diff --git a/plugins/feature/map/Cesium/Cesium.js b/plugins/feature/map/Cesium/Cesium.js index bf49bfd2b..6c8a61ce4 100644 --- a/plugins/feature/map/Cesium/Cesium.js +++ b/plugins/feature/map/Cesium/Cesium.js @@ -23,7 +23,7 @@ * See https://github.com/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details. */ -"use strict";var Cesium=(()=>{var YYe=Object.create;var OA=Object.defineProperty;var MYe=Object.getOwnPropertyDescriptor;var wYe=Object.getOwnPropertyNames;var kYe=Object.getPrototypeOf,UYe=Object.prototype.hasOwnProperty;var DYe=(e,t,n)=>t in e?OA(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var $5=(e=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(e,{get:(t,n)=>(typeof require<"u"?require:t)[n]}):e)(function(e){if(typeof require<"u")return require.apply(this,arguments);throw Error('Dynamic require of "'+e+'" is not supported')});var Xs=(e,t,n)=>()=>{if(n)throw n[0];try{return e&&(t=e(e=0)),t}catch(i){throw n=[i],i}};var gm=(e,t)=>()=>{try{return t||e((t={exports:{}}).exports,t),t.exports}catch(n){throw t=0,n}},Cle=(e,t)=>{for(var n in t)OA(e,n,{get:t[n],enumerable:!0})},Vle=(e,t,n,i)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of wYe(t))!UYe.call(e,o)&&o!==n&&OA(e,o,{get:()=>t[o],enumerable:!(i=MYe(t,o))||i.enumerable});return e};var x=(e,t,n)=>(n=e!=null?YYe(kYe(e)):{},Vle(t||!e||!e.__esModule?OA(n,"default",{value:e,enumerable:!0}):n,e)),OYe=e=>Vle(OA({},"__esModule",{value:!0}),e);var mt=(e,t,n)=>DYe(e,typeof t!="symbol"?t+"":t,n);var T=gm(()=>{"use strict";globalThis.CESIUM_WORKERS=atob("dmFyIENlc2l1bVdvcmtlcnM9KCgpPT57dmFyIG9DPU9iamVjdC5jcmVhdGU7dmFyIF9mPU9iamVjdC5kZWZpbmVQcm9wZXJ0eTt2YX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oLm1heChlLncsdC53KSxvfXN0YXRpYyBjbGFtcChlLHQsbyxhKXtsZXQgcj1rLmNsYW1wKGUueCx0Lngsby54KSxpPWsuY2xhbXAoZS55LHQueSxvLnkpLGY9ay5jbGFtcChlLnosdC56LG8ueiksZD1rLmNsYW1wKGUudyx0Lncsby53KTtyZXR1cm4gYS54PXIsYS55PWksYS56PWYsYS53PWQsYX1zdGF0aWMgbWFnbml0dWRlU3F1YXJlZChlKXtyZXR1cm4gZS54KmUueCtlLnkqZS55K2UueiplLnorZS53KmUud31zdGF0aWMgbWFnbml0dWRlKGUpe3JldHVybiBNYXRoLnNxcnQobi5tYWduaXR1ZGVTcXVhcmVkKGUpKX1zdGF0aWMgZGlzdGFuY2UoZSx0KXtyZXR1cm4gbi5zdWJ0cmFjdChlLHQsZmwpLG4ubWFnbml0dWRlKGZsKX1zdGF0aWMgZGlzdGFuY2VTcXVhcmVkKGUsdCl7cmV0dXJuIG4uc3VidHJhY3QoZSx0LGZsKSxuLm1hZ25pdHVkZVNxdWFyZWQoZmwpfXN0YXRpYyBub3JtYWxpemUoZSx0KXtsZXQgbz1uLm1hZ25pdHVkZShlKTtyZXR1cm4gdC54PWUueC9vLHQueT1lLnkvbyx0Lno9ZS56L28sdC53PWUudy9vLHR9c3RhdGljIGRvdChlLHQpe3JldHVybiBlLngqdC54K2UueSp0LnkrZS56KnQueitlLncqdC53fXN0YXRpYyBtdWx0aXBseUNvbXBvbmVudHMoZSx0LG8pe3JldHVybiBvLng9ZS54KnQueCxvLnk9ZS55KnQueSxvLno9ZS56KnQueixvLnc9ZS53KnQudyxvfXN0YXRpYyBkaXZpZGVDb21wb25lbnRzKGUsdCxvKXtyZXR1cm4gby54PWUueC90Lngsby55PWUueS90Lnksby56PWUuei90Lnosby53PWUudy90Lncsb31zdGF0aWMgYWRkKGUsdCxvKXtyZXR1cm4gby54PWUueCt0Lngsby55PWUueSt0Lnksby56PWUueit0Lnosby53PWUudyt0Lncsb31zdGF0aWMgc3VidHJh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pO2xldCBQPXMuYWRkKEksTixSMyk7RS5wb3NpdGlvbi52YWx1ZXMucHVzaChfLngsXy55LF8ueixfLngsXy55LF8ueiksRS5wb3NpdGlvbi52YWx1ZXMucHVzaChQLngsUC55LFAueiksRS5wb3NpdGlvbi52YWx1ZXMucHVzaChQLngsUC55LFAueiksRS5wcmV2UG9zaXRpb24udmFsdWVzLnB1c2goYVt5KjNdLGFbeSozKzFdLGFbeSozKzJdKSxFLnByZXZQb3NpdGlvbi52YWx1ZXMucHVzaChhW3kqMyszXSxhW3kqMys0XSxhW3kqMys1XSksRS5wcmV2UG9zaXRpb24udmFsdWVzLnB1c2goXy54LF8ueSxfLnosXy54LF8ueSxfLnopLEUubmV4dFBvc2l0aW9uLnZhbHVlcy5wdXNoKFAueCxQLnksUC56KSxFLm5leHRQb3NpdGlvbi52YWx1ZXMucHVzaChQLngsUC55LFAueiksRS5uZXh0UG9zaXRpb24udmFsdWVzLnB1c2goUC54LFAueSxQLnopLEUubmV4dFBvc2l0aW9uLnZhbHVlcy5wdXNoKFAueCxQLnksUC56KSxzLm5lZ2F0ZShOLE4pLHMuYWRkKEksTixQKSxTLnBvc2l0aW9uLnZhbHVlcy5wdXNoKFAueCxQLnksUC56KSxTLnBvc2l0aW9uLnZhbHVlcy5wdXNoKFAueCxQLnksUC56KSxTLnBvc2l0aW9uLnZhbHVlcy5wdXNoKFQueCxULnksVC56LFQueCxULnksVC56KSxTLnByZXZQb3NpdGlvbi52YWx1ZXMucHVzaChQLngsUC55LFAueiksUy5wcmV2UG9zaXRpb24udmFsdWVzLnB1c2goUC54LFAueSxQLnopLFMucHJldlBvc2l0aW9uLnZhbHVlcy5wdXNoKFAueCxQLnksUC56KSxTLnByZXZQb3NpdGlvbi52YWx1ZXMucHVzaChQLngsUC55LFAueiksUy5uZXh0UG9zaXRpb24udmFsdWVzLnB1c2goVC54LFQueSxULnosVC54LFQueSxULnopLFMubmV4dFBvc2l0aW9uLnZhbHVlcy5wdXNoKHJbdyozXSx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TVdPTgsclsxNl09MTAsclsxN109MTEsclsxOF09MTQsclsxOV09MTMsclsyMF09MTIsclsyMV09MTUsclsyMl09MTQsclsyM109MTIsclsyNF09MTgsclsyNV09MTcsclsyNl09MTYsclsyN109MTksclsyOF09MTgsclsyOV09MTYsclszMF09MjAsclszMV09MjEsclszMl09MjIsclszM109MjAsclszNF09MjIsclszNV09MjN9ZWxzZSBpPW5ldyBGbG9hdDY0QXJyYXkoMjQpLGlbMF09ZS54LGlbMV09ZS55LGlbMl09ZS56LGlbM109dC54LGlbNF09ZS55LGlbNV09ZS56LGlbNl09dC54LGlbN109dC55LGlbOF09ZS56LGlbOV09ZS54LGlbMTBdPXQueSxpWzExXT1lLnosaVsxMl09ZS54LGlbMTNdPWUueSxpWzE0XT10LnosaVsxNV09dC54LGlbMTZdPWUueSxpWzE3XT10LnosaVsxOF09dC54LGlbMTldPXQueSxpWzIwXT10LnosaVsyMV09ZS54LGlbMjJdPXQueSxpWzIzXT10LnosYS5wb3NpdGlvbj1uZXcgaWUoe2NvbXBvbmVudERhdGF0eXBlOm5lLkRPVUJMRSxjb21wb25lbnRzUGVyQXR0cmlidXRlOjMsdmFsdWVzOml9KSxyPW5ldyBVaW50MTZBcnJheSgzNiksclswXT00LHJbMV09NSxyWzJdPTYsclszXT00LHJbNF09NixyWzVdPTcscls2XT0xLHJbN109MCxyWzhdPTMscls5XT0xLHJbMTBdPTMsclsxMV09MixyWzEyXT0xLHJbMTNdPTYsclsxNF09NSxyWzE1XT0xLHJbMTZdPTIsclsxN109NixyWzE4XT0yLHJbMTldPTMsclsyMF09NyxyWzIxXT0yLHJbMjJdPTcsclsyM109NixyWzI0XT0zLHJbMjVdPTAsclsyNl09NCxyWzI3XT0zLHJbMjhdPTQsclsyOV09NyxyWzMwXT0wLHJbMzFdPTEsclszMl09NSxyWzMzXT0wLHJbMzRdPTUsclszNV09NDtsZXQgZj1zLnN1YnRyYWN0KHQsZSxMMyksZD1zLm1hZ25pdHVkZShmKSouNTtpZ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wi5tdWx0aXBseUJ5VmVjdG9yKEMsRCxYcCksVj1FLnByb2plY3QoZi5jYXJ0ZXNpYW5Ub0NhcnRvZ3JhcGhpYyhHLGdoKSxZcCk7cy5zdWJ0cmFjdChWLFIsViksJG4ueD0oVi54K3IpLygyKnIpLCRuLnk9KFYueStpKS8oMippKSxOLng9TWF0aC5taW4oJG4ueCxOLngpLE4ueT1NYXRoLm1pbigkbi55LE4ueSksUC54PU1hdGgubWF4KCRuLngsUC54KSxQLnk9TWF0aC5tYXgoJG4ueSxQLnkpLHQmJihsW3kreF09JG4ueCxsW3krMSt4XT0kbi55KSxsW3krK109JG4ueCxsW3krK109JG4ueX0oby5ub3JtYWx8fG8udGFuZ2VudHx8by5iaXRhbmdlbnR8fHUpJiYodz1mLmdlb2RldGljU3VyZmFjZU5vcm1hbChELHcpLHUmJihwW3YrQV09LXcueCxwW1UrQV09LXcueSxwW0wrQV09LXcueiksKG8ubm9ybWFsfHxvLnRhbmdlbnR8fG8uYml0YW5nZW50KSYmKChvLnRhbmdlbnR8fG8uYml0YW5nZW50KSYmKF89cy5ub3JtYWxpemUocy5jcm9zcyhzLlVOSVRfWix3LF8pLF8pLFoubXVsdGlwbHlCeVZlY3RvcihJLF8sXykpLG8ubm9ybWFsJiYobVt2XT13LngsbVtVXT13LnksbVtMXT13LnosdCYmKG1bditBXT0tdy54LG1bVStBXT0tdy55LG1bTCtBXT0tdy56KSksby50YW5nZW50JiYoaFt2XT1fLngsaFtVXT1fLnksaFtMXT1fLnosdCYmKGhbditBXT0tXy54LGhbVStBXT0tXy55LGhbTCtBXT0tXy56KSksby5iaXRhbmdlbnQmJihUPXMubm9ybWFsaXplKHMuY3Jvc3ModyxfLFQpLFQpLGJbdl09VC54LGJbVV09VC55LGJbTF09VC56LHQmJihiW3YrQV09VC54LGJbVStBXT1ULnksYltMK0FdPVQueikpKSl9aWYoby5zdCl7Rj1sLmxlbmd0aDtmb3IobGV0IHY9MDt2PEY7dis9MilsW3ZdPShsW3Z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ubmV4dDtmb3IoO2IhPT1lOyl7aWYoYi54Pj11JiZiLng8PW0mJmIueT49bCYmYi55PD1oJiZXZihhLGYscixkLGksYyxiLngsYi55KSYmRm4oYi5wcmV2LGIsYi5uZXh0KT49MClyZXR1cm4hMTtiPWIubmV4dH1yZXR1cm4hMH1mdW5jdGlvbiBmayhuLGUsdCxvKXtsZXQgYT1uLnByZXYscj1uLGk9bi5uZXh0O2lmKEZuKGEscixpKT49MClyZXR1cm4hMTtsZXQgZj1hLngsZD1yLngsYz1pLngsdT1hLnksbD1yLnksbT1pLnksaD1NYXRoLm1pbihmLGQsYyksYj1NYXRoLm1pbih1LGwsbSkscD1NYXRoLm1heChmLGQsYykseT1NYXRoLm1heCh1LGwsbSksdz1mMChoLGIsZSx0LG8pLF89ZjAocCx5LGUsdCxvKSxUPW4ucHJldlosRT1uLm5leHRaO2Zvcig7VCYmVC56Pj13JiZFJiZFLno8PV87KXtpZihULng+PWgmJlQueDw9cCYmVC55Pj1iJiZULnk8PXkmJlQhPT1hJiZUIT09aSYmV2YoZix1LGQsbCxjLG0sVC54LFQueSkmJkZuKFQucHJldixULFQubmV4dCk+PTB8fChUPVQucHJldlosRS54Pj1oJiZFLng8PXAmJkUueT49YiYmRS55PD15JiZFIT09YSYmRSE9PWkmJldmKGYsdSxkLGwsYyxtLEUueCxFLnkpJiZGbihFLnByZXYsRSxFLm5leHQpPj0wKSlyZXR1cm4hMTtFPUUubmV4dFp9Zm9yKDtUJiZULno+PXc7KXtpZihULng+PWgmJlQueDw9cCYmVC55Pj1iJiZULnk8PXkmJlQhPT1hJiZUIT09aSYmV2YoZix1LGQsbCxjLG0sVC54LFQueSkmJkZuKFQucHJldixULFQubmV4dCk+PTApcmV0dXJuITE7VD1ULnByZXZafWZvcig7RSYmRS56PD1fOyl7aWYoRS54Pj1oJiZFLng8PXAmJkUueT49YiYmRS55PD15JiZFIT09YSYmRSE9PWkmJldmKGYsdSxkLGwsYyxtLEUueCxFLnkpJiZGbihFLnByZX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ytdPUEueCxsW0krK109QS55LGxbSSsrXT1BLnosbFtJKytdPUEueCxsW0krK109QS55LGxbSSsrXT1BLnopLGEudGFuZ2VudCYmKG1bTisrXT1NLngsbVtOKytdPU0ueSxtW04rK109TS56LG1bTisrXT1NLngsbVtOKytdPU0ueSxtW04rK109TS56KSxhLmJpdGFuZ2VudCYmKHY9cy5ub3JtYWxpemUocy5jcm9zcyhBLE0sdiksdiksaFtQKytdPXYueCxoW1ArK109di55LGhbUCsrXT12LnosaFtQKytdPXYueCxoW1ArK109di55LGhbUCsrXT12LnopKX1mb3IoYj0wO2I8cjtiKyspYS5ub3JtYWwmJihsW0krK109MCxsW0krK109MCxsW0krK109LTEpLGEudGFuZ2VudCYmKG1bTisrXT0xLG1bTisrXT0wLG1bTisrXT0wKSxhLmJpdGFuZ2VudCYmKGhbUCsrXT0wLGhbUCsrXT0tMSxoW1ArK109MCk7Zm9yKGI9MDtiPHI7YisrKWEubm9ybWFsJiYobFtJKytdPTAsbFtJKytdPTAsbFtJKytdPTEpLGEudGFuZ2VudCYmKG1bTisrXT0xLG1bTisrXT0wLG1bTisrXT0wKSxhLmJpdGFuZ2VudCYmKGhbUCsrXT0wLGhbUCsrXT0xLGhbUCsrXT0wKX1sZXQgeT0xMipyLTEyLHc9SWUuY3JlYXRlVHlwZWRBcnJheShkLHkpLF89MCxUPTA7Zm9yKGI9MDtiPHItMTtiKyspd1tfKytdPVQsd1tfKytdPVQrMix3W18rK109VCszLHdbXysrXT1ULHdbXysrXT1UKzMsd1tfKytdPVQrMSxUKz0yO2Zvcih3W18rK109aS0yLHdbXysrXT0wLHdbXysrXT0xLHdbXysrXT1pLTIsd1tfKytdPTEsd1tfKytdPWktMSxiPTE7YjxyLTE7YisrKXdbXysrXT1pK2IrMSx3W18rK109aStiLHdbXysrXT1pO2ZvcihiPTE7YjxyLTE7YisrKXdbXysrXT1mLHdbXysrXT1mK2Isd1tfKytdPWYrYisxO2xldCBFPTA7aWYoYS5zdCl7bGV0IEM9T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SYmbCE9PTAmJmwhPT15LTEmJihQW0pdPSEwKSxKKys7bT0wO2xldCByZSxzZTtmb3IodT0xO3U8cC0yO3UrKylmb3IocmU9dSp5LHNlPSh1KzEpKnksbD0xO2w8eS0yO2wrKyl4W20rK109c2UrbCx4W20rK109c2UrbCsxLHhbbSsrXT1yZStsKzEseFttKytdPXNlK2wseFttKytdPXJlK2wrMSx4W20rK109cmUrbDtpZihUKXtsZXQgWmU9cCp5O2Zvcih1PTE7dTxwLTI7dSsrKWZvcihyZT1aZSt1Knksc2U9WmUrKHUrMSkqeSxsPTE7bDx5LTI7bCsrKXhbbSsrXT1zZStsLHhbbSsrXT1yZStsLHhbbSsrXT1yZStsKzEseFttKytdPXNlK2wseFttKytdPXJlK2wrMSx4W20rK109c2UrbCsxfWxldCBvZSxjZTtpZihUKXtpZihFKWZvcihjZT1wKnksdT0xO3U8eS0yO3UrKyl4W20rK109dSx4W20rK109dSsxLHhbbSsrXT1jZSt1KzEseFttKytdPXUseFttKytdPWNlK3UrMSx4W20rK109Y2UrdTtpZihSKWZvcihvZT1wKnkteSxjZT1wKnkqXy15LHU9MTt1PHktMjt1KyspeFttKytdPW9lK3UrMSx4W20rK109b2UrdSx4W20rK109Y2UrdSx4W20rK109b2UrdSsxLHhbbSsrXT1jZSt1LHhbbSsrXT1jZSt1KzF9aWYoUyl7Zm9yKHU9MTt1PHAtMjt1KyspY2U9eSpwK3kqdSxvZT15KnUseFttKytdPWNlLHhbbSsrXT1vZSt5LHhbbSsrXT1vZSx4W20rK109Y2UseFttKytdPWNlK3kseFttKytdPW9lK3k7Zm9yKHU9MTt1PHAtMjt1KyspY2U9eSpwK3kqKHUrMSktMSxvZT15Kih1KzEpLTEseFttKytdPW9lK3kseFttKytdPWNlLHhbbSsrXT1vZSx4W20rK109b2UreSx4W20rK109Y2UreSx4W20rK109Y2V9bGV0IG1lPW5ldyBRZTtmLnBvc2l0aW9uJiYobWUucG9zaXRpb249bmV3IGllKHtjb21wb25lbnREYXRhd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LHIucHVzaCgwKSxyLnB1c2goMiksci5wdXNoKGwpKSx1IT09MSYmKHIucHVzaCgtMSksci5wdXNoKDApLHIucHVzaCgxKSxyLnB1c2godSkpKTpmPyhtPShuLW8pLyhhLW8pLGg9KG4tbykvKHQtbyksci5wdXNoKDIpLHIucHVzaCgwKSxoIT09MSYmKHIucHVzaCgtMSksci5wdXNoKDEpLHIucHVzaCgwKSxyLnB1c2goaCkpLG0hPT0xJiYoci5wdXNoKC0xKSxyLnB1c2goMSksci5wdXNoKDIpLHIucHVzaChtKSkpOmQmJihiPShuLWEpLyh0LWEpLHA9KG4tYSkvKG8tYSksci5wdXNoKDApLHIucHVzaCgxKSxwIT09MSYmKHIucHVzaCgtMSksci5wdXNoKDIpLHIucHVzaCgxKSxyLnB1c2gocCkpLGIhPT0xJiYoci5wdXNoKC0xKSxyLnB1c2goMiksci5wdXNoKDApLHIucHVzaChiKSkpOmM9PT0yPyFpJiZ0IT09bj8oaD0obi1vKS8odC1vKSxiPShuLWEpLyh0LWEpLHIucHVzaCgwKSxyLnB1c2goLTEpLHIucHVzaCgxKSxyLnB1c2goMCksci5wdXNoKGgpLHIucHVzaCgtMSksci5wdXNoKDIpLHIucHVzaCgwKSxyLnB1c2goYikpOiFmJiZvIT09bj8ocD0obi1hKS8oby1hKSx1PShuLXQpLyhvLXQpLHIucHVzaCgxKSxyLnB1c2goLTEpLHIucHVzaCgyKSxyLnB1c2goMSksci5wdXNoKHApLHIucHVzaCgtMSksci5wdXNoKDApLHIucHVzaCgxKSxyLnB1c2godSkpOiFkJiZhIT09biYmKGw9KG4tdCkvKGEtdCksbT0obi1vKS8oYS1vKSxyLnB1c2goMiksci5wdXNoKC0xKSxyLnB1c2goMCksci5wdXNoKDIpLHIucHVzaChsKSxyLnB1c2goLTEpLHIucHVzaCgxKSxyLnB1c2goMiksci5wdXNoKG0pKTpjIT09MyYmKHIucHVzaCgwKSxyLnB1c2goMSksci5wdXNoKDIpKSxyfTtLbS5jb21wdXRlQmFy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ZSgpLnRoZW4oKCk9PkUxKCkpfTtyZXR1cm4gZkMoWUcpO30pKCk7Cg==")});var eD=gm((N3t,Ele)=>{var Y3t=x(T()),j0=function(e){e==null&&(e=new Date().getTime()),this.N=624,this.M=397,this.MATRIX_A=2567483615,this.UPPER_MASK=2147483648,this.LOWER_MASK=2147483647,this.mt=new Array(this.N),this.mti=this.N+1,e.constructor==Array?this.init_by_array(e,e.length):this.init_seed(e)};j0.prototype.init_seed=function(e){for(this.mt[0]=e>>>0,this.mti=1;this.mti>>30;this.mt[this.mti]=(((e&4294901760)>>>16)*1812433253<<16)+(e&65535)*1812433253+this.mti,this.mt[this.mti]>>>=0}};j0.prototype.init_by_array=function(e,t){var n,i,o;for(this.init_seed(19650218),n=1,i=0,o=this.N>t?this.N:t;o;o--){var r=this.mt[n-1]^this.mt[n-1]>>>30;this.mt[n]=(this.mt[n]^(((r&4294901760)>>>16)*1664525<<16)+(r&65535)*1664525)+e[i]+i,this.mt[n]>>>=0,n++,i++,n>=this.N&&(this.mt[0]=this.mt[this.N-1],n=1),i>=t&&(i=0)}for(o=this.N-1;o;o--){var r=this.mt[n-1]^this.mt[n-1]>>>30;this.mt[n]=(this.mt[n]^(((r&4294901760)>>>16)*1566083941<<16)+(r&65535)*1566083941)-n,this.mt[n]>>>=0,n++,n>=this.N&&(this.mt[0]=this.mt[this.N-1],n=1)}this.mt[0]=2147483648};j0.prototype.random_int=function(){var e,t=new Array(0,this.MATRIX_A);if(this.mti>=this.N){var n;for(this.mti==this.N+1&&this.init_seed(5489),n=0;n>>1^t[e&1];for(;n>>1^t[e&1];e=this.mt[this.N-1]&this.UPPER_MASK|this.mt[0]&this.LOWER_MASK,this.mt[this.N-1]=this.mt[this.M-1]^e>>>1^t[e&1],this.mti=0}return e=this.mt[this.mti++],e^=e>>>11,e^=e<<7&2636928640,e^=e<<15&4022730752,e^=e>>>18,e>>>0};j0.prototype.random_int31=function(){return this.random_int()>>>1};j0.prototype.random_incl=function(){return this.random_int()*(1/4294967295)};j0.prototype.random=function(){return this.random_int()*(1/4294967296)};j0.prototype.random_excl=function(){return(this.random_int()+.5)*(1/4294967296)};j0.prototype.random_long=function(){var e=this.random_int()>>>5,t=this.random_int()>>>6;return(e*67108864+t)*(1/9007199254740992)};Ele.exports=j0});var sde=gm((e1,t1)=>{var pKt=x(T());/*! https://mths.be/punycode v1.4.0 by @mathias */(function(e){var t=typeof e1=="object"&&e1&&!e1.nodeType&&e1,n=typeof t1=="object"&&t1&&!t1.nodeType&&t1,i=typeof global=="object"&&global;(i.global===i||i.window===i||i.self===i)&&(e=i);var o,r=2147483647,s=36,a=1,c=26,d=38,u=700,m=72,p=128,b="-",f=/^xn--/,y=/[^\x20-\x7E]/,_=/[\x2E\u3002\uFF0E\uFF61]/g,S={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},Z=s-a,R=Math.floor,C=String.fromCharCode,E;function A(M){throw new RangeError(S[M])}function L(M,O){for(var w=M.length,z=[];w--;)z[w]=O(M[w]);return z}function F(M,O){var w=M.split("@"),z="";w.length>1&&(z=w[0]+"@",M=w[1]),M=M.replace(_,".");var K=M.split("."),te=L(K,O).join(".");return z+te}function I(M){for(var O=[],w=0,z=M.length,K,te;w=55296&&K<=56319&&w65535&&(O-=65536,w+=C(O>>>10&1023|55296),O=56320|O&1023),w+=C(O),w}).join("")}function g(M){return M-48<10?M-22:M-65<26?M-65:M-97<26?M-97:s}function V(M,O){return M+22+75*(M<26)-((O!=0)<<5)}function G(M,O,w){var z=0;for(M=w?R(M/u):M>>1,M+=R(M/O);M>Z*c>>1;z+=s)M=R(M/Z);return R(z+(Z+1)*M/(M+d))}function v(M){var O=[],w=M.length,z,K=0,te=p,H=m,$,ee,le,_e,he,Ze,ye,Ge,Ae;for($=M.lastIndexOf(b),$<0&&($=0),ee=0;ee<$;++ee)M.charCodeAt(ee)>=128&&A("not-basic"),O.push(M.charCodeAt(ee));for(le=$>0?$+1:0;le=w&&A("invalid-input"),ye=g(M.charCodeAt(le++)),(ye>=s||ye>R((r-K)/he))&&A("overflow"),K+=ye*he,Ge=Ze<=H?a:Ze>=H+c?c:Ze-H,!(yeR(r/Ae)&&A("overflow"),he*=Ae;z=O.length+1,H=G(K-_e,z,_e==0),R(K/z)>r-te&&A("overflow"),te+=R(K/z),K%=z,O.splice(K++,0,te)}return N(O)}function X(M){var O,w,z,K,te,H,$,ee,le,_e,he,Ze=[],ye,Ge,Ae,Fe;for(M=I(M),ye=M.length,O=p,w=0,te=m,H=0;H=O&&he<$&&($=he);for(Ge=z+1,$-O>R((r-w)/Ge)&&A("overflow"),w+=($-O)*Ge,O=$,H=0;Hr&&A("overflow"),he==O){for(ee=w,le=s;_e=le<=te?a:le>=te+c?c:le-te,!(ee<_e);le+=s)Fe=ee-_e,Ae=s-_e,Ze.push(C(V(_e+Fe%Ae,0))),ee=R(Fe/Ae);Ze.push(C(V(ee,0))),te=G(w,Ge,z==K),w=0,++z}++w,++O}return Ze.join("")}function Y(M){return F(M,function(O){return f.test(O)?v(O.slice(4).toLowerCase()):O})}function D(M){return F(M,function(O){return y.test(O)?"xn--"+X(O):O})}if(o={version:"1.3.2",ucs2:{decode:I,encode:N},decode:v,encode:X,toASCII:D,toUnicode:Y},typeof define=="function"&&typeof define.amd=="object"&&define.amd)define("punycode",function(){return o});else if(t&&n)if(t1.exports==t)n.exports=o;else for(E in o)o.hasOwnProperty(E)&&(t[E]=o[E]);else e.punycode=o})(e1)});var cde=gm((ade,TD)=>{var bKt=x(T());/*! +"use strict";var Cesium=(()=>{var MYe=Object.create;var OA=Object.defineProperty;var wYe=Object.getOwnPropertyDescriptor;var kYe=Object.getOwnPropertyNames;var UYe=Object.getPrototypeOf,DYe=Object.prototype.hasOwnProperty;var OYe=(e,t,n)=>t in e?OA(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var $5=(e=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(e,{get:(t,n)=>(typeof require<"u"?require:t)[n]}):e)(function(e){if(typeof require<"u")return require.apply(this,arguments);throw Error('Dynamic require of "'+e+'" is not supported')});var Xs=(e,t,n)=>()=>{if(n)throw n[0];try{return e&&(t=e(e=0)),t}catch(i){throw n=[i],i}};var bm=(e,t)=>()=>{try{return t||e((t={exports:{}}).exports,t),t.exports}catch(n){throw t=0,n}},Cle=(e,t)=>{for(var n in t)OA(e,n,{get:t[n],enumerable:!0})},Vle=(e,t,n,i)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of kYe(t))!DYe.call(e,o)&&o!==n&&OA(e,o,{get:()=>t[o],enumerable:!(i=wYe(t,o))||i.enumerable});return e};var x=(e,t,n)=>(n=e!=null?MYe(UYe(e)):{},Vle(t||!e||!e.__esModule?OA(n,"default",{value:e,enumerable:!0}):n,e)),BYe=e=>Vle(OA({},"__esModule",{value:!0}),e);var mt=(e,t,n)=>OYe(e,typeof t!="symbol"?t+"":t,n);var T=bm(()=>{"use strict";globalThis.CESIUM_WORKERS=atob("dmFyIENlc2l1bVdvcmtlcnM9KCgpPT57dmFyIG9DPU9iamVjdC5jcmVhdGU7dmFyIF9mPU9iamVjdC5kZWZpbmVQcm9wZXJ0eTt2YXIgYUM9T2JqZWN0LmdldE93blByb3BlcnR5RGVzY3JpcHRvcjt2YXIgckM9T2JqZWN0LmdldE93blByb3BlcnR5TmFtZXM7dmFyIGlDPU9iamVjdC5nZXRQcm90b3R5cGVPZixjQz1PYmplY3QucHJvdG90eXBlLmhhc093blByb3BlcnR5O3ZhciBzQz0obixlLHQpPT5lIGluIG4/X2YobixlLHtlbnVtZXJhYmxlOiEwLGNvbmZpZ3VyYWJsZTohMCx3cml0YWJsZTohMCx2YWx1ZTp0fSk6bltlXT10O3ZhciBsYT0obj0+dHlwZW9mIHJlcXVpcmU8InUiP3JlcXVpcmU6dHlwZW9mIFByb3h5PCJ1Ij9uZXcgUHJveHkobix7Z2V0OihlLHQpPT4odHlwZW9mIHJlcXVpcmU8InUiP3JlcXVpc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yKjQpO3JldHVybiB0fXN0YXRpYyB1bnBhY2tBcnJheShlLHQpe2xldCBvPWUubGVuZ3RoO2codCk/dC5sZW5ndGg9by80OnQ9bmV3IEFycmF5KG8vNCk7Zm9yKGxldCBhPTA7YTxvO2ErPTQpe2xldCByPWEvNDt0W3JdPW4udW5wYWNrKGUsYSx0W3JdKX1yZXR1cm4gdH1zdGF0aWMgbWF4aW11bUNvbXBvbmVudChlKXtyZXR1cm4gTWF0aC5tYXgoZS54LGUueSxlLnosZS53KX1zdGF0aWMgbWluaW11bUNvbXBvbmVudChlKXtyZXR1cm4gTWF0aC5taW4oZS54LGUueSxlLnosZS53KX1zdGF0aWMgbWluaW11bUJ5Q29tcG9uZW50KGUsdCxvKXtyZXR1cm4gby54PU1hdGgubWluKGUueCx0LngpLG8ueT1NYXRoLm1pbihlLnksdC55KSxvLno9TWF0aC5taW4oZS56LHQueiksby53PU1hdGgubWluKGUudyx0LncpLG99c3RhdGljIG1heGltdW1CeUNvbXBvbmVudChlLHQsbyl7cmV0dXJuIG8ueD1NYXRoLm1heChlLngsdC54KSxvLnk9TWF0aC5tYXgoZS55LHQueSksby56PU1hdGgubWF4KGUueix0LnopLG8udz1NYXRoLm1heChlLncsdC53KSxvfXN0YXRpYyBjbGFtcChlLHQsbyxhKXtsZXQgcj1rLmNsYW1wKGUueCx0Lngsby54KSxpPWsuY2xhbXAoZS55LHQueSxvLnkpLGY9ay5jbGFtcChlLnosdC56LG8ueiksZD1rLmNsYW1wKGUudyx0Lncsby53KTtyZXR1cm4gYS54PXIsYS55PWksYS56PWYsYS53PWQsYX1zdGF0aWMgbWFnbml0dWRlU3F1YXJlZChlKXtyZXR1cm4gZS54KmUueCtlLnkqZS55K2UueiplLnorZS53KmUud31zdGF0aWMgbWFnbml0dWRlKGUpe3JldHVybiBNYXRoLnNxcnQobi5tYWduaXR1ZGVTcXVhcmVkKGUpKX1zdGF0aWMgZGlzdGFuY2UoZSx0KXtyZXR1cm4gbi5zdWJ0cmFjdChlLHQsZmwpLG4ubWFnbml0dWRlKGZsKX1zdGF0aWMgZGlzdGFuY2VTcXVhcmVkKGUsdCl7cmV0dXJuIG4uc3VidHJhY3QoZSx0LGZsKSxuLm1hZ25pdHVkZVNxdWFyZWQoZmwpfXN0YXRpYyBub3JtYWxpemUoZSx0KXtsZXQgbz1uLm1hZ25pdHVkZShlKTtyZXR1cm4gdC54PWUueC9vLHQueT1lLnkvbyx0Lno9ZS56L28sdC53PWUudy9vLHR9c3RhdGljIGRvdChlLHQpe3JldHVybiBlLngqdC54K2UueSp0LnkrZS56KnQueitlLncqdC53fXN0YXRpYyBtdWx0aXBseUNvbXBvbmVudHMoZSx0LG8pe3JldHVybiBvLng9ZS54KnQueCxvLnk9ZS55KnQueSxvLno9ZS56KnQueixvLnc9ZS53KnQudyxvfXN0YXRpYyBkaXZpZGVDb21wb25lbnRzKGUsdCxvKXtyZXR1cm4gby54PWUueC90Lngsby55PWUueS90Lnksby56PWUuei90Lnosby53PWUudy90Lncsb31zdGF0aWMgYWRkKGUsdCxvKXtyZXR1cm4gby54PWUueCt0Lngsby55PWUueSt0Lnksby56PWUueit0Lnosby53PWUudyt0Lncsb31zdGF0aWMgc3VidHJhY3QoZSx0LG8pe3JldHVybiBvLng9ZS54LXQueCxvLnk9ZS55LXQueSxvLno9ZS56LXQueixvLnc9ZS53LXQudyxvfXN0YXRpYyBtdWx0aXBseUJ5U2NhbGFyKGUsdCxvKXtyZXR1cm4gby54PWUueCp0LG8ueT1lLnkqdCxvLno9ZS56KnQsby53PWUudyp0LG99c3RhdGljIGRpdmlkZUJ5U2NhbGFyKGUsdCxvKXtyZXR1cm4gby54PWUueC90LG8ueT1lLnkvdCxvLno9ZS56L3Qsby53PWUudy90LG99c3RhdGljIG5lZ2F0ZShlLHQpe3JldHVybiB0Lng9LWUueCx0Lnk9LWUueSx0Lno9LWUueix0Lnc9LWUudyx0fXN0YXRpYyBhYnMoZSx0KXtyZXR1cm4gdC54PU1hdGguYWJzKGUueCksd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CxjWzM4XT0xLGNbMzldPTAsY1s0MF09MCxjWzQxXT0xLGNbNDJdPTAsY1s0M109MCxjWzQ0XT0xLGNbNDVdPTAsY1s0Nl09MCxjWzQ3XT0xLGNbNDhdPTAsY1s0OV09MCxjWzUwXT0xLGNbNTFdPTAsY1s1Ml09MCxjWzUzXT0xLGNbNTRdPTAsY1s1NV09MCxjWzU2XT0xLGNbNTddPTAsY1s1OF09MCxjWzU5XT0xLGNbNjBdPTAsY1s2MV09MCxjWzYyXT0xLGNbNjNdPTAsY1s2NF09MCxjWzY1XT0xLGNbNjZdPTAsY1s2N109MCxjWzY4XT0xLGNbNjldPTAsY1s3MF09MCxjWzcxXT0xLGEuYml0YW5nZW50PW5ldyBpZSh7Y29tcG9uZW50RGF0YXR5cGU6bmUuRkxPQVQsY29tcG9uZW50c1BlckF0dHJpYnV0ZTozLHZhbHVlczpjfSl9cj1uZXcgVWludDE2QXJyYXkoMzYpLHJbMF09MCxyWzFdPTEsclsyXT0yLHJbM109MCxyWzRdPTIscls1XT0zLHJbNl09NixyWzddPTUscls4XT00LHJbOV09NyxyWzEwXT02LHJbMTFdPTQsclsxMl09OCxyWzEzXT05LHJbMTRdPTEwLHJbMTVdPTgsclsxNl09MTAsclsxN109MTEsclsxOF09MTQsclsxOV09MTMsclsyMF09MTIsclsyMV09MTUsclsyMl09MTQsclsyM109MTIsclsyNF09MTgsclsyNV09MTcsclsyNl09MTYsclsyN109MTksclsyOF09MTgsclsyOV09MTYsclszMF09MjAsclszMV09MjEsclszMl09MjIsclszM109MjAsclszNF09MjIsclszNV09MjN9ZWxzZSBpPW5ldyBGbG9hdDY0QXJyYXkoMjQpLGlbMF09ZS54LGlbMV09ZS55LGlbMl09ZS56LGlbM109dC54LGlbNF09ZS55LGlbNV09ZS56LGlbNl09dC54LGlbN109dC55LGlbOF09ZS56LGlbOV09ZS54LGlbMTBdPXQueSxpWzExXT1lLnosaVsxMl09ZS54LGlbMTNdPWUueSxpWzE0XT10LnosaVsxNV09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2UucmVzb2x2ZSgpLnRoZW4oKCk9PnB5KCkpfSxVRz0oKT0+e1Byb21pc2UucmVzb2x2ZSgpLnRoZW4oKCk9Pnl5KCkpfSxqRz0oKT0+e1Byb21pc2UucmVzb2x2ZSgpLnRoZW4oKCk9Pnh5KCkpfSxMRz0oKT0+e1Byb21pc2UucmVzb2x2ZSgpLnRoZW4oKCk9PiR5KCkpfSx6Rz0oKT0+e1Byb21pc2UucmVzb2x2ZSgpLnRoZW4oKCk9PmExKCkpfSxHRz0oKT0+e1Byb21pc2UucmVzb2x2ZSgpLnRoZW4oKCk9PmYxKCkpfSxWRz0oKT0+e1Byb21pc2UucmVzb2x2ZSgpLnRoZW4oKCk9PnUxKCkpfSxIRz0oKT0+e1Byb21pc2UucmVzb2x2ZSgpLnRoZW4oKCk9PmgxKCkpfSxLRz0oKT0+e1Byb21pc2UucmVzb2x2ZSgpLnRoZW4oKCk9Pl8xKCkpfSxxRz0oKT0+e1Byb21pc2UucmVzb2x2ZSgpLnRoZW4oKCk9PnkxKCkpfSxXRz0oKT0+e1Byb21pc2UucmVzb2x2ZSgpLnRoZW4oKCk9PncxKCkpfSxYRz0oKT0+e1Byb21pc2UucmVzb2x2ZSgpLnRoZW4oKCk9PkUxKCkpfTtyZXR1cm4gZkMoWUcpO30pKCk7Cg==")});var eD=bm((Y3t,Ele)=>{var M3t=x(T()),j0=function(e){e==null&&(e=new Date().getTime()),this.N=624,this.M=397,this.MATRIX_A=2567483615,this.UPPER_MASK=2147483648,this.LOWER_MASK=2147483647,this.mt=new Array(this.N),this.mti=this.N+1,e.constructor==Array?this.init_by_array(e,e.length):this.init_seed(e)};j0.prototype.init_seed=function(e){for(this.mt[0]=e>>>0,this.mti=1;this.mti>>30;this.mt[this.mti]=(((e&4294901760)>>>16)*1812433253<<16)+(e&65535)*1812433253+this.mti,this.mt[this.mti]>>>=0}};j0.prototype.init_by_array=function(e,t){var n,i,o;for(this.init_seed(19650218),n=1,i=0,o=this.N>t?this.N:t;o;o--){var r=this.mt[n-1]^this.mt[n-1]>>>30;this.mt[n]=(this.mt[n]^(((r&4294901760)>>>16)*1664525<<16)+(r&65535)*1664525)+e[i]+i,this.mt[n]>>>=0,n++,i++,n>=this.N&&(this.mt[0]=this.mt[this.N-1],n=1),i>=t&&(i=0)}for(o=this.N-1;o;o--){var r=this.mt[n-1]^this.mt[n-1]>>>30;this.mt[n]=(this.mt[n]^(((r&4294901760)>>>16)*1566083941<<16)+(r&65535)*1566083941)-n,this.mt[n]>>>=0,n++,n>=this.N&&(this.mt[0]=this.mt[this.N-1],n=1)}this.mt[0]=2147483648};j0.prototype.random_int=function(){var e,t=new Array(0,this.MATRIX_A);if(this.mti>=this.N){var n;for(this.mti==this.N+1&&this.init_seed(5489),n=0;n>>1^t[e&1];for(;n>>1^t[e&1];e=this.mt[this.N-1]&this.UPPER_MASK|this.mt[0]&this.LOWER_MASK,this.mt[this.N-1]=this.mt[this.M-1]^e>>>1^t[e&1],this.mti=0}return e=this.mt[this.mti++],e^=e>>>11,e^=e<<7&2636928640,e^=e<<15&4022730752,e^=e>>>18,e>>>0};j0.prototype.random_int31=function(){return this.random_int()>>>1};j0.prototype.random_incl=function(){return this.random_int()*(1/4294967295)};j0.prototype.random=function(){return this.random_int()*(1/4294967296)};j0.prototype.random_excl=function(){return(this.random_int()+.5)*(1/4294967296)};j0.prototype.random_long=function(){var e=this.random_int()>>>5,t=this.random_int()>>>6;return(e*67108864+t)*(1/9007199254740992)};Ele.exports=j0});var sde=bm((e1,t1)=>{var bKt=x(T());/*! https://mths.be/punycode v1.4.0 by @mathias */(function(e){var t=typeof e1=="object"&&e1&&!e1.nodeType&&e1,n=typeof t1=="object"&&t1&&!t1.nodeType&&t1,i=typeof global=="object"&&global;(i.global===i||i.window===i||i.self===i)&&(e=i);var o,r=2147483647,s=36,a=1,c=26,d=38,u=700,m=72,p=128,b="-",f=/^xn--/,y=/[^\x20-\x7E]/,_=/[\x2E\u3002\uFF0E\uFF61]/g,S={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},Z=s-a,R=Math.floor,C=String.fromCharCode,E;function A(M){throw new RangeError(S[M])}function L(M,O){for(var w=M.length,z=[];w--;)z[w]=O(M[w]);return z}function F(M,O){var w=M.split("@"),z="";w.length>1&&(z=w[0]+"@",M=w[1]),M=M.replace(_,".");var K=M.split("."),te=L(K,O).join(".");return z+te}function I(M){for(var O=[],w=0,z=M.length,K,te;w=55296&&K<=56319&&w65535&&(O-=65536,w+=C(O>>>10&1023|55296),O=56320|O&1023),w+=C(O),w}).join("")}function g(M){return M-48<10?M-22:M-65<26?M-65:M-97<26?M-97:s}function V(M,O){return M+22+75*(M<26)-((O!=0)<<5)}function G(M,O,w){var z=0;for(M=w?R(M/u):M>>1,M+=R(M/O);M>Z*c>>1;z+=s)M=R(M/Z);return R(z+(Z+1)*M/(M+d))}function v(M){var O=[],w=M.length,z,K=0,te=p,H=m,$,ee,le,_e,he,Ze,ye,Ge,Ae;for($=M.lastIndexOf(b),$<0&&($=0),ee=0;ee<$;++ee)M.charCodeAt(ee)>=128&&A("not-basic"),O.push(M.charCodeAt(ee));for(le=$>0?$+1:0;le=w&&A("invalid-input"),ye=g(M.charCodeAt(le++)),(ye>=s||ye>R((r-K)/he))&&A("overflow"),K+=ye*he,Ge=Ze<=H?a:Ze>=H+c?c:Ze-H,!(yeR(r/Ae)&&A("overflow"),he*=Ae;z=O.length+1,H=G(K-_e,z,_e==0),R(K/z)>r-te&&A("overflow"),te+=R(K/z),K%=z,O.splice(K++,0,te)}return N(O)}function X(M){var O,w,z,K,te,H,$,ee,le,_e,he,Ze=[],ye,Ge,Ae,Fe;for(M=I(M),ye=M.length,O=p,w=0,te=m,H=0;H=O&&he<$&&($=he);for(Ge=z+1,$-O>R((r-w)/Ge)&&A("overflow"),w+=($-O)*Ge,O=$,H=0;Hr&&A("overflow"),he==O){for(ee=w,le=s;_e=le<=te?a:le>=te+c?c:le-te,!(ee<_e);le+=s)Fe=ee-_e,Ae=s-_e,Ze.push(C(V(_e+Fe%Ae,0))),ee=R(Fe/Ae);Ze.push(C(V(ee,0))),te=G(w,Ge,z==K),w=0,++z}++w,++O}return Ze.join("")}function Y(M){return F(M,function(O){return f.test(O)?v(O.slice(4).toLowerCase()):O})}function D(M){return F(M,function(O){return y.test(O)?"xn--"+X(O):O})}if(o={version:"1.3.2",ucs2:{decode:I,encode:N},decode:v,encode:X,toASCII:D,toUnicode:Y},typeof define=="function"&&typeof define.amd=="object"&&define.amd)define("punycode",function(){return o});else if(t&&n)if(t1.exports==t)n.exports=o;else for(E in o)o.hasOwnProperty(E)&&(t[E]=o[E]);else e.punycode=o})(e1)});var cde=bm((ade,TD)=>{var gKt=x(T());/*! * URI.js - Mutating URLs * IPv6 Support * @@ -35,7 +35,7 @@ * Licensed under * MIT License http://www.opensource.org/licenses/mit-license * - */(function(e,t){"use strict";typeof TD=="object"&&TD.exports?TD.exports=t():typeof define=="function"&&define.amd?define(t):e.IPv6=t(e)})(ade,function(e){"use strict";var t=e&&e.IPv6;function n(o){var r=o.toLowerCase(),s=r.split(":"),a=s.length,c=8;s[0]===""&&s[1]===""&&s[2]===""?(s.shift(),s.shift()):s[0]===""&&s[1]===""?s.shift():s[a-1]===""&&s[a-2]===""&&s.pop(),a=s.length,s[a-1].indexOf(".")!==-1&&(c=7);var d;for(d=0;d1);p++)u.splice(0,1);s[m]=u.join("")}var b=-1,f=0,y=0,_=-1,S=!1;for(m=0;mf&&(b=_,f=y)):s[m]==="0"&&(S=!0,_=m,y=1);y>f&&(b=_,f=y),f>1&&s.splice(b,f,""),a=s.length;var Z="";for(s[0]===""&&(Z=":"),m=0;m{var gKt=x(T());/*! + */(function(e,t){"use strict";typeof TD=="object"&&TD.exports?TD.exports=t():typeof define=="function"&&define.amd?define(t):e.IPv6=t(e)})(ade,function(e){"use strict";var t=e&&e.IPv6;function n(o){var r=o.toLowerCase(),s=r.split(":"),a=s.length,c=8;s[0]===""&&s[1]===""&&s[2]===""?(s.shift(),s.shift()):s[0]===""&&s[1]===""?s.shift():s[a-1]===""&&s[a-2]===""&&s.pop(),a=s.length,s[a-1].indexOf(".")!==-1&&(c=7);var d;for(d=0;d1);p++)u.splice(0,1);s[m]=u.join("")}var b=-1,f=0,y=0,_=-1,S=!1;for(m=0;mf&&(b=_,f=y)):s[m]==="0"&&(S=!0,_=m,y=1);y>f&&(b=_,f=y),f>1&&s.splice(b,f,""),a=s.length;var Z="";for(s[0]===""&&(Z=":"),m=0;m{var yKt=x(T());/*! * URI.js - Mutating URLs * Second Level Domain (SLD) Support * @@ -47,7 +47,7 @@ * Licensed under * MIT License http://www.opensource.org/licenses/mit-license * - */(function(e,t){"use strict";typeof _D=="object"&&_D.exports?_D.exports=t():typeof define=="function"&&define.amd?define(t):e.SecondLevelDomains=t(e)})(lde,function(e){"use strict";var t=e&&e.SecondLevelDomains,n={list:{ac:" com gov mil net org ",ae:" ac co gov mil name net org pro sch ",af:" com edu gov net org ",al:" com edu gov mil net org ",ao:" co ed gv it og pb ",ar:" com edu gob gov int mil net org tur ",at:" ac co gv or ",au:" asn com csiro edu gov id net org ",ba:" co com edu gov mil net org rs unbi unmo unsa untz unze ",bb:" biz co com edu gov info net org store tv ",bh:" biz cc com edu gov info net org ",bn:" com edu gov net org ",bo:" com edu gob gov int mil net org tv ",br:" adm adv agr am arq art ato b bio blog bmd cim cng cnt com coop ecn edu eng esp etc eti far flog fm fnd fot fst g12 ggf gov imb ind inf jor jus lel mat med mil mus net nom not ntr odo org ppg pro psc psi qsl rec slg srv tmp trd tur tv vet vlog wiki zlg ",bs:" com edu gov net org ",bz:" du et om ov rg ",ca:" ab bc mb nb nf nl ns nt nu on pe qc sk yk ",ck:" biz co edu gen gov info net org ",cn:" ac ah bj com cq edu fj gd gov gs gx gz ha hb he hi hl hn jl js jx ln mil net nm nx org qh sc sd sh sn sx tj tw xj xz yn zj ",co:" com edu gov mil net nom org ",cr:" ac c co ed fi go or sa ",cy:" ac biz com ekloges gov ltd name net org parliament press pro tm ",do:" art com edu gob gov mil net org sld web ",dz:" art asso com edu gov net org pol ",ec:" com edu fin gov info med mil net org pro ",eg:" com edu eun gov mil name net org sci ",er:" com edu gov ind mil net org rochest w ",es:" com edu gob nom org ",et:" biz com edu gov info name net org ",fj:" ac biz com info mil name net org pro ",fk:" ac co gov net nom org ",fr:" asso com f gouv nom prd presse tm ",gg:" co net org ",gh:" com edu gov mil org ",gn:" ac com gov net org ",gr:" com edu gov mil net org ",gt:" com edu gob ind mil net org ",gu:" com edu gov net org ",hk:" com edu gov idv net org ",hu:" 2000 agrar bolt casino city co erotica erotika film forum games hotel info ingatlan jogasz konyvelo lakas media news org priv reklam sex shop sport suli szex tm tozsde utazas video ",id:" ac co go mil net or sch web ",il:" ac co gov idf k12 muni net org ",in:" ac co edu ernet firm gen gov i ind mil net nic org res ",iq:" com edu gov i mil net org ",ir:" ac co dnssec gov i id net org sch ",it:" edu gov ",je:" co net org ",jo:" com edu gov mil name net org sch ",jp:" ac ad co ed go gr lg ne or ",ke:" ac co go info me mobi ne or sc ",kh:" com edu gov mil net org per ",ki:" biz com de edu gov info mob net org tel ",km:" asso com coop edu gouv k medecin mil nom notaires pharmaciens presse tm veterinaire ",kn:" edu gov net org ",kr:" ac busan chungbuk chungnam co daegu daejeon es gangwon go gwangju gyeongbuk gyeonggi gyeongnam hs incheon jeju jeonbuk jeonnam k kg mil ms ne or pe re sc seoul ulsan ",kw:" com edu gov net org ",ky:" com edu gov net org ",kz:" com edu gov mil net org ",lb:" com edu gov net org ",lk:" assn com edu gov grp hotel int ltd net ngo org sch soc web ",lr:" com edu gov net org ",lv:" asn com conf edu gov id mil net org ",ly:" com edu gov id med net org plc sch ",ma:" ac co gov m net org press ",mc:" asso tm ",me:" ac co edu gov its net org priv ",mg:" com edu gov mil nom org prd tm ",mk:" com edu gov inf name net org pro ",ml:" com edu gov net org presse ",mn:" edu gov org ",mo:" com edu gov net org ",mt:" com edu gov net org ",mv:" aero biz com coop edu gov info int mil museum name net org pro ",mw:" ac co com coop edu gov int museum net org ",mx:" com edu gob net org ",my:" com edu gov mil name net org sch ",nf:" arts com firm info net other per rec store web ",ng:" biz com edu gov mil mobi name net org sch ",ni:" ac co com edu gob mil net nom org ",np:" com edu gov mil net org ",nr:" biz com edu gov info net org ",om:" ac biz co com edu gov med mil museum net org pro sch ",pe:" com edu gob mil net nom org sld ",ph:" com edu gov i mil net ngo org ",pk:" biz com edu fam gob gok gon gop gos gov net org web ",pl:" art bialystok biz com edu gda gdansk gorzow gov info katowice krakow lodz lublin mil net ngo olsztyn org poznan pwr radom slupsk szczecin torun warszawa waw wroc wroclaw zgora ",pr:" ac biz com edu est gov info isla name net org pro prof ",ps:" com edu gov net org plo sec ",pw:" belau co ed go ne or ",ro:" arts com firm info nom nt org rec store tm www ",rs:" ac co edu gov in org ",sb:" com edu gov net org ",sc:" com edu gov net org ",sh:" co com edu gov net nom org ",sl:" com edu gov net org ",st:" co com consulado edu embaixada gov mil net org principe saotome store ",sv:" com edu gob org red ",sz:" ac co org ",tr:" av bbs bel biz com dr edu gen gov info k12 name net org pol tel tsk tv web ",tt:" aero biz cat co com coop edu gov info int jobs mil mobi museum name net org pro tel travel ",tw:" club com ebiz edu game gov idv mil net org ",mu:" ac co com gov net or org ",mz:" ac co edu gov org ",na:" co com ",nz:" ac co cri geek gen govt health iwi maori mil net org parliament school ",pa:" abo ac com edu gob ing med net nom org sld ",pt:" com edu gov int net nome org publ ",py:" com edu gov mil net org ",qa:" com edu gov mil net org ",re:" asso com nom ",ru:" ac adygeya altai amur arkhangelsk astrakhan bashkiria belgorod bir bryansk buryatia cbg chel chelyabinsk chita chukotka chuvashia com dagestan e-burg edu gov grozny int irkutsk ivanovo izhevsk jar joshkar-ola kalmykia kaluga kamchatka karelia kazan kchr kemerovo khabarovsk khakassia khv kirov koenig komi kostroma kranoyarsk kuban kurgan kursk lipetsk magadan mari mari-el marine mil mordovia mosreg msk murmansk nalchik net nnov nov novosibirsk nsk omsk orenburg org oryol penza perm pp pskov ptz rnd ryazan sakhalin samara saratov simbirsk smolensk spb stavropol stv surgut tambov tatarstan tom tomsk tsaritsyn tsk tula tuva tver tyumen udm udmurtia ulan-ude vladikavkaz vladimir vladivostok volgograd vologda voronezh vrn vyatka yakutia yamal yekaterinburg yuzhno-sakhalinsk ",rw:" ac co com edu gouv gov int mil net ",sa:" com edu gov med net org pub sch ",sd:" com edu gov info med net org tv ",se:" a ac b bd c d e f g h i k l m n o org p parti pp press r s t tm u w x y z ",sg:" com edu gov idn net org per ",sn:" art com edu gouv org perso univ ",sy:" com edu gov mil net news org ",th:" ac co go in mi net or ",tj:" ac biz co com edu go gov info int mil name net nic org test web ",tn:" agrinet com defense edunet ens fin gov ind info intl mincom nat net org perso rnrt rns rnu tourism ",tz:" ac co go ne or ",ua:" biz cherkassy chernigov chernovtsy ck cn co com crimea cv dn dnepropetrovsk donetsk dp edu gov if in ivano-frankivsk kh kharkov kherson khmelnitskiy kiev kirovograd km kr ks kv lg lugansk lutsk lviv me mk net nikolaev od odessa org pl poltava pp rovno rv sebastopol sumy te ternopil uzhgorod vinnica vn zaporizhzhe zhitomir zp zt ",ug:" ac co go ne or org sc ",uk:" ac bl british-library co cym gov govt icnet jet lea ltd me mil mod national-library-scotland nel net nhs nic nls org orgn parliament plc police sch scot soc ",us:" dni fed isa kids nsn ",uy:" com edu gub mil net org ",ve:" co com edu gob info mil net org web ",vi:" co com k12 net org ",vn:" ac biz com edu gov health info int name net org pro ",ye:" co com gov ltd me net org plc ",yu:" ac co edu gov org ",za:" ac agric alt bourse city co cybernet db edu gov grondar iaccess imt inca landesign law mil net ngo nis nom olivetti org pix school tm web ",zm:" ac co com edu gov net org sch ",com:"ar br cn de eu gb gr hu jpn kr no qc ru sa se uk us uy za ",net:"gb jp se uk ",org:"ae",de:"com "},has:function(i){var o=i.lastIndexOf(".");if(o<=0||o>=i.length-1)return!1;var r=i.lastIndexOf(".",o-1);if(r<=0||r>=o-1)return!1;var s=n.list[i.slice(o+1)];return s?s.indexOf(" "+i.slice(r+1,o)+" ")>=0:!1},is:function(i){var o=i.lastIndexOf(".");if(o<=0||o>=i.length-1)return!1;var r=i.lastIndexOf(".",o-1);if(r>=0)return!1;var s=n.list[i.slice(o+1)];return s?s.indexOf(" "+i.slice(0,o)+" ")>=0:!1},get:function(i){var o=i.lastIndexOf(".");if(o<=0||o>=i.length-1)return null;var r=i.lastIndexOf(".",o-1);if(r<=0||r>=o-1)return null;var s=n.list[i.slice(o+1)];return!s||s.indexOf(" "+i.slice(r+1,o)+" ")<0?null:i.slice(r+1)},noConflict:function(){return e.SecondLevelDomains===this&&(e.SecondLevelDomains=t),this}};return n})});var gu=gm((ude,SD)=>{var yKt=x(T());/*! + */(function(e,t){"use strict";typeof _D=="object"&&_D.exports?_D.exports=t():typeof define=="function"&&define.amd?define(t):e.SecondLevelDomains=t(e)})(lde,function(e){"use strict";var t=e&&e.SecondLevelDomains,n={list:{ac:" com gov mil net org ",ae:" ac co gov mil name net org pro sch ",af:" com edu gov net org ",al:" com edu gov mil net org ",ao:" co ed gv it og pb ",ar:" com edu gob gov int mil net org tur ",at:" ac co gv or ",au:" asn com csiro edu gov id net org ",ba:" co com edu gov mil net org rs unbi unmo unsa untz unze ",bb:" biz co com edu gov info net org store tv ",bh:" biz cc com edu gov info net org ",bn:" com edu gov net org ",bo:" com edu gob gov int mil net org tv ",br:" adm adv agr am arq art ato b bio blog bmd cim cng cnt com coop ecn edu eng esp etc eti far flog fm fnd fot fst g12 ggf gov imb ind inf jor jus lel mat med mil mus net nom not ntr odo org ppg pro psc psi qsl rec slg srv tmp trd tur tv vet vlog wiki zlg ",bs:" com edu gov net org ",bz:" du et om ov rg ",ca:" ab bc mb nb nf nl ns nt nu on pe qc sk yk ",ck:" biz co edu gen gov info net org ",cn:" ac ah bj com cq edu fj gd gov gs gx gz ha hb he hi hl hn jl js jx ln mil net nm nx org qh sc sd sh sn sx tj tw xj xz yn zj ",co:" com edu gov mil net nom org ",cr:" ac c co ed fi go or sa ",cy:" ac biz com ekloges gov ltd name net org parliament press pro tm ",do:" art com edu gob gov mil net org sld web ",dz:" art asso com edu gov net org pol ",ec:" com edu fin gov info med mil net org pro ",eg:" com edu eun gov mil name net org sci ",er:" com edu gov ind mil net org rochest w ",es:" com edu gob nom org ",et:" biz com edu gov info name net org ",fj:" ac biz com info mil name net org pro ",fk:" ac co gov net nom org ",fr:" asso com f gouv nom prd presse tm ",gg:" co net org ",gh:" com edu gov mil org ",gn:" ac com gov net org ",gr:" com edu gov mil net org ",gt:" com edu gob ind mil net org ",gu:" com edu gov net org ",hk:" com edu gov idv net org ",hu:" 2000 agrar bolt casino city co erotica erotika film forum games hotel info ingatlan jogasz konyvelo lakas media news org priv reklam sex shop sport suli szex tm tozsde utazas video ",id:" ac co go mil net or sch web ",il:" ac co gov idf k12 muni net org ",in:" ac co edu ernet firm gen gov i ind mil net nic org res ",iq:" com edu gov i mil net org ",ir:" ac co dnssec gov i id net org sch ",it:" edu gov ",je:" co net org ",jo:" com edu gov mil name net org sch ",jp:" ac ad co ed go gr lg ne or ",ke:" ac co go info me mobi ne or sc ",kh:" com edu gov mil net org per ",ki:" biz com de edu gov info mob net org tel ",km:" asso com coop edu gouv k medecin mil nom notaires pharmaciens presse tm veterinaire ",kn:" edu gov net org ",kr:" ac busan chungbuk chungnam co daegu daejeon es gangwon go gwangju gyeongbuk gyeonggi gyeongnam hs incheon jeju jeonbuk jeonnam k kg mil ms ne or pe re sc seoul ulsan ",kw:" com edu gov net org ",ky:" com edu gov net org ",kz:" com edu gov mil net org ",lb:" com edu gov net org ",lk:" assn com edu gov grp hotel int ltd net ngo org sch soc web ",lr:" com edu gov net org ",lv:" asn com conf edu gov id mil net org ",ly:" com edu gov id med net org plc sch ",ma:" ac co gov m net org press ",mc:" asso tm ",me:" ac co edu gov its net org priv ",mg:" com edu gov mil nom org prd tm ",mk:" com edu gov inf name net org pro ",ml:" com edu gov net org presse ",mn:" edu gov org ",mo:" com edu gov net org ",mt:" com edu gov net org ",mv:" aero biz com coop edu gov info int mil museum name net org pro ",mw:" ac co com coop edu gov int museum net org ",mx:" com edu gob net org ",my:" com edu gov mil name net org sch ",nf:" arts com firm info net other per rec store web ",ng:" biz com edu gov mil mobi name net org sch ",ni:" ac co com edu gob mil net nom org ",np:" com edu gov mil net org ",nr:" biz com edu gov info net org ",om:" ac biz co com edu gov med mil museum net org pro sch ",pe:" com edu gob mil net nom org sld ",ph:" com edu gov i mil net ngo org ",pk:" biz com edu fam gob gok gon gop gos gov net org web ",pl:" art bialystok biz com edu gda gdansk gorzow gov info katowice krakow lodz lublin mil net ngo olsztyn org poznan pwr radom slupsk szczecin torun warszawa waw wroc wroclaw zgora ",pr:" ac biz com edu est gov info isla name net org pro prof ",ps:" com edu gov net org plo sec ",pw:" belau co ed go ne or ",ro:" arts com firm info nom nt org rec store tm www ",rs:" ac co edu gov in org ",sb:" com edu gov net org ",sc:" com edu gov net org ",sh:" co com edu gov net nom org ",sl:" com edu gov net org ",st:" co com consulado edu embaixada gov mil net org principe saotome store ",sv:" com edu gob org red ",sz:" ac co org ",tr:" av bbs bel biz com dr edu gen gov info k12 name net org pol tel tsk tv web ",tt:" aero biz cat co com coop edu gov info int jobs mil mobi museum name net org pro tel travel ",tw:" club com ebiz edu game gov idv mil net org ",mu:" ac co com gov net or org ",mz:" ac co edu gov org ",na:" co com ",nz:" ac co cri geek gen govt health iwi maori mil net org parliament school ",pa:" abo ac com edu gob ing med net nom org sld ",pt:" com edu gov int net nome org publ ",py:" com edu gov mil net org ",qa:" com edu gov mil net org ",re:" asso com nom ",ru:" ac adygeya altai amur arkhangelsk astrakhan bashkiria belgorod bir bryansk buryatia cbg chel chelyabinsk chita chukotka chuvashia com dagestan e-burg edu gov grozny int irkutsk ivanovo izhevsk jar joshkar-ola kalmykia kaluga kamchatka karelia kazan kchr kemerovo khabarovsk khakassia khv kirov koenig komi kostroma kranoyarsk kuban kurgan kursk lipetsk magadan mari mari-el marine mil mordovia mosreg msk murmansk nalchik net nnov nov novosibirsk nsk omsk orenburg org oryol penza perm pp pskov ptz rnd ryazan sakhalin samara saratov simbirsk smolensk spb stavropol stv surgut tambov tatarstan tom tomsk tsaritsyn tsk tula tuva tver tyumen udm udmurtia ulan-ude vladikavkaz vladimir vladivostok volgograd vologda voronezh vrn vyatka yakutia yamal yekaterinburg yuzhno-sakhalinsk ",rw:" ac co com edu gouv gov int mil net ",sa:" com edu gov med net org pub sch ",sd:" com edu gov info med net org tv ",se:" a ac b bd c d e f g h i k l m n o org p parti pp press r s t tm u w x y z ",sg:" com edu gov idn net org per ",sn:" art com edu gouv org perso univ ",sy:" com edu gov mil net news org ",th:" ac co go in mi net or ",tj:" ac biz co com edu go gov info int mil name net nic org test web ",tn:" agrinet com defense edunet ens fin gov ind info intl mincom nat net org perso rnrt rns rnu tourism ",tz:" ac co go ne or ",ua:" biz cherkassy chernigov chernovtsy ck cn co com crimea cv dn dnepropetrovsk donetsk dp edu gov if in ivano-frankivsk kh kharkov kherson khmelnitskiy kiev kirovograd km kr ks kv lg lugansk lutsk lviv me mk net nikolaev od odessa org pl poltava pp rovno rv sebastopol sumy te ternopil uzhgorod vinnica vn zaporizhzhe zhitomir zp zt ",ug:" ac co go ne or org sc ",uk:" ac bl british-library co cym gov govt icnet jet lea ltd me mil mod national-library-scotland nel net nhs nic nls org orgn parliament plc police sch scot soc ",us:" dni fed isa kids nsn ",uy:" com edu gub mil net org ",ve:" co com edu gob info mil net org web ",vi:" co com k12 net org ",vn:" ac biz com edu gov health info int name net org pro ",ye:" co com gov ltd me net org plc ",yu:" ac co edu gov org ",za:" ac agric alt bourse city co cybernet db edu gov grondar iaccess imt inca landesign law mil net ngo nis nom olivetti org pix school tm web ",zm:" ac co com edu gov net org sch ",com:"ar br cn de eu gb gr hu jpn kr no qc ru sa se uk us uy za ",net:"gb jp se uk ",org:"ae",de:"com "},has:function(i){var o=i.lastIndexOf(".");if(o<=0||o>=i.length-1)return!1;var r=i.lastIndexOf(".",o-1);if(r<=0||r>=o-1)return!1;var s=n.list[i.slice(o+1)];return s?s.indexOf(" "+i.slice(r+1,o)+" ")>=0:!1},is:function(i){var o=i.lastIndexOf(".");if(o<=0||o>=i.length-1)return!1;var r=i.lastIndexOf(".",o-1);if(r>=0)return!1;var s=n.list[i.slice(o+1)];return s?s.indexOf(" "+i.slice(0,o)+" ")>=0:!1},get:function(i){var o=i.lastIndexOf(".");if(o<=0||o>=i.length-1)return null;var r=i.lastIndexOf(".",o-1);if(r<=0||r>=o-1)return null;var s=n.list[i.slice(o+1)];return!s||s.indexOf(" "+i.slice(r+1,o)+" ")<0?null:i.slice(r+1)},noConflict:function(){return e.SecondLevelDomains===this&&(e.SecondLevelDomains=t),this}};return n})});var gu=bm((ude,SD)=>{var xKt=x(T());/*! * URI.js - Mutating URLs * * Version: 1.19.11 @@ -58,26 +58,26 @@ * Licensed under * MIT License http://www.opensource.org/licenses/mit-license * - */(function(e,t){"use strict";typeof SD=="object"&&SD.exports?SD.exports=t(sde(),cde(),dde()):typeof define=="function"&&define.amd?define(["./punycode","./IPv6","./SecondLevelDomains"],t):e.URI=t(e.punycode,e.IPv6,e.SecondLevelDomains,e)})(ude,function(e,t,n,i){"use strict";var o=i&&i.URI;function r(V,G){var v=arguments.length>=1,X=arguments.length>=2;if(!(this instanceof r))return v?X?new r(V,G):new r(V):new r;if(V===void 0){if(v)throw new TypeError("undefined is not a valid argument for URI");typeof location<"u"?V=location.href+"":V=""}if(V===null&&v)throw new TypeError("null is not a valid argument for URI");return this.href(V),G!==void 0?this.absoluteTo(G):this}function s(V){return/^[0-9]+$/.test(V)}r.version="1.19.11";var a=r.prototype,c=Object.prototype.hasOwnProperty;function d(V){return V.replace(/([.*+?^=!:${}()|[\]\/\\])/g,"\\$1")}function u(V){return V===void 0?"Undefined":String(Object.prototype.toString.call(V)).slice(8,-1)}function m(V){return u(V)==="Array"}function p(V,G){var v={},X,Y;if(u(G)==="RegExp")v=null;else if(m(G))for(X=0,Y=G.length;X]+|\(([^\s()<>]+|(\([^\s()<>]+\)))*\))+(?:\(([^\s()<>]+|(\([^\s()<>]+\)))*\)|[^\s`!()\[\]{};:'".,<>?«»“”‘’]))/ig,r.findUri={start:/\b(?:([a-z][a-z0-9.+-]*:\/\/)|www\.)/gi,end:/[\s\r\n]|$/,trim:/[`!()\[\]{};:'".,<>?«»“”„‘’]+$/,parens:/(\([^\)]*\)|\[[^\]]*\]|\{[^}]*\}|<[^>]*>)/g},r.leading_whitespace_expression=/^[\x00-\x20\u00a0\u1680\u2000-\u200a\u2028\u2029\u202f\u205f\u3000\ufeff]+/,r.ascii_tab_whitespace=/[\u0009\u000A\u000D]+/g,r.defaultPorts={http:"80",https:"443",ftp:"21",gopher:"70",ws:"80",wss:"443"},r.hostProtocols=["http","https"],r.invalid_hostname_characters=/[^a-zA-Z0-9\.\-:_]/,r.domAttributes={a:"href",blockquote:"cite",link:"href",base:"href",script:"src",form:"action",img:"src",area:"href",iframe:"src",embed:"src",source:"src",track:"src",input:"src",audio:"src",video:"src"},r.getDomAttribute=function(V){if(!(!V||!V.nodeName)){var G=V.nodeName.toLowerCase();if(!(G==="input"&&V.type!=="image"))return r.domAttributes[G]}};function _(V){return escape(V)}function S(V){return encodeURIComponent(V).replace(/[!'()*]/g,_).replace(/\*/g,"%2A")}r.encode=S,r.decode=decodeURIComponent,r.iso8859=function(){r.encode=escape,r.decode=unescape},r.unicode=function(){r.encode=S,r.decode=decodeURIComponent},r.characters={pathname:{encode:{expression:/%(24|26|2B|2C|3B|3D|3A|40)/ig,map:{"%24":"$","%26":"&","%2B":"+","%2C":",","%3B":";","%3D":"=","%3A":":","%40":"@"}},decode:{expression:/[\/\?#]/g,map:{"/":"%2F","?":"%3F","#":"%23"}}},reserved:{encode:{expression:/%(21|23|24|26|27|28|29|2A|2B|2C|2F|3A|3B|3D|3F|40|5B|5D)/ig,map:{"%3A":":","%2F":"/","%3F":"?","%23":"#","%5B":"[","%5D":"]","%40":"@","%21":"!","%24":"$","%26":"&","%27":"'","%28":"(","%29":")","%2A":"*","%2B":"+","%2C":",","%3B":";","%3D":"="}}},urnpath:{encode:{expression:/%(21|24|27|28|29|2A|2B|2C|3B|3D|40)/ig,map:{"%21":"!","%24":"$","%27":"'","%28":"(","%29":")","%2A":"*","%2B":"+","%2C":",","%3B":";","%3D":"=","%40":"@"}},decode:{expression:/[\/\?#:]/g,map:{"/":"%2F","?":"%3F","#":"%23",":":"%3A"}}}},r.encodeQuery=function(V,G){var v=r.encode(V+"");return G===void 0&&(G=r.escapeQuerySpace),G?v.replace(/%20/g,"+"):v},r.decodeQuery=function(V,G){V+="",G===void 0&&(G=r.escapeQuerySpace);try{return r.decode(G?V.replace(/\+/g,"%20"):V)}catch{return V}};var Z={encode:"encode",decode:"decode"},R,C=function(V,G){return function(v){try{return r[G](v+"").replace(r.characters[V][G].expression,function(X){return r.characters[V][G].map[X]})}catch{return v}}};for(R in Z)r[R+"PathSegment"]=C("pathname",Z[R]),r[R+"UrnPathSegment"]=C("urnpath",Z[R]);var E=function(V,G,v){return function(X){var Y;v?Y=function(w){return r[G](r[v](w))}:Y=r[G];for(var D=(X+"").split(V),M=0,O=D.length;M-1&&(G.fragment=V.substring(v+1)||null,V=V.substring(0,v)),v=V.indexOf("?"),v>-1&&(G.query=V.substring(v+1)||null,V=V.substring(0,v)),V=V.replace(/^(https?|ftp|wss?)?:+[/\\]*/i,"$1://"),V=V.replace(/^[/\\]{2,}/i,"//"),V.substring(0,2)==="//"?(G.protocol=null,V=V.substring(2),V=r.parseAuthority(V,G)):(v=V.indexOf(":"),v>-1&&(G.protocol=V.substring(0,v)||null,G.protocol&&!G.protocol.match(r.protocol_expression)?G.protocol=void 0:V.substring(v+1,v+3).replace(/\\/g,"/")==="//"?(V=V.substring(v+3),V=r.parseAuthority(V,G)):(V=V.substring(v+1),G.urn=!0))),G.path=V,G},r.parseHost=function(V,G){V||(V=""),V=V.replace(/\\/g,"/");var v=V.indexOf("/"),X,Y;if(v===-1&&(v=V.length),V.charAt(0)==="[")X=V.indexOf("]"),G.hostname=V.substring(1,X)||null,G.port=V.substring(X+2,v)||null,G.port==="/"&&(G.port=null);else{var D=V.indexOf(":"),M=V.indexOf("/"),O=V.indexOf(":",D+1);O!==-1&&(M===-1||O-1?Y:V.length-1),M;return D>-1&&(Y===-1||D-1?H=H.slice(0,$)+H.slice($).replace(D,""):H=H.replace(D,""),!(H.length<=w[0].length)&&!(v.ignore&&v.ignore.test(H))){te=z+H.length;var _e=G(H,z,te,V);if(_e===void 0){X.lastIndex=te;continue}_e=String(_e),V=V.slice(0,z)+_e+V.slice(te),X.lastIndex=z+_e.length}}return X.lastIndex=0,V},r.ensureValidHostname=function(V,G){var v=!!V,X=!!G,Y=!1;if(X&&(Y=b(r.hostProtocols,G)),Y&&!v)throw new TypeError("Hostname cannot be empty, if protocol is "+G);if(V&&V.match(r.invalid_hostname_characters)){if(!e)throw new TypeError('Hostname "'+V+'" contains characters other than [A-Z0-9.-:_] and Punycode.js is not available');if(e.toASCII(V).match(r.invalid_hostname_characters))throw new TypeError('Hostname "'+V+'" contains characters other than [A-Z0-9.-:_]')}},r.ensureValidPort=function(V){if(V){var G=Number(V);if(!(s(G)&&G>0&&G<65536))throw new TypeError('Port "'+V+'" is not a valid port')}},r.noConflict=function(V){if(V){var G={URI:this.noConflict()};return i.URITemplate&&typeof i.URITemplate.noConflict=="function"&&(G.URITemplate=i.URITemplate.noConflict()),i.IPv6&&typeof i.IPv6.noConflict=="function"&&(G.IPv6=i.IPv6.noConflict()),i.SecondLevelDomains&&typeof i.SecondLevelDomains.noConflict=="function"&&(G.SecondLevelDomains=i.SecondLevelDomains.noConflict()),G}else i.URI===this&&(i.URI=o);return this},a.build=function(V){return V===!0?this._deferred_build=!0:(V===void 0||this._deferred_build)&&(this._string=r.build(this._parts),this._deferred_build=!1),this},a.clone=function(){return new r(this)},a.valueOf=a.toString=function(){return this.build(!1)._string};function A(V){return function(G,v){return G===void 0?this._parts[V]||"":(this._parts[V]=G||null,this.build(!v),this)}}function L(V,G){return function(v,X){return v===void 0?this._parts[V]||"":(v!==null&&(v=v+"",v.charAt(0)===G&&(v=v.substring(1))),this._parts[V]=v,this.build(!X),this)}}a.protocol=A("protocol"),a.username=A("username"),a.password=A("password"),a.hostname=A("hostname"),a.port=A("port"),a.query=L("query","?"),a.fragment=L("fragment","#"),a.search=function(V,G){var v=this.query(V,G);return typeof v=="string"&&v.length?"?"+v:v},a.hash=function(V,G){var v=this.fragment(V,G);return typeof v=="string"&&v.length?"#"+v:v},a.pathname=function(V,G){if(V===void 0||V===!0){var v=this._parts.path||(this._parts.hostname?"/":"");return V?(this._parts.urn?r.decodeUrnPath:r.decodePath)(v):v}else return this._parts.urn?this._parts.path=V?r.recodeUrnPath(V):"":this._parts.path=V?r.recodePath(V):"/",this.build(!G),this},a.path=a.pathname,a.href=function(V,G){var v;if(V===void 0)return this.toString();this._string="",this._parts=r._parts();var X=V instanceof r,Y=typeof V=="object"&&(V.hostname||V.path||V.pathname);if(V.nodeName){var D=r.getDomAttribute(V);V=V[D]||"",Y=!1}if(!X&&Y&&V.pathname!==void 0&&(V=V.toString()),typeof V=="string"||V instanceof String)this._parts=r.parse(String(V),this._parts);else if(X||Y){var M=X?V._parts:V;for(v in M)v!=="query"&&c.call(this._parts,v)&&(this._parts[v]=M[v]);M.query&&this.query(M.query,!1)}else throw new TypeError("invalid input");return this.build(!G),this},a.is=function(V){var G=!1,v=!1,X=!1,Y=!1,D=!1,M=!1,O=!1,w=!this._parts.urn;switch(this._parts.hostname&&(w=!1,v=r.ip4_expression.test(this._parts.hostname),X=r.ip6_expression.test(this._parts.hostname),G=v||X,Y=!G,D=Y&&n&&n.has(this._parts.hostname),M=Y&&r.idn_expression.test(this._parts.hostname),O=Y&&r.punycode_expression.test(this._parts.hostname)),V.toLowerCase()){case"relative":return w;case"absolute":return!w;case"domain":case"name":return Y;case"sld":return D;case"ip":return G;case"ip4":case"ipv4":case"inet4":return v;case"ip6":case"ipv6":case"inet6":return X;case"idn":return M;case"url":return!this._parts.urn;case"urn":return!!this._parts.urn;case"punycode":return O}return null};var F=a.protocol,I=a.port,N=a.hostname;a.protocol=function(V,G){if(V&&(V=V.replace(/:(\/\/)?$/,""),!V.match(r.protocol_expression)))throw new TypeError('Protocol "'+V+`" contains characters other than [A-Z0-9.+-] or doesn't start with [A-Z]`);return F.call(this,V,G)},a.scheme=a.protocol,a.port=function(V,G){return this._parts.urn?V===void 0?"":this:(V!==void 0&&(V===0&&(V=null),V&&(V+="",V.charAt(0)===":"&&(V=V.substring(1)),r.ensureValidPort(V))),I.call(this,V,G))},a.hostname=function(V,G){if(this._parts.urn)return V===void 0?"":this;if(V!==void 0){var v={preventInvalidHostname:this._parts.preventInvalidHostname},X=r.parseHost(V,v);if(X!=="/")throw new TypeError('Hostname "'+V+'" contains characters other than [A-Z0-9.-]');V=v.hostname,this._parts.preventInvalidHostname&&r.ensureValidHostname(V,this._parts.protocol)}return N.call(this,V,G)},a.origin=function(V,G){if(this._parts.urn)return V===void 0?"":this;if(V===void 0){var v=this.protocol(),X=this.authority();return X?(v?v+"://":"")+this.authority():""}else{var Y=r(V);return this.protocol(Y.protocol()).authority(Y.authority()).build(!G),this}},a.host=function(V,G){if(this._parts.urn)return V===void 0?"":this;if(V===void 0)return this._parts.hostname?r.buildHost(this._parts):"";var v=r.parseHost(V,this._parts);if(v!=="/")throw new TypeError('Hostname "'+V+'" contains characters other than [A-Z0-9.-]');return this.build(!G),this},a.authority=function(V,G){if(this._parts.urn)return V===void 0?"":this;if(V===void 0)return this._parts.hostname?r.buildAuthority(this._parts):"";var v=r.parseAuthority(V,this._parts);if(v!=="/")throw new TypeError('Hostname "'+V+'" contains characters other than [A-Z0-9.-]');return this.build(!G),this},a.userinfo=function(V,G){if(this._parts.urn)return V===void 0?"":this;if(V===void 0){var v=r.buildUserinfo(this._parts);return v&&v.substring(0,v.length-1)}else return V[V.length-1]!=="@"&&(V+="@"),r.parseUserinfo(V,this._parts),this.build(!G),this},a.resource=function(V,G){var v;return V===void 0?this.path()+this.search()+this.hash():(v=r.parse(V),this._parts.path=v.path,this._parts.query=v.query,this._parts.fragment=v.fragment,this.build(!G),this)},a.subdomain=function(V,G){if(this._parts.urn)return V===void 0?"":this;if(V===void 0){if(!this._parts.hostname||this.is("IP"))return"";var v=this._parts.hostname.length-this.domain().length-1;return this._parts.hostname.substring(0,v)||""}else{var X=this._parts.hostname.length-this.domain().length,Y=this._parts.hostname.substring(0,X),D=new RegExp("^"+d(Y));if(V&&V.charAt(V.length-1)!=="."&&(V+="."),V.indexOf(":")!==-1)throw new TypeError("Domains cannot contain colons");return V&&r.ensureValidHostname(V,this._parts.protocol),this._parts.hostname=this._parts.hostname.replace(D,V),this.build(!G),this}},a.domain=function(V,G){if(this._parts.urn)return V===void 0?"":this;if(typeof V=="boolean"&&(G=V,V=void 0),V===void 0){if(!this._parts.hostname||this.is("IP"))return"";var v=this._parts.hostname.match(/\./g);if(v&&v.length<2)return this._parts.hostname;var X=this._parts.hostname.length-this.tld(G).length-1;return X=this._parts.hostname.lastIndexOf(".",X-1)+1,this._parts.hostname.substring(X)||""}else{if(!V)throw new TypeError("cannot set domain empty");if(V.indexOf(":")!==-1)throw new TypeError("Domains cannot contain colons");if(r.ensureValidHostname(V,this._parts.protocol),!this._parts.hostname||this.is("IP"))this._parts.hostname=V;else{var Y=new RegExp(d(this.domain())+"$");this._parts.hostname=this._parts.hostname.replace(Y,V)}return this.build(!G),this}},a.tld=function(V,G){if(this._parts.urn)return V===void 0?"":this;if(typeof V=="boolean"&&(G=V,V=void 0),V===void 0){if(!this._parts.hostname||this.is("IP"))return"";var v=this._parts.hostname.lastIndexOf("."),X=this._parts.hostname.substring(v+1);return G!==!0&&n&&n.list[X.toLowerCase()]&&n.get(this._parts.hostname)||X}else{var Y;if(V)if(V.match(/[^a-zA-Z0-9-]/))if(n&&n.is(V))Y=new RegExp(d(this.tld())+"$"),this._parts.hostname=this._parts.hostname.replace(Y,V);else throw new TypeError('TLD "'+V+'" contains characters other than [A-Z0-9]');else{if(!this._parts.hostname||this.is("IP"))throw new ReferenceError("cannot set TLD on non-domain host");Y=new RegExp(d(this.tld())+"$"),this._parts.hostname=this._parts.hostname.replace(Y,V)}else throw new TypeError("cannot set TLD empty");return this.build(!G),this}},a.directory=function(V,G){if(this._parts.urn)return V===void 0?"":this;if(V===void 0||V===!0){if(!this._parts.path&&!this._parts.hostname)return"";if(this._parts.path==="/")return"/";var v=this._parts.path.length-this.filename().length-1,X=this._parts.path.substring(0,v)||(this._parts.hostname?"/":"");return V?r.decodePath(X):X}else{var Y=this._parts.path.length-this.filename().length,D=this._parts.path.substring(0,Y),M=new RegExp("^"+d(D));return this.is("relative")||(V||(V="/"),V.charAt(0)!=="/"&&(V="/"+V)),V&&V.charAt(V.length-1)!=="/"&&(V+="/"),V=r.recodePath(V),this._parts.path=this._parts.path.replace(M,V),this.build(!G),this}},a.filename=function(V,G){if(this._parts.urn)return V===void 0?"":this;if(typeof V!="string"){if(!this._parts.path||this._parts.path==="/")return"";var v=this._parts.path.lastIndexOf("/"),X=this._parts.path.substring(v+1);return V?r.decodePathSegment(X):X}else{var Y=!1;V.charAt(0)==="/"&&(V=V.substring(1)),V.match(/\.?\//)&&(Y=!0);var D=new RegExp(d(this.filename())+"$");return V=r.recodePath(V),this._parts.path=this._parts.path.replace(D,V),Y?this.normalizePath(G):this.build(!G),this}},a.suffix=function(V,G){if(this._parts.urn)return V===void 0?"":this;if(V===void 0||V===!0){if(!this._parts.path||this._parts.path==="/")return"";var v=this.filename(),X=v.lastIndexOf("."),Y,D;return X===-1?"":(Y=v.substring(X+1),D=/^[a-z0-9%]+$/i.test(Y)?Y:"",V?r.decodePathSegment(D):D)}else{V.charAt(0)==="."&&(V=V.substring(1));var M=this.suffix(),O;if(M)V?O=new RegExp(d(M)+"$"):O=new RegExp(d("."+M)+"$");else{if(!V)return this;this._parts.path+="."+r.recodePath(V)}return O&&(V=r.recodePath(V),this._parts.path=this._parts.path.replace(O,V)),this.build(!G),this}},a.segment=function(V,G,v){var X=this._parts.urn?":":"/",Y=this.path(),D=Y.substring(0,1)==="/",M=Y.split(X);if(V!==void 0&&typeof V!="number"&&(v=G,G=V,V=void 0),V!==void 0&&typeof V!="number")throw new Error('Bad segment "'+V+'", must be 0-based integer');if(D&&M.shift(),V<0&&(V=Math.max(M.length+V,0)),G===void 0)return V===void 0?M:M[V];if(V===null||M[V]===void 0)if(m(G)){M=[];for(var O=0,w=G.length;O{"use strict";var Whi=x(T());e_e.exports=Xlt;var lN=1e20;function Xlt(e,t){t||(t={});var n=t.cutoff==null?.25:t.cutoff,i=t.radius==null?8:t.radius,o=t.channel||0,r,s,a,c,d,u,m,p,b,f,y;if(ArrayBuffer.isView(e)||Array.isArray(e)){if(!t.width||!t.height)throw Error("For raw data width and height should be provided by options");r=t.width,s=t.height,c=e,t.stride?u=t.stride:u=Math.floor(e.length/r/s)}else window.HTMLCanvasElement&&e instanceof window.HTMLCanvasElement?(p=e,m=p.getContext("2d"),r=p.width,s=p.height,b=m.getImageData(0,0,r,s),c=b.data,u=4):window.CanvasRenderingContext2D&&e instanceof window.CanvasRenderingContext2D?(p=e.canvas,m=e,r=p.width,s=p.height,b=m.getImageData(0,0,r,s),c=b.data,u=4):window.ImageData&&e instanceof window.ImageData&&(b=e,r=e.width,s=e.height,c=b.data,u=4);if(a=Math.max(r,s),window.Uint8ClampedArray&&c instanceof window.Uint8ClampedArray||window.Uint8Array&&c instanceof window.Uint8Array)for(d=c,c=Array(r*s),f=0,y=Math.floor(d.length/u);f{var Qhi=x(T());function zlt(){var e=0,t=1,n=2,i=3,o=4,r=5,s=6,a=7,c=8,d=9,u=10,m=11,p=12,b=13,f=14,y=15,_=16,S=17,Z=0,R=1,C=2,E=3,A=4;function L(g,V){return 55296<=g.charCodeAt(V)&&g.charCodeAt(V)<=56319&&56320<=g.charCodeAt(V+1)&&g.charCodeAt(V+1)<=57343}function F(g,V){V===void 0&&(V=0);var G=g.charCodeAt(V);if(55296<=G&&G<=56319&&V=1){var v=g.charCodeAt(V-1),X=G;return 55296<=v&&v<=56319?(v-55296)*1024+(X-56320)+65536:X}return G}function I(g,V,G){var v=[g].concat(V).concat([G]),X=v[v.length-2],Y=G,D=v.lastIndexOf(f);if(D>1&&v.slice(1,D).every(function(w){return w==i})&&[i,b,S].indexOf(g)==-1)return C;var M=v.lastIndexOf(o);if(M>0&&v.slice(1,M).every(function(w){return w==o})&&[p,o].indexOf(X)==-1)return v.filter(function(w){return w==o}).length%2==1?E:A;if(X==e&&Y==t)return Z;if(X==n||X==e||X==t)return Y==f&&V.every(function(w){return w==i})?C:R;if(Y==n||Y==e||Y==t)return R;if(X==s&&(Y==s||Y==a||Y==d||Y==u))return Z;if((X==d||X==a)&&(Y==a||Y==c))return Z;if((X==u||X==c)&&Y==c)return Z;if(Y==i||Y==y)return Z;if(Y==r)return Z;if(X==p)return Z;var O=v.indexOf(i)!=-1?v.lastIndexOf(i)-1:v.length-2;return[b,S].indexOf(v[O])!=-1&&v.slice(O+1,-1).every(function(w){return w==i})&&Y==f||X==y&&[_,S].indexOf(Y)!=-1?Z:V.indexOf(o)!=-1?C:X==o&&Y==o?Z:R}this.nextBreak=function(g,V){if(V===void 0&&(V=0),V<0)return 0;if(V>=g.length-1)return g.length;for(var G=N(F(g,V)),v=[],X=V+1;X{_Ki=x(T(),1),$ee=new Date(2107,11,31,23,59,58),hE=new Date(1980,0,1),ke=void 0,TZ=1/0,$d="undefined",Yr="function",LVe="object",_Z="string",WVe="number",vVe="boolean",yo=new Uint8Array});function pE(e){if(e&&typeof e!=Yr)throw new Error(uEe);return e}function ez(e){if(e&&(typeof e.addEventListener!=Yr||typeof e.aborted!=vVe))throw new Error(mEe);return e||ke}function tz(e,t){if(e&&typeof e!=_Z||t&&!(t instanceof Uint8Array))throw new Error(nte)}function ite(e,t,n){if(!Number.isInteger(e)||e<0||e>t)throw new Error(n)}function bE(e,t,n){e!==ke&&ite(e,t,n)}function SZ(e){return typeof e==_Z&&e.trim()?Number(e):e}var RKi,FVe,IVe,PVe,XVe,NVe,D3,O3,B3,z3,YVe,MVe,wVe,kVe,UVe,DVe,OVe,BVe,H3,K3,J3,j3,zVe,HVe,KVe,JVe,jVe,QVe,qVe,$Ve,eEe,ete,tEe,nEe,WM,fE,iEe,oEe,rEe,sEe,aEe,cEe,tte,lEe,dEe,Q3,q3,iT,$3,Ng,uEe,mEe,nte,vM=Xs(()=>{RKi=x(T(),1);gc();FVe="filenameEncoding",IVe="commentEncoding",PVe="decodeText",XVe="extractPrependedData",NVe="extractAppendedData",D3="password",O3="rawPassword",B3="passThrough",z3="signal",YVe="checkPasswordOnly",MVe="checkOverlappingEntryOnly",wVe="checkOverlappingEntry",kVe="checkAmbiguity",UVe="checkLocalDirectory",DVe="checkSignature",OVe="checkCrc32",BVe="checkAuthenticationCode",H3="useWebWorkers",K3="useCompressionStream",J3="transferStreams",j3="preventClose",zVe="encryptionStrength",HVe="extendedTimestamp",KVe="ntfsTimestamp",JVe="keepOrder",jVe="level",QVe="bufferedWrite",qVe="createTempStream",$Ve="dataDescriptorSignature",eEe="useUnicodeFileNames",ete="dataDescriptor",tEe="supportZip64SplitFile",nEe="encodeText",WM="offset",fE="usdz",iEe="unixExtraFieldType",oEe="localExtraField",rEe="centralExtraField",sEe="strictness",aEe="filenameValidation",cEe="normalizeFilename",tte="maxAppendedDataSize",lEe="decryptCentralDirectory",dEe="signCentralDirectory",Q3="filename",q3="comment",iT="strict",$3="balanced",Ng="tolerant",uEe="Invalid option (must be a function)",mEe="Invalid signal (must be an AbortSignal instance)",nte="Invalid password (password must be a string, rawPassword must be a Uint8Array)"});function Yg(){return ote}function FM(e){return rte(e.chunkSize)}function rte(e){return e=SZ(e),Number.isInteger(e)&&e>=fEe?Math.max(e,p_t):hEe}function IM(e){Object.assign(ote,_Ee(SEe(e)))}function _Ee(e){let t={};for(let n of y_t){let i=e[n];i!==ke&&(t[n]=x_t(n,i))}return t}function x_t(e,t){if(xEe.includes(e)){if(t=SZ(t),e==yEe&&(!Number.isInteger(t)||t{AKi=x(T(),1);gc();vM();hEe=64*1024,p_t=64,fEe=1,pEe="Invalid maxWorkers (must be an integer greater than 0)",bEe=2;try{typeof navigator!=$d&&navigator.hardwareConcurrency&&(bEe=navigator.hardwareConcurrency)}catch{}gEe={workerURI:"./core/web-worker-wasm.js",wasmURI:"./core/streams/zlib-wasm/zlib-streams.wasm",chunkSize:hEe,maxWorkers:bEe,terminateWorkerTimeout:5e3,workerStarvationTimeout:5e3,workerStartupTimeout:5e3,useWebWorkers:!0,useCompressionStream:!0,transferStreams:!0,CompressionStream:typeof CompressionStream!=$d&&CompressionStream,DecompressionStream:typeof DecompressionStream!=$d&&DecompressionStream},yEe="maxWorkers",b_t=["baseURI","wasmURI","workerURI"],g_t=["useCompressionStream","useWebWorkers","transferStreams"],xEe=["chunkSize",yEe,"terminateWorkerTimeout","workerStarvationTimeout","workerStartupTimeout"],TEe=["createWorker","CompressionStream","DecompressionStream","CompressionStreamFallback","DecompressionStreamFallback"],y_t=[...b_t,...g_t,...xEe,...TEe],ote={...gEe}});function mh(e,t){let n=new Uint8Array(e.length+t.length);return n.set(e),n.set(t,e.length),n}function nz(e){return e.byteOffset||e.byteLength!=e.buffer.byteLength?new Uint8Array(e):e}function fi(e){return new DataView(e.buffer,e.byteOffset,e.byteLength)}var LKi,ZZ=Xs(()=>{LKi=x(T(),1)});var vKi,PM,ZEe,T_t,__t,S_t,Z_t,R_t,C_t,V_t,kf,XM=Xs(()=>{vKi=x(T(),1),PM=[[],[],[],[],[],[],[],[]];for(let e=0;e<256;e++){let t=e;for(let n=0;n<8;n++)t=t&1?t>>>1^3988292384:t>>>1;PM[0][e]=t}for(let e=0;e<256;e++)for(let t=1;t<8;t++){let n=PM[t-1][e];PM[t][e]=n>>>8^PM[0][n&255]}[ZEe,T_t,__t,S_t,Z_t,R_t,C_t,V_t]=PM,kf=class{constructor(t){this.crc=t||-1}append(t){let n=this.crc|0,i=t.length|0,o=0;if(i>=8&&t.buffer){let r=new DataView(t.buffer,t.byteOffset,i),s=i-8;for(;o<=s;o+=8){let a=n^r.getInt32(o,!0),c=r.getInt32(o+4,!0);n=V_t[a&255]^C_t[a>>>8&255]^R_t[a>>>16&255]^Z_t[a>>>24&255]^S_t[c&255]^__t[c>>>8&255]^T_t[c>>>16&255]^ZEe[c>>>24&255]}}for(;o>>8^ZEe[(n^t[o])&255];this.crc=n}get(){return~this.crc}}});var PKi,NM,REe=Xs(()=>{PKi=x(T(),1);XM();NM=class extends TransformStream{constructor(){let t,n=new kf;super({transform(i,o){n.append(i),o.enqueue(i)},flush(){let i=new Uint8Array(4);new DataView(i.buffer).setUint32(0,n.get()),t.value=i}}),t=this}}});function yE(e){if(typeof TextEncoder==$d){e=unescape(encodeURIComponent(e));let t=new Uint8Array(e.length);for(let n=0;n{YKi=x(T(),1);gc()});var wKi,md,YM,CEe,ate,cte,oT,VEe=Xs(()=>{wKi=x(T(),1),md={concat(e,t){if(e.length===0||t.length===0)return e.concat(t);let n=e[e.length-1],i=md.getPartial(n);return i===32?e.concat(t):md._shiftRight(t,i,n|0,e.slice(0,e.length-1))},bitLength(e){let t=e.length;if(t===0)return 0;let n=e[t-1];return(t-1)*32+md.getPartial(n)},clamp(e,t){if(e.length*320&&t&&(e[n-1]=md.partial(t,e[n-1]&2147483648>>t-1,1)),e},partial(e,t,n){return e===32?t:(n?t|0:t<<32-e)+e*1099511627776},getPartial(e){return Math.round(e/1099511627776)||32},_shiftRight(e,t,n,i){for(i===void 0&&(i=[]);t>=32;t-=32)i.push(n),n=0;if(t===0)return i.concat(e);for(let s=0;s>>t),n=e[s]<<32-t;let o=e.length?e[e.length-1]:0,r=md.getPartial(o);return i.push(md.partial(t+r&31,t+r>32?n:i.pop(),1)),i}},YM={bytes:{fromBits(e){let n=md.bitLength(e)/8,i=new Uint8Array(n),o;for(let r=0;r>>24,o<<=8;return i},toBits(e){let t=[],n,i=0;for(n=0;n9007199254740991)throw new Error("Cannot hash more than 2^53 - 1 bits");let r=new Uint32Array(n),s=0;for(let a=t.blockSize+i-(t.blockSize+i&t.blockSize-1);a<=o;a+=t.blockSize)t._block(r.subarray(16*s,16*(s+1))),s+=1;return n.splice(0,16*s),t}finalize(){let e=this,t=e._buffer,n=e._h;t=md.concat(t,[md.partial(1,1)]);for(let i=t.length+2;i&15;i++)t.push(0);for(t.push(Math.floor(e._length/4294967296)),t.push(e._length|0);t.length;)e._block(t.splice(0,16));return e.reset(),n}_f(e,t,n,i){if(e<=19)return t&n|~t&i;if(e<=39)return t^n^i;if(e<=59)return t&n|t&i|n&i;if(e<=79)return t^n^i}_S(e,t){return t<>>32-e}_block(e){let t=this,n=t._h,i=Array(80);for(let d=0;d<16;d++)i[d]=e[d];let o=n[0],r=n[1],s=n[2],a=n[3],c=n[4];for(let d=0;d<=79;d++){d>=16&&(i[d]=t._S(1,i[d-3]^i[d-8]^i[d-14]^i[d-16]));let u=t._S(5,o)+t._f(d,r,s,a)+c+i[d]+t._key[Math.floor(d/20)]|0;c=a,a=s,s=t._S(30,r),r=o,o=u}n[0]=n[0]+o|0,n[1]=n[1]+r|0,n[2]=n[2]+s|0,n[3]=n[3]+a|0,n[4]=n[4]+c|0}};ate={};ate.aes=class{constructor(e){let t=this;t._tables=[[[],[],[],[],[]],[[],[],[],[],[]]],t._tables[0][0][0]||t._precompute();let n=t._tables[0][4],i=t._tables[1],o=e.length,r,s,a,c=1;if(o!==4&&o!==6&&o!==8)throw new Error("invalid aes key size");for(t._key=[s=e.slice(0),a=[]],r=o;r<4*o+28;r++){let d=s[r-1];(r%o===0||o===8&&r%o===4)&&(d=n[d>>>24]<<24^n[d>>16&255]<<16^n[d>>8&255]<<8^n[d&255],r%o===0&&(d=d<<8^d>>>24^c<<24,c=c<<1^(c>>7)*283)),s[r]=s[r-o]^d}for(let d=0;r;d++,r--){let u=s[d&3?r:r-4];r<=4||d<4?a[d]=u:a[d]=i[0][n[u>>>24]]^i[1][n[u>>16&255]]^i[2][n[u>>8&255]]^i[3][n[u&255]]}}encrypt(e){return this._crypt(e,0)}decrypt(e){return this._crypt(e,1)}_precompute(){let e=this._tables[0],t=this._tables[1],n=e[4],i=t[4],o=[],r=[],s,a,c,d;for(let u=0;u<256;u++)r[(o[u]=u<<1^(u>>7)*283)^u]=u;for(let u=s=0;!n[u];u^=a||1,s=r[s]||1){let m=s^s<<1^s<<2^s<<3^s<<4;m=m>>8^m&255^99,n[u]=m,i[m]=u,d=o[c=o[a=o[u]]];let p=d*16843009^c*65537^a*257^u*16843008,b=o[m]*257^m*16843008;for(let f=0;f<4;f++)e[f][u]=b=b<<24^b>>>8,t[f][m]=p=p<<24^p>>>8}for(let u=0;u<5;u++)e[u]=e[u].slice(0),t[u]=t[u].slice(0)}_crypt(e,t){if(e.length!==4)throw new Error("invalid aes block size");let n=this._key[t],i=n.length/4-2,o=[0,0,0,0],r=this._tables[t],s=r[0],a=r[1],c=r[2],d=r[3],u=r[4],m=e[0]^n[0],p=e[t?3:1]^n[1],b=e[2]^n[2],f=e[t?1:3]^n[3],y=4,_,S,Z;for(let R=0;R>>24]^a[p>>16&255]^c[b>>8&255]^d[f&255]^n[y],S=s[p>>>24]^a[b>>16&255]^c[f>>8&255]^d[m&255]^n[y+1],Z=s[b>>>24]^a[f>>16&255]^c[m>>8&255]^d[p&255]^n[y+2],f=s[f>>>24]^a[m>>16&255]^c[p>>8&255]^d[b&255]^n[y+3],y+=4,m=_,p=S,b=Z;for(let R=0;R<4;R++)o[t?3&-R:R]=u[m>>>24]<<24^u[p>>16&255]<<16^u[b>>8&255]<<8^u[f&255]^n[y++],_=m,m=p,p=b,b=f,f=_;return o}};cte={};cte.ctrGladman=class{constructor(e,t){this._prf=e,this._initIv=t,this._iv=t}reset(){this._iv=this._initIv}update(e){return this.calculate(this._prf,e,this._iv)}incWord(e){if((e>>24&255)===255){let t=e>>16&255,n=e>>8&255,i=e&255;t===255?(t=0,n===255?(n=0,i===255?i=0:++i):++n):++t,e=0,e+=t<<16,e+=n<<8,e+=i}else e+=1<<24;return e}incCounter(e){(e[0]=this.incWord(e[0]))===0&&(e[1]=this.incWord(e[1]))}calculate(e,t,n){let i;if(!(i=t.length))return[];let o=md.bitLength(t);for(let r=0;r>5)+1<<2,r,s,a,c,d,u=new ArrayBuffer(o),m=new DataView(u),p=0,b=md;for(t=YM.bytes.toBits(t),d=1;p<(o||1);d++){for(r=s=e.encrypt(b.concat(t,[d])),a=1;ao&&(e=new n().update(e).finalize());for(let r=0;r{HKi=x(T(),1);gc();E_t=typeof crypto!=$d&&typeof crypto.getRandomValues==Yr,h0="Invalid password",rT="Invalid signature",sT=rT,Mg="zipjs-abort-check-password",xE="Crypto API not supported"});function WEe(e,t,n,i){Object.assign(e,{ready:new Promise(o=>e.resolveReady=o),password:k_t(t,n),strength:i-1,pendingInput:yo})}function vEe(e,t,n,i,o,r){let{ctr:s,hmac:a,pendingInput:c}=e;c.length&&(t=mh(c,t));let d=t.length-o;n=U_t(n,i+(d-d%TE));let u;for(u=0;u<=d-TE;u+=TE){let m=UM(f0,hh(t,u,u+TE));r&&a.update(m);let p=s.update(m);r||a.update(p),n.set(kM(f0,p),u+i)}return e.pendingInput=hh(t,u),n}async function N_t(e,t,n,i){let o=await FEe(e,t,n,hh(i,0,wM[t])),r=hh(i,wM[t]);if(o[0]!=r[0]||o[1]!=r[1])throw new Error(h0)}async function Y_t(e,t,n){let i=iz(new Uint8Array(wM[t])),o=await FEe(e,t,n,i);return mh(i,o)}async function FEe(e,t,n,i){e.password=null;let o=await M_t(A_t,n,W_t,!1,v_t),r=await w_t(Object.assign({salt:i},lte),o,8*(MM[t]*2+2)),s=new Uint8Array(r),a=UM(f0,hh(s,0,MM[t])),c=UM(f0,hh(s,MM[t],MM[t]*2)),d=hh(s,MM[t]*2);return Object.assign(e,{keys:{key:a,authentication:c,passwordVerification:d},ctr:new P_t(new I_t(a),Array.from(F_t)),hmac:new X_t(c)}),d}async function M_t(e,t,n,i,o){if(EEe)try{return await DM.importKey(e,t,n,i,o)}catch{return EEe=!1,oT.importKey(t)}else return oT.importKey(t)}async function w_t(e,t,n){if(AEe)try{return await DM.deriveBits(e,t,n)}catch{return AEe=!1,oT.pbkdf2(t,e.salt,lte.iterations,n)}else return oT.pbkdf2(t,e.salt,lte.iterations,n)}function k_t(e,t){return t===ke?yE(e):t}function U_t(e,t){if(t&&t>e.length){let n=e;e=new Uint8Array(t),e.set(n,0)}return e}function hh(e,t,n){return e.subarray(t,n)}function kM(e,t){return e.fromBits(t)}function UM(e,t){return e.toBits(t)}var eJi,TE,A_t,GEe,G_t,L_t,W_t,lte,v_t,wM,MM,wg,F_t,az,DM,LEe,f0,I_t,P_t,X_t,EEe,AEe,rz,sz,IEe=Xs(()=>{eJi=x(T(),1);gc();ste();ZZ();VEe();oz();TE=16,A_t="raw",GEe={name:"PBKDF2"},G_t={name:"HMAC"},L_t="SHA-1",W_t=Object.assign({hash:G_t},GEe),lte=Object.assign({iterations:1e3,hash:{name:L_t}},GEe),v_t=["deriveBits"],wM=[8,12,16],MM=[16,24,32],wg=10,F_t=[0,0,0,0],az=typeof crypto!=$d,DM=az&&crypto.subtle,LEe=az&&typeof DM!=$d,f0=YM.bytes,I_t=ate.aes,P_t=cte.ctrGladman,X_t=oT.hmacSha1,EEe=az&&LEe&&typeof DM.importKey==Yr,AEe=az&&LEe&&typeof DM.deriveBits==Yr,rz=class extends TransformStream{constructor({password:t,rawPassword:n,encryptionStrength:i,checkPasswordOnly:o,checkAuthenticationCode:r=!0}){super({start(){WEe(this,t,n,i)},async transform(s,a){let c=this,{password:d,strength:u,resolveReady:m,ready:p}=c;d?(await N_t(c,u,d,hh(s,0,wM[u]+2)),s=hh(s,wM[u]+2),o?a.error(new Error(Mg)):m()):await p;let b=new Uint8Array(s.length-wg-(s.length-wg)%TE);a.enqueue(vEe(c,s,b,0,wg,!0))},async flush(s){let{ctr:a,hmac:c,pendingInput:d,ready:u}=this;if(c&&a){await u;let m=hh(d,0,d.length-wg),p=hh(d,d.length-wg),b=yo;if(m.length){let _=UM(f0,m);c.update(_);let S=a.update(_);b=kM(f0,S)}let f=hh(kM(f0,c.digest()),0,wg),y=d.length>>24]);let o=~e.crcKey2.get();e.keys=[i,n,o]}function MEe(e){let t=e.keys[2]|2;return wEe(Math.imul(t,t^1)>>>8)}function wEe(e){return e&255}function NEe(e){return e&4294967295}var oJi,_E,cz,lz,kEe=Xs(()=>{oJi=x(T(),1);XM();oz();_E=12,cz=class extends TransformStream{constructor({password:t,rawPassword:n,passwordVerification:i,checkPasswordOnly:o}){super({start(){YEe(this,t,n,i)},transform(r,s){let a=this;if(a.password||a.rawPassword){let c=PEe(a,r.subarray(0,_E));if(a.password=a.rawPassword=null,(c[_E-1]^a.passwordVerification)!=0)throw new Error(h0);r=r.subarray(_E)}o?s.error(new Error(Mg)):s.enqueue(PEe(a,r))}})}},lz=class extends TransformStream{constructor({password:t,rawPassword:n,passwordVerification:i}){super({start(){YEe(this,t,n,i)},transform(o,r){let s=this,a,c;if(s.password||s.rawPassword){s.password=s.rawPassword=null;let d=iz(new Uint8Array(_E));d[_E-1]=s.passwordVerification,a=new Uint8Array(o.length+d.length),a.set(XEe(s,d),0),c=_E}else a=new Uint8Array(o.length),c=0;a.set(XEe(s,o),c),r.enqueue(a)}})}}});function Uf(e){if(e instanceof ReadableStream)return e;let t=e.getReader();return new ReadableStream({async pull(n){let{value:i,done:o}=await t.read();o?n.close():n.enqueue(i)},cancel(n){return t.cancel(n)}})}function p0(e,t){e=Uf(e);let n=t?{type:t}:{};if(O_t())return new Response(e).blob().then(o=>t?new Blob([o],n):o);let i=[];return e.pipeTo(new WritableStream({write(o){i.push(o)}})).then(()=>new Blob(i,n))}function O_t(){return typeof Blob.prototype.stream!=Yr||new Blob([]).stream()instanceof ReadableStream}function UEe(e){if(e instanceof WritableStream)return e;let t=e.getWriter();return new WritableStream({write(n){return t.write(n)},close(){return t.close()},abort(n){return t.abort(n)}})}var aJi,SE=Xs(()=>{aJi=x(T(),1);gc()});function uz(e){return B_t.get(e)}function mz(e){return dte.get(e)}function z_t(e,t){let{CompressionStream:n,DecompressionStream:i}=t;if(typeof n!=Yr&&typeof i!=Yr)throw new Error(DEe);dte.set(e,{CompressionStream:n,DecompressionStream:i})}async function OEe(e,t){!dte.has(e)&&t&&z_t(e,await import(t))}var dJi,DEe,B_t,dte,CZ=Xs(()=>{dJi=x(T(),1);gc();DEe="Invalid codec module",B_t=new Map,dte=new Map});function j_t(e,t,n){let i=new kf,o=0,r=!1,s,a,c,d=new Promise((f,y)=>{a=f,c=y});d.catch(()=>{}),n||a();let u=new TransformStream({start(f){let y=new Uint8Array(HEe);y.set(K_t),f.enqueue(y)},transform(f,y){y.enqueue(f)},async flush(f){r=!0,p();try{await d}finally{b()}let y=new Uint8Array(ute),_=fi(y);_.setUint32(0,i.get(),!0),_.setUint32(4,n,!0),f.enqueue(y)},cancel(f){c(f)}}),m=new TransformStream({transform(f,y){i.append(f),o+=f.length,o>=n?a():r&&p(),y.enqueue(f)},cancel(f){c(f)}});return e=Df(e,u),e=RE(e,t),Df(e,m);function p(){b(),s=setTimeout(()=>c(new Error(aT)),J_t)}function b(){clearTimeout(s)}}function hte(e,t){if(!e)return!1;let n=BEe.get(e);n||(n=new Map,BEe.set(e,n));let i=n.get(t);if(i===ke){try{new e(t),i=!0}catch{i=!1}n.set(t,i)}return i}function bz(e){return hte(e,mte)}function fte(e){return hte(e,BM)}function KEe(e,t,n){t=Df(t,new TransformStream({flush:n})),Object.defineProperty(e,"readable",{get(){return t}})}function JEe(e,t,n){if(!e)throw new Error(H_t);return new e(t,n)}function jEe(e,t,n,i,o){let r=t&&i?i:o||i,s=n.deflate64?zEe:mte,a;try{a=new r(s,n)}catch(c){if(t&&o&&r!=o)a=new o(s,n);else throw c}return RE(e,a)}function Df(e,t){return Uf(e).pipeThrough(t)}function RE(e,t){let n=t.writable.getWriter(),i=e.getReader();return o(),t.readable;async function o(){try{for(;;){await n.ready;let r=await i.read();if(r.done){await n.close();break}await n.write(r.value)}}catch(r){await Q_t(n,r),await q_t(i,r)}}}async function Q_t(e,t){try{await e.abort(t)}catch{}}async function q_t(e,t){try{await e.cancel(t)}catch{}}function $_t(e){let t=e.getReader();return new ReadableStream({async pull(n){let i;try{i=await t.read()}catch(s){if(s&&s.message)throw s;let a=new Error(CE);throw a.cause=s,a}let{value:o,done:r}=i;r?n.close():n.enqueue(o)},cancel(n){return t.cancel(n)}})}var _Ji,aT,CE,VE,H_t,mte,zEe,BM,HEe,ute,K_t,J_t,hz,fz,pz,BEe,pte=Xs(()=>{_Ji=x(T(),1);XM();REe();IEe();kEe();oz();gc();ZZ();SE();CZ();aT="Invalid uncompressed size",CE="Invalid compressed data",VE=rT,H_t="Compression method not supported",mte="deflate-raw",zEe="deflate64-raw",BM="gzip",HEe=10,ute=8,K_t=[31,139,8],J_t=5e3,hz=class extends TransformStream{constructor(t,{chunkSize:n,CompressionStreamFallback:i,CompressionStream:o}){super({});let{compressed:r,encrypted:s,useCompressionStream:a,zipCrypto:c,computeCrc32:d,level:u,deflate64:m,format:p,compressionMethod:b,inputSize:f}=t,y=this,_,S,Z,R=super.readable,C=p&&mz(p),E=d&&r&&!m&&!C&&(!s||c)&&!!(a&&o);if((!s||c)&&d&&!E&&(_=new NM,R=Df(R,_)),r)if(C)R=RE(R,JEe(C.CompressionStream,p,{level:u,chunkSize:n,compressionMethod:b,uncompressedSize:f}));else if(E)Z=new fz,R=RE(R,new o(BM)),R=Df(R,Z);else try{R=jEe(R,a,{level:u,chunkSize:n},o,i)}catch(A){let L;try{L=new o(BM)}catch{throw A}R=RE(R,L),R=Df(R,new fz)}s&&(c?R=Df(R,new lz(t)):(S=new sz(t),R=Df(R,S))),KEe(y,R,()=>{(!s||c)&&d&&(y.crc32=E?Z.crc32:new DataView(_.value.buffer).getUint32(0))})}},fz=class extends TransformStream{constructor(){let t,n=HEe,i=new Uint8Array(0);super({transform(o,r){if(n){let d=Math.min(n,o.length);if(n-=d,o=o.subarray(d),!o.length)return}let s=i.length+o.length;if(s<=ute){i=mh(i,o);return}let a=s-ute,c=Math.min(a,i.length);r.enqueue(mh(i.subarray(0,c),o.subarray(0,a-c))),i=mh(i.subarray(c),o.subarray(a-c))},flush(){let o=fi(i);t.crc32=o.getUint32(0,!0),t.uncompressedSize=o.getUint32(4,!0)}}),t=this}};pz=class extends TransformStream{constructor(t,{chunkSize:n,DecompressionStreamFallback:i,DecompressionStream:o}){super({});let{zipCrypto:r,encrypted:s,checkCrc32:a,crc32:c,compressed:d,useCompressionStream:u,deflate64:m,format:p,compressionMethod:b,rawBitFlag:f,outputSize:y}=t,_,S,Z=super.readable;if(s&&(r?Z=Df(Z,new cz(t)):(S=new rz(t),Z=Df(Z,S))),d){let R=p&&mz(p);if(R)Z=RE(Z,JEe(R.DecompressionStream,p,{chunkSize:n,compressionMethod:b,rawBitFlag:f,uncompressedSize:y}));else try{Z=jEe(Z,u,{chunkSize:n,deflate64:m},o,i)}catch(C){if(m||y===ke)throw C;let E;try{E=new o(BM)}catch{throw C}Z=j_t(Z,E,y)}Z=$_t(Z)}a&&(_=new NM,Z=Df(Z,_)),KEe(this,Z,()=>{if(a){let R=new DataView(_.value.buffer);if(c!=R.getUint32(0,!1))throw new Error(VE)}})}},BEe=new Map});var CJi,eSt,QEe,qEe,$Ee,bte,eAe,tAe,EE,yz,gz,zM,xz=Xs(()=>{CJi=x(T(),1);gc();pte();eSt=64*1024,QEe="message",qEe="start",$Ee="pull",bte="data",eAe="ack",tAe="close",EE="deflate",yz="inflate",gz=class extends TransformStream{constructor(t,n){super({});let i=this,{codecType:o}=t,r;o.startsWith(EE)?r=hz:o.startsWith(yz)&&(r=pz),i.outputSize=0;let s=0,a=new r(t,n),c=super.readable,d=new TransformStream({transform(m,p){m&&m.length&&(s+=m.length,p.enqueue(m))},flush(){Object.assign(i,{inputSize:s})}}),u=new TransformStream({transform(m,p){if(m&&m.length&&(p.enqueue(m),i.outputSize+=m.length,t.outputSize!==ke&&i.outputSize>t.outputSize))throw new Error(aT)},flush(){let{crc32:m}=a;Object.assign(i,{crc32:m,inputSize:s})}});Object.defineProperty(i,"readable",{get(){return c.pipeThrough(d).pipeThrough(a).pipeThrough(u)}})}},zM=class extends TransformStream{constructor(t){let n=[],i=0;(!Number.isFinite(t)||t<1)&&(t=eSt),super({transform(s,a){for(n.push(s),i+=s.length;i>t;)a.enqueue(o())},flush(s){i&&s.enqueue(r(n,i))}});function o(){let s=new Uint8Array(t),a=0;for(;aSz(e,t)}}async function Sz({options:e,readable:t,writable:n,onTaskFinished:i},o){let r;try{if(e.compressed&&!e.format){let d=e.codecType.startsWith(EE),u=d?o.CompressionStreamFallback:o.DecompressionStreamFallback,m=d?o.CompressionStream:o.DecompressionStream;if(e.useCompressionStream){if(u&&u.requiresModule&&!bz(m))try{await _z(o)}catch{}}else try{await _z(o)}catch{(!u||u.requiresModule)&&(e.useCompressionStream=!0)}}r=new gz(e,o),await t.pipeThrough(r).pipeThrough(new zM(FM(o))).pipeTo(n,{preventClose:!0,preventAbort:!0});let{crc32:s,inputSize:a,outputSize:c}=r;return{crc32:s,inputSize:a,outputSize:c}}catch(s){throw r&&(s.outputSize=r.outputSize),s}finally{i()}}var LJi,EZ,Tz,nAe,yte,_z,VZ,xte,HM=Xs(()=>{LJi=x(T(),1);gc();m0();xz();EZ="Worker startup timeout",_z=()=>{};VZ=class{constructor(t,{readable:n,writable:i},{options:o,config:r,streamOptions:s,useWebWorkers:a,transferStreams:c,workerURI:d,createWorker:u},m){let{signal:p}=s;return nAe&&(u=ke),Object.assign(t,{busy:!0,generation:(t.generation||0)+1,readable:n.pipeThrough(new zM(FM(r))).pipeThrough(new xte(s),{signal:p}),writable:i,options:Object.assign({},o),workerURI:d,createWorker:u,transferStreams:c,terminate(){return new Promise(b=>{let{worker:f,busy:y}=t;f?(y?t.resolveTerminated=b:(f.terminate(),b()),t.interface=null):b()})},onTaskFinished(){if(t.busy){let{resolveTerminated:b}=t;b&&(t.resolveTerminated=null,t.terminated=!0,t.worker.terminate(),b()),t.busy=!1,m(t)}}}),Tz===ke&&(Tz=typeof Worker!=$d),(a&&yte&&(Tz&&d||u)?yte:_te)(t,r)}},xte=class extends TransformStream{constructor({onstart:t,onprogress:n,size:i,onend:o}){let r=0;super({async start(){t&&await gte(t,i)},async transform(s,a){r+=s.length,n&&await gte(n,r,i),a.enqueue(s)},async flush(){o&&await gte(o,r)}})}}});async function Vz(e,t){let{options:n,config:i}=t,{transferStreams:o,useWebWorkers:r,useCompressionStream:s,compressed:a,checkCrc32:c,computeCrc32:d,encrypted:u,format:m,codecURI:p}=n,{workerURI:b,createWorker:f,maxWorkers:y}=i;m&&(p&&(n.codecURI=aSt(p,i.baseURI)),await OEe(m,n.codecURI)),t.transferStreams=!m&&(o||o===ke&&i.transferStreams);let _=!a&&!c&&!d&&!u,S=m===ke||!!n.codecURI;return t.useWebWorkers=!_&&S&&(r||r===ke&&i.useWebWorkers),t.workerURI=t.useWebWorkers&&b?b:ke,t.createWorker=t.useWebWorkers&&f?f:ke,n.useCompressionStream=s||s===ke&&i.useCompressionStream,(await Z()).run();async function Z(){let C=AZ.find(E=>!E.busy);if(C)return hAe(C),new VZ(C,e,t,R);if(AZ.length{AE.push({resolve:E,stream:e,workerOptions:t}),Rz=i.workerStarvationTimeout,Cz()})}function R(C){if(fAe(),AE.length){let[{resolve:E,stream:A,workerOptions:L}]=AE.splice(0,1);E(new VZ(C,A,L,R)),Cz()}else C.worker?(hAe(C),dSt(C,t)):AZ=AZ.filter(E=>E!=C)}}function aSt(e,t){try{return new URL(e,t).toString()}catch{return e}}function Cz(){!GE&&AE.length&&Number.isFinite(Rz)&&Rz>=0&&(GE=setTimeout(cSt,Rz))}function fAe(){GE&&(clearTimeout(GE),GE=null)}function cSt(){if(GE=null,AE.length){let[{resolve:e,stream:t,workerOptions:n}]=AE.splice(0,1),i=Object.assign({},n,{useWebWorkers:!1,workerURI:ke,createWorker:ke});e(new VZ({},t,i,lSt)),Cz()}}function lSt(){fAe(),Cz()}function dSt(e,t){let{config:n}=t,{terminateWorkerTimeout:i}=n;Number.isFinite(i)&&i>=0&&(e.terminated?e.terminated=!1:e.terminateTimeout=setTimeout(async()=>{AZ=AZ.filter(o=>o!=e);try{await e.terminate()}catch{}},i))}function hAe(e){let{terminateTimeout:t}=e;t&&(clearTimeout(t),e.terminateTimeout=null)}var UJi,AZ,AE,GE,Rz,mAe,Ez=Xs(()=>{UJi=x(T(),1);gc();xz();CZ();HM();AZ=[],AE=[],mAe=0});function bAe(e){if(uSt){let t="";for(let n=0;n{OJi=x(T(),1),pAe="\0\u263A\u263B\u2665\u2666\u2663\u2660\u2022\u25D8\u25CB\u25D9\u2642\u2640\u266A\u266B\u263C\u25BA\u25C4\u2195\u203C\xB6\xA7\u25AC\u21A8\u2191\u2193\u2192\u2190\u221F\u2194\u25B2\u25BC !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~\u2302\xC7\xFC\xE9\xE2\xE4\xE0\xE5\xE7\xEA\xEB\xE8\xEF\xEE\xEC\xC4\xC5\xC9\xE6\xC6\xF4\xF6\xF2\xFB\xF9\xFF\xD6\xDC\xA2\xA3\xA5\u20A7\u0192\xE1\xED\xF3\xFA\xF1\xD1\xAA\xBA\xBF\u2310\xAC\xBD\xBC\xA1\xAB\xBB\u2591\u2592\u2593\u2502\u2524\u2561\u2562\u2556\u2555\u2563\u2551\u2557\u255D\u255C\u255B\u2510\u2514\u2534\u252C\u251C\u2500\u253C\u255E\u255F\u255A\u2554\u2569\u2566\u2560\u2550\u256C\u2567\u2568\u2564\u2565\u2559\u2558\u2552\u2553\u256B\u256A\u2518\u250C\u2588\u2584\u258C\u2590\u2580\u03B1\xDF\u0393\u03C0\u03A3\u03C3\xB5\u03C4\u03A6\u0398\u03A9\u03B4\u221E\u03C6\u03B5\u2229\u2261\xB1\u2265\u2264\u2320\u2321\xF7\u2248\xB0\u2219\xB7\u221A\u207F\xB2\u25A0\xA0".split(""),uSt=pAe.length==256});function KM(e,t){return xAe(e,t,!0)}function yAe(e,t){return xAe(e,t,!1)}function xAe(e,t,n){return t&&t.trim().toLowerCase()=="cp437"?bAe(e):new TextDecoder(t,{ignoreBOM:n}).decode(e)}var HJi,Ete=Xs(()=>{HJi=x(T(),1);gAe()});function hSt(){ZAe=(async()=>{try{let t=new Blob([new Uint8Array(3)]).slice(1,2).stream().getReader(),n=0,i=await t.read();for(;!i.done;)n+=i.value.length,i=await t.read();Ate=n==1}catch{Ate=!1}})()}function Wz(e){return!!(e&&e.getData)}async function Nc(e,t){if(e.init&&!e.initialized)await e.init(t);else return Promise.resolve()}async function fSt(e){return e=new kg(e),await Nc(e),(e.size===ke||!e.readUint8Array)&&(e=new eu(await p0(e.readable)),await Nc(e)),e}function Mr(e,t,n){return e.readUint8Array(t,n)}function Lte(e,t){return e.createReadable?e.createReadable(t):e.readUint8Array?WE.prototype.createReadable.call(e,t):e.readable}var nji,_Ae,SAe,mSt,$Ji,eji,Gte,TAe,LE,WE,Az,JM,Ate,ZAe,eu,vE,jM,QM,Gz,Lz,kg,FE,vz=Xs(()=>{nji=x(T(),1);gc();m0();ZZ();SE();Ete();_Ae="Writer iterator completed too soon",SAe="Writer not initialized",mSt="text/plain",$Ji=256*1024,eji=16*1024*1024,Gte="writable",TAe=Symbol(),LE=class{constructor(){this.size=0}init(){this.initialized=!0}},WE=class extends LE{get readable(){return this.createReadable()}createReadable({offset:t=0,size:n,chunkSize:i=FM(Yg())}={}){let o=this,r=0;return i=rte(i),new ReadableStream({async pull(s){let a=n===ke?i:Math.min(i,n-r),c=await Mr(o,t+r,a);c.length&&s.enqueue(c),r+i>=n||!c.length&&a?s.close():r+=i}})}},Az=class extends LE{constructor(){super();let t=this,n=new WritableStream({write(i){if(!t.initialized)throw new Error(SAe);return t.writeUint8Array(nz(i))}});Object.defineProperty(t,Gte,{get(){return n}})}writeUint8Array(){}},JM=class extends Az{constructor(t){super(),Object.assign(this,{contentType:t,data:"data:"+(t||"")+";base64,",pendingCharacters:""})}writeUint8Array(t){let n=this,i,o=n.pendingCharacters,r=n.pendingCharacters.length;for(n.pendingCharacters="",i=0;i2?n.data+=btoa(o):n.pendingCharacters=o+n.pendingCharacters}getData(){return this.data+btoa(this.pendingCharacters)}};eu=class extends WE{constructor(t){super(),Object.assign(this,{sourceBlob:t,size:t.size}),ZAe||hSt()}createReadable(t){let n=this,{sourceBlob:i,size:o}=n,{offset:r=0,size:s=o-r}=t||{};return!r&&s>=o?Uf(i.stream()):Ate?Uf(i.slice(r,r+s).stream()):super.createReadable(t)}async readUint8Array(t,n){let i=this,o=t+n,a=await(!t&&o>=i.size?i.sourceBlob:i.sourceBlob.slice(t,o)).arrayBuffer();return a.byteLength>n&&(a=a.slice(t,o)),new Uint8Array(a)}},vE=class extends LE{constructor(t){super();let n=this,i=new TransformStream;Object.defineProperty(n,Gte,{get(){return i.writable}}),n.contentType=t,n.blobPromise=p0(i.readable,t),n.blobPromise.catch(()=>{})}getData(){return this.blobPromise}},jM=class extends eu{constructor(t){super(new Blob([t],{type:mSt}))}},QM=class extends vE{constructor(t){super(),Object.assign(this,{encoding:t,utf8:!t||t.toLowerCase()=="utf-8"})}async getData(){let{encoding:t,utf8:n}=this,i=await super.getData();return i.text&&n?i.text():yAe(new Uint8Array(await i.arrayBuffer()),t)}},Gz=class extends WE{constructor(t){super(),this.readers=t}async init(){let t=this;t.lastDiskNumber=0;let n=t.readers=await Promise.all(t.readers.map(fSt));t.diskOffsets=n.map(i=>{let o=t.size;return t.size+=i.size,o}),super.init()}getDiskOffset(t){let{diskOffsets:n,size:i}=this,o=n[t];return o===ke?i:o}async readUint8Array(t,n){let i=this,{readers:o}=this,r,s=0,a=t;for(;o[s]&&a>=o[s].size;)a-=o[s].size,s++;let c=o[s];if(c){let d=c.size;if(a+n<=d)r=await Mr(c,a,n);else{let u=d-a,m=await Mr(c,a,u),p=await i.readUint8Array(t+u,n-u);r=mh(m,p)}}else r=yo;return i.lastDiskNumber=Math.max(s,i.lastDiskNumber),r}},Lz=class extends LE{constructor(t,n=4294967295){super();let i=this;Object.assign(i,{diskNumber:0,diskOffset:0,size:0,maxSize:n,availableSize:n});let o,r,s,a=new WritableStream({async write(m){if(m===TAe){s&&await d();return}let{availableSize:p}=i;if(s)m.length>=p?(await c(m.subarray(0,p)),await d(),m.length>p&&await this.write(m.subarray(p))):await c(m);else{let{value:b,done:f}=await t.next();if(f&&!b)throw new Error(_Ae);o=b,o.size=0,o.maxSize&&(i.maxSize=o.maxSize),i.availableSize=i.maxSize,await Nc(o),r=b.writable,s=r.getWriter(),await this.write(m)}},async close(){s&&(await s.ready,await u())},async abort(m){s&&await s.abort(m)}});Object.defineProperty(i,Gte,{get(){return a}});async function c(m){let p=m.length;p&&(await s.ready,await s.write(m),o.size+=p,i.availableSize-=p)}async function d(){await u(),i.diskOffset+=o.size,i.diskNumber++,s=null,i.availableSize=i.maxSize}async function u(){await s.close()}}async closeDisk(){let t=this.writable.getWriter();try{await t.ready,await t.write(TAe)}finally{t.releaseLock()}}},kg=class{constructor(t){return Array.isArray(t)&&(t=new Gz(t)),(t instanceof ReadableStream||typeof t.getReader==Yr)&&(t={readable:Uf(t)}),t}},FE=class{constructor(t){return t.writable===ke&&typeof t.next==Yr&&(t=new Lz(t)),(t instanceof WritableStream||typeof t.getWriter==Yr)&&(t={writable:UEe(t)}),t.size===ke&&(t.size=0),t}}});var oji,Wte,vte,qM,Fte,$M,Ite,Pte,Xte,IE,PE,ew,Nte,tw,Yte,Mte,wte,Fz,Iz,kte,Ute,Dte,Pz,Ote,Bte,zte,Hte,GZ,Kte,pSt,Jte,Xz,bSt,Nz,gSt,ySt,xSt,TSt,jte,Qte,qte,$te,_St,SSt,ZSt,RSt,CSt,VSt,ESt,ASt,GSt,LSt,WSt,vSt,FSt,ISt,PSt,XSt,cT,ene=Xs(()=>{oji=x(T(),1),Wte="filename",vte="rawFilename",qM="comment",Fte="rawComment",$M="uncompressedSize",Ite="compressedSize",Pte="offset",Xte="diskNumberStart",IE="lastModDate",PE="rawLastModDate",ew="lastAccessDate",Nte="rawLastAccessDate",tw="creationDate",Yte="rawCreationDate",Mte="internalFileAttributes",wte="externalFileAttributes",Fz="internalFileAttribute",Iz="externalFileAttribute",kte="msdosAttributesRaw",Ute="msdosAttributes",Dte="msDosCompatible",Pz="zip64",Ote="encrypted",Bte="version",zte="versionMadeBy",Hte="zipCrypto",GZ="directory",Kte="executable",pSt="symlink",Jte="compressionMethod",Xz="signature",bSt="crc32",Nz="extraField",gSt="extraFieldInfoZip",ySt="extraFieldUnix",xSt="extraFieldUnixType1",TSt="extraFieldPkwareUnix",jte="unixMode",Qte="setuid",qte="setgid",$te="sticky",_St="bitFlag",SSt="rawBitFlag",ZSt="filenameLength",RSt="extraFieldLength",CSt="unixExternalUpper",VSt="filenameUTF8",ESt="commentUTF8",ASt="rawExtraField",GSt="extraFieldZip64",LSt="extraFieldUnicodePath",WSt="extraFieldUnicodeComment",vSt="extraFieldAES",FSt="extraFieldNTFS",ISt="extraFieldExtendedTimestamp",PSt="extraFieldUSDZ",XSt=[Wte,vte,$M,Ite,IE,PE,qM,Fte,ew,Nte,tw,Yte,Pte,Xte,Mte,wte,Fz,Iz,kte,Ute,Dte,Pz,Ote,Bte,zte,Hte,GZ,Kte,pSt,Jte,Xz,bSt,Nz,ySt,gSt,xSt,TSt,"uid","gid",jte,CSt,Qte,qte,$te,_St,SSt,ZSt,RSt,VSt,ESt,ASt,GSt,LSt,WSt,vSt,FSt,ISt,PSt],cT=class{constructor(t){XSt.forEach(n=>this[n]=t[n])}}});var QAe={};Cle(QAe,{ERR_AMBIGUOUS_ARCHIVE:()=>Ane,ERR_BAD_FORMAT:()=>XE,ERR_CENTRAL_DIRECTORY_NOT_FOUND:()=>Sne,ERR_ENCRYPTED:()=>Cne,ERR_ENCRYPTED_CENTRAL_DIRECTORY:()=>Gne,ERR_ENTRY_DATA_OUT_OF_BOUNDS:()=>Ene,ERR_EOCDR_LOCATOR_ZIP64_NOT_FOUND:()=>_ne,ERR_EOCDR_NOT_FOUND:()=>Tne,ERR_EXTRAFIELD_ZIP64_NOT_FOUND:()=>Rne,ERR_INVALID_AUTHENTICATION_CODE:()=>sT,ERR_INVALID_COMPRESSED_DATA:()=>CE,ERR_INVALID_CRC32:()=>VE,ERR_INVALID_FILENAME_VALIDATION:()=>vne,ERR_INVALID_MAX_APPENDED_DATA_SIZE:()=>Fne,ERR_INVALID_PASSWORD:()=>h0,ERR_INVALID_SIGNATURE:()=>rT,ERR_INVALID_STRICTNESS:()=>Wne,ERR_INVALID_UNCOMPRESSED_SIZE:()=>aT,ERR_LOCAL_FILE_HEADER_NOT_FOUND:()=>Zne,ERR_OVERLAPPING_ENTRY:()=>Vne,ERR_SPLIT_ZIP_FILE:()=>Uz,ERR_UNSAFE_FILENAME:()=>Lne,ERR_UNSUPPORTED_COMPRESSION:()=>kz,ERR_UNSUPPORTED_ENCRYPTION:()=>wz,ERR_UNSUPPORTED_UINT64:()=>Ine,ERR_WORKER_STARTUP_TIMEOUT:()=>EZ,WARNING_APPENDED_DATA:()=>Oz,WARNING_COMPRESSED_PATCHED_DATA:()=>Nne,WARNING_DUPLICATE_FILENAME:()=>kne,WARNING_MALFORMED_EXTRA_FIELD:()=>iH,WARNING_MISMATCHED_LOCAL_FILE_HEADER_BIT_FLAG:()=>Une,WARNING_MISMATCHED_LOCAL_FILE_HEADER_COMPRESSION_METHOD:()=>Dne,WARNING_MISMATCHED_LOCAL_FILE_HEADER_CRC32_OR_SIZES:()=>One,WARNING_MISMATCHED_ZIP64_END_OF_CENTRAL_DIRECTORY:()=>NE,WARNING_PREPENDED_CENTRAL_DIRECTORY:()=>Mne,WARNING_PREPENDED_DATA:()=>Bz,WARNING_TRAILING_CENTRAL_DIRECTORY_DATA:()=>wne,WARNING_UNKNOWN_VERSION:()=>Xne,WARNING_UNKNOWN_ZIP64_EXTENSIBLE_DATA:()=>Yne,WARNING_UNSORTED_CENTRAL_DIRECTORY:()=>Pne,WARNING_WRAPPED_ENTRIES_COUNT:()=>Dz,ZipReader:()=>FZ,ZipReaderStream:()=>Hz,isZipFile:()=>UAe});async function UAe(e,t={}){if(e=new kg(e),await Nc(e),(e.size===ke||!e.readUint8Array)&&(e=new eu(await p0(e.readable)),await Nc(e)),e.size<22)return!1;let n=zne(t,{}),i=n!=Ng,o=HAe(t[tte],n),{endOfDirectoryInfo:r,endOfDirectoryReachingEndCount:s}=await KAe(e,i,o);if(!r||n==iT&&s>1)return!1;let a=xo(fi(r),20),c=r.offset+22+a;return e.size-c<=o}function tne(e){let t=Math.min(e.byteLength,1024)-3;for(let n=0;n=6){let t=fi(e);if(Fi(t,0)==84233040){let n=xo(t,4);if(6+n<=e.length)return e.subarray(6,6+n)}}}function jSt(e,t,n){let i=e&&e.compressedSize?e.compressedSize:t;return i>0&&i<=n?i:n}function QSt(e){let t={rawExtensibleData:e};if(e.length>=28){let n=fi(e),i=xo(n,26);Object.assign(t,{compressionMethod:xo(n,0),compressedSize:$u(n,2),uncompressedSize:$u(n,10),encryptionAlgorithm:xo(n,18),bitLength:xo(n,20),flags:xo(n,22),hashAlgorithm:xo(n,24),hashData:e.subarray(28,28+i)})}return t}function DAe(e,t,n){let i=e.rawBitFlag=xo(t,n+2),o=(i&1)==1,r=Fi(t,n+6);Object.assign(e,{encrypted:o,version:xo(t,n),bitFlag:{level:(i&6)>>1,dataDescriptor:(i&8)==8,languageEncodingFlag:(i&2048)==2048},rawLastModDate:r,lastModDate:mZt(r),filenameLength:xo(t,n+22),extraFieldLength:xo(t,n+24)})}function OAe(e,t,n,i,o){let{rawExtraField:r}=t,s=t.extraField=new Map,a=fi(r),c=0,d=!1;try{for(;cr.length&&(d=!0);let u=xo(n,i+4);Object.assign(t,{signature:Fi(n,i+10),crc32:Fi(n,i+10),compressedSize:Fi(n,i+14),uncompressedSize:Fi(n,i+18)});let m=s.get(1);m&&(qSt(m,t),t.extraFieldZip64=m);let p=s.get(28789);p&&(FAe(p,Wte,vte,t,e),t.extraFieldUnicodePath=p);let b=s.get(25461);b&&(FAe(b,qM,Fte,t,e),t.extraFieldUnicodeComment=b);let f=s.get(39169);f&&f.data.length>=7?($St(f,t,u),t.extraFieldAES=f):t.compressionMethod=u;let y=s.get(13);y&&(IAe(y,t),t.extraFieldPkwareUnix=y);let _=s.get(22613);_&&(IAe(_,t),t.extraFieldUnixType1=_);let S=s.get(10);S&&(eZt(S,t),t.extraFieldNTFS=S);let Z=s.get(30805),R;if(Z&&(R=PAe(Z,t,!1),t.extraFieldUnix=Z),!R){let A=s.get(30837);A&&(PAe(A,t,!0),t.extraFieldInfoZip=A)}let C=s.get(21589);C&&(tZt(C,t,o),t.extraFieldExtendedTimestamp=C);let E=s.get(6534);return E&&(t.extraFieldUSDZ=E),d}function qSt(e,t){t.zip64=!0;let n=fi(e.data),i=zSt.filter(([r,s])=>t[r]==s),o=i.reduce((r,[,s])=>r+LAe[s].bytes,0);if(e.data.length=12&&(r.uid=xo(n,8),r.gid=xo(n,10)),Object.assign(e,r),Object.assign(t,r)}function PAe(e,t,n){try{let i=fi(e.data),o,r;if(n){let s=0,a=dT(i,s++),c=dT(i,s++);o=XAe(e.data.subarray(s,s+c)),s+=c;let d=dT(i,s++);r=XAe(e.data.subarray(s,s+d)),Object.assign(e,{version:a,uid:o,gid:r})}else e.data.length>=4&&(o=xo(i,0),r=xo(i,2),Object.assign(e,{uid:o,gid:r}));return o!==ke&&(t.uid=o),r!==ke&&(t.gid=r),o!==ke||r!==ke}catch{}}function XAe(e){let t=new Uint8Array(4);return t.set(e,0),new DataView(t.buffer,t.byteOffset,4).getUint32(0,!0)}function tZt(e,t,n){if(!e.data.length)return;let i=fi(e.data),o=dT(i,0),r=[],s=[];n?((o&1)==1&&(r.push(IE),s.push(PE)),(o&2)==2&&(r.push(ew),s.push(Nte)),(o&4)==4&&(r.push(tw),s.push(Yte))):e.data.length>=5&&(r.push(IE),s.push(PE));let a=1;r.forEach((c,d)=>{if(e.data.length>=a+4){let u=Fi(i,a);t[c]=e[c]=new Date((u|0)*1e3);let m=s[d];e[m]=u}a+=4})}async function nZt({reader:e,fileEntry:t,index:n,offset:i,crc32:o,compressedSize:r,uncompressedSize:s,dataOffset:a,dataDescriptor:c,extraFieldZip64:d,readRanges:u}){let m=0;if(c&&(d?m=20:m=12),m){let b=await Mr(e,a+r,m+4),f=fi(b),y=b.length==m+4&&Fi(f,0)==134695760;if(y){let _=NAe(f,4,d);(t.encrypted&&!t.zipCrypto||_.crc32==o)&&_.compressedSize==r&&_.uncompressedSize==s?m+=4:y=!1}if(b.length>=m){let _=NAe(f,y?4:0,d);_.signature=y,t.localDirectory.dataDescriptor=_}}let p={start:i,end:a+r+m,fileEntry:t};for(let[b,f]of u)if(b!=n&&p.start1&&n[n.length-1]===""&&n.pop(),n.includes("..")||e.startsWith("/")||e.startsWith("\\\\")||OSt.test(e)?!0:t==iT&&(n.includes(".")||n.includes(""))}function HAe(e,t){if(e!==ke){let n=SZ(e);if(typeof n!=WVe||Number.isNaN(n)||n<0)throw new Error(Fne);return n}return t==iT?0:t==Ng?1/0:65535}async function KAe(e,t,n){let{size:i}=e,o=Math.min(i,65557),r={count:KSt},s,a,c=0;for await(let[d,u,m,p,b]of JAe(e,o)){let f=xo(d,p+20);if(b+22+f==i){let y=await jAe(e,d,u,p,b,i,r);if(y==zz){if(s||(s=rne(m,p,b)),c++,!t||c>1)break}else y==Bne&&!a&&(a=rne(m,p,b))}}return s||(s=a),s||(s=await dZt(e,n,r)),{endOfDirectoryInfo:s,endOfDirectoryReachingEndCount:c}}async function dZt(e,t,n){let{size:i}=e,o=Math.min(i,t==1/0?i:65557+t),r,s;for await(let[a,c,d,u,m]of JAe(e,o)){let p=rne(d,u,m);r||(r=p);let b=await jAe(e,a,c,u,m,i,n);if(b==zz)return p;b==Bne&&!s&&(s=p)}return s||r}async function*JAe(e,t){let n=e.size-t,i=await Mr(e,n,t),o=fi(i);for(let r=i.length-22;r>=0;r--)Fi(o,r)==101010256&&(yield[o,n,i,r,n+r])}function rne(e,t,n){return{offset:n,buffer:e.slice(t,t+22).buffer}}async function jAe(e,t,n,i,o,r,s){let a=xo(t,i+10),c=Fi(t,i+12),d=Fi(t,i+16);if(a==65535||c==4294967295||d==4294967295)return await MAe(e,t,n,o-20,r,s)==117853008?zz:WAe;if(!a&&!c)return Bne;let u=xo(t,i+6);for(let m of[o-c,YE(e,u)+d])if(await MAe(e,t,n,m,r,s)==33639248)return zz;return WAe}async function MAe(e,t,n,i,o,r){if(i<0||i+4>o)return ke;if(i>=n)return Fi(t,i-n);if(r.count>0){r.count--;let s=await Mr(e,i,4);return Fi(fi(s),0)}return ke}function uZt(e,t,n,i,o){let{rawFilename:r}=e,s=!o,a=e.decryptedDirectory&&(t.rawBitFlag&8192)==8192;i&&!a&&(n.length!=r.length||n.some((c,d)=>c!=r[d]))&&y0(s,o,"mismatched local file header (filename)"),(t.rawBitFlag&GAe)!=(e.rawBitFlag&GAe)&&y0(s,o,Une),t.compressionMethod!=e.compressionMethod&&y0(s,o,Dne),!t.bitFlag.dataDescriptor&&!a&&(t.crc32||t.compressedSize||t.uncompressedSize)&&(t.crc32!=e.crc32||t.compressedSize!=e.compressedSize||t.uncompressedSize!=e.uncompressedSize)&&y0(s,o,One)}function y0(e,t,n){e?Yz(n):fh(t,n)}function fh(e,t,n){if(!e.some(i=>i.reason==t)){let i={reason:t};n!==ke&&(i.filename=n),e.push(i)}}function Yz(e){let t=new Error(Ane);throw t.reason=e,t}function Gs(e,t,n){return t[n]===ke?e.options[n]:t[n]}function wAe(e,t,n){return pE(Gs(e,t,n))}function mZt(e){let t=(e&4294901760)>>16,n=e&65535,i=new Date(1980+((t&65024)>>9),((t&480)>>5)-1,t&31,(n&63488)>>11,(n&2016)>>5,(n&31)*2,0);return iHSt)throw new Error(Ine);return Number(n)}var bji,XE,Tne,_ne,Sne,Zne,Rne,Cne,wz,kz,Uz,Vne,Ene,Ane,Gne,Lne,Wne,vne,Fne,Ine,Pne,Xne,Nne,iH,Yne,Dz,Oz,Bz,Mne,wne,kne,NE,Une,Dne,One,DSt,OSt,EAe,BSt,AAe,GAe,kAe,zSt,LAe,HSt,KSt,JSt,WAe,Bne,zz,FZ,Hz,one,Hne=Xs(()=>{bji=x(T(),1);gc();m0();CZ();Ez();vz();Ete();ZZ();SE();XM();ene();vM();XE="File format is not recognized",Tne="End of central directory not found",_ne="End of Zip64 central directory locator not found",Sne="Central directory header not found",Zne="Local file header not found",Rne="Zip64 extra field not found",Cne="File contains encrypted entry",wz="Encryption method not supported",kz="Compression method not supported",Uz="Split zip file",Vne="Overlapping entry found",Ene="Entry data out of bounds",Ane="Ambiguous archive",Gne="Encrypted central directory is not supported",Lne="Unsafe filename",Wne="Invalid strictness (must be 'strict', 'balanced' or 'tolerant')",vne="Invalid filenameValidation (must be 'strict', 'balanced' or 'tolerant')",Fne="Invalid maxAppendedDataSize (must be a number greater than or equal to 0)",Ine="64-bit value exceeds Number.MAX_SAFE_INTEGER",Pne="unsorted central directory",Xne="unknown version needed to extract",Nne="compressed patched data",iH="malformed extra field",Yne="unknown zip64 extensible data",Dz="wrapped entries count",Oz="appended data",Bz="prepended data",Mne="prepended central directory",wne="trailing central directory data",kne="duplicate filename",NE="mismatched zip64 end of central directory record",Une="mismatched local file header (general purpose bit flag)",Dne="mismatched local file header (compression method)",One="mismatched local file header (crc32 or sizes)",DSt=63,OSt=/^[a-zA-Z]:/,EAe="utf-8",BSt="UTF8",AAe="cp437",GAe=2057,kAe=1,zSt=[[$M,4294967295],[Ite,4294967295],[Pte,4294967295],[Xte,65535]],LAe={65535:{getValue:Fi,bytes:4},4294967295:{getValue:$u,bytes:8}},HSt=BigInt(Number.MAX_SAFE_INTEGER),KSt=64,JSt=1032,WAe=0,Bne=1,zz=2,FZ=class{constructor(t,n={}){Object.assign(this,{reader:new kg(t),options:n,readRanges:new Map})}async*getEntriesGenerator(t={}){let n=this,{reader:i}=n;if(await Nc(i),(i.size===ke||!i.readUint8Array)&&(i=new eu(await p0(i.readable)),await Nc(i)),i.size<22)throw new Error(XE);let o=n.warnings=[],r=zne(t,n.options),s=r==iT,a=r!=Ng,c=HAe(Gs(n,t,tte),r),d=cZt(Gs(n,t,aEe),r),u=Gs(n,t,cEe),{endOfDirectoryInfo:m,endOfDirectoryReachingEndCount:p}=await KAe(i,a,c);if(!m)throw await iZt(i)?new Error(Uz):new Error(Tne);a&&p>1&&Yz("multiple end of central directory records");let b=fi(m),f=Fi(b,12),y=Fi(b,16),_=m.offset,S=xo(b,20),Z=_+22+S,R=i.size-Z;R>c&&Yz(Oz),R>0&&fh(o,Oz);let C=xo(b,4),E=i.lastDiskNumber||0,A=xo(b,6),L=xo(b,10),F=0,I,N,g,V,G=56,v,X=y==4294967295||f==4294967295||L==65535||A==65535;if(y!=4294967295&&A!=65535&&(y+=YE(i,A)),X){let Be=m.offset>=20?await Mr(i,m.offset-20,20):yo,je=fi(Be);if(Be.length==20&&Fi(je,0)==117853008){y=YE(i,Fi(je,4))+$u(je,8);let qe=await Mr(i,y,56),We=fi(qe),Ke=m.offset-20-56;if((qe.length<56||Fi(We,0)!=101075792)&&y!=Ke&&Ke>=0){let ct=y;y=Ke,y>ct&&(F=y-ct),qe=await Mr(i,y,56),We=fi(qe)}if(qe.length<56||Fi(We,0)!=101075792)throw new Error(_ne);if(g=!0,V=$u(We,4)>44,V){let ct=Math.min($u(We,4)-44,i.size-y-56);if(ct>0){G+=ct;let Et=await Mr(i,y+56,ct);v=QSt(Et)}}C==65535?C=Fi(We,16):C!=Fi(We,16)&&y0(s,o,NE),A==65535?A=Fi(We,20):A!=Fi(We,20)&&y0(s,o,NE),L==65535?L=$u(We,32):L!=$u(We,32)&&y0(s,o,NE),f==4294967295?f=$u(We,40):f!=$u(We,40)&&y0(s,o,NE),y=YE(i,A)+$u(We,48)+F}}let Y=f,D=m.offset-(g?G+20:0);if(y>=i.size&&(F=i.size-y-f-22,y=i.size-f-22),E!=C)throw new Error(Uz);if(y<0)throw new Error(XE);let M=0,O=await Mr(i,y,f),w=fi(O);if(f){if(O.length<4)throw new Error(XE);let Be=D-f;if(y!=Be&&A==C){let je=Fi(w,M)==33639248||!!(v&&v.compressedSize)||tne(w),qe=!je;if(!qe&&Be>=0&&Be+4<=i.size){let We=await Mr(i,Be,4);qe=Fi(fi(We),0)==33639248}if(qe){let We=y;y=Be,y>We&&(F+=y-We,I=je),O=await Mr(i,y,f),w=fi(O)}}}let z=D-y;if(f!=z&&z>=0&&A==C&&(f=z,O=await Mr(i,y,f),w=fi(O)),y<0||y>=i.size)throw new Error(XE);n.directoryOffset=y,n.directoryLength=Y;let K=wAe(n,t,lEe),te,H;if(K&&L&&O.length>=4&&Fi(w,0)!=33639248&&(V||tne(w))){let Be=jSt(v,Y,O.length);H=O.subarray(Be),O=await K(O.subarray(0,Be),v),w=fi(O),Y=O.length,te=!0}v&&!te&&(O.length<4||Fi(w,0)==33639248)&&fh(o,Yne),N=y;let $=Gs(n,t,FVe),ee=Gs(n,t,IVe),le=new Set,_e,he=-1,Ze=!s&&!g;!L&&Ze&&(L=vAe(w,O,M),L&&fh(o,Dz));for(let Be=0;BeO.length||Fi(w,M)!=33639248)throw Be==0&&!te&&(V||tne(w))?new Error(Gne):new Error(Sne);DAe(je,w,M+6);let qe=!!je.bitFlag.languageEncodingFlag,We=M+46,Ke=We+je.filenameLength,ct=Ke+je.extraFieldLength,Et=xo(w,M+4),zt=Et>>8==0,ut=Et>>8==3,bt=O.subarray(We,Ke),ht=xo(w,M+32),jt=ct+ht,st=O.subarray(ct,jt),pt=qe,Mi=qe,jn=Fi(w,M+38),Si=jn&255,Hi={readOnly:!!(Si&1),hidden:!!(Si&2),system:!!(Si&4),directory:!!(Si&16),archive:!!(Si&32)},Gi=Fi(w,M+42),pi=wAe(n,t,PVe)||KM,Zi=pt?EAe:$||AAe,On=Mi?EAe:ee||AAe,rn=pi(bt,Zi,Q3);if(rn===ke&&(rn=KM(bt,Zi)),u){let wi=u(rn);wi!==ke&&(rn=wi)}if(lZt(rn,d)){let wi=new Error(Lne);throw wi.filename=rn,wi}let Hn=pi(st,On,q3);Hn===ke&&(Hn=KM(st,On)),Object.assign(je,{index:Be,decryptedDirectory:te,versionMadeBy:Et,msDosCompatible:zt,zip64:!1,compressedSize:0,uncompressedSize:0,commentLength:ht,offset:Gi,diskNumberStart:xo(w,M+34),internalFileAttributes:xo(w,M+36),externalFileAttributes:jn,msdosAttributesRaw:Si,msdosAttributes:Hi,rawFilename:bt,filenameUTF8:pt,commentUTF8:Mi,rawExtraField:O.subarray(Ke,ct),rawComment:st,filename:rn,comment:Hn}),OAe(je,je,w,M+6)&&fh(o,iH,rn),je.offset+=F;let $i=YE(i,je.diskNumberStart)+je.offset;N=Math.min($i,N),$iDSt&&fh(o,Xne,rn),(je.rawBitFlag&32)==32&&fh(o,Nne,rn),le.has(je.filename)&&(_e=!0),le.add(je.filename);let Po=je.externalFileAttributes>>16&65535;je.unixMode===ke&&(Po&16877)!=0&&(je.unixMode=Po);let hr=!!(je.unixMode&2048),Is=!!(je.unixMode&1024),Hs=!!(je.unixMode&512),yi=((je.unixMode===ke?Po:je.unixMode)&61440)==40960,fr=!yi&&(je.unixMode!==ke?(je.unixMode&73)!=0:ut&&(Po&73)!=0),mo=je.unixMode!==ke&&(je.unixMode&61440)==16384,Qr=(Po&61440)==16384;Object.assign(je,{setuid:hr,setgid:Is,sticky:Hs,symlink:yi,unixExternalUpper:Po,internalFileAttribute:je.internalFileAttributes,externalFileAttribute:je.externalFileAttributes,executable:fr,directory:mo||Qr||zt&&Hi.directory||je.filename.endsWith("/"),zipCrypto:je.encrypted&&!je.extraFieldAES});let Mn=new cT(je);if(Mn.getData=(wi,Xo)=>je.getData(wi,Mn,n.readRanges,Xo),Mn.arrayBuffer=async wi=>{let Xo=new TransformStream,Dc=p0(Xo.readable).then(bm=>bm.arrayBuffer());return Dc.catch(()=>{}),await je.getData(Xo,Mn,n.readRanges,wi),Dc},M=jt,Be==L-1&&Ze){let wi=vAe(w,O,M);wi&&(L+=wi,fh(o,Dz))}let{onprogress:Ki}=t;if(Ki)try{await Ki(Be+1,L,new cT(je))}catch{}yield Mn}let ye=M,Ge=nne(O.subarray(M))||(te?nne(H):ke);if(!Ge&&!te){let Be=y+M,je=Math.min(D-Be,65541);je>=6&&(Ge=nne(await Mr(i,Be,je)))}Ge&&(n.digitalSignature=Ge,ye=M+6+Ge.length),(M!=Y&&ye!=Y||!te&&M!=f&&ye!=f)&&y0(s,o,wne),_e&&y0(s,o,kne);let Ae=Gs(n,t,XVe),Fe=Gs(n,t,NVe),tt=(s||Ae)&&L&&N==4&&await oZt(i)?4:0;return s&&(F||L&&N>tt)&&Yz(Bz),(F||L&&N>4)&&fh(o,Bz),I&&fh(o,Mne),Ae&&(n.prependedData=N>tt?await Mr(i,tt,N-tt):yo),n.comment=S?await Mr(i,_+22,S):yo,Fe&&(n.appendedData=Z3))throw new Error(wz);if(!N&&!g)throw new Error(Cne)}if(X+R>a.size)throw new Error(Ene);let _e=R,he=Uf(a.createReadable({offset:X,size:_e})),Ze=ez(Gs(r,o,z3)),ye=Gs(r,o,YVe),Ge=Gs(r,o,wVe),Ae=Gs(r,o,MVe);Ae&&(Ge=!0);let{onstart:Fe,onprogress:tt,onend:Be}=o,je=b!=0&&!V,qe=V?R:Z,We=b==9,Ke=Gs(r,o,K3);We&&(Ke=!1);let ct=Gs(r,o,OVe),Et=(ct===ke?Gs(r,o,DVe):ct)&&!V&&(!$||ee||m&&m.vendorVersion==kAe),zt={options:{codecType:yz,password:N,rawPassword:g,zipCrypto:ee,encryptionStrength:m&&m.strength,checkCrc32:Et,checkAuthenticationCode:Gs(r,o,BVe),passwordVerification:ee&&(C?S>>>8&255:_>>>24&255),outputSize:qe,crc32:_,compressed:je,encrypted:$,useWebWorkers:Gs(r,o,H3),useCompressionStream:Ke,transferStreams:Gs(r,o,J3),deflate64:We,format:le?le.format:ke,codecURI:le?le.codecURI:ke,compressionMethod:b,rawBitFlag:y,checkPasswordOnly:ye},config:s,streamOptions:{signal:Ze,size:_e,onstart:Fe,onprogress:tt,onend:Be}};Ge&&await nZt({reader:a,fileEntry:n,index:c,offset:L,crc32:_,compressedSize:R,uncompressedSize:Z,dataOffset:X,dataDescriptor:C||E.bitFlag.dataDescriptor,extraFieldZip64:p||E.extraFieldZip64,readRanges:i});let ut,bt;try{if(!Ae){ye&&(t=new WritableStream),t=new FE(t),await Nc(t,rZt(qe,R,je)),{writable:ut}=t;let{outputSize:ht}=await Vz({readable:he,writable:ut},zt);if(t.size+=ht,ht!=qe)throw new Error(aT)}}catch(ht){if(ht.outputSize!==ke&&(t.size+=ht.outputSize),!ye||ht.message!=Mg)throw bt=ht,ht}finally{if(!(!Wz(t)&&Gs(r,o,j3))&&ut&&!ut.locked){let jt=ut.getWriter();if(bt)try{await jt.abort(bt)}catch{}else await jt.close()}}return ye||Ae?ke:t.getData?t.getData():ut}}});var Kse=gm((E2o,SU)=>{var A2o=x(T());/*! + */(function(e,t){"use strict";typeof SD=="object"&&SD.exports?SD.exports=t(sde(),cde(),dde()):typeof define=="function"&&define.amd?define(["./punycode","./IPv6","./SecondLevelDomains"],t):e.URI=t(e.punycode,e.IPv6,e.SecondLevelDomains,e)})(ude,function(e,t,n,i){"use strict";var o=i&&i.URI;function r(V,G){var v=arguments.length>=1,X=arguments.length>=2;if(!(this instanceof r))return v?X?new r(V,G):new r(V):new r;if(V===void 0){if(v)throw new TypeError("undefined is not a valid argument for URI");typeof location<"u"?V=location.href+"":V=""}if(V===null&&v)throw new TypeError("null is not a valid argument for URI");return this.href(V),G!==void 0?this.absoluteTo(G):this}function s(V){return/^[0-9]+$/.test(V)}r.version="1.19.11";var a=r.prototype,c=Object.prototype.hasOwnProperty;function d(V){return V.replace(/([.*+?^=!:${}()|[\]\/\\])/g,"\\$1")}function u(V){return V===void 0?"Undefined":String(Object.prototype.toString.call(V)).slice(8,-1)}function m(V){return u(V)==="Array"}function p(V,G){var v={},X,Y;if(u(G)==="RegExp")v=null;else if(m(G))for(X=0,Y=G.length;X]+|\(([^\s()<>]+|(\([^\s()<>]+\)))*\))+(?:\(([^\s()<>]+|(\([^\s()<>]+\)))*\)|[^\s`!()\[\]{};:'".,<>?«»“”‘’]))/ig,r.findUri={start:/\b(?:([a-z][a-z0-9.+-]*:\/\/)|www\.)/gi,end:/[\s\r\n]|$/,trim:/[`!()\[\]{};:'".,<>?«»“”„‘’]+$/,parens:/(\([^\)]*\)|\[[^\]]*\]|\{[^}]*\}|<[^>]*>)/g},r.leading_whitespace_expression=/^[\x00-\x20\u00a0\u1680\u2000-\u200a\u2028\u2029\u202f\u205f\u3000\ufeff]+/,r.ascii_tab_whitespace=/[\u0009\u000A\u000D]+/g,r.defaultPorts={http:"80",https:"443",ftp:"21",gopher:"70",ws:"80",wss:"443"},r.hostProtocols=["http","https"],r.invalid_hostname_characters=/[^a-zA-Z0-9\.\-:_]/,r.domAttributes={a:"href",blockquote:"cite",link:"href",base:"href",script:"src",form:"action",img:"src",area:"href",iframe:"src",embed:"src",source:"src",track:"src",input:"src",audio:"src",video:"src"},r.getDomAttribute=function(V){if(!(!V||!V.nodeName)){var G=V.nodeName.toLowerCase();if(!(G==="input"&&V.type!=="image"))return r.domAttributes[G]}};function _(V){return escape(V)}function S(V){return encodeURIComponent(V).replace(/[!'()*]/g,_).replace(/\*/g,"%2A")}r.encode=S,r.decode=decodeURIComponent,r.iso8859=function(){r.encode=escape,r.decode=unescape},r.unicode=function(){r.encode=S,r.decode=decodeURIComponent},r.characters={pathname:{encode:{expression:/%(24|26|2B|2C|3B|3D|3A|40)/ig,map:{"%24":"$","%26":"&","%2B":"+","%2C":",","%3B":";","%3D":"=","%3A":":","%40":"@"}},decode:{expression:/[\/\?#]/g,map:{"/":"%2F","?":"%3F","#":"%23"}}},reserved:{encode:{expression:/%(21|23|24|26|27|28|29|2A|2B|2C|2F|3A|3B|3D|3F|40|5B|5D)/ig,map:{"%3A":":","%2F":"/","%3F":"?","%23":"#","%5B":"[","%5D":"]","%40":"@","%21":"!","%24":"$","%26":"&","%27":"'","%28":"(","%29":")","%2A":"*","%2B":"+","%2C":",","%3B":";","%3D":"="}}},urnpath:{encode:{expression:/%(21|24|27|28|29|2A|2B|2C|3B|3D|40)/ig,map:{"%21":"!","%24":"$","%27":"'","%28":"(","%29":")","%2A":"*","%2B":"+","%2C":",","%3B":";","%3D":"=","%40":"@"}},decode:{expression:/[\/\?#:]/g,map:{"/":"%2F","?":"%3F","#":"%23",":":"%3A"}}}},r.encodeQuery=function(V,G){var v=r.encode(V+"");return G===void 0&&(G=r.escapeQuerySpace),G?v.replace(/%20/g,"+"):v},r.decodeQuery=function(V,G){V+="",G===void 0&&(G=r.escapeQuerySpace);try{return r.decode(G?V.replace(/\+/g,"%20"):V)}catch{return V}};var Z={encode:"encode",decode:"decode"},R,C=function(V,G){return function(v){try{return r[G](v+"").replace(r.characters[V][G].expression,function(X){return r.characters[V][G].map[X]})}catch{return v}}};for(R in Z)r[R+"PathSegment"]=C("pathname",Z[R]),r[R+"UrnPathSegment"]=C("urnpath",Z[R]);var E=function(V,G,v){return function(X){var Y;v?Y=function(w){return r[G](r[v](w))}:Y=r[G];for(var D=(X+"").split(V),M=0,O=D.length;M-1&&(G.fragment=V.substring(v+1)||null,V=V.substring(0,v)),v=V.indexOf("?"),v>-1&&(G.query=V.substring(v+1)||null,V=V.substring(0,v)),V=V.replace(/^(https?|ftp|wss?)?:+[/\\]*/i,"$1://"),V=V.replace(/^[/\\]{2,}/i,"//"),V.substring(0,2)==="//"?(G.protocol=null,V=V.substring(2),V=r.parseAuthority(V,G)):(v=V.indexOf(":"),v>-1&&(G.protocol=V.substring(0,v)||null,G.protocol&&!G.protocol.match(r.protocol_expression)?G.protocol=void 0:V.substring(v+1,v+3).replace(/\\/g,"/")==="//"?(V=V.substring(v+3),V=r.parseAuthority(V,G)):(V=V.substring(v+1),G.urn=!0))),G.path=V,G},r.parseHost=function(V,G){V||(V=""),V=V.replace(/\\/g,"/");var v=V.indexOf("/"),X,Y;if(v===-1&&(v=V.length),V.charAt(0)==="[")X=V.indexOf("]"),G.hostname=V.substring(1,X)||null,G.port=V.substring(X+2,v)||null,G.port==="/"&&(G.port=null);else{var D=V.indexOf(":"),M=V.indexOf("/"),O=V.indexOf(":",D+1);O!==-1&&(M===-1||O-1?Y:V.length-1),M;return D>-1&&(Y===-1||D-1?H=H.slice(0,$)+H.slice($).replace(D,""):H=H.replace(D,""),!(H.length<=w[0].length)&&!(v.ignore&&v.ignore.test(H))){te=z+H.length;var _e=G(H,z,te,V);if(_e===void 0){X.lastIndex=te;continue}_e=String(_e),V=V.slice(0,z)+_e+V.slice(te),X.lastIndex=z+_e.length}}return X.lastIndex=0,V},r.ensureValidHostname=function(V,G){var v=!!V,X=!!G,Y=!1;if(X&&(Y=b(r.hostProtocols,G)),Y&&!v)throw new TypeError("Hostname cannot be empty, if protocol is "+G);if(V&&V.match(r.invalid_hostname_characters)){if(!e)throw new TypeError('Hostname "'+V+'" contains characters other than [A-Z0-9.-:_] and Punycode.js is not available');if(e.toASCII(V).match(r.invalid_hostname_characters))throw new TypeError('Hostname "'+V+'" contains characters other than [A-Z0-9.-:_]')}},r.ensureValidPort=function(V){if(V){var G=Number(V);if(!(s(G)&&G>0&&G<65536))throw new TypeError('Port "'+V+'" is not a valid port')}},r.noConflict=function(V){if(V){var G={URI:this.noConflict()};return i.URITemplate&&typeof i.URITemplate.noConflict=="function"&&(G.URITemplate=i.URITemplate.noConflict()),i.IPv6&&typeof i.IPv6.noConflict=="function"&&(G.IPv6=i.IPv6.noConflict()),i.SecondLevelDomains&&typeof i.SecondLevelDomains.noConflict=="function"&&(G.SecondLevelDomains=i.SecondLevelDomains.noConflict()),G}else i.URI===this&&(i.URI=o);return this},a.build=function(V){return V===!0?this._deferred_build=!0:(V===void 0||this._deferred_build)&&(this._string=r.build(this._parts),this._deferred_build=!1),this},a.clone=function(){return new r(this)},a.valueOf=a.toString=function(){return this.build(!1)._string};function A(V){return function(G,v){return G===void 0?this._parts[V]||"":(this._parts[V]=G||null,this.build(!v),this)}}function L(V,G){return function(v,X){return v===void 0?this._parts[V]||"":(v!==null&&(v=v+"",v.charAt(0)===G&&(v=v.substring(1))),this._parts[V]=v,this.build(!X),this)}}a.protocol=A("protocol"),a.username=A("username"),a.password=A("password"),a.hostname=A("hostname"),a.port=A("port"),a.query=L("query","?"),a.fragment=L("fragment","#"),a.search=function(V,G){var v=this.query(V,G);return typeof v=="string"&&v.length?"?"+v:v},a.hash=function(V,G){var v=this.fragment(V,G);return typeof v=="string"&&v.length?"#"+v:v},a.pathname=function(V,G){if(V===void 0||V===!0){var v=this._parts.path||(this._parts.hostname?"/":"");return V?(this._parts.urn?r.decodeUrnPath:r.decodePath)(v):v}else return this._parts.urn?this._parts.path=V?r.recodeUrnPath(V):"":this._parts.path=V?r.recodePath(V):"/",this.build(!G),this},a.path=a.pathname,a.href=function(V,G){var v;if(V===void 0)return this.toString();this._string="",this._parts=r._parts();var X=V instanceof r,Y=typeof V=="object"&&(V.hostname||V.path||V.pathname);if(V.nodeName){var D=r.getDomAttribute(V);V=V[D]||"",Y=!1}if(!X&&Y&&V.pathname!==void 0&&(V=V.toString()),typeof V=="string"||V instanceof String)this._parts=r.parse(String(V),this._parts);else if(X||Y){var M=X?V._parts:V;for(v in M)v!=="query"&&c.call(this._parts,v)&&(this._parts[v]=M[v]);M.query&&this.query(M.query,!1)}else throw new TypeError("invalid input");return this.build(!G),this},a.is=function(V){var G=!1,v=!1,X=!1,Y=!1,D=!1,M=!1,O=!1,w=!this._parts.urn;switch(this._parts.hostname&&(w=!1,v=r.ip4_expression.test(this._parts.hostname),X=r.ip6_expression.test(this._parts.hostname),G=v||X,Y=!G,D=Y&&n&&n.has(this._parts.hostname),M=Y&&r.idn_expression.test(this._parts.hostname),O=Y&&r.punycode_expression.test(this._parts.hostname)),V.toLowerCase()){case"relative":return w;case"absolute":return!w;case"domain":case"name":return Y;case"sld":return D;case"ip":return G;case"ip4":case"ipv4":case"inet4":return v;case"ip6":case"ipv6":case"inet6":return X;case"idn":return M;case"url":return!this._parts.urn;case"urn":return!!this._parts.urn;case"punycode":return O}return null};var F=a.protocol,I=a.port,N=a.hostname;a.protocol=function(V,G){if(V&&(V=V.replace(/:(\/\/)?$/,""),!V.match(r.protocol_expression)))throw new TypeError('Protocol "'+V+`" contains characters other than [A-Z0-9.+-] or doesn't start with [A-Z]`);return F.call(this,V,G)},a.scheme=a.protocol,a.port=function(V,G){return this._parts.urn?V===void 0?"":this:(V!==void 0&&(V===0&&(V=null),V&&(V+="",V.charAt(0)===":"&&(V=V.substring(1)),r.ensureValidPort(V))),I.call(this,V,G))},a.hostname=function(V,G){if(this._parts.urn)return V===void 0?"":this;if(V!==void 0){var v={preventInvalidHostname:this._parts.preventInvalidHostname},X=r.parseHost(V,v);if(X!=="/")throw new TypeError('Hostname "'+V+'" contains characters other than [A-Z0-9.-]');V=v.hostname,this._parts.preventInvalidHostname&&r.ensureValidHostname(V,this._parts.protocol)}return N.call(this,V,G)},a.origin=function(V,G){if(this._parts.urn)return V===void 0?"":this;if(V===void 0){var v=this.protocol(),X=this.authority();return X?(v?v+"://":"")+this.authority():""}else{var Y=r(V);return this.protocol(Y.protocol()).authority(Y.authority()).build(!G),this}},a.host=function(V,G){if(this._parts.urn)return V===void 0?"":this;if(V===void 0)return this._parts.hostname?r.buildHost(this._parts):"";var v=r.parseHost(V,this._parts);if(v!=="/")throw new TypeError('Hostname "'+V+'" contains characters other than [A-Z0-9.-]');return this.build(!G),this},a.authority=function(V,G){if(this._parts.urn)return V===void 0?"":this;if(V===void 0)return this._parts.hostname?r.buildAuthority(this._parts):"";var v=r.parseAuthority(V,this._parts);if(v!=="/")throw new TypeError('Hostname "'+V+'" contains characters other than [A-Z0-9.-]');return this.build(!G),this},a.userinfo=function(V,G){if(this._parts.urn)return V===void 0?"":this;if(V===void 0){var v=r.buildUserinfo(this._parts);return v&&v.substring(0,v.length-1)}else return V[V.length-1]!=="@"&&(V+="@"),r.parseUserinfo(V,this._parts),this.build(!G),this},a.resource=function(V,G){var v;return V===void 0?this.path()+this.search()+this.hash():(v=r.parse(V),this._parts.path=v.path,this._parts.query=v.query,this._parts.fragment=v.fragment,this.build(!G),this)},a.subdomain=function(V,G){if(this._parts.urn)return V===void 0?"":this;if(V===void 0){if(!this._parts.hostname||this.is("IP"))return"";var v=this._parts.hostname.length-this.domain().length-1;return this._parts.hostname.substring(0,v)||""}else{var X=this._parts.hostname.length-this.domain().length,Y=this._parts.hostname.substring(0,X),D=new RegExp("^"+d(Y));if(V&&V.charAt(V.length-1)!=="."&&(V+="."),V.indexOf(":")!==-1)throw new TypeError("Domains cannot contain colons");return V&&r.ensureValidHostname(V,this._parts.protocol),this._parts.hostname=this._parts.hostname.replace(D,V),this.build(!G),this}},a.domain=function(V,G){if(this._parts.urn)return V===void 0?"":this;if(typeof V=="boolean"&&(G=V,V=void 0),V===void 0){if(!this._parts.hostname||this.is("IP"))return"";var v=this._parts.hostname.match(/\./g);if(v&&v.length<2)return this._parts.hostname;var X=this._parts.hostname.length-this.tld(G).length-1;return X=this._parts.hostname.lastIndexOf(".",X-1)+1,this._parts.hostname.substring(X)||""}else{if(!V)throw new TypeError("cannot set domain empty");if(V.indexOf(":")!==-1)throw new TypeError("Domains cannot contain colons");if(r.ensureValidHostname(V,this._parts.protocol),!this._parts.hostname||this.is("IP"))this._parts.hostname=V;else{var Y=new RegExp(d(this.domain())+"$");this._parts.hostname=this._parts.hostname.replace(Y,V)}return this.build(!G),this}},a.tld=function(V,G){if(this._parts.urn)return V===void 0?"":this;if(typeof V=="boolean"&&(G=V,V=void 0),V===void 0){if(!this._parts.hostname||this.is("IP"))return"";var v=this._parts.hostname.lastIndexOf("."),X=this._parts.hostname.substring(v+1);return G!==!0&&n&&n.list[X.toLowerCase()]&&n.get(this._parts.hostname)||X}else{var Y;if(V)if(V.match(/[^a-zA-Z0-9-]/))if(n&&n.is(V))Y=new RegExp(d(this.tld())+"$"),this._parts.hostname=this._parts.hostname.replace(Y,V);else throw new TypeError('TLD "'+V+'" contains characters other than [A-Z0-9]');else{if(!this._parts.hostname||this.is("IP"))throw new ReferenceError("cannot set TLD on non-domain host");Y=new RegExp(d(this.tld())+"$"),this._parts.hostname=this._parts.hostname.replace(Y,V)}else throw new TypeError("cannot set TLD empty");return this.build(!G),this}},a.directory=function(V,G){if(this._parts.urn)return V===void 0?"":this;if(V===void 0||V===!0){if(!this._parts.path&&!this._parts.hostname)return"";if(this._parts.path==="/")return"/";var v=this._parts.path.length-this.filename().length-1,X=this._parts.path.substring(0,v)||(this._parts.hostname?"/":"");return V?r.decodePath(X):X}else{var Y=this._parts.path.length-this.filename().length,D=this._parts.path.substring(0,Y),M=new RegExp("^"+d(D));return this.is("relative")||(V||(V="/"),V.charAt(0)!=="/"&&(V="/"+V)),V&&V.charAt(V.length-1)!=="/"&&(V+="/"),V=r.recodePath(V),this._parts.path=this._parts.path.replace(M,V),this.build(!G),this}},a.filename=function(V,G){if(this._parts.urn)return V===void 0?"":this;if(typeof V!="string"){if(!this._parts.path||this._parts.path==="/")return"";var v=this._parts.path.lastIndexOf("/"),X=this._parts.path.substring(v+1);return V?r.decodePathSegment(X):X}else{var Y=!1;V.charAt(0)==="/"&&(V=V.substring(1)),V.match(/\.?\//)&&(Y=!0);var D=new RegExp(d(this.filename())+"$");return V=r.recodePath(V),this._parts.path=this._parts.path.replace(D,V),Y?this.normalizePath(G):this.build(!G),this}},a.suffix=function(V,G){if(this._parts.urn)return V===void 0?"":this;if(V===void 0||V===!0){if(!this._parts.path||this._parts.path==="/")return"";var v=this.filename(),X=v.lastIndexOf("."),Y,D;return X===-1?"":(Y=v.substring(X+1),D=/^[a-z0-9%]+$/i.test(Y)?Y:"",V?r.decodePathSegment(D):D)}else{V.charAt(0)==="."&&(V=V.substring(1));var M=this.suffix(),O;if(M)V?O=new RegExp(d(M)+"$"):O=new RegExp(d("."+M)+"$");else{if(!V)return this;this._parts.path+="."+r.recodePath(V)}return O&&(V=r.recodePath(V),this._parts.path=this._parts.path.replace(O,V)),this.build(!G),this}},a.segment=function(V,G,v){var X=this._parts.urn?":":"/",Y=this.path(),D=Y.substring(0,1)==="/",M=Y.split(X);if(V!==void 0&&typeof V!="number"&&(v=G,G=V,V=void 0),V!==void 0&&typeof V!="number")throw new Error('Bad segment "'+V+'", must be 0-based integer');if(D&&M.shift(),V<0&&(V=Math.max(M.length+V,0)),G===void 0)return V===void 0?M:M[V];if(V===null||M[V]===void 0)if(m(G)){M=[];for(var O=0,w=G.length;O{"use strict";var l1n=x(T());$pe.exports=LKe;var sF=1e20;function LKe(e,t){t||(t={});var n=t.cutoff==null?.25:t.cutoff,i=t.radius==null?8:t.radius,o=t.channel||0,r,s,a,c,d,u,m,p,b,f,y;if(ArrayBuffer.isView(e)||Array.isArray(e)){if(!t.width||!t.height)throw Error("For raw data width and height should be provided by options");r=t.width,s=t.height,c=e,t.stride?u=t.stride:u=Math.floor(e.length/r/s)}else window.HTMLCanvasElement&&e instanceof window.HTMLCanvasElement?(p=e,m=p.getContext("2d"),r=p.width,s=p.height,b=m.getImageData(0,0,r,s),c=b.data,u=4):window.CanvasRenderingContext2D&&e instanceof window.CanvasRenderingContext2D?(p=e.canvas,m=e,r=p.width,s=p.height,b=m.getImageData(0,0,r,s),c=b.data,u=4):window.ImageData&&e instanceof window.ImageData&&(b=e,r=e.width,s=e.height,c=b.data,u=4);if(a=Math.max(r,s),window.Uint8ClampedArray&&c instanceof window.Uint8ClampedArray||window.Uint8Array&&c instanceof window.Uint8Array)for(d=c,c=Array(r*s),f=0,y=Math.floor(d.length/u);f{var u1n=x(T());function WKe(){var e=0,t=1,n=2,i=3,o=4,r=5,s=6,a=7,c=8,d=9,u=10,m=11,p=12,b=13,f=14,y=15,_=16,S=17,Z=0,R=1,C=2,E=3,A=4;function L(g,V){return 55296<=g.charCodeAt(V)&&g.charCodeAt(V)<=56319&&56320<=g.charCodeAt(V+1)&&g.charCodeAt(V+1)<=57343}function F(g,V){V===void 0&&(V=0);var G=g.charCodeAt(V);if(55296<=G&&G<=56319&&V=1){var v=g.charCodeAt(V-1),X=G;return 55296<=v&&v<=56319?(v-55296)*1024+(X-56320)+65536:X}return G}function I(g,V,G){var v=[g].concat(V).concat([G]),X=v[v.length-2],Y=G,D=v.lastIndexOf(f);if(D>1&&v.slice(1,D).every(function(w){return w==i})&&[i,b,S].indexOf(g)==-1)return C;var M=v.lastIndexOf(o);if(M>0&&v.slice(1,M).every(function(w){return w==o})&&[p,o].indexOf(X)==-1)return v.filter(function(w){return w==o}).length%2==1?E:A;if(X==e&&Y==t)return Z;if(X==n||X==e||X==t)return Y==f&&V.every(function(w){return w==i})?C:R;if(Y==n||Y==e||Y==t)return R;if(X==s&&(Y==s||Y==a||Y==d||Y==u))return Z;if((X==d||X==a)&&(Y==a||Y==c))return Z;if((X==u||X==c)&&Y==c)return Z;if(Y==i||Y==y)return Z;if(Y==r)return Z;if(X==p)return Z;var O=v.indexOf(i)!=-1?v.lastIndexOf(i)-1:v.length-2;return[b,S].indexOf(v[O])!=-1&&v.slice(O+1,-1).every(function(w){return w==i})&&Y==f||X==y&&[_,S].indexOf(Y)!=-1?Z:V.indexOf(o)!=-1?C:X==o&&Y==o?Z:R}this.nextBreak=function(g,V){if(V===void 0&&(V=0),V<0)return 0;if(V>=g.length-1)return g.length;for(var G=N(F(g,V)),v=[],X=V+1;X{aTo=x(T(),1),hie=new Date(2107,11,31,23,59,58),XE=new Date(1980,0,1),ke=void 0,iR=1/0,ou="undefined",Yr="function",JWe="object",oR="string",jWe="number",QWe="boolean",yo=new Uint8Array});function YE(e){if(e&&typeof e!=Yr)throw new Error(Lve);return e}function mH(e){if(e&&(typeof e.addEventListener!=Yr||typeof e.aborted!=QWe))throw new Error(Wve);return e||ke}function hH(e,t){if(e&&typeof e!=oR||t&&!(t instanceof Uint8Array))throw new Error(bie)}function gie(e,t,n){if(!Number.isInteger(e)||e<0||e>t)throw new Error(n)}function ME(e,t,n){e!==ke&&gie(e,t,n)}function rR(e){return typeof e==oR&&e.trim()?Number(e):e}var dTo,qWe,$We,eve,tve,nve,tH,nH,iH,oH,ive,ove,rve,sve,ave,cve,lve,dve,rH,sH,aH,cH,uve,mve,hve,fve,pve,bve,gve,yve,xve,fie,Tve,_ve,bk,NE,Sve,Zve,Rve,Cve,Vve,Eve,pie,Ave,Gve,lH,dH,yT,uH,Qg,Lve,Wve,bie,gk=Xs(()=>{dTo=x(T(),1);_c();qWe="filenameEncoding",$We="commentEncoding",eve="decodeText",tve="extractPrependedData",nve="extractAppendedData",tH="password",nH="rawPassword",iH="passThrough",oH="signal",ive="checkPasswordOnly",ove="checkOverlappingEntryOnly",rve="checkOverlappingEntry",sve="checkAmbiguity",ave="checkLocalDirectory",cve="checkSignature",lve="checkCrc32",dve="checkAuthenticationCode",rH="useWebWorkers",sH="useCompressionStream",aH="transferStreams",cH="preventClose",uve="encryptionStrength",mve="extendedTimestamp",hve="ntfsTimestamp",fve="keepOrder",pve="level",bve="bufferedWrite",gve="createTempStream",yve="dataDescriptorSignature",xve="useUnicodeFileNames",fie="dataDescriptor",Tve="supportZip64SplitFile",_ve="encodeText",bk="offset",NE="usdz",Sve="unixExtraFieldType",Zve="localExtraField",Rve="centralExtraField",Cve="strictness",Vve="filenameValidation",Eve="normalizeFilename",pie="maxAppendedDataSize",Ave="decryptCentralDirectory",Gve="signCentralDirectory",lH="filename",dH="comment",yT="strict",uH="balanced",Qg="tolerant",Lve="Invalid option (must be a function)",Wve="Invalid signal (must be an AbortSignal instance)",bie="Invalid password (password must be a string, rawPassword must be a Uint8Array)"});function qg(){return yie}function yk(e){return xie(e.chunkSize)}function xie(e){return e=rR(e),Number.isInteger(e)&&e>=Fve?Math.max(e,JIt):vve}function xk(e){Object.assign(yie,wve(kve(e)))}function wve(e){let t={};for(let n of qIt){let i=e[n];i!==ke&&(t[n]=$It(n,i))}return t}function $It(e,t){if(Yve.includes(e)){if(t=rR(t),e==Nve&&(!Number.isInteger(t)||t{fTo=x(T(),1);_c();gk();vve=64*1024,JIt=64,Fve=1,Ive="Invalid maxWorkers (must be an integer greater than 0)",Pve=2;try{typeof navigator!=ou&&navigator.hardwareConcurrency&&(Pve=navigator.hardwareConcurrency)}catch{}Xve={workerURI:"./core/web-worker-wasm.js",wasmURI:"./core/streams/zlib-wasm/zlib-streams.wasm",chunkSize:vve,maxWorkers:Pve,terminateWorkerTimeout:5e3,workerStarvationTimeout:5e3,workerStartupTimeout:5e3,useWebWorkers:!0,useCompressionStream:!0,transferStreams:!0,CompressionStream:typeof CompressionStream!=ou&&CompressionStream,DecompressionStream:typeof DecompressionStream!=ou&&DecompressionStream},Nve="maxWorkers",jIt=["baseURI","wasmURI","workerURI"],QIt=["useCompressionStream","useWebWorkers","transferStreams"],Yve=["chunkSize",Nve,"terminateWorkerTimeout","workerStarvationTimeout","workerStartupTimeout"],Mve=["createWorker","CompressionStream","DecompressionStream","CompressionStreamFallback","DecompressionStreamFallback"],qIt=[...jIt,...QIt,...Yve,...Mve],yie={...Xve}});function Sh(e,t){let n=new Uint8Array(e.length+t.length);return n.set(e),n.set(t,e.length),n}function fH(e){return e.byteOffset||e.byteLength!=e.buffer.byteLength?new Uint8Array(e):e}function fi(e){return new DataView(e.buffer,e.byteOffset,e.byteLength)}var bTo,sR=Xs(()=>{bTo=x(T(),1)});var yTo,Tk,Uve,ePt,tPt,nPt,iPt,oPt,rPt,sPt,jf,_k=Xs(()=>{yTo=x(T(),1),Tk=[[],[],[],[],[],[],[],[]];for(let e=0;e<256;e++){let t=e;for(let n=0;n<8;n++)t=t&1?t>>>1^3988292384:t>>>1;Tk[0][e]=t}for(let e=0;e<256;e++)for(let t=1;t<8;t++){let n=Tk[t-1][e];Tk[t][e]=n>>>8^Tk[0][n&255]}[Uve,ePt,tPt,nPt,iPt,oPt,rPt,sPt]=Tk,jf=class{constructor(t){this.crc=t||-1}append(t){let n=this.crc|0,i=t.length|0,o=0;if(i>=8&&t.buffer){let r=new DataView(t.buffer,t.byteOffset,i),s=i-8;for(;o<=s;o+=8){let a=n^r.getInt32(o,!0),c=r.getInt32(o+4,!0);n=sPt[a&255]^rPt[a>>>8&255]^oPt[a>>>16&255]^iPt[a>>>24&255]^nPt[c&255]^tPt[c>>>8&255]^ePt[c>>>16&255]^Uve[c>>>24&255]}}for(;o>>8^Uve[(n^t[o])&255];this.crc=n}get(){return~this.crc}}});var _To,Sk,Dve=Xs(()=>{_To=x(T(),1);_k();Sk=class extends TransformStream{constructor(){let t,n=new jf;super({transform(i,o){n.append(i),o.enqueue(i)},flush(){let i=new Uint8Array(4);new DataView(i.buffer).setUint32(0,n.get()),t.value=i}}),t=this}}});function kE(e){if(typeof TextEncoder==ou){e=unescape(encodeURIComponent(e));let t=new Uint8Array(e.length);for(let n=0;n{RTo=x(T(),1);_c()});var VTo,gd,Zk,Ove,_ie,Sie,xT,Bve=Xs(()=>{VTo=x(T(),1),gd={concat(e,t){if(e.length===0||t.length===0)return e.concat(t);let n=e[e.length-1],i=gd.getPartial(n);return i===32?e.concat(t):gd._shiftRight(t,i,n|0,e.slice(0,e.length-1))},bitLength(e){let t=e.length;if(t===0)return 0;let n=e[t-1];return(t-1)*32+gd.getPartial(n)},clamp(e,t){if(e.length*320&&t&&(e[n-1]=gd.partial(t,e[n-1]&2147483648>>t-1,1)),e},partial(e,t,n){return e===32?t:(n?t|0:t<<32-e)+e*1099511627776},getPartial(e){return Math.round(e/1099511627776)||32},_shiftRight(e,t,n,i){for(i===void 0&&(i=[]);t>=32;t-=32)i.push(n),n=0;if(t===0)return i.concat(e);for(let s=0;s>>t),n=e[s]<<32-t;let o=e.length?e[e.length-1]:0,r=gd.getPartial(o);return i.push(gd.partial(t+r&31,t+r>32?n:i.pop(),1)),i}},Zk={bytes:{fromBits(e){let n=gd.bitLength(e)/8,i=new Uint8Array(n),o;for(let r=0;r>>24,o<<=8;return i},toBits(e){let t=[],n,i=0;for(n=0;n9007199254740991)throw new Error("Cannot hash more than 2^53 - 1 bits");let r=new Uint32Array(n),s=0;for(let a=t.blockSize+i-(t.blockSize+i&t.blockSize-1);a<=o;a+=t.blockSize)t._block(r.subarray(16*s,16*(s+1))),s+=1;return n.splice(0,16*s),t}finalize(){let e=this,t=e._buffer,n=e._h;t=gd.concat(t,[gd.partial(1,1)]);for(let i=t.length+2;i&15;i++)t.push(0);for(t.push(Math.floor(e._length/4294967296)),t.push(e._length|0);t.length;)e._block(t.splice(0,16));return e.reset(),n}_f(e,t,n,i){if(e<=19)return t&n|~t&i;if(e<=39)return t^n^i;if(e<=59)return t&n|t&i|n&i;if(e<=79)return t^n^i}_S(e,t){return t<>>32-e}_block(e){let t=this,n=t._h,i=Array(80);for(let d=0;d<16;d++)i[d]=e[d];let o=n[0],r=n[1],s=n[2],a=n[3],c=n[4];for(let d=0;d<=79;d++){d>=16&&(i[d]=t._S(1,i[d-3]^i[d-8]^i[d-14]^i[d-16]));let u=t._S(5,o)+t._f(d,r,s,a)+c+i[d]+t._key[Math.floor(d/20)]|0;c=a,a=s,s=t._S(30,r),r=o,o=u}n[0]=n[0]+o|0,n[1]=n[1]+r|0,n[2]=n[2]+s|0,n[3]=n[3]+a|0,n[4]=n[4]+c|0}};_ie={};_ie.aes=class{constructor(e){let t=this;t._tables=[[[],[],[],[],[]],[[],[],[],[],[]]],t._tables[0][0][0]||t._precompute();let n=t._tables[0][4],i=t._tables[1],o=e.length,r,s,a,c=1;if(o!==4&&o!==6&&o!==8)throw new Error("invalid aes key size");for(t._key=[s=e.slice(0),a=[]],r=o;r<4*o+28;r++){let d=s[r-1];(r%o===0||o===8&&r%o===4)&&(d=n[d>>>24]<<24^n[d>>16&255]<<16^n[d>>8&255]<<8^n[d&255],r%o===0&&(d=d<<8^d>>>24^c<<24,c=c<<1^(c>>7)*283)),s[r]=s[r-o]^d}for(let d=0;r;d++,r--){let u=s[d&3?r:r-4];r<=4||d<4?a[d]=u:a[d]=i[0][n[u>>>24]]^i[1][n[u>>16&255]]^i[2][n[u>>8&255]]^i[3][n[u&255]]}}encrypt(e){return this._crypt(e,0)}decrypt(e){return this._crypt(e,1)}_precompute(){let e=this._tables[0],t=this._tables[1],n=e[4],i=t[4],o=[],r=[],s,a,c,d;for(let u=0;u<256;u++)r[(o[u]=u<<1^(u>>7)*283)^u]=u;for(let u=s=0;!n[u];u^=a||1,s=r[s]||1){let m=s^s<<1^s<<2^s<<3^s<<4;m=m>>8^m&255^99,n[u]=m,i[m]=u,d=o[c=o[a=o[u]]];let p=d*16843009^c*65537^a*257^u*16843008,b=o[m]*257^m*16843008;for(let f=0;f<4;f++)e[f][u]=b=b<<24^b>>>8,t[f][m]=p=p<<24^p>>>8}for(let u=0;u<5;u++)e[u]=e[u].slice(0),t[u]=t[u].slice(0)}_crypt(e,t){if(e.length!==4)throw new Error("invalid aes block size");let n=this._key[t],i=n.length/4-2,o=[0,0,0,0],r=this._tables[t],s=r[0],a=r[1],c=r[2],d=r[3],u=r[4],m=e[0]^n[0],p=e[t?3:1]^n[1],b=e[2]^n[2],f=e[t?1:3]^n[3],y=4,_,S,Z;for(let R=0;R>>24]^a[p>>16&255]^c[b>>8&255]^d[f&255]^n[y],S=s[p>>>24]^a[b>>16&255]^c[f>>8&255]^d[m&255]^n[y+1],Z=s[b>>>24]^a[f>>16&255]^c[m>>8&255]^d[p&255]^n[y+2],f=s[f>>>24]^a[m>>16&255]^c[p>>8&255]^d[b&255]^n[y+3],y+=4,m=_,p=S,b=Z;for(let R=0;R<4;R++)o[t?3&-R:R]=u[m>>>24]<<24^u[p>>16&255]<<16^u[b>>8&255]<<8^u[f&255]^n[y++],_=m,m=p,p=b,b=f,f=_;return o}};Sie={};Sie.ctrGladman=class{constructor(e,t){this._prf=e,this._initIv=t,this._iv=t}reset(){this._iv=this._initIv}update(e){return this.calculate(this._prf,e,this._iv)}incWord(e){if((e>>24&255)===255){let t=e>>16&255,n=e>>8&255,i=e&255;t===255?(t=0,n===255?(n=0,i===255?i=0:++i):++n):++t,e=0,e+=t<<16,e+=n<<8,e+=i}else e+=1<<24;return e}incCounter(e){(e[0]=this.incWord(e[0]))===0&&(e[1]=this.incWord(e[1]))}calculate(e,t,n){let i;if(!(i=t.length))return[];let o=gd.bitLength(t);for(let r=0;r>5)+1<<2,r,s,a,c,d,u=new ArrayBuffer(o),m=new DataView(u),p=0,b=gd;for(t=Zk.bytes.toBits(t),d=1;p<(o||1);d++){for(r=s=e.encrypt(b.concat(t,[d])),a=1;ao&&(e=new n().update(e).finalize());for(let r=0;r{FTo=x(T(),1);_c();aPt=typeof crypto!=ou&&typeof crypto.getRandomValues==Yr,L0="Invalid password",TT="Invalid signature",_T=TT,$g="zipjs-abort-check-password",UE="Crypto API not supported"});function jve(e,t,n,i){Object.assign(e,{ready:new Promise(o=>e.resolveReady=o),password:_Pt(t,n),strength:i-1,pendingInput:yo})}function Qve(e,t,n,i,o,r){let{ctr:s,hmac:a,pendingInput:c}=e;c.length&&(t=Sh(c,t));let d=t.length-o;n=SPt(n,i+(d-d%DE));let u;for(u=0;u<=d-DE;u+=DE){let m=Ek(W0,Zh(t,u,u+DE));r&&a.update(m);let p=s.update(m);r||a.update(p),n.set(Vk(W0,p),u+i)}return e.pendingInput=Zh(t,u),n}async function gPt(e,t,n,i){let o=await qve(e,t,n,Zh(i,0,Ck[t])),r=Zh(i,Ck[t]);if(o[0]!=r[0]||o[1]!=r[1])throw new Error(L0)}async function yPt(e,t,n){let i=pH(new Uint8Array(Ck[t])),o=await qve(e,t,n,i);return Sh(i,o)}async function qve(e,t,n,i){e.password=null;let o=await xPt(cPt,n,uPt,!1,mPt),r=await TPt(Object.assign({salt:i},Zie),o,8*(Rk[t]*2+2)),s=new Uint8Array(r),a=Ek(W0,Zh(s,0,Rk[t])),c=Ek(W0,Zh(s,Rk[t],Rk[t]*2)),d=Zh(s,Rk[t]*2);return Object.assign(e,{keys:{key:a,authentication:c,passwordVerification:d},ctr:new pPt(new fPt(a),Array.from(hPt)),hmac:new bPt(c)}),d}async function xPt(e,t,n,i,o){if(zve)try{return await Ak.importKey(e,t,n,i,o)}catch{return zve=!1,xT.importKey(t)}else return xT.importKey(t)}async function TPt(e,t,n){if(Hve)try{return await Ak.deriveBits(e,t,n)}catch{return Hve=!1,xT.pbkdf2(t,e.salt,Zie.iterations,n)}else return xT.pbkdf2(t,e.salt,Zie.iterations,n)}function _Pt(e,t){return t===ke?kE(e):t}function SPt(e,t){if(t&&t>e.length){let n=e;e=new Uint8Array(t),e.set(n,0)}return e}function Zh(e,t,n){return e.subarray(t,n)}function Vk(e,t){return e.fromBits(t)}function Ek(e,t){return e.toBits(t)}var wTo,DE,cPt,Kve,lPt,dPt,uPt,Zie,mPt,Ck,Rk,ey,hPt,xH,Ak,Jve,W0,fPt,pPt,bPt,zve,Hve,gH,yH,$ve=Xs(()=>{wTo=x(T(),1);_c();Tie();sR();Bve();bH();DE=16,cPt="raw",Kve={name:"PBKDF2"},lPt={name:"HMAC"},dPt="SHA-1",uPt=Object.assign({hash:lPt},Kve),Zie=Object.assign({iterations:1e3,hash:{name:dPt}},Kve),mPt=["deriveBits"],Ck=[8,12,16],Rk=[16,24,32],ey=10,hPt=[0,0,0,0],xH=typeof crypto!=ou,Ak=xH&&crypto.subtle,Jve=xH&&typeof Ak!=ou,W0=Zk.bytes,fPt=_ie.aes,pPt=Sie.ctrGladman,bPt=xT.hmacSha1,zve=xH&&Jve&&typeof Ak.importKey==Yr,Hve=xH&&Jve&&typeof Ak.deriveBits==Yr,gH=class extends TransformStream{constructor({password:t,rawPassword:n,encryptionStrength:i,checkPasswordOnly:o,checkAuthenticationCode:r=!0}){super({start(){jve(this,t,n,i)},async transform(s,a){let c=this,{password:d,strength:u,resolveReady:m,ready:p}=c;d?(await gPt(c,u,d,Zh(s,0,Ck[u]+2)),s=Zh(s,Ck[u]+2),o?a.error(new Error($g)):m()):await p;let b=new Uint8Array(s.length-ey-(s.length-ey)%DE);a.enqueue(Qve(c,s,b,0,ey,!0))},async flush(s){let{ctr:a,hmac:c,pendingInput:d,ready:u}=this;if(c&&a){await u;let m=Zh(d,0,d.length-ey),p=Zh(d,d.length-ey),b=yo;if(m.length){let _=Ek(W0,m);c.update(_);let S=a.update(_);b=Vk(W0,S)}let f=Zh(Vk(W0,c.digest()),0,ey),y=d.length>>24]);let o=~e.crcKey2.get();e.keys=[i,n,o]}function o2e(e){let t=e.keys[2]|2;return r2e(Math.imul(t,t^1)>>>8)}function r2e(e){return e&255}function n2e(e){return e&4294967295}var OTo,OE,TH,_H,s2e=Xs(()=>{OTo=x(T(),1);_k();bH();OE=12,TH=class extends TransformStream{constructor({password:t,rawPassword:n,passwordVerification:i,checkPasswordOnly:o}){super({start(){i2e(this,t,n,i)},transform(r,s){let a=this;if(a.password||a.rawPassword){let c=e2e(a,r.subarray(0,OE));if(a.password=a.rawPassword=null,(c[OE-1]^a.passwordVerification)!=0)throw new Error(L0);r=r.subarray(OE)}o?s.error(new Error($g)):s.enqueue(e2e(a,r))}})}},_H=class extends TransformStream{constructor({password:t,rawPassword:n,passwordVerification:i}){super({start(){i2e(this,t,n,i)},transform(o,r){let s=this,a,c;if(s.password||s.rawPassword){s.password=s.rawPassword=null;let d=pH(new Uint8Array(OE));d[OE-1]=s.passwordVerification,a=new Uint8Array(o.length+d.length),a.set(t2e(s,d),0),c=OE}else a=new Uint8Array(o.length),c=0;a.set(t2e(s,o),c),r.enqueue(a)}})}}});function Qf(e){if(e instanceof ReadableStream)return e;let t=e.getReader();return new ReadableStream({async pull(n){let{value:i,done:o}=await t.read();o?n.close():n.enqueue(i)},cancel(n){return t.cancel(n)}})}function v0(e,t){e=Qf(e);let n=t?{type:t}:{};if(RPt())return new Response(e).blob().then(o=>t?new Blob([o],n):o);let i=[];return e.pipeTo(new WritableStream({write(o){i.push(o)}})).then(()=>new Blob(i,n))}function RPt(){return typeof Blob.prototype.stream!=Yr||new Blob([]).stream()instanceof ReadableStream}function a2e(e){if(e instanceof WritableStream)return e;let t=e.getWriter();return new WritableStream({write(n){return t.write(n)},close(){return t.close()},abort(n){return t.abort(n)}})}var HTo,BE=Xs(()=>{HTo=x(T(),1);_c()});function ZH(e){return CPt.get(e)}function RH(e){return Rie.get(e)}function VPt(e,t){let{CompressionStream:n,DecompressionStream:i}=t;if(typeof n!=Yr&&typeof i!=Yr)throw new Error(c2e);Rie.set(e,{CompressionStream:n,DecompressionStream:i})}async function l2e(e,t){!Rie.has(e)&&t&&VPt(e,await import(t))}var jTo,c2e,CPt,Rie,cR=Xs(()=>{jTo=x(T(),1);_c();c2e="Invalid codec module",CPt=new Map,Rie=new Map});function LPt(e,t,n){let i=new jf,o=0,r=!1,s,a,c,d=new Promise((f,y)=>{a=f,c=y});d.catch(()=>{}),n||a();let u=new TransformStream({start(f){let y=new Uint8Array(m2e);y.set(APt),f.enqueue(y)},transform(f,y){y.enqueue(f)},async flush(f){r=!0,p();try{await d}finally{b()}let y=new Uint8Array(Cie),_=fi(y);_.setUint32(0,i.get(),!0),_.setUint32(4,n,!0),f.enqueue(y)},cancel(f){c(f)}}),m=new TransformStream({transform(f,y){i.append(f),o+=f.length,o>=n?a():r&&p(),y.enqueue(f)},cancel(f){c(f)}});return e=qf(e,u),e=HE(e,t),qf(e,m);function p(){b(),s=setTimeout(()=>c(new Error(ST)),GPt)}function b(){clearTimeout(s)}}function Eie(e,t){if(!e)return!1;let n=d2e.get(e);n||(n=new Map,d2e.set(e,n));let i=n.get(t);if(i===ke){try{new e(t),i=!0}catch{i=!1}n.set(t,i)}return i}function AH(e){return Eie(e,Vie)}function Aie(e){return Eie(e,Lk)}function h2e(e,t,n){t=qf(t,new TransformStream({flush:n})),Object.defineProperty(e,"readable",{get(){return t}})}function f2e(e,t,n){if(!e)throw new Error(EPt);return new e(t,n)}function p2e(e,t,n,i,o){let r=t&&i?i:o||i,s=n.deflate64?u2e:Vie,a;try{a=new r(s,n)}catch(c){if(t&&o&&r!=o)a=new o(s,n);else throw c}return HE(e,a)}function qf(e,t){return Qf(e).pipeThrough(t)}function HE(e,t){let n=t.writable.getWriter(),i=e.getReader();return o(),t.readable;async function o(){try{for(;;){await n.ready;let r=await i.read();if(r.done){await n.close();break}await n.write(r.value)}}catch(r){await WPt(n,r),await vPt(i,r)}}}async function WPt(e,t){try{await e.abort(t)}catch{}}async function vPt(e,t){try{await e.cancel(t)}catch{}}function FPt(e){let t=e.getReader();return new ReadableStream({async pull(n){let i;try{i=await t.read()}catch(s){if(s&&s.message)throw s;let a=new Error(KE);throw a.cause=s,a}let{value:o,done:r}=i;r?n.close():n.enqueue(o)},cancel(n){return t.cancel(n)}})}var a_o,ST,KE,JE,EPt,Vie,u2e,Lk,m2e,Cie,APt,GPt,CH,VH,EH,d2e,Gie=Xs(()=>{a_o=x(T(),1);_k();Dve();$ve();s2e();bH();_c();sR();BE();cR();ST="Invalid uncompressed size",KE="Invalid compressed data",JE=TT,EPt="Compression method not supported",Vie="deflate-raw",u2e="deflate64-raw",Lk="gzip",m2e=10,Cie=8,APt=[31,139,8],GPt=5e3,CH=class extends TransformStream{constructor(t,{chunkSize:n,CompressionStreamFallback:i,CompressionStream:o}){super({});let{compressed:r,encrypted:s,useCompressionStream:a,zipCrypto:c,computeCrc32:d,level:u,deflate64:m,format:p,compressionMethod:b,inputSize:f}=t,y=this,_,S,Z,R=super.readable,C=p&&RH(p),E=d&&r&&!m&&!C&&(!s||c)&&!!(a&&o);if((!s||c)&&d&&!E&&(_=new Sk,R=qf(R,_)),r)if(C)R=HE(R,f2e(C.CompressionStream,p,{level:u,chunkSize:n,compressionMethod:b,uncompressedSize:f}));else if(E)Z=new VH,R=HE(R,new o(Lk)),R=qf(R,Z);else try{R=p2e(R,a,{level:u,chunkSize:n},o,i)}catch(A){let L;try{L=new o(Lk)}catch{throw A}R=HE(R,L),R=qf(R,new VH)}s&&(c?R=qf(R,new _H(t)):(S=new yH(t),R=qf(R,S))),h2e(y,R,()=>{(!s||c)&&d&&(y.crc32=E?Z.crc32:new DataView(_.value.buffer).getUint32(0))})}},VH=class extends TransformStream{constructor(){let t,n=m2e,i=new Uint8Array(0);super({transform(o,r){if(n){let d=Math.min(n,o.length);if(n-=d,o=o.subarray(d),!o.length)return}let s=i.length+o.length;if(s<=Cie){i=Sh(i,o);return}let a=s-Cie,c=Math.min(a,i.length);r.enqueue(Sh(i.subarray(0,c),o.subarray(0,a-c))),i=Sh(i.subarray(c),o.subarray(a-c))},flush(){let o=fi(i);t.crc32=o.getUint32(0,!0),t.uncompressedSize=o.getUint32(4,!0)}}),t=this}};EH=class extends TransformStream{constructor(t,{chunkSize:n,DecompressionStreamFallback:i,DecompressionStream:o}){super({});let{zipCrypto:r,encrypted:s,checkCrc32:a,crc32:c,compressed:d,useCompressionStream:u,deflate64:m,format:p,compressionMethod:b,rawBitFlag:f,outputSize:y}=t,_,S,Z=super.readable;if(s&&(r?Z=qf(Z,new TH(t)):(S=new gH(t),Z=qf(Z,S))),d){let R=p&&RH(p);if(R)Z=HE(Z,f2e(R.DecompressionStream,p,{chunkSize:n,compressionMethod:b,rawBitFlag:f,uncompressedSize:y}));else try{Z=p2e(Z,u,{chunkSize:n,deflate64:m},o,i)}catch(C){if(m||y===ke)throw C;let E;try{E=new o(Lk)}catch{throw C}Z=LPt(Z,E,y)}Z=FPt(Z)}a&&(_=new Sk,Z=qf(Z,_)),h2e(this,Z,()=>{if(a){let R=new DataView(_.value.buffer);if(c!=R.getUint32(0,!1))throw new Error(JE)}})}},d2e=new Map});var u_o,IPt,b2e,g2e,y2e,Lie,x2e,T2e,jE,LH,GH,Wk,WH=Xs(()=>{u_o=x(T(),1);_c();Gie();IPt=64*1024,b2e="message",g2e="start",y2e="pull",Lie="data",x2e="ack",T2e="close",jE="deflate",LH="inflate",GH=class extends TransformStream{constructor(t,n){super({});let i=this,{codecType:o}=t,r;o.startsWith(jE)?r=CH:o.startsWith(LH)&&(r=EH),i.outputSize=0;let s=0,a=new r(t,n),c=super.readable,d=new TransformStream({transform(m,p){m&&m.length&&(s+=m.length,p.enqueue(m))},flush(){Object.assign(i,{inputSize:s})}}),u=new TransformStream({transform(m,p){if(m&&m.length&&(p.enqueue(m),i.outputSize+=m.length,t.outputSize!==ke&&i.outputSize>t.outputSize))throw new Error(ST)},flush(){let{crc32:m}=a;Object.assign(i,{crc32:m,inputSize:s})}});Object.defineProperty(i,"readable",{get(){return c.pipeThrough(d).pipeThrough(a).pipeThrough(u)}})}},Wk=class extends TransformStream{constructor(t){let n=[],i=0;(!Number.isFinite(t)||t<1)&&(t=IPt),super({transform(s,a){for(n.push(s),i+=s.length;i>t;)a.enqueue(o())},flush(s){i&&s.enqueue(r(n,i))}});function o(){let s=new Uint8Array(t),a=0;for(;aIH(e,t)}}async function IH({options:e,readable:t,writable:n,onTaskFinished:i},o){let r;try{if(e.compressed&&!e.format){let d=e.codecType.startsWith(jE),u=d?o.CompressionStreamFallback:o.DecompressionStreamFallback,m=d?o.CompressionStream:o.DecompressionStream;if(e.useCompressionStream){if(u&&u.requiresModule&&!AH(m))try{await FH(o)}catch{}}else try{await FH(o)}catch{(!u||u.requiresModule)&&(e.useCompressionStream=!0)}}r=new GH(e,o),await t.pipeThrough(r).pipeThrough(new Wk(yk(o))).pipeTo(n,{preventClose:!0,preventAbort:!0});let{crc32:s,inputSize:a,outputSize:c}=r;return{crc32:s,inputSize:a,outputSize:c}}catch(s){throw r&&(s.outputSize=r.outputSize),s}finally{i()}}var b_o,dR,vH,_2e,vie,FH,lR,Fie,vk=Xs(()=>{b_o=x(T(),1);_c();G0();WH();dR="Worker startup timeout",FH=()=>{};lR=class{constructor(t,{readable:n,writable:i},{options:o,config:r,streamOptions:s,useWebWorkers:a,transferStreams:c,workerURI:d,createWorker:u},m){let{signal:p}=s;return _2e&&(u=ke),Object.assign(t,{busy:!0,generation:(t.generation||0)+1,readable:n.pipeThrough(new Wk(yk(r))).pipeThrough(new Fie(s),{signal:p}),writable:i,options:Object.assign({},o),workerURI:d,createWorker:u,transferStreams:c,terminate(){return new Promise(b=>{let{worker:f,busy:y}=t;f?(y?t.resolveTerminated=b:(f.terminate(),b()),t.interface=null):b()})},onTaskFinished(){if(t.busy){let{resolveTerminated:b}=t;b&&(t.resolveTerminated=null,t.terminated=!0,t.worker.terminate(),b()),t.busy=!1,m(t)}}}),vH===ke&&(vH=typeof Worker!=ou),(a&&vie&&(vH&&d||u)?vie:Pie)(t,r)}},Fie=class extends TransformStream{constructor({onstart:t,onprogress:n,size:i,onend:o}){let r=0;super({async start(){t&&await Wie(t,i)},async transform(s,a){r+=s.length,n&&await Wie(n,r,i),a.enqueue(s)},async flush(){o&&await Wie(o,r)}})}}});async function YH(e,t){let{options:n,config:i}=t,{transferStreams:o,useWebWorkers:r,useCompressionStream:s,compressed:a,checkCrc32:c,computeCrc32:d,encrypted:u,format:m,codecURI:p}=n,{workerURI:b,createWorker:f,maxWorkers:y}=i;m&&(p&&(n.codecURI=kPt(p,i.baseURI)),await l2e(m,n.codecURI)),t.transferStreams=!m&&(o||o===ke&&i.transferStreams);let _=!a&&!c&&!d&&!u,S=m===ke||!!n.codecURI;return t.useWebWorkers=!_&&S&&(r||r===ke&&i.useWebWorkers),t.workerURI=t.useWebWorkers&&b?b:ke,t.createWorker=t.useWebWorkers&&f?f:ke,n.useCompressionStream=s||s===ke&&i.useCompressionStream,(await Z()).run();async function Z(){let C=uR.find(E=>!E.busy);if(C)return v2e(C),new lR(C,e,t,R);if(uR.length{QE.push({resolve:E,stream:e,workerOptions:t}),XH=i.workerStarvationTimeout,NH()})}function R(C){if(F2e(),QE.length){let[{resolve:E,stream:A,workerOptions:L}]=QE.splice(0,1);E(new lR(C,A,L,R)),NH()}else C.worker?(v2e(C),OPt(C,t)):uR=uR.filter(E=>E!=C)}}function kPt(e,t){try{return new URL(e,t).toString()}catch{return e}}function NH(){!qE&&QE.length&&Number.isFinite(XH)&&XH>=0&&(qE=setTimeout(UPt,XH))}function F2e(){qE&&(clearTimeout(qE),qE=null)}function UPt(){if(qE=null,QE.length){let[{resolve:e,stream:t,workerOptions:n}]=QE.splice(0,1),i=Object.assign({},n,{useWebWorkers:!1,workerURI:ke,createWorker:ke});e(new lR({},t,i,DPt)),NH()}}function DPt(){F2e(),NH()}function OPt(e,t){let{config:n}=t,{terminateWorkerTimeout:i}=n;Number.isFinite(i)&&i>=0&&(e.terminated?e.terminated=!1:e.terminateTimeout=setTimeout(async()=>{uR=uR.filter(o=>o!=e);try{await e.terminate()}catch{}},i))}function v2e(e){let{terminateTimeout:t}=e;t&&(clearTimeout(t),e.terminateTimeout=null)}var A_o,uR,QE,qE,XH,W2e,MH=Xs(()=>{A_o=x(T(),1);_c();WH();cR();vk();uR=[],QE=[],W2e=0});function P2e(e){if(BPt){let t="";for(let n=0;n{L_o=x(T(),1),I2e="\0\u263A\u263B\u2665\u2666\u2663\u2660\u2022\u25D8\u25CB\u25D9\u2642\u2640\u266A\u266B\u263C\u25BA\u25C4\u2195\u203C\xB6\xA7\u25AC\u21A8\u2191\u2193\u2192\u2190\u221F\u2194\u25B2\u25BC !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~\u2302\xC7\xFC\xE9\xE2\xE4\xE0\xE5\xE7\xEA\xEB\xE8\xEF\xEE\xEC\xC4\xC5\xC9\xE6\xC6\xF4\xF6\xF2\xFB\xF9\xFF\xD6\xDC\xA2\xA3\xA5\u20A7\u0192\xE1\xED\xF3\xFA\xF1\xD1\xAA\xBA\xBF\u2310\xAC\xBD\xBC\xA1\xAB\xBB\u2591\u2592\u2593\u2502\u2524\u2561\u2562\u2556\u2555\u2563\u2551\u2557\u255D\u255C\u255B\u2510\u2514\u2534\u252C\u251C\u2500\u253C\u255E\u255F\u255A\u2554\u2569\u2566\u2560\u2550\u256C\u2567\u2568\u2564\u2565\u2559\u2558\u2552\u2553\u256B\u256A\u2518\u250C\u2588\u2584\u258C\u2590\u2580\u03B1\xDF\u0393\u03C0\u03A3\u03C3\xB5\u03C4\u03A6\u0398\u03A9\u03B4\u221E\u03C6\u03B5\u2229\u2261\xB1\u2265\u2264\u2320\u2321\xF7\u2248\xB0\u2219\xB7\u221A\u207F\xB2\u25A0\xA0".split(""),BPt=I2e.length==256});function Fk(e,t){return Y2e(e,t,!0)}function N2e(e,t){return Y2e(e,t,!1)}function Y2e(e,t,n){return t&&t.trim().toLowerCase()=="cp437"?P2e(e):new TextDecoder(t,{ignoreBOM:n}).decode(e)}var F_o,kie=Xs(()=>{F_o=x(T(),1);X2e()});function HPt(){U2e=(async()=>{try{let t=new Blob([new Uint8Array(3)]).slice(1,2).stream().getReader(),n=0,i=await t.read();for(;!i.done;)n+=i.value.length,i=await t.read();Uie=n==1}catch{Uie=!1}})()}function DH(e){return!!(e&&e.getData)}async function wc(e,t){if(e.init&&!e.initialized)await e.init(t);else return Promise.resolve()}async function KPt(e){return e=new ty(e),await wc(e),(e.size===ke||!e.readUint8Array)&&(e=new ru(await v0(e.readable)),await wc(e)),e}function Mr(e,t,n){return e.readUint8Array(t,n)}function Oie(e,t){return e.createReadable?e.createReadable(t):e.readUint8Array?eA.prototype.createReadable.call(e,t):e.readable}var U_o,w2e,k2e,zPt,M_o,w_o,Die,M2e,$E,eA,wH,Ik,Uie,U2e,ru,tA,Pk,Xk,kH,UH,ty,nA,OH=Xs(()=>{U_o=x(T(),1);_c();G0();sR();BE();kie();w2e="Writer iterator completed too soon",k2e="Writer not initialized",zPt="text/plain",M_o=256*1024,w_o=16*1024*1024,Die="writable",M2e=Symbol(),$E=class{constructor(){this.size=0}init(){this.initialized=!0}},eA=class extends $E{get readable(){return this.createReadable()}createReadable({offset:t=0,size:n,chunkSize:i=yk(qg())}={}){let o=this,r=0;return i=xie(i),new ReadableStream({async pull(s){let a=n===ke?i:Math.min(i,n-r),c=await Mr(o,t+r,a);c.length&&s.enqueue(c),r+i>=n||!c.length&&a?s.close():r+=i}})}},wH=class extends $E{constructor(){super();let t=this,n=new WritableStream({write(i){if(!t.initialized)throw new Error(k2e);return t.writeUint8Array(fH(i))}});Object.defineProperty(t,Die,{get(){return n}})}writeUint8Array(){}},Ik=class extends wH{constructor(t){super(),Object.assign(this,{contentType:t,data:"data:"+(t||"")+";base64,",pendingCharacters:""})}writeUint8Array(t){let n=this,i,o=n.pendingCharacters,r=n.pendingCharacters.length;for(n.pendingCharacters="",i=0;i2?n.data+=btoa(o):n.pendingCharacters=o+n.pendingCharacters}getData(){return this.data+btoa(this.pendingCharacters)}};ru=class extends eA{constructor(t){super(),Object.assign(this,{sourceBlob:t,size:t.size}),U2e||HPt()}createReadable(t){let n=this,{sourceBlob:i,size:o}=n,{offset:r=0,size:s=o-r}=t||{};return!r&&s>=o?Qf(i.stream()):Uie?Qf(i.slice(r,r+s).stream()):super.createReadable(t)}async readUint8Array(t,n){let i=this,o=t+n,a=await(!t&&o>=i.size?i.sourceBlob:i.sourceBlob.slice(t,o)).arrayBuffer();return a.byteLength>n&&(a=a.slice(t,o)),new Uint8Array(a)}},tA=class extends $E{constructor(t){super();let n=this,i=new TransformStream;Object.defineProperty(n,Die,{get(){return i.writable}}),n.contentType=t,n.blobPromise=v0(i.readable,t),n.blobPromise.catch(()=>{})}getData(){return this.blobPromise}},Pk=class extends ru{constructor(t){super(new Blob([t],{type:zPt}))}},Xk=class extends tA{constructor(t){super(),Object.assign(this,{encoding:t,utf8:!t||t.toLowerCase()=="utf-8"})}async getData(){let{encoding:t,utf8:n}=this,i=await super.getData();return i.text&&n?i.text():N2e(new Uint8Array(await i.arrayBuffer()),t)}},kH=class extends eA{constructor(t){super(),this.readers=t}async init(){let t=this;t.lastDiskNumber=0;let n=t.readers=await Promise.all(t.readers.map(KPt));t.diskOffsets=n.map(i=>{let o=t.size;return t.size+=i.size,o}),super.init()}getDiskOffset(t){let{diskOffsets:n,size:i}=this,o=n[t];return o===ke?i:o}async readUint8Array(t,n){let i=this,{readers:o}=this,r,s=0,a=t;for(;o[s]&&a>=o[s].size;)a-=o[s].size,s++;let c=o[s];if(c){let d=c.size;if(a+n<=d)r=await Mr(c,a,n);else{let u=d-a,m=await Mr(c,a,u),p=await i.readUint8Array(t+u,n-u);r=Sh(m,p)}}else r=yo;return i.lastDiskNumber=Math.max(s,i.lastDiskNumber),r}},UH=class extends $E{constructor(t,n=4294967295){super();let i=this;Object.assign(i,{diskNumber:0,diskOffset:0,size:0,maxSize:n,availableSize:n});let o,r,s,a=new WritableStream({async write(m){if(m===M2e){s&&await d();return}let{availableSize:p}=i;if(s)m.length>=p?(await c(m.subarray(0,p)),await d(),m.length>p&&await this.write(m.subarray(p))):await c(m);else{let{value:b,done:f}=await t.next();if(f&&!b)throw new Error(w2e);o=b,o.size=0,o.maxSize&&(i.maxSize=o.maxSize),i.availableSize=i.maxSize,await wc(o),r=b.writable,s=r.getWriter(),await this.write(m)}},async close(){s&&(await s.ready,await u())},async abort(m){s&&await s.abort(m)}});Object.defineProperty(i,Die,{get(){return a}});async function c(m){let p=m.length;p&&(await s.ready,await s.write(m),o.size+=p,i.availableSize-=p)}async function d(){await u(),i.diskOffset+=o.size,i.diskNumber++,s=null,i.availableSize=i.maxSize}async function u(){await s.close()}}async closeDisk(){let t=this.writable.getWriter();try{await t.ready,await t.write(M2e)}finally{t.releaseLock()}}},ty=class{constructor(t){return Array.isArray(t)&&(t=new kH(t)),(t instanceof ReadableStream||typeof t.getReader==Yr)&&(t={readable:Qf(t)}),t}},nA=class{constructor(t){return t.writable===ke&&typeof t.next==Yr&&(t=new UH(t)),(t instanceof WritableStream||typeof t.getWriter==Yr)&&(t={writable:a2e(t)}),t.size===ke&&(t.size=0),t}}});var O_o,Bie,zie,Nk,Hie,Yk,Kie,Jie,jie,iA,oA,Mk,Qie,wk,qie,$ie,eoe,BH,zH,toe,noe,ioe,HH,ooe,roe,soe,aoe,mR,coe,JPt,loe,KH,jPt,JH,QPt,qPt,$Pt,eXt,doe,uoe,moe,hoe,tXt,nXt,iXt,oXt,rXt,sXt,aXt,cXt,lXt,dXt,uXt,mXt,hXt,fXt,pXt,bXt,ZT,foe=Xs(()=>{O_o=x(T(),1),Bie="filename",zie="rawFilename",Nk="comment",Hie="rawComment",Yk="uncompressedSize",Kie="compressedSize",Jie="offset",jie="diskNumberStart",iA="lastModDate",oA="rawLastModDate",Mk="lastAccessDate",Qie="rawLastAccessDate",wk="creationDate",qie="rawCreationDate",$ie="internalFileAttributes",eoe="externalFileAttributes",BH="internalFileAttribute",zH="externalFileAttribute",toe="msdosAttributesRaw",noe="msdosAttributes",ioe="msDosCompatible",HH="zip64",ooe="encrypted",roe="version",soe="versionMadeBy",aoe="zipCrypto",mR="directory",coe="executable",JPt="symlink",loe="compressionMethod",KH="signature",jPt="crc32",JH="extraField",QPt="extraFieldInfoZip",qPt="extraFieldUnix",$Pt="extraFieldUnixType1",eXt="extraFieldPkwareUnix",doe="unixMode",uoe="setuid",moe="setgid",hoe="sticky",tXt="bitFlag",nXt="rawBitFlag",iXt="filenameLength",oXt="extraFieldLength",rXt="unixExternalUpper",sXt="filenameUTF8",aXt="commentUTF8",cXt="rawExtraField",lXt="extraFieldZip64",dXt="extraFieldUnicodePath",uXt="extraFieldUnicodeComment",mXt="extraFieldAES",hXt="extraFieldNTFS",fXt="extraFieldExtendedTimestamp",pXt="extraFieldUSDZ",bXt=[Bie,zie,Yk,Kie,iA,oA,Nk,Hie,Mk,Qie,wk,qie,Jie,jie,$ie,eoe,BH,zH,toe,noe,ioe,HH,ooe,roe,soe,aoe,mR,coe,JPt,loe,KH,jPt,JH,qPt,QPt,$Pt,eXt,"uid","gid",doe,rXt,uoe,moe,hoe,tXt,nXt,iXt,oXt,sXt,aXt,cXt,lXt,dXt,uXt,mXt,hXt,fXt,pXt],ZT=class{constructor(t){bXt.forEach(n=>this[n]=t[n])}}});var bFe={};Cle(bFe,{ERR_AMBIGUOUS_ARCHIVE:()=>Uoe,ERR_BAD_FORMAT:()=>rA,ERR_CENTRAL_DIRECTORY_NOT_FOUND:()=>Xoe,ERR_ENCRYPTED:()=>Moe,ERR_ENCRYPTED_CENTRAL_DIRECTORY:()=>Doe,ERR_ENTRY_DATA_OUT_OF_BOUNDS:()=>koe,ERR_EOCDR_LOCATOR_ZIP64_NOT_FOUND:()=>Poe,ERR_EOCDR_NOT_FOUND:()=>Ioe,ERR_EXTRAFIELD_ZIP64_NOT_FOUND:()=>Yoe,ERR_INVALID_AUTHENTICATION_CODE:()=>_T,ERR_INVALID_COMPRESSED_DATA:()=>KE,ERR_INVALID_CRC32:()=>JE,ERR_INVALID_FILENAME_VALIDATION:()=>zoe,ERR_INVALID_MAX_APPENDED_DATA_SIZE:()=>Hoe,ERR_INVALID_PASSWORD:()=>L0,ERR_INVALID_SIGNATURE:()=>TT,ERR_INVALID_STRICTNESS:()=>Boe,ERR_INVALID_UNCOMPRESSED_SIZE:()=>ST,ERR_LOCAL_FILE_HEADER_NOT_FOUND:()=>Noe,ERR_OVERLAPPING_ENTRY:()=>woe,ERR_SPLIT_ZIP_FILE:()=>eK,ERR_UNSAFE_FILENAME:()=>Ooe,ERR_UNSUPPORTED_COMPRESSION:()=>$H,ERR_UNSUPPORTED_ENCRYPTION:()=>qH,ERR_UNSUPPORTED_UINT64:()=>Koe,ERR_WORKER_STARTUP_TIMEOUT:()=>dR,WARNING_APPENDED_DATA:()=>nK,WARNING_COMPRESSED_PATCHED_DATA:()=>Qoe,WARNING_DUPLICATE_FILENAME:()=>tre,WARNING_MALFORMED_EXTRA_FIELD:()=>pK,WARNING_MISMATCHED_LOCAL_FILE_HEADER_BIT_FLAG:()=>nre,WARNING_MISMATCHED_LOCAL_FILE_HEADER_COMPRESSION_METHOD:()=>ire,WARNING_MISMATCHED_LOCAL_FILE_HEADER_CRC32_OR_SIZES:()=>ore,WARNING_MISMATCHED_ZIP64_END_OF_CENTRAL_DIRECTORY:()=>sA,WARNING_PREPENDED_CENTRAL_DIRECTORY:()=>$oe,WARNING_PREPENDED_DATA:()=>iK,WARNING_TRAILING_CENTRAL_DIRECTORY_DATA:()=>ere,WARNING_UNKNOWN_VERSION:()=>joe,WARNING_UNKNOWN_ZIP64_EXTENSIBLE_DATA:()=>qoe,WARNING_UNSORTED_CENTRAL_DIRECTORY:()=>Joe,WARNING_WRAPPED_ENTRIES_COUNT:()=>tK,ZipReader:()=>bR,ZipReaderStream:()=>rK,isZipFile:()=>aFe});async function aFe(e,t={}){if(e=new ty(e),await wc(e),(e.size===ke||!e.readUint8Array)&&(e=new ru(await v0(e.readable)),await wc(e)),e.size<22)return!1;let n=sre(t,{}),i=n!=Qg,o=mFe(t[pie],n),{endOfDirectoryInfo:r,endOfDirectoryReachingEndCount:s}=await hFe(e,i,o);if(!r||n==yT&&s>1)return!1;let a=xo(fi(r),20),c=r.offset+22+a;return e.size-c<=o}function poe(e){let t=Math.min(e.byteLength,1024)-3;for(let n=0;n=6){let t=fi(e);if(Fi(t,0)==84233040){let n=xo(t,4);if(6+n<=e.length)return e.subarray(6,6+n)}}}function LXt(e,t,n){let i=e&&e.compressedSize?e.compressedSize:t;return i>0&&i<=n?i:n}function WXt(e){let t={rawExtensibleData:e};if(e.length>=28){let n=fi(e),i=xo(n,26);Object.assign(t,{compressionMethod:xo(n,0),compressedSize:rm(n,2),uncompressedSize:rm(n,10),encryptionAlgorithm:xo(n,18),bitLength:xo(n,20),flags:xo(n,22),hashAlgorithm:xo(n,24),hashData:e.subarray(28,28+i)})}return t}function cFe(e,t,n){let i=e.rawBitFlag=xo(t,n+2),o=(i&1)==1,r=Fi(t,n+6);Object.assign(e,{encrypted:o,version:xo(t,n),bitFlag:{level:(i&6)>>1,dataDescriptor:(i&8)==8,languageEncodingFlag:(i&2048)==2048},rawLastModDate:r,lastModDate:zXt(r),filenameLength:xo(t,n+22),extraFieldLength:xo(t,n+24)})}function lFe(e,t,n,i,o){let{rawExtraField:r}=t,s=t.extraField=new Map,a=fi(r),c=0,d=!1;try{for(;cr.length&&(d=!0);let u=xo(n,i+4);Object.assign(t,{signature:Fi(n,i+10),crc32:Fi(n,i+10),compressedSize:Fi(n,i+14),uncompressedSize:Fi(n,i+18)});let m=s.get(1);m&&(vXt(m,t),t.extraFieldZip64=m);let p=s.get(28789);p&&(q2e(p,Bie,zie,t,e),t.extraFieldUnicodePath=p);let b=s.get(25461);b&&(q2e(b,Nk,Hie,t,e),t.extraFieldUnicodeComment=b);let f=s.get(39169);f&&f.data.length>=7?(FXt(f,t,u),t.extraFieldAES=f):t.compressionMethod=u;let y=s.get(13);y&&($2e(y,t),t.extraFieldPkwareUnix=y);let _=s.get(22613);_&&($2e(_,t),t.extraFieldUnixType1=_);let S=s.get(10);S&&(IXt(S,t),t.extraFieldNTFS=S);let Z=s.get(30805),R;if(Z&&(R=eFe(Z,t,!1),t.extraFieldUnix=Z),!R){let A=s.get(30837);A&&(eFe(A,t,!0),t.extraFieldInfoZip=A)}let C=s.get(21589);C&&(PXt(C,t,o),t.extraFieldExtendedTimestamp=C);let E=s.get(6534);return E&&(t.extraFieldUSDZ=E),d}function vXt(e,t){t.zip64=!0;let n=fi(e.data),i=VXt.filter(([r,s])=>t[r]==s),o=i.reduce((r,[,s])=>r+J2e[s].bytes,0);if(e.data.length=12&&(r.uid=xo(n,8),r.gid=xo(n,10)),Object.assign(e,r),Object.assign(t,r)}function eFe(e,t,n){try{let i=fi(e.data),o,r;if(n){let s=0,a=CT(i,s++),c=CT(i,s++);o=tFe(e.data.subarray(s,s+c)),s+=c;let d=CT(i,s++);r=tFe(e.data.subarray(s,s+d)),Object.assign(e,{version:a,uid:o,gid:r})}else e.data.length>=4&&(o=xo(i,0),r=xo(i,2),Object.assign(e,{uid:o,gid:r}));return o!==ke&&(t.uid=o),r!==ke&&(t.gid=r),o!==ke||r!==ke}catch{}}function tFe(e){let t=new Uint8Array(4);return t.set(e,0),new DataView(t.buffer,t.byteOffset,4).getUint32(0,!0)}function PXt(e,t,n){if(!e.data.length)return;let i=fi(e.data),o=CT(i,0),r=[],s=[];n?((o&1)==1&&(r.push(iA),s.push(oA)),(o&2)==2&&(r.push(Mk),s.push(Qie)),(o&4)==4&&(r.push(wk),s.push(qie))):e.data.length>=5&&(r.push(iA),s.push(oA));let a=1;r.forEach((c,d)=>{if(e.data.length>=a+4){let u=Fi(i,a);t[c]=e[c]=new Date((u|0)*1e3);let m=s[d];e[m]=u}a+=4})}async function XXt({reader:e,fileEntry:t,index:n,offset:i,crc32:o,compressedSize:r,uncompressedSize:s,dataOffset:a,dataDescriptor:c,extraFieldZip64:d,readRanges:u}){let m=0;if(c&&(d?m=20:m=12),m){let b=await Mr(e,a+r,m+4),f=fi(b),y=b.length==m+4&&Fi(f,0)==134695760;if(y){let _=nFe(f,4,d);(t.encrypted&&!t.zipCrypto||_.crc32==o)&&_.compressedSize==r&&_.uncompressedSize==s?m+=4:y=!1}if(b.length>=m){let _=nFe(f,y?4:0,d);_.signature=y,t.localDirectory.dataDescriptor=_}}let p={start:i,end:a+r+m,fileEntry:t};for(let[b,f]of u)if(b!=n&&p.start1&&n[n.length-1]===""&&n.pop(),n.includes("..")||e.startsWith("/")||e.startsWith("\\\\")||RXt.test(e)?!0:t==yT&&(n.includes(".")||n.includes(""))}function mFe(e,t){if(e!==ke){let n=rR(e);if(typeof n!=jWe||Number.isNaN(n)||n<0)throw new Error(Hoe);return n}return t==yT?0:t==Qg?1/0:65535}async function hFe(e,t,n){let{size:i}=e,o=Math.min(i,65557),r={count:AXt},s,a,c=0;for await(let[d,u,m,p,b]of fFe(e,o)){let f=xo(d,p+20);if(b+22+f==i){let y=await pFe(e,d,u,p,b,i,r);if(y==oK){if(s||(s=xoe(m,p,b)),c++,!t||c>1)break}else y==rre&&!a&&(a=xoe(m,p,b))}}return s||(s=a),s||(s=await OXt(e,n,r)),{endOfDirectoryInfo:s,endOfDirectoryReachingEndCount:c}}async function OXt(e,t,n){let{size:i}=e,o=Math.min(i,t==1/0?i:65557+t),r,s;for await(let[a,c,d,u,m]of fFe(e,o)){let p=xoe(d,u,m);r||(r=p);let b=await pFe(e,a,c,u,m,i,n);if(b==oK)return p;b==rre&&!s&&(s=p)}return s||r}async function*fFe(e,t){let n=e.size-t,i=await Mr(e,n,t),o=fi(i);for(let r=i.length-22;r>=0;r--)Fi(o,r)==101010256&&(yield[o,n,i,r,n+r])}function xoe(e,t,n){return{offset:n,buffer:e.slice(t,t+22).buffer}}async function pFe(e,t,n,i,o,r,s){let a=xo(t,i+10),c=Fi(t,i+12),d=Fi(t,i+16);if(a==65535||c==4294967295||d==4294967295)return await oFe(e,t,n,o-20,r,s)==117853008?oK:j2e;if(!a&&!c)return rre;let u=xo(t,i+6);for(let m of[o-c,aA(e,u)+d])if(await oFe(e,t,n,m,r,s)==33639248)return oK;return j2e}async function oFe(e,t,n,i,o,r){if(i<0||i+4>o)return ke;if(i>=n)return Fi(t,i-n);if(r.count>0){r.count--;let s=await Mr(e,i,4);return Fi(fi(s),0)}return ke}function BXt(e,t,n,i,o){let{rawFilename:r}=e,s=!o,a=e.decryptedDirectory&&(t.rawBitFlag&8192)==8192;i&&!a&&(n.length!=r.length||n.some((c,d)=>c!=r[d]))&&P0(s,o,"mismatched local file header (filename)"),(t.rawBitFlag&K2e)!=(e.rawBitFlag&K2e)&&P0(s,o,nre),t.compressionMethod!=e.compressionMethod&&P0(s,o,ire),!t.bitFlag.dataDescriptor&&!a&&(t.crc32||t.compressedSize||t.uncompressedSize)&&(t.crc32!=e.crc32||t.compressedSize!=e.compressedSize||t.uncompressedSize!=e.uncompressedSize)&&P0(s,o,ore)}function P0(e,t,n){e?jH(n):Rh(t,n)}function Rh(e,t,n){if(!e.some(i=>i.reason==t)){let i={reason:t};n!==ke&&(i.filename=n),e.push(i)}}function jH(e){let t=new Error(Uoe);throw t.reason=e,t}function Ws(e,t,n){return t[n]===ke?e.options[n]:t[n]}function rFe(e,t,n){return YE(Ws(e,t,n))}function zXt(e){let t=(e&4294901760)>>16,n=e&65535,i=new Date(1980+((t&65024)>>9),((t&480)>>5)-1,t&31,(n&63488)>>11,(n&2016)>>5,(n&31)*2,0);return iEXt)throw new Error(Koe);return Number(n)}var nSo,rA,Ioe,Poe,Xoe,Noe,Yoe,Moe,qH,$H,eK,woe,koe,Uoe,Doe,Ooe,Boe,zoe,Hoe,Koe,Joe,joe,Qoe,pK,qoe,tK,nK,iK,$oe,ere,tre,sA,nre,ire,ore,ZXt,RXt,z2e,CXt,H2e,K2e,sFe,VXt,J2e,EXt,AXt,GXt,j2e,rre,oK,bR,rK,yoe,are=Xs(()=>{nSo=x(T(),1);_c();G0();cR();MH();OH();kie();sR();BE();_k();foe();gk();rA="File format is not recognized",Ioe="End of central directory not found",Poe="End of Zip64 central directory locator not found",Xoe="Central directory header not found",Noe="Local file header not found",Yoe="Zip64 extra field not found",Moe="File contains encrypted entry",qH="Encryption method not supported",$H="Compression method not supported",eK="Split zip file",woe="Overlapping entry found",koe="Entry data out of bounds",Uoe="Ambiguous archive",Doe="Encrypted central directory is not supported",Ooe="Unsafe filename",Boe="Invalid strictness (must be 'strict', 'balanced' or 'tolerant')",zoe="Invalid filenameValidation (must be 'strict', 'balanced' or 'tolerant')",Hoe="Invalid maxAppendedDataSize (must be a number greater than or equal to 0)",Koe="64-bit value exceeds Number.MAX_SAFE_INTEGER",Joe="unsorted central directory",joe="unknown version needed to extract",Qoe="compressed patched data",pK="malformed extra field",qoe="unknown zip64 extensible data",tK="wrapped entries count",nK="appended data",iK="prepended data",$oe="prepended central directory",ere="trailing central directory data",tre="duplicate filename",sA="mismatched zip64 end of central directory record",nre="mismatched local file header (general purpose bit flag)",ire="mismatched local file header (compression method)",ore="mismatched local file header (crc32 or sizes)",ZXt=63,RXt=/^[a-zA-Z]:/,z2e="utf-8",CXt="UTF8",H2e="cp437",K2e=2057,sFe=1,VXt=[[Yk,4294967295],[Kie,4294967295],[Jie,4294967295],[jie,65535]],J2e={65535:{getValue:Fi,bytes:4},4294967295:{getValue:rm,bytes:8}},EXt=BigInt(Number.MAX_SAFE_INTEGER),AXt=64,GXt=1032,j2e=0,rre=1,oK=2,bR=class{constructor(t,n={}){Object.assign(this,{reader:new ty(t),options:n,readRanges:new Map})}async*getEntriesGenerator(t={}){let n=this,{reader:i}=n;if(await wc(i),(i.size===ke||!i.readUint8Array)&&(i=new ru(await v0(i.readable)),await wc(i)),i.size<22)throw new Error(rA);let o=n.warnings=[],r=sre(t,n.options),s=r==yT,a=r!=Qg,c=mFe(Ws(n,t,pie),r),d=UXt(Ws(n,t,Vve),r),u=Ws(n,t,Eve),{endOfDirectoryInfo:m,endOfDirectoryReachingEndCount:p}=await hFe(i,a,c);if(!m)throw await NXt(i)?new Error(eK):new Error(Ioe);a&&p>1&&jH("multiple end of central directory records");let b=fi(m),f=Fi(b,12),y=Fi(b,16),_=m.offset,S=xo(b,20),Z=_+22+S,R=i.size-Z;R>c&&jH(nK),R>0&&Rh(o,nK);let C=xo(b,4),E=i.lastDiskNumber||0,A=xo(b,6),L=xo(b,10),F=0,I,N,g,V,G=56,v,X=y==4294967295||f==4294967295||L==65535||A==65535;if(y!=4294967295&&A!=65535&&(y+=aA(i,A)),X){let Be=m.offset>=20?await Mr(i,m.offset-20,20):yo,je=fi(Be);if(Be.length==20&&Fi(je,0)==117853008){y=aA(i,Fi(je,4))+rm(je,8);let qe=await Mr(i,y,56),We=fi(qe),Ke=m.offset-20-56;if((qe.length<56||Fi(We,0)!=101075792)&&y!=Ke&&Ke>=0){let ct=y;y=Ke,y>ct&&(F=y-ct),qe=await Mr(i,y,56),We=fi(qe)}if(qe.length<56||Fi(We,0)!=101075792)throw new Error(Poe);if(g=!0,V=rm(We,4)>44,V){let ct=Math.min(rm(We,4)-44,i.size-y-56);if(ct>0){G+=ct;let Et=await Mr(i,y+56,ct);v=WXt(Et)}}C==65535?C=Fi(We,16):C!=Fi(We,16)&&P0(s,o,sA),A==65535?A=Fi(We,20):A!=Fi(We,20)&&P0(s,o,sA),L==65535?L=rm(We,32):L!=rm(We,32)&&P0(s,o,sA),f==4294967295?f=rm(We,40):f!=rm(We,40)&&P0(s,o,sA),y=aA(i,A)+rm(We,48)+F}}let Y=f,D=m.offset-(g?G+20:0);if(y>=i.size&&(F=i.size-y-f-22,y=i.size-f-22),E!=C)throw new Error(eK);if(y<0)throw new Error(rA);let M=0,O=await Mr(i,y,f),w=fi(O);if(f){if(O.length<4)throw new Error(rA);let Be=D-f;if(y!=Be&&A==C){let je=Fi(w,M)==33639248||!!(v&&v.compressedSize)||poe(w),qe=!je;if(!qe&&Be>=0&&Be+4<=i.size){let We=await Mr(i,Be,4);qe=Fi(fi(We),0)==33639248}if(qe){let We=y;y=Be,y>We&&(F+=y-We,I=je),O=await Mr(i,y,f),w=fi(O)}}}let z=D-y;if(f!=z&&z>=0&&A==C&&(f=z,O=await Mr(i,y,f),w=fi(O)),y<0||y>=i.size)throw new Error(rA);n.directoryOffset=y,n.directoryLength=Y;let K=rFe(n,t,Ave),te,H;if(K&&L&&O.length>=4&&Fi(w,0)!=33639248&&(V||poe(w))){let Be=LXt(v,Y,O.length);H=O.subarray(Be),O=await K(O.subarray(0,Be),v),w=fi(O),Y=O.length,te=!0}v&&!te&&(O.length<4||Fi(w,0)==33639248)&&Rh(o,qoe),N=y;let $=Ws(n,t,qWe),ee=Ws(n,t,$We),le=new Set,_e,he=-1,Ze=!s&&!g;!L&&Ze&&(L=Q2e(w,O,M),L&&Rh(o,tK));for(let Be=0;BeO.length||Fi(w,M)!=33639248)throw Be==0&&!te&&(V||poe(w))?new Error(Doe):new Error(Xoe);cFe(je,w,M+6);let qe=!!je.bitFlag.languageEncodingFlag,We=M+46,Ke=We+je.filenameLength,ct=Ke+je.extraFieldLength,Et=xo(w,M+4),zt=Et>>8==0,ut=Et>>8==3,bt=O.subarray(We,Ke),ht=xo(w,M+32),jt=ct+ht,st=O.subarray(ct,jt),pt=qe,Mi=qe,jn=Fi(w,M+38),Si=jn&255,Hi={readOnly:!!(Si&1),hidden:!!(Si&2),system:!!(Si&4),directory:!!(Si&16),archive:!!(Si&32)},Gi=Fi(w,M+42),pi=rFe(n,t,eve)||Fk,Zi=pt?z2e:$||H2e,On=Mi?z2e:ee||H2e,rn=pi(bt,Zi,lH);if(rn===ke&&(rn=Fk(bt,Zi)),u){let wi=u(rn);wi!==ke&&(rn=wi)}if(DXt(rn,d)){let wi=new Error(Ooe);throw wi.filename=rn,wi}let Hn=pi(st,On,dH);Hn===ke&&(Hn=Fk(st,On)),Object.assign(je,{index:Be,decryptedDirectory:te,versionMadeBy:Et,msDosCompatible:zt,zip64:!1,compressedSize:0,uncompressedSize:0,commentLength:ht,offset:Gi,diskNumberStart:xo(w,M+34),internalFileAttributes:xo(w,M+36),externalFileAttributes:jn,msdosAttributesRaw:Si,msdosAttributes:Hi,rawFilename:bt,filenameUTF8:pt,commentUTF8:Mi,rawExtraField:O.subarray(Ke,ct),rawComment:st,filename:rn,comment:Hn}),lFe(je,je,w,M+6)&&Rh(o,pK,rn),je.offset+=F;let $i=aA(i,je.diskNumberStart)+je.offset;N=Math.min($i,N),$iZXt&&Rh(o,joe,rn),(je.rawBitFlag&32)==32&&Rh(o,Qoe,rn),le.has(je.filename)&&(_e=!0),le.add(je.filename);let Po=je.externalFileAttributes>>16&65535;je.unixMode===ke&&(Po&16877)!=0&&(je.unixMode=Po);let hr=!!(je.unixMode&2048),Is=!!(je.unixMode&1024),Hs=!!(je.unixMode&512),yi=((je.unixMode===ke?Po:je.unixMode)&61440)==40960,fr=!yi&&(je.unixMode!==ke?(je.unixMode&73)!=0:ut&&(Po&73)!=0),mo=je.unixMode!==ke&&(je.unixMode&61440)==16384,Qr=(Po&61440)==16384;Object.assign(je,{setuid:hr,setgid:Is,sticky:Hs,symlink:yi,unixExternalUpper:Po,internalFileAttribute:je.internalFileAttributes,externalFileAttribute:je.externalFileAttributes,executable:fr,directory:mo||Qr||zt&&Hi.directory||je.filename.endsWith("/"),zipCrypto:je.encrypted&&!je.extraFieldAES});let Mn=new ZT(je);if(Mn.getData=(wi,Xo)=>je.getData(wi,Mn,n.readRanges,Xo),Mn.arrayBuffer=async wi=>{let Xo=new TransformStream,Dc=v0(Xo.readable).then(pm=>pm.arrayBuffer());return Dc.catch(()=>{}),await je.getData(Xo,Mn,n.readRanges,wi),Dc},M=jt,Be==L-1&&Ze){let wi=Q2e(w,O,M);wi&&(L+=wi,Rh(o,tK))}let{onprogress:Ki}=t;if(Ki)try{await Ki(Be+1,L,new ZT(je))}catch{}yield Mn}let ye=M,Ge=boe(O.subarray(M))||(te?boe(H):ke);if(!Ge&&!te){let Be=y+M,je=Math.min(D-Be,65541);je>=6&&(Ge=boe(await Mr(i,Be,je)))}Ge&&(n.digitalSignature=Ge,ye=M+6+Ge.length),(M!=Y&&ye!=Y||!te&&M!=f&&ye!=f)&&P0(s,o,ere),_e&&P0(s,o,tre);let Ae=Ws(n,t,tve),Fe=Ws(n,t,nve),tt=(s||Ae)&&L&&N==4&&await YXt(i)?4:0;return s&&(F||L&&N>tt)&&jH(iK),(F||L&&N>4)&&Rh(o,iK),I&&Rh(o,$oe),Ae&&(n.prependedData=N>tt?await Mr(i,tt,N-tt):yo),n.comment=S?await Mr(i,_+22,S):yo,Fe&&(n.appendedData=Z3))throw new Error(qH);if(!N&&!g)throw new Error(Moe)}if(X+R>a.size)throw new Error(koe);let _e=R,he=Qf(a.createReadable({offset:X,size:_e})),Ze=mH(Ws(r,o,oH)),ye=Ws(r,o,ive),Ge=Ws(r,o,rve),Ae=Ws(r,o,ove);Ae&&(Ge=!0);let{onstart:Fe,onprogress:tt,onend:Be}=o,je=b!=0&&!V,qe=V?R:Z,We=b==9,Ke=Ws(r,o,sH);We&&(Ke=!1);let ct=Ws(r,o,lve),Et=(ct===ke?Ws(r,o,cve):ct)&&!V&&(!$||ee||m&&m.vendorVersion==sFe),zt={options:{codecType:LH,password:N,rawPassword:g,zipCrypto:ee,encryptionStrength:m&&m.strength,checkCrc32:Et,checkAuthenticationCode:Ws(r,o,dve),passwordVerification:ee&&(C?S>>>8&255:_>>>24&255),outputSize:qe,crc32:_,compressed:je,encrypted:$,useWebWorkers:Ws(r,o,rH),useCompressionStream:Ke,transferStreams:Ws(r,o,aH),deflate64:We,format:le?le.format:ke,codecURI:le?le.codecURI:ke,compressionMethod:b,rawBitFlag:y,checkPasswordOnly:ye},config:s,streamOptions:{signal:Ze,size:_e,onstart:Fe,onprogress:tt,onend:Be}};Ge&&await XXt({reader:a,fileEntry:n,index:c,offset:L,crc32:_,compressedSize:R,uncompressedSize:Z,dataOffset:X,dataDescriptor:C||E.bitFlag.dataDescriptor,extraFieldZip64:p||E.extraFieldZip64,readRanges:i});let ut,bt;try{if(!Ae){ye&&(t=new WritableStream),t=new nA(t),await wc(t,MXt(qe,R,je)),{writable:ut}=t;let{outputSize:ht}=await YH({readable:he,writable:ut},zt);if(t.size+=ht,ht!=qe)throw new Error(ST)}}catch(ht){if(ht.outputSize!==ke&&(t.size+=ht.outputSize),!ye||ht.message!=$g)throw bt=ht,ht}finally{if(!(!DH(t)&&Ws(r,o,cH))&&ut&&!ut.locked){let jt=ut.getWriter();if(bt)try{await jt.abort(bt)}catch{}else await jt.close()}}return ye||Ae?ke:t.getData?t.getData():ut}}});var Jse=bm((I2o,RU)=>{var P2o=x(T());/*! * protobuf.js v8.8.0 (c) 2016, daniel wirtz * compiled thu, 27 aug 2026 00:01:05 utc * licensed under the bsd-3-clause license * see: https://github.com/dcodeio/protobuf.js for details - */(function(e){"use strict";(function(n,i,o){function r(a){var c=i[a];return c||n[a][0].call(c=i[a]={exports:{}},r,c,c.exports),c.exports}var s=r(o[0]);s.util.global.protobuf=s,typeof define=="function"&&define.amd&&define(["long"],function(a){return a&&a.isLong&&(s.util.Long=a,s.configure()),s}),typeof SU=="object"&&SU&&SU.exports&&(SU.exports=s)})({1:[function(t,n,i){"use strict";i.build="minimal",i.Writer=t(15),i.BufferWriter=t(16),i.Reader=t(2),i.BufferReader=t(3),i.util=t(12),i.rpc=t(5),i.roots=t(4),i.configure=o;function o(){i.util.LongBits._configure(i.util.Long),i.Writer._configure(i.BufferWriter),i.Reader._configure(i.BufferReader)}o()},{12:12,15:15,16:16,2:2,3:3,4:4,5:5}],2:[function(t,n,i){"use strict";n.exports=d;var o=t(12),r,s=o.LongBits,a=o.utf8;function c(R,C){return RangeError("index out of range: "+R.pos+" + "+(C||1)+" > "+R.len)}function d(R){this.buf=R,this.pos=0,this.len=R.length,this.view=null,this.discardUnknown=d.discardUnknown}function u(R){if(Array.isArray(R)&&(R=new Uint8Array(R)),R instanceof Uint8Array)return new d(R);throw Error("illegal buffer")}var m=function(){return o.Buffer?function(E){return(d.create=function(L){return o.Buffer.isBuffer(L)?new r(L):u(L)})(E)}:u};d.create=m(),d.prototype.raw=function(C,E){return this.buf.subarray(C,E)};function p(R){for(var C=0,E=0;E<4;++E){if(R.pos>=R.len)throw c(R);var A=R.buf[R.pos++];if(C=(C|(A&127)<>>0,A<128)return C}throw c(R)}d.prototype.uint32=function(){if(this.len-this.pos<5){if(this.pos>=this.len)throw c(this);if(this.buf[this.pos]>=128)return p(this)}var C=this.buf,E=this.pos,A=(C[E]&127)>>>0;if(C[E++]<128)return this.pos=E,A;if(A=(A|(C[E]&127)<<7)>>>0,C[E++]<128)return this.pos=E,A;if(A=(A|(C[E]&127)<<14)>>>0,C[E++]<128)return this.pos=E,A;if(A=(A|(C[E]&127)<<21)>>>0,C[E++]<128)return this.pos=E,A;if(A=(A|(C[E]&15)<<28)>>>0,C[E++]<128)return this.pos=E,A;for(var L=0;L<5;++L){if(E>=this.len)throw this.pos=E,c(this);if(C[E++]<128)return this.pos=E,A}throw this.pos=E,Error("invalid varint encoding")},d.prototype.tag=function(){if(this.len-this.pos<5){if(this.pos>=this.len)throw c(this);if(this.buf[this.pos]>=128)return p(this)}var C=this.buf,E=this.pos,A=(C[E]&127)>>>0;if(C[E++]<128)return this.pos=E,A;if(A=(A|(C[E]&127)<<7)>>>0,C[E++]<128)return this.pos=E,A;if(A=(A|(C[E]&127)<<14)>>>0,C[E++]<128)return this.pos=E,A;if(A=(A|(C[E]&127)<<21)>>>0,C[E++]<128)return this.pos=E,A;if(A=(A|(C[E]&15)<<28)>>>0,C[E]<128&&(C[E]&112)===0)return this.pos=E+1,A;throw this.pos=E+1,Error("invalid tag encoding")},d.prototype.int32=function(){return this.uint32()|0},d.prototype.sint32=function(){var C=this.uint32();return C>>>1^-(C&1)|0};function b(){var R=new s(0,0),C=0;if(this.len-this.pos>4){for(;C<4;++C)if(R.lo=(R.lo|(this.buf[this.pos]&127)<>>0,this.buf[this.pos++]<128)return R;if(R.lo=(R.lo|(this.buf[this.pos]&127)<<28)>>>0,R.hi=(R.hi|(this.buf[this.pos]&127)>>4)>>>0,this.buf[this.pos++]<128)return R;C=0}else{for(;C<4;++C){if(this.pos>=this.len)throw c(this);if(R.lo=(R.lo|(this.buf[this.pos]&127)<>>0,this.buf[this.pos++]<128)return R}throw c(this)}if(this.len-this.pos>4){for(;C<5;++C)if(R.hi=(R.hi|(this.buf[this.pos]&127)<>>0,this.buf[this.pos++]<128)return R}else for(;C<5;++C){if(this.pos>=this.len)throw c(this);if(R.hi=(R.hi|(this.buf[this.pos]&127)<>>0,this.buf[this.pos++]<128)return R}throw Error("invalid varint encoding")}d.prototype.bool=function(){for(var C=!1,E,A=0;A<10;++A){if(this.pos>=this.len)throw c(this);if(E=this.buf[this.pos++],E&127&&(C=!0),E<128)return C}throw Error("invalid varint encoding")};function f(R,C){return(R[C-4]|R[C-3]<<8|R[C-2]<<16|R[C-1]<<24)>>>0}d.prototype.fixed32=function(){if(this.pos+4>this.len)throw c(this,4);return f(this.buf,this.pos+=4)},d.prototype.sfixed32=function(){if(this.pos+4>this.len)throw c(this,4);return f(this.buf,this.pos+=4)|0};function y(){if(this.pos+8>this.len)throw c(this,8);return new s(f(this.buf,this.pos+=4),f(this.buf,this.pos+=4))}d.prototype.float=function(){if(this.pos+4>this.len)throw c(this,4);var C=o.float.readFloatLE(this.buf,this.pos);return this.pos+=4,C},d.prototype.double=function(){if(this.pos+8>this.len)throw c(this,4);var C=o.float.readDoubleLE(this.buf,this.pos);return this.pos+=8,C},d.prototype.uint32s=function(C){C===e&&(C=[]);var E=this.uint32()+this.pos,A=this.len,L=this.buf,F=this.pos,I;if(E>A)throw c(this,E-this.pos);for(this.len=E;FA)throw c(this,E-this.pos);for(this.len=E;FA)throw c(this,E-this.pos);for(this.len=E;this.posA)throw c(this,E-this.pos);for(this.len=E;Fthis.len)throw c(this,E);var L=E>>>2,F=C.length,I=this.pos;C.length=F+L;var N=Z(this,L,S);if(N)for(var g=0;gthis.len)throw c(this,E);var L=E>>>2,F=C.length,I=this.pos;C.length=F+L;var N=Z(this,L,S);if(N)for(var g=0;gthis.len)throw c(this,E);var L=E>>>2,F=C.length,I=this.pos;C.length=F+L;var N=Z(this,L,_);if(N)for(var g=0;gthis.len)throw c(this,E);var L=E>>>3,F=C.length,I=this.pos;C.length=F+L;var N=Z(this,L,_);if(N)for(var g=0;gA)throw c(this,E-this.pos);for(this.len=E;this.posA)throw c(this,E-this.pos);for(this.len=E;this.posA)throw c(this,E-this.pos);for(this.len=E;this.posthis.len)throw c(this,E);var F=E>>>3;C.length=L+F;for(var I=0;Ithis.len)throw c(this,E);var F=E>>>3;C.length=L+F;for(var I=0;Ithis.len)throw c(this,C);return this.pos=A,this.raw(E,A)},d.prototype.string=function(){var C=this.uint32(),E=this.pos,A=this.pos+C;if(A>this.len)throw c(this,C);return this.pos=A,a.read(this.buf,E,A)},d.prototype.stringVerify=function(){var C=this.uint32(),E=this.pos,A=this.pos+C;if(A>this.len)throw c(this,C);return this.pos=A,a.readStrict(this.buf,E,A)},d.prototype.skip=function(C){if(typeof C=="number"){if(this.pos+C>this.len)throw c(this,C);this.pos+=C}else do if(this.pos>=this.len)throw c(this);while(this.buf[this.pos++]&128);return this},d.recursionLimit=o.recursionLimit,d.discardUnknown=!0,d.prototype.skipType=function(R,C,E){if(C===e&&(C=0),C>d.recursionLimit)throw Error("max depth exceeded");if(E===0)throw Error("illegal tag: field number 0");switch(R){case 0:this.skip();break;case 1:this.skip(8);break;case 2:this.skip(this.uint32());break;case 3:for(;;){var A=this.tag(),L=A>>>3;if(R=A&7,!L)throw Error("illegal tag: field number 0");if(R===4){if(E!==e&&L!==E)throw Error("invalid end group tag");break}this.skipType(R,C+1,L)}break;case 5:this.skip(4);break;default:throw Error("invalid wire type "+R+" at offset "+this.pos)}return this},d._configure=function(R){r=R,d.create=m(),r._configure();var C=o.Long?"toLong":"toNumber";o.merge(d.prototype,{int64:function(){return b.call(this)[C](!1)},uint64:function(){return b.call(this)[C](!0)},sint64:function(){return b.call(this).zzDecode()[C](!1)},fixed64:function(){return y.call(this)[C](!0)},sfixed64:function(){return y.call(this)[C](!1)}})}},{12:12}],3:[function(t,n,i){"use strict";n.exports=s;var o=t(2);s.prototype=Object.create(o.prototype,{constructor:{value:s,writable:!0,enumerable:!1,configurable:!0}});var r=t(12);function s(a){o.call(this,a)}s._configure=function(){r.Buffer&&(s.prototype._slice=r.Buffer.prototype.slice)},s.prototype.raw=function(c,d){return this._slice.call(this.buf,c,d)},s.prototype.string=function(){var c=this.uint32(),d=this.pos,u=this.pos+c;if(u>this.len)throw RangeError("index out of range: "+this.pos+" + "+c+" > "+this.len);return this.pos=u,this.buf.utf8Slice?this.buf.utf8Slice(d,u):this.buf.toString("utf-8",d,u)},s._configure()},{12:12,2:2}],4:[function(t,n,i){"use strict";n.exports=Object.create(null)},{}],5:[function(t,n,i){"use strict";var o=i;o.Service=t(6)},{6:6}],6:[function(t,n,i){"use strict";n.exports=r;var o=t(12);r.prototype=Object.create(o.EventEmitter.prototype,{constructor:{value:r,writable:!0,enumerable:!1,configurable:!0}});function r(s,a,c){if(typeof s!="function")throw TypeError("rpcImpl must be a function");o.EventEmitter.call(this),this.rpcImpl=s,this.requestDelimited=!!a,this.responseDelimited=!!c}r.prototype.rpcCall=function s(a,c,d,u,m){if(!u)throw TypeError("request must be specified");var p=this;if(!m)return o.asPromise(s,p,a,c,d,u);if(!p.rpcImpl)return setTimeout(function(){m(Error("already ended"))},0),e;try{return p.rpcImpl(a,c[p.requestDelimited?"encodeDelimited":"encode"](u).finish(),function(f,y){if(f)return p.emit("error",f,a),m(f);if(y===null)return p.end(!0),e;if(!(y instanceof d))try{y=d[p.responseDelimited?"decodeDelimited":"decode"](y)}catch(_){return p.emit("error",_,a),m(_)}return p.emit("data",y,a),m(null,y)})}catch(b){return p.emit("error",b,a),setTimeout(function(){m(b)},0),e}},r.prototype.end=function(a){return this.rpcImpl&&(a||this.rpcImpl(null,null,null),this.rpcImpl=null,this.emit("end").off()),this}},{12:12}],7:[function(t,n,i){"use strict";n.exports=o;function o(r,s){for(var a=new Array(arguments.length-1),c=0,d=2,u=!0;d0&&b.charAt(f-1)==="=";)--f;return Math.floor(f*3/4)};for(var r=new Array(64),s=new Array(123),a=0;a<64;)s[r[a]=a<26?a+65:a<52?a+71:a<62?a-4:a-59|43]=a++;s[45]=62,s[95]=63,o.encode=function(b,f,y){for(var _=null,S=[],Z=0,R=0,C;f>2],C=(E&3)<<4,R=1;break;case 1:S[Z++]=r[C|E>>4],C=(E&15)<<2,R=2;break;case 2:S[Z++]=r[C|E>>6],S[Z++]=r[E&63],R=0;break}Z>8191&&((_||(_=[])).push(String.fromCharCode.apply(String,S)),Z=0)}return R&&(S[Z++]=r[C],S[Z++]=61,R===1&&(S[Z++]=61)),_?(Z&&_.push(String.fromCharCode.apply(String,S.slice(0,Z))),_.join("")):String.fromCharCode.apply(String,S.slice(0,Z))};var c="invalid encoding";o.decode=function(b,f,y){for(var _=y,S=0,Z,R=0;R1)break;if((C=s[C])===e)throw Error(c);switch(S){case 0:Z=C,S=1;break;case 1:f[y++]=Z<<2|(C&48)>>4,Z=C,S=2;break;case 2:f[y++]=(Z&15)<<4|(C&60)>>2,Z=C,S=3;break;case 3:f[y++]=(Z&3)<<6|C,S=0;break}}if(S===1)throw Error(c);return y-_};var d=/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/,u=/[-_]/,m=/^(?:[A-Za-z0-9_-]{4})*(?:[A-Za-z0-9_-]{2}(?:==)?|[A-Za-z0-9_-]{3}=?)?$/;o.test=function(b){return d.test(b)||u.test(b)&&m.test(b)}},{}],9:[function(t,n,i){"use strict";n.exports=o;function o(){this._listeners=Object.create(null)}o.prototype.on=function(s,a,c){return(this._listeners[s]||(this._listeners[s]=[])).push({fn:a,ctx:c||this}),this},o.prototype.off=function(s,a){if(s===e)this._listeners=Object.create(null);else if(a===e)this._listeners[s]=[];else{var c=this._listeners[s];if(!c)return this;for(var d=0;d0?0:2147483648,f,y);else if(isNaN(b))p(2143289344,f,y);else if(b>34028234663852886e22)p((_<<31|2139095040)>>>0,f,y);else if(b<11754943508222875e-54)p((_<<31|Math.round(b/1401298464324817e-60))>>>0,f,y);else{var S=Math.floor(Math.log(b)/Math.LN2),Z=Math.round(b*Math.pow(2,-S)*8388608)&8388607;p((_<<31|S+127<<23|Z)>>>0,f,y)}}d.writeFloatLE=u.bind(null,r),d.writeFloatBE=u.bind(null,s);function m(p,b,f){var y=p(b,f),_=(y>>31)*2+1,S=y>>>23&255,Z=y&8388607;return S===255?Z?NaN:_*(1/0):S===0?_*1401298464324817e-60*Z:_*Math.pow(2,S-150)*(Z+8388608)}d.readFloatLE=m.bind(null,a),d.readFloatBE=m.bind(null,c)})(),typeof Float64Array<"u"?(function(){var u=new Float64Array([-0]),m=new Uint8Array(u.buffer),p=m[7]===128;function b(S,Z,R){u[0]=S,Z[R]=m[0],Z[R+1]=m[1],Z[R+2]=m[2],Z[R+3]=m[3],Z[R+4]=m[4],Z[R+5]=m[5],Z[R+6]=m[6],Z[R+7]=m[7]}function f(S,Z,R){u[0]=S,Z[R]=m[7],Z[R+1]=m[6],Z[R+2]=m[5],Z[R+3]=m[4],Z[R+4]=m[3],Z[R+5]=m[2],Z[R+6]=m[1],Z[R+7]=m[0]}d.writeDoubleLE=p?b:f,d.writeDoubleBE=p?f:b;function y(S,Z){return m[0]=S[Z],m[1]=S[Z+1],m[2]=S[Z+2],m[3]=S[Z+3],m[4]=S[Z+4],m[5]=S[Z+5],m[6]=S[Z+6],m[7]=S[Z+7],u[0]}function _(S,Z){return m[7]=S[Z],m[6]=S[Z+1],m[5]=S[Z+2],m[4]=S[Z+3],m[3]=S[Z+4],m[2]=S[Z+5],m[1]=S[Z+6],m[0]=S[Z+7],u[0]}d.readDoubleLE=p?y:_,d.readDoubleBE=p?_:y})():(function(){function u(p,b,f,y,_,S){var Z=y<0?1:0;if(Z&&(y=-y),y===0)p(0,_,S+b),p(1/y>0?0:2147483648,_,S+f);else if(isNaN(y))p(0,_,S+b),p(2146959360,_,S+f);else if(y>17976931348623157e292)p(0,_,S+b),p((Z<<31|2146435072)>>>0,_,S+f);else{var R;if(y<22250738585072014e-324)R=y/5e-324,p(R>>>0,_,S+b),p((Z<<31|R/4294967296)>>>0,_,S+f);else{var C=Math.floor(Math.log(y)/Math.LN2);C===1024&&(C=1023),R=y*Math.pow(2,-C),p(R*4503599627370496>>>0,_,S+b),p((Z<<31|C+1023<<20|R*1048576&1048575)>>>0,_,S+f)}}}d.writeDoubleLE=u.bind(null,r,0,4),d.writeDoubleBE=u.bind(null,s,4,0);function m(p,b,f,y,_){var S=p(y,_+b),Z=p(y,_+f),R=(Z>>31)*2+1,C=Z>>>20&2047,E=4294967296*(Z&1048575)+S;return C===2047?E?NaN:R*(1/0):C===0?R*5e-324*E:R*Math.pow(2,C-1075)*(E+4503599627370496)}d.readDoubleLE=m.bind(null,a,0,4),d.readDoubleBE=m.bind(null,c,4,0)})(),d}function r(d,u,m){u[m]=d&255,u[m+1]=d>>>8&255,u[m+2]=d>>>16&255,u[m+3]=d>>>24}function s(d,u,m){u[m]=d>>>24,u[m+1]=d>>>16&255,u[m+2]=d>>>8&255,u[m+3]=d&255}function a(d,u){return(d[u]|d[u+1]<<8|d[u+2]<<16|d[u+3]<<24)>>>0}function c(d,u){return(d[u]<<24|d[u+1]<<16|d[u+2]<<8|d[u+3])>>>0}},{}],11:[function(t,n,i){"use strict";n.exports=r;var o;function r(d,u){this.lo=d>>>0,this.hi=u>>>0}var s=r.zero=new r(0,0);s.toNumber=function(){return 0},s.zzEncode=s.zzDecode=function(){return this},s.length=function(){return 1};var a=r.zeroHash="\0\0\0\0\0\0\0\0";r.fromNumber=function(u){if(u===0)return s;var m=u<0;m&&(u=-u);var p=u>>>0,b=(u-p)/4294967296>>>0;return m&&(b=~b>>>0,p=~p>>>0,++p>4294967295&&(p=0,++b>4294967295&&(b=0))),new r(p,b)},r.from=function(u){if(typeof u=="number")return r.fromNumber(u);if(typeof u=="string"||u instanceof String)if(o)u=o.fromString(u);else return r.fromNumber(parseInt(u,10));return u.low||u.high?new r(u.low>>>0,u.high>>>0):s},r.prototype.toNumber=function(u){if(!u&&this.hi>>>31){var m=~this.lo+1>>>0,p=~this.hi>>>0;return m||(p=p+1>>>0),-(m+p*4294967296)}return this.lo+this.hi*4294967296},r.prototype.toLong=function(u){return o?new o(this.lo|0,this.hi|0,!!u):{low:this.lo|0,high:this.hi|0,unsigned:!!u}};var c=String.prototype.charCodeAt;r.fromHash=function(u){return u===a?s:new r((c.call(u,0)|c.call(u,1)<<8|c.call(u,2)<<16|c.call(u,3)<<24)>>>0,(c.call(u,4)|c.call(u,5)<<8|c.call(u,6)<<16|c.call(u,7)<<24)>>>0)},r.prototype.toHash=function(){return String.fromCharCode(this.lo&255,this.lo>>>8&255,this.lo>>>16&255,this.lo>>>24,this.hi&255,this.hi>>>8&255,this.hi>>>16&255,this.hi>>>24)},r.prototype.zzEncode=function(){var u=this.hi>>31;return this.hi=((this.hi<<1|this.lo>>>31)^u)>>>0,this.lo=(this.lo<<1^u)>>>0,this},r.prototype.zzDecode=function(){var u=-(this.lo&1);return this.lo=((this.lo>>>1|this.hi<<31)^u)>>>0,this.hi=(this.hi>>>1^u)>>>0,this},r.prototype.length=function(){var u=this.lo,m=(this.lo>>>28|this.hi<<4)>>>0,p=this.hi>>>24;return p===0?m===0?u<16384?u<128?1:2:u<2097152?3:4:m<16384?m<128?5:6:m<2097152?7:8:p<128?9:10},r._configure=function(d){o=d}},{}],12:[function(t,n,i){"use strict";var o=i;o.asPromise=t(7),o.base64=t(8),o.EventEmitter=t(9),o.float=t(10),o.utf8=t(14),o.pool=t(13),o.LongBits=t(11);function r(c){return c==="__proto__"||c==="prototype"||c==="constructor"}o.isUnsafeProperty=r,o.isNode=!!(typeof global<"u"&&global&&global.process&&global.process.versions&&global.process.versions.node),o.global=o.isNode&&global||typeof window<"u"&&window||typeof self<"u"&&self||typeof globalThis<"u"&&globalThis||this,o.emptyArray=Object.freeze?Object.freeze([]):[],o.emptyObject=Object.freeze?Object.freeze({}):{},o.isInteger=Number.isInteger||function(d){return typeof d=="number"&&isFinite(d)&&Math.floor(d)===d},o.isString=function(d){return typeof d=="string"||d instanceof String},o.isObject=function(d){return d&&typeof d=="object"},o.isset=o.isSet=function(d,u){var m=d[u];return m!=null&&Object.hasOwnProperty.call(d,u)?typeof m!="object"||(Array.isArray(m)?m.length:Object.keys(m).length)>0:!1},o.Buffer=(function(){try{var c=o.global.Buffer;return c.prototype.utf8Write||o.isNode?c:null}catch{return null}})(),o.newBuffer=function(d){var u=o.Buffer;return typeof d=="number"?u?u.allocUnsafe(d):new Uint8Array(d):u?u.from(d):new Uint8Array(d)},o.rawField=function(d,u,m){var p=[],b=d<<3|u;for(b>>>=0;b>127;)p.push(b&127|128),b>>>=7;p.push(b);for(var f=0;f-1;--b)if(u[p[b]]===1&&this[p[b]]!==e&&this[p[b]]!==null)return p[b]}},o.oneOfSetter=function(d){return function(u){for(var m=0;m>>1,u=null,m=c;return function(b){if(b<1||b>d)return r(b);m+b>c&&(u=r(c),m=0);var f=s.call(u,m,m+=b);return m&7&&(m=(m|7)+1),f}}},{}],14:[function(t,n,i){"use strict";var o=i,r=new TextDecoder("utf-8",{ignoreBOM:!0}),s,a=64;try{s=new TextDecoder("utf-8",{fatal:!0,ignoreBOM:!0})}catch{s=r}o.length=function(u){for(var m=0,p=0,b=0;b=a)return c(r,u,m,p);for(var b="",f=m,y,_,S,Z,R,C,E,A;f+7=a)return c(s,u,m,p);for(var b="",f=m,y,_,S,Z,R,C,E,A;f+7>6|192,m[p++]=f&63|128):(f&64512)===55296&&((y=u.charCodeAt(_+1))&64512)===56320?(f=65536+((f&1023)<<10)+(y&1023),++_,m[p++]=f>>18|240,m[p++]=f>>12&63|128,m[p++]=f>>6&63|128,m[p++]=f&63|128):(m[p++]=f>>12|224,m[p++]=f>>6&63|128,m[p++]=f&63|128);return p-b}},{}],15:[function(t,n,i){"use strict";n.exports=d;var o=t(12),r,s=o.LongBits,a=o.base64,c=o.utf8;function d(){this.pos=0,this.buf=this.constructor.alloc(d.initialBufferSize),this.view=null,this.states=null}d.initialBufferSize=128,Object.defineProperty(d.prototype,"len",{configurable:!0,enumerable:!0,get:function(){return this.pos}});var u=function(){return o.Buffer?function(){return(d.create=function(){return new r})()}:function(){return new d}};d.create=u(),d.alloc=function(C){return new Uint8Array(C)},d.alloc=o.pool(d.alloc,Uint8Array.prototype.subarray);function m(R){return R<128?1:R<16384?2:R<2097152?3:R<268435456?4:5}d.prototype._reserve=function(C){var E=this.pos+C;if(E>this.buf.length){var A=this.buf.length<<1;A127;)C[E++]=R&127|128,R>>>=7;return C[E]=R,E+1}d.prototype.uint32=function(C){C=C>>>0,this._reserve(5);var E=this.pos;return this.pos=b(C,this.buf,E),this},d.prototype.int32=function(C){return(C|=0)<0?(this._reserve(10),f(s.fromNumber(C),this.buf,this.pos),this.pos+=10,this):this.uint32(C)},d.prototype.sint32=function(C){return this.uint32((C<<1^C>>31)>>>0)};function f(R,C,E){for(var A=R.lo,L=R.hi;L;)C[E++]=A&127|128,A=(A>>>7|L<<25)>>>0,L>>>=7;for(;A>127;)C[E++]=A&127|128,A=A>>>7;return C[E]=A,E+1}d.prototype.uint64=function(C){var E=s.from(C);this._reserve(10);var A=this.pos;return this.pos=f(E,this.buf,A),this},d.prototype.int64=d.prototype.uint64,d.prototype.sint64=function(C){var E=s.from(C).zzEncode();this._reserve(10);var A=this.pos;return this.pos=f(E,this.buf,A),this},d.prototype.bool=function(C){return this._reserve(1),this.buf[this.pos++]=C?1:0,this};function y(R,C,E){C[E]=R&255,C[E+1]=R>>>8&255,C[E+2]=R>>>16&255,C[E+3]=R>>>24}d.prototype.fixed32=function(C){return this._reserve(4),y(C>>>0,this.buf,this.pos),this.pos+=4,this},d.prototype.sfixed32=d.prototype.fixed32,d.prototype.fixed64=function(C){var E=s.from(C);return this._reserve(8),y(E.lo,this.buf,this.pos),y(E.hi,this.buf,this.pos+4),this.pos+=8,this},d.prototype.sfixed64=d.prototype.fixed64,d.prototype.float=function(C){return this._reserve(4),o.float.writeFloatLE(C,this.buf,this.pos),this.pos+=4,this},d.prototype.double=function(C){return this._reserve(8),o.float.writeDoubleLE(C,this.buf,this.pos),this.pos+=8,this},d.prototype.bytes=function(C){var E=C.length>>>0;if(!E)return this._reserve(1),this.buf[this.pos++]=0,this;if(o.isString(C)){var A=d.alloc(E=a.length(C));a.decode(C,A,0),C=A}return this.uint32(E),this._reserve(E),this.buf.set(C,this.pos),this.pos+=E,this},d.prototype.raw=function(C){var E=C.length>>>0;return E?(this._reserve(E),this.buf.set(C,this.pos),this.pos+=E,this):this},d.prototype._delim=function(C,E){var A=m(E);return A>1&&this.buf.copyWithin(C+A,C+1,C+1+E),b(E,this.buf,C),this.pos=C+A+E,this},d.prototype.string=function(C){var E=C.length;if(!E)return this._reserve(1),this.buf[this.pos++]=0,this;if(E<128){this._reserve(E*3+5);var A=this.pos;return this._delim(A,c.write(C,this.buf,A+1))}var L=c.length(C);return this.uint32(L),this._reserve(L),L===C.length?p(C,this.buf,this.pos):c.write(C,this.buf,this.pos),this.pos+=L,this},d.prototype.uint32s=function(C){var E=C.length;this._reserve(E*5+5);for(var A=this.buf,L=this.pos,F=L+1,I=0;I>>0,A,F);return this._delim(L,F-L-1)},d.prototype.int32s=function(C){var E=C.length;this._reserve(E*10+5);for(var A=this.buf,L=this.pos,F=L+1,I,N=0;N>31)>>>0,A,F);return this._delim(L,F-L-1)},d.prototype.uint64s=function(C){var E=C.length;this._reserve(E*10+5);for(var A=this.buf,L=this.pos,F=L+1,I=0;I>>0,!0),L+=4;else{var N=this.buf;for(F=0;F>>0,N,L),L+=4}return this.pos+=A,this},d.prototype.sfixed32s=d.prototype.fixed32s,d.prototype.fixed64s=function(C){var E=C.length,A=E*8;this.uint32(A),this._reserve(A);var L=this.pos,F,I,N=Z(this,E,S);if(N)for(F=0;F1?(this._reserve(A-1),this.buf.copyWithin(L+A,L+1,L+1+E),this.pos+=A-1,b(E,this.buf,L)):this.buf[L]=E}else E=this.pos,A=m(E),this._reserve(A),this.buf.copyWithin(A,0,E),b(E,this.buf,0),this.pos+=A;return this},d.prototype.finish=function(C){if(C)return this.buf.subarray(0,this.pos);var E=this.constructor.alloc(this.pos);return E.set(this.buf.subarray(0,this.pos),0),E},d.prototype.finishInto=function(C,E){return E===e&&(E=0),C.set(this.buf.subarray(0,this.pos),E),C},d._configure=function(R){r=R,d.create=u(),r._configure()}},{12:12}],16:[function(t,n,i){"use strict";n.exports=s;var o=t(15);s.prototype=Object.create(o.prototype,{constructor:{value:s,writable:!0,enumerable:!1,configurable:!0}});var r=t(12);function s(){o.call(this)}var a;s._configure=function(){s.alloc=r.Buffer&&r.Buffer.allocUnsafe,a=r.Buffer&&r.Buffer.prototype.utf8Write?function(d,u,m){return u.utf8Write(d,m)}:function(d,u,m){return u.write(d,m)}},s.prototype.bytes=function(d){r.isString(d)&&(d=r.Buffer.from(d,"base64"));var u=d.length>>>0;return this.uint32(u),u&&(this._reserve(u),this.buf.set(d,this.pos),this.pos+=u),this},s.prototype.string=function(d){var u=d.length;if(!u)return this._reserve(1),this.buf[this.pos++]=0,this;if(u<128){this._reserve(u*3+5);var m=this.pos,p=this.buf;return this._delim(m,u<40?r.utf8.write(d,p,m+1):a(d,p,m+1))}var b=r.Buffer.byteLength(d);return this.uint32(b),this._reserve(b),a(d,this.buf,this.pos),this.pos+=b,this},s._configure()},{12:12,15:15}]},{},[1])})()});var LNe=gm((_ko,EJ)=>{var Sko=x(T());/* Copyright 2015-2018 Esri. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 @preserve */(function(){var e=(function(){var o={};o.defaultNoDataValue=-34027999387901484e22,o.decode=function(u,m){m=m||{};var p=m.encodedMaskData||m.encodedMaskData===null,b=c(u,m.inputOffset||0,p),f=m.noDataValue!==null?m.noDataValue:o.defaultNoDataValue,y=r(b,m.pixelType||Float32Array,m.encodedMaskData,f,m.returnMask),_={width:b.width,height:b.height,pixelData:y.resultPixels,minValue:y.minValue,maxValue:b.pixels.maxValue,noDataValue:f};return y.resultMask&&(_.maskData=y.resultMask),m.returnEncodedMask&&b.mask&&(_.encodedMaskData=b.mask.bitset?b.mask.bitset:null),m.returnFileInfo&&(_.fileInfo=s(b),m.computeUsedBitDepths&&(_.fileInfo.bitDepths=a(b))),_};var r=function(u,m,p,b,f){var y=0,_=u.pixels.numBlocksX,S=u.pixels.numBlocksY,Z=Math.floor(u.width/_),R=Math.floor(u.height/S),C=2*u.maxZError,E=Number.MAX_VALUE,A;p=p||(u.mask?u.mask.bitset:null);var L,F;L=new m(u.width*u.height),f&&p&&(F=new Uint8Array(u.width*u.height));for(var I=new Float32Array(Z*R),N,g,V=0;V<=S;V++){var G=V!==S?R:u.height%S;if(G!==0)for(var v=0;v<=_;v++){var X=v!==_?Z:u.width%_;if(X!==0){var Y=V*u.width*R+v*Z,D=u.width-X,M=u.pixels.blocks[y],O,w,z;M.encoding<2?(M.encoding===0?O=M.rawData:(d(M.stuffedData,M.bitsPerPixel,M.numValidPixels,M.offset,C,I,u.pixels.maxValue),O=I),w=0):M.encoding===2?z=0:z=M.offset;var K;if(p)for(g=0;g>3],K<<=Y&7),N=0;N>3]),K&128?(F&&(F[Y]=1),A=M.encoding<2?O[w++]:z,E=E>A?A:E,L[Y++]=A):(F&&(F[Y]=0),L[Y++]=b),K<<=1;Y+=D}else if(M.encoding<2)for(g=0;gA?A:E,L[Y++]=A;Y+=D}else for(E=E>z?z:E,g=0;g0){var _=new Uint8Array(Math.ceil(b.width*b.height/8));y=new DataView(u,m,b.mask.numBytes);var S=y.getInt16(0,!0),Z=2,R=0;do{if(S>0)for(;S--;)_[R++]=y.getUint8(Z++);else{var C=y.getUint8(Z++);for(S=-S;S--;)_[R++]=C}S=y.getInt16(Z,!0),Z+=2}while(Z0?1:0),F=A+(b.height%A>0?1:0);b.pixels.blocks=new Array(L*F);for(var I=0,N=0;N3)throw"Invalid block encoding ("+v.encoding+")";if(v.encoding===2){m++;continue}if(X!==0&&X!==2){if(X>>=6,v.offsetType=X,X===2)v.offset=y.getInt8(1),V++;else if(X===1)v.offset=y.getInt16(1,!0),V+=2;else if(X===0)v.offset=y.getFloat32(1,!0),V+=4;else throw"Invalid block offset type";if(v.encoding===1)if(X=y.getUint8(V),V++,v.bitsPerPixel=X&63,X>>=6,v.numValidPixelsType=X,X===2)v.numValidPixels=y.getUint8(V),V++;else if(X===1)v.numValidPixels=y.getUint16(V,!0),V+=2;else if(X===0)v.numValidPixels=y.getUint32(V,!0),V+=4;else throw"Invalid valid pixel count type"}if(m+=V,v.encoding!==3){var Y,D;if(v.encoding===0){var M=(b.pixels.numBytes-1)/4;if(M!==Math.floor(M))throw"uncompressed block has invalid length";Y=new ArrayBuffer(M*4),D=new Uint8Array(Y),D.set(new Uint8Array(u,m,M*4));var O=new Float32Array(Y);v.rawData=O,m+=M*4}else if(v.encoding===1){var w=Math.ceil(v.numValidPixels*v.bitsPerPixel/8),z=Math.ceil(w/4);Y=new ArrayBuffer(z*4),D=new Uint8Array(Y),D.set(new Uint8Array(u,m,w)),v.stuffedData=new Uint32Array(Y),m+=w}}}return b.eofOffset=m,b},d=function(u,m,p,b,f,y,_){var S=(1<=m)E=A>>>C-m&S,C-=m;else{var I=m-C;E=(A&S)<>>C}y[R]=E=u?(C=E>>>R-u&_,R-=u):(A=u-R,C=(E&_)<>>R),d[Z]=p[C];else for(L=Math.ceil((y-b)/f),Z=0;Z=u?(C=E>>>R-u&_,R-=u):(A=u-R,C=(E&_)<>>R),d[Z]=C=d?(R=C>>>Z-d&f,Z-=d):(S=d-Z,R=(C&f)<>>Z),E[_]=R=u?(E=A>>>C&_,R-=u,C+=u):(L=u-R,E=A>>>C&_,A=c[S++],R=32-L,E|=(A&(1<=u?(E=A>>>C&_,R-=u,C+=u):(L=u-R,E=A>>>C&_,A=c[S++],R=32-L,E|=(A&(1<=d?(R=E>>>C&f,Z-=d,C+=d):(S=d-Z,R=E>>>C&f,E=c[y++],Z=32-S,R|=(E&(1<=u?(_=S>>>y-u&p,y-=u):(Z=u-y,_=(S&p)<>>y),d[f]=_;return d},originalUnstuff2:function(c,d,u,m){var p=(1<=u?(S=Z>>>_&p,y-=u,_+=u):(R=u-y,S=Z>>>_&p,Z=c[b++],y=32-R,S|=(Z&(1<=359?359:p;p-=f;do d+=c[b++]<<8,u+=d+=c[b++];while(--f);d=(d&65535)+(d>>>16),u=(u&65535)+(u>>>16)}return m&1&&(u+=d+=c[b]<<8),d=(d&65535)+(d>>>16),u=(u&65535)+(u>>>16),(u<<16|d)>>>0},readHeaderInfo:function(c,d){var u=d.ptr,m=new Uint8Array(c,u,6),p={};if(p.fileIdentifierString=String.fromCharCode.apply(null,m),p.fileIdentifierString.lastIndexOf("Lerc2",0)!==0)throw"Unexpected file identifier string (expect Lerc2 ): "+p.fileIdentifierString;u+=6;var b=new DataView(c,u,8),f=b.getInt32(0,!0);p.fileVersion=f,u+=4,f>=3&&(p.checksum=b.getUint32(4,!0),u+=4),b=new DataView(c,u,12),p.height=b.getUint32(0,!0),p.width=b.getUint32(4,!0),u+=8,f>=4?(p.numDims=b.getUint32(8,!0),u+=4):p.numDims=1,b=new DataView(c,u,40),p.numValidPixel=b.getUint32(0,!0),p.microBlockSize=b.getInt32(4,!0),p.blobSize=b.getInt32(8,!0),p.imageType=b.getInt32(12,!0),p.maxZError=b.getFloat64(16,!0),p.zMin=b.getFloat64(24,!0),p.zMax=b.getFloat64(32,!0),u+=40,d.headerInfo=p,d.ptr=u;var y,_;if(f>=3&&(_=f>=4?52:48,y=this.computeChecksumFletcher32(new Uint8Array(c,u-_,p.blobSize-14)),y!==p.checksum))throw"Checksum failed.";return!0},checkMinMaxRanges:function(c,d){var u=d.headerInfo,m=this.getDataTypeArray(u.imageType),p=u.numDims*this.getDataTypeSize(u.imageType),b=this.readSubArray(c,d.ptr,m,p),f=this.readSubArray(c,d.ptr+p,m,p);d.ptr+=2*p;var y,_=!0;for(y=0;y0){_=new Uint8Array(Math.ceil(p/8)),f=new DataView(c,u,y.numBytes);var Z=f.getInt16(0,!0),R=2,C=0,E=0;do{if(Z>0)for(;Z--;)_[C++]=f.getUint8(R++);else for(E=f.getUint8(R++),Z=-Z;Z--;)_[C++]=E;Z=f.getInt16(R,!0),R+=2}while(R>3],A<<=L&7):A=_[L>>3],A&128&&(S[L]=1);d.pixels.resultMask=S,y.bitset=_,u+=y.numBytes}return d.ptr=u,d.mask=y,!0},readDataOneSweep:function(c,d,u){var m=d.ptr,p=d.headerInfo,b=p.numDims,f=p.width*p.height,y=p.imageType,_=p.numValidPixel*r.getDataTypeSize(y)*b,S,Z=d.pixels.resultMask;if(u===Uint8Array)S=new Uint8Array(c,m,_);else{var R=new ArrayBuffer(_),C=new Uint8Array(R);C.set(new Uint8Array(c,m,_)),S=new u(R)}if(S.length===f*b)d.pixels.resultPixels=S;else{d.pixels.resultPixels=new u(f*b);var E=0,A=0,L=0,F=0;if(b>1)for(L=0;L=y)return!1;var _=new Uint32Array(y-f);r.decodeBits(c,d,_);var S=[],Z,R,C,E;for(Z=f;Z0&&(S[R].second=V<>>32-E,32-g>=E?(g+=E,g===32&&(g=0,G++,V=N[G])):(g+=E-32,G++,V=N[G],S[R].second|=V>>>32-g));var v=0,X=0,Y=new s;for(Z=0;Z=u?X=u:X=v,v>=30&&console.log("WARning, large NUM LUT BITS IS "+v);var D=[],M,O,w,z,K,te;for(Z=f;Z0)if(M=[E,R],E<=X)for(O=S[R].second<=0;z--)K=O>>>z&1,K?(te.right||(te.right=new s),te=te.right):(te.left||(te.left=new s),te=te.left),z===0&&!te.val&&(te.val=M[1]);return{decodeLut:D,numBitsLUTQick:X,numBitsLUT:v,tree:Y,stuffedData:N,srcPtr:G,bitPos:g}},readHuffman:function(c,d,u){var m=d.headerInfo,p=m.numDims,b=d.headerInfo.height,f=d.headerInfo.width,y=f*b,_=this.readHuffmanTree(c,d),S=_.decodeLut,Z=_.tree,R=_.stuffedData,C=_.srcPtr,E=_.bitPos,A=_.numBitsLUTQick,L=_.numBitsLUT,F=d.headerInfo.imageType===0?128:0,I,N,g,V=d.pixels.resultMask,G,v,X,Y,D,M,O,w=0;E>0&&(C++,E=0);var z=R[C],K=d.encodeMode===1,te=new u(y*p),H=te,$;for($=0;$1&&(H=new u(te.buffer,y*$,y),w=0),d.headerInfo.numValidPixel===f*b)for(M=0,Y=0;Y>>32-A,v=G,32-E>>64-E-A,v=G),S[v])N=S[v][1],E+=S[v][0];else for(G=z<>>32-L,v=G,32-E>>64-E-L,v=G),I=Z,O=0;O>>L-O-1&1,I=X?I.right:I.left,!(I.left||I.right)){N=I.val,E=E+O+1;break}E>=32&&(E-=32,C++,z=R[C]),g=N-F,K?(D>0?g+=w:Y>0?g+=H[M-f]:g+=w,g&=255,H[M]=g,w=g):H[M]=g}else for(M=0,Y=0;Y>>32-A,v=G,32-E>>64-E-A,v=G),S[v])N=S[v][1],E+=S[v][0];else for(G=z<>>32-L,v=G,32-E>>64-E-L,v=G),I=Z,O=0;O>>L-O-1&1,I=X?I.right:I.left,!(I.left||I.right)){N=I.val,E=E+O+1;break}E>=32&&(E-=32,C++,z=R[C]),g=N-F,K?(D>0&&V[M-1]?g+=w:Y>0&&V[M-f]?g+=H[M-f]:g+=w,g&=255,H[M]=g,w=g):H[M]=g}d.ptr=d.ptr+(C+1)*4+(E>0?4:0)}d.pixels.resultPixels=te},decodeBits:function(c,d,u,m,p){{var b=d.headerInfo,f=b.fileVersion,y=0,_=new DataView(c,d.ptr,5),S=_.getUint8(0);y++;var Z=S>>6,R=Z===0?4:3-Z,C=(S&32)>0,E=S&31,A=0;if(R===1)A=_.getUint8(y),y++;else if(R===2)A=_.getUint16(y,!0),y+=2;else if(R===4)A=_.getUint32(y,!0),y+=4;else throw"Invalid valid pixel count type";var L=2*b.maxZError,F,I,N,g,V,G,v,X,Y,D,M=b.numDims>1?b.maxValues[p]:b.zMax;if(C){for(d.counter.lut++,X=_.getUint8(y),Y=E,y++,g=Math.ceil((X-1)*E/8),V=Math.ceil(g/4),I=new ArrayBuffer(V*4),N=new Uint8Array(I),d.ptr+=y,N.set(new Uint8Array(c,d.ptr,g)),v=new Uint32Array(I),d.ptr+=g,D=0;X-1>>>D;)D++;g=Math.ceil(A*D/8),V=Math.ceil(g/4),I=new ArrayBuffer(V*4),N=new Uint8Array(I),N.set(new Uint8Array(c,d.ptr,g)),F=new Uint32Array(I),d.ptr+=g,f>=3?G=o.unstuffLUT2(v,E,X-1,m,L,M):G=o.unstuffLUT(v,E,X-1,m,L,M),f>=3?o.unstuff2(F,u,D,A,G):o.unstuff(F,u,D,A,G)}else d.counter.bitstuffer++,D=E,d.ptr+=y,D>0&&(g=Math.ceil(A*D/8),V=Math.ceil(g/4),I=new ArrayBuffer(V*4),N=new Uint8Array(I),N.set(new Uint8Array(c,d.ptr,g)),F=new Uint32Array(I),d.ptr+=g,f>=3?m==null?o.originalUnstuff2(F,u,D,A):o.unstuff2(F,u,D,A,!1,m,L,M):m==null?o.originalUnstuff(F,u,D,A):o.unstuff(F,u,D,A,!1,m,L,M))}},readTiles:function(c,d,u){var m=d.headerInfo,p=m.width,b=m.height,f=m.microBlockSize,y=m.imageType,_=r.getDataTypeSize(y),S=Math.ceil(p/f),Z=Math.ceil(b/f);d.pixels.numBlocksY=Z,d.pixels.numBlocksX=S,d.pixels.ptr=0;var R=0,C=0,E=0,A=0,L=0,F=0,I=0,N=0,g=0,V=0,G=0,v=0,X=0,Y=0,D=0,M=0,O,w,z,K,te,H,$=new u(f*f),ee=b%f||f,le=p%f||f,_e,he,Ze=m.numDims,ye,Ge=d.pixels.resultMask,Ae=d.pixels.resultPixels;for(E=0;E1&&(Ae=new u(d.pixels.resultPixels.buffer,p*b*ye*_,p*b)),I=c.byteLength-d.ptr,O=new DataView(c,d.ptr,Math.min(10,I)),w={},M=0,N=O.getUint8(0),M++,g=N>>6&255,V=N>>2&15,V!==(A*f>>3&15))throw"integrity issue";if(H=N&3,H>3)throw d.ptr+=M,"Invalid block encoding ("+H+")";if(H===2){d.counter.constant++,d.ptr+=M;continue}else if(H===0){if(d.counter.uncompressed++,d.ptr+=M,X=L*F*_,Y=c.byteLength-d.ptr,X=X1)for(b=0;b=-128&&d<=127;break;case 1:u=d>=0&&d<=255;break;case 2:u=d>=-32768&&d<=32767;break;case 3:u=d>=0&&d<=65536;break;case 4:u=d>=-2147483648&&d<=2147483647;break;case 5:u=d>=0&&d<=4294967296;break;case 6:u=d>=-34027999387901484e22&&d<=34027999387901484e22;break;case 7:u=d>=5e-324&&d<=17976931348623157e292;break;default:u=!1}return u},getDataTypeSize:function(c){var d=0;switch(c){case 0:case 1:d=1;break;case 2:case 3:d=2;break;case 4:case 5:case 6:d=4;break;case 7:d=8;break;default:d=c}return d},getDataTypeUsed:function(c,d){var u=c;switch(c){case 2:case 4:u=c-d;break;case 3:case 5:u=c-2*d;break;case 6:d===0?u=c:d===1?u=2:u=1;break;case 7:d===0?u=c:u=c-2*d+1;break;default:u=c;break}return u},getOnePixel:function(c,d,u,m){var p=0;switch(u){case 0:p=m.getInt8(d);break;case 1:p=m.getUint8(d);break;case 2:p=m.getInt16(d,!0);break;case 3:p=m.getUint16(d,!0);break;case 4:p=m.getInt32(d,!0);break;case 5:p=m.getUInt32(d,!0);break;case 6:p=m.getFloat32(d,!0);break;case 7:p=m.getFloat64(d,!0);break;default:throw"the decoder does not understand this pixel type"}return p}},s=function(c,d,u){this.val=c,this.left=d,this.right=u},a={decode:function(c,d){d=d||{};var u=d.noDataValue,m=0,p={};if(p.ptr=d.inputOffset||0,p.pixels={},!!r.readHeaderInfo(c,p)){var b=p.headerInfo,f=b.fileVersion,y=r.getDataTypeArray(b.imageType);r.readMask(c,p),b.numValidPixel!==b.width*b.height&&!p.pixels.resultMask&&(p.pixels.resultMask=d.maskData);var _=b.width*b.height;if(p.pixels.resultPixels=new y(_*b.numDims),p.counter={onesweep:0,uncompressed:0,lut:0,bitstuffer:0,constant:0,constantoffset:0},b.numValidPixel!==0)if(b.zMax===b.zMin)r.constructConstantSurface(p);else if(f>=4&&r.checkMinMaxRanges(c,p))r.constructConstantSurface(p);else{var S=new DataView(c,p.ptr,2),Z=S.getUint8(0);if(p.ptr++,Z)r.readDataOneSweep(c,p,y);else if(f>1&&b.imageType<=1&&Math.abs(b.maxZError-.5)<1e-5){var R=S.getUint8(1);if(p.ptr++,p.encodeMode=R,R>2||f<4&&R>1)throw"Invalid Huffman flag "+R;R?r.readHuffman(c,p,y):r.readTiles(c,p,y)}else r.readTiles(c,p,y)}p.eofOffset=p.ptr;var C;d.inputOffset?(C=p.headerInfo.blobSize+d.inputOffset-p.ptr,Math.abs(C)>=1&&(p.eofOffset=d.inputOffset+p.headerInfo.blobSize)):(C=p.headerInfo.blobSize-p.ptr,Math.abs(C)>=1&&(p.eofOffset=p.headerInfo.blobSize));var E={width:b.width,height:b.height,pixelData:p.pixels.resultPixels,minValue:b.zMin,maxValue:b.zMax,validPixelCount:b.numValidPixel,dimCount:b.numDims,dimStats:{minValues:b.minValues,maxValues:b.maxValues},maskData:p.pixels.resultMask};if(p.pixels.resultMask&&r.isValidPixelValue(b.imageType,u)){var A=p.pixels.resultMask;for(m=0;m<_;m++)A[m]||(E.pixelData[m]=u);E.noDataValue=u}return p.noDataValue=u,d.returnFileInfo&&(E.fileInfo=r.formatFileInfo(p)),E}},getBandCount:function(c){var d=0,u=0,m={};for(m.ptr=0,m.pixels={};u1&&Z.fileInfo.mask&&Z.fileInfo.mask.numBytes>0&&f.push(Z.maskData),m++,S.pixels.push(Z.pixelData),S.statistics.push({minValue:Z.minValue,maxValue:Z.maxValue,noDataValue:Z.noDataValue,dimStats:Z.dimStats})}var R,C,E;if(u>1&&f.length>1){for(E=S.width*S.height,S.bandMasks=f,_=new Uint8Array(E),_.set(f[0]),R=1;R{var Vfr=x(T());VYe.exports={webm:"data:video/webm;base64,GkXfowEAAAAA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AAAACQAAAAkAAAAJAAAACQAAAAkAAAAJAAAACQAAAAkAAAAJAAAACQAAAAkAAAAJAAAACQAAAAkAAAAJAAAACQAAAAkAAAAJAAAACQAAAAkAAAAJAAAACQAAAAkAAAAJAAAACQAAAAkAAAAJAAAACQAAAAkAAAAJAAAACQAAAAkAAAAJAAAACQAAAAkAAACMc3RjbwAAAAAAAAAfAAAALAAAA1UAAANyAAADhgAAA6IAAAO+AAAD0QAAA+0AAAQAAAAEHAAABC8AAARLAAAEZwAABHoAAASWAAAEqQAABMUAAATYAAAE9AAABRAAAAUjAAAFPwAABVIAAAVuAAAFgQAABZ0AAAWwAAAFzAAABegAAAX7AAAGFwAAAGJ1ZHRhAAAAWm1ldGEAAAAAAAAAIWhkbHIAAAAAAAAAAG1kaXJhcHBsAAAAAAAAAAAAAAAALWlsc3QAAAAlqXRvbwAAAB1kYXRhAAAAAQAAAABMYXZmNTUuMzMuMTAw"}});var GYe=gm((Efr,AYe)=>{var Afr=x(T()),{webm:$Bt,mp4:e3t}=EYe(),hle=()=>typeof navigator<"u"&&parseFloat((""+(/CPU.*OS ([0-9_]{3,4})[0-9_]{0,1}|(CPU like).*AppleWebKit.*Mobile/i.exec(navigator.userAgent)||[0,""])[1]).replace("undefined","3_2").replace("_",".").replace("_",""))<10&&!window.MSStream,fle=()=>"wakeLock"in navigator,ple=class{constructor(){if(this.enabled=!1,fle()){this._wakeLock=null;let t=()=>{this._wakeLock!==null&&document.visibilityState==="visible"&&this.enable()};document.addEventListener("visibilitychange",t),document.addEventListener("fullscreenchange",t)}else hle()?this.noSleepTimer=null:(this.noSleepVideo=document.createElement("video"),this.noSleepVideo.setAttribute("title","No Sleep"),this.noSleepVideo.setAttribute("playsinline",""),this._addSourceToVideo(this.noSleepVideo,"webm",$Bt),this._addSourceToVideo(this.noSleepVideo,"mp4",e3t),this.noSleepVideo.addEventListener("loadedmetadata",()=>{this.noSleepVideo.duration<=1?this.noSleepVideo.setAttribute("loop",""):this.noSleepVideo.addEventListener("timeupdate",()=>{this.noSleepVideo.currentTime>.5&&(this.noSleepVideo.currentTime=Math.random())})}))}_addSourceToVideo(t,n,i){var o=document.createElement("source");o.src=i,o.type=`video/${n}`,t.appendChild(o)}get isEnabled(){return this.enabled}enable(){return fle()?navigator.wakeLock.request("screen").then(t=>{this._wakeLock=t,this.enabled=!0,console.log("Wake Lock active."),this._wakeLock.addEventListener("release",()=>{console.log("Wake Lock released.")})}).catch(t=>{throw this.enabled=!1,console.error(`${t.name}, ${t.message}`),t}):hle()?(this.disable(),console.warn(` + */(function(e){"use strict";(function(n,i,o){function r(a){var c=i[a];return c||n[a][0].call(c=i[a]={exports:{}},r,c,c.exports),c.exports}var s=r(o[0]);s.util.global.protobuf=s,typeof define=="function"&&define.amd&&define(["long"],function(a){return a&&a.isLong&&(s.util.Long=a,s.configure()),s}),typeof RU=="object"&&RU&&RU.exports&&(RU.exports=s)})({1:[function(t,n,i){"use strict";i.build="minimal",i.Writer=t(15),i.BufferWriter=t(16),i.Reader=t(2),i.BufferReader=t(3),i.util=t(12),i.rpc=t(5),i.roots=t(4),i.configure=o;function o(){i.util.LongBits._configure(i.util.Long),i.Writer._configure(i.BufferWriter),i.Reader._configure(i.BufferReader)}o()},{12:12,15:15,16:16,2:2,3:3,4:4,5:5}],2:[function(t,n,i){"use strict";n.exports=d;var o=t(12),r,s=o.LongBits,a=o.utf8;function c(R,C){return RangeError("index out of range: "+R.pos+" + "+(C||1)+" > "+R.len)}function d(R){this.buf=R,this.pos=0,this.len=R.length,this.view=null,this.discardUnknown=d.discardUnknown}function u(R){if(Array.isArray(R)&&(R=new Uint8Array(R)),R instanceof Uint8Array)return new d(R);throw Error("illegal buffer")}var m=function(){return o.Buffer?function(E){return(d.create=function(L){return o.Buffer.isBuffer(L)?new r(L):u(L)})(E)}:u};d.create=m(),d.prototype.raw=function(C,E){return this.buf.subarray(C,E)};function p(R){for(var C=0,E=0;E<4;++E){if(R.pos>=R.len)throw c(R);var A=R.buf[R.pos++];if(C=(C|(A&127)<>>0,A<128)return C}throw c(R)}d.prototype.uint32=function(){if(this.len-this.pos<5){if(this.pos>=this.len)throw c(this);if(this.buf[this.pos]>=128)return p(this)}var C=this.buf,E=this.pos,A=(C[E]&127)>>>0;if(C[E++]<128)return this.pos=E,A;if(A=(A|(C[E]&127)<<7)>>>0,C[E++]<128)return this.pos=E,A;if(A=(A|(C[E]&127)<<14)>>>0,C[E++]<128)return this.pos=E,A;if(A=(A|(C[E]&127)<<21)>>>0,C[E++]<128)return this.pos=E,A;if(A=(A|(C[E]&15)<<28)>>>0,C[E++]<128)return this.pos=E,A;for(var L=0;L<5;++L){if(E>=this.len)throw this.pos=E,c(this);if(C[E++]<128)return this.pos=E,A}throw this.pos=E,Error("invalid varint encoding")},d.prototype.tag=function(){if(this.len-this.pos<5){if(this.pos>=this.len)throw c(this);if(this.buf[this.pos]>=128)return p(this)}var C=this.buf,E=this.pos,A=(C[E]&127)>>>0;if(C[E++]<128)return this.pos=E,A;if(A=(A|(C[E]&127)<<7)>>>0,C[E++]<128)return this.pos=E,A;if(A=(A|(C[E]&127)<<14)>>>0,C[E++]<128)return this.pos=E,A;if(A=(A|(C[E]&127)<<21)>>>0,C[E++]<128)return this.pos=E,A;if(A=(A|(C[E]&15)<<28)>>>0,C[E]<128&&(C[E]&112)===0)return this.pos=E+1,A;throw this.pos=E+1,Error("invalid tag encoding")},d.prototype.int32=function(){return this.uint32()|0},d.prototype.sint32=function(){var C=this.uint32();return C>>>1^-(C&1)|0};function b(){var R=new s(0,0),C=0;if(this.len-this.pos>4){for(;C<4;++C)if(R.lo=(R.lo|(this.buf[this.pos]&127)<>>0,this.buf[this.pos++]<128)return R;if(R.lo=(R.lo|(this.buf[this.pos]&127)<<28)>>>0,R.hi=(R.hi|(this.buf[this.pos]&127)>>4)>>>0,this.buf[this.pos++]<128)return R;C=0}else{for(;C<4;++C){if(this.pos>=this.len)throw c(this);if(R.lo=(R.lo|(this.buf[this.pos]&127)<>>0,this.buf[this.pos++]<128)return R}throw c(this)}if(this.len-this.pos>4){for(;C<5;++C)if(R.hi=(R.hi|(this.buf[this.pos]&127)<>>0,this.buf[this.pos++]<128)return R}else for(;C<5;++C){if(this.pos>=this.len)throw c(this);if(R.hi=(R.hi|(this.buf[this.pos]&127)<>>0,this.buf[this.pos++]<128)return R}throw Error("invalid varint encoding")}d.prototype.bool=function(){for(var C=!1,E,A=0;A<10;++A){if(this.pos>=this.len)throw c(this);if(E=this.buf[this.pos++],E&127&&(C=!0),E<128)return C}throw Error("invalid varint encoding")};function f(R,C){return(R[C-4]|R[C-3]<<8|R[C-2]<<16|R[C-1]<<24)>>>0}d.prototype.fixed32=function(){if(this.pos+4>this.len)throw c(this,4);return f(this.buf,this.pos+=4)},d.prototype.sfixed32=function(){if(this.pos+4>this.len)throw c(this,4);return f(this.buf,this.pos+=4)|0};function y(){if(this.pos+8>this.len)throw c(this,8);return new s(f(this.buf,this.pos+=4),f(this.buf,this.pos+=4))}d.prototype.float=function(){if(this.pos+4>this.len)throw c(this,4);var C=o.float.readFloatLE(this.buf,this.pos);return this.pos+=4,C},d.prototype.double=function(){if(this.pos+8>this.len)throw c(this,4);var C=o.float.readDoubleLE(this.buf,this.pos);return this.pos+=8,C},d.prototype.uint32s=function(C){C===e&&(C=[]);var E=this.uint32()+this.pos,A=this.len,L=this.buf,F=this.pos,I;if(E>A)throw c(this,E-this.pos);for(this.len=E;FA)throw c(this,E-this.pos);for(this.len=E;FA)throw c(this,E-this.pos);for(this.len=E;this.posA)throw c(this,E-this.pos);for(this.len=E;Fthis.len)throw c(this,E);var L=E>>>2,F=C.length,I=this.pos;C.length=F+L;var N=Z(this,L,S);if(N)for(var g=0;gthis.len)throw c(this,E);var L=E>>>2,F=C.length,I=this.pos;C.length=F+L;var N=Z(this,L,S);if(N)for(var g=0;gthis.len)throw c(this,E);var L=E>>>2,F=C.length,I=this.pos;C.length=F+L;var N=Z(this,L,_);if(N)for(var g=0;gthis.len)throw c(this,E);var L=E>>>3,F=C.length,I=this.pos;C.length=F+L;var N=Z(this,L,_);if(N)for(var g=0;gA)throw c(this,E-this.pos);for(this.len=E;this.posA)throw c(this,E-this.pos);for(this.len=E;this.posA)throw c(this,E-this.pos);for(this.len=E;this.posthis.len)throw c(this,E);var F=E>>>3;C.length=L+F;for(var I=0;Ithis.len)throw c(this,E);var F=E>>>3;C.length=L+F;for(var I=0;Ithis.len)throw c(this,C);return this.pos=A,this.raw(E,A)},d.prototype.string=function(){var C=this.uint32(),E=this.pos,A=this.pos+C;if(A>this.len)throw c(this,C);return this.pos=A,a.read(this.buf,E,A)},d.prototype.stringVerify=function(){var C=this.uint32(),E=this.pos,A=this.pos+C;if(A>this.len)throw c(this,C);return this.pos=A,a.readStrict(this.buf,E,A)},d.prototype.skip=function(C){if(typeof C=="number"){if(this.pos+C>this.len)throw c(this,C);this.pos+=C}else do if(this.pos>=this.len)throw c(this);while(this.buf[this.pos++]&128);return this},d.recursionLimit=o.recursionLimit,d.discardUnknown=!0,d.prototype.skipType=function(R,C,E){if(C===e&&(C=0),C>d.recursionLimit)throw Error("max depth exceeded");if(E===0)throw Error("illegal tag: field number 0");switch(R){case 0:this.skip();break;case 1:this.skip(8);break;case 2:this.skip(this.uint32());break;case 3:for(;;){var A=this.tag(),L=A>>>3;if(R=A&7,!L)throw Error("illegal tag: field number 0");if(R===4){if(E!==e&&L!==E)throw Error("invalid end group tag");break}this.skipType(R,C+1,L)}break;case 5:this.skip(4);break;default:throw Error("invalid wire type "+R+" at offset "+this.pos)}return this},d._configure=function(R){r=R,d.create=m(),r._configure();var C=o.Long?"toLong":"toNumber";o.merge(d.prototype,{int64:function(){return b.call(this)[C](!1)},uint64:function(){return b.call(this)[C](!0)},sint64:function(){return b.call(this).zzDecode()[C](!1)},fixed64:function(){return y.call(this)[C](!0)},sfixed64:function(){return y.call(this)[C](!1)}})}},{12:12}],3:[function(t,n,i){"use strict";n.exports=s;var o=t(2);s.prototype=Object.create(o.prototype,{constructor:{value:s,writable:!0,enumerable:!1,configurable:!0}});var r=t(12);function s(a){o.call(this,a)}s._configure=function(){r.Buffer&&(s.prototype._slice=r.Buffer.prototype.slice)},s.prototype.raw=function(c,d){return this._slice.call(this.buf,c,d)},s.prototype.string=function(){var c=this.uint32(),d=this.pos,u=this.pos+c;if(u>this.len)throw RangeError("index out of range: "+this.pos+" + "+c+" > "+this.len);return this.pos=u,this.buf.utf8Slice?this.buf.utf8Slice(d,u):this.buf.toString("utf-8",d,u)},s._configure()},{12:12,2:2}],4:[function(t,n,i){"use strict";n.exports=Object.create(null)},{}],5:[function(t,n,i){"use strict";var o=i;o.Service=t(6)},{6:6}],6:[function(t,n,i){"use strict";n.exports=r;var o=t(12);r.prototype=Object.create(o.EventEmitter.prototype,{constructor:{value:r,writable:!0,enumerable:!1,configurable:!0}});function r(s,a,c){if(typeof s!="function")throw TypeError("rpcImpl must be a function");o.EventEmitter.call(this),this.rpcImpl=s,this.requestDelimited=!!a,this.responseDelimited=!!c}r.prototype.rpcCall=function s(a,c,d,u,m){if(!u)throw TypeError("request must be specified");var p=this;if(!m)return o.asPromise(s,p,a,c,d,u);if(!p.rpcImpl)return setTimeout(function(){m(Error("already ended"))},0),e;try{return p.rpcImpl(a,c[p.requestDelimited?"encodeDelimited":"encode"](u).finish(),function(f,y){if(f)return p.emit("error",f,a),m(f);if(y===null)return p.end(!0),e;if(!(y instanceof d))try{y=d[p.responseDelimited?"decodeDelimited":"decode"](y)}catch(_){return p.emit("error",_,a),m(_)}return p.emit("data",y,a),m(null,y)})}catch(b){return p.emit("error",b,a),setTimeout(function(){m(b)},0),e}},r.prototype.end=function(a){return this.rpcImpl&&(a||this.rpcImpl(null,null,null),this.rpcImpl=null,this.emit("end").off()),this}},{12:12}],7:[function(t,n,i){"use strict";n.exports=o;function o(r,s){for(var a=new Array(arguments.length-1),c=0,d=2,u=!0;d0&&b.charAt(f-1)==="=";)--f;return Math.floor(f*3/4)};for(var r=new Array(64),s=new Array(123),a=0;a<64;)s[r[a]=a<26?a+65:a<52?a+71:a<62?a-4:a-59|43]=a++;s[45]=62,s[95]=63,o.encode=function(b,f,y){for(var _=null,S=[],Z=0,R=0,C;f>2],C=(E&3)<<4,R=1;break;case 1:S[Z++]=r[C|E>>4],C=(E&15)<<2,R=2;break;case 2:S[Z++]=r[C|E>>6],S[Z++]=r[E&63],R=0;break}Z>8191&&((_||(_=[])).push(String.fromCharCode.apply(String,S)),Z=0)}return R&&(S[Z++]=r[C],S[Z++]=61,R===1&&(S[Z++]=61)),_?(Z&&_.push(String.fromCharCode.apply(String,S.slice(0,Z))),_.join("")):String.fromCharCode.apply(String,S.slice(0,Z))};var c="invalid encoding";o.decode=function(b,f,y){for(var _=y,S=0,Z,R=0;R1)break;if((C=s[C])===e)throw Error(c);switch(S){case 0:Z=C,S=1;break;case 1:f[y++]=Z<<2|(C&48)>>4,Z=C,S=2;break;case 2:f[y++]=(Z&15)<<4|(C&60)>>2,Z=C,S=3;break;case 3:f[y++]=(Z&3)<<6|C,S=0;break}}if(S===1)throw Error(c);return y-_};var d=/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/,u=/[-_]/,m=/^(?:[A-Za-z0-9_-]{4})*(?:[A-Za-z0-9_-]{2}(?:==)?|[A-Za-z0-9_-]{3}=?)?$/;o.test=function(b){return d.test(b)||u.test(b)&&m.test(b)}},{}],9:[function(t,n,i){"use strict";n.exports=o;function o(){this._listeners=Object.create(null)}o.prototype.on=function(s,a,c){return(this._listeners[s]||(this._listeners[s]=[])).push({fn:a,ctx:c||this}),this},o.prototype.off=function(s,a){if(s===e)this._listeners=Object.create(null);else if(a===e)this._listeners[s]=[];else{var c=this._listeners[s];if(!c)return this;for(var d=0;d0?0:2147483648,f,y);else if(isNaN(b))p(2143289344,f,y);else if(b>34028234663852886e22)p((_<<31|2139095040)>>>0,f,y);else if(b<11754943508222875e-54)p((_<<31|Math.round(b/1401298464324817e-60))>>>0,f,y);else{var S=Math.floor(Math.log(b)/Math.LN2),Z=Math.round(b*Math.pow(2,-S)*8388608)&8388607;p((_<<31|S+127<<23|Z)>>>0,f,y)}}d.writeFloatLE=u.bind(null,r),d.writeFloatBE=u.bind(null,s);function m(p,b,f){var y=p(b,f),_=(y>>31)*2+1,S=y>>>23&255,Z=y&8388607;return S===255?Z?NaN:_*(1/0):S===0?_*1401298464324817e-60*Z:_*Math.pow(2,S-150)*(Z+8388608)}d.readFloatLE=m.bind(null,a),d.readFloatBE=m.bind(null,c)})(),typeof Float64Array<"u"?(function(){var u=new Float64Array([-0]),m=new Uint8Array(u.buffer),p=m[7]===128;function b(S,Z,R){u[0]=S,Z[R]=m[0],Z[R+1]=m[1],Z[R+2]=m[2],Z[R+3]=m[3],Z[R+4]=m[4],Z[R+5]=m[5],Z[R+6]=m[6],Z[R+7]=m[7]}function f(S,Z,R){u[0]=S,Z[R]=m[7],Z[R+1]=m[6],Z[R+2]=m[5],Z[R+3]=m[4],Z[R+4]=m[3],Z[R+5]=m[2],Z[R+6]=m[1],Z[R+7]=m[0]}d.writeDoubleLE=p?b:f,d.writeDoubleBE=p?f:b;function y(S,Z){return m[0]=S[Z],m[1]=S[Z+1],m[2]=S[Z+2],m[3]=S[Z+3],m[4]=S[Z+4],m[5]=S[Z+5],m[6]=S[Z+6],m[7]=S[Z+7],u[0]}function _(S,Z){return m[7]=S[Z],m[6]=S[Z+1],m[5]=S[Z+2],m[4]=S[Z+3],m[3]=S[Z+4],m[2]=S[Z+5],m[1]=S[Z+6],m[0]=S[Z+7],u[0]}d.readDoubleLE=p?y:_,d.readDoubleBE=p?_:y})():(function(){function u(p,b,f,y,_,S){var Z=y<0?1:0;if(Z&&(y=-y),y===0)p(0,_,S+b),p(1/y>0?0:2147483648,_,S+f);else if(isNaN(y))p(0,_,S+b),p(2146959360,_,S+f);else if(y>17976931348623157e292)p(0,_,S+b),p((Z<<31|2146435072)>>>0,_,S+f);else{var R;if(y<22250738585072014e-324)R=y/5e-324,p(R>>>0,_,S+b),p((Z<<31|R/4294967296)>>>0,_,S+f);else{var C=Math.floor(Math.log(y)/Math.LN2);C===1024&&(C=1023),R=y*Math.pow(2,-C),p(R*4503599627370496>>>0,_,S+b),p((Z<<31|C+1023<<20|R*1048576&1048575)>>>0,_,S+f)}}}d.writeDoubleLE=u.bind(null,r,0,4),d.writeDoubleBE=u.bind(null,s,4,0);function m(p,b,f,y,_){var S=p(y,_+b),Z=p(y,_+f),R=(Z>>31)*2+1,C=Z>>>20&2047,E=4294967296*(Z&1048575)+S;return C===2047?E?NaN:R*(1/0):C===0?R*5e-324*E:R*Math.pow(2,C-1075)*(E+4503599627370496)}d.readDoubleLE=m.bind(null,a,0,4),d.readDoubleBE=m.bind(null,c,4,0)})(),d}function r(d,u,m){u[m]=d&255,u[m+1]=d>>>8&255,u[m+2]=d>>>16&255,u[m+3]=d>>>24}function s(d,u,m){u[m]=d>>>24,u[m+1]=d>>>16&255,u[m+2]=d>>>8&255,u[m+3]=d&255}function a(d,u){return(d[u]|d[u+1]<<8|d[u+2]<<16|d[u+3]<<24)>>>0}function c(d,u){return(d[u]<<24|d[u+1]<<16|d[u+2]<<8|d[u+3])>>>0}},{}],11:[function(t,n,i){"use strict";n.exports=r;var o;function r(d,u){this.lo=d>>>0,this.hi=u>>>0}var s=r.zero=new r(0,0);s.toNumber=function(){return 0},s.zzEncode=s.zzDecode=function(){return this},s.length=function(){return 1};var a=r.zeroHash="\0\0\0\0\0\0\0\0";r.fromNumber=function(u){if(u===0)return s;var m=u<0;m&&(u=-u);var p=u>>>0,b=(u-p)/4294967296>>>0;return m&&(b=~b>>>0,p=~p>>>0,++p>4294967295&&(p=0,++b>4294967295&&(b=0))),new r(p,b)},r.from=function(u){if(typeof u=="number")return r.fromNumber(u);if(typeof u=="string"||u instanceof String)if(o)u=o.fromString(u);else return r.fromNumber(parseInt(u,10));return u.low||u.high?new r(u.low>>>0,u.high>>>0):s},r.prototype.toNumber=function(u){if(!u&&this.hi>>>31){var m=~this.lo+1>>>0,p=~this.hi>>>0;return m||(p=p+1>>>0),-(m+p*4294967296)}return this.lo+this.hi*4294967296},r.prototype.toLong=function(u){return o?new o(this.lo|0,this.hi|0,!!u):{low:this.lo|0,high:this.hi|0,unsigned:!!u}};var c=String.prototype.charCodeAt;r.fromHash=function(u){return u===a?s:new r((c.call(u,0)|c.call(u,1)<<8|c.call(u,2)<<16|c.call(u,3)<<24)>>>0,(c.call(u,4)|c.call(u,5)<<8|c.call(u,6)<<16|c.call(u,7)<<24)>>>0)},r.prototype.toHash=function(){return String.fromCharCode(this.lo&255,this.lo>>>8&255,this.lo>>>16&255,this.lo>>>24,this.hi&255,this.hi>>>8&255,this.hi>>>16&255,this.hi>>>24)},r.prototype.zzEncode=function(){var u=this.hi>>31;return this.hi=((this.hi<<1|this.lo>>>31)^u)>>>0,this.lo=(this.lo<<1^u)>>>0,this},r.prototype.zzDecode=function(){var u=-(this.lo&1);return this.lo=((this.lo>>>1|this.hi<<31)^u)>>>0,this.hi=(this.hi>>>1^u)>>>0,this},r.prototype.length=function(){var u=this.lo,m=(this.lo>>>28|this.hi<<4)>>>0,p=this.hi>>>24;return p===0?m===0?u<16384?u<128?1:2:u<2097152?3:4:m<16384?m<128?5:6:m<2097152?7:8:p<128?9:10},r._configure=function(d){o=d}},{}],12:[function(t,n,i){"use strict";var o=i;o.asPromise=t(7),o.base64=t(8),o.EventEmitter=t(9),o.float=t(10),o.utf8=t(14),o.pool=t(13),o.LongBits=t(11);function r(c){return c==="__proto__"||c==="prototype"||c==="constructor"}o.isUnsafeProperty=r,o.isNode=!!(typeof global<"u"&&global&&global.process&&global.process.versions&&global.process.versions.node),o.global=o.isNode&&global||typeof window<"u"&&window||typeof self<"u"&&self||typeof globalThis<"u"&&globalThis||this,o.emptyArray=Object.freeze?Object.freeze([]):[],o.emptyObject=Object.freeze?Object.freeze({}):{},o.isInteger=Number.isInteger||function(d){return typeof d=="number"&&isFinite(d)&&Math.floor(d)===d},o.isString=function(d){return typeof d=="string"||d instanceof String},o.isObject=function(d){return d&&typeof d=="object"},o.isset=o.isSet=function(d,u){var m=d[u];return m!=null&&Object.hasOwnProperty.call(d,u)?typeof m!="object"||(Array.isArray(m)?m.length:Object.keys(m).length)>0:!1},o.Buffer=(function(){try{var c=o.global.Buffer;return c.prototype.utf8Write||o.isNode?c:null}catch{return null}})(),o.newBuffer=function(d){var u=o.Buffer;return typeof d=="number"?u?u.allocUnsafe(d):new Uint8Array(d):u?u.from(d):new Uint8Array(d)},o.rawField=function(d,u,m){var p=[],b=d<<3|u;for(b>>>=0;b>127;)p.push(b&127|128),b>>>=7;p.push(b);for(var f=0;f-1;--b)if(u[p[b]]===1&&this[p[b]]!==e&&this[p[b]]!==null)return p[b]}},o.oneOfSetter=function(d){return function(u){for(var m=0;m>>1,u=null,m=c;return function(b){if(b<1||b>d)return r(b);m+b>c&&(u=r(c),m=0);var f=s.call(u,m,m+=b);return m&7&&(m=(m|7)+1),f}}},{}],14:[function(t,n,i){"use strict";var o=i,r=new TextDecoder("utf-8",{ignoreBOM:!0}),s,a=64;try{s=new TextDecoder("utf-8",{fatal:!0,ignoreBOM:!0})}catch{s=r}o.length=function(u){for(var m=0,p=0,b=0;b=a)return c(r,u,m,p);for(var b="",f=m,y,_,S,Z,R,C,E,A;f+7=a)return c(s,u,m,p);for(var b="",f=m,y,_,S,Z,R,C,E,A;f+7>6|192,m[p++]=f&63|128):(f&64512)===55296&&((y=u.charCodeAt(_+1))&64512)===56320?(f=65536+((f&1023)<<10)+(y&1023),++_,m[p++]=f>>18|240,m[p++]=f>>12&63|128,m[p++]=f>>6&63|128,m[p++]=f&63|128):(m[p++]=f>>12|224,m[p++]=f>>6&63|128,m[p++]=f&63|128);return p-b}},{}],15:[function(t,n,i){"use strict";n.exports=d;var o=t(12),r,s=o.LongBits,a=o.base64,c=o.utf8;function d(){this.pos=0,this.buf=this.constructor.alloc(d.initialBufferSize),this.view=null,this.states=null}d.initialBufferSize=128,Object.defineProperty(d.prototype,"len",{configurable:!0,enumerable:!0,get:function(){return this.pos}});var u=function(){return o.Buffer?function(){return(d.create=function(){return new r})()}:function(){return new d}};d.create=u(),d.alloc=function(C){return new Uint8Array(C)},d.alloc=o.pool(d.alloc,Uint8Array.prototype.subarray);function m(R){return R<128?1:R<16384?2:R<2097152?3:R<268435456?4:5}d.prototype._reserve=function(C){var E=this.pos+C;if(E>this.buf.length){var A=this.buf.length<<1;A127;)C[E++]=R&127|128,R>>>=7;return C[E]=R,E+1}d.prototype.uint32=function(C){C=C>>>0,this._reserve(5);var E=this.pos;return this.pos=b(C,this.buf,E),this},d.prototype.int32=function(C){return(C|=0)<0?(this._reserve(10),f(s.fromNumber(C),this.buf,this.pos),this.pos+=10,this):this.uint32(C)},d.prototype.sint32=function(C){return this.uint32((C<<1^C>>31)>>>0)};function f(R,C,E){for(var A=R.lo,L=R.hi;L;)C[E++]=A&127|128,A=(A>>>7|L<<25)>>>0,L>>>=7;for(;A>127;)C[E++]=A&127|128,A=A>>>7;return C[E]=A,E+1}d.prototype.uint64=function(C){var E=s.from(C);this._reserve(10);var A=this.pos;return this.pos=f(E,this.buf,A),this},d.prototype.int64=d.prototype.uint64,d.prototype.sint64=function(C){var E=s.from(C).zzEncode();this._reserve(10);var A=this.pos;return this.pos=f(E,this.buf,A),this},d.prototype.bool=function(C){return this._reserve(1),this.buf[this.pos++]=C?1:0,this};function y(R,C,E){C[E]=R&255,C[E+1]=R>>>8&255,C[E+2]=R>>>16&255,C[E+3]=R>>>24}d.prototype.fixed32=function(C){return this._reserve(4),y(C>>>0,this.buf,this.pos),this.pos+=4,this},d.prototype.sfixed32=d.prototype.fixed32,d.prototype.fixed64=function(C){var E=s.from(C);return this._reserve(8),y(E.lo,this.buf,this.pos),y(E.hi,this.buf,this.pos+4),this.pos+=8,this},d.prototype.sfixed64=d.prototype.fixed64,d.prototype.float=function(C){return this._reserve(4),o.float.writeFloatLE(C,this.buf,this.pos),this.pos+=4,this},d.prototype.double=function(C){return this._reserve(8),o.float.writeDoubleLE(C,this.buf,this.pos),this.pos+=8,this},d.prototype.bytes=function(C){var E=C.length>>>0;if(!E)return this._reserve(1),this.buf[this.pos++]=0,this;if(o.isString(C)){var A=d.alloc(E=a.length(C));a.decode(C,A,0),C=A}return this.uint32(E),this._reserve(E),this.buf.set(C,this.pos),this.pos+=E,this},d.prototype.raw=function(C){var E=C.length>>>0;return E?(this._reserve(E),this.buf.set(C,this.pos),this.pos+=E,this):this},d.prototype._delim=function(C,E){var A=m(E);return A>1&&this.buf.copyWithin(C+A,C+1,C+1+E),b(E,this.buf,C),this.pos=C+A+E,this},d.prototype.string=function(C){var E=C.length;if(!E)return this._reserve(1),this.buf[this.pos++]=0,this;if(E<128){this._reserve(E*3+5);var A=this.pos;return this._delim(A,c.write(C,this.buf,A+1))}var L=c.length(C);return this.uint32(L),this._reserve(L),L===C.length?p(C,this.buf,this.pos):c.write(C,this.buf,this.pos),this.pos+=L,this},d.prototype.uint32s=function(C){var E=C.length;this._reserve(E*5+5);for(var A=this.buf,L=this.pos,F=L+1,I=0;I>>0,A,F);return this._delim(L,F-L-1)},d.prototype.int32s=function(C){var E=C.length;this._reserve(E*10+5);for(var A=this.buf,L=this.pos,F=L+1,I,N=0;N>31)>>>0,A,F);return this._delim(L,F-L-1)},d.prototype.uint64s=function(C){var E=C.length;this._reserve(E*10+5);for(var A=this.buf,L=this.pos,F=L+1,I=0;I>>0,!0),L+=4;else{var N=this.buf;for(F=0;F>>0,N,L),L+=4}return this.pos+=A,this},d.prototype.sfixed32s=d.prototype.fixed32s,d.prototype.fixed64s=function(C){var E=C.length,A=E*8;this.uint32(A),this._reserve(A);var L=this.pos,F,I,N=Z(this,E,S);if(N)for(F=0;F1?(this._reserve(A-1),this.buf.copyWithin(L+A,L+1,L+1+E),this.pos+=A-1,b(E,this.buf,L)):this.buf[L]=E}else E=this.pos,A=m(E),this._reserve(A),this.buf.copyWithin(A,0,E),b(E,this.buf,0),this.pos+=A;return this},d.prototype.finish=function(C){if(C)return this.buf.subarray(0,this.pos);var E=this.constructor.alloc(this.pos);return E.set(this.buf.subarray(0,this.pos),0),E},d.prototype.finishInto=function(C,E){return E===e&&(E=0),C.set(this.buf.subarray(0,this.pos),E),C},d._configure=function(R){r=R,d.create=u(),r._configure()}},{12:12}],16:[function(t,n,i){"use strict";n.exports=s;var o=t(15);s.prototype=Object.create(o.prototype,{constructor:{value:s,writable:!0,enumerable:!1,configurable:!0}});var r=t(12);function s(){o.call(this)}var a;s._configure=function(){s.alloc=r.Buffer&&r.Buffer.allocUnsafe,a=r.Buffer&&r.Buffer.prototype.utf8Write?function(d,u,m){return u.utf8Write(d,m)}:function(d,u,m){return u.write(d,m)}},s.prototype.bytes=function(d){r.isString(d)&&(d=r.Buffer.from(d,"base64"));var u=d.length>>>0;return this.uint32(u),u&&(this._reserve(u),this.buf.set(d,this.pos),this.pos+=u),this},s.prototype.string=function(d){var u=d.length;if(!u)return this._reserve(1),this.buf[this.pos++]=0,this;if(u<128){this._reserve(u*3+5);var m=this.pos,p=this.buf;return this._delim(m,u<40?r.utf8.write(d,p,m+1):a(d,p,m+1))}var b=r.Buffer.byteLength(d);return this.uint32(b),this._reserve(b),a(d,this.buf,this.pos),this.pos+=b,this},s._configure()},{12:12,15:15}]},{},[1])})()});var WNe=bm((Rko,EJ)=>{var Cko=x(T());/* Copyright 2015-2018 Esri. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 @preserve */(function(){var e=(function(){var o={};o.defaultNoDataValue=-34027999387901484e22,o.decode=function(u,m){m=m||{};var p=m.encodedMaskData||m.encodedMaskData===null,b=c(u,m.inputOffset||0,p),f=m.noDataValue!==null?m.noDataValue:o.defaultNoDataValue,y=r(b,m.pixelType||Float32Array,m.encodedMaskData,f,m.returnMask),_={width:b.width,height:b.height,pixelData:y.resultPixels,minValue:y.minValue,maxValue:b.pixels.maxValue,noDataValue:f};return y.resultMask&&(_.maskData=y.resultMask),m.returnEncodedMask&&b.mask&&(_.encodedMaskData=b.mask.bitset?b.mask.bitset:null),m.returnFileInfo&&(_.fileInfo=s(b),m.computeUsedBitDepths&&(_.fileInfo.bitDepths=a(b))),_};var r=function(u,m,p,b,f){var y=0,_=u.pixels.numBlocksX,S=u.pixels.numBlocksY,Z=Math.floor(u.width/_),R=Math.floor(u.height/S),C=2*u.maxZError,E=Number.MAX_VALUE,A;p=p||(u.mask?u.mask.bitset:null);var L,F;L=new m(u.width*u.height),f&&p&&(F=new Uint8Array(u.width*u.height));for(var I=new Float32Array(Z*R),N,g,V=0;V<=S;V++){var G=V!==S?R:u.height%S;if(G!==0)for(var v=0;v<=_;v++){var X=v!==_?Z:u.width%_;if(X!==0){var Y=V*u.width*R+v*Z,D=u.width-X,M=u.pixels.blocks[y],O,w,z;M.encoding<2?(M.encoding===0?O=M.rawData:(d(M.stuffedData,M.bitsPerPixel,M.numValidPixels,M.offset,C,I,u.pixels.maxValue),O=I),w=0):M.encoding===2?z=0:z=M.offset;var K;if(p)for(g=0;g>3],K<<=Y&7),N=0;N>3]),K&128?(F&&(F[Y]=1),A=M.encoding<2?O[w++]:z,E=E>A?A:E,L[Y++]=A):(F&&(F[Y]=0),L[Y++]=b),K<<=1;Y+=D}else if(M.encoding<2)for(g=0;gA?A:E,L[Y++]=A;Y+=D}else for(E=E>z?z:E,g=0;g0){var _=new Uint8Array(Math.ceil(b.width*b.height/8));y=new DataView(u,m,b.mask.numBytes);var S=y.getInt16(0,!0),Z=2,R=0;do{if(S>0)for(;S--;)_[R++]=y.getUint8(Z++);else{var C=y.getUint8(Z++);for(S=-S;S--;)_[R++]=C}S=y.getInt16(Z,!0),Z+=2}while(Z0?1:0),F=A+(b.height%A>0?1:0);b.pixels.blocks=new Array(L*F);for(var I=0,N=0;N3)throw"Invalid block encoding ("+v.encoding+")";if(v.encoding===2){m++;continue}if(X!==0&&X!==2){if(X>>=6,v.offsetType=X,X===2)v.offset=y.getInt8(1),V++;else if(X===1)v.offset=y.getInt16(1,!0),V+=2;else if(X===0)v.offset=y.getFloat32(1,!0),V+=4;else throw"Invalid block offset type";if(v.encoding===1)if(X=y.getUint8(V),V++,v.bitsPerPixel=X&63,X>>=6,v.numValidPixelsType=X,X===2)v.numValidPixels=y.getUint8(V),V++;else if(X===1)v.numValidPixels=y.getUint16(V,!0),V+=2;else if(X===0)v.numValidPixels=y.getUint32(V,!0),V+=4;else throw"Invalid valid pixel count type"}if(m+=V,v.encoding!==3){var Y,D;if(v.encoding===0){var M=(b.pixels.numBytes-1)/4;if(M!==Math.floor(M))throw"uncompressed block has invalid length";Y=new ArrayBuffer(M*4),D=new Uint8Array(Y),D.set(new Uint8Array(u,m,M*4));var O=new Float32Array(Y);v.rawData=O,m+=M*4}else if(v.encoding===1){var w=Math.ceil(v.numValidPixels*v.bitsPerPixel/8),z=Math.ceil(w/4);Y=new ArrayBuffer(z*4),D=new Uint8Array(Y),D.set(new Uint8Array(u,m,w)),v.stuffedData=new Uint32Array(Y),m+=w}}}return b.eofOffset=m,b},d=function(u,m,p,b,f,y,_){var S=(1<=m)E=A>>>C-m&S,C-=m;else{var I=m-C;E=(A&S)<>>C}y[R]=E=u?(C=E>>>R-u&_,R-=u):(A=u-R,C=(E&_)<>>R),d[Z]=p[C];else for(L=Math.ceil((y-b)/f),Z=0;Z=u?(C=E>>>R-u&_,R-=u):(A=u-R,C=(E&_)<>>R),d[Z]=C=d?(R=C>>>Z-d&f,Z-=d):(S=d-Z,R=(C&f)<>>Z),E[_]=R=u?(E=A>>>C&_,R-=u,C+=u):(L=u-R,E=A>>>C&_,A=c[S++],R=32-L,E|=(A&(1<=u?(E=A>>>C&_,R-=u,C+=u):(L=u-R,E=A>>>C&_,A=c[S++],R=32-L,E|=(A&(1<=d?(R=E>>>C&f,Z-=d,C+=d):(S=d-Z,R=E>>>C&f,E=c[y++],Z=32-S,R|=(E&(1<=u?(_=S>>>y-u&p,y-=u):(Z=u-y,_=(S&p)<>>y),d[f]=_;return d},originalUnstuff2:function(c,d,u,m){var p=(1<=u?(S=Z>>>_&p,y-=u,_+=u):(R=u-y,S=Z>>>_&p,Z=c[b++],y=32-R,S|=(Z&(1<=359?359:p;p-=f;do d+=c[b++]<<8,u+=d+=c[b++];while(--f);d=(d&65535)+(d>>>16),u=(u&65535)+(u>>>16)}return m&1&&(u+=d+=c[b]<<8),d=(d&65535)+(d>>>16),u=(u&65535)+(u>>>16),(u<<16|d)>>>0},readHeaderInfo:function(c,d){var u=d.ptr,m=new Uint8Array(c,u,6),p={};if(p.fileIdentifierString=String.fromCharCode.apply(null,m),p.fileIdentifierString.lastIndexOf("Lerc2",0)!==0)throw"Unexpected file identifier string (expect Lerc2 ): "+p.fileIdentifierString;u+=6;var b=new DataView(c,u,8),f=b.getInt32(0,!0);p.fileVersion=f,u+=4,f>=3&&(p.checksum=b.getUint32(4,!0),u+=4),b=new DataView(c,u,12),p.height=b.getUint32(0,!0),p.width=b.getUint32(4,!0),u+=8,f>=4?(p.numDims=b.getUint32(8,!0),u+=4):p.numDims=1,b=new DataView(c,u,40),p.numValidPixel=b.getUint32(0,!0),p.microBlockSize=b.getInt32(4,!0),p.blobSize=b.getInt32(8,!0),p.imageType=b.getInt32(12,!0),p.maxZError=b.getFloat64(16,!0),p.zMin=b.getFloat64(24,!0),p.zMax=b.getFloat64(32,!0),u+=40,d.headerInfo=p,d.ptr=u;var y,_;if(f>=3&&(_=f>=4?52:48,y=this.computeChecksumFletcher32(new Uint8Array(c,u-_,p.blobSize-14)),y!==p.checksum))throw"Checksum failed.";return!0},checkMinMaxRanges:function(c,d){var u=d.headerInfo,m=this.getDataTypeArray(u.imageType),p=u.numDims*this.getDataTypeSize(u.imageType),b=this.readSubArray(c,d.ptr,m,p),f=this.readSubArray(c,d.ptr+p,m,p);d.ptr+=2*p;var y,_=!0;for(y=0;y0){_=new Uint8Array(Math.ceil(p/8)),f=new DataView(c,u,y.numBytes);var Z=f.getInt16(0,!0),R=2,C=0,E=0;do{if(Z>0)for(;Z--;)_[C++]=f.getUint8(R++);else for(E=f.getUint8(R++),Z=-Z;Z--;)_[C++]=E;Z=f.getInt16(R,!0),R+=2}while(R>3],A<<=L&7):A=_[L>>3],A&128&&(S[L]=1);d.pixels.resultMask=S,y.bitset=_,u+=y.numBytes}return d.ptr=u,d.mask=y,!0},readDataOneSweep:function(c,d,u){var m=d.ptr,p=d.headerInfo,b=p.numDims,f=p.width*p.height,y=p.imageType,_=p.numValidPixel*r.getDataTypeSize(y)*b,S,Z=d.pixels.resultMask;if(u===Uint8Array)S=new Uint8Array(c,m,_);else{var R=new ArrayBuffer(_),C=new Uint8Array(R);C.set(new Uint8Array(c,m,_)),S=new u(R)}if(S.length===f*b)d.pixels.resultPixels=S;else{d.pixels.resultPixels=new u(f*b);var E=0,A=0,L=0,F=0;if(b>1)for(L=0;L=y)return!1;var _=new Uint32Array(y-f);r.decodeBits(c,d,_);var S=[],Z,R,C,E;for(Z=f;Z0&&(S[R].second=V<>>32-E,32-g>=E?(g+=E,g===32&&(g=0,G++,V=N[G])):(g+=E-32,G++,V=N[G],S[R].second|=V>>>32-g));var v=0,X=0,Y=new s;for(Z=0;Z=u?X=u:X=v,v>=30&&console.log("WARning, large NUM LUT BITS IS "+v);var D=[],M,O,w,z,K,te;for(Z=f;Z0)if(M=[E,R],E<=X)for(O=S[R].second<=0;z--)K=O>>>z&1,K?(te.right||(te.right=new s),te=te.right):(te.left||(te.left=new s),te=te.left),z===0&&!te.val&&(te.val=M[1]);return{decodeLut:D,numBitsLUTQick:X,numBitsLUT:v,tree:Y,stuffedData:N,srcPtr:G,bitPos:g}},readHuffman:function(c,d,u){var m=d.headerInfo,p=m.numDims,b=d.headerInfo.height,f=d.headerInfo.width,y=f*b,_=this.readHuffmanTree(c,d),S=_.decodeLut,Z=_.tree,R=_.stuffedData,C=_.srcPtr,E=_.bitPos,A=_.numBitsLUTQick,L=_.numBitsLUT,F=d.headerInfo.imageType===0?128:0,I,N,g,V=d.pixels.resultMask,G,v,X,Y,D,M,O,w=0;E>0&&(C++,E=0);var z=R[C],K=d.encodeMode===1,te=new u(y*p),H=te,$;for($=0;$1&&(H=new u(te.buffer,y*$,y),w=0),d.headerInfo.numValidPixel===f*b)for(M=0,Y=0;Y>>32-A,v=G,32-E>>64-E-A,v=G),S[v])N=S[v][1],E+=S[v][0];else for(G=z<>>32-L,v=G,32-E>>64-E-L,v=G),I=Z,O=0;O>>L-O-1&1,I=X?I.right:I.left,!(I.left||I.right)){N=I.val,E=E+O+1;break}E>=32&&(E-=32,C++,z=R[C]),g=N-F,K?(D>0?g+=w:Y>0?g+=H[M-f]:g+=w,g&=255,H[M]=g,w=g):H[M]=g}else for(M=0,Y=0;Y>>32-A,v=G,32-E>>64-E-A,v=G),S[v])N=S[v][1],E+=S[v][0];else for(G=z<>>32-L,v=G,32-E>>64-E-L,v=G),I=Z,O=0;O>>L-O-1&1,I=X?I.right:I.left,!(I.left||I.right)){N=I.val,E=E+O+1;break}E>=32&&(E-=32,C++,z=R[C]),g=N-F,K?(D>0&&V[M-1]?g+=w:Y>0&&V[M-f]?g+=H[M-f]:g+=w,g&=255,H[M]=g,w=g):H[M]=g}d.ptr=d.ptr+(C+1)*4+(E>0?4:0)}d.pixels.resultPixels=te},decodeBits:function(c,d,u,m,p){{var b=d.headerInfo,f=b.fileVersion,y=0,_=new DataView(c,d.ptr,5),S=_.getUint8(0);y++;var Z=S>>6,R=Z===0?4:3-Z,C=(S&32)>0,E=S&31,A=0;if(R===1)A=_.getUint8(y),y++;else if(R===2)A=_.getUint16(y,!0),y+=2;else if(R===4)A=_.getUint32(y,!0),y+=4;else throw"Invalid valid pixel count type";var L=2*b.maxZError,F,I,N,g,V,G,v,X,Y,D,M=b.numDims>1?b.maxValues[p]:b.zMax;if(C){for(d.counter.lut++,X=_.getUint8(y),Y=E,y++,g=Math.ceil((X-1)*E/8),V=Math.ceil(g/4),I=new ArrayBuffer(V*4),N=new Uint8Array(I),d.ptr+=y,N.set(new Uint8Array(c,d.ptr,g)),v=new Uint32Array(I),d.ptr+=g,D=0;X-1>>>D;)D++;g=Math.ceil(A*D/8),V=Math.ceil(g/4),I=new ArrayBuffer(V*4),N=new Uint8Array(I),N.set(new Uint8Array(c,d.ptr,g)),F=new Uint32Array(I),d.ptr+=g,f>=3?G=o.unstuffLUT2(v,E,X-1,m,L,M):G=o.unstuffLUT(v,E,X-1,m,L,M),f>=3?o.unstuff2(F,u,D,A,G):o.unstuff(F,u,D,A,G)}else d.counter.bitstuffer++,D=E,d.ptr+=y,D>0&&(g=Math.ceil(A*D/8),V=Math.ceil(g/4),I=new ArrayBuffer(V*4),N=new Uint8Array(I),N.set(new Uint8Array(c,d.ptr,g)),F=new Uint32Array(I),d.ptr+=g,f>=3?m==null?o.originalUnstuff2(F,u,D,A):o.unstuff2(F,u,D,A,!1,m,L,M):m==null?o.originalUnstuff(F,u,D,A):o.unstuff(F,u,D,A,!1,m,L,M))}},readTiles:function(c,d,u){var m=d.headerInfo,p=m.width,b=m.height,f=m.microBlockSize,y=m.imageType,_=r.getDataTypeSize(y),S=Math.ceil(p/f),Z=Math.ceil(b/f);d.pixels.numBlocksY=Z,d.pixels.numBlocksX=S,d.pixels.ptr=0;var R=0,C=0,E=0,A=0,L=0,F=0,I=0,N=0,g=0,V=0,G=0,v=0,X=0,Y=0,D=0,M=0,O,w,z,K,te,H,$=new u(f*f),ee=b%f||f,le=p%f||f,_e,he,Ze=m.numDims,ye,Ge=d.pixels.resultMask,Ae=d.pixels.resultPixels;for(E=0;E1&&(Ae=new u(d.pixels.resultPixels.buffer,p*b*ye*_,p*b)),I=c.byteLength-d.ptr,O=new DataView(c,d.ptr,Math.min(10,I)),w={},M=0,N=O.getUint8(0),M++,g=N>>6&255,V=N>>2&15,V!==(A*f>>3&15))throw"integrity issue";if(H=N&3,H>3)throw d.ptr+=M,"Invalid block encoding ("+H+")";if(H===2){d.counter.constant++,d.ptr+=M;continue}else if(H===0){if(d.counter.uncompressed++,d.ptr+=M,X=L*F*_,Y=c.byteLength-d.ptr,X=X1)for(b=0;b=-128&&d<=127;break;case 1:u=d>=0&&d<=255;break;case 2:u=d>=-32768&&d<=32767;break;case 3:u=d>=0&&d<=65536;break;case 4:u=d>=-2147483648&&d<=2147483647;break;case 5:u=d>=0&&d<=4294967296;break;case 6:u=d>=-34027999387901484e22&&d<=34027999387901484e22;break;case 7:u=d>=5e-324&&d<=17976931348623157e292;break;default:u=!1}return u},getDataTypeSize:function(c){var d=0;switch(c){case 0:case 1:d=1;break;case 2:case 3:d=2;break;case 4:case 5:case 6:d=4;break;case 7:d=8;break;default:d=c}return d},getDataTypeUsed:function(c,d){var u=c;switch(c){case 2:case 4:u=c-d;break;case 3:case 5:u=c-2*d;break;case 6:d===0?u=c:d===1?u=2:u=1;break;case 7:d===0?u=c:u=c-2*d+1;break;default:u=c;break}return u},getOnePixel:function(c,d,u,m){var p=0;switch(u){case 0:p=m.getInt8(d);break;case 1:p=m.getUint8(d);break;case 2:p=m.getInt16(d,!0);break;case 3:p=m.getUint16(d,!0);break;case 4:p=m.getInt32(d,!0);break;case 5:p=m.getUInt32(d,!0);break;case 6:p=m.getFloat32(d,!0);break;case 7:p=m.getFloat64(d,!0);break;default:throw"the decoder does not understand this pixel type"}return p}},s=function(c,d,u){this.val=c,this.left=d,this.right=u},a={decode:function(c,d){d=d||{};var u=d.noDataValue,m=0,p={};if(p.ptr=d.inputOffset||0,p.pixels={},!!r.readHeaderInfo(c,p)){var b=p.headerInfo,f=b.fileVersion,y=r.getDataTypeArray(b.imageType);r.readMask(c,p),b.numValidPixel!==b.width*b.height&&!p.pixels.resultMask&&(p.pixels.resultMask=d.maskData);var _=b.width*b.height;if(p.pixels.resultPixels=new y(_*b.numDims),p.counter={onesweep:0,uncompressed:0,lut:0,bitstuffer:0,constant:0,constantoffset:0},b.numValidPixel!==0)if(b.zMax===b.zMin)r.constructConstantSurface(p);else if(f>=4&&r.checkMinMaxRanges(c,p))r.constructConstantSurface(p);else{var S=new DataView(c,p.ptr,2),Z=S.getUint8(0);if(p.ptr++,Z)r.readDataOneSweep(c,p,y);else if(f>1&&b.imageType<=1&&Math.abs(b.maxZError-.5)<1e-5){var R=S.getUint8(1);if(p.ptr++,p.encodeMode=R,R>2||f<4&&R>1)throw"Invalid Huffman flag "+R;R?r.readHuffman(c,p,y):r.readTiles(c,p,y)}else r.readTiles(c,p,y)}p.eofOffset=p.ptr;var C;d.inputOffset?(C=p.headerInfo.blobSize+d.inputOffset-p.ptr,Math.abs(C)>=1&&(p.eofOffset=d.inputOffset+p.headerInfo.blobSize)):(C=p.headerInfo.blobSize-p.ptr,Math.abs(C)>=1&&(p.eofOffset=p.headerInfo.blobSize));var E={width:b.width,height:b.height,pixelData:p.pixels.resultPixels,minValue:b.zMin,maxValue:b.zMax,validPixelCount:b.numValidPixel,dimCount:b.numDims,dimStats:{minValues:b.minValues,maxValues:b.maxValues},maskData:p.pixels.resultMask};if(p.pixels.resultMask&&r.isValidPixelValue(b.imageType,u)){var A=p.pixels.resultMask;for(m=0;m<_;m++)A[m]||(E.pixelData[m]=u);E.noDataValue=u}return p.noDataValue=u,d.returnFileInfo&&(E.fileInfo=r.formatFileInfo(p)),E}},getBandCount:function(c){var d=0,u=0,m={};for(m.ptr=0,m.pixels={};u1&&Z.fileInfo.mask&&Z.fileInfo.mask.numBytes>0&&f.push(Z.maskData),m++,S.pixels.push(Z.pixelData),S.statistics.push({minValue:Z.minValue,maxValue:Z.maxValue,noDataValue:Z.noDataValue,dimStats:Z.dimStats})}var R,C,E;if(u>1&&f.length>1){for(E=S.width*S.height,S.bandMasks=f,_=new Uint8Array(E),_.set(f[0]),R=1;R{var Efr=x(T());EYe.exports={webm:"data:video/webm;base64,GkXfowEAAAAAAAAfQoaBAUL3gQFC8oEEQvOBCEKChHdlYm1Ch4EEQoWBAhhTgGcBAAAAAAAVkhFNm3RALE27i1OrhBVJqWZTrIHfTbuMU6uEFlSua1OsggEwTbuMU6uEHFO7a1OsghV17AEAAAAAAACkAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA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k4wqi7DRhAsPQKEhKwKAKAAAwBimFFPKMCYhpBAaxiSEFEImJaXSUqogpFJSKRWEVEoqJaOUUmopVRBSKamUCkIqJZVSAADYgQMA2IGFUGjISgAgDwCAMEYpxhhzTiKkFGPOOScRUoox55yTSjHmnHPOSSkZc8w556SUzjnnnHNSSuacc845KaVzzjnnnJRSSuecc05KKSWEzkEnpZTSOeecEwAAVOAAABBgo8jmBCNBhYasBABSAQAMjmNZmuZ5omialiRpmud5niiapiZJmuZ5nieKqsnzPE8URdE0VZXneZ4oiqJpqirXFUXTNE1VVV2yLIqmaZqq6rowTdNUVdd1XZimaaqq67oubFtVVdV1ZRm2raqq6rqyDFzXdWXZloEsu67s2rIAAPAEBwCgAhtWRzgpGgssNGQlAJABAEAYg5BCCCFlEEIKIYSUUggJAAAYcAAACDChDBQashIASAUAAIyx1lprrbXWQGettdZaa62AzFprrbXWWmuttdZaa6211lJrrbXWWmuttdZaa6211lprrbXWWmuttdZaa6211lprrbXWWmuttdZaa6211lprrbXWWmstpZRSSimllFJKKaWUUkoppZRSSgUA+lU4APg/2LA6wknRWGChISsBgHAAAMAYpRhzDEIppVQIMeacdFRai7FCiDHnJKTUWmzFc85BKCGV1mIsnnMOQikpxVZjUSmEUlJKLbZYi0qho5JSSq3VWIwxqaTWWoutxmKMSSm01FqLMRYjbE2ptdhqq7EYY2sqLbQYY4zFCF9kbC2m2moNxggjWywt1VprMMYY3VuLpbaaizE++NpSLDHWXAAAd4MDAESCjTOsJJ0VjgYXGrISAAgJACAQUooxxhhzzjnnpFKMOeaccw5CCKFUijHGnHMOQgghlIwx5pxzEEIIIYRSSsaccxBCCCGEkFLqnHMQQgghhBBKKZ1zDkIIIYQQQimlgxBCCCGEEEoopaQUQgghhBBCCKmklEIIIYRSQighlZRSCCGEEEIpJaSUUgohhFJCCKGElFJKKYUQQgillJJSSimlEkoJJYQSUikppRRKCCGUUkpKKaVUSgmhhBJKKSWllFJKIYQQSikFAAAcOAAABBhBJxlVFmGjCRc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AAACQAAAAkAAACMc3RjbwAAAAAAAAAfAAAALAAAA1UAAANyAAADhgAAA6IAAAO+AAAD0QAAA+0AAAQAAAAEHAAABC8AAARLAAAEZwAABHoAAASWAAAEqQAABMUAAATYAAAE9AAABRAAAAUjAAAFPwAABVIAAAVuAAAFgQAABZ0AAAWwAAAFzAAABegAAAX7AAAGFwAAAGJ1ZHRhAAAAWm1ldGEAAAAAAAAAIWhkbHIAAAAAAAAAAG1kaXJhcHBsAAAAAAAAAAAAAAAALWlsc3QAAAAlqXRvbwAAAB1kYXRhAAAAAQAAAABMYXZmNTUuMzMuMTAw"}});var LYe=bm((Afr,GYe)=>{var Gfr=x(T()),{webm:e3t,mp4:t3t}=AYe(),hle=()=>typeof navigator<"u"&&parseFloat((""+(/CPU.*OS ([0-9_]{3,4})[0-9_]{0,1}|(CPU like).*AppleWebKit.*Mobile/i.exec(navigator.userAgent)||[0,""])[1]).replace("undefined","3_2").replace("_",".").replace("_",""))<10&&!window.MSStream,fle=()=>"wakeLock"in navigator,ple=class{constructor(){if(this.enabled=!1,fle()){this._wakeLock=null;let t=()=>{this._wakeLock!==null&&document.visibilityState==="visible"&&this.enable()};document.addEventListener("visibilitychange",t),document.addEventListener("fullscreenchange",t)}else hle()?this.noSleepTimer=null:(this.noSleepVideo=document.createElement("video"),this.noSleepVideo.setAttribute("title","No Sleep"),this.noSleepVideo.setAttribute("playsinline",""),this._addSourceToVideo(this.noSleepVideo,"webm",e3t),this._addSourceToVideo(this.noSleepVideo,"mp4",t3t),this.noSleepVideo.addEventListener("loadedmetadata",()=>{this.noSleepVideo.duration<=1?this.noSleepVideo.setAttribute("loop",""):this.noSleepVideo.addEventListener("timeupdate",()=>{this.noSleepVideo.currentTime>.5&&(this.noSleepVideo.currentTime=Math.random())})}))}_addSourceToVideo(t,n,i){var o=document.createElement("source");o.src=i,o.type=`video/${n}`,t.appendChild(o)}get isEnabled(){return this.enabled}enable(){return fle()?navigator.wakeLock.request("screen").then(t=>{this._wakeLock=t,this.enabled=!0,console.log("Wake Lock active."),this._wakeLock.addEventListener("release",()=>{console.log("Wake Lock released.")})}).catch(t=>{throw this.enabled=!1,console.error(`${t.name}, ${t.message}`),t}):hle()?(this.disable(),console.warn(` NoSleep enabled for older iOS devices. This can interrupt active or long-running network requests from completing successfully. See https://github.com/richtr/NoSleep.js/issues/15 for more details. `),this.noSleepTimer=window.setInterval(()=>{document.hidden||(window.location.href=window.location.href.split("#")[0],window.setTimeout(window.stop,0))},15e3),this.enabled=!0,Promise.resolve()):this.noSleepVideo.play().then(n=>(this.enabled=!0,n)).catch(n=>{throw this.enabled=!1,n})}disable(){fle()?(this._wakeLock&&this._wakeLock.release(),this._wakeLock=null):hle()?this.noSleepTimer&&(console.warn(` NoSleep now disabled for older iOS devices. - `),window.clearInterval(this.noSleepTimer),this.noSleepTimer=null):this.noSleepVideo.pause(),this.enabled=!1}};AYe.exports=ple});var R3t={};Cle(R3t,{AlphaMode:()=>Mp,AlphaPipelineStage:()=>EP,AnchorPointDirect:()=>EI,AnchorPointIndirect:()=>AI,Animation:()=>h5,AnimationViewModel:()=>f5,Appearance:()=>Go,ApproximateTerrainHeights:()=>Pi,ArcGISTiledElevationTerrainProvider:()=>Cse,ArcGisBaseMapType:()=>hf,ArcGisMapServerImageryProvider:()=>Jb,ArcGisMapService:()=>Fu,ArcType:()=>un,ArticulationStageType:()=>cl,AssociativeArray:()=>kt,Atmosphere:()=>lS,AtmospherePipelineStage:()=>oP,AttributeCompression:()=>dn,AttributeType:()=>Dt,AutoExposure:()=>ik,AutomaticUniforms:()=>Q0,Axis:()=>Bi,AxisAlignedBoundingBox:()=>Zu,Azure2DImageryProvider:()=>lX,B3dmLoader:()=>DI,B3dmParser:()=>wI,BaseLayerPicker:()=>b5,BaseLayerPickerViewModel:()=>p5,BatchTable:()=>Z_,BatchTableHierarchy:()=>H_,BatchTexture:()=>jl,BatchTexturePipelineStage:()=>AP,Billboard:()=>Mo,BillboardCollection:()=>wu,BillboardGraphics:()=>jc,BillboardLoadState:()=>Os,BillboardTexture:()=>eg,BillboardVisualizer:()=>y2,BingMapsGeocoderService:()=>Ese,BingMapsImageryProvider:()=>$P,BingMapsStyle:()=>XC,BlendEquation:()=>Ac,BlendFunction:()=>$o,BlendOption:()=>Yi,BlendingState:()=>on,BoundingRectangle:()=>nt,BoundingSphere:()=>me,BoundingSphereState:()=>Wt,BoundingVolumeSemantics:()=>lx,BoxEmitter:()=>Gae,BoxGeometry:()=>Vc,BoxGeometryUpdater:()=>VF,BoxGraphics:()=>L_,BoxOutlineGeometry:()=>Bh,BrdfLutGenerator:()=>n9,Buffer:()=>it,BufferLoader:()=>$_,BufferPoint:()=>Xc,BufferPointCollection:()=>zd,BufferPointMaterial:()=>Zf,BufferPolygon:()=>Ir,BufferPolygonCollection:()=>Ma,BufferPolygonMaterial:()=>Lu,BufferPolyline:()=>ya,BufferPolylineCollection:()=>ml,BufferPolylineMaterial:()=>Wu,BufferPrimitive:()=>rs,BufferPrimitiveCollection:()=>na,BufferPrimitiveMaterial:()=>$l,BufferUsage:()=>Pe,CPUStylingPipelineStage:()=>vP,CallbackPositionProperty:()=>EF,CallbackProperty:()=>Qh,Camera:()=>Io,CameraEventAggregator:()=>dk,CameraEventType:()=>lo,CameraFlightPath:()=>o9,Cartesian2:()=>k,Cartesian3:()=>h,Cartesian4:()=>ce,CartesianRectangle:()=>KC,Cartographic:()=>pe,CartographicGeocoderService:()=>Gse,CatmullRomSpline:()=>Lse,Cesium3DContentGroup:()=>z_,Cesium3DTile:()=>th,Cesium3DTileBatchTable:()=>tf,Cesium3DTileColorBlendMode:()=>Xd,Cesium3DTileContent:()=>Fae,Cesium3DTileContentFactory:()=>NS,Cesium3DTileContentState:()=>Fo,Cesium3DTileContentType:()=>Za,Cesium3DTileFeature:()=>ea,Cesium3DTileFeatureTable:()=>lf,Cesium3DTileOptimizationHint:()=>Qm,Cesium3DTileOptimizations:()=>KN,Cesium3DTilePass:()=>lr,Cesium3DTilePassState:()=>_h,Cesium3DTilePointFeature:()=>tg,Cesium3DTileRefine:()=>xr,Cesium3DTileStyle:()=>sg,Cesium3DTileStyleEngine:()=>eY,Cesium3DTileVectorFeature:()=>IS,Cesium3DTilesInspector:()=>G5,Cesium3DTilesInspectorViewModel:()=>A5,Cesium3DTilesTerrainData:()=>xU,Cesium3DTilesTerrainGeometryProcessor:()=>ZA,Cesium3DTilesTerrainProvider:()=>Xse,Cesium3DTilesVoxelProvider:()=>Iae,Cesium3DTileset:()=>zr,Cesium3DTilesetBaseTraversal:()=>sY,Cesium3DTilesetCache:()=>QN,Cesium3DTilesetGraphics:()=>N_,Cesium3DTilesetHeatmap:()=>qN,Cesium3DTilesetMetadata:()=>HS,Cesium3DTilesetMostDetailedTraversal:()=>iY,Cesium3DTilesetSkipTraversal:()=>lY,Cesium3DTilesetStatistics:()=>Cf,Cesium3DTilesetTraversal:()=>Ba,Cesium3DTilesetVisualizer:()=>dY,CesiumInspector:()=>_5,CesiumInspectorViewModel:()=>T5,CesiumTerrainProvider:()=>LR,CesiumWidget:()=>pU,Check:()=>Ko,CheckerboardMaterialProperty:()=>pV,CircleEmitter:()=>FU,CircleGeometry:()=>Use,CircleOutlineGeometry:()=>Dse,ClassificationModelDrawCommand:()=>HX,ClassificationPipelineStage:()=>GP,ClassificationPrimitive:()=>L1,ClassificationType:()=>ni,ClearCommand:()=>ui,ClippingPlane:()=>ta,ClippingPlaneCollection:()=>gs,ClippingPolygon:()=>mC,ClippingPolygonCollection:()=>vc,Clock:()=>Wf,ClockRange:()=>As,ClockStep:()=>Oo,ClockViewModel:()=>d5,CloudCollection:()=>Mae,CloudType:()=>LA,Color:()=>U,ColorBlendMode:()=>al,ColorGeometryInstanceAttribute:()=>$t,ColorMaterialProperty:()=>Qt,Command:()=>$ce,ComponentDatatype:()=>J,Composite3DTileContent:()=>PF,CompositeEntityCollection:()=>M$,CompositeMaterialProperty:()=>gV,CompositePositionProperty:()=>hc,CompositeProperty:()=>pl,CompressedTextureBuffer:()=>mG,ComputeCommand:()=>bu,ComputeEngine:()=>uG,ConditionsExpression:()=>WN,ConeEmitter:()=>kae,ConstantPositionProperty:()=>Bl,ConstantProperty:()=>mi,ConstantSpline:()=>HI,ContentMetadata:()=>MN,Context:()=>g_,ContextLimits:()=>wt,Controller:()=>Yce,ControllerHost:()=>a9,CoplanarPolygonGeometry:()=>zY,CoplanarPolygonGeometryLibrary:()=>mg,CoplanarPolygonOutlineGeometry:()=>eh,CornerType:()=>ro,CorrelationGroup:()=>GI,CorridorGeometry:()=>QS,CorridorGeometryLibrary:()=>bo,CorridorGeometryUpdater:()=>xY,CorridorGraphics:()=>v_,CorridorOutlineGeometry:()=>yY,Credit:()=>Lt,CreditDisplay:()=>d9,CubeMap:()=>es,CubeMapFace:()=>SG,CubeMapPanorama:()=>SR,CubicRealPolynomial:()=>l_,CullFace:()=>Di,CullingVolume:()=>$s,CumulusCloud:()=>fm,CustomDataSource:()=>ZY,CustomHeightmapTerrainProvider:()=>Ose,CustomShader:()=>M0,CustomShaderMode:()=>Kb,CustomShaderPipelineStage:()=>MP,CustomShaderTranslucencyMode:()=>_x,CylinderGeometry:()=>RY,CylinderGeometryLibrary:()=>qS,CylinderGeometryUpdater:()=>VY,CylinderGraphics:()=>F_,CylinderOutlineGeometry:()=>CY,CzmlDataSource:()=>XY,DataSource:()=>Es,DataSourceClock:()=>vf,DataSourceCollection:()=>NY,DataSourceDisplay:()=>AM,DebugAppearance:()=>zae,DebugCameraPrimitive:()=>v0,DebugInspector:()=>Sk,DebugModelMatrixPrimitive:()=>XU,DefaultProxy:()=>zse,DepthFunction:()=>sc,DepthPlane:()=>b9,DequantizationPipelineStage:()=>kP,DerivedCommand:()=>qf,DeveloperError:()=>ge,DeviceOrientationCameraController:()=>g9,DirectionalLight:()=>jae,DiscardEmptyTileImagePolicy:()=>NC,DiscardMissingTileImagePolicy:()=>QP,DistanceDisplayCondition:()=>Bt,DistanceDisplayConditionGeometryInstanceAttribute:()=>ti,DoubleEndedPriorityQueue:()=>ly,DoublyLinkedList:()=>jN,DracoLoader:()=>vb,DrawCommand:()=>lt,DynamicAtmosphereLightingType:()=>Nb,DynamicEnvironmentMapManager:()=>Yb,DynamicGeometryBatch:()=>oZ,DynamicGeometryUpdater:()=>Li,EarthOrientationParameters:()=>iG,EarthOrientationParametersSample:()=>Zy,EasingFunction:()=>vs,EdgeDetectionPipelineStage:()=>DP,EdgeDisplayMode:()=>km,EdgeFramebuffer:()=>Z9,EdgeVisibilityPipelineStage:()=>zP,EllipseGeometry:()=>ud,EllipseGeometryLibrary:()=>jd,EllipseGeometryUpdater:()=>MY,EllipseGraphics:()=>I_,EllipseOutlineGeometry:()=>ju,Ellipsoid:()=>ne,EllipsoidGeodesic:()=>gb,EllipsoidGeometry:()=>Ha,EllipsoidGeometryUpdater:()=>kY,EllipsoidGraphics:()=>P_,EllipsoidOutlineGeometry:()=>Du,EllipsoidPrimitive:()=>Qw,EllipsoidRhumbLine:()=>Gc,EllipsoidSurfaceAppearance:()=>Qae,EllipsoidTangentPlane:()=>Ms,EllipsoidTerrainProvider:()=>A0,EllipsoidalOccluder:()=>Gf,Empty3DTileContent:()=>Qp,EncodedCartesian3:()=>An,Entity:()=>er,EntityCluster:()=>Bu,EntityCollection:()=>za,EntityView:()=>LM,EquirectangularPanorama:()=>qae,Event:()=>Se,EventHelper:()=>Hr,Expression:()=>Fm,ExpressionNodeType:()=>Pt,ExtrapolationType:()=>cd,FeatureDetection:()=>fn,FeatureIdPipelineStage:()=>Tx,Fog:()=>y9,ForEach:()=>we,FrameRateMonitor:()=>UU,FrameState:()=>Nx,Framebuffer:()=>fs,FramebufferManager:()=>li,Frozen:()=>B,FrustumCommands:()=>C9,FrustumGeometry:()=>JZ,FrustumOutlineGeometry:()=>h9,Fullscreen:()=>qr,FullscreenButton:()=>Z5,FullscreenButtonViewModel:()=>S5,GaussianSplat3DTileContent:()=>Fx,GaussianSplatPrimitive:()=>YN,GaussianSplatRenderResources:()=>PN,GaussianSplatSorter:()=>PS,GaussianSplatTextureGenerator:()=>IN,GeoJsonDataSource:()=>mT,GeoJsonLoader:()=>OI,GeoJsonPrimitive:()=>nce,GeocodeType:()=>NT,Geocoder:()=>K5,GeocoderService:()=>VA,GeocoderViewModel:()=>H5,GeographicProjection:()=>ki,GeographicTilingScheme:()=>to,Geometry:()=>At,Geometry3DTileContent:()=>YF,GeometryAttribute:()=>Xe,GeometryAttributes:()=>Rn,GeometryFactory:()=>Hse,GeometryInstance:()=>Yt,GeometryInstanceAttribute:()=>Qc,GeometryOffsetAttribute:()=>bn,GeometryPipeline:()=>Bn,GeometryPipelineStage:()=>jP,GeometryType:()=>Sm,GeometryUpdater:()=>Wi,GeometryUpdaterSet:()=>pZ,GeometryVisualizer:()=>hM,GetFeatureInfoFormat:()=>ff,Globe:()=>Hw,GlobeDepth:()=>V9,GlobeSurfaceShaderSet:()=>Xw,GlobeSurfaceTile:()=>xh,GlobeSurfaceTileProvider:()=>Yw,GlobeTranslucency:()=>Mw,GlobeTranslucencyFramebuffer:()=>E9,GlobeTranslucencyState:()=>x9,GltfBufferViewLoader:()=>O1,GltfDracoLoader:()=>B1,GltfGpmLoader:()=>WI,GltfGpmLocal:()=>gC,GltfImageLoader:()=>z1,GltfIndexBufferLoader:()=>H1,GltfJsonLoader:()=>J1,GltfLoader:()=>vu,GltfLoaderUtil:()=>Md,GltfMeshPrimitiveGpmLoader:()=>PI,GltfSpzLoader:()=>nI,GltfStructuralMetadataLoader:()=>CI,GltfTextureLoader:()=>$1,GltfVertexBufferLoader:()=>eC,Google2DImageryProvider:()=>cX,GoogleEarthEnterpriseImageryProvider:()=>oce,GoogleEarthEnterpriseMapsProvider:()=>nX,GoogleEarthEnterpriseMetadata:()=>hy,GoogleEarthEnterpriseTerrainData:()=>EA,GoogleEarthEnterpriseTerrainProvider:()=>eae,GoogleEarthEnterpriseTileInformation:()=>ZU,GoogleGeocoderService:()=>nae,GoogleMaps:()=>_a,GoogleStreetViewCubeMapPanoramaProvider:()=>rce,GpxDataSource:()=>Sw,GregorianDate:()=>vh,GridImageryProvider:()=>sce,GridMaterialProperty:()=>EV,GroundGeometryUpdater:()=>ri,GroundPolylineGeometry:()=>E_,GroundPolylinePrimitive:()=>zh,GroundPrimitive:()=>Dl,GroupMetadata:()=>mV,HeadingPitchRange:()=>uh,HeadingPitchRoll:()=>Cc,Heap:()=>$A,HeightReference:()=>He,HeightmapEncoding:()=>gh,HeightmapTerrainData:()=>wc,HeightmapTessellator:()=>QE,HermitePolynomialApproximation:()=>EY,HermiteSpline:()=>yx,HilbertOrder:()=>w1,HomeButton:()=>C5,HomeButtonViewModel:()=>R5,HorizontalOrigin:()=>Ui,HybridScreenSpacePanCameraController:()=>Dce,I3SBuildingSceneLayerExplorer:()=>sle,I3SBuildingSceneLayerExplorerViewModel:()=>L5,I3SDataProvider:()=>up,I3SDecoder:()=>DU,I3SFeature:()=>OU,I3SField:()=>BU,I3SGeometry:()=>FA,I3SLayer:()=>kR,I3SNode:()=>IA,I3SStatistics:()=>KU,I3SSublayer:()=>jU,I3SSymbology:()=>HU,I3dmLoader:()=>zI,I3dmParser:()=>BI,ITwinData:()=>dce,ITwinPlatform:()=>la,Iau2000Orientation:()=>Jw,Iau2006XysData:()=>oG,Iau2006XysSample:()=>r_,IauOrientationAxes:()=>jw,IauOrientationParameters:()=>Kw,ImageBasedLighting:()=>B_,ImageBasedLightingPipelineStage:()=>sP,ImageMaterialProperty:()=>By,Imagery:()=>zC,ImageryConfiguration:()=>iN,ImageryCoverage:()=>JC,ImageryFlags:()=>dX,ImageryInput:()=>mX,ImageryLayer:()=>Zs,ImageryLayerCollection:()=>KS,ImageryLayerFeatureInfo:()=>mf,ImageryPipelineStage:()=>hX,ImageryProvider:()=>Iu,ImageryState:()=>Dn,Implicit3DTileContent:()=>rC,ImplicitAvailabilityBitstream:()=>U1,ImplicitMetadataView:()=>D1,ImplicitSubdivisionScheme:()=>Us,ImplicitSubtree:()=>Pb,ImplicitSubtreeCache:()=>WU,ImplicitSubtreeMetadata:()=>wF,ImplicitTileCoordinates:()=>e0,ImplicitTileset:()=>$p,IndexDatatype:()=>Oe,InfoBox:()=>I5,InfoBoxViewModel:()=>F5,InspectorShared:()=>fu,InstanceAttributeSemantic:()=>Pr,InstancingPipelineStage:()=>ZP,InterpolationAlgorithm:()=>oae,InterpolationType:()=>af,Intersect:()=>qt,IntersectionTests:()=>xi,Intersections2D:()=>sp,Interval:()=>Ns,InvertClassification:()=>aA,Ion:()=>Id,IonGeocodeProviderType:()=>fy,IonGeocoderService:()=>FR,IonImageryProvider:()=>nd,IonImageryProviderFactory:()=>OC,IonResource:()=>Ur,IonSnapGeometryType:()=>aae,IonSnapHeat:()=>cae,IonSnapMode:()=>CU,IonSnapParentGeometryType:()=>lae,IonSnapService:()=>dae,IonWorldImageryStyle:()=>Qb,Iso8601:()=>ot,JobScheduler:()=>T9,JobType:()=>Wc,JsonMetadataTable:()=>Mb,JulianDate:()=>Q,KTX2Transcoder:()=>hG,KeyboardEventModifier:()=>ir,KeyframeNode:()=>zo,KmlCamera:()=>Zw,KmlDataSource:()=>DZ,KmlLookAt:()=>Rw,KmlTour:()=>Cw,KmlTourFlyTo:()=>Ew,KmlTourWait:()=>Aw,Label:()=>Ex,LabelCollection:()=>Jp,LabelGraphics:()=>Kh,LabelStyle:()=>Tr,LabelVisualizer:()=>fM,LagrangePolynomialApproximation:()=>AY,LeapSecond:()=>To,Light:()=>uce,LightingModel:()=>zp,LightingPipelineStage:()=>pX,LinearApproximation:()=>Bx,LinearSpline:()=>gx,MVTDataProvider:()=>fce,ManagedArray:()=>Jl,MapMode2D:()=>pd,MapProjection:()=>mae,MapboxImageryProvider:()=>iX,MapboxStyleImageryProvider:()=>mce,MappedPositions:()=>uX,Material:()=>eo,MaterialAppearance:()=>Co,MaterialPipelineStage:()=>xX,MaterialProperty:()=>yr,Math:()=>W,Matrix2:()=>Ji,Matrix3:()=>q,Matrix4:()=>P,Megatexture:()=>jk,MeshPrimitiveGpmLocal:()=>II,MetadataClass:()=>rf,MetadataClassProperty:()=>Xp,MetadataComponentType:()=>Nt,MetadataEntity:()=>Jn,MetadataEnum:()=>rI,MetadataEnumValue:()=>oI,MetadataPicking:()=>_9,MetadataPickingPipelineStage:()=>Nu,MetadataPipelineStage:()=>Um,MetadataSchema:()=>Ql,MetadataSchemaLoader:()=>ax,MetadataSemantic:()=>Nm,MetadataTable:()=>Im,MetadataTableProperty:()=>DF,MetadataType:()=>St,MipmapHint:()=>Cm,Model:()=>Yu,Model3DTileContent:()=>Mu,ModelAlphaOptions:()=>_S,ModelAnimation:()=>QI,ModelAnimationChannel:()=>jI,ModelAnimationCollection:()=>qI,ModelAnimationLoop:()=>wd,ModelAnimationState:()=>df,ModelArticulation:()=>cP,ModelArticulationStage:()=>aP,ModelClippingPlanesPipelineStage:()=>uP,ModelClippingPolygonsPipelineStage:()=>fP,ModelColorPipelineStage:()=>xx,ModelComponents:()=>Vn,ModelDrawCommand:()=>KX,ModelDrawCommands:()=>QX,ModelFeature:()=>$I,ModelFeatureTable:()=>eP,ModelGraphics:()=>Sb,ModelImagery:()=>oN,ModelImageryMapping:()=>yS,ModelLightingOptions:()=>OX,ModelMatrixUpdateStage:()=>RP,ModelNode:()=>yP,ModelPrimitiveImagery:()=>xS,ModelReader:()=>xa,ModelRenderResources:()=>NX,ModelRuntimeNode:()=>VP,ModelRuntimePrimitive:()=>PX,ModelSceneGraph:()=>qX,ModelSilhouettePipelineStage:()=>wX,ModelSkin:()=>XX,ModelSplitterPipelineStage:()=>UX,ModelStatistics:()=>$X,ModelType:()=>Or,ModelUtility:()=>Zt,ModelVectorLookupPipelineStage:()=>gP,ModelVisualizer:()=>bM,Moon:()=>$w,MorphTargetsPipelineStage:()=>_X,MorphWeightSpline:()=>hae,MortonOrder:()=>Yx,MouseButton:()=>qa,Multiple3DTileContent:()=>UN,MultisampleFramebuffer:()=>pv,NavigationHelpButton:()=>v5,NavigationHelpButtonViewModel:()=>W5,NearFarScalar:()=>Kt,NeverTileDiscardPolicy:()=>bce,NodeRenderResources:()=>DX,NodeStatisticsPipelineStage:()=>CP,NodeTransformationProperty:()=>X_,OIT:()=>A9,Occluder:()=>e9,OffsetGeometryInstanceAttribute:()=>Ro,OpenCageGeocoderService:()=>pae,OpenStreetMapImageryProvider:()=>gy,OrderedGroundPrimitiveCollection:()=>YY,OrientedBoundingBox:()=>nn,OrthographicFrustum:()=>yn,OrthographicOffCenterFrustum:()=>ps,Packable:()=>bae,PackableForInterpolation:()=>gae,Panorama:()=>gce,PanoramaProvider:()=>yce,Particle:()=>NA,ParticleBurst:()=>Tce,ParticleEmitter:()=>_ce,ParticleSystem:()=>Sce,Pass:()=>Le,PassState:()=>oc,PathGraphics:()=>Zb,PathMode:()=>n0,PathVisualizer:()=>TM,PeliasGeocoderService:()=>RU,PerInstanceColorAppearance:()=>Tn,PerformanceDisplay:()=>qg,PerformanceWatchdog:()=>X5,PerformanceWatchdogViewModel:()=>P5,PerspectiveFrustum:()=>qi,PerspectiveOffCenterFrustum:()=>fd,PickDepth:()=>S9,PickDepthFramebuffer:()=>L9,PickFramebuffer:()=>W9,PickId:()=>EG,PickedMetadataInfo:()=>nU,Picking:()=>Y9,PickingPipelineStage:()=>SX,PinBuilder:()=>zg,PixelDatatype:()=>Ue,PixelFormat:()=>Qe,PlanarFillIdFramebuffer:()=>R9,Plane:()=>cn,PlaneGeometry:()=>UY,PlaneGeometryUpdater:()=>OY,PlaneGraphics:()=>xF,PlaneOutlineGeometry:()=>DY,PntsLoader:()=>tN,PntsParser:()=>ZS,PointCloud:()=>hU,PointCloudEyeDomeLighting:()=>kb,PointCloudShading:()=>Up,PointCloudStylingPipelineStage:()=>RX,PointGraphics:()=>Y_,PointPrimitive:()=>Ea,PointPrimitiveCollection:()=>SV,PointVisualizer:()=>SM,PolygonGeometry:()=>kp,PolygonGeometryLibrary:()=>oi,PolygonGeometryUpdater:()=>KY,PolygonGraphics:()=>Jh,PolygonHierarchy:()=>Lc,PolygonOutlineGeometry:()=>HY,PolygonPipeline:()=>hi,Polyline:()=>Hm,PolylineArrowMaterialProperty:()=>GV,PolylineCollection:()=>Tf,PolylineColorAppearance:()=>ws,PolylineDashMaterialProperty:()=>WV,PolylineGeometry:()=>Xg,PolylineGeometryUpdater:()=>CM,PolylineGlowMaterialProperty:()=>FV,PolylineGraphics:()=>qc,PolylineMaterialAppearance:()=>ac,PolylineOutlineMaterialProperty:()=>zx,PolylinePipeline:()=>oo,PolylineVisualizer:()=>EM,PolylineVolumeGeometry:()=>QY,PolylineVolumeGeometryLibrary:()=>Vf,PolylineVolumeGeometryUpdater:()=>tM,PolylineVolumeGraphics:()=>M_,PolylineVolumeOutlineGeometry:()=>eM,PositionProperty:()=>Hh,PositionPropertyArray:()=>Vg,PostProcessStage:()=>Uo,PostProcessStageCollection:()=>sk,PostProcessStageComposite:()=>cu,PostProcessStageLibrary:()=>am,PostProcessStageSampleMode:()=>sm,PostProcessStageTextureCache:()=>cR,PpeMetadata:()=>FI,PpeSource:()=>Jce,PpeTexture:()=>vI,Primitive:()=>In,PrimitiveCollection:()=>xl,PrimitiveLoadPlan:()=>hS,PrimitiveOutlineGenerator:()=>mS,PrimitiveOutlinePipelineStage:()=>EX,PrimitivePipeline:()=>R_,PrimitiveRenderResources:()=>BX,PrimitiveState:()=>ns,PrimitiveStatisticsPipelineStage:()=>AX,PrimitiveType:()=>Ie,ProjectionPicker:()=>Y5,ProjectionPickerViewModel:()=>N5,Property:()=>j,PropertyArray:()=>PV,PropertyAttribute:()=>dS,PropertyAttributeProperty:()=>_I,PropertyBag:()=>Hl,PropertyTable:()=>ed,PropertyTexture:()=>wb,PropertyTextureProperty:()=>TI,ProviderViewModel:()=>mr,Proxy:()=>xae,QuadraticRealPolynomial:()=>Xl,QuadtreeOccluders:()=>ww,QuadtreePrimitive:()=>zw,QuadtreeTile:()=>kw,QuadtreeTileLoadState:()=>Ja,QuadtreeTileProvider:()=>Rce,QuantizedMeshTerrainData:()=>GR,QuarticRealPolynomial:()=>bG,Quaternion:()=>Ne,QuaternionSpline:()=>JI,Queue:()=>mx,Ray:()=>gn,Rectangle:()=>re,RectangleCollisionChecker:()=>gZ,RectangleGeometry:()=>lZ,RectangleGeometryLibrary:()=>Ca,RectangleGeometryUpdater:()=>nM,RectangleGraphics:()=>jh,RectangleOutlineGeometry:()=>wS,ReferenceFrame:()=>Oi,ReferenceProperty:()=>Eg,RenderState:()=>ze,Renderbuffer:()=>_u,RenderbufferFormat:()=>Ml,Request:()=>Ar,RequestErrorEvent:()=>Sp,RequestScheduler:()=>Hc,RequestState:()=>Ri,RequestType:()=>js,Resource:()=>ve,ResourceCache:()=>Ni,ResourceCacheKey:()=>ql,ResourceCacheStatistics:()=>cI,ResourceLoader:()=>io,ResourceLoaderState:()=>Rt,Rotation:()=>rh,RuntimeError:()=>ae,S2Cell:()=>Gb,SDFSettings:()=>Da,SampledPositionProperty:()=>pc,SampledProperty:()=>Ku,Sampler:()=>Ot,ScaledPositionProperty:()=>l0,Scene:()=>oU,SceneFramebuffer:()=>iR,SceneMode:()=>se,SceneMode2DPipelineStage:()=>GX,SceneModePicker:()=>w5,SceneModePickerViewModel:()=>M5,SceneTransforms:()=>fo,SceneTransitioner:()=>lk,ScreenSpaceCameraController:()=>hk,ScreenSpaceElevatorCameraController:()=>o5,ScreenSpaceEventHandler:()=>aa,ScreenSpaceEventType:()=>mn,ScreenSpaceInputBindings:()=>hp,ScreenSpaceMapCameraController:()=>r5,ScreenSpaceTiltOrbitCameraController:()=>Bce,ScreenSpaceZoomCameraController:()=>Hce,SelectedFeatureIdPipelineStage:()=>Sx,SelectionIndicator:()=>D5,SelectionIndicatorViewModel:()=>U5,SensorVolumePortionToDisplay:()=>MV,ShaderBuilder:()=>lb,ShaderCache:()=>lv,ShaderDestination:()=>fe,ShaderFunction:()=>xv,ShaderProgram:()=>tn,ShaderSource:()=>Je,ShaderStruct:()=>yv,ShadowMap:()=>ty,ShadowMapShader:()=>ep,ShadowMode:()=>vn,ShadowVolumeAppearance:()=>Ru,SharedContext:()=>Tv,ShowGeometryInstanceAttribute:()=>Wn,Simon1994PlanetaryPositions:()=>Iy,SimplePolylineGeometry:()=>Tae,SingleTileImageryProvider:()=>oX,SkinningPipelineStage:()=>WX,SkyAtmosphere:()=>rU,SkyBox:()=>aU,SnapFramebuffer:()=>pk,SnapService:()=>_ae,Snapping:()=>gk,SpatialNode:()=>qk,Spdcf:()=>LI,SpecularEnvironmentCubeMap:()=>$h,SphereEmitter:()=>Vce,SphereGeometry:()=>EU,SphereOutlineGeometry:()=>fg,Spherical:()=>GY,Spline:()=>vo,SplitDirection:()=>kr,Splitter:()=>bA,StaticGeometryColorBatch:()=>lh,StaticGeometryPerMaterialBatch:()=>dh,StaticGroundGeometryColorBatch:()=>rE,StaticGroundGeometryPerMaterialBatch:()=>mM,StaticGroundPolylinePerMaterialBatch:()=>VM,StaticOutlineGeometryBatch:()=>cE,StencilConstants:()=>Jt,StencilFunction:()=>ii,StencilOperation:()=>Ft,SteppedSpline:()=>KI,Stereographic:()=>rl,StorageType:()=>px,StripeMaterialProperty:()=>NV,StripeOrientation:()=>Ff,StructuralMetadata:()=>wa,StyleCommandsNeeded:()=>uf,StyleExpression:()=>Ece,Sun:()=>dU,SunLight:()=>cb,SunPostProcess:()=>Tk,SupportedImageFormats:()=>VI,SvgPathBindingHandler:()=>c5,Sync:()=>_v,TaskProcessor:()=>qn,Terrain:()=>t5,TerrainData:()=>ru,TerrainEncoding:()=>Cr,TerrainFillMesh:()=>tA,TerrainMesh:()=>yc,TerrainOffsetProperty:()=>w_,TerrainPicker:()=>Iw,TerrainProvider:()=>Qo,TerrainQuantization:()=>Ka,TerrainState:()=>wo,Texture:()=>vt,Texture3D:()=>Sv,TextureAtlas:()=>x_,TextureCache:()=>dv,TextureMagnificationFilter:()=>$n,TextureManager:()=>Vk,TextureMinificationFilter:()=>Ht,TexturePacker:()=>g1,TextureUniform:()=>Ak,TextureWrap:()=>pn,TileAvailability:()=>rp,TileBoundingRegion:()=>Uu,TileBoundingS2Cell:()=>zN,TileBoundingSphere:()=>pg,TileBoundingVolume:()=>Ace,TileCoordinatesImageryProvider:()=>i5,TileDiscardPolicy:()=>Lce,TileEdge:()=>Gn,TileImagery:()=>HC,TileMapServiceImageryProvider:()=>Zx,TileMetadata:()=>wN,TileOrientedBoundingBox:()=>Hd,TileProviderError:()=>tr,TileReplacementQueue:()=>Uw,TileSelectionResult:()=>gi,TileState:()=>Wce,Tileset3DTileContent:()=>aN,TilesetMetadata:()=>HN,TilesetPipelineStage:()=>tP,TilingScheme:()=>Zae,TimeConstants:()=>wn,TimeDynamicImagery:()=>gS,TimeDynamicPointCloud:()=>yA,TimeInterval:()=>Cn,TimeIntervalCollection:()=>Vs,TimeIntervalCollectionPositionProperty:()=>Ag,TimeIntervalCollectionProperty:()=>Gg,TimeStandard:()=>ci,Timeline:()=>z5,TimelineHighlightRange:()=>O5,TimelineTrack:()=>B5,Tipsify:()=>gG,ToggleButtonViewModel:()=>kT,Tonemapper:()=>oy,TrackingReferenceFrame:()=>bb,Transforms:()=>_t,TranslationRotationScale:()=>zy,TranslucentTileClassification:()=>v9,TridiagonalSystemSolver:()=>RC,TrustedServers:()=>o1,TweenCollection:()=>mR,UniformState:()=>fv,UniformType:()=>Y0,UrlTemplate3DTilesDataProvider:()=>qU,UrlTemplateImageryProvider:()=>Ss,VERSION:()=>Z3t,VRButton:()=>j5,VRButtonViewModel:()=>J5,VRTheWorldTerrainProvider:()=>Cae,VaryingType:()=>Kce,Vector3DTileBatch:()=>Pp,Vector3DTileClampedPolylines:()=>SN,Vector3DTileContent:()=>RN,Vector3DTileGeometry:()=>Ab,Vector3DTilePoints:()=>yN,Vector3DTilePolygons:()=>xN,Vector3DTilePolylines:()=>WS,Vector3DTilePrimitive:()=>j_,VectorGltf3DTileContent:()=>vx,VectorPipeline:()=>Ts,VectorProvider:()=>ag,VelocityOrientationProperty:()=>WY,VelocityVectorProperty:()=>Lg,VertexArray:()=>Un,VertexArrayFacade:()=>db,VertexAttributeSemantic:()=>dt,VertexFormat:()=>Me,VerticalExaggeration:()=>_o,VerticalExaggerationPipelineStage:()=>FX,VerticalOrigin:()=>zn,VideoSynchronizer:()=>Rae,View:()=>rR,Viewer:()=>gle,ViewportQuad:()=>vce,Visibility:()=>Jr,Visualizer:()=>loe,VoxelBoundsCollection:()=>ay,VoxelBoxShape:()=>yR,VoxelCell:()=>Zk,VoxelContent:()=>gR,VoxelCylinderShape:()=>xR,VoxelEllipsoidShape:()=>TR,VoxelInspector:()=>q5,VoxelInspectorViewModel:()=>Q5,VoxelMetadataOrder:()=>w0,VoxelPrimitive:()=>vT,VoxelProvider:()=>Ice,VoxelRenderResources:()=>Ok,VoxelShape:()=>Pce,VoxelShapeType:()=>_c,VoxelTraversal:()=>$k,VulkanConstants:()=>Vae,WallGeometry:()=>oM,WallGeometryLibrary:()=>dZ,WallGeometryUpdater:()=>aM,WallGraphics:()=>Rb,WallOutlineGeometry:()=>sM,WebGLConstants:()=>ie,WebMapServiceImageryProvider:()=>sX,WebMapTileServiceImageryProvider:()=>aX,WebMercatorProjection:()=>Ti,WebMercatorTilingScheme:()=>Xr,WindingOrder:()=>Qs,WireframeIndexGenerator:()=>jC,WireframePipelineStage:()=>IX,_shadersAcesTonemappingStage:()=>M9,_shadersAdditiveBlend:()=>yk,_shadersAdjustTranslucentFS:()=>y1,_shadersAllMaterialAppearanceFS:()=>_2,_shadersAllMaterialAppearanceVS:()=>S2,_shadersAmbientOcclusionGenerate:()=>w9,_shadersAmbientOcclusionModulate:()=>k9,_shadersAspectRampMaterial:()=>E2,_shadersAtmosphereCommon:()=>Uh,_shadersAtmosphereStageFS:()=>nP,_shadersAtmosphereStageVS:()=>iP,_shadersBasicMaterialAppearanceFS:()=>Z2,_shadersBasicMaterialAppearanceVS:()=>R2,_shadersBillboardCollectionFS:()=>Rv,_shadersBillboardCollectionVS:()=>Cv,_shadersBlackAndWhite:()=>U9,_shadersBloomComposite:()=>D9,_shadersBrdfLutGeneratorFS:()=>Vv,_shadersBrightPass:()=>xk,_shadersBrightness:()=>O9,_shadersBufferPointMaterialFS:()=>Ev,_shadersBufferPointMaterialVS:()=>Av,_shadersBufferPolygonMaterialFS:()=>Gv,_shadersBufferPolygonMaterialVS:()=>Lv,_shadersBufferPolylineMaterialFS:()=>Wv,_shadersBufferPolylineMaterialVS:()=>vv,_shadersBumpMapMaterial:()=>A2,_shadersCPUStylingStageFS:()=>WP,_shadersCPUStylingStageVS:()=>LP,_shadersCheckerboardMaterial:()=>G2,_shadersCloudCollectionFS:()=>Fv,_shadersCloudCollectionVS:()=>Iv,_shadersCloudNoiseFS:()=>Pv,_shadersCloudNoiseVS:()=>Xv,_shadersCompareAndPackTranslucentDepth:()=>Nv,_shadersCompositeOITFS:()=>Yv,_shadersCompositeTranslucentClassification:()=>oR,_shadersComputeIrradianceFS:()=>Mv,_shadersComputeRadianceMapFS:()=>wv,_shadersConstantLodStageFS:()=>yX,_shadersConstantLodStageVS:()=>gX,_shadersContrastBias:()=>B9,_shadersConvolveSpecularMapFS:()=>kv,_shadersConvolveSpecularMapVS:()=>Uv,_shadersCubeMapPanoramaVS:()=>Dv,_shadersCustomShaderStageFS:()=>IP,_shadersCustomShaderStageVS:()=>FP,_shadersCzmBuiltins:()=>p_,_shadersDepthOfField:()=>z9,_shadersDepthPlaneFS:()=>Ov,_shadersDepthPlaneVS:()=>Bv,_shadersDepthView:()=>H9,_shadersDepthViewPacked:()=>Xce,_shadersDotMaterial:()=>L2,_shadersEdgeDetection:()=>K9,_shadersEdgeDetectionStageFS:()=>UP,_shadersEdgeVisibilityStageFS:()=>OP,_shadersEdgeVisibilityStageVS:()=>BP,_shadersElevationBandMaterial:()=>W2,_shadersElevationContourMaterial:()=>v2,_shadersElevationRampMaterial:()=>F2,_shadersEllipsoidFS:()=>x1,_shadersEllipsoidSurfaceAppearanceFS:()=>MU,_shadersEllipsoidSurfaceAppearanceVS:()=>wU,_shadersEllipsoidVS:()=>T1,_shadersFXAA:()=>Q9,_shadersFXAA3_11:()=>zv,_shadersFadeMaterial:()=>I2,_shadersFeatureIdStageFS:()=>PP,_shadersFeatureIdStageVS:()=>XP,_shadersFilmicTonemapping:()=>J9,_shadersGaussianBlur1D:()=>GT,_shadersGeometryStageFS:()=>HP,_shadersGeometryStageVS:()=>KP,_shadersGlobeFS:()=>Hv,_shadersGlobeVS:()=>Kv,_shadersGridMaterial:()=>P2,_shadersGroundAtmosphere:()=>_1,_shadersHSBToRGB:()=>cW,_shadersHSLToRGB:()=>lW,_shadersImageBasedLightingStageFS:()=>rP,_shadersInstancingStageCommon:()=>xP,_shadersInstancingStageVS:()=>TP,_shadersIntersectBox:()=>Xk,_shadersIntersectCylinder:()=>Nk,_shadersIntersectDepth:()=>Ik,_shadersIntersectEllipsoid:()=>Yk,_shadersIntersectLongitude:()=>hA,_shadersIntersectPlane:()=>Pk,_shadersIntersection:()=>bR,_shadersIntersectionUtils:()=>Fk,_shadersLegacyInstancingStageVS:()=>_P,_shadersLensFlare:()=>q9,_shadersLightingStageFS:()=>fX,_shadersMaterialStageFS:()=>bX,_shadersMegatexture:()=>Dk,_shadersMetadataStageFS:()=>NP,_shadersMetadataStageVS:()=>YP,_shadersModelClippingPlanesStageFS:()=>dP,_shadersModelClippingPolygonsStageFS:()=>mP,_shadersModelClippingPolygonsStageVS:()=>hP,_shadersModelColorStageFS:()=>lP,_shadersModelFS:()=>jX,_shadersModelSilhouetteStageFS:()=>YX,_shadersModelSilhouetteStageVS:()=>MX,_shadersModelSplitterStageFS:()=>kX,_shadersModelVS:()=>JX,_shadersModelVectorLookupStageFS:()=>bP,_shadersModelVectorLookupStageVS:()=>pP,_shadersModifiedReinhardTonemapping:()=>$9,_shadersMorphTargetsStageVS:()=>TX,_shadersNightVision:()=>ek,_shadersNormalMapMaterial:()=>X2,_shadersOctree:()=>Uk,_shadersPassThrough:()=>au,_shadersPassThroughDepth:()=>CT,_shadersPbrNeutralTonemapping:()=>j9,_shadersPerInstanceColorAppearanceFS:()=>H2,_shadersPerInstanceColorAppearanceVS:()=>K2,_shadersPerInstanceFlatColorAppearanceFS:()=>S_,_shadersPerInstanceFlatColorAppearanceVS:()=>J2,_shadersPointCloudEyeDomeLighting:()=>YI,_shadersPointCloudStylingStageVS:()=>ZX,_shadersPointPrimitiveCollectionFS:()=>Ny,_shadersPointPrimitiveCollectionVS:()=>Jv,_shadersPolylineArrowMaterial:()=>N2,_shadersPolylineColorAppearanceVS:()=>sF,_shadersPolylineCommon:()=>Ul,_shadersPolylineDashMaterial:()=>Y2,_shadersPolylineFS:()=>T_,_shadersPolylineGlowMaterial:()=>M2,_shadersPolylineMaterialAppearanceVS:()=>aF,_shadersPolylineOutlineMaterial:()=>w2,_shadersPolylineShadowVolumeFS:()=>jv,_shadersPolylineShadowVolumeMorphFS:()=>Qv,_shadersPolylineShadowVolumeMorphVS:()=>qv,_shadersPolylineShadowVolumeVS:()=>$v,_shadersPolylineVS:()=>e2,_shadersPrimitiveGaussianSplatFS:()=>t2,_shadersPrimitiveGaussianSplatVS:()=>n2,_shadersPrimitiveOutlineStageFS:()=>VX,_shadersPrimitiveOutlineStageVS:()=>CX,_shadersRGBToHSB:()=>PW,_shadersRGBToHSL:()=>XW,_shadersRGBToXYZ:()=>NW,_shadersReinhardTonemapping:()=>tk,_shadersReprojectWebMercatorFS:()=>i2,_shadersReprojectWebMercatorVS:()=>o2,_shadersRimLightingMaterial:()=>k2,_shadersSelectedFeatureIdStageCommon:()=>FC,_shadersShadowVolumeAppearanceFS:()=>S1,_shadersShadowVolumeAppearanceVS:()=>r2,_shadersShadowVolumeFS:()=>Yy,_shadersSilhouette:()=>nk,_shadersSkinningStageVS:()=>LX,_shadersSkyAtmosphereCommon:()=>Z1,_shadersSkyAtmosphereFS:()=>s2,_shadersSkyAtmosphereVS:()=>a2,_shadersSkyBoxFS:()=>c2,_shadersSkyBoxVS:()=>l2,_shadersSlopeRampMaterial:()=>U2,_shadersStripeMaterial:()=>D2,_shadersSunFS:()=>d2,_shadersSunTextureFS:()=>u2,_shadersSunVS:()=>m2,_shadersTexturedMaterialAppearanceFS:()=>C2,_shadersTexturedMaterialAppearanceVS:()=>V2,_shadersVector3DTileClampedPolylinesFS:()=>h2,_shadersVector3DTileClampedPolylinesVS:()=>f2,_shadersVector3DTilePolylinesVS:()=>p2,_shadersVectorCommon:()=>ub,_shadersVectorTileVS:()=>R1,_shadersVerticalExaggerationStageVS:()=>vX,_shadersViewportQuadFS:()=>b2,_shadersViewportQuadVS:()=>s_,_shadersVoxelFS:()=>Wk,_shadersVoxelUtils:()=>Lk,_shadersVoxelVS:()=>vk,_shadersWater:()=>B2,_shadersWaterMaskMaterial:()=>O2,_shadersXYZToRGB:()=>av,_shadersacesTonemapping:()=>RL,_shadersalphaWeight:()=>CL,_shadersantialias:()=>VL,_shadersapplyHSBShift:()=>EL,_shadersapproximateSphericalCoordinates:()=>AL,_shadersapproximateTanh:()=>GL,_shadersbackFacing:()=>LL,_shadersbranchFreeTernary:()=>WL,_shaderscascadeColor:()=>vL,_shaderscascadeDistance:()=>FL,_shaderscascadeMatrix:()=>IL,_shaderscascadeWeights:()=>PL,_shaderscolumbusViewMorph:()=>XL,_shaderscomputeAtmosphereColor:()=>NL,_shaderscomputeGroundAtmosphereScattering:()=>YL,_shaderscomputePosition:()=>ML,_shaderscomputeScattering:()=>wL,_shaderscomputeTextureTransform:()=>kL,_shadersconvertLocalToBoxUv:()=>Mk,_shadersconvertLocalToCylinderUv:()=>wk,_shadersconvertLocalToEllipsoidUv:()=>kk,_shaderscosineAndSine:()=>UL,_shadersdecodeRGB8:()=>DL,_shadersdecompressTextureCoordinates:()=>OL,_shadersdegreesPerRadian:()=>AG,_shadersdepthClamp:()=>BL,_shadersdepthRange:()=>GG,_shadersdepthRangeStruct:()=>bL,_shaderseastNorthUpToEyeCoordinates:()=>zL,_shadersellipsoidContainsPoint:()=>HL,_shadersellipsoidTextureCoordinates:()=>KL,_shadersepsilon1:()=>LG,_shadersepsilon2:()=>WG,_shadersepsilon3:()=>vG,_shadersepsilon4:()=>FG,_shadersepsilon5:()=>IG,_shadersepsilon6:()=>PG,_shadersepsilon7:()=>XG,_shadersequalsEpsilon:()=>JL,_shaderseyeOffset:()=>jL,_shaderseyeToCartographicDelta:()=>QL,_shaderseyeToWindowCoordinates:()=>qL,_shadersfastApproximateAtan:()=>$L,_shadersfog:()=>eW,_shadersgammaCorrect:()=>tW,_shadersgeodeticSurfaceNormal:()=>nW,_shadersgetDefaultMaterial:()=>iW,_shadersgetDynamicAtmosphereLightDirection:()=>oW,_shadersgetLambertDiffuse:()=>rW,_shadersgetSpecular:()=>sW,_shadersgetWaterNoise:()=>aW,_shadershue:()=>dW,_shadersinfinity:()=>NG,_shadersinverseGamma:()=>uW,_shadersisEmpty:()=>mW,_shadersisFull:()=>hW,_shaderslatitudeToWebMercatorFraction:()=>fW,_shaderslineDistance:()=>bW,_shaderslinearToSrgb:()=>pW,_shadersluminance:()=>gW,_shadersmaterial:()=>gL,_shadersmaterialInput:()=>yL,_shadersmaximumComponent:()=>yW,_shadersmetersPerPixel:()=>xW,_shadersmodelMaterial:()=>xL,_shadersmodelToWindowCoordinates:()=>TW,_shadersmodelVertexOutput:()=>TL,_shadersmultiplyWithColorBalance:()=>_W,_shadersnearFarScalar:()=>SW,_shadersoctDecode:()=>ZW,_shadersoneOverPi:()=>YG,_shadersoneOverTwoPi:()=>MG,_shaderspackDepth:()=>RW,_shaderspassCesium3DTile:()=>wG,_shaderspassCesium3DTileClassification:()=>kG,_shaderspassCesium3DTileClassificationIgnoreShow:()=>UG,_shaderspassCesium3DTileEdges:()=>DG,_shaderspassCesium3DTileEdgesDirect:()=>OG,_shaderspassCesium3DTilePlanarFillId:()=>BG,_shaderspassClassification:()=>zG,_shaderspassCompute:()=>HG,_shaderspassEnvironment:()=>KG,_shaderspassGaussianSplats:()=>JG,_shaderspassGlobe:()=>jG,_shaderspassOpaque:()=>QG,_shaderspassOverlay:()=>qG,_shaderspassTerrainClassification:()=>$G,_shaderspassTranslucent:()=>eL,_shaderspassVoxels:()=>tL,_shaderspbrLighting:()=>CW,_shaderspbrNeutralTonemapping:()=>VW,_shadersphong:()=>EW,_shaderspi:()=>nL,_shaderspiOverFour:()=>iL,_shaderspiOverSix:()=>oL,_shaderspiOverThree:()=>rL,_shaderspiOverTwo:()=>sL,_shadersplaneDistance:()=>AW,_shaderspointAlongRay:()=>GW,_shadersradiansPerDegree:()=>aL,_shadersray:()=>_L,_shadersrayEllipsoidIntersectionInterval:()=>LW,_shadersraySegment:()=>SL,_shadersraySphereIntersectionInterval:()=>WW,_shadersreadDepth:()=>vW,_shadersreadNonPerspective:()=>FW,_shadersreverseLogDepth:()=>IW,_shadersround:()=>YW,_shaderssaturation:()=>MW,_shaderssceneMode2D:()=>cL,_shaderssceneMode3D:()=>lL,_shaderssceneModeColumbusView:()=>dL,_shaderssceneModeMorphing:()=>uL,_shadersshadowDepthCompare:()=>wW,_shadersshadowParameters:()=>ZL,_shadersshadowVisibility:()=>kW,_shaderssignNotZero:()=>UW,_shaderssolarRadius:()=>mL,_shaderssphericalHarmonics:()=>DW,_shaderssrgbToLinear:()=>OW,_shaderstangentToEyeSpaceMatrix:()=>BW,_shaderstextureCube:()=>zW,_shadersthreePiOver2:()=>hL,_shaderstransformPlane:()=>HW,_shaderstranslateRelativeToEye:()=>KW,_shaderstranslucentPhong:()=>JW,_shaderstranspose:()=>jW,_shaderstwoPi:()=>fL,_shadersunpackDepth:()=>QW,_shadersunpackFloat:()=>qW,_shadersunpackTexture:()=>$W,_shadersunpackUint:()=>ev,_shadersvalueTransform:()=>tv,_shadersvertexLogDepth:()=>nv,_shaderswebMercatorMaxLatitude:()=>pL,_shaderswindowToEyeCoordinates:()=>iv,_shaderswriteDepthClamp:()=>ov,_shaderswriteLogDepth:()=>rv,_shaderswriteNonPerspective:()=>sv,addAllToArray:()=>ei,addBuffer:()=>qF,addDefaults:()=>BF,addExtensionsRequired:()=>JF,addExtensionsUsed:()=>Pm,addPipelineExtras:()=>ix,addToArray:()=>ba,appendForwardSlash:()=>JA,arrayRemoveDuplicates:()=>Yo,assert:()=>lQ,barycentricCoordinates:()=>c_,binarySearch:()=>Eo,buildModuleUrl:()=>en,buildVectorGltfFromMVT:()=>GU,buildVoxelCustomShader:()=>mA,buildVoxelDrawCommands:()=>Bk,clone:()=>$e,combine:()=>It,computeFlyToLocationForRectangle:()=>BZ,createBillboardPointCallback:()=>ES,createColorRamp:()=>Rk,createCommand:()=>Fn,createDefaultImageryProviderViewModels:()=>g5,createDefaultTerrainProviderViewModels:()=>y5,createElevationBandMaterial:()=>Uae,createGooglePhotorealistic3DTileset:()=>Dae,createGuid:()=>Qn,createMaterialPropertyDescriptor:()=>sr,createOsmBuildingsAsync:()=>Oae,createPropertyDescriptor:()=>be,createRawPropertyDescriptor:()=>zl,createTangentSpaceDebugPrimitive:()=>Bae,createTaskProcessorWorker:()=>jce,createUniform:()=>cG,createUniformArray:()=>lG,createVectorTileBuffersFromModelComponents:()=>vN,createWorldBathymetryAsync:()=>TU,createWorldImageryAsync:()=>qb,createWorldTerrainAsync:()=>WR,decodeGoogleEarthEnterpriseData:()=>_U,decodeMVT:()=>YU,decodeVectorPolylinePositions:()=>ZN,defaultPickWorldPosition:()=>mp,defer:()=>Cd,defined:()=>l,demodernizeShader:()=>cv,deprecationWarning:()=>Jo,destroyObject:()=>ue,exportKml:()=>mie,findAccessorMinMax:()=>rS,findContentMetadata:()=>YS,findGroupMetadata:()=>MS,findMeshoptExtension:()=>tx,findTileMetadata:()=>kN,forEachTextureInMaterial:()=>K1,formatError:()=>Op,freezeRenderState:()=>$j,getAbsoluteUri:()=>_m,getAccessorByteStride:()=>Yd,getBaseUri:()=>jA,getBinaryAccessor:()=>vm,getClipAndStyleCode:()=>uU,getClippingFunction:()=>zZ,getComponentReader:()=>Ib,getElement:()=>Nn,getExtensionFromUri:()=>eb,getFilenameFromUri:()=>Rg,getImageFromTypedArray:()=>Ck,getImagePixels:()=>Fh,getJsonFromTypedArray:()=>vr,getMagic:()=>ef,getMeshPrimitives:()=>XI,getMetadataClassProperty:()=>tU,getMetadataProperty:()=>iU,getStringFromTypedArray:()=>Pd,getTimestamp:()=>Zn,hasExtension:()=>no,heightReferenceOnEntityPropertyChanged:()=>Cb,isBitSet:()=>Vl,isBlobUri:()=>qT,isCrossOriginUrl:()=>Vy,isDataUri:()=>Ih,isLeapYear:()=>Pl,knockout:()=>Ee,knockout_3_5_1:()=>UR,knockout_es5:()=>a5,loadAndExecuteScript:()=>$T,loadCubeMap:()=>gv,loadImageFromTypedArray:()=>Fb,loadKTX2:()=>Ad,mergeSort:()=>L0,mostDetailedSurfaceHeight:()=>Oh,moveTechniqueRenderStates:()=>KF,moveTechniquesToExtension:()=>jF,numberOfComponentsForType:()=>Gu,objectToQuery:()=>e_,oneTimeWarning:()=>xt,parseBatchTable:()=>Ob,parseFeatureMetadataLegacy:()=>RI,parseGlb:()=>oS,parseResponseHeaders:()=>QA,parseStructuralMetadata:()=>ZI,pickModel:()=>qC,pointInsideTriangle:()=>yae,positionForSurfaceHeight:()=>mb,preprocess3DTileContent:()=>ug,processVoxelProperties:()=>Gk,queryToObject:()=>yu,readAccessorPacked:()=>$F,removeExtension:()=>sS,removeExtensionsRequired:()=>zF,removeExtensionsUsed:()=>iS,removePipelineExtras:()=>HF,removeUnusedElements:()=>QF,renderBufferPointCollection:()=>EN,renderBufferPolygonCollection:()=>bI,renderBufferPolylineCollection:()=>LN,resizeImageToNextPowerOfTwo:()=>sx,sampleTerrain:()=>vw,sampleTerrainMostDetailed:()=>OZ,scaleToGeodeticSurface:()=>QT,srgbToLinear:()=>IR,subdivideArray:()=>q2,subscribeAndEvaluate:()=>Sc,updateAccessorComponentTypes:()=>eI,updateVersion:()=>tI,usesExtension:()=>Dr,viewerCesium3DTilesInspectorMixin:()=>yle,viewerCesiumInspectorMixin:()=>xle,viewerDragDropMixin:()=>_le,viewerPerformanceWatchdogMixin:()=>Sle,viewerVoxelInspectorMixin:()=>Rle,webGLConstantToGlslType:()=>Eae,wrapFunction:()=>AU,writeTextToCanvas:()=>GS});var U0r=x(T(),1);var qOo=x(T(),1);var Tzt=x(T(),1);var O3t=x(T(),1);var X3t=x(T(),1);var G3t=x(T(),1);function BYe(e){return e!=null}var l=BYe;var v3t=x(T(),1);function JT(e){this.name="DeveloperError",this.message=e;let t;try{throw new Error}catch(n){t=n.stack}this.stack=t}l(Object.create)&&(JT.prototype=Object.create(Error.prototype),JT.prototype.constructor=JT);JT.prototype.toString=function(){let e=`${this.name}: ${this.message}`;return l(this.stack)&&(e+=` -${this.stack.toString()}`),e};JT.throwInstantiationError=function(){throw new JT("This function defines an interface and should not be called directly.")};var ge=JT;var ma={};ma.typeOf={};function zYe(e){return`${e} is required, actual value was undefined`}function KR(e,t,n){return`Expected ${n} to be typeof ${t}, actual typeof was ${e}`}ma.defined=function(e,t){if(!l(t))throw new ge(zYe(e))};ma.typeOf.func=function(e,t){if(typeof t!="function")throw new ge(KR(typeof t,"function",e))};ma.typeOf.string=function(e,t){if(typeof t!="string")throw new ge(KR(typeof t,"string",e))};ma.typeOf.number=function(e,t){if(typeof t!="number")throw new ge(KR(typeof t,"number",e))};ma.typeOf.number.lessThan=function(e,t,n){if(ma.typeOf.number(e,t),t>=n)throw new ge(`Expected ${e} to be less than ${n}, actual value was ${t}`)};ma.typeOf.number.lessThanOrEquals=function(e,t,n){if(ma.typeOf.number(e,t),t>n)throw new ge(`Expected ${e} to be less than or equal to ${n}, actual value was ${t}`)};ma.typeOf.number.greaterThan=function(e,t,n){if(ma.typeOf.number(e,t),t<=n)throw new ge(`Expected ${e} to be greater than ${n}, actual value was ${t}`)};ma.typeOf.number.greaterThanOrEquals=function(e,t,n){if(ma.typeOf.number(e,t),t0?1:-1};Tt.signNotZero=function(e){return e<0?-1:1};Tt.toSNorm=function(e,t){return t=t??255,Math.round((Tt.clamp(e,-1,1)*.5+.5)*t)};Tt.fromSNorm=function(e,t){return t=t??255,Tt.clamp(e,0,t)/t*2-1};Tt.normalize=function(e,t,n){return n=Math.max(n-t,0),n===0?0:Tt.clamp((e-t)/n,0,1)};Tt.sinh=Math.sinh??function(t){return(Math.exp(t)-Math.exp(-t))/2};Tt.cosh=Math.cosh??function(t){return(Math.exp(t)+Math.exp(-t))/2};Tt.lerp=function(e,t,n){return(1-n)*e+n*t};Tt.smoothDamp=function(e,t,n,i=0,o=Number.POSITIVE_INFINITY,r=1e-4,s={}){r=Math.max(1e-4,r);let a=2/r,c=a*i,d=1/(1+c+.48*c*c+.235*c*c*c),u=o*r,m=e-t;m=Tt.clamp(m,-u,u);let p=e-m,b=(n+a*m)*i;return n=(n-a*b)*d,s.value=p+(m+b)*d,s.velocity=n,s};Tt.PI=Math.PI;Tt.ONE_OVER_PI=1/Math.PI;Tt.PI_OVER_TWO=Math.PI/2;Tt.PI_OVER_THREE=Math.PI/3;Tt.PI_OVER_FOUR=Math.PI/4;Tt.PI_OVER_SIX=Math.PI/6;Tt.THREE_PI_OVER_TWO=3*Math.PI/2;Tt.TWO_PI=2*Math.PI;Tt.ONE_OVER_TWO_PI=1/(2*Math.PI);Tt.RADIANS_PER_DEGREE=Math.PI/180;Tt.DEGREES_PER_RADIAN=180/Math.PI;Tt.RADIANS_PER_ARCSECOND=Tt.RADIANS_PER_DEGREE/3600;Tt.toRadians=function(e){return e*Tt.RADIANS_PER_DEGREE};Tt.toDegrees=function(e){return e*Tt.DEGREES_PER_RADIAN};Tt.convertLongitudeRange=function(e){let t=Tt.TWO_PI,n=e-Math.floor(e/t)*t;return n<-Math.PI?n+t:n>=Math.PI?n-t:n};Tt.clampToLatitudeRange=function(e){return Tt.clamp(e,-1*Tt.PI_OVER_TWO,Tt.PI_OVER_TWO)};Tt.negativePiToPi=function(e){return e>=-Tt.PI&&e<=Tt.PI?e:Tt.zeroToTwoPi(e+Tt.PI)-Tt.PI};Tt.zeroToTwoPi=function(e){if(e>=0&&e<=Tt.TWO_PI)return e;let t=Tt.mod(e,Tt.TWO_PI);return Math.abs(t)Tt.EPSILON14?Tt.TWO_PI:t};Tt.mod=function(e,t){return Tt.sign(e)===Tt.sign(t)&&Math.abs(e)n};Tt.greaterThanOrEquals=function(e,t,n){return e-t>-n};var tD=[1];Tt.factorial=function(e){let t=tD.length;if(e>=t){let n=tD[t-1];for(let i=t;i<=e;i++){let o=n*i;tD.push(o),n=o}}return tD[e]};Tt.incrementWrap=function(e,t,n){return n=n??0,++e,e>t&&(e=n),e};Tt.isPowerOfTwo=function(e){return e!==0&&(e&e-1)===0};Tt.nextPowerOfTwo=function(e){return--e,e|=e>>1,e|=e>>2,e|=e>>4,e|=e>>8,e|=e>>16,++e,e};Tt.previousPowerOfTwo=function(e){return e|=e>>1,e|=e>>2,e|=e>>4,e|=e>>8,e|=e>>16,e|=e>>32,e=(e>>>0)-(e>>>1),e};Tt.clamp=function(e,t,n){return en?n:e};var Ale=new dj.default;Tt.setRandomNumberSeed=function(e){Ale=new dj.default(e)};Tt.nextRandomNumber=function(){return Ale.random()};Tt.randomBetween=function(e,t){return Tt.nextRandomNumber()*(t-e)+e};Tt.acosClamped=function(e){return Math.acos(Tt.clamp(e,-1,1))};Tt.asinClamped=function(e){return Math.asin(Tt.clamp(e,-1,1))};Tt.chordLength=function(e,t){return 2*t*Math.sin(e*.5)};Tt.logBase=function(e,t){return Math.log(e)/Math.log(t)};Tt.cbrt=Math.cbrt??function(t){let n=Math.pow(Math.abs(t),.3333333333333333);return t<0?-n:n};Tt.log2=Math.log2??function(t){return Math.log(t)*Math.LOG2E};Tt.fog=function(e,t){let n=e*t;return 1-Math.exp(-(n*n))};Tt.fastApproximateAtan=function(e){return e*(-.1784*Math.abs(e)-.0663*e*e+1.0301)};Tt.fastApproximateAtan2=function(e,t){let n,i=Math.abs(e);n=Math.abs(t);let o=Math.max(i,n);n=Math.min(i,n);let r=n/o;return i=Tt.fastApproximateAtan(r),i=Math.abs(t)>Math.abs(e)?Tt.PI_OVER_TWO-i:i,i=e<0?Tt.PI-i:i,i=t<0?-i:i,i};var W=Tt;var br=class e{constructor(t,n,i){this.x=t??0,this.y=n??0,this.z=i??0}static fromSpherical(t,n){l(n)||(n=new e);let i=t.clock,o=t.cone,r=t.magnitude??1,s=r*Math.sin(o);return n.x=s*Math.cos(i),n.y=s*Math.sin(i),n.z=r*Math.cos(o),n}static fromElements(t,n,i,o){return l(o)?(o.x=t,o.y=n,o.z=i,o):new e(t,n,i)}static clone(t,n){if(l(t))return l(n)?(n.x=t.x,n.y=t.y,n.z=t.z,n):new e(t.x,t.y,t.z)}static pack(t,n,i){return i=i??0,n[i++]=t.x,n[i++]=t.y,n[i]=t.z,n}static unpack(t,n,i){return n=n??0,l(i)||(i=new e),i.x=t[n++],i.y=t[n++],i.z=t[n],i}static packArray(t,n){let i=t.length,o=i*3;l(n)?!Array.isArray(n)&&n.length!==o||n.length!==o&&(n.length=o):n=new Array(o);for(let r=0;rd;)rMe(c,rD),e.transpose(rD,Fle),e.multiply(c,rD,c),e.multiply(Fle,c,c),e.multiply(a,rD,a),++r>2&&(++s,r=0);return n}static abs(t,n){return n[0]=Math.abs(t[0]),n[1]=Math.abs(t[1]),n[2]=Math.abs(t[2]),n[3]=Math.abs(t[3]),n[4]=Math.abs(t[4]),n[5]=Math.abs(t[5]),n[6]=Math.abs(t[6]),n[7]=Math.abs(t[7]),n[8]=Math.abs(t[8]),n}static determinant(t){let n=t[0],i=t[3],o=t[6],r=t[1],s=t[4],a=t[7],c=t[2],d=t[5],u=t[8];return n*(s*u-d*a)+r*(d*o-i*u)+c*(i*a-s*o)}static inverse(t,n){let i=t[0],o=t[1],r=t[2],s=t[3],a=t[4],c=t[5],d=t[6],u=t[7],m=t[8],p=e.determinant(t);n[0]=a*m-u*c,n[1]=u*r-o*m,n[2]=o*c-a*r,n[3]=d*c-s*m,n[4]=i*m-d*r,n[5]=s*r-i*c,n[6]=s*u-d*a,n[7]=d*o-i*u,n[8]=i*a-s*o;let b=1/p;return e.multiplyByScalar(n,b,n)}static inverseTranspose(t,n){return e.inverse(e.transpose(t,nMe),n)}static equals(t,n){return t===n||l(t)&&l(n)&&t[0]===n[0]&&t[1]===n[1]&&t[2]===n[2]&&t[3]===n[3]&&t[4]===n[4]&&t[5]===n[5]&&t[6]===n[6]&&t[7]===n[7]&&t[8]===n[8]}static equalsEpsilon(t,n,i){return i=i??0,t===n||l(t)&&l(n)&&Math.abs(t[0]-n[0])<=i&&Math.abs(t[1]-n[1])<=i&&Math.abs(t[2]-n[2])<=i&&Math.abs(t[3]-n[3])<=i&&Math.abs(t[4]-n[4])<=i&&Math.abs(t[5]-n[5])<=i&&Math.abs(t[6]-n[6])<=i&&Math.abs(t[7]-n[7])<=i&&Math.abs(t[8]-n[8])<=i}get length(){return e.packedLength}clone(t){return e.clone(this,t)}equals(t){return e.equals(this,t)}static equalsArray(t,n,i){return t[0]===n[i]&&t[1]===n[i+1]&&t[2]===n[i+2]&&t[3]===n[i+3]&&t[4]===n[i+4]&&t[5]===n[i+5]&&t[6]===n[i+6]&&t[7]===n[i+7]&&t[8]===n[i+8]}equalsEpsilon(t,n){return e.equalsEpsilon(this,t,n)}toString(){return`(${this[0]}, ${this[3]}, ${this[6]}) + `),window.clearInterval(this.noSleepTimer),this.noSleepTimer=null):this.noSleepVideo.pause(),this.enabled=!1}};GYe.exports=ple});var C3t={};Cle(C3t,{AlphaMode:()=>Bp,AlphaPipelineStage:()=>TX,AnchorPointDirect:()=>xP,AnchorPointIndirect:()=>TP,Animation:()=>h5,AnimationViewModel:()=>f5,Appearance:()=>Go,ApproximateTerrainHeights:()=>Pi,ArcGISTiledElevationTerrainProvider:()=>Vse,ArcGisBaseMapType:()=>Cf,ArcGisMapServerImageryProvider:()=>tg,ArcGisMapService:()=>wu,ArcType:()=>un,ArticulationStageType:()=>cl,AssociativeArray:()=>kt,Atmosphere:()=>gS,AtmospherePipelineStage:()=>QP,AttributeCompression:()=>dn,AttributeType:()=>Dt,AutoExposure:()=>Hw,AutomaticUniforms:()=>Q0,Axis:()=>Bi,AxisAlignedBoundingBox:()=>Su,Azure2DImageryProvider:()=>nN,B3dmLoader:()=>XP,B3dmParser:()=>vP,BaseLayerPicker:()=>Z5,BaseLayerPickerViewModel:()=>S5,BatchTable:()=>C_,BatchTableHierarchy:()=>vS,BatchTexture:()=>rd,BatchTexturePipelineStage:()=>_X,Billboard:()=>Mo,BillboardCollection:()=>Cu,BillboardGraphics:()=>el,BillboardLoadState:()=>ks,BillboardTexture:()=>Tb,BillboardVisualizer:()=>eF,BingMapsGeocoderService:()=>Ase,BingMapsImageryProvider:()=>zX,BingMapsStyle:()=>dV,BlendEquation:()=>Gc,BlendFunction:()=>$o,BlendOption:()=>Ni,BlendingState:()=>on,BoundingRectangle:()=>nt,BoundingSphere:()=>me,BoundingSphereState:()=>Wt,BoundingVolumeSemantics:()=>Px,BoxEmitter:()=>Lae,BoxGeometry:()=>Vc,BoxGeometryUpdater:()=>MF,BoxGraphics:()=>I_,BoxOutlineGeometry:()=>tf,BrdfLutGenerator:()=>BM,Buffer:()=>it,BufferLoader:()=>xS,BufferPoint:()=>Xc,BufferPointCollection:()=>jd,BufferPointMaterial:()=>If,BufferPolygon:()=>Ir,BufferPolygonCollection:()=>ka,BufferPolygonMaterial:()=>Xu,BufferPolyline:()=>Ta,BufferPolylineCollection:()=>pl,BufferPolylineMaterial:()=>Nu,BufferPrimitive:()=>ss,BufferPrimitiveCollection:()=>na,BufferPrimitiveMaterial:()=>ed,BufferUsage:()=>Pe,CPUStylingPipelineStage:()=>CX,CallbackPositionProperty:()=>oM,CallbackProperty:()=>nf,Camera:()=>Io,CameraEventAggregator:()=>e9,CameraEventType:()=>ao,CameraFlightPath:()=>KM,Cartesian2:()=>k,Cartesian3:()=>h,Cartesian4:()=>ce,CartesianRectangle:()=>SV,Cartographic:()=>pe,CartographicGeocoderService:()=>Lse,CatmullRomSpline:()=>Wse,Cesium3DContentGroup:()=>DS,Cesium3DTile:()=>ah,Cesium3DTileBatchTable:()=>_f,Cesium3DTileColorBlendMode:()=>Ud,Cesium3DTileContent:()=>Iae,Cesium3DTileContentFactory:()=>nZ,Cesium3DTileContentState:()=>Fo,Cesium3DTileContentType:()=>Va,Cesium3DTileFeature:()=>ia,Cesium3DTileFeatureTable:()=>Tf,Cesium3DTileOptimizationHint:()=>rh,Cesium3DTileOptimizations:()=>kY,Cesium3DTilePass:()=>lr,Cesium3DTilePassState:()=>ph,Cesium3DTilePointFeature:()=>mg,Cesium3DTileRefine:()=>Tr,Cesium3DTileStyle:()=>bg,Cesium3DTileStyleEngine:()=>HY,Cesium3DTileVectorFeature:()=>$S,Cesium3DTilesInspector:()=>y5,Cesium3DTilesInspectorViewModel:()=>g5,Cesium3DTilesTerrainData:()=>_U,Cesium3DTilesTerrainGeometryProcessor:()=>ZA,Cesium3DTilesTerrainProvider:()=>Nse,Cesium3DTilesVoxelProvider:()=>Pae,Cesium3DTileset:()=>Hr,Cesium3DTilesetBaseTraversal:()=>$Y,Cesium3DTilesetCache:()=>OY,Cesium3DTilesetGraphics:()=>k_,Cesium3DTilesetHeatmap:()=>BY,Cesium3DTilesetMetadata:()=>dZ,Cesium3DTilesetMostDetailedTraversal:()=>jY,Cesium3DTilesetSkipTraversal:()=>nM,Cesium3DTilesetStatistics:()=>Xf,Cesium3DTilesetTraversal:()=>Ha,Cesium3DTilesetVisualizer:()=>iM,CesiumInspector:()=>_5,CesiumInspectorViewModel:()=>T5,CesiumTerrainProvider:()=>LR,CesiumWidget:()=>rk,Check:()=>Ko,CheckerboardMaterialProperty:()=>TE,CircleEmitter:()=>PU,CircleGeometry:()=>Dse,CircleOutlineGeometry:()=>Ose,ClassificationModelDrawCommand:()=>wN,ClassificationPipelineStage:()=>SX,ClassificationPrimitive:()=>G1,ClassificationType:()=>ti,ClearCommand:()=>ui,ClippingPlane:()=>ta,ClippingPlaneCollection:()=>_s,ClippingPolygon:()=>EC,ClippingPolygonCollection:()=>vc,Clock:()=>Dh,ClockRange:()=>bs,ClockStep:()=>Do,ClockViewModel:()=>d5,CloudCollection:()=>wae,CloudType:()=>LA,Color:()=>U,ColorBlendMode:()=>ol,ColorGeometryInstanceAttribute:()=>$t,ColorMaterialProperty:()=>Qt,Command:()=>$ce,ComponentDatatype:()=>J,Composite3DTileContent:()=>nY,CompositeEntityCollection:()=>sie,CompositeMaterialProperty:()=>SE,CompositePositionProperty:()=>pc,CompositeProperty:()=>gl,CompressedTextureBuffer:()=>mG,ComputeCommand:()=>bu,ComputeEngine:()=>uG,ConditionsExpression:()=>VY,ConeEmitter:()=>Uae,ConstantPositionProperty:()=>zl,ConstantProperty:()=>mi,ConstantSpline:()=>wP,ContentMetadata:()=>IY,Context:()=>g_,ContextLimits:()=>wt,Controller:()=>Yce,ControllerHost:()=>QM,CoplanarPolygonGeometry:()=>cI,CoplanarPolygonGeometryLibrary:()=>Nb,CoplanarPolygonOutlineGeometry:()=>Ym,CornerType:()=>no,CorrelationGroup:()=>_P,CorridorGeometry:()=>j_,CorridorGeometryLibrary:()=>po,CorridorGeometryUpdater:()=>jF,CorridorGraphics:()=>X_,CorridorOutlineGeometry:()=>JF,Credit:()=>Lt,CreditDisplay:()=>ew,CubeMap:()=>es,CubeMapFace:()=>SG,CubeMapPanorama:()=>JZ,CubicRealPolynomial:()=>l_,CullFace:()=>Ui,CullingVolume:()=>$s,CumulusCloud:()=>hm,CustomDataSource:()=>LF,CustomHeightmapTerrainProvider:()=>Bse,CustomShader:()=>C0,CustomShaderMode:()=>eg,CustomShaderPipelineStage:()=>vX,CustomShaderTranslucencyMode:()=>Zx,CylinderGeometry:()=>QF,CylinderGeometryLibrary:()=>Q_,CylinderGeometryUpdater:()=>$F,CylinderGraphics:()=>N_,CylinderOutlineGeometry:()=>qF,CzmlDataSource:()=>pk,DataSource:()=>ys,DataSourceClock:()=>Kf,DataSourceCollection:()=>g2,DataSourceDisplay:()=>yM,DebugAppearance:()=>Hae,DebugCameraPrimitive:()=>y0,DebugInspector:()=>m9,DebugModelMatrixPrimitive:()=>YU,DefaultProxy:()=>Hse,DepthFunction:()=>sc,DepthPlane:()=>sw,DequantizationPipelineStage:()=>IX,DerivedCommand:()=>kf,DeveloperError:()=>ge,DeviceOrientationCameraController:()=>aw,DirectionalLight:()=>Qae,DiscardEmptyTileImagePolicy:()=>uV,DiscardMissingTileImagePolicy:()=>OX,DistanceDisplayCondition:()=>Bt,DistanceDisplayConditionGeometryInstanceAttribute:()=>ii,DoubleEndedPriorityQueue:()=>Bg,DoublyLinkedList:()=>DY,DracoLoader:()=>Bb,DrawCommand:()=>lt,DynamicAtmosphereLightingType:()=>wb,DynamicEnvironmentMapManager:()=>kb,DynamicGeometryBatch:()=>B_,DynamicGeometryUpdater:()=>Li,EarthOrientationParameters:()=>iG,EarthOrientationParametersSample:()=>Zy,EasingFunction:()=>As,EdgeDetectionPipelineStage:()=>XX,EdgeDisplayMode:()=>Bm,EdgeFramebuffer:()=>hw,EdgeVisibilityPipelineStage:()=>MX,EllipseGeometry:()=>$l,EllipseGeometryLibrary:()=>Pd,EllipseGeometryUpdater:()=>eI,EllipseGraphics:()=>Y_,EllipseOutlineGeometry:()=>Lu,Ellipsoid:()=>ne,EllipsoidGeodesic:()=>mb,EllipsoidGeometry:()=>Ma,EllipsoidGeometryUpdater:()=>nI,EllipsoidGraphics:()=>M_,EllipsoidOutlineGeometry:()=>Wu,EllipsoidPrimitive:()=>wM,EllipsoidRhumbLine:()=>Ac,EllipsoidSurfaceAppearance:()=>qae,EllipsoidTangentPlane:()=>ws,EllipsoidTerrainProvider:()=>h0,EllipsoidalOccluder:()=>Hh,Empty3DTileContent:()=>o0,EncodedCartesian3:()=>An,Entity:()=>er,EntityCluster:()=>Eu,EntityCollection:()=>Ya,EntityView:()=>TM,EquirectangularPanorama:()=>$ae,Event:()=>Se,EventHelper:()=>kr,Expression:()=>$m,ExpressionNodeType:()=>Pt,ExtrapolationType:()=>dd,FeatureDetection:()=>fn,FeatureIdPipelineStage:()=>Sx,Fog:()=>cw,ForEach:()=>we,FrameRateMonitor:()=>UU,FrameState:()=>Ox,Framebuffer:()=>fs,FramebufferManager:()=>li,Frozen:()=>B,FrustumCommands:()=>pw,FrustumGeometry:()=>SZ,FrustumOutlineGeometry:()=>iw,Fullscreen:()=>qr,FullscreenButton:()=>W5,FullscreenButtonViewModel:()=>L5,GaussianSplat3DTileContent:()=>wx,GaussianSplatPrimitive:()=>FY,GaussianSplatRenderResources:()=>LY,GaussianSplatSorter:()=>eZ,GaussianSplatTextureGenerator:()=>GY,GeoJsonDataSource:()=>ET,GeoJsonLoader:()=>NP,GeoJsonPrimitive:()=>ice,GeocodeType:()=>NT,Geocoder:()=>E5,GeocoderService:()=>VA,GeocoderViewModel:()=>V5,GeographicProjection:()=>ki,GeographicTilingScheme:()=>eo,Geometry:()=>At,Geometry3DTileContent:()=>oY,GeometryAttribute:()=>Xe,GeometryAttributes:()=>Rn,GeometryFactory:()=>Kse,GeometryInstance:()=>Yt,GeometryInstanceAttribute:()=>jc,GeometryOffsetAttribute:()=>bn,GeometryPipeline:()=>Bn,GeometryPipelineStage:()=>DX,GeometryType:()=>_m,GeometryUpdater:()=>Wi,GeometryUpdaterSet:()=>mS,GeometryVisualizer:()=>LI,GetFeatureInfoFormat:()=>Vf,Globe:()=>XM,GlobeDepth:()=>bw,GlobeSurfaceShaderSet:()=>CM,GlobeSurfaceTile:()=>hh,GlobeSurfaceTileProvider:()=>EM,GlobeTranslucency:()=>AM,GlobeTranslucencyFramebuffer:()=>gw,GlobeTranslucencyState:()=>lw,GltfBufferViewLoader:()=>IC,GltfDracoLoader:()=>PC,GltfGpmLoader:()=>ZP,GltfGpmLocal:()=>BC,GltfImageLoader:()=>XC,GltfIndexBufferLoader:()=>NC,GltfJsonLoader:()=>MC,GltfLoader:()=>Mu,GltfLoaderUtil:()=>Md,GltfMeshPrimitiveGpmLoader:()=>EP,GltfSpzLoader:()=>dP,GltfStructuralMetadataLoader:()=>gP,GltfTextureLoader:()=>wC,GltfVertexBufferLoader:()=>kC,Google2DImageryProvider:()=>tN,GoogleEarthEnterpriseImageryProvider:()=>rce,GoogleEarthEnterpriseMapsProvider:()=>JX,GoogleEarthEnterpriseMetadata:()=>hy,GoogleEarthEnterpriseTerrainData:()=>EA,GoogleEarthEnterpriseTerrainProvider:()=>tae,GoogleEarthEnterpriseTileInformation:()=>CU,GoogleGeocoderService:()=>iae,GoogleMaps:()=>Ra,GoogleStreetViewCubeMapPanoramaProvider:()=>sce,GpxDataSource:()=>aU,GregorianDate:()=>vh,GridImageryProvider:()=>ace,GridMaterialProperty:()=>RE,GroundGeometryUpdater:()=>ri,GroundPolylineGeometry:()=>__,GroundPolylinePrimitive:()=>Oh,GroundPrimitive:()=>Bl,GroupMetadata:()=>DV,HeadingPitchRange:()=>Am,HeadingPitchRoll:()=>Cc,Heap:()=>$A,HeightReference:()=>He,HeightmapEncoding:()=>uh,HeightmapTerrainData:()=>Yc,HeightmapTessellator:()=>jV,HermitePolynomialApproximation:()=>sk,HermiteSpline:()=>Tx,HilbertOrder:()=>EV,HomeButton:()=>G5,HomeButtonViewModel:()=>A5,HorizontalOrigin:()=>Di,HybridScreenSpacePanCameraController:()=>Dce,I3SBuildingSceneLayerExplorer:()=>cle,I3SBuildingSceneLayerExplorerViewModel:()=>v5,I3SDataProvider:()=>up,I3SDecoder:()=>DU,I3SFeature:()=>OU,I3SField:()=>BU,I3SGeometry:()=>FA,I3SLayer:()=>kR,I3SNode:()=>IA,I3SStatistics:()=>KU,I3SSublayer:()=>jU,I3SSymbology:()=>HU,I3dmLoader:()=>MP,I3dmParser:()=>YP,ITwinData:()=>uce,ITwinPlatform:()=>la,Iau2000Orientation:()=>YM,Iau2006XysData:()=>oG,Iau2006XysSample:()=>r_,IauOrientationAxes:()=>MM,IauOrientationParameters:()=>NM,ImageBasedLighting:()=>WS,ImageBasedLightingPipelineStage:()=>$P,ImageMaterialProperty:()=>Hy,Imagery:()=>TV,ImageryConfiguration:()=>jN,ImageryCoverage:()=>ZV,ImageryFlags:()=>iN,ImageryInput:()=>rN,ImageryLayer:()=>Cs,ImageryLayerCollection:()=>uZ,ImageryLayerFeatureInfo:()=>Rf,ImageryPipelineStage:()=>sN,ImageryProvider:()=>ku,ImageryState:()=>Dn,Implicit3DTileContent:()=>vV,ImplicitAvailabilityBitstream:()=>GV,ImplicitMetadataView:()=>LV,ImplicitSubdivisionScheme:()=>Os,ImplicitSubtree:()=>ug,ImplicitSubtreeCache:()=>FU,ImplicitSubtreeMetadata:()=>sY,ImplicitTileCoordinates:()=>a0,ImplicitTileset:()=>s0,IndexDatatype:()=>Oe,InfoBox:()=>I5,InfoBoxViewModel:()=>F5,InspectorShared:()=>fu,InstanceAttributeSemantic:()=>Xr,InstancingPipelineStage:()=>bX,InterpolationAlgorithm:()=>rae,InterpolationType:()=>ff,Intersect:()=>qt,IntersectionTests:()=>xi,Intersections2D:()=>sp,Interval:()=>Ns,InvertClassification:()=>aE,Ion:()=>Bd,IonGeocodeProviderType:()=>fy,IonGeocoderService:()=>FR,IonImageryProvider:()=>sd,IonImageryProviderFactory:()=>yV,IonResource:()=>zr,IonSnapGeometryType:()=>cae,IonSnapHeat:()=>lae,IonSnapMode:()=>EU,IonSnapParentGeometryType:()=>dae,IonSnapService:()=>uae,IonWorldImageryStyle:()=>ig,Iso8601:()=>ot,JobScheduler:()=>dw,JobType:()=>Ic,JsonMetadataTable:()=>Db,JulianDate:()=>Q,KTX2Transcoder:()=>hG,KeyboardEventModifier:()=>nr,KeyframeNode:()=>Bo,KmlCamera:()=>cU,KmlDataSource:()=>VR,KmlLookAt:()=>lU,KmlTour:()=>dU,KmlTourFlyTo:()=>uU,KmlTourWait:()=>mU,Label:()=>By,LabelCollection:()=>Xp,LabelGraphics:()=>qh,LabelStyle:()=>yr,LabelVisualizer:()=>WI,LagrangePolynomialApproximation:()=>ak,LeapSecond:()=>To,Light:()=>mce,LightingModel:()=>$p,LightingPipelineStage:()=>cN,LinearApproximation:()=>Kx,LinearSpline:()=>xx,MVTDataProvider:()=>pce,ManagedArray:()=>cd,MapMode2D:()=>md,MapProjection:()=>hae,MapboxImageryProvider:()=>jX,MapboxStyleImageryProvider:()=>hce,MappedPositions:()=>oN,Material:()=>to,MaterialAppearance:()=>Co,MaterialPipelineStage:()=>mN,MaterialProperty:()=>xr,Math:()=>W,Matrix2:()=>Ji,Matrix3:()=>q,Matrix4:()=>P,Megatexture:()=>w9,MeshPrimitiveGpmLocal:()=>VP,MetadataClass:()=>gf,MetadataClassProperty:()=>zp,MetadataComponentType:()=>Nt,MetadataEntity:()=>Jn,MetadataEnum:()=>hP,MetadataEnumValue:()=>mP,MetadataPicking:()=>uw,MetadataPickingPipelineStage:()=>Ou,MetadataPipelineStage:()=>jm,MetadataSchema:()=>nd,MetadataSchemaLoader:()=>px,MetadataSemantic:()=>eh,MetadataTable:()=>zm,MetadataTableProperty:()=>KI,MetadataType:()=>St,MipmapHint:()=>Rm,Model:()=>Bu,Model3DTileContent:()=>Hu,ModelAlphaOptions:()=>wS,ModelAnimation:()=>OP,ModelAnimationChannel:()=>DP,ModelAnimationCollection:()=>BP,ModelAnimationLoop:()=>Dd,ModelAnimationState:()=>Sf,ModelArticulation:()=>tX,ModelArticulationStage:()=>eX,ModelClippingPlanesPipelineStage:()=>oX,ModelClippingPolygonsPipelineStage:()=>aX,ModelColorPipelineStage:()=>_x,ModelComponents:()=>Vn,ModelDrawCommand:()=>kN,ModelDrawCommands:()=>ON,ModelFeature:()=>zP,ModelFeatureTable:()=>HP,ModelGraphics:()=>Cb,ModelImagery:()=>QN,ModelImageryMapping:()=>NS,ModelLightingOptions:()=>NN,ModelMatrixUpdateStage:()=>gX,ModelNode:()=>uX,ModelPrimitiveImagery:()=>YS,ModelReader:()=>Sa,ModelRenderResources:()=>LN,ModelRuntimeNode:()=>xX,ModelRuntimePrimitive:()=>AN,ModelSceneGraph:()=>BN,ModelSilhouettePipelineStage:()=>FN,ModelSkin:()=>GN,ModelSplitterPipelineStage:()=>PN,ModelStatistics:()=>zN,ModelType:()=>Br,ModelUtility:()=>Zt,ModelVectorLookupPipelineStage:()=>dX,ModelVisualizer:()=>eY,Moon:()=>UM,MorphTargetsPipelineStage:()=>fN,MorphWeightSpline:()=>fae,MortonOrder:()=>Bx,MouseButton:()=>qa,Multiple3DTileContent:()=>NY,MultisampleFramebuffer:()=>pv,NavigationHelpButton:()=>X5,NavigationHelpButtonViewModel:()=>P5,NearFarScalar:()=>Kt,NeverTileDiscardPolicy:()=>gce,NodeRenderResources:()=>XN,NodeStatisticsPipelineStage:()=>yX,NodeTransformationProperty:()=>w_,OIT:()=>yw,Occluder:()=>DM,OffsetGeometryInstanceAttribute:()=>Ro,OpenCageGeocoderService:()=>bae,OpenStreetMapImageryProvider:()=>gy,OrderedGroundPrimitiveCollection:()=>$2,OrientedBoundingBox:()=>nn,OrthographicFrustum:()=>yn,OrthographicOffCenterFrustum:()=>ps,Packable:()=>gae,PackableForInterpolation:()=>yae,Panorama:()=>yce,PanoramaProvider:()=>xce,Particle:()=>NA,ParticleBurst:()=>_ce,ParticleEmitter:()=>Sce,ParticleSystem:()=>Zce,Pass:()=>Le,PassState:()=>oc,PathGraphics:()=>Vb,PathMode:()=>c0,PathVisualizer:()=>dM,PeliasGeocoderService:()=>VU,PerInstanceColorAppearance:()=>Tn,PerformanceDisplay:()=>Ig,PerformanceWatchdog:()=>Y5,PerformanceWatchdogViewModel:()=>N5,PerspectiveFrustum:()=>Qi,PerspectiveOffCenterFrustum:()=>ud,PickDepth:()=>mw,PickDepthFramebuffer:()=>Tw,PickFramebuffer:()=>_w,PickId:()=>EG,PickedMetadataInfo:()=>z9,Picking:()=>Aw,PickingPipelineStage:()=>pN,PinBuilder:()=>sy,PixelDatatype:()=>Ue,PixelFormat:()=>Qe,PlanarFillIdFramebuffer:()=>fw,Plane:()=>cn,PlaneGeometry:()=>iI,PlaneGeometryUpdater:()=>rI,PlaneGraphics:()=>SF,PlaneOutlineGeometry:()=>oI,PntsLoader:()=>KN,PntsParser:()=>US,PointCloud:()=>ik,PointCloudEyeDomeLighting:()=>Hb,PointCloudShading:()=>jp,PointCloudStylingPipelineStage:()=>gN,PointGraphics:()=>U_,PointPrimitive:()=>pa,PointPrimitiveCollection:()=>L1,PointVisualizer:()=>mM,PolygonGeometry:()=>kp,PolygonGeometryLibrary:()=>oi,PolygonGeometryUpdater:()=>dI,PolygonGraphics:()=>$h,PolygonHierarchy:()=>Wc,PolygonOutlineGeometry:()=>lI,PolygonPipeline:()=>hi,Polyline:()=>th,PolylineArrowMaterialProperty:()=>VE,PolylineCollection:()=>Wf,PolylineColorAppearance:()=>Ms,PolylineDashMaterialProperty:()=>AE,PolylineGeometry:()=>Lg,PolylineGeometryUpdater:()=>pM,PolylineGlowMaterialProperty:()=>LE,PolylineGraphics:()=>tl,PolylineMaterialAppearance:()=>rc,PolylineOutlineMaterialProperty:()=>pT,PolylinePipeline:()=>io,PolylineVisualizer:()=>gM,PolylineVolumeGeometry:()=>hI,PolylineVolumeGeometryLibrary:()=>of,PolylineVolumeGeometryUpdater:()=>gI,PolylineVolumeGraphics:()=>D_,PolylineVolumeOutlineGeometry:()=>bI,PositionProperty:()=>Qh,PositionPropertyArray:()=>Kg,PostProcessStage:()=>Uo,PostProcessStageCollection:()=>jw,PostProcessStageComposite:()=>nu,PostProcessStageLibrary:()=>$u,PostProcessStageSampleMode:()=>qu,PostProcessStageTextureCache:()=>PZ,PpeMetadata:()=>CP,PpeSource:()=>Jce,PpeTexture:()=>RP,Primitive:()=>In,PrimitiveCollection:()=>Qc,PrimitiveLoadPlan:()=>GS,PrimitiveOutlineGenerator:()=>AS,PrimitiveOutlinePipelineStage:()=>TN,PrimitivePipeline:()=>V_,PrimitiveRenderResources:()=>YN,PrimitiveState:()=>ns,PrimitiveStatisticsPipelineStage:()=>_N,PrimitiveType:()=>Ie,ProjectionPicker:()=>w5,ProjectionPickerViewModel:()=>M5,Property:()=>j,PropertyArray:()=>vE,PropertyAttribute:()=>yS,PropertyAttributeProperty:()=>OI,PropertyBag:()=>Kl,PropertyTable:()=>td,PropertyTexture:()=>Ob,PropertyTextureProperty:()=>DI,ProviderViewModel:()=>mr,Proxy:()=>Tae,QuadraticRealPolynomial:()=>Xl,QuadtreeOccluders:()=>GM,QuadtreePrimitive:()=>PM,QuadtreeTile:()=>LM,QuadtreeTileLoadState:()=>Ja,QuadtreeTileProvider:()=>Cce,QuantizedMeshTerrainData:()=>GR,QuarticRealPolynomial:()=>bG,Quaternion:()=>Ne,QuaternionSpline:()=>UP,Queue:()=>nx,Ray:()=>gn,Rectangle:()=>re,RectangleCollisionChecker:()=>fS,RectangleGeometry:()=>rS,RectangleGeometryLibrary:()=>ga,RectangleGeometryUpdater:()=>xI,RectangleGraphics:()=>ef,RectangleOutlineGeometry:()=>sS,ReferenceFrame:()=>Oi,ReferenceProperty:()=>Ag,RenderState:()=>ze,Renderbuffer:()=>_u,RenderbufferFormat:()=>Ml,Request:()=>Ar,RequestErrorEvent:()=>Sp,RequestScheduler:()=>Hc,RequestState:()=>Ri,RequestType:()=>js,Resource:()=>ve,ResourceCache:()=>Yi,ResourceCacheKey:()=>id,ResourceCacheStatistics:()=>bP,ResourceLoader:()=>oo,ResourceLoaderState:()=>Rt,Rotation:()=>_h,RuntimeError:()=>ae,S2Cell:()=>cg,SDFSettings:()=>Xa,SampledPositionProperty:()=>bc,SampledProperty:()=>ju,Sampler:()=>Ot,ScaledPositionProperty:()=>l0,Scene:()=>K9,SceneFramebuffer:()=>LZ,SceneMode:()=>se,SceneMode2DPipelineStage:()=>SN,SceneModePicker:()=>U5,SceneModePickerViewModel:()=>k5,SceneTransforms:()=>fo,SceneTransitioner:()=>$w,ScreenSpaceCameraController:()=>i9,ScreenSpaceElevatorCameraController:()=>o5,ScreenSpaceEventHandler:()=>oa,ScreenSpaceEventType:()=>mn,ScreenSpaceInputBindings:()=>hp,ScreenSpaceMapCameraController:()=>r5,ScreenSpaceTiltOrbitCameraController:()=>Bce,ScreenSpaceZoomCameraController:()=>Hce,SelectedFeatureIdPipelineStage:()=>Rx,SelectionIndicator:()=>B5,SelectionIndicatorViewModel:()=>O5,SensorVolumePortionToDisplay:()=>PE,ShaderBuilder:()=>lb,ShaderCache:()=>lv,ShaderDestination:()=>fe,ShaderFunction:()=>xv,ShaderProgram:()=>tn,ShaderSource:()=>Je,ShaderStruct:()=>yv,ShadowMap:()=>Ng,ShadowMapShader:()=>Df,ShadowMode:()=>Wn,ShadowVolumeAppearance:()=>Zu,SharedContext:()=>Tv,ShowGeometryInstanceAttribute:()=>vn,Simon1994PlanetaryPositions:()=>Iy,SimplePolylineGeometry:()=>_ae,SingleTileImageryProvider:()=>QX,SkinningPipelineStage:()=>RN,SkyAtmosphere:()=>J9,SkyBox:()=>Q9,SnapFramebuffer:()=>r9,SnapService:()=>Sae,Snapping:()=>a9,SpatialNode:()=>U9,Spdcf:()=>SP,SpecularEnvironmentCubeMap:()=>xf,SphereEmitter:()=>Ece,SphereGeometry:()=>GU,SphereOutlineGeometry:()=>Sg,Spherical:()=>ck,Spline:()=>vo,SplitDirection:()=>Ur,Splitter:()=>bE,StaticGeometryColorBatch:()=>Um,StaticGeometryPerMaterialBatch:()=>Dm,StaticGroundGeometryColorBatch:()=>yC,StaticGroundGeometryPerMaterialBatch:()=>GI,StaticGroundPolylinePerMaterialBatch:()=>bM,StaticOutlineGeometryBatch:()=>_C,StencilConstants:()=>Jt,StencilFunction:()=>ni,StencilOperation:()=>Ft,SteppedSpline:()=>kP,Stereographic:()=>il,StorageType:()=>bx,StripeMaterialProperty:()=>IE,StripeOrientation:()=>Jf,StructuralMetadata:()=>Ua,StyleCommandsNeeded:()=>Zf,StyleExpression:()=>Ace,Sun:()=>ek,SunLight:()=>cb,SunPostProcess:()=>d9,SupportedImageFormats:()=>yP,SvgPathBindingHandler:()=>c5,Sync:()=>_v,TaskProcessor:()=>qn,Terrain:()=>t5,TerrainData:()=>$d,TerrainEncoding:()=>Rr,TerrainFillMesh:()=>eE,TerrainMesh:()=>gc,TerrainOffsetProperty:()=>H_,TerrainPicker:()=>ZM,TerrainProvider:()=>Qo,TerrainQuantization:()=>Ka,TerrainState:()=>wo,Texture:()=>vt,Texture3D:()=>Sv,TextureAtlas:()=>x_,TextureCache:()=>dv,TextureMagnificationFilter:()=>$n,TextureManager:()=>b9,TextureMinificationFilter:()=>Ht,TexturePacker:()=>g1,TextureUniform:()=>y9,TextureWrap:()=>pn,TileAvailability:()=>rp,TileBoundingRegion:()=>Ju,TileBoundingS2Cell:()=>MY,TileBoundingSphere:()=>Zg,TileBoundingVolume:()=>Gce,TileCoordinatesImageryProvider:()=>i5,TileDiscardPolicy:()=>Wce,TileEdge:()=>Gn,TileImagery:()=>_V,TileMapServiceImageryProvider:()=>Cx,TileMetadata:()=>PY,TileOrientedBoundingBox:()=>Qd,TileProviderError:()=>tr,TileReplacementQueue:()=>WM,TileSelectionResult:()=>gi,TileState:()=>vce,Tileset3DTileContent:()=>cY,TilesetMetadata:()=>wY,TilesetPipelineStage:()=>KP,TilingScheme:()=>Rae,TimeConstants:()=>wn,TimeDynamicImagery:()=>XS,TimeDynamicPointCloud:()=>yE,TimeInterval:()=>Cn,TimeIntervalCollection:()=>Es,TimeIntervalCollectionPositionProperty:()=>Gg,TimeIntervalCollectionProperty:()=>Jg,TimeStandard:()=>ci,Timeline:()=>K5,TimelineHighlightRange:()=>z5,TimelineTrack:()=>H5,Tipsify:()=>gG,ToggleButtonViewModel:()=>kT,Tonemapper:()=>wg,TrackingReferenceFrame:()=>Zb,Transforms:()=>_t,TranslationRotationScale:()=>Ky,TranslucentTileClassification:()=>Sw,TridiagonalSystemSolver:()=>qC,TrustedServers:()=>o1,TweenCollection:()=>MZ,UniformState:()=>fv,UniformType:()=>R0,UrlTemplate3DTilesDataProvider:()=>qU,UrlTemplateImageryProvider:()=>Rs,VERSION:()=>R3t,VRButton:()=>j5,VRButtonViewModel:()=>J5,VRTheWorldTerrainProvider:()=>Vae,VaryingType:()=>Kce,Vector3DTileBatch:()=>n0,Vector3DTileClampedPolylines:()=>gY,Vector3DTileContent:()=>xY,Vector3DTileGeometry:()=>ag,Vector3DTilePoints:()=>hY,Vector3DTilePolygons:()=>fY,Vector3DTilePolylines:()=>jS,Vector3DTilePrimitive:()=>zS,VectorGltf3DTileContent:()=>Mx,VectorPipeline:()=>Ss,VectorProvider:()=>gg,VelocityOrientationProperty:()=>dk,VelocityVectorProperty:()=>Wg,VertexArray:()=>Un,VertexArrayFacade:()=>db,VertexAttributeSemantic:()=>dt,VertexFormat:()=>Me,VerticalExaggeration:()=>_o,VerticalExaggerationPipelineStage:()=>VN,VerticalOrigin:()=>zn,VideoSynchronizer:()=>Cae,View:()=>vZ,Viewer:()=>gle,ViewportQuad:()=>Fce,Visibility:()=>Kr,Visualizer:()=>Sse,VoxelBoundsCollection:()=>Dg,VoxelBoxShape:()=>BZ,VoxelCell:()=>h9,VoxelContent:()=>OZ,VoxelCylinderShape:()=>zZ,VoxelEllipsoidShape:()=>HZ,VoxelInspector:()=>q5,VoxelInspectorViewModel:()=>Q5,VoxelMetadataOrder:()=>V0,VoxelPrimitive:()=>uT,VoxelProvider:()=>Pce,VoxelRenderResources:()=>I9,VoxelShape:()=>Xce,VoxelShapeType:()=>Tc,VoxelTraversal:()=>D9,VulkanConstants:()=>Eae,WallGeometry:()=>_I,WallGeometryLibrary:()=>aS,WallGeometryUpdater:()=>RI,WallGraphics:()=>Eb,WallOutlineGeometry:()=>ZI,WebGLConstants:()=>ie,WebMapServiceImageryProvider:()=>$X,WebMapTileServiceImageryProvider:()=>eN,WebMercatorProjection:()=>Ti,WebMercatorTilingScheme:()=>Nr,WindingOrder:()=>Qs,WireframeIndexGenerator:()=>RV,WireframePipelineStage:()=>EN,_shadersAcesTonemappingStage:()=>Gw,_shadersAdditiveBlend:()=>c9,_shadersAdjustTranslucentFS:()=>y1,_shadersAllMaterialAppearanceFS:()=>WF,_shadersAllMaterialAppearanceVS:()=>vF,_shadersAmbientOcclusionGenerate:()=>Lw,_shadersAmbientOcclusionModulate:()=>Ww,_shadersAspectRampMaterial:()=>C2,_shadersAtmosphereCommon:()=>Uh,_shadersAtmosphereStageFS:()=>JP,_shadersAtmosphereStageVS:()=>jP,_shadersBasicMaterialAppearanceFS:()=>FF,_shadersBasicMaterialAppearanceVS:()=>IF,_shadersBillboardCollectionFS:()=>Rv,_shadersBillboardCollectionVS:()=>Cv,_shadersBlackAndWhite:()=>vw,_shadersBloomComposite:()=>Fw,_shadersBrdfLutGeneratorFS:()=>Vv,_shadersBrightPass:()=>l9,_shadersBrightness:()=>Iw,_shadersBufferPointMaterialFS:()=>Ev,_shadersBufferPointMaterialVS:()=>Av,_shadersBufferPolygonMaterialFS:()=>Gv,_shadersBufferPolygonMaterialVS:()=>Lv,_shadersBufferPolylineMaterialFS:()=>Wv,_shadersBufferPolylineMaterialVS:()=>vv,_shadersBumpMapMaterial:()=>V2,_shadersCPUStylingStageFS:()=>RX,_shadersCPUStylingStageVS:()=>ZX,_shadersCheckerboardMaterial:()=>E2,_shadersCloudCollectionFS:()=>Fv,_shadersCloudCollectionVS:()=>Iv,_shadersCloudNoiseFS:()=>Pv,_shadersCloudNoiseVS:()=>Xv,_shadersCompareAndPackTranslucentDepth:()=>Nv,_shadersCompositeOITFS:()=>Yv,_shadersCompositeTranslucentClassification:()=>WZ,_shadersComputeIrradianceFS:()=>Mv,_shadersComputeRadianceMapFS:()=>wv,_shadersConstantLodStageFS:()=>uN,_shadersConstantLodStageVS:()=>dN,_shadersContrastBias:()=>Pw,_shadersConvolveSpecularMapFS:()=>kv,_shadersConvolveSpecularMapVS:()=>Uv,_shadersCubeMapPanoramaVS:()=>Dv,_shadersCustomShaderStageFS:()=>EX,_shadersCustomShaderStageVS:()=>VX,_shadersCzmBuiltins:()=>p_,_shadersDepthOfField:()=>Xw,_shadersDepthPlaneFS:()=>Ov,_shadersDepthPlaneVS:()=>Bv,_shadersDepthView:()=>Nw,_shadersDepthViewPacked:()=>Zse,_shadersDotMaterial:()=>A2,_shadersEdgeDetection:()=>Yw,_shadersEdgeDetectionStageFS:()=>PX,_shadersEdgeVisibilityStageFS:()=>NX,_shadersEdgeVisibilityStageVS:()=>YX,_shadersElevationBandMaterial:()=>G2,_shadersElevationContourMaterial:()=>L2,_shadersElevationRampMaterial:()=>W2,_shadersEllipsoidFS:()=>x1,_shadersEllipsoidSurfaceAppearanceFS:()=>bU,_shadersEllipsoidSurfaceAppearanceVS:()=>gU,_shadersEllipsoidVS:()=>T1,_shadersFXAA:()=>kw,_shadersFXAA3_11:()=>zv,_shadersFadeMaterial:()=>v2,_shadersFeatureIdStageFS:()=>AX,_shadersFeatureIdStageVS:()=>GX,_shadersFilmicTonemapping:()=>Mw,_shadersGaussianBlur1D:()=>cT,_shadersGeometryStageFS:()=>wX,_shadersGeometryStageVS:()=>kX,_shadersGlobeFS:()=>Hv,_shadersGlobeVS:()=>Kv,_shadersGridMaterial:()=>F2,_shadersGroundAtmosphere:()=>_1,_shadersHSBToRGB:()=>cW,_shadersHSLToRGB:()=>lW,_shadersImageBasedLightingStageFS:()=>qP,_shadersInstancingStageCommon:()=>mX,_shadersInstancingStageVS:()=>hX,_shadersIntersectBox:()=>V9,_shadersIntersectCylinder:()=>E9,_shadersIntersectDepth:()=>R9,_shadersIntersectEllipsoid:()=>A9,_shadersIntersectLongitude:()=>hE,_shadersIntersectPlane:()=>C9,_shadersIntersection:()=>DZ,_shadersIntersectionUtils:()=>Z9,_shadersLegacyInstancingStageVS:()=>fX,_shadersLensFlare:()=>Uw,_shadersLightingStageFS:()=>aN,_shadersMaterialStageFS:()=>lN,_shadersMegatexture:()=>F9,_shadersMetadataStageFS:()=>LX,_shadersMetadataStageVS:()=>WX,_shadersModelClippingPlanesStageFS:()=>iX,_shadersModelClippingPolygonsStageFS:()=>rX,_shadersModelClippingPolygonsStageVS:()=>sX,_shadersModelColorStageFS:()=>nX,_shadersModelFS:()=>DN,_shadersModelSilhouetteStageFS:()=>WN,_shadersModelSilhouetteStageVS:()=>vN,_shadersModelSplitterStageFS:()=>IN,_shadersModelVS:()=>UN,_shadersModelVectorLookupStageFS:()=>lX,_shadersModelVectorLookupStageVS:()=>cX,_shadersModifiedReinhardTonemapping:()=>Dw,_shadersMorphTargetsStageVS:()=>hN,_shadersNightVision:()=>Ow,_shadersNormalMapMaterial:()=>I2,_shadersOctree:()=>v9,_shadersPassThrough:()=>tu,_shadersPassThroughDepth:()=>oT,_shadersPbrNeutralTonemapping:()=>ww,_shadersPerInstanceColorAppearanceFS:()=>j2,_shadersPerInstanceColorAppearanceVS:()=>Q2,_shadersPerInstanceFlatColorAppearanceFS:()=>S_,_shadersPerInstanceFlatColorAppearanceVS:()=>q2,_shadersPointCloudEyeDomeLighting:()=>WP,_shadersPointCloudStylingStageVS:()=>bN,_shadersPointPrimitiveCollectionFS:()=>Ny,_shadersPointPrimitiveCollectionVS:()=>Jv,_shadersPolylineArrowMaterial:()=>P2,_shadersPolylineColorAppearanceVS:()=>Z2,_shadersPolylineCommon:()=>Ul,_shadersPolylineDashMaterial:()=>X2,_shadersPolylineFS:()=>T_,_shadersPolylineGlowMaterial:()=>N2,_shadersPolylineMaterialAppearanceVS:()=>R2,_shadersPolylineOutlineMaterial:()=>Y2,_shadersPolylineShadowVolumeFS:()=>jv,_shadersPolylineShadowVolumeMorphFS:()=>Qv,_shadersPolylineShadowVolumeMorphVS:()=>qv,_shadersPolylineShadowVolumeVS:()=>$v,_shadersPolylineVS:()=>e2,_shadersPrimitiveGaussianSplatFS:()=>t2,_shadersPrimitiveGaussianSplatVS:()=>n2,_shadersPrimitiveOutlineStageFS:()=>xN,_shadersPrimitiveOutlineStageVS:()=>yN,_shadersRGBToHSB:()=>PW,_shadersRGBToHSL:()=>XW,_shadersRGBToXYZ:()=>NW,_shadersReinhardTonemapping:()=>Bw,_shadersReprojectWebMercatorFS:()=>i2,_shadersReprojectWebMercatorVS:()=>o2,_shadersRimLightingMaterial:()=>M2,_shadersSelectedFeatureIdStageCommon:()=>aV,_shadersShadowVolumeAppearanceFS:()=>S1,_shadersShadowVolumeAppearanceVS:()=>r2,_shadersShadowVolumeFS:()=>Yy,_shadersSilhouette:()=>zw,_shadersSkinningStageVS:()=>ZN,_shadersSkyAtmosphereCommon:()=>Z1,_shadersSkyAtmosphereFS:()=>s2,_shadersSkyAtmosphereVS:()=>a2,_shadersSkyBoxFS:()=>c2,_shadersSkyBoxVS:()=>l2,_shadersSlopeRampMaterial:()=>w2,_shadersStripeMaterial:()=>k2,_shadersSunFS:()=>d2,_shadersSunTextureFS:()=>u2,_shadersSunVS:()=>m2,_shadersTexturedMaterialAppearanceFS:()=>PF,_shadersTexturedMaterialAppearanceVS:()=>XF,_shadersVector3DTileClampedPolylinesFS:()=>h2,_shadersVector3DTileClampedPolylinesVS:()=>f2,_shadersVector3DTilePolylinesVS:()=>p2,_shadersVectorCommon:()=>ub,_shadersVectorTileVS:()=>R1,_shadersVerticalExaggerationStageVS:()=>CN,_shadersViewportQuadFS:()=>b2,_shadersViewportQuadVS:()=>s_,_shadersVoxelFS:()=>_9,_shadersVoxelUtils:()=>T9,_shadersVoxelVS:()=>S9,_shadersWater:()=>D2,_shadersWaterMaskMaterial:()=>U2,_shadersXYZToRGB:()=>av,_shadersacesTonemapping:()=>RL,_shadersalphaWeight:()=>CL,_shadersantialias:()=>VL,_shadersapplyHSBShift:()=>EL,_shadersapproximateSphericalCoordinates:()=>AL,_shadersapproximateTanh:()=>GL,_shadersbackFacing:()=>LL,_shadersbranchFreeTernary:()=>WL,_shaderscascadeColor:()=>vL,_shaderscascadeDistance:()=>FL,_shaderscascadeMatrix:()=>IL,_shaderscascadeWeights:()=>PL,_shaderscolumbusViewMorph:()=>XL,_shaderscomputeAtmosphereColor:()=>NL,_shaderscomputeGroundAtmosphereScattering:()=>YL,_shaderscomputePosition:()=>ML,_shaderscomputeScattering:()=>wL,_shaderscomputeTextureTransform:()=>kL,_shadersconvertLocalToBoxUv:()=>G9,_shadersconvertLocalToCylinderUv:()=>L9,_shadersconvertLocalToEllipsoidUv:()=>W9,_shaderscosineAndSine:()=>UL,_shadersdecodeRGB8:()=>DL,_shadersdecompressTextureCoordinates:()=>OL,_shadersdegreesPerRadian:()=>AG,_shadersdepthClamp:()=>BL,_shadersdepthRange:()=>GG,_shadersdepthRangeStruct:()=>bL,_shaderseastNorthUpToEyeCoordinates:()=>zL,_shadersellipsoidContainsPoint:()=>HL,_shadersellipsoidTextureCoordinates:()=>KL,_shadersepsilon1:()=>LG,_shadersepsilon2:()=>WG,_shadersepsilon3:()=>vG,_shadersepsilon4:()=>FG,_shadersepsilon5:()=>IG,_shadersepsilon6:()=>PG,_shadersepsilon7:()=>XG,_shadersequalsEpsilon:()=>JL,_shaderseyeOffset:()=>jL,_shaderseyeToCartographicDelta:()=>QL,_shaderseyeToWindowCoordinates:()=>qL,_shadersfastApproximateAtan:()=>$L,_shadersfog:()=>eW,_shadersgammaCorrect:()=>tW,_shadersgeodeticSurfaceNormal:()=>nW,_shadersgetDefaultMaterial:()=>iW,_shadersgetDynamicAtmosphereLightDirection:()=>oW,_shadersgetLambertDiffuse:()=>rW,_shadersgetSpecular:()=>sW,_shadersgetWaterNoise:()=>aW,_shadershue:()=>dW,_shadersinfinity:()=>NG,_shadersinverseGamma:()=>uW,_shadersisEmpty:()=>mW,_shadersisFull:()=>hW,_shaderslatitudeToWebMercatorFraction:()=>fW,_shaderslineDistance:()=>bW,_shaderslinearToSrgb:()=>pW,_shadersluminance:()=>gW,_shadersmaterial:()=>gL,_shadersmaterialInput:()=>yL,_shadersmaximumComponent:()=>yW,_shadersmetersPerPixel:()=>xW,_shadersmodelMaterial:()=>xL,_shadersmodelToWindowCoordinates:()=>TW,_shadersmodelVertexOutput:()=>TL,_shadersmultiplyWithColorBalance:()=>_W,_shadersnearFarScalar:()=>SW,_shadersoctDecode:()=>ZW,_shadersoneOverPi:()=>YG,_shadersoneOverTwoPi:()=>MG,_shaderspackDepth:()=>RW,_shaderspassCesium3DTile:()=>wG,_shaderspassCesium3DTileClassification:()=>kG,_shaderspassCesium3DTileClassificationIgnoreShow:()=>UG,_shaderspassCesium3DTileEdges:()=>DG,_shaderspassCesium3DTileEdgesDirect:()=>OG,_shaderspassCesium3DTilePlanarFillId:()=>BG,_shaderspassClassification:()=>zG,_shaderspassCompute:()=>HG,_shaderspassEnvironment:()=>KG,_shaderspassGaussianSplats:()=>JG,_shaderspassGlobe:()=>jG,_shaderspassOpaque:()=>QG,_shaderspassOverlay:()=>qG,_shaderspassTerrainClassification:()=>$G,_shaderspassTranslucent:()=>eL,_shaderspassVoxels:()=>tL,_shaderspbrLighting:()=>CW,_shaderspbrNeutralTonemapping:()=>VW,_shadersphong:()=>EW,_shaderspi:()=>nL,_shaderspiOverFour:()=>iL,_shaderspiOverSix:()=>oL,_shaderspiOverThree:()=>rL,_shaderspiOverTwo:()=>sL,_shadersplaneDistance:()=>AW,_shaderspointAlongRay:()=>GW,_shadersradiansPerDegree:()=>aL,_shadersray:()=>_L,_shadersrayEllipsoidIntersectionInterval:()=>LW,_shadersraySegment:()=>SL,_shadersraySphereIntersectionInterval:()=>WW,_shadersreadDepth:()=>vW,_shadersreadNonPerspective:()=>FW,_shadersreverseLogDepth:()=>IW,_shadersround:()=>YW,_shaderssaturation:()=>MW,_shaderssceneMode2D:()=>cL,_shaderssceneMode3D:()=>lL,_shaderssceneModeColumbusView:()=>dL,_shaderssceneModeMorphing:()=>uL,_shadersshadowDepthCompare:()=>wW,_shadersshadowParameters:()=>ZL,_shadersshadowVisibility:()=>kW,_shaderssignNotZero:()=>UW,_shaderssolarRadius:()=>mL,_shaderssphericalHarmonics:()=>DW,_shaderssrgbToLinear:()=>OW,_shaderstangentToEyeSpaceMatrix:()=>BW,_shaderstextureCube:()=>zW,_shadersthreePiOver2:()=>hL,_shaderstransformPlane:()=>HW,_shaderstranslateRelativeToEye:()=>KW,_shaderstranslucentPhong:()=>JW,_shaderstranspose:()=>jW,_shaderstwoPi:()=>fL,_shadersunpackDepth:()=>QW,_shadersunpackFloat:()=>qW,_shadersunpackTexture:()=>$W,_shadersunpackUint:()=>ev,_shadersvalueTransform:()=>tv,_shadersvertexLogDepth:()=>nv,_shaderswebMercatorMaxLatitude:()=>pL,_shaderswindowToEyeCoordinates:()=>iv,_shaderswriteDepthClamp:()=>ov,_shaderswriteLogDepth:()=>rv,_shaderswriteNonPerspective:()=>sv,addAllToArray:()=>ei,addBuffer:()=>sP,addDefaults:()=>$I,addExtensionsRequired:()=>iP,addExtensionsUsed:()=>Hm,addPipelineExtras:()=>hx,addToArray:()=>_a,appendForwardSlash:()=>JA,arrayRemoveDuplicates:()=>Yo,assert:()=>lQ,barycentricCoordinates:()=>c_,binarySearch:()=>Eo,buildModuleUrl:()=>en,buildVectorGltfFromMVT:()=>WU,buildVoxelCustomShader:()=>mE,buildVoxelDrawCommands:()=>P9,clone:()=>$e,combine:()=>It,computeFlyToLocationForRectangle:()=>yZ,createBillboardPointCallback:()=>JS,createColorRamp:()=>f9,createCommand:()=>Fn,createDefaultImageryProviderViewModels:()=>R5,createDefaultTerrainProviderViewModels:()=>C5,createElevationBandMaterial:()=>Dae,createGooglePhotorealistic3DTileset:()=>Oae,createGuid:()=>Qn,createMaterialPropertyDescriptor:()=>sr,createOsmBuildingsAsync:()=>Bae,createPropertyDescriptor:()=>be,createRawPropertyDescriptor:()=>Hl,createTangentSpaceDebugPrimitive:()=>zae,createTaskProcessorWorker:()=>jce,createUniform:()=>cG,createUniformArray:()=>lG,createVectorTileBuffersFromModelComponents:()=>EY,createWorldBathymetryAsync:()=>SU,createWorldImageryAsync:()=>og,createWorldTerrainAsync:()=>WR,decodeGoogleEarthEnterpriseData:()=>ZU,decodeMVT:()=>wU,decodeVectorPolylinePositions:()=>yY,defaultPickWorldPosition:()=>mp,defer:()=>Cd,defined:()=>l,demodernizeShader:()=>cv,deprecationWarning:()=>Jo,destroyObject:()=>ue,exportKml:()=>Vre,findAccessorMinMax:()=>CS,findContentMetadata:()=>iZ,findGroupMetadata:()=>oZ,findMeshoptExtension:()=>ux,findTileMetadata:()=>XY,forEachTextureInMaterial:()=>YC,formatError:()=>Wp,freezeRenderState:()=>$j,getAbsoluteUri:()=>Tm,getAccessorByteStride:()=>Yd,getBaseUri:()=>jA,getBinaryAccessor:()=>Jm,getClipAndStyleCode:()=>tk,getClippingFunction:()=>xZ,getComponentReader:()=>Ub,getElement:()=>Nn,getExtensionFromUri:()=>eb,getFilenameFromUri:()=>zg,getImageFromTypedArray:()=>p9,getImagePixels:()=>Fh,getJsonFromTypedArray:()=>Pr,getMagic:()=>bf,getMeshPrimitives:()=>AP,getMetadataClassProperty:()=>B9,getMetadataProperty:()=>H9,getStringFromTypedArray:()=>wd,getTimestamp:()=>Zn,hasExtension:()=>ro,heightReferenceOnEntityPropertyChanged:()=>Ab,isBitSet:()=>Vl,isBlobUri:()=>qT,isCrossOriginUrl:()=>Vy,isDataUri:()=>Ih,isLeapYear:()=>Pl,knockout:()=>Ee,knockout_3_5_1:()=>UR,knockout_es5:()=>a5,loadAndExecuteScript:()=>$T,loadCubeMap:()=>gv,loadImageFromTypedArray:()=>zb,loadKTX2:()=>Ad,mergeSort:()=>p0,mostDetailedSurfaceHeight:()=>zh,moveTechniqueRenderStates:()=>nP,moveTechniquesToExtension:()=>oP,numberOfComponentsForType:()=>Yu,objectToQuery:()=>e_,oneTimeWarning:()=>xt,parseBatchTable:()=>jb,parseFeatureMetadataLegacy:()=>QI,parseGlb:()=>RS,parseResponseHeaders:()=>QA,parseStructuralMetadata:()=>jI,pickModel:()=>VV,pointInsideTriangle:()=>xae,positionForSurfaceHeight:()=>xb,preprocess3DTileContent:()=>_g,processVoxelProperties:()=>x9,queryToObject:()=>yu,readAccessorPacked:()=>aP,removeExtension:()=>VS,removeExtensionsRequired:()=>eP,removeExtensionsUsed:()=>ZS,removePipelineExtras:()=>tP,removeUnusedElements:()=>rP,renderBufferPointCollection:()=>SY,renderBufferPolygonCollection:()=>MI,renderBufferPolylineCollection:()=>CY,resizeImageToNextPowerOfTwo:()=>fx,sampleTerrain:()=>_M,sampleTerrainMostDetailed:()=>gZ,scaleToGeodeticSurface:()=>QT,srgbToLinear:()=>IR,subdivideArray:()=>B2,subscribeAndEvaluate:()=>Sc,updateAccessorComponentTypes:()=>cP,updateVersion:()=>lP,usesExtension:()=>Or,viewerCesium3DTilesInspectorMixin:()=>yle,viewerCesiumInspectorMixin:()=>xle,viewerDragDropMixin:()=>_le,viewerPerformanceWatchdogMixin:()=>Sle,viewerVoxelInspectorMixin:()=>Rle,webGLConstantToGlslType:()=>Aae,wrapFunction:()=>LU,writeTextToCanvas:()=>F_});var D0r=x(T(),1);var $Oo=x(T(),1);var _zt=x(T(),1);var B3t=x(T(),1);var N3t=x(T(),1);var L3t=x(T(),1);function zYe(e){return e!=null}var l=zYe;var F3t=x(T(),1);function JT(e){this.name="DeveloperError",this.message=e;let t;try{throw new Error}catch(n){t=n.stack}this.stack=t}l(Object.create)&&(JT.prototype=Object.create(Error.prototype),JT.prototype.constructor=JT);JT.prototype.toString=function(){let e=`${this.name}: ${this.message}`;return l(this.stack)&&(e+=` +${this.stack.toString()}`),e};JT.throwInstantiationError=function(){throw new JT("This function defines an interface and should not be called directly.")};var ge=JT;var ma={};ma.typeOf={};function HYe(e){return`${e} is required, actual value was undefined`}function KR(e,t,n){return`Expected ${n} to be typeof ${t}, actual typeof was ${e}`}ma.defined=function(e,t){if(!l(t))throw new ge(HYe(e))};ma.typeOf.func=function(e,t){if(typeof t!="function")throw new ge(KR(typeof t,"function",e))};ma.typeOf.string=function(e,t){if(typeof t!="string")throw new ge(KR(typeof t,"string",e))};ma.typeOf.number=function(e,t){if(typeof t!="number")throw new ge(KR(typeof t,"number",e))};ma.typeOf.number.lessThan=function(e,t,n){if(ma.typeOf.number(e,t),t>=n)throw new ge(`Expected ${e} to be less than ${n}, actual value was ${t}`)};ma.typeOf.number.lessThanOrEquals=function(e,t,n){if(ma.typeOf.number(e,t),t>n)throw new ge(`Expected ${e} to be less than or equal to ${n}, actual value was ${t}`)};ma.typeOf.number.greaterThan=function(e,t,n){if(ma.typeOf.number(e,t),t<=n)throw new ge(`Expected ${e} to be greater than ${n}, actual value was ${t}`)};ma.typeOf.number.greaterThanOrEquals=function(e,t,n){if(ma.typeOf.number(e,t),t0?1:-1};Tt.signNotZero=function(e){return e<0?-1:1};Tt.toSNorm=function(e,t){return t=t??255,Math.round((Tt.clamp(e,-1,1)*.5+.5)*t)};Tt.fromSNorm=function(e,t){return t=t??255,Tt.clamp(e,0,t)/t*2-1};Tt.normalize=function(e,t,n){return n=Math.max(n-t,0),n===0?0:Tt.clamp((e-t)/n,0,1)};Tt.sinh=Math.sinh??function(t){return(Math.exp(t)-Math.exp(-t))/2};Tt.cosh=Math.cosh??function(t){return(Math.exp(t)+Math.exp(-t))/2};Tt.lerp=function(e,t,n){return(1-n)*e+n*t};Tt.smoothDamp=function(e,t,n,i=0,o=Number.POSITIVE_INFINITY,r=1e-4,s={}){r=Math.max(1e-4,r);let a=2/r,c=a*i,d=1/(1+c+.48*c*c+.235*c*c*c),u=o*r,m=e-t;m=Tt.clamp(m,-u,u);let p=e-m,b=(n+a*m)*i;return n=(n-a*b)*d,s.value=p+(m+b)*d,s.velocity=n,s};Tt.PI=Math.PI;Tt.ONE_OVER_PI=1/Math.PI;Tt.PI_OVER_TWO=Math.PI/2;Tt.PI_OVER_THREE=Math.PI/3;Tt.PI_OVER_FOUR=Math.PI/4;Tt.PI_OVER_SIX=Math.PI/6;Tt.THREE_PI_OVER_TWO=3*Math.PI/2;Tt.TWO_PI=2*Math.PI;Tt.ONE_OVER_TWO_PI=1/(2*Math.PI);Tt.RADIANS_PER_DEGREE=Math.PI/180;Tt.DEGREES_PER_RADIAN=180/Math.PI;Tt.RADIANS_PER_ARCSECOND=Tt.RADIANS_PER_DEGREE/3600;Tt.toRadians=function(e){return e*Tt.RADIANS_PER_DEGREE};Tt.toDegrees=function(e){return e*Tt.DEGREES_PER_RADIAN};Tt.convertLongitudeRange=function(e){let t=Tt.TWO_PI,n=e-Math.floor(e/t)*t;return n<-Math.PI?n+t:n>=Math.PI?n-t:n};Tt.clampToLatitudeRange=function(e){return Tt.clamp(e,-1*Tt.PI_OVER_TWO,Tt.PI_OVER_TWO)};Tt.negativePiToPi=function(e){return e>=-Tt.PI&&e<=Tt.PI?e:Tt.zeroToTwoPi(e+Tt.PI)-Tt.PI};Tt.zeroToTwoPi=function(e){if(e>=0&&e<=Tt.TWO_PI)return e;let t=Tt.mod(e,Tt.TWO_PI);return Math.abs(t)Tt.EPSILON14?Tt.TWO_PI:t};Tt.mod=function(e,t){return Tt.sign(e)===Tt.sign(t)&&Math.abs(e)n};Tt.greaterThanOrEquals=function(e,t,n){return e-t>-n};var tD=[1];Tt.factorial=function(e){let t=tD.length;if(e>=t){let n=tD[t-1];for(let i=t;i<=e;i++){let o=n*i;tD.push(o),n=o}}return tD[e]};Tt.incrementWrap=function(e,t,n){return n=n??0,++e,e>t&&(e=n),e};Tt.isPowerOfTwo=function(e){return e!==0&&(e&e-1)===0};Tt.nextPowerOfTwo=function(e){return--e,e|=e>>1,e|=e>>2,e|=e>>4,e|=e>>8,e|=e>>16,++e,e};Tt.previousPowerOfTwo=function(e){return e|=e>>1,e|=e>>2,e|=e>>4,e|=e>>8,e|=e>>16,e|=e>>32,e=(e>>>0)-(e>>>1),e};Tt.clamp=function(e,t,n){return en?n:e};var Ale=new dj.default;Tt.setRandomNumberSeed=function(e){Ale=new dj.default(e)};Tt.nextRandomNumber=function(){return Ale.random()};Tt.randomBetween=function(e,t){return Tt.nextRandomNumber()*(t-e)+e};Tt.acosClamped=function(e){return Math.acos(Tt.clamp(e,-1,1))};Tt.asinClamped=function(e){return Math.asin(Tt.clamp(e,-1,1))};Tt.chordLength=function(e,t){return 2*t*Math.sin(e*.5)};Tt.logBase=function(e,t){return Math.log(e)/Math.log(t)};Tt.cbrt=Math.cbrt??function(t){let n=Math.pow(Math.abs(t),.3333333333333333);return t<0?-n:n};Tt.log2=Math.log2??function(t){return Math.log(t)*Math.LOG2E};Tt.fog=function(e,t){let n=e*t;return 1-Math.exp(-(n*n))};Tt.fastApproximateAtan=function(e){return e*(-.1784*Math.abs(e)-.0663*e*e+1.0301)};Tt.fastApproximateAtan2=function(e,t){let n,i=Math.abs(e);n=Math.abs(t);let o=Math.max(i,n);n=Math.min(i,n);let r=n/o;return i=Tt.fastApproximateAtan(r),i=Math.abs(t)>Math.abs(e)?Tt.PI_OVER_TWO-i:i,i=e<0?Tt.PI-i:i,i=t<0?-i:i,i};var W=Tt;var br=class e{constructor(t,n,i){this.x=t??0,this.y=n??0,this.z=i??0}static fromSpherical(t,n){l(n)||(n=new e);let i=t.clock,o=t.cone,r=t.magnitude??1,s=r*Math.sin(o);return n.x=s*Math.cos(i),n.y=s*Math.sin(i),n.z=r*Math.cos(o),n}static fromElements(t,n,i,o){return l(o)?(o.x=t,o.y=n,o.z=i,o):new e(t,n,i)}static clone(t,n){if(l(t))return l(n)?(n.x=t.x,n.y=t.y,n.z=t.z,n):new e(t.x,t.y,t.z)}static pack(t,n,i){return i=i??0,n[i++]=t.x,n[i++]=t.y,n[i]=t.z,n}static unpack(t,n,i){return n=n??0,l(i)||(i=new e),i.x=t[n++],i.y=t[n++],i.z=t[n],i}static packArray(t,n){let i=t.length,o=i*3;l(n)?!Array.isArray(n)&&n.length!==o||n.length!==o&&(n.length=o):n=new Array(o);for(let r=0;rd;)sMe(c,rD),e.transpose(rD,Fle),e.multiply(c,rD,c),e.multiply(Fle,c,c),e.multiply(a,rD,a),++r>2&&(++s,r=0);return n}static abs(t,n){return n[0]=Math.abs(t[0]),n[1]=Math.abs(t[1]),n[2]=Math.abs(t[2]),n[3]=Math.abs(t[3]),n[4]=Math.abs(t[4]),n[5]=Math.abs(t[5]),n[6]=Math.abs(t[6]),n[7]=Math.abs(t[7]),n[8]=Math.abs(t[8]),n}static determinant(t){let n=t[0],i=t[3],o=t[6],r=t[1],s=t[4],a=t[7],c=t[2],d=t[5],u=t[8];return n*(s*u-d*a)+r*(d*o-i*u)+c*(i*a-s*o)}static inverse(t,n){let i=t[0],o=t[1],r=t[2],s=t[3],a=t[4],c=t[5],d=t[6],u=t[7],m=t[8],p=e.determinant(t);n[0]=a*m-u*c,n[1]=u*r-o*m,n[2]=o*c-a*r,n[3]=d*c-s*m,n[4]=i*m-d*r,n[5]=s*r-i*c,n[6]=s*u-d*a,n[7]=d*o-i*u,n[8]=i*a-s*o;let b=1/p;return e.multiplyByScalar(n,b,n)}static inverseTranspose(t,n){return e.inverse(e.transpose(t,iMe),n)}static equals(t,n){return t===n||l(t)&&l(n)&&t[0]===n[0]&&t[1]===n[1]&&t[2]===n[2]&&t[3]===n[3]&&t[4]===n[4]&&t[5]===n[5]&&t[6]===n[6]&&t[7]===n[7]&&t[8]===n[8]}static equalsEpsilon(t,n,i){return i=i??0,t===n||l(t)&&l(n)&&Math.abs(t[0]-n[0])<=i&&Math.abs(t[1]-n[1])<=i&&Math.abs(t[2]-n[2])<=i&&Math.abs(t[3]-n[3])<=i&&Math.abs(t[4]-n[4])<=i&&Math.abs(t[5]-n[5])<=i&&Math.abs(t[6]-n[6])<=i&&Math.abs(t[7]-n[7])<=i&&Math.abs(t[8]-n[8])<=i}get length(){return e.packedLength}clone(t){return e.clone(this,t)}equals(t){return e.equals(this,t)}static equalsArray(t,n,i){return t[0]===n[i]&&t[1]===n[i+1]&&t[2]===n[i+2]&&t[3]===n[i+3]&&t[4]===n[i+4]&&t[5]===n[i+5]&&t[6]===n[i+6]&&t[7]===n[i+7]&&t[8]===n[i+8]}equalsEpsilon(t,n){return e.equalsEpsilon(this,t,n)}toString(){return`(${this[0]}, ${this[3]}, ${this[6]}) (${this[1]}, ${this[4]}, ${this[7]}) -(${this[2]}, ${this[5]}, ${this[8]})`}};So.packedLength=9;So.fromArray=So.unpack;So.IDENTITY=new So(1,0,0,0,1,0,0,0,1);So.ZERO=new So(0,0,0,0,0,0,0,0,0);So.COLUMN0ROW0=0;So.COLUMN0ROW1=1;So.COLUMN0ROW2=2;So.COLUMN1ROW0=3;So.COLUMN1ROW1=4;So.COLUMN1ROW2=5;So.COLUMN2ROW0=6;So.COLUMN2ROW1=7;So.COLUMN2ROW2=8;var qYe=new h,$Ye=new h,fj=new h,vle=new h,eMe=new h,tMe=new h,rD=new So,Fle=new So,nMe=new So;function iMe(e){let t=0;for(let n=0;n<9;++n){let i=e[n];t+=i*i}return Math.sqrt(t)}var pj=[1,0,0],bj=[2,2,1];function oMe(e){let t=0;for(let n=0;n<3;++n){let i=e[So.getElementIndex(bj[n],pj[n])];t+=2*i*i}return Math.sqrt(t)}function rMe(e,t){let n=W.EPSILON15,i=0,o=1;for(let d=0;d<3;++d){let u=Math.abs(e[So.getElementIndex(bj[d],pj[d])]);u>i&&(o=d,i=u)}let r=1,s=0,a=pj[o],c=bj[o];if(Math.abs(e[So.getElementIndex(c,a)])>n){let d=e[So.getElementIndex(c,c)],u=e[So.getElementIndex(a,a)],m=e[So.getElementIndex(c,a)],p=(d-u)/2/m,b;p<0?b=-1/(-p+Math.sqrt(1+p*p)):b=1/(p+Math.sqrt(1+p*p)),r=1/Math.sqrt(1+b*b),s=b*r}return t=So.clone(So.IDENTITY,t),t[So.getElementIndex(a,a)]=t[So.getElementIndex(c,c)]=r,t[So.getElementIndex(c,a)]=s,t[So.getElementIndex(a,c)]=-s,t}var q=So;var ozt=x(T(),1);function BA(e){this.name="RuntimeError",this.message=e;let t;try{throw new Error}catch(n){t=n.stack}this.stack=t}l(Object.create)&&(BA.prototype=Object.create(Error.prototype),BA.prototype.constructor=BA);BA.prototype.toString=function(){let e=`${this.name}: ${this.message}`;return l(this.stack)&&(e+=` -${this.stack.toString()}`),e};var ae=BA;var sMe=Object.freeze([NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN]),gr=class e{constructor(t,n,i,o,r,s,a,c,d,u,m,p,b,f,y,_){let S=Reflect.construct(Array,sMe,new.target);return S[0]=t??0,S[1]=r??0,S[2]=d??0,S[3]=b??0,S[4]=n??0,S[5]=s??0,S[6]=u??0,S[7]=f??0,S[8]=i??0,S[9]=a??0,S[10]=m??0,S[11]=y??0,S[12]=o??0,S[13]=c??0,S[14]=p??0,S[15]=_??0,S}static pack(t,n,i){return i=i??0,n[i++]=t[0],n[i++]=t[1],n[i++]=t[2],n[i++]=t[3],n[i++]=t[4],n[i++]=t[5],n[i++]=t[6],n[i++]=t[7],n[i++]=t[8],n[i++]=t[9],n[i++]=t[10],n[i++]=t[11],n[i++]=t[12],n[i++]=t[13],n[i++]=t[14],n[i]=t[15],n}static unpack(t,n,i){return n=n??0,l(i)||(i=new e),i[0]=t[n++],i[1]=t[n++],i[2]=t[n++],i[3]=t[n++],i[4]=t[n++],i[5]=t[n++],i[6]=t[n++],i[7]=t[n++],i[8]=t[n++],i[9]=t[n++],i[10]=t[n++],i[11]=t[n++],i[12]=t[n++],i[13]=t[n++],i[14]=t[n++],i[15]=t[n],i}static packArray(t,n){let i=t.length,o=i*16;l(n)?!Array.isArray(n)&&n.length!==o||n.length!==o&&(n.length=o):n=new Array(o);for(let r=0;ri&&(o=d,i=u)}let r=1,s=0,a=pj[o],c=bj[o];if(Math.abs(e[So.getElementIndex(c,a)])>n){let d=e[So.getElementIndex(c,c)],u=e[So.getElementIndex(a,a)],m=e[So.getElementIndex(c,a)],p=(d-u)/2/m,b;p<0?b=-1/(-p+Math.sqrt(1+p*p)):b=1/(p+Math.sqrt(1+p*p)),r=1/Math.sqrt(1+b*b),s=b*r}return t=So.clone(So.IDENTITY,t),t[So.getElementIndex(a,a)]=t[So.getElementIndex(c,c)]=r,t[So.getElementIndex(c,a)]=s,t[So.getElementIndex(a,c)]=-s,t}var q=So;var rzt=x(T(),1);function BA(e){this.name="RuntimeError",this.message=e;let t;try{throw new Error}catch(n){t=n.stack}this.stack=t}l(Object.create)&&(BA.prototype=Object.create(Error.prototype),BA.prototype.constructor=BA);BA.prototype.toString=function(){let e=`${this.name}: ${this.message}`;return l(this.stack)&&(e+=` +${this.stack.toString()}`),e};var ae=BA;var aMe=Object.freeze([NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN]),gr=class e{constructor(t,n,i,o,r,s,a,c,d,u,m,p,b,f,y,_){let S=Reflect.construct(Array,aMe,new.target);return S[0]=t??0,S[1]=r??0,S[2]=d??0,S[3]=b??0,S[4]=n??0,S[5]=s??0,S[6]=u??0,S[7]=f??0,S[8]=i??0,S[9]=a??0,S[10]=m??0,S[11]=y??0,S[12]=o??0,S[13]=c??0,S[14]=p??0,S[15]=_??0,S}static pack(t,n,i){return i=i??0,n[i++]=t[0],n[i++]=t[1],n[i++]=t[2],n[i++]=t[3],n[i++]=t[4],n[i++]=t[5],n[i++]=t[6],n[i++]=t[7],n[i++]=t[8],n[i++]=t[9],n[i++]=t[10],n[i++]=t[11],n[i++]=t[12],n[i++]=t[13],n[i++]=t[14],n[i]=t[15],n}static unpack(t,n,i){return n=n??0,l(i)||(i=new e),i[0]=t[n++],i[1]=t[n++],i[2]=t[n++],i[3]=t[n++],i[4]=t[n++],i[5]=t[n++],i[6]=t[n++],i[7]=t[n++],i[8]=t[n++],i[9]=t[n++],i[10]=t[n++],i[11]=t[n++],i[12]=t[n++],i[13]=t[n++],i[14]=t[n++],i[15]=t[n],i}static packArray(t,n){let i=t.length,o=i*16;l(n)?!Array.isArray(n)&&n.length!==o||n.length!==o&&(n.length=o):n=new Array(o);for(let r=0;r=W.SIXTY_FOUR_KILOBYTES?new Uint32Array(t):new Uint16Array(t)};ha.createTypedArrayFromArrayBuffer=function(e,t,n,i){return e>=W.SIXTY_FOUR_KILOBYTES?new Uint32Array(t,n,i):new Uint16Array(t,n,i)};ha.fromTypedArray=function(e){if(e instanceof Uint8Array)return ha.UNSIGNED_BYTE;if(e instanceof Uint16Array)return ha.UNSIGNED_SHORT;if(e instanceof Uint32Array)return ha.UNSIGNED_INT};Object.freeze(ha);var Oe=ha;var vzt=x(T(),1);var jT={STREAM_DRAW:ie.STREAM_DRAW,STATIC_DRAW:ie.STATIC_DRAW,DYNAMIC_DRAW:ie.DYNAMIC_DRAW,DYNAMIC_READ:ie.DYNAMIC_READ};jT.validate=function(e){return e===jT.STREAM_DRAW||e===jT.STATIC_DRAW||e===jT.DYNAMIC_DRAW||e===jT.DYNAMIC_READ};Object.freeze(jT);var Pe=jT;function Bc(e){e=e??B.EMPTY_OBJECT;let t=e.context._gl,n=e.bufferTarget,i=e.typedArray,o=e.sizeInBytes,r=e.usage,s=l(i);s&&(o=i.byteLength);let a=t.createBuffer();t.bindBuffer(n,a),t.bufferData(n,s?i:o,r),t.bindBuffer(n,null),this._id=Qn(),this._gl=t,this._webgl2=e.context._webgl2,this._bufferTarget=n,this._sizeInBytes=o,this._usage=r,this._buffer=a,this.vertexArrayDestroyable=!0}Bc.createPixelBuffer=function(e){if(!e.context._webgl2)throw new ge("A WebGL 2 context is required to create PixelBuffers.");return new Bc({context:e.context,bufferTarget:ie.PIXEL_PACK_BUFFER,typedArray:e.typedArray,sizeInBytes:e.sizeInBytes,usage:e.usage})};Bc.createVertexBuffer=function(e){return new Bc({context:e.context,bufferTarget:ie.ARRAY_BUFFER,typedArray:e.typedArray,sizeInBytes:e.sizeInBytes,usage:e.usage})};Bc.createIndexBuffer=function(e){let t=e.context,n=e.indexDatatype,i=Oe.getSizeInBytes(n),o=new Bc({context:t,bufferTarget:ie.ELEMENT_ARRAY_BUFFER,typedArray:e.typedArray,sizeInBytes:e.sizeInBytes,usage:e.usage}),r=o.sizeInBytes/i;return Object.defineProperties(o,{indexDatatype:{get:function(){return n}},bytesPerIndex:{get:function(){return i}},numberOfIndices:{get:function(){return r}}}),o};Object.defineProperties(Bc.prototype,{sizeInBytes:{get:function(){return this._sizeInBytes}},usage:{get:function(){return this._usage}}});Bc.prototype._getBuffer=function(){return this._buffer};Bc.prototype._bind=function(){let e=this._gl,t=this._bufferTarget;e.bindBuffer(t,this._buffer)};Bc.prototype._unBind=function(){let e=this._gl,t=this._bufferTarget;e.bindBuffer(t,null)};Bc.prototype.copyFromArrayView=function(e,t){t=t??0;let n=this._gl,i=this._bufferTarget;n.bindBuffer(i,this._buffer),n.bufferSubData(i,t,e),n.bindBuffer(i,null)};Bc.prototype.copyFromBuffer=function(e,t,n,i){let o=ie.COPY_READ_BUFFER,r=ie.COPY_WRITE_BUFFER,s=this._gl;s.bindBuffer(r,this._buffer),s.bindBuffer(o,e._buffer),s.copyBufferSubData(o,r,t,n,i),s.bindBuffer(r,null),s.bindBuffer(o,null)};Bc.prototype.getBufferData=function(e,t,n,i){t=t??0,n=n??0;let o=this._gl,r=ie.COPY_READ_BUFFER;o.bindBuffer(r,this._buffer),o.getBufferSubData(r,t,e,n,i),o.bindBuffer(r,null)};Bc.prototype.isDestroyed=function(){return!1};Bc.prototype.destroy=function(){return this._gl.deleteBuffer(this._buffer),ue(this)};var it=Bc;var oHt=x(T(),1);var eHt=x(T(),1);var Kzt=x(T(),1);var Ozt=x(T(),1);var Sy,us={requestFullscreen:void 0,exitFullscreen:void 0,fullscreenEnabled:void 0,fullscreenElement:void 0,fullscreenchange:void 0,fullscreenerror:void 0},Rd={};Object.defineProperties(Rd,{element:{get:function(){if(Rd.supportsFullscreen())return document[us.fullscreenElement]}},changeEventName:{get:function(){if(Rd.supportsFullscreen())return us.fullscreenchange}},errorEventName:{get:function(){if(Rd.supportsFullscreen())return us.fullscreenerror}},enabled:{get:function(){if(Rd.supportsFullscreen())return document[us.fullscreenEnabled]}},fullscreen:{get:function(){if(Rd.supportsFullscreen())return Rd.element!==null}}});Rd.supportsFullscreen=function(){if(l(Sy))return Sy;Sy=!1;let e=document.body;if(typeof e.requestFullscreen=="function")return us.requestFullscreen="requestFullscreen",us.exitFullscreen="exitFullscreen",us.fullscreenEnabled="fullscreenEnabled",us.fullscreenElement="fullscreenElement",us.fullscreenchange="fullscreenchange",us.fullscreenerror="fullscreenerror",Sy=!0,Sy;let t=["webkit","moz","o","ms","khtml"],n;for(let i=0,o=t.length;i{let t=new Image;t.onload=function(){vl._result=t.width>0&&t.height>0,e(vl._result)},t.onerror=function(){vl._result=!1,e(vl._result)},t.src="data:image/webp;base64,UklGRiIAAABXRUJQVlA4IBYAAAAwAQCdASoBAAEADsD+JaQAA3AAAAAA"})),vl._promise};Object.defineProperties(vl,{initialized:{get:function(){return l(vl._result)}}});var qR=[];typeof ArrayBuffer<"u"&&(qR.push(Int8Array,Uint8Array,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array),typeof Uint8ClampedArray<"u"&&qR.push(Uint8ClampedArray),typeof Uint8ClampedArray<"u"&&qR.push(Uint8ClampedArray),typeof BigInt64Array<"u"&&qR.push(BigInt64Array),typeof BigUint64Array<"u"&&qR.push(BigUint64Array));var Tm={isChrome:Sj,chromeVersion:_Me,isSafari:Yle,safariVersion:SMe,isWebkit:Mle,webkitVersion:ZMe,isEdge:mD,edgeVersion:RMe,isFirefox:hD,firefoxVersion:EMe,isWindows:CMe,isIPadOrIOS:VMe,hardwareConcurrency:xm.hardwareConcurrency??3,supportsPointerEvents:AMe,supportsImageRenderingPixelated:Ule,supportsWebP:vl,imageRenderingValue:GMe,typedArrayTypes:qR};Tm.supportsBasis=function(e){return Tm.supportsWebAssembly()&&e.context.supportsBasis};Tm.supportsFullscreen=function(){return qr.supportsFullscreen()};Tm.supportsTypedArrays=function(){return typeof ArrayBuffer<"u"};Tm.supportsBigInt64Array=function(){return typeof BigInt64Array<"u"};Tm.supportsBigUint64Array=function(){return typeof BigUint64Array<"u"};Tm.supportsBigInt=function(){return typeof BigInt<"u"};Tm.supportsWebWorkers=function(){return typeof Worker<"u"};Tm.supportsWebAssembly=function(){return typeof WebAssembly<"u"};Tm.supportsWebgl2=function(e){return e.context.webgl2};Tm.supportsEsmWebWorkers=function(){return!hD()||parseInt(Zj)>=114};var fn=Tm;function Rj(e,t,n){return n<0&&(n+=1),n>1&&(n-=1),n*6<1?e+(t-e)*6*n:n*2<1?t:n*3<2?e+(t-e)*(2/3-n)*6:e}var xe=class e{constructor(t,n,i,o){this.red=t??1,this.green=n??1,this.blue=i??1,this.alpha=o??1}static fromCartesian4(t,n){return l(n)?(n.red=t.x,n.green=t.y,n.blue=t.z,n.alpha=t.w,n):new e(t.x,t.y,t.z,t.w)}static fromBytes(t,n,i,o,r){return t=e.byteToFloat(t??255),n=e.byteToFloat(n??255),i=e.byteToFloat(i??255),o=e.byteToFloat(o??255),l(r)?(r.red=t,r.green=n,r.blue=i,r.alpha=o,r):new e(t,n,i,o)}static fromAlpha(t,n,i){return l(i)?(i.red=t.red,i.green=t.green,i.blue=t.blue,i.alpha=n,i):new e(t.red,t.green,t.blue,n)}static fromRgba(t,n){return Vj[0]=t,e.fromBytes(q0[0],q0[1],q0[2],q0[3],n)}static fromHsl(t,n,i,o,r){t=(t??0)%1,n=n??0,i=i??0,o=o??1;let s=i,a=i,c=i;if(n!==0){let d;i<.5?d=i*(1+n):d=i+n-i*n;let u=2*i-d;s=Rj(u,d,t+1/3),a=Rj(u,d,t),c=Rj(u,d,t-1/3)}return l(r)?(r.red=s,r.green=a,r.blue=c,r.alpha=o,r):new e(s,a,c,o)}static fromRandom(t,n){t=t??B.EMPTY_OBJECT;let i=t.red;if(!l(i)){let a=t.minimumRed??0,c=t.maximumRed??1;i=a+W.nextRandomNumber()*(c-a)}let o=t.green;if(!l(o)){let a=t.minimumGreen??0,c=t.maximumGreen??1;o=a+W.nextRandomNumber()*(c-a)}let r=t.blue;if(!l(r)){let a=t.minimumBlue??0,c=t.maximumBlue??1;r=a+W.nextRandomNumber()*(c-a)}let s=t.alpha;if(!l(s)){let a=t.minimumAlpha??0,c=t.maximumAlpha??1;s=a+W.nextRandomNumber()*(c-a)}return l(n)?(n.red=i,n.green=o,n.blue=r,n.alpha=s,n):new e(i,o,r,s)}static fromCssColorString(t,n){l(n)||(n=new e),t=t.trim();let i=e[t.toUpperCase()];if(l(i))return e.clone(i,n),n;let o=LMe.exec(t);return o!==null?(n.red=parseInt(o[1],16)/15,n.green=parseInt(o[2],16)/15,n.blue=parseInt(o[3],16)/15,n.alpha=parseInt(o[4]??"f",16)/15,n):(o=WMe.exec(t),o!==null?(n.red=parseInt(o[1],16)/255,n.green=parseInt(o[2],16)/255,n.blue=parseInt(o[3],16)/255,n.alpha=parseInt(o[4]??"ff",16)/255,n):(o=vMe.exec(t),o!==null?(n.red=parseFloat(o[1])/(o[1].substr(-1)==="%"?100:255),n.green=parseFloat(o[2])/(o[2].substr(-1)==="%"?100:255),n.blue=parseFloat(o[3])/(o[3].substr(-1)==="%"?100:255),n.alpha=parseFloat(o[4]??"1.0"),n):(o=FMe.exec(t),o!==null?e.fromHsl(parseFloat(o[1])/360,parseFloat(o[2])/100,parseFloat(o[3])/100,parseFloat(o[4]??"1.0"),n):(n=void 0,n))))}static pack(t,n,i){return i=i??0,n[i++]=t.red,n[i++]=t.green,n[i++]=t.blue,n[i]=t.alpha,n}static unpack(t,n,i){return n=n??0,l(i)||(i=new e),i.red=t[n++],i.green=t[n++],i.blue=t[n++],i.alpha=t[n],i}static byteToFloat(t){return t/255}static floatToByte(t){return t===1?255:t*256|0}static clone(t,n){if(l(t))return l(n)?(n.red=t.red,n.green=t.green,n.blue=t.blue,n.alpha=t.alpha,n):new e(t.red,t.green,t.blue,t.alpha)}static equals(t,n){return t===n||l(t)&&l(n)&&t.red===n.red&&t.green===n.green&&t.blue===n.blue&&t.alpha===n.alpha}static equalsArray(t,n,i){return t.red===n[i]&&t.green===n[i+1]&&t.blue===n[i+2]&&t.alpha===n[i+3]}clone(t){return e.clone(this,t)}equals(t){return e.equals(this,t)}equalsEpsilon(t,n){return this===t||l(t)&&Math.abs(this.red-t.red)<=n&&Math.abs(this.green-t.green)<=n&&Math.abs(this.blue-t.blue)<=n&&Math.abs(this.alpha-t.alpha)<=n}toString(){return`(${this.red}, ${this.green}, ${this.blue}, ${this.alpha})`}toCssColorString(){let t=e.floatToByte(this.red),n=e.floatToByte(this.green),i=e.floatToByte(this.blue);return this.alpha===1?`rgb(${t},${n},${i})`:`rgba(${t},${n},${i},${this.alpha})`}toCssHexString(){let t=e.floatToByte(this.red).toString(16);t.length<2&&(t=`0${t}`);let n=e.floatToByte(this.green).toString(16);n.length<2&&(n=`0${n}`);let i=e.floatToByte(this.blue).toString(16);if(i.length<2&&(i=`0${i}`),this.alpha<1){let o=e.floatToByte(this.alpha).toString(16);return o.length<2&&(o=`0${o}`),`#${t}${n}${i}${o}`}return`#${t}${n}${i}`}toBytes(t){let n=e.floatToByte(this.red),i=e.floatToByte(this.green),o=e.floatToByte(this.blue),r=e.floatToByte(this.alpha);return l(t)?(t[0]=n,t[1]=i,t[2]=o,t[3]=r,t):[n,i,o,r]}static bytesToRgba(t,n,i,o){return q0[0]=t,q0[1]=n,q0[2]=i,q0[3]=o,Vj[0]}toRgba(){return e.bytesToRgba(e.floatToByte(this.red),e.floatToByte(this.green),e.floatToByte(this.blue),e.floatToByte(this.alpha))}brighten(t,n){return t=1-t,n.red=1-(1-this.red)*t,n.green=1-(1-this.green)*t,n.blue=1-(1-this.blue)*t,n.alpha=this.alpha,n}darken(t,n){return t=1-t,n.red=this.red*t,n.green=this.green*t,n.blue=this.blue*t,n.alpha=this.alpha,n}withAlpha(t,n){return e.fromAlpha(this,t,n)}static add(t,n,i){return i.red=t.red+n.red,i.green=t.green+n.green,i.blue=t.blue+n.blue,i.alpha=t.alpha+n.alpha,i}static subtract(t,n,i){return i.red=t.red-n.red,i.green=t.green-n.green,i.blue=t.blue-n.blue,i.alpha=t.alpha-n.alpha,i}static multiply(t,n,i){return i.red=t.red*n.red,i.green=t.green*n.green,i.blue=t.blue*n.blue,i.alpha=t.alpha*n.alpha,i}static divide(t,n,i){return i.red=t.red/n.red,i.green=t.green/n.green,i.blue=t.blue/n.blue,i.alpha=t.alpha/n.alpha,i}static mod(t,n,i){return i.red=t.red%n.red,i.green=t.green%n.green,i.blue=t.blue%n.blue,i.alpha=t.alpha%n.alpha,i}static lerp(t,n,i,o){return o.red=W.lerp(t.red,n.red,i),o.green=W.lerp(t.green,n.green,i),o.blue=W.lerp(t.blue,n.blue,i),o.alpha=W.lerp(t.alpha,n.alpha,i),o}static multiplyByScalar(t,n,i){return i.red=t.red*n,i.green=t.green*n,i.blue=t.blue*n,i.alpha=t.alpha*n,i}static divideByScalar(t,n,i){return i.red=t.red/n,i.green=t.green/n,i.blue=t.blue/n,i.alpha=t.alpha/n,i}},Cj,Vj,q0;fn.supportsTypedArrays()&&(Cj=new ArrayBuffer(4),Vj=new Uint32Array(Cj),q0=new Uint8Array(Cj));var LMe=/^#([0-9a-f])([0-9a-f])([0-9a-f])([0-9a-f])?$/i,WMe=/^#([0-9a-f]{2})([0-9a-f]{2})([0-9a-f]{2})([0-9a-f]{2})?$/i,vMe=/^rgba?\s*\(\s*([0-9.]+%?)\s*[,\s]+\s*([0-9.]+%?)\s*[,\s]+\s*([0-9.]+%?)(?:\s*[,\s/]+\s*([0-9.]+))?\s*\)$/i,FMe=/^hsla?\s*\(\s*([0-9.]+)\s*[,\s]+\s*([0-9.]+%)\s*[,\s]+\s*([0-9.]+%)(?:\s*[,\s/]+\s*([0-9.]+))?\s*\)$/i;xe.packedLength=4;xe.ALICEBLUE=Object.freeze(xe.fromCssColorString("#F0F8FF"));xe.ANTIQUEWHITE=Object.freeze(xe.fromCssColorString("#FAEBD7"));xe.AQUA=Object.freeze(xe.fromCssColorString("#00FFFF"));xe.AQUAMARINE=Object.freeze(xe.fromCssColorString("#7FFFD4"));xe.AZURE=Object.freeze(xe.fromCssColorString("#F0FFFF"));xe.BEIGE=Object.freeze(xe.fromCssColorString("#F5F5DC"));xe.BISQUE=Object.freeze(xe.fromCssColorString("#FFE4C4"));xe.BLACK=Object.freeze(xe.fromCssColorString("#000000"));xe.BLANCHEDALMOND=Object.freeze(xe.fromCssColorString("#FFEBCD"));xe.BLUE=Object.freeze(xe.fromCssColorString("#0000FF"));xe.BLUEVIOLET=Object.freeze(xe.fromCssColorString("#8A2BE2"));xe.BROWN=Object.freeze(xe.fromCssColorString("#A52A2A"));xe.BURLYWOOD=Object.freeze(xe.fromCssColorString("#DEB887"));xe.CADETBLUE=Object.freeze(xe.fromCssColorString("#5F9EA0"));xe.CHARTREUSE=Object.freeze(xe.fromCssColorString("#7FFF00"));xe.CHOCOLATE=Object.freeze(xe.fromCssColorString("#D2691E"));xe.CORAL=Object.freeze(xe.fromCssColorString("#FF7F50"));xe.CORNFLOWERBLUE=Object.freeze(xe.fromCssColorString("#6495ED"));xe.CORNSILK=Object.freeze(xe.fromCssColorString("#FFF8DC"));xe.CRIMSON=Object.freeze(xe.fromCssColorString("#DC143C"));xe.CYAN=Object.freeze(xe.fromCssColorString("#00FFFF"));xe.DARKBLUE=Object.freeze(xe.fromCssColorString("#00008B"));xe.DARKCYAN=Object.freeze(xe.fromCssColorString("#008B8B"));xe.DARKGOLDENROD=Object.freeze(xe.fromCssColorString("#B8860B"));xe.DARKGRAY=Object.freeze(xe.fromCssColorString("#A9A9A9"));xe.DARKGREEN=Object.freeze(xe.fromCssColorString("#006400"));xe.DARKGREY=xe.DARKGRAY;xe.DARKKHAKI=Object.freeze(xe.fromCssColorString("#BDB76B"));xe.DARKMAGENTA=Object.freeze(xe.fromCssColorString("#8B008B"));xe.DARKOLIVEGREEN=Object.freeze(xe.fromCssColorString("#556B2F"));xe.DARKORANGE=Object.freeze(xe.fromCssColorString("#FF8C00"));xe.DARKORCHID=Object.freeze(xe.fromCssColorString("#9932CC"));xe.DARKRED=Object.freeze(xe.fromCssColorString("#8B0000"));xe.DARKSALMON=Object.freeze(xe.fromCssColorString("#E9967A"));xe.DARKSEAGREEN=Object.freeze(xe.fromCssColorString("#8FBC8F"));xe.DARKSLATEBLUE=Object.freeze(xe.fromCssColorString("#483D8B"));xe.DARKSLATEGRAY=Object.freeze(xe.fromCssColorString("#2F4F4F"));xe.DARKSLATEGREY=xe.DARKSLATEGRAY;xe.DARKTURQUOISE=Object.freeze(xe.fromCssColorString("#00CED1"));xe.DARKVIOLET=Object.freeze(xe.fromCssColorString("#9400D3"));xe.DEEPPINK=Object.freeze(xe.fromCssColorString("#FF1493"));xe.DEEPSKYBLUE=Object.freeze(xe.fromCssColorString("#00BFFF"));xe.DIMGRAY=Object.freeze(xe.fromCssColorString("#696969"));xe.DIMGREY=xe.DIMGRAY;xe.DODGERBLUE=Object.freeze(xe.fromCssColorString("#1E90FF"));xe.FIREBRICK=Object.freeze(xe.fromCssColorString("#B22222"));xe.FLORALWHITE=Object.freeze(xe.fromCssColorString("#FFFAF0"));xe.FORESTGREEN=Object.freeze(xe.fromCssColorString("#228B22"));xe.FUCHSIA=Object.freeze(xe.fromCssColorString("#FF00FF"));xe.GAINSBORO=Object.freeze(xe.fromCssColorString("#DCDCDC"));xe.GHOSTWHITE=Object.freeze(xe.fromCssColorString("#F8F8FF"));xe.GOLD=Object.freeze(xe.fromCssColorString("#FFD700"));xe.GOLDENROD=Object.freeze(xe.fromCssColorString("#DAA520"));xe.GRAY=Object.freeze(xe.fromCssColorString("#808080"));xe.GREEN=Object.freeze(xe.fromCssColorString("#008000"));xe.GREENYELLOW=Object.freeze(xe.fromCssColorString("#ADFF2F"));xe.GREY=xe.GRAY;xe.HONEYDEW=Object.freeze(xe.fromCssColorString("#F0FFF0"));xe.HOTPINK=Object.freeze(xe.fromCssColorString("#FF69B4"));xe.INDIANRED=Object.freeze(xe.fromCssColorString("#CD5C5C"));xe.INDIGO=Object.freeze(xe.fromCssColorString("#4B0082"));xe.IVORY=Object.freeze(xe.fromCssColorString("#FFFFF0"));xe.KHAKI=Object.freeze(xe.fromCssColorString("#F0E68C"));xe.LAVENDER=Object.freeze(xe.fromCssColorString("#E6E6FA"));xe.LAVENDAR_BLUSH=Object.freeze(xe.fromCssColorString("#FFF0F5"));xe.LAWNGREEN=Object.freeze(xe.fromCssColorString("#7CFC00"));xe.LEMONCHIFFON=Object.freeze(xe.fromCssColorString("#FFFACD"));xe.LIGHTBLUE=Object.freeze(xe.fromCssColorString("#ADD8E6"));xe.LIGHTCORAL=Object.freeze(xe.fromCssColorString("#F08080"));xe.LIGHTCYAN=Object.freeze(xe.fromCssColorString("#E0FFFF"));xe.LIGHTGOLDENRODYELLOW=Object.freeze(xe.fromCssColorString("#FAFAD2"));xe.LIGHTGRAY=Object.freeze(xe.fromCssColorString("#D3D3D3"));xe.LIGHTGREEN=Object.freeze(xe.fromCssColorString("#90EE90"));xe.LIGHTGREY=xe.LIGHTGRAY;xe.LIGHTPINK=Object.freeze(xe.fromCssColorString("#FFB6C1"));xe.LIGHTSEAGREEN=Object.freeze(xe.fromCssColorString("#20B2AA"));xe.LIGHTSKYBLUE=Object.freeze(xe.fromCssColorString("#87CEFA"));xe.LIGHTSLATEGRAY=Object.freeze(xe.fromCssColorString("#778899"));xe.LIGHTSLATEGREY=xe.LIGHTSLATEGRAY;xe.LIGHTSTEELBLUE=Object.freeze(xe.fromCssColorString("#B0C4DE"));xe.LIGHTYELLOW=Object.freeze(xe.fromCssColorString("#FFFFE0"));xe.LIME=Object.freeze(xe.fromCssColorString("#00FF00"));xe.LIMEGREEN=Object.freeze(xe.fromCssColorString("#32CD32"));xe.LINEN=Object.freeze(xe.fromCssColorString("#FAF0E6"));xe.MAGENTA=Object.freeze(xe.fromCssColorString("#FF00FF"));xe.MAROON=Object.freeze(xe.fromCssColorString("#800000"));xe.MEDIUMAQUAMARINE=Object.freeze(xe.fromCssColorString("#66CDAA"));xe.MEDIUMBLUE=Object.freeze(xe.fromCssColorString("#0000CD"));xe.MEDIUMORCHID=Object.freeze(xe.fromCssColorString("#BA55D3"));xe.MEDIUMPURPLE=Object.freeze(xe.fromCssColorString("#9370DB"));xe.MEDIUMSEAGREEN=Object.freeze(xe.fromCssColorString("#3CB371"));xe.MEDIUMSLATEBLUE=Object.freeze(xe.fromCssColorString("#7B68EE"));xe.MEDIUMSPRINGGREEN=Object.freeze(xe.fromCssColorString("#00FA9A"));xe.MEDIUMTURQUOISE=Object.freeze(xe.fromCssColorString("#48D1CC"));xe.MEDIUMVIOLETRED=Object.freeze(xe.fromCssColorString("#C71585"));xe.MIDNIGHTBLUE=Object.freeze(xe.fromCssColorString("#191970"));xe.MINTCREAM=Object.freeze(xe.fromCssColorString("#F5FFFA"));xe.MISTYROSE=Object.freeze(xe.fromCssColorString("#FFE4E1"));xe.MOCCASIN=Object.freeze(xe.fromCssColorString("#FFE4B5"));xe.NAVAJOWHITE=Object.freeze(xe.fromCssColorString("#FFDEAD"));xe.NAVY=Object.freeze(xe.fromCssColorString("#000080"));xe.OLDLACE=Object.freeze(xe.fromCssColorString("#FDF5E6"));xe.OLIVE=Object.freeze(xe.fromCssColorString("#808000"));xe.OLIVEDRAB=Object.freeze(xe.fromCssColorString("#6B8E23"));xe.ORANGE=Object.freeze(xe.fromCssColorString("#FFA500"));xe.ORANGERED=Object.freeze(xe.fromCssColorString("#FF4500"));xe.ORCHID=Object.freeze(xe.fromCssColorString("#DA70D6"));xe.PALEGOLDENROD=Object.freeze(xe.fromCssColorString("#EEE8AA"));xe.PALEGREEN=Object.freeze(xe.fromCssColorString("#98FB98"));xe.PALETURQUOISE=Object.freeze(xe.fromCssColorString("#AFEEEE"));xe.PALEVIOLETRED=Object.freeze(xe.fromCssColorString("#DB7093"));xe.PAPAYAWHIP=Object.freeze(xe.fromCssColorString("#FFEFD5"));xe.PEACHPUFF=Object.freeze(xe.fromCssColorString("#FFDAB9"));xe.PERU=Object.freeze(xe.fromCssColorString("#CD853F"));xe.PINK=Object.freeze(xe.fromCssColorString("#FFC0CB"));xe.PLUM=Object.freeze(xe.fromCssColorString("#DDA0DD"));xe.POWDERBLUE=Object.freeze(xe.fromCssColorString("#B0E0E6"));xe.PURPLE=Object.freeze(xe.fromCssColorString("#800080"));xe.RED=Object.freeze(xe.fromCssColorString("#FF0000"));xe.ROSYBROWN=Object.freeze(xe.fromCssColorString("#BC8F8F"));xe.ROYALBLUE=Object.freeze(xe.fromCssColorString("#4169E1"));xe.SADDLEBROWN=Object.freeze(xe.fromCssColorString("#8B4513"));xe.SALMON=Object.freeze(xe.fromCssColorString("#FA8072"));xe.SANDYBROWN=Object.freeze(xe.fromCssColorString("#F4A460"));xe.SEAGREEN=Object.freeze(xe.fromCssColorString("#2E8B57"));xe.SEASHELL=Object.freeze(xe.fromCssColorString("#FFF5EE"));xe.SIENNA=Object.freeze(xe.fromCssColorString("#A0522D"));xe.SILVER=Object.freeze(xe.fromCssColorString("#C0C0C0"));xe.SKYBLUE=Object.freeze(xe.fromCssColorString("#87CEEB"));xe.SLATEBLUE=Object.freeze(xe.fromCssColorString("#6A5ACD"));xe.SLATEGRAY=Object.freeze(xe.fromCssColorString("#708090"));xe.SLATEGREY=xe.SLATEGRAY;xe.SNOW=Object.freeze(xe.fromCssColorString("#FFFAFA"));xe.SPRINGGREEN=Object.freeze(xe.fromCssColorString("#00FF7F"));xe.STEELBLUE=Object.freeze(xe.fromCssColorString("#4682B4"));xe.TAN=Object.freeze(xe.fromCssColorString("#D2B48C"));xe.TEAL=Object.freeze(xe.fromCssColorString("#008080"));xe.THISTLE=Object.freeze(xe.fromCssColorString("#D8BFD8"));xe.TOMATO=Object.freeze(xe.fromCssColorString("#FF6347"));xe.TURQUOISE=Object.freeze(xe.fromCssColorString("#40E0D0"));xe.VIOLET=Object.freeze(xe.fromCssColorString("#EE82EE"));xe.WHEAT=Object.freeze(xe.fromCssColorString("#F5DEB3"));xe.WHITE=Object.freeze(xe.fromCssColorString("#FFFFFF"));xe.WHITESMOKE=Object.freeze(xe.fromCssColorString("#F5F5F5"));xe.YELLOW=Object.freeze(xe.fromCssColorString("#FFFF00"));xe.YELLOWGREEN=Object.freeze(xe.fromCssColorString("#9ACD32"));xe.TRANSPARENT=Object.freeze(new xe(0,0,0,0));var U=xe;function fD(e){e=e??B.EMPTY_OBJECT,this.color=e.color,this.depth=e.depth,this.stencil=e.stencil,this.renderState=e.renderState,this.framebuffer=e.framebuffer,this.owner=e.owner,this.pass=e.pass}fD.ALL=Object.freeze(new fD({color:new U(0,0,0,0),depth:1,stencil:0}));fD.prototype.execute=function(e,t){e.clear(this,t)};var ui=fD;var dHt=x(T(),1);var sHt=x(T(),1),Dle={ENVIRONMENT:0,COMPUTE:1,GLOBE:2,TERRAIN_CLASSIFICATION:3,CESIUM_3D_TILE_EDGES:4,CESIUM_3D_TILE_PLANAR_FILL_ID:5,CESIUM_3D_TILE:6,CESIUM_3D_TILE_CLASSIFICATION:7,CESIUM_3D_TILE_CLASSIFICATION_IGNORE_SHOW:8,OPAQUE:9,TRANSLUCENT:10,VOXELS:11,GAUSSIAN_SPLATS:12,CESIUM_3D_TILE_EDGES_DIRECT:13,OVERLAY:14,NUMBER_OF_PASSES:15};Object.freeze(Dle);var Le=Dle;function Ole(e){e=e??B.EMPTY_OBJECT,this.vertexArray=e.vertexArray,this.fragmentShaderSource=e.fragmentShaderSource,this.shaderProgram=e.shaderProgram,this.uniformMap=e.uniformMap,this.outputTexture=e.outputTexture,this.preExecute=e.preExecute,this.postExecute=e.postExecute,this.canceled=e.canceled,this.persists=e.persists??!1,this.pass=Le.COMPUTE,this.owner=e.owner}Ole.prototype.execute=function(e){e.execute(this)};var bu=Ole;var a8t=x(T(),1);var A4t=x(T(),1);var fHt=x(T(),1);var ms=class e{constructor(t,n){this.x=t??0,this.y=n??0}static fromElements(t,n,i){return l(i)?(i.x=t,i.y=n,i):new e(t,n)}static clone(t,n){if(l(t))return l(n)?(n.x=t.x,n.y=t.y,n):new e(t.x,t.y)}static pack(t,n,i){return i=i??0,n[i++]=t.x,n[i]=t.y,n}static unpack(t,n,i){return n=n??0,l(i)||(i=new e),i.x=t[n++],i.y=t[n],i}static packArray(t,n){let i=t.length,o=i*2;l(n)?!Array.isArray(n)&&n.length!==o||n.length!==o&&(n.length=o):n=new Array(o);for(let r=0;rW.EPSILON12);return l(o)?(o.x=r*I,o.y=s*N,o.z=a*g,o):new h(r*I,s*N,a*g)}var QT=NMe;var Fl=class Fl{constructor(t,n,i){this.longitude=t??0,this.latitude=n??0,this.height=i??0}static fromRadians(t,n,i,o){return i=i??0,l(o)?(o.longitude=t,o.latitude=n,o.height=i,o):new Fl(t,n,i)}static fromDegrees(t,n,i,o){return t=W.toRadians(t),n=W.toRadians(n),Fl.fromRadians(t,n,i,o)}static fromCartesian(t,n,i){let o=l(n)?n.oneOverRadii:Fl._ellipsoidOneOverRadii,r=l(n)?n.oneOverRadiiSquared:Fl._ellipsoidOneOverRadiiSquared,s=l(n)?n._centerToleranceSquared:Fl._ellipsoidCenterToleranceSquared,a=QT(t,o,r,s,MMe);if(!l(a))return;let c=h.multiplyComponents(a,r,YMe);c=h.normalize(c,c);let d=h.subtract(t,a,wMe),u=Math.atan2(c.y,c.x),m=Math.asin(c.z),p=W.sign(h.dot(d,t))*h.magnitude(d);return l(i)?(i.longitude=u,i.latitude=m,i.height=p,i):new Fl(u,m,p)}static toCartesian(t,n,i){return h.fromRadians(t.longitude,t.latitude,t.height,n,i)}static clone(t,n){if(l(t))return l(n)?(n.longitude=t.longitude,n.latitude=t.latitude,n.height=t.height,n):new Fl(t.longitude,t.latitude,t.height)}static equals(t,n){return t===n||l(t)&&l(n)&&t.longitude===n.longitude&&t.latitude===n.latitude&&t.height===n.height}static equalsEpsilon(t,n,i){return i=i??0,t===n||l(t)&&l(n)&&Math.abs(t.longitude-n.longitude)<=i&&Math.abs(t.latitude-n.latitude)<=i&&Math.abs(t.height-n.height)<=i}clone(t){return Fl.clone(this,t)}equals(t){return Fl.equals(this,t)}equalsEpsilon(t,n){return Fl.equalsEpsilon(this,t,n)}toString(){return`(${this.longitude}, ${this.latitude}, ${this.height})`}};mt(Fl,"_ellipsoidOneOverRadii",new h(1/6378137,1/6378137,1/6356752314245179e-9)),mt(Fl,"_ellipsoidOneOverRadiiSquared",new h(1/(6378137*6378137),1/(6378137*6378137),1/(6356752314245179e-9*6356752314245179e-9))),mt(Fl,"_ellipsoidCenterToleranceSquared",W.EPSILON1);var KA=Fl;KA.ZERO=Object.freeze(new KA(0,0,0));var YMe=new h,MMe=new h,wMe=new h,pe=KA;var IHt=x(T(),1);function Kle(e,t,n,i){t=t??0,n=n??0,i=i??0,e._radii=new h(t,n,i),e._radiiSquared=new h(t*t,n*n,i*i),e._radiiToTheFourth=new h(t*t*t*t,n*n*n*n,i*i*i*i),e._oneOverRadii=new h(t===0?0:1/t,n===0?0:1/n,i===0?0:1/i),e._oneOverRadiiSquared=new h(t===0?0:1/(t*t),n===0?0:1/(n*n),i===0?0:1/(i*i)),e._minimumRadius=Math.min(t,n,i),e._maximumRadius=Math.max(t,n,i),e._centerToleranceSquared=W.EPSILON1,e._radiiSquared.z!==0&&(e._squaredXOverSquaredZ=e._radiiSquared.x/e._radiiSquared.z)}var Il=class e{constructor(t,n,i){this._radii=void 0,this._radiiSquared=void 0,this._radiiToTheFourth=void 0,this._oneOverRadii=void 0,this._oneOverRadiiSquared=void 0,this._minimumRadius=void 0,this._maximumRadius=void 0,this._centerToleranceSquared=void 0,this._squaredXOverSquaredZ=void 0,Kle(this,t,n,i)}get radii(){return this._radii}get radiiSquared(){return this._radiiSquared}get radiiToTheFourth(){return this._radiiToTheFourth}get oneOverRadii(){return this._oneOverRadii}get oneOverRadiiSquared(){return this._oneOverRadiiSquared}get minimumRadius(){return this._minimumRadius}get maximumRadius(){return this._maximumRadius}static clone(t,n){if(!l(t))return;let i=t._radii;return l(n)?(h.clone(i,n._radii),h.clone(t._radiiSquared,n._radiiSquared),h.clone(t._radiiToTheFourth,n._radiiToTheFourth),h.clone(t._oneOverRadii,n._oneOverRadii),h.clone(t._oneOverRadiiSquared,n._oneOverRadiiSquared),n._minimumRadius=t._minimumRadius,n._maximumRadius=t._maximumRadius,n._centerToleranceSquared=t._centerToleranceSquared,n):new e(i.x,i.y,i.z)}static fromCartesian3(t,n){return l(n)||(n=new e),l(t)&&Kle(n,t.x,t.y,t.z),n}static get default(){return e._default}static set default(t){e._default=t,h._ellipsoidRadiiSquared=t.radiiSquared,pe._ellipsoidOneOverRadii=t.oneOverRadii,pe._ellipsoidOneOverRadiiSquared=t.oneOverRadiiSquared,pe._ellipsoidCenterToleranceSquared=t._centerToleranceSquared}clone(t){return e.clone(this,t)}static pack(t,n,i){return i=i??0,h.pack(t._radii,n,i),n}static unpack(t,n,i){n=n??0;let o=h.unpack(t,n);return e.fromCartesian3(o,i)}geodeticSurfaceNormalCartographic(t,n){let i=t.longitude,o=t.latitude,r=Math.cos(o),s=r*Math.cos(i),a=r*Math.sin(i),c=Math.sin(o);return l(n)||(n=new h),n.x=s,n.y=a,n.z=c,h.normalize(n,n)}geodeticSurfaceNormal(t,n){if(!h.equalsEpsilon(t,h.ZERO,W.EPSILON14))return l(n)||(n=new h),n=h.multiplyComponents(t,this._oneOverRadiiSquared,n),h.normalize(n,n)}cartographicToCartesian(t,n){let i=kMe,o=UMe;this.geodeticSurfaceNormalCartographic(t,i),h.multiplyComponents(this._radiiSquared,i,o);let r=Math.sqrt(h.dot(i,o));return h.divideByScalar(o,r,o),h.multiplyByScalar(i,t.height,i),l(n)||(n=new h),h.add(o,i,n)}cartographicArrayToCartesianArray(t,n){let i=t.length;l(n)?n.length=i:n=new Array(i);for(let o=0;o=this._radii.z-n))return i}getLocalCurvature(t,n){l(n)||(n=new k);let i=this.getSurfaceNormalIntersectionWithZAxis(t,0,zMe),o=h.distance(t,i),r=this.minimumRadius*o/this.maximumRadius**2,s=o*r**2;return k.fromElements(1/o,1/s,n)}surfaceArea(t){let n=t.west,i=t.east,o=t.south,r=t.north;for(;i0){o=r-1;continue}return r}return~(o+1)}var Eo=JMe;var zHt=x(T(),1);function jMe(e,t,n,i,o){this.xPoleWander=e,this.yPoleWander=t,this.xPoleOffset=n,this.yPoleOffset=i,this.ut1MinusUtc=o}var Zy=jMe;var fKt=x(T(),1);var $Ht=x(T(),1);var KHt=x(T(),1);function QMe(e){return e%4===0&&e%100!==0||e%400===0}var Pl=QMe;var Qle=[31,28,31,30,31,30,31,31,30,31,30,31];function qMe(e,t,n,i,o,r,s,a){e=e??1,t=t??1,n=n??1,i=i??0,o=o??0,r=r??0,s=s??0,a=a??!1,this.year=e,this.month=t,this.day=n,this.hour=i,this.minute=o,this.second=r,this.millisecond=s,this.isLeapSecond=a;function y(){Ko.typeOf.number.greaterThanOrEquals("Year",e,1),Ko.typeOf.number.lessThanOrEquals("Year",e,9999),Ko.typeOf.number.greaterThanOrEquals("Month",t,1),Ko.typeOf.number.lessThanOrEquals("Month",t,12),Ko.typeOf.number.greaterThanOrEquals("Day",n,1),Ko.typeOf.number.lessThanOrEquals("Day",n,31),Ko.typeOf.number.greaterThanOrEquals("Hour",i,0),Ko.typeOf.number.lessThanOrEquals("Hour",i,23),Ko.typeOf.number.greaterThanOrEquals("Minute",o,0),Ko.typeOf.number.lessThanOrEquals("Minute",o,59),Ko.typeOf.bool("IsLeapSecond",a),Ko.typeOf.number.greaterThanOrEquals("Second",r,0),Ko.typeOf.number.lessThanOrEquals("Second",r,a?60:59),Ko.typeOf.number.greaterThanOrEquals("Millisecond",s,0),Ko.typeOf.number.lessThan("Millisecond",s,1e3)}function _(){let S=t===2&&Pl(e)?Qle[t-1]+1:Qle[t-1];if(n>S)throw new ge("Month and Day represents invalid date")}}var vh=qMe;var tKt=x(T(),1);function $Me(e,t){this.julianDate=e,this.offset=t}var To=$Me;var iKt=x(T(),1),qle={SECONDS_PER_MILLISECOND:.001,SECONDS_PER_MINUTE:60,MINUTES_PER_HOUR:60,HOURS_PER_DAY:24,SECONDS_PER_HOUR:3600,MINUTES_PER_DAY:1440,SECONDS_PER_DAY:86400,DAYS_PER_JULIAN_CENTURY:36525,PICOSECOND:1e-9,MODIFIED_JULIAN_DATE_DIFFERENCE:24000005e-1};Object.freeze(qle);var wn=qle;var rKt=x(T(),1),$le={UTC:0,TAI:1};Object.freeze($le);var ci=$le;var ede=new vh,gD=[31,28,31,30,31,30,31,31,30,31,30,31],yD=29;function Gj(e,t){return bi.compare(e.julianDate,t.julianDate)}var $R=new To;function xD(e){$R.julianDate=e;let t=bi.leapSeconds,n=Eo(t,$R,Gj);n<0&&(n=~n),n>=t.length&&(n=t.length-1);let i=t[n].offset;n>0&&bi.secondsDifference(t[n].julianDate,e)>i&&(n--,i=t[n].offset),bi.addSeconds(e,i,e)}function tde(e,t){$R.julianDate=e;let n=bi.leapSeconds,i=Eo(n,$R,Gj);if(i<0&&(i=~i),i===0)return bi.addSeconds(e,-n[0].offset,t);if(i>=n.length)return bi.addSeconds(e,-n[i-1].offset,t);let o=bi.secondsDifference(n[i].julianDate,e);if(o===0)return bi.addSeconds(e,-n[i].offset,t);if(!(o<=1))return bi.addSeconds(e,-n[i-1].offset,t)}function Ry(e,t,n){let i=t/wn.SECONDS_PER_DAY|0;return e+=i,t-=wn.SECONDS_PER_DAY*i,t<0&&(e--,t+=wn.SECONDS_PER_DAY),n.dayNumber=e,n.secondsOfDay=t,n}function Aj(e,t,n,i,o,r,s){let a=(t-14)/12|0,c=e+4800+a,d=(1461*c/4|0)+(367*(t-2-12*a)/12|0)-(3*((c+100)/100|0)/4|0)+n-32075;i=i-12,i<0&&(i+=24);let u=r+(i*wn.SECONDS_PER_HOUR+o*wn.SECONDS_PER_MINUTE+s*wn.SECONDS_PER_MILLISECOND);return u>=43200&&(d-=1),[d,u]}var ewe=/^(\d{4})$/,twe=/^(\d{4})-(\d{2})$/,nwe=/^(\d{4})-?(\d{3})$/,iwe=/^(\d{4})-?W(\d{2})-?(\d{1})?$/,owe=/^(\d{4})-?(\d{2})-?(\d{2})$/,Lj=/([Z+\-])?(\d{2})?:?(\d{2})?$/,rwe=/^(\d{2})(\.\d+)?/.source+Lj.source,swe=/^(\d{2}):?(\d{2})(\.\d+)?/.source+Lj.source,awe=/^(\d{2}):?(\d{2}):?(\d{2})(\.\d+)?/.source+Lj.source;var Cy={year:0,month:0,day:0,hour:0,minute:0,second:0,millisecond:0},cwe=[1,10,100,1e3,1e4,1e5,1e6,1e7,1e8,1e9,1e10,1e11,1e12,1e13,1e14,1e15];function $0(e,t){let n=e.charCodeAt(t)-48,i=e.charCodeAt(t+1)-48;return n<0||n>9||i<0||i>9?-1:n*10+i}var nde=NaN,ide=0;function ode(e,t,n,i,o,r,s){Cy.year=e,Cy.month=t,Cy.day=n,Cy.hour=i,Cy.minute=o,Cy.second=r,Cy.millisecond=s}function lwe(e){let t=e.length;if(t===4){let f=$0(e,0),y=$0(e,2);return f<0||y<0?!1:(ode(f*100+y,1,1,0,0,0,0),!0)}let n=e.charCodeAt(t-1)===90,i=n?t-1:t;if(i<19||e.charCodeAt(4)!==45||e.charCodeAt(7)!==45||e.charCodeAt(10)!==84||e.charCodeAt(13)!==58||e.charCodeAt(16)!==58)return!1;let o=$0(e,0),r=$0(e,2),s=$0(e,5),a=$0(e,8),c=$0(e,11),d=$0(e,14),u=$0(e,17);if(o<0||r<0||s<1||s>12||a<1||a>31||c<0||c>23||d<0||d>59||u<0||u>60)return!1;let m=0;if(i>19){let f=e.charCodeAt(19),y=i-20;if(f!==46&&f!==44||y<1||y>15)return!1;let _=0;for(let S=20;S9)return!1;_=_*10+Z}m=_/cwe[y]*1e3}let p=o*100+r,b=Pl(p);if((s!==2||!b?gD[s-1]:yD)=60;)o-=60,i++;for(;i>=24;)i-=24,n++;for(d=a&&t===2?yD:gD[t-1];n>d;)n-=d,t++,t>12&&(t-=12,e++),d=a&&t===2?yD:gD[t-1];for(;o<0;)o+=60,i--;for(;i<0;)i+=24,n--;for(;n<1;)t--,t<1&&(t+=12,e--),d=a&&t===2?yD:gD[t-1],n+=d;let m=Aj(e,t,n,i,o,r,s);return l(c)?(Ry(m[0],m[1],c),xD(c)):c=new bi(m[0],m[1],ci.UTC),u&&bi.addSeconds(c,1,c),c}var bi=class e{constructor(t,n,i){this.dayNumber=void 0,this.secondsOfDay=void 0,t=t??0,n=n??0,i=i??ci.UTC;let o=t|0;n=n+(t-o)*wn.SECONDS_PER_DAY,Ry(o,n,this),i===ci.UTC&&xD(this)}static fromGregorianDate(t,n){let i=Aj(t.year,t.month,t.day,t.hour,t.minute,t.second,t.millisecond);return l(n)?(Ry(i[0],i[1],n),xD(n),n):new e(i[0],i[1],ci.UTC)}static fromDate(t,n){let i=Aj(t.getUTCFullYear(),t.getUTCMonth()+1,t.getUTCDate(),t.getUTCHours(),t.getUTCMinutes(),t.getUTCSeconds(),t.getUTCMilliseconds());return l(n)?(Ry(i[0],i[1],n),xD(n),n):new e(i[0],i[1],ci.UTC)}static fromIso8601(t,n){if(lwe(t)){let _=Cy;return rde(_.year,_.month,_.day,_.hour,_.minute,_.second,_.millisecond,Pl(_.year),n)}t=t.replace(",",".");let i=t.split("T"),o,r=1,s=1,a=0,c=0,d=0,u=0,m=i[0],p=i[1],b,f;if(i=m.match(owe),i!==null)o=+i[1],r=+i[2],s=+i[3];else if(i=m.match(twe),i!==null)o=+i[1],r=+i[2];else if(i=m.match(ewe),i!==null)o=+i[1];else{let _;if(i=m.match(nwe),i!==null)o=+i[1],_=+i[2],f=Pl(o);else if(i=m.match(iwe),i!==null){o=+i[1];let S=+i[2],Z=+i[3]||0,R=new Date(Date.UTC(o,0,4));_=S*7+Z-R.getUTCDay()-3}b=new Date(Date.UTC(o,0,1)),b.setUTCDate(_),r=b.getUTCMonth()+1,s=b.getUTCDate()}f=Pl(o);let y;if(l(p)){i=p.match(awe),i!==null?(a=+i[1],c=+i[2],d=+i[3],u=+(i[4]||0)*1e3,y=5):(i=p.match(swe),i!==null?(a=+i[1],c=+i[2],d=+(i[3]||0)*60,y=4):(i=p.match(rwe),i!==null&&(a=+i[1],c=+(i[2]||0)*60,y=3)));let _=i[y],S=+i[y+1],Z=+(i[y+2]||0);switch(_){case"+":a=a-S,c=c-Z;break;case"-":a=a+S,c=c+Z;break;case"Z":break;default:c=c+new Date(Date.UTC(o,r-1,s,a,c)).getTimezoneOffset();break}}return rde(o,r,s,a,c,d,u,f,n)}static now(t){return e.fromDate(new Date,t)}static toGregorianDate(t,n){let i=!1,o=tde(t,bD);l(o)||(e.addSeconds(t,-1,bD),o=tde(bD,bD),i=!0);let r=o.dayNumber,s=o.secondsOfDay;s>=43200&&(r+=1);let a=r+68569|0,c=4*a/146097|0;a=a-((146097*c+3)/4|0)|0;let d=4e3*(a+1)/1461001|0;a=a-(1461*d/4|0)+31|0;let u=80*a/2447|0,m=a-(2447*u/80|0)|0;a=u/11|0;let p=u+2-12*a|0,b=100*(c-49)+d+a|0,f=s/wn.SECONDS_PER_HOUR|0,y=s-f*wn.SECONDS_PER_HOUR,_=y/wn.SECONDS_PER_MINUTE|0;y=y-_*wn.SECONDS_PER_MINUTE;let S=y|0,Z=(y-S)/wn.SECONDS_PER_MILLISECOND;return f+=12,f>23&&(f-=24),i&&(S+=1),l(n)?(n.year=b,n.month=p,n.day=m,n.hour=f,n.minute=_,n.second=S,n.millisecond=Z,n.isLeapSecond=i,n):new vh(b,p,m,f,_,S,Z,i)}static toDate(t){let n=e.toGregorianDate(t,ede),i=n.second;return n.isLeapSecond&&(i-=1),new Date(Date.UTC(n.year,n.month-1,n.day,n.hour,n.minute,i,n.millisecond))}static toIso8601(t,n){let i=e.toGregorianDate(t,ede),o=i.year,r=i.month,s=i.day,a=i.hour,c=i.minute,d=i.second,u=i.millisecond;o===1e4&&r===1&&s===1&&a===0&&c===0&&d===0&&u===0&&(o=9999,r=12,s=31,a=24);let m;if(!l(n)&&u!==0){let p=u*.01;return m=p<1e-6?p.toFixed(20).replace(".","").replace(/0+$/,""):p.toString().replace(".",""),`${o.toString().padStart(4,"0")}-${r.toString().padStart(2,"0")}-${s.toString().padStart(2,"0")}T${a.toString().padStart(2,"0")}:${c.toString().padStart(2,"0")}:${d.toString().padStart(2,"0")}.${m}Z`}return!l(n)||n===0?`${o.toString().padStart(4,"0")}-${r.toString().padStart(2,"0")}-${s.toString().padStart(2,"0")}T${a.toString().padStart(2,"0")}:${c.toString().padStart(2,"0")}:${d.toString().padStart(2,"0")}Z`:(m=(u*.01).toFixed(n).replace(".","").slice(0,n),`${o.toString().padStart(4,"0")}-${r.toString().padStart(2,"0")}-${s.toString().padStart(2,"0")}T${a.toString().padStart(2,"0")}:${c.toString().padStart(2,"0")}:${d.toString().padStart(2,"0")}.${m}Z`)}static clone(t,n){if(l(t))return l(n)?(n.dayNumber=t.dayNumber,n.secondsOfDay=t.secondsOfDay,n):new e(t.dayNumber,t.secondsOfDay,ci.TAI)}static compare(t,n){let i=t.dayNumber-n.dayNumber;return i!==0?i:t.secondsOfDay-n.secondsOfDay}static equals(t,n){return t===n||l(t)&&l(n)&&t.dayNumber===n.dayNumber&&t.secondsOfDay===n.secondsOfDay}static equalsEpsilon(t,n,i){return i=i??0,t===n||l(t)&&l(n)&&Math.abs(e.secondsDifference(t,n))<=i}static totalDays(t){return t.dayNumber+t.secondsOfDay/wn.SECONDS_PER_DAY}static secondsDifference(t,n){return(t.dayNumber-n.dayNumber)*wn.SECONDS_PER_DAY+(t.secondsOfDay-n.secondsOfDay)}static daysDifference(t,n){let i=t.dayNumber-n.dayNumber,o=(t.secondsOfDay-n.secondsOfDay)/wn.SECONDS_PER_DAY;return i+o}static computeTaiMinusUtc(t){$R.julianDate=t;let n=e.leapSeconds,i=Eo(n,$R,Gj);return i<0&&(i=~i,--i,i<0&&(i=0)),n[i].offset}static addSeconds(t,n,i){return Ry(t.dayNumber,t.secondsOfDay+n,i)}static addMinutes(t,n,i){let o=t.secondsOfDay+n*wn.SECONDS_PER_MINUTE;return Ry(t.dayNumber,o,i)}static addHours(t,n,i){let o=t.secondsOfDay+n*wn.SECONDS_PER_HOUR;return Ry(t.dayNumber,o,i)}static addDays(t,n,i){let o=t.dayNumber+n;return Ry(o,t.secondsOfDay,i)}static lessThan(t,n){return e.compare(t,n)<0}static lessThanOrEquals(t,n){return e.compare(t,n)<=0}static greaterThan(t,n){return e.compare(t,n)>0}static greaterThanOrEquals(t,n){return e.compare(t,n)>=0}clone(t){return e.clone(this,t)}equals(t){return e.equals(this,t)}equalsEpsilon(t,n){return e.equalsEpsilon(this,t,n)}toString(){return e.toIso8601(this)}},bD=new bi(0,0,ci.TAI);bi.leapSeconds=[new To(new bi(2441317,43210,ci.TAI),10),new To(new bi(2441499,43211,ci.TAI),11),new To(new bi(2441683,43212,ci.TAI),12),new To(new bi(2442048,43213,ci.TAI),13),new To(new bi(2442413,43214,ci.TAI),14),new To(new bi(2442778,43215,ci.TAI),15),new To(new bi(2443144,43216,ci.TAI),16),new To(new bi(2443509,43217,ci.TAI),17),new To(new bi(2443874,43218,ci.TAI),18),new To(new bi(2444239,43219,ci.TAI),19),new To(new bi(2444786,43220,ci.TAI),20),new To(new bi(2445151,43221,ci.TAI),21),new To(new bi(2445516,43222,ci.TAI),22),new To(new bi(2446247,43223,ci.TAI),23),new To(new bi(2447161,43224,ci.TAI),24),new To(new bi(2447892,43225,ci.TAI),25),new To(new bi(2448257,43226,ci.TAI),26),new To(new bi(2448804,43227,ci.TAI),27),new To(new bi(2449169,43228,ci.TAI),28),new To(new bi(2449534,43229,ci.TAI),29),new To(new bi(2450083,43230,ci.TAI),30),new To(new bi(2450630,43231,ci.TAI),31),new To(new bi(2451179,43232,ci.TAI),32),new To(new bi(2453736,43233,ci.TAI),33),new To(new bi(2454832,43234,ci.TAI),34),new To(new bi(2456109,43235,ci.TAI),35),new To(new bi(2457204,43236,ci.TAI),36),new To(new bi(2457754,43237,ci.TAI),37)];var Q=bi;var ojt=x(T(),1),Vde=x(gu(),1);var TKt=x(T(),1);function dwe(e){return(e.length===0||e[e.length-1]!=="/")&&(e=`${e}/`),e}var JA=dwe;var SKt=x(T(),1);function mde(e,t){if(e===null||typeof e!="object")return e;t=t??!1;let n=new e.constructor;for(let i in e)if(e.hasOwnProperty(i)){let o=e[i];t&&(o=mde(o,t)),n[i]=o}return n}var $e=mde;var CKt=x(T(),1);function hde(e,t,n){n=n??!1;let i={},o=l(e),r=l(t),s,a,c;if(o)for(s in e)e.hasOwnProperty(s)&&(a=e[s],r&&n&&typeof a=="object"&&t.hasOwnProperty(s)?(c=t[s],typeof c=="object"?i[s]=hde(a,c,n):i[s]=a):i[s]=a);if(r)for(s in t)t.hasOwnProperty(s)&&!i.hasOwnProperty(s)&&(c=t[s],i[s]=c);return i}var It=hde;var EKt=x(T(),1);function uwe(){let e,t,n=new Promise(function(i,o){e=i,t=o});return{resolve:e,reject:t,promise:n}}var Cd=uwe;var LKt=x(T(),1),fde=x(gu(),1);function Wj(e,t){let n;return typeof document<"u"&&(n=document),Wj._implementation(e,t,n)}Wj._implementation=function(e,t,n){if(!l(t)){if(typeof n>"u")return e;t=n.baseURI??n.location.href}let i=new fde.default(e);return i.scheme()!==""?i.toString():i.absoluteTo(t).toString()};var _m=Wj;var vKt=x(T(),1),pde=x(gu(),1);function mwe(e,t){let n="",i=e.lastIndexOf("/");return i!==-1&&(n=e.substring(0,i+1)),t&&(e=new pde.default(e),e.query().length!==0&&(n+=`?${e.query()}`),e.fragment().length!==0&&(n+=`#${e.fragment()}`)),n}var jA=mwe;var IKt=x(T(),1),bde=x(gu(),1);function hwe(e){let t=new bde.default(e);t.normalize();let n=t.path(),i=n.lastIndexOf("/");return i!==-1&&(n=n.substr(i+1)),i=n.lastIndexOf("."),i===-1?n="":n=n.substr(i+1),n}var eb=hwe;var NKt=x(T(),1);var gde={};function fwe(e,t,n){l(t)||(t=e.width),l(n)||(n=e.height);let i=gde[t];l(i)||(i={},gde[t]=i);let o=i[n];if(!l(o)){let r=document.createElement("canvas");r.width=t,r.height=n,o=r.getContext("2d",{willReadFrequently:!0}),o.globalCompositeOperation="copy",i[n]=o}return o.drawImage(e,0,0,t,n),o.getImageData(0,0,t,n).data}var Fh=fwe;var MKt=x(T(),1);var pwe=/^blob:/i;function bwe(e){return pwe.test(e)}var qT=bwe;var UKt=x(T(),1);var _p;function gwe(e){l(_p)||(_p=document.createElement("a")),_p.href=window.location.href;let t=_p.host,n=_p.protocol;return _p.href=e,_p.href=_p.href,n!==_p.protocol||t!==_p.host}var Vy=gwe;var OKt=x(T(),1);var ywe=/^data:/i;function xwe(e){return ywe.test(e)}var Ih=xwe;var zKt=x(T(),1);function Twe(e){let t=document.createElement("script");return t.async=!0,t.src=e,new Promise((n,i)=>{window.crossOriginIsolated&&t.setAttribute("crossorigin","anonymous");let o=document.getElementsByTagName("head")[0];t.onload=function(){t.onload=void 0,o.removeChild(t),n()},t.onerror=function(r){i(r)},o.appendChild(t)})}var $T=Twe;var KKt=x(T(),1);function _we(e){let t="";for(let n in e)if(e.hasOwnProperty(n)){let i=e[n],o=`${encodeURIComponent(n)}=`;if(Array.isArray(i))for(let r=0,s=i.length;r0){let s=o.substring(0,r),a=o.substring(r+2);t[s]=a}}return t}var QA=Zwe;function Tde(e,t,n){this.statusCode=e,this.response=t,this.responseHeaders=n,typeof this.responseHeaders=="string"&&(this.responseHeaders=QA(this.responseHeaders))}Tde.prototype.toString=function(){let e="Request has failed.";return l(this.statusCode)&&(e+=` Status Code: ${this.statusCode}`),e};var Sp=Tde;var GJt=x(T(),1),VD=x(gu(),1);var bJt=x(T(),1);function qA(){this._listeners=new Map,this._toRemove=new Map,this._toAdd=new Map,this._invokingListeners=!1,this._listenerCount=0}Object.defineProperties(qA.prototype,{numberOfListeners:{get:function(){return this._listenerCount}}});qA.prototype.addEventListener=function(e,t){let n=this,i=n._invokingListeners?n._toAdd:n._listeners;return Fj(this,i,e,t)&&n._listenerCount++,function(){n.removeEventListener(e,t)}};function Fj(e,t,n,i){t.has(n)||t.set(n,new Set);let o=t.get(n);return o.has(i)?!1:(o.add(i),!0)}qA.prototype.removeEventListener=function(e,t){let n=vj(this,this._listeners,e,t),i=vj(this,this._toAdd,e,t),o=n||i;return o&&this._listenerCount--,o};function vj(e,t,n,i){let o=t.get(n);if(!o||!o.has(i))return!1;if(e._invokingListeners){if(!Fj(e,e._toRemove,n,i))return!1}else o.delete(i),o.size===0&&t.delete(n);return!0}var CD,RD;function Rwe(e){CD.apply(e,RD)}function Cwe(e,t){l(t)&&(CD=t,e.forEach(Rwe))}qA.prototype.raiseEvent=function(){this._invokingListeners=!0;let e=CD,t=RD;RD=arguments;try{this._listeners.forEach(Cwe)}finally{CD=e,RD=t}if(this._invokingListeners=!1,this._toAdd.size>0){for(let[n,i]of this._toAdd.entries())for(let o of i)Fj(this,this._listeners,n,o);this._toAdd.clear()}if(this._toRemove.size>0){for(let[n,i]of this._toRemove.entries())for(let o of i)vj(this,this._listeners,n,o);this._toRemove.clear()}};var Se=qA;var xJt=x(T(),1);function t_(e){this._comparator=e.comparator,this._array=[],this._length=0,this._maximumLength=void 0}Object.defineProperties(t_.prototype,{length:{get:function(){return this._length}},internalArray:{get:function(){return this._array}},maximumLength:{get:function(){return this._maximumLength},set:function(e){let t=this._length;if(e=0;--t)this.heapify(t)};t_.prototype.insert=function(e){let t=this._array,n=this._comparator,i=this._maximumLength,o=this._length++;for(oi&&(r=t[i],this._length=i),r};t_.prototype.pop=function(e){if(e=e??0,this._length===0)return;let t=this._array,n=t[e];return Ij(t,e,--this._length),this.heapify(e),t[this._length]=void 0,n};var $A=t_;function Vwe(e,t){return e.priority-t.priority}var Ao={numberOfAttemptedRequests:0,numberOfActiveRequests:0,numberOfCancelledRequests:0,numberOfCancelledActiveRequests:0,numberOfFailedRequests:0,numberOfActiveRequestsEver:0,lastNumberOfActiveRequests:0},n1=20,zc=new $A({comparator:Vwe});zc.maximumLength=n1;zc.reserve(n1);var Zp=[],tb={},Ewe=typeof document<"u"?new VD.default(document.location.href):new VD.default,ED=new Se;function Gr(){}Gr.maximumRequests=50;Gr.maximumRequestsPerServer=18;Gr.requestsByServer={};Gr.throttleRequests=!0;Gr.debugShowStatistics=!1;Gr.requestCompletedEvent=ED;Object.defineProperties(Gr,{statistics:{get:function(){return Ao}},priorityHeapLength:{get:function(){return n1},set:function(e){if(ee;){let t=zc.pop();n_(t)}n1=e,zc.maximumLength=e,zc.reserve(e)}}});function _de(e){l(e.priorityFunction)&&(e.priority=e.priorityFunction())}Gr.serverHasOpenSlots=function(e,t){t=t??1;let n=Gr.requestsByServer[e]??Gr.maximumRequestsPerServer;return tb[e]+t<=n};Gr.heapHasOpenSlots=function(e){return zc.length+e<=n1};function Sde(e){return e.state===Ri.UNISSUED&&(e.state=Ri.ISSUED,e.deferred=Cd()),e.deferred.promise}function Awe(e){return function(t){if(e.state===Ri.CANCELLED)return;let n=e.deferred;--Ao.numberOfActiveRequests,--tb[e.serverKey],ED.raiseEvent(),e.state=Ri.RECEIVED,e.deferred=void 0,n.resolve(t)}}function Gwe(e){return function(t){e.state!==Ri.CANCELLED&&(++Ao.numberOfFailedRequests,--Ao.numberOfActiveRequests,--tb[e.serverKey],ED.raiseEvent(t),e.state=Ri.FAILED,e.deferred.reject(t))}}function Zde(e){let t=Sde(e);return e.state=Ri.ACTIVE,Zp.push(e),++Ao.numberOfActiveRequests,++Ao.numberOfActiveRequestsEver,++tb[e.serverKey],e.requestFunction().then(Awe(e)).catch(Gwe(e)),t}function n_(e){let t=e.state===Ri.ACTIVE;if(e.state=Ri.CANCELLED,++Ao.numberOfCancelledRequests,l(e.deferred)){let n=e.deferred;n.promise.catch(()=>{}),e.deferred=void 0,n.reject(new ae(`Request cancelled: "${e.url}"`))}t&&(--Ao.numberOfActiveRequests,--tb[e.serverKey],++Ao.numberOfCancelledActiveRequests),l(e.cancelFunction)&&e.cancelFunction()}Gr.update=function(){let e,t,n=0,i=Zp.length;for(e=0;e0&&(Zp[e-n]=t)}Zp.length-=n;let o=zc.internalArray,r=zc.length;for(e=0;e0;){if(t=zc.pop(),t.cancelled){n_(t);continue}if(t.throttleByServer&&!Gr.serverHasOpenSlots(t.serverKey)){n_(t);continue}Zde(t),++a}Lwe()};Gr.getServerKey=function(e){let t=new VD.default(e);t.scheme()===""&&(t=t.absoluteTo(Ewe),t.normalize());let n=t.authority();/:/.test(n)||(n=`${n}:${t.scheme()==="https"?"443":"80"}`);let i=tb[n];return l(i)||(tb[n]=0),n};Gr.request=function(e){if(Ih(e.url)||qT(e.url))return ED.raiseEvent(),e.state=Ri.RECEIVED,e.requestFunction();if(++Ao.numberOfAttemptedRequests,l(e.serverKey)||(e.serverKey=Gr.getServerKey(e.url)),Gr.throttleRequests&&e.throttleByServer&&!Gr.serverHasOpenSlots(e.serverKey))return;if(!Gr.throttleRequests||!e.throttle)return Zde(e);if(Zp.length>=Gr.maximumRequests)return;_de(e);let t=zc.insert(e);if(l(t)){if(t===e)return;n_(t)}return Sde(e)};function Lwe(){Gr.debugShowStatistics&&(Ao.numberOfActiveRequests===0&&Ao.lastNumberOfActiveRequests>0&&(Ao.numberOfAttemptedRequests>0&&(console.log(`Number of attempted requests: ${Ao.numberOfAttemptedRequests}`),Ao.numberOfAttemptedRequests=0),Ao.numberOfCancelledRequests>0&&(console.log(`Number of cancelled requests: ${Ao.numberOfCancelledRequests}`),Ao.numberOfCancelledRequests=0),Ao.numberOfCancelledActiveRequests>0&&(console.log(`Number of cancelled active requests: ${Ao.numberOfCancelledActiveRequests}`),Ao.numberOfCancelledActiveRequests=0),Ao.numberOfFailedRequests>0&&(console.log(`Number of failed requests: ${Ao.numberOfFailedRequests}`),Ao.numberOfFailedRequests=0)),Ao.lastNumberOfActiveRequests=Ao.numberOfActiveRequests)}Gr.clearForSpecs=function(){for(;zc.length>0;){let t=zc.pop();n_(t)}let e=Zp.length;for(let t=0;t0}},credits:{get:function(){return this._credits}}});Ut.prototype.toString=function(){return this.getUrlComponent(!0,!0)};Ut.prototype.parseUrl=function(e,t,n,i){let o=new Vde.default(e),r=vwe(o.query());this._queryParameters=t?GD(r,this.queryParameters,n):r,o.search(""),o.fragment(""),l(i)&&o.scheme()===""&&(o=o.absoluteTo(_m(i))),this._url=o.toString()};function vwe(e){return e.length===0?{}:e.indexOf("=")===-1?{[e]:void 0}:yu(e)}function GD(e,t,n){if(!n)return It(e,t);let i=$e(e,!0);for(let o in t)if(t.hasOwnProperty(o)){let r=i[o],s=t[o];l(r)?(Array.isArray(r)||(r=i[o]=[r]),i[o]=r.concat(s)):i[o]=Array.isArray(s)?s.slice():s}return i}Ut.prototype.getUrlComponent=function(e,t){if(this.isDataUri)return this._url;let n=this._url;e&&(n=`${n}${Fwe(this.queryParameters)}`),n=n.replace(/%7B/g,"{").replace(/%7D/g,"}");let i=this._templateValues;return Object.keys(i).length>0&&(n=n.replace(/{(.*?)}/g,function(o,r){let s=i[r];return l(s)?encodeURIComponent(s):o})),t&&l(this.proxy)&&(n=this.proxy.getURL(n)),n};function Fwe(e){let t=Object.keys(e);return t.length===0?"":t.length===1&&!l(e[t[0]])?`?${t[0]}`:`?${e_(e)}`}Ut.prototype.setQueryParameters=function(e,t){t?this._queryParameters=GD(this._queryParameters,e,!1):this._queryParameters=GD(e,this._queryParameters,!1)};Ut.prototype.appendQueryParameters=function(e){this._queryParameters=GD(e,this._queryParameters,!0)};Ut.prototype.setTemplateValues=function(e,t){t?this._templateValues=It(this._templateValues,e):this._templateValues=It(e,this._templateValues)};Ut.prototype.getDerivedResource=function(e){let t=this.clone();if(t._retryCount=0,l(e.url)){let n=e.preserveQueryParameters??!1;t.parseUrl(e.url,!0,n,this._url)}return l(e.queryParameters)&&(t._queryParameters=It(e.queryParameters,t.queryParameters)),l(e.templateValues)&&(t._templateValues=It(e.templateValues,t.templateValues)),l(e.headers)&&(t.headers=It(e.headers,t.headers)),l(e.proxy)&&(t.proxy=e.proxy),l(e.request)&&(t.request=e.request),l(e.retryCallback)&&(t.retryCallback=e.retryCallback),l(e.retryAttempts)&&(t.retryAttempts=e.retryAttempts),t};Ut.prototype.retryOnError=function(e){let t=this.retryCallback;if(typeof t!="function"||this._retryCount>=this.retryAttempts)return Promise.resolve(!1);let n=this;return Promise.resolve(t(this,e)).then(function(i){return++n._retryCount,i})};Ut.prototype.clone=function(e){return l(e)?(e._url=this._url,e._queryParameters=$e(this._queryParameters),e._templateValues=$e(this._templateValues),e.headers=$e(this.headers),e.proxy=this.proxy,e.retryCallback=this.retryCallback,e.retryAttempts=this.retryAttempts,e._retryCount=0,e.request=this.request.clone(),e):new Ut({url:this._url,queryParameters:this.queryParameters,templateValues:this.templateValues,headers:this.headers,proxy:this.proxy,retryCallback:this.retryCallback,retryAttempts:this.retryAttempts,request:this.request.clone(),parseUrl:!1,credits:l(this.credits)?this.credits.slice():void 0})};Ut.prototype.getBaseUri=function(e){return jA(this.getUrlComponent(e),e)};Ut.prototype.appendForwardSlash=function(){this._url=JA(this._url)};Ut.prototype.fetchArrayBuffer=function(){return this.fetch({responseType:"arraybuffer"})};Ut.fetchArrayBuffer=function(e){return new Ut(e).fetchArrayBuffer()};Ut.prototype.fetchBlob=function(){return this.fetch({responseType:"blob"})};Ut.fetchBlob=function(e){return new Ut(e).fetchBlob()};Ut.prototype.fetchImage=function(e){e=e??B.EMPTY_OBJECT;let t=e.preferImageBitmap??!1,n=e.preferBlob??!1,i=e.flipY??!1,o=e.skipColorSpaceConversion??!1;if(Pj(this.request),!Ede||this.isDataUri||this.isBlobUri||!this.hasHeaders&&!n)return this._fetchImage({resource:this,flipY:i,skipColorSpaceConversion:o,preferImageBitmap:t});let r=this.fetchBlob();if(!l(r))return;let s,a,c,d;return Ut.supportsImageBitmapOptions().then(function(u){return s=u,a=s&&t,r}).then(function(u){if(!l(u))return;if(d=u,a)return Ut.createImageBitmapFromBlob(u,{flipY:i,premultiplyAlpha:!1,skipColorSpaceConversion:o});let m=window.URL.createObjectURL(u);return c=new Ut({url:m}),c._fetchImage({flipY:i,skipColorSpaceConversion:o,preferImageBitmap:!1})}).then(function(u){if(l(u))return u.blob=d,a||window.URL.revokeObjectURL(c.url),u}).catch(function(u){return l(c)&&window.URL.revokeObjectURL(c.url),u.blob=d,Promise.reject(u)})};Ut.prototype._fetchImage=function(e){let t=this,n=e.flipY,i=e.skipColorSpaceConversion,o=e.preferImageBitmap,r=t.request;r.url=t.url,r.requestFunction=function(){let a=!1;!t.isDataUri&&!t.isBlobUri&&(a=t.isCrossOriginUrl);let c=Cd();return Ut._Implementations.createImage(r,a,c,n,i,o),c.promise};let s=Hc.request(r);if(l(s))return s.catch(function(a){return r.state!==Ri.FAILED?Promise.reject(a):t.retryOnError(a).then(function(c){return c?(r.state=Ri.UNISSUED,r.deferred=void 0,t._fetchImage({flipY:n,skipColorSpaceConversion:i,preferImageBitmap:o})):Promise.reject(a)})})};Ut.fetchImage=function(e){return new Ut(e).fetchImage({flipY:e.flipY,skipColorSpaceConversion:e.skipColorSpaceConversion,preferBlob:e.preferBlob,preferImageBitmap:e.preferImageBitmap})};Ut.prototype.fetchText=function(){return this.fetch({responseType:"text"})};Ut.fetchText=function(e){return new Ut(e).fetchText()};Ut.prototype.fetchJson=function(){let e=this.fetch({responseType:"text",headers:{Accept:"application/json,*/*;q=0.01"}});if(l(e))return e.then(function(t){if(l(t))return JSON.parse(t)})};Ut.fetchJson=function(e){return new Ut(e).fetchJson()};Ut.prototype.fetchXML=function(){return this.fetch({responseType:"document",overrideMimeType:"text/xml"})};Ut.fetchXML=function(e){return new Ut(e).fetchXML()};Ut.prototype.fetchJsonp=function(e){e=e??"callback",Pj(this.request);let t;do t=`loadJsonp${W.nextRandomNumber().toString().substring(2,8)}`;while(l(window[t]));return Ade(this,e,t)};function Ade(e,t,n){let i={};i[t]=n,e.setQueryParameters(i);let o=e.request,r=e.url;o.url=r,o.requestFunction=function(){let a=Cd();return window[n]=function(c){a.resolve(c);try{delete window[n]}catch{window[n]=void 0}},Ut._Implementations.loadAndExecuteScript(r,n,a),a.promise};let s=Hc.request(o);if(l(s))return s.catch(function(a){return o.state!==Ri.FAILED?Promise.reject(a):e.retryOnError(a).then(function(c){return c?(o.state=Ri.UNISSUED,o.deferred=void 0,Ade(e,t,n)):Promise.reject(a)})})}Ut.fetchJsonp=function(e){return new Ut(e).fetchJsonp(e.callbackParameterName)};Ut.prototype._makeRequest=function(e){let t=this;Pj(t.request);let n=t.request,i=t.url;n.url=i,n.requestFunction=function(){let r=e.responseType,s=It(e.headers,t.headers),a=e.overrideMimeType,c=e.method,d=e.data,u=Cd(),m=Ut._Implementations.loadWithXhr(i,r,c,d,s,u,a);return l(m)&&l(m.abort)&&(n.cancelFunction=function(){m.abort()}),u.promise};let o=Hc.request(n);if(l(o))return o.then(function(r){return n.cancelFunction=void 0,r}).catch(function(r){return n.cancelFunction=void 0,n.state!==Ri.FAILED?Promise.reject(r):t.retryOnError(r).then(function(s){return s?(n.state=Ri.UNISSUED,n.deferred=void 0,t.fetch(e)):Promise.reject(r)})})};function Pj(e){if(e.state===Ri.ISSUED||e.state===Ri.ACTIVE)throw new ae("The Resource is already being fetched.");e.state=Ri.UNISSUED,e.deferred=void 0}var Iwe=/^data:(.*?)(;base64)?,(.*)$/;function AD(e,t){let n=decodeURIComponent(t);return e?atob(n):n}function Cde(e,t){let n=AD(e,t),i=new ArrayBuffer(n.length),o=new Uint8Array(i);for(let r=0;r{if(!a.ok){let c={};a.headers.forEach((d,u)=>{c[u]=d}),r.reject(new Sp(a.status,a,c));return}switch(t){case"text":r.resolve(a.text());break;case"json":r.resolve(a.json());break;default:r.resolve(new Uint8Array(await a.arrayBuffer()).buffer);break}}).catch(()=>{r.reject(new Sp)})}var Nwe=typeof XMLHttpRequest>"u";Ut._Implementations.loadWithXhr=function(e,t,n,i,o,r,s){let a=Iwe.exec(e);if(a!==null){r.resolve(Pwe(a,t));return}if(Nwe){Xwe(e,t,n,i,o,r,s);return}let c=new XMLHttpRequest;if(o1.contains(e)&&(c.withCredentials=!0),c.open(n,e,!0),l(s)&&l(c.overrideMimeType)&&c.overrideMimeType(s),l(o))for(let u in o)o.hasOwnProperty(u)&&c.setRequestHeader(u,o[u]);l(t)&&(c.responseType=t);let d=!1;return typeof e=="string"&&(d=e.indexOf("file://")===0||typeof window<"u"&&window.location.origin==="file://"),c.onload=function(){if((c.status<200||c.status>=300)&&!(d&&c.status===0)){r.reject(new Sp(c.status,c.response,c.getAllResponseHeaders()));return}let u=c.response,m=c.responseType;if(n==="HEAD"||n==="OPTIONS"){let b=c.getAllResponseHeaders().trim().split(/[\r\n]+/),f={};b.forEach(function(y){let _=y.split(": "),S=_.shift();f[S]=_.join(": ")}),r.resolve(f);return}if(c.status===204)r.resolve(void 0);else if(l(u)&&(!l(t)||m===t))r.resolve(u);else if(t==="json"&&typeof u=="string")try{r.resolve(JSON.parse(u))}catch(p){r.reject(p)}else(m===""||m==="document")&&l(c.responseXML)&&c.responseXML.hasChildNodes()?r.resolve(c.responseXML):(m===""||m==="text")&&l(c.responseText)?r.resolve(c.responseText):r.reject(new ae("Invalid XMLHttpRequest response type."))},c.onerror=function(u){r.reject(new Sp)},c.send(i),c};Ut._Implementations.loadAndExecuteScript=function(e,t,n){return $T(e,t).catch(function(i){n.reject(i)})};Ut._DefaultImplementations={};Ut._DefaultImplementations.createImage=Ut._Implementations.createImage;Ut._DefaultImplementations.loadWithXhr=Ut._Implementations.loadWithXhr;Ut._DefaultImplementations.loadAndExecuteScript=Ut._Implementations.loadAndExecuteScript;Ut.DEFAULT=Object.freeze(new Ut({url:typeof document>"u"?"":document.location.href.split("?")[0]}));var ve=Ut;function nG(e){e=e??B.EMPTY_OBJECT,this._dates=void 0,this._samples=void 0,this._dateColumn=-1,this._xPoleWanderRadiansColumn=-1,this._yPoleWanderRadiansColumn=-1,this._ut1MinusUtcSecondsColumn=-1,this._xCelestialPoleOffsetRadiansColumn=-1,this._yCelestialPoleOffsetRadiansColumn=-1,this._taiMinusUtcSecondsColumn=-1,this._columnCount=0,this._lastIndex=-1,this._addNewLeapSeconds=e.addNewLeapSeconds??!0,l(e.data)?Gde(this,e.data):Gde(this,{columnNames:["dateIso8601","modifiedJulianDateUtc","xPoleWanderRadians","yPoleWanderRadians","ut1MinusUtcSeconds","lengthOfDayCorrectionSeconds","xCelestialPoleOffsetRadians","yCelestialPoleOffsetRadians","taiMinusUtcSeconds"],samples:[]})}nG.fromUrl=async function(e,t){t=t??B.EMPTY_OBJECT;let n=ve.createIfNeeded(e),i;try{i=await n.fetchJson()}catch{throw new ae(`An error occurred while retrieving the EOP data from the URL ${n.url}.`)}return new nG({addNewLeapSeconds:t.addNewLeapSeconds,data:i})};nG.NONE=Object.freeze({compute:function(e,t){return l(t)?(t.xPoleWander=0,t.yPoleWander=0,t.xPoleOffset=0,t.yPoleOffset=0,t.ut1MinusUtc=0):t=new Zy(0,0,0,0,0),t}});nG.prototype.compute=function(e,t){if(!l(this._samples))return;if(l(t)||(t=new Zy(0,0,0,0,0)),this._samples.length===0)return t.xPoleWander=0,t.yPoleWander=0,t.xPoleOffset=0,t.yPoleOffset=0,t.ut1MinusUtc=0,t;let n=this._dates,i=this._lastIndex,o,r;if(l(i)){let a=n[i],c=n[i+1],d=Q.lessThanOrEquals(a,e),u=!l(c),m=u||Q.greaterThanOrEquals(c,e);if(d&&m)return o=i,!u&&c.equals(e)&&++o,r=o+1,Wde(this,n,this._samples,e,o,r,t),t}let s=Eo(n,e,Q.compare,this._dateColumn);return s>=0?(st.length-1)return s.xPoleWander=0,s.yPoleWander=0,s.xPoleOffset=0,s.yPoleOffset=0,s.ut1MinusUtc=0,s;let c=t[o],d=t[r];if(c.equals(d)||i.equals(c))return Lde(e,n,o,a,s),s;if(i.equals(d))return Lde(e,n,r,a,s),s;let u=Q.secondsDifference(i,c)/Q.secondsDifference(d,c),m=o*a,p=r*a,b=n[m+e._ut1MinusUtcSecondsColumn],f=n[p+e._ut1MinusUtcSecondsColumn],y=f-b;if(y>.5||y<-.5){let _=n[m+e._taiMinusUtcSecondsColumn],S=n[p+e._taiMinusUtcSecondsColumn];_!==S&&(d.equals(i)?b=f:f-=S-_)}return s.xPoleWander=tG(u,n[m+e._xPoleWanderRadiansColumn],n[p+e._xPoleWanderRadiansColumn]),s.yPoleWander=tG(u,n[m+e._yPoleWanderRadiansColumn],n[p+e._yPoleWanderRadiansColumn]),s.xPoleOffset=tG(u,n[m+e._xCelestialPoleOffsetRadiansColumn],n[p+e._xCelestialPoleOffsetRadiansColumn]),s.yPoleOffset=tG(u,n[m+e._yCelestialPoleOffsetRadiansColumn],n[p+e._yCelestialPoleOffsetRadiansColumn]),s.ut1MinusUtc=tG(u,b,f),s}var iG=nG;var Tjt=x(T(),1);function Kc(e,t,n){this.heading=e??0,this.pitch=t??0,this.roll=n??0}Kc.fromQuaternion=function(e,t){l(t)||(t=new Kc);let n=2*(e.w*e.y-e.z*e.x),i=1-2*(e.x*e.x+e.y*e.y),o=2*(e.w*e.x+e.y*e.z),r=1-2*(e.y*e.y+e.z*e.z),s=2*(e.w*e.z+e.x*e.y);return t.heading=-Math.atan2(s,r),t.roll=Math.atan2(o,i),t.pitch=-W.asinClamped(n),t};Kc.fromDegrees=function(e,t,n,i){return l(i)||(i=new Kc),i.heading=e*W.RADIANS_PER_DEGREE,i.pitch=t*W.RADIANS_PER_DEGREE,i.roll=n*W.RADIANS_PER_DEGREE,i};Kc.clone=function(e,t){if(l(e))return l(t)?(t.heading=e.heading,t.pitch=e.pitch,t.roll=e.roll,t):new Kc(e.heading,e.pitch,e.roll)};Kc.equals=function(e,t){return e===t||l(e)&&l(t)&&e.heading===t.heading&&e.pitch===t.pitch&&e.roll===t.roll};Kc.equalsEpsilon=function(e,t,n,i){return e===t||l(e)&&l(t)&&W.equalsEpsilon(e.heading,t.heading,n,i)&&W.equalsEpsilon(e.pitch,t.pitch,n,i)&&W.equalsEpsilon(e.roll,t.roll,n,i)};Kc.prototype.clone=function(e){return Kc.clone(this,e)};Kc.prototype.equals=function(e){return Kc.equals(this,e)};Kc.prototype.equalsEpsilon=function(e,t,n){return Kc.equalsEpsilon(this,e,t,n)};Kc.prototype.toString=function(){return`(${this.heading}, ${this.pitch}, ${this.roll})`};var Cc=Kc;var Njt=x(T(),1);var Cjt=x(T(),1);var vde={};var Fde=/((?:.*\/)|^)Cesium\.js(?:\?|\#|$)/;function Mwe(){let e=document.getElementsByTagName("script");for(let t=0,n=e.length;t"u"?e:(l(LD)||(LD=document.createElement("a")),LD.href=e,LD.href)}var i_;function Pde(){if(l(i_))return i_;let e;return typeof CESIUM_BASE_URL<"u"?e=CESIUM_BASE_URL:l(vde?.url)?e=_m(".",vde.url):typeof define=="object"&&l(define.amd)&&!define.amd.toUrlUndefined&&l($5.toUrl)?e=_m("..",o_("Core/buildModuleUrl.js")):e=Mwe(),i_=new ve({url:Ide(e)}),i_.appendForwardSlash(),i_}function wwe(e){return Ide($5.toUrl(`../${e}`))}function Xde(e){return Pde().getDerivedResource({url:e}).url}var WD;function o_(e){return l(WD)||(typeof define=="object"&&l(define.amd)&&!define.amd.toUrlUndefined&&l($5.toUrl)?WD=wwe:WD=Xde),WD(e)}o_._cesiumScriptRegex=Fde;o_._buildModuleUrlFromBaseUrl=Xde;o_._clearBaseResource=function(){i_=void 0};o_.setBaseUrl=function(e){i_=ve.DEFAULT.getDerivedResource({url:e})};o_.getCesiumBaseUrl=Pde;var en=o_;var Ajt=x(T(),1);function kwe(e,t,n){this.x=e,this.y=t,this.s=n}var r_=kwe;function vD(e){e=e??B.EMPTY_OBJECT,this._xysFileUrlTemplate=ve.createIfNeeded(e.xysFileUrlTemplate),this._interpolationOrder=e.interpolationOrder??9,this._sampleZeroJulianEphemerisDate=e.sampleZeroJulianEphemerisDate??24423965e-1,this._sampleZeroDateTT=new Q(this._sampleZeroJulianEphemerisDate,0,ci.TAI),this._stepSizeDays=e.stepSizeDays??1,this._samplesPerXysFile=e.samplesPerXysFile??1e3,this._totalSamples=e.totalSamples??27426,this._samples=new Array(this._totalSamples*3),this._chunkDownloadsInProgress=[];let t=this._interpolationOrder,n=this._denominators=new Array(t+1),i=this._xTable=new Array(t+1),o=Math.pow(this._stepSizeDays,t);for(let r=0;r<=t;++r){n[r]=o,i[r]=r*this._stepSizeDays;for(let s=0;s<=t;++s)s!==r&&(n[r]*=r-s);n[r]=1/n[r]}this._work=new Array(t+1),this._coef=new Array(t+1)}var Uwe=new Q(0,0,ci.TAI);function Xj(e,t,n){let i=Uwe;return i.dayNumber=t,i.secondsOfDay=n,Q.daysDifference(i,e._sampleZeroDateTT)}vD.prototype.preload=function(e,t,n,i){let o=Xj(this,e,t),r=Xj(this,n,i),s=o/this._stepSizeDays-this._interpolationOrder/2|0;s<0&&(s=0);let a=r/this._stepSizeDays-this._interpolationOrder/2|0+this._interpolationOrder;a>=this._totalSamples&&(a=this._totalSamples-1);let c=s/this._samplesPerXysFile|0,d=a/this._samplesPerXysFile|0,u=[];for(let m=c;m<=d;++m)u.push(Nj(this,m));return Promise.all(u)};vD.prototype.computeXysRadians=function(e,t,n){let i=Xj(this,e,t);if(i<0)return;let o=i/this._stepSizeDays|0;if(o>=this._totalSamples)return;let r=this._interpolationOrder,s=o-(r/2|0);s<0&&(s=0);let a=s+r;a>=this._totalSamples&&(a=this._totalSamples-1,s=a-r,s<0&&(s=0));let c=!1,d=this._samples;if(l(d[s*3])||(Nj(this,s/this._samplesPerXysFile|0),c=!0),l(d[a*3])||(Nj(this,a/this._samplesPerXysFile|0),c=!0),c)return;l(n)?(n.x=0,n.y=0,n.s=0):n=new r_(0,0,0);let u=i-s*this._stepSizeDays,m=this._work,p=this._denominators,b=this._coef,f=this._xTable,y,_;for(y=0;y<=r;++y)m[y]=u-f[y];for(y=0;y<=r;++y){for(b[y]=1,_=0;_<=r;++_)_!==y&&(b[y]*=m[_]);b[y]*=p[y];let S=(s+y)*3;n.x+=b[y]*d[S++],n.y+=b[y]*d[S++],n.s+=b[y]*d[S]}return n};vD.prototype._updateChunkData=function(e,{samples:t}){this._chunkDownloadsInProgress[e]=void 0;let n=this._samplesPerXysFile,i=e*n*3;for(let o=0;o0)n=Math.sqrt(u+1),s=.5*n,n=.5/n,i=(e[q.COLUMN1ROW2]-e[q.COLUMN2ROW1])*n,o=(e[q.COLUMN2ROW0]-e[q.COLUMN0ROW2])*n,r=(e[q.COLUMN0ROW1]-e[q.COLUMN1ROW0])*n;else{let m=Owe,p=0;c>a&&(p=1),d>a&&d>c&&(p=2);let b=m[p],f=m[b];n=Math.sqrt(e[q.getElementIndex(p,p)]-e[q.getElementIndex(b,b)]-e[q.getElementIndex(f,f)]+1);let y=Bwe;y[p]=.5*n,n=.5/n,s=(e[q.getElementIndex(f,b)]-e[q.getElementIndex(b,f)])*n,y[b]=(e[q.getElementIndex(b,p)]+e[q.getElementIndex(p,b)])*n,y[f]=(e[q.getElementIndex(f,p)]+e[q.getElementIndex(p,f)])*n,i=-y[0],o=-y[1],r=-y[2]}return l(t)?(t.x=i,t.y=o,t.z=r,t.w=s,t):new ft(i,o,r,s)};var Nde=new ft,Yde=new ft,Yj=new ft,Mde=new ft;ft.fromHeadingPitchRoll=function(e,t){return Mde=ft.fromAxisAngle(h.UNIT_X,e.roll,Nde),Yj=ft.fromAxisAngle(h.UNIT_Y,-e.pitch,t),t=ft.multiply(Yj,Mde,Yj),Yde=ft.fromAxisAngle(h.UNIT_Z,-e.heading,Nde),ft.multiply(Yde,t,t)};var FD=new h,Mj=new h,Ph=new ft,wde=new ft,ID=new ft;ft.packedLength=4;ft.pack=function(e,t,n){return n=n??0,t[n++]=e.x,t[n++]=e.y,t[n++]=e.z,t[n]=e.w,t};ft.unpack=function(e,t,n){return t=t??0,l(n)||(n=new ft),n.x=e[t],n.y=e[t+1],n.z=e[t+2],n.w=e[t+3],n};ft.packedInterpolationLength=3;ft.convertPackedArrayForInterpolation=function(e,t,n,i){ft.unpack(e,n*4,ID),ft.conjugate(ID,ID);for(let o=0,r=n-t+1;o=0?r=1:(r=-1,o=-o);let s=o-1,a=1-n,c=n*n,d=a*a;for(let b=7;b>=0;--b)nb[b]=(PD[b]*c-XD[b])*s,ib[b]=(PD[b]*d-XD[b])*s;let u=r*n*(1+nb[0]*(1+nb[1]*(1+nb[2]*(1+nb[3]*(1+nb[4]*(1+nb[5]*(1+nb[6]*(1+nb[7])))))))),m=a*(1+ib[0]*(1+ib[1]*(1+ib[2]*(1+ib[3]*(1+ib[4]*(1+ib[5]*(1+ib[6]*(1+ib[7])))))))),p=ft.multiplyByScalar(e,m,Kwe);return ft.multiplyByScalar(t,u,i),ft.add(p,i,i)};ft.fastSquad=function(e,t,n,i,o,r){let s=ft.fastSlerp(e,t,o,sG),a=ft.fastSlerp(n,i,o,s1);return ft.fastSlerp(s,a,2*o*(1-o),r)};ft.equals=function(e,t){return e===t||l(e)&&l(t)&&e.x===t.x&&e.y===t.y&&e.z===t.z&&e.w===t.w};ft.equalsEpsilon=function(e,t,n){return n=n??0,e===t||l(e)&&l(t)&&Math.abs(e.x-t.x)<=n&&Math.abs(e.y-t.y)<=n&&Math.abs(e.z-t.z)<=n&&Math.abs(e.w-t.w)<=n};ft.ZERO=Object.freeze(new ft(0,0,0,0));ft.IDENTITY=Object.freeze(new ft(0,0,0,1));ft.prototype.clone=function(e){return ft.clone(this,e)};ft.prototype.equals=function(e){return ft.equals(this,e)};ft.prototype.equalsEpsilon=function(e,t){return ft.equalsEpsilon(this,e,t)};ft.prototype.toString=function(){return`(${this.x}, ${this.y}, ${this.z}, ${this.w})`};var Ne=ft;var Ci={},Dj={up:{south:"east",north:"west",west:"south",east:"north"},down:{south:"west",north:"east",west:"north",east:"south"},south:{up:"west",down:"east",west:"down",east:"up"},north:{up:"east",down:"west",west:"up",east:"down"},west:{up:"north",down:"south",north:"down",south:"up"},east:{up:"south",down:"north",north:"up",south:"down"}},a1={north:[-1,0,0],east:[0,1,0],up:[0,0,1],south:[1,0,0],west:[0,-1,0],down:[0,0,-1]},Oj={},Vd={east:new h,north:new h,up:new h,west:new h,south:new h,down:new h},Ey=new h,Ay=new h,Gy=new h;Ci.localFrameToFixedFrameGenerator=function(e,t){if(!Dj.hasOwnProperty(e)||!Dj[e].hasOwnProperty(t))throw new ge("firstAxis and secondAxis must be east, north, up, west, south or down.");let n=Dj[e][t],i,o=e+t;return l(Oj[o])?i=Oj[o]:(i=function(r,s,a){if(l(a)||(a=new P),h.equalsEpsilon(r,h.ZERO,W.EPSILON14))h.unpack(a1[e],0,Ey),h.unpack(a1[t],0,Ay),h.unpack(a1[n],0,Gy);else if(W.equalsEpsilon(r.x,0,W.EPSILON14)&&W.equalsEpsilon(r.y,0,W.EPSILON14)){let c=W.sign(r.z);h.unpack(a1[e],0,Ey),e!=="east"&&e!=="west"&&h.multiplyByScalar(Ey,c,Ey),h.unpack(a1[t],0,Ay),t!=="east"&&t!=="west"&&h.multiplyByScalar(Ay,c,Ay),h.unpack(a1[n],0,Gy),n!=="east"&&n!=="west"&&h.multiplyByScalar(Gy,c,Gy)}else{s=s??ne.default,s.geodeticSurfaceNormal(r,Vd.up);let c=Vd.up,d=Vd.east;d.x=-r.y,d.y=r.x,d.z=0,h.normalize(d,Vd.east),h.cross(c,d,Vd.north),h.multiplyByScalar(Vd.up,-1,Vd.down),h.multiplyByScalar(Vd.east,-1,Vd.west),h.multiplyByScalar(Vd.north,-1,Vd.south),Ey=Vd[e],Ay=Vd[t],Gy=Vd[n]}return a[0]=Ey.x,a[1]=Ey.y,a[2]=Ey.z,a[3]=0,a[4]=Ay.x,a[5]=Ay.y,a[6]=Ay.z,a[7]=0,a[8]=Gy.x,a[9]=Gy.y,a[10]=Gy.z,a[11]=0,a[12]=r.x,a[13]=r.y,a[14]=r.z,a[15]=1,a},Oj[o]=i),i};Ci.eastNorthUpToFixedFrame=Ci.localFrameToFixedFrameGenerator("east","north");Ci.northEastDownToFixedFrame=Ci.localFrameToFixedFrameGenerator("north","east");Ci.northUpEastToFixedFrame=Ci.localFrameToFixedFrameGenerator("north","up");Ci.northWestUpToFixedFrame=Ci.localFrameToFixedFrameGenerator("north","west");var Jwe=new Ne,jwe=new h(1,1,1),Qwe=new P;Ci.headingPitchRollToFixedFrame=function(e,t,n,i,o){i=i??Ci.eastNorthUpToFixedFrame;let r=Ne.fromHeadingPitchRoll(t,Jwe),s=P.fromTranslationQuaternionRotationScale(h.ZERO,r,jwe,Qwe);return o=i(e,n,o),P.multiply(o,s,o)};var qwe=new P,$we=new q;Ci.headingPitchRollQuaternion=function(e,t,n,i,o){let r=Ci.headingPitchRollToFixedFrame(e,t,n,i,qwe),s=P.getMatrix3(r,$we);return Ne.fromRotationMatrix(s,o)};var e9e=new h(1,1,1),t9e=new h,Dde=new P,n9e=new P,i9e=new q,o9e=new Ne;Ci.fixedFrameToHeadingPitchRoll=function(e,t,n,i){t=t??ne.default,n=n??Ci.eastNorthUpToFixedFrame,l(i)||(i=new Cc);let o=P.getTranslation(e,t9e);if(h.equals(o,h.ZERO))return i.heading=0,i.pitch=0,i.roll=0,i;let r=P.inverseTransformation(n(o,t,Dde),Dde),s=P.setScale(e,e9e,n9e);s=P.setTranslation(s,h.ZERO,s),r=P.multiply(r,s,r);let a=Ne.fromRotationMatrix(P.getMatrix3(r,i9e),o9e);return a=Ne.normalize(a,a),Cc.fromQuaternion(a,i)};var r9e=6*3600+2460+50.54841,s9e=8640184812866e-6,a9e=.093104,c9e=-62e-7,l9e=11772758384668e-32,d9e=72921158553e-15,u9e=W.TWO_PI/86400,ND=new Q;Ci.computeIcrfToCentralBodyFixedMatrix=function(e,t){let n=Ci.computeIcrfToFixedMatrix(e,t);return l(n)||(n=Ci.computeTemeToPseudoFixedMatrix(e,t)),n};Ci.computeTemeToPseudoFixedMatrix=function(e,t){ND=Q.addSeconds(e,-Q.computeTaiMinusUtc(e),ND);let n=ND.dayNumber,i=ND.secondsOfDay,o,r=n-2451545;i>=43200?o=(r+.5)/wn.DAYS_PER_JULIAN_CENTURY:o=(r-.5)/wn.DAYS_PER_JULIAN_CENTURY;let a=(r9e+o*(s9e+o*(a9e+o*c9e)))*u9e%W.TWO_PI,c=d9e+l9e*(n-24515455e-1),d=(i+wn.SECONDS_PER_DAY*.5)%wn.SECONDS_PER_DAY,u=a+c*d,m=Math.cos(u),p=Math.sin(u);return l(t)?(t[0]=m,t[1]=-p,t[2]=0,t[3]=p,t[4]=m,t[5]=0,t[6]=0,t[7]=0,t[8]=1,t):new q(m,p,0,-p,m,0,0,0,1)};Ci.iau2006XysData=new oG;Ci.earthOrientationParameters=iG.NONE;var Hj=32.184,m9e=2451545;Ci.preloadIcrfFixed=function(e){let t=e.start.dayNumber,n=e.start.secondsOfDay+Hj,i=e.stop.dayNumber,o=e.stop.secondsOfDay+Hj;return Ci.iau2006XysData.preload(t,n,i,o)};Ci.computeIcrfToFixedMatrix=function(e,t){l(t)||(t=new q);let n=Ci.computeFixedToIcrfMatrix(e,t);if(l(n))return q.transpose(n,t)};var h9e=32.184,f9e=2451545,YD=new Cc,p9e=new q,b9e=new Q;Ci.computeMoonFixedToIcrfMatrix=function(e,t){l(t)||(t=new q);let n=Q.addSeconds(e,h9e,b9e),i=Q.totalDays(n)-f9e,o=W.toRadians(12.112)-W.toRadians(.052992)*i,r=W.toRadians(24.224)-W.toRadians(.105984)*i,s=W.toRadians(227.645)+W.toRadians(13.012)*i,a=W.toRadians(261.105)+W.toRadians(13.340716)*i,c=W.toRadians(358)+W.toRadians(.9856)*i;return YD.pitch=W.toRadians(180)-W.toRadians(3.878)*Math.sin(o)-W.toRadians(.12)*Math.sin(r)+W.toRadians(.07)*Math.sin(s)-W.toRadians(.017)*Math.sin(a),YD.roll=W.toRadians(66.53-90)+W.toRadians(1.543)*Math.cos(o)+W.toRadians(.24)*Math.cos(r)-W.toRadians(.028)*Math.cos(s)+W.toRadians(.007)*Math.cos(a),YD.heading=W.toRadians(244.375-90)+W.toRadians(13.17635831)*i+W.toRadians(3.558)*Math.sin(o)+W.toRadians(.121)*Math.sin(r)-W.toRadians(.064)*Math.sin(s)+W.toRadians(.016)*Math.sin(a)+W.toRadians(.025)*Math.sin(c),q.fromHeadingPitchRoll(YD,p9e,t)};Ci.computeIcrfToMoonFixedMatrix=function(e,t){l(t)||(t=new q);let n=Ci.computeMoonFixedToIcrfMatrix(e,t);if(l(n))return q.transpose(n,t)};var g9e=new r_(0,0,0),y9e=new Zy(0,0,0,0,0,0),Bj=new q,zj=new q;Ci.computeFixedToIcrfMatrix=function(e,t){l(t)||(t=new q);let n=Ci.earthOrientationParameters.compute(e,y9e);if(!l(n))return;let i=e.dayNumber,o=e.secondsOfDay+Hj,r=Ci.iau2006XysData.computeXysRadians(i,o,g9e);if(!l(r))return;let s=r.x+n.xPoleOffset,a=r.y+n.yPoleOffset,c=1/(1+Math.sqrt(1-s*s-a*a)),d=Bj;d[0]=1-c*s*s,d[3]=-c*s*a,d[6]=s,d[1]=-c*s*a,d[4]=1-c*a*a,d[7]=a,d[2]=-s,d[5]=-a,d[8]=1-c*(s*s+a*a);let u=q.fromRotationZ(-r.s,zj),m=q.multiply(d,u,Bj),p=e.dayNumber,b=e.secondsOfDay-Q.computeTaiMinusUtc(e)+n.ut1MinusUtc,f=p-2451545,y=b/wn.SECONDS_PER_DAY,_=.779057273264+y+.00273781191135448*(f+y);_=_%1*W.TWO_PI;let S=q.fromRotationZ(_,zj),Z=q.multiply(m,S,Bj),R=Math.cos(n.xPoleWander),C=Math.cos(n.yPoleWander),E=Math.sin(n.xPoleWander),A=Math.sin(n.yPoleWander),L=i-m9e+o/wn.SECONDS_PER_DAY;L/=36525;let F=-47e-6*L*W.RADIANS_PER_DEGREE/3600,I=Math.cos(F),N=Math.sin(F),g=zj;return g[0]=R*I,g[1]=R*N,g[2]=E,g[3]=-C*N+A*E*I,g[4]=C*I+A*E*N,g[5]=-A*R,g[6]=-A*N-C*E*I,g[7]=A*I-C*E*N,g[8]=C*R,q.multiply(Z,g,t)};var x9e=new ce;Ci.pointToWindowCoordinates=function(e,t,n,i){return i=Ci.pointToGLWindowCoordinates(e,t,n,i),i.y=2*t[5]-i.y,i};Ci.pointToGLWindowCoordinates=function(e,t,n,i){l(i)||(i=new k);let o=x9e;return P.multiplyByVector(e,ce.fromElements(n.x,n.y,n.z,1,o),o),ce.multiplyByScalar(o,1/o.w,o),P.multiplyByVector(t,o,o),k.fromCartesian4(o,i)};var T9e=new h,_9e=new h,S9e=new h;Ci.rotationMatrixFromPositionVelocity=function(e,t,n,i){let o=(n??ne.default).geodeticSurfaceNormal(e,T9e),r=h.cross(t,o,_9e);h.equalsEpsilon(r,h.ZERO,W.EPSILON6)&&(r=h.clone(h.UNIT_X,r));let s=h.cross(r,t,S9e);return h.normalize(s,s),h.cross(t,s,r),h.negate(r,r),h.normalize(r,r),l(i)||(i=new q),i[0]=t.x,i[1]=t.y,i[2]=t.z,i[3]=r.x,i[4]=r.y,i[5]=r.z,i[6]=s.x,i[7]=s.y,i[8]=s.z,i};Ci.SWIZZLE_3D_TO_2D_MATRIX=Object.freeze(new P(0,0,1,0,1,0,0,0,0,1,0,0,0,0,0,1));var Ode=new pe,Kj=new h,Z9e=new h,R9e=new q,Jj=new P,Bde=new P;Ci.basisTo2D=function(e,t,n){let i=P.getTranslation(t,Z9e),o=e.ellipsoid,r;if(h.equals(i,h.ZERO))r=h.clone(h.ZERO,Kj);else{let u=o.cartesianToCartographic(i,Ode);r=e.project(u,Kj),h.fromElements(r.z,r.x,r.y,r)}let s=Ci.eastNorthUpToFixedFrame(i,o,Jj),a=P.inverseTransformation(s,Bde),c=P.getMatrix3(t,R9e),d=P.multiplyByMatrix3(a,c,n);return P.multiply(Ci.SWIZZLE_3D_TO_2D_MATRIX,d,n),P.setTranslation(n,r,n),n};Ci.ellipsoidTo2DModelMatrix=function(e,t,n){let i=e.ellipsoid,o=Ci.eastNorthUpToFixedFrame(t,i,Jj),r=P.inverseTransformation(o,Bde),s=i.cartesianToCartographic(t,Ode),a=e.project(s,Kj);h.fromElements(a.z,a.x,a.y,a);let c=P.fromTranslation(a,Jj);return P.multiply(Ci.SWIZZLE_3D_TO_2D_MATRIX,r,n),P.multiply(c,n,n),n};var _t=Ci;var c1=class e{constructor(t,n,i,o){this.west=t??0,this.south=n??0,this.east=i??0,this.north=o??0}get width(){return e.computeWidth(this)}get height(){return e.computeHeight(this)}static pack(t,n,i){return i=i??0,n[i++]=t.west,n[i++]=t.south,n[i++]=t.east,n[i]=t.north,n}static unpack(t,n,i){return n=n??0,l(i)||(i=new e),i.west=t[n++],i.south=t[n++],i.east=t[n++],i.north=t[n],i}static computeWidth(t){let n=t.east,i=t.west;return n=0?m.longitude:m.longitude+W.TWO_PI;r=Math.min(r,p),s=Math.max(s,p)}return o-i>s-r&&(i=r,o=s,o>W.PI&&(o=o-W.TWO_PI),i>W.PI&&(i=i-W.TWO_PI)),l(n)?(n.west=i,n.south=a,n.east=o,n.north=c,n):new e(i,a,o,c)}static fromCartesianArray(t,n,i){n=n??ne.default;let o=Number.MAX_VALUE,r=-Number.MAX_VALUE,s=Number.MAX_VALUE,a=-Number.MAX_VALUE,c=Number.MAX_VALUE,d=-Number.MAX_VALUE;for(let u=0,m=t.length;u=0?p.longitude:p.longitude+W.TWO_PI;s=Math.min(s,b),a=Math.max(a,b)}return r-o>a-s&&(o=s,r=a,r>W.PI&&(r=r-W.TWO_PI),o>W.PI&&(o=o-W.TWO_PI)),l(i)?(i.west=o,i.south=c,i.east=r,i.north=d,i):new e(o,c,r,d)}static fromBoundingSphere(t,n,i){let o=t.center,r=t.radius;if(l(n)||(n=ne.default),l(i)||(i=new e),h.equals(o,h.ZERO))return e.clone(e.MAX_VALUE,i),i;let s=_t.eastNorthUpToFixedFrame(o,n,C9e),a=P.multiplyByPointAsVector(s,h.UNIT_X,V9e);h.normalize(a,a);let c=P.multiplyByPointAsVector(s,h.UNIT_Y,E9e);h.normalize(c,c),h.multiplyByScalar(c,r,c),h.multiplyByScalar(a,r,a);let d=h.negate(c,G9e),u=h.negate(a,A9e),m=jj,p=m[0];return h.add(o,c,p),p=m[1],h.add(o,u,p),p=m[2],h.add(o,d,p),p=m[3],h.add(o,a,p),m[4]=o,e.fromCartesianArray(m,n,i)}static clone(t,n){if(l(t))return l(n)?(n.west=t.west,n.south=t.south,n.east=t.east,n.north=t.north,n):new e(t.west,t.south,t.east,t.north)}static equalsEpsilon(t,n,i){return i=i??0,t===n||l(t)&&l(n)&&Math.abs(t.west-n.west)<=i&&Math.abs(t.south-n.south)<=i&&Math.abs(t.east-n.east)<=i&&Math.abs(t.north-n.north)<=i}clone(t){return e.clone(this,t)}equals(t){return e.equals(this,t)}static equals(t,n){return t===n||l(t)&&l(n)&&t.west===n.west&&t.south===n.south&&t.east===n.east&&t.north===n.north}equalsEpsilon(t,n){return e.equalsEpsilon(this,t,n)}static _validate(t){}static southwest(t,n){return l(n)?(n.longitude=t.west,n.latitude=t.south,n.height=0,n):new pe(t.west,t.south)}static northwest(t,n){return l(n)?(n.longitude=t.west,n.latitude=t.north,n.height=0,n):new pe(t.west,t.north)}static northeast(t,n){return l(n)?(n.longitude=t.east,n.latitude=t.north,n.height=0,n):new pe(t.east,t.north)}static southeast(t,n){return l(n)?(n.longitude=t.east,n.latitude=t.south,n.height=0,n):new pe(t.east,t.south)}static center(t,n){let i=t.east,o=t.west;i0?o+=W.TWO_PI:s0&&(s+=W.TWO_PI),o=m))return l(i)?(i.west=c,i.south=u,i.east=d,i.north=m,i):new e(c,u,d,m)}static simpleIntersection(t,n,i){let o=Math.max(t.west,n.west),r=Math.max(t.south,n.south),s=Math.min(t.east,n.east),a=Math.min(t.north,n.north);if(!(r>=a||o>=s))return l(i)?(i.west=o,i.south=r,i.east=s,i.north=a,i):new e(o,r,s,a)}static union(t,n,i){l(i)||(i=new e);let o=t.east,r=t.west,s=n.east,a=n.west;o0?o+=W.TWO_PI:s0&&(s+=W.TWO_PI),or||W.equalsEpsilon(i,r,W.EPSILON14))&&(i=t.south&&o<=t.north}static subsample(t,n,i,o){n=n??ne.default,i=i??0,l(o)||(o=[]);let r=0,s=t.north,a=t.south,c=t.east,d=t.west,u=L9e;u.height=i,u.longitude=d,u.latitude=s,o[r]=n.cartographicToCartesian(u,o[r]),r++,u.longitude=c,o[r]=n.cartographicToCartesian(u,o[r]),r++,u.latitude=a,o[r]=n.cartographicToCartesian(u,o[r]),r++,u.longitude=d,o[r]=n.cartographicToCartesian(u,o[r]),r++,s<0?u.latitude=s:a>0?u.latitude=a:u.latitude=0;for(let m=1;m<8;++m)u.longitude=-Math.PI+m*W.PI_OVER_TWO,e.contains(t,u)&&(o[r]=n.cartographicToCartesian(u,o[r]),r++);return u.latitude===0&&(u.longitude=d,o[r]=n.cartographicToCartesian(u,o[r]),r++,u.longitude=c,o[r]=n.cartographicToCartesian(u,o[r]),r++),o.length=r,o}static subsection(t,n,i,o,r,s){if(l(s)||(s=new e),t.west<=t.east){let c=t.east-t.west;s.west=t.west+n*c,s.east=t.west+o*c}else{let c=W.TWO_PI+t.east-t.west;s.west=W.negativePiToPi(t.west+n*c),s.east=W.negativePiToPi(t.west+o*c)}let a=t.north-t.south;return s.south=t.south+i*a,s.north=t.south+r*a,n===1&&(s.west=t.east),o===1&&(s.east=t.east),i===1&&(s.south=t.north),r===1&&(s.north=t.north),s}};c1.packedLength=4;var C9e=new P,V9e=new h,E9e=new h,A9e=new h,G9e=new h,jj=new Array(5);for(let e=0;en.width?n.width=i:i<0&&(n.width-=i,n.x=t.x),o>n.height?n.height=o:o<0&&(n.height-=o,n.y=t.y),n};hs.intersect=function(e,t){let n=e.x,i=e.y,o=t.x,r=t.y;return n>o+t.width||n+e.widthr+t.height?qt.OUTSIDE:qt.INTERSECTING};hs.equals=function(e,t){return e===t||l(e)&&l(t)&&e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height};hs.prototype.clone=function(e){return hs.clone(this,e)};hs.prototype.intersect=function(e){return hs.intersect(this,e)};hs.prototype.equals=function(e){return hs.equals(this,e)};var nt=hs;var W4t=x(T(),1);var tc={POINTS:ie.POINTS,LINES:ie.LINES,LINE_LOOP:ie.LINE_LOOP,LINE_STRIP:ie.LINE_STRIP,TRIANGLES:ie.TRIANGLES,TRIANGLE_STRIP:ie.TRIANGLE_STRIP,TRIANGLE_FAN:ie.TRIANGLE_FAN};tc.isLines=function(e){return e===tc.LINES||e===tc.LINE_LOOP||e===tc.LINE_STRIP};tc.isTriangles=function(e){return e===tc.TRIANGLES||e===tc.TRIANGLE_STRIP||e===tc.TRIANGLE_FAN};tc.validate=function(e){return e===tc.POINTS||e===tc.LINES||e===tc.LINE_LOOP||e===tc.LINE_STRIP||e===tc.TRIANGLES||e===tc.TRIANGLE_STRIP||e===tc.TRIANGLE_FAN};Object.freeze(tc);var Ie=tc;var F4t=x(T(),1),s_=`in vec4 position; +(${this[3]}, ${this[7]}, ${this[11]}, ${this[15]})`}};gr.packedLength=16;gr.fromArray=gr.unpack;gr.IDENTITY=new gr(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1);gr.ZERO=new gr(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0);gr.COLUMN0ROW0=0;gr.COLUMN0ROW1=1;gr.COLUMN0ROW2=2;gr.COLUMN0ROW3=3;gr.COLUMN1ROW0=4;gr.COLUMN1ROW1=5;gr.COLUMN1ROW2=6;gr.COLUMN1ROW3=7;gr.COLUMN2ROW0=8;gr.COLUMN2ROW1=9;gr.COLUMN2ROW2=10;gr.COLUMN2ROW3=11;gr.COLUMN3ROW0=12;gr.COLUMN3ROW1=13;gr.COLUMN3ROW2=14;gr.COLUMN3ROW3=15;var jR=new h,QR=new h,zA=new h,cMe=new h,lMe=new h,gj=new h,Ile=new h,dMe=new h,uMe=new h,mMe=new q,hMe=new q,fMe=new ce,pMe=new ce(0,0,0,1),bMe=new gr,P=gr;var bzt=x(T(),1),Ple={DEPTH_BUFFER_BIT:256,STENCIL_BUFFER_BIT:1024,COLOR_BUFFER_BIT:16384,POINTS:0,LINES:1,LINE_LOOP:2,LINE_STRIP:3,TRIANGLES:4,TRIANGLE_STRIP:5,TRIANGLE_FAN:6,ZERO:0,ONE:1,SRC_COLOR:768,ONE_MINUS_SRC_COLOR:769,SRC_ALPHA:770,ONE_MINUS_SRC_ALPHA:771,DST_ALPHA:772,ONE_MINUS_DST_ALPHA:773,DST_COLOR:774,ONE_MINUS_DST_COLOR:775,SRC_ALPHA_SATURATE:776,FUNC_ADD:32774,BLEND_EQUATION:32777,BLEND_EQUATION_RGB:32777,BLEND_EQUATION_ALPHA:34877,FUNC_SUBTRACT:32778,FUNC_REVERSE_SUBTRACT:32779,BLEND_DST_RGB:32968,BLEND_SRC_RGB:32969,BLEND_DST_ALPHA:32970,BLEND_SRC_ALPHA:32971,CONSTANT_COLOR:32769,ONE_MINUS_CONSTANT_COLOR:32770,CONSTANT_ALPHA:32771,ONE_MINUS_CONSTANT_ALPHA:32772,BLEND_COLOR:32773,ARRAY_BUFFER:34962,ELEMENT_ARRAY_BUFFER:34963,ARRAY_BUFFER_BINDING:34964,ELEMENT_ARRAY_BUFFER_BINDING:34965,STREAM_DRAW:35040,STATIC_DRAW:35044,DYNAMIC_DRAW:35048,BUFFER_SIZE:34660,BUFFER_USAGE:34661,CURRENT_VERTEX_ATTRIB:34342,FRONT:1028,BACK:1029,FRONT_AND_BACK:1032,CULL_FACE:2884,BLEND:3042,DITHER:3024,STENCIL_TEST:2960,DEPTH_TEST:2929,SCISSOR_TEST:3089,POLYGON_OFFSET_FILL:32823,SAMPLE_ALPHA_TO_COVERAGE:32926,SAMPLE_COVERAGE:32928,NO_ERROR:0,INVALID_ENUM:1280,INVALID_VALUE:1281,INVALID_OPERATION:1282,OUT_OF_MEMORY:1285,CW:2304,CCW:2305,LINE_WIDTH:2849,ALIASED_POINT_SIZE_RANGE:33901,ALIASED_LINE_WIDTH_RANGE:33902,CULL_FACE_MODE:2885,FRONT_FACE:2886,DEPTH_RANGE:2928,DEPTH_WRITEMASK:2930,DEPTH_CLEAR_VALUE:2931,DEPTH_FUNC:2932,STENCIL_CLEAR_VALUE:2961,STENCIL_FUNC:2962,STENCIL_FAIL:2964,STENCIL_PASS_DEPTH_FAIL:2965,STENCIL_PASS_DEPTH_PASS:2966,STENCIL_REF:2967,STENCIL_VALUE_MASK:2963,STENCIL_WRITEMASK:2968,STENCIL_BACK_FUNC:34816,STENCIL_BACK_FAIL:34817,STENCIL_BACK_PASS_DEPTH_FAIL:34818,STENCIL_BACK_PASS_DEPTH_PASS:34819,STENCIL_BACK_REF:36003,STENCIL_BACK_VALUE_MASK:36004,STENCIL_BACK_WRITEMASK:36005,VIEWPORT:2978,SCISSOR_BOX:3088,COLOR_CLEAR_VALUE:3106,COLOR_WRITEMASK:3107,UNPACK_ALIGNMENT:3317,PACK_ALIGNMENT:3333,MAX_TEXTURE_SIZE:3379,MAX_VIEWPORT_DIMS:3386,SUBPIXEL_BITS:3408,RED_BITS:3410,GREEN_BITS:3411,BLUE_BITS:3412,ALPHA_BITS:3413,DEPTH_BITS:3414,STENCIL_BITS:3415,POLYGON_OFFSET_UNITS:10752,POLYGON_OFFSET_FACTOR:32824,TEXTURE_BINDING_2D:32873,SAMPLE_BUFFERS:32936,SAMPLES:32937,SAMPLE_COVERAGE_VALUE:32938,SAMPLE_COVERAGE_INVERT:32939,COMPRESSED_TEXTURE_FORMATS:34467,DONT_CARE:4352,FASTEST:4353,NICEST:4354,GENERATE_MIPMAP_HINT:33170,BYTE:5120,UNSIGNED_BYTE:5121,SHORT:5122,UNSIGNED_SHORT:5123,INT:5124,UNSIGNED_INT:5125,FLOAT:5126,DEPTH_COMPONENT:6402,ALPHA:6406,RGB:6407,RGBA:6408,LUMINANCE:6409,LUMINANCE_ALPHA:6410,UNSIGNED_SHORT_4_4_4_4:32819,UNSIGNED_SHORT_5_5_5_1:32820,UNSIGNED_SHORT_5_6_5:33635,FRAGMENT_SHADER:35632,VERTEX_SHADER:35633,MAX_VERTEX_ATTRIBS:34921,MAX_VERTEX_UNIFORM_VECTORS:36347,MAX_VARYING_VECTORS:36348,MAX_COMBINED_TEXTURE_IMAGE_UNITS:35661,MAX_VERTEX_TEXTURE_IMAGE_UNITS:35660,MAX_TEXTURE_IMAGE_UNITS:34930,MAX_FRAGMENT_UNIFORM_VECTORS:36349,SHADER_TYPE:35663,DELETE_STATUS:35712,LINK_STATUS:35714,VALIDATE_STATUS:35715,ATTACHED_SHADERS:35717,ACTIVE_UNIFORMS:35718,ACTIVE_ATTRIBUTES:35721,SHADING_LANGUAGE_VERSION:35724,CURRENT_PROGRAM:35725,NEVER:512,LESS:513,EQUAL:514,LEQUAL:515,GREATER:516,NOTEQUAL:517,GEQUAL:518,ALWAYS:519,KEEP:7680,REPLACE:7681,INCR:7682,DECR:7683,INVERT:5386,INCR_WRAP:34055,DECR_WRAP:34056,VENDOR:7936,RENDERER:7937,VERSION:7938,NEAREST:9728,LINEAR:9729,NEAREST_MIPMAP_NEAREST:9984,LINEAR_MIPMAP_NEAREST:9985,NEAREST_MIPMAP_LINEAR:9986,LINEAR_MIPMAP_LINEAR:9987,TEXTURE_MAG_FILTER:10240,TEXTURE_MIN_FILTER:10241,TEXTURE_WRAP_S:10242,TEXTURE_WRAP_T:10243,TEXTURE_2D:3553,TEXTURE:5890,TEXTURE_CUBE_MAP:34067,TEXTURE_BINDING_CUBE_MAP:34068,TEXTURE_CUBE_MAP_POSITIVE_X:34069,TEXTURE_CUBE_MAP_NEGATIVE_X:34070,TEXTURE_CUBE_MAP_POSITIVE_Y:34071,TEXTURE_CUBE_MAP_NEGATIVE_Y:34072,TEXTURE_CUBE_MAP_POSITIVE_Z:34073,TEXTURE_CUBE_MAP_NEGATIVE_Z:34074,MAX_CUBE_MAP_TEXTURE_SIZE:34076,TEXTURE0:33984,TEXTURE1:33985,TEXTURE2:33986,TEXTURE3:33987,TEXTURE4:33988,TEXTURE5:33989,TEXTURE6:33990,TEXTURE7:33991,TEXTURE8:33992,TEXTURE9:33993,TEXTURE10:33994,TEXTURE11:33995,TEXTURE12:33996,TEXTURE13:33997,TEXTURE14:33998,TEXTURE15:33999,TEXTURE16:34e3,TEXTURE17:34001,TEXTURE18:34002,TEXTURE19:34003,TEXTURE20:34004,TEXTURE21:34005,TEXTURE22:34006,TEXTURE23:34007,TEXTURE24:34008,TEXTURE25:34009,TEXTURE26:34010,TEXTURE27:34011,TEXTURE28:34012,TEXTURE29:34013,TEXTURE30:34014,TEXTURE31:34015,ACTIVE_TEXTURE:34016,REPEAT:10497,CLAMP_TO_EDGE:33071,MIRRORED_REPEAT:33648,FLOAT_VEC2:35664,FLOAT_VEC3:35665,FLOAT_VEC4:35666,INT_VEC2:35667,INT_VEC3:35668,INT_VEC4:35669,BOOL:35670,BOOL_VEC2:35671,BOOL_VEC3:35672,BOOL_VEC4:35673,FLOAT_MAT2:35674,FLOAT_MAT3:35675,FLOAT_MAT4:35676,SAMPLER_2D:35678,SAMPLER_CUBE:35680,VERTEX_ATTRIB_ARRAY_ENABLED:34338,VERTEX_ATTRIB_ARRAY_SIZE:34339,VERTEX_ATTRIB_ARRAY_STRIDE:34340,VERTEX_ATTRIB_ARRAY_TYPE:34341,VERTEX_ATTRIB_ARRAY_NORMALIZED:34922,VERTEX_ATTRIB_ARRAY_POINTER:34373,VERTEX_ATTRIB_ARRAY_BUFFER_BINDING:34975,IMPLEMENTATION_COLOR_READ_TYPE:35738,IMPLEMENTATION_COLOR_READ_FORMAT:35739,COMPILE_STATUS:35713,LOW_FLOAT:36336,MEDIUM_FLOAT:36337,HIGH_FLOAT:36338,LOW_INT:36339,MEDIUM_INT:36340,HIGH_INT:36341,FRAMEBUFFER:36160,RENDERBUFFER:36161,RGBA4:32854,RGB5_A1:32855,RGB565:36194,DEPTH_COMPONENT16:33189,STENCIL_INDEX:6401,STENCIL_INDEX8:36168,DEPTH_STENCIL:34041,RENDERBUFFER_WIDTH:36162,RENDERBUFFER_HEIGHT:36163,RENDERBUFFER_INTERNAL_FORMAT:36164,RENDERBUFFER_RED_SIZE:36176,RENDERBUFFER_GREEN_SIZE:36177,RENDERBUFFER_BLUE_SIZE:36178,RENDERBUFFER_ALPHA_SIZE:36179,RENDERBUFFER_DEPTH_SIZE:36180,RENDERBUFFER_STENCIL_SIZE:36181,FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE:36048,FRAMEBUFFER_ATTACHMENT_OBJECT_NAME:36049,FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL:36050,FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE:36051,COLOR_ATTACHMENT0:36064,DEPTH_ATTACHMENT:36096,STENCIL_ATTACHMENT:36128,DEPTH_STENCIL_ATTACHMENT:33306,NONE:0,FRAMEBUFFER_COMPLETE:36053,FRAMEBUFFER_INCOMPLETE_ATTACHMENT:36054,FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT:36055,FRAMEBUFFER_INCOMPLETE_DIMENSIONS:36057,FRAMEBUFFER_UNSUPPORTED:36061,FRAMEBUFFER_BINDING:36006,RENDERBUFFER_BINDING:36007,MAX_RENDERBUFFER_SIZE:34024,INVALID_FRAMEBUFFER_OPERATION:1286,UNPACK_FLIP_Y_WEBGL:37440,UNPACK_PREMULTIPLY_ALPHA_WEBGL:37441,CONTEXT_LOST_WEBGL:37442,UNPACK_COLORSPACE_CONVERSION_WEBGL:37443,BROWSER_DEFAULT_WEBGL:37444,COMPRESSED_RGB_S3TC_DXT1_EXT:33776,COMPRESSED_RGBA_S3TC_DXT1_EXT:33777,COMPRESSED_RGBA_S3TC_DXT3_EXT:33778,COMPRESSED_RGBA_S3TC_DXT5_EXT:33779,COMPRESSED_RGB_PVRTC_4BPPV1_IMG:35840,COMPRESSED_RGB_PVRTC_2BPPV1_IMG:35841,COMPRESSED_RGBA_PVRTC_4BPPV1_IMG:35842,COMPRESSED_RGBA_PVRTC_2BPPV1_IMG:35843,COMPRESSED_RGBA_ASTC_4x4_WEBGL:37808,COMPRESSED_RGB_ETC1_WEBGL:36196,COMPRESSED_RGBA_BPTC_UNORM:36492,HALF_FLOAT_OES:36193,DOUBLE:5130,READ_BUFFER:3074,UNPACK_ROW_LENGTH:3314,UNPACK_SKIP_ROWS:3315,UNPACK_SKIP_PIXELS:3316,PACK_ROW_LENGTH:3330,PACK_SKIP_ROWS:3331,PACK_SKIP_PIXELS:3332,COLOR:6144,DEPTH:6145,STENCIL:6146,RED:6403,RGB8:32849,RGBA8:32856,RGB10_A2:32857,TEXTURE_BINDING_3D:32874,UNPACK_SKIP_IMAGES:32877,UNPACK_IMAGE_HEIGHT:32878,TEXTURE_3D:32879,TEXTURE_WRAP_R:32882,MAX_3D_TEXTURE_SIZE:32883,UNSIGNED_INT_2_10_10_10_REV:33640,MAX_ELEMENTS_VERTICES:33e3,MAX_ELEMENTS_INDICES:33001,TEXTURE_MIN_LOD:33082,TEXTURE_MAX_LOD:33083,TEXTURE_BASE_LEVEL:33084,TEXTURE_MAX_LEVEL:33085,MIN:32775,MAX:32776,DEPTH_COMPONENT24:33190,MAX_TEXTURE_LOD_BIAS:34045,TEXTURE_COMPARE_MODE:34892,TEXTURE_COMPARE_FUNC:34893,CURRENT_QUERY:34917,QUERY_RESULT:34918,QUERY_RESULT_AVAILABLE:34919,STREAM_READ:35041,STREAM_COPY:35042,STATIC_READ:35045,STATIC_COPY:35046,DYNAMIC_READ:35049,DYNAMIC_COPY:35050,MAX_DRAW_BUFFERS:34852,DRAW_BUFFER0:34853,DRAW_BUFFER1:34854,DRAW_BUFFER2:34855,DRAW_BUFFER3:34856,DRAW_BUFFER4:34857,DRAW_BUFFER5:34858,DRAW_BUFFER6:34859,DRAW_BUFFER7:34860,DRAW_BUFFER8:34861,DRAW_BUFFER9:34862,DRAW_BUFFER10:34863,DRAW_BUFFER11:34864,DRAW_BUFFER12:34865,DRAW_BUFFER13:34866,DRAW_BUFFER14:34867,DRAW_BUFFER15:34868,MAX_FRAGMENT_UNIFORM_COMPONENTS:35657,MAX_VERTEX_UNIFORM_COMPONENTS:35658,SAMPLER_3D:35679,SAMPLER_2D_SHADOW:35682,FRAGMENT_SHADER_DERIVATIVE_HINT:35723,PIXEL_PACK_BUFFER:35051,PIXEL_UNPACK_BUFFER:35052,PIXEL_PACK_BUFFER_BINDING:35053,PIXEL_UNPACK_BUFFER_BINDING:35055,FLOAT_MAT2x3:35685,FLOAT_MAT2x4:35686,FLOAT_MAT3x2:35687,FLOAT_MAT3x4:35688,FLOAT_MAT4x2:35689,FLOAT_MAT4x3:35690,SRGB:35904,SRGB8:35905,SRGB8_ALPHA8:35907,COMPARE_REF_TO_TEXTURE:34894,RGBA32F:34836,RGB32F:34837,RGBA16F:34842,RGB16F:34843,VERTEX_ATTRIB_ARRAY_INTEGER:35069,MAX_ARRAY_TEXTURE_LAYERS:35071,MIN_PROGRAM_TEXEL_OFFSET:35076,MAX_PROGRAM_TEXEL_OFFSET:35077,MAX_VARYING_COMPONENTS:35659,TEXTURE_2D_ARRAY:35866,TEXTURE_BINDING_2D_ARRAY:35869,R11F_G11F_B10F:35898,UNSIGNED_INT_10F_11F_11F_REV:35899,RGB9_E5:35901,UNSIGNED_INT_5_9_9_9_REV:35902,TRANSFORM_FEEDBACK_BUFFER_MODE:35967,MAX_TRANSFORM_FEEDBACK_SEPARATE_COMPONENTS:35968,TRANSFORM_FEEDBACK_VARYINGS:35971,TRANSFORM_FEEDBACK_BUFFER_START:35972,TRANSFORM_FEEDBACK_BUFFER_SIZE:35973,TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN:35976,RASTERIZER_DISCARD:35977,MAX_TRANSFORM_FEEDBACK_INTERLEAVED_COMPONENTS:35978,MAX_TRANSFORM_FEEDBACK_SEPARATE_ATTRIBS:35979,INTERLEAVED_ATTRIBS:35980,SEPARATE_ATTRIBS:35981,TRANSFORM_FEEDBACK_BUFFER:35982,TRANSFORM_FEEDBACK_BUFFER_BINDING:35983,RGBA32UI:36208,RGB32UI:36209,RGBA16UI:36214,RGB16UI:36215,RGBA8UI:36220,RGB8UI:36221,RGBA32I:36226,RGB32I:36227,RGBA16I:36232,RGB16I:36233,RGBA8I:36238,RGB8I:36239,RED_INTEGER:36244,RGB_INTEGER:36248,RGBA_INTEGER:36249,SAMPLER_2D_ARRAY:36289,SAMPLER_2D_ARRAY_SHADOW:36292,SAMPLER_CUBE_SHADOW:36293,UNSIGNED_INT_VEC2:36294,UNSIGNED_INT_VEC3:36295,UNSIGNED_INT_VEC4:36296,INT_SAMPLER_2D:36298,INT_SAMPLER_3D:36299,INT_SAMPLER_CUBE:36300,INT_SAMPLER_2D_ARRAY:36303,UNSIGNED_INT_SAMPLER_2D:36306,UNSIGNED_INT_SAMPLER_3D:36307,UNSIGNED_INT_SAMPLER_CUBE:36308,UNSIGNED_INT_SAMPLER_2D_ARRAY:36311,DEPTH_COMPONENT32F:36012,DEPTH32F_STENCIL8:36013,FLOAT_32_UNSIGNED_INT_24_8_REV:36269,FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING:33296,FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE:33297,FRAMEBUFFER_ATTACHMENT_RED_SIZE:33298,FRAMEBUFFER_ATTACHMENT_GREEN_SIZE:33299,FRAMEBUFFER_ATTACHMENT_BLUE_SIZE:33300,FRAMEBUFFER_ATTACHMENT_ALPHA_SIZE:33301,FRAMEBUFFER_ATTACHMENT_DEPTH_SIZE:33302,FRAMEBUFFER_ATTACHMENT_STENCIL_SIZE:33303,FRAMEBUFFER_DEFAULT:33304,UNSIGNED_INT_24_8:34042,DEPTH24_STENCIL8:35056,UNSIGNED_NORMALIZED:35863,DRAW_FRAMEBUFFER_BINDING:36006,READ_FRAMEBUFFER:36008,DRAW_FRAMEBUFFER:36009,READ_FRAMEBUFFER_BINDING:36010,RENDERBUFFER_SAMPLES:36011,FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER:36052,MAX_COLOR_ATTACHMENTS:36063,COLOR_ATTACHMENT1:36065,COLOR_ATTACHMENT2:36066,COLOR_ATTACHMENT3:36067,COLOR_ATTACHMENT4:36068,COLOR_ATTACHMENT5:36069,COLOR_ATTACHMENT6:36070,COLOR_ATTACHMENT7:36071,COLOR_ATTACHMENT8:36072,COLOR_ATTACHMENT9:36073,COLOR_ATTACHMENT10:36074,COLOR_ATTACHMENT11:36075,COLOR_ATTACHMENT12:36076,COLOR_ATTACHMENT13:36077,COLOR_ATTACHMENT14:36078,COLOR_ATTACHMENT15:36079,FRAMEBUFFER_INCOMPLETE_MULTISAMPLE:36182,MAX_SAMPLES:36183,HALF_FLOAT:5131,RG:33319,RG_INTEGER:33320,R8:33321,RG8:33323,R16F:33325,R32F:33326,RG16F:33327,RG32F:33328,R8I:33329,R8UI:33330,R16I:33331,R16UI:33332,R32I:33333,R32UI:33334,RG8I:33335,RG8UI:33336,RG16I:33337,RG16UI:33338,RG32I:33339,RG32UI:33340,VERTEX_ARRAY_BINDING:34229,R8_SNORM:36756,RG8_SNORM:36757,RGB8_SNORM:36758,RGBA8_SNORM:36759,SIGNED_NORMALIZED:36764,COPY_READ_BUFFER:36662,COPY_WRITE_BUFFER:36663,COPY_READ_BUFFER_BINDING:36662,COPY_WRITE_BUFFER_BINDING:36663,UNIFORM_BUFFER:35345,UNIFORM_BUFFER_BINDING:35368,UNIFORM_BUFFER_START:35369,UNIFORM_BUFFER_SIZE:35370,MAX_VERTEX_UNIFORM_BLOCKS:35371,MAX_FRAGMENT_UNIFORM_BLOCKS:35373,MAX_COMBINED_UNIFORM_BLOCKS:35374,MAX_UNIFORM_BUFFER_BINDINGS:35375,MAX_UNIFORM_BLOCK_SIZE:35376,MAX_COMBINED_VERTEX_UNIFORM_COMPONENTS:35377,MAX_COMBINED_FRAGMENT_UNIFORM_COMPONENTS:35379,UNIFORM_BUFFER_OFFSET_ALIGNMENT:35380,ACTIVE_UNIFORM_BLOCKS:35382,UNIFORM_TYPE:35383,UNIFORM_SIZE:35384,UNIFORM_BLOCK_INDEX:35386,UNIFORM_OFFSET:35387,UNIFORM_ARRAY_STRIDE:35388,UNIFORM_MATRIX_STRIDE:35389,UNIFORM_IS_ROW_MAJOR:35390,UNIFORM_BLOCK_BINDING:35391,UNIFORM_BLOCK_DATA_SIZE:35392,UNIFORM_BLOCK_ACTIVE_UNIFORMS:35394,UNIFORM_BLOCK_ACTIVE_UNIFORM_INDICES:35395,UNIFORM_BLOCK_REFERENCED_BY_VERTEX_SHADER:35396,UNIFORM_BLOCK_REFERENCED_BY_FRAGMENT_SHADER:35398,INVALID_INDEX:4294967295,MAX_VERTEX_OUTPUT_COMPONENTS:37154,MAX_FRAGMENT_INPUT_COMPONENTS:37157,MAX_SERVER_WAIT_TIMEOUT:37137,OBJECT_TYPE:37138,SYNC_CONDITION:37139,SYNC_STATUS:37140,SYNC_FLAGS:37141,SYNC_FENCE:37142,SYNC_GPU_COMMANDS_COMPLETE:37143,UNSIGNALED:37144,SIGNALED:37145,ALREADY_SIGNALED:37146,TIMEOUT_EXPIRED:37147,CONDITION_SATISFIED:37148,WAIT_FAILED:37149,SYNC_FLUSH_COMMANDS_BIT:1,VERTEX_ATTRIB_ARRAY_DIVISOR:35070,ANY_SAMPLES_PASSED:35887,ANY_SAMPLES_PASSED_CONSERVATIVE:36202,SAMPLER_BINDING:35097,RGB10_A2UI:36975,INT_2_10_10_10_REV:36255,TRANSFORM_FEEDBACK:36386,TRANSFORM_FEEDBACK_PAUSED:36387,TRANSFORM_FEEDBACK_ACTIVE:36388,TRANSFORM_FEEDBACK_BINDING:36389,COMPRESSED_R11_EAC:37488,COMPRESSED_SIGNED_R11_EAC:37489,COMPRESSED_RG11_EAC:37490,COMPRESSED_SIGNED_RG11_EAC:37491,COMPRESSED_RGB8_ETC2:37492,COMPRESSED_SRGB8_ETC2:37493,COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2:37494,COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2:37495,COMPRESSED_RGBA8_ETC2_EAC:37496,COMPRESSED_SRGB8_ALPHA8_ETC2_EAC:37497,TEXTURE_IMMUTABLE_FORMAT:37167,MAX_ELEMENT_INDEX:36203,TEXTURE_IMMUTABLE_LEVELS:33503,MAX_TEXTURE_MAX_ANISOTROPY_EXT:34047};Object.freeze(Ple);var ie=Ple;var gMe=new h;function Xt(e){this._size=e.size,this._datatype=e.datatype,this.getValue=e.getValue}var ec={};ec[ie.FLOAT]="float";ec[ie.FLOAT_VEC2]="vec2";ec[ie.FLOAT_VEC3]="vec3";ec[ie.FLOAT_VEC4]="vec4";ec[ie.INT]="int";ec[ie.INT_VEC2]="ivec2";ec[ie.INT_VEC3]="ivec3";ec[ie.INT_VEC4]="ivec4";ec[ie.BOOL]="bool";ec[ie.BOOL_VEC2]="bvec2";ec[ie.BOOL_VEC3]="bvec3";ec[ie.BOOL_VEC4]="bvec4";ec[ie.FLOAT_MAT2]="mat2";ec[ie.FLOAT_MAT3]="mat3";ec[ie.FLOAT_MAT4]="mat4";ec[ie.SAMPLER_2D]="sampler2D";ec[ie.SAMPLER_CUBE]="samplerCube";Xt.prototype.getDeclaration=function(e){let t=`uniform ${ec[this._datatype]} ${e}`,n=this._size;return n===1?t+=";":t+=`[${n.toString()}];`,t};var yMe={czm_viewport:new Xt({size:1,datatype:ie.FLOAT_VEC4,getValue:function(e){return e.viewportCartesian4}}),czm_viewportOrthographic:new Xt({size:1,datatype:ie.FLOAT_MAT4,getValue:function(e){return e.viewportOrthographic}}),czm_viewportTransformation:new Xt({size:1,datatype:ie.FLOAT_MAT4,getValue:function(e){return e.viewportTransformation}}),czm_globeDepthTexture:new Xt({size:1,datatype:ie.SAMPLER_2D,getValue:function(e){return e.globeDepthTexture}}),czm_edgeIdTexture:new Xt({size:1,datatype:ie.SAMPLER_2D,getValue:function(e){return e.edgeIdTexture}}),czm_edgeColorTexture:new Xt({size:1,datatype:ie.SAMPLER_2D,getValue:function(e){return e.edgeColorTexture}}),czm_edgeDepthTexture:new Xt({size:1,datatype:ie.SAMPLER_2D,getValue:function(e){return e.edgeDepthTexture}}),czm_planarFillIdTexture:new Xt({size:1,datatype:ie.SAMPLER_2D,getValue:function(e){return e.planarFillIdTexture}}),czm_model:new Xt({size:1,datatype:ie.FLOAT_MAT4,getValue:function(e){return e.model}}),czm_inverseModel:new Xt({size:1,datatype:ie.FLOAT_MAT4,getValue:function(e){return e.inverseModel}}),czm_view:new Xt({size:1,datatype:ie.FLOAT_MAT4,getValue:function(e){return e.view}}),czm_view3D:new Xt({size:1,datatype:ie.FLOAT_MAT4,getValue:function(e){return e.view3D}}),czm_viewRotation:new Xt({size:1,datatype:ie.FLOAT_MAT3,getValue:function(e){return e.viewRotation}}),czm_viewRotation3D:new Xt({size:1,datatype:ie.FLOAT_MAT3,getValue:function(e){return e.viewRotation3D}}),czm_inverseView:new Xt({size:1,datatype:ie.FLOAT_MAT4,getValue:function(e){return e.inverseView}}),czm_inverseView3D:new Xt({size:1,datatype:ie.FLOAT_MAT4,getValue:function(e){return e.inverseView3D}}),czm_inverseViewRotation:new Xt({size:1,datatype:ie.FLOAT_MAT3,getValue:function(e){return e.inverseViewRotation}}),czm_inverseViewRotation3D:new Xt({size:1,datatype:ie.FLOAT_MAT3,getValue:function(e){return e.inverseViewRotation3D}}),czm_projection:new Xt({size:1,datatype:ie.FLOAT_MAT4,getValue:function(e){return e.projection}}),czm_inverseProjection:new Xt({size:1,datatype:ie.FLOAT_MAT4,getValue:function(e){return e.inverseProjection}}),czm_infiniteProjection:new Xt({size:1,datatype:ie.FLOAT_MAT4,getValue:function(e){return e.infiniteProjection}}),czm_modelView:new Xt({size:1,datatype:ie.FLOAT_MAT4,getValue:function(e){return e.modelView}}),czm_modelView3D:new Xt({size:1,datatype:ie.FLOAT_MAT4,getValue:function(e){return e.modelView3D}}),czm_modelViewRelativeToEye:new Xt({size:1,datatype:ie.FLOAT_MAT4,getValue:function(e){return e.modelViewRelativeToEye}}),czm_inverseModelView:new Xt({size:1,datatype:ie.FLOAT_MAT4,getValue:function(e){return e.inverseModelView}}),czm_inverseModelView3D:new Xt({size:1,datatype:ie.FLOAT_MAT4,getValue:function(e){return e.inverseModelView3D}}),czm_viewProjection:new Xt({size:1,datatype:ie.FLOAT_MAT4,getValue:function(e){return e.viewProjection}}),czm_inverseViewProjection:new Xt({size:1,datatype:ie.FLOAT_MAT4,getValue:function(e){return e.inverseViewProjection}}),czm_modelViewProjection:new Xt({size:1,datatype:ie.FLOAT_MAT4,getValue:function(e){return e.modelViewProjection}}),czm_inverseModelViewProjection:new Xt({size:1,datatype:ie.FLOAT_MAT4,getValue:function(e){return e.inverseModelViewProjection}}),czm_modelViewProjectionRelativeToEye:new Xt({size:1,datatype:ie.FLOAT_MAT4,getValue:function(e){return e.modelViewProjectionRelativeToEye}}),czm_modelViewInfiniteProjection:new Xt({size:1,datatype:ie.FLOAT_MAT4,getValue:function(e){return e.modelViewInfiniteProjection}}),czm_orthographicIn3D:new Xt({size:1,datatype:ie.FLOAT,getValue:function(e){return e.orthographicIn3D?1:0}}),czm_normal:new Xt({size:1,datatype:ie.FLOAT_MAT3,getValue:function(e){return e.normal}}),czm_normal3D:new Xt({size:1,datatype:ie.FLOAT_MAT3,getValue:function(e){return e.normal3D}}),czm_inverseNormal:new Xt({size:1,datatype:ie.FLOAT_MAT3,getValue:function(e){return e.inverseNormal}}),czm_inverseNormal3D:new Xt({size:1,datatype:ie.FLOAT_MAT3,getValue:function(e){return e.inverseNormal3D}}),czm_eyeHeight:new Xt({size:1,datatype:ie.FLOAT,getValue:function(e){return e.eyeHeight}}),czm_eyeCartographic:new Xt({size:1,datatype:ie.FLOAT_VEC3,getValue:function(e){return e.eyeCartographic}}),czm_eyeHeight2D:new Xt({size:1,datatype:ie.FLOAT_VEC2,getValue:function(e){return e.eyeHeight2D}}),czm_eyeEllipsoidNormalEC:new Xt({size:1,datatype:ie.FLOAT_VEC3,getValue:function(e){return e.eyeEllipsoidNormalEC}}),czm_eyeEllipsoidCurvature:new Xt({size:1,datatype:ie.FLOAT_VEC2,getValue:function(e){return e.eyeEllipsoidCurvature}}),czm_eyeToEnu:new Xt({size:1,datatype:ie.FLOAT_MAT3,getValue:function(e){return e.eyeToEnu}}),czm_modelToEnu:new Xt({size:1,datatype:ie.FLOAT_MAT4,getValue:function(e){return e.modelToEnu}}),czm_enuToModel:new Xt({size:1,datatype:ie.FLOAT_MAT4,getValue:function(e){return e.enuToModel}}),czm_entireFrustum:new Xt({size:1,datatype:ie.FLOAT_VEC2,getValue:function(e){return e.entireFrustum}}),czm_currentFrustum:new Xt({size:1,datatype:ie.FLOAT_VEC2,getValue:function(e){return e.currentFrustum}}),czm_frustumPlanes:new Xt({size:1,datatype:ie.FLOAT_VEC4,getValue:function(e){return e.frustumPlanes}}),czm_farDepthFromNearPlusOne:new Xt({size:1,datatype:ie.FLOAT,getValue:function(e){return e.farDepthFromNearPlusOne}}),czm_log2FarDepthFromNearPlusOne:new Xt({size:1,datatype:ie.FLOAT,getValue:function(e){return e.log2FarDepthFromNearPlusOne}}),czm_oneOverLog2FarDepthFromNearPlusOne:new Xt({size:1,datatype:ie.FLOAT,getValue:function(e){return e.oneOverLog2FarDepthFromNearPlusOne}}),czm_sunPositionWC:new Xt({size:1,datatype:ie.FLOAT_VEC3,getValue:function(e){return e.sunPositionWC}}),czm_sunPositionColumbusView:new Xt({size:1,datatype:ie.FLOAT_VEC3,getValue:function(e){return e.sunPositionColumbusView}}),czm_sunDirectionEC:new Xt({size:1,datatype:ie.FLOAT_VEC3,getValue:function(e){return e.sunDirectionEC}}),czm_sunDirectionWC:new Xt({size:1,datatype:ie.FLOAT_VEC3,getValue:function(e){return e.sunDirectionWC}}),czm_moonDirectionEC:new Xt({size:1,datatype:ie.FLOAT_VEC3,getValue:function(e){return e.moonDirectionEC}}),czm_lightDirectionEC:new Xt({size:1,datatype:ie.FLOAT_VEC3,getValue:function(e){return e.lightDirectionEC}}),czm_lightDirectionWC:new Xt({size:1,datatype:ie.FLOAT_VEC3,getValue:function(e){return e.lightDirectionWC}}),czm_lightColor:new Xt({size:1,datatype:ie.FLOAT_VEC3,getValue:function(e){return e.lightColor}}),czm_lightColorHdr:new Xt({size:1,datatype:ie.FLOAT_VEC3,getValue:function(e){return e.lightColorHdr}}),czm_encodedCameraPositionMCHigh:new Xt({size:1,datatype:ie.FLOAT_VEC3,getValue:function(e){return e.encodedCameraPositionMCHigh}}),czm_encodedCameraPositionMCLow:new Xt({size:1,datatype:ie.FLOAT_VEC3,getValue:function(e){return e.encodedCameraPositionMCLow}}),czm_viewerPositionWC:new Xt({size:1,datatype:ie.FLOAT_VEC3,getValue:function(e){return P.getTranslation(e.inverseView,gMe)}}),czm_frameNumber:new Xt({size:1,datatype:ie.FLOAT,getValue:function(e){return e.frameState.frameNumber}}),czm_morphTime:new Xt({size:1,datatype:ie.FLOAT,getValue:function(e){return e.frameState.morphTime}}),czm_sceneMode:new Xt({size:1,datatype:ie.FLOAT,getValue:function(e){return e.frameState.mode}}),czm_pass:new Xt({size:1,datatype:ie.FLOAT,getValue:function(e){return e.pass}}),czm_backgroundColor:new Xt({size:1,datatype:ie.FLOAT_VEC4,getValue:function(e){return e.backgroundColor}}),czm_brdfLut:new Xt({size:1,datatype:ie.SAMPLER_2D,getValue:function(e){return e.brdfLut}}),czm_environmentMap:new Xt({size:1,datatype:ie.SAMPLER_CUBE,getValue:function(e){return e.environmentMap}}),czm_specularEnvironmentMaps:new Xt({size:1,datatype:ie.SAMPLER_CUBE,getValue:function(e){return e.specularEnvironmentMaps}}),czm_specularEnvironmentMapsMaximumLOD:new Xt({size:1,datatype:ie.FLOAT,getValue:function(e){return e.specularEnvironmentMapsMaximumLOD}}),czm_sphericalHarmonicCoefficients:new Xt({size:9,datatype:ie.FLOAT_VEC3,getValue:function(e){return e.sphericalHarmonicCoefficients}}),czm_temeToPseudoFixed:new Xt({size:1,datatype:ie.FLOAT_MAT3,getValue:function(e){return e.temeToPseudoFixedMatrix}}),czm_pixelRatio:new Xt({size:1,datatype:ie.FLOAT,getValue:function(e){return e.pixelRatio}}),czm_fogDensity:new Xt({size:1,datatype:ie.FLOAT,getValue:function(e){return e.fogDensity}}),czm_fogVisualDensityScalar:new Xt({size:1,datatype:ie.FLOAT,getValue:function(e){return e.fogVisualDensityScalar}}),czm_fogMinimumBrightness:new Xt({size:1,datatype:ie.FLOAT,getValue:function(e){return e.fogMinimumBrightness}}),czm_atmosphereHsbShift:new Xt({size:1,datatype:ie.FLOAT_VEC3,getValue:function(e){return e.atmosphereHsbShift}}),czm_atmosphereLightIntensity:new Xt({size:1,datatype:ie.FLOAT,getValue:function(e){return e.atmosphereLightIntensity}}),czm_atmosphereRayleighCoefficient:new Xt({size:1,datatype:ie.FLOAT_VEC3,getValue:function(e){return e.atmosphereRayleighCoefficient}}),czm_atmosphereRayleighScaleHeight:new Xt({size:1,datatype:ie.FLOAT,getValue:function(e){return e.atmosphereRayleighScaleHeight}}),czm_atmosphereMieCoefficient:new Xt({size:1,datatype:ie.FLOAT_VEC3,getValue:function(e){return e.atmosphereMieCoefficient}}),czm_atmosphereMieScaleHeight:new Xt({size:1,datatype:ie.FLOAT,getValue:function(e){return e.atmosphereMieScaleHeight}}),czm_atmosphereMieAnisotropy:new Xt({size:1,datatype:ie.FLOAT,getValue:function(e){return e.atmosphereMieAnisotropy}}),czm_atmosphereDynamicLighting:new Xt({size:1,datatype:ie.FLOAT,getValue:function(e){return e.atmosphereDynamicLighting}}),czm_splitPosition:new Xt({size:1,datatype:ie.FLOAT,getValue:function(e){return e.splitPosition}}),czm_geometricToleranceOverMeter:new Xt({size:1,datatype:ie.FLOAT,getValue:function(e){return e.geometricToleranceOverMeter}}),czm_minimumDisableDepthTestDistance:new Xt({size:1,datatype:ie.FLOAT,getValue:function(e){return e.minimumDisableDepthTestDistance}}),czm_invertClassificationColor:new Xt({size:1,datatype:ie.FLOAT_VEC4,getValue:function(e){return e.invertClassificationColor}}),czm_gamma:new Xt({size:1,datatype:ie.FLOAT,getValue:function(e){return e.gamma}}),czm_ellipsoidRadii:new Xt({size:1,datatype:ie.FLOAT_VEC3,getValue:function(e){return e.ellipsoid.radii}}),czm_ellipsoidInverseRadii:new Xt({size:1,datatype:ie.FLOAT_VEC3,getValue:function(e){return e.ellipsoid.oneOverRadii}})},Q0=yMe;var Uzt=x(T(),1);var Zzt=x(T(),1);function xMe(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(e){let t=Math.random()*16|0;return(e==="x"?t:t&3|8).toString(16)})}var Qn=xMe;var Czt=x(T(),1);function TMe(){return!0}function _Me(e,t){t=t??"This object was destroyed, i.e., destroy() was called.";function n(){}for(let i in e)typeof e[i]=="function"&&(e[i]=n);e.isDestroyed=TMe}var ue=_Me;var Lzt=x(T(),1);var ha={UNSIGNED_BYTE:ie.UNSIGNED_BYTE,UNSIGNED_SHORT:ie.UNSIGNED_SHORT,UNSIGNED_INT:ie.UNSIGNED_INT};ha.getSizeInBytes=function(e){switch(e){case ha.UNSIGNED_BYTE:return Uint8Array.BYTES_PER_ELEMENT;case ha.UNSIGNED_SHORT:return Uint16Array.BYTES_PER_ELEMENT;case ha.UNSIGNED_INT:return Uint32Array.BYTES_PER_ELEMENT}};ha.fromSizeInBytes=function(e){switch(e){case 2:return ha.UNSIGNED_SHORT;case 4:return ha.UNSIGNED_INT;case 1:return ha.UNSIGNED_BYTE}};ha.validate=function(e){return l(e)&&(e===ha.UNSIGNED_BYTE||e===ha.UNSIGNED_SHORT||e===ha.UNSIGNED_INT)};ha.createTypedArray=function(e,t){return e>=W.SIXTY_FOUR_KILOBYTES?new Uint32Array(t):new Uint16Array(t)};ha.createTypedArrayFromArrayBuffer=function(e,t,n,i){return e>=W.SIXTY_FOUR_KILOBYTES?new Uint32Array(t,n,i):new Uint16Array(t,n,i)};ha.fromTypedArray=function(e){if(e instanceof Uint8Array)return ha.UNSIGNED_BYTE;if(e instanceof Uint16Array)return ha.UNSIGNED_SHORT;if(e instanceof Uint32Array)return ha.UNSIGNED_INT};Object.freeze(ha);var Oe=ha;var Fzt=x(T(),1);var jT={STREAM_DRAW:ie.STREAM_DRAW,STATIC_DRAW:ie.STATIC_DRAW,DYNAMIC_DRAW:ie.DYNAMIC_DRAW,DYNAMIC_READ:ie.DYNAMIC_READ};jT.validate=function(e){return e===jT.STREAM_DRAW||e===jT.STATIC_DRAW||e===jT.DYNAMIC_DRAW||e===jT.DYNAMIC_READ};Object.freeze(jT);var Pe=jT;function Bc(e){e=e??B.EMPTY_OBJECT;let t=e.context._gl,n=e.bufferTarget,i=e.typedArray,o=e.sizeInBytes,r=e.usage,s=l(i);s&&(o=i.byteLength);let a=t.createBuffer();t.bindBuffer(n,a),t.bufferData(n,s?i:o,r),t.bindBuffer(n,null),this._id=Qn(),this._gl=t,this._webgl2=e.context._webgl2,this._bufferTarget=n,this._sizeInBytes=o,this._usage=r,this._buffer=a,this.vertexArrayDestroyable=!0}Bc.createPixelBuffer=function(e){if(!e.context._webgl2)throw new ge("A WebGL 2 context is required to create PixelBuffers.");return new Bc({context:e.context,bufferTarget:ie.PIXEL_PACK_BUFFER,typedArray:e.typedArray,sizeInBytes:e.sizeInBytes,usage:e.usage})};Bc.createVertexBuffer=function(e){return new Bc({context:e.context,bufferTarget:ie.ARRAY_BUFFER,typedArray:e.typedArray,sizeInBytes:e.sizeInBytes,usage:e.usage})};Bc.createIndexBuffer=function(e){let t=e.context,n=e.indexDatatype,i=Oe.getSizeInBytes(n),o=new Bc({context:t,bufferTarget:ie.ELEMENT_ARRAY_BUFFER,typedArray:e.typedArray,sizeInBytes:e.sizeInBytes,usage:e.usage}),r=o.sizeInBytes/i;return Object.defineProperties(o,{indexDatatype:{get:function(){return n}},bytesPerIndex:{get:function(){return i}},numberOfIndices:{get:function(){return r}}}),o};Object.defineProperties(Bc.prototype,{sizeInBytes:{get:function(){return this._sizeInBytes}},usage:{get:function(){return this._usage}}});Bc.prototype._getBuffer=function(){return this._buffer};Bc.prototype._bind=function(){let e=this._gl,t=this._bufferTarget;e.bindBuffer(t,this._buffer)};Bc.prototype._unBind=function(){let e=this._gl,t=this._bufferTarget;e.bindBuffer(t,null)};Bc.prototype.copyFromArrayView=function(e,t){t=t??0;let n=this._gl,i=this._bufferTarget;n.bindBuffer(i,this._buffer),n.bufferSubData(i,t,e),n.bindBuffer(i,null)};Bc.prototype.copyFromBuffer=function(e,t,n,i){let o=ie.COPY_READ_BUFFER,r=ie.COPY_WRITE_BUFFER,s=this._gl;s.bindBuffer(r,this._buffer),s.bindBuffer(o,e._buffer),s.copyBufferSubData(o,r,t,n,i),s.bindBuffer(r,null),s.bindBuffer(o,null)};Bc.prototype.getBufferData=function(e,t,n,i){t=t??0,n=n??0;let o=this._gl,r=ie.COPY_READ_BUFFER;o.bindBuffer(r,this._buffer),o.getBufferSubData(r,t,e,n,i),o.bindBuffer(r,null)};Bc.prototype.isDestroyed=function(){return!1};Bc.prototype.destroy=function(){return this._gl.deleteBuffer(this._buffer),ue(this)};var it=Bc;var rHt=x(T(),1);var tHt=x(T(),1);var Jzt=x(T(),1);var Bzt=x(T(),1);var Sy,us={requestFullscreen:void 0,exitFullscreen:void 0,fullscreenEnabled:void 0,fullscreenElement:void 0,fullscreenchange:void 0,fullscreenerror:void 0},Rd={};Object.defineProperties(Rd,{element:{get:function(){if(Rd.supportsFullscreen())return document[us.fullscreenElement]}},changeEventName:{get:function(){if(Rd.supportsFullscreen())return us.fullscreenchange}},errorEventName:{get:function(){if(Rd.supportsFullscreen())return us.fullscreenerror}},enabled:{get:function(){if(Rd.supportsFullscreen())return document[us.fullscreenEnabled]}},fullscreen:{get:function(){if(Rd.supportsFullscreen())return Rd.element!==null}}});Rd.supportsFullscreen=function(){if(l(Sy))return Sy;Sy=!1;let e=document.body;if(typeof e.requestFullscreen=="function")return us.requestFullscreen="requestFullscreen",us.exitFullscreen="exitFullscreen",us.fullscreenEnabled="fullscreenEnabled",us.fullscreenElement="fullscreenElement",us.fullscreenchange="fullscreenchange",us.fullscreenerror="fullscreenerror",Sy=!0,Sy;let t=["webkit","moz","o","ms","khtml"],n;for(let i=0,o=t.length;i{let t=new Image;t.onload=function(){vl._result=t.width>0&&t.height>0,e(vl._result)},t.onerror=function(){vl._result=!1,e(vl._result)},t.src="data:image/webp;base64,UklGRiIAAABXRUJQVlA4IBYAAAAwAQCdASoBAAEADsD+JaQAA3AAAAAA"})),vl._promise};Object.defineProperties(vl,{initialized:{get:function(){return l(vl._result)}}});var qR=[];typeof ArrayBuffer<"u"&&(qR.push(Int8Array,Uint8Array,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array),typeof Uint8ClampedArray<"u"&&qR.push(Uint8ClampedArray),typeof Uint8ClampedArray<"u"&&qR.push(Uint8ClampedArray),typeof BigInt64Array<"u"&&qR.push(BigInt64Array),typeof BigUint64Array<"u"&&qR.push(BigUint64Array));var xm={isChrome:Sj,chromeVersion:SMe,isSafari:Yle,safariVersion:ZMe,isWebkit:Mle,webkitVersion:RMe,isEdge:mD,edgeVersion:CMe,isFirefox:hD,firefoxVersion:AMe,isWindows:VMe,isIPadOrIOS:EMe,hardwareConcurrency:ym.hardwareConcurrency??3,supportsPointerEvents:GMe,supportsImageRenderingPixelated:Ule,supportsWebP:vl,imageRenderingValue:LMe,typedArrayTypes:qR};xm.supportsBasis=function(e){return xm.supportsWebAssembly()&&e.context.supportsBasis};xm.supportsFullscreen=function(){return qr.supportsFullscreen()};xm.supportsTypedArrays=function(){return typeof ArrayBuffer<"u"};xm.supportsBigInt64Array=function(){return typeof BigInt64Array<"u"};xm.supportsBigUint64Array=function(){return typeof BigUint64Array<"u"};xm.supportsBigInt=function(){return typeof BigInt<"u"};xm.supportsWebWorkers=function(){return typeof Worker<"u"};xm.supportsWebAssembly=function(){return typeof WebAssembly<"u"};xm.supportsWebgl2=function(e){return e.context.webgl2};xm.supportsEsmWebWorkers=function(){return!hD()||parseInt(Zj)>=114};var fn=xm;function Rj(e,t,n){return n<0&&(n+=1),n>1&&(n-=1),n*6<1?e+(t-e)*6*n:n*2<1?t:n*3<2?e+(t-e)*(2/3-n)*6:e}var xe=class e{constructor(t,n,i,o){this.red=t??1,this.green=n??1,this.blue=i??1,this.alpha=o??1}static fromCartesian4(t,n){return l(n)?(n.red=t.x,n.green=t.y,n.blue=t.z,n.alpha=t.w,n):new e(t.x,t.y,t.z,t.w)}static fromBytes(t,n,i,o,r){return t=e.byteToFloat(t??255),n=e.byteToFloat(n??255),i=e.byteToFloat(i??255),o=e.byteToFloat(o??255),l(r)?(r.red=t,r.green=n,r.blue=i,r.alpha=o,r):new e(t,n,i,o)}static fromAlpha(t,n,i){return l(i)?(i.red=t.red,i.green=t.green,i.blue=t.blue,i.alpha=n,i):new e(t.red,t.green,t.blue,n)}static fromRgba(t,n){return Vj[0]=t,e.fromBytes(q0[0],q0[1],q0[2],q0[3],n)}static fromHsl(t,n,i,o,r){t=(t??0)%1,n=n??0,i=i??0,o=o??1;let s=i,a=i,c=i;if(n!==0){let d;i<.5?d=i*(1+n):d=i+n-i*n;let u=2*i-d;s=Rj(u,d,t+1/3),a=Rj(u,d,t),c=Rj(u,d,t-1/3)}return l(r)?(r.red=s,r.green=a,r.blue=c,r.alpha=o,r):new e(s,a,c,o)}static fromRandom(t,n){t=t??B.EMPTY_OBJECT;let i=t.red;if(!l(i)){let a=t.minimumRed??0,c=t.maximumRed??1;i=a+W.nextRandomNumber()*(c-a)}let o=t.green;if(!l(o)){let a=t.minimumGreen??0,c=t.maximumGreen??1;o=a+W.nextRandomNumber()*(c-a)}let r=t.blue;if(!l(r)){let a=t.minimumBlue??0,c=t.maximumBlue??1;r=a+W.nextRandomNumber()*(c-a)}let s=t.alpha;if(!l(s)){let a=t.minimumAlpha??0,c=t.maximumAlpha??1;s=a+W.nextRandomNumber()*(c-a)}return l(n)?(n.red=i,n.green=o,n.blue=r,n.alpha=s,n):new e(i,o,r,s)}static fromCssColorString(t,n){l(n)||(n=new e),t=t.trim();let i=e[t.toUpperCase()];if(l(i))return e.clone(i,n),n;let o=WMe.exec(t);return o!==null?(n.red=parseInt(o[1],16)/15,n.green=parseInt(o[2],16)/15,n.blue=parseInt(o[3],16)/15,n.alpha=parseInt(o[4]??"f",16)/15,n):(o=vMe.exec(t),o!==null?(n.red=parseInt(o[1],16)/255,n.green=parseInt(o[2],16)/255,n.blue=parseInt(o[3],16)/255,n.alpha=parseInt(o[4]??"ff",16)/255,n):(o=FMe.exec(t),o!==null?(n.red=parseFloat(o[1])/(o[1].substr(-1)==="%"?100:255),n.green=parseFloat(o[2])/(o[2].substr(-1)==="%"?100:255),n.blue=parseFloat(o[3])/(o[3].substr(-1)==="%"?100:255),n.alpha=parseFloat(o[4]??"1.0"),n):(o=IMe.exec(t),o!==null?e.fromHsl(parseFloat(o[1])/360,parseFloat(o[2])/100,parseFloat(o[3])/100,parseFloat(o[4]??"1.0"),n):(n=void 0,n))))}static pack(t,n,i){return i=i??0,n[i++]=t.red,n[i++]=t.green,n[i++]=t.blue,n[i]=t.alpha,n}static unpack(t,n,i){return n=n??0,l(i)||(i=new e),i.red=t[n++],i.green=t[n++],i.blue=t[n++],i.alpha=t[n],i}static byteToFloat(t){return t/255}static floatToByte(t){return t===1?255:t*256|0}static clone(t,n){if(l(t))return l(n)?(n.red=t.red,n.green=t.green,n.blue=t.blue,n.alpha=t.alpha,n):new e(t.red,t.green,t.blue,t.alpha)}static equals(t,n){return t===n||l(t)&&l(n)&&t.red===n.red&&t.green===n.green&&t.blue===n.blue&&t.alpha===n.alpha}static equalsArray(t,n,i){return t.red===n[i]&&t.green===n[i+1]&&t.blue===n[i+2]&&t.alpha===n[i+3]}clone(t){return e.clone(this,t)}equals(t){return e.equals(this,t)}equalsEpsilon(t,n){return this===t||l(t)&&Math.abs(this.red-t.red)<=n&&Math.abs(this.green-t.green)<=n&&Math.abs(this.blue-t.blue)<=n&&Math.abs(this.alpha-t.alpha)<=n}toString(){return`(${this.red}, ${this.green}, ${this.blue}, ${this.alpha})`}toCssColorString(){let t=e.floatToByte(this.red),n=e.floatToByte(this.green),i=e.floatToByte(this.blue);return this.alpha===1?`rgb(${t},${n},${i})`:`rgba(${t},${n},${i},${this.alpha})`}toCssHexString(){let t=e.floatToByte(this.red).toString(16);t.length<2&&(t=`0${t}`);let n=e.floatToByte(this.green).toString(16);n.length<2&&(n=`0${n}`);let i=e.floatToByte(this.blue).toString(16);if(i.length<2&&(i=`0${i}`),this.alpha<1){let o=e.floatToByte(this.alpha).toString(16);return o.length<2&&(o=`0${o}`),`#${t}${n}${i}${o}`}return`#${t}${n}${i}`}toBytes(t){let n=e.floatToByte(this.red),i=e.floatToByte(this.green),o=e.floatToByte(this.blue),r=e.floatToByte(this.alpha);return l(t)?(t[0]=n,t[1]=i,t[2]=o,t[3]=r,t):[n,i,o,r]}static bytesToRgba(t,n,i,o){return q0[0]=t,q0[1]=n,q0[2]=i,q0[3]=o,Vj[0]}toRgba(){return e.bytesToRgba(e.floatToByte(this.red),e.floatToByte(this.green),e.floatToByte(this.blue),e.floatToByte(this.alpha))}brighten(t,n){return t=1-t,n.red=1-(1-this.red)*t,n.green=1-(1-this.green)*t,n.blue=1-(1-this.blue)*t,n.alpha=this.alpha,n}darken(t,n){return t=1-t,n.red=this.red*t,n.green=this.green*t,n.blue=this.blue*t,n.alpha=this.alpha,n}withAlpha(t,n){return e.fromAlpha(this,t,n)}static add(t,n,i){return i.red=t.red+n.red,i.green=t.green+n.green,i.blue=t.blue+n.blue,i.alpha=t.alpha+n.alpha,i}static subtract(t,n,i){return i.red=t.red-n.red,i.green=t.green-n.green,i.blue=t.blue-n.blue,i.alpha=t.alpha-n.alpha,i}static multiply(t,n,i){return i.red=t.red*n.red,i.green=t.green*n.green,i.blue=t.blue*n.blue,i.alpha=t.alpha*n.alpha,i}static divide(t,n,i){return i.red=t.red/n.red,i.green=t.green/n.green,i.blue=t.blue/n.blue,i.alpha=t.alpha/n.alpha,i}static mod(t,n,i){return i.red=t.red%n.red,i.green=t.green%n.green,i.blue=t.blue%n.blue,i.alpha=t.alpha%n.alpha,i}static lerp(t,n,i,o){return o.red=W.lerp(t.red,n.red,i),o.green=W.lerp(t.green,n.green,i),o.blue=W.lerp(t.blue,n.blue,i),o.alpha=W.lerp(t.alpha,n.alpha,i),o}static multiplyByScalar(t,n,i){return i.red=t.red*n,i.green=t.green*n,i.blue=t.blue*n,i.alpha=t.alpha*n,i}static divideByScalar(t,n,i){return i.red=t.red/n,i.green=t.green/n,i.blue=t.blue/n,i.alpha=t.alpha/n,i}},Cj,Vj,q0;fn.supportsTypedArrays()&&(Cj=new ArrayBuffer(4),Vj=new Uint32Array(Cj),q0=new Uint8Array(Cj));var WMe=/^#([0-9a-f])([0-9a-f])([0-9a-f])([0-9a-f])?$/i,vMe=/^#([0-9a-f]{2})([0-9a-f]{2})([0-9a-f]{2})([0-9a-f]{2})?$/i,FMe=/^rgba?\s*\(\s*([0-9.]+%?)\s*[,\s]+\s*([0-9.]+%?)\s*[,\s]+\s*([0-9.]+%?)(?:\s*[,\s/]+\s*([0-9.]+))?\s*\)$/i,IMe=/^hsla?\s*\(\s*([0-9.]+)\s*[,\s]+\s*([0-9.]+%)\s*[,\s]+\s*([0-9.]+%)(?:\s*[,\s/]+\s*([0-9.]+))?\s*\)$/i;xe.packedLength=4;xe.ALICEBLUE=Object.freeze(xe.fromCssColorString("#F0F8FF"));xe.ANTIQUEWHITE=Object.freeze(xe.fromCssColorString("#FAEBD7"));xe.AQUA=Object.freeze(xe.fromCssColorString("#00FFFF"));xe.AQUAMARINE=Object.freeze(xe.fromCssColorString("#7FFFD4"));xe.AZURE=Object.freeze(xe.fromCssColorString("#F0FFFF"));xe.BEIGE=Object.freeze(xe.fromCssColorString("#F5F5DC"));xe.BISQUE=Object.freeze(xe.fromCssColorString("#FFE4C4"));xe.BLACK=Object.freeze(xe.fromCssColorString("#000000"));xe.BLANCHEDALMOND=Object.freeze(xe.fromCssColorString("#FFEBCD"));xe.BLUE=Object.freeze(xe.fromCssColorString("#0000FF"));xe.BLUEVIOLET=Object.freeze(xe.fromCssColorString("#8A2BE2"));xe.BROWN=Object.freeze(xe.fromCssColorString("#A52A2A"));xe.BURLYWOOD=Object.freeze(xe.fromCssColorString("#DEB887"));xe.CADETBLUE=Object.freeze(xe.fromCssColorString("#5F9EA0"));xe.CHARTREUSE=Object.freeze(xe.fromCssColorString("#7FFF00"));xe.CHOCOLATE=Object.freeze(xe.fromCssColorString("#D2691E"));xe.CORAL=Object.freeze(xe.fromCssColorString("#FF7F50"));xe.CORNFLOWERBLUE=Object.freeze(xe.fromCssColorString("#6495ED"));xe.CORNSILK=Object.freeze(xe.fromCssColorString("#FFF8DC"));xe.CRIMSON=Object.freeze(xe.fromCssColorString("#DC143C"));xe.CYAN=Object.freeze(xe.fromCssColorString("#00FFFF"));xe.DARKBLUE=Object.freeze(xe.fromCssColorString("#00008B"));xe.DARKCYAN=Object.freeze(xe.fromCssColorString("#008B8B"));xe.DARKGOLDENROD=Object.freeze(xe.fromCssColorString("#B8860B"));xe.DARKGRAY=Object.freeze(xe.fromCssColorString("#A9A9A9"));xe.DARKGREEN=Object.freeze(xe.fromCssColorString("#006400"));xe.DARKGREY=xe.DARKGRAY;xe.DARKKHAKI=Object.freeze(xe.fromCssColorString("#BDB76B"));xe.DARKMAGENTA=Object.freeze(xe.fromCssColorString("#8B008B"));xe.DARKOLIVEGREEN=Object.freeze(xe.fromCssColorString("#556B2F"));xe.DARKORANGE=Object.freeze(xe.fromCssColorString("#FF8C00"));xe.DARKORCHID=Object.freeze(xe.fromCssColorString("#9932CC"));xe.DARKRED=Object.freeze(xe.fromCssColorString("#8B0000"));xe.DARKSALMON=Object.freeze(xe.fromCssColorString("#E9967A"));xe.DARKSEAGREEN=Object.freeze(xe.fromCssColorString("#8FBC8F"));xe.DARKSLATEBLUE=Object.freeze(xe.fromCssColorString("#483D8B"));xe.DARKSLATEGRAY=Object.freeze(xe.fromCssColorString("#2F4F4F"));xe.DARKSLATEGREY=xe.DARKSLATEGRAY;xe.DARKTURQUOISE=Object.freeze(xe.fromCssColorString("#00CED1"));xe.DARKVIOLET=Object.freeze(xe.fromCssColorString("#9400D3"));xe.DEEPPINK=Object.freeze(xe.fromCssColorString("#FF1493"));xe.DEEPSKYBLUE=Object.freeze(xe.fromCssColorString("#00BFFF"));xe.DIMGRAY=Object.freeze(xe.fromCssColorString("#696969"));xe.DIMGREY=xe.DIMGRAY;xe.DODGERBLUE=Object.freeze(xe.fromCssColorString("#1E90FF"));xe.FIREBRICK=Object.freeze(xe.fromCssColorString("#B22222"));xe.FLORALWHITE=Object.freeze(xe.fromCssColorString("#FFFAF0"));xe.FORESTGREEN=Object.freeze(xe.fromCssColorString("#228B22"));xe.FUCHSIA=Object.freeze(xe.fromCssColorString("#FF00FF"));xe.GAINSBORO=Object.freeze(xe.fromCssColorString("#DCDCDC"));xe.GHOSTWHITE=Object.freeze(xe.fromCssColorString("#F8F8FF"));xe.GOLD=Object.freeze(xe.fromCssColorString("#FFD700"));xe.GOLDENROD=Object.freeze(xe.fromCssColorString("#DAA520"));xe.GRAY=Object.freeze(xe.fromCssColorString("#808080"));xe.GREEN=Object.freeze(xe.fromCssColorString("#008000"));xe.GREENYELLOW=Object.freeze(xe.fromCssColorString("#ADFF2F"));xe.GREY=xe.GRAY;xe.HONEYDEW=Object.freeze(xe.fromCssColorString("#F0FFF0"));xe.HOTPINK=Object.freeze(xe.fromCssColorString("#FF69B4"));xe.INDIANRED=Object.freeze(xe.fromCssColorString("#CD5C5C"));xe.INDIGO=Object.freeze(xe.fromCssColorString("#4B0082"));xe.IVORY=Object.freeze(xe.fromCssColorString("#FFFFF0"));xe.KHAKI=Object.freeze(xe.fromCssColorString("#F0E68C"));xe.LAVENDER=Object.freeze(xe.fromCssColorString("#E6E6FA"));xe.LAVENDAR_BLUSH=Object.freeze(xe.fromCssColorString("#FFF0F5"));xe.LAWNGREEN=Object.freeze(xe.fromCssColorString("#7CFC00"));xe.LEMONCHIFFON=Object.freeze(xe.fromCssColorString("#FFFACD"));xe.LIGHTBLUE=Object.freeze(xe.fromCssColorString("#ADD8E6"));xe.LIGHTCORAL=Object.freeze(xe.fromCssColorString("#F08080"));xe.LIGHTCYAN=Object.freeze(xe.fromCssColorString("#E0FFFF"));xe.LIGHTGOLDENRODYELLOW=Object.freeze(xe.fromCssColorString("#FAFAD2"));xe.LIGHTGRAY=Object.freeze(xe.fromCssColorString("#D3D3D3"));xe.LIGHTGREEN=Object.freeze(xe.fromCssColorString("#90EE90"));xe.LIGHTGREY=xe.LIGHTGRAY;xe.LIGHTPINK=Object.freeze(xe.fromCssColorString("#FFB6C1"));xe.LIGHTSEAGREEN=Object.freeze(xe.fromCssColorString("#20B2AA"));xe.LIGHTSKYBLUE=Object.freeze(xe.fromCssColorString("#87CEFA"));xe.LIGHTSLATEGRAY=Object.freeze(xe.fromCssColorString("#778899"));xe.LIGHTSLATEGREY=xe.LIGHTSLATEGRAY;xe.LIGHTSTEELBLUE=Object.freeze(xe.fromCssColorString("#B0C4DE"));xe.LIGHTYELLOW=Object.freeze(xe.fromCssColorString("#FFFFE0"));xe.LIME=Object.freeze(xe.fromCssColorString("#00FF00"));xe.LIMEGREEN=Object.freeze(xe.fromCssColorString("#32CD32"));xe.LINEN=Object.freeze(xe.fromCssColorString("#FAF0E6"));xe.MAGENTA=Object.freeze(xe.fromCssColorString("#FF00FF"));xe.MAROON=Object.freeze(xe.fromCssColorString("#800000"));xe.MEDIUMAQUAMARINE=Object.freeze(xe.fromCssColorString("#66CDAA"));xe.MEDIUMBLUE=Object.freeze(xe.fromCssColorString("#0000CD"));xe.MEDIUMORCHID=Object.freeze(xe.fromCssColorString("#BA55D3"));xe.MEDIUMPURPLE=Object.freeze(xe.fromCssColorString("#9370DB"));xe.MEDIUMSEAGREEN=Object.freeze(xe.fromCssColorString("#3CB371"));xe.MEDIUMSLATEBLUE=Object.freeze(xe.fromCssColorString("#7B68EE"));xe.MEDIUMSPRINGGREEN=Object.freeze(xe.fromCssColorString("#00FA9A"));xe.MEDIUMTURQUOISE=Object.freeze(xe.fromCssColorString("#48D1CC"));xe.MEDIUMVIOLETRED=Object.freeze(xe.fromCssColorString("#C71585"));xe.MIDNIGHTBLUE=Object.freeze(xe.fromCssColorString("#191970"));xe.MINTCREAM=Object.freeze(xe.fromCssColorString("#F5FFFA"));xe.MISTYROSE=Object.freeze(xe.fromCssColorString("#FFE4E1"));xe.MOCCASIN=Object.freeze(xe.fromCssColorString("#FFE4B5"));xe.NAVAJOWHITE=Object.freeze(xe.fromCssColorString("#FFDEAD"));xe.NAVY=Object.freeze(xe.fromCssColorString("#000080"));xe.OLDLACE=Object.freeze(xe.fromCssColorString("#FDF5E6"));xe.OLIVE=Object.freeze(xe.fromCssColorString("#808000"));xe.OLIVEDRAB=Object.freeze(xe.fromCssColorString("#6B8E23"));xe.ORANGE=Object.freeze(xe.fromCssColorString("#FFA500"));xe.ORANGERED=Object.freeze(xe.fromCssColorString("#FF4500"));xe.ORCHID=Object.freeze(xe.fromCssColorString("#DA70D6"));xe.PALEGOLDENROD=Object.freeze(xe.fromCssColorString("#EEE8AA"));xe.PALEGREEN=Object.freeze(xe.fromCssColorString("#98FB98"));xe.PALETURQUOISE=Object.freeze(xe.fromCssColorString("#AFEEEE"));xe.PALEVIOLETRED=Object.freeze(xe.fromCssColorString("#DB7093"));xe.PAPAYAWHIP=Object.freeze(xe.fromCssColorString("#FFEFD5"));xe.PEACHPUFF=Object.freeze(xe.fromCssColorString("#FFDAB9"));xe.PERU=Object.freeze(xe.fromCssColorString("#CD853F"));xe.PINK=Object.freeze(xe.fromCssColorString("#FFC0CB"));xe.PLUM=Object.freeze(xe.fromCssColorString("#DDA0DD"));xe.POWDERBLUE=Object.freeze(xe.fromCssColorString("#B0E0E6"));xe.PURPLE=Object.freeze(xe.fromCssColorString("#800080"));xe.RED=Object.freeze(xe.fromCssColorString("#FF0000"));xe.ROSYBROWN=Object.freeze(xe.fromCssColorString("#BC8F8F"));xe.ROYALBLUE=Object.freeze(xe.fromCssColorString("#4169E1"));xe.SADDLEBROWN=Object.freeze(xe.fromCssColorString("#8B4513"));xe.SALMON=Object.freeze(xe.fromCssColorString("#FA8072"));xe.SANDYBROWN=Object.freeze(xe.fromCssColorString("#F4A460"));xe.SEAGREEN=Object.freeze(xe.fromCssColorString("#2E8B57"));xe.SEASHELL=Object.freeze(xe.fromCssColorString("#FFF5EE"));xe.SIENNA=Object.freeze(xe.fromCssColorString("#A0522D"));xe.SILVER=Object.freeze(xe.fromCssColorString("#C0C0C0"));xe.SKYBLUE=Object.freeze(xe.fromCssColorString("#87CEEB"));xe.SLATEBLUE=Object.freeze(xe.fromCssColorString("#6A5ACD"));xe.SLATEGRAY=Object.freeze(xe.fromCssColorString("#708090"));xe.SLATEGREY=xe.SLATEGRAY;xe.SNOW=Object.freeze(xe.fromCssColorString("#FFFAFA"));xe.SPRINGGREEN=Object.freeze(xe.fromCssColorString("#00FF7F"));xe.STEELBLUE=Object.freeze(xe.fromCssColorString("#4682B4"));xe.TAN=Object.freeze(xe.fromCssColorString("#D2B48C"));xe.TEAL=Object.freeze(xe.fromCssColorString("#008080"));xe.THISTLE=Object.freeze(xe.fromCssColorString("#D8BFD8"));xe.TOMATO=Object.freeze(xe.fromCssColorString("#FF6347"));xe.TURQUOISE=Object.freeze(xe.fromCssColorString("#40E0D0"));xe.VIOLET=Object.freeze(xe.fromCssColorString("#EE82EE"));xe.WHEAT=Object.freeze(xe.fromCssColorString("#F5DEB3"));xe.WHITE=Object.freeze(xe.fromCssColorString("#FFFFFF"));xe.WHITESMOKE=Object.freeze(xe.fromCssColorString("#F5F5F5"));xe.YELLOW=Object.freeze(xe.fromCssColorString("#FFFF00"));xe.YELLOWGREEN=Object.freeze(xe.fromCssColorString("#9ACD32"));xe.TRANSPARENT=Object.freeze(new xe(0,0,0,0));var U=xe;function fD(e){e=e??B.EMPTY_OBJECT,this.color=e.color,this.depth=e.depth,this.stencil=e.stencil,this.renderState=e.renderState,this.framebuffer=e.framebuffer,this.owner=e.owner,this.pass=e.pass}fD.ALL=Object.freeze(new fD({color:new U(0,0,0,0),depth:1,stencil:0}));fD.prototype.execute=function(e,t){e.clear(this,t)};var ui=fD;var uHt=x(T(),1);var aHt=x(T(),1),Dle={ENVIRONMENT:0,COMPUTE:1,GLOBE:2,TERRAIN_CLASSIFICATION:3,CESIUM_3D_TILE_EDGES:4,CESIUM_3D_TILE_PLANAR_FILL_ID:5,CESIUM_3D_TILE:6,CESIUM_3D_TILE_CLASSIFICATION:7,CESIUM_3D_TILE_CLASSIFICATION_IGNORE_SHOW:8,OPAQUE:9,TRANSLUCENT:10,VOXELS:11,GAUSSIAN_SPLATS:12,CESIUM_3D_TILE_EDGES_DIRECT:13,OVERLAY:14,NUMBER_OF_PASSES:15};Object.freeze(Dle);var Le=Dle;function Ole(e){e=e??B.EMPTY_OBJECT,this.vertexArray=e.vertexArray,this.fragmentShaderSource=e.fragmentShaderSource,this.shaderProgram=e.shaderProgram,this.uniformMap=e.uniformMap,this.outputTexture=e.outputTexture,this.preExecute=e.preExecute,this.postExecute=e.postExecute,this.canceled=e.canceled,this.persists=e.persists??!1,this.pass=Le.COMPUTE,this.owner=e.owner}Ole.prototype.execute=function(e){e.execute(this)};var bu=Ole;var c8t=x(T(),1);var G4t=x(T(),1);var pHt=x(T(),1);var ms=class e{constructor(t,n){this.x=t??0,this.y=n??0}static fromElements(t,n,i){return l(i)?(i.x=t,i.y=n,i):new e(t,n)}static clone(t,n){if(l(t))return l(n)?(n.x=t.x,n.y=t.y,n):new e(t.x,t.y)}static pack(t,n,i){return i=i??0,n[i++]=t.x,n[i]=t.y,n}static unpack(t,n,i){return n=n??0,l(i)||(i=new e),i.x=t[n++],i.y=t[n],i}static packArray(t,n){let i=t.length,o=i*2;l(n)?!Array.isArray(n)&&n.length!==o||n.length!==o&&(n.length=o):n=new Array(o);for(let r=0;rW.EPSILON12);return l(o)?(o.x=r*I,o.y=s*N,o.z=a*g,o):new h(r*I,s*N,a*g)}var QT=YMe;var Fl=class Fl{constructor(t,n,i){this.longitude=t??0,this.latitude=n??0,this.height=i??0}static fromRadians(t,n,i,o){return i=i??0,l(o)?(o.longitude=t,o.latitude=n,o.height=i,o):new Fl(t,n,i)}static fromDegrees(t,n,i,o){return t=W.toRadians(t),n=W.toRadians(n),Fl.fromRadians(t,n,i,o)}static fromCartesian(t,n,i){let o=l(n)?n.oneOverRadii:Fl._ellipsoidOneOverRadii,r=l(n)?n.oneOverRadiiSquared:Fl._ellipsoidOneOverRadiiSquared,s=l(n)?n._centerToleranceSquared:Fl._ellipsoidCenterToleranceSquared,a=QT(t,o,r,s,wMe);if(!l(a))return;let c=h.multiplyComponents(a,r,MMe);c=h.normalize(c,c);let d=h.subtract(t,a,kMe),u=Math.atan2(c.y,c.x),m=Math.asin(c.z),p=W.sign(h.dot(d,t))*h.magnitude(d);return l(i)?(i.longitude=u,i.latitude=m,i.height=p,i):new Fl(u,m,p)}static toCartesian(t,n,i){return h.fromRadians(t.longitude,t.latitude,t.height,n,i)}static clone(t,n){if(l(t))return l(n)?(n.longitude=t.longitude,n.latitude=t.latitude,n.height=t.height,n):new Fl(t.longitude,t.latitude,t.height)}static equals(t,n){return t===n||l(t)&&l(n)&&t.longitude===n.longitude&&t.latitude===n.latitude&&t.height===n.height}static equalsEpsilon(t,n,i){return i=i??0,t===n||l(t)&&l(n)&&Math.abs(t.longitude-n.longitude)<=i&&Math.abs(t.latitude-n.latitude)<=i&&Math.abs(t.height-n.height)<=i}clone(t){return Fl.clone(this,t)}equals(t){return Fl.equals(this,t)}equalsEpsilon(t,n){return Fl.equalsEpsilon(this,t,n)}toString(){return`(${this.longitude}, ${this.latitude}, ${this.height})`}};mt(Fl,"_ellipsoidOneOverRadii",new h(1/6378137,1/6378137,1/6356752314245179e-9)),mt(Fl,"_ellipsoidOneOverRadiiSquared",new h(1/(6378137*6378137),1/(6378137*6378137),1/(6356752314245179e-9*6356752314245179e-9))),mt(Fl,"_ellipsoidCenterToleranceSquared",W.EPSILON1);var KA=Fl;KA.ZERO=Object.freeze(new KA(0,0,0));var MMe=new h,wMe=new h,kMe=new h,pe=KA;var PHt=x(T(),1);function Kle(e,t,n,i){t=t??0,n=n??0,i=i??0,e._radii=new h(t,n,i),e._radiiSquared=new h(t*t,n*n,i*i),e._radiiToTheFourth=new h(t*t*t*t,n*n*n*n,i*i*i*i),e._oneOverRadii=new h(t===0?0:1/t,n===0?0:1/n,i===0?0:1/i),e._oneOverRadiiSquared=new h(t===0?0:1/(t*t),n===0?0:1/(n*n),i===0?0:1/(i*i)),e._minimumRadius=Math.min(t,n,i),e._maximumRadius=Math.max(t,n,i),e._centerToleranceSquared=W.EPSILON1,e._radiiSquared.z!==0&&(e._squaredXOverSquaredZ=e._radiiSquared.x/e._radiiSquared.z)}var Il=class e{constructor(t,n,i){this._radii=void 0,this._radiiSquared=void 0,this._radiiToTheFourth=void 0,this._oneOverRadii=void 0,this._oneOverRadiiSquared=void 0,this._minimumRadius=void 0,this._maximumRadius=void 0,this._centerToleranceSquared=void 0,this._squaredXOverSquaredZ=void 0,Kle(this,t,n,i)}get radii(){return this._radii}get radiiSquared(){return this._radiiSquared}get radiiToTheFourth(){return this._radiiToTheFourth}get oneOverRadii(){return this._oneOverRadii}get oneOverRadiiSquared(){return this._oneOverRadiiSquared}get minimumRadius(){return this._minimumRadius}get maximumRadius(){return this._maximumRadius}static clone(t,n){if(!l(t))return;let i=t._radii;return l(n)?(h.clone(i,n._radii),h.clone(t._radiiSquared,n._radiiSquared),h.clone(t._radiiToTheFourth,n._radiiToTheFourth),h.clone(t._oneOverRadii,n._oneOverRadii),h.clone(t._oneOverRadiiSquared,n._oneOverRadiiSquared),n._minimumRadius=t._minimumRadius,n._maximumRadius=t._maximumRadius,n._centerToleranceSquared=t._centerToleranceSquared,n):new e(i.x,i.y,i.z)}static fromCartesian3(t,n){return l(n)||(n=new e),l(t)&&Kle(n,t.x,t.y,t.z),n}static get default(){return e._default}static set default(t){e._default=t,h._ellipsoidRadiiSquared=t.radiiSquared,pe._ellipsoidOneOverRadii=t.oneOverRadii,pe._ellipsoidOneOverRadiiSquared=t.oneOverRadiiSquared,pe._ellipsoidCenterToleranceSquared=t._centerToleranceSquared}clone(t){return e.clone(this,t)}static pack(t,n,i){return i=i??0,h.pack(t._radii,n,i),n}static unpack(t,n,i){n=n??0;let o=h.unpack(t,n);return e.fromCartesian3(o,i)}geodeticSurfaceNormalCartographic(t,n){let i=t.longitude,o=t.latitude,r=Math.cos(o),s=r*Math.cos(i),a=r*Math.sin(i),c=Math.sin(o);return l(n)||(n=new h),n.x=s,n.y=a,n.z=c,h.normalize(n,n)}geodeticSurfaceNormal(t,n){if(!h.equalsEpsilon(t,h.ZERO,W.EPSILON14))return l(n)||(n=new h),n=h.multiplyComponents(t,this._oneOverRadiiSquared,n),h.normalize(n,n)}cartographicToCartesian(t,n){let i=UMe,o=DMe;this.geodeticSurfaceNormalCartographic(t,i),h.multiplyComponents(this._radiiSquared,i,o);let r=Math.sqrt(h.dot(i,o));return h.divideByScalar(o,r,o),h.multiplyByScalar(i,t.height,i),l(n)||(n=new h),h.add(o,i,n)}cartographicArrayToCartesianArray(t,n){let i=t.length;l(n)?n.length=i:n=new Array(i);for(let o=0;o=this._radii.z-n))return i}getLocalCurvature(t,n){l(n)||(n=new k);let i=this.getSurfaceNormalIntersectionWithZAxis(t,0,HMe),o=h.distance(t,i),r=this.minimumRadius*o/this.maximumRadius**2,s=o*r**2;return k.fromElements(1/o,1/s,n)}surfaceArea(t){let n=t.west,i=t.east,o=t.south,r=t.north;for(;i0){o=r-1;continue}return r}return~(o+1)}var Eo=jMe;var HHt=x(T(),1);function QMe(e,t,n,i,o){this.xPoleWander=e,this.yPoleWander=t,this.xPoleOffset=n,this.yPoleOffset=i,this.ut1MinusUtc=o}var Zy=QMe;var pKt=x(T(),1);var eKt=x(T(),1);var JHt=x(T(),1);function qMe(e){return e%4===0&&e%100!==0||e%400===0}var Pl=qMe;var Qle=[31,28,31,30,31,30,31,31,30,31,30,31];function $Me(e,t,n,i,o,r,s,a){e=e??1,t=t??1,n=n??1,i=i??0,o=o??0,r=r??0,s=s??0,a=a??!1,this.year=e,this.month=t,this.day=n,this.hour=i,this.minute=o,this.second=r,this.millisecond=s,this.isLeapSecond=a;function y(){Ko.typeOf.number.greaterThanOrEquals("Year",e,1),Ko.typeOf.number.lessThanOrEquals("Year",e,9999),Ko.typeOf.number.greaterThanOrEquals("Month",t,1),Ko.typeOf.number.lessThanOrEquals("Month",t,12),Ko.typeOf.number.greaterThanOrEquals("Day",n,1),Ko.typeOf.number.lessThanOrEquals("Day",n,31),Ko.typeOf.number.greaterThanOrEquals("Hour",i,0),Ko.typeOf.number.lessThanOrEquals("Hour",i,23),Ko.typeOf.number.greaterThanOrEquals("Minute",o,0),Ko.typeOf.number.lessThanOrEquals("Minute",o,59),Ko.typeOf.bool("IsLeapSecond",a),Ko.typeOf.number.greaterThanOrEquals("Second",r,0),Ko.typeOf.number.lessThanOrEquals("Second",r,a?60:59),Ko.typeOf.number.greaterThanOrEquals("Millisecond",s,0),Ko.typeOf.number.lessThan("Millisecond",s,1e3)}function _(){let S=t===2&&Pl(e)?Qle[t-1]+1:Qle[t-1];if(n>S)throw new ge("Month and Day represents invalid date")}}var vh=$Me;var nKt=x(T(),1);function ewe(e,t){this.julianDate=e,this.offset=t}var To=ewe;var oKt=x(T(),1),qle={SECONDS_PER_MILLISECOND:.001,SECONDS_PER_MINUTE:60,MINUTES_PER_HOUR:60,HOURS_PER_DAY:24,SECONDS_PER_HOUR:3600,MINUTES_PER_DAY:1440,SECONDS_PER_DAY:86400,DAYS_PER_JULIAN_CENTURY:36525,PICOSECOND:1e-9,MODIFIED_JULIAN_DATE_DIFFERENCE:24000005e-1};Object.freeze(qle);var wn=qle;var sKt=x(T(),1),$le={UTC:0,TAI:1};Object.freeze($le);var ci=$le;var ede=new vh,gD=[31,28,31,30,31,30,31,31,30,31,30,31],yD=29;function Gj(e,t){return bi.compare(e.julianDate,t.julianDate)}var $R=new To;function xD(e){$R.julianDate=e;let t=bi.leapSeconds,n=Eo(t,$R,Gj);n<0&&(n=~n),n>=t.length&&(n=t.length-1);let i=t[n].offset;n>0&&bi.secondsDifference(t[n].julianDate,e)>i&&(n--,i=t[n].offset),bi.addSeconds(e,i,e)}function tde(e,t){$R.julianDate=e;let n=bi.leapSeconds,i=Eo(n,$R,Gj);if(i<0&&(i=~i),i===0)return bi.addSeconds(e,-n[0].offset,t);if(i>=n.length)return bi.addSeconds(e,-n[i-1].offset,t);let o=bi.secondsDifference(n[i].julianDate,e);if(o===0)return bi.addSeconds(e,-n[i].offset,t);if(!(o<=1))return bi.addSeconds(e,-n[i-1].offset,t)}function Ry(e,t,n){let i=t/wn.SECONDS_PER_DAY|0;return e+=i,t-=wn.SECONDS_PER_DAY*i,t<0&&(e--,t+=wn.SECONDS_PER_DAY),n.dayNumber=e,n.secondsOfDay=t,n}function Aj(e,t,n,i,o,r,s){let a=(t-14)/12|0,c=e+4800+a,d=(1461*c/4|0)+(367*(t-2-12*a)/12|0)-(3*((c+100)/100|0)/4|0)+n-32075;i=i-12,i<0&&(i+=24);let u=r+(i*wn.SECONDS_PER_HOUR+o*wn.SECONDS_PER_MINUTE+s*wn.SECONDS_PER_MILLISECOND);return u>=43200&&(d-=1),[d,u]}var twe=/^(\d{4})$/,nwe=/^(\d{4})-(\d{2})$/,iwe=/^(\d{4})-?(\d{3})$/,owe=/^(\d{4})-?W(\d{2})-?(\d{1})?$/,rwe=/^(\d{4})-?(\d{2})-?(\d{2})$/,Lj=/([Z+\-])?(\d{2})?:?(\d{2})?$/,swe=/^(\d{2})(\.\d+)?/.source+Lj.source,awe=/^(\d{2}):?(\d{2})(\.\d+)?/.source+Lj.source,cwe=/^(\d{2}):?(\d{2}):?(\d{2})(\.\d+)?/.source+Lj.source;var Cy={year:0,month:0,day:0,hour:0,minute:0,second:0,millisecond:0},lwe=[1,10,100,1e3,1e4,1e5,1e6,1e7,1e8,1e9,1e10,1e11,1e12,1e13,1e14,1e15];function $0(e,t){let n=e.charCodeAt(t)-48,i=e.charCodeAt(t+1)-48;return n<0||n>9||i<0||i>9?-1:n*10+i}var nde=NaN,ide=0;function ode(e,t,n,i,o,r,s){Cy.year=e,Cy.month=t,Cy.day=n,Cy.hour=i,Cy.minute=o,Cy.second=r,Cy.millisecond=s}function dwe(e){let t=e.length;if(t===4){let f=$0(e,0),y=$0(e,2);return f<0||y<0?!1:(ode(f*100+y,1,1,0,0,0,0),!0)}let n=e.charCodeAt(t-1)===90,i=n?t-1:t;if(i<19||e.charCodeAt(4)!==45||e.charCodeAt(7)!==45||e.charCodeAt(10)!==84||e.charCodeAt(13)!==58||e.charCodeAt(16)!==58)return!1;let o=$0(e,0),r=$0(e,2),s=$0(e,5),a=$0(e,8),c=$0(e,11),d=$0(e,14),u=$0(e,17);if(o<0||r<0||s<1||s>12||a<1||a>31||c<0||c>23||d<0||d>59||u<0||u>60)return!1;let m=0;if(i>19){let f=e.charCodeAt(19),y=i-20;if(f!==46&&f!==44||y<1||y>15)return!1;let _=0;for(let S=20;S9)return!1;_=_*10+Z}m=_/lwe[y]*1e3}let p=o*100+r,b=Pl(p);if((s!==2||!b?gD[s-1]:yD)=60;)o-=60,i++;for(;i>=24;)i-=24,n++;for(d=a&&t===2?yD:gD[t-1];n>d;)n-=d,t++,t>12&&(t-=12,e++),d=a&&t===2?yD:gD[t-1];for(;o<0;)o+=60,i--;for(;i<0;)i+=24,n--;for(;n<1;)t--,t<1&&(t+=12,e--),d=a&&t===2?yD:gD[t-1],n+=d;let m=Aj(e,t,n,i,o,r,s);return l(c)?(Ry(m[0],m[1],c),xD(c)):c=new bi(m[0],m[1],ci.UTC),u&&bi.addSeconds(c,1,c),c}var bi=class e{constructor(t,n,i){this.dayNumber=void 0,this.secondsOfDay=void 0,t=t??0,n=n??0,i=i??ci.UTC;let o=t|0;n=n+(t-o)*wn.SECONDS_PER_DAY,Ry(o,n,this),i===ci.UTC&&xD(this)}static fromGregorianDate(t,n){let i=Aj(t.year,t.month,t.day,t.hour,t.minute,t.second,t.millisecond);return l(n)?(Ry(i[0],i[1],n),xD(n),n):new e(i[0],i[1],ci.UTC)}static fromDate(t,n){let i=Aj(t.getUTCFullYear(),t.getUTCMonth()+1,t.getUTCDate(),t.getUTCHours(),t.getUTCMinutes(),t.getUTCSeconds(),t.getUTCMilliseconds());return l(n)?(Ry(i[0],i[1],n),xD(n),n):new e(i[0],i[1],ci.UTC)}static fromIso8601(t,n){if(dwe(t)){let _=Cy;return rde(_.year,_.month,_.day,_.hour,_.minute,_.second,_.millisecond,Pl(_.year),n)}t=t.replace(",",".");let i=t.split("T"),o,r=1,s=1,a=0,c=0,d=0,u=0,m=i[0],p=i[1],b,f;if(i=m.match(rwe),i!==null)o=+i[1],r=+i[2],s=+i[3];else if(i=m.match(nwe),i!==null)o=+i[1],r=+i[2];else if(i=m.match(twe),i!==null)o=+i[1];else{let _;if(i=m.match(iwe),i!==null)o=+i[1],_=+i[2],f=Pl(o);else if(i=m.match(owe),i!==null){o=+i[1];let S=+i[2],Z=+i[3]||0,R=new Date(Date.UTC(o,0,4));_=S*7+Z-R.getUTCDay()-3}b=new Date(Date.UTC(o,0,1)),b.setUTCDate(_),r=b.getUTCMonth()+1,s=b.getUTCDate()}f=Pl(o);let y;if(l(p)){i=p.match(cwe),i!==null?(a=+i[1],c=+i[2],d=+i[3],u=+(i[4]||0)*1e3,y=5):(i=p.match(awe),i!==null?(a=+i[1],c=+i[2],d=+(i[3]||0)*60,y=4):(i=p.match(swe),i!==null&&(a=+i[1],c=+(i[2]||0)*60,y=3)));let _=i[y],S=+i[y+1],Z=+(i[y+2]||0);switch(_){case"+":a=a-S,c=c-Z;break;case"-":a=a+S,c=c+Z;break;case"Z":break;default:c=c+new Date(Date.UTC(o,r-1,s,a,c)).getTimezoneOffset();break}}return rde(o,r,s,a,c,d,u,f,n)}static now(t){return e.fromDate(new Date,t)}static toGregorianDate(t,n){let i=!1,o=tde(t,bD);l(o)||(e.addSeconds(t,-1,bD),o=tde(bD,bD),i=!0);let r=o.dayNumber,s=o.secondsOfDay;s>=43200&&(r+=1);let a=r+68569|0,c=4*a/146097|0;a=a-((146097*c+3)/4|0)|0;let d=4e3*(a+1)/1461001|0;a=a-(1461*d/4|0)+31|0;let u=80*a/2447|0,m=a-(2447*u/80|0)|0;a=u/11|0;let p=u+2-12*a|0,b=100*(c-49)+d+a|0,f=s/wn.SECONDS_PER_HOUR|0,y=s-f*wn.SECONDS_PER_HOUR,_=y/wn.SECONDS_PER_MINUTE|0;y=y-_*wn.SECONDS_PER_MINUTE;let S=y|0,Z=(y-S)/wn.SECONDS_PER_MILLISECOND;return f+=12,f>23&&(f-=24),i&&(S+=1),l(n)?(n.year=b,n.month=p,n.day=m,n.hour=f,n.minute=_,n.second=S,n.millisecond=Z,n.isLeapSecond=i,n):new vh(b,p,m,f,_,S,Z,i)}static toDate(t){let n=e.toGregorianDate(t,ede),i=n.second;return n.isLeapSecond&&(i-=1),new Date(Date.UTC(n.year,n.month-1,n.day,n.hour,n.minute,i,n.millisecond))}static toIso8601(t,n){let i=e.toGregorianDate(t,ede),o=i.year,r=i.month,s=i.day,a=i.hour,c=i.minute,d=i.second,u=i.millisecond;o===1e4&&r===1&&s===1&&a===0&&c===0&&d===0&&u===0&&(o=9999,r=12,s=31,a=24);let m;if(!l(n)&&u!==0){let p=u*.01;return m=p<1e-6?p.toFixed(20).replace(".","").replace(/0+$/,""):p.toString().replace(".",""),`${o.toString().padStart(4,"0")}-${r.toString().padStart(2,"0")}-${s.toString().padStart(2,"0")}T${a.toString().padStart(2,"0")}:${c.toString().padStart(2,"0")}:${d.toString().padStart(2,"0")}.${m}Z`}return!l(n)||n===0?`${o.toString().padStart(4,"0")}-${r.toString().padStart(2,"0")}-${s.toString().padStart(2,"0")}T${a.toString().padStart(2,"0")}:${c.toString().padStart(2,"0")}:${d.toString().padStart(2,"0")}Z`:(m=(u*.01).toFixed(n).replace(".","").slice(0,n),`${o.toString().padStart(4,"0")}-${r.toString().padStart(2,"0")}-${s.toString().padStart(2,"0")}T${a.toString().padStart(2,"0")}:${c.toString().padStart(2,"0")}:${d.toString().padStart(2,"0")}.${m}Z`)}static clone(t,n){if(l(t))return l(n)?(n.dayNumber=t.dayNumber,n.secondsOfDay=t.secondsOfDay,n):new e(t.dayNumber,t.secondsOfDay,ci.TAI)}static compare(t,n){let i=t.dayNumber-n.dayNumber;return i!==0?i:t.secondsOfDay-n.secondsOfDay}static equals(t,n){return t===n||l(t)&&l(n)&&t.dayNumber===n.dayNumber&&t.secondsOfDay===n.secondsOfDay}static equalsEpsilon(t,n,i){return i=i??0,t===n||l(t)&&l(n)&&Math.abs(e.secondsDifference(t,n))<=i}static totalDays(t){return t.dayNumber+t.secondsOfDay/wn.SECONDS_PER_DAY}static secondsDifference(t,n){return(t.dayNumber-n.dayNumber)*wn.SECONDS_PER_DAY+(t.secondsOfDay-n.secondsOfDay)}static daysDifference(t,n){let i=t.dayNumber-n.dayNumber,o=(t.secondsOfDay-n.secondsOfDay)/wn.SECONDS_PER_DAY;return i+o}static computeTaiMinusUtc(t){$R.julianDate=t;let n=e.leapSeconds,i=Eo(n,$R,Gj);return i<0&&(i=~i,--i,i<0&&(i=0)),n[i].offset}static addSeconds(t,n,i){return Ry(t.dayNumber,t.secondsOfDay+n,i)}static addMinutes(t,n,i){let o=t.secondsOfDay+n*wn.SECONDS_PER_MINUTE;return Ry(t.dayNumber,o,i)}static addHours(t,n,i){let o=t.secondsOfDay+n*wn.SECONDS_PER_HOUR;return Ry(t.dayNumber,o,i)}static addDays(t,n,i){let o=t.dayNumber+n;return Ry(o,t.secondsOfDay,i)}static lessThan(t,n){return e.compare(t,n)<0}static lessThanOrEquals(t,n){return e.compare(t,n)<=0}static greaterThan(t,n){return e.compare(t,n)>0}static greaterThanOrEquals(t,n){return e.compare(t,n)>=0}clone(t){return e.clone(this,t)}equals(t){return e.equals(this,t)}equalsEpsilon(t,n){return e.equalsEpsilon(this,t,n)}toString(){return e.toIso8601(this)}},bD=new bi(0,0,ci.TAI);bi.leapSeconds=[new To(new bi(2441317,43210,ci.TAI),10),new To(new bi(2441499,43211,ci.TAI),11),new To(new bi(2441683,43212,ci.TAI),12),new To(new bi(2442048,43213,ci.TAI),13),new To(new bi(2442413,43214,ci.TAI),14),new To(new bi(2442778,43215,ci.TAI),15),new To(new bi(2443144,43216,ci.TAI),16),new To(new bi(2443509,43217,ci.TAI),17),new To(new bi(2443874,43218,ci.TAI),18),new To(new bi(2444239,43219,ci.TAI),19),new To(new bi(2444786,43220,ci.TAI),20),new To(new bi(2445151,43221,ci.TAI),21),new To(new bi(2445516,43222,ci.TAI),22),new To(new bi(2446247,43223,ci.TAI),23),new To(new bi(2447161,43224,ci.TAI),24),new To(new bi(2447892,43225,ci.TAI),25),new To(new bi(2448257,43226,ci.TAI),26),new To(new bi(2448804,43227,ci.TAI),27),new To(new bi(2449169,43228,ci.TAI),28),new To(new bi(2449534,43229,ci.TAI),29),new To(new bi(2450083,43230,ci.TAI),30),new To(new bi(2450630,43231,ci.TAI),31),new To(new bi(2451179,43232,ci.TAI),32),new To(new bi(2453736,43233,ci.TAI),33),new To(new bi(2454832,43234,ci.TAI),34),new To(new bi(2456109,43235,ci.TAI),35),new To(new bi(2457204,43236,ci.TAI),36),new To(new bi(2457754,43237,ci.TAI),37)];var Q=bi;var rjt=x(T(),1),Vde=x(gu(),1);var _Kt=x(T(),1);function uwe(e){return(e.length===0||e[e.length-1]!=="/")&&(e=`${e}/`),e}var JA=uwe;var ZKt=x(T(),1);function mde(e,t){if(e===null||typeof e!="object")return e;t=t??!1;let n=new e.constructor;for(let i in e)if(e.hasOwnProperty(i)){let o=e[i];t&&(o=mde(o,t)),n[i]=o}return n}var $e=mde;var VKt=x(T(),1);function hde(e,t,n){n=n??!1;let i={},o=l(e),r=l(t),s,a,c;if(o)for(s in e)e.hasOwnProperty(s)&&(a=e[s],r&&n&&typeof a=="object"&&t.hasOwnProperty(s)?(c=t[s],typeof c=="object"?i[s]=hde(a,c,n):i[s]=a):i[s]=a);if(r)for(s in t)t.hasOwnProperty(s)&&!i.hasOwnProperty(s)&&(c=t[s],i[s]=c);return i}var It=hde;var AKt=x(T(),1);function mwe(){let e,t,n=new Promise(function(i,o){e=i,t=o});return{resolve:e,reject:t,promise:n}}var Cd=mwe;var WKt=x(T(),1),fde=x(gu(),1);function Wj(e,t){let n;return typeof document<"u"&&(n=document),Wj._implementation(e,t,n)}Wj._implementation=function(e,t,n){if(!l(t)){if(typeof n>"u")return e;t=n.baseURI??n.location.href}let i=new fde.default(e);return i.scheme()!==""?i.toString():i.absoluteTo(t).toString()};var Tm=Wj;var FKt=x(T(),1),pde=x(gu(),1);function hwe(e,t){let n="",i=e.lastIndexOf("/");return i!==-1&&(n=e.substring(0,i+1)),t&&(e=new pde.default(e),e.query().length!==0&&(n+=`?${e.query()}`),e.fragment().length!==0&&(n+=`#${e.fragment()}`)),n}var jA=hwe;var PKt=x(T(),1),bde=x(gu(),1);function fwe(e){let t=new bde.default(e);t.normalize();let n=t.path(),i=n.lastIndexOf("/");return i!==-1&&(n=n.substr(i+1)),i=n.lastIndexOf("."),i===-1?n="":n=n.substr(i+1),n}var eb=fwe;var YKt=x(T(),1);var gde={};function pwe(e,t,n){l(t)||(t=e.width),l(n)||(n=e.height);let i=gde[t];l(i)||(i={},gde[t]=i);let o=i[n];if(!l(o)){let r=document.createElement("canvas");r.width=t,r.height=n,o=r.getContext("2d",{willReadFrequently:!0}),o.globalCompositeOperation="copy",i[n]=o}return o.drawImage(e,0,0,t,n),o.getImageData(0,0,t,n).data}var Fh=pwe;var wKt=x(T(),1);var bwe=/^blob:/i;function gwe(e){return bwe.test(e)}var qT=gwe;var DKt=x(T(),1);var _p;function ywe(e){l(_p)||(_p=document.createElement("a")),_p.href=window.location.href;let t=_p.host,n=_p.protocol;return _p.href=e,_p.href=_p.href,n!==_p.protocol||t!==_p.host}var Vy=ywe;var BKt=x(T(),1);var xwe=/^data:/i;function Twe(e){return xwe.test(e)}var Ih=Twe;var HKt=x(T(),1);function _we(e){let t=document.createElement("script");return t.async=!0,t.src=e,new Promise((n,i)=>{window.crossOriginIsolated&&t.setAttribute("crossorigin","anonymous");let o=document.getElementsByTagName("head")[0];t.onload=function(){t.onload=void 0,o.removeChild(t),n()},t.onerror=function(r){i(r)},o.appendChild(t)})}var $T=_we;var JKt=x(T(),1);function Swe(e){let t="";for(let n in e)if(e.hasOwnProperty(n)){let i=e[n],o=`${encodeURIComponent(n)}=`;if(Array.isArray(i))for(let r=0,s=i.length;r0){let s=o.substring(0,r),a=o.substring(r+2);t[s]=a}}return t}var QA=Rwe;function Tde(e,t,n){this.statusCode=e,this.response=t,this.responseHeaders=n,typeof this.responseHeaders=="string"&&(this.responseHeaders=QA(this.responseHeaders))}Tde.prototype.toString=function(){let e="Request has failed.";return l(this.statusCode)&&(e+=` Status Code: ${this.statusCode}`),e};var Sp=Tde;var LJt=x(T(),1),VD=x(gu(),1);var gJt=x(T(),1);function qA(){this._listeners=new Map,this._toRemove=new Map,this._toAdd=new Map,this._invokingListeners=!1,this._listenerCount=0}Object.defineProperties(qA.prototype,{numberOfListeners:{get:function(){return this._listenerCount}}});qA.prototype.addEventListener=function(e,t){let n=this,i=n._invokingListeners?n._toAdd:n._listeners;return Fj(this,i,e,t)&&n._listenerCount++,function(){n.removeEventListener(e,t)}};function Fj(e,t,n,i){t.has(n)||t.set(n,new Set);let o=t.get(n);return o.has(i)?!1:(o.add(i),!0)}qA.prototype.removeEventListener=function(e,t){let n=vj(this,this._listeners,e,t),i=vj(this,this._toAdd,e,t),o=n||i;return o&&this._listenerCount--,o};function vj(e,t,n,i){let o=t.get(n);if(!o||!o.has(i))return!1;if(e._invokingListeners){if(!Fj(e,e._toRemove,n,i))return!1}else o.delete(i),o.size===0&&t.delete(n);return!0}var CD,RD;function Cwe(e){CD.apply(e,RD)}function Vwe(e,t){l(t)&&(CD=t,e.forEach(Cwe))}qA.prototype.raiseEvent=function(){this._invokingListeners=!0;let e=CD,t=RD;RD=arguments;try{this._listeners.forEach(Vwe)}finally{CD=e,RD=t}if(this._invokingListeners=!1,this._toAdd.size>0){for(let[n,i]of this._toAdd.entries())for(let o of i)Fj(this,this._listeners,n,o);this._toAdd.clear()}if(this._toRemove.size>0){for(let[n,i]of this._toRemove.entries())for(let o of i)vj(this,this._listeners,n,o);this._toRemove.clear()}};var Se=qA;var TJt=x(T(),1);function t_(e){this._comparator=e.comparator,this._array=[],this._length=0,this._maximumLength=void 0}Object.defineProperties(t_.prototype,{length:{get:function(){return this._length}},internalArray:{get:function(){return this._array}},maximumLength:{get:function(){return this._maximumLength},set:function(e){let t=this._length;if(e=0;--t)this.heapify(t)};t_.prototype.insert=function(e){let t=this._array,n=this._comparator,i=this._maximumLength,o=this._length++;for(oi&&(r=t[i],this._length=i),r};t_.prototype.pop=function(e){if(e=e??0,this._length===0)return;let t=this._array,n=t[e];return Ij(t,e,--this._length),this.heapify(e),t[this._length]=void 0,n};var $A=t_;function Ewe(e,t){return e.priority-t.priority}var Ao={numberOfAttemptedRequests:0,numberOfActiveRequests:0,numberOfCancelledRequests:0,numberOfCancelledActiveRequests:0,numberOfFailedRequests:0,numberOfActiveRequestsEver:0,lastNumberOfActiveRequests:0},n1=20,zc=new $A({comparator:Ewe});zc.maximumLength=n1;zc.reserve(n1);var Zp=[],tb={},Awe=typeof document<"u"?new VD.default(document.location.href):new VD.default,ED=new Se;function Gr(){}Gr.maximumRequests=50;Gr.maximumRequestsPerServer=18;Gr.requestsByServer={};Gr.throttleRequests=!0;Gr.debugShowStatistics=!1;Gr.requestCompletedEvent=ED;Object.defineProperties(Gr,{statistics:{get:function(){return Ao}},priorityHeapLength:{get:function(){return n1},set:function(e){if(ee;){let t=zc.pop();n_(t)}n1=e,zc.maximumLength=e,zc.reserve(e)}}});function _de(e){l(e.priorityFunction)&&(e.priority=e.priorityFunction())}Gr.serverHasOpenSlots=function(e,t){t=t??1;let n=Gr.requestsByServer[e]??Gr.maximumRequestsPerServer;return tb[e]+t<=n};Gr.heapHasOpenSlots=function(e){return zc.length+e<=n1};function Sde(e){return e.state===Ri.UNISSUED&&(e.state=Ri.ISSUED,e.deferred=Cd()),e.deferred.promise}function Gwe(e){return function(t){if(e.state===Ri.CANCELLED)return;let n=e.deferred;--Ao.numberOfActiveRequests,--tb[e.serverKey],ED.raiseEvent(),e.state=Ri.RECEIVED,e.deferred=void 0,n.resolve(t)}}function Lwe(e){return function(t){e.state!==Ri.CANCELLED&&(++Ao.numberOfFailedRequests,--Ao.numberOfActiveRequests,--tb[e.serverKey],ED.raiseEvent(t),e.state=Ri.FAILED,e.deferred.reject(t))}}function Zde(e){let t=Sde(e);return e.state=Ri.ACTIVE,Zp.push(e),++Ao.numberOfActiveRequests,++Ao.numberOfActiveRequestsEver,++tb[e.serverKey],e.requestFunction().then(Gwe(e)).catch(Lwe(e)),t}function n_(e){let t=e.state===Ri.ACTIVE;if(e.state=Ri.CANCELLED,++Ao.numberOfCancelledRequests,l(e.deferred)){let n=e.deferred;n.promise.catch(()=>{}),e.deferred=void 0,n.reject(new ae(`Request cancelled: "${e.url}"`))}t&&(--Ao.numberOfActiveRequests,--tb[e.serverKey],++Ao.numberOfCancelledActiveRequests),l(e.cancelFunction)&&e.cancelFunction()}Gr.update=function(){let e,t,n=0,i=Zp.length;for(e=0;e0&&(Zp[e-n]=t)}Zp.length-=n;let o=zc.internalArray,r=zc.length;for(e=0;e0;){if(t=zc.pop(),t.cancelled){n_(t);continue}if(t.throttleByServer&&!Gr.serverHasOpenSlots(t.serverKey)){n_(t);continue}Zde(t),++a}Wwe()};Gr.getServerKey=function(e){let t=new VD.default(e);t.scheme()===""&&(t=t.absoluteTo(Awe),t.normalize());let n=t.authority();/:/.test(n)||(n=`${n}:${t.scheme()==="https"?"443":"80"}`);let i=tb[n];return l(i)||(tb[n]=0),n};Gr.request=function(e){if(Ih(e.url)||qT(e.url))return ED.raiseEvent(),e.state=Ri.RECEIVED,e.requestFunction();if(++Ao.numberOfAttemptedRequests,l(e.serverKey)||(e.serverKey=Gr.getServerKey(e.url)),Gr.throttleRequests&&e.throttleByServer&&!Gr.serverHasOpenSlots(e.serverKey))return;if(!Gr.throttleRequests||!e.throttle)return Zde(e);if(Zp.length>=Gr.maximumRequests)return;_de(e);let t=zc.insert(e);if(l(t)){if(t===e)return;n_(t)}return Sde(e)};function Wwe(){Gr.debugShowStatistics&&(Ao.numberOfActiveRequests===0&&Ao.lastNumberOfActiveRequests>0&&(Ao.numberOfAttemptedRequests>0&&(console.log(`Number of attempted requests: ${Ao.numberOfAttemptedRequests}`),Ao.numberOfAttemptedRequests=0),Ao.numberOfCancelledRequests>0&&(console.log(`Number of cancelled requests: ${Ao.numberOfCancelledRequests}`),Ao.numberOfCancelledRequests=0),Ao.numberOfCancelledActiveRequests>0&&(console.log(`Number of cancelled active requests: ${Ao.numberOfCancelledActiveRequests}`),Ao.numberOfCancelledActiveRequests=0),Ao.numberOfFailedRequests>0&&(console.log(`Number of failed requests: ${Ao.numberOfFailedRequests}`),Ao.numberOfFailedRequests=0)),Ao.lastNumberOfActiveRequests=Ao.numberOfActiveRequests)}Gr.clearForSpecs=function(){for(;zc.length>0;){let t=zc.pop();n_(t)}let e=Zp.length;for(let t=0;t0}},credits:{get:function(){return this._credits}}});Ut.prototype.toString=function(){return this.getUrlComponent(!0,!0)};Ut.prototype.parseUrl=function(e,t,n,i){let o=new Vde.default(e),r=Fwe(o.query());this._queryParameters=t?GD(r,this.queryParameters,n):r,o.search(""),o.fragment(""),l(i)&&o.scheme()===""&&(o=o.absoluteTo(Tm(i))),this._url=o.toString()};function Fwe(e){return e.length===0?{}:e.indexOf("=")===-1?{[e]:void 0}:yu(e)}function GD(e,t,n){if(!n)return It(e,t);let i=$e(e,!0);for(let o in t)if(t.hasOwnProperty(o)){let r=i[o],s=t[o];l(r)?(Array.isArray(r)||(r=i[o]=[r]),i[o]=r.concat(s)):i[o]=Array.isArray(s)?s.slice():s}return i}Ut.prototype.getUrlComponent=function(e,t){if(this.isDataUri)return this._url;let n=this._url;e&&(n=`${n}${Iwe(this.queryParameters)}`),n=n.replace(/%7B/g,"{").replace(/%7D/g,"}");let i=this._templateValues;return Object.keys(i).length>0&&(n=n.replace(/{(.*?)}/g,function(o,r){let s=i[r];return l(s)?encodeURIComponent(s):o})),t&&l(this.proxy)&&(n=this.proxy.getURL(n)),n};function Iwe(e){let t=Object.keys(e);return t.length===0?"":t.length===1&&!l(e[t[0]])?`?${t[0]}`:`?${e_(e)}`}Ut.prototype.setQueryParameters=function(e,t){t?this._queryParameters=GD(this._queryParameters,e,!1):this._queryParameters=GD(e,this._queryParameters,!1)};Ut.prototype.appendQueryParameters=function(e){this._queryParameters=GD(e,this._queryParameters,!0)};Ut.prototype.setTemplateValues=function(e,t){t?this._templateValues=It(this._templateValues,e):this._templateValues=It(e,this._templateValues)};Ut.prototype.getDerivedResource=function(e){let t=this.clone();if(t._retryCount=0,l(e.url)){let n=e.preserveQueryParameters??!1;t.parseUrl(e.url,!0,n,this._url)}return l(e.queryParameters)&&(t._queryParameters=It(e.queryParameters,t.queryParameters)),l(e.templateValues)&&(t._templateValues=It(e.templateValues,t.templateValues)),l(e.headers)&&(t.headers=It(e.headers,t.headers)),l(e.proxy)&&(t.proxy=e.proxy),l(e.request)&&(t.request=e.request),l(e.retryCallback)&&(t.retryCallback=e.retryCallback),l(e.retryAttempts)&&(t.retryAttempts=e.retryAttempts),t};Ut.prototype.retryOnError=function(e){let t=this.retryCallback;if(typeof t!="function"||this._retryCount>=this.retryAttempts)return Promise.resolve(!1);let n=this;return Promise.resolve(t(this,e)).then(function(i){return++n._retryCount,i})};Ut.prototype.clone=function(e){return l(e)?(e._url=this._url,e._queryParameters=$e(this._queryParameters),e._templateValues=$e(this._templateValues),e.headers=$e(this.headers),e.proxy=this.proxy,e.retryCallback=this.retryCallback,e.retryAttempts=this.retryAttempts,e._retryCount=0,e.request=this.request.clone(),e):new Ut({url:this._url,queryParameters:this.queryParameters,templateValues:this.templateValues,headers:this.headers,proxy:this.proxy,retryCallback:this.retryCallback,retryAttempts:this.retryAttempts,request:this.request.clone(),parseUrl:!1,credits:l(this.credits)?this.credits.slice():void 0})};Ut.prototype.getBaseUri=function(e){return jA(this.getUrlComponent(e),e)};Ut.prototype.appendForwardSlash=function(){this._url=JA(this._url)};Ut.prototype.fetchArrayBuffer=function(){return this.fetch({responseType:"arraybuffer"})};Ut.fetchArrayBuffer=function(e){return new Ut(e).fetchArrayBuffer()};Ut.prototype.fetchBlob=function(){return this.fetch({responseType:"blob"})};Ut.fetchBlob=function(e){return new Ut(e).fetchBlob()};Ut.prototype.fetchImage=function(e){e=e??B.EMPTY_OBJECT;let t=e.preferImageBitmap??!1,n=e.preferBlob??!1,i=e.flipY??!1,o=e.skipColorSpaceConversion??!1;if(Pj(this.request),!Ede||this.isDataUri||this.isBlobUri||!this.hasHeaders&&!n)return this._fetchImage({resource:this,flipY:i,skipColorSpaceConversion:o,preferImageBitmap:t});let r=this.fetchBlob();if(!l(r))return;let s,a,c,d;return Ut.supportsImageBitmapOptions().then(function(u){return s=u,a=s&&t,r}).then(function(u){if(!l(u))return;if(d=u,a)return Ut.createImageBitmapFromBlob(u,{flipY:i,premultiplyAlpha:!1,skipColorSpaceConversion:o});let m=window.URL.createObjectURL(u);return c=new Ut({url:m}),c._fetchImage({flipY:i,skipColorSpaceConversion:o,preferImageBitmap:!1})}).then(function(u){if(l(u))return u.blob=d,a||window.URL.revokeObjectURL(c.url),u}).catch(function(u){return l(c)&&window.URL.revokeObjectURL(c.url),u.blob=d,Promise.reject(u)})};Ut.prototype._fetchImage=function(e){let t=this,n=e.flipY,i=e.skipColorSpaceConversion,o=e.preferImageBitmap,r=t.request;r.url=t.url,r.requestFunction=function(){let a=!1;!t.isDataUri&&!t.isBlobUri&&(a=t.isCrossOriginUrl);let c=Cd();return Ut._Implementations.createImage(r,a,c,n,i,o),c.promise};let s=Hc.request(r);if(l(s))return s.catch(function(a){return r.state!==Ri.FAILED?Promise.reject(a):t.retryOnError(a).then(function(c){return c?(r.state=Ri.UNISSUED,r.deferred=void 0,t._fetchImage({flipY:n,skipColorSpaceConversion:i,preferImageBitmap:o})):Promise.reject(a)})})};Ut.fetchImage=function(e){return new Ut(e).fetchImage({flipY:e.flipY,skipColorSpaceConversion:e.skipColorSpaceConversion,preferBlob:e.preferBlob,preferImageBitmap:e.preferImageBitmap})};Ut.prototype.fetchText=function(){return this.fetch({responseType:"text"})};Ut.fetchText=function(e){return new Ut(e).fetchText()};Ut.prototype.fetchJson=function(){let e=this.fetch({responseType:"text",headers:{Accept:"application/json,*/*;q=0.01"}});if(l(e))return e.then(function(t){if(l(t))return JSON.parse(t)})};Ut.fetchJson=function(e){return new Ut(e).fetchJson()};Ut.prototype.fetchXML=function(){return this.fetch({responseType:"document",overrideMimeType:"text/xml"})};Ut.fetchXML=function(e){return new Ut(e).fetchXML()};Ut.prototype.fetchJsonp=function(e){e=e??"callback",Pj(this.request);let t;do t=`loadJsonp${W.nextRandomNumber().toString().substring(2,8)}`;while(l(window[t]));return Ade(this,e,t)};function Ade(e,t,n){let i={};i[t]=n,e.setQueryParameters(i);let o=e.request,r=e.url;o.url=r,o.requestFunction=function(){let a=Cd();return window[n]=function(c){a.resolve(c);try{delete window[n]}catch{window[n]=void 0}},Ut._Implementations.loadAndExecuteScript(r,n,a),a.promise};let s=Hc.request(o);if(l(s))return s.catch(function(a){return o.state!==Ri.FAILED?Promise.reject(a):e.retryOnError(a).then(function(c){return c?(o.state=Ri.UNISSUED,o.deferred=void 0,Ade(e,t,n)):Promise.reject(a)})})}Ut.fetchJsonp=function(e){return new Ut(e).fetchJsonp(e.callbackParameterName)};Ut.prototype._makeRequest=function(e){let t=this;Pj(t.request);let n=t.request,i=t.url;n.url=i,n.requestFunction=function(){let r=e.responseType,s=It(e.headers,t.headers),a=e.overrideMimeType,c=e.method,d=e.data,u=Cd(),m=Ut._Implementations.loadWithXhr(i,r,c,d,s,u,a);return l(m)&&l(m.abort)&&(n.cancelFunction=function(){m.abort()}),u.promise};let o=Hc.request(n);if(l(o))return o.then(function(r){return n.cancelFunction=void 0,r}).catch(function(r){return n.cancelFunction=void 0,n.state!==Ri.FAILED?Promise.reject(r):t.retryOnError(r).then(function(s){return s?(n.state=Ri.UNISSUED,n.deferred=void 0,t.fetch(e)):Promise.reject(r)})})};function Pj(e){if(e.state===Ri.ISSUED||e.state===Ri.ACTIVE)throw new ae("The Resource is already being fetched.");e.state=Ri.UNISSUED,e.deferred=void 0}var Pwe=/^data:(.*?)(;base64)?,(.*)$/;function AD(e,t){let n=decodeURIComponent(t);return e?atob(n):n}function Cde(e,t){let n=AD(e,t),i=new ArrayBuffer(n.length),o=new Uint8Array(i);for(let r=0;r{if(!a.ok){let c={};a.headers.forEach((d,u)=>{c[u]=d}),r.reject(new Sp(a.status,a,c));return}switch(t){case"text":r.resolve(a.text());break;case"json":r.resolve(a.json());break;default:r.resolve(new Uint8Array(await a.arrayBuffer()).buffer);break}}).catch(()=>{r.reject(new Sp)})}var Ywe=typeof XMLHttpRequest>"u";Ut._Implementations.loadWithXhr=function(e,t,n,i,o,r,s){let a=Pwe.exec(e);if(a!==null){r.resolve(Xwe(a,t));return}if(Ywe){Nwe(e,t,n,i,o,r,s);return}let c=new XMLHttpRequest;if(o1.contains(e)&&(c.withCredentials=!0),c.open(n,e,!0),l(s)&&l(c.overrideMimeType)&&c.overrideMimeType(s),l(o))for(let u in o)o.hasOwnProperty(u)&&c.setRequestHeader(u,o[u]);l(t)&&(c.responseType=t);let d=!1;return typeof e=="string"&&(d=e.indexOf("file://")===0||typeof window<"u"&&window.location.origin==="file://"),c.onload=function(){if((c.status<200||c.status>=300)&&!(d&&c.status===0)){r.reject(new Sp(c.status,c.response,c.getAllResponseHeaders()));return}let u=c.response,m=c.responseType;if(n==="HEAD"||n==="OPTIONS"){let b=c.getAllResponseHeaders().trim().split(/[\r\n]+/),f={};b.forEach(function(y){let _=y.split(": "),S=_.shift();f[S]=_.join(": ")}),r.resolve(f);return}if(c.status===204)r.resolve(void 0);else if(l(u)&&(!l(t)||m===t))r.resolve(u);else if(t==="json"&&typeof u=="string")try{r.resolve(JSON.parse(u))}catch(p){r.reject(p)}else(m===""||m==="document")&&l(c.responseXML)&&c.responseXML.hasChildNodes()?r.resolve(c.responseXML):(m===""||m==="text")&&l(c.responseText)?r.resolve(c.responseText):r.reject(new ae("Invalid XMLHttpRequest response type."))},c.onerror=function(u){r.reject(new Sp)},c.send(i),c};Ut._Implementations.loadAndExecuteScript=function(e,t,n){return $T(e,t).catch(function(i){n.reject(i)})};Ut._DefaultImplementations={};Ut._DefaultImplementations.createImage=Ut._Implementations.createImage;Ut._DefaultImplementations.loadWithXhr=Ut._Implementations.loadWithXhr;Ut._DefaultImplementations.loadAndExecuteScript=Ut._Implementations.loadAndExecuteScript;Ut.DEFAULT=Object.freeze(new Ut({url:typeof document>"u"?"":document.location.href.split("?")[0]}));var ve=Ut;function nG(e){e=e??B.EMPTY_OBJECT,this._dates=void 0,this._samples=void 0,this._dateColumn=-1,this._xPoleWanderRadiansColumn=-1,this._yPoleWanderRadiansColumn=-1,this._ut1MinusUtcSecondsColumn=-1,this._xCelestialPoleOffsetRadiansColumn=-1,this._yCelestialPoleOffsetRadiansColumn=-1,this._taiMinusUtcSecondsColumn=-1,this._columnCount=0,this._lastIndex=-1,this._addNewLeapSeconds=e.addNewLeapSeconds??!0,l(e.data)?Gde(this,e.data):Gde(this,{columnNames:["dateIso8601","modifiedJulianDateUtc","xPoleWanderRadians","yPoleWanderRadians","ut1MinusUtcSeconds","lengthOfDayCorrectionSeconds","xCelestialPoleOffsetRadians","yCelestialPoleOffsetRadians","taiMinusUtcSeconds"],samples:[]})}nG.fromUrl=async function(e,t){t=t??B.EMPTY_OBJECT;let n=ve.createIfNeeded(e),i;try{i=await n.fetchJson()}catch{throw new ae(`An error occurred while retrieving the EOP data from the URL ${n.url}.`)}return new nG({addNewLeapSeconds:t.addNewLeapSeconds,data:i})};nG.NONE=Object.freeze({compute:function(e,t){return l(t)?(t.xPoleWander=0,t.yPoleWander=0,t.xPoleOffset=0,t.yPoleOffset=0,t.ut1MinusUtc=0):t=new Zy(0,0,0,0,0),t}});nG.prototype.compute=function(e,t){if(!l(this._samples))return;if(l(t)||(t=new Zy(0,0,0,0,0)),this._samples.length===0)return t.xPoleWander=0,t.yPoleWander=0,t.xPoleOffset=0,t.yPoleOffset=0,t.ut1MinusUtc=0,t;let n=this._dates,i=this._lastIndex,o,r;if(l(i)){let a=n[i],c=n[i+1],d=Q.lessThanOrEquals(a,e),u=!l(c),m=u||Q.greaterThanOrEquals(c,e);if(d&&m)return o=i,!u&&c.equals(e)&&++o,r=o+1,Wde(this,n,this._samples,e,o,r,t),t}let s=Eo(n,e,Q.compare,this._dateColumn);return s>=0?(st.length-1)return s.xPoleWander=0,s.yPoleWander=0,s.xPoleOffset=0,s.yPoleOffset=0,s.ut1MinusUtc=0,s;let c=t[o],d=t[r];if(c.equals(d)||i.equals(c))return Lde(e,n,o,a,s),s;if(i.equals(d))return Lde(e,n,r,a,s),s;let u=Q.secondsDifference(i,c)/Q.secondsDifference(d,c),m=o*a,p=r*a,b=n[m+e._ut1MinusUtcSecondsColumn],f=n[p+e._ut1MinusUtcSecondsColumn],y=f-b;if(y>.5||y<-.5){let _=n[m+e._taiMinusUtcSecondsColumn],S=n[p+e._taiMinusUtcSecondsColumn];_!==S&&(d.equals(i)?b=f:f-=S-_)}return s.xPoleWander=tG(u,n[m+e._xPoleWanderRadiansColumn],n[p+e._xPoleWanderRadiansColumn]),s.yPoleWander=tG(u,n[m+e._yPoleWanderRadiansColumn],n[p+e._yPoleWanderRadiansColumn]),s.xPoleOffset=tG(u,n[m+e._xCelestialPoleOffsetRadiansColumn],n[p+e._xCelestialPoleOffsetRadiansColumn]),s.yPoleOffset=tG(u,n[m+e._yCelestialPoleOffsetRadiansColumn],n[p+e._yCelestialPoleOffsetRadiansColumn]),s.ut1MinusUtc=tG(u,b,f),s}var iG=nG;var _jt=x(T(),1);function Kc(e,t,n){this.heading=e??0,this.pitch=t??0,this.roll=n??0}Kc.fromQuaternion=function(e,t){l(t)||(t=new Kc);let n=2*(e.w*e.y-e.z*e.x),i=1-2*(e.x*e.x+e.y*e.y),o=2*(e.w*e.x+e.y*e.z),r=1-2*(e.y*e.y+e.z*e.z),s=2*(e.w*e.z+e.x*e.y);return t.heading=-Math.atan2(s,r),t.roll=Math.atan2(o,i),t.pitch=-W.asinClamped(n),t};Kc.fromDegrees=function(e,t,n,i){return l(i)||(i=new Kc),i.heading=e*W.RADIANS_PER_DEGREE,i.pitch=t*W.RADIANS_PER_DEGREE,i.roll=n*W.RADIANS_PER_DEGREE,i};Kc.clone=function(e,t){if(l(e))return l(t)?(t.heading=e.heading,t.pitch=e.pitch,t.roll=e.roll,t):new Kc(e.heading,e.pitch,e.roll)};Kc.equals=function(e,t){return e===t||l(e)&&l(t)&&e.heading===t.heading&&e.pitch===t.pitch&&e.roll===t.roll};Kc.equalsEpsilon=function(e,t,n,i){return e===t||l(e)&&l(t)&&W.equalsEpsilon(e.heading,t.heading,n,i)&&W.equalsEpsilon(e.pitch,t.pitch,n,i)&&W.equalsEpsilon(e.roll,t.roll,n,i)};Kc.prototype.clone=function(e){return Kc.clone(this,e)};Kc.prototype.equals=function(e){return Kc.equals(this,e)};Kc.prototype.equalsEpsilon=function(e,t,n){return Kc.equalsEpsilon(this,e,t,n)};Kc.prototype.toString=function(){return`(${this.heading}, ${this.pitch}, ${this.roll})`};var Cc=Kc;var Yjt=x(T(),1);var Vjt=x(T(),1);var vde={};var Fde=/((?:.*\/)|^)Cesium\.js(?:\?|\#|$)/;function wwe(){let e=document.getElementsByTagName("script");for(let t=0,n=e.length;t"u"?e:(l(LD)||(LD=document.createElement("a")),LD.href=e,LD.href)}var i_;function Pde(){if(l(i_))return i_;let e;return typeof CESIUM_BASE_URL<"u"?e=CESIUM_BASE_URL:l(vde?.url)?e=Tm(".",vde.url):typeof define=="object"&&l(define.amd)&&!define.amd.toUrlUndefined&&l($5.toUrl)?e=Tm("..",o_("Core/buildModuleUrl.js")):e=wwe(),i_=new ve({url:Ide(e)}),i_.appendForwardSlash(),i_}function kwe(e){return Ide($5.toUrl(`../${e}`))}function Xde(e){return Pde().getDerivedResource({url:e}).url}var WD;function o_(e){return l(WD)||(typeof define=="object"&&l(define.amd)&&!define.amd.toUrlUndefined&&l($5.toUrl)?WD=kwe:WD=Xde),WD(e)}o_._cesiumScriptRegex=Fde;o_._buildModuleUrlFromBaseUrl=Xde;o_._clearBaseResource=function(){i_=void 0};o_.setBaseUrl=function(e){i_=ve.DEFAULT.getDerivedResource({url:e})};o_.getCesiumBaseUrl=Pde;var en=o_;var Gjt=x(T(),1);function Uwe(e,t,n){this.x=e,this.y=t,this.s=n}var r_=Uwe;function vD(e){e=e??B.EMPTY_OBJECT,this._xysFileUrlTemplate=ve.createIfNeeded(e.xysFileUrlTemplate),this._interpolationOrder=e.interpolationOrder??9,this._sampleZeroJulianEphemerisDate=e.sampleZeroJulianEphemerisDate??24423965e-1,this._sampleZeroDateTT=new Q(this._sampleZeroJulianEphemerisDate,0,ci.TAI),this._stepSizeDays=e.stepSizeDays??1,this._samplesPerXysFile=e.samplesPerXysFile??1e3,this._totalSamples=e.totalSamples??27426,this._samples=new Array(this._totalSamples*3),this._chunkDownloadsInProgress=[];let t=this._interpolationOrder,n=this._denominators=new Array(t+1),i=this._xTable=new Array(t+1),o=Math.pow(this._stepSizeDays,t);for(let r=0;r<=t;++r){n[r]=o,i[r]=r*this._stepSizeDays;for(let s=0;s<=t;++s)s!==r&&(n[r]*=r-s);n[r]=1/n[r]}this._work=new Array(t+1),this._coef=new Array(t+1)}var Dwe=new Q(0,0,ci.TAI);function Xj(e,t,n){let i=Dwe;return i.dayNumber=t,i.secondsOfDay=n,Q.daysDifference(i,e._sampleZeroDateTT)}vD.prototype.preload=function(e,t,n,i){let o=Xj(this,e,t),r=Xj(this,n,i),s=o/this._stepSizeDays-this._interpolationOrder/2|0;s<0&&(s=0);let a=r/this._stepSizeDays-this._interpolationOrder/2|0+this._interpolationOrder;a>=this._totalSamples&&(a=this._totalSamples-1);let c=s/this._samplesPerXysFile|0,d=a/this._samplesPerXysFile|0,u=[];for(let m=c;m<=d;++m)u.push(Nj(this,m));return Promise.all(u)};vD.prototype.computeXysRadians=function(e,t,n){let i=Xj(this,e,t);if(i<0)return;let o=i/this._stepSizeDays|0;if(o>=this._totalSamples)return;let r=this._interpolationOrder,s=o-(r/2|0);s<0&&(s=0);let a=s+r;a>=this._totalSamples&&(a=this._totalSamples-1,s=a-r,s<0&&(s=0));let c=!1,d=this._samples;if(l(d[s*3])||(Nj(this,s/this._samplesPerXysFile|0),c=!0),l(d[a*3])||(Nj(this,a/this._samplesPerXysFile|0),c=!0),c)return;l(n)?(n.x=0,n.y=0,n.s=0):n=new r_(0,0,0);let u=i-s*this._stepSizeDays,m=this._work,p=this._denominators,b=this._coef,f=this._xTable,y,_;for(y=0;y<=r;++y)m[y]=u-f[y];for(y=0;y<=r;++y){for(b[y]=1,_=0;_<=r;++_)_!==y&&(b[y]*=m[_]);b[y]*=p[y];let S=(s+y)*3;n.x+=b[y]*d[S++],n.y+=b[y]*d[S++],n.s+=b[y]*d[S]}return n};vD.prototype._updateChunkData=function(e,{samples:t}){this._chunkDownloadsInProgress[e]=void 0;let n=this._samplesPerXysFile,i=e*n*3;for(let o=0;o0)n=Math.sqrt(u+1),s=.5*n,n=.5/n,i=(e[q.COLUMN1ROW2]-e[q.COLUMN2ROW1])*n,o=(e[q.COLUMN2ROW0]-e[q.COLUMN0ROW2])*n,r=(e[q.COLUMN0ROW1]-e[q.COLUMN1ROW0])*n;else{let m=Bwe,p=0;c>a&&(p=1),d>a&&d>c&&(p=2);let b=m[p],f=m[b];n=Math.sqrt(e[q.getElementIndex(p,p)]-e[q.getElementIndex(b,b)]-e[q.getElementIndex(f,f)]+1);let y=zwe;y[p]=.5*n,n=.5/n,s=(e[q.getElementIndex(f,b)]-e[q.getElementIndex(b,f)])*n,y[b]=(e[q.getElementIndex(b,p)]+e[q.getElementIndex(p,b)])*n,y[f]=(e[q.getElementIndex(f,p)]+e[q.getElementIndex(p,f)])*n,i=-y[0],o=-y[1],r=-y[2]}return l(t)?(t.x=i,t.y=o,t.z=r,t.w=s,t):new ft(i,o,r,s)};var Nde=new ft,Yde=new ft,Yj=new ft,Mde=new ft;ft.fromHeadingPitchRoll=function(e,t){return Mde=ft.fromAxisAngle(h.UNIT_X,e.roll,Nde),Yj=ft.fromAxisAngle(h.UNIT_Y,-e.pitch,t),t=ft.multiply(Yj,Mde,Yj),Yde=ft.fromAxisAngle(h.UNIT_Z,-e.heading,Nde),ft.multiply(Yde,t,t)};var FD=new h,Mj=new h,Ph=new ft,wde=new ft,ID=new ft;ft.packedLength=4;ft.pack=function(e,t,n){return n=n??0,t[n++]=e.x,t[n++]=e.y,t[n++]=e.z,t[n]=e.w,t};ft.unpack=function(e,t,n){return t=t??0,l(n)||(n=new ft),n.x=e[t],n.y=e[t+1],n.z=e[t+2],n.w=e[t+3],n};ft.packedInterpolationLength=3;ft.convertPackedArrayForInterpolation=function(e,t,n,i){ft.unpack(e,n*4,ID),ft.conjugate(ID,ID);for(let o=0,r=n-t+1;o=0?r=1:(r=-1,o=-o);let s=o-1,a=1-n,c=n*n,d=a*a;for(let b=7;b>=0;--b)nb[b]=(PD[b]*c-XD[b])*s,ib[b]=(PD[b]*d-XD[b])*s;let u=r*n*(1+nb[0]*(1+nb[1]*(1+nb[2]*(1+nb[3]*(1+nb[4]*(1+nb[5]*(1+nb[6]*(1+nb[7])))))))),m=a*(1+ib[0]*(1+ib[1]*(1+ib[2]*(1+ib[3]*(1+ib[4]*(1+ib[5]*(1+ib[6]*(1+ib[7])))))))),p=ft.multiplyByScalar(e,m,Jwe);return ft.multiplyByScalar(t,u,i),ft.add(p,i,i)};ft.fastSquad=function(e,t,n,i,o,r){let s=ft.fastSlerp(e,t,o,sG),a=ft.fastSlerp(n,i,o,s1);return ft.fastSlerp(s,a,2*o*(1-o),r)};ft.equals=function(e,t){return e===t||l(e)&&l(t)&&e.x===t.x&&e.y===t.y&&e.z===t.z&&e.w===t.w};ft.equalsEpsilon=function(e,t,n){return n=n??0,e===t||l(e)&&l(t)&&Math.abs(e.x-t.x)<=n&&Math.abs(e.y-t.y)<=n&&Math.abs(e.z-t.z)<=n&&Math.abs(e.w-t.w)<=n};ft.ZERO=Object.freeze(new ft(0,0,0,0));ft.IDENTITY=Object.freeze(new ft(0,0,0,1));ft.prototype.clone=function(e){return ft.clone(this,e)};ft.prototype.equals=function(e){return ft.equals(this,e)};ft.prototype.equalsEpsilon=function(e,t){return ft.equalsEpsilon(this,e,t)};ft.prototype.toString=function(){return`(${this.x}, ${this.y}, ${this.z}, ${this.w})`};var Ne=ft;var Ci={},Dj={up:{south:"east",north:"west",west:"south",east:"north"},down:{south:"west",north:"east",west:"north",east:"south"},south:{up:"west",down:"east",west:"down",east:"up"},north:{up:"east",down:"west",west:"up",east:"down"},west:{up:"north",down:"south",north:"down",south:"up"},east:{up:"south",down:"north",north:"up",south:"down"}},a1={north:[-1,0,0],east:[0,1,0],up:[0,0,1],south:[1,0,0],west:[0,-1,0],down:[0,0,-1]},Oj={},Vd={east:new h,north:new h,up:new h,west:new h,south:new h,down:new h},Ey=new h,Ay=new h,Gy=new h;Ci.localFrameToFixedFrameGenerator=function(e,t){if(!Dj.hasOwnProperty(e)||!Dj[e].hasOwnProperty(t))throw new ge("firstAxis and secondAxis must be east, north, up, west, south or down.");let n=Dj[e][t],i,o=e+t;return l(Oj[o])?i=Oj[o]:(i=function(r,s,a){if(l(a)||(a=new P),h.equalsEpsilon(r,h.ZERO,W.EPSILON14))h.unpack(a1[e],0,Ey),h.unpack(a1[t],0,Ay),h.unpack(a1[n],0,Gy);else if(W.equalsEpsilon(r.x,0,W.EPSILON14)&&W.equalsEpsilon(r.y,0,W.EPSILON14)){let c=W.sign(r.z);h.unpack(a1[e],0,Ey),e!=="east"&&e!=="west"&&h.multiplyByScalar(Ey,c,Ey),h.unpack(a1[t],0,Ay),t!=="east"&&t!=="west"&&h.multiplyByScalar(Ay,c,Ay),h.unpack(a1[n],0,Gy),n!=="east"&&n!=="west"&&h.multiplyByScalar(Gy,c,Gy)}else{s=s??ne.default,s.geodeticSurfaceNormal(r,Vd.up);let c=Vd.up,d=Vd.east;d.x=-r.y,d.y=r.x,d.z=0,h.normalize(d,Vd.east),h.cross(c,d,Vd.north),h.multiplyByScalar(Vd.up,-1,Vd.down),h.multiplyByScalar(Vd.east,-1,Vd.west),h.multiplyByScalar(Vd.north,-1,Vd.south),Ey=Vd[e],Ay=Vd[t],Gy=Vd[n]}return a[0]=Ey.x,a[1]=Ey.y,a[2]=Ey.z,a[3]=0,a[4]=Ay.x,a[5]=Ay.y,a[6]=Ay.z,a[7]=0,a[8]=Gy.x,a[9]=Gy.y,a[10]=Gy.z,a[11]=0,a[12]=r.x,a[13]=r.y,a[14]=r.z,a[15]=1,a},Oj[o]=i),i};Ci.eastNorthUpToFixedFrame=Ci.localFrameToFixedFrameGenerator("east","north");Ci.northEastDownToFixedFrame=Ci.localFrameToFixedFrameGenerator("north","east");Ci.northUpEastToFixedFrame=Ci.localFrameToFixedFrameGenerator("north","up");Ci.northWestUpToFixedFrame=Ci.localFrameToFixedFrameGenerator("north","west");var jwe=new Ne,Qwe=new h(1,1,1),qwe=new P;Ci.headingPitchRollToFixedFrame=function(e,t,n,i,o){i=i??Ci.eastNorthUpToFixedFrame;let r=Ne.fromHeadingPitchRoll(t,jwe),s=P.fromTranslationQuaternionRotationScale(h.ZERO,r,Qwe,qwe);return o=i(e,n,o),P.multiply(o,s,o)};var $we=new P,e9e=new q;Ci.headingPitchRollQuaternion=function(e,t,n,i,o){let r=Ci.headingPitchRollToFixedFrame(e,t,n,i,$we),s=P.getMatrix3(r,e9e);return Ne.fromRotationMatrix(s,o)};var t9e=new h(1,1,1),n9e=new h,Dde=new P,i9e=new P,o9e=new q,r9e=new Ne;Ci.fixedFrameToHeadingPitchRoll=function(e,t,n,i){t=t??ne.default,n=n??Ci.eastNorthUpToFixedFrame,l(i)||(i=new Cc);let o=P.getTranslation(e,n9e);if(h.equals(o,h.ZERO))return i.heading=0,i.pitch=0,i.roll=0,i;let r=P.inverseTransformation(n(o,t,Dde),Dde),s=P.setScale(e,t9e,i9e);s=P.setTranslation(s,h.ZERO,s),r=P.multiply(r,s,r);let a=Ne.fromRotationMatrix(P.getMatrix3(r,o9e),r9e);return a=Ne.normalize(a,a),Cc.fromQuaternion(a,i)};var s9e=6*3600+2460+50.54841,a9e=8640184812866e-6,c9e=.093104,l9e=-62e-7,d9e=11772758384668e-32,u9e=72921158553e-15,m9e=W.TWO_PI/86400,ND=new Q;Ci.computeIcrfToCentralBodyFixedMatrix=function(e,t){let n=Ci.computeIcrfToFixedMatrix(e,t);return l(n)||(n=Ci.computeTemeToPseudoFixedMatrix(e,t)),n};Ci.computeTemeToPseudoFixedMatrix=function(e,t){ND=Q.addSeconds(e,-Q.computeTaiMinusUtc(e),ND);let n=ND.dayNumber,i=ND.secondsOfDay,o,r=n-2451545;i>=43200?o=(r+.5)/wn.DAYS_PER_JULIAN_CENTURY:o=(r-.5)/wn.DAYS_PER_JULIAN_CENTURY;let a=(s9e+o*(a9e+o*(c9e+o*l9e)))*m9e%W.TWO_PI,c=u9e+d9e*(n-24515455e-1),d=(i+wn.SECONDS_PER_DAY*.5)%wn.SECONDS_PER_DAY,u=a+c*d,m=Math.cos(u),p=Math.sin(u);return l(t)?(t[0]=m,t[1]=-p,t[2]=0,t[3]=p,t[4]=m,t[5]=0,t[6]=0,t[7]=0,t[8]=1,t):new q(m,p,0,-p,m,0,0,0,1)};Ci.iau2006XysData=new oG;Ci.earthOrientationParameters=iG.NONE;var Hj=32.184,h9e=2451545;Ci.preloadIcrfFixed=function(e){let t=e.start.dayNumber,n=e.start.secondsOfDay+Hj,i=e.stop.dayNumber,o=e.stop.secondsOfDay+Hj;return Ci.iau2006XysData.preload(t,n,i,o)};Ci.computeIcrfToFixedMatrix=function(e,t){l(t)||(t=new q);let n=Ci.computeFixedToIcrfMatrix(e,t);if(l(n))return q.transpose(n,t)};var f9e=32.184,p9e=2451545,YD=new Cc,b9e=new q,g9e=new Q;Ci.computeMoonFixedToIcrfMatrix=function(e,t){l(t)||(t=new q);let n=Q.addSeconds(e,f9e,g9e),i=Q.totalDays(n)-p9e,o=W.toRadians(12.112)-W.toRadians(.052992)*i,r=W.toRadians(24.224)-W.toRadians(.105984)*i,s=W.toRadians(227.645)+W.toRadians(13.012)*i,a=W.toRadians(261.105)+W.toRadians(13.340716)*i,c=W.toRadians(358)+W.toRadians(.9856)*i;return YD.pitch=W.toRadians(180)-W.toRadians(3.878)*Math.sin(o)-W.toRadians(.12)*Math.sin(r)+W.toRadians(.07)*Math.sin(s)-W.toRadians(.017)*Math.sin(a),YD.roll=W.toRadians(66.53-90)+W.toRadians(1.543)*Math.cos(o)+W.toRadians(.24)*Math.cos(r)-W.toRadians(.028)*Math.cos(s)+W.toRadians(.007)*Math.cos(a),YD.heading=W.toRadians(244.375-90)+W.toRadians(13.17635831)*i+W.toRadians(3.558)*Math.sin(o)+W.toRadians(.121)*Math.sin(r)-W.toRadians(.064)*Math.sin(s)+W.toRadians(.016)*Math.sin(a)+W.toRadians(.025)*Math.sin(c),q.fromHeadingPitchRoll(YD,b9e,t)};Ci.computeIcrfToMoonFixedMatrix=function(e,t){l(t)||(t=new q);let n=Ci.computeMoonFixedToIcrfMatrix(e,t);if(l(n))return q.transpose(n,t)};var y9e=new r_(0,0,0),x9e=new Zy(0,0,0,0,0,0),Bj=new q,zj=new q;Ci.computeFixedToIcrfMatrix=function(e,t){l(t)||(t=new q);let n=Ci.earthOrientationParameters.compute(e,x9e);if(!l(n))return;let i=e.dayNumber,o=e.secondsOfDay+Hj,r=Ci.iau2006XysData.computeXysRadians(i,o,y9e);if(!l(r))return;let s=r.x+n.xPoleOffset,a=r.y+n.yPoleOffset,c=1/(1+Math.sqrt(1-s*s-a*a)),d=Bj;d[0]=1-c*s*s,d[3]=-c*s*a,d[6]=s,d[1]=-c*s*a,d[4]=1-c*a*a,d[7]=a,d[2]=-s,d[5]=-a,d[8]=1-c*(s*s+a*a);let u=q.fromRotationZ(-r.s,zj),m=q.multiply(d,u,Bj),p=e.dayNumber,b=e.secondsOfDay-Q.computeTaiMinusUtc(e)+n.ut1MinusUtc,f=p-2451545,y=b/wn.SECONDS_PER_DAY,_=.779057273264+y+.00273781191135448*(f+y);_=_%1*W.TWO_PI;let S=q.fromRotationZ(_,zj),Z=q.multiply(m,S,Bj),R=Math.cos(n.xPoleWander),C=Math.cos(n.yPoleWander),E=Math.sin(n.xPoleWander),A=Math.sin(n.yPoleWander),L=i-h9e+o/wn.SECONDS_PER_DAY;L/=36525;let F=-47e-6*L*W.RADIANS_PER_DEGREE/3600,I=Math.cos(F),N=Math.sin(F),g=zj;return g[0]=R*I,g[1]=R*N,g[2]=E,g[3]=-C*N+A*E*I,g[4]=C*I+A*E*N,g[5]=-A*R,g[6]=-A*N-C*E*I,g[7]=A*I-C*E*N,g[8]=C*R,q.multiply(Z,g,t)};var T9e=new ce;Ci.pointToWindowCoordinates=function(e,t,n,i){return i=Ci.pointToGLWindowCoordinates(e,t,n,i),i.y=2*t[5]-i.y,i};Ci.pointToGLWindowCoordinates=function(e,t,n,i){l(i)||(i=new k);let o=T9e;return P.multiplyByVector(e,ce.fromElements(n.x,n.y,n.z,1,o),o),ce.multiplyByScalar(o,1/o.w,o),P.multiplyByVector(t,o,o),k.fromCartesian4(o,i)};var _9e=new h,S9e=new h,Z9e=new h;Ci.rotationMatrixFromPositionVelocity=function(e,t,n,i){let o=(n??ne.default).geodeticSurfaceNormal(e,_9e),r=h.cross(t,o,S9e);h.equalsEpsilon(r,h.ZERO,W.EPSILON6)&&(r=h.clone(h.UNIT_X,r));let s=h.cross(r,t,Z9e);return h.normalize(s,s),h.cross(t,s,r),h.negate(r,r),h.normalize(r,r),l(i)||(i=new q),i[0]=t.x,i[1]=t.y,i[2]=t.z,i[3]=r.x,i[4]=r.y,i[5]=r.z,i[6]=s.x,i[7]=s.y,i[8]=s.z,i};Ci.SWIZZLE_3D_TO_2D_MATRIX=Object.freeze(new P(0,0,1,0,1,0,0,0,0,1,0,0,0,0,0,1));var Ode=new pe,Kj=new h,R9e=new h,C9e=new q,Jj=new P,Bde=new P;Ci.basisTo2D=function(e,t,n){let i=P.getTranslation(t,R9e),o=e.ellipsoid,r;if(h.equals(i,h.ZERO))r=h.clone(h.ZERO,Kj);else{let u=o.cartesianToCartographic(i,Ode);r=e.project(u,Kj),h.fromElements(r.z,r.x,r.y,r)}let s=Ci.eastNorthUpToFixedFrame(i,o,Jj),a=P.inverseTransformation(s,Bde),c=P.getMatrix3(t,C9e),d=P.multiplyByMatrix3(a,c,n);return P.multiply(Ci.SWIZZLE_3D_TO_2D_MATRIX,d,n),P.setTranslation(n,r,n),n};Ci.ellipsoidTo2DModelMatrix=function(e,t,n){let i=e.ellipsoid,o=Ci.eastNorthUpToFixedFrame(t,i,Jj),r=P.inverseTransformation(o,Bde),s=i.cartesianToCartographic(t,Ode),a=e.project(s,Kj);h.fromElements(a.z,a.x,a.y,a);let c=P.fromTranslation(a,Jj);return P.multiply(Ci.SWIZZLE_3D_TO_2D_MATRIX,r,n),P.multiply(c,n,n),n};var _t=Ci;var c1=class e{constructor(t,n,i,o){this.west=t??0,this.south=n??0,this.east=i??0,this.north=o??0}get width(){return e.computeWidth(this)}get height(){return e.computeHeight(this)}static pack(t,n,i){return i=i??0,n[i++]=t.west,n[i++]=t.south,n[i++]=t.east,n[i]=t.north,n}static unpack(t,n,i){return n=n??0,l(i)||(i=new e),i.west=t[n++],i.south=t[n++],i.east=t[n++],i.north=t[n],i}static computeWidth(t){let n=t.east,i=t.west;return n=0?m.longitude:m.longitude+W.TWO_PI;r=Math.min(r,p),s=Math.max(s,p)}return o-i>s-r&&(i=r,o=s,o>W.PI&&(o=o-W.TWO_PI),i>W.PI&&(i=i-W.TWO_PI)),l(n)?(n.west=i,n.south=a,n.east=o,n.north=c,n):new e(i,a,o,c)}static fromCartesianArray(t,n,i){n=n??ne.default;let o=Number.MAX_VALUE,r=-Number.MAX_VALUE,s=Number.MAX_VALUE,a=-Number.MAX_VALUE,c=Number.MAX_VALUE,d=-Number.MAX_VALUE;for(let u=0,m=t.length;u=0?p.longitude:p.longitude+W.TWO_PI;s=Math.min(s,b),a=Math.max(a,b)}return r-o>a-s&&(o=s,r=a,r>W.PI&&(r=r-W.TWO_PI),o>W.PI&&(o=o-W.TWO_PI)),l(i)?(i.west=o,i.south=c,i.east=r,i.north=d,i):new e(o,c,r,d)}static fromBoundingSphere(t,n,i){let o=t.center,r=t.radius;if(l(n)||(n=ne.default),l(i)||(i=new e),h.equals(o,h.ZERO))return e.clone(e.MAX_VALUE,i),i;let s=_t.eastNorthUpToFixedFrame(o,n,V9e),a=P.multiplyByPointAsVector(s,h.UNIT_X,E9e);h.normalize(a,a);let c=P.multiplyByPointAsVector(s,h.UNIT_Y,A9e);h.normalize(c,c),h.multiplyByScalar(c,r,c),h.multiplyByScalar(a,r,a);let d=h.negate(c,L9e),u=h.negate(a,G9e),m=jj,p=m[0];return h.add(o,c,p),p=m[1],h.add(o,u,p),p=m[2],h.add(o,d,p),p=m[3],h.add(o,a,p),m[4]=o,e.fromCartesianArray(m,n,i)}static clone(t,n){if(l(t))return l(n)?(n.west=t.west,n.south=t.south,n.east=t.east,n.north=t.north,n):new e(t.west,t.south,t.east,t.north)}static equalsEpsilon(t,n,i){return i=i??0,t===n||l(t)&&l(n)&&Math.abs(t.west-n.west)<=i&&Math.abs(t.south-n.south)<=i&&Math.abs(t.east-n.east)<=i&&Math.abs(t.north-n.north)<=i}clone(t){return e.clone(this,t)}equals(t){return e.equals(this,t)}static equals(t,n){return t===n||l(t)&&l(n)&&t.west===n.west&&t.south===n.south&&t.east===n.east&&t.north===n.north}equalsEpsilon(t,n){return e.equalsEpsilon(this,t,n)}static _validate(t){}static southwest(t,n){return l(n)?(n.longitude=t.west,n.latitude=t.south,n.height=0,n):new pe(t.west,t.south)}static northwest(t,n){return l(n)?(n.longitude=t.west,n.latitude=t.north,n.height=0,n):new pe(t.west,t.north)}static northeast(t,n){return l(n)?(n.longitude=t.east,n.latitude=t.north,n.height=0,n):new pe(t.east,t.north)}static southeast(t,n){return l(n)?(n.longitude=t.east,n.latitude=t.south,n.height=0,n):new pe(t.east,t.south)}static center(t,n){let i=t.east,o=t.west;i0?o+=W.TWO_PI:s0&&(s+=W.TWO_PI),o=m))return l(i)?(i.west=c,i.south=u,i.east=d,i.north=m,i):new e(c,u,d,m)}static simpleIntersection(t,n,i){let o=Math.max(t.west,n.west),r=Math.max(t.south,n.south),s=Math.min(t.east,n.east),a=Math.min(t.north,n.north);if(!(r>=a||o>=s))return l(i)?(i.west=o,i.south=r,i.east=s,i.north=a,i):new e(o,r,s,a)}static union(t,n,i){l(i)||(i=new e);let o=t.east,r=t.west,s=n.east,a=n.west;o0?o+=W.TWO_PI:s0&&(s+=W.TWO_PI),or||W.equalsEpsilon(i,r,W.EPSILON14))&&(i=t.south&&o<=t.north}static subsample(t,n,i,o){n=n??ne.default,i=i??0,l(o)||(o=[]);let r=0,s=t.north,a=t.south,c=t.east,d=t.west,u=W9e;u.height=i,u.longitude=d,u.latitude=s,o[r]=n.cartographicToCartesian(u,o[r]),r++,u.longitude=c,o[r]=n.cartographicToCartesian(u,o[r]),r++,u.latitude=a,o[r]=n.cartographicToCartesian(u,o[r]),r++,u.longitude=d,o[r]=n.cartographicToCartesian(u,o[r]),r++,s<0?u.latitude=s:a>0?u.latitude=a:u.latitude=0;for(let m=1;m<8;++m)u.longitude=-Math.PI+m*W.PI_OVER_TWO,e.contains(t,u)&&(o[r]=n.cartographicToCartesian(u,o[r]),r++);return u.latitude===0&&(u.longitude=d,o[r]=n.cartographicToCartesian(u,o[r]),r++,u.longitude=c,o[r]=n.cartographicToCartesian(u,o[r]),r++),o.length=r,o}static subsection(t,n,i,o,r,s){if(l(s)||(s=new e),t.west<=t.east){let c=t.east-t.west;s.west=t.west+n*c,s.east=t.west+o*c}else{let c=W.TWO_PI+t.east-t.west;s.west=W.negativePiToPi(t.west+n*c),s.east=W.negativePiToPi(t.west+o*c)}let a=t.north-t.south;return s.south=t.south+i*a,s.north=t.south+r*a,n===1&&(s.west=t.east),o===1&&(s.east=t.east),i===1&&(s.south=t.north),r===1&&(s.north=t.north),s}};c1.packedLength=4;var V9e=new P,E9e=new h,A9e=new h,G9e=new h,L9e=new h,jj=new Array(5);for(let e=0;en.width?n.width=i:i<0&&(n.width-=i,n.x=t.x),o>n.height?n.height=o:o<0&&(n.height-=o,n.y=t.y),n};hs.intersect=function(e,t){let n=e.x,i=e.y,o=t.x,r=t.y;return n>o+t.width||n+e.widthr+t.height?qt.OUTSIDE:qt.INTERSECTING};hs.equals=function(e,t){return e===t||l(e)&&l(t)&&e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height};hs.prototype.clone=function(e){return hs.clone(this,e)};hs.prototype.intersect=function(e){return hs.intersect(this,e)};hs.prototype.equals=function(e){return hs.equals(this,e)};var nt=hs;var v4t=x(T(),1);var tc={POINTS:ie.POINTS,LINES:ie.LINES,LINE_LOOP:ie.LINE_LOOP,LINE_STRIP:ie.LINE_STRIP,TRIANGLES:ie.TRIANGLES,TRIANGLE_STRIP:ie.TRIANGLE_STRIP,TRIANGLE_FAN:ie.TRIANGLE_FAN};tc.isLines=function(e){return e===tc.LINES||e===tc.LINE_LOOP||e===tc.LINE_STRIP};tc.isTriangles=function(e){return e===tc.TRIANGLES||e===tc.TRIANGLE_STRIP||e===tc.TRIANGLE_FAN};tc.validate=function(e){return e===tc.POINTS||e===tc.LINES||e===tc.LINE_LOOP||e===tc.LINE_STRIP||e===tc.TRIANGLES||e===tc.TRIANGLE_STRIP||e===tc.TRIANGLE_FAN};Object.freeze(tc);var Ie=tc;var I4t=x(T(),1),s_=`in vec4 position; in vec2 textureCoordinates; out vec2 v_textureCoordinates; void main() @@ -85,61 +85,61 @@ void main() gl_Position = position; v_textureCoordinates = textureCoordinates; } -`;var Y4t=x(T(),1);var $r={CULL:1,OCCLUDE:2,EXECUTE_IN_CLOSEST_FRUSTUM:4,DEBUG_SHOW_BOUNDING_VOLUME:8,CAST_SHADOWS:16,RECEIVE_SHADOWS:32,PICK_ONLY:64,DEPTH_FOR_TRANSLUCENT_CLASSIFICATION:128},Qj=class e{constructor(t=B.EMPTY_OBJECT){this._boundingVolume=t.boundingVolume,this._orientedBoundingBox=t.orientedBoundingBox,this._modelMatrix=t.modelMatrix,this._primitiveType=t.primitiveType??Ie.TRIANGLES,this._vertexArray=t.vertexArray,this._count=t.count,this._offset=t.offset??0,this._instanceCount=t.instanceCount??0,this._shaderProgram=t.shaderProgram,this._uniformMap=t.uniformMap,this._renderState=t.renderState,this._framebuffer=t.framebuffer,this._pass=t.pass,this._owner=t.owner,this._debugOverlappingFrustums=0,this._pickId=t.pickId,this._snapId=t.snapId,this._pickMetadataAllowed=t.pickMetadataAllowed===!0,this._pickedMetadataInfo=void 0,this._flags=0,this.cull=t.cull??!0,this.occlude=t.occlude??!0,this.executeInClosestFrustum=t.executeInClosestFrustum??!1,this.debugShowBoundingVolume=t.debugShowBoundingVolume??!1,this.castShadows=t.castShadows??!1,this.receiveShadows=t.receiveShadows??!1,this.pickOnly=t.pickOnly??!1,this.depthForTranslucentClassification=t.depthForTranslucentClassification??!1,this.dirty=!0,this.lastDirtyTime=0,this.derivedCommands={}}get boundingVolume(){return this._boundingVolume}set boundingVolume(t){this._boundingVolume!==t&&(this._boundingVolume=t,this.dirty=!0)}get orientedBoundingBox(){return this._orientedBoundingBox}set orientedBoundingBox(t){this._orientedBoundingBox!==t&&(this._orientedBoundingBox=t,this.dirty=!0)}get cull(){return Jc(this,$r.CULL)}set cull(t){Jc(this,$r.CULL)!==t&&(Ly(this,$r.CULL,t),this.dirty=!0)}get occlude(){return Jc(this,$r.OCCLUDE)}set occlude(t){Jc(this,$r.OCCLUDE)!==t&&(Ly(this,$r.OCCLUDE,t),this.dirty=!0)}get modelMatrix(){return this._modelMatrix}set modelMatrix(t){this._modelMatrix!==t&&(this._modelMatrix=t,this.dirty=!0)}get primitiveType(){return this._primitiveType}set primitiveType(t){this._primitiveType!==t&&(this._primitiveType=t,this.dirty=!0)}get vertexArray(){return this._vertexArray}set vertexArray(t){this._vertexArray!==t&&(this._vertexArray=t,this.dirty=!0)}get count(){return this._count}set count(t){this._count!==t&&(this._count=t,this.dirty=!0)}get offset(){return this._offset}set offset(t){this._offset!==t&&(this._offset=t,this.dirty=!0)}get instanceCount(){return this._instanceCount}set instanceCount(t){this._instanceCount!==t&&(this._instanceCount=t,this.dirty=!0)}get shaderProgram(){return this._shaderProgram}set shaderProgram(t){this._shaderProgram!==t&&(this._shaderProgram=t,this.dirty=!0)}get castShadows(){return Jc(this,$r.CAST_SHADOWS)}set castShadows(t){Jc(this,$r.CAST_SHADOWS)!==t&&(Ly(this,$r.CAST_SHADOWS,t),this.dirty=!0)}get receiveShadows(){return Jc(this,$r.RECEIVE_SHADOWS)}set receiveShadows(t){Jc(this,$r.RECEIVE_SHADOWS)!==t&&(Ly(this,$r.RECEIVE_SHADOWS,t),this.dirty=!0)}get uniformMap(){return this._uniformMap}set uniformMap(t){this._uniformMap!==t&&(this._uniformMap=t,this.dirty=!0)}get renderState(){return this._renderState}set renderState(t){this._renderState!==t&&(this._renderState=t,this.dirty=!0)}get framebuffer(){return this._framebuffer}set framebuffer(t){this._framebuffer!==t&&(this._framebuffer=t,this.dirty=!0)}get pass(){return this._pass}set pass(t){this._pass!==t&&(this._pass=t,this.dirty=!0)}get executeInClosestFrustum(){return Jc(this,$r.EXECUTE_IN_CLOSEST_FRUSTUM)}set executeInClosestFrustum(t){Jc(this,$r.EXECUTE_IN_CLOSEST_FRUSTUM)!==t&&(Ly(this,$r.EXECUTE_IN_CLOSEST_FRUSTUM,t),this.dirty=!0)}get owner(){return this._owner}set owner(t){this._owner!==t&&(this._owner=t,this.dirty=!0)}get debugShowBoundingVolume(){return Jc(this,$r.DEBUG_SHOW_BOUNDING_VOLUME)}set debugShowBoundingVolume(t){Jc(this,$r.DEBUG_SHOW_BOUNDING_VOLUME)!==t&&(Ly(this,$r.DEBUG_SHOW_BOUNDING_VOLUME,t),this.dirty=!0)}get debugOverlappingFrustums(){return this._debugOverlappingFrustums}set debugOverlappingFrustums(t){this._debugOverlappingFrustums!==t&&(this._debugOverlappingFrustums=t,this.dirty=!0)}get pickId(){return this._pickId}set pickId(t){this._pickId!==t&&(this._pickId=t,this.dirty=!0)}get snapId(){return this._snapId}set snapId(t){this._snapId!==t&&(this._snapId=t,this.dirty=!0)}get pickMetadataAllowed(){return this._pickMetadataAllowed}get pickedMetadataInfo(){return this._pickedMetadataInfo}set pickedMetadataInfo(t){this._pickedMetadataInfo!==t&&(this._pickedMetadataInfo=t,this.dirty=!0)}get pickOnly(){return Jc(this,$r.PICK_ONLY)}set pickOnly(t){Jc(this,$r.PICK_ONLY)!==t&&(Ly(this,$r.PICK_ONLY,t),this.dirty=!0)}get depthForTranslucentClassification(){return Jc(this,$r.DEPTH_FOR_TRANSLUCENT_CLASSIFICATION)}set depthForTranslucentClassification(t){Jc(this,$r.DEPTH_FOR_TRANSLUCENT_CLASSIFICATION)!==t&&(Ly(this,$r.DEPTH_FOR_TRANSLUCENT_CLASSIFICATION,t),this.dirty=!0)}static shallowClone(t,n){if(l(t))return l(n)||(n=new e),n._boundingVolume=t._boundingVolume,n._orientedBoundingBox=t._orientedBoundingBox,n._modelMatrix=t._modelMatrix,n._primitiveType=t._primitiveType,n._vertexArray=t._vertexArray,n._count=t._count,n._offset=t._offset,n._instanceCount=t._instanceCount,n._shaderProgram=t._shaderProgram,n._uniformMap=t._uniformMap,n._renderState=t._renderState,n._framebuffer=t._framebuffer,n._pass=t._pass,n._owner=t._owner,n._debugOverlappingFrustums=t._debugOverlappingFrustums,n._pickId=t._pickId,n._snapId=t._snapId,n._pickMetadataAllowed=t._pickMetadataAllowed,n._pickedMetadataInfo=t._pickedMetadataInfo,n._flags=t._flags,n.dirty=!0,n.lastDirtyTime=0,n}execute(t,n){t.draw(this,n)}};function Jc(e,t){return(e._flags&t)===t}function Ly(e,t,n){n?e._flags|=t:e._flags&=~t}var lt=Qj;var $4t=x(T(),1);var B4t=x(T(),1);var k4t=x(T(),1);var Ii={UNSIGNED_BYTE:ie.UNSIGNED_BYTE,UNSIGNED_SHORT:ie.UNSIGNED_SHORT,UNSIGNED_INT:ie.UNSIGNED_INT,FLOAT:ie.FLOAT,HALF_FLOAT:ie.HALF_FLOAT_OES,UNSIGNED_INT_24_8:ie.UNSIGNED_INT_24_8,UNSIGNED_SHORT_4_4_4_4:ie.UNSIGNED_SHORT_4_4_4_4,UNSIGNED_SHORT_5_5_5_1:ie.UNSIGNED_SHORT_5_5_5_1,UNSIGNED_SHORT_5_6_5:ie.UNSIGNED_SHORT_5_6_5};Ii.toWebGLConstant=function(e,t){switch(e){case Ii.UNSIGNED_BYTE:return ie.UNSIGNED_BYTE;case Ii.UNSIGNED_SHORT:return ie.UNSIGNED_SHORT;case Ii.UNSIGNED_INT:return ie.UNSIGNED_INT;case Ii.FLOAT:return ie.FLOAT;case Ii.HALF_FLOAT:return t.webgl2?ie.HALF_FLOAT:ie.HALF_FLOAT_OES;case Ii.UNSIGNED_INT_24_8:return ie.UNSIGNED_INT_24_8;case Ii.UNSIGNED_SHORT_4_4_4_4:return ie.UNSIGNED_SHORT_4_4_4_4;case Ii.UNSIGNED_SHORT_5_5_5_1:return ie.UNSIGNED_SHORT_5_5_5_1;case Ii.UNSIGNED_SHORT_5_6_5:return Ii.UNSIGNED_SHORT_5_6_5}};Ii.isPacked=function(e){return e===Ii.UNSIGNED_INT_24_8||e===Ii.UNSIGNED_SHORT_4_4_4_4||e===Ii.UNSIGNED_SHORT_5_5_5_1||e===Ii.UNSIGNED_SHORT_5_6_5};Ii.sizeInBytes=function(e){switch(e){case Ii.UNSIGNED_BYTE:return 1;case Ii.UNSIGNED_SHORT:case Ii.UNSIGNED_SHORT_4_4_4_4:case Ii.UNSIGNED_SHORT_5_5_5_1:case Ii.UNSIGNED_SHORT_5_6_5:case Ii.HALF_FLOAT:return 2;case Ii.UNSIGNED_INT:case Ii.FLOAT:case Ii.UNSIGNED_INT_24_8:return 4}};Ii.validate=function(e){return e===Ii.UNSIGNED_BYTE||e===Ii.UNSIGNED_SHORT||e===Ii.UNSIGNED_INT||e===Ii.FLOAT||e===Ii.HALF_FLOAT||e===Ii.UNSIGNED_INT_24_8||e===Ii.UNSIGNED_SHORT_4_4_4_4||e===Ii.UNSIGNED_SHORT_5_5_5_1||e===Ii.UNSIGNED_SHORT_5_6_5};Ii.getTypedArrayConstructor=function(e){let t=Ii.sizeInBytes(e);return t===Uint8Array.BYTES_PER_ELEMENT?Uint8Array:t===Uint16Array.BYTES_PER_ELEMENT?Uint16Array:t===Float32Array.BYTES_PER_ELEMENT&&e===Ii.FLOAT?Float32Array:Uint32Array};Object.freeze(Ii);var Ue=Ii;var at={DEPTH_COMPONENT:ie.DEPTH_COMPONENT,DEPTH_STENCIL:ie.DEPTH_STENCIL,ALPHA:ie.ALPHA,RED:ie.RED,RG:ie.RG,RGB:ie.RGB,RGBA:ie.RGBA,RED_INTEGER:ie.RED_INTEGER,RG_INTEGER:ie.RG_INTEGER,RGB_INTEGER:ie.RGB_INTEGER,RGBA_INTEGER:ie.RGBA_INTEGER,LUMINANCE:ie.LUMINANCE,LUMINANCE_ALPHA:ie.LUMINANCE_ALPHA,RGB_DXT1:ie.COMPRESSED_RGB_S3TC_DXT1_EXT,RGBA_DXT1:ie.COMPRESSED_RGBA_S3TC_DXT1_EXT,RGBA_DXT3:ie.COMPRESSED_RGBA_S3TC_DXT3_EXT,RGBA_DXT5:ie.COMPRESSED_RGBA_S3TC_DXT5_EXT,RGB_PVRTC_4BPPV1:ie.COMPRESSED_RGB_PVRTC_4BPPV1_IMG,RGB_PVRTC_2BPPV1:ie.COMPRESSED_RGB_PVRTC_2BPPV1_IMG,RGBA_PVRTC_4BPPV1:ie.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG,RGBA_PVRTC_2BPPV1:ie.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG,RGBA_ASTC:ie.COMPRESSED_RGBA_ASTC_4x4_WEBGL,RGB_ETC1:ie.COMPRESSED_RGB_ETC1_WEBGL,RGB8_ETC2:ie.COMPRESSED_RGB8_ETC2,RGBA8_ETC2_EAC:ie.COMPRESSED_RGBA8_ETC2_EAC,RGBA_BC7:ie.COMPRESSED_RGBA_BPTC_UNORM};at.componentsLength=function(e){switch(e){case at.RGB:case at.RGB_INTEGER:return 3;case at.RGBA:case at.RGBA_INTEGER:return 4;case at.LUMINANCE_ALPHA:case at.RG:case at.RG_INTEGER:return 2;case at.ALPHA:case at.RED:case at.RED_INTEGER:case at.LUMINANCE:return 1;default:return 1}};at.validate=function(e){return e===at.DEPTH_COMPONENT||e===at.DEPTH_STENCIL||e===at.ALPHA||e===at.RED||e===at.RG||e===at.RGB||e===at.RGBA||e===at.RED_INTEGER||e===at.RG_INTEGER||e===at.RGB_INTEGER||e===at.RGBA_INTEGER||e===at.LUMINANCE||e===at.LUMINANCE_ALPHA||e===at.RGB_DXT1||e===at.RGBA_DXT1||e===at.RGBA_DXT3||e===at.RGBA_DXT5||e===at.RGB_PVRTC_4BPPV1||e===at.RGB_PVRTC_2BPPV1||e===at.RGBA_PVRTC_4BPPV1||e===at.RGBA_PVRTC_2BPPV1||e===at.RGBA_ASTC||e===at.RGB_ETC1||e===at.RGB8_ETC2||e===at.RGBA8_ETC2_EAC||e===at.RGBA_BC7};at.isColorFormat=function(e){return e===at.RED||e===at.ALPHA||e===at.RGB||e===at.RGBA||e===at.LUMINANCE||e===at.LUMINANCE_ALPHA};at.isDepthFormat=function(e){return e===at.DEPTH_COMPONENT||e===at.DEPTH_STENCIL};at.isCompressedFormat=function(e){return e===at.RGB_DXT1||e===at.RGBA_DXT1||e===at.RGBA_DXT3||e===at.RGBA_DXT5||e===at.RGB_PVRTC_4BPPV1||e===at.RGB_PVRTC_2BPPV1||e===at.RGBA_PVRTC_4BPPV1||e===at.RGBA_PVRTC_2BPPV1||e===at.RGBA_ASTC||e===at.RGB_ETC1||e===at.RGB8_ETC2||e===at.RGBA8_ETC2_EAC||e===at.RGBA_BC7};at.isDXTFormat=function(e){return e===at.RGB_DXT1||e===at.RGBA_DXT1||e===at.RGBA_DXT3||e===at.RGBA_DXT5};at.isPVRTCFormat=function(e){return e===at.RGB_PVRTC_4BPPV1||e===at.RGB_PVRTC_2BPPV1||e===at.RGBA_PVRTC_4BPPV1||e===at.RGBA_PVRTC_2BPPV1};at.isASTCFormat=function(e){return e===at.RGBA_ASTC};at.isETC1Format=function(e){return e===at.RGB_ETC1};at.isETC2Format=function(e){return e===at.RGB8_ETC2||e===at.RGBA8_ETC2_EAC};at.isBC7Format=function(e){return e===at.RGBA_BC7};at.compressedTextureSizeInBytes=function(e,t,n){switch(e){case at.RGB_DXT1:case at.RGBA_DXT1:case at.RGB_ETC1:case at.RGB8_ETC2:return Math.floor((t+3)/4)*Math.floor((n+3)/4)*8;case at.RGBA_DXT3:case at.RGBA_DXT5:case at.RGBA_ASTC:case at.RGBA8_ETC2_EAC:return Math.floor((t+3)/4)*Math.floor((n+3)/4)*16;case at.RGB_PVRTC_4BPPV1:case at.RGBA_PVRTC_4BPPV1:return Math.floor((Math.max(t,8)*Math.max(n,8)*4+7)/8);case at.RGB_PVRTC_2BPPV1:case at.RGBA_PVRTC_2BPPV1:return Math.floor((Math.max(t,16)*Math.max(n,8)*2+7)/8);case at.RGBA_BC7:return Math.ceil(t/4)*Math.ceil(n/4)*16;default:return 0}};at.textureSizeInBytes=function(e,t,n,i){let o=at.componentsLength(e);return Ue.isPacked(t)&&(o=1),o*Ue.sizeInBytes(t)*n*i};at.texture3DSizeInBytes=function(e,t,n,i,o){let r=at.componentsLength(e);return Ue.isPacked(t)&&(r=1),r*Ue.sizeInBytes(t)*n*i*o};at.alignmentInBytes=function(e,t,n){let i=at.textureSizeInBytes(e,t,n,1)%4;return i===0?4:i===2?2:1};at.createTypedArray=function(e,t,n,i){let o=Ue.getTypedArrayConstructor(t),r=at.componentsLength(e)*n*i;return new o(r)};at.flipY=function(e,t,n,i,o){if(o===1)return e;let r=at.createTypedArray(t,n,i,o),s=at.componentsLength(t),a=i*s;for(let c=0;c0&&console.log(`${Ep}Vertex shader compile log: ${c}`),c=e.getShaderInfoLog(r),l(c)&&c.length>0&&console.log(`${Ep}Fragment shader compile log: ${c}`),c=e.getProgramInfoLog(s),l(c)&&c.length>0&&console.log(`${Ep}Shader program link log: ${c}`)),e.deleteShader(o),e.deleteShader(r),s;let d,u=t._debugShaders;throw e.getShaderParameter(r,e.COMPILE_STATUS)?e.getShaderParameter(o,e.COMPILE_STATUS)?(c=e.getProgramInfoLog(s),console.error(`${Ep}Shader program link log: ${c}`),m(o,"vertex"),m(r,"fragment"),d=`Program failed to link. Link log: ${c}`):(c=e.getShaderInfoLog(o),console.error(`${Ep}Vertex shader compile log: ${c}`),console.error(`${Ep} Vertex shader source: +`;var M4t=x(T(),1);var $r={CULL:1,OCCLUDE:2,EXECUTE_IN_CLOSEST_FRUSTUM:4,DEBUG_SHOW_BOUNDING_VOLUME:8,CAST_SHADOWS:16,RECEIVE_SHADOWS:32,PICK_ONLY:64,DEPTH_FOR_TRANSLUCENT_CLASSIFICATION:128},Qj=class e{constructor(t=B.EMPTY_OBJECT){this._boundingVolume=t.boundingVolume,this._orientedBoundingBox=t.orientedBoundingBox,this._modelMatrix=t.modelMatrix,this._primitiveType=t.primitiveType??Ie.TRIANGLES,this._vertexArray=t.vertexArray,this._count=t.count,this._offset=t.offset??0,this._instanceCount=t.instanceCount??0,this._shaderProgram=t.shaderProgram,this._uniformMap=t.uniformMap,this._renderState=t.renderState,this._framebuffer=t.framebuffer,this._pass=t.pass,this._owner=t.owner,this._debugOverlappingFrustums=0,this._pickId=t.pickId,this._snapId=t.snapId,this._pickMetadataAllowed=t.pickMetadataAllowed===!0,this._pickedMetadataInfo=void 0,this._flags=0,this.cull=t.cull??!0,this.occlude=t.occlude??!0,this.executeInClosestFrustum=t.executeInClosestFrustum??!1,this.debugShowBoundingVolume=t.debugShowBoundingVolume??!1,this.castShadows=t.castShadows??!1,this.receiveShadows=t.receiveShadows??!1,this.pickOnly=t.pickOnly??!1,this.depthForTranslucentClassification=t.depthForTranslucentClassification??!1,this.dirty=!0,this.lastDirtyTime=0,this.derivedCommands={}}get boundingVolume(){return this._boundingVolume}set boundingVolume(t){this._boundingVolume!==t&&(this._boundingVolume=t,this.dirty=!0)}get orientedBoundingBox(){return this._orientedBoundingBox}set orientedBoundingBox(t){this._orientedBoundingBox!==t&&(this._orientedBoundingBox=t,this.dirty=!0)}get cull(){return Jc(this,$r.CULL)}set cull(t){Jc(this,$r.CULL)!==t&&(Ly(this,$r.CULL,t),this.dirty=!0)}get occlude(){return Jc(this,$r.OCCLUDE)}set occlude(t){Jc(this,$r.OCCLUDE)!==t&&(Ly(this,$r.OCCLUDE,t),this.dirty=!0)}get modelMatrix(){return this._modelMatrix}set modelMatrix(t){this._modelMatrix!==t&&(this._modelMatrix=t,this.dirty=!0)}get primitiveType(){return this._primitiveType}set primitiveType(t){this._primitiveType!==t&&(this._primitiveType=t,this.dirty=!0)}get vertexArray(){return this._vertexArray}set vertexArray(t){this._vertexArray!==t&&(this._vertexArray=t,this.dirty=!0)}get count(){return this._count}set count(t){this._count!==t&&(this._count=t,this.dirty=!0)}get offset(){return this._offset}set offset(t){this._offset!==t&&(this._offset=t,this.dirty=!0)}get instanceCount(){return this._instanceCount}set instanceCount(t){this._instanceCount!==t&&(this._instanceCount=t,this.dirty=!0)}get shaderProgram(){return this._shaderProgram}set shaderProgram(t){this._shaderProgram!==t&&(this._shaderProgram=t,this.dirty=!0)}get castShadows(){return Jc(this,$r.CAST_SHADOWS)}set castShadows(t){Jc(this,$r.CAST_SHADOWS)!==t&&(Ly(this,$r.CAST_SHADOWS,t),this.dirty=!0)}get receiveShadows(){return Jc(this,$r.RECEIVE_SHADOWS)}set receiveShadows(t){Jc(this,$r.RECEIVE_SHADOWS)!==t&&(Ly(this,$r.RECEIVE_SHADOWS,t),this.dirty=!0)}get uniformMap(){return this._uniformMap}set uniformMap(t){this._uniformMap!==t&&(this._uniformMap=t,this.dirty=!0)}get renderState(){return this._renderState}set renderState(t){this._renderState!==t&&(this._renderState=t,this.dirty=!0)}get framebuffer(){return this._framebuffer}set framebuffer(t){this._framebuffer!==t&&(this._framebuffer=t,this.dirty=!0)}get pass(){return this._pass}set pass(t){this._pass!==t&&(this._pass=t,this.dirty=!0)}get executeInClosestFrustum(){return Jc(this,$r.EXECUTE_IN_CLOSEST_FRUSTUM)}set executeInClosestFrustum(t){Jc(this,$r.EXECUTE_IN_CLOSEST_FRUSTUM)!==t&&(Ly(this,$r.EXECUTE_IN_CLOSEST_FRUSTUM,t),this.dirty=!0)}get owner(){return this._owner}set owner(t){this._owner!==t&&(this._owner=t,this.dirty=!0)}get debugShowBoundingVolume(){return Jc(this,$r.DEBUG_SHOW_BOUNDING_VOLUME)}set debugShowBoundingVolume(t){Jc(this,$r.DEBUG_SHOW_BOUNDING_VOLUME)!==t&&(Ly(this,$r.DEBUG_SHOW_BOUNDING_VOLUME,t),this.dirty=!0)}get debugOverlappingFrustums(){return this._debugOverlappingFrustums}set debugOverlappingFrustums(t){this._debugOverlappingFrustums!==t&&(this._debugOverlappingFrustums=t,this.dirty=!0)}get pickId(){return this._pickId}set pickId(t){this._pickId!==t&&(this._pickId=t,this.dirty=!0)}get snapId(){return this._snapId}set snapId(t){this._snapId!==t&&(this._snapId=t,this.dirty=!0)}get pickMetadataAllowed(){return this._pickMetadataAllowed}get pickedMetadataInfo(){return this._pickedMetadataInfo}set pickedMetadataInfo(t){this._pickedMetadataInfo!==t&&(this._pickedMetadataInfo=t,this.dirty=!0)}get pickOnly(){return Jc(this,$r.PICK_ONLY)}set pickOnly(t){Jc(this,$r.PICK_ONLY)!==t&&(Ly(this,$r.PICK_ONLY,t),this.dirty=!0)}get depthForTranslucentClassification(){return Jc(this,$r.DEPTH_FOR_TRANSLUCENT_CLASSIFICATION)}set depthForTranslucentClassification(t){Jc(this,$r.DEPTH_FOR_TRANSLUCENT_CLASSIFICATION)!==t&&(Ly(this,$r.DEPTH_FOR_TRANSLUCENT_CLASSIFICATION,t),this.dirty=!0)}static shallowClone(t,n){if(l(t))return l(n)||(n=new e),n._boundingVolume=t._boundingVolume,n._orientedBoundingBox=t._orientedBoundingBox,n._modelMatrix=t._modelMatrix,n._primitiveType=t._primitiveType,n._vertexArray=t._vertexArray,n._count=t._count,n._offset=t._offset,n._instanceCount=t._instanceCount,n._shaderProgram=t._shaderProgram,n._uniformMap=t._uniformMap,n._renderState=t._renderState,n._framebuffer=t._framebuffer,n._pass=t._pass,n._owner=t._owner,n._debugOverlappingFrustums=t._debugOverlappingFrustums,n._pickId=t._pickId,n._snapId=t._snapId,n._pickMetadataAllowed=t._pickMetadataAllowed,n._pickedMetadataInfo=t._pickedMetadataInfo,n._flags=t._flags,n.dirty=!0,n.lastDirtyTime=0,n}execute(t,n){t.draw(this,n)}};function Jc(e,t){return(e._flags&t)===t}function Ly(e,t,n){n?e._flags|=t:e._flags&=~t}var lt=Qj;var eQt=x(T(),1);var z4t=x(T(),1);var U4t=x(T(),1);var Ii={UNSIGNED_BYTE:ie.UNSIGNED_BYTE,UNSIGNED_SHORT:ie.UNSIGNED_SHORT,UNSIGNED_INT:ie.UNSIGNED_INT,FLOAT:ie.FLOAT,HALF_FLOAT:ie.HALF_FLOAT_OES,UNSIGNED_INT_24_8:ie.UNSIGNED_INT_24_8,UNSIGNED_SHORT_4_4_4_4:ie.UNSIGNED_SHORT_4_4_4_4,UNSIGNED_SHORT_5_5_5_1:ie.UNSIGNED_SHORT_5_5_5_1,UNSIGNED_SHORT_5_6_5:ie.UNSIGNED_SHORT_5_6_5};Ii.toWebGLConstant=function(e,t){switch(e){case Ii.UNSIGNED_BYTE:return ie.UNSIGNED_BYTE;case Ii.UNSIGNED_SHORT:return ie.UNSIGNED_SHORT;case Ii.UNSIGNED_INT:return ie.UNSIGNED_INT;case Ii.FLOAT:return ie.FLOAT;case Ii.HALF_FLOAT:return t.webgl2?ie.HALF_FLOAT:ie.HALF_FLOAT_OES;case Ii.UNSIGNED_INT_24_8:return ie.UNSIGNED_INT_24_8;case Ii.UNSIGNED_SHORT_4_4_4_4:return ie.UNSIGNED_SHORT_4_4_4_4;case Ii.UNSIGNED_SHORT_5_5_5_1:return ie.UNSIGNED_SHORT_5_5_5_1;case Ii.UNSIGNED_SHORT_5_6_5:return Ii.UNSIGNED_SHORT_5_6_5}};Ii.isPacked=function(e){return e===Ii.UNSIGNED_INT_24_8||e===Ii.UNSIGNED_SHORT_4_4_4_4||e===Ii.UNSIGNED_SHORT_5_5_5_1||e===Ii.UNSIGNED_SHORT_5_6_5};Ii.sizeInBytes=function(e){switch(e){case Ii.UNSIGNED_BYTE:return 1;case Ii.UNSIGNED_SHORT:case Ii.UNSIGNED_SHORT_4_4_4_4:case Ii.UNSIGNED_SHORT_5_5_5_1:case Ii.UNSIGNED_SHORT_5_6_5:case Ii.HALF_FLOAT:return 2;case Ii.UNSIGNED_INT:case Ii.FLOAT:case Ii.UNSIGNED_INT_24_8:return 4}};Ii.validate=function(e){return e===Ii.UNSIGNED_BYTE||e===Ii.UNSIGNED_SHORT||e===Ii.UNSIGNED_INT||e===Ii.FLOAT||e===Ii.HALF_FLOAT||e===Ii.UNSIGNED_INT_24_8||e===Ii.UNSIGNED_SHORT_4_4_4_4||e===Ii.UNSIGNED_SHORT_5_5_5_1||e===Ii.UNSIGNED_SHORT_5_6_5};Ii.getTypedArrayConstructor=function(e){let t=Ii.sizeInBytes(e);return t===Uint8Array.BYTES_PER_ELEMENT?Uint8Array:t===Uint16Array.BYTES_PER_ELEMENT?Uint16Array:t===Float32Array.BYTES_PER_ELEMENT&&e===Ii.FLOAT?Float32Array:Uint32Array};Object.freeze(Ii);var Ue=Ii;var at={DEPTH_COMPONENT:ie.DEPTH_COMPONENT,DEPTH_STENCIL:ie.DEPTH_STENCIL,ALPHA:ie.ALPHA,RED:ie.RED,RG:ie.RG,RGB:ie.RGB,RGBA:ie.RGBA,RED_INTEGER:ie.RED_INTEGER,RG_INTEGER:ie.RG_INTEGER,RGB_INTEGER:ie.RGB_INTEGER,RGBA_INTEGER:ie.RGBA_INTEGER,LUMINANCE:ie.LUMINANCE,LUMINANCE_ALPHA:ie.LUMINANCE_ALPHA,RGB_DXT1:ie.COMPRESSED_RGB_S3TC_DXT1_EXT,RGBA_DXT1:ie.COMPRESSED_RGBA_S3TC_DXT1_EXT,RGBA_DXT3:ie.COMPRESSED_RGBA_S3TC_DXT3_EXT,RGBA_DXT5:ie.COMPRESSED_RGBA_S3TC_DXT5_EXT,RGB_PVRTC_4BPPV1:ie.COMPRESSED_RGB_PVRTC_4BPPV1_IMG,RGB_PVRTC_2BPPV1:ie.COMPRESSED_RGB_PVRTC_2BPPV1_IMG,RGBA_PVRTC_4BPPV1:ie.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG,RGBA_PVRTC_2BPPV1:ie.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG,RGBA_ASTC:ie.COMPRESSED_RGBA_ASTC_4x4_WEBGL,RGB_ETC1:ie.COMPRESSED_RGB_ETC1_WEBGL,RGB8_ETC2:ie.COMPRESSED_RGB8_ETC2,RGBA8_ETC2_EAC:ie.COMPRESSED_RGBA8_ETC2_EAC,RGBA_BC7:ie.COMPRESSED_RGBA_BPTC_UNORM};at.componentsLength=function(e){switch(e){case at.RGB:case at.RGB_INTEGER:return 3;case at.RGBA:case at.RGBA_INTEGER:return 4;case at.LUMINANCE_ALPHA:case at.RG:case at.RG_INTEGER:return 2;case at.ALPHA:case at.RED:case at.RED_INTEGER:case at.LUMINANCE:return 1;default:return 1}};at.validate=function(e){return e===at.DEPTH_COMPONENT||e===at.DEPTH_STENCIL||e===at.ALPHA||e===at.RED||e===at.RG||e===at.RGB||e===at.RGBA||e===at.RED_INTEGER||e===at.RG_INTEGER||e===at.RGB_INTEGER||e===at.RGBA_INTEGER||e===at.LUMINANCE||e===at.LUMINANCE_ALPHA||e===at.RGB_DXT1||e===at.RGBA_DXT1||e===at.RGBA_DXT3||e===at.RGBA_DXT5||e===at.RGB_PVRTC_4BPPV1||e===at.RGB_PVRTC_2BPPV1||e===at.RGBA_PVRTC_4BPPV1||e===at.RGBA_PVRTC_2BPPV1||e===at.RGBA_ASTC||e===at.RGB_ETC1||e===at.RGB8_ETC2||e===at.RGBA8_ETC2_EAC||e===at.RGBA_BC7};at.isColorFormat=function(e){return e===at.RED||e===at.ALPHA||e===at.RGB||e===at.RGBA||e===at.LUMINANCE||e===at.LUMINANCE_ALPHA};at.isDepthFormat=function(e){return e===at.DEPTH_COMPONENT||e===at.DEPTH_STENCIL};at.isCompressedFormat=function(e){return e===at.RGB_DXT1||e===at.RGBA_DXT1||e===at.RGBA_DXT3||e===at.RGBA_DXT5||e===at.RGB_PVRTC_4BPPV1||e===at.RGB_PVRTC_2BPPV1||e===at.RGBA_PVRTC_4BPPV1||e===at.RGBA_PVRTC_2BPPV1||e===at.RGBA_ASTC||e===at.RGB_ETC1||e===at.RGB8_ETC2||e===at.RGBA8_ETC2_EAC||e===at.RGBA_BC7};at.isDXTFormat=function(e){return e===at.RGB_DXT1||e===at.RGBA_DXT1||e===at.RGBA_DXT3||e===at.RGBA_DXT5};at.isPVRTCFormat=function(e){return e===at.RGB_PVRTC_4BPPV1||e===at.RGB_PVRTC_2BPPV1||e===at.RGBA_PVRTC_4BPPV1||e===at.RGBA_PVRTC_2BPPV1};at.isASTCFormat=function(e){return e===at.RGBA_ASTC};at.isETC1Format=function(e){return e===at.RGB_ETC1};at.isETC2Format=function(e){return e===at.RGB8_ETC2||e===at.RGBA8_ETC2_EAC};at.isBC7Format=function(e){return e===at.RGBA_BC7};at.compressedTextureSizeInBytes=function(e,t,n){switch(e){case at.RGB_DXT1:case at.RGBA_DXT1:case at.RGB_ETC1:case at.RGB8_ETC2:return Math.floor((t+3)/4)*Math.floor((n+3)/4)*8;case at.RGBA_DXT3:case at.RGBA_DXT5:case at.RGBA_ASTC:case at.RGBA8_ETC2_EAC:return Math.floor((t+3)/4)*Math.floor((n+3)/4)*16;case at.RGB_PVRTC_4BPPV1:case at.RGBA_PVRTC_4BPPV1:return Math.floor((Math.max(t,8)*Math.max(n,8)*4+7)/8);case at.RGB_PVRTC_2BPPV1:case at.RGBA_PVRTC_2BPPV1:return Math.floor((Math.max(t,16)*Math.max(n,8)*2+7)/8);case at.RGBA_BC7:return Math.ceil(t/4)*Math.ceil(n/4)*16;default:return 0}};at.textureSizeInBytes=function(e,t,n,i){let o=at.componentsLength(e);return Ue.isPacked(t)&&(o=1),o*Ue.sizeInBytes(t)*n*i};at.texture3DSizeInBytes=function(e,t,n,i,o){let r=at.componentsLength(e);return Ue.isPacked(t)&&(r=1),r*Ue.sizeInBytes(t)*n*i*o};at.alignmentInBytes=function(e,t,n){let i=at.textureSizeInBytes(e,t,n,1)%4;return i===0?4:i===2?2:1};at.createTypedArray=function(e,t,n,i){let o=Ue.getTypedArrayConstructor(t),r=at.componentsLength(e)*n*i;return new o(r)};at.flipY=function(e,t,n,i,o){if(o===1)return e;let r=at.createTypedArray(t,n,i,o),s=at.componentsLength(t),a=i*s;for(let c=0;c0&&console.log(`${Ep}Vertex shader compile log: ${c}`),c=e.getShaderInfoLog(r),l(c)&&c.length>0&&console.log(`${Ep}Fragment shader compile log: ${c}`),c=e.getProgramInfoLog(s),l(c)&&c.length>0&&console.log(`${Ep}Shader program link log: ${c}`)),e.deleteShader(o),e.deleteShader(r),s;let d,u=t._debugShaders;throw e.getShaderParameter(r,e.COMPILE_STATUS)?e.getShaderParameter(o,e.COMPILE_STATUS)?(c=e.getProgramInfoLog(s),console.error(`${Ep}Shader program link log: ${c}`),m(o,"vertex"),m(r,"fragment"),d=`Program failed to link. Link log: ${c}`):(c=e.getShaderInfoLog(o),console.error(`${Ep}Vertex shader compile log: ${c}`),console.error(`${Ep} Vertex shader source: ${n}`),d=`Vertex shader failed to compile. Compile log: ${c}`):(c=e.getShaderInfoLog(r),console.error(`${Ep}Fragment shader compile log: ${c}`),console.error(`${Ep} Fragment shader source: ${i}`),d=`Fragment shader failed to compile. Compile log: ${c}`),e.deleteShader(o),e.deleteShader(r),e.deleteProgram(s),new ae(d);function m(p,b){if(!l(u))return;let f=u.getTranslatedShaderSource(p);if(f===""){console.error(`${Ep}${b} shader translation failed.`);return}console.error(`${Ep}Translated ${b} shaderSource: -${f}`)}}function j9e(e,t,n){let i={};for(let o=0;o=0){if(u=n[d.slice(0,f)],!l(u))continue;m=u._locations,m.length<=1&&(p=u.value,b=e.getUniformLocation(t,d),b!==null&&(m.push(b),p.push(e.getUniform(t,b))))}else{m=[];for(let y=0;y{e.onmessage=function(o){let r=o.data.array,s=l(r)&&r[0]===t;i(s),e.terminate(),nc._canTransferArrayBuffer=s}})}return nc._canTransferArrayBuffer}var C4=new Se;function R4(e){let t;try{t=new Blob([e],{type:"application/javascript"})}catch{let o=window.BlobBuilder||window.WebKitBlobBuilder||window.MozBlobBuilder||window.MSBlobBuilder,r=new o;r.append(e),t=r.getBlob("application/javascript")}return(window.URL||window.webkitURL).createObjectURL(t)}function V4(e){let t=new fue.default(e),n=t.scheme().length!==0&&t.fragment().length===0,i=e.replace(/\.js$/,""),o={},r,s;if(Vy(e))s=e;else if(!n){let a=en(`${nc._workerModulePrefix}/${i}.js`);Vy(a)&&(s=a)}if(s){let a=`import "${s}";`;return r=R4(a),o.type="module",new Worker(r,o)}if(!n&&typeof CESIUM_WORKERS<"u"){let a=` +${f}`)}}function Q9e(e,t,n){let i={};for(let o=0;o=0){if(u=n[d.slice(0,f)],!l(u))continue;m=u._locations,m.length<=1&&(p=u.value,b=e.getUniformLocation(t,d),b!==null&&(m.push(b),p.push(e.getUniform(t,b))))}else{m=[];for(let y=0;y{e.onmessage=function(o){let r=o.data.array,s=l(r)&&r[0]===t;i(s),e.terminate(),nc._canTransferArrayBuffer=s}})}return nc._canTransferArrayBuffer}var C4=new Se;function R4(e){let t;try{t=new Blob([e],{type:"application/javascript"})}catch{let o=window.BlobBuilder||window.WebKitBlobBuilder||window.MozBlobBuilder||window.MSBlobBuilder,r=new o;r.append(e),t=r.getBlob("application/javascript")}return(window.URL||window.webkitURL).createObjectURL(t)}function V4(e){let t=new fue.default(e),n=t.scheme().length!==0&&t.fragment().length===0,i=e.replace(/\.js$/,""),o={},r,s;if(Vy(e))s=e;else if(!n){let a=en(`${nc._workerModulePrefix}/${i}.js`);Vy(a)&&(s=a)}if(s){let a=`import "${s}";`;return r=R4(a),o.type="module",new Worker(r,o)}if(!n&&typeof CESIUM_WORKERS<"u"){let a=` importScripts("${R4(CESIUM_WORKERS)}"); CesiumWorkers["${i}"](); - `;return r=R4(a),new Worker(r,o)}if(r=e,n||(r=en(`${nc._workerModulePrefix+i}.js`)),!fn.supportsEsmWebWorkers())throw new ae("This browser is not supported. Please update your browser to continue.");return o.type="module",new Worker(r,o)}async function pke(e,t){let n={modulePath:void 0,wasmBinaryFile:void 0,wasmBinary:void 0};if(!fn.supportsWebAssembly()){if(!l(t.fallbackModulePath))throw new ae(`This browser does not support Web Assembly, and no backup module was provided for ${e._workerPath}`);return n.modulePath=en(t.fallbackModulePath),n}n.wasmBinaryFile=en(t.wasmBinaryFile);let i=await ve.fetchArrayBuffer({url:n.wasmBinaryFile});return n.wasmBinary=i,n}function nc(e,t){this._workerPath=e,this._maximumActiveTasks=t??Number.POSITIVE_INFINITY,this._activeTasks=0,this._nextID=0,this._webAssemblyPromise=void 0}var bke=(e,t,n,i)=>{let o=({data:r})=>{if(r.id===t){if(l(r.error)){let s=r.error;s.name==="RuntimeError"?(s=new ae(r.error.message),s.stack=r.error.stack):s.name==="DeveloperError"?(s=new ge(r.error.message),s.stack=r.error.stack):s.name==="Error"&&(s=new Error(r.error.message),s.stack=r.error.stack),C4.raiseEvent(s),i(s)}else C4.raiseEvent(),n(r.result);e.removeEventListener("message",o)}};return o},gke=[];async function yke(e,t,n){let i=await Promise.resolve(pue());l(n)?i||(n.length=0):n=gke;let o=e._nextID++,r=new Promise((s,a)=>{e._worker.addEventListener("message",bke(e._worker,o,s,a))});return e._worker.postMessage({id:o,baseUrl:en.getCesiumBaseUrl().url,parameters:t,canTransferArrayBuffer:i},n),r}async function xke(e,t,n){++e._activeTasks;try{let i=await yke(e,t,n);return--e._activeTasks,i}catch(i){throw--e._activeTasks,i}}nc.prototype.scheduleTask=function(e,t){if(l(this._worker)||(this._worker=V4(this._workerPath)),!(this._activeTasks>=this._maximumActiveTasks))return xke(this,e,t)};nc.prototype.initWebAssemblyModule=async function(e){if(l(this._webAssemblyPromise))return this._webAssemblyPromise;let t=async()=>{let n=this._worker=V4(this._workerPath),i=await pke(this,e),o=await Promise.resolve(pue()),r,s=i.wasmBinary;l(s)&&o&&(r=[s]);let a=new Promise((c,d)=>{n.onmessage=function({data:u}){l(u)?c(u.result):d(new ae("Could not configure wasm module"))}});return n.postMessage({canTransferArrayBuffer:o,parameters:{webAssemblyConfig:i}},r),a};return this._webAssemblyPromise=t(),this._webAssemblyPromise};nc.prototype.isDestroyed=function(){return!1};nc.prototype.destroy=function(){return l(this._worker)&&this._worker.terminate(),ue(this)};nc.taskCompletedEvent=C4;nc._defaultWorkerModulePrefix="Workers/";nc._workerModulePrefix=nc._defaultWorkerModulePrefix;nc._canTransferArrayBuffer=void 0;var qn=nc;function rb(){}rb._transcodeTaskProcessor=new qn("transcodeKTX2",Number.POSITIVE_INFINITY);rb._readyPromise=void 0;function Tke(){let e=rb._transcodeTaskProcessor.initWebAssemblyModule({wasmBinaryFile:"ThirdParty/basis_transcoder.wasm"}).then(function(t){if(t)return rb._transcodeTaskProcessor;throw new ae("KTX2 transcoder could not be initialized.")});rb._readyPromise=e}rb.transcode=function(e,t){return l(rb._readyPromise)||Tke(),rb._readyPromise.then(function(n){let i=e;e instanceof ArrayBuffer&&(i=new Uint8Array(e));let o={supportedTargetFormats:t,ktx2Buffer:i};return n.scheduleTask(o,[i.buffer])}).then(function(n){let i=n.length,o=Object.keys(n[0]);for(let r=0;ra.x&&h.clone(i,a),Nc.y&&h.clone(i,c),gd.z&&h.clone(i,d)}let p=h.magnitudeSquared(h.subtract(a,o,ic)),b=h.magnitudeSquared(h.subtract(c,r,ic)),f=h.magnitudeSquared(h.subtract(d,s,ic)),y=o,_=a,S=p;b>S&&(S=b,y=r,_=c),f>S&&(y=s,_=d);let Z=I4;Z.x=(y.x+_.x)*.5,Z.y=(y.y+_.y)*.5,Z.z=(y.z+_.z)*.5;let R=h.magnitudeSquared(h.subtract(_,Z,ic)),C=Math.sqrt(R),E=P4;E.x=o.x,E.y=r.y,E.z=s.z;let A=X4;A.x=a.x,A.y=c.y,A.z=d.z;let L=h.midpoint(E,A,N4),F=0;for(m=0;mF&&(F=I);let N=h.magnitudeSquared(h.subtract(i,Z,ic));if(N>R){let g=Math.sqrt(N);C=(C+g)*.5,R=C*C;let V=g-C;Z.x=(C*Z.x+V*i.x)/g,Z.y=(C*Z.y+V*i.y)/g,Z.z=(C*Z.z+V*i.z)/g}}return Cd.x&&h.clone(r,d),Vu.y&&h.clone(r,u),Gm.z&&h.clone(r,m)}let f=h.magnitudeSquared(h.subtract(d,s,ic)),y=h.magnitudeSquared(h.subtract(u,a,ic)),_=h.magnitudeSquared(h.subtract(m,c,ic)),S=s,Z=d,R=f;y>R&&(R=y,S=a,Z=u),_>R&&(S=c,Z=m);let C=I4;C.x=(S.x+Z.x)*.5,C.y=(S.y+Z.y)*.5,C.z=(S.z+Z.z)*.5;let E=h.magnitudeSquared(h.subtract(Z,C,ic)),A=Math.sqrt(E),L=P4;L.x=s.x,L.y=a.y,L.z=c.z;let F=X4;F.x=d.x,F.y=u.y,F.z=m.z;let I=h.midpoint(L,F,N4),N=0;for(b=0;bN&&(N=g);let V=h.magnitudeSquared(h.subtract(r,C,ic));if(V>E){let G=Math.sqrt(V);A=(A+G)*.5,E=A*A;let v=G-A;C.x=(A*C.x+v*r.x)/G,C.y=(A*C.y+v*r.y)/G,C.z=(A*C.z+v*r.z)/G}}return Ac.x&&h.clone(o,c),gd.y&&h.clone(o,d),Vu.z&&h.clone(o,u)}let b=h.magnitudeSquared(h.subtract(c,r,ic)),f=h.magnitudeSquared(h.subtract(d,s,ic)),y=h.magnitudeSquared(h.subtract(u,a,ic)),_=r,S=c,Z=b;f>Z&&(Z=f,_=s,S=d),y>Z&&(_=a,S=u);let R=I4;R.x=(_.x+S.x)*.5,R.y=(_.y+S.y)*.5,R.z=(_.z+S.z)*.5;let C=h.magnitudeSquared(h.subtract(S,R,ic)),E=Math.sqrt(C),A=P4;A.x=r.x,A.y=s.y,A.z=a.z;let L=X4;L.x=c.x,L.y=d.y,L.z=u.z;let F=h.midpoint(A,L,N4),I=0;for(p=0;pI&&(I=N);let g=h.magnitudeSquared(h.subtract(o,R,ic));if(g>C){let V=Math.sqrt(g);E=(E+V)*.5,C=E*E;let G=V-E;R.x=(E*R.x+G*o.x)/V,R.y=(E*R.y+G*o.y)/V,R.z=(E*R.z+G*o.z)/V}}return E=d+a)return t.clone(i),i;if(a>=d+r)return n.clone(i),i;let u=(r+d+a)*.5,m=h.multiplyByScalar(c,(-r+u)/d,vke);return h.add(m,o,m),h.clone(m,i.center),i.radius=u,i}static expand(t,n,i){i=e.clone(t,i);let o=h.magnitude(h.subtract(n,i.center,Fke));return o>i.radius&&(i.radius=o),i}static intersectPlane(t,n){let i=t.center,o=t.radius,r=n.normal,s=h.dot(r,i)+n.distance;return s<-o?qt.OUTSIDE:s>1^-(e&1)}No.zigZagDeltaDecode=function(e,t,n){let i=e.length,o=0,r=0,s=0;for(let a=0;a>16&255)/255,t.green=(e>>8&255)/255,t.blue=(e&255)/255,t};No.decodeRGB565=function(e,t){let n=e.length;l(t)||(t=new Float32Array(n*3));let i=31,o=63,r=1/31,s=1/63;for(let a=0;a>11,u=c>>5&o,m=c&i,p=3*a;t[p]=d*r,t[p+1]=u*s,t[p+2]=m*r}return t};var dn=No;var s7t=x(T(),1);var Gue=new h,Lue=new h,Wue=new h;function Oke(e,t,n,i,o){l(o)||(o=new h);let r,s,a,c,d,u,m,p;if(l(t.z)){if(h.equalsEpsilon(e,t,W.EPSILON14))return h.clone(h.UNIT_X,o);if(h.equalsEpsilon(e,n,W.EPSILON14))return h.clone(h.UNIT_Y,o);if(h.equalsEpsilon(e,i,W.EPSILON14))return h.clone(h.UNIT_Z,o);r=h.subtract(n,t,Gue),s=h.subtract(i,t,Lue),a=h.subtract(e,t,Wue),c=h.dot(r,r),d=h.dot(r,s),u=h.dot(r,a),m=h.dot(s,s),p=h.dot(s,a)}else{if(k.equalsEpsilon(e,t,W.EPSILON14))return h.clone(h.UNIT_X,o);if(k.equalsEpsilon(e,n,W.EPSILON14))return h.clone(h.UNIT_Y,o);if(k.equalsEpsilon(e,i,W.EPSILON14))return h.clone(h.UNIT_Z,o);r=k.subtract(n,t,Gue),s=k.subtract(i,t,Lue),a=k.subtract(e,t,Wue),c=k.dot(r,r),d=k.dot(r,s),u=k.dot(r,a),m=k.dot(s,s),p=k.dot(s,a)}o.y=m*u-d*p,o.z=c*p-d*u;let b=c*m-d*d;if(b!==0)return o.y/=b,o.z/=b,o.x=1-o.y-o.z,o}var c_=Oke;var d7t=x(T(),1);function Ap(){this.high=h.clone(h.ZERO),this.low=h.clone(h.ZERO)}Ap.encode=function(e,t){l(t)||(t={high:0,low:0});let n;return e>=0?(n=Math.floor(e/65536)*65536,t.high=n,t.low=e-n):(n=Math.floor(-e/65536)*65536,t.high=-n,t.low=e+n),t};var sb={high:0,low:0};Ap.fromCartesian=function(e,t){l(t)||(t=new Ap);let n=t.high,i=t.low;return Ap.encode(e.x,sb),n.x=sb.high,i.x=sb.low,Ap.encode(e.y,sb),n.y=sb.high,i.y=sb.low,Ap.encode(e.z,sb),n.z=sb.high,i.z=sb.low,t};var O4=new Ap;Ap.writeElements=function(e,t,n){Ap.fromCartesian(e,O4);let i=O4.high,o=O4.low;t[n]=i.x,t[n+1]=i.y,t[n+2]=i.z,t[n+3]=o.x,t[n+4]=o.y,t[n+5]=o.z};var An=Ap;var X7t=x(T(),1);var h7t=x(T(),1);var B4={};B4.computeDiscriminant=function(e,t,n){return t*t-4*e*n};function vue(e,t,n){let i=e+t;return W.sign(e)!==W.sign(t)&&Math.abs(i/Math.max(Math.abs(e),Math.abs(t)))d&&d/c0?[a/e,n/a]:[n/a,a/e]};var Xl=B4;var _7t=x(T(),1);var b7t=x(T(),1);var H4={};H4.computeDiscriminant=function(e,t,n,i){let o=e*e,r=t*t,s=n*n,a=i*i;return 18*e*t*n*i+r*s-27*o*a-4*(e*s*n+r*t*i)};function z4(e,t,n,i){let o=e,r=t/3,s=n/3,a=i,c=o*s,d=r*a,u=r*r,m=s*s,p=o*s-u,b=o*a-r*s,f=r*a-m,y=4*p*f-b*b,_,S;if(y<0){let z,K,te;u*d>=c*m?(z=o,K=p,te=-2*r*p+o*b):(z=a,K=f,te=-a*b+2*s*f);let $=-(te<0?-1:1)*Math.abs(z)*Math.sqrt(-y);S=-te+$;let ee=S/2,le=ee<0?-Math.pow(-ee,1/3):Math.pow(ee,1/3),_e=S===$?-le:-K/le;return _=K<=0?le+_e:-te/(le*le+_e*_e+K),u*d>=c*m?[(_-r)/o]:[-a/(_+s)]}let Z=p,R=-2*r*p+o*b,C=f,E=-a*b+2*s*f,A=Math.sqrt(y),L=Math.sqrt(3)/2,F=Math.abs(Math.atan2(o*A,-R)/3);_=2*Math.sqrt(-Z);let I=Math.cos(F);S=_*I;let N=_*(-I/2-L*Math.sin(F)),g=S+N>2*r?S-r:N-r,V=o,G=g/V;F=Math.abs(Math.atan2(a*A,-E)/3),_=2*Math.sqrt(-C),I=Math.cos(F),S=_*I,N=_*(-I/2-L*Math.sin(F));let v=-a,X=S+N<2*s?S+s:N+s,Y=v/X,D=V*X,M=-g*X-V*v,O=g*v,w=(s*M-r*O)/(-r*M+s*D);return G<=w?G<=Y?w<=Y?[G,w,Y]:[G,Y,w]:[Y,G,w]:G<=Y?[w,G,Y]:w<=Y?[w,Y,G]:[Y,w,G]}H4.computeRealRoots=function(e,t,n,i){let o,r;if(e===0)return Xl.computeRealRoots(t,n,i);if(t===0){if(n===0){if(i===0)return[0,0,0];r=-i/e;let s=r<0?-Math.pow(-r,1/3):Math.pow(r,1/3);return[s,s,s]}else if(i===0)return o=Xl.computeRealRoots(e,0,n),o.Length===0?[0]:[o[0],0,o[1]];return z4(e,0,n,i)}else{if(n===0)return i===0?(r=-t/e,r<0?[r,0,0]:[0,0,r]):z4(e,t,0,i);if(i===0)return o=Xl.computeRealRoots(e,t,n),o.length===0?[0]:o[1]<=0?[o[0],o[1],0]:o[0]>=0?[0,o[0],o[1]]:[o[0],0,o[1]]}return z4(e,t,n,i)};var l_=H4;var K4={};K4.computeDiscriminant=function(e,t,n,i,o){let r=e*e,s=r*e,a=t*t,c=a*t,d=n*n,u=d*n,m=i*i,p=m*i,b=o*o,f=b*o;return a*d*m-4*c*p-4*e*u*m+18*e*t*n*p-27*r*m*m+256*s*f+o*(18*c*n*i-4*a*u+16*e*d*d-80*e*t*d*i-6*e*a*m+144*r*n*m)+b*(144*e*a*n-27*a*a-128*r*d-192*r*t*i)};function Nh(e,t,n,i){let o=e*e,r=t-3*o/8,s=n-t*e/2+o*e/8,a=i-n*e/4+t*o/16-3*o*o/256,c=l_.computeRealRoots(1,2*r,r*r-4*a,-s*s);if(c.length>0){let d=-e/4,u=c[c.length-1];if(Math.abs(u)=0&&b>=0){let y=Math.sqrt(p),_=Math.sqrt(b);return[d-_,d-y,d+y,d+_]}else{if(p>=0&&b<0)return f=Math.sqrt(p),[d-f,d+f];if(p<0&&b>=0)return f=Math.sqrt(b),[d-f,d+f]}}return[]}else if(u>0){let m=Math.sqrt(u),p=(r+u-s/m)/2,b=(r+u+s/m)/2,f=Xl.computeRealRoots(1,m,p),y=Xl.computeRealRoots(1,-m,b);return f.length!==0?(f[0]+=d,f[1]+=d,y.length!==0?(y[0]+=d,y[1]+=d,f[1]<=y[0]?[f[0],f[1],y[0],y[1]]:y[1]<=f[0]?[y[0],y[1],f[0],f[1]]:f[0]>=y[0]&&f[1]<=y[1]?[y[0],f[0],f[1],y[1]]:y[0]>=f[0]&&y[1]<=f[1]?[f[0],y[0],y[1],f[1]]:f[0]>y[0]&&f[0]0){let m=u[0],p=t-m,b=p*p,f=e/2,y=p/2,_=b-4*i,S=b+4*Math.abs(i),Z=s-4*m,R=s+4*Math.abs(m),C,E;if(m<0||_*R=g[0]&&N[1]<=g[1]?[g[0],N[0],N[1],g[1]]:g[0]>=N[0]&&g[1]<=N[1]?[N[0],g[0],g[1],N[1]]:N[0]>g[0]&&N[0]u)||(p=h.cross(m,a,Iue),f=h.dot(s,p),f<0||b+f>u))return;y=h.dot(c,p)/u}else{if(Math.abs(u)1||(p=h.cross(m,a,Iue),f=h.dot(s,p)*_,f<0||b+f>1))return;y=h.dot(c,p)*_}return y};rr.rayTriangle=function(e,t,n,i,o,r){let s=rr.rayTriangleParametric(e,t,n,i,o);if(!(!l(s)||s<0))return l(r)||(r=new h),h.multiplyByScalar(e.direction,s,r),h.add(e.origin,r,r)};var Hke=new gn;rr.lineSegmentTriangle=function(e,t,n,i,o,r,s){let a=Hke;h.clone(e,a.origin),h.subtract(t,e,a.direction),h.normalize(a.direction,a.direction);let c=rr.rayTriangleParametric(a,n,i,o,r);if(!(!l(c)||c<0||c>h.distance(e,t)))return l(s)||(s=new h),h.multiplyByScalar(a.direction,c,s),h.add(a.origin,s,s)};function Kke(e,t,n,i){let o=t*t-4*e*n;if(o<0)return;if(o>0){let s=1/(2*e),a=Math.sqrt(o),c=(-t+a)*s,d=(-t-a)*s;return cs))return i.start=Math.max(i.start,0),i.stop=Math.min(i.stop,s),i};var Qke=new h,qke=new h;rr.rayEllipsoid=function(e,t){let n=t.oneOverRadii,i=h.multiplyComponents(n,e.origin,Qke),o=h.multiplyComponents(n,e.direction,qke),r=h.magnitudeSquared(i),s=h.dot(i,o),a,c,d,u,m;if(r>1){if(s>=0)return;let p=s*s;if(a=r-1,c=h.magnitudeSquared(o),d=c*a,pd){u=s*s-d,m=-s+Math.sqrt(u);let f=m/c,y=a/m;return fo.start?i.start:o.start,n.stop=i.stopo.stop||o.start>i.stop)&&!(n.start>r.stop||r.start>n.stop))return r.start>n.start&&(n.start=r.start),r.stop0?b.push(new h(i,o*I,o*-V)):V!==0?(b.push(new h(i,o*I,o*-V)),b.push(new h(i,o*I,o*V)),++F):b.push(new h(i,o*I,o*V))}return b};var Q4=new h,Pue=new h,Xue=new h,BD=new h,nUe=new h,iUe=new q,oUe=new q,rUe=new q,sUe=new q,aUe=new q,Nue=new q,Yue=new q,Mue=new h,cUe=new h,lUe=new pe;rr.grazingAltitudeLocation=function(e,t){let n=e.origin,i=e.direction;if(!h.equals(n,h.ZERO)){let A=t.geodeticSurfaceNormal(n,Q4);if(h.dot(i,A)>=0)return n}let o=l(this.rayEllipsoid(e,t)),r=t.transformPositionToScaledSpace(i,Q4),s=h.normalize(r,r),a=h.mostOrthogonalAxis(r,BD),c=h.normalize(h.cross(a,s,Pue),Pue),d=h.normalize(h.cross(s,c,Xue),Xue),u=iUe;u[0]=s.x,u[1]=s.y,u[2]=s.z,u[3]=c.x,u[4]=c.y,u[5]=c.z,u[6]=d.x,u[7]=d.y,u[8]=d.z;let m=q.transpose(u,oUe),p=q.fromScale(t.radii,rUe),b=q.fromScale(t.oneOverRadii,sUe),f=aUe;f[0]=0,f[1]=-i.z,f[2]=i.y,f[3]=i.z,f[4]=0,f[5]=-i.x,f[6]=-i.y,f[7]=i.x,f[8]=0;let y=q.multiply(q.multiply(m,b,Nue),f,Nue),_=q.multiply(q.multiply(y,p,Yue),u,Yue),S=q.multiplyByVector(y,n,nUe),Z=rr.quadraticVectorExpression(_,h.negate(S,Q4),0,0,1),R,C,E=Z.length;if(E>0){let A=h.clone(h.ZERO,cUe),L=Number.NEGATIVE_INFINITY;for(let I=0;IL&&(L=g,A=h.clone(R,A))}let F=t.cartesianToCartographic(A,lUe);return L=W.clamp(L,0,1),C=h.magnitude(h.subtract(A,n,BD))*Math.sqrt(1-L*L),C=o?-C:C,F.height=C,t.cartographicToCartesian(F,new h)}};var dUe=new h;rr.lineSegmentPlane=function(e,t,n,i){l(i)||(i=new h);let o=h.subtract(t,e,dUe),r=n.normal,s=h.dot(r,o);if(Math.abs(s)1))return h.multiplyByScalar(o,c,i),h.add(e,i,i),i};rr.trianglePlaneIntersection=function(e,t,n,i){let o=i.normal,r=i.distance,s=h.dot(o,e)+r<0,a=h.dot(o,t)+r<0,c=h.dot(o,n)+r<0,d=0;d+=s?1:0,d+=a?1:0,d+=c?1:0;let u,m;if((d===1||d===2)&&(u=new h,m=new h),d===1){if(s)return rr.lineSegmentPlane(e,t,i,u),rr.lineSegmentPlane(e,n,i,m),{positions:[e,t,n,u,m],indices:[0,3,4,1,2,4,1,4,3]};if(a)return rr.lineSegmentPlane(t,n,i,u),rr.lineSegmentPlane(t,e,i,m),{positions:[e,t,n,u,m],indices:[1,3,4,2,0,4,2,4,3]};if(c)return rr.lineSegmentPlane(n,e,i,u),rr.lineSegmentPlane(n,t,i,m),{positions:[e,t,n,u,m],indices:[2,3,4,0,1,4,0,4,3]}}else if(d===2)if(s)if(a){if(!c)return rr.lineSegmentPlane(e,n,i,u),rr.lineSegmentPlane(t,n,i,m),{positions:[e,t,n,u,m],indices:[0,1,4,0,4,3,2,3,4]}}else return rr.lineSegmentPlane(n,t,i,u),rr.lineSegmentPlane(e,t,i,m),{positions:[e,t,n,u,m],indices:[2,0,4,2,4,3,1,3,4]};else return rr.lineSegmentPlane(t,e,i,u),rr.lineSegmentPlane(n,e,i,m),{positions:[e,t,n,u,m],indices:[1,2,4,1,4,3,0,3,4]}};var xi=rr;var U7t=x(T(),1);function Fa(e,t){this.normal=h.clone(e),this.distance=t}Fa.fromPointNormal=function(e,t,n){let i=-h.dot(t,e);return l(n)?(h.clone(t,n.normal),n.distance=i,n):new Fa(t,i)};var uUe=new h;Fa.fromCartesian4=function(e,t){let n=h.fromCartesian4(e,uUe),i=e.w;return l(t)?(h.clone(n,t.normal),t.distance=i,t):new Fa(n,i)};Fa.getPointDistance=function(e,t){return h.dot(e.normal,t)+e.distance};var mUe=new h;Fa.projectPointOntoPlane=function(e,t,n){l(n)||(n=new h);let i=Fa.getPointDistance(e,t),o=h.multiplyByScalar(e.normal,i,mUe);return h.subtract(t,o,n)};var hUe=new P,fUe=new ce,pUe=new h;Fa.transform=function(e,t,n){let i=e.normal,o=e.distance,r=P.inverseTranspose(t,hUe),s=ce.fromElements(i.x,i.y,i.z,o,fUe);s=P.multiplyByVector(r,s,s);let a=h.fromCartesian4(s,pUe);return s=ce.divideByScalar(s,h.magnitude(a),s),Fa.fromCartesian4(s,n)};Fa.clone=function(e,t){return l(t)?(h.clone(e.normal,t.normal),t.distance=e.distance,t):new Fa(e.normal,e.distance)};Fa.equals=function(e,t){return e.distance===t.distance&&h.equals(e.normal,t.normal)};Fa.ORIGIN_XY_PLANE=Object.freeze(new Fa(h.UNIT_Z,0));Fa.ORIGIN_YZ_PLANE=Object.freeze(new Fa(h.UNIT_X,0));Fa.ORIGIN_ZX_PLANE=Object.freeze(new Fa(h.UNIT_Y,0));var cn=Fa;var z7t=x(T(),1);var q4={};q4.calculateACMR=function(e){e=e??B.EMPTY_OBJECT;let t=e.indices,n=e.maximumIndex,i=e.cacheSize??24,o=t.length;if(!l(n)){n=0;let a=0,c=t[a];for(;an&&(n=c),++a,c=t[a]}let r=[];for(let a=0;ai&&(r[t[a]]=s,++s);return(s-i+1)/(o/3)};q4.tipsify=function(e){e=e??B.EMPTY_OBJECT;let t=e.indices,n=e.maximumIndex,i=e.cacheSize??24,o;function r(g,V,G,v){for(;V.length>=1;){let X=V[V.length-1];if(V.splice(V.length-1,1),g[X].numLiveTriangles>0)return X}for(;o0)return++o,o-1;++o}return-1}function s(g,V,G,v,X,Y,D){let M=-1,O,w=-1,z=0;for(;zw||w===-1)&&(w=O,M=K)),++z}return M===-1?r(v,Y,g,D):M}let a=t.length,c=0,d=0,u=t[d],m=a;if(l(n))c=n+1;else{for(;dc&&(c=u),++d,u=t[d];if(c===-1)return 0;++c}let p=[],b;for(b=0;bi&&(R.timeStamp=_,++_),++d}y=s(t,i,S,p,_,Z,c)}return A};var gG=q4;var Nl={};function qD(e,t,n,i,o){e[t++]=n,e[t++]=i,e[t++]=i,e[t++]=o,e[t++]=o,e[t]=n}function bUe(e){let t=e.length,n=t/3*6,i=Oe.createTypedArray(t,n),o=0;for(let r=0;r=3){let n=(t-2)*6,i=Oe.createTypedArray(t,n);qD(i,0,e[0],e[1],e[2]);let o=6;for(let r=3;r0){let t=e.length-1,n=(t-1)*6,i=Oe.createTypedArray(t,n),o=e[0],r=0;for(let s=1;so&&(o=n[r]);e.indices=gG.tipsify({indices:n,maximumIndex:o,cacheSize:t})}return e};function Uue(e){let t={};for(let n in e)if(e.hasOwnProperty(n)&&l(e[n])&&l(e[n].values)){let i=e[n];t[n]=new Xe({componentDatatype:i.componentDatatype,componentsPerAttribute:i.componentsPerAttribute,normalize:i.normalize,values:[]})}return t}function xUe(e,t,n){for(let i in t)if(t.hasOwnProperty(i)&&l(t[i])&&l(t[i].values)){let o=t[i];for(let r=0;r=W.SIXTY_FOUR_KILOBYTES){let i=[],o=[],r=0,s=Uue(e.attributes),a=e.indices,c=a.length,d;e.primitiveType===Ie.TRIANGLES?d=3:e.primitiveType===Ie.LINES?d=2:e.primitiveType===Ie.POINTS&&(d=1);for(let u=0;u=W.SIXTY_FOUR_KILOBYTES&&(t.push(new At({attributes:s,indices:o,primitiveType:e.primitiveType,boundingSphere:e.boundingSphere,boundingSphereCV:e.boundingSphereCV})),i=[],o=[],r=0,s=Uue(e.attributes))}o.length!==0&&t.push(new At({attributes:s,indices:o,primitiveType:e.primitiveType,boundingSphere:e.boundingSphere,boundingSphereCV:e.boundingSphereCV}))}else t.push(e);return t};var Due=new h,TUe=new pe;Nl.projectTo2D=function(e,t,n,i,o){let r=e.attributes[t];o=l(o)?o:new ki;let s=o.ellipsoid,a=r.values,c=new Float64Array(a.length),d=0;for(let u=0;u_&&(_=Z)}return new At({attributes:u,indices:f,primitiveType:d,boundingSphere:l(y)?new me(y,_):void 0})}Nl.combineInstances=function(e){let t=[],n=[],i=e.length;for(let r=0;r0&&o.push(nQ(t,"geometry")),n.length>0&&(o.push(nQ(n,"westHemisphereGeometry")),o.push(nQ(n,"eastHemisphereGeometry"))),o};var Zm=new h,yG=new h,d1=new h,u1=new h;Nl.computeNormal=function(e){let t=e.indices,n=e.attributes,i=n.position.values,o=n.position.values.length/3,r=t.length,s=new Array(o),a=new Array(r/3),c=new Array(r),d;for(d=0;d0){for(u=0;u3&&(n[3]=0,n[4]=2,n[5]=3);let i=6;for(let o=3;oo?i>r?s=W.sign(e.y):s=W.sign(n.y):o>r?s=W.sign(t.y):s=W.sign(n.y);let a=s<0;Wy(e,a),Wy(t,a),Wy(n,a)}var Hue=new h;function Rm(e,t,n,i){h.add(e,h.multiplyByScalar(h.subtract(t,e,Hue),e.y/(e.y-t.y),Hue),n),h.clone(n,i),Wy(n,!0),Wy(i,!1)}var u_=new h,m_=new h,h_=new h,f_=new h,iQ={positions:new Array(7),indices:new Array(9)};function FUe(e,t,n){if(e.x>=0||t.x>=0||n.x>=0)return;vUe(e,t,n);let i=e.y<0,o=t.y<0,r=n.y<0,s=0;s+=i?1:0,s+=o?1:0,s+=r?1:0;let a=iQ.indices;s===1?(a[1]=3,a[2]=4,a[5]=6,a[7]=6,a[8]=5,i?(Rm(e,t,u_,h_),Rm(e,n,m_,f_),a[0]=0,a[3]=1,a[4]=2,a[6]=1):o?(Rm(t,n,u_,h_),Rm(t,e,m_,f_),a[0]=1,a[3]=2,a[4]=0,a[6]=2):r&&(Rm(n,e,u_,h_),Rm(n,t,m_,f_),a[0]=2,a[3]=0,a[4]=1,a[6]=0)):s===2&&(a[2]=4,a[4]=4,a[5]=3,a[7]=5,a[8]=6,i?o?r||(Rm(n,e,u_,h_),Rm(n,t,m_,f_),a[0]=0,a[1]=1,a[3]=0,a[6]=2):(Rm(t,n,u_,h_),Rm(t,e,m_,f_),a[0]=2,a[1]=0,a[3]=2,a[6]=1):(Rm(e,t,u_,h_),Rm(e,n,m_,f_),a[0]=1,a[1]=2,a[3]=1,a[6]=0));let c=iQ.positions;return c[0]=e,c[1]=t,c[2]=n,c.length=3,(s===1||s===2)&&(c[3]=u_,c[4]=m_,c[5]=h_,c[6]=f_,c.length=7),iQ}function Kue(e,t){let n=e.attributes;if(n.position.values.length===0)return;for(let o in n)if(n.hasOwnProperty(o)&&l(n[o])&&l(n[o].values)){let r=n[o];r.values=J.createTypedArray(r.componentDatatype,r.values)}let i=At.computeNumberOfVertices(e);return e.indices=Oe.createTypedArray(i,e.indices),t&&(e.boundingSphere=me.fromVertices(n.position.values)),e}function h1(e){let t=e.attributes,n={};for(let i in t)if(t.hasOwnProperty(i)&&l(t[i])&&l(t[i].values)){let o=t[i];n[i]=new Xe({componentDatatype:o.componentDatatype,componentsPerAttribute:o.componentsPerAttribute,normalize:o.normalize,values:[]})}return new At({attributes:n,indices:[],primitiveType:e.primitiveType})}function aQ(e,t,n){let i=l(e.geometry.boundingSphere);t=Kue(t,i),n=Kue(n,i),l(n)&&!l(t)?e.geometry=n:!l(n)&&l(t)?e.geometry=t:(e.westHemisphereGeometry=t,e.eastHemisphereGeometry=n,e.geometry=void 0)}function cQ(e,t){let n=new e,i=new e,o=new e;return function(r,s,a,c,d,u,m,p){let b=e.fromArray(d,r*t,n),f=e.fromArray(d,s*t,i),y=e.fromArray(d,a*t,o);e.multiplyByScalar(b,c.x,b),e.multiplyByScalar(f,c.y,f),e.multiplyByScalar(y,c.z,y);let _=e.add(b,f,b);e.add(_,y,_),p&&e.normalize(_,_),e.pack(_,u,m*t)}}var IUe=cQ(ce,4),QD=cQ(h,3),eme=cQ(k,2),PUe=function(e,t,n,i,o,r,s){let a=o[e]*i.x,c=o[t]*i.y,d=o[n]*i.z;r[s]=a+c+d>W.EPSILON6?1:0},TG=new h,oQ=new h,rQ=new h,XUe=new h;function JD(e,t,n,i,o,r,s,a,c,d,u,m,p,b,f,y){if(!l(r)&&!l(s)&&!l(a)&&!l(c)&&!l(d)&&b===0)return;let _=h.fromArray(o,e*3,TG),S=h.fromArray(o,t*3,oQ),Z=h.fromArray(o,n*3,rQ),R=c_(i,_,S,Z,XUe);if(l(R)){if(l(r)&&QD(e,t,n,R,r,m.normal.values,y,!0),l(d)){let C=h.fromArray(d,e*3,TG),E=h.fromArray(d,t*3,oQ),A=h.fromArray(d,n*3,rQ);h.multiplyByScalar(C,R.x,C),h.multiplyByScalar(E,R.y,E),h.multiplyByScalar(A,R.z,A);let L;!h.equals(C,h.ZERO)||!h.equals(E,h.ZERO)||!h.equals(A,h.ZERO)?(L=h.add(C,E,C),h.add(L,A,L),h.normalize(L,L)):(L=TG,L.x=0,L.y=0,L.z=0),h.pack(L,m.extrudeDirection.values,y*3)}if(l(u)&&PUe(e,t,n,R,u,m.applyOffset.values,y),l(s)&&QD(e,t,n,R,s,m.tangent.values,y,!0),l(a)&&QD(e,t,n,R,a,m.bitangent.values,y,!0),l(c)&&eme(e,t,n,R,c,m.st.values,y),b>0)for(let C=0;C3){let v=G.positions,X=G.indices,Y=X.length;for(let D=0;D0)continue;let c=h.unpack(i,s,ime);(a.y<0&&c.y>0||a.y>0&&c.y<0)&&(s-3>0?(i[s]=n[s-3],i[s+1]=n[s-2],i[s+2]=n[s-1]):h.pack(a,i,s));let d=h.unpack(o,s,sQ);(a.y<0&&d.y>0||a.y>0&&d.y<0)&&(s+30||me.intersectPlane(n,cn.ORIGIN_ZX_PLANE)!==qt.INTERSECTING))return e;if(t.geometryType!==Sm.NONE)switch(t.geometryType){case Sm.POLYLINES:zUe(e);break;case Sm.TRIANGLES:Jue(e);break;case Sm.LINES:jue(e);break}else WUe(t),t.primitiveType===Ie.TRIANGLES?Jue(e):t.primitiveType===Ie.LINES&&jue(e);return e};var Bn=Nl;var Sqt=x(T(),1);function _G(e,t,n,i,o,r,s,a,c,d,u){this._context=e,this._texture=t,this._textureTarget=n,this._targetFace=i,this._pixelDatatype=s,this._internalFormat=o,this._pixelFormat=r,this._size=a,this._preMultiplyAlpha=c,this._flipY=d,this._initialized=u}Object.defineProperties(_G.prototype,{pixelFormat:{get:function(){return this._pixelFormat}},pixelDatatype:{get:function(){return this._pixelDatatype}},_target:{get:function(){return this._targetFace}}});_G.prototype.copyFrom=function(e){let{xOffset:t=0,yOffset:n=0,source:i,skipColorSpaceConversion:o=!1}=e,{width:r,height:s}=i,a=this._context._gl,c=this._textureTarget,d=this._targetFace;a.activeTexture(a.TEXTURE0),a.bindTexture(c,this._texture);let u=i.arrayBufferView,m=this._size,p=this._pixelFormat,b=this._internalFormat,f=this._pixelDatatype,y=this._preMultiplyAlpha,_=this._flipY,S=4;l(u)&&(S=Qe.alignmentInBytes(p,f,r)),a.pixelStorei(a.UNPACK_ALIGNMENT,S),o?a.pixelStorei(a.UNPACK_COLORSPACE_CONVERSION_WEBGL,a.NONE):a.pixelStorei(a.UNPACK_COLORSPACE_CONVERSION_WEBGL,a.BROWSER_DEFAULT_WEBGL);let Z=!1;if(!this._initialized){let R;t===0&&n===0&&r===m&&s===m?(l(u)?(a.pixelStorei(a.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!1),a.pixelStorei(a.UNPACK_FLIP_Y_WEBGL,!1),_&&(u=Qe.flipY(u,p,f,m,m)),R=u):(a.pixelStorei(a.UNPACK_PREMULTIPLY_ALPHA_WEBGL,y),a.pixelStorei(a.UNPACK_FLIP_Y_WEBGL,_),R=i),Z=!0):(a.pixelStorei(a.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!1),a.pixelStorei(a.UNPACK_FLIP_Y_WEBGL,!1),R=Qe.createTypedArray(p,f,m,m)),a.texImage2D(d,0,b,m,m,0,p,Ue.toWebGLConstant(f,this._context),R),this._initialized=!0}Z||(l(u)?(a.pixelStorei(a.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!1),a.pixelStorei(a.UNPACK_FLIP_Y_WEBGL,!1),_&&(u=Qe.flipY(u,p,f,r,s)),a.texSubImage2D(d,0,t,n,r,s,p,Ue.toWebGLConstant(f,this._context),u)):(a.pixelStorei(a.UNPACK_PREMULTIPLY_ALPHA_WEBGL,y),a.pixelStorei(a.UNPACK_FLIP_Y_WEBGL,_),a.texSubImage2D(d,0,t,n,p,Ue.toWebGLConstant(f,this._context),i))),a.bindTexture(c,null)};_G.prototype.copyFromFramebuffer=function(e,t,n,i,o,r){e=e??0,t=t??0,n=n??0,i=i??0,o=o??this._size,r=r??this._size;let s=this._context._gl,a=this._textureTarget;s.activeTexture(s.TEXTURE0),s.bindTexture(a,this._texture),s.copyTexSubImage2D(this._targetFace,0,e,t,n,i,o,r),s.bindTexture(a,null),this._initialized=!0};_G.prototype.copyMipmapFromFramebuffer=function(e,t,n,i,o){e=e??0,t=t??0,n=n??this._size,i=i??this._size,o=o??0;let r=this._context._gl,s=this._textureTarget;r.activeTexture(r.TEXTURE0),r.bindTexture(s,this._texture),r.copyTexImage2D(this._targetFace,o,this._internalFormat,e,t,n,i,0),r.bindTexture(s,null),this._initialized=!0};var SG=_G;var Cqt=x(T(),1);var ZG={DONT_CARE:ie.DONT_CARE,FASTEST:ie.FASTEST,NICEST:ie.NICEST,validate:function(e){return e===ZG.DONT_CARE||e===ZG.FASTEST||e===ZG.NICEST}};Object.freeze(ZG);var Cm=ZG;var kqt=x(T(),1);var Aqt=x(T(),1);var RG={NEAREST:ie.NEAREST,LINEAR:ie.LINEAR};RG.validate=function(e){return e===RG.NEAREST||e===RG.LINEAR};Object.freeze(RG);var $n=RG;var Wqt=x(T(),1);var ab={NEAREST:ie.NEAREST,LINEAR:ie.LINEAR,NEAREST_MIPMAP_NEAREST:ie.NEAREST_MIPMAP_NEAREST,LINEAR_MIPMAP_NEAREST:ie.LINEAR_MIPMAP_NEAREST,NEAREST_MIPMAP_LINEAR:ie.NEAREST_MIPMAP_LINEAR,LINEAR_MIPMAP_LINEAR:ie.LINEAR_MIPMAP_LINEAR};ab.validate=function(e){return e===ab.NEAREST||e===ab.LINEAR||e===ab.NEAREST_MIPMAP_NEAREST||e===ab.LINEAR_MIPMAP_NEAREST||e===ab.NEAREST_MIPMAP_LINEAR||e===ab.LINEAR_MIPMAP_LINEAR};Object.freeze(ab);var Ht=ab;var Iqt=x(T(),1);var CG={CLAMP_TO_EDGE:ie.CLAMP_TO_EDGE,REPEAT:ie.REPEAT,MIRRORED_REPEAT:ie.MIRRORED_REPEAT,validate:function(e){return e===CG.CLAMP_TO_EDGE||e===CG.REPEAT||e===CG.MIRRORED_REPEAT}};Object.freeze(CG);var pn=CG;function VG(e){e=e??B.EMPTY_OBJECT;let{wrapR:t=pn.CLAMP_TO_EDGE,wrapS:n=pn.CLAMP_TO_EDGE,wrapT:i=pn.CLAMP_TO_EDGE,minificationFilter:o=Ht.LINEAR,magnificationFilter:r=$n.LINEAR,maximumAnisotropy:s=1}=e;this._wrapR=t,this._wrapS=n,this._wrapT=i,this._minificationFilter=o,this._magnificationFilter=r,this._maximumAnisotropy=s}Object.defineProperties(VG.prototype,{wrapR:{get:function(){return this._wrapR}},wrapS:{get:function(){return this._wrapS}},wrapT:{get:function(){return this._wrapT}},minificationFilter:{get:function(){return this._minificationFilter}},magnificationFilter:{get:function(){return this._magnificationFilter}},maximumAnisotropy:{get:function(){return this._maximumAnisotropy}}});VG.equals=function(e,t){return e===t||l(e)&&l(t)&&e._wrapR===t._wrapR&&e._wrapS===t._wrapS&&e._wrapT===t._wrapT&&e._minificationFilter===t._minificationFilter&&e._magnificationFilter===t._magnificationFilter&&e._maximumAnisotropy===t._maximumAnisotropy};VG.NEAREST=Object.freeze(new VG({wrapR:pn.CLAMP_TO_EDGE,wrapS:pn.CLAMP_TO_EDGE,wrapT:pn.CLAMP_TO_EDGE,minificationFilter:Ht.NEAREST,magnificationFilter:$n.NEAREST}));var Ot=VG;var o$t=x(T(),1);var Oqt=x(T(),1);function HUe(e,t){if(!e)throw new ge(t)}var lQ=HUe;function KUe(e,t,n,i){let o=l(t.vertexBuffer),r=l(t.value),s=t.value?t.value.length:t.componentsPerAttribute,a={index:t.index??n,enabled:t.enabled??!0,vertexBuffer:t.vertexBuffer,value:r?t.value.slice(0):void 0,componentsPerAttribute:s,componentDatatype:t.componentDatatype??J.FLOAT,normalize:t.normalize??!1,offsetInBytes:t.offsetInBytes??0,strideInBytes:t.strideInBytes??0,instanceDivisor:t.instanceDivisor??0};if(o)a.vertexAttrib=function(c){let d=this.index;c.bindBuffer(c.ARRAY_BUFFER,this.vertexBuffer._getBuffer()),c.vertexAttribPointer(d,this.componentsPerAttribute,this.componentDatatype,this.normalize,this.strideInBytes,this.offsetInBytes),c.enableVertexAttribArray(d),this.instanceDivisor>0&&(i.glVertexAttribDivisor(d,this.instanceDivisor),i._vertexAttribDivisors[d]=this.instanceDivisor,i._previousDrawInstanced=!0)},a.disableVertexAttribArray=function(c){c.disableVertexAttribArray(this.index),this.instanceDivisor>0&&i.glVertexAttribDivisor(n,0)};else{switch(a.componentsPerAttribute){case 1:a.vertexAttrib=function(c){c.vertexAttrib1fv(this.index,this.value)};break;case 2:a.vertexAttrib=function(c){c.vertexAttrib2fv(this.index,this.value)};break;case 3:a.vertexAttrib=function(c){c.vertexAttrib3fv(this.index,this.value)};break;case 4:a.vertexAttrib=function(c){c.vertexAttrib4fv(this.index,this.value)};break}a.disableVertexAttribArray=function(c){}}e.push(a)}function rme(e,t,n){for(let i=0;i0&&(c=!0),l(s[r].value)&&(d=!0);let m;t.vertexArrayObject&&(m=t.glCreateVertexArray(),t.glBindVertexArray(m),rme(n,s,o),t.glBindVertexArray(null)),this._numberOfVertices=a,this._hasInstancedAttributes=c,this._hasConstantAttributes=d,this._context=t,this._gl=n,this._vao=m,this._attributes=s,this._indexBuffer=o}function ome(e){return e.values.length/e.componentsPerAttribute}function JUe(e){return J.getSizeInBytes(e.componentDatatype)*e.componentsPerAttribute}function jUe(e){let t,n,i,o=[];for(n in e)e.hasOwnProperty(n)&&l(e[n])&&l(e[n].values)&&(o.push(n),e[n].componentDatatype===J.DOUBLE&&(e[n].componentDatatype=J.FLOAT,e[n].values=J.createTypedArray(J.FLOAT,e[n].values)));let r,s=o.length;if(s>0)for(r=ome(e[o[0]]),t=1;t0){let d=J.getSizeInBytes(e[o[0]].componentDatatype),u=a%d;u!==0&&(a+=d-u);let m=r*a,p=new ArrayBuffer(m),b={};for(t=0;t=W.SIXTY_FOUR_KILOBYTES&&t.elementIndexUint?p=it.createIndexBuffer({context:t,typedArray:new Uint32Array(b),usage:i,indexDatatype:Oe.UNSIGNED_INT}):p=it.createIndexBuffer({context:t,typedArray:new Uint16Array(b),usage:i,indexDatatype:Oe.UNSIGNED_SHORT})),new wh({context:t,attributes:u,indexBuffer:p})};Object.defineProperties(wh.prototype,{numberOfAttributes:{get:function(){return this._attributes.length}},numberOfVertices:{get:function(){return this._numberOfVertices}},indexBuffer:{get:function(){return this._indexBuffer}}});wh.prototype.getAttribute=function(e){return this._attributes[e]};function QUe(e){let t=e._context,n=e._hasInstancedAttributes;if(!n&&!t._previousDrawInstanced)return;t._previousDrawInstanced=n;let i=t._vertexAttribDivisors,o=e._attributes,r=wt.maximumVertexAttributes,s;if(n){let a=o.length;for(s=0;s0&&(t.glVertexAttribDivisor(s,0),i[s]=0)}function qUe(e,t){let n=e._attributes,i=n.length;for(let o=0;o{let o=({data:r})=>{if(r.id===t){if(l(r.error)){let s=r.error;s.name==="RuntimeError"?(s=new ae(r.error.message),s.stack=r.error.stack):s.name==="DeveloperError"?(s=new ge(r.error.message),s.stack=r.error.stack):s.name==="Error"&&(s=new Error(r.error.message),s.stack=r.error.stack),C4.raiseEvent(s),i(s)}else C4.raiseEvent(),n(r.result);e.removeEventListener("message",o)}};return o},yke=[];async function xke(e,t,n){let i=await Promise.resolve(pue());l(n)?i||(n.length=0):n=yke;let o=e._nextID++,r=new Promise((s,a)=>{e._worker.addEventListener("message",gke(e._worker,o,s,a))});return e._worker.postMessage({id:o,baseUrl:en.getCesiumBaseUrl().url,parameters:t,canTransferArrayBuffer:i},n),r}async function Tke(e,t,n){++e._activeTasks;try{let i=await xke(e,t,n);return--e._activeTasks,i}catch(i){throw--e._activeTasks,i}}nc.prototype.scheduleTask=function(e,t){if(l(this._worker)||(this._worker=V4(this._workerPath)),!(this._activeTasks>=this._maximumActiveTasks))return Tke(this,e,t)};nc.prototype.initWebAssemblyModule=async function(e){if(l(this._webAssemblyPromise))return this._webAssemblyPromise;let t=async()=>{let n=this._worker=V4(this._workerPath),i=await bke(this,e),o=await Promise.resolve(pue()),r,s=i.wasmBinary;l(s)&&o&&(r=[s]);let a=new Promise((c,d)=>{n.onmessage=function({data:u}){l(u)?c(u.result):d(new ae("Could not configure wasm module"))}});return n.postMessage({canTransferArrayBuffer:o,parameters:{webAssemblyConfig:i}},r),a};return this._webAssemblyPromise=t(),this._webAssemblyPromise};nc.prototype.isDestroyed=function(){return!1};nc.prototype.destroy=function(){return l(this._worker)&&this._worker.terminate(),ue(this)};nc.taskCompletedEvent=C4;nc._defaultWorkerModulePrefix="Workers/";nc._workerModulePrefix=nc._defaultWorkerModulePrefix;nc._canTransferArrayBuffer=void 0;var qn=nc;function rb(){}rb._transcodeTaskProcessor=new qn("transcodeKTX2",Number.POSITIVE_INFINITY);rb._readyPromise=void 0;function _ke(){let e=rb._transcodeTaskProcessor.initWebAssemblyModule({wasmBinaryFile:"ThirdParty/basis_transcoder.wasm"}).then(function(t){if(t)return rb._transcodeTaskProcessor;throw new ae("KTX2 transcoder could not be initialized.")});rb._readyPromise=e}rb.transcode=function(e,t){return l(rb._readyPromise)||_ke(),rb._readyPromise.then(function(n){let i=e;e instanceof ArrayBuffer&&(i=new Uint8Array(e));let o={supportedTargetFormats:t,ktx2Buffer:i};return n.scheduleTask(o,[i.buffer])}).then(function(n){let i=n.length,o=Object.keys(n[0]);for(let r=0;ra.x&&h.clone(i,a),Nc.y&&h.clone(i,c),gd.z&&h.clone(i,d)}let p=h.magnitudeSquared(h.subtract(a,o,ic)),b=h.magnitudeSquared(h.subtract(c,r,ic)),f=h.magnitudeSquared(h.subtract(d,s,ic)),y=o,_=a,S=p;b>S&&(S=b,y=r,_=c),f>S&&(y=s,_=d);let Z=I4;Z.x=(y.x+_.x)*.5,Z.y=(y.y+_.y)*.5,Z.z=(y.z+_.z)*.5;let R=h.magnitudeSquared(h.subtract(_,Z,ic)),C=Math.sqrt(R),E=P4;E.x=o.x,E.y=r.y,E.z=s.z;let A=X4;A.x=a.x,A.y=c.y,A.z=d.z;let L=h.midpoint(E,A,N4),F=0;for(m=0;mF&&(F=I);let N=h.magnitudeSquared(h.subtract(i,Z,ic));if(N>R){let g=Math.sqrt(N);C=(C+g)*.5,R=C*C;let V=g-C;Z.x=(C*Z.x+V*i.x)/g,Z.y=(C*Z.y+V*i.y)/g,Z.z=(C*Z.z+V*i.z)/g}}return Cd.x&&h.clone(r,d),Vu.y&&h.clone(r,u),Gm.z&&h.clone(r,m)}let f=h.magnitudeSquared(h.subtract(d,s,ic)),y=h.magnitudeSquared(h.subtract(u,a,ic)),_=h.magnitudeSquared(h.subtract(m,c,ic)),S=s,Z=d,R=f;y>R&&(R=y,S=a,Z=u),_>R&&(S=c,Z=m);let C=I4;C.x=(S.x+Z.x)*.5,C.y=(S.y+Z.y)*.5,C.z=(S.z+Z.z)*.5;let E=h.magnitudeSquared(h.subtract(Z,C,ic)),A=Math.sqrt(E),L=P4;L.x=s.x,L.y=a.y,L.z=c.z;let F=X4;F.x=d.x,F.y=u.y,F.z=m.z;let I=h.midpoint(L,F,N4),N=0;for(b=0;bN&&(N=g);let V=h.magnitudeSquared(h.subtract(r,C,ic));if(V>E){let G=Math.sqrt(V);A=(A+G)*.5,E=A*A;let v=G-A;C.x=(A*C.x+v*r.x)/G,C.y=(A*C.y+v*r.y)/G,C.z=(A*C.z+v*r.z)/G}}return Ac.x&&h.clone(o,c),gd.y&&h.clone(o,d),Vu.z&&h.clone(o,u)}let b=h.magnitudeSquared(h.subtract(c,r,ic)),f=h.magnitudeSquared(h.subtract(d,s,ic)),y=h.magnitudeSquared(h.subtract(u,a,ic)),_=r,S=c,Z=b;f>Z&&(Z=f,_=s,S=d),y>Z&&(_=a,S=u);let R=I4;R.x=(_.x+S.x)*.5,R.y=(_.y+S.y)*.5,R.z=(_.z+S.z)*.5;let C=h.magnitudeSquared(h.subtract(S,R,ic)),E=Math.sqrt(C),A=P4;A.x=r.x,A.y=s.y,A.z=a.z;let L=X4;L.x=c.x,L.y=d.y,L.z=u.z;let F=h.midpoint(A,L,N4),I=0;for(p=0;pI&&(I=N);let g=h.magnitudeSquared(h.subtract(o,R,ic));if(g>C){let V=Math.sqrt(g);E=(E+V)*.5,C=E*E;let G=V-E;R.x=(E*R.x+G*o.x)/V,R.y=(E*R.y+G*o.y)/V,R.z=(E*R.z+G*o.z)/V}}return E=d+a)return t.clone(i),i;if(a>=d+r)return n.clone(i),i;let u=(r+d+a)*.5,m=h.multiplyByScalar(c,(-r+u)/d,Fke);return h.add(m,o,m),h.clone(m,i.center),i.radius=u,i}static expand(t,n,i){i=e.clone(t,i);let o=h.magnitude(h.subtract(n,i.center,Ike));return o>i.radius&&(i.radius=o),i}static intersectPlane(t,n){let i=t.center,o=t.radius,r=n.normal,s=h.dot(r,i)+n.distance;return s<-o?qt.OUTSIDE:s>1^-(e&1)}No.zigZagDeltaDecode=function(e,t,n){let i=e.length,o=0,r=0,s=0;for(let a=0;a>16&255)/255,t.green=(e>>8&255)/255,t.blue=(e&255)/255,t};No.decodeRGB565=function(e,t){let n=e.length;l(t)||(t=new Float32Array(n*3));let i=31,o=63,r=1/31,s=1/63;for(let a=0;a>11,u=c>>5&o,m=c&i,p=3*a;t[p]=d*r,t[p+1]=u*s,t[p+2]=m*r}return t};var dn=No;var a7t=x(T(),1);var Gue=new h,Lue=new h,Wue=new h;function Bke(e,t,n,i,o){l(o)||(o=new h);let r,s,a,c,d,u,m,p;if(l(t.z)){if(h.equalsEpsilon(e,t,W.EPSILON14))return h.clone(h.UNIT_X,o);if(h.equalsEpsilon(e,n,W.EPSILON14))return h.clone(h.UNIT_Y,o);if(h.equalsEpsilon(e,i,W.EPSILON14))return h.clone(h.UNIT_Z,o);r=h.subtract(n,t,Gue),s=h.subtract(i,t,Lue),a=h.subtract(e,t,Wue),c=h.dot(r,r),d=h.dot(r,s),u=h.dot(r,a),m=h.dot(s,s),p=h.dot(s,a)}else{if(k.equalsEpsilon(e,t,W.EPSILON14))return h.clone(h.UNIT_X,o);if(k.equalsEpsilon(e,n,W.EPSILON14))return h.clone(h.UNIT_Y,o);if(k.equalsEpsilon(e,i,W.EPSILON14))return h.clone(h.UNIT_Z,o);r=k.subtract(n,t,Gue),s=k.subtract(i,t,Lue),a=k.subtract(e,t,Wue),c=k.dot(r,r),d=k.dot(r,s),u=k.dot(r,a),m=k.dot(s,s),p=k.dot(s,a)}o.y=m*u-d*p,o.z=c*p-d*u;let b=c*m-d*d;if(b!==0)return o.y/=b,o.z/=b,o.x=1-o.y-o.z,o}var c_=Bke;var u7t=x(T(),1);function Ap(){this.high=h.clone(h.ZERO),this.low=h.clone(h.ZERO)}Ap.encode=function(e,t){l(t)||(t={high:0,low:0});let n;return e>=0?(n=Math.floor(e/65536)*65536,t.high=n,t.low=e-n):(n=Math.floor(-e/65536)*65536,t.high=-n,t.low=e+n),t};var sb={high:0,low:0};Ap.fromCartesian=function(e,t){l(t)||(t=new Ap);let n=t.high,i=t.low;return Ap.encode(e.x,sb),n.x=sb.high,i.x=sb.low,Ap.encode(e.y,sb),n.y=sb.high,i.y=sb.low,Ap.encode(e.z,sb),n.z=sb.high,i.z=sb.low,t};var O4=new Ap;Ap.writeElements=function(e,t,n){Ap.fromCartesian(e,O4);let i=O4.high,o=O4.low;t[n]=i.x,t[n+1]=i.y,t[n+2]=i.z,t[n+3]=o.x,t[n+4]=o.y,t[n+5]=o.z};var An=Ap;var N7t=x(T(),1);var f7t=x(T(),1);var B4={};B4.computeDiscriminant=function(e,t,n){return t*t-4*e*n};function vue(e,t,n){let i=e+t;return W.sign(e)!==W.sign(t)&&Math.abs(i/Math.max(Math.abs(e),Math.abs(t)))d&&d/c0?[a/e,n/a]:[n/a,a/e]};var Xl=B4;var S7t=x(T(),1);var g7t=x(T(),1);var H4={};H4.computeDiscriminant=function(e,t,n,i){let o=e*e,r=t*t,s=n*n,a=i*i;return 18*e*t*n*i+r*s-27*o*a-4*(e*s*n+r*t*i)};function z4(e,t,n,i){let o=e,r=t/3,s=n/3,a=i,c=o*s,d=r*a,u=r*r,m=s*s,p=o*s-u,b=o*a-r*s,f=r*a-m,y=4*p*f-b*b,_,S;if(y<0){let z,K,te;u*d>=c*m?(z=o,K=p,te=-2*r*p+o*b):(z=a,K=f,te=-a*b+2*s*f);let $=-(te<0?-1:1)*Math.abs(z)*Math.sqrt(-y);S=-te+$;let ee=S/2,le=ee<0?-Math.pow(-ee,1/3):Math.pow(ee,1/3),_e=S===$?-le:-K/le;return _=K<=0?le+_e:-te/(le*le+_e*_e+K),u*d>=c*m?[(_-r)/o]:[-a/(_+s)]}let Z=p,R=-2*r*p+o*b,C=f,E=-a*b+2*s*f,A=Math.sqrt(y),L=Math.sqrt(3)/2,F=Math.abs(Math.atan2(o*A,-R)/3);_=2*Math.sqrt(-Z);let I=Math.cos(F);S=_*I;let N=_*(-I/2-L*Math.sin(F)),g=S+N>2*r?S-r:N-r,V=o,G=g/V;F=Math.abs(Math.atan2(a*A,-E)/3),_=2*Math.sqrt(-C),I=Math.cos(F),S=_*I,N=_*(-I/2-L*Math.sin(F));let v=-a,X=S+N<2*s?S+s:N+s,Y=v/X,D=V*X,M=-g*X-V*v,O=g*v,w=(s*M-r*O)/(-r*M+s*D);return G<=w?G<=Y?w<=Y?[G,w,Y]:[G,Y,w]:[Y,G,w]:G<=Y?[w,G,Y]:w<=Y?[w,Y,G]:[Y,w,G]}H4.computeRealRoots=function(e,t,n,i){let o,r;if(e===0)return Xl.computeRealRoots(t,n,i);if(t===0){if(n===0){if(i===0)return[0,0,0];r=-i/e;let s=r<0?-Math.pow(-r,1/3):Math.pow(r,1/3);return[s,s,s]}else if(i===0)return o=Xl.computeRealRoots(e,0,n),o.Length===0?[0]:[o[0],0,o[1]];return z4(e,0,n,i)}else{if(n===0)return i===0?(r=-t/e,r<0?[r,0,0]:[0,0,r]):z4(e,t,0,i);if(i===0)return o=Xl.computeRealRoots(e,t,n),o.length===0?[0]:o[1]<=0?[o[0],o[1],0]:o[0]>=0?[0,o[0],o[1]]:[o[0],0,o[1]]}return z4(e,t,n,i)};var l_=H4;var K4={};K4.computeDiscriminant=function(e,t,n,i,o){let r=e*e,s=r*e,a=t*t,c=a*t,d=n*n,u=d*n,m=i*i,p=m*i,b=o*o,f=b*o;return a*d*m-4*c*p-4*e*u*m+18*e*t*n*p-27*r*m*m+256*s*f+o*(18*c*n*i-4*a*u+16*e*d*d-80*e*t*d*i-6*e*a*m+144*r*n*m)+b*(144*e*a*n-27*a*a-128*r*d-192*r*t*i)};function Nh(e,t,n,i){let o=e*e,r=t-3*o/8,s=n-t*e/2+o*e/8,a=i-n*e/4+t*o/16-3*o*o/256,c=l_.computeRealRoots(1,2*r,r*r-4*a,-s*s);if(c.length>0){let d=-e/4,u=c[c.length-1];if(Math.abs(u)=0&&b>=0){let y=Math.sqrt(p),_=Math.sqrt(b);return[d-_,d-y,d+y,d+_]}else{if(p>=0&&b<0)return f=Math.sqrt(p),[d-f,d+f];if(p<0&&b>=0)return f=Math.sqrt(b),[d-f,d+f]}}return[]}else if(u>0){let m=Math.sqrt(u),p=(r+u-s/m)/2,b=(r+u+s/m)/2,f=Xl.computeRealRoots(1,m,p),y=Xl.computeRealRoots(1,-m,b);return f.length!==0?(f[0]+=d,f[1]+=d,y.length!==0?(y[0]+=d,y[1]+=d,f[1]<=y[0]?[f[0],f[1],y[0],y[1]]:y[1]<=f[0]?[y[0],y[1],f[0],f[1]]:f[0]>=y[0]&&f[1]<=y[1]?[y[0],f[0],f[1],y[1]]:y[0]>=f[0]&&y[1]<=f[1]?[f[0],y[0],y[1],f[1]]:f[0]>y[0]&&f[0]0){let m=u[0],p=t-m,b=p*p,f=e/2,y=p/2,_=b-4*i,S=b+4*Math.abs(i),Z=s-4*m,R=s+4*Math.abs(m),C,E;if(m<0||_*R=g[0]&&N[1]<=g[1]?[g[0],N[0],N[1],g[1]]:g[0]>=N[0]&&g[1]<=N[1]?[N[0],g[0],g[1],N[1]]:N[0]>g[0]&&N[0]u)||(p=h.cross(m,a,Iue),f=h.dot(s,p),f<0||b+f>u))return;y=h.dot(c,p)/u}else{if(Math.abs(u)1||(p=h.cross(m,a,Iue),f=h.dot(s,p)*_,f<0||b+f>1))return;y=h.dot(c,p)*_}return y};rr.rayTriangle=function(e,t,n,i,o,r){let s=rr.rayTriangleParametric(e,t,n,i,o);if(!(!l(s)||s<0))return l(r)||(r=new h),h.multiplyByScalar(e.direction,s,r),h.add(e.origin,r,r)};var Kke=new gn;rr.lineSegmentTriangle=function(e,t,n,i,o,r,s){let a=Kke;h.clone(e,a.origin),h.subtract(t,e,a.direction),h.normalize(a.direction,a.direction);let c=rr.rayTriangleParametric(a,n,i,o,r);if(!(!l(c)||c<0||c>h.distance(e,t)))return l(s)||(s=new h),h.multiplyByScalar(a.direction,c,s),h.add(a.origin,s,s)};function Jke(e,t,n,i){let o=t*t-4*e*n;if(o<0)return;if(o>0){let s=1/(2*e),a=Math.sqrt(o),c=(-t+a)*s,d=(-t-a)*s;return cs))return i.start=Math.max(i.start,0),i.stop=Math.min(i.stop,s),i};var qke=new h,$ke=new h;rr.rayEllipsoid=function(e,t){let n=t.oneOverRadii,i=h.multiplyComponents(n,e.origin,qke),o=h.multiplyComponents(n,e.direction,$ke),r=h.magnitudeSquared(i),s=h.dot(i,o),a,c,d,u,m;if(r>1){if(s>=0)return;let p=s*s;if(a=r-1,c=h.magnitudeSquared(o),d=c*a,pd){u=s*s-d,m=-s+Math.sqrt(u);let f=m/c,y=a/m;return fo.start?i.start:o.start,n.stop=i.stopo.stop||o.start>i.stop)&&!(n.start>r.stop||r.start>n.stop))return r.start>n.start&&(n.start=r.start),r.stop0?b.push(new h(i,o*I,o*-V)):V!==0?(b.push(new h(i,o*I,o*-V)),b.push(new h(i,o*I,o*V)),++F):b.push(new h(i,o*I,o*V))}return b};var Q4=new h,Pue=new h,Xue=new h,BD=new h,iUe=new h,oUe=new q,rUe=new q,sUe=new q,aUe=new q,cUe=new q,Nue=new q,Yue=new q,Mue=new h,lUe=new h,dUe=new pe;rr.grazingAltitudeLocation=function(e,t){let n=e.origin,i=e.direction;if(!h.equals(n,h.ZERO)){let A=t.geodeticSurfaceNormal(n,Q4);if(h.dot(i,A)>=0)return n}let o=l(this.rayEllipsoid(e,t)),r=t.transformPositionToScaledSpace(i,Q4),s=h.normalize(r,r),a=h.mostOrthogonalAxis(r,BD),c=h.normalize(h.cross(a,s,Pue),Pue),d=h.normalize(h.cross(s,c,Xue),Xue),u=oUe;u[0]=s.x,u[1]=s.y,u[2]=s.z,u[3]=c.x,u[4]=c.y,u[5]=c.z,u[6]=d.x,u[7]=d.y,u[8]=d.z;let m=q.transpose(u,rUe),p=q.fromScale(t.radii,sUe),b=q.fromScale(t.oneOverRadii,aUe),f=cUe;f[0]=0,f[1]=-i.z,f[2]=i.y,f[3]=i.z,f[4]=0,f[5]=-i.x,f[6]=-i.y,f[7]=i.x,f[8]=0;let y=q.multiply(q.multiply(m,b,Nue),f,Nue),_=q.multiply(q.multiply(y,p,Yue),u,Yue),S=q.multiplyByVector(y,n,iUe),Z=rr.quadraticVectorExpression(_,h.negate(S,Q4),0,0,1),R,C,E=Z.length;if(E>0){let A=h.clone(h.ZERO,lUe),L=Number.NEGATIVE_INFINITY;for(let I=0;IL&&(L=g,A=h.clone(R,A))}let F=t.cartesianToCartographic(A,dUe);return L=W.clamp(L,0,1),C=h.magnitude(h.subtract(A,n,BD))*Math.sqrt(1-L*L),C=o?-C:C,F.height=C,t.cartographicToCartesian(F,new h)}};var uUe=new h;rr.lineSegmentPlane=function(e,t,n,i){l(i)||(i=new h);let o=h.subtract(t,e,uUe),r=n.normal,s=h.dot(r,o);if(Math.abs(s)1))return h.multiplyByScalar(o,c,i),h.add(e,i,i),i};rr.trianglePlaneIntersection=function(e,t,n,i){let o=i.normal,r=i.distance,s=h.dot(o,e)+r<0,a=h.dot(o,t)+r<0,c=h.dot(o,n)+r<0,d=0;d+=s?1:0,d+=a?1:0,d+=c?1:0;let u,m;if((d===1||d===2)&&(u=new h,m=new h),d===1){if(s)return rr.lineSegmentPlane(e,t,i,u),rr.lineSegmentPlane(e,n,i,m),{positions:[e,t,n,u,m],indices:[0,3,4,1,2,4,1,4,3]};if(a)return rr.lineSegmentPlane(t,n,i,u),rr.lineSegmentPlane(t,e,i,m),{positions:[e,t,n,u,m],indices:[1,3,4,2,0,4,2,4,3]};if(c)return rr.lineSegmentPlane(n,e,i,u),rr.lineSegmentPlane(n,t,i,m),{positions:[e,t,n,u,m],indices:[2,3,4,0,1,4,0,4,3]}}else if(d===2)if(s)if(a){if(!c)return rr.lineSegmentPlane(e,n,i,u),rr.lineSegmentPlane(t,n,i,m),{positions:[e,t,n,u,m],indices:[0,1,4,0,4,3,2,3,4]}}else return rr.lineSegmentPlane(n,t,i,u),rr.lineSegmentPlane(e,t,i,m),{positions:[e,t,n,u,m],indices:[2,0,4,2,4,3,1,3,4]};else return rr.lineSegmentPlane(t,e,i,u),rr.lineSegmentPlane(n,e,i,m),{positions:[e,t,n,u,m],indices:[1,2,4,1,4,3,0,3,4]}};var xi=rr;var D7t=x(T(),1);function Fa(e,t){this.normal=h.clone(e),this.distance=t}Fa.fromPointNormal=function(e,t,n){let i=-h.dot(t,e);return l(n)?(h.clone(t,n.normal),n.distance=i,n):new Fa(t,i)};var mUe=new h;Fa.fromCartesian4=function(e,t){let n=h.fromCartesian4(e,mUe),i=e.w;return l(t)?(h.clone(n,t.normal),t.distance=i,t):new Fa(n,i)};Fa.getPointDistance=function(e,t){return h.dot(e.normal,t)+e.distance};var hUe=new h;Fa.projectPointOntoPlane=function(e,t,n){l(n)||(n=new h);let i=Fa.getPointDistance(e,t),o=h.multiplyByScalar(e.normal,i,hUe);return h.subtract(t,o,n)};var fUe=new P,pUe=new ce,bUe=new h;Fa.transform=function(e,t,n){let i=e.normal,o=e.distance,r=P.inverseTranspose(t,fUe),s=ce.fromElements(i.x,i.y,i.z,o,pUe);s=P.multiplyByVector(r,s,s);let a=h.fromCartesian4(s,bUe);return s=ce.divideByScalar(s,h.magnitude(a),s),Fa.fromCartesian4(s,n)};Fa.clone=function(e,t){return l(t)?(h.clone(e.normal,t.normal),t.distance=e.distance,t):new Fa(e.normal,e.distance)};Fa.equals=function(e,t){return e.distance===t.distance&&h.equals(e.normal,t.normal)};Fa.ORIGIN_XY_PLANE=Object.freeze(new Fa(h.UNIT_Z,0));Fa.ORIGIN_YZ_PLANE=Object.freeze(new Fa(h.UNIT_X,0));Fa.ORIGIN_ZX_PLANE=Object.freeze(new Fa(h.UNIT_Y,0));var cn=Fa;var H7t=x(T(),1);var q4={};q4.calculateACMR=function(e){e=e??B.EMPTY_OBJECT;let t=e.indices,n=e.maximumIndex,i=e.cacheSize??24,o=t.length;if(!l(n)){n=0;let a=0,c=t[a];for(;an&&(n=c),++a,c=t[a]}let r=[];for(let a=0;ai&&(r[t[a]]=s,++s);return(s-i+1)/(o/3)};q4.tipsify=function(e){e=e??B.EMPTY_OBJECT;let t=e.indices,n=e.maximumIndex,i=e.cacheSize??24,o;function r(g,V,G,v){for(;V.length>=1;){let X=V[V.length-1];if(V.splice(V.length-1,1),g[X].numLiveTriangles>0)return X}for(;o0)return++o,o-1;++o}return-1}function s(g,V,G,v,X,Y,D){let M=-1,O,w=-1,z=0;for(;zw||w===-1)&&(w=O,M=K)),++z}return M===-1?r(v,Y,g,D):M}let a=t.length,c=0,d=0,u=t[d],m=a;if(l(n))c=n+1;else{for(;dc&&(c=u),++d,u=t[d];if(c===-1)return 0;++c}let p=[],b;for(b=0;bi&&(R.timeStamp=_,++_),++d}y=s(t,i,S,p,_,Z,c)}return A};var gG=q4;var Nl={};function qD(e,t,n,i,o){e[t++]=n,e[t++]=i,e[t++]=i,e[t++]=o,e[t++]=o,e[t]=n}function gUe(e){let t=e.length,n=t/3*6,i=Oe.createTypedArray(t,n),o=0;for(let r=0;r=3){let n=(t-2)*6,i=Oe.createTypedArray(t,n);qD(i,0,e[0],e[1],e[2]);let o=6;for(let r=3;r0){let t=e.length-1,n=(t-1)*6,i=Oe.createTypedArray(t,n),o=e[0],r=0;for(let s=1;so&&(o=n[r]);e.indices=gG.tipsify({indices:n,maximumIndex:o,cacheSize:t})}return e};function Uue(e){let t={};for(let n in e)if(e.hasOwnProperty(n)&&l(e[n])&&l(e[n].values)){let i=e[n];t[n]=new Xe({componentDatatype:i.componentDatatype,componentsPerAttribute:i.componentsPerAttribute,normalize:i.normalize,values:[]})}return t}function TUe(e,t,n){for(let i in t)if(t.hasOwnProperty(i)&&l(t[i])&&l(t[i].values)){let o=t[i];for(let r=0;r=W.SIXTY_FOUR_KILOBYTES){let i=[],o=[],r=0,s=Uue(e.attributes),a=e.indices,c=a.length,d;e.primitiveType===Ie.TRIANGLES?d=3:e.primitiveType===Ie.LINES?d=2:e.primitiveType===Ie.POINTS&&(d=1);for(let u=0;u=W.SIXTY_FOUR_KILOBYTES&&(t.push(new At({attributes:s,indices:o,primitiveType:e.primitiveType,boundingSphere:e.boundingSphere,boundingSphereCV:e.boundingSphereCV})),i=[],o=[],r=0,s=Uue(e.attributes))}o.length!==0&&t.push(new At({attributes:s,indices:o,primitiveType:e.primitiveType,boundingSphere:e.boundingSphere,boundingSphereCV:e.boundingSphereCV}))}else t.push(e);return t};var Due=new h,_Ue=new pe;Nl.projectTo2D=function(e,t,n,i,o){let r=e.attributes[t];o=l(o)?o:new ki;let s=o.ellipsoid,a=r.values,c=new Float64Array(a.length),d=0;for(let u=0;u_&&(_=Z)}return new At({attributes:u,indices:f,primitiveType:d,boundingSphere:l(y)?new me(y,_):void 0})}Nl.combineInstances=function(e){let t=[],n=[],i=e.length;for(let r=0;r0&&o.push(nQ(t,"geometry")),n.length>0&&(o.push(nQ(n,"westHemisphereGeometry")),o.push(nQ(n,"eastHemisphereGeometry"))),o};var Sm=new h,yG=new h,d1=new h,u1=new h;Nl.computeNormal=function(e){let t=e.indices,n=e.attributes,i=n.position.values,o=n.position.values.length/3,r=t.length,s=new Array(o),a=new Array(r/3),c=new Array(r),d;for(d=0;d0){for(u=0;u3&&(n[3]=0,n[4]=2,n[5]=3);let i=6;for(let o=3;oo?i>r?s=W.sign(e.y):s=W.sign(n.y):o>r?s=W.sign(t.y):s=W.sign(n.y);let a=s<0;Wy(e,a),Wy(t,a),Wy(n,a)}var Hue=new h;function Zm(e,t,n,i){h.add(e,h.multiplyByScalar(h.subtract(t,e,Hue),e.y/(e.y-t.y),Hue),n),h.clone(n,i),Wy(n,!0),Wy(i,!1)}var u_=new h,m_=new h,h_=new h,f_=new h,iQ={positions:new Array(7),indices:new Array(9)};function IUe(e,t,n){if(e.x>=0||t.x>=0||n.x>=0)return;FUe(e,t,n);let i=e.y<0,o=t.y<0,r=n.y<0,s=0;s+=i?1:0,s+=o?1:0,s+=r?1:0;let a=iQ.indices;s===1?(a[1]=3,a[2]=4,a[5]=6,a[7]=6,a[8]=5,i?(Zm(e,t,u_,h_),Zm(e,n,m_,f_),a[0]=0,a[3]=1,a[4]=2,a[6]=1):o?(Zm(t,n,u_,h_),Zm(t,e,m_,f_),a[0]=1,a[3]=2,a[4]=0,a[6]=2):r&&(Zm(n,e,u_,h_),Zm(n,t,m_,f_),a[0]=2,a[3]=0,a[4]=1,a[6]=0)):s===2&&(a[2]=4,a[4]=4,a[5]=3,a[7]=5,a[8]=6,i?o?r||(Zm(n,e,u_,h_),Zm(n,t,m_,f_),a[0]=0,a[1]=1,a[3]=0,a[6]=2):(Zm(t,n,u_,h_),Zm(t,e,m_,f_),a[0]=2,a[1]=0,a[3]=2,a[6]=1):(Zm(e,t,u_,h_),Zm(e,n,m_,f_),a[0]=1,a[1]=2,a[3]=1,a[6]=0));let c=iQ.positions;return c[0]=e,c[1]=t,c[2]=n,c.length=3,(s===1||s===2)&&(c[3]=u_,c[4]=m_,c[5]=h_,c[6]=f_,c.length=7),iQ}function Kue(e,t){let n=e.attributes;if(n.position.values.length===0)return;for(let o in n)if(n.hasOwnProperty(o)&&l(n[o])&&l(n[o].values)){let r=n[o];r.values=J.createTypedArray(r.componentDatatype,r.values)}let i=At.computeNumberOfVertices(e);return e.indices=Oe.createTypedArray(i,e.indices),t&&(e.boundingSphere=me.fromVertices(n.position.values)),e}function h1(e){let t=e.attributes,n={};for(let i in t)if(t.hasOwnProperty(i)&&l(t[i])&&l(t[i].values)){let o=t[i];n[i]=new Xe({componentDatatype:o.componentDatatype,componentsPerAttribute:o.componentsPerAttribute,normalize:o.normalize,values:[]})}return new At({attributes:n,indices:[],primitiveType:e.primitiveType})}function aQ(e,t,n){let i=l(e.geometry.boundingSphere);t=Kue(t,i),n=Kue(n,i),l(n)&&!l(t)?e.geometry=n:!l(n)&&l(t)?e.geometry=t:(e.westHemisphereGeometry=t,e.eastHemisphereGeometry=n,e.geometry=void 0)}function cQ(e,t){let n=new e,i=new e,o=new e;return function(r,s,a,c,d,u,m,p){let b=e.fromArray(d,r*t,n),f=e.fromArray(d,s*t,i),y=e.fromArray(d,a*t,o);e.multiplyByScalar(b,c.x,b),e.multiplyByScalar(f,c.y,f),e.multiplyByScalar(y,c.z,y);let _=e.add(b,f,b);e.add(_,y,_),p&&e.normalize(_,_),e.pack(_,u,m*t)}}var PUe=cQ(ce,4),QD=cQ(h,3),eme=cQ(k,2),XUe=function(e,t,n,i,o,r,s){let a=o[e]*i.x,c=o[t]*i.y,d=o[n]*i.z;r[s]=a+c+d>W.EPSILON6?1:0},TG=new h,oQ=new h,rQ=new h,NUe=new h;function JD(e,t,n,i,o,r,s,a,c,d,u,m,p,b,f,y){if(!l(r)&&!l(s)&&!l(a)&&!l(c)&&!l(d)&&b===0)return;let _=h.fromArray(o,e*3,TG),S=h.fromArray(o,t*3,oQ),Z=h.fromArray(o,n*3,rQ),R=c_(i,_,S,Z,NUe);if(l(R)){if(l(r)&&QD(e,t,n,R,r,m.normal.values,y,!0),l(d)){let C=h.fromArray(d,e*3,TG),E=h.fromArray(d,t*3,oQ),A=h.fromArray(d,n*3,rQ);h.multiplyByScalar(C,R.x,C),h.multiplyByScalar(E,R.y,E),h.multiplyByScalar(A,R.z,A);let L;!h.equals(C,h.ZERO)||!h.equals(E,h.ZERO)||!h.equals(A,h.ZERO)?(L=h.add(C,E,C),h.add(L,A,L),h.normalize(L,L)):(L=TG,L.x=0,L.y=0,L.z=0),h.pack(L,m.extrudeDirection.values,y*3)}if(l(u)&&XUe(e,t,n,R,u,m.applyOffset.values,y),l(s)&&QD(e,t,n,R,s,m.tangent.values,y,!0),l(a)&&QD(e,t,n,R,a,m.bitangent.values,y,!0),l(c)&&eme(e,t,n,R,c,m.st.values,y),b>0)for(let C=0;C3){let v=G.positions,X=G.indices,Y=X.length;for(let D=0;D0)continue;let c=h.unpack(i,s,ime);(a.y<0&&c.y>0||a.y>0&&c.y<0)&&(s-3>0?(i[s]=n[s-3],i[s+1]=n[s-2],i[s+2]=n[s-1]):h.pack(a,i,s));let d=h.unpack(o,s,sQ);(a.y<0&&d.y>0||a.y>0&&d.y<0)&&(s+30||me.intersectPlane(n,cn.ORIGIN_ZX_PLANE)!==qt.INTERSECTING))return e;if(t.geometryType!==_m.NONE)switch(t.geometryType){case _m.POLYLINES:HUe(e);break;case _m.TRIANGLES:Jue(e);break;case _m.LINES:jue(e);break}else vUe(t),t.primitiveType===Ie.TRIANGLES?Jue(e):t.primitiveType===Ie.LINES&&jue(e);return e};var Bn=Nl;var Zqt=x(T(),1);function _G(e,t,n,i,o,r,s,a,c,d,u){this._context=e,this._texture=t,this._textureTarget=n,this._targetFace=i,this._pixelDatatype=s,this._internalFormat=o,this._pixelFormat=r,this._size=a,this._preMultiplyAlpha=c,this._flipY=d,this._initialized=u}Object.defineProperties(_G.prototype,{pixelFormat:{get:function(){return this._pixelFormat}},pixelDatatype:{get:function(){return this._pixelDatatype}},_target:{get:function(){return this._targetFace}}});_G.prototype.copyFrom=function(e){let{xOffset:t=0,yOffset:n=0,source:i,skipColorSpaceConversion:o=!1}=e,{width:r,height:s}=i,a=this._context._gl,c=this._textureTarget,d=this._targetFace;a.activeTexture(a.TEXTURE0),a.bindTexture(c,this._texture);let u=i.arrayBufferView,m=this._size,p=this._pixelFormat,b=this._internalFormat,f=this._pixelDatatype,y=this._preMultiplyAlpha,_=this._flipY,S=4;l(u)&&(S=Qe.alignmentInBytes(p,f,r)),a.pixelStorei(a.UNPACK_ALIGNMENT,S),o?a.pixelStorei(a.UNPACK_COLORSPACE_CONVERSION_WEBGL,a.NONE):a.pixelStorei(a.UNPACK_COLORSPACE_CONVERSION_WEBGL,a.BROWSER_DEFAULT_WEBGL);let Z=!1;if(!this._initialized){let R;t===0&&n===0&&r===m&&s===m?(l(u)?(a.pixelStorei(a.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!1),a.pixelStorei(a.UNPACK_FLIP_Y_WEBGL,!1),_&&(u=Qe.flipY(u,p,f,m,m)),R=u):(a.pixelStorei(a.UNPACK_PREMULTIPLY_ALPHA_WEBGL,y),a.pixelStorei(a.UNPACK_FLIP_Y_WEBGL,_),R=i),Z=!0):(a.pixelStorei(a.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!1),a.pixelStorei(a.UNPACK_FLIP_Y_WEBGL,!1),R=Qe.createTypedArray(p,f,m,m)),a.texImage2D(d,0,b,m,m,0,p,Ue.toWebGLConstant(f,this._context),R),this._initialized=!0}Z||(l(u)?(a.pixelStorei(a.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!1),a.pixelStorei(a.UNPACK_FLIP_Y_WEBGL,!1),_&&(u=Qe.flipY(u,p,f,r,s)),a.texSubImage2D(d,0,t,n,r,s,p,Ue.toWebGLConstant(f,this._context),u)):(a.pixelStorei(a.UNPACK_PREMULTIPLY_ALPHA_WEBGL,y),a.pixelStorei(a.UNPACK_FLIP_Y_WEBGL,_),a.texSubImage2D(d,0,t,n,p,Ue.toWebGLConstant(f,this._context),i))),a.bindTexture(c,null)};_G.prototype.copyFromFramebuffer=function(e,t,n,i,o,r){e=e??0,t=t??0,n=n??0,i=i??0,o=o??this._size,r=r??this._size;let s=this._context._gl,a=this._textureTarget;s.activeTexture(s.TEXTURE0),s.bindTexture(a,this._texture),s.copyTexSubImage2D(this._targetFace,0,e,t,n,i,o,r),s.bindTexture(a,null),this._initialized=!0};_G.prototype.copyMipmapFromFramebuffer=function(e,t,n,i,o){e=e??0,t=t??0,n=n??this._size,i=i??this._size,o=o??0;let r=this._context._gl,s=this._textureTarget;r.activeTexture(r.TEXTURE0),r.bindTexture(s,this._texture),r.copyTexImage2D(this._targetFace,o,this._internalFormat,e,t,n,i,0),r.bindTexture(s,null),this._initialized=!0};var SG=_G;var Vqt=x(T(),1);var ZG={DONT_CARE:ie.DONT_CARE,FASTEST:ie.FASTEST,NICEST:ie.NICEST,validate:function(e){return e===ZG.DONT_CARE||e===ZG.FASTEST||e===ZG.NICEST}};Object.freeze(ZG);var Rm=ZG;var Uqt=x(T(),1);var Gqt=x(T(),1);var RG={NEAREST:ie.NEAREST,LINEAR:ie.LINEAR};RG.validate=function(e){return e===RG.NEAREST||e===RG.LINEAR};Object.freeze(RG);var $n=RG;var vqt=x(T(),1);var ab={NEAREST:ie.NEAREST,LINEAR:ie.LINEAR,NEAREST_MIPMAP_NEAREST:ie.NEAREST_MIPMAP_NEAREST,LINEAR_MIPMAP_NEAREST:ie.LINEAR_MIPMAP_NEAREST,NEAREST_MIPMAP_LINEAR:ie.NEAREST_MIPMAP_LINEAR,LINEAR_MIPMAP_LINEAR:ie.LINEAR_MIPMAP_LINEAR};ab.validate=function(e){return e===ab.NEAREST||e===ab.LINEAR||e===ab.NEAREST_MIPMAP_NEAREST||e===ab.LINEAR_MIPMAP_NEAREST||e===ab.NEAREST_MIPMAP_LINEAR||e===ab.LINEAR_MIPMAP_LINEAR};Object.freeze(ab);var Ht=ab;var Pqt=x(T(),1);var CG={CLAMP_TO_EDGE:ie.CLAMP_TO_EDGE,REPEAT:ie.REPEAT,MIRRORED_REPEAT:ie.MIRRORED_REPEAT,validate:function(e){return e===CG.CLAMP_TO_EDGE||e===CG.REPEAT||e===CG.MIRRORED_REPEAT}};Object.freeze(CG);var pn=CG;function VG(e){e=e??B.EMPTY_OBJECT;let{wrapR:t=pn.CLAMP_TO_EDGE,wrapS:n=pn.CLAMP_TO_EDGE,wrapT:i=pn.CLAMP_TO_EDGE,minificationFilter:o=Ht.LINEAR,magnificationFilter:r=$n.LINEAR,maximumAnisotropy:s=1}=e;this._wrapR=t,this._wrapS=n,this._wrapT=i,this._minificationFilter=o,this._magnificationFilter=r,this._maximumAnisotropy=s}Object.defineProperties(VG.prototype,{wrapR:{get:function(){return this._wrapR}},wrapS:{get:function(){return this._wrapS}},wrapT:{get:function(){return this._wrapT}},minificationFilter:{get:function(){return this._minificationFilter}},magnificationFilter:{get:function(){return this._magnificationFilter}},maximumAnisotropy:{get:function(){return this._maximumAnisotropy}}});VG.equals=function(e,t){return e===t||l(e)&&l(t)&&e._wrapR===t._wrapR&&e._wrapS===t._wrapS&&e._wrapT===t._wrapT&&e._minificationFilter===t._minificationFilter&&e._magnificationFilter===t._magnificationFilter&&e._maximumAnisotropy===t._maximumAnisotropy};VG.NEAREST=Object.freeze(new VG({wrapR:pn.CLAMP_TO_EDGE,wrapS:pn.CLAMP_TO_EDGE,wrapT:pn.CLAMP_TO_EDGE,minificationFilter:Ht.NEAREST,magnificationFilter:$n.NEAREST}));var Ot=VG;var r$t=x(T(),1);var Bqt=x(T(),1);function KUe(e,t){if(!e)throw new ge(t)}var lQ=KUe;function JUe(e,t,n,i){let o=l(t.vertexBuffer),r=l(t.value),s=t.value?t.value.length:t.componentsPerAttribute,a={index:t.index??n,enabled:t.enabled??!0,vertexBuffer:t.vertexBuffer,value:r?t.value.slice(0):void 0,componentsPerAttribute:s,componentDatatype:t.componentDatatype??J.FLOAT,normalize:t.normalize??!1,offsetInBytes:t.offsetInBytes??0,strideInBytes:t.strideInBytes??0,instanceDivisor:t.instanceDivisor??0};if(o)a.vertexAttrib=function(c){let d=this.index;c.bindBuffer(c.ARRAY_BUFFER,this.vertexBuffer._getBuffer()),c.vertexAttribPointer(d,this.componentsPerAttribute,this.componentDatatype,this.normalize,this.strideInBytes,this.offsetInBytes),c.enableVertexAttribArray(d),this.instanceDivisor>0&&(i.glVertexAttribDivisor(d,this.instanceDivisor),i._vertexAttribDivisors[d]=this.instanceDivisor,i._previousDrawInstanced=!0)},a.disableVertexAttribArray=function(c){c.disableVertexAttribArray(this.index),this.instanceDivisor>0&&i.glVertexAttribDivisor(n,0)};else{switch(a.componentsPerAttribute){case 1:a.vertexAttrib=function(c){c.vertexAttrib1fv(this.index,this.value)};break;case 2:a.vertexAttrib=function(c){c.vertexAttrib2fv(this.index,this.value)};break;case 3:a.vertexAttrib=function(c){c.vertexAttrib3fv(this.index,this.value)};break;case 4:a.vertexAttrib=function(c){c.vertexAttrib4fv(this.index,this.value)};break}a.disableVertexAttribArray=function(c){}}e.push(a)}function rme(e,t,n){for(let i=0;i0&&(c=!0),l(s[r].value)&&(d=!0);let m;t.vertexArrayObject&&(m=t.glCreateVertexArray(),t.glBindVertexArray(m),rme(n,s,o),t.glBindVertexArray(null)),this._numberOfVertices=a,this._hasInstancedAttributes=c,this._hasConstantAttributes=d,this._context=t,this._gl=n,this._vao=m,this._attributes=s,this._indexBuffer=o}function ome(e){return e.values.length/e.componentsPerAttribute}function jUe(e){return J.getSizeInBytes(e.componentDatatype)*e.componentsPerAttribute}function QUe(e){let t,n,i,o=[];for(n in e)e.hasOwnProperty(n)&&l(e[n])&&l(e[n].values)&&(o.push(n),e[n].componentDatatype===J.DOUBLE&&(e[n].componentDatatype=J.FLOAT,e[n].values=J.createTypedArray(J.FLOAT,e[n].values)));let r,s=o.length;if(s>0)for(r=ome(e[o[0]]),t=1;t0){let d=J.getSizeInBytes(e[o[0]].componentDatatype),u=a%d;u!==0&&(a+=d-u);let m=r*a,p=new ArrayBuffer(m),b={};for(t=0;t=W.SIXTY_FOUR_KILOBYTES&&t.elementIndexUint?p=it.createIndexBuffer({context:t,typedArray:new Uint32Array(b),usage:i,indexDatatype:Oe.UNSIGNED_INT}):p=it.createIndexBuffer({context:t,typedArray:new Uint16Array(b),usage:i,indexDatatype:Oe.UNSIGNED_SHORT})),new wh({context:t,attributes:u,indexBuffer:p})};Object.defineProperties(wh.prototype,{numberOfAttributes:{get:function(){return this._attributes.length}},numberOfVertices:{get:function(){return this._numberOfVertices}},indexBuffer:{get:function(){return this._indexBuffer}}});wh.prototype.getAttribute=function(e){return this._attributes[e]};function qUe(e){let t=e._context,n=e._hasInstancedAttributes;if(!n&&!t._previousDrawInstanced)return;t._previousDrawInstanced=n;let i=t._vertexAttribDivisors,o=e._attributes,r=wt.maximumVertexAttributes,s;if(n){let a=o.length;for(s=0;s0&&(t.glVertexAttribDivisor(s,0),i[s]=0)}function $Ue(e,t){let n=e._attributes,i=n.length;for(let o=0;o= 0.0 ? 1.0 : -1.0; } @@ -1401,7 +1401,7 @@ vec4 czm_signNotZero(vec4 value) { return vec4(czm_signNotZero(value.x), czm_signNotZero(value.y), czm_signNotZero(value.z), czm_signNotZero(value.w)); } -`;var ron=x(T(),1),DW=`vec3 czm_sphericalHarmonics(vec3 normal, vec3 coefficients[9]) +`;var son=x(T(),1),DW=`vec3 czm_sphericalHarmonics(vec3 normal, vec3 coefficients[9]) { vec3 L00 = coefficients[0]; vec3 L1_1 = coefficients[1]; @@ -1427,7 +1427,7 @@ L00 + L22 * (x * x - y * y); return max(L, vec3(0.0)); } -`;var aon=x(T(),1),OW=`vec3 czm_srgbToLinear(vec3 srgbIn) +`;var con=x(T(),1),OW=`vec3 czm_srgbToLinear(vec3 srgbIn) { return pow(srgbIn, vec3(2.2)); } @@ -1436,7 +1436,7 @@ vec4 czm_srgbToLinear(vec4 srgbIn) vec3 linearOut = pow(srgbIn.rgb, vec3(2.2)); return vec4(linearOut, srgbIn.a); } -`;var lon=x(T(),1),BW=`mat3 czm_tangentToEyeSpaceMatrix(vec3 normalEC, vec3 tangentEC, vec3 bitangentEC) +`;var don=x(T(),1),BW=`mat3 czm_tangentToEyeSpaceMatrix(vec3 normalEC, vec3 tangentEC, vec3 bitangentEC) { vec3 normal = normalize(normalEC); vec3 tangent = normalize(tangentEC); @@ -1445,7 +1445,7 @@ return mat3(tangent.x , tangent.y , tangent.z, bitangent.x, bitangent.y, bitangent.z, normal.x , normal.y , normal.z); } -`;var uon=x(T(),1),zW=`vec4 czm_textureCube(samplerCube sampler, vec3 p) { +`;var mon=x(T(),1),zW=`vec4 czm_textureCube(samplerCube sampler, vec3 p) { #if __VERSION__ == 300 return texture(sampler, p); #else @@ -1459,12 +1459,12 @@ return textureLod(sampler, p, lod); return textureCubeLodEXT(sampler, p, lod); #endif } -`;var hon=x(T(),1),HW=`vec4 czm_transformPlane(vec4 plane, mat4 transform) { +`;var fon=x(T(),1),HW=`vec4 czm_transformPlane(vec4 plane, mat4 transform) { vec4 transformedPlane = transform * plane; float normalMagnitude = length(transformedPlane.xyz); return transformedPlane / normalMagnitude; } -`;var pon=x(T(),1),KW=`vec4 czm_translateRelativeToEye(vec3 high, vec3 low) +`;var bon=x(T(),1),KW=`vec4 czm_translateRelativeToEye(vec3 high, vec3 low) { vec3 highDifference = high - czm_encodedCameraPositionMCHigh; if (length(highDifference) == 0.0) { @@ -1473,7 +1473,7 @@ highDifference = vec3(0); vec3 lowDifference = low - czm_encodedCameraPositionMCLow; return vec4(highDifference + lowDifference, 1.0); } -`;var gon=x(T(),1),JW=`vec4 czm_translucentPhong(vec3 toEye, czm_material material, vec3 lightDirectionEC) +`;var yon=x(T(),1),JW=`vec4 czm_translucentPhong(vec3 toEye, czm_material material, vec3 lightDirectionEC) { float diffuse = czm_getLambertDiffuse(vec3(0.0, 0.0, 1.0), material.normal); if (czm_sceneMode == czm_sceneMode3D) { @@ -1488,7 +1488,7 @@ color += materialDiffuse * diffuse * czm_lightColor; color += material.specular * specular * czm_lightColor; return vec4(color, material.alpha); } -`;var xon=x(T(),1),jW=`mat2 czm_transpose(mat2 matrix) +`;var Ton=x(T(),1),jW=`mat2 czm_transpose(mat2 matrix) { return mat2( matrix[0][0], matrix[1][0], @@ -1509,11 +1509,11 @@ matrix[0][1], matrix[1][1], matrix[2][1], matrix[3][1], matrix[0][2], matrix[1][2], matrix[2][2], matrix[3][2], matrix[0][3], matrix[1][3], matrix[2][3], matrix[3][3]); } -`;var _on=x(T(),1),QW=`float czm_unpackDepth(vec4 packedDepth) +`;var Son=x(T(),1),QW=`float czm_unpackDepth(vec4 packedDepth) { return dot(packedDepth, vec4(1.0, 1.0 / 255.0, 1.0 / 65025.0, 1.0 / 16581375.0)); } -`;var Zon=x(T(),1),qW=`float czm_unpackFloat(vec4 packedFloat) +`;var Ron=x(T(),1),qW=`float czm_unpackFloat(vec4 packedFloat) { packedFloat = floor(packedFloat * 255.0 + 0.5); float sign = 1.0 - step(128.0, packedFloat[3]) * 2.0; @@ -1526,7 +1526,7 @@ float mantissa = mod(packedFloat[2], 128.0) * 65536.0 + packedFloat[1] * 256.0 + float result = sign * exp2(exponent - 23.0) * mantissa; return result; } -`;var Con=x(T(),1),$W=`uint czm_unpackTexture(float packedValue) { +`;var Von=x(T(),1),$W=`uint czm_unpackTexture(float packedValue) { float rounded = czm_round(packedValue * 255.0); return uint(rounded); } @@ -1551,7 +1551,7 @@ uint byte2 = uint(rounded.z); uint byte3 = uint(rounded.w); return byte0 | (byte1 << 8) | (byte2 << 16) | (byte3 << 24); } -`;var Eon=x(T(),1),ev=`int czm_unpackUint(float packedValue) { +`;var Aon=x(T(),1),ev=`int czm_unpackUint(float packedValue) { float rounded = czm_round(packedValue * 255.0); return int(rounded); } @@ -1567,7 +1567,7 @@ int czm_unpackUint(vec4 packedValue) { vec4 rounded = czm_round(packedValue * 255.0); return int(dot(rounded, vec4(1.0, 256.0, 65536.0, 16777216.0))); } -`;var Gon=x(T(),1),tv=`float czm_valueTransform(float offset, float scale, float value) { +`;var Lon=x(T(),1),tv=`float czm_valueTransform(float offset, float scale, float value) { return scale * value + offset; } vec2 czm_valueTransform(vec2 offset, vec2 scale, vec2 value) { @@ -1588,7 +1588,7 @@ return matrixCompMult(scale, value) + offset; mat4 czm_valueTransform(mat4 offset, mat4 scale, mat4 value) { return matrixCompMult(scale, value) + offset; } -`;var Won=x(T(),1),nv=`#ifdef LOG_DEPTH +`;var von=x(T(),1),nv=`#ifdef LOG_DEPTH out float v_depthFromNearPlusOne; #ifdef SHADOW_MAP out vec3 v_logPositionEC; @@ -1618,7 +1618,7 @@ v_depthFromNearPlusOne = (clipCoords.w - czm_currentFrustum.x) + 1.0; czm_updatePositionDepth(clipCoords); #endif } -`;var Fon=x(T(),1),iv=`vec4 czm_screenToEyeCoordinates(vec4 screenCoordinate) +`;var Ion=x(T(),1),iv=`vec4 czm_screenToEyeCoordinates(vec4 screenCoordinate) { float x = 2.0 * screenCoordinate.x - 1.0; float y = 2.0 * screenCoordinate.y - 1.0; @@ -1671,7 +1671,7 @@ vec4 czm_windowToEyeCoordinates(vec2 fragmentCoordinateXY, float depthOrLogDepth vec2 screenCoordXY = (fragmentCoordinateXY.xy - czm_viewport.xy) / czm_viewport.zw; return czm_screenToEyeCoordinates(screenCoordXY, depthOrLogDepth); } -`;var Pon=x(T(),1),ov=`#if !defined(LOG_DEPTH) +`;var Xon=x(T(),1),ov=`#if !defined(LOG_DEPTH) in float v_WindowZ; #endif void czm_writeDepthClamp() @@ -1680,7 +1680,7 @@ void czm_writeDepthClamp() gl_FragDepth = clamp(v_WindowZ * gl_FragCoord.w, 0.0, 1.0); #endif } -`;var Non=x(T(),1),rv=`#ifdef LOG_DEPTH +`;var Yon=x(T(),1),rv=`#ifdef LOG_DEPTH in float v_depthFromNearPlusOne; #ifdef POLYGON_OFFSET uniform vec2 u_polygonOffset; @@ -1715,7 +1715,7 @@ void czm_writeLogDepth() { czm_writeLogDepth(v_depthFromNearPlusOne); #endif } -`;var Mon=x(T(),1),sv=`float czm_writeNonPerspective(float value, float w) { +`;var won=x(T(),1),sv=`float czm_writeNonPerspective(float value, float w) { return value * w; } vec2 czm_writeNonPerspective(vec2 value, float w) { @@ -1727,7 +1727,7 @@ return value * w; vec4 czm_writeNonPerspective(vec4 value, float w) { return value * w; } -`;var kon=x(T(),1),av=`vec3 czm_XYZToRGB(vec3 Yxy) +`;var Uon=x(T(),1),av=`vec3 czm_XYZToRGB(vec3 Yxy) { const mat3 XYZ2RGB = mat3( 3.2405, -0.9693, 0.0556, -1.5371, 1.8760, -0.2040, @@ -1738,7 +1738,7 @@ xyz.g = Yxy.r; xyz.b = Yxy.r * (1.0 - Yxy.g - Yxy.b) / Yxy.b; return XYZ2RGB * xyz; } -`;var p_={czm_degreesPerRadian:AG,czm_depthRange:GG,czm_epsilon1:LG,czm_epsilon2:WG,czm_epsilon3:vG,czm_epsilon4:FG,czm_epsilon5:IG,czm_epsilon6:PG,czm_epsilon7:XG,czm_infinity:NG,czm_oneOverPi:YG,czm_oneOverTwoPi:MG,czm_passCesium3DTile:wG,czm_passCesium3DTileClassification:kG,czm_passCesium3DTileClassificationIgnoreShow:UG,czm_passCesium3DTileEdges:DG,czm_passCesium3DTileEdgesDirect:OG,czm_passCesium3DTilePlanarFillId:BG,czm_passClassification:zG,czm_passCompute:HG,czm_passEnvironment:KG,czm_passGaussianSplats:JG,czm_passGlobe:jG,czm_passOpaque:QG,czm_passOverlay:qG,czm_passTerrainClassification:$G,czm_passTranslucent:eL,czm_passVoxels:tL,czm_pi:nL,czm_piOverFour:iL,czm_piOverSix:oL,czm_piOverThree:rL,czm_piOverTwo:sL,czm_radiansPerDegree:aL,czm_sceneMode2D:cL,czm_sceneMode3D:lL,czm_sceneModeColumbusView:dL,czm_sceneModeMorphing:uL,czm_solarRadius:mL,czm_threePiOver2:hL,czm_twoPi:fL,czm_webMercatorMaxLatitude:pL,czm_depthRangeStruct:bL,czm_material:gL,czm_materialInput:yL,czm_modelMaterial:xL,czm_modelVertexOutput:TL,czm_ray:_L,czm_raySegment:SL,czm_shadowParameters:ZL,czm_acesTonemapping:RL,czm_alphaWeight:CL,czm_antialias:VL,czm_applyHSBShift:EL,czm_approximateSphericalCoordinates:AL,czm_approximateTanh:GL,czm_backFacing:LL,czm_branchFreeTernary:WL,czm_cascadeColor:vL,czm_cascadeDistance:FL,czm_cascadeMatrix:IL,czm_cascadeWeights:PL,czm_columbusViewMorph:XL,czm_computeAtmosphereColor:NL,czm_computeGroundAtmosphereScattering:YL,czm_computePosition:ML,czm_computeScattering:wL,czm_computeTextureTransform:kL,czm_cosineAndSine:UL,czm_decodeRGB8:DL,czm_decompressTextureCoordinates:OL,czm_depthClamp:BL,czm_eastNorthUpToEyeCoordinates:zL,czm_ellipsoidContainsPoint:HL,czm_ellipsoidTextureCoordinates:KL,czm_equalsEpsilon:JL,czm_eyeOffset:jL,czm_eyeToCartographicDelta:QL,czm_eyeToWindowCoordinates:qL,czm_fastApproximateAtan:$L,czm_fog:eW,czm_gammaCorrect:tW,czm_geodeticSurfaceNormal:nW,czm_getDefaultMaterial:iW,czm_getDynamicAtmosphereLightDirection:oW,czm_getLambertDiffuse:rW,czm_getSpecular:sW,czm_getWaterNoise:aW,czm_HSBToRGB:cW,czm_HSLToRGB:lW,czm_hue:dW,czm_inverseGamma:uW,czm_isEmpty:mW,czm_isFull:hW,czm_latitudeToWebMercatorFraction:fW,czm_linearToSrgb:pW,czm_lineDistance:bW,czm_luminance:gW,czm_maximumComponent:yW,czm_metersPerPixel:xW,czm_modelToWindowCoordinates:TW,czm_multiplyWithColorBalance:_W,czm_nearFarScalar:SW,czm_octDecode:ZW,czm_packDepth:RW,czm_pbrLighting:CW,czm_pbrNeutralTonemapping:VW,czm_phong:EW,czm_planeDistance:AW,czm_pointAlongRay:GW,czm_rayEllipsoidIntersectionInterval:LW,czm_raySphereIntersectionInterval:WW,czm_readDepth:vW,czm_readNonPerspective:FW,czm_reverseLogDepth:IW,czm_RGBToHSB:PW,czm_RGBToHSL:XW,czm_RGBToXYZ:NW,czm_round:YW,czm_saturation:MW,czm_shadowDepthCompare:wW,czm_shadowVisibility:kW,czm_signNotZero:UW,czm_sphericalHarmonics:DW,czm_srgbToLinear:OW,czm_tangentToEyeSpaceMatrix:BW,czm_textureCube:zW,czm_transformPlane:HW,czm_translateRelativeToEye:KW,czm_translucentPhong:JW,czm_transpose:jW,czm_unpackDepth:QW,czm_unpackFloat:qW,czm_unpackTexture:$W,czm_unpackUint:ev,czm_valueTransform:tv,czm_vertexLogDepth:nv,czm_windowToEyeCoordinates:iv,czm_writeDepthClamp:ov,czm_writeLogDepth:rv,czm_writeNonPerspective:sv,czm_XYZToRGB:av};var Can=x(T(),1);function t5e(e,t){let n=e;return n=n.replaceAll("version 300 es",""),n=n.replaceAll(/(texture\()/g,"texture2D("),t?(n=n.replaceAll(/\n\s*(in)\s+(vec\d|mat\d|float)/g,` +`;var p_={czm_degreesPerRadian:AG,czm_depthRange:GG,czm_epsilon1:LG,czm_epsilon2:WG,czm_epsilon3:vG,czm_epsilon4:FG,czm_epsilon5:IG,czm_epsilon6:PG,czm_epsilon7:XG,czm_infinity:NG,czm_oneOverPi:YG,czm_oneOverTwoPi:MG,czm_passCesium3DTile:wG,czm_passCesium3DTileClassification:kG,czm_passCesium3DTileClassificationIgnoreShow:UG,czm_passCesium3DTileEdges:DG,czm_passCesium3DTileEdgesDirect:OG,czm_passCesium3DTilePlanarFillId:BG,czm_passClassification:zG,czm_passCompute:HG,czm_passEnvironment:KG,czm_passGaussianSplats:JG,czm_passGlobe:jG,czm_passOpaque:QG,czm_passOverlay:qG,czm_passTerrainClassification:$G,czm_passTranslucent:eL,czm_passVoxels:tL,czm_pi:nL,czm_piOverFour:iL,czm_piOverSix:oL,czm_piOverThree:rL,czm_piOverTwo:sL,czm_radiansPerDegree:aL,czm_sceneMode2D:cL,czm_sceneMode3D:lL,czm_sceneModeColumbusView:dL,czm_sceneModeMorphing:uL,czm_solarRadius:mL,czm_threePiOver2:hL,czm_twoPi:fL,czm_webMercatorMaxLatitude:pL,czm_depthRangeStruct:bL,czm_material:gL,czm_materialInput:yL,czm_modelMaterial:xL,czm_modelVertexOutput:TL,czm_ray:_L,czm_raySegment:SL,czm_shadowParameters:ZL,czm_acesTonemapping:RL,czm_alphaWeight:CL,czm_antialias:VL,czm_applyHSBShift:EL,czm_approximateSphericalCoordinates:AL,czm_approximateTanh:GL,czm_backFacing:LL,czm_branchFreeTernary:WL,czm_cascadeColor:vL,czm_cascadeDistance:FL,czm_cascadeMatrix:IL,czm_cascadeWeights:PL,czm_columbusViewMorph:XL,czm_computeAtmosphereColor:NL,czm_computeGroundAtmosphereScattering:YL,czm_computePosition:ML,czm_computeScattering:wL,czm_computeTextureTransform:kL,czm_cosineAndSine:UL,czm_decodeRGB8:DL,czm_decompressTextureCoordinates:OL,czm_depthClamp:BL,czm_eastNorthUpToEyeCoordinates:zL,czm_ellipsoidContainsPoint:HL,czm_ellipsoidTextureCoordinates:KL,czm_equalsEpsilon:JL,czm_eyeOffset:jL,czm_eyeToCartographicDelta:QL,czm_eyeToWindowCoordinates:qL,czm_fastApproximateAtan:$L,czm_fog:eW,czm_gammaCorrect:tW,czm_geodeticSurfaceNormal:nW,czm_getDefaultMaterial:iW,czm_getDynamicAtmosphereLightDirection:oW,czm_getLambertDiffuse:rW,czm_getSpecular:sW,czm_getWaterNoise:aW,czm_HSBToRGB:cW,czm_HSLToRGB:lW,czm_hue:dW,czm_inverseGamma:uW,czm_isEmpty:mW,czm_isFull:hW,czm_latitudeToWebMercatorFraction:fW,czm_linearToSrgb:pW,czm_lineDistance:bW,czm_luminance:gW,czm_maximumComponent:yW,czm_metersPerPixel:xW,czm_modelToWindowCoordinates:TW,czm_multiplyWithColorBalance:_W,czm_nearFarScalar:SW,czm_octDecode:ZW,czm_packDepth:RW,czm_pbrLighting:CW,czm_pbrNeutralTonemapping:VW,czm_phong:EW,czm_planeDistance:AW,czm_pointAlongRay:GW,czm_rayEllipsoidIntersectionInterval:LW,czm_raySphereIntersectionInterval:WW,czm_readDepth:vW,czm_readNonPerspective:FW,czm_reverseLogDepth:IW,czm_RGBToHSB:PW,czm_RGBToHSL:XW,czm_RGBToXYZ:NW,czm_round:YW,czm_saturation:MW,czm_shadowDepthCompare:wW,czm_shadowVisibility:kW,czm_signNotZero:UW,czm_sphericalHarmonics:DW,czm_srgbToLinear:OW,czm_tangentToEyeSpaceMatrix:BW,czm_textureCube:zW,czm_transformPlane:HW,czm_translateRelativeToEye:KW,czm_translucentPhong:JW,czm_transpose:jW,czm_unpackDepth:QW,czm_unpackFloat:qW,czm_unpackTexture:$W,czm_unpackUint:ev,czm_valueTransform:tv,czm_vertexLogDepth:nv,czm_windowToEyeCoordinates:iv,czm_writeDepthClamp:ov,czm_writeLogDepth:rv,czm_writeNonPerspective:sv,czm_XYZToRGB:av};var Van=x(T(),1);function n5e(e,t){let n=e;return n=n.replaceAll("version 300 es",""),n=n.replaceAll(/(texture\()/g,"texture2D("),t?(n=n.replaceAll(/\n\s*(in)\s+(vec\d|mat\d|float)/g,` varying $2`),/out_FragData_(\d+)/.test(n)&&(n=`#extension GL_EXT_draw_buffers : enable ${n}`,n=n.replaceAll(/layout\s+\(location\s*=\s*\d+\)\s*out\s+vec4\s+out_FragData_\d+;/g,""),n=n.replaceAll(/out_FragData_(\d+)/g,"gl_FragData[$1]")),n=n.replaceAll(/layout\s+\(location\s*=\s*0\)\s*out\s+vec4\s+out_FragColor;/g,""),n=n.replaceAll(/out_FragColor/g,"gl_FragColor"),n=n.replaceAll(/out_FragColor\[(\d+)\]/g,"gl_FragColor[$1]"),/gl_FragDepth/.test(n)&&(n=`#extension GL_EXT_frag_depth : enable ${n}`,n=n.replaceAll(/gl_FragDepth/g,"gl_FragDepthEXT")),n=`#ifdef GL_EXT_shader_texture_lod @@ -1748,8 +1748,8 @@ ${n}`,n=`#ifdef GL_OES_standard_derivatives #extension GL_OES_standard_derivatives : enable #endif ${n}`):(n=n.replaceAll(/(in)\s+(vec\d|mat\d|float)/g,"attribute $2"),n=n.replaceAll(/(out)\s+(vec\d|mat\d|float)\s+([\w]+);/g,"varying $2 $3;")),n=`#version 100 -${n}`,n}var cv=t5e;function ame(e){return e=e.replace(/\/\/.*/g,""),e.replace(/\/\*\*[\s\S]*?\*\//gm,function(t){let n=t.match(/\n/gm).length,i="";for(let o=0;o0;){let o=e.pop();n.push(o),o.requiredBy.length===0&&t.push(o)}for(;t.length>0;){let o=t.shift();e.push(o);for(let r=0;r=0;--o)i=`${i+t[o].glslSource} +${n}`,n}var cv=n5e;function ame(e){return e=e.replace(/\/\/.*/g,""),e.replace(/\/\*\*[\s\S]*?\*\//gm,function(t){let n=t.match(/\n/gm).length,i="";for(let o=0;o0;){let o=e.pop();n.push(o),o.requiredBy.length===0&&t.push(o)}for(;t.length>0;){let o=t.shift();e.push(o);for(let r=0;r=0;--o)i=`${i+t[o].glslSource} `;return i.replace(n.glslSource,"")}function dme(e,t,n){let i="",o=e.sources;if(l(o))for(let b=0;b-1&&i.derivedKeywords.splice(s,1)}return this.createDerivedShaderProgram(e,t,n)};kh.prototype.getDerivedShaderProgram=function(e,t){let n=e._cachedShader,i=t+n.keyword,o=this._shaders[i];if(l(o))return o.shaderProgram};kh.prototype.createDerivedShaderProgram=function(e,t,n){let i=e._cachedShader,o=t+i.keyword,r=n.vertexShaderSource,s=n.fragmentShaderSource,a=n.attributeLocations;typeof r=="string"&&(r=new Je({sources:[r]})),typeof s=="string"&&(s=new Je({sources:[s]}));let c=this._context,d=r.createCombinedVertexShader(c),u=s.createCombinedFragmentShader(c),m=new tn({gl:c._gl,logShaderCompilation:c.logShaderCompilation,debugShaders:c.debugShaders,vertexShaderSource:r,vertexShaderText:d,fragmentShaderSource:s,fragmentShaderText:u,attributeLocations:a}),p={cache:this,shaderProgram:m,keyword:o,derivedKeywords:[],count:0};return i.derivedKeywords.push(t),m._cachedShader=p,this._shaders[o]=p,m};function mQ(e,t){let n=t.derivedKeywords,i=n.length;for(let o=0;oZ5e;++r){o=i;let s=o-t*Math.sin(o)-e,a=1-t*Math.cos(o);i=o-s/a}return o=i+n*W.TWO_PI,o}function C5e(e,t){let n=Math.floor(e/W.TWO_PI);e-=n*W.TWO_PI;let i=Math.cos(e)-t,o=Math.sin(e)*Math.sqrt(1-t*t),r=Math.atan2(o,i);return r=W.zeroToTwoPi(r),e<0&&(r-=W.TWO_PI),r+=n*W.TWO_PI,r}function V5e(e,t,n,i){let o=Math.cos(e),r=Math.sin(e),s=Math.cos(t),a=Math.sin(t),c=Math.cos(n),d=Math.sin(n);return l(i)?(i[0]=c*o-d*r*s,i[1]=d*o+c*r*s,i[2]=r*a,i[3]=-c*r-d*o*s,i[4]=-d*r+c*o*s,i[5]=o*a,i[6]=d*a,i[7]=-c*a,i[8]=s):i=new q(c*o-d*r*s,-c*r-d*o*s,d*a,d*o+c*r*s,-d*r+c*o*s,-c*a,r*a,o*a,s),i}var E5e=1.0000010178*Ec,A5e=100.46645683*Am,G5e=129597742283429e-5*Tu,_me=16002,Sme=21863,Zme=32004,Rme=10931,Cme=14529,Vme=16368,Eme=15318,Ame=32794,L5e=64*1e-7*Ec,W5e=-152*1e-7*Ec,v5e=62*1e-7*Ec,F5e=-8*1e-7*Ec,I5e=32*1e-7*Ec,P5e=-41*1e-7*Ec,X5e=19*1e-7*Ec,N5e=-11*1e-7*Ec,Y5e=-150*1e-7*Ec,M5e=-46*1e-7*Ec,w5e=68*1e-7*Ec,k5e=54*1e-7*Ec,U5e=14*1e-7*Ec,D5e=24*1e-7*Ec,O5e=-28*1e-7*Ec,B5e=22*1e-7*Ec,Gme=10,Lme=16002,Wme=21863,vme=10931,Fme=1473,Ime=32004,Pme=4387,Xme=73,z5e=-325*1e-7,H5e=-322*1e-7,K5e=-79*1e-7,J5e=232*1e-7,j5e=-52*1e-7,Q5e=97*1e-7,q5e=55*1e-7,$5e=-41*1e-7,eDe=-105*1e-7,tDe=-137*1e-7,nDe=258*1e-7,iDe=35*1e-7,oDe=-116*1e-7,rDe=-88*1e-7,sDe=-112*1e-7,aDe=-80*1e-7,f1=new Q(0,0,ci.TAI);function cDe(e,t){Yme(e,f1);let i=(f1.dayNumber-eO.dayNumber+(f1.secondsOfDay-eO.secondsOfDay)/wn.SECONDS_PER_DAY)/(wn.DAYS_PER_JULIAN_CENTURY*10),o=.3595362*i,r=E5e+L5e*Math.cos(_me*o)+Y5e*Math.sin(_me*o)+W5e*Math.cos(Sme*o)+M5e*Math.sin(Sme*o)+v5e*Math.cos(Zme*o)+w5e*Math.sin(Zme*o)+F5e*Math.cos(Rme*o)+k5e*Math.sin(Rme*o)+I5e*Math.cos(Cme*o)+U5e*Math.sin(Cme*o)+P5e*Math.cos(Vme*o)+D5e*Math.sin(Vme*o)+X5e*Math.cos(Eme*o)+O5e*Math.sin(Eme*o)+N5e*Math.cos(Ame*o)+B5e*Math.sin(Ame*o),s=A5e+G5e*i+z5e*Math.cos(Gme*o)+eDe*Math.sin(Gme*o)+H5e*Math.cos(Lme*o)+tDe*Math.sin(Lme*o)+K5e*Math.cos(Wme*o)+nDe*Math.sin(Wme*o)+J5e*Math.cos(vme*o)+iDe*Math.sin(vme*o)+j5e*Math.cos(Fme*o)+oDe*Math.sin(Fme*o)+Q5e*Math.cos(Ime*o)+rDe*Math.sin(Ime*o)+q5e*Math.cos(Pme*o)+sDe*Math.sin(Pme*o)+$5e*Math.cos(Xme*o)+aDe*Math.sin(Xme*o),a=.0167086342-.0004203654*i,c=102.93734808*Am+11612.3529*Tu*i,d=469.97289*Tu*i,u=174.87317577*Am-8679.27034*Tu*i;return Mme(r,a,d,c,u,s,t)}function wme(e,t){Yme(e,f1);let i=(f1.dayNumber-eO.dayNumber+(f1.secondsOfDay-eO.secondsOfDay)/wn.SECONDS_PER_DAY)/wn.DAYS_PER_JULIAN_CENTURY,o=i*i,r=o*i,s=r*i,a=383397.7725+.004*i,c=.055545526-16e-9*i,d=5.15668983*Am,u=-8e-5*i+.02966*o-42e-6*r-13e-8*s,m=83.35324312*Am,p=146434202669e-4*i-38.2702*o-.045047*r+21301e-8*s,b=125.04455501*Am,f=-69679193631e-4*i+6.3602*o+.007625*r-3586e-8*s,y=218.31664563*Am,_=17325593434847e-4*i-6.391*o+.006588*r-3169e-8*s,S=297.85019547*Am+Tu*(1602961601209e-3*i-6.3706*o+.006593*r-3169e-8*s),Z=93.27209062*Am+Tu*(17395272628478e-4*i-12.7512*o-.001037*r+417e-8*s),R=134.96340251*Am+Tu*(17179159232178e-4*i+31.8792*o+.051635*r-2447e-7*s),C=357.52910918*Am+Tu*(1295965810481e-4*i-.5532*o+136e-6*r-1149e-8*s),E=310.17137918*Am-Tu*(6967051436e-3*i+6.2068*o+.007618*r-3219e-8*s),A=2*S,L=4*S,F=6*S,I=2*R,N=3*R,g=4*R,V=2*Z;a+=3400.4*Math.cos(A)-635.6*Math.cos(A-R)-235.6*Math.cos(R)+218.1*Math.cos(A-C)+181*Math.cos(A+R),c+=.014216*Math.cos(A-R)+.008551*Math.cos(A-I)-.001383*Math.cos(R)+.001356*Math.cos(A+R)-.001147*Math.cos(L-N)-914e-6*Math.cos(L-I)+869e-6*Math.cos(A-C-R)-627e-6*Math.cos(A)-394e-6*Math.cos(L-g)+282e-6*Math.cos(A-C-I)-279e-6*Math.cos(S-R)-236e-6*Math.cos(I)+231e-6*Math.cos(L)+229e-6*Math.cos(F-g)-201e-6*Math.cos(I-V),u+=486.26*Math.cos(A-V)-40.13*Math.cos(A)+37.51*Math.cos(V)+25.73*Math.cos(I-V)+19.97*Math.cos(A-C-V),p+=-55609*Math.sin(A-R)-34711*Math.sin(A-I)-9792*Math.sin(R)+9385*Math.sin(L-N)+7505*Math.sin(L-I)+5318*Math.sin(A+R)+3484*Math.sin(L-g)-3417*Math.sin(A-C-R)-2530*Math.sin(F-g)-2376*Math.sin(A)-2075*Math.sin(A-N)-1883*Math.sin(I)-1736*Math.sin(F-5*R)+1626*Math.sin(C)-1370*Math.sin(F-N),f+=-5392*Math.sin(A-V)-540*Math.sin(C)-441*Math.sin(A)+423*Math.sin(V)-288*Math.sin(I-V),_+=-3332.9*Math.sin(A)+1197.4*Math.sin(A-R)-662.5*Math.sin(C)+396.3*Math.sin(R)-218*Math.sin(A-C);let G=2*E,v=3*E;u+=46.997*Math.cos(E)*i-.614*Math.cos(A-V+E)*i+.614*Math.cos(A-V-E)*i-.0297*Math.cos(G)*o-.0335*Math.cos(E)*o+.0012*Math.cos(A-V+G)*o-16e-5*Math.cos(E)*r+4e-5*Math.cos(v)*r+4e-5*Math.cos(G)*r;let X=2.116*Math.sin(E)*i-.111*Math.sin(A-V-E)*i-.0015*Math.sin(E)*o;p+=X,_+=X,f+=-520.77*Math.sin(E)*i+13.66*Math.sin(A-V+E)*i+1.12*Math.sin(A-E)*i-1.06*Math.sin(V-E)*i+.66*Math.sin(G)*o+.371*Math.sin(E)*o-.035*Math.sin(A-V+G)*o-.015*Math.sin(A-V+E)*o+.0014*Math.sin(E)*r-.0011*Math.sin(v)*r-9e-4*Math.sin(G)*r,a*=x5e;let Y=d+u*Tu,D=m+p*Tu,M=y+_*Tu,O=b+f*Tu;return Mme(a,c,Y,D,O,M,t)}var Nme=.012300034,lDe=Nme/(Nme+1)*-1;function dDe(e,t){return t=wme(e,t),h.multiplyByScalar(t,lDe,t)}var kme=new q(1.0000000000000002,5619723173785822e-31,4690511510146299e-34,-5154129427414611e-31,.9174820620691819,-.39777715593191376,-223970096136568e-30,.39777715593191376,.9174820620691819),mv=new h;fQ.computeSunPositionInEarthInertialFrame=function(e,t){return l(e)||(e=Q.now()),l(t)||(t=new h),mv=cDe(e,mv),t=h.negate(mv,t),dDe(e,mv),h.subtract(t,mv,t),q.multiplyByVector(kme,t,t),t};fQ.computeMoonPositionInEarthInertialFrame=function(e,t){return l(e)||(e=Q.now()),t=wme(e,t),q.multiplyByVector(kme,t,t),t};var Iy=fQ;var Pcn=x(T(),1),hv={MORPHING:0,COLUMBUS_VIEW:1,SCENE2D:2,SCENE3D:3};hv.getMorphTime=function(e){return e===hv.SCENE3D?1:e===hv.MORPHING?void 0:0};Object.freeze(hv);var se=hv;var Mcn=x(T(),1);function uDe(e){e=e??B.EMPTY_OBJECT,this.color=U.clone(e.color??U.WHITE),this.intensity=e.intensity??2}var cb=uDe;function p1(){this.globeDepthTexture=void 0,this.edgeIdTexture=void 0,this.edgeColorTexture=void 0,this.edgeDepthTexture=void 0,this.planarFillIdTexture=void 0,this.gamma=void 0,this._viewport=new nt,this._viewportCartesian4=new ce,this._viewportDirty=!1,this._viewportOrthographicMatrix=P.clone(P.IDENTITY),this._viewportTransformation=P.clone(P.IDENTITY),this._model=P.clone(P.IDENTITY),this._view=P.clone(P.IDENTITY),this._inverseView=P.clone(P.IDENTITY),this._projection=P.clone(P.IDENTITY),this._infiniteProjection=P.clone(P.IDENTITY),this._entireFrustum=new k,this._currentFrustum=new k,this._frustumPlanes=new ce,this._farDepthFromNearPlusOne=void 0,this._log2FarDepthFromNearPlusOne=void 0,this._oneOverLog2FarDepthFromNearPlusOne=void 0,this._frameState=void 0,this._temeToPseudoFixed=q.clone(P.IDENTITY),this._view3DDirty=!0,this._view3D=new P,this._inverseView3DDirty=!0,this._inverseView3D=new P,this._inverseModelDirty=!0,this._inverseModel=new P,this._inverseTransposeModelDirty=!0,this._inverseTransposeModel=new q,this._viewRotation=new q,this._inverseViewRotation=new q,this._viewRotation3D=new q,this._inverseViewRotation3D=new q,this._inverseProjectionDirty=!0,this._inverseProjection=new P,this._modelViewDirty=!0,this._modelView=new P,this._modelView3DDirty=!0,this._modelView3D=new P,this._modelViewRelativeToEyeDirty=!0,this._modelViewRelativeToEye=new P,this._inverseModelViewDirty=!0,this._inverseModelView=new P,this._inverseModelView3DDirty=!0,this._inverseModelView3D=new P,this._viewProjectionDirty=!0,this._viewProjection=new P,this._inverseViewProjectionDirty=!0,this._inverseViewProjection=new P,this._modelViewProjectionDirty=!0,this._modelViewProjection=new P,this._inverseModelViewProjectionDirty=!0,this._inverseModelViewProjection=new P,this._modelViewProjectionRelativeToEyeDirty=!0,this._modelViewProjectionRelativeToEye=new P,this._modelViewInfiniteProjectionDirty=!0,this._modelViewInfiniteProjection=new P,this._normalDirty=!0,this._normal=new q,this._normal3DDirty=!0,this._normal3D=new q,this._inverseNormalDirty=!0,this._inverseNormal=new q,this._inverseNormal3DDirty=!0,this._inverseNormal3D=new q,this._encodedCameraPositionMCDirty=!0,this._encodedCameraPositionMC=new An,this._cameraPosition=new h,this._sunPositionWC=new h,this._sunPositionColumbusView=new h,this._sunDirectionWC=new h,this._sunDirectionEC=new h,this._moonDirectionEC=new h,this._lightDirectionWC=new h,this._lightDirectionEC=new h,this._lightColor=new h,this._lightColorHdr=new h,this._pass=void 0,this._mode=void 0,this._mapProjection=void 0,this._ellipsoid=void 0,this._cameraDirection=new h,this._cameraRight=new h,this._cameraUp=new h,this._frustum2DWidth=0,this._eyeHeight=0,this._eyeHeight2D=new k,this._eyeCartographic=new h,this._eyeEllipsoidNormalEC=new h,this._eyeEllipsoidCurvature=new k,this._eyeToEnu=new q,this._modelToEnu=new P,this._enuToModel=new P,this._pixelRatio=1,this._orthographicIn3D=!1,this._backgroundColor=new U,this._brdfLut=void 0,this._environmentMap=void 0,this._sphericalHarmonicCoefficients=void 0,this._specularEnvironmentMaps=void 0,this._specularEnvironmentMapsMaximumLOD=void 0,this._fogDensity=void 0,this._fogVisualDensityScalar=void 0,this._fogMinimumBrightness=void 0,this._atmosphereHsbShift=void 0,this._atmosphereLightIntensity=void 0,this._atmosphereRayleighCoefficient=new h,this._atmosphereRayleighScaleHeight=new h,this._atmosphereMieCoefficient=new h,this._atmosphereMieScaleHeight=void 0,this._atmosphereMieAnisotropy=void 0,this._atmosphereDynamicLighting=void 0,this._invertClassificationColor=void 0,this._splitPosition=0,this._pixelSizePerMeter=void 0,this._geometricToleranceOverMeter=void 0,this._minimumDisableDepthTestDistance=void 0}Object.defineProperties(p1.prototype,{frameState:{get:function(){return this._frameState}},viewport:{get:function(){return this._viewport},set:function(e){if(!nt.equals(e,this._viewport)){nt.clone(e,this._viewport);let t=this._viewport,n=this._viewportCartesian4;n.x=t.x,n.y=t.y,n.z=t.width,n.w=t.height,this._viewportDirty=!0}}},viewportCartesian4:{get:function(){return this._viewportCartesian4}},viewportOrthographic:{get:function(){return Ome(this),this._viewportOrthographicMatrix}},viewportTransformation:{get:function(){return Ome(this),this._viewportTransformation}},model:{get:function(){return this._model},set:function(e){P.clone(e,this._model),this._modelView3DDirty=!0,this._inverseModelView3DDirty=!0,this._inverseModelDirty=!0,this._inverseTransposeModelDirty=!0,this._modelViewDirty=!0,this._inverseModelViewDirty=!0,this._modelViewRelativeToEyeDirty=!0,this._inverseModelViewDirty=!0,this._modelViewProjectionDirty=!0,this._inverseModelViewProjectionDirty=!0,this._modelViewProjectionRelativeToEyeDirty=!0,this._modelViewInfiniteProjectionDirty=!0,this._normalDirty=!0,this._inverseNormalDirty=!0,this._normal3DDirty=!0,this._inverseNormal3DDirty=!0,this._encodedCameraPositionMCDirty=!0}},inverseModel:{get:function(){return this._inverseModelDirty&&(this._inverseModelDirty=!1,P.inverse(this._model,this._inverseModel)),this._inverseModel}},inverseTransposeModel:{get:function(){let e=this._inverseTransposeModel;return this._inverseTransposeModelDirty&&(this._inverseTransposeModelDirty=!1,P.getMatrix3(this.inverseModel,e),q.transpose(e,e)),e}},view:{get:function(){return this._view}},view3D:{get:function(){return bQ(this),this._view3D}},viewRotation:{get:function(){return bQ(this),this._viewRotation}},viewRotation3D:{get:function(){return bQ(this),this._viewRotation3D}},inverseView:{get:function(){return this._inverseView}},inverseView3D:{get:function(){return Hme(this),this._inverseView3D}},inverseViewRotation:{get:function(){return this._inverseViewRotation}},inverseViewRotation3D:{get:function(){return Hme(this),this._inverseViewRotation3D}},projection:{get:function(){return this._projection}},inverseProjection:{get:function(){return SDe(this),this._inverseProjection}},infiniteProjection:{get:function(){return this._infiniteProjection}},modelView:{get:function(){return ZDe(this),this._modelView}},modelView3D:{get:function(){return RDe(this),this._modelView3D}},modelViewRelativeToEye:{get:function(){return LDe(this),this._modelViewRelativeToEye}},inverseModelView:{get:function(){return CDe(this),this._inverseModelView}},inverseModelView3D:{get:function(){return VDe(this),this._inverseModelView3D}},viewProjection:{get:function(){return EDe(this),this._viewProjection}},inverseViewProjection:{get:function(){return ADe(this),this._inverseViewProjection}},modelViewProjection:{get:function(){return GDe(this),this._modelViewProjection}},inverseModelViewProjection:{get:function(){return WDe(this),this._inverseModelViewProjection}},modelViewProjectionRelativeToEye:{get:function(){return vDe(this),this._modelViewProjectionRelativeToEye}},modelViewInfiniteProjection:{get:function(){return FDe(this),this._modelViewInfiniteProjection}},normal:{get:function(){return IDe(this),this._normal}},normal3D:{get:function(){return PDe(this),this._normal3D}},inverseNormal:{get:function(){return XDe(this),this._inverseNormal}},inverseNormal3D:{get:function(){return NDe(this),this._inverseNormal3D}},entireFrustum:{get:function(){return this._entireFrustum}},currentFrustum:{get:function(){return this._currentFrustum}},frustumPlanes:{get:function(){return this._frustumPlanes}},farDepthFromNearPlusOne:{get:function(){return this._farDepthFromNearPlusOne}},log2FarDepthFromNearPlusOne:{get:function(){return this._log2FarDepthFromNearPlusOne}},oneOverLog2FarDepthFromNearPlusOne:{get:function(){return this._oneOverLog2FarDepthFromNearPlusOne}},eyeHeight:{get:function(){return this._eyeHeight}},eyeCartographic:{get:function(){return this._eyeCartographic}},eyeHeight2D:{get:function(){return this._eyeHeight2D}},eyeEllipsoidNormalEC:{get:function(){return this._eyeEllipsoidNormalEC}},eyeEllipsoidCurvature:{get:function(){return this._eyeEllipsoidCurvature}},eyeToEnu:{get:function(){return this._eyeToEnu}},modelToEnu:{get:function(){return this._modelToEnu}},enuToModel:{get:function(){return this._enuToModel}},sunPositionWC:{get:function(){return this._sunPositionWC}},sunPositionColumbusView:{get:function(){return this._sunPositionColumbusView}},sunDirectionWC:{get:function(){return this._sunDirectionWC}},sunDirectionEC:{get:function(){return this._sunDirectionEC}},moonDirectionEC:{get:function(){return this._moonDirectionEC}},lightDirectionWC:{get:function(){return this._lightDirectionWC}},lightDirectionEC:{get:function(){return this._lightDirectionEC}},lightColor:{get:function(){return this._lightColor}},lightColorHdr:{get:function(){return this._lightColorHdr}},encodedCameraPositionMCHigh:{get:function(){return zme(this),this._encodedCameraPositionMC.high}},encodedCameraPositionMCLow:{get:function(){return zme(this),this._encodedCameraPositionMC.low}},temeToPseudoFixedMatrix:{get:function(){return this._temeToPseudoFixed}},pixelRatio:{get:function(){return this._pixelRatio}},fogDensity:{get:function(){return this._fogDensity}},fogVisualDensityScalar:{get:function(){return this._fogVisualDensityScalar}},fogMinimumBrightness:{get:function(){return this._fogMinimumBrightness}},atmosphereHsbShift:{get:function(){return this._atmosphereHsbShift}},atmosphereLightIntensity:{get:function(){return this._atmosphereLightIntensity}},atmosphereRayleighCoefficient:{get:function(){return this._atmosphereRayleighCoefficient}},atmosphereRayleighScaleHeight:{get:function(){return this._atmosphereRayleighScaleHeight}},atmosphereMieCoefficient:{get:function(){return this._atmosphereMieCoefficient}},atmosphereMieScaleHeight:{get:function(){return this._atmosphereMieScaleHeight}},atmosphereMieAnisotropy:{get:function(){return this._atmosphereMieAnisotropy}},atmosphereDynamicLighting:{get:function(){return this._atmosphereDynamicLighting}},geometricToleranceOverMeter:{get:function(){return this._geometricToleranceOverMeter}},pass:{get:function(){return this._pass}},backgroundColor:{get:function(){return this._backgroundColor}},brdfLut:{get:function(){return this._brdfLut}},environmentMap:{get:function(){return this._environmentMap}},sphericalHarmonicCoefficients:{get:function(){return this._sphericalHarmonicCoefficients}},specularEnvironmentMaps:{get:function(){return this._specularEnvironmentMaps}},specularEnvironmentMapsMaximumLOD:{get:function(){return this._specularEnvironmentMapsMaximumLOD}},splitPosition:{get:function(){return this._splitPosition}},minimumDisableDepthTestDistance:{get:function(){return this._minimumDisableDepthTestDistance}},invertClassificationColor:{get:function(){return this._invertClassificationColor}},orthographicIn3D:{get:function(){return this._orthographicIn3D}},ellipsoid:{get:function(){return this._ellipsoid??ne.default}}});function mDe(e,t){P.clone(t,e._view),P.getMatrix3(t,e._viewRotation),e._view3DDirty=!0,e._inverseView3DDirty=!0,e._modelViewDirty=!0,e._modelView3DDirty=!0,e._modelViewRelativeToEyeDirty=!0,e._inverseModelViewDirty=!0,e._inverseModelView3DDirty=!0,e._viewProjectionDirty=!0,e._inverseViewProjectionDirty=!0,e._modelViewProjectionDirty=!0,e._modelViewProjectionRelativeToEyeDirty=!0,e._modelViewInfiniteProjectionDirty=!0,e._normalDirty=!0,e._inverseNormalDirty=!0,e._normal3DDirty=!0,e._inverseNormal3DDirty=!0}function hDe(e,t){P.clone(t,e._inverseView),P.getMatrix3(t,e._inverseViewRotation)}function fDe(e,t){P.clone(t,e._projection),e._inverseProjectionDirty=!0,e._viewProjectionDirty=!0,e._inverseViewProjectionDirty=!0,e._modelViewProjectionDirty=!0,e._modelViewProjectionRelativeToEyeDirty=!0}function pDe(e,t){P.clone(t,e._infiniteProjection),e._modelViewInfiniteProjectionDirty=!0}var Ume=new h,bDe=new P,Dme=new q;function gDe(e,t){h.clone(t.positionWC,e._cameraPosition),h.clone(t.directionWC,e._cameraDirection),h.clone(t.rightWC,e._cameraRight),h.clone(t.upWC,e._cameraUp);let n=e._ellipsoid,i,o=t.positionCartographic;if(l(o)?(e._eyeHeight=o.height,e._eyeCartographic=h.fromElements(o.longitude,o.latitude,o.height,e._eyeCartographic),e._eyeEllipsoidNormalEC=n.geodeticSurfaceNormalCartographic(o,e._eyeEllipsoidNormalEC),i=h.fromRadians(o.longitude,o.latitude,0,n,Ume)):(e._eyeHeight=-n.maximumRadius,h.magnitude(t.positionWC)>0&&(e._eyeEllipsoidNormalEC=h.normalize(t.positionWC,e._eyeEllipsoidNormalEC)),i=n.scaleToGeodeticSurface(t.positionWC,Ume)),e._encodedCameraPositionMCDirty=!0,!l(i))return;e._eyeEllipsoidNormalEC=q.multiplyByVector(e._viewRotation,e._eyeEllipsoidNormalEC,e._eyeEllipsoidNormalEC);let r=_t.eastNorthUpToFixedFrame(i,n,bDe);e._enuToModel=P.multiplyTransformation(e.inverseModel,r,e._enuToModel),e._modelToEnu=P.inverseTransformation(e._enuToModel,e._modelToEnu);let s=P.getRotation(r,Dme),a=q.multiply(e._viewRotation,s,Dme);e._eyeToEnu=q.transpose(a,e._eyeToEnu),W.equalsEpsilon(n._radii.x,n._radii.y,W.EPSILON15)&&(e._eyeEllipsoidCurvature=n.getLocalCurvature(i,e._eyeEllipsoidCurvature))}var pQ=new q,yDe=new pe;function xDe(e,t){_t.computeIcrfToCentralBodyFixedMatrix(t.time,pQ);let n=Iy.computeSunPositionInEarthInertialFrame(t.time,e._sunPositionWC);q.multiplyByVector(pQ,n,n),h.normalize(n,e._sunDirectionWC),n=q.multiplyByVector(e.viewRotation3D,n,e._sunDirectionEC),h.normalize(n,n),n=Iy.computeMoonPositionInEarthInertialFrame(t.time,e._moonDirectionEC),q.multiplyByVector(pQ,n,n),q.multiplyByVector(e.viewRotation3D,n,n),h.normalize(n,n);let i=t.mapProjection,r=i.ellipsoid.cartesianToCartographic(e._sunPositionWC,yDe);i.project(r,e._sunPositionColumbusView)}p1.prototype.updateCamera=function(e){mDe(this,e.viewMatrix),hDe(this,e.inverseViewMatrix),gDe(this,e),this._entireFrustum.x=e.frustum.near,this._entireFrustum.y=e.frustum.far,this.updateFrustum(e.frustum),this._orthographicIn3D=this._mode!==se.SCENE2D&&e.frustum instanceof yn};p1.prototype.updateFrustum=function(e){fDe(this,e.projectionMatrix),l(e.infiniteProjectionMatrix)&&pDe(this,e.infiniteProjectionMatrix),this._currentFrustum.x=e.near,this._currentFrustum.y=e.far,this._farDepthFromNearPlusOne=e.far-e.near+1,this._log2FarDepthFromNearPlusOne=W.log2(this._farDepthFromNearPlusOne),this._oneOverLog2FarDepthFromNearPlusOne=1/this._log2FarDepthFromNearPlusOne;let t=e.offCenterFrustum;l(t)&&(e=t),this._frustumPlanes.x=e.top,this._frustumPlanes.y=e.bottom,this._frustumPlanes.z=e.left,this._frustumPlanes.w=e.right};p1.prototype.updatePass=function(e){this._pass=e};var TDe=[],_De=new cb;p1.prototype.update=function(e){this._mode=e.mode,this._mapProjection=e.mapProjection,this._ellipsoid=e.mapProjection.ellipsoid,this._pixelRatio=e.pixelRatio;let t=e.camera;this.updateCamera(t),e.mode===se.SCENE2D?(this._frustum2DWidth=t.frustum.right-t.frustum.left,this._eyeHeight2D.x=this._frustum2DWidth*.5,this._eyeHeight2D.y=this._eyeHeight2D.x*this._eyeHeight2D.x):(this._frustum2DWidth=0,this._eyeHeight2D.x=0,this._eyeHeight2D.y=0),xDe(this,e);let n=e.light??_De;n instanceof cb?(this._lightDirectionWC=h.clone(this._sunDirectionWC,this._lightDirectionWC),this._lightDirectionEC=h.clone(this._sunDirectionEC,this._lightDirectionEC)):(this._lightDirectionWC=h.normalize(h.negate(n.direction,this._lightDirectionWC),this._lightDirectionWC),this._lightDirectionEC=q.multiplyByVector(this.viewRotation3D,this._lightDirectionWC,this._lightDirectionEC));let i=n.color,o=h.fromElements(i.red,i.green,i.blue,this._lightColorHdr);o=h.multiplyByScalar(o,n.intensity,o);let r=h.maximumComponent(o);r>1?h.divideByScalar(o,r,this._lightColor):h.clone(o,this._lightColor);let s=e.brdfLutGenerator,a=l(s)?s.colorTexture:void 0;this._brdfLut=a,this._environmentMap=e.environmentMap??e.context.defaultCubeMap,this._sphericalHarmonicCoefficients=e.sphericalHarmonicCoefficients??TDe,this._specularEnvironmentMaps=e.specularEnvironmentMaps,this._specularEnvironmentMapsMaximumLOD=e.specularEnvironmentMapsMaximumLOD,this._fogDensity=e.fog.density,this._fogVisualDensityScalar=e.fog.visualDensityScalar,this._fogMinimumBrightness=e.fog.minimumBrightness;let c=e.atmosphere;l(c)&&(this._atmosphereHsbShift=h.fromElements(c.hueShift,c.saturationShift,c.brightnessShift,this._atmosphereHsbShift),this._atmosphereLightIntensity=c.lightIntensity,this._atmosphereRayleighCoefficient=h.clone(c.rayleighCoefficient,this._atmosphereRayleighCoefficient),this._atmosphereRayleighScaleHeight=c.rayleighScaleHeight,this._atmosphereMieCoefficient=h.clone(c.mieCoefficient,this._atmosphereMieCoefficient),this._atmosphereMieScaleHeight=c.mieScaleHeight,this._atmosphereMieAnisotropy=c.mieAnisotropy,this._atmosphereDynamicLighting=c.dynamicLighting),this._invertClassificationColor=e.invertClassificationColor,this._frameState=e,this._temeToPseudoFixed=_t.computeTemeToPseudoFixedMatrix(e.time,this._temeToPseudoFixed),this._splitPosition=e.splitPosition*e.context.drawingBufferWidth;let d=t.frustum.fov,u=this._viewport,m;l(d)?u.height>u.width?m=Math.tan(.5*d)*2/u.height:m=Math.tan(.5*d)*2/u.width:m=1/Math.max(u.width,u.height),this._geometricToleranceOverMeter=m*e.maximumScreenSpaceError,U.clone(e.backgroundColor,this._backgroundColor),this._minimumDisableDepthTestDistance=e.minimumDisableDepthTestDistance,this._minimumDisableDepthTestDistance*=this._minimumDisableDepthTestDistance,this._minimumDisableDepthTestDistance===Number.POSITIVE_INFINITY&&(this._minimumDisableDepthTestDistance=-1)};function Ome(e){if(e._viewportDirty){let t=e._viewport;P.computeOrthographicOffCenter(t.x,t.x+t.width,t.y,t.y+t.height,0,1,e._viewportOrthographicMatrix),P.computeViewportTransformation(t,0,1,e._viewportTransformation),e._viewportDirty=!1}}function SDe(e){e._inverseProjectionDirty&&(e._inverseProjectionDirty=!1,e._mode!==se.SCENE2D&&e._mode!==se.MORPHING&&!e._orthographicIn3D?P.inverse(e._projection,e._inverseProjection):P.clone(P.ZERO,e._inverseProjection))}function ZDe(e){e._modelViewDirty&&(e._modelViewDirty=!1,P.multiplyTransformation(e._view,e._model,e._modelView))}function RDe(e){e._modelView3DDirty&&(e._modelView3DDirty=!1,P.multiplyTransformation(e.view3D,e._model,e._modelView3D))}function CDe(e){e._inverseModelViewDirty&&(e._inverseModelViewDirty=!1,P.inverse(e.modelView,e._inverseModelView))}function VDe(e){e._inverseModelView3DDirty&&(e._inverseModelView3DDirty=!1,P.inverse(e.modelView3D,e._inverseModelView3D))}function EDe(e){e._viewProjectionDirty&&(e._viewProjectionDirty=!1,P.multiply(e._projection,e._view,e._viewProjection))}function ADe(e){e._inverseViewProjectionDirty&&(e._inverseViewProjectionDirty=!1,P.inverse(e.viewProjection,e._inverseViewProjection))}function GDe(e){e._modelViewProjectionDirty&&(e._modelViewProjectionDirty=!1,P.multiply(e._projection,e.modelView,e._modelViewProjection))}function LDe(e){if(e._modelViewRelativeToEyeDirty){e._modelViewRelativeToEyeDirty=!1;let t=e.modelView,n=e._modelViewRelativeToEye;n[0]=t[0],n[1]=t[1],n[2]=t[2],n[3]=t[3],n[4]=t[4],n[5]=t[5],n[6]=t[6],n[7]=t[7],n[8]=t[8],n[9]=t[9],n[10]=t[10],n[11]=t[11],n[12]=0,n[13]=0,n[14]=0,n[15]=t[15]}}function WDe(e){e._inverseModelViewProjectionDirty&&(e._inverseModelViewProjectionDirty=!1,P.inverse(e.modelViewProjection,e._inverseModelViewProjection))}function vDe(e){e._modelViewProjectionRelativeToEyeDirty&&(e._modelViewProjectionRelativeToEyeDirty=!1,P.multiply(e._projection,e.modelViewRelativeToEye,e._modelViewProjectionRelativeToEye))}function FDe(e){e._modelViewInfiniteProjectionDirty&&(e._modelViewInfiniteProjectionDirty=!1,P.multiply(e._infiniteProjection,e.modelView,e._modelViewInfiniteProjection))}function IDe(e){if(e._normalDirty){e._normalDirty=!1;let t=e._normal;P.getMatrix3(e.inverseModelView,t),q.transpose(t,t)}}function PDe(e){if(e._normal3DDirty){e._normal3DDirty=!1;let t=e._normal3D;P.getMatrix3(e.inverseModelView3D,t),q.transpose(t,t)}}function XDe(e){if(e._inverseNormalDirty){e._inverseNormalDirty=!1;let t=e._inverseNormal;P.getMatrix3(e.modelView,t),q.transpose(t,t)}}function NDe(e){if(e._inverseNormal3DDirty){e._inverseNormal3DDirty=!1;let t=e._inverseNormal3D;P.getMatrix3(e.modelView3D,t),q.transpose(t,t)}}var Bme=new h;function zme(e){e._encodedCameraPositionMCDirty&&(e._encodedCameraPositionMCDirty=!1,P.multiplyByPoint(e.inverseModel,e._cameraPosition,Bme),An.fromCartesian(Bme,e._encodedCameraPositionMC))}var YDe=new h,MDe=new h,wDe=new h,kDe=new h,UDe=new pe,DDe=new h,ODe=new P;function BDe(e,t,n,i,o,r,s,a){let c=YDe;c.x=e.y,c.y=e.z,c.z=e.x;let d=MDe;d.x=n.y,d.y=n.z,d.z=n.x;let u=wDe;u.x=i.y,u.y=i.z,u.z=i.x;let m=kDe;m.x=t.y,m.y=t.z,m.z=t.x,r===se.SCENE2D&&(c.z=o*.5);let p=s.unproject(c,UDe);p.longitude=W.clamp(p.longitude,-Math.PI,Math.PI),p.latitude=W.clamp(p.latitude,-W.PI_OVER_TWO,W.PI_OVER_TWO);let b=s.ellipsoid,f=b.cartographicToCartesian(p,DDe),y=_t.eastNorthUpToFixedFrame(f,b,ODe);return P.multiplyByPointAsVector(y,d,d),P.multiplyByPointAsVector(y,u,u),P.multiplyByPointAsVector(y,m,m),l(a)||(a=new P),a[0]=d.x,a[1]=u.x,a[2]=-m.x,a[3]=0,a[4]=d.y,a[5]=u.y,a[6]=-m.y,a[7]=0,a[8]=d.z,a[9]=u.z,a[10]=-m.z,a[11]=0,a[12]=-h.dot(d,f),a[13]=-h.dot(u,f),a[14]=h.dot(m,f),a[15]=1,a}function bQ(e){e._view3DDirty&&(e._mode===se.SCENE3D?P.clone(e._view,e._view3D):BDe(e._cameraPosition,e._cameraDirection,e._cameraRight,e._cameraUp,e._frustum2DWidth,e._mode,e._mapProjection,e._view3D),P.getMatrix3(e._view3D,e._viewRotation3D),e._view3DDirty=!1)}function Hme(e){e._inverseView3DDirty&&(P.inverseTransformation(e.view3D,e._inverseView3D),P.getMatrix3(e._inverseView3D,e._inverseViewRotation3D),e._inverseView3DDirty=!1)}var fv=p1;function Ld(e,t){let{getWebGLStub:n,requestWebgl1:i,webgl:o={},allowTextureFilterAnisotropic:r=!0,transparentDefaultTexture:s=!1}=t??{};o.alpha=o.alpha??!1,o.stencil=o.stencil??!0,o.powerPreference=o.powerPreference??"high-performance";let a=l(n)?n(e,o):zDe(e,o,i),d=typeof WebGL2RenderingContext<"u"&&a instanceof WebGL2RenderingContext;this._canvas=e,this._originalGLContext=a,this._gl=a,this._webgl2=d,this._id=Qn(),this.validateFramebuffer=!1,this.validateShaderProgram=!1,this.logShaderCompilation=!1,this._throwOnWebGLError=!1,this._shaderCache=new lv(this),this._textureCache=new dv,this._transparentDefaultTexture=s;let u=a;this._stencilBits=u.getParameter(u.STENCIL_BITS),wt._maximumCombinedTextureImageUnits=u.getParameter(u.MAX_COMBINED_TEXTURE_IMAGE_UNITS),wt._maximumCubeMapSize=u.getParameter(u.MAX_CUBE_MAP_TEXTURE_SIZE),wt._maximumFragmentUniformVectors=u.getParameter(u.MAX_FRAGMENT_UNIFORM_VECTORS),wt._maximumTextureImageUnits=u.getParameter(u.MAX_TEXTURE_IMAGE_UNITS),wt._maximumRenderbufferSize=u.getParameter(u.MAX_RENDERBUFFER_SIZE),wt._maximumTextureSize=u.getParameter(u.MAX_TEXTURE_SIZE),wt._maximum3DTextureSize=u.getParameter(u.MAX_3D_TEXTURE_SIZE),wt._maximumVaryingVectors=u.getParameter(u.MAX_VARYING_VECTORS),wt._maximumVertexAttributes=u.getParameter(u.MAX_VERTEX_ATTRIBS),wt._maximumVertexTextureImageUnits=u.getParameter(u.MAX_VERTEX_TEXTURE_IMAGE_UNITS),wt._maximumVertexUniformVectors=u.getParameter(u.MAX_VERTEX_UNIFORM_VECTORS),wt._maximumSamples=this._webgl2?u.getParameter(u.MAX_SAMPLES):0;let m=u.getParameter(u.ALIASED_LINE_WIDTH_RANGE);wt._minimumAliasedLineWidth=m[0],wt._maximumAliasedLineWidth=m[1];let p=u.getParameter(u.ALIASED_POINT_SIZE_RANGE);wt._minimumAliasedPointSize=p[0],wt._maximumAliasedPointSize=p[1];let b=u.getParameter(u.MAX_VIEWPORT_DIMS);wt._maximumViewportWidth=b[0],wt._maximumViewportHeight=b[1];let f=u.getShaderPrecisionFormat(u.FRAGMENT_SHADER,u.HIGH_FLOAT);wt._highpFloatSupported=f.precision!==0;let y=u.getShaderPrecisionFormat(u.FRAGMENT_SHADER,u.HIGH_INT);wt._highpIntSupported=y.rangeMax!==0,this._antialias=u.getContextAttributes().antialias,this._standardDerivatives=!!ts(u,["OES_standard_derivatives"]),this._blendMinmax=!!ts(u,["EXT_blend_minmax"]),this._elementIndexUint=!!ts(u,["OES_element_index_uint"]),this._depthTexture=!!ts(u,["WEBGL_depth_texture","WEBKIT_WEBGL_depth_texture"]),this._fragDepth=!!ts(u,["EXT_frag_depth"]),this._debugShaders=ts(u,["WEBGL_debug_shaders"]),this._textureFloat=!!ts(u,["OES_texture_float"]),this._textureHalfFloat=!!ts(u,["OES_texture_half_float"]),this._textureFloatLinear=!!ts(u,["OES_texture_float_linear"]),this._textureHalfFloatLinear=!!ts(u,["OES_texture_half_float_linear"]),this._supportsTextureLod=!!ts(u,["EXT_shader_texture_lod"]),this._colorBufferFloat=!!ts(u,["EXT_color_buffer_float","WEBGL_color_buffer_float"]),this._floatBlend=!!ts(u,["EXT_float_blend"]),this._colorBufferHalfFloat=!!ts(u,["EXT_color_buffer_half_float"]),this._s3tc=!!ts(u,["WEBGL_compressed_texture_s3tc","MOZ_WEBGL_compressed_texture_s3tc","WEBKIT_WEBGL_compressed_texture_s3tc"]),this._pvrtc=!!ts(u,["WEBGL_compressed_texture_pvrtc","WEBKIT_WEBGL_compressed_texture_pvrtc"]),this._astc=!!ts(u,["WEBGL_compressed_texture_astc"]),this._etc=!!ts(u,["WEBG_compressed_texture_etc"]),this._etc1=!!ts(u,["WEBGL_compressed_texture_etc1"]),this._bc7=!!ts(u,["EXT_texture_compression_bptc"]),Ad.setKTX2SupportedFormats(this._s3tc,this._pvrtc,this._astc,this._etc,this._etc1,this._bc7);let _=r?ts(u,["EXT_texture_filter_anisotropic","WEBKIT_EXT_texture_filter_anisotropic"]):void 0;this._textureFilterAnisotropic=_,wt._maximumTextureFilterAnisotropy=l(_)?u.getParameter(_.MAX_TEXTURE_MAX_ANISOTROPY_EXT):1;let S,Z,R,C,E,A,L,F,I,N;if(d){let v=this;S=function(){return v._gl.createVertexArray()},Z=function(X){v._gl.bindVertexArray(X)},R=function(X){v._gl.deleteVertexArray(X)},C=function(X,Y,D,M,O){u.drawElementsInstanced(X,Y,D,M,O)},E=function(X,Y,D,M){u.drawArraysInstanced(X,Y,D,M)},A=function(X,Y){u.vertexAttribDivisor(X,Y)},L=function(X){u.drawBuffers(X)}}else F=ts(u,["OES_vertex_array_object"]),l(F)&&(S=function(){return F.createVertexArrayOES()},Z=function(v){F.bindVertexArrayOES(v)},R=function(v){F.deleteVertexArrayOES(v)}),I=ts(u,["ANGLE_instanced_arrays"]),l(I)&&(C=function(v,X,Y,D,M){I.drawElementsInstancedANGLE(v,X,Y,D,M)},E=function(v,X,Y,D){I.drawArraysInstancedANGLE(v,X,Y,D)},A=function(v,X){I.vertexAttribDivisorANGLE(v,X)}),N=ts(u,["WEBGL_draw_buffers"]),l(N)&&(L=function(v){N.drawBuffersWEBGL(v)});this.glCreateVertexArray=S,this.glBindVertexArray=Z,this.glDeleteVertexArray=R,this.glDrawElementsInstanced=C,this.glDrawArraysInstanced=E,this.glVertexAttribDivisor=A,this.glDrawBuffers=L,this._vertexArrayObject=!!F,this._instancedArrays=!!I,this._drawBuffers=!!N,wt._maximumDrawBuffers=this.drawBuffers?u.getParameter(ie.MAX_DRAW_BUFFERS):1,wt._maximumColorAttachments=this.drawBuffers?u.getParameter(ie.MAX_COLOR_ATTACHMENTS):1,this._clearColor=new U(0,0,0,0),this._clearDepth=1,this._clearStencil=0;let g=new fv,V=new oc(this),G=ze.fromCache();this._defaultPassState=V,this._defaultRenderState=G,this._defaultTexture=void 0,this._defaultEmissiveTexture=void 0,this._defaultNormalTexture=void 0,this._defaultCubeMap=void 0,this._us=g,this._currentRenderState=G,this._currentPassState=V,this._currentFramebuffer=void 0,this._maxFrameTextureUnitIndex=0,this._vertexAttribDivisors=[],this._previousDrawInstanced=!1;for(let v=0;v"u")throw new ae("The browser does not support WebGL. Visit http://get.webgl.org.");!n&&!(typeof WebGL2RenderingContext<"u")&&(n=!0);let o=n?"webgl":"webgl2",r=e.getContext(o,t);if(!l(r))throw new ae("The browser supports WebGL, but initialization failed.");return r}function HDe(e,t){let n="WebGL Error: ";switch(t){case e.INVALID_ENUM:n+="INVALID_ENUM";break;case e.INVALID_VALUE:n+="INVALID_VALUE";break;case e.INVALID_OPERATION:n+="INVALID_OPERATION";break;case e.OUT_OF_MEMORY:n+="OUT_OF_MEMORY";break;case e.CONTEXT_LOST_WEBGL:n+="CONTEXT_LOST_WEBGL lost";break;default:n+=`Unknown (${t})`}return n}function KDe(e,t,n,i){let o=`${HDe(e,i)}: ${t.name}(`;for(let r=0;r=8}},antialias:{get:function(){return this._antialias}},msaa:{get:function(){return this._webgl2}},standardDerivatives:{get:function(){return this._standardDerivatives||this._webgl2}},floatBlend:{get:function(){return this._floatBlend}},blendMinmax:{get:function(){return this._blendMinmax||this._webgl2}},elementIndexUint:{get:function(){return this._elementIndexUint||this._webgl2}},depthTexture:{get:function(){return this._depthTexture||this._webgl2}},floatingPointTexture:{get:function(){return this._webgl2||this._textureFloat}},halfFloatingPointTexture:{get:function(){return this._webgl2||this._textureHalfFloat}},textureFloatLinear:{get:function(){return this._textureFloatLinear}},textureHalfFloatLinear:{get:function(){return this._webgl2&&this._textureFloatLinear||!this._webgl2&&this._textureHalfFloatLinear}},supportsTextureLod:{get:function(){return this._webgl2||this._supportsTextureLod}},textureFilterAnisotropic:{get:function(){return!!this._textureFilterAnisotropic}},s3tc:{get:function(){return this._s3tc}},pvrtc:{get:function(){return this._pvrtc}},astc:{get:function(){return this._astc}},etc:{get:function(){return this._etc}},etc1:{get:function(){return this._etc1}},bc7:{get:function(){return this._bc7}},supportsBasis:{get:function(){return this._s3tc||this._pvrtc||this._astc||this._etc||this._etc1||this._bc7}},vertexArrayObject:{get:function(){return this._vertexArrayObject||this._webgl2}},fragmentDepth:{get:function(){return this._fragDepth||this._webgl2}},instancedArrays:{get:function(){return this._instancedArrays||this._webgl2}},colorBufferFloat:{get:function(){return this._colorBufferFloat}},colorBufferHalfFloat:{get:function(){return this._webgl2&&this._colorBufferFloat||!this._webgl2&&this._colorBufferHalfFloat}},drawBuffers:{get:function(){return this._drawBuffers||this._webgl2}},debugShaders:{get:function(){return this._debugShaders}},throwOnWebGLError:{get:function(){return this._throwOnWebGLError},set:function(e){this._throwOnWebGLError=e,this._gl=QDe(this._originalGLContext,e?JDe:void 0)}},defaultTexture:{get:function(){if(this._defaultTexture===void 0){let e=vt.defaultColor;this._defaultTexture=new vt({context:this,source:{width:1,height:1,arrayBufferView:new Uint8Array([e.red*255,e.green*255,e.blue*255,this._transparentDefaultTexture?0:e.alpha*255])},flipY:!1})}return this._defaultTexture}},defaultEmissiveTexture:{get:function(){return this._defaultEmissiveTexture===void 0&&(this._defaultEmissiveTexture=new vt({context:this,pixelFormat:Qe.RGB,source:{width:1,height:1,arrayBufferView:new Uint8Array([0,0,0])},flipY:!1})),this._defaultEmissiveTexture}},defaultNormalTexture:{get:function(){return this._defaultNormalTexture===void 0&&(this._defaultNormalTexture=new vt({context:this,pixelFormat:Qe.RGB,source:{width:1,height:1,arrayBufferView:new Uint8Array([128,128,255])},flipY:!1})),this._defaultNormalTexture}},defaultCubeMap:{get:function(){if(this._defaultCubeMap===void 0){let e={width:1,height:1,arrayBufferView:new Uint8Array([255,255,255,255])};this._defaultCubeMap=new es({context:this,source:{positiveX:e,negativeX:e,positiveY:e,negativeY:e,positiveZ:e,negativeZ:e},flipY:!1})}return this._defaultCubeMap}},drawingBufferHeight:{get:function(){return this._gl.drawingBufferHeight}},drawingBufferWidth:{get:function(){return this._gl.drawingBufferWidth}},defaultFramebuffer:{get:function(){return qDe}}});function Kme(e,t,n,i){let o=e._currentRenderState,r=e._currentPassState;e._currentRenderState=t,e._currentPassState=n,ze.partialApply(e._gl,o,t,r,n,i)}var gQ;typeof WebGLRenderingContext<"u"&&(gQ=[ie.BACK]);function tO(e,t){if(t!==e._currentFramebuffer){e._currentFramebuffer=t;let n=gQ;if(l(t))t._bind(),n=t._getActiveColorAttachments();else{let i=e._gl;i.bindFramebuffer(i.FRAMEBUFFER,null)}e.drawBuffers&&e.glDrawBuffers(n)}}var $De=new ui;Ld.prototype.clear=function(e,t){e=e??$De,t=t??this._defaultPassState;let n=this._gl,i=0,o=e.color,r=e.depth,s=e.stencil;l(o)&&(U.equals(this._clearColor,o)||(U.clone(o,this._clearColor),n.clearColor(o.red,o.green,o.blue,o.alpha)),i|=n.COLOR_BUFFER_BIT),l(r)&&(r!==this._clearDepth&&(this._clearDepth=r,n.clearDepth(r)),i|=n.DEPTH_BUFFER_BIT),l(s)&&(s!==this._clearStencil&&(this._clearStencil=s,n.clearStencil(s)),i|=n.STENCIL_BUFFER_BIT);let a=e.renderState??this._defaultRenderState;Kme(this,a,t,!0);let c=e.framebuffer??t.framebuffer;tO(this,c),n.clear(i)};function eOe(e,t,n,i,o){tO(e,t),Kme(e,o,n,!1),i._bind(),e._maxFrameTextureUnitIndex=Math.max(e._maxFrameTextureUnitIndex,i.maximumTextureUnitIndex)}function tOe(e,t,n,i){let o=t._primitiveType,r=t._vertexArray,s=t._offset,a=t._count,c=t.instanceCount;e._us.model=t._modelMatrix??P.IDENTITY,n._setUniforms(i,e._us,e.validateShaderProgram),r._bind();let d=r.indexBuffer;l(d)?(s=s*d.bytesPerIndex,l(a)?a=Math.min(a,d.numberOfIndices):a=d.numberOfIndices,c===0?e._gl.drawElements(o,a,d.indexDatatype,s):e.glDrawElementsInstanced(o,a,d.indexDatatype,s,c)):(l(a)?a=Math.min(a,r.numberOfVertices):a=r.numberOfVertices,c===0?e._gl.drawArrays(o,s,a):e.glDrawArraysInstanced(o,s,a,c)),r._unBind()}Ld.prototype.draw=function(e,t,n,i){t=t??this._defaultPassState;let o=e._framebuffer??t.framebuffer,r=e._renderState??this._defaultRenderState;n=n??e._shaderProgram,i=i??e._uniformMap,eOe(this,o,t,n,r),tOe(this,e,n,i)};Ld.prototype.beginFrame=function(){};Ld.prototype.endFrame=function(){let e=this._gl;e.useProgram(null),this._currentFramebuffer=void 0,e.bindFramebuffer(e.FRAMEBUFFER,null);let t=gQ;this.drawBuffers&&this.glDrawBuffers(t);let n=this._maxFrameTextureUnitIndex;this._maxFrameTextureUnitIndex=0;for(let i=0;i0&&(a=s.getColorTexture(0).pixelDatatype,c=s.getColorTexture(0).pixelFormat);let d=it.createPixelBuffer({context:this,sizeInBytes:Qe.textureSizeInBytes(c,a,o,r),usage:Pe.DYNAMIC_READ});return tO(this,s),d._bind(),t.readPixels(n,i,o,r,c,Ue.toWebGLConstant(a,this),0),d._unBind(),d};Ld.prototype.readPixels=function(e){let t=this._gl;e=e??B.EMPTY_OBJECT;let n=Math.max(e.x??0,0),i=Math.max(e.y??0,0),o=e.width??this.drawingBufferWidth,r=e.height??this.drawingBufferHeight,s=e.framebuffer,a=Ue.UNSIGNED_BYTE,c=Qe.RGBA;l(s)&&s.numberOfColorAttachments>0&&(a=s.getColorTexture(0).pixelDatatype,c=s.getColorTexture(0).pixelFormat);let d=Qe.createTypedArray(c,a,o,r);return tO(this,s),t.readPixels(n,i,o,r,Qe.RGBA,Ue.toWebGLConstant(a,this),d),d};var Jme={position:0,textureCoordinates:1};Ld.prototype.getViewportQuadVertexArray=function(){let e=this.cache.viewportQuad_vertexArray;if(!l(e)){let t=new At({attributes:{position:new Xe({componentDatatype:J.FLOAT,componentsPerAttribute:2,values:[-1,-1,1,-1,1,1,-1,1]}),textureCoordinates:new Xe({componentDatatype:J.FLOAT,componentsPerAttribute:2,values:[0,0,1,0,1,1,0,1]})},indices:new Uint16Array([0,1,2,0,2,3]),primitiveType:Ie.TRIANGLES});e=Un.fromGeometry({context:this,geometry:t,attributeLocations:Jme,bufferUsage:Pe.STATIC_DRAW,interleave:!0}),this.cache.viewportQuad_vertexArray=e}return e};Ld.prototype.createViewportQuadCommand=function(e,t){return t=t??B.EMPTY_OBJECT,new lt({vertexArray:this.getViewportQuadVertexArray(),primitiveType:Ie.TRIANGLES,renderState:t.renderState,shaderProgram:tn.fromCache({context:this,vertexShaderSource:s_,fragmentShaderSource:e,attributeLocations:Jme}),uniformMap:t.uniformMap,owner:t.owner,framebuffer:t.framebuffer,pass:t.pass})};Ld.prototype.getObjectByPickColor=function(e){return this._pickObjects.get(e)};Ld.prototype.createPickId=function(e){++this._nextPickColor[0];let t=this._nextPickColor[0];if(t===0)throw new ae("Out of unique Pick IDs.");return this._pickObjects.set(t,e),new EG(this._pickObjects,t,U.fromRgba(t))};Ld.prototype.isDestroyed=function(){return!1};Ld.prototype.destroy=function(){let e=this.cache;for(let t in e)if(e.hasOwnProperty(t)){let n=e[t];l(n.destroy)&&n.destroy()}return this._shaderCache=this._shaderCache.destroy(),this._textureCache=this._textureCache.destroy(),this._defaultTexture=this._defaultTexture&&this._defaultTexture.destroy(),this._defaultEmissiveTexture=this._defaultEmissiveTexture&&this._defaultEmissiveTexture.destroy(),this._defaultNormalTexture=this._defaultNormalTexture&&this._defaultNormalTexture.destroy(),this._defaultCubeMap=this._defaultCubeMap&&this._defaultCubeMap.destroy(),ue(this)};var g_=Ld;var hdn=x(T(),1);var Bln=x(T(),1);function b1(e){e=e??B.EMPTY_OBJECT;let{context:t,width:n,height:i,colorRenderbuffers:o,colorTextures:r,depthStencilRenderbuffer:s,depthStencilTexture:a,destroyAttachments:c}=e;if(this._width=n,this._height=i,l(o)!==l(r))throw new ge("Both color renderbuffer and texture attachments must be provided.");if(l(s)!==l(a))throw new ge("Both depth-stencil renderbuffer and texture attachments must be provided.");this._renderFramebuffer=new fs({context:t,colorRenderbuffers:o,depthStencilRenderbuffer:s,destroyAttachments:c}),this._colorFramebuffer=new fs({context:t,colorTextures:r,depthStencilTexture:a,destroyAttachments:c})}b1.prototype.getRenderFramebuffer=function(){return this._renderFramebuffer};b1.prototype.getColorFramebuffer=function(){return this._colorFramebuffer};b1.prototype.blitFramebuffers=function(e,t){this._renderFramebuffer.bindRead(),this._colorFramebuffer.bindDraw();let n=e._gl,i=0;this._colorFramebuffer._colorTextures.length>0&&(i|=n.COLOR_BUFFER_BIT),l(this._colorFramebuffer.depthStencilTexture)&&(i|=n.DEPTH_BUFFER_BIT|(t?n.STENCIL_BUFFER_BIT:0)),n.blitFramebuffer(0,0,this._width,this._height,0,0,this._width,this._height,i,n.NEAREST),n.bindFramebuffer(n.READ_FRAMEBUFFER,null),n.bindFramebuffer(n.DRAW_FRAMEBUFFER,null)};b1.prototype.isDestroyed=function(){return!1};b1.prototype.destroy=function(){return this._renderFramebuffer.destroy(),this._colorFramebuffer.destroy(),ue(this)};var pv=b1;var tdn=x(T(),1);var Kln=x(T(),1);var Yl={RGBA4:ie.RGBA4,RGBA8:ie.RGBA8,RGBA16F:ie.RGBA16F,RGBA32F:ie.RGBA32F,RGB5_A1:ie.RGB5_A1,RGB565:ie.RGB565,DEPTH_COMPONENT16:ie.DEPTH_COMPONENT16,STENCIL_INDEX8:ie.STENCIL_INDEX8,DEPTH_STENCIL:ie.DEPTH_STENCIL,DEPTH24_STENCIL8:ie.DEPTH24_STENCIL8,validate:function(e){return e===Yl.RGBA4||e===Yl.RGBA8||e===Yl.RGBA16F||e===Yl.RGBA32F||e===Yl.RGB5_A1||e===Yl.RGB565||e===Yl.DEPTH_COMPONENT16||e===Yl.STENCIL_INDEX8||e===Yl.DEPTH_STENCIL||e===Yl.DEPTH24_STENCIL8},getColorFormat:function(e){return e===ie.FLOAT?Yl.RGBA32F:e===ie.HALF_FLOAT_OES?Yl.RGBA16F:Yl.RGBA8}};Object.freeze(Yl);var Ml=Yl;function bv(e){e=e??B.EMPTY_OBJECT;let t=e.context,n=t._gl,i=wt.maximumRenderbufferSize,o=e.format??Ml.RGBA4,r=l(e.width)?e.width:t.drawingBufferWidth,s=l(e.height)?e.height:t.drawingBufferHeight,a=e.numSamples??1;this._gl=n,this._format=o,this._width=r,this._height=s,this._renderbuffer=this._gl.createRenderbuffer(),n.bindRenderbuffer(n.RENDERBUFFER,this._renderbuffer),a>1?n.renderbufferStorageMultisample(n.RENDERBUFFER,a,o,r,s):n.renderbufferStorage(n.RENDERBUFFER,o,r,s),n.bindRenderbuffer(n.RENDERBUFFER,null)}Object.defineProperties(bv.prototype,{format:{get:function(){return this._format}},width:{get:function(){return this._width}},height:{get:function(){return this._height}}});bv.prototype._getRenderbuffer=function(){return this._renderbuffer};bv.prototype.isDestroyed=function(){return!1};bv.prototype.destroy=function(){return this._gl.deleteRenderbuffer(this._renderbuffer),ue(this)};var _u=bv;function fa(e){e=e??B.EMPTY_OBJECT,this._numSamples=e.numSamples??1,this._colorAttachmentsLength=e.colorAttachmentsLength??1,this._color=e.color??!0,this._depth=e.depth??!1,this._depthStencil=e.depthStencil??!1,this._supportsDepthTexture=e.supportsDepthTexture??!1,this._createColorAttachments=e.createColorAttachments??!0,this._createDepthAttachments=e.createDepthAttachments??!0,this._pixelDatatype=e.pixelDatatype,this._pixelFormat=e.pixelFormat,this._width=void 0,this._height=void 0,this._framebuffer=void 0,this._multisampleFramebuffer=void 0,this._colorTextures=void 0,this._color&&(this._colorTextures=new Array(this._colorAttachmentsLength),this._colorRenderbuffers=new Array(this._colorAttachmentsLength)),this._colorRenderbuffer=void 0,this._depthStencilRenderbuffer=void 0,this._depthStencilTexture=void 0,this._depthRenderbuffer=void 0,this._depthTexture=void 0,this._attachmentsDirty=!1}Object.defineProperties(fa.prototype,{framebuffer:{get:function(){return this._numSamples>1?this._multisampleFramebuffer.getRenderFramebuffer():this._framebuffer}},numSamples:{get:function(){return this._numSamples}},status:{get:function(){return this.framebuffer.status}}});fa.prototype.isDirty=function(e,t,n,i,o){n=n??1;let r=this._width!==e||this._height!==t,s=this._numSamples!==n,a=l(i)&&this._pixelDatatype!==i||l(o)&&this._pixelFormat!==o,c=n===1?l(this._framebuffer):l(this._multisampleFramebuffer);return this._attachmentsDirty||r||s||a||!c||this._color&&!l(this._colorTextures[0])};fa.prototype.update=function(e,t,n,i,o,r){if(i=e.msaa?i??1:1,o=o??(this._color?this._pixelDatatype??Ue.UNSIGNED_BYTE:void 0),r=r??(this._color?this._pixelFormat??Qe.RGBA:void 0),this.isDirty(t,n,i,o,r)){if(this.destroy(),this._width=t,this._height=n,this._numSamples=i,this._pixelDatatype=o,this._pixelFormat=r,this._attachmentsDirty=!1,this._color&&this._createColorAttachments){for(let s=0;s1){let a=Ml.getColorFormat(o);this._colorRenderbuffers[s]=new _u({context:e,width:t,height:n,format:a,numSamples:this._numSamples})}}this._depthStencil&&this._createDepthAttachments&&(this._supportsDepthTexture&&e.depthTexture?(this._depthStencilTexture=new vt({context:e,width:t,height:n,pixelFormat:Qe.DEPTH_STENCIL,pixelDatatype:Ue.UNSIGNED_INT_24_8,sampler:Ot.NEAREST}),this._numSamples>1&&(this._depthStencilRenderbuffer=new _u({context:e,width:t,height:n,format:Ml.DEPTH24_STENCIL8,numSamples:this._numSamples}))):this._depthStencilRenderbuffer=new _u({context:e,width:t,height:n,format:Ml.DEPTH_STENCIL})),this._depth&&this._createDepthAttachments&&(this._supportsDepthTexture&&e.depthTexture?this._depthTexture=new vt({context:e,width:t,height:n,pixelFormat:Qe.DEPTH_COMPONENT,pixelDatatype:Ue.UNSIGNED_INT,sampler:Ot.NEAREST}):this._depthRenderbuffer=new _u({context:e,width:t,height:n,format:Ml.DEPTH_COMPONENT16})),this._numSamples>1?this._multisampleFramebuffer=new pv({context:e,width:this._width,height:this._height,colorTextures:this._colorTextures,colorRenderbuffers:this._colorRenderbuffers,depthStencilTexture:this._depthStencilTexture,depthStencilRenderbuffer:this._depthStencilRenderbuffer,destroyAttachments:!1}):this._framebuffer=new fs({context:e,colorTextures:this._colorTextures,depthTexture:this._depthTexture,depthRenderbuffer:this._depthRenderbuffer,depthStencilTexture:this._depthStencilTexture,depthStencilRenderbuffer:this._depthStencilRenderbuffer,destroyAttachments:!1})}};fa.prototype.getColorTexture=function(e){return e=e??0,this._colorTextures[e]};fa.prototype.setColorTexture=function(e,t){t=t??0,this._attachmentsDirty=e!==this._colorTextures[t],this._colorTextures[t]=e};fa.prototype.getColorRenderbuffer=function(e){return e=e??0,this._colorRenderbuffers[e]};fa.prototype.setColorRenderbuffer=function(e,t){t=t??0,this._attachmentsDirty=e!==this._colorRenderbuffers[t],this._colorRenderbuffers[t]=e};fa.prototype.getDepthRenderbuffer=function(){return this._depthRenderbuffer};fa.prototype.setDepthRenderbuffer=function(e){this._attachmentsDirty=e!==this._depthRenderbuffer,this._depthRenderbuffer=e};fa.prototype.getDepthTexture=function(){return this._depthTexture};fa.prototype.setDepthTexture=function(e){this._attachmentsDirty=e!==this._depthTexture,this._depthTexture=e};fa.prototype.getDepthStencilRenderbuffer=function(){return this._depthStencilRenderbuffer};fa.prototype.setDepthStencilRenderbuffer=function(e){this._attachmentsDirty=e!==this._depthStencilRenderbuffer,this._depthStencilRenderbuffer=e};fa.prototype.getDepthStencilTexture=function(){return this._depthStencilTexture};fa.prototype.setDepthStencilTexture=function(e){this._attachmentsDirty=e!==this._depthStencilTexture,this._depthStencilTexture=e};fa.prototype.prepareTextures=function(e,t){this._numSamples>1&&this._multisampleFramebuffer.blitFramebuffers(e,t)};fa.prototype.clear=function(e,t,n){let i=t.framebuffer;t.framebuffer=this.framebuffer,t.execute(e,n),t.framebuffer=i};fa.prototype.destroyFramebuffer=function(){this._framebuffer=this._framebuffer&&this._framebuffer.destroy(),this._multisampleFramebuffer=this._multisampleFramebuffer&&this._multisampleFramebuffer.destroy()};fa.prototype.destroy=function(){if(this._color){let e=this._colorTextures,t=this._colorRenderbuffers;for(let n=0;n-1&&i.derivedKeywords.splice(s,1)}return this.createDerivedShaderProgram(e,t,n)};kh.prototype.getDerivedShaderProgram=function(e,t){let n=e._cachedShader,i=t+n.keyword,o=this._shaders[i];if(l(o))return o.shaderProgram};kh.prototype.createDerivedShaderProgram=function(e,t,n){let i=e._cachedShader,o=t+i.keyword,r=n.vertexShaderSource,s=n.fragmentShaderSource,a=n.attributeLocations;typeof r=="string"&&(r=new Je({sources:[r]})),typeof s=="string"&&(s=new Je({sources:[s]}));let c=this._context,d=r.createCombinedVertexShader(c),u=s.createCombinedFragmentShader(c),m=new tn({gl:c._gl,logShaderCompilation:c.logShaderCompilation,debugShaders:c.debugShaders,vertexShaderSource:r,vertexShaderText:d,fragmentShaderSource:s,fragmentShaderText:u,attributeLocations:a}),p={cache:this,shaderProgram:m,keyword:o,derivedKeywords:[],count:0};return i.derivedKeywords.push(t),m._cachedShader=p,this._shaders[o]=p,m};function mQ(e,t){let n=t.derivedKeywords,i=n.length;for(let o=0;oR5e;++r){o=i;let s=o-t*Math.sin(o)-e,a=1-t*Math.cos(o);i=o-s/a}return o=i+n*W.TWO_PI,o}function V5e(e,t){let n=Math.floor(e/W.TWO_PI);e-=n*W.TWO_PI;let i=Math.cos(e)-t,o=Math.sin(e)*Math.sqrt(1-t*t),r=Math.atan2(o,i);return r=W.zeroToTwoPi(r),e<0&&(r-=W.TWO_PI),r+=n*W.TWO_PI,r}function E5e(e,t,n,i){let o=Math.cos(e),r=Math.sin(e),s=Math.cos(t),a=Math.sin(t),c=Math.cos(n),d=Math.sin(n);return l(i)?(i[0]=c*o-d*r*s,i[1]=d*o+c*r*s,i[2]=r*a,i[3]=-c*r-d*o*s,i[4]=-d*r+c*o*s,i[5]=o*a,i[6]=d*a,i[7]=-c*a,i[8]=s):i=new q(c*o-d*r*s,-c*r-d*o*s,d*a,d*o+c*r*s,-d*r+c*o*s,-c*a,r*a,o*a,s),i}var A5e=1.0000010178*Ec,G5e=100.46645683*Em,L5e=129597742283429e-5*Tu,_me=16002,Sme=21863,Zme=32004,Rme=10931,Cme=14529,Vme=16368,Eme=15318,Ame=32794,W5e=64*1e-7*Ec,v5e=-152*1e-7*Ec,F5e=62*1e-7*Ec,I5e=-8*1e-7*Ec,P5e=32*1e-7*Ec,X5e=-41*1e-7*Ec,N5e=19*1e-7*Ec,Y5e=-11*1e-7*Ec,M5e=-150*1e-7*Ec,w5e=-46*1e-7*Ec,k5e=68*1e-7*Ec,U5e=54*1e-7*Ec,D5e=14*1e-7*Ec,O5e=24*1e-7*Ec,B5e=-28*1e-7*Ec,z5e=22*1e-7*Ec,Gme=10,Lme=16002,Wme=21863,vme=10931,Fme=1473,Ime=32004,Pme=4387,Xme=73,H5e=-325*1e-7,K5e=-322*1e-7,J5e=-79*1e-7,j5e=232*1e-7,Q5e=-52*1e-7,q5e=97*1e-7,$5e=55*1e-7,eDe=-41*1e-7,tDe=-105*1e-7,nDe=-137*1e-7,iDe=258*1e-7,oDe=35*1e-7,rDe=-116*1e-7,sDe=-88*1e-7,aDe=-112*1e-7,cDe=-80*1e-7,f1=new Q(0,0,ci.TAI);function lDe(e,t){Yme(e,f1);let i=(f1.dayNumber-eO.dayNumber+(f1.secondsOfDay-eO.secondsOfDay)/wn.SECONDS_PER_DAY)/(wn.DAYS_PER_JULIAN_CENTURY*10),o=.3595362*i,r=A5e+W5e*Math.cos(_me*o)+M5e*Math.sin(_me*o)+v5e*Math.cos(Sme*o)+w5e*Math.sin(Sme*o)+F5e*Math.cos(Zme*o)+k5e*Math.sin(Zme*o)+I5e*Math.cos(Rme*o)+U5e*Math.sin(Rme*o)+P5e*Math.cos(Cme*o)+D5e*Math.sin(Cme*o)+X5e*Math.cos(Vme*o)+O5e*Math.sin(Vme*o)+N5e*Math.cos(Eme*o)+B5e*Math.sin(Eme*o)+Y5e*Math.cos(Ame*o)+z5e*Math.sin(Ame*o),s=G5e+L5e*i+H5e*Math.cos(Gme*o)+tDe*Math.sin(Gme*o)+K5e*Math.cos(Lme*o)+nDe*Math.sin(Lme*o)+J5e*Math.cos(Wme*o)+iDe*Math.sin(Wme*o)+j5e*Math.cos(vme*o)+oDe*Math.sin(vme*o)+Q5e*Math.cos(Fme*o)+rDe*Math.sin(Fme*o)+q5e*Math.cos(Ime*o)+sDe*Math.sin(Ime*o)+$5e*Math.cos(Pme*o)+aDe*Math.sin(Pme*o)+eDe*Math.cos(Xme*o)+cDe*Math.sin(Xme*o),a=.0167086342-.0004203654*i,c=102.93734808*Em+11612.3529*Tu*i,d=469.97289*Tu*i,u=174.87317577*Em-8679.27034*Tu*i;return Mme(r,a,d,c,u,s,t)}function wme(e,t){Yme(e,f1);let i=(f1.dayNumber-eO.dayNumber+(f1.secondsOfDay-eO.secondsOfDay)/wn.SECONDS_PER_DAY)/wn.DAYS_PER_JULIAN_CENTURY,o=i*i,r=o*i,s=r*i,a=383397.7725+.004*i,c=.055545526-16e-9*i,d=5.15668983*Em,u=-8e-5*i+.02966*o-42e-6*r-13e-8*s,m=83.35324312*Em,p=146434202669e-4*i-38.2702*o-.045047*r+21301e-8*s,b=125.04455501*Em,f=-69679193631e-4*i+6.3602*o+.007625*r-3586e-8*s,y=218.31664563*Em,_=17325593434847e-4*i-6.391*o+.006588*r-3169e-8*s,S=297.85019547*Em+Tu*(1602961601209e-3*i-6.3706*o+.006593*r-3169e-8*s),Z=93.27209062*Em+Tu*(17395272628478e-4*i-12.7512*o-.001037*r+417e-8*s),R=134.96340251*Em+Tu*(17179159232178e-4*i+31.8792*o+.051635*r-2447e-7*s),C=357.52910918*Em+Tu*(1295965810481e-4*i-.5532*o+136e-6*r-1149e-8*s),E=310.17137918*Em-Tu*(6967051436e-3*i+6.2068*o+.007618*r-3219e-8*s),A=2*S,L=4*S,F=6*S,I=2*R,N=3*R,g=4*R,V=2*Z;a+=3400.4*Math.cos(A)-635.6*Math.cos(A-R)-235.6*Math.cos(R)+218.1*Math.cos(A-C)+181*Math.cos(A+R),c+=.014216*Math.cos(A-R)+.008551*Math.cos(A-I)-.001383*Math.cos(R)+.001356*Math.cos(A+R)-.001147*Math.cos(L-N)-914e-6*Math.cos(L-I)+869e-6*Math.cos(A-C-R)-627e-6*Math.cos(A)-394e-6*Math.cos(L-g)+282e-6*Math.cos(A-C-I)-279e-6*Math.cos(S-R)-236e-6*Math.cos(I)+231e-6*Math.cos(L)+229e-6*Math.cos(F-g)-201e-6*Math.cos(I-V),u+=486.26*Math.cos(A-V)-40.13*Math.cos(A)+37.51*Math.cos(V)+25.73*Math.cos(I-V)+19.97*Math.cos(A-C-V),p+=-55609*Math.sin(A-R)-34711*Math.sin(A-I)-9792*Math.sin(R)+9385*Math.sin(L-N)+7505*Math.sin(L-I)+5318*Math.sin(A+R)+3484*Math.sin(L-g)-3417*Math.sin(A-C-R)-2530*Math.sin(F-g)-2376*Math.sin(A)-2075*Math.sin(A-N)-1883*Math.sin(I)-1736*Math.sin(F-5*R)+1626*Math.sin(C)-1370*Math.sin(F-N),f+=-5392*Math.sin(A-V)-540*Math.sin(C)-441*Math.sin(A)+423*Math.sin(V)-288*Math.sin(I-V),_+=-3332.9*Math.sin(A)+1197.4*Math.sin(A-R)-662.5*Math.sin(C)+396.3*Math.sin(R)-218*Math.sin(A-C);let G=2*E,v=3*E;u+=46.997*Math.cos(E)*i-.614*Math.cos(A-V+E)*i+.614*Math.cos(A-V-E)*i-.0297*Math.cos(G)*o-.0335*Math.cos(E)*o+.0012*Math.cos(A-V+G)*o-16e-5*Math.cos(E)*r+4e-5*Math.cos(v)*r+4e-5*Math.cos(G)*r;let X=2.116*Math.sin(E)*i-.111*Math.sin(A-V-E)*i-.0015*Math.sin(E)*o;p+=X,_+=X,f+=-520.77*Math.sin(E)*i+13.66*Math.sin(A-V+E)*i+1.12*Math.sin(A-E)*i-1.06*Math.sin(V-E)*i+.66*Math.sin(G)*o+.371*Math.sin(E)*o-.035*Math.sin(A-V+G)*o-.015*Math.sin(A-V+E)*o+.0014*Math.sin(E)*r-.0011*Math.sin(v)*r-9e-4*Math.sin(G)*r,a*=T5e;let Y=d+u*Tu,D=m+p*Tu,M=y+_*Tu,O=b+f*Tu;return Mme(a,c,Y,D,O,M,t)}var Nme=.012300034,dDe=Nme/(Nme+1)*-1;function uDe(e,t){return t=wme(e,t),h.multiplyByScalar(t,dDe,t)}var kme=new q(1.0000000000000002,5619723173785822e-31,4690511510146299e-34,-5154129427414611e-31,.9174820620691819,-.39777715593191376,-223970096136568e-30,.39777715593191376,.9174820620691819),mv=new h;fQ.computeSunPositionInEarthInertialFrame=function(e,t){return l(e)||(e=Q.now()),l(t)||(t=new h),mv=lDe(e,mv),t=h.negate(mv,t),uDe(e,mv),h.subtract(t,mv,t),q.multiplyByVector(kme,t,t),t};fQ.computeMoonPositionInEarthInertialFrame=function(e,t){return l(e)||(e=Q.now()),t=wme(e,t),q.multiplyByVector(kme,t,t),t};var Iy=fQ;var Xcn=x(T(),1),hv={MORPHING:0,COLUMBUS_VIEW:1,SCENE2D:2,SCENE3D:3};hv.getMorphTime=function(e){return e===hv.SCENE3D?1:e===hv.MORPHING?void 0:0};Object.freeze(hv);var se=hv;var wcn=x(T(),1);function mDe(e){e=e??B.EMPTY_OBJECT,this.color=U.clone(e.color??U.WHITE),this.intensity=e.intensity??2}var cb=mDe;function p1(){this.globeDepthTexture=void 0,this.edgeIdTexture=void 0,this.edgeColorTexture=void 0,this.edgeDepthTexture=void 0,this.planarFillIdTexture=void 0,this.gamma=void 0,this._viewport=new nt,this._viewportCartesian4=new ce,this._viewportDirty=!1,this._viewportOrthographicMatrix=P.clone(P.IDENTITY),this._viewportTransformation=P.clone(P.IDENTITY),this._model=P.clone(P.IDENTITY),this._view=P.clone(P.IDENTITY),this._inverseView=P.clone(P.IDENTITY),this._projection=P.clone(P.IDENTITY),this._infiniteProjection=P.clone(P.IDENTITY),this._entireFrustum=new k,this._currentFrustum=new k,this._frustumPlanes=new ce,this._farDepthFromNearPlusOne=void 0,this._log2FarDepthFromNearPlusOne=void 0,this._oneOverLog2FarDepthFromNearPlusOne=void 0,this._frameState=void 0,this._temeToPseudoFixed=q.clone(P.IDENTITY),this._view3DDirty=!0,this._view3D=new P,this._inverseView3DDirty=!0,this._inverseView3D=new P,this._inverseModelDirty=!0,this._inverseModel=new P,this._inverseTransposeModelDirty=!0,this._inverseTransposeModel=new q,this._viewRotation=new q,this._inverseViewRotation=new q,this._viewRotation3D=new q,this._inverseViewRotation3D=new q,this._inverseProjectionDirty=!0,this._inverseProjection=new P,this._modelViewDirty=!0,this._modelView=new P,this._modelView3DDirty=!0,this._modelView3D=new P,this._modelViewRelativeToEyeDirty=!0,this._modelViewRelativeToEye=new P,this._inverseModelViewDirty=!0,this._inverseModelView=new P,this._inverseModelView3DDirty=!0,this._inverseModelView3D=new P,this._viewProjectionDirty=!0,this._viewProjection=new P,this._inverseViewProjectionDirty=!0,this._inverseViewProjection=new P,this._modelViewProjectionDirty=!0,this._modelViewProjection=new P,this._inverseModelViewProjectionDirty=!0,this._inverseModelViewProjection=new P,this._modelViewProjectionRelativeToEyeDirty=!0,this._modelViewProjectionRelativeToEye=new P,this._modelViewInfiniteProjectionDirty=!0,this._modelViewInfiniteProjection=new P,this._normalDirty=!0,this._normal=new q,this._normal3DDirty=!0,this._normal3D=new q,this._inverseNormalDirty=!0,this._inverseNormal=new q,this._inverseNormal3DDirty=!0,this._inverseNormal3D=new q,this._encodedCameraPositionMCDirty=!0,this._encodedCameraPositionMC=new An,this._cameraPosition=new h,this._sunPositionWC=new h,this._sunPositionColumbusView=new h,this._sunDirectionWC=new h,this._sunDirectionEC=new h,this._moonDirectionEC=new h,this._lightDirectionWC=new h,this._lightDirectionEC=new h,this._lightColor=new h,this._lightColorHdr=new h,this._pass=void 0,this._mode=void 0,this._mapProjection=void 0,this._ellipsoid=void 0,this._cameraDirection=new h,this._cameraRight=new h,this._cameraUp=new h,this._frustum2DWidth=0,this._eyeHeight=0,this._eyeHeight2D=new k,this._eyeCartographic=new h,this._eyeEllipsoidNormalEC=new h,this._eyeEllipsoidCurvature=new k,this._eyeToEnu=new q,this._modelToEnu=new P,this._enuToModel=new P,this._pixelRatio=1,this._orthographicIn3D=!1,this._backgroundColor=new U,this._brdfLut=void 0,this._environmentMap=void 0,this._sphericalHarmonicCoefficients=void 0,this._specularEnvironmentMaps=void 0,this._specularEnvironmentMapsMaximumLOD=void 0,this._fogDensity=void 0,this._fogVisualDensityScalar=void 0,this._fogMinimumBrightness=void 0,this._atmosphereHsbShift=void 0,this._atmosphereLightIntensity=void 0,this._atmosphereRayleighCoefficient=new h,this._atmosphereRayleighScaleHeight=new h,this._atmosphereMieCoefficient=new h,this._atmosphereMieScaleHeight=void 0,this._atmosphereMieAnisotropy=void 0,this._atmosphereDynamicLighting=void 0,this._invertClassificationColor=void 0,this._splitPosition=0,this._pixelSizePerMeter=void 0,this._geometricToleranceOverMeter=void 0,this._minimumDisableDepthTestDistance=void 0}Object.defineProperties(p1.prototype,{frameState:{get:function(){return this._frameState}},viewport:{get:function(){return this._viewport},set:function(e){if(!nt.equals(e,this._viewport)){nt.clone(e,this._viewport);let t=this._viewport,n=this._viewportCartesian4;n.x=t.x,n.y=t.y,n.z=t.width,n.w=t.height,this._viewportDirty=!0}}},viewportCartesian4:{get:function(){return this._viewportCartesian4}},viewportOrthographic:{get:function(){return Ome(this),this._viewportOrthographicMatrix}},viewportTransformation:{get:function(){return Ome(this),this._viewportTransformation}},model:{get:function(){return this._model},set:function(e){P.clone(e,this._model),this._modelView3DDirty=!0,this._inverseModelView3DDirty=!0,this._inverseModelDirty=!0,this._inverseTransposeModelDirty=!0,this._modelViewDirty=!0,this._inverseModelViewDirty=!0,this._modelViewRelativeToEyeDirty=!0,this._inverseModelViewDirty=!0,this._modelViewProjectionDirty=!0,this._inverseModelViewProjectionDirty=!0,this._modelViewProjectionRelativeToEyeDirty=!0,this._modelViewInfiniteProjectionDirty=!0,this._normalDirty=!0,this._inverseNormalDirty=!0,this._normal3DDirty=!0,this._inverseNormal3DDirty=!0,this._encodedCameraPositionMCDirty=!0}},inverseModel:{get:function(){return this._inverseModelDirty&&(this._inverseModelDirty=!1,P.inverse(this._model,this._inverseModel)),this._inverseModel}},inverseTransposeModel:{get:function(){let e=this._inverseTransposeModel;return this._inverseTransposeModelDirty&&(this._inverseTransposeModelDirty=!1,P.getMatrix3(this.inverseModel,e),q.transpose(e,e)),e}},view:{get:function(){return this._view}},view3D:{get:function(){return bQ(this),this._view3D}},viewRotation:{get:function(){return bQ(this),this._viewRotation}},viewRotation3D:{get:function(){return bQ(this),this._viewRotation3D}},inverseView:{get:function(){return this._inverseView}},inverseView3D:{get:function(){return Hme(this),this._inverseView3D}},inverseViewRotation:{get:function(){return this._inverseViewRotation}},inverseViewRotation3D:{get:function(){return Hme(this),this._inverseViewRotation3D}},projection:{get:function(){return this._projection}},inverseProjection:{get:function(){return ZDe(this),this._inverseProjection}},infiniteProjection:{get:function(){return this._infiniteProjection}},modelView:{get:function(){return RDe(this),this._modelView}},modelView3D:{get:function(){return CDe(this),this._modelView3D}},modelViewRelativeToEye:{get:function(){return WDe(this),this._modelViewRelativeToEye}},inverseModelView:{get:function(){return VDe(this),this._inverseModelView}},inverseModelView3D:{get:function(){return EDe(this),this._inverseModelView3D}},viewProjection:{get:function(){return ADe(this),this._viewProjection}},inverseViewProjection:{get:function(){return GDe(this),this._inverseViewProjection}},modelViewProjection:{get:function(){return LDe(this),this._modelViewProjection}},inverseModelViewProjection:{get:function(){return vDe(this),this._inverseModelViewProjection}},modelViewProjectionRelativeToEye:{get:function(){return FDe(this),this._modelViewProjectionRelativeToEye}},modelViewInfiniteProjection:{get:function(){return IDe(this),this._modelViewInfiniteProjection}},normal:{get:function(){return PDe(this),this._normal}},normal3D:{get:function(){return XDe(this),this._normal3D}},inverseNormal:{get:function(){return NDe(this),this._inverseNormal}},inverseNormal3D:{get:function(){return YDe(this),this._inverseNormal3D}},entireFrustum:{get:function(){return this._entireFrustum}},currentFrustum:{get:function(){return this._currentFrustum}},frustumPlanes:{get:function(){return this._frustumPlanes}},farDepthFromNearPlusOne:{get:function(){return this._farDepthFromNearPlusOne}},log2FarDepthFromNearPlusOne:{get:function(){return this._log2FarDepthFromNearPlusOne}},oneOverLog2FarDepthFromNearPlusOne:{get:function(){return this._oneOverLog2FarDepthFromNearPlusOne}},eyeHeight:{get:function(){return this._eyeHeight}},eyeCartographic:{get:function(){return this._eyeCartographic}},eyeHeight2D:{get:function(){return this._eyeHeight2D}},eyeEllipsoidNormalEC:{get:function(){return this._eyeEllipsoidNormalEC}},eyeEllipsoidCurvature:{get:function(){return this._eyeEllipsoidCurvature}},eyeToEnu:{get:function(){return this._eyeToEnu}},modelToEnu:{get:function(){return this._modelToEnu}},enuToModel:{get:function(){return this._enuToModel}},sunPositionWC:{get:function(){return this._sunPositionWC}},sunPositionColumbusView:{get:function(){return this._sunPositionColumbusView}},sunDirectionWC:{get:function(){return this._sunDirectionWC}},sunDirectionEC:{get:function(){return this._sunDirectionEC}},moonDirectionEC:{get:function(){return this._moonDirectionEC}},lightDirectionWC:{get:function(){return this._lightDirectionWC}},lightDirectionEC:{get:function(){return this._lightDirectionEC}},lightColor:{get:function(){return this._lightColor}},lightColorHdr:{get:function(){return this._lightColorHdr}},encodedCameraPositionMCHigh:{get:function(){return zme(this),this._encodedCameraPositionMC.high}},encodedCameraPositionMCLow:{get:function(){return zme(this),this._encodedCameraPositionMC.low}},temeToPseudoFixedMatrix:{get:function(){return this._temeToPseudoFixed}},pixelRatio:{get:function(){return this._pixelRatio}},fogDensity:{get:function(){return this._fogDensity}},fogVisualDensityScalar:{get:function(){return this._fogVisualDensityScalar}},fogMinimumBrightness:{get:function(){return this._fogMinimumBrightness}},atmosphereHsbShift:{get:function(){return this._atmosphereHsbShift}},atmosphereLightIntensity:{get:function(){return this._atmosphereLightIntensity}},atmosphereRayleighCoefficient:{get:function(){return this._atmosphereRayleighCoefficient}},atmosphereRayleighScaleHeight:{get:function(){return this._atmosphereRayleighScaleHeight}},atmosphereMieCoefficient:{get:function(){return this._atmosphereMieCoefficient}},atmosphereMieScaleHeight:{get:function(){return this._atmosphereMieScaleHeight}},atmosphereMieAnisotropy:{get:function(){return this._atmosphereMieAnisotropy}},atmosphereDynamicLighting:{get:function(){return this._atmosphereDynamicLighting}},geometricToleranceOverMeter:{get:function(){return this._geometricToleranceOverMeter}},pass:{get:function(){return this._pass}},backgroundColor:{get:function(){return this._backgroundColor}},brdfLut:{get:function(){return this._brdfLut}},environmentMap:{get:function(){return this._environmentMap}},sphericalHarmonicCoefficients:{get:function(){return this._sphericalHarmonicCoefficients}},specularEnvironmentMaps:{get:function(){return this._specularEnvironmentMaps}},specularEnvironmentMapsMaximumLOD:{get:function(){return this._specularEnvironmentMapsMaximumLOD}},splitPosition:{get:function(){return this._splitPosition}},minimumDisableDepthTestDistance:{get:function(){return this._minimumDisableDepthTestDistance}},invertClassificationColor:{get:function(){return this._invertClassificationColor}},orthographicIn3D:{get:function(){return this._orthographicIn3D}},ellipsoid:{get:function(){return this._ellipsoid??ne.default}}});function hDe(e,t){P.clone(t,e._view),P.getMatrix3(t,e._viewRotation),e._view3DDirty=!0,e._inverseView3DDirty=!0,e._modelViewDirty=!0,e._modelView3DDirty=!0,e._modelViewRelativeToEyeDirty=!0,e._inverseModelViewDirty=!0,e._inverseModelView3DDirty=!0,e._viewProjectionDirty=!0,e._inverseViewProjectionDirty=!0,e._modelViewProjectionDirty=!0,e._modelViewProjectionRelativeToEyeDirty=!0,e._modelViewInfiniteProjectionDirty=!0,e._normalDirty=!0,e._inverseNormalDirty=!0,e._normal3DDirty=!0,e._inverseNormal3DDirty=!0}function fDe(e,t){P.clone(t,e._inverseView),P.getMatrix3(t,e._inverseViewRotation)}function pDe(e,t){P.clone(t,e._projection),e._inverseProjectionDirty=!0,e._viewProjectionDirty=!0,e._inverseViewProjectionDirty=!0,e._modelViewProjectionDirty=!0,e._modelViewProjectionRelativeToEyeDirty=!0}function bDe(e,t){P.clone(t,e._infiniteProjection),e._modelViewInfiniteProjectionDirty=!0}var Ume=new h,gDe=new P,Dme=new q;function yDe(e,t){h.clone(t.positionWC,e._cameraPosition),h.clone(t.directionWC,e._cameraDirection),h.clone(t.rightWC,e._cameraRight),h.clone(t.upWC,e._cameraUp);let n=e._ellipsoid,i,o=t.positionCartographic;if(l(o)?(e._eyeHeight=o.height,e._eyeCartographic=h.fromElements(o.longitude,o.latitude,o.height,e._eyeCartographic),e._eyeEllipsoidNormalEC=n.geodeticSurfaceNormalCartographic(o,e._eyeEllipsoidNormalEC),i=h.fromRadians(o.longitude,o.latitude,0,n,Ume)):(e._eyeHeight=-n.maximumRadius,h.magnitude(t.positionWC)>0&&(e._eyeEllipsoidNormalEC=h.normalize(t.positionWC,e._eyeEllipsoidNormalEC)),i=n.scaleToGeodeticSurface(t.positionWC,Ume)),e._encodedCameraPositionMCDirty=!0,!l(i))return;e._eyeEllipsoidNormalEC=q.multiplyByVector(e._viewRotation,e._eyeEllipsoidNormalEC,e._eyeEllipsoidNormalEC);let r=_t.eastNorthUpToFixedFrame(i,n,gDe);e._enuToModel=P.multiplyTransformation(e.inverseModel,r,e._enuToModel),e._modelToEnu=P.inverseTransformation(e._enuToModel,e._modelToEnu);let s=P.getRotation(r,Dme),a=q.multiply(e._viewRotation,s,Dme);e._eyeToEnu=q.transpose(a,e._eyeToEnu),W.equalsEpsilon(n._radii.x,n._radii.y,W.EPSILON15)&&(e._eyeEllipsoidCurvature=n.getLocalCurvature(i,e._eyeEllipsoidCurvature))}var pQ=new q,xDe=new pe;function TDe(e,t){_t.computeIcrfToCentralBodyFixedMatrix(t.time,pQ);let n=Iy.computeSunPositionInEarthInertialFrame(t.time,e._sunPositionWC);q.multiplyByVector(pQ,n,n),h.normalize(n,e._sunDirectionWC),n=q.multiplyByVector(e.viewRotation3D,n,e._sunDirectionEC),h.normalize(n,n),n=Iy.computeMoonPositionInEarthInertialFrame(t.time,e._moonDirectionEC),q.multiplyByVector(pQ,n,n),q.multiplyByVector(e.viewRotation3D,n,n),h.normalize(n,n);let i=t.mapProjection,r=i.ellipsoid.cartesianToCartographic(e._sunPositionWC,xDe);i.project(r,e._sunPositionColumbusView)}p1.prototype.updateCamera=function(e){hDe(this,e.viewMatrix),fDe(this,e.inverseViewMatrix),yDe(this,e),this._entireFrustum.x=e.frustum.near,this._entireFrustum.y=e.frustum.far,this.updateFrustum(e.frustum),this._orthographicIn3D=this._mode!==se.SCENE2D&&e.frustum instanceof yn};p1.prototype.updateFrustum=function(e){pDe(this,e.projectionMatrix),l(e.infiniteProjectionMatrix)&&bDe(this,e.infiniteProjectionMatrix),this._currentFrustum.x=e.near,this._currentFrustum.y=e.far,this._farDepthFromNearPlusOne=e.far-e.near+1,this._log2FarDepthFromNearPlusOne=W.log2(this._farDepthFromNearPlusOne),this._oneOverLog2FarDepthFromNearPlusOne=1/this._log2FarDepthFromNearPlusOne;let t=e.offCenterFrustum;l(t)&&(e=t),this._frustumPlanes.x=e.top,this._frustumPlanes.y=e.bottom,this._frustumPlanes.z=e.left,this._frustumPlanes.w=e.right};p1.prototype.updatePass=function(e){this._pass=e};var _De=[],SDe=new cb;p1.prototype.update=function(e){this._mode=e.mode,this._mapProjection=e.mapProjection,this._ellipsoid=e.mapProjection.ellipsoid,this._pixelRatio=e.pixelRatio;let t=e.camera;this.updateCamera(t),e.mode===se.SCENE2D?(this._frustum2DWidth=t.frustum.right-t.frustum.left,this._eyeHeight2D.x=this._frustum2DWidth*.5,this._eyeHeight2D.y=this._eyeHeight2D.x*this._eyeHeight2D.x):(this._frustum2DWidth=0,this._eyeHeight2D.x=0,this._eyeHeight2D.y=0),TDe(this,e);let n=e.light??SDe;n instanceof cb?(this._lightDirectionWC=h.clone(this._sunDirectionWC,this._lightDirectionWC),this._lightDirectionEC=h.clone(this._sunDirectionEC,this._lightDirectionEC)):(this._lightDirectionWC=h.normalize(h.negate(n.direction,this._lightDirectionWC),this._lightDirectionWC),this._lightDirectionEC=q.multiplyByVector(this.viewRotation3D,this._lightDirectionWC,this._lightDirectionEC));let i=n.color,o=h.fromElements(i.red,i.green,i.blue,this._lightColorHdr);o=h.multiplyByScalar(o,n.intensity,o);let r=h.maximumComponent(o);r>1?h.divideByScalar(o,r,this._lightColor):h.clone(o,this._lightColor);let s=e.brdfLutGenerator,a=l(s)?s.colorTexture:void 0;this._brdfLut=a,this._environmentMap=e.environmentMap??e.context.defaultCubeMap,this._sphericalHarmonicCoefficients=e.sphericalHarmonicCoefficients??_De,this._specularEnvironmentMaps=e.specularEnvironmentMaps,this._specularEnvironmentMapsMaximumLOD=e.specularEnvironmentMapsMaximumLOD,this._fogDensity=e.fog.density,this._fogVisualDensityScalar=e.fog.visualDensityScalar,this._fogMinimumBrightness=e.fog.minimumBrightness;let c=e.atmosphere;l(c)&&(this._atmosphereHsbShift=h.fromElements(c.hueShift,c.saturationShift,c.brightnessShift,this._atmosphereHsbShift),this._atmosphereLightIntensity=c.lightIntensity,this._atmosphereRayleighCoefficient=h.clone(c.rayleighCoefficient,this._atmosphereRayleighCoefficient),this._atmosphereRayleighScaleHeight=c.rayleighScaleHeight,this._atmosphereMieCoefficient=h.clone(c.mieCoefficient,this._atmosphereMieCoefficient),this._atmosphereMieScaleHeight=c.mieScaleHeight,this._atmosphereMieAnisotropy=c.mieAnisotropy,this._atmosphereDynamicLighting=c.dynamicLighting),this._invertClassificationColor=e.invertClassificationColor,this._frameState=e,this._temeToPseudoFixed=_t.computeTemeToPseudoFixedMatrix(e.time,this._temeToPseudoFixed),this._splitPosition=e.splitPosition*e.context.drawingBufferWidth;let d=t.frustum.fov,u=this._viewport,m;l(d)?u.height>u.width?m=Math.tan(.5*d)*2/u.height:m=Math.tan(.5*d)*2/u.width:m=1/Math.max(u.width,u.height),this._geometricToleranceOverMeter=m*e.maximumScreenSpaceError,U.clone(e.backgroundColor,this._backgroundColor),this._minimumDisableDepthTestDistance=e.minimumDisableDepthTestDistance,this._minimumDisableDepthTestDistance*=this._minimumDisableDepthTestDistance,this._minimumDisableDepthTestDistance===Number.POSITIVE_INFINITY&&(this._minimumDisableDepthTestDistance=-1)};function Ome(e){if(e._viewportDirty){let t=e._viewport;P.computeOrthographicOffCenter(t.x,t.x+t.width,t.y,t.y+t.height,0,1,e._viewportOrthographicMatrix),P.computeViewportTransformation(t,0,1,e._viewportTransformation),e._viewportDirty=!1}}function ZDe(e){e._inverseProjectionDirty&&(e._inverseProjectionDirty=!1,e._mode!==se.SCENE2D&&e._mode!==se.MORPHING&&!e._orthographicIn3D?P.inverse(e._projection,e._inverseProjection):P.clone(P.ZERO,e._inverseProjection))}function RDe(e){e._modelViewDirty&&(e._modelViewDirty=!1,P.multiplyTransformation(e._view,e._model,e._modelView))}function CDe(e){e._modelView3DDirty&&(e._modelView3DDirty=!1,P.multiplyTransformation(e.view3D,e._model,e._modelView3D))}function VDe(e){e._inverseModelViewDirty&&(e._inverseModelViewDirty=!1,P.inverse(e.modelView,e._inverseModelView))}function EDe(e){e._inverseModelView3DDirty&&(e._inverseModelView3DDirty=!1,P.inverse(e.modelView3D,e._inverseModelView3D))}function ADe(e){e._viewProjectionDirty&&(e._viewProjectionDirty=!1,P.multiply(e._projection,e._view,e._viewProjection))}function GDe(e){e._inverseViewProjectionDirty&&(e._inverseViewProjectionDirty=!1,P.inverse(e.viewProjection,e._inverseViewProjection))}function LDe(e){e._modelViewProjectionDirty&&(e._modelViewProjectionDirty=!1,P.multiply(e._projection,e.modelView,e._modelViewProjection))}function WDe(e){if(e._modelViewRelativeToEyeDirty){e._modelViewRelativeToEyeDirty=!1;let t=e.modelView,n=e._modelViewRelativeToEye;n[0]=t[0],n[1]=t[1],n[2]=t[2],n[3]=t[3],n[4]=t[4],n[5]=t[5],n[6]=t[6],n[7]=t[7],n[8]=t[8],n[9]=t[9],n[10]=t[10],n[11]=t[11],n[12]=0,n[13]=0,n[14]=0,n[15]=t[15]}}function vDe(e){e._inverseModelViewProjectionDirty&&(e._inverseModelViewProjectionDirty=!1,P.inverse(e.modelViewProjection,e._inverseModelViewProjection))}function FDe(e){e._modelViewProjectionRelativeToEyeDirty&&(e._modelViewProjectionRelativeToEyeDirty=!1,P.multiply(e._projection,e.modelViewRelativeToEye,e._modelViewProjectionRelativeToEye))}function IDe(e){e._modelViewInfiniteProjectionDirty&&(e._modelViewInfiniteProjectionDirty=!1,P.multiply(e._infiniteProjection,e.modelView,e._modelViewInfiniteProjection))}function PDe(e){if(e._normalDirty){e._normalDirty=!1;let t=e._normal;P.getMatrix3(e.inverseModelView,t),q.transpose(t,t)}}function XDe(e){if(e._normal3DDirty){e._normal3DDirty=!1;let t=e._normal3D;P.getMatrix3(e.inverseModelView3D,t),q.transpose(t,t)}}function NDe(e){if(e._inverseNormalDirty){e._inverseNormalDirty=!1;let t=e._inverseNormal;P.getMatrix3(e.modelView,t),q.transpose(t,t)}}function YDe(e){if(e._inverseNormal3DDirty){e._inverseNormal3DDirty=!1;let t=e._inverseNormal3D;P.getMatrix3(e.modelView3D,t),q.transpose(t,t)}}var Bme=new h;function zme(e){e._encodedCameraPositionMCDirty&&(e._encodedCameraPositionMCDirty=!1,P.multiplyByPoint(e.inverseModel,e._cameraPosition,Bme),An.fromCartesian(Bme,e._encodedCameraPositionMC))}var MDe=new h,wDe=new h,kDe=new h,UDe=new h,DDe=new pe,ODe=new h,BDe=new P;function zDe(e,t,n,i,o,r,s,a){let c=MDe;c.x=e.y,c.y=e.z,c.z=e.x;let d=wDe;d.x=n.y,d.y=n.z,d.z=n.x;let u=kDe;u.x=i.y,u.y=i.z,u.z=i.x;let m=UDe;m.x=t.y,m.y=t.z,m.z=t.x,r===se.SCENE2D&&(c.z=o*.5);let p=s.unproject(c,DDe);p.longitude=W.clamp(p.longitude,-Math.PI,Math.PI),p.latitude=W.clamp(p.latitude,-W.PI_OVER_TWO,W.PI_OVER_TWO);let b=s.ellipsoid,f=b.cartographicToCartesian(p,ODe),y=_t.eastNorthUpToFixedFrame(f,b,BDe);return P.multiplyByPointAsVector(y,d,d),P.multiplyByPointAsVector(y,u,u),P.multiplyByPointAsVector(y,m,m),l(a)||(a=new P),a[0]=d.x,a[1]=u.x,a[2]=-m.x,a[3]=0,a[4]=d.y,a[5]=u.y,a[6]=-m.y,a[7]=0,a[8]=d.z,a[9]=u.z,a[10]=-m.z,a[11]=0,a[12]=-h.dot(d,f),a[13]=-h.dot(u,f),a[14]=h.dot(m,f),a[15]=1,a}function bQ(e){e._view3DDirty&&(e._mode===se.SCENE3D?P.clone(e._view,e._view3D):zDe(e._cameraPosition,e._cameraDirection,e._cameraRight,e._cameraUp,e._frustum2DWidth,e._mode,e._mapProjection,e._view3D),P.getMatrix3(e._view3D,e._viewRotation3D),e._view3DDirty=!1)}function Hme(e){e._inverseView3DDirty&&(P.inverseTransformation(e.view3D,e._inverseView3D),P.getMatrix3(e._inverseView3D,e._inverseViewRotation3D),e._inverseView3DDirty=!1)}var fv=p1;function Ld(e,t){let{getWebGLStub:n,requestWebgl1:i,webgl:o={},allowTextureFilterAnisotropic:r=!0,transparentDefaultTexture:s=!1}=t??{};o.alpha=o.alpha??!1,o.stencil=o.stencil??!0,o.powerPreference=o.powerPreference??"high-performance";let a=l(n)?n(e,o):HDe(e,o,i),d=typeof WebGL2RenderingContext<"u"&&a instanceof WebGL2RenderingContext;this._canvas=e,this._originalGLContext=a,this._gl=a,this._webgl2=d,this._id=Qn(),this.validateFramebuffer=!1,this.validateShaderProgram=!1,this.logShaderCompilation=!1,this._throwOnWebGLError=!1,this._shaderCache=new lv(this),this._textureCache=new dv,this._transparentDefaultTexture=s;let u=a;this._stencilBits=u.getParameter(u.STENCIL_BITS),wt._maximumCombinedTextureImageUnits=u.getParameter(u.MAX_COMBINED_TEXTURE_IMAGE_UNITS),wt._maximumCubeMapSize=u.getParameter(u.MAX_CUBE_MAP_TEXTURE_SIZE),wt._maximumFragmentUniformVectors=u.getParameter(u.MAX_FRAGMENT_UNIFORM_VECTORS),wt._maximumTextureImageUnits=u.getParameter(u.MAX_TEXTURE_IMAGE_UNITS),wt._maximumRenderbufferSize=u.getParameter(u.MAX_RENDERBUFFER_SIZE),wt._maximumTextureSize=u.getParameter(u.MAX_TEXTURE_SIZE),wt._maximum3DTextureSize=u.getParameter(u.MAX_3D_TEXTURE_SIZE),wt._maximumVaryingVectors=u.getParameter(u.MAX_VARYING_VECTORS),wt._maximumVertexAttributes=u.getParameter(u.MAX_VERTEX_ATTRIBS),wt._maximumVertexTextureImageUnits=u.getParameter(u.MAX_VERTEX_TEXTURE_IMAGE_UNITS),wt._maximumVertexUniformVectors=u.getParameter(u.MAX_VERTEX_UNIFORM_VECTORS),wt._maximumSamples=this._webgl2?u.getParameter(u.MAX_SAMPLES):0;let m=u.getParameter(u.ALIASED_LINE_WIDTH_RANGE);wt._minimumAliasedLineWidth=m[0],wt._maximumAliasedLineWidth=m[1];let p=u.getParameter(u.ALIASED_POINT_SIZE_RANGE);wt._minimumAliasedPointSize=p[0],wt._maximumAliasedPointSize=p[1];let b=u.getParameter(u.MAX_VIEWPORT_DIMS);wt._maximumViewportWidth=b[0],wt._maximumViewportHeight=b[1];let f=u.getShaderPrecisionFormat(u.FRAGMENT_SHADER,u.HIGH_FLOAT);wt._highpFloatSupported=f.precision!==0;let y=u.getShaderPrecisionFormat(u.FRAGMENT_SHADER,u.HIGH_INT);wt._highpIntSupported=y.rangeMax!==0,this._antialias=u.getContextAttributes().antialias,this._standardDerivatives=!!ts(u,["OES_standard_derivatives"]),this._blendMinmax=!!ts(u,["EXT_blend_minmax"]),this._elementIndexUint=!!ts(u,["OES_element_index_uint"]),this._depthTexture=!!ts(u,["WEBGL_depth_texture","WEBKIT_WEBGL_depth_texture"]),this._fragDepth=!!ts(u,["EXT_frag_depth"]),this._debugShaders=ts(u,["WEBGL_debug_shaders"]),this._textureFloat=!!ts(u,["OES_texture_float"]),this._textureHalfFloat=!!ts(u,["OES_texture_half_float"]),this._textureFloatLinear=!!ts(u,["OES_texture_float_linear"]),this._textureHalfFloatLinear=!!ts(u,["OES_texture_half_float_linear"]),this._supportsTextureLod=!!ts(u,["EXT_shader_texture_lod"]),this._colorBufferFloat=!!ts(u,["EXT_color_buffer_float","WEBGL_color_buffer_float"]),this._floatBlend=!!ts(u,["EXT_float_blend"]),this._colorBufferHalfFloat=!!ts(u,["EXT_color_buffer_half_float"]),this._s3tc=!!ts(u,["WEBGL_compressed_texture_s3tc","MOZ_WEBGL_compressed_texture_s3tc","WEBKIT_WEBGL_compressed_texture_s3tc"]),this._pvrtc=!!ts(u,["WEBGL_compressed_texture_pvrtc","WEBKIT_WEBGL_compressed_texture_pvrtc"]),this._astc=!!ts(u,["WEBGL_compressed_texture_astc"]),this._etc=!!ts(u,["WEBG_compressed_texture_etc"]),this._etc1=!!ts(u,["WEBGL_compressed_texture_etc1"]),this._bc7=!!ts(u,["EXT_texture_compression_bptc"]),Ad.setKTX2SupportedFormats(this._s3tc,this._pvrtc,this._astc,this._etc,this._etc1,this._bc7);let _=r?ts(u,["EXT_texture_filter_anisotropic","WEBKIT_EXT_texture_filter_anisotropic"]):void 0;this._textureFilterAnisotropic=_,wt._maximumTextureFilterAnisotropy=l(_)?u.getParameter(_.MAX_TEXTURE_MAX_ANISOTROPY_EXT):1;let S,Z,R,C,E,A,L,F,I,N;if(d){let v=this;S=function(){return v._gl.createVertexArray()},Z=function(X){v._gl.bindVertexArray(X)},R=function(X){v._gl.deleteVertexArray(X)},C=function(X,Y,D,M,O){u.drawElementsInstanced(X,Y,D,M,O)},E=function(X,Y,D,M){u.drawArraysInstanced(X,Y,D,M)},A=function(X,Y){u.vertexAttribDivisor(X,Y)},L=function(X){u.drawBuffers(X)}}else F=ts(u,["OES_vertex_array_object"]),l(F)&&(S=function(){return F.createVertexArrayOES()},Z=function(v){F.bindVertexArrayOES(v)},R=function(v){F.deleteVertexArrayOES(v)}),I=ts(u,["ANGLE_instanced_arrays"]),l(I)&&(C=function(v,X,Y,D,M){I.drawElementsInstancedANGLE(v,X,Y,D,M)},E=function(v,X,Y,D){I.drawArraysInstancedANGLE(v,X,Y,D)},A=function(v,X){I.vertexAttribDivisorANGLE(v,X)}),N=ts(u,["WEBGL_draw_buffers"]),l(N)&&(L=function(v){N.drawBuffersWEBGL(v)});this.glCreateVertexArray=S,this.glBindVertexArray=Z,this.glDeleteVertexArray=R,this.glDrawElementsInstanced=C,this.glDrawArraysInstanced=E,this.glVertexAttribDivisor=A,this.glDrawBuffers=L,this._vertexArrayObject=!!F,this._instancedArrays=!!I,this._drawBuffers=!!N,wt._maximumDrawBuffers=this.drawBuffers?u.getParameter(ie.MAX_DRAW_BUFFERS):1,wt._maximumColorAttachments=this.drawBuffers?u.getParameter(ie.MAX_COLOR_ATTACHMENTS):1,this._clearColor=new U(0,0,0,0),this._clearDepth=1,this._clearStencil=0;let g=new fv,V=new oc(this),G=ze.fromCache();this._defaultPassState=V,this._defaultRenderState=G,this._defaultTexture=void 0,this._defaultEmissiveTexture=void 0,this._defaultNormalTexture=void 0,this._defaultCubeMap=void 0,this._us=g,this._currentRenderState=G,this._currentPassState=V,this._currentFramebuffer=void 0,this._maxFrameTextureUnitIndex=0,this._vertexAttribDivisors=[],this._previousDrawInstanced=!1;for(let v=0;v"u")throw new ae("The browser does not support WebGL. Visit http://get.webgl.org.");!n&&!(typeof WebGL2RenderingContext<"u")&&(n=!0);let o=n?"webgl":"webgl2",r=e.getContext(o,t);if(!l(r))throw new ae("The browser supports WebGL, but initialization failed.");return r}function KDe(e,t){let n="WebGL Error: ";switch(t){case e.INVALID_ENUM:n+="INVALID_ENUM";break;case e.INVALID_VALUE:n+="INVALID_VALUE";break;case e.INVALID_OPERATION:n+="INVALID_OPERATION";break;case e.OUT_OF_MEMORY:n+="OUT_OF_MEMORY";break;case e.CONTEXT_LOST_WEBGL:n+="CONTEXT_LOST_WEBGL lost";break;default:n+=`Unknown (${t})`}return n}function JDe(e,t,n,i){let o=`${KDe(e,i)}: ${t.name}(`;for(let r=0;r=8}},antialias:{get:function(){return this._antialias}},msaa:{get:function(){return this._webgl2}},standardDerivatives:{get:function(){return this._standardDerivatives||this._webgl2}},floatBlend:{get:function(){return this._floatBlend}},blendMinmax:{get:function(){return this._blendMinmax||this._webgl2}},elementIndexUint:{get:function(){return this._elementIndexUint||this._webgl2}},depthTexture:{get:function(){return this._depthTexture||this._webgl2}},floatingPointTexture:{get:function(){return this._webgl2||this._textureFloat}},halfFloatingPointTexture:{get:function(){return this._webgl2||this._textureHalfFloat}},textureFloatLinear:{get:function(){return this._textureFloatLinear}},textureHalfFloatLinear:{get:function(){return this._webgl2&&this._textureFloatLinear||!this._webgl2&&this._textureHalfFloatLinear}},supportsTextureLod:{get:function(){return this._webgl2||this._supportsTextureLod}},textureFilterAnisotropic:{get:function(){return!!this._textureFilterAnisotropic}},s3tc:{get:function(){return this._s3tc}},pvrtc:{get:function(){return this._pvrtc}},astc:{get:function(){return this._astc}},etc:{get:function(){return this._etc}},etc1:{get:function(){return this._etc1}},bc7:{get:function(){return this._bc7}},supportsBasis:{get:function(){return this._s3tc||this._pvrtc||this._astc||this._etc||this._etc1||this._bc7}},vertexArrayObject:{get:function(){return this._vertexArrayObject||this._webgl2}},fragmentDepth:{get:function(){return this._fragDepth||this._webgl2}},instancedArrays:{get:function(){return this._instancedArrays||this._webgl2}},colorBufferFloat:{get:function(){return this._colorBufferFloat}},colorBufferHalfFloat:{get:function(){return this._webgl2&&this._colorBufferFloat||!this._webgl2&&this._colorBufferHalfFloat}},drawBuffers:{get:function(){return this._drawBuffers||this._webgl2}},debugShaders:{get:function(){return this._debugShaders}},throwOnWebGLError:{get:function(){return this._throwOnWebGLError},set:function(e){this._throwOnWebGLError=e,this._gl=qDe(this._originalGLContext,e?jDe:void 0)}},defaultTexture:{get:function(){if(this._defaultTexture===void 0){let e=vt.defaultColor;this._defaultTexture=new vt({context:this,source:{width:1,height:1,arrayBufferView:new Uint8Array([e.red*255,e.green*255,e.blue*255,this._transparentDefaultTexture?0:e.alpha*255])},flipY:!1})}return this._defaultTexture}},defaultEmissiveTexture:{get:function(){return this._defaultEmissiveTexture===void 0&&(this._defaultEmissiveTexture=new vt({context:this,pixelFormat:Qe.RGB,source:{width:1,height:1,arrayBufferView:new Uint8Array([0,0,0])},flipY:!1})),this._defaultEmissiveTexture}},defaultNormalTexture:{get:function(){return this._defaultNormalTexture===void 0&&(this._defaultNormalTexture=new vt({context:this,pixelFormat:Qe.RGB,source:{width:1,height:1,arrayBufferView:new Uint8Array([128,128,255])},flipY:!1})),this._defaultNormalTexture}},defaultCubeMap:{get:function(){if(this._defaultCubeMap===void 0){let e={width:1,height:1,arrayBufferView:new Uint8Array([255,255,255,255])};this._defaultCubeMap=new es({context:this,source:{positiveX:e,negativeX:e,positiveY:e,negativeY:e,positiveZ:e,negativeZ:e},flipY:!1})}return this._defaultCubeMap}},drawingBufferHeight:{get:function(){return this._gl.drawingBufferHeight}},drawingBufferWidth:{get:function(){return this._gl.drawingBufferWidth}},defaultFramebuffer:{get:function(){return $De}}});function Kme(e,t,n,i){let o=e._currentRenderState,r=e._currentPassState;e._currentRenderState=t,e._currentPassState=n,ze.partialApply(e._gl,o,t,r,n,i)}var gQ;typeof WebGLRenderingContext<"u"&&(gQ=[ie.BACK]);function tO(e,t){if(t!==e._currentFramebuffer){e._currentFramebuffer=t;let n=gQ;if(l(t))t._bind(),n=t._getActiveColorAttachments();else{let i=e._gl;i.bindFramebuffer(i.FRAMEBUFFER,null)}e.drawBuffers&&e.glDrawBuffers(n)}}var eOe=new ui;Ld.prototype.clear=function(e,t){e=e??eOe,t=t??this._defaultPassState;let n=this._gl,i=0,o=e.color,r=e.depth,s=e.stencil;l(o)&&(U.equals(this._clearColor,o)||(U.clone(o,this._clearColor),n.clearColor(o.red,o.green,o.blue,o.alpha)),i|=n.COLOR_BUFFER_BIT),l(r)&&(r!==this._clearDepth&&(this._clearDepth=r,n.clearDepth(r)),i|=n.DEPTH_BUFFER_BIT),l(s)&&(s!==this._clearStencil&&(this._clearStencil=s,n.clearStencil(s)),i|=n.STENCIL_BUFFER_BIT);let a=e.renderState??this._defaultRenderState;Kme(this,a,t,!0);let c=e.framebuffer??t.framebuffer;tO(this,c),n.clear(i)};function tOe(e,t,n,i,o){tO(e,t),Kme(e,o,n,!1),i._bind(),e._maxFrameTextureUnitIndex=Math.max(e._maxFrameTextureUnitIndex,i.maximumTextureUnitIndex)}function nOe(e,t,n,i){let o=t._primitiveType,r=t._vertexArray,s=t._offset,a=t._count,c=t.instanceCount;e._us.model=t._modelMatrix??P.IDENTITY,n._setUniforms(i,e._us,e.validateShaderProgram),r._bind();let d=r.indexBuffer;l(d)?(s=s*d.bytesPerIndex,l(a)?a=Math.min(a,d.numberOfIndices):a=d.numberOfIndices,c===0?e._gl.drawElements(o,a,d.indexDatatype,s):e.glDrawElementsInstanced(o,a,d.indexDatatype,s,c)):(l(a)?a=Math.min(a,r.numberOfVertices):a=r.numberOfVertices,c===0?e._gl.drawArrays(o,s,a):e.glDrawArraysInstanced(o,s,a,c)),r._unBind()}Ld.prototype.draw=function(e,t,n,i){t=t??this._defaultPassState;let o=e._framebuffer??t.framebuffer,r=e._renderState??this._defaultRenderState;n=n??e._shaderProgram,i=i??e._uniformMap,tOe(this,o,t,n,r),nOe(this,e,n,i)};Ld.prototype.beginFrame=function(){};Ld.prototype.endFrame=function(){let e=this._gl;e.useProgram(null),this._currentFramebuffer=void 0,e.bindFramebuffer(e.FRAMEBUFFER,null);let t=gQ;this.drawBuffers&&this.glDrawBuffers(t);let n=this._maxFrameTextureUnitIndex;this._maxFrameTextureUnitIndex=0;for(let i=0;i0&&(a=s.getColorTexture(0).pixelDatatype,c=s.getColorTexture(0).pixelFormat);let d=it.createPixelBuffer({context:this,sizeInBytes:Qe.textureSizeInBytes(c,a,o,r),usage:Pe.DYNAMIC_READ});return tO(this,s),d._bind(),t.readPixels(n,i,o,r,c,Ue.toWebGLConstant(a,this),0),d._unBind(),d};Ld.prototype.readPixels=function(e){let t=this._gl;e=e??B.EMPTY_OBJECT;let n=Math.max(e.x??0,0),i=Math.max(e.y??0,0),o=e.width??this.drawingBufferWidth,r=e.height??this.drawingBufferHeight,s=e.framebuffer,a=Ue.UNSIGNED_BYTE,c=Qe.RGBA;l(s)&&s.numberOfColorAttachments>0&&(a=s.getColorTexture(0).pixelDatatype,c=s.getColorTexture(0).pixelFormat);let d=Qe.createTypedArray(c,a,o,r);return tO(this,s),t.readPixels(n,i,o,r,Qe.RGBA,Ue.toWebGLConstant(a,this),d),d};var Jme={position:0,textureCoordinates:1};Ld.prototype.getViewportQuadVertexArray=function(){let e=this.cache.viewportQuad_vertexArray;if(!l(e)){let t=new At({attributes:{position:new Xe({componentDatatype:J.FLOAT,componentsPerAttribute:2,values:[-1,-1,1,-1,1,1,-1,1]}),textureCoordinates:new Xe({componentDatatype:J.FLOAT,componentsPerAttribute:2,values:[0,0,1,0,1,1,0,1]})},indices:new Uint16Array([0,1,2,0,2,3]),primitiveType:Ie.TRIANGLES});e=Un.fromGeometry({context:this,geometry:t,attributeLocations:Jme,bufferUsage:Pe.STATIC_DRAW,interleave:!0}),this.cache.viewportQuad_vertexArray=e}return e};Ld.prototype.createViewportQuadCommand=function(e,t){return t=t??B.EMPTY_OBJECT,new lt({vertexArray:this.getViewportQuadVertexArray(),primitiveType:Ie.TRIANGLES,renderState:t.renderState,shaderProgram:tn.fromCache({context:this,vertexShaderSource:s_,fragmentShaderSource:e,attributeLocations:Jme}),uniformMap:t.uniformMap,owner:t.owner,framebuffer:t.framebuffer,pass:t.pass})};Ld.prototype.getObjectByPickColor=function(e){return this._pickObjects.get(e)};Ld.prototype.createPickId=function(e){++this._nextPickColor[0];let t=this._nextPickColor[0];if(t===0)throw new ae("Out of unique Pick IDs.");return this._pickObjects.set(t,e),new EG(this._pickObjects,t,U.fromRgba(t))};Ld.prototype.isDestroyed=function(){return!1};Ld.prototype.destroy=function(){let e=this.cache;for(let t in e)if(e.hasOwnProperty(t)){let n=e[t];l(n.destroy)&&n.destroy()}return this._shaderCache=this._shaderCache.destroy(),this._textureCache=this._textureCache.destroy(),this._defaultTexture=this._defaultTexture&&this._defaultTexture.destroy(),this._defaultEmissiveTexture=this._defaultEmissiveTexture&&this._defaultEmissiveTexture.destroy(),this._defaultNormalTexture=this._defaultNormalTexture&&this._defaultNormalTexture.destroy(),this._defaultCubeMap=this._defaultCubeMap&&this._defaultCubeMap.destroy(),ue(this)};var g_=Ld;var fdn=x(T(),1);var zln=x(T(),1);function b1(e){e=e??B.EMPTY_OBJECT;let{context:t,width:n,height:i,colorRenderbuffers:o,colorTextures:r,depthStencilRenderbuffer:s,depthStencilTexture:a,destroyAttachments:c}=e;if(this._width=n,this._height=i,l(o)!==l(r))throw new ge("Both color renderbuffer and texture attachments must be provided.");if(l(s)!==l(a))throw new ge("Both depth-stencil renderbuffer and texture attachments must be provided.");this._renderFramebuffer=new fs({context:t,colorRenderbuffers:o,depthStencilRenderbuffer:s,destroyAttachments:c}),this._colorFramebuffer=new fs({context:t,colorTextures:r,depthStencilTexture:a,destroyAttachments:c})}b1.prototype.getRenderFramebuffer=function(){return this._renderFramebuffer};b1.prototype.getColorFramebuffer=function(){return this._colorFramebuffer};b1.prototype.blitFramebuffers=function(e,t){this._renderFramebuffer.bindRead(),this._colorFramebuffer.bindDraw();let n=e._gl,i=0;this._colorFramebuffer._colorTextures.length>0&&(i|=n.COLOR_BUFFER_BIT),l(this._colorFramebuffer.depthStencilTexture)&&(i|=n.DEPTH_BUFFER_BIT|(t?n.STENCIL_BUFFER_BIT:0)),n.blitFramebuffer(0,0,this._width,this._height,0,0,this._width,this._height,i,n.NEAREST),n.bindFramebuffer(n.READ_FRAMEBUFFER,null),n.bindFramebuffer(n.DRAW_FRAMEBUFFER,null)};b1.prototype.isDestroyed=function(){return!1};b1.prototype.destroy=function(){return this._renderFramebuffer.destroy(),this._colorFramebuffer.destroy(),ue(this)};var pv=b1;var ndn=x(T(),1);var Jln=x(T(),1);var Yl={RGBA4:ie.RGBA4,RGBA8:ie.RGBA8,RGBA16F:ie.RGBA16F,RGBA32F:ie.RGBA32F,RGB5_A1:ie.RGB5_A1,RGB565:ie.RGB565,DEPTH_COMPONENT16:ie.DEPTH_COMPONENT16,STENCIL_INDEX8:ie.STENCIL_INDEX8,DEPTH_STENCIL:ie.DEPTH_STENCIL,DEPTH24_STENCIL8:ie.DEPTH24_STENCIL8,validate:function(e){return e===Yl.RGBA4||e===Yl.RGBA8||e===Yl.RGBA16F||e===Yl.RGBA32F||e===Yl.RGB5_A1||e===Yl.RGB565||e===Yl.DEPTH_COMPONENT16||e===Yl.STENCIL_INDEX8||e===Yl.DEPTH_STENCIL||e===Yl.DEPTH24_STENCIL8},getColorFormat:function(e){return e===ie.FLOAT?Yl.RGBA32F:e===ie.HALF_FLOAT_OES?Yl.RGBA16F:Yl.RGBA8}};Object.freeze(Yl);var Ml=Yl;function bv(e){e=e??B.EMPTY_OBJECT;let t=e.context,n=t._gl,i=wt.maximumRenderbufferSize,o=e.format??Ml.RGBA4,r=l(e.width)?e.width:t.drawingBufferWidth,s=l(e.height)?e.height:t.drawingBufferHeight,a=e.numSamples??1;this._gl=n,this._format=o,this._width=r,this._height=s,this._renderbuffer=this._gl.createRenderbuffer(),n.bindRenderbuffer(n.RENDERBUFFER,this._renderbuffer),a>1?n.renderbufferStorageMultisample(n.RENDERBUFFER,a,o,r,s):n.renderbufferStorage(n.RENDERBUFFER,o,r,s),n.bindRenderbuffer(n.RENDERBUFFER,null)}Object.defineProperties(bv.prototype,{format:{get:function(){return this._format}},width:{get:function(){return this._width}},height:{get:function(){return this._height}}});bv.prototype._getRenderbuffer=function(){return this._renderbuffer};bv.prototype.isDestroyed=function(){return!1};bv.prototype.destroy=function(){return this._gl.deleteRenderbuffer(this._renderbuffer),ue(this)};var _u=bv;function fa(e){e=e??B.EMPTY_OBJECT,this._numSamples=e.numSamples??1,this._colorAttachmentsLength=e.colorAttachmentsLength??1,this._color=e.color??!0,this._depth=e.depth??!1,this._depthStencil=e.depthStencil??!1,this._supportsDepthTexture=e.supportsDepthTexture??!1,this._createColorAttachments=e.createColorAttachments??!0,this._createDepthAttachments=e.createDepthAttachments??!0,this._pixelDatatype=e.pixelDatatype,this._pixelFormat=e.pixelFormat,this._width=void 0,this._height=void 0,this._framebuffer=void 0,this._multisampleFramebuffer=void 0,this._colorTextures=void 0,this._color&&(this._colorTextures=new Array(this._colorAttachmentsLength),this._colorRenderbuffers=new Array(this._colorAttachmentsLength)),this._colorRenderbuffer=void 0,this._depthStencilRenderbuffer=void 0,this._depthStencilTexture=void 0,this._depthRenderbuffer=void 0,this._depthTexture=void 0,this._attachmentsDirty=!1}Object.defineProperties(fa.prototype,{framebuffer:{get:function(){return this._numSamples>1?this._multisampleFramebuffer.getRenderFramebuffer():this._framebuffer}},numSamples:{get:function(){return this._numSamples}},status:{get:function(){return this.framebuffer.status}}});fa.prototype.isDirty=function(e,t,n,i,o){n=n??1;let r=this._width!==e||this._height!==t,s=this._numSamples!==n,a=l(i)&&this._pixelDatatype!==i||l(o)&&this._pixelFormat!==o,c=n===1?l(this._framebuffer):l(this._multisampleFramebuffer);return this._attachmentsDirty||r||s||a||!c||this._color&&!l(this._colorTextures[0])};fa.prototype.update=function(e,t,n,i,o,r){if(i=e.msaa?i??1:1,o=o??(this._color?this._pixelDatatype??Ue.UNSIGNED_BYTE:void 0),r=r??(this._color?this._pixelFormat??Qe.RGBA:void 0),this.isDirty(t,n,i,o,r)){if(this.destroy(),this._width=t,this._height=n,this._numSamples=i,this._pixelDatatype=o,this._pixelFormat=r,this._attachmentsDirty=!1,this._color&&this._createColorAttachments){for(let s=0;s1){let a=Ml.getColorFormat(o);this._colorRenderbuffers[s]=new _u({context:e,width:t,height:n,format:a,numSamples:this._numSamples})}}this._depthStencil&&this._createDepthAttachments&&(this._supportsDepthTexture&&e.depthTexture?(this._depthStencilTexture=new vt({context:e,width:t,height:n,pixelFormat:Qe.DEPTH_STENCIL,pixelDatatype:Ue.UNSIGNED_INT_24_8,sampler:Ot.NEAREST}),this._numSamples>1&&(this._depthStencilRenderbuffer=new _u({context:e,width:t,height:n,format:Ml.DEPTH24_STENCIL8,numSamples:this._numSamples}))):this._depthStencilRenderbuffer=new _u({context:e,width:t,height:n,format:Ml.DEPTH_STENCIL})),this._depth&&this._createDepthAttachments&&(this._supportsDepthTexture&&e.depthTexture?this._depthTexture=new vt({context:e,width:t,height:n,pixelFormat:Qe.DEPTH_COMPONENT,pixelDatatype:Ue.UNSIGNED_INT,sampler:Ot.NEAREST}):this._depthRenderbuffer=new _u({context:e,width:t,height:n,format:Ml.DEPTH_COMPONENT16})),this._numSamples>1?this._multisampleFramebuffer=new pv({context:e,width:this._width,height:this._height,colorTextures:this._colorTextures,colorRenderbuffers:this._colorRenderbuffers,depthStencilTexture:this._depthStencilTexture,depthStencilRenderbuffer:this._depthStencilRenderbuffer,destroyAttachments:!1}):this._framebuffer=new fs({context:e,colorTextures:this._colorTextures,depthTexture:this._depthTexture,depthRenderbuffer:this._depthRenderbuffer,depthStencilTexture:this._depthStencilTexture,depthStencilRenderbuffer:this._depthStencilRenderbuffer,destroyAttachments:!1})}};fa.prototype.getColorTexture=function(e){return e=e??0,this._colorTextures[e]};fa.prototype.setColorTexture=function(e,t){t=t??0,this._attachmentsDirty=e!==this._colorTextures[t],this._colorTextures[t]=e};fa.prototype.getColorRenderbuffer=function(e){return e=e??0,this._colorRenderbuffers[e]};fa.prototype.setColorRenderbuffer=function(e,t){t=t??0,this._attachmentsDirty=e!==this._colorRenderbuffers[t],this._colorRenderbuffers[t]=e};fa.prototype.getDepthRenderbuffer=function(){return this._depthRenderbuffer};fa.prototype.setDepthRenderbuffer=function(e){this._attachmentsDirty=e!==this._depthRenderbuffer,this._depthRenderbuffer=e};fa.prototype.getDepthTexture=function(){return this._depthTexture};fa.prototype.setDepthTexture=function(e){this._attachmentsDirty=e!==this._depthTexture,this._depthTexture=e};fa.prototype.getDepthStencilRenderbuffer=function(){return this._depthStencilRenderbuffer};fa.prototype.setDepthStencilRenderbuffer=function(e){this._attachmentsDirty=e!==this._depthStencilRenderbuffer,this._depthStencilRenderbuffer=e};fa.prototype.getDepthStencilTexture=function(){return this._depthStencilTexture};fa.prototype.setDepthStencilTexture=function(e){this._attachmentsDirty=e!==this._depthStencilTexture,this._depthStencilTexture=e};fa.prototype.prepareTextures=function(e,t){this._numSamples>1&&this._multisampleFramebuffer.blitFramebuffers(e,t)};fa.prototype.clear=function(e,t,n){let i=t.framebuffer;t.framebuffer=this.framebuffer,t.execute(e,n),t.framebuffer=i};fa.prototype.destroyFramebuffer=function(){this._framebuffer=this._framebuffer&&this._framebuffer.destroy(),this._multisampleFramebuffer=this._multisampleFramebuffer&&this._multisampleFramebuffer.destroy()};fa.prototype.destroy=function(){if(this._color){let e=this._colorTextures,t=this._colorRenderbuffers;for(let n=0;n{n.getStatus()===ie.SIGNALED?o():s<=0?r(new ae("Wait for signal timeout")):e(i(o,r,s-1))}}return new Promise((o,r)=>{e(i(o,r,t))})};var _v=y_;var cun=x(T(),1);function Xy(e){e=e??B.EMPTY_OBJECT;let{context:t,source:n,pixelFormat:i=Qe.RGBA,pixelDatatype:o=Ue.UNSIGNED_BYTE,flipY:r=!0,skipColorSpaceConversion:s=!1,sampler:a=new Ot}=e;if(!t.webgl2&&!l(t.options.getWebGLStub))throw new ge("WebGL1 does not support texture3D. Please use a WebGL2 context.");let{width:c,height:d,depth:u}=e;l(n)&&(l(c)||(c=n.width),l(d)||(d=n.height),l(u)||(u=n.depth));let m=e.preMultiplyAlpha||i===Qe.RGB||i===Qe.LUMINANCE,p=Qe.toInternalFormat(i,o,t),b=Qe.isCompressedFormat(p),f=t._gl,y=Qe.texture3DSizeInBytes(i,o,c,d,u);if(this._id=e.id??Qn(),this._context=t,this._textureFilterAnisotropic=t._textureFilterAnisotropic,this._textureTarget=f.TEXTURE_3D,this._texture=f.createTexture(),this._internalFormat=p,this._pixelFormat=i,this._pixelDatatype=o,this._width=c,this._height=d,this._depth=u,this._dimensions=new h(c,d,u),this._hasMipmap=!1,this._sizeInBytes=y,this._preMultiplyAlpha=m,this._flipY=r,this._initialized=!1,this._sampler=void 0,this._sampler=a,qme(this,a),f.activeTexture(f.TEXTURE0),f.bindTexture(this._textureTarget,this._texture),l(n)){if(s?f.pixelStorei(f.UNPACK_COLORSPACE_CONVERSION_WEBGL,f.NONE):f.pixelStorei(f.UNPACK_COLORSPACE_CONVERSION_WEBGL,f.BROWSER_DEFAULT_WEBGL),!l(n.arrayBufferView))throw new ge("For Texture3D, options.source.arrayBufferView must be defined");jme(this,n),this._initialized=!0}else Qme(this);f.bindTexture(this._textureTarget,null)}function jme(e,t){let n=e._context,i=n._gl,o=e._textureTarget,r=e._internalFormat,{width:s,height:a,depth:c,pixelFormat:d,pixelDatatype:u,flipY:m}=e,p=Qe.alignmentInBytes(d,u,s);i.pixelStorei(i.UNPACK_ALIGNMENT,p),i.pixelStorei(i.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!1),i.pixelStorei(i.UNPACK_FLIP_Y_WEBGL,!1);let{arrayBufferView:b}=t;m&&console.warn("texture3D.flipY is not supported.");let f=1;if(t.mipLevels&&t.mipLevels.length&&(f=t.mipLevels.length+1),i.texStorage3D(o,f,r,s,a,c),i.texSubImage3D(o,0,0,0,0,s,a,c,d,Ue.toWebGLConstant(u,n),b),f>1){let y=s,_=a,S=c;for(let Z=0;Za){e.childNode1=new Zv({x:i.x,y:i.y,width:t,height:r});let u=s-c;return u>0&&(e.childNode2=new Zv({x:i.x+t+c,y:i.y,width:u,height:r})),this._findNode(e.childNode1,{width:t,height:n})}e.childNode1=new Zv({x:i.x,y:i.y,width:o,height:n});let d=a-c;return d>0&&(e.childNode2=new Zv({x:i.x,y:i.y+n+c,width:o,height:d})),this._findNode(e.childNode1,{width:t,height:n})}return this._findNode(e.childNode1,{width:t,height:n})||this._findNode(e.childNode2,{width:t,height:n})}};var g1=_Q;var $me=16;function kl(e){e=e??B.EMPTY_OBJECT;let t=e.borderWidthInPixels??1,n=e.initialSize??new k($me,$me);this._pixelFormat=e.pixelFormat??Qe.RGBA,this._sampler=e.sampler,this._borderWidthInPixels=t,this._initialSize=n,this._texturePacker=void 0,this._rectangles=[],this._subRegions=new Map,this._guid=Qn(),this._imagesToAddQueue=[],this._indexById=new Map,this._indexPromiseById=new Map,this._nextIndex=0}Object.defineProperties(kl.prototype,{borderWidthInPixels:{get:function(){return this._borderWidthInPixels}},rectangles:{get:function(){return this._rectangles}},texture:{get:function(){return this._texture}},pixelFormat:{get:function(){return this._pixelFormat}},sampler:{get:function(){return this._sampler}},numberOfImages:{get:function(){return this._nextIndex}},guid:{get:function(){return this._guid}},sizeInBytes:{get:function(){return l(this._texture)?this._texture.sizeInBytes:0}}});kl.prototype.computeTextureCoordinates=function(e,t){let n=this._texture,i=this._rectangles[e];if(l(t)||(t=new nt),!l(i))return t.x=0,t.y=0,t.width=0,t.height=0,t;let o=n.width,r=n.height,s=i.width,a=i.height,c=i.x,d=i.y,u=this._subRegions.get(e);if(l(u)){let m=this._rectangles[u];c+=m.x,d+=m.y}return t.x=c/o,t.y=d/r,t.width=s/o,t.height=a/r,t};kl.prototype._copyFromTexture=function(e,t,n,i){let o=this._pixelFormat,r=this._sampler,s=new vt({context:e,height:n,width:t,pixelFormat:o,sampler:r}),a=e._gl,c=s._textureTarget,d=this._texture,u=new fs({context:e,colorTextures:[d],destroyAttachments:!1});a.activeTexture(a.TEXTURE0),a.bindTexture(c,s._texture),u._bind();let m=this.rectangles,p=this._subRegions;for(let b=0;bnew ehe({index:S,image:_})).filter((_,S)=>l(_.image)&&!l(c.get(S))),u=0,m=0,p=0;for(let _=t;_=s*a;)s>a?a*=2:s*=2;d.sort(({image:_},{image:S})=>S.height*S.width-_.height*_.width);let b=new Array(this._nextIndex);for(let _ of this._subRegions.keys())l(c.get(_))&&(b[_]=i[_]);let f,y=!1;for(;!y;){f=new g1({height:a,width:s,borderPadding:n});let _;for(_=0;_a?a*=2:s*=2;break}b[S]=R.rectangle}y=_===d.length}this._texturePacker=f,this._texture=this._copyFromTexture(e,s,a,b),r.destroy(),this._rectangles=b,this._guid=Qn()};kl.prototype.getImageIndex=function(e){return this._indexById.get(e)};kl.prototype._copyImageToTexture=function({index:e,image:t,resolve:n,reject:i}){let o=this._texture,r=this._rectangles[e];try{o.copyFrom({source:t,xOffset:r.x,yOffset:r.y}),l(n)&&n(e)}catch(s){if(l(i)){i(s);return}}};function ehe({index:e,image:t,resolve:n,reject:i}){this.index=e,this.image=t,this.resolve=n,this.reject=i,this.rectangle=void 0}kl.prototype._addImage=function(e,t){return new Promise((n,i)=>{this._imagesToAddQueue.push(new ehe({index:e,image:t,resolve:n,reject:i})),this._imagesToAddQueue.sort(({image:o},{image:r})=>r.height*r.width-o.height*o.width)})};kl.prototype._processImageQueue=function(e){let t=this._imagesToAddQueue;if(t.length===0)return!1;this._rectangles.length=this._nextIndex;let n,i;for(n=0;n{let a=await cOe(t,e);if(this.isDestroyed()||!l(a))return this._indexPromiseById.delete(e),-1;l(n)&&(a.width=n),l(i)&&(a.height=i);let c=await this._addImage(r,a);return this._indexPromiseById.delete(e),c})(),this._indexPromiseById.set(e,o),o)};kl.prototype.getCachedImageSubRegion=function(e,t,n){let i=this._indexPromiseById.get(e);for(let[o,r]of this._subRegions.entries())if(n===r&&this._rectangles[o].equals(t))return i?i.then(a=>a===-1?-1:o):o};kl.prototype.addImageSubRegion=function(e,t){let n=this._indexById.get(e);if(!l(n))throw new ae(`image with id "${e}" not found in the atlas.`);let i=this.getCachedImageSubRegion(e,t,n);return l(i)?i:(i=this._nextIndex++,this._subRegions.set(i,n),this._rectangles[i]=t.clone(),(this._indexPromiseById.get(e)??Promise.resolve(n)).then(r=>{if(r===-1)return-1;let s=this._rectangles[r];return i}))};kl.prototype.isDestroyed=function(){return!1};kl.prototype.destroy=function(){return this._texture=this._texture&&this._texture.destroy(),this._imagesToAddQueue.forEach(({resolve:e})=>{l(e)&&e(-1)}),ue(this)};var x_=kl;var Xun=x(T(),1);function Pa(e,t,n,i){let o=Pa._verifyAttributes(t);n=n??0;let r=[],s={},a,c,d=o.length;for(let m=0;m0?J.getSizeInBytes(e[0].componentDatatype):0,o=i>0?t%i:0,r=o===0?0:i-o;return t+=r,t};Pa._createArrayViews=function(e,t){let n=[],i=0,o=e.length;for(let r=0;r0){let n=new ArrayBuffer(t*e.vertexSizeInBytes);if(l(e.arrayBuffer)){let r=new Uint8Array(n),s=new Uint8Array(e.arrayBuffer),a=s.length;for(let c=0;c0){t.needsCommit=!1;let n=t.vertexBuffer,i=e._size*t.vertexSizeInBytes,o=l(n);if(!o||n.sizeInBytes0){let i=e.vertexSizeInBytes*t,o=e.vertexSizeInBytes*n;e.vertexBuffer.copyFromArrayView(new Uint8Array(e.arrayBuffer,i,o),i)}}Pa.prototype.endSubCommits=function(){let e=this._allBuffers;for(let t=0,n=e.length;t{n.getStatus()===ie.SIGNALED?o():s<=0?r(new ae("Wait for signal timeout")):e(i(o,r,s-1))}}return new Promise((o,r)=>{e(i(o,r,t))})};var _v=y_;var lun=x(T(),1);function Xy(e){e=e??B.EMPTY_OBJECT;let{context:t,source:n,pixelFormat:i=Qe.RGBA,pixelDatatype:o=Ue.UNSIGNED_BYTE,flipY:r=!0,skipColorSpaceConversion:s=!1,sampler:a=new Ot}=e;if(!t.webgl2&&!l(t.options.getWebGLStub))throw new ge("WebGL1 does not support texture3D. Please use a WebGL2 context.");let{width:c,height:d,depth:u}=e;l(n)&&(l(c)||(c=n.width),l(d)||(d=n.height),l(u)||(u=n.depth));let m=e.preMultiplyAlpha||i===Qe.RGB||i===Qe.LUMINANCE,p=Qe.toInternalFormat(i,o,t),b=Qe.isCompressedFormat(p),f=t._gl,y=Qe.texture3DSizeInBytes(i,o,c,d,u);if(this._id=e.id??Qn(),this._context=t,this._textureFilterAnisotropic=t._textureFilterAnisotropic,this._textureTarget=f.TEXTURE_3D,this._texture=f.createTexture(),this._internalFormat=p,this._pixelFormat=i,this._pixelDatatype=o,this._width=c,this._height=d,this._depth=u,this._dimensions=new h(c,d,u),this._hasMipmap=!1,this._sizeInBytes=y,this._preMultiplyAlpha=m,this._flipY=r,this._initialized=!1,this._sampler=void 0,this._sampler=a,qme(this,a),f.activeTexture(f.TEXTURE0),f.bindTexture(this._textureTarget,this._texture),l(n)){if(s?f.pixelStorei(f.UNPACK_COLORSPACE_CONVERSION_WEBGL,f.NONE):f.pixelStorei(f.UNPACK_COLORSPACE_CONVERSION_WEBGL,f.BROWSER_DEFAULT_WEBGL),!l(n.arrayBufferView))throw new ge("For Texture3D, options.source.arrayBufferView must be defined");jme(this,n),this._initialized=!0}else Qme(this);f.bindTexture(this._textureTarget,null)}function jme(e,t){let n=e._context,i=n._gl,o=e._textureTarget,r=e._internalFormat,{width:s,height:a,depth:c,pixelFormat:d,pixelDatatype:u,flipY:m}=e,p=Qe.alignmentInBytes(d,u,s);i.pixelStorei(i.UNPACK_ALIGNMENT,p),i.pixelStorei(i.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!1),i.pixelStorei(i.UNPACK_FLIP_Y_WEBGL,!1);let{arrayBufferView:b}=t;m&&console.warn("texture3D.flipY is not supported.");let f=1;if(t.mipLevels&&t.mipLevels.length&&(f=t.mipLevels.length+1),i.texStorage3D(o,f,r,s,a,c),i.texSubImage3D(o,0,0,0,0,s,a,c,d,Ue.toWebGLConstant(u,n),b),f>1){let y=s,_=a,S=c;for(let Z=0;Za){e.childNode1=new Zv({x:i.x,y:i.y,width:t,height:r});let u=s-c;return u>0&&(e.childNode2=new Zv({x:i.x+t+c,y:i.y,width:u,height:r})),this._findNode(e.childNode1,{width:t,height:n})}e.childNode1=new Zv({x:i.x,y:i.y,width:o,height:n});let d=a-c;return d>0&&(e.childNode2=new Zv({x:i.x,y:i.y+n+c,width:o,height:d})),this._findNode(e.childNode1,{width:t,height:n})}return this._findNode(e.childNode1,{width:t,height:n})||this._findNode(e.childNode2,{width:t,height:n})}};var g1=_Q;var $me=16;function kl(e){e=e??B.EMPTY_OBJECT;let t=e.borderWidthInPixels??1,n=e.initialSize??new k($me,$me);this._pixelFormat=e.pixelFormat??Qe.RGBA,this._sampler=e.sampler,this._borderWidthInPixels=t,this._initialSize=n,this._texturePacker=void 0,this._rectangles=[],this._subRegions=new Map,this._guid=Qn(),this._imagesToAddQueue=[],this._indexById=new Map,this._indexPromiseById=new Map,this._nextIndex=0}Object.defineProperties(kl.prototype,{borderWidthInPixels:{get:function(){return this._borderWidthInPixels}},rectangles:{get:function(){return this._rectangles}},texture:{get:function(){return this._texture}},pixelFormat:{get:function(){return this._pixelFormat}},sampler:{get:function(){return this._sampler}},numberOfImages:{get:function(){return this._nextIndex}},guid:{get:function(){return this._guid}},sizeInBytes:{get:function(){return l(this._texture)?this._texture.sizeInBytes:0}}});kl.prototype.computeTextureCoordinates=function(e,t){let n=this._texture,i=this._rectangles[e];if(l(t)||(t=new nt),!l(i))return t.x=0,t.y=0,t.width=0,t.height=0,t;let o=n.width,r=n.height,s=i.width,a=i.height,c=i.x,d=i.y,u=this._subRegions.get(e);if(l(u)){let m=this._rectangles[u];c+=m.x,d+=m.y}return t.x=c/o,t.y=d/r,t.width=s/o,t.height=a/r,t};kl.prototype._copyFromTexture=function(e,t,n,i){let o=this._pixelFormat,r=this._sampler,s=new vt({context:e,height:n,width:t,pixelFormat:o,sampler:r}),a=e._gl,c=s._textureTarget,d=this._texture,u=new fs({context:e,colorTextures:[d],destroyAttachments:!1});a.activeTexture(a.TEXTURE0),a.bindTexture(c,s._texture),u._bind();let m=this.rectangles,p=this._subRegions;for(let b=0;bnew ehe({index:S,image:_})).filter((_,S)=>l(_.image)&&!l(c.get(S))),u=0,m=0,p=0;for(let _=t;_=s*a;)s>a?a*=2:s*=2;d.sort(({image:_},{image:S})=>S.height*S.width-_.height*_.width);let b=new Array(this._nextIndex);for(let _ of this._subRegions.keys())l(c.get(_))&&(b[_]=i[_]);let f,y=!1;for(;!y;){f=new g1({height:a,width:s,borderPadding:n});let _;for(_=0;_a?a*=2:s*=2;break}b[S]=R.rectangle}y=_===d.length}this._texturePacker=f,this._texture=this._copyFromTexture(e,s,a,b),r.destroy(),this._rectangles=b,this._guid=Qn()};kl.prototype.getImageIndex=function(e){return this._indexById.get(e)};kl.prototype._copyImageToTexture=function({index:e,image:t,resolve:n,reject:i}){let o=this._texture,r=this._rectangles[e];try{o.copyFrom({source:t,xOffset:r.x,yOffset:r.y}),l(n)&&n(e)}catch(s){if(l(i)){i(s);return}}};function ehe({index:e,image:t,resolve:n,reject:i}){this.index=e,this.image=t,this.resolve=n,this.reject=i,this.rectangle=void 0}kl.prototype._addImage=function(e,t){return new Promise((n,i)=>{this._imagesToAddQueue.push(new ehe({index:e,image:t,resolve:n,reject:i})),this._imagesToAddQueue.sort(({image:o},{image:r})=>r.height*r.width-o.height*o.width)})};kl.prototype._processImageQueue=function(e){let t=this._imagesToAddQueue;if(t.length===0)return!1;this._rectangles.length=this._nextIndex;let n,i;for(n=0;n{let a=await lOe(t,e);if(this.isDestroyed()||!l(a))return this._indexPromiseById.delete(e),-1;l(n)&&(a.width=n),l(i)&&(a.height=i);let c=await this._addImage(r,a);return this._indexPromiseById.delete(e),c})(),this._indexPromiseById.set(e,o),o)};kl.prototype.getCachedImageSubRegion=function(e,t,n){let i=this._indexPromiseById.get(e);for(let[o,r]of this._subRegions.entries())if(n===r&&this._rectangles[o].equals(t))return i?i.then(a=>a===-1?-1:o):o};kl.prototype.addImageSubRegion=function(e,t){let n=this._indexById.get(e);if(!l(n))throw new ae(`image with id "${e}" not found in the atlas.`);let i=this.getCachedImageSubRegion(e,t,n);return l(i)?i:(i=this._nextIndex++,this._subRegions.set(i,n),this._rectangles[i]=t.clone(),(this._indexPromiseById.get(e)??Promise.resolve(n)).then(r=>{if(r===-1)return-1;let s=this._rectangles[r];return i}))};kl.prototype.isDestroyed=function(){return!1};kl.prototype.destroy=function(){return this._texture=this._texture&&this._texture.destroy(),this._imagesToAddQueue.forEach(({resolve:e})=>{l(e)&&e(-1)}),ue(this)};var x_=kl;var Nun=x(T(),1);function Pa(e,t,n,i){let o=Pa._verifyAttributes(t);n=n??0;let r=[],s={},a,c,d=o.length;for(let m=0;m0?J.getSizeInBytes(e[0].componentDatatype):0,o=i>0?t%i:0,r=o===0?0:i-o;return t+=r,t};Pa._createArrayViews=function(e,t){let n=[],i=0,o=e.length;for(let r=0;r0){let n=new ArrayBuffer(t*e.vertexSizeInBytes);if(l(e.arrayBuffer)){let r=new Uint8Array(n),s=new Uint8Array(e.arrayBuffer),a=s.length;for(let c=0;c0){t.needsCommit=!1;let n=t.vertexBuffer,i=e._size*t.vertexSizeInBytes,o=l(n);if(!o||n.sizeInBytes0){let i=e.vertexSizeInBytes*t,o=e.vertexSizeInBytes*n;e.vertexBuffer.copyFromArrayView(new Uint8Array(e.arrayBuffer,i,o),i)}}Pa.prototype.endSubCommits=function(){let e=this._allBuffers;for(let t=0,n=e.length;t opaqueDepth, 1.0, translucentDepth); out_FragColor = czm_packDepth(translucentDepth); } -`;var bmn=x(T(),1),Yv=`uniform sampler2D u_opaque; +`;var gmn=x(T(),1),Yv=`uniform sampler2D u_opaque; uniform sampler2D u_accumulation; uniform sampler2D u_revealage; in vec2 v_textureCoordinates; @@ -2956,7 +2956,7 @@ if (opaque != czm_backgroundColor) out_FragColor.a = 1.0; } } -`;var ymn=x(T(),1),Mv=`uniform samplerCube u_radianceMap; +`;var xmn=x(T(),1),Mv=`uniform samplerCube u_radianceMap; in vec2 v_textureCoordinates; const float twoSqrtPi = 2.0 * sqrt(czm_pi); float computeShBasis(int index, vec3 s) { @@ -3031,7 +3031,7 @@ vec4 color = czm_textureCube(u_radianceMap, lookupDirection, 0.0); out_FragColor += Ylm * color * solidAngle * sinTheta; } } -`;var Tmn=x(T(),1),wv=`precision highp float; +`;var _mn=x(T(),1),wv=`precision highp float; in vec2 v_textureCoordinates; uniform vec3 u_faceDirection; uniform vec3 u_positionWC; @@ -3110,7 +3110,7 @@ color.rgb = pow(color.rgb, vec3(gamma)); color.rgb = czm_gammaCorrect(color.rgb); out_FragColor = color; } -`;var Smn=x(T(),1),kv=`precision highp float; +`;var Zmn=x(T(),1),kv=`precision highp float; in vec3 v_textureCoordinates; uniform float u_roughness; uniform samplerCube u_radianceTexture; @@ -3170,7 +3170,7 @@ weight += NdotL; } out_FragColor = color / weight; } -`;var Rmn=x(T(),1),Uv=`in vec3 position; +`;var Cmn=x(T(),1),Uv=`in vec3 position; out vec3 v_textureCoordinates; uniform vec3 u_faceDirection; vec3 getCubeMapDirection(vec2 uv, vec3 faceDir) { @@ -3190,7 +3190,7 @@ v_textureCoordinates.y = -v_textureCoordinates.y; v_textureCoordinates.z = -v_textureCoordinates.z; gl_Position = vec4(position, 1.0); } -`;var Vmn=x(T(),1),Dv=`uniform mat3 u_cubeMapPanoramaTransform; +`;var Emn=x(T(),1),Dv=`uniform mat3 u_cubeMapPanoramaTransform; in vec3 position; out vec3 v_texCoord; void main() @@ -3199,7 +3199,7 @@ vec3 p = czm_viewRotation * (u_cubeMapPanoramaTransform * (czm_entireFrustum.y * gl_Position = czm_projection * vec4(p, 1.0); v_texCoord = position.xyz; } -`;var Amn=x(T(),1),Ov=`in vec4 positionEC; +`;var Gmn=x(T(),1),Ov=`in vec4 positionEC; void main() { vec3 position; @@ -3230,7 +3230,7 @@ discard; } czm_writeLogDepth(); } -`;var Lmn=x(T(),1),Bv=`in vec4 position; +`;var Wmn=x(T(),1),Bv=`in vec4 position; out vec4 positionEC; void main() { @@ -3238,7 +3238,7 @@ positionEC = czm_modelView * position; gl_Position = czm_projection * positionEC; czm_vertexLogDepth(); } -`;var vmn=x(T(),1),x1=`uniform vec3 u_radii; +`;var Fmn=x(T(),1),x1=`uniform vec3 u_radii; uniform vec3 u_oneOverEllipsoidRadiiSquared; in vec3 v_positionEC; vec4 computeEllipsoidColor(czm_ray ray, float intersection, float side) @@ -3311,7 +3311,7 @@ gl_FragDepth = (z * (f - n) + f + n) * 0.5; #endif #endif } -`;var Imn=x(T(),1),T1=`in vec3 position; +`;var Pmn=x(T(),1),T1=`in vec3 position; uniform vec3 u_radii; out vec3 v_positionEC; void main() @@ -3323,7 +3323,7 @@ gl_Position = czm_projection * pEC; gl_Position.z = clamp(gl_Position.z, czm_depthRange.near, czm_depthRange.far); czm_vertexLogDepth(); } -`;var Xmn=x(T(),1);/** +`;var Nmn=x(T(),1);/** * @license * Copyright (c) 2014-2015, NVIDIA CORPORATION. All rights reserved. * @@ -3820,7 +3820,7 @@ if(!horzSpan) posM.x += pixelOffsetSubpix * lengthSign; if( horzSpan) posM.y += pixelOffsetSubpix * lengthSign; return FxaaFloat4(FxaaTexTop(tex, posM).xyz, lumaM); } -`;var Ymn=x(T(),1),Hv=`uniform vec4 u_initialColor; +`;var Mmn=x(T(),1),Hv=`uniform vec4 u_initialColor; #if TEXTURE_UNITS > 0 uniform sampler2D u_dayTextures[TEXTURE_UNITS]; uniform vec4 u_dayTextureTranslationAndScale[TEXTURE_UNITS]; @@ -4323,7 +4323,7 @@ vec3 color = imageryColor.rgb + diffuseHighlight + nonDiffuseHighlight + specula return vec4(color, imageryColor.a); } #endif // #ifdef SHOW_REFLECTIVE_OCEAN -`;var wmn=x(T(),1),Kv=`#ifdef QUANTIZATION_BITS12 +`;var kmn=x(T(),1),Kv=`#ifdef QUANTIZATION_BITS12 in vec4 compressed0; in float compressed1; #else @@ -4522,7 +4522,7 @@ v_aspect = czm_branchFreeTernary(determ < 0.0, 2.0 * czm_pi - v_aspect, v_aspect v_height = height; #endif } -`;var Umn=x(T(),1),_1=`void computeAtmosphereScattering(vec3 positionWC, vec3 lightDirection, out vec3 rayleighColor, out vec3 mieColor, out float opacity) { +`;var Dmn=x(T(),1),_1=`void computeAtmosphereScattering(vec3 positionWC, vec3 lightDirection, out vec3 rayleighColor, out vec3 mieColor, out float opacity) { vec3 cameraToPositionWC = positionWC - czm_viewerPositionWC; vec3 cameraToPositionWCDirection = normalize(cameraToPositionWC); czm_ray primaryRay = czm_ray(czm_viewerPositionWC, cameraToPositionWCDirection); @@ -4537,7 +4537,7 @@ mieColor, opacity ); } -`;var Omn=x(T(),1),Ny=`in vec4 v_color; +`;var Bmn=x(T(),1),Ny=`in vec4 v_color; in vec4 v_outlineColor; in float v_innerPercent; in float v_pixelDistance; @@ -4574,7 +4574,7 @@ discard; out_FragColor = czm_gammaCorrect(color); czm_writeLogDepth(); } -`;var zmn=x(T(),1),Jv=`uniform float u_maxTotalPointSize; +`;var Hmn=x(T(),1),Jv=`uniform float u_maxTotalPointSize; in vec4 positionHighAndSize; in vec4 positionLowAndOutline; in vec4 compressedAttribute0; @@ -4686,7 +4686,7 @@ gl_Position *= show; v_pickColor = pickColor; v_splitDirection = distanceDisplayConditionAndDisableDepthAndSplitDirection.w; } -`;var Kmn=x(T(),1),Ul=`void clipLineSegmentToNearPlane( +`;var Jmn=x(T(),1),Ul=`void clipLineSegmentToNearPlane( vec3 p0, vec3 p1, out vec4 positionWC, @@ -4796,7 +4796,7 @@ vec4 prevEC = czm_modelViewRelativeToEye * previous; vec4 nextEC = czm_modelViewRelativeToEye * next; return getPolylineWindowCoordinatesEC(positionEC, prevEC, nextEC, expandDirection, width, usePrevious, angle); } -`;var jmn=x(T(),1),T_=`#ifdef VECTOR_TILE +`;var Qmn=x(T(),1),T_=`#ifdef VECTOR_TILE uniform vec4 u_highlightColor; #endif in vec2 v_st; @@ -4815,7 +4815,7 @@ out_FragColor *= u_highlightColor; #endif czm_writeLogDepth(); } -`;var qmn=x(T(),1),jv=`in vec4 v_startPlaneNormalEcAndHalfWidth; +`;var $mn=x(T(),1),jv=`in vec4 v_startPlaneNormalEcAndHalfWidth; in vec4 v_endPlaneNormalEcAndBatchId; in vec4 v_rightPlaneEC; in vec4 v_endEcAndStartEcX; @@ -4872,7 +4872,7 @@ out_FragColor = vec4(material.diffuse + material.emission, material.alpha); out_FragColor.rgb *= out_FragColor.a; czm_writeDepthClamp(); } -`;var ehn=x(T(),1),Qv=`in vec3 v_forwardDirectionEC; +`;var thn=x(T(),1),Qv=`in vec3 v_forwardDirectionEC; in vec3 v_texcoordNormalizationAndHalfWidth; in float v_batchId; #ifdef PER_INSTANCE_COLOR @@ -4905,7 +4905,7 @@ czm_material material = czm_getMaterial(materialInput); out_FragColor = vec4(material.diffuse + material.emission, material.alpha); #endif // PER_INSTANCE_COLOR } -`;var nhn=x(T(),1),qv=`in vec3 position3DHigh; +`;var ihn=x(T(),1),qv=`in vec3 position3DHigh; in vec3 position3DLow; in vec4 startHiAndForwardOffsetX; in vec4 startLoAndForwardOffsetY; @@ -5025,7 +5025,7 @@ approxLineDirection.y = czm_branchFreeTernary(approxLineDirection.x == 0.0 && ap v_polylineAngle = czm_fastApproximateAtan(approxLineDirection.x, approxLineDirection.y); #endif } -`;var ohn=x(T(),1),$v=`in vec3 position3DHigh; +`;var rhn=x(T(),1),$v=`in vec3 position3DHigh; in vec3 position3DLow; #ifndef COLUMBUS_VIEW_2D in vec4 startHiAndForwardOffsetX; @@ -5129,7 +5129,7 @@ approxLineDirection.y = czm_branchFreeTernary(approxLineDirection.x == 0.0 && ap v_polylineAngle = czm_fastApproximateAtan(approxLineDirection.x, approxLineDirection.y); #endif } -`;var shn=x(T(),1),e2=`in vec3 position3DHigh; +`;var ahn=x(T(),1),e2=`in vec3 position3DHigh; in vec3 position3DLow; in vec3 position2DHigh; in vec3 position2DLow; @@ -5220,7 +5220,7 @@ v_width = width; v_pickColor = pickColor; v_polylineAngle = polylineAngle; } -`;var chn=x(T(),1),t2=`void main() { +`;var lhn=x(T(),1),t2=`void main() { if (v_splitDirection < 0.0 && gl_FragCoord.x > czm_splitPosition) discard; if (v_splitDirection > 0.0 && gl_FragCoord.x < czm_splitPosition) discard; float A = -dot(v_vertPos, v_vertPos); @@ -5230,7 +5230,7 @@ discard; float B = exp(A * 4.) * v_splatColor.a ; out_FragColor = vec4(v_splatColor.rgb * B , B); } -`;var dhn=x(T(),1),n2=`#if defined(HAS_SPHERICAL_HARMONICS) +`;var uhn=x(T(),1),n2=`#if defined(HAS_SPHERICAL_HARMONICS) const uint coefficientCount[3] = uint[3](3u,8u,15u); const float SH_C1 = 0.48860251; const float SH_C2[5] = float[5]( @@ -5376,13 +5376,13 @@ v_splatColor.rgb += evaluateSH(texIdx, viewDirModel).rgb; #endif v_splitDirection = u_splitDirection; } -`;var mhn=x(T(),1),i2=`uniform sampler2D u_texture; +`;var hhn=x(T(),1),i2=`uniform sampler2D u_texture; in vec2 v_textureCoordinates; void main() { out_FragColor = texture(u_texture, v_textureCoordinates); } -`;var fhn=x(T(),1),o2=`in vec4 position; +`;var phn=x(T(),1),o2=`in vec4 position; in float webMercatorT; uniform vec2 u_textureDimensions; out vec2 v_textureCoordinates; @@ -5391,7 +5391,7 @@ void main() v_textureCoordinates = vec2(position.x, webMercatorT); gl_Position = czm_viewportOrthographic * (position * vec4(u_textureDimensions, 1.0, 1.0)); } -`;var bhn=x(T(),1),S1=`#ifdef TEXTURE_COORDINATES +`;var ghn=x(T(),1),S1=`#ifdef TEXTURE_COORDINATES #ifdef SPHERICAL in vec4 v_sphericalExtents; #else // SPHERICAL @@ -5502,7 +5502,7 @@ out_FragColor.rgb *= out_FragColor.a; czm_writeDepthClamp(); #endif // PICK } -`;var yhn=x(T(),1),r2=`in vec3 position3DHigh; +`;var xhn=x(T(),1),r2=`in vec3 position3DHigh; in vec3 position3DLow; in float batchId; #ifdef EXTRUDED_GEOMETRY @@ -5577,7 +5577,7 @@ v_color = czm_batchTable_color(batchId); #endif gl_Position = czm_depthClamp(czm_modelViewProjectionRelativeToEye * position); } -`;var Thn=x(T(),1),Yy=`#ifdef VECTOR_TILE +`;var _hn=x(T(),1),Yy=`#ifdef VECTOR_TILE uniform vec4 u_highlightColor; #endif void main(void) @@ -5589,7 +5589,7 @@ out_FragColor = vec4(1.0); #endif czm_writeDepthClamp(); } -`;var Shn=x(T(),1),Z1=`float interpolateByDistance(vec4 nearFarScalar, float distance) +`;var Zhn=x(T(),1),Z1=`float interpolateByDistance(vec4 nearFarScalar, float distance) { float startDistance = nearFarScalar.x; float startValue = nearFarScalar.y; @@ -5642,7 +5642,7 @@ opacity = clamp((atmosphereOuterRadius - cameraHeight) / (atmosphereOuterRadius float nightAlpha = (u_radiiAndDynamicAtmosphereColor.z != 0.0) ? clamp(dot(normalize(positionWC), lightDirection), 0.0, 1.0) : 1.0; opacity *= pow(nightAlpha, 0.5); } -`;var Rhn=x(T(),1),s2=`in vec3 v_outerPositionWC; +`;var Chn=x(T(),1),s2=`in vec3 v_outerPositionWC; uniform vec3 u_hsbShift; #ifndef PER_FRAGMENT_ATMOSPHERE in vec3 v_mieColor; @@ -5687,7 +5687,7 @@ color.a = mix(color.b, 1.0, color.a) * smoothstep(0.0, 1.0, czm_morphTime); } out_FragColor = color; } -`;var Vhn=x(T(),1),a2=`in vec4 position; +`;var Ehn=x(T(),1),a2=`in vec4 position; out vec3 v_outerPositionWC; #ifndef PER_FRAGMENT_ATMOSPHERE out vec3 v_mieColor; @@ -5714,14 +5714,14 @@ v_outerPositionWC = positionWC.xyz; vec4 positionEC = czm_modelView * position; gl_Position = czm_projection * positionEC; } -`;var Ahn=x(T(),1),c2=`uniform samplerCube u_cubeMap; +`;var Ghn=x(T(),1),c2=`uniform samplerCube u_cubeMap; in vec3 v_texCoord; void main() { vec4 color = czm_textureCube(u_cubeMap, normalize(v_texCoord)); out_FragColor = vec4(czm_gammaCorrect(color).rgb, czm_morphTime); } -`;var Lhn=x(T(),1),l2=`in vec3 position; +`;var Whn=x(T(),1),l2=`in vec3 position; out vec3 v_texCoord; void main() { @@ -5729,14 +5729,14 @@ vec3 p = czm_viewRotation * (czm_temeToPseudoFixed * (czm_entireFrustum.y * posi gl_Position = czm_projection * vec4(p, 1.0); v_texCoord = position.xyz; } -`;var vhn=x(T(),1),d2=`uniform sampler2D u_texture; +`;var Fhn=x(T(),1),d2=`uniform sampler2D u_texture; in vec2 v_textureCoordinates; void main() { vec4 color = texture(u_texture, v_textureCoordinates); out_FragColor = czm_gammaCorrect(color); } -`;var Ihn=x(T(),1),u2=`uniform float u_radiusTS; +`;var Phn=x(T(),1),u2=`uniform float u_radiusTS; in vec2 v_textureCoordinates; vec2 rotate(vec2 p, vec2 direction) { @@ -5768,7 +5768,7 @@ burst += 0.3 * addBurst(position, vec2(0.66507, -0.74678), lengthScalar); color += clamp(burst, vec4(0.0), vec4(1.0)) * 0.15; out_FragColor = clamp(color, vec4(0.0), vec4(1.0)); } -`;var Xhn=x(T(),1),m2=`in vec2 direction; +`;var Nhn=x(T(),1),m2=`in vec2 direction; uniform float u_size; out vec2 v_textureCoordinates; void main() @@ -5789,7 +5789,7 @@ halfSize *= ((direction * 2.0) - 1.0); gl_Position = czm_viewportOrthographic * vec4(positionWC.xy + halfSize, -positionWC.z, 1.0); v_textureCoordinates = direction; } -`;var Yhn=x(T(),1),h2=`in vec4 v_startPlaneEC; +`;var Mhn=x(T(),1),h2=`in vec4 v_startPlaneEC; in vec4 v_endPlaneEC; in vec4 v_rightPlaneEC; in float v_halfWidth; @@ -5824,7 +5824,7 @@ discard; out_FragColor = u_highlightColor; czm_writeDepthClamp(); } -`;var whn=x(T(),1),f2=`in vec3 startEllipsoidNormal; +`;var khn=x(T(),1),f2=`in vec3 startEllipsoidNormal; in vec3 endEllipsoidNormal; in vec4 startPositionAndHeight; in vec4 endPositionAndHeight; @@ -5870,7 +5870,7 @@ vec3 endNormalEC = czm_normal * endFaceNormalAndHalfWidth.xyz; v_endPlaneEC = vec4(endNormalEC, -dot(endNormalEC, position.xyz)); v_halfWidth = endFaceNormalAndHalfWidth.w; } -`;var Uhn=x(T(),1),p2=`in vec4 currentPosition; +`;var Dhn=x(T(),1),p2=`in vec4 currentPosition; in vec4 previousPosition; in vec4 nextPosition; in vec2 expandAndWidth; @@ -5888,7 +5888,7 @@ float angle; vec4 positionWC = getPolylineWindowCoordinatesEC(p, prev, next, expandDir, width, usePrev, angle); gl_Position = czm_viewportOrthographic * positionWC; } -`;var Ohn=x(T(),1),ub=`uniform highp sampler2D u_vectorColorTexture; +`;var Bhn=x(T(),1),ub=`uniform highp sampler2D u_vectorColorTexture; uniform highp sampler2D u_vectorPickColorTexture; int vectorPickPrimitiveIndex = -1; #ifdef HAS_VECTOR_POLYLINES @@ -6104,14 +6104,14 @@ inside = !inside; } return inside; } -`;var zhn=x(T(),1),R1=`in vec3 position; +`;var Hhn=x(T(),1),R1=`in vec3 position; in float a_batchId; uniform mat4 u_modifiedModelViewProjection; void main() { gl_Position = czm_depthClamp(u_modifiedModelViewProjection * vec4(position, 1.0)); } -`;var Khn=x(T(),1),b2=`in vec2 v_textureCoordinates; +`;var Jhn=x(T(),1),b2=`in vec2 v_textureCoordinates; void main() { czm_materialInput materialInput; @@ -6122,124 +6122,67 @@ materialInput.normalEC = vec3(0.0, 0.0, -1.0); czm_material material = czm_getMaterial(materialInput); out_FragColor = vec4(material.diffuse + material.emission, material.alpha); } -`;var cfn=x(T(),1);var nfn=x(T(),1);var qhn=x(T(),1);function My(e){this._value=void 0,this._hasClone=!1,this._hasEquals=!1,this._definitionChanged=new Se,this.setValue(e)}Object.defineProperties(My.prototype,{isConstant:{value:!0},definitionChanged:{get:function(){return this._definitionChanged}}});My.prototype.getValue=function(e,t){return this._hasClone?this._value.clone(t):this._value};My.prototype.setValue=function(e){let t=this._value;if(t!==e){let n=l(e),i=n&&typeof e.clone=="function",o=n&&typeof e.equals=="function";(!o||!e.equals(t))&&(this._hasClone=i,this._hasEquals=o,this._value=i?e.clone(this._value):e,this._definitionChanged.raiseEvent(this))}};My.prototype.equals=function(e){return this===e||e instanceof My&&(!this._hasEquals&&this._value===e._value||this._hasEquals&&this._value.equals(e._value))};My.prototype.valueOf=function(){return this._value};My.prototype.toString=function(){return String(this._value)};var mi=My;function mOe(e,t,n,i,o){return{configurable:i,get:function(){return this[t]},set:function(r){let s=this[t],a=this[n];l(a)&&(a(),this[n]=void 0),r!==void 0&&(!l(r)||!l(r.getValue))&&l(o)&&(r=o(r)),s!==r&&(this[t]=r,this._definitionChanged.raiseEvent(this,e,r,s)),l(r)&&l(r.definitionChanged)&&(this[n]=r.definitionChanged.addEventListener(function(){this._definitionChanged.raiseEvent(this,e,r,r)},this))}}}function hOe(e){return new mi(e)}function fOe(e,t,n){return mOe(e,`_${e.toString()}`,`_${e.toString()}Subscription`,t??!1,n??hOe)}var be=fOe;function g2(e){this._definitionChanged=new Se,this._show=void 0,this._showSubscription=void 0,this._image=void 0,this._imageSubscription=void 0,this._scale=void 0,this._scaleSubscription=void 0,this._pixelOffset=void 0,this._pixelOffsetSubscription=void 0,this._eyeOffset=void 0,this._eyeOffsetSubscription=void 0,this._horizontalOrigin=void 0,this._horizontalOriginSubscription=void 0,this._verticalOrigin=void 0,this._verticalOriginSubscription=void 0,this._heightReference=void 0,this._heightReferenceSubscription=void 0,this._color=void 0,this._colorSubscription=void 0,this._rotation=void 0,this._rotationSubscription=void 0,this._alignedAxis=void 0,this._alignedAxisSubscription=void 0,this._sizeInMeters=void 0,this._sizeInMetersSubscription=void 0,this._width=void 0,this._widthSubscription=void 0,this._height=void 0,this._heightSubscription=void 0,this._scaleByDistance=void 0,this._scaleByDistanceSubscription=void 0,this._translucencyByDistance=void 0,this._translucencyByDistanceSubscription=void 0,this._pixelOffsetScaleByDistance=void 0,this._pixelOffsetScaleByDistanceSubscription=void 0,this._imageSubRegion=void 0,this._imageSubRegionSubscription=void 0,this._distanceDisplayCondition=void 0,this._distanceDisplayConditionSubscription=void 0,this._disableDepthTestDistance=void 0,this._disableDepthTestDistanceSubscription=void 0,this._splitDirection=void 0,this._splitDirectionSubscription=void 0,this.merge(e??B.EMPTY_OBJECT)}Object.defineProperties(g2.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:be("show"),image:be("image"),scale:be("scale"),pixelOffset:be("pixelOffset"),eyeOffset:be("eyeOffset"),horizontalOrigin:be("horizontalOrigin"),verticalOrigin:be("verticalOrigin"),heightReference:be("heightReference"),color:be("color"),rotation:be("rotation"),alignedAxis:be("alignedAxis"),sizeInMeters:be("sizeInMeters"),width:be("width"),height:be("height"),scaleByDistance:be("scaleByDistance"),translucencyByDistance:be("translucencyByDistance"),pixelOffsetScaleByDistance:be("pixelOffsetScaleByDistance"),imageSubRegion:be("imageSubRegion"),distanceDisplayCondition:be("distanceDisplayCondition"),disableDepthTestDistance:be("disableDepthTestDistance"),splitDirection:be("splitDirection")});g2.prototype.clone=function(e){return l(e)?(e.show=this._show,e.image=this._image,e.scale=this._scale,e.pixelOffset=this._pixelOffset,e.eyeOffset=this._eyeOffset,e.horizontalOrigin=this._horizontalOrigin,e.verticalOrigin=this._verticalOrigin,e.heightReference=this._heightReference,e.color=this._color,e.rotation=this._rotation,e.alignedAxis=this._alignedAxis,e.sizeInMeters=this._sizeInMeters,e.width=this._width,e.height=this._height,e.scaleByDistance=this._scaleByDistance,e.translucencyByDistance=this._translucencyByDistance,e.pixelOffsetScaleByDistance=this._pixelOffsetScaleByDistance,e.imageSubRegion=this._imageSubRegion,e.distanceDisplayCondition=this._distanceDisplayCondition,e.disableDepthTestDistance=this._disableDepthTestDistance,e.splitDirection=this._splitDirection,e):new g2(this)};g2.prototype.merge=function(e){this.show=this._show??e.show,this.image=this._image??e.image,this.scale=this._scale??e.scale,this.pixelOffset=this._pixelOffset??e.pixelOffset,this.eyeOffset=this._eyeOffset??e.eyeOffset,this.horizontalOrigin=this._horizontalOrigin??e.horizontalOrigin,this.verticalOrigin=this._verticalOrigin??e.verticalOrigin,this.heightReference=this._heightReference??e.heightReference,this.color=this._color??e.color,this.rotation=this._rotation??e.rotation,this.alignedAxis=this._alignedAxis??e.alignedAxis,this.sizeInMeters=this._sizeInMeters??e.sizeInMeters,this.width=this._width??e.width,this.height=this._height??e.height,this.scaleByDistance=this._scaleByDistance??e.scaleByDistance,this.translucencyByDistance=this._translucencyByDistance??e.translucencyByDistance,this.pixelOffsetScaleByDistance=this._pixelOffsetScaleByDistance??e.pixelOffsetScaleByDistance,this.imageSubRegion=this._imageSubRegion??e.imageSubRegion,this.distanceDisplayCondition=this._distanceDisplayCondition??e.distanceDisplayCondition,this.disableDepthTestDistance=this._disableDepthTestDistance??e.disableDepthTestDistance,this.splitDirection=this.splitDirection??e.splitDirection};var jc=g2;var apn=x(T(),1);var ufn=x(T(),1);var ZQ=class{constructor(){this._array=[],this._hash={}}get length(){return this._array.length}get values(){return this._array}contains(t){return l(this._hash[t])}set(t,n){let i=this._hash[t];n!==i&&(this.remove(t),this._hash[t]=n,this._array.push(n))}get(t){return this._hash[t]}remove(t){let n=this._hash[t],i=l(n);if(i){let o=this._array;o.splice(o.indexOf(n),1),delete this._hash[t]}return i}removeAll(){let t=this._array;t.length>0&&(this._hash={},t.length=0)}},kt=ZQ;var ffn=x(T(),1);function Su(e,t){e=e??0,this._near=e,t=t??Number.MAX_VALUE,this._far=t}Object.defineProperties(Su.prototype,{near:{get:function(){return this._near},set:function(e){this._near=e}},far:{get:function(){return this._far},set:function(e){this._far=e}}});Su.packedLength=2;Su.pack=function(e,t,n){return n=n??0,t[n++]=e.near,t[n]=e.far,t};Su.unpack=function(e,t,n){return t=t??0,l(n)||(n=new Su),n.near=e[t++],n.far=e[t],n};Su.equals=function(e,t){return e===t||l(e)&&l(t)&&e.near===t.near&&e.far===t.far};Su.clone=function(e,t){if(l(e))return l(t)||(t=new Su),t.near=e.near,t.far=e.far,t};Su.prototype.clone=function(e){return Su.clone(this,e)};Su.prototype.equals=function(e){return Su.equals(this,e)};var Bt=Su;var gfn=x(T(),1);function Gm(e,t,n,i){this.near=e??0,this.nearValue=t??0,this.far=n??1,this.farValue=i??0}Gm.clone=function(e,t){if(l(e))return l(t)?(t.near=e.near,t.nearValue=e.nearValue,t.far=e.far,t.farValue=e.farValue,t):new Gm(e.near,e.nearValue,e.far,e.farValue)};Gm.packedLength=4;Gm.pack=function(e,t,n){return n=n??0,t[n++]=e.near,t[n++]=e.nearValue,t[n++]=e.far,t[n]=e.farValue,t};Gm.unpack=function(e,t,n){return t=t??0,l(n)||(n=new Gm),n.near=e[t++],n.nearValue=e[t++],n.far=e[t++],n.farValue=e[t],n};Gm.equals=function(e,t){return e===t||l(e)&&l(t)&&e.near===t.near&&e.nearValue===t.nearValue&&e.far===t.far&&e.farValue===t.farValue};Gm.prototype.clone=function(e){return Gm.clone(this,e)};Gm.prototype.equals=function(e){return Gm.equals(this,e)};var Kt=Gm;var xfn=x(T(),1),wy={NONE:0,CLAMP_TO_GROUND:1,RELATIVE_TO_GROUND:2,CLAMP_TO_TERRAIN:3,RELATIVE_TO_TERRAIN:4,CLAMP_TO_3D_TILE:5,RELATIVE_TO_3D_TILE:6,CLIP_TO_GROUND:7};Object.freeze(wy);var He=wy;function bs(e){return e===wy.CLAMP_TO_GROUND||e===wy.CLAMP_TO_3D_TILE||e===wy.CLAMP_TO_TERRAIN}function ky(e){return e===wy.RELATIVE_TO_GROUND||e===wy.RELATIVE_TO_3D_TILE||e===wy.RELATIVE_TO_TERRAIN}var _fn=x(T(),1),the={CENTER:0,LEFT:1,RIGHT:-1};Object.freeze(the);var Ui=the;var Zfn=x(T(),1),nhe={CENTER:0,BOTTOM:1,BASELINE:2,TOP:-1};Object.freeze(nhe);var zn=nhe;var Cfn=x(T(),1),pOe=Object.freeze({DONE:0,PENDING:1,FAILED:2}),Wt=pOe;var Gfn=x(T(),1);function Dh(){ge.throwInstantiationError()}Object.defineProperties(Dh.prototype,{isConstant:{get:ge.throwInstantiationError},definitionChanged:{get:ge.throwInstantiationError}});Dh.prototype.getValue=ge.throwInstantiationError;Dh.prototype.equals=ge.throwInstantiationError;Dh.equals=function(e,t){return e===t||l(e)&&e.equals(t)};Dh.arrayEquals=function(e,t){if(e===t)return!0;if(!l(e)||!l(t)||e.length!==t.length)return!1;let n=e.length;for(let i=0;ibOe&&(l(t.mostDetailedHeight)&&(t.mostDetailedHeightPrevious=t.mostDetailedHeight),t.mostDetailedHeightPosition=void 0,t.mostDetailedHeight=void 0),!l(t.mostDetailedHeightPosition))if(t.mostDetailedHeightPosition=h.clone(n),!l(e)||!e.sampleHeightSupported||e.mode!==se.SCENE3D)t.mostDetailedHeight=null;else{t.mostDetailedHeight=void 0;let a=(e.ellipsoid??ne.default).cartesianToCartographic(n);e.sampleHeightMostDetailed([a],i).then(function(c){o()&&(t.mostDetailedHeight=c[0].height??null)}).catch(function(){o()&&(t.mostDetailedHeight=null)})}return t.mostDetailedHeight===void 0?t.mostDetailedHeightPrevious:t.mostDetailedHeight}var Oh=gOe;var Mfn=x(T(),1);var yOe=new pe;function xOe(e,t,n,i,o){let r=i.cartesianToCartographic(e,yOe);return n===He.CLIP_TO_GROUND?r.heightr.get(e.id)===n);if(s===void 0)return Wt.PENDING;s===null?t.center=h.clone(i.position,t.center):t.center=mb(i.position,s,i.heightReference,o.ellipsoid??ne.default,t.center)}return t.radius=0,Wt.DONE};Uy.prototype.isDestroyed=function(){return!1};Uy.prototype.destroy=function(){this._entityCollection.collectionChanged.removeEventListener(Uy.prototype._onCollectionChanged,this);let e=this._entityCollection.values;for(let t=0;t-1;o--)r=t[o],l(r._billboard)&&l(r._position)&&s.set(r.id,new ohe(r));for(o=i.length-1;o>-1;o--)r=i[o],l(r._billboard)&&l(r._position)?s.contains(r.id)||s.set(r.id,new ohe(r)):(RQ(s.get(r.id),r,a),s.remove(r.id));for(o=n.length-1;o>-1;o--)r=n[o],RQ(s.get(r.id),r,a),s.remove(r.id)};function RQ(e,t,n){l(e)&&(e.billboard=void 0,n.removeBillboard(t))}var y2=Uy;var aAn=x(T(),1);var xpn=x(T(),1);var wOe=new h;function Wp(e){e=e??B.EMPTY_OBJECT;let t=e.minimum,n=e.maximum;this._min=h.clone(t),this._max=h.clone(n),this._offsetAttribute=e.offsetAttribute,this._workerName="createBoxOutlineGeometry"}Wp.fromDimensions=function(e){e=e??B.EMPTY_OBJECT;let t=e.dimensions,n=h.multiplyByScalar(t,.5,new h);return new Wp({minimum:h.negate(n,new h),maximum:n,offsetAttribute:e.offsetAttribute})};Wp.fromAxisAlignedBoundingBox=function(e){return new Wp({minimum:e.minimum,maximum:e.maximum})};Wp.packedLength=2*h.packedLength+1;Wp.pack=function(e,t,n){return n=n??0,h.pack(e._min,t,n),h.pack(e._max,t,n+h.packedLength),t[n+h.packedLength*2]=e._offsetAttribute??-1,t};var she=new h,ahe=new h,rhe={minimum:she,maximum:ahe,offsetAttribute:void 0};Wp.unpack=function(e,t,n){t=t??0;let i=h.unpack(e,t,she),o=h.unpack(e,t+h.packedLength,ahe),r=e[t+h.packedLength*2];return l(n)?(n._min=h.clone(i,n._min),n._max=h.clone(o,n._max),n._offsetAttribute=r===-1?void 0:r,n):(rhe.offsetAttribute=r===-1?void 0:r,new Wp(rhe))};Wp.createGeometry=function(e){let t=e._min,n=e._max;if(h.equals(t,n))return;let i=new Rn,o=new Uint16Array(24),r=new Float64Array(24);r[0]=t.x,r[1]=t.y,r[2]=t.z,r[3]=n.x,r[4]=t.y,r[5]=t.z,r[6]=n.x,r[7]=n.y,r[8]=t.z,r[9]=t.x,r[10]=n.y,r[11]=t.z,r[12]=t.x,r[13]=t.y,r[14]=n.z,r[15]=n.x,r[16]=t.y,r[17]=n.z,r[18]=n.x,r[19]=n.y,r[20]=n.z,r[21]=t.x,r[22]=n.y,r[23]=n.z,i.position=new Xe({componentDatatype:J.DOUBLE,componentsPerAttribute:3,values:r}),o[0]=4,o[1]=5,o[2]=5,o[3]=6,o[4]=6,o[5]=7,o[6]=7,o[7]=4,o[8]=0,o[9]=1,o[10]=1,o[11]=2,o[12]=2,o[13]=3,o[14]=3,o[15]=0,o[16]=0,o[17]=4,o[18]=1,o[19]=5,o[20]=2,o[21]=6,o[22]=3,o[23]=7;let s=h.subtract(n,t,wOe),a=h.magnitude(s)*.5;if(l(e._offsetAttribute)){let c=r.length,d=e._offsetAttribute===bn.NONE?0:1,u=new Uint8Array(c/3).fill(d);i.applyOffset=new Xe({componentDatatype:J.UNSIGNED_BYTE,componentsPerAttribute:1,values:u})}return new At({attributes:i,indices:o,primitiveType:Ie.LINES,boundingSphere:new me(h.ZERO,a),offsetAttribute:e._offsetAttribute})};var Bh=Wp;var Rpn=x(T(),1);function C1(e,t,n,i){e=e??1,t=t??1,n=n??1,i=i??1,this.value=new Uint8Array([U.floatToByte(e),U.floatToByte(t),U.floatToByte(n),U.floatToByte(i)])}Object.defineProperties(C1.prototype,{componentDatatype:{get:function(){return J.UNSIGNED_BYTE}},componentsPerAttribute:{get:function(){return 4}},normalize:{get:function(){return!0}}});C1.fromColor=function(e){return new C1(e.red,e.green,e.blue,e.alpha)};C1.toValue=function(e,t){return l(t)?e.toBytes(t):new Uint8Array(e.toBytes())};C1.equals=function(e,t){return e===t||l(e)&&l(t)&&e.value[0]===t.value[0]&&e.value[1]===t.value[1]&&e.value[2]===t.value[2]&&e.value[3]===t.value[3]};var $t=C1;var Apn=x(T(),1);function x2(e,t){e=e??0,t=t??Number.MAX_VALUE,this.value=new Float32Array([e,t])}Object.defineProperties(x2.prototype,{componentDatatype:{get:function(){return J.FLOAT}},componentsPerAttribute:{get:function(){return 2}},normalize:{get:function(){return!1}}});x2.fromDistanceDisplayCondition=function(e){return new x2(e.near,e.far)};x2.toValue=function(e,t){return l(t)?(t[0]=e.near,t[1]=e.far,t):new Float32Array([e.near,e.far])};var ti=x2;var vpn=x(T(),1);function kOe(e){e=e??B.EMPTY_OBJECT,this.geometry=e.geometry,this.modelMatrix=P.clone(e.modelMatrix??P.IDENTITY),this.id=e.id,this.pickPrimitive=e.pickPrimitive,this.attributes=e.attributes??{},this.westHemisphereGeometry=void 0,this.eastHemisphereGeometry=void 0}var Yt=kOe;var Upn=x(T(),1);var Ypn=x(T(),1);function Wr(e){e=e??B.EMPTY_OBJECT,this.start=l(e.start)?Q.clone(e.start):new Q,this.stop=l(e.stop)?Q.clone(e.stop):new Q,this.data=e.data,this.isStartIncluded=e.isStartIncluded??!0,this.isStopIncluded=e.isStopIncluded??!0}Object.defineProperties(Wr.prototype,{isEmpty:{get:function(){let e=Q.compare(this.stop,this.start);return e<0||e===0&&(!this.isStartIncluded||!this.isStopIncluded)}}});var V1={start:void 0,stop:void 0,isStartIncluded:void 0,isStopIncluded:void 0,data:void 0};Wr.fromIso8601=function(e,t){let n=e.iso8601.split("/");if(n.length!==2)throw new ge("options.iso8601 is an invalid ISO 8601 interval.");let i=Q.fromIso8601(n[0]),o=Q.fromIso8601(n[1]),r=e.isStartIncluded??!0,s=e.isStopIncluded??!0,a=e.data;return l(t)?(t.start=i,t.stop=o,t.isStartIncluded=r,t.isStopIncluded=s,t.data=a,t):(V1.start=i,V1.stop=o,V1.isStartIncluded=r,V1.isStopIncluded=s,V1.data=a,new Wr(V1))};Wr.toIso8601=function(e,t){return`${Q.toIso8601(e.start,t)}/${Q.toIso8601(e.stop,t)}`};Wr.clone=function(e,t){if(l(e))return l(t)?(t.start=e.start,t.stop=e.stop,t.isStartIncluded=e.isStartIncluded,t.isStopIncluded=e.isStopIncluded,t.data=e.data,t):new Wr(e)};Wr.equals=function(e,t,n){return e===t||l(e)&&l(t)&&(e.isEmpty&&t.isEmpty||e.isStartIncluded===t.isStartIncluded&&e.isStopIncluded===t.isStopIncluded&&Q.equals(e.start,t.start)&&Q.equals(e.stop,t.stop)&&(e.data===t.data||l(n)&&n(e.data,t.data)))};Wr.equalsEpsilon=function(e,t,n,i){return n=n??0,e===t||l(e)&&l(t)&&(e.isEmpty&&t.isEmpty||e.isStartIncluded===t.isStartIncluded&&e.isStopIncluded===t.isStopIncluded&&Q.equalsEpsilon(e.start,t.start,n)&&Q.equalsEpsilon(e.stop,t.stop,n)&&(e.data===t.data||l(i)&&i(e.data,t.data)))};Wr.intersect=function(e,t,n,i){if(!l(t))return Wr.clone(Wr.EMPTY,n);let o=e.start,r=e.stop,s=t.start,a=t.stop,c=Q.greaterThanOrEquals(s,o)&&Q.greaterThanOrEquals(r,s),d=!c&&Q.lessThanOrEquals(s,o)&&Q.lessThanOrEquals(o,a);if(!c&&!d)return Wr.clone(Wr.EMPTY,n);let u=e.isStartIncluded,m=e.isStopIncluded,p=t.isStartIncluded,b=t.isStopIncluded,f=Q.lessThan(r,a);return l(n)||(n=new Wr),n.start=c?s:o,n.isStartIncluded=u&&p||!Q.equals(s,o)&&(c&&p||d&&u),n.stop=f?r:a,n.isStopIncluded=f?m:m&&b||!Q.equals(a,r)&&b,n.data=l(i)?i(e.data,t.data):e.data,n};Wr.contains=function(e,t){if(e.isEmpty)return!1;let n=Q.compare(e.start,t);if(n===0)return e.isStartIncluded;let i=Q.compare(t,e.stop);return i===0?e.isStopIncluded:n<0&&i<0};Wr.prototype.clone=function(e){return Wr.clone(this,e)};Wr.prototype.equals=function(e,t){return Wr.equals(this,e,t)};Wr.prototype.equalsEpsilon=function(e,t,n){return Wr.equalsEpsilon(this,e,t,n)};Wr.prototype.toString=function(){return Wr.toIso8601(this)};Wr.EMPTY=Object.freeze(new Wr({start:new Q,stop:new Q,isStartIncluded:!1,isStopIncluded:!1}));var Cn=Wr;var che=Object.freeze(Q.fromIso8601("0000-01-01T00:00:00Z")),lhe=Object.freeze(Q.fromIso8601("9999-12-31T24:00:00Z")),UOe=Object.freeze(new Cn({start:che,stop:lhe})),DOe={MINIMUM_VALUE:che,MAXIMUM_VALUE:lhe,MAXIMUM_INTERVAL:UOe},ot=DOe;var zpn=x(T(),1);function T2(e,t,n){e=e??0,t=t??0,n=n??0,this.value=new Float32Array([e,t,n])}Object.defineProperties(T2.prototype,{componentDatatype:{get:function(){return J.FLOAT}},componentsPerAttribute:{get:function(){return 3}},normalize:{get:function(){return!1}}});T2.fromCartesian3=function(e){return new T2(e.x,e.y,e.z)};T2.toValue=function(e,t){return l(t)||(t=new Float32Array([e.x,e.y,e.z])),t[0]=e.x,t[1]=e.y,t[2]=e.z,t};var Ro=T2;var jpn=x(T(),1);function iO(e){e=e??!0,this.value=iO.toValue(e)}Object.defineProperties(iO.prototype,{componentDatatype:{get:function(){return J.UNSIGNED_BYTE}},componentsPerAttribute:{get:function(){return 1}},normalize:{get:function(){return!1}}});iO.toValue=function(e,t){return l(t)?(t[0]=e,t):new Uint8Array([e])};var Wn=iO;var ugn=x(T(),1);var qpn=x(T(),1),_2=`in vec3 v_positionEC; -in vec3 v_normalEC; -in vec3 v_tangentEC; -in vec3 v_bitangentEC; -in vec2 v_st; +`;var w0o=x(T(),1);var dfn=x(T(),1);var Qhn=x(T(),1),the={UNBOUNDED:0,CLAMPED:1,LOOP_STOP:2};Object.freeze(the);var bs=the;var $hn=x(T(),1),nhe={TICK_DEPENDENT:0,SYSTEM_CLOCK_MULTIPLIER:1,SYSTEM_CLOCK:2};Object.freeze(nhe);var Do=nhe;var tfn=x(T(),1),ZQ;typeof performance<"u"&&typeof performance.now=="function"&&isFinite(performance.now())?ZQ=function(){return performance.now()}:ZQ=function(){return Date.now()};var Zn=ZQ;function RQ(e){e=e??B.EMPTY_OBJECT;let t=e.currentTime,n=e.startTime,i=e.stopTime;l(t)?t=Q.clone(t):l(n)?t=Q.clone(n):l(i)?t=Q.addDays(i,-1,new Q):t=Q.now(),l(n)?n=Q.clone(n):n=Q.clone(t),l(i)?i=Q.clone(i):i=Q.addDays(n,1,new Q),this.startTime=n,this.stopTime=i,this.clockRange=e.clockRange??bs.UNBOUNDED,this.canAnimate=e.canAnimate??!0,this.onTick=new Se,this.onStop=new Se,this._currentTime=void 0,this._multiplier=void 0,this._clockStep=void 0,this._shouldAnimate=void 0,this._lastSystemTime=Zn(),this.currentTime=t,this.multiplier=e.multiplier??1,this.shouldAnimate=e.shouldAnimate??!1,this.clockStep=e.clockStep??Do.SYSTEM_CLOCK_MULTIPLIER}Object.defineProperties(RQ.prototype,{currentTime:{get:function(){return this._currentTime},set:function(e){Q.equals(this._currentTime,e)||(this._clockStep===Do.SYSTEM_CLOCK&&(this._clockStep=Do.SYSTEM_CLOCK_MULTIPLIER),this._currentTime=e)}},multiplier:{get:function(){return this._multiplier},set:function(e){this._multiplier!==e&&(this._clockStep===Do.SYSTEM_CLOCK&&(this._clockStep=Do.SYSTEM_CLOCK_MULTIPLIER),this._multiplier=e)}},clockStep:{get:function(){return this._clockStep},set:function(e){e===Do.SYSTEM_CLOCK&&(this._multiplier=1,this._shouldAnimate=!0,this._currentTime=Q.now()),this._clockStep=e}},shouldAnimate:{get:function(){return this._shouldAnimate},set:function(e){this._shouldAnimate!==e&&(this._clockStep===Do.SYSTEM_CLOCK&&(this._clockStep=Do.SYSTEM_CLOCK_MULTIPLIER),this._shouldAnimate=e)}}});RQ.prototype.tick=function(){let e=Zn(),t=Q.clone(this._currentTime);if(this.canAnimate&&this._shouldAnimate){let n=this._clockStep;if(n===Do.SYSTEM_CLOCK)t=Q.now(t);else{let i=this._multiplier;if(n===Do.TICK_DEPENDENT)t=Q.addSeconds(t,i,t);else{let a=e-this._lastSystemTime;t=Q.addSeconds(t,i*(a/1e3),t)}let o=this.clockRange,r=this.startTime,s=this.stopTime;if(o===bs.CLAMPED)Q.lessThan(t,r)?t=Q.clone(r,t):Q.greaterThan(t,s)&&(t=Q.clone(s,t),this.onStop.raiseEvent(this));else if(o===bs.LOOP_STOP)for(Q.lessThan(t,r)&&(t=Q.clone(r,t));Q.greaterThan(t,s);)t=Q.addSeconds(r,Q.secondsDifference(t,s),t),this.onStop.raiseEvent(this)}}return this._currentTime=t,this._lastSystemTime=e,this.onTick.raiseEvent(this),t};var Dh=RQ;var mfn=x(T(),1);function CQ(){this._removalFunctions=[]}CQ.prototype.add=function(e,t,n){let i=e.addEventListener(t,n);this._removalFunctions.push(i);let o=this;return function(){i();let r=o._removalFunctions;r.splice(r.indexOf(i),1)}};CQ.prototype.removeAll=function(){let e=this._removalFunctions;for(let t=0,n=e.length;t=r&&(u=r-1);let m=(o.north-t.latitude)/c|0;return m>=s&&(m=s-1),l(i)?(i.x=u,i.y=m,i):new k(u,m)}},eo=EQ;var ohe=new h,rhe=new h,she=new pe,AQ=new h,pOe=new h,ahe=new me,bOe=new eo,y2=[new pe,new pe,new pe,new pe],x2=new k,Ys={};Ys.initialize=function(){let e=Ys._initPromise;return l(e)||(e=ve.fetchJson(en("Assets/approximateTerrainHeights.json")).then(function(t){Ys._terrainHeights=t}),Ys._initPromise=e),e};Ys.getMinimumMaximumHeights=function(e,t){t=t??ne.default;let n=che(e),i=Ys._defaultMinTerrainHeight,o=Ys._defaultMaxTerrainHeight;if(l(n)){let r=`${n.level}-${n.x}-${n.y}`,s=Ys._terrainHeights[r];l(s)&&(i=s[0],o=s[1]),t.cartographicToCartesian(re.northeast(e,she),ohe),t.cartographicToCartesian(re.southwest(e,she),rhe),h.midpoint(rhe,ohe,AQ);let a=t.scaleToGeodeticSurface(AQ,pOe);if(l(a)){let c=h.distance(AQ,a);i=Math.min(i,-c)}else i=Ys._defaultMinTerrainHeight}return i=Math.max(Ys._defaultMinTerrainHeight,i),{minimumTerrainHeight:i,maximumTerrainHeight:o}};Ys.getBoundingSphere=function(e,t){t=t??ne.default;let n=che(e),i=Ys._defaultMaxTerrainHeight;if(l(n)){let r=`${n.level}-${n.x}-${n.y}`,s=Ys._terrainHeights[r];l(s)&&(i=s[1])}let o=me.fromRectangle3D(e,t,0);return me.fromRectangle3D(e,t,i,ahe),me.union(o,ahe,o)};function che(e){pe.fromRadians(e.east,e.north,0,y2[0]),pe.fromRadians(e.west,e.north,0,y2[1]),pe.fromRadians(e.east,e.south,0,y2[2]),pe.fromRadians(e.west,e.south,0,y2[3]);let t=0,n=0,i=0,o=0,r=Ys._terrainHeightsMaxLevel,s;for(s=0;s<=r;++s){let a=!1;for(let c=0;c<4;++c){let d=y2[c];if(bOe.positionToTileXY(d,s,x2),c===0)i=x2.x,o=x2.y;else if(i!==x2.x||o!==x2.y){a=!0;break}}if(a)break;t=i,n=o}if(s!==0)return{x:t,y:n,level:s>r?r:s-1}}Ys._terrainHeightsMaxLevel=6;Ys._defaultMaxTerrainHeight=9e3;Ys._defaultMinTerrainHeight=-1e5;Ys._terrainHeights=void 0;Ys._initPromise=void 0;Object.defineProperties(Ys,{initialized:{get:function(){return l(Ys._terrainHeights)}}});var Pi=Ys;var Axn=x(T(),1);var jfn=x(T(),1);function gOe(e){e=e??B.EMPTY_OBJECT,this.geometry=e.geometry,this.modelMatrix=P.clone(e.modelMatrix??P.IDENTITY),this.id=e.id,this.pickPrimitive=e.pickPrimitive,this.attributes=e.attributes??{},this.westHemisphereGeometry=void 0,this.eastHemisphereGeometry=void 0}var Yt=gOe;var $fn=x(T(),1);function yOe(e){e=e??B.EMPTY_OBJECT,this.componentDatatype=e.componentDatatype,this.componentsPerAttribute=e.componentsPerAttribute,this.normalize=e.normalize??!1,this.value=e.value}var jc=yOe;var Qpn=x(T(),1);var tpn=x(T(),1),lhe={NONE:0,GEODESIC:1,RHUMB:2};Object.freeze(lhe);var un=lhe;var rpn=x(T(),1);var dhe=W.EPSILON10;function xOe(e,t,n,i){if(!l(e))return;n=n??!1;let o=l(i),r=e.length;if(r<2)return e;let s,a=e[0],c,d,u=0,m=-1;for(s=1;sW.EPSILON12);let V=N*(t*t-n*n)/(n*n),G=1+V*(4096+V*(V*(320-175*V)-768))/16384,v=V*(256+V*(V*(74-47*V)-128))/1024,X=g*g,Y=v*I*(g+v*(F*(2*X-1)-v*g*(4*I*I-3)*(4*X-3)/6)/4),D=n*G*(L-Y),M=Math.atan2(b*A,_-Z*E),O=Math.atan2(m*A,_*E-Z);e._distance=D,e._startHeading=M,e._endHeading=O,e._uSquared=V}var ZOe=new h,GQ=new h;function mhe(e,t,n,i){let o=h.normalize(i.cartographicToCartesian(t,GQ),ZOe),r=h.normalize(i.cartographicToCartesian(n,GQ),GQ);SOe(e,i.maximumRadius,i.minimumRadius,t.longitude,t.latitude,n.longitude,n.latitude),e._start=pe.clone(t,e._start),e._end=pe.clone(n,e._end),e._start.height=0,e._end.height=0,TOe(e)}function T2(e,t,n){let i=n??ne.default;this._ellipsoid=i,this._start=new pe,this._end=new pe,this._constants={},this._startHeading=void 0,this._endHeading=void 0,this._distance=void 0,this._uSquared=void 0,l(e)&&l(t)&&mhe(this,e,t,i)}Object.defineProperties(T2.prototype,{ellipsoid:{get:function(){return this._ellipsoid}},surfaceDistance:{get:function(){return this._distance}},start:{get:function(){return this._start}},end:{get:function(){return this._end}},startHeading:{get:function(){return this._startHeading}},endHeading:{get:function(){return this._endHeading}}});T2.prototype.setEndPoints=function(e,t){mhe(this,e,t,this._ellipsoid)};T2.prototype.interpolateUsingFraction=function(e,t){return this.interpolateUsingSurfaceDistance(this._distance*e,t)};T2.prototype.interpolateUsingSurfaceDistance=function(e,t){let n=this._constants,i=n.distanceRatio+e/n.b,o=Math.cos(2*i),r=Math.cos(4*i),s=Math.cos(6*i),a=Math.sin(2*i),c=Math.sin(4*i),d=Math.sin(6*i),u=Math.sin(8*i),m=i*i,p=i*m,b=n.u8Over256,f=n.u2Over4,y=n.u6Over64,_=n.u4Over16,S=2*p*b*o/3+i*(1-f+7*_/4-15*y/4+579*b/64-(_-15*y/4+187*b/16)*o-(5*y/4-115*b/16)*r-29*b*s/16)+(f/2-_+71*y/32-85*b/16)*a+(5*_/16-5*y/4+383*b/96)*c-m*((y-11*b/2)*a+5*b*c/2)+(29*y/96-29*b/16)*d+539*b*u/1536,Z=Math.asin(Math.sin(S)*n.cosineAlpha),R=Math.atan(n.a/n.b*Math.tan(Z));S=S-n.sigma;let C=Math.cos(2*n.sigma+S),E=Math.sin(S),A=Math.cos(S),L=n.cosineU*A,F=n.sineU*E,N=Math.atan2(E*n.sineHeading,L-F*n.cosineHeading)-uhe(n.f,n.sineAlpha,n.cosineSquaredAlpha,S,E,A,C);return l(t)?(t.longitude=this._start.longitude+N,t.latitude=R,t.height=0,t):new pe(this._start.longitude+N,R,0)};var mb=T2;var xpn=x(T(),1);function WQ(e,t,n){if(e===0)return t*n;let i=e*e,o=i*i,r=o*i,s=r*i,a=s*i,c=a*i,d=n,u=Math.sin(2*d),m=Math.sin(4*d),p=Math.sin(6*d),b=Math.sin(8*d),f=Math.sin(10*d),y=Math.sin(12*d);return t*((1-i/4-3*o/64-5*r/256-175*s/16384-441*a/65536-4851*c/1048576)*d-(3*i/8+3*o/32+45*r/1024+105*s/4096+2205*a/131072+6237*c/524288)*u+(15*o/256+45*r/1024+525*s/16384+1575*a/65536+155925*c/8388608)*m-(35*r/3072+175*s/12288+3675*a/262144+13475*c/1048576)*p+(315*s/131072+2205*a/524288+43659*c/8388608)*b-(693*a/1310720+6237*c/5242880)*f+1001*c/8388608*y)}function ROe(e,t,n){let i=e/n;if(t===0)return i;let o=i*i,r=o*i,s=r*i,a=t,c=a*a,d=c*c,u=d*c,m=u*c,p=m*c,b=p*c,f=Math.sin(2*i),y=Math.cos(2*i),_=Math.sin(4*i),S=Math.cos(4*i),Z=Math.sin(6*i),R=Math.cos(6*i),C=Math.sin(8*i),E=Math.cos(8*i),A=Math.sin(10*i),L=Math.cos(10*i),F=Math.sin(12*i);return i+i*c/4+7*i*d/64+15*i*u/256+579*i*m/16384+1515*i*p/65536+16837*i*b/1048576+(3*i*d/16+45*i*u/256-i*(32*o-561)*m/4096-i*(232*o-1677)*p/16384+i*(399985-90560*o+512*s)*b/5242880)*y+(21*i*u/256+483*i*m/4096-i*(224*o-1969)*p/16384-i*(33152*o-112599)*b/1048576)*S+(151*i*m/4096+4681*i*p/65536+1479*i*b/16384-453*r*b/32768)*R+(1097*i*p/65536+42783*i*b/1048576)*E+8011*i*b/1048576*L+(3*c/8+3*d/16+213*u/2048-3*o*u/64+255*m/4096-33*o*m/512+20861*p/524288-33*o*p/512+s*p/1024+28273*b/1048576-471*o*b/8192+9*s*b/4096)*f+(21*d/256+21*u/256+533*m/8192-21*o*m/512+197*p/4096-315*o*p/4096+584039*b/16777216-12517*o*b/131072+7*s*b/2048)*_+(151*u/6144+151*m/4096+5019*p/131072-453*o*p/16384+26965*b/786432-8607*o*b/131072)*Z+(1097*m/131072+1097*p/65536+225797*b/10485760-1097*o*b/65536)*C+(8011*p/2621440+8011*b/1048576)*A+293393*b/251658240*F}function C1(e,t){if(e===0)return Math.log(Math.tan(.5*(W.PI_OVER_TWO+t)));let n=e*Math.sin(t);return Math.log(Math.tan(.5*(W.PI_OVER_TWO+t)))-e/2*Math.log((1+n)/(1-n))}function COe(e,t,n,i,o){let r=C1(e._ellipticity,n),s=C1(e._ellipticity,o);return Math.atan2(W.negativePiToPi(i-t),s-r)}function VOe(e,t,n,i,o,r,s){let a=e._heading,c=r-i,d;if(W.equalsEpsilon(Math.abs(a),W.PI_OVER_TWO,W.EPSILON8))if(t===n)d=t*Math.cos(o)*W.negativePiToPi(c);else{let u=Math.sin(o);d=t*Math.cos(o)*W.negativePiToPi(c)/Math.sqrt(1-e._ellipticitySquared*u*u)}else{let u=WQ(e._ellipticity,t,o);d=(WQ(e._ellipticity,t,s)-u)/Math.cos(a)}return Math.abs(d)}var EOe=new h,LQ=new h;function hhe(e,t,n,i){let o=h.normalize(i.cartographicToCartesian(t,LQ),EOe),r=h.normalize(i.cartographicToCartesian(n,LQ),LQ),s=i.maximumRadius,a=i.minimumRadius,c=s*s,d=a*a;e._ellipticitySquared=(c-d)/c,e._ellipticity=Math.sqrt(e._ellipticitySquared),e._start=pe.clone(t,e._start),e._start.height=0,e._end=pe.clone(n,e._end),e._end.height=0,e._heading=COe(e,t.longitude,t.latitude,n.longitude,n.latitude),e._distance=VOe(e,i.maximumRadius,i.minimumRadius,t.longitude,t.latitude,n.longitude,n.latitude)}function fhe(e,t,n,i,o,r){if(n===0)return pe.clone(e,r);let s=o*o,a,c,d;if(Math.abs(W.PI_OVER_TWO-Math.abs(t))>W.EPSILON8){let u=WQ(o,i,e.latitude),m=n*Math.cos(t),p=u+m;if(c=ROe(p,o,i),Math.abs(t)0?a=W.negativePiToPi(e.longitude+d):a=W.negativePiToPi(e.longitude-d)}return l(r)?(r.longitude=a,r.latitude=c,r.height=0,r):new pe(a,c,0)}function hb(e,t,n){let i=n??ne.default;this._ellipsoid=i,this._start=new pe,this._end=new pe,this._heading=void 0,this._distance=void 0,this._ellipticity=void 0,this._ellipticitySquared=void 0,l(e)&&l(t)&&hhe(this,e,t,i)}Object.defineProperties(hb.prototype,{ellipsoid:{get:function(){return this._ellipsoid}},surfaceDistance:{get:function(){return this._distance}},start:{get:function(){return this._start}},end:{get:function(){return this._end}},heading:{get:function(){return this._heading}}});hb.fromStartHeadingDistance=function(e,t,n,i,o){let r=i??ne.default,s=r.maximumRadius,a=r.minimumRadius,c=s*s,d=a*a,u=Math.sqrt((c-d)/c);t=W.negativePiToPi(t);let m=fhe(e,t,n,r.maximumRadius,u);return!l(o)||l(i)&&!i.equals(o.ellipsoid)?new hb(e,m,r):(o.setEndPoints(e,m),o)};hb.prototype.setEndPoints=function(e,t){hhe(this,e,t,this._ellipsoid)};hb.prototype.interpolateUsingFraction=function(e,t){return this.interpolateUsingSurfaceDistance(e*this._distance,t)};hb.prototype.interpolateUsingSurfaceDistance=function(e,t){return fhe(this._start,this._heading,e,this._ellipsoid.maximumRadius,this._ellipticity,t)};hb.prototype.findIntersectionWithLongitude=function(e,t){let n=this._ellipticity,i=this._heading,o=Math.abs(i),r=this._start;if(e=W.negativePiToPi(e),W.equalsEpsilon(Math.abs(e),Math.PI,W.EPSILON14)&&(e=W.sign(r.longitude)*Math.PI),l(t)||(t=new pe),Math.abs(W.PI_OVER_TWO-o)<=W.EPSILON8)return t.longitude=e,t.latitude=r.latitude,t.height=0,t;if(W.equalsEpsilon(Math.abs(W.PI_OVER_TWO-o),W.PI_OVER_TWO,W.EPSILON8))return W.equalsEpsilon(e,r.longitude,W.EPSILON12)?void 0:(t.longitude=e,t.latitude=W.PI_OVER_TWO*W.sign(W.PI_OVER_TWO-i),t.height=0,t);let s=r.latitude,a=n*Math.sin(s),c=Math.tan(.5*(W.PI_OVER_TWO+s))*Math.exp((e-r.longitude)/Math.tan(i)),d=(1+a)/(1-a),u=r.latitude,m;do{m=u;let p=n*Math.sin(m),b=(1+p)/(1-p);u=2*Math.atan(c*Math.pow(b/d,n/2))-W.PI_OVER_TWO}while(!W.equalsEpsilon(u,m,W.EPSILON12));return t.longitude=e,t.latitude=u,t.height=0,t};hb.prototype.findIntersectionWithLatitude=function(e,t){let n=this._ellipticity,i=this._heading,o=this._start;if(W.equalsEpsilon(Math.abs(i),W.PI_OVER_TWO,W.EPSILON8))return;let r=C1(n,o.latitude),s=C1(n,e),a=Math.tan(i)*(s-r),c=W.negativePiToPi(o.longitude+a);return l(t)?(t.longitude=c,t.latitude=e,t.height=0,t):new pe(c,e,0)};var Ac=hb;var Vpn=x(T(),1);var _2=class e{constructor(t){this._ellipsoid=t??ne.WGS84,this._semimajorAxis=this._ellipsoid.maximumRadius,this._oneOverSemimajorAxis=1/this._semimajorAxis}get ellipsoid(){return this._ellipsoid}static mercatorAngleToGeodeticLatitude(t){return W.PI_OVER_TWO-2*Math.atan(Math.exp(-t))}static geodeticLatitudeToMercatorAngle(t){t>e.MaximumLatitude?t=e.MaximumLatitude:t<-e.MaximumLatitude&&(t=-e.MaximumLatitude);let n=Math.sin(t);return .5*Math.log((1+n)/(1-n))}project(t,n){let i=this._semimajorAxis,o=t.longitude*i,r=e.geodeticLatitudeToMercatorAngle(t.latitude)*i,s=t.height;return l(n)?(n.x=o,n.y=r,n.z=s,n):new h(o,r,s)}unproject(t,n){let i=this._oneOverSemimajorAxis,o=t.x*i,r=e.mercatorAngleToGeodeticLatitude(t.y*i),s=t.z;return l(n)?(n.longitude=o,n.latitude=r,n.height=s,n):new pe(o,r,s)}};_2.MaximumLatitude=_2.mercatorAngleToGeodeticLatitude(Math.PI);var Ti=_2;var MQ=[ki,Ti],AOe=MQ.length,Ihe=Math.cos(W.toRadians(30)),phe=Math.cos(W.toRadians(150)),Phe=0,Xhe=1e3;function wy(e){e=e??B.EMPTY_OBJECT;let t=e.positions;this.width=e.width??1,this._positions=t,this.granularity=e.granularity??9999,this.loop=e.loop??!1,this.arcType=e.arcType??un.GEODESIC,this._ellipsoid=ne.default,this._projectionIndex=0,this._workerName="createGroundPolylineGeometry",this._scene3DOnly=!1}Object.defineProperties(wy.prototype,{packedLength:{get:function(){return 1+this._positions.length*3+1+1+1+ne.packedLength+1+1}}});wy.setProjectionAndEllipsoid=function(e,t){let n=0;for(let i=0;iIhe||rW.PI_OVER_TWO&&(a=!0,s=h.subtract(r,n,Zhe),d=c.cartesianToCartographic(s,She)),d.height=0;let u=e.project(d,o);return o=h.subtract(u,i,o),o.z=0,o=h.normalize(o,o),a&&h.negate(o,o),o}var KOe=new h,Rhe=new h;function Che(e,t,n,i,o,r){let s=h.subtract(t,e,KOe);h.normalize(s,s);let a=n-Phe,c=h.multiplyByScalar(s,a,Rhe);h.add(e,c,o);let d=i-Xhe;c=h.multiplyByScalar(s,d,Rhe),h.add(t,c,r)}var JOe=new h;function sO(e,t){let n=cn.getPointDistance(aO,e),i=cn.getPointDistance(aO,t),o=JOe;W.equalsEpsilon(n,0,W.EPSILON2)?(o=fb(t,e,o),h.multiplyByScalar(o,W.EPSILON2,o),h.add(e,o,e)):W.equalsEpsilon(i,0,W.EPSILON2)&&(o=fb(e,t,o),h.multiplyByScalar(o,W.EPSILON2,o),h.add(t,o,t))}function jOe(e,t){let n=Math.abs(e.longitude),i=Math.abs(t.longitude);if(W.equalsEpsilon(n,W.PI,W.EPSILON11)){let o=W.sign(t.longitude);return e.longitude=o*(n-W.EPSILON11),1}else if(W.equalsEpsilon(i,W.PI,W.EPSILON11)){let o=W.sign(e.longitude);return t.longitude=o*(i-W.EPSILON11),2}return 0}var Yhe=new pe,Mhe=new pe,Vhe=new h,PQ=new h,Ehe=new h,Ahe=new h,QOe=new h,Ghe=new h,qOe=[Yhe,Mhe],$Oe=new re,eBe=new h,tBe=new h,nBe=new h,iBe=new h,oBe=new h,rBe=new h,XQ=new h,NQ=new h,sBe=new h,aBe=new h,cBe=new h,Lhe=new h,lBe=new h,dBe=new h,uBe=new An,mBe=new An,Whe=new h,hBe=new h,vhe=new h,fBe=[new me,new me],whe=[0,2,1,0,3,2,0,7,3,0,4,7,0,5,4,0,1,5,5,7,4,5,6,7,5,2,6,5,1,2,3,6,2,3,7,6],Fhe=whe.length;function pBe(e,t,n,i,o,r,s){let a,c,d=t._ellipsoid,u=n.length/3-1,m=u*8,p=m*4,b=u*36,f=m>65535?new Uint32Array(b):new Uint16Array(b),y=new Float64Array(m*3),_=new Float32Array(p),S=new Float32Array(p),Z=new Float32Array(p),R=new Float32Array(p),C=new Float32Array(p),E,A,L,F;s&&(E=new Float32Array(p),A=new Float32Array(p),L=new Float32Array(p),F=new Float32Array(m*2));let I=r.length/2,N=0,g=Yhe;g.height=0;let V=Mhe;V.height=0;let G=Vhe,v=PQ;if(s)for(c=0,a=1;aIhe?(qe=S2(t,g,tt,Be,XQ),We=S2(t,V,$,je,NQ)):yi===1?(We=S2(t,V,$,je,NQ),qe.x=0,qe.y=W.sign(g.longitude-Math.abs(V.longitude)),qe.z=0):(qe=S2(t,g,tt,Be,XQ),We.x=0,We.y=W.sign(g.longitude-V.longitude),We.z=0)}let Ke=h.distance(Fe,H),ct=An.fromCartesian(Ae,uBe),Et=h.subtract(te,Ae,sBe),zt=h.normalize(Et,Lhe),ut=h.subtract(Fe,Ae,aBe);ut=h.normalize(ut,ut);let bt=h.cross(zt,ut,Lhe);bt=h.normalize(bt,bt);let ht=h.cross(ut,tt,lBe);ht=h.normalize(ht,ht);let jt=h.subtract(H,te,cBe);jt=h.normalize(jt,jt);let st=h.cross($,jt,dBe);st=h.normalize(st,st);let pt=Ke/Y,Mi=ee/Y,jn=0,Si,Hi,Gi,pi=0,Zi=0;if(s){jn=h.distance(Be,je),Si=An.fromCartesian(Be,mBe),Hi=h.subtract(je,Be,Whe),Gi=h.normalize(Hi,hBe);let yi=Gi.x;Gi.x=Gi.y,Gi.y=-yi,pi=jn/N,Zi=le/N}for(D=0;D<8;D++){let yi=z+D*4,fr=O+D*2,mo=yi+3,Qr=D<4?1:-1,Mn=D===2||D===3||D===6||D===7?1:-1;h.pack(ct.high,_,yi),_[mo]=Et.x,h.pack(ct.low,S,yi),S[mo]=Et.y,h.pack(ht,Z,yi),Z[mo]=Et.z,h.pack(st,R,yi),R[mo]=pt*Qr,h.pack(bt,C,yi);let Ki=Mi*Mn;Ki===0&&Mn<0&&(Ki=9),C[mo]=Ki,s&&(E[yi]=Si.high.x,E[yi+1]=Si.high.y,E[yi+2]=Si.low.x,E[yi+3]=Si.low.y,L[yi]=-qe.y,L[yi+1]=qe.x,L[yi+2]=We.y,L[yi+3]=-We.x,A[yi]=Hi.x,A[yi+1]=Hi.y,A[yi+2]=Gi.x,A[yi+3]=Gi.y,F[fr]=pi*Qr,Ki=Zi*Mn,Ki===0&&Mn<0&&(Ki=9),F[fr+1]=Ki)}let On=nBe,rn=iBe,Hn=eBe,$i=tBe,Po=re.fromCartographicArray(qOe,$Oe),hr=Pi.getMinimumMaximumHeights(Po,d),Is=hr.minimumTerrainHeight,Hs=hr.maximumTerrainHeight;_e+=Math.abs(Is),_e+=Math.abs(Hs),Che(Ae,Fe,Is,Hs,On,Hn),Che(te,H,Is,Hs,rn,$i);let or=h.multiplyByScalar(bt,W.EPSILON5,vhe);h.add(On,or,On),h.add(rn,or,rn),h.add(Hn,or,Hn),h.add($i,or,$i),sO(On,rn),sO(Hn,$i),h.pack(On,y,w),h.pack(rn,y,w+3),h.pack($i,y,w+6),h.pack(Hn,y,w+9),or=h.multiplyByScalar(bt,-2*W.EPSILON5,vhe),h.add(On,or,On),h.add(rn,or,rn),h.add(Hn,or,Hn),h.add($i,or,$i),sO(On,rn),sO(Hn,$i),h.pack(On,y,w+12),h.pack(rn,y,w+15),h.pack($i,y,w+18),h.pack(Hn,y,w+21),M+=2,c+=3,O+=16,w+=24,z+=32,ee+=Ke,le+=jn}c=0;let he=0;for(a=0;a-1)return!0;return!1}function jOe(e){let t=e._template.components,n=e._template.source;if(l(n))e.shaderSource+=`${n} +`;function rt(e){this.type=void 0,this.shaderSource=void 0,this.materials=void 0,this.uniforms=void 0,this._uniforms=void 0,this.translucent=void 0,this._minificationFilter=e.minificationFilter??Ht.LINEAR,this._magnificationFilter=e.magnificationFilter??$n.LINEAR,this._strict=void 0,this._template=void 0,this._count=void 0,this._texturePaths={},this._loadedImages=[],this._loadedCubeMaps=[],this._textures={},this._updateFunctions=[],this._defaultTexture=void 0,this._initializationPromises=[],this._initializationError=void 0,yBe(e,this),Object.defineProperties(this,{type:{value:this.type,writable:!1},minificationFilter:{get:function(){return this._minificationFilter},set:function(t){this._minificationFilter=t}},magnificationFilter:{get:function(){return this._magnificationFilter},set:function(t){this._magnificationFilter=t}}}),l(rt._uniformList[this.type])||(rt._uniformList[this.type]=Object.keys(this._uniforms))}rt._uniformList={};rt.fromType=function(e,t){let n=new rt({fabric:{type:e}});if(l(t))for(let i in t)t.hasOwnProperty(i)&&(n.uniforms[i]=t[i]);return n};rt.fromTypeAsync=async function(e,t){let n=[],i=new rt({fabric:{type:e,uniforms:t}});if(Hhe(i,n),await Promise.all(n),n.length=0,l(i._initializationError))throw i._initializationError;return i};function Hhe(e,t){t.push(...e._initializationPromises);let n=e.materials;for(let i in n)if(n.hasOwnProperty(i)){let o=n[i];Hhe(o,t)}}rt.prototype.isTranslucent=function(){if(l(this.translucent))return typeof this.translucent=="function"?this.translucent():this.translucent;let e=!0,t=this._translucentFunctions,n=t.length;for(let i=0;i-1)return!0;return!1}function RBe(e){let t=e._template.components,n=e._template.source;if(l(n))e.shaderSource+=`${n} `;else{if(e.shaderSource+=`czm_material czm_getMaterial(czm_materialInput materialInput) { `,e.shaderSource+=`czm_material material = czm_getDefaultMaterial(materialInput); -`,l(t)){let i=Object.keys(e._template.materials).length>0;for(let o in t)if(t.hasOwnProperty(o))if(o==="diffuse"||o==="emission"){let s=i&&JOe(t[o],e)?t[o]:`czm_gammaCorrect(${t[o]})`;e.shaderSource+=`material.${o} = ${s}; +`,l(t)){let i=Object.keys(e._template.materials).length>0;for(let o in t)if(t.hasOwnProperty(o))if(o==="diffuse"||o==="emission"){let s=i&&ZBe(t[o],e)?t[o]:`czm_gammaCorrect(${t[o]})`;e.shaderSource+=`material.${o} = ${s}; `}else o==="alpha"?e.shaderSource+=`material.alpha = ${t.alpha}; `:e.shaderSource+=`material.${o} = ${t[o]}; `}e.shaderSource+=`return material; } -`}}var phe={mat2:Ji,mat3:q,mat4:P},QOe=/\.ktx2$/i;function qOe(e){let t;return function(n,i){let o=n.uniforms,r=o[e],s=t!==r,a=!l(r)||r===rt.DefaultImageId;t=r;let c=n._textures[e],d,u;if(r instanceof HTMLVideoElement){if(r.readyState>=2){if(s&&l(c)&&(c!==i.defaultTexture&&c.destroy(),c=void 0),!l(c)||c===i.defaultTexture){let m=new Ot({minificationFilter:n._minificationFilter,magnificationFilter:n._magnificationFilter});c=new vt({context:i,source:r,sampler:m}),n._textures[e]=c;return}c.copyFrom({source:r})}else l(c)||(n._textures[e]=i.defaultTexture);return}if(r instanceof vt&&r!==c){n._texturePaths[e]=void 0;let m=n._textures[e];l(m)&&m!==n._defaultTexture&&m.destroy(),n._textures[e]=r,d=`${e}Dimensions`,o.hasOwnProperty(d)&&(u=o[d],u.x=r._width,u.y=r._height);return}if(s&&l(c)&&a&&(c!==n._defaultTexture&&c.destroy(),c=void 0,n._texturePaths[e]=void 0),l(c)||(c=n._textures[e]=n._defaultTexture,d=`${e}Dimensions`,o.hasOwnProperty(d)&&(u=o[d],u.x=c._width,u.y=c._height)),!a){if((r instanceof HTMLCanvasElement||r instanceof HTMLImageElement||r instanceof ImageBitmap||r instanceof OffscreenCanvas)&&r!==n._texturePaths[e]){n._loadedImages.push({id:e,image:r}),n._texturePaths[e]=r;return}ghe(n,e)}}}function ghe(e,t){let i=e.uniforms[t];if(i===rt.DefaultImageId)return Promise.resolve();let o=ve.createIfNeeded(i);if(!(o instanceof ve))return Promise.resolve();let r=ve.createIfNeeded(e._texturePaths[t]);if(!(!l(r)||r.url!==o.url))return Promise.resolve();let a;return QOe.test(o.url)?a=Ad(o.url):a=o.fetchImage(),Promise.resolve(a).then(function(c){e._loadedImages.push({id:t,image:c})}).catch(function(c){e._initializationError=c;let d=e._textures[t];l(d)&&d!==e._defaultTexture&&d.destroy(),e._textures[t]=e._defaultTexture}),e._texturePaths[t]=i,a}function $Oe(e){return function(t,n){let i=t.uniforms[e];if(i instanceof es){let o=t._textures[e];o!==t._defaultTexture&&o.destroy(),t._texturePaths[e]=void 0,t._textures[e]=i;return}l(t._textures[e])||(t._textures[e]=n.defaultCubeMap),yhe(t,e)}}function yhe(e,t){let i=e.uniforms[t];if(i===rt.DefaultCubeMapId)return Promise.resolve();let o=i.positiveX+i.negativeX+i.positiveY+i.negativeY+i.positiveZ+i.negativeZ;if(o===e._texturePaths[t])return Promise.resolve();let r=[ve.createIfNeeded(i.positiveX).fetchImage(),ve.createIfNeeded(i.negativeX).fetchImage(),ve.createIfNeeded(i.positiveY).fetchImage(),ve.createIfNeeded(i.negativeY).fetchImage(),ve.createIfNeeded(i.positiveZ).fetchImage(),ve.createIfNeeded(i.negativeZ).fetchImage()],s=Promise.all(r);return s.then(function(a){e._loadedCubeMaps.push({id:t,images:a})}).catch(function(a){e._initializationError=a}),e._texturePaths[t]=o,s}function eBe(e){let t=e._template.uniforms;for(let n in t)t.hasOwnProperty(n)&&xhe(e,n)}function xhe(e,t){let n=e._strict,i=e._template.uniforms,o=i[t],r=tBe(o),s;if(r==="channels")s=z2(e,t,o,!1);else{if(r==="sampler2D"){let d=`${t}Dimensions`;iBe(e,d)>0&&(i[d]={type:"ivec3",x:1,y:1},xhe(e,d))}if(!new RegExp(`uniform\\s+${r}\\s+${t}\\s*;`).test(e.shaderSource)){let d=`uniform ${r} ${t};`;e.shaderSource=d+e.shaderSource}let c=`${t}_${e._count++}`;if(s=z2(e,t,c),e.uniforms[t]=o,r==="sampler2D")e._uniforms[c]=function(){return e._textures[t]},e._updateFunctions.push(qOe(t)),e._initializationPromises.push(ghe(e,t));else if(r==="samplerCube")e._uniforms[c]=function(){return e._textures[t]},e._updateFunctions.push($Oe(t)),e._initializationPromises.push(yhe(e,t));else if(r.indexOf("mat")!==-1){let d=new phe[r];e._uniforms[c]=function(){return phe[r].fromColumnMajorArray(e.uniforms[t],d)}}else e._uniforms[c]=function(){return e.uniforms[t]}}}function tBe(e){let t=e.type;if(!l(t)){let n=typeof e;if(n==="number")t="float";else if(n==="boolean")t="bool";else if(n==="string"||e instanceof ve||e instanceof HTMLCanvasElement||e instanceof HTMLImageElement||e instanceof ImageBitmap||e instanceof OffscreenCanvas)/^([rgba]){1,4}$/i.test(e)?t="channels":e===rt.DefaultCubeMapId?t="samplerCube":t="sampler2D";else if(n==="object")if(Array.isArray(e))(e.length===4||e.length===9||e.length===16)&&(t=`mat${Math.sqrt(e.length)}`);else{let i=0;for(let o in e)e.hasOwnProperty(o)&&(i+=1);i>=2&&i<=4?t=`vec${i}`:i===6&&(t="samplerCube")}}return t}function nBe(e){let t=e._strict,n=e._template.materials;for(let i in n)if(n.hasOwnProperty(i)){let o=new rt({strict:t,fabric:n[i],count:e._count});e._count=o._count,e._uniforms=It(e._uniforms,o._uniforms,!0),e.materials[i]=o,e._translucentFunctions=e._translucentFunctions.concat(o._translucentFunctions);let r="czm_getMaterial",s=`${r}_${e._count++}`;z2(o,r,s),e.shaderSource=o.shaderSource+e.shaderSource;let a=`${s}(materialInput)`,c=z2(e,i,a)}}function z2(e,t,n,i){i=i??!0;let o=0,r="([\\w])?",s=`([\\w${i?".":""}])?`,a=new RegExp(s+t+r,"g");return e.shaderSource=e.shaderSource.replace(a,function(c,d,u){return d||u?c:(o+=1,n)}),o}function iBe(e,t,n){return z2(e,t,t,n)}rt._materialCache={_materials:{},addMaterial:function(e,t){this._materials[e]=t},getMaterial:function(e){return this._materials[e]}};rt.DefaultImageId="czm_defaultImage";rt.DefaultCubeMapId="czm_defaultCubeMap";rt.ColorType="Color";rt._materialCache.addMaterial(rt.ColorType,{fabric:{type:rt.ColorType,uniforms:{color:new U(1,0,0,.5)},components:{diffuse:"color.rgb",alpha:"color.a"}},translucent:function(e){return e.uniforms.color.alpha<1}});rt.ImageType="Image";rt._materialCache.addMaterial(rt.ImageType,{fabric:{type:rt.ImageType,uniforms:{image:rt.DefaultImageId,repeat:new k(1,1),color:new U(1,1,1,1)},components:{diffuse:"texture(image, fract(repeat * materialInput.st)).rgb * color.rgb",alpha:"texture(image, fract(repeat * materialInput.st)).a * color.a"}},translucent:function(e){return e.uniforms.color.alpha<1}});rt.DiffuseMapType="DiffuseMap";rt._materialCache.addMaterial(rt.DiffuseMapType,{fabric:{type:rt.DiffuseMapType,uniforms:{image:rt.DefaultImageId,channels:"rgb",repeat:new k(1,1)},components:{diffuse:"texture(image, fract(repeat * materialInput.st)).channels"}},translucent:!1});rt.AlphaMapType="AlphaMap";rt._materialCache.addMaterial(rt.AlphaMapType,{fabric:{type:rt.AlphaMapType,uniforms:{image:rt.DefaultImageId,channel:"a",repeat:new k(1,1)},components:{alpha:"texture(image, fract(repeat * materialInput.st)).channel"}},translucent:!0});rt.SpecularMapType="SpecularMap";rt._materialCache.addMaterial(rt.SpecularMapType,{fabric:{type:rt.SpecularMapType,uniforms:{image:rt.DefaultImageId,channel:"r",repeat:new k(1,1)},components:{specular:"texture(image, fract(repeat * materialInput.st)).channel"}},translucent:!1});rt.EmissionMapType="EmissionMap";rt._materialCache.addMaterial(rt.EmissionMapType,{fabric:{type:rt.EmissionMapType,uniforms:{image:rt.DefaultImageId,channels:"rgb",repeat:new k(1,1)},components:{emission:"texture(image, fract(repeat * materialInput.st)).channels"}},translucent:!1});rt.BumpMapType="BumpMap";rt._materialCache.addMaterial(rt.BumpMapType,{fabric:{type:rt.BumpMapType,uniforms:{image:rt.DefaultImageId,channel:"r",strength:.8,repeat:new k(1,1)},source:A2},translucent:!1});rt.NormalMapType="NormalMap";rt._materialCache.addMaterial(rt.NormalMapType,{fabric:{type:rt.NormalMapType,uniforms:{image:rt.DefaultImageId,channels:"rgb",strength:.8,repeat:new k(1,1)},source:X2},translucent:!1});rt.GridType="Grid";rt._materialCache.addMaterial(rt.GridType,{fabric:{type:rt.GridType,uniforms:{color:new U(0,1,0,1),cellAlpha:.1,lineCount:new k(8,8),lineThickness:new k(1,1),lineOffset:new k(0,0)},source:P2},translucent:function(e){let t=e.uniforms;return t.color.alpha<1||t.cellAlpha<1}});rt.StripeType="Stripe";rt._materialCache.addMaterial(rt.StripeType,{fabric:{type:rt.StripeType,uniforms:{horizontal:!0,evenColor:new U(1,1,1,.5),oddColor:new U(0,0,1,.5),offset:0,repeat:5},source:D2},translucent:function(e){let t=e.uniforms;return t.evenColor.alpha<1||t.oddColor.alpha<1}});rt.CheckerboardType="Checkerboard";rt._materialCache.addMaterial(rt.CheckerboardType,{fabric:{type:rt.CheckerboardType,uniforms:{lightColor:new U(1,1,1,.5),darkColor:new U(0,0,0,.5),repeat:new k(5,5)},source:G2},translucent:function(e){let t=e.uniforms;return t.lightColor.alpha<1||t.darkColor.alpha<1}});rt.DotType="Dot";rt._materialCache.addMaterial(rt.DotType,{fabric:{type:rt.DotType,uniforms:{lightColor:new U(1,1,0,.75),darkColor:new U(0,1,1,.75),repeat:new k(5,5)},source:L2},translucent:function(e){let t=e.uniforms;return t.lightColor.alpha<1||t.darkColor.alpha<1}});rt.WaterType="Water";rt._materialCache.addMaterial(rt.WaterType,{fabric:{type:rt.WaterType,uniforms:{baseWaterColor:new U(.2,.3,.6,1),blendColor:new U(0,1,.699,1),specularMap:rt.DefaultImageId,normalMap:rt.DefaultImageId,frequency:10,animationSpeed:.01,amplitude:1,specularIntensity:.5,fadeFactor:1},source:B2},translucent:function(e){let t=e.uniforms;return t.baseWaterColor.alpha<1||t.blendColor.alpha<1}});rt.RimLightingType="RimLighting";rt._materialCache.addMaterial(rt.RimLightingType,{fabric:{type:rt.RimLightingType,uniforms:{color:new U(1,0,0,.7),rimColor:new U(1,1,1,.4),width:.3},source:k2},translucent:function(e){let t=e.uniforms;return t.color.alpha<1||t.rimColor.alpha<1}});rt.FadeType="Fade";rt._materialCache.addMaterial(rt.FadeType,{fabric:{type:rt.FadeType,uniforms:{fadeInColor:new U(1,0,0,1),fadeOutColor:new U(0,0,0,0),maximumDistance:.5,repeat:!0,fadeDirection:{x:!0,y:!0},time:new k(.5,.5)},source:I2},translucent:function(e){let t=e.uniforms;return t.fadeInColor.alpha<1||t.fadeOutColor.alpha<1}});rt.PolylineArrowType="PolylineArrow";rt._materialCache.addMaterial(rt.PolylineArrowType,{fabric:{type:rt.PolylineArrowType,uniforms:{color:new U(1,1,1,1)},source:N2},translucent:!0});rt.PolylineDashType="PolylineDash";rt._materialCache.addMaterial(rt.PolylineDashType,{fabric:{type:rt.PolylineDashType,uniforms:{color:new U(1,0,1,1),gapColor:new U(0,0,0,0),dashLength:16,dashPattern:255},source:Y2},translucent:!0});rt.PolylineGlowType="PolylineGlow";rt._materialCache.addMaterial(rt.PolylineGlowType,{fabric:{type:rt.PolylineGlowType,uniforms:{color:new U(0,.5,1,1),glowPower:.25,taperPower:1},source:M2},translucent:!0});rt.PolylineOutlineType="PolylineOutline";rt._materialCache.addMaterial(rt.PolylineOutlineType,{fabric:{type:rt.PolylineOutlineType,uniforms:{color:new U(1,1,1,1),outlineColor:new U(1,0,0,1),outlineWidth:1},source:w2},translucent:function(e){let t=e.uniforms;return t.color.alpha<1||t.outlineColor.alpha<1}});rt.ElevationContourType="ElevationContour";rt._materialCache.addMaterial(rt.ElevationContourType,{fabric:{type:rt.ElevationContourType,uniforms:{spacing:100,color:new U(1,0,0,1),width:1},source:v2},translucent:!1});rt.ElevationRampType="ElevationRamp";rt._materialCache.addMaterial(rt.ElevationRampType,{fabric:{type:rt.ElevationRampType,uniforms:{image:rt.DefaultImageId,minimumHeight:0,maximumHeight:1e4},source:F2},translucent:!1});rt.SlopeRampMaterialType="SlopeRamp";rt._materialCache.addMaterial(rt.SlopeRampMaterialType,{fabric:{type:rt.SlopeRampMaterialType,uniforms:{image:rt.DefaultImageId},source:U2},translucent:!1});rt.AspectRampMaterialType="AspectRamp";rt._materialCache.addMaterial(rt.AspectRampMaterialType,{fabric:{type:rt.AspectRampMaterialType,uniforms:{image:rt.DefaultImageId},source:E2},translucent:!1});rt.ElevationBandType="ElevationBand";rt._materialCache.addMaterial(rt.ElevationBandType,{fabric:{type:rt.ElevationBandType,uniforms:{heights:rt.DefaultImageId,colors:rt.DefaultImageId},source:W2},translucent:!0});rt.WaterMaskType="WaterMask";rt._materialCache.addMaterial(rt.WaterMaskType,{fabric:{type:rt.WaterMaskType,source:O2,uniforms:{waterColor:new U(1,1,1,1),landColor:new U(0,0,0,0)}},translucent:!1});var eo=rt;function __(e){e=e??B.EMPTY_OBJECT;let t=e.translucent??!0,n=e.closed??!1,i=e.materialSupport??__.MaterialSupport.TEXTURED;this.material=l(e.material)?e.material:eo.fromType(eo.ColorType),this.translucent=t,this._vertexShaderSource=e.vertexShaderSource??i.vertexShaderSource,this._fragmentShaderSource=e.fragmentShaderSource??i.fragmentShaderSource,this._renderState=Go.getDefaultRenderState(t,n,e.renderState),this._closed=n,this._materialSupport=i,this._vertexFormat=i.vertexFormat,this._flat=e.flat??!1,this._faceForward=e.faceForward??!n}Object.defineProperties(__.prototype,{vertexShaderSource:{get:function(){return this._vertexShaderSource}},fragmentShaderSource:{get:function(){return this._fragmentShaderSource}},renderState:{get:function(){return this._renderState}},closed:{get:function(){return this._closed}},materialSupport:{get:function(){return this._materialSupport}},vertexFormat:{get:function(){return this._vertexFormat}},flat:{get:function(){return this._flat}},faceForward:{get:function(){return this._faceForward}}});__.prototype.getFragmentShaderSource=Go.prototype.getFragmentShaderSource;__.prototype.isTranslucent=Go.prototype.isTranslucent;__.prototype.getRenderState=Go.prototype.getRenderState;__.MaterialSupport={BASIC:Object.freeze({vertexFormat:Me.POSITION_AND_NORMAL,vertexShaderSource:R2,fragmentShaderSource:Z2}),TEXTURED:Object.freeze({vertexFormat:Me.POSITION_NORMAL_AND_ST,vertexShaderSource:V2,fragmentShaderSource:C2}),ALL:Object.freeze({vertexFormat:Me.ALL,vertexShaderSource:S2,fragmentShaderSource:_2})};var Co=__;var Agn=x(T(),1);var hgn=x(T(),1),H2=`in vec3 v_positionEC; -in vec3 v_normalEC; -in vec4 v_color; -void main() -{ -vec3 positionToEyeEC = -v_positionEC; -vec3 normalEC = normalize(v_normalEC); -#ifdef FACE_FORWARD -normalEC = faceforward(normalEC, vec3(0.0, 0.0, 1.0), -normalEC); -#endif -vec4 color = czm_gammaCorrect(v_color); -czm_materialInput materialInput; -materialInput.normalEC = normalEC; -materialInput.positionToEyeEC = positionToEyeEC; -czm_material material = czm_getDefaultMaterial(materialInput); -material.diffuse = color.rgb; -material.alpha = color.a; -out_FragColor = czm_phong(normalize(positionToEyeEC), material, czm_lightDirectionEC); -} -`;var pgn=x(T(),1),K2=`in vec3 position3DHigh; -in vec3 position3DLow; -in vec3 normal; -in vec4 color; -in float batchId; -out vec3 v_positionEC; -out vec3 v_normalEC; -out vec4 v_color; -void main() -{ -vec4 p = czm_computePosition(); -v_positionEC = (czm_modelViewRelativeToEye * p).xyz; -v_normalEC = czm_normal * normal; -v_color = color; -gl_Position = czm_modelViewProjectionRelativeToEye * p; -} -`;var ggn=x(T(),1),S_=`in vec4 v_color; -void main() -{ -out_FragColor = czm_gammaCorrect(v_color); -} -`;var xgn=x(T(),1),J2=`in vec3 position3DHigh; -in vec3 position3DLow; -in vec4 color; -in float batchId; -out vec4 v_color; -void main() -{ -vec4 p = czm_computePosition(); -v_color = color; -gl_Position = czm_modelViewProjectionRelativeToEye * p; -} -`;function hb(e){e=e??B.EMPTY_OBJECT;let t=e.translucent??!0,n=e.closed??!1,i=e.flat??!1,o=i?J2:K2,r=i?S_:H2,s=i?hb.FLAT_VERTEX_FORMAT:hb.VERTEX_FORMAT;this.material=void 0,this.translucent=t,this._vertexShaderSource=e.vertexShaderSource??o,this._fragmentShaderSource=e.fragmentShaderSource??r,this._renderState=Go.getDefaultRenderState(t,n,e.renderState),this._closed=n,this._vertexFormat=s,this._flat=i,this._faceForward=e.faceForward??!n}Object.defineProperties(hb.prototype,{vertexShaderSource:{get:function(){return this._vertexShaderSource}},fragmentShaderSource:{get:function(){return this._fragmentShaderSource}},renderState:{get:function(){return this._renderState}},closed:{get:function(){return this._closed}},vertexFormat:{get:function(){return this._vertexFormat}},flat:{get:function(){return this._flat}},faceForward:{get:function(){return this._faceForward}}});hb.VERTEX_FORMAT=Me.POSITION_AND_NORMAL;hb.FLAT_VERTEX_FORMAT=Me.POSITION_ONLY;hb.prototype.getFragmentShaderSource=Go.prototype.getFragmentShaderSource;hb.prototype.isTranslucent=Go.prototype.isTranslucent;hb.prototype.getRenderState=Go.prototype.getRenderState;var Tn=hb;var Xgn=x(T(),1);function A1(e){this._definitionChanged=new Se,this._color=void 0,this._colorSubscription=void 0,this.color=e}Object.defineProperties(A1.prototype,{isConstant:{get:function(){return j.isConstant(this._color)}},definitionChanged:{get:function(){return this._definitionChanged}},color:be("color")});A1.prototype.getType=function(e){return"Color"};var oBe=new Q;A1.prototype.getValue=function(e,t){return l(e)||(e=Q.now(oBe)),l(t)||(t={}),t.color=j.getValueOrClonedDefault(this._color,e,U.WHITE,t.color),t};A1.prototype.equals=function(e){return this===e||e instanceof A1&&j.equals(this._color,e._color)};var Qt=A1;var cSn=x(T(),1);var k_n=x(T(),1);var iyn=x(T(),1);var Bgn=x(T(),1);var VQ=class{constructor(t){t=t??B.EMPTY_OBJECT,this._ellipsoid=t.ellipsoid??ne.default,this._rectangle=t.rectangle??re.MAX_VALUE,this._projection=new ki(this._ellipsoid),this._numberOfLevelZeroTilesX=t.numberOfLevelZeroTilesX??2,this._numberOfLevelZeroTilesY=t.numberOfLevelZeroTilesY??1}get ellipsoid(){return this._ellipsoid}get rectangle(){return this._rectangle}get projection(){return this._projection}getNumberOfXTilesAtLevel(t){return this._numberOfLevelZeroTilesX<=r&&(u=r-1);let m=(o.north-t.latitude)/c|0;return m>=s&&(m=s-1),l(i)?(i.x=u,i.y=m,i):new k(u,m)}},to=VQ;var The=new h,_he=new h,She=new pe,EQ=new h,rBe=new h,Zhe=new me,sBe=new to,j2=[new pe,new pe,new pe,new pe],Q2=new k,Ys={};Ys.initialize=function(){let e=Ys._initPromise;return l(e)||(e=ve.fetchJson(en("Assets/approximateTerrainHeights.json")).then(function(t){Ys._terrainHeights=t}),Ys._initPromise=e),e};Ys.getMinimumMaximumHeights=function(e,t){t=t??ne.default;let n=Rhe(e),i=Ys._defaultMinTerrainHeight,o=Ys._defaultMaxTerrainHeight;if(l(n)){let r=`${n.level}-${n.x}-${n.y}`,s=Ys._terrainHeights[r];l(s)&&(i=s[0],o=s[1]),t.cartographicToCartesian(re.northeast(e,She),The),t.cartographicToCartesian(re.southwest(e,She),_he),h.midpoint(_he,The,EQ);let a=t.scaleToGeodeticSurface(EQ,rBe);if(l(a)){let c=h.distance(EQ,a);i=Math.min(i,-c)}else i=Ys._defaultMinTerrainHeight}return i=Math.max(Ys._defaultMinTerrainHeight,i),{minimumTerrainHeight:i,maximumTerrainHeight:o}};Ys.getBoundingSphere=function(e,t){t=t??ne.default;let n=Rhe(e),i=Ys._defaultMaxTerrainHeight;if(l(n)){let r=`${n.level}-${n.x}-${n.y}`,s=Ys._terrainHeights[r];l(s)&&(i=s[1])}let o=me.fromRectangle3D(e,t,0);return me.fromRectangle3D(e,t,i,Zhe),me.union(o,Zhe,o)};function Rhe(e){pe.fromRadians(e.east,e.north,0,j2[0]),pe.fromRadians(e.west,e.north,0,j2[1]),pe.fromRadians(e.east,e.south,0,j2[2]),pe.fromRadians(e.west,e.south,0,j2[3]);let t=0,n=0,i=0,o=0,r=Ys._terrainHeightsMaxLevel,s;for(s=0;s<=r;++s){let a=!1;for(let c=0;c<4;++c){let d=j2[c];if(sBe.positionToTileXY(d,s,Q2),c===0)i=Q2.x,o=Q2.y;else if(i!==Q2.x||o!==Q2.y){a=!0;break}}if(a)break;t=i,n=o}if(s!==0)return{x:t,y:n,level:s>r?r:s-1}}Ys._terrainHeightsMaxLevel=6;Ys._defaultMaxTerrainHeight=9e3;Ys._defaultMinTerrainHeight=-1e5;Ys._terrainHeights=void 0;Ys._initPromise=void 0;Object.defineProperties(Ys,{initialized:{get:function(){return l(Ys._terrainHeights)}}});var Pi=Ys;var Nyn=x(T(),1);var _yn=x(T(),1);var cyn=x(T(),1);function rc(e,t,n){this.minimum=h.clone(e??h.ZERO),this.maximum=h.clone(t??h.ZERO),l(n)?n=h.clone(n):n=h.midpoint(this.minimum,this.maximum,new h),this.center=n}rc.fromCorners=function(e,t,n){return l(n)||(n=new rc),n.minimum=h.clone(e,n.minimum),n.maximum=h.clone(t,n.maximum),n.center=h.midpoint(e,t,n.center),n};rc.fromPoints=function(e,t){if(l(t)||(t=new rc),!l(e)||e.length===0)return t.minimum=h.clone(h.ZERO,t.minimum),t.maximum=h.clone(h.ZERO,t.maximum),t.center=h.clone(h.ZERO,t.center),t;let n=e[0].x,i=e[0].y,o=e[0].z,r=e[0].x,s=e[0].y,a=e[0].z,c=e.length;for(let m=1;m0?qt.INSIDE:r+o<0?qt.OUTSIDE:qt.INTERSECTING};rc.intersectAxisAlignedBoundingBox=function(e,t){return e.minimum.x<=t.maximum.x&&e.maximum.x>=t.minimum.x&&e.minimum.y<=t.maximum.y&&e.maximum.y>=t.minimum.y&&e.minimum.z<=t.maximum.z&&e.maximum.z>=t.minimum.z};rc.prototype.clone=function(e){return rc.clone(this,e)};rc.prototype.intersectPlane=function(e){return rc.intersectPlane(this,e)};rc.prototype.intersectAxisAlignedBoundingBox=function(e){return rc.intersectAxisAlignedBoundingBox(this,e)};rc.prototype.equals=function(e){return rc.equals(this,e)};var Zu=rc;var AQ=new ce;function vp(e,t){t=t??ne.default,e=t.scaleToGeodeticSurface(e);let n=_t.eastNorthUpToFixedFrame(e,t);this._ellipsoid=t,this._origin=e,this._xAxis=h.fromCartesian4(P.getColumn(n,0,AQ)),this._yAxis=h.fromCartesian4(P.getColumn(n,1,AQ));let i=h.fromCartesian4(P.getColumn(n,2,AQ));this._plane=cn.fromPointNormal(e,i)}Object.defineProperties(vp.prototype,{ellipsoid:{get:function(){return this._ellipsoid}},origin:{get:function(){return this._origin}},plane:{get:function(){return this._plane}},xAxis:{get:function(){return this._xAxis}},yAxis:{get:function(){return this._yAxis}},zAxis:{get:function(){return this._plane.normal}}});var aBe=new Zu;vp.fromPoints=function(e,t){let n=Zu.fromPoints(e,aBe);return new vp(n.center,t)};var Che=new gn,rO=new h;vp.prototype.projectPointOntoPlane=function(e,t){let n=Che;n.origin=e,h.normalize(e,n.direction);let i=xi.rayPlane(n,this._plane,rO);if(l(i)||(h.negate(n.direction,n.direction),i=xi.rayPlane(n,this._plane,rO)),l(i)){let o=h.subtract(i,this._origin,i),r=h.dot(this._xAxis,o),s=h.dot(this._yAxis,o);return l(t)?(t.x=r,t.y=s,t):new k(r,s)}};vp.prototype.projectPointsOntoPlane=function(e,t){l(t)||(t=[]);let n=0,i=e.length;for(let o=0;o0?0:L.latitude,V=pe.fromRadians(N,e.north,n,xBe),G=pe.fromRadians(e.west,e.north,n,TBe),v=pe.fromRadians(e.west,g,n,_Be),X=pe.fromRadians(e.west,e.south,n,SBe),Y=pe.fromRadians(N,e.south,n,ZBe),D=i.cartographicToCartesian(V,RBe),M=i.cartographicToCartesian(G,Ahe),O=i.cartographicToCartesian(v,CBe),w=i.cartographicToCartesian(X,Ghe),z=i.cartographicToCartesian(Y,VBe),K=I.projectPointToNearestOnPlane(D,EBe),te=I.projectPointToNearestOnPlane(M,ABe),H=I.projectPointToNearestOnPlane(O,GBe),$=I.projectPointToNearestOnPlane(w,LBe),ee=I.projectPointToNearestOnPlane(z,WBe);return r=Math.min(te.x,H.x,$.x),s=-r,c=Math.max(te.y,K.y),a=Math.min($.y,ee.y),G.height=X.height=t,M=i.cartographicToCartesian(G,Ahe),w=i.cartographicToCartesian(X,Ghe),d=Math.min(cn.getPointDistance(m,M),cn.getPointDistance(m,w)),u=n,Vhe(I.origin,I.xAxis,I.yAxis,I.zAxis,r,s,a,c,d,u,o)}let p=e.south>0,b=e.north<0,f=p?e.south:b?e.north:0,y=re.center(e,Ehe).longitude,_=h.fromRadians(y,f,n,i,vBe);_.z=0;let Z=Math.abs(_.x)=c?qt.INSIDE:qt.INTERSECTING};var vhe=new h,Fhe=new h,Ihe=new h,kBe=new h,Lhe=new h,UBe=new h;ho.distanceSquaredTo=function(e,t){let n=h.subtract(t,e.center,Whe),i=e.halfAxes,o=q.getColumn(i,0,vhe),r=q.getColumn(i,1,Fhe),s=q.getColumn(i,2,Ihe),a=h.magnitude(o),c=h.magnitude(r),d=h.magnitude(s),u=!0,m=!0,p=!0;a>0?h.divideByScalar(o,a,o):u=!1,c>0?h.divideByScalar(r,c,r):m=!1,d>0?h.divideByScalar(s,d,s):p=!1;let b=!u+!m+!p,f,y,_;if(b===1){let C=o;f=r,y=s,m?p||(C=s,y=o):(C=r,f=o),_=h.cross(f,y,Lhe),C===o?o=_:C===r?r=_:C===s&&(s=_)}else if(b===2){f=o,m?f=r:p&&(f=s);let C=h.UNIT_Y;C.equalsEpsilon(f,W.EPSILON3)&&(C=h.UNIT_X),y=h.cross(f,C,kBe),h.normalize(y,y),_=h.cross(f,y,Lhe),h.normalize(_,_),f===o?(r=y,s=_):f===r?(s=y,o=_):f===s&&(o=y,r=_)}else b===3&&(o=h.UNIT_X,r=h.UNIT_Y,s=h.UNIT_Z);let S=UBe;S.x=h.dot(n,o),S.y=h.dot(n,r),S.z=h.dot(n,s);let Z=0,R;return S.x<-a?(R=S.x+a,Z+=R*R):S.x>a&&(R=S.x-a,Z+=R*R),S.y<-c?(R=S.y+c,Z+=R*R):S.y>c&&(R=S.y-c,Z+=R*R),S.z<-d?(R=S.z+d,Z+=R*R):S.z>d&&(R=S.z-d,Z+=R*R),Z};var DBe=new h,OBe=new h;ho.computePlaneDistances=function(e,t,n,i){l(i)||(i=new Ns);let o=Number.POSITIVE_INFINITY,r=Number.NEGATIVE_INFINITY,s=e.center,a=e.halfAxes,c=q.getColumn(a,0,vhe),d=q.getColumn(a,1,Fhe),u=q.getColumn(a,2,Ihe),m=h.add(c,d,DBe);h.add(m,u,m),h.add(m,s,m);let p=h.subtract(m,t,OBe),b=h.dot(n,p);return o=Math.min(b,o),r=Math.max(b,r),h.add(s,c,m),h.add(m,d,m),h.subtract(m,u,m),h.subtract(m,t,p),b=h.dot(n,p),o=Math.min(b,o),r=Math.max(b,r),h.add(s,c,m),h.subtract(m,d,m),h.add(m,u,m),h.subtract(m,t,p),b=h.dot(n,p),o=Math.min(b,o),r=Math.max(b,r),h.add(s,c,m),h.subtract(m,d,m),h.subtract(m,u,m),h.subtract(m,t,p),b=h.dot(n,p),o=Math.min(b,o),r=Math.max(b,r),h.subtract(s,c,m),h.add(m,d,m),h.add(m,u,m),h.subtract(m,t,p),b=h.dot(n,p),o=Math.min(b,o),r=Math.max(b,r),h.subtract(s,c,m),h.add(m,d,m),h.subtract(m,u,m),h.subtract(m,t,p),b=h.dot(n,p),o=Math.min(b,o),r=Math.max(b,r),h.subtract(s,c,m),h.subtract(m,d,m),h.add(m,u,m),h.subtract(m,t,p),b=h.dot(n,p),o=Math.min(b,o),r=Math.max(b,r),h.subtract(s,c,m),h.subtract(m,d,m),h.subtract(m,u,m),h.subtract(m,t,p),b=h.dot(n,p),o=Math.min(b,o),r=Math.max(b,r),i.start=o,i.stop=r,i};var BBe=new h,zBe=new h,HBe=new h;ho.computeCorners=function(e,t){l(t)||(t=[new h,new h,new h,new h,new h,new h,new h,new h]);let n=e.center,i=e.halfAxes,o=q.getColumn(i,0,BBe),r=q.getColumn(i,1,zBe),s=q.getColumn(i,2,HBe);return h.clone(n,t[0]),h.subtract(t[0],o,t[0]),h.subtract(t[0],r,t[0]),h.subtract(t[0],s,t[0]),h.clone(n,t[1]),h.subtract(t[1],o,t[1]),h.subtract(t[1],r,t[1]),h.add(t[1],s,t[1]),h.clone(n,t[2]),h.subtract(t[2],o,t[2]),h.add(t[2],r,t[2]),h.subtract(t[2],s,t[2]),h.clone(n,t[3]),h.subtract(t[3],o,t[3]),h.add(t[3],r,t[3]),h.add(t[3],s,t[3]),h.clone(n,t[4]),h.add(t[4],o,t[4]),h.subtract(t[4],r,t[4]),h.subtract(t[4],s,t[4]),h.clone(n,t[5]),h.add(t[5],o,t[5]),h.subtract(t[5],r,t[5]),h.add(t[5],s,t[5]),h.clone(n,t[6]),h.add(t[6],o,t[6]),h.add(t[6],r,t[6]),h.subtract(t[6],s,t[6]),h.clone(n,t[7]),h.add(t[7],o,t[7]),h.add(t[7],r,t[7]),h.add(t[7],s,t[7]),t};var KBe=new q;ho.computeTransformation=function(e,t){l(t)||(t=new P);let n=e.center,i=q.multiplyByUniformScale(e.halfAxes,2,KBe);return P.fromRotationTranslation(i,n,t)};var JBe=new me;ho.isOccluded=function(e,t){let n=me.fromOrientedBoundingBox(e,JBe);return!t.isBoundingSphereVisible(n)};ho.prototype.intersectPlane=function(e){return ho.intersectPlane(this,e)};ho.prototype.distanceSquaredTo=function(e){return ho.distanceSquaredTo(this,e)};ho.prototype.computePlaneDistances=function(e,t,n){return ho.computePlaneDistances(this,e,t,n)};ho.prototype.computeCorners=function(e){return ho.computeCorners(this,e)};ho.prototype.computeTransformation=function(e){return ho.computeTransformation(this,e)};ho.prototype.isOccluded=function(e){return ho.isOccluded(this,e)};ho.equals=function(e,t){return e===t||l(e)&&l(t)&&h.equals(e.center,t.center)&&q.equals(e.halfAxes,t.halfAxes)};ho.prototype.clone=function(e){return ho.clone(this,e)};ho.prototype.equals=function(e){return ho.equals(this,e)};var nn=ho;var Uyn=x(T(),1);var sO={};sO.getHeight=function(e,t,n){return(e-n)*t+n};var jBe=new pe;sO.getPosition=function(e,t,n,i,o){let r=t.cartesianToCartographic(e,jBe);if(!l(r))return h.clone(e,o);let s=sO.getHeight(r.height,n,i);return h.fromRadians(r.longitude,r.latitude,s,t,o)};var _o=sO;var Z_n=x(T(),1);var Oyn=x(T(),1),GQ={TERRAIN:0,CESIUM_3D_TILE:1,BOTH:2};GQ.NUMBER_OF_CLASSIFICATION_TYPES=3;Object.freeze(GQ);var ni=GQ;var Hyn=x(T(),1);var Phe={NEVER:ie.NEVER,LESS:ie.LESS,EQUAL:ie.EQUAL,LESS_OR_EQUAL:ie.LEQUAL,GREATER:ie.GREATER,NOT_EQUAL:ie.NOTEQUAL,GREATER_OR_EQUAL:ie.GEQUAL,ALWAYS:ie.ALWAYS};Object.freeze(Phe);var sc=Phe;var STn=x(T(),1);var Jyn=x(T(),1);function QBe(e,t){let n=[],i=e.length,o=0;for(;o=2){if(s&&l(c)&&(c!==i.defaultTexture&&c.destroy(),c=void 0),!l(c)||c===i.defaultTexture){let m=new Ot({minificationFilter:n._minificationFilter,magnificationFilter:n._magnificationFilter});c=new vt({context:i,source:r,sampler:m}),n._textures[e]=c;return}c.copyFrom({source:r})}else l(c)||(n._textures[e]=i.defaultTexture);return}if(r instanceof vt&&r!==c){n._texturePaths[e]=void 0;let m=n._textures[e];l(m)&&m!==n._defaultTexture&&m.destroy(),n._textures[e]=r,d=`${e}Dimensions`,o.hasOwnProperty(d)&&(u=o[d],u.x=r._width,u.y=r._height);return}if(s&&l(c)&&a&&(c!==n._defaultTexture&&c.destroy(),c=void 0,n._texturePaths[e]=void 0),l(c)||(c=n._textures[e]=n._defaultTexture,d=`${e}Dimensions`,o.hasOwnProperty(d)&&(u=o[d],u.x=c._width,u.y=c._height)),!a){if((r instanceof HTMLCanvasElement||r instanceof HTMLImageElement||r instanceof ImageBitmap||r instanceof OffscreenCanvas)&&r!==n._texturePaths[e]){n._loadedImages.push({id:e,image:r}),n._texturePaths[e]=r;return}Khe(n,e)}}}function Khe(e,t){let i=e.uniforms[t];if(i===rt.DefaultImageId)return Promise.resolve();let o=ve.createIfNeeded(i);if(!(o instanceof ve))return Promise.resolve();let r=ve.createIfNeeded(e._texturePaths[t]);if(!(!l(r)||r.url!==o.url))return Promise.resolve();let a;return CBe.test(o.url)?a=Ad(o.url):a=o.fetchImage(),Promise.resolve(a).then(function(c){e._loadedImages.push({id:t,image:c})}).catch(function(c){e._initializationError=c;let d=e._textures[t];l(d)&&d!==e._defaultTexture&&d.destroy(),e._textures[t]=e._defaultTexture}),e._texturePaths[t]=i,a}function EBe(e){return function(t,n){let i=t.uniforms[e];if(i instanceof es){let o=t._textures[e];o!==t._defaultTexture&&o.destroy(),t._texturePaths[e]=void 0,t._textures[e]=i;return}l(t._textures[e])||(t._textures[e]=n.defaultCubeMap),Jhe(t,e)}}function Jhe(e,t){let i=e.uniforms[t];if(i===rt.DefaultCubeMapId)return Promise.resolve();let o=i.positiveX+i.negativeX+i.positiveY+i.negativeY+i.positiveZ+i.negativeZ;if(o===e._texturePaths[t])return Promise.resolve();let r=[ve.createIfNeeded(i.positiveX).fetchImage(),ve.createIfNeeded(i.negativeX).fetchImage(),ve.createIfNeeded(i.positiveY).fetchImage(),ve.createIfNeeded(i.negativeY).fetchImage(),ve.createIfNeeded(i.positiveZ).fetchImage(),ve.createIfNeeded(i.negativeZ).fetchImage()],s=Promise.all(r);return s.then(function(a){e._loadedCubeMaps.push({id:t,images:a})}).catch(function(a){e._initializationError=a}),e._texturePaths[t]=o,s}function ABe(e){let t=e._template.uniforms;for(let n in t)t.hasOwnProperty(n)&&jhe(e,n)}function jhe(e,t){let n=e._strict,i=e._template.uniforms,o=i[t],r=GBe(o),s;if(r==="channels")s=O2(e,t,o,!1);else{if(r==="sampler2D"){let d=`${t}Dimensions`;WBe(e,d)>0&&(i[d]={type:"ivec3",x:1,y:1},jhe(e,d))}if(!new RegExp(`uniform\\s+${r}\\s+${t}\\s*;`).test(e.shaderSource)){let d=`uniform ${r} ${t};`;e.shaderSource=d+e.shaderSource}let c=`${t}_${e._count++}`;if(s=O2(e,t,c),e.uniforms[t]=o,r==="sampler2D")e._uniforms[c]=function(){return e._textures[t]},e._updateFunctions.push(VBe(t)),e._initializationPromises.push(Khe(e,t));else if(r==="samplerCube")e._uniforms[c]=function(){return e._textures[t]},e._updateFunctions.push(EBe(t)),e._initializationPromises.push(Jhe(e,t));else if(r.indexOf("mat")!==-1){let d=new zhe[r];e._uniforms[c]=function(){return zhe[r].fromColumnMajorArray(e.uniforms[t],d)}}else e._uniforms[c]=function(){return e.uniforms[t]}}}function GBe(e){let t=e.type;if(!l(t)){let n=typeof e;if(n==="number")t="float";else if(n==="boolean")t="bool";else if(n==="string"||e instanceof ve||e instanceof HTMLCanvasElement||e instanceof HTMLImageElement||e instanceof ImageBitmap||e instanceof OffscreenCanvas)/^([rgba]){1,4}$/i.test(e)?t="channels":e===rt.DefaultCubeMapId?t="samplerCube":t="sampler2D";else if(n==="object")if(Array.isArray(e))(e.length===4||e.length===9||e.length===16)&&(t=`mat${Math.sqrt(e.length)}`);else{let i=0;for(let o in e)e.hasOwnProperty(o)&&(i+=1);i>=2&&i<=4?t=`vec${i}`:i===6&&(t="samplerCube")}}return t}function LBe(e){let t=e._strict,n=e._template.materials;for(let i in n)if(n.hasOwnProperty(i)){let o=new rt({strict:t,fabric:n[i],count:e._count});e._count=o._count,e._uniforms=It(e._uniforms,o._uniforms,!0),e.materials[i]=o,e._translucentFunctions=e._translucentFunctions.concat(o._translucentFunctions);let r="czm_getMaterial",s=`${r}_${e._count++}`;O2(o,r,s),e.shaderSource=o.shaderSource+e.shaderSource;let a=`${s}(materialInput)`,c=O2(e,i,a)}}function O2(e,t,n,i){i=i??!0;let o=0,r="([\\w])?",s=`([\\w${i?".":""}])?`,a=new RegExp(s+t+r,"g");return e.shaderSource=e.shaderSource.replace(a,function(c,d,u){return d||u?c:(o+=1,n)}),o}function WBe(e,t,n){return O2(e,t,t,n)}rt._materialCache={_materials:{},addMaterial:function(e,t){this._materials[e]=t},getMaterial:function(e){return this._materials[e]}};rt.DefaultImageId="czm_defaultImage";rt.DefaultCubeMapId="czm_defaultCubeMap";rt.ColorType="Color";rt._materialCache.addMaterial(rt.ColorType,{fabric:{type:rt.ColorType,uniforms:{color:new U(1,0,0,.5)},components:{diffuse:"color.rgb",alpha:"color.a"}},translucent:function(e){return e.uniforms.color.alpha<1}});rt.ImageType="Image";rt._materialCache.addMaterial(rt.ImageType,{fabric:{type:rt.ImageType,uniforms:{image:rt.DefaultImageId,repeat:new k(1,1),color:new U(1,1,1,1)},components:{diffuse:"texture(image, fract(repeat * materialInput.st)).rgb * color.rgb",alpha:"texture(image, fract(repeat * materialInput.st)).a * color.a"}},translucent:function(e){return e.uniforms.color.alpha<1}});rt.DiffuseMapType="DiffuseMap";rt._materialCache.addMaterial(rt.DiffuseMapType,{fabric:{type:rt.DiffuseMapType,uniforms:{image:rt.DefaultImageId,channels:"rgb",repeat:new k(1,1)},components:{diffuse:"texture(image, fract(repeat * materialInput.st)).channels"}},translucent:!1});rt.AlphaMapType="AlphaMap";rt._materialCache.addMaterial(rt.AlphaMapType,{fabric:{type:rt.AlphaMapType,uniforms:{image:rt.DefaultImageId,channel:"a",repeat:new k(1,1)},components:{alpha:"texture(image, fract(repeat * materialInput.st)).channel"}},translucent:!0});rt.SpecularMapType="SpecularMap";rt._materialCache.addMaterial(rt.SpecularMapType,{fabric:{type:rt.SpecularMapType,uniforms:{image:rt.DefaultImageId,channel:"r",repeat:new k(1,1)},components:{specular:"texture(image, fract(repeat * materialInput.st)).channel"}},translucent:!1});rt.EmissionMapType="EmissionMap";rt._materialCache.addMaterial(rt.EmissionMapType,{fabric:{type:rt.EmissionMapType,uniforms:{image:rt.DefaultImageId,channels:"rgb",repeat:new k(1,1)},components:{emission:"texture(image, fract(repeat * materialInput.st)).channels"}},translucent:!1});rt.BumpMapType="BumpMap";rt._materialCache.addMaterial(rt.BumpMapType,{fabric:{type:rt.BumpMapType,uniforms:{image:rt.DefaultImageId,channel:"r",strength:.8,repeat:new k(1,1)},source:V2},translucent:!1});rt.NormalMapType="NormalMap";rt._materialCache.addMaterial(rt.NormalMapType,{fabric:{type:rt.NormalMapType,uniforms:{image:rt.DefaultImageId,channels:"rgb",strength:.8,repeat:new k(1,1)},source:I2},translucent:!1});rt.GridType="Grid";rt._materialCache.addMaterial(rt.GridType,{fabric:{type:rt.GridType,uniforms:{color:new U(0,1,0,1),cellAlpha:.1,lineCount:new k(8,8),lineThickness:new k(1,1),lineOffset:new k(0,0)},source:F2},translucent:function(e){let t=e.uniforms;return t.color.alpha<1||t.cellAlpha<1}});rt.StripeType="Stripe";rt._materialCache.addMaterial(rt.StripeType,{fabric:{type:rt.StripeType,uniforms:{horizontal:!0,evenColor:new U(1,1,1,.5),oddColor:new U(0,0,1,.5),offset:0,repeat:5},source:k2},translucent:function(e){let t=e.uniforms;return t.evenColor.alpha<1||t.oddColor.alpha<1}});rt.CheckerboardType="Checkerboard";rt._materialCache.addMaterial(rt.CheckerboardType,{fabric:{type:rt.CheckerboardType,uniforms:{lightColor:new U(1,1,1,.5),darkColor:new U(0,0,0,.5),repeat:new k(5,5)},source:E2},translucent:function(e){let t=e.uniforms;return t.lightColor.alpha<1||t.darkColor.alpha<1}});rt.DotType="Dot";rt._materialCache.addMaterial(rt.DotType,{fabric:{type:rt.DotType,uniforms:{lightColor:new U(1,1,0,.75),darkColor:new U(0,1,1,.75),repeat:new k(5,5)},source:A2},translucent:function(e){let t=e.uniforms;return t.lightColor.alpha<1||t.darkColor.alpha<1}});rt.WaterType="Water";rt._materialCache.addMaterial(rt.WaterType,{fabric:{type:rt.WaterType,uniforms:{baseWaterColor:new U(.2,.3,.6,1),blendColor:new U(0,1,.699,1),specularMap:rt.DefaultImageId,normalMap:rt.DefaultImageId,frequency:10,animationSpeed:.01,amplitude:1,specularIntensity:.5,fadeFactor:1},source:D2},translucent:function(e){let t=e.uniforms;return t.baseWaterColor.alpha<1||t.blendColor.alpha<1}});rt.RimLightingType="RimLighting";rt._materialCache.addMaterial(rt.RimLightingType,{fabric:{type:rt.RimLightingType,uniforms:{color:new U(1,0,0,.7),rimColor:new U(1,1,1,.4),width:.3},source:M2},translucent:function(e){let t=e.uniforms;return t.color.alpha<1||t.rimColor.alpha<1}});rt.FadeType="Fade";rt._materialCache.addMaterial(rt.FadeType,{fabric:{type:rt.FadeType,uniforms:{fadeInColor:new U(1,0,0,1),fadeOutColor:new U(0,0,0,0),maximumDistance:.5,repeat:!0,fadeDirection:{x:!0,y:!0},time:new k(.5,.5)},source:v2},translucent:function(e){let t=e.uniforms;return t.fadeInColor.alpha<1||t.fadeOutColor.alpha<1}});rt.PolylineArrowType="PolylineArrow";rt._materialCache.addMaterial(rt.PolylineArrowType,{fabric:{type:rt.PolylineArrowType,uniforms:{color:new U(1,1,1,1)},source:P2},translucent:!0});rt.PolylineDashType="PolylineDash";rt._materialCache.addMaterial(rt.PolylineDashType,{fabric:{type:rt.PolylineDashType,uniforms:{color:new U(1,0,1,1),gapColor:new U(0,0,0,0),dashLength:16,dashPattern:255},source:X2},translucent:!0});rt.PolylineGlowType="PolylineGlow";rt._materialCache.addMaterial(rt.PolylineGlowType,{fabric:{type:rt.PolylineGlowType,uniforms:{color:new U(0,.5,1,1),glowPower:.25,taperPower:1},source:N2},translucent:!0});rt.PolylineOutlineType="PolylineOutline";rt._materialCache.addMaterial(rt.PolylineOutlineType,{fabric:{type:rt.PolylineOutlineType,uniforms:{color:new U(1,1,1,1),outlineColor:new U(1,0,0,1),outlineWidth:1},source:Y2},translucent:function(e){let t=e.uniforms;return t.color.alpha<1||t.outlineColor.alpha<1}});rt.ElevationContourType="ElevationContour";rt._materialCache.addMaterial(rt.ElevationContourType,{fabric:{type:rt.ElevationContourType,uniforms:{spacing:100,color:new U(1,0,0,1),width:1},source:L2},translucent:!1});rt.ElevationRampType="ElevationRamp";rt._materialCache.addMaterial(rt.ElevationRampType,{fabric:{type:rt.ElevationRampType,uniforms:{image:rt.DefaultImageId,minimumHeight:0,maximumHeight:1e4},source:W2},translucent:!1});rt.SlopeRampMaterialType="SlopeRamp";rt._materialCache.addMaterial(rt.SlopeRampMaterialType,{fabric:{type:rt.SlopeRampMaterialType,uniforms:{image:rt.DefaultImageId},source:w2},translucent:!1});rt.AspectRampMaterialType="AspectRamp";rt._materialCache.addMaterial(rt.AspectRampMaterialType,{fabric:{type:rt.AspectRampMaterialType,uniforms:{image:rt.DefaultImageId},source:C2},translucent:!1});rt.ElevationBandType="ElevationBand";rt._materialCache.addMaterial(rt.ElevationBandType,{fabric:{type:rt.ElevationBandType,uniforms:{heights:rt.DefaultImageId,colors:rt.DefaultImageId},source:G2},translucent:!0});rt.WaterMaskType="WaterMask";rt._materialCache.addMaterial(rt.WaterMaskType,{fabric:{type:rt.WaterMaskType,source:U2,uniforms:{waterColor:new U(1,1,1,1),landColor:new U(0,0,0,0)}},translucent:!1});var to=rt;var vBe=`#define CLIP_POLYLINE +${Ul} +${R2}`,FBe=T_;function R_(e){e=e??B.EMPTY_OBJECT;let t=e.translucent??!0,n=!1,i=R_.VERTEX_FORMAT;this.material=l(e.material)?e.material:to.fromType(to.ColorType),this.translucent=t,this._vertexShaderSource=e.vertexShaderSource??vBe,this._fragmentShaderSource=e.fragmentShaderSource??FBe,this._renderState=Go.getDefaultRenderState(t,n,e.renderState),this._closed=n,this._vertexFormat=i}Object.defineProperties(R_.prototype,{vertexShaderSource:{get:function(){let e=this._vertexShaderSource;return this.material.shaderSource.search(/in\s+float\s+v_polylineAngle;/g)!==-1&&(e=`#define POLYLINE_DASH +${e}`),e}},fragmentShaderSource:{get:function(){return this._fragmentShaderSource}},renderState:{get:function(){return this._renderState}},closed:{get:function(){return this._closed}},vertexFormat:{get:function(){return this._vertexFormat}}});R_.VERTEX_FORMAT=Me.POSITION_AND_ST;R_.prototype.getFragmentShaderSource=Go.prototype.getFragmentShaderSource;R_.prototype.isTranslucent=Go.prototype.isTranslucent;R_.prototype.getRenderState=Go.prototype.getRenderState;var rc=R_;var Uyn=x(T(),1);var pgn=x(T(),1);function IBe(e,t){let n=[],i=e.length,o=0;for(;oe.MaximumLatitude?t=e.MaximumLatitude:t<-e.MaximumLatitude&&(t=-e.MaximumLatitude);let n=Math.sin(t);return .5*Math.log((1+n)/(1-n))}project(t,n){let i=this._semimajorAxis,o=t.longitude*i,r=e.geodeticLatitudeToMercatorAngle(t.latitude)*i,s=t.height;return l(n)?(n.x=o,n.y=r,n.z=s,n):new h(o,r,s)}unproject(t,n){let i=this._oneOverSemimajorAxis,o=t.x*i,r=e.mercatorAngleToGeodeticLatitude(t.y*i),s=t.z;return l(n)?(n.longitude=o,n.latitude=r,n.height=s,n):new pe(o,r,s)}};eF.MaximumLatitude=eF.mercatorAngleToGeodeticLatitude(Math.PI);var Ti=eF;function u3e(e,t,n){let i=!n,o=e.length,r;if(!i&&o>1){let s=e[0].modelMatrix;for(r=1;r=0){let d=i[a];o=d.offset+d.count,s=d.index,r=n[s].indices.length}else o=0,s=0,r=n[s].indices.length;let c=e.length;for(let d=0;dr&&(o=0,r=n[++s].indices.length),i.push({index:s,offset:o,count:p}),o+=p}}function f3e(e,t){let n=[];return WQ(e,"geometry",t,n),WQ(e,"westHemisphereGeometry",t,n),WQ(e,"eastHemisphereGeometry",t,n),n}var pb={};pb.combineGeometry=function(e){let t,n,i=e.instances,o=i.length,r,s,a=!1;o>0&&(t=h3e(e),t.length>0&&(n=Bn.createAttributeLocations(t[0]),e.createPickOffsets&&(r=f3e(i,t))),l(i[0].attributes)&&l(i[0].attributes.offset)&&(s=new Array(o),a=!0));let c=new Array(o),d=new Array(o);for(let u=0;u0&&(n.set(c.indices,s),s+=f)}return t.push(n.buffer),{stringTable:i,packedData:n}};pb.unpackCreateGeometryResults=function(e){let t=e.stringTable,n=e.packedData,i,o=new Array(n[0]),r=0,s=1;for(;s0){let E=_.length/S;for(C=Oe.createTypedArray(E,y),i=0;i1){let s=e[0].modelMatrix;for(r=1;r=0){let d=i[a];o=d.offset+d.count,s=d.index,r=n[s].indices.length}else o=0,s=0,r=n[s].indices.length;let c=e.length;for(let d=0;dr&&(o=0,r=n[++s].indices.length),i.push({index:s,offset:o,count:p}),o+=p}}function QBe(e,t){let n=[];return DQ(e,"geometry",t,n),DQ(e,"westHemisphereGeometry",t,n),DQ(e,"eastHemisphereGeometry",t,n),n}var bb={};bb.combineGeometry=function(e){let t,n,i=e.instances,o=i.length,r,s,a=!1;o>0&&(t=jBe(e),t.length>0&&(n=Bn.createAttributeLocations(t[0]),e.createPickOffsets&&(r=QBe(i,t))),l(i[0].attributes)&&l(i[0].attributes.offset)&&(s=new Array(o),a=!0));let c=new Array(o),d=new Array(o);for(let u=0;u0&&(n.set(c.indices,s),s+=f)}return t.push(n.buffer),{stringTable:i,packedData:n}};bb.unpackCreateGeometryResults=function(e){let t=e.stringTable,n=e.packedData,i,o=new Array(n[0]),r=0,s=1;for(;s0){let E=_.length/S;for(C=Oe.createTypedArray(E,y),i=0;i= nearSq && distanceSq <= farSq) ? 1.0 : 0.0; gl_Position *= show; }`,`${i} -${o}`};function Dhe(e,t){if(!e.compressVertices)return t;let n=t.search(/in\s+vec3\s+normal;/g)!==-1,i=t.search(/in\s+vec2\s+st;/g)!==-1;if(!n&&!i)return t;let o=t.search(/in\s+vec3\s+tangent;/g)!==-1,r=t.search(/in\s+vec3\s+bitangent;/g)!==-1,s=i&&n?2:1;s+=o||r?1:0;let a=s>1?`vec${s}`:"float",c="compressedAttributes",d=`in ${a} ${c};`,u="",m="";if(i){u+=`vec2 st; +${o}`};function rfe(e,t){if(!e.compressVertices)return t;let n=t.search(/in\s+vec3\s+normal;/g)!==-1,i=t.search(/in\s+vec2\s+st;/g)!==-1;if(!n&&!i)return t;let o=t.search(/in\s+vec3\s+tangent;/g)!==-1,r=t.search(/in\s+vec3\s+bitangent;/g)!==-1,s=i&&n?2:1;s+=o||r?1:0;let a=s>1?`vec${s}`:"float",c="compressedAttributes",d=`in ${a} ${c};`,u="",m="";if(i){u+=`vec2 st; `;let f=s>1?`${c}.x`:c;m+=` st = czm_decompressTextureCoordinates(${f}); `}n&&o&&r?(u+=`vec3 normal; vec3 tangent; @@ -6898,10 +6793,10 @@ vec3 bitangent; { ${m} czm_non_compressed_main(); }`;return[d,u,p,b].join(` -`)}function A3e(e){let t=Je.replaceMain(e,"czm_non_depth_clamp_main");return t+=`void main() { +`)}function u3e(e){let t=Je.replaceMain(e,"czm_non_depth_clamp_main");return t+=`void main() { czm_non_depth_clamp_main(); gl_Position = czm_depthClamp(gl_Position);} -`,t}function G3e(e){let t=Je.replaceMain(e,"czm_non_depth_clamp_main");return t+=`void main() { +`,t}function m3e(e){let t=Je.replaceMain(e,"czm_non_depth_clamp_main");return t+=`void main() { czm_non_depth_clamp_main(); #if defined(LOG_DEPTH) czm_writeLogDepth(); @@ -6909,223 +6804,198 @@ ${m} czm_non_compressed_main(); czm_writeDepthClamp(); #endif } -`,t}function Ohe(e,t){let n=e.vertexAttributes}function L3e(e,t){return function(){return e[t]}}var vQ=Math.max(fn.hardwareConcurrency-1,1),aO,W3e=new qn("combineGeometry");function v3e(e,t){let n,i,o,r,s=e._instanceIds;if(e._state===ns.READY){n=Array.isArray(e.geometryInstances)?e.geometryInstances:[e.geometryInstances];let a=e._numberOfInstances=n.length,c=[],d=[];for(o=0;o0){let y=new Float64Array(m);for(f=[y.buffer],r=0;r0?(e._recomputeBoundingSpheres=!0,e._state=ns.COMBINED):nF(e,t,ns.FAILED,void 0)}).catch(function(m){nF(e,t,ns.FAILED,m)})}}function F3e(e,t){let n=Array.isArray(e.geometryInstances)?e.geometryInstances:[e.geometryInstances],i=e._numberOfInstances=n.length,o=new Array(i),r=e._instanceIds,s,a,c=0;for(a=0;a0?(e._recomputeBoundingSpheres=!0,e._state=ns.COMBINED):nF(e,t,ns.FAILED,void 0)}function I3e(e,t){let n=e._batchTableAttributeIndices.offset;if(!e._recomputeBoundingSpheres||!l(n)){e._recomputeBoundingSpheres=!1;return}let i,o=e._offsetInstanceExtend,r=e._instanceBoundingSpheres,s=r.length,a=e._tempBoundingSpheres;if(!l(a)){for(a=new Array(s),i=0;i0||me.intersectPlane(y,cn.ORIGIN_ZX_PLANE)!==qt.INTERSECTING?c.push(y):(d.push(y),u.push(y))}let m=c[0],p=u[0],b=d[0];for(i=1;i0){if(wt.maximumVertexTextureImageUnits===0)throw new ae("Vertex texture fetch support is required to render primitives with per-instance attributes. The maximum number of vertex texture image units must be greater than zero.");this._batchTable.update(e)}if(this._state!==ns.COMPLETE&&this._state!==ns.COMBINED&&(this.asynchronous?v3e(this,e):F3e(this,e)),this._state===ns.COMBINED&&(P3e(this,e),zhe(this,e),N3e(this,e)),!this.show||this._state!==ns.COMPLETE)return;this._batchTableOffsetsUpdated||zhe(this,e),this._recomputeBoundingSpheres&&I3e(this,e);let n=this.appearance,i=n.material,o=!1,r=!1;this._appearance!==n?(this._appearance=n,this._material=i,o=!0,r=!0):this._material!==i&&(this._material=i,r=!0);let s=this.depthFailAppearance,a=l(s)?s.material:void 0;this._depthFailAppearance!==s?(this._depthFailAppearance=s,this._depthFailMaterial=a,o=!0,r=!0):this._depthFailMaterial!==a&&(this._depthFailMaterial=a,r=!0);let c=this._appearance.isTranslucent();this._translucent!==c&&(this._translucent=c,o=!0),l(this._material)&&this._material.update(t);let d=n.closed&&c;o&&(this._createRenderStatesFunction??Y3e)(this,t,n,d),r&&(this._createShaderProgramFunction??M3e)(this,e,n),(o||r)&&(this._createCommandsFunction??w3e)(this,n,i,c,d,this._colorCommands,this._pickCommands,e),(this._updateAndQueueCommandsFunction??k3e)(this,e,this._colorCommands,this._pickCommands,this.modelMatrix,this.cull,this.debugShowBoundingVolume,d)};var U3e=new me,D3e=new me;function efe(e,t,n){if(n===bn.TOP){let i=me.clone(e,U3e),o=me.clone(e,D3e);o.center=h.add(o.center,t,o.center),e=me.union(i,o,e)}else n===bn.ALL&&(e.center=h.add(e.center,t,e.center));return e}function O3e(e,t,n){return function(){let i=e.getBatchedAttribute(t,n),o=e.attributes[n],r=o.componentsPerAttribute,s=J.createTypedArray(o.componentDatatype,r);return l(i.constructor.pack)?i.constructor.pack(i,s,0):s[0]=i,s}}function B3e(e,t,n,i,o){return function(r){let s=jhe(r);e.setBatchedAttribute(t,n,s),o==="offset"&&(i._recomputeBoundingSpheres=!0,i._batchTableOffsetsUpdated=!1)}}var z3e=new h;function H3e(e,t,n){t.boundingSphere={get:function(){let i=e._instanceBoundingSpheres[n];if(l(i)){i=i.clone();let o=e.modelMatrix,r=t.offset;l(r)&&efe(i,h.fromArray(r.get(),0,z3e),e._offsetInstanceExtend[n]),l(o)&&(i=me.transform(i,o))}return i}},t.boundingSphereCV={get:function(){return e._instanceBoundingSpheresCV[n]}}}function K3e(e,t,n){t.pickId={get:function(){return e._pickIds[n]}}}is.prototype.getGeometryInstanceAttributes=function(e){let t=this._perInstanceAttributeCache.get(e);if(l(t))return t;let n=-1,i=this._lastPerInstanceAttributeIndex,o=this._instanceIds,r=o.length;for(let d=0;dd&&(u=W.PI-s,s=-W.PI,d+=u),r-=W.EPSILON5,s-=W.EPSILON5,c+=W.EPSILON5,d+=W.EPSILON5;let m=1/(d-s),p=1/(c-r),b={sphericalExtents:new Qc({componentDatatype:J.FLOAT,componentsPerAttribute:4,normalize:!1,value:[r,s,p,m]}),longitudeRotation:new Qc({componentDatatype:J.FLOAT,componentsPerAttribute:1,normalize:!1,value:[u]})};return lfe(b,t),mfe(e,i,b),b};Lm.hasAttributesForTextureCoordinatePlanes=function(e){return l(e.southWest_HIGH)&&l(e.southWest_LOW)&&l(e.northward)&&l(e.eastward)&&l(e.planes2D_HIGH)&&l(e.planes2D_LOW)&&l(e.uMaxVmax)&&l(e.uvMinAndExtents)};Lm.hasAttributesForSphericalExtents=function(e){return l(e.sphericalExtents)&&l(e.longitudeRotation)&&l(e.planes2D_HIGH)&&l(e.planes2D_LOW)&&l(e.uMaxVmax)&&l(e.uvMinAndExtents)};function cze(e){return Math.max(e.width,e.height)>Lm.MAX_WIDTH_FOR_PLANAR_EXTENTS}Lm.shouldUseSphericalCoordinates=function(e){return cze(e)};Lm.MAX_WIDTH_FOR_PLANAR_EXTENTS=W.toRadians(1);var Ru=Lm;var QTn=x(T(),1);var OTn=x(T(),1);var hfe={NEVER:ie.NEVER,LESS:ie.LESS,EQUAL:ie.EQUAL,LESS_OR_EQUAL:ie.LEQUAL,GREATER:ie.GREATER,NOT_EQUAL:ie.NOTEQUAL,GREATER_OR_EQUAL:ie.GEQUAL,ALWAYS:ie.ALWAYS};Object.freeze(hfe);var ii=hfe;var HTn=x(T(),1);var ffe={ZERO:ie.ZERO,KEEP:ie.KEEP,REPLACE:ie.REPLACE,INCREMENT:ie.INCR,DECREMENT:ie.DECR,INVERT:ie.INVERT,INCREMENT_WRAP:ie.INCR_WRAP,DECREMENT_WRAP:ie.DECR_WRAP};Object.freeze(ffe);var Ft=ffe;var lO={CESIUM_3D_TILE_MASK:128,SKIP_LOD_MASK:112,SKIP_LOD_BIT_SHIFT:4,CLASSIFICATION_MASK:15};lO.setCesium3DTileBit=function(){return{enabled:!0,frontFunction:ii.ALWAYS,frontOperation:{fail:Ft.KEEP,zFail:Ft.KEEP,zPass:Ft.REPLACE},backFunction:ii.ALWAYS,backOperation:{fail:Ft.KEEP,zFail:Ft.KEEP,zPass:Ft.REPLACE},reference:lO.CESIUM_3D_TILE_MASK,mask:lO.CESIUM_3D_TILE_MASK}};var Jt=Object.freeze(lO);function C_(e){e=e??B.EMPTY_OBJECT;let t=e.geometryInstances;this.geometryInstances=t,this.show=e.show??!0,this.classificationType=e.classificationType??ni.BOTH,this.debugShowBoundingVolume=e.debugShowBoundingVolume??!1,this.debugShowShadowVolume=e.debugShowShadowVolume??!1,this._debugShowShadowVolume=!1,this._extruded=e._extruded??!1,this._uniformMap=e._uniformMap,this._sp=void 0,this._spStencil=void 0,this._spPick=void 0,this._spColor=void 0,this._spPick2D=void 0,this._spColor2D=void 0,this._rsStencilDepthPass=void 0,this._rsStencilDepthPass3DTiles=void 0,this._rsColorPass=void 0,this._rsPickPass=void 0,this._commandsIgnoreShow=[],this._ready=!1,this._primitive=void 0,this._pickPrimitive=e._pickPrimitive,this._hasSphericalExtentsAttribute=!1,this._hasPlanarExtentsAttributes=!1,this._hasPerColorAttribute=!1,this.appearance=e.appearance,this._createBoundingVolumeFunction=e._createBoundingVolumeFunction,this._updateAndQueueCommandsFunction=e._updateAndQueueCommandsFunction,this._usePickOffsets=!1,this._primitiveOptions={geometryInstances:void 0,appearance:void 0,vertexCacheOptimize:e.vertexCacheOptimize??!1,interleave:e.interleave??!1,releaseGeometryInstances:e.releaseGeometryInstances??!0,allowPicking:e.allowPicking??!0,asynchronous:e.asynchronous??!0,compressVertices:e.compressVertices??!0,_createBoundingVolumeFunction:void 0,_createRenderStatesFunction:void 0,_createShaderProgramFunction:void 0,_createCommandsFunction:void 0,_updateAndQueueCommandsFunction:void 0,_createPickOffsets:!0}}Object.defineProperties(C_.prototype,{vertexCacheOptimize:{get:function(){return this._primitiveOptions.vertexCacheOptimize}},interleave:{get:function(){return this._primitiveOptions.interleave}},releaseGeometryInstances:{get:function(){return this._primitiveOptions.releaseGeometryInstances}},allowPicking:{get:function(){return this._primitiveOptions.allowPicking}},asynchronous:{get:function(){return this._primitiveOptions.asynchronous}},compressVertices:{get:function(){return this._primitiveOptions.compressVertices}},ready:{get:function(){return this._ready}},_needs2DShader:{get:function(){return this._hasPlanarExtentsAttributes||this._hasSphericalExtentsAttribute}}});C_.isSupported=function(e){return e.context.stencilBuffer};function G1(e,t){let n=t?ii.EQUAL:ii.ALWAYS;return{colorMask:{red:!1,green:!1,blue:!1,alpha:!1},stencilTest:{enabled:e,frontFunction:n,frontOperation:{fail:Ft.KEEP,zFail:Ft.DECREMENT_WRAP,zPass:Ft.KEEP},backFunction:n,backOperation:{fail:Ft.KEEP,zFail:Ft.INCREMENT_WRAP,zPass:Ft.KEEP},reference:Jt.CESIUM_3D_TILE_MASK,mask:Jt.CESIUM_3D_TILE_MASK},stencilMask:Jt.CLASSIFICATION_MASK,depthTest:{enabled:!0,func:sc.LESS_OR_EQUAL},depthMask:!1}}function XQ(e){return{stencilTest:{enabled:e,frontFunction:ii.NOT_EQUAL,frontOperation:{fail:Ft.ZERO,zFail:Ft.ZERO,zPass:Ft.ZERO},backFunction:ii.NOT_EQUAL,backOperation:{fail:Ft.ZERO,zFail:Ft.ZERO,zPass:Ft.ZERO},reference:0,mask:Jt.CLASSIFICATION_MASK},stencilMask:Jt.CLASSIFICATION_MASK,depthTest:{enabled:!1},depthMask:!1,blending:on.PRE_MULTIPLIED_ALPHA_BLEND}}var lze={stencilTest:{enabled:!0,frontFunction:ii.NOT_EQUAL,frontOperation:{fail:Ft.ZERO,zFail:Ft.ZERO,zPass:Ft.ZERO},backFunction:ii.NOT_EQUAL,backOperation:{fail:Ft.ZERO,zFail:Ft.ZERO,zPass:Ft.ZERO},reference:0,mask:Jt.CLASSIFICATION_MASK},stencilMask:Jt.CLASSIFICATION_MASK,depthTest:{enabled:!1},depthMask:!1};function dze(e,t,n,i){if(l(e._rsStencilDepthPass))return;let o=!e.debugShowShadowVolume;e._rsStencilDepthPass=ze.fromCache(G1(o,!1)),e._rsStencilDepthPass3DTiles=ze.fromCache(G1(o,!0)),e._rsColorPass=ze.fromCache(XQ(o,!1)),e._rsPickPass=ze.fromCache(lze)}function uze(e,t){if(!e.compressVertices)return t;if(t.search(/in\s+vec3\s+extrudeDirection;/g)!==-1){let n="compressedAttributes",i=`in vec2 ${n};`,o=`vec3 extrudeDirection; -`,r=` extrudeDirection = czm_octDecode(${n}, 65535.0); -`,s=t;s=s.replace(/in\s+vec3\s+extrudeDirection;/g,""),s=Je.replaceMain(s,"czm_non_compressed_main");let a=`void main() -{ -${r} czm_non_compressed_main(); -}`;return[i,o,s,a].join(` -`)}}function mze(e,t){let n=t.context,i=e._primitive,o=r2;o=e._primitive._batchTable.getVertexShaderCallback()(o),o=In._appendDistanceDisplayConditionToShader(i,o),o=In._modifyShaderPosition(e,o,t.scene3DOnly),o=In._updateColorAttribute(i,o);let r=e._hasPlanarExtentsAttributes,s=r||e._hasSphericalExtentsAttribute;e._extruded&&(o=uze(i,o));let a=e._extruded?"EXTRUDED_GEOMETRY":"",c=new Je({defines:[a],sources:[o]}),d=new Je({sources:[Yy]}),u=e._primitive._attributeLocations,m=new Ru(s,r,e.appearance);if(e._spStencil=tn.replaceCache({context:n,shaderProgram:e._spStencil,vertexShaderSource:c,fragmentShaderSource:d,attributeLocations:u}),e._primitive.allowPicking){let f=Je.createPickVertexShaderSource(o);f=In._appendShowToShader(i,f),f=In._updatePickColorAttribute(f);let y=m.createPickFragmentShader(!1),_=m.createPickVertexShader([a],f,!1,t.mapProjection);if(e._spPick=tn.replaceCache({context:n,shaderProgram:e._spPick,vertexShaderSource:_,fragmentShaderSource:y,attributeLocations:u}),s){let S=n.shaderCache.getDerivedShaderProgram(e._spPick,"2dPick");if(!l(S)){let Z=m.createPickFragmentShader(!0),R=m.createPickVertexShader([a],f,!0,t.mapProjection);S=n.shaderCache.createDerivedShaderProgram(e._spPick,"2dPick",{vertexShaderSource:R,fragmentShaderSource:Z,attributeLocations:u})}e._spPick2D=S}}else e._spPick=tn.fromCache({context:n,vertexShaderSource:c,fragmentShaderSource:d,attributeLocations:u});o=In._appendShowToShader(i,o),c=new Je({defines:[a],sources:[o]}),e._sp=tn.replaceCache({context:n,shaderProgram:e._sp,vertexShaderSource:c,fragmentShaderSource:d,attributeLocations:u});let p=m.createFragmentShader(!1),b=m.createVertexShader([a],o,!1,t.mapProjection);if(e._spColor=tn.replaceCache({context:n,shaderProgram:e._spColor,vertexShaderSource:b,fragmentShaderSource:p,attributeLocations:u}),s){let f=n.shaderCache.getDerivedShaderProgram(e._spColor,"2dColor");if(!l(f)){let y=m.createFragmentShader(!0),_=m.createVertexShader([a],o,!0,t.mapProjection);f=n.shaderCache.createDerivedShaderProgram(e._spColor,"2dColor",{vertexShaderSource:_,fragmentShaderSource:y,attributeLocations:u})}e._spColor2D=f}}function hze(e,t){let n=e._primitive,i=n._va.length*2;t.length=i;let o,r,s,a=0,c=n._batchTable.getUniformMapCallback()(e._uniformMap),d=e._needs2DShader;for(o=0;o0&&(c=o[0].attributes,p=Ru.hasAttributesForSphericalExtents(c),b=Ru.hasAttributesForTextureCoordinatePlanes(c),m=c.color),s=0;s{l(this._primitive)&&this._primitive.ready&&(this._ready=!0,this.releaseGeometryInstances&&(this.geometryInstances=void 0))})};C_.prototype.getGeometryInstanceAttributes=function(e){return this._primitive.getGeometryInstanceAttributes(e)};C_.prototype.isDestroyed=function(){return!1};C_.prototype.destroy=function(){return this._primitive=this._primitive&&this._primitive.destroy(),this._sp=this._sp&&this._sp.destroy(),this._spPick=this._spPick&&this._spPick.destroy(),this._spColor=this._spColor&&this._spColor.destroy(),this._spPick2D=void 0,this._spColor2D=void 0,ue(this)};var L1=C_;var gze={u_globeMinimumAltitude:function(){return 55e3}};function vd(e){e=e??B.EMPTY_OBJECT;let t=e.appearance,n=e.geometryInstances;if(!l(t)&&l(n)){let o=Array.isArray(n)?n:[n],r=o.length;for(let s=0;s{!this._ready&&l(this._primitive)&&this._primitive.ready&&(this._ready=!0,this.releaseGeometryInstances&&(this.geometryInstances=void 0))})};vd.prototype.getBoundingSphere=function(e){let t=this._boundingSpheresKeys.indexOf(e);if(t!==-1)return this._boundingSpheres[t]};vd.prototype.getGeometryInstanceAttributes=function(e){return this._primitive.getGeometryInstanceAttributes(e)};vd.prototype.isDestroyed=function(){return!1};vd.prototype.destroy=function(){return this._primitive=this._primitive&&this._primitive.destroy(),ue(this)};vd._supportsMaterials=function(e){return e.depthTexture};vd.supportsMaterials=function(e){return vd._supportsMaterials(e.frameState.context)};var Dl=vd;var K_n=x(T(),1);function W1(){ge.throwInstantiationError()}Object.defineProperties(W1.prototype,{isConstant:{get:ge.throwInstantiationError},definitionChanged:{get:ge.throwInstantiationError}});W1.prototype.getType=ge.throwInstantiationError;W1.prototype.getValue=ge.throwInstantiationError;W1.prototype.equals=ge.throwInstantiationError;var Vze=new Q;W1.getValue=function(e,t,n){let i;return l(e)||(e=Q.now(Vze)),l(t)&&(i=t.getType(e),l(i))?((!l(n)||n.type!==i)&&(n=eo.fromType(i)),t.getValue(e,n.uniforms),n):((!l(n)||n.type!==eo.ColorType)&&(n=eo.fromType(eo.ColorType)),U.clone(U.WHITE,n.uniforms.color),n)};var yr=W1;function V_(e,t,n){this._primitives=t,this._orderedGroundPrimitives=n,this._primitive=void 0,this._outlinePrimitive=void 0,this._geometryUpdater=e,this._options=e._options,this._entity=e._entity,this._material=void 0}V_.prototype._isHidden=function(e,t,n){return!e.isShowing||!e.isAvailable(n)||!j.getValueOrDefault(t.show,n,!0)};V_.prototype._setOptions=ge.throwInstantiationError;V_.prototype.update=function(e){let t=this._geometryUpdater,n=t._onTerrain,i=this._primitives,o=this._orderedGroundPrimitives;n?o.remove(this._primitive):(i.removeAndDestroy(this._primitive),i.removeAndDestroy(this._outlinePrimitive),this._outlinePrimitive=void 0),this._primitive=void 0;let r=this._entity,s=r[this._geometryUpdater._geometryPropertyName];if(this._setOptions(r,s,e),this._isHidden(r,s,e))return;let a=this._geometryUpdater.shadowsProperty.getValue(e),c=this._options;if(!l(s.fill)||s.fill.getValue(e)){let d=t.fillMaterialProperty,u=d instanceof Qt,m,p=t._getIsClosed(c);if(u)m=new Tn({closed:p,flat:n&&!t._supportsMaterialsforEntitiesOnTerrain});else{let b=yr.getValue(e,d,this._material);this._material=b,m=new Co({material:b,translucent:b.isTranslucent(),closed:p})}if(n)c.vertexFormat=Tn.VERTEX_FORMAT,this._primitive=o.add(new Dl({geometryInstances:this._geometryUpdater.createFillGeometryInstance(e),appearance:m,asynchronous:!1,shadows:a,classificationType:this._geometryUpdater.classificationTypeProperty.getValue(e)}),j.getValueOrUndefined(this._geometryUpdater.zIndex,e));else{c.vertexFormat=m.vertexFormat;let b=this._geometryUpdater.createFillGeometryInstance(e);u&&(m.translucent=b.attributes.color.value[3]!==255),this._primitive=i.add(new In({geometryInstances:b,appearance:m,asynchronous:!1,shadows:a}))}}if(!n&&l(s.outline)&&s.outline.getValue(e)){let d=this._geometryUpdater.createOutlineGeometryInstance(e),u=j.getValueOrDefault(s.outlineWidth,e,1);this._outlinePrimitive=i.add(new In({geometryInstances:d,appearance:new Tn({flat:!0,translucent:d.attributes.color.value[3]!==255,renderState:{lineWidth:t._scene.clampLineWidth(u)}}),asynchronous:!1,shadows:a}))}};V_.prototype.getBoundingSphere=function(e){let t=this._entity,n=this._primitive,i=this._outlinePrimitive,o;return l(n)&&n.show&&n.ready&&(o=n.getGeometryInstanceAttributes(t),l(o)&&l(o.boundingSphere))?(me.clone(o.boundingSphere,e),Wt.DONE):l(i)&&i.show&&i.ready&&(o=i.getGeometryInstanceAttributes(t),l(o)&&l(o.boundingSphere))?(me.clone(o.boundingSphere,e),Wt.DONE):l(n)&&!n.ready||l(i)&&!i.ready?Wt.PENDING:Wt.FAILED};V_.prototype.isDestroyed=function(){return!1};V_.prototype.destroy=function(){let e=this._primitives,t=this._orderedGroundPrimitives;this._geometryUpdater._onTerrain?t.remove(this._primitive):e.removeAndDestroy(this._primitive),e.removeAndDestroy(this._outlinePrimitive),ue(this)};var Li=V_;var bEn=x(T(),1);var uSn=x(T(),1);var Tfe={};function iF(e,t){l(Tfe[e])||(Tfe[e]=!0,console.warn(t??e))}iF.geometryOutlines="Entity geometry outlines are unsupported on terrain. Outlines will be disabled. To enable outlines, disable geometry terrain clamping by explicitly setting height to 0.";iF.geometryZIndex="Entity geometry with zIndex are unsupported when height or extrudedHeight are defined. zIndex will be ignored";iF.geometryHeightReference="Entity corridor, ellipse, polygon or rectangle with heightReference must also have a defined height. heightReference will be ignored";iF.geometryExtrudedHeightReference="Entity corridor, ellipse, polygon or rectangle with extrudedHeightReference must also have a defined extrudedHeight. extrudedHeightReference will be ignored";var xt=iF;var eEn=x(T(),1);var hSn=x(T(),1),_fe={AUTODETECT:0,ENU:1,INERTIAL:2,VELOCITY:3};Object.freeze(_fe);var bb=_fe;var nRn=x(T(),1);var oZn=x(T(),1);var pSn=x(T(),1),Sfe={NONE:0,GEODESIC:1,RHUMB:2};Object.freeze(Sfe);var un=Sfe;var xSn=x(T(),1);var Zfe=W.EPSILON10;function Eze(e,t,n,i){if(!l(e))return;n=n??!1;let o=l(i),r=e.length;if(r<2)return e;let s,a=e[0],c,d,u=0,m=-1;for(s=1;sW.EPSILON12);let V=N*(t*t-n*n)/(n*n),G=1+V*(4096+V*(V*(320-175*V)-768))/16384,v=V*(256+V*(V*(74-47*V)-128))/1024,X=g*g,Y=v*I*(g+v*(F*(2*X-1)-v*g*(4*I*I-3)*(4*X-3)/6)/4),D=n*G*(L-Y),M=Math.atan2(b*A,_-Z*E),O=Math.atan2(m*A,_*E-Z);e._distance=D,e._startHeading=M,e._endHeading=O,e._uSquared=V}var Wze=new h,MQ=new h;function Cfe(e,t,n,i){let o=h.normalize(i.cartographicToCartesian(t,MQ),Wze),r=h.normalize(i.cartographicToCartesian(n,MQ),MQ);Lze(e,i.maximumRadius,i.minimumRadius,t.longitude,t.latitude,n.longitude,n.latitude),e._start=pe.clone(t,e._start),e._end=pe.clone(n,e._end),e._start.height=0,e._end.height=0,Aze(e)}function oF(e,t,n){let i=n??ne.default;this._ellipsoid=i,this._start=new pe,this._end=new pe,this._constants={},this._startHeading=void 0,this._endHeading=void 0,this._distance=void 0,this._uSquared=void 0,l(e)&&l(t)&&Cfe(this,e,t,i)}Object.defineProperties(oF.prototype,{ellipsoid:{get:function(){return this._ellipsoid}},surfaceDistance:{get:function(){return this._distance}},start:{get:function(){return this._start}},end:{get:function(){return this._end}},startHeading:{get:function(){return this._startHeading}},endHeading:{get:function(){return this._endHeading}}});oF.prototype.setEndPoints=function(e,t){Cfe(this,e,t,this._ellipsoid)};oF.prototype.interpolateUsingFraction=function(e,t){return this.interpolateUsingSurfaceDistance(this._distance*e,t)};oF.prototype.interpolateUsingSurfaceDistance=function(e,t){let n=this._constants,i=n.distanceRatio+e/n.b,o=Math.cos(2*i),r=Math.cos(4*i),s=Math.cos(6*i),a=Math.sin(2*i),c=Math.sin(4*i),d=Math.sin(6*i),u=Math.sin(8*i),m=i*i,p=i*m,b=n.u8Over256,f=n.u2Over4,y=n.u6Over64,_=n.u4Over16,S=2*p*b*o/3+i*(1-f+7*_/4-15*y/4+579*b/64-(_-15*y/4+187*b/16)*o-(5*y/4-115*b/16)*r-29*b*s/16)+(f/2-_+71*y/32-85*b/16)*a+(5*_/16-5*y/4+383*b/96)*c-m*((y-11*b/2)*a+5*b*c/2)+(29*y/96-29*b/16)*d+539*b*u/1536,Z=Math.asin(Math.sin(S)*n.cosineAlpha),R=Math.atan(n.a/n.b*Math.tan(Z));S=S-n.sigma;let C=Math.cos(2*n.sigma+S),E=Math.sin(S),A=Math.cos(S),L=n.cosineU*A,F=n.sineU*E,N=Math.atan2(E*n.sineHeading,L-F*n.cosineHeading)-Rfe(n.f,n.sineAlpha,n.cosineSquaredAlpha,S,E,A,C);return l(t)?(t.longitude=this._start.longitude+N,t.latitude=R,t.height=0,t):new pe(this._start.longitude+N,R,0)};var gb=oF;var FSn=x(T(),1);function kQ(e,t,n){if(e===0)return t*n;let i=e*e,o=i*i,r=o*i,s=r*i,a=s*i,c=a*i,d=n,u=Math.sin(2*d),m=Math.sin(4*d),p=Math.sin(6*d),b=Math.sin(8*d),f=Math.sin(10*d),y=Math.sin(12*d);return t*((1-i/4-3*o/64-5*r/256-175*s/16384-441*a/65536-4851*c/1048576)*d-(3*i/8+3*o/32+45*r/1024+105*s/4096+2205*a/131072+6237*c/524288)*u+(15*o/256+45*r/1024+525*s/16384+1575*a/65536+155925*c/8388608)*m-(35*r/3072+175*s/12288+3675*a/262144+13475*c/1048576)*p+(315*s/131072+2205*a/524288+43659*c/8388608)*b-(693*a/1310720+6237*c/5242880)*f+1001*c/8388608*y)}function vze(e,t,n){let i=e/n;if(t===0)return i;let o=i*i,r=o*i,s=r*i,a=t,c=a*a,d=c*c,u=d*c,m=u*c,p=m*c,b=p*c,f=Math.sin(2*i),y=Math.cos(2*i),_=Math.sin(4*i),S=Math.cos(4*i),Z=Math.sin(6*i),R=Math.cos(6*i),C=Math.sin(8*i),E=Math.cos(8*i),A=Math.sin(10*i),L=Math.cos(10*i),F=Math.sin(12*i);return i+i*c/4+7*i*d/64+15*i*u/256+579*i*m/16384+1515*i*p/65536+16837*i*b/1048576+(3*i*d/16+45*i*u/256-i*(32*o-561)*m/4096-i*(232*o-1677)*p/16384+i*(399985-90560*o+512*s)*b/5242880)*y+(21*i*u/256+483*i*m/4096-i*(224*o-1969)*p/16384-i*(33152*o-112599)*b/1048576)*S+(151*i*m/4096+4681*i*p/65536+1479*i*b/16384-453*r*b/32768)*R+(1097*i*p/65536+42783*i*b/1048576)*E+8011*i*b/1048576*L+(3*c/8+3*d/16+213*u/2048-3*o*u/64+255*m/4096-33*o*m/512+20861*p/524288-33*o*p/512+s*p/1024+28273*b/1048576-471*o*b/8192+9*s*b/4096)*f+(21*d/256+21*u/256+533*m/8192-21*o*m/512+197*p/4096-315*o*p/4096+584039*b/16777216-12517*o*b/131072+7*s*b/2048)*_+(151*u/6144+151*m/4096+5019*p/131072-453*o*p/16384+26965*b/786432-8607*o*b/131072)*Z+(1097*m/131072+1097*p/65536+225797*b/10485760-1097*o*b/65536)*C+(8011*p/2621440+8011*b/1048576)*A+293393*b/251658240*F}function v1(e,t){if(e===0)return Math.log(Math.tan(.5*(W.PI_OVER_TWO+t)));let n=e*Math.sin(t);return Math.log(Math.tan(.5*(W.PI_OVER_TWO+t)))-e/2*Math.log((1+n)/(1-n))}function Fze(e,t,n,i,o){let r=v1(e._ellipticity,n),s=v1(e._ellipticity,o);return Math.atan2(W.negativePiToPi(i-t),s-r)}function Ize(e,t,n,i,o,r,s){let a=e._heading,c=r-i,d;if(W.equalsEpsilon(Math.abs(a),W.PI_OVER_TWO,W.EPSILON8))if(t===n)d=t*Math.cos(o)*W.negativePiToPi(c);else{let u=Math.sin(o);d=t*Math.cos(o)*W.negativePiToPi(c)/Math.sqrt(1-e._ellipticitySquared*u*u)}else{let u=kQ(e._ellipticity,t,o);d=(kQ(e._ellipticity,t,s)-u)/Math.cos(a)}return Math.abs(d)}var Pze=new h,wQ=new h;function Vfe(e,t,n,i){let o=h.normalize(i.cartographicToCartesian(t,wQ),Pze),r=h.normalize(i.cartographicToCartesian(n,wQ),wQ),s=i.maximumRadius,a=i.minimumRadius,c=s*s,d=a*a;e._ellipticitySquared=(c-d)/c,e._ellipticity=Math.sqrt(e._ellipticitySquared),e._start=pe.clone(t,e._start),e._start.height=0,e._end=pe.clone(n,e._end),e._end.height=0,e._heading=Fze(e,t.longitude,t.latitude,n.longitude,n.latitude),e._distance=Ize(e,i.maximumRadius,i.minimumRadius,t.longitude,t.latitude,n.longitude,n.latitude)}function Efe(e,t,n,i,o,r){if(n===0)return pe.clone(e,r);let s=o*o,a,c,d;if(Math.abs(W.PI_OVER_TWO-Math.abs(t))>W.EPSILON8){let u=kQ(o,i,e.latitude),m=n*Math.cos(t),p=u+m;if(c=vze(p,o,i),Math.abs(t)0?a=W.negativePiToPi(e.longitude+d):a=W.negativePiToPi(e.longitude-d)}return l(r)?(r.longitude=a,r.latitude=c,r.height=0,r):new pe(a,c,0)}function yb(e,t,n){let i=n??ne.default;this._ellipsoid=i,this._start=new pe,this._end=new pe,this._heading=void 0,this._distance=void 0,this._ellipticity=void 0,this._ellipticitySquared=void 0,l(e)&&l(t)&&Vfe(this,e,t,i)}Object.defineProperties(yb.prototype,{ellipsoid:{get:function(){return this._ellipsoid}},surfaceDistance:{get:function(){return this._distance}},start:{get:function(){return this._start}},end:{get:function(){return this._end}},heading:{get:function(){return this._heading}}});yb.fromStartHeadingDistance=function(e,t,n,i,o){let r=i??ne.default,s=r.maximumRadius,a=r.minimumRadius,c=s*s,d=a*a,u=Math.sqrt((c-d)/c);t=W.negativePiToPi(t);let m=Efe(e,t,n,r.maximumRadius,u);return!l(o)||l(i)&&!i.equals(o.ellipsoid)?new yb(e,m,r):(o.setEndPoints(e,m),o)};yb.prototype.setEndPoints=function(e,t){Vfe(this,e,t,this._ellipsoid)};yb.prototype.interpolateUsingFraction=function(e,t){return this.interpolateUsingSurfaceDistance(e*this._distance,t)};yb.prototype.interpolateUsingSurfaceDistance=function(e,t){return Efe(this._start,this._heading,e,this._ellipsoid.maximumRadius,this._ellipticity,t)};yb.prototype.findIntersectionWithLongitude=function(e,t){let n=this._ellipticity,i=this._heading,o=Math.abs(i),r=this._start;if(e=W.negativePiToPi(e),W.equalsEpsilon(Math.abs(e),Math.PI,W.EPSILON14)&&(e=W.sign(r.longitude)*Math.PI),l(t)||(t=new pe),Math.abs(W.PI_OVER_TWO-o)<=W.EPSILON8)return t.longitude=e,t.latitude=r.latitude,t.height=0,t;if(W.equalsEpsilon(Math.abs(W.PI_OVER_TWO-o),W.PI_OVER_TWO,W.EPSILON8))return W.equalsEpsilon(e,r.longitude,W.EPSILON12)?void 0:(t.longitude=e,t.latitude=W.PI_OVER_TWO*W.sign(W.PI_OVER_TWO-i),t.height=0,t);let s=r.latitude,a=n*Math.sin(s),c=Math.tan(.5*(W.PI_OVER_TWO+s))*Math.exp((e-r.longitude)/Math.tan(i)),d=(1+a)/(1-a),u=r.latitude,m;do{m=u;let p=n*Math.sin(m),b=(1+p)/(1-p);u=2*Math.atan(c*Math.pow(b/d,n/2))-W.PI_OVER_TWO}while(!W.equalsEpsilon(u,m,W.EPSILON12));return t.longitude=e,t.latitude=u,t.height=0,t};yb.prototype.findIntersectionWithLatitude=function(e,t){let n=this._ellipticity,i=this._heading,o=this._start;if(W.equalsEpsilon(Math.abs(i),W.PI_OVER_TWO,W.EPSILON8))return;let r=v1(n,o.latitude),s=v1(n,e),a=Math.tan(i)*(s-r),c=W.negativePiToPi(o.longitude+a);return l(t)?(t.longitude=c,t.latitude=e,t.height=0,t):new pe(c,e,0)};var Gc=yb;var JQ=[ki,Ti],Xze=JQ.length,Hfe=Math.cos(W.toRadians(30)),Afe=Math.cos(W.toRadians(150)),Kfe=0,Jfe=1e3;function Oy(e){e=e??B.EMPTY_OBJECT;let t=e.positions;this.width=e.width??1,this._positions=t,this.granularity=e.granularity??9999,this.loop=e.loop??!1,this.arcType=e.arcType??un.GEODESIC,this._ellipsoid=ne.default,this._projectionIndex=0,this._workerName="createGroundPolylineGeometry",this._scene3DOnly=!1}Object.defineProperties(Oy.prototype,{packedLength:{get:function(){return 1+this._positions.length*3+1+1+1+ne.packedLength+1+1}}});Oy.setProjectionAndEllipsoid=function(e,t){let n=0;for(let i=0;iHfe||rW.PI_OVER_TWO&&(a=!0,s=h.subtract(r,n,Xfe),d=c.cartesianToCartographic(s,Pfe)),d.height=0;let u=e.project(d,o);return o=h.subtract(u,i,o),o.z=0,o=h.normalize(o,o),a&&h.negate(o,o),o}var nHe=new h,Nfe=new h;function Yfe(e,t,n,i,o,r){let s=h.subtract(t,e,nHe);h.normalize(s,s);let a=n-Kfe,c=h.multiplyByScalar(s,a,Nfe);h.add(e,c,o);let d=i-Jfe;c=h.multiplyByScalar(s,d,Nfe),h.add(t,c,r)}var iHe=new h;function hO(e,t){let n=cn.getPointDistance(fO,e),i=cn.getPointDistance(fO,t),o=iHe;W.equalsEpsilon(n,0,W.EPSILON2)?(o=xb(t,e,o),h.multiplyByScalar(o,W.EPSILON2,o),h.add(e,o,e)):W.equalsEpsilon(i,0,W.EPSILON2)&&(o=xb(e,t,o),h.multiplyByScalar(o,W.EPSILON2,o),h.add(t,o,t))}function oHe(e,t){let n=Math.abs(e.longitude),i=Math.abs(t.longitude);if(W.equalsEpsilon(n,W.PI,W.EPSILON11)){let o=W.sign(t.longitude);return e.longitude=o*(n-W.EPSILON11),1}else if(W.equalsEpsilon(i,W.PI,W.EPSILON11)){let o=W.sign(e.longitude);return t.longitude=o*(i-W.EPSILON11),2}return 0}var Qfe=new pe,qfe=new pe,Mfe=new h,BQ=new h,wfe=new h,kfe=new h,rHe=new h,Ufe=new h,sHe=[Qfe,qfe],aHe=new re,cHe=new h,lHe=new h,dHe=new h,uHe=new h,mHe=new h,hHe=new h,zQ=new h,HQ=new h,fHe=new h,pHe=new h,bHe=new h,Dfe=new h,gHe=new h,yHe=new h,xHe=new An,THe=new An,Ofe=new h,_He=new h,Bfe=new h,SHe=[new me,new me],$fe=[0,2,1,0,3,2,0,7,3,0,4,7,0,5,4,0,1,5,5,7,4,5,6,7,5,2,6,5,1,2,3,6,2,3,7,6],zfe=$fe.length;function ZHe(e,t,n,i,o,r,s){let a,c,d=t._ellipsoid,u=n.length/3-1,m=u*8,p=m*4,b=u*36,f=m>65535?new Uint32Array(b):new Uint16Array(b),y=new Float64Array(m*3),_=new Float32Array(p),S=new Float32Array(p),Z=new Float32Array(p),R=new Float32Array(p),C=new Float32Array(p),E,A,L,F;s&&(E=new Float32Array(p),A=new Float32Array(p),L=new Float32Array(p),F=new Float32Array(m*2));let I=r.length/2,N=0,g=Qfe;g.height=0;let V=qfe;V.height=0;let G=Mfe,v=BQ;if(s)for(c=0,a=1;aHfe?(qe=rF(t,g,tt,Be,zQ),We=rF(t,V,$,je,HQ)):yi===1?(We=rF(t,V,$,je,HQ),qe.x=0,qe.y=W.sign(g.longitude-Math.abs(V.longitude)),qe.z=0):(qe=rF(t,g,tt,Be,zQ),We.x=0,We.y=W.sign(g.longitude-V.longitude),We.z=0)}let Ke=h.distance(Fe,H),ct=An.fromCartesian(Ae,xHe),Et=h.subtract(te,Ae,fHe),zt=h.normalize(Et,Dfe),ut=h.subtract(Fe,Ae,pHe);ut=h.normalize(ut,ut);let bt=h.cross(zt,ut,Dfe);bt=h.normalize(bt,bt);let ht=h.cross(ut,tt,gHe);ht=h.normalize(ht,ht);let jt=h.subtract(H,te,bHe);jt=h.normalize(jt,jt);let st=h.cross($,jt,yHe);st=h.normalize(st,st);let pt=Ke/Y,Mi=ee/Y,jn=0,Si,Hi,Gi,pi=0,Zi=0;if(s){jn=h.distance(Be,je),Si=An.fromCartesian(Be,THe),Hi=h.subtract(je,Be,Ofe),Gi=h.normalize(Hi,_He);let yi=Gi.x;Gi.x=Gi.y,Gi.y=-yi,pi=jn/N,Zi=le/N}for(D=0;D<8;D++){let yi=z+D*4,fr=O+D*2,mo=yi+3,Qr=D<4?1:-1,Mn=D===2||D===3||D===6||D===7?1:-1;h.pack(ct.high,_,yi),_[mo]=Et.x,h.pack(ct.low,S,yi),S[mo]=Et.y,h.pack(ht,Z,yi),Z[mo]=Et.z,h.pack(st,R,yi),R[mo]=pt*Qr,h.pack(bt,C,yi);let Ki=Mi*Mn;Ki===0&&Mn<0&&(Ki=9),C[mo]=Ki,s&&(E[yi]=Si.high.x,E[yi+1]=Si.high.y,E[yi+2]=Si.low.x,E[yi+3]=Si.low.y,L[yi]=-qe.y,L[yi+1]=qe.x,L[yi+2]=We.y,L[yi+3]=-We.x,A[yi]=Hi.x,A[yi+1]=Hi.y,A[yi+2]=Gi.x,A[yi+3]=Gi.y,F[fr]=pi*Qr,Ki=Zi*Mn,Ki===0&&Mn<0&&(Ki=9),F[fr+1]=Ki)}let On=dHe,rn=uHe,Hn=cHe,$i=lHe,Po=re.fromCartographicArray(sHe,aHe),hr=Pi.getMinimumMaximumHeights(Po,d),Is=hr.minimumTerrainHeight,Hs=hr.maximumTerrainHeight;_e+=Math.abs(Is),_e+=Math.abs(Hs),Yfe(Ae,Fe,Is,Hs,On,Hn),Yfe(te,H,Is,Hs,rn,$i);let or=h.multiplyByScalar(bt,W.EPSILON5,Bfe);h.add(On,or,On),h.add(rn,or,rn),h.add(Hn,or,Hn),h.add($i,or,$i),hO(On,rn),hO(Hn,$i),h.pack(On,y,w),h.pack(rn,y,w+3),h.pack($i,y,w+6),h.pack(Hn,y,w+9),or=h.multiplyByScalar(bt,-2*W.EPSILON5,Bfe),h.add(On,or,On),h.add(rn,or,rn),h.add(Hn,or,Hn),h.add($i,or,$i),hO(On,rn),hO(Hn,$i),h.pack(On,y,w+12),h.pack(rn,y,w+15),h.pack($i,y,w+18),h.pack(Hn,y,w+21),M+=2,c+=3,O+=16,w+=24,z+=32,ee+=Ke,le+=jn}c=0;let he=0;for(a=0;a0){let y=new Float64Array(m);for(f=[y.buffer],r=0;r0?(e._recomputeBoundingSpheres=!0,e._state=ns.COMBINED):J2(e,t,ns.FAILED,void 0)}).catch(function(m){J2(e,t,ns.FAILED,m)})}}function b3e(e,t){let n=Array.isArray(e.geometryInstances)?e.geometryInstances:[e.geometryInstances],i=e._numberOfInstances=n.length,o=new Array(i),r=e._instanceIds,s,a,c=0;for(a=0;a0?(e._recomputeBoundingSpheres=!0,e._state=ns.COMBINED):J2(e,t,ns.FAILED,void 0)}function g3e(e,t){let n=e._batchTableAttributeIndices.offset;if(!e._recomputeBoundingSpheres||!l(n)){e._recomputeBoundingSpheres=!1;return}let i,o=e._offsetInstanceExtend,r=e._instanceBoundingSpheres,s=r.length,a=e._tempBoundingSpheres;if(!l(a)){for(a=new Array(s),i=0;i0||me.intersectPlane(y,cn.ORIGIN_ZX_PLANE)!==qt.INTERSECTING?c.push(y):(d.push(y),u.push(y))}let m=c[0],p=u[0],b=d[0];for(i=1;i0){if(wt.maximumVertexTextureImageUnits===0)throw new ae("Vertex texture fetch support is required to render primitives with per-instance attributes. The maximum number of vertex texture image units must be greater than zero.");this._batchTable.update(e)}if(this._state!==ns.COMPLETE&&this._state!==ns.COMBINED&&(this.asynchronous?p3e(this,e):b3e(this,e)),this._state===ns.COMBINED&&(y3e(this,e),cfe(this,e),T3e(this,e)),!this.show||this._state!==ns.COMPLETE)return;this._batchTableOffsetsUpdated||cfe(this,e),this._recomputeBoundingSpheres&&g3e(this,e);let n=this.appearance,i=n.material,o=!1,r=!1;this._appearance!==n?(this._appearance=n,this._material=i,o=!0,r=!0):this._material!==i&&(this._material=i,r=!0);let s=this.depthFailAppearance,a=l(s)?s.material:void 0;this._depthFailAppearance!==s?(this._depthFailAppearance=s,this._depthFailMaterial=a,o=!0,r=!0):this._depthFailMaterial!==a&&(this._depthFailMaterial=a,r=!0);let c=this._appearance.isTranslucent();this._translucent!==c&&(this._translucent=c,o=!0),l(this._material)&&this._material.update(t);let d=n.closed&&c;o&&(this._createRenderStatesFunction??_3e)(this,t,n,d),r&&(this._createShaderProgramFunction??S3e)(this,e,n),(o||r)&&(this._createCommandsFunction??Z3e)(this,n,i,c,d,this._colorCommands,this._pickCommands,e),(this._updateAndQueueCommandsFunction??R3e)(this,e,this._colorCommands,this._pickCommands,this.modelMatrix,this.cull,this.debugShowBoundingVolume,d)};var C3e=new me,V3e=new me;function bfe(e,t,n){if(n===bn.TOP){let i=me.clone(e,C3e),o=me.clone(e,V3e);o.center=h.add(o.center,t,o.center),e=me.union(i,o,e)}else n===bn.ALL&&(e.center=h.add(e.center,t,e.center));return e}function E3e(e,t,n){return function(){let i=e.getBatchedAttribute(t,n),o=e.attributes[n],r=o.componentsPerAttribute,s=J.createTypedArray(o.componentDatatype,r);return l(i.constructor.pack)?i.constructor.pack(i,s,0):s[0]=i,s}}function A3e(e,t,n,i,o){return function(r){let s=mfe(r);e.setBatchedAttribute(t,n,s),o==="offset"&&(i._recomputeBoundingSpheres=!0,i._batchTableOffsetsUpdated=!1)}}var G3e=new h;function L3e(e,t,n){t.boundingSphere={get:function(){let i=e._instanceBoundingSpheres[n];if(l(i)){i=i.clone();let o=e.modelMatrix,r=t.offset;l(r)&&bfe(i,h.fromArray(r.get(),0,G3e),e._offsetInstanceExtend[n]),l(o)&&(i=me.transform(i,o))}return i}},t.boundingSphereCV={get:function(){return e._instanceBoundingSpheresCV[n]}}}function W3e(e,t,n){t.pickId={get:function(){return e._pickIds[n]}}}is.prototype.getGeometryInstanceAttributes=function(e){let t=this._perInstanceAttributeCache.get(e);if(l(t))return t;let n=-1,i=this._lastPerInstanceAttributeIndex,o=this._instanceIds,r=o.length;for(let d=0;d{!this._ready&&l(this._primitive)&&this._primitive.ready&&(this._ready=!0,this.releaseGeometryInstances&&(this.geometryInstances=void 0))})};gb.prototype.getGeometryInstanceAttributes=function(e){return this._primitive.getGeometryInstanceAttributes(e)};gb.isSupported=function(e){return e.frameState.context.depthTexture};gb.prototype.isDestroyed=function(){return!1};gb.prototype.destroy=function(){return this._primitive=this._primitive&&this._primitive.destroy(),this._sp=this._sp&&this._sp.destroy(),this._sp2D=void 0,this._spMorph=void 0,ue(this)};var Oh=gb;var M_n=x(T(),1);var cTn=x(T(),1);var zxn=x(T(),1);var Fxn=x(T(),1);function ac(e,t,n){this.minimum=h.clone(e??h.ZERO),this.maximum=h.clone(t??h.ZERO),l(n)?n=h.clone(n):n=h.midpoint(this.minimum,this.maximum,new h),this.center=n}ac.fromCorners=function(e,t,n){return l(n)||(n=new ac),n.minimum=h.clone(e,n.minimum),n.maximum=h.clone(t,n.maximum),n.center=h.midpoint(e,t,n.center),n};ac.fromPoints=function(e,t){if(l(t)||(t=new ac),!l(e)||e.length===0)return t.minimum=h.clone(h.ZERO,t.minimum),t.maximum=h.clone(h.ZERO,t.maximum),t.center=h.clone(h.ZERO,t.center),t;let n=e[0].x,i=e[0].y,o=e[0].z,r=e[0].x,s=e[0].y,a=e[0].z,c=e.length;for(let m=1;m0?qt.INSIDE:r+o<0?qt.OUTSIDE:qt.INTERSECTING};ac.intersectAxisAlignedBoundingBox=function(e,t){return e.minimum.x<=t.maximum.x&&e.maximum.x>=t.minimum.x&&e.minimum.y<=t.maximum.y&&e.maximum.y>=t.minimum.y&&e.minimum.z<=t.maximum.z&&e.maximum.z>=t.minimum.z};ac.prototype.clone=function(e){return ac.clone(this,e)};ac.prototype.intersectPlane=function(e){return ac.intersectPlane(this,e)};ac.prototype.intersectAxisAlignedBoundingBox=function(e){return ac.intersectAxisAlignedBoundingBox(this,e)};ac.prototype.equals=function(e){return ac.equals(this,e)};var Su=ac;var zQ=new ce;function vp(e,t){t=t??ne.default,e=t.scaleToGeodeticSurface(e);let n=_t.eastNorthUpToFixedFrame(e,t);this._ellipsoid=t,this._origin=e,this._xAxis=h.fromCartesian4(P.getColumn(n,0,zQ)),this._yAxis=h.fromCartesian4(P.getColumn(n,1,zQ));let i=h.fromCartesian4(P.getColumn(n,2,zQ));this._plane=cn.fromPointNormal(e,i)}Object.defineProperties(vp.prototype,{ellipsoid:{get:function(){return this._ellipsoid}},origin:{get:function(){return this._origin}},plane:{get:function(){return this._plane}},xAxis:{get:function(){return this._xAxis}},yAxis:{get:function(){return this._yAxis}},zAxis:{get:function(){return this._plane.normal}}});var P3e=new Su;vp.fromPoints=function(e,t){let n=Su.fromPoints(e,P3e);return new vp(n.center,t)};var _fe=new gn,uO=new h;vp.prototype.projectPointOntoPlane=function(e,t){let n=_fe;n.origin=e,h.normalize(e,n.direction);let i=xi.rayPlane(n,this._plane,uO);if(l(i)||(h.negate(n.direction,n.direction),i=xi.rayPlane(n,this._plane,uO)),l(i)){let o=h.subtract(i,this._origin,i),r=h.dot(this._xAxis,o),s=h.dot(this._yAxis,o);return l(t)?(t.x=r,t.y=s,t):new k(r,s)}};vp.prototype.projectPointsOntoPlane=function(e,t){l(t)||(t=[]);let n=0,i=e.length;for(let o=0;o0?0:L.latitude,V=pe.fromRadians(N,e.north,n,H3e),G=pe.fromRadians(e.west,e.north,n,K3e),v=pe.fromRadians(e.west,g,n,J3e),X=pe.fromRadians(e.west,e.south,n,j3e),Y=pe.fromRadians(N,e.south,n,Q3e),D=i.cartographicToCartesian(V,q3e),M=i.cartographicToCartesian(G,Rfe),O=i.cartographicToCartesian(v,$3e),w=i.cartographicToCartesian(X,Cfe),z=i.cartographicToCartesian(Y,eze),K=I.projectPointToNearestOnPlane(D,tze),te=I.projectPointToNearestOnPlane(M,nze),H=I.projectPointToNearestOnPlane(O,ize),$=I.projectPointToNearestOnPlane(w,oze),ee=I.projectPointToNearestOnPlane(z,rze);return r=Math.min(te.x,H.x,$.x),s=-r,c=Math.max(te.y,K.y),a=Math.min($.y,ee.y),G.height=X.height=t,M=i.cartographicToCartesian(G,Rfe),w=i.cartographicToCartesian(X,Cfe),d=Math.min(cn.getPointDistance(m,M),cn.getPointDistance(m,w)),u=n,Sfe(I.origin,I.xAxis,I.yAxis,I.zAxis,r,s,a,c,d,u,o)}let p=e.south>0,b=e.north<0,f=p?e.south:b?e.north:0,y=re.center(e,Zfe).longitude,_=h.fromRadians(y,f,n,i,sze);_.z=0;let Z=Math.abs(_.x)=c?qt.INSIDE:qt.INTERSECTING};var Afe=new h,Gfe=new h,Lfe=new h,pze=new h,Vfe=new h,bze=new h;ho.distanceSquaredTo=function(e,t){let n=h.subtract(t,e.center,Efe),i=e.halfAxes,o=q.getColumn(i,0,Afe),r=q.getColumn(i,1,Gfe),s=q.getColumn(i,2,Lfe),a=h.magnitude(o),c=h.magnitude(r),d=h.magnitude(s),u=!0,m=!0,p=!0;a>0?h.divideByScalar(o,a,o):u=!1,c>0?h.divideByScalar(r,c,r):m=!1,d>0?h.divideByScalar(s,d,s):p=!1;let b=!u+!m+!p,f,y,_;if(b===1){let C=o;f=r,y=s,m?p||(C=s,y=o):(C=r,f=o),_=h.cross(f,y,Vfe),C===o?o=_:C===r?r=_:C===s&&(s=_)}else if(b===2){f=o,m?f=r:p&&(f=s);let C=h.UNIT_Y;C.equalsEpsilon(f,W.EPSILON3)&&(C=h.UNIT_X),y=h.cross(f,C,pze),h.normalize(y,y),_=h.cross(f,y,Vfe),h.normalize(_,_),f===o?(r=y,s=_):f===r?(s=y,o=_):f===s&&(o=y,r=_)}else b===3&&(o=h.UNIT_X,r=h.UNIT_Y,s=h.UNIT_Z);let S=bze;S.x=h.dot(n,o),S.y=h.dot(n,r),S.z=h.dot(n,s);let Z=0,R;return S.x<-a?(R=S.x+a,Z+=R*R):S.x>a&&(R=S.x-a,Z+=R*R),S.y<-c?(R=S.y+c,Z+=R*R):S.y>c&&(R=S.y-c,Z+=R*R),S.z<-d?(R=S.z+d,Z+=R*R):S.z>d&&(R=S.z-d,Z+=R*R),Z};var gze=new h,yze=new h;ho.computePlaneDistances=function(e,t,n,i){l(i)||(i=new Ns);let o=Number.POSITIVE_INFINITY,r=Number.NEGATIVE_INFINITY,s=e.center,a=e.halfAxes,c=q.getColumn(a,0,Afe),d=q.getColumn(a,1,Gfe),u=q.getColumn(a,2,Lfe),m=h.add(c,d,gze);h.add(m,u,m),h.add(m,s,m);let p=h.subtract(m,t,yze),b=h.dot(n,p);return o=Math.min(b,o),r=Math.max(b,r),h.add(s,c,m),h.add(m,d,m),h.subtract(m,u,m),h.subtract(m,t,p),b=h.dot(n,p),o=Math.min(b,o),r=Math.max(b,r),h.add(s,c,m),h.subtract(m,d,m),h.add(m,u,m),h.subtract(m,t,p),b=h.dot(n,p),o=Math.min(b,o),r=Math.max(b,r),h.add(s,c,m),h.subtract(m,d,m),h.subtract(m,u,m),h.subtract(m,t,p),b=h.dot(n,p),o=Math.min(b,o),r=Math.max(b,r),h.subtract(s,c,m),h.add(m,d,m),h.add(m,u,m),h.subtract(m,t,p),b=h.dot(n,p),o=Math.min(b,o),r=Math.max(b,r),h.subtract(s,c,m),h.add(m,d,m),h.subtract(m,u,m),h.subtract(m,t,p),b=h.dot(n,p),o=Math.min(b,o),r=Math.max(b,r),h.subtract(s,c,m),h.subtract(m,d,m),h.add(m,u,m),h.subtract(m,t,p),b=h.dot(n,p),o=Math.min(b,o),r=Math.max(b,r),h.subtract(s,c,m),h.subtract(m,d,m),h.subtract(m,u,m),h.subtract(m,t,p),b=h.dot(n,p),o=Math.min(b,o),r=Math.max(b,r),i.start=o,i.stop=r,i};var xze=new h,Tze=new h,_ze=new h;ho.computeCorners=function(e,t){l(t)||(t=[new h,new h,new h,new h,new h,new h,new h,new h]);let n=e.center,i=e.halfAxes,o=q.getColumn(i,0,xze),r=q.getColumn(i,1,Tze),s=q.getColumn(i,2,_ze);return h.clone(n,t[0]),h.subtract(t[0],o,t[0]),h.subtract(t[0],r,t[0]),h.subtract(t[0],s,t[0]),h.clone(n,t[1]),h.subtract(t[1],o,t[1]),h.subtract(t[1],r,t[1]),h.add(t[1],s,t[1]),h.clone(n,t[2]),h.subtract(t[2],o,t[2]),h.add(t[2],r,t[2]),h.subtract(t[2],s,t[2]),h.clone(n,t[3]),h.subtract(t[3],o,t[3]),h.add(t[3],r,t[3]),h.add(t[3],s,t[3]),h.clone(n,t[4]),h.add(t[4],o,t[4]),h.subtract(t[4],r,t[4]),h.subtract(t[4],s,t[4]),h.clone(n,t[5]),h.add(t[5],o,t[5]),h.subtract(t[5],r,t[5]),h.add(t[5],s,t[5]),h.clone(n,t[6]),h.add(t[6],o,t[6]),h.add(t[6],r,t[6]),h.subtract(t[6],s,t[6]),h.clone(n,t[7]),h.add(t[7],o,t[7]),h.add(t[7],r,t[7]),h.add(t[7],s,t[7]),t};var Sze=new q;ho.computeTransformation=function(e,t){l(t)||(t=new P);let n=e.center,i=q.multiplyByUniformScale(e.halfAxes,2,Sze);return P.fromRotationTranslation(i,n,t)};var Zze=new me;ho.isOccluded=function(e,t){let n=me.fromOrientedBoundingBox(e,Zze);return!t.isBoundingSphereVisible(n)};ho.prototype.intersectPlane=function(e){return ho.intersectPlane(this,e)};ho.prototype.distanceSquaredTo=function(e){return ho.distanceSquaredTo(this,e)};ho.prototype.computePlaneDistances=function(e,t,n){return ho.computePlaneDistances(this,e,t,n)};ho.prototype.computeCorners=function(e){return ho.computeCorners(this,e)};ho.prototype.computeTransformation=function(e){return ho.computeTransformation(this,e)};ho.prototype.isOccluded=function(e){return ho.isOccluded(this,e)};ho.equals=function(e,t){return e===t||l(e)&&l(t)&&h.equals(e.center,t.center)&&q.equals(e.halfAxes,t.halfAxes)};ho.prototype.clone=function(e){return ho.clone(this,e)};ho.prototype.equals=function(e){return ho.equals(this,e)};var nn=ho;var hTn=x(T(),1);var mO={};mO.getHeight=function(e,t,n){return(e-n)*t+n};var Rze=new pe;mO.getPosition=function(e,t,n,i,o){let r=t.cartesianToCartographic(e,Rze);if(!l(r))return h.clone(e,o);let s=mO.getHeight(r.height,n,i);return h.fromRadians(r.longitude,r.latitude,s,t,o)};var _o=mO;var __n=x(T(),1);var yTn=x(T(),1);function E1(e,t,n,i){e=e??1,t=t??1,n=n??1,i=i??1,this.value=new Uint8Array([U.floatToByte(e),U.floatToByte(t),U.floatToByte(n),U.floatToByte(i)])}Object.defineProperties(E1.prototype,{componentDatatype:{get:function(){return J.UNSIGNED_BYTE}},componentsPerAttribute:{get:function(){return 4}},normalize:{get:function(){return!0}}});E1.fromColor=function(e){return new E1(e.red,e.green,e.blue,e.alpha)};E1.toValue=function(e,t){return l(t)?e.toBytes(t):new Uint8Array(e.toBytes())};E1.equals=function(e,t){return e===t||l(e)&&l(t)&&e.value[0]===t.value[0]&&e.value[1]===t.value[1]&&e.value[2]===t.value[2]&&e.value[3]===t.value[3]};var $t=E1;var FTn=x(T(),1);var TTn=x(T(),1),j2=`in vec3 v_positionEC; +in vec3 v_normalEC; +in vec4 v_color; +void main() +{ +vec3 positionToEyeEC = -v_positionEC; +vec3 normalEC = normalize(v_normalEC); +#ifdef FACE_FORWARD +normalEC = faceforward(normalEC, vec3(0.0, 0.0, 1.0), -normalEC); +#endif +vec4 color = czm_gammaCorrect(v_color); +czm_materialInput materialInput; +materialInput.normalEC = normalEC; +materialInput.positionToEyeEC = positionToEyeEC; +czm_material material = czm_getDefaultMaterial(materialInput); +material.diffuse = color.rgb; +material.alpha = color.a; +out_FragColor = czm_phong(normalize(positionToEyeEC), material, czm_lightDirectionEC); +} +`;var STn=x(T(),1),Q2=`in vec3 position3DHigh; in vec3 position3DLow; -in vec3 prevPosition3DHigh; -in vec3 prevPosition3DLow; -in vec3 nextPosition3DHigh; -in vec3 nextPosition3DLow; -in vec2 expandAndWidth; +in vec3 normal; in vec4 color; in float batchId; +out vec3 v_positionEC; +out vec3 v_normalEC; out vec4 v_color; void main() { -float expandDir = expandAndWidth.x; -float width = abs(expandAndWidth.y) + 0.5; -bool usePrev = expandAndWidth.y < 0.0; vec4 p = czm_computePosition(); -vec4 prev = czm_computePrevPosition(); -vec4 next = czm_computeNextPosition(); -float angle; -vec4 positionWC = getPolylineWindowCoordinates(p, prev, next, expandDir, width, usePrev, angle); -gl_Position = czm_viewportOrthographic * positionWC; +v_positionEC = (czm_modelViewRelativeToEye * p).xyz; +v_normalEC = czm_normal * normal; v_color = color; +gl_Position = czm_modelViewProjectionRelativeToEye * p; } -`;var RHe=`#define CLIP_POLYLINE -${Ul} -${sF}`,CHe=S_;function A_(e){e=e??B.EMPTY_OBJECT;let t=e.translucent??!0,n=!1,i=A_.VERTEX_FORMAT;this.material=void 0,this.translucent=t,this._vertexShaderSource=e.vertexShaderSource??RHe,this._fragmentShaderSource=e.fragmentShaderSource??CHe,this._renderState=Go.getDefaultRenderState(t,n,e.renderState),this._closed=n,this._vertexFormat=i}Object.defineProperties(A_.prototype,{vertexShaderSource:{get:function(){return this._vertexShaderSource}},fragmentShaderSource:{get:function(){return this._fragmentShaderSource}},renderState:{get:function(){return this._renderState}},closed:{get:function(){return this._closed}},vertexFormat:{get:function(){return this._vertexFormat}}});A_.VERTEX_FORMAT=Me.POSITION_ONLY;A_.prototype.getFragmentShaderSource=Go.prototype.getFragmentShaderSource;A_.prototype.isTranslucent=Go.prototype.isTranslucent;A_.prototype.getRenderState=Go.prototype.getRenderState;var ws=A_;var VZn=x(T(),1);var bZn=x(T(),1),aF=`in vec3 position3DHigh; +`;var RTn=x(T(),1),q2=`in vec3 position3DHigh; in vec3 position3DLow; -in vec3 prevPosition3DHigh; -in vec3 prevPosition3DLow; -in vec3 nextPosition3DHigh; -in vec3 nextPosition3DLow; -in vec2 expandAndWidth; -in vec2 st; +in vec4 color; in float batchId; -out float v_width; -out vec2 v_st; -out float v_polylineAngle; +out vec4 v_color; void main() { -float expandDir = expandAndWidth.x; -float width = abs(expandAndWidth.y) + 0.5; -bool usePrev = expandAndWidth.y < 0.0; vec4 p = czm_computePosition(); -vec4 prev = czm_computePrevPosition(); -vec4 next = czm_computeNextPosition(); -float angle; -vec4 positionWC = getPolylineWindowCoordinates(p, prev, next, expandDir, width, usePrev, angle); -gl_Position = czm_viewportOrthographic * positionWC; -v_width = width; -v_st.s = st.s; -v_st.t = czm_writeNonPerspective(st.t, gl_Position.w); -v_polylineAngle = angle; +v_color = color; +gl_Position = czm_modelViewProjectionRelativeToEye * p; } -`;var VHe=`#define CLIP_POLYLINE -${Ul} -${aF}`,EHe=T_;function G_(e){e=e??B.EMPTY_OBJECT;let t=e.translucent??!0,n=!1,i=G_.VERTEX_FORMAT;this.material=l(e.material)?e.material:eo.fromType(eo.ColorType),this.translucent=t,this._vertexShaderSource=e.vertexShaderSource??VHe,this._fragmentShaderSource=e.fragmentShaderSource??EHe,this._renderState=Go.getDefaultRenderState(t,n,e.renderState),this._closed=n,this._vertexFormat=i}Object.defineProperties(G_.prototype,{vertexShaderSource:{get:function(){let e=this._vertexShaderSource;return this.material.shaderSource.search(/in\s+float\s+v_polylineAngle;/g)!==-1&&(e=`#define POLYLINE_DASH -${e}`),e}},fragmentShaderSource:{get:function(){return this._fragmentShaderSource}},renderState:{get:function(){return this._renderState}},closed:{get:function(){return this._closed}},vertexFormat:{get:function(){return this._vertexFormat}}});G_.VERTEX_FORMAT=Me.POSITION_AND_ST;G_.prototype.getFragmentShaderSource=Go.prototype.getFragmentShaderSource;G_.prototype.isTranslucent=Go.prototype.isTranslucent;G_.prototype.getRenderState=Go.prototype.getRenderState;var ac=G_;function Tb(e){e=e??B.EMPTY_OBJECT,this.geometryInstances=e.geometryInstances,this._hasPerInstanceColors=!0;let t=e.appearance;l(t)||(t=new ac),this.appearance=t,this.show=e.show??!0,this.classificationType=e.classificationType??ni.BOTH,this.debugShowBoundingVolume=e.debugShowBoundingVolume??!1,this._debugShowShadowVolume=e.debugShowShadowVolume??!1,this._primitiveOptions={geometryInstances:void 0,appearance:void 0,vertexCacheOptimize:!1,interleave:e.interleave??!1,releaseGeometryInstances:e.releaseGeometryInstances??!0,allowPicking:e.allowPicking??!0,asynchronous:e.asynchronous??!0,compressVertices:!1,_createShaderProgramFunction:void 0,_createCommandsFunction:void 0,_updateAndQueueCommandsFunction:void 0},this._zIndex=void 0,this._ready=!1,this._primitive=void 0,this._sp=void 0,this._sp2D=void 0,this._spMorph=void 0,this._renderState=epe(!1),this._renderState3DTiles=epe(!0),this._renderStateMorph=ze.fromCache({cull:{enabled:!0,face:Di.FRONT},depthTest:{enabled:!0},blending:on.PRE_MULTIPLIED_ALPHA_BLEND,depthMask:!1})}Object.defineProperties(Tb.prototype,{interleave:{get:function(){return this._primitiveOptions.interleave}},releaseGeometryInstances:{get:function(){return this._primitiveOptions.releaseGeometryInstances}},allowPicking:{get:function(){return this._primitiveOptions.allowPicking}},asynchronous:{get:function(){return this._primitiveOptions.asynchronous}},ready:{get:function(){return this._ready}},debugShowShadowVolume:{get:function(){return this._debugShowShadowVolume}}});Tb.initializeTerrainHeights=function(){return Pi.initialize()};function AHe(e,t,n){let i=t.context,o=e._primitive,r=o._attributeLocations,s=o._batchTable.getVertexShaderCallback()($v);s=In._appendShowToShader(o,s),s=In._appendDistanceDisplayConditionToShader(o,s),s=In._modifyShaderPosition(e,s,t.scene3DOnly);let a=o._batchTable.getVertexShaderCallback()(qv);a=In._appendShowToShader(o,a),a=In._appendDistanceDisplayConditionToShader(o,a),a=In._modifyShaderPosition(e,a,t.scene3DOnly);let c=o._batchTable.getVertexShaderCallback()(jv),d=[`GLOBE_MINIMUM_ALTITUDE ${t.mapProjection.ellipsoid.minimumRadius.toFixed(1)}`],u="",m="";l(n.material)?(m=l(n.material)?n.material.shaderSource:"",m.search(/in\s+float\s+v_polylineAngle;/g)!==-1&&d.push("ANGLE_VARYING"),m.search(/in\s+float\s+v_width;/g)!==-1&&d.push("WIDTH_VARYING")):u="PER_INSTANCE_COLOR",d.push(u);let p=e.debugShowShadowVolume?["DEBUG_SHOW_VOLUME",u]:[u],b=new Je({defines:d,sources:[s]}),f=new Je({defines:p,sources:[m,c]});e._sp=tn.replaceCache({context:i,shaderProgram:o._sp,vertexShaderSource:b,fragmentShaderSource:f,attributeLocations:r});let y=i.shaderCache.getDerivedShaderProgram(e._sp,"2dColor");if(!l(y)){let S=new Je({defines:d.concat(["COLUMBUS_VIEW_2D"]),sources:[s]});y=i.shaderCache.createDerivedShaderProgram(e._sp,"2dColor",{context:i,shaderProgram:e._sp2D,vertexShaderSource:S,fragmentShaderSource:f,attributeLocations:r})}e._sp2D=y;let _=i.shaderCache.getDerivedShaderProgram(e._sp,"MorphColor");if(!l(_)){let S=new Je({defines:d.concat([`MAX_TERRAIN_HEIGHT ${Pi._defaultMaxTerrainHeight.toFixed(1)}`]),sources:[a]});c=o._batchTable.getVertexShaderCallback()(Qv);let Z=new Je({defines:p,sources:[m,c]});_=i.shaderCache.createDerivedShaderProgram(e._sp,"MorphColor",{context:i,shaderProgram:e._spMorph,vertexShaderSource:S,fragmentShaderSource:Z,attributeLocations:r})}e._spMorph=_}function epe(e){return ze.fromCache({cull:{enabled:!0},blending:on.PRE_MULTIPLIED_ALPHA_BLEND,depthMask:!1,stencilTest:{enabled:e,frontFunction:ii.EQUAL,frontOperation:{fail:Ft.KEEP,zFail:Ft.KEEP,zPass:Ft.KEEP},backFunction:ii.EQUAL,backOperation:{fail:Ft.KEEP,zFail:Ft.KEEP,zPass:Ft.KEEP},reference:Jt.CESIUM_3D_TILE_MASK,mask:Jt.CESIUM_3D_TILE_MASK}})}function GHe(e,t,n,i,o,r){let s=e._primitive,a=s._va.length;o.length=a,r.length=a;let d=t instanceof ws?{}:n._uniforms,u=s._batchTable.getUniformMapCallback()(d);for(let m=0;m{!this._ready&&l(this._primitive)&&this._primitive.ready&&(this._ready=!0,this.releaseGeometryInstances&&(this.geometryInstances=void 0))})};Tb.prototype.getGeometryInstanceAttributes=function(e){return this._primitive.getGeometryInstanceAttributes(e)};Tb.isSupported=function(e){return e.frameState.context.depthTexture};Tb.prototype.isDestroyed=function(){return!1};Tb.prototype.destroy=function(){return this._primitive=this._primitive&&this._primitive.destroy(),this._sp=this._sp&&this._sp.destroy(),this._sp2D=void 0,this._spMorph=void 0,ue(this)};var zh=Tb;var VRn=x(T(),1);var xRn=x(T(),1);var mRn=x(T(),1);var WHe=new k(1,1),vHe=!1,FHe=U.WHITE;function F1(e){e=e??B.EMPTY_OBJECT,this._definitionChanged=new Se,this._image=void 0,this._imageSubscription=void 0,this._repeat=void 0,this._repeatSubscription=void 0,this._color=void 0,this._colorSubscription=void 0,this._transparent=void 0,this._transparentSubscription=void 0,this.image=e.image,this.repeat=e.repeat,this.color=e.color,this.transparent=e.transparent}Object.defineProperties(F1.prototype,{isConstant:{get:function(){return j.isConstant(this._image)&&j.isConstant(this._repeat)}},definitionChanged:{get:function(){return this._definitionChanged}},image:be("image"),repeat:be("repeat"),color:be("color"),transparent:be("transparent")});F1.prototype.getType=function(e){return"Image"};var IHe=new Q;F1.prototype.getValue=function(e,t){return l(e)||(e=Q.now(IHe)),l(t)||(t={}),t.image=j.getValueOrUndefined(this._image,e),t.repeat=j.getValueOrClonedDefault(this._repeat,e,WHe,t.repeat),t.color=j.getValueOrClonedDefault(this._color,e,FHe,t.color),j.getValueOrDefault(this._transparent,e,vHe)&&(t.color.alpha=Math.min(.99,t.color.alpha)),t};F1.prototype.equals=function(e){return this===e||e instanceof F1&&j.equals(this._image,e._image)&&j.equals(this._repeat,e._repeat)&&j.equals(this._color,e._color)&&j.equals(this._transparent,e._transparent)};var By=F1;function PHe(e){if(e instanceof U)return new Qt(e);if(typeof e=="string"||e instanceof ve||e instanceof HTMLCanvasElement||e instanceof HTMLVideoElement){let t=new By;return t.image=e,t}}function XHe(e,t){return be(e,t,PHe)}var sr=XHe;function cF(e){this._definitionChanged=new Se,this._show=void 0,this._showSubscription=void 0,this._dimensions=void 0,this._dimensionsSubscription=void 0,this._heightReference=void 0,this._heightReferenceSubscription=void 0,this._fill=void 0,this._fillSubscription=void 0,this._material=void 0,this._materialSubscription=void 0,this._outline=void 0,this._outlineSubscription=void 0,this._outlineColor=void 0,this._outlineColorSubscription=void 0,this._outlineWidth=void 0,this._outlineWidthSubscription=void 0,this._shadows=void 0,this._shadowsSubscription=void 0,this._distanceDisplayCondition=void 0,this._distanceDisplayConditionSubscription=void 0,this.merge(e??B.EMPTY_OBJECT)}Object.defineProperties(cF.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:be("show"),dimensions:be("dimensions"),heightReference:be("heightReference"),fill:be("fill"),material:sr("material"),outline:be("outline"),outlineColor:be("outlineColor"),outlineWidth:be("outlineWidth"),shadows:be("shadows"),distanceDisplayCondition:be("distanceDisplayCondition")});cF.prototype.clone=function(e){return l(e)?(e.show=this.show,e.dimensions=this.dimensions,e.heightReference=this.heightReference,e.fill=this.fill,e.material=this.material,e.outline=this.outline,e.outlineColor=this.outlineColor,e.outlineWidth=this.outlineWidth,e.shadows=this.shadows,e.distanceDisplayCondition=this.distanceDisplayCondition,e):new cF(this)};cF.prototype.merge=function(e){this.show=this.show??e.show,this.dimensions=this.dimensions??e.dimensions,this.heightReference=this.heightReference??e.heightReference,this.fill=this.fill??e.fill,this.material=this.material??e.material,this.outline=this.outline??e.outline,this.outlineColor=this.outlineColor??e.outlineColor,this.outlineWidth=this.outlineWidth??e.outlineWidth,this.shadows=this.shadows??e.shadows,this.distanceDisplayCondition=this.distanceDisplayCondition??e.distanceDisplayCondition};var L_=cF;var ORn=x(T(),1);var ARn=x(T(),1),npe={FIXED:0,INERTIAL:1};Object.freeze(npe);var Oi=npe;var XRn=x(T(),1);function I1(){ge.throwInstantiationError()}Object.defineProperties(I1.prototype,{isConstant:{get:ge.throwInstantiationError},definitionChanged:{get:ge.throwInstantiationError},referenceFrame:{get:ge.throwInstantiationError}});I1.prototype.getValue=ge.throwInstantiationError;I1.prototype.getValueInReferenceFrame=ge.throwInstantiationError;I1.prototype.equals=ge.throwInstantiationError;var ipe=new q;I1.convertToReferenceFrame=function(e,t,n,i,o){if(!l(t))return t;if(l(o)||(o=new h),n===i)return h.clone(t,o);let r=_t.computeIcrfToCentralBodyFixedMatrix(e,ipe);if(n===Oi.INERTIAL)return q.multiplyByVector(r,t,o);if(n===Oi.FIXED)return q.multiplyByVector(q.transpose(r,ipe),t,o)};var Hh=I1;function W_(e,t){this._definitionChanged=new Se,this._value=h.clone(e),this._referenceFrame=t??Oi.FIXED}Object.defineProperties(W_.prototype,{isConstant:{get:function(){return!l(this._value)||this._referenceFrame===Oi.FIXED}},definitionChanged:{get:function(){return this._definitionChanged}},referenceFrame:{get:function(){return this._referenceFrame}}});var NHe=new Q;W_.prototype.getValue=function(e,t){return l(e)||(e=Q.now(NHe)),this.getValueInReferenceFrame(e,Oi.FIXED,t)};W_.prototype.setValue=function(e,t){let n=!1;h.equals(this._value,e)||(n=!0,this._value=h.clone(e)),l(t)&&this._referenceFrame!==t&&(n=!0,this._referenceFrame=t),n&&this._definitionChanged.raiseEvent(this)};W_.prototype.getValueInReferenceFrame=function(e,t,n){return Hh.convertToReferenceFrame(e,this._value,this._referenceFrame,t,n)};W_.prototype.equals=function(e){return this===e||e instanceof W_&&h.equals(this._value,e._value)&&this._referenceFrame===e._referenceFrame};var Bl=W_;var QRn=x(T(),1);function lF(e){this._definitionChanged=new Se,this._show=void 0,this._showSubscription=void 0,this._positions=void 0,this._positionsSubscription=void 0,this._width=void 0,this._widthSubscription=void 0,this._height=void 0,this._heightSubscription=void 0,this._heightReference=void 0,this._heightReferenceSubscription=void 0,this._extrudedHeight=void 0,this._extrudedHeightSubscription=void 0,this._extrudedHeightReference=void 0,this._extrudedHeightReferenceSubscription=void 0,this._cornerType=void 0,this._cornerTypeSubscription=void 0,this._granularity=void 0,this._granularitySubscription=void 0,this._fill=void 0,this._fillSubscription=void 0,this._material=void 0,this._materialSubscription=void 0,this._outline=void 0,this._outlineSubscription=void 0,this._outlineColor=void 0,this._outlineColorSubscription=void 0,this._outlineWidth=void 0,this._outlineWidthSubscription=void 0,this._shadows=void 0,this._shadowsSubscription=void 0,this._distanceDisplayCondition=void 0,this._distanceDisplayConditionSubscription=void 0,this._classificationType=void 0,this._classificationTypeSubscription=void 0,this._zIndex=void 0,this._zIndexSubscription=void 0,this.merge(e??B.EMPTY_OBJECT)}Object.defineProperties(lF.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:be("show"),positions:be("positions"),width:be("width"),height:be("height"),heightReference:be("heightReference"),extrudedHeight:be("extrudedHeight"),extrudedHeightReference:be("extrudedHeightReference"),cornerType:be("cornerType"),granularity:be("granularity"),fill:be("fill"),material:sr("material"),outline:be("outline"),outlineColor:be("outlineColor"),outlineWidth:be("outlineWidth"),shadows:be("shadows"),distanceDisplayCondition:be("distanceDisplayCondition"),classificationType:be("classificationType"),zIndex:be("zIndex")});lF.prototype.clone=function(e){return l(e)?(e.show=this.show,e.positions=this.positions,e.width=this.width,e.height=this.height,e.heightReference=this.heightReference,e.extrudedHeight=this.extrudedHeight,e.extrudedHeightReference=this.extrudedHeightReference,e.cornerType=this.cornerType,e.granularity=this.granularity,e.fill=this.fill,e.material=this.material,e.outline=this.outline,e.outlineColor=this.outlineColor,e.outlineWidth=this.outlineWidth,e.shadows=this.shadows,e.distanceDisplayCondition=this.distanceDisplayCondition,e.classificationType=this.classificationType,e.zIndex=this.zIndex,e):new lF(this)};lF.prototype.merge=function(e){this.show=this.show??e.show,this.positions=this.positions??e.positions,this.width=this.width??e.width,this.height=this.height??e.height,this.heightReference=this.heightReference??e.heightReference,this.extrudedHeight=this.extrudedHeight??e.extrudedHeight,this.extrudedHeightReference=this.extrudedHeightReference??e.extrudedHeightReference,this.cornerType=this.cornerType??e.cornerType,this.granularity=this.granularity??e.granularity,this.fill=this.fill??e.fill,this.material=this.material??e.material,this.outline=this.outline??e.outline,this.outlineColor=this.outlineColor??e.outlineColor,this.outlineWidth=this.outlineWidth??e.outlineWidth,this.shadows=this.shadows??e.shadows,this.distanceDisplayCondition=this.distanceDisplayCondition??e.distanceDisplayCondition,this.classificationType=this.classificationType??e.classificationType,this.zIndex=this.zIndex??e.zIndex};var v_=lF;var e1n=x(T(),1);function YHe(e){return e}function MHe(e,t){return be(e,t,YHe)}var zl=MHe;var a1n=x(T(),1);function dF(e){this._definitionChanged=new Se,this._show=void 0,this._showSubscription=void 0,this._length=void 0,this._lengthSubscription=void 0,this._topRadius=void 0,this._topRadiusSubscription=void 0,this._bottomRadius=void 0,this._bottomRadiusSubscription=void 0,this._heightReference=void 0,this._heightReferenceSubscription=void 0,this._fill=void 0,this._fillSubscription=void 0,this._material=void 0,this._materialSubscription=void 0,this._outline=void 0,this._outlineSubscription=void 0,this._outlineColor=void 0,this._outlineColorSubscription=void 0,this._outlineWidth=void 0,this._outlineWidthSubscription=void 0,this._numberOfVerticalLines=void 0,this._numberOfVerticalLinesSubscription=void 0,this._slices=void 0,this._slicesSubscription=void 0,this._shadows=void 0,this._shadowsSubscription=void 0,this._distanceDisplayCondition=void 0,this._distanceDisplayConditionSubscription=void 0,this.merge(e??B.EMPTY_OBJECT)}Object.defineProperties(dF.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:be("show"),length:be("length"),topRadius:be("topRadius"),bottomRadius:be("bottomRadius"),heightReference:be("heightReference"),fill:be("fill"),material:sr("material"),outline:be("outline"),outlineColor:be("outlineColor"),outlineWidth:be("outlineWidth"),numberOfVerticalLines:be("numberOfVerticalLines"),slices:be("slices"),shadows:be("shadows"),distanceDisplayCondition:be("distanceDisplayCondition")});dF.prototype.clone=function(e){return l(e)?(e.show=this.show,e.length=this.length,e.topRadius=this.topRadius,e.bottomRadius=this.bottomRadius,e.heightReference=this.heightReference,e.fill=this.fill,e.material=this.material,e.outline=this.outline,e.outlineColor=this.outlineColor,e.outlineWidth=this.outlineWidth,e.numberOfVerticalLines=this.numberOfVerticalLines,e.slices=this.slices,e.shadows=this.shadows,e.distanceDisplayCondition=this.distanceDisplayCondition,e):new dF(this)};dF.prototype.merge=function(e){this.show=this.show??e.show,this.length=this.length??e.length,this.topRadius=this.topRadius??e.topRadius,this.bottomRadius=this.bottomRadius??e.bottomRadius,this.heightReference=this.heightReference??e.heightReference,this.fill=this.fill??e.fill,this.material=this.material??e.material,this.outline=this.outline??e.outline,this.outlineColor=this.outlineColor??e.outlineColor,this.outlineWidth=this.outlineWidth??e.outlineWidth,this.numberOfVerticalLines=this.numberOfVerticalLines??e.numberOfVerticalLines,this.slices=this.slices??e.slices,this.shadows=this.shadows??e.shadows,this.distanceDisplayCondition=this.distanceDisplayCondition??e.distanceDisplayCondition};var F_=dF;var f1n=x(T(),1);function uF(e){this._definitionChanged=new Se,this._show=void 0,this._showSubscription=void 0,this._semiMajorAxis=void 0,this._semiMajorAxisSubscription=void 0,this._semiMinorAxis=void 0,this._semiMinorAxisSubscription=void 0,this._height=void 0,this._heightSubscription=void 0,this._heightReference=void 0,this._heightReferenceSubscription=void 0,this._extrudedHeight=void 0,this._extrudedHeightSubscription=void 0,this._extrudedHeightReference=void 0,this._extrudedHeightReferenceSubscription=void 0,this._rotation=void 0,this._rotationSubscription=void 0,this._stRotation=void 0,this._stRotationSubscription=void 0,this._granularity=void 0,this._granularitySubscription=void 0,this._fill=void 0,this._fillSubscription=void 0,this._material=void 0,this._materialSubscription=void 0,this._outline=void 0,this._outlineSubscription=void 0,this._outlineColor=void 0,this._outlineColorSubscription=void 0,this._outlineWidth=void 0,this._outlineWidthSubscription=void 0,this._numberOfVerticalLines=void 0,this._numberOfVerticalLinesSubscription=void 0,this._shadows=void 0,this._shadowsSubscription=void 0,this._distanceDisplayCondition=void 0,this._distanceDisplayConditionSubscription=void 0,this._classificationType=void 0,this._classificationTypeSubscription=void 0,this._zIndex=void 0,this._zIndexSubscription=void 0,this.merge(e??B.EMPTY_OBJECT)}Object.defineProperties(uF.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:be("show"),semiMajorAxis:be("semiMajorAxis"),semiMinorAxis:be("semiMinorAxis"),height:be("height"),heightReference:be("heightReference"),extrudedHeight:be("extrudedHeight"),extrudedHeightReference:be("extrudedHeightReference"),rotation:be("rotation"),stRotation:be("stRotation"),granularity:be("granularity"),fill:be("fill"),material:sr("material"),outline:be("outline"),outlineColor:be("outlineColor"),outlineWidth:be("outlineWidth"),numberOfVerticalLines:be("numberOfVerticalLines"),shadows:be("shadows"),distanceDisplayCondition:be("distanceDisplayCondition"),classificationType:be("classificationType"),zIndex:be("zIndex")});uF.prototype.clone=function(e){return l(e)?(e.show=this.show,e.semiMajorAxis=this.semiMajorAxis,e.semiMinorAxis=this.semiMinorAxis,e.height=this.height,e.heightReference=this.heightReference,e.extrudedHeight=this.extrudedHeight,e.extrudedHeightReference=this.extrudedHeightReference,e.rotation=this.rotation,e.stRotation=this.stRotation,e.granularity=this.granularity,e.fill=this.fill,e.material=this.material,e.outline=this.outline,e.outlineColor=this.outlineColor,e.outlineWidth=this.outlineWidth,e.numberOfVerticalLines=this.numberOfVerticalLines,e.shadows=this.shadows,e.distanceDisplayCondition=this.distanceDisplayCondition,e.classificationType=this.classificationType,e.zIndex=this.zIndex,e):new uF(this)};uF.prototype.merge=function(e){this.show=this.show??e.show,this.semiMajorAxis=this.semiMajorAxis??e.semiMajorAxis,this.semiMinorAxis=this.semiMinorAxis??e.semiMinorAxis,this.height=this.height??e.height,this.heightReference=this.heightReference??e.heightReference,this.extrudedHeight=this.extrudedHeight??e.extrudedHeight,this.extrudedHeightReference=this.extrudedHeightReference??e.extrudedHeightReference,this.rotation=this.rotation??e.rotation,this.stRotation=this.stRotation??e.stRotation,this.granularity=this.granularity??e.granularity,this.fill=this.fill??e.fill,this.material=this.material??e.material,this.outline=this.outline??e.outline,this.outlineColor=this.outlineColor??e.outlineColor,this.outlineWidth=this.outlineWidth??e.outlineWidth,this.numberOfVerticalLines=this.numberOfVerticalLines??e.numberOfVerticalLines,this.shadows=this.shadows??e.shadows,this.distanceDisplayCondition=this.distanceDisplayCondition??e.distanceDisplayCondition,this.classificationType=this.classificationType??e.classificationType,this.zIndex=this.zIndex??e.zIndex};var I_=uF;var _1n=x(T(),1);function mF(e){this._definitionChanged=new Se,this._show=void 0,this._showSubscription=void 0,this._radii=void 0,this._radiiSubscription=void 0,this._innerRadii=void 0,this._innerRadiiSubscription=void 0,this._minimumClock=void 0,this._minimumClockSubscription=void 0,this._maximumClock=void 0,this._maximumClockSubscription=void 0,this._minimumCone=void 0,this._minimumConeSubscription=void 0,this._maximumCone=void 0,this._maximumConeSubscription=void 0,this._heightReference=void 0,this._heightReferenceSubscription=void 0,this._fill=void 0,this._fillSubscription=void 0,this._material=void 0,this._materialSubscription=void 0,this._outline=void 0,this._outlineSubscription=void 0,this._outlineColor=void 0,this._outlineColorSubscription=void 0,this._outlineWidth=void 0,this._outlineWidthSubscription=void 0,this._stackPartitions=void 0,this._stackPartitionsSubscription=void 0,this._slicePartitions=void 0,this._slicePartitionsSubscription=void 0,this._subdivisions=void 0,this._subdivisionsSubscription=void 0,this._shadows=void 0,this._shadowsSubscription=void 0,this._distanceDisplayCondition=void 0,this._distanceDisplayConditionSubscription=void 0,this.merge(e??B.EMPTY_OBJECT)}Object.defineProperties(mF.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:be("show"),radii:be("radii"),innerRadii:be("innerRadii"),minimumClock:be("minimumClock"),maximumClock:be("maximumClock"),minimumCone:be("minimumCone"),maximumCone:be("maximumCone"),heightReference:be("heightReference"),fill:be("fill"),material:sr("material"),outline:be("outline"),outlineColor:be("outlineColor"),outlineWidth:be("outlineWidth"),stackPartitions:be("stackPartitions"),slicePartitions:be("slicePartitions"),subdivisions:be("subdivisions"),shadows:be("shadows"),distanceDisplayCondition:be("distanceDisplayCondition")});mF.prototype.clone=function(e){return l(e)?(e.show=this.show,e.radii=this.radii,e.innerRadii=this.innerRadii,e.minimumClock=this.minimumClock,e.maximumClock=this.maximumClock,e.minimumCone=this.minimumCone,e.maximumCone=this.maximumCone,e.heightReference=this.heightReference,e.fill=this.fill,e.material=this.material,e.outline=this.outline,e.outlineColor=this.outlineColor,e.outlineWidth=this.outlineWidth,e.stackPartitions=this.stackPartitions,e.slicePartitions=this.slicePartitions,e.subdivisions=this.subdivisions,e.shadows=this.shadows,e.distanceDisplayCondition=this.distanceDisplayCondition,e):new mF(this)};mF.prototype.merge=function(e){this.show=this.show??e.show,this.radii=this.radii??e.radii,this.innerRadii=this.innerRadii??e.innerRadii,this.minimumClock=this.minimumClock??e.minimumClock,this.maximumClock=this.maximumClock??e.maximumClock,this.minimumCone=this.minimumCone??e.minimumCone,this.maximumCone=this.maximumCone??e.maximumCone,this.heightReference=this.heightReference??e.heightReference,this.fill=this.fill??e.fill,this.material=this.material??e.material,this.outline=this.outline??e.outline,this.outlineColor=this.outlineColor??e.outlineColor,this.outlineWidth=this.outlineWidth??e.outlineWidth,this.stackPartitions=this.stackPartitions??e.stackPartitions,this.slicePartitions=this.slicePartitions??e.slicePartitions,this.subdivisions=this.subdivisions??e.subdivisions,this.shadows=this.shadows??e.shadows,this.distanceDisplayCondition=this.distanceDisplayCondition??e.distanceDisplayCondition};var P_=mF;var E1n=x(T(),1);function hF(e){this._definitionChanged=new Se,this._show=void 0,this._showSubscription=void 0,this._text=void 0,this._textSubscription=void 0,this._font=void 0,this._fontSubscription=void 0,this._style=void 0,this._styleSubscription=void 0,this._scale=void 0,this._scaleSubscription=void 0,this._showBackground=void 0,this._showBackgroundSubscription=void 0,this._backgroundColor=void 0,this._backgroundColorSubscription=void 0,this._backgroundPadding=void 0,this._backgroundPaddingSubscription=void 0,this._pixelOffset=void 0,this._pixelOffsetSubscription=void 0,this._eyeOffset=void 0,this._eyeOffsetSubscription=void 0,this._horizontalOrigin=void 0,this._horizontalOriginSubscription=void 0,this._verticalOrigin=void 0,this._verticalOriginSubscription=void 0,this._heightReference=void 0,this._heightReferenceSubscription=void 0,this._fillColor=void 0,this._fillColorSubscription=void 0,this._outlineColor=void 0,this._outlineColorSubscription=void 0,this._outlineWidth=void 0,this._outlineWidthSubscription=void 0,this._translucencyByDistance=void 0,this._translucencyByDistanceSubscription=void 0,this._pixelOffsetScaleByDistance=void 0,this._pixelOffsetScaleByDistanceSubscription=void 0,this._scaleByDistance=void 0,this._scaleByDistanceSubscription=void 0,this._distanceDisplayCondition=void 0,this._distanceDisplayConditionSubscription=void 0,this._disableDepthTestDistance=void 0,this._disableDepthTestDistanceSubscription=void 0,this.merge(e??B.EMPTY_OBJECT)}Object.defineProperties(hF.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:be("show"),text:be("text"),font:be("font"),style:be("style"),scale:be("scale"),showBackground:be("showBackground"),backgroundColor:be("backgroundColor"),backgroundPadding:be("backgroundPadding"),pixelOffset:be("pixelOffset"),eyeOffset:be("eyeOffset"),horizontalOrigin:be("horizontalOrigin"),verticalOrigin:be("verticalOrigin"),heightReference:be("heightReference"),fillColor:be("fillColor"),outlineColor:be("outlineColor"),outlineWidth:be("outlineWidth"),translucencyByDistance:be("translucencyByDistance"),pixelOffsetScaleByDistance:be("pixelOffsetScaleByDistance"),scaleByDistance:be("scaleByDistance"),distanceDisplayCondition:be("distanceDisplayCondition"),disableDepthTestDistance:be("disableDepthTestDistance")});hF.prototype.clone=function(e){return l(e)?(e.show=this.show,e.text=this.text,e.font=this.font,e.style=this.style,e.scale=this.scale,e.showBackground=this.showBackground,e.backgroundColor=this.backgroundColor,e.backgroundPadding=this.backgroundPadding,e.pixelOffset=this.pixelOffset,e.eyeOffset=this.eyeOffset,e.horizontalOrigin=this.horizontalOrigin,e.verticalOrigin=this.verticalOrigin,e.heightReference=this.heightReference,e.fillColor=this.fillColor,e.outlineColor=this.outlineColor,e.outlineWidth=this.outlineWidth,e.translucencyByDistance=this.translucencyByDistance,e.pixelOffsetScaleByDistance=this.pixelOffsetScaleByDistance,e.scaleByDistance=this.scaleByDistance,e.distanceDisplayCondition=this.distanceDisplayCondition,e.disableDepthTestDistance=this.disableDepthTestDistance,e):new hF(this)};hF.prototype.merge=function(e){this.show=this.show??e.show,this.text=this.text??e.text,this.font=this.font??e.font,this.style=this.style??e.style,this.scale=this.scale??e.scale,this.showBackground=this.showBackground??e.showBackground,this.backgroundColor=this.backgroundColor??e.backgroundColor,this.backgroundPadding=this.backgroundPadding??e.backgroundPadding,this.pixelOffset=this.pixelOffset??e.pixelOffset,this.eyeOffset=this.eyeOffset??e.eyeOffset,this.horizontalOrigin=this.horizontalOrigin??e.horizontalOrigin,this.verticalOrigin=this.verticalOrigin??e.verticalOrigin,this.heightReference=this.heightReference??e.heightReference,this.fillColor=this.fillColor??e.fillColor,this.outlineColor=this.outlineColor??e.outlineColor,this.outlineWidth=this.outlineWidth??e.outlineWidth,this.translucencyByDistance=this.translucencyByDistance??e.translucencyByDistance,this.pixelOffsetScaleByDistance=this.pixelOffsetScaleByDistance??e.pixelOffsetScaleByDistance,this.scaleByDistance=this.scaleByDistance??e.scaleByDistance,this.distanceDisplayCondition=this.distanceDisplayCondition??e.distanceDisplayCondition,this.disableDepthTestDistance=this.disableDepthTestDistance??e.disableDepthTestDistance};var Kh=hF;var iCn=x(T(),1);var k1n=x(T(),1);var v1n=x(T(),1);var wHe=new h(1,1,1),kHe=h.ZERO,UHe=Ne.IDENTITY;function ope(e,t,n){this.translation=h.clone(e??kHe),this.rotation=Ne.clone(t??UHe),this.scale=h.clone(n??wHe)}ope.prototype.equals=function(e){return this===e||l(e)&&h.equals(this.translation,e.translation)&&Ne.equals(this.rotation,e.rotation)&&h.equals(this.scale,e.scale)};var zy=ope;var jQ=new zy;function fF(e){e=e??B.EMPTY_OBJECT,this._definitionChanged=new Se,this._translation=void 0,this._translationSubscription=void 0,this._rotation=void 0,this._rotationSubscription=void 0,this._scale=void 0,this._scaleSubscription=void 0,this.translation=e.translation,this.rotation=e.rotation,this.scale=e.scale}Object.defineProperties(fF.prototype,{isConstant:{get:function(){return j.isConstant(this._translation)&&j.isConstant(this._rotation)&&j.isConstant(this._scale)}},definitionChanged:{get:function(){return this._definitionChanged}},translation:be("translation"),rotation:be("rotation"),scale:be("scale")});var DHe=new Q;fF.prototype.getValue=function(e,t){return l(e)||(e=Q.now(DHe)),l(t)||(t=new zy),t.translation=j.getValueOrClonedDefault(this._translation,e,jQ.translation,t.translation),t.rotation=j.getValueOrClonedDefault(this._rotation,e,jQ.rotation,t.rotation),t.scale=j.getValueOrClonedDefault(this._scale,e,jQ.scale,t.scale),t};fF.prototype.equals=function(e){return this===e||e instanceof fF&&j.equals(this._translation,e._translation)&&j.equals(this._rotation,e._rotation)&&j.equals(this._scale,e._scale)};var X_=fF;var J1n=x(T(),1);function _b(e,t){this._propertyNames=[],this._definitionChanged=new Se,l(e)&&this.merge(e,t)}Object.defineProperties(_b.prototype,{propertyNames:{get:function(){return this._propertyNames}},isConstant:{get:function(){let e=this._propertyNames;for(let t=0,n=e.length;t{this._terrainHeight=s.height,this.definitionChanged.raiseEvent()};this._removeCallbackFunc=e.updateHeight(i,r,this._heightReference)};var dKe=new Q;X1.prototype.getValue=function(e,t){l(e)||(e=Q.now(dKe));let n=j.getValueOrDefault(this._heightReference,e,He.NONE),i=j.getValueOrDefault(this._extrudedHeightReference,e,He.NONE);if(n===He.NONE&&!ky(i))return this._position=h.clone(h.ZERO,this._position),h.clone(h.ZERO,t);if(this._positionProperty.isConstant&&n!==He.CLIP_TO_GROUND)return h.multiplyByScalar(this._normal,this._terrainHeight,t);let o=this._scene,r=this._positionProperty.getValue(e,lpe);if(!l(r)||h.equals(r,h.ZERO)||!l(o.globe))return h.clone(h.ZERO,t);if(h.equalsEpsilon(this._position,r,W.EPSILON10)&&n!==He.CLIP_TO_GROUND)return h.multiplyByScalar(this._normal,this._terrainHeight,t);this._position=h.clone(r,this._position),this._updateClamping();let s=o.ellipsoid.geodeticSurfaceNormal(r,this._normal);if(n===He.CLIP_TO_GROUND){let c=o.globe.ellipsoid.cartesianToCartographic(r,scratchCarto);return this._terrainHeight>=c.height?h.multiplyByScalar(s,this._terrainHeight-c.height,t):h.clone(h.ZERO,t)}return h.multiplyByScalar(s,this._terrainHeight,t)};X1.prototype.isDestroyed=function(){return!1};X1.prototype.destroy=function(){return l(this._removeEventListener)&&this._removeEventListener(),l(this._removeModeListener)&&this._removeModeListener(),l(this._removeCallbackFunc)&&this._removeCallbackFunc(),ue(this)};var w_=X1;function uKe(e,t,n,i){if(Wi.prototype._onEntityPropertyChanged.call(this,e,t,n,i),this._observedPropertyNames.indexOf(t)===-1)return;let o=this._entity[this._geometryPropertyName];if(!l(o))return;l(this._terrainOffsetProperty)&&(this._terrainOffsetProperty.destroy(),this._terrainOffsetProperty=void 0);let r=o.heightReference;if(l(r)){let s=new Qh(this._computeCenter.bind(this),!this._dynamic);this._terrainOffsetProperty=new w_(this._scene,s,r)}}var Cb=uKe;var dpe=h.ZERO,upe=new h,mKe=new h,mpe=new U;function hKe(e){this.id=e,this.vertexFormat=void 0,this.dimensions=void 0,this.offsetAttribute=void 0}function Cu(e,t){Wi.call(this,{entity:e,scene:t,geometryOptions:new hKe(e),geometryPropertyName:"box",observedPropertyNames:["availability","position","orientation","box"]}),this._onEntityPropertyChanged(e,"box",e.box,void 0)}l(Object.create)&&(Cu.prototype=Object.create(Wi.prototype),Cu.prototype.constructor=Cu);Object.defineProperties(Cu.prototype,{terrainOffsetProperty:{get:function(){return this._terrainOffsetProperty}}});Cu.prototype.createFillGeometryInstance=function(e){let t=this._entity,n=t.isAvailable(e),i=new Wn(n&&t.isShowing&&this._showProperty.getValue(e)&&this._fillProperty.getValue(e)),o=this._distanceDisplayConditionProperty.getValue(e),r=ti.fromDistanceDisplayCondition(o),s={show:i,distanceDisplayCondition:r,color:void 0,offset:void 0};if(this._materialProperty instanceof Qt){let a;l(this._materialProperty.color)&&(this._materialProperty.color.isConstant||n)&&(a=this._materialProperty.color.getValue(e,mpe)),l(a)||(a=U.WHITE),s.color=$t.fromColor(a)}return l(this._options.offsetAttribute)&&(s.offset=Ro.fromCartesian3(j.getValueOrDefault(this._terrainOffsetProperty,e,dpe,upe))),new Yt({id:t,geometry:Vc.fromDimensions(this._options),modelMatrix:t.computeModelMatrixForHeightReference(e,t.box.heightReference,this._options.dimensions.z*.5,this._scene.ellipsoid),attributes:s})};Cu.prototype.createOutlineGeometryInstance=function(e){let t=this._entity,n=t.isAvailable(e),i=j.getValueOrDefault(this._outlineColorProperty,e,U.BLACK,mpe),o=this._distanceDisplayConditionProperty.getValue(e),r={show:new Wn(n&&t.isShowing&&this._showProperty.getValue(e)&&this._showOutlineProperty.getValue(e)),color:$t.fromColor(i),distanceDisplayCondition:ti.fromDistanceDisplayCondition(o),offset:void 0};return l(this._options.offsetAttribute)&&(r.offset=Ro.fromCartesian3(j.getValueOrDefault(this._terrainOffsetProperty,e,dpe,upe))),new Yt({id:t,geometry:Bh.fromDimensions(this._options),modelMatrix:t.computeModelMatrixForHeightReference(e,t.box.heightReference,this._options.dimensions.z*.5,this._scene.ellipsoid),attributes:r})};Cu.prototype._computeCenter=function(e,t){return j.getValueOrUndefined(this._entity.position,e,t)};Cu.prototype._isHidden=function(e,t){return!l(t.dimensions)||!l(e.position)||Wi.prototype._isHidden.call(this,e,t)};Cu.prototype._isDynamic=function(e,t){return!e.position.isConstant||!j.isConstant(e.orientation)||!t.dimensions.isConstant||!j.isConstant(t.outlineWidth)};Cu.prototype._setStaticOptions=function(e,t){let n=j.getValueOrDefault(t.heightReference,ot.MINIMUM_VALUE,He.NONE),i=this._options;i.vertexFormat=this._materialProperty instanceof Qt?Tn.VERTEX_FORMAT:Co.MaterialSupport.TEXTURED.vertexFormat,i.dimensions=t.dimensions.getValue(ot.MINIMUM_VALUE,i.dimensions),i.offsetAttribute=n!==He.NONE?bn.ALL:void 0};Cu.prototype._onEntityPropertyChanged=Cb;Cu.DynamicGeometryUpdater=N1;function N1(e,t,n){Li.call(this,e,t,n)}l(Object.create)&&(N1.prototype=Object.create(Li.prototype),N1.prototype.constructor=N1);N1.prototype._isHidden=function(e,t,n){let i=j.getValueOrUndefined(e.position,n,mKe),o=this._options.dimensions;return!l(i)||!l(o)||Li.prototype._isHidden.call(this,e,t,n)};N1.prototype._setOptions=function(e,t,n){let i=j.getValueOrDefault(t.heightReference,n,He.NONE),o=this._options;o.dimensions=j.getValueOrUndefined(t.dimensions,n,o.dimensions),o.offsetAttribute=i!==He.NONE?bn.ALL:void 0};var VF=Cu;var fAn=x(T(),1);function k_(e,t,n){this._callback=void 0,this._isConstant=void 0,this._referenceFrame=n??Oi.FIXED,this._definitionChanged=new Se,this.setCallback(e,t)}Object.defineProperties(k_.prototype,{isConstant:{get:function(){return this._isConstant}},definitionChanged:{get:function(){return this._definitionChanged}},referenceFrame:{get:function(){return this._referenceFrame}}});var fKe=new Q;k_.prototype.getValue=function(e,t){return l(e)||(e=Q.now(fKe)),this.getValueInReferenceFrame(e,Oi.FIXED,t)};k_.prototype.setCallback=function(e,t){let n=this._callback!==e||this._isConstant!==t;this._callback=e,this._isConstant=t,n&&this._definitionChanged.raiseEvent(this)};k_.prototype.getValueInReferenceFrame=function(e,t,n){let i=this._callback(e,n);return Hh.convertToReferenceFrame(e,i,this._referenceFrame,t,n)};k_.prototype.equals=function(e){return this===e||e instanceof k_&&this._callback===e._callback&&this._isConstant===e._isConstant&&this._referenceFrame===e._referenceFrame};var EF=k_;var XEi=x(T(),1);var CEi=x(T(),1);var TAn=x(T(),1);var bAn=x(T(),1);/*! @license DOMPurify 3.4.14 | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/3.4.14/LICENSE */function hpe(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,i=Array(t);n2?i-2:0),r=2;r1?n-1:0),o=1;o"u"?null:pa(BigInt.prototype.toString),xpe=typeof Symbol>"u"?null:pa(Symbol.prototype.toString),Fd=pa(Object.prototype.hasOwnProperty),LF=pa(Object.prototype.toString),$c=pa(RegExp.prototype.test),U_=AKe(TypeError);function pa(e){return function(t){t instanceof RegExp&&(t.lastIndex=0);for(var n=arguments.length,i=new Array(n>1?n-1:0),o=1;o2&&arguments[2]!==void 0?arguments[2]:WF;if(fpe&&fpe(e,null),!M1(t))return e;let i=t.length;for(;i--;){let o=t[i];if(typeof o=="string"){let r=n(o);r!==o&&(TKe(t)||(t[i]=r),o=r)}e[o]=!0}return e}function GKe(e){for(let t=0;t/g),XKe=cc(/\${[\w\W]*/g),NKe=cc(/^data-[\-\w.\u00B7-\uFFFF]+$/),YKe=cc(/^aria-[\-\w]+$/),Rpe=cc(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),MKe=cc(/^(?:\w+script|data):/i),wKe=cc(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),kKe=cc(/^html$/i),UKe=cc(/^[a-z][.\w]*(-[.\w]+)+$/i),Cpe=cc(/<[/\w!]/g),Vpe=cc(/<[/\w]/g),DKe=cc(/<\/no(script|embed|frames)/i),OKe=cc(/\/>/i),Vu={element:1,attribute:2,text:3,cdataSection:4,entityReference:5,entityNode:6,processingInstruction:7,comment:8,document:9,documentType:10,documentFragment:11,notation:12},Lpe=["style","script","xmp","iframe","noembed","noframes","plaintext","noscript"],BKe=Na(Lo({},Lpe)),zKe=(function(){let e={};return D_(Lpe,t=>{e[t]=cc(new RegExp("])","i"))}),Na(e)})(),HKe=function(){return typeof window>"u"?null:window},KKe=function(t,n){if(typeof t!="object"||typeof t.createPolicy!="function")return null;let i=null,o="data-tt-policy-suffix";n&&n.hasAttribute(o)&&(i=n.getAttribute(o));let r="dompurify"+(i?"#"+i:"");try{return t.createPolicy(r,{createHTML(s){return s},createScriptURL(s){return s}})}catch{return console.warn("TrustedTypes policy "+r+" could not be created."),null}},Epe=function(){return{afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}},Hy=function(t,n,i,o){return Fd(t,n)&&M1(t[n])?Lo(o.base?Eu(o.base):{},t[n],o.transform):i},o8=function(t,n,i){let o=Fd(t,n)?t[n]:void 0;return o&&typeof o=="object"?Eu(o):i()};function Wpe(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:HKe(),t=Vt=>Wpe(Vt);if(t.version="3.4.14",t.removed=[],!e||!e.document||e.document.nodeType!==Vu.document||!e.Element)return t.isSupported=!1,t;let n=e.document,i=n,o=i.currentScript;e.DocumentFragment;let r=e.HTMLTemplateElement,s=e.Node,a=e.Element,c=e.NodeFilter,d=e.NamedNodeMap;d===void 0&&(e.NamedNodeMap||e.MozNamedAttrMap),e.HTMLFormElement;let u=e.DOMParser,m=e.trustedTypes,p=a.prototype,b=qh(p,"cloneNode"),f=qh(p,"remove"),y=qh(p,"nextSibling"),_=qh(p,"childNodes"),S=qh(p,"parentNode"),Z=qh(p,"shadowRoot"),R=qh(p,"attributes"),C=s&&s.prototype?qh(s.prototype,"nodeType"):null,E=s&&s.prototype?qh(s.prototype,"nodeName"):null,A=s&&s.prototype?qh(s.prototype,"ownerDocument"):null,L=function(Te){return C?C(Te):Te.nodeType},F=function(Te){return E?E(Te):Te.nodeName};if(typeof r=="function"){let Vt=n.createElement("template");Vt.content&&Vt.content.ownerDocument&&(n=Vt.content.ownerDocument)}let I,N="",g,V=!1,G=0,v=function(){if(G>0)throw U_('A configured TRUSTED_TYPES_POLICY callback (createHTML or createScriptURL) must not call DOMPurify.sanitize, as that causes infinite recursion. Do not pass a policy whose callbacks wrap DOMPurify as TRUSTED_TYPES_POLICY; see the "DOMPurify and Trusted Types" section of the README.')},X=function(Te){v(),G++;try{return I.createHTML(Te)}finally{G--}},Y=function(Te){v(),G++;try{return I.createScriptURL(Te)}finally{G--}},D=function(){return V||(g=KKe(m,o),V=!0),g},M=n,O=M.implementation,w=M.createNodeIterator,z=M.createDocumentFragment,K=M.getElementsByTagName,te=i.importNode,H=Epe();t.isSupported=typeof Ape=="function"&&typeof S=="function"&&O&&O.createHTMLDocument!==void 0;let $=IKe,ee=PKe,le=XKe,_e=NKe,he=YKe,Ze=MKe,ye=wKe,Ge=UKe,Ae=Rpe,Fe=null,tt=Lo({},[...Tpe,...e8,...t8,...n8,..._pe]),Be=null,je=Lo({},[...Spe,...i8,...Zpe,...pO]),qe=Object.seal(Y1(null,{tagNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},allowCustomizedBuiltInElements:{writable:!0,configurable:!1,enumerable:!0,value:!1}})),We=null,Ke=null,ct=Object.seal(Y1(null,{tagCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeCheck:{writable:!0,configurable:!1,enumerable:!0,value:null}})),Et=!0,zt=!0,ut=!1,bt=!0,ht=!1,jt=!0,st=!1,pt=!1,Mi=null,jn=null,Si=!1,Hi=!1,Gi=!1,pi=!1,Zi=!0,On=!1,rn="user-content-",Hn=!0,$i=!1,Po={},hr=null,Is=Lo({},["annotation-xml","audio","colgroup","desc","foreignobject","head","iframe","math","mi","mn","mo","ms","mtext","noembed","noframes","noscript","plaintext","script","selectedcontent","style","svg","template","thead","title","video","xmp"]),Hs=null,or=Lo({},["audio","video","img","source","image","track"]),yi=null,fr=Lo({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),mo="http://www.w3.org/1998/Math/MathML",Qr="http://www.w3.org/2000/svg",Mn="http://www.w3.org/1999/xhtml",Ki=Mn,wi=!1,Xo=null,Dc=Lo({},[mo,Qr,Mn],$Q),bm=Na(["mi","mo","mn","ms","mtext"]),bp=Lo({},bm),Lh=Na(["annotation-xml"]),ua=Lo({},Lh),gp=Lo({},["title","style","font","a","script"]),Ps=null,$a=["application/xhtml+xml","text/html"],BT="text/html",si=null,qo=null,Gl=n.createElement("form"),K0=function(Te){return Te instanceof RegExp||Te instanceof Function},va=function(){let Te=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(qo&&qo===Te)return;(!Te||typeof Te!="object")&&(Te={}),Te=Eu(Te),Ps=$a.indexOf(Te.PARSER_MEDIA_TYPE)===-1?BT:Te.PARSER_MEDIA_TYPE,si=Ps==="application/xhtml+xml"?$Q:WF,Fe=Hy(Te,"ALLOWED_TAGS",tt,{transform:si}),Be=Hy(Te,"ALLOWED_ATTR",je,{transform:si}),Xo=Hy(Te,"ALLOWED_NAMESPACES",Dc,{transform:$Q}),yi=Hy(Te,"ADD_URI_SAFE_ATTR",fr,{transform:si,base:fr}),Hs=Hy(Te,"ADD_DATA_URI_TAGS",or,{transform:si,base:or}),hr=Hy(Te,"FORBID_CONTENTS",Is,{transform:si}),We=Hy(Te,"FORBID_TAGS",Eu({}),{transform:si}),Ke=Hy(Te,"FORBID_ATTR",Eu({}),{transform:si}),Po=Fd(Te,"USE_PROFILES")?Te.USE_PROFILES&&typeof Te.USE_PROFILES=="object"?Eu(Te.USE_PROFILES):Te.USE_PROFILES:!1,Et=Te.ALLOW_ARIA_ATTR!==!1,zt=Te.ALLOW_DATA_ATTR!==!1,ut=Te.ALLOW_UNKNOWN_PROTOCOLS||!1,bt=Te.ALLOW_SELF_CLOSE_IN_ATTR!==!1,ht=Te.SAFE_FOR_TEMPLATES||!1,jt=Te.SAFE_FOR_XML!==!1,st=Te.WHOLE_DOCUMENT||!1,Hi=Te.RETURN_DOM||!1,Gi=Te.RETURN_DOM_FRAGMENT||!1,pi=Te.RETURN_TRUSTED_TYPE||!1,Si=Te.FORCE_BODY||!1,Zi=Te.SANITIZE_DOM!==!1,On=Te.SANITIZE_NAMED_PROPS||!1,Hn=Te.KEEP_CONTENT!==!1,$i=Te.IN_PLACE||!1,Ae=WKe(Te.ALLOWED_URI_REGEXP)?Te.ALLOWED_URI_REGEXP:Rpe,Ki=typeof Te.NAMESPACE=="string"?Te.NAMESPACE:Mn,bp=o8(Te,"MATHML_TEXT_INTEGRATION_POINTS",()=>Lo({},bm)),ua=o8(Te,"HTML_INTEGRATION_POINTS",()=>Lo({},Lh));let Ye=o8(Te,"CUSTOM_ELEMENT_HANDLING",()=>Y1(null));if(qe=Y1(null),Fd(Ye,"tagNameCheck")&&K0(Ye.tagNameCheck)&&(qe.tagNameCheck=Ye.tagNameCheck),Fd(Ye,"attributeNameCheck")&&K0(Ye.attributeNameCheck)&&(qe.attributeNameCheck=Ye.attributeNameCheck),Fd(Ye,"allowCustomizedBuiltInElements")&&typeof Ye.allowCustomizedBuiltInElements=="boolean"&&(qe.allowCustomizedBuiltInElements=Ye.allowCustomizedBuiltInElements),cc(qe),ht&&(zt=!1),Gi&&(Hi=!0),Po&&(Fe=Lo({},_pe),Be=Y1(null),Po.html===!0&&(Lo(Fe,Tpe),Lo(Be,Spe)),Po.svg===!0&&(Lo(Fe,e8),Lo(Be,i8),Lo(Be,pO)),Po.svgFilters===!0&&(Lo(Fe,t8),Lo(Be,i8),Lo(Be,pO)),Po.mathMl===!0&&(Lo(Fe,n8),Lo(Be,Zpe),Lo(Be,pO))),ct.tagCheck=null,ct.attributeCheck=null,Fd(Te,"ADD_TAGS")&&(typeof Te.ADD_TAGS=="function"?ct.tagCheck=Te.ADD_TAGS:M1(Te.ADD_TAGS)&&(Fe===tt&&(Fe=Eu(Fe)),Lo(Fe,Te.ADD_TAGS,si))),Fd(Te,"ADD_ATTR")&&(typeof Te.ADD_ATTR=="function"?ct.attributeCheck=Te.ADD_ATTR:M1(Te.ADD_ATTR)&&(Be===je&&(Be=Eu(Be)),Lo(Be,Te.ADD_ATTR,si))),Fd(Te,"ADD_FORBID_CONTENTS")&&M1(Te.ADD_FORBID_CONTENTS)&&(hr===Is&&(hr=Eu(hr)),Lo(hr,Te.ADD_FORBID_CONTENTS,si)),Hn&&(Fe["#text"]=!0),st&&Lo(Fe,["html","head","body"]),Fe.table&&(Lo(Fe,["tbody"]),delete We.tbody),Te.TRUSTED_TYPES_POLICY){if(typeof Te.TRUSTED_TYPES_POLICY.createHTML!="function")throw U_('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if(typeof Te.TRUSTED_TYPES_POLICY.createScriptURL!="function")throw U_('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');let yt=I;I=Te.TRUSTED_TYPES_POLICY;try{N=X("")}catch(an){throw I=yt,an}}else Te.TRUSTED_TYPES_POLICY===null?(I=void 0,N=""):(I===void 0&&(I=D()),I&&typeof N=="string"&&(N=X("")));Na&&Na(Te),qo=Te},yp=Lo({},[...e8,...t8,...vKe]),Ty=Lo({},[...n8,...FKe]),oj=function(Te,Ye,yt){return Ye.namespaceURI===Mn?Te==="svg":Ye.namespaceURI===mo?Te==="svg"&&(yt==="annotation-xml"||bp[yt]):!!yp[Te]},rj=function(Te,Ye,yt){return Ye.namespaceURI===Mn?Te==="math":Ye.namespaceURI===Qr?Te==="math"&&ua[yt]:!!Ty[Te]},sj=function(Te,Ye,yt){return Ye.namespaceURI===Qr&&!ua[yt]||Ye.namespaceURI===mo&&!bp[yt]?!1:!Ty[Te]&&(gp[Te]||!yp[Te])},aj=function(Te){let Ye=S(Te);(!Ye||!Ye.tagName)&&(Ye={namespaceURI:Ki,tagName:"template"});let yt=WF(Te.tagName),an=WF(Ye.tagName);return Xo[Te.namespaceURI]?Te.namespaceURI===Qr?oj(yt,Ye,an):Te.namespaceURI===mo?rj(yt,Ye,an):Te.namespaceURI===Mn?sj(yt,Ye,an):!!(Ps==="application/xhtml+xml"&&Xo[Te.namespaceURI]):!1},xp=function(Te){AF(t.removed,{element:Te});try{S(Te).removeChild(Te)}catch{if(f(Te),!S(Te))throw U_("a node selected for removal could not be detached from its tree and cannot be safely returned; refusing to sanitize in place")}},BR=function(Te,Ye,yt){try{Te.removeAttributeNode(Ye)}catch{try{Te.removeAttribute(yt)}catch{}}},zT=function(Te){HT(Te);let Ye=_(Te);if(Ye){let an=[];D_(Ye,Ln=>{AF(an,Ln)}),D_(an,Ln=>{try{f(Ln)}catch{}})}let yt=R(Te);if(yt)for(let an=yt.length-1;an>=0;--an){let Ln=yt[an],ai=Ln&&Ln.name;typeof ai=="string"&&BR(Te,Ln,ai)}},Wh=function(Te,Ye,yt){if(!yt)try{yt=Ye.getAttributeNode(Te)}catch{yt=null}AF(t.removed,{attribute:yt||null,from:Ye});try{yt?Ye.removeAttributeNode(yt):Ye.removeAttribute(Te)}catch{try{Ye.removeAttribute(Te)}catch{}}if(Te==="is")if(Hi||Gi)try{xp(Ye)}catch{}else try{Ye.setAttribute(Te,"")}catch{}},cj=function(Te){let Ye=R(Te);if(Ye)for(let yt=Ye.length-1;yt>=0;--yt){let an=Ye[yt],Ln=an&&an.name;typeof Ln!="string"||Be[si(Ln)]||BR(Te,an,Ln)}},HT=function(Te){let Ye=[Te];for(;Ye.length>0;){let yt=Ye.pop();L(yt)===Vu.element&&cj(yt);let Ln=_(yt);if(Ln)for(let ai=Ln.length-1;ai>=0;--ai)Ye.push(Ln[ai])}},zR=function(Te,Ye){return jt?Te==="patchsrc"?!0:Te==="for"&&Ye!=="label"&&Ye!=="output":!1},Tp=function(Te){if(!jt)return;let Ye=[Te];for(;Ye.length>0;){let yt=Ye.pop(),an=L(yt);if(an===Vu.processingInstruction||an===Vu.comment&&$c(Vpe,yt.data)){try{f(yt)}catch{}continue}if(an===Vu.element){let ai=yt,Er=si(F(yt));try{ai.hasAttribute&&ai.hasAttribute("patchsrc")&&ai.removeAttribute("patchsrc"),ai.hasAttribute&&ai.hasAttribute("for")&&zR("for",Er)&&ai.removeAttribute("for")}catch{}}let Ln=_(yt);if(Ln)for(let ai=Ln.length-1;ai>=0;--ai)Ye.push(Ln[ai])}},KT=function(Te){let Ye=null,yt=null;if(Si)Te=""+Te;else{let ai=bpe(Te,/^[\r\n\t ]+/);yt=ai&&ai[0]}Ps==="application/xhtml+xml"&&Ki===Mn&&(Te=''+Te+"");let an=I?X(Te):Te;if(Ki===Mn)try{Ye=new u().parseFromString(an,Ps)}catch{}if(!Ye||!Ye.documentElement){Ye=O.createDocument(Ki,"template",null);try{Ye.documentElement.innerHTML=wi?N:an}catch{}}let Ln=Ye.body||Ye.documentElement;return Te&&yt&&Ln.insertBefore(n.createTextNode(yt),Ln.childNodes[0]||null),Ki===Mn?K.call(Ye,st?"html":"body")[0]:st?Ye.documentElement:Ln},DA=function(Te){let Ye=A?A(Te):Te.ownerDocument;return w.call(Ye||Te,Te,c.SHOW_ELEMENT|c.SHOW_COMMENT|c.SHOW_TEXT|c.SHOW_PROCESSING_INSTRUCTION|c.SHOW_CDATA_SECTION,null)},HR=function(Te){return Te=GF(Te,$," "),Te=GF(Te,ee," "),Te=GF(Te,le," "),Te},_y=function(Te){var Ye;Te.normalize();let yt=A?A(Te):Te.ownerDocument,an=w.call(yt||Te,Te,c.SHOW_TEXT|c.SHOW_COMMENT|c.SHOW_CDATA_SECTION|c.SHOW_PROCESSING_INSTRUCTION,null),Ln=an.nextNode();for(;Ln;)Ln.data=HR(Ln.data),Ln=an.nextNode();let ai=(Ye=Te.querySelectorAll)===null||Ye===void 0?void 0:Ye.call(Te,"template");ai&&D_(ai,Er=>{oe(Er.content)&&_y(Er.content)})},de=function(Te){let Ye=E?E(Te):null;return typeof Ye!="string"||si(Ye)!=="form"?!1:typeof Te.nodeName!="string"||typeof Te.textContent!="string"||typeof Te.removeChild!="function"||Te.attributes!==R(Te)||typeof Te.removeAttribute!="function"||typeof Te.setAttribute!="function"||typeof Te.namespaceURI!="string"||typeof Te.insertBefore!="function"||typeof Te.hasChildNodes!="function"||Te.nodeType!==C(Te)||Te.childNodes!==_(Te)},oe=function(Te){if(!C||typeof Te!="object"||Te===null)return!1;try{return C(Te)===Vu.documentFragment}catch{return!1}},Re=function(Te){if(!C||typeof Te!="object"||Te===null)return!1;try{return typeof C(Te)=="number"}catch{return!1}};function Ve(Vt,Te,Ye){Vt.length!==0&&D_(Vt,yt=>{yt.call(t,Te,Ye,qo)})}let et=function(Te,Ye){return!!(jt&&Te.hasChildNodes()&&!Re(Te.firstElementChild)&&$c(Cpe,Te.textContent)&&$c(Cpe,Te.innerHTML)||jt&&Te.namespaceURI===Mn&&BKe[Ye]&&(Re(Te.firstElementChild)||typeof Te.textContent=="string"&&$c(zKe[Ye],Te.textContent))||Te.nodeType===Vu.processingInstruction||jt&&Te.nodeType===Vu.comment&&$c(Vpe,Te.data))},Ct=function(Te,Ye){if(Te instanceof RegExp)return $c(Te,Ye);if(Te instanceof Function){for(var yt=arguments.length,an=new Array(yt>2?yt-2:0),Ln=2;Ln=0;--Er){let ds=Te===yt?b(Ln[Er],!0):Ln[Er];an.insertBefore(ds,y(Te))}}}return xp(Te),!0},Gt=function(Te,Ye,yt,an){return Te.length===0?Ye:Ye===yt||Ye===an?Eu(Ye):Ye},Sn=function(Te,Ye){return Te===Ye||S(Te)!==null?!1:($i&&HT(Te),!0)},Kn=function(Te,Ye){if(Ve(H.beforeSanitizeElements,Te,null),Sn(Te,Ye))return!0;if(de(Te))return xp(Te),!0;let yt=si(F(Te));if(Fe=Gt(H.uponSanitizeElement,Fe,tt,Mi),Ve(H.uponSanitizeElement,Te,{tagName:yt,allowedTags:Fe}),Sn(Te,Ye))return!0;if(et(Te,yt))return xp(Te),!0;if(We[yt]||!(ct.tagCheck instanceof Function&&ct.tagCheck(yt))&&!Fe[yt]){let Ln=gt(Te,yt,Ye);return Ln===!1&&Ve(H.afterSanitizeElements,Te,null),Ln}if(L(Te)===Vu.element&&!aj(Te)||(yt==="noscript"||yt==="noembed"||yt==="noframes")&&$c(DKe,Te.innerHTML))return xp(Te),!0;if(ht&&Te.nodeType===Vu.text){let Ln=HR(Te.textContent);Te.textContent!==Ln&&(AF(t.removed,{element:Te.cloneNode()}),Te.textContent=Ln)}return Ve(H.afterSanitizeElements,Te,null),!1},xn=function(Te,Ye,yt){if(Ke[Ye]||zR(Ye,Te)||Zi&&(Ye==="id"||Ye==="name")&&(yt in n||yt in Gl))return!1;let an=Be[Ye]||ct.attributeCheck instanceof Function&&ct.attributeCheck(Ye,Te);return zt&&$c(_e,Ye)||Et&&$c(he,Ye)?!0:an?yi[Ye]||$c(Ae,GF(yt,ye,""))||(Ye==="src"||Ye==="xlink:href"||Ye==="href")&&Te!=="script"&&gpe(yt,"data:")===0&&Hs[Te]||ut&&!$c(Ze,GF(yt,ye,""))?!0:!yt:pr(Te)&&Ct(qe.tagNameCheck,Te)&&Ct(qe.attributeNameCheck,Ye,Te)||Ye==="is"&&qe.allowCustomizedBuiltInElements&&Ct(qe.tagNameCheck,yt)},Vr=Lo({},["annotation-xml","color-profile","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","missing-glyph"]),pr=function(Te){return!Vr[WF(Te)]&&$c(Ge,Te)},Ks=function(Te,Ye,yt,an){if(I&&typeof m=="object"&&typeof m.getAttributeType=="function"&&!yt)switch(m.getAttributeType(Te,Ye)){case"TrustedHTML":return X(an);case"TrustedScriptURL":return Y(an)}return an},Rc=function(Te,Ye,yt,an){try{yt?Te.setAttributeNS(yt,Ye,an):Te.setAttribute(Ye,an),de(Te)?xp(Te):ppe(t.removed)}catch{Wh(Ye,Te)}},Ll=function(Te){Ve(H.beforeSanitizeAttributes,Te,null);let Ye=Te.attributes;if(!Ye||de(Te))return;Be=Gt(H.uponSanitizeAttribute,Be,je,jn);let yt={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:Be,forceKeepAttr:void 0},an=Ye.length,Ln=si(Te.nodeName);for(;an--;){let ai=Ye[an],Er=ai.name,ds=ai.namespaceURI,Sd=ai.value,Zd=si(Er),lj=Sd,Wl=Er==="value"?lj:CKe(lj);if(yt.attrName=Zd,yt.attrValue=Wl,yt.keepAttr=!0,yt.forceKeepAttr=void 0,Ve(H.uponSanitizeAttribute,Te,yt),Wl=yt.attrValue,On&&(Zd==="id"||Zd==="name")&&gpe(Wl,rn)!==0&&(Wh(Er,Te,ai),Wl=rn+Wl),jt&&$c(/((--!?|])>)|<\/(style|script|title|xmp|textarea|noscript|iframe|noembed|noframes)/i,Wl)){Wh(Er,Te,ai);continue}if(Zd==="attributename"&&bpe(Wl,"href")){Wh(Er,Te,ai);continue}if(!yt.forceKeepAttr){if(!yt.keepAttr){Wh(Er,Te,ai);continue}if(!bt&&$c(OKe,Wl)){Wh(Er,Te,ai);continue}if(ht&&(Wl=HR(Wl)),!xn(Ln,Zd,Wl)){Wh(Er,Te,ai);continue}Wl=Ks(Ln,Zd,ds,Wl),Wl!==lj&&Rc(Te,Er,ds,Wl)}}Ve(H.afterSanitizeAttributes,Te,null)},_d=function(Te){let Ye=null,yt=DA(Te);for(Ve(H.beforeSanitizeShadowDOM,Te,null);Ye=yt.nextNode();)if(Ve(H.uponSanitizeShadowNode,Ye,null),Kn(Ye,Te),Ll(Ye),oe(Ye.content)&&_d(Ye.content),L(Ye)===Vu.element){let an=Z(Ye);oe(an)&&(J0(an),_d(an))}Ve(H.afterSanitizeShadowDOM,Te,null)},J0=function(Te){let Ye=[{node:Te,shadow:null}];for(;Ye.length>0;){let yt=Ye.pop();if(yt.shadow){_d(yt.shadow);continue}let an=yt.node,ai=L(an)===Vu.element,Er=_(an);if(Er)for(let ds=Er.length-1;ds>=0;--ds)Ye.push({node:Er[ds],shadow:null});if(ai){let ds=E?E(an):null;if(typeof ds=="string"&&si(ds)==="template"){let Sd=an.content;oe(Sd)&&Ye.push({node:Sd,shadow:null})}}if(ai){let ds=Z(an);oe(ds)&&Ye.push({node:null,shadow:ds},{node:ds,shadow:null})}}};return t.sanitize=function(Vt){let Te=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},Ye=null,yt=null,an=null,Ln=null;if(wi=!Vt,wi&&(Vt=""),typeof Vt!="string"&&!Re(Vt)&&(Vt=LKe(Vt),typeof Vt!="string"))throw U_("dirty is not a string, aborting");if(!t.isSupported)return Vt;pt?(Fe=Mi,Be=jn):va(Te),(H.uponSanitizeElement.length>0||H.uponSanitizeAttribute.length>0)&&(Fe=Eu(Fe)),H.uponSanitizeAttribute.length>0&&(Be=Eu(Be)),t.removed=[];let ai=$i&&typeof Vt!="string"&&Re(Vt);if(ai){Tp(Vt);let Sd=F(Vt);if(typeof Sd=="string"){let Zd=si(Sd);if(!Fe[Zd]||We[Zd])throw zT(Vt),U_("root node is forbidden and cannot be sanitized in-place")}if(de(Vt))throw zT(Vt),U_("root node is clobbered and cannot be sanitized in-place");try{J0(Vt)}catch(Zd){throw zT(Vt),Zd}}else if(Re(Vt))Ye=KT(""),yt=Ye.ownerDocument.importNode(Vt,!0),yt.nodeType===Vu.element&&yt.nodeName==="BODY"||yt.nodeName==="HTML"?Ye=yt:Ye.appendChild(yt),J0(yt);else{if(!Hi&&!ht&&!st&&Vt.indexOf("<")===-1)return I&&pi?X(Vt):Vt;if(Ye=KT(Vt),!Ye)return Hi?null:pi?N:""}Ye&&Si&&xp(Ye.firstChild);let Er=ai?Vt:Ye;try{let Sd=DA(Er);for(;an=Sd.nextNode();)Kn(an,Er),Ll(an),oe(an.content)&&_d(an.content)}catch(Sd){throw ai&&(zT(Vt),D_(t.removed,Zd=>{Zd.element&&HT(Zd.element)})),Sd}if(ai)return D_(t.removed,Sd=>{Sd.element&&HT(Sd.element)}),ht&&_y(Vt),Vt;if(Hi){if(ht&&_y(Ye),Gi)for(Ln=z.call(Ye.ownerDocument);Ye.firstChild;)Ln.appendChild(Ye.firstChild);else Ln=Ye;return(Be.shadowroot||Be.shadowrootmode)&&(Ln=te.call(i,Ln,!0)),Ln}let ds=st?Ye.outerHTML:Ye.innerHTML;return st&&Fe["!doctype"]&&Ye.ownerDocument&&Ye.ownerDocument.doctype&&Ye.ownerDocument.doctype.name&&$c(kKe,Ye.ownerDocument.doctype.name)&&(ds=" -`+ds),ht&&(ds=HR(ds)),I&&pi?X(ds):ds},t.setConfig=function(){let Vt=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};va(Vt),pt=!0,Mi=Fe,jn=Be},t.clearConfig=function(){qo=null,pt=!1,Mi=null,jn=null,I=g,N=""},t.isValidAttribute=function(Vt,Te,Ye){qo||va({});let yt=si(Vt),an=si(Te);return xn(yt,an,Ye)},t.addHook=function(Vt,Te){typeof Te=="function"&&Fd(H,Vt)&&AF(H[Vt],Te)},t.removeHook=function(Vt,Te){if(Fd(H,Vt)){if(Te!==void 0){let Ye=ZKe(H[Vt],Te);return Ye===-1?void 0:RKe(H[Vt],Ye,1)[0]}return ppe(H[Vt])}},t.removeHooks=function(Vt){Fd(H,Vt)&&(H[Vt]=[])},t.removeAllHooks=function(){H=Epe()},t}var vpe=Wpe();var JKe=0,a8={},c8=class e{constructor(t,n){let i,o=t;l(a8[o])?i=a8[o]:(i=JKe++,a8[o]=i),n=n??!1,this._id=i,this._html=t,this._showOnScreen=n,this._element=void 0}get html(){return this._html}get id(){return this._id}get showOnScreen(){return this._showOnScreen}set showOnScreen(t){this._showOnScreen=t}get element(){if(!l(this._element)){let t=vpe.sanitize(this._html),n=document.createElement("div");n.className="cesium-credit-wrapper",n._creditId=this._id,n.style.display="inline",n.innerHTML=t;let i=n.querySelectorAll("a");for(let o=0;o{u[m]=void 0});for(let m=r;m0||this._imageBasedLightingFactor.y>0}},shouldRegenerateShaders:{get:function(){return this._shouldRegenerateShaders}},specularEnvironmentCubeMap:{get:function(){return this._specularEnvironmentCubeMap}},useDefaultSphericalHarmonics:{get:function(){return this._useDefaultSphericalHarmonics}},useDefaultSpecularMaps:{get:function(){return this._useDefaultSpecularMaps}},useSpecularEnvironmentMaps:{get:function(){return l(this._specularEnvironmentCubeMap)&&this._specularEnvironmentCubeMap.ready||this._useDefaultSpecularMaps}}});function QKe(e,t){if($h.isSupported(t)){if(e._specularEnvironmentCubeMap=e._specularEnvironmentCubeMap&&e._specularEnvironmentCubeMap.destroy(),l(e._specularEnvironmentMaps)){let n=new $h(e._specularEnvironmentMaps);e._specularEnvironmentCubeMap=n,e._removeErrorListener=n.errorEvent.addEventListener(i=>{console.error(`Error loading specularEnvironmentMaps: ${i}`)})}e._shouldRegenerateShaders=!0}}vF.prototype.update=function(e){if(e.frameNumber===this._previousFrameNumber&&e.context===this._previousFrameContext)return;this._previousFrameNumber=e.frameNumber;let t=this._previousFrameContext=e.context;e.brdfLutGenerator.update(e),this._shouldRegenerateShaders=!1;let n=this._imageBasedLightingFactor,i=this._previousImageBasedLightingFactor;k.equals(n,i)||(this._shouldRegenerateShaders=n.x>0&&i.x===0||n.x===0&&i.x>0,this._shouldRegenerateShaders=this._shouldRegenerateShaders||n.y>0&&i.y===0||n.y===0&&i.y>0,this._previousImageBasedLightingFactor=k.clone(this._imageBasedLightingFactor,this._previousImageBasedLightingFactor)),this._previousSphericalHarmonicCoefficients!==this._sphericalHarmonicCoefficients&&(this._shouldRegenerateShaders=this._shouldRegenerateShaders||l(this._previousSphericalHarmonicCoefficients)!==l(this._sphericalHarmonicCoefficients),this._previousSphericalHarmonicCoefficients=this._sphericalHarmonicCoefficients),this._shouldRegenerateShaders=this._shouldRegenerateShaders||this._previousSpecularEnvironmentMapLoaded!==this._specularEnvironmentMapLoaded,this._previousSpecularEnvironmentMapLoaded=this._specularEnvironmentMapLoaded,this._specularEnvironmentCubeMapDirty&&(QKe(this,t),this._specularEnvironmentCubeMapDirty=!1),l(this._specularEnvironmentCubeMap)&&(this._specularEnvironmentCubeMap.update(e),this._specularEnvironmentCubeMap.ready&&(this._specularEnvironmentMapLoaded=!0));let o=!l(this._specularEnvironmentCubeMap)&&l(e.specularEnvironmentMaps)&&!this._useDefaultSpecularMaps,r=!l(e.specularEnvironmentMaps)&&this._useDefaultSpecularMaps,s=!l(this._sphericalHarmonicCoefficients)&&l(e.sphericalHarmonicCoefficients)&&!this._useDefaultSphericalHarmonics,a=!l(e.sphericalHarmonicCoefficients)&&this._useDefaultSphericalHarmonics;this._shouldRegenerateShaders=this._shouldRegenerateShaders||o||r||s||a,this._useDefaultSpecularMaps=!l(this._specularEnvironmentCubeMap)&&l(e.specularEnvironmentMaps),this._useDefaultSphericalHarmonics=!l(this._sphericalHarmonicCoefficients)&&l(e.sphericalHarmonicCoefficients)};vF.prototype.isDestroyed=function(){return!1};vF.prototype.destroy=function(){return this._specularEnvironmentCubeMap=this._specularEnvironmentCubeMap&&this._specularEnvironmentCubeMap.destroy(),this._removeErrorListener=this._removeErrorListener&&this._removeErrorListener(),ue(this)};var B_=vF;var eGn=x(T(),1),u8=x(gu(),1);var zAn=x(T(),1);var d8,Fpe="eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJub25jZSI6ImwwendUTkl3UVk5Uk5XdEkiLCJqdGkiOiJjZGFkZDZlNC0wMDI5LTQ5OTMtYWIwMC01ZWY4ZDVlNTBhMzYiLCJpZCI6MjU5LCJzdWIiOiJDZXNpdW1KUyIsImlzcyI6Imh0dHBzOi8vYXBpLmNlc2l1bS5jb20iLCJhdWQiOiIxLjE0NSBSZWxlYXNlIC0gRGVsZXRlIG9uIE5vdmVtYmVyIDEsIDIwMjYiLCJpYXQiOjE3ODc2MzQ3NzV9.3SPieoGxEZ22pnWLETAIFZveR0xXTzvOh8G4NYTxDSo",bO={};bO.defaultAccessToken=Fpe;bO.defaultServer=new ve({url:"https://api.cesium.com/"});bO.getDefaultTokenCredit=function(e){if(e===Fpe){if(!l(d8)){let t=` This application is using Cesium's default ion access token. Please assign Cesium.Ion.defaultAccessToken with an access token from your ion account before making any Cesium API calls. You can sign up for a free ion account at https://cesium.com.`;d8=new Lt(t,!0)}return d8}};var Id=bO;function el(e,t){let n,i=e.externalType,o=l(i);if(!o)n={url:e.url,retryAttempts:1,retryCallback:qKe};else if(i==="3DTILES"||i==="STK_TERRAIN_SERVER")n={url:e.options.url};else throw new ae("Ion.createResource does not support external imagery assets; use IonImageryProvider instead.");ve.call(this,n),this._ionEndpoint=e,this._ionEndpointDomain=o?void 0:new u8.default(e.url).authority(),this._ionEndpointResource=t,this._ionRoot=void 0,this._pendingPromise=void 0,this._credits=void 0,this._isExternal=o,this.refreshCallback=void 0}l(Object.create)&&(el.prototype=Object.create(ve.prototype),el.prototype.constructor=el);el.fromAssetId=function(e,t){let n=el._createEndpointResource(e,t);return n.fetchJson().then(function(i){return new el(i,n)})};Object.defineProperties(el.prototype,{credits:{get:function(){return l(this._ionRoot)?this._ionRoot.credits:l(this._credits)?this._credits:(this._credits=el.getCreditsFromEndpoint(this._ionEndpoint,this._ionEndpointResource),this._credits)}}});el.getCreditsFromEndpoint=function(e,t){let n=e.attributions.map(Lt.getIonCredit),i=Id.getDefaultTokenCredit(t.queryParameters.access_token);return l(i)&&n.push(Lt.clone(i)),n};el.prototype.clone=function(e){let t=this._ionRoot??this;return l(e)||(e=Object.create(el.prototype),ve.call(e,{url:this._url,parseUrl:!1}),e._ionEndpoint=t._ionEndpoint,e._ionEndpointDomain=t._ionEndpointDomain,e._ionEndpointResource=t._ionEndpointResource,e._ionRoot=void 0,e._pendingPromise=void 0,e._credits=void 0,e._isExternal=this._isExternal,e.refreshCallback=void 0),e=ve.prototype.clone.call(this,e),e._ionRoot=t,e._isExternal=this._isExternal,e};el.prototype.fetchImage=function(e){if(!this._isExternal){let t=e;e={preferBlob:!0},l(t)&&(e.flipY=t.flipY,e.preferImageBitmap=t.preferImageBitmap)}return ve.prototype.fetchImage.call(this,e)};el.prototype._makeRequest=function(e){return this._isExternal||new u8.default(this.url).authority()!==this._ionEndpointDomain?ve.prototype._makeRequest.call(this,e):(e.headers=m8(e.headers),e.headers.Authorization=`Bearer ${this._ionEndpoint.accessToken}`,ve.prototype._makeRequest.call(this,e))};el._createEndpointResource=function(e,t){t=t??B.EMPTY_OBJECT;let n=t.server??Id.defaultServer,i=t.accessToken??Id.defaultAccessToken;n=ve.createIfNeeded(n);let o={url:`v1/assets/${e}/endpoint`};return l(i)&&(o.queryParameters={access_token:i}),l(t.queryParameters)&&(o.queryParameters={...o.queryParameters,...t.queryParameters}),o.headers=m8(o.headers),n.getDerivedResource(o)};function m8(e={}){return e["X-Cesium-Client"]="CesiumJS",typeof CESIUM_VERSION<"u"&&(e["X-Cesium-Client-Version"]=CESIUM_VERSION),e}el._addClientHeaders=m8;function qKe(e,t){let n=e._ionRoot??e,i=n._ionEndpointResource,o=typeof Image<"u";return!l(t)||t.statusCode!==401&&!(o&&t.target instanceof Image)?Promise.resolve(!1):(l(n._pendingPromise)||(n._pendingPromise=i.fetchJson().then(function(r){let s=e.refreshCallback??n.refreshCallback;return l(s)&&s(n,r),n._ionEndpoint=r,n._ionEndpoint}).finally(function(r){return n._pendingPromise=void 0,r})),n._pendingPromise.then(function(r){return e._ionEndpoint=r,!0}))}var Ur=el;var nGn=x(T(),1);function Fp(e){e=e??0,this._array=new Array(e),this._length=e}Object.defineProperties(Fp.prototype,{length:{get:function(){return this._length},set:function(e){let t=this._array,n=this._length;if(et.length&&(t.length=e);this._length=e}},values:{get:function(){return this._array}}});Fp.prototype.get=function(e){return this._array[e]};Fp.prototype.set=function(e,t){e>=this._length&&(this.length=e+1),this._array[e]=t};Fp.prototype.peek=function(){return this._array[this._length-1]};Fp.prototype.push=function(e){let t=this.length++;this._array[t]=e};Fp.prototype.pop=function(){if(this._length===0)return;let e=this._array[this._length-1];return--this.length,e};Fp.prototype.reserve=function(e){e>this._array.length&&(this._array.length=e)};Fp.prototype.resize=function(e){this.length=e};Fp.prototype.trim=function(e){e=e??this._length,this._array.length=e};var Jl=Fp;var sGn=x(T(),1);var Ip={X:0,Y:1,Z:2};Ip.Y_UP_TO_Z_UP=P.fromRotationTranslation(q.fromArray([1,0,0,0,0,1,0,-1,0]));Ip.Z_UP_TO_Y_UP=P.fromRotationTranslation(q.fromArray([1,0,0,0,0,-1,0,1,0]));Ip.X_UP_TO_Z_UP=P.fromRotationTranslation(q.fromArray([0,0,1,0,1,0,-1,0,0]));Ip.Z_UP_TO_X_UP=P.fromRotationTranslation(q.fromArray([0,0,-1,0,1,0,1,0,0]));Ip.X_UP_TO_Y_UP=P.fromRotationTranslation(q.fromArray([0,1,0,-1,0,0,0,0,1]));Ip.Y_UP_TO_X_UP=P.fromRotationTranslation(q.fromArray([0,-1,0,1,0,0,0,0,1]));Ip.fromName=function(e){return Ip[e]};Object.freeze(Ip);var Bi=Ip;var R1i=x(T(),1);var lGn=x(T(),1);function Ipe(e){e=e??B.EMPTY_OBJECT,this._metadata=e.metadata}Object.defineProperties(Ipe.prototype,{metadata:{get:function(){return this._metadata}}});var z_=Ipe;var n_i=x(T(),1);var SGn=x(T(),1);var pGn=x(T(),1);var mGn=x(T(),1);function Ky(e,t,n){return t=t??0,n=n??e.byteLength-t,e=e.subarray(t,t+n),Ky.decode(e)}Ky.decodeWithTextDecoder=function(e){return new TextDecoder("utf-8").decode(e)};Ky.decodeWithFromCharCode=function(e){let t="",n=$Ke(e),i=n.length;for(let o=0;o>10)+55296,(r&1023)+56320))}return t};function FF(e,t,n){return t<=e&&e<=n}function $Ke(e){let t=0,n=0,i=0,o=128,r=191,s=[],a=e.length;for(let c=0;c0){let o=Math.min(t,wt.maximumTextureSize),r=Math.ceil(t/wt.maximumTextureSize),s=1/o,a=s*.5,c=1/r,d=c*.5;n=new k(o,r),i=new ce(s,a,c,d)}this._translucentFeaturesLength=0,this._featuresLength=t,this._textureDimensions=n,this._textureStep=i,this._owner=e.owner,this._statistics=e.statistics,this._colorChangedCallback=e.colorChangedCallback}Object.defineProperties(tl.prototype,{translucentFeaturesLength:{get:function(){return this._translucentFeaturesLength}},byteLength:{get:function(){let e=0;return l(this._pickTexture)&&(e+=this._pickTexture.sizeInBytes),l(this._batchTexture)&&(e+=this._batchTexture.sizeInBytes),e}},textureDimensions:{get:function(){return this._textureDimensions}},textureStep:{get:function(){return this._textureStep}},batchTexture:{get:function(){return this._batchTexture}},defaultTexture:{get:function(){return this._defaultTexture}},pickTexture:{get:function(){return this._pickTexture}}});tl.DEFAULT_COLOR_VALUE=U.WHITE;tl.DEFAULT_SHOW_VALUE=!0;function Ppe(e){let t=e._textureDimensions;return t.x*t.y*4}function Xpe(e){if(!l(e._batchValues)){let t=Ppe(e),n=new Uint8Array(t).fill(255);e._batchValues=n}return e._batchValues}function Npe(e){if(!l(e._showAlphaProperties)){let t=2*e._featuresLength,n=new Uint8Array(t).fill(255);e._showAlphaProperties=n}return e._showAlphaProperties}tl.prototype.setShow=function(e,t){if(t&&!l(this._showAlphaProperties))return;let n=Npe(this),i=e*2,o=t?255:0;if(n[i]!==o){n[i]=o;let r=Xpe(this),s=e*4+3;r[s]=t?n[i+1]:0,this._batchValuesDirty=!0}};tl.prototype.setAllShow=function(e){let t=this._featuresLength;for(let n=0;n0){let i=e._pickIds,o=Ppe(e),r=new Uint8Array(o),s=e._owner,a=e._statistics;for(let c=0;c0;){if(t=u.pop(),c[t]===d)continue;c[t]=d;let m=n(e,t);if(l(m))return m;let p=o[t],b=s[t];for(let f=0;f0?(s="",e&&(s+=`uniform bool tile_translucentCommand; -`),s+=`uniform sampler2D tile_batchTexture; -out vec4 tile_featureColor; -out vec2 tile_featureSt; -void main() +`;function yb(e){e=e??B.EMPTY_OBJECT;let t=e.translucent??!0,n=e.closed??!1,i=e.flat??!1,o=i?q2:Q2,r=i?S_:j2,s=i?yb.FLAT_VERTEX_FORMAT:yb.VERTEX_FORMAT;this.material=void 0,this.translucent=t,this._vertexShaderSource=e.vertexShaderSource??o,this._fragmentShaderSource=e.fragmentShaderSource??r,this._renderState=Go.getDefaultRenderState(t,n,e.renderState),this._closed=n,this._vertexFormat=s,this._flat=i,this._faceForward=e.faceForward??!n}Object.defineProperties(yb.prototype,{vertexShaderSource:{get:function(){return this._vertexShaderSource}},fragmentShaderSource:{get:function(){return this._fragmentShaderSource}},renderState:{get:function(){return this._renderState}},closed:{get:function(){return this._closed}},vertexFormat:{get:function(){return this._vertexFormat}},flat:{get:function(){return this._flat}},faceForward:{get:function(){return this._faceForward}}});yb.VERTEX_FORMAT=Me.POSITION_AND_NORMAL;yb.FLAT_VERTEX_FORMAT=Me.POSITION_ONLY;yb.prototype.getFragmentShaderSource=Go.prototype.getFragmentShaderSource;yb.prototype.isTranslucent=Go.prototype.isTranslucent;yb.prototype.getRenderState=Go.prototype.getRenderState;var Tn=yb;var JTn=x(T(),1);function Gm(e,t,n){this._projectionExtentDefines={eastMostYhighDefine:"",eastMostYlowDefine:"",westMostYhighDefine:"",westMostYlowDefine:""};let i=new HQ;i.requiresTextureCoordinates=e,i.requiresEC=!n.flat;let o=new HQ;if(o.requiresTextureCoordinates=e,n instanceof Tn)i.requiresNormalEC=!n.flat;else{let r=`${n.material.shaderSource} +${n.fragmentShaderSource}`;i.normalEC=r.indexOf("materialInput.normalEC")!==-1||r.indexOf("czm_getDefaultMaterial")!==-1,i.positionToEyeEC=r.indexOf("materialInput.positionToEyeEC")!==-1,i.tangentToEyeMatrix=r.indexOf("materialInput.tangentToEyeMatrix")!==-1,i.st=r.indexOf("materialInput.st")!==-1}this._colorShaderDependencies=i,this._pickShaderDependencies=o,this._appearance=n,this._extentsCulling=e,this._planarExtents=t}Gm.prototype.createFragmentShader=function(e){let t=this._appearance,n=this._colorShaderDependencies,i=[];!e&&!this._planarExtents&&i.push("SPHERICAL"),n.requiresEC&&i.push("REQUIRES_EC"),n.requiresWC&&i.push("REQUIRES_WC"),n.requiresTextureCoordinates&&i.push("TEXTURE_COORDINATES"),this._extentsCulling&&i.push("CULL_FRAGMENTS"),n.requiresNormalEC&&i.push("NORMAL_EC"),t instanceof Tn&&i.push("PER_INSTANCE_COLOR"),n.normalEC&&i.push("USES_NORMAL_EC"),n.positionToEyeEC&&i.push("USES_POSITION_TO_EYE_EC"),n.tangentToEyeMatrix&&i.push("USES_TANGENT_TO_EYE"),n.st&&i.push("USES_ST"),t.flat&&i.push("FLAT");let o="";return t instanceof Tn||(o=t.material.shaderSource),new Je({defines:i,sources:[o,S1]})};Gm.prototype.createPickFragmentShader=function(e){let t=this._pickShaderDependencies,n=["PICK"];return!e&&!this._planarExtents&&n.push("SPHERICAL"),t.requiresEC&&n.push("REQUIRES_EC"),t.requiresWC&&n.push("REQUIRES_WC"),t.requiresTextureCoordinates&&n.push("TEXTURE_COORDINATES"),this._extentsCulling&&n.push("CULL_FRAGMENTS"),new Je({defines:n,sources:[S1],pickColorQualifier:"in"})};Gm.prototype.createVertexShader=function(e,t,n,i){return Yfe(this._colorShaderDependencies,this._planarExtents,n,e,t,this._appearance,i,this._projectionExtentDefines)};Gm.prototype.createPickVertexShader=function(e,t,n,i){return Yfe(this._pickShaderDependencies,this._planarExtents,n,e,t,void 0,i,this._projectionExtentDefines)};var Wfe=new h,vfe=new pe,Ffe={high:0,low:0};function Yfe(e,t,n,i,o,r,s,a){let c=i.slice();if(a.eastMostYhighDefine===""){let d=vfe;d.longitude=W.PI,d.latitude=0,d.height=0;let u=s.project(d,Wfe),m=An.encode(u.x,Ffe);a.eastMostYhighDefine=`EAST_MOST_X_HIGH ${m.high.toFixed(`${m.high}`.length+1)}`,a.eastMostYlowDefine=`EAST_MOST_X_LOW ${m.low.toFixed(`${m.low}`.length+1)}`;let p=vfe;p.longitude=-W.PI,p.latitude=0,p.height=0;let b=s.project(p,Wfe);m=An.encode(b.x,Ffe),a.westMostYhighDefine=`WEST_MOST_X_HIGH ${m.high.toFixed(`${m.high}`.length+1)}`,a.westMostYlowDefine=`WEST_MOST_X_LOW ${m.low.toFixed(`${m.low}`.length+1)}`}return n&&(c.push(a.eastMostYhighDefine),c.push(a.eastMostYlowDefine),c.push(a.westMostYhighDefine),c.push(a.westMostYlowDefine)),l(r)&&r instanceof Tn&&c.push("PER_INSTANCE_COLOR"),e.requiresTextureCoordinates&&(c.push("TEXTURE_COORDINATES"),t||n||c.push("SPHERICAL"),n&&c.push("COLUMBUS_VIEW_2D")),new Je({defines:c,sources:[o]})}function HQ(){this._requiresEC=!1,this._requiresWC=!1,this._requiresNormalEC=!1,this._requiresTextureCoordinates=!1,this._usesNormalEC=!1,this._usesPositionToEyeEC=!1,this._usesTangentToEyeMat=!1,this._usesSt=!1}Object.defineProperties(HQ.prototype,{requiresEC:{get:function(){return this._requiresEC},set:function(e){this._requiresEC=e||this._requiresEC}},requiresWC:{get:function(){return this._requiresWC},set:function(e){this._requiresWC=e||this._requiresWC,this.requiresEC=this._requiresWC}},requiresNormalEC:{get:function(){return this._requiresNormalEC},set:function(e){this._requiresNormalEC=e||this._requiresNormalEC,this.requiresEC=this._requiresNormalEC}},requiresTextureCoordinates:{get:function(){return this._requiresTextureCoordinates},set:function(e){this._requiresTextureCoordinates=e||this._requiresTextureCoordinates,this.requiresWC=this._requiresTextureCoordinates}},normalEC:{set:function(e){this.requiresNormalEC=e,this._usesNormalEC=e},get:function(){return this._usesNormalEC}},tangentToEyeMatrix:{set:function(e){this.requiresWC=e,this.requiresNormalEC=e,this._usesTangentToEyeMat=e},get:function(){return this._usesTangentToEyeMat}},positionToEyeEC:{set:function(e){this.requiresEC=e,this._usesPositionToEyeEC=e},get:function(){return this._usesPositionToEyeEC}},st:{set:function(e){this.requiresTextureCoordinates=e,this._usesSt=e},get:function(){return this._usesSt}}});function Ife(e,t,n){return Math.abs((t.y-e.y)*n.x-(t.x-e.x)*n.y+t.x*e.y-t.y*e.x)/k.distance(t,e)}var Cze=[new k,new k,new k,new k];function Mfe(e,t){let n=Cze,i=k.unpack(t,0,n[0]),o=k.unpack(t,2,n[1]),r=k.unpack(t,4,n[2]);e.uMaxVmax=new jc({componentDatatype:J.FLOAT,componentsPerAttribute:4,normalize:!1,value:[o.x,o.y,r.x,r.y]});let s=1/Ife(i,o,r),a=1/Ife(i,r,o);e.uvMinAndExtents=new jc({componentDatatype:J.FLOAT,componentsPerAttribute:4,normalize:!1,value:[i.x,i.y,s,a]})}var wfe=new pe,kfe=new h,Vze=new h,Eze=new h,hO={high:0,low:0};function Ufe(e,t,n){let i=wfe;i.height=0,i.longitude=e.west,i.latitude=e.south;let o=t.project(i,kfe);i.latitude=e.north;let r=t.project(i,Vze);i.longitude=e.east,i.latitude=e.south;let s=t.project(i,Eze),a=[0,0,0,0],c=[0,0,0,0],d=An.encode(o.x,hO);a[0]=d.high,c[0]=d.low,d=An.encode(o.y,hO),a[1]=d.high,c[1]=d.low,d=An.encode(r.y,hO),a[2]=d.high,c[2]=d.low,d=An.encode(s.x,hO),a[3]=d.high,c[3]=d.low,n.planes2D_HIGH=new jc({componentDatatype:J.FLOAT,componentsPerAttribute:4,normalize:!1,value:a}),n.planes2D_LOW=new jc({componentDatatype:J.FLOAT,componentsPerAttribute:4,normalize:!1,value:c})}var Aze=new P,Gze=new P,Pfe=new h,Lze=new pe,Wze=[new pe,new pe,new pe,new pe,new pe,new pe,new pe,new pe];function vze(e,t,n,i,o,r){let s=re.center(e,Lze);s.height=n;let a=pe.toCartesian(s,t,Pfe),c=_t.eastNorthUpToFixedFrame(a,t,Aze),d=P.inverse(c,Gze),u=e.west,m=e.east,p=e.north,b=e.south,f=Wze;f[0].latitude=b,f[0].longitude=u,f[1].latitude=p,f[1].longitude=u,f[2].latitude=p,f[2].longitude=m,f[3].latitude=b,f[3].longitude=m;let y=(u+m)*.5,_=(p+b)*.5;f[4].latitude=b,f[4].longitude=y,f[5].latitude=p,f[5].longitude=y,f[6].latitude=_,f[6].longitude=u,f[7].latitude=_,f[7].longitude=m;let S=Number.POSITIVE_INFINITY,Z=Number.NEGATIVE_INFINITY,R=Number.POSITIVE_INFINITY,C=Number.NEGATIVE_INFINITY;for(let F=0;F<8;F++){f[F].height=n;let I=pe.toCartesian(f[F],t,Pfe);P.multiplyByPoint(d,I,I),I.z=0,S=Math.min(S,I.x),Z=Math.max(Z,I.x),R=Math.min(R,I.y),C=Math.max(C,I.y)}let E=i;E.x=S,E.y=R,E.z=0,P.multiplyByPoint(c,E,E);let A=o;A.x=Z,A.y=R,A.z=0,P.multiplyByPoint(c,A,A),h.subtract(A,E,o);let L=r;L.x=S,L.y=C,L.z=0,P.multiplyByPoint(c,L,L),h.subtract(L,E,r)}var Fze=new h,Ize=new h,Pze=new An;Gm.getPlanarTextureCoordinateAttributes=function(e,t,n,i,o){let r=kfe,s=Fze,a=Ize;vze(e,n,o??0,r,s,a);let c={};Mfe(c,t);let d=An.fromCartesian(r,Pze);return c.southWest_HIGH=new jc({componentDatatype:J.FLOAT,componentsPerAttribute:3,normalize:!1,value:h.pack(d.high,[0,0,0])}),c.southWest_LOW=new jc({componentDatatype:J.FLOAT,componentsPerAttribute:3,normalize:!1,value:h.pack(d.low,[0,0,0])}),c.eastward=new jc({componentDatatype:J.FLOAT,componentsPerAttribute:3,normalize:!1,value:h.pack(s,[0,0,0])}),c.northward=new jc({componentDatatype:J.FLOAT,componentsPerAttribute:3,normalize:!1,value:h.pack(a,[0,0,0])}),Ufe(e,i,c),c};var Xze=new h;function Xfe(e,t,n,i){let o=wfe;o.latitude=e,o.longitude=t,o.height=0;let r=pe.toCartesian(o,n,Xze),s=Math.sqrt(r.x*r.x+r.y*r.y),a=W.fastApproximateAtan2(s,r.z),c=W.fastApproximateAtan2(r.x,r.y);return i.x=a,i.y=c,i}var Nfe=new k;Gm.getSphericalExtentGeometryInstanceAttributes=function(e,t,n,i){let o=Xfe(e.south,e.west,n,Nfe),r=o.x,s=o.y,a=Xfe(e.north,e.east,n,Nfe),c=a.x,d=a.y,u=0;s>d&&(u=W.PI-s,s=-W.PI,d+=u),r-=W.EPSILON5,s-=W.EPSILON5,c+=W.EPSILON5,d+=W.EPSILON5;let m=1/(d-s),p=1/(c-r),b={sphericalExtents:new jc({componentDatatype:J.FLOAT,componentsPerAttribute:4,normalize:!1,value:[r,s,p,m]}),longitudeRotation:new jc({componentDatatype:J.FLOAT,componentsPerAttribute:1,normalize:!1,value:[u]})};return Mfe(b,t),Ufe(e,i,b),b};Gm.hasAttributesForTextureCoordinatePlanes=function(e){return l(e.southWest_HIGH)&&l(e.southWest_LOW)&&l(e.northward)&&l(e.eastward)&&l(e.planes2D_HIGH)&&l(e.planes2D_LOW)&&l(e.uMaxVmax)&&l(e.uvMinAndExtents)};Gm.hasAttributesForSphericalExtents=function(e){return l(e.sphericalExtents)&&l(e.longitudeRotation)&&l(e.planes2D_HIGH)&&l(e.planes2D_LOW)&&l(e.uMaxVmax)&&l(e.uvMinAndExtents)};function Nze(e){return Math.max(e.width,e.height)>Gm.MAX_WIDTH_FOR_PLANAR_EXTENTS}Gm.shouldUseSphericalCoordinates=function(e){return Nze(e)};Gm.MAX_WIDTH_FOR_PLANAR_EXTENTS=W.toRadians(1);var Zu=Gm;function E_(e){e=e??B.EMPTY_OBJECT;let t=e.geometryInstances;this.geometryInstances=t,this.show=e.show??!0,this.classificationType=e.classificationType??ti.BOTH,this.debugShowBoundingVolume=e.debugShowBoundingVolume??!1,this.debugShowShadowVolume=e.debugShowShadowVolume??!1,this._debugShowShadowVolume=!1,this._extruded=e._extruded??!1,this._uniformMap=e._uniformMap,this._sp=void 0,this._spStencil=void 0,this._spPick=void 0,this._spColor=void 0,this._spPick2D=void 0,this._spColor2D=void 0,this._rsStencilDepthPass=void 0,this._rsStencilDepthPass3DTiles=void 0,this._rsColorPass=void 0,this._rsPickPass=void 0,this._commandsIgnoreShow=[],this._ready=!1,this._primitive=void 0,this._pickPrimitive=e._pickPrimitive,this._hasSphericalExtentsAttribute=!1,this._hasPlanarExtentsAttributes=!1,this._hasPerColorAttribute=!1,this.appearance=e.appearance,this._createBoundingVolumeFunction=e._createBoundingVolumeFunction,this._updateAndQueueCommandsFunction=e._updateAndQueueCommandsFunction,this._usePickOffsets=!1,this._primitiveOptions={geometryInstances:void 0,appearance:void 0,vertexCacheOptimize:e.vertexCacheOptimize??!1,interleave:e.interleave??!1,releaseGeometryInstances:e.releaseGeometryInstances??!0,allowPicking:e.allowPicking??!0,asynchronous:e.asynchronous??!0,compressVertices:e.compressVertices??!0,_createBoundingVolumeFunction:void 0,_createRenderStatesFunction:void 0,_createShaderProgramFunction:void 0,_createCommandsFunction:void 0,_updateAndQueueCommandsFunction:void 0,_createPickOffsets:!0}}Object.defineProperties(E_.prototype,{vertexCacheOptimize:{get:function(){return this._primitiveOptions.vertexCacheOptimize}},interleave:{get:function(){return this._primitiveOptions.interleave}},releaseGeometryInstances:{get:function(){return this._primitiveOptions.releaseGeometryInstances}},allowPicking:{get:function(){return this._primitiveOptions.allowPicking}},asynchronous:{get:function(){return this._primitiveOptions.asynchronous}},compressVertices:{get:function(){return this._primitiveOptions.compressVertices}},ready:{get:function(){return this._ready}},_needs2DShader:{get:function(){return this._hasPlanarExtentsAttributes||this._hasSphericalExtentsAttribute}}});E_.isSupported=function(e){return e.context.stencilBuffer};function A1(e,t){let n=t?ni.EQUAL:ni.ALWAYS;return{colorMask:{red:!1,green:!1,blue:!1,alpha:!1},stencilTest:{enabled:e,frontFunction:n,frontOperation:{fail:Ft.KEEP,zFail:Ft.DECREMENT_WRAP,zPass:Ft.KEEP},backFunction:n,backOperation:{fail:Ft.KEEP,zFail:Ft.INCREMENT_WRAP,zPass:Ft.KEEP},reference:Jt.CESIUM_3D_TILE_MASK,mask:Jt.CESIUM_3D_TILE_MASK},stencilMask:Jt.CLASSIFICATION_MASK,depthTest:{enabled:!0,func:sc.LESS_OR_EQUAL},depthMask:!1}}function JQ(e){return{stencilTest:{enabled:e,frontFunction:ni.NOT_EQUAL,frontOperation:{fail:Ft.ZERO,zFail:Ft.ZERO,zPass:Ft.ZERO},backFunction:ni.NOT_EQUAL,backOperation:{fail:Ft.ZERO,zFail:Ft.ZERO,zPass:Ft.ZERO},reference:0,mask:Jt.CLASSIFICATION_MASK},stencilMask:Jt.CLASSIFICATION_MASK,depthTest:{enabled:!1},depthMask:!1,blending:on.PRE_MULTIPLIED_ALPHA_BLEND}}var Yze={stencilTest:{enabled:!0,frontFunction:ni.NOT_EQUAL,frontOperation:{fail:Ft.ZERO,zFail:Ft.ZERO,zPass:Ft.ZERO},backFunction:ni.NOT_EQUAL,backOperation:{fail:Ft.ZERO,zFail:Ft.ZERO,zPass:Ft.ZERO},reference:0,mask:Jt.CLASSIFICATION_MASK},stencilMask:Jt.CLASSIFICATION_MASK,depthTest:{enabled:!1},depthMask:!1};function Mze(e,t,n,i){if(l(e._rsStencilDepthPass))return;let o=!e.debugShowShadowVolume;e._rsStencilDepthPass=ze.fromCache(A1(o,!1)),e._rsStencilDepthPass3DTiles=ze.fromCache(A1(o,!0)),e._rsColorPass=ze.fromCache(JQ(o,!1)),e._rsPickPass=ze.fromCache(Yze)}function wze(e,t){if(!e.compressVertices)return t;if(t.search(/in\s+vec3\s+extrudeDirection;/g)!==-1){let n="compressedAttributes",i=`in vec2 ${n};`,o=`vec3 extrudeDirection; +`,r=` extrudeDirection = czm_octDecode(${n}, 65535.0); +`,s=t;s=s.replace(/in\s+vec3\s+extrudeDirection;/g,""),s=Je.replaceMain(s,"czm_non_compressed_main");let a=`void main() { - vec2 st = computeSt(${t}); - vec4 featureProperties = texture(tile_batchTexture, st); - tile_color(featureProperties); - float show = ceil(featureProperties.a); - gl_Position *= show; -`,e&&(s+=` bool isStyleTranslucent = (featureProperties.a != 1.0); - if (czm_pass == czm_passTranslucent) - { - if (!isStyleTranslucent && !tile_translucentCommand) - { - gl_Position *= 0.0; - } - } - else - { - if (isStyleTranslucent) - { - gl_Position *= 0.0; - } - } -`),s+=` tile_featureColor = featureProperties; - tile_featureSt = st; -}`):s=`out vec2 tile_featureSt; +${r} czm_non_compressed_main(); +}`;return[i,o,s,a].join(` +`)}}function kze(e,t){let n=t.context,i=e._primitive,o=r2;o=e._primitive._batchTable.getVertexShaderCallback()(o),o=In._appendDistanceDisplayConditionToShader(i,o),o=In._modifyShaderPosition(e,o,t.scene3DOnly),o=In._updateColorAttribute(i,o);let r=e._hasPlanarExtentsAttributes,s=r||e._hasSphericalExtentsAttribute;e._extruded&&(o=wze(i,o));let a=e._extruded?"EXTRUDED_GEOMETRY":"",c=new Je({defines:[a],sources:[o]}),d=new Je({sources:[Yy]}),u=e._primitive._attributeLocations,m=new Zu(s,r,e.appearance);if(e._spStencil=tn.replaceCache({context:n,shaderProgram:e._spStencil,vertexShaderSource:c,fragmentShaderSource:d,attributeLocations:u}),e._primitive.allowPicking){let f=Je.createPickVertexShaderSource(o);f=In._appendShowToShader(i,f),f=In._updatePickColorAttribute(f);let y=m.createPickFragmentShader(!1),_=m.createPickVertexShader([a],f,!1,t.mapProjection);if(e._spPick=tn.replaceCache({context:n,shaderProgram:e._spPick,vertexShaderSource:_,fragmentShaderSource:y,attributeLocations:u}),s){let S=n.shaderCache.getDerivedShaderProgram(e._spPick,"2dPick");if(!l(S)){let Z=m.createPickFragmentShader(!0),R=m.createPickVertexShader([a],f,!0,t.mapProjection);S=n.shaderCache.createDerivedShaderProgram(e._spPick,"2dPick",{vertexShaderSource:R,fragmentShaderSource:Z,attributeLocations:u})}e._spPick2D=S}}else e._spPick=tn.fromCache({context:n,vertexShaderSource:c,fragmentShaderSource:d,attributeLocations:u});o=In._appendShowToShader(i,o),c=new Je({defines:[a],sources:[o]}),e._sp=tn.replaceCache({context:n,shaderProgram:e._sp,vertexShaderSource:c,fragmentShaderSource:d,attributeLocations:u});let p=m.createFragmentShader(!1),b=m.createVertexShader([a],o,!1,t.mapProjection);if(e._spColor=tn.replaceCache({context:n,shaderProgram:e._spColor,vertexShaderSource:b,fragmentShaderSource:p,attributeLocations:u}),s){let f=n.shaderCache.getDerivedShaderProgram(e._spColor,"2dColor");if(!l(f)){let y=m.createFragmentShader(!0),_=m.createVertexShader([a],o,!0,t.mapProjection);f=n.shaderCache.createDerivedShaderProgram(e._spColor,"2dColor",{vertexShaderSource:_,fragmentShaderSource:y,attributeLocations:u})}e._spColor2D=f}}function Uze(e,t){let n=e._primitive,i=n._va.length*2;t.length=i;let o,r,s,a=0,c=n._batchTable.getUniformMapCallback()(e._uniformMap),d=e._needs2DShader;for(o=0;o0&&(c=o[0].attributes,p=Zu.hasAttributesForSphericalExtents(c),b=Zu.hasAttributesForTextureCoordinatePlanes(c),m=c.color),s=0;s{l(this._primitive)&&this._primitive.ready&&(this._ready=!0,this.releaseGeometryInstances&&(this.geometryInstances=void 0))})};E_.prototype.getGeometryInstanceAttributes=function(e){return this._primitive.getGeometryInstanceAttributes(e)};E_.prototype.isDestroyed=function(){return!1};E_.prototype.destroy=function(){return this._primitive=this._primitive&&this._primitive.destroy(),this._sp=this._sp&&this._sp.destroy(),this._spPick=this._spPick&&this._spPick.destroy(),this._spColor=this._spColor&&this._spColor.destroy(),this._spPick2D=void 0,this._spColor2D=void 0,ue(this)};var G1=E_;var zze={u_globeMinimumAltitude:function(){return 55e3}};function vd(e){e=e??B.EMPTY_OBJECT;let t=e.appearance,n=e.geometryInstances;if(!l(t)&&l(n)){let o=Array.isArray(n)?n:[n],r=o.length;for(let s=0;s{!this._ready&&l(this._primitive)&&this._primitive.ready&&(this._ready=!0,this.releaseGeometryInstances&&(this.geometryInstances=void 0))})};vd.prototype.getBoundingSphere=function(e){let t=this._boundingSpheresKeys.indexOf(e);if(t!==-1)return this._boundingSpheres[t]};vd.prototype.getGeometryInstanceAttributes=function(e){return this._primitive.getGeometryInstanceAttributes(e)};vd.prototype.isDestroyed=function(){return!1};vd.prototype.destroy=function(){return this._primitive=this._primitive&&this._primitive.destroy(),ue(this)};vd._supportsMaterials=function(e){return e.depthTexture};vd.supportsMaterials=function(e){return vd._supportsMaterials(e.frameState.context)};var Bl=vd;var Q_n=x(T(),1);var z_n=x(T(),1);function cc(e){e=e??B.EMPTY_OBJECT,this._primitives=[],this._guid=Qn(),this._primitiveAdded=new Se,this._primitiveRemoved=new Se,this._zIndex=void 0,this.show=e.show??!0,this.destroyPrimitives=e.destroyPrimitives??!0,this._countReferences=e.countReferences??!1}Object.defineProperties(cc.prototype,{length:{get:function(){return this._primitives.length}},primitiveAdded:{get:function(){return this._primitiveAdded}},primitiveRemoved:{get:function(){return this._primitiveRemoved}}});cc.prototype.add=function(e,t){let n=l(t),i=e._external=e._external||{},o=i._composites=i._composites||{};return o[this._guid]={collection:this},n?this._primitives.splice(t,0,e):this._primitives.push(e),this._countReferences&&(l(i._referenceCount)?++i._referenceCount:i._referenceCount=1),this._primitiveAdded.raiseEvent(e),e};cc.prototype.remove=function(e){if(this.contains(e)){let t=this._primitives.indexOf(e);if(t!==-1)return this._primitives.splice(t,1),delete e._external._composites[this._guid],this._countReferences&&e._external._referenceCount--,this.destroyPrimitives&&(!this._countReferences||e._external._referenceCount<=0)&&e.destroy(),this._primitiveRemoved.raiseEvent(e),!0}return!1};cc.prototype.removeAndDestroy=function(e){let t=this.remove(e);return t&&!this.destroyPrimitives&&e.destroy(),t};cc.prototype.removeAll=function(){let e=this._primitives,t=e.length;for(let n=0;n0&&(this._hash={},t.length=0)}},kt=qQ;var iSn=x(T(),1);function Ru(e,t){e=e??0,this._near=e,t=t??Number.MAX_VALUE,this._far=t}Object.defineProperties(Ru.prototype,{near:{get:function(){return this._near},set:function(e){this._near=e}},far:{get:function(){return this._far},set:function(e){this._far=e}}});Ru.packedLength=2;Ru.pack=function(e,t,n){return n=n??0,t[n++]=e.near,t[n]=e.far,t};Ru.unpack=function(e,t,n){return t=t??0,l(n)||(n=new Ru),n.near=e[t++],n.far=e[t],n};Ru.equals=function(e,t){return e===t||l(e)&&l(t)&&e.near===t.near&&e.far===t.far};Ru.clone=function(e,t){if(l(e))return l(t)||(t=new Ru),t.near=e.near,t.far=e.far,t};Ru.prototype.clone=function(e){return Ru.clone(this,e)};Ru.prototype.equals=function(e){return Ru.equals(this,e)};var Bt=Ru;var sSn=x(T(),1);function Lm(e,t,n,i){this.near=e??0,this.nearValue=t??0,this.far=n??1,this.farValue=i??0}Lm.clone=function(e,t){if(l(e))return l(t)?(t.near=e.near,t.nearValue=e.nearValue,t.far=e.far,t.farValue=e.farValue,t):new Lm(e.near,e.nearValue,e.far,e.farValue)};Lm.packedLength=4;Lm.pack=function(e,t,n){return n=n??0,t[n++]=e.near,t[n++]=e.nearValue,t[n++]=e.far,t[n]=e.farValue,t};Lm.unpack=function(e,t,n){return t=t??0,l(n)||(n=new Lm),n.near=e[t++],n.nearValue=e[t++],n.far=e[t++],n.farValue=e[t],n};Lm.equals=function(e,t){return e===t||l(e)&&l(t)&&e.near===t.near&&e.nearValue===t.nearValue&&e.far===t.far&&e.farValue===t.farValue};Lm.prototype.clone=function(e){return Lm.clone(this,e)};Lm.prototype.equals=function(e){return Lm.equals(this,e)};var Kt=Lm;var cSn=x(T(),1),ky={NONE:0,CLAMP_TO_GROUND:1,RELATIVE_TO_GROUND:2,CLAMP_TO_TERRAIN:3,RELATIVE_TO_TERRAIN:4,CLAMP_TO_3D_TILE:5,RELATIVE_TO_3D_TILE:6,CLIP_TO_GROUND:7};Object.freeze(ky);var He=ky;function gs(e){return e===ky.CLAMP_TO_GROUND||e===ky.CLAMP_TO_3D_TILE||e===ky.CLAMP_TO_TERRAIN}function Uy(e){return e===ky.RELATIVE_TO_GROUND||e===ky.RELATIVE_TO_3D_TILE||e===ky.RELATIVE_TO_TERRAIN}var dSn=x(T(),1),Kfe={CENTER:0,LEFT:1,RIGHT:-1};Object.freeze(Kfe);var Di=Kfe;var mSn=x(T(),1),Jfe={CENTER:0,BOTTOM:1,BASELINE:2,TOP:-1};Object.freeze(Jfe);var zn=Jfe;var bSn=x(T(),1);function Bh(){ge.throwInstantiationError()}Object.defineProperties(Bh.prototype,{isConstant:{get:ge.throwInstantiationError},definitionChanged:{get:ge.throwInstantiationError}});Bh.prototype.getValue=ge.throwInstantiationError;Bh.prototype.equals=ge.throwInstantiationError;Bh.equals=function(e,t){return e===t||l(e)&&e.equals(t)};Bh.arrayEquals=function(e,t){if(e===t)return!0;if(!l(e)||!l(t)||e.length!==t.length)return!1;let n=e.length;for(let i=0;itHe&&(l(t.mostDetailedHeight)&&(t.mostDetailedHeightPrevious=t.mostDetailedHeight),t.mostDetailedHeightPosition=void 0,t.mostDetailedHeight=void 0),!l(t.mostDetailedHeightPosition))if(t.mostDetailedHeightPosition=h.clone(n),!l(e)||!e.sampleHeightSupported||e.mode!==se.SCENE3D)t.mostDetailedHeight=null;else{t.mostDetailedHeight=void 0;let a=(e.ellipsoid??ne.default).cartesianToCartographic(n);e.sampleHeightMostDetailed([a],i).then(function(c){o()&&(t.mostDetailedHeight=c[0].height??null)}).catch(function(){o()&&(t.mostDetailedHeight=null)})}return t.mostDetailedHeight===void 0?t.mostDetailedHeightPrevious:t.mostDetailedHeight}var zh=nHe;var VSn=x(T(),1);var iHe=new pe;function oHe(e,t,n,i,o){let r=i.cartesianToCartographic(e,iHe);return n===He.CLIP_TO_GROUND?r.heightr.get(e.id)===n);if(s===void 0)return Wt.PENDING;s===null?t.center=h.clone(i.position,t.center):t.center=xb(i.position,s,i.heightReference,o.ellipsoid??ne.default,t.center)}return t.radius=0,Wt.DONE};Dy.prototype.isDestroyed=function(){return!1};Dy.prototype.destroy=function(){this._entityCollection.collectionChanged.removeEventListener(Dy.prototype._onCollectionChanged,this);let e=this._entityCollection.values;for(let t=0;t-1;o--)r=t[o],l(r._billboard)&&l(r._position)&&s.set(r.id,new Qfe(r));for(o=i.length-1;o>-1;o--)r=i[o],l(r._billboard)&&l(r._position)?s.contains(r.id)||s.set(r.id,new Qfe(r)):($Q(s.get(r.id),r,a),s.remove(r.id));for(o=n.length-1;o>-1;o--)r=n[o],$Q(s.get(r.id),r,a),s.remove(r.id)};function $Q(e,t,n){l(e)&&(e.billboard=void 0,n.removeBillboard(t))}var eF=Dy;var PLn=x(T(),1);var QSn=x(T(),1);function bO(){ge.throwInstantiationError()}Object.defineProperties(bO.prototype,{name:{get:ge.throwInstantiationError},clock:{get:ge.throwInstantiationError},entities:{get:ge.throwInstantiationError},isLoading:{get:ge.throwInstantiationError},changedEvent:{get:ge.throwInstantiationError},errorEvent:{get:ge.throwInstantiationError},loadingEvent:{get:ge.throwInstantiationError},show:{get:ge.throwInstantiationError},clustering:{get:ge.throwInstantiationError}});bO.prototype.update=function(e){ge.throwInstantiationError()};bO.setLoading=function(e,t){e._isLoading!==t&&(t?e._entityCollection.suspendEvents():e._entityCollection.resumeEvents(),e._isLoading=t,e._loading.raiseEvent(e,t))};var ys=bO;var wCn=x(T(),1);var oZn=x(T(),1);function Ip(e,t){this._ellipsoid=e,this._cameraPosition=new h,this._cameraPositionInScaledSpace=new h,this._distanceToLimbInScaledSpaceSquared=0,l(t)&&(this.cameraPosition=t)}Object.defineProperties(Ip.prototype,{ellipsoid:{get:function(){return this._ellipsoid}},cameraPosition:{get:function(){return this._cameraPosition},set:function(e){let n=this._ellipsoid.transformPositionToScaledSpace(e,this._cameraPositionInScaledSpace),i=h.magnitudeSquared(n)-1;h.clone(e,this._cameraPosition),this._cameraPositionInScaledSpace=n,this._distanceToLimbInScaledSpaceSquared=i}}});var qfe=new h;Ip.prototype.isPointVisible=function(e){let n=this._ellipsoid.transformPositionToScaledSpace(e,qfe);return t8(n,this._cameraPositionInScaledSpace,this._distanceToLimbInScaledSpaceSquared)};Ip.prototype.isScaledSpacePointVisible=function(e){return t8(e,this._cameraPositionInScaledSpace,this._distanceToLimbInScaledSpaceSquared)};var CHe=new h;Ip.prototype.isScaledSpacePointVisiblePossiblyUnderEllipsoid=function(e,t){let n=this._ellipsoid,i,o;return l(t)&&t<0&&n.minimumRadius>-t?(o=CHe,o.x=this._cameraPosition.x/(n.radii.x+t),o.y=this._cameraPosition.y/(n.radii.y+t),o.z=this._cameraPosition.z/(n.radii.z+t),i=o.x*o.x+o.y*o.y+o.z*o.z-1):(o=this._cameraPositionInScaledSpace,i=this._distanceToLimbInScaledSpaceSquared),t8(e,o,i)};Ip.prototype.computeHorizonCullingPoint=function(e,t,n){return tpe(this._ellipsoid,e,t,n)};var $fe=ne.clone(ne.UNIT_SPHERE);Ip.prototype.computeHorizonCullingPointPossiblyUnderEllipsoid=function(e,t,n,i){let o=epe(this._ellipsoid,n,$fe);return tpe(o,e,t,i)};Ip.prototype.computeHorizonCullingPointFromVertices=function(e,t,n,i,o){return npe(this._ellipsoid,e,t,n,i,o)};Ip.prototype.computeHorizonCullingPointFromVerticesPossiblyUnderEllipsoid=function(e,t,n,i,o,r){let s=epe(this._ellipsoid,o,$fe);return npe(s,e,t,n,i,r)};var VHe=[];Ip.prototype.computeHorizonCullingPointFromRectangle=function(e,t,n){let i=re.subsample(e,t,0,VHe),o=me.fromPoints(i);if(!(h.magnitude(o.center)<.1*t.minimumRadius))return this.computeHorizonCullingPoint(o.center,i,n)};var EHe=new h;function epe(e,t,n){if(l(t)&&t<0&&e.minimumRadius>-t){let i=h.fromElements(e.radii.x+t,e.radii.y+t,e.radii.z+t,EHe);e=ne.fromCartesian3(i,n)}return e}function tpe(e,t,n,i){l(i)||(i=new h);let o=rpe(e,t),r=0;for(let s=0,a=n.length;s0:s>o&&s*s/h.magnitudeSquared(r)>o)}var AHe=new h,GHe=new h;function ipe(e,t,n){let i=e.transformPositionToScaledSpace(t,AHe),o=h.magnitudeSquared(i),r=Math.sqrt(o),s=h.divideByScalar(i,r,GHe);o=Math.max(1,o),r=Math.max(1,r);let a=h.dot(s,n),c=h.magnitude(h.cross(s,n,s)),d=1/r,u=Math.sqrt(o-1)*d;return 1/(a*d-c*u)}function ope(e,t,n){if(!(t<=0||t===1/0||t!==t))return h.multiplyByScalar(e,t,n)}var e8=new h;function rpe(e,t){return h.equals(t,h.ZERO)?t:(e.transformPositionToScaledSpace(t,e8),h.normalize(e8,e8))}var Hh=Ip;var JZn=x(T(),1);var dZn=x(T(),1);var sZn=x(T(),1),LHe=Object.freeze({NONE:0,LOADING:2,LOADED:3,ERROR:4,FAILED:5}),ks=LHe;function Kh(e){this._billboardCollection=e,this._id=void 0,this._loadState=ks.NONE,this._loadError=void 0,this._index=-1,this._width=void 0,this._height=void 0,this._hasSubregion=!1,this.dirty=!1}Object.defineProperties(Kh.prototype,{loadError:{get:function(){return this._loadError}},loadState:{get:function(){return this._loadState}},ready:{get:function(){return this._loadState===ks.LOADED}},hasImage:{get:function(){return this._loadState!==ks.NONE}},id:{get:function(){return this._id}},width:{get:function(){return this._width}},height:{get:function(){return this._height}}});Kh.prototype.unload=async function(){this._loadState!==ks.NONE&&(this._id=void 0,this._loadError=void 0,this._loadState=ks.NONE,this._index=-1,this._width=void 0,this._height=void 0,this.dirty=!0)};Kh.prototype.loadImage=async function(e,t,n,i){if(this._id===e)return;let o=this._billboardCollection,r=o.billboardTextureCache,s=r.get(e);if(l(s)&&t.loadState===ks.LOADING||t.loadState===ks.LOADED){Kh.clone(s,this);return}l(s)||(s=new Kh(o),r.set(e,s)),s._id=this._id=e,s._loadState=this._loadState=ks.LOADING,s._loadError=this._loadError=void 0;let a,c=this._billboardCollection.textureAtlas;try{let u=c.addImage(e,t,n,i);typeof u=="number"?a=u:a=await u}catch(u){if(s._loadState=ks.ERROR,s._loadError=u,this._id!==e)return;this._loadState=ks.ERROR,this._loadError=u;return}if(!l(a)||a===-1){if(s._loadState=ks.FAILED,s._index=-1,this._id!==e)return;this._loadState=ks.FAILED,this._index=-1;return}s._index=a,s._loadState=ks.LOADED;let d=c.rectangles[a];s._width=d.width,s._height=d.height,this._id===e&&(this._index=a,this._loadState=ks.LOADED,this._width=d.width,this._height=d.height,this.dirty=!0)};Kh.prototype.addImageSubRegion=function(e,t){this._id=e,this._loadError=void 0,this._hasSubregion=!0;let i=this._billboardCollection.textureAtlas.addImageSubRegion(e,t);if(typeof i=="number"){this.setImageSubRegion(i,t);return}this.loadImageSubRegion(e,t,i)};Kh.prototype.loadImageSubRegion=async function(e,t,n){let i;try{this._loadState=ks.LOADING,i=await n}catch(o){this._loadState=ks.ERROR,this._loadError=o;return}this._id===e&&(this._loadState=ks.LOADED,this.setImageSubRegion(i,t))};Kh.prototype.setImageSubRegion=function(e,t){if(this._index!==e){if(!l(e)||e===-1){this._loadState=ks.FAILED,this._index=-1,this._width=void 0,this._height=void 0;return}this._width=t.width,this._height=t.height,this._index=e,this.dirty=!0}};Kh.prototype.computeTextureCoordinates=function(e){return this._billboardCollection.textureAtlas.computeTextureCoordinates(this._index,e)};Kh.clone=function(e,t){if(t._id=e._id,t._loadState=e._loadState,t._loadError=void 0,t._index=e._index,t._width=e._width,t._height=e._height,t._hasSubregion=e._hasSubregion,e.ready){t.dirty=!0;return}return(async()=>{let i=e._id;await e._billboardCollection.textureAtlas._indexPromiseById.get(i),t._id===i&&(e._hasSubregion&&await Promise.resolve(),t._id=i,t._loadState=e._loadState,t._loadError=e._loadError,t._index=e._index,t._width=e._width,t._height=e._height,t.dirty=!0)})(),t};var Tb=Kh;var RZn=x(T(),1);var Lc={},WHe=new ce(0,0,0,1),qc=new ce,vHe=new nt,n8=new k,i8=new k;Lc.worldToWindowCoordinates=function(e,t,n){return Lc.worldWithEyeOffsetToWindowCoordinates(e,t,h.ZERO,n)};var spe=new ce,ape=new h;function tF(e,t,n,i){let o=n.viewMatrix,r=P.multiplyByVector(o,ce.fromElements(e.x,e.y,e.z,1,spe),spe),s=h.multiplyComponents(t,h.normalize(r,ape),ape);return r.x+=t.x+s.x,r.y+=t.y+s.y,r.z+=s.z,P.multiplyByVector(n.frustum.projectionMatrix,r,i)}var FHe=new pe(Math.PI,W.PI_OVER_TWO),IHe=new h,PHe=new h;Lc.worldWithEyeOffsetToWindowCoordinates=function(e,t,n,i){let o=e.frameState,r=Lc.computeActualEllipsoidPosition(o,t,WHe);if(!l(r))return;let s=e.canvas,a=vHe;a.x=0,a.y=0,a.width=s.clientWidth,a.height=s.clientHeight;let c=e.camera,d=!1;if(o.mode===se.SCENE2D){let u=e.mapProjection,m=FHe,p=u.project(m,IHe),b=h.clone(c.position,PHe),f=c.frustum.clone(),y=P.computeViewportTransformation(a,0,1,new P),_=c.frustum.projectionMatrix,S=c.positionWC.y,Z=h.fromElements(W.sign(S)*p.x-S,0,-c.positionWC.x),R=_t.pointToGLWindowCoordinates(_,y,Z);if(S===0||R.x<=0||R.x>=s.clientWidth)d=!0;else{if(R.x>s.clientWidth*.5){a.width=R.x,c.frustum.right=p.x-S,qc=tF(r,n,c,qc),Lc.clipToGLWindowCoordinates(a,qc,n8),a.x+=R.x,c.position.x=-c.position.x;let C=c.frustum.right;c.frustum.right=-c.frustum.left,c.frustum.left=-C,qc=tF(r,n,c,qc),Lc.clipToGLWindowCoordinates(a,qc,i8)}else{a.x+=R.x,a.width-=R.x,c.frustum.left=-p.x-S,qc=tF(r,n,c,qc),Lc.clipToGLWindowCoordinates(a,qc,n8),a.x=a.x-a.width,c.position.x=-c.position.x;let C=c.frustum.left;c.frustum.left=-c.frustum.right,c.frustum.right=-C,qc=tF(r,n,c,qc),Lc.clipToGLWindowCoordinates(a,qc,i8)}h.clone(b,c.position),c.frustum=f.clone(),i=k.clone(n8,i),(i.x<0||i.x>s.clientWidth)&&(i.x=i8.x)}}if(o.mode!==se.SCENE2D||d){if(qc=tF(r,n,c,qc),qc.z<0&&!(c.frustum instanceof yn)&&!(c.frustum instanceof ps))return;i=Lc.clipToGLWindowCoordinates(a,qc,i)}return i.y=s.clientHeight-i.y,i};Lc.worldToDrawingBufferCoordinates=function(e,t,n){if(n=Lc.worldToWindowCoordinates(e,t,n),!!l(n))return Lc.transformWindowToDrawingBuffer(e,n,n)};var _b=new h,XHe=new pe;Lc.computeActualEllipsoidPosition=function(e,t,n){let i=e.mode;if(i===se.SCENE3D)return h.clone(t,n);let o=e.mapProjection,r=o.ellipsoid.cartesianToCartographic(t,XHe);if(!l(r))return;if(o.project(r,_b),i===se.COLUMBUS_VIEW)return h.fromElements(_b.z,_b.x,_b.y,n);if(i===se.SCENE2D)return h.fromElements(0,_b.x,_b.y,n);let s=e.morphTime;return h.fromElements(W.lerp(_b.z,t.x,s),W.lerp(_b.x,t.y,s),W.lerp(_b.y,t.z,s),n)};var cpe=new h,lpe=new h,dpe=new P;Lc.clipToGLWindowCoordinates=function(e,t,n){return h.divideByScalar(t,t.w,cpe),P.computeViewportTransformation(e,0,1,dpe),P.multiplyByPoint(dpe,cpe,lpe),k.fromCartesian3(lpe,n)};Lc.transformWindowToDrawingBuffer=function(e,t,n){let i=e.canvas,o=e.drawingBufferWidth/i.clientWidth,r=e.drawingBufferHeight/i.clientHeight;return k.fromElements(t.x*o,t.y*r,n)};var NHe=new ce,upe=new ce;Lc.drawingBufferToWorldCoordinates=function(e,t,n,i){let r=e.context.uniformState,s=r.currentFrustum,a=s.x,c=s.y;if(e.frameState.useLogDepth){let b=n*r.log2FarDepthFromNearPlusOne,f=Math.pow(2,b)-1;n=c*(1-a/(f+a))/(c-a)}let d=e.view.passState.viewport,u=ce.clone(ce.UNIT_W,NHe);u.x=(t.x-d.x)/d.width*2-1,u.y=(t.y-d.y)/d.height*2-1,u.z=n*2-1,u.w=1;let m,p=e.camera.frustum;if(l(p.fovy)){m=P.multiplyByVector(r.inverseViewProjection,u,upe);let b=1/m.w;h.multiplyByScalar(m,b,m)}else{let b=p.offCenterFrustum;l(b)&&(p=b),m=upe,m.x=(u.x*(p.right-p.left)+p.left+p.right)*.5,m.y=(u.y*(p.top-p.bottom)+p.bottom+p.top)*.5,m.z=(u.z*(a-c)-a-c)*.5,m.w=1,m=P.multiplyByVector(r.inverseView,m,m)}return h.fromCartesian4(m,i)};var fo=Lc;function Xi(e,t){e=e??B.EMPTY_OBJECT;let n=e.translucencyByDistance,i=e.pixelOffsetScaleByDistance,o=e.scaleByDistance,r=e.distanceDisplayCondition;l(n)&&(n=Kt.clone(n)),l(i)&&(i=Kt.clone(i)),l(o)&&(o=Kt.clone(o)),l(r)&&(r=Bt.clone(r)),this._show=e.show??!0,this._position=h.clone(e.position??h.ZERO),this._actualPosition=h.clone(this._position),this._pixelOffset=k.clone(e.pixelOffset??k.ZERO),this._translate=new k(0,0),this._eyeOffset=h.clone(e.eyeOffset??h.ZERO),this._heightReference=e.heightReference??He.NONE,this._verticalOrigin=e.verticalOrigin??zn.CENTER,this._horizontalOrigin=e.horizontalOrigin??Di.CENTER,this._scale=e.scale??1,this._color=U.clone(e.color??U.WHITE),this._rotation=e.rotation??0,this._alignedAxis=h.clone(e.alignedAxis??h.ZERO),this._width=e.width,this._height=e.height,this._scaleByDistance=o,this._translucencyByDistance=n,this._pixelOffsetScaleByDistance=i,this._sizeInMeters=e.sizeInMeters??!1,this._distanceDisplayCondition=r,this._disableDepthTestDistance=e.disableDepthTestDistance,this._id=e.id,this._collection=e.collection??t,this._pickId=void 0,this._pickPrimitive=e._pickPrimitive??this,this._billboardCollection=t,this._dirty=!1,this._index=-1,this._batchIndex=void 0,this._imageTexture=new Tb(t),this._imageId=e.imageId,this._imageWidth=void 0,this._imageHeight=void 0,this._labelDimensions=void 0,this._labelHorizontalOrigin=void 0,this._labelTranslate=void 0;let s=e.image;l(s)&&(this._computeImageTextureProperties(e.imageId,s),this._imageTexture.loadImage(this._imageId,s,this._imageWidth,this._imageHeight)),l(e.imageSubRegion)&&this._imageTexture.addImageSubRegion(this._imageId,e.imageSubRegion),this._actualClampedPosition=void 0,this._removeCallbackFunc=void 0,this._lastSurfaceHeight=void 0,this._lastSurfaceQueryFrame=-1,this._lastSurfaceQueryMissed=!1,this._clampedToSurface=!1,this._clampingCartesian=void 0,this._clampingHeight=0,this._clampingHeightValid=!1,this._mode=se.SCENE3D,this._clusterShow=!0,this._outlineColor=U.clone(e.outlineColor??U.BLACK),this._outlineWidth=e.outlineWidth??0,this._updateClamping(),this._splitDirection=e.splitDirection??Ur.NONE,this._positionFromParent=!1}var mpe=Xi.SHOW_INDEX=0,xO=Xi.POSITION_INDEX=1,_pe=Xi.PIXEL_OFFSET_INDEX=2,YHe=Xi.EYE_OFFSET_INDEX=3,MHe=Xi.HORIZONTAL_ORIGIN_INDEX=4,wHe=Xi.VERTICAL_ORIGIN_INDEX=5,kHe=Xi.SCALE_INDEX=6,hpe=Xi.IMAGE_INDEX_INDEX=7,fpe=Xi.COLOR_INDEX=8,UHe=Xi.ROTATION_INDEX=9,DHe=Xi.ALIGNED_AXIS_INDEX=10,OHe=Xi.SCALE_BY_DISTANCE_INDEX=11,BHe=Xi.TRANSLUCENCY_BY_DISTANCE_INDEX=12,zHe=Xi.PIXEL_OFFSET_SCALE_BY_DISTANCE_INDEX=13,HHe=Xi.DISTANCE_DISPLAY_CONDITION=14,KHe=Xi.DISABLE_DEPTH_DISTANCE=15;Xi.TEXTURE_COORDINATE_BOUNDS=16;var ppe=Xi.SDF_INDEX=17,JHe=Xi.SPLIT_DIRECTION_INDEX=18;Xi.NUMBER_OF_PROPERTIES=19;function Wr(e,t){let n=e._billboardCollection;l(n)&&(n._updateBillboard(e,t),e._dirty=!0)}function o8(e,t){return e===t||l(e)&&l(t)&&e.x===t.x&&e.y===t.y&&e.z===t.z}function A_(e,t){if(l(e))return l(t)?(t.x=e.x,t.y=e.y,t.z=e.z,t):new h(e.x,e.y,e.z)}Object.defineProperties(Xi.prototype,{show:{get:function(){return this._show},set:function(e){this._show!==e&&(this._show=e,Wr(this,mpe))}},position:{get:function(){return this._position},set:function(e){let t=this._position;o8(t,e)||(A_(e,t),A_(e,this._actualPosition),this._updateClamping(),Wr(this,xO))}},heightReference:{get:function(){return this._heightReference},set:function(e){let t=this._heightReference;e!==t&&(this._heightReference=e,this._updateClamping(),Wr(this,xO))}},pixelOffset:{get:function(){return this._pixelOffset},set:function(e){let t=this._pixelOffset;k.equals(t,e)||(k.clone(e,t),Wr(this,_pe))}},scaleByDistance:{get:function(){return this._scaleByDistance},set:function(e){let t=this._scaleByDistance;Kt.equals(t,e)||(this._scaleByDistance=Kt.clone(e,t),Wr(this,OHe))}},translucencyByDistance:{get:function(){return this._translucencyByDistance},set:function(e){let t=this._translucencyByDistance;Kt.equals(t,e)||(this._translucencyByDistance=Kt.clone(e,t),Wr(this,BHe))}},pixelOffsetScaleByDistance:{get:function(){return this._pixelOffsetScaleByDistance},set:function(e){let t=this._pixelOffsetScaleByDistance;Kt.equals(t,e)||(this._pixelOffsetScaleByDistance=Kt.clone(e,t),Wr(this,zHe))}},eyeOffset:{get:function(){return this._eyeOffset},set:function(e){let t=this._eyeOffset;h.equals(t,e)||(h.clone(e,t),Wr(this,YHe))}},horizontalOrigin:{get:function(){return this._horizontalOrigin},set:function(e){this._horizontalOrigin!==e&&(this._horizontalOrigin=e,Wr(this,MHe))}},verticalOrigin:{get:function(){return this._verticalOrigin},set:function(e){this._verticalOrigin!==e&&(this._verticalOrigin=e,Wr(this,wHe))}},scale:{get:function(){return this._scale},set:function(e){this._scale!==e&&(this._scale=e,Wr(this,kHe))}},color:{get:function(){return this._color},set:function(e){let t=this._color;U.equals(t,e)||(U.clone(e,t),Wr(this,fpe))}},rotation:{get:function(){return this._rotation},set:function(e){this._rotation!==e&&(this._rotation=e,Wr(this,UHe))}},alignedAxis:{get:function(){return this._alignedAxis},set:function(e){let t=this._alignedAxis;h.equals(t,e)||(h.clone(e,t),Wr(this,DHe))}},width:{get:function(){return this._width??this._imageTexture.width},set:function(e){this._width!==e&&(this._width=e,Wr(this,hpe))}},height:{get:function(){return this._height??this._imageTexture.height},set:function(e){this._height!==e&&(this._height=e,Wr(this,hpe))}},sizeInMeters:{get:function(){return this._sizeInMeters},set:function(e){this._sizeInMeters!==e&&(this._sizeInMeters=e,Wr(this,fpe))}},distanceDisplayCondition:{get:function(){return this._distanceDisplayCondition},set:function(e){Bt.equals(e,this._distanceDisplayCondition)||(this._distanceDisplayCondition=Bt.clone(e,this._distanceDisplayCondition),Wr(this,HHe))}},disableDepthTestDistance:{get:function(){return this._disableDepthTestDistance},set:function(e){this._disableDepthTestDistance!==e&&(this._disableDepthTestDistance=e,Wr(this,KHe))}},id:{get:function(){return this._id},set:function(e){this._id=e,l(this._pickId)&&(this._pickId.object.id=e)}},pickPrimitive:{get:function(){return this._pickPrimitive},set:function(e){this._pickPrimitive=e,l(this._pickId)&&(this._pickId.object.primitive=e)}},pickId:{get:function(){return this._pickId}},image:{get:function(){return this._imageTexture.id},set:function(e){if(!l(e)){this._imageTexture.unload();return}this._computeImageTextureProperties(void 0,e),this._imageTexture.loadImage(this._imageId,e,this._imageWidth,this._imageHeight)}},ready:{get:function(){return this._imageTexture.ready}},loadError:{get:function(){return this._imageTexture.loadError}},textureDirty:{get:function(){return this._imageTexture.dirty},set:function(e){this._imageTexture.dirty=e}},_clampedPosition:{get:function(){return this._actualClampedPosition},set:function(e){this._actualClampedPosition=A_(e,this._actualClampedPosition),Wr(this,xO)}},clusterShow:{get:function(){return this._clusterShow},set:function(e){this._clusterShow!==e&&(this._clusterShow=e,Wr(this,mpe))}},outlineColor:{get:function(){return this._outlineColor},set:function(e){let t=this._outlineColor;U.equals(t,e)||(U.clone(e,t),Wr(this,ppe))}},outlineWidth:{get:function(){return this._outlineWidth},set:function(e){this._outlineWidth!==e&&(this._outlineWidth=e,Wr(this,ppe))}},splitDirection:{get:function(){return this._splitDirection},set:function(e){this._splitDirection!==e&&(this._splitDirection=e,Wr(this,JHe))}}});Xi.prototype.getPickId=function(e){return l(this._pickId)||(this._pickId=e.createPickId({primitive:this._pickPrimitive,collection:this._collection,id:this._id})),this._pickId};Xi.prototype._updateClamping=function(){Xi._updateClamping(this._billboardCollection,this)};var TO=new pe,jHe=new pe,bpe=200,gpe=30;function ype(e,t,n,i){let o=t.cartographicToCartesian(i,e._clampedPosition);Uy(e._heightReference)?e._mode===se.SCENE3D?(i.height+=n.height,t.cartographicToCartesian(i,o)):o.x+=n.height:e._heightReference===He.CLIP_TO_GROUND&&n.height>i.height&&(e._mode===se.SCENE3D?(i.height=n.height,t.cartographicToCartesian(i,o)):o.x=n.height),e._clampedPosition=o}Xi._updateClamping=function(e,t){if(!l(e)||!l(e._scene))return;let n=e._scene,i=n.ellipsoid??ne.default,o=n.frameState.mode,r=o!==t._mode;if(t._mode=o,(t._heightReference===He.NONE||r)&&l(t._removeCallbackFunc)&&(t._removeCallbackFunc(),t._removeCallbackFunc=void 0,t._clampedPosition=void 0,t._lastSurfaceHeight=void 0,t._clampedToSurface=!1),t._heightReference===He.NONE||t._positionFromParent||!l(t._position))return;let s=n.frameState.frameNumber;if(t._clampingHeightValid&&t._heightReference===He.CLIP_TO_GROUND&&o===se.SCENE3D&&l(t._removeCallbackFunc)&&l(t._lastSurfaceHeight)&&s-t._lastSurfaceQueryFramet._lastSurfaceHeight+bpe){t._clampedToSurface=!0,t._clampedPosition=_;return}}let a=i.cartesianToCartographic(t._position,jHe);if(!l(a)){t._actualClampedPosition=void 0,t._clampingHeightValid=!1;return}t._clampingCartesian=A_(t._position,t._clampingCartesian),t._clampingHeight=a.height,t._clampingHeightValid=!0;let c=t._heightReference===He.CLIP_TO_GROUND,d=s-t._lastSurfaceQueryFramet._lastSurfaceHeight+bpe,m=u&&d,p=c&&d&&t._lastSurfaceQueryMissed;if(!((c&&t._lastSurfaceQueryMissed||u)&&l(t._removeCallbackFunc))){l(t._removeCallbackFunc)&&t._removeCallbackFunc();let _=pe.clone(a);t._removeCallbackFunc=n.updateHeight(_,S=>{let Z=n.getHeight(_,t._heightReference);l(Z)&&(S.height=Z,t._lastSurfaceQueryFrame=n.frameState.frameNumber,t._lastSurfaceQueryMissed=!1),t._lastSurfaceHeight=S.height,t._clampedToSurface=!0,ype(t,i,_,S)},t._heightReference)}pe.clone(a,TO);let y;m||p?y=t._lastSurfaceHeight:(t._lastSurfaceQueryFrame=s,y=n.getHeight(a,t._heightReference),t._lastSurfaceQueryMissed=!l(y),l(y)?t._lastSurfaceHeight=y:y=t._lastSurfaceHeight),t._clampedToSurface=l(y),l(y)&&(TO.height=y),ype(t,i,a,TO)};Xi.prototype.computeTextureCoordinates=function(e){return this._imageTexture.computeTextureCoordinates(e)};Xi.prototype.setImage=function(e,t){this._computeImageTextureProperties(e,t),this._imageTexture.loadImage(this._imageId,t,this._imageWidth,this._imageHeight)};Xi.prototype.setImageTexture=function(e){Tb.clone(e,this._imageTexture)};var xpe=512;Xi.prototype._computeImageTextureProperties=function(e,t){if(this._imageWidth=void 0,this._imageHeight=void 0,!l(t)){this._imageId=Qn();return}let n;typeof t=="string"?n=t:t instanceof ve?n=t._url:l(t.src)&&(n=t.src),this._imageId=e??n??Qn(),l(this._width)&&l(this._height)&&!this._sizeInMeters&&QHe(n)&&(this._imageWidth=Math.min(this._width,xpe),this._imageHeight=Math.min(this._height,xpe))};function QHe(e){return l(e)?Ih(e)?e.startsWith("data:image/svg+xml"):eb(e)==="svg":!1}Xi.prototype.setImageSubRegion=function(e,t){this._imageTexture.addImageSubRegion(e,t)};Xi.prototype._setTranslate=function(e){let t=this._translate;k.equals(t,e)||(k.clone(e,t),Wr(this,_pe))};Xi.prototype._getActualPosition=function(){return l(this._clampedPosition)?this._clampedPosition:this._actualPosition};Xi.prototype._setActualPosition=function(e){l(this._clampedPosition)||h.clone(e,this._actualPosition),Wr(this,xO)};var Tpe=new ce;Xi._computeActualPosition=function(e,t,n,i){return l(e._clampedPosition)?(n.mode!==e._mode&&e._updateClamping(),e._clampedPosition):n.mode===se.SCENE3D?t:(P.multiplyByPoint(i,t,Tpe),fo.computeActualEllipsoidPosition(n,Tpe))};var Spe=new h;Xi._computeScreenSpacePosition=function(e,t,n,i,o,r){let s=P.multiplyByPoint(e,t,Spe),a=fo.worldWithEyeOffsetToWindowCoordinates(o,s,n,r);if(l(a))return k.add(a,i,a),a};var yO=new k(0,0);Xi.prototype.computeScreenSpacePosition=function(e,t){let n=this._billboardCollection;l(t)||(t=new k),k.clone(this._pixelOffset,yO),k.add(yO,this._translate,yO);let i=n.modelMatrix,o=this._position;if(l(this._clampedPosition)&&(o=this._clampedPosition,e.mode!==se.SCENE3D)){let s=e.mapProjection,a=s.ellipsoid,c=s.unproject(o,TO);o=a.cartographicToCartesian(c,Spe),i=P.IDENTITY}return Xi._computeScreenSpacePosition(i,o,this._eyeOffset,yO,e,t)};Xi.getScreenSpaceBoundingBox=function(e,t,n){let i=e.width,o=e.height,r=e.scale;i*=r,o*=r;let s=t.x;e.horizontalOrigin===Di.RIGHT?s-=i:e.horizontalOrigin===Di.CENTER&&(s-=i*.5);let a=t.y;return e.verticalOrigin===zn.BOTTOM||e.verticalOrigin===zn.BASELINE?a-=o:e.verticalOrigin===zn.CENTER&&(a-=o*.5),l(n)||(n=new nt),n.x=s,n.y=a,n.width=i,n.height=o,n};Xi.prototype.equals=function(e){return this===e||l(e)&&this._id===e._id&&h.equals(this._position,e._position)&&this.image===e.image&&this._show===e._show&&this._scale===e._scale&&this._verticalOrigin===e._verticalOrigin&&this._horizontalOrigin===e._horizontalOrigin&&this._heightReference===e._heightReference&&U.equals(this._color,e._color)&&k.equals(this._pixelOffset,e._pixelOffset)&&k.equals(this._translate,e._translate)&&h.equals(this._eyeOffset,e._eyeOffset)&&Kt.equals(this._scaleByDistance,e._scaleByDistance)&&Kt.equals(this._translucencyByDistance,e._translucencyByDistance)&&Kt.equals(this._pixelOffsetScaleByDistance,e._pixelOffsetScaleByDistance)&&Bt.equals(this._distanceDisplayCondition,e._distanceDisplayCondition)&&this._disableDepthTestDistance===e._disableDepthTestDistance&&this._splitDirection===e._splitDirection};Xi.prototype._destroy=function(){l(this._customData)&&(this._billboardCollection._scene.globe._surface.removeTileCustomData(this._customData),this._customData=void 0),l(this._removeCallbackFunc)&&(this._removeCallbackFunc(),this._removeCallbackFunc=void 0),this.image=void 0,this._pickId=this._pickId&&this._pickId.destroy(),this._billboardCollection=void 0};var Mo=Xi;var YRn=x(T(),1);var QZn=x(T(),1),Zpe={OPAQUE:0,TRANSLUCENT:1,OPAQUE_AND_TRANSLUCENT:2};Object.freeze(Zpe);var Ni=Zpe;var $Zn=x(T(),1),qHe={FONT_SIZE:48,PADDING:10,RADIUS:8,CUTOFF:.25},Xa=Object.freeze(qHe);var $He=Mo.SHOW_INDEX,nF=Mo.POSITION_INDEX,Cpe=Mo.PIXEL_OFFSET_INDEX,Vpe=Mo.EYE_OFFSET_INDEX,eKe=Mo.HORIZONTAL_ORIGIN_INDEX,tKe=Mo.VERTICAL_ORIGIN_INDEX,nKe=Mo.SCALE_INDEX,G_=Mo.IMAGE_INDEX_INDEX,Epe=Mo.COLOR_INDEX,iKe=Mo.ROTATION_INDEX,oKe=Mo.ALIGNED_AXIS_INDEX,Ape=Mo.SCALE_BY_DISTANCE_INDEX,Gpe=Mo.TRANSLUCENCY_BY_DISTANCE_INDEX,Lpe=Mo.PIXEL_OFFSET_SCALE_BY_DISTANCE_INDEX,Wpe=Mo.DISTANCE_DISPLAY_CONDITION,rKe=Mo.DISABLE_DEPTH_DISTANCE,sKe=Mo.TEXTURE_COORDINATE_BOUNDS,vpe=Mo.SDF_INDEX,Fpe=Mo.SPLIT_DIRECTION_INDEX,d8=Mo.NUMBER_OF_PROPERTIES,Oo={direction:0,positionHighAndScale:1,positionLowAndRotation:2,compressedAttribute0:3,compressedAttribute1:4,compressedAttribute2:5,eyeOffset:6,scaleByDistance:7,pixelOffsetScaleByDistance:8,compressedAttribute3:9,textureCoordinateBoundsOrLabelTranslate:10,a_batchId:11,sdf:12,splitDirection:13};function vm(e){e=e??B.EMPTY_OBJECT,this._scene=e.scene,this._batchTable=e.batchTable;let t=e.textureAtlas;l(t)||(t=new x_),this._textureAtlas=t,this._textureAtlasGUID=t.guid,this._destroyTextureAtlas=!0,this._billboardTextureCache=new Map,this._sp=void 0,this._spTranslucent=void 0,this._rsOpaque=void 0,this._rsTranslucent=void 0,this._vaf=void 0,this._billboards=[],this._billboardsToUpdate=[],this._billboardsToUpdateIndex=0,this._billboardsRemoved=!1,this._createVertexArray=!1,this._shaderRotation=!1,this._compiledShaderRotation=!1,this._shaderAlignedAxis=!1,this._compiledShaderAlignedAxis=!1,this._shaderScaleByDistance=!1,this._compiledShaderScaleByDistance=!1,this._shaderTranslucencyByDistance=!1,this._compiledShaderTranslucencyByDistance=!1,this._shaderPixelOffsetScaleByDistance=!1,this._compiledShaderPixelOffsetScaleByDistance=!1,this._shaderDistanceDisplayCondition=!1,this._compiledShaderDistanceDisplayCondition=!1,this._shaderDisableDepthDistance=!1,this._compiledShaderDisableDepthDistance=!1,this._shaderClampToGround=!1,this._compiledShaderClampToGround=!1,this._propertiesChanged=new Uint32Array(d8),this._maxSize=0,this._maxEyeOffset=0,this._maxScale=1,this._maxPixelOffset=0,this._allHorizontalCenter=!0,this._allVerticalCenter=!0,this._allSizedInMeters=!0,this._baseVolume=new me,this._baseVolumeWC=new me,this._baseVolume2D=new me,this._boundingVolume=new me,this._boundingVolumeDirty=!1,this._colorCommands=[],this._allBillboardsReady=!1,this.show=e.show??!0,this.modelMatrix=P.clone(e.modelMatrix??P.IDENTITY),this._modelMatrix=P.clone(P.IDENTITY),this.debugShowBoundingVolume=e.debugShowBoundingVolume??!1,this.debugShowTextureAtlas=e.debugShowTextureAtlas??!1,this.blendOption=e.blendOption??Ni.OPAQUE_AND_TRANSLUCENT,this._blendOption=void 0,this._mode=se.SCENE3D,this._buffersUsage=[Pe.STATIC_DRAW,Pe.STATIC_DRAW,Pe.STATIC_DRAW,Pe.STATIC_DRAW,Pe.STATIC_DRAW,Pe.STATIC_DRAW,Pe.STATIC_DRAW,Pe.STATIC_DRAW,Pe.STATIC_DRAW,Pe.STATIC_DRAW,Pe.STATIC_DRAW,Pe.STATIC_DRAW,Pe.STATIC_DRAW,Pe.STATIC_DRAW,Pe.STATIC_DRAW,Pe.STATIC_DRAW,Pe.STATIC_DRAW],this._highlightColor=U.clone(U.WHITE),this._coarseDepthTestDistance=e.coarseDepthTestDistance??ne.default.minimumRadius/10,this._threePointDepthTestDistance=e.threePointDepthTestDistance??ne.default.minimumRadius/1e3,this._uniforms={u_atlas:()=>this.textureAtlas.texture,u_highlightColor:()=>this._highlightColor,u_coarseDepthTestDistance:()=>this._coarseDepthTestDistance,u_threePointDepthTestDistance:()=>this._threePointDepthTestDistance};let n=this._scene;l(n)&&l(n.terrainProviderChanged)&&(this._removeCallbackFunc=n.terrainProviderChanged.addEventListener(function(){let i=this._billboards,o=i.length;for(let r=0;re.radius&&(e.radius=s)}function Xpe(e,t,n,i){let o=n[Oo.positionHighAndScale],r=n[Oo.positionLowAndRotation],s=i._getActualPosition();e._mode===se.SCENE3D&&(Ppe(e._baseVolume,s),e._boundingVolumeDirty=!0),An.fromCartesian(s,r8);let a=i.scale,c=i.rotation;c!==0&&(e._shaderRotation=!0),e._maxScale=Math.max(e._maxScale,a);let d=r8.high,u=r8.low;o(i._index,d.x,d.y,d.z,a),r(i._index,u.x,u.y,u.z,c)}var Oy=new k,Wm=32768,m8=65536,s8=4096,L_=256,lKe=128,dKe=32,uKe=8,_O=4,mKe=1/256,Npe=new nt;function Ype(e,t,n,i){let o=n[Oo.compressedAttribute0],r=i.pixelOffset,s=r.x,a=r.y,c=i._translate,d=c.x,u=c.y;e._maxPixelOffset=Math.max(e._maxPixelOffset,Math.abs(s+d),Math.abs(-a+u));let m=i.horizontalOrigin,p=i._verticalOrigin,b=i.show&&i.clusterShow;i.color.alpha===0&&(b=!1),p===zn.BASELINE&&(p=zn.BOTTOM),e._allHorizontalCenter=e._allHorizontalCenter&&m===Di.CENTER,e._allVerticalCenter=e._allVerticalCenter&&p===zn.CENTER;let f=0,y=0;if(i.ready){let L=i.computeTextureCoordinates(Npe);f=L.x,y=L.y}let _=Math.floor(W.clamp(s,-Wm,Wm)+Wm)*lKe;_+=(m+1)*dKe,_+=(p+1)*uKe,_+=(b?1:0)*_O;let S=Math.floor(W.clamp(a,-Wm,Wm)+Wm)*L_,Z=Math.floor(W.clamp(d*_O,-Wm,Wm)+Wm)*L_,R=(W.clamp(u*_O,-Wm,Wm)+Wm)*mKe,C=Math.floor(R),E=Math.floor((R-C)*L_);S+=C,Z+=E,Oy.x=f,Oy.y=y;let A=dn.compressTextureCoordinates(Oy);o(i._index,_,S,Z,A)}function Mpe(e,t,n,i){let o=n[Oo.compressedAttribute1],r=i.alignedAxis;h.equals(r,h.ZERO)||(r=h.normalize(r,new h),e._shaderAlignedAxis=!0);let s=0,a=1,c=1,d=1,u=i.translucencyByDistance;l(u)&&(s=u.near,a=u.nearValue,c=u.far,d=u.farValue,(a!==1||d!==1)&&(e._shaderTranslucencyByDistance=!0));let m=Math.round(i.width??0);e._maxSize=Math.max(e._maxSize,m);let p=W.clamp(m,0,m8),b=0;Math.abs(h.magnitudeSquared(r)-1)0)&&(e._shaderDisableDepthDistance=!0,c===Number.POSITIVE_INFINITY&&(c=-1));let u,m;l(i._labelDimensions)?(m=i._labelDimensions.x,u=i._labelDimensions.y):(m=i.width??0,u=i.height??0);let p=Math.floor(W.clamp(m,0,s8)),b=Math.floor(W.clamp(u,0,s8)),f=p*s8+b;o(i._index,r,s,c,f)}function Dpe(e,t,n,i){if(gs(i.heightReference)){let a=e._scene,c=t.context,d=t.globeTranslucencyState.translucent,u=l(a.globe)&&a.globe.depthTestAgainstTerrain;e._shaderClampToGround=c.depthTexture&&!d&&u}let o=n[Oo.textureCoordinateBoundsOrLabelTranslate],r=0,s=0;l(i._labelTranslate)&&(r=i._labelTranslate.x,s=i._labelTranslate.y),o(i._index,r,s,0,0)}function hKe(e,t,n,i){if(!l(e._batchTable))return;let o=n[Oo.a_batchId],r=i._batchIndex;o(i._index,r)}function Ope(e,t,n,i){if(!e._sdf)return;let o=n[Oo.sdf],r=i.outlineColor,s=i.outlineWidth,a=dn.encodeRGB8(r),c=s/Xa.RADIUS,d=U.floatToByte(r.alpha)*m8+U.floatToByte(c)*L_;o(i._index,a,d)}function Bpe(e,t,n,i){let o=n[Oo.splitDirection],r=0,s=i.splitDirection;l(s)&&(r=s),o(i._index,r)}function fKe(e,t,n,i){Xpe(e,t,n,i),Ype(e,t,n,i),Mpe(e,t,n,i),c8(e,t,n,i),l8(e,t,n,i),wpe(e,t,n,i),kpe(e,t,n,i),Upe(e,t,n,i),Dpe(e,t,n,i),hKe(e,t,n,i),Ope(e,t,n,i),Bpe(e,t,n,i)}function a8(e,t,n,i,o,r){let s;i.mode===se.SCENE3D?(s=e._baseVolume,e._boundingVolumeDirty=!0):s=e._baseVolume2D;let a=[];for(let c=0;c-1;){let s=0;for(let d=o;d0?(i+=`uniform sampler2D tile_pickTexture; -in vec2 tile_featureSt; -in vec4 tile_featureColor; -void main() -{ - tile_color(tile_featureColor); -`,n&&(i+=` out_FragColor.rgb *= out_FragColor.a; -`),i+="}"):(e&&(i+=`uniform bool tile_translucentCommand; -`),i+=`uniform sampler2D tile_pickTexture; -uniform sampler2D tile_batchTexture; -in vec2 tile_featureSt; -void main() -{ - vec4 featureProperties = texture(tile_batchTexture, tile_featureSt); - if (featureProperties.a == 0.0) { - discard; - } -`,e&&(i+=` bool isStyleTranslucent = (featureProperties.a != 1.0); - if (czm_pass == czm_passTranslucent) - { - if (!isStyleTranslucent && !tile_translucentCommand) - { - discard; - } - } - else - { - if (isStyleTranslucent) - { - discard; - } - } -`),i+=` tile_color(featureProperties); -`,n&&(i+=` out_FragColor.rgb *= out_FragColor.a; -`),i+=`} -`),i}};function CJe(e){let t=e._content.tileset,n=t.colorBlendMode,i=t.colorBlendAmount;if(n===Xd.HIGHLIGHT)return 0;if(n===Xd.REPLACE)return 1;if(n===Xd.MIX)return W.clamp(i,W.EPSILON4,1)}jo.prototype.getUniformMapCallback=function(){if(this.featuresLength===0)return;let e=this;return function(t){return It(t,{tile_batchTexture:function(){return e._batchTexture.batchTexture??e._batchTexture.defaultTexture},tile_textureDimensions:function(){return e._batchTexture.textureDimensions},tile_textureStep:function(){return e._batchTexture.textureStep},tile_colorBlend:function(){return CJe(e)},tile_pickTexture:function(){return e._batchTexture.pickTexture}})}};jo.prototype.getPickId=function(){return"texture(tile_pickTexture, tile_featureSt)"};var Jy={ALL_OPAQUE:0,ALL_TRANSLUCENT:1,OPAQUE_AND_TRANSLUCENT:2};jo.prototype.addDerivedCommands=function(e,t){let n=e.commandList,i=n.length,o=this._content._tile,r=o._finalResolution,s=o.tileset,a=s.isSkippingLevelOfDetail&&s.hasMixedContent&&e.context.stencilBuffer,c=VJe(this);for(let d=t;d>>Jt.SKIP_LOD_BIT_SHIFT}function IJe(e){let t=$e(e,!0);return t.cull.enabled=!1,t.depthTest.enabled=!0,t.depthMask=!1,t.blending=on.ALPHA_BLEND,t.stencilTest=Jt.setCesium3DTileBit(),t.stencilMask=Jt.CESIUM_3D_TILE_MASK,ze.fromCache(t)}function PJe(e){let t=$e(e,!0);return t.stencilTest=Jt.setCesium3DTileBit(),t.stencilMask=Jt.CESIUM_3D_TILE_MASK,ze.fromCache(t)}jo.prototype.update=function(e,t){this._batchTexture.update(e,t)};jo.prototype.isDestroyed=function(){return!1};jo.prototype.destroy=function(){return this._batchTexture=this._batchTexture&&this._batchTexture.destroy(),ue(this)};var tf=jo;var wWn=x(T(),1);var vLn=x(T(),1);function XJe(e){this.offset=e.offset,this.count=e.count,this.color=e.color,this.batchIds=e.batchIds}var Pp=XJe;var AWn=x(T(),1);var XLn=x(T(),1);var b8=class e{constructor(t,n){this._content=t,this._batchId=n,this._color=void 0}get show(){return this._content.batchTable.getShow(this._batchId)}set show(t){this._content.batchTable.setShow(this._batchId,t)}get color(){return l(this._color)||(this._color=new U),this._content.batchTable.getColor(this._batchId,this._color)}set color(t){this._content.batchTable.setColor(this._batchId,t)}get polylinePositions(){if(l(this._content.getPolylinePositions))return this._content.getPolylinePositions(this._batchId)}get content(){return this._content}get tileset(){return this._content.tileset}get primitive(){return this._content.tileset}get featureId(){return this._batchId}get pickId(){return this._content.batchTable.getPickColor(this._batchId)}hasProperty(t){return this._content.batchTable.hasProperty(this._batchId,t)}getPropertyIds(t){return this._content.batchTable.getPropertyIds(this._batchId,t)}getProperty(t){return this._content.batchTable.getProperty(this._batchId,t)}static getPropertyInherited(t,n,i,o=t.batchTable){if(l(o)){if(o.hasPropertyBySemantic(n,i))return o.getPropertyBySemantic(n,i);if(o.hasProperty(n,i))return o.getProperty(n,i)}let r=t.metadata;if(l(r)){if(r.hasPropertyBySemantic(i))return r.getPropertyBySemantic(i);if(r.hasProperty(i))return r.getProperty(i)}let s=t.tile,a=s.metadata;if(l(a)){if(a.hasPropertyBySemantic(i))return a.getPropertyBySemantic(i);if(a.hasProperty(i))return a.getProperty(i)}let c;if(l(s.implicitSubtree)&&(c=s.implicitSubtree.metadata),l(c)){if(c.hasPropertyBySemantic(i))return c.getPropertyBySemantic(i);if(c.hasProperty(i))return c.getProperty(i)}let d=l(t.group)?t.group.metadata:void 0;if(l(d)){if(d.hasPropertyBySemantic(i))return d.getPropertyBySemantic(i);if(d.hasProperty(i))return d.getProperty(i)}let u=t.tileset.metadata;if(l(u)){if(u.hasPropertyBySemantic(i))return u.getPropertyBySemantic(i);if(u.hasProperty(i))return u.getProperty(i)}}getPropertyInherited(t){return e.getPropertyInherited(this._content,this._batchId,t)}setProperty(t,n){this._content.batchTable.setProperty(this._batchId,t,n),this._content.featurePropertiesDirty=!0}isExactClass(t){return this._content.batchTable.isExactClass(this._batchId,t)}isClass(t){return this._content.batchTable.isClass(this._batchId,t)}getExactClassName(){return this._content.batchTable.getExactClassName(this._batchId)}},ea=b8;var qLn=x(T(),1);var MLn=x(T(),1),g8=class{add(t,n,i){if(typeof arguments[0]!="string")for(let o in arguments[0])this.add(o,arguments[0][o],arguments[1]);else(Array.isArray(t)?t:[t]).forEach(function(o){this[o]=this[o]||[],n&&this[o][i?"unshift":"push"](n)},this)}run(t,n){this[t]=this[t]||[],this[t].forEach(function(i){i.call(n&&n.context?n.context:n,n)})}},y8=class{constructor(t){this.jsep=t,this.registered={}}register(...t){t.forEach(n=>{if(typeof n!="object"||!n.name||!n.init)throw new Error("Invalid JSEP plugin format");this.registered[n.name]||(n.init(this.jsep),this.registered[n.name]=n)})}},Nd=class e{static get version(){return"1.4.0"}static toString(){return"JavaScript Expression Parser (JSEP) v"+e.version}static addUnaryOp(t){return e.max_unop_len=Math.max(t.length,e.max_unop_len),e.unary_ops[t]=1,e}static addBinaryOp(t,n,i){return e.max_binop_len=Math.max(t.length,e.max_binop_len),e.binary_ops[t]=n,i?e.right_associative.add(t):e.right_associative.delete(t),e}static addIdentifierChar(t){return e.additional_identifier_chars.add(t),e}static addLiteral(t,n){return e.literals[t]=n,e}static removeUnaryOp(t){return delete e.unary_ops[t],t.length===e.max_unop_len&&(e.max_unop_len=e.getMaxKeyLen(e.unary_ops)),e}static removeAllUnaryOps(){return e.unary_ops={},e.max_unop_len=0,e}static removeIdentifierChar(t){return e.additional_identifier_chars.delete(t),e}static removeBinaryOp(t){return delete e.binary_ops[t],t.length===e.max_binop_len&&(e.max_binop_len=e.getMaxKeyLen(e.binary_ops)),e.right_associative.delete(t),e}static removeAllBinaryOps(){return e.binary_ops={},e.max_binop_len=0,e}static removeLiteral(t){return delete e.literals[t],e}static removeAllLiterals(){return e.literals={},e}get char(){return this.expr.charAt(this.index)}get code(){return this.expr.charCodeAt(this.index)}constructor(t){this.expr=t,this.index=0}static parse(t){return new e(t).parse()}static getMaxKeyLen(t){return Math.max(0,...Object.keys(t).map(n=>n.length))}static isDecimalDigit(t){return t>=48&&t<=57}static binaryPrecedence(t){return e.binary_ops[t]||0}static isIdentifierStart(t){return t>=65&&t<=90||t>=97&&t<=122||t>=128&&!e.binary_ops[String.fromCharCode(t)]||e.additional_identifier_chars.has(String.fromCharCode(t))}static isIdentifierPart(t){return e.isIdentifierStart(t)||e.isDecimalDigit(t)}throwError(t){let n=new Error(t+" at character "+this.index);throw n.index=this.index,n.description=t,n}runHook(t,n){if(e.hooks[t]){let i={context:this,node:n};return e.hooks.run(t,i),i.node}return n}searchHook(t){if(e.hooks[t]){let n={context:this};return e.hooks[t].find(function(i){return i.call(n.context,n),n.node}),n.node}}gobbleSpaces(){let t=this.code;for(;t===e.SPACE_CODE||t===e.TAB_CODE||t===e.LF_CODE||t===e.CR_CODE;)t=this.expr.charCodeAt(++this.index);this.runHook("gobble-spaces")}parse(){this.runHook("before-all");let t=this.gobbleExpressions(),n=t.length===1?t[0]:{type:e.COMPOUND,body:t};return this.runHook("after-all",n)}gobbleExpressions(t){let n=[],i,o;for(;this.index0;){if(e.binary_ops.hasOwnProperty(t)&&(!e.isIdentifierStart(this.code)||this.index+t.lengthr.right_a&&m.right_a?i>m.prec:i<=m.prec;for(;o.length>2&&u(o[o.length-2]);)a=o.pop(),n=o.pop().value,s=o.pop(),t={type:e.BINARY_EXP,operator:n,left:s,right:a},o.push(t);t=this.gobbleToken(),t||this.throwError("Expected expression after "+d),o.push(r,t)}for(c=o.length-1,t=o[c];c>1;)t={type:e.BINARY_EXP,operator:o[c-1].value,left:o[c-2],right:t},c-=2;return t}gobbleToken(){let t,n,i,o;if(this.gobbleSpaces(),o=this.searchHook("gobble-token"),o)return this.runHook("after-token",o);if(t=this.code,e.isDecimalDigit(t)||t===e.PERIOD_CODE)return this.gobbleNumericLiteral();if(t===e.SQUOTE_CODE||t===e.DQUOTE_CODE)o=this.gobbleStringLiteral();else if(t===e.OBRACK_CODE)o=this.gobbleArray();else{for(n=this.expr.substr(this.index,e.max_unop_len),i=n.length;i>0;){if(e.unary_ops.hasOwnProperty(n)&&(!e.isIdentifierStart(this.code)||this.index+n.length=n.length&&this.throwError("Unexpected token "+String.fromCharCode(t));break}else if(r===e.COMMA_CODE){if(this.index++,o++,o!==n.length){if(t===e.CPAREN_CODE)this.throwError("Unexpected token ,");else if(t===e.CBRACK_CODE)for(let s=n.length;s":7,"<=":7,">=":7,"<<":8,">>":8,">>>":8,"+":9,"-":9,"*":10,"/":10,"%":10,"**":11},right_associative:new Set(["**"]),additional_identifier_chars:new Set(["$","_"]),literals:{true:!0,false:!1,null:null},this_str:"this"});Nd.max_unop_len=Nd.getMaxKeyLen(Nd.unary_ops);Nd.max_binop_len=Nd.getMaxKeyLen(Nd.binary_ops);var jy=e=>new Nd(e).parse(),YJe=Object.getOwnPropertyNames(class{});Object.getOwnPropertyNames(Nd).filter(e=>!YJe.includes(e)&&jy[e]===void 0).forEach(e=>{jy[e]=Nd[e]});jy.Jsep=Nd;var MJe="ConditionalExpression",wJe={name:"ternary",init(e){e.hooks.add("after-expression",function(n){if(n.node&&this.code===e.QUMARK_CODE){this.index++;let i=n.node,o=this.gobbleExpression();if(o||this.throwError("Expected expression"),this.gobbleSpaces(),this.code===e.COLON_CODE){this.index++;let r=this.gobbleExpression();if(r||this.throwError("Expected expression"),n.node={type:MJe,test:i,consequent:o,alternate:r},i.operator&&e.binary_ops[i.operator]<=.9){let s=i;for(;s.right.operator&&e.binary_ops[s.right.operator]<=.9;)s=s.right;n.node.test=s.right,s.right=n.node,n.node=i}}else this.throwError("Expected :")}})}};jy.plugins.register(wJe);var kLn=x(T(),1),Dpe={VARIABLE:0,UNARY:1,BINARY:2,TERNARY:3,CONDITIONAL:4,MEMBER:5,FUNCTION_CALL:6,ARRAY:7,REGEX:8,VARIABLE_IN_STRING:9,LITERAL_NULL:10,LITERAL_BOOLEAN:11,LITERAL_NUMBER:12,LITERAL_STRING:13,LITERAL_COLOR:14,LITERAL_VECTOR:15,LITERAL_REGEX:16,LITERAL_UNDEFINED:17,BUILTIN_VARIABLE:18};Object.freeze(Dpe);var Pt=Dpe;function nf(e,t){this._expression=e,e=$Je(e,t),e=tje(eje(e)),jy.addBinaryOp("=~",0),jy.addBinaryOp("!~",0);let n;try{n=jy(e)}catch(i){throw new ae(i)}this._runtimeAst=ji(this,n)}Object.defineProperties(nf.prototype,{expression:{get:function(){return this._expression}}});var kn={arrayIndex:0,arrayArray:[[]],cartesian2Index:0,cartesian3Index:0,cartesian4Index:0,cartesian2Array:[new k],cartesian3Array:[new h],cartesian4Array:[new ce],reset:function(){this.arrayIndex=0,this.cartesian2Index=0,this.cartesian3Index=0,this.cartesian4Index=0},getArray:function(){this.arrayIndex>=this.arrayArray.length&&this.arrayArray.push([]);let e=this.arrayArray[this.arrayIndex++];return e.length=0,e},getCartesian2:function(){return this.cartesian2Index>=this.cartesian2Array.length&&this.cartesian2Array.push(new k),this.cartesian2Array[this.cartesian2Index++]},getCartesian3:function(){return this.cartesian3Index>=this.cartesian3Array.length&&this.cartesian3Array.push(new h),this.cartesian3Array[this.cartesian3Index++]},getCartesian4:function(){return this.cartesian4Index>=this.cartesian4Array.length&&this.cartesian4Array.push(new ce),this.cartesian4Array[this.cartesian4Index++]}};nf.prototype.evaluate=function(e,t){kn.reset();let n=this._runtimeAst.evaluate(e);return t instanceof U&&n instanceof ce?U.fromCartesian4(n,t):n instanceof k||n instanceof h||n instanceof ce?n.clone(t):n};nf.prototype.evaluateColor=function(e,t){kn.reset();let n=this._runtimeAst.evaluate(e);return U.fromCartesian4(n,t)};nf.prototype.getShaderFunction=function(e,t,n,i){let o=this.getShaderExpression(t,n);return o=`${i} ${e} +`,{uniformMap:{billboard_texture:function(){return e.textureAtlas.texture}}});return i.pass=Le.OVERLAY,i}var yKe=[];vm.prototype.update=function(e){if(u8(this),!this.show)return;let t=e.context;if(!t.instancedArrays||!(wt.maximumVertexTextureImageUnits>0))throw new ge("Beginning in CesiumJS 1.140, billboards and labels require device support for WebGL 2, or WebGL 1 with ANGLE_instanced_arrays and MAX_VERTEX_TEXTURE_IMAGE_UNITS > 0. For more information or to share feedback, see: https://github.com/CesiumGS/cesium/issues/13053");let n=this._billboards,i=n.length,o=!0;for(let L=0;L{if(!this.isDestroyed())return r.update(e.context)}),!l(r.texture))return;pKe(this,e),n=this._billboards,i=n.length;let s=this._billboardsToUpdate,a=this._billboardsToUpdateIndex,c=this._propertiesChanged,d=r.guid,u=this._createVertexArray||this._textureAtlasGUID!==d;this._textureAtlasGUID=d;let m,p=e.passes,b=p.pick;if(u||!b&&this.computeNewBuffersUsage()){this._createVertexArray=!1;for(let L=0;L0){this._vaf=cKe(t,i,this._buffersUsage,this._batchTable,this._sdf),m=this._vaf.writers;for(let L=0;L0){let L=yKe;L.length=0,(c[nF]||c[iKe]||c[nKe])&&L.push(Xpe),(c[G_]||c[Cpe]||c[eKe]||c[tKe]||c[$He])&&(L.push(Ype),L.push(l8)),(c[G_]||c[oKe]||c[Gpe])&&(L.push(Mpe),L.push(c8)),(c[G_]||c[Epe])&&L.push(c8),(c[G_]||c[Vpe])&&L.push(l8),c[Ape]&&L.push(wpe),c[Lpe]&&L.push(kpe),(c[Wpe]||c[rKe]||c[G_]||c[nF])&&L.push(Upe),(c[G_]||c[nF])&&L.push(Dpe),c[vpe]&&L.push(Ope),c[Fpe]&&L.push(Bpe);let F=L.length;if(m=this._vaf.writers,a/i>.1){for(let I=0;Ii*1.5&&(s.length=i),!l(this._vaf)||!l(this._vaf.va))return;this._boundingVolumeDirty&&(this._boundingVolumeDirty=!1,me.transform(this._baseVolume,this.modelMatrix,this._baseVolumeWC));let f,y=P.IDENTITY;e.mode===se.SCENE3D?(y=this.modelMatrix,f=me.clone(this._baseVolumeWC,this._boundingVolume)):f=me.clone(this._baseVolume2D,this._boundingVolume),bKe(this,e,f);let _=this._blendOption!==this.blendOption;if(this._blendOption=this.blendOption,_){this._blendOption===Ni.OPAQUE||this._blendOption===Ni.OPAQUE_AND_TRANSLUCENT?this._rsOpaque=ze.fromCache({depthTest:{enabled:!0,func:ie.LESS},depthMask:!0}):this._rsOpaque=void 0;let L=this._blendOption===Ni.TRANSLUCENT;this._blendOption===Ni.TRANSLUCENT||this._blendOption===Ni.OPAQUE_AND_TRANSLUCENT?this._rsTranslucent=ze.fromCache({depthTest:{enabled:!0,func:L?ie.LEQUAL:ie.LESS},depthMask:L,blending:on.ALPHA_BLEND}):this._rsTranslucent=void 0}this._shaderDisableDepthDistance=this._shaderDisableDepthDistance||e.minimumDisableDepthTestDistance!==0;let S,Z,R,C,E;if(_||this._shaderRotation!==this._compiledShaderRotation||this._shaderAlignedAxis!==this._compiledShaderAlignedAxis||this._shaderScaleByDistance!==this._compiledShaderScaleByDistance||this._shaderTranslucencyByDistance!==this._compiledShaderTranslucencyByDistance||this._shaderPixelOffsetScaleByDistance!==this._compiledShaderPixelOffsetScaleByDistance||this._shaderDistanceDisplayCondition!==this._compiledShaderDistanceDisplayCondition||this._shaderDisableDepthDistance!==this._compiledShaderDisableDepthDistance||this._shaderClampToGround!==this._compiledShaderClampToGround||this._sdf!==this._compiledSDF){S=Cv,Z=Rv,E=["INSTANCED"],l(this._batchTable)&&(E.push("VECTOR_TILE"),S=this._batchTable.getVertexShaderCallback(!1,"a_batchId",void 0)(S),Z=this._batchTable.getFragmentShaderCallback(!1,void 0)(Z)),R=new Je({defines:E,sources:[S]}),this._shaderRotation&&R.defines.push("ROTATION"),this._shaderAlignedAxis&&R.defines.push("ALIGNED_AXIS"),this._shaderScaleByDistance&&R.defines.push("EYE_DISTANCE_SCALING"),this._shaderTranslucencyByDistance&&R.defines.push("EYE_DISTANCE_TRANSLUCENCY"),this._shaderPixelOffsetScaleByDistance&&R.defines.push("EYE_DISTANCE_PIXEL_OFFSET"),this._shaderDistanceDisplayCondition&&R.defines.push("DISTANCE_DISPLAY_CONDITION"),this._shaderDisableDepthDistance&&R.defines.push("DISABLE_DEPTH_DISTANCE"),this._shaderClampToGround&&R.defines.push("VS_THREE_POINT_DEPTH_CHECK");let L=1-Xa.CUTOFF;this._sdf&&R.defines.push("SDF");let F=l(this._batchTable)?"VECTOR_TILE":"";this._blendOption===Ni.OPAQUE_AND_TRANSLUCENT&&(C=new Je({defines:["OPAQUE",F],sources:[Z]}),this._shaderClampToGround&&C.defines.push("VS_THREE_POINT_DEPTH_CHECK"),this._sdf&&(C.defines.push("SDF"),C.defines.push(`SDF_EDGE ${L}`)),this._sp=tn.replaceCache({context:t,shaderProgram:this._sp,vertexShaderSource:R,fragmentShaderSource:C,attributeLocations:Oo}),C=new Je({defines:["TRANSLUCENT",F],sources:[Z]}),this._shaderClampToGround&&C.defines.push("VS_THREE_POINT_DEPTH_CHECK"),this._sdf&&(C.defines.push("SDF"),C.defines.push(`SDF_EDGE ${L}`)),this._spTranslucent=tn.replaceCache({context:t,shaderProgram:this._spTranslucent,vertexShaderSource:R,fragmentShaderSource:C,attributeLocations:Oo})),this._blendOption===Ni.OPAQUE&&(C=new Je({defines:[F],sources:[Z]}),this._shaderClampToGround&&C.defines.push("VS_THREE_POINT_DEPTH_CHECK"),this._sdf&&(C.defines.push("SDF"),C.defines.push(`SDF_EDGE ${L}`)),this._sp=tn.replaceCache({context:t,shaderProgram:this._sp,vertexShaderSource:R,fragmentShaderSource:C,attributeLocations:Oo})),this._blendOption===Ni.TRANSLUCENT&&(C=new Je({defines:[F],sources:[Z]}),this._shaderClampToGround&&C.defines.push("VS_THREE_POINT_DEPTH_CHECK"),this._sdf&&(C.defines.push("SDF"),C.defines.push(`SDF_EDGE ${L}`)),this._spTranslucent=tn.replaceCache({context:t,shaderProgram:this._spTranslucent,vertexShaderSource:R,fragmentShaderSource:C,attributeLocations:Oo})),this._compiledShaderRotation=this._shaderRotation,this._compiledShaderAlignedAxis=this._shaderAlignedAxis,this._compiledShaderScaleByDistance=this._shaderScaleByDistance,this._compiledShaderTranslucencyByDistance=this._shaderTranslucencyByDistance,this._compiledShaderPixelOffsetScaleByDistance=this._shaderPixelOffsetScaleByDistance,this._compiledShaderDistanceDisplayCondition=this._shaderDistanceDisplayCondition,this._compiledShaderDisableDepthDistance=this._shaderDisableDepthDistance,this._compiledShaderClampToGround=this._shaderClampToGround,this._compiledSDF=this._sdf}let A=e.commandList;if(p.render||p.pick){let L=this._colorCommands,F=this._blendOption===Ni.OPAQUE,I=this._blendOption===Ni.OPAQUE_AND_TRANSLUCENT,N=this._vaf.va,g=N.length,V=this._uniforms,G;l(this._batchTable)?(V=this._batchTable.getUniformMapCallback()(V),G=this._batchTable.getPickId()):G="v_pickColor",L.length=g;let v=I?g*2:g;for(let X=0;X]/,o=[],r="",s=ea.LTR,a="",c=e.length;for(let d=0;d";case">":return"<"}}var CKe="\u05D0-\u05EA",VKe="\u0600-\u06FF\u0750-\u077F\u08A0-\u08FF",Jpe=new RegExp(`[${CKe}${VKe}]`);function EKe(e){let t=e.split(` +`),n="";for(let i=0;id+1?s[d+1].Type===ea.RTL?(c=m+c,a=0):(c=rF(c,a,u.Word),a+=u.Word.length):c=rF(c,0,m)):u.Type===ea.RTL?c=rF(c,a,m):u.Type===ea.LTR?(c+=u.Word,a=c.length):(u.Type===ea.WEAK||u.Type===ea.BRACKETS)&&(d>0&&s[d-1].Type===ea.RTL?s.length>d+1?s[d+1].Type===ea.RTL?c=rF(c,a,m):(c+=u.Word,a=c.length):c+=u.Word:(c+=u.Word,a=c.length))}n+=c,i0&&A.height>0&&!YKe.test(b)){let L=(0,o0e.default)(A,{cutoff:Xa.CUTOFF,radius:Xa.RADIUS}),F=A.getContext("2d"),I=A.width,N=A.height,g=F.getImageData(0,0,I,N);for(let V=0;V0?R=C.pop():(R=d.add({collection:e}),R._labelDimensions=new k,R._labelTranslate=new k,R._positionFromParent=!0),Z.billboard=R),R.setImageTexture(S),R.show=t._show,R.position=t._position,R.eyeOffset=t._eyeOffset,R.pixelOffset=t._pixelOffset,R.horizontalOrigin=Di.LEFT,R.verticalOrigin=t._verticalOrigin,R.heightReference=t._heightReference,l(t._clampedPosition)&&(R._clampedPosition=t._clampedPosition),R.scale=t.totalScale,R.pickPrimitive=t,R.id=t._id,R.translucencyByDistance=t._translucencyByDistance,R.pixelOffsetScaleByDistance=t._pixelOffsetScaleByDistance,R.scaleByDistance=t._scaleByDistance,R.distanceDisplayCondition=t._distanceDisplayCondition,R.disableDepthTestDistance=t._disableDepthTestDistance,R._batchIndex=t._batchIndex,R.outlineColor=t.outlineColor,t.style===yr.FILL_AND_OUTLINE?(R.color=t._fillColor,R.outlineWidth=t.outlineWidth):t.style===yr.FILL?(R.color=t._fillColor,R.outlineWidth=0):t.style===yr.OUTLINE&&(R.color=U.TRANSPARENT,R.outlineWidth=t.outlineWidth)}t._repositionAllGlyphs=!0}function wKe(e,t,n){if(!l(n))return;let i=t.show&&t._showBackground&&t._renderedText.split(` +`).join("").length>0;if(t.show&&!i){e.remove(n),t._backgroundBillboard=void 0;return}n.color=t._backgroundColor,n.show=t._show,n.position=t._position,n.eyeOffset=t._eyeOffset,n.pixelOffset=t._pixelOffset,n.horizontalOrigin=Di.LEFT,n.verticalOrigin=t._verticalOrigin,n.heightReference=t._heightReference,l(t._clampedPosition)&&(n._clampedPosition=t._clampedPosition),n.scale=t.totalScale,n.pickPrimitive=t,n.id=t._id,n.translucencyByDistance=t._translucencyByDistance,n.pixelOffsetScaleByDistance=t._pixelOffsetScaleByDistance,n.scaleByDistance=t._scaleByDistance,n.distanceDisplayCondition=t._distanceDisplayCondition,n.disableDepthTestDistance=t._disableDepthTestDistance,n.clusterShow=t.clusterShow}function i0e(e,t,n){return t===Di.CENTER?-e/2:t===Di.RIGHT?-(e+n.x):n.x}var Dr=new k,kKe=new k;function UKe(e){let t=e._glyphs,n=e._renderedText,i=0,o=0,r=[],s=Number.NEGATIVE_INFINITY,a=0,c=1,d=t.length,u=e._backgroundBillboard,m=k.clone(l(u)?e._backgroundPadding:k.ZERO,kKe);m.x/=e._relativeSize,m.y/=e._relativeSize;for(let I=0;I0&&(f===Di.CENTER?Z=-o/2-m.x:f===Di.RIGHT?Z=-(o+m.x*2):Z=0,Dr.x=Z*b,y===zn.TOP?Dr.y=p-a-s:y===zn.CENTER?Dr.y=(p-a)/2-s:y===zn.BASELINE?Dr.y=-m.y-s:Dr.y=0,Dr.y=Dr.y*b,u.width=E,u.height=A,u._setTranslate(Dr),u._labelTranslate=k.clone(Dr,u._labelTranslate))}function s0e(e,t){let n=t._glyphs;for(let i=0,o=n.length;i0?Ni.TRANSLUCENT:this.blendOption;t.blendOption=o,n.blendOption=o,t._highlightColor=this._highlightColor,n._highlightColor=this._highlightColor,this._labelsToUpdate.length=0,n.update(e),t.update(e)};Pp.prototype.isDestroyed=function(){return!1};Pp.prototype.destroy=function(){return this.removeAll(),this._glyphBillboardCollection=this._glyphBillboardCollection.destroy(),this._backgroundBillboardCollection=this._backgroundBillboardCollection.destroy(),ue(this)};var Xp=Pp;var z1n=x(T(),1);function os(e,t){e=e??B.EMPTY_OBJECT;let n=e.translucencyByDistance,i=e.scaleByDistance,o=e.distanceDisplayCondition;l(n)&&(n=Kt.clone(n)),l(i)&&(i=Kt.clone(i)),l(o)&&(o=Bt.clone(o)),this._show=e.show??!0,this._position=h.clone(e.position??h.ZERO),this._actualPosition=h.clone(this._position),this._color=U.clone(e.color??U.WHITE),this._outlineColor=U.clone(e.outlineColor??U.TRANSPARENT),this._outlineWidth=e.outlineWidth??0,this._pixelSize=e.pixelSize??10,this._scaleByDistance=i,this._translucencyByDistance=n,this._distanceDisplayCondition=o,this._disableDepthTestDistance=e.disableDepthTestDistance??0,this._id=e.id,this._collection=e.collection??t,this._clusterShow=!0,this._pickId=void 0,this._pointPrimitiveCollection=t,this._dirty=!1,this._index=-1,this._splitDirection=e.splitDirection??Ur.NONE}var a0e=os.SHOW_INDEX=0,d0e=os.POSITION_INDEX=1,DKe=os.COLOR_INDEX=2,OKe=os.OUTLINE_COLOR_INDEX=3,BKe=os.OUTLINE_WIDTH_INDEX=4,zKe=os.PIXEL_SIZE_INDEX=5,HKe=os.SCALE_BY_DISTANCE_INDEX=6,KKe=os.TRANSLUCENCY_BY_DISTANCE_INDEX=7,JKe=os.DISTANCE_DISPLAY_CONDITION_INDEX=8,jKe=os.DISABLE_DEPTH_DISTANCE_INDEX=9,QKe=os.SPLIT_DIRECTION_INDEX=10;os.NUMBER_OF_PROPERTIES=11;function Vu(e,t){let n=e._pointPrimitiveCollection;l(n)&&(n._updatePointPrimitive(e,t),e._dirty=!0)}Object.defineProperties(os.prototype,{show:{get:function(){return this._show},set:function(e){this._show!==e&&(this._show=e,Vu(this,a0e))}},position:{get:function(){return this._position},set:function(e){let t=this._position;h.equals(t,e)||(h.clone(e,t),h.clone(e,this._actualPosition),Vu(this,d0e))}},scaleByDistance:{get:function(){return this._scaleByDistance},set:function(e){let t=this._scaleByDistance;Kt.equals(t,e)||(this._scaleByDistance=Kt.clone(e,t),Vu(this,HKe))}},translucencyByDistance:{get:function(){return this._translucencyByDistance},set:function(e){let t=this._translucencyByDistance;Kt.equals(t,e)||(this._translucencyByDistance=Kt.clone(e,t),Vu(this,KKe))}},pixelSize:{get:function(){return this._pixelSize},set:function(e){this._pixelSize!==e&&(this._pixelSize=e,Vu(this,zKe))}},color:{get:function(){return this._color},set:function(e){let t=this._color;U.equals(t,e)||(U.clone(e,t),Vu(this,DKe))}},outlineColor:{get:function(){return this._outlineColor},set:function(e){let t=this._outlineColor;U.equals(t,e)||(U.clone(e,t),Vu(this,OKe))}},outlineWidth:{get:function(){return this._outlineWidth},set:function(e){this._outlineWidth!==e&&(this._outlineWidth=e,Vu(this,BKe))}},distanceDisplayCondition:{get:function(){return this._distanceDisplayCondition},set:function(e){Bt.equals(this._distanceDisplayCondition,e)||(this._distanceDisplayCondition=Bt.clone(e,this._distanceDisplayCondition),Vu(this,JKe))}},disableDepthTestDistance:{get:function(){return this._disableDepthTestDistance},set:function(e){this._disableDepthTestDistance!==e&&(this._disableDepthTestDistance=e,Vu(this,jKe))}},id:{get:function(){return this._id},set:function(e){this._id=e,l(this._pickId)&&(this._pickId.object.id=e)}},pickId:{get:function(){return this._pickId}},clusterShow:{get:function(){return this._clusterShow},set:function(e){this._clusterShow!==e&&(this._clusterShow=e,Vu(this,a0e))}},splitDirection:{get:function(){return this._splitDirection},set:function(e){this._splitDirection!==e&&(this._splitDirection=e,Vu(this,QKe))}}});os.prototype.getPickId=function(e){return l(this._pickId)||(this._pickId=e.createPickId({primitive:this,collection:this._collection,id:this._id})),this._pickId};os.prototype._getActualPosition=function(){return this._actualPosition};os.prototype._setActualPosition=function(e){h.clone(e,this._actualPosition),Vu(this,d0e)};var c0e=new ce;os._computeActualPosition=function(e,t,n){return t.mode===se.SCENE3D?e:(P.multiplyByPoint(n,e,c0e),fo.computeActualEllipsoidPosition(t,c0e))};var l0e=new ce;os._computeScreenSpacePosition=function(e,t,n,i){let o=P.multiplyByVector(e,ce.fromElements(t.x,t.y,t.z,1,l0e),l0e);return fo.worldToWindowCoordinates(n,o,i)};os.prototype.computeScreenSpacePosition=function(e,t){let n=this._pointPrimitiveCollection;l(t)||(t=new k);let i=n.modelMatrix,o=os._computeScreenSpacePosition(i,this._actualPosition,e,t);if(l(o))return o.y=e.canvas.clientHeight-o.y,o};os.getScreenSpaceBoundingBox=function(e,t,n){let i=e.pixelSize,o=i*.5,r=t.x-o,s=t.y-o,a=i,c=i;return l(n)||(n=new nt),n.x=r,n.y=s,n.width=a,n.height=c,n};os.prototype.equals=function(e){return this===e||l(e)&&this._id===e._id&&h.equals(this._position,e._position)&&U.equals(this._color,e._color)&&this._pixelSize===e._pixelSize&&this._outlineWidth===e._outlineWidth&&this._show===e._show&&U.equals(this._outlineColor,e._outlineColor)&&Kt.equals(this._scaleByDistance,e._scaleByDistance)&&Kt.equals(this._translucencyByDistance,e._translucencyByDistance)&&Bt.equals(this._distanceDisplayCondition,e._distanceDisplayCondition)&&this._disableDepthTestDistance===e._disableDepthTestDistance&&this._splitDirection===e._splitDirection};os.prototype._destroy=function(){this._pickId=this._pickId&&this._pickId.destroy(),this._pointPrimitiveCollection=void 0};var pa=os;var TCn=x(T(),1);var qKe=pa.SHOW_INDEX,g8=pa.POSITION_INDEX,u0e=pa.COLOR_INDEX,$Ke=pa.OUTLINE_COLOR_INDEX,eJe=pa.OUTLINE_WIDTH_INDEX,tJe=pa.PIXEL_SIZE_INDEX,m0e=pa.SCALE_BY_DISTANCE_INDEX,h0e=pa.TRANSLUCENCY_BY_DISTANCE_INDEX,f0e=pa.DISTANCE_DISPLAY_CONDITION_INDEX,nJe=pa.DISABLE_DEPTH_DISTANCE_INDEX,iJe=pa.SPLIT_DIRECTION_INDEX,y8=pa.NUMBER_OF_PROPERTIES,$c={positionHighAndSize:0,positionLowAndOutline:1,compressedAttribute0:2,compressedAttribute1:3,scaleByDistance:4,distanceDisplayConditionAndDisableDepthAndSplitDirection:5};function Fm(e){e=e??B.EMPTY_OBJECT,this._sp=void 0,this._spTranslucent=void 0,this._rsOpaque=void 0,this._rsTranslucent=void 0,this._vaf=void 0,this._pointPrimitives=[],this._pointPrimitivesToUpdate=[],this._pointPrimitivesToUpdateIndex=0,this._pointPrimitivesRemoved=!1,this._createVertexArray=!1,this._shaderScaleByDistance=!1,this._compiledShaderScaleByDistance=!1,this._shaderTranslucencyByDistance=!1,this._compiledShaderTranslucencyByDistance=!1,this._shaderDistanceDisplayCondition=!1,this._compiledShaderDistanceDisplayCondition=!1,this._shaderDisableDepthDistance=!1,this._compiledShaderDisableDepthDistance=!1,this._propertiesChanged=new Uint32Array(y8),this._maxPixelSize=1,this._baseVolume=new me,this._baseVolumeWC=new me,this._baseVolume2D=new me,this._boundingVolume=new me,this._boundingVolumeDirty=!1,this._colorCommands=[],this.show=e.show??!0,this.modelMatrix=P.clone(e.modelMatrix??P.IDENTITY),this._modelMatrix=P.clone(P.IDENTITY),this.debugShowBoundingVolume=e.debugShowBoundingVolume??!1,this.blendOption=e.blendOption??Ni.OPAQUE_AND_TRANSLUCENT,this._blendOption=void 0,this._mode=se.SCENE3D,this._maxTotalPointSize=1,this._buffersUsage=[Pe.STATIC_DRAW,Pe.STATIC_DRAW,Pe.STATIC_DRAW,Pe.STATIC_DRAW,Pe.STATIC_DRAW,Pe.STATIC_DRAW,Pe.STATIC_DRAW,Pe.STATIC_DRAW,Pe.STATIC_DRAW];let t=this;this._uniforms={u_maxTotalPointSize:function(){return t._maxTotalPointSize}}}Object.defineProperties(Fm.prototype,{length:{get:function(){return x8(this),this._pointPrimitives.length}}});function p0e(e){let t=e.length;for(let n=0;n0&&(e._shaderDisableDepthDistance=!0,d===Number.POSITIVE_INFINITY&&(d=-1));let u=0,m=i.splitDirection;l(m)&&(u=m),r(o,s,a,d,u)}function sJe(e,t,n,i){b0e(e,t,n,i),g0e(e,t,n,i),y0e(e,t,n,i),x0e(e,t,n,i),T0e(e,t,n,i)}function b8(e,t,n,i,o,r){let s;i.mode===se.SCENE3D?(s=e._baseVolume,e._boundingVolumeDirty=!0):s=e._baseVolume2D;let a=[];for(let c=0;c0){this._vaf=oJe(c,n,this._buffersUsage),a=this._vaf.writers;for(let E=0;E0){let E=lJe;E.length=0,(r[g8]||r[eJe]||r[tJe])&&E.push(b0e),(r[u0e]||r[$Ke])&&E.push(g0e),(r[qKe]||r[h0e])&&E.push(y0e),r[m0e]&&E.push(x0e),(r[f0e]||r[nJe]||r[iJe])&&E.push(T0e);let A=E.length;if(a=this._vaf.writers,o/n>.1){for(let L=0;Ln*1.5&&(i.length=n),!l(this._vaf)||!l(this._vaf.va))return;this._boundingVolumeDirty&&(this._boundingVolumeDirty=!1,me.transform(this._baseVolume,this.modelMatrix,this._baseVolumeWC));let m,p=P.IDENTITY;e.mode===se.SCENE3D?(p=this.modelMatrix,m=me.clone(this._baseVolumeWC,this._boundingVolume)):m=me.clone(this._baseVolume2D,this._boundingVolume),cJe(this,e,m);let b=this._blendOption!==this.blendOption;this._blendOption=this.blendOption,b&&(this._blendOption===Ni.OPAQUE||this._blendOption===Ni.OPAQUE_AND_TRANSLUCENT?this._rsOpaque=ze.fromCache({depthTest:{enabled:!0,func:ie.LEQUAL},depthMask:!0}):this._rsOpaque=void 0,this._blendOption===Ni.TRANSLUCENT||this._blendOption===Ni.OPAQUE_AND_TRANSLUCENT?this._rsTranslucent=ze.fromCache({depthTest:{enabled:!0,func:ie.LEQUAL},depthMask:!1,blending:on.ALPHA_BLEND}):this._rsTranslucent=void 0),this._shaderDisableDepthDistance=this._shaderDisableDepthDistance||e.minimumDisableDepthTestDistance!==0;let f,y;(b||this._shaderScaleByDistance&&!this._compiledShaderScaleByDistance||this._shaderTranslucencyByDistance&&!this._compiledShaderTranslucencyByDistance||this._shaderDistanceDisplayCondition&&!this._compiledShaderDistanceDisplayCondition||this._shaderDisableDepthDistance!==this._compiledShaderDisableDepthDistance)&&(f=new Je({sources:[Jv]}),this._shaderScaleByDistance&&f.defines.push("EYE_DISTANCE_SCALING"),this._shaderTranslucencyByDistance&&f.defines.push("EYE_DISTANCE_TRANSLUCENCY"),this._shaderDistanceDisplayCondition&&f.defines.push("DISTANCE_DISPLAY_CONDITION"),this._shaderDisableDepthDistance&&f.defines.push("DISABLE_DEPTH_DISTANCE"),this._blendOption===Ni.OPAQUE_AND_TRANSLUCENT&&(y=new Je({defines:["OPAQUE"],sources:[Ny]}),this._sp=tn.replaceCache({context:c,shaderProgram:this._sp,vertexShaderSource:f,fragmentShaderSource:y,attributeLocations:$c}),y=new Je({defines:["TRANSLUCENT"],sources:[Ny]}),this._spTranslucent=tn.replaceCache({context:c,shaderProgram:this._spTranslucent,vertexShaderSource:f,fragmentShaderSource:y,attributeLocations:$c})),this._blendOption===Ni.OPAQUE&&(y=new Je({sources:[Ny]}),this._sp=tn.replaceCache({context:c,shaderProgram:this._sp,vertexShaderSource:f,fragmentShaderSource:y,attributeLocations:$c})),this._blendOption===Ni.TRANSLUCENT&&(y=new Je({sources:[Ny]}),this._spTranslucent=tn.replaceCache({context:c,shaderProgram:this._spTranslucent,vertexShaderSource:f,fragmentShaderSource:y,attributeLocations:$c})),this._compiledShaderScaleByDistance=this._shaderScaleByDistance,this._compiledShaderTranslucencyByDistance=this._shaderTranslucencyByDistance,this._compiledShaderDistanceDisplayCondition=this._shaderDistanceDisplayCondition,this._compiledShaderDisableDepthDistance=this._shaderDisableDepthDistance);let _,S,Z,R,C=e.commandList;if(d.render||u){let E=this._colorCommands,A=this._blendOption===Ni.OPAQUE,L=this._blendOption===Ni.OPAQUE_AND_TRANSLUCENT;_=this._vaf.va,S=_.length,E.length=S;let F=L?S*2:S;for(R=0;R>4;if(o!==T8)throw new Error(`Got v${o} data when expected v${T8}.`);let r=_0e[i&15];if(!r)throw new Error("Unrecognized array type.");let[s]=new Uint16Array(t,2,1),[a]=new Uint32Array(t,4,1);return new e(a,s,r,void 0,t)}constructor(t,n=64,i=Float64Array,o=ArrayBuffer,r){if(isNaN(t)||t<0)throw new Error(`Unexpected numItems value: ${t}.`);this.numItems=+t,this.nodeSize=Math.min(Math.max(+n,2),65535),this.ArrayType=i,this.IndexArrayType=t<65536?Uint16Array:Uint32Array;let s=_0e.indexOf(this.ArrayType),a=t*2*this.ArrayType.BYTES_PER_ELEMENT,c=t*this.IndexArrayType.BYTES_PER_ELEMENT,d=(8-c%8)%8;if(s<0)throw new Error(`Unexpected typed array class: ${i}.`);if(r)this.data=r,this.ids=new this.IndexArrayType(r,aF,t),this.coords=new i(r,aF+c+d,t*2),this._pos=t*2,this._finished=!0;else{let u=this.data=new o(aF+a+c+d);this.ids=new this.IndexArrayType(u,aF,t),this.coords=new i(u,aF+c+d,t*2),this._pos=0,this._finished=!1,new Uint8Array(u,0,2).set([219,(T8<<4)+s]),new Uint16Array(u,2,1)[0]=n,new Uint32Array(u,4,1)[0]=t}}add(t,n){let i=this._pos>>1;return this.ids[i]=i,this.coords[this._pos++]=t,this.coords[this._pos++]=n,i}finish(){let t=this._pos>>1;if(t!==this.numItems)throw new Error(`Added ${t} items when expected ${this.numItems}.`);return S8(this.ids,this.coords,this.nodeSize,0,this.numItems-1,0),this._finished=!0,this}range(t,n,i,o){if(!this._finished)throw new Error("Data not yet indexed - call index.finish().");let{ids:r,coords:s,nodeSize:a}=this;rs[0]=0,rs[1]=r.length-1,rs[2]=0;let c=3,d=[];for(;c>0;){let u=rs[--c],m=rs[--c],p=rs[--c];if(m-p<=a){for(let _=p;_<=m;_++){let S=s[2*_],Z=s[2*_+1];S>=t&&S<=i&&Z>=n&&Z<=o&&d.push(r[_])}continue}let b=p+m>>1,f=s[2*b],y=s[2*b+1];f>=t&&f<=i&&y>=n&&y<=o&&d.push(r[b]),(u===0?t<=f:n<=y)&&(rs[c++]=p,rs[c++]=b-1,rs[c++]=1-u),(u===0?i>=f:o>=y)&&(rs[c++]=b+1,rs[c++]=m,rs[c++]=1-u)}return d}within(t,n,i){let o=[];return this.withinInto(t,n,i,o),o}withinInto(t,n,i,o){if(!this._finished)throw new Error("Data not yet indexed - call index.finish().");let{ids:r,coords:s,nodeSize:a}=this;rs[0]=0,rs[1]=r.length-1,rs[2]=0;let c=3,d=0,u=i*i;for(;c>0;){let m=rs[--c],p=rs[--c],b=rs[--c];if(p-b<=a){for(let S=b;S<=p;S++)S0e(s[2*S],s[2*S+1],t,n)<=u&&(o[d++]=r[S]);continue}let f=b+p>>1,y=s[2*f],_=s[2*f+1];S0e(y,_,t,n)<=u&&(o[d++]=r[f]),(m===0?t-i<=y:n-i<=_)&&(rs[c++]=b,rs[c++]=f-1,rs[c++]=1-m),(m===0?t+i>=y:n+i>=_)&&(rs[c++]=f+1,rs[c++]=p,rs[c++]=1-m)}return d}};function S8(e,t,n,i,o,r){if(o-i<=n)return;let s=i+o>>1;Z0e(e,t,s,i,o,r),S8(e,t,n,i,s-1,1-r),S8(e,t,n,s+1,o,1-r)}function Z0e(e,t,n,i,o,r){for(;o>i;){if(o-i>600){let d=o-i+1,u=n-i+1,m=Math.log(d),p=.5*Math.exp(2*m/3),b=.5*Math.sqrt(m*p*(d-p)/d)*(u-d/2<0?-1:1),f=Math.max(i,Math.floor(n-u*p/d+b)),y=Math.min(o,Math.floor(n+(d-u)*p/d+b));Z0e(e,t,n,f,y,r)}let s=t[2*n+r],a=i,c=o;for(cF(e,t,i,n),t[2*o+r]>s&&cF(e,t,i,o);as;)c--}t[2*i+r]===s?cF(e,t,i,c):(c++,cF(e,t,c,o)),c<=n&&(i=c+1),n<=c&&(o=c-1)}}function cF(e,t,n,i){_8(e,n,i),_8(t,2*n,2*i),_8(t,2*n+1,2*i+1)}function _8(e,t,n){let i=e[t];e[t]=e[n],e[n]=i}function S0e(e,t,n,i){let o=e-n,r=t-i;return o*o+r*r}function jh(e){e=e??B.EMPTY_OBJECT,this._enabled=e.enabled??!1,this._pixelRange=e.pixelRange??80,this._minimumClusterSize=e.minimumClusterSize??2,this._clusterBillboards=e.clusterBillboards??!0,this._clusterLabels=e.clusterLabels??!0,this._clusterPoints=e.clusterPoints??!0,this._labelCollection=void 0,this._billboardCollection=void 0,this._pointCollection=void 0,this._clusterBillboardCollection=void 0,this._clusterLabelCollection=void 0,this._clusterPointCollection=void 0,this._collectionIndicesByEntity={},this._unusedLabelIndices=[],this._unusedBillboardIndices=[],this._unusedPointIndices=[],this._previousClusters=[],this._previousHeight=void 0,this._enabledDirty=!1,this._clusterDirty=!1,this._cluster=void 0,this._removeEventListener=void 0,this._clusterEvent=new Se,this.show=e.show??!0}function R0e(e,t){e.x-=t,e.y-=t,e.width+=t*2,e.height+=t*2}var dJe=new nt;function C0e(e,t,n,i,o){if(l(e._labelCollection)&&i._clusterLabels?o=By.getScreenSpaceBoundingBox(e,t,o):l(e._billboardCollection)&&i._clusterBillboards?o=Mo.getScreenSpaceBoundingBox(e,t,o):l(e._pointPrimitiveCollection)&&i._clusterPoints&&(o=pa.getScreenSpaceBoundingBox(e,t,o)),R0e(o,n),i._clusterLabels&&!l(e._labelCollection)&&l(e.id)&&E0e(i,e.id.id)&&l(e.id._label)){let r=i._collectionIndicesByEntity[e.id.id].labelIndex,s=i._labelCollection.get(r),a=By.getScreenSpaceBoundingBox(s,t,dJe);R0e(a,n),o=nt.union(o,a,o)}return o}function uJe(e,t){if(e.clusterShow=!0,!l(e._labelCollection)&&l(e.id)&&E0e(t,e.id.id)&&l(e.id._label)){let n=t._collectionIndicesByEntity[e.id.id].labelIndex,i=t._labelCollection.get(n);i.clusterShow=!0}}function V0e(e,t,n,i){let o={billboard:i._clusterBillboardCollection.add(),label:i._clusterLabelCollection.add(),point:i._clusterPointCollection.add()};o.billboard.show=!1,o.point.show=!1,o.label.show=!0,o.label.text=t.toLocaleString(),o.label.id=n,o.billboard.position=o.label.position=o.point.position=e,i._clusterEvent.raiseEvent(n,o)}function E0e(e,t){return l(e)&&l(e._collectionIndicesByEntity[t])&&l(e._collectionIndicesByEntity[t].labelIndex)}function Z8(e,t,n,i,o){if(!l(e))return;let r=e.length;for(let s=0;s0){let X=new lF(Z.length,64,Float64Array);for(let Y=0;Y=u)for(V0e(Y.position,V,g,e),p.push(Y),C=0;C=u){let w=h.multiplyByScalar(O,1/V,O);for(V0e(w,V,g,e),p.push({position:w,width:M.width,height:M.height,minimumWidth:A.width,minimumHeight:A.height}),C=0;C0?(a=d.shift(),c=r.get(a)):(c=r.add(),a=r.length-1),s[i]=a;let u=this;return Promise.resolve().then(function(){u._clusterDirty=!0}),c}}function V8(e,t){let n=e._collectionIndicesByEntity[t];!l(n.billboardIndex)&&!l(n.labelIndex)&&!l(n.pointIndex)&&delete e._collectionIndicesByEntity[t]}jh.prototype.getLabel=C8("_labelCollection",Xp,"_unusedLabelIndices","labelIndex");jh.prototype.removeLabel=function(e){let t=this._collectionIndicesByEntity&&this._collectionIndicesByEntity[e.id];if(!l(this._labelCollection)||!l(t)||!l(t.labelIndex))return;let n=t.labelIndex;t.labelIndex=void 0,V8(this,e.id);let i=this._labelCollection.get(n);i.show=!1,i.text="",i.id=void 0,this._unusedLabelIndices.push(n),this._clusterDirty=!0};jh.prototype.getBillboard=C8("_billboardCollection",Cu,"_unusedBillboardIndices","billboardIndex");jh.prototype.removeBillboard=function(e){let t=this._collectionIndicesByEntity&&this._collectionIndicesByEntity[e.id];if(!l(this._billboardCollection)||!l(t)||!l(t.billboardIndex))return;let n=t.billboardIndex;t.billboardIndex=void 0,V8(this,e.id);let i=this._billboardCollection.get(n);i.id=void 0,i.show=!1,i.image=void 0,this._unusedBillboardIndices.push(n),this._clusterDirty=!0};jh.prototype.getPoint=C8("_pointCollection",L1,"_unusedPointIndices","pointIndex");jh.prototype.removePoint=function(e){let t=this._collectionIndicesByEntity&&this._collectionIndicesByEntity[e.id];if(!l(this._pointCollection)||!l(t)||!l(t.pointIndex))return;let n=t.pointIndex;t.pointIndex=void 0,V8(this,e.id);let i=this._pointCollection.get(n);i.show=!1,i.id=void 0,this._unusedPointIndices.push(n),this._clusterDirty=!0};function R8(e){if(!l(e))return;let t=e.length;for(let n=0;n0&&!n.ready&&(t=e.commandList,e.commandList=[],n.update(e),e.commandList=t);let i=this._billboardCollection;l(i)&&i.length>0&&!i.ready&&(t=e.commandList,e.commandList=[],i.update(e),e.commandList=t),this._enabledDirty&&(this._enabledDirty=!1,bJe(this),this._clusterDirty=!0),this._clusterDirty&&(this._cluster(),this._clusterDirty=l(n)&&!n.ready||l(i)&&!i.ready),l(this._clusterLabelCollection)&&this._clusterLabelCollection.update(e),l(this._clusterBillboardCollection)&&this._clusterBillboardCollection.update(e),l(this._clusterPointCollection)&&this._clusterPointCollection.update(e),l(n)&&n.update(e),l(i)&&i.update(e),l(this._pointCollection)&&this._pointCollection.update(e)};jh.prototype.destroy=function(){l(this._removeEventListener)&&(this._removeEventListener(),this._removeEventListener=void 0),this._labelCollection=this._labelCollection&&this._labelCollection.destroy(),this._billboardCollection=this._billboardCollection&&this._billboardCollection.destroy(),this._pointCollection=this._pointCollection&&this._pointCollection.destroy(),this._clusterLabelCollection=this._clusterLabelCollection&&this._clusterLabelCollection.destroy(),this._clusterBillboardCollection=this._clusterBillboardCollection&&this._clusterBillboardCollection.destroy(),this._clusterPointCollection=this._clusterPointCollection&&this._clusterPointCollection.destroy(),this._labelCollection=void 0,this._billboardCollection=void 0,this._pointCollection=void 0,this._clusterBillboardCollection=void 0,this._clusterLabelCollection=void 0,this._clusterPointCollection=void 0,this._collectionIndicesByEntity=void 0,this._unusedLabelIndices=[],this._unusedBillboardIndices=[],this._unusedPointIndices=[],this._previousClusters=[],this._previousHeight=void 0,this._enabledDirty=!1,this._pixelRangeDirty=!1,this._minimumClusterSizeDirty=!1};var Eu=jh;var GLn=x(T(),1);var jCn=x(T(),1);var zCn=x(T(),1);function vr(e){e=e??B.EMPTY_OBJECT,this.start=l(e.start)?Q.clone(e.start):new Q,this.stop=l(e.stop)?Q.clone(e.stop):new Q,this.data=e.data,this.isStartIncluded=e.isStartIncluded??!0,this.isStopIncluded=e.isStopIncluded??!0}Object.defineProperties(vr.prototype,{isEmpty:{get:function(){let e=Q.compare(this.stop,this.start);return e<0||e===0&&(!this.isStartIncluded||!this.isStopIncluded)}}});var W1={start:void 0,stop:void 0,isStartIncluded:void 0,isStopIncluded:void 0,data:void 0};vr.fromIso8601=function(e,t){let n=e.iso8601.split("/");if(n.length!==2)throw new ge("options.iso8601 is an invalid ISO 8601 interval.");let i=Q.fromIso8601(n[0]),o=Q.fromIso8601(n[1]),r=e.isStartIncluded??!0,s=e.isStopIncluded??!0,a=e.data;return l(t)?(t.start=i,t.stop=o,t.isStartIncluded=r,t.isStopIncluded=s,t.data=a,t):(W1.start=i,W1.stop=o,W1.isStartIncluded=r,W1.isStopIncluded=s,W1.data=a,new vr(W1))};vr.toIso8601=function(e,t){return`${Q.toIso8601(e.start,t)}/${Q.toIso8601(e.stop,t)}`};vr.clone=function(e,t){if(l(e))return l(t)?(t.start=e.start,t.stop=e.stop,t.isStartIncluded=e.isStartIncluded,t.isStopIncluded=e.isStopIncluded,t.data=e.data,t):new vr(e)};vr.equals=function(e,t,n){return e===t||l(e)&&l(t)&&(e.isEmpty&&t.isEmpty||e.isStartIncluded===t.isStartIncluded&&e.isStopIncluded===t.isStopIncluded&&Q.equals(e.start,t.start)&&Q.equals(e.stop,t.stop)&&(e.data===t.data||l(n)&&n(e.data,t.data)))};vr.equalsEpsilon=function(e,t,n,i){return n=n??0,e===t||l(e)&&l(t)&&(e.isEmpty&&t.isEmpty||e.isStartIncluded===t.isStartIncluded&&e.isStopIncluded===t.isStopIncluded&&Q.equalsEpsilon(e.start,t.start,n)&&Q.equalsEpsilon(e.stop,t.stop,n)&&(e.data===t.data||l(i)&&i(e.data,t.data)))};vr.intersect=function(e,t,n,i){if(!l(t))return vr.clone(vr.EMPTY,n);let o=e.start,r=e.stop,s=t.start,a=t.stop,c=Q.greaterThanOrEquals(s,o)&&Q.greaterThanOrEquals(r,s),d=!c&&Q.lessThanOrEquals(s,o)&&Q.lessThanOrEquals(o,a);if(!c&&!d)return vr.clone(vr.EMPTY,n);let u=e.isStartIncluded,m=e.isStopIncluded,p=t.isStartIncluded,b=t.isStopIncluded,f=Q.lessThan(r,a);return l(n)||(n=new vr),n.start=c?s:o,n.isStartIncluded=u&&p||!Q.equals(s,o)&&(c&&p||d&&u),n.stop=f?r:a,n.isStopIncluded=f?m:m&&b||!Q.equals(a,r)&&b,n.data=l(i)?i(e.data,t.data):e.data,n};vr.contains=function(e,t){if(e.isEmpty)return!1;let n=Q.compare(e.start,t);if(n===0)return e.isStartIncluded;let i=Q.compare(t,e.stop);return i===0?e.isStopIncluded:n<0&&i<0};vr.prototype.clone=function(e){return vr.clone(this,e)};vr.prototype.equals=function(e,t){return vr.equals(this,e,t)};vr.prototype.equalsEpsilon=function(e,t,n){return vr.equalsEpsilon(this,e,t,n)};vr.prototype.toString=function(){return vr.toIso8601(this)};vr.EMPTY=Object.freeze(new vr({start:new Q,stop:new Q,isStartIncluded:!1,isStopIncluded:!1}));var Cn=vr;var A0e=Object.freeze(Q.fromIso8601("0000-01-01T00:00:00Z")),G0e=Object.freeze(Q.fromIso8601("9999-12-31T24:00:00Z")),gJe=Object.freeze(new Cn({start:A0e,stop:G0e})),yJe={MINIMUM_VALUE:A0e,MAXIMUM_VALUE:G0e,MAXIMUM_INTERVAL:gJe},ot=yJe;var yLn=x(T(),1);var qCn=x(T(),1),L0e={AUTODETECT:0,ENU:1,INERTIAL:2,VELOCITY:3};Object.freeze(L0e);var Zb=L0e;var mVn=x(T(),1);var sVn=x(T(),1);var nVn=x(T(),1);function zy(e){this._value=void 0,this._hasClone=!1,this._hasEquals=!1,this._definitionChanged=new Se,this.setValue(e)}Object.defineProperties(zy.prototype,{isConstant:{value:!0},definitionChanged:{get:function(){return this._definitionChanged}}});zy.prototype.getValue=function(e,t){return this._hasClone?this._value.clone(t):this._value};zy.prototype.setValue=function(e){let t=this._value;if(t!==e){let n=l(e),i=n&&typeof e.clone=="function",o=n&&typeof e.equals=="function";(!o||!e.equals(t))&&(this._hasClone=i,this._hasEquals=o,this._value=i?e.clone(this._value):e,this._definitionChanged.raiseEvent(this))}};zy.prototype.equals=function(e){return this===e||e instanceof zy&&(!this._hasEquals&&this._value===e._value||this._hasEquals&&this._value.equals(e._value))};zy.prototype.valueOf=function(){return this._value};zy.prototype.toString=function(){return String(this._value)};var mi=zy;function xJe(e,t,n,i,o){return{configurable:i,get:function(){return this[t]},set:function(r){let s=this[t],a=this[n];l(a)&&(a(),this[n]=void 0),r!==void 0&&(!l(r)||!l(r.getValue))&&l(o)&&(r=o(r)),s!==r&&(this[t]=r,this._definitionChanged.raiseEvent(this,e,r,s)),l(r)&&l(r.definitionChanged)&&(this[n]=r.definitionChanged.addEventListener(function(){this._definitionChanged.raiseEvent(this,e,r,r)},this))}}}function TJe(e){return new mi(e)}function _Je(e,t,n){return xJe(e,`_${e.toString()}`,`_${e.toString()}Subscription`,t??!1,n??TJe)}var be=_Je;function dF(e){this._definitionChanged=new Se,this._show=void 0,this._showSubscription=void 0,this._image=void 0,this._imageSubscription=void 0,this._scale=void 0,this._scaleSubscription=void 0,this._pixelOffset=void 0,this._pixelOffsetSubscription=void 0,this._eyeOffset=void 0,this._eyeOffsetSubscription=void 0,this._horizontalOrigin=void 0,this._horizontalOriginSubscription=void 0,this._verticalOrigin=void 0,this._verticalOriginSubscription=void 0,this._heightReference=void 0,this._heightReferenceSubscription=void 0,this._color=void 0,this._colorSubscription=void 0,this._rotation=void 0,this._rotationSubscription=void 0,this._alignedAxis=void 0,this._alignedAxisSubscription=void 0,this._sizeInMeters=void 0,this._sizeInMetersSubscription=void 0,this._width=void 0,this._widthSubscription=void 0,this._height=void 0,this._heightSubscription=void 0,this._scaleByDistance=void 0,this._scaleByDistanceSubscription=void 0,this._translucencyByDistance=void 0,this._translucencyByDistanceSubscription=void 0,this._pixelOffsetScaleByDistance=void 0,this._pixelOffsetScaleByDistanceSubscription=void 0,this._imageSubRegion=void 0,this._imageSubRegionSubscription=void 0,this._distanceDisplayCondition=void 0,this._distanceDisplayConditionSubscription=void 0,this._disableDepthTestDistance=void 0,this._disableDepthTestDistanceSubscription=void 0,this._splitDirection=void 0,this._splitDirectionSubscription=void 0,this.merge(e??B.EMPTY_OBJECT)}Object.defineProperties(dF.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:be("show"),image:be("image"),scale:be("scale"),pixelOffset:be("pixelOffset"),eyeOffset:be("eyeOffset"),horizontalOrigin:be("horizontalOrigin"),verticalOrigin:be("verticalOrigin"),heightReference:be("heightReference"),color:be("color"),rotation:be("rotation"),alignedAxis:be("alignedAxis"),sizeInMeters:be("sizeInMeters"),width:be("width"),height:be("height"),scaleByDistance:be("scaleByDistance"),translucencyByDistance:be("translucencyByDistance"),pixelOffsetScaleByDistance:be("pixelOffsetScaleByDistance"),imageSubRegion:be("imageSubRegion"),distanceDisplayCondition:be("distanceDisplayCondition"),disableDepthTestDistance:be("disableDepthTestDistance"),splitDirection:be("splitDirection")});dF.prototype.clone=function(e){return l(e)?(e.show=this._show,e.image=this._image,e.scale=this._scale,e.pixelOffset=this._pixelOffset,e.eyeOffset=this._eyeOffset,e.horizontalOrigin=this._horizontalOrigin,e.verticalOrigin=this._verticalOrigin,e.heightReference=this._heightReference,e.color=this._color,e.rotation=this._rotation,e.alignedAxis=this._alignedAxis,e.sizeInMeters=this._sizeInMeters,e.width=this._width,e.height=this._height,e.scaleByDistance=this._scaleByDistance,e.translucencyByDistance=this._translucencyByDistance,e.pixelOffsetScaleByDistance=this._pixelOffsetScaleByDistance,e.imageSubRegion=this._imageSubRegion,e.distanceDisplayCondition=this._distanceDisplayCondition,e.disableDepthTestDistance=this._disableDepthTestDistance,e.splitDirection=this._splitDirection,e):new dF(this)};dF.prototype.merge=function(e){this.show=this._show??e.show,this.image=this._image??e.image,this.scale=this._scale??e.scale,this.pixelOffset=this._pixelOffset??e.pixelOffset,this.eyeOffset=this._eyeOffset??e.eyeOffset,this.horizontalOrigin=this._horizontalOrigin??e.horizontalOrigin,this.verticalOrigin=this._verticalOrigin??e.verticalOrigin,this.heightReference=this._heightReference??e.heightReference,this.color=this._color??e.color,this.rotation=this._rotation??e.rotation,this.alignedAxis=this._alignedAxis??e.alignedAxis,this.sizeInMeters=this._sizeInMeters??e.sizeInMeters,this.width=this._width??e.width,this.height=this._height??e.height,this.scaleByDistance=this._scaleByDistance??e.scaleByDistance,this.translucencyByDistance=this._translucencyByDistance??e.translucencyByDistance,this.pixelOffsetScaleByDistance=this._pixelOffsetScaleByDistance??e.pixelOffsetScaleByDistance,this.imageSubRegion=this._imageSubRegion??e.imageSubRegion,this.distanceDisplayCondition=this._distanceDisplayCondition??e.distanceDisplayCondition,this.disableDepthTestDistance=this._disableDepthTestDistance??e.disableDepthTestDistance,this.splitDirection=this.splitDirection??e.splitDirection};var el=dF;var OVn=x(T(),1);var NVn=x(T(),1);var TVn=x(T(),1);function v1(e){this._definitionChanged=new Se,this._color=void 0,this._colorSubscription=void 0,this.color=e}Object.defineProperties(v1.prototype,{isConstant:{get:function(){return j.isConstant(this._color)}},definitionChanged:{get:function(){return this._definitionChanged}},color:be("color")});v1.prototype.getType=function(e){return"Color"};var SJe=new Q;v1.prototype.getValue=function(e,t){return l(e)||(e=Q.now(SJe)),l(t)||(t={}),t.color=j.getValueOrClonedDefault(this._color,e,U.WHITE,t.color),t};v1.prototype.equals=function(e){return this===e||e instanceof v1&&j.equals(this._color,e._color)};var Qt=v1;var LVn=x(T(),1);var ZJe=new k(1,1),RJe=!1,CJe=U.WHITE;function F1(e){e=e??B.EMPTY_OBJECT,this._definitionChanged=new Se,this._image=void 0,this._imageSubscription=void 0,this._repeat=void 0,this._repeatSubscription=void 0,this._color=void 0,this._colorSubscription=void 0,this._transparent=void 0,this._transparentSubscription=void 0,this.image=e.image,this.repeat=e.repeat,this.color=e.color,this.transparent=e.transparent}Object.defineProperties(F1.prototype,{isConstant:{get:function(){return j.isConstant(this._image)&&j.isConstant(this._repeat)}},definitionChanged:{get:function(){return this._definitionChanged}},image:be("image"),repeat:be("repeat"),color:be("color"),transparent:be("transparent")});F1.prototype.getType=function(e){return"Image"};var VJe=new Q;F1.prototype.getValue=function(e,t){return l(e)||(e=Q.now(VJe)),l(t)||(t={}),t.image=j.getValueOrUndefined(this._image,e),t.repeat=j.getValueOrClonedDefault(this._repeat,e,ZJe,t.repeat),t.color=j.getValueOrClonedDefault(this._color,e,CJe,t.color),j.getValueOrDefault(this._transparent,e,RJe)&&(t.color.alpha=Math.min(.99,t.color.alpha)),t};F1.prototype.equals=function(e){return this===e||e instanceof F1&&j.equals(this._image,e._image)&&j.equals(this._repeat,e._repeat)&&j.equals(this._color,e._color)&&j.equals(this._transparent,e._transparent)};var Hy=F1;function EJe(e){if(e instanceof U)return new Qt(e);if(typeof e=="string"||e instanceof ve||e instanceof HTMLCanvasElement||e instanceof HTMLVideoElement){let t=new Hy;return t.image=e,t}}function AJe(e,t){return be(e,t,EJe)}var sr=AJe;function uF(e){this._definitionChanged=new Se,this._show=void 0,this._showSubscription=void 0,this._dimensions=void 0,this._dimensionsSubscription=void 0,this._heightReference=void 0,this._heightReferenceSubscription=void 0,this._fill=void 0,this._fillSubscription=void 0,this._material=void 0,this._materialSubscription=void 0,this._outline=void 0,this._outlineSubscription=void 0,this._outlineColor=void 0,this._outlineColorSubscription=void 0,this._outlineWidth=void 0,this._outlineWidthSubscription=void 0,this._shadows=void 0,this._shadowsSubscription=void 0,this._distanceDisplayCondition=void 0,this._distanceDisplayConditionSubscription=void 0,this.merge(e??B.EMPTY_OBJECT)}Object.defineProperties(uF.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:be("show"),dimensions:be("dimensions"),heightReference:be("heightReference"),fill:be("fill"),material:sr("material"),outline:be("outline"),outlineColor:be("outlineColor"),outlineWidth:be("outlineWidth"),shadows:be("shadows"),distanceDisplayCondition:be("distanceDisplayCondition")});uF.prototype.clone=function(e){return l(e)?(e.show=this.show,e.dimensions=this.dimensions,e.heightReference=this.heightReference,e.fill=this.fill,e.material=this.material,e.outline=this.outline,e.outlineColor=this.outlineColor,e.outlineWidth=this.outlineWidth,e.shadows=this.shadows,e.distanceDisplayCondition=this.distanceDisplayCondition,e):new uF(this)};uF.prototype.merge=function(e){this.show=this.show??e.show,this.dimensions=this.dimensions??e.dimensions,this.heightReference=this.heightReference??e.heightReference,this.fill=this.fill??e.fill,this.material=this.material??e.material,this.outline=this.outline??e.outline,this.outlineColor=this.outlineColor??e.outlineColor,this.outlineWidth=this.outlineWidth??e.outlineWidth,this.shadows=this.shadows??e.shadows,this.distanceDisplayCondition=this.distanceDisplayCondition??e.distanceDisplayCondition};var I_=uF;var cEn=x(T(),1);var zVn=x(T(),1),W0e={FIXED:0,INERTIAL:1};Object.freeze(W0e);var Oi=W0e;var eEn=x(T(),1);function I1(){ge.throwInstantiationError()}Object.defineProperties(I1.prototype,{isConstant:{get:ge.throwInstantiationError},definitionChanged:{get:ge.throwInstantiationError},referenceFrame:{get:ge.throwInstantiationError}});I1.prototype.getValue=ge.throwInstantiationError;I1.prototype.getValueInReferenceFrame=ge.throwInstantiationError;I1.prototype.equals=ge.throwInstantiationError;var v0e=new q;I1.convertToReferenceFrame=function(e,t,n,i,o){if(!l(t))return t;if(l(o)||(o=new h),n===i)return h.clone(t,o);let r=_t.computeIcrfToCentralBodyFixedMatrix(e,v0e);if(n===Oi.INERTIAL)return q.multiplyByVector(r,t,o);if(n===Oi.FIXED)return q.multiplyByVector(q.transpose(r,v0e),t,o)};var Qh=I1;function P_(e,t){this._definitionChanged=new Se,this._value=h.clone(e),this._referenceFrame=t??Oi.FIXED}Object.defineProperties(P_.prototype,{isConstant:{get:function(){return!l(this._value)||this._referenceFrame===Oi.FIXED}},definitionChanged:{get:function(){return this._definitionChanged}},referenceFrame:{get:function(){return this._referenceFrame}}});var GJe=new Q;P_.prototype.getValue=function(e,t){return l(e)||(e=Q.now(GJe)),this.getValueInReferenceFrame(e,Oi.FIXED,t)};P_.prototype.setValue=function(e,t){let n=!1;h.equals(this._value,e)||(n=!0,this._value=h.clone(e)),l(t)&&this._referenceFrame!==t&&(n=!0,this._referenceFrame=t),n&&this._definitionChanged.raiseEvent(this)};P_.prototype.getValueInReferenceFrame=function(e,t,n){return Qh.convertToReferenceFrame(e,this._value,this._referenceFrame,t,n)};P_.prototype.equals=function(e){return this===e||e instanceof P_&&h.equals(this._value,e._value)&&this._referenceFrame===e._referenceFrame};var zl=P_;var pEn=x(T(),1);function mF(e){this._definitionChanged=new Se,this._show=void 0,this._showSubscription=void 0,this._positions=void 0,this._positionsSubscription=void 0,this._width=void 0,this._widthSubscription=void 0,this._height=void 0,this._heightSubscription=void 0,this._heightReference=void 0,this._heightReferenceSubscription=void 0,this._extrudedHeight=void 0,this._extrudedHeightSubscription=void 0,this._extrudedHeightReference=void 0,this._extrudedHeightReferenceSubscription=void 0,this._cornerType=void 0,this._cornerTypeSubscription=void 0,this._granularity=void 0,this._granularitySubscription=void 0,this._fill=void 0,this._fillSubscription=void 0,this._material=void 0,this._materialSubscription=void 0,this._outline=void 0,this._outlineSubscription=void 0,this._outlineColor=void 0,this._outlineColorSubscription=void 0,this._outlineWidth=void 0,this._outlineWidthSubscription=void 0,this._shadows=void 0,this._shadowsSubscription=void 0,this._distanceDisplayCondition=void 0,this._distanceDisplayConditionSubscription=void 0,this._classificationType=void 0,this._classificationTypeSubscription=void 0,this._zIndex=void 0,this._zIndexSubscription=void 0,this.merge(e??B.EMPTY_OBJECT)}Object.defineProperties(mF.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:be("show"),positions:be("positions"),width:be("width"),height:be("height"),heightReference:be("heightReference"),extrudedHeight:be("extrudedHeight"),extrudedHeightReference:be("extrudedHeightReference"),cornerType:be("cornerType"),granularity:be("granularity"),fill:be("fill"),material:sr("material"),outline:be("outline"),outlineColor:be("outlineColor"),outlineWidth:be("outlineWidth"),shadows:be("shadows"),distanceDisplayCondition:be("distanceDisplayCondition"),classificationType:be("classificationType"),zIndex:be("zIndex")});mF.prototype.clone=function(e){return l(e)?(e.show=this.show,e.positions=this.positions,e.width=this.width,e.height=this.height,e.heightReference=this.heightReference,e.extrudedHeight=this.extrudedHeight,e.extrudedHeightReference=this.extrudedHeightReference,e.cornerType=this.cornerType,e.granularity=this.granularity,e.fill=this.fill,e.material=this.material,e.outline=this.outline,e.outlineColor=this.outlineColor,e.outlineWidth=this.outlineWidth,e.shadows=this.shadows,e.distanceDisplayCondition=this.distanceDisplayCondition,e.classificationType=this.classificationType,e.zIndex=this.zIndex,e):new mF(this)};mF.prototype.merge=function(e){this.show=this.show??e.show,this.positions=this.positions??e.positions,this.width=this.width??e.width,this.height=this.height??e.height,this.heightReference=this.heightReference??e.heightReference,this.extrudedHeight=this.extrudedHeight??e.extrudedHeight,this.extrudedHeightReference=this.extrudedHeightReference??e.extrudedHeightReference,this.cornerType=this.cornerType??e.cornerType,this.granularity=this.granularity??e.granularity,this.fill=this.fill??e.fill,this.material=this.material??e.material,this.outline=this.outline??e.outline,this.outlineColor=this.outlineColor??e.outlineColor,this.outlineWidth=this.outlineWidth??e.outlineWidth,this.shadows=this.shadows??e.shadows,this.distanceDisplayCondition=this.distanceDisplayCondition??e.distanceDisplayCondition,this.classificationType=this.classificationType??e.classificationType,this.zIndex=this.zIndex??e.zIndex};var X_=mF;var yEn=x(T(),1);function LJe(e){return e}function WJe(e,t){return be(e,t,LJe)}var Hl=WJe;var CEn=x(T(),1);function hF(e){this._definitionChanged=new Se,this._show=void 0,this._showSubscription=void 0,this._length=void 0,this._lengthSubscription=void 0,this._topRadius=void 0,this._topRadiusSubscription=void 0,this._bottomRadius=void 0,this._bottomRadiusSubscription=void 0,this._heightReference=void 0,this._heightReferenceSubscription=void 0,this._fill=void 0,this._fillSubscription=void 0,this._material=void 0,this._materialSubscription=void 0,this._outline=void 0,this._outlineSubscription=void 0,this._outlineColor=void 0,this._outlineColorSubscription=void 0,this._outlineWidth=void 0,this._outlineWidthSubscription=void 0,this._numberOfVerticalLines=void 0,this._numberOfVerticalLinesSubscription=void 0,this._slices=void 0,this._slicesSubscription=void 0,this._shadows=void 0,this._shadowsSubscription=void 0,this._distanceDisplayCondition=void 0,this._distanceDisplayConditionSubscription=void 0,this.merge(e??B.EMPTY_OBJECT)}Object.defineProperties(hF.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:be("show"),length:be("length"),topRadius:be("topRadius"),bottomRadius:be("bottomRadius"),heightReference:be("heightReference"),fill:be("fill"),material:sr("material"),outline:be("outline"),outlineColor:be("outlineColor"),outlineWidth:be("outlineWidth"),numberOfVerticalLines:be("numberOfVerticalLines"),slices:be("slices"),shadows:be("shadows"),distanceDisplayCondition:be("distanceDisplayCondition")});hF.prototype.clone=function(e){return l(e)?(e.show=this.show,e.length=this.length,e.topRadius=this.topRadius,e.bottomRadius=this.bottomRadius,e.heightReference=this.heightReference,e.fill=this.fill,e.material=this.material,e.outline=this.outline,e.outlineColor=this.outlineColor,e.outlineWidth=this.outlineWidth,e.numberOfVerticalLines=this.numberOfVerticalLines,e.slices=this.slices,e.shadows=this.shadows,e.distanceDisplayCondition=this.distanceDisplayCondition,e):new hF(this)};hF.prototype.merge=function(e){this.show=this.show??e.show,this.length=this.length??e.length,this.topRadius=this.topRadius??e.topRadius,this.bottomRadius=this.bottomRadius??e.bottomRadius,this.heightReference=this.heightReference??e.heightReference,this.fill=this.fill??e.fill,this.material=this.material??e.material,this.outline=this.outline??e.outline,this.outlineColor=this.outlineColor??e.outlineColor,this.outlineWidth=this.outlineWidth??e.outlineWidth,this.numberOfVerticalLines=this.numberOfVerticalLines??e.numberOfVerticalLines,this.slices=this.slices??e.slices,this.shadows=this.shadows??e.shadows,this.distanceDisplayCondition=this.distanceDisplayCondition??e.distanceDisplayCondition};var N_=hF;var vEn=x(T(),1);function fF(e){this._definitionChanged=new Se,this._show=void 0,this._showSubscription=void 0,this._semiMajorAxis=void 0,this._semiMajorAxisSubscription=void 0,this._semiMinorAxis=void 0,this._semiMinorAxisSubscription=void 0,this._height=void 0,this._heightSubscription=void 0,this._heightReference=void 0,this._heightReferenceSubscription=void 0,this._extrudedHeight=void 0,this._extrudedHeightSubscription=void 0,this._extrudedHeightReference=void 0,this._extrudedHeightReferenceSubscription=void 0,this._rotation=void 0,this._rotationSubscription=void 0,this._stRotation=void 0,this._stRotationSubscription=void 0,this._granularity=void 0,this._granularitySubscription=void 0,this._fill=void 0,this._fillSubscription=void 0,this._material=void 0,this._materialSubscription=void 0,this._outline=void 0,this._outlineSubscription=void 0,this._outlineColor=void 0,this._outlineColorSubscription=void 0,this._outlineWidth=void 0,this._outlineWidthSubscription=void 0,this._numberOfVerticalLines=void 0,this._numberOfVerticalLinesSubscription=void 0,this._shadows=void 0,this._shadowsSubscription=void 0,this._distanceDisplayCondition=void 0,this._distanceDisplayConditionSubscription=void 0,this._classificationType=void 0,this._classificationTypeSubscription=void 0,this._zIndex=void 0,this._zIndexSubscription=void 0,this.merge(e??B.EMPTY_OBJECT)}Object.defineProperties(fF.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:be("show"),semiMajorAxis:be("semiMajorAxis"),semiMinorAxis:be("semiMinorAxis"),height:be("height"),heightReference:be("heightReference"),extrudedHeight:be("extrudedHeight"),extrudedHeightReference:be("extrudedHeightReference"),rotation:be("rotation"),stRotation:be("stRotation"),granularity:be("granularity"),fill:be("fill"),material:sr("material"),outline:be("outline"),outlineColor:be("outlineColor"),outlineWidth:be("outlineWidth"),numberOfVerticalLines:be("numberOfVerticalLines"),shadows:be("shadows"),distanceDisplayCondition:be("distanceDisplayCondition"),classificationType:be("classificationType"),zIndex:be("zIndex")});fF.prototype.clone=function(e){return l(e)?(e.show=this.show,e.semiMajorAxis=this.semiMajorAxis,e.semiMinorAxis=this.semiMinorAxis,e.height=this.height,e.heightReference=this.heightReference,e.extrudedHeight=this.extrudedHeight,e.extrudedHeightReference=this.extrudedHeightReference,e.rotation=this.rotation,e.stRotation=this.stRotation,e.granularity=this.granularity,e.fill=this.fill,e.material=this.material,e.outline=this.outline,e.outlineColor=this.outlineColor,e.outlineWidth=this.outlineWidth,e.numberOfVerticalLines=this.numberOfVerticalLines,e.shadows=this.shadows,e.distanceDisplayCondition=this.distanceDisplayCondition,e.classificationType=this.classificationType,e.zIndex=this.zIndex,e):new fF(this)};fF.prototype.merge=function(e){this.show=this.show??e.show,this.semiMajorAxis=this.semiMajorAxis??e.semiMajorAxis,this.semiMinorAxis=this.semiMinorAxis??e.semiMinorAxis,this.height=this.height??e.height,this.heightReference=this.heightReference??e.heightReference,this.extrudedHeight=this.extrudedHeight??e.extrudedHeight,this.extrudedHeightReference=this.extrudedHeightReference??e.extrudedHeightReference,this.rotation=this.rotation??e.rotation,this.stRotation=this.stRotation??e.stRotation,this.granularity=this.granularity??e.granularity,this.fill=this.fill??e.fill,this.material=this.material??e.material,this.outline=this.outline??e.outline,this.outlineColor=this.outlineColor??e.outlineColor,this.outlineWidth=this.outlineWidth??e.outlineWidth,this.numberOfVerticalLines=this.numberOfVerticalLines??e.numberOfVerticalLines,this.shadows=this.shadows??e.shadows,this.distanceDisplayCondition=this.distanceDisplayCondition??e.distanceDisplayCondition,this.classificationType=this.classificationType??e.classificationType,this.zIndex=this.zIndex??e.zIndex};var Y_=fF;var MEn=x(T(),1);function pF(e){this._definitionChanged=new Se,this._show=void 0,this._showSubscription=void 0,this._radii=void 0,this._radiiSubscription=void 0,this._innerRadii=void 0,this._innerRadiiSubscription=void 0,this._minimumClock=void 0,this._minimumClockSubscription=void 0,this._maximumClock=void 0,this._maximumClockSubscription=void 0,this._minimumCone=void 0,this._minimumConeSubscription=void 0,this._maximumCone=void 0,this._maximumConeSubscription=void 0,this._heightReference=void 0,this._heightReferenceSubscription=void 0,this._fill=void 0,this._fillSubscription=void 0,this._material=void 0,this._materialSubscription=void 0,this._outline=void 0,this._outlineSubscription=void 0,this._outlineColor=void 0,this._outlineColorSubscription=void 0,this._outlineWidth=void 0,this._outlineWidthSubscription=void 0,this._stackPartitions=void 0,this._stackPartitionsSubscription=void 0,this._slicePartitions=void 0,this._slicePartitionsSubscription=void 0,this._subdivisions=void 0,this._subdivisionsSubscription=void 0,this._shadows=void 0,this._shadowsSubscription=void 0,this._distanceDisplayCondition=void 0,this._distanceDisplayConditionSubscription=void 0,this.merge(e??B.EMPTY_OBJECT)}Object.defineProperties(pF.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:be("show"),radii:be("radii"),innerRadii:be("innerRadii"),minimumClock:be("minimumClock"),maximumClock:be("maximumClock"),minimumCone:be("minimumCone"),maximumCone:be("maximumCone"),heightReference:be("heightReference"),fill:be("fill"),material:sr("material"),outline:be("outline"),outlineColor:be("outlineColor"),outlineWidth:be("outlineWidth"),stackPartitions:be("stackPartitions"),slicePartitions:be("slicePartitions"),subdivisions:be("subdivisions"),shadows:be("shadows"),distanceDisplayCondition:be("distanceDisplayCondition")});pF.prototype.clone=function(e){return l(e)?(e.show=this.show,e.radii=this.radii,e.innerRadii=this.innerRadii,e.minimumClock=this.minimumClock,e.maximumClock=this.maximumClock,e.minimumCone=this.minimumCone,e.maximumCone=this.maximumCone,e.heightReference=this.heightReference,e.fill=this.fill,e.material=this.material,e.outline=this.outline,e.outlineColor=this.outlineColor,e.outlineWidth=this.outlineWidth,e.stackPartitions=this.stackPartitions,e.slicePartitions=this.slicePartitions,e.subdivisions=this.subdivisions,e.shadows=this.shadows,e.distanceDisplayCondition=this.distanceDisplayCondition,e):new pF(this)};pF.prototype.merge=function(e){this.show=this.show??e.show,this.radii=this.radii??e.radii,this.innerRadii=this.innerRadii??e.innerRadii,this.minimumClock=this.minimumClock??e.minimumClock,this.maximumClock=this.maximumClock??e.maximumClock,this.minimumCone=this.minimumCone??e.minimumCone,this.maximumCone=this.maximumCone??e.maximumCone,this.heightReference=this.heightReference??e.heightReference,this.fill=this.fill??e.fill,this.material=this.material??e.material,this.outline=this.outline??e.outline,this.outlineColor=this.outlineColor??e.outlineColor,this.outlineWidth=this.outlineWidth??e.outlineWidth,this.stackPartitions=this.stackPartitions??e.stackPartitions,this.slicePartitions=this.slicePartitions??e.slicePartitions,this.subdivisions=this.subdivisions??e.subdivisions,this.shadows=this.shadows??e.shadows,this.distanceDisplayCondition=this.distanceDisplayCondition??e.distanceDisplayCondition};var M_=pF;var BEn=x(T(),1);function bF(e){this._definitionChanged=new Se,this._show=void 0,this._showSubscription=void 0,this._text=void 0,this._textSubscription=void 0,this._font=void 0,this._fontSubscription=void 0,this._style=void 0,this._styleSubscription=void 0,this._scale=void 0,this._scaleSubscription=void 0,this._showBackground=void 0,this._showBackgroundSubscription=void 0,this._backgroundColor=void 0,this._backgroundColorSubscription=void 0,this._backgroundPadding=void 0,this._backgroundPaddingSubscription=void 0,this._pixelOffset=void 0,this._pixelOffsetSubscription=void 0,this._eyeOffset=void 0,this._eyeOffsetSubscription=void 0,this._horizontalOrigin=void 0,this._horizontalOriginSubscription=void 0,this._verticalOrigin=void 0,this._verticalOriginSubscription=void 0,this._heightReference=void 0,this._heightReferenceSubscription=void 0,this._fillColor=void 0,this._fillColorSubscription=void 0,this._outlineColor=void 0,this._outlineColorSubscription=void 0,this._outlineWidth=void 0,this._outlineWidthSubscription=void 0,this._translucencyByDistance=void 0,this._translucencyByDistanceSubscription=void 0,this._pixelOffsetScaleByDistance=void 0,this._pixelOffsetScaleByDistanceSubscription=void 0,this._scaleByDistance=void 0,this._scaleByDistanceSubscription=void 0,this._distanceDisplayCondition=void 0,this._distanceDisplayConditionSubscription=void 0,this._disableDepthTestDistance=void 0,this._disableDepthTestDistanceSubscription=void 0,this.merge(e??B.EMPTY_OBJECT)}Object.defineProperties(bF.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:be("show"),text:be("text"),font:be("font"),style:be("style"),scale:be("scale"),showBackground:be("showBackground"),backgroundColor:be("backgroundColor"),backgroundPadding:be("backgroundPadding"),pixelOffset:be("pixelOffset"),eyeOffset:be("eyeOffset"),horizontalOrigin:be("horizontalOrigin"),verticalOrigin:be("verticalOrigin"),heightReference:be("heightReference"),fillColor:be("fillColor"),outlineColor:be("outlineColor"),outlineWidth:be("outlineWidth"),translucencyByDistance:be("translucencyByDistance"),pixelOffsetScaleByDistance:be("pixelOffsetScaleByDistance"),scaleByDistance:be("scaleByDistance"),distanceDisplayCondition:be("distanceDisplayCondition"),disableDepthTestDistance:be("disableDepthTestDistance")});bF.prototype.clone=function(e){return l(e)?(e.show=this.show,e.text=this.text,e.font=this.font,e.style=this.style,e.scale=this.scale,e.showBackground=this.showBackground,e.backgroundColor=this.backgroundColor,e.backgroundPadding=this.backgroundPadding,e.pixelOffset=this.pixelOffset,e.eyeOffset=this.eyeOffset,e.horizontalOrigin=this.horizontalOrigin,e.verticalOrigin=this.verticalOrigin,e.heightReference=this.heightReference,e.fillColor=this.fillColor,e.outlineColor=this.outlineColor,e.outlineWidth=this.outlineWidth,e.translucencyByDistance=this.translucencyByDistance,e.pixelOffsetScaleByDistance=this.pixelOffsetScaleByDistance,e.scaleByDistance=this.scaleByDistance,e.distanceDisplayCondition=this.distanceDisplayCondition,e.disableDepthTestDistance=this.disableDepthTestDistance,e):new bF(this)};bF.prototype.merge=function(e){this.show=this.show??e.show,this.text=this.text??e.text,this.font=this.font??e.font,this.style=this.style??e.style,this.scale=this.scale??e.scale,this.showBackground=this.showBackground??e.showBackground,this.backgroundColor=this.backgroundColor??e.backgroundColor,this.backgroundPadding=this.backgroundPadding??e.backgroundPadding,this.pixelOffset=this.pixelOffset??e.pixelOffset,this.eyeOffset=this.eyeOffset??e.eyeOffset,this.horizontalOrigin=this.horizontalOrigin??e.horizontalOrigin,this.verticalOrigin=this.verticalOrigin??e.verticalOrigin,this.heightReference=this.heightReference??e.heightReference,this.fillColor=this.fillColor??e.fillColor,this.outlineColor=this.outlineColor??e.outlineColor,this.outlineWidth=this.outlineWidth??e.outlineWidth,this.translucencyByDistance=this.translucencyByDistance??e.translucencyByDistance,this.pixelOffsetScaleByDistance=this.pixelOffsetScaleByDistance??e.pixelOffsetScaleByDistance,this.scaleByDistance=this.scaleByDistance??e.scaleByDistance,this.distanceDisplayCondition=this.distanceDisplayCondition??e.distanceDisplayCondition,this.disableDepthTestDistance=this.disableDepthTestDistance??e.disableDepthTestDistance};var qh=bF;var _An=x(T(),1);var rAn=x(T(),1);var jEn=x(T(),1);var vJe=new h(1,1,1),FJe=h.ZERO,IJe=Ne.IDENTITY;function F0e(e,t,n){this.translation=h.clone(e??FJe),this.rotation=Ne.clone(t??IJe),this.scale=h.clone(n??vJe)}F0e.prototype.equals=function(e){return this===e||l(e)&&h.equals(this.translation,e.translation)&&Ne.equals(this.rotation,e.rotation)&&h.equals(this.scale,e.scale)};var Ky=F0e;var E8=new Ky;function gF(e){e=e??B.EMPTY_OBJECT,this._definitionChanged=new Se,this._translation=void 0,this._translationSubscription=void 0,this._rotation=void 0,this._rotationSubscription=void 0,this._scale=void 0,this._scaleSubscription=void 0,this.translation=e.translation,this.rotation=e.rotation,this.scale=e.scale}Object.defineProperties(gF.prototype,{isConstant:{get:function(){return j.isConstant(this._translation)&&j.isConstant(this._rotation)&&j.isConstant(this._scale)}},definitionChanged:{get:function(){return this._definitionChanged}},translation:be("translation"),rotation:be("rotation"),scale:be("scale")});var PJe=new Q;gF.prototype.getValue=function(e,t){return l(e)||(e=Q.now(PJe)),l(t)||(t=new Ky),t.translation=j.getValueOrClonedDefault(this._translation,e,E8.translation,t.translation),t.rotation=j.getValueOrClonedDefault(this._rotation,e,E8.rotation,t.rotation),t.scale=j.getValueOrClonedDefault(this._scale,e,E8.scale,t.scale),t};gF.prototype.equals=function(e){return this===e||e instanceof gF&&j.equals(this._translation,e._translation)&&j.equals(this._rotation,e._rotation)&&j.equals(this._scale,e._scale)};var w_=gF;var hAn=x(T(),1);function Rb(e,t){this._propertyNames=[],this._definitionChanged=new Se,l(e)&&this.merge(e,t)}Object.defineProperties(Rb.prototype,{propertyNames:{get:function(){return this._propertyNames}},isConstant:{get:function(){let e=this._propertyNames;for(let t=0,n=e.length;t",">=","<","<=","&&","||","!~","=~"],NF=/\${(.*?)}/g,UJe=/\\/g,DJe="@#%",OJe=/@#%/g,xO=new U,TO={abs:Ya(Math.abs),sqrt:Ya(Math.sqrt),cos:Ya(Math.cos),sin:Ya(Math.sin),tan:Ya(Math.tan),acos:Ya(Math.acos),asin:Ya(Math.asin),atan:Ya(Math.atan),radians:Ya(W.toRadians),degrees:Ya(W.toDegrees),sign:Ya(W.sign),floor:Ya(Math.floor),ceil:Ya(Math.ceil),round:Ya(Math.round),exp:Ya(Math.exp),exp2:Ya(zJe),log:Ya(Math.log),log2:Ya(HJe),fract:Ya(BJe),length:KJe,normalize:JJe},_O={atan2:gO(Math.atan2,!1),pow:gO(Math.pow,!1),min:gO(Math.min,!0),max:gO(Math.max,!0),distance:jJe,dot:QJe,cross:qJe},_8={clamp:Bpe(W.clamp,!0),mix:Bpe(W.lerp,!0)};function BJe(e){return e-Math.floor(e)}function zJe(e){return Math.pow(2,e)}function HJe(e){return W.log2(e)}function Ya(e){return function(t,n){if(typeof n=="number")return e(n);if(n instanceof k)return k.fromElements(e(n.x),e(n.y),kn.getCartesian2());if(n instanceof h)return h.fromElements(e(n.x),e(n.y),e(n.z),kn.getCartesian3());if(n instanceof ce)return ce.fromElements(e(n.x),e(n.y),e(n.z),e(n.w),kn.getCartesian4());throw new ae(`Function "${t}" requires a vector or number argument. Argument is ${n}.`)}}function gO(e,t){return function(n,i,o){if(t&&typeof o=="number"){if(typeof i=="number")return e(i,o);if(i instanceof k)return k.fromElements(e(i.x,o),e(i.y,o),kn.getCartesian2());if(i instanceof h)return h.fromElements(e(i.x,o),e(i.y,o),e(i.z,o),kn.getCartesian3());if(i instanceof ce)return ce.fromElements(e(i.x,o),e(i.y,o),e(i.z,o),e(i.w,o),kn.getCartesian4())}if(typeof i=="number"&&typeof o=="number")return e(i,o);if(i instanceof k&&o instanceof k)return k.fromElements(e(i.x,o.x),e(i.y,o.y),kn.getCartesian2());if(i instanceof h&&o instanceof h)return h.fromElements(e(i.x,o.x),e(i.y,o.y),e(i.z,o.z),kn.getCartesian3());if(i instanceof ce&&o instanceof ce)return ce.fromElements(e(i.x,o.x),e(i.y,o.y),e(i.z,o.z),e(i.w,o.w),kn.getCartesian4());throw new ae(`Function "${n}" requires vector or number arguments of matching types. Arguments are ${i} and ${o}.`)}}function Bpe(e,t){return function(n,i,o,r){if(t&&typeof r=="number"){if(typeof i=="number"&&typeof o=="number")return e(i,o,r);if(i instanceof k&&o instanceof k)return k.fromElements(e(i.x,o.x,r),e(i.y,o.y,r),kn.getCartesian2());if(i instanceof h&&o instanceof h)return h.fromElements(e(i.x,o.x,r),e(i.y,o.y,r),e(i.z,o.z,r),kn.getCartesian3());if(i instanceof ce&&o instanceof ce)return ce.fromElements(e(i.x,o.x,r),e(i.y,o.y,r),e(i.z,o.z,r),e(i.w,o.w,r),kn.getCartesian4())}if(typeof i=="number"&&typeof o=="number"&&typeof r=="number")return e(i,o,r);if(i instanceof k&&o instanceof k&&r instanceof k)return k.fromElements(e(i.x,o.x,r.x),e(i.y,o.y,r.y),kn.getCartesian2());if(i instanceof h&&o instanceof h&&r instanceof h)return h.fromElements(e(i.x,o.x,r.x),e(i.y,o.y,r.y),e(i.z,o.z,r.z),kn.getCartesian3());if(i instanceof ce&&o instanceof ce&&r instanceof ce)return ce.fromElements(e(i.x,o.x,r.x),e(i.y,o.y,r.y),e(i.z,o.z,r.z),e(i.w,o.w,r.w),kn.getCartesian4());throw new ae(`Function "${n}" requires vector or number arguments of matching types. Arguments are ${i}, ${o}, and ${r}.`)}}function KJe(e,t){if(typeof t=="number")return Math.abs(t);if(t instanceof k)return k.magnitude(t);if(t instanceof h)return h.magnitude(t);if(t instanceof ce)return ce.magnitude(t);throw new ae(`Function "${e}" requires a vector or number argument. Argument is ${t}.`)}function JJe(e,t){if(typeof t=="number")return 1;if(t instanceof k)return k.normalize(t,kn.getCartesian2());if(t instanceof h)return h.normalize(t,kn.getCartesian3());if(t instanceof ce)return ce.normalize(t,kn.getCartesian4());throw new ae(`Function "${e}" requires a vector or number argument. Argument is ${t}.`)}function jJe(e,t,n){if(typeof t=="number"&&typeof n=="number")return Math.abs(t-n);if(t instanceof k&&n instanceof k)return k.distance(t,n);if(t instanceof h&&n instanceof h)return h.distance(t,n);if(t instanceof ce&&n instanceof ce)return ce.distance(t,n);throw new ae(`Function "${e}" requires vector or number arguments of matching types. Arguments are ${t} and ${n}.`)}function QJe(e,t,n){if(typeof t=="number"&&typeof n=="number")return t*n;if(t instanceof k&&n instanceof k)return k.dot(t,n);if(t instanceof h&&n instanceof h)return h.dot(t,n);if(t instanceof ce&&n instanceof ce)return ce.dot(t,n);throw new ae(`Function "${e}" requires vector or number arguments of matching types. Arguments are ${t} and ${n}.`)}function qJe(e,t,n){if(t instanceof h&&n instanceof h)return h.cross(t,n,kn.getCartesian3());throw new ae(`Function "${e}" requires vec3 arguments. Arguments are ${t} and ${n}.`)}function Mt(e,t,n,i,o){this._type=e,this._value=t,this._left=n,this._right=i,this._test=o,this.evaluate=void 0,uje(this)}function $Je(e,t){if(!l(t))return e;for(let n in t)if(t.hasOwnProperty(n)){let i=new RegExp(`\\$\\{${n}\\}`,"g"),o=`(${t[n]})`;l(o)&&(e=e.replace(i,o))}return e}function eje(e){return e.replace(UJe,DJe)}function T8(e){return e.replace(OJe,"\\")}function tje(e){let t=e,n="",i=t.indexOf("${");for(;i>=0;){let o=t.indexOf("'"),r=t.indexOf('"'),s;if(o>=0&&o=0&&r=0?new Mt(Pt.VARIABLE_IN_STRING,e.value):new Mt(Pt.LITERAL_STRING,T8(e.value))}function ije(e,t){let n=t.arguments,i=n.length,o,r,s,a;if(t.callee.type==="MemberExpression"){o=t.callee.property.name;let c=t.callee.object;if(o==="test"||o==="exec"){if(!l(c.callee)||c.callee.name!=="regExp")throw new ae(`${o} is not a function.`);return i===0?o==="test"?new Mt(Pt.LITERAL_BOOLEAN,!1):new Mt(Pt.LITERAL_NULL,null):(s=ji(e,c),a=ji(e,n[0]),new Mt(Pt.FUNCTION_CALL,o,s,a))}else if(o==="toString")return r=ji(e,c),new Mt(Pt.FUNCTION_CALL,o,r);throw new ae(`Unexpected function call "${o}".`)}if(o=t.callee.name,o==="color"){if(i===0)return new Mt(Pt.LITERAL_COLOR,o);if(r=ji(e,n[0]),l(n[1])){let c=ji(e,n[1]);return new Mt(Pt.LITERAL_COLOR,o,[r,c])}return new Mt(Pt.LITERAL_COLOR,o,[r])}else if(o==="rgb"||o==="hsl"){if(i<3)throw new ae(`${o} requires three arguments.`);return r=[ji(e,n[0]),ji(e,n[1]),ji(e,n[2])],new Mt(Pt.LITERAL_COLOR,o,r)}else if(o==="rgba"||o==="hsla"){if(i<4)throw new ae(`${o} requires four arguments.`);return r=[ji(e,n[0]),ji(e,n[1]),ji(e,n[2]),ji(e,n[3])],new Mt(Pt.LITERAL_COLOR,o,r)}else if(o==="vec2"||o==="vec3"||o==="vec4"){r=new Array(i);for(let c=0;c1)throw new ae(`${o} requires exactly one argument.`);return r=ji(e,n[0]),new Mt(Pt.UNARY,o,r)}else if(o==="getExactClassName"){if(i>0)throw new ae(`${o} does not take any argument.`);return new Mt(Pt.UNARY,o)}else if(l(TO[o])){if(i!==1)throw new ae(`${o} requires exactly one argument.`);return r=ji(e,n[0]),new Mt(Pt.UNARY,o,r)}else if(l(_O[o])){if(i!==2)throw new ae(`${o} requires exactly two arguments.`);return s=ji(e,n[0]),a=ji(e,n[1]),new Mt(Pt.BINARY,o,s,a)}else if(l(_8[o])){if(i!==3)throw new ae(`${o} requires exactly three arguments.`);s=ji(e,n[0]),a=ji(e,n[1]);let c=ji(e,n[2]);return new Mt(Pt.TERNARY,o,s,a,c)}else{if(o==="Boolean")return i===0?new Mt(Pt.LITERAL_BOOLEAN,!1):(r=ji(e,n[0]),new Mt(Pt.UNARY,o,r));if(o==="Number")return i===0?new Mt(Pt.LITERAL_NUMBER,0):(r=ji(e,n[0]),new Mt(Pt.UNARY,o,r));if(o==="String")return i===0?new Mt(Pt.LITERAL_STRING,""):(r=ji(e,n[0]),new Mt(Pt.UNARY,o,r));if(o==="regExp")return oje(e,t)}}throw new ae(`Unexpected function call "${o}".`)}function oje(e,t){let n=t.arguments;if(n.length===0)return new Mt(Pt.LITERAL_REGEX,new RegExp);let i=ji(e,n[0]),o;if(n.length>1){let r=ji(e,n[1]);if(x8(i)&&x8(r)){try{o=new RegExp(T8(String(i._value)),r._value)}catch(s){throw new ae(s)}return new Mt(Pt.LITERAL_REGEX,o)}return new Mt(Pt.REGEX,i,r)}if(x8(i)){try{o=new RegExp(T8(String(i._value)))}catch(r){throw new ae(r)}return new Mt(Pt.LITERAL_REGEX,o)}return new Mt(Pt.REGEX,i)}function rje(e){if(lje(e.name)){let t=dje(e.name);return t.substr(0,8)==="tiles3d_"?new Mt(Pt.BUILTIN_VARIABLE,t):new Mt(Pt.VARIABLE,t)}else{if(e.name==="NaN")return new Mt(Pt.LITERAL_NUMBER,NaN);if(e.name==="Infinity")return new Mt(Pt.LITERAL_NUMBER,1/0);if(e.name==="undefined")return new Mt(Pt.LITERAL_UNDEFINED,void 0)}throw new ae(`${e.name} is not defined.`)}function sje(e){let t=e.property.name;if(t==="PI")return new Mt(Pt.LITERAL_NUMBER,Math.PI);if(t==="E")return new Mt(Pt.LITERAL_NUMBER,Math.E)}function aje(e){if(e.property.name==="POSITIVE_INFINITY")return new Mt(Pt.LITERAL_NUMBER,Number.POSITIVE_INFINITY)}function cje(e,t){if(t.object.name==="Math")return sje(t);if(t.object.name==="Number")return aje(t);let n,i=ji(e,t.object);return t.computed?(n=ji(e,t.property),new Mt(Pt.MEMBER,"brackets",i,n)):(n=new Mt(Pt.LITERAL_STRING,t.property.name),new Mt(Pt.MEMBER,"dot",i,n))}function x8(e){return e._type>=Pt.LITERAL_NULL}function lje(e){return e.substr(0,4)==="czm_"}function dje(e){return e.substr(4)}function ji(e,t){let n,i,o,r;if(t.type==="Literal")n=nje(t);else if(t.type==="CallExpression")n=ije(e,t);else if(t.type==="Identifier")n=rje(t);else if(t.type==="UnaryExpression"){i=t.operator;let s=ji(e,t.argument);if(kJe.indexOf(i)>-1)n=new Mt(Pt.UNARY,i,s);else throw new ae(`Unexpected operator "${i}".`)}else if(t.type==="BinaryExpression")if(i=t.operator,o=ji(e,t.left),r=ji(e,t.right),Ope.indexOf(i)>-1)n=new Mt(Pt.BINARY,i,o,r);else throw new ae(`Unexpected operator "${i}".`);else if(t.type==="LogicalExpression")i=t.operator,o=ji(e,t.left),r=ji(e,t.right),Ope.indexOf(i)>-1&&(n=new Mt(Pt.BINARY,i,o,r));else if(t.type==="ConditionalExpression"){let s=ji(e,t.test);o=ji(e,t.consequent),r=ji(e,t.alternate),n=new Mt(Pt.CONDITIONAL,"?",o,r,s)}else if(t.type==="MemberExpression")n=cje(e,t);else if(t.type==="ArrayExpression"){let s=[];for(let a=0;a"?e.evaluate=e._evaluateGreaterThan:e._value===">="?e.evaluate=e._evaluateGreaterThanOrEquals:e._value==="&&"?e.evaluate=e._evaluateAnd:e._value==="||"?e.evaluate=e._evaluateOr:e._value==="=~"?e.evaluate=e._evaluateRegExpMatch:e._value==="!~"?e.evaluate=e._evaluateRegExpNotMatch:l(_O[e._value])&&(e.evaluate=fje(e._value)):e._type===Pt.TERNARY?e.evaluate=pje(e._value):e._type===Pt.MEMBER?e._value==="brackets"?e.evaluate=e._evaluateMemberBrackets:e.evaluate=e._evaluateMemberDot:e._type===Pt.ARRAY?e.evaluate=e._evaluateArray:e._type===Pt.VARIABLE?e.evaluate=e._evaluateVariable:e._type===Pt.VARIABLE_IN_STRING?e.evaluate=e._evaluateVariableString:e._type===Pt.LITERAL_COLOR?e.evaluate=e._evaluateLiteralColor:e._type===Pt.LITERAL_VECTOR?e.evaluate=e._evaluateLiteralVector:e._type===Pt.LITERAL_STRING?e.evaluate=e._evaluateLiteralString:e._type===Pt.REGEX?e.evaluate=e._evaluateRegExp:e._type===Pt.BUILTIN_VARIABLE?e._value==="tiles3d_tileset_time"&&(e.evaluate=mje):e.evaluate=e._evaluateLiteral}function mje(e){return l(e)?e.content.tileset.timeSinceLoad:0}function hje(e){let t=TO[e];return function(n){let i=this._left.evaluate(n);return t(e,i)}}function fje(e){let t=_O[e];return function(n){let i=this._left.evaluate(n),o=this._right.evaluate(n);return t(e,i,o)}}function pje(e){let t=_8[e];return function(n){let i=this._left.evaluate(n),o=this._right.evaluate(n),r=this._test.evaluate(n);return t(e,i,o,r)}}function SO(e,t){if(l(e))return e.getPropertyInherited(t)}Mt.prototype._evaluateLiteral=function(){return this._value};Mt.prototype._evaluateLiteralColor=function(e){let t=xO,n=this._left;if(this._value==="color")l(n)?n.length>1?(U.fromCssColorString(n[0].evaluate(e),t),t.alpha=n[1].evaluate(e)):U.fromCssColorString(n[0].evaluate(e),t):U.fromBytes(255,255,255,255,t);else if(this._value==="rgb")U.fromBytes(n[0].evaluate(e),n[1].evaluate(e),n[2].evaluate(e),255,t);else if(this._value==="rgba"){let i=n[3].evaluate(e)*255;U.fromBytes(n[0].evaluate(e),n[1].evaluate(e),n[2].evaluate(e),i,t)}else this._value==="hsl"?U.fromHsl(n[0].evaluate(e),n[1].evaluate(e),n[2].evaluate(e),1,t):this._value==="hsla"&&U.fromHsl(n[0].evaluate(e),n[1].evaluate(e),n[2].evaluate(e),n[3].evaluate(e),t);return ce.fromColor(t,kn.getCartesian4())};Mt.prototype._evaluateLiteralVector=function(e){let t=kn.getArray(),n=this._value,i=this._left,o=i.length;for(let a=0;a1)throw new ae(`Invalid ${n} constructor. Not enough arguments.`);if(r>s&&o>1)throw new ae(`Invalid ${n} constructor. Too many arguments.`);if(r===1){let a=t[0];t.push(a,a,a)}if(n==="vec2")return k.fromArray(t,0,kn.getCartesian2());if(n==="vec3")return h.fromArray(t,0,kn.getCartesian3());if(n==="vec4")return ce.fromArray(t,0,kn.getCartesian4())};Mt.prototype._evaluateLiteralString=function(){return this._value};Mt.prototype._evaluateVariableString=function(e){let t=this._value,n=NF.exec(t);for(;n!==null;){let i=n[0],o=n[1],r=SO(e,o);l(r)||(r=""),t=t.replace(i,r),NF.lastIndex+=r.length-i.length,n=NF.exec(t)}return t};Mt.prototype._evaluateVariable=function(e){return SO(e,this._value)};function K_(e){return e._value==="feature"}Mt.prototype._evaluateMemberDot=function(e){if(K_(this._left))return SO(e,this._right.evaluate(e));let t=this._left.evaluate(e);if(!l(t))return;let n=this._right.evaluate(e);if(t instanceof k||t instanceof h||t instanceof ce){if(n==="r")return t.x;if(n==="g")return t.y;if(n==="b")return t.z;if(n==="a")return t.w}return t[n]};Mt.prototype._evaluateMemberBrackets=function(e){if(K_(this._left))return SO(e,this._right.evaluate(e));let t=this._left.evaluate(e);if(!l(t))return;let n=this._right.evaluate(e);if(t instanceof k||t instanceof h||t instanceof ce){if(n===0||n==="r")return t.x;if(n===1||n==="g")return t.y;if(n===2||n==="b")return t.z;if(n===3||n==="a")return t.w}return t[n]};Mt.prototype._evaluateArray=function(e){let t=[];for(let n=0;n" requires number arguments. Arguments are ${t} and ${n}.`);return t>n};Mt.prototype._evaluateGreaterThanOrEquals=function(e){let t=this._left.evaluate(e),n=this._right.evaluate(e);if(typeof t!="number"||typeof n!="number")throw new ae(`Operator ">=" requires number arguments. Arguments are ${t} and ${n}.`);return t>=n};Mt.prototype._evaluateOr=function(e){let t=this._left.evaluate(e);if(typeof t!="boolean")throw new ae(`Operator "||" requires boolean arguments. First argument is ${t}.`);if(t)return!0;let n=this._right.evaluate(e);if(typeof n!="boolean")throw new ae(`Operator "||" requires boolean arguments. Second argument is ${n}.`);return t||n};Mt.prototype._evaluateAnd=function(e){let t=this._left.evaluate(e);if(typeof t!="boolean")throw new ae(`Operator "&&" requires boolean arguments. First argument is ${t}.`);if(!t)return!1;let n=this._right.evaluate(e);if(typeof n!="boolean")throw new ae(`Operator "&&" requires boolean arguments. Second argument is ${n}.`);return t&&n};Mt.prototype._evaluatePlus=function(e){let t=this._left.evaluate(e),n=this._right.evaluate(e);if(n instanceof k&&t instanceof k)return k.add(t,n,kn.getCartesian2());if(n instanceof h&&t instanceof h)return h.add(t,n,kn.getCartesian3());if(n instanceof ce&&t instanceof ce)return ce.add(t,n,kn.getCartesian4());if(typeof t=="string"||typeof n=="string")return t+n;if(typeof t=="number"&&typeof n=="number")return t+n;throw new ae(`Operator "+" requires vector or number arguments of matching types, or at least one string argument. Arguments are ${t} and ${n}.`)};Mt.prototype._evaluateMinus=function(e){let t=this._left.evaluate(e),n=this._right.evaluate(e);if(n instanceof k&&t instanceof k)return k.subtract(t,n,kn.getCartesian2());if(n instanceof h&&t instanceof h)return h.subtract(t,n,kn.getCartesian3());if(n instanceof ce&&t instanceof ce)return ce.subtract(t,n,kn.getCartesian4());if(typeof t=="number"&&typeof n=="number")return t-n;throw new ae(`Operator "-" requires vector or number arguments of matching types. Arguments are ${t} and ${n}.`)};Mt.prototype._evaluateTimes=function(e){let t=this._left.evaluate(e),n=this._right.evaluate(e);if(n instanceof k&&t instanceof k)return k.multiplyComponents(t,n,kn.getCartesian2());if(n instanceof k&&typeof t=="number")return k.multiplyByScalar(n,t,kn.getCartesian2());if(t instanceof k&&typeof n=="number")return k.multiplyByScalar(t,n,kn.getCartesian2());if(n instanceof h&&t instanceof h)return h.multiplyComponents(t,n,kn.getCartesian3());if(n instanceof h&&typeof t=="number")return h.multiplyByScalar(n,t,kn.getCartesian3());if(t instanceof h&&typeof n=="number")return h.multiplyByScalar(t,n,kn.getCartesian3());if(n instanceof ce&&t instanceof ce)return ce.multiplyComponents(t,n,kn.getCartesian4());if(n instanceof ce&&typeof t=="number")return ce.multiplyByScalar(n,t,kn.getCartesian4());if(t instanceof ce&&typeof n=="number")return ce.multiplyByScalar(t,n,kn.getCartesian4());if(typeof t=="number"&&typeof n=="number")return t*n;throw new ae(`Operator "*" requires vector or number arguments. If both arguments are vectors they must be matching types. Arguments are ${t} and ${n}.`)};Mt.prototype._evaluateDivide=function(e){let t=this._left.evaluate(e),n=this._right.evaluate(e);if(n instanceof k&&t instanceof k)return k.divideComponents(t,n,kn.getCartesian2());if(t instanceof k&&typeof n=="number")return k.divideByScalar(t,n,kn.getCartesian2());if(n instanceof h&&t instanceof h)return h.divideComponents(t,n,kn.getCartesian3());if(t instanceof h&&typeof n=="number")return h.divideByScalar(t,n,kn.getCartesian3());if(n instanceof ce&&t instanceof ce)return ce.divideComponents(t,n,kn.getCartesian4());if(t instanceof ce&&typeof n=="number")return ce.divideByScalar(t,n,kn.getCartesian4());if(typeof t=="number"&&typeof n=="number")return t/n;throw new ae(`Operator "/" requires vector or number arguments of matching types, or a number as the second argument. Arguments are ${t} and ${n}.`)};Mt.prototype._evaluateMod=function(e){let t=this._left.evaluate(e),n=this._right.evaluate(e);if(n instanceof k&&t instanceof k)return k.fromElements(t.x%n.x,t.y%n.y,kn.getCartesian2());if(n instanceof h&&t instanceof h)return h.fromElements(t.x%n.x,t.y%n.y,t.z%n.z,kn.getCartesian3());if(n instanceof ce&&t instanceof ce)return ce.fromElements(t.x%n.x,t.y%n.y,t.z%n.z,t.w%n.w,kn.getCartesian4());if(typeof t=="number"&&typeof n=="number")return t%n;throw new ae(`Operator "%" requires vector or number arguments of matching types. Arguments are ${t} and ${n}.`)};Mt.prototype._evaluateEqualsStrict=function(e){let t=this._left.evaluate(e),n=this._right.evaluate(e);return n instanceof k&&t instanceof k||n instanceof h&&t instanceof h||n instanceof ce&&t instanceof ce?t.equals(n):t===n};Mt.prototype._evaluateNotEqualsStrict=function(e){let t=this._left.evaluate(e),n=this._right.evaluate(e);return n instanceof k&&t instanceof k||n instanceof h&&t instanceof h||n instanceof ce&&t instanceof ce?!t.equals(n):t!==n};Mt.prototype._evaluateConditional=function(e){let t=this._test.evaluate(e);if(typeof t!="boolean")throw new ae(`Conditional argument of conditional expression must be a boolean. Argument is ${t}.`);return t?this._left.evaluate(e):this._right.evaluate(e)};Mt.prototype._evaluateNaN=function(e){return isNaN(this._left.evaluate(e))};Mt.prototype._evaluateIsFinite=function(e){return isFinite(this._left.evaluate(e))};Mt.prototype._evaluateIsExactClass=function(e){return l(e)?e.isExactClass(this._left.evaluate(e)):!1};Mt.prototype._evaluateIsClass=function(e){return l(e)?e.isClass(this._left.evaluate(e)):!1};Mt.prototype._evaluateGetExactClassName=function(e){if(l(e))return e.getExactClassName()};Mt.prototype._evaluateBooleanConversion=function(e){return!!this._left.evaluate(e)};Mt.prototype._evaluateNumberConversion=function(e){return Number(this._left.evaluate(e))};Mt.prototype._evaluateStringConversion=function(e){return String(this._left.evaluate(e))};Mt.prototype._evaluateRegExp=function(e){let t=this._value.evaluate(e),n="";l(this._left)&&(n=this._left.evaluate(e));let i;try{i=new RegExp(t,n)}catch(o){throw new ae(o)}return i};Mt.prototype._evaluateRegExpTest=function(e){let t=this._left.evaluate(e),n=this._right.evaluate(e);if(!(t instanceof RegExp&&typeof n=="string"))throw new ae(`RegExp.test requires the first argument to be a RegExp and the second argument to be a string. Arguments are ${t} and ${n}.`);return t.test(n)};Mt.prototype._evaluateRegExpMatch=function(e){let t=this._left.evaluate(e),n=this._right.evaluate(e);if(t instanceof RegExp&&typeof n=="string")return t.test(n);if(n instanceof RegExp&&typeof t=="string")return n.test(t);throw new ae(`Operator "=~" requires one RegExp argument and one string argument. Arguments are ${t} and ${n}.`)};Mt.prototype._evaluateRegExpNotMatch=function(e){let t=this._left.evaluate(e),n=this._right.evaluate(e);if(t instanceof RegExp&&typeof n=="string")return!t.test(n);if(n instanceof RegExp&&typeof t=="string")return!n.test(t);throw new ae(`Operator "!~" requires one RegExp argument and one string argument. Arguments are ${t} and ${n}.`)};Mt.prototype._evaluateRegExpExec=function(e){let t=this._left.evaluate(e),n=this._right.evaluate(e);if(!(t instanceof RegExp&&typeof n=="string"))throw new ae(`RegExp.exec requires the first argument to be a RegExp and the second argument to be a string. Arguments are ${t} and ${n}.`);let i=t.exec(n);return l(i)?i[1]:null};Mt.prototype._evaluateToString=function(e){let t=this._left.evaluate(e);if(t instanceof RegExp||t instanceof k||t instanceof h||t instanceof ce)return String(t);throw new ae(`Unexpected function call "${this._value}".`)};function zpe(e){let t=e._left,n=t.length;for(let a=0;a1){let p=d[0],b=d[1];return b!=="1.0"&&(t.translucent=!0),`vec4(${p}, ${b})`}}else return"vec4(1.0)";return`vec4(${d[0]}, 1.0)`}else{if(c==="rgb")return i=Hpe(this),l(i)?yO(i):`vec4(${d[0]} / 255.0, ${d[1]} / 255.0, ${d[2]} / 255.0, 1.0)`;if(c==="rgba")return d[3]!=="1.0"&&(t.translucent=!0),i=Hpe(this),l(i)?yO(i):`vec4(${d[0]} / 255.0, ${d[1]} / 255.0, ${d[2]} / 255.0, ${d[3]})`;if(c==="hsl")return i=zpe(this),l(i)?yO(i):`vec4(czm_HSLToRGB(vec3(${d[0]}, ${d[1]}, ${d[2]})), 1.0)`;if(c==="hsla")return i=zpe(this),l(i)?(i.alpha!==1&&(t.translucent=!0),yO(i)):(d[3]!=="1.0"&&(t.translucent=!0),`vec4(czm_HSLToRGB(vec3(${d[0]}, ${d[1]}, ${d[2]})), ${d[3]})`)}break;case Pt.LITERAL_VECTOR:u=o.length,m=`${c}(`;for(let p=0;p0;){let u=t.pop();if(U.equals(u.color,a.color))d=S8(n,s,d,i,o,u.batchIds,r),a.batchIds=a.batchIds.concat(u.batchIds),a.count=d-a.offset;else{let m=d;d=S8(n,s,d,i,o,u.batchIds,r),u.offset=m,u.count=d-m,c.push(u),a=u}}e._va.indexBuffer.copyFromArrayView(s),e._indices=s,e._batchedIndices=c}function Z8(e,t,n,i,o,r,s){let a=e.bytesPerIndex,c=r.length;for(let d=0;d0;){let m=t.pop();if(U.equals(m.color,r.color))d=Z8(a,c,d,n,i,m.batchIds,o),r.batchIds=r.batchIds.concat(m.batchIds),r.count=d-r.offset;else{let p=d;d=Z8(a,c,d,n,i,m.batchIds,o),m.offset=p,m.count=d-p,s.push(m),r=m}}let u=e._va;e._va=e._vaSwap,e._vaSwap=u,e._batchedIndices=s}function Vje(e,t){return t.color.toRgba()-e.color.toRgba()}function Eje(e,t){if(!e._batchDirty)return!1;let n=e._batchedIndices,i=n.length,o=!1,r={};for(let s=0;s=y&&s{e.isDestroyed()||(e._error=f)}):void 0}}function Dje(e){l(e._primitive)||(e._primitive=new j_({batchTable:e._batchTable,positions:e._positions,batchIds:e._batchIds,vertexBatchIds:e._vertexBatchIds,indices:e._indices,indexOffsets:e._indexOffsets,indexCounts:e._indexCounts,batchedIndices:e._batchedIndices,boundingVolume:e._boundingVolume,boundingVolumes:e._boundingVolumes,center:e._center,pickObject:e._pickObject??e}),e._boxes=void 0,e._boxBatchIds=void 0,e._cylinders=void 0,e._cylinderBatchIds=void 0,e._ellipsoids=void 0,e._ellipsoidBatchIds=void 0,e._spheres=void 0,e._sphereBatchIds=void 0,e._center=void 0,e._modelMatrix=void 0,e._batchTable=void 0,e._boundingVolume=void 0,e._boundingVolumes=void 0,e._batchedIndices=void 0,e._indices=void 0,e._indexOffsets=void 0,e._indexCounts=void 0,e._positions=void 0,e._vertexBatchIds=void 0,e._batchIds=void 0,e._batchTableColors=void 0,e._packedBuffer=void 0,e._verticesPromise=void 0)}Au.prototype.createFeatures=function(e,t){this._primitive.createFeatures(e,t)};Au.prototype.applyDebugSettings=function(e,t){this._primitive.applyDebugSettings(e,t)};Au.prototype.applyStyle=function(e,t){this._primitive.applyStyle(e,t)};Au.prototype.updateCommands=function(e,t){this._primitive.updateCommands(e,t)};Au.prototype.update=function(e){if(!this._ready){if(l(this._promise)||(this._promise=Uje(this)),l(this._error)){let t=this._error;throw this._error=void 0,t}return}this._primitive.debugWireframe=this.debugWireframe,this._primitive.forceRebatch=this.forceRebatch,this._primitive.classificationType=this.classificationType,this._primitive.update(e)};Au.prototype.isDestroyed=function(){return!1};Au.prototype.destroy=function(){return this._primitive=this._primitive&&this._primitive.destroy(),ue(this)};var Ab=Au;var R8=class{constructor(t,n,i,o,r){this._tileset=t,this._tile=n,this._resource=i,this._geometries=void 0,this._metadata=void 0,this._batchTable=void 0,this._features=void 0,this.featurePropertiesDirty=!1,this._group=void 0,this._ready=!1,zje(this,o,r)}get featuresLength(){return l(this._batchTable)?this._batchTable.featuresLength:0}get pointsLength(){return 0}get trianglesLength(){return l(this._geometries)?this._geometries.trianglesLength:0}get geometryByteLength(){return l(this._geometries)?this._geometries.geometryByteLength:0}get texturesByteLength(){return 0}get batchTableByteLength(){return l(this._batchTable)?this._batchTable.batchTableByteLength:0}get innerContents(){}get ready(){return this._ready}get tileset(){return this._tileset}get tile(){return this._tile}get url(){return this._resource.getUrlComponent(!0)}get metadata(){return this._metadata}set metadata(t){this._metadata=t}get batchTable(){return this._batchTable}get group(){return this._group}set group(t){this._group=t}hasProperty(t,n){return this._batchTable.hasProperty(t,n)}getFeature(t){return $pe(this),this._features[t]}applyDebugSettings(t,n){l(this._geometries)&&this._geometries.applyDebugSettings(t,n)}applyStyle(t){$pe(this),l(this._geometries)&&this._geometries.applyStyle(t,this._features)}update(t,n){l(this._geometries)&&(this._geometries.classificationType=this._tileset.classificationType,this._geometries.debugWireframe=this._tileset.debugWireframe,this._geometries.update(n)),l(this._batchTable)&&this._geometries.ready&&(this._batchTable.update(t,n),this._ready=!0)}pick(t,n,i){}isDestroyed(){return!1}destroy(){return this._geometries=this._geometries&&this._geometries.destroy(),this._batchTable=this._batchTable&&this._batchTable.destroy(),ue(this)}};function Oje(e){return function(t,n){l(e._geometries)&&e._geometries.updateCommands(t,n)}}function Bje(e,t){let n,i,o,r,s,a=e.BOXES_LENGTH??0,c=e.CYLINDERS_LENGTH??0,d=e.ELLIPSOIDS_LENGTH??0,u=e.SPHERES_LENGTH??0;if(a>0&&l(e.BOX_BATCH_IDS)){let f=t.byteOffset+e.BOX_BATCH_IDS.byteOffset;n=new Uint16Array(t.buffer,f,a)}if(c>0&&l(e.CYLINDER_BATCH_IDS)){let f=t.byteOffset+e.CYLINDER_BATCH_IDS.byteOffset;i=new Uint16Array(t.buffer,f,c)}if(d>0&&l(e.ELLIPSOID_BATCH_IDS)){let f=t.byteOffset+e.ELLIPSOID_BATCH_IDS.byteOffset;o=new Uint16Array(t.buffer,f,d)}if(u>0&&l(e.SPHERE_BATCH_IDS)){let f=t.byteOffset+e.SPHERE_BATCH_IDS.byteOffset;r=new Uint16Array(t.buffer,f,u)}let m=l(n)||l(i)||l(o)||l(r),p=a>0&&!l(n)||c>0&&!l(i)||d>0&&!l(o)||u>0&&!l(r);if(m&&p)throw new ae("If one group of batch ids is defined, then all batch ids must be defined");if(!l(n)&&!l(i)&&!l(o)&&!l(r)){let f=0;if(!l(n)&&a>0)for(n=new Uint16Array(a),s=0;s0)for(i=new Uint16Array(c),s=0;s0)for(o=new Uint16Array(d),s=0;s0)for(r=new Uint16Array(u),s=0;s0&&(b=vr(i,n,d),n+=d,u>0&&(f=new Uint8Array(t,n,u),f=new Uint8Array(f)));let y=m.BOXES_LENGTH??0,_=m.CYLINDERS_LENGTH??0,S=m.ELLIPSOIDS_LENGTH??0,Z=m.SPHERES_LENGTH??0,R=y+_+S+Z,C=new tf(e,R,b,f,Oje(e));if(e._batchTable=C,R===0)return;let E=e.tile.computedTransform,A;l(m.RTC_CENTER)&&(A=h.unpack(m.RTC_CENTER),P.multiplyByPoint(E,A,A));let L=Bje(m,p);if(y>0||_>0||S>0||Z>0){let F,I,N,g;if(y>0){let V=p.byteOffset+m.BOXES.byteOffset;F=new Float32Array(p.buffer,V,Ab.packedBoxLength*y)}if(_>0){let V=p.byteOffset+m.CYLINDERS.byteOffset;I=new Float32Array(p.buffer,V,Ab.packedCylinderLength*_)}if(S>0){let V=p.byteOffset+m.ELLIPSOIDS.byteOffset;N=new Float32Array(p.buffer,V,Ab.packedEllipsoidLength*S)}if(Z>0){let V=p.byteOffset+m.SPHERES.byteOffset;g=new Float32Array(p.buffer,V,Ab.packedSphereLength*Z)}return e._geometries=new Ab({boxes:F,boxBatchIds:L.boxes,cylinders:I,cylinderBatchIds:L.cylinders,ellipsoids:N,ellipsoidBatchIds:L.ellipsoids,spheres:g,sphereBatchIds:L.spheres,center:A,modelMatrix:E,batchTable:C,boundingVolume:e.tile.boundingVolume.boundingVolume}),e}return Promise.resolve(e)}function $pe(e){let t=e.featuresLength;if(!l(e._features)&&t>0){let n=new Array(t);l(e._geometries)&&e._geometries.createFeatures(e,n),e._features=n}}var YF=R8;var JMn=x(T(),1);var qWn=x(T(),1);var C8={};C8.encode2D=function(e,t,n){let i=Math.pow(2,e),o={x:t,y:n},r,s,a,c=BigInt(0);for(a=i/2;a>0;a/=2)r=(o.x&a)>0?1:0,s=(o.y&a)>0?1:0,c+=BigInt((3*r^s)*a*a),e0e(i,o,r,s);return c};C8.decode2D=function(e,t){let n=Math.pow(2,e),i={x:0,y:0},o,r,s,a;for(s=1,a=t;s>>0,V8=2*q_+1,qy=4,i0e=[],o0e=[],Jje=[[0,1,3,2],[0,2,3,1],[3,2,0,1],[3,1,0,2]],$y=1,k1=2,ZO=[$y,0,0,$y|k1];function ks(e){if(!fn.supportsBigInt())throw new ae("S2 required BigInt support");this._cellId=e,this._level=ks.getLevel(e)}ks.fromToken=function(e){return new ks(ks.getIdFromToken(e))};ks.isValidId=function(e){return!(e<=0||e>>BigInt(V8)>5||!(e&~e+BigInt(1)&BigInt("0x1555555555555555")))};ks.isValidToken=function(e){return/^[0-9a-fA-F]{1,16}$/.test(e)?ks.isValidId(ks.getIdFromToken(e)):!1};ks.getIdFromToken=function(e){return BigInt("0x"+e+"0".repeat(16-e.length))};ks.getTokenFromId=function(e){let t=Math.floor(r4e(e)/4),n=e.toString(16).replace(/0*$/,"");return Array(17-t-n.length).join("0")+n};ks.getLevel=function(e){let t=0;for(;e!==BigInt(0)&&!(e&BigInt(1));)t++,e=e>>BigInt(1);return q_-(t>>1)};ks.prototype.getChild=function(e){let t=a0e(this._cellId)>>BigInt(2),n=this._cellId+BigInt(2*e+1-4)*t;return new ks(n)};ks.prototype.getParent=function(){let e=a0e(this._cellId)<>1&1;return s0e(i[0],o[0][r^n&1],o[1][r])}function qje(e,t){let n=r0e(e),i=n[0],o=n[1],r=n[2],s=t===30,a=!s&&(BigInt(o)^e>>BigInt(2))&BigInt(1),c=s?1:a?2:0,d=(o<<1)+c,u=(r<<1)+c;return[i,d,u]}function r0e(e){i0e.length===0&&n4e();let t=Number(e>>BigInt(V8)),n=t&$y,i=(1<=0;s--){let c=(1<<2*(s===7?q_-7*qy:qy))-1;n+=Number(e>>BigInt(s*2*qy+1)&BigInt(c))<<2,n=o0e[n];let d=s*qy;o+=n>>qy+2<>2&i)<=.5?1/3*(4*e*e-1):1/3*(1-4*(1-e)*(1-e))}function t0e(e){return 1/Kje*e}function e4e(e,t){let n=[[],[]],i=t4e(t);for(let o=0;o<2;++o){let r=e[o]&-i,s=r+i;n[o][0]=RO(n0e(r)),n[o][1]=RO(n0e(s))}return n}function t4e(e){return 1<>>0}function n0e(e){return 1/Hje*e}function ex(e,t,n,i,o,r){if(e===qy){let s=(t<>1),n+(s[0]&1),i,o,r^ZO[0]),ex(e,t+(s[1]>>1),n+(s[1]&1),i,o+1,r^ZO[1]),ex(e,t+(s[2]>>1),n+(s[2]&1),i,o+2,r^ZO[2]),ex(e,t+(s[3]>>1),n+(s[3]&1),i,o+3,r^ZO[3])}}function n4e(){ex(0,0,0,0,0,0),ex(0,0,0,$y,0,$y),ex(0,0,0,k1,0,k1),ex(0,0,0,$y|k1,0,$y|k1)}function a0e(e){return e&~e+BigInt(1)}function i4e(e){return BigInt(1)<>3,r=i%8;n+=e[o]>>r&1}return n}Object.defineProperties(E8.prototype,{lengthBits:{get:function(){return this._lengthBits}},availableCount:{get:function(){return this._availableCount}}});E8.prototype.getBit=function(e){if(l(this._constant))return this._constant;let t=e>>3,n=e%8;return(this._bitstream[t]>>n&1)===1};var U1=E8;var pvn=x(T(),1);function Lb(e){e=e??B.EMPTY_OBJECT;let t=e.metadataTable,n=e.class,i=e.entityId,o=e.propertyTableJson;this._class=n,this._metadataTable=t,this._entityId=i,this._extensions=o.extensions,this._extras=o.extras}Object.defineProperties(Lb.prototype,{class:{get:function(){return this._class}},extras:{get:function(){return this._extras}},extensions:{get:function(){return this._extensions}}});Lb.prototype.hasProperty=function(e){return this._metadataTable.hasProperty(e)};Lb.prototype.hasPropertyBySemantic=function(e){return this._metadataTable.hasPropertyBySemantic(e)};Lb.prototype.getPropertyIds=function(e){return this._metadataTable.getPropertyIds(e)};Lb.prototype.getProperty=function(e){return this._metadataTable.getProperty(this._entityId,e)};Lb.prototype.setProperty=function(e,t){return this._metadataTable.setProperty(this._entityId,e,t)};Lb.prototype.getPropertyBySemantic=function(e){return this._metadataTable.getPropertyBySemantic(this._entityId,e)};Lb.prototype.setPropertyBySemantic=function(e,t){return this._metadataTable.setPropertyBySemantic(this._entityId,e,t)};var D1=Lb;var gvn=x(T(),1);var MF={QUADTREE:"QUADTREE",OCTREE:"OCTREE"};MF.getBranchingFactor=function(e){switch(e){case MF.OCTREE:return 8;case MF.QUADTREE:return 4}};Object.freeze(MF);var Us=MF;var Evn=x(T(),1);var Svn=x(T(),1);function lc(){}Object.defineProperties(lc.prototype,{class:{get:function(){ge.throwInstantiationError()}}});lc.prototype.hasProperty=function(e){ge.throwInstantiationError()};lc.prototype.hasPropertyBySemantic=function(e){ge.throwInstantiationError()};lc.prototype.getPropertyIds=function(e){ge.throwInstantiationError()};lc.prototype.getProperty=function(e){ge.throwInstantiationError()};lc.prototype.setProperty=function(e,t){ge.throwInstantiationError()};lc.prototype.getPropertyBySemantic=function(e){ge.throwInstantiationError()};lc.prototype.setPropertyBySemantic=function(e,t){ge.throwInstantiationError()};lc.hasProperty=function(e,t,n){if(l(t[e]))return!0;let i=n.properties;if(!l(i))return!1;let o=i[e];return!!(l(o)&&l(o.default))};lc.hasPropertyBySemantic=function(e,t,n){let i=n.propertiesBySemantic;if(!l(i))return!1;let o=i[e];return l(o)};lc.getPropertyIds=function(e,t,n){n=l(n)?n:[],n.length=0;for(let o in e)e.hasOwnProperty(o)&&l(e[o])&&n.push(o);let i=t.properties;if(l(i))for(let o in i)i.hasOwnProperty(o)&&!l(e[o])&&l(i[o].default)&&n.push(o);return n};lc.getProperty=function(e,t,n){let i=n.properties[e],o=t[e];Array.isArray(o)&&l(o.slice)&&(o=o.slice());let r=!0;if(o=i.handleNoData(o),!l(o)&&l(i.default))return o=$e(i.default,!0),i.unpackVectorAndMatrixTypes(o,r);if(l(o))return o=i.normalize(o),o=i.applyValueTransform(o),i.unpackVectorAndMatrixTypes(o,r)};lc.setProperty=function(e,t,n,i){if(!l(n[e]))return!1;Array.isArray(t)&&l(t.slice)&&(t=t.slice());let o,r=i.properties;return l(r)&&(o=r[e]),l(o)&&(t=o.packVectorAndMatrixTypes(t,!0),t=o.unapplyValueTransform(t),t=o.unnormalize(t)),n[e]=t,!0};lc.getPropertyBySemantic=function(e,t,n){let i=n.propertiesBySemantic;if(!l(i))return;let o=i[e];if(l(o))return lc.getProperty(o.id,t,n)};lc.setPropertyBySemantic=function(e,t,n,i){let o=i.propertiesBySemantic;if(!l(o))return!1;let r=i.propertiesBySemantic[e];return l(r)?lc.setProperty(r.id,t,n,i):!1};var Jn=lc;function Wb(e){e=e??B.EMPTY_OBJECT;let t=e.subtreeMetadata,n=e.class,i=l(t.properties)?t.properties:{};this._class=n,this._properties=i,this._extras=t.extras,this._extensions=t.extensions}Object.defineProperties(Wb.prototype,{class:{get:function(){return this._class}},extras:{get:function(){return this._extras}},extensions:{get:function(){return this._extensions}}});Wb.prototype.hasProperty=function(e){return Jn.hasProperty(e,this._properties,this._class)};Wb.prototype.hasPropertyBySemantic=function(e){return Jn.hasPropertyBySemantic(e,this._properties,this._class)};Wb.prototype.getPropertyIds=function(e){return Jn.getPropertyIds(this._properties,this._class,e)};Wb.prototype.getProperty=function(e){return Jn.getProperty(e,this._properties,this._class)};Wb.prototype.setProperty=function(e,t){return Jn.setProperty(e,t,this._properties,this._class)};Wb.prototype.getPropertyBySemantic=function(e){return Jn.getPropertyBySemantic(e,this._properties,this._class)};Wb.prototype.setPropertyBySemantic=function(e,t){return Jn.setPropertyBySemantic(e,t,this._properties,this._class)};var wF=Wb;var T2n=x(T(),1);var h2n=x(T(),1);var Fvn=x(T(),1);var hn={INT8:"INT8",UINT8:"UINT8",INT16:"INT16",UINT16:"UINT16",INT32:"INT32",UINT32:"UINT32",INT64:"INT64",UINT64:"UINT64",FLOAT32:"FLOAT32",FLOAT64:"FLOAT64"},nl={INTEGER:"int",UNSIGNED_INTEGER:"uint",FLOAT:"float"};hn.typeInfo={INT8:{vectorCompatible:!0,size:1,maximumValue:127,minimumValue:-128,category:nl.INTEGER},UINT8:{vectorCompatible:!0,size:1,maximumValue:255,minimumValue:0,category:nl.UNSIGNED_INTEGER},INT16:{vectorCompatible:!0,size:2,maximumValue:32767,minimumValue:-32768,category:nl.INTEGER},UINT16:{vectorCompatible:!0,size:2,maximumValue:65535,minimumValue:0,category:nl.UNSIGNED_INTEGER},INT32:{vectorCompatible:!0,size:4,maximumValue:2147483647,minimumValue:-2147483648,category:nl.INTEGER},UINT32:{vectorCompatible:!0,size:4,maximumValue:4294967295,minimumValue:0,category:nl.UNSIGNED_INTEGER},INT64:{vectorCompatible:!1,size:8,maximumValue:BigInt("9223372036854775807"),minimumValue:BigInt("-9223372036854775808"),category:nl.INTEGER,downcastFunction:e=>hn.clampToLimits(e,hn.INT32)},UINT64:{vectorCompatible:!1,size:8,maximumValue:BigInt("18446744073709551615"),minimumValue:BigInt(0),category:nl.UNSIGNED_INTEGER,downcastFunction:e=>hn.clampToLimits(e,hn.UINT32)},FLOAT32:{vectorCompatible:!0,size:4,maximumValue:34028234663852886e22,minimumValue:-34028234663852886e22,category:nl.FLOAT},FLOAT64:{vectorCompatible:!0,size:8,maximumValue:Number.MAX_VALUE,minimumValue:-Number.MAX_VALUE,category:nl.FLOAT,downcastFunction:e=>Math.fround(e)}};hn.getMinimum=function(e){return hn.typeInfo[e].minimumValue};hn.getMaximum=function(e){return hn.typeInfo[e].maximumValue};hn.isIntegerType=function(e){return hn.typeInfo[e].category!==nl.FLOAT};hn.isUnsignedIntegerType=function(e){return hn.typeInfo[e].category===nl.UNSIGNED_INTEGER};hn.isVectorCompatible=function(e){return hn.typeInfo[e].vectorCompatible};hn.category=function(e){return hn.typeInfo[e].category};hn.gpuComponentType=function(e){switch(e){case hn.INT64:return"INT32";case hn.UINT64:return"UINT32";case hn.FLOAT64:return"FLOAT32";default:return e}};hn.normalize=function(e,t){return Math.max(Number(e)/Number(hn.getMaximum(t)),-1)};hn.unnormalize=function(e,t){let n=hn.getMaximum(t),i=hn.isUnsignedIntegerType(t)?0:-n;return e=W.sign(e)*Math.round(Math.abs(e)*Number(n)),(t===hn.INT64||t===hn.UINT64)&&fn.supportsBigInt()&&(e=BigInt(e)),e>n?n:er?i:Number(e)}return Math.max(n,Math.min(i,e))};hn.downcastFunction=function(e){let n=hn.typeInfo[e].downcastFunction;return l(n)?n:i=>i};hn.fromComponentDatatype=function(e){switch(e){case J.BYTE:return hn.INT8;case J.UNSIGNED_BYTE:return hn.UINT8;case J.SHORT:return hn.INT16;case J.UNSIGNED_SHORT:return hn.UINT16;case J.INT:return hn.INT32;case J.UNSIGNED_INT:return hn.UINT32;case J.FLOAT:return hn.FLOAT32;case J.DOUBLE:return hn.FLOAT64}};hn.toComponentDatatype=function(e){switch(e){case hn.INT8:return J.BYTE;case hn.UINT8:return J.UNSIGNED_BYTE;case hn.INT16:return J.SHORT;case hn.UINT16:return J.UNSIGNED_SHORT;case hn.INT32:return J.INT;case hn.UINT32:return J.UNSIGNED_INT;case hn.FLOAT32:return J.FLOAT;case hn.FLOAT64:return J.DOUBLE}};hn.getDataViewAccessors=function(e,t){return{[hn.UINT8]:{get:e.getUint8.bind(e),set:e.setUint8.bind(e)},[hn.INT8]:{get:e.getInt8.bind(e),set:e.setInt8.bind(e)},[hn.UINT16]:{get:i=>e.getUint16(i,!0),set:(i,o)=>e.setUint16(i,o,!0)},[hn.INT16]:{get:i=>e.getInt16(i,!0),set:(i,o)=>e.setInt16(i,o,!0)},[hn.UINT32]:{get:i=>e.getUint32(i,!0),set:(i,o)=>e.setUint32(i,o,!0)},[hn.INT32]:{get:i=>e.getInt32(i,!0),set:(i,o)=>e.setInt32(i,o,!0)},[hn.FLOAT32]:{get:i=>e.getFloat32(i,!0),set:(i,o)=>e.setFloat32(i,o,!0)},[hn.FLOAT64]:{get:i=>e.getFloat64(i,!0),set:(i,o)=>e.setFloat64(i,o,!0)},[hn.UINT64]:{get:i=>e.getBigUint64(i,!0),set:(i,o)=>e.setBigUint64(i,BigInt(o),!0)},[hn.INT64]:{get:i=>e.getBigInt64(i,!0),set:(i,o)=>e.setBigInt64(i,BigInt(o),!0)}}[t]};Object.freeze(hn);var Nt=hn;var e2n=x(T(),1);var kvn=x(T(),1);var ar={SCALAR:"SCALAR",VEC2:"VEC2",VEC3:"VEC3",VEC4:"VEC4",MAT2:"MAT2",MAT3:"MAT3",MAT4:"MAT4",BOOLEAN:"BOOLEAN",STRING:"STRING",ENUM:"ENUM"};ar.isVectorType=function(e){switch(e){case ar.VEC2:case ar.VEC3:case ar.VEC4:return!0;default:return!1}};ar.isMatrixType=function(e){switch(e){case ar.MAT2:case ar.MAT3:case ar.MAT4:return!0;default:return!1}};ar.getComponentCount=function(e){switch(e){case ar.SCALAR:case ar.STRING:case ar.ENUM:case ar.BOOLEAN:return 1;case ar.VEC2:return 2;case ar.VEC3:return 3;case ar.VEC4:return 4;case ar.MAT2:return 4;case ar.MAT3:return 9;case ar.MAT4:return 16}};ar.getMathType=function(e){switch(e){case ar.VEC2:return k;case ar.VEC3:return h;case ar.VEC4:return ce;case ar.MAT2:return Ji;case ar.MAT3:return q;case ar.MAT4:return P;default:return}};Object.freeze(ar);var St=ar;function os(e){e=e??B.EMPTY_OBJECT;let t=e.id,n=e.type,i=e.componentType,o=e.enumType,r=l(i)&&(e.normalized??!1)&&Nt.isIntegerType(i);this._id=t,this._name=e.name,this._description=e.description,this._semantic=e.semantic,this._isLegacyExtension=e.isLegacyExtension,this._type=n,this._componentType=i,this._enumType=o,this._valueType=l(o)?o.valueType:i,this._isArray=e.isArray??!1,this._isVariableLengthArray=e.isVariableLengthArray??!1,this._arrayLength=e.arrayLength,this._min=$e(e.min,!0),this._max=$e(e.max,!0),this._normalized=r;let s=$e(e.offset,!0),a=$e(e.scale,!0),c=l(s)||l(a),d=!0;l(s)||(s=this.expandConstant(0,d)),l(a)||(a=this.expandConstant(1,d)),this._offset=s,this._scale=a,this._hasValueTransform=c,this._noData=$e(e.noData,!0),this._default=$e(e.default,!0),this._required=e.required??!0,this._extras=$e(e.extras,!0),this._extensions=$e(e.extensions,!0)}os.fromJson=function(e){e=e??B.EMPTY_OBJECT;let t=e.id,n=e.property,i=c4e(n),o=l4e(n,e.enums),r;return l(i)?i?r=l(n.optional)?!n.optional:!0:r=n.required??!1:r=!1,new os({id:t,type:o.type,componentType:o.componentType,enumType:o.enumType,isArray:o.isArray,isVariableLengthArray:o.isVariableLengthArray,arrayLength:o.arrayLength,normalized:n.normalized,min:n.min,max:n.max,offset:n.offset,scale:n.scale,noData:n.noData,default:n.default,required:r,name:n.name,description:n.description,semantic:n.semantic,extras:n.extras,extensions:n.extensions,isLegacyExtension:i})};Object.defineProperties(os.prototype,{id:{get:function(){return this._id}},name:{get:function(){return this._name}},description:{get:function(){return this._description}},type:{get:function(){return this._type}},enumType:{get:function(){return this._enumType}},componentType:{get:function(){return this._componentType}},valueType:{get:function(){return this._valueType}},isArray:{get:function(){return this._isArray}},isVariableLengthArray:{get:function(){return this._isVariableLengthArray}},arrayLength:{get:function(){return this._arrayLength}},normalized:{get:function(){return this._normalized}},max:{get:function(){return this._max}},min:{get:function(){return this._min}},noData:{get:function(){return this._noData}},default:{get:function(){return this._default}},required:{get:function(){return this._required}},semantic:{get:function(){return this._semantic}},hasValueTransform:{get:function(){return this._hasValueTransform}},offset:{get:function(){return this._offset}},scale:{get:function(){return this._scale}},extras:{get:function(){return this._extras}},extensions:{get:function(){return this._extensions}}});function c4e(e){if(e.type==="ARRAY")return!0;let t=e.type;if(t===St.SCALAR||St.isMatrixType(t)||St.isVectorType(t))return!1;if(l(Nt[t]))return!0;if(l(e.noData)||l(e.scale)||l(e.offset)||l(e.required)||l(e.count)||l(e.array)||l(e.optional))return!1}function l4e(e,t){let n=e.type,i=e.componentType,o=n==="ARRAY",r,s,a;o?(r=!0,s=e.componentCount,a=!l(s)):e.array?(r=!0,s=e.count,a=!l(e.count)):(r=!1,s=void 0,a=!1);let c;if(l(e.enumType)&&(c=t[e.enumType]),n===St.ENUM)return{type:n,componentType:void 0,enumType:c,valueType:c.valueType,isArray:r,isVariableLengthArray:a,arrayLength:s};if(o&&i===St.ENUM)return{type:i,componentType:void 0,enumType:c,valueType:c.valueType,isArray:r,isVariableLengthArray:a,arrayLength:s};if(n===St.SCALAR||St.isMatrixType(n)||St.isVectorType(n))return{type:n,componentType:i,enumType:void 0,valueType:i,isArray:r,isVariableLengthArray:a,arrayLength:s};if(n===St.BOOLEAN||n===St.STRING)return{type:n,componentType:void 0,enumType:void 0,valueType:void 0,isArray:r,isVariableLengthArray:a,arrayLength:s};if(o&&(i===St.BOOLEAN||i===St.STRING))return{type:i,componentType:void 0,enumType:void 0,valueType:void 0,isArray:r,isVariableLengthArray:a,arrayLength:s};if(l(i)&&l(Nt[i]))return{type:St.SCALAR,componentType:i,enumType:void 0,valueType:i,isArray:r,isVariableLengthArray:a,arrayLength:s};if(l(Nt[n]))return{type:St.SCALAR,componentType:n,enumType:void 0,valueType:n,isArray:r,isVariableLengthArray:a,arrayLength:s}}os.prototype.normalize=function(e){return this._normalized?A8(e,this._valueType,Nt.normalize):e};os.prototype.unnormalize=function(e){return this._normalized?A8(e,this._valueType,Nt.unnormalize):e};os.prototype.applyValueTransform=function(e){return!this._hasValueTransform||this._isVariableLengthArray?e:os.valueTransformInPlace(e,this._offset,this._scale,Nt.applyValueTransform)};os.prototype.unapplyValueTransform=function(e){return!this._hasValueTransform||this._isVariableLengthArray?e:os.valueTransformInPlace(e,this._offset,this._scale,Nt.unapplyValueTransform)};os.prototype.expandConstant=function(e,t){t=t??!1;let n=this._isArray,i=this._arrayLength,o=St.getComponentCount(this._type),r=n&&o>1;if(!n&&o===1)return e;if(!n)return new Array(o).fill(e);if(!r)return new Array(i).fill(e);if(!t)return new Array(this._arrayLength*o).fill(e);let s=new Array(o).fill(e);return new Array(this._arrayLength).fill(s)};os.prototype.handleNoData=function(e){let t=this._noData;if(!l(t))return e;if(!u0e(e,t))return e};function kF(e){return Array.isArray(e)&&!(e instanceof Ji)&&!(e instanceof q)&&!(e instanceof P)}function u0e(e,t){if(!kF(e))return e===t;if(!kF(t)||e.length!==t.length)return!1;for(let n=0;n1;return l(n)?t&&r?e.map(function(s){return n.unpack(s)}):i?n.unpackArray(e):n.unpack(e):e};os.prototype.packVectorAndMatrixTypes=function(e,t){t=t??!1;let n=St.getMathType(this._type),i=this._isArray,o=St.getComponentCount(this._type),r=i&&o>1;return l(n)?t&&r?e.map(function(s){return n.pack(s,[])}):i?n.packArray(e,[]):n.pack(e,[]):e};os.prototype.validate=function(e){if(!(!l(e)&&l(this._default)))return this._required&&!l(e)?"required property must have a value":this._isArray?d4e(this,e):m0e(this,e)};function d4e(e,t){if(!kF(t))return`value ${t} must be an array`;let n=t.length;if(!e._isVariableLengthArray&&n!==e._arrayLength)return"Array length does not match property.arrayLength";for(let i=0;i1?c0e(e,t,n):void 0}if(eNt.getMaximum(t))return c0e(e,t,n)}function d0e(e,t){return`value ${e} of type ${t} must be finite`}function A8(e,t,n){if(!kF(e))return n(e,t);for(let i=0;ie)};var G8=[void 0,"float","vec2","vec3","vec4"],f0e=[void 0,"int","ivec2","ivec3","ivec4"],g4e=[void 0,"uint","uvec2","uvec3","uvec4"],y4e={[nl.FLOAT]:"uintBitsToFloat",[nl.INTEGER]:"int",[nl.UNSIGNED_INTEGER]:""};os.prototype.getGlslTypeWebGL1=function(){let e=St.getComponentCount(this.type);return this.isArray&&(e=this.arrayLength),this.normalized?G8[e]:f0e[e]};os.prototype.getGlslType=function(){let e=this.valueType,t=St.getComponentCount(this.type),n=this.isArray?this.arrayLength:1;return t*=n,!Nt.isIntegerType(e)||this.normalized?G8[t]:Nt.isUnsignedIntegerType(e)?g4e[t]:f0e[t]};os.prototype.unpackTextureInShader=function(e,t,n,i){let o=this.getGlslType(),r=Nt.gpuComponentType(this.valueType),s=t.length,a=this.type,c=St.getComponentCount(a)*(this.isArray?this.arrayLength:1),d=Math.floor(s/c),u=`${n}_rawChannels`,m=`${n}_rawBits`,p=`${n}_unpackedValue`,b=`${o} ${p};`,f=`uint ${m};`;i.push(b),i.push(f);let y=`${G8[s]} ${u} = ${e};`;i.push(y);let _=y4e[Nt.category(r)],S=c>1;for(let Z=0;Z1?`.${R}`:"",E=`${m} = czm_unpackTexture(${u}${C});`,A="";S&&(A=`[${Z}]`);let L="",F="";if(this.normalized){let N=Nt.getMaximum(r);L=` * ${1/Number(N)}`,F="float"}let I=`${p}${A} = ${F}(${_}(${m}))${L};`;i.push(E),i.push(I)}return p};os.prototype.unpackTextureInShaderWebGL1=function(e){return this.normalized?e:`${this.getGlslTypeWebGL1()}(255.0 * ${e})`};var Xp=os;function UF(e){e=e??B.EMPTY_OBJECT;let t=e.count,n=e.property,i=e.classProperty,o=e.bufferViews,r=i.type,s=i.isArray,a=i.isVariableLengthArray,c=i.valueType,d=i.enumType,u=r===St.STRING,m=r===St.BOOLEAN,p=0,b;if(a){let g=n.arrayOffsetType??n.offsetType;g=Nt[g]??Nt.UINT32;let V=n.arrayOffsets??n.arrayOffsetBufferView;b=new L8(o[V],g,t+1),p+=b.typedArray.byteLength}let f=St.getComponentCount(r),y;a?y=b.get(t)-b.get(0):s?y=t*i.arrayLength:y=t;let _=f*y,S;if(u){let g=n.stringOffsetType??n.offsetType;g=Nt[g]??Nt.UINT32;let V=n.stringOffsets??n.stringOffsetBufferView;S=new L8(o[V],g,_+1),p+=S.typedArray.byteLength}(u||m)&&(c=Nt.UINT8);let Z;u?Z=S.get(_)-S.get(0):m?Z=Math.ceil(_/8):Z=_;let R=n.values??n.bufferView,C=new L8(o[R],c,Z);p+=C.typedArray.byteLength;let E=n.offset,A=n.scale,L=i.hasValueTransform||l(E)||l(A);E=E??i.offset,A=A??i.scale,E=p0e(E),A=p0e(A);let F,I,N=this;u?F=function(g){return _4e(g,N._values,N._stringOffsets)}:m?(F=function(g){return S4e(g,N._values)},I=function(g,V){Z4e(g,N._values,V)}):l(d)?(F=function(g){let V=N._values.get(g);return d.namesByValue[V]},I=function(g,V){let G=d.valuesByName[V];N._values.set(g,G)}):(F=function(g){return N._values.get(g)},I=function(g,V){N._values.set(g,V)}),this._arrayOffsets=b,this._stringOffsets=S,this._values=C,this._classProperty=i,this._count=t,this._vectorComponentCount=f,this._min=n.min,this._max=n.max,this._offset=E,this._scale=A,this._hasValueTransform=L,this._getValue=F,this._setValue=I,this._unpackedValues=void 0,this._extras=n.extras,this._extensions=n.extensions,this._byteLength=p}Object.defineProperties(UF.prototype,{hasValueTransform:{get:function(){return this._hasValueTransform}},offset:{get:function(){return this._offset}},scale:{get:function(){return this._scale}},extras:{get:function(){return this._extras}},extensions:{get:function(){return this._extensions}},byteLength:{get:function(){return this._byteLength}},classProperty:{get:function(){return this._classProperty}}});UF.prototype.get=function(e){let t=x4e(this,e);return t=this._classProperty.handleNoData(t),l(t)?(t=this._classProperty.normalize(t),t=W4e(this,t),this._classProperty.unpackVectorAndMatrixTypes(t)):(t=this._classProperty.default,this._classProperty.unpackVectorAndMatrixTypes(t))};UF.prototype.set=function(e,t){let n=this._classProperty;t=n.packVectorAndMatrixTypes(t),t=v4e(this,t),t=n.unnormalize(t),T4e(this,e,t)};UF.prototype.getTypedArray=function(){if(l(this._values))return this._values.typedArray};function p0e(e){if(!Array.isArray(e)||!l(e.slice))return e;let t=[];for(let n=0;n>3,i=e%8;return(t.typedArray[n]>>i&1)===1}function Z4e(e,t,n){let i=e>>3,o=e%8;n?t.typedArray[i]|=1<0,s=!0;for(let a=0;a<8;++a){let c=n.getUint8(i+a);r&&(s?c!==0&&(c=~(c-1)&255,s=!1):c=~c&255),o+=c*Math.pow(256,a)}return r&&(o=-o),o}function C4e(e,t){let n=t.dataView,i=e*8,o=BigInt(0),r=(n.getUint8(i+7)&128)>0,s=!0;for(let a=0;a<8;++a){let c=n.getUint8(i+a);r&&(s?c!==0&&(c=~(c-1)&255,s=!1):c=~c&255),o+=BigInt(c)*(BigInt(1)<{this._terrainHeight=s.height,this.definitionChanged.raiseEvent()};this._removeCallbackFunc=e.updateHeight(i,r,this._heightReference)};var oje=new Q;Y1.prototype.getValue=function(e,t){l(e)||(e=Q.now(oje));let n=j.getValueOrDefault(this._heightReference,e,He.NONE),i=j.getValueOrDefault(this._extrudedHeightReference,e,He.NONE);if(n===He.NONE&&!Uy(i))return this._position=h.clone(h.ZERO,this._position),h.clone(h.ZERO,t);if(this._positionProperty.isConstant&&n!==He.CLIP_TO_GROUND)return h.multiplyByScalar(this._normal,this._terrainHeight,t);let o=this._scene,r=this._positionProperty.getValue(e,D0e);if(!l(r)||h.equals(r,h.ZERO)||!l(o.globe))return h.clone(h.ZERO,t);if(h.equalsEpsilon(this._position,r,W.EPSILON10)&&n!==He.CLIP_TO_GROUND)return h.multiplyByScalar(this._normal,this._terrainHeight,t);this._position=h.clone(r,this._position),this._updateClamping();let s=o.ellipsoid.geodeticSurfaceNormal(r,this._normal);if(n===He.CLIP_TO_GROUND){let c=o.globe.ellipsoid.cartesianToCartographic(r,scratchCarto);return this._terrainHeight>=c.height?h.multiplyByScalar(s,this._terrainHeight-c.height,t):h.clone(h.ZERO,t)}return h.multiplyByScalar(s,this._terrainHeight,t)};Y1.prototype.isDestroyed=function(){return!1};Y1.prototype.destroy=function(){return l(this._removeEventListener)&&this._removeEventListener(),l(this._removeModeListener)&&this._removeModeListener(),l(this._removeCallbackFunc)&&this._removeCallbackFunc(),ue(this)};var H_=Y1;function rje(e,t,n,i){if(Wi.prototype._onEntityPropertyChanged.call(this,e,t,n,i),this._observedPropertyNames.indexOf(t)===-1)return;let o=this._entity[this._geometryPropertyName];if(!l(o))return;l(this._terrainOffsetProperty)&&(this._terrainOffsetProperty.destroy(),this._terrainOffsetProperty=void 0);let r=o.heightReference;if(l(r)){let s=new nf(this._computeCenter.bind(this),!this._dynamic);this._terrainOffsetProperty=new H_(this._scene,s,r)}}var Ab=rje;var O0e=h.ZERO,B0e=new h,sje=new h,z0e=new U;function aje(e){this.id=e,this.vertexFormat=void 0,this.dimensions=void 0,this.offsetAttribute=void 0}function Au(e,t){Wi.call(this,{entity:e,scene:t,geometryOptions:new aje(e),geometryPropertyName:"box",observedPropertyNames:["availability","position","orientation","box"]}),this._onEntityPropertyChanged(e,"box",e.box,void 0)}l(Object.create)&&(Au.prototype=Object.create(Wi.prototype),Au.prototype.constructor=Au);Object.defineProperties(Au.prototype,{terrainOffsetProperty:{get:function(){return this._terrainOffsetProperty}}});Au.prototype.createFillGeometryInstance=function(e){let t=this._entity,n=t.isAvailable(e),i=new vn(n&&t.isShowing&&this._showProperty.getValue(e)&&this._fillProperty.getValue(e)),o=this._distanceDisplayConditionProperty.getValue(e),r=ii.fromDistanceDisplayCondition(o),s={show:i,distanceDisplayCondition:r,color:void 0,offset:void 0};if(this._materialProperty instanceof Qt){let a;l(this._materialProperty.color)&&(this._materialProperty.color.isConstant||n)&&(a=this._materialProperty.color.getValue(e,z0e)),l(a)||(a=U.WHITE),s.color=$t.fromColor(a)}return l(this._options.offsetAttribute)&&(s.offset=Ro.fromCartesian3(j.getValueOrDefault(this._terrainOffsetProperty,e,O0e,B0e))),new Yt({id:t,geometry:Vc.fromDimensions(this._options),modelMatrix:t.computeModelMatrixForHeightReference(e,t.box.heightReference,this._options.dimensions.z*.5,this._scene.ellipsoid),attributes:s})};Au.prototype.createOutlineGeometryInstance=function(e){let t=this._entity,n=t.isAvailable(e),i=j.getValueOrDefault(this._outlineColorProperty,e,U.BLACK,z0e),o=this._distanceDisplayConditionProperty.getValue(e),r={show:new vn(n&&t.isShowing&&this._showProperty.getValue(e)&&this._showOutlineProperty.getValue(e)),color:$t.fromColor(i),distanceDisplayCondition:ii.fromDistanceDisplayCondition(o),offset:void 0};return l(this._options.offsetAttribute)&&(r.offset=Ro.fromCartesian3(j.getValueOrDefault(this._terrainOffsetProperty,e,O0e,B0e))),new Yt({id:t,geometry:tf.fromDimensions(this._options),modelMatrix:t.computeModelMatrixForHeightReference(e,t.box.heightReference,this._options.dimensions.z*.5,this._scene.ellipsoid),attributes:r})};Au.prototype._computeCenter=function(e,t){return j.getValueOrUndefined(this._entity.position,e,t)};Au.prototype._isHidden=function(e,t){return!l(t.dimensions)||!l(e.position)||Wi.prototype._isHidden.call(this,e,t)};Au.prototype._isDynamic=function(e,t){return!e.position.isConstant||!j.isConstant(e.orientation)||!t.dimensions.isConstant||!j.isConstant(t.outlineWidth)};Au.prototype._setStaticOptions=function(e,t){let n=j.getValueOrDefault(t.heightReference,ot.MINIMUM_VALUE,He.NONE),i=this._options;i.vertexFormat=this._materialProperty instanceof Qt?Tn.VERTEX_FORMAT:Co.MaterialSupport.TEXTURED.vertexFormat,i.dimensions=t.dimensions.getValue(ot.MINIMUM_VALUE,i.dimensions),i.offsetAttribute=n!==He.NONE?bn.ALL:void 0};Au.prototype._onEntityPropertyChanged=Ab;Au.DynamicGeometryUpdater=M1;function M1(e,t,n){Li.call(this,e,t,n)}l(Object.create)&&(M1.prototype=Object.create(Li.prototype),M1.prototype.constructor=M1);M1.prototype._isHidden=function(e,t,n){let i=j.getValueOrUndefined(e.position,n,sje),o=this._options.dimensions;return!l(i)||!l(o)||Li.prototype._isHidden.call(this,e,t,n)};M1.prototype._setOptions=function(e,t,n){let i=j.getValueOrDefault(t.heightReference,n,He.NONE),o=this._options;o.dimensions=j.getValueOrUndefined(t.dimensions,n,o.dimensions),o.offsetAttribute=i!==He.NONE?bn.ALL:void 0};var MF=Au;var vIn=x(T(),1);var vFn=x(T(),1);var d2n=x(T(),1),H0e={ROUNDED:0,MITERED:1,BEVELED:2};Object.freeze(H0e);var no=H0e;var H2n=x(T(),1);var S2n=x(T(),1);var jl={};jl.numberOfPoints=function(e,t,n){let i=h.distance(e,t);return Math.ceil(i/n)};jl.numberOfPointsRhumbLine=function(e,t,n){let i=Math.pow(e.longitude-t.longitude,2)+Math.pow(e.latitude-t.latitude,2);return Math.max(1,Math.ceil(Math.sqrt(i/(n*n))))};var cje=new pe;jl.extractHeights=function(e,t){let n=e.length,i=new Array(n);for(let o=0;o0){t=t??P.IDENTITY;let o=P.inverseTransformation(t,lje),r=P.multiplyByPoint(o,h.ZERO,dje),s=h.normalize(P.multiplyByPointAsVector(o,h.UNIT_Y,K0e),K0e),a=cn.fromPointNormal(r,s,uje),c=h.normalize(P.multiplyByPointAsVector(o,h.UNIT_X,J0e),J0e),d=cn.fromPointNormal(r,c,mje),u=1;n.push(h.clone(e[0]));let m=n[0],p=e.length;for(let b=1;b=0?-a:a}var Lje=new h(-1,0,0),K_=new P,Wje=new P,X8=new q,vje=q.IDENTITY.clone(),Fje=new h,Ije=new ce,q0e=new h;function Gb(e,t,n,i,o,r,s,a){let c=Fje,d=Ije;K_=_t.eastNorthUpToFixedFrame(e,o,K_),c=P.multiplyByPointAsVector(K_,Lje,c),c=h.normalize(c,c);let u=Gje(c,t,e,o);X8=q.fromRotationZ(u,X8),q0e.z=r,K_=P.multiplyTransformation(K_,P.fromRotationTranslation(X8,q0e,Wje),K_);let m=vje;m[0]=s;for(let p=0;p0){let y=d?2:1;for(let _=0;_=0};var Nje=new h,Yje=new h;kF.computePositions=function(e,t,n,i,o){let r=i._ellipsoid,s=Aje(e,r),a=i._granularity,c=i._cornerType,d=o?Xje(t,n):$0e(t,n),u=o?$0e(t,n):void 0,m=n.height/2,p=n.width/2,b=e.length,f=[],y=o?[]:void 0,_=xje,S=Tje,Z=_je,R=Sje,C=Zje,E=Rje,A=Cje,L=Vje,F=Eje,I=e[0],N=e[1];R=r.geodeticSurfaceNormal(I,R),_=h.subtract(N,I,_),_=h.normalize(_,_),L=h.cross(R,_,L),L=h.normalize(L,L);let g=s[0],V=s[1];o&&(y=Gb(I,L,u,y,r,g+m,1,1)),F=h.clone(I,F),I=N,S=h.negate(_,S);let G,v;for(let D=1;D80*n){a=e[0],c=e[1];let u=a,m=c;for(let p=n;pu&&(u=b),f>m&&(m=f)}d=Math.max(u-a,m-c),d=d!==0?32767/d:0}return DF(r,s,n,a,c,d,0),s}function hbe(e,t,n,i,o){let r;if(o===u4e(e,t,n,i)>0)for(let s=t;s=t;s-=i)r=mbe(s/i|0,e[s],e[s+1],r);return r&&U1(r,r.next)&&(BF(r),r=r.next),r}function J_(e,t){if(!e)return e;t||(t=e);let n=e,i;do if(i=!1,!n.steiner&&(U1(n,n.next)||xs(n.prev,n,n.next)===0)){if(BF(n),n=t=n.prev,n===n.next)break;i=!0}else n=n.next;while(i||n!==t);return t}function DF(e,t,n,i,o,r,s){if(!e)return;!s&&r&&r4e(e,i,o,r);let a=e;for(;e.prev!==e.next;){let c=e.prev,d=e.next;if(r?Qje(e,i,o,r):jje(e)){t.push(c.i,e.i,d.i),BF(e),e=d.next,a=d.next;continue}if(e=d,e===a){s?s===1?(e=qje(J_(e),t),DF(e,t,n,i,o,r,2)):s===2&&$je(e,t,n,i,o,r):DF(J_(e),t,n,i,o,r,1);break}}}function jje(e){let t=e.prev,n=e,i=e.next;if(xs(t,n,i)>=0)return!1;let o=t.x,r=n.x,s=i.x,a=t.y,c=n.y,d=i.y,u=Math.min(o,r,s),m=Math.min(a,c,d),p=Math.max(o,r,s),b=Math.max(a,c,d),f=i.next;for(;f!==t;){if(f.x>=u&&f.x<=p&&f.y>=m&&f.y<=b&&UF(o,a,r,c,s,d,f.x,f.y)&&xs(f.prev,f,f.next)>=0)return!1;f=f.next}return!0}function Qje(e,t,n,i){let o=e.prev,r=e,s=e.next;if(xs(o,r,s)>=0)return!1;let a=o.x,c=r.x,d=s.x,u=o.y,m=r.y,p=s.y,b=Math.min(a,c,d),f=Math.min(u,m,p),y=Math.max(a,c,d),_=Math.max(u,m,p),S=w8(b,f,t,n,i),Z=w8(y,_,t,n,i),R=e.prevZ,C=e.nextZ;for(;R&&R.z>=S&&C&&C.z<=Z;){if(R.x>=b&&R.x<=y&&R.y>=f&&R.y<=_&&R!==o&&R!==s&&UF(a,u,c,m,d,p,R.x,R.y)&&xs(R.prev,R,R.next)>=0||(R=R.prevZ,C.x>=b&&C.x<=y&&C.y>=f&&C.y<=_&&C!==o&&C!==s&&UF(a,u,c,m,d,p,C.x,C.y)&&xs(C.prev,C,C.next)>=0))return!1;C=C.nextZ}for(;R&&R.z>=S;){if(R.x>=b&&R.x<=y&&R.y>=f&&R.y<=_&&R!==o&&R!==s&&UF(a,u,c,m,d,p,R.x,R.y)&&xs(R.prev,R,R.next)>=0)return!1;R=R.prevZ}for(;C&&C.z<=Z;){if(C.x>=b&&C.x<=y&&C.y>=f&&C.y<=_&&C!==o&&C!==s&&UF(a,u,c,m,d,p,C.x,C.y)&&xs(C.prev,C,C.next)>=0)return!1;C=C.nextZ}return!0}function qje(e,t){let n=e;do{let i=n.prev,o=n.next.next;!U1(i,o)&&pbe(i,n,n.next,o)&&OF(i,o)&&OF(o,i)&&(t.push(i.i,n.i,o.i),BF(n),BF(n.next),n=e=o),n=n.next}while(n!==e);return J_(n)}function $je(e,t,n,i,o,r){let s=e;do{let a=s.next.next;for(;a!==s.prev;){if(s.i!==a.i&&c4e(s,a)){let c=bbe(s,a);s=J_(s,s.next),c=J_(c,c.next),DF(s,t,n,i,o,r,0),DF(c,t,n,i,o,r,0);return}a=a.next}s=s.next}while(s!==e)}function e4e(e,t,n,i){let o=[];for(let r=0,s=t.length;r=n.next.y&&n.next.y!==n.y){let m=n.x+(o-n.y)*(n.next.x-n.x)/(n.next.y-n.y);if(m<=i&&m>r&&(r=m,s=n.x=n.x&&n.x>=c&&i!==n.x&&fbe(os.x||n.x===s.x&&o4e(s,n)))&&(s=n,u=m)}n=n.next}while(n!==a);return s}function o4e(e,t){return xs(e.prev,e,t.prev)<0&&xs(t.next,e,e.next)<0}function r4e(e,t,n,i){let o=e;do o.z===0&&(o.z=w8(o.x,o.y,t,n,i)),o.prevZ=o.prev,o.nextZ=o.next,o=o.next;while(o!==e);o.prevZ.nextZ=null,o.prevZ=null,s4e(o)}function s4e(e){let t,n=1;do{let i=e,o;e=null;let r=null;for(t=0;i;){t++;let s=i,a=0;for(let d=0;d0||c>0&&s;)a!==0&&(c===0||!s||i.z<=s.z)?(o=i,i=i.nextZ,a--):(o=s,s=s.nextZ,c--),r?r.nextZ=o:e=o,o.prevZ=r,r=o;i=s}r.nextZ=null,n*=2}while(t>1);return e}function w8(e,t,n,i,o){return e=(e-n)*o|0,t=(t-i)*o|0,e=(e|e<<8)&16711935,e=(e|e<<4)&252645135,e=(e|e<<2)&858993459,e=(e|e<<1)&1431655765,t=(t|t<<8)&16711935,t=(t|t<<4)&252645135,t=(t|t<<2)&858993459,t=(t|t<<1)&1431655765,e|t<<1}function a4e(e){let t=e,n=e;do(t.x=(e-s)*(r-a)&&(e-s)*(i-a)>=(n-s)*(t-a)&&(n-s)*(r-a)>=(o-s)*(i-a)}function UF(e,t,n,i,o,r,s,a){return!(e===s&&t===a)&&fbe(e,t,n,i,o,r,s,a)}function c4e(e,t){return e.next.i!==t.i&&e.prev.i!==t.i&&!l4e(e,t)&&(OF(e,t)&&OF(t,e)&&d4e(e,t)&&(xs(e.prev,e,t.prev)||xs(e,t.prev,t))||U1(e,t)&&xs(e.prev,e,e.next)>0&&xs(t.prev,t,t.next)>0)}function xs(e,t,n){return(t.y-e.y)*(n.x-t.x)-(t.x-e.x)*(n.y-t.y)}function U1(e,t){return e.x===t.x&&e.y===t.y}function pbe(e,t,n,i){let o=vO(xs(e,t,n)),r=vO(xs(e,t,i)),s=vO(xs(n,i,e)),a=vO(xs(n,i,t));return!!(o!==r&&s!==a||o===0&&WO(e,n,t)||r===0&&WO(e,i,t)||s===0&&WO(n,e,i)||a===0&&WO(n,t,i))}function WO(e,t,n){return t.x<=Math.max(e.x,n.x)&&t.x>=Math.min(e.x,n.x)&&t.y<=Math.max(e.y,n.y)&&t.y>=Math.min(e.y,n.y)}function vO(e){return e>0?1:e<0?-1:0}function l4e(e,t){let n=e;do{if(n.i!==e.i&&n.next.i!==e.i&&n.i!==t.i&&n.next.i!==t.i&&pbe(n,n.next,e,t))return!0;n=n.next}while(n!==e);return!1}function OF(e,t){return xs(e.prev,e,e.next)<0?xs(e,t,e.next)>=0&&xs(e,e.prev,t)>=0:xs(e,t,e.prev)<0||xs(e,e.next,t)<0}function d4e(e,t){let n=e,i=!1,o=(e.x+t.x)/2,r=(e.y+t.y)/2;do n.y>r!=n.next.y>r&&n.next.y!==n.y&&o<(n.next.x-n.x)*(r-n.y)/(n.next.y-n.y)+n.x&&(i=!i),n=n.next;while(n!==e);return i}function bbe(e,t){let n=k8(e.i,e.x,e.y),i=k8(t.i,t.x,t.y),o=e.next,r=t.prev;return e.next=t,t.prev=e,n.next=o,o.prev=n,i.next=n,n.prev=i,r.next=i,i.prev=r,i}function mbe(e,t,n,i){let o=k8(e,t,n);return i?(o.next=i.next,o.prev=i,i.next.prev=o,i.next=o):(o.prev=o,o.next=o),o}function BF(e){e.next.prev=e.prev,e.prev.next=e.next,e.prevZ&&(e.prevZ.nextZ=e.nextZ),e.nextZ&&(e.nextZ.prevZ=e.prevZ)}function k8(e,t,n){return{i:e,x:t,y:n,prev:null,next:null,z:0,prevZ:null,nextZ:null,steiner:!1}}function u4e(e,t,n,i){let o=0;for(let r=t,s=n-i;r0?Qs.COUNTER_CLOCKWISE:Qs.CLOCKWISE};jy.triangulate=function(e,t){let n=k.packArray(e);return U8(n,t,2)};var Tbe=new h,_be=new h,Sbe=new h,gbe=new h,ybe=new h,xbe=new h,Lb=new h,Zbe=new k,Rbe=new k,Cbe=new k,D1=new k;jy.computeSubdivision=function(e,t,n,i,o){o=o??W.RADIANS_PER_DEGREE;let r=l(i),s=n.slice(0),a,c=t.length,d=new Array(c*3),u=new Array(c*2),m=0,p=0;for(a=0;a0;){let R=s.pop(),C=s.pop(),E=s.pop(),A=h.fromArray(d,E*3,Tbe),L=h.fromArray(d,C*3,_be),F=h.fromArray(d,R*3,Sbe),I,N,g;r&&(I=k.fromArray(u,E*2,Zbe),N=k.fromArray(u,C*2,Rbe),g=k.fromArray(u,R*2,Cbe));let V=h.multiplyByScalar(h.normalize(A,gbe),y,gbe),G=h.multiplyByScalar(h.normalize(L,ybe),y,ybe),v=h.multiplyByScalar(h.normalize(F,xbe),y,xbe),X=h.magnitudeSquared(h.subtract(V,G,Lb)),Y=h.magnitudeSquared(h.subtract(G,v,Lb)),D=h.magnitudeSquared(h.subtract(v,V,Lb)),M=Math.max(X,Y,D),O,w,z;M>S?X===M?(O=`${Math.min(E,C)} ${Math.max(E,C)}`,a=f[O],l(a)||(w=h.add(A,L,Lb),h.multiplyByScalar(w,.5,w),d.push(w.x,w.y,w.z),a=d.length/3-1,f[O]=a,r&&(z=k.add(I,N,D1),k.multiplyByScalar(z,.5,z),u.push(z.x,z.y))),s.push(E,a,R),s.push(a,C,R)):Y===M?(O=`${Math.min(C,R)} ${Math.max(C,R)}`,a=f[O],l(a)||(w=h.add(L,F,Lb),h.multiplyByScalar(w,.5,w),d.push(w.x,w.y,w.z),a=d.length/3-1,f[O]=a,r&&(z=k.add(N,g,D1),k.multiplyByScalar(z,.5,z),u.push(z.x,z.y))),s.push(C,a,E),s.push(a,R,E)):D===M&&(O=`${Math.min(R,E)} ${Math.max(R,E)}`,a=f[O],l(a)||(w=h.add(F,A,Lb),h.multiplyByScalar(w,.5,w),d.push(w.x,w.y,w.z),a=d.length/3-1,f[O]=a,r&&(z=k.add(g,I,D1),k.multiplyByScalar(z,.5,z),u.push(z.x,z.y))),s.push(R,a,C),s.push(a,E,C)):(b.push(E),b.push(C),b.push(R))}let Z={attributes:{position:new Xe({componentDatatype:J.DOUBLE,componentsPerAttribute:3,values:d})},indices:b,primitiveType:Ie.TRIANGLES};return r&&(Z.attributes.st=new Xe({componentDatatype:J.FLOAT,componentsPerAttribute:2,values:u})),new At(Z)};var f4e=new pe,p4e=new pe,b4e=new pe,D8=new pe;jy.computeRhumbLineSubdivision=function(e,t,n,i,o){o=o??W.RADIANS_PER_DEGREE;let r=l(i),s=n.slice(0),a,c=t.length,d=new Array(c*3),u=new Array(c*2),m=0,p=0;for(a=0;a0;){let E=s.pop(),A=s.pop(),L=s.pop(),F=h.fromArray(d,L*3,Tbe),I=h.fromArray(d,A*3,_be),N=h.fromArray(d,E*3,Sbe),g,V,G;r&&(g=k.fromArray(u,L*2,Zbe),V=k.fromArray(u,A*2,Rbe),G=k.fromArray(u,E*2,Cbe));let v=e.cartesianToCartographic(F,f4e),X=e.cartesianToCartographic(I,p4e),Y=e.cartesianToCartographic(N,b4e);S.setEndPoints(v,X);let D=S.surfaceDistance;Z.setEndPoints(X,Y);let M=Z.surfaceDistance;R.setEndPoints(Y,v);let O=R.surfaceDistance,w=Math.max(D,M,O),z,K,te,H,$;w>_?D===w?(z=`${Math.min(L,A)} ${Math.max(L,A)}`,a=f[z],l(a)||(K=S.interpolateUsingFraction(.5,D8),te=(v.height+X.height)*.5,H=h.fromRadians(K.longitude,K.latitude,te,e,Lb),d.push(H.x,H.y,H.z),a=d.length/3-1,f[z]=a,r&&($=k.add(g,V,D1),k.multiplyByScalar($,.5,$),u.push($.x,$.y))),s.push(L,a,E),s.push(a,A,E)):M===w?(z=`${Math.min(A,E)} ${Math.max(A,E)}`,a=f[z],l(a)||(K=Z.interpolateUsingFraction(.5,D8),te=(X.height+Y.height)*.5,H=h.fromRadians(K.longitude,K.latitude,te,e,Lb),d.push(H.x,H.y,H.z),a=d.length/3-1,f[z]=a,r&&($=k.add(V,G,D1),k.multiplyByScalar($,.5,$),u.push($.x,$.y))),s.push(A,a,L),s.push(a,E,L)):O===w&&(z=`${Math.min(E,L)} ${Math.max(E,L)}`,a=f[z],l(a)||(K=R.interpolateUsingFraction(.5,D8),te=(Y.height+v.height)*.5,H=h.fromRadians(K.longitude,K.latitude,te,e,Lb),d.push(H.x,H.y,H.z),a=d.length/3-1,f[z]=a,r&&($=k.add(G,g,D1),k.multiplyByScalar($,.5,$),u.push($.x,$.y))),s.push(E,a,A),s.push(a,L,A)):(b.push(L),b.push(A),b.push(E))}let C={attributes:{position:new Xe({componentDatatype:J.DOUBLE,componentsPerAttribute:3,values:d})},indices:b,primitiveType:Ie.TRIANGLES};return r&&(C.attributes.st=new Xe({componentDatatype:J.FLOAT,componentsPerAttribute:2,values:u})),new At(C)};jy.scaleToGeodeticHeight=function(e,t,n,i){n=n??ne.default;let o=m4e,r=h4e;if(t=t??0,i=i??!0,l(e)){let s=e.length;for(let a=0;aye;m--)Ze=W.PI_OVER_TWO-m*he,$[_e++]=1-ee*(1+Math.cos(Ze)),$[_e++]=.5*(1+Math.sin(Ze));for(m=ye;m>0;m--)Ze=W.PI_OVER_TWO-he*m,$[_e++]=1-le*(1+Math.cos(Ze)),$[_e++]=.5*(1+Math.sin(Ze));for(m=d-y;m>0;m--)$[_e++]=m*le,$[_e++]=1;for(m=1;m0;m--)$[_e++]=(m-1)*le,$[_e++]=1}c.st=new Xe({componentDatatype:J.FLOAT,componentsPerAttribute:2,values:$})}return t.normal&&(c.normal=new Xe({componentDatatype:J.FLOAT,componentsPerAttribute:3,values:E.normals})),t.tangent&&(c.tangent=new Xe({componentDatatype:J.FLOAT,componentsPerAttribute:3,values:E.tangents})),t.bitangent&&(c.bitangent=new Xe({componentDatatype:J.FLOAT,componentsPerAttribute:3,values:E.bitangents})),{attributes:c,indices:D}}function y4e(e,t){if(!t.normal&&!t.tangent&&!t.bitangent&&!t.st)return e;let n=e.position.values,i,o;(t.normal||t.bitangent)&&(i=e.normal.values,o=e.bitangent.values);let r=e.position.values.length/18,s=r*3,a=r*2,c=s*2,d;if(t.normal||t.bitangent||t.tangent){let u=t.normal?new Float32Array(s*6):void 0,m=t.tangent?new Float32Array(s*6):void 0,p=t.bitangent?new Float32Array(s*6):void 0,b=Abe,f=Gbe,y=FO,_=IO,S=g4e,Z=Lbe,R=c;for(d=0;d0){let y=Math.min(r,o);d=Math.round(o/y),c+=y}let u=Oe.createTypedArray(s,c*2),m=0,p;for(p=0;p0)for(p=0;p1;--g){if(S=W.PI_OVER_TWO-(g-1)*_,E=J1(-S,r,f,b,c,u,d,m,p,E),A=J1(S+Math.PI,r,f,b,c,u,d,m,p,A),t){for(R[C++]=E.x,R[C++]=E.y,R[C++]=E.z,G=2*(g-1)+2,V=1;V1;--s){for(t[n++]=i++,t[n++]=i,t[n++]=r,o=2*s,a=0;aW.PI&&(m.north=m.north>0?W.PI_OVER_TWO-W.EPSILON7:m.north,m.south=m.south<0?W.EPSILON7-W.PI_OVER_TWO:m.south,m.east=W.PI,m.west=-W.PI),m}function Mp(e){e=e??B.EMPTY_OBJECT;let t=e.center,n=e.ellipsoid??ne.default,i=e.semiMajorAxis,o=e.semiMinorAxis,r=e.granularity??W.RADIANS_PER_DEGREE,s=e.vertexFormat??Me.DEFAULT,a=e.height??0,c=e.extrudedHeight??a;this._center=h.clone(t),this._semiMajorAxis=i,this._semiMinorAxis=o,this._ellipsoid=ne.clone(n),this._rotation=e.rotation??0,this._stRotation=e.stRotation??0,this._height=Math.max(c,a),this._granularity=r,this._vertexFormat=Me.clone(s),this._extrudedHeight=Math.min(c,a),this._shadowVolume=e.shadowVolume??!1,this._workerName="createEllipseGeometry",this._offsetAttribute=e.offsetAttribute,this._rectangle=void 0,this._textureCoordinateRotationPoints=void 0}Mp.packedLength=h.packedLength+ne.packedLength+Me.packedLength+9;Mp.pack=function(e,t,n){return n=n??0,h.pack(e._center,t,n),n+=h.packedLength,ne.pack(e._ellipsoid,t,n),n+=ne.packedLength,Me.pack(e._vertexFormat,t,n),n+=Me.packedLength,t[n++]=e._semiMajorAxis,t[n++]=e._semiMinorAxis,t[n++]=e._rotation,t[n++]=e._stRotation,t[n++]=e._height,t[n++]=e._granularity,t[n++]=e._extrudedHeight,t[n++]=e._shadowVolume?1:0,t[n]=e._offsetAttribute??-1,t};var uge=new h,mge=new ne,hge=new Me,Yp={center:uge,ellipsoid:mge,vertexFormat:hge,semiMajorAxis:void 0,semiMinorAxis:void 0,rotation:void 0,stRotation:void 0,height:void 0,granularity:void 0,extrudedHeight:void 0,shadowVolume:void 0,offsetAttribute:void 0};Mp.unpack=function(e,t,n){t=t??0;let i=h.unpack(e,t,uge);t+=h.packedLength;let o=ne.unpack(e,t,mge);t+=ne.packedLength;let r=Me.unpack(e,t,hge);t+=Me.packedLength;let s=e[t++],a=e[t++],c=e[t++],d=e[t++],u=e[t++],m=e[t++],p=e[t++],b=e[t++]===1,f=e[t];return l(n)?(n._center=h.clone(i,n._center),n._ellipsoid=ne.clone(o,n._ellipsoid),n._vertexFormat=Me.clone(r,n._vertexFormat),n._semiMajorAxis=s,n._semiMinorAxis=a,n._rotation=c,n._stRotation=d,n._height=u,n._granularity=m,n._extrudedHeight=p,n._shadowVolume=b,n._offsetAttribute=f===-1?void 0:f,n):(Yp.height=u,Yp.extrudedHeight=p,Yp.granularity=m,Yp.stRotation=d,Yp.rotation=c,Yp.semiMajorAxis=s,Yp.semiMinorAxis=a,Yp.shadowVolume=b,Yp.offsetAttribute=f===-1?void 0:f,new Mp(Yp))};Mp.computeRectangle=function(e,t){e=e??B.EMPTY_OBJECT;let n=e.center,i=e.ellipsoid??ne.default,o=e.semiMajorAxis,r=e.semiMinorAxis,s=e.granularity??W.RADIANS_PER_DEGREE,a=e.rotation??0;return dge(n,o,r,a,s,i,t)};Mp.createGeometry=function(e){if(e._semiMajorAxis<=0||e._semiMinorAxis<=0)return;let t=e._height,n=e._extrudedHeight,i=!W.equalsEpsilon(t,n,0,W.EPSILON2);e._center=e._ellipsoid.scaleToGeodeticSurface(e._center,e._center);let o={center:e._center,semiMajorAxis:e._semiMajorAxis,semiMinorAxis:e._semiMinorAxis,ellipsoid:e._ellipsoid,rotation:e._rotation,height:t,granularity:e._granularity,vertexFormat:e._vertexFormat,stRotation:e._stRotation},r;if(i)o.extrudedHeight=n,o.shadowVolume=e._shadowVolume,o.offsetAttribute=e._offsetAttribute,r=M4e(o);else if(r=X4e(o),l(e._offsetAttribute)){let s=r.attributes.position.values.length,a=e._offsetAttribute===bn.NONE?0:1,c=new Uint8Array(s/3).fill(a);r.attributes.applyOffset=new Xe({componentDatatype:J.UNSIGNED_BYTE,componentsPerAttribute:1,values:c})}return new At({attributes:r.attributes,indices:r.indices,primitiveType:Ie.TRIANGLES,boundingSphere:r.boundingSphere,offsetAttribute:e._offsetAttribute})};Mp.createShadowVolume=function(e,t,n){let i=e._granularity,o=e._ellipsoid,r=t(i,o),s=n(i,o);return new Mp({center:e._center,semiMajorAxis:e._semiMajorAxis,semiMinorAxis:e._semiMinorAxis,ellipsoid:o,rotation:e._rotation,stRotation:e._stRotation,granularity:i,extrudedHeight:r,height:s,vertexFormat:Me.POSITION_ONLY,shadowVolume:!0})};function w4e(e){let t=-e._stRotation;if(t===0)return[0,0,0,1,1,0];let i=Pd.computeEllipsePositions({center:e._center,semiMajorAxis:e._semiMajorAxis,semiMinorAxis:e._semiMinorAxis,rotation:e._rotation,granularity:e._granularity},!1,!0).outerPositions,o=i.length/3,r=new Array(o);for(let c=0;c0){let f=Math.min(d,c);b=Math.round(c/f);let y=Math.min(b*d,c);for(p=0;p0&&(C=!0,S+=c-1),s0&&u!==y-1&&m!==0&&m!==_-1&&(N[K]=!0),K++;p=0;let te,H;for(u=1;u=We&&u0&&(f=!0,m+=d),s10&&t*2>e.length&&(this._array=e.slice(t),t=0),this._offset=t,this._length--,n};tx.prototype.peek=function(){if(this._length!==0)return this._array[this._offset]};tx.prototype.contains=function(e){return this._array.indexOf(e)!==-1};tx.prototype.clear=function(){this._array.length=this._offset=this._length=0};tx.prototype.sort=function(e){this._offset>0&&(this._array=this._array.slice(this._offset),this._offset=0),this._array.sort(e)};var nx=tx;var Fr={};Fr.computeHierarchyPackedLength=function(e,t){let n=0,i=[e];for(;i.length>0;){let o=i.pop();if(!l(o))continue;n+=2;let r=o.positions,s=o.holes;if(l(r)&&r.length>0&&(n+=r.length*t.packedLength),l(s)){let a=s.length;for(let c=0;c0;){let r=o.pop();if(!l(r))continue;let s=r.positions,a=r.holes;if(t[n++]=l(s)?s.length:0,t[n++]=l(a)?a.length:0,l(s)){let c=s.length;for(let d=0;d0?new Array(o):void 0;for(let a=0;aW.PI){let c=s;s=a,a=c}if(!(r.longitudea))return n.cartographicToCartesian(r)}function SQe(e,t,n,i){if(i===un.RHUMB)return _Qe(e,t,n);let o=xi.lineSegmentPlane(e,t,cn.ORIGIN_XY_PLANE);if(l(o))return n.scaleToGeodeticSurface(o,o)}var ZQe=new pe;function RQe(e,t,n){let i=[],o,r,s,a,c,d=0;for(;dt.cartesianToCartographic(m,ZQe).longitude;if(s===0)i.push({position:d,type:s,visited:!1,next:a,theta:u(o)});else if(a!==0){if(c=SQe(o,r,t,n),++d,!l(c))continue;e.splice(d,0,c),i.push({position:d,type:s,visited:!1,next:a,theta:u(c)})}++d}return i}function Yge(e,t,n,i,o,r,s){let a=[],c=r,d=m=>p=>p.position===m,u=[];do{let m=n[c];a.push(m);let p=i.findIndex(d(c)),b=i[p];if(!l(b)){++c;continue}let{visited:f,type:y,next:_}=b;if(b.visited=!0,y===0){if(_===0){let C=i[p-(s?1:-1)];if(C?.position===c+1)C.visited=!0;else{++c;continue}}if(!f&&s&&_>0||r===c&&!s&&_<0){++c;continue}}if(!(s?y>=0:y<=0)){++c;continue}f||u.push(c);let Z=p+(s?1:-1),R=i[Z];if(!l(R)){++c;continue}c=R.position}while(c=0&&c!==r&&a.lengthd.theta-u.theta);let c=s[0].z>=0;o=Yge(i,o,s,a,1,0,c)}return i};Fr.polygonsFromHierarchy=function(e,t,n,i,o,r){let s=[],a=[],c=new nx;c.enqueue(e);let d=l(r);for(;c.length!==0;){let u=c.dequeue(),m=u.positions,p=u.holes,b,f;if(i)for(f=m.length,b=0;b1){for(let L of A)c.enqueue(new Wc(L,p));continue}}let Z=m.slice(),R=l(p)?p.length:0,C=[],E;for(b=0;bMath.PI&&(e-=W.TWO_PI),e}}});var iC=new pe,JQe=new h;Ts.prototype.getLatitude=function(e){l(e)||(e=ne.default),iC.latitude=this.conformalLatitude,iC.longitude=this.longitude,iC.height=0;let t=this.ellipsoid.cartographicToCartesian(iC,JQe);return e.cartesianToCartographic(t,iC),iC.latitude};var jQe=new gn,QQe=new h,qQe=new h;Ts.fromCartesian=function(e,t){let n=W.signNotZero(e.z),i=Ts.NORTH_POLE_TANGENT_PLANE,o=Ts.SOUTH_POLE;n<0&&(i=Ts.SOUTH_POLE_TANGENT_PLANE,o=Ts.NORTH_POLE);let r=jQe;r.origin=i.ellipsoid.scaleToGeocentricSurface(e,r.origin),r.direction=h.subtract(r.origin,o,QQe),h.normalize(r.direction,r.direction);let s=xi.rayPlane(r,i.plane,qQe),a=h.subtract(s,o,s),c=h.dot(i.xAxis,a),d=n*h.dot(i.yAxis,a);return l(t)?(t.position=new k(c,d),t.tangentPlane=i,t):new Ts(new k(c,d),i)};Ts.fromCartesianArray=function(e,t){let n=e.length;l(t)?t.length=n:t=new Array(n);for(let i=0;i=0?s:s+W.TWO_PI;o.westOverIdl=Math.min(o.westOverIdl,a),o.eastOverIdl=Math.max(o.eastOverIdl,a),r.west=Math.min(r.west,s),r.east=Math.max(r.east,s);let c=e.getLatitude(n),d=c;if(r.south=Math.min(r.south,c),r.north=Math.max(r.north,c),i!==un.RHUMB){let p=k.subtract(t.position,e.position,b8e),b=k.dot(t.position,p)/k.dot(p,p);if(b>0&&b<1){let f=k.add(t.position,k.multiplyByScalar(p,-b,p),g8e),y=il.clone(t,y8e);y.position=f;let _=y.getLatitude(n);r.south=Math.min(r.south,_),r.north=Math.max(r.north,_),Math.abs(c)>Math.abs(_)&&(d=_)}}let u=t.x*e.y-e.x*t.y,m=Math.sign(u);m!==0&&(m*=k.angleBetween(t.position,e.position)),d>=0&&(o.northAngle+=m),d<=0&&(o.southAngle+=m)}var Bge=new il,x8e=new il,Mm={northAngle:0,southAngle:0,westOverIdl:0,eastOverIdl:0};wm.computeRectangleFromPositions=function(e,t,n,i){if(l(i)||(i=new re),e.length<3)return i;i.west=Number.POSITIVE_INFINITY,i.east=Number.NEGATIVE_INFINITY,i.south=Number.POSITIVE_INFINITY,i.north=Number.NEGATIVE_INFINITY,Mm.northAngle=0,Mm.southAngle=0,Mm.westOverIdl=Number.POSITIVE_INFINITY,Mm.eastOverIdl=Number.NEGATIVE_INFINITY;let o=e.length,r=il.fromCartesian(e[0],x8e);for(let s=1;sMm.eastOverIdl-Mm.westOverIdl&&(i.west=Mm.westOverIdl,i.east=Mm.eastOverIdl,i.east>W.PI&&(i.east=i.east-W.TWO_PI),i.west>W.PI&&(i.west=i.west-W.TWO_PI)),W.equalsEpsilon(Math.abs(Mm.northAngle),W.TWO_PI,W.EPSILON10)&&(i.north=W.PI_OVER_TWO,i.east=W.PI,i.west=-W.PI),W.equalsEpsilon(Math.abs(Mm.southAngle),W.TWO_PI,W.EPSILON10)&&(i.south=-W.PI_OVER_TWO,i.east=W.PI,i.west=-W.PI),i};var T8e=new il;function _8e(e,t,n){return e.height>=W.PI||e.width>=W.PI?il.fromCartesian(t[0],T8e).tangentPlane:ws.fromPoints(t,n)}var zge=new pe;function S8e(e,t,n){return(i,o)=>{if(e.height>=W.PI||e.width>=W.PI){if(e.south<0&&e.north>0){l(o)||(o=[]);for(let s=0;s=W.PI||e.width>=W.PI)return(o,r)=>{if(e.south<0&&e.north>0){let s=n.cartesianToCartographic(o,zge);return l(r)||(r=new k),r.x=s.longitude/W.PI,r.y=s.latitude/W.PI_OVER_TWO,r}return il.fromCartesian(o,r)};let i=ws.fromPoints(t,n);return(o,r)=>i.projectPointsOntoPlane(o,r)}function R8e(e,t,n,i){return(o,r)=>!i&&(e.height>=W.PI_OVER_TWO||e.width>=2*W.PI_OVER_THREE)?oi.splitPolygonsOnEquator(o,t,n,r):o}function C8e(e,t,n,i){if(t.height>=W.PI||t.width>=W.PI)return nt.fromRectangle(t,void 0,kge);let o=e,r=ws.fromPoints(o,n);return oi.computeBoundingRectangle(r.plane.normal,r.projectPointOntoPlane.bind(r),o,i,kge)}wm.createGeometry=function(e){let t=e._vertexFormat,n=e._ellipsoid,i=e._granularity,o=e._stRotation,r=e._polygonHierarchy,s=e._perPositionHeight,a=e._closeTop,c=e._closeBottom,d=e._arcType,u=e._textureCoordinates,m=l(u),p=r.positions;if(p.length<3)return;let b=e.rectangle,f=oi.polygonsFromHierarchy(r,m,S8e(b,p,n),!s,n,R8e(b,n,d,s)),y=f.hierarchy,_=f.polygons,S=function(v){return v},Z=m?oi.polygonsFromHierarchy(u,!0,S,!1,n).polygons:void 0;if(y.length===0)return;let R=y[0].outerRing,C=C8e(R,b,n,o),E=[],A=e._height,L=e._extrudedHeight,F=e._perPositionHeightExtrude||!W.equalsEpsilon(A,L,0,W.EPSILON2),I={perPositionHeight:s,vertexFormat:t,geometry:void 0,rotationAxis:_8e(b,R,n).plane.normal,projectTo2d:Z8e(b,R,n),boundingRectangle:C,ellipsoid:n,stRotation:o,textureCoordinates:void 0,bottom:!1,top:!0,wall:!1,extrude:!1,arcType:d},N;if(F)for(I.extrude=!0,I.top=a,I.bottom=c,I.shadowVolume=e._shadowVolume,I.offsetAttribute=e._offsetAttribute,N=0;N<_.length;N++){let v=m8e(n,_[N],m?Z[N]:void 0,i,y[N],s,a,c,t,d),X;a&&c?(X=v.topAndBottom,I.geometry=oi.scaleToGeodeticHeightExtruded(X.geometry,A,L,n,s)):a?(X=v.topAndBottom,X.geometry.attributes.position.values=hi.scaleToGeodeticHeight(X.geometry.attributes.position.values,A,n,!s),I.geometry=X.geometry):c&&(X=v.topAndBottom,X.geometry.attributes.position.values=hi.scaleToGeodeticHeight(X.geometry.attributes.position.values,L,n,!0),I.geometry=X.geometry),(a||c)&&(I.wall=!1,X.geometry=o6(I),E.push(X));let Y=v.walls;I.wall=!0;for(let D=0;Da?b=W.TWO_PI-c+a:b=a-c;let y=Math.ceil(b/t)+1,_=Math.ceil(f/t)+1,S=b/(y-1),Z=f/(_-1),R=re.northwest(e,r),C=re.center(e,k8e);(n!==0||i!==0)&&(C.longitude1||E>1))for(let V=0;V0;u-=d)ye=u*3,z=aC(z,ee,ye,p,_),ee+=6,o.st&&(H=cC(H,le,u*2,E),le+=4),n&&(_e+=3,K[_e++]=A[ye],K[_e++]=A[ye+1],K[_e++]=A[ye+2]),$&&(te[he++]=1,he+=1);if(G){let We=Ze;for(ye=We*3,u=0;u<2;u++)z=aC(z,ee,ye,p,_),ee+=6,o.st&&(H=cC(H,le,We*2,E),le+=4),n&&(_e+=3,K[_e++]=A[ye],K[_e++]=A[ye+1],K[_e++]=A[ye+2]),$&&(te[he++]=1,he+=1)}else for(u=d-1;u>=0;u--)ye=u*3,z=aC(z,ee,ye,p,_),ee+=6,o.st&&(H=cC(H,le,u*2,E),le+=4),n&&(_e+=3,K[_e++]=A[ye],K[_e++]=A[ye+1],K[_e++]=A[ye+2]),$&&(te[he++]=1,he+=1);let Ge=z8e(z,o,a);o.st&&(Ge.attributes.st=new Xe({componentDatatype:J.FLOAT,componentsPerAttribute:2,values:H})),n&&(Ge.attributes.extrudeDirection=new Xe({componentDatatype:J.FLOAT,componentsPerAttribute:3,values:K})),F&&(Ge.attributes.applyOffset=new Xe({componentDatatype:J.UNSIGNED_BYTE,componentsPerAttribute:1,values:te}));let Ae=Oe.createTypedArray(w,D*6),Fe,tt,Be,je;b=z.length/3;let qe=0;for(u=0;u=0;f--)ga.computePosition(t,n,!1,b,f,y),m[p++]=y.x,m[p++]=y.y,m[p++]=y.z;for(f=0,b=i-2;b>0;b--)ga.computePosition(t,n,!1,b,f,y),m[p++]=y.x,m[p++]=y.y,m[p++]=y.z;let _=m.length/3*2,S=Oe.createTypedArray(m.length/3,_),Z=0;for(let C=0;C0)for(s=new Array(o),i=0;i0)for(a=new Array(o),i=0;i0)for(s=new Array(o),i=0;i0)for(a=new Array(o),i=0;i{i.raiseEvent(a)}),n[r]=s}this.updaters=n,this.geometryChanged=i,this.eventHelper=o,this._removeEntitySubscription=e.definitionChanged.addEventListener(uS.prototype._onEntityPropertyChanged,this)}uS.prototype._onEntityPropertyChanged=function(e,t,n,i){let o=this.updaters;for(let r=0;r0){l(i)&&(l(this.oldPrimitive)?o.remove(i):this.oldPrimitive=i);let c;if(l(this.depthFailAppearanceType)){l(this.depthFailMaterialProperty)&&(this.depthFailMaterial=xr.getValue(e,this.depthFailMaterialProperty,this.depthFailMaterial));let u=this.depthFailAppearanceType;c=new u({material:this.depthFailMaterial,translucent:this.translucent,closed:this.closed})}let d=this.appearanceType;i=new In({show:!1,asynchronous:!0,geometryInstances:s.slice(),appearance:new d({translucent:this.translucent,closed:this.closed}),depthFailAppearance:c,shadows:this.shadows}),o.add(i),t=!1}else{l(i)&&(o.remove(i),i=void 0);let c=this.oldPrimitive;l(c)&&(o.remove(c),this.oldPrimitive=void 0)}this.attributes.removeAll(),this.primitive=i,this.createPrimitive=!1,this.waitingOnCreate=!0}else if(l(i)&&i.ready){i.show=!0,l(this.oldPrimitive)&&(o.remove(this.oldPrimitive),this.oldPrimitive=void 0),l(this.depthFailAppearanceType)&&!(this.depthFailMaterialProperty instanceof Qt)&&(this.depthFailMaterial=xr.getValue(e,this.depthFailMaterialProperty,this.depthFailMaterial),this.primitive.depthFailAppearance.material=this.depthFailMaterial);let s=this.updatersWithAttributes.values,a=s.length,c=this.waitingOnCreate;for(r=0;r=0;i--){let o=e[i];if(o.remove(t))return o.updaters.length===0&&(e.splice(i,1),o.destroy()),!0}return!1}hC.prototype.remove=function(e){Pye(this._solidItems,e)||Pye(this._translucentItems,e)};function Xye(e,t,n){let i=!1,o=t.length;for(let r=0;r0)for(r=0;r=0;r--){let s=t[r];if(s.invalidated){t.splice(r,1);let a=s.updaters.values,c=a.length;for(let d=0;d0){l(n)&&(l(this.oldPrimitive)?i.remove(n):this.oldPrimitive=n),this.material=xr.getValue(e,this.materialProperty,this.material);let a;if(l(this.depthFailMaterialProperty)){this.depthFailMaterial=xr.getValue(e,this.depthFailMaterialProperty,this.depthFailMaterial);let d=this.depthFailAppearanceType;a=new d({material:this.depthFailMaterial,translucent:this.depthFailMaterial.isTranslucent(),closed:this.closed})}let c=this.appearanceType;n=new In({show:!1,asynchronous:!0,geometryInstances:o.slice(),appearance:new c({material:this.material,translucent:this.material.isTranslucent(),closed:this.closed}),depthFailAppearance:a,shadows:this.shadows}),i.add(n),t=!1}else{l(n)&&(i.remove(n),n=void 0);let a=this.oldPrimitive;l(a)&&(i.remove(a),this.oldPrimitive=void 0)}this.attributes.removeAll(),this.primitive=n,this.createPrimitive=!1}else if(l(n)&&n.ready){n.show=!0,l(this.oldPrimitive)&&(i.remove(this.oldPrimitive),this.oldPrimitive=void 0),this.material=xr.getValue(e,this.materialProperty,this.material),this.primitive.appearance.material=this.material,l(this.depthFailAppearanceType)&&!(this.depthFailMaterialProperty instanceof Qt)&&(this.depthFailMaterial=xr.getValue(e,this.depthFailMaterialProperty,this.depthFailMaterial),this.primitive.depthFailAppearance.material=this.depthFailMaterial);let s=this.updatersWithAttributes.values,a=s.length;for(r=0;r=0;i--){let o=t[i];if(o.remove(e)){o.updaters.length===0&&(t.splice(i,1),o.destroy());break}}};fC.prototype.update=function(e){let t,n=this._items,i=n.length;for(t=i-1;t>=0;t--){let r=n[t];if(r.invalidated){n.splice(t,1);let s=r.updaters.values,a=s.length;for(let c=0;cn;){if(i-n>600){let c=i-n+1,d=t-n+1,u=Math.log(c),m=.5*Math.exp(2*u/3),p=.5*Math.sqrt(u*m*(c-m)/c)*(d-c/2<0?-1:1),b=Math.max(n,Math.floor(t-d*m/c+p)),f=Math.min(i,Math.floor(t+(c-d)*m/c+p));eB(e,t,b,f,o)}let r=e[t],s=n,a=i;for(CI(e,n,t),o(e[i],r)>0&&CI(e,n,i);s0;)a--}o(e[n],r)===0?CI(e,n,a):(a++,CI(e,a,i)),a<=t&&(n=a+1),t<=a&&(i=a-1)}}function CI(e,t,n){let i=e[t];e[t]=e[n],e[n]=i}function v6e(e,t){return et?1:0}var AI=class{constructor(t=9){this._maxEntries=Math.max(4,t),this._minEntries=Math.max(2,Math.ceil(this._maxEntries*.4)),this.clear()}all(){return this._all(this.data,[])}search(t){let n=this.data,i=[];if(!nB(t,n))return i;let o=this.toBBox,r=[];for(;n;){for(let s=0;s=0&&r[n].children.length>this._maxEntries;)this._split(r,n),n--;this._adjustParentBBoxes(o,r,n)}_split(t,n){let i=t[n],o=i.children.length,r=this._minEntries;this._chooseSplitAxis(i,r,o);let s=this._chooseSplitIndex(i,r,o),a=bC(i.children.splice(s,i.children.length-s));a.height=i.height,a.leaf=i.leaf,pC(i,this.toBBox),pC(a,this.toBBox),n?t[n-1].children.push(a):this._splitRoot(i,a)}_splitRoot(t,n){this.data=bC([t,n]),this.data.height=t.height+1,this.data.leaf=!1,pC(this.data,this.toBBox)}_chooseSplitIndex(t,n,i){let o,r=1/0,s=1/0;for(let a=n;a<=i-n;a++){let c=VI(t,0,a,this.toBBox),d=VI(t,a,i,this.toBBox),u=N6e(c,d),m=u6(c)+u6(d);u=n;d--){let u=t.children[d];EI(a,t.leaf?r(u):u),c+=tB(a)}return c}_adjustParentBBoxes(t,n,i){for(let o=i;o>=0;o--)EI(n[o],t)}_condense(t){for(let n=t.length-1,i;n>=0;n--)t[n].children.length===0?n>0?(i=t[n-1].children,i.splice(i.indexOf(t[n]),1)):this.clear():pC(t[n],this.toBBox)}};function F6e(e,t,n){if(!n)return t.indexOf(e);for(let i=0;i=e.minX&&t.maxY>=e.minY}function bC(e){return{children:e,height:1,leaf:!0,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0}}function Mye(e,t,n,i,o){let r=[t,n];for(;r.length;){if(n=r.pop(),t=r.pop(),n-t<=i)continue;let s=t+Math.ceil((n-t)/i/2)*i;eB(e,s,t,n,o),r.push(t,s,s,n)}}function iB(){this._tree=new AI}function hS(){this.minX=0,this.minY=0,this.maxX=0,this.maxY=0,this.id=""}hS.fromRectangleAndId=function(e,t,n){return n.minX=t.west,n.minY=t.south,n.maxX=t.east,n.maxY=t.north,n.id=e,n};iB.prototype.insert=function(e,t){let n=hS.fromRectangleAndId(e,t,new hS);this._tree.insert(n)};function Y6e(e,t){return e.id===t.id}var M6e=new hS;iB.prototype.remove=function(e,t){let n=hS.fromRectangleAndId(e,t,M6e);this._tree.remove(n,Y6e)};var w6e=new hS;iB.prototype.collides=function(e){let t=hS.fromRectangleAndId("",e,w6e);return this._tree.collides(t)};var fS=iB;var k6e=new U,U6e=new Bt,D6e=new Bt;function Yb(e,t,n,i){this.primitives=e,this.zIndex=i,this.classificationType=t,this.color=n,this.createPrimitive=!1,this.waitingOnCreate=!1,this.primitive=void 0,this.oldPrimitive=void 0,this.geometry=new kt,this.updaters=new kt,this.updatersWithAttributes=new kt,this.attributes=new kt,this.subscriptions=new kt,this.showsUpdated=new kt,this.itemsToRemove=[],this.isDirty=!1,this.rectangleCollisionCheck=new fS}Yb.prototype.overlapping=function(e){return this.rectangleCollisionCheck.collides(e)};Yb.prototype.add=function(e,t){let n=e.id;if(this.createPrimitive=!0,this.geometry.set(n,t),this.updaters.set(n,e),this.rectangleCollisionCheck.insert(n,t.geometry.rectangle),!e.hasConstantFill||!e.fillMaterialProperty.isConstant||!j.isConstant(e.distanceDisplayConditionProperty))this.updatersWithAttributes.set(n,e);else{let i=this;this.subscriptions.set(n,e.entity.definitionChanged.addEventListener(function(o,r,s,a){r==="isShowing"&&i.showsUpdated.set(e.id,e)}))}};Yb.prototype.remove=function(e){let t=e.id,n=this.geometry.get(t);if(this.createPrimitive=this.geometry.remove(t)||this.createPrimitive,this.updaters.remove(t)){this.rectangleCollisionCheck.remove(t,n.geometry.rectangle),this.updatersWithAttributes.remove(t);let i=this.subscriptions.get(t);return l(i)&&(i(),this.subscriptions.remove(t),this.showsUpdated.remove(t)),!0}return!1};Yb.prototype.update=function(e){let t=!0,n=0,i=this.primitive,o=this.primitives,r;if(this.createPrimitive){let s=this.geometry.values;if(s.length>0)l(i)&&(l(this.oldPrimitive)?o.remove(i):this.oldPrimitive=i),i=new Bl({show:!1,asynchronous:!0,geometryInstances:s.slice(),classificationType:this.classificationType}),o.add(i,this.zIndex),t=!1;else{l(i)&&(o.remove(i),i=void 0);let c=this.oldPrimitive;l(c)&&(o.remove(c),this.oldPrimitive=void 0)}this.attributes.removeAll(),this.primitive=i,this.createPrimitive=!1,this.waitingOnCreate=!0}else if(l(i)&&i.ready){i.show=!0,l(this.oldPrimitive)&&(o.remove(this.oldPrimitive),this.oldPrimitive=void 0);let s=this.updatersWithAttributes.values,a=s.length,c=this.waitingOnCreate;for(r=0;r=0;--t){let s=o[t];s.isDirty&&(i=o[t].update(e)&&i,s.isDirty=!1),s.geometry.length===0&&o.splice(t,1)}return i};gC.prototype.getBoundingSphere=function(e,t){let n=this._batches,i=n.length;for(let o=0;o0){l(n)&&(l(this.oldPrimitive)?i.remove(n):this.oldPrimitive=n),this.material=xr.getValue(e,this.materialProperty,this.material);let a=this.appearanceType;n=new Bl({show:!1,asynchronous:!0,geometryInstances:o.slice(),appearance:new a({material:this.material}),classificationType:this.classificationType}),i.add(n,this.zIndex),t=!1}else{l(n)&&(i.remove(n),n=void 0);let a=this.oldPrimitive;l(a)&&(i.remove(a),this.oldPrimitive=void 0)}this.attributes.removeAll(),this.primitive=n,this.createPrimitive=!1}else if(l(n)&&n.ready){n.show=!0,l(this.oldPrimitive)&&(i.remove(this.oldPrimitive),this.oldPrimitive=void 0),this.material=xr.getValue(e,this.materialProperty,this.material),this.primitive.appearance.material=this.material;let s=this.updatersWithAttributes.values,a=s.length;for(r=0;r=0&&!t[i].remove(e);i--);};xC.prototype.update=function(e){let t,n=this._items,i=n.length;for(t=i-1;t>=0;t--){let r=n[t];r.updaters.length===0&&(n.splice(t,1),r.destroy())}let o=!0;for(t=0;t0)l(i)&&(l(this.oldPrimitive)?o.remove(i):this.oldPrimitive=i),i=new In({show:!1,asynchronous:!0,geometryInstances:s.slice(),appearance:new Tn({flat:!0,translucent:this.translucent,renderState:{lineWidth:this.width}}),shadows:this.shadows}),o.add(i),t=!1;else{l(i)&&(o.remove(i),i=void 0);let c=this.oldPrimitive;l(c)&&(o.remove(c),this.oldPrimitive=void 0)}this.attributes.removeAll(),this.primitive=i,this.createPrimitive=!1,this.waitingOnCreate=!0}else if(l(i)&&i.ready){i.show=!0,l(this.oldPrimitive)&&(o.remove(this.oldPrimitive),this.oldPrimitive=void 0);let s=this.updatersWithAttributes.values,a=s.length,c=this.waitingOnCreate;for(r=0;r0)for(m=!0,t=0;t0)for(m=!0,t=0;t-1;a--)c=s[a],d=c.id,u=this._updaterSets.get(d),u.entity===c?u.forEach(function(y){m._removeUpdater(y),m._insertUpdaterIntoBatch(e,y)}):(o.push(c),n.push(c));for(a=o.length-1;a>-1;a--)c=o[a],d=c.id,u=this._updaterSets.get(d),u.forEach(this._removeUpdater.bind(this)),u.destroy(),this._updaterSets.remove(d),this._subscriptions.get(d)(),this._subscriptions.remove(d);for(a=n.length-1;a>-1;a--)c=n[a],d=c.id,u=new mS(c,this._scene),this._updaterSets.set(d,u),u.forEach(function(y){m._insertUpdaterIntoBatch(e,y)}),this._subscriptions.set(d,u.geometryChanged.addEventListener(Xd._onGeometryChanged,this));t.removeAll(),i.removeAll(),r.removeAll();let p=!0,b=this._batches,f=b.length;for(a=0;a-1;s--)c=n[s],a=c.id,i.remove(a)||(o.set(a,c),r.remove(a));for(s=t.length-1;s>-1;s--)c=t[s],a=c.id,o.remove(a)?r.set(a,c):i.set(a,c)};var LI=Xd;var r3n=x(T(),1);var e7e=1,t7e="30px sans-serif",n7e=yr.FILL,i7e=U.WHITE,o7e=U.BLACK,r7e=1,s7e=!1,a7e=new U(.165,.165,.165,.8),c7e=new k(7,5),l7e=k.ZERO,d7e=h.ZERO,u7e=He.NONE,m7e=Di.CENTER,h7e=zn.CENTER,f7e=new h,p7e=new U,b7e=new U,g7e=new U,y7e=new k,x7e=new h,T7e=new k,_7e=new Kt,S7e=new Kt,Z7e=new Kt,R7e=new Bt;function wye(e){this.entity=e,this.label=void 0,this.index=void 0}function rx(e,t){t.collectionChanged.addEventListener(rx.prototype._onCollectionChanged,this),this._cluster=e,this._entityCollection=t,this._items=new kt,this._onCollectionChanged(t,t.values,[],[])}rx.prototype.update=function(e){let t=this._items.values,n=this._cluster;for(let i=0,o=t.length;ir.get(e.id)===n);if(s===void 0)return Wt.PENDING;s===null?t.center=h.clone(i.position,t.center):t.center=xb(i.position,s,i.heightReference,o.ellipsoid??ne.default,t.center)}return t.radius=0,Wt.DONE};rx.prototype.isDestroyed=function(){return!1};rx.prototype.destroy=function(){this._entityCollection.collectionChanged.removeEventListener(rx.prototype._onCollectionChanged,this);let e=this._entityCollection.values;for(let t=0;t-1;o--)r=t[o],l(r._label)&&l(r._position)&&s.set(r.id,new wye(r));for(o=i.length-1;o>-1;o--)r=i[o],l(r._label)&&l(r._position)?s.contains(r.id)||s.set(r.id,new wye(r)):(h6(s.get(r.id),r,a),s.remove(r.id));for(o=n.length-1;o>-1;o--)r=n[o],h6(s.get(r.id),r,a),s.remove(r.id)};function h6(e,t,n){l(e)&&(e.label=void 0,n.removeLabel(t))}var WI=rx;var RVi=x(T(),1);var c3n=x(T(),1);var SC={HIGHLIGHT:0,REPLACE:1,MIX:2};SC.getColorBlend=function(e,t){if(e===SC.HIGHLIGHT)return 0;if(e===SC.REPLACE)return 1;if(e===SC.MIX)return W.clamp(t,W.EPSILON4,1)};Object.freeze(SC);var ol=SC;var nVi=x(T(),1);var f3n=x(T(),1);var d3n=x(T(),1);/*! @license DOMPurify 3.4.14 | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/3.4.14/LICENSE */function kye(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,i=Array(t);n2?i-2:0),r=2;r1?n-1:0),o=1;o"u"?null:ya(BigInt.prototype.toString),Hye=typeof Symbol>"u"?null:ya(Symbol.prototype.toString),Nd=ya(Object.prototype.hasOwnProperty),II=ya(Object.prototype.toString),rl=ya(RegExp.prototype.test),pS=Y7e(TypeError);function ya(e){return function(t){t instanceof RegExp&&(t.lastIndex=0);for(var n=arguments.length,i=new Array(n>1?n-1:0),o=1;o2&&arguments[2]!==void 0?arguments[2]:PI;if(Uye&&Uye(e,null),!RC(t))return e;let i=t.length;for(;i--;){let o=t[i];if(typeof o=="string"){let r=n(o);r!==o&&(L7e(t)||(t[i]=r),o=r)}e[o]=!0}return e}function M7e(e){for(let t=0;t/g),z7e=dc(/\${[\w\W]*/g),H7e=dc(/^data-[\-\w.\u00B7-\uFFFF]+$/),K7e=dc(/^aria-[\-\w]+$/),qye=dc(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),J7e=dc(/^(?:\w+script|data):/i),j7e=dc(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),Q7e=dc(/^html$/i),q7e=dc(/^[a-z][.\w]*(-[.\w]+)+$/i),$ye=dc(/<[/\w!]/g),exe=dc(/<[/\w]/g),$7e=dc(/<\/no(script|embed|frames)/i),eqe=dc(/\/>/i),Iu={element:1,attribute:2,text:3,cdataSection:4,entityReference:5,entityNode:6,processingInstruction:7,comment:8,document:9,documentType:10,documentFragment:11,notation:12},oxe=["style","script","xmp","iframe","noembed","noframes","plaintext","noscript"],tqe=wa(Lo({},oxe)),nqe=(function(){let e={};return bS(oxe,t=>{e[t]=dc(new RegExp("])","i"))}),wa(e)})(),iqe=function(){return typeof window>"u"?null:window},oqe=function(t,n){if(typeof t!="object"||typeof t.createPolicy!="function")return null;let i=null,o="data-tt-policy-suffix";n&&n.hasAttribute(o)&&(i=n.getAttribute(o));let r="dompurify"+(i?"#"+i:"");try{return t.createPolicy(r,{createHTML(s){return s},createScriptURL(s){return s}})}catch{return console.warn("TrustedTypes policy "+r+" could not be created."),null}},txe=function(){return{afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}},sx=function(t,n,i,o){return Nd(t,n)&&RC(t[n])?Lo(o.base?Pu(o.base):{},t[n],o.transform):i},x6=function(t,n,i){let o=Nd(t,n)?t[n]:void 0;return o&&typeof o=="object"?Pu(o):i()};function rxe(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:iqe(),t=Vt=>rxe(Vt);if(t.version="3.4.14",t.removed=[],!e||!e.document||e.document.nodeType!==Iu.document||!e.Element)return t.isSupported=!1,t;let n=e.document,i=n,o=i.currentScript;e.DocumentFragment;let r=e.HTMLTemplateElement,s=e.Node,a=e.Element,c=e.NodeFilter,d=e.NamedNodeMap;d===void 0&&(e.NamedNodeMap||e.MozNamedAttrMap),e.HTMLFormElement;let u=e.DOMParser,m=e.trustedTypes,p=a.prototype,b=mf(p,"cloneNode"),f=mf(p,"remove"),y=mf(p,"nextSibling"),_=mf(p,"childNodes"),S=mf(p,"parentNode"),Z=mf(p,"shadowRoot"),R=mf(p,"attributes"),C=s&&s.prototype?mf(s.prototype,"nodeType"):null,E=s&&s.prototype?mf(s.prototype,"nodeName"):null,A=s&&s.prototype?mf(s.prototype,"ownerDocument"):null,L=function(Te){return C?C(Te):Te.nodeType},F=function(Te){return E?E(Te):Te.nodeName};if(typeof r=="function"){let Vt=n.createElement("template");Vt.content&&Vt.content.ownerDocument&&(n=Vt.content.ownerDocument)}let I,N="",g,V=!1,G=0,v=function(){if(G>0)throw pS('A configured TRUSTED_TYPES_POLICY callback (createHTML or createScriptURL) must not call DOMPurify.sanitize, as that causes infinite recursion. Do not pass a policy whose callbacks wrap DOMPurify as TRUSTED_TYPES_POLICY; see the "DOMPurify and Trusted Types" section of the README.')},X=function(Te){v(),G++;try{return I.createHTML(Te)}finally{G--}},Y=function(Te){v(),G++;try{return I.createScriptURL(Te)}finally{G--}},D=function(){return V||(g=oqe(m,o),V=!0),g},M=n,O=M.implementation,w=M.createNodeIterator,z=M.createDocumentFragment,K=M.getElementsByTagName,te=i.importNode,H=txe();t.isSupported=typeof nxe=="function"&&typeof S=="function"&&O&&O.createHTMLDocument!==void 0;let $=O7e,ee=B7e,le=z7e,_e=H7e,he=K7e,Ze=J7e,ye=j7e,Ge=q7e,Ae=qye,Fe=null,tt=Lo({},[...Kye,...p6,...b6,...g6,...Jye]),Be=null,je=Lo({},[...jye,...y6,...Qye,...oB]),qe=Object.seal(ZC(null,{tagNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},allowCustomizedBuiltInElements:{writable:!0,configurable:!1,enumerable:!0,value:!1}})),We=null,Ke=null,ct=Object.seal(ZC(null,{tagCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeCheck:{writable:!0,configurable:!1,enumerable:!0,value:null}})),Et=!0,zt=!0,ut=!1,bt=!0,ht=!1,jt=!0,st=!1,pt=!1,Mi=null,jn=null,Si=!1,Hi=!1,Gi=!1,pi=!1,Zi=!0,On=!1,rn="user-content-",Hn=!0,$i=!1,Po={},hr=null,Is=Lo({},["annotation-xml","audio","colgroup","desc","foreignobject","head","iframe","math","mi","mn","mo","ms","mtext","noembed","noframes","noscript","plaintext","script","selectedcontent","style","svg","template","thead","title","video","xmp"]),Hs=null,or=Lo({},["audio","video","img","source","image","track"]),yi=null,fr=Lo({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),mo="http://www.w3.org/1998/Math/MathML",Qr="http://www.w3.org/2000/svg",Mn="http://www.w3.org/1999/xhtml",Ki=Mn,wi=!1,Xo=null,Dc=Lo({},[mo,Qr,Mn],f6),pm=wa(["mi","mo","mn","ms","mtext"]),bp=Lo({},pm),Lh=wa(["annotation-xml"]),ua=Lo({},Lh),gp=Lo({},["title","style","font","a","script"]),Ps=null,$a=["application/xhtml+xml","text/html"],BT="text/html",si=null,qo=null,Gl=n.createElement("form"),K0=function(Te){return Te instanceof RegExp||Te instanceof Function},va=function(){let Te=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(qo&&qo===Te)return;(!Te||typeof Te!="object")&&(Te={}),Te=Pu(Te),Ps=$a.indexOf(Te.PARSER_MEDIA_TYPE)===-1?BT:Te.PARSER_MEDIA_TYPE,si=Ps==="application/xhtml+xml"?f6:PI,Fe=sx(Te,"ALLOWED_TAGS",tt,{transform:si}),Be=sx(Te,"ALLOWED_ATTR",je,{transform:si}),Xo=sx(Te,"ALLOWED_NAMESPACES",Dc,{transform:f6}),yi=sx(Te,"ADD_URI_SAFE_ATTR",fr,{transform:si,base:fr}),Hs=sx(Te,"ADD_DATA_URI_TAGS",or,{transform:si,base:or}),hr=sx(Te,"FORBID_CONTENTS",Is,{transform:si}),We=sx(Te,"FORBID_TAGS",Pu({}),{transform:si}),Ke=sx(Te,"FORBID_ATTR",Pu({}),{transform:si}),Po=Nd(Te,"USE_PROFILES")?Te.USE_PROFILES&&typeof Te.USE_PROFILES=="object"?Pu(Te.USE_PROFILES):Te.USE_PROFILES:!1,Et=Te.ALLOW_ARIA_ATTR!==!1,zt=Te.ALLOW_DATA_ATTR!==!1,ut=Te.ALLOW_UNKNOWN_PROTOCOLS||!1,bt=Te.ALLOW_SELF_CLOSE_IN_ATTR!==!1,ht=Te.SAFE_FOR_TEMPLATES||!1,jt=Te.SAFE_FOR_XML!==!1,st=Te.WHOLE_DOCUMENT||!1,Hi=Te.RETURN_DOM||!1,Gi=Te.RETURN_DOM_FRAGMENT||!1,pi=Te.RETURN_TRUSTED_TYPE||!1,Si=Te.FORCE_BODY||!1,Zi=Te.SANITIZE_DOM!==!1,On=Te.SANITIZE_NAMED_PROPS||!1,Hn=Te.KEEP_CONTENT!==!1,$i=Te.IN_PLACE||!1,Ae=k7e(Te.ALLOWED_URI_REGEXP)?Te.ALLOWED_URI_REGEXP:qye,Ki=typeof Te.NAMESPACE=="string"?Te.NAMESPACE:Mn,bp=x6(Te,"MATHML_TEXT_INTEGRATION_POINTS",()=>Lo({},pm)),ua=x6(Te,"HTML_INTEGRATION_POINTS",()=>Lo({},Lh));let Ye=x6(Te,"CUSTOM_ELEMENT_HANDLING",()=>ZC(null));if(qe=ZC(null),Nd(Ye,"tagNameCheck")&&K0(Ye.tagNameCheck)&&(qe.tagNameCheck=Ye.tagNameCheck),Nd(Ye,"attributeNameCheck")&&K0(Ye.attributeNameCheck)&&(qe.attributeNameCheck=Ye.attributeNameCheck),Nd(Ye,"allowCustomizedBuiltInElements")&&typeof Ye.allowCustomizedBuiltInElements=="boolean"&&(qe.allowCustomizedBuiltInElements=Ye.allowCustomizedBuiltInElements),dc(qe),ht&&(zt=!1),Gi&&(Hi=!0),Po&&(Fe=Lo({},Jye),Be=ZC(null),Po.html===!0&&(Lo(Fe,Kye),Lo(Be,jye)),Po.svg===!0&&(Lo(Fe,p6),Lo(Be,y6),Lo(Be,oB)),Po.svgFilters===!0&&(Lo(Fe,b6),Lo(Be,y6),Lo(Be,oB)),Po.mathMl===!0&&(Lo(Fe,g6),Lo(Be,Qye),Lo(Be,oB))),ct.tagCheck=null,ct.attributeCheck=null,Nd(Te,"ADD_TAGS")&&(typeof Te.ADD_TAGS=="function"?ct.tagCheck=Te.ADD_TAGS:RC(Te.ADD_TAGS)&&(Fe===tt&&(Fe=Pu(Fe)),Lo(Fe,Te.ADD_TAGS,si))),Nd(Te,"ADD_ATTR")&&(typeof Te.ADD_ATTR=="function"?ct.attributeCheck=Te.ADD_ATTR:RC(Te.ADD_ATTR)&&(Be===je&&(Be=Pu(Be)),Lo(Be,Te.ADD_ATTR,si))),Nd(Te,"ADD_FORBID_CONTENTS")&&RC(Te.ADD_FORBID_CONTENTS)&&(hr===Is&&(hr=Pu(hr)),Lo(hr,Te.ADD_FORBID_CONTENTS,si)),Hn&&(Fe["#text"]=!0),st&&Lo(Fe,["html","head","body"]),Fe.table&&(Lo(Fe,["tbody"]),delete We.tbody),Te.TRUSTED_TYPES_POLICY){if(typeof Te.TRUSTED_TYPES_POLICY.createHTML!="function")throw pS('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if(typeof Te.TRUSTED_TYPES_POLICY.createScriptURL!="function")throw pS('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');let yt=I;I=Te.TRUSTED_TYPES_POLICY;try{N=X("")}catch(an){throw I=yt,an}}else Te.TRUSTED_TYPES_POLICY===null?(I=void 0,N=""):(I===void 0&&(I=D()),I&&typeof N=="string"&&(N=X("")));wa&&wa(Te),qo=Te},yp=Lo({},[...p6,...b6,...U7e]),Ty=Lo({},[...g6,...D7e]),oj=function(Te,Ye,yt){return Ye.namespaceURI===Mn?Te==="svg":Ye.namespaceURI===mo?Te==="svg"&&(yt==="annotation-xml"||bp[yt]):!!yp[Te]},rj=function(Te,Ye,yt){return Ye.namespaceURI===Mn?Te==="math":Ye.namespaceURI===Qr?Te==="math"&&ua[yt]:!!Ty[Te]},sj=function(Te,Ye,yt){return Ye.namespaceURI===Qr&&!ua[yt]||Ye.namespaceURI===mo&&!bp[yt]?!1:!Ty[Te]&&(gp[Te]||!yp[Te])},aj=function(Te){let Ye=S(Te);(!Ye||!Ye.tagName)&&(Ye={namespaceURI:Ki,tagName:"template"});let yt=PI(Te.tagName),an=PI(Ye.tagName);return Xo[Te.namespaceURI]?Te.namespaceURI===Qr?oj(yt,Ye,an):Te.namespaceURI===mo?rj(yt,Ye,an):Te.namespaceURI===Mn?sj(yt,Ye,an):!!(Ps==="application/xhtml+xml"&&Xo[Te.namespaceURI]):!1},xp=function(Te){vI(t.removed,{element:Te});try{S(Te).removeChild(Te)}catch{if(f(Te),!S(Te))throw pS("a node selected for removal could not be detached from its tree and cannot be safely returned; refusing to sanitize in place")}},BR=function(Te,Ye,yt){try{Te.removeAttributeNode(Ye)}catch{try{Te.removeAttribute(yt)}catch{}}},zT=function(Te){HT(Te);let Ye=_(Te);if(Ye){let an=[];bS(Ye,Ln=>{vI(an,Ln)}),bS(an,Ln=>{try{f(Ln)}catch{}})}let yt=R(Te);if(yt)for(let an=yt.length-1;an>=0;--an){let Ln=yt[an],ai=Ln&&Ln.name;typeof ai=="string"&&BR(Te,Ln,ai)}},Wh=function(Te,Ye,yt){if(!yt)try{yt=Ye.getAttributeNode(Te)}catch{yt=null}vI(t.removed,{attribute:yt||null,from:Ye});try{yt?Ye.removeAttributeNode(yt):Ye.removeAttribute(Te)}catch{try{Ye.removeAttribute(Te)}catch{}}if(Te==="is")if(Hi||Gi)try{xp(Ye)}catch{}else try{Ye.setAttribute(Te,"")}catch{}},cj=function(Te){let Ye=R(Te);if(Ye)for(let yt=Ye.length-1;yt>=0;--yt){let an=Ye[yt],Ln=an&&an.name;typeof Ln!="string"||Be[si(Ln)]||BR(Te,an,Ln)}},HT=function(Te){let Ye=[Te];for(;Ye.length>0;){let yt=Ye.pop();L(yt)===Iu.element&&cj(yt);let Ln=_(yt);if(Ln)for(let ai=Ln.length-1;ai>=0;--ai)Ye.push(Ln[ai])}},zR=function(Te,Ye){return jt?Te==="patchsrc"?!0:Te==="for"&&Ye!=="label"&&Ye!=="output":!1},Tp=function(Te){if(!jt)return;let Ye=[Te];for(;Ye.length>0;){let yt=Ye.pop(),an=L(yt);if(an===Iu.processingInstruction||an===Iu.comment&&rl(exe,yt.data)){try{f(yt)}catch{}continue}if(an===Iu.element){let ai=yt,Er=si(F(yt));try{ai.hasAttribute&&ai.hasAttribute("patchsrc")&&ai.removeAttribute("patchsrc"),ai.hasAttribute&&ai.hasAttribute("for")&&zR("for",Er)&&ai.removeAttribute("for")}catch{}}let Ln=_(yt);if(Ln)for(let ai=Ln.length-1;ai>=0;--ai)Ye.push(Ln[ai])}},KT=function(Te){let Ye=null,yt=null;if(Si)Te=""+Te;else{let ai=Oye(Te,/^[\r\n\t ]+/);yt=ai&&ai[0]}Ps==="application/xhtml+xml"&&Ki===Mn&&(Te=''+Te+"");let an=I?X(Te):Te;if(Ki===Mn)try{Ye=new u().parseFromString(an,Ps)}catch{}if(!Ye||!Ye.documentElement){Ye=O.createDocument(Ki,"template",null);try{Ye.documentElement.innerHTML=wi?N:an}catch{}}let Ln=Ye.body||Ye.documentElement;return Te&&yt&&Ln.insertBefore(n.createTextNode(yt),Ln.childNodes[0]||null),Ki===Mn?K.call(Ye,st?"html":"body")[0]:st?Ye.documentElement:Ln},DA=function(Te){let Ye=A?A(Te):Te.ownerDocument;return w.call(Ye||Te,Te,c.SHOW_ELEMENT|c.SHOW_COMMENT|c.SHOW_TEXT|c.SHOW_PROCESSING_INSTRUCTION|c.SHOW_CDATA_SECTION,null)},HR=function(Te){return Te=FI(Te,$," "),Te=FI(Te,ee," "),Te=FI(Te,le," "),Te},_y=function(Te){var Ye;Te.normalize();let yt=A?A(Te):Te.ownerDocument,an=w.call(yt||Te,Te,c.SHOW_TEXT|c.SHOW_COMMENT|c.SHOW_CDATA_SECTION|c.SHOW_PROCESSING_INSTRUCTION,null),Ln=an.nextNode();for(;Ln;)Ln.data=HR(Ln.data),Ln=an.nextNode();let ai=(Ye=Te.querySelectorAll)===null||Ye===void 0?void 0:Ye.call(Te,"template");ai&&bS(ai,Er=>{oe(Er.content)&&_y(Er.content)})},de=function(Te){let Ye=E?E(Te):null;return typeof Ye!="string"||si(Ye)!=="form"?!1:typeof Te.nodeName!="string"||typeof Te.textContent!="string"||typeof Te.removeChild!="function"||Te.attributes!==R(Te)||typeof Te.removeAttribute!="function"||typeof Te.setAttribute!="function"||typeof Te.namespaceURI!="string"||typeof Te.insertBefore!="function"||typeof Te.hasChildNodes!="function"||Te.nodeType!==C(Te)||Te.childNodes!==_(Te)},oe=function(Te){if(!C||typeof Te!="object"||Te===null)return!1;try{return C(Te)===Iu.documentFragment}catch{return!1}},Re=function(Te){if(!C||typeof Te!="object"||Te===null)return!1;try{return typeof C(Te)=="number"}catch{return!1}};function Ve(Vt,Te,Ye){Vt.length!==0&&bS(Vt,yt=>{yt.call(t,Te,Ye,qo)})}let et=function(Te,Ye){return!!(jt&&Te.hasChildNodes()&&!Re(Te.firstElementChild)&&rl($ye,Te.textContent)&&rl($ye,Te.innerHTML)||jt&&Te.namespaceURI===Mn&&tqe[Ye]&&(Re(Te.firstElementChild)||typeof Te.textContent=="string"&&rl(nqe[Ye],Te.textContent))||Te.nodeType===Iu.processingInstruction||jt&&Te.nodeType===Iu.comment&&rl(exe,Te.data))},Ct=function(Te,Ye){if(Te instanceof RegExp)return rl(Te,Ye);if(Te instanceof Function){for(var yt=arguments.length,an=new Array(yt>2?yt-2:0),Ln=2;Ln=0;--Er){let ds=Te===yt?b(Ln[Er],!0):Ln[Er];an.insertBefore(ds,y(Te))}}}return xp(Te),!0},Gt=function(Te,Ye,yt,an){return Te.length===0?Ye:Ye===yt||Ye===an?Pu(Ye):Ye},Sn=function(Te,Ye){return Te===Ye||S(Te)!==null?!1:($i&&HT(Te),!0)},Kn=function(Te,Ye){if(Ve(H.beforeSanitizeElements,Te,null),Sn(Te,Ye))return!0;if(de(Te))return xp(Te),!0;let yt=si(F(Te));if(Fe=Gt(H.uponSanitizeElement,Fe,tt,Mi),Ve(H.uponSanitizeElement,Te,{tagName:yt,allowedTags:Fe}),Sn(Te,Ye))return!0;if(et(Te,yt))return xp(Te),!0;if(We[yt]||!(ct.tagCheck instanceof Function&&ct.tagCheck(yt))&&!Fe[yt]){let Ln=gt(Te,yt,Ye);return Ln===!1&&Ve(H.afterSanitizeElements,Te,null),Ln}if(L(Te)===Iu.element&&!aj(Te)||(yt==="noscript"||yt==="noembed"||yt==="noframes")&&rl($7e,Te.innerHTML))return xp(Te),!0;if(ht&&Te.nodeType===Iu.text){let Ln=HR(Te.textContent);Te.textContent!==Ln&&(vI(t.removed,{element:Te.cloneNode()}),Te.textContent=Ln)}return Ve(H.afterSanitizeElements,Te,null),!1},xn=function(Te,Ye,yt){if(Ke[Ye]||zR(Ye,Te)||Zi&&(Ye==="id"||Ye==="name")&&(yt in n||yt in Gl))return!1;let an=Be[Ye]||ct.attributeCheck instanceof Function&&ct.attributeCheck(Ye,Te);return zt&&rl(_e,Ye)||Et&&rl(he,Ye)?!0:an?yi[Ye]||rl(Ae,FI(yt,ye,""))||(Ye==="src"||Ye==="xlink:href"||Ye==="href")&&Te!=="script"&&Bye(yt,"data:")===0&&Hs[Te]||ut&&!rl(Ze,FI(yt,ye,""))?!0:!yt:pr(Te)&&Ct(qe.tagNameCheck,Te)&&Ct(qe.attributeNameCheck,Ye,Te)||Ye==="is"&&qe.allowCustomizedBuiltInElements&&Ct(qe.tagNameCheck,yt)},Vr=Lo({},["annotation-xml","color-profile","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","missing-glyph"]),pr=function(Te){return!Vr[PI(Te)]&&rl(Ge,Te)},Ks=function(Te,Ye,yt,an){if(I&&typeof m=="object"&&typeof m.getAttributeType=="function"&&!yt)switch(m.getAttributeType(Te,Ye)){case"TrustedHTML":return X(an);case"TrustedScriptURL":return Y(an)}return an},Rc=function(Te,Ye,yt,an){try{yt?Te.setAttributeNS(yt,Ye,an):Te.setAttribute(Ye,an),de(Te)?xp(Te):Dye(t.removed)}catch{Wh(Ye,Te)}},Ll=function(Te){Ve(H.beforeSanitizeAttributes,Te,null);let Ye=Te.attributes;if(!Ye||de(Te))return;Be=Gt(H.uponSanitizeAttribute,Be,je,jn);let yt={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:Be,forceKeepAttr:void 0},an=Ye.length,Ln=si(Te.nodeName);for(;an--;){let ai=Ye[an],Er=ai.name,ds=ai.namespaceURI,Sd=ai.value,Zd=si(Er),lj=Sd,Wl=Er==="value"?lj:P7e(lj);if(yt.attrName=Zd,yt.attrValue=Wl,yt.keepAttr=!0,yt.forceKeepAttr=void 0,Ve(H.uponSanitizeAttribute,Te,yt),Wl=yt.attrValue,On&&(Zd==="id"||Zd==="name")&&Bye(Wl,rn)!==0&&(Wh(Er,Te,ai),Wl=rn+Wl),jt&&rl(/((--!?|])>)|<\/(style|script|title|xmp|textarea|noscript|iframe|noembed|noframes)/i,Wl)){Wh(Er,Te,ai);continue}if(Zd==="attributename"&&Oye(Wl,"href")){Wh(Er,Te,ai);continue}if(!yt.forceKeepAttr){if(!yt.keepAttr){Wh(Er,Te,ai);continue}if(!bt&&rl(eqe,Wl)){Wh(Er,Te,ai);continue}if(ht&&(Wl=HR(Wl)),!xn(Ln,Zd,Wl)){Wh(Er,Te,ai);continue}Wl=Ks(Ln,Zd,ds,Wl),Wl!==lj&&Rc(Te,Er,ds,Wl)}}Ve(H.afterSanitizeAttributes,Te,null)},_d=function(Te){let Ye=null,yt=DA(Te);for(Ve(H.beforeSanitizeShadowDOM,Te,null);Ye=yt.nextNode();)if(Ve(H.uponSanitizeShadowNode,Ye,null),Kn(Ye,Te),Ll(Ye),oe(Ye.content)&&_d(Ye.content),L(Ye)===Iu.element){let an=Z(Ye);oe(an)&&(J0(an),_d(an))}Ve(H.afterSanitizeShadowDOM,Te,null)},J0=function(Te){let Ye=[{node:Te,shadow:null}];for(;Ye.length>0;){let yt=Ye.pop();if(yt.shadow){_d(yt.shadow);continue}let an=yt.node,ai=L(an)===Iu.element,Er=_(an);if(Er)for(let ds=Er.length-1;ds>=0;--ds)Ye.push({node:Er[ds],shadow:null});if(ai){let ds=E?E(an):null;if(typeof ds=="string"&&si(ds)==="template"){let Sd=an.content;oe(Sd)&&Ye.push({node:Sd,shadow:null})}}if(ai){let ds=Z(an);oe(ds)&&Ye.push({node:null,shadow:ds},{node:ds,shadow:null})}}};return t.sanitize=function(Vt){let Te=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},Ye=null,yt=null,an=null,Ln=null;if(wi=!Vt,wi&&(Vt=""),typeof Vt!="string"&&!Re(Vt)&&(Vt=w7e(Vt),typeof Vt!="string"))throw pS("dirty is not a string, aborting");if(!t.isSupported)return Vt;pt?(Fe=Mi,Be=jn):va(Te),(H.uponSanitizeElement.length>0||H.uponSanitizeAttribute.length>0)&&(Fe=Pu(Fe)),H.uponSanitizeAttribute.length>0&&(Be=Pu(Be)),t.removed=[];let ai=$i&&typeof Vt!="string"&&Re(Vt);if(ai){Tp(Vt);let Sd=F(Vt);if(typeof Sd=="string"){let Zd=si(Sd);if(!Fe[Zd]||We[Zd])throw zT(Vt),pS("root node is forbidden and cannot be sanitized in-place")}if(de(Vt))throw zT(Vt),pS("root node is clobbered and cannot be sanitized in-place");try{J0(Vt)}catch(Zd){throw zT(Vt),Zd}}else if(Re(Vt))Ye=KT(""),yt=Ye.ownerDocument.importNode(Vt,!0),yt.nodeType===Iu.element&&yt.nodeName==="BODY"||yt.nodeName==="HTML"?Ye=yt:Ye.appendChild(yt),J0(yt);else{if(!Hi&&!ht&&!st&&Vt.indexOf("<")===-1)return I&&pi?X(Vt):Vt;if(Ye=KT(Vt),!Ye)return Hi?null:pi?N:""}Ye&&Si&&xp(Ye.firstChild);let Er=ai?Vt:Ye;try{let Sd=DA(Er);for(;an=Sd.nextNode();)Kn(an,Er),Ll(an),oe(an.content)&&_d(an.content)}catch(Sd){throw ai&&(zT(Vt),bS(t.removed,Zd=>{Zd.element&&HT(Zd.element)})),Sd}if(ai)return bS(t.removed,Sd=>{Sd.element&&HT(Sd.element)}),ht&&_y(Vt),Vt;if(Hi){if(ht&&_y(Ye),Gi)for(Ln=z.call(Ye.ownerDocument);Ye.firstChild;)Ln.appendChild(Ye.firstChild);else Ln=Ye;return(Be.shadowroot||Be.shadowrootmode)&&(Ln=te.call(i,Ln,!0)),Ln}let ds=st?Ye.outerHTML:Ye.innerHTML;return st&&Fe["!doctype"]&&Ye.ownerDocument&&Ye.ownerDocument.doctype&&Ye.ownerDocument.doctype.name&&rl(Q7e,Ye.ownerDocument.doctype.name)&&(ds=" +`+ds),ht&&(ds=HR(ds)),I&&pi?X(ds):ds},t.setConfig=function(){let Vt=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};va(Vt),pt=!0,Mi=Fe,jn=Be},t.clearConfig=function(){qo=null,pt=!1,Mi=null,jn=null,I=g,N=""},t.isValidAttribute=function(Vt,Te,Ye){qo||va({});let yt=si(Vt),an=si(Te);return xn(yt,an,Ye)},t.addHook=function(Vt,Te){typeof Te=="function"&&Nd(H,Vt)&&vI(H[Vt],Te)},t.removeHook=function(Vt,Te){if(Nd(H,Vt)){if(Te!==void 0){let Ye=F7e(H[Vt],Te);return Ye===-1?void 0:I7e(H[Vt],Ye,1)[0]}return Dye(H[Vt])}},t.removeHooks=function(Vt){Nd(H,Vt)&&(H[Vt]=[])},t.removeAllHooks=function(){H=txe()},t}var sxe=rxe();var rqe=0,S6={},Z6=class e{constructor(t,n){let i,o=t;l(S6[o])?i=S6[o]:(i=rqe++,S6[o]=i),n=n??!1,this._id=i,this._html=t,this._showOnScreen=n,this._element=void 0}get html(){return this._html}get id(){return this._id}get showOnScreen(){return this._showOnScreen}set showOnScreen(t){this._showOnScreen=t}get element(){if(!l(this._element)){let t=sxe.sanitize(this._html),n=document.createElement("div");n.className="cesium-credit-wrapper",n._creditId=this._id,n.style.display="inline",n.innerHTML=t;let i=n.querySelectorAll("a");for(let o=0;o0&&(r=qt.OUTSIDE);for(let s=0;st(this.get(u,s),this.get(m,a)));for(let u=0;uthis._dirtyOffset+this._dirtyCount&&(this._dirtyCount=t+1-this._dirtyOffset)}_makeClean(){this._dirtyCount>0&&(this._dirtyCount=0,this._dirtyOffset=0,this._version++)}_makeDirtyBoundingVolume(){this._boundingVolumeAutoUpdate&&(this._dirtyBoundingVolume=!0)}update(t){t.mode!==se.SCENE3D&&xt("bufferprim-scenemode","BufferPrimitiveCollection requires SceneMode.SCENE3D."),this._dirtyBoundingVolume&&this._updateBoundingVolume(),this._allowPicking&&this._updatePickIds(t.context)}_isRendered(t){let n=t.passes;return this.show&&!gs(this._heightReference)&&(n.render||n.pick)}get primitiveCount(){return this._primitiveCount}get primitiveCountMax(){return this._primitiveCountMax}get byteLength(){return this._primitiveView.byteLength+this._positionView.byteLength+this._materialView.byteLength}get vertexCount(){return this._positionCount}get vertexCountMax(){return this._positionCountMax}get modelMatrix(){return this._modelMatrix}get boundingVolume(){return this._dirtyBoundingVolume&&this._updateBoundingVolume(),this._boundingVolume}get positionDatatype(){return this._positionDatatype}get positionNormalized(){return this._positionNormalized}get heightReference(){return this._heightReference}static _copySubArray(t,n,i){for(let o=0;o0?this.getHoles()[0]:this.vertexCount}getOuterPositions(n){return this._getPositionsRange(0,this.outerVertexCount,n)}get holeOffset(){return this._getUint32(Om.Layout.HOLE_OFFSET_U32)}get holeCount(){return this._getUint32(Om.Layout.HOLE_COUNT_U32)}getHoles(n){let{holeOffset:i,holeCount:o}=this,r=this._collection._holeIndexView;if(!l(n)){let s=r.byteOffset+i*r.BYTES_PER_ELEMENT,a=r.constructor;return new a(r.buffer,s,o)}for(let s=0;s0){let{attributeArrays:c}=n,{_dirtyOffset:d,_dirtyCount:u}=e,m=c.positionHigh,p=c.positionLow,b=n.indexArray,f=c.pickColor,y=c.showColorAlpha;for(let _=d,S=d+u;_0){let{indexOffset:c,indexCount:d,vertexOffset:u,vertexCount:m}=fqe(e);n.vertexArray.copyIndexFromRange(n.indexArray,c,d);for(let p in r)if(Object.hasOwn(r,p)){let b=p;n.vertexArray.copyAttributeFromRange(r[b],n.attributeArrays[b],u,m)}}}else{let{attributeArrays:c}=n;n.vertexArray=new Un({context:i,indexBuffer:it.createIndexBuffer({context:i,typedArray:n.indexArray,usage:Pe.STATIC_DRAW,indexDatatype:Oe.fromTypedArray(n.indexArray)}),attributes:[...o?[{index:A6.positionHigh,componentDatatype:J.FLOAT,componentsPerAttribute:3,vertexBuffer:it.createVertexBuffer({typedArray:c.positionHigh,context:i,usage:Pe.STATIC_DRAW})},{index:A6.positionLow,componentDatatype:J.FLOAT,componentsPerAttribute:3,vertexBuffer:it.createVertexBuffer({typedArray:c.positionLow,context:i,usage:Pe.STATIC_DRAW})}]:[{index:gxe.position,componentDatatype:e._positionDatatype,componentsPerAttribute:3,normalize:e._positionNormalized,vertexBuffer:it.createVertexBuffer({typedArray:c.position,context:i,usage:Pe.STATIC_DRAW})}],{index:r.pickColor,componentDatatype:J.UNSIGNED_BYTE,componentsPerAttribute:4,vertexBuffer:it.createVertexBuffer({typedArray:c.pickColor,context:i,usage:Pe.STATIC_DRAW})},{index:r.showColorAlpha,componentDatatype:J.FLOAT,componentsPerAttribute:3,vertexBuffer:it.createVertexBuffer({typedArray:c.showColorAlpha,context:i,usage:Pe.STATIC_DRAW})}]})}l(n.renderState)||(n.renderState=ze.fromCache({blending:e._blendOption===Ni.OPAQUE?on.DISABLED:on.ALPHA_BLEND,depthTest:{enabled:!0}})),l(n.shaderProgram)||(n.shaderProgram=tn.fromCache({context:i,vertexShaderSource:new Je({sources:[Lv],defines:o?["USE_FLOAT64"]:[]}),fragmentShaderSource:new Je({sources:[Gv]}),attributeLocations:r}));let s=e.triangleCount*3;l(n.command)||(n.command=new lt({vertexArray:n.vertexArray,renderState:n.renderState,shaderProgram:n.shaderProgram,primitiveType:Ie.TRIANGLES,pass:e._blendOption===Ni.OPAQUE?Le.OPAQUE:Le.TRANSLUCENT,pickId:e._allowPicking?"v_pickColor":void 0,owner:e,count:s,modelMatrix:e.modelMatrix,boundingVolume:e.boundingVolume,debugShowBoundingVolume:e.debugShowBoundingVolume}));let a=n.command;return a.count!==s&&(a.count=s),a.debugShowBoundingVolume!==e.debugShowBoundingVolume&&(a.debugShowBoundingVolume=e.debugShowBoundingVolume),t.commandList.push(a),e._makeClean(),n}function fqe(e){let{_dirtyOffset:t,_dirtyCount:n}=e;e.get(t,xa);let i=xa.vertexOffset,o=xa.triangleOffset*3;e.get(t+n-1,xa);let r=xa.vertexOffset+xa.vertexCount-i,s=(xa.triangleOffset+xa.triangleCount)*3-o;return{indexOffset:o,indexCount:s,vertexOffset:i,vertexCount:r}}function pqe(){let e=this;l(e.vertexArray)&&e.vertexArray.destroy(),l(e.shaderProgram)&&e.shaderProgram.destroy(),l(e.renderState)&&ze.removeFromCache(e.renderState)}var MI=hqe;var{ERR_CAPACITY:uHn}=na.Error,W6=class e extends na{constructor(t=B.EMPTY_OBJECT){super(t),this._holeCount=0,this._holeCountMax=t.holeCountMax??na.DEFAULT_CAPACITY,this._holeIndexView=null,this._triangleCount=0,this._triangleCountMax=t.triangleCountMax??na.DEFAULT_CAPACITY,this._triangleIndexView=null,this._allocateHoleIndexBuffer(),this._allocateTriangleIndexBuffer()}_getCollectionClass(){return e}_getPrimitiveClass(){return Ir}_getMaterialClass(){return Xu}_allocateHoleIndexBuffer(){this._holeIndexView=Oe.createTypedArray(this._positionCountMax,this._holeCountMax)}_allocateTriangleIndexBuffer(){this._triangleIndexView=Oe.createTypedArray(this._positionCountMax,this._triangleCountMax*3)}static clone(t,n,i){return super.clone(t,n,i),l(i)||(this._copySubArray(t._holeIndexView,n._holeIndexView,t.holeCount),this._copySubArray(t._triangleIndexView,n._triangleIndexView,t._triangleCount*3),n._holeCount=t._holeCount,n._triangleCount=t._triangleCount),n}static fromCollection(t,n,i){return super.fromCollection(t,n,i)}_cloneEmpty(t=B.EMPTY_OBJECT){return new e({holeCountMax:this.holeCountMax,triangleCountMax:this.triangleCountMax,...this._cloneEmptyBaseArgs(t)})}static _replaceBuffers(t,n){super._replaceBuffers(t,n),n._holeIndexView=t._holeIndexView,n._triangleIndexView=t._triangleIndexView}add(t,n=new Ir){super.add(t,n);let i=this._positionCount;n._setUint32(Ir.Layout.POSITION_OFFSET_U32,i),n._setUint32(Ir.Layout.POSITION_COUNT_U32,0);let o=this._holeCount;n._setUint32(Ir.Layout.HOLE_OFFSET_U32,o),n._setUint32(Ir.Layout.HOLE_COUNT_U32,0);let r=this._triangleCount;return n._setUint32(Ir.Layout.TRIANGLE_OFFSET_U32,r),n._setUint32(Ir.Layout.TRIANGLE_COUNT_U32,0),l(t.positions)&&n.setPositions(t.positions),l(t.holes)&&n.setHoles(t.holes),l(t.triangles)&&n.setTriangles(t.triangles),n}update(t){super.update(t),this._isRendered(t)&&(this._renderContext=MI(this,t,this._renderContext))}get byteLength(){return super.byteLength+this._holeIndexView.byteLength+this._triangleIndexView.byteLength}get holeCount(){return this._holeCount}get holeCountMax(){return this._holeCountMax}get triangleCount(){return this._triangleCount}get triangleCountMax(){return this._triangleCountMax}},ka=W6;var OHn=x(T(),1);var THn=x(T(),1);var{ERR_RESIZE:gHn,ERR_CAPACITY:yHn}=na.Error,AC=class AC extends ss{constructor(){super(...arguments);mt(this,"_collection",null)}static clone(n,i){return super.clone(n,i),i.setPositions(n.getPositions()),i}get vertexOffset(){return this._getUint32(AC.Layout.POSITION_OFFSET_U32)}get vertexCount(){return this._getUint32(AC.Layout.POSITION_COUNT_U32)}getPositions(n){let{vertexOffset:i,vertexCount:o}=this,r=this._collection._positionView;if(!l(n)){let s=r.byteOffset+i*3*r.BYTES_PER_ELEMENT,a=r.constructor;return new a(r.buffer,s,o*3)}for(let s=0;s0&&(o.hasPixelWidths||(o.hasPixelWidths=!n.widthInMeters),o.hasMeterWidths||(o.hasMeterWidths=n.widthInMeters)),o.primitiveCount+=s}static packPolylineGrid(t){let n=t.polylineSegments,i=t.polylineSegmentPrimitiveIndices,o=Math.max(1,Math.ceil(Math.sqrt(n.length/xxe))),r=new Array(o*o);for(let _=0;_=0)return(e+1)*.5/t.minimumTileScreenPixels;let n=t.metersPerUv;return-e*.5/Math.min(n.x,n.y)}function Rqe(e,t,n,i){let o=e.x,r=t.x;r=o+W.negativePiToPi(r-o);let s=n.west+i*.5,a=s+W.negativePiToPi(o-s)-o;o+=a,r+=a;let c=n.north-n.south;e.x=(o-n.west)/i,e.y=(e.y-n.south)/c,t.x=(r-n.west)/i,t.y=(t.y-n.south)/c}function Cqe(e,t,n){let i=-n,o=1+n,r=0,s=1,a=e.x,c=e.y,d=t.x,u=t.y,m=d-a,p=u-c,b=[-m,m,-p,p],f=[a-i,o-a,c-i,o-c];for(let y=0;y<4;y++){if(Math.abs(b[y])<1e-12){if(f[y]<0)return!1;continue}let _=f[y]/b[y];if(b[y]<0?r=Math.max(r,_):s=Math.min(s,_),r>s)return!1}return e.x=a+r*m,e.y=c+r*p,t.x=a+s*m,t.y=c+s*p,!0}function ax(e,t){return Math.max(0,Math.min(t-1,e))}var I6=new Float64Array(512),Rxe=new Float64Array(512),Cxe={positions:new Float64Array(512),vertexCount:0};function Vqe(e,t,n,i,o){I6.length>1,m=(d&1)===0?1:-1,p=d===0?n:d===1?i:d===2?o:r,b=c*4+4,f=(d&1)===0,y=f?Rxe:s.positions;y.length=0;for(let C=0;C=0;if(L!==R){let F=u===0?(p-S)/(E-S):(p-Z)/(A-Z);y[_*2]=u===0?p:S+F*(E-S),y[_*2+1]=u===0?Z+F*(A-Z):p,_++}L&&(y[_*2]=E,y[_*2+1]=A,_++),S=E,Z=A,R=L}if(_===0)return s.vertexCount=0,s;a=y,c=_}return s.vertexCount=c,s}function lB(e){let t=W.nextPowerOfTwo(Math.max(1,Math.ceil(Math.sqrt(e)))),n=W.nextPowerOfTwo(Math.max(1,Math.ceil(e/t)));return[t,n]}function Exe(e,t){let[n,i]=lB(t.length),o=new Float32Array(n*i);return o.set(t),new vt({context:e,pixelFormat:Qe.RED,pixelDatatype:Ue.FLOAT,source:{width:n,height:i,arrayBufferView:o},sampler:Ot.NEAREST,flipY:!1})}function Axe(e,t,n){l(n)||(n=new Float64Array(e._positionCountMax*2));let i=e._positionView,o=e.modelMatrix;for(let r=0;r0?2*i:0,triangleCountMax:0});for(let o=0;od.show:void 0);if(i.destroy(),e._bufferPolygonCollection=c,a){let d=e._polygons;for(let u=0;uEC.equals(t.clippingPolygon,e))};al.prototype.remove=function(e){let t=this._polygons,n=t.findIndex(o=>EC.equals(o.clippingPolygon,e));if(n===-1)return!1;let[i]=t.splice(n,1);return Wxe(this,i),this._dirty=!0,this.polygonRemoved.raiseEvent(i.clippingPolygon,n),!0};al.prototype.removeAll=function(){let e=this._polygons,t=e.length;for(let n=0;n{if(Vi._activeComputeCommandCount>=Vi._maximumComputeCommandCount){Vi._nextFrameCommandQueue.push(e);return}t.commandList.push(e),Vi._activeComputeCommandCount++};Vi._updateCommandQueue=e=>{if(Vi._maximumComputeCommandCount=Math.log2(wt.maximumCubeMapSize),Vi._nextFrameCommandQueue.length>0&&Vi._activeComputeCommandCounts,u_enuToFixedFrame:()=>c,u_faceDirection:()=>es.getDirection(m,Fxe),u_positionWC:()=>r,u_brightnessSaturationGammaIntensity:()=>d,u_groundColor:()=>e.groundColor.withAlpha(e.groundAlbedo,Xqe)},owner:e});f.postExecute=()=>{if(e.isDestroyed()||f.canceled){Vi._activeComputeCommandCount--;return}let y=e._radianceMapComputeCommands;y[b]=void 0;let _=new fs({context:n,colorTextures:[e._radianceMapTextures[b]]});_._bind(),e._radianceCubeMap[m].copyFromFramebuffer(),_._unBind(),_.destroy(),Vi._activeComputeCommandCount--,y.some(l)||(e._convolutionsCommandsDirty=!0,e._shouldRegenerateShaders=!0)},e._radianceMapComputeCommands[u]=f,Vi._queueCommand(f,t),u++}e._radianceCommandsDirty=!1}}function Yqe(e,t){let n=e._radianceCubeMap;n.generateMipmap();let i=e._mipmapLevels,o=e._textureDimensions,r=o.x/2,s=o.y/2,a=t.context,c=0,d=()=>{let p=e._specularMapTextures.length;c>=p&&(e._irradianceCommandDirty=!0,i>1&&(n.sampler=new Ot({minificationFilter:Ht.LINEAR_MIPMAP_LINEAR}),e._shouldRegenerateShaders=!0,e._va.destroy(),e._va=void 0,e._convolveSP.destroy(),e._convolveSP=void 0))},u=(p,b,f,y,_)=>()=>{if(e.isDestroyed()||p.canceled){Vi._activeComputeCommandCount--;return}let S=e._convolutionComputeCommands;S[b]=void 0,n.copyFace(t,f,y,_),c++,Vi._activeComputeCommandCount--,f.destroy(),e._specularMapTextures[b]=void 0,d()},m=0;for(let p=1;pp/(i-1),u_radianceTexture:()=>n??a.defaultTexture,u_faceDirection:()=>es.getDirection(b,Fxe)}});S.postExecute=u(S,m,f,b,p),e._convolutionComputeCommands[m]=S,Vi._queueCommand(S,t),++m}r/=2,s/=2}d()}var Ixe=new k(3,3);function Mqe(e,t){let n=t.context,i=Ixe,o=e._irradianceMapTexture;l(o)&&!o.isDestroyed()&&o.destroy(),o=new vt({context:n,width:i.x,height:i.y,pixelDatatype:Ue.FLOAT,pixelFormat:Qe.RGBA}),e._irradianceMapTexture=o;let r=e._irradianceMapFS;l(r)||(r=new Je({sources:[Mv]}),e._irradianceMapFS=r);let s=new bu({fragmentShaderSource:r,outputTexture:o,owner:e,uniformMap:{u_radianceMap:()=>e._radianceCubeMap??n.defaultTexture}});s.postExecute=()=>{if(e.isDestroyed()||s.canceled){Vi._activeComputeCommandCount--;return}e._irradianceTextureDirty=!1,e._irradianceComputeCommand=void 0,e._sphericalHarmonicCoefficientsDirty=!0,e._irradianceMapFS=void 0,Vi._activeComputeCommandCount--},e._irradianceComputeCommand=s,Vi._queueCommand(s,t),e._irradianceTextureDirty=!0}function wqe(e,t){let n=t.context;if(!l(e._irradianceMapTexture))return;let i=new fs({context:n,colorTextures:[e._irradianceMapTexture],destroyAttachments:!1}),o=Ixe,r=n.readPixels({x:0,y:0,width:o.x,height:o.y,framebuffer:i});for(let s=0;s<9;++s)e._sphericalHarmonicCoefficients[s]=h.unpack(r,s*4),h.multiplyByScalar(e._sphericalHarmonicCoefficients[s],e.atmosphereScatteringIntensity,e._sphericalHarmonicCoefficients[s]);i.destroy(),e._irradianceMapTexture.destroy(),e._irradianceMapTexture=void 0,e._shouldRegenerateShaders=!0}Vi.prototype.update=function(e){let t=e.mode;if(!(Vi.isDynamicUpdateSupported(e)&&this._mipmapLevels>=1)||!this.enabled||!this.shouldUpdate||!l(this._position)||t===se.MORPHING){this._shouldRegenerateShaders=!1;return}Vi._updateCommandQueue(e);let i=e.atmosphere.dynamicLighting,o=Fqe(this,e)||i===wb.SUNLIGHT&&!Q.equalsEpsilon(e.time,this._lastTime,this.maximumSecondsDifference);if(this._shouldReset||o){this.reset(),this._shouldReset=!1,this._lastTime=Q.clone(e.time,this._lastTime);return}if(this._radianceMapDirty&&(Nqe(this,e),this._radianceMapDirty=!1),this._convolutionsCommandsDirty&&(Yqe(this,e),this._convolutionsCommandsDirty=!1),this._irradianceCommandDirty&&(Mqe(this,e),this._irradianceCommandDirty=!1),this._irradianceTextureDirty){this._shouldRegenerateShaders=!1;return}if(this._sphericalHarmonicCoefficientsDirty){wqe(this,e),this._sphericalHarmonicCoefficientsDirty=!1;return}this._shouldRegenerateShaders=!1};Vi.prototype.isDestroyed=function(){return!1};Vi.prototype.destroy=function(){let e=this._radianceMapComputeCommands.length;for(let t=0;t0)return i.byteStride}return J.getSizeInBytes(t.componentType)*Yu(t.type)}var Yd=Uqe;var aJn=x(T(),1);function Dqe(e){switch(e){case J.BYTE:return function(t,n,i,o,r){for(let s=0;s>10)+55296,(r&1023)+56320))}return t};function BI(e,t,n){return t<=e&&e<=n}function Hqe(e){let t=0,n=0,i=0,o=128,r=191,s=[],a=e.length;for(let c=0;chn.clampToLimits(e,hn.INT32)},UINT64:{vectorCompatible:!1,size:8,maximumValue:BigInt("18446744073709551615"),minimumValue:BigInt(0),category:ll.UNSIGNED_INTEGER,downcastFunction:e=>hn.clampToLimits(e,hn.UINT32)},FLOAT32:{vectorCompatible:!0,size:4,maximumValue:34028234663852886e22,minimumValue:-34028234663852886e22,category:ll.FLOAT},FLOAT64:{vectorCompatible:!0,size:8,maximumValue:Number.MAX_VALUE,minimumValue:-Number.MAX_VALUE,category:ll.FLOAT,downcastFunction:e=>Math.fround(e)}};hn.getMinimum=function(e){return hn.typeInfo[e].minimumValue};hn.getMaximum=function(e){return hn.typeInfo[e].maximumValue};hn.isIntegerType=function(e){return hn.typeInfo[e].category!==ll.FLOAT};hn.isUnsignedIntegerType=function(e){return hn.typeInfo[e].category===ll.UNSIGNED_INTEGER};hn.isVectorCompatible=function(e){return hn.typeInfo[e].vectorCompatible};hn.category=function(e){return hn.typeInfo[e].category};hn.gpuComponentType=function(e){switch(e){case hn.INT64:return"INT32";case hn.UINT64:return"UINT32";case hn.FLOAT64:return"FLOAT32";default:return e}};hn.normalize=function(e,t){return Math.max(Number(e)/Number(hn.getMaximum(t)),-1)};hn.unnormalize=function(e,t){let n=hn.getMaximum(t),i=hn.isUnsignedIntegerType(t)?0:-n;return e=W.sign(e)*Math.round(Math.abs(e)*Number(n)),(t===hn.INT64||t===hn.UINT64)&&fn.supportsBigInt()&&(e=BigInt(e)),e>n?n:er?i:Number(e)}return Math.max(n,Math.min(i,e))};hn.downcastFunction=function(e){let n=hn.typeInfo[e].downcastFunction;return l(n)?n:i=>i};hn.fromComponentDatatype=function(e){switch(e){case J.BYTE:return hn.INT8;case J.UNSIGNED_BYTE:return hn.UINT8;case J.SHORT:return hn.INT16;case J.UNSIGNED_SHORT:return hn.UINT16;case J.INT:return hn.INT32;case J.UNSIGNED_INT:return hn.UINT32;case J.FLOAT:return hn.FLOAT32;case J.DOUBLE:return hn.FLOAT64}};hn.toComponentDatatype=function(e){switch(e){case hn.INT8:return J.BYTE;case hn.UINT8:return J.UNSIGNED_BYTE;case hn.INT16:return J.SHORT;case hn.UINT16:return J.UNSIGNED_SHORT;case hn.INT32:return J.INT;case hn.UINT32:return J.UNSIGNED_INT;case hn.FLOAT32:return J.FLOAT;case hn.FLOAT64:return J.DOUBLE}};hn.getDataViewAccessors=function(e,t){return{[hn.UINT8]:{get:e.getUint8.bind(e),set:e.setUint8.bind(e)},[hn.INT8]:{get:e.getInt8.bind(e),set:e.setInt8.bind(e)},[hn.UINT16]:{get:i=>e.getUint16(i,!0),set:(i,o)=>e.setUint16(i,o,!0)},[hn.INT16]:{get:i=>e.getInt16(i,!0),set:(i,o)=>e.setInt16(i,o,!0)},[hn.UINT32]:{get:i=>e.getUint32(i,!0),set:(i,o)=>e.setUint32(i,o,!0)},[hn.INT32]:{get:i=>e.getInt32(i,!0),set:(i,o)=>e.setInt32(i,o,!0)},[hn.FLOAT32]:{get:i=>e.getFloat32(i,!0),set:(i,o)=>e.setFloat32(i,o,!0)},[hn.FLOAT64]:{get:i=>e.getFloat64(i,!0),set:(i,o)=>e.setFloat64(i,o,!0)},[hn.UINT64]:{get:i=>e.getBigUint64(i,!0),set:(i,o)=>e.setBigUint64(i,BigInt(o),!0)},[hn.INT64]:{get:i=>e.getBigInt64(i,!0),set:(i,o)=>e.setBigInt64(i,BigInt(o),!0)}}[t]};Object.freeze(hn);var Nt=hn;var Bjn=x(T(),1);var vjn=x(T(),1);var ar={SCALAR:"SCALAR",VEC2:"VEC2",VEC3:"VEC3",VEC4:"VEC4",MAT2:"MAT2",MAT3:"MAT3",MAT4:"MAT4",BOOLEAN:"BOOLEAN",STRING:"STRING",ENUM:"ENUM"};ar.isVectorType=function(e){switch(e){case ar.VEC2:case ar.VEC3:case ar.VEC4:return!0;default:return!1}};ar.isMatrixType=function(e){switch(e){case ar.MAT2:case ar.MAT3:case ar.MAT4:return!0;default:return!1}};ar.getComponentCount=function(e){switch(e){case ar.SCALAR:case ar.STRING:case ar.ENUM:case ar.BOOLEAN:return 1;case ar.VEC2:return 2;case ar.VEC3:return 3;case ar.VEC4:return 4;case ar.MAT2:return 4;case ar.MAT3:return 9;case ar.MAT4:return 16}};ar.getMathType=function(e){switch(e){case ar.VEC2:return k;case ar.VEC3:return h;case ar.VEC4:return ce;case ar.MAT2:return Ji;case ar.MAT3:return q;case ar.MAT4:return P;default:return}};Object.freeze(ar);var St=ar;function as(e){e=e??B.EMPTY_OBJECT;let t=e.id,n=e.type,i=e.componentType,o=e.enumType,r=l(i)&&(e.normalized??!1)&&Nt.isIntegerType(i);this._id=t,this._name=e.name,this._description=e.description,this._semantic=e.semantic,this._isLegacyExtension=e.isLegacyExtension,this._type=n,this._componentType=i,this._enumType=o,this._valueType=l(o)?o.valueType:i,this._isArray=e.isArray??!1,this._isVariableLengthArray=e.isVariableLengthArray??!1,this._arrayLength=e.arrayLength,this._min=$e(e.min,!0),this._max=$e(e.max,!0),this._normalized=r;let s=$e(e.offset,!0),a=$e(e.scale,!0),c=l(s)||l(a),d=!0;l(s)||(s=this.expandConstant(0,d)),l(a)||(a=this.expandConstant(1,d)),this._offset=s,this._scale=a,this._hasValueTransform=c,this._noData=$e(e.noData,!0),this._default=$e(e.default,!0),this._required=e.required??!0,this._extras=$e(e.extras,!0),this._extensions=$e(e.extensions,!0)}as.fromJson=function(e){e=e??B.EMPTY_OBJECT;let t=e.id,n=e.property,i=Kqe(n),o=Jqe(n,e.enums),r;return l(i)?i?r=l(n.optional)?!n.optional:!0:r=n.required??!1:r=!1,new as({id:t,type:o.type,componentType:o.componentType,enumType:o.enumType,isArray:o.isArray,isVariableLengthArray:o.isVariableLengthArray,arrayLength:o.arrayLength,normalized:n.normalized,min:n.min,max:n.max,offset:n.offset,scale:n.scale,noData:n.noData,default:n.default,required:r,name:n.name,description:n.description,semantic:n.semantic,extras:n.extras,extensions:n.extensions,isLegacyExtension:i})};Object.defineProperties(as.prototype,{id:{get:function(){return this._id}},name:{get:function(){return this._name}},description:{get:function(){return this._description}},type:{get:function(){return this._type}},enumType:{get:function(){return this._enumType}},componentType:{get:function(){return this._componentType}},valueType:{get:function(){return this._valueType}},isArray:{get:function(){return this._isArray}},isVariableLengthArray:{get:function(){return this._isVariableLengthArray}},arrayLength:{get:function(){return this._arrayLength}},normalized:{get:function(){return this._normalized}},max:{get:function(){return this._max}},min:{get:function(){return this._min}},noData:{get:function(){return this._noData}},default:{get:function(){return this._default}},required:{get:function(){return this._required}},semantic:{get:function(){return this._semantic}},hasValueTransform:{get:function(){return this._hasValueTransform}},offset:{get:function(){return this._offset}},scale:{get:function(){return this._scale}},extras:{get:function(){return this._extras}},extensions:{get:function(){return this._extensions}}});function Kqe(e){if(e.type==="ARRAY")return!0;let t=e.type;if(t===St.SCALAR||St.isMatrixType(t)||St.isVectorType(t))return!1;if(l(Nt[t]))return!0;if(l(e.noData)||l(e.scale)||l(e.offset)||l(e.required)||l(e.count)||l(e.array)||l(e.optional))return!1}function Jqe(e,t){let n=e.type,i=e.componentType,o=n==="ARRAY",r,s,a;o?(r=!0,s=e.componentCount,a=!l(s)):e.array?(r=!0,s=e.count,a=!l(e.count)):(r=!1,s=void 0,a=!1);let c;if(l(e.enumType)&&(c=t[e.enumType]),n===St.ENUM)return{type:n,componentType:void 0,enumType:c,valueType:c.valueType,isArray:r,isVariableLengthArray:a,arrayLength:s};if(o&&i===St.ENUM)return{type:i,componentType:void 0,enumType:c,valueType:c.valueType,isArray:r,isVariableLengthArray:a,arrayLength:s};if(n===St.SCALAR||St.isMatrixType(n)||St.isVectorType(n))return{type:n,componentType:i,enumType:void 0,valueType:i,isArray:r,isVariableLengthArray:a,arrayLength:s};if(n===St.BOOLEAN||n===St.STRING)return{type:n,componentType:void 0,enumType:void 0,valueType:void 0,isArray:r,isVariableLengthArray:a,arrayLength:s};if(o&&(i===St.BOOLEAN||i===St.STRING))return{type:i,componentType:void 0,enumType:void 0,valueType:void 0,isArray:r,isVariableLengthArray:a,arrayLength:s};if(l(i)&&l(Nt[i]))return{type:St.SCALAR,componentType:i,enumType:void 0,valueType:i,isArray:r,isVariableLengthArray:a,arrayLength:s};if(l(Nt[n]))return{type:St.SCALAR,componentType:n,enumType:void 0,valueType:n,isArray:r,isVariableLengthArray:a,arrayLength:s}}as.prototype.normalize=function(e){return this._normalized?g7(e,this._valueType,Nt.normalize):e};as.prototype.unnormalize=function(e){return this._normalized?g7(e,this._valueType,Nt.unnormalize):e};as.prototype.applyValueTransform=function(e){return!this._hasValueTransform||this._isVariableLengthArray?e:as.valueTransformInPlace(e,this._offset,this._scale,Nt.applyValueTransform)};as.prototype.unapplyValueTransform=function(e){return!this._hasValueTransform||this._isVariableLengthArray?e:as.valueTransformInPlace(e,this._offset,this._scale,Nt.unapplyValueTransform)};as.prototype.expandConstant=function(e,t){t=t??!1;let n=this._isArray,i=this._arrayLength,o=St.getComponentCount(this._type),r=n&&o>1;if(!n&&o===1)return e;if(!n)return new Array(o).fill(e);if(!r)return new Array(i).fill(e);if(!t)return new Array(this._arrayLength*o).fill(e);let s=new Array(o).fill(e);return new Array(this._arrayLength).fill(s)};as.prototype.handleNoData=function(e){let t=this._noData;if(!l(t))return e;if(!Bxe(e,t))return e};function zI(e){return Array.isArray(e)&&!(e instanceof Ji)&&!(e instanceof q)&&!(e instanceof P)}function Bxe(e,t){if(!zI(e))return e===t;if(!zI(t)||e.length!==t.length)return!1;for(let n=0;n1;return l(n)?t&&r?e.map(function(s){return n.unpack(s)}):i?n.unpackArray(e):n.unpack(e):e};as.prototype.packVectorAndMatrixTypes=function(e,t){t=t??!1;let n=St.getMathType(this._type),i=this._isArray,o=St.getComponentCount(this._type),r=i&&o>1;return l(n)?t&&r?e.map(function(s){return n.pack(s,[])}):i?n.packArray(e,[]):n.pack(e,[]):e};as.prototype.validate=function(e){if(!(!l(e)&&l(this._default)))return this._required&&!l(e)?"required property must have a value":this._isArray?jqe(this,e):zxe(this,e)};function jqe(e,t){if(!zI(t))return`value ${t} must be an array`;let n=t.length;if(!e._isVariableLengthArray&&n!==e._arrayLength)return"Array length does not match property.arrayLength";for(let i=0;i1?Uxe(e,t,n):void 0}if(eNt.getMaximum(t))return Uxe(e,t,n)}function Oxe(e,t){return`value ${e} of type ${t} must be finite`}function g7(e,t,n){if(!zI(e))return n(e,t);for(let i=0;ie)};var y7=[void 0,"float","vec2","vec3","vec4"],Kxe=[void 0,"int","ivec2","ivec3","ivec4"],i$e=[void 0,"uint","uvec2","uvec3","uvec4"],o$e={[ll.FLOAT]:"uintBitsToFloat",[ll.INTEGER]:"int",[ll.UNSIGNED_INTEGER]:""};as.prototype.getGlslTypeWebGL1=function(){let e=St.getComponentCount(this.type);return this.isArray&&(e=this.arrayLength),this.normalized?y7[e]:Kxe[e]};as.prototype.getGlslType=function(){let e=this.valueType,t=St.getComponentCount(this.type),n=this.isArray?this.arrayLength:1;return t*=n,!Nt.isIntegerType(e)||this.normalized?y7[t]:Nt.isUnsignedIntegerType(e)?i$e[t]:Kxe[t]};as.prototype.unpackTextureInShader=function(e,t,n,i){let o=this.getGlslType(),r=Nt.gpuComponentType(this.valueType),s=t.length,a=this.type,c=St.getComponentCount(a)*(this.isArray?this.arrayLength:1),d=Math.floor(s/c),u=`${n}_rawChannels`,m=`${n}_rawBits`,p=`${n}_unpackedValue`,b=`${o} ${p};`,f=`uint ${m};`;i.push(b),i.push(f);let y=`${y7[s]} ${u} = ${e};`;i.push(y);let _=o$e[Nt.category(r)],S=c>1;for(let Z=0;Z1?`.${R}`:"",E=`${m} = czm_unpackTexture(${u}${C});`,A="";S&&(A=`[${Z}]`);let L="",F="";if(this.normalized){let N=Nt.getMaximum(r);L=` * ${1/Number(N)}`,F="float"}let I=`${p}${A} = ${F}(${_}(${m}))${L};`;i.push(E),i.push(I)}return p};as.prototype.unpackTextureInShaderWebGL1=function(e){return this.normalized?e:`${this.getGlslTypeWebGL1()}(255.0 * ${e})`};var zp=as;function HI(e){e=e??B.EMPTY_OBJECT;let t=e.count,n=e.property,i=e.classProperty,o=e.bufferViews,r=i.type,s=i.isArray,a=i.isVariableLengthArray,c=i.valueType,d=i.enumType,u=r===St.STRING,m=r===St.BOOLEAN,p=0,b;if(a){let g=n.arrayOffsetType??n.offsetType;g=Nt[g]??Nt.UINT32;let V=n.arrayOffsets??n.arrayOffsetBufferView;b=new x7(o[V],g,t+1),p+=b.typedArray.byteLength}let f=St.getComponentCount(r),y;a?y=b.get(t)-b.get(0):s?y=t*i.arrayLength:y=t;let _=f*y,S;if(u){let g=n.stringOffsetType??n.offsetType;g=Nt[g]??Nt.UINT32;let V=n.stringOffsets??n.stringOffsetBufferView;S=new x7(o[V],g,_+1),p+=S.typedArray.byteLength}(u||m)&&(c=Nt.UINT8);let Z;u?Z=S.get(_)-S.get(0):m?Z=Math.ceil(_/8):Z=_;let R=n.values??n.bufferView,C=new x7(o[R],c,Z);p+=C.typedArray.byteLength;let E=n.offset,A=n.scale,L=i.hasValueTransform||l(E)||l(A);E=E??i.offset,A=A??i.scale,E=Jxe(E),A=Jxe(A);let F,I,N=this;u?F=function(g){return a$e(g,N._values,N._stringOffsets)}:m?(F=function(g){return c$e(g,N._values)},I=function(g,V){l$e(g,N._values,V)}):l(d)?(F=function(g){let V=N._values.get(g);return d.namesByValue[V]},I=function(g,V){let G=d.valuesByName[V];N._values.set(g,G)}):(F=function(g){return N._values.get(g)},I=function(g,V){N._values.set(g,V)}),this._arrayOffsets=b,this._stringOffsets=S,this._values=C,this._classProperty=i,this._count=t,this._vectorComponentCount=f,this._min=n.min,this._max=n.max,this._offset=E,this._scale=A,this._hasValueTransform=L,this._getValue=F,this._setValue=I,this._unpackedValues=void 0,this._extras=n.extras,this._extensions=n.extensions,this._byteLength=p}Object.defineProperties(HI.prototype,{hasValueTransform:{get:function(){return this._hasValueTransform}},offset:{get:function(){return this._offset}},scale:{get:function(){return this._scale}},extras:{get:function(){return this._extras}},extensions:{get:function(){return this._extensions}},byteLength:{get:function(){return this._byteLength}},classProperty:{get:function(){return this._classProperty}}});HI.prototype.get=function(e){let t=r$e(this,e);return t=this._classProperty.handleNoData(t),l(t)?(t=this._classProperty.normalize(t),t=g$e(this,t),this._classProperty.unpackVectorAndMatrixTypes(t)):(t=this._classProperty.default,this._classProperty.unpackVectorAndMatrixTypes(t))};HI.prototype.set=function(e,t){let n=this._classProperty;t=n.packVectorAndMatrixTypes(t),t=y$e(this,t),t=n.unnormalize(t),s$e(this,e,t)};HI.prototype.getTypedArray=function(){if(l(this._values))return this._values.typedArray};function Jxe(e){if(!Array.isArray(e)||!l(e.slice))return e;let t=[];for(let n=0;n>3,i=e%8;return(t.typedArray[n]>>i&1)===1}function l$e(e,t,n){let i=e>>3,o=e%8;n?t.typedArray[i]|=1<0,s=!0;for(let a=0;a<8;++a){let c=n.getUint8(i+a);r&&(s?c!==0&&(c=~(c-1)&255,s=!1):c=~c&255),o+=c*Math.pow(256,a)}return r&&(o=-o),o}function u$e(e,t){let n=t.dataView,i=e*8,o=BigInt(0),r=(n.getUint8(i+7)&128)>0,s=!0;for(let a=0;a<8;++a){let c=n.getUint8(i+a);r&&(s?c!==0&&(c=~(c-1)&255,s=!1):c=~c&255),o+=BigInt(c)*(BigInt(1)<wt.maximumTextureSize||a>wt.maximumTextureSize){xt("PropertyTableTextureExceedsMaximumSize",`Cannot create a texture for the property table "${e.name}" because it exceeds the maximum texture size of ${wt.maximumTextureSize}.`);return}let c=R$e(s,r),d=new Ot({wrapS:pn.CLAMP_TO_EDGE,wrapT:pn.CLAMP_TO_EDGE,minificationFilter:Ht.NEAREST,magnificationFilter:$n.NEAREST});return vt.create({context:i,pixelFormat:Qe.RGBA,pixelDatatype:Ue.UNSIGNED_BYTE,sampler:d,flipY:!1,source:{width:r,height:a,arrayBufferView:c}})}function S$e(e,t,n,i){let o=[],r=n.properties;for(let[s,a]of Object.entries(r)){if(!a.isGpuCompatible(JI))continue;let c=e[s],d=l(c)?t[c.values]:Z$e(a,i),u=d.length,m=a.cpuBytesPerElement(),p=u/m;if(p!==i)throw new ae(`Property with ID: "${s}" has (${p}), which does not match number of features in the property table: (${i}).`);o.push({view:d,classProperty:a})}return o}function Z$e(e,t){let n=e.noData,i=St.getComponentCount(e.type),o=e.isArray?e.arrayLength:1;e.type===St.ENUM&&(n=e.enumType.valuesByName[n]),i===1&&(n=[n]),o===1&&(n=[n]);let r=e.cpuBytesPerElement(),s=Nt.getSizeInBytes(e.valueType),a=new ArrayBuffer(r*t),c=new DataView(a),d=Nt.getDataViewAccessors(c,e.valueType);for(let u=0;u96?_-97:_>64?_-39:_+4}for(var S=0,y=0;y=3),c(n.exports.meshopt_spatialSortRemap,b,b.length/f,f*4)},encodeVertexBuffer:function(b,f,y){r(y>0&&y<=256),r(y%4==0);var _=n.exports.meshopt_encodeVertexBufferBound(f,y);return d(n.exports.meshopt_encodeVertexBuffer,_,b,f,y)},encodeVertexBufferLevel:function(b,f,y,_,S){r(y>0&&y<=256),r(y%4==0),r(_>=0&&_<=3),r(S===void 0||S==0||S==1);var Z=n.exports.meshopt_encodeVertexBufferBound(f,y);return d(n.exports.meshopt_encodeVertexBufferLevel,Z,b,f,y,_,S===void 0?-1:S)},encodeIndexBuffer:function(b,f,y){r(y==2||y==4),r(f%3==0);var _=m(b,y),S=n.exports.meshopt_encodeIndexBufferBound(f,u(_)+1);return d(n.exports.meshopt_encodeIndexBuffer,S,_,f,4)},encodeIndexSequence:function(b,f,y){r(y==2||y==4);var _=m(b,y),S=n.exports.meshopt_encodeIndexSequenceBound(f,u(_)+1);return d(n.exports.meshopt_encodeIndexSequence,S,_,f,4)},encodeGltfBuffer:function(b,f,y,_,S){var Z={ATTRIBUTES:this.encodeVertexBufferLevel,TRIANGLES:this.encodeIndexBuffer,INDICES:this.encodeIndexSequence};return r(Z[_]),Z[_](b,f,y,2,S===void 0?0:S)},encodeFilterOct:function(b,f,y,_){return r(y==4||y==8),r(_>=2&&_<=16),p(n.exports.meshopt_encodeFilterOct,b,f,y,_,16)},encodeFilterQuat:function(b,f,y,_){return r(y==8),r(_>=4&&_<=16),p(n.exports.meshopt_encodeFilterQuat,b,f,y,_,16)},encodeFilterExp:function(b,f,y,_,S){r(y>0&&y%4==0),r(_>=1&&_<=24);var Z={Separate:0,SharedVector:1,SharedComponent:2,Clamped:3};return r(!S||S in Z),p(n.exports.meshopt_encodeFilterExp,b,f,y,_,y,S?Z[S]:1)},encodeFilterColor:function(b,f,y,_){return r(y==4||y==8),r(_>=2&&_<=16),p(n.exports.meshopt_encodeFilterColor,b,f,y,_,16)}}})();var U2n=x(T(),1),nx=(function(){var e="b9H79Tebbbe8Fv9Gbb9Gvuuuuueu9Giuuub9Geueu9Giuuueuixkbeeeddddillviebeoweuecj:Gdkr;Neqo9TW9T9VV95dbH9F9F939H79T9F9J9H229F9Jt9VV7bb8A9TW79O9V9Wt9F9KW9J9V9KW9wWVtW949c919M9MWVbeY9TW79O9V9Wt9F9KW9J9V9KW69U9KW949c919M9MWVbdE9TW79O9V9Wt9F9KW9J9V9KW69U9KW949tWG91W9U9JWbiL9TW79O9V9Wt9F9KW9J9V9KWS9P2tWV9p9JtblK9TW79O9V9Wt9F9KW9J9V9KWS9P2tWV9r919HtbvL9TW79O9V9Wt9F9KW9J9V9KWS9P2tWVT949WboY9TW79O9V9Wt9F9KW9J9V9KWS9P2tWVJ9V29VVbrl79IV9Rbwq1Zkdbk:kYi5ud9:du8Jjjjjbcjq9Rgv8Kjjjjbc9:hodnalTmbcuhoaiRbbgrc;WeGc:Ge9hmbarcsGgwce0mbc9:hoalcufadcd4cbawEgDadfgrcKcaawEgqaraq0Egk6mbaicefhxcj;abad9Uc;WFbGcjdadca0EhmaialfgPar9Rgoadfhsavaoadz:jjjjbgzceVhHcbhOdndninaeaO9nmeaPax9RaD6mdamaeaO9RaOamfgoae6EgAcsfglc9WGhCaAcethXaxaDfhiaOaeaoaeao6E9RhQalcl4cifcd4hLazcjdfaAfhKcbhYabaOad2fg8AhEaHh3incbh5dnawTmbaxaYcd4fRbbh5kcbh8Eazcjdfhqinaih8Fdndndndna5a8Ecet4ciGgoc9:fPdebdkaPa8F9RaA6mrazcjdfa8EaA2fa8FaAz:jjjjb8Aa8FaAfhixdkazcjdfa8EaA2fcbaAz:kjjjb8Aa8FhixekaPa8F9RaL6mva8FaLfhidnaCTmbaPai9RcK6mbaocdtc:q:G:cjbfcj:G:cjbawEhaczhrcbhlinargoc9Wfghaqfhrdndndndndndnaaa8Fahco4fRbbalcoG4ciGcdtfydbPDbedvivvvlvkar9cb83bwar9cb83bbxlkarcbaiRbdai8Xbb9c:c:qj:bw9:9c:q;c1:I1e:d9c:b:c:e1z9:gg9cjjjjjz:dg8J9qE86bbaqaofgrcGfcbaicdfa8J9c8N1:NfghRbbag9cjjjjjw:dg8J9qE86bbarcVfcbaha8J9c8M1:NfghRbbag9cjjjjjl:dg8J9qE86bbarc7fcbaha8J9c8L1:NfghRbbag9cjjjjjd:dg8J9qE86bbarctfcbaha8J9c8K1:NfghRbbag9cjjjjje:dg8J9qE86bbarc91fcbaha8J9c8J1:NfghRbbag9cjjjj;ab:dg8J9qE86bbarc4fcbaha8J9cg1:NfghRbbag9cjjjja:dg8J9qE86bbarc93fcbaha8J9ch1:NfghRbbag9cjjjjz:dgg9qE86bbarc94fcbahag9ca1:NfghRbbai8Xbe9c:c:qj:bw9:9c:q;c1:I1e:d9c:b:c:e1z9:gg9cjjjjjz:dg8J9qE86bbarc95fcbaha8J9c8N1:NfgiRbbag9cjjjjjw:dg8J9qE86bbarc96fcbaia8J9c8M1:NfgiRbbag9cjjjjjl:dg8J9qE86bbarc97fcbaia8J9c8L1:NfgiRbbag9cjjjjjd:dg8J9qE86bbarc98fcbaia8J9c8K1:NfgiRbbag9cjjjjje:dg8J9qE86bbarc99fcbaia8J9c8J1:NfgiRbbag9cjjjj;ab:dg8J9qE86bbarc9:fcbaia8J9cg1:NfgiRbbag9cjjjja:dg8J9qE86bbarcufcbaia8J9ch1:NfgiRbbag9cjjjjz:dgg9qE86bbaiag9ca1:NfhixikaraiRblaiRbbghco4g8Ka8KciSg8KE86bbaqaofgrcGfaiclfa8Kfg8KRbbahcl4ciGg8La8LciSg8LE86bbarcVfa8Ka8Lfg8KRbbahcd4ciGg8La8LciSg8LE86bbarc7fa8Ka8Lfg8KRbbahciGghahciSghE86bbarctfa8Kahfg8KRbbaiRbeghco4g8La8LciSg8LE86bbarc91fa8Ka8Lfg8KRbbahcl4ciGg8La8LciSg8LE86bbarc4fa8Ka8Lfg8KRbbahcd4ciGg8La8LciSg8LE86bbarc93fa8Ka8Lfg8KRbbahciGghahciSghE86bbarc94fa8Kahfg8KRbbaiRbdghco4g8La8LciSg8LE86bbarc95fa8Ka8Lfg8KRbbahcl4ciGg8La8LciSg8LE86bbarc96fa8Ka8Lfg8KRbbahcd4ciGg8La8LciSg8LE86bbarc97fa8Ka8Lfg8KRbbahciGghahciSghE86bbarc98fa8KahfghRbbaiRbigico4g8Ka8KciSg8KE86bbarc99faha8KfghRbbaicl4ciGg8Ka8KciSg8KE86bbarc9:faha8KfghRbbaicd4ciGg8Ka8KciSg8KE86bbarcufaha8KfgrRbbaiciGgiaiciSgiE86bbaraifhixdkaraiRbwaiRbbghcl4g8Ka8KcsSg8KE86bbaqaofgrcGfaicwfa8Kfg8KRbbahcsGghahcsSghE86bbarcVfa8KahfghRbbaiRbeg8Kcl4g8La8LcsSg8LE86bbarc7faha8LfghRbba8KcsGg8Ka8KcsSg8KE86bbarctfaha8KfghRbbaiRbdg8Kcl4g8La8LcsSg8LE86bbarc91faha8LfghRbba8KcsGg8Ka8KcsSg8KE86bbarc4faha8KfghRbbaiRbig8Kcl4g8La8LcsSg8LE86bbarc93faha8LfghRbba8KcsGg8Ka8KcsSg8KE86bbarc94faha8KfghRbbaiRblg8Kcl4g8La8LcsSg8LE86bbarc95faha8LfghRbba8KcsGg8Ka8KcsSg8KE86bbarc96faha8KfghRbbaiRbvg8Kcl4g8La8LcsSg8LE86bbarc97faha8LfghRbba8KcsGg8Ka8KcsSg8KE86bbarc98faha8KfghRbbaiRbog8Kcl4g8La8LcsSg8LE86bbarc99faha8LfghRbba8KcsGg8Ka8KcsSg8KE86bbarc9:faha8KfghRbbaiRbrgicl4g8Ka8KcsSg8KE86bbarcufaha8KfgrRbbaicsGgiaicsSgiE86bbaraifhixekarai8Pbw83bwarai8Pbb83bbaiczfhikdnaoaC9pmbalcdfhlaoczfhraPai9RcL0mekkaoaC6moaimexokaCmva8FTmvkaqaAfhqa8Ecefg8Ecl9hmbkdndndndnawTmbasaYcd4fRbbgociGPlbedrbkaATmdazaYfh8Fazcjdfhhcbh8EaEhaina8FRbbhraahocbhlinaoahalfRbbgqce4cbaqceG9R7arfgr86bbaoadfhoaAalcefgl9hmbkaacefhaa8Fcefh8FahaAfhha8Ecefg8Ecl9hmbxikkaATmeazaYfhaazcjdfhhcbhoceh8EaKh8FinaEaofhlaa8Vbbhrcbhoinala8FaofRbbcwtahaofRbbgqVc;:FiGce4cbaqceG9R7arfgr87bbaladfhlaQaocefgofmbka8FaXfh8FcdhoaacdfhaahaXfhha8EceGhlcbh8EalmbxdkkaATmbaocl4h8EazaYfRbbhqcwhoa3hlinalRbbaotaqVhqalcefhlaocwfgoca9hmbkcbhhaEh8FaKhainazcjdfahfRbbhrcwhoaahlinalRbbaotarVhralaAfhlaocwfgoca9hmbkara8E94aq7hqcbhoa8Fhlinalaqao486bbalcefhlaocwfgoca9hmbka8Fadfh8FaacefhaahcefghaA9hmbkkaEclfhEa3clfh3aYclfgYad6mbkaza8AaAcufad2fadz:jjjjb8AaAaOfhOaihxaimbkc9:hoxdkcbc99aPax9RakSEhoxekc9:hokavcjqf8Kjjjjbaok:ysezu8Jjjjjbc;ae9Rgv8Kjjjjbc9:hodnalaeci9UgrcHf6mbcuhoaiRbbgwc;WeGc;Ge9hmbawcsGgDce0mbavc;abfcFecjez:kjjjb8Aav9cu83iUav9cu83i8Wav9cu83iyav9cu83iaav9cu83iKav9cu83izav9cu83iwav9cu83ibaialfc9WfhqaicefgwarfhldnaeTmbcmcsaDceSEhkcbhxcbhmcbhrcbhicbhoindnalaq9nmbc9:hoxikdndnawRbbgDc;Ve0mbavc;abfaoaDcu7gPcl4fcsGcitfgsydlhzasydbhHdndnaDcsGgsak9pmbavaiaPfcsGcdtfydbaxasEhDaxasTgOfhxxekdndnascsSmbcehOasc987asamffcefhDxekalcefhDal8SbbgscFeGhPdndnascu9mmbaDhlxekalcvfhlaPcFbGhPcrhsdninaD8SbbgOcFbGastaPVhPaOcu9kmeaDcefhDascrfgsc8J9hmbxdkkaDcefhlkcehOaPce4cbaPceG9R7amfhDkaDhmkavc;abfaocitfgsaDBdbasazBdlavaicdtfaDBdbavc;abfaocefcsGcitfgsaHBdbasaDBdlaocdfhoaOaifhidnadcd9hmbabarcetfgsaH87ebasclfaD87ebascdfaz87ebxdkabarcdtfgsaHBdbascwfaDBdbasclfazBdbxekdnaDcpe0mbavaiaqaDcsGfRbbgscl4gP9RcsGcdtfydbaxcefgOaPEhDavaias9RcsGcdtfydbaOaPTgzfgOascsGgPEhsaPThPdndnadcd9hmbabarcetfgHax87ebaHclfas87ebaHcdfaD87ebxekabarcdtfgHaxBdbaHcwfasBdbaHclfaDBdbkavaicdtfaxBdbavc;abfaocitfgHaDBdbaHaxBdlavaicefgicsGcdtfaDBdbavc;abfaocefcsGcitfgHasBdbaHaDBdlavaiazfgicsGcdtfasBdbavc;abfaocdfcsGcitfgDaxBdbaDasBdlaocifhoaiaPfhiaOaPfhxxekaxcbalRbbgsEgHaDc;:eSgDfhOascsGhAdndnascl4gCmbaOcefhzxekaOhzavaiaC9RcsGcdtfydbhOkdndnaAmbazcefhxxekazhxavaias9RcsGcdtfydbhzkdndnaDTmbalcefhDxekalcdfhDal8SbegPcFeGhsdnaPcu9kmbalcofhHascFbGhscrhldninaD8SbbgPcFbGaltasVhsaPcu9kmeaDcefhDalcrfglc8J9hmbkaHhDxekaDcefhDkasce4cbasceG9R7amfgmhHkdndnaCcsSmbaDhsxekaDcefhsaD8SbbglcFeGhPdnalcu9kmbaDcvfhOaPcFbGhPcrhldninas8SbbgDcFbGaltaPVhPaDcu9kmeascefhsalcrfglc8J9hmbkaOhsxekascefhskaPce4cbaPceG9R7amfgmhOkdndnaAcsSmbashlxekascefhlas8SbbgDcFeGhPdnaDcu9kmbascvfhzaPcFbGhPcrhDdninal8SbbgscFbGaDtaPVhPascu9kmealcefhlaDcrfgDc8J9hmbkazhlxekalcefhlkaPce4cbaPceG9R7amfgmhzkdndnadcd9hmbabarcetfgDaH87ebaDclfaz87ebaDcdfaO87ebxekabarcdtfgDaHBdbaDcwfazBdbaDclfaOBdbkavc;abfaocitfgDaOBdbaDaHBdlavaicdtfaHBdbavc;abfaocefcsGcitfgDazBdbaDaOBdlavaicefgicsGcdtfaOBdbavc;abfaocdfcsGcitfgDaHBdbaDazBdlavaiaCTaCcsSVfgicsGcdtfazBdbaiaATaAcsSVfhiaocifhokawcefhwaocsGhoaicsGhiarcifgrae6mbkkcbc99alaqSEhokavc;aef8Kjjjjbaok:clevu8Jjjjjbcz9Rhvdnalaecvf9pmbc9:skdnaiRbbc;:eGc;qeSmbcuskav9cb83iwaicefhoaialfc98fhrdnaeTmbdnadcdSmbcbhwindnaoar6mbc9:skaocefhlao8SbbgicFeGhddndnaicu9mmbalhoxekaocvfhoadcFbGhdcrhidninal8SbbgDcFbGaitadVhdaDcu9kmealcefhlaicrfgic8J9hmbxdkkalcefhokabawcdtfadc8Etc8F91adcd47avcwfadceGcdtVglydbfgiBdbalaiBdbawcefgwae9hmbxdkkcbhwindnaoar6mbc9:skaocefhlao8SbbgicFeGhddndnaicu9mmbalhoxekaocvfhoadcFbGhdcrhidninal8SbbgDcFbGaitadVhdaDcu9kmealcefhlaicrfgic8J9hmbxdkkalcefhokabawcetfadc8Etc8F91adcd47avcwfadceGcdtVglydbfgi87ebalaiBdbawcefgwae9hmbkkcbc99aoarSEk:Lvoeue99dud99eud99dndnadcl9hmbaeTmeindndnabcdfgd8Sbb:Yab8Sbbgi:Ygl:l:tabcefgv8Sbbgo:Ygr:l:tgwJbb;:9cawawNJbbbbawawJbbbb9GgDEgq:mgkaqaicb9iEalMgwawNakaqaocb9iEarMgqaqNMM:r:vglNJbbbZJbbb:;aDEMgr:lJbbb9p9DTmbar:Ohixekcjjjj94hikadai86bbdndnaqalNJbbbZJbbb:;aqJbbbb9GEMgq:lJbbb9p9DTmbaq:Ohdxekcjjjj94hdkavad86bbdndnawalNJbbbZJbbb:;awJbbbb9GEMgw:lJbbb9p9DTmbaw:Ohdxekcjjjj94hdkabad86bbabclfhbaecufgembxdkkaeTmbindndnabclfgd8Ueb:Yab8Uebgi:Ygl:l:tabcdfgv8Uebgo:Ygr:l:tgwJb;:FSawawNJbbbbawawJbbbb9GgDEgq:mgkaqaicb9iEalMgwawNakaqaocb9iEarMgqaqNMM:r:vglNJbbbZJbbb:;aDEMgr:lJbbb9p9DTmbar:Ohixekcjjjj94hikadai87ebdndnaqalNJbbbZJbbb:;aqJbbbb9GEMgq:lJbbb9p9DTmbaq:Ohdxekcjjjj94hdkavad87ebdndnawalNJbbbZJbbb:;awJbbbb9GEMgw:lJbbb9p9DTmbaw:Ohdxekcjjjj94hdkabad87ebabcwfhbaecufgembkkk:4ioiue99dud99dud99dnaeTmbcbhiabhlindndnal8Uebgv:YgoJ:ji:1Salcof8UebgrciVgw:Y:vgDNJbbbZJbbb:;avcu9kEMgq:lJbbb9p9DTmbaq:Ohkxekcjjjj94hkkalclf8Uebhvalcdf8UebhxalarcefciGcetfak87ebdndnax:YgqaDNJbbbZJbbb:;axcu9kEMgm:lJbbb9p9DTmbam:Ohxxekcjjjj94hxkabaiarciGgkfcd7cetfax87ebdndnav:YgmaDNJbbbZJbbb:;avcu9kEMgP:lJbbb9p9DTmbaP:Ohvxekcjjjj94hvkalarcufciGcetfav87ebdndnawaw2:ZgPaPMaoaoN:taqaqN:tamamN:tgoJbbbbaoJbbbb9GE:raDNJbbbZMgD:lJbbb9p9DTmbaD:Ohrxekcjjjj94hrkalakcetfar87ebalcwfhlaiclfhiaecufgembkkk9mbdnadcd4ae2gdTmbinababydbgecwtcw91:Yaece91cjjj98Gcjjj;8if::NUdbabclfhbadcufgdmbkkk:Tvirud99eudndnadcl9hmbaeTmeindndnabRbbgiabcefgl8Sbbgvabcdfgo8Sbbgrf9R:YJbbuJabcifgwRbbgdce4adVgDcd4aDVgDcl4aDVgD:Z:vgqNJbbbZMgk:lJbbb9p9DTmbak:Ohxxekcjjjj94hxkaoax86bbdndnaraif:YaqNJbbbZMgk:lJbbb9p9DTmbak:Ohoxekcjjjj94hokalao86bbdndnavaifar9R:YaqNJbbbZMgk:lJbbb9p9DTmbak:Ohixekcjjjj94hikabai86bbdndnaDadcetGadceGV:ZaqNJbbbZMgq:lJbbb9p9DTmbaq:Ohdxekcjjjj94hdkawad86bbabclfhbaecufgembxdkkaeTmbindndnab8Vebgiabcdfgl8Uebgvabclfgo8Uebgrf9R:YJbFu9habcofgw8Vebgdce4adVgDcd4aDVgDcl4aDVgDcw4aDVgD:Z:vgqNJbbbZMgk:lJbbb9p9DTmbak:Ohxxekcjjjj94hxkaoax87ebdndnaraif:YaqNJbbbZMgk:lJbbb9p9DTmbak:Ohoxekcjjjj94hokalao87ebdndnavaifar9R:YaqNJbbbZMgk:lJbbb9p9DTmbak:Ohixekcjjjj94hikabai87ebdndnaDadcetGadceGV:ZaqNJbbbZMgq:lJbbb9p9DTmbaq:Ohdxekcjjjj94hdkawad87ebabcwfhbaecufgembkkk9teiucbcbyd:K:G:cjbgeabcifc98GfgbBd:K:G:cjbdndnabZbcztgd9nmbcuhiabad9RcFFifcz4nbcuSmekaehikaik;LeeeudndnaeabVciGTmbabhixekdndnadcz9pmbabhixekabhiinaiaeydbBdbaiclfaeclfydbBdbaicwfaecwfydbBdbaicxfaecxfydbBdbaeczfheaiczfhiadc9Wfgdcs0mbkkadcl6mbinaiaeydbBdbaeclfheaiclfhiadc98fgdci0mbkkdnadTmbinaiaeRbb86bbaicefhiaecefheadcufgdmbkkabk;aeedudndnabciGTmbabhixekaecFeGc:b:c:ew2hldndnadcz9pmbabhixekabhiinaialBdbaicxfalBdbaicwfalBdbaiclfalBdbaiczfhiadc9Wfgdcs0mbkkadcl6mbinaialBdbaiclfhiadc98fgdci0mbkkdnadTmbinaiae86bbaicefhiadcufgdmbkkabkk83dbcj:Gdk8Kbbbbdbbblbbbwbbbbbbbebbbdbbblbbbwbbbbc:K:Gdkl8W:qbb",t="b9H79TebbbeKl9Gbb9Gvuuuuueu9Giuuub9Geueuixkbbebeeddddilve9Weeeviebeoweuecj:Gdkr;Neqo9TW9T9VV95dbH9F9F939H79T9F9J9H229F9Jt9VV7bb8A9TW79O9V9Wt9F9KW9J9V9KW9wWVtW949c919M9MWVbdY9TW79O9V9Wt9F9KW9J9V9KW69U9KW949c919M9MWVblE9TW79O9V9Wt9F9KW9J9V9KW69U9KW949tWG91W9U9JWbvL9TW79O9V9Wt9F9KW9J9V9KWS9P2tWV9p9JtboK9TW79O9V9Wt9F9KW9J9V9KWS9P2tWV9r919HtbrL9TW79O9V9Wt9F9KW9J9V9KWS9P2tWVT949WbwY9TW79O9V9Wt9F9KW9J9V9KWS9P2tWVJ9V29VVbDl79IV9Rbqq:59Dklbzik94evu8Jjjjjbcz9Rhbcbheincbhdcbhiinabcwfadfaicjuaead4ceGglE86bbaialfhiadcefgdcw9hmbkaeai86b:q:W:cjbaecitab8Piw83i:q:G:cjbaecefgecjd9hmbkk:SBlEud97dur978Jjjjjbcj;kb9Rgv8Kjjjjbc9:hodnalTmbcuhoaiRbbgrc;WeGc:Ge9hmbarcsGgwce0mbc9:hoalcufadcd4cbawEgDadfgrcKcaawEgqaraq0Egk6mbaialfgxar9RhodnadTgmmbavaoad;8qbbkaicefhPcj;abad9Uc;WFbGcjdadca0EhsdndndnadTmbaoadfhzcbhHinaeaH9nmdaxaP9RaD6miabaHad2fgOavcjdfasaeaH9RaHasfae6EgAaAcsfgoc9WGgCSEhXaPaDfhQaocl4cifcd4hLavcj;cbfaCcetfhKavcj;cbfaCci2fhYavcj;cbfaCfh8AcbhEaoc;ab6h3incbh5dnawTmbaPaEcd4fRbbh5kcbh8Eavcj;cbfh8Findndndndna5a8Ecet4ciGgoc9:fPdebdkaxaQ9RaC6mwdnaCTmbavcj;cbfa8EaC2faQaC;8qbbkaQaAfhQxdkaCTmeavcj;cbfa8EaC2fcbaC;8kbxekaxaQ9RaL6moaoclVcbawEhraQaLfhocbhidna3mbaxao9Rc;Gb6mbcbhlina8FalfhidndndndndndnaQalco4fRbbgqciGarfPDbedibledibkaipxbbbbbbbbbbbbbbbbpklbxlkaiaopbblaopbbbgaclp:meaapmbzeHdOiAlCvXoQrLgacdp:meaapmbzeHdOiAlCvXoQrLpxiiiiiiiiiiiiiiiip9oghpxiiiiiiiiiiiiiiiip8Jgap5b9cjF;8;4;W;G;ab9:9cU1:Nggcitpbi:q:G:cjbagRb:q:W:cjbggpsaap5e9cjF;8;4;W;G;ab9:9cU1:Ng8Jcitpbi:q:G:cjbp9UpmbedilvorzHOACXQLpPahaap9spklbagaoclffa8JRb:q:W:cjbfhoxikaiaopbbwaopbbbgaclp:meaapmbzeHdOiAlCvXoQrLpxssssssssssssssssp9oghpxssssssssssssssssp8Jgap5b9cjF;8;4;W;G;ab9:9cU1:Nggcitpbi:q:G:cjbagRb:q:W:cjbggpsaap5e9cjF;8;4;W;G;ab9:9cU1:Ng8Jcitpbi:q:G:cjbp9UpmbedilvorzHOACXQLpPahaap9spklbagaocwffa8JRb:q:W:cjbfhoxdkaiaopbbbpklbaoczfhoxekaiaopbbdaoRbbggcitpbi:q:G:cjbagRb:q:W:cjbggpsaoRbeg8Jcitpbi:q:G:cjbp9UpmbedilvorzHOACXQLpPpklbagaocdffa8JRb:q:W:cjbfhokdndndndndndnaqcd4ciGarfPDbedibledibkaiczfpxbbbbbbbbbbbbbbbbpklbxlkaiczfaopbblaopbbbgaclp:meaapmbzeHdOiAlCvXoQrLgacdp:meaapmbzeHdOiAlCvXoQrLpxiiiiiiiiiiiiiiiip9oghpxiiiiiiiiiiiiiiiip8Jgap5b9cjF;8;4;W;G;ab9:9cU1:Nggcitpbi:q:G:cjbagRb:q:W:cjbggpsaap5e9cjF;8;4;W;G;ab9:9cU1:Ng8Jcitpbi:q:G:cjbp9UpmbedilvorzHOACXQLpPahaap9spklbagaoclffa8JRb:q:W:cjbfhoxikaiczfaopbbwaopbbbgaclp:meaapmbzeHdOiAlCvXoQrLpxssssssssssssssssp9oghpxssssssssssssssssp8Jgap5b9cjF;8;4;W;G;ab9:9cU1:Nggcitpbi:q:G:cjbagRb:q:W:cjbggpsaap5e9cjF;8;4;W;G;ab9:9cU1:Ng8Jcitpbi:q:G:cjbp9UpmbedilvorzHOACXQLpPahaap9spklbagaocwffa8JRb:q:W:cjbfhoxdkaiczfaopbbbpklbaoczfhoxekaiczfaopbbdaoRbbggcitpbi:q:G:cjbagRb:q:W:cjbggpsaoRbeg8Jcitpbi:q:G:cjbp9UpmbedilvorzHOACXQLpPpklbagaocdffa8JRb:q:W:cjbfhokdndndndndndnaqcl4ciGarfPDbedibledibkaicafpxbbbbbbbbbbbbbbbbpklbxlkaicafaopbblaopbbbgaclp:meaapmbzeHdOiAlCvXoQrLgacdp:meaapmbzeHdOiAlCvXoQrLpxiiiiiiiiiiiiiiiip9oghpxiiiiiiiiiiiiiiiip8Jgap5b9cjF;8;4;W;G;ab9:9cU1:Nggcitpbi:q:G:cjbagRb:q:W:cjbggpsaap5e9cjF;8;4;W;G;ab9:9cU1:Ng8Jcitpbi:q:G:cjbp9UpmbedilvorzHOACXQLpPahaap9spklbagaoclffa8JRb:q:W:cjbfhoxikaicafaopbbwaopbbbgaclp:meaapmbzeHdOiAlCvXoQrLpxssssssssssssssssp9oghpxssssssssssssssssp8Jgap5b9cjF;8;4;W;G;ab9:9cU1:Nggcitpbi:q:G:cjbagRb:q:W:cjbggpsaap5e9cjF;8;4;W;G;ab9:9cU1:Ng8Jcitpbi:q:G:cjbp9UpmbedilvorzHOACXQLpPahaap9spklbagaocwffa8JRb:q:W:cjbfhoxdkaicafaopbbbpklbaoczfhoxekaicafaopbbdaoRbbggcitpbi:q:G:cjbagRb:q:W:cjbggpsaoRbeg8Jcitpbi:q:G:cjbp9UpmbedilvorzHOACXQLpPpklbagaocdffa8JRb:q:W:cjbfhokdndndndndndnaqco4arfPDbedibledibkaic8Wfpxbbbbbbbbbbbbbbbbpklbxlkaic8Wfaopbblaopbbbgaclp:meaapmbzeHdOiAlCvXoQrLgacdp:meaapmbzeHdOiAlCvXoQrLpxiiiiiiiiiiiiiiiip9oghpxiiiiiiiiiiiiiiiip8Jgap5b9cjF;8;4;W;G;ab9:9cU1:Ngicitpbi:q:G:cjbaiRb:q:W:cjbgipsaap5e9cjF;8;4;W;G;ab9:9cU1:Ngqcitpbi:q:G:cjbp9UpmbedilvorzHOACXQLpPahaap9spklbaiaoclffaqRb:q:W:cjbfhoxikaic8Wfaopbbwaopbbbgaclp:meaapmbzeHdOiAlCvXoQrLpxssssssssssssssssp9oghpxssssssssssssssssp8Jgap5b9cjF;8;4;W;G;ab9:9cU1:Ngicitpbi:q:G:cjbaiRb:q:W:cjbgipsaap5e9cjF;8;4;W;G;ab9:9cU1:Ngqcitpbi:q:G:cjbp9UpmbedilvorzHOACXQLpPahaap9spklbaiaocwffaqRb:q:W:cjbfhoxdkaic8Wfaopbbbpklbaoczfhoxekaic8WfaopbbdaoRbbgicitpbi:q:G:cjbaiRb:q:W:cjbgipsaoRbegqcitpbi:q:G:cjbp9UpmbedilvorzHOACXQLpPpklbaiaocdffaqRb:q:W:cjbfhokalc;abfhialcjefaC0meaihlaxao9Rc;Fb0mbkkdnaiaC9pmbaici4hlinaxao9RcK6mwa8FaifhqdndndndndndnaQaico4fRbbalcoG4ciGarfPDbedibledibkaqpxbbbbbbbbbbbbbbbbpkbbxlkaqaopbblaopbbbgaclp:meaapmbzeHdOiAlCvXoQrLgacdp:meaapmbzeHdOiAlCvXoQrLpxiiiiiiiiiiiiiiiip9oghpxiiiiiiiiiiiiiiiip8Jgap5b9cjF;8;4;W;G;ab9:9cU1:Nggcitpbi:q:G:cjbagRb:q:W:cjbggpsaap5e9cjF;8;4;W;G;ab9:9cU1:Ng8Jcitpbi:q:G:cjbp9UpmbedilvorzHOACXQLpPahaap9spkbbagaoclffa8JRb:q:W:cjbfhoxikaqaopbbwaopbbbgaclp:meaapmbzeHdOiAlCvXoQrLpxssssssssssssssssp9oghpxssssssssssssssssp8Jgap5b9cjF;8;4;W;G;ab9:9cU1:Nggcitpbi:q:G:cjbagRb:q:W:cjbggpsaap5e9cjF;8;4;W;G;ab9:9cU1:Ng8Jcitpbi:q:G:cjbp9UpmbedilvorzHOACXQLpPahaap9spkbbagaocwffa8JRb:q:W:cjbfhoxdkaqaopbbbpkbbaoczfhoxekaqaopbbdaoRbbggcitpbi:q:G:cjbagRb:q:W:cjbggpsaoRbeg8Jcitpbi:q:G:cjbp9UpmbedilvorzHOACXQLpPpkbbagaocdffa8JRb:q:W:cjbfhokalcdfhlaiczfgiaC6mbkkaohQaoTmoka8FaCfh8Fa8Ecefg8Ecl9hmbkdndndndnawTmbazaEcd4fRbbglciGPlbedwbkaCTmdaXaEfhlavaEfpbdbh8Kcbhoinalavcj;cbfaofpblbg8La8Aaofpblbg8MpmbzeHdOiAlCvXoQrLg8NaKaofpblbgyaYaofpblbg8PpmbzeHdOiAlCvXoQrLgIpmbezHdiOAlvCXorQLgacep9Taapxeeeeeeeeeeeeeeeeghp9op9Hp9rgaa8Kp9Ug8Kp9Abbbaladfgla8K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g8Kp9Abbbaladfgla8Ka8NaIpmwDKYqk8AExm35Ps8E8Fgacep:neaaahp9op:bep9rgap:oeg8Kp9Abbbaladfgla8Kaaaapmlvorlvorlvorlvorp:oeg8Kp9Abbbaladfgla8KaaaapmwDqkwDqkwDqkwDqkp:oeg8Kp9Abbbaladfgla8KaaaapmxmPsxmPsxmPsxmPsp:oeg8Kp9Abbbaladfgla8Ka8La8MpmwKDYq8AkEx3m5P8Es8Fg8Laya8PpmwKDYq8AkEx3m5P8Es8Fg8MpmbezHdiOAlvCXorQLgacep:neaaahp9op:bep9rgap:oeg8Kp9Abbbaladfgla8Kaaaapmlvorlvorlvorlvorp:oeg8Kp9Abbbaladfgla8KaaaapmwDqkwDqkwDqkwDqkp:oeg8Kp9Abbbaladfgla8KaaaapmxmPsxmPsxmPsxmPsp:oeg8Kp9Abbbaladfgla8Ka8La8MpmwDKYqk8AExm35Ps8E8Fgacep:neaaahp9op:bep9rgap:oeghp9Abbbaladfglahaaaapmlvorlvorlvorlvorp:oeghp9AbbbaladfglahaaaapmwDqkwDqkwDqkwDqkp:oeghp9AbbbaladfglahaaaapmxmPsxmPsxmPsxmPsp:oeg8Kp9AbbbaladfhlaoczfgoaC6mbxdkkaCTmbaXaEfhrcbhocbalcl4gl9Rc8FGhiavaEfpbdbhhinaravcj;cbfaofpblbg8Ka8Aaofpblbg8LpmbzeHdOiAlCvXoQrLg8MaKaofpblbg8NaYaofpblbgypmbzeHdOiAlCvXoQrLg8PpmbezHdiOAlvCXorQLgaaip:Reaaalp:Tep9qgaahp9rghp9Abbbaradfgrahaaaapmlvorlvorlvorlvorp9rghp9AbbbaradfgrahaaaapmwDqkwDqkwDqkwDqkp9rghp9AbbbaradfgrahaaaapmxmPsxmPsxmPsxmPsp9rghp9Abbbaradfgraha8Ma8PpmwDKYqk8AExm35Ps8E8Fgaaip:Reaaalp:Tep9qgap9rghp9Abbbaradfgrahaaaapmlvorlvorlvorlvorp9rghp9AbbbaradfgrahaaaapmwDqkwDqkwDqkwDqkp9rghp9AbbbaradfgrahaaaapmxmPsxmPsxmPsxmPsp9rghp9Abbbaradfgraha8Ka8LpmwKDYq8AkEx3m5P8Es8Fg8Ka8NaypmwKDYq8AkEx3m5P8Es8Fg8LpmbezHdiOAlvCXorQLgaaip:Reaaalp:Tep9qgap9rghp9Abbbaradfgrahaaaapmlvorlvorlvorlvorp9rghp9AbbbaradfgrahaaaapmwDqkwDqkwDqkwDqkp9rghp9AbbbaradfgrahaaaapmxmPsxmPsxmPsxmPsp9rghp9Abbbaradfgraha8Ka8LpmwDKYqk8AExm35Ps8E8Fgaaip:Reaaalp:Tep9qgap9rghp9Abbbaradfgrahaaaapmlvorlvorlvorlvorp9rghp9AbbbaradfgrahaaaapmwDqkwDqkwDqkwDqkp9rghp9AbbbaradfgrahaaaapmxmPsxmPsxmPsxmPsp9rghp9AbbbaradfhraoczfgoaC6mbkkaEclfgEad6mbkdnaXavcjdf9hmbaAad2goTmbaOavcjdfao;8qbbkdnammbavaXaAcufad2fad;8qbbkaAaHfhHc9:hoaQhPaQmbxlkkaeTmbaDalfhrcbhocuhlinaralaD9RglfaD6mdasaeao9Raoasfae6Eaofgoae6mbkaial9RhPkcbc99axaP9RakSEhoxekc9:hokavcj;kbf8Kjjjjbaokwbz:bjjjbkNsezu8Jjjjjbc;ae9Rgv8Kjjjjbc9:hodnalaeci9UgrcHf6mbcuhoaiRbbgwc;WeGc;Ge9hmbawcsGgDce0mbavc;abfcFecje;8kbav9cu83iUav9cu83i8Wav9cu83iyav9cu83iaav9cu83iKav9cu83izav9cu83iwav9cu83ibaialfc9WfhqaicefgwarfhldnaeTmbcmcsaDceSEhkcbhxcbhmcbhrcbhicbhoindnalaq9nmbc9:hoxikdndnawRbbgDc;Ve0mbavc;abfaoaDcu7gPcl4fcsGcitfgsydlhzasydbhHdndnaDcsGgsak9pmbavaiaPfcsGcdtfydbaxasEhDaxasTgOfhxxekdndnascsSmbcehOasc987asamffcefhDxekalcefhDal8SbbgscFeGhPdndnascu9mmbaDhlxekalcvfhlaPcFbGhPcrhsdninaD8SbbgOcFbGastaPVhPaOcu9kmeaDcefhDascrfgsc8J9hmbxdkkaDcefhlkcehOaPce4cbaPceG9R7amfhDkaDhmkavc;abfaocitfgsaDBdbasazBdlavaicdtfaDBdbavc;abfaocefcsGcitfgsaHBdbasaDBdlaocdfhoaOaifhidnadcd9hmbabarcetfgsaH87ebasclfaD87ebascdfaz87ebxdkabarcdtfgsaHBdbascwfaDBdbasclfazBdbxekdnaDcpe0mbavaiaqaDcsGfRbbgscl4gP9RcsGcdtfydbaxcefgOaPEhDavaias9RcsGcdtfydbaOaPTgzfgOascsGgPEhsaPThPdndnadcd9hmbabarcetfgHax87ebaHclfas87ebaHcdfaD87ebxekabarcdtfgHaxBdbaHcwfasBdbaHclfaDBdbkavaicdtfaxBdbavc;abfaocitfgHaDBdbaHaxBdlavaicefgicsGcdtfaDBdbavc;abfaocefcsGcitfgHasBdbaHaDBdlavaiazfgicsGcdtfasBdbavc;abfaocdfcsGcitfgDaxBdbaDasBdlaocifhoaiaPfhiaOaPfhxxekaxcbalRbbgsEgHaDc;:eSgDfhOascsGhAdndnascl4gCmbaOcefhzxekaOhzavaiaC9RcsGcdtfydbhOkdndnaAmbazcefhxxekazhxavaias9RcsGcdtfydbhzkdndnaDTmbalcefhDxekalcdfhDal8SbegPcFeGhsdnaPcu9kmbalcofhHascFbGhscrhldninaD8SbbgPcFbGaltasVhsaPcu9kmeaDcefhDalcrfglc8J9hmbkaHhDxekaDcefhDkasce4cbasceG9R7amfgmhHkdndnaCcsSmbaDhsxekaDcefhsaD8SbbglcFeGhPdnalcu9kmbaDcvfhOaPcFbGhPcrhldninas8SbbgDcFbGaltaPVhPaDcu9kmeascefhsalcrfglc8J9hmbkaOhsxekascefhskaPce4cbaPceG9R7amfgmhOkdndnaAcsSmbashlxekascefhlas8SbbgDcFeGhPdnaDcu9kmbascvfhzaPcFbGhPcrhDdninal8SbbgscFbGaDtaPVhPascu9kmealcefhlaDcrfgDc8J9hmbkazhlxekalcefhlkaPce4cbaPceG9R7amfgmhzkdndnadcd9hmbabarcetfgDaH87ebaDclfaz87ebaDcdfaO87ebxekabarcdtfgDaHBdbaDcwfazBdbaDclfaOBdbkavc;abfaocitfgDaOBdbaDaHBdlavaicdtfaHBdbavc;abfaocefcsGcitfgDazBdbaDaOBdlavaicefgicsGcdtfaOBdbavc;abfaocdfcsGcitfgDaHBdbaDazBdlavaiaCTaCcsSVfgicsGcdtfazBdbaiaATaAcsSVfhiaocifhokawcefhwaocsGhoaicsGhiarcifgrae6mbkkcbc99alaqSEhokavc;aef8Kjjjjbaok:clevu8Jjjjjbcz9Rhvdnalaecvf9pmbc9:skdnaiRbbc;:eGc;qeSmbcuskav9cb83iwaicefhoaialfc98fhrdnaeTmbdnadcdSmbcbhwindnaoar6mbc9:skaocefhlao8SbbgicFeGhddndnaicu9mmbalhoxekaocvfhoadcFbGhdcrhidninal8SbbgDcFbGaitadVhdaDcu9kmealcefhlaicrfgic8J9hmbxdkkalcefhokabawcdtfadc8Etc8F91adcd47avcwfadceGcdtVglydbfgiBdbalaiBdbawcefgwae9hmbxdkkcbhwindnaoar6mbc9:skaocefhlao8SbbgicFeGhddndnaicu9mmbalhoxekaocvfhoadcFbGhdcrhidninal8SbbgDcFbGaitadVhdaDcu9kmealcefhlaicrfgic8J9hmbxdkkalcefhokabawcetfadc8Etc8F91adcd47avcwfadceGcdtVglydbfgi87ebalaiBdbawcefgwae9hmbkkcbc99aoarSEk;Toio97eue97aec98Ghedndnadcl9hmbaeTmecbhdinababpbbbgicKp:RecKp:Sep;6eglaicwp:RecKp:Sep;6ealp;Geaiczp:RecKp:Sep;6egvp;Gep;Kep;Legopxbbbbbbbbbbbbbbbbp:2egralpxbbbjbbbjbbbjbbbjgwp9op9rp;Keglpxbb;:9cbb;:9cbb;:9cbb;:9calalp;Meaoaop;Meavaravawp9op9rp;Keglalp;Mep;Kep;Kep;Jep;Negvp;Mepxbbn0bbn0bbn0bbn0grp;KepxFbbbFbbbFbbbFbbbp9oaipxbbbFbbbFbbbFbbbFp9op9qalavp;Mearp;Kecwp:RepxbFbbbFbbbFbbbFbbp9op9qaoavp;Mearp;Keczp:RepxbbFbbbFbbbFbbbFbp9op9qpkbbabczfhbadclfgdae6mbxdkkaeTmbcbhdinabczfgDaDpbbbgipxbbbbbbFFbbbbbbFFgwp9oabpbbbgoaipmbediwDqkzHOAKY8AEgvczp:Reczp:Sep;6eglaoaipmlvorxmPsCXQL358E8FpxFubbFubbFubbFubbp9op;6eavczp:Sep;6egvp;Gealp;Gep;Kep;Legipxbbbbbbbbbbbbbbbbp:2egralpxbbbjbbbjbbbjbbbjgqp9op9rp;Keglpxb;:FSb;:FSb;:FSb;:FSalalp;Meaiaip;Meavaravaqp9op9rp;Keglalp;Mep;Kep;Kep;Jep;Negvp;Mepxbbn0bbn0bbn0bbn0grp;KepxFFbbFFbbFFbbFFbbp9oaiavp;Mearp;Keczp:Rep9qgialavp;Mearp;KepxFFbbFFbbFFbbFFbbp9oglpmwDKYqk8AExm35Ps8E8Fp9qpkbbabaoawp9oaialpmbezHdiOAlvCXorQLp9qpkbbabcafhbadclfgdae6mbkkk;2ileue97euo97dnaec98GgiTmbcbheinabcKfpx:ji:1S:ji:1S:ji:1S:ji:1SabpbbbglabczfgvpbbbgopmlvorxmPsCXQL358E8Fgrczp:Segwpxibbbibbbibbbibbbp9qp;6egDp;NegqaDaDp;MegDaDp;KealaopmbediwDqkzHOAKY8AEgDczp:Reczp:Sep;6eglalp;MeaDczp:Sep;6egoaop;Mearczp:Reczp:Sep;6egrarp;Mep;Kep;Kep;Lepxbbbbbbbbbbbbbbbbp:4ep;Jep;Mepxbbn0bbn0bbn0bbn0gDp;KepxFFbbFFbbFFbbFFbbgkp9oaqaop;MeaDp;Keczp:Rep9qgoaqalp;MeaDp;Keakp9oaqarp;MeaDp;Keczp:Rep9qgDpmwDKYqk8AExm35Ps8E8Fglp5eawclp:RegqpEi:T:j83ibavalp5baqpEd:T:j83ibabcwfaoaDpmbezHdiOAlvCXorQLgDp5eaqpEe:T:j83ibabaDp5baqpEb:T:j83ibabcafhbaeclfgeai6mbkkkuee97dnadcd4ae2c98GgeTmbcbhdinababpbbbgicwp:Recwp:Sep;6eaicep:SepxbbjFbbjFbbjFbbjFp9opxbbjZbbjZbbjZbbjZp:Uep;Mepkbbabczfhbadclfgdae6mbkkk:Sodw97euaec98Ghedndnadcl9hmbaeTmecbhdinabpxbbuJbbuJbbuJbbuJabpbbbgicKp:TeglaicYp:Tep9qgvcdp:Teavp9qgvclp:Teavp9qgop;6ep;Negvaicwp:RecKp:SegraipxFbbbFbbbFbbbFbbbgwp9ogDp:Uep;6ep;Mepxbbn0bbn0bbn0bbn0gqp;Kecwp:RepxbFbbbFbbbFbbbFbbp9oavaDarp:Xeaiczp:RecKp:Segip:Uep;6ep;Meaqp;Keawp9op9qavaDaraip:Uep:Xep;6ep;Meaqp;Keczp:RepxbbFbbbFbbbFbbbFbp9op9qavaoalcep:Rep9oalpxebbbebbbebbbebbbp9op9qp;6ep;Meaqp;KecKp:Rep9qpkbbabczfhbadclfgdae6mbxdkkaeTmbcbhdinabczfgkpxbFu9hbFu9hbFu9hbFu9habpbbbglakpbbbgrpmlvorxmPsCXQL358E8Fgvczp:TegqavcHp:Tep9qgicdp:Teaip9qgiclp:Teaip9qgicwp:Teaip9qgop;6ep;NegialarpmbediwDqkzHOAKY8AEgDpxFFbbFFbbFFbbFFbbglp9ograDczp:Segwp:Ueavczp:Reczp:SegDp:Xep;6ep;Mepxbbn0bbn0bbn0bbn0gvp;Kealp9oaiarawaDp:Uep:Xep;6ep;Meavp;Keczp:Rep9qgwaiaoaqcep:Rep9oaqpxebbbebbbebbbebbbp9op9qp;6ep;Meavp;Keczp:ReaiaDarp:Uep;6ep;Meavp;Kealp9op9qgipmwDKYqk8AExm35Ps8E8FpkbbabawaipmbezHdiOAlvCXorQLpkbbabcafhbadclfgdae6mbkkk9teiucbcbydj:G:cjbgeabcifc98GfgbBdj:G:cjbdndnabZbcztgd9nmbcuhiabad9RcFFifcz4nbcuSmekaehikaikkxebcj:Gdklz:zbb",n=new Uint8Array([0,97,115,109,1,0,0,0,1,4,1,96,0,0,3,3,2,0,0,5,3,1,0,1,12,1,0,10,22,2,12,0,65,0,65,0,65,0,252,10,0,0,11,7,0,65,0,253,15,26,11]),i=new Uint8Array([32,0,65,2,1,106,34,33,3,128,11,4,13,64,6,253,10,7,15,116,127,5,8,12,40,16,19,54,20,9,27,255,113,17,42,67,24,23,146,148,18,14,22,45,70,69,56,114,101,21,25,63,75,136,108,28,118,29,73,115]);if(typeof WebAssembly!="object")return{supported:!1};var o=WebAssembly.validate(n)?a(t):a(e),r,s=WebAssembly.instantiate(o,{}).then(function(S){r=S.instance,r.exports.__wasm_call_ctors()});function a(S){for(var Z=new Uint8Array(S.length),R=0;R96?C-97:C>64?C-39:C+4}for(var E=0,R=0;R0?y(S,Z,R,u[C],d[E]):s.then(function(){var A=new Uint8Array(S*Z);return c(r,r.exports[u[C]],A,S,Z,R,r.exports[d[E]]),A})}}})();var B2n=x(T(),1),D2n=(function(){var e="b9H79Tebbbe:6eO9Geueu9Geub9Gbb9Gsuuuuuuuuuuuu99uueu9Gvuuuuub9Gruuuuuuub9Gouuuuuue999Gvuuuuueu9Gzuuuuuuuuuuu99uuuub9Gquuuuuuu99uueu9GPuuuuuuuuuuu99uueu9Gquuuuuuuu99ueu9Gruuuuuu99eu9Gwuuuuuu99ueu9Giuuue999Gluuuueu9Gluuuub9GiuuueuiLQdilvorlwDiqkxmPszbHHbelve9Weiiviebeoweuecj:Gdkr:Bdxo9TW9T9VV95dbH9F9F939H79T9F9J9H229F9Jt9VV7bbz9TW79O9V9Wt9F79P9T9W29P9M95bw8E9TW79O9V9Wt9F79P9T9W29P9M959x9Pt9OcttV9P9I91tW7bD8A9TW79O9V9Wt9F79P9T9W29P9M959x9Pt9O9v9W9K9HtWbqQ9TW79O9V9Wt9F79P9T9W29P9M959t29V9W9W95bkX9TW79O9V9Wt9F79P9T9W29P9M959qV919UWbxQ9TW79O9V9Wt9F79P9T9W29P9M959q9V9P9Ut7bmX9TW79O9V9Wt9F79P9T9W29P9M959t9J9H2WbPa9TW79O9V9Wt9F9V9Wt9P9T9P96W9wWVtW94SWt9J9O9sW9T9H9Wbs59TW79O9V9Wt9F9NW9UWV9HtW9q9V79Pt9P9V9U9sW9T9H9Wbzl79IV9RbHDwebcekdCXq;y;WeQdbk;r:herYue99iuY99Xue9:D998Jjjjjbcj;sb9Rgs8Kjjjjbcbhzasc:Cefcbc;Kbz:tjjjb8AdnabaeSmbabaeadcdtzMjjjb8AkdnamcdGTmbalcrfci4cbyd1:H:cjbHjjjjbbhHasc:Cefasyd;8egecdtfaHBdbasaecefBd;8ecbhlcbhednadTmbabheadhOinaHaeydbci4fcb86bbaeclfheaOcufgOmbkcbhlabheadhOinaHaeydbgAci4fgCaCRbbgCceaAcrGgAtV86bbaCcu7aA4ceGalfhlaeclfheaOcufgOmbkcualcdtalcFFFFi0Ehekaecbyd1:H:cjbHjjjjbbhzasc:Cefasyd;8egecdtfazBdbasaecefBd;8ealcd4alfhOcehHinaHgecethHaeaO6mbkcbhXcuaecdtgOaecFFFFi0Ecbyd1:H:cjbHjjjjbbhHasc:Cefasyd;8egAcdtfaHBdbasaAcefBd;8eaHcFeaOz:tjjjbhQdnadTmbaecufhLcbhKindndnaQabaKcdtfgYydbgAc:v;t;h;Ev2aLGgOcdtfgCydbgHcuSmbceheinazaHcdtfydbaASmdaOaefhHaecefheaQaHaLGgOcdtfgCydbgHcu9hmbkkazaXcdtfaABdbaCaXBdbaXhHaXcefhXkaYaHBdbaKcefgKad9hmbkkaQcbyd:m:H:cjbH:bjjjbbasasyd;8ecufBd;8ekcbh8AcualcefgecdtaecFFFFi0Ecbyd1:H:cjbHjjjjbbhLasc:Cefasyd;8egecdtfaLBdbasaLBdNeasaecefBd;8ecuadcitadcFFFFe0Ecbyd1:H:cjbHjjjjbbhEasc:Cefasyd;8egecdtfaEBdbasaEBd:yeasaecefBd;8eascNefabadalcbz:cjjjbcualcdtgealcFFFFi0Eg3cbyd1:H:cjbHjjjjbbhOasc:Cefasyd;8egHcdtfaOBdbasaHcefBd;8ea3cbyd1:H:cjbHjjjjbbhQasc:Cefasyd;8egHcdtfaQBdbasaHcefBd;8eaOaQaialavazasc:Cefz:djjjbalcbyd1:H:cjbHjjjjbbhYasc:Cefasyd;8egHcdtfaYBdbasaHcefBd;8ea3cbyd1:H:cjbHjjjjbbhHasc:Cefasyd;8egAcdtfaHBdbasaAcefBd;8ea3cbyd1:H:cjbHjjjjbbhAasc:Cefasyd;8egCcdtfaABdbasaCcefBd;8eaHcFeaez:tjjjbh5aAcFeaez:tjjjbh8EdnalTmbindnaLa8AgAcefg8AcdtfydbgCaLaAcdtgefydbgHSmbaCaH9Rh8FaEaHcitfhaa8Eaefhha5aefhKcbhCindndnaaaCcitfydbgXaA9hmbaKaABdbahaABdbxekdnaLaXcdtggfgeclfydbgHaeydbgeSmbaHae9RhHaEaecitfheinaeydbaASmdaecwfheaHcufgHmbkka8EagfgeaAaXaeydbcuSEBdbaKaXaAaKydbcuSEBdbkaCcefgCa8F9hmbkka8Aal9hmbkaOhHaQhAa5hXa8EhCcbheindndnaeaHydbgK9hmbdnaeaAydbgK9hmbaXydbhKdnaCydbg8Fcu9hmbaKcu9hmbaYaefcb86bbxikdna8FcuSmbaKcuSmbaea8FSmbaOa8FcdtfydbaOaKcdtfydb9hmbaYaefcd86bbxikaYaefhadnaea8FSmbaeaKSmbaace86bbxikaacl86bbxdkdnaeaQaKcdtg8Ffydb9hmbdnaCydbgacuSmbaeaaSmbaXydbggcuSmbaeagSmba8Ea8FfydbghcuSmbahaKSmba5a8Ffydbg8FcuSmba8FaKSmbdnaOaacdtfydbgKaOa8Fcdtfydb9hmbaKaOagcdtfydbg8FSmba8FaOahcdtfydb9hmbaYaefcd86bbxlkaYaefcl86bbxikaYaefcl86bbxdkaYaefcl86bbxekaYaefaYaKfRbb86bbkaHclfhHaAclfhAaXclfhXaCclfhCalaecefge9hmbkdnamcaGTmbcbh8JindndnaYa8Jfg8KRbbg8Lc9:fPibebekdndndnaOa8Jcdtfydbgea8J9hmbdnaqmbcbh8FxdkdnazTmbcbh8Fa8JheinaqazaecdtgefydbfRbbce4a8FVceGh8FaQaefydbgea8J9hmbxikkcbh8Fa8JheinaqaefRbbce4a8FVceGh8FaQaecdtfydbgea8J9hmbxdkkaYaefRbbhexeka8JheindnaLaecdtg8AfgeclfydbgHaeydbgeSmbaHae9RhgaEaecitfhhaOa8AfhacbhKinahaKcitfydbgXhednindnaLaecdtgCfgeclfydbgHaeydbgeSmbaHae9RhHaEaecitfheaaydbhAdninaOaeydbcdtfydbaASmeaecwfheaHcufgHTmdxbkkcbhexdkaQaCfydbgeaX9hmbkceheka8FaeVh8FaKcefgKag9hmbkkaQa8Afydbgea8J9hmbka8Lcia8FceGEheka8Kae86bbka8Jcefg8Jal9hmbkkdnaqTmbdndnazTmbazheaOhHalhAindnaqaeydbfRbbceGTmbaYaHydbfcl86bbkaeclfheaHclfhHaAcufgAmbxdkkaqheaOhHalhAindnaeRbbceGTmbaYaHydbfcl86bbkaecefheaHclfhHaAcufgAmbkkaOhealhAaYhHindnaYaeydbfRbbcl9hmbaHcl86bbkaeclfheaHcefhHaAcufgAmbkkamceGTmbaYhealhHindnaeRbbce9hmbaecl86bbkaecefheaHcufgHmbkkcbh8Mcualcx2alc;v:Q;v:Qe0Ecbyd1:H:cjbHjjjjbbh8Nasc:Cefasyd;8egecdtfa8NBdbasaecefBd;8eascbBd:qeas9cb83i1ea8Naialavazasc1efz:ejjjbhydndnaDmbcbh8PcbhCxekcbhCawhecbhHindnaeIdbJbbbb9ETmbasaCcdtfaHBdbaCcefhCkaeclfheaDaHcefgH9hmbkcuaCal2gecdtaecFFFFi0Ecbyd1:H:cjbHjjjjbbh8Pasc:Cefasyd;8egecdtfa8PBdbasaecefBd;8ealTmbdnaCmbcbhCxekarcd4hgdnazTmbaC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fgKaAclfIdbaKIdbMUdbaecwfgKaAcwfIdbaKIdbMUdbaecxfgeaAcxfIdbaeIdbMUdbaHczfhHaXcufgXmbkaacifgaad6mbkkcbhAdndnamcwGgTmbJbbbbh8ScbhScbh9hcbh9ixekcbhSa3cbyd1:H:cjbHjjjjbbh9iasc:Cefasyd;8egecdtfa9iBdbasaecefBd;8ecua9ialabadaOz:fjjjbgXcltaXcjjjjiGEcbyd1:H:cjbHjjjjbbh9hasc:Cefasyd;8egecdtfa9hBdbasaecefBd;8ea9haXa9ia8Nalz:gjjjbJFFuuh8SaXTmba9hheaXhHinaeIdbgRa8Sa8SaR9EEh8SaeclfheaHcufgHmbkaXhSkdnalTmbaLclfheaLydbhXaYhHalhKcbhAincbaeydbg8FaX9RaHRbbcpeGEaAfhAaHcefhHaeclfhea8FhXaKcufgKmbkaAce4hAkcuadaA9Rcifg6cx2a6c;v:Q;v:Qe0Ecbyd1:H:cjbHjjjjbbh9kasc:Cefasyd;8egecdtfa9kBdbasaecefBd;8ecua6cdta6cFFFFi0Ecbyd1:H:cjbHjjjjbbh0asc:Cefasyd;8egecdtfa0BdbasaecefBd;8ea3cbyd1:H:cjbHjjjjbbh9masc:Cefasyd;8egecdtfa9mBdbasaecefBd;8ealcbyd1:H:cjbHjjjjbbh9nasc:Cefasyd;8egecdtfa9nBdbasaecefBd;8eaxaxNayJbbjZamclGEgZaZN:vh87JbbbbhUdnadak9nmbdna6ci6mbaCclth9oa9kcwfh9pJbbbbh85JbbbbhUinascNefabadalaOz:cjjjbabh8Acbh9qcbh9rinaba9rcdtfhDcbheindnaOa8AaefydbgAcdtghfydbgXaOaDaec:W:G:cjbfydbcdtfydbgHcdtg8JfydbgKSmbaYaHfRbbgacv2aYaAfRbbg8FfRb;a:G:cjbg8La8Fcv2aafg8KRb;a:G:cjbg3VcFeGTmbdnaKaX9nmba8KRb;G:G:cjbcFeGmekdna8FcufcFeGce0mbaaTmba5ahfydbaH9hmekdna8FTmbaacufcFeGce0mba8Ea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dba8XaecwfIdbNa8YaeIdbNa81aeclfIdbNMMMg8Wa8WM:tNa8VMh8VaHclfhHaeczfheaAcufgAmbka8V:lh8VkaBaR:lMhBa86a8VMh86dndndnaYaKfRbbc9:fPddbekaQaXfydbgXaKSmbaOa8Fcdtfydbh8Jindndna5aXcdtgafydbgecuSmbaOaecdtfydba8JSmekdna8EaafydbgecuSmbaOaecdtfydba8JSmeka8FhekagaXc8S2fgAIdwa8Naecx2fgHIdwg8WNaAIdzaHIdbg8XNaAIdaMgRaRMMa8WNaAIdlaHIdlg8YNaAIdCa8WNaAId3MgRaRMMa8YNaAIdba8XNaAIdxa8YNaAIdKMgRaRMMa8XNaAId8KMMMhRa8PaeaC2cdtfhHa8RaXaC2cltfheaAIdyh81aChAinaHIdbg8Va8Va81NaecxfIdba8WaecwfIdbNa8XaeIdbNa8YaeclfIdbNMMMg8Va8VM:tNaRMhRaHclfhHaeczfheaAcufgAmbkaBaR:lMhBaQaafydbgXaK9hmbkkaYa8FfRbbci9hmeaDTmeaQa8FcdtfydbgXa8FSmeindndna5aXcdtgafydbgecuSmbaOaecdtfydba8ASmekdna8EaafydbgecuSmbaOaecdtfydba8ASmekaKhekagaXc8S2fgAIdwa8Naecx2fgHIdwg8WNaAIdzaHIdbg8XNaAIdaMgRaRMMa8WNaAIdlaHIdlg8YNaAIdCa8WNaAId3MgRaRMMa8YNaAIdba8XNaAIdxa8YNaAIdKMgRaRMMa8XNaAId8KMMMhRa8PaeaC2cdtfhHa8RaXaC2cltfheaAIdyh81aChAinaHIdbg8Va8Va81NaecxfIdba8WaecwfIdbNa8XaeIdbNa8YaeclfIdbNMMMg8Va8VM:tNaRMhRaHclfhHaeczfheaAcufgAmbka86aR:lMh86aQaafydbgXa8F9hmbxdkkdna8Ea5a5aXfydba8FSEaQaXfydbgacdtfydbgXcu9hmbaQa8FcdtfydbhXkagaac8S2fgAIdwa8NaXcx2fgeIdwg8WNaAIdzaeIdbg8XNaAIdaMgRaRMMa8WNaAIdlaeI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ba8La9u0mdkdna3aOa8JydlgDcdtg9vfg8AydbgAfg9wRbba3aOa8Jydbghcdtg9xfydbgefg9yRbbVmbaYahfRbbh9zdndnaLaecdtfgHclfydbgXaHydbgHSmbaXaH9RhXa8NaAcx2fh8Fa8Naecx2fhaaEaHcitfheindna9maeydbcdtfydbgHaASmba9maeclfydbcdtfydbgKaASmbaHaKSmba8NaKcx2fgKIdba8NaHcx2fgHIdbg8W:tgRaaIdlaHIdlg8X:tg80NaKIdla8X:tg8VaaIdba8W:tgBN:tg8YaRa8FIdla8X:tg86Na8Va8FIdba8W:tg8UN:tg8XNa8VaaIdwaHIdwg81:tg8ZNaKIdwa81:tg8Wa80N:tg80a8Va8FIdwa81:tg83Na8Wa86N:tg8VNa8WaBNaRa8ZN:tg81a8Wa8UNaRa83N:tgRNMMa8Ya8YNa80a80Na81a81NMMa8Xa8XNa8Va8VNaRaRNMMN:rJbbj8:N9FmikaecwfheaXcufgXmbkkdndndndna9zc9:fPdebdkahheina8AydbhAdndna5aecdtgHfydbgecuSmbaOaecdtfydbaASmekdna8EaHfydbgecuSmbaOaecdtfydbaASmekaDheka9maHfaeBdbaQaHfydbgeah9hmbxikkdna8Ea5a5a9xfydbaDSEaQa9xfydbghcdtfydbgecu9hmbaQa9vfydbheka9ma9xfaDBdbaehDka9mahcdtfaDBdbka9yce86bba9wce86bba8JIdwgRaUaUaR9DEhUa9tcefh9tcecda9zceSEa8Lfh8Lxeka9rcefh9rka8Kcefg8Ka9q9hmbkka9tTmddnalTmbcbh8Fcbhhindna9mahcdtgefydbgAahSmbaOaAcdtfydbh8AdnahaOaefydb9hg8JmbaIa8Ac8S2fgeaIahc8S2fgHIdbaeIdbMUdbaeaHIdlaeIdlMUdlaeaHIdwaeIdwMUdwaeaHIdxaeIdxMUdxaeaHIdzaeIdzMUdzaeaHIdCaeIdCMUdCaeaHIdKaeIdKMUdKaeaHId3aeId3MUd3aeaHIdaaeIdaMUdaaeaHId8KaeId8KMUd8KaeaHIdyaeId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xekJFFuuh8ScbhdabhecbhAindna9ha9iaeydbgXcdtfydbcdtfIdbgRa859ETmbaeclf8Pdbh9AabadcdtfgKaXBdbaKclfa9A83dbaRa8Sa8SaR9EEh8SadcifhdkaecxfheaAcifgAaH6mbkkadak0mbxdkkascNefabadalaOz:cjjjbkdndnadak0mbadhaxekdnaTmbadhaxekdna8Sa879FmbadhaxekcehKina8SJbb;aZNgRa87aRa879DEh8WJbbbbhRdnaSTmba9hheaShHinaeIdbg8VaRa8Va8W9FEaRa8VaR9EEhRaeclfheaHcufgHmbkkJFFuuh8ScbhaabhecbhHindna9ha9iaeydbgAcdtfydbcdtfIdbg8Va8W9ETmbaeclf8Pdbh9AabaacdtfgXaABdbaXclfa9A83dba8Va8Sa8Sa8V9EEh8SaacifhakaecxfheaHcifgHad6mbkdnaKaaad9hVceGmbadhaxdkaRaUaUaR9DEhUaaak9nmecbhKaahda8Sa879FmbkkdnamcjjjjdGTmba9ncbalz:tjjjbh8AdnaaTmbabheaahHina8AaeydbgAfce86bba8AaOaAcdtfydbfce86bbaeclfheaHcufgHmbkkascNefabaaalaOz:cjjjbdndnalTmbcbhXindna8AaXfRbbTmbdnaYaXfRbbgecl0mbceaetcQGmekdnaOaXcdtg8FfydbgeaXSmba8NaXcx2fgHa8Naecx2fgeydwBdwaHae8Pdb83dbxekaIaXc8S2fgKIdygcacJL:3;rUNgRMh87aKIdwg9BaRMh8SaKIdlg9CaRMh8UaKIdbg9DaRMh81aKIdag9EaRa8NaXcx2fg8JIdwg88N:th8ZaKId3g9FaRa8JIdlg89N:th83aKIdKg9Ga8JIdbg8:aRN:th80JbbbbhnaKIdCg9HJbbbbMh85aKIdzg9IJbbbbMhBaKIdxg9JJbbbbMh86dndnaCTmbaXhAinJbbbba87agaAc8S2fgHIdygR:vaRJbbbb9BEhRa8RaAaC2cltfheaHIdaa87Na8ZMh8ZaHId3a87Na83Mh83aHIdKa87Na80Mh80aHIdCa87Na85Mh85aHIdza87NaBMhBaHIdxa87Na86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QaecwfgXydbhHcjjjj94hCdna5aAcdtgEfydbaeclfgKydbgOSmbcjjjj94cba8EaOcdtfydbaASEhCkaeaQaCVaAVBdbaYaOfRbbc3th8Fcjjjj94hCcjjjj94hQdna5aOcdtfydbaHSmbcjjjj94cba8EaHcdtfydbaOSEhQkaKa8FaQVaOVBdbaYaHfRbbc3thOdna5aHcdtfydbaASmbcjjjj94cba8EaEfydbaHSEhCkaXaOaCVaHVBdbaecxfheaLcifgLaa6mbkkdnazTmbaaTmbaaheinabazabydbcdtfydbBdbabclfhbaecufgembkkdnaPTmbaPaZaU:rNUdbkdnasyd;8egHTmbaHcdtasc:Ceffc98fheinaeydbcbyd:m:H:cjbH:bjjjbbaec98fheaHcufgHmbkkascj;sbf8Kjjjjbaak;Yieouabydlhvabydbclfcbaicdtz:tjjjbhoadci9UhrdnadTmbdnalTmbaehwadhDinaoalawydbcdtfydbcdtfgqaqydbcefBdbawclfhwaDcufgDmbxdkkaehwadhDinaoawydbcdtfgqaqydbcefBdbawclfhwaDcufgDmbkkdnaiTmbcbhDaohwinawydbhqawaDBdbawclfhwaqaDfhDaicufgimbkkdnadci6mbinaecwfydbhwaeclfydbhDaeydbhidnalTmbalawcdtfydbhwalaDcdtfydbhDalaicdtfydbhikavaoaicdtfgqydbcitfaDBdbavaqydbcitfawBdlaqaqydbcefBdbavaoaDcdtfgqydbcitfawBdbavaqydbcitfaiBdlaqaqydbcefBdbavaoawcdtfgwydbcitfaiBdbavawydbcitfaDBdlawawydbcefBdbaecxfhearcufgrmbkkabydbcbBdbk:todDue99aicd4aifhrcehwinawgDcethwaDar6mbkcuaDcdtgraDcFFFFi0Ecbyd1:H:cjbHjjjjbbhwaoaoyd9GgqcefBd9GaoaqcdtfawBdbawcFearz:tjjjbhkdnaiTmbalcd4hlaDcufhxcbhminamhDdnavTmbavamcdtfydbhDkcbadaDal2cdtfgDydlgwawcjjjj94SEgwcH4aw7c:F:b:DD2cbaDydbgwawcjjjj94SEgwcH4aw7c;D;O:B8J27cbaDydwgDaDcjjjj94SEgDcH4aD7c:3F;N8N27axGhwamcdthPdndndnavTmbakawcdtfgrydbgDcuSmeadavaPfydbal2cdtfgsIdbhzcehqinaqhrdnadavaDcdtfydbal2cdtfgqIdbaz9CmbaqIdlasIdl9CmbaqIdwasIdw9BmlkarcefhqakawarfaxGgwcdtfgrydbgDcu9hmbxdkkakawcdtfgrydbgDcuSmbadamal2cdtfgsIdbhzcehqinaqhrdnadaDal2cdtfgqIdbaz9CmbaqIdlasIdl9CmbaqIdwasIdw9BmikarcefhqakawarfaxGgwcdtfgrydbgDcu9hmbkkaramBdbamhDkabaPfaDBdbamcefgmai9hmbkkakcbyd:m:H:cjbH:bjjjbbaoaoyd9GcufBd9GdnaeTmbaiTmbcbhDaehwinawaDBdbawclfhwaiaDcefgD9hmbkcbhDaehwindnaDabydbgrSmbawaearcdtfgrydbBdbaraDBdbkabclfhbawclfhwaiaDcefgD9hmbkkk;:odvuv998Jjjjjbca9Rgocbyd1:G:cjbBdKaocb8Pdj:G:cjb83izaocbydN:G:cjbBdwaocb8Pd:m:G:cjb83ibdnadTmbaicd4hrdnabmbdnalTmbcbhwinaealawcdtfydbar2cdtfhDcbhiinaoczfaifgqaDaifIdbgkaqIdbgxaxak9EEUdbaoaifgqakaqIdbgxaxak9DEUdbaiclfgicx9hmbkawcefgwad9hmbxikkarcdthwcbhDincbhiinaoczfaifgqaeaifIdbgkaqIdbgxaxak9EEUdbaoaifgqakaqIdbgxaxak9DEUdbaiclfgicx9hmbkaeawfheaDcefgDad9hmbxdkkdnalTmbcbhwinabawcx2fgiaealawcdtfydbar2cdtfgDIdbUdbaiaDIdlUdlaiaDIdwUdwcbhiinaoczfaifgqaDaifIdbgkaqIdbgxaxak9EEUdbaoaifgqakaqIdbgxaxak9DEUdbaiclfgicx9hmbkawcefgwad9hmbxdkkarcdthlcbhwaehDinabawcx2fgiaeawar2cdtfgqIdbUdbaiaqIdlUdlaiaqIdwUdwcbhiinaoczfaifgqaDaifIdbgkaqIdbgxaxak9EEUdbaoaifgqakaqIdbgxaxak9DEUdbaiclfgicx9hmbkaDalfhDawcefgwad9hmbkkJbbbbaoIdbaoIdzgx:tgkakJbbbb9DEgkaoIdlaoIdCgm:tgPaPak9DEgkaoIdwaoIdKgP:tgsasak9DEhsdnabTmbadTmbJbbbbJbbjZas:vasJbbbb9BEhkinabakabIdbax:tNUdbabclfgoakaoIdbam:tNUdbabcwfgoakaoIdbaP:tNUdbabcxfhbadcufgdmbkkdnavTmbavaPUdwavamUdlavaxUdbkask:WlewudnaeTmbcbhvabhoinaoavBdbaoclfhoaeavcefgv9hmbkkdnaiTmbcbhrinadarcdtfhwcbhDinalawaDcdtgvyd:G:G:cjbcdtfydbcdtfydbhodnalawavfydbcdtfydbgqabaqcdtfgkydbgvSmbinakabavgqcdtfgxydbgvBdbaxhkaqav9hmbkkdnaoabaocdtfgkydbgvSmbinakabavgocdtfgxydbgvBdbaxhkaoav9hmbkkdnaqaoSmbabaqaoaqao0Ecdtfaqaoaqao6EBdbkaDcefgDci9hmbkarcifgrai6mbkkdnaembcbskcbhxindnalaxcdtgvfydbax9hmbaxhodnaxabavfgDydbgvSmbaDhqinaqabavgocdtfgkydbgvBdbakhqaoav9hmbkkaDaoBdbkaxcefgxae9hmbkcbhkabhvcbhoindndnaoalydbgq9hmbdnaoavydbgq9hmbavakBdbakcefhkxdkavabaqcdtfydbBdbxekavabaqcdtfydbBdbkalclfhlavclfhvaeaocefgo9hmbkakk;jiilud99euabcbaecltz:tjjjbhvdnalTmbadhoaihralhwinarcwfIdbhDarclfIdbhqavaoydbcltfgkarIdbakIdbMUdbakaqakIdlMUdlakaDakIdwMUdwakakIdxJbbjZMUdxaoclfhoarcxfhrawcufgwmbkkdnaeTmbavhkaehrinakcxfgoIdbhDaocbBdbakakIdbJbbbbJbbjZaD:vaDJbbbb9BEgDNUdbakclfgoaDaoIdbNUdbakcwfgoaDaoIdbNUdbakczfhkarcufgrmbkkdnalTmbinavadydbcltfgkaicwfIdbakIdw:tgDaDNaiIdbakIdb:tgDaDNaiclfIdbakIdl:tgDaDNMMgDakIdxgqaqaD9DEUdxadclfhdaicxfhialcufglmbkkdnaeTmbavcxfhkinabakIdbUdbakczfhkabclfhbaecufgembkkk:moerudnaoTmbaecd4hzdnavTmbaicd4hHavcdthOcbhAindnaPaAfRbbTmbaAhednaDTmbaDaAcdtfydbhekdnasTmbasaefRbbceGmekdnamaAfRbbclSmbabaeaz2cdtfgiaraAcx2fgCIdbakNaxIdbMUdbaiaCIdlakNaxIdlMUdlaiaCIdwakNaxIdwMUdwkadaeaH2cdtfhXaqheawhiavhCinaXaeydbcdtgQfaiIdbalaQfIdb:vUdbaeclfheaiclfhiaCcufgCmbkkawaOfhwaAcefgAao9hmbxdkkdnasmbcbheaDhiindnaPaefRbbTmbaehCdnaDTmbaiydbhCkamaefRbbclSmbabaCaz2cdtfgCarIdbakNaxIdbMUdbaCarclfIdbakNaxIdlMUdlaCarcwfIdbakNaxIdwMUdwkaiclfhiarcxfhraoaecefge9hmbxdkkdnaDTmbindnaPRbbTmbasaDydbgefRbbceGmbamRbbclSmbabaeaz2cdtfgearIdbakNaxIdbMUdbaearclfIdbakNaxIdlMUdlaearcwfIdbakNaxIdwMUdwkaPcefhPaDclfhDamcefhmarcxfhraocufgombxdkkazcdthicbheindnaPaefRbbTmbasaefRbbceGmbamaefRbbclSmbabarIdbakNaxIdbMUdbabclfarclfIdbakNaxIdlMUdbabcwfarcwfIdbakNaxIdwMUdbkarcxfhrabaifhbaoaecefge9hmbkkk8MbabaeadaialavcbcbcbcbcbaoarawaDz:bjjjbk8MbabaeadaialavaoarawaDaqakaxamaPz:bjjjbkRbababaeadaialavaoarawaDaqakaxcjjjjdVamz:bjjjbk:g8Koque99due99duq998Jjjjjbc;Wb9Rgq8Kjjjjbcbhkaqcxfcbc;Kbz:tjjjb8Aaqcualcx2alc;v:Q;v:Qe0Ecbyd1:H:cjbHjjjjbbgxBdxaqceBd2axaialavcbcbz:ejjjb8AaqcualcdtalcFFFFi0Egmcbyd1:H:cjbHjjjjbbgiBdzaqcdBd2dndnJFF959eJbbjZawJbbjZawJbbjZ9DE:vawJ9VO:d869DEgw:lJbbb9p9DTmbaw:OhPxekcjjjj94hPkadci9Uhsarco9UhzdndnaombaPcd9imekdnalTmbaPcuf:YhwdnaoTmbcbhvaihHaxhOindndnaoavfRbbceGTmbavcjjjjlVhAxekdndnaOclfIdbawNJbbbZMgC:lJbbb9p9DTmbaC:OhAxekcjjjj94hAkaAcqthAdndnaOcwfIdbawNJbbbZMgC:lJbbb9p9DTmbaC:OhXxekcjjjj94hXkaAaXVhAdndnaOIdbawNJbbbZMgC:lJbbb9p9DTmbaC:OhXxekcjjjj94hXkaAaXcCtVhAkaHaABdbaHclfhHaOcxfhOalavcefgv9hmbxdkkaxhvaihOalhHindndnavIdbawNJbbbZMgC:lJbbb9p9DTmbaC:OhAxekcjjjj94hAkaAcCthAdndnavclfIdbawNJbbbZMgC:lJbbb9p9DTmbaC:OhXxekcjjjj94hXkaXcqtaAVhAdndnavcwfIdbawNJbbbZMgC:lJbbb9p9DTmbaC:OhXxekcjjjj94hXkaOaAaXVBdbavcxfhvaOclfhOaHcufgHmbkkadTmbcbhkaehvcbhOinakaiavclfydbcdtfydbgHaiavcwfydbcdtfydbgA9haiavydbcdtfydbgXaH9haXaA9hGGfhkavcxfhvaOcifgOad6mbkkarci9UhQdndnaz:Z:rJbbbZMgw:lJbbb9p9DTmbaw:Ohvxekcjjjj94hvkaQ:ZhLcbhKc:bwhzdninakaQ9pmeazaP9Rcd9imeavazcufgOavaO9iEaPcefavaP9kEhYdnalTmbaYcuf:YhwdnaoTmbcbhOaihHaxhvindndnaoaOfRbbceGTmbaOcjjjjlVhAxekdndnavclfIdbawNJbbbZMgC:lJbbb9p9DTmbaC:OhAxekcjjjj94hAkaAcqthAdndnavcwfIdbawNJbbbZMgC:lJbbb9p9DTmbaC:OhXxekcjjjj94hXkaAaXVhAdndnavIdbawNJbbbZMgC:lJ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xdkaxhOaihHalhAindndnaOIdbawNJbbbZMgC:lJbbb9p9DTmbaC:OhXxekcjjjj94hXkaXcCthXdndnaOclfIdbawNJbbbZMgC:lJbbb9p9DTmbaC:Ohrxekcjjjj94hrkarcqtaXVhXdndnaOcwfIdbawNJbbbZMgC:lJbbb9p9DTmbaC:Ohrxekcjjjj94hrkaHaXarVBdbaOcxfhOaHclfhHaAcufgAmbkkaKcFeaYz:tjjjbhravcufhocbhPcbhYindndndnaraiaYcdtgKfydbgAcm4aA7c:v;t;h;Ev2gvcs4av7aoGgHcdtfgXydbgOcuSmbcehvinaiaOcdtgOfydbaASmdaHavfhOavcefhvaraOaoGgHcdtfgXydbgOcu9hmbkkaXaYBdbaPhvaPcefhPxekazaOfydbhvkazaKfavBdbaYcefgYal9hmbkcuaPc8S2gOaPc;D;O;f8U0EhvkcbhXaqavcbyd1:H:cjbHjjjjbbgvBd3aqcvBd2avcbaOz:tjjjbhOdnadTmbaehiinaxaiclfydbgrcx2fgvIdbaxaiydbgocx2fgHIdbg3:tgCaxaicwfydbgYcx2fgAIdlaHIdlg8A:tgwNavIdla8A:tgEaAIdba3:tg8EN:tgLaLNaEaAIdwaHIdwg5:tg8FNavIdwa5:tgEawN:tgwawNaEa8ENaCa8FN:tgCaCNMMg8E:rhEJbbnnJbbjZazaocdtfydbgvazarcdtfydbgASavazaYcdtfydbgrSGgHEh8Fdna8EJbbbb9ETmbaLaE:vhLaCaE:vhCawaE:vhwkaOavc8S2fgvavIdbawa8FaE:rNgEawNNg8FMUdbavaCaEaCNgaNghavIdlMUdlavaLaEaLNg8ENggavIdwMUdwavawaaNgaavIdxMUdxava8EawNg8JavIdzMUdzavaCa8ENg8EavIdCMUdCavawaEaLa5Nawa3Na8AaCNMM:mg8ANg3NgwavIdKMUdKavaCa3NgCavId3MUd3avaLa3NgLavIdaMUdaava3a8ANg3avId8KMUd8KavaEavIdyMUdydnaHmbaOaAc8S2fgva8FavIdbMUdbavahavIdlMUdlavagavIdwMUdwavaaavIdxMUdxava8JavIdzMUdzava8EavIdCMUdCavawavIdKMUdKavaCavId3MUd3avaLavIdaMUdaava3avId8KMUd8KavaEavIdyMUdyaOarc8S2fgva8FavIdbMUdbavahavIdlMUdlavagavIdwMUdwavaaavIdxMUdxava8JavIdzMUdzava8EavIdCMUdCavawavIdKMUdKavaCavId3MUd3avaLavIdaMUdaava3avId8KMUd8KavaEavIdyMUdykaicxfhiaXcifgXad6mbkkcbhAaqcuaPcdtgvaPcFFFFi0Egicbyd1:H:cjbHjjjjbbgHBdaaqcoBd2aqaicbyd1:H:cjbHjjjjbbgiBd8KaqcrBd2aHcFeavz:tjjjbhYdnalTmbazhHinJbbbbJbbjZaOaHydbgXc8S2fgvIdygw:vawJbbbb9BEavIdwaxcwfIdbgwNavIdzaxIdbgCNavIdaMgLaLMMawNavIdlaxclfIdbgLNavIdCawNavId3MgwawMMaLNavIdbaCNavIdxaLNavIdKMgwawMMaCNavId8KMMM:lNhwdndnaYaXcdtgvfgXydbcuSmbaiavfIdbaw9ETmekaXaABdbaiavfawUdbkaHclfhHaxcxfhxalaAcefgA9hmbkkdndnaPmbJbbbbhwxekJbbbbhwinaiIdbgCawawaC9DEhwaiclfhiaPcufgPmbkaw:rhwkakcd4akfhOcehiinaigvcethiavaO6mbkcbhOaqcuavcdtgiavcFFFFi0Ecbyd1:H:cjbHjjjjbbgHBdyaHcFeaiz:tjjjbhXdnadTmbavcufhrcbhPcbhxindnazaeaxcdtfgvydbcdtfydbgiazavclfydbcdtfydbgOSmbaiazavcwfydbcdtfydbgvSmbaOavSmbaYavcdtfydbhAdndnaYaOcdtfydbgvaYaicdtfydbgi9pmbavaA9pmbaAhlaihoavhAxekdnaAai9pmbaAav9pmbaihlavhoxekavhlaAhoaihAkabaPcx2fgvaABdbavcwfaoBdbavclfalBdbdnaXaoc:3F;N8N2alc:F:b:DD27aAc;D;O:B8J27arGgOcdtfgvydbgicuSmbcehHinaHhvdnabaicx2fgiydbaA9hmbaiydlal9hmbaiydwaoSmikavcefhHaXaOavfarGgOcdtfgvydbgicu9hmbkkavaPBdbaPcefhPkaxcifgxad6mbkaPci2hOkcwhvaDTmekaDawUdbkavcdthvaqcxfc98fhiinaiavfydbcbyd:m:H:cjbH:bjjjbbavc98fgvmbkaqc;Wbf8KjjjjbaOk:3ldrue9:8Jjjjjbc;Wb9Rgr8Kjjjjbcbhwarcxfcbc;Kbz:tjjjb8AdnabaeSmbabaeadcdtzMjjjb8AkarcualcdtalcFFFFi0EgDcbyd1:H:cjbHjjjjbbgqBdxarceBd2aqcbaialavcbarcxfz:djjjbcualcx2alc;v:Q;v:Qe0Ecbyd1:H:cjbHjjjjbbhkarcxfaryd2gxcdtfakBdbaraxcefgmBd2akaialavcbcbz:ejjjb8AarcxfamcdtfaDcbyd1:H:cjbHjjjjbbgiBdbaraxcdfgvBd2arcxfavcdtfcuaialaeadaqz:fjjjbgecltaecjjjjiGEcbyd1:H:cjbHjjjjbbgqBdbaqaeaiakalz:gjjjbaxcifhkdnadTmbaoaoNhocbhwabhlcbheindnaqaialydbgvcdtfydbcdtfIdbao9ETmbalclf8PdbhPabawcdtfgDavBdbaDclfaP83dbawcifhwkalcxfhlaecifgead6mbkkdnakTmbaxcdtarcxffcwfhlinalydbcbyd:m:H:cjbH:bjjjbbalc98fhlakcufgkmbkkarc;Wbf8Kjjjjbawk:WCoDud99vue99vuv998Jjjjjbc;Wb9Rgw8KjjjjbdndnarmbcbhDxekawcxfcbc;Kbz:tjjjb8Aawcuadcx2adc;v:Q;v:Qe0Ecbyd1:H:cjbHjjjjbbgqBdxawceBd2aqaeadaicbcbz:ejjjb8AawcuadcdtadcFFFFi0Egkcbyd1:H:cjbHjjjjbbgxBdzawcdBd2adcd4adfhmceheinaegicetheaiam6mbkcbhPawcuaicdtgsaicFFFFi0Ecbyd1:H:cjbHjjjjbbgzBdCawciBd2dndnar:ZgH:rJbbbZMgO:lJbbb9p9DTmbaO:Ohexekcjjjj94hekaicufhAc:bwhCcbhXadhQcbhLina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7aAGgmcdtfg8AydbgecuSmbcehiinaxaecdtgefydbaYSmdamaifheaicefhiaEaeaAGgmcdtfg8Aydbgecu9hmbkka8Aa3BdbaDhiaDcefhDxeka5aefydbhika5aCfaiBdba3cefg3ad9hmbkcuaDc32giaDc;j:KM;jb0EhexekazcFeasz:tjjjb8AcbhDcbhekawaecbyd1:H:cjbHjjjjbbgeBd3awcvBd2aecbaiz:tjjjbh8Aavcd4hxdnadTmbdnalTmbaxcdthEa5hYaqhealhmadhAina8AaYydbc32fgiaeIdbaiIdbMUdbaiaeclfIdbaiIdlMUdlaiaecwfIdbaiIdwMUdwaiamIdbaiIdxMUdxaiamclfIdbaiIdzMUdzaiamcwfIdbaiIdCMUdCaiaiIdKJbbjZMUdKaYclfhYaecxfheamaEfhmaAcufgAmbxdkka5hmaqheadhYina8Aamydbc32fgiaeIdbaiIdbMUdbaiaeclfIdbaiIdlMUdlaiaecwfIdbaiIdwMUdwaiaiIdxJbbbbMUdxaiaiIdzJbbbbMUdzaiaiIdCJbbbbMUdCaiaiIdKJbbjZMUdKamclfhmaecxfheaYcufgYmbkkdnaDTmba8AhiaDheinaiaiIdbJbbbbJbbjZaicKfIdbgO:vaOJbbbb9BEgONUdbaiclfgmaOamIdbNUdbaicwfgmaOamIdbNUdbaicxfgmaOamIdbNUdbaiczfgmaOamIdbNUdbaicCfgmaOamIdbNUdbaic3fhiaecufgembkkcbhYawcuaDcdtgCaDcFFFFi0Egicbyd1:H:cjbHjjjjbbgeBdaawcoBd2awaicbyd1:H:cjbHjjjjbbgEBd8KaecFeaCz:tjjjbh3dnadTmbaoJbbjZJbbjZaK:vaPceSENgOaONhKaxcdthxalheinaKaec;8:G:cjbalEgmIdwa8Aa5ydbgAc32fgiIdC:tgOaONamIdbaiIdx:tgOaONamIdlaiIdz:tgOaONMMNaqcwfIdbaiIdw:tgOaONaqIdbaiIdb:tgOaONaqclfIdbaiIdl:tgOaONMMMhOdndna3aAcdtgifgmydbcuSmbaEaifIdbaO9ETmekamaYBdbaEaifaOUdbka5clfh5aqcxfhqaeaxfheadaYcefgY9hmbkkaba3aCzMjjjb8Acrhikaicdthiawcxfc98fheinaeaifydbcbyd:m:H:cjbH:bjjjbbaic98fgimbkkawc;Wbf8KjjjjbaDk:Pdidui99ducbhi8Jjjjjbca9Rglcbyd1:G:cjbBdKalcb8Pdj:G:cjb83izalcbydN:G:cjbBdwalcb8Pd:m:G:cjb83ibdndnaembJbbjFhvJbbjFhoJbbjFhrxekadcd4cdthwincbhdinalczfadfgDabadfIdbgvaDIdbgoaoav9EEUdbaladfgDavaDIdbgoaoav9DEUdbadclfgdcx9hmbkabawfhbaicefgiae9hmbkalIdwalIdK:thralIdlalIdC:thoalIdbalIdz:thvkJbbbbavavJbbbb9DEgvaoaoav9DEgvararav9DEk9DeeuabcFeaicdtz:tjjjbhlcbhbdnadTmbindnalaeydbcdtfgiydbcu9hmbaiabBdbabcefhbkaeclfheadcufgdmbkkabk;Bidqui998Jjjjjbc;Wb9Rgl8Kjjjjbalcxfcbc;Kbz:tjjjb8Aadcd4adfhvcehoinaogrcethoarav6mbkalcuarcdtgoarcFFFFi0Ecbyd1:H:cjbHjjjjbbgvBdxavcFeaoz:tjjjbhwdnadTmbaicd4hDarcufhqcbhkindndnawcbaeakaD2cdtfgrydlgiaicjjjj94SEgocH4ao7c:F:b:DD2cbarydbgxaxcjjjj94SEgocH4ao7c;D;O:B8J27cbarydwgmamcjjjj94SEgrcH4ar7c:3F;N8N27aqGgvcdtfgrydbgocuSmbam::hPai::hsax::hzcehiinaihrdnaeaoaD2cdtfgiIdbaz9CmbaiIdlas9CmbaiIdwaP9BmikarcefhiawavarfaqGgvcdtfgrydbgocu9hmbkkarakBdbakhokabakcdtfaoBdbakcefgkad9hmbkkalydxcbyd:m:H:cjbH:bjjjbbalc;Wbf8Kjjjjbk9teiucbcbyd:q:H:cjbgeabcifc98GfgbBd:q:H:cjbdndnabZbcztgd9nmbcuhiabad9RcFFifcz4nbcuSmekaehikaik;LeeeudndnaeabVciGTmbabhixekdndnadcz9pmbabhixekabhiinaiaeydbBdbaiclfaeclfydbBdbaicwfaecwfydbBdbaicxfaecxfydbBdbaeczfheaiczfhiadc9Wfgdcs0mbkkadcl6mbinaiaeydbBdbaeclfheaiclfhiadc98fgdci0mbkkdnadTmbinaiaeRbb86bbaicefhiaecefheadcufgdmbkkabk;aeedudndnabciGTmbabhixekaecFeGc:b:c:ew2hldndnadcz9pmbabhixekabhiinaialBdbaicxfalBdbaicwfalBdbaiclfalBdbaiczfhiadc9Wfgdcs0mbkkadcl6mbinaialBdbaiclfhiadc98fgdci0mbkkdnadTmbinaiae86bbaicefhiadcufgdmbkkabk9teiucbcbyd:q:H:cjbgeabcrfc94GfgbBd:q:H:cjbdndnabZbcztgd9nmbcuhiabad9RcFFifcz4nbcuSmekaehikaikTeeucbabcbyd:q:H:cjbge9Rcifc98GaefgbBd:q:H:cjbdnabZbcztge9nmbabae9RcFFifcz4nb8Akkk:Kedbcj:Gdk1eFFuuFFuuFFuuFFuFFFuFFFuFbbbbbbbbebbbdbbbbbbbebbbebbbdbbbbbbbbbbbeeeeebebbebbebebbbeebbbbbbbbbbbbeeeeeebebbeeebeebbbbebebbbbbbbbbbbbbbbbbbc1:Hdkxebbbdbbb:G:qbb",t=new Uint8Array([32,0,65,2,1,106,34,33,3,128,11,4,13,64,6,253,10,7,15,116,127,5,8,12,40,16,19,54,20,9,27,255,113,17,42,67,24,23,146,148,18,14,22,45,70,69,56,114,101,21,25,63,75,136,108,28,118,29,73,115]);if(typeof WebAssembly!="object")return{supported:!1};var n,i=WebAssembly.instantiate(o(e),{}).then(function(Z){n=Z.instance,n.exports.__wasm_call_ctors()});function o(Z){for(var R=new Uint8Array(Z.length),C=0;C96?E-97:E>64?E-39:E+4}for(var A=0,C=0;C=3),a(n.exports.meshopt_generatePositionRemap,Z,Z.length/R,R)},simplify:function(Z,R,C,E,A,L){r(Z instanceof Uint32Array||Z instanceof Int32Array||Z instanceof Uint16Array||Z instanceof Int16Array),r(Z.length%3==0),r(R instanceof Float32Array),r(R.length%C==0),r(C>=3),r(E>=0&&E<=Z.length),r(E%3==0),r(A>=0);for(var F=0,I=0;I<(L?L.length:0);++I)r(L[I]in S),F|=S[L[I]];var N=Z.BYTES_PER_ELEMENT==4?Z:new Uint32Array(Z),g=u(n.exports.meshopt_simplify,N,Z.length,R,R.length/C,C*4,E,A,F);return g[0]=Z instanceof Uint32Array?g[0]:new Z.constructor(g[0]),g},simplifyWithAttributes:function(Z,R,C,E,A,L,F,I,N,g){r(Z instanceof Uint32Array||Z instanceof Int32Array||Z instanceof Uint16Array||Z instanceof Int16Array),r(Z.length%3==0),r(R instanceof Float32Array),r(R.length%C==0),r(C>=3),r(E instanceof Float32Array),r(E.length==A*(R.length/C)),r(A>=0),r(F==null||F instanceof Uint8Array),r(F==null||F.length==R.length/C),r(I>=0&&I<=Z.length),r(I%3==0),r(N>=0),r(Array.isArray(L)),r(A>=L.length),r(L.length<=32);for(var V=0;V=0);for(var G=0,V=0;V<(g?g.length:0);++V)r(g[V]in S),G|=S[g[V]];var v=Z.BYTES_PER_ELEMENT==4?Z:new Uint32Array(Z),X=m(n.exports.meshopt_simplifyWithAttributes,v,Z.length,R,R.length/C,C*4,E,A*4,new Float32Array(L),F,I,N,G);return X[0]=Z instanceof Uint32Array?X[0]:new Z.constructor(X[0]),X},simplifyWithUpdate:function(Z,R,C,E,A,L,F,I,N,g){r(Z instanceof Uint32Array||Z instanceof Int32Array||Z instanceof Uint16Array||Z instanceof Int16Array),r(Z.length%3==0),r(R instanceof Float32Array),r(R.length%C==0),r(C>=3),r(E instanceof Float32Array),r(E.length==A*(R.length/C)),r(A>=0),r(F==null||F instanceof Uint8Array),r(F==null||F.length==R.length/C),r(I>=0&&I<=Z.length),r(I%3==0),r(N>=0),r(Array.isArray(L)),r(A>=L.length),r(L.length<=32);for(var V=0;V=0);for(var G=0,V=0;V<(g?g.length:0);++V)r(g[V]in S),G|=S[g[V]];var v=Z.BYTES_PER_ELEMENT==4?Z:new Uint32Array(Z),X=p(n.exports.meshopt_simplifyWithUpdate,v,Z.length,R,R.length/C,C*4,E,A*4,new Float32Array(L),F,I,N,G);if(Z!==v)for(var V=0;V=3),b(n.exports.meshopt_simplifyScale,Z,Z.length/R,R*4)},simplifyPoints:function(Z,R,C,E,A,L){return r(Z instanceof Float32Array),r(Z.length%R==0),r(R>=3),r(C>=0&&C<=Z.length/R),E?(r(E instanceof Float32Array),r(E.length%A==0),r(A>=3),r(Z.length/R==E.length/A),f(n.exports.meshopt_simplifyPoints,Z,Z.length/R,R*4,E,A*4,L||0,C)):f(n.exports.meshopt_simplifyPoints,Z,Z.length/R,R*4,void 0,0,0,C)},simplifySloppy:function(Z,R,C,E,A,L){r(Z instanceof Uint32Array||Z instanceof Int32Array||Z instanceof Uint16Array||Z instanceof Int16Array),r(Z.length%3==0),r(R instanceof Float32Array),r(R.length%C==0),r(C>=3),r(E==null||E instanceof Uint8Array),r(E==null||E.length==R.length/C),r(A>=0&&A<=Z.length),r(A%3==0),r(L>=0);var F=Z.BYTES_PER_ELEMENT==4?Z:new Uint32Array(Z),I=y(n.exports.meshopt_simplifySloppy,F,Z.length,R,R.length/C,C*4,E,A,L);return I[0]=Z instanceof Uint32Array?I[0]:new Z.constructor(I[0]),I},simplifyPrune:function(Z,R,C,E){r(Z instanceof Uint32Array||Z instanceof Int32Array||Z instanceof Uint16Array||Z instanceof Int16Array),r(Z.length%3==0),r(R instanceof Float32Array),r(R.length%C==0),r(C>=3),r(E>=0);var A=Z.BYTES_PER_ELEMENT==4?Z:new Uint32Array(Z),L=_(n.exports.meshopt_simplifyPrune,A,Z.length,R,R.length/C,C*4,E);return L=Z instanceof Uint32Array?L:new Z.constructor(L),L}}})();var K2n=x(T(),1),z2n=(function(){var e="b9H79Tebbbe:neP9Geueu9Geub9Gbb9Giuuueu9Gmuuuuuuuuuuu9999eu9Gouuuuuueu9Gruuuuuuub9Gxuuuuuuuuuuuueu9Gxuuuuuuuuuuu99eu9GPuuuuuuuuuuuuu99b9Gouuuuuub9Gwuuuuuuuub9Gvuuuuub9GluuuubiQXdilvorwDqokoqxmbiibeilve9Weiiviebeoweuecj:Gdkr;Zeqo9TW9T9VV95dbH9F9F939H79T9F9J9H229F9Jt9VV7bb8A9TW79O9V9Wt9F9I919P29K9nW79O2Wt79c9V919U9KbeY9TW79O9V9Wt9F9I919P29K9nW79O2Wt7S2W94bd39TW79O9V9Wt9F9I919P29K9nW79O2Wt79t9W9Ht9P9H2bo39TW79O9V9Wt9F9J9V9T9W91tWJ2917tWV9c9V919U9K7bw39TW79O9V9Wt9F9J9V9T9W91tW9nW79O2Wt9c9V919U9K7bkE9TW79O9V9Wt9F9J9V9T9W91tW9t9W9OWVW9c9V919U9K7bxL9TW79O9V9Wt9F9V9Wt9P9T9P96W9nW79O2WtbPl79IV9RbsDwebcekdOAq;W:leXdbkIbabaec9:fgefcufae9Ugeabci9Uadfcufad9Ugbaeab0Ek:88JDPue99eux99due99euo99iu8Jjjjjbc:WD9Rgm8KjjjjbdndnalmbcbhPxekamc:Cwfcbc;Kbz:rjjjb8AcuaocdtgsaocFFFFi0Ehzcbyd;0:G:cjbhHdndnalcb9imbaoal9nmbamazaHHjjjjbbgHBd:CwamceBd;8wamazcbyd;0:G:cjbHjjjjbbgOBd:GwamcdBd;8wamcualcdtalcFFFFi0Ecbyd;0:G:cjbHjjjjbbgABd:KwamciBd;8waihzalhsinaHazydbcdtfcbBdbazclfhzascufgsmbkaihzalhsinaHazydbcdtfgCaCydbcefBdbazclfhzascufgsmbkaihzalhCcbhXindnaHazydbcdtgQfgsydbcb9imbaOaQfaXBdbasasydbgQcjjjj94VBdbaQaXfhXkazclfhzaCcufgCmbkalci9UhLdnalci6mbcbhzaihsinascwfydbhCasclfydbhXaOasydbcdtfgQaQydbgQcefBdbaAaQcdtfazBdbaOaXcdtfgXaXydbgXcefBdbaAaXcdtfazBdbaOaCcdtfgCaCydbgCcefBdbaAaCcdtfazBdbascxfhsaLazcefgz9hmbkkaihzalhsindnaHazydbcdtgCfgXydbgQcu9kmbaXaQcFFFFrGgQBdbaOaCfgCaCydbaQ9RBdbkazclfhzascufgsmbxdkkamazaHHjjjjbbgHBd:CwamceBd;8wamazcbyd;0:G:cjbHjjjjbbgOBd:GwamcdBd;8wamcualcdtalcFFFFi0Ecbyd;0:G:cjbHjjjjbbgABd:KwamciBd;8waHcbasz:rjjjbhXaihzalhsinaXazydbcdtfgCaCydbcefBdbazclfhzascufgsmbkalci9UhLdnaoTmbcbhzaOhsaXhCaohQinasazBdbasclfhsaCydbazfhzaCclfhCaQcufgQmbkkdnalci6mbcbhzaihsinascwfydbhCasclfydbhQaOasydbcdtfgKaKydbgKcefBdbaAaKcdtfazBdbaOaQcdtfgQaQydbgQcefBdbaAaQcdtfazBdbaOaCcdtfgCaCydbgCcefBdbaAaCcdtfazBdbascxfhsaLazcefgz9hmbkkaoTmbcbhzaohsinaOazfgCaCydbaXazfydb9RBdbazclfhzascufgsmbkkamaLcbyd;0:G:cjbHjjjjbbgzBd:OwamclBd;8wazcbaLz:rjjjbhYamcuaLcK2alcjjjjd0Ecbyd;0:G:cjbHjjjjbbg8ABd:SwamcvBd;8wJbbbbhEdnalci6g3mbarcd4hKaihsa8AhzaLhrJbbbbh5inavasclfydbaK2cdtfgCIdlh8EavasydbaK2cdtfgXIdlhEavascwfydbaK2cdtfgQIdlh8FaCIdwhaaXIdwhhaQIdwhgazaCIdbg8JaXIdbg8KMaQIdbg8LMJbbnn:vUdbazclfaXIdlaCIdlMaQIdlMJbbnn:vUdbaQIdwh8MaCIdwh8NaXIdwhyazcxfa8EaE:tg8Eagah:tggNaaah:tgaa8FaE:tghN:tgEJbbbbJbbjZa8Ja8K:tg8FahNa8Ea8La8K:tg8KN:tghahNaEaENaaa8KNa8FagN:tgEaENMMg8K:rg8E:va8KJbbbb9BEg8KNUdbazczfaEa8KNUdbazcCfaha8KNUdbazcwfa8Maya8NMMJbbnn:vUdba5a8EMh5ascxfhsazcKfhzarcufgrmbka5aL:Z:vJbbbZNhEkamcuaLcdtalcFFFF970Ecbyd;0:G:cjbHjjjjbbgCBd:WwamcoBd;8waq:Zhhdna3mbcbhzaChsinasazBdbasclfhsaLazcefgz9hmbkkaEahNhhamcuaLcltalcFFFFd0Ecbyd;0:G:cjbHjjjjbbg8PBd:0wamcrBd;8wcba8Pa8AaCaLcbz:djjjb8AJFFuuh8MJFFuuh8NJFFuuhydnalci6mbJFFuuhya8AhzaLhsJFFuuh8NJFFuuh8MinazcwfIdbgEa8Ma8MaE9EEh8MazclfIdbgEa8Na8NaE9EEh8NazIdbgEayayaE9EEhyazcKfhzascufgsmbkkah:rhEamaocetgzcuaocu9kEcbyd;0:G:cjbHjjjjbbgCBd:4wdndnaoal9nmbaihzalhsinaCazydbcetfcFFi87ebazclfhzascufgsmbxdkkaCcFeazz:rjjjb8AkaEJbbbZNh8JcuhIdnalci6mbcbhsJFFuuhEa8AhzcuhIinazcwfIdba8M:tghahNazIdbay:tghahNazclfIdba8N:tghahNMM:rghaEaIcuSahaE9DVgXEhEasaIaXEhIazcKfhzaLascefgs9hmbkkamczfcbcjwz:rjjjb8Aam9cb83iwam9cb83ibaxa8JNh8RJbbjZak:th8Lcbh8SJbbbbhRJbbbbh8UJbbbbh8VJbbbbh8WJbbbbh8XJbbbbh8Ycbh8ZcbhPinJbbbbhEdna8STmbJbbjZa8S:Z:vhEkJbbbbhhdna8Ya8YNa8Wa8WNa8Xa8XNMMg8KJbbbb9BmbJbbjZa8K:r:vhhka8VaENh8Ka8UaENh5aRaENh8EaIhLdndndndndna8SaPVTmbamydwg80Tmea8YahNh8Fa8XahNhaa8WahNhgaeamydbcdtfh81cbh3JFFuuhEcvhQcuhLindnaHa81a3cdtfydbcdtgzfydbgvTmbaAaOazfydbcdtfhsindndnaCaiasydbgKcx2fgzclfydbgrcetf8Vebcs4aCazydbgXcetf8Vebcs4faCazcwfydbglcetf8Vebcs4fgombcbhzxekcehzaHaXcdtfydbgXceSmbcehzaHarcdtfydbgrceSmbcehzaHalcdtfydbglceSmbdnarcdSaXcdSfalcdSfcd6mbaocefhzxekaocdfhzkdnazaQ9kmba8AaKcK2fgXIdwa8K:tghahNaXIdba8E:tghahNaXIdla5:tghahNMM:ra8J:va8LNJbbjZMJ9VO:d86JbbjZaXIdCa8FNaXIdxagNaaaXIdzNMMakN:tghahJ9VO:d869DENghaEazaQ6ahaE9DVgXEhEaKaLaXEhLazaQaXEhQkasclfhsavcufgvmbkka3cefg3a809hmbkkaLcu9hmekama8KUd:ODama5Ud:KDama8EUd:GDamcuBd:qDamcFFF;7rBdjDa8Pcba8AaYamc:GDfamc:qDfamcjDfz:ejjjbamyd:qDhLdndnaxJbbbb9ETmba8SaD6mbaLcuSmeceh3amIdjDa8R9EmixdkaLcu9hmekdna8STmbabaPcltfgHam8Piw83dwaHam8Pib83dbaPcefhPkc3hHinamc:CwfaHfydbcbyd;4:G:cjbH:bjjjbbaHc98fgHc989hmbxvkkcbh3a8Saq9pmbamydwaCaiaLcx2fgzydbcetf8Vebcs4aCazcwfydbcetf8Vebcs4faCazclfydbcetf8Vebcs4ffaw9nmekcbhzcbhsdna8ZTmbcbhsamczfhXinamczfascdtfaXydbgQBdbaXclfhXasaYaQfRbbTfhsa8Zcufg8ZmbkkamydwhlamydbhXam9cu83i:GDam9cu83i:ODam9cu83i:qDam9cu83i:yDinamcjDfazfcFFF;7rBdbazclfgzcz9hmbkasc;8easclfc:bd6Eg8Zcdth80dnalTmbaeaXcdtfhocbhrindnaHaoarcdtfydbcdtgzfydbgvTmbaAaOazfydbcdtfhscuhQcuhzinaHaiasydbgKcx2fgXclfydbcdtfydbaHaXydbcdtfydbfaHaXcwfydbcdtfydbfgXazaXaz6gXEhzaKaQaXEhQasclfhsavcufgvmbkaQcuSmba8AaQcK2fgsIdwa8M:tgEaENasIdbay:tgEaENasIdla8N:tgEaENMM:rhEcbhsindndnazamc:qDfasfgvydbgX6mbazaX9hmeaEamcjDfasfIdb9FTmekavazBdbamc:GDfasfaQBdbamcjDfasfaEUdbxdkasclfgscz9hmbkkarcefgral9hmbkkamczfa80fhQcbhzcbhsindnamc:GDfazfydbgXcuSmbaQascdtfaXBdbascefhskazclfgzcz9hmbkasa8Zfg8ZTmbJFFuuhhcuhKamczfhza8ZhvcuhQina8AazydbgXcK2fgsIdwa8M:tgEaENasIdbay:tgEaENasIdla8N:tgEaENMM:rhEdndnaHaiaXcx2fgsclfydbcdtfydbaHasydbcdtfydbfaHascwfydbcdtfydbfgsaQ6mbasaQ9hmeaEah9DTmekaEhhashQaXhKkazclfhzavcufgvmbkaKcuSmbaKhLkdnamaiaLcx2fgrydbarclfydbarcwfydbaCabaeadaPawaqa3z:fjjjbTmbaPcefhPJbbbbhRJbbbbh8UJbbbbh8VJbbbbh8WJbbbbh8XJbbbbh8YkcbhXinaAaOaraXcdtfydbcdtgsfydbcdtfgKhzaHasfgvydbgQhsdnaQTmbdninazydbaLSmeazclfhzascufgsTmdxbkkazaKaQcdtfc98fydbBdbavavydbcufBdbkaXcefgXci9hmbka8AaLcK2fgzIdbhEazIdlhhazIdwh8KazIdxh5azIdzh8EazIdCh8FaYaLfce86bba8Ya8FMh8Ya8Xa8EMh8Xa8Wa5Mh8Wa8Va8KMh8Va8UahMh8UaRaEMhRamydxh8Sxbkkamc:WDf8KjjjjbaPkjoivuv99lu8Jjjjjbca9Rgo8Kjjjjbdndnalcw0mbaiydbhraeabcitfgwalcdtciVBdlawarBdbdnalcd6mbaiclfhralcufhDawcxfhwinarydbhqawcuBdbawc98faqBdbawcwfhwarclfhraDcufgDmbkkalabfhwxekcbhqaocbBdKao9cb83izaocbBdwao9cb83ibJbbjZhkJbbjZhxinadaiaqcdtfydbcK2fhDcbhwinaoczfawfgraDawfIdbgmarIdbgP:tgsaxNaPMgPUdbaoawfgrasamaP:tNarIdbMUdbawclfgwcx9hmbkJbbjZakJbbjZMgk:vhxaqcefgqal9hmbkcbhradcbcecdaoIdlgmaoIdwgP9GEgwaoIdbgsaP9GEawasam9GEgzcdtgwfhHaoczfawfIdbhmaihwalhDinaiarcdtfgqydbhOaqawydbgABdbawaOBdbawclfhwaraHaAcK2fIdbam9DfhraDcufgDmbkdndnarcv6mbavc8X9kmbaralc98f6mekaiydbhraeabcitfgwalcdtciVBdlawarBdbaiclfhralcufhDawcxfhwinarydbhqawcuBdbawc98faqBdbawcwfhwarclfhraDcufgDmbkalabfhwxekaeabcitfgwamUdbawawydlc98GazVBdlabcefaeadaiaravcefgqz:djjjbhDawawydlciGaDabcu7fcdtVBdlaDaeadaiarcdtfalar9Raqz:djjjbhwkaocaf8Kjjjjbawk;Oddvue99dninabaecitfgrydlgwcd4gDTmednawciGgqci9hmbcihqdnawcl6mbabaecitfhbcbheawhqcehkindnaiabydbgDfRbbmbcbhkadaDcK2fgwIdwalIdw:tgxaxNawIdbalIdb:tgxaxNawIdlalIdl:tgxaxNMM:rgxaoIdb9DTmbaoaxUdbavaDBdbarydlhqkabcwfhbaecefgeaqcd46mbkakceGTmikaraqciGBdlskdnabcbaDalaqcdtfIdbarIdb:tgxJbbbb9FEgwaD7aecefgDfgecitfydlabawaDfgDcitfydlVci0mbaraqBdlkabaDadaialavaoz:ejjjbax:laoIdb9Fmbkkkjlevudndnabydwgxaladcetfgm8Vebcs4alaecetfgP8Vebgscs4falaicetfgz8Vebcs4ffaD0mbakmbcbhDabydxaq6mekavawcltfgxab8Pdw83dwaxab8Pdb83dbabydbhDdnabydwgwTmbaoaDcdtfhxawhsinalaxydbcetfcFFi87ebaxclfhxascufgsmbkkabaDawfBdbabydxhxab9cb83dwababydlaxci2fBdlaP8VebhscehDcbhxkdnascztcz91cu9kmbabaxcefBdwaPax87ebaoabydbcdtfaxcdtfaeBdbkdnam8Uebcu9kmbababydwgxcefBdwamax87ebaoabydbcdtfaxcdtfadBdbkdnaz8Uebcu9kmbababydwgxcefBdwazax87ebaoabydbcdtfaxcdtfaiBdbkarabydlfabydxci2faPRbb86bbarabydlfabydxci2fcefamRbb86bbarabydlfabydxci2fcdfazRbb86bbababydxcefBdxaDk:mPrHue99eue99eue99iu8Jjjjjbc;W;Gb9Rgx8KjjjjbdndnalmbcbhmxekcbhPaxc:m;Gbfcbc;Kbz:rjjjb8Aaxcualci9UgscltascjjjjiGEcbyd;0:G:cjbHjjjjbbgzBd:m9GaxceBd;S9GaxcuascK2gHcKfalcpFFFe0Ecbyd;0:G:cjbHjjjjbbgOBd:q9GaxcdBd;S9Gdnalci6gAmbarcd4hCascdthXaOhQazhLinavaiaPcx2fgrydwaC2cdtfhKavarydlaC2cdtfhYavarydbaC2cdtfh8AcbhraLhEinaQarfgma8Aarfg3Idbg5aYarfg8EIdbg8Fa5a8F9DEg5UdbamaKarfgaIdbg8Fa5a8Fa59DEg8FUdbamcxfgma3Idbg5a8EIdbgha5ah9EEg5UdbamaaIdbgha5aha59EEg5UdbaEa8Fa5MJbbbZNUdbaEaXfhEarclfgrcx9hmbkaQcKfhQaLclfhLaPcefgPas9hmbkkaOaHfgr9cb83dbar9cb83dzar9cb83dwaxcuascx2gralc:bjjjl0Ecbyd;0:G:cjbHjjjjbbgHBdN9GaxciBd;S9GascdthgazarfhvaxcwVhPaxclVhCaHh8Jazh8KcbhLinaxcbcj;Gbz:rjjjbhEaLas2cdthadnaAmba8Khrash3inaEarydbgmc8F91cjjjj94Vam7gmcQ4cx2fg8Ea8EydwcefBdwaEamcd4cFrGcx2fg8Ea8EydbcefBdbaEamcx4cFrGcx2fgmamydlcefBdlarclfhra3cufg3mbkkazaafh8AaHaafhXcbhmcbh3cbh8EcbhainaEamfgrydbhQara3BdbarcwfgKydbhYaKaaBdbarclfgrydbhKara8EBdbaQa3fh3aYaafhaaKa8Efh8Eamcxfgmcj;Gb9hmbkdnaAmbcbhravhminamarBdbamclfhmasarcefgr9hmbkavhrashminaEa8Aarydbg3cdtfydbg8Ec8F91a8E7cd4cFrGcx2fg8Ea8Eydbg8EcefBdbaXa8Ecdtfa3Bdbarclfhramcufgmmbka8JhrashminaCa8Aarydbg3cdtfydbg8Ec8F91a8E7cx4cFrGcx2fg8Ea8Eydbg8EcefBdbava8Ecdtfa3BdbarclfhramcufgmmbkavhrashminaPa8Aarydbg3cdtfydbg8Ec8F91cjjjj94Va8E7cQ4cx2fg8Ea8Eydbg8EcefBdbaXa8Ecdtfa3Bdbarclfhramcufgmmbkka8Jagfh8Ja8Kagfh8KaLcefgLci9hmbkaEaocetgrcuaocu9kEcbyd;0:G:cjbHjjjjbbgKBd:y9GaEclBd;S9Gdndnaoal9nmbaihralhminaKarydbcetfcFFi87ebarclfhramcufgmmbxdkkaKcFearz:rjjjb8Akcbh8EaEascbyd;0:G:cjbHjjjjbbg8ABd:C9GaOaHaHascdtfaHascitfa8AascbazaKaiawaDaqakz:hjjjbdndnalci6mba8Ahrashmina8EarRbbfh8EarcefhramcufgmmbkaE9cb83iwaE9cb83ibalawc9:fgrfcufar9UgrasaDfcufaD9Ugmaram0EhYcbhmcbhra8Ehaincbh3dnarTmba8AarfRbbceSh3kamaEaiaHydbcx2fgQydbaQclfydbaQcwfydbaKabaeadamawaqa3a3ce7a8EaY9nVaaamfaY6VGz:fjjjbfhmaHclfhHaaa8AarfRbb9Rhaasarcefgr9hmbkaEydxTmeabamcltfgraE8Piw83dwaraE8Pib83dbamcefhmxekaE9cb83iwaE9cb83ibcbhmkczhrinaEc:m;Gbfarfydbcbyd;4:G:cjbH:bjjjbbarc98fgrc989hmbkkaxc;W;Gbf8Kjjjjbamk:wKDQue99iue99iul9:euw99iu8Jjjjjbc;qb9RgP8Kjjjjbaxhsaxhzdndnavax0gHmbdnavTmbcbhOaehzavhAinawaDazydbcx2fgCcwfydbcetfgX8VebhQawaCclfydbcetfgL8VebhKawaCydbcetfgC8VebhYaXce87ebaLce87ebaCce87ebaOaKcs4aYcs4faQcs4ffhOazclfhzaAcufgAmbkaehzavhAinawaDazydbcx2fgCcwfydbcetfcFFi87ebawaCclfydbcetfcFFi87ebawaCydbcetfcFFi87ebazclfhzaAcufgAmbkcehzaqhsaOaq0mekalce86bbalcefcbavcufz:rjjjb8AxekaPaiBdxaPadBdwaPaeBdlavakaqci9Ug8Aaka8Aak6EaHEgK9RhEaxaK9Rh3aKcufh5aKceth8EaKcdtgCc98fh8FavcitgOaC9Rarfc98fhaascufhhavcufhgaraOfh8JJbbjZas:Y:vh8KcbazceakaxSEg8Lcdtg8M9Rh8NJFFuuhycuh8PcbhIcbh8RinaPclfa8RcdtfydbhQaPcb8Pd:y:G:cjbg8S83i9iaPcb8Pd:q:G:cjbgR83inaPcb8Pd1:G:cjbg8U83iUaPcb8Pdj:G:cjbg8V83i8WaPa8S83iyaPaR83iaaPa8U83iKaPa8V83izaQavcdtgYfh8WcbhXinabaQaXcdtgLfydbcK2fhAcbhzinaPc8WfazfgCaAazfgOIdbg8XaCIdbg8Ya8Xa8Y9DEUdbaCczfgCaOcxfIdbg8XaCIdbg8Ya8Xa8Y9EEUdbazclfgzcx9hmbkaba8WaXcu7cdtfydbcK2fhAcbhzaPIdUh8ZaPId9ih80aPId80h81aPId9ehBaPId8Wh83aPIdnhUinaPczfazfgCaAazfgOIdbg8XaCIdbg8Ya8Xa8Y9DEUdbaCczfgCaOcxfIdbg8XaCIdbg8Ya8Xa8Y9EEUdbazclfgzcx9hmbkaraLfgza80a8Z:tg8XaUa83:tg8YNa8YaBa81:tg8ZNa8Za8XNMMUdbazaYfaPIdyaPIdK:tg8XaPIdaaPIdz:tg8YNa8YaPId8KaPIdC:tg8ZNa8Za8XNMMUdbaXcefgXav9hmbkcbh85dnaHmbcbhAaQhza8JhCavhXinawaDazydbcx2fgOcwfydbcetfgL8Vebh8WawaOclfydbcetfg858Vebh86awaOydbcetfgO8Vebh87aLce87eba85ce87ebaOce87ebaCaAa86cs4a87cs4fa8Wcs4ffgABdbazclfhzaCclfhCaXcufgXmbkavhCinawaDaQydbcx2fgzcwfydbcetfcFFi87ebawazclfydbcetfcFFi87ebawazydbcetfcFFi87ebaQclfhQaCcufgCmbka8Jh85kdndndndndndndndndndndnava8E6mba8Eax9nmeavavaK9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rci9hmbkdndnaoc8X9kmba8Pcb9omeka8Acufh85cbhYindndndnavaY9RaxaYaxfav0Eg8WTmbcbhAaeaYcdtfgzhCa8WhXinawaDaCydbcx2fgOcwfydbcetfgQ8VebhbawaOclfydbcetfgL8VebhrawaOydbcetfgO8VebhKaQce87ebaLce87ebaOce87ebaAarcs4aKcs4fabcs4ffhAaCclfhCaXcufgXmbka8WhOinawaDazydbcx2fgCcwfydbcetfcFFi87ebawaCclfydbcetfcFFi87ebawaCydbcetfcFFi87ebazclfhzaOcufgOmbkaAaq0mekalaYfgzce86bbazcefcba8Wcufz:rjjjb8AxekalaYfgzce86bbazcefcba85z:rjjjb8Aa8Ah8Wka8WaYfgYav9pmdxbkkaravcdtg8WfhLdnaITmbaPclfa8PcdtfydbhzaIhCinaLazydbfcb86bbazclfhzaCcufgCmbkkdnavaI9nmbaPclfa8PcdtfydbaIcdtfhzavaI9RhCinaLazydbfce86bbazclfhzaCcufgCmbkkcbhYindnaYa8PSmbcbhzaraPclfaYcdtfydbgKa8Wz:qjjjbhCavhXaIhOinaKaOazaLaCydbgQfRbbgAEcdtfaQBdbaCclfhCaOaAfhOazaA9RcefhzaXcufgXmbkkaYcefgYci9hmbkabaeadaialaIaocefgCarawaDaqakaxamz:hjjjbabaeaIcdtgzfadazfaiazfalaIfavaI9RaCarawaDaqakaxamz:hjjjbkaPc;qbf8Kjjjjbk:Seeru8Jjjjjbc:q;ab9Rgo8Kjjjjbaoc:q8WfcFecjzz:rjjjb8AcbhrdnadTmbaehwadhDinaoarcdtfawydbgqBdbaoc:q8WfaqcFiGcdtfgkydbhxakaqBdbawclfhwaraxaq9hfhraDcufgDmbkkabaeadaoaraiavz:jjjjbaoc:q;abf8Kjjjjbk;Sqloud99euD998Jjjjjbc:W;ab9Rgr8KjjjjbdndnadTmbaocd4hwcbhDcbhqindnavaeclfydbaw2cdtfgkIdbavaeydbaw2cdtfgxIdbgm:tgPavaecwfydbaw2cdtfgsIdlaxIdlgz:tgHNakIdlaz:tgOasIdbam:tgAN:tgCaCNaOasIdwaxIdwgX:tgQNakIdwaX:tgOaHN:tgHaHNaOaANaPaQN:tgPaPNMMgOJbbbb9Bmbarc8WfaDcltfgkaCaO:rgO:vgCUdwakaPaO:vgPUdlakaHaO:vgHUdbakaCaXNaHamNazaPNMM:mUdxaDcefhDkaecxfheaqcifgqad6mbkab9cb83dyab9cb83daab9cb83dKab9cb83dzab9cb83dwab9cb83dbaDTmearcbBd8Sar9cb83iKar9cb83izarczfavalaoarc8Sfcbcraiz:kjjjbarIdKhQarIdChLarIdzhKar9cb83iwar9cb83ibararc8WfaDczarc8Sfcbcicbz:kjjjbJbbbbhmdnarIdwgzazNarIdbgHaHNarIdlgXaXNMMgCJbbbb9BmbJbbjZaC:r:vhmkazamNhCaXamNhXaHamNhHJbbjZhmarc8WfheaDhvinaecwfIdbaCNaeIdbaHNaXaeclfIdbNMMgzamazam9DEhmaeczfheavcufgvmbkabaQUdwabaLUdlabaKUdbabarId3UdxdndnamJ;n;m;m899FmbJbbbbhzarc8WfheinaecxfIdbaQaecwfIdbgPNaKaeIdbgONaLaeclfIdbgANMMMaCaPNaHaONaXaANMM:vgPazaPaz9EEhzaeczfheaDcufgDmbkabaCUd8KabaXUdaabaHUd3abaQaCazN:tUdKabaLaXazN:tUdCabaKaHazN:tUdzabJbbjZamamN:t:rgmUdydndnaCJbbj:;aCJbbj:;9GEgzJbbjZazJbbjZ9FEJbb;:9cNJbbbZJbbb:;aCJbbbb9GEMgz:lJbbb9p9DTmbaz:Ohexekcjjjj94hekabae86b8UdndnaXJbbj:;aXJbbj:;9GEgzJbbjZazJbbjZ9FEJbb;:9cNJbbbZJbbb:;aXJbbbb9GEMgz:lJbbb9p9DTmbaz:Ohvxekcjjjj94hvkabav86bRdndnaHJbbj:;aHJbbj:;9GEgzJbbjZazJbbjZ9FEJbb;:9cNJbbbZJbbb:;aHJbbbb9GEMgz:lJbbb9p9DTmbaz:Ohwxekcjjjj94hwkabaw86b8SdndnaecKtcK91:YJbb;:9c:vaC:t:lavcKtcK91:YJbb;:9c:vaX:t:lawcKtcK91:YJbb;:9c:vaH:t:lamMMMJbb;:9cNJbbjZMgm:lJbbb9p9DTmbam:Ohexekcjjjj94hekaecFbaecFb9iEhexekabcjjj;8iBdycFbhekabae86b8Vxekab9cb83dyab9cb83daab9cb83dKab9cb83dzab9cb83dwab9cb83dbkarc:W;abf8Kjjjjbk;7woDuo99eue99euv998Jjjjjbcje9Rgw8Kjjjjbawc;abfcbaocdtgDz:rjjjb8Aawc;GbfcbaDz:rjjjb8AawcafhDawhqaohkinaqcFFF97BdbaDcFFF;7rBdbaqclfhqaDclfhDakcufgkmbkavcd4hxaicd4hmdnadTmbaocx2hPcbhsinashzdnarTmbarascdtfydbhzkaeazam2cdtfgDIdwhHaDIdlhOaDIdbhAalazax2cdtfIdbhCcbhDawcafhqawc;Gbfhvawhkawc;abfhiinaCaDc:O:G:cjbfIdbaHNaDc:G:G:cjbfIdbaANaDc:K:G:cjbfIdbaONMMgXMhQazhLdnaXaC:tgXaqIdbgK9DgYmbavydbhLkavaLBdbazhLdnaQakIdbg8A9EmbaiydbhLa8AhQkaiaLBdbakaQUdbaqaXaKaYEUdbaiclfhiakclfhkavclfhvaqclfhqaPaDcxfgD9hmbkascefgsad9hmbkkJbbbbhQcbhLawc;GbfhDawc;abfhqcbhkinalaqydbgvax2cdtfIdbalaDydbgiax2cdtfIdbaeavam2cdtfgvIdwaeaiam2cdtfgiIdw:tgCaCNavIdbaiIdb:tgCaCNavIdlaiIdl:tgCaCNMM:rMMgCaQaCaQ9EgvEhQakaLavEhLaqclfhqaDclfhDaoakcefgk9hmbkJbbbbhCdnaeawc;abfaLcdtgqfydbgkam2cdtfgDIdwaeawc;Gbfaqfydbgvam2cdtfgqIdwgH:tgXaXNaDIdbaqIdbgA:tg8Aa8ANaDIdlaqIdlgE:tgOaONMMgKJbbbb9ETmbaK:rgCalakax2cdtfIdbMalavax2cdtfIdb:taCaCM:vhCkaQJbbbZNhKaXaCNaHMhHaOaCNaEMhOa8AaCNaAMhAdnadTmbcbhqarhkinaqhDdnarTmbakydbhDkdnalaDax2cdtfIdbg3aeaDam2cdtfgDIdwaH:tgQaQNaDIdbaA:tgCaCNaDIdlaO:tgXaXNMMg5:rgEMg8EaK9ETmbJbbbbh8Adna5Jbbbb9ETmba8EaK:taEaEM:vh8Aka8AaQNaHMhHa8AaXNaOMhOa8AaCNaAMhAa3aKaEMMJbbbZNhKkakclfhkadaqcefgq9hmbkkabaKUdxabaHUdwabaOUdlabaAUdbawcjef8Kjjjjbk:reevu8Jjjjjbcj8W9Rgr8Kjjjjbaici2hwcbhDdnaiTmbarhiawhqinaiaeadRbbgkcdtfydbBdbaDakcefgkaDak0EhDaiclfhiadcefhdaqcufgqmbkkabarawaeaDalaoz:jjjjbarcj8Wf8Kjjjjbk:Eeeeu8Jjjjjbca9Rgo8Kjjjjbab9cb83dyab9cb83daab9cb83dKab9cb83dzab9cb83dwab9cb83dbdnadTmbaocbBd3ao9cb83iwao9cb83ibaoaeadaialaoc3falEavcbalEcrcbz:kjjjbabao8Pib83dbabao8Piw83dwkaocaf8Kjjjjbk::meQu8Jjjjjbcjz9Rgv8KjjjjbcbhoavcjPfcbaez:rjjjb8Aavcjxfcbaez:rjjjb8AdnaiTmbadhoaihrinavcjxfaoRbbfgwawRbbcef86bbavcjxfaocefRbbfgwawRbbcef86bbavcjxfaocdfRbbfgwawRbbcef86bbaocifhoarcufgrmbkcbhDcjehoadhqcehkindndnalTmbcbhxcuhmaqhrakhwcuhPinawcufamaoavcjPfarcefRbbgsfRbb9RcFeGgzci6aoavcjPfarRbbgHfRbb9RcFeGgOci6faoavcjPfarcdfRbbgAfRbb9RcFeGgCci6fgXcOtaOcFr7azaCf9RcwtVavcjxfaAfRbbgzavcjxfaHfRbbgHavcjxfasfRbbgsaHas6Egsazas6EcFe7VgsaP9kgzEhmaXcd6gHaxcefgOal9iVce9hmdasaPazEhPaxaOaHEhxarcifhrawai6hsawcefhwasmbxdkkcuhmaqhrakhwcuhxinawcufamaoavcjPfarcefRbbfRbb9RcFeGci6aoavcjPfarRbbfRbb9RcFeGci6faoavcjPfarcdfRbbfRbb9RcFeGci6fgPax9kgsEhmaPce0meaPaxasEhxarcifhrawai6hPawcefhwaPmbkkadamci2fgrcdfRbbhwarcefRbbhxarRbbhPadaDci2fgrcifaramaD9Rci2zNjjjb8AaPavcjPffaocefgo86bbaPavcjxffgmamRbbcuf86bbaxavcjPffao86bbaxavcjxffgmamRbbcuf86bbarcdfaw86bbarcefax86bbaraP86bbawavcjPffao86bbawavcjxffgrarRbbcuf86bbaqcifhqakcefhkaDcefgDai9hmbkcbhzdnalcb9mmbcbhsavcjPfcbaez:rjjjb8Aadcvfhlinadasci2fgxcefgDRbbhoaxcdfgqRbbhrdndnavcjPfaxRbbgmfRbbmbavcjPfarfRbbhwdndndnavcjPfaofRbbTmbawcFeGTmexikawcFeGmdascefgAai9pmdasc980mdascifhQcbhLarcFeGhCamcFeGhXalhwcbhKcbhYinawcufRbbhPawRbbhOcehkdndnawc9:fRbbgHao9hmbaPcFeGamSmekdnaPcFeGao9hmbaOcFeGamSmekaHamSaOcFeGaoSGhkkceh8AaYceGhYdndnaHar9hmbaPcFeGaoSmekdnaPcFeGar9hmbaOcFeGaoSmekaHaoSaOcFeGarSGh8AkakaYVhYaLaHcFeGgHaXSaPcFeGgPaCSGaPaXSaOcFeGgPaCSGVaHaCSaPaXSGVVhLa8AaKceGVhKdnaAcefgPai9pmbawcifhwaAaQ6hHaPhAaHmekkaYTmeaKmekarhwaohPaohHarhOamhrxdkdnaYTaLVceGTmbaYaKTVaLVceGmekamhwarhParhHamhOaohrxekaohwamhPamhHaohOkavcjPfarfce86bbavcjPfawfce86bbaxaH86bbaqar86bbaDaO86bbavcjPfaPfce86bbalcifhlascefgsai9hmbkkavcFeaecetz:rjjjbhwaici2hrindnawadRbbgmcetfgx8Uebgocu9kmbaxaz87ebawcjlfazcdtfabamcdtfydbBdbazhoazcefhzkadao86bbadcefhdarcufgrmbkazcdthokabavcjlfaoz:qjjjb8Aavcjzf8KjjjjbkObabaiaeadcbz:njjjbk9teiucbcbyd;8:G:cjbgeabcifc98GfgbBd;8:G:cjbdndnabZbcztgd9nmbcuhiabad9RcFFifcz4nbcuSmekaehikaik;LeeeudndnaeabVciGTmbabhixekdndnadcz9pmbabhixekabhiinaiaeydbBdbaiclfaeclfydbBdbaicwfaecwfydbBdbaicxfaecxfydbBdbaeczfheaiczfhiadc9Wfgdcs0mbkkadcl6mbinaiaeydbBdbaeclfheaiclfhiadc98fgdci0mbkkdnadTmbinaiaeRbb86bbaicefhiaecefheadcufgdmbkkabk;aeedudndnabciGTmbabhixekaecFeGc:b:c:ew2hldndnadcz9pmbabhixekabhiinaialBdbaicxfalBdbaicwfalBdbaiclfalBdbaiczfhiadc9Wfgdcs0mbkkadcl6mbinaialBdbaiclfhiadc98fgdci0mbkkdnadTmbinaiae86bbaicefhiadcufgdmbkkabk9teiucbcbyd;8:G:cjbgeabcrfc94GfgbBd;8:G:cjbdndnabZbcztgd9nmbcuhiabad9RcFFifcz4nbcuSmekaehikaikTeeucbabcbyd;8:G:cjbge9Rcifc98GaefgbBd;8:G:cjbdnabZbcztge9nmbabae9RcFFifcz4nb8Akk:3qeludndnadch6mbadTmeabaead;8qbbabskabaeSmbdnaeadabfgi9Rcbadcet9R0mbadTmeabaead;8qbbabskaeab7ciGhldndndnabae9pmbdnalTmbadhvabhixikdnabciGmbadhvabhixdkadTmiabaeRbb86bbadcufhvdnabcefgiciGmbaecefhexdkavTmiabaeRbe86beadc9:fhvdnabcdfgiciGmbaecdfhexdkavTmiabaeRbd86bdadc99fhvdnabcifgiciGmbaecifhexdkavTmiabaeRbi86biabclfhiaeclfheadc98fhvxekdnalmbdnaiciGTmbadTmlabadcufgifglaeaifRbb86bbdnalciGmbaihdxekaiTmlabadc9:fgifglaeaifRbb86bbdnalciGmbaihdxekaiTmlabadc99fgifglaeaifRbb86bbdnalciGmbaihdxekaiTmlabadc98fgdfaeadfRbb86bbkadcl6mbdnadc98fgocxGcxSmbaocd4cefciGhiaec98fhlabc98fhvinavadfaladfydbBdbadc98fhdaicufgimbkkaocx6mbaec9Wfhvabc9WfhoinaoadfgicxfavadfglcxfydbBdbaicwfalcwfydbBdbaiclfalclfydbBdbaialydbBdbadc9Wfgdci0mbkkadTmdadhidnadciGglTmbaecufhvabcufhoadhiinaoaifavaifRbb86bbaicufhialcufglmbkkadcl6mdaec98fhlabc98fhvinavaifgecifalaifgdcifRbb86bbaecdfadcdfRbb86bbaecefadcefRbb86bbaeadRbb86bbaic98fgimbxikkavcl6mbdnavc98fglc3Gc3Smbavalcd4cefcrGgdcdt9RhvinaiaeydbBdbaeclfheaiclfhiadcufgdmbkkalc36mbinaiaeydbBdbaiclfaeclfydbBdbaicwfaecwfydbBdbaicxfaecxfydbBdbaiczfaeczfydbBdbaicCfaecCfydbBdbaicKfaecKfydbBdbaic3faec3fydbBdbaecafheaicafhiavc9Gfgvci0mbkkavTmbdndnavcrGgdmbavhlxekavc94GhlinaiaeRbb86bbaicefhiaecefheadcufgdmbkkavcw6mbinaiaeRbb86bbaicefaecefRbb86bbaicdfaecdfRbb86bbaicifaecifRbb86bbaiclfaeclfRbb86bbaicvfaecvfRbb86bbaicofaecofRbb86bbaicrfaecrfRbb86bbaicwfhiaecwfhealc94fglmbkkabkk:pedbcj:GdktFFuuFFuuFFuubbbbFFuFFFuFFFuFbbbbbbjZbbbbbbbbbbbbbbjZbbbbbbbbbbbbbbjZ86;nAZ86;nAZ86;nAZ86;nA:;86;nAZ86;nAZ86;nAZ86;nA:;86;nAZ86;nAZ86;nAZ86;nA:;bc;0:Gdkxebbbdbbbj:qbb",t=new Uint8Array([32,0,65,2,1,106,34,33,3,128,11,4,13,64,6,253,10,7,15,116,127,5,8,12,40,16,19,54,20,9,27,255,113,17,42,67,24,23,146,148,18,14,22,45,70,69,56,114,101,21,25,63,75,136,108,28,118,29,73,115]);if(typeof WebAssembly!="object")return{supported:!1};var n,i=WebAssembly.instantiate(o(e),{}).then(function(y){n=y.instance,n.exports.__wasm_call_ctors()});function o(y){for(var _=new Uint8Array(y.length),S=0;S96?Z-97:Z>64?Z-39:Z+4}for(var R=0,S=0;S=3),r(Z>=3&&Z<=256),r(R>=1&&R<=512),C=C||0;var E=y.BYTES_PER_ELEMENT==4?y:new Uint32Array(y);return u(n.exports.meshopt_buildMeshletsFlex,E,_,_.length/S,S*4,Z,R,R,C,0)},buildMeshletsFlex:function(y,_,S,Z,R,C,E,A){r(y.length%3==0),r(_ instanceof Float32Array),r(_.length%S==0),r(S>=3),r(Z>=3&&Z<=256),r(R>=1&&C<=512),r(R<=C),E=E||0,A=A||0;var L=y.BYTES_PER_ELEMENT==4?y:new Uint32Array(y);return u(n.exports.meshopt_buildMeshletsFlex,L,_,_.length/S,S*4,Z,R,C,E,A)},buildMeshletsSpatial:function(y,_,S,Z,R,C,E){r(y.length%3==0),r(_ instanceof Float32Array),r(_.length%S==0),r(S>=3),r(Z>=3&&Z<=256),r(R>=1&&C<=512),r(R<=C),E=E||0;var A=y.BYTES_PER_ELEMENT==4?y:new Uint32Array(y);return u(n.exports.meshopt_buildMeshletsSpatial,A,_,_.length/S,S*4,Z,R,C,E)},extractMeshlet:function(y,_){return r(_>=0&&_=3);var Z=y.BYTES_PER_ELEMENT==4?y:new Uint32Array(y);return b(Z,_,_.length/S,S*4)},computeMeshletBounds:function(y,_,S){return r(_ instanceof Float32Array),r(_.length%S==0),r(S>=3),p(y,_,_.length/S,S*4)},computeSphereBounds:function(y,_,S,Z){return r(y instanceof Float32Array),r(y.length%_==0),r(_>=3),r(!S||S instanceof Float32Array),r(!S||S.length%Z==0),r(!S||Z>=1),r(!S||y.length/_==S.length/Z),Z=Z||0,f(y,y.length/_,_*4,S,Z*4)}}})();var Q2n=x(T(),1),J2n=(function(){var e="b9H79Tebbbegv9Geueu9Geub9Gbb9Gkuuuuuuuuuuub9Giuuueuirodiblbelve9Weiiviebeoweuecj:Gdkrnlo9TW9T9VV95dbH9F9F939H79T9F9J9H229F9Jt9VV7bbK9TW79O9V9Wt9F9NW9UWV9HtW9u9H9U9NW9Ut7bel79IV9RbdDwebcekdlvq;m8Lodbk:wgvOuw99iuv99vu8Jjjjjbc;Wb9Rgk8Kjjjjbakcxfcbc;Kbz:djjjb8AakcualcdtgxalcFFFFi0Ecbyd:q:G:cjbHjjjjbbgmBdxakceBd2adci9UhPalcd4alfhscehzinazgHcethzaHas6mbkakcuaHcdtgzaHcFFFFi0Ecbyd:q:G:cjbHjjjjbbgsBdzakcdBd2ascFeazz:djjjbhOaDcd4hAarcd4hCavcd4hXdnalTmbaHcufhrcbhvindndnaOcbaiavaX2cdtfgHydlgDaDcjjjj94SEgscH4cbaoavaC2cdtfgzydlgQcs4aQcjjjj94SE7as7c:F:b:DD2cbaHydbgLaLcjjjj94SEgscH4cbazydbgKcs4aKcjjjj94SE7as7c;D;O:B8J27cbaHydwgYaYcjjjj94SEgHcH4cbazydwg8Acs4a8Acjjjj94SE7aH7c:3F;N8N27awavaA2cdtfgHydlgEaHydbg37cFFFFrGgHcm4aH7c:fjjK27arGgscdtfgHydbgzcuSmbaE::h5a3::h8Ea8A::h8FaQ::haaK::hhaY::hgaD::h8JaL::h8KcehDinaDhHdnaiazaX2cdtfgDIdba8K9CmbaDIdla8J9CmbaDIdwag9CmbaoazaC2cdtfgDIdbah9CmbaDIdlaa9CmbaDIdwa8F9CmbawazaA2cdtfgDIdba8E9CmbaDIdla59BmikaHcefhDaOasaHfarGgscdtfgHydbgzcu9hmbkkaHavBdbavhzkamavcdtfazBdbavcefgval9hmbkkaOcbydN:G:cjbH:bjjjbbakceBd2akcualcefgHcdtaHcFFFFi0Ecbyd:q:G:cjbHjjjjbbg8LBdzakcdBd2akcuadcdtadcFFFFi0EgYcbyd:q:G:cjbHjjjjbbg8MBdCakciBd2a8Lclfcbaxz:djjjbhzdnadTmbdnaeTmbaehHadhsinazamaHydbcdtfydbcdtfgDaDydbcefBdbaHclfhHascufgsmbxdkkamhHadhsinazaHydbcdtfgDaDydbcefBdbaHclfhHascufgsmbkkdnalTmbcbhsazhHalhDinaHydbhOaHasBdbaHclfhHaOasfhsaDcufgDmbkkdnadci6gQmbcbhscdhHaPhOindndnaeTmbamaeasfgvydbcdtfhDamavcwfydbcdtfhramavclfydbcdtfhvxekamasfgDcwfhraDclfhvkarydbhravydbhvazaDydbcdtfgDaDydbgDcefBdba8MaDcdtfaHc9:fBdbazavcdtfgDaDydbgDcefBdba8MaDcdtfaHcufBdbazarcdtfgDaDydbgDcefBdba8MaDcdtfaHBdbascxfhsaHclfhHaOcufgOmbkkcbhsa8LcbBdbakcuaPcltadcFFFFd0Ecbyd:q:G:cjbHjjjjbbg8NBdKakclBd2dnaQmbaehza8NhHaPhvindndnaeTmbazcwfydbhDazclfydbhOazydbhrxekascdfhDascefhOashrkJbbbbh8KJbbbbJbbbbJbbbbJbbbbJbbjZJbbj:;awaOaA2cdtfgQIdbawaraA2cdtfgLIdbgh:tawaDaA2cdtfgKIdlaLIdlgg:tg8JNaQIdlag:tggaKIdbah:tN:tghJbbbb9EEahJbbbb9BEg8EaiaraX2cdtfgrIdwghaiaOaX2cdtfgOIdwg59BEa8EarIdlgaaOIdlgy9BEa8EarIdbg8FaOIdbg8P9BEg8EahaiaDaX2cdtfgDIdwgI9BEa8EaaaDIdlg8R9BEa8Ea8FaDIdbg8S9BEg8Ea5aI9BEa8Eaya8R9BEa8Ea8Pa8S9BEh8Edna8Ja5ah:tNagaIah:tN:tghahNa8Ja8Pa8F:tNaga8Sa8F:tN:tg8Fa8FNa8Jayaa:tNaga8Raa:tN:tg8Ja8JNMMggJbbbb9Bmba8Eag:r:vh8KkaHcxfa8EUdbaHcwfaha8KNUdbaHclfa8Ja8KNUdbaHa8Fa8KNUdbazcxfhzaHczfhHascifhsavcufgvmbkkcbhHakaYcbyd:q:G:cjbHjjjjbbgDBd3akcvBd2dnadTmbaDhzinazaHBdbazclfhzadaHcefgH9hmbkkakcuaPcdtadcFFFF970Ecbyd:q:G:cjbHjjjjbbgvBdaakcoBd2akaPcbyd:q:G:cjbHjjjjbbg8ABd8KakcrBd2dnadci6mba8NcxfhzavhscbhHinasaHBdba8AaHfcdcbazIdbg8KJbbbb9DEa8KJbbbb9EV86bbasclfhsazczfhzaPaHcefgH9hmbkkdnalTmbcbhRinaRcdthHdna8LaRcefgRcdtfydbgza8LaHfydbgHSmbazaH9RhLa8MaHcdtfhKcbh8UinaKa8Ucdtfg8VydbgHcd4g8Wci2gxaHciGcdtgzyd:e:G:cjbfhHaxazydj:G:cjbfhzdnaeTmbaeaHcdtfydbhHaeazcdtfydbhzkdna8Ucefg8UaL9pmbamaHcdtfydbhYamazcdtfydbh3a8Aa8WfhEava8Wcdtfh8Xa8UhwinaKawcdtfgQydbgHcd4gzci2gAaHciGcdtgHyd:e:G:cjbfhsaAaHydj:G:cjbfhHdnaeTmbaeascdtfydbhsaeaHcdtfydbhHkdndnamaHcdtfydbaYSmbamascdtfydba39hmeka8AazfRbbgHaERbbgsVciSmbdnaHasGmba8Whsdna8Wa8XydbgHSmba8XhOinaOavaHgscdtfgrydbgHBdbarhOasaH9hmbkkdnazavazcdtfgOydbgHSmbinaOavaHgzcdtfgrydbgHBdbarhOazaH9hmbkkasazSmba8AazfgORbba8AasfgHRbbVciSmeavazcdtfasBdbaHaHRbbaORbbV86bbkdna8VydbciGaxfgzaDazcdtfgsydbgHSmbinasaDaHgzcdtfgOydbgHBdbaOhsazaH9hmbkkdnaQydbciGaAfgsaDascdtfgOydbgHSmbinaOaDaHgscdtfgrydbgHBdbarhOasaH9hmbkkazasSmbaDascdtfazBdbkawcefgwaL9hmbkka8UaL9hmbkkaRal9hmbkkdnadTmbcbhrinarhzdnaraDarcdtfgwydbgHSmbawhsinasaDaHgzcdtfgOydbgHBdbaOhsazaH9hmbkkawazBdbarcefgrad9hmbkcbh8Vabcbadcltz:djjjbhKdnadci6mbaqceGhEaDhYaeh3cbh8Windna8Na8WcltfgsIdxJbbbb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MMgaJbbbb9BmbJbbjZaa:r:vh8KkaOa8Ja8KNUdbaraha8KNUdbaHaga8KNg8JUdbavmbaHJbbjZa8Ja8KJbbbb9BEUdbkasclfhsaHczfhHadazcefgz9hmbkcbhHaKhzindnaHaDydbgsSmbazaKascltfgsydwBdwazas8Pdb83dbkaDclfhDazczfhzadaHcefgH9hmbkkdnakyd2gzTmbazcdtakcxffc98fhHinaHydbcbydN:G:cjbH:bjjjbbaHc98fhHazcufgzmbkkakc;Wbf8Kjjjjbk9teiucbcbyd:y:G:cjbgeabcifc98GfgbBd:y:G:cjbdndnabZbcztgd9nmbcuhiabad9RcFFifcz4nbcuSmekaehikaik;aeedudndnabciGTmbabhixekaecFeGc:b:c:ew2hldndnadcz9pmbabhixekabhiinaialBdbaicxfalBdbaicwfalBdbaiclfalBdbaiczfhiadc9Wfgdcs0mbkkadcl6mbinaialBdbaiclfhiadc98fgdci0mbkkdnadTmbinaiae86bbaicefhiadcufgdmbkkabk9teiucbcbyd:y:G:cjbgeabcrfc94GfgbBd:y:G:cjbdndnabZbcztgd9nmbcuhiabad9RcFFifcz4nbcuSmekaehikaikTeeucbabcbyd:y:G:cjbge9Rcifc98GaefgbBd:y:G:cjbdnabZbcztge9nmbabae9RcFFifcz4nb8Akkk8Rdbcj:Gdkzebbbdbbbbbbbebbbbc:q:Gdkxebbbdbbba:qbb",t=new Uint8Array([32,0,65,2,1,106,34,33,3,128,11,4,13,64,6,253,10,7,15,116,127,5,8,12,40,16,19,54,20,9,27,255,113,17,42,67,24,23,146,148,18,14,22,45,70,69,56,114,101,21,25,63,75,136,108,28,118,29,73,115]);if(typeof WebAssembly!="object")return{supported:!1};var n,i=WebAssembly.instantiate(o(e),{}).then(function(d){n=d.instance,n.exports.__wasm_call_ctors()});function o(d){for(var u=new Uint8Array(d.length),m=0;m96?p-97:p>64?p-39:p+4}for(var b=0,m=0;m=3),r(p instanceof Float32Array),r(p.length%b==0),r(b>=3),r(f instanceof Float32Array),r(f.length%y==0),r(y>=2),r(u.length/m==p.length/b),r(u.length/m==f.length/y),r(d!==null||u.length/m%3==0);for(var S=0,Z=0;Z<(_?_.length:0);++Z)r(_[Z]in c),S|=c[_[Z]];var R=u.length/m,C=d?d.length:R,E=d===null||d.BYTES_PER_ELEMENT==4?d:new Uint32Array(d);return a(E,C,u,R,m,p,b,f,y,S)}}})();var v8=class extends io{constructor(t){super(),t=t??B.EMPTY_OBJECT;let n=t.resourceCache,i=t.gltf,o=t.bufferViewId,r=t.gltfResource,s=t.baseResource,a=t.cacheKey,c=i.bufferViews[o],d=c.buffer,u=c.byteOffset,m=c.byteLength,p=!1,b,f,y,_,S=tx(c);l(S)&&(d=S.buffer,u=S.byteOffset??0,m=S.byteLength,p=!0,b=S.byteStride,f=S.count,y=S.mode,_=S.filter??"NONE");let Z=i.buffers[d];this._hasMeshopt=p,this._meshoptByteStride=b,this._meshoptCount=f,this._meshoptMode=y,this._meshoptFilter=_,this._resourceCache=n,this._gltfResource=r,this._baseResource=s,this._buffer=Z,this._bufferId=d,this._byteOffset=u,this._byteLength=m,this._cacheKey=a,this._bufferLoader=void 0,this._typedArray=void 0,this._state=Rt.UNLOADED,this._promise=void 0}get cacheKey(){return this._cacheKey}get typedArray(){return this._typedArray}async load(){return l(this._promise)?this._promise:(this._state=Rt.LOADING,this._promise=X4e(this),this._promise)}unload(){l(this._bufferLoader)&&!this._bufferLoader.isDestroyed()&&this._resourceCache.unload(this._bufferLoader),this._bufferLoader=void 0,this._typedArray=void 0}};async function X4e(e){try{let t=N4e(e);if(e._bufferLoader=t,await t.load(),e.isDestroyed())return;let n=t.typedArray,i=new Uint8Array(n.buffer,n.byteOffset+e._byteOffset,e._byteLength);if(e.unload(),e._typedArray=i,e._hasMeshopt){let o=e._meshoptCount,r=e._meshoptByteStride,s=new Uint8Array(o*r);nx.decodeGltfBuffer(s,o,r,e._typedArray,e._meshoptMode,e._meshoptFilter),e._typedArray=s}return e._state=Rt.READY,e}catch(t){if(e.isDestroyed())return;throw e.unload(),e._state=Rt.FAILED,e.getError("Failed to load buffer view",t)}}function N4e(e){let t=e._resourceCache,n=e._buffer;if(l(n.uri)){let r=e._baseResource.getDerivedResource({url:n.uri});return t.getExternalBufferLoader({resource:r})}let i=n.extras?._pipeline?.source;return t.getEmbeddedBufferLoader({parentResource:e._gltfResource,bufferId:e._bufferId,typedArray:i})}var O1=v8;var LFn=x(T(),1);var yFn=x(T(),1);var eS=class e{static _getDecoderTaskProcessor(){if(!l(e._decoderTaskProcessor)){let t=new qn("decodeDraco",e._maxDecodingConcurrency);t.initWebAssemblyModule({wasmBinaryFile:"ThirdParty/draco_decoder.wasm"}).then(function(n){n?e._taskProcessorReady=!0:e._error=new ae("Draco decoder could not be initialized.")}).catch(n=>{e._error=n}),e._decoderTaskProcessor=t}return e._decoderTaskProcessor}static decodePointCloud(t){let n=e._getDecoderTaskProcessor();if(l(e._error))throw e._error;if(e._taskProcessorReady)return n.scheduleTask(t,[t.buffer.buffer])}static decodeBufferView(t){let n=e._getDecoderTaskProcessor();if(l(e._error))throw e._error;if(e._taskProcessorReady)return n.scheduleTask(t,[t.array.buffer])}};eS._maxDecodingConcurrency=Math.max(fn.hardwareConcurrency-1,1);eS._decoderTaskProcessor=void 0;eS._taskProcessorReady=!1;eS._error=void 0;var vb=eS;var _Fn=x(T(),1);var Pn={POSITION:"POSITION",NORMAL:"NORMAL",TANGENT:"TANGENT",TEXCOORD:"TEXCOORD",COLOR:"COLOR",JOINTS:"JOINTS",WEIGHTS:"WEIGHTS",FEATURE_ID:"_FEATURE_ID",SCALE:"KHR_gaussian_splatting:SCALE",ROTATION:"KHR_gaussian_splatting:ROTATION",CUMULATIVE_DISTANCE:"BENTLEY_materials_line_style:CUMULATIVE_DISTANCE"};function Y4e(e){switch(e){case Pn.POSITION:return"positionMC";case Pn.NORMAL:return"normalMC";case Pn.TANGENT:return"tangentMC";case Pn.TEXCOORD:return"texCoord";case Pn.COLOR:return"color";case Pn.JOINTS:return"joints";case Pn.WEIGHTS:return"weights";case Pn.FEATURE_ID:return"featureId";case Pn.SCALE:return"scale";case Pn.ROTATION:return"rotation";case Pn.CUMULATIVE_DISTANCE:return"cumulativeDistance"}}Pn.hasSetIndex=function(e){switch(e){case Pn.POSITION:case Pn.NORMAL:case Pn.TANGENT:case Pn.CUMULATIVE_DISTANCE:return!1;case Pn.TEXCOORD:case Pn.COLOR:case Pn.JOINTS:case Pn.WEIGHTS:case Pn.FEATURE_ID:case Pn.SCALE:case Pn.ROTATION:return!0}};Pn.fromGltfSemantic=function(e){let t=e,i=/^(\w+)_\d+$/.exec(e);switch(i!==null&&(t=i[1]),t){case"POSITION":return Pn.POSITION;case"NORMAL":return Pn.NORMAL;case"TANGENT":return Pn.TANGENT;case"TEXCOORD":return Pn.TEXCOORD;case"COLOR":return Pn.COLOR;case"JOINTS":return Pn.JOINTS;case"WEIGHTS":return Pn.WEIGHTS;case"_FEATURE_ID":return Pn.FEATURE_ID;case"KHR_gaussian_splatting:SCALE":case"_SCALE":return Pn.SCALE;case"KHR_gaussian_splatting:ROTATION":case"_ROTATION":return Pn.ROTATION;case"BENTLEY_materials_line_style:CUMULATIVE_DISTANCE":return Pn.CUMULATIVE_DISTANCE}};Pn.fromPntsSemantic=function(e){switch(e){case"POSITION":case"POSITION_QUANTIZED":return Pn.POSITION;case"RGBA":case"RGB":case"RGB565":return Pn.COLOR;case"NORMAL":case"NORMAL_OCT16P":return Pn.NORMAL;case"BATCH_ID":return Pn.FEATURE_ID}};Pn.getGlslType=function(e){switch(e){case Pn.POSITION:case Pn.NORMAL:case Pn.TANGENT:return"vec3";case Pn.TEXCOORD:return"vec2";case Pn.COLOR:return"vec4";case Pn.JOINTS:return"ivec4";case Pn.WEIGHTS:return"vec4";case Pn.FEATURE_ID:return"int";case Pn.SCALE:return"vec3";case Pn.ROTATION:return"vec4";case Pn.CUMULATIVE_DISTANCE:return"float";case Pn.OPACITY:return"float"}};Pn.getVariableName=function(e,t){let n=Y4e(e);return l(t)&&(n+=`_${t}`),n};Object.freeze(Pn);var dt=Pn;var F8=class extends io{constructor(t){super(),t=t??B.EMPTY_OBJECT;let n=t.resourceCache,i=t.gltf,o=t.primitive,r=t.draco,s=t.gltfResource,a=t.baseResource,c=t.cacheKey;this._resourceCache=n,this._gltfResource=s,this._baseResource=a,this._gltf=i,this._primitive=o,this._draco=r,this._cacheKey=c,this._bufferViewLoader=void 0,this._bufferViewTypedArray=void 0,this._decodePromise=void 0,this._decodedData=void 0,this._state=Rt.UNLOADED,this._promise=void 0,this._dracoError=void 0}get cacheKey(){return this._cacheKey}get decodedData(){return this._decodedData}async load(){return l(this._promise)?this._promise:(this._state=Rt.LOADING,this._promise=M4e(this),this._promise)}process(t){if(this._state===Rt.READY)return!0;if(this._state!==Rt.PROCESSING||(l(this._dracoError)&&T0e(this,this._dracoError),!l(this._bufferViewTypedArray))||l(this._decodePromise))return!1;let n=this._draco,i=this._primitive,o=this._gltf,r=o.bufferViews,s=n.bufferView,a=r[s],c=n.attributes,d=[];for(let p in i.attributes)if(i.attributes.hasOwnProperty(p)){let b=k4e(p);l(b)&&o.accessors[i.attributes[p]].componentType===J.FLOAT&&(d.includes(b)||d.push(b))}let u={array:new Uint8Array(this._bufferViewTypedArray),bufferView:a,compressedAttributes:c,dequantizeInShader:!0,attributesToSkipTransform:d},m=vb.decodeBufferView(u);if(!l(m))return!1;this._decodePromise=w4e(this,m)}unload(){l(this._bufferViewLoader)&&this._resourceCache.unload(this._bufferViewLoader),this._bufferViewLoader=void 0,this._bufferViewTypedArray=void 0,this._decodedData=void 0,this._gltf=void 0,this._primitive=void 0}};async function M4e(e){let t=e._resourceCache;try{let n=t.getBufferViewLoader({gltf:e._gltf,bufferViewId:e._draco.bufferView,gltfResource:e._gltfResource,baseResource:e._baseResource});return e._bufferViewLoader=n,await n.load(),e.isDestroyed()?void 0:(e._bufferViewTypedArray=n.typedArray,e._state=Rt.PROCESSING,e)}catch(n){if(e.isDestroyed())return;T0e(e,n)}}function T0e(e,t){throw e.unload(),e._state=Rt.FAILED,e.getError("Failed to load Draco",t)}async function w4e(e,t){try{let n=await t;return e.isDestroyed()?void 0:(e.unload(),e._decodedData={indices:n.indexArray,vertexAttributes:n.attributeData},e._state=Rt.READY,e._baseResource)}catch(n){if(e.isDestroyed())return;e._dracoError=n}}var tS={};tS[dt.POSITION]="POSITION";tS[dt.NORMAL]="NORMAL";tS[dt.COLOR]="COLOR";tS[dt.TEXCOORD]="TEX_COORD";function k4e(e){for(let t in tS)if(tS.hasOwnProperty(t)&&e.startsWith(t))return tS[t]}var B1=F8;var DFn=x(T(),1);var IFn=x(T(),1);function U4e(e){let{uint8Array:t,format:n,request:i}=e,o=e.flipY??!1,r=e.skipColorSpaceConversion??!1,s=new Blob([t],{type:n}),a;return ve.supportsImageBitmapOptions().then(function(c){return c?Promise.resolve(ve.createImageBitmapFromBlob(s,{flipY:o,premultiplyAlpha:!1,skipColorSpaceConversion:r})):(a=window.URL.createObjectURL(s),new ve({url:a,request:i}).fetchImage({flipY:o,skipColorSpaceConversion:r}))}).then(function(c){return l(a)&&window.URL.revokeObjectURL(a),c}).catch(function(c){return l(a)&&window.URL.revokeObjectURL(a),Promise.reject(c)})}var Fb=U4e;var OF=class extends io{constructor(t){super(),t=t??B.EMPTY_OBJECT;let n=t.resourceCache,i=t.gltf,o=t.imageId,r=t.gltfResource,s=t.baseResource,a=t.cacheKey,c=i.images[o],d=c.bufferView,u=c.uri;this._resourceCache=n,this._gltfResource=r,this._baseResource=s,this._gltf=i,this._bufferViewId=d,this._uri=u,this._cacheKey=a,this._bufferViewLoader=void 0,this._image=void 0,this._mipLevels=void 0,this._state=Rt.UNLOADED,this._promise=void 0}get cacheKey(){return this._cacheKey}get image(){return this._image}get mipLevels(){return this._mipLevels}load(){return l(this._promise)?this._promise:l(this._bufferViewId)?(this._promise=D4e(this),this._promise):(this._promise=O4e(this),this._promise)}unload(){l(this._bufferViewLoader)&&!this._bufferViewLoader.isDestroyed()&&this._resourceCache.unload(this._bufferViewLoader),this._bufferViewLoader=void 0,this._uri=void 0,this._image=void 0,this._mipLevels=void 0,this._gltf=void 0}};function _0e(e){let t;return Array.isArray(e)&&(t=e.slice(1,e.length).map(function(n){return n.bufferView}),e=e[0]),{image:e,mipLevels:t}}async function D4e(e){e._state=Rt.LOADING;let t=e._resourceCache;try{let n=t.getBufferViewLoader({gltf:e._gltf,bufferViewId:e._bufferViewId,gltfResource:e._gltfResource,baseResource:e._baseResource});if(e._bufferViewLoader=n,await n.load(),e.isDestroyed())return;let i=n.typedArray,o=await z4e(i);if(e.isDestroyed())return;let r=_0e(o);return e.unload(),e._image=r.image,e._mipLevels=r.mipLevels,e._state=Rt.READY,e}catch(n){return e.isDestroyed()?void 0:S0e(e,n,"Failed to load embedded image")}}async function O4e(e){e._state=Rt.LOADING;let t=e._baseResource,n=e._uri,i=t.getDerivedResource({url:n});try{let o=await K4e(i);if(e.isDestroyed())return;let r=_0e(o);return e.unload(),e._image=r.image,e._mipLevels=r.mipLevels,e._state=Rt.READY,e}catch(o){return e.isDestroyed()?void 0:S0e(e,o,`Failed to load image: ${n}`)}}function S0e(e,t,n){return e.unload(),e._state=Rt.FAILED,Promise.reject(e.getError(n,t))}function B4e(e){let t=e.subarray(0,2),n=e.subarray(0,4),i=e.subarray(8,12);if(t[0]===255&&t[1]===216)return"image/jpeg";if(t[0]===137&&t[1]===80)return"image/png";if(t[0]===171&&t[1]===75)return"image/ktx2";if(n[0]===82&&n[1]===73&&n[2]===70&&n[3]===70&&i[0]===87&&i[1]===69&&i[2]===66&&i[3]===80)return"image/webp";throw new ae("Image format is not recognized")}async function z4e(e){let t=B4e(e);if(t==="image/ktx2"){let n=new Uint8Array(e);return Ad(n)}return OF._loadImageFromTypedArray({uint8Array:e,format:t,flipY:!1,skipColorSpaceConversion:!0})}var H4e=/(^data:image\/ktx2)|(\.ktx2$)/i;function K4e(e){let t=e.getUrlComponent(!1,!0);return H4e.test(t)?Ad(e):e.fetchImage({skipColorSpaceConversion:!0,preferImageBitmap:!0})}OF._loadImageFromTypedArray=Fb;var z1=OF;var iIn=x(T(),1);var BFn=x(T(),1),Z0e={TEXTURE:0,PROGRAM:1,BUFFER:2,NUMBER_OF_JOB_TYPES:3};Object.freeze(Z0e);var Wc=Z0e;var I8=class extends io{constructor(t){super(),t=t??B.EMPTY_OBJECT;let n=t.resourceCache,i=t.gltf,o=t.accessorId,r=t.gltfResource,s=t.baseResource,a=t.primitive,c=t.draco,d=t.cacheKey,u=t.asynchronous??!0,m=t.loadBuffer??!1,p=t.loadTypedArray??!1,b=i.accessors[o].componentType;this._resourceCache=n,this._gltfResource=r,this._baseResource=s,this._gltf=i,this._accessorId=o,this._indexDatatype=b,this._primitive=a,this._draco=c,this._cacheKey=d,this._asynchronous=u,this._loadBuffer=m,this._loadTypedArray=p,this._bufferViewLoader=void 0,this._dracoLoader=void 0,this._typedArray=void 0,this._buffer=void 0,this._state=Rt.UNLOADED,this._promise=void 0}get cacheKey(){return this._cacheKey}get buffer(){return this._buffer}get typedArray(){return this._typedArray}get indexDatatype(){return this._indexDatatype}async load(){return l(this._promise)?this._promise:l(this._draco)?(this._promise=j4e(this),this._promise):(this._promise=Q4e(this),this._promise)}process(t){if(this._state===Rt.READY)return!0;if(this._state!==Rt.LOADED&&this._state!==Rt.PROCESSING)return!1;let n=this._typedArray,i=this._indexDatatype;if(l(this._dracoLoader))try{this._dracoLoader.process(t)&&(n=this._dracoLoader.decodedData.indices.typedArray,this._typedArray=n,i=J.fromTypedArray(n),this._indexDatatype=i)}catch(r){X8(this,r)}if(!l(n))return!1;let o;if(this._loadBuffer&&this._asynchronous){let r=J4e;if(r.set(n,i,t.context),!t.jobScheduler.execute(r,Wc.BUFFER))return!1;o=r.buffer}else this._loadBuffer&&(o=R0e(n,i,t.context));return this.unload(),this._buffer=o,this._typedArray=this._loadTypedArray?n:void 0,this._state=Rt.READY,this._resourceCache.statistics.addGeometryLoader(this),!0}unload(){l(this._buffer)&&this._buffer.destroy();let t=this._resourceCache;l(this._bufferViewLoader)&&!this._bufferViewLoader.isDestroyed()&&t.unload(this._bufferViewLoader),l(this._dracoLoader)&&t.unload(this._dracoLoader),this._bufferViewLoader=void 0,this._dracoLoader=void 0,this._typedArray=void 0,this._buffer=void 0,this._gltf=void 0,this._primitive=void 0}},P8=class{constructor(){this.typedArray=void 0,this.indexDatatype=void 0,this.context=void 0,this.buffer=void 0}set(t,n,i){this.typedArray=t,this.indexDatatype=n,this.context=i}execute(){this.buffer=R0e(this.typedArray,this.indexDatatype,this.context)}};function R0e(e,t,n){let i=it.createIndexBuffer({typedArray:e,context:n,usage:Pe.STATIC_DRAW,indexDatatype:t});return i.vertexArrayDestroyable=!1,i}var J4e=new P8;async function j4e(e){e._state=Rt.LOADING;let t=e._resourceCache;try{let n=t.getDracoLoader({gltf:e._gltf,primitive:e._primitive,draco:e._draco,gltfResource:e._gltfResource,baseResource:e._baseResource});return e._dracoLoader=n,await n.load(),e.isDestroyed()?void 0:(e._state=Rt.LOADED,e)}catch(n){if(e.isDestroyed())return;X8(e,n)}}async function Q4e(e){let t=e._gltf,n=e._accessorId,o=t.accessors[n].bufferView;e._state=Rt.LOADING;let r=e._resourceCache;try{let s=r.getBufferViewLoader({gltf:t,bufferViewId:o,gltfResource:e._gltfResource,baseResource:e._baseResource});if(e._bufferViewLoader=s,await s.load(),e.isDestroyed())return;let a=s.typedArray;return e._typedArray=q4e(e,a),e._state=Rt.PROCESSING,e}catch(s){if(e.isDestroyed())return;X8(e,s)}}function q4e(e,t){let n=e._gltf,i=e._accessorId,o=n.accessors[i],r=o.count,s=o.componentType,a=Oe.getSizeInBytes(s),c=t.buffer,d=t.byteOffset+o.byteOffset;if(d%a!==0){let m=r*a,p=new Uint8Array(c,d,m);c=new Uint8Array(p).buffer,d=0,Jo("index-buffer-unaligned",`The index array is not aligned to a ${a}-byte boundary.`)}let u;return s===Oe.UNSIGNED_BYTE?u=new Uint8Array(c,d,r):s===Oe.UNSIGNED_SHORT?u=new Uint16Array(c,d,r):s===Oe.UNSIGNED_INT&&(u=new Uint32Array(c,d,r)),u}function X8(e,t){throw e.unload(),e._state=Rt.FAILED,e.getError("Failed to load index buffer",t)}var H1=I8;var rNn=x(T(),1);var VIn=x(T(),1);var rIn=x(T(),1);function $4e(e,t,n){if(n=n??!1,n){let i=e.indexOf(t);if(i>-1)return i}return e.push(t),e.length-1}var ba=$4e;var mIn=x(T(),1);var cIn=x(T(),1);function eQe(e,t){return l(e.extensionsUsed)&&e.extensionsUsed.indexOf(t)>=0}var Dr=eQe;function sn(){}sn.objectLegacy=function(e,t){if(l(e)){for(let n in e)if(Object.prototype.hasOwnProperty.call(e,n)){let i=e[n],o=t(i,n);if(l(o))return o}}};sn.object=function(e,t){if(l(e)){let n=e.length;for(let i=0;i0)return i.byteStride}return J.getSizeInBytes(t.componentType)*Gu(t.type)}var Yd=nQe;function iQe(e){we.accessor(e,function(n){l(n.bufferView)&&(n.byteOffset=n.byteOffset??0)}),we.bufferView(e,function(n){l(n.buffer)&&(n.byteOffset=n.byteOffset??0)}),we.mesh(e,function(n){we.meshPrimitive(n,function(i){if(i.mode=i.mode??ie.TRIANGLES,!l(i.material)){l(e.materials)||(e.materials=[]);let o={name:"default"};i.material=ba(e.materials,o)}})}),we.accessorContainingVertexAttributeData(e,function(n){let i=e.accessors[n],o=i.bufferView;if(i.normalized=i.normalized??!1,l(o)){let r=e.bufferViews[o];r.byteStride=Yd(e,i),r.target=ie.ARRAY_BUFFER}}),we.accessorContainingIndexData(e,function(n){let o=e.accessors[n].bufferView;if(l(o)){let r=e.bufferViews[o];r.target=ie.ELEMENT_ARRAY_BUFFER}}),we.material(e,function(n){let i=n.extensions??{},o=i.KHR_materials_common;if(l(o)){let c=o.technique,d=l(o.values)?o.values:{};o.values=d,d.ambient=l(d.ambient)?d.ambient:[0,0,0,1],d.emission=l(d.emission)?d.emission:[0,0,0,1],d.transparency=d.transparency??1,c!=="CONSTANT"&&(d.diffuse=l(d.diffuse)?d.diffuse:[0,0,0,1],c!=="LAMBERT"&&(d.specular=l(d.specular)?d.specular:[0,0,0,1],d.shininess=d.shininess??0)),o.transparent=o.transparent??!1,o.doubleSided=o.doubleSided??!1;return}n.emissiveFactor=n.emissiveFactor??[0,0,0],n.alphaMode=n.alphaMode??"OPAQUE",n.doubleSided=n.doubleSided??!1,n.alphaMode==="MASK"&&(n.alphaCutoff=n.alphaCutoff??.5);let r=i.KHR_techniques_webgl;l(r)&&we.materialValue(n,function(c){l(c.index)&&nS(c)}),nS(n.emissiveTexture),nS(n.normalTexture),nS(n.occlusionTexture);let s=n.pbrMetallicRoughness;l(s)&&(s.baseColorFactor=s.baseColorFactor??[1,1,1,1],s.metallicFactor=s.metallicFactor??1,s.roughnessFactor=s.roughnessFactor??1,nS(s.baseColorTexture),nS(s.metallicRoughnessTexture));let a=i.KHR_materials_pbrSpecularGlossiness;l(a)&&(a.diffuseFactor=a.diffuseFactor??[1,1,1,1],a.specularFactor=a.specularFactor??[1,1,1],a.glossinessFactor=a.glossinessFactor??1,nS(a.specularGlossinessTexture))}),we.animation(e,function(n){we.animationSampler(n,function(i){i.interpolation=i.interpolation??"LINEAR"})});let t=oQe(e);return we.node(e,function(n,i){l(t[i])||l(n.translation)||l(n.rotation)||l(n.scale)?(n.translation=n.translation??[0,0,0],n.rotation=n.rotation??[0,0,0,1],n.scale=n.scale??[1,1,1]):n.matrix=n.matrix??[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]}),we.sampler(e,function(n){n.wrapS=n.wrapS??ie.REPEAT,n.wrapT=n.wrapT??ie.REPEAT}),l(e.scenes)&&!l(e.scene)&&(e.scene=0),e}function oQe(e){let t={};return we.animation(e,function(n){we.animationChannel(n,function(i){let o=i.target,r=o.node,s=o.path;(s==="translation"||s==="rotation"||s==="scale")&&(t[r]=!0)})}),t}function nS(e){l(e)&&(e.texCoord=e.texCoord??0)}var BF=iQe;var LIn=x(T(),1);function rQe(e){return we.shader(e,function(t){EO(t)}),we.buffer(e,function(t){EO(t)}),we.image(e,function(t){EO(t)}),EO(e),e}function EO(e){e.extras=l(e.extras)?e.extras:{},e.extras._pipeline=l(e.extras._pipeline)?e.extras._pipeline:{}}var ix=rQe;var BIn=x(T(),1);var NIn=x(T(),1);var FIn=x(T(),1);function sQe(e,t){let n=e.extensionsRequired;if(l(n)){let i=n.indexOf(t);i>=0&&n.splice(i,1),n.length===0&&delete e.extensionsRequired}}var zF=sQe;function aQe(e,t){let n=e.extensionsUsed;if(l(n)){let i=n.indexOf(t);i>=0&&n.splice(i,1),zF(e,t),n.length===0&&delete e.extensionsUsed}}var iS=aQe;var cQe=4;function lQe(e){if(ef(e)!=="glTF")throw new ae("File is not valid binary glTF");let n=C0e(e,0,5),i=n[1];if(i!==1&&i!==2)throw new ae("Binary glTF version is not 1 or 2");return i===1?dQe(e,n):uQe(e,n)}function C0e(e,t,n){let i=new DataView(e.buffer),o=new Array(n);for(let r=0;r0){let m=u.binary_glTF??u.KHR_binary_glTF;l(m)&&(m.extras._pipeline.source=d,delete m.uri)}return iS(c,"KHR_binary_glTF"),c}function uQe(e,t){let n=t[2],i=12,o,r;for(;i0){let a=s[0];a.extras._pipeline.source=r}}return o}var oS=lQe;var JIn=x(T(),1);function mQe(e){return we.shader(e,function(t){AO(t)}),we.buffer(e,function(t){AO(t)}),we.image(e,function(t){AO(t)}),AO(e),e}function AO(e){l(e.extras)&&(l(e.extras._pipeline)&&delete e.extras._pipeline,Object.keys(e.extras).length===0&&delete e.extras)}var HF=mQe;var EXn=x(T(),1);var $In=x(T(),1);function hQe(e,t){let n=e.extensionsUsed;l(n)||(n=[],e.extensionsUsed=n),ba(n,t,!0)}var Pm=hQe;var lPn=x(T(),1);var nPn=x(T(),1);function fQe(e){switch(e){case J.BYTE:return function(t,n,i,o,r){for(let s=0;s-1:!1}var yQe=[ie.ZERO,ie.ONE,ie.SRC_COLOR,ie.ONE_MINUS_SRC_COLOR,ie.SRC_ALPHA,ie.ONE_MINUS_SRC_ALPHA,ie.DST_ALPHA,ie.ONE_MINUS_DST_ALPHA,ie.DST_COLOR,ie.ONE_MINUS_DST_COLOR];function xQe(e,t){if(!l(e))return t;for(let n=0;n<4;n++)if(yQe.indexOf(e[n])===-1)return t;return e}function TQe(e){let t={},n={},i=e.techniques;return l(i)&&(we.technique(e,function(o,r){let s=o.states;if(l(s)){let a=n[r]={};if(V0e(s,ie.BLEND)){a.alphaMode="BLEND";let c=s.functions;l(c)&&(l(c.blendEquationSeparate)||l(c.blendFuncSeparate))&&(t[r]={blendEquation:c.blendEquationSeparate??bQe,blendFactors:xQe(c.blendFuncSeparate,gQe)})}V0e(s,ie.CULL_FACE)||(a.doubleSided=!0),delete o.states}}),Object.keys(t).length>0&&(l(e.extensions)||(e.extensions={}),Pm(e,"KHR_blend")),we.material(e,function(o){if(l(o.technique)){let r=n[o.technique];we.objectLegacy(r,function(a,c){o[c]=a});let s=t[o.technique];l(s)&&(l(o.extensions)||(o.extensions={}),o.extensions.KHR_blend=s)}})),e}var KF=TQe;var EPn=x(T(),1);var TPn=x(T(),1);function _Qe(e,t){let n=e.extensionsRequired;l(n)||(n=[],e.extensionsRequired=n),ba(n,t,!0),Pm(e,t)}var JF=_Qe;function SQe(e){let t=e.techniques,n={},i={},o={};if(l(t)){let r={programs:[],shaders:[],techniques:[]},s=e.glExtensionsUsed;delete e.glExtensionsUsed,we.technique(e,function(a,c){let d={name:a.name,program:void 0,attributes:{},uniforms:{}},u;if(we.techniqueAttribute(a,function(m,p){u=a.parameters[m],d.attributes[p]={semantic:u.semantic}}),we.techniqueUniform(a,function(m,p){u=a.parameters[m],d.uniforms[p]={count:u.count,node:u.node,type:u.type,semantic:u.semantic,value:u.value},l(n[c])||(n[c]={}),n[c][m]=p}),l(o[a.program]))d.program=o[a.program];else{let m=e.programs[a.program],p={name:m.name,fragmentShader:void 0,vertexShader:void 0,glExtensions:s},b=e.shaders[m.fragmentShader];p.fragmentShader=ba(r.shaders,b,!0);let f=e.shaders[m.vertexShader];p.vertexShader=ba(r.shaders,f,!0),d.program=ba(r.programs,p),o[a.program]=d.program}i[c]=ba(r.techniques,d)}),r.techniques.length>0&&(l(e.extensions)||(e.extensions={}),e.extensions.KHR_techniques_webgl=r,Pm(e,"KHR_techniques_webgl"),JF(e,"KHR_techniques_webgl"))}return we.material(e,function(r){if(l(r.technique)){let s={technique:i[r.technique]};we.objectLegacy(r.values,function(a,c){l(s.values)||(s.values={});let d=n[r.technique][c];l(d)&&(s.values[d]=a)}),l(r.extensions)||(r.extensions={}),r.extensions.KHR_techniques_webgl=s}delete r.technique,delete r.values}),delete e.techniques,delete e.programs,delete e.shaders,e}var jF=SQe;var YPn=x(T(),1);var vPn=x(T(),1);function ZQe(e,t){Ko.typeOf.object("material",e),Ko.defined("handler",t);let n=e.pbrMetallicRoughness;if(l(n)){if(l(n.baseColorTexture)){let r=n.baseColorTexture,s=t(r.index,r);if(l(s))return s}if(l(n.metallicRoughnessTexture)){let r=n.metallicRoughnessTexture,s=t(r.index,r);if(l(s))return s}}let{extensions:i}=e;if(l(i)){let r=i.KHR_materials_pbrSpecularGlossiness;if(l(r)){if(l(r.diffuseTexture)){let d=r.diffuseTexture,u=t(d.index,d);if(l(u))return u}if(l(r.specularGlossinessTexture)){let d=r.specularGlossinessTexture,u=t(d.index,d);if(l(u))return u}}let s=i.KHR_materials_specular;if(l(s)){let{specularTexture:d,specularColorTexture:u}=s;if(l(d)){let m=t(d.index,d);if(l(m))return m}if(l(u)){let m=t(u.index,u);if(l(m))return m}}let a=i.KHR_materials_transmission;if(l(a)&&l(a.transmissionTexture)){let d=a.transmissionTexture,u=t(d.index,d);if(l(u))return u}let c=i.KHR_materials_common;if(l(c)&&l(c.values)){let{diffuse:d,ambient:u,emission:m,specular:p}=c.values;if(l(d)&&l(d.index)){let b=t(d.index,d);if(l(b))return b}if(l(u)&&l(u.index)){let b=t(u.index,u);if(l(b))return b}if(l(m)&&l(m.index)){let b=t(m.index,m);if(l(b))return b}if(l(p)&&l(p.index)){let b=t(p.index,p);if(l(b))return b}}}let o=we.materialValue(e,function(r){if(l(r.index)){let s=t(r.index,r);if(l(s))return s}});if(l(o))return o;if(l(e.emissiveTexture)){let r=e.emissiveTexture,s=t(r.index,r);if(l(s))return s}if(l(e.normalTexture)){let r=e.normalTexture,s=t(r.index,r);if(l(s))return s}if(l(e.occlusionTexture)){let r=e.occlusionTexture,s=t(r.index,r);if(l(s))return s}}var K1=ZQe;var E0e=["mesh","node","material","accessor","bufferView","buffer","texture","sampler","image"];function RQe(e,t){return t=t??E0e,E0e.forEach(function(n){t.indexOf(n)>-1&&VQe(e,n)}),e}var CQe={accessor:"accessors",buffer:"buffers",bufferView:"bufferViews",image:"images",node:"nodes",material:"materials",mesh:"meshes",sampler:"samplers",texture:"textures"};function VQe(e,t){let n=CQe[t],i=e[n];if(l(i)){let o=0,r=Yp[t](e),s=i.length;for(let a=0;at&&o.attributes[c]--}),we.meshPrimitiveTarget(o,function(a){we.meshPrimitiveTargetAttribute(a,function(c,d){c>t&&a[d]--})});let r=o.indices;l(r)&&r>t&&o.indices--;let s=o.extensions;l(s)&&l(s.CESIUM_primitive_outline)&&s.CESIUM_primitive_outline.indices>t&&--s.CESIUM_primitive_outline.indices})}),we.skin(e,function(i){l(i.inverseBindMatrices)&&i.inverseBindMatrices>t&&i.inverseBindMatrices--}),we.animation(e,function(i){we.animationSampler(i,function(o){l(o.input)&&o.input>t&&o.input--,l(o.output)&&o.output>t&&o.output--})})};Np.buffer=function(e,t){e.buffers.splice(t,1),we.bufferView(e,function(i){l(i.buffer)&&i.buffer>t&&i.buffer--;let o=i.extensions;if(l(o)){let r=o.EXT_meshopt_compression;l(r)&&r.buffer>t&&r.buffer--;let s=o.KHR_meshopt_compression;l(s)&&s.buffer>t&&s.buffer--}})};Np.bufferView=function(e,t){if(e.bufferViews.splice(t,1),we.accessor(e,function(i){l(i.bufferView)&&i.bufferView>t&&i.bufferView--}),we.shader(e,function(i){l(i.bufferView)&&i.bufferView>t&&i.bufferView--}),we.image(e,function(i){l(i.bufferView)&&i.bufferView>t&&i.bufferView--}),Dr(e,"KHR_draco_mesh_compression")&&we.mesh(e,function(i){we.meshPrimitive(i,function(o){l(o.extensions)&&l(o.extensions.KHR_draco_mesh_compression)&&o.extensions.KHR_draco_mesh_compression.bufferView>t&&o.extensions.KHR_draco_mesh_compression.bufferView--})}),Dr(e,"EXT_feature_metadata")){let o=e.extensions.EXT_feature_metadata.featureTables;for(let r in o)if(o.hasOwnProperty(r)){let a=o[r].properties;if(l(a)){for(let c in a)if(a.hasOwnProperty(c)){let d=a[c];l(d.bufferView)&&d.bufferView>t&&d.bufferView--,l(d.arrayOffsetBufferView)&&d.arrayOffsetBufferView>t&&d.arrayOffsetBufferView--,l(d.stringOffsetBufferView)&&d.stringOffsetBufferView>t&&d.stringOffsetBufferView--}}}}if(Dr(e,"EXT_structural_metadata")){let o=e.extensions.EXT_structural_metadata.propertyTables;if(l(o)){let r=o.length;for(let s=0;st&&u.values--,l(u.arrayOffsets)&&u.arrayOffsets>t&&u.arrayOffsets--,l(u.stringOffsets)&&u.stringOffsets>t&&u.stringOffsets--}}}}};Np.image=function(e,t){e.images.splice(t,1),we.texture(e,function(i){l(i.source)&&i.source>t&&--i.source;let o=i.extensions;l(o)&&l(o.EXT_texture_webp)&&o.EXT_texture_webp.source>t?--i.extensions.EXT_texture_webp.source:l(o)&&l(o.KHR_texture_basisu)&&o.KHR_texture_basisu.source>t&&--i.extensions.KHR_texture_basisu.source})};Np.mesh=function(e,t){e.meshes.splice(t,1),we.node(e,function(i){l(i.mesh)&&(i.mesh>t?i.mesh--:i.mesh===t&&delete i.mesh)})};Np.node=function(e,t){e.nodes.splice(t,1),we.skin(e,function(i){l(i.skeleton)&&i.skeleton>t&&i.skeleton--,i.joints=i.joints.map(function(o){return o>t?o-1:o})}),we.animation(e,function(i){we.animationChannel(i,function(o){l(o.target)&&l(o.target.node)&&o.target.node>t&&o.target.node--})}),we.technique(e,function(i){we.techniqueUniform(i,function(o){l(o.node)&&o.node>t&&o.node--})}),we.node(e,function(i){l(i.children)&&(i.children=i.children.filter(function(o){return o!==t}).map(function(o){return o>t?o-1:o}))}),we.scene(e,function(i){i.nodes=i.nodes.filter(function(o){return o!==t}).map(function(o){return o>t?o-1:o})})};Np.material=function(e,t){e.materials.splice(t,1),we.mesh(e,function(i){we.meshPrimitive(i,function(o){l(o.material)&&o.material>t&&o.material--})})};Np.sampler=function(e,t){e.samplers.splice(t,1),we.texture(e,function(i){l(i.sampler)&&i.sampler>t&&--i.sampler})};Np.texture=function(e,t){if(e.textures.splice(t,1),we.material(e,function(i){K1(i,function(o,r){r.index>t&&--r.index})}),Dr(e,"EXT_feature_metadata")){we.mesh(e,function(r){we.meshPrimitive(r,function(s){let a=s.extensions;if(l(a)&&l(a.EXT_feature_metadata)){let d=a.EXT_feature_metadata.featureIdTextures;if(l(d)){let u=d.length;for(let m=0;mt&&--b.index}}}})});let o=e.extensions.EXT_feature_metadata.featureTextures;for(let r in o)if(o.hasOwnProperty(r)){let a=o[r].properties;if(l(a)){for(let c in a)if(a.hasOwnProperty(c)){let u=a[c].texture;u.index>t&&--u.index}}}}if(Dr(e,"EXT_mesh_features")&&we.mesh(e,function(i){we.meshPrimitive(i,function(o){let r=o.extensions;if(l(r)&&l(r.EXT_mesh_features)){let a=r.EXT_mesh_features.featureIds;if(l(a)){let c=a.length;for(let d=0;dt&&--u.texture.index}}}})}),Dr(e,"EXT_structural_metadata")){let o=e.extensions.EXT_structural_metadata.propertyTextures;if(l(o)){let r=o.length;for(let s=0;st&&--u.index}}}}};function Yp(){}Yp.accessor=function(e){let t={};return we.mesh(e,function(n){we.meshPrimitive(n,function(i){we.meshPrimitiveAttribute(i,function(r){t[r]=!0}),we.meshPrimitiveTarget(i,function(r){we.meshPrimitiveTargetAttribute(r,function(s){t[s]=!0})});let o=i.indices;l(o)&&(t[o]=!0)})}),we.skin(e,function(n){l(n.inverseBindMatrices)&&(t[n.inverseBindMatrices]=!0)}),we.animation(e,function(n){we.animationSampler(n,function(i){l(i.input)&&(t[i.input]=!0),l(i.output)&&(t[i.output]=!0)})}),Dr(e,"EXT_mesh_gpu_instancing")&&we.node(e,function(n){l(n.extensions)&&l(n.extensions.EXT_mesh_gpu_instancing)&&Object.keys(n.extensions.EXT_mesh_gpu_instancing.attributes).forEach(function(i){let o=n.extensions.EXT_mesh_gpu_instancing.attributes[i];t[o]=!0})}),Dr(e,"CESIUM_primitive_outline")&&we.mesh(e,function(n){we.meshPrimitive(n,function(i){let o=i.extensions;if(l(o)&&l(o.CESIUM_primitive_outline)){let s=o.CESIUM_primitive_outline.indices;l(s)&&(t[s]=!0)}})}),t};Yp.buffer=function(e){let t={};return we.bufferView(e,function(n){l(n.buffer)&&(t[n.buffer]=!0);let i=n.extensions;if(l(i)){let o=i.EXT_meshopt_compression;l(o)&&(t[o.buffer]=!0);let r=i.KHR_meshopt_compression;l(r)&&(t[r.buffer]=!0)}}),t};Yp.bufferView=function(e){let t={};if(we.accessor(e,function(n){l(n.bufferView)&&(t[n.bufferView]=!0)}),we.shader(e,function(n){l(n.bufferView)&&(t[n.bufferView]=!0)}),we.image(e,function(n){l(n.bufferView)&&(t[n.bufferView]=!0)}),Dr(e,"KHR_draco_mesh_compression")&&we.mesh(e,function(n){we.meshPrimitive(n,function(i){l(i.extensions)&&l(i.extensions.KHR_draco_mesh_compression)&&(t[i.extensions.KHR_draco_mesh_compression.bufferView]=!0)})}),Dr(e,"EXT_feature_metadata")){let i=e.extensions.EXT_feature_metadata.featureTables;for(let o in i)if(i.hasOwnProperty(o)){let s=i[o].properties;if(l(s)){for(let a in s)if(s.hasOwnProperty(a)){let c=s[a];l(c.bufferView)&&(t[c.bufferView]=!0),l(c.arrayOffsetBufferView)&&(t[c.arrayOffsetBufferView]=!0),l(c.stringOffsetBufferView)&&(t[c.stringOffsetBufferView]=!0)}}}}if(Dr(e,"EXT_structural_metadata")){let i=e.extensions.EXT_structural_metadata.propertyTables;if(l(i)){let o=i.length;for(let r=0;r0&&(t[n.mesh]=!0)}}),t};function A0e(e,t,n){let i=e.nodes[t];return l(i.mesh)||l(i.camera)||l(i.skin)||l(i.weights)||l(i.extras)||l(i.extensions)&&Object.keys(i.extensions).length!==0||l(n[t])?!1:!l(i.children)||i.children.filter(function(o){return!A0e(e,o,n)}).length===0}Yp.node=function(e){let t={};return we.skin(e,function(n){l(n.skeleton)&&(t[n.skeleton]=!0),we.skinJoint(n,function(i){t[i]=!0})}),we.animation(e,function(n){we.animationChannel(n,function(i){l(i.target)&&l(i.target.node)&&(t[i.target.node]=!0)})}),we.technique(e,function(n){we.techniqueUniform(n,function(i){l(i.node)&&(t[i.node]=!0)})}),we.node(e,function(n,i){A0e(e,i,t)||(t[i]=!0)}),t};Yp.material=function(e){let t={};return we.mesh(e,function(n){we.meshPrimitive(n,function(i){l(i.material)&&(t[i.material]=!0)})}),t};Yp.texture=function(e){let t={};if(we.material(e,function(n){K1(n,function(i){t[i]=!0})}),Dr(e,"EXT_feature_metadata")){we.mesh(e,function(o){we.meshPrimitive(o,function(r){let s=r.extensions;if(l(s)&&l(s.EXT_feature_metadata)){let c=s.EXT_feature_metadata.featureIdTextures;if(l(c)){let d=c.length;for(let u=0;u0)for(s.mesh=n.meshes[c[0]],t=1;t0&&l(s.skin)){let u=e.skins[s.skin];u.skeleton=n.nodes[c[0]]}delete s.skeletons}l(s.jointName)&&delete s.jointName}),we.skin(e,function(s){l(s.inverseBindMatrices)&&(s.inverseBindMatrices=n.accessors[s.inverseBindMatrices]);let a=s.jointNames;if(l(a)){let c=[],d=a.length;for(t=0;t=0&&(a=r.substring(0,s),c=r.substring(s));let d,u=JQe[a];l(u)?(d=u+c,t[r]=d):l(KQe[a])||(d=`_${r}`,t[r]=d)}});for(let o in t)if(Object.prototype.hasOwnProperty.call(t,o)){let r=t[o],s=i.attributes[o];l(s)&&(delete i.attributes[o],i.attributes[r]=s)}})}),we.technique(e,function(n){we.techniqueParameter(n,function(i){let o=t[i.semantic];l(o)&&(i.semantic=o)})})}function QQe(e){we.camera(e,function(t){let n=t.perspective;if(l(n)){let i=n.aspectRatio;l(i)&&i===0&&delete n.aspectRatio;let o=n.yfov;l(o)&&o===0&&(n.yfov=1)}})}function M8(e,t){return l(t.byteStride)&&t.byteStride!==0?t.byteStride:Yd(e,t)}function qQe(e){we.buffer(e,function(t){l(t.byteLength)||(t.byteLength=t.extras._pipeline.source.length)}),we.accessor(e,function(t){let n=t.bufferView;if(l(n)){let i=e.bufferViews[n],o=M8(e,t),r=t.byteOffset+t.count*o;i.byteLength=Math.max(i.byteLength??0,r)}})}function $Qe(e){let t,n,i,o=e.bufferViews,r={};we.accessorContainingVertexAttributeData(e,function(a){let c=e.accessors[a];l(c.bufferView)&&(r[c.bufferView]=!0)});let s={};we.accessor(e,function(a){l(a.bufferView)&&(s[a.bufferView]=s[a.bufferView]??[],s[a.bufferView].push(a))});for(let a in s)if(Object.prototype.hasOwnProperty.call(s,a)){i=o[a];let c=s[a];c.sort(function(p,b){return p.byteOffset-b.byteOffset});let d=0,u=0,m=c.length;for(t=0;t=0;--r)if(i[r]===t){i.splice(r,1);return}}}),we.node(e,function(n,i){if(l(n.children)){let o=n.children.indexOf(t);o>-1&&(n.children.splice(o,1),v0e(n)&&F0e(e,i))}}),delete e.nodes[t]}function t8e(e){return we.node(e,function(t,n){v0e(t)&&F0e(e,n)}),e}function n8e(e){we.animation(e,function(t){we.animationSampler(t,function(n){let i=e.accessors[n.input];if(!l(i.min)||!l(i.max)){let o=rS(e,i);i.min=o.min,i.max=o.max}})})}function i8e(e){we.accessor(e,function(t){if(l(t.min)||l(t.max)){let n=rS(e,t);l(t.min)&&(t.min=n.min),l(t.max)&&(t.max=n.max)}})}function o8e(e){e.asset=e.asset??{},e.asset.version="2.0",W0e(e),YQe(e),t8e(e),MQe(e),wQe(e),UQe(e),OQe(e),qQe(e),$Qe(e),e8e(e),n8e(e),i8e(e),BQe(e),zQe(e),HQe(e),jQe(e),eI(e),QQe(e),KF(e),jF(e),kQe(e)}var r8e=["u_tex","u_diffuse","u_emission","u_diffuse_tex"],s8e=["u_diffuse","u_diffuse_mat"];function w8(e){e.pbrMetallicRoughness=l(e.pbrMetallicRoughness)?e.pbrMetallicRoughness:{},e.pbrMetallicRoughness.roughnessFactor=1,e.pbrMetallicRoughness.metallicFactor=0}function k8(e){return l(e.index)}function U8(e){return Array.isArray(e)&&e.length===4}function I0e(e){let t=new Array(4);t[3]=e[3];for(let n=0;n<3;n++){let i=e[n];i<=.04045?t[n]=e[n]*.07739938080495357:t[n]=Math.pow((i+.055)*.9478672985781991,2.4)}return t}function a8e(e,t){t=t??{};let n=t.baseColorTextureNames??r8e,i=t.baseColorFactorNames??s8e;we.material(e,function(o){we.materialValue(o,function(r,s){n.indexOf(s)!==-1&&k8(r)?(w8(o),o.pbrMetallicRoughness.baseColorTexture=r):i.indexOf(s)!==-1&&U8(r)&&(w8(o),o.pbrMetallicRoughness.baseColorFactor=I0e(r))})}),sS(e,"KHR_techniques_webgl"),sS(e,"KHR_blend")}function Y8(e,t){l(t)&&(U8(t)?e.pbrMetallicRoughness.baseColorFactor=I0e(t):k8(t)&&(e.pbrMetallicRoughness.baseColorTexture=t))}function L0e(e,t){l(t)&&(U8(t)?e.emissiveFactor=t.slice(0,3):k8(t)&&(e.emissiveTexture=t))}function c8e(e){we.material(e,function(t){let n=(t.extensions??{}).KHR_materials_common;if(!l(n))return;let i=n.values??{},o=i.ambient,r=i.diffuse,s=i.emission,a=i.transparency,c=n.doubleSided,d=n.transparent;w8(t),n.technique==="CONSTANT"?(Pm(e,"KHR_materials_unlit"),t.extensions=l(t.extensions)?t.extensions:{},t.extensions.KHR_materials_unlit={},Y8(t,s),Y8(t,o)):(Y8(t,r),L0e(t,o),L0e(t,s)),l(c)&&(t.doubleSided=c),l(a)&&(l(t.pbrMetallicRoughness.baseColorFactor)?t.pbrMetallicRoughness.baseColorFactor[3]*=a:t.pbrMetallicRoughness.baseColorFactor=[1,1,1,a]),l(d)&&(t.alphaMode=d?"BLEND":"OPAQUE")}),sS(e,"KHR_materials_common")}var tI=vQe;var wXn=x(T(),1);function il(){}il.getError=function(e,t,n){let i=`Failed to load ${e}: ${t}`;l(n)&&l(n.message)&&(i+=` +${i.stack}`),i}isDestroyed(){return!1}destroy(){return this.unload(),ue(this)}},oo=T7;var J4n=x(T(),1),$xe={UNLOADED:0,LOADING:1,LOADED:2,PROCESSING:3,READY:4,FAILED:5};Object.freeze($xe);var Rt=$xe;var bB=class extends oo{constructor(t){super(),t=t??B.EMPTY_OBJECT;let n=t.typedArray,i=t.resource,o=t.cacheKey;this._typedArray=n,this._resource=i,this._cacheKey=o,this._state=Rt.UNLOADED,this._promise=void 0}get cacheKey(){return this._cacheKey}get typedArray(){return this._typedArray}async load(){return l(this._promise)?this._promise:l(this._typedArray)?(this._promise=Promise.resolve(this),this._promise):(this._promise=L$e(this),this._promise)}static _fetchArrayBuffer(t){return t.fetchArrayBuffer()}unload(){this._typedArray=void 0}};async function L$e(e){let t=e._resource;e._state=Rt.LOADING;try{let n=await bB._fetchArrayBuffer(t);return e.isDestroyed()?void 0:(e._typedArray=new Uint8Array(n),e._state=Rt.READY,e)}catch(n){if(e.isDestroyed())return;e._state=Rt.FAILED;let i=`Failed to load external buffer: ${t.url}`;throw e.getError(i,n)}}var xS=bB;var FQn=x(T(),1);var oQn=x(T(),1);function W$e(e){let t=e?.extensions;if(l(t))return t.KHR_meshopt_compression??t.EXT_meshopt_compression}var ux=W$e;var TQn=x(T(),1);var aQn=x(T(),1),rQn=(function(){var e="b9H79Tebbbe9ok9Geueu9Geub9Gbb9Gruuuuuuueu9Gvuuuuueu9Gduueu9Gluuuueu9Gvuuuuub9Gouuuuuub9Gluuuub9GiuuueuiE8AdilveoveovrrwrrrDDoDrbqqbelve9Weiiviebeoweuecj:Gdkr:PlCo9TW9T9VV95dbH9F9F939H79T9F9J9H229F9Jt9VV7bb8F9TW79O9V9Wt9FW9U9J9V9KW9wWVtW949c919M9MWV9mW4W2be8A9TW79O9V9Wt9FW9U9J9V9KW9wWVtW949c919M9MWVbd8F9TW79O9V9Wt9FW9U9J9V9KW9wWVtW949c919M9MWV9c9V919U9KbiE9TW79O9V9Wt9FW9U9J9V9KW9wWVtW949wWV79P9V9UblY9TW79O9V9Wt9FW9U9J9V9KW69U9KW949c919M9MWVbv8E9TW79O9V9Wt9FW9U9J9V9KW69U9KW949c919M9MWV9c9V919U9Kbo8A9TW79O9V9Wt9FW9U9J9V9KW69U9KW949wWV79P9V9UbrE9TW79O9V9Wt9FW9U9J9V9KW69U9KW949tWG91W9U9JWbwa9TW79O9V9Wt9FW9U9J9V9KW69U9KW949tWG91W9U9JW9c9V919U9KbDL9TW79O9V9Wt9FW9U9J9V9KWS9P2tWV9p9JtbqK9TW79O9V9Wt9FW9U9J9V9KWS9P2tWV9r919HtbkL9TW79O9V9Wt9FW9U9J9V9KWS9P2tWVT949WbxY9TW79O9V9Wt9FW9U9J9V9KWS9P2tWVJ9V29VVbmE9TW79O9V9Wt9F9V9Wt9P9T9P96W9wWVtW94J9H9J9OWbza9TW79O9V9Wt9F9V9Wt9P9T9P96W9wWVtW94J9H9J9OW9ttV9P9WbHa9TW79O9V9Wt9F9V9Wt9P9T9P96W9wWVtW94SWt9J9O9sW9T9H9WbOK9TW79O9V9Wt9F79W9Ht9P9H29t9VVt9sW9T9H9WbAl79IV9RbXDwebcekdKYq:zf8Adbk;wadhud9:8Jjjjjbc;qw9Rgr8KjjjjbcbhwdnaeTmbabcbyd;i:I:cjbaoaocb9iEgDc:GeV86bbarc;adfcbcjdz:xjjjb8AdnaiTmbarc;adfadalz:wjjjb8Akarc;abfalfcbcbcjdal9RalcFe0Ez:xjjjb8Aarc;abfarc;adfalz:wjjjb8Aar9cb83iUar9cb83i8War9cb83iyar9cb83iaar9cb83iKar9cb83izar9cb83iwar9cb83ibcj;abal9Uc;WFbGcjdalca0Ehqdnaicd6mbavcd9imbaDTmbadcefhkaqci2gxal2hmarc;alfclfhParc;qlfceVhsarc;qofclVhzcbhHincdhOcbhAdnavci6mbar9cb83i;Ooar9cb83i;Goar9cb83i;yoar9cb83i;qoadaHfgoybbhCcbhXincbhwcbhQdninaoalfhLaoybbgKaC7aQVhQawcP0meaLhoaKhCawcefgwaXfai6mbkkcbhCarc;qofhwincwhYcwh8AdnaQaC93gocFeGgEcs0mbclh8AaEci0mbcdcbaEEh8Akdnaocw4cFeGgEcs0mbclhYaEci0mbcdcbaEEhYkaYa8AfhEawydbh3cwhYcwh8Adnaocz4cFeGg5cs0mbclh8Aa5ci0mbcdcba5Eh8AkaEa3fhEdnaocFFFFb0mbclhYaocFFF8F0mbcbcdaocjjjw6EhYkawaEa8AfaYfBdbawclfhwaCcefgCcw9hmbkaLhoaKhCaXczfgXai6mbkcbhocehwazhQinawaoaQydbarc;qofaocdtfydb6EhoaQclfhQawcefgwcw9hmbkaoclthAcihOkcbhEarc;qlfcbcjdz:xjjjb8AarcbBd;ilar9cb83i;aladh8Eaqh8Fakh3inarc;qlfadaEaEcb9h9Ral2falz:wjjjb8Aaia8Faia8F6EhadnaqaiaE9RaEaqfai6EgKcsfc9WGgoaK9nmbarc;qofaKfcbaoaK9Rz:xjjjb8AkadaEal2fhhcbhginagaAVcl4hXarc;alfagcdtfh8JaHh8Kcbh8Lina8LaHfhwdndndndndndndnagPlbedibkaKTmvahawfhoarc;qlfawfRbbhQarc;qofhwaahCinawaoRbbgYaQ9RgQcetaQcKtc8F91786bbawcefhwaoalfhoaYhQaEaCcufgC9hmbxvkkaKTmla8Kc9:Ghoa8LcitcwGh8Aarc;qlfawceVfRbbcwtarc;qlfawc9:GfRbbVhQarc;qofhwaahCinawa3aofRbbcwta8EaofRbbVgYaQ9RgQcetaQcztc8F917cFFiGa8A486bbaoalfhoawcefhwaYhQaEaCcufgC9hmbxlkkasa8Kc98GgQfhoa3aQfhYarc;qlfawc98GgQfRbbhCcwhwinaoRbbawtaCVhCaocefhoawcwfgwca9hmbxdkkaKTmdxekaKTmea8Lcith5ahaQfh8AcbhLina8ARbbhQcwhoaYhwinawRbbaotaQVhQawcefhwaocwfgoca9hmbkarc;qofaLfaQaC7aX93a5486bbaYalfhYa8Aalfh8AaQhCaLcefgLaK9hmbkka8Jydbh8AcbhLarc;qofhoincdhQcbhwinaQaoawfRbbcb9hfhQawcefgwcz9hmbkclhCcbhwinaCaoawfRbbcd0fhCawcefgwcz9hmbkcwhYcbhwinaYaoawfRbbcP0fhYawcefgwcz9hmbkaQaCaQaC6EgwaYawaY6Egwczawcz6Ea8Afh8AaoczfhoaLczfgLaK6mbka8Ja8ABdbka8Kcefh8Ka8Lcefg8Lcl9hmbkagcefggaO9hmbka8Eamfh8Ea8Faxfh8Fa3amfh3aEaxfgEai6mbkcbhocehwaPhQinawaoaQydbarc;alfaocdtfydb6EhoaQclfhQaOawcefgw9hmbkaraHcd4faAcdVaoaocdSE86bbaHclfgHal6mbkkabaefhgabcefhoalcd4g8McbaDEhkadcefh8Narc;abfceVhecbhmdndninaiam9nmearc;qofcbcjdz:xjjjb8Aagao9Rak6mdadamal2gwfhxcbhHa8Nawfhzaocbakz:xjjjbg8Fakfh3aqaiam9Ramaqfai6Egscsfgocl4cifcd4hOaoc9WGg8JThPindndndndndndndndndndnaDTmbaraHcd4fRbbgQciGPlbedlbkasTmdaxaHfhoarc;abfaHfRbbhQarc;qofhwashCinawaoRbbgYaQ9RgQcetaQcKtc8F91786bbawcefhwaoalfhoaYhQaCcufgCmbxikkasTmiaHcitcwGh8Aarc;abfaHceVfRbbcwtarc;abfaHc9:GgofRbbVhQaxaofhoarc;qofhwashCinawao8VbbgYaQ9RgQcetaQcztc8F917cFFiGa8A486bbawcefhwaoalfhoaYhQaCcufgCmbxikkaeaHc98Gg8Afhoaza8AfhYarc;abfa8AfRbbhCcwhwinaoRbbawtaCVhCaocefhoawcwfgwca9hmbkasTmdaQcl4hKaHcitcKGhEaxa8Afh8AcbhLina8ARbbhQcwhoaYhwinawRbbaotaQVhQawcefhwaocwfgoca9hmbkarc;qofaLfaQaC7aK93aE486bbaYalfhYa8Aalfh8AaQhCaLcefgLas9hmbkkaDmbcbhoxlka8JTmbcbhodninarc;qofaofgwcwf8Pibaw8Pib:e9qTmeaoczfgoa8J9pmdxbkkdnavmbcehoxikcbh8AaOhLaOhKinarc;qofa8Afgocwf8Pibhyao8Pibh8PcdhQcbhwinaQaoawfRbbcb9hfhQawcefgwcz9hmbkclhCcbhwinaCaoawfRbbcd0fhCawcefgwcz9hmbkcwhYcbhwinaYaoawfRbbcP0fhYawcefgwcz9hmbkaQaCaQaC6EgoaYaoaY6Egoczaocz6EaKfhKaocucbaya8P:e9cb9sEgwaoaw6EaLfhLa8Aczfg8Aa8J9pmdxbkka8FaHcd4fgoaoRbbcdaHcetcoGtV86bbxikdnaLas6mbaKas6mba8FaHcd4fgoaoRbbciaHcetcoGtV86bbaga39Ras6mra3arc;qofasz:wjjjbasfh3xikaLaK9phoka8FaHcd4fgwawRbbaoaHcetcoGtV86bbkaga39RaO6mla3cbaOz:xjjjbgaaOfhKdndna8JmbaPhoxekdnagaK9RcK9pmbaPhoxekaocdtc:q:G:cjbfcj:G:cjbaDEg3ydxghcetc;:FFFeGhAcuhEcuahtcu7cFeGh8Ecbh8Karc;qofhQinarc;qofa8KfhXczh8AdndndnahPDbeeeeeeedekcucbaXcwf8PibaX8Pib:e9cb9sEh8AxekcbhoaAh8Aina8Aa8EaQaofRbb9nfh8Aaocefgocz9hmbkkcih5cbhYinczhwdndndna3aYcdtfydbgLPDbeeeeeeedekcucbaXcwf8PibaX8Pib:e9cb9sEhwxekaLcetc;:FFFeGhwcuaLtcu7cFeGhCcbhoinawaCaQaofRbb9nfhwaocefgocz9hmbkkdndnawa8A6mbaLaE9hmeawa8A9hmea3a5cdtfydbcwSmekaYh5awh8AkaYcefgYci9hmbkaaa8Kco4fgoaoRbba5a8Kci4coGtV86bbdndndna3a5cdtfydbgEPDdbbbbbbbebkdncwaE9Tg5TmbcuaEtcu7hwdndnaEceSmbcbh8LaQhXinaXhoa5hYcbhCinaoRbbg8AawcFeGgLa8AaL6EaCaEtVhCaocefhoaYcufgYmbkaKaC86bbaXa5fhXaKcefhKa8La5fg8Lcz6mbxdkkcbh8LaQhXinaXhoa5hYcbhCinaoRbbg8AawcFeGgLa8AaL6EaCcetVhCaocefhoaYcufgYmbkaKaC:T9cFe:d9c:c:qj:bw9:9c:q;c1:I1e:d9c:b:c:e1z9:9ca188bbaXa5fhXaKcefhKa8La5fg8Lcz6mbkkcbhoinaKaQaofRbbgC86bbaKaCawcFeG9pfhKaocefgocz9hmbxikkdnaEceSmbinaKcb86bbaKcefhKxbkkinaKcb86bbaKcefhKxbkkaKaX8Pbw83bwaKaX8Pbb83bbaKczfhKka8Kczfg8Ka8J9pgomeaQczfhQagaK9RcK9pmbkkaoTmlaKh3aKTmlkaHcefgHal9hmbkarc;abfaxascufal2falz:wjjjb8Aasamfhma3hoa3mbkcbhwxdkdnagao9RakalfgwcKcaaDEgQawaQ0EgC9pmbcbhwxdkdnawaQ9pmbaocbaCaw9Rgwz:xjjjbawfhokaoarc;adfalz:wjjjbalfhodnaDTmbaoara8Mz:wjjjba8Mfhokaoab9Rhwxekcbhwkarc;qwf8Kjjjjbawk5babaeadaialcdcbyd;i:I:cjbz:bjjjbk9reduaecd4gdaefgicaaica0Eabcj;abae9Uc;WFbGcjdaeca0Egifcufai9Uae2aiadfaicl4cifcd4f2fcefkmbcbabBd;i:I:cjbk;HPeLu8Jjjjjbc;ae9Rgl8Kjjjjbcbhvdnaeaici9UgocHf6mbabcbyd;m:I:cjbgrc;GeV86bbalc;abfcFecjez:xjjjb8Aal9cu83iUal9cu83i8Wal9cu83iyal9cu83iaal9cu83iKal9cu83izal9cu83iwal9cu83ibabaefc9WfhwabcefgDaofhednaiTmbcmcsarcb9kgqEhkcbhxcbhmcbhPcbhscbhzindnaeaw9nmbcbhvxikazcufhvadaPcdtfgHydbhOaHcwfydbhAaHclfydbhCcbhXdndndninalc;abfavcsGcitfgoydlhQdndndnaoydbgoaO9hmbaQaCSmekdnaoaC9hmbaQaA9hmbaXcefhXxekaoaA9hmeaQaO9hmeaXcdfhXkaXc870mdascufhvaHaXcdtgAcxGgoyd:4:G:cjbcdtfydbhQaHaoyd:0:G:cjbcdtfydbhCaHaoyd:W:G:cjbcdtfydbhOcbhodnindnalavcsGcdtfydbaQ9hmbaohXxdkcuhXavcufhvaocefgocz9hmbkkaxaQaxSgvaXce9iaXak9oVgoGfhxdndndncbcsavEaXaoEgvcs9hmbarce9imbaQaQamaQcefamSgvEgmcefSmecmcsavEhvkaDavaAc;WeGV86bbavcs9hmeaQam9Rgvcetavc8F917hvinaecbcjeavcje6EavcFbGV86bbaecefheavcr4gvmbkaQhmxvkcPhvaDaAcPV86bbaQhmkavTmiavak9omicdhocehXazhAxlkavcufhvaXclfgXc;ab9hmbkkdnaHcecdcbaAaxSEaCaxSEcdtgvyd:W:G:cjbcdtfydbgOTaHavyd:0:G:cjbcdtfydbgCceSGaHavyd:4:G:cjbcdtfydbgQcdSGaxcb9hGaqGgLce9hmbal9cu83iUal9cu83i8Wal9cu83iyal9cu83iaal9cu83iKal9cu83izal9cu83iwal9cu83ibcbhxkcbhXascufgvhodnindnalaocsGcdtfydbaC9hmbaXhAxdkcuhAaocufhoaXcefgXcz9hmbkkcbhodnindnalavcsGcdtfydbaQ9hmbaohXxdkcuhXavcufhvaocefgocz9hmbkkaxaOaxSgKfhHdndnaAcm0mbaAcefhAxekcbcsaCaHSgvEhAaHavfhHkdndnaXcm0mbaXcefhXxekcbcsaQaHSgvEhXaHavfhHkc9:cuaKEhYcbhvaXaAcltVg8AcFeGhodndndninavc;q:G:cjbfRbbaoSmeavcefgvcz9hmbxdkkaLaOax9havcm0VVmbaDavc;WeV86bbxekaDaY86bbaea8A86bbaecefhekdnaKmbaOam9Rgvcetavc8F917hvinaecbcjeavcje6EavcFbGV86bbaecefheavcr4gvmbkaOhmkdnaAcs9hmbaCam9Rgvcetavc8F917hvinaecbcjeavcje6EavcFbGV86bbaecefheavcr4gvmbkaChmkdnaXcs9hmbaQam9Rgvcetavc8F917hvinaecbcjeavcje6EavcFbGV86bbaecefheavcr4gvmbkaQhmkalascdtfaOBdbascefcsGhvdndnaAPzbeeeeeeeeeeeeeebekalavcdtfaCBdbascdfcsGhvkdndnaXPzbeeeeeeeeeeeeeebekalavcdtfaQBdbavcefcsGhvkcihoalc;abfazcitfgXaOBdlaXaCBdbazcefcsGhAcdhXavhsaHhxxekcdhoalascdtfaQBdbcehXascefcsGhsazhAkalc;abfaAcitfgvaCBdlavaQBdbalc;abfazaXfcsGcitfgvaQBdlavaOBdbaDcefhDazaofcsGhzaPcifgPai6mbkkdnaeaw9nmbcbhvxekcbhvinaeavfavc;q:G:cjbfRbb86bbavcefgvcz9hmbkaeab9Ravfhvkalc;aef8KjjjjbavkZeeucbhddninadcefgdc8F0meaeceadt0mbkkadcrfcFeGcr9Uci2cdfabci9U2cHfkmbcbabBd;m:I:cjbk:zderu8Jjjjjbcz9Rhlcbhvdnaeaicvf6mbabcbRb;m:I:cjbc;qeV86bbal9cb83iwabcefhvabaefc98fhodnaiTmbcbhecbhrcbhwindnavao6mbcbskadawcdtfydbgDalcwfaraDae9Rgeaec8F91ge7ae9Rc507grcdtfgqydb9Rgec8E91c9:Gaecdt7arVheinavcbcjeaecje6EaecFbGV86bbavcefhvaecr4gembkaqaDBdbaDheawcefgwai9hmbkkdnavao9nmbcbskavcbBbbavab9RclfhvkavkBeeucbhddninadcefgdc8F0meaeceadt0mbkkabadcwfcFeGcr9U2cvfk:dvli99dui99ludnaeTmbcuadcetcuftcu7:Zhvdndncuaicuftcu7:ZgoJbbbZMgr:lJbbb9p9DTmbar:Ohwxekcjjjj94hwkcbhicbhDinalclfIdbgrJbbbbJbbjZalIdbgq:lar:lMalcwfIdbgk:lMgr:varJbbbb9BEgrNhxaqarNhralcxfIdbhqdndnakJbbbb9GTmbaxhkxekJbbjZar:l:tgkak:maxJbbbb9GEhkJbbjZax:l:tgxax:marJbbbb9GEhrkdndnaqJbbj:;aqJbbj:;9GEgxJbbjZaxJbbjZ9FEavNJbbbZJbbb:;aqJbbbb9GEMgq:lJbbb9p9DTmbaq:Ohmxekcjjjj94hmkdndnakJbbj:;akJbbj:;9GEgqJbbjZaqJbbjZ9FEaoNJbbbZJbbb:;akJbbbb9GEMgq:lJbbb9p9DTmbaq:OhPxekcjjjj94hPkdndnarJbbj:;arJbbj:;9GEgqJbbjZaqJbbjZ9FEaoNJbbbZJbbb:;arJbbbb9GEMgr:lJbbb9p9DTmbar:Ohsxekcjjjj94hskdndnadcl9hmbabaDfgzas86bbazcifam86bbazcdfaw86bbazcefaP86bbxekabaifgzas87ebazcofam87ebazclfaw87ebazcdfaP87ebkaicwfhiaDclfhDalczfhlaecufgembkkk;hlld99eud99eudnaeTmbdndncuaicuftcu7:ZgvJbbbZMgo:lJbbb9p9DTmbao:Ohixekcjjjj94hikaic;8FiGhrinabcofcicdalclfIdb:lalIdb:l9EgialcwfIdb:lalaicdtfIdb:l9EEgialcxfIdb:lalaicdtfIdb:l9EEgiarV87ebdndnJbbj:;JbbjZalaicdtfIdbJbbbb9DEgoalaicd7cdtfIdbJ;Zl:1ZNNgwJbbj:;awJbbj:;9GEgDJbbjZaDJbbjZ9FEavNJbbbZJbbb:;awJbbbb9GEMgw:lJbbb9p9DTmbaw:Ohqxekcjjjj94hqkabcdfaq87ebdndnalaicefciGcdtfIdbJ;Zl:1ZNaoNgwJbbj:;awJbbj:;9GEgDJbbjZaDJbbjZ9FEavNJbbbZJbbb:;awJbbbb9GEMgw:lJbbb9p9DTmbaw:Ohqxekcjjjj94hqkabaq87ebdndnaoalaicufciGcdtfIdbJ;Zl:1ZNNgoJbbj:;aoJbbj:;9GEgwJbbjZawJbbjZ9FEavNJbbbZJbbb:;aoJbbbb9GEMgo:lJbbb9p9DTmbao:Ohixekcjjjj94hikabclfai87ebabcwfhbalczfhlaecufgembkkk;gvdDue998Jjjjjbcjd9Rgo8Kjjjjbdndndnadcd4grTmbc:CucbavEhwaohdarhDinadawBdbadclfhdaDcufgDmbkavcd9hmbaeTmbarcdthqcbhkalhxinaohdaxhDarhwinadadydbgmaDydbcL4cFeGc:cufgPamaP9kEBdbaDclfhDadclfhdawcufgwmbkaxaqfhxakcefgkae9hmbxdkkaeTmekarcdthxavce9hhqcbhkindndndnaqmbarTmdc:CuhDalhdarhwinaDadydbcL4cFeGc:cufgmaDam9kEhDadclfhdawcufgwmbxdkkdndndndnavPleddbdkarTmlaohdalhDarhwinadcbaDydbcL4cFeGgmc:cufgPaPam0EBdbadclfhdaDclfhDawcufgwmbxikkarTmicbhdarhDindnaladfIdbgsJbbbb9Bmbaoadfas:8cL4cFeGgwc8Aawc8A0Ec:cufBdbkadclfhdaDcufgDmbxdkkarTmdkc:CuhDkcbhdarhminaDhwdnavceSmbaoadfydbhwkdndnaladfIdbgscjjj;8iawai9RcefgwcLt9R::NJbbbZJbbb:;asJbbbb9GEMgs:lJbbb9p9DTmbas:OhPxekcjjjj94hPkabadfaPcFFFrGawcKtVBdbadclfhdamcufgmmbkkabaxfhbalaxfhlakcefgkae9hmbkkaocjdf8Kjjjjbk:Olveue99iue99iudnaeTmbceaicufthvcuaitcu7:Zhocbhradcl9hhwcbhDindndnalcwfIdbgqJbbbbaqJbbbb9GEgqJbbjZaqJbbjZ9FEaoNJbbbZMgq:lJbbb9p9DTmbaq:Ohixekcjjjj94hikdndnalIdbgqJbbbbaqJbbbb9GEgqJbbjZaqJbbjZ9FEaoNJbbbZMgq:lJbbb9p9DTmbaq:Ohdxekcjjjj94hdkadai9Rcd9TgkaifhidndnalclfIdbgqJbbbbaqJbbbb9GEgqJbbjZaqJbbjZ9FEaoNJbbbZMgq:lJbbb9p9DTmbaq:Ohdxekcjjjj94hdkadai9Rcd9ThddndnalcxfIdbgqJbbbbaqJbbbb9GEgqJbbjZaqJbbjZ9FEaoNJbbbZMgq:lJbbb9p9DTmbaq:Ohxxekcjjjj94hxkadaifhiaxce91avVhxdndnawmbabaDfgmai86bbamcifax86bbamcdfad86bbamcefak86bbxekabarfgmai87ebamcofax87ebamclfad87ebamcdfak87ebkarcwfhraDclfhDalczfhlaecufgembkkk;mqdQui998Jjjjjbc:qd9Rgv8Kjjjjbavc:Sefcbc;Kbz:xjjjb8AdnadTmbaiTmbdndnabaeSmbaehoxekavcuadcdtgradcFFFFi0Ecbyd;q:I:cjbHjjjjbbgoBd:SeavceBd:mdaoaearz:wjjjb8AkavcbBd:Oeav9cb83i:Geavc:Gefaoadaiavc:Sefz:pjjjbavyd:Gehwadci9UgDcbyd;q:I:cjbHjjjjbbheavc:Sefavyd:mdgqcdtfaeBdbavaqcefgrBd:mdaecbaDz:xjjjbhkavc:SefarcdtfcuaicdtaicFFFFi0Ecbyd;q:I:cjbHjjjjbbgxBdbavaqcdfgmBd:mdalc;ebfhPawheaxhrinaralIdbaPaeydbgscwascw6EcdtfIdbMUdbaeclfhearclfhraicufgimbkavc:SefamcdtfcuaDcdtadcFFFF970Ecbyd;q:I:cjbHjjjjbbgmBdbdnadci6mbaoheamhraDhiinaraxaeydbcdtfIdbaxaeclfydbcdtfIdbMaxaecwfydbcdtfIdbMUdbaecxfhearclfhraicufgimbkkaqcifhzalc;ebfhHavc;qbfhOavheavyd:KehAavyd:OehCcbhscbhrcbhXcehQinaehLaoarcx2fgKydbhPaKclfydbhdabaXcx2fgecwfaKcwfydbgYBdbaeclfadBdbaeaPBdbakarfce86bbaOaYBdwaOadBdlaOaPBdbamarcdtfcbBdbcih8AdnasTmbaLhiinaOa8AcdtfaiydbgeBdba8AaeaY9haeaP9haead9hGGfh8AaiclfhiascufgsmbkkaXcefhXcbhsinaCaAaKascdtfydbcdtgifydbcdtfgYheawaifgdydbgPhidnaPTmbdninaeydbarSmeaeclfheaicufgiTmdxbkkaeaYaPcdtfc98fydbBdbadadydbcufBdbkascefgsci9hmbkdndndna8ATmbcuhrJbbbbhEcbhdavyd:KehYavyd:OehKindnawaOadcdtfydbcdtgsfydbgeTmbaxasfgiIdbh3aialcuadadcs0EcdtfclfIdbaHaecwaecw6EcdtfIdbMg5Udba5a3:th5aecdthiaKaYasfydbcdtfheinamaeydbgscdtfgPa5aPIdbMg3Udba3aEaEa39DgPEhEasaraPEhraeclfheaic98fgimbkkadcefgda8A9hmbkarcu9hmekaQaD9pmeindnakaQfRbbmbaQhrxdkaDaQcefgQ9hmbxdkka8Acza8Acz6EhsaOheaLhOarcu9hmekkazTmbaqcdtavc:Seffcwfheinaeydbcbyd;u:I:cjbH:bjjjbbaec98fheazcufgzmbkkavc:qdf8Kjjjjbk:0leoucuaicdtgvaicFFFFi0Egocbyd;q:I:cjbHjjjjbbhralalyd9GgwcdtfarBdbalawcefBd9GabarBdbaocbyd;q:I:cjbHjjjjbbhralalyd9GgocdtfarBdbalaocefBd9GabarBdlcuadcdtadcFFFFi0Ecbyd;q:I:cjbHjjjjbbhralalyd9GgocdtfarBdbalaocefBd9GabarBdwabydbcbavz:xjjjb8AabydbhraehladhvinaralydbcdtfgoaoydbcefBdbalclfhlavcufgvmbkcbhvabydlglhoarhwaihDinaoavBdbaoclfhoawydbavfhvawclfhwaDcufgDmbkadci9Uhqdnadcd9nmbabydwhocbhvinaecwfydbhwaeclfydbhDalaeydbcdtfgbabydbgbcefBdbaoabcdtfavBdbalaDcdtfgDaDydbgDcefBdbaoaDcdtfavBdbalawcdtfgwawydbgwcefBdbaoawcdtfavBdbaecxfheaqavcefgv9hmbkkinalalydbarydb9RBdbarclfhralclfhlaicufgimbkkQbabaeadaic;G:G:cjbz:ojjjbkQbabaeadaic;i:H:cjbz:ojjjbk9DeeuabcFeaicdtz:xjjjbhlcbhbdnadTmbindnalaeydbcdtfgiydbcu9hmbaiabBdbabcefhbkaeclfheadcufgdmbkkabk:3vioud9:du8Jjjjjbc;Wa9Rgl8Kjjjjbcbhvalcxfcbc;Kbz:xjjjb8AalcuadcitgoadcFFFFe0Ecbyd;q:I:cjbHjjjjbbgrBdxalceBd2araeadaicezNjjjbalcuaoadcjjjjoGEcbyd;q:I:cjbHjjjjbbgwBdzadcdthednadTmbabhiinaiavBdbaiclfhiadavcefgv9hmbkkawaefhDalabBdwalawBdl9cbhqindnadTmbaq9cq9:hkarhvaDhiadheinaiav8Pibak1:NcFrG87ebavcwfhvaicdfhiaecufgembkkalclfaq:NceGcdtfydbhxalclfaq9ce98gq:NceGcdtfydbhmalc;Wbfcbcjaz:xjjjb8AaDhvadhidnadTmbinalc;Wbfav8VebcdtfgeaeydbcefBdbavcdfhvaicufgimbkkcbhvcbhiinalc;WbfavfgeydbhoaeaiBdbaoaifhiavclfgvcja9hmbkadhvdndnadTmbinalc;WbfaDamydbgicetf8VebcdtfgeaeydbgecefBdbaxaecdtfaiBdbamclfhmavcufgvmbkaq9cv9smdcbhvinabawydbcdtfavBdbawclfhwadavcefgv9hmbxdkkaq9cv9smekkcwhvcbhiinalcxfavfc98fydbcbyd;u:I:cjbH:bjjjbbaiceGheclhvcehiaeTmbkalc;Waf8Kjjjjbk:Awliuo99iud9:cbhv8Jjjjjbca9Rgocbyd:4:I:cjbBdKaocb8Pd:W:I:cjb83izaocbyd;e:I:cjbBdwaocb8Pd:8:I:cjb83ibaicd4hrdndnadmbJFFuFhwJFFuuhDJFFuuhqJFFuFhkJFFuuhxJFFuFhmxekarcdthPaehsincbhiinaoczfaifgzasaifIdbgwazIdbgDaDaw9EEUdbaoaifgzawazIdbgDaDaw9DEUdbaiclfgicx9hmbkasaPfhsavcefgvad9hmbkaoIdKhDaoIdwhwaoIdChqaoIdlhkaoIdzhxaoIdbhmkdnadTmbJbbbbJbFu9hJbbbbamax:tgmamJbbbb9DEgmakaq:tgkakam9DEgkawaD:tgwawak9DEgw:vawJbbbb9BEhwdnalmbarcdthoindndnaeclfIdbaq:tawNJbbbZMgk:lJbbb9p9DTmbak:Ohixekcjjjj94hikai:S9cC:ghHdndnaeIdbax:tawNJbbbZMgk:lJbbb9p9DTmbak:Ohixekcjjjj94hikaHai:S:ehHdndnaecwfIdbaD:tawNJbbbZMgk:lJbbb9p9DTmbak:Ohixekcjjjj94hikabaHai:T9cy:g:e83ibaeaofheabcwfhbadcufgdmbxdkkarcdthoindndnaeIdbax:tawNJbbbZMgk:lJbbb9p9DTmbak:Ohixekcjjjj94hikai:SgH9ca:gaH9cz:g9cjjj;4s:d:eaH9cFe:d:e9cF:bj;4:pj;ar:d9c:bd9:9c:p;G:d;4j:E;ar:d9cH9:9c;d;H:W:y:m:g;d;Hb:d9cv9:9c;j:KM;j:KM;j:Kd:dhOdndnaeclfIdbaq:tawNJbbbZMgk:lJbbb9p9DTmbak:Ohixekcjjjj94hikai:SgH9ca:gaH9cz:g9cjjj;4s:d:eaH9cFe:d:e9cF:bj;4:pj;ar:d9c:bd9:9c:p;G:d;4j:E;ar:d9cH9:9c;d;H:W:y:m:g;d;Hb:d9cq9:9cM;j:KM;j:KM;jl:daO:ehOdndnaecwfIdbaD:tawNJbbbZMgk:lJbbb9p9DTmbak:Ohixekcjjjj94hikabaOai:SgH9ca:gaH9cz:g9cjjj;4s:d:eaH9cFe:d:e9cF:bj;4:pj;ar:d9c:bd9:9c:p;G:d;4j:E;ar:d9cH9:9c;d;H:W:y:m:g;d;Hb:d9cC9:9c:KM;j:KM;j:KMD:d:e83ibaeaofheabcwfhbadcufgdmbkkk9teiucbcbyd;y:I:cjbgeabcifc98GfgbBd;y:I:cjbdndnabZbcztgd9nmbcuhiabad9RcFFifcz4nbcuSmekaehikaik;LeeeudndnaeabVciGTmbabhixekdndnadcz9pmbabhixekabhiinaiaeydbBdbaiclfaeclfydbBdbaicwfaecwfydbBdbaicxfaecxfydbBdbaeczfheaiczfhiadc9Wfgdcs0mbkkadcl6mbinaiaeydbBdbaeclfheaiclfhiadc98fgdci0mbkkdnadTmbinaiaeRbb86bbaicefhiaecefheadcufgdmbkkabk;aeedudndnabciGTmbabhixekaecFeGc:b:c:ew2hldndnadcz9pmbabhixekabhiinaialBdbaicxfalBdbaicwfalBdbaiclfalBdbaiczfhiadc9Wfgdcs0mbkkadcl6mbinaialBdbaiclfhiadc98fgdci0mbkkdnadTmbinaiae86bbaicefhiadcufgdmbkkabk9teiucbcbyd;y:I:cjbgeabcrfc94GfgbBd;y:I:cjbdndnabZbcztgd9nmbcuhiabad9RcFFifcz4nbcuSmekaehikaikTeeucbabcbyd;y:I:cjbge9Rcifc98GaefgbBd;y:I:cjbdnabZbcztge9nmbabae9RcFFifcz4nb8Akkk;Sddbcj:Gdk;idbbbbdbbblbbbwbbbbbbbebbbdbbblbbbwbbbbbbbbbbbbbbbbbbbebbbdbbbbbbbebbbbbbbbbbbbbbbb4:h9w9N94:P:gW:j9O:ye9Pbbbbbb:l29hZ;69:9kZ;N;76Z;rg97Z;z;o9xZ8J;B85Z;:;u9yZ;b;k9HZ:2;Z9DZ9e:l9mZ59A8KZ:r;T3Z:A:zYZ79OHZ;j4::8::Y:D9V8:bbbb9s:49:Z8R:hBZ9M9M;M8:L;z;o8:;8:PG89q;x:J878R:hQ8::M:B;e87bbbbbbjZbbjZbbjZ:E;V;N8::Y:DsZ9i;H;68:xd;R8:;h0838:;W:NoZbbbb:WV9O8:uf888:9i;H;68:9c9G;L89;n;m9m89;D8Ko8:bbbbf:8tZ9m836ZS:2AZL;zPZZ818EZ9e:lxZ;U98F8:819E;68:FFuuFFuuFFuuFFuFFFuFFFuFbc;i:IdkCebbbebbbebbbdbbb9G:rbb",t=new Uint8Array([32,0,65,2,1,106,34,33,3,128,11,4,13,64,6,253,10,7,15,116,127,5,8,12,40,16,19,54,20,9,27,255,113,17,42,67,24,23,146,148,18,14,22,45,70,69,56,114,101,21,25,63,75,136,108,28,118,29,73,115]);if(typeof WebAssembly!="object")return{supported:!1};var n,i=WebAssembly.instantiate(o(e),{}).then(function(b){n=b.instance,n.exports.__wasm_call_ctors(),n.exports.meshopt_encodeVertexVersion(1),n.exports.meshopt_encodeIndexVersion(1)});function o(b){for(var f=new Uint8Array(b.length),y=0;y96?_-97:_>64?_-39:_+4}for(var S=0,y=0;y=3),c(n.exports.meshopt_spatialSortRemap,b,b.length/f,f*4)},encodeVertexBuffer:function(b,f,y){r(y>0&&y<=256),r(y%4==0);var _=n.exports.meshopt_encodeVertexBufferBound(f,y);return d(n.exports.meshopt_encodeVertexBuffer,_,b,f,y)},encodeVertexBufferLevel:function(b,f,y,_,S){r(y>0&&y<=256),r(y%4==0),r(_>=0&&_<=3),r(S===void 0||S==0||S==1);var Z=n.exports.meshopt_encodeVertexBufferBound(f,y);return d(n.exports.meshopt_encodeVertexBufferLevel,Z,b,f,y,_,S===void 0?-1:S)},encodeIndexBuffer:function(b,f,y){r(y==2||y==4),r(f%3==0);var _=m(b,y),S=n.exports.meshopt_encodeIndexBufferBound(f,u(_)+1);return d(n.exports.meshopt_encodeIndexBuffer,S,_,f,4)},encodeIndexSequence:function(b,f,y){r(y==2||y==4);var _=m(b,y),S=n.exports.meshopt_encodeIndexSequenceBound(f,u(_)+1);return d(n.exports.meshopt_encodeIndexSequence,S,_,f,4)},encodeGltfBuffer:function(b,f,y,_,S){var Z={ATTRIBUTES:this.encodeVertexBufferLevel,TRIANGLES:this.encodeIndexBuffer,INDICES:this.encodeIndexSequence};return r(Z[_]),Z[_](b,f,y,2,S===void 0?0:S)},encodeFilterOct:function(b,f,y,_){return r(y==4||y==8),r(_>=2&&_<=16),p(n.exports.meshopt_encodeFilterOct,b,f,y,_,16)},encodeFilterQuat:function(b,f,y,_){return r(y==8),r(_>=4&&_<=16),p(n.exports.meshopt_encodeFilterQuat,b,f,y,_,16)},encodeFilterExp:function(b,f,y,_,S){r(y>0&&y%4==0),r(_>=1&&_<=24);var Z={Separate:0,SharedVector:1,SharedComponent:2,Clamped:3};return r(!S||S in Z),p(n.exports.meshopt_encodeFilterExp,b,f,y,_,y,S?Z[S]:1)},encodeFilterColor:function(b,f,y,_){return r(y==4||y==8),r(_>=2&&_<=16),p(n.exports.meshopt_encodeFilterColor,b,f,y,_,16)}}})();var lQn=x(T(),1),mx=(function(){var e="b9H79Tebbbe8Fv9Gbb9Gvuuuuueu9Giuuub9Geueu9Giuuueuixkbeeeddddillviebeoweuecj:Gdkr;Neqo9TW9T9VV95dbH9F9F939H79T9F9J9H229F9Jt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M1:NfghRbbag9cjjjjjl:dg8J9qE86bbarc7fcbaha8J9c8L1:NfghRbbag9cjjjjjd:dg8J9qE86bbarctfcbaha8J9c8K1:NfghRbbag9cjjjjje:dg8J9qE86bbarc91fcbaha8J9c8J1:NfghRbbag9cjjjj;ab:dg8J9qE86bbarc4fcbaha8J9cg1:NfghRbbag9cjjjja:dg8J9qE86bbarc93fcbaha8J9ch1:NfghRbbag9cjjjjz:dgg9qE86bbarc94fcbahag9ca1:NfghRbbai8Xbe9c:c:qj:bw9:9c:q;c1:I1e:d9c:b:c:e1z9:gg9cjjjjjz:dg8J9qE86bbarc95fcbaha8J9c8N1:NfgiRbbag9cjjjjjw:dg8J9qE86bbarc96fcbaia8J9c8M1:NfgiRbbag9cjjjjjl:dg8J9qE86bbarc97fcbaia8J9c8L1:NfgiRbbag9cjjjjjd:dg8J9qE86bbarc98fcbaia8J9c8K1:NfgiRbbag9cjjjjje:dg8J9qE86bbarc99fcbaia8J9c8J1:NfgiRbbag9cjjjj;ab:dg8J9qE86bbarc9:fcbaia8J9cg1:NfgiRbbag9cjjjja:dg8J9qE86bbarcufcbaia8J9ch1:NfgiRbbag9cjjjjz:dgg9qE86bbaiag9ca1:NfhixikaraiRblaiRbbghco4g8Ka8KciSg8KE86bbaqaofgrcGfaiclfa8Kfg8KRbbahcl4ciGg8La8LciSg8LE86bbarcVfa8Ka8Lfg8KRbbahcd4ciGg8La8LciSg8LE86bbarc7fa8Ka8Lfg8KRbbahciGghahciSghE86bbarctfa8Kahfg8KRbbaiRbeghco4g8La8LciSg8LE86bbarc91fa8Ka8Lfg8KRbbahcl4ciGg8La8LciSg8LE86bbarc4fa8Ka8Lfg8KRbbahcd4ciGg8La8LciSg8LE86bbarc93fa8Ka8Lfg8KRbbahciGghahciSghE86bbarc94fa8Kahfg8KRbbaiRbdghco4g8La8LciSg8LE86bbarc95fa8Ka8Lfg8KRbbahcl4ciGg8La8LciSg8LE86bbarc96fa8Ka8Lfg8KRbbahcd4ciGg8La8LciSg8LE86bbarc97fa8Ka8Lfg8KRbbahciGghahciSghE86bbarc98fa8KahfghRbbaiRbigico4g8Ka8KciSg8KE86bbarc99faha8KfghRbbaicl4ciGg8Ka8KciSg8KE86bbarc9:faha8KfghRbbaicd4ciGg8Ka8KciSg8KE86bbarcufaha8KfgrRbbaiciGgiaiciSgiE86bbaraifhixdkaraiRbwaiRbbghcl4g8Ka8KcsSg8KE86bbaqaofgrcGfaicwfa8Kfg8KRbbahcsGghahcsSghE86bbarcVfa8KahfghRbbaiRbeg8Kcl4g8La8LcsSg8LE86bbarc7faha8LfghRbba8KcsGg8Ka8KcsSg8KE86bbarctfaha8KfghRbbaiRbdg8Kcl4g8La8LcsSg8LE86bbarc91faha8LfghRbba8KcsGg8Ka8KcsSg8KE86bbarc4faha8KfghRbbaiRbig8Kcl4g8La8LcsSg8LE86bbarc93faha8LfghRbba8KcsGg8Ka8KcsSg8KE86bbarc94faha8KfghRbbaiRblg8Kcl4g8La8LcsSg8LE86bbarc95faha8LfghRbba8KcsGg8Ka8KcsSg8KE86bbarc96faha8KfghRbbaiRbvg8Kcl4g8La8LcsSg8LE86bbarc97faha8LfghRbba8KcsGg8Ka8KcsSg8KE86bbarc98faha8KfghRbbaiRbog8Kcl4g8La8LcsSg8LE86bbarc99faha8LfghRbba8KcsGg8Ka8KcsSg8KE86bbarc9:faha8KfghRbbaiRbrgicl4g8Ka8KcsSg8KE86bbarcufaha8KfgrRbbaicsGgiaicsSgiE86bbaraifhixekarai8Pbw83bwarai8Pbb83bbaiczfhikdnaoaC9pmbalcdfhlaoczfhraPai9RcL0mekkaoaC6moaimexokaCmva8FTmvkaqaAfhqa8Ecefg8Ecl9hmbkdndndndnawTmbasaYcd4fRbbgociGPlbedrbkaATmdazaYfh8Fazcjdfhhcbh8EaEhaina8FRbbhraahocbhlinaoahalfRbbgqce4cbaqceG9R7arfgr86bbaoadfhoaAalcefgl9hmbkaacefhaa8Fcefh8FahaAfhha8Ecefg8Ecl9hmbxikkaATmeazaYfhaazcjdfhhcbhoceh8EaKh8FinaEaofhlaa8Vbbhrcbhoinala8FaofRbbcwtahaofRbbgqVc;:FiGce4cbaqceG9R7arfgr87bbaladfhlaQaocefgofmbka8FaXfh8FcdhoaacdfhaahaXfhha8EceGhlcbh8EalmbxdkkaATmbaocl4h8EazaYfRbbhqcwhoa3hlinalRbbaotaqVhqalcefhlaocwfgoca9hmbkcbhhaEh8FaKhainazcjdfahfRbbhrcwhoaahlinalRbbaotarVhralaAfhlaocwfgoca9hmbkara8E94aq7hqcbhoa8Fhlinalaqao486bbalcefhlaocwfgoca9hmbka8Fadfh8FaacefhaahcefghaA9hmbkkaEclfhEa3clfh3aYclfgYad6mbkaza8AaAcufad2fadz:jjjjb8AaAaOfhOaihxaimbkc9:hoxdkcbc99aPax9RakSEhoxekc9:hokavcjqf8Kjjjjbaok:ysezu8Jjjjjbc;ae9Rgv8Kjjjjbc9:hodnalaeci9UgrcHf6mbcuhoaiRbbgwc;WeGc;Ge9hmbawcsGgDce0mbavc;abfcFecjez:kjjjb8Aav9cu83iUav9cu83i8Wav9cu83iyav9cu83iaav9cu83iKav9cu83izav9cu83iwav9cu83ibaialfc9WfhqaicefgwarfhldnaeTmbcmcsaDceSEhkcbhxcbhmcbhrcbhicbhoindnalaq9nmbc9:hoxikdndnawRbbgDc;Ve0mbavc;abfaoaDcu7gPcl4fcsGcitfgsydlhzasydbhHdndnaDcsGgsak9pmbavaiaPfcsGcdtfydbaxasEhDaxasTgOfhxxekdndnascsSmbcehOasc987asamffcefhDxekalcefhDal8SbbgscFeGhPdndnascu9mmbaDhlxekalcvfhlaPcFbGhPcrhsdninaD8SbbgOcFbGastaPVhPaOcu9kmeaDcefhDascrfgsc8J9hmbxdkkaDcefhlkcehOaPce4cbaPceG9R7amfhDkaDhmkavc;abfaocitfgsaDBdbasazBdlavaicdtfaDBdbavc;abfaocefcsGcitfgsaHBdbasaDBdlaocdfhoaOaifhidnadcd9hmbabarcetfgsaH87ebasclfaD87ebascdfaz87ebxdkabarcdtfgsaHBdbascwfaDBdbasclfazBdbxekdnaDcpe0mbavaiaqaDcsGfRbbgscl4gP9RcsGcdtfydbaxcefgOaPEhDavaias9RcsGcdtfydbaOaPTgzfgOascsGgPEhsaPThPdndnadcd9hmbabarcetfgHax87ebaHclfas87ebaHcdfaD87ebxekabarcdtfgHaxBdbaHcwfasBdbaHclfaDBdbkavaicdtfaxBdbavc;abfaocitfgHaDBdbaHaxBdlavaicefgicsGcdtfaDBdbavc;abfaocefcsGcitfgHasBdbaHaDBdlavaiazfgicsGcdtfasBdbavc;abfaocdfcsGcitfgDaxBdbaDasBdlaocifhoaiaPfhiaOaPfhxxekaxcbalRbbgsEgHaDc;:eSgDfhOascsGhAdndnascl4gCmbaOcefhzxekaOhzavaiaC9RcsGcdtfydbhOkdndnaAmbazcefhxxekazhxavaias9RcsGcdtfydbhzkdndnaDTmbalcefhDxekalcdfhDal8SbegPcFeGhsdnaPcu9kmbalcofhHascFbGhscrhldninaD8SbbgPcFbGaltasVhsaPcu9kmeaDcefhDalcrfglc8J9hmbkaHhDxekaDcefhDkasce4cbasceG9R7amfgmhHkdndnaCcsSmbaDhsxekaDcefhsaD8SbbglcFeGhPdnalcu9kmbaDcvfhOaPcFbGhPcrhldninas8SbbgDcFbGaltaPVhPaDcu9kmeascefhsalcrfglc8J9hmbkaOhsxekascefhskaPce4cbaPceG9R7amfgmhOkdndnaAcsSmbashlxekascefhlas8SbbgDcFeGhPdnaDcu9kmbascvfhzaPcFbGhPcrhDdninal8SbbgscFbGaDtaPVhPascu9kmealcefhlaDcrfgDc8J9hmbkazhlxekalcefhlkaPce4cbaPceG9R7amfgmhzkdndnadcd9hmbabarcetfgDaH87ebaDclfaz87ebaDcdfaO87ebxekabarcdtfgDaHBdbaDcwfazBdbaDclfaOBdbkavc;abfaocitfgDaOBdbaDaHBdlavaicdtfaHBdbavc;abfaocefcsGcitfgDazBdbaDaOBdlavaicefgicsGcdtfaOBdbavc;abfaocdfcsGcitfgDaHBdbaDazBdlavaiaCTaCcsSVfgicsGcdtfazBdbaiaATaAcsSVfhiaocifhokawcefhwaocsGhoaicsGhiarcifgrae6mbkkcbc99alaqSEhokavc;aef8Kjjjjbaok:clevu8Jjjjjbcz9Rhvdnalaecvf9pmbc9:skdnaiRbbc;:eGc;qeSmbcuskav9cb83iwaicefhoaialfc98fhrdnaeTmbdnadcdSmbcbhwindnaoar6mbc9:skaocefhlao8SbbgicFeGhddndnaicu9mmbalhoxekaocvfhoadcFbGhdcrhidninal8SbbgDcFbGaitadVhdaDcu9kmealcefhlaicrfgic8J9hmbxdkkalcefhokabawcdtfadc8Etc8F91adcd47avcwfadceGcdtVglydbfgiBdbalaiBdbawcefgwae9hmbxdkkcbhwindnaoar6mbc9:skaocefhlao8SbbgicFeGhddndnaicu9mmbalhoxekaocvfhoadcFbGhdcrhidninal8SbbgDcFbGaitadVhdaDcu9kmealcefhlaicrfgic8J9hmbxdkkalcefhokabawcetfadc8Etc8F91adcd47avcwfadceGcdtVglydbfgi87ebalaiBdbawcefgwae9hmbkkcbc99aoarSEk:Lvoeue99dud99eud99dndnadcl9hmbaeTmeindndnabcdfgd8Sbb:Yab8Sbbgi:Ygl:l:tabcefgv8Sbbgo:Ygr:l:tgwJbb;:9cawawNJbbbbawawJbbbb9GgDEgq:mgkaqaicb9iEalMgwawNakaqaocb9iEarMgqaqNMM:r:vglNJbbbZJbbb:;aDEMgr:lJbbb9p9DTmbar:Ohixekcjjjj94hikadai86bbdndnaqalNJbbbZJbbb:;aqJbbbb9GEMgq:lJbbb9p9DTmbaq:Ohdxekcjjjj94hdkavad86bbdndnawalNJbbbZJbbb:;awJbbbb9GEMgw:lJbbb9p9DTmbaw:Ohdxekcjjjj94hdkabad86bbabclfhbaecufgembxdkkaeTmbindndnabclfgd8Ueb:Yab8Uebgi:Ygl:l:tabcdfgv8Uebgo:Ygr:l:tgwJb;:FSawawNJbbbbawawJbbbb9GgDEgq:mgkaqaicb9iEalMgwawNakaqaocb9iEarMgqaqNMM:r:vglNJbbbZJbbb:;aDEMgr:lJbbb9p9DTmbar:Ohixekcjjjj94hikadai87ebdndnaqalNJbbbZJbbb:;aqJbbbb9GEMgq:lJbbb9p9DTmbaq:Ohdxekcjjjj94hdkavad87ebdndnawalNJbbbZJbbb:;awJbbbb9GEMgw:lJbbb9p9DTmbaw:Ohdxekcjjjj94hdkabad87ebabcwfhbaecufgembkkk:4ioiue99dud99dud99dnaeTmbcbhiabhlindndnal8Uebgv:YgoJ:ji:1Salcof8UebgrciVgw:Y:vgDNJbbbZJbbb:;avcu9kEMgq:lJbbb9p9DTmbaq:Ohkxekcjjjj94hkkalclf8Uebhvalcdf8UebhxalarcefciGcetfak87ebdndnax:YgqaDNJbbbZJbbb:;axcu9kEMgm:lJbbb9p9DTmbam:Ohxxekcjjjj94hxkabaiarciGgkfcd7cetfax87ebdndnav:YgmaDNJbbbZJbbb:;avcu9kEMgP:lJbbb9p9DTmbaP:Ohvxekcjjjj94hvkalarcufciGcetfav87ebdndnawaw2:ZgPaPMaoaoN:taqaqN:tamamN:tgoJbbbbaoJbbbb9GE:raDNJbbbZMgD:lJbbb9p9DTmbaD:Ohrxekcjjjj94hrkalakcetfar87ebalcwfhlaiclfhiaecufgembkkk9mbdnadcd4ae2gdTmbinababydbgecwtcw91:Yaece91cjjj98Gcjjj;8if::NUdbabclfhbadcufgdmbkkk:Tvirud99eudndnadcl9hmbaeTmeindndnabRbbgiabcefgl8Sbbgvabcdfgo8Sbbgrf9R:YJbbuJabcifgwRbbgdce4adVgDcd4aDVgDcl4aDVgD:Z:vgqNJbbbZMgk:lJbbb9p9DTmbak:Ohxxekcjjjj94hxkaoax86bbdndnaraif:YaqNJbbbZMgk:lJbbb9p9DTmbak:Ohoxekcjjjj94hokalao86bbdndnavaifar9R:YaqNJbbbZMgk:lJbbb9p9DTmbak:Ohixekcjjjj94hikabai86bbdndnaDadcetGadceGV:ZaqNJbbbZMgq:lJbbb9p9DTmbaq:Ohdxekcjjjj94hdkawad86bbabclfhbaecufgembxdkkaeTmbindndnab8Vebgiabcdfgl8Uebgvabclfgo8Uebgrf9R:YJbFu9habcofgw8Vebgdce4adVgDcd4aDVgDcl4aDVgDcw4aDVgD:Z:vgqNJbbbZMgk:lJbbb9p9DTmbak:Ohxxekcjjjj94hxkaoax87ebdndnaraif:YaqNJbbbZMgk:lJbbb9p9DTmbak:Ohoxekcjjjj94hokalao87ebdndnavaifar9R:YaqNJbbbZMgk:lJbbb9p9DTmbak:Ohixekcjjjj94hikabai87ebdndnaDadcetGadceGV:ZaqNJbbbZMgq:lJbbb9p9DTmbaq:Ohdxekcjjjj94hdkawad87ebabcwfhbaecufgembkkk9teiucbcbyd:K:G:cjbgeabcifc98GfgbBd:K:G:cjbdndnabZbcztgd9nmbcuhiabad9RcFFifcz4nbcuSmekaehikaik;LeeeudndnaeabVciGTmbabhixekdndnadcz9pmbabhixekabhiinaiaeydbBdbaiclfaeclfydbBdbaicwfaecwfydbBdbaicxfaecxfydbBdbaeczfheaiczfhiadc9Wfgdcs0mbkkadcl6mbinaiaeydbBdbaeclfheaiclfhiadc98fgdci0mbkkdnadTmbinaiaeRbb86bbaicefhiaecefheadcufgdmbkkabk;aeedudndnabciGTmbabhixekaecFeGc:b:c:ew2hldndnadcz9pmbabhixekabhiinaialBdbaicxfalBdbaicwfalBdbaiclfalBdbaiczfhiadc9Wfgdcs0mbkkadcl6mbinaialBdbaiclfhiadc98fgdci0mbkkdnadTmbinaiae86bbaicefhiadcufgdmbkkabkk83dbcj:Gdk8Kbbbbdbbblbbbwbbbbbbbebbbdbbblbbbwbbbbc:K:Gdkl8W:qbb",t="b9H79TebbbeKl9Gbb9Gvuuuuueu9Giuuub9Geueuixkbbebeeddddilve9Weeeviebeoweuecj:Gdkr;Neqo9TW9T9VV95dbH9F9F939H79T9F9J9H229F9Jt9VV7bb8A9TW79O9V9Wt9F9KW9J9V9KW9wWVtW949c919M9MWVbdY9TW79O9V9Wt9F9KW9J9V9KW69U9KW949c919M9MWVblE9TW79O9V9Wt9F9KW9J9V9KW69U9KW949tWG91W9U9JWbvL9TW79O9V9Wt9F9KW9J9V9KWS9P2tWV9p9JtboK9TW79O9V9Wt9F9KW9J9V9KWS9P2tWV9r919HtbrL9TW79O9V9Wt9F9KW9J9V9KWS9P2tWVT949WbwY9TW79O9V9Wt9F9KW9J9V9KWS9P2tWVJ9V29VVbDl79IV9Rbqq:59Dklbzik94evu8Jjjjjbcz9Rhbcbheincbhdcbhiinabcwfadfaicjuaead4ceGglE86bbaialfhiadcefgdcw9hmbkaeai86b:q:W:cjbaecitab8Piw83i:q:G:cjbaecefgecjd9hmbkk:SBlEud97dur978Jjjjjbcj;kb9Rgv8Kjjjjbc9:hodnalTmbcuhoaiRbbgrc;WeGc:Ge9hmbarcsGgwce0mbc9:hoalcufadcd4cbawEgDadfgrcKcaawEgqaraq0Egk6mbaialfgxar9RhodnadTgmmbavaoad;8qbbkaicefhPcj;abad9Uc;WFbGcjdadca0EhsdndndnadTmbaoadfhzcbhHinaeaH9nmdaxaP9RaD6miabaHad2fgOavcjdfasaeaH9RaHasfae6EgAaAcsfgoc9WGgCSEhXaPaDfhQaocl4cifcd4hLavcj;cbfaCcetfhKavcj;cbfaCci2fhYavcj;cbfaCfh8AcbhEaoc;ab6h3incbh5dnawTmbaPaEcd4fRbbh5kcbh8Eavcj;cbfh8Findndndndna5a8Ecet4ciGgoc9:fPdebdkaxaQ9RaC6mwdnaCTmbavcj;cbfa8EaC2faQaC;8qbbkaQaAfhQxdkaCTmeavcj;cbfa8EaC2fcbaC;8kbxekaxaQ9RaL6moaoclVcbawEhraQaLfhocbhidna3mbaxao9Rc;Gb6mbcbhlina8FalfhidndndndndndnaQalco4fRbbgqciGarfPDbedibledibkaipxbbbbbbbbbbbbbbbbpklbxlkaiaopbblaopbbbgaclp:meaapmbzeHdOiAlCvXoQrLgacdp:meaapmbzeHdOiAlCvXoQrLpxiiiiiiiiiiiiiiiip9oghpxiiiiiiiiiiiiiiiip8Jgap5b9cjF;8;4;W;G;ab9:9cU1:Nggcitpbi:q:G:cjbagRb:q:W:cjbggpsaap5e9cjF;8;4;W;G;ab9:9cU1:Ng8Jcitpbi:q:G:cjbp9UpmbedilvorzHOACXQLpPahaap9spklbagaoclffa8JRb:q:W:cjbfhoxikaiaopbbwaopbbbgaclp:meaapmbzeHdOiAlCvXoQrLpxssssssssssssssssp9oghpxssssssssssssssssp8Jgap5b9cjF;8;4;W;G;ab9:9cU1:Nggcitpbi:q:G:cjbagRb:q:W:cjbggpsaap5e9cjF;8;4;W;G;ab9:9cU1:Ng8Jcitpbi:q:G:cjbp9UpmbedilvorzHOACXQLpPahaap9spklbagaocwffa8JRb:q:W:cjbfhoxdkaiaopbbbpklbaoczfhoxekaiaopbbdaoRbbggcitpbi:q:G:cjbagRb:q:W:cjbggpsaoRbeg8Jcitpbi:q:G:cjbp9UpmbedilvorzHOACXQLpPpklbagaocdffa8JRb:q:W:cjbfhokdndndndndndnaqcd4ciGarfPDbedibledibkaiczfpxbbbbbbbbbbbbbbbbpklbxlkaiczfaopbblaopbbbgaclp:meaapmbzeHdOiAlCvXoQrLgacdp:meaapmbzeHdOiAlCvXoQrLpxiiiiiiiiiiiiiiiip9oghpxiiiiiiiiiiiiiiiip8Jgap5b9cjF;8;4;W;G;ab9:9cU1:Nggcitpbi:q:G:cjbagRb:q:W:cjbggpsaap5e9cjF;8;4;W;G;ab9:9cU1:Ng8Jcitpbi:q:G:cjbp9UpmbedilvorzHOACXQLpPahaap9spklbagaoclffa8JRb:q:W:cjbfhoxikaiczfaopbbwaopbbbgaclp:meaapmbzeHdOiAlCvXoQrLpxssssssssssssssssp9oghpxssssssssssssssssp8Jgap5b9cjF;8;4;W;G;ab9:9cU1:Nggcitpbi:q:G:cjbagRb:q:W:cjbggpsaap5e9cjF;8;4;W;G;ab9:9cU1:Ng8Jcitpbi:q:G:cjbp9UpmbedilvorzHOACXQLpPahaap9spklbagaocwffa8JRb:q:W:cjbfhoxdkaiczfaopbbbpklbaoczfhoxekaiczfaopbbdaoRbbggcitpbi:q:G:cjbagRb:q:W:cjbggpsaoRbeg8Jcitpbi:q:G:cjbp9UpmbedilvorzHOACXQLpPpklbagaocdffa8JRb:q:W:cjbfhokdndndndndndnaqcl4ciGarfPDbedibledibkaicafpxbbbbbbbbbbbbbbbbpklbxlkaicafaopbblaopbbbgaclp:meaapmbzeHdOiAlCvXoQrLgacdp:meaapmbzeHdOiAlCvXoQrLpxiiiiiiiiiiiiiiiip9oghpxiiiiiiiiiiiiiiiip8Jgap5b9cjF;8;4;W;G;ab9:9cU1:Nggcitpbi:q:G:cjbagRb:q:W:cjbggpsaap5e9cjF;8;4;W;G;ab9:9cU1:Ng8Jcitpbi:q:G:cjbp9UpmbedilvorzHOACXQLpPahaap9spklbagaoclffa8JRb:q:W:cjbfhoxikaicafaopbbwaopbbbgaclp:meaapmbzeHdOiAlCvXoQrLpxssssssssssssssssp9oghpxssssssssssssssssp8Jgap5b9cjF;8;4;W;G;ab9:9cU1:Nggcitpbi:q:G:cjbagRb:q:W:cjbggpsaap5e9cjF;8;4;W;G;ab9:9cU1:Ng8Jcitpbi:q:G:cjbp9UpmbedilvorzHOACXQLpPahaap9spklbagaocwffa8JRb:q:W:cjbfhoxdkaicafaopbbbpklbaoczfhoxekaicafaopbbdaoRbbggcitpbi:q:G:cjbagRb:q:W:cjbggpsaoRbeg8Jcitpbi:q:G:cjbp9UpmbedilvorzHOACXQLpPpklbagaocdffa8JRb:q:W:cjbfhokdndndndndndnaqco4arfPDbedibledibkaic8Wfpxbbbbbbbbbbbbbbbbpklbxlkaic8Wfaopbblaopbbbgaclp:meaapmbzeHdOiAlCvXoQrLgacdp:meaapmbzeHdOiAlCvXoQrLpxiiiiiiiiiiiiiiiip9oghpxiiiiiiiiiiiiiiiip8Jgap5b9cjF;8;4;W;G;ab9:9cU1:Ngicitpbi:q:G:cjbaiRb:q:W:cjbgipsaap5e9cjF;8;4;W;G;ab9:9cU1:Ngqcitpbi:q:G:cjbp9UpmbedilvorzHOACXQLpPahaap9spklbaiaoclffaqRb:q:W:cjbfhoxikaic8Wfaopbbwaopbbbgaclp:meaapmbzeHdOiAlCvXoQrLpxssssssssssssssssp9oghpxssssssssssssssssp8Jgap5b9cjF;8;4;W;G;ab9:9cU1:Ngicitpbi:q:G:cjbaiRb:q:W:cjbgipsaap5e9cjF;8;4;W;G;ab9:9cU1:Ngqcitpbi:q:G:cjbp9UpmbedilvorzHOACXQLpPahaap9spklbaiaocwffaqRb:q:W:cjbfhoxdkaic8Wfaopbbbpklbaoczfhoxekaic8WfaopbbdaoRbbgicitpbi:q:G:cjbaiRb:q:W:cjbgipsaoRbegqcitpbi:q:G:cjbp9UpmbedilvorzHOACXQLpPpklbaiaocdffaqRb:q:W:cjbfhokalc;abfhialcjefaC0meaihlaxao9Rc;Fb0mbkkdnaiaC9pmbaici4hlinaxao9RcK6mwa8FaifhqdndndndndndnaQaico4fRbbalcoG4ciGarfPDbedibledibkaqpxbbbbbbbbbbbbbbbbpkbbxlkaqaopbblaopbbbgaclp:meaapmbzeHdOiAlCvXoQrLgacdp:meaapmbzeHdOiAlCvXoQrLpxiiiiiiiiiiiiiiiip9oghpxiiiiiiiiiiiiiiiip8Jgap5b9cjF;8;4;W;G;ab9:9cU1:Nggcitpbi:q:G:cjbagRb:q:W:cjbggpsaap5e9cjF;8;4;W;G;ab9:9cU1:Ng8Jcitpbi:q:G:cjbp9UpmbedilvorzHOACXQLpPahaap9spkbbagaoclffa8JRb:q:W:cjbfhoxikaqaopbbwaopbbbgaclp:meaapmbzeHdOiAlCvXoQrLpxssssssssssssssssp9oghpxssssssssssssssssp8Jgap5b9cjF;8;4;W;G;ab9:9cU1:Nggcitpbi:q:G:cjbagRb:q:W:cjbggpsaap5e9cjF;8;4;W;G;ab9:9cU1:Ng8Jcitpbi:q:G:cjbp9UpmbedilvorzHOACXQLpPahaap9spkbbagaocwffa8JRb:q:W:cjbfhoxdkaqaopbbbpkbbaoczfhoxekaqaopbbdaoRbbggcitpb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qkwDqkp9Ughp9AbbbaladfglahaaaapmxmPsxmPsxmPsxmPsp9Ug8Kp9AbbbaladfhlaoczfgoaC6mbxikkaCTmeaXaEfhlavaEfpbdbh8Kcbhoinalavcj;cbfaofpblbg8La8Aaofpblbg8MpmbzeHdOiAlCvXoQrLg8NaKaofpblbgyaYaofpblbg8PpmbzeHdOiAlCvXoQrLgIpmbezHdiOAlvCXorQLgacep:neaapxebebebebebebebebghp9op:bep9rgaa8Kp:oeg8Kp9Abbbaladfgla8Kaaaapmlvorlvorlvorlvorp:oeg8Kp9Abbbaladfgla8KaaaapmwDqkwDqkwDqkwDqkp:oeg8Kp9Abbbaladfgla8KaaaapmxmPsxmPsxmPsxmPsp:oeg8Kp9Abbbaladfgla8Ka8NaIpmwDKYqk8AExm35Ps8E8Fgacep:neaaahp9op:bep9rgap:oeg8Kp9Abbbaladfgla8Kaaaapmlvorlvorlvorlvorp:oeg8Kp9Abbbaladfgla8KaaaapmwDqkwDqkwDqkwDqkp:oeg8Kp9Abbbaladfgla8KaaaapmxmPsxmPsxmPsxmPsp:oeg8Kp9Abbbaladfgla8Ka8La8MpmwKDYq8AkEx3m5P8Es8Fg8Laya8PpmwKDYq8AkEx3m5P8Es8Fg8MpmbezHdiOAlvCXorQLgacep:neaaahp9op:bep9rgap:oeg8Kp9Abbbaladfgla8Kaaaapmlvorlvorlvorlvorp:oeg8Kp9Abbbaladfgla8KaaaapmwDqkwDqkwDqkwDqkp:oeg8Kp9Abbbaladfgla8KaaaapmxmPsxmPsxmPsxmPsp:oeg8Kp9Abbbaladfgla8Ka8La8MpmwDKYqk8AExm35Ps8E8Fgacep:neaaahp9op:bep9rgap:oeghp9Abbbaladfglahaaaapmlvorlvorlvorlvorp:oeghp9AbbbaladfglahaaaapmwDqkwDqkwDqkwDqkp:oeghp9AbbbaladfglahaaaapmxmPsxmPsxmPsxmPsp:oeg8Kp9AbbbaladfhlaoczfgoaC6mbxdkkaCTmbaXaEfhrcbhocbalcl4gl9Rc8FGhiavaEfpbdbhhinaravcj;cbfaofpblbg8Ka8Aaofpblbg8LpmbzeHdOiAlCvXoQrLg8MaKaofpblbg8NaYaofpblbgypmbzeHdOiAlCvXoQrLg8PpmbezHdiOAlvCXorQLgaaip:Reaaalp:Tep9qgaahp9rghp9Abbbaradfgrahaaaapmlvorlvorlvorlvorp9rghp9AbbbaradfgrahaaaapmwDqkwDqkwDqkwDqkp9rghp9AbbbaradfgrahaaaapmxmPsxmPsxmPsxmPsp9rghp9Abbbaradfgraha8Ma8PpmwDKYqk8AExm35Ps8E8Fgaaip:Reaaalp:Tep9qgap9rghp9Abbbaradfgrahaaaapmlvorlvorlvorlvorp9rghp9AbbbaradfgrahaaaapmwDqkwDqkwDqkwDqkp9rghp9AbbbaradfgrahaaaapmxmPsxmPsxmPsxmPsp9rghp9Abbbaradfgraha8Ka8LpmwKDYq8AkEx3m5P8Es8Fg8Ka8NaypmwKDYq8AkEx3m5P8Es8Fg8LpmbezHdiOAlvCXorQLgaaip:Reaaalp:Tep9qgap9rghp9Abbbaradfgrahaaaapmlvorlvorlvorlvorp9rghp9AbbbaradfgrahaaaapmwDqkwDqkwDqkwDqkp9rghp9AbbbaradfgrahaaaapmxmPsxmPsxmPsxmPsp9rghp9Abbbaradfgraha8Ka8LpmwDKYqk8AExm35Ps8E8Fgaaip:Reaaalp:Tep9qgap9rghp9Abbbaradfgrahaaaapmlvorlvorlvorlvorp9rghp9AbbbaradfgrahaaaapmwDqkwDqkwDqkwDqkp9rghp9AbbbaradfgrahaaaapmxmPsxmPsxmPsxmPsp9rghp9AbbbaradfhraoczfgoaC6mbkkaEclfgEad6mbkdnaXavcjdf9hmbaAad2goTmbaOavcjdfao;8qbbkdnammbavaXaAcufad2fad;8qbbkaAaHfhHc9:hoaQhPaQmbxlkkaeTmbaDalfhrcbhocuhlinaralaD9RglfaD6mdasaeao9Raoasfae6Eaofgoae6mbkaial9RhPkcbc99axaP9RakSEhoxekc9:hokavcj;kbf8Kjjjjbaokwbz:bjjjbkNsezu8Jjjjjbc;ae9Rgv8Kjjjjbc9:hodnalaeci9UgrcHf6mbcuhoaiRbbgwc;WeGc;Ge9hmbawcsGgDce0mbavc;abfcFecje;8kbav9cu83iUav9cu83i8Wav9cu83iyav9cu83iaav9cu83iKav9cu83izav9cu83iwav9cu83ibaialfc9WfhqaicefgwarfhldnaeTmbcmcsaDceSEhkcbhxcbhmcbhrcbhicbhoindnalaq9nmbc9:hoxikdndnawRbbgDc;Ve0mbavc;abfaoaDcu7gPcl4fcsGcitfgsydlhzasydbhHdndnaDcsGgsak9pmbavaiaPfcsGcdtfydbaxasEhDaxasTgOfhxxekdndnascsSmbcehOasc987asamffcefhDxekalcefhDal8SbbgscFeGhPdndnascu9mmbaDhlxekalcvfhlaPcFbGhPcrhsdninaD8SbbgOcFbGastaPVhPaOcu9kmeaDcefhDascrfgsc8J9hmbxdkkaDcefhlkcehOaPce4cbaPceG9R7amfhDkaDhmkavc;abfaocitfgsaDBdbasazBdlavaicdtfaDBdbavc;abfaocefcsGcitfgsaHBdbasaDBdlaocdfhoaOaifhidnadcd9hmbabarcetfgsaH87ebasclfaD87ebascdfaz87ebxdkabarcdtfgsaHBdbascwfaDBdbasclfazBdbxekdnaDcpe0mbavaiaqaDcsGfRbbgscl4gP9RcsGcdtfydbaxcefgOaPEhDavaias9RcsGcdtfydbaOaPTgzfgOascsGgPEhsaPThPdndnadcd9hmbabarcetfgHax87ebaHclfas87ebaHcdfaD87ebxekabarcdtfgHaxBdbaHcwfasBdbaHclfaDBdbkavaicdtfaxBdbavc;abfaocitfgHaDBdbaHaxBdlavaicefgicsGcdtfaDBdbavc;abfaocefcsGcitfgHasBdbaHaDBdlavaiazfgicsGcdtfasBdbavc;abfaocdfcsGcitfgDaxBdbaDasBdlaocifhoaiaPfhiaOaPfhxxekaxcbalRbbgsEgHaDc;:eSgDfhOascsGhAdndnascl4gCmbaOcefhzxekaOhzavaiaC9RcsGcdtfydbhOkdndnaAmbazcefhxxekazhxavaias9RcsGcdtfydbhzkdndnaDTmbalcefhDxekalcdfhDal8SbegPcFeGhsdnaPcu9kmbalcofhHascFbGhscrhldninaD8SbbgPcFbGaltasVhsaPcu9kmeaDcefhDalcrfglc8J9hmbkaHhDxekaDcefhDkasce4cbasceG9R7amfgmhHkdndnaCcsSmbaDhsxekaDcefhsaD8SbbglcFeGhPdnalcu9kmbaDcvfhOaPcFbGhPcrhldninas8SbbgDcFbGaltaPVhPaDcu9kmeascefhsalcrfglc8J9hmbkaOhsxekascefhskaPce4cbaPceG9R7amfgmhOkdndnaAcsSmbashlxekascefhlas8SbbgDcFeGhPdnaDcu9kmbascvfhzaPcFbGhPcrhDdninal8SbbgscFbGaDtaPVhPascu9kmealcefhlaDcrfgDc8J9hmbkazhlxekalcefhlkaPce4cbaPceG9R7amfgmhzkdndnadcd9hmbabarcetfgDaH87ebaDclfaz87ebaDcdfaO87ebxekabarcdtfgDaHBdbaDcwfazBdbaDclfaOBdbkavc;abfaocitfgDaOBdbaDaHBdlavaicdtfaHBdbavc;abfaocefcsGcitfgDazBdbaDaOBdlavaicefgicsGcdtfaOBdbavc;abfaocdfcsGcitfgDaHBdbaDazBdlavaiaCTaCcsSVfgicsGcdtfazBdbaiaATaAcsSVfhiaocifhokawcefhwaocsGhoaicsGhiarcifgrae6mbkkcbc99alaqSEhokavc;aef8Kjjjjbaok:clevu8Jjjjjbcz9Rhvdnalaecvf9pmbc9:skdnaiRbbc;:eGc;qeSmbcuskav9cb83iwaicefhoaialfc98fhrdnaeTmbdnadcdSmbcbhwindnaoar6mbc9:skaocefhlao8SbbgicFeGhddndnaicu9mmbalhoxekaocvfhoadcFbGhdcrhidninal8SbbgDcFbGaitadVhdaDcu9kmealcefhlaicrfgic8J9hmbxdkkalcefhokabawcdtfadc8Etc8F91adcd47avcwfadceGcdtVglydbfgiBdbalaiBdbawcefgwae9hmbxdkkcbhwindnaoar6mbc9:skaocefhlao8SbbgicFeGhddndnaicu9mmbalhoxekaocvfhoadcFbGhdcrhidninal8SbbgDcFbGaitadVhdaDcu9kmealcefhlaicrfgic8J9hmbxdkkalcefhokabawcetfadc8Etc8F91adcd47avcwfadceGcdtVglydbfgi87ebalaiBdbawcefgwae9hmbkkcbc99aoarSEk;Toio97eue97aec98Ghedndnadcl9hmbaeTmecbhdinababpbbbgicKp:RecKp:Sep;6eglaicwp:RecKp:Sep;6ealp;Geaiczp:RecKp:Sep;6egvp;Gep;Kep;Legopxbbbbbbbbbbbbbbbbp:2egralpxbbbjbbbjbbbjbbbjgwp9op9rp;Keglpxbb;:9cbb;:9cbb;:9cbb;:9calalp;Meaoaop;Meavaravawp9op9rp;Keglalp;Mep;Kep;Kep;Jep;Negvp;Mepxbbn0bbn0bbn0bbn0grp;KepxFbbbFbbbFbbbFbbbp9oaipxbbbFbbbFbbbFbbbFp9op9qalavp;Mearp;Kecwp:RepxbFbbbFbbbFbbbFbbp9op9qaoavp;Mearp;Keczp:RepxbbFbbbFbbbFbbbFbp9op9qpkbbabczfhbadclfgdae6mbxdkkaeTmbcbhdinabczfgDaDpbbbgipxbbbbbbFFbbbbbbFFgwp9oabpbbbgoaipmbediwDqkzHOAKY8AEgvczp:Reczp:Sep;6eglaoaipmlvorxmPsCXQL358E8FpxFubbFubbFubbFubbp9op;6eavczp:Sep;6egvp;Gealp;Gep;Kep;Legipxbbbbbbbbbbbbbbbbp:2egralpxbbbjbbbjbbbjbbbjgqp9op9rp;Keglpxb;:FSb;:FSb;:FSb;:FSalalp;Meaiaip;Meavaravaqp9op9rp;Keglalp;Mep;Kep;Kep;Jep;Negvp;Mepxbbn0bbn0bbn0bbn0grp;KepxFFbbFFbbFFbbFFbbp9oaiavp;Mearp;Keczp:Rep9qgialavp;Mearp;KepxFFbbFFbbFFbbFFbbp9oglpmwDKYqk8AExm35Ps8E8Fp9qpkbbabaoawp9oaialpmbezHdiOAlvCXorQLp9qpkbbabcafhbadclfgdae6mbkkk;2ileue97euo97dnaec98GgiTmbcbheinabcKfpx:ji:1S:ji:1S:ji:1S:ji:1SabpbbbglabczfgvpbbbgopmlvorxmPsCXQL358E8Fgrczp:Segwpxibbbibbbibbbibbbp9qp;6egDp;NegqaDaDp;MegDaDp;KealaopmbediwDqkzHOAKY8AEgDczp:Reczp:Sep;6eglalp;MeaDczp:Sep;6egoaop;Mearczp:Reczp:Sep;6egrarp;Mep;Kep;Kep;Lepxbbbbbbbbbbbbbbbbp:4ep;Jep;Mepxbbn0bbn0bbn0bbn0gDp;KepxFFbbFFbbFFbbFFbbgkp9oaqaop;MeaDp;Keczp:Rep9qgoaqalp;MeaDp;Keakp9oaqarp;MeaDp;Keczp:Rep9qgDpmwDKYqk8AExm35Ps8E8Fglp5eawclp:RegqpEi:T:j83ibavalp5baqpEd:T:j83ibabcwfaoaDpmbezHdiOAlvCXorQLgDp5eaqpEe:T:j83ibabaDp5baqpEb:T:j83ibabcafhbaeclfgeai6mbkkkuee97dnadcd4ae2c98GgeTmbcbhdinababpbbbgicwp:Recwp:Sep;6eaicep:SepxbbjFbbjFbbjFbbjFp9opxbbjZbbjZbbjZbbjZp:Uep;Mepkbbabczfhbadclfgdae6mbkkk:Sodw97euaec98Ghedndnadcl9hmbaeTmecbhdinabpxbbuJbbuJbbuJbbuJabpbbbgicKp:TeglaicYp:Tep9qgvcdp:Teavp9qgvclp:Teavp9qgop;6ep;Negvaicwp:RecKp:SegraipxFbbbFbbbFbbbFbbbgwp9ogDp:Uep;6ep;Mepxbbn0bbn0bbn0bbn0gqp;Kecwp:RepxbFbbbFbbbFbbbFbbp9oavaDarp:Xeaiczp:RecKp:Segip:Uep;6ep;Meaqp;Keawp9op9qavaDaraip:Uep:Xep;6ep;Meaqp;Keczp:RepxbbFbbbFbbbFbbbFbp9op9qavaoalcep:Rep9oalpxebbbebbbebbbebbbp9op9qp;6ep;Meaqp;KecKp:Rep9qpkbbabczfhbadclfgdae6mbxdkkaeTmbcbhdinabczfgkpxbFu9hbFu9hbFu9hbFu9habpbbbglakpbbbgrpmlvorxmPsCXQL358E8Fgvczp:TegqavcHp:Tep9qgicdp:Teaip9qgiclp:Teaip9qgicwp:Teaip9qgop;6ep;NegialarpmbediwDqkzHOAKY8AEgDpxFFbbFFbbFFbbFFbbglp9ograDczp:Segwp:Ueavczp:Reczp:SegDp:Xep;6ep;Mepxbbn0bbn0bbn0bbn0gvp;Kealp9oaiarawaDp:Uep:Xep;6ep;Meavp;Keczp:Rep9qgwaiaoaqcep:Rep9oaqpxebbbebbbebbbebbbp9op9qp;6ep;Meavp;Keczp:ReaiaDarp:Uep;6ep;Meavp;Kealp9op9qgipmwDKYqk8AExm35Ps8E8FpkbbabawaipmbezHdiOAlvCXorQLpkbbabcafhbadclfgdae6mbkkk9teiucbcbydj:G:cjbgeabcifc98GfgbBdj:G:cjbdndnabZbcztgd9nmbcuhiabad9RcFFifcz4nbcuSmekaehikaikkxebcj:Gdklz:zbb",n=new Uint8Array([0,97,115,109,1,0,0,0,1,4,1,96,0,0,3,3,2,0,0,5,3,1,0,1,12,1,0,10,22,2,12,0,65,0,65,0,65,0,252,10,0,0,11,7,0,65,0,253,15,26,11]),i=new Uint8Array([32,0,65,2,1,106,34,33,3,128,11,4,13,64,6,253,10,7,15,116,127,5,8,12,40,16,19,54,20,9,27,255,113,17,42,67,24,23,146,148,18,14,22,45,70,69,56,114,101,21,25,63,75,136,108,28,118,29,73,115]);if(typeof WebAssembly!="object")return{supported:!1};var o=WebAssembly.validate(n)?a(t):a(e),r,s=WebAssembly.instantiate(o,{}).then(function(S){r=S.instance,r.exports.__wasm_call_ctors()});function a(S){for(var Z=new Uint8Array(S.length),R=0;R96?C-97:C>64?C-39:C+4}for(var E=0,R=0;R0?y(S,Z,R,u[C],d[E]):s.then(function(){var A=new Uint8Array(S*Z);return c(r,r.exports[u[C]],A,S,Z,R,r.exports[d[E]]),A})}}})();var mQn=x(T(),1),dQn=(function(){var e="b9H79Tebbbe:6eO9Geueu9Geub9Gbb9Gsuuuuuuuuuuuu99uueu9Gvuuuuub9Gruuuuuuub9Gouuuuuue999Gvuuuuueu9Gzuuuuuuuuuuu99uuuub9Gquuuuuuu99uueu9GPuuuuuuuuuuu99uueu9Gquuuuuuuu99ueu9Gruuuuuu99eu9Gwuuuuuu99ueu9Giuuue999Gluuuueu9Gluuuub9GiuuueuiLQdilvorlwDiqkxmPszbHHbelve9Weiiviebeoweuecj:Gdkr:Bdxo9TW9T9VV95dbH9F9F939H79T9F9J9H229F9Jt9VV7bbz9TW79O9V9Wt9F79P9T9W29P9M95bw8E9TW79O9V9Wt9F79P9T9W29P9M959x9Pt9OcttV9P9I91tW7bD8A9TW79O9V9Wt9F79P9T9W29P9M959x9Pt9O9v9W9K9HtWbqQ9TW79O9V9Wt9F79P9T9W29P9M959t29V9W9W95bkX9TW79O9V9Wt9F79P9T9W29P9M959qV919UWbxQ9TW79O9V9Wt9F79P9T9W29P9M959q9V9P9Ut7bmX9TW79O9V9Wt9F79P9T9W29P9M959t9J9H2WbPa9TW79O9V9Wt9F9V9Wt9P9T9P96W9wWVtW94SWt9J9O9sW9T9H9Wbs59TW79O9V9Wt9F9NW9UWV9HtW9q9V79Pt9P9V9U9sW9T9H9Wbzl79IV9RbHDwebcekdCXq;y;WeQdbk;r:herYue99iuY99Xue9:D998Jjjjjbcj;sb9Rgs8Kjjjjbcbhzasc:Cefcbc;Kbz:tjjjb8AdnabaeSmbabaeadcdtzMjjjb8AkdnamcdGTmbalcrfci4cbyd1:H:cjbHjjjjbbhHasc:Cefasyd;8egecdtfaHBdbasaecefBd;8ecbhlcbhednadTmbabheadhOinaHaeydbci4fcb86bbaeclfheaOcufgOmbkcbhlabheadhOinaHaeydbgAci4fgCaCRbbgCceaAcrGgAtV86bbaCcu7aA4ceGalfhlaeclfheaOcufgOmbkcualcdtalcFFFFi0Ehekaecbyd1:H:cjbHjjjjbbhzasc:Cefasyd;8egecdtfazBdbasaecefBd;8ealcd4alfhOcehHinaHgecethHaeaO6mbkcbhXcuaecdtgOaecFFFFi0Ecbyd1:H:cjbHjjjjbbhHasc:Cefasyd;8egAcdtfaHBdbasaAcefBd;8eaHcFeaOz:tjjjbhQdnadTmbaecufhLcbhKindndnaQabaKcdtfgYydbgAc:v;t;h;Ev2aLGgOcdtfgCydbgHcuSmbceheinazaHcdtfydbaASmdaOaefhHaecefheaQaHaLGgOcdtfgCydbgHcu9hmbkkazaXcdtfaABdbaCaXBdbaXhHaXcefhXkaYaHBdbaKcefgKad9hmbkkaQcbyd:m:H:cjbH:bjjjbbasasyd;8ecufBd;8ekcbh8AcualcefgecdtaecFFFFi0Ecbyd1:H:cjbHjjjjbbhLasc:Cefasyd;8egecdtfaLBdbasaLBdNeasaecefBd;8ecuadcitadcFFFFe0Ecbyd1:H:cjbHjjjjbbhEasc:Cefasyd;8egecdtfaEBdbasaEBd:yeasaecefBd;8eascNefabadalcbz:cjjjbcualcdtgealcFFFFi0Eg3cbyd1:H:cjbHjjjjbbhOasc:Cefasyd;8egHcdtfaOBdbasaHcefBd;8ea3cbyd1:H:cjbHjjjjbbhQasc:Cefasyd;8egHcdtfaQBdbasaHcefBd;8eaOaQaialavazasc:Cefz:djjjbalcbyd1:H:cjbHjjjjbbhYasc:Cefasyd;8egHcdtfaYBdbasaHcefBd;8ea3cbyd1:H:cjbHjjjjbbhHasc:Cefasyd;8egAcdtfaHBdbasaAcefBd;8ea3cbyd1:H:cjbHjjjjbbhAasc:Cefasyd;8egCcdtfaABdbasaCcefBd;8eaHcFeaez:tjjjbh5aAcFeaez:tjjjbh8EdnalTmbindnaLa8AgAcefg8AcdtfydbgCaLaAcdtgefydbgHSmbaCaH9Rh8FaEaHcitfhaa8Eaefhha5aefhKcbhCindndnaaaCcitfydbgXaA9hmbaKaABdbahaABdbxekdnaLaXcdtggfgeclfydbgHaeydbgeSmbaHae9RhHaEaecitfheinaeydbaASmdaecwfheaHcufgHmbkka8EagfgeaAaXaeydbcuSEBdbaKaXaAaKydbcuSEBdbkaCcefgCa8F9hmbkka8Aal9hmbkaOhHaQhAa5hXa8EhCcbheindndnaeaHydbgK9hmbdnaeaAydbgK9hmbaXydbhKdnaCydbg8Fcu9hmbaKcu9hmbaYaefcb86bbxikdna8FcuSmbaKcuSmbaea8FSmbaOa8FcdtfydbaOaKcdtfydb9hmbaYaefcd86bbxikaYaefhadnaea8FSmbaeaKSmbaace86bbxikaacl86bbxdkdnaeaQaKcdtg8Ffydb9hmbdnaCydbgacuSmbaeaaSmbaXydbggcuSmbaeagSmba8Ea8FfydbghcuSmbahaKSmba5a8Ffydbg8FcuSmba8FaKSmbdnaOaacdtfydbgKaOa8Fcdtfydb9hmbaKaOagcdtfydbg8FSmba8FaOahcdtfydb9hmbaYaefcd86bbxlkaYaefcl86bbxikaYaefcl86bbxdkaYaefcl86bbxekaYaefaYaKfRbb86bbkaHclfhHaAclfhAaXclfhXaCclfhCalaecefge9hmbkdnamcaGTmbcbh8JindndnaYa8Jfg8KRbbg8Lc9:fPibebekdndndnaOa8Jcdtfydbgea8J9hmbdnaqmbcbh8FxdkdnazTmbcbh8Fa8JheinaqazaecdtgefydbfRbbce4a8FVceGh8FaQaefydbgea8J9hmbxikkcbh8Fa8JheinaqaefRbbce4a8FVceGh8FaQaecdtfydbgea8J9hmbxdkkaYaefRbbhexeka8JheindnaLaecdtg8AfgeclfydbgHaeydbgeSmbaHae9RhgaEaecitfhhaOa8AfhacbhKinahaKcitfydbgXhednindnaLaecdtgCfgeclfydbgHaeydbgeSmbaHae9RhHaEaecitfheaaydbhAdninaOaeydbcdtfydbaASmeaecwfheaHcufgHTmdxbkkcbhexdkaQaCfydbgeaX9hmbkceheka8FaeVh8FaKcefgKag9hmbkkaQa8Afydbgea8J9hmbka8Lcia8FceGEheka8Kae86bbka8Jcefg8Jal9hmbkkdnaqTmbdndnazTmbazheaOhHalhAindnaqaeydbfRbbceGTmbaYaHydbfcl86bbkaeclfheaHclfhHaAcufgAmbxdkkaqheaOhHalhAindnaeRbbceGTmbaYaHydbfcl86bbkaecefheaHclfhHaAcufgAmbkkaOhealhAaYhHindnaYaeydbfRbbcl9hmbaHcl86bbkaeclfheaHcefhHaAcufgAmbkkamceGTmbaYhealhHindnaeRbbce9hmbaecl86bbkaecefheaHcufgHmbkkcbh8Mcualcx2alc;v:Q;v:Qe0Ecbyd1:H:cjbHjjjjbbh8Nasc:Cefasyd;8egecdtfa8NBdbasaecefBd;8eascbBd:qeas9cb83i1ea8Naialavazasc1efz:ejjjbhydndnaDmbcbh8PcbhCxekcbhCawhecbhHindnaeIdbJbbbb9ETmbasaCcdtfaHBdbaCcefhCkaeclfheaDaHcefgH9hmbkcuaCal2gecdtaecFFFFi0Ecbyd1:H:cjbHjjjjbbh8Pasc:Cefasyd;8egecdtfa8PBdbasaecefBd;8ealTmbdnaCmbcbhCxekarcd4hgdnazTmbaCcdthhcbh8Fa8Phainaoaza8Fcdtfydbag2cdtfhKasheaahHaChAinaHaKaeydbcdtgXfIdbawaXfIdbNUdbaeclfheaHclfhHaAcufgAmbkaaahfhaa8Fcefg8Fal9hmbxdkkaCcdthhcbh8Fa8Phainaoa8Fag2cdtfhKasheaahHaChAinaHaKaeydbcdtgXfIdbawaXfIdbNUdbaeclfheaHclfhHaAcufgAmbkaaahfhaa8Fcefg8Fal9hmbkkcualc8S2gHalc;D;O;f8U0EgXcbyd1:H:cjbHjjjjbbheasc:Cefasyd;8egAcdtfaeBdbasaAcefBd;8eaecbaHz:tjjjbhIcbh8RcbhgdnaCTmbcbh8MaXcbyd1:H:cjbHjjjjbbhgasc:Cefasyd;8egecdtfagBdbasaecefBd;8eagcbaHz:tjjjb8AcuaCal2gecltgHaecFFFFb0Ecbyd1:H:cjbHjjjjbbh8Rasc:Cefasyd;8egecdtfa8RBdbasaecefBd;8ea8RcbaHz:tjjjb8AamcjjjjdGTmbcualcltgealcFFFFb0Ecbyd1:H:cjbHjjjjbbh8Masc:Cefasyd;8egHcdtfa8MBdbasaHcefBd;8ea8Mcbaez:tjjjb8AkdnadTmbcbhKabhHina8NaHclfydbg8Fcx2fgeIdba8NaHydbgacx2fgAIdbg8S:tgRa8NaHcwfydbgh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UdKaea85aeId3MUd3aea87aeIdaMUdaaeaUaeId8KMUd8KaeaRaeIdyMUdya8Ra8Jcltfh8FcbhHaChXina8FaHfgeascjdfaHfgAIdbaeIdbMUdbaeclfgKaAclfIdbaKIdbMUdbaecwfgKaAcwfIdbaKIdbMUdbaecxfgeaAcxfIdbaeIdbMUdbaHczfhHaXcufgXmbka8Ra8Kcltfh8FcbhHaChXina8FaHfgeascjdfaHfgAIdbaeIdbMUdbaeclfgKaAclfIdbaKIdbMUdbaecwfgKaAcwfIdbaKIdbMUdbaecxfgeaAcxfIdbaeIdbMUdbaHczfhHaXcufgXmbka8RaDcltfh8FcbhHaChXina8FaHfgeascjdfaHfgAIdbaeIdbMUdbaeclfgKaAclfIdbaKIdbMUdbaecwfgKaAcwfIdbaKIdbMUdbaecxfgeaAcxfIdbaeIdbMUdbaHczfhHaXcufgXmbkaacifgaad6mbkkcbhAdndnamcwGgTmbJbbbbh8ScbhScbh9hcbh9ixekcbhSa3cbyd1:H:cjbHjjjjbbh9iasc:Cefasyd;8egecdtfa9iBdbasaecefBd;8ecua9ialabadaOz:fjjjbgXcltaXcjjjjiGEcbyd1:H:cjbHjjjjbbh9hasc:Cefasyd;8egecdtfa9hBdbasaecefBd;8ea9haXa9ia8Nalz:gjjjbJFFuuh8SaXTmba9hheaXhHinaeIdbgRa8Sa8SaR9EEh8SaeclfheaHcufgHmbkaXhSkdnalTmbaLclfheaLydbhXaYhHalhKcbhAincbaeydbg8FaX9RaHRbbcpeGEaAfhAaHcefhHaeclfhea8FhXaKcufgKmbkaAce4hAkcuadaA9Rcifg6cx2a6c;v:Q;v:Qe0Ecbyd1:H:cjbHjjjjbbh9kasc:Cefasyd;8egecdtfa9kBdbasaecefBd;8ecua6cdta6cFFFFi0Ecbyd1:H:cjbHjjjjbbh0asc:Cefasyd;8egecdtfa0BdbasaecefBd;8ea3cbyd1:H:cjbHjjjjbbh9masc:Cefasyd;8egecdtfa9mBdbasaecefBd;8ealcbyd1:H:cjbHjjjj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a8XNaAId8KMMMhRa8Pa8FaC2gacdtfhHa8RaKaC2g8JcltfheaAIdyh81aChAinaHIdbg8Va8Va81NaecxfIdba8WaecwfIdbNa8XaeIdbNa8YaeclfIdbNMMMg8Va8VM:tNaRMhRaHclfhHaeczfheaAcufgAmbkdndnaDmbJbbbbh8Vxekaga8Fc8S2fgAIdwa8NaKcx2fgeIdwg8XNaAIdzaeIdbg8YNaAIdaMg8Va8VMMa8XNaAIdlaeIdlg81NaAIdCa8XNaAId3Mg8Va8VMMa81NaAIdba8YNaAIdxa81NaAIdKMg8Va8VMMa8YNaAId8KMMMh8Va8Pa8JcdtfhHa8RaacltfheaAIdyh80aChAinaHIdbg8Wa8Wa80NaecxfIdba8XaecwfIdbNa8YaeIdbNa81aeclfIdbNMMMg8Wa8WM:tNa8VMh8VaHclfhHaeczfheaAcufgAmbka8V:lh8VkaBaR:lMhBa86a8VMh86dndndnaYaKfRbbc9:fPddbekaQaXfydbgXaKSmbaOa8Fcdtfydbh8Jindndna5aXcdtgafydbgecuSmbaOaecdtfydba8JSmekdna8EaafydbgecuSmbaOaecdtfydba8JSmeka8FhekagaXc8S2fgAIdwa8Naecx2fgHIdwg8WNaAIdzaHIdbg8XNaAIdaMgRaRMMa8WNaAIdlaHIdlg8YNaAIdCa8WNaAId3MgRaRMMa8YNaAIdba8XNaAIdxa8YNaAIdKMgRaRMMa8XNaAId8KMMMhRa8PaeaC2cdtfhHa8RaXaC2cltfheaAIdyh81aChAinaHIdbg8Va8Va81NaecxfIdba8WaecwfIdbNa8XaeIdbNa8YaeclfIdbNMMMg8Va8VM:tNaRMhRaHclfhHaeczfheaAcufgAmbkaBaR:lMhBaQaafydbgXaK9hmbkkaYa8FfRbbci9hmeaDTmeaQa8FcdtfydbgXa8FSmeindndna5aXcdtgafydbgecuSmbaOaecdtfydba8ASmekdna8EaafydbgecuSmbaOaecdtfydba8ASmekaKhekagaXc8S2fgAIdwa8Naecx2fgHIdwg8WNaAIdzaHIdbg8XNaAIdaM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efBdbaecxfheaHcufgHmbkcbhecbhHinascjdfaefgAydbhXaAaHBdbaXaHfhHaeclfgecj;qb9hmbkcbhea9phHinascjdfaHydbcA4cF8FGgAcFAaAcFA6EcdtfgAaAydbgAcefBdba0aAcdtfaeBdbaHcxfhHa9qaecefge9hmbkadak9RgAci9Uh9sdnalTmbcbhea9mhHinaHaeBdbaHclfhHalaecefge9hmbkkcbh9ta9ncbalz:tjjjbh3aAcO9Uh9ua9sce4h9rcbh8Lcbh8Kdnina9ka0a8Kcdtfydbcx2fg8JIdwgRa879Emea8La9s9pmeJFFuuh8Vdna9ra9q9pmba9ka0a9rcdtfydbcx2fIdwJbb;aZNh8VkdnaRa8V9ETmbaRaU9ETmba8La9u0mdkdna3aOa8JydlgDcdtg9vfg8AydbgAfg9wRbba3aOa8Jydbghcdtg9xfydbgefg9yRbbVmbaYahfRbbh9zdndnaLaecdtfgHclfydbgXaHydbgHSmbaXaH9RhXa8NaAcx2fh8Fa8Naecx2fhaaEaHcitfheindna9maeydbcdtfydbgHaASmba9maeclfydbcdtfydbgKaASmbaHaKSmba8NaKcx2fgKIdba8NaHcx2fgHIdbg8W:tgRaaIdlaHIdlg8X:tg80NaKIdla8X:tg8VaaIdba8W:tgBN:tg8YaRa8FIdla8X:tg86Na8Va8FIdba8W:tg8UN:tg8XNa8VaaIdwaHIdwg81:tg8ZNaKIdwa81:tg8Wa80N:tg80a8Va8FIdwa81:tg83Na8Wa86N:tg8VNa8WaBNaRa8ZN:tg81a8Wa8UNaRa83N:tgRNMMa8Ya8YNa80a80Na81a81NMMa8Xa8XNa8Va8VNaRaRNMMN:rJbbj8:N9FmikaecwfheaXcufgXmbkkdndndndna9zc9:fPdebdkahheina8AydbhAdndna5aecdtgHfydbgecuSmbaOaecdtfydbaASmekdna8EaHfydbgecuSmbaOaecdtfydbaASmekaDheka9maHfaeBdbaQaHfydbgeah9hmbxikkdna8Ea5a5a9xfydbaDSEaQa9xfydbghcdtfydbgecu9hmbaQa9vfydbheka9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9hmbcuhAa5aXfydbgXcuSmba9maXcdtfydbhAkaeaABdbkaeclfhealaHcefgH9hmbkcbhHa8EheindnaeydbgAcuSmbdnaHa9maAcdtgXfydbgA9hmbcuhAa8EaXfydbgXcuSmba9maXcdtfydbhAkaeaABdbkaeclfhealaHcefgH9hmbkka85aUaCEh85cbhHabhecbhAindnaOa9maeydbcdtfydbg8FcdtfydbgXaOa9maeclfydbcdtfydbgacdtfydbgKSmbaXaOa9maecwfydbcdtfydbg8AcdtfydbghSmbaKahSmbabaHcdtfgXa8FBdbaXcwfa8ABdbaXclfaaBdbaHcifhHkaecxfheaAcifgAad6mbkdndnaTmbaHhdxekdnaHak0mbaHhdxekdna8Sa859FmbaHhdxekJFFuuh8ScbhdabhecbhAindna9ha9iaeydbgXcdtfydbcdtfIdbgRa859ETmbaeclf8Pdbh9AabadcdtfgKaXBdbaKclfa9A83dbaRa8Sa8SaR9EEh8SadcifhdkaecxfheaAcifgAaH6mbkkadak0mbxdkkascNefabadalaOz:cjjjbkdndnadak0mbadhaxekdnaTmbadhaxekdna8Sa879FmbadhaxekcehKina8SJbb;aZNgRa87aRa879DEh8WJbbbbhRdnaSTmba9hheaShHinaeIdbg8VaRa8Va8W9FEaRa8VaR9EEhRaeclfheaHcufgHmbkkJFFuuh8ScbhaabhecbhHindna9ha9iaeydbgAcdtfydbcdtfIdbg8Va8W9ETmbaeclf8Pdbh9AabaacdtfgXaABdbaXclfa9A83dba8Va8Sa8Sa8V9EEh8SaacifhakaecxfheaHcifgHad6mbkdnaKaaad9hVceGmbadhaxdkaRaUaUaR9DEhUaaak9nmecbhKaahda8Sa879FmbkkdnamcjjjjdGTmba9ncbalz:tjjjbh8AdnaaTmbabheaahHina8AaeydbgAfce86bba8AaOaAcdtfydbfce86bbaeclfheaHcufgHmbkkascNefabaaalaOz:cjjjbdndnalTmbcbhXindna8AaXfRbbTmbdnaYaXfRbbgecl0mbceaetcQGmekdnaOaXcdtg8FfydbgeaXSmba8NaXcx2fgHa8Na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LinaLhHcuhLdnaKaeaC2cdtfIdbaR9CmbaHcuSmbaHhLagaec8S2fIdyagaHc8S2fIdy9ETmbaehLkaQaecdtfydbgeaX9hmbkka8PaEcdtfhKa8RaEcltfh8FaXheinaKaeaC2cdtfJbbbbJbbjZagaeaLaLcuSEgHc8S2fIdygR:vaRJbbbb9BEa8FaHaC2cltfgHIdwaAIdwNaHIdbaAIdbNaHIdlaAIdlNMMaHIdxMNUdbaQaecdtfydbgeaX9hmbkaEcefgEaC9hmbkkaXcefgXal9hmbxdkkaCmbcbhCkaiavaoarawaCala8Na8Pazasayasc1efaYa8Aaqz:hjjjbkdnamcjjjjlGTmbazmbaaTmbabhecbhLinaYaeydbgAfRbbc3thQaecwfgXydbhHcjjjj94hCdna5aAcdtgEfydbaeclfgKydbgOSmbcjjjj94cba8EaOcdtfydbaASEhCkaeaQaCVaAVBdbaYaOfRbbc3th8Fcjjjj94hCcjjjj94hQdna5aOcdtfydbaHSmbcjjjj94cba8EaHcdtfydbaOSEhQkaKa8FaQVaOVBdbaYaHfRbbc3thOdna5aHcdtfydbaASmbcjjjj94cba8EaEfydbaHSEhCkaXaOaCVaHVBdbaecxfheaLcifgLaa6mbkkdnazTmbaaTmbaaheinabazabydbcdtfydbBdbabclfhbaecufgembkkdnaPTmbaPaZaU:rNUdbkdnasyd;8egHTmbaHcdtasc:Ceffc98fheinaeydbcbyd:m:H:cjbH:bjjjbbaec98fheaHcufgHmbkkascj;sbf8Kjjjjbaak;Yieouabydlhvabydbclfcbaicdtz:tjjjbhoadci9UhrdnadTmbdnalTmbaehwadhDinaoalawydbcdtfydbcdtfgqaqydbcefBdbawclfhwaDcufgDmbxdkkaehwadhDinaoawydbcdtfgqaqydbcefBdbawclfhwaDcufgDmbkkdnaiTmbcbhDaohwinawydbhqawaDBdbawclfhwaqaDfhDaicufgimbkkdnadci6mbinaecwfydbhwaeclfydbhDaeydbhidnalTmbalawcdtfydbhwalaDcdtfydbhDalaicdtfydbhikavaoaicdtfgqydbcitfaDBdbavaqydbcitfawBdlaqaqydbcefBdbavaoaDcdtfgqydbcitfawBdbavaqydbcitfaiBdlaqaqydbcefBdbavaoawcdtfgwydbcitfaiBdbavawydbcitfaDBdlawawydbcefBdbaecxfhearcufgrmbkkabydbcbBdbk:todDue99aicd4aifhrcehwinawgDcethwaDar6mbkcuaDcdtgraDcFFFFi0Ecbyd1:H:cjbHjjjjbbhwaoaoyd9GgqcefBd9GaoaqcdtfawBdbawcFearz:tjjjbhkdnaiTmbalcd4hlaDcufhxcbhminamhDdnavTmbavamcdtfydbhDkcbadaDal2cdtfgDydlgwawcjjjj94SEgwcH4aw7c:F:b:DD2cbaDydbgwawcjjjj94SEgwcH4aw7c;D;O:B8J27cbaDydwgDaDcjjjj94SEgDcH4aD7c:3F;N8N27axGhwamcdthPdndndnavTmbakawcdtfgrydbgDcuSmeadavaPfydbal2cdtfgsIdbhzcehqinaqhrdnadavaDcdtfydbal2cdtfgqIdbaz9CmbaqIdlasIdl9CmbaqIdwasIdw9BmlkarcefhqakawarfaxGgwcdtfgrydbgDcu9hmbxdkkakawcdtfgrydbgDcuSmbadamal2cdtfgsIdbhzcehqinaqhrdnadaDal2cdtfgqIdbaz9CmbaqIdlasIdl9CmbaqIdwasIdw9BmikarcefhqakawarfaxGgwcdtfgrydbgDcu9hmbkkaramBdbamhDkabaPfaDBdbamcefgmai9hmbkkakcbyd:m:H:cjbH:bjjjbbaoaoyd9GcufBd9GdnaeTmbaiTmbcbhDaehwinawaDBdbawclfhwaiaDcefgD9hmbkcbhDaehwindnaDabydbgrSmbawaearcdtfgrydbBdbaraDBdbkabclfhbawclfhwaiaDcefgD9hmbkkk;:odvuv998Jjjjjbca9Rgocbyd1:G:cjbBdKaocb8Pdj:G:cjb83izaocbydN:G:cjbBdwaocb8Pd:m:G:cjb83ibdnadTmbaicd4hrdnabmbdnalTmbcbhwinaealawcdtfydbar2cdtfhDcbhiinaoczfaifgqaDaifIdbgkaqIdbgxaxak9EEUdbaoaifgqakaqIdbgxaxak9DEUdbaiclfgicx9hmbkawcefgwad9hmbxikkarcdthwcbhDincbhiinaoczfaifgqaeaifIdbgkaqIdbgxaxak9EEUdbaoaifgqakaqIdbgxaxak9DEUdbaiclfgicx9hmbkaeawfheaDcefgDad9hmbxdkkdnalTmbcbhwinabawcx2fgiaealawcdtfydbar2cdtfgDIdbUdbaiaDIdlUdlaiaDIdwUdwcbhiinaoczfaifgqaDaifIdbgkaqIdbgxaxak9EEUdbaoaifgqakaqIdbgxaxak9DEUdbaiclfgicx9hmbkawcefgwad9hmbxdkkarcdthlcbhwaehDinabawcx2fgiaeawar2cdtfgqIdbUdbaiaqIdlUdlaiaqIdwUdwcbhiinaoczfaifgqaDaifIdbgkaqIdbgxaxak9EEUdbaoaifgqakaqIdbgxaxak9DEUdbaiclfgicx9hmbkaDalfhDawcefgwad9hmbkkJbbbbaoIdbaoIdzgx:tgkakJbbbb9DEgkaoIdlaoIdCgm:tgPaPak9DEgkaoIdwaoIdKgP:tgsasak9DEhsdnabTmbadTmbJbbbbJbbjZas:vasJbbbb9BEhkinabakabIdbax:tNUdbabclfgoakaoIdbam:tNUdbabcwfgoakaoIdbaP:tNUdbabcxfhbadcufgdmbkkdnavTmbavaPUdwavamUdlavaxUdbkask:WlewudnaeTmbcbhvabhoinaoavBdbaoclfhoaeavcefgv9hmbkkdnaiTmbcbhrinadarcdtfhwcbhDinalawaDcdtgvyd:G:G:cjbcdtfydbcdtfydbhodnalawavfydbcdtfydbgqabaqcdtfgkydbgvSmbinakabavgqcdtfgxydbgvBdbaxhkaqav9hmbkkdnaoabaocdtfgkydbgvSmbinakabavgocdtfgxydbgvBdbaxhkaoav9hmbkkdnaqaoSmbabaqaoaqao0Ecdtfaqaoaqao6EBdbkaDcefgDci9hmbkarcifgrai6mbkkdnaembcbskcbhxindnalaxcdtgvfydbax9hmbaxhodnaxabavfgDydbgvSmbaDhqinaqabavgocdtfgkydbgvBdbakhqaoav9hmbkkaDaoBdbkaxcefgxae9hmbkcbhkabhvcbhoindndnaoalydbgq9hmbdnaoavydbgq9hmbavakBdbakcefhkxdkavabaqcdtfydbBdbxekavabaqcdtfydbBdbkalclfhlavclfhvaeaocefgo9hmbkakk;jiilud99euabcbaecltz:tjjjbhvdnalTmbadhoaihralhwinarcwfIdbhDarclfIdbhqavaoydbcltfgkarIdbakIdbMUdbakaqakIdlMUdlakaDakIdwMUdwakakIdxJbbjZMUdxaoclfhoarcxfhrawcufgwmbkkdnaeTmbavhkaehrinakcxfgoIdbhDaocbBdbakakIdbJbbbbJbbjZaD:vaDJbbbb9BEgDNUdbakclfgoaDaoIdbNUdbakcwfgoaDaoIdbNUdbakczfhkarcufgrmbkkdnalTmbinavadydbcltfgkaicwfIdbakIdw:tgDaDNaiIdbakIdb:tgDaDNaiclfIdbakIdl:tgDaDNMMgDakIdxgqaqaD9DEUdxadclfhdaicxfhialcufglmbkkdnaeTmbavcxfhkinabakIdbUdbakczfhkabclfhbaecufgembkkk:moerudnaoTmbaecd4hzdnavTmbaicd4hHavcdthOcbhAindnaPaAfRbbTmbaAhednaDTmbaDaAcdtfydbhekdnasTmbasaefRbbceGmekdnamaAfRbbclSmbabaeaz2cdtfgiaraAcx2fgCIdbakNaxIdbMUdbaiaCIdlakNaxIdlMUdlaiaCIdwakNaxIdwMUdwkadaeaH2cdtfhXaqheawhiavhCinaXaeydbcdtgQfaiIdbalaQfIdb:vUdbaeclfheaiclfhiaCcufgCmbkkawaOfhwaAcefgAao9hmbxdkkdnasmbcbheaDhiindnaPaefRbbTmbaehCdnaDTmbaiydbhCkamaefRbbclSmbabaCaz2cdtfgCarIdbakNaxIdbMUdbaCarclfIdbakNaxIdlMUdlaCarcwfIdbakNaxIdwMUdwkaiclfhiarcxfhraoaecefge9hmbxdkkdnaDTmbindnaPRbbTmbasaDydbgefRbbceGmbamRbbclSmbabaeaz2cdtfgearIdbakNaxIdbMUdbaearclfIdbakNaxIdlMUdlaearcwfIdbakNaxIdwMUdwkaPcefhPaDclfhDamcefhmarcxfhraocufgombxdkkazcdthicbheindnaPaefRbbTmbasaefRbbceGmbamaefRbbclSmbabarIdbakNaxIdbMUdbabclfarclfIdbakNaxIdlMUdbabcwfarcwfIdbakNaxIdwMUdbkarcxfhrabaifhbaoaecefge9hmbkkk8MbabaeadaialavcbcbcbcbcbaoarawaDz:bjjjbk8MbabaeadaialavaoarawaDaqakaxamaPz:bjjjbkRbababaeadaialavaoarawaDaqakaxcjjjjdVamz:bjjjbk:g8Koque99due99duq998Jjjjjbc;Wb9Rgq8Kjjjjbcbhkaqcxfcbc;Kbz:tjjjb8Aaqcualcx2alc;v:Q;v:Qe0Ecbyd1:H:cjbHjjjjbbgxBdxaqceBd2axaialavcbcbz:ejjjb8AaqcualcdtalcFFFFi0Egmcbyd1:H:cjbHjjjjbbgiBdzaqcdBd2dndnJFF959eJbbjZawJbbjZawJbbjZ9DE:vawJ9VO:d869DEgw:lJbbb9p9DTmbaw:OhPxekcjjjj94hPkadci9Uhsarco9UhzdndnaombaPcd9imekdnalTmbaPcuf:YhwdnaoTmbcbhvaihHaxhOindndnaoavfRbbceGTmbavcjjjjlVhAxekdndnaOclfIdbawNJbbbZMgC:lJbbb9p9DTmbaC:OhAxekcjjjj94hAkaAcqthAdndnaOcwfIdbawNJbbbZMgC:lJbbb9p9DTmbaC:OhXxekcjjjj94hXkaAaXVhAdndnaOIdbawNJbbbZMgC:lJbbb9p9DTmbaC:OhXxekcjjjj94hXkaAaXcCtVhAkaHaABdbaHclfhHaOcxfhOalavcefgv9hmbxdkkaxhvaihOalhHindndnavIdbawNJbbbZMgC:lJbbb9p9DTmbaC:OhAxekcjjjj94hAkaAcCthAdndnavclfIdbawNJbbbZMgC:lJbbb9p9DTmbaC:OhXxekcjjjj94hXkaXcqtaAVhAdndnavcwfIdbawNJbbbZMgC:lJbbb9p9DTmbaC:OhXxekcjjjj94hXkaOaAaXVBdbavcxfhvaOclfhOaHcufgHmbkkadTmbcbhkaehvcbhOinakaiavclfydbcdtfydbgHaiavcwfydbcdtfydbgA9haiavydbcdtfydbgXaH9haXaA9hGGfhkavcxfhvaOcifgOad6mbkkarci9UhQdndnaz:Z:rJbbbZMgw:lJbbb9p9DTmbaw:Ohvxekcjjjj94hvkaQ:ZhLcbhKc:bwhzdninakaQ9pmeazaP9Rcd9imeavazcufgOavaO9iEaPcefavaP9kEhYdnalTmbaYcuf:YhwdnaoTmbcbhOaihHaxhvindndnaoaOfRbbceGTmbaOcjjjjlVhAxekdndnavclfIdbawNJbbbZMgC:lJbbb9p9DTmbaC:OhAxekcjjjj94hAkaAcqthAdndnavcwfIdbawNJbbbZMgC:lJbbb9p9DTmbaC:OhXxekcjjjj94hXkaAaXVhAdndnavIdbawNJbbbZMgC:lJbbb9p9DTmbaC:OhXxekcjjjj94hXkaAaXcCtVhAkaHaABdbaHclfhHavcxfhvalaOcefgO9hmbxdkkaxhvaihOalhHindndnavIdbawNJbbbZMgC:lJbbb9p9DTmbaC:OhAxekcjjjj94hAkaAcCthAdndnavclfIdbawNJbbbZMgC:lJbbb9p9DTmbaC:OhXxekcjjjj94hXkaXcqtaAVhAdndnavcwfIdbawNJbbbZMgC:lJbbb9p9DTmbaC:OhXxekcjjjj94hXkaOaAaXVBdbavcxfhvaOclfhOaHcufgHmbkkcbhOdnadTmbaehvcbhHinaOaiavclfydbcdtfydbgAaiavcwfydbcdtfydbgX9haiavydbcdtfydbgraA9haraX9hGGfhOavcxfhvaHcifgHad6mbkkdnas:ZgCaL:taY:Ygwaz:Y:tg8ANak:ZgEaO:Zg3:tNaEaL:tawaP:Y:tg5Na3aC:tNMg8EJbbbb9BmbaCaE:ta5a8Aa3aL:tNNNa8E:vawMhwkdndnaOaQ0mbaOhkaYhPxekaOhsaYhzkdndnaKcl0mbdnawJbbbZMgw:lJbbb9p9DTmbaw:Ohvxdkcjjjj94hvxekaPazfcd9ThvkaKcefgKcs9hmbkkdndndnakmbJbbjZhwcbhOcdhvaDmexdkalcd4alfhHcehOinaOgvcethOavaH6mbkcbhOaqcuavcdt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:rhEJbbnnJbbjZazaocdtfydbgvazarcdtfydbgASavazaYcdtfydbgrSGgHEh8Fdna8EJbbbb9ETmbaLaE:vhLaCaE:vhCawaE:vhwkaOavc8S2fgvavIdbawa8FaE:rNgEawNNg8FMUdbavaCaEaCNgaNghavIdlMUdlavaLaEaLNg8ENggavIdwMUdwavawaaNgaavIdxMUdxava8EawNg8JavIdzMUdzavaCa8ENg8EavIdCMUdCavawaEaLa5Nawa3Na8AaCNMM:mg8ANg3NgwavIdKMUdKavaCa3NgCavId3MUd3avaLa3NgLavIdaMUdaava3a8ANg3avId8KMUd8KavaEavIdyMUdydnaHmbaOaAc8S2fgva8FavIdbMUdbavahavIdlMUdlavagavIdwMUdwavaaavIdxMUdxava8JavIdzMUdzava8EavIdCMUdCavawavIdKMUdKavaCavId3MUd3avaLavIdaMUdaava3avId8KMUd8KavaEavIdyMUdyaOarc8S2fgva8FavIdbMUdbavahavIdlMUdlavagavIdwMUdwavaaavIdxMUdxava8JavIdzMUdzava8EavIdCMUdCavawavIdKMUdKavaCavId3MUd3avaLavIdaMUdaava3avId8KMUd8KavaEavIdyMUdykaicxfhiaXcifgXad6mbkkcbhAaqcuaPcdtgvaPcFFFFi0Egicbyd1:H:cjbHjjjjbbgHBdaaqcoBd2aqaicbyd1:H:cjbHjjjjbbgiBd8KaqcrBd2aHcFeavz:tjjjbhYdnalTmbazhHinJbbbbJbbjZaOaHydbgXc8S2fgvIdygw:vawJbbbb9BEavIdwaxcwfIdbgwNavIdzaxIdbgCNavIdaMgLaLMMawNavIdlaxclfIdbgLNavIdCawNavId3MgwawMMaLNavIdbaCNavIdxaLNavIdKMgwawMMaCNavId8KMMM:lNhwdndnaYaXcdtgvfgXydbcuSmbaiavfIdbaw9ETmekaXaABdbaiavfawUdbkaHclfhHaxcxfhxalaAcefgA9hmbkkdndnaPmbJbbbbhwxekJbbbbhwinaiIdbgCawawaC9DEhwaiclfhiaPcufgPmbkaw:rhwkakcd4akfhOcehiinaigvcethiavaO6mbkcbhOaqcuavcdtgiavcFFFFi0Ecbyd1:H:cjbHjjjjbbgHBdyaHcFeaiz:tjjjbhXdnadTmbavcufhrcbhPcbhxindnazaeaxcdtfgvydbcdtfydbgiazavclfydbcdtfydbgOSmbaiazavcwfydbcdtfydbgvSmbaOavSmbaYavcdtfydbhAdndnaYaOcdtfydbgvaYaicdtfydbgi9pmbavaA9pmbaAhlaihoavhAxekdnaAai9pmbaAav9pmbaihlavhoxekavhlaAhoaihAkabaPcx2fgvaABdbavcwfaoBdbavclfalBdbdnaXaoc:3F;N8N2alc:F:b:DD27aAc;D;O:B8J27arGgOcdtfgvydbgicuSmbcehHinaHhvdnabaicx2fgiydbaA9hmbaiydlal9hmbaiydwaoSmikavcefhHaXaOavfarGgOcdtfgvydbgicu9hmbkkavaPBdbaPcefhPkaxcifgxad6mbkaPci2hOkcwhvaDTmekaDawUdbkavcdthvaqcxfc98fhiinaiavfydbcbyd:m:H:cjbH:bjjjbbavc98fgvmbkaqc;Wbf8KjjjjbaOk:3ldrue9:8Jjjjjbc;Wb9Rgr8Kjjjjbcbhwarcxfcbc;Kbz:tjjjb8AdnabaeSmbabaeadcdtzMjjjb8AkarcualcdtalcFFFFi0EgDcbyd1:H:cjbHjjjjbbgqBdxarceBd2aqcbaialavcbarcxfz:djjjbcualcx2alc;v:Q;v:Qe0Ecbyd1:H:cjbHjjjjbbhkarcxfaryd2gxcdtfakBdbaraxcefgmBd2akaialavcbcbz:ejjjb8AarcxfamcdtfaDcbyd1:H:cjbHjjjjbbgiBdbaraxcdfgvBd2arcxfavcdtfcuaialaeadaqz:fjjjbgecltaecjjjjiGEcbyd1:H:cjbHjjjjbbgqBdbaqaeaiakalz:gjjjbaxcifhkdnadTmbaoaoNhocbhwabhlcbheindnaqaialydbgvcdtfydbcdtfIdbao9ETmbalclf8PdbhPabawcdtfgDavBdbaDclfaP83dbawcifhwkalcxfhlaecifgead6mbkkdnakTmbaxcdtarcxffcwfhlinalydbcbyd:m:H:cjbH:bjjjbb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ka3aQaiEhQaLcefgLcs9hmekkdndnaXmbcihicbhDxekcbhiawakcbyd1:H:cjbHjjjjbbg5BdKawclBd2aPcuf:YhKdndnadTmbaqhiaxheadhmindndnaiIdbaKNJbbbZMgO:lJbbb9p9DTmbaO:OhYxekcjjjj94hYkaYcCthYdndnaiclfIdbaKNJbbbZMgO:lJbbb9p9DTmbaO:Oh8Axekcjjjj94h8Aka8AcqtaYVhYdndnaicwfIdbaKNJbbbZMgO:lJbbb9p9DTmbaO:Oh8Axekcjjjj94h8AkaeaYa8AVBdbaicxfhiaeclfheamcufgmmbkazcFeasz:tjjjbhEcbhDcbh3indndndnaEaxa3cdtgCfydbgYcm4aY7c:v;t;h;Ev2gics4ai7aAGgmcdtfg8AydbgecuSmbcehiinaxaecdtgefydbaYSmdamaifheaicefhiaEaeaAGgmcdtfg8Aydbgecu9hmbkka8Aa3BdbaDhiaDcefhDxeka5aefydbhika5aCfaiBdba3cefg3ad9hmbkcuaDc32giaDc;j:KM;jb0EhexekazcFeasz:tjjjb8AcbhDcbhekawaecbyd1:H:cjbHjjjjbbgeBd3awcvBd2aecbaiz:tjjjbh8Aavcd4hxdnadTmbdnalTmbaxcdthEa5hYaqhealhmadhAina8AaYydbc32fgiaeIdbaiIdbMUdbaiaeclfIdbaiIdlMUdlaiaecwfIdbaiIdwMUdwaiamIdbaiIdxMUdxaiamclfIdbaiIdzMUdzaiamcwfIdbaiIdCMUdCaiaiIdKJbbjZMUdKaYclfhYaecxfheamaEfhmaAcufgAmbxdkka5hmaqheadhYina8Aamydbc32fgiaeIdbaiIdbMUdbaiaeclfIdbaiIdlMUdlaiaecwfIdbaiIdwMUdwaiaiIdxJbbbbMUdxaiaiIdzJbbbbMUdzaiaiIdCJbbbbMUdCaiaiIdKJbbjZMUdKamclfhmaecxfheaYcufgYmbkkdnaDTmba8AhiaDheinaiaiIdbJbbbbJbbjZaicKfIdbgO:vaOJbbbb9BEgONUdbaiclfgmaOamIdbNUdbaicwfgmaOamIdbNUdbaicxfgmaOamIdbNUdbaiczfgmaOamIdbNUdbaicCfgmaOamIdbNUdbaic3fhiaecufgembkkcbhYawcuaDcdtgCaDcFFFFi0Egicbyd1:H:cjbHjjjjbbgeBdaawcoBd2awaicbyd1:H:cjbHjjjjbbgEBd8KaecFeaCz:tjjjbh3dnadTmbaoJbbjZJbbjZaK:vaPceSENgOaONhKaxcdthxalheinaKaec;8:G:cjbalEgmIdwa8Aa5ydbgAc32fgiIdC:tgOaONamIdbaiIdx:tgOaONamIdlaiIdz:tgOaONMMNaqcwfIdbaiIdw:tgOaONaqIdbaiIdb:tgOaONaqclfIdbaiIdl:tgOaONMMMhOdndna3aAcdtgifgmydbcuSmbaEaifIdbaO9ETmekamaYBdbaEaifaOUdbka5clfh5aqcxfhqaeaxfheadaYcefgY9hmbkkaba3aCzMjjjb8Acrhikaicdthiawcxfc98fheinaeaifydbcbyd:m:H:cjbH:bjjjbbaic98fgimbkkawc;Wbf8KjjjjbaDk:Pdidui99ducbhi8Jjjjjbca9Rglcbyd1:G:cjbBdKalcb8Pdj:G:cjb83izalcbydN:G:cjbBdwalcb8Pd:m:G:cjb83ibdndnaembJbbjFhvJbbjFhoJbbjFhrxekadcd4cdthwincbhdinalczfadfgDabadfIdbgvaDIdbgoaoav9EEUdbaladfgDavaDIdbgoaoav9DEUdbadclfgdcx9hmbkabawfhbaicefgiae9hmbkalIdwalIdK:thralIdlalIdC:thoalIdbalIdz:thvkJbbbbavavJbbbb9DEgvaoaoav9DEgvararav9DEk9DeeuabcFeaicdtz:tjjjbhlcbhbdnadTmbindnalaeydbcdtfgiydbcu9hmbaiabBdbabcefhbkaeclfheadcufgdmbkkabk;Bidqui998Jjjjjbc;Wb9Rgl8Kjjjjbalcxfcbc;Kbz:tjjjb8Aadcd4adfhvcehoinaogrcethoarav6mbkalcuarcdtgoarcFFFFi0Ecbyd1:H:cjbHjjjjbbgvBdxavcFeaoz:tjjjbhwdnadTmbaicd4hDarcufhqcbhkindndnawcbaeakaD2cdtfgrydlgiaicjjjj94SEgocH4ao7c:F:b:DD2cbarydbgxaxcjjjj94SEgocH4ao7c;D;O:B8J27cbarydwgmamcjjjj94SEgrcH4ar7c:3F;N8N27aqGgvcdtfgrydbgocuSmbam::hPai::hsax::hzcehiinaihrdnaeaoaD2cdtfgiIdbaz9CmbaiIdlas9CmbaiIdwaP9BmikarcefhiawavarfaqGgvcdtfgrydbgocu9hmbkkarakBdbakhokabakcdtfaoBdbakcefgkad9hmbkkalydxcbyd:m:H:cjbH:bjjjbbalc;Wbf8Kjjjjbk9teiucbcbyd:q:H:cjbgeabcifc98GfgbBd:q:H:cjbdndnabZbcztgd9nmbcuhiabad9RcFFifcz4nbcuSmekaehikaik;LeeeudndnaeabVciGTmbabhixekdndnadcz9pmbabhixekabhiinaiaeydbBdbaiclfaeclfydbBdbaicwfaecwfydbBdbaicxfaecxfydbBdbaeczfheaiczfhiadc9Wfgdcs0mbkkadcl6mbinaiaeydbBdbaeclfheaiclfhiadc98fgdci0mbkkdnadTmbinaiaeRbb86bbaicefhiaecefheadcufgdmbkkabk;aeedudndnabciGTmbabhixekaecFeGc:b:c:ew2hldndnadcz9pmbabhixekabhiinaialBdbaicxfalBdbaicwfalBdbaiclfalBdbaiczfhiadc9Wfgdcs0mbkkadcl6mbinaialBdbaiclfhiadc98fgdci0mbkkdnadTmbinaiae86bbaicefhiadcufgdmbkkabk9teiucbcbyd:q:H:cjbgeabcrfc94GfgbBd:q:H:cjbdndnabZbcztgd9nmbcuhiabad9RcFFifcz4nbcuSmekaehikaikTeeucbabcbyd:q:H:cjbge9Rcifc98GaefgbBd:q:H:cjbdnabZbcztge9nmbabae9RcFFifcz4nb8Akkk:Kedbcj:Gdk1eFFuuFFuuFFuuFFuFFFuFFFuFbbbbbbbbebbbdbbbbbbbebbbebbbdbbbbbbbbbbbeeeeebebbebbebebbbeebbbbbbbbbbbbeeeeeebebbeeebeebbbbebebbbbbbbbbbbbbbbbbbc1:Hdkxebbbdbbb:G:qbb",t=new Uint8Array([32,0,65,2,1,106,34,33,3,128,11,4,13,64,6,253,10,7,15,116,127,5,8,12,40,16,19,54,20,9,27,255,113,17,42,67,24,23,146,148,18,14,22,45,70,69,56,114,101,21,25,63,75,136,108,28,118,29,73,115]);if(typeof WebAssembly!="object")return{supported:!1};var n,i=WebAssembly.instantiate(o(e),{}).then(function(Z){n=Z.instance,n.exports.__wasm_call_ctors()});function o(Z){for(var R=new Uint8Array(Z.length),C=0;C96?E-97:E>64?E-39:E+4}for(var A=0,C=0;C=3),a(n.exports.meshopt_generatePositionRemap,Z,Z.length/R,R)},simplify:function(Z,R,C,E,A,L){r(Z instanceof Uint32Array||Z instanceof Int32Array||Z instanceof Uint16Array||Z instanceof Int16Array),r(Z.length%3==0),r(R instanceof Float32Array),r(R.length%C==0),r(C>=3),r(E>=0&&E<=Z.length),r(E%3==0),r(A>=0);for(var F=0,I=0;I<(L?L.length:0);++I)r(L[I]in S),F|=S[L[I]];var N=Z.BYTES_PER_ELEMENT==4?Z:new Uint32Array(Z),g=u(n.exports.meshopt_simplify,N,Z.length,R,R.length/C,C*4,E,A,F);return g[0]=Z instanceof Uint32Array?g[0]:new Z.constructor(g[0]),g},simplifyWithAttributes:function(Z,R,C,E,A,L,F,I,N,g){r(Z instanceof Uint32Array||Z instanceof Int32Array||Z instanceof Uint16Array||Z instanceof Int16Array),r(Z.length%3==0),r(R instanceof Float32Array),r(R.length%C==0),r(C>=3),r(E instanceof Float32Array),r(E.length==A*(R.length/C)),r(A>=0),r(F==null||F instanceof Uint8Array),r(F==null||F.length==R.length/C),r(I>=0&&I<=Z.length),r(I%3==0),r(N>=0),r(Array.isArray(L)),r(A>=L.length),r(L.length<=32);for(var V=0;V=0);for(var G=0,V=0;V<(g?g.length:0);++V)r(g[V]in S),G|=S[g[V]];var v=Z.BYTES_PER_ELEMENT==4?Z:new Uint32Array(Z),X=m(n.exports.meshopt_simplifyWithAttributes,v,Z.length,R,R.length/C,C*4,E,A*4,new Float32Array(L),F,I,N,G);return X[0]=Z instanceof Uint32Array?X[0]:new Z.constructor(X[0]),X},simplifyWithUpdate:function(Z,R,C,E,A,L,F,I,N,g){r(Z instanceof Uint32Array||Z instanceof Int32Array||Z instanceof Uint16Array||Z instanceof Int16Array),r(Z.length%3==0),r(R instanceof Float32Array),r(R.length%C==0),r(C>=3),r(E instanceof Float32Array),r(E.length==A*(R.length/C)),r(A>=0),r(F==null||F instanceof Uint8Array),r(F==null||F.length==R.length/C),r(I>=0&&I<=Z.length),r(I%3==0),r(N>=0),r(Array.isArray(L)),r(A>=L.length),r(L.length<=32);for(var V=0;V=0);for(var G=0,V=0;V<(g?g.length:0);++V)r(g[V]in S),G|=S[g[V]];var v=Z.BYTES_PER_ELEMENT==4?Z:new Uint32Array(Z),X=p(n.exports.meshopt_simplifyWithUpdate,v,Z.length,R,R.length/C,C*4,E,A*4,new Float32Array(L),F,I,N,G);if(Z!==v)for(var V=0;V=3),b(n.exports.meshopt_simplifyScale,Z,Z.length/R,R*4)},simplifyPoints:function(Z,R,C,E,A,L){return r(Z instanceof Float32Array),r(Z.length%R==0),r(R>=3),r(C>=0&&C<=Z.length/R),E?(r(E instanceof Float32Array),r(E.length%A==0),r(A>=3),r(Z.length/R==E.length/A),f(n.exports.meshopt_simplifyPoints,Z,Z.length/R,R*4,E,A*4,L||0,C)):f(n.exports.meshopt_simplifyPoints,Z,Z.length/R,R*4,void 0,0,0,C)},simplifySloppy:function(Z,R,C,E,A,L){r(Z instanceof Uint32Array||Z instanceof Int32Array||Z instanceof Uint16Array||Z instanceof Int16Array),r(Z.length%3==0),r(R instanceof Float32Array),r(R.length%C==0),r(C>=3),r(E==null||E instanceof Uint8Array),r(E==null||E.length==R.length/C),r(A>=0&&A<=Z.length),r(A%3==0),r(L>=0);var F=Z.BYTES_PER_ELEMENT==4?Z:new Uint32Array(Z),I=y(n.exports.meshopt_simplifySloppy,F,Z.length,R,R.length/C,C*4,E,A,L);return I[0]=Z instanceof Uint32Array?I[0]:new Z.constructor(I[0]),I},simplifyPrune:function(Z,R,C,E){r(Z instanceof Uint32Array||Z instanceof Int32Array||Z instanceof Uint16Array||Z instanceof Int16Array),r(Z.length%3==0),r(R instanceof Float32Array),r(R.length%C==0),r(C>=3),r(E>=0);var A=Z.BYTES_PER_ELEMENT==4?Z:new Uint32Array(Z),L=_(n.exports.meshopt_simplifyPrune,A,Z.length,R,R.length/C,C*4,E);return L=Z instanceof Uint32Array?L:new Z.constructor(L),L}}})();var pQn=x(T(),1),hQn=(function(){var e="b9H79Tebbbe:neP9Geueu9Geub9Gbb9Giuuueu9Gmuuuuuuuuuuu9999eu9Gouuuuuueu9Gruuuuuuub9Gxuuuuuuuuuuuueu9Gxuuuuuuuuuuu99eu9GPuuuuuuuuuuuuu99b9Gouuuuuub9Gwuuuuuuuub9Gvuuuuub9GluuuubiQXdilvorwDqokoqxmbiibeilve9Weiiviebeoweuecj:Gdkr;Zeqo9TW9T9VV95dbH9F9F939H79T9F9J9H229F9Jt9VV7bb8A9TW79O9V9Wt9F9I919P29K9nW79O2Wt79c9V919U9KbeY9TW79O9V9Wt9F9I919P29K9nW79O2Wt7S2W94bd39TW79O9V9Wt9F9I919P29K9nW79O2Wt79t9W9Ht9P9H2bo39TW79O9V9Wt9F9J9V9T9W91tWJ2917tWV9c9V919U9K7bw39TW79O9V9Wt9F9J9V9T9W91tW9nW79O2Wt9c9V919U9K7bkE9TW79O9V9Wt9F9J9V9T9W91tW9t9W9OWVW9c9V919U9K7bxL9TW79O9V9Wt9F9V9Wt9P9T9P96W9nW79O2WtbPl79IV9RbsDwebcekdOAq;W:leXdbkIbabaec9:fgefcufae9Ugeabci9Uadfcufad9Ugbaeab0Ek:88JDPue99eux99due99euo99iu8Jjjjjbc:WD9Rgm8KjjjjbdndnalmbcbhPxekamc:Cwfcbc;Kbz:rjjjb8AcuaocdtgsaocFFFFi0Ehzcbyd;0:G:cjbhHdndnalcb9imbaoal9nmbamazaHHjjjjbbgHBd:CwamceBd;8wamazcbyd;0:G:cjbHjjjjbbgOBd:GwamcdBd;8wamcualcdtalcFFFFi0Ecbyd;0:G:cjbHjjjjbbgABd:KwamciBd;8waihzalhsinaHazydbcdtfcbBdbazclfhzascufgsmbkaihzalhsinaHazydbcdtfgCaCydbcefBdbazclfhzascufgsmbkaihzalhCcbhXindnaHazydbcdtgQfgsydbcb9imbaOaQfaXBdbasasydbgQcjjjj94VBdbaQaXfhXkazclfhzaCcufgCmbkalci9UhLdnalci6mbcbhzaihsinascwfydbhCasclfydbhXaOasydbcdtfgQaQydbgQcefBdbaAaQcdtfazBdbaOaXcdtfgXaXydbgXcefBdbaAaXcdtfazBdbaOaCcdtfgCaCydbgCcefBdbaAaCcdtfazBdbascxfhsaLazcefgz9hmbkkaihzalhsindnaHazydbcdtgCfgXydbgQcu9kmbaXaQcFFFFrGgQBdbaOaCfgCaCydbaQ9RBdbkazclfhzascufgsmbxdkkamazaHHjjjjbbgHBd:CwamceBd;8wamazcbyd;0:G:cjbHjjjjbbgOBd:GwamcdBd;8wamcualcdtalcFFFFi0Ecbyd;0:G:cjbHjjjjbbgABd:KwamciBd;8waHcbasz:rjjjbhXaihzalhsinaXazydbcdtfgCaCydbcefBdbazclfhzascufgsmbkalci9UhLdnaoTmbcbhzaOhsaXhCaohQinasazBdbasclfhsaCydbazfhzaCclfhCaQcufgQmbkkdnalci6mbcbhzaihsinascwfydbhCasclfydbhQaOasydbcdtfgKaKydbgKcefBdbaAaKcdtfazBdbaOaQcdtfgQaQydbgQcefBdbaAaQcdtfazBdbaOaCcdtfgCaCydbgCcefBdbaAaCcdtfazBdbascxfhsaLazcefgz9hmbkkaoTmbcbhzaohsinaOazfgCaCydbaXazfydb9RBdbazclfhzascufgsmbkkamaLcbyd;0:G:cjbHjjjjbbgzBd:OwamclBd;8wazcbaLz:rjjjbhYamcuaLcK2alcjjjjd0Ecbyd;0:G:cjbHjjjjbbg8ABd:SwamcvBd;8wJbbbbhEdnalci6g3mbarcd4hKaihsa8AhzaLhrJbbbbh5inavasclfydbaK2cdtfgCIdlh8EavasydbaK2cdtfgXIdlhEavascwfydbaK2cdtfgQIdlh8FaCIdwhaaXIdwhhaQIdwhgazaCIdbg8JaXIdbg8KMaQIdbg8LMJbbnn:vUdbazclfaXIdlaCIdlMaQIdlMJbbnn:vUdbaQIdwh8MaCIdwh8NaXIdwhyazcxfa8EaE:tg8Eagah:tggNaaah:tgaa8FaE:tghN:tgEJbbbbJbbjZa8Ja8K:tg8FahNa8Ea8La8K:tg8KN:tghahNaEaENaaa8KNa8FagN:tgEaENMMg8K:rg8E:va8KJbbbb9BEg8KNUdbazczfaEa8KNUdbazcCfaha8KNUdbazcwfa8Maya8NMMJbbnn:vUdba5a8EMh5ascxfhsazcKfhzarcufgrmbka5aL:Z:vJbbbZNhEkamcuaLcdtalcFFFF970Ecbyd;0:G:cjbHjjjjbbgCBd:WwamcoBd;8waq:Zhhdna3mbcbhzaChsinasazBdbasclfhsaLazcefgz9hmbkkaEahNhhamcuaLcltalcFFFFd0Ecbyd;0:G:cjbHjjjjbbg8PBd:0wamcrBd;8wcba8Pa8AaCaLcbz:djjjb8AJFFuuh8MJFFuuh8NJFFuuhydnalci6mbJFFuuhya8AhzaLhsJFFuuh8NJFFuuh8MinazcwfIdbgEa8Ma8MaE9EEh8MazclfIdbgEa8Na8NaE9EEh8NazIdbgEayayaE9EEhyazcKfhzascufgsmbkkah:rhEamaocetgzcuaocu9kEcbyd;0:G:cjbHjjjjbbgCBd:4wdndnaoal9nmbaihzalhsinaCazydbcetfcFFi87ebazclfhzascufgsmbxdkkaCcFeazz:rjjjb8AkaEJbbbZNh8JcuhIdnalci6mbcbhsJFFuuhEa8AhzcuhIinazcwfIdba8M:tghahNazIdbay:tghahNazclfIdba8N:tghahNMM:rghaEaIcuSahaE9DVgXEhEasaIaXEhIazcKfhzaLascefgs9hmbkkamczfcbcjwz:rjjjb8Aam9cb83iwam9cb83ibaxa8JNh8RJbbjZak:th8Lcbh8SJbbbbhRJbbbbh8UJbbbbh8VJbbbbh8WJbbbbh8XJbbbbh8Ycbh8ZcbhPinJbbbbhEdna8STmbJbbjZa8S:Z:vhEkJbbbbhhdna8Ya8YNa8Wa8WNa8Xa8XNMMg8KJbbbb9BmbJbbjZa8K:r:vhhka8VaENh8Ka8UaENh5aRaENh8EaIhLdndndndndna8SaPVTmbamydwg80Tmea8YahNh8Fa8XahNhaa8WahNhgaeamydbcdtfh81cbh3JFFuuhEcvhQcuhLindnaHa81a3cdtfydbcdtgzfydbgvTmbaAaOazfydbcdtfhsindndnaCaiasydbgKcx2fgzclfydbgrcetf8Vebcs4aCazydbgXcetf8Vebcs4faCazcwfydbglcetf8Vebcs4fgombcbhzxekcehzaHaXcdtfydbgXceSmbcehzaHarcdtfydbgrceSmbcehzaHalcdtfydbglceSmbdnarcdSaXcdSfalcdSfcd6mbaocefhzxekaocdfhzkdnazaQ9kmba8AaKcK2fgXIdwa8K:tghahNaXIdba8E:tghahNaXIdla5:tghahNMM:ra8J:va8LNJbbjZMJ9VO:d86JbbjZaXIdCa8FNaXIdxagNaaaXIdzNMMakN:tghahJ9VO:d869DENghaEazaQ6ahaE9DVgXEhEaKaLaXEhLazaQaXEhQkasclfhsavcufgvmbkka3cefg3a809hmbkkaLcu9hmekama8KUd:ODama5Ud:KDama8EUd:GDamcuBd:qDamcFFF;7rBdjDa8Pcba8AaYamc:GDfamc:qDfamcjDfz:ejjjbamyd:qDhLdndnaxJbbbb9ETmba8SaD6mbaLcuSmeceh3amIdjDa8R9EmixdkaLcu9hmekdna8STmbabaPcltfgHam8Piw83dwaHam8Pib83dbaPcefhPkc3hHinamc:CwfaHfydbcbyd;4:G:cjbH:bjjjbbaHc98fgHc989hmbxvkkcbh3a8Saq9pmbamydwaCaiaLcx2fgzydbcetf8Vebcs4aCazcwfydbcetf8Vebcs4faCazclfydbcetf8Vebcs4ffaw9nmekcbhzcbhsdna8ZTmbcbhsamczfhXinamczfascdtfaXydbgQBdbaXclfhXasaYaQfRbbTfhsa8Zcufg8ZmbkkamydwhlamydbhXam9cu83i:GDam9cu83i:ODam9cu83i:qDam9cu83i:yDinamcjDfazfcFFF;7rBdbazclfgzcz9hmbkasc;8easclfc:bd6Eg8Zcdth80dnalTmbaeaXcdtfhocbhrindnaHaoarcdtfydbcdtgzfydbgvTmbaAaOazfydbcdtfhscuhQcuhzinaHaiasydbgKcx2fgXclfydbcdtfydbaHaXydbcdtfydbfaHaXcwfydbcdtfydbfgXazaXaz6gXEhzaKaQaXEhQasclfhsavcufgvmbkaQcuSmba8AaQcK2fgsIdwa8M:tgEaENasIdbay:tgEaENasIdla8N:tgEaENMM:rhEcbhsindndnazamc:qDfasfgvydbgX6mbazaX9hmeaEamcjDfasfIdb9FTmekavazBdbamc:GDfasfaQBdbamcjDfasfaEUdbxdkasclfgscz9hmbkkarcefgral9hmbkkamczfa80fhQcbhzcbhsindnamc:GDfazfydbgXcuSmbaQascdtfaXBdbascefhskazclfgzcz9hmbkasa8Zfg8ZTmbJFFuuhhcuhKamczfhza8ZhvcuhQina8AazydbgXcK2fgsIdwa8M:tgEaENasIdbay:tgEaENasIdla8N:tgEaENMM:rhEdndnaHaiaXcx2fgsclfydbcdtfydbaHasydbcdtfydbfaHascwfydbcdtfydbfgsaQ6mbasaQ9hmeaEah9DTmekaEhhashQaXhKkazclfhzavcufgvmbkaKcuSmbaKhLkdnamaiaLcx2fgrydbarclfydbarcwfydbaCabaeadaPawaqa3z:fjjjbTmbaPcefhPJbbbbhRJbbbbh8UJbbbbh8VJbbbbh8WJbbbbh8XJbbbbh8YkcbhXinaAaOaraXcdtfydbcdtgsfydbcdtfgKhzaHasfgvydbgQhsdnaQTmbdninazydbaLSmeazclfhzascufgsTmdxbkkazaKaQcdtfc98fydbBdbavavydbcufBdbkaXcefgXci9hmbka8AaLcK2fgzIdbhEazIdlhhazIdwh8KazIdxh5azIdzh8EazIdCh8FaYaLfce86bba8Ya8FMh8Ya8Xa8EMh8Xa8Wa5Mh8Wa8Va8KMh8Va8UahMh8UaRaEMhRamydxh8Sxbkkamc:WDf8KjjjjbaPkjoivuv99lu8Jjjjjbca9Rgo8Kjjjjbdndnalcw0mbaiydbhraeabcitfgwalcdtciVBdlawarBdbdnalcd6mbaiclfhralcufhDawcxfhwinarydbhqawcuBdbawc98faqBdbawcwfhwarclfhraDcufgDmbkkalabfhwxekcbhqaocbBdKao9cb83izaocbBdwao9cb83ibJbbjZhkJbbjZhxinadaiaqcdtfydbcK2fhDcbhwinaoczfawfgraDawfIdbgmarIdbgP:tgsaxNaPMgPUdbaoawfgrasamaP:tNarIdbMUdbawclfgwcx9hmbkJbbjZakJbbjZMgk:vhxaqcefgqal9hmbkcbhradcbcecdaoIdlgmaoIdwgP9GEgwaoIdbgsaP9GEawasam9GEgzcdtgwfhHaoczfawfIdbhmaihwalhDinaiarcdtfgqydbhOaqawydbgABdbawaOBdbawclfhwaraHaAcK2fIdbam9DfhraDcufgDmbkdndnarcv6mbavc8X9kmbaralc98f6mekaiydbhraeabcitfgwalcdtciVBdlawarBdbaiclfhralcufhDawcxfhwinarydbhqawcuBdbawc98faqBdbawcwfhwarclfhraDcufgDmbkalabfhwxekaeabcitfgwamUdbawawydlc98GazVBdlabcefaeadaiaravcefgqz:djjjbhDawawydlciGaDabcu7fcdtVBdlaDaeadaiarcdtfalar9Raqz:djjjbhwkaocaf8Kjjjjbawk;Oddvue99dninabaecitfgrydlgwcd4gDTmednawciGgqci9hmbcihqdnawcl6mbabaecitfhbcbheawhqcehkindnaiabydbgDfRbbmbcbhkadaDcK2fgwIdwalIdw:tgxaxNawIdbalIdb:tgxaxNawIdlalIdl:tgxaxNMM:rgxaoIdb9DTmbaoaxUdbavaDBdbarydlhqkabcwfhbaecefgeaqcd46mbkakceGTmikaraqciGBdlskdnabcbaDalaqcdtfIdbarIdb:tgxJbbbb9FEgwaD7aecefgDfgecitfydlabawaDfgDcitfydlVci0mbaraqBdlkabaDadaialavaoz:ejjjbax:laoIdb9Fmbkkkjlevudndnabydwgxaladcetfgm8Vebcs4alaecetfgP8Vebgscs4falaicetfgz8Vebcs4ffaD0mbakmbcbhDabydxaq6mekavawcltfgxab8Pdw83dwaxab8Pdb83dbabydbhDdnabydwgwTmbaoaDcdtfhxawhsinalaxydbcetfcFFi87ebaxclfhxascufgsmbkkabaDawfBdbabydxhxab9cb83dwababydlaxci2fBdlaP8VebhscehDcbhxkdnascztcz91cu9kmbabaxcefBdwaPax87ebaoabydbcdtfaxcdtfaeBdbkdnam8Uebcu9kmbababydwgxcefBdwamax87ebaoabydbcdtfaxcdtfadBdbkdnaz8Uebcu9kmbababydwgxcefBdwazax87ebaoabydbcdtfaxcdtfaiBdbkarabydlfabydxci2faPRbb86bbarabydlfabydxci2fcefamRbb86bbarabydlfabydxci2fcdfazRbb86bbababydxcefBdxaDk:mPrHue99eue99eue99iu8Jjjjjbc;W;Gb9Rgx8KjjjjbdndnalmbcbhmxekcbhPaxc:m;Gbfcbc;Kbz:rjjjb8Aaxcualci9UgscltascjjjjiGEcbyd;0:G:cjbHjjjjbbgzBd:m9GaxceBd;S9GaxcuascK2gHcKfalcpFFFe0Ecbyd;0:G:cjbHjjjjbbgOBd:q9GaxcdBd;S9Gdnalci6gAmbarcd4hCascdthXaOhQazhLinavaiaPcx2fgrydwaC2cdtfhKavarydlaC2cdtfhYavarydbaC2cdtfh8AcbhraLhEinaQarfgma8Aarfg3Idbg5aYarfg8EIdbg8Fa5a8F9DEg5UdbamaKarfgaIdbg8Fa5a8Fa59DEg8FUdbamcxfgma3Idbg5a8EIdbgha5ah9EEg5UdbamaaIdbgha5aha59EEg5UdbaEa8Fa5MJbbbZNUdbaEaXfhEarclfgrcx9hmbkaQcKfhQaLclfhLaPcefgPas9hmbkkaOaHfgr9cb83dbar9cb83dzar9cb83dwaxcuascx2gralc:bjjjl0Ecbyd;0:G:cjbHjjjjbbgHBdN9GaxciBd;S9GascdthgazarfhvaxcwVhPaxclVhCaHh8Jazh8KcbhLinaxcbcj;Gbz:rjjjbhEaLas2cdthadnaAmba8Khrash3inaEarydbgmc8F91cjjjj94Vam7gmcQ4cx2fg8Ea8EydwcefBdwaEamcd4cFrGcx2fg8Ea8EydbcefBdbaEamcx4cFrGcx2fgmamydlcefBdlarclfhra3cufg3mbkkazaafh8AaHaafhXcbhmcbh3cbh8EcbhainaEamfgrydbhQara3BdbarcwfgKydbhYaKaaBdbarclfgrydbhKara8EBdbaQa3fh3aYaafhaaKa8Efh8Eamcxfgmcj;Gb9hmbkdnaAmbcbhravhminamarBdbamclfhmasarcefgr9hmbkavhrashminaEa8Aarydbg3cdtfydbg8Ec8F91a8E7cd4cFrGcx2fg8Ea8Eydbg8EcefBdbaXa8Ecdtfa3Bdbarclfhramcufgmmbka8JhrashminaCa8Aarydbg3cdtfydbg8Ec8F91a8E7cx4cFrGcx2fg8Ea8Eydbg8EcefBdbava8Ecdtfa3BdbarclfhramcufgmmbkavhrashminaPa8Aarydbg3cdtfydbg8Ec8F91cjjjj94Va8E7cQ4cx2fg8Ea8Eydbg8EcefBdbaXa8Ecdtfa3Bdbarclfhramcufgmmbkka8Jagfh8Ja8Kagfh8KaLcefgLci9hmbkaEaocetgrcuaocu9kEcbyd;0:G:cjbHjjjjbbgKBd:y9GaEclBd;S9Gdndnaoal9nmbaihralhminaKarydbcetfcFFi87ebarclfhramcufgmmbxdkkaKcFearz:rjjjb8Akcbh8EaEascbyd;0:G:cjbHjjjjbbg8ABd:C9GaOaHaHascdtfaHascitfa8AascbazaKaiawaDaqakz:hjjjbdndnalci6mba8Ahrashmina8EarRbbfh8EarcefhramcufgmmbkaE9cb83iwaE9cb83ibalawc9:fgrfcufar9UgrasaDfcufaD9Ugmaram0EhYcbhmcbhra8Ehaincbh3dnarTmba8AarfRbbceSh3kamaEaiaHydbcx2fgQydbaQclfydbaQcwfydbaKabaeadamawaqa3a3ce7a8EaY9nVaaamfaY6VGz:fjjjbfhmaHclfhHaaa8AarfRbb9Rhaasarcefgr9hmbkaEydxTmeabamcltfgraE8Piw83dwaraE8Pib83dbamcefhmxekaE9cb83iwaE9cb83ibcbhmkczhrinaEc:m;Gbfarfydbcbyd;4:G:cjbH:bjjjbbarc98fgrc989hmbkkaxc;W;Gbf8Kjjjjbamk:wKDQue99iue99iul9:euw99iu8Jjjjjbc;qb9RgP8Kjjjjbaxhsaxhzdndnavax0gHmbdnavTmbcbhOaehzavhAinawaDazydbcx2fgCcwfydbcetfgX8VebhQawaCclfydbcetfgL8VebhKawaCydbcetfgC8VebhYaXce87ebaLce87ebaCce87ebaOaKcs4aYcs4faQcs4ffhOazclfhzaAcufgAmbkaehzavhAinawaDazydbcx2fgCcwfydbcetfcFFi87ebawaCclfydbcetfcFFi87ebawaCydbcetfcFFi87ebazclfhzaAcufgAmbkcehzaqhsaOaq0mekalce86bbalcefcbavcufz:rjjjb8AxekaPaiBdxaPadBdwaPaeBdlavakaqci9Ug8Aaka8Aak6EaHEgK9RhEaxaK9Rh3aKcufh5aKceth8EaKcdtgCc98fh8FavcitgOaC9Rarfc98fhaascufhhavcufhgaraOfh8JJbbjZas:Y:vh8KcbazceakaxSEg8Lcdtg8M9Rh8NJFFuuhycuh8PcbhIcbh8RinaPclfa8RcdtfydbhQaPcb8Pd:y:G:cjbg8S83i9iaPcb8Pd:q:G:cjbgR83inaPcb8Pd1:G:cjbg8U83iUaPcb8Pdj:G:cjbg8V83i8WaPa8S83iyaPaR83iaaPa8U83iKaPa8V83izaQavcdtgYfh8WcbhXinabaQaXcdtgLfydbcK2fhAcbhzinaPc8WfazfgCaAazfgOIdbg8XaCIdbg8Ya8Xa8Y9DEUdbaCczfgCaOcxfIdbg8XaCIdbg8Ya8Xa8Y9EEUdbazclfgzcx9hmbkaba8WaXcu7cdtfydbcK2fhAcbhzaPIdUh8ZaPId9ih80aPId80h81aPId9ehBaPId8Wh83aPIdnhUinaPczfazfgCaAazfgOIdbg8XaCIdbg8Ya8Xa8Y9DEUdbaCczfgCaOcxfIdbg8XaCIdbg8Ya8Xa8Y9EEUdbazclfgzcx9hmbkaraLfgza80a8Z:tg8XaUa83:tg8YNa8YaBa81:tg8ZNa8Za8XNMMUdbazaYfaPIdyaPIdK:tg8XaPIdaaPIdz:tg8YNa8YaPId8KaPIdC:tg8ZNa8Za8XNMMUdbaXcefgXav9hmbkcbh85dnaHmbcbhAaQhza8JhCavhXinawaDazydbcx2fgOcwfydbcetfgL8Vebh8WawaOclfydbcetfg858Vebh86awaOydbcetfgO8Vebh87aLce87eba85ce87ebaOce87ebaCaAa86cs4a87cs4fa8Wcs4ffgABdbazclfhzaCclfhCaXcufgXmbkavhCinawaDaQydbcx2fgzcwfydbcetfcFFi87ebawazclfydbcetfcFFi87ebawazydbcetfcFFi87ebaQclfhQaCcufgCmbka8Jh85kdndndndndndndndndndndnava8E6mba8Eax9nmeavavaK9UgzaK29Raza320mda5aE9pmqa85Th87ceh8WaEhQxwka5ag9pmDa8Eax9nmixokavaK6mea5aE9pmwcehQaEhXa85Tmixlka5ag6mlxrka5ag9pmokcbhQaghXa85mekJFFuuh8XcbhLa5hzindnazcefgCaK6mbaQavaC9RgOaK6GmbarazcdtfIdbg8YaC:YNaravaz9RcdtfaYfc94fIdbg8ZaO:YNMg80a8X9Embdndna8KaOahf:YNg81:lJbbb9p9DTmba81:OhAxekcjjjj94hAka8ZasaA2aO9R:YNh8Zdndna8Kazasf:YNg81:lJbbb9p9DTmba81:OhOxekcjjjj94hOkamasaO2aC9R:Ya8YNa8ZMNa80Mg8Ya8Xa8Ya8X9DgOEh8XaCaLaOEhLkaza8LfgzaX6mbxlkkJFFuuh8XcbhLaEhCaahAa8FhOaKhzindnazaK6mbaQaCaK6GmbaraOfIdbg8Yaz:YNaAIdbg8ZaC:YNMg80a8X9Embdndna8Ka85aOfydbgYahf:YNg81:lJbbb9p9DTmba81:Oh8Wxekcjjjj94h8Wkamasa8W2aY9R:Yg81a8YNa8Za81NMNa80Mg8Ya8Xa8Ya8X9DgYEh8XazaLaYEhLkaCa8L9RhCaAa8NfhAaOa8MfhOaza8LfgzcufaX6mbxikka85Th87cbh8WaghQkJFFuuh8XcbhLaEhCaahAa8FhOaKhzindnazazaK9UgXaK29RaXa320mbdna8WTmbaCaCaK9UgXaK29RaXa320mekaraOfIdbg8Yaz:YNaAIdbg8ZaC:YNMg80a8X9EmbazhXaChYdna87mba85aOfydbgXhYkdndna8KaYahf:YNg81:lJbbb9p9DTmba81:Oh86xekcjjjj94h86ka8Zasa862aY9R:YNh8Zdndna8KaXahf:YNg81:lJbbb9p9DTmba81:OhYxekcjjjj94hYkamasaY2aX9R:Ya8YNa8ZMNa80Mg8Ya8Xa8Ya8X9DgXEh8XazaLaXEhLkaCa8L9RhCaAa8NfhAaOa8MfhOaza8LfgzcufaQ6mbkkaLTmba8Xay9DTmba8XhyaLhIa8Rh8Pka8Rcefg8Rci9hmbkdndnaoc8X9kmba8Pcb9omeka8Acufh85cbhYindndndnavaY9RaxaYaxfav0Eg8WTmbcbhAaeaYcdtfgzhCa8WhXinawaDaCydbcx2fgOcwfydbcetfgQ8VebhbawaOclfydbcetfgL8VebhrawaOydbcetfgO8VebhKaQce87ebaLce87ebaOce87ebaAarcs4aKcs4fabcs4ffhAaCclfhCaXcufgXmbka8WhOinawaDazydbcx2fgCcwfydbcetfcFFi87ebawaCclfydbcetfcFFi87ebawaCydbcetfcFFi87ebazclfhzaOcufgOmbkaAaq0mekalaYfgzce86bbazcefcba8Wcufz:rjjjb8AxekalaYfgzce86bbazcefcba85z:rjjjb8Aa8Ah8Wka8WaYfgYav9pmdxbkkaravcdtg8WfhLdnaITmbaPclfa8PcdtfydbhzaIhCinaLazydbfcb86bbazclfhzaCcufgCmbkkdnavaI9nmbaPclfa8PcdtfydbaIcdtfhzavaI9RhCinaLazydbfce86bbazclfhzaCcufgCmbkkcbhYindnaYa8PSmbcbhzaraPclfaYcdtfydbgKa8Wz:qjjjbhCavhXaIhOinaKaOazaLaCydbgQfRbbgAEcdtfaQBdbaCclfhCaOaAfhOazaA9RcefhzaXcufgXmbkkaYcefgYci9hmbkabaeadaialaIaocefgCarawaDaqakaxamz:hjjjbabaeaIcdtgzfadazfaiazfalaIfavaI9RaCarawaDaqakaxamz:hjjjbkaPc;qbf8Kjjjjbk:Seeru8Jjjjjbc:q;ab9Rgo8Kjjjjbaoc:q8WfcFecjzz:rjjjb8AcbhrdnadTmbaehwadhDinaoarcdtfawydbgqBdbaoc:q8WfaqcFiGcdtfgkydbhxakaqBdbawclfhwaraxaq9hfhraDcufgDmbkkabaeadaoaraiavz:jjjjbaoc:q;abf8Kjjjjbk;Sqloud99euD998Jjjjjbc:W;ab9Rgr8KjjjjbdndnadTmbaocd4hwcbhDcbhqindnavaeclfydbaw2cdtfgkIdbavaeydbaw2cdtfgxIdbgm:tgPavaecwfydbaw2cdtfgsIdlaxIdlgz:tgHNakIdlaz:tgOasIdbam:tgAN:tgCaCNaOasIdwaxIdwgX:tgQNakIdwaX:tgOaHN:tgHaHNaOaANaPaQN:tgPaPNMMgOJbbbb9Bmbarc8WfaDcltfgkaCaO:rgO:vgCUdwakaPaO:vgPUdlakaHaO:vgHUdbakaCaXNaHamNazaPNMM:mUdxaDcefhDkaecxfheaqcifgqad6mbkab9cb83dyab9cb83daab9cb83dKab9cb83dzab9cb83dwab9cb83dbaDTmearcbBd8Sar9cb83iKar9cb83izarczfavalaoarc8Sfcbcraiz:kjjjbarIdKhQarIdChLarIdzhKar9cb83iwar9cb83ibararc8WfaDczarc8Sfcbcicbz:kjjjbJbbbbhmdnarIdwgzazNarIdbgHaHNarIdlgXaXNMMgCJbbbb9BmbJbbjZaC:r:vhmkazamNhCaXamNhXaHamNhHJbbjZhmarc8WfheaDhvinaecwfIdbaCNaeIdbaHNaXaeclfIdbNMMgzamazam9DEhmaeczfheavcufgvmbkabaQUdwabaLUdlabaKUdbabarId3UdxdndnamJ;n;m;m899FmbJbbbbhzarc8WfheinaecxfIdbaQaecwfIdbgPNaKaeIdbgONaLaeclfIdbgANMMMaCaPNaHaONaXaANMM:vgPazaPaz9EEhzaeczfheaDcufgDmbkabaCUd8KabaXUdaabaHUd3abaQaCazN:tUdKabaLaXazN:tUdCabaKaHazN:tUdzabJbbjZamamN:t:rgmUdydndnaCJbbj:;aCJbbj:;9GEgzJbbjZazJbbjZ9FEJbb;:9cNJbbbZJbbb:;aCJbbbb9GEMgz:lJbbb9p9DTmbaz:Ohexekcjjjj94hekabae86b8UdndnaXJbbj:;aXJbbj:;9GEgzJbbjZazJbbjZ9FEJbb;:9cNJbbbZJbbb:;aXJbbbb9GEMgz:lJbbb9p9DTmbaz:Ohvxekcjjjj94hvkabav86bRdndnaHJbbj:;aHJbbj:;9GEgzJbbjZazJbbjZ9FEJbb;:9cNJbbbZJbbb:;aHJbbbb9GEMgz:lJbbb9p9DTmbaz:Ohwxekcjjjj94hwkabaw86b8SdndnaecKtcK91:YJbb;:9c:vaC:t:lavcKtcK91:YJbb;:9c:vaX:t:lawcKtcK91:YJbb;:9c:vaH:t:lamMMMJbb;:9cNJbbjZMgm:lJbbb9p9DTmbam:Ohexekcjjjj94hekaecFbaecFb9iEhexekabcjjj;8iBdycFbhekabae86b8Vxekab9cb83dyab9cb83daab9cb83dKab9cb83dzab9cb83dwab9cb83dbkarc:W;abf8Kjjjjbk;7woDuo99eue99euv998Jjjjjbcje9Rgw8Kjjjjbawc;abfcbaocdtgDz:rjjjb8Aawc;GbfcbaDz:rjjjb8AawcafhDawhqaohkinaqcFFF97BdbaDcFFF;7rBdbaqclfhqaDclfhDakcufgkmbkavcd4hxaicd4hmdnadTmbaocx2hPcbhsinashzdnarTmbarascdtfydbhzkaeazam2cdtfgDIdwhHaDIdlhOaDIdbhAalazax2cdtfIdbhCcbhDawcafhqawc;Gbfhvawhkawc;abfhiinaCaDc:O:G:cjbfIdbaHNaDc:G:G:cjbfIdbaANaDc:K:G:cjbfIdbaONMMgXMhQazhLdnaXaC:tgXaqIdbgK9DgYmbavydbhLkavaLBdbazhLdnaQakIdbg8A9EmbaiydbhLa8AhQkaiaLBdbakaQUdbaqaXaKaYEUdbaiclfhiakclfhkavclfhvaqclfhqaPaDcxfgD9hmbkascefgsad9h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iTmbadhoaihrinavcjxfaoRbbfgwawRbbcef86bbavcjxfaocefRbbfgwawRbbcef86bbavcjxfaocdfRbbfgwawRbbcef86bbaocifhoarcufgrmbkcbhDcjehoadhqcehkindndnalTmbcbhxcuhmaqhrakhwcuhPinawcufamaoavcjPfarcefRbbgsfRbb9RcFeGgzci6aoavcjPfarRbbgHfRbb9RcFeGgOci6faoavcjPfarcdfRbbgAfRbb9RcFeGgCci6fgXcOtaOcFr7azaCf9RcwtVavcjxfaAfRbbgzavcjxfaHfRbbgHavcjxfasfRbbgsaHas6Egsazas6EcFe7VgsaP9kgzEhmaXcd6gHaxcefgOal9iVce9hmdasaPazEhPaxaOaHEhxarcifhrawai6hsawcefhwasmbxdkkcuhmaqhrakhwcuhxinawcufamaoavcjPfarcefRbbfRbb9RcFeGci6aoavcjPfarRbbfRbb9RcFeGci6faoavcjPfarcdfRbbfRbb9RcFeGci6fgPax9kgsEhmaPce0meaPaxasEhxarcifhrawai6hPawcefhwaPmbkkadamci2fgrcdfRbbhwarcefRbbhxarRbbhPadaDci2fgrcifaramaD9Rci2zNjjjb8AaPavcjPffaocefgo86bbaPavcjxffgmamRbbcuf86bbaxavcjPffao86bbaxavcjxffgmamRbbcuf86bbarcdfaw86bbarcefax86bbaraP86bbawavcjPffao86bbawavcjxffgrarRbbcuf86bbaqcifhqakcefhkaDcefgDai9hmbkcbhzdnalcb9mmbcbhsavcjPfcbaez:rjjjb8Aadcvfhlinadasci2fgxcefgDRbbhoaxcdfgqRbbhrdndnavcjPfaxRbbgmfRbbmbavcjPfarfRbbhwdndndnavcjPfaofRbbTmbawcFeGTmexikawcFeGmdascefgAai9pmdasc980mdascifhQcbhLarcFeGhCamcFeGhXalhwcbhKcbhYinawcufRbbhPawRbbhOcehkdndnawc9:fRbbgHao9hmbaPcFeGamSmekdnaPcFeGao9hmbaOcFeGamSmekaHamSaOcFeGaoSGhkkceh8AaYceGhYdndnaHar9hmbaPcFeGaoSmekdnaPcFeGar9hmbaOcFeGaoSmekaHaoSaOcFeGarSGh8AkakaYVhYaLaHcFeGgHaXSaPcFeGgPaCSGaPaXSaOcFeGgPaCSGVaHaCSaPaXSGVVhLa8AaKceGVhKdnaAcefgPai9pmbawcifhwaAaQ6hHaPhAaHmekkaYTmeaKmekarhwaohPaohHarhOamhrxdkdnaYTaLVceGTmbaYaKTVaLVceGmekamhwarhParhHamhOaohrxekaohwamhPamhHaohOkavcjPfarfce86bbavcjPfawfce86bbaxaH86bbaqar86bbaDaO86bbavcjPfaPfce86bbalcifhlascefgsai9hmbkkavcFeaecetz:rjjjbhwaici2hrindnawadRbbgmcetfgx8Uebgocu9kmbaxaz87ebawcjlfazcdtfabamcdtfydbBdbazhoazcefhzkadao86bbadcefhdarcufgrmbkazcdthokabavcjlfaoz:qjjjb8Aavcjzf8KjjjjbkObabaiaeadcbz:njjjbk9teiucbcbyd;8:G:cjbgeabcifc98GfgbBd;8:G:cjbdndnabZbcztgd9nmbcuhiabad9RcFFifcz4nbcuSmekaehikaik;LeeeudndnaeabVciGTmbabhixekdndnadcz9pmbabhixekabhiinaiaeydbBdbaiclfaeclfydbBdbaicwfaecwfydbBdbaicxfaecxfydbBdbaeczfheaiczfhiadc9Wfgdcs0mbkkadcl6mbinaiaeydbBdbaeclfheaiclfhiadc98fgdci0mbkkdnadTmbinaiaeRbb86bbaicefhiaecefheadcufgdmbkkabk;aeedudndnabciGTmbabhixekaecFeGc:b:c:ew2hldndnadcz9pmbabhixekabhiinaialBdbaicxfalBdbaicwfalBdbaiclfalBdbaiczfhiadc9Wfgdcs0mbkkadcl6mbinaialBdbaiclfhiadc98fgdci0mbkkdnadTmbinaiae86bbaicefhiadcufgdmbkkabk9teiucbcbyd;8:G:cjbgeabcrfc94GfgbBd;8:G:cjbdndnabZbcztgd9nmbcuhiabad9RcFFifcz4nbcuSmekaehikaikTeeucbabcbyd;8:G:cjbge9Rcifc98GaefgbBd;8:G:cjbdnabZbcztge9nmbabae9RcFFifcz4nb8Akk:3qeludndnadch6mbadTmeabaead;8qbbabskabaeSmbdnaeadabfgi9Rcbadcet9R0mbadTmeabaead;8qbbabskaeab7ciGhldndndnabae9pmbdnalTmbadhvabhixikdnabciGmbadhvabhixdkadTmiabaeRbb86bbadcufhvdnabcefgiciGmbaecefhexdkavTmiabaeRbe86beadc9:fhvdnabcdfgiciGmbaecdfhexdkavTmiabaeRbd86bdadc99fhvdnabcifgiciGmbaecifhexdkavTmiabaeRbi86biabclfhiaeclfheadc98fhvxekdnalmbdnaiciGTmbadTmlabadcufgifglaeaifRbb86bbdnalciGmbaihdxekaiTmlabadc9:fgifglaeaifRbb86bbdnalciGmbaihdxekaiTmlabadc99fgifglaeaifRbb86bbdnalciGmbaihdxekaiTmlabadc98fgdfaeadfRbb86bbkadcl6mbdnadc98fgocxGcxSmbaocd4cefciGhiaec98fhlabc98fhvinavadfaladfydbBdbadc98fhdaicufgimbkkaocx6mbaec9Wfhvabc9WfhoinaoadfgicxfavadfglcxfydbBdbaicwfalcwfydbBdbaiclfalclfydbBdbaialydbBdbadc9Wfgdci0mbkkadTmdadhidnadciGglTmbaecufhvabcufhoadhiinaoaifavaifRbb86bbaicufhialcufglmbkkadcl6mdaec98fhlabc98fhvinavaifgecifalaifgdcifRbb86bbaecdfadcdfRbb86bbaecefadcefRbb86bbaeadRbb86bbaic98fgimbxikkavcl6mbdnavc98fglc3Gc3Smbavalcd4cefcrGgdcdt9RhvinaiaeydbBdbaeclfheaiclfhiadcufgdmbkkalc36mbinaiaeydbBdbaiclfaeclfydbBdbaicwfaecwfydbBdbaicxfaecxfydbBdbaiczfaeczfydbBdbaicCfaecCfydbBdbaicKfaecKfydbBdbaic3faec3fydbBdbaecafheaicafhiavc9Gfgvci0mbkkavTmbdndnavcrGgdmbavhlxekavc94GhlinaiaeRbb86bbaicefhiaecefheadcufgdmbkkavcw6mbinaiaeRbb86bbaicefaecefRbb86bbaicdfaecdfRbb86bbaicifaecifRbb86bbaiclfaeclfRbb86bbaicvfaecvfRbb86bbaicofaecofRbb86bbaicrfaecrfRbb86bbaicwfhiaecwfhealc94fglmbkkabkk:pedbcj:GdktFFuuFFuuFFuubbbbFFuFFFuFFFuFbbbbbbjZbbbbbbbbbbbbbbjZbbbbbbbbbbbbbbjZ86;nAZ86;nAZ86;nAZ86;nA:;86;nAZ86;nAZ86;nAZ86;nA:;86;nAZ86;nAZ86;nAZ86;nA:;bc;0:Gdkxebbbdbbbj:qbb",t=new Uint8Array([32,0,65,2,1,106,34,33,3,128,11,4,13,64,6,253,10,7,15,116,127,5,8,12,40,16,19,54,20,9,27,255,113,17,42,67,24,23,146,148,18,14,22,45,70,69,56,114,101,21,25,63,75,136,108,28,118,29,73,115]);if(typeof WebAssembly!="object")return{supported:!1};var n,i=WebAssembly.instantiate(o(e),{}).then(function(y){n=y.instance,n.exports.__wasm_call_ctors()});function o(y){for(var _=new Uint8Array(y.length),S=0;S96?Z-97:Z>64?Z-39:Z+4}for(var R=0,S=0;S=3),r(Z>=3&&Z<=256),r(R>=1&&R<=512),C=C||0;var E=y.BYTES_PER_ELEMENT==4?y:new Uint32Array(y);return u(n.exports.meshopt_buildMeshletsFlex,E,_,_.length/S,S*4,Z,R,R,C,0)},buildMeshletsFlex:function(y,_,S,Z,R,C,E,A){r(y.length%3==0),r(_ instanceof Float32Array),r(_.length%S==0),r(S>=3),r(Z>=3&&Z<=256),r(R>=1&&C<=512),r(R<=C),E=E||0,A=A||0;var L=y.BYTES_PER_ELEMENT==4?y:new Uint32Array(y);return u(n.exports.meshopt_buildMeshletsFlex,L,_,_.length/S,S*4,Z,R,C,E,A)},buildMeshletsSpatial:function(y,_,S,Z,R,C,E){r(y.length%3==0),r(_ instanceof Float32Array),r(_.length%S==0),r(S>=3),r(Z>=3&&Z<=256),r(R>=1&&C<=512),r(R<=C),E=E||0;var A=y.BYTES_PER_ELEMENT==4?y:new Uint32Array(y);return u(n.exports.meshopt_buildMeshletsSpatial,A,_,_.length/S,S*4,Z,R,C,E)},extractMeshlet:function(y,_){return r(_>=0&&_=3);var Z=y.BYTES_PER_ELEMENT==4?y:new Uint32Array(y);return b(Z,_,_.length/S,S*4)},computeMeshletBounds:function(y,_,S){return r(_ instanceof Float32Array),r(_.length%S==0),r(S>=3),p(y,_,_.length/S,S*4)},computeSphereBounds:function(y,_,S,Z){return r(y instanceof Float32Array),r(y.length%_==0),r(_>=3),r(!S||S instanceof Float32Array),r(!S||S.length%Z==0),r(!S||Z>=1),r(!S||y.length/_==S.length/Z),Z=Z||0,f(y,y.length/_,_*4,S,Z*4)}}})();var yQn=x(T(),1),bQn=(function(){var e="b9H79Tebbbegv9Geueu9Geub9Gbb9Gkuuuuuuuuuuub9Giuuueuirodiblbelve9Weiiviebeoweuecj:Gdkrnlo9TW9T9VV95dbH9F9F939H79T9F9J9H229F9Jt9VV7bbK9TW79O9V9Wt9F9NW9UWV9HtW9u9H9U9NW9Ut7bel79IV9RbdDwebcekdlvq;m8Lodbk:wgvOuw99iuv99vu8Jjjjjbc;Wb9Rgk8Kjjjjbakcxfcbc;Kbz:djjjb8AakcualcdtgxalcFFFFi0Ecbyd:q:G:cjbHjjjjbbgmBdxakceBd2adci9UhPalcd4alfhscehzinazgHcethzaHas6mbkakcuaHcdtgzaHcFFFFi0Ecbyd:q:G:cjbHjjjjbbgsBdzakcdBd2ascFeazz:djjjbhOaDcd4hAarcd4hCavcd4hXdnalTmbaHcufhrcbhvindndnaOcbaiavaX2cdtfgHydlgDaDcjjjj94SEgscH4cbaoavaC2cdtfgzydlgQcs4aQcjjjj94SE7as7c:F:b:DD2cbaHydbgLaLcjjjj94SEgscH4cbazydbgKcs4aKcjjjj94SE7as7c;D;O:B8J27cbaHydwgYaYcjjjj94SEgHcH4cbazydwg8Acs4a8Acjjjj94SE7aH7c:3F;N8N27awavaA2cdtfgHydlgEaHydbg37cFFFFrGgHcm4aH7c:fjjK27arGgscdtfgHydbgzcuSmbaE::h5a3::h8Ea8A::h8FaQ::haaK::hhaY::hgaD::h8JaL::h8KcehDinaDhHdnaiazaX2cdtfgDIdba8K9CmbaDIdla8J9CmbaDIdwag9CmbaoazaC2cdtfgDIdbah9CmbaDIdlaa9CmbaDIdwa8F9CmbawazaA2cdtfgDIdba8E9CmbaDIdla59BmikaHcefhDaOasaHfarGgscdtfgHydbgzcu9hmbkkaHavBdbavhzkamavcdtfazBdbavcefgval9hmbkkaOcbydN:G:cjbH:bjjjbbakceBd2akcualcefgHcdtaHcFFFFi0Ecbyd:q:G:cjbHjjjjbbg8LBdzakcdBd2akcuadcdtadcFFFFi0EgYcbyd:q:G:cjbHjjjjbbg8MBdCakciBd2a8Lclfcbaxz:djjjbhzdnadTmbdnaeTmbaehHadhsinazamaHydbcdtfydbcdtfgDaDydbcefBdbaHclfhHascufgsmbxdkkamhHadhsinazaHydbcdtfgDaDydbcefBdbaHclfhHascufgsmbkkdnalTmbcbhsazhHalhDinaHydbhOaHasBdbaHclfhHaOasfhsaDcufgDmbkkdnadci6gQmbcbhscdhHaPhOindndnaeTmbamaeasfgvydbcdtfhDamavcwfydbcdtfhramavclfydbcdtfhvxekamasfgDcwfhraDclfhvkarydbhravydbhvazaDydbcdtfgDaDydbgDcefBdba8MaDcdtfaHc9:fBdbazavcdtfgDaDydbgDcefBdba8MaDcdtfaHcufBdbazarcdtfgDaDydbgDcefBdba8MaDcdtfaHBdbascxfhsaHclfhHaOcufgOmbkkcbhsa8LcbBdbakcuaPcltadcFFFFd0Ecbyd:q:G:cjbHjjjjbbg8NBdKakclBd2dnaQmbaehza8NhHaPhvindndnaeTmbazcwfydbhDazclfydbhOazydbhrxekascdfhDascefhOashrkJbbbbh8KJbbbbJbbbbJbbbbJbbbbJbbjZJbbj:;awaOaA2cdtfgQIdbawaraA2cdtfgLIdbgh:tawaDaA2cdtfgKIdlaLIdlgg:tg8JNaQIdlag:tggaKIdbah:tN:tghJbbbb9EEahJbbbb9BEg8EaiaraX2cdtfgrIdwghaiaOaX2cdtfgOIdwg59BEa8EarIdlgaaOIdlgy9BEa8EarIdbg8FaOIdbg8P9BEg8EahaiaDaX2cdtfgDIdwgI9BEa8EaaaDIdlg8R9BEa8Ea8FaDIdbg8S9BEg8Ea5aI9BEa8Eaya8R9BEa8Ea8Pa8S9BEh8Edna8Ja5ah:tNagaIah:tN:tghahNa8Ja8Pa8F:tNaga8Sa8F:tN:tg8Fa8FNa8Jayaa:tNaga8Raa:tN:tg8Ja8JNMMggJbbbb9Bmba8Eag:r:vh8KkaHcxfa8EUdbaHcwfaha8KNUdbaHclfa8Ja8KNUdbaHa8Fa8KNUdbazcxfhzaHczfhHascifhsavcufgvmbkkcbhHakaYcbyd:q:G:cjbHjjjjbbgDBd3akcvBd2dnadTmbaDhzinazaHBdbazclfhzadaHcefgH9hmbkkakcuaPcdtadcFFFF970Ecbyd:q:G:cjbHjjjjbbgvBdaakcoBd2akaPcbyd:q:G:cjbHjjjjbbg8ABd8KakcrBd2dnadci6mba8NcxfhzavhscbhHinasaHBdba8AaHfcdcbazIdbg8KJbbbb9DEa8KJbbbb9EV86bbasclfhsazczfhzaPaHcefgH9hmbkkdnalTmbcbhRinaRcdthHdna8LaRcefgRcdtfydbgza8LaHfydbgHSmbazaH9RhLa8MaHcdtfhKcbh8UinaKa8Ucdtfg8VydbgHcd4g8Wci2gxaHciGcdtgzyd:e:G:cjbfhHaxazydj:G:cjbfhzdnaeTmbaeaHcdtfydbhHaeazcdtfydbhzkdna8Ucefg8UaL9pmbamaHcdtfydbhYamazcdtfydbh3a8Aa8WfhEava8Wcdtfh8Xa8UhwinaKawcdtfgQydbgHcd4gzci2gAaHciGcdtgHyd:e:G:cjbfhsaAaHydj:G:cjbfhHdnaeTmbaeascdtfydbhsaeaHcdtfydbhHkdndnamaHcdtfydbaYSmbamascdtfydba39hmeka8AazfRbbgHaERbbgsVciSmbdnaHasGmba8Whsdna8Wa8XydbgHSmba8XhOinaOavaHgscdtfgrydbgHBdbarhOasaH9hmbkkdnazavazcdtfgOydbgHSmbinaOavaHgzcdtfgrydbgHBdbarhOazaH9hmbkkasazSmba8AazfgORb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ob;jZMJbbjZa8K:t:rNg8K:ta8KagJbbbb9DENg8Ka8Ja8KNaEEg8KNaHIdbMUdbaHaha8KNaHIdlMUdlaHa8Fa8KNaHIdwMUdwawcefhwazclfgzcx9hmbkkaYcxfhYa3cxfh3a8Vcifh8Va8Wcefg8WaP9hmbkcbhrinarhzdnaravarcdtfgsydbgHSmbinasavaHgzcdtfgOydbgHBdbaOhsazaH9hmbkkaKarc8W2fgHc3fJbbjZJbbj:;a8AazfRbbceGEg8KUdbaHc8Sfa8KUdbaHa8KUdxarcefgraP9hmbkkaqcdGhvcbhzaDhsaKhHindnazasydb9hmbJbbbbh8KdnaHcwfgOIdbg8Ja8JNaHIdbggagNaHclfgrIdbghahNMMgaJbbbb9BmbJbbjZaa:r:vh8KkaOa8Ja8KNUdbaraha8KNUdbaHaga8KNg8JUdbavmbaHJbbjZa8Ja8KJbbbb9BEUdbkasclfhsaHczfhHadazcefgz9hmbkcbhHaKhzindnaHaDydbgsSmbazaKascltfgsydwBdwazas8Pdb83dbkaDclfhDazczfhzadaHcefgH9hmbkkdnakyd2gzTmbazcdtakcxffc98fhHinaHydbcbydN:G:cjbH:bjjjbbaHc98fhHazcufgzmbkkakc;Wbf8Kjjjjbk9teiucbcbyd:y:G:cjbgeabcifc98GfgbBd:y:G:cjbdndnabZbcztgd9nmbcuhiabad9RcFFifcz4nbcuSmekaehikaik;aeedudndnabciGTmbabhixekaecFeGc:b:c:ew2hldndnadcz9pmbabhixekabhiinaialBdbaicxfalBdbaicwfalBdbaiclfalBdbaiczfhiadc9Wfgdcs0mbkkadcl6mbinaialBdbaiclfhiadc98fgdci0mbkkdnadTmbinaiae86bbaicefhiadcufgdmbkkabk9teiucbcbyd:y:G:cjbgeabcrfc94GfgbBd:y:G:cjbdndnabZbcztgd9nmbcuhiabad9RcFFifcz4nbcuSmekaehikaikTeeucbabcbyd:y:G:cjbge9Rcifc98GaefgbBd:y:G:cjbdnabZbcztge9nmbabae9RcFFifcz4nb8Akkk8Rdbcj:Gdkzebbbdbbbbbbbebbbbc:q:Gdkxebbbdbbba:qbb",t=new Uint8Array([32,0,65,2,1,106,34,33,3,128,11,4,13,64,6,253,10,7,15,116,127,5,8,12,40,16,19,54,20,9,27,255,113,17,42,67,24,23,146,148,18,14,22,45,70,69,56,114,101,21,25,63,75,136,108,28,118,29,73,115]);if(typeof WebAssembly!="object")return{supported:!1};var n,i=WebAssembly.instantiate(o(e),{}).then(function(d){n=d.instance,n.exports.__wasm_call_ctors()});function o(d){for(var u=new Uint8Array(d.length),m=0;m96?p-97:p>64?p-39:p+4}for(var b=0,m=0;m=3),r(p instanceof Float32Array),r(p.length%b==0),r(b>=3),r(f instanceof Float32Array),r(f.length%y==0),r(y>=2),r(u.length/m==p.length/b),r(u.length/m==f.length/y),r(d!==null||u.length/m%3==0);for(var S=0,Z=0;Z<(_?_.length:0);++Z)r(_[Z]in c),S|=c[_[Z]];var R=u.length/m,C=d?d.length:R,E=d===null||d.BYTES_PER_ELEMENT==4?d:new Uint32Array(d);return a(E,C,u,R,m,p,b,f,y,S)}}})();var _7=class extends oo{constructor(t){super(),t=t??B.EMPTY_OBJECT;let n=t.resourceCache,i=t.gltf,o=t.bufferViewId,r=t.gltfResource,s=t.baseResource,a=t.cacheKey,c=i.bufferViews[o],d=c.buffer,u=c.byteOffset,m=c.byteLength,p=!1,b,f,y,_,S=ux(c);l(S)&&(d=S.buffer,u=S.byteOffset??0,m=S.byteLength,p=!0,b=S.byteStride,f=S.count,y=S.mode,_=S.filter??"NONE");let Z=i.buffers[d];this._hasMeshopt=p,this._meshoptByteStride=b,this._meshoptCount=f,this._meshoptMode=y,this._meshoptFilter=_,this._resourceCache=n,this._gltfResource=r,this._baseResource=s,this._buffer=Z,this._bufferId=d,this._byteOffset=u,this._byteLength=m,this._cacheKey=a,this._bufferLoader=void 0,this._typedArray=void 0,this._state=Rt.UNLOADED,this._promise=void 0}get cacheKey(){return this._cacheKey}get typedArray(){return this._typedArray}async load(){return l(this._promise)?this._promise:(this._state=Rt.LOADING,this._promise=v$e(this),this._promise)}unload(){l(this._bufferLoader)&&!this._bufferLoader.isDestroyed()&&this._resourceCache.unload(this._bufferLoader),this._bufferLoader=void 0,this._typedArray=void 0}};async function v$e(e){try{let t=F$e(e);if(e._bufferLoader=t,await t.load(),e.isDestroyed())return;let n=t.typedArray,i=new Uint8Array(n.buffer,n.byteOffset+e._byteOffset,e._byteLength);if(e.unload(),e._typedArray=i,e._hasMeshopt){let o=e._meshoptCount,r=e._meshoptByteStride,s=new Uint8Array(o*r);mx.decodeGltfBuffer(s,o,r,e._typedArray,e._meshoptMode,e._meshoptFilter),e._typedArray=s}return e._state=Rt.READY,e}catch(t){if(e.isDestroyed())return;throw e.unload(),e._state=Rt.FAILED,e.getError("Failed to load buffer view",t)}}function F$e(e){let t=e._resourceCache,n=e._buffer;if(l(n.uri)){let r=e._baseResource.getDerivedResource({url:n.uri});return t.getExternalBufferLoader({resource:r})}let i=n.extras?._pipeline?.source;return t.getEmbeddedBufferLoader({parentResource:e._gltfResource,bufferId:e._bufferId,typedArray:i})}var IC=_7;var QQn=x(T(),1);var MQn=x(T(),1);var TS=class e{static _getDecoderTaskProcessor(){if(!l(e._decoderTaskProcessor)){let t=new qn("decodeDraco",e._maxDecodingConcurrency);t.initWebAssemblyModule({wasmBinaryFile:"ThirdParty/draco_decoder.wasm"}).then(function(n){n?e._taskProcessorReady=!0:e._error=new ae("Draco decoder could not be initialized.")}).catch(n=>{e._error=n}),e._decoderTaskProcessor=t}return e._decoderTaskProcessor}static decodePointCloud(t){let n=e._getDecoderTaskProcessor();if(l(e._error))throw e._error;if(e._taskProcessorReady)return n.scheduleTask(t,[t.buffer.buffer])}static decodeBufferView(t){let n=e._getDecoderTaskProcessor();if(l(e._error))throw e._error;if(e._taskProcessorReady)return n.scheduleTask(t,[t.array.buffer])}};TS._maxDecodingConcurrency=Math.max(fn.hardwareConcurrency-1,1);TS._decoderTaskProcessor=void 0;TS._taskProcessorReady=!1;TS._error=void 0;var Bb=TS;var UQn=x(T(),1);var Pn={POSITION:"POSITION",NORMAL:"NORMAL",TANGENT:"TANGENT",TEXCOORD:"TEXCOORD",COLOR:"COLOR",JOINTS:"JOINTS",WEIGHTS:"WEIGHTS",FEATURE_ID:"_FEATURE_ID",SCALE:"KHR_gaussian_splatting:SCALE",ROTATION:"KHR_gaussian_splatting:ROTATION",CUMULATIVE_DISTANCE:"BENTLEY_materials_line_style:CUMULATIVE_DISTANCE"};function I$e(e){switch(e){case Pn.POSITION:return"positionMC";case Pn.NORMAL:return"normalMC";case Pn.TANGENT:return"tangentMC";case Pn.TEXCOORD:return"texCoord";case Pn.COLOR:return"color";case Pn.JOINTS:return"joints";case Pn.WEIGHTS:return"weights";case Pn.FEATURE_ID:return"featureId";case Pn.SCALE:return"scale";case Pn.ROTATION:return"rotation";case Pn.CUMULATIVE_DISTANCE:return"cumulativeDistance"}}Pn.hasSetIndex=function(e){switch(e){case Pn.POSITION:case Pn.NORMAL:case Pn.TANGENT:case Pn.CUMULATIVE_DISTANCE:return!1;case Pn.TEXCOORD:case Pn.COLOR:case Pn.JOINTS:case Pn.WEIGHTS:case Pn.FEATURE_ID:case Pn.SCALE:case Pn.ROTATION:return!0}};Pn.fromGltfSemantic=function(e){let t=e,i=/^(\w+)_\d+$/.exec(e);switch(i!==null&&(t=i[1]),t){case"POSITION":return Pn.POSITION;case"NORMAL":return Pn.NORMAL;case"TANGENT":return Pn.TANGENT;case"TEXCOORD":return Pn.TEXCOORD;case"COLOR":return Pn.COLOR;case"JOINTS":return Pn.JOINTS;case"WEIGHTS":return Pn.WEIGHTS;case"_FEATURE_ID":return Pn.FEATURE_ID;case"KHR_gaussian_splatting:SCALE":case"_SCALE":return Pn.SCALE;case"KHR_gaussian_splatting:ROTATION":case"_ROTATION":return Pn.ROTATION;case"BENTLEY_materials_line_style:CUMULATIVE_DISTANCE":return Pn.CUMULATIVE_DISTANCE}};Pn.fromPntsSemantic=function(e){switch(e){case"POSITION":case"POSITION_QUANTIZED":return Pn.POSITION;case"RGBA":case"RGB":case"RGB565":return Pn.COLOR;case"NORMAL":case"NORMAL_OCT16P":return Pn.NORMAL;case"BATCH_ID":return Pn.FEATURE_ID}};Pn.getGlslType=function(e){switch(e){case Pn.POSITION:case Pn.NORMAL:case Pn.TANGENT:return"vec3";case Pn.TEXCOORD:return"vec2";case Pn.COLOR:return"vec4";case Pn.JOINTS:return"ivec4";case Pn.WEIGHTS:return"vec4";case Pn.FEATURE_ID:return"int";case Pn.SCALE:return"vec3";case Pn.ROTATION:return"vec4";case Pn.CUMULATIVE_DISTANCE:return"float";case Pn.OPACITY:return"float"}};Pn.getVariableName=function(e,t){let n=I$e(e);return l(t)&&(n+=`_${t}`),n};Object.freeze(Pn);var dt=Pn;var S7=class extends oo{constructor(t){super(),t=t??B.EMPTY_OBJECT;let n=t.resourceCache,i=t.gltf,o=t.primitive,r=t.draco,s=t.gltfResource,a=t.baseResource,c=t.cacheKey;this._resourceCache=n,this._gltfResource=s,this._baseResource=a,this._gltf=i,this._primitive=o,this._draco=r,this._cacheKey=c,this._bufferViewLoader=void 0,this._bufferViewTypedArray=void 0,this._decodePromise=void 0,this._decodedData=void 0,this._state=Rt.UNLOADED,this._promise=void 0,this._dracoError=void 0}get cacheKey(){return this._cacheKey}get decodedData(){return this._decodedData}async load(){return l(this._promise)?this._promise:(this._state=Rt.LOADING,this._promise=P$e(this),this._promise)}process(t){if(this._state===Rt.READY)return!0;if(this._state!==Rt.PROCESSING||(l(this._dracoError)&&eTe(this,this._dracoError),!l(this._bufferViewTypedArray))||l(this._decodePromise))return!1;let n=this._draco,i=this._primitive,o=this._gltf,r=o.bufferViews,s=n.bufferView,a=r[s],c=n.attributes,d=[];for(let p in i.attributes)if(i.attributes.hasOwnProperty(p)){let b=N$e(p);l(b)&&o.accessors[i.attributes[p]].componentType===J.FLOAT&&(d.includes(b)||d.push(b))}let u={array:new Uint8Array(this._bufferViewTypedArray),bufferView:a,compressedAttributes:c,dequantizeInShader:!0,attributesToSkipTransform:d},m=Bb.decodeBufferView(u);if(!l(m))return!1;this._decodePromise=X$e(this,m)}unload(){l(this._bufferViewLoader)&&this._resourceCache.unload(this._bufferViewLoader),this._bufferViewLoader=void 0,this._bufferViewTypedArray=void 0,this._decodedData=void 0,this._gltf=void 0,this._primitive=void 0}};async function P$e(e){let t=e._resourceCache;try{let n=t.getBufferViewLoader({gltf:e._gltf,bufferViewId:e._draco.bufferView,gltfResource:e._gltfResource,baseResource:e._baseResource});return e._bufferViewLoader=n,await n.load(),e.isDestroyed()?void 0:(e._bufferViewTypedArray=n.typedArray,e._state=Rt.PROCESSING,e)}catch(n){if(e.isDestroyed())return;eTe(e,n)}}function eTe(e,t){throw e.unload(),e._state=Rt.FAILED,e.getError("Failed to load Draco",t)}async function X$e(e,t){try{let n=await t;return e.isDestroyed()?void 0:(e.unload(),e._decodedData={indices:n.indexArray,vertexAttributes:n.attributeData},e._state=Rt.READY,e._baseResource)}catch(n){if(e.isDestroyed())return;e._dracoError=n}}var _S={};_S[dt.POSITION]="POSITION";_S[dt.NORMAL]="NORMAL";_S[dt.COLOR]="COLOR";_S[dt.TEXCOORD]="TEX_COORD";function N$e(e){for(let t in _S)if(_S.hasOwnProperty(t)&&e.startsWith(t))return _S[t]}var PC=S7;var d8n=x(T(),1);var t8n=x(T(),1);function Y$e(e){let{uint8Array:t,format:n,request:i}=e,o=e.flipY??!1,r=e.skipColorSpaceConversion??!1,s=new Blob([t],{type:n}),a;return ve.supportsImageBitmapOptions().then(function(c){return c?Promise.resolve(ve.createImageBitmapFromBlob(s,{flipY:o,premultiplyAlpha:!1,skipColorSpaceConversion:r})):(a=window.URL.createObjectURL(s),new ve({url:a,request:i}).fetchImage({flipY:o,skipColorSpaceConversion:r}))}).then(function(c){return l(a)&&window.URL.revokeObjectURL(a),c}).catch(function(c){return l(a)&&window.URL.revokeObjectURL(a),Promise.reject(c)})}var zb=Y$e;var qI=class extends oo{constructor(t){super(),t=t??B.EMPTY_OBJECT;let n=t.resourceCache,i=t.gltf,o=t.imageId,r=t.gltfResource,s=t.baseResource,a=t.cacheKey,c=i.images[o],d=c.bufferView,u=c.uri;this._resourceCache=n,this._gltfResource=r,this._baseResource=s,this._gltf=i,this._bufferViewId=d,this._uri=u,this._cacheKey=a,this._bufferViewLoader=void 0,this._image=void 0,this._mipLevels=void 0,this._state=Rt.UNLOADED,this._promise=void 0}get cacheKey(){return this._cacheKey}get image(){return this._image}get mipLevels(){return this._mipLevels}load(){return l(this._promise)?this._promise:l(this._bufferViewId)?(this._promise=M$e(this),this._promise):(this._promise=w$e(this),this._promise)}unload(){l(this._bufferViewLoader)&&!this._bufferViewLoader.isDestroyed()&&this._resourceCache.unload(this._bufferViewLoader),this._bufferViewLoader=void 0,this._uri=void 0,this._image=void 0,this._mipLevels=void 0,this._gltf=void 0}};function tTe(e){let t;return Array.isArray(e)&&(t=e.slice(1,e.length).map(function(n){return n.bufferView}),e=e[0]),{image:e,mipLevels:t}}async function M$e(e){e._state=Rt.LOADING;let t=e._resourceCache;try{let n=t.getBufferViewLoader({gltf:e._gltf,bufferViewId:e._bufferViewId,gltfResource:e._gltfResource,baseResource:e._baseResource});if(e._bufferViewLoader=n,await n.load(),e.isDestroyed())return;let i=n.typedArray,o=await U$e(i);if(e.isDestroyed())return;let r=tTe(o);return e.unload(),e._image=r.image,e._mipLevels=r.mipLevels,e._state=Rt.READY,e}catch(n){return e.isDestroyed()?void 0:nTe(e,n,"Failed to load embedded image")}}async function w$e(e){e._state=Rt.LOADING;let t=e._baseResource,n=e._uri,i=t.getDerivedResource({url:n});try{let o=await O$e(i);if(e.isDestroyed())return;let r=tTe(o);return e.unload(),e._image=r.image,e._mipLevels=r.mipLevels,e._state=Rt.READY,e}catch(o){return e.isDestroyed()?void 0:nTe(e,o,`Failed to load image: ${n}`)}}function nTe(e,t,n){return e.unload(),e._state=Rt.FAILED,Promise.reject(e.getError(n,t))}function k$e(e){let t=e.subarray(0,2),n=e.subarray(0,4),i=e.subarray(8,12);if(t[0]===255&&t[1]===216)return"image/jpeg";if(t[0]===137&&t[1]===80)return"image/png";if(t[0]===171&&t[1]===75)return"image/ktx2";if(n[0]===82&&n[1]===73&&n[2]===70&&n[3]===70&&i[0]===87&&i[1]===69&&i[2]===66&&i[3]===80)return"image/webp";throw new ae("Image format is not recognized")}async function U$e(e){let t=k$e(e);if(t==="image/ktx2"){let n=new Uint8Array(e);return Ad(n)}return qI._loadImageFromTypedArray({uint8Array:e,format:t,flipY:!1,skipColorSpaceConversion:!0})}var D$e=/(^data:image\/ktx2)|(\.ktx2$)/i;function O$e(e){let t=e.getUrlComponent(!1,!0);return D$e.test(t)?Ad(e):e.fetchImage({skipColorSpaceConversion:!0,preferImageBitmap:!0})}qI._loadImageFromTypedArray=zb;var XC=qI;var R8n=x(T(),1);var m8n=x(T(),1),iTe={TEXTURE:0,PROGRAM:1,BUFFER:2,NUMBER_OF_JOB_TYPES:3};Object.freeze(iTe);var Ic=iTe;var Z7=class extends oo{constructor(t){super(),t=t??B.EMPTY_OBJECT;let n=t.resourceCache,i=t.gltf,o=t.accessorId,r=t.gltfResource,s=t.baseResource,a=t.primitive,c=t.draco,d=t.cacheKey,u=t.asynchronous??!0,m=t.loadBuffer??!1,p=t.loadTypedArray??!1,b=i.accessors[o].componentType;this._resourceCache=n,this._gltfResource=r,this._baseResource=s,this._gltf=i,this._accessorId=o,this._indexDatatype=b,this._primitive=a,this._draco=c,this._cacheKey=d,this._asynchronous=u,this._loadBuffer=m,this._loadTypedArray=p,this._bufferViewLoader=void 0,this._dracoLoader=void 0,this._typedArray=void 0,this._buffer=void 0,this._state=Rt.UNLOADED,this._promise=void 0}get cacheKey(){return this._cacheKey}get buffer(){return this._buffer}get typedArray(){return this._typedArray}get indexDatatype(){return this._indexDatatype}async load(){return l(this._promise)?this._promise:l(this._draco)?(this._promise=z$e(this),this._promise):(this._promise=H$e(this),this._promise)}process(t){if(this._state===Rt.READY)return!0;if(this._state!==Rt.LOADED&&this._state!==Rt.PROCESSING)return!1;let n=this._typedArray,i=this._indexDatatype;if(l(this._dracoLoader))try{this._dracoLoader.process(t)&&(n=this._dracoLoader.decodedData.indices.typedArray,this._typedArray=n,i=J.fromTypedArray(n),this._indexDatatype=i)}catch(r){C7(this,r)}if(!l(n))return!1;let o;if(this._loadBuffer&&this._asynchronous){let r=B$e;if(r.set(n,i,t.context),!t.jobScheduler.execute(r,Ic.BUFFER))return!1;o=r.buffer}else this._loadBuffer&&(o=oTe(n,i,t.context));return this.unload(),this._buffer=o,this._typedArray=this._loadTypedArray?n:void 0,this._state=Rt.READY,this._resourceCache.statistics.addGeometryLoader(this),!0}unload(){l(this._buffer)&&this._buffer.destroy();let t=this._resourceCache;l(this._bufferViewLoader)&&!this._bufferViewLoader.isDestroyed()&&t.unload(this._bufferViewLoader),l(this._dracoLoader)&&t.unload(this._dracoLoader),this._bufferViewLoader=void 0,this._dracoLoader=void 0,this._typedArray=void 0,this._buffer=void 0,this._gltf=void 0,this._primitive=void 0}},R7=class{constructor(){this.typedArray=void 0,this.indexDatatype=void 0,this.context=void 0,this.buffer=void 0}set(t,n,i){this.typedArray=t,this.indexDatatype=n,this.context=i}execute(){this.buffer=oTe(this.typedArray,this.indexDatatype,this.context)}};function oTe(e,t,n){let i=it.createIndexBuffer({typedArray:e,context:n,usage:Pe.STATIC_DRAW,indexDatatype:t});return i.vertexArrayDestroyable=!1,i}var B$e=new R7;async function z$e(e){e._state=Rt.LOADING;let t=e._resourceCache;try{let n=t.getDracoLoader({gltf:e._gltf,primitive:e._primitive,draco:e._draco,gltfResource:e._gltfResource,baseResource:e._baseResource});return e._dracoLoader=n,await n.load(),e.isDestroyed()?void 0:(e._state=Rt.LOADED,e)}catch(n){if(e.isDestroyed())return;C7(e,n)}}async function H$e(e){let t=e._gltf,n=e._accessorId,o=t.accessors[n].bufferView;e._state=Rt.LOADING;let r=e._resourceCache;try{let s=r.getBufferViewLoader({gltf:t,bufferViewId:o,gltfResource:e._gltfResource,baseResource:e._baseResource});if(e._bufferViewLoader=s,await s.load(),e.isDestroyed())return;let a=s.typedArray;return e._typedArray=K$e(e,a),e._state=Rt.PROCESSING,e}catch(s){if(e.isDestroyed())return;C7(e,s)}}function K$e(e,t){let n=e._gltf,i=e._accessorId,o=n.accessors[i],r=o.count,s=o.componentType,a=Oe.getSizeInBytes(s),c=t.buffer,d=t.byteOffset+o.byteOffset;if(d%a!==0){let m=r*a,p=new Uint8Array(c,d,m);c=new Uint8Array(p).buffer,d=0,Jo("index-buffer-unaligned",`The index array is not aligned to a ${a}-byte boundary.`)}let u;return s===Oe.UNSIGNED_BYTE?u=new Uint8Array(c,d,r):s===Oe.UNSIGNED_SHORT?u=new Uint16Array(c,d,r):s===Oe.UNSIGNED_INT&&(u=new Uint32Array(c,d,r)),u}function C7(e,t){throw e.unload(),e._state=Rt.FAILED,e.getError("Failed to load index buffer",t)}var NC=Z7;var Vqn=x(T(),1);var E8n=x(T(),1);function J$e(e,t,n){return JSON.parse(wd(e,t,n))}var Pr=J$e;var L8n=x(T(),1);function j$e(e,t){return t=t??0,wd(e,t,Math.min(4,e.length))}var bf=j$e;var z8n=x(T(),1);var v8n=x(T(),1);function Q$e(e,t,n){if(n=n??!1,n){let i=e.indexOf(t);if(i>-1)return i}return e.push(t),e.length-1}var _a=Q$e;var M8n=x(T(),1);var P8n=x(T(),1);function q$e(e,t){return l(e.extensionsUsed)&&e.extensionsUsed.indexOf(t)>=0}var Or=q$e;function sn(){}sn.objectLegacy=function(e,t){if(l(e)){for(let n in e)if(Object.prototype.hasOwnProperty.call(e,n)){let i=e[n],o=t(i,n);if(l(o))return o}}};sn.object=function(e,t){if(l(e)){let n=e.length;for(let i=0;i=0&&n.splice(i,1),n.length===0&&delete e.extensionsRequired}}var eP=net;function iet(e,t){let n=e.extensionsUsed;if(l(n)){let i=n.indexOf(t);i>=0&&n.splice(i,1),eP(e,t),n.length===0&&delete e.extensionsUsed}}var ZS=iet;var oet=4;function ret(e){if(bf(e)!=="glTF")throw new ae("File is not valid binary glTF");let n=rTe(e,0,5),i=n[1];if(i!==1&&i!==2)throw new ae("Binary glTF version is not 1 or 2");return i===1?set(e,n):aet(e,n)}function rTe(e,t,n){let i=new DataView(e.buffer),o=new Array(n);for(let r=0;r0){let m=u.binary_glTF??u.KHR_binary_glTF;l(m)&&(m.extras._pipeline.source=d,delete m.uri)}return ZS(c,"KHR_binary_glTF"),c}function aet(e,t){let n=t[2],i=12,o,r;for(;i0){let a=s[0];a.extras._pipeline.source=r}}return o}var RS=ret;var p6n=x(T(),1);function cet(e){return we.shader(e,function(t){yB(t)}),we.buffer(e,function(t){yB(t)}),we.image(e,function(t){yB(t)}),yB(e),e}function yB(e){l(e.extras)&&(l(e.extras._pipeline)&&delete e.extras._pipeline,Object.keys(e.extras).length===0&&delete e.extras)}var tP=cet;var O7n=x(T(),1);var x6n=x(T(),1);function det(e,t){let n=e.extensionsUsed;l(n)||(n=[],e.extensionsUsed=n),_a(n,t,!0)}var Hm=det;var V6n=x(T(),1);function uet(e,t){let n=e.bufferViews,i=e.buffers,o=t.bufferView,r=Yu(t.type);if(!l(t.bufferView))return{min:new Array(r).fill(0),max:new Array(r).fill(0)};let s=new Array(r).fill(Number.POSITIVE_INFINITY),a=new Array(r).fill(Number.NEGATIVE_INFINITY),c=n[o],d=c.buffer,m=i[d].extras._pipeline.source,p=t.count,b=Yd(e,t),f=t.byteOffset+c.byteOffset+m.byteOffset,y=t.componentType,_=J.getSizeInBytes(y),S=new DataView(m.buffer),Z=new Array(r),R=Ub(y);for(let C=0;C-1:!1}var fet=[ie.ZERO,ie.ONE,ie.SRC_COLOR,ie.ONE_MINUS_SRC_COLOR,ie.SRC_ALPHA,ie.ONE_MINUS_SRC_ALPHA,ie.DST_ALPHA,ie.ONE_MINUS_DST_ALPHA,ie.DST_COLOR,ie.ONE_MINUS_DST_COLOR];function pet(e,t){if(!l(e))return t;for(let n=0;n<4;n++)if(fet.indexOf(e[n])===-1)return t;return e}function bet(e){let t={},n={},i=e.techniques;return l(i)&&(we.technique(e,function(o,r){let s=o.states;if(l(s)){let a=n[r]={};if(sTe(s,ie.BLEND)){a.alphaMode="BLEND";let c=s.functions;l(c)&&(l(c.blendEquationSeparate)||l(c.blendFuncSeparate))&&(t[r]={blendEquation:c.blendEquationSeparate??met,blendFactors:pet(c.blendFuncSeparate,het)})}sTe(s,ie.CULL_FACE)||(a.doubleSided=!0),delete o.states}}),Object.keys(t).length>0&&(l(e.extensions)||(e.extensions={}),Hm(e,"KHR_blend")),we.material(e,function(o){if(l(o.technique)){let r=n[o.technique];we.objectLegacy(r,function(a,c){o[c]=a});let s=t[o.technique];l(s)&&(l(o.extensions)||(o.extensions={}),o.extensions.KHR_blend=s)}})),e}var nP=bet;var O6n=x(T(),1);var N6n=x(T(),1);function get(e,t){let n=e.extensionsRequired;l(n)||(n=[],e.extensionsRequired=n),_a(n,t,!0),Hm(e,t)}var iP=get;function yet(e){let t=e.techniques,n={},i={},o={};if(l(t)){let r={programs:[],shaders:[],techniques:[]},s=e.glExtensionsUsed;delete e.glExtensionsUsed,we.technique(e,function(a,c){let d={name:a.name,program:void 0,attributes:{},uniforms:{}},u;if(we.techniqueAttribute(a,function(m,p){u=a.parameters[m],d.attributes[p]={semantic:u.semantic}}),we.techniqueUniform(a,function(m,p){u=a.parameters[m],d.uniforms[p]={count:u.count,node:u.node,type:u.type,semantic:u.semantic,value:u.value},l(n[c])||(n[c]={}),n[c][m]=p}),l(o[a.program]))d.program=o[a.program];else{let m=e.programs[a.program],p={name:m.name,fragmentShader:void 0,vertexShader:void 0,glExtensions:s},b=e.shaders[m.fragmentShader];p.fragmentShader=_a(r.shaders,b,!0);let f=e.shaders[m.vertexShader];p.vertexShader=_a(r.shaders,f,!0),d.program=_a(r.programs,p),o[a.program]=d.program}i[c]=_a(r.techniques,d)}),r.techniques.length>0&&(l(e.extensions)||(e.extensions={}),e.extensions.KHR_techniques_webgl=r,Hm(e,"KHR_techniques_webgl"),iP(e,"KHR_techniques_webgl"))}return we.material(e,function(r){if(l(r.technique)){let s={technique:i[r.technique]};we.objectLegacy(r.values,function(a,c){l(s.values)||(s.values={});let d=n[r.technique][c];l(d)&&(s.values[d]=a)}),l(r.extensions)||(r.extensions={}),r.extensions.KHR_techniques_webgl=s}delete r.technique,delete r.values}),delete e.techniques,delete e.programs,delete e.shaders,e}var oP=yet;var t7n=x(T(),1);var J6n=x(T(),1);function xet(e,t){Ko.typeOf.object("material",e),Ko.defined("handler",t);let n=e.pbrMetallicRoughness;if(l(n)){if(l(n.baseColorTexture)){let r=n.baseColorTexture,s=t(r.index,r);if(l(s))return s}if(l(n.metallicRoughnessTexture)){let r=n.metallicRoughnessTexture,s=t(r.index,r);if(l(s))return s}}let{extensions:i}=e;if(l(i)){let r=i.KHR_materials_pbrSpecularGlossiness;if(l(r)){if(l(r.diffuseTexture)){let d=r.diffuseTexture,u=t(d.index,d);if(l(u))return u}if(l(r.specularGlossinessTexture)){let d=r.specularGlossinessTexture,u=t(d.index,d);if(l(u))return u}}let s=i.KHR_materials_specular;if(l(s)){let{specularTexture:d,specularColorTexture:u}=s;if(l(d)){let m=t(d.index,d);if(l(m))return m}if(l(u)){let m=t(u.index,u);if(l(m))return m}}let a=i.KHR_materials_transmission;if(l(a)&&l(a.transmissionTexture)){let d=a.transmissionTexture,u=t(d.index,d);if(l(u))return u}let c=i.KHR_materials_common;if(l(c)&&l(c.values)){let{diffuse:d,ambient:u,emission:m,specular:p}=c.values;if(l(d)&&l(d.index)){let b=t(d.index,d);if(l(b))return b}if(l(u)&&l(u.index)){let b=t(u.index,u);if(l(b))return b}if(l(m)&&l(m.index)){let b=t(m.index,m);if(l(b))return b}if(l(p)&&l(p.index)){let b=t(p.index,p);if(l(b))return b}}}let o=we.materialValue(e,function(r){if(l(r.index)){let s=t(r.index,r);if(l(s))return s}});if(l(o))return o;if(l(e.emissiveTexture)){let r=e.emissiveTexture,s=t(r.index,r);if(l(s))return s}if(l(e.normalTexture)){let r=e.normalTexture,s=t(r.index,r);if(l(s))return s}if(l(e.occlusionTexture)){let r=e.occlusionTexture,s=t(r.index,r);if(l(s))return s}}var YC=xet;var aTe=["mesh","node","material","accessor","bufferView","buffer","texture","sampler","image"];function Tet(e,t){return t=t??aTe,aTe.forEach(function(n){t.indexOf(n)>-1&&Zet(e,n)}),e}var _et={accessor:"accessors",buffer:"buffers",bufferView:"bufferViews",image:"images",node:"nodes",material:"materials",mesh:"meshes",sampler:"samplers",texture:"textures"};function Zet(e,t){let n=_et[t],i=e[n];if(l(i)){let o=0,r=Kp[t](e),s=i.length;for(let a=0;at&&o.attributes[c]--}),we.meshPrimitiveTarget(o,function(a){we.meshPrimitiveTargetAttribute(a,function(c,d){c>t&&a[d]--})});let r=o.indices;l(r)&&r>t&&o.indices--;let s=o.extensions;l(s)&&l(s.CESIUM_primitive_outline)&&s.CESIUM_primitive_outline.indices>t&&--s.CESIUM_primitive_outline.indices})}),we.skin(e,function(i){l(i.inverseBindMatrices)&&i.inverseBindMatrices>t&&i.inverseBindMatrices--}),we.animation(e,function(i){we.animationSampler(i,function(o){l(o.input)&&o.input>t&&o.input--,l(o.output)&&o.output>t&&o.output--})})};Hp.buffer=function(e,t){e.buffers.splice(t,1),we.bufferView(e,function(i){l(i.buffer)&&i.buffer>t&&i.buffer--;let o=i.extensions;if(l(o)){let r=o.EXT_meshopt_compression;l(r)&&r.buffer>t&&r.buffer--;let s=o.KHR_meshopt_compression;l(s)&&s.buffer>t&&s.buffer--}})};Hp.bufferView=function(e,t){if(e.bufferViews.splice(t,1),we.accessor(e,function(i){l(i.bufferView)&&i.bufferView>t&&i.bufferView--}),we.shader(e,function(i){l(i.bufferView)&&i.bufferView>t&&i.bufferView--}),we.image(e,function(i){l(i.bufferView)&&i.bufferView>t&&i.bufferView--}),Or(e,"KHR_draco_mesh_compression")&&we.mesh(e,function(i){we.meshPrimitive(i,function(o){l(o.extensions)&&l(o.extensions.KHR_draco_mesh_compression)&&o.extensions.KHR_draco_mesh_compression.bufferView>t&&o.extensions.KHR_draco_mesh_compression.bufferView--})}),Or(e,"EXT_feature_metadata")){let o=e.extensions.EXT_feature_metadata.featureTables;for(let r in o)if(o.hasOwnProperty(r)){let a=o[r].properties;if(l(a)){for(let c in a)if(a.hasOwnProperty(c)){let d=a[c];l(d.bufferView)&&d.bufferView>t&&d.bufferView--,l(d.arrayOffsetBufferView)&&d.arrayOffsetBufferView>t&&d.arrayOffsetBufferView--,l(d.stringOffsetBufferView)&&d.stringOffsetBufferView>t&&d.stringOffsetBufferView--}}}}if(Or(e,"EXT_structural_metadata")){let o=e.extensions.EXT_structural_metadata.propertyTables;if(l(o)){let r=o.length;for(let s=0;st&&u.values--,l(u.arrayOffsets)&&u.arrayOffsets>t&&u.arrayOffsets--,l(u.stringOffsets)&&u.stringOffsets>t&&u.stringOffsets--}}}}};Hp.image=function(e,t){e.images.splice(t,1),we.texture(e,function(i){l(i.source)&&i.source>t&&--i.source;let o=i.extensions;l(o)&&l(o.EXT_texture_webp)&&o.EXT_texture_webp.source>t?--i.extensions.EXT_texture_webp.source:l(o)&&l(o.KHR_texture_basisu)&&o.KHR_texture_basisu.source>t&&--i.extensions.KHR_texture_basisu.source})};Hp.mesh=function(e,t){e.meshes.splice(t,1),we.node(e,function(i){l(i.mesh)&&(i.mesh>t?i.mesh--:i.mesh===t&&delete i.mesh)})};Hp.node=function(e,t){e.nodes.splice(t,1),we.skin(e,function(i){l(i.skeleton)&&i.skeleton>t&&i.skeleton--,i.joints=i.joints.map(function(o){return o>t?o-1:o})}),we.animation(e,function(i){we.animationChannel(i,function(o){l(o.target)&&l(o.target.node)&&o.target.node>t&&o.target.node--})}),we.technique(e,function(i){we.techniqueUniform(i,function(o){l(o.node)&&o.node>t&&o.node--})}),we.node(e,function(i){l(i.children)&&(i.children=i.children.filter(function(o){return o!==t}).map(function(o){return o>t?o-1:o}))}),we.scene(e,function(i){i.nodes=i.nodes.filter(function(o){return o!==t}).map(function(o){return o>t?o-1:o})})};Hp.material=function(e,t){e.materials.splice(t,1),we.mesh(e,function(i){we.meshPrimitive(i,function(o){l(o.material)&&o.material>t&&o.material--})})};Hp.sampler=function(e,t){e.samplers.splice(t,1),we.texture(e,function(i){l(i.sampler)&&i.sampler>t&&--i.sampler})};Hp.texture=function(e,t){if(e.textures.splice(t,1),we.material(e,function(i){YC(i,function(o,r){r.index>t&&--r.index})}),Or(e,"EXT_feature_metadata")){we.mesh(e,function(r){we.meshPrimitive(r,function(s){let a=s.extensions;if(l(a)&&l(a.EXT_feature_metadata)){let d=a.EXT_feature_metadata.featureIdTextures;if(l(d)){let u=d.length;for(let m=0;mt&&--b.index}}}})});let o=e.extensions.EXT_feature_metadata.featureTextures;for(let r in o)if(o.hasOwnProperty(r)){let a=o[r].properties;if(l(a)){for(let c in a)if(a.hasOwnProperty(c)){let u=a[c].texture;u.index>t&&--u.index}}}}if(Or(e,"EXT_mesh_features")&&we.mesh(e,function(i){we.meshPrimitive(i,function(o){let r=o.extensions;if(l(r)&&l(r.EXT_mesh_features)){let a=r.EXT_mesh_features.featureIds;if(l(a)){let c=a.length;for(let d=0;dt&&--u.texture.index}}}})}),Or(e,"EXT_structural_metadata")){let o=e.extensions.EXT_structural_metadata.propertyTextures;if(l(o)){let r=o.length;for(let s=0;st&&--u.index}}}}};function Kp(){}Kp.accessor=function(e){let t={};return we.mesh(e,function(n){we.meshPrimitive(n,function(i){we.meshPrimitiveAttribute(i,function(r){t[r]=!0}),we.meshPrimitiveTarget(i,function(r){we.meshPrimitiveTargetAttribute(r,function(s){t[s]=!0})});let o=i.indices;l(o)&&(t[o]=!0)})}),we.skin(e,function(n){l(n.inverseBindMatrices)&&(t[n.inverseBindMatrices]=!0)}),we.animation(e,function(n){we.animationSampler(n,function(i){l(i.input)&&(t[i.input]=!0),l(i.output)&&(t[i.output]=!0)})}),Or(e,"EXT_mesh_gpu_instancing")&&we.node(e,function(n){l(n.extensions)&&l(n.extensions.EXT_mesh_gpu_instancing)&&Object.keys(n.extensions.EXT_mesh_gpu_instancing.attributes).forEach(function(i){let o=n.extensions.EXT_mesh_gpu_instancing.attributes[i];t[o]=!0})}),Or(e,"CESIUM_primitive_outline")&&we.mesh(e,function(n){we.meshPrimitive(n,function(i){let o=i.extensions;if(l(o)&&l(o.CESIUM_primitive_outline)){let s=o.CESIUM_primitive_outline.indices;l(s)&&(t[s]=!0)}})}),t};Kp.buffer=function(e){let t={};return we.bufferView(e,function(n){l(n.buffer)&&(t[n.buffer]=!0);let i=n.extensions;if(l(i)){let o=i.EXT_meshopt_compression;l(o)&&(t[o.buffer]=!0);let r=i.KHR_meshopt_compression;l(r)&&(t[r.buffer]=!0)}}),t};Kp.bufferView=function(e){let t={};if(we.accessor(e,function(n){l(n.bufferView)&&(t[n.bufferView]=!0)}),we.shader(e,function(n){l(n.bufferView)&&(t[n.bufferView]=!0)}),we.image(e,function(n){l(n.bufferView)&&(t[n.bufferView]=!0)}),Or(e,"KHR_draco_mesh_compression")&&we.mesh(e,function(n){we.meshPrimitive(n,function(i){l(i.extensions)&&l(i.extensions.KHR_draco_mesh_compression)&&(t[i.extensions.KHR_draco_mesh_compression.bufferView]=!0)})}),Or(e,"EXT_feature_metadata")){let i=e.extensions.EXT_feature_metadata.featureTables;for(let o in i)if(i.hasOwnProperty(o)){let s=i[o].properties;if(l(s)){for(let a in s)if(s.hasOwnProperty(a)){let c=s[a];l(c.bufferView)&&(t[c.bufferView]=!0),l(c.arrayOffsetBufferView)&&(t[c.arrayOffsetBufferView]=!0),l(c.stringOffsetBufferView)&&(t[c.stringOffsetBufferView]=!0)}}}}if(Or(e,"EXT_structural_metadata")){let i=e.extensions.EXT_structural_metadata.propertyTables;if(l(i)){let o=i.length;for(let r=0;r0&&(t[n.mesh]=!0)}}),t};function cTe(e,t,n){let i=e.nodes[t];return l(i.mesh)||l(i.camera)||l(i.skin)||l(i.weights)||l(i.extras)||l(i.extensions)&&Object.keys(i.extensions).length!==0||l(n[t])?!1:!l(i.children)||i.children.filter(function(o){return!cTe(e,o,n)}).length===0}Kp.node=function(e){let t={};return we.skin(e,function(n){l(n.skeleton)&&(t[n.skeleton]=!0),we.skinJoint(n,function(i){t[i]=!0})}),we.animation(e,function(n){we.animationChannel(n,function(i){l(i.target)&&l(i.target.node)&&(t[i.target.node]=!0)})}),we.technique(e,function(n){we.techniqueUniform(n,function(i){l(i.node)&&(t[i.node]=!0)})}),we.node(e,function(n,i){cTe(e,i,t)||(t[i]=!0)}),t};Kp.material=function(e){let t={};return we.mesh(e,function(n){we.meshPrimitive(n,function(i){l(i.material)&&(t[i.material]=!0)})}),t};Kp.texture=function(e){let t={};if(we.material(e,function(n){YC(n,function(i){t[i]=!0})}),Or(e,"EXT_feature_metadata")){we.mesh(e,function(o){we.meshPrimitive(o,function(r){let s=r.extensions;if(l(s)&&l(s.EXT_feature_metadata)){let c=s.EXT_feature_metadata.featureIdTextures;if(l(c)){let d=c.length;for(let u=0;u0)for(s.mesh=n.meshes[c[0]],t=1;t0&&l(s.skin)){let u=e.skins[s.skin];u.skeleton=n.nodes[c[0]]}delete s.skeletons}l(s.jointName)&&delete s.jointName}),we.skin(e,function(s){l(s.inverseBindMatrices)&&(s.inverseBindMatrices=n.accessors[s.inverseBindMatrices]);let a=s.jointNames;if(l(a)){let c=[],d=a.length;for(t=0;t=0&&(a=r.substring(0,s),c=r.substring(s));let d,u=zet[a];l(u)?(d=u+c,t[r]=d):l(Bet[a])||(d=`_${r}`,t[r]=d)}});for(let o in t)if(Object.prototype.hasOwnProperty.call(t,o)){let r=t[o],s=i.attributes[o];l(s)&&(delete i.attributes[o],i.attributes[r]=s)}})}),we.technique(e,function(n){we.techniqueParameter(n,function(i){let o=t[i.semantic];l(o)&&(i.semantic=o)})})}function Ket(e){we.camera(e,function(t){let n=t.perspective;if(l(n)){let i=n.aspectRatio;l(i)&&i===0&&delete n.aspectRatio;let o=n.yfov;l(o)&&o===0&&(n.yfov=1)}})}function A7(e,t){return l(t.byteStride)&&t.byteStride!==0?t.byteStride:Yd(e,t)}function Jet(e){we.buffer(e,function(t){l(t.byteLength)||(t.byteLength=t.extras._pipeline.source.length)}),we.accessor(e,function(t){let n=t.bufferView;if(l(n)){let i=e.bufferViews[n],o=A7(e,t),r=t.byteOffset+t.count*o;i.byteLength=Math.max(i.byteLength??0,r)}})}function jet(e){let t,n,i,o=e.bufferViews,r={};we.accessorContainingVertexAttributeData(e,function(a){let c=e.accessors[a];l(c.bufferView)&&(r[c.bufferView]=!0)});let s={};we.accessor(e,function(a){l(a.bufferView)&&(s[a.bufferView]=s[a.bufferView]??[],s[a.bufferView].push(a))});for(let a in s)if(Object.prototype.hasOwnProperty.call(s,a)){i=o[a];let c=s[a];c.sort(function(p,b){return p.byteOffset-b.byteOffset});let d=0,u=0,m=c.length;for(t=0;t=0;--r)if(i[r]===t){i.splice(r,1);return}}}),we.node(e,function(n,i){if(l(n.children)){let o=n.children.indexOf(t);o>-1&&(n.children.splice(o,1),mTe(n)&&hTe(e,i))}}),delete e.nodes[t]}function qet(e){return we.node(e,function(t,n){mTe(t)&&hTe(e,n)}),e}function $et(e){we.animation(e,function(t){we.animationSampler(t,function(n){let i=e.accessors[n.input];if(!l(i.min)||!l(i.max)){let o=CS(e,i);i.min=o.min,i.max=o.max}})})}function ett(e){we.accessor(e,function(t){if(l(t.min)||l(t.max)){let n=CS(e,t);l(t.min)&&(t.min=n.min),l(t.max)&&(t.max=n.max)}})}function ttt(e){e.asset=e.asset??{},e.asset.version="2.0",uTe(e),Pet(e),qet(e),Xet(e),Net(e),Met(e),ket(e),Jet(e),jet(e),Qet(e),$et(e),ett(e),Uet(e),Det(e),Oet(e),Het(e),cP(e),Ket(e),nP(e),oP(e),Yet(e)}var ntt=["u_tex","u_diffuse","u_emission","u_diffuse_tex"],itt=["u_diffuse","u_diffuse_mat"];function G7(e){e.pbrMetallicRoughness=l(e.pbrMetallicRoughness)?e.pbrMetallicRoughness:{},e.pbrMetallicRoughness.roughnessFactor=1,e.pbrMetallicRoughness.metallicFactor=0}function L7(e){return l(e.index)}function W7(e){return Array.isArray(e)&&e.length===4}function fTe(e){let t=new Array(4);t[3]=e[3];for(let n=0;n<3;n++){let i=e[n];i<=.04045?t[n]=e[n]*.07739938080495357:t[n]=Math.pow((i+.055)*.9478672985781991,2.4)}return t}function ott(e,t){t=t??{};let n=t.baseColorTextureNames??ntt,i=t.baseColorFactorNames??itt;we.material(e,function(o){we.materialValue(o,function(r,s){n.indexOf(s)!==-1&&L7(r)?(G7(o),o.pbrMetallicRoughness.baseColorTexture=r):i.indexOf(s)!==-1&&W7(r)&&(G7(o),o.pbrMetallicRoughness.baseColorFactor=fTe(r))})}),VS(e,"KHR_techniques_webgl"),VS(e,"KHR_blend")}function E7(e,t){l(t)&&(W7(t)?e.pbrMetallicRoughness.baseColorFactor=fTe(t):L7(t)&&(e.pbrMetallicRoughness.baseColorTexture=t))}function dTe(e,t){l(t)&&(W7(t)?e.emissiveFactor=t.slice(0,3):L7(t)&&(e.emissiveTexture=t))}function rtt(e){we.material(e,function(t){let n=(t.extensions??{}).KHR_materials_common;if(!l(n))return;let i=n.values??{},o=i.ambient,r=i.diffuse,s=i.emission,a=i.transparency,c=n.doubleSided,d=n.transparent;G7(t),n.technique==="CONSTANT"?(Hm(e,"KHR_materials_unlit"),t.extensions=l(t.extensions)?t.extensions:{},t.extensions.KHR_materials_unlit={},E7(t,s),E7(t,o)):(E7(t,r),dTe(t,o),dTe(t,s)),l(c)&&(t.doubleSided=c),l(a)&&(l(t.pbrMetallicRoughness.baseColorFactor)?t.pbrMetallicRoughness.baseColorFactor[3]*=a:t.pbrMetallicRoughness.baseColorFactor=[1,1,1,a]),l(d)&&(t.alphaMode=d?"BLEND":"OPAQUE")}),VS(e,"KHR_materials_common")}var lP=Get;var aqn=x(T(),1);var K7n=x(T(),1);var Jp={X:0,Y:1,Z:2};Jp.Y_UP_TO_Z_UP=P.fromRotationTranslation(q.fromArray([1,0,0,0,0,1,0,-1,0]));Jp.Z_UP_TO_Y_UP=P.fromRotationTranslation(q.fromArray([1,0,0,0,0,-1,0,1,0]));Jp.X_UP_TO_Z_UP=P.fromRotationTranslation(q.fromArray([0,0,1,0,1,0,-1,0,0]));Jp.Z_UP_TO_X_UP=P.fromRotationTranslation(q.fromArray([0,0,-1,0,1,0,1,0,0]));Jp.X_UP_TO_Y_UP=P.fromRotationTranslation(q.fromArray([0,1,0,-1,0,0,0,0,1]));Jp.Y_UP_TO_X_UP=P.fromRotationTranslation(q.fromArray([0,-1,0,1,0,0,0,0,1]));Jp.fromName=function(e){return Jp[e]};Object.freeze(Jp);var Bi=Jp;function dl(){}dl.getError=function(e,t,n){let i=`Failed to load ${e}: ${t}`;l(n)&&l(n.message)&&(i+=` ${n.message}`);let o=new ae(i);return l(n)&&(o.stack=`Original stack: ${n.stack} Handler stack: -${o.stack}`),o};il.getNodeTransform=function(e){return l(e.matrix)?e.matrix:P.fromTranslationQuaternionRotationScale(l(e.translation)?e.translation:h.ZERO,l(e.rotation)?e.rotation:Ne.IDENTITY,l(e.scale)?e.scale:h.ONE)};il.getAttributeBySemantic=function(e,t,n){let i=e.attributes,o=i.length;for(let r=0;rX8e);var d=de(w0e.url)}var u="./this.program",m=w0e.url;if(c)d("node:fs"),m.startsWith("file:")&&d("node:path").dirname(d("node:url").fileURLToPath(m)),1>8&et;return Ve}var _,S,Z,R,C,E,A,L,F,I,N,g,V=!1;function G(){var de=KT.buffer;Z=new Int8Array(de),C=new Int16Array(de),r.HEAPU8=R=new Uint8Array(de),E=new Uint16Array(de),A=new Int32Array(de),L=new Uint32Array(de),r.HEAPF32=F=new Float32Array(de),I=new Float64Array(de),N=new BigInt64Array(de),g=new BigUint64Array(de)}function v(de){var oe;throw(oe=r.onAbort)==null||oe.call(r,de),de="Aborted("+de+")",b(de),f=!0,de=new WebAssembly.RuntimeError(de+". Build with -sASSERTIONS for more info."),S?.(de),de}var X;async function Y(de){return de}async function D(de){var oe=X;try{var Re=await Y(oe);return await WebAssembly.instantiate(Re,de)}catch(Ve){b(`failed to asynchronously prepare wasm: ${Ve}`),v(Ve)}}async function M(de){return D(de)}var O=de=>{for(;0{var de=r.preRun.shift();z.push(de)},te={},H=de=>{for(;de.length;){var oe=de.pop();de.pop()(oe)}};function $(de){return this.O(L[de>>2])}var ee={},le={},_e={},he=class extends Error{constructor(de){super(de),this.name="InternalError"}},Ze=(de,oe,Re)=>{function Ve(Gt){if(Gt=Re(Gt),Gt.length!==de.length)throw new he("Mismatched type converter count");for(var Sn=0;Sn_e[Gt]=oe);var et=Array(oe.length),Ct=[],gt=0;for(let[Gt,Sn]of oe.entries())le.hasOwnProperty(Sn)?et[Gt]=le[Sn]:(Ct.push(Sn),ee.hasOwnProperty(Sn)||(ee[Sn]=[]),ee[Sn].push(()=>{et[Gt]=le[Sn],++gt,gt===Ct.length&&Ve(et)}));Ct.length===0&&Ve(et)},ye=de=>{for(var oe="";;){var Re=R[de++];if(!Re)return oe;oe+=String.fromCharCode(Re)}},Ge=class extends Error{constructor(de){super(de),this.name="BindingError"}},Ae=de=>{throw new Ge(de)};function Fe(de,oe,Re={}){var Ve=oe.name;if(!de)throw new Ge(`type "${Ve}" must have a positive integer typeid pointer`);if(le.hasOwnProperty(de)){if(Re.Aa)return;throw new Ge(`Cannot register type '${Ve}' twice`)}le[de]=oe,delete _e[de],ee.hasOwnProperty(de)&&(oe=ee[de],delete ee[de],oe.forEach(et=>et()))}function tt(de,oe,Re={}){return Fe(de,oe,Re)}var Be=(de,oe,Re)=>{switch(oe){case 1:return Re?Ve=>Z[Ve]:Ve=>R[Ve];case 2:return Re?Ve=>C[Ve>>1]:Ve=>E[Ve>>1];case 4:return Re?Ve=>A[Ve>>2]:Ve=>L[Ve>>2];case 8:return Re?Ve=>N[Ve>>3]:Ve=>g[Ve>>3];default:throw new TypeError(`invalid integer width (${oe}): ${de}`)}},je=de=>{throw new Ge(de.M.R.N.name+" instance already deleted")},qe=!1,We=()=>{},Ke=de=>globalThis.FinalizationRegistry?(qe=new FinalizationRegistry(oe=>{oe=oe.M,--oe.count.value,oe.count.value===0&&(oe.V?oe.Y.Z(oe.V):oe.R.N.Z(oe.P))}),Ke=oe=>{var Re=oe.M;return Re.V&&qe.register(oe,{M:Re},oe),oe},We=oe=>{qe.unregister(oe)},Ke(de)):(Ke=oe=>oe,de);function ct(){}var Et=(de,oe)=>Object.defineProperty(oe,"name",{value:de}),zt={},ut=(de,oe,Re)=>{if(de[oe].U===void 0){var Ve=de[oe];de[oe]=function(...et){if(!de[oe].U.hasOwnProperty(et.length))throw new Ge(`Function '${Re}' called with an invalid number of arguments (${et.length}) - expects one of (${de[oe].U})!`);return de[oe].U[et.length].apply(this,et)},de[oe].U=[],de[oe].U[Ve.$]=Ve}},bt=(de,oe,Re)=>{if(r.hasOwnProperty(de)){if(Re===void 0||r[de].U!==void 0&&r[de].U[Re]!==void 0)throw new Ge(`Cannot register public name '${de}' twice`);if(ut(r,de,de),r[de].U.hasOwnProperty(Re))throw new Ge(`Cannot register multiple overloads of a function with the same number of arguments (${Re})!`);r[de].U[Re]=oe}else r[de]=oe,r[de].$=Re},ht=de=>{de=de.replace(/[^a-zA-Z0-9_]/g,"$");var oe=de.charCodeAt(0);return 48<=oe&&57>=oe?`_${de}`:de};function jt(de,oe,Re,Ve,et,Ct,gt,Gt){this.name=de,this.constructor=oe,this.ba=Re,this.Z=Ve,this.W=et,this.va=Ct,this.fa=gt,this.ta=Gt,this.Ca=[]}var st=(de,oe,Re)=>{for(;oe!==Re;){if(!oe.fa)throw new Ge(`Expected null or instance of ${Re.name}, got an instance of ${oe.name}`);de=oe.fa(de),oe=oe.W}return de},pt=de=>{if(de===null)return"null";var oe=typeof de;return oe==="object"||oe==="array"||oe==="function"?de.toString():""+de};function Mi(de,oe){if(oe===null){if(this.ia)throw new Ge(`null is not a valid ${this.name}`);return 0}if(!oe.M)throw new Ge(`Cannot pass "${pt(oe)}" as a ${this.name}`);if(!oe.M.P)throw new Ge(`Cannot pass deleted object as a pointer of type ${this.name}`);return st(oe.M.P,oe.M.R.N,this.N)}function jn(de,oe){if(oe===null){if(this.ia)throw new Ge(`null is not a valid ${this.name}`);if(this.ha){var Re=this.ka();return de!==null&&de.push(this.Z,Re),Re}return 0}if(!oe||!oe.M)throw new Ge(`Cannot pass "${pt(oe)}" as a ${this.name}`);if(!oe.M.P)throw new Ge(`Cannot pass deleted object as a pointer of type ${this.name}`);if(!this.ga&&oe.M.R.ga)throw new Ge(`Cannot convert argument of type ${oe.M.Y?oe.M.Y.name:oe.M.R.name} to parameter type ${this.name}`);if(Re=st(oe.M.P,oe.M.R.N,this.N),this.ha){if(oe.M.V===void 0)throw new Ge("Passing raw pointer to smart pointer is illegal");switch(this.Ha){case 0:if(oe.M.Y===this)Re=oe.M.V;else throw new Ge(`Cannot convert argument of type ${oe.M.Y?oe.M.Y.name:oe.M.R.name} to parameter type ${this.name}`);break;case 1:Re=oe.M.V;break;case 2:if(oe.M.Y===this)Re=oe.M.V;else{var Ve=oe.clone();Re=this.Da(Re,Ki(()=>Ve.delete())),de!==null&&de.push(this.Z,Re)}break;default:throw new Ge("Unsupported sharing policy")}}return Re}function Si(de,oe){if(oe===null){if(this.ia)throw new Ge(`null is not a valid ${this.name}`);return 0}if(!oe.M)throw new Ge(`Cannot pass "${pt(oe)}" as a ${this.name}`);if(!oe.M.P)throw new Ge(`Cannot pass deleted object as a pointer of type ${this.name}`);if(oe.M.R.ga)throw new Ge(`Cannot convert argument of type ${oe.M.R.name} to parameter type ${this.name}`);return st(oe.M.P,oe.M.R.N,this.N)}var Hi=(de,oe,Re)=>oe===Re?de:Re.W===void 0?null:(de=Hi(de,oe,Re.W),de===null?null:Re.ta(de)),Gi={},pi=(de,oe)=>{if(oe===void 0)throw new Ge("ptr should not be undefined");for(;de.W;)oe=de.fa(oe),de=de.W;return Gi[oe]},Zi=(de,oe)=>{if(!oe.R||!oe.P)throw new he("makeClassHandle requires ptr and ptrType");if(!!oe.Y!=!!oe.V)throw new he("Both smartPtrType and smartPtr must be specified");return oe.count={value:1},Ke(Object.create(de,{M:{value:oe,writable:!0}}))};function On(de,oe,Re,Ve,et,Ct,gt,Gt,Sn,Kn,xn){this.name=de,this.N=oe,this.ia=Re,this.ga=Ve,this.ha=et,this.Ba=Ct,this.Ha=gt,this.pa=Gt,this.ka=Sn,this.Da=Kn,this.Z=xn,et||oe.W!==void 0?this.S=jn:(this.S=Ve?Mi:Si,this.T=null)}var rn=(de,oe,Re)=>{if(!r.hasOwnProperty(de))throw new he("Replacing nonexistent public symbol");r[de].U!==void 0&&Re!==void 0?r[de].U[Re]=oe:(r[de]=oe,r[de].$=Re)},Hn=(de,oe)=>{de=ye(de);var Re=DA.get(oe);if(typeof Re!="function")throw new Ge(`unknown function pointer with signature ${de}: ${oe}`);return Re};class $i extends Error{}var Po=de=>{de=HT(de);var oe=ye(de);return Tp(de),oe},hr=(de,oe)=>{function Re(Ct){et[Ct]||le[Ct]||(_e[Ct]?_e[Ct].forEach(Re):(Ve.push(Ct),et[Ct]=!0))}var Ve=[],et={};throw oe.forEach(Re),new $i(`${de}: `+Ve.map(Po).join([", "]))},Is=(de,oe)=>{for(var Re=[],Ve=0;Ve>2]);return Re};function Hs(de){for(var oe=1;oegt)throw new Ge("argTypes array size mismatch! Must at least get return value and 'this' types!");var Gt=oe[1]!==null&&Re!==null,Sn=Hs(oe);Re=!oe[0].oa;var Kn=oe[0],xn=oe[1];for(Ve=[de,Ae,Ve,et,H,Kn.O.bind(Kn),xn?.S.bind(xn)],et=2;etWtt);var d=de(xTe.url)}var u="./this.program",m=xTe.url;if(c)d("node:fs"),m.startsWith("file:")&&d("node:path").dirname(d("node:url").fileURLToPath(m)),1>8&et;return Ve}var _,S,Z,R,C,E,A,L,F,I,N,g,V=!1;function G(){var de=KT.buffer;Z=new Int8Array(de),C=new Int16Array(de),r.HEAPU8=R=new Uint8Array(de),E=new Uint16Array(de),A=new Int32Array(de),L=new Uint32Array(de),r.HEAPF32=F=new Float32Array(de),I=new Float64Array(de),N=new BigInt64Array(de),g=new BigUint64Array(de)}function v(de){var oe;throw(oe=r.onAbort)==null||oe.call(r,de),de="Aborted("+de+")",b(de),f=!0,de=new WebAssembly.RuntimeError(de+". Build with -sASSERTIONS for more info."),S?.(de),de}var X;async function Y(de){return de}async function D(de){var oe=X;try{var Re=await Y(oe);return await WebAssembly.instantiate(Re,de)}catch(Ve){b(`failed to asynchronously prepare wasm: ${Ve}`),v(Ve)}}async function M(de){return D(de)}var O=de=>{for(;0{var de=r.preRun.shift();z.push(de)},te={},H=de=>{for(;de.length;){var oe=de.pop();de.pop()(oe)}};function $(de){return this.O(L[de>>2])}var ee={},le={},_e={},he=class extends Error{constructor(de){super(de),this.name="InternalError"}},Ze=(de,oe,Re)=>{function Ve(Gt){if(Gt=Re(Gt),Gt.length!==de.length)throw new he("Mismatched type converter count");for(var Sn=0;Sn_e[Gt]=oe);var et=Array(oe.length),Ct=[],gt=0;for(let[Gt,Sn]of oe.entries())le.hasOwnProperty(Sn)?et[Gt]=le[Sn]:(Ct.push(Sn),ee.hasOwnProperty(Sn)||(ee[Sn]=[]),ee[Sn].push(()=>{et[Gt]=le[Sn],++gt,gt===Ct.length&&Ve(et)}));Ct.length===0&&Ve(et)},ye=de=>{for(var oe="";;){var Re=R[de++];if(!Re)return oe;oe+=String.fromCharCode(Re)}},Ge=class extends Error{constructor(de){super(de),this.name="BindingError"}},Ae=de=>{throw new Ge(de)};function Fe(de,oe,Re={}){var Ve=oe.name;if(!de)throw new Ge(`type "${Ve}" must have a positive integer typeid pointer`);if(le.hasOwnProperty(de)){if(Re.Aa)return;throw new Ge(`Cannot register type '${Ve}' twice`)}le[de]=oe,delete _e[de],ee.hasOwnProperty(de)&&(oe=ee[de],delete ee[de],oe.forEach(et=>et()))}function tt(de,oe,Re={}){return Fe(de,oe,Re)}var Be=(de,oe,Re)=>{switch(oe){case 1:return Re?Ve=>Z[Ve]:Ve=>R[Ve];case 2:return Re?Ve=>C[Ve>>1]:Ve=>E[Ve>>1];case 4:return Re?Ve=>A[Ve>>2]:Ve=>L[Ve>>2];case 8:return Re?Ve=>N[Ve>>3]:Ve=>g[Ve>>3];default:throw new TypeError(`invalid integer width (${oe}): ${de}`)}},je=de=>{throw new Ge(de.M.R.N.name+" instance already deleted")},qe=!1,We=()=>{},Ke=de=>globalThis.FinalizationRegistry?(qe=new FinalizationRegistry(oe=>{oe=oe.M,--oe.count.value,oe.count.value===0&&(oe.V?oe.Y.Z(oe.V):oe.R.N.Z(oe.P))}),Ke=oe=>{var Re=oe.M;return Re.V&&qe.register(oe,{M:Re},oe),oe},We=oe=>{qe.unregister(oe)},Ke(de)):(Ke=oe=>oe,de);function ct(){}var Et=(de,oe)=>Object.defineProperty(oe,"name",{value:de}),zt={},ut=(de,oe,Re)=>{if(de[oe].U===void 0){var Ve=de[oe];de[oe]=function(...et){if(!de[oe].U.hasOwnProperty(et.length))throw new Ge(`Function '${Re}' called with an invalid number of arguments (${et.length}) - expects one of (${de[oe].U})!`);return de[oe].U[et.length].apply(this,et)},de[oe].U=[],de[oe].U[Ve.$]=Ve}},bt=(de,oe,Re)=>{if(r.hasOwnProperty(de)){if(Re===void 0||r[de].U!==void 0&&r[de].U[Re]!==void 0)throw new Ge(`Cannot register public name '${de}' twice`);if(ut(r,de,de),r[de].U.hasOwnProperty(Re))throw new Ge(`Cannot register multiple overloads of a function with the same number of arguments (${Re})!`);r[de].U[Re]=oe}else r[de]=oe,r[de].$=Re},ht=de=>{de=de.replace(/[^a-zA-Z0-9_]/g,"$");var oe=de.charCodeAt(0);return 48<=oe&&57>=oe?`_${de}`:de};function jt(de,oe,Re,Ve,et,Ct,gt,Gt){this.name=de,this.constructor=oe,this.ba=Re,this.Z=Ve,this.W=et,this.va=Ct,this.fa=gt,this.ta=Gt,this.Ca=[]}var st=(de,oe,Re)=>{for(;oe!==Re;){if(!oe.fa)throw new Ge(`Expected null or instance of ${Re.name}, got an instance of ${oe.name}`);de=oe.fa(de),oe=oe.W}return de},pt=de=>{if(de===null)return"null";var oe=typeof de;return oe==="object"||oe==="array"||oe==="function"?de.toString():""+de};function Mi(de,oe){if(oe===null){if(this.ia)throw new Ge(`null is not a valid ${this.name}`);return 0}if(!oe.M)throw new Ge(`Cannot pass "${pt(oe)}" as a ${this.name}`);if(!oe.M.P)throw new Ge(`Cannot pass deleted object as a pointer of type ${this.name}`);return st(oe.M.P,oe.M.R.N,this.N)}function jn(de,oe){if(oe===null){if(this.ia)throw new Ge(`null is not a valid ${this.name}`);if(this.ha){var Re=this.ka();return de!==null&&de.push(this.Z,Re),Re}return 0}if(!oe||!oe.M)throw new Ge(`Cannot pass "${pt(oe)}" as a ${this.name}`);if(!oe.M.P)throw new Ge(`Cannot pass deleted object as a pointer of type ${this.name}`);if(!this.ga&&oe.M.R.ga)throw new Ge(`Cannot convert argument of type ${oe.M.Y?oe.M.Y.name:oe.M.R.name} to parameter type ${this.name}`);if(Re=st(oe.M.P,oe.M.R.N,this.N),this.ha){if(oe.M.V===void 0)throw new Ge("Passing raw pointer to smart pointer is illegal");switch(this.Ha){case 0:if(oe.M.Y===this)Re=oe.M.V;else throw new Ge(`Cannot convert argument of type ${oe.M.Y?oe.M.Y.name:oe.M.R.name} to parameter type ${this.name}`);break;case 1:Re=oe.M.V;break;case 2:if(oe.M.Y===this)Re=oe.M.V;else{var Ve=oe.clone();Re=this.Da(Re,Ki(()=>Ve.delete())),de!==null&&de.push(this.Z,Re)}break;default:throw new Ge("Unsupported sharing policy")}}return Re}function Si(de,oe){if(oe===null){if(this.ia)throw new Ge(`null is not a valid ${this.name}`);return 0}if(!oe.M)throw new Ge(`Cannot pass "${pt(oe)}" as a ${this.name}`);if(!oe.M.P)throw new Ge(`Cannot pass deleted object as a pointer of type ${this.name}`);if(oe.M.R.ga)throw new Ge(`Cannot convert argument of type ${oe.M.R.name} to parameter type ${this.name}`);return st(oe.M.P,oe.M.R.N,this.N)}var Hi=(de,oe,Re)=>oe===Re?de:Re.W===void 0?null:(de=Hi(de,oe,Re.W),de===null?null:Re.ta(de)),Gi={},pi=(de,oe)=>{if(oe===void 0)throw new Ge("ptr should not be undefined");for(;de.W;)oe=de.fa(oe),de=de.W;return Gi[oe]},Zi=(de,oe)=>{if(!oe.R||!oe.P)throw new he("makeClassHandle requires ptr and ptrType");if(!!oe.Y!=!!oe.V)throw new he("Both smartPtrType and smartPtr must be specified");return oe.count={value:1},Ke(Object.create(de,{M:{value:oe,writable:!0}}))};function On(de,oe,Re,Ve,et,Ct,gt,Gt,Sn,Kn,xn){this.name=de,this.N=oe,this.ia=Re,this.ga=Ve,this.ha=et,this.Ba=Ct,this.Ha=gt,this.pa=Gt,this.ka=Sn,this.Da=Kn,this.Z=xn,et||oe.W!==void 0?this.S=jn:(this.S=Ve?Mi:Si,this.T=null)}var rn=(de,oe,Re)=>{if(!r.hasOwnProperty(de))throw new he("Replacing nonexistent public symbol");r[de].U!==void 0&&Re!==void 0?r[de].U[Re]=oe:(r[de]=oe,r[de].$=Re)},Hn=(de,oe)=>{de=ye(de);var Re=DA.get(oe);if(typeof Re!="function")throw new Ge(`unknown function pointer with signature ${de}: ${oe}`);return Re};class $i extends Error{}var Po=de=>{de=HT(de);var oe=ye(de);return Tp(de),oe},hr=(de,oe)=>{function Re(Ct){et[Ct]||le[Ct]||(_e[Ct]?_e[Ct].forEach(Re):(Ve.push(Ct),et[Ct]=!0))}var Ve=[],et={};throw oe.forEach(Re),new $i(`${de}: `+Ve.map(Po).join([", "]))},Is=(de,oe)=>{for(var Re=[],Ve=0;Ve>2]);return Re};function Hs(de){for(var oe=1;oegt)throw new Ge("argTypes array size mismatch! Must at least get return value and 'this' types!");var Gt=oe[1]!==null&&Re!==null,Sn=Hs(oe);Re=!oe[0].oa;var Kn=oe[0],xn=oe[1];for(Ve=[de,Ae,Ve,et,H,Kn.O.bind(Kn),xn?.S.bind(xn)],et=2;et{de=de.trim();let oe=de.indexOf("(");return oe===-1?de:de.slice(0,oe)},fr=[],mo=[0,1,,1,null,1,!0,1,!1,1],Qr=de=>{9{if(!de)throw new Ge(`Cannot use deleted val. handle = ${de}`);return mo[de]},Ki=de=>{switch(de){case void 0:return 2;case null:return 4;case!0:return 6;case!1:return 8;default:let oe=fr.pop()||mo.length;return mo[oe]=de,mo[oe+1]=1,oe}},wi={name:"emscripten::val",O:de=>{var oe=Mn(de);return Qr(de),oe},S:(de,oe)=>Ki(oe),X:$,T:null},Xo=(de,oe,Re)=>{switch(oe){case 1:return Re?function(Ve){return this.O(Z[Ve])}:function(Ve){return this.O(R[Ve])};case 2:return Re?function(Ve){return this.O(C[Ve>>1])}:function(Ve){return this.O(E[Ve>>1])};case 4:return Re?function(Ve){return this.O(A[Ve>>2])}:function(Ve){return this.O(L[Ve>>2])};default:throw new TypeError(`invalid integer width (${oe}): ${de}`)}},Dc=(de,oe)=>{var Re=le[de];if(Re===void 0)throw de=`${oe} has unknown type ${Po(de)}`,new Ge(de);return Re},bm=(de,oe)=>{switch(oe){case 4:return function(Re){return this.O(F[Re>>2])};case 8:return function(Re){return this.O(I[Re>>3])};default:throw new TypeError(`invalid float width (${oe}): ${de}`)}},bp=(de,oe,Re)=>{let Ve=(et,Ct)=>{let gt=0;return{next(){if(gt>=et)return{done:!0};let Gt=gt;return gt++,{value:Ct(Gt),done:!1}},[Symbol.iterator](){return this}}};de[Symbol.iterator]||(de[Symbol.iterator]=function(){let et=this[oe]();return Ve(et,Ct=>this[Re](Ct))})},Lh=Object.assign({optional:!0},wi),ua=(de,oe,Re)=>{var Ve=R;if(!(0=gt){if(oe>=Re)break;Ve[oe++]=gt}else if(2047>=gt){if(oe+1>=Re)break;Ve[oe++]=192|gt>>6,Ve[oe++]=128|gt&63}else if(65535>=gt){if(oe+2>=Re)break;Ve[oe++]=224|gt>>12,Ve[oe++]=128|gt>>6&63,Ve[oe++]=128|gt&63}else{if(oe+3>=Re)break;Ve[oe++]=240|gt>>18,Ve[oe++]=128|gt>>12&63,Ve[oe++]=128|gt>>6&63,Ve[oe++]=128|gt&63,Ct++}}return Ve[oe]=0,oe-et},gp=de=>{for(var oe=0,Re=0;Re=Ve?oe++:2047>=Ve?oe+=2:55296<=Ve&&57343>=Ve?(oe+=4,++Re):oe+=3}return oe},Ps=new TextDecoder,$a=(de,oe,Re,Ve)=>{if(Re=oe+Re,Ve)return Re;for(;de[oe]&&!(oe>=Re);)++oe;return oe},BT=new TextDecoder("utf-16le"),si=(de,oe,Re)=>(de>>=1,BT.decode(E.subarray(de,$a(E,de,oe/2,Re)))),qo=(de,oe,Re)=>{if(Re??(Re=2147483647),2>Re)return 0;Re-=2;var Ve=oe;Re=Re<2*de.length?Re/2:de.length;for(var et=0;et>1]=de.charCodeAt(et),oe+=2;return C[oe>>1]=0,oe-Ve},Gl=de=>2*de.length,K0=(de,oe,Re)=>{var Ve="";de>>=2;for(var et=0;!(et>=oe/4);et++){var Ct=L[de+et];if(!Ct&&!Re)break;Ve+=String.fromCodePoint(Ct)}return Ve},va=(de,oe,Re)=>{if(Re??(Re=2147483647),4>Re)return 0;var Ve=oe;Re=Ve+Re-4;for(var et=0;et>2]=Ct,oe+=4,oe+4>Re)break}return A[oe>>2]=0,oe-Ve},yp=de=>{for(var oe=0,Re=0;Re{var oe=Ty.length;return Ty.push(de),oe},rj=(de,oe)=>{for(var Re=Array(de),Ve=0;Ve>2],`parameter ${Ve}`);return Re},sj=(de,oe,Re)=>{var Ve=[];return de=de(Ve,Re),Ve.length&&(L[oe>>2]=Ki(Ve)),de},aj={},xp=de=>{var oe=aj[de];return oe===void 0?ye(de):oe},BR={},zT=()=>{var de;if(!Wh){var oe={USER:"web_user",LOGNAME:"web_user",PATH:"/",PWD:"/",HOME:"/home/web_user",LANG:(((de=globalThis.navigator)==null?void 0:de.language)??"C").replace("-","_")+".UTF-8",_:u||"./this.program"},Re;for(Re in BR)BR[Re]===void 0?delete oe[Re]:oe[Re]=BR[Re];var Ve=[];for(Re in oe)Ve.push(`${Re}=${oe[Re]}`);Wh=Ve}return Wh},Wh,cj=[null,[],[]];if((()=>{let de=ct.prototype;Object.assign(de,{isAliasOf:function(Re){if(!(this instanceof ct&&Re instanceof ct))return!1;var Ve=this.M.R.N,et=this.M.P;Re.M=Re.M;var Ct=Re.M.R.N;for(Re=Re.M.P;Ve.W;)et=Ve.fa(et),Ve=Ve.W;for(;Ct.W;)Re=Ct.fa(Re),Ct=Ct.W;return Ve===Ct&&et===Re},clone:function(){if(this.M.P||je(this),this.M.ea)return this.M.count.value+=1,this;var Re=Ke,Ve=Object,et=Ve.create,Ct=Object.getPrototypeOf(this),gt=this.M;return Re=Re(et.call(Ve,Ct,{M:{value:{count:gt.count,da:gt.da,ea:gt.ea,P:gt.P,R:gt.R,V:gt.V,Y:gt.Y}}})),Re.M.count.value+=1,Re.M.da=!1,Re},delete(){if(this.M.P||je(this),this.M.da&&!this.M.ea)throw new Ge("Object already scheduled for deletion");We(this);var Re=this.M;--Re.count.value,Re.count.value===0&&(Re.V?Re.Y.Z(Re.V):Re.R.N.Z(Re.P)),this.M.ea||(this.M.V=void 0,this.M.P=void 0)},isDeleted:function(){return!this.M.P},deleteLater:function(){if(this.M.P||je(this),this.M.da&&!this.M.ea)throw new Ge("Object already scheduled for deletion");return this.M.da=!0,this}});let oe=Symbol.dispose;oe&&(de[oe]=de.delete)})(),Object.assign(On.prototype,{wa(de){return this.pa&&(de=this.pa(de)),de},ma(de){var oe;(oe=this.Z)==null||oe.call(this,de)},X:$,O:function(de){function oe(){return this.ha?Zi(this.N.ba,{R:this.Ba,P:Re,Y:this,V:de}):Zi(this.N.ba,{R:this,P:de})}var Re=this.wa(de);if(!Re)return this.ma(de),null;var Ve=pi(this.N,Re);if(Ve!==void 0)return Ve.M.count.value===0?(Ve.M.P=Re,Ve.M.V=de,Ve.clone()):(Ve=Ve.clone(),this.ma(de),Ve);if(Ve=this.N.va(Re),Ve=zt[Ve],!Ve)return oe.call(this);Ve=this.ga?Ve.sa:Ve.pointerType;var et=Hi(Re,this.N,Ve.N);return et===null?oe.call(this):this.ha?Zi(Ve.N.ba,{R:Ve,P:et,Y:this,V:de}):Zi(Ve.N.ba,{R:Ve,P:et})}}),r.print&&(p=r.print),r.printErr&&(b=r.printErr),r.thisProgram&&(u=r.thisProgram),r.preInit)for(typeof r.preInit=="function"&&(r.preInit=[r.preInit]);0v(""),r:de=>{var oe=te[de];delete te[de];var Re=oe.ka,Ve=oe.Z,et=oe.na,Ct=et.map(gt=>gt.za).concat(et.map(gt=>gt.Fa));Ze([de],Ct,gt=>{var Gt={},Sn,Kn;for([Sn,Kn]of et.entries()){let xn=gt[Sn],Vr=Kn.xa,pr=Kn.ya,Ks=gt[Sn+et.length],Rc=Kn.Ea,Ll=Kn.Ga;Gt[Kn.ua]={read:_d=>xn.O(Vr(pr,_d)),write:(_d,J0)=>{var Vt=[];Rc(Ll,_d,Ks.S(Vt,J0)),H(Vt)},optional:xn.optional}}return[{name:oe.name,O:xn=>{var Vr={},pr;for(pr in Gt)Vr[pr]=Gt[pr].read(xn);return Ve(xn),Vr},S:(xn,Vr)=>{for(var pr in Gt)if(!(pr in Vr||Gt[pr].optional))throw new TypeError(`Missing field: "${pr}"`);var Ks=Re();for(pr in Gt)Gt[pr].write(Ks,Vr[pr]);return xn!==null&&xn.push(Ve,Ks),Ks},X:$,T:Ve}]})},o:(de,oe,Re,Ve,et)=>{oe=ye(oe),Ve=Ve===0n;let Ct=gt=>gt;if(Ve){let gt=8*Re;Ct=Gt=>BigInt.asUintN(gt,Gt),et=Ct(et)}tt(de,{name:oe,O:Ct,S:(gt,Gt)=>(typeof Gt=="number"&&(Gt=BigInt(Gt)),Gt),X:Be(oe,Re,!Ve),T:null})},C:(de,oe,Re,Ve)=>{oe=ye(oe),tt(de,{name:oe,O:function(et){return!!et},S:function(et,Ct){return Ct?Re:Ve},X:function(et){return this.O(R[et])},T:null})},k:(de,oe,Re,Ve,et,Ct,gt,Gt,Sn,Kn,xn,Vr,pr)=>{xn=ye(xn),Ct=Hn(et,Ct),Gt&&(Gt=Hn(gt,Gt)),Kn&&(Kn=Hn(Sn,Kn)),pr=Hn(Vr,pr);var Ks=ht(xn);bt(Ks,function(){hr(`Cannot construct ${xn} due to unbound types`,[Ve])}),Ze([de,oe,Re],Ve?[Ve]:[],Rc=>{if(Rc=Rc[0],Ve)var Ll=Rc.N,_d=Ll.ba;else _d=ct.prototype;Rc=Et(xn,function(...Ye){if(Object.getPrototypeOf(this)!==J0)throw new Ge(`Use 'new' to construct ${xn}`);if(Vt.aa===void 0)throw new Ge(`${xn} has no accessible constructor`);var yt=Vt.aa[Ye.length];if(yt===void 0)throw new Ge(`Tried to invoke ctor of ${xn} with invalid number of parameters (${Ye.length}) - expected (${Object.keys(Vt.aa).toString()}) parameters instead!`);return yt.apply(this,Ye)});var J0=Object.create(_d,{constructor:{value:Rc}});Rc.prototype=J0;var Vt=new jt(xn,Rc,J0,pr,Ll,Ct,Gt,Kn);if(Vt.W){var Te;(Te=Vt.W).la??(Te.la=[]),Vt.W.la.push(Vt)}return Ll=new On(xn,Vt,!0,!1,!1),Te=new On(xn+"*",Vt,!1,!1,!1),_d=new On(xn+" const*",Vt,!1,!0,!1),zt[de]={pointerType:Te,sa:_d},rn(Ks,Rc),[Ll,Te,_d]})},g:(de,oe,Re,Ve,et,Ct)=>{var gt=Is(oe,Re);et=Hn(Ve,et),Ze([],[de],Gt=>{Gt=Gt[0];var Sn=`constructor ${Gt.name}`;if(Gt.N.aa===void 0&&(Gt.N.aa=[]),Gt.N.aa[oe-1]!==void 0)throw new Ge(`Cannot register multiple constructors with identical number of parameters (${oe-1}) for class '${Gt.name}'! Overload resolution is currently only performed using the parameter count, not actual type info!`);return Gt.N.aa[oe-1]=()=>{hr(`Cannot construct ${Gt.name} due to unbound types`,gt)},Ze([],gt,Kn=>(Kn.splice(1,0,null),Gt.N.aa[oe-1]=or(Sn,Kn,null,et,Ct),[])),[]})},b:(de,oe,Re,Ve,et,Ct,gt,Gt,Sn)=>{var Kn=Is(Re,Ve);oe=ye(oe),oe=yi(oe),Ct=Hn(et,Ct),Ze([],[de],xn=>{function Vr(){hr(`Cannot call ${pr} due to unbound types`,Kn)}xn=xn[0];var pr=`${xn.name}.${oe}`;oe.startsWith("@@")&&(oe=Symbol[oe.substring(2)]),Gt&&xn.N.Ca.push(oe);var Ks=xn.N.ba,Rc=Ks[oe];return Rc===void 0||Rc.U===void 0&&Rc.className!==xn.name&&Rc.$===Re-2?(Vr.$=Re-2,Vr.className=xn.name,Ks[oe]=Vr):(ut(Ks,oe,pr),Ks[oe].U[Re-2]=Vr),Ze([],Kn,Ll=>(Ll=or(pr,Ll,xn,Ct,gt,Sn),Ks[oe].U===void 0?(Ll.$=Re-2,Ks[oe]=Ll):Ks[oe].U[Re-2]=Ll,[])),[]})},A:de=>tt(de,wi),s:(de,oe,Re,Ve,et)=>{switch(oe=ye(oe),et=et===0?"object":et===1?"number":"string",et){case"object":let gt=function(){};gt.values={},tt(de,{name:oe,constructor:gt,valueType:et,O:function(Gt){return this.constructor.values[Gt]},S:(Gt,Sn)=>Sn.value,X:Xo(oe,Re,Ve),T:null}),bt(oe,gt);break;case"number":var Ct={};tt(de,{name:oe,ja:Ct,valueType:et,O:Gt=>Gt,S:(Gt,Sn)=>Sn,X:Xo(oe,Re,Ve),T:null}),bt(oe,Ct),delete r[oe].$;break;case"string":Ct={},tt(de,{name:oe,ra:{},qa:{},ja:Ct,valueType:et,O:function(Gt){return this.qa[Gt]},S:function(Gt,Sn){return this.ra[Sn]},X:Xo(oe,Re,Ve),T:null}),bt(oe,Ct),delete r[oe].$}},d:(de,oe,Re)=>{var Ve=Dc(de,"enum");switch(oe=ye(oe),Ve.valueType){case"object":de=Ve.constructor,Ve=Object.create(Ve.constructor.prototype,{value:{value:Re},constructor:{value:Et(`${Ve.name}_${oe}`,function(){})}}),de.values[Re]=Ve,de[oe]=Ve;break;case"number":Ve.ja[oe]=Re;break;case"string":Ve.ra[oe]=Re,Ve.qa[Re]=oe,Ve.ja[oe]=oe}},n:(de,oe,Re)=>{oe=ye(oe),tt(de,{name:oe,O:Ve=>Ve,S:(Ve,et)=>et,X:bm(oe,Re),T:null})},m:(de,oe,Re,Ve,et,Ct,gt)=>{var Gt=Is(oe,Re);de=ye(de),de=yi(de),et=Hn(Ve,et),bt(de,function(){hr(`Cannot call ${de} due to unbound types`,Gt)},oe-1),Ze([],Gt,Sn=>(Sn=[Sn[0],null].concat(Sn.slice(1)),rn(de,or(de,Sn,null,et,Ct,gt),oe-1),[]))},c:(de,oe,Re,Ve,et)=>{oe=ye(oe);let Ct=Gt=>Gt;if(Ve===0){var gt=32-8*Re;Ct=Gt=>Gt<>>gt,et=Ct(et)}tt(de,{name:oe,O:Ct,S:(Gt,Sn)=>Sn,X:Be(oe,Re,Ve!==0),T:null})},j:(de,oe,Re,Ve)=>{Re=ye(Re),Ve=ye(Ve),Ze([],[de,oe],et=>(bp(et[0].N.ba,Re,Ve),[]))},a:(de,oe,Re)=>{function Ve(Ct){return new et(Z.buffer,L[Ct+4>>2],L[Ct>>2])}var et=[Int8Array,Uint8Array,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array,BigInt64Array,BigUint64Array][oe];Re=ye(Re),tt(de,{name:Re,O:Ve,X:Ve},{Aa:!0})},h:de=>{tt(de,Lh)},B:(de,oe)=>{oe=ye(oe),tt(de,{name:oe,O(Re){var Ve=(Ve=Re+4)?Ps.decode(R.subarray(Ve,$a(R,Ve,L[Re>>2],!0))):"";return Tp(Re),Ve},S(Re,Ve){Ve instanceof ArrayBuffer&&(Ve=new Uint8Array(Ve));var et=typeof Ve=="string";if(!(et||ArrayBuffer.isView(Ve)&&Ve.BYTES_PER_ELEMENT==1))throw new Ge("Cannot pass non-string to std::string");var Ct=et?gp(Ve):Ve.length,gt=zR(4+Ct+1),Gt=gt+4;return L[gt>>2]=Ct,et?ua(Ve,Gt,Ct+1):R.set(Ve,Gt),Re!==null&&Re.push(Tp,gt),gt},X:$,T(Re){Tp(Re)}})},f:(de,oe,Re)=>{if(Re=ye(Re),oe===2)var Ve=si,et=qo,Ct=Gl;else Ve=K0,et=va,Ct=yp;tt(de,{name:Re,O:gt=>{var Gt=Ve(gt+4,L[gt>>2]*oe,!0);return Tp(gt),Gt},S:(gt,Gt)=>{if(typeof Gt!="string")throw new Ge(`Cannot pass non-string to C++ string type ${Re}`);var Sn=Ct(Gt),Kn=zR(4+Sn+oe);return L[Kn>>2]=Sn/oe,et(Gt,Kn+4,Sn+oe),gt!==null&>.push(Tp,Kn),Kn},X:$,T(gt){Tp(gt)}})},i:(de,oe,Re,Ve,et,Ct)=>{te[de]={name:ye(oe),ka:Hn(Re,Ve),Z:Hn(et,Ct),na:[]}},e:(de,oe,Re,Ve,et,Ct,gt,Gt,Sn,Kn)=>{te[de].na.push({ua:ye(oe),za:Re,xa:Hn(Ve,et),ya:Ct,Fa:gt,Ea:Hn(Gt,Sn),Ga:Kn})},D:(de,oe)=>{oe=ye(oe),tt(de,{oa:!0,name:oe,O:()=>{},S:()=>{}})},q:(de,oe,Re)=>{var[Ve,...et]=rj(de,oe);oe=Ve.S.bind(Ve);var Ct=et.map(Sn=>Sn.X.bind(Sn));de--;var gt={toValue:Mn};switch(de=Ct.map((Sn,Kn)=>{var xn=`argFromPtr${Kn}`;return gt[xn]=Sn,`${xn}(args${Kn?"+"+8*Kn:""})`}),Re){case 0:var Gt="toValue(handle)";break;case 2:Gt="new (toValue(handle))";break;case 3:Gt="";break;case 1:gt.getStringOrSymbol=xp,Gt="toValue(handle)[getStringOrSymbol(methodName)]"}return Gt+=`(${de})`,Ve.oa||(gt.toReturnWire=oe,gt.emval_returnValue=sj,Gt=`return emval_returnValue(toReturnWire, destructorsRef, ${Gt})`),Gt=`return function (handle, methodName, destructorsRef, args) { +`)(...Ve),Et(de,oe)}var yi=de=>{de=de.trim();let oe=de.indexOf("(");return oe===-1?de:de.slice(0,oe)},fr=[],mo=[0,1,,1,null,1,!0,1,!1,1],Qr=de=>{9{if(!de)throw new Ge(`Cannot use deleted val. handle = ${de}`);return mo[de]},Ki=de=>{switch(de){case void 0:return 2;case null:return 4;case!0:return 6;case!1:return 8;default:let oe=fr.pop()||mo.length;return mo[oe]=de,mo[oe+1]=1,oe}},wi={name:"emscripten::val",O:de=>{var oe=Mn(de);return Qr(de),oe},S:(de,oe)=>Ki(oe),X:$,T:null},Xo=(de,oe,Re)=>{switch(oe){case 1:return Re?function(Ve){return this.O(Z[Ve])}:function(Ve){return this.O(R[Ve])};case 2:return Re?function(Ve){return this.O(C[Ve>>1])}:function(Ve){return this.O(E[Ve>>1])};case 4:return Re?function(Ve){return this.O(A[Ve>>2])}:function(Ve){return this.O(L[Ve>>2])};default:throw new TypeError(`invalid integer width (${oe}): ${de}`)}},Dc=(de,oe)=>{var Re=le[de];if(Re===void 0)throw de=`${oe} has unknown type ${Po(de)}`,new Ge(de);return Re},pm=(de,oe)=>{switch(oe){case 4:return function(Re){return this.O(F[Re>>2])};case 8:return function(Re){return this.O(I[Re>>3])};default:throw new TypeError(`invalid float width (${oe}): ${de}`)}},bp=(de,oe,Re)=>{let Ve=(et,Ct)=>{let gt=0;return{next(){if(gt>=et)return{done:!0};let Gt=gt;return gt++,{value:Ct(Gt),done:!1}},[Symbol.iterator](){return this}}};de[Symbol.iterator]||(de[Symbol.iterator]=function(){let et=this[oe]();return Ve(et,Ct=>this[Re](Ct))})},Lh=Object.assign({optional:!0},wi),ua=(de,oe,Re)=>{var Ve=R;if(!(0=gt){if(oe>=Re)break;Ve[oe++]=gt}else if(2047>=gt){if(oe+1>=Re)break;Ve[oe++]=192|gt>>6,Ve[oe++]=128|gt&63}else if(65535>=gt){if(oe+2>=Re)break;Ve[oe++]=224|gt>>12,Ve[oe++]=128|gt>>6&63,Ve[oe++]=128|gt&63}else{if(oe+3>=Re)break;Ve[oe++]=240|gt>>18,Ve[oe++]=128|gt>>12&63,Ve[oe++]=128|gt>>6&63,Ve[oe++]=128|gt&63,Ct++}}return Ve[oe]=0,oe-et},gp=de=>{for(var oe=0,Re=0;Re=Ve?oe++:2047>=Ve?oe+=2:55296<=Ve&&57343>=Ve?(oe+=4,++Re):oe+=3}return oe},Ps=new TextDecoder,$a=(de,oe,Re,Ve)=>{if(Re=oe+Re,Ve)return Re;for(;de[oe]&&!(oe>=Re);)++oe;return oe},BT=new TextDecoder("utf-16le"),si=(de,oe,Re)=>(de>>=1,BT.decode(E.subarray(de,$a(E,de,oe/2,Re)))),qo=(de,oe,Re)=>{if(Re??(Re=2147483647),2>Re)return 0;Re-=2;var Ve=oe;Re=Re<2*de.length?Re/2:de.length;for(var et=0;et>1]=de.charCodeAt(et),oe+=2;return C[oe>>1]=0,oe-Ve},Gl=de=>2*de.length,K0=(de,oe,Re)=>{var Ve="";de>>=2;for(var et=0;!(et>=oe/4);et++){var Ct=L[de+et];if(!Ct&&!Re)break;Ve+=String.fromCodePoint(Ct)}return Ve},va=(de,oe,Re)=>{if(Re??(Re=2147483647),4>Re)return 0;var Ve=oe;Re=Ve+Re-4;for(var et=0;et>2]=Ct,oe+=4,oe+4>Re)break}return A[oe>>2]=0,oe-Ve},yp=de=>{for(var oe=0,Re=0;Re{var oe=Ty.length;return Ty.push(de),oe},rj=(de,oe)=>{for(var Re=Array(de),Ve=0;Ve>2],`parameter ${Ve}`);return Re},sj=(de,oe,Re)=>{var Ve=[];return de=de(Ve,Re),Ve.length&&(L[oe>>2]=Ki(Ve)),de},aj={},xp=de=>{var oe=aj[de];return oe===void 0?ye(de):oe},BR={},zT=()=>{var de;if(!Wh){var oe={USER:"web_user",LOGNAME:"web_user",PATH:"/",PWD:"/",HOME:"/home/web_user",LANG:(((de=globalThis.navigator)==null?void 0:de.language)??"C").replace("-","_")+".UTF-8",_:u||"./this.program"},Re;for(Re in BR)BR[Re]===void 0?delete oe[Re]:oe[Re]=BR[Re];var Ve=[];for(Re in oe)Ve.push(`${Re}=${oe[Re]}`);Wh=Ve}return Wh},Wh,cj=[null,[],[]];if((()=>{let de=ct.prototype;Object.assign(de,{isAliasOf:function(Re){if(!(this instanceof ct&&Re instanceof ct))return!1;var Ve=this.M.R.N,et=this.M.P;Re.M=Re.M;var Ct=Re.M.R.N;for(Re=Re.M.P;Ve.W;)et=Ve.fa(et),Ve=Ve.W;for(;Ct.W;)Re=Ct.fa(Re),Ct=Ct.W;return Ve===Ct&&et===Re},clone:function(){if(this.M.P||je(this),this.M.ea)return this.M.count.value+=1,this;var Re=Ke,Ve=Object,et=Ve.create,Ct=Object.getPrototypeOf(this),gt=this.M;return Re=Re(et.call(Ve,Ct,{M:{value:{count:gt.count,da:gt.da,ea:gt.ea,P:gt.P,R:gt.R,V:gt.V,Y:gt.Y}}})),Re.M.count.value+=1,Re.M.da=!1,Re},delete(){if(this.M.P||je(this),this.M.da&&!this.M.ea)throw new Ge("Object already scheduled for deletion");We(this);var Re=this.M;--Re.count.value,Re.count.value===0&&(Re.V?Re.Y.Z(Re.V):Re.R.N.Z(Re.P)),this.M.ea||(this.M.V=void 0,this.M.P=void 0)},isDeleted:function(){return!this.M.P},deleteLater:function(){if(this.M.P||je(this),this.M.da&&!this.M.ea)throw new Ge("Object already scheduled for deletion");return this.M.da=!0,this}});let oe=Symbol.dispose;oe&&(de[oe]=de.delete)})(),Object.assign(On.prototype,{wa(de){return this.pa&&(de=this.pa(de)),de},ma(de){var oe;(oe=this.Z)==null||oe.call(this,de)},X:$,O:function(de){function oe(){return this.ha?Zi(this.N.ba,{R:this.Ba,P:Re,Y:this,V:de}):Zi(this.N.ba,{R:this,P:de})}var Re=this.wa(de);if(!Re)return this.ma(de),null;var Ve=pi(this.N,Re);if(Ve!==void 0)return Ve.M.count.value===0?(Ve.M.P=Re,Ve.M.V=de,Ve.clone()):(Ve=Ve.clone(),this.ma(de),Ve);if(Ve=this.N.va(Re),Ve=zt[Ve],!Ve)return oe.call(this);Ve=this.ga?Ve.sa:Ve.pointerType;var et=Hi(Re,this.N,Ve.N);return et===null?oe.call(this):this.ha?Zi(Ve.N.ba,{R:Ve,P:et,Y:this,V:de}):Zi(Ve.N.ba,{R:Ve,P:et})}}),r.print&&(p=r.print),r.printErr&&(b=r.printErr),r.thisProgram&&(u=r.thisProgram),r.preInit)for(typeof r.preInit=="function"&&(r.preInit=[r.preInit]);0v(""),r:de=>{var oe=te[de];delete te[de];var Re=oe.ka,Ve=oe.Z,et=oe.na,Ct=et.map(gt=>gt.za).concat(et.map(gt=>gt.Fa));Ze([de],Ct,gt=>{var Gt={},Sn,Kn;for([Sn,Kn]of et.entries()){let xn=gt[Sn],Vr=Kn.xa,pr=Kn.ya,Ks=gt[Sn+et.length],Rc=Kn.Ea,Ll=Kn.Ga;Gt[Kn.ua]={read:_d=>xn.O(Vr(pr,_d)),write:(_d,J0)=>{var Vt=[];Rc(Ll,_d,Ks.S(Vt,J0)),H(Vt)},optional:xn.optional}}return[{name:oe.name,O:xn=>{var Vr={},pr;for(pr in Gt)Vr[pr]=Gt[pr].read(xn);return Ve(xn),Vr},S:(xn,Vr)=>{for(var pr in Gt)if(!(pr in Vr||Gt[pr].optional))throw new TypeError(`Missing field: "${pr}"`);var Ks=Re();for(pr in Gt)Gt[pr].write(Ks,Vr[pr]);return xn!==null&&xn.push(Ve,Ks),Ks},X:$,T:Ve}]})},o:(de,oe,Re,Ve,et)=>{oe=ye(oe),Ve=Ve===0n;let Ct=gt=>gt;if(Ve){let gt=8*Re;Ct=Gt=>BigInt.asUintN(gt,Gt),et=Ct(et)}tt(de,{name:oe,O:Ct,S:(gt,Gt)=>(typeof Gt=="number"&&(Gt=BigInt(Gt)),Gt),X:Be(oe,Re,!Ve),T:null})},C:(de,oe,Re,Ve)=>{oe=ye(oe),tt(de,{name:oe,O:function(et){return!!et},S:function(et,Ct){return Ct?Re:Ve},X:function(et){return this.O(R[et])},T:null})},k:(de,oe,Re,Ve,et,Ct,gt,Gt,Sn,Kn,xn,Vr,pr)=>{xn=ye(xn),Ct=Hn(et,Ct),Gt&&(Gt=Hn(gt,Gt)),Kn&&(Kn=Hn(Sn,Kn)),pr=Hn(Vr,pr);var Ks=ht(xn);bt(Ks,function(){hr(`Cannot construct ${xn} due to unbound types`,[Ve])}),Ze([de,oe,Re],Ve?[Ve]:[],Rc=>{if(Rc=Rc[0],Ve)var Ll=Rc.N,_d=Ll.ba;else _d=ct.prototype;Rc=Et(xn,function(...Ye){if(Object.getPrototypeOf(this)!==J0)throw new Ge(`Use 'new' to construct ${xn}`);if(Vt.aa===void 0)throw new Ge(`${xn} has no accessible constructor`);var yt=Vt.aa[Ye.length];if(yt===void 0)throw new Ge(`Tried to invoke ctor of ${xn} with invalid number of parameters (${Ye.length}) - expected (${Object.keys(Vt.aa).toString()}) parameters instead!`);return yt.apply(this,Ye)});var J0=Object.create(_d,{constructor:{value:Rc}});Rc.prototype=J0;var Vt=new jt(xn,Rc,J0,pr,Ll,Ct,Gt,Kn);if(Vt.W){var Te;(Te=Vt.W).la??(Te.la=[]),Vt.W.la.push(Vt)}return Ll=new On(xn,Vt,!0,!1,!1),Te=new On(xn+"*",Vt,!1,!1,!1),_d=new On(xn+" const*",Vt,!1,!0,!1),zt[de]={pointerType:Te,sa:_d},rn(Ks,Rc),[Ll,Te,_d]})},g:(de,oe,Re,Ve,et,Ct)=>{var gt=Is(oe,Re);et=Hn(Ve,et),Ze([],[de],Gt=>{Gt=Gt[0];var Sn=`constructor ${Gt.name}`;if(Gt.N.aa===void 0&&(Gt.N.aa=[]),Gt.N.aa[oe-1]!==void 0)throw new Ge(`Cannot register multiple constructors with identical number of parameters (${oe-1}) for class '${Gt.name}'! Overload resolution is currently only performed using the parameter count, not actual type info!`);return Gt.N.aa[oe-1]=()=>{hr(`Cannot construct ${Gt.name} due to unbound types`,gt)},Ze([],gt,Kn=>(Kn.splice(1,0,null),Gt.N.aa[oe-1]=or(Sn,Kn,null,et,Ct),[])),[]})},b:(de,oe,Re,Ve,et,Ct,gt,Gt,Sn)=>{var Kn=Is(Re,Ve);oe=ye(oe),oe=yi(oe),Ct=Hn(et,Ct),Ze([],[de],xn=>{function Vr(){hr(`Cannot call ${pr} due to unbound types`,Kn)}xn=xn[0];var pr=`${xn.name}.${oe}`;oe.startsWith("@@")&&(oe=Symbol[oe.substring(2)]),Gt&&xn.N.Ca.push(oe);var Ks=xn.N.ba,Rc=Ks[oe];return Rc===void 0||Rc.U===void 0&&Rc.className!==xn.name&&Rc.$===Re-2?(Vr.$=Re-2,Vr.className=xn.name,Ks[oe]=Vr):(ut(Ks,oe,pr),Ks[oe].U[Re-2]=Vr),Ze([],Kn,Ll=>(Ll=or(pr,Ll,xn,Ct,gt,Sn),Ks[oe].U===void 0?(Ll.$=Re-2,Ks[oe]=Ll):Ks[oe].U[Re-2]=Ll,[])),[]})},A:de=>tt(de,wi),s:(de,oe,Re,Ve,et)=>{switch(oe=ye(oe),et=et===0?"object":et===1?"number":"string",et){case"object":let gt=function(){};gt.values={},tt(de,{name:oe,constructor:gt,valueType:et,O:function(Gt){return this.constructor.values[Gt]},S:(Gt,Sn)=>Sn.value,X:Xo(oe,Re,Ve),T:null}),bt(oe,gt);break;case"number":var Ct={};tt(de,{name:oe,ja:Ct,valueType:et,O:Gt=>Gt,S:(Gt,Sn)=>Sn,X:Xo(oe,Re,Ve),T:null}),bt(oe,Ct),delete r[oe].$;break;case"string":Ct={},tt(de,{name:oe,ra:{},qa:{},ja:Ct,valueType:et,O:function(Gt){return this.qa[Gt]},S:function(Gt,Sn){return this.ra[Sn]},X:Xo(oe,Re,Ve),T:null}),bt(oe,Ct),delete r[oe].$}},d:(de,oe,Re)=>{var Ve=Dc(de,"enum");switch(oe=ye(oe),Ve.valueType){case"object":de=Ve.constructor,Ve=Object.create(Ve.constructor.prototype,{value:{value:Re},constructor:{value:Et(`${Ve.name}_${oe}`,function(){})}}),de.values[Re]=Ve,de[oe]=Ve;break;case"number":Ve.ja[oe]=Re;break;case"string":Ve.ra[oe]=Re,Ve.qa[Re]=oe,Ve.ja[oe]=oe}},n:(de,oe,Re)=>{oe=ye(oe),tt(de,{name:oe,O:Ve=>Ve,S:(Ve,et)=>et,X:pm(oe,Re),T:null})},m:(de,oe,Re,Ve,et,Ct,gt)=>{var Gt=Is(oe,Re);de=ye(de),de=yi(de),et=Hn(Ve,et),bt(de,function(){hr(`Cannot call ${de} due to unbound types`,Gt)},oe-1),Ze([],Gt,Sn=>(Sn=[Sn[0],null].concat(Sn.slice(1)),rn(de,or(de,Sn,null,et,Ct,gt),oe-1),[]))},c:(de,oe,Re,Ve,et)=>{oe=ye(oe);let Ct=Gt=>Gt;if(Ve===0){var gt=32-8*Re;Ct=Gt=>Gt<>>gt,et=Ct(et)}tt(de,{name:oe,O:Ct,S:(Gt,Sn)=>Sn,X:Be(oe,Re,Ve!==0),T:null})},j:(de,oe,Re,Ve)=>{Re=ye(Re),Ve=ye(Ve),Ze([],[de,oe],et=>(bp(et[0].N.ba,Re,Ve),[]))},a:(de,oe,Re)=>{function Ve(Ct){return new et(Z.buffer,L[Ct+4>>2],L[Ct>>2])}var et=[Int8Array,Uint8Array,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array,BigInt64Array,BigUint64Array][oe];Re=ye(Re),tt(de,{name:Re,O:Ve,X:Ve},{Aa:!0})},h:de=>{tt(de,Lh)},B:(de,oe)=>{oe=ye(oe),tt(de,{name:oe,O(Re){var Ve=(Ve=Re+4)?Ps.decode(R.subarray(Ve,$a(R,Ve,L[Re>>2],!0))):"";return Tp(Re),Ve},S(Re,Ve){Ve instanceof ArrayBuffer&&(Ve=new Uint8Array(Ve));var et=typeof Ve=="string";if(!(et||ArrayBuffer.isView(Ve)&&Ve.BYTES_PER_ELEMENT==1))throw new Ge("Cannot pass non-string to std::string");var Ct=et?gp(Ve):Ve.length,gt=zR(4+Ct+1),Gt=gt+4;return L[gt>>2]=Ct,et?ua(Ve,Gt,Ct+1):R.set(Ve,Gt),Re!==null&&Re.push(Tp,gt),gt},X:$,T(Re){Tp(Re)}})},f:(de,oe,Re)=>{if(Re=ye(Re),oe===2)var Ve=si,et=qo,Ct=Gl;else Ve=K0,et=va,Ct=yp;tt(de,{name:Re,O:gt=>{var Gt=Ve(gt+4,L[gt>>2]*oe,!0);return Tp(gt),Gt},S:(gt,Gt)=>{if(typeof Gt!="string")throw new Ge(`Cannot pass non-string to C++ string type ${Re}`);var Sn=Ct(Gt),Kn=zR(4+Sn+oe);return L[Kn>>2]=Sn/oe,et(Gt,Kn+4,Sn+oe),gt!==null&>.push(Tp,Kn),Kn},X:$,T(gt){Tp(gt)}})},i:(de,oe,Re,Ve,et,Ct)=>{te[de]={name:ye(oe),ka:Hn(Re,Ve),Z:Hn(et,Ct),na:[]}},e:(de,oe,Re,Ve,et,Ct,gt,Gt,Sn,Kn)=>{te[de].na.push({ua:ye(oe),za:Re,xa:Hn(Ve,et),ya:Ct,Fa:gt,Ea:Hn(Gt,Sn),Ga:Kn})},D:(de,oe)=>{oe=ye(oe),tt(de,{oa:!0,name:oe,O:()=>{},S:()=>{}})},q:(de,oe,Re)=>{var[Ve,...et]=rj(de,oe);oe=Ve.S.bind(Ve);var Ct=et.map(Sn=>Sn.X.bind(Sn));de--;var gt={toValue:Mn};switch(de=Ct.map((Sn,Kn)=>{var xn=`argFromPtr${Kn}`;return gt[xn]=Sn,`${xn}(args${Kn?"+"+8*Kn:""})`}),Re){case 0:var Gt="toValue(handle)";break;case 2:Gt="new (toValue(handle))";break;case 3:Gt="";break;case 1:gt.getStringOrSymbol=xp,Gt="toValue(handle)[getStringOrSymbol(methodName)]"}return Gt+=`(${de})`,Ve.oa||(gt.toReturnWire=oe,gt.emval_returnValue=sj,Gt=`return emval_returnValue(toReturnWire, destructorsRef, ${Gt})`),Gt=`return function (handle, methodName, destructorsRef, args) { ${Gt} }`,Re=new Function(Object.keys(gt),Gt)(...Object.values(gt)),Gt=`methodCaller<(${et.map(Sn=>Sn.name)}) => ${Ve.name}>`,oj(Et(Gt,Re))},F:Qr,p:(de,oe,Re,Ve,et)=>Ty[de](oe,Re,Ve,et),E:de=>{var oe=Mn(de);H(oe),Qr(de)},t:(de,oe,Re,Ve)=>{var et=new Date().getFullYear(),Ct=new Date(et,0,1).getTimezoneOffset();et=new Date(et,6,1).getTimezoneOffset(),L[de>>2]=60*Math.max(Ct,et),A[oe>>2]=+(Ct!=et),oe=gt=>{var Gt=Math.abs(gt);return`UTC${0<=gt?"-":"+"}${String(Math.floor(Gt/60)).padStart(2,"0")}${String(Gt%60).padStart(2,"0")}`},de=oe(Ct),oe=oe(et),et{var oe=R.length;if(de>>>=0,2147483648=Re;Re*=2){var Ve=oe*(1+.2/Re);Ve=Math.min(Ve,de+100663296);e:{Ve=(Math.min(2147483648,65536*Math.ceil(Math.max(de,Ve)/65536))-KT.buffer.byteLength+65535)/65536|0;try{KT.grow(Ve),G();var et=1;break e}catch{}et=void 0}if(et)return!0}return!1},u:(de,oe)=>{var Re=0,Ve=0,et;for(et of zT()){var Ct=oe+Re;L[de+Ve>>2]=Ct,Re+=ua(et,Ct,1/0)+1,Ve+=4}return 0},v:(de,oe)=>{var Re=zT();L[de>>2]=Re.length,de=0;for(var Ve of Re)de+=gp(Ve)+1;return L[oe>>2]=de,0},w:()=>52,x:function(){return 70},l:(de,oe,Re,Ve)=>{for(var et=0,Ct=0;Ct>2],Gt=L[oe+4>>2];oe+=8;for(var Sn=0;Sn>2]=et,0}},_y;return _y=await(async function(){function de(Re){return Re=_y=Re.exports,HT=Re.J,zR=r._malloc=Re.K,Tp=r._free=Re.L,KT=Re.G,DA=Re.I,G(),_y}var oe={a:HR};return r.instantiateWasm?new Promise(Re=>{r.instantiateWasm(oe,(Ve,et)=>{Re(de(Ve))})}):(X??(X=y(`\0asm\0\0\0\xD79\`\x7F\x7F\`\x7F\x7F\0\`\x7F\x7F\x7F\x7F\`\x7F\x7F\x7F\`\x7F\0\`\x7F\x7F\x7F\x7F\x7F\x7F\x7F\`\x7F\x7F\x7F\x7F\x7F\`\x7F\x7F\x7F\0\`\x7F\x7F\x7F\x7F\0\`\x7F\x7F\x7F\x7F\x7F\x7F\`\x7F\x7F\x7F\x7F\x7F\0\`\x7F\x7F\x7F\x7F\x7F\x7F\0\`\b\x7F\x7F\x7F\x7F\x7F\x7F\x7F\x7F\x7F\`\0\0\`\x07\x7F\x7F\x7F\x7F\x7F\x7F\x7F\x7F\`\x7F~~~~\0\`\0\x7F\` \x7F\x7F\x7F\x7F\x7F\x7F\x7F\x7F\x7F\x7F\0\`\x07\x7F\x7F\x7F\x7F\x7F\x7F\x7F\0\`\x7F\x7F\x7F\x7F~\x7F\`\b\x7F\x7F\x7F\x7F\x7F\x7F\x7F\x7F\0\`\x7F~~\x7F\0\`\x7F~\x7F~\`\x7F\x7F~\x7F\x7F\0\` @@ -8155,7 +8025,7 @@ OW\xC6\xBF\xA0\x8E\v{"^\xF2?\0\x81\x9C\xC7+\xAA\xC1\xBF?4JJ\xBB\xF1?^\x8C\xCEv \0\0\0d\0\0\0\xE8\0\0'\0\0\xA0\x86\0@B\0\x80\x96\x98\0\0\xE1\xF5\0\xCA\x9A;\0\0\0\0\0\0\0\x0000010203040506070809101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899\0\0\0\0\0\0\0\x00000000010010001101000101011001111000100110101011110011011110111100010203040506071011121314151617202122232425262730313233343536374041424344454647505152535455565760616263646566677071727374757677000102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f202122232425262728292a2b2c2d2e2f303132333435363738393a3b3c3d3e3f404142434445464748494a4b4c4d4e4f505152535455565758595a5b5c5d5e5f606162636465666768696a6b6c6d6e6f707172737475767778797a7b7c7d7e7f808182838485868788898a8b8c8d8e8f909192939495969798999a9b9c9d9e9fa0a1a2a3a4a5a6a7a8a9aaabacadaeafb0b1b2b3b4b5b6b7b8b9babbbcbdbebfc0c1c2c3c4c5c6c7c8c9cacbcccdcecfd0d1d2d3d4d5d6d7d8d9dadbdcdddedfe0e1e2e3e4e5e6e7e8e9eaebecedeeeff0f1f2f3f4f5f6f7f8f9fafbfcfdfeff\0\0\0\0\0\0\0\0 \0\0\0\0\0\0\0d\0\0\0\0\0\0\0\xE8\0\0\0\0\0\0'\0\0\0\0\0\0\xA0\x86\0\0\0\0\0@B\0\0\0\0\0\x80\x96\x98\0\0\0\0\0\0\xE1\xF5\0\0\0\0\0\xCA\x9A;\0\0\0\0\0\xE4\vT\0\0\0\0\xE8vH\0\0\0\0\xA5\xD4\xE8\0\0\0\0\xA0rN \0\0\0@z\xF3Z\0\0\0\x80\xC6\xA4~\x8D\0\0\0\xC1o\xF2\x86#\0\0\0\x8A]xEc\0\0d\xA7\xB3\xB6\xE0\r\0\0\xE8\x89#\xC7\x8A\xA4d\0\0\xF8a\0\0NSt3__214__shared_countE\0\0\0\0hf\0\0\xCCd\0\0$b\0\0\x98e\0\0N10__cxxabiv116__shim_type_infoE\0\0\0\0\xCCd\0\0Tb\0\0b\0\0N10__cxxabiv117__class_type_infoE\0\0\0\xCCd\0\0\x84b\0\0b\0\0N10__cxxabiv117__pbase_type_infoE\0\0\0\xCCd\0\0\xB4b\0\0xb\0\0N10__cxxabiv119__pointer_type_infoE\0\xCCd\0\0\xE4b\0\0b\0\0N10__cxxabiv120__function_type_infoE\0\0\0\0\xCCd\0\0c\0\0xb\0\0N10__cxxabiv129__pointer_to_member_type_infoE\0\0\0\0\0\0\0dc\0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\0\0\0f\0\x004v\0A\xA4\xCD\v\0A\xB4\xCD\v\b\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\0A\xF8\xCD\vhf`)),de((await M(oe)).instance))})(),(function(){function de(){var oe;if(r.calledRun=!0,!f){if(V=!0,_y.H(),_?.(r),(oe=r.onRuntimeInitialized)==null||oe.call(r),r.postRun)for(typeof r.postRun=="function"&&(r.postRun=[r.postRun]);r.postRun.length;){var Re=r.postRun.shift();w.push(Re)}O(w)}}if(r.preRun)for(typeof r.preRun=="function"&&(r.preRun=[r.preRun]);r.preRun.length;)K();O(z),r.setStatus?(r.setStatus("Running..."),setTimeout(()=>{setTimeout(()=>r.setStatus(""),1),de()},1)):de()})(),V?o=r:o=new Promise((de,oe)=>{_=de,S=oe}),o}var tC=(e,t,n)=>{let i=e.vf32_ptr(t),o=t.size(),r=i>>2,s=e.HEAPF32.slice(r,r+o);if(n!==void 0)for(let a=0;a1/(1+Math.exp(-e)),F8e=e=>t=>t*e+.5,I8e=(e,t,n)=>{let i=n?.colorScaleFactor??.282;return{numPoints:t.numPoints,shDegree:t.shDegree,antialiased:t.antialiased,positions:tC(e,t.positions),scales:tC(e,t.scales,Math.exp),rotations:tC(e,t.rotations),alphas:tC(e,t.alphas,v8e),colors:tC(e,t.colors,F8e(i)),sh:tC(e,t.sh)}},P8e=(e,t)=>{e._free(e.vf32_ptr(t.positions)),e._free(e.vf32_ptr(t.scales)),e._free(e.vf32_ptr(t.rotations)),e._free(e.vf32_ptr(t.alphas)),e._free(e.vf32_ptr(t.colors)),e._free(e.vf32_ptr(t.sh))},k0e=async(e,t)=>{var n;let i=await W8e(),o=e instanceof Uint8Array?e:new Uint8Array(e),r=null;try{if(r=i._malloc(Uint8Array.BYTES_PER_ELEMENT*o.length),r===null)throw new Error("couldn't allocate memory");i.HEAPU8.set(o,r/Uint8Array.BYTES_PER_ELEMENT);let s=i.CoordinateSystem[((n=t?.unpackOptions)==null?void 0:n.coordinateSystem)??"UNSPECIFIED"],a=i.load_spz(r,o.length,{coordinateSystem:s}),c=I8e(i,a,t);return P8e(i,a),c}catch(s){throw s}finally{r!==null&&i._free(r)}};var X8e=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"}));var N8e=[0,9,24,45],Y8e=14,M8e=1.6*1024*1024*1024;function w8e(e,t){let n=t?.attributes;if(!l(n))return;let i=n.POSITION;if(!l(i))return;let o=e?.accessors?.[i];if(!l(o)||o.count<=0)return;let r=0;for(let s in n)if(Object.prototype.hasOwnProperty.call(n,s)){let a=/SH_DEGREE_(\d+)_COEF_/.exec(s);a&&(r=Math.max(r,parseInt(a[1],10)))}return{numPoints:o.count,shDegree:r}}function k8e(e,t){let n=Y8e+(N8e[t]??0);return e*n*Float32Array.BYTES_PER_ELEMENT*2}var R6=class extends io{constructor(t){super(),t=t??B.EMPTY_OBJECT;let n=t.resourceCache,i=t.gltf,o=t.primitive,r=t.spz,s=t.gltfResource,a=t.baseResource,c=t.cacheKey;this._resourceCache=n,this._gltfResource=s,this._baseResource=a,this._gltf=i,this._primitive=o,this._spz=r,this._cacheKey=c,this._bufferViewLoader=void 0,this._bufferViewTypedArray=void 0,this._decodePromise=void 0,this._decodedData=void 0,this._state=Rt.UNLOADED,this._promise=void 0,this._spzError=void 0}get cacheKey(){return this._cacheKey}get decodedData(){return this._decodedData}async load(){return l(this._promise)?this._promise:(this._state=Rt.LOADING,this._promise=U8e(this),this._promise)}process(t){if(this._state===Rt.READY)return!0;if(this._state!==Rt.PROCESSING||(l(this._spzError)&&C6(this,this._spzError),!l(this._bufferViewTypedArray))||l(this._decodePromise))return!1;let n=w8e(this._gltf,this._primitive);if(l(n)){let o=k8e(n.numPoints,n.shDegree);if(o>M8e){let r=Math.round(o/1048576);return C6(this,new ae(`SPZ data too large to decode: ${n.numPoints.toLocaleString()} splats with spherical harmonics degree ${n.shDegree} would require approximately ${r} MB, which exceeds the WASM memory limit. Consider using a lower spherical harmonics degree or splitting the dataset into smaller tiles.`)),!1}}let i=k0e(this._bufferViewTypedArray,{unpackOptions:{coordinateSystem:"UNSPECIFIED"}});if(!l(i))return!1;this._decodePromise=D8e(this,i)}unload(){l(this._bufferViewLoader)&&this._resourceCache.unload(this._bufferViewLoader),this._bufferViewLoader=void 0,this._bufferViewTypedArray=void 0,this._decodedData=void 0,this._gltf=void 0,this._primitive=void 0}};async function U8e(e){let t=e._resourceCache;try{let n=t.getBufferViewLoader({gltf:e._gltf,bufferViewId:e._spz.bufferView,gltfResource:e._gltfResource,baseResource:e._baseResource});return e._bufferViewLoader=n,await n.load(),e.isDestroyed()?void 0:(e._bufferViewTypedArray=n.typedArray,e._state=Rt.PROCESSING,e)}catch(n){if(e.isDestroyed())return;C6(e,n)}}function C6(e,t){throw e.unload(),e._state=Rt.FAILED,e.getError("Failed to load SPZ",t)}async function D8e(e,t){try{let n=await t;return e.isDestroyed()?void 0:(e.unload(),e._decodedData={gcloud:n},e._state=Rt.READY,e._baseResource)}catch(n){if(e.isDestroyed())return;e._spzError=n}}var nI=R6;var DYn=x(T(),1);var XYn=x(T(),1);var xYn=x(T(),1);function iI(e){e=e??B.EMPTY_OBJECT;let t=e.id,n=e.properties??{},i={};for(let o in n)if(n.hasOwnProperty(o)){let r=n[o];l(r.semantic)&&(i[r.semantic]=r)}this._id=t,this._name=e.name,this._description=e.description,this._properties=n,this._propertiesBySemantic=i,this._extras=$e(e.extras,!0),this._extensions=$e(e.extensions,!0)}iI.fromJson=function(e){e=e??B.EMPTY_OBJECT;let t=e.id,n=e.class,i={};for(let o in n.properties)if(n.properties.hasOwnProperty(o)){let r=Xp.fromJson({id:o,property:n.properties[o],enums:e.enums});i[o]=r}return new iI({id:t,name:n.name,description:n.description,properties:i,extras:n.extras,extensions:n.extensions})};Object.defineProperties(iI.prototype,{properties:{get:function(){return this._properties}},propertiesBySemantic:{get:function(){return this._propertiesBySemantic}},id:{get:function(){return this._id}},name:{get:function(){return this._name}},description:{get:function(){return this._description}},extras:{get:function(){return this._extras}},extensions:{get:function(){return this._extensions}}});iI.BATCH_TABLE_CLASS_NAME="_batchTable";var rf=iI;var GYn=x(T(),1);var ZYn=x(T(),1);function NO(e){e=e??B.EMPTY_OBJECT;let t=e.value,n=e.name;this._value=t,this._name=n,this._description=e.description,this._extras=$e(e.extras,!0),this._extensions=$e(e.extensions,!0)}NO.fromJson=function(e){return new NO({value:e.value,name:e.name,description:e.description,extras:e.extras,extensions:e.extensions})};Object.defineProperties(NO.prototype,{value:{get:function(){return this._value}},name:{get:function(){return this._name}},description:{get:function(){return this._description}},extras:{get:function(){return this._extras}},extensions:{get:function(){return this._extensions}}});var oI=NO;function YO(e){e=e??B.EMPTY_OBJECT;let t=e.id,n=e.values,i={},o={},r=n.length;for(let a=0;a>t};dc.fromSubtreeJson=async function(e,t,n,i,o){let r=new dc(e,i,o),s;l(t)?s={json:t,binary:void 0}:s=K8e(n);let a=s.json;r._subtreeJson=a;let c;if(no(a,"3DTILES_metadata"))c=a.extensions["3DTILES_metadata"];else if(l(a.tileMetadata)){let Z=a.tileMetadata;c=a.propertyTables[Z]}let d=[];if(l(a.contentMetadata)){let Z=a.contentMetadata.length;for(let R=0;R0;u=u||m;for(let p=0;p0){let g=t.getContentMetadataView(a,E);I=lx.parseAllBoundingVolumeSemantics("CONTENT",g)}let N=f6e(b,I);l(N)&&(F.boundingVolume=N),f.push(It(F,s.contentHeaders[E]))}let y=J0e(c,s,a),_={boundingVolume:b,geometricError:y,refine:s.refine,contents:f},S=!0,Z=$e(s.tileHeader,S);delete Z.boundingVolume,delete Z.transform,delete Z.metadata;let R=It(_,Z,S),C=ebe(e,s.baseResource,R,n);return C.implicitCoordinates=a,C.implicitSubtree=t,C.metadata=c,C.hasImplicitContentMetadata=p,C}function wO(e,t){return l(e)&&l(t)&&(l(t.minimumHeight)||l(t.maximumHeight))&&(no(e,"3DTILES_bounding_volume_S2")||l(e.region))}function L6(e,t){l(t)&&(no(e,"3DTILES_bounding_volume_S2")?m6e(e.extensions["3DTILES_bounding_volume_S2"],t.minimumHeight,t.maximumHeight):l(e.region)&&u6e(e.region,t.minimumHeight,t.maximumHeight))}function u6e(e,t,n){l(t)&&(e[4]=t),l(n)&&(e[5]=n)}function m6e(e,t,n){l(t)&&(e.minimumHeight=t),l(n)&&(e.maximumHeight=n)}function h6e(e,t,n,i,o,r){let s;return!l(r)||!l(r.boundingVolume)||!wO(r.boundingVolume,r)&&wO(e.boundingVolume,r)?s=j0e(e,t,n,i??!1,o):s=r.boundingVolume,L6(s,r),s}function f6e(e,t){let n;return l(t)&&(n=t.boundingVolume),wO(n,t)?L6(n,t):wO(e,t)&&(n=$e(e,!0),L6(n,t)),n}function j0e(e,t,n,i,o){let r=e.boundingVolume;return no(r,"3DTILES_bounding_volume_S2")?Q0e(i,o,n,t.level,t.x,t.y,t.z):l(r.region)?{region:$0e(r.region,t.level,t.x,t.y,t.z)}:{box:q0e(r.box,t.level,t.x,t.y,t.z)}}function Q0e(e,t,n,i,o,r,s){let a=t._boundingVolume;if(e)return{extensions:{"3DTILES_bounding_volume_S2":{token:Gb.getTokenFromId(a.s2Cell._cellId),minimumHeight:a.minimumHeight,maximumHeight:a.maximumHeight}}};let c=Number(t._boundingVolume.s2Cell._cellId>>BigInt(61)),d=c%2===0?w1.encode2D(i,o,r):w1.encode2D(i,r,o),u=Gb.fromFacePositionLevel(c,BigInt(d),i),m,p;if(l(s)){let b=(a.maximumHeight+a.minimumHeight)/2;m=n<4?a.minimumHeight:b,p=n<4?b:a.maximumHeight}else m=a.minimumHeight,p=a.maximumHeight;return{extensions:{"3DTILES_bounding_volume_S2":{token:Gb.getTokenFromId(u._cellId),minimumHeight:m,maximumHeight:p}}}}var p6e=new h,b6e=new h,G6=new h,g6e=new q;function q0e(e,t,n,i,o){if(t===0)return e;let r=h.unpack(e,0,b6e),s=q.unpack(e,3,g6e),a=Math.pow(2,-t),c=-1+(2*n+1)*a,d=-1+(2*i+1)*a,u=0,m=h.fromElements(a,a,1,p6e);l(o)&&(u=-1+(2*o+1)*a,m.z=a);let p=h.fromElements(c,d,u,G6);p=q.multiplyByVector(s,p,G6),p=h.add(p,r,G6);let b=q.clone(s);b=q.multiplyByScale(b,m,b);let f=new Array(12);return h.pack(p,f),q.pack(b,f,3),f}var y6e=new re;function $0e(e,t,n,i,o){if(t===0)return e.slice();let r=re.unpack(e,0,y6e),s=e[4],a=e[5],c=Math.pow(2,-t),d=c*r.width,u=W.negativePiToPi(r.west+n*d),m=W.negativePiToPi(u+d),p=c*r.height,b=W.negativePiToPi(r.south+i*p),f=W.negativePiToPi(b+p),y=s,_=a;if(l(o)){let S=c*(a-s);y+=o*S,_=y+S}return[u,b,m,f,y,_]}function x6e(e,t,n){let i=e._implicitTileset,o=t.implicitCoordinates.getChildCoordinates(n),r=j0e(i,o,n,!1,t),s=J0e(void 0,i,o),a=i.subtreeUriTemplate.getDerivedResource({templateValues:o.getTemplateValues()}).url,c={boundingVolume:r,geometricError:s,refine:i.refine,contents:[{uri:a}]},d=ebe(e,i.baseResource,c,t);return d.implicitTileset=i,d.implicitCoordinates=o,d}function ebe(e,t,n,i){let o=e._tile.constructor;return new o(e._tileset,t,n,i)}oC._deriveBoundingBox=q0e;oC._deriveBoundingRegion=$0e;oC._deriveBoundingVolumeS2=Q0e;var rC=oC;var Hui=x(T(),1);var QMn=x(T(),1),tbe={NONE:0,REPEAT:1,MIRRORED_REPEAT:2};Object.freeze(tbe);var wd=tbe;var Nui=x(T(),1);var _wn=x(T(),1);var twn=x(T(),1);function sC(e,t){this._distance=t,this._normal=new nbe(e,this),this.onChangeCallback=void 0,this.index=-1}Object.defineProperties(sC.prototype,{distance:{get:function(){return this._distance},set:function(e){l(this.onChangeCallback)&&e!==this._distance&&this.onChangeCallback(this.index),this._distance=e}},normal:{get:function(){return this._normal},set:function(e){l(this.onChangeCallback)&&!h.equals(this._normal._cartesian3,e)&&this.onChangeCallback(this.index),h.clone(e,this._normal._cartesian3)}}});sC.fromPlane=function(e,t){return l(t)?(t.normal=e.normal,t.distance=e.distance):t=new sC(e.normal,e.distance),t};sC.clone=function(e,t){return l(t)?(t.normal=e.normal,t.distance=e.distance,t):new sC(e.normal,e.distance)};function nbe(e,t){this._clippingPlane=t,this._cartesian3=h.clone(e)}Object.defineProperties(nbe.prototype,{x:{get:function(){return this._cartesian3.x},set:function(e){l(this._clippingPlane.onChangeCallback)&&e!==this._cartesian3.x&&this._clippingPlane.onChangeCallback(this._clippingPlane.index),this._cartesian3.x=e}},y:{get:function(){return this._cartesian3.y},set:function(e){l(this._clippingPlane.onChangeCallback)&&e!==this._cartesian3.y&&this._clippingPlane.onChangeCallback(this._clippingPlane.index),this._cartesian3.y=e}},z:{get:function(){return this._cartesian3.z},set:function(e){l(this._clippingPlane.onChangeCallback)&&e!==this._cartesian3.z&&this._clippingPlane.onChangeCallback(this._clippingPlane.index),this._cartesian3.z=e}}});var ta=sC;function ol(e){e=e??B.EMPTY_OBJECT,this._planes=[],this._dirtyIndex=-1,this._multipleDirtyPlanes=!1,this._enabled=e.enabled??!0,this.modelMatrix=P.clone(e.modelMatrix??P.IDENTITY),this.edgeColor=U.clone(e.edgeColor??U.WHITE),this.edgeWidth=e.edgeWidth??0,this.planeAdded=new Se,this.planeRemoved=new Se,this._owner=void 0;let t=e.unionClippingRegions??!1;this._unionClippingRegions=t,this._testIntersection=t?abe:cbe,this._uint8View=void 0,this._float32View=void 0,this._clippingPlanesTexture=void 0;let n=e.planes;if(l(n)){let i=n.length;for(let o=0;o0&&(r=qt.OUTSIDE);for(let s=0;s80*n){a=e[0],c=e[1];let u=a,m=c;for(let p=n;pu&&(u=b),f>m&&(m=f)}d=Math.max(u-a,m-c),d=d!==0?32767/d:0}return dI(r,s,n,a,c,d,0),s}function mbe(e,t,n,i,o){let r;if(o===M6e(e,t,n,i)>0)for(let s=t;s=t;s-=i)r=ube(s/i|0,e[s],e[s+1],r);return r&&aC(r,r.next)&&(mI(r),r=r.next),r}function aS(e,t){if(!e)return e;t||(t=e);let n=e,i;do if(i=!1,!n.steiner&&(aC(n,n.next)||ys(n.prev,n,n.next)===0)){if(mI(n),n=t=n.prev,n===n.next)break;i=!0}else n=n.next;while(i||n!==t);return t}function dI(e,t,n,i,o,r,s){if(!e)return;!s&&r&&F6e(e,i,o,r);let a=e;for(;e.prev!==e.next;){let c=e.prev,d=e.next;if(r?C6e(e,i,o,r):R6e(e)){t.push(c.i,e.i,d.i),mI(e),e=d.next,a=d.next;continue}if(e=d,e===a){s?s===1?(e=V6e(aS(e),t),dI(e,t,n,i,o,r,2)):s===2&&E6e(e,t,n,i,o,r):dI(aS(e),t,n,i,o,r,1);break}}}function R6e(e){let t=e.prev,n=e,i=e.next;if(ys(t,n,i)>=0)return!1;let o=t.x,r=n.x,s=i.x,a=t.y,c=n.y,d=i.y,u=Math.min(o,r,s),m=Math.min(a,c,d),p=Math.max(o,r,s),b=Math.max(a,c,d),f=i.next;for(;f!==t;){if(f.x>=u&&f.x<=p&&f.y>=m&&f.y<=b&&lI(o,a,r,c,s,d,f.x,f.y)&&ys(f.prev,f,f.next)>=0)return!1;f=f.next}return!0}function C6e(e,t,n,i){let o=e.prev,r=e,s=e.next;if(ys(o,r,s)>=0)return!1;let a=o.x,c=r.x,d=s.x,u=o.y,m=r.y,p=s.y,b=Math.min(a,c,d),f=Math.min(u,m,p),y=Math.max(a,c,d),_=Math.max(u,m,p),S=W6(b,f,t,n,i),Z=W6(y,_,t,n,i),R=e.prevZ,C=e.nextZ;for(;R&&R.z>=S&&C&&C.z<=Z;){if(R.x>=b&&R.x<=y&&R.y>=f&&R.y<=_&&R!==o&&R!==s&&lI(a,u,c,m,d,p,R.x,R.y)&&ys(R.prev,R,R.next)>=0||(R=R.prevZ,C.x>=b&&C.x<=y&&C.y>=f&&C.y<=_&&C!==o&&C!==s&&lI(a,u,c,m,d,p,C.x,C.y)&&ys(C.prev,C,C.next)>=0))return!1;C=C.nextZ}for(;R&&R.z>=S;){if(R.x>=b&&R.x<=y&&R.y>=f&&R.y<=_&&R!==o&&R!==s&&lI(a,u,c,m,d,p,R.x,R.y)&&ys(R.prev,R,R.next)>=0)return!1;R=R.prevZ}for(;C&&C.z<=Z;){if(C.x>=b&&C.x<=y&&C.y>=f&&C.y<=_&&C!==o&&C!==s&&lI(a,u,c,m,d,p,C.x,C.y)&&ys(C.prev,C,C.next)>=0)return!1;C=C.nextZ}return!0}function V6e(e,t){let n=e;do{let i=n.prev,o=n.next.next;!aC(i,o)&&fbe(i,n,n.next,o)&&uI(i,o)&&uI(o,i)&&(t.push(i.i,n.i,o.i),mI(n),mI(n.next),n=e=o),n=n.next}while(n!==e);return aS(n)}function E6e(e,t,n,i,o,r){let s=e;do{let a=s.next.next;for(;a!==s.prev;){if(s.i!==a.i&&X6e(s,a)){let c=pbe(s,a);s=aS(s,s.next),c=aS(c,c.next),dI(s,t,n,i,o,r,0),dI(c,t,n,i,o,r,0);return}a=a.next}s=s.next}while(s!==e)}function A6e(e,t,n,i){let o=[];for(let r=0,s=t.length;r=n.next.y&&n.next.y!==n.y){let m=n.x+(o-n.y)*(n.next.x-n.x)/(n.next.y-n.y);if(m<=i&&m>r&&(r=m,s=n.x=n.x&&n.x>=c&&i!==n.x&&hbe(os.x||n.x===s.x&&v6e(s,n)))&&(s=n,u=m)}n=n.next}while(n!==a);return s}function v6e(e,t){return ys(e.prev,e,t.prev)<0&&ys(t.next,e,e.next)<0}function F6e(e,t,n,i){let o=e;do o.z===0&&(o.z=W6(o.x,o.y,t,n,i)),o.prevZ=o.prev,o.nextZ=o.next,o=o.next;while(o!==e);o.prevZ.nextZ=null,o.prevZ=null,I6e(o)}function I6e(e){let t,n=1;do{let i=e,o;e=null;let r=null;for(t=0;i;){t++;let s=i,a=0;for(let d=0;d0||c>0&&s;)a!==0&&(c===0||!s||i.z<=s.z)?(o=i,i=i.nextZ,a--):(o=s,s=s.nextZ,c--),r?r.nextZ=o:e=o,o.prevZ=r,r=o;i=s}r.nextZ=null,n*=2}while(t>1);return e}function W6(e,t,n,i,o){return e=(e-n)*o|0,t=(t-i)*o|0,e=(e|e<<8)&16711935,e=(e|e<<4)&252645135,e=(e|e<<2)&858993459,e=(e|e<<1)&1431655765,t=(t|t<<8)&16711935,t=(t|t<<4)&252645135,t=(t|t<<2)&858993459,t=(t|t<<1)&1431655765,e|t<<1}function P6e(e){let t=e,n=e;do(t.x=(e-s)*(r-a)&&(e-s)*(i-a)>=(n-s)*(t-a)&&(n-s)*(r-a)>=(o-s)*(i-a)}function lI(e,t,n,i,o,r,s,a){return!(e===s&&t===a)&&hbe(e,t,n,i,o,r,s,a)}function X6e(e,t){return e.next.i!==t.i&&e.prev.i!==t.i&&!N6e(e,t)&&(uI(e,t)&&uI(t,e)&&Y6e(e,t)&&(ys(e.prev,e,t.prev)||ys(e,t.prev,t))||aC(e,t)&&ys(e.prev,e,e.next)>0&&ys(t.prev,t,t.next)>0)}function ys(e,t,n){return(t.y-e.y)*(n.x-t.x)-(t.x-e.x)*(n.y-t.y)}function aC(e,t){return e.x===t.x&&e.y===t.y}function fbe(e,t,n,i){let o=UO(ys(e,t,n)),r=UO(ys(e,t,i)),s=UO(ys(n,i,e)),a=UO(ys(n,i,t));return!!(o!==r&&s!==a||o===0&&kO(e,n,t)||r===0&&kO(e,i,t)||s===0&&kO(n,e,i)||a===0&&kO(n,t,i))}function kO(e,t,n){return t.x<=Math.max(e.x,n.x)&&t.x>=Math.min(e.x,n.x)&&t.y<=Math.max(e.y,n.y)&&t.y>=Math.min(e.y,n.y)}function UO(e){return e>0?1:e<0?-1:0}function N6e(e,t){let n=e;do{if(n.i!==e.i&&n.next.i!==e.i&&n.i!==t.i&&n.next.i!==t.i&&fbe(n,n.next,e,t))return!0;n=n.next}while(n!==e);return!1}function uI(e,t){return ys(e.prev,e,e.next)<0?ys(e,t,e.next)>=0&&ys(e,e.prev,t)>=0:ys(e,t,e.prev)<0||ys(e,e.next,t)<0}function Y6e(e,t){let n=e,i=!1,o=(e.x+t.x)/2,r=(e.y+t.y)/2;do n.y>r!=n.next.y>r&&n.next.y!==n.y&&o<(n.next.x-n.x)*(r-n.y)/(n.next.y-n.y)+n.x&&(i=!i),n=n.next;while(n!==e);return i}function pbe(e,t){let n=v6(e.i,e.x,e.y),i=v6(t.i,t.x,t.y),o=e.next,r=t.prev;return e.next=t,t.prev=e,n.next=o,o.prev=n,i.next=n,n.prev=i,r.next=i,i.prev=r,i}function ube(e,t,n,i){let o=v6(e,t,n);return i?(o.next=i.next,o.prev=i,i.next.prev=o,i.next=o):(o.prev=o,o.next=o),o}function mI(e){e.next.prev=e.prev,e.prev.next=e.next,e.prevZ&&(e.prevZ.nextZ=e.nextZ),e.nextZ&&(e.nextZ.prevZ=e.prevZ)}function v6(e,t,n){return{i:e,x:t,y:n,prev:null,next:null,z:0,prevZ:null,nextZ:null,steiner:!1}}function M6e(e,t,n,i){let o=0;for(let r=t,s=n-i;r0?Qs.COUNTER_CLOCKWISE:Qs.CLOCKWISE};dx.triangulate=function(e,t){let n=k.packArray(e);return F6(n,t,2)};var xbe=new h,Tbe=new h,_be=new h,bbe=new h,gbe=new h,ybe=new h,Xb=new h,Sbe=new k,Zbe=new k,Rbe=new k,cC=new k;dx.computeSubdivision=function(e,t,n,i,o){o=o??W.RADIANS_PER_DEGREE;let r=l(i),s=n.slice(0),a,c=t.length,d=new Array(c*3),u=new Array(c*2),m=0,p=0;for(a=0;a0;){let R=s.pop(),C=s.pop(),E=s.pop(),A=h.fromArray(d,E*3,xbe),L=h.fromArray(d,C*3,Tbe),F=h.fromArray(d,R*3,_be),I,N,g;r&&(I=k.fromArray(u,E*2,Sbe),N=k.fromArray(u,C*2,Zbe),g=k.fromArray(u,R*2,Rbe));let V=h.multiplyByScalar(h.normalize(A,bbe),y,bbe),G=h.multiplyByScalar(h.normalize(L,gbe),y,gbe),v=h.multiplyByScalar(h.normalize(F,ybe),y,ybe),X=h.magnitudeSquared(h.subtract(V,G,Xb)),Y=h.magnitudeSquared(h.subtract(G,v,Xb)),D=h.magnitudeSquared(h.subtract(v,V,Xb)),M=Math.max(X,Y,D),O,w,z;M>S?X===M?(O=`${Math.min(E,C)} ${Math.max(E,C)}`,a=f[O],l(a)||(w=h.add(A,L,Xb),h.multiplyByScalar(w,.5,w),d.push(w.x,w.y,w.z),a=d.length/3-1,f[O]=a,r&&(z=k.add(I,N,cC),k.multiplyByScalar(z,.5,z),u.push(z.x,z.y))),s.push(E,a,R),s.push(a,C,R)):Y===M?(O=`${Math.min(C,R)} ${Math.max(C,R)}`,a=f[O],l(a)||(w=h.add(L,F,Xb),h.multiplyByScalar(w,.5,w),d.push(w.x,w.y,w.z),a=d.length/3-1,f[O]=a,r&&(z=k.add(N,g,cC),k.multiplyByScalar(z,.5,z),u.push(z.x,z.y))),s.push(C,a,E),s.push(a,R,E)):D===M&&(O=`${Math.min(R,E)} ${Math.max(R,E)}`,a=f[O],l(a)||(w=h.add(F,A,Xb),h.multiplyByScalar(w,.5,w),d.push(w.x,w.y,w.z),a=d.length/3-1,f[O]=a,r&&(z=k.add(g,I,cC),k.multiplyByScalar(z,.5,z),u.push(z.x,z.y))),s.push(R,a,C),s.push(a,E,C)):(b.push(E),b.push(C),b.push(R))}let Z={attributes:{position:new Xe({componentDatatype:J.DOUBLE,componentsPerAttribute:3,values:d})},indices:b,primitiveType:Ie.TRIANGLES};return r&&(Z.attributes.st=new Xe({componentDatatype:J.FLOAT,componentsPerAttribute:2,values:u})),new At(Z)};var U6e=new pe,D6e=new pe,O6e=new pe,I6=new pe;dx.computeRhumbLineSubdivision=function(e,t,n,i,o){o=o??W.RADIANS_PER_DEGREE;let r=l(i),s=n.slice(0),a,c=t.length,d=new Array(c*3),u=new Array(c*2),m=0,p=0;for(a=0;a0;){let E=s.pop(),A=s.pop(),L=s.pop(),F=h.fromArray(d,L*3,xbe),I=h.fromArray(d,A*3,Tbe),N=h.fromArray(d,E*3,_be),g,V,G;r&&(g=k.fromArray(u,L*2,Sbe),V=k.fromArray(u,A*2,Zbe),G=k.fromArray(u,E*2,Rbe));let v=e.cartesianToCartographic(F,U6e),X=e.cartesianToCartographic(I,D6e),Y=e.cartesianToCartographic(N,O6e);S.setEndPoints(v,X);let D=S.surfaceDistance;Z.setEndPoints(X,Y);let M=Z.surfaceDistance;R.setEndPoints(Y,v);let O=R.surfaceDistance,w=Math.max(D,M,O),z,K,te,H,$;w>_?D===w?(z=`${Math.min(L,A)} ${Math.max(L,A)}`,a=f[z],l(a)||(K=S.interpolateUsingFraction(.5,I6),te=(v.height+X.height)*.5,H=h.fromRadians(K.longitude,K.latitude,te,e,Xb),d.push(H.x,H.y,H.z),a=d.length/3-1,f[z]=a,r&&($=k.add(g,V,cC),k.multiplyByScalar($,.5,$),u.push($.x,$.y))),s.push(L,a,E),s.push(a,A,E)):M===w?(z=`${Math.min(A,E)} ${Math.max(A,E)}`,a=f[z],l(a)||(K=Z.interpolateUsingFraction(.5,I6),te=(X.height+Y.height)*.5,H=h.fromRadians(K.longitude,K.latitude,te,e,Xb),d.push(H.x,H.y,H.z),a=d.length/3-1,f[z]=a,r&&($=k.add(V,G,cC),k.multiplyByScalar($,.5,$),u.push($.x,$.y))),s.push(A,a,L),s.push(a,E,L)):O===w&&(z=`${Math.min(E,L)} ${Math.max(E,L)}`,a=f[z],l(a)||(K=R.interpolateUsingFraction(.5,I6),te=(Y.height+v.height)*.5,H=h.fromRadians(K.longitude,K.latitude,te,e,Xb),d.push(H.x,H.y,H.z),a=d.length/3-1,f[z]=a,r&&($=k.add(G,g,cC),k.multiplyByScalar($,.5,$),u.push($.x,$.y))),s.push(E,a,A),s.push(a,L,A)):(b.push(L),b.push(A),b.push(E))}let C={attributes:{position:new Xe({componentDatatype:J.DOUBLE,componentsPerAttribute:3,values:d})},indices:b,primitiveType:Ie.TRIANGLES};return r&&(C.attributes.st=new Xe({componentDatatype:J.FLOAT,componentsPerAttribute:2,values:u})),new At(C)};dx.scaleToGeodeticHeight=function(e,t,n,i){n=n??ne.default;let o=w6e,r=k6e;if(t=t??0,i=i??!0,l(e)){let s=e.length;for(let a=0;a10&&t*2>e.length&&(this._array=e.slice(t),t=0),this._offset=t,this._length--,n};ux.prototype.peek=function(){if(this._length!==0)return this._array[this._offset]};ux.prototype.contains=function(e){return this._array.indexOf(e)!==-1};ux.prototype.clear=function(){this._array.length=this._offset=this._length=0};ux.prototype.sort=function(e){this._offset>0&&(this._array=this._array.slice(this._offset),this._offset=0),this._array.sort(e)};var mx=ux;var Fr={};Fr.computeHierarchyPackedLength=function(e,t){let n=0,i=[e];for(;i.length>0;){let o=i.pop();if(!l(o))continue;n+=2;let r=o.positions,s=o.holes;if(l(r)&&r.length>0&&(n+=r.length*t.packedLength),l(s)){let a=s.length;for(let c=0;c0;){let r=o.pop();if(!l(r))continue;let s=r.positions,a=r.holes;if(t[n++]=l(s)?s.length:0,t[n++]=l(a)?a.length:0,l(s)){let c=s.length;for(let d=0;d0?new Array(o):void 0;for(let a=0;aW.PI){let c=s;s=a,a=c}if(!(r.longitudea))return n.cartographicToCartesian(r)}function e7e(e,t,n,i){if(i===un.RHUMB)return $6e(e,t,n);let o=xi.lineSegmentPlane(e,t,cn.ORIGIN_XY_PLANE);if(l(o))return n.scaleToGeodeticSurface(o,o)}var t7e=new pe;function n7e(e,t,n){let i=[],o,r,s,a,c,d=0;for(;dt.cartesianToCartographic(m,t7e).longitude;if(s===0)i.push({position:d,type:s,visited:!1,next:a,theta:u(o)});else if(a!==0){if(c=e7e(o,r,t,n),++d,!l(c))continue;e.splice(d,0,c),i.push({position:d,type:s,visited:!1,next:a,theta:u(c)})}++d}return i}function Abe(e,t,n,i,o,r,s){let a=[],c=r,d=m=>p=>p.position===m,u=[];do{let m=n[c];a.push(m);let p=i.findIndex(d(c)),b=i[p];if(!l(b)){++c;continue}let{visited:f,type:y,next:_}=b;if(b.visited=!0,y===0){if(_===0){let C=i[p-(s?1:-1)];if(C?.position===c+1)C.visited=!0;else{++c;continue}}if(!f&&s&&_>0||r===c&&!s&&_<0){++c;continue}}if(!(s?y>=0:y<=0)){++c;continue}f||u.push(c);let Z=p+(s?1:-1),R=i[Z];if(!l(R)){++c;continue}c=R.position}while(c=0&&c!==r&&a.lengthd.theta-u.theta);let c=s[0].z>=0;o=Abe(i,o,s,a,1,0,c)}return i};Fr.polygonsFromHierarchy=function(e,t,n,i,o,r){let s=[],a=[],c=new mx;c.enqueue(e);let d=l(r);for(;c.length!==0;){let u=c.dequeue(),m=u.positions,p=u.holes,b,f;if(i)for(f=m.length,b=0;b1){for(let L of A)c.enqueue(new Lc(L,p));continue}}let Z=m.slice(),R=l(p)?p.length:0,C=[],E;for(b=0;bMath.PI&&(e-=W.TWO_PI),e}}});var lC=new pe,l7e=new h;xs.prototype.getLatitude=function(e){l(e)||(e=ne.default),lC.latitude=this.conformalLatitude,lC.longitude=this.longitude,lC.height=0;let t=this.ellipsoid.cartographicToCartesian(lC,l7e);return e.cartesianToCartographic(t,lC),lC.latitude};var d7e=new gn,u7e=new h,m7e=new h;xs.fromCartesian=function(e,t){let n=W.signNotZero(e.z),i=xs.NORTH_POLE_TANGENT_PLANE,o=xs.SOUTH_POLE;n<0&&(i=xs.SOUTH_POLE_TANGENT_PLANE,o=xs.NORTH_POLE);let r=d7e;r.origin=i.ellipsoid.scaleToGeocentricSurface(e,r.origin),r.direction=h.subtract(r.origin,o,u7e),h.normalize(r.direction,r.direction);let s=xi.rayPlane(r,i.plane,m7e),a=h.subtract(s,o,s),c=h.dot(i.xAxis,a),d=n*h.dot(i.yAxis,a);return l(t)?(t.position=new k(c,d),t.tangentPlane=i,t):new xs(new k(c,d),i)};xs.fromCartesianArray=function(e,t){let n=e.length;l(t)?t.length=n:t=new Array(n);for(let i=0;i=0?s:s+W.TWO_PI;o.westOverIdl=Math.min(o.westOverIdl,a),o.eastOverIdl=Math.max(o.eastOverIdl,a),r.west=Math.min(r.west,s),r.east=Math.max(r.east,s);let c=e.getLatitude(n),d=c;if(r.south=Math.min(r.south,c),r.north=Math.max(r.north,c),i!==un.RHUMB){let p=k.subtract(t.position,e.position,L7e),b=k.dot(t.position,p)/k.dot(p,p);if(b>0&&b<1){let f=k.add(t.position,k.multiplyByScalar(p,-b,p),W7e),y=rl.clone(t,v7e);y.position=f;let _=y.getLatitude(n);r.south=Math.min(r.south,_),r.north=Math.max(r.north,_),Math.abs(c)>Math.abs(_)&&(d=_)}}let u=t.x*e.y-e.x*t.y,m=Math.sign(u);m!==0&&(m*=k.angleBetween(t.position,e.position)),d>=0&&(o.northAngle+=m),d<=0&&(o.southAngle+=m)}var Ibe=new rl,F7e=new rl,Ym={northAngle:0,southAngle:0,westOverIdl:0,eastOverIdl:0};Mm.computeRectangleFromPositions=function(e,t,n,i){if(l(i)||(i=new re),e.length<3)return i;i.west=Number.POSITIVE_INFINITY,i.east=Number.NEGATIVE_INFINITY,i.south=Number.POSITIVE_INFINITY,i.north=Number.NEGATIVE_INFINITY,Ym.northAngle=0,Ym.southAngle=0,Ym.westOverIdl=Number.POSITIVE_INFINITY,Ym.eastOverIdl=Number.NEGATIVE_INFINITY;let o=e.length,r=rl.fromCartesian(e[0],F7e);for(let s=1;sYm.eastOverIdl-Ym.westOverIdl&&(i.west=Ym.westOverIdl,i.east=Ym.eastOverIdl,i.east>W.PI&&(i.east=i.east-W.TWO_PI),i.west>W.PI&&(i.west=i.west-W.TWO_PI)),W.equalsEpsilon(Math.abs(Ym.northAngle),W.TWO_PI,W.EPSILON10)&&(i.north=W.PI_OVER_TWO,i.east=W.PI,i.west=-W.PI),W.equalsEpsilon(Math.abs(Ym.southAngle),W.TWO_PI,W.EPSILON10)&&(i.south=-W.PI_OVER_TWO,i.east=W.PI,i.west=-W.PI),i};var I7e=new rl;function P7e(e,t,n){return e.height>=W.PI||e.width>=W.PI?rl.fromCartesian(t[0],I7e).tangentPlane:Ms.fromPoints(t,n)}var Pbe=new pe;function X7e(e,t,n){return(i,o)=>{if(e.height>=W.PI||e.width>=W.PI){if(e.south<0&&e.north>0){l(o)||(o=[]);for(let s=0;s=W.PI||e.width>=W.PI)return(o,r)=>{if(e.south<0&&e.north>0){let s=n.cartesianToCartographic(o,Pbe);return l(r)||(r=new k),r.x=s.longitude/W.PI,r.y=s.latitude/W.PI_OVER_TWO,r}return rl.fromCartesian(o,r)};let i=Ms.fromPoints(t,n);return(o,r)=>i.projectPointsOntoPlane(o,r)}function Y7e(e,t,n,i){return(o,r)=>!i&&(e.height>=W.PI_OVER_TWO||e.width>=2*W.PI_OVER_THREE)?oi.splitPolygonsOnEquator(o,t,n,r):o}function M7e(e,t,n,i){if(t.height>=W.PI||t.width>=W.PI)return nt.fromRectangle(t,void 0,Lbe);let o=e,r=Ms.fromPoints(o,n);return oi.computeBoundingRectangle(r.plane.normal,r.projectPointOntoPlane.bind(r),o,i,Lbe)}Mm.createGeometry=function(e){let t=e._vertexFormat,n=e._ellipsoid,i=e._granularity,o=e._stRotation,r=e._polygonHierarchy,s=e._perPositionHeight,a=e._closeTop,c=e._closeBottom,d=e._arcType,u=e._textureCoordinates,m=l(u),p=r.positions;if(p.length<3)return;let b=e.rectangle,f=oi.polygonsFromHierarchy(r,m,X7e(b,p,n),!s,n,Y7e(b,n,d,s)),y=f.hierarchy,_=f.polygons,S=function(v){return v},Z=m?oi.polygonsFromHierarchy(u,!0,S,!1,n).polygons:void 0;if(y.length===0)return;let R=y[0].outerRing,C=M7e(R,b,n,o),E=[],A=e._height,L=e._extrudedHeight,F=e._perPositionHeightExtrude||!W.equalsEpsilon(A,L,0,W.EPSILON2),I={perPositionHeight:s,vertexFormat:t,geometry:void 0,rotationAxis:P7e(b,R,n).plane.normal,projectTo2d:N7e(b,R,n),boundingRectangle:C,ellipsoid:n,stRotation:o,textureCoordinates:void 0,bottom:!1,top:!0,wall:!1,extrude:!1,arcType:d},N;if(F)for(I.extrude=!0,I.top=a,I.bottom=c,I.shadowVolume=e._shadowVolume,I.offsetAttribute=e._offsetAttribute,N=0;N<_.length;N++){let v=V7e(n,_[N],m?Z[N]:void 0,i,y[N],s,a,c,t,d),X;a&&c?(X=v.topAndBottom,I.geometry=oi.scaleToGeodeticHeightExtruded(X.geometry,A,L,n,s)):a?(X=v.topAndBottom,X.geometry.attributes.position.values=hi.scaleToGeodeticHeight(X.geometry.attributes.position.values,A,n,!s),I.geometry=X.geometry):c&&(X=v.topAndBottom,X.geometry.attributes.position.values=hi.scaleToGeodeticHeight(X.geometry.attributes.position.values,L,n,!0),I.geometry=X.geometry),(a||c)&&(I.wall=!1,X.geometry=P6(I),E.push(X));let Y=v.walls;I.wall=!0;for(let D=0;Dt(this.get(u,s),this.get(m,a)));for(let u=0;uthis._dirtyOffset+this._dirtyCount&&(this._dirtyCount=t+1-this._dirtyOffset)}_makeClean(){this._dirtyCount>0&&(this._dirtyCount=0,this._dirtyOffset=0,this._version++)}_makeDirtyBoundingVolume(){this._boundingVolumeAutoUpdate&&(this._dirtyBoundingVolume=!0)}update(t){t.mode!==se.SCENE3D&&xt("bufferprim-scenemode","BufferPrimitiveCollection requires SceneMode.SCENE3D."),this._dirtyBoundingVolume&&this._updateBoundingVolume(),this._allowPicking&&this._updatePickIds(t.context)}_isRendered(t){let n=t.passes;return this.show&&!bs(this._heightReference)&&(n.render||n.pick)}get primitiveCount(){return this._primitiveCount}get primitiveCountMax(){return this._primitiveCountMax}get byteLength(){return this._primitiveView.byteLength+this._positionView.byteLength+this._materialView.byteLength}get vertexCount(){return this._positionCount}get vertexCountMax(){return this._positionCountMax}get modelMatrix(){return this._modelMatrix}get boundingVolume(){return this._dirtyBoundingVolume&&this._updateBoundingVolume(),this._boundingVolume}get positionDatatype(){return this._positionDatatype}get positionNormalized(){return this._positionNormalized}get heightReference(){return this._heightReference}static _copySubArray(t,n,i){for(let o=0;o0?this.getHoles()[0]:this.vertexCount}getOuterPositions(n){return this._getPositionsRange(0,this.outerVertexCount,n)}get holeOffset(){return this._getUint32(wm.Layout.HOLE_OFFSET_U32)}get holeCount(){return this._getUint32(wm.Layout.HOLE_COUNT_U32)}getHoles(n){let{holeOffset:i,holeCount:o}=this,r=this._collection._holeIndexView;if(!l(n)){let s=r.byteOffset+i*r.BYTES_PER_ELEMENT,a=r.constructor;return new a(r.buffer,s,o)}for(let s=0;s0){let{attributeArrays:c}=n,{_dirtyOffset:d,_dirtyCount:u}=e,m=c.positionHigh,p=c.positionLow,b=n.indexArray,f=c.pickColor,y=c.showColorAlpha;for(let _=d,S=d+u;_0){let{indexOffset:c,indexCount:d,vertexOffset:u,vertexCount:m}=O7e(e);n.vertexArray.copyIndexFromRange(n.indexArray,c,d);for(let p in r)if(Object.hasOwn(r,p)){let b=p;n.vertexArray.copyAttributeFromRange(r[b],n.attributeArrays[b],u,m)}}}else{let{attributeArrays:c}=n;n.vertexArray=new Un({context:i,indexBuffer:it.createIndexBuffer({context:i,typedArray:n.indexArray,usage:Pe.STATIC_DRAW,indexDatatype:Oe.fromTypedArray(n.indexArray)}),attributes:[...o?[{index:w6.positionHigh,componentDatatype:J.FLOAT,componentsPerAttribute:3,vertexBuffer:it.createVertexBuffer({typedArray:c.positionHigh,context:i,usage:Pe.STATIC_DRAW})},{index:w6.positionLow,componentDatatype:J.FLOAT,componentsPerAttribute:3,vertexBuffer:it.createVertexBuffer({typedArray:c.positionLow,context:i,usage:Pe.STATIC_DRAW})}]:[{index:Ybe.position,componentDatatype:e._positionDatatype,componentsPerAttribute:3,normalize:e._positionNormalized,vertexBuffer:it.createVertexBuffer({typedArray:c.position,context:i,usage:Pe.STATIC_DRAW})}],{index:r.pickColor,componentDatatype:J.UNSIGNED_BYTE,componentsPerAttribute:4,vertexBuffer:it.createVertexBuffer({typedArray:c.pickColor,context:i,usage:Pe.STATIC_DRAW})},{index:r.showColorAlpha,componentDatatype:J.FLOAT,componentsPerAttribute:3,vertexBuffer:it.createVertexBuffer({typedArray:c.showColorAlpha,context:i,usage:Pe.STATIC_DRAW})}]})}l(n.renderState)||(n.renderState=ze.fromCache({blending:e._blendOption===Yi.OPAQUE?on.DISABLED:on.ALPHA_BLEND,depthTest:{enabled:!0}})),l(n.shaderProgram)||(n.shaderProgram=tn.fromCache({context:i,vertexShaderSource:new Je({sources:[Lv],defines:o?["USE_FLOAT64"]:[]}),fragmentShaderSource:new Je({sources:[Gv]}),attributeLocations:r}));let s=e.triangleCount*3;l(n.command)||(n.command=new lt({vertexArray:n.vertexArray,renderState:n.renderState,shaderProgram:n.shaderProgram,primitiveType:Ie.TRIANGLES,pass:e._blendOption===Yi.OPAQUE?Le.OPAQUE:Le.TRANSLUCENT,pickId:e._allowPicking?"v_pickColor":void 0,owner:e,count:s,modelMatrix:e.modelMatrix,boundingVolume:e.boundingVolume,debugShowBoundingVolume:e.debugShowBoundingVolume}));let a=n.command;return a.count!==s&&(a.count=s),a.debugShowBoundingVolume!==e.debugShowBoundingVolume&&(a.debugShowBoundingVolume=e.debugShowBoundingVolume),t.commandList.push(a),e._makeClean(),n}function O7e(e){let{_dirtyOffset:t,_dirtyCount:n}=e;e.get(t,ga);let i=ga.vertexOffset,o=ga.triangleOffset*3;e.get(t+n-1,ga);let r=ga.vertexOffset+ga.vertexCount-i,s=(ga.triangleOffset+ga.triangleCount)*3-o;return{indexOffset:o,indexCount:s,vertexOffset:i,vertexCount:r}}function B7e(){let e=this;l(e.vertexArray)&&e.vertexArray.destroy(),l(e.shaderProgram)&&e.shaderProgram.destroy(),l(e.renderState)&&ze.removeFromCache(e.renderState)}var bI=D7e;var{ERR_CAPACITY:ZUn}=na.Error,D6=class e extends na{constructor(t=B.EMPTY_OBJECT){super(t),this._holeCount=0,this._holeCountMax=t.holeCountMax??na.DEFAULT_CAPACITY,this._holeIndexView=null,this._triangleCount=0,this._triangleCountMax=t.triangleCountMax??na.DEFAULT_CAPACITY,this._triangleIndexView=null,this._allocateHoleIndexBuffer(),this._allocateTriangleIndexBuffer()}_getCollectionClass(){return e}_getPrimitiveClass(){return Ir}_getMaterialClass(){return Lu}_allocateHoleIndexBuffer(){this._holeIndexView=Oe.createTypedArray(this._positionCountMax,this._holeCountMax)}_allocateTriangleIndexBuffer(){this._triangleIndexView=Oe.createTypedArray(this._positionCountMax,this._triangleCountMax*3)}static clone(t,n,i){return super.clone(t,n,i),l(i)||(this._copySubArray(t._holeIndexView,n._holeIndexView,t.holeCount),this._copySubArray(t._triangleIndexView,n._triangleIndexView,t._triangleCount*3),n._holeCount=t._holeCount,n._triangleCount=t._triangleCount),n}static fromCollection(t,n,i){return super.fromCollection(t,n,i)}_cloneEmpty(t=B.EMPTY_OBJECT){return new e({holeCountMax:this.holeCountMax,triangleCountMax:this.triangleCountMax,...this._cloneEmptyBaseArgs(t)})}static _replaceBuffers(t,n){super._replaceBuffers(t,n),n._holeIndexView=t._holeIndexView,n._triangleIndexView=t._triangleIndexView}add(t,n=new Ir){super.add(t,n);let i=this._positionCount;n._setUint32(Ir.Layout.POSITION_OFFSET_U32,i),n._setUint32(Ir.Layout.POSITION_COUNT_U32,0);let o=this._holeCount;n._setUint32(Ir.Layout.HOLE_OFFSET_U32,o),n._setUint32(Ir.Layout.HOLE_COUNT_U32,0);let r=this._triangleCount;return n._setUint32(Ir.Layout.TRIANGLE_OFFSET_U32,r),n._setUint32(Ir.Layout.TRIANGLE_COUNT_U32,0),l(t.positions)&&n.setPositions(t.positions),l(t.holes)&&n.setHoles(t.holes),l(t.triangles)&&n.setTriangles(t.triangles),n}update(t){super.update(t),this._isRendered(t)&&(this._renderContext=bI(this,t,this._renderContext))}get byteLength(){return super.byteLength+this._holeIndexView.byteLength+this._triangleIndexView.byteLength}get holeCount(){return this._holeCount}get holeCountMax(){return this._holeCountMax}get triangleCount(){return this._triangleCount}get triangleCountMax(){return this._triangleCountMax}},Ma=D6;var n5n=x(T(),1);var vUn=x(T(),1);var{ERR_RESIZE:GUn,ERR_CAPACITY:LUn}=na.Error,hC=class hC extends rs{constructor(){super(...arguments);mt(this,"_collection",null)}static clone(n,i){return super.clone(n,i),i.setPositions(n.getPositions()),i}get vertexOffset(){return this._getUint32(hC.Layout.POSITION_OFFSET_U32)}get vertexCount(){return this._getUint32(hC.Layout.POSITION_COUNT_U32)}getPositions(n){let{vertexOffset:i,vertexCount:o}=this,r=this._collection._positionView;if(!l(n)){let s=r.byteOffset+i*3*r.BYTES_PER_ELEMENT,a=r.constructor;return new a(r.buffer,s,o*3)}for(let s=0;s0&&(o.hasPixelWidths||(o.hasPixelWidths=!n.widthInMeters),o.hasMeterWidths||(o.hasMeterWidths=n.widthInMeters)),o.primitiveCount+=s}static packPolylineGrid(t){let n=t.polylineSegments,i=t.polylineSegmentPrimitiveIndices,o=Math.max(1,Math.ceil(Math.sqrt(n.length/wbe))),r=new Array(o*o);for(let _=0;_=0)return(e+1)*.5/t.minimumTileScreenPixels;let n=t.metersPerUv;return-e*.5/Math.min(n.x,n.y)}function eqe(e,t,n,i){let o=e.x,r=t.x;r=o+W.negativePiToPi(r-o);let s=n.west+i*.5,a=s+W.negativePiToPi(o-s)-o;o+=a,r+=a;let c=n.north-n.south;e.x=(o-n.west)/i,e.y=(e.y-n.south)/c,t.x=(r-n.west)/i,t.y=(t.y-n.south)/c}function tqe(e,t,n){let i=-n,o=1+n,r=0,s=1,a=e.x,c=e.y,d=t.x,u=t.y,m=d-a,p=u-c,b=[-m,m,-p,p],f=[a-i,o-a,c-i,o-c];for(let y=0;y<4;y++){if(Math.abs(b[y])<1e-12){if(f[y]<0)return!1;continue}let _=f[y]/b[y];if(b[y]<0?r=Math.max(r,_):s=Math.min(s,_),r>s)return!1}return e.x=a+r*m,e.y=c+r*p,t.x=a+s*m,t.y=c+s*p,!0}function fx(e,t){return Math.max(0,Math.min(t-1,e))}var z6=new Float64Array(512),Bbe=new Float64Array(512),zbe={positions:new Float64Array(512),vertexCount:0};function nqe(e,t,n,i,o){z6.length>1,m=(d&1)===0?1:-1,p=d===0?n:d===1?i:d===2?o:r,b=c*4+4,f=(d&1)===0,y=f?Bbe:s.positions;y.length=0;for(let C=0;C=0;if(L!==R){let F=u===0?(p-S)/(E-S):(p-Z)/(A-Z);y[_*2]=u===0?p:S+F*(E-S),y[_*2+1]=u===0?Z+F*(A-Z):p,_++}L&&(y[_*2]=E,y[_*2+1]=A,_++),S=E,Z=A,R=L}if(_===0)return s.vertexCount=0,s;a=y,c=_}return s.vertexCount=c,s}function QO(e){let t=W.nextPowerOfTwo(Math.max(1,Math.ceil(Math.sqrt(e)))),n=W.nextPowerOfTwo(Math.max(1,Math.ceil(e/t)));return[t,n]}function Kbe(e,t){let[n,i]=QO(t.length),o=new Float32Array(n*i);return o.set(t),new vt({context:e,pixelFormat:Qe.RED,pixelDatatype:Ue.FLOAT,source:{width:n,height:i,arrayBufferView:o},sampler:Ot.NEAREST,flipY:!1})}function Jbe(e,t,n){l(n)||(n=new Float64Array(e._positionCountMax*2));let i=e._positionView,o=e.modelMatrix;for(let r=0;r0?2*i:0,triangleCountMax:0});for(let o=0;od.show:void 0);if(i.destroy(),e._bufferPolygonCollection=c,a){let d=e._polygons;for(let u=0;umC.equals(t.clippingPolygon,e))};sl.prototype.remove=function(e){let t=this._polygons,n=t.findIndex(o=>mC.equals(o.clippingPolygon,e));if(n===-1)return!1;let[i]=t.splice(n,1);return qbe(this,i),this._dirty=!0,this.polygonRemoved.raiseEvent(i.clippingPolygon,n),!0};sl.prototype.removeAll=function(){let e=this._polygons,t=e.length;for(let n=0;n{if(Vi._activeComputeCommandCount>=Vi._maximumComputeCommandCount){Vi._nextFrameCommandQueue.push(e);return}t.commandList.push(e),Vi._activeComputeCommandCount++};Vi._updateCommandQueue=e=>{if(Vi._maximumComputeCommandCount=Math.log2(wt.maximumCubeMapSize),Vi._nextFrameCommandQueue.length>0&&Vi._activeComputeCommandCounts,u_enuToFixedFrame:()=>c,u_faceDirection:()=>es.getDirection(m,ege),u_positionWC:()=>r,u_brightnessSaturationGammaIntensity:()=>d,u_groundColor:()=>e.groundColor.withAlpha(e.groundAlbedo,mqe)},owner:e});f.postExecute=()=>{if(e.isDestroyed()||f.canceled){Vi._activeComputeCommandCount--;return}let y=e._radianceMapComputeCommands;y[b]=void 0;let _=new fs({context:n,colorTextures:[e._radianceMapTextures[b]]});_._bind(),e._radianceCubeMap[m].copyFromFramebuffer(),_._unBind(),_.destroy(),Vi._activeComputeCommandCount--,y.some(l)||(e._convolutionsCommandsDirty=!0,e._shouldRegenerateShaders=!0)},e._radianceMapComputeCommands[u]=f,Vi._queueCommand(f,t),u++}e._radianceCommandsDirty=!1}}function fqe(e,t){let n=e._radianceCubeMap;n.generateMipmap();let i=e._mipmapLevels,o=e._textureDimensions,r=o.x/2,s=o.y/2,a=t.context,c=0,d=()=>{let p=e._specularMapTextures.length;c>=p&&(e._irradianceCommandDirty=!0,i>1&&(n.sampler=new Ot({minificationFilter:Ht.LINEAR_MIPMAP_LINEAR}),e._shouldRegenerateShaders=!0,e._va.destroy(),e._va=void 0,e._convolveSP.destroy(),e._convolveSP=void 0))},u=(p,b,f,y,_)=>()=>{if(e.isDestroyed()||p.canceled){Vi._activeComputeCommandCount--;return}let S=e._convolutionComputeCommands;S[b]=void 0,n.copyFace(t,f,y,_),c++,Vi._activeComputeCommandCount--,f.destroy(),e._specularMapTextures[b]=void 0,d()},m=0;for(let p=1;pp/(i-1),u_radianceTexture:()=>n??a.defaultTexture,u_faceDirection:()=>es.getDirection(b,ege)}});S.postExecute=u(S,m,f,b,p),e._convolutionComputeCommands[m]=S,Vi._queueCommand(S,t),++m}r/=2,s/=2}d()}var tge=new k(3,3);function pqe(e,t){let n=t.context,i=tge,o=e._irradianceMapTexture;l(o)&&!o.isDestroyed()&&o.destroy(),o=new vt({context:n,width:i.x,height:i.y,pixelDatatype:Ue.FLOAT,pixelFormat:Qe.RGBA}),e._irradianceMapTexture=o;let r=e._irradianceMapFS;l(r)||(r=new Je({sources:[Mv]}),e._irradianceMapFS=r);let s=new bu({fragmentShaderSource:r,outputTexture:o,owner:e,uniformMap:{u_radianceMap:()=>e._radianceCubeMap??n.defaultTexture}});s.postExecute=()=>{if(e.isDestroyed()||s.canceled){Vi._activeComputeCommandCount--;return}e._irradianceTextureDirty=!1,e._irradianceComputeCommand=void 0,e._sphericalHarmonicCoefficientsDirty=!0,e._irradianceMapFS=void 0,Vi._activeComputeCommandCount--},e._irradianceComputeCommand=s,Vi._queueCommand(s,t),e._irradianceTextureDirty=!0}function bqe(e,t){let n=t.context;if(!l(e._irradianceMapTexture))return;let i=new fs({context:n,colorTextures:[e._irradianceMapTexture],destroyAttachments:!1}),o=tge,r=n.readPixels({x:0,y:0,width:o.x,height:o.y,framebuffer:i});for(let s=0;s<9;++s)e._sphericalHarmonicCoefficients[s]=h.unpack(r,s*4),h.multiplyByScalar(e._sphericalHarmonicCoefficients[s],e.atmosphereScatteringIntensity,e._sphericalHarmonicCoefficients[s]);i.destroy(),e._irradianceMapTexture.destroy(),e._irradianceMapTexture=void 0,e._shouldRegenerateShaders=!0}Vi.prototype.update=function(e){let t=e.mode;if(!(Vi.isDynamicUpdateSupported(e)&&this._mipmapLevels>=1)||!this.enabled||!this.shouldUpdate||!l(this._position)||t===se.MORPHING){this._shouldRegenerateShaders=!1;return}Vi._updateCommandQueue(e);let i=e.atmosphere.dynamicLighting,o=lqe(this,e)||i===Nb.SUNLIGHT&&!Q.equalsEpsilon(e.time,this._lastTime,this.maximumSecondsDifference);if(this._shouldReset||o){this.reset(),this._shouldReset=!1,this._lastTime=Q.clone(e.time,this._lastTime);return}if(this._radianceMapDirty&&(hqe(this,e),this._radianceMapDirty=!1),this._convolutionsCommandsDirty&&(fqe(this,e),this._convolutionsCommandsDirty=!1),this._irradianceCommandDirty&&(pqe(this,e),this._irradianceCommandDirty=!1),this._irradianceTextureDirty){this._shouldRegenerateShaders=!1;return}if(this._sphericalHarmonicCoefficientsDirty){bqe(this,e),this._sphericalHarmonicCoefficientsDirty=!1;return}this._shouldRegenerateShaders=!1};Vi.prototype.isDestroyed=function(){return!1};Vi.prototype.destroy=function(){let e=this._radianceMapComputeCommands.length;for(let t=0;twt.maximumTextureSize||a>wt.maximumTextureSize){xt("PropertyTableTextureExceedsMaximumSize",`Cannot create a texture for the property table "${e.name}" because it exceeds the maximum texture size of ${wt.maximumTextureSize}.`);return}let c=Sqe(s,r),d=new Ot({wrapS:pn.CLAMP_TO_EDGE,wrapT:pn.CLAMP_TO_EDGE,minificationFilter:Ht.NEAREST,magnificationFilter:$n.NEAREST});return vt.create({context:i,pixelFormat:Qe.RGBA,pixelDatatype:Ue.UNSIGNED_BYTE,sampler:d,flipY:!1,source:{width:r,height:a,arrayBufferView:c}})}function Tqe(e,t,n,i){let o=[],r=n.properties;for(let[s,a]of Object.entries(r)){if(!a.isGpuCompatible(SI))continue;let c=e[s],d=l(c)?t[c.values]:_qe(a,i),u=d.length,m=a.cpuBytesPerElement(),p=u/m;if(p!==i)throw new ae(`Property with ID: "${s}" has (${p}), which does not match number of features in the property table: (${i}).`);o.push({view:d,classProperty:a})}return o}function _qe(e,t){let n=e.noData,i=St.getComponentCount(e.type),o=e.isArray?e.arrayLength:1;e.type===St.ENUM&&(n=e.enumType.valuesByName[n]),i===1&&(n=[n]),o===1&&(n=[n]);let r=e.cpuBytesPerElement(),s=Nt.getSizeInBytes(e.valueType),a=new ArrayBuffer(r*t),c=new DataView(a),d=Nt.getDataViewAccessors(c,e.valueType);for(let u=0;u=r;)S=o[S-r];o.push(S),s[y]=_}_>kqe&&(t instanceof Uint16Array||t instanceof Uint8Array)?t=new Uint32Array(t):_>Uqe&&t instanceof Uint8Array&&(t=new Uint16Array(t)),y===c?(c=_,t[a]=_):y===d?(d=_,t[a+1]=_):(u=_,t[a+2]=_),y=lge(i,c,d,u,p,b,f)}}e._triangleIndices=t,e._outlineCoordinatesTypedArray=new Float32Array(i)}function lge(e,t,n,i,o,r,s){let a=s?1:0,c=o?1:0,d=0,u=t7(e,t,a,c,d);if(u===0)return t;let m=0,p=o?1:0,b=r?1:0,f=t7(e,n,m,p,b);if(f===0)return n;let y=s?1:0,_=0,S=r?1:0,Z=t7(e,i,y,_,S);if(Z===0)return i;let R=u&f&Z,C,E,A;if(R&1)C=0,E=1,A=2;else if(R&2)C=0,A=1,E=2;else if(R&4)E=0,C=1,A=2;else if(R&8)E=0,A=1,C=2;else if(R&16)A=0,C=1,E=2;else if(R&32)A=0,E=1,C=2;else{let N=n7(u),g=n7(f),V=n7(Z);return N>1&1)+(e>>2&1)+(e>>3&1)+(e>>4&1)+(e>>5&1)}qO.prototype.updateAttribute=function(e){let t=this._extraVertices,n=e.length,i=n/this._originalVertexCount,o=t.length,r=e.constructor,s=new r(e.length+o*i);s.set(e);for(let a=0;a1;)i>>=1,r.push(dge(i));let s=new vt({context:e,source:{arrayBufferView:o,mipLevels:r},width:n,height:1,pixelFormat:Qe.LUMINANCE,sampler:new Ot({wrapS:pn.CLAMP_TO_EDGE,wrapT:pn.CLAMP_TO_EDGE,minificationFilter:Ht.LINEAR_MIPMAP_LINEAR,magnificationFilter:$n.LINEAR})});return t.outlineTexture=s,s};function dge(e){let t=new Uint8Array(e);return t[e-1]=192,e===8?t[e-1]=96:e===4?t[e-1]=48:e===2?t[e-1]=24:e===1&&(t[e-1]=12),t}function uge(e,t){this._originalVertexCount=t,this._edges=new Set;for(let n=0;n{this._resourcesLoaded=!0}).catch(r=>{this._processError=r})),l(this._processError)){this._state=cr.FAILED;let r=this._processError;this._processError=void 0,eB(this,r)}let n=this._textureErrors.pop();if(l(n)){let r=this.getError("Failed to load glTF texture",n);throw r.name="TextureError",r}if(this._state===cr.FAILED)return!1;let i=!1;try{i=this._process(t)}catch(r){this._state=cr.FAILED,eB(this,r)}let o=!1;try{o=this._processTextures(t)}catch(r){this._textureState=cr.FAILED,eB(this,r)}return this._incrementallyLoadTextures?i:i&&o}isUnloaded(){return this._state===cr.UNLOADED}unload(){l(this._gltfJsonLoader)&&!this._gltfJsonLoader.isDestroyed()&&Ni.unload(this._gltfJsonLoader),this._gltfJsonLoader=void 0,Bet(this),Zge(this),zet(this),Het(this),Ket(this),Jet(this),this._components=void 0,this._typedArray=void 0,this._state=cr.UNLOADED}};async function A$e(e){e._state=cr.LOADING,e._textureState=cr.LOADING;try{let t=Ni.getGltfJsonLoader({gltfResource:e._gltfResource,baseResource:e._baseResource,typedArray:e._typedArray,gltfJson:e._gltfJson});return e._gltfJsonLoader=t,await t.load(),e.isDestroyed()||e.isUnloaded()||t.isDestroyed()?void 0:(e._state=cr.LOADED,e._textureState=cr.LOADED,e)}catch(t){if(e.isDestroyed())return;e._state=cr.FAILED,e._textureState=cr.FAILED,eB(e,t)}}async function G$e(e,t){fn.supportsWebP.initialized||await fn.supportsWebP.initialize(),e._supportedImageFormats=new VI({webp:fn.supportsWebP(),basis:t.context.supportsBasis});let n=Oet(e,t);return e._state=cr.PROCESSING,e._textureState=cr.PROCESSING,l(e._gltfJsonLoader)&&e._releaseGltfJson&&(Ni.unload(e._gltfJsonLoader),e._gltfJsonLoader=void 0),n}function eB(e,t){throw e.unload(),e.getError("Failed to load glTF",t)}function L$e(e,t){let n=!0,i=e._geometryLoaders;for(let s=0;s{if(e.isDestroyed())return;let s=s7(o,t,i.typedArray);n.set(s)});return e._loaderPromises.push(r),n}function kd(e,t){if(l(t))return e===Number?t[0]:e.unpack(t)}function Y$e(e){return e===Number?0:new e}function M$e(e){switch(e){case J.BYTE:return 127;case J.UNSIGNED_BYTE:return 255;case J.SHORT:return 32767;case J.UNSIGNED_SHORT:return 65535;default:return 1}}var w$e={VEC2:new k(-1,-1),VEC3:new h(-1,-1,-1),VEC4:new ce(-1,-1,-1,-1)};function k$e(e,t){let n=M$e(e.componentDatatype),i=w$e[e.type],o=e.min;l(o)&&(o=t.divideByScalar(o,n,o),o=t.maximumByComponent(o,i,o));let r=e.max;l(r)&&(r=t.divideByScalar(r,n,r),r=t.maximumByComponent(r,i,r)),e.min=o,e.max=r}function U$e(e,t,n){let i=e.decodeMatrix,o=kd(n,e.decodedMin),r=kd(n,e.decodedMax);l(o)&&l(r)&&(t.min=o,t.max=r);let s=new Vn.Quantization;s.componentDatatype=t.componentDatatype,s.type=t.type,i.length===4?(s.quantizedVolumeOffset=i[2],s.quantizedVolumeStepSize=i[0]):i.length===9?(s.quantizedVolumeOffset=new k(i[6],i[7]),s.quantizedVolumeStepSize=new k(i[0],i[4])):i.length===16?(s.quantizedVolumeOffset=new h(i[12],i[13],i[14]),s.quantizedVolumeStepSize=new h(i[0],i[5],i[10])):i.length===25&&(s.quantizedVolumeOffset=new ce(i[20],i[21],i[22],i[23]),s.quantizedVolumeStepSize=new ce(i[0],i[6],i[12],i[18])),t.quantization=s}function D$e(e,t,n,i,o){let r=e.accessors[t],s=Dt.getMathType(r.type),a=r.normalized??!1,c=new i$e;c.name=n,c.semantic=i,c.setIndex=o,c.constant=Y$e(s),c.componentDatatype=r.componentType,c.normalized=a,c.count=r.count,c.type=r.type,c.min=kd(s,r.min),c.max=kd(s,r.max),c.byteOffset=r.byteOffset,c.byteStride=Yd(e,r),no(r,"WEB3D_quantized_attributes")&&U$e(r.extensions.WEB3D_quantized_attributes,c,s);let d=c.semantic===dt.POSITION||c.semantic===dt.NORMAL||c.semantic===dt.TANGENT||c.semantic===dt.TEXCOORD||c.semantic===dt.FEATURE_ID||c.semantic===dt.SCALE||c.semantic===dt.ROTATION;return e.extensionsRequired?.includes("KHR_mesh_quantization")&&a&&d&&k$e(c,s),c}function Age(e){let n=/^\w+_(\d+)$/.exec(e);if(n!==null)return parseInt(n[1])}var O$e={gltfSemantic:void 0,renamedSemantic:void 0,modelSemantic:void 0};function a7(e,t,n){let i=n;e._renameBatchIdSemantic&&(n==="_BATCHID"||n==="BATCHID")&&(i="_FEATURE_ID_0");let o=t.fromGltfSemantic(i),r=O$e;return r.gltfSemantic=n,r.renamedSemantic=i,r.modelSemantic=o,r}function B$e(e){let t=e===dt.POSITION,n=e===dt.FEATURE_ID,i=e===dt.TEXCOORD;return t||n||i}function z$e(e,t,n,i){if(e.byteOffset=0,e.byteStride=void 0,e.quantization=t.quantization,n&&(e.buffer=t.buffer),i){let o=l(t.quantization)?t.quantization.componentDatatype:e.componentDatatype;e.typedArray=J.createArrayBufferView(o,t.typedArray.buffer)}}function H$e(e,t,n,i){if(e.byteOffset=0,e.byteStride=void 0,n&&(e.buffer=t.buffer),i&&l(t.typedArray)&&(e.typedArray=J.createArrayBufferView(e.componentDatatype,t.typedArray.buffer)),e.semantic===dt.POSITION){let o=s=>{let a=1/0,c=-1/0,d=1/0,u=-1/0,m=1/0,p=-1/0;for(let b=0;b{l(o)&&l(o.attributes)&&l(o.attributes[p])?z$e(S,Z,s,a):l(r)?H$e(S,Z,s,a):K$e(d,u,S,Z,s,a)},S}function Lge(e,t,n,i,o,r,s,a,c){let d=n.modelSemantic,u=d===dt.POSITION,m=d===dt.FEATURE_ID,p=u&&!s&&e._loadAttributesFor2D&&!c.scene3DOnly,b=u&&e._enablePick&&!c.context.webgl2,f=e._loadForClassification&&m,y=e._loadAttributesAsTypedArray,_=!y,S=y||p||b||f,C=Gge(e,t,n,i,o,r,a?!1:_,a?!0:S,c),E=new hS.AttributeLoadPlan(C);return E.loadBuffer=_,E.loadTypedArray=S,E}function J$e(e,t,n,i,o){let r=e.gltfJson.accessors,s=l(n.ROTATION),a=l(n.TRANSLATION)&&l(r[n.TRANSLATION].min)&&l(r[n.TRANSLATION].max),c=a7(e,Pr,i),d=c.modelSemantic,u=d===Pr.TRANSLATION||d===Pr.ROTATION||d===Pr.SCALE,m=d===Pr.TRANSLATION,p=e._loadAttributesAsTypedArray||s&&u||!o.context.instancedArrays,b=e._enablePick&&!o.context.webgl2,f=!p,y=e._loadAttributesFor2D&&!o.scene3DOnly;return Gge(e,t,c,void 0,void 0,void 0,f,p||m&&(!a||y||b),o)}function j$e(e,t,n,i,o,r){let s=e.gltfJson.accessors[t],a=s.bufferView,c=n.extensions??B.EMPTY_OBJECT,d=c.KHR_draco_mesh_compression,u=l(c.EXT_mesh_primitive_edge_visibility);if(!l(d)&&!l(a))return;let m=new o$e;m.count=s.count;let p=e._loadAttributesAsTypedArray,b=(e._loadIndicesForWireframe||e._enablePick)&&!r.context.webgl2,f=e._loadForClassification&&i,_=!p,S=p||b||f||u,C=I$e(e,t,n,d,o?!1:_,o?!0:S,r),E=e._geometryLoaders.length;e._geometryLoaders.push(C);let A=C.load();e._loaderPromises.push(A),e._geometryCallbacks[E]=()=>{m.indexDatatype=C.indexDatatype,m.buffer=C.buffer,m.typedArray=C.typedArray};let L=new hS.IndicesLoadPlan(m);return L.loadBuffer=_,L.loadTypedArray=S,L}function Q$e(e,t,n){return new Ot({wrapR:e.wrapR,wrapS:e.wrapS,wrapT:e.wrapT,minificationFilter:t??e.minificationFilter,magnificationFilter:n??e.magnificationFilter,maximumAnisotropy:e.maximumAnisotropy})}function td(e,t,n,i,o){let r=e.gltfJson,s=Md.getImageIdFromTexture({gltf:r,textureId:t.index,supportedImageFormats:e._supportedImageFormats});if(!l(s))return;let a=Ni.getTextureLoader({gltf:r,textureInfo:t,gltfResource:e._gltfResource,baseResource:e._baseResource,supportedImageFormats:e._supportedImageFormats,frameState:n,asynchronous:e._asynchronous}),c=Md.createModelTextureReader({textureInfo:t}),d=e._textureLoaders.length;e._textureLoaders.push(a);let u=a.load().catch(m=>{if(!e.isDestroyed()){if(!e._incrementallyLoadTextures)throw m;e._textureState=cr.FAILED,e._textureErrors.push(m)}});return e._texturesPromises.push(u),e._textureCallbacks[d]=()=>{let m=a.texture;c.texture=m,(l(i)||l(o))&&(m.sampler=Q$e(m.sampler,i,o))},c}function q$e(e,t,n){let{diffuseTexture:i,specularGlossinessTexture:o,diffuseFactor:r,specularFactor:s,glossinessFactor:a}=t,c=new _$e;return l(i)&&(c.diffuseTexture=td(e,i,n)),l(o)&&(c.specularGlossinessTexture=td(e,o,n)),c.diffuseFactor=kd(ce,r),c.specularFactor=kd(h,s),c.glossinessFactor=a,c}function $$e(e,t,n){let{baseColorTexture:i,metallicRoughnessTexture:o,baseColorFactor:r,metallicFactor:s,roughnessFactor:a}=t,c=new T$e;return l(i)&&(c.baseColorTexture=td(e,i,n)),l(o)&&(c.metallicRoughnessTexture=td(e,o,n)),c.baseColorFactor=kd(ce,r),c.metallicFactor=s,c.roughnessFactor=a,c}function eet(e,t,n){let{specularFactor:i,specularTexture:o,specularColorFactor:r,specularColorTexture:s}=t,a=new S$e;return l(o)&&(a.specularTexture=td(e,o,n)),l(s)&&(a.specularColorTexture=td(e,s,n)),a.specularFactor=i,a.specularColorFactor=kd(h,r),a}function tet(e,t,n){let{anisotropyStrength:i=i7.DEFAULT_ANISOTROPY_STRENGTH,anisotropyRotation:o=i7.DEFAULT_ANISOTROPY_ROTATION,anisotropyTexture:r}=t,s=new i7;return l(r)&&(s.anisotropyTexture=td(e,r,n)),s.anisotropyStrength=i,s.anisotropyRotation=o,s}function net(e,t,n){let{clearcoatFactor:i=o7.DEFAULT_CLEARCOAT_FACTOR,clearcoatTexture:o,clearcoatRoughnessFactor:r=o7.DEFAULT_CLEARCOAT_ROUGHNESS_FACTOR,clearcoatRoughnessTexture:s,clearcoatNormalTexture:a}=t,c=new o7;return l(o)&&(c.clearcoatTexture=td(e,o,n)),l(s)&&(c.clearcoatRoughnessTexture=td(e,s,n)),l(a)&&(c.clearcoatNormalTexture=td(e,a,n)),c.clearcoatFactor=i,c.clearcoatRoughnessFactor=r,c}function iet(e){return new Z$e(e)}function oet(e){if(!l(e))return;let t=new R$e;if(l(e.width)){let n=e.width;n>0&&Math.floor(n)===n&&(t.width=n)}if(l(e.pattern)){let n=e.pattern;n>=0&&n<=65535&&Math.floor(n)===n&&(t.pattern=n)}if(!(!l(t.width)&&!l(t.pattern)))return t}function ret(e,t,n){let i=new C$e,o=t.extensions??B.EMPTY_OBJECT,r=o.KHR_materials_pbrSpecularGlossiness,s=o.KHR_materials_specular,a=o.KHR_materials_anisotropy,c=o.KHR_materials_clearcoat,d=t.pbrMetallicRoughness,u=o.BENTLEY_materials_planar_fill;i.unlit=l(o.KHR_materials_unlit),l(r)?i.specularGlossiness=q$e(e,r,n):(l(d)&&(i.metallicRoughness=$$e(e,d,n)),l(s)&&!i.unlit&&(i.specular=eet(e,s,n)),l(a)&&!i.unlit&&(i.anisotropy=tet(e,a,n)),l(c)&&!i.unlit&&(i.clearcoat=net(e,c,n))),l(t.emissiveTexture)&&(i.emissiveTexture=td(e,t.emissiveTexture,n)),l(t.normalTexture)&&!e._loadForClassification&&(i.normalTexture=td(e,t.normalTexture,n)),l(t.occlusionTexture)&&(i.occlusionTexture=td(e,t.occlusionTexture,n)),i.emissiveFactor=kd(h,t.emissiveFactor),i.alphaMode=t.alphaMode,i.alphaCutoff=t.alphaCutoff,i.doubleSided=t.doubleSided,l(u)&&(i.planarFill=iet(u));let m=o.BENTLEY_materials_point_style;if(l(m)&&l(m.diameter)){let p=m.diameter;p>=1&&(i.pointDiameter=Math.floor(p))}return i.lineStyle=oet(o.BENTLEY_materials_line_style),i}function Wge(e,t){let n=new Rge;return n.featureCount=e.featureCount,n.nullFeatureId=e.nullFeatureId,n.propertyTableId=e.propertyTable,n.setIndex=e.attribute,n.label=e.label,n.positionalLabel=t,n}function vge(e,t,n,i){let o=new Rge,r=e.featureIds;return o.featureCount=n,o.propertyTableId=t,o.setIndex=Age(r.attribute),o.positionalLabel=i,o}function Fge(e,t){let n=new Vge;return n.propertyTableId=e.propertyTable,n.featureCount=e.featureCount,n.nullFeatureId=e.nullFeatureId,n.label=e.label,n.positionalLabel=t,n.offset=0,n.repeat=1,n}function Ige(e,t,n,i){let o=new Vge,r=e.featureIds;o.propertyTableId=t,o.featureCount=n,o.offset=r.constant??0;let s=r.divisor??0;return o.repeat=s===0?void 0:s,o.positionalLabel=i,o}function set(e,t,n,i){let o=new Cge;o.featureCount=t.featureCount,o.nullFeatureId=t.nullFeatureId,o.propertyTableId=t.propertyTable,o.label=t.label,o.positionalLabel=i;let r=t.texture;o.textureReader=td(e,r,n,Ht.NEAREST,$n.NEAREST);let a=(l(r.channels)?r.channels:[0]).map(function(c){return"rgba".charAt(c)}).join("");return o.textureReader.channels=a,o}function aet(e,t,n,i,o,r){let s=new Cge,a=t.featureIds,c=a.texture;return s.featureCount=o,s.propertyTableId=n,s.textureReader=td(e,c,i,Ht.NEAREST,$n.NEAREST),s.textureReader.channels=a.channels,s.positionalLabel=r,s}function cet(e,t,n,i,o){let r=new r$e,s=void 0,a=void 0,c=void 0,d=!1;for(let u in t){if(!t.hasOwnProperty(u))continue;let m=t[u],p=a7(e,dt,u),b=Lge(e,m,p,s,a,c,d,n,o);r.attributes.push(b.attribute),i.attributePlans.push(b)}return r}function det(e){let i=e?.KHR_gaussian_splatting?.extensions?.KHR_gaussian_splatting_compression_spz_2;if(l(i))return i}function Pge(e,t){if(!l(t))return;let n=e.gltfJson.materials;if(!l(n)||t<0||t>=n.length)return;let i=n[t];if(!l(i))return;let o=i.pbrMetallicRoughness??B.EMPTY_OBJECT,r=kd(ce,o.baseColorFactor);return l(r)?r:new ce(1,1,1,1)}function uet(e){switch(e){case J.UNSIGNED_BYTE:return 255;case J.UNSIGNED_SHORT:return 65535;case J.UNSIGNED_INT:return 4294967295;default:throw new ae("EXT_mesh_primitive_edge_visibility line strings indices must use unsigned scalar component types.")}}function met(e,t,n){if(!l(t)||t.length===0)return;let i=new Array(t.length);for(let o=0;on[s]);let r=t.inverseBindMatrices;if(l(r)){let s=e.gltfJson.accessors[r];i.inverseBindMatrices=NI(e,s)}else i.inverseBindMatrices=new Array(o.length).fill(P.IDENTITY);return i}function Let(e,t){let n=e.gltfJson.skins;if(e._loadForClassification||!l(n))return[];let i=n.map(function(r,s){let a=Get(e,r,t);return a.index=s,a}),o=e.gltfJson.nodes;for(let r=0;r{setTimeout(()=>r.setStatus(""),1),de()},1)):de()})(),V?o=r:o=new Promise((de,oe)=>{_=de,S=oe}),o}var UC=(e,t,n)=>{let i=e.vf32_ptr(t),o=t.size(),r=i>>2,s=e.HEAPF32.slice(r,r+o);if(n!==void 0)for(let a=0;a1/(1+Math.exp(-e)),Att=e=>t=>t*e+.5,Gtt=(e,t,n)=>{let i=n?.colorScaleFactor??.282;return{numPoints:t.numPoints,shDegree:t.shDegree,antialiased:t.antialiased,positions:UC(e,t.positions),scales:UC(e,t.scales,Math.exp),rotations:UC(e,t.rotations),alphas:UC(e,t.alphas,Ett),colors:UC(e,t.colors,Att(i)),sh:UC(e,t.sh)}},Ltt=(e,t)=>{e._free(e.vf32_ptr(t.positions)),e._free(e.vf32_ptr(t.scales)),e._free(e.vf32_ptr(t.rotations)),e._free(e.vf32_ptr(t.alphas)),e._free(e.vf32_ptr(t.colors)),e._free(e.vf32_ptr(t.sh))},TTe=async(e,t)=>{var n;let i=await Vtt(),o=e instanceof Uint8Array?e:new Uint8Array(e),r=null;try{if(r=i._malloc(Uint8Array.BYTES_PER_ELEMENT*o.length),r===null)throw new Error("couldn't allocate memory");i.HEAPU8.set(o,r/Uint8Array.BYTES_PER_ELEMENT);let s=i.CoordinateSystem[((n=t?.unpackOptions)==null?void 0:n.coordinateSystem)??"UNSPECIFIED"],a=i.load_spz(r,o.length,{coordinateSystem:s}),c=Gtt(i,a,t);return Ltt(i,a),c}catch(s){throw s}finally{r!==null&&i._free(r)}};var Wtt=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"}));var vtt=[0,9,24,45],Ftt=14,Itt=1.6*1024*1024*1024;function Ptt(e,t){let n=t?.attributes;if(!l(n))return;let i=n.POSITION;if(!l(i))return;let o=e?.accessors?.[i];if(!l(o)||o.count<=0)return;let r=0;for(let s in n)if(Object.prototype.hasOwnProperty.call(n,s)){let a=/SH_DEGREE_(\d+)_COEF_/.exec(s);a&&(r=Math.max(r,parseInt(a[1],10)))}return{numPoints:o.count,shDegree:r}}function Xtt(e,t){let n=Ftt+(vtt[t]??0);return e*n*Float32Array.BYTES_PER_ELEMENT*2}var Y7=class extends oo{constructor(t){super(),t=t??B.EMPTY_OBJECT;let n=t.resourceCache,i=t.gltf,o=t.primitive,r=t.spz,s=t.gltfResource,a=t.baseResource,c=t.cacheKey;this._resourceCache=n,this._gltfResource=s,this._baseResource=a,this._gltf=i,this._primitive=o,this._spz=r,this._cacheKey=c,this._bufferViewLoader=void 0,this._bufferViewTypedArray=void 0,this._decodePromise=void 0,this._decodedData=void 0,this._state=Rt.UNLOADED,this._promise=void 0,this._spzError=void 0}get cacheKey(){return this._cacheKey}get decodedData(){return this._decodedData}async load(){return l(this._promise)?this._promise:(this._state=Rt.LOADING,this._promise=Ntt(this),this._promise)}process(t){if(this._state===Rt.READY)return!0;if(this._state!==Rt.PROCESSING||(l(this._spzError)&&M7(this,this._spzError),!l(this._bufferViewTypedArray))||l(this._decodePromise))return!1;let n=Ptt(this._gltf,this._primitive);if(l(n)){let o=Xtt(n.numPoints,n.shDegree);if(o>Itt){let r=Math.round(o/1048576);return M7(this,new ae(`SPZ data too large to decode: ${n.numPoints.toLocaleString()} splats with spherical harmonics degree ${n.shDegree} would require approximately ${r} MB, which exceeds the WASM memory limit. Consider using a lower spherical harmonics degree or splitting the dataset into smaller tiles.`)),!1}}let i=TTe(this._bufferViewTypedArray,{unpackOptions:{coordinateSystem:"UNSPECIFIED"}});if(!l(i))return!1;this._decodePromise=Ytt(this,i)}unload(){l(this._bufferViewLoader)&&this._resourceCache.unload(this._bufferViewLoader),this._bufferViewLoader=void 0,this._bufferViewTypedArray=void 0,this._decodedData=void 0,this._gltf=void 0,this._primitive=void 0}};async function Ntt(e){let t=e._resourceCache;try{let n=t.getBufferViewLoader({gltf:e._gltf,bufferViewId:e._spz.bufferView,gltfResource:e._gltfResource,baseResource:e._baseResource});return e._bufferViewLoader=n,await n.load(),e.isDestroyed()?void 0:(e._bufferViewTypedArray=n.typedArray,e._state=Rt.PROCESSING,e)}catch(n){if(e.isDestroyed())return;M7(e,n)}}function M7(e,t){throw e.unload(),e._state=Rt.FAILED,e.getError("Failed to load SPZ",t)}async function Ytt(e,t){try{let n=await t;return e.isDestroyed()?void 0:(e.unload(),e._decodedData={gcloud:n},e._state=Rt.READY,e._baseResource)}catch(n){if(e.isDestroyed())return;e._spzError=n}}var dP=Y7;var D$n=x(T(),1);var X$n=x(T(),1);var x$n=x(T(),1);function uP(e){e=e??B.EMPTY_OBJECT;let t=e.id,n=e.properties??{},i={};for(let o in n)if(n.hasOwnProperty(o)){let r=n[o];l(r.semantic)&&(i[r.semantic]=r)}this._id=t,this._name=e.name,this._description=e.description,this._properties=n,this._propertiesBySemantic=i,this._extras=$e(e.extras,!0),this._extensions=$e(e.extensions,!0)}uP.fromJson=function(e){e=e??B.EMPTY_OBJECT;let t=e.id,n=e.class,i={};for(let o in n.properties)if(n.properties.hasOwnProperty(o)){let r=zp.fromJson({id:o,property:n.properties[o],enums:e.enums});i[o]=r}return new uP({id:t,name:n.name,description:n.description,properties:i,extras:n.extras,extensions:n.extensions})};Object.defineProperties(uP.prototype,{properties:{get:function(){return this._properties}},propertiesBySemantic:{get:function(){return this._propertiesBySemantic}},id:{get:function(){return this._id}},name:{get:function(){return this._name}},description:{get:function(){return this._description}},extras:{get:function(){return this._extras}},extensions:{get:function(){return this._extensions}}});uP.BATCH_TABLE_CLASS_NAME="_batchTable";var gf=uP;var G$n=x(T(),1);var Z$n=x(T(),1);function SB(e){e=e??B.EMPTY_OBJECT;let t=e.value,n=e.name;this._value=t,this._name=n,this._description=e.description,this._extras=$e(e.extras,!0),this._extensions=$e(e.extensions,!0)}SB.fromJson=function(e){return new SB({value:e.value,name:e.name,description:e.description,extras:e.extras,extensions:e.extensions})};Object.defineProperties(SB.prototype,{value:{get:function(){return this._value}},name:{get:function(){return this._name}},description:{get:function(){return this._description}},extras:{get:function(){return this._extras}},extensions:{get:function(){return this._extensions}}});var mP=SB;function ZB(e){e=e??B.EMPTY_OBJECT;let t=e.id,n=e.values,i={},o={},r=n.length;for(let a=0;a=r;)S=o[S-r];o.push(S),s[y]=_}_>int&&(t instanceof Uint16Array||t instanceof Uint8Array)?t=new Uint32Array(t):_>ont&&t instanceof Uint8Array&&(t=new Uint16Array(t)),y===c?(c=_,t[a]=_):y===d?(d=_,t[a+1]=_):(u=_,t[a+2]=_),y=CTe(i,c,d,u,p,b,f)}}e._triangleIndices=t,e._outlineCoordinatesTypedArray=new Float32Array(i)}function CTe(e,t,n,i,o,r,s){let a=s?1:0,c=o?1:0,d=0,u=D7(e,t,a,c,d);if(u===0)return t;let m=0,p=o?1:0,b=r?1:0,f=D7(e,n,m,p,b);if(f===0)return n;let y=s?1:0,_=0,S=r?1:0,Z=D7(e,i,y,_,S);if(Z===0)return i;let R=u&f&Z,C,E,A;if(R&1)C=0,E=1,A=2;else if(R&2)C=0,A=1,E=2;else if(R&4)E=0,C=1,A=2;else if(R&8)E=0,A=1,C=2;else if(R&16)A=0,C=1,E=2;else if(R&32)A=0,E=1,C=2;else{let N=O7(u),g=O7(f),V=O7(Z);return N>1&1)+(e>>2&1)+(e>>3&1)+(e>>4&1)+(e>>5&1)}CB.prototype.updateAttribute=function(e){let t=this._extraVertices,n=e.length,i=n/this._originalVertexCount,o=t.length,r=e.constructor,s=new r(e.length+o*i);s.set(e);for(let a=0;a1;)i>>=1,r.push(VTe(i));let s=new vt({context:e,source:{arrayBufferView:o,mipLevels:r},width:n,height:1,pixelFormat:Qe.LUMINANCE,sampler:new Ot({wrapS:pn.CLAMP_TO_EDGE,wrapT:pn.CLAMP_TO_EDGE,minificationFilter:Ht.LINEAR_MIPMAP_LINEAR,magnificationFilter:$n.LINEAR})});return t.outlineTexture=s,s};function VTe(e){let t=new Uint8Array(e);return t[e-1]=192,e===8?t[e-1]=96:e===4?t[e-1]=48:e===2?t[e-1]=24:e===1&&(t[e-1]=12),t}function ETe(e,t){this._originalVertexCount=t,this._edges=new Set;for(let n=0;n{this._resourcesLoaded=!0}).catch(r=>{this._processError=r})),l(this._processError)){this._state=cr.FAILED;let r=this._processError;this._processError=void 0,EB(this,r)}let n=this._textureErrors.pop();if(l(n)){let r=this.getError("Failed to load glTF texture",n);throw r.name="TextureError",r}if(this._state===cr.FAILED)return!1;let i=!1;try{i=this._process(t)}catch(r){this._state=cr.FAILED,EB(this,r)}let o=!1;try{o=this._processTextures(t)}catch(r){this._textureState=cr.FAILED,EB(this,r)}return this._incrementallyLoadTextures?i:i&&o}isUnloaded(){return this._state===cr.UNLOADED}unload(){l(this._gltfJsonLoader)&&!this._gltfJsonLoader.isDestroyed()&&Yi.unload(this._gltfJsonLoader),this._gltfJsonLoader=void 0,rot(this),MTe(this),sot(this),aot(this),cot(this),lot(this),this._components=void 0,this._typedArray=void 0,this._state=cr.UNLOADED}};async function Ont(e){e._state=cr.LOADING,e._textureState=cr.LOADING;try{let t=Yi.getGltfJsonLoader({gltfResource:e._gltfResource,baseResource:e._baseResource,typedArray:e._typedArray,gltfJson:e._gltfJson});return e._gltfJsonLoader=t,await t.load(),e.isDestroyed()||e.isUnloaded()||t.isDestroyed()?void 0:(e._state=cr.LOADED,e._textureState=cr.LOADED,e)}catch(t){if(e.isDestroyed())return;e._state=cr.FAILED,e._textureState=cr.FAILED,EB(e,t)}}async function Bnt(e,t){fn.supportsWebP.initialized||await fn.supportsWebP.initialize(),e._supportedImageFormats=new yP({webp:fn.supportsWebP(),basis:t.context.supportsBasis});let n=oot(e,t);return e._state=cr.PROCESSING,e._textureState=cr.PROCESSING,l(e._gltfJsonLoader)&&e._releaseGltfJson&&(Yi.unload(e._gltfJsonLoader),e._gltfJsonLoader=void 0),n}function EB(e,t){throw e.unload(),e.getError("Failed to load glTF",t)}function znt(e,t){let n=!0,i=e._geometryLoaders;for(let s=0;s{if(e.isDestroyed())return;let s=K7(o,t,i.typedArray);n.set(s)});return e._loaderPromises.push(r),n}function kd(e,t){if(l(t))return e===Number?t[0]:e.unpack(t)}function eit(e){return e===Number?0:new e}function tit(e){switch(e){case J.BYTE:return 127;case J.UNSIGNED_BYTE:return 255;case J.SHORT:return 32767;case J.UNSIGNED_SHORT:return 65535;default:return 1}}var nit={VEC2:new k(-1,-1),VEC3:new h(-1,-1,-1),VEC4:new ce(-1,-1,-1,-1)};function iit(e,t){let n=tit(e.componentDatatype),i=nit[e.type],o=e.min;l(o)&&(o=t.divideByScalar(o,n,o),o=t.maximumByComponent(o,i,o));let r=e.max;l(r)&&(r=t.divideByScalar(r,n,r),r=t.maximumByComponent(r,i,r)),e.min=o,e.max=r}function oit(e,t,n){let i=e.decodeMatrix,o=kd(n,e.decodedMin),r=kd(n,e.decodedMax);l(o)&&l(r)&&(t.min=o,t.max=r);let s=new Vn.Quantization;s.componentDatatype=t.componentDatatype,s.type=t.type,i.length===4?(s.quantizedVolumeOffset=i[2],s.quantizedVolumeStepSize=i[0]):i.length===9?(s.quantizedVolumeOffset=new k(i[6],i[7]),s.quantizedVolumeStepSize=new k(i[0],i[4])):i.length===16?(s.quantizedVolumeOffset=new h(i[12],i[13],i[14]),s.quantizedVolumeStepSize=new h(i[0],i[5],i[10])):i.length===25&&(s.quantizedVolumeOffset=new ce(i[20],i[21],i[22],i[23]),s.quantizedVolumeStepSize=new ce(i[0],i[6],i[12],i[18])),t.quantization=s}function rit(e,t,n,i,o){let r=e.accessors[t],s=Dt.getMathType(r.type),a=r.normalized??!1,c=new xnt;c.name=n,c.semantic=i,c.setIndex=o,c.constant=eit(s),c.componentDatatype=r.componentType,c.normalized=a,c.count=r.count,c.type=r.type,c.min=kd(s,r.min),c.max=kd(s,r.max),c.byteOffset=r.byteOffset,c.byteStride=Yd(e,r),ro(r,"WEB3D_quantized_attributes")&&oit(r.extensions.WEB3D_quantized_attributes,c,s);let d=c.semantic===dt.POSITION||c.semantic===dt.NORMAL||c.semantic===dt.TANGENT||c.semantic===dt.TEXCOORD||c.semantic===dt.FEATURE_ID||c.semantic===dt.SCALE||c.semantic===dt.ROTATION;return e.extensionsRequired?.includes("KHR_mesh_quantization")&&a&&d&&iit(c,s),c}function OTe(e){let n=/^\w+_(\d+)$/.exec(e);if(n!==null)return parseInt(n[1])}var sit={gltfSemantic:void 0,renamedSemantic:void 0,modelSemantic:void 0};function J7(e,t,n){let i=n;e._renameBatchIdSemantic&&(n==="_BATCHID"||n==="BATCHID")&&(i="_FEATURE_ID_0");let o=t.fromGltfSemantic(i),r=sit;return r.gltfSemantic=n,r.renamedSemantic=i,r.modelSemantic=o,r}function ait(e){let t=e===dt.POSITION,n=e===dt.FEATURE_ID,i=e===dt.TEXCOORD;return t||n||i}function cit(e,t,n,i){if(e.byteOffset=0,e.byteStride=void 0,e.quantization=t.quantization,n&&(e.buffer=t.buffer),i){let o=l(t.quantization)?t.quantization.componentDatatype:e.componentDatatype;e.typedArray=J.createArrayBufferView(o,t.typedArray.buffer)}}function lit(e,t,n,i){if(e.byteOffset=0,e.byteStride=void 0,n&&(e.buffer=t.buffer),i&&l(t.typedArray)&&(e.typedArray=J.createArrayBufferView(e.componentDatatype,t.typedArray.buffer)),e.semantic===dt.POSITION){let o=s=>{let a=1/0,c=-1/0,d=1/0,u=-1/0,m=1/0,p=-1/0;for(let b=0;b{l(o)&&l(o.attributes)&&l(o.attributes[p])?cit(S,Z,s,a):l(r)?lit(S,Z,s,a):dit(d,u,S,Z,s,a)},S}function zTe(e,t,n,i,o,r,s,a,c){let d=n.modelSemantic,u=d===dt.POSITION,m=d===dt.FEATURE_ID,p=u&&!s&&e._loadAttributesFor2D&&!c.scene3DOnly,b=u&&e._enablePick&&!c.context.webgl2,f=e._loadForClassification&&m,y=e._loadAttributesAsTypedArray,_=!y,S=y||p||b||f,C=BTe(e,t,n,i,o,r,a?!1:_,a?!0:S,c),E=new GS.AttributeLoadPlan(C);return E.loadBuffer=_,E.loadTypedArray=S,E}function uit(e,t,n,i,o){let r=e.gltfJson.accessors,s=l(n.ROTATION),a=l(n.TRANSLATION)&&l(r[n.TRANSLATION].min)&&l(r[n.TRANSLATION].max),c=J7(e,Xr,i),d=c.modelSemantic,u=d===Xr.TRANSLATION||d===Xr.ROTATION||d===Xr.SCALE,m=d===Xr.TRANSLATION,p=e._loadAttributesAsTypedArray||s&&u||!o.context.instancedArrays,b=e._enablePick&&!o.context.webgl2,f=!p,y=e._loadAttributesFor2D&&!o.scene3DOnly;return BTe(e,t,c,void 0,void 0,void 0,f,p||m&&(!a||y||b),o)}function mit(e,t,n,i,o,r){let s=e.gltfJson.accessors[t],a=s.bufferView,c=n.extensions??B.EMPTY_OBJECT,d=c.KHR_draco_mesh_compression,u=l(c.EXT_mesh_primitive_edge_visibility);if(!l(d)&&!l(a))return;let m=new Tnt;m.count=s.count;let p=e._loadAttributesAsTypedArray,b=(e._loadIndicesForWireframe||e._enablePick)&&!r.context.webgl2,f=e._loadForClassification&&i,_=!p,S=p||b||f||u,C=jnt(e,t,n,d,o?!1:_,o?!0:S,r),E=e._geometryLoaders.length;e._geometryLoaders.push(C);let A=C.load();e._loaderPromises.push(A),e._geometryCallbacks[E]=()=>{m.indexDatatype=C.indexDatatype,m.buffer=C.buffer,m.typedArray=C.typedArray};let L=new GS.IndicesLoadPlan(m);return L.loadBuffer=_,L.loadTypedArray=S,L}function hit(e,t,n){return new Ot({wrapR:e.wrapR,wrapS:e.wrapS,wrapT:e.wrapT,minificationFilter:t??e.minificationFilter,magnificationFilter:n??e.magnificationFilter,maximumAnisotropy:e.maximumAnisotropy})}function od(e,t,n,i,o){let r=e.gltfJson,s=Md.getImageIdFromTexture({gltf:r,textureId:t.index,supportedImageFormats:e._supportedImageFormats});if(!l(s))return;let a=Yi.getTextureLoader({gltf:r,textureInfo:t,gltfResource:e._gltfResource,baseResource:e._baseResource,supportedImageFormats:e._supportedImageFormats,frameState:n,asynchronous:e._asynchronous}),c=Md.createModelTextureReader({textureInfo:t}),d=e._textureLoaders.length;e._textureLoaders.push(a);let u=a.load().catch(m=>{if(!e.isDestroyed()){if(!e._incrementallyLoadTextures)throw m;e._textureState=cr.FAILED,e._textureErrors.push(m)}});return e._texturesPromises.push(u),e._textureCallbacks[d]=()=>{let m=a.texture;c.texture=m,(l(i)||l(o))&&(m.sampler=hit(m.sampler,i,o))},c}function fit(e,t,n){let{diffuseTexture:i,specularGlossinessTexture:o,diffuseFactor:r,specularFactor:s,glossinessFactor:a}=t,c=new Nnt;return l(i)&&(c.diffuseTexture=od(e,i,n)),l(o)&&(c.specularGlossinessTexture=od(e,o,n)),c.diffuseFactor=kd(ce,r),c.specularFactor=kd(h,s),c.glossinessFactor=a,c}function pit(e,t,n){let{baseColorTexture:i,metallicRoughnessTexture:o,baseColorFactor:r,metallicFactor:s,roughnessFactor:a}=t,c=new Xnt;return l(i)&&(c.baseColorTexture=od(e,i,n)),l(o)&&(c.metallicRoughnessTexture=od(e,o,n)),c.baseColorFactor=kd(ce,r),c.metallicFactor=s,c.roughnessFactor=a,c}function bit(e,t,n){let{specularFactor:i,specularTexture:o,specularColorFactor:r,specularColorTexture:s}=t,a=new Ynt;return l(o)&&(a.specularTexture=od(e,o,n)),l(s)&&(a.specularColorTexture=od(e,s,n)),a.specularFactor=i,a.specularColorFactor=kd(h,r),a}function git(e,t,n){let{anisotropyStrength:i=B7.DEFAULT_ANISOTROPY_STRENGTH,anisotropyRotation:o=B7.DEFAULT_ANISOTROPY_ROTATION,anisotropyTexture:r}=t,s=new B7;return l(r)&&(s.anisotropyTexture=od(e,r,n)),s.anisotropyStrength=i,s.anisotropyRotation=o,s}function yit(e,t,n){let{clearcoatFactor:i=z7.DEFAULT_CLEARCOAT_FACTOR,clearcoatTexture:o,clearcoatRoughnessFactor:r=z7.DEFAULT_CLEARCOAT_ROUGHNESS_FACTOR,clearcoatRoughnessTexture:s,clearcoatNormalTexture:a}=t,c=new z7;return l(o)&&(c.clearcoatTexture=od(e,o,n)),l(s)&&(c.clearcoatRoughnessTexture=od(e,s,n)),l(a)&&(c.clearcoatNormalTexture=od(e,a,n)),c.clearcoatFactor=i,c.clearcoatRoughnessFactor=r,c}function xit(e){return new Mnt(e)}function Tit(e){if(!l(e))return;let t=new wnt;if(l(e.width)){let n=e.width;n>0&&Math.floor(n)===n&&(t.width=n)}if(l(e.pattern)){let n=e.pattern;n>=0&&n<=65535&&Math.floor(n)===n&&(t.pattern=n)}if(!(!l(t.width)&&!l(t.pattern)))return t}function _it(e,t,n){let i=new knt,o=t.extensions??B.EMPTY_OBJECT,r=o.KHR_materials_pbrSpecularGlossiness,s=o.KHR_materials_specular,a=o.KHR_materials_anisotropy,c=o.KHR_materials_clearcoat,d=t.pbrMetallicRoughness,u=o.BENTLEY_materials_planar_fill;i.unlit=l(o.KHR_materials_unlit),l(r)?i.specularGlossiness=fit(e,r,n):(l(d)&&(i.metallicRoughness=pit(e,d,n)),l(s)&&!i.unlit&&(i.specular=bit(e,s,n)),l(a)&&!i.unlit&&(i.anisotropy=git(e,a,n)),l(c)&&!i.unlit&&(i.clearcoat=yit(e,c,n))),l(t.emissiveTexture)&&(i.emissiveTexture=od(e,t.emissiveTexture,n)),l(t.normalTexture)&&!e._loadForClassification&&(i.normalTexture=od(e,t.normalTexture,n)),l(t.occlusionTexture)&&(i.occlusionTexture=od(e,t.occlusionTexture,n)),i.emissiveFactor=kd(h,t.emissiveFactor),i.alphaMode=t.alphaMode,i.alphaCutoff=t.alphaCutoff,i.doubleSided=t.doubleSided,l(u)&&(i.planarFill=xit(u));let m=o.BENTLEY_materials_point_style;if(l(m)&&l(m.diameter)){let p=m.diameter;p>=1&&(i.pointDiameter=Math.floor(p))}return i.lineStyle=Tit(o.BENTLEY_materials_line_style),i}function HTe(e,t){let n=new wTe;return n.featureCount=e.featureCount,n.nullFeatureId=e.nullFeatureId,n.propertyTableId=e.propertyTable,n.setIndex=e.attribute,n.label=e.label,n.positionalLabel=t,n}function KTe(e,t,n,i){let o=new wTe,r=e.featureIds;return o.featureCount=n,o.propertyTableId=t,o.setIndex=OTe(r.attribute),o.positionalLabel=i,o}function JTe(e,t){let n=new UTe;return n.propertyTableId=e.propertyTable,n.featureCount=e.featureCount,n.nullFeatureId=e.nullFeatureId,n.label=e.label,n.positionalLabel=t,n.offset=0,n.repeat=1,n}function jTe(e,t,n,i){let o=new UTe,r=e.featureIds;o.propertyTableId=t,o.featureCount=n,o.offset=r.constant??0;let s=r.divisor??0;return o.repeat=s===0?void 0:s,o.positionalLabel=i,o}function Sit(e,t,n,i){let o=new kTe;o.featureCount=t.featureCount,o.nullFeatureId=t.nullFeatureId,o.propertyTableId=t.propertyTable,o.label=t.label,o.positionalLabel=i;let r=t.texture;o.textureReader=od(e,r,n,Ht.NEAREST,$n.NEAREST);let a=(l(r.channels)?r.channels:[0]).map(function(c){return"rgba".charAt(c)}).join("");return o.textureReader.channels=a,o}function Zit(e,t,n,i,o,r){let s=new kTe,a=t.featureIds,c=a.texture;return s.featureCount=o,s.propertyTableId=n,s.textureReader=od(e,c,i,Ht.NEAREST,$n.NEAREST),s.textureReader.channels=a.channels,s.positionalLabel=r,s}function Rit(e,t,n,i,o){let r=new _nt,s=void 0,a=void 0,c=void 0,d=!1;for(let u in t){if(!t.hasOwnProperty(u))continue;let m=t[u],p=J7(e,dt,u),b=zTe(e,m,p,s,a,c,d,n,o);r.attributes.push(b.attribute),i.attributePlans.push(b)}return r}function Cit(e){let i=e?.KHR_gaussian_splatting?.extensions?.KHR_gaussian_splatting_compression_spz_2;if(l(i))return i}function QTe(e,t){if(!l(t))return;let n=e.gltfJson.materials;if(!l(n)||t<0||t>=n.length)return;let i=n[t];if(!l(i))return;let o=i.pbrMetallicRoughness??B.EMPTY_OBJECT,r=kd(ce,o.baseColorFactor);return l(r)?r:new ce(1,1,1,1)}function Vit(e){switch(e){case J.UNSIGNED_BYTE:return 255;case J.UNSIGNED_SHORT:return 65535;case J.UNSIGNED_INT:return 4294967295;default:throw new ae("EXT_mesh_primitive_edge_visibility line strings indices must use unsigned scalar component types.")}}function Eit(e,t,n){if(!l(t)||t.length===0)return;let i=new Array(t.length);for(let o=0;on[s]);let r=t.inverseBindMatrices;if(l(r)){let s=e.gltfJson.accessors[r];i.inverseBindMatrices=GP(e,s)}else i.inverseBindMatrices=new Array(o.length).fill(P.IDENTITY);return i}function Oit(e,t){let n=e.gltfJson.skins;if(e._loadForClassification||!l(n))return[];let i=n.map(function(r,s){let a=Dit(e,r,t);return a.index=s,a}),o=e.gltfJson.nodes;for(let r=0;r{u[m]=void 0});for(let m=r;m0||this._imageBasedLightingFactor.y>0}},shouldRegenerateShaders:{get:function(){return this._shouldRegenerateShaders}},specularEnvironmentCubeMap:{get:function(){return this._specularEnvironmentCubeMap}},useDefaultSphericalHarmonics:{get:function(){return this._useDefaultSphericalHarmonics}},useDefaultSpecularMaps:{get:function(){return this._useDefaultSpecularMaps}},useSpecularEnvironmentMaps:{get:function(){return l(this._specularEnvironmentCubeMap)&&this._specularEnvironmentCubeMap.ready||this._useDefaultSpecularMaps}}});function dot(e,t){if(xf.isSupported(t)){if(e._specularEnvironmentCubeMap=e._specularEnvironmentCubeMap&&e._specularEnvironmentCubeMap.destroy(),l(e._specularEnvironmentMaps)){let n=new xf(e._specularEnvironmentMaps);e._specularEnvironmentCubeMap=n,e._removeErrorListener=n.errorEvent.addEventListener(i=>{console.error(`Error loading specularEnvironmentMaps: ${i}`)})}e._shouldRegenerateShaders=!0}}LP.prototype.update=function(e){if(e.frameNumber===this._previousFrameNumber&&e.context===this._previousFrameContext)return;this._previousFrameNumber=e.frameNumber;let t=this._previousFrameContext=e.context;e.brdfLutGenerator.update(e),this._shouldRegenerateShaders=!1;let n=this._imageBasedLightingFactor,i=this._previousImageBasedLightingFactor;k.equals(n,i)||(this._shouldRegenerateShaders=n.x>0&&i.x===0||n.x===0&&i.x>0,this._shouldRegenerateShaders=this._shouldRegenerateShaders||n.y>0&&i.y===0||n.y===0&&i.y>0,this._previousImageBasedLightingFactor=k.clone(this._imageBasedLightingFactor,this._previousImageBasedLightingFactor)),this._previousSphericalHarmonicCoefficients!==this._sphericalHarmonicCoefficients&&(this._shouldRegenerateShaders=this._shouldRegenerateShaders||l(this._previousSphericalHarmonicCoefficients)!==l(this._sphericalHarmonicCoefficients),this._previousSphericalHarmonicCoefficients=this._sphericalHarmonicCoefficients),this._shouldRegenerateShaders=this._shouldRegenerateShaders||this._previousSpecularEnvironmentMapLoaded!==this._specularEnvironmentMapLoaded,this._previousSpecularEnvironmentMapLoaded=this._specularEnvironmentMapLoaded,this._specularEnvironmentCubeMapDirty&&(dot(this,t),this._specularEnvironmentCubeMapDirty=!1),l(this._specularEnvironmentCubeMap)&&(this._specularEnvironmentCubeMap.update(e),this._specularEnvironmentCubeMap.ready&&(this._specularEnvironmentMapLoaded=!0));let o=!l(this._specularEnvironmentCubeMap)&&l(e.specularEnvironmentMaps)&&!this._useDefaultSpecularMaps,r=!l(e.specularEnvironmentMaps)&&this._useDefaultSpecularMaps,s=!l(this._sphericalHarmonicCoefficients)&&l(e.sphericalHarmonicCoefficients)&&!this._useDefaultSphericalHarmonics,a=!l(e.sphericalHarmonicCoefficients)&&this._useDefaultSphericalHarmonics;this._shouldRegenerateShaders=this._shouldRegenerateShaders||o||r||s||a,this._useDefaultSpecularMaps=!l(this._specularEnvironmentCubeMap)&&l(e.specularEnvironmentMaps),this._useDefaultSphericalHarmonics=!l(this._sphericalHarmonicCoefficients)&&l(e.sphericalHarmonicCoefficients)};LP.prototype.isDestroyed=function(){return!1};LP.prototype.destroy=function(){return this._specularEnvironmentCubeMap=this._specularEnvironmentCubeMap&&this._specularEnvironmentCubeMap.destroy(),this._removeErrorListener=this._removeErrorListener&&this._removeErrorListener(),ue(this)};var WS=LP;var gii=x(T(),1);var fii=x(T(),1);var qni=x(T(),1),WP=`uniform sampler2D u_pointCloud_colorGBuffer; uniform sampler2D u_pointCloud_depthGBuffer; uniform vec2 u_distanceAndEdlStrength; in vec2 v_textureCoordinates; @@ -8198,7 +8068,7 @@ color.rgb *= shade; out_FragColor = vec4(color); gl_FragDepth = depthOrLogDepth; } -`;function xC(){this._framebuffer=new li({colorAttachmentsLength:2,depth:!0,supportsDepthTexture:!0}),this._drawCommand=void 0,this._clearCommand=void 0,this._strength=1,this._radius=1}Object.defineProperties(xC.prototype,{framebuffer:{get:function(){return this._framebuffer.framebuffer}},colorGBuffer:{get:function(){return this._framebuffer.getColorTexture(0)}},depthGBuffer:{get:function(){return this._framebuffer.getColorTexture(1)}}});function jet(e){e._framebuffer.destroy(),e._drawCommand=void 0,e._clearCommand=void 0}var c7=new k;function Qet(e,t){let n=new Je({defines:["LOG_DEPTH_WRITE"],sources:[YI]}),i={u_pointCloud_colorGBuffer:function(){return e.colorGBuffer},u_pointCloud_depthGBuffer:function(){return e.depthGBuffer},u_distanceAndEdlStrength:function(){return c7.x=e._radius,c7.y=e._strength,c7}},o=ze.fromCache({blending:on.ALPHA_BLEND,depthMask:!0,depthTest:{enabled:!0},stencilTest:Jt.setCesium3DTileBit(),stencilMask:Jt.CESIUM_3D_TILE_MASK});e._drawCommand=t.createViewportQuadCommand(n,{uniformMap:i,renderState:o,pass:Le.CESIUM_3D_TILE,owner:e}),e._clearCommand=new ui({framebuffer:e.framebuffer,color:new U(0,0,0,0),depth:1,renderState:ze.fromCache(),pass:Le.CESIUM_3D_TILE,owner:e})}function qet(e,t){let n=t.drawingBufferWidth,i=t.drawingBufferHeight;e._framebuffer.update(t,n,i),Qet(e,t)}function Xge(e){return e.drawBuffers&&e.fragmentDepth}xC.isSupported=Xge;function $et(e,t){let n=e.shaderCache.getDerivedShaderProgram(t,"EC");if(!l(n)){let i=t._attributeLocations,o=t.fragmentShaderSource.clone();o.sources.splice(0,0,`layout (location = 0) out vec4 out_FragData_0; +`;function HC(){this._framebuffer=new li({colorAttachmentsLength:2,depth:!0,supportsDepthTexture:!0}),this._drawCommand=void 0,this._clearCommand=void 0,this._strength=1,this._radius=1}Object.defineProperties(HC.prototype,{framebuffer:{get:function(){return this._framebuffer.framebuffer}},colorGBuffer:{get:function(){return this._framebuffer.getColorTexture(0)}},depthGBuffer:{get:function(){return this._framebuffer.getColorTexture(1)}}});function uot(e){e._framebuffer.destroy(),e._drawCommand=void 0,e._clearCommand=void 0}var Q7=new k;function mot(e,t){let n=new Je({defines:["LOG_DEPTH_WRITE"],sources:[WP]}),i={u_pointCloud_colorGBuffer:function(){return e.colorGBuffer},u_pointCloud_depthGBuffer:function(){return e.depthGBuffer},u_distanceAndEdlStrength:function(){return Q7.x=e._radius,Q7.y=e._strength,Q7}},o=ze.fromCache({blending:on.ALPHA_BLEND,depthMask:!0,depthTest:{enabled:!0},stencilTest:Jt.setCesium3DTileBit(),stencilMask:Jt.CESIUM_3D_TILE_MASK});e._drawCommand=t.createViewportQuadCommand(n,{uniformMap:i,renderState:o,pass:Le.CESIUM_3D_TILE,owner:e}),e._clearCommand=new ui({framebuffer:e.framebuffer,color:new U(0,0,0,0),depth:1,renderState:ze.fromCache(),pass:Le.CESIUM_3D_TILE,owner:e})}function hot(e,t){let n=t.drawingBufferWidth,i=t.drawingBufferHeight;e._framebuffer.update(t,n,i),mot(e,t)}function qTe(e){return e.drawBuffers&&e.fragmentDepth}HC.isSupported=qTe;function fot(e,t){let n=e.shaderCache.getDerivedShaderProgram(t,"EC");if(!l(n)){let i=t._attributeLocations,o=t.fragmentShaderSource.clone();o.sources.splice(0,0,`layout (location = 0) out vec4 out_FragData_0; layout (location = 1) out vec4 out_FragData_1;`),o.sources=o.sources.map(function(r){return r=Je.replaceMain(r,"czm_point_cloud_post_process_main"),r=r.replaceAll(/out_FragColor/g,"out_FragData_0"),r}),o.sources.push(`void main() { czm_point_cloud_post_process_main(); @@ -8208,7 +8078,134 @@ layout (location = 1) out vec4 out_FragData_1;`),o.sources=o.sources.map(functio #else out_FragData_1 = czm_packDepth(gl_FragCoord.z); #endif -}`),n=e.shaderCache.createDerivedShaderProgram(t,"EC",{vertexShaderSource:t.vertexShaderSource,fragmentShaderSource:o,attributeLocations:i})}return n}xC.prototype.update=function(e,t,n,i){if(!Xge(e.context))return;this._strength=n.eyeDomeLightingStrength,this._radius=n.eyeDomeLightingRadius*e.pixelRatio,qet(this,e.context);let o,r=e.commandList,s=r.length;for(o=t;o=s.clientWidth)d=!0;else{if(R.x>s.clientWidth*.5){a.width=R.x,c.frustum.right=p.x-S,ll=MI(r,n,c,ll),Ic.clipToGLWindowCoordinates(a,ll,l7),a.x+=R.x,c.position.x=-c.position.x;let C=c.frustum.right;c.frustum.right=-c.frustum.left,c.frustum.left=-C,ll=MI(r,n,c,ll),Ic.clipToGLWindowCoordinates(a,ll,d7)}else{a.x+=R.x,a.width-=R.x,c.frustum.left=-p.x-S,ll=MI(r,n,c,ll),Ic.clipToGLWindowCoordinates(a,ll,l7),a.x=a.x-a.width,c.position.x=-c.position.x;let C=c.frustum.left;c.frustum.left=-c.frustum.right,c.frustum.right=-C,ll=MI(r,n,c,ll),Ic.clipToGLWindowCoordinates(a,ll,d7)}h.clone(b,c.position),c.frustum=f.clone(),i=k.clone(l7,i),(i.x<0||i.x>s.clientWidth)&&(i.x=d7.x)}}if(o.mode!==se.SCENE2D||d){if(ll=MI(r,n,c,ll),ll.z<0&&!(c.frustum instanceof yn)&&!(c.frustum instanceof ps))return;i=Ic.clipToGLWindowCoordinates(a,ll,i)}return i.y=s.clientHeight-i.y,i};Ic.worldToDrawingBufferCoordinates=function(e,t,n){if(n=Ic.worldToWindowCoordinates(e,t,n),!!l(n))return Ic.transformWindowToDrawingBuffer(e,n,n)};var Ub=new h,rtt=new pe;Ic.computeActualEllipsoidPosition=function(e,t,n){let i=e.mode;if(i===se.SCENE3D)return h.clone(t,n);let o=e.mapProjection,r=o.ellipsoid.cartesianToCartographic(t,rtt);if(!l(r))return;if(o.project(r,Ub),i===se.COLUMBUS_VIEW)return h.fromElements(Ub.z,Ub.x,Ub.y,n);if(i===se.SCENE2D)return h.fromElements(0,Ub.x,Ub.y,n);let s=e.morphTime;return h.fromElements(W.lerp(Ub.z,t.x,s),W.lerp(Ub.x,t.y,s),W.lerp(Ub.y,t.z,s),n)};var wge=new h,kge=new h,Uge=new P;Ic.clipToGLWindowCoordinates=function(e,t,n){return h.divideByScalar(t,t.w,wge),P.computeViewportTransformation(e,0,1,Uge),P.multiplyByPoint(Uge,wge,kge),k.fromCartesian3(kge,n)};Ic.transformWindowToDrawingBuffer=function(e,t,n){let i=e.canvas,o=e.drawingBufferWidth/i.clientWidth,r=e.drawingBufferHeight/i.clientHeight;return k.fromElements(t.x*o,t.y*r,n)};var stt=new ce,Dge=new ce;Ic.drawingBufferToWorldCoordinates=function(e,t,n,i){let r=e.context.uniformState,s=r.currentFrustum,a=s.x,c=s.y;if(e.frameState.useLogDepth){let b=n*r.log2FarDepthFromNearPlusOne,f=Math.pow(2,b)-1;n=c*(1-a/(f+a))/(c-a)}let d=e.view.passState.viewport,u=ce.clone(ce.UNIT_W,stt);u.x=(t.x-d.x)/d.width*2-1,u.y=(t.y-d.y)/d.height*2-1,u.z=n*2-1,u.w=1;let m,p=e.camera.frustum;if(l(p.fovy)){m=P.multiplyByVector(r.inverseViewProjection,u,Dge);let b=1/m.w;h.multiplyByScalar(m,b,m)}else{let b=p.offCenterFrustum;l(b)&&(p=b),m=Dge,m.x=(u.x*(p.right-p.left)+p.left+p.right)*.5,m.y=(u.y*(p.top-p.bottom)+p.bottom+p.top)*.5,m.z=(u.z*(a-c)-a-c)*.5,m.w=1,m=P.multiplyByVector(r.inverseView,m,m)}return h.fromCartesian4(m,i)};var fo=Ic;var uHn=x(T(),1);var Rzn=x(T(),1);var TC={};TC._deprecationWarning=Jo;var Db=Uint32Array.BYTES_PER_ELEMENT;TC.parse=function(e,t){let n=t??0;t=n;let i=new Uint8Array(e),o=new DataView(e);t+=Db;let r=o.getUint32(t,!0);if(r!==1)throw new ae(`Only Batched 3D Model version 1 is supported. Version ${r} is not.`);t+=Db;let s=o.getUint32(t,!0);t+=Db;let a=o.getUint32(t,!0);t+=Db;let c=o.getUint32(t,!0);t+=Db;let d=o.getUint32(t,!0);t+=Db;let u=o.getUint32(t,!0);t+=Db;let m;d>=570425344?(t-=Db*2,m=a,d=c,u=0,a=0,c=0,TC._deprecationWarning("b3dm-legacy-header","This b3dm header is using the legacy format [batchLength] [batchTableByteLength]. The new format is [featureTableJsonByteLength] [featureTableBinaryByteLength] [batchTableJsonByteLength] [batchTableBinaryByteLength] from https://github.com/CesiumGS/3d-tiles/tree/main/specification/TileFormats/Batched3DModel.")):u>=570425344&&(t-=Db,m=d,d=a,u=c,a=0,c=0,TC._deprecationWarning("b3dm-legacy-header","This b3dm header is using the legacy format [batchTableJsonByteLength] [batchTableBinaryByteLength] [batchLength]. The new format is [featureTableJsonByteLength] [featureTableBinaryByteLength] [batchTableJsonByteLength] [batchTableBinaryByteLength] from https://github.com/CesiumGS/3d-tiles/tree/main/specification/TileFormats/Batched3DModel."));let p;a===0?p={BATCH_LENGTH:m??0}:(p=vr(i,t,a),t+=a);let b=new Uint8Array(e,t,c);t+=c;let f,y;d>0&&(f=vr(i,t,d),t+=d,u>0&&(y=new Uint8Array(e,t,u),y=new Uint8Array(y),t+=u));let _=n+s-t;if(_===0)throw new ae("glTF byte length must be greater than 0.");let S;return t%4===0?S=new Uint8Array(e,t,_):(TC._deprecationWarning("b3dm-glb-unaligned","The embedded glb is not aligned to a 4-byte boundary."),S=new Uint8Array(i.subarray(t,t+_))),{batchLength:m,featureTableJson:p,featureTableBinary:b,batchTableJson:f,batchTableBinary:y,gltf:S}};var wI=TC;var Azn=x(T(),1);function kI(e,t){this.json=e,this.buffer=t,this._cachedTypedArrays={},this.featuresLength=0}function Oge(e,t,n,i,o,r){let s=e._cachedTypedArrays,a=s[t];return l(a)||(a=J.createArrayBufferView(n,e.buffer.buffer,e.buffer.byteOffset+r,o*i),s[t]=a),a}function att(e,t,n,i){let o=e._cachedTypedArrays,r=o[t];return l(r)||(r=J.createTypedArray(n,i),o[t]=r),r}kI.prototype.getGlobalProperty=function(e,t,n){let i=this.json[e];if(l(i))return l(i.byteOffset)?(t=t??J.UNSIGNED_INT,n=n??1,Oge(this,e,t,n,1,i.byteOffset)):i};kI.prototype.hasProperty=function(e){return l(this.json[e])};kI.prototype.getPropertyArray=function(e,t,n){let i=this.json[e];if(l(i))return l(i.byteOffset)?(l(i.componentType)&&(t=J.fromName(i.componentType)),Oge(this,e,t,n,this.featuresLength,i.byteOffset)):att(this,e,t,i)};kI.prototype.getProperty=function(e,t,n,i,o){let r=this.json[e];if(!l(r))return;let s=this.getPropertyArray(e,t,n);if(n===1)return s[i];for(let a=0;a0&&(f=vr(i,t,d),t+=d,u>0&&(y=new Uint8Array(e,t,u),y=new Uint8Array(y),t+=u));let _=n+s-t;if(_===0)throw new ae("glTF byte length must be greater than 0.");let S;return t%4===0?S=new Uint8Array(e,t,_):(nB._deprecationWarning("i3dm-glb-unaligned","The embedded glb is not aligned to a 4-byte boundary."),S=new Uint8Array(i.subarray(t,t+_))),{gltfFormat:m,featureTableJson:p,featureTableBinary:b,batchTableJson:f,batchTableBinary:y,gltf:S}};var BI=nB;var Bb={NOT_LOADED:0,LOADING:1,PROCESSING:2,POST_PROCESSING:3,READY:4,FAILED:5,UNLOADED:6},iB=Vn.Attribute,Att=Vn.FeatureIdAttribute,jge=Vn.Instances,p7=class extends io{constructor(t){super(),t=t??B.EMPTY_OBJECT;let n=t.i3dmResource,i=t.arrayBuffer,o=t.baseResource,r=t.byteOffset??0,s=t.releaseGltfJson??!1,a=t.asynchronous??!0,c=t.incrementallyLoadTextures??!0,d=t.upAxis??Bi.Y,u=t.forwardAxis??Bi.X,m=t.loadAttributesAsTypedArray??!1,p=t.loadIndicesForWireframe??!1,b=t.loadPrimitiveOutline??!0,f=t.enablePick??!1;o=l(o)?o:n.clone(),this._i3dmResource=n,this._baseResource=o,this._arrayBuffer=i,this._byteOffset=r,this._releaseGltfJson=s,this._asynchronous=a,this._incrementallyLoadTextures=c,this._upAxis=d,this._forwardAxis=u,this._loadAttributesAsTypedArray=m,this._loadIndicesForWireframe=p,this._loadPrimitiveOutline=b,this._enablePick=f,this._state=Bb.NOT_LOADED,this._promise=void 0,this._gltfLoader=void 0,this._buffers=[],this._components=void 0,this._transform=P.IDENTITY,this._batchTable=void 0,this._featureTable=void 0,this._instancesLength=0}get texturesLoaded(){return this._gltfLoader?.texturesLoaded}get cacheKey(){}get components(){return this._components}load(){if(l(this._promise))return this._promise;let t=BI.parse(this._arrayBuffer,this._byteOffset),n=t.featureTableJson,i=t.featureTableBinary,o=t.batchTableJson,r=t.batchTableBinary,s=t.gltfFormat,a=new lf(n,i);this._featureTable=a;let c=a.getGlobalProperty("INSTANCES_LENGTH");if(a.featuresLength=c,!l(c))throw new ae("Feature table global property: INSTANCES_LENGTH must be defined");this._instancesLength=c;let d=a.getGlobalProperty("RTC_CENTER",J.FLOAT,3);l(d)&&(this._transform=P.fromTranslation(h.fromArray(d))),this._batchTable={json:o,binary:r};let u={upAxis:this._upAxis,forwardAxis:this._forwardAxis,releaseGltfJson:this._releaseGltfJson,incrementallyLoadTextures:this._incrementallyLoadTextures,loadAttributesAsTypedArray:this._loadAttributesAsTypedArray,enablePick:this._enablePick,loadIndicesForWireframe:this._loadIndicesForWireframe,loadPrimitiveOutline:this._loadPrimitiveOutline};if(s===0){let p=Pd(t.gltf);p=p.replace(/[\s\0]+$/,"");let b=this._baseResource.getDerivedResource({url:p});u.gltfResource=b,u.baseResource=b}else u.gltfResource=this._i3dmResource,u.typedArray=t.gltf;let m=new vu(u);return this._gltfLoader=m,this._state=Bb.LOADING,this._promise=m.load().then(()=>{if(!this.isDestroyed())return this._state=Bb.PROCESSING,this}).catch(p=>{if(!this.isDestroyed())throw Gtt(this,p)}),this._promise}process(t){if(this._state===Bb.READY)return!0;let n=this._gltfLoader,i=!1;if(this._state===Bb.PROCESSING&&(i=n.process(t)),!i)return!1;let o=n.components;return o.transform=P.multiplyTransformation(this._transform,o.transform,o.transform),vtt(this,o,t),Ltt(this,o),this._components=o,this._arrayBuffer=void 0,this._state=Bb.READY,!0}isUnloaded(){return this._state===Bb.UNLOADED}unload(){l(this._gltfLoader)&&!this._gltfLoader.isDestroyed()&&this._gltfLoader.unload(),Ntt(this),this._components=void 0,this._arrayBuffer=void 0,this._state=Bb.UNLOADED}};function Gtt(e,t){return e.unload(),e._state=Bb.FAILED,e.getError("Failed to load i3dm",t)}function Ltt(e,t){let n=e._batchTable,i=e._instancesLength;if(i===0)return;let o;if(l(n.json))o=Ob({count:i,batchTable:n.json,binaryBody:n.binary});else{let r=new ed({name:rf.BATCH_TABLE_CLASS_NAME,count:i});o=new wa({schema:{},propertyTables:[r]})}t.structuralMetadata=o}var oB=new h,b7=new Array(4),Wtt=new P;function vtt(e,t,n){let i,o=e._featureTable,r=e._instancesLength;if(r===0)return;let s=o.getGlobalProperty("RTC_CENTER",J.FLOAT,3),a=o.getGlobalProperty("EAST_NORTH_UP"),c=o.hasProperty("NORMAL_UP")||o.hasProperty("NORMAL_UP_OCT32P")||a,d=o.hasProperty("SCALE")||o.hasProperty("SCALE_NON_UNIFORM"),u=Itt(o,r),m;c&&(m=new Float32Array(4*r));let p;d&&(p=new Float32Array(3*r));let b=new Float32Array(r),f=h.unpackArray(u),y,_=new h,S=new h,Z=new h,R=new q,C=new Ne,E=new Array(4),A=new h,L=new Array(3),F=new P;if(!l(s)||h.equals(h.unpack(s),h.ZERO)){let M=me.fromPoints(f);for(i=0;i0&&(M.instances=D?Ftt(I):I,D=!0)}}function Ftt(e){let t=new jge;t.transformInWorldSpace=e.transformInWorldSpace;let n=e.attributes,i=n.length;for(let o=0;o=n[t]){if(t+1=0&&e>=n[t-1])return t-1;let o;if(e>n[t])for(o=t;o=n[o]&&e=0&&!(e>=n[o]&&en&&(r=Math.floor((e-n)/o)+1,e-=r*o),e};_C.prototype.clampTime=function(e){let t=this.times;return W.clamp(e,t[0],t[t.length-1])};var vo=_C;function SC(e){this._value=e,this._valueType=vo.getPointType(e)}Object.defineProperties(SC.prototype,{value:{get:function(){return this._value}}});SC.prototype.findTimeInterval=function(e){};SC.prototype.wrapTime=function(e){return 0};SC.prototype.clampTime=function(e){return 0};SC.prototype.evaluate=function(e,t){let n=this._value,i=this._valueType;return i===Number?n:i.clone(n,t)};var HI=SC;var BKn=x(T(),1);var vKn=x(T(),1);function ZC(e){e=e??B.EMPTY_OBJECT;let t=e.points,n=e.times;this._times=n,this._points=t,this._pointType=vo.getPointType(t[0]),this._lastTimeIndex=0}Object.defineProperties(ZC.prototype,{times:{get:function(){return this._times}},points:{get:function(){return this._points}}});ZC.prototype.findTimeInterval=vo.prototype.findTimeInterval;ZC.prototype.wrapTime=vo.prototype.wrapTime;ZC.prototype.clampTime=vo.prototype.clampTime;ZC.prototype.evaluate=function(e,t){let n=this.points,i=this.times,o=this._lastTimeIndex=this.findTimeInterval(e,this._lastTimeIndex),r=(e-i[o])/(i[o+1]-i[o]);return this._pointType===Number?(1-r)*n[o]+r*n[o+1]:(l(t)||(t=new h),h.lerp(n[o],n[o+1],r,t))};var gx=ZC;var PKn=x(T(),1);var qge={};qge.solve=function(e,t,n,i){let o=new Array(n.length),r=new Array(i.length),s=new Array(i.length),a;for(a=0;a=0;--a)s[a]=h.subtract(r[a],h.multiplyByScalar(s[a+1],o[a],s[a]),s[a]);return s};var RC=qge;var $ge=[],eye=[],tye=[],nye=[];function Ytt(e,t,n){let i=$ge,o=tye,r=eye,s=nye;i.length=o.length=e.length-1,r.length=s.length=e.length;let a;i[0]=r[0]=1,o[0]=0;let c=s[0];for(l(c)||(c=s[0]=new h),h.clone(t,c),a=1;a0&&e.afterRender.push(a._raiseStartEvent)),a.loop===wd.REPEAT)b=b-Math.floor(b);else if(a.loop===wd.MIRRORED_REPEAT){let Z=Math.floor(b),R=b-Z;b=Z%2===1?1-R:R}let _=a.startOffset;a.reverse&&(b=1-b,_=-_);let S=b*d*a.multiplier+_;S=W.clamp(S,a.localStartTime,a.localStopTime),a.animate(S),a.update.numberOfListeners>0&&(a._updateEventTime=S,e.afterRender.push(a._raiseUpdateEvent)),i=!0,y||(a._state=df.STOPPED,a.stop.numberOfListeners>0&&e.afterRender.push(a._raiseStopEvent),a.removeOnStop&&rB.push(a))}}n=rB.length;for(let s=0;s=570425344?(t-=Kb*2,m=a,d=c,u=0,a=0,c=0,KC._deprecationWarning("b3dm-legacy-header","This b3dm header is using the legacy format [batchLength] [batchTableByteLength]. The new format is [featureTableJsonByteLength] [featureTableBinaryByteLength] [batchTableJsonByteLength] [batchTableBinaryByteLength] from https://github.com/CesiumGS/3d-tiles/tree/main/specification/TileFormats/Batched3DModel.")):u>=570425344&&(t-=Kb,m=d,d=a,u=c,a=0,c=0,KC._deprecationWarning("b3dm-legacy-header","This b3dm header is using the legacy format [batchTableJsonByteLength] [batchTableBinaryByteLength] [batchLength]. The new format is [featureTableJsonByteLength] [featureTableBinaryByteLength] [batchTableJsonByteLength] [batchTableBinaryByteLength] from https://github.com/CesiumGS/3d-tiles/tree/main/specification/TileFormats/Batched3DModel."));let p;a===0?p={BATCH_LENGTH:m??0}:(p=Pr(i,t,a),t+=a);let b=new Uint8Array(e,t,c);t+=c;let f,y;d>0&&(f=Pr(i,t,d),t+=d,u>0&&(y=new Uint8Array(e,t,u),y=new Uint8Array(y),t+=u));let _=n+s-t;if(_===0)throw new ae("glTF byte length must be greater than 0.");let S;return t%4===0?S=new Uint8Array(e,t,_):(KC._deprecationWarning("b3dm-glb-unaligned","The embedded glb is not aligned to a 4-byte boundary."),S=new Uint8Array(i.subarray(t,t+_))),{batchLength:m,featureTableJson:p,featureTableBinary:b,batchTableJson:f,batchTableBinary:y,gltf:S}};var vP=KC;var Vii=x(T(),1);function FP(e,t){this.json=e,this.buffer=t,this._cachedTypedArrays={},this.featuresLength=0}function e_e(e,t,n,i,o,r){let s=e._cachedTypedArrays,a=s[t];return l(a)||(a=J.createArrayBufferView(n,e.buffer.buffer,e.buffer.byteOffset+r,o*i),s[t]=a),a}function pot(e,t,n,i){let o=e._cachedTypedArrays,r=o[t];return l(r)||(r=J.createTypedArray(n,i),o[t]=r),r}FP.prototype.getGlobalProperty=function(e,t,n){let i=this.json[e];if(l(i))return l(i.byteOffset)?(t=t??J.UNSIGNED_INT,n=n??1,e_e(this,e,t,n,1,i.byteOffset)):i};FP.prototype.hasProperty=function(e){return l(this.json[e])};FP.prototype.getPropertyArray=function(e,t,n){let i=this.json[e];if(l(i))return l(i.byteOffset)?(l(i.componentType)&&(t=J.fromName(i.componentType)),e_e(this,e,t,n,this.featuresLength,i.byteOffset)):pot(this,e,t,i)};FP.prototype.getProperty=function(e,t,n,i,o){let r=this.json[e];if(!l(r))return;let s=this.getPropertyArray(e,t,n);if(n===1)return s[i];for(let a=0;a0){let o=Math.min(t,wt.maximumTextureSize),r=Math.ceil(t/wt.maximumTextureSize),s=1/o,a=s*.5,c=1/r,d=c*.5;n=new k(o,r),i=new ce(s,a,c,d)}this._translucentFeaturesLength=0,this._featuresLength=t,this._textureDimensions=n,this._textureStep=i,this._owner=e.owner,this._statistics=e.statistics,this._colorChangedCallback=e.colorChangedCallback}Object.defineProperties(ul.prototype,{translucentFeaturesLength:{get:function(){return this._translucentFeaturesLength}},byteLength:{get:function(){let e=0;return l(this._pickTexture)&&(e+=this._pickTexture.sizeInBytes),l(this._batchTexture)&&(e+=this._batchTexture.sizeInBytes),e}},textureDimensions:{get:function(){return this._textureDimensions}},textureStep:{get:function(){return this._textureStep}},batchTexture:{get:function(){return this._batchTexture}},defaultTexture:{get:function(){return this._defaultTexture}},pickTexture:{get:function(){return this._pickTexture}}});ul.DEFAULT_COLOR_VALUE=U.WHITE;ul.DEFAULT_SHOW_VALUE=!0;function t_e(e){let t=e._textureDimensions;return t.x*t.y*4}function n_e(e){if(!l(e._batchValues)){let t=t_e(e),n=new Uint8Array(t).fill(255);e._batchValues=n}return e._batchValues}function i_e(e){if(!l(e._showAlphaProperties)){let t=2*e._featuresLength,n=new Uint8Array(t).fill(255);e._showAlphaProperties=n}return e._showAlphaProperties}ul.prototype.setShow=function(e,t){if(t&&!l(this._showAlphaProperties))return;let n=i_e(this),i=e*2,o=t?255:0;if(n[i]!==o){n[i]=o;let r=n_e(this),s=e*4+3;r[s]=t?n[i+1]:0,this._batchValuesDirty=!0}};ul.prototype.setAllShow=function(e){let t=this._featuresLength;for(let n=0;n0){let i=e._pickIds,o=t_e(e),r=new Uint8Array(o),s=e._owner,a=e._statistics;for(let c=0;c0?(s="",e&&(s+=`uniform bool tile_translucentCommand; +`),s+=`uniform sampler2D tile_batchTexture; +out vec4 tile_featureColor; +out vec2 tile_featureSt; +void main() +{ + vec2 st = computeSt(${t}); + vec4 featureProperties = texture(tile_batchTexture, st); + tile_color(featureProperties); + float show = ceil(featureProperties.a); + gl_Position *= show; +`,e&&(s+=` bool isStyleTranslucent = (featureProperties.a != 1.0); + if (czm_pass == czm_passTranslucent) + { + if (!isStyleTranslucent && !tile_translucentCommand) + { + gl_Position *= 0.0; + } + } + else + { + if (isStyleTranslucent) + { + gl_Position *= 0.0; + } + } +`),s+=` tile_featureColor = featureProperties; + tile_featureSt = st; +}`):s=`out vec2 tile_featureSt; +void main() +{ + tile_color(vec4(1.0)); + tile_featureSt = computeSt(${t}); +}`,`${r} +${Aot(i)}${s}`}};function s_e(e,t){return e=Je.replaceMain(e,"tile_main"),t?`${e}uniform float tile_colorBlend; +void tile_color(vec4 tile_featureColor) +{ + tile_main(); + tile_featureColor = czm_gammaCorrect(tile_featureColor); + out_FragColor.a *= tile_featureColor.a; + float highlight = ceil(tile_colorBlend); + out_FragColor.rgb *= mix(tile_featureColor.rgb, vec3(1.0), highlight); +} +`:`${e}void tile_color(vec4 tile_featureColor) +{ + tile_main(); +} +`}function Got(e,t){let n=`texture(${t}`,i=0,o=e.indexOf(n,i),r;for(;o>-1;){let s=0;for(let d=o;d0?(i+=`uniform sampler2D tile_pickTexture; +in vec2 tile_featureSt; +in vec4 tile_featureColor; +void main() +{ + tile_color(tile_featureColor); +`,n&&(i+=` out_FragColor.rgb *= out_FragColor.a; +`),i+="}"):(e&&(i+=`uniform bool tile_translucentCommand; +`),i+=`uniform sampler2D tile_pickTexture; +uniform sampler2D tile_batchTexture; +in vec2 tile_featureSt; +void main() +{ + vec4 featureProperties = texture(tile_batchTexture, tile_featureSt); + if (featureProperties.a == 0.0) { + discard; + } +`,e&&(i+=` bool isStyleTranslucent = (featureProperties.a != 1.0); + if (czm_pass == czm_passTranslucent) + { + if (!isStyleTranslucent && !tile_translucentCommand) + { + discard; + } + } + else + { + if (isStyleTranslucent) + { + discard; + } + } +`),i+=` tile_color(featureProperties); +`,n&&(i+=` out_FragColor.rgb *= out_FragColor.a; +`),i+=`} +`),i}};function Lot(e){let t=e._content.tileset,n=t.colorBlendMode,i=t.colorBlendAmount;if(n===Ud.HIGHLIGHT)return 0;if(n===Ud.REPLACE)return 1;if(n===Ud.MIX)return W.clamp(i,W.EPSILON4,1)}jo.prototype.getUniformMapCallback=function(){if(this.featuresLength===0)return;let e=this;return function(t){return It(t,{tile_batchTexture:function(){return e._batchTexture.batchTexture??e._batchTexture.defaultTexture},tile_textureDimensions:function(){return e._batchTexture.textureDimensions},tile_textureStep:function(){return e._batchTexture.textureStep},tile_colorBlend:function(){return Lot(e)},tile_pickTexture:function(){return e._batchTexture.pickTexture}})}};jo.prototype.getPickId=function(){return"texture(tile_pickTexture, tile_featureSt)"};var gx={ALL_OPAQUE:0,ALL_TRANSLUCENT:1,OPAQUE_AND_TRANSLUCENT:2};jo.prototype.addDerivedCommands=function(e,t){let n=e.commandList,i=n.length,o=this._content._tile,r=o._finalResolution,s=o.tileset,a=s.isSkippingLevelOfDetail&&s.hasMixedContent&&e.context.stencilBuffer,c=Wot(this);for(let d=t;d>>Jt.SKIP_LOD_BIT_SHIFT}function Mot(e){let t=$e(e,!0);return t.cull.enabled=!1,t.depthTest.enabled=!0,t.depthMask=!1,t.blending=on.ALPHA_BLEND,t.stencilTest=Jt.setCesium3DTileBit(),t.stencilMask=Jt.CESIUM_3D_TILE_MASK,ze.fromCache(t)}function wot(e){let t=$e(e,!0);return t.stencilTest=Jt.setCesium3DTileBit(),t.stencilMask=Jt.CESIUM_3D_TILE_MASK,ze.fromCache(t)}jo.prototype.update=function(e,t){this._batchTexture.update(e,t)};jo.prototype.isDestroyed=function(){return!1};jo.prototype.destroy=function(){return this._batchTexture=this._batchTexture&&this._batchTexture.destroy(),ue(this)};var _f=jo;function Jb(e){this._classes=void 0,this._classIds=void 0,this._classIndexes=void 0,this._parentCounts=void 0,this._parentIndexes=void 0,this._parentIds=void 0,this._byteLength=0,kot(this,e.extension,e.binaryBody)}Object.defineProperties(Jb.prototype,{byteLength:{get:function(){return this._byteLength}}});function kot(e,t,n){let i,o,r,s=t.instancesLength,a=t.classes,c=t.classIds,d=t.parentCounts,u=t.parentIds,m=s,p=0;l(c.byteOffset)&&(c.componentType=c.componentType??J.UNSIGNED_SHORT,c.type=Dt.SCALAR,r=Jm(c),c=r.createArrayBufferView(n.buffer,n.byteOffset+c.byteOffset,s),p+=c.byteLength);let b;if(l(d)){for(l(d.byteOffset)&&(d.componentType=d.componentType??J.UNSIGNED_SHORT,d.type=Dt.SCALAR,r=Jm(d),d=r.createArrayBufferView(n.buffer,n.byteOffset+d.byteOffset,s),p+=d.byteLength),b=new Uint16Array(s),m=0,i=0;i0;){if(t=u.pop(),c[t]===d)continue;c[t]=d;let m=n(e,t);if(l(m))return m;let p=o[t],b=s[t];for(let f=0;f0&&(f=Pr(i,t,d),t+=d,u>0&&(y=new Uint8Array(e,t,u),y=new Uint8Array(y),t+=u));let _=n+s-t;if(_===0)throw new ae("glTF byte length must be greater than 0.");let S;return t%4===0?S=new Uint8Array(e,t,_):(GB._deprecationWarning("i3dm-glb-unaligned","The embedded glb is not aligned to a 4-byte boundary."),S=new Uint8Array(i.subarray(t,t+_))),{gltfFormat:m,featureTableJson:p,featureTableBinary:b,batchTableJson:f,batchTableBinary:y,gltf:S}};var YP=GB;var Qb={NOT_LOADED:0,LOADING:1,PROCESSING:2,POST_PROCESSING:3,READY:4,FAILED:5,UNLOADED:6},LB=Vn.Attribute,brt=Vn.FeatureIdAttribute,f_e=Vn.Instances,oq=class extends oo{constructor(t){super(),t=t??B.EMPTY_OBJECT;let n=t.i3dmResource,i=t.arrayBuffer,o=t.baseResource,r=t.byteOffset??0,s=t.releaseGltfJson??!1,a=t.asynchronous??!0,c=t.incrementallyLoadTextures??!0,d=t.upAxis??Bi.Y,u=t.forwardAxis??Bi.X,m=t.loadAttributesAsTypedArray??!1,p=t.loadIndicesForWireframe??!1,b=t.loadPrimitiveOutline??!0,f=t.enablePick??!1;o=l(o)?o:n.clone(),this._i3dmResource=n,this._baseResource=o,this._arrayBuffer=i,this._byteOffset=r,this._releaseGltfJson=s,this._asynchronous=a,this._incrementallyLoadTextures=c,this._upAxis=d,this._forwardAxis=u,this._loadAttributesAsTypedArray=m,this._loadIndicesForWireframe=p,this._loadPrimitiveOutline=b,this._enablePick=f,this._state=Qb.NOT_LOADED,this._promise=void 0,this._gltfLoader=void 0,this._buffers=[],this._components=void 0,this._transform=P.IDENTITY,this._batchTable=void 0,this._featureTable=void 0,this._instancesLength=0}get texturesLoaded(){return this._gltfLoader?.texturesLoaded}get cacheKey(){}get components(){return this._components}load(){if(l(this._promise))return this._promise;let t=YP.parse(this._arrayBuffer,this._byteOffset),n=t.featureTableJson,i=t.featureTableBinary,o=t.batchTableJson,r=t.batchTableBinary,s=t.gltfFormat,a=new Tf(n,i);this._featureTable=a;let c=a.getGlobalProperty("INSTANCES_LENGTH");if(a.featuresLength=c,!l(c))throw new ae("Feature table global property: INSTANCES_LENGTH must be defined");this._instancesLength=c;let d=a.getGlobalProperty("RTC_CENTER",J.FLOAT,3);l(d)&&(this._transform=P.fromTranslation(h.fromArray(d))),this._batchTable={json:o,binary:r};let u={upAxis:this._upAxis,forwardAxis:this._forwardAxis,releaseGltfJson:this._releaseGltfJson,incrementallyLoadTextures:this._incrementallyLoadTextures,loadAttributesAsTypedArray:this._loadAttributesAsTypedArray,enablePick:this._enablePick,loadIndicesForWireframe:this._loadIndicesForWireframe,loadPrimitiveOutline:this._loadPrimitiveOutline};if(s===0){let p=wd(t.gltf);p=p.replace(/[\s\0]+$/,"");let b=this._baseResource.getDerivedResource({url:p});u.gltfResource=b,u.baseResource=b}else u.gltfResource=this._i3dmResource,u.typedArray=t.gltf;let m=new Mu(u);return this._gltfLoader=m,this._state=Qb.LOADING,this._promise=m.load().then(()=>{if(!this.isDestroyed())return this._state=Qb.PROCESSING,this}).catch(p=>{if(!this.isDestroyed())throw grt(this,p)}),this._promise}process(t){if(this._state===Qb.READY)return!0;let n=this._gltfLoader,i=!1;if(this._state===Qb.PROCESSING&&(i=n.process(t)),!i)return!1;let o=n.components;return o.transform=P.multiplyTransformation(this._transform,o.transform,o.transform),Trt(this,o,t),yrt(this,o),this._components=o,this._arrayBuffer=void 0,this._state=Qb.READY,!0}isUnloaded(){return this._state===Qb.UNLOADED}unload(){l(this._gltfLoader)&&!this._gltfLoader.isDestroyed()&&this._gltfLoader.unload(),Crt(this),this._components=void 0,this._arrayBuffer=void 0,this._state=Qb.UNLOADED}};function grt(e,t){return e.unload(),e._state=Qb.FAILED,e.getError("Failed to load i3dm",t)}function yrt(e,t){let n=e._batchTable,i=e._instancesLength;if(i===0)return;let o;if(l(n.json))o=jb({count:i,batchTable:n.json,binaryBody:n.binary});else{let r=new td({name:gf.BATCH_TABLE_CLASS_NAME,count:i});o=new Ua({schema:{},propertyTables:[r]})}t.structuralMetadata=o}var WB=new h,rq=new Array(4),xrt=new P;function Trt(e,t,n){let i,o=e._featureTable,r=e._instancesLength;if(r===0)return;let s=o.getGlobalProperty("RTC_CENTER",J.FLOAT,3),a=o.getGlobalProperty("EAST_NORTH_UP"),c=o.hasProperty("NORMAL_UP")||o.hasProperty("NORMAL_UP_OCT32P")||a,d=o.hasProperty("SCALE")||o.hasProperty("SCALE_NON_UNIFORM"),u=Srt(o,r),m;c&&(m=new Float32Array(4*r));let p;d&&(p=new Float32Array(3*r));let b=new Float32Array(r),f=h.unpackArray(u),y,_=new h,S=new h,Z=new h,R=new q,C=new Ne,E=new Array(4),A=new h,L=new Array(3),F=new P;if(!l(s)||h.equals(h.unpack(s),h.ZERO)){let M=me.fromPoints(f);for(i=0;i0&&(M.instances=D?_rt(I):I,D=!0)}}function _rt(e){let t=new f_e;t.transformInWorldSpace=e.transformInWorldSpace;let n=e.attributes,i=n.length;for(let o=0;o=n[t]){if(t+1=0&&e>=n[t-1])return t-1;let o;if(e>n[t])for(o=t;o=n[o]&&e=0&&!(e>=n[o]&&en&&(r=Math.floor((e-n)/o)+1,e-=r*o),e};JC.prototype.clampTime=function(e){let t=this.times;return W.clamp(e,t[0],t[t.length-1])};var vo=JC;function jC(e){this._value=e,this._valueType=vo.getPointType(e)}Object.defineProperties(jC.prototype,{value:{get:function(){return this._value}}});jC.prototype.findTimeInterval=function(e){};jC.prototype.wrapTime=function(e){return 0};jC.prototype.clampTime=function(e){return 0};jC.prototype.evaluate=function(e,t){let n=this._value,i=this._valueType;return i===Number?n:i.clone(n,t)};var wP=jC;var jsi=x(T(),1);var Nsi=x(T(),1);function QC(e){e=e??B.EMPTY_OBJECT;let t=e.points,n=e.times;this._times=n,this._points=t,this._pointType=vo.getPointType(t[0]),this._lastTimeIndex=0}Object.defineProperties(QC.prototype,{times:{get:function(){return this._times}},points:{get:function(){return this._points}}});QC.prototype.findTimeInterval=vo.prototype.findTimeInterval;QC.prototype.wrapTime=vo.prototype.wrapTime;QC.prototype.clampTime=vo.prototype.clampTime;QC.prototype.evaluate=function(e,t){let n=this.points,i=this.times,o=this._lastTimeIndex=this.findTimeInterval(e,this._lastTimeIndex),r=(e-i[o])/(i[o+1]-i[o]);return this._pointType===Number?(1-r)*n[o]+r*n[o+1]:(l(t)||(t=new h),h.lerp(n[o],n[o+1],r,t))};var xx=QC;var wsi=x(T(),1);var g_e={};g_e.solve=function(e,t,n,i){let o=new Array(n.length),r=new Array(i.length),s=new Array(i.length),a;for(a=0;a=0;--a)s[a]=h.subtract(r[a],h.multiplyByScalar(s[a+1],o[a],s[a]),s[a]);return s};var qC=g_e;var y_e=[],x_e=[],T_e=[],__e=[];function Vrt(e,t,n){let i=y_e,o=T_e,r=x_e,s=__e;i.length=o.length=e.length-1,r.length=s.length=e.length;let a;i[0]=r[0]=1,o[0]=0;let c=s[0];for(l(c)||(c=s[0]=new h),h.clone(t,c),a=1;a0&&e.afterRender.push(a._raiseStartEvent)),a.loop===Dd.REPEAT)b=b-Math.floor(b);else if(a.loop===Dd.MIRRORED_REPEAT){let Z=Math.floor(b),R=b-Z;b=Z%2===1?1-R:R}let _=a.startOffset;a.reverse&&(b=1-b,_=-_);let S=b*d*a.multiplier+_;S=W.clamp(S,a.localStartTime,a.localStopTime),a.animate(S),a.update.numberOfListeners>0&&(a._updateEventTime=S,e.afterRender.push(a._raiseUpdateEvent)),i=!0,y||(a._state=Sf.STOPPED,a.stop.numberOfListeners>0&&e.afterRender.push(a._raiseStopEvent),a.removeOnStop&&vB.push(a))}}n=vB.length;for(let s=0;sW.EPSILON3}};var oP=rye;var Rjn=x(T(),1);var bjn=x(T(),1),rP=`#ifdef DIFFUSE_IBL +`;var R_e={name:"AtmospherePipelineStage"};R_e.process=function(e,t,n){let i=e.shaderBuilder;i.addDefine("HAS_ATMOSPHERE",void 0,fe.BOTH),i.addDefine("COMPUTE_POSITION_WC_ATMOSPHERE",void 0,fe.BOTH),i.addVarying("vec3","v_atmosphereRayleighColor"),i.addVarying("vec3","v_atmosphereMieColor"),i.addVarying("float","v_atmosphereOpacity"),i.addVertexLines([jP]),i.addFragmentLines([JP]),i.addUniform("bool","u_isInFog",fe.FRAGMENT),e.uniformMap.u_isInFog=function(){let o=h.distance(n.camera.positionWC,t.boundingSphere.center);return W.fog(o,n.fog.density)>W.EPSILON3}};var QP=R_e;var Fci=x(T(),1);var Cci=x(T(),1),qP=`#ifdef DIFFUSE_IBL vec3 sampleDiffuseEnvironment(vec3 cubeDir) { #ifdef CUSTOM_SPHERICAL_HARMONICS @@ -8359,14 +8356,14 @@ vec3 specularContribution = vec3(0.0); return diffuseContribution + specularContribution; } #endif -`;var sye={name:"ImageBasedLightingPipelineStage"},Qtt=new k;sye.process=function(e,t,n){let i=t.imageBasedLighting,o=t.environmentMapManager,r=e.shaderBuilder,s;l(i.specularEnvironmentMaps)||(s=o.radianceCubeMap);let a=i.sphericalHarmonicCoefficients??o.sphericalHarmonicCoefficients;r.addDefine("USE_IBL_LIGHTING",void 0,fe.FRAGMENT),r.addUniform("vec2","model_iblFactor",fe.FRAGMENT),$h.isSupported(n.context)&&((i.useSphericalHarmonics||i.useSpecularEnvironmentMaps||i.enabled)&&r.addUniform("mat3","model_iblReferenceFrameMatrix",fe.FRAGMENT),l(s)&&r.addDefine("COMPUTE_POSITION_WC_ATMOSPHERE",void 0,fe.BOTH),l(a)&&l(a[0])?(r.addDefine("DIFFUSE_IBL",void 0,fe.FRAGMENT),r.addDefine("CUSTOM_SPHERICAL_HARMONICS",void 0,fe.FRAGMENT),r.addUniform("vec3","model_sphericalHarmonicCoefficients[9]",fe.FRAGMENT)):i.useDefaultSphericalHarmonics&&r.addDefine("DIFFUSE_IBL",void 0,fe.FRAGMENT),l(i.specularEnvironmentCubeMap)&&i.specularEnvironmentCubeMap.ready||l(s)?(r.addDefine("SPECULAR_IBL",void 0,fe.FRAGMENT),r.addDefine("CUSTOM_SPECULAR_IBL",void 0,fe.FRAGMENT),r.addUniform("samplerCube","model_specularEnvironmentMaps",fe.FRAGMENT),r.addUniform("float","model_specularEnvironmentMapsMaximumLOD",fe.FRAGMENT)):t.useDefaultSpecularMaps&&r.addDefine("SPECULAR_IBL",void 0,fe.FRAGMENT)),r.addFragmentLines(rP);let c={model_iblFactor:function(){return k.multiplyByScalar(i.imageBasedLightingFactor,o?.intensity||1,Qtt)},model_iblReferenceFrameMatrix:function(){return t._iblReferenceFrameMatrix},model_sphericalHarmonicCoefficients:function(){return a},model_specularEnvironmentMaps:function(){return i.specularEnvironmentCubeMap.texture},model_specularEnvironmentMapsMaximumLOD:function(){return i.specularEnvironmentCubeMap.maximumMipmapLevel}};l(s)&&(c.model_specularEnvironmentMaps=function(){return s},c.model_specularEnvironmentMapsMaximumLOD=function(){return o.maximumMipmapLevel}),e.uniformMap=It(c,e.uniformMap)};var sP=sye;var Yjn=x(T(),1);var vjn=x(T(),1);var qtt=W.EPSILON16;function _7(e){e=e??B.EMPTY_OBJECT;let t=e.stage,n=e.runtimeArticulation;this._stage=t,this._runtimeArticulation=n,this._name=t.name,this._type=t.type,this._minimumValue=t.minimumValue,this._maximumValue=t.maximumValue,this._currentValue=t.initialValue}Object.defineProperties(_7.prototype,{stage:{get:function(){return this._stage}},runtimeArticulation:{get:function(){return this._runtimeArticulation}},name:{get:function(){return this._name}},type:{get:function(){return this._type}},minimumValue:{get:function(){return this._minimumValue}},maximumValue:{get:function(){return this._maximumValue}},currentValue:{get:function(){return this._currentValue},set:function(e){e=W.clamp(e,this.minimumValue,this.maximumValue),W.equalsEpsilon(this._currentValue,e,qtt)||(this._currentValue=e,this.runtimeArticulation._dirty=!0)}}});var $tt=new h,T7=new q;_7.prototype.applyStageToMatrix=function(e){let t=this.type,n=this.currentValue,i=$tt,o;switch(t){case cl.XROTATE:o=q.fromRotationX(W.toRadians(n),T7),e=P.multiplyByMatrix3(e,o,e);break;case cl.YROTATE:o=q.fromRotationY(W.toRadians(n),T7),e=P.multiplyByMatrix3(e,o,e);break;case cl.ZROTATE:o=q.fromRotationZ(W.toRadians(n),T7),e=P.multiplyByMatrix3(e,o,e);break;case cl.XTRANSLATE:i.x=n,i.y=0,i.z=0,e=P.multiplyByTranslation(e,i,e);break;case cl.YTRANSLATE:i.x=0,i.y=n,i.z=0,e=P.multiplyByTranslation(e,i,e);break;case cl.ZTRANSLATE:i.x=0,i.y=0,i.z=n,e=P.multiplyByTranslation(e,i,e);break;case cl.XSCALE:i.x=n,i.y=1,i.z=1,e=P.multiplyByScale(e,i,e);break;case cl.YSCALE:i.x=1,i.y=n,i.z=1,e=P.multiplyByScale(e,i,e);break;case cl.ZSCALE:i.x=1,i.y=1,i.z=n,e=P.multiplyByScale(e,i,e);break;case cl.UNIFORMSCALE:e=P.multiplyByUniformScale(e,n,e);break;default:break}return e};var aP=_7;function sB(e){e=e??B.EMPTY_OBJECT;let t=e.articulation,n=e.sceneGraph;this._articulation=t,this._sceneGraph=n,this._name=t.name,this._runtimeStages=[],this._runtimeStagesByName={},this._runtimeNodes=[],this._dirty=!0,ent(this)}Object.defineProperties(sB.prototype,{articulation:{get:function(){return this._articulation}},sceneGraph:{get:function(){return this._sceneGraph}},name:{get:function(){return this._name}},runtimeStages:{get:function(){return this._runtimeStages}},runtimeNodes:{get:function(){return this._runtimeNodes}}});function ent(e){let n=e.articulation.stages,i=n.length,o=e._runtimeStages,r=e._runtimeStagesByName;for(let s=0;s 0.0 && clipDistance < clippingPlanesEdgeWidth) { color = clippingPlanesEdgeColor; } } -`;var aye={name:"ModelClippingPlanesPipelineStage"},int=new k,ont=new P,rnt=new P;aye.process=function(e,t,n){let i=t.clippingPlanes,o=n.context,r=e.shaderBuilder;r.addDefine("HAS_CLIPPING_PLANES",void 0,fe.FRAGMENT),r.addDefine("CLIPPING_PLANES_LENGTH",i.length,fe.FRAGMENT),i.unionClippingRegions&&r.addDefine("UNION_CLIPPING_REGIONS",void 0,fe.FRAGMENT),gs.useFloatTexture(o)&&r.addDefine("USE_CLIPPING_PLANES_FLOAT_TEXTURE",void 0,fe.FRAGMENT);let s=gs.getTextureResolution(i,o,int);r.addDefine("CLIPPING_PLANES_TEXTURE_WIDTH",s.x,fe.FRAGMENT),r.addDefine("CLIPPING_PLANES_TEXTURE_HEIGHT",s.y,fe.FRAGMENT),r.addUniform("sampler2D","model_clippingPlanes",fe.FRAGMENT),r.addUniform("vec4","model_clippingPlanesEdgeStyle",fe.FRAGMENT),r.addUniform("mat4","model_clippingPlanesMatrix",fe.FRAGMENT),r.addFragmentLines(dP);let a={model_clippingPlanes:function(){return i.texture},model_clippingPlanesEdgeStyle:function(){let c=U.clone(i.edgeColor);return c.alpha=i.edgeWidth,c},model_clippingPlanesMatrix:function(){let c=P.transpose(o.uniformState.inverseView3D,ont);return P.multiply(c,t._clippingPlanesMatrix,rnt)}};e.uniformMap=It(a,e.uniformMap)};var uP=aye;var y4n=x(T(),1);var s4n=x(T(),1),mP=`void modelClippingPolygonsStage() +`;var V_e={name:"ModelClippingPlanesPipelineStage"},Brt=new k,zrt=new P,Hrt=new P;V_e.process=function(e,t,n){let i=t.clippingPlanes,o=n.context,r=e.shaderBuilder;r.addDefine("HAS_CLIPPING_PLANES",void 0,fe.FRAGMENT),r.addDefine("CLIPPING_PLANES_LENGTH",i.length,fe.FRAGMENT),i.unionClippingRegions&&r.addDefine("UNION_CLIPPING_REGIONS",void 0,fe.FRAGMENT),_s.useFloatTexture(o)&&r.addDefine("USE_CLIPPING_PLANES_FLOAT_TEXTURE",void 0,fe.FRAGMENT);let s=_s.getTextureResolution(i,o,Brt);r.addDefine("CLIPPING_PLANES_TEXTURE_WIDTH",s.x,fe.FRAGMENT),r.addDefine("CLIPPING_PLANES_TEXTURE_HEIGHT",s.y,fe.FRAGMENT),r.addUniform("sampler2D","model_clippingPlanes",fe.FRAGMENT),r.addUniform("vec4","model_clippingPlanesEdgeStyle",fe.FRAGMENT),r.addUniform("mat4","model_clippingPlanesMatrix",fe.FRAGMENT),r.addFragmentLines(iX);let a={model_clippingPlanes:function(){return i.texture},model_clippingPlanesEdgeStyle:function(){let c=U.clone(i.edgeColor);return c.alpha=i.edgeWidth,c},model_clippingPlanesMatrix:function(){let c=P.transpose(o.uniformState.inverseView3D,zrt);return P.multiply(c,t._clippingPlanesMatrix,Hrt)}};e.uniformMap=It(a,e.uniformMap)};var oX=V_e;var Eli=x(T(),1);var pli=x(T(),1),rX=`void modelClippingPolygonsStage() { bool insideAny = vectorClip(v_clippingUv); #ifdef CLIPPING_INVERSE @@ -8460,22 +8457,22 @@ discard; } #endif } -`;var c4n=x(T(),1),hP=`void modelClippingPolygonsStage() +`;var gli=x(T(),1),sX=`void modelClippingPolygonsStage() { vec2 delta = czm_eyeToCartographicDelta(v_positionEC).xy; v_clippingUv = u_clippingCameraUv + delta * u_clippingRectangleInverseSize; } -`;var lye={name:"ModelClippingPolygonsPipelineStage"},snt=new k,ant=new k,cye=re.MAX_VALUE;lye.process=function(e,t,n){let i=t.clippingPolygons,o=e.shaderBuilder;o.addDefine("ENABLE_CLIPPING_POLYGONS",void 0,fe.BOTH),i.inverse&&o.addDefine("CLIPPING_INVERSE",void 0,fe.FRAGMENT),o.addVarying("vec2","v_clippingUv"),o.addUniform("vec2","u_clippingCameraUv",fe.VERTEX),o.addUniform("vec2","u_clippingRectangleInverseSize",fe.VERTEX),o.addVertexLines(hP),o.addFragmentLines(ub),o.addFragmentLines(mP);let r={u_clippingCameraUv:function(){let s=t._clippingPolygonData?.rectangle??cye,a=s.width*.5,c=s.west+a,d=n.camera.positionCartographic,u=W.negativePiToPi(d.longitude-c)+a;return k.fromElements(u/s.width,(d.latitude-s.south)/s.height,snt)},u_clippingRectangleInverseSize:function(){let s=t._clippingPolygonData?.rectangle??cye;return k.fromElements(1/s.width,1/s.height,ant)},u_clippingEdgeTexture:function(){return t._clippingPolygonData?.polygonEdgeTexture??n.context.defaultTexture},u_clippingEdgePrimitiveIndicesTexture:function(){return t._clippingPolygonData?.polygonEdgePrimitiveIndicesTexture??n.context.defaultTexture},u_clippingGridCellIndicesTexture:function(){return t._clippingPolygonData?.polygonGridCellIndicesTexture??n.context.defaultTexture}};e.uniformMap=It(r,e.uniformMap)};var fP=lye;var W4n=x(T(),1);var T4n=x(T(),1),pP=`void modelVectorLookupStage(ProcessedAttributes attributes) +`;var A_e={name:"ModelClippingPolygonsPipelineStage"},Krt=new k,Jrt=new k,E_e=re.MAX_VALUE;A_e.process=function(e,t,n){let i=t.clippingPolygons,o=e.shaderBuilder;o.addDefine("ENABLE_CLIPPING_POLYGONS",void 0,fe.BOTH),i.inverse&&o.addDefine("CLIPPING_INVERSE",void 0,fe.FRAGMENT),o.addVarying("vec2","v_clippingUv"),o.addUniform("vec2","u_clippingCameraUv",fe.VERTEX),o.addUniform("vec2","u_clippingRectangleInverseSize",fe.VERTEX),o.addVertexLines(sX),o.addFragmentLines(ub),o.addFragmentLines(rX);let r={u_clippingCameraUv:function(){let s=t._clippingPolygonData?.rectangle??E_e,a=s.width*.5,c=s.west+a,d=n.camera.positionCartographic,u=W.negativePiToPi(d.longitude-c)+a;return k.fromElements(u/s.width,(d.latitude-s.south)/s.height,Krt)},u_clippingRectangleInverseSize:function(){let s=t._clippingPolygonData?.rectangle??E_e;return k.fromElements(1/s.width,1/s.height,Jrt)},u_clippingEdgeTexture:function(){return t._clippingPolygonData?.polygonEdgeTexture??n.context.defaultTexture},u_clippingEdgePrimitiveIndicesTexture:function(){return t._clippingPolygonData?.polygonEdgePrimitiveIndicesTexture??n.context.defaultTexture},u_clippingGridCellIndicesTexture:function(){return t._clippingPolygonData?.polygonGridCellIndicesTexture??n.context.defaultTexture}};e.uniformMap=It(r,e.uniformMap)};var aX=A_e;var wli=x(T(),1);var Gli=x(T(),1),cX=`void modelVectorLookupStage(ProcessedAttributes attributes) { vec2 delta = czm_eyeToCartographicDelta(v_positionEC).xy; v_vectorUv = u_vectorCameraUv + delta * u_vectorRectangleInverseSize; } -`;var S4n=x(T(),1),bP=`void modelVectorLookupStage(inout vec4 color) +`;var Wli=x(T(),1),lX=`void modelVectorLookupStage(inout vec4 color) { color = vectorPolygonRender(v_vectorUv, color); color = vectorPolylineRender(v_vectorUv, color); } -`;var cnt={name:"ModelVectorLookupPipelineStage",process:unt},lnt=new k,dnt=new k;function unt(e,t,n){let i=e.shaderBuilder,o=t._vectorData,r=o.hasPolylines,s=o.hasPolygons;i.addDefine("HAS_VECTOR_LOOKUP",void 0,fe.BOTH),r&&(i.addDefine("HAS_VECTOR_POLYLINES",void 0,fe.FRAGMENT),o.hasMeterWidths&&(i.addDefine("VECTOR_WIDTH_IN_METERS",void 0,fe.FRAGMENT),o.hasPixelWidths&&i.addDefine("VECTOR_WIDTH_MIXED_UNITS",void 0,fe.FRAGMENT),i.addUniform("vec2","u_vectorMetersPerUv",fe.FRAGMENT))),s&&i.addDefine("HAS_VECTOR_POLYGONS",void 0,fe.FRAGMENT),i.addUniform("vec2","u_vectorCameraUv",fe.VERTEX),i.addUniform("vec2","u_vectorRectangleInverseSize",fe.VERTEX),i.addVarying("vec2","v_vectorUv"),i.addVertexLines(pP),i.addFragmentLines(ub),i.addFragmentLines(bP);let a=o.rectangle,c=function(){return n.context.defaultTexture},d={u_vectorCameraUv:function(){let u=t._vectorData?.rectangle??a,m=n.camera.positionCartographic,p=u.width*.5,b=u.west+p,f=W.negativePiToPi(m.longitude-b)+p;return k.fromElements(f/u.width,(m.latitude-u.south)/u.height,lnt)},u_vectorRectangleInverseSize:function(){let u=t._vectorData?.rectangle??a;return k.fromElements(1/u.width,1/u.height,dnt)},u_vectorColorTexture:function(){return t._vectorData?.colorTexture??c()},u_vectorPickColorTexture:function(){return t._vectorData?.pickColorTexture??c()}};r&&(d.u_vectorSegmentTexture=function(){return t._vectorData?.polylineSegmentTexture??c()},d.u_vectorWidthTexture=function(){return t._vectorData?.widthTexture??c()},d.u_vectorSegmentPrimitiveIndicesTexture=function(){return t._vectorData?.polylineSegmentPrimitiveIndicesTexture??c()},d.u_vectorGridCellIndicesTexture=function(){return t._vectorData?.polylineGridCellIndicesTexture??c()},o.hasMeterWidths&&(d.u_vectorMetersPerUv=function(){return t._vectorData.metersPerUv})),s&&(d.u_vectorPolygonEdgeTexture=function(){return t._vectorData?.polygonEdgeTexture??c()},d.u_vectorPolygonEdgePrimitiveIndicesTexture=function(){return t._vectorData?.polygonEdgePrimitiveIndicesTexture??c()},d.u_vectorPolygonGridCellIndicesTexture=function(){return t._vectorData?.polygonGridCellIndicesTexture??c()}),e.uniformMap=It(d,e.uniformMap)}var gP=cnt;var I4n=x(T(),1);function dye(e,t){this._model=e,this._runtimeNode=t}Object.defineProperties(dye.prototype,{name:{get:function(){return this._runtimeNode._name}},id:{get:function(){return this._runtimeNode._id}},show:{get:function(){return this._runtimeNode.show},set:function(e){this._runtimeNode.show=e}},matrix:{get:function(){return this._runtimeNode.transform},set:function(e){l(e)?(this._runtimeNode.transform=e,this._runtimeNode.userAnimated=!0,this._model._userAnimationDirty=!0):(this._runtimeNode.transform=this.originalMatrix,this._runtimeNode.userAnimated=!1)}},originalMatrix:{get:function(){return this._runtimeNode.originalTransform}}});var yP=dye;var GQn=x(T(),1);var lQn=x(T(),1);var X4n=x(T(),1),xP=`mat4 getInstancingTransform() +`;var jrt={name:"ModelVectorLookupPipelineStage",process:$rt},Qrt=new k,qrt=new k;function $rt(e,t,n){let i=e.shaderBuilder,o=t._vectorData,r=o.hasPolylines,s=o.hasPolygons;i.addDefine("HAS_VECTOR_LOOKUP",void 0,fe.BOTH),r&&(i.addDefine("HAS_VECTOR_POLYLINES",void 0,fe.FRAGMENT),o.hasMeterWidths&&(i.addDefine("VECTOR_WIDTH_IN_METERS",void 0,fe.FRAGMENT),o.hasPixelWidths&&i.addDefine("VECTOR_WIDTH_MIXED_UNITS",void 0,fe.FRAGMENT),i.addUniform("vec2","u_vectorMetersPerUv",fe.FRAGMENT))),s&&i.addDefine("HAS_VECTOR_POLYGONS",void 0,fe.FRAGMENT),i.addUniform("vec2","u_vectorCameraUv",fe.VERTEX),i.addUniform("vec2","u_vectorRectangleInverseSize",fe.VERTEX),i.addVarying("vec2","v_vectorUv"),i.addVertexLines(cX),i.addFragmentLines(ub),i.addFragmentLines(lX);let a=o.rectangle,c=function(){return n.context.defaultTexture},d={u_vectorCameraUv:function(){let u=t._vectorData?.rectangle??a,m=n.camera.positionCartographic,p=u.width*.5,b=u.west+p,f=W.negativePiToPi(m.longitude-b)+p;return k.fromElements(f/u.width,(m.latitude-u.south)/u.height,Qrt)},u_vectorRectangleInverseSize:function(){let u=t._vectorData?.rectangle??a;return k.fromElements(1/u.width,1/u.height,qrt)},u_vectorColorTexture:function(){return t._vectorData?.colorTexture??c()},u_vectorPickColorTexture:function(){return t._vectorData?.pickColorTexture??c()}};r&&(d.u_vectorSegmentTexture=function(){return t._vectorData?.polylineSegmentTexture??c()},d.u_vectorWidthTexture=function(){return t._vectorData?.widthTexture??c()},d.u_vectorSegmentPrimitiveIndicesTexture=function(){return t._vectorData?.polylineSegmentPrimitiveIndicesTexture??c()},d.u_vectorGridCellIndicesTexture=function(){return t._vectorData?.polylineGridCellIndicesTexture??c()},o.hasMeterWidths&&(d.u_vectorMetersPerUv=function(){return t._vectorData.metersPerUv})),s&&(d.u_vectorPolygonEdgeTexture=function(){return t._vectorData?.polygonEdgeTexture??c()},d.u_vectorPolygonEdgePrimitiveIndicesTexture=function(){return t._vectorData?.polygonEdgePrimitiveIndicesTexture??c()},d.u_vectorPolygonGridCellIndicesTexture=function(){return t._vectorData?.polygonGridCellIndicesTexture??c()}),e.uniformMap=It(d,e.uniformMap)}var dX=jrt;var Dli=x(T(),1);function G_e(e,t){this._model=e,this._runtimeNode=t}Object.defineProperties(G_e.prototype,{name:{get:function(){return this._runtimeNode._name}},id:{get:function(){return this._runtimeNode._id}},show:{get:function(){return this._runtimeNode.show},set:function(e){this._runtimeNode.show=e}},matrix:{get:function(){return this._runtimeNode.transform},set:function(e){l(e)?(this._runtimeNode.transform=e,this._runtimeNode.userAnimated=!0,this._model._userAnimationDirty=!0):(this._runtimeNode.transform=this.originalMatrix,this._runtimeNode.userAnimated=!1)}},originalMatrix:{get:function(){return this._runtimeNode.originalTransform}}});var uX=G_e;var Ydi=x(T(),1);var ydi=x(T(),1);var Bli=x(T(),1),mX=`mat4 getInstancingTransform() { mat4 instancingTransform; #ifdef HAS_INSTANCE_MATRICES @@ -8533,7 +8530,7 @@ translation2D.x, translation2D.y, translation2D.z, 1.0 return instancingTransform2D; } #endif -`;var Y4n=x(T(),1),TP=`void instancingStage(inout ProcessedAttributes attributes) +`;var Hli=x(T(),1),hX=`void instancingStage(inout ProcessedAttributes attributes) { vec3 positionMC = attributes.positionMC; mat4 instancingTransform = getInstancingTransform(); @@ -8547,7 +8544,7 @@ mat4 instancingTransform2D = getInstancingTransform2D(); attributes.position2D = (instancingTransform2D * vec4(positionMC, 1.0)).xyz; #endif } -`;var w4n=x(T(),1),_P=`void legacyInstancingStage( +`;var Jli=x(T(),1),fX=`void legacyInstancingStage( inout ProcessedAttributes attributes, out mat4 instanceModelView, out mat3 instanceModelViewInverseTranspose) @@ -8563,7 +8560,7 @@ mat4 instancingTransform2D = getInstancingTransform2D(); attributes.position2D = (instancingTransform2D * vec4(positionMC, 1.0)).xyz; #endif } -`;var aB=new P,mnt=new P,hnt=new P,mye={name:"InstancingPipelineStage",_getInstanceTransformsAsMatrices:gye,_transformsToTypedArray:Z7};mye.process=function(e,t,n){let i=t.instances,o=i.attributes[0].count,r=e.shaderBuilder;r.addDefine("HAS_INSTANCING"),r.addVertexLines(xP);let s=e.model,a=s.sceneGraph,c=e.runtimeNode,d=n.mode!==se.SCENE3D&&!n.scene3DOnly&&s._projectTo2D,u=s._enablePick&&!n.context.webgl2,m=[];Ant(e,n,i,m,d,u),Wnt(e,n,i,m);let p={};if(i.transformInWorldSpace?(r.addDefine("USE_LEGACY_INSTANCING",void 0,fe.VERTEX),r.addUniform("mat4","u_instance_modifiedModelView",fe.VERTEX),r.addUniform("mat4","u_instance_nodeTransform",fe.VERTEX),p.u_instance_modifiedModelView=function(){let b=P.multiplyTransformation(s.modelMatrix,a.components.transform,aB);return d?P.multiplyTransformation(n.context.uniformState.view3D,b,aB):(n.mode!==se.SCENE3D&&(b=_t.basisTo2D(n.mapProjection,b,aB)),P.multiplyTransformation(n.context.uniformState.view,b,aB))},p.u_instance_nodeTransform=function(){return P.multiplyTransformation(a.axisCorrectionMatrix,c.computedTransform,mnt)},r.addVertexLines(_P)):r.addVertexLines(TP),d){r.addDefine("USE_2D_INSTANCING",void 0,fe.VERTEX),r.addUniform("mat4","u_modelView2D",fe.VERTEX);let b=n.context,f=P.fromTranslation(c.instancingReferencePoint2D,new P);p.u_modelView2D=function(){return P.multiplyTransformation(b.uniformState.view,f,hnt)}}e.uniformMap=It(p,e.uniformMap),e.instanceCount=o,ei(e.attributes,m)};var SP=new P,fnt=new h;function pnt(e,t,n,i,o){let r=P.multiplyTransformation(t,e,SP);return r=P.multiplyTransformation(r,n,SP),o=_t.basisTo2D(i.mapProjection,r,o),o}function bnt(e,t,n,i,o){let r=P.fromTranslation(e,SP),s=P.multiplyTransformation(t,r,SP);s=P.multiplyTransformation(s,n,SP);let a=P.getTranslation(s,fnt);return o=fo.computeActualEllipsoidPosition(i,a,o),o}function hye(e,t,n){let i=e.model,o=i.sceneGraph;e.runtimeNode.node.instances.transformInWorldSpace?(P.multiplyTransformation(i.modelMatrix,o.components.transform,t),P.multiplyTransformation(o.axisCorrectionMatrix,e.runtimeNode.computedTransform,n)):(t=P.clone(o.computedModelMatrix,t),P.multiplyTransformation(t,e.runtimeNode.computedTransform,t),P.clone(P.IDENTITY,n))}var fye=new P,pye=new P,gnt=new P,ynt=new h;function xnt(e,t,n,i){let o=fye,r=pye;hye(t,o,r);let a=t.runtimeNode.instancingReferencePoint2D,c=e.length;for(let d=0;d=e.featureIdVertexAttributeSetIndex&&(e.featureIdVertexAttributeSetIndex=a.setIndex+1),i.push({index:e.attributeIndex++,vertexBuffer:a.buffer,componentsPerAttribute:Dt.getNumberOfComponents(a.type),componentDatatype:a.componentDatatype,normalize:!1,offsetInBytes:a.byteOffset,strideInBytes:a.byteStride,instanceDivisor:1}),r.addAttribute("float",`a_instanceFeatureId_${a.setIndex}`))}}var ZP=mye;var pQn=x(T(),1);var yye=[],C7={};C7.name="ModelMatrixUpdateStage";C7.update=function(e,t,n){let i=n.mode!==se.SCENE3D;if(!(i&&t._model._projectTo2D)&&e._transformDirty){if(!e.show)return;let o=i?t._computedModelMatrix2D:t._computedModelMatrix;xye(e,t,o,e.transformToRoot,0),e._transformDirty=!1}};function vnt(e,t,n){e.modelMatrix=P.multiplyTransformation(t,n,e.modelMatrix),e.cullFace=Zt.getCullFace(e.modelMatrix,e.primitiveType)}function xye(e,t,n,i,o){let r,s=yye[o];l(s)||(s=yye[o]=new P),i=P.multiplyTransformation(i,e.transform,s),e.updateComputedTransform();let a=e.runtimePrimitives.length;for(r=0;r1&&(i.addDefine("MULTILINE_BATCH_TEXTURE"),i.addUniform("vec2","model_textureDimensions"),o.model_textureDimensions=function(){return c.textureDimensions}),e.uniformMap=It(o,e.uniformMap)};var AP=Rye;var BQn=x(T(),1);var Cye={name:"ClassificationPipelineStage"};Cye.process=function(e,t,n){e.shaderBuilder.addDefine("HAS_CLASSIFICATION",void 0,fe.BOTH);let o=e.runtimePrimitive;l(o.batchLengths)||Int(t,o)};function Int(e,t){let n=Zt.getAttributeBySemantic(e,dt.POSITION);if(!l(n))throw new ae("Primitives must have a position attribute to be used for classification.");let i,o=e.indices,r=l(o);r&&(i=o.typedArray,o.typedArray=void 0);let s=r?o.count:n.count,a=Zt.getAttributeBySemantic(e,dt.FEATURE_ID,0);if(!l(a)){t.batchLengths=[s],t.batchOffsets=[0];return}let c=a.typedArray;a.typedArray=void 0;let d=[],u=[0],m=r?i[0]:0,p=c[m],b=0;for(let y=1;y=e.featureIdVertexAttributeSetIndex&&(e.featureIdVertexAttributeSetIndex=a.setIndex+1),i.push({index:e.attributeIndex++,vertexBuffer:a.buffer,componentsPerAttribute:Dt.getNumberOfComponents(a.type),componentDatatype:a.componentDatatype,normalize:!1,offsetInBytes:a.byteOffset,strideInBytes:a.byteStride,instanceDivisor:1}),r.addAttribute("float",`a_instanceFeatureId_${a.setIndex}`))}}var bX=W_e;var Rdi=x(T(),1);var N_e=[],pq={};pq.name="ModelMatrixUpdateStage";pq.update=function(e,t,n){let i=n.mode!==se.SCENE3D;if(!(i&&t._model._projectTo2D)&&e._transformDirty){if(!e.show)return;let o=i?t._computedModelMatrix2D:t._computedModelMatrix;Y_e(e,t,o,e.transformToRoot,0),e._transformDirty=!1}};function Tst(e,t,n){e.modelMatrix=P.multiplyTransformation(t,n,e.modelMatrix),e.cullFace=Zt.getCullFace(e.modelMatrix,e.primitiveType)}function Y_e(e,t,n,i,o){let r,s=N_e[o];l(s)||(s=N_e[o]=new P),i=P.multiplyTransformation(i,e.transform,s),e.updateComputedTransform();let a=e.runtimePrimitives.length;for(r=0;r1&&(i.addDefine("MULTILINE_BATCH_TEXTURE"),i.addUniform("vec2","model_textureDimensions"),o.model_textureDimensions=function(){return c.textureDimensions}),e.uniformMap=It(o,e.uniformMap)};var _X=D_e;var eui=x(T(),1);var O_e={name:"ClassificationPipelineStage"};O_e.process=function(e,t,n){e.shaderBuilder.addDefine("HAS_CLASSIFICATION",void 0,fe.BOTH);let o=e.runtimePrimitive;l(o.batchLengths)||Sst(t,o)};function Sst(e,t){let n=Zt.getAttributeBySemantic(e,dt.POSITION);if(!l(n))throw new ae("Primitives must have a position attribute to be used for classification.");let i,o=e.indices,r=l(o);r&&(i=o.typedArray,o.typedArray=void 0);let s=r?o.count:n.count,a=Zt.getAttributeBySemantic(e,dt.FEATURE_ID,0);if(!l(a)){t.batchLengths=[s],t.batchOffsets=[0];return}let c=a.typedArray;a.typedArray=void 0;let d=[],u=[0],m=r?i[0]:0,p=c[m],b=0;for(let y=1;yOnt(i,t,n)):[]}function Ont(e,t,n){let{getAttributeByName:i,getAttributeInfo:o,sanitizeGlslIdentifier:r}=Zt,s=e.class.id,a=n?.classes[s],c=Object.entries(e.properties),d=new Array(c.length);for(let u=0;uznt(n,t)):[]}function znt(e,t){let{sanitizeGlslIdentifier:n}=Zt,i=e.class.id,o=t?.classes[i],r=Object.entries(e.properties).filter(([a,c])=>{let d=c.textureReader.channels.length;return c.classProperty.isGpuCompatible(d)}),s=new Array(r.length);for(let a=0;al(s.class)&&r.has(String(s.id))).flatMap(s=>Jnt(s,r,i,o))}function Jnt(e,t,n,i){let{sanitizeGlslIdentifier:o}=Zt,r=e.class,s=n?.classes[r.id],a=t.get(String(e.id))??{},c=a.shaderDestination??fe.BOTH,d=e.properties,u=r.properties,m=[],p=0;for(let[b,f]of Object.entries(u)){if(!f.isGpuCompatible(Hnt))continue;let y=d[b],_=fe.intersection(dit(b,i),c);if(_===fe.NONE){p++;continue}m.push({metadataVariable:o(b),property:y,classProperty:f,type:f.type,glslType:f.getGlslType(),propertyStatistics:s?.properties[b],shaderDestination:_,propertyTable:e,featureIdVariableName:a.variableName,propertyInfoIndex:p}),p++}return m}function jnt(e,t){let n=new Map;function i(a,c){let d=a?.propertyTableId;if(!l(d))return;let u=String(d),m={variableName:a.positionalLabel,shaderDestination:c},p=n.get(u);l(p)&&console.warn(`Multiple feature ID sets reference the same property table ${d} in primitive. Only one will be used.`),n.set(u,m)}let o=t?.featureIds??[];for(let a=0;am),i.addStructField(vi.STRUCT_ID_METADATA_FS,s,r);let y=`attributes.texCoord_${c}`,_=y;if(l(p)&&!q.equals(p,q.IDENTITY)){let A=`${b}Transform`;i.addUniform("mat3",A,fe.FRAGMENT),o[A]=function(){return p},_=`vec2(${A} * vec3(${y}, 1.0))`}let S=`texture(${b}, ${_}).${d}`,Z=a.classProperty,R;n?R=Z.unpackTextureInShader(S,d,r,f):R=Z.unpackTextureInShaderWebGL1(S);let C=L7({valueExpression:R,renderResources:e,glslType:s,metadataVariable:r,shaderDestination:fe.FRAGMENT,property:a}),E=`metadata.${r} = ${C};`;f.push(E),i.addFunctionLines(vi.FUNCTION_ID_INITIALIZE_METADATA_FS,f)}function A7(e,t){let n=t.classProperty,{metadataVariable:i,glslType:o,shaderDestination:r}=t,s=Gye(vi.METADATA_CLASS_FIELDS,n,`metadataClass.${i}`,o),a=`${o}MetadataClass`;e.addStructField(vi.STRUCT_ID_METADATA_CLASS_FS,a,i),e.addFunctionLines(vi.FUNCTION_ID_INITIALIZE_METADATA_FS,s),fe.includesVertexShader(r)&&(e.addStructField(vi.STRUCT_ID_METADATA_CLASS_VS,a,i),e.addFunctionLines(vi.FUNCTION_ID_INITIALIZE_METADATA_VS,s))}function G7(e,t){let{propertyStatistics:n}=t;if(!l(n))return;let{metadataVariable:i,type:o,glslType:r}=t;if(o===St.ENUM)return;let s=vi.METADATA_STATISTICS_FIELDS,a=`metadataStatistics.${i}`,c=Gye(s,n,a,r),d=`${r}MetadataStatistics`;e.addStructField(vi.STRUCT_ID_METADATA_STATISTICS_FS,d,i),e.addFunctionLines(vi.FUNCTION_ID_INITIALIZE_METADATA_FS,c),fe.includesVertexShader(t.shaderDestination)&&(e.addStructField(vi.STRUCT_ID_METADATA_STATISTICS_VS,d,i),e.addFunctionLines(vi.FUNCTION_ID_INITIALIZE_METADATA_VS,c))}function rit(e,t,n){sit(e,t,n),A7(e.shaderBuilder,t),G7(e.shaderBuilder,t)}function sit(e,t,n){let{shaderBuilder:i,uniformMap:o}=e,{metadataVariable:r,glslType:s,property:a,featureIdVariableName:c,propertyTable:d,propertyInfoIndex:u}=t;if(!n){xt("PropertyTableCustomShader","Property table support for custom shaders requires WebGL2.");return}if(!l(c)||!l(d.texture))return;let m=`u_propertyTableTexture_${d.id}`,p=[];o.hasOwnProperty(m)||(i.addUniform("sampler2D",m,fe.BOTH),o[m]=()=>d.texture);let b=t.shaderDestination;fe.includesVertexShader(b)&&i.addStructField(vi.STRUCT_ID_METADATA_VS,s,r),fe.includesFragmentShader(b)&&i.addStructField(vi.STRUCT_ID_METADATA_FS,s,r);let y=`ivec2(${`featureIds.${c}`}, ${u})`,_=`texelFetch(${m}, ${y}, 0)`,S=t.classProperty,Z=S.unpackTextureInShader(_,"rgba",r,p),R=L7({valueExpression:Z,renderResources:e,glslType:s,metadataVariable:r,shaderDestination:b,property:a??S}),C=`metadata.${r} = ${R};`;p.push(C),fe.includesVertexShader(b)&&i.addFunctionLines(vi.FUNCTION_ID_INITIALIZE_METADATA_VS,p),fe.includesFragmentShader(b)&&i.addFunctionLines(vi.FUNCTION_ID_INITIALIZE_METADATA_FS,p)}function Gye(e,t,n,i){function o(r){let s=t[r.specName];if(l(s))return`${n}.${r.shaderName} = ${i}(${s});`}return l(t)?e.map(o).filter(l):[]}function L7(e){let{valueExpression:t,property:n}=e;if(!n.hasValueTransform)return t;let i=e.metadataVariable,o=`u_${i}_offset`,r=`u_${i}_scale`,{shaderBuilder:s,uniformMap:a}=e.renderResources,{glslType:c,shaderDestination:d}=e;s.addUniform(c,o,d),s.addUniform(c,r,d);let{offset:u,scale:m}=n;return a[o]=()=>u,a[r]=()=>m,`czm_valueTransform(${o}, ${r}, ${t})`}function ait(e,t){let n=new Set,i=new Set;return cit(e,n,i),lit(e,t,n,i),{usedInVertex:n,usedInFragment:i}}function cit(e,t,n){let i=e.customShader;if(!l(i))return;let o=i.usedVariablesFragment?.metadataSet??{};for(let s in o)o.hasOwnProperty(s)&&n.add(s);let r=i.usedVariablesVertex?.metadataSet??{};for(let s in r)r.hasOwnProperty(s)&&t.add(s)}function lit(e,t,n,i){let o=e.style;if(!(l(o)&&t.primitiveType===Ie.POINTS))return;let s=o.color?.getVariables?.()??[];for(let d of s)n.add(d),i.add(d);let a=o.show?.getVariables?.()??[];for(let d of a)n.add(d),i.add(d);let c=o.pointSize?.getVariables?.()??[];for(let d of c)n.add(d)}function dit(e,t){let n=t.usedInFragment.has(e)?fe.FRAGMENT:fe.NONE,i=t.usedInVertex.has(e)?fe.VERTEX:fe.NONE;return fe.union(n,i)}var Um=vi;var O8n=x(T(),1),Lye={INHERIT:0,OPAQUE:1,TRANSLUCENT:2};Object.freeze(Lye);var _x=Lye;var ka={name:"CustomShaderPipelineStage",STRUCT_ID_ATTRIBUTES_VS:"AttributesVS",STRUCT_ID_ATTRIBUTES_FS:"AttributesFS",STRUCT_NAME_ATTRIBUTES:"Attributes",STRUCT_ID_VERTEX_INPUT:"VertexInput",STRUCT_NAME_VERTEX_INPUT:"VertexInput",STRUCT_ID_FRAGMENT_INPUT:"FragmentInput",STRUCT_NAME_FRAGMENT_INPUT:"FragmentInput",FUNCTION_ID_INITIALIZE_INPUT_STRUCT_VS:"initializeInputStructVS",FUNCTION_SIGNATURE_INITIALIZE_INPUT_STRUCT_VS:"void initializeInputStruct(out VertexInput vsInput, ProcessedAttributes attributes)",FUNCTION_ID_INITIALIZE_INPUT_STRUCT_FS:"initializeInputStructFS",FUNCTION_SIGNATURE_INITIALIZE_INPUT_STRUCT_FS:"void initializeInputStruct(out FragmentInput fsInput, ProcessedAttributes attributes)",_oneTimeWarning:xt};ka.process=function(e,t,n){let{shaderBuilder:i,model:o,alphaOptions:r}=e,{customShader:s}=o,{lightingModel:a,translucencyMode:c}=s;l(a)&&(e.lightingOptions.lightingModel=a),c===_x.TRANSLUCENT?r.pass=Le.TRANSLUCENT:c===_x.OPAQUE&&(r.pass=void 0);let d=yit(s,t,e);if(!d.customShaderEnabled)return;if(Sit(i,s,d),d.shouldComputePositionWC&&i.addDefine("COMPUTE_POSITION_WC_CUSTOM_SHADER",void 0,fe.BOTH),l(s.vertexShaderText)&&i.addDefine("HAS_CUSTOM_VERTEX_SHADER",void 0,fe.VERTEX),l(s.fragmentShaderText)){i.addDefine("HAS_CUSTOM_FRAGMENT_SHADER",void 0,fe.FRAGMENT);let p=Kb.getDefineName(s.mode);i.addDefine(p,void 0,fe.FRAGMENT)}let u=s.uniforms;for(let p in u)if(u.hasOwnProperty(p)){let b=u[p];i.addUniform(b.type,p)}let m=s.varyings;for(let p in m)if(m.hasOwnProperty(p)){let b=m[p];i.addVarying(b,p)}e.uniformMap=It(e.uniformMap,s.uniformMap)};function uit(e){let t={};for(let n=0;na.propertyTableId):[],r=new Set;function s(a,c){for(let d of a){let m=c[d].class.properties;Object.keys(m).forEach(p=>r.add(p))}}return s(n,t.propertyTextures),s(i,t.propertyAttributes),s(o,t.propertyTables),r}function Iye(e,t){for(let n in e)if(e.hasOwnProperty(n)&&!t.has(n))return ka._oneTimeWarning("CustomShaderPipelineStage.checkMetadataCompatibility",`A custom shader uses metadata property "${n}" which is not present for all primitives in the tileset. Disabling the custom shader for these primitives.`),!1;return!0}var MP=ka;var u6n=x(T(),1);var wP={name:"DequantizationPipelineStage",FUNCTION_ID_DEQUANTIZATION_STAGE_VS:"dequantizationStage",FUNCTION_SIGNATURE_DEQUANTIZATION_STAGE_VS:"void dequantizationStage(inout ProcessedAttributes attributes)"};wP.process=function(e,t,n){let i=e.shaderBuilder,o=e.model,r=l(o.classificationType);i.addDefine("USE_DEQUANTIZATION",void 0,fe.VERTEX),i.addFunction(wP.FUNCTION_ID_DEQUANTIZATION_STAGE_VS,wP.FUNCTION_SIGNATURE_DEQUANTIZATION_STAGE_VS,fe.VERTEX);let s=t.attributes;for(let a=0;avst(i,t,n)):[]}function vst(e,t,n){let{getAttributeByName:i,getAttributeInfo:o,sanitizeGlslIdentifier:r}=Zt,s=e.class.id,a=n?.classes[s],c=Object.entries(e.properties),d=new Array(c.length);for(let u=0;uIst(n,t)):[]}function Ist(e,t){let{sanitizeGlslIdentifier:n}=Zt,i=e.class.id,o=t?.classes[i],r=Object.entries(e.properties).filter(([a,c])=>{let d=c.textureReader.channels.length;return c.classProperty.isGpuCompatible(d)}),s=new Array(r.length);for(let a=0;al(s.class)&&r.has(String(s.id))).flatMap(s=>Nst(s,r,i,o))}function Nst(e,t,n,i){let{sanitizeGlslIdentifier:o}=Zt,r=e.class,s=n?.classes[r.id],a=t.get(String(e.id))??{},c=a.shaderDestination??fe.BOTH,d=e.properties,u=r.properties,m=[],p=0;for(let[b,f]of Object.entries(u)){if(!f.isGpuCompatible(Pst))continue;let y=d[b],_=fe.intersection(qst(b,i),c);if(_===fe.NONE){p++;continue}m.push({metadataVariable:o(b),property:y,classProperty:f,type:f.type,glslType:f.getGlslType(),propertyStatistics:s?.properties[b],shaderDestination:_,propertyTable:e,featureIdVariableName:a.variableName,propertyInfoIndex:p}),p++}return m}function Yst(e,t){let n=new Map;function i(a,c){let d=a?.propertyTableId;if(!l(d))return;let u=String(d),m={variableName:a.positionalLabel,shaderDestination:c},p=n.get(u);l(p)&&console.warn(`Multiple feature ID sets reference the same property table ${d} in primitive. Only one will be used.`),n.set(u,m)}let o=t?.featureIds??[];for(let a=0;am),i.addStructField(vi.STRUCT_ID_METADATA_FS,s,r);let y=`attributes.texCoord_${c}`,_=y;if(l(p)&&!q.equals(p,q.IDENTITY)){let A=`${b}Transform`;i.addUniform("mat3",A,fe.FRAGMENT),o[A]=function(){return p},_=`vec2(${A} * vec3(${y}, 1.0))`}let S=`texture(${b}, ${_}).${d}`,Z=a.classProperty,R;n?R=Z.unpackTextureInShader(S,d,r,f):R=Z.unpackTextureInShaderWebGL1(S);let C=Tq({valueExpression:R,renderResources:e,glslType:s,metadataVariable:r,shaderDestination:fe.FRAGMENT,property:a}),E=`metadata.${r} = ${C};`;f.push(E),i.addFunctionLines(vi.FUNCTION_ID_INITIALIZE_METADATA_FS,f)}function yq(e,t){let n=t.classProperty,{metadataVariable:i,glslType:o,shaderDestination:r}=t,s=K_e(vi.METADATA_CLASS_FIELDS,n,`metadataClass.${i}`,o),a=`${o}MetadataClass`;e.addStructField(vi.STRUCT_ID_METADATA_CLASS_FS,a,i),e.addFunctionLines(vi.FUNCTION_ID_INITIALIZE_METADATA_FS,s),fe.includesVertexShader(r)&&(e.addStructField(vi.STRUCT_ID_METADATA_CLASS_VS,a,i),e.addFunctionLines(vi.FUNCTION_ID_INITIALIZE_METADATA_VS,s))}function xq(e,t){let{propertyStatistics:n}=t;if(!l(n))return;let{metadataVariable:i,type:o,glslType:r}=t;if(o===St.ENUM)return;let s=vi.METADATA_STATISTICS_FIELDS,a=`metadataStatistics.${i}`,c=K_e(s,n,a,r),d=`${r}MetadataStatistics`;e.addStructField(vi.STRUCT_ID_METADATA_STATISTICS_FS,d,i),e.addFunctionLines(vi.FUNCTION_ID_INITIALIZE_METADATA_FS,c),fe.includesVertexShader(t.shaderDestination)&&(e.addStructField(vi.STRUCT_ID_METADATA_STATISTICS_VS,d,i),e.addFunctionLines(vi.FUNCTION_ID_INITIALIZE_METADATA_VS,c))}function Hst(e,t,n){Kst(e,t,n),yq(e.shaderBuilder,t),xq(e.shaderBuilder,t)}function Kst(e,t,n){let{shaderBuilder:i,uniformMap:o}=e,{metadataVariable:r,glslType:s,property:a,featureIdVariableName:c,propertyTable:d,propertyInfoIndex:u}=t;if(!n){xt("PropertyTableCustomShader","Property table support for custom shaders requires WebGL2.");return}if(!l(c)||!l(d.texture))return;let m=`u_propertyTableTexture_${d.id}`,p=[];o.hasOwnProperty(m)||(i.addUniform("sampler2D",m,fe.BOTH),o[m]=()=>d.texture);let b=t.shaderDestination;fe.includesVertexShader(b)&&i.addStructField(vi.STRUCT_ID_METADATA_VS,s,r),fe.includesFragmentShader(b)&&i.addStructField(vi.STRUCT_ID_METADATA_FS,s,r);let y=`ivec2(${`featureIds.${c}`}, ${u})`,_=`texelFetch(${m}, ${y}, 0)`,S=t.classProperty,Z=S.unpackTextureInShader(_,"rgba",r,p),R=Tq({valueExpression:Z,renderResources:e,glslType:s,metadataVariable:r,shaderDestination:b,property:a??S}),C=`metadata.${r} = ${R};`;p.push(C),fe.includesVertexShader(b)&&i.addFunctionLines(vi.FUNCTION_ID_INITIALIZE_METADATA_VS,p),fe.includesFragmentShader(b)&&i.addFunctionLines(vi.FUNCTION_ID_INITIALIZE_METADATA_FS,p)}function K_e(e,t,n,i){function o(r){let s=t[r.specName];if(l(s))return`${n}.${r.shaderName} = ${i}(${s});`}return l(t)?e.map(o).filter(l):[]}function Tq(e){let{valueExpression:t,property:n}=e;if(!n.hasValueTransform)return t;let i=e.metadataVariable,o=`u_${i}_offset`,r=`u_${i}_scale`,{shaderBuilder:s,uniformMap:a}=e.renderResources,{glslType:c,shaderDestination:d}=e;s.addUniform(c,o,d),s.addUniform(c,r,d);let{offset:u,scale:m}=n;return a[o]=()=>u,a[r]=()=>m,`czm_valueTransform(${o}, ${r}, ${t})`}function Jst(e,t){let n=new Set,i=new Set;return jst(e,n,i),Qst(e,t,n,i),{usedInVertex:n,usedInFragment:i}}function jst(e,t,n){let i=e.customShader;if(!l(i))return;let o=i.usedVariablesFragment?.metadataSet??{};for(let s in o)o.hasOwnProperty(s)&&n.add(s);let r=i.usedVariablesVertex?.metadataSet??{};for(let s in r)r.hasOwnProperty(s)&&t.add(s)}function Qst(e,t,n,i){let o=e.style;if(!(l(o)&&t.primitiveType===Ie.POINTS))return;let s=o.color?.getVariables?.()??[];for(let d of s)n.add(d),i.add(d);let a=o.show?.getVariables?.()??[];for(let d of a)n.add(d),i.add(d);let c=o.pointSize?.getVariables?.()??[];for(let d of c)n.add(d)}function qst(e,t){let n=t.usedInFragment.has(e)?fe.FRAGMENT:fe.NONE,i=t.usedInVertex.has(e)?fe.VERTEX:fe.NONE;return fe.union(n,i)}var jm=vi;var $ui=x(T(),1),J_e={INHERIT:0,OPAQUE:1,TRANSLUCENT:2};Object.freeze(J_e);var Zx=J_e;var Da={name:"CustomShaderPipelineStage",STRUCT_ID_ATTRIBUTES_VS:"AttributesVS",STRUCT_ID_ATTRIBUTES_FS:"AttributesFS",STRUCT_NAME_ATTRIBUTES:"Attributes",STRUCT_ID_VERTEX_INPUT:"VertexInput",STRUCT_NAME_VERTEX_INPUT:"VertexInput",STRUCT_ID_FRAGMENT_INPUT:"FragmentInput",STRUCT_NAME_FRAGMENT_INPUT:"FragmentInput",FUNCTION_ID_INITIALIZE_INPUT_STRUCT_VS:"initializeInputStructVS",FUNCTION_SIGNATURE_INITIALIZE_INPUT_STRUCT_VS:"void initializeInputStruct(out VertexInput vsInput, ProcessedAttributes attributes)",FUNCTION_ID_INITIALIZE_INPUT_STRUCT_FS:"initializeInputStructFS",FUNCTION_SIGNATURE_INITIALIZE_INPUT_STRUCT_FS:"void initializeInputStruct(out FragmentInput fsInput, ProcessedAttributes attributes)",_oneTimeWarning:xt};Da.process=function(e,t,n){let{shaderBuilder:i,model:o,alphaOptions:r}=e,{customShader:s}=o,{lightingModel:a,translucencyMode:c}=s;l(a)&&(e.lightingOptions.lightingModel=a),c===Zx.TRANSLUCENT?r.pass=Le.TRANSLUCENT:c===Zx.OPAQUE&&(r.pass=void 0);let d=sat(s,t,e);if(!d.customShaderEnabled)return;if(dat(i,s,d),d.shouldComputePositionWC&&i.addDefine("COMPUTE_POSITION_WC_CUSTOM_SHADER",void 0,fe.BOTH),l(s.vertexShaderText)&&i.addDefine("HAS_CUSTOM_VERTEX_SHADER",void 0,fe.VERTEX),l(s.fragmentShaderText)){i.addDefine("HAS_CUSTOM_FRAGMENT_SHADER",void 0,fe.FRAGMENT);let p=eg.getDefineName(s.mode);i.addDefine(p,void 0,fe.FRAGMENT)}let u=s.uniforms;for(let p in u)if(u.hasOwnProperty(p)){let b=u[p];i.addUniform(b.type,p)}let m=s.varyings;for(let p in m)if(m.hasOwnProperty(p)){let b=m[p];i.addVarying(b,p)}e.uniformMap=It(e.uniformMap,s.uniformMap)};function $st(e){let t={};for(let n=0;na.propertyTableId):[],r=new Set;function s(a,c){for(let d of a){let m=c[d].class.properties;Object.keys(m).forEach(p=>r.add(p))}}return s(n,t.propertyTextures),s(i,t.propertyAttributes),s(o,t.propertyTables),r}function $_e(e,t){for(let n in e)if(e.hasOwnProperty(n)&&!t.has(n))return Da._oneTimeWarning("CustomShaderPipelineStage.checkMetadataCompatibility",`A custom shader uses metadata property "${n}" which is not present for all primitives in the tileset. Disabling the custom shader for these primitives.`),!1;return!0}var vX=Da;var Tmi=x(T(),1);var FX={name:"DequantizationPipelineStage",FUNCTION_ID_DEQUANTIZATION_STAGE_VS:"dequantizationStage",FUNCTION_SIGNATURE_DEQUANTIZATION_STAGE_VS:"void dequantizationStage(inout ProcessedAttributes attributes)"};FX.process=function(e,t,n){let i=e.shaderBuilder,o=e.model,r=l(o.classificationType);i.addDefine("USE_DEQUANTIZATION",void 0,fe.VERTEX),i.addFunction(FX.FUNCTION_ID_DEQUANTIZATION_STAGE_VS,FX.FUNCTION_SIGNATURE_DEQUANTIZATION_STAGE_VS,fe.VERTEX);let s=t.attributes;for(let a=0;a0?h.normalize(c,c):(c.x=0,c.y=0,c.z=1),a[d*3]=c.x,a[d*3+1]=c.y,a[d*3+2]=c.z;for(let d=0;d=a.length)continue;let b=p*3,f=(p+1)*3,y=d*6;o[y]=a[b],o[y+1]=a[b+1],o[y+2]=a[b+2],o[y+3]=a[f],o[y+4]=a[f+1],o[y+5]=a[f+2]}return o}function Git(e){let t=e.edgeVisibility;if(!l(t))return[];let n=t.visibility,i=e.indices,o=t.lineStrings,r=e.attributes,s=l(r)&&r.length>0?r[0].count:0,a=l(n)&&l(i)&&l(i.typedArray)&&i.typedArray.length>0,c=l(o)&&o.length>0;if(!a&&!c)return[];let d=a?i.typedArray:void 0,u=[],m=[],p=new Set,b=0,f=t.materialColor;if(a){let y=0,_=d.length,S=n;for(let Z=0;Z+2<_;Z+=3){let R=d[Z],C=d[Z+1],E=d[Z+2];for(let A=0;A<3;A++){let L,F;A===0?(L=R,F=C):A===1?(L=C,F=E):(L=E,F=R);let I=Math.floor(y/4),N=y%4*2;if(y++,I>=S.length)break;let V=S[I]>>N&3;if(V===vC.HIDDEN)continue;let G=Math.min(L,F),v=Math.max(L,F),X=`${G},${v}`;if(p.has(X))continue;p.add(X),u.push(L,F);let Y=-1;V===vC.SILHOUETTE&&(Y=b,b++),m.push({edgeType:V===vC.REPEATED_HARD?vC.HARD:V,silhouetteEdgeIndex:Y,color:f})}}}if(c)for(let y=0;y0&&(L<0||L>=s||F<0||F>=s))continue;let I=Math.min(L,F),N=Math.max(L,F),g=`${I},${N}`;p.has(g)||(p.add(g),u.push(L,F),m.push({edgeType:vC.HARD,silhouetteEdgeIndex:-1,color:l(R)?R:void 0}))}}return{edgeIndices:u,edgeData:m,silhouetteEdgeCount:b}}function Lit(e){if(!l(e))return;let t=Zt.getAttributeBySemantic(e,dt.COLOR);if(!l(t))return;let n=Dt.getNumberOfComponents(t.type);if(n!==3&&n!==4)return;let i=t.typedArray;if(l(i)||(i=xa.readAttributeAsTypedArray(t)),!l(i))return;let o=t.count;if(!l(o)||o===0||i.length=M){O(qe);return}let Ke=We*4,ct=qe*4;Y[ct]=D[Ke],Y[ct+1]=D[Ke+1],Y[ct+2]=D[Ke+2],Y[ct+3]=D[Ke+3]}for(let qe=0;qe<_;qe++){let We=e[qe*2],Ke=e[qe*2+1],Et=t[qe].edgeType/255,zt=E[We*3],ut=E[We*3+1],bt=E[We*3+2],ht=E[Ke*3],jt=E[Ke*3+1],st=E[Ke*3+2],pt=qe*4;A[pt*3]=zt,A[pt*3+1]=ut,A[pt*3+2]=bt,N[pt*3]=ht,N[pt*3+1]=jt,N[pt*3+2]=st,g[pt]=-1,L[pt]=Et,A[(pt+1)*3]=zt,A[(pt+1)*3+1]=ut,A[(pt+1)*3+2]=bt,N[(pt+1)*3]=ht,N[(pt+1)*3+1]=jt,N[(pt+1)*3+2]=st,g[pt+1]=1,L[pt+1]=Et,A[(pt+2)*3]=ht,A[(pt+2)*3+1]=jt,A[(pt+2)*3+2]=st,N[(pt+2)*3]=zt,N[(pt+2)*3+1]=ut,N[(pt+2)*3+2]=bt,g[pt+2]=1,L[pt+2]=Et,A[(pt+3)*3]=ht,A[(pt+3)*3+1]=jt,A[(pt+3)*3+2]=st,N[(pt+3)*3]=zt,N[(pt+3)*3+1]=ut,N[(pt+3)*3+2]=bt,g[pt+3]=-1,L[pt+3]=Et;let Mi=t[qe].color;if(l(Mi))for(let rn=0;rn<4;rn++)w(pt+rn,Mi);else if(l(D))for(let rn=0;rn<4;rn++)z(pt+rn,We);else for(let rn=0;rn<4;rn++)O(pt+rn);if(V){let rn=v[We],Hn=v[Ke];G[pt]=rn,G[pt+1]=rn,G[pt+2]=Hn,G[pt+3]=Hn}let jn=qe*6,Si=b[jn],Hi=b[jn+1],Gi=b[jn+2],pi=b[jn+3],Zi=b[jn+4],On=b[jn+5];for(let rn=0;rn<4;rn++)F[(pt+rn)*3]=Si,F[(pt+rn)*3+1]=Hi,F[(pt+rn)*3+2]=Gi,I[(pt+rn)*3]=pi,I[(pt+rn)*3+1]=Zi,I[(pt+rn)*3+2]=On}let K=it.createVertexBuffer({context:i,typedArray:A,usage:Pe.STATIC_DRAW}),te=it.createVertexBuffer({context:i,typedArray:L,usage:Pe.STATIC_DRAW}),H=it.createVertexBuffer({context:i,typedArray:F,usage:Pe.STATIC_DRAW}),$=it.createVertexBuffer({context:i,typedArray:I,usage:Pe.STATIC_DRAW}),ee=it.createVertexBuffer({context:i,typedArray:N,usage:Pe.STATIC_DRAW}),le=it.createVertexBuffer({context:i,typedArray:g,usage:Pe.STATIC_DRAW}),_e=X?it.createVertexBuffer({context:i,typedArray:Y,usage:Pe.STATIC_DRAW}):void 0,he=V?it.createVertexBuffer({context:i,typedArray:G,usage:Pe.STATIC_DRAW}):void 0,ye=_*2*3,Ge=Z>65534,Ae=Ge?new Uint32Array(ye):new Uint16Array(ye);for(let qe=0;qe<_;qe++){let We=qe*4,Ke=qe*6;Ae[Ke]=We,Ae[Ke+1]=We+1,Ae[Ke+2]=We+2,Ae[Ke+3]=We,Ae[Ke+4]=We+2,Ae[Ke+5]=We+3}let Fe=it.createIndexBuffer({context:i,typedArray:Ae,usage:Pe.STATIC_DRAW,indexDatatype:Ge?Oe.UNSIGNED_INT:Oe.UNSIGNED_SHORT}),tt=[{index:R,vertexBuffer:K,componentsPerAttribute:3,componentDatatype:J.FLOAT,normalize:!1},{index:o,vertexBuffer:te,componentsPerAttribute:1,componentDatatype:J.FLOAT,normalize:!1},{index:r,vertexBuffer:H,componentsPerAttribute:3,componentDatatype:J.FLOAT,normalize:!1},{index:s,vertexBuffer:$,componentsPerAttribute:3,componentDatatype:J.FLOAT,normalize:!1},{index:d,vertexBuffer:ee,componentsPerAttribute:3,componentDatatype:J.FLOAT,normalize:!1},{index:u,vertexBuffer:le,componentsPerAttribute:1,componentDatatype:J.FLOAT,normalize:!1}];X&&tt.push({index:c,vertexBuffer:_e,componentsPerAttribute:4,componentDatatype:J.FLOAT,normalize:!1}),V&&tt.push({index:y,vertexBuffer:he,componentsPerAttribute:1,componentDatatype:J.FLOAT,normalize:!1});let Be=n.runtimePrimitive.primitive;if(l(Be.featureIds)&&Be.featureIds.length>0){let qe=Be.featureIds[0];if(l(qe.setIndex)){let We=Be.attributes.find(Ke=>Ke.semantic===dt.FEATURE_ID&&Ke.setIndex===qe.setIndex);if(l(We)){let Ke=l(We.typedArray)?We.typedArray:xa.readAttributeAsTypedArray(We),ct=new Float32Array(Z);for(let zt=0;zt<_;zt++){let ut=e[zt*2],bt=ut0}}var zP=Nye;var G7n=x(T(),1);var o7n=x(T(),1),HP=`void geometryStage(out ProcessedAttributes attributes) +`;var Hmi=x(T(),1);var _q=class e{static readAttributeAsTypedArray(t){let n=e.readAttributeAsRawCompactTypedArray(t),i=t.normalized,o=t.quantization;if(!l(o)&&!i)return n;let r=t.type,s=t.count,a=n;return i&&(a=dn.dequantize(n,t.componentDatatype,r,s)),l(o)?e.dequantize(a,s,r,o):a}static readAttributeAsRawCompactTypedArray(t){let n=t.type,i=t.count,o=Dt.getNumberOfComponents(n),r=i*o,s=t.componentDatatype,a=t.quantization;l(a)&&(s=a.componentDatatype);let c=t.buffer,d=t.byteOffset,u=t.byteStride,m=J.getSizeInBytes(s),p=o*m,b=!l(u)||u===p;if(l(t.typedArray))return t.typedArray;if(b){let E=J.createTypedArray(s,r);return c.getBufferData(E,d),E}let y=new Uint8Array(c.sizeInBytes);c.getBufferData(y);let _=J.createTypedArray(s,r),S=u??p,Z=new DataView(y.buffer,y.byteOffset,y.byteLength),R=new Array(o),C=e.createComponentsReader(s);for(let E=0;E0?h.normalize(c,c):(c.x=0,c.y=0,c.z=1),a[d*3]=c.x,a[d*3+1]=c.y,a[d*3+2]=c.z;for(let d=0;d=a.length)continue;let b=p*3,f=(p+1)*3,y=d*6;o[y]=a[b],o[y+1]=a[b+1],o[y+2]=a[b+2],o[y+3]=a[f],o[y+4]=a[f+1],o[y+5]=a[f+2]}return o}function gat(e){let t=e.edgeVisibility;if(!l(t))return[];let n=t.visibility,i=e.indices,o=t.lineStrings,r=e.attributes,s=l(r)&&r.length>0?r[0].count:0,a=l(n)&&l(i)&&l(i.typedArray)&&i.typedArray.length>0,c=l(o)&&o.length>0;if(!a&&!c)return[];let d=a?i.typedArray:void 0,u=[],m=[],p=new Set,b=0,f=t.materialColor;if(a){let y=0,_=d.length,S=n;for(let Z=0;Z+2<_;Z+=3){let R=d[Z],C=d[Z+1],E=d[Z+2];for(let A=0;A<3;A++){let L,F;A===0?(L=R,F=C):A===1?(L=C,F=E):(L=E,F=R);let I=Math.floor(y/4),N=y%4*2;if(y++,I>=S.length)break;let V=S[I]>>N&3;if(V===sV.HIDDEN)continue;let G=Math.min(L,F),v=Math.max(L,F),X=`${G},${v}`;if(p.has(X))continue;p.add(X),u.push(L,F);let Y=-1;V===sV.SILHOUETTE&&(Y=b,b++),m.push({edgeType:V===sV.REPEATED_HARD?sV.HARD:V,silhouetteEdgeIndex:Y,color:f})}}}if(c)for(let y=0;y0&&(L<0||L>=s||F<0||F>=s))continue;let I=Math.min(L,F),N=Math.max(L,F),g=`${I},${N}`;p.has(g)||(p.add(g),u.push(L,F),m.push({edgeType:sV.HARD,silhouetteEdgeIndex:-1,color:l(R)?R:void 0}))}}return{edgeIndices:u,edgeData:m,silhouetteEdgeCount:b}}function yat(e){if(!l(e))return;let t=Zt.getAttributeBySemantic(e,dt.COLOR);if(!l(t))return;let n=Dt.getNumberOfComponents(t.type);if(n!==3&&n!==4)return;let i=t.typedArray;if(l(i)||(i=Sa.readAttributeAsTypedArray(t)),!l(i))return;let o=t.count;if(!l(o)||o===0||i.length=M){O(qe);return}let Ke=We*4,ct=qe*4;Y[ct]=D[Ke],Y[ct+1]=D[Ke+1],Y[ct+2]=D[Ke+2],Y[ct+3]=D[Ke+3]}for(let qe=0;qe<_;qe++){let We=e[qe*2],Ke=e[qe*2+1],Et=t[qe].edgeType/255,zt=E[We*3],ut=E[We*3+1],bt=E[We*3+2],ht=E[Ke*3],jt=E[Ke*3+1],st=E[Ke*3+2],pt=qe*4;A[pt*3]=zt,A[pt*3+1]=ut,A[pt*3+2]=bt,N[pt*3]=ht,N[pt*3+1]=jt,N[pt*3+2]=st,g[pt]=-1,L[pt]=Et,A[(pt+1)*3]=zt,A[(pt+1)*3+1]=ut,A[(pt+1)*3+2]=bt,N[(pt+1)*3]=ht,N[(pt+1)*3+1]=jt,N[(pt+1)*3+2]=st,g[pt+1]=1,L[pt+1]=Et,A[(pt+2)*3]=ht,A[(pt+2)*3+1]=jt,A[(pt+2)*3+2]=st,N[(pt+2)*3]=zt,N[(pt+2)*3+1]=ut,N[(pt+2)*3+2]=bt,g[pt+2]=1,L[pt+2]=Et,A[(pt+3)*3]=ht,A[(pt+3)*3+1]=jt,A[(pt+3)*3+2]=st,N[(pt+3)*3]=zt,N[(pt+3)*3+1]=ut,N[(pt+3)*3+2]=bt,g[pt+3]=-1,L[pt+3]=Et;let Mi=t[qe].color;if(l(Mi))for(let rn=0;rn<4;rn++)w(pt+rn,Mi);else if(l(D))for(let rn=0;rn<4;rn++)z(pt+rn,We);else for(let rn=0;rn<4;rn++)O(pt+rn);if(V){let rn=v[We],Hn=v[Ke];G[pt]=rn,G[pt+1]=rn,G[pt+2]=Hn,G[pt+3]=Hn}let jn=qe*6,Si=b[jn],Hi=b[jn+1],Gi=b[jn+2],pi=b[jn+3],Zi=b[jn+4],On=b[jn+5];for(let rn=0;rn<4;rn++)F[(pt+rn)*3]=Si,F[(pt+rn)*3+1]=Hi,F[(pt+rn)*3+2]=Gi,I[(pt+rn)*3]=pi,I[(pt+rn)*3+1]=Zi,I[(pt+rn)*3+2]=On}let K=it.createVertexBuffer({context:i,typedArray:A,usage:Pe.STATIC_DRAW}),te=it.createVertexBuffer({context:i,typedArray:L,usage:Pe.STATIC_DRAW}),H=it.createVertexBuffer({context:i,typedArray:F,usage:Pe.STATIC_DRAW}),$=it.createVertexBuffer({context:i,typedArray:I,usage:Pe.STATIC_DRAW}),ee=it.createVertexBuffer({context:i,typedArray:N,usage:Pe.STATIC_DRAW}),le=it.createVertexBuffer({context:i,typedArray:g,usage:Pe.STATIC_DRAW}),_e=X?it.createVertexBuffer({context:i,typedArray:Y,usage:Pe.STATIC_DRAW}):void 0,he=V?it.createVertexBuffer({context:i,typedArray:G,usage:Pe.STATIC_DRAW}):void 0,ye=_*2*3,Ge=Z>65534,Ae=Ge?new Uint32Array(ye):new Uint16Array(ye);for(let qe=0;qe<_;qe++){let We=qe*4,Ke=qe*6;Ae[Ke]=We,Ae[Ke+1]=We+1,Ae[Ke+2]=We+2,Ae[Ke+3]=We,Ae[Ke+4]=We+2,Ae[Ke+5]=We+3}let Fe=it.createIndexBuffer({context:i,typedArray:Ae,usage:Pe.STATIC_DRAW,indexDatatype:Ge?Oe.UNSIGNED_INT:Oe.UNSIGNED_SHORT}),tt=[{index:R,vertexBuffer:K,componentsPerAttribute:3,componentDatatype:J.FLOAT,normalize:!1},{index:o,vertexBuffer:te,componentsPerAttribute:1,componentDatatype:J.FLOAT,normalize:!1},{index:r,vertexBuffer:H,componentsPerAttribute:3,componentDatatype:J.FLOAT,normalize:!1},{index:s,vertexBuffer:$,componentsPerAttribute:3,componentDatatype:J.FLOAT,normalize:!1},{index:d,vertexBuffer:ee,componentsPerAttribute:3,componentDatatype:J.FLOAT,normalize:!1},{index:u,vertexBuffer:le,componentsPerAttribute:1,componentDatatype:J.FLOAT,normalize:!1}];X&&tt.push({index:c,vertexBuffer:_e,componentsPerAttribute:4,componentDatatype:J.FLOAT,normalize:!1}),V&&tt.push({index:y,vertexBuffer:he,componentsPerAttribute:1,componentDatatype:J.FLOAT,normalize:!1});let Be=n.runtimePrimitive.primitive;if(l(Be.featureIds)&&Be.featureIds.length>0){let qe=Be.featureIds[0];if(l(qe.setIndex)){let We=Be.attributes.find(Ke=>Ke.semantic===dt.FEATURE_ID&&Ke.setIndex===qe.setIndex);if(l(We)){let Ke=l(We.typedArray)?We.typedArray:Sa.readAttributeAsTypedArray(We),ct=new Float32Array(Z);for(let zt=0;zt<_;zt++){let ut=e[zt*2],bt=ut0}}var MX=nSe;var Yhi=x(T(),1);var hhi=x(T(),1),wX=`void geometryStage(out ProcessedAttributes attributes) { attributes.positionMC = v_positionMC; attributes.positionEC = v_positionEC; @@ -8863,7 +8860,7 @@ attributes.bitangentEC = normalize(v_bitangentEC); #endif setDynamicVaryings(attributes); } -`;var s7n=x(T(),1),KP=`vec4 geometryStage(inout ProcessedAttributes attributes, mat4 modelView, mat3 normal) +`;var phi=x(T(),1),kX=`vec4 geometryStage(inout ProcessedAttributes attributes, mat4 modelView, mat3 normal) { vec4 computedPosition; vec3 positionMC = attributes.positionMC; @@ -8891,7 +8888,7 @@ v_bitangentEC = normalize(normal * attributes.bitangentMC); setDynamicVaryings(attributes); return computedPosition; } -`;var p7n=x(T(),1);var c7n=x(T(),1),FC=`vec2 computeSt(float featureId) +`;var Rhi=x(T(),1);var ghi=x(T(),1),aV=`vec2 computeSt(float featureId) { float stepX = model_textureStep.x; float centerX = model_textureStep.y; @@ -8929,8 +8926,7 @@ feature.color = vec4(1.0); } #endif } -`;var JP={name:"SelectedFeatureIdPipelineStage",STRUCT_ID_SELECTED_FEATURE:"SelectedFeature",STRUCT_NAME_SELECTED_FEATURE:"SelectedFeature"};JP.process=function(e,t,n){let i=e.shaderBuilder;e.hasPropertyTable=!0;let o=e.model,r=e.runtimeNode.node,s=vit(o,r,t),a=s.shaderDestination;i.addDefine("HAS_SELECTED_FEATURE_ID",void 0,a),i.addDefine("SELECTED_FEATURE_ID",s.variableName,a),i.addDefine(s.featureIdDefine,void 0,a),Fit(i);let c=s.featureIds.nullFeatureId,d=e.uniformMap;l(c)&&(i.addDefine("HAS_NULL_FEATURE_ID",void 0,a),i.addUniform("int","model_nullFeatureId",a),d.model_nullFeatureId=function(){return c}),s.shaderDestination===fe.BOTH&&i.addVertexLines(FC),i.addFragmentLines(FC)};function Yye(e){return e instanceof Vn.FeatureIdTexture?"HAS_SELECTED_FEATURE_ID_TEXTURE":"HAS_SELECTED_FEATURE_ID_ATTRIBUTE"}function Mye(e){return e instanceof Vn.FeatureIdTexture?fe.FRAGMENT:fe.BOTH}function vit(e,t,n){let i,o;return l(t.instances)&&(o=Zt.getFeatureIdsByLabel(t.instances.featureIds,e.instanceFeatureIdLabel),l(o))?(i=o.label??o.positionalLabel,{featureIds:o,variableName:i,shaderDestination:Mye(o),featureIdDefine:Yye(o)}):(o=Zt.getFeatureIdsByLabel(n.featureIds,e.featureIdLabel),i=o.label??o.positionalLabel,{featureIds:o,variableName:i,shaderDestination:Mye(o),featureIdDefine:Yye(o)})}function Fit(e){e.addStructField(JP.STRUCT_ID_SELECTED_FEATURE,"int","id"),e.addStructField(JP.STRUCT_ID_SELECTED_FEATURE,"vec2","st"),e.addStructField(JP.STRUCT_ID_SELECTED_FEATURE,"vec4","color")}var Sx=JP;var Ua={name:"GeometryPipelineStage",STRUCT_ID_PROCESSED_ATTRIBUTES_VS:"ProcessedAttributesVS",STRUCT_ID_PROCESSED_ATTRIBUTES_FS:"ProcessedAttributesFS",STRUCT_NAME_PROCESSED_ATTRIBUTES:"ProcessedAttributes",FUNCTION_ID_INITIALIZE_ATTRIBUTES:"initializeAttributes",FUNCTION_SIGNATURE_INITIALIZE_ATTRIBUTES:"void initializeAttributes(out ProcessedAttributes attributes)",FUNCTION_ID_SET_DYNAMIC_VARYINGS_VS:"setDynamicVaryingsVS",FUNCTION_ID_SET_DYNAMIC_VARYINGS_FS:"setDynamicVaryingsFS",FUNCTION_SIGNATURE_SET_DYNAMIC_VARYINGS:"void setDynamicVaryings(inout ProcessedAttributes attributes)"};Ua.process=function(e,t,n){let{shaderBuilder:i,model:o}=e;i.addStruct(Ua.STRUCT_ID_PROCESSED_ATTRIBUTES_VS,"ProcessedAttributes",fe.VERTEX),i.addStruct(Ua.STRUCT_ID_PROCESSED_ATTRIBUTES_FS,"ProcessedAttributes",fe.FRAGMENT),i.addStruct(Sx.STRUCT_ID_SELECTED_FEATURE,Sx.STRUCT_NAME_SELECTED_FEATURE,fe.BOTH),i.addFunction(Ua.FUNCTION_ID_INITIALIZE_ATTRIBUTES,Ua.FUNCTION_SIGNATURE_INITIALIZE_ATTRIBUTES,fe.VERTEX),i.addVarying("vec3","v_positionWC"),i.addVarying("vec3","v_positionEC"),i.addStructField(Ua.STRUCT_ID_PROCESSED_ATTRIBUTES_FS,"vec3","positionWC"),i.addStructField(Ua.STRUCT_ID_PROCESSED_ATTRIBUTES_FS,"vec3","positionEC"),i.addFunction(Ua.FUNCTION_ID_SET_DYNAMIC_VARYINGS_VS,Ua.FUNCTION_SIGNATURE_SET_DYNAMIC_VARYINGS,fe.VERTEX),i.addFunction(Ua.FUNCTION_ID_SET_DYNAMIC_VARYINGS_FS,Ua.FUNCTION_SIGNATURE_SET_DYNAMIC_VARYINGS,fe.FRAGMENT),o.type===Or.TILE_PNTS&&i.addDefine("HAS_SRGB_COLOR",void 0,fe.FRAGMENT);let r=n.mode!==se.SCENE3D&&!n.scene3DOnly&&o._projectTo2D,s=l(e.runtimeNode.node.instances),a=r&&!s,c=t.attributes.length;for(let d=0;d1?(b=e.attributeIndex,e.attributeIndex+=m):p&&!a?b=0:b=e.attributeIndex++;let f=!p&&t.primitiveType===Ie.POINTS&&n.context.webgl2?"flat":void 0;Iit(e,u,b,m,r,s,f)}Dit(i,t.attributes),t.primitiveType===Ie.POINTS&&i.addDefine("PRIMITIVE_TYPE_POINTS"),i.addVertexLines(KP),i.addFragmentLines(HP)};function Iit(e,t,n,i,o,r,s){let a=e.shaderBuilder,c=Zt.getAttributeInfo(t),d=o&&!r;i>1?Nit(e,t,n,i):Xit(e,t,n,d),Mit(a,c,d),Yit(a,c,s),l(t.semantic)&&Pit(a,t),wit(a,c,o),kit(a,c,d),Uit(a,c)}function Pit(e,t){let{semantic:n,setIndex:i}=t;switch(n){case dt.NORMAL:e.addDefine("HAS_NORMALS");break;case dt.TANGENT:e.addDefine("HAS_TANGENTS");break;case dt.FEATURE_ID:e.addDefine(`HAS${n}_${i}`);break;case dt.TEXCOORD:case dt.COLOR:e.addDefine(`HAS_${n}_${i}`)}}function Xit(e,t,n,i){let{quantization:o,semantic:r,setIndex:s}=t,{type:a,componentDatatype:c}=l(o)?o:t;r===dt.FEATURE_ID&&s>=e.featureIdVertexAttributeSetIndex&&(e.featureIdVertexAttributeSetIndex=s+1);let d=r===dt.POSITION,u=d?0:n,m=Dt.getNumberOfComponents(a),p={index:u,value:l(t.buffer)?void 0:t.constant,vertexBuffer:t.buffer,count:t.count,componentsPerAttribute:m,componentDatatype:c,offsetInBytes:t.byteOffset,strideInBytes:t.byteStride,normalize:t.normalized};if(e.attributes.push(p),!d||!i)return;let b=e.runtimePrimitive.positionBuffer2D,f={index:n,vertexBuffer:b,count:t.count,componentsPerAttribute:m,componentDatatype:J.FLOAT,offsetInBytes:0,strideInBytes:void 0,normalize:t.normalized};e.attributes.push(f)}function Nit(e,t,n,i){let{quantization:o,normalized:r}=t,{type:s,componentDatatype:a}=l(o)?o:t,d=Dt.getNumberOfComponents(s)/i,u=J.getSizeInBytes(a),m=d*u,p=t.byteStride;for(let b=0;b=r&&(y=r-1);let _=f/u|0;return _>=s&&(_=s-1),l(i)?(i.x=y,i.y=_,i):new k(y,_)}},Xr=I7;var B7n=x(T(),1);var P7,Uye="AAPTaeRGM19PsTpo1ePVkJZk4Tg..zqn3rpU4kUaF-8QMW-oWZntlxvKhdUFXLBoo5dQwRNEKd1EoKJh-Ha2zxbrz2Nhz2tV_gLVZTQwFHLzJHKwsGDz4GTKV8jeUgb12Ci9CeU_9sOrauJYnGK2vHhtSSAQ-73rmKzNG_2lZ0zuCCEKslxCmXUw2mT1Cpk0RoCCtDheWByX1e7Lnb3LKCBDt9VhGFSGCOiaFfizFRLld8LWukKgxCgluTpKgUuUi4OytX84roEpm6mP7PE91AT1_5Uash6To",IC={};IC.defaultAccessToken=Uye;IC.defaultWorldImageryServer=new ve({url:"https://ibasemaps-api.arcgis.com/arcgis/rest/services/World_Imagery/MapServer"});IC.defaultWorldHillshadeServer=new ve({url:"https://ibasemaps-api.arcgis.com/arcgis/rest/services/Elevation/World_Hillshade/MapServer"});IC.defaultWorldOceanServer=new ve({url:"https://ibasemaps-api.arcgis.com/arcgis/rest/services/Ocean/World_Ocean_Base/MapServer"});IC.getDefaultTokenCredit=function(e){if(e===Uye){if(!l(P7)){let t=' This application is using a default ArcGIS access token. Please assign Cesium.ArcGisMapService.defaultAccessToken with an API key from your ArcGIS Developer account before using the ArcGIS tile services. You can sign up for a free ArcGIS Developer account at https://developers.arcgis.com/.';P7=new Lt(t,!0)}return P7}};var Fu=IC;var Q7n=x(T(),1);function X7(e){e=e??B.EMPTY_OBJECT,this._pixelsToCheck=e.pixelsToCheck,this._missingImagePixels=void 0,this._missingImageByteLength=void 0,this._isReady=!1;let t=ve.createIfNeeded(e.missingImageUrl),n=this;function i(r){l(r.blob)&&(n._missingImageByteLength=r.blob.size);let s=Fh(r);if(e.disableCheckIfAllPixelsAreTransparent){let a=!0,c=r.width,d=e.pixelsToCheck;for(let u=0,m=d.length;a&&u0&&(a=!1)}a&&(s=void 0)}n._missingImagePixels=s,n._isReady=!0}function o(){n._missingImagePixels=void 0,n._isReady=!0}t.fetchImage({preferBlob:!0,preferImageBitmap:!0,flipY:!0}).then(i).catch(o)}X7.prototype.isReady=function(){return this._isReady};X7.prototype.shouldDiscardImage=function(e){let t=this._pixelsToCheck,n=this._missingImagePixels;if(!l(n)||l(e.blob)&&e.blob.size!==this._missingImageByteLength)return!1;let i=Fh(e),o=e.width;for(let r=0,s=t.length;r1&&o==="name"?(t=1,n=i):t>2&&o==="title"?(t=2,n=i):t>3&&/name/i.test(i)?(t=3,n=i):t>4&&/title/i.test(i)&&(t=4,n=i)}l(n)&&(this.name=e[n])};N7.prototype.configureDescriptionFromProperties=function(e){function t(n){let i='';for(let o in n)if(n.hasOwnProperty(o)){let r=n[o];l(r)&&(typeof r=="object"?i+=``:i+=``)}return i+="
${o}${t(r)}
${o}${r}
",i}this.description=t(e)};var mf=N7;var sqn=x(T(),1);function PC(){ge.throwInstantiationError()}Object.defineProperties(PC.prototype,{rectangle:{get:ge.throwInstantiationError},tileWidth:{get:ge.throwInstantiationError},tileHeight:{get:ge.throwInstantiationError},maximumLevel:{get:ge.throwInstantiationError},minimumLevel:{get:ge.throwInstantiationError},tilingScheme:{get:ge.throwInstantiationError},tileDiscardPolicy:{get:ge.throwInstantiationError},errorEvent:{get:ge.throwInstantiationError},credit:{get:ge.throwInstantiationError},proxy:{get:ge.throwInstantiationError},hasAlphaChannel:{get:ge.throwInstantiationError}});PC.prototype.getTileCredits=function(e,t,n){ge.throwInstantiationError()};PC.prototype.requestImage=function(e,t,n,i){ge.throwInstantiationError()};PC.prototype.pickFeatures=function(e,t,n,i,o){ge.throwInstantiationError()};var Oit=/\.ktx2$/i;PC.loadImage=function(e,t){let n=ve.createIfNeeded(t);return Oit.test(n.url)?Ad(n):l(e)&&l(e.tileDiscardPolicy)?n.fetchImage({preferBlob:!0,preferImageBitmap:!0,flipY:!0}):n.fetchImage({preferImageBitmap:!0,flipY:!0})};var Iu=PC;var cqn=x(T(),1),Dye={SATELLITE:1,OCEANS:2,HILLSHADE:3};Object.freeze(Dye);var hf=Dye;function Oye(e){this.useTiles=e.usePreCachedTilesIfAvailable??!0;let t=e.ellipsoid;this.tilingScheme=e.tilingScheme??new to({ellipsoid:t}),this.rectangle=e.rectangle??this.tilingScheme.rectangle,this.ellipsoid=t;let n=e.credit;typeof n=="string"&&(n=new Lt(n)),this.credit=n,this.tileCredits=void 0,this.tileDiscardPolicy=e.tileDiscardPolicy,this.tileWidth=e.tileWidth??256,this.tileHeight=e.tileHeight??256,this.maximumLevel=e.maximumLevel}Oye.prototype.build=function(e){e._useTiles=this.useTiles,e._tilingScheme=this.tilingScheme,e._rectangle=this.rectangle,e._credit=this.credit,e._tileCredits=this.tileCredits,e._tileDiscardPolicy=this.tileDiscardPolicy,e._tileWidth=this.tileWidth,e._tileHeight=this.tileHeight,e._maximumLevel=this.maximumLevel,this.useTiles&&!l(this.tileDiscardPolicy)&&(e._tileDiscardPolicy=new QP({missingImageUrl:Bye(e,0,0,this.maximumLevel).url,pixelsToCheck:[new k(0,0),new k(200,20),new k(20,200),new k(80,110),new k(160,130)],disableCheckIfAllPixelsAreTransparent:!0}))};function Bit(e,t){let n=e.tileInfo;if(!l(n))t.useTiles=!1;else{if(t.tileWidth=n.rows,t.tileHeight=n.cols,n.spatialReference.wkid===102100||n.spatialReference.wkid===102113)t.tilingScheme=new Xr({ellipsoid:t.ellipsoid});else if(e.tileInfo.spatialReference.wkid===4326)t.tilingScheme=new to({ellipsoid:t.ellipsoid});else{let i=`Tile spatial reference WKID ${e.tileInfo.spatialReference.wkid} is not supported.`;throw new ae(i)}if(t.maximumLevel=e.tileInfo.lods.length-1,l(e.fullExtent)){if(l(e.fullExtent.spatialReference)&&l(e.fullExtent.spatialReference.wkid))if(e.fullExtent.spatialReference.wkid===102100||e.fullExtent.spatialReference.wkid===102113){let i=new Ti,o=e.fullExtent,r=i.unproject(new h(Math.max(o.xmin,-t.tilingScheme.ellipsoid.maximumRadius*Math.PI),Math.max(o.ymin,-t.tilingScheme.ellipsoid.maximumRadius*Math.PI),0)),s=i.unproject(new h(Math.min(o.xmax,t.tilingScheme.ellipsoid.maximumRadius*Math.PI),Math.min(o.ymax,t.tilingScheme.ellipsoid.maximumRadius*Math.PI),0));t.rectangle=new re(r.longitude,r.latitude,s.longitude,s.latitude)}else if(e.fullExtent.spatialReference.wkid===4326)t.rectangle=re.fromDegrees(e.fullExtent.xmin,e.fullExtent.ymin,e.fullExtent.xmax,e.fullExtent.ymax);else{let i=`fullExtent.spatialReference WKID ${e.fullExtent.spatialReference.wkid} is not supported.`;throw new ae(i)}}else t.rectangle=t.tilingScheme.rectangle;t.useTiles=!0}l(e.copyrightText)&&e.copyrightText.length>0&&(l(t.credit)?t.tileCredits=[new Lt(e.copyrightText)]:t.credit=new Lt(e.copyrightText))}function zit(e,t){let n=`An error occurred while accessing ${e.url}`;throw l(t)&&l(t.message)&&(n+=`: ${t.message}`),new ae(n)}async function Hit(e,t){let n=e.getDerivedResource({queryParameters:{f:"json"}});try{let i=await n.fetchJson();Bit(i,t)}catch(i){zit(e,i)}}function Dp(e){e=e??B.EMPTY_OBJECT,this._defaultAlpha=void 0,this._defaultNightAlpha=void 0,this._defaultDayAlpha=void 0,this._defaultBrightness=void 0,this._defaultContrast=void 0,this._defaultHue=void 0,this._defaultSaturation=void 0,this._defaultGamma=void 0,this._defaultMinificationFilter=void 0,this._defaultMagnificationFilter=void 0,this._tileDiscardPolicy=e.tileDiscardPolicy,this._tileWidth=e.tileWidth??256,this._tileHeight=e.tileHeight??256,this._maximumLevel=e.maximumLevel,this._tilingScheme=e.tilingScheme??new to({ellipsoid:e.ellipsoid}),this._useTiles=e.usePreCachedTilesIfAvailable??!0,this._rectangle=e.rectangle??this._tilingScheme.rectangle,this._layers=e.layers,this._credit=e.credit,this._tileCredits=void 0,this.enablePickFeatures=e.enablePickFeatures??!0,this._errorEvent=new Se}Dp.fromBasemapType=async function(e,t){t=t??B.EMPTY_OBJECT;let n,i,o;switch(e){case hf.SATELLITE:{n=t.token??Fu.defaultAccessToken,i=ve.createIfNeeded(Fu.defaultWorldImageryServer),i.appendForwardSlash();let r=Fu.getDefaultTokenCredit(n);l(r)&&(o=Lt.clone(r))}break;case hf.OCEANS:{n=t.token??Fu.defaultAccessToken,i=ve.createIfNeeded(Fu.defaultWorldOceanServer),i.appendForwardSlash();let r=Fu.getDefaultTokenCredit(n);l(r)&&(o=Lt.clone(r))}break;case hf.HILLSHADE:{n=t.token??Fu.defaultAccessToken,i=ve.createIfNeeded(Fu.defaultWorldHillshadeServer),i.appendForwardSlash();let r=Fu.getDefaultTokenCredit(n);l(r)&&(o=Lt.clone(r))}break;default:}return Dp.fromUrl(i,{...t,token:n,credit:o,usePreCachedTilesIfAvailable:!0})};function Bye(e,t,n,i,o){let r;if(e._useTiles)r=e._resource.getDerivedResource({url:`tile/${i}/${n}/${t}`,request:o});else{let s=e._tilingScheme.tileXYToNativeRectangle(t,n,i),c={bbox:`${s.west},${s.south},${s.east},${s.north}`,size:`${e._tileWidth},${e._tileHeight}`,format:"png32",transparent:!0,f:"image"};e._tilingScheme.projection instanceof ki?(c.bboxSR=4326,c.imageSR=4326):(c.bboxSR=3857,c.imageSR=3857),e.layers&&(c.layers=`show:${e.layers}`),r=e._resource.getDerivedResource({url:"export",request:o,queryParameters:c})}return r}Object.defineProperties(Dp.prototype,{url:{get:function(){return this._resource._url}},token:{get:function(){return this._resource.queryParameters.token}},proxy:{get:function(){return this._resource.proxy}},tileWidth:{get:function(){return this._tileWidth}},tileHeight:{get:function(){return this._tileHeight}},maximumLevel:{get:function(){return this._maximumLevel}},minimumLevel:{get:function(){return 0}},tilingScheme:{get:function(){return this._tilingScheme}},rectangle:{get:function(){return this._rectangle}},tileDiscardPolicy:{get:function(){return this._tileDiscardPolicy}},errorEvent:{get:function(){return this._errorEvent}},credit:{get:function(){return this._credit}},usingPrecachedTiles:{get:function(){return this._useTiles}},hasAlphaChannel:{get:function(){return!0}},layers:{get:function(){return this._layers}}});Dp.fromUrl=async function(e,t){t=t??B.EMPTY_OBJECT;let n=ve.createIfNeeded(e);n.appendForwardSlash(),l(t.token)&&n.setQueryParameters({token:t.token});let i=new Dp(t);i._resource=n;let o=new Oye(t);return(t.usePreCachedTilesIfAvailable??!0)&&await Hit(n,o),o.build(i),i};Dp.prototype.getTileCredits=function(e,t,n){return this._tileCredits};Dp.prototype.requestImage=function(e,t,n,i){return Iu.loadImage(this,Bye(this,e,t,n,i))};Dp.prototype.pickFeatures=function(e,t,n,i,o){if(!this.enablePickFeatures)return;let r=this._tilingScheme.tileXYToNativeRectangle(e,t,n),s,a,c;if(this._tilingScheme.projection instanceof ki)s=W.toDegrees(i),a=W.toDegrees(o),c="4326";else{let p=this._tilingScheme.projection.project(new pe(i,o,0));s=p.x,a=p.y,c="3857"}let d="visible";l(this._layers)&&(d+=`:${this._layers}`);let u={f:"json",tolerance:2,geometryType:"esriGeometryPoint",geometry:`${s},${a}`,mapExtent:`${r.west},${r.south},${r.east},${r.north}`,imageDisplay:`${this._tileWidth},${this._tileHeight},96`,sr:c,layers:d};return this._resource.getDerivedResource({url:"identify",queryParameters:u}).fetchJson().then(function(p){let b=[],f=p.results;if(!l(f))return b;for(let y=0;y0?n.raiseEvent(c):l(t)&&console.log(`An error occurred in "${t.constructor.name}": ${Op(i)}`),c};cB.reportSuccess=function(e){l(e)&&(e.timesRetried=-1)};var tr=cB;var Mqn=x(T(),1),zye={AERIAL:"Aerial",AERIAL_WITH_LABELS:"AerialWithLabels",AERIAL_WITH_LABELS_ON_DEMAND:"AerialWithLabelsOnDemand",ROAD:"Road",ROAD_ON_DEMAND:"RoadOnDemand",CANVAS_DARK:"CanvasDark",CANVAS_LIGHT:"CanvasLight",CANVAS_GRAY:"CanvasGray",ORDNANCE_SURVEY:"OrdnanceSurvey",COLLINS_BART:"CollinsBart"};Object.freeze(zye);var XC=zye;var Uqn=x(T(),1);function qP(e){}qP.prototype.isReady=function(){return!0};qP.prototype.shouldDiscardImage=function(e){return qP.EMPTY_IMAGE===e};var lB;Object.defineProperties(qP,{EMPTY_IMAGE:{get:function(){return l(lB)||(lB=new Image,lB.src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAQAAAC1HAwCAAAAC0lEQVR42mNkYAAAAAYAAjCB0C8AAAAASUVORK5CYII="),lB}}});var NC=qP;function Hye(e){this.tileWidth=void 0,this.tileHeight=void 0,this.maximumLevel=void 0,this.imageUrlSubdomains=void 0,this.imageUrlTemplate=void 0,this.attributionList=void 0}Hye.prototype.build=function(e){e._tileWidth=this.tileWidth,e._tileHeight=this.tileHeight,e._maximumLevel=this.maximumLevel,e._imageUrlSubdomains=this.imageUrlSubdomains,e._imageUrlTemplate=this.imageUrlTemplate;let t=e._attributionList=this.attributionList;t||(t=[]),e._attributionList=t;for(let n=0,i=t.length;no.coverageAreas?.some(r=>l(r.bbox)))),t.attributionList=i}function jit(e,t,n){let i=`An error occurred while accessing ${e.url}`;throw l(t)&&l(t.message)&&(i+=`: ${t.message}`),tr.reportError(void 0,n,l(n)?n._errorEvent:void 0,i,void 0,void 0,void 0,t),new ae(i)}async function Qit(e,t,n){let i=e.url,o=Ta._metadataCache[i];l(o)||(o=e.fetchJson(),Ta._metadataCache[i]=o);try{let r=await o;return Jit(r,t)}catch(r){jit(e,r,n)}}function Ta(e){e=e??B.EMPTY_OBJECT,this._defaultAlpha=void 0,this._defaultNightAlpha=void 0,this._defaultDayAlpha=void 0,this._defaultBrightness=void 0,this._defaultContrast=void 0,this._defaultHue=void 0,this._defaultSaturation=void 0,this._defaultGamma=1,this._defaultMinificationFilter=void 0,this._defaultMagnificationFilter=void 0,this._mapStyle=e.mapStyle??XC.AERIAL,this._mapLayer=e.mapLayer,this._culture=e.culture??"",this._key=e.key,this._tileDiscardPolicy=e.tileDiscardPolicy,l(this._tileDiscardPolicy)||(this._tileDiscardPolicy=new NC),this._proxy=e.proxy,this._credit=new Lt(``),this._tilingScheme=new Xr({numberOfLevelZeroTilesX:2,numberOfLevelZeroTilesY:2,ellipsoid:e.ellipsoid}),this._tileWidth=void 0,this._tileHeight=void 0,this._maximumLevel=void 0,this._imageUrlTemplate=void 0,this._imageUrlSubdomains=void 0,this._attributionList=void 0,this._errorEvent=new Se}Object.defineProperties(Ta.prototype,{url:{get:function(){return this._resource.url}},proxy:{get:function(){return this._resource.proxy}},key:{get:function(){return this._key}},mapStyle:{get:function(){return this._mapStyle}},mapLayer:{get:function(){return this._mapLayer}},culture:{get:function(){return this._culture}},tileWidth:{get:function(){return this._tileWidth}},tileHeight:{get:function(){return this._tileHeight}},maximumLevel:{get:function(){return this._maximumLevel}},minimumLevel:{get:function(){return 0}},tilingScheme:{get:function(){return this._tilingScheme}},rectangle:{get:function(){return this._tilingScheme.rectangle}},tileDiscardPolicy:{get:function(){return this._tileDiscardPolicy}},errorEvent:{get:function(){return this._errorEvent}},credit:{get:function(){return this._credit}},hasAlphaChannel:{get:function(){return l(this.mapLayer)}}});Ta.fromUrl=async function(e,t){t=t??B.EMPTY_OBJECT;let n=t.tileProtocol;l(n)?n.length>0&&n[n.length-1]===":"&&(n=n.substr(0,n.length-1)):n=document.location.protocol==="http:"?"http":"https";let i=t.mapStyle??XC.AERIAL,o=ve.createIfNeeded(e);o.appendForwardSlash();let r={incl:"ImageryProviders",key:t.key,uriScheme:n};l(t.mapLayer)&&(r.mapLayer=t.mapLayer),l(t.culture)&&(r.culture=t.culture);let s=o.getDerivedResource({url:`REST/v1/Imagery/Metadata/${i}`,queryParameters:r}),a=new Ta(t);a._resource=o;let c=new Hye(t);return await Qit(s,c),c.build(a),a};var qit=new re;Ta.prototype.getTileCredits=function(e,t,n){let i=this._tilingScheme.tileXYToRectangle(e,t,n,qit);return tot(this._attributionList,n,i)};Ta.prototype.requestImage=function(e,t,n,i){let o=Iu.loadImage(this,$it(this,e,t,n,i));if(l(o))return o.catch(function(r){return l(r.blob)&&r.blob.size===0?NC.EMPTY_IMAGE:Promise.reject(r)})};Ta.prototype.pickFeatures=function(e,t,n,i,o){};Ta.tileXYToQuadKey=function(e,t,n){let i="";for(let o=n;o>=0;--o){let r=1<=0;--o){let r=1<=m.zoomMin&&t<=m.zoomMax){let p=re.intersection(n,m.bbox,eot);l(p)&&(c=!0)}}c&&i.push(s.credit)}return i}Ta._metadataCache={};var $P=Ta;var P$n=x(T(),1);var T$n=x(T(),1);var Kye=/{[^}]+}/g,Jye={x:rot,y:aot,z:dot,s:uot,reverseX:sot,reverseY:cot,reverseZ:lot,westDegrees:mot,southDegrees:hot,eastDegrees:fot,northDegrees:pot,westProjected:bot,southProjected:got,eastProjected:yot,northProjected:xot,width:Tot,height:_ot},not=It(Jye,{i:Sot,j:Zot,reverseI:Rot,reverseJ:Cot,longitudeDegrees:Eot,latitudeDegrees:Aot,longitudeProjected:Got,latitudeProjected:Lot,format:vot});function eX(e){e=e??B.EMPTY_OBJECT,this._errorEvent=new Se;let t=ve.createIfNeeded(e.url),n=ve.createIfNeeded(e.pickFeaturesUrl);this._resource=t,this._urlSchemeZeroPadding=e.urlSchemeZeroPadding,this._getFeatureInfoFormats=e.getFeatureInfoFormats,this._pickFeaturesResource=n;let i=e.subdomains;Array.isArray(i)?i=i.slice():l(i)&&i.length>0?i=i.split(""):i=["a","b","c"],this._subdomains=i,this._tileWidth=e.tileWidth??256,this._tileHeight=e.tileHeight??256,this._minimumLevel=e.minimumLevel??0,this._maximumLevel=e.maximumLevel,this._tilingScheme=e.tilingScheme??new Xr({ellipsoid:e.ellipsoid}),this._rectangle=e.rectangle??this._tilingScheme.rectangle,this._rectangle=re.intersection(this._rectangle,this._tilingScheme.rectangle),this._tileDiscardPolicy=e.tileDiscardPolicy;let o=e.credit;typeof o=="string"&&(o=new Lt(o)),this._credit=o,this._hasAlphaChannel=e.hasAlphaChannel??!0;let r=e.customTags,s=It(Jye,r),a=It(not,r);this._tags=s,this._pickFeaturesTags=a,this._defaultAlpha=void 0,this._defaultNightAlpha=void 0,this._defaultDayAlpha=void 0,this._defaultBrightness=void 0,this._defaultContrast=void 0,this._defaultHue=void 0,this._defaultSaturation=void 0,this._defaultGamma=void 0,this._defaultMinificationFilter=void 0,this._defaultMagnificationFilter=void 0,this.enablePickFeatures=e.enablePickFeatures??!0}Object.defineProperties(eX.prototype,{url:{get:function(){return this._resource.url}},urlSchemeZeroPadding:{get:function(){return this._urlSchemeZeroPadding}},pickFeaturesUrl:{get:function(){return this._pickFeaturesResource.url}},proxy:{get:function(){return this._resource.proxy}},tileWidth:{get:function(){return this._tileWidth}},tileHeight:{get:function(){return this._tileHeight}},maximumLevel:{get:function(){return this._maximumLevel}},minimumLevel:{get:function(){return this._minimumLevel}},tilingScheme:{get:function(){return this._tilingScheme}},rectangle:{get:function(){return this._rectangle}},tileDiscardPolicy:{get:function(){return this._tileDiscardPolicy}},errorEvent:{get:function(){return this._errorEvent}},credit:{get:function(){return this._credit}},hasAlphaChannel:{get:function(){return this._hasAlphaChannel}}});eX.prototype.getTileCredits=function(e,t,n){};eX.prototype.requestImage=function(e,t,n,i){return Iu.loadImage(this,iot(this,e,t,n,i))};eX.prototype.pickFeatures=function(e,t,n,i,o){if(!this.enablePickFeatures||!l(this._pickFeaturesResource)||this._getFeatureInfoFormats.length===0)return;let r=0,s=this;function a(d,u){return d.callback(u)}function c(){if(r>=s._getFeatureInfoFormats.length)return Promise.resolve([]);let d=s._getFeatureInfoFormats[r],u=oot(s,e,t,n,i,o,d.format);return++r,d.type==="json"?u.fetchJson().then(d.callback).catch(c):d.type==="xml"?u.fetchXML().then(d.callback).catch(c):d.type==="text"||d.type==="html"?u.fetchText().then(d.callback).catch(c):u.fetch({responseType:d.format}).then(a.bind(void 0,d)).catch(c)}return c()};var dB=!1,Pu=new re,uB=!1,tX=new re;function iot(e,t,n,i,o){dB=!1,uB=!1;let r=e._resource,s=r.getUrlComponent(!0),a=e._tags,c={},d=s.match(Kye);return l(d)&&d.forEach(function(u){let m=u.substring(1,u.length-1);l(a[m])&&(c[m]=a[m](e,t,n,i))}),r.getDerivedResource({request:o,templateValues:c})}var Y7=!1,MC=new k,M7=!1;function oot(e,t,n,i,o,r,s){dB=!1,uB=!1,Y7=!1,M7=!1;let a=e._pickFeaturesResource,c=a.getUrlComponent(!0),d=e._pickFeaturesTags,u={},m=c.match(Kye);return l(m)&&m.forEach(function(p){let b=p.substring(1,p.length-1);l(d[b])&&(u[b]=d[b](e,t,n,i,o,r,s))}),a.getDerivedResource({templateValues:u})}function wC(e,t,n){if(e&&e.urlSchemeZeroPadding&&e.urlSchemeZeroPadding.hasOwnProperty(t)){let i=e.urlSchemeZeroPadding[t];if(typeof i=="string"){let o=i.length;o>1&&(n=n.length>=o?n:new Array(o-n.toString().length+1).join("0")+n)}}return n}function rot(e,t,n,i){return wC(e,"{x}",t)}function sot(e,t,n,i){let o=e.tilingScheme.getNumberOfXTilesAtLevel(i)-t-1;return wC(e,"{reverseX}",o)}function aot(e,t,n,i){return wC(e,"{y}",n)}function cot(e,t,n,i){let o=e.tilingScheme.getNumberOfYTilesAtLevel(i)-n-1;return wC(e,"{reverseY}",o)}function lot(e,t,n,i){let o=e.maximumLevel,r=l(o)&&it.rectangle.east&&(e.east=t.rectangle.east),e.southt.rectangle.north&&(e.north=t.rectangle.north),e}function Qye(e,t,n){let i=e.positionToTileXY(re.southwest(t),n),o=e.positionToTileXY(re.northeast(t),n);return(Math.abs(o.x-i.x)+1)*(Math.abs(o.y-i.y)+1)>4?0:n}Dm._metadataSuccess=function(e,t,n,i,o){let r=/tileformat/i,s=/tileset/i,a=/tilesets/i,c=/boundingbox/i,d,u,m,p=[],b=e.childNodes[0].childNodes;for(let F=0;F`),this._tilingScheme=void 0,this._version=void 0,this._tileWidth=256,this._tileHeight=256,this._maximumLevel=e.maximumLevel,this._errorEvent=new Se}Object.defineProperties(Dd.prototype,{url:{get:function(){return this._url}},path:{get:function(){return this._path}},proxy:{get:function(){return this._resource.proxy}},channel:{get:function(){return this._channel}},tileWidth:{get:function(){return this._tileWidth}},tileHeight:{get:function(){return this._tileHeight}},maximumLevel:{get:function(){return this._maximumLevel}},minimumLevel:{get:function(){return 0}},tilingScheme:{get:function(){return this._tilingScheme}},version:{get:function(){return this._version}},requestType:{get:function(){return this._requestType}},rectangle:{get:function(){return this._tilingScheme.rectangle}},tileDiscardPolicy:{get:function(){return this._tileDiscardPolicy}},errorEvent:{get:function(){return this._errorEvent}},credit:{get:function(){return this._credit}},hasAlphaChannel:{get:function(){return!0}}});Dd.fromUrl=async function(e,t,n){n=n??{};let i=n.path??"/default_map",o=ve.createIfNeeded(e).getDerivedResource({url:i[0]==="/"?i.substring(1):i});o.appendForwardSlash();let r=o.getDerivedResource({url:"query",queryParameters:{request:"Json",vars:"geeServerDefs",is2d:"t"}}),s=new qye(n);s.channel=t,await Pot(r,s);let a=new Dd(n);return s.build(a),a._resource=o,a._url=e,a._path=i,a};Dd.prototype.getTileCredits=function(e,t,n){};Dd.prototype.requestImage=function(e,t,n,i){let o=this._resource.getDerivedResource({url:"query",request:i,queryParameters:{request:this._requestType,channel:this._channel,version:this._version,x:e,y:t,z:n+1}});return Iu.loadImage(this,o)};Dd.prototype.pickFeatures=function(e,t,n,i,o){};Dd._logoUrl=void 0;Object.defineProperties(Dd,{logoUrl:{get:function(){return l(Dd._logoUrl)||(Dd._logoUrl=en("Assets/Images/google_earth_credit.png")),Dd._logoUrl},set:function(e){Dd._logoUrl=e}}});var nX=Dd;var tei=x(T(),1);var Xot=/\/$/,$ye=new Lt('© Mapbox © OpenStreetMap Improve this map');function kC(e){e=e??B.EMPTY_OBJECT;let t=e.mapId,n=e.accessToken;this._defaultAlpha=void 0,this._defaultNightAlpha=void 0,this._defaultDayAlpha=void 0,this._defaultBrightness=void 0,this._defaultContrast=void 0,this._defaultHue=void 0,this._defaultSaturation=void 0,this._defaultGamma=void 0,this._defaultMinificationFilter=void 0,this._defaultMagnificationFilter=void 0;let i=ve.createIfNeeded(e.url??"https://{s}.tiles.mapbox.com/v4/");this._mapId=t,this._accessToken=n;let o=e.format??"png";/\./.test(o)||(o=`.${o}`),this._format=o;let r=i.getUrlComponent();Xot.test(r)||(r+="/"),r+=`${t}/{z}/{x}/{y}${this._format}`,i.url=r,i.setQueryParameters({access_token:n});let s;l(e.credit)?(s=e.credit,typeof s=="string"&&(s=new Lt(s))):s=$ye,this._resource=i,this._imageryProvider=new Ss({url:i,credit:s,ellipsoid:e.ellipsoid,minimumLevel:e.minimumLevel,maximumLevel:e.maximumLevel,rectangle:e.rectangle})}Object.defineProperties(kC.prototype,{url:{get:function(){return this._imageryProvider.url}},rectangle:{get:function(){return this._imageryProvider.rectangle}},tileWidth:{get:function(){return this._imageryProvider.tileWidth}},tileHeight:{get:function(){return this._imageryProvider.tileHeight}},maximumLevel:{get:function(){return this._imageryProvider.maximumLevel}},minimumLevel:{get:function(){return this._imageryProvider.minimumLevel}},tilingScheme:{get:function(){return this._imageryProvider.tilingScheme}},tileDiscardPolicy:{get:function(){return this._imageryProvider.tileDiscardPolicy}},errorEvent:{get:function(){return this._imageryProvider.errorEvent}},credit:{get:function(){return this._imageryProvider.credit}},proxy:{get:function(){return this._imageryProvider.proxy}},hasAlphaChannel:{get:function(){return this._imageryProvider.hasAlphaChannel}}});kC.prototype.getTileCredits=function(e,t,n){};kC.prototype.requestImage=function(e,t,n,i){return this._imageryProvider.requestImage(e,t,n,i)};kC.prototype.pickFeatures=function(e,t,n,i,o){return this._imageryProvider.pickFeatures(e,t,n,i,o)};kC._defaultCredit=$ye;var iX=kC;var hei=x(T(),1);function bS(e){e=e??B.EMPTY_OBJECT,this._defaultAlpha=void 0,this._defaultNightAlpha=void 0,this._defaultDayAlpha=void 0,this._defaultBrightness=void 0,this._defaultContrast=void 0,this._defaultHue=void 0,this._defaultSaturation=void 0,this._defaultGamma=void 0,this._defaultMinificationFilter=void 0,this._defaultMagnificationFilter=void 0;let t=e.rectangle??re.MAX_VALUE,n=new to({rectangle:t,numberOfLevelZeroTilesX:1,numberOfLevelZeroTilesY:1,ellipsoid:e.ellipsoid});this._tilingScheme=n,this._image=void 0,this._texture=void 0,this._hasError=!1,this._errorEvent=new Se;let i=e.credit;typeof i=="string"&&(i=new Lt(i)),this._credit=i;let o=ve.createIfNeeded(e.url);this._resource=o,this._tileWidth=e.tileWidth,this._tileHeight=e.tileHeight}Object.defineProperties(bS.prototype,{url:{get:function(){return this._resource.url}},proxy:{get:function(){return this._resource.proxy}},tileWidth:{get:function(){return this._tileWidth}},tileHeight:{get:function(){return this._tileHeight}},maximumLevel:{get:function(){return 0}},minimumLevel:{get:function(){return 0}},tilingScheme:{get:function(){return this._tilingScheme}},rectangle:{get:function(){return this._tilingScheme.rectangle}},tileDiscardPolicy:{get:function(){}},errorEvent:{get:function(){return this._errorEvent}},credit:{get:function(){return this._credit}},hasAlphaChannel:{get:function(){return!0}}});function Not(e,t,n,i){let o=`Failed to load image ${e.url}`;l(t)&&l(t.message)&&(o+=`: ${t.message}`);let r=tr.reportError(i,n,l(n)?n._errorEvent:void 0,o,0,0,0,t);if(r.retry)return k7(e,n,r);throw l(n)&&(n._hasError=!0),new ae(o)}async function k7(e,t,n){try{return await Iu.loadImage(null,e)}catch(i){return Not(e,i,t,n)}}bS.fromUrl=async function(e,t){let n=ve.createIfNeeded(e),i=await k7(n);t=t??B.EMPTY_OBJECT;let o=new bS({...t,url:e,tileWidth:i.width,tileHeight:i.height});return o._image=i,o};bS.prototype.getTileCredits=function(e,t,n){};bS.prototype.requestImage=async function(e,t,n,i){if(!this._hasError&&!l(this._image)){let o=await k7(this._resource,this);return this._image=o,tr.reportSuccess(this._errorEvent),o}return this._image};bS.prototype.pickFeatures=function(e,t,n,i,o){};var oX=bS;var Nei=x(T(),1);var xei=x(T(),1);function Yot(e,t,n){this.type=e,l(t)||(e==="json"?t="application/json":e==="xml"?t="text/xml":e==="html"?t="text/html":e==="text"&&(t="text/plain")),this.format=t,l(n)||(e==="json"?n=Mot:e==="xml"?n=Dot:(e==="html"||e==="text")&&(n=exe)),this.callback=n}function Mot(e){let t=[],n=e.features;for(let i=0;i0)for(let r=0;r\s*<\/body>/im,jot=//im,Qot=/([\s\S]*)<\/title>/im;function exe(e){if(Jot.test(e)||jot.test(e))return;let t,n=Qot.exec(e);n&&n.length>1&&(t=n[1]);let i=new mf;return i.name=t,i.description=e,i.data=e,[i]}var ff=Yot;var Vei=x(T(),1);function rX(e){e=e??B.EMPTY_OBJECT,this._tileCache={},this._tilesRequestedForInterval=[];let t=this._clock=e.clock;this._times=e.times,this._requestImageFunction=e.requestImageFunction,this._reloadFunction=e.reloadFunction,this._currentIntervalIndex=-1,t.onTick.addEventListener(this._clockOnTick,this),this._clockOnTick(t)}Object.defineProperties(rX.prototype,{clock:{get:function(){return this._clock},set:function(e){this._clock!==e&&(this._clock=e,this._clockOnTick(e),this._reloadFunction())}},times:{get:function(){return this._times},set:function(e){this._times!==e&&(this._times=e,this._clockOnTick(this._clock),this._reloadFunction())}},currentInterval:{get:function(){return this._times.get(this._currentIntervalIndex)}}});rX.prototype.getFromCache=function(e,t,n,i){let o=txe(e,t,n),r,s=this._tileCache[this._currentIntervalIndex];if(l(s)&&l(s[o])){let a=s[o];r=a.promise.catch(function(c){throw i.state=a.request.state,c}),delete s[o]}return r};rX.prototype.checkApproachingInterval=function(e,t,n,i){let o=txe(e,t,n),r=this._tilesRequestedForInterval,s=nxe(this),a={key:o,priorityFunction:i.priorityFunction};(!l(s)||!ixe(this,a,s))&&r.push(a),r.length>=512&&r.splice(0,256)};rX.prototype._clockOnTick=function(e){let t=e.currentTime,i=this._times.indexOf(t),o=this._currentIntervalIndex;if(i!==o){let s=this._tileCache[o];for(let a in s)s.hasOwnProperty(a)&&s[a].request.cancel();delete this._tileCache[o],this._tilesRequestedForInterval=[],this._currentIntervalIndex=i,this._reloadFunction();return}let r=nxe(this);if(l(r)){let s=this._tilesRequestedForInterval,a=!0;for(;a&&s.length!==0;){let c=s.pop();a=ixe(this,c,r),a||s.push(c)}}};function txe(e,t,n){return`${e}-${t}-${n}`}function qot(e){let t=e.split("-");if(t.length===3)return{x:Number(t[0]),y:Number(t[1]),level:Number(t[2])}}function nxe(e){let t=e._times;if(!l(t))return;let n=e._clock,i=n.currentTime,o=n.canAnimate&&n.shouldAnimate,r=n.multiplier;if(!o&&r!==0)return;let s,a=t.indexOf(i);if(a<0)return;let c=t.get(a);return r>0?(s=Q.secondsDifference(c.stop,i),++a):(s=Q.secondsDifference(c.start,i),--a),s/=r,a>=0&&s<=5?t.get(a):void 0}function ixe(e,t,n){let i=e._times.indexOf(n.start),o=e._tileCache,r=o[i];l(r)||(r=o[i]={});let s=t.key;if(l(r[s]))return!0;let a=qot(s),c=new Ar({throttle:!1,throttleByServer:!0,type:js.IMAGERY,priorityFunction:t.priorityFunction}),d=e._requestImageFunction(a.x,a.y,a.level,c,n);return l(d)?(r[s]={promise:d,request:c},!0):!1}var gS=rX;var $ot=[3034,3035,3042,3043,3044],ert=[4471,4559];function pf(e){if(e=e??B.EMPTY_OBJECT,l(e.times)&&!l(e.clock))throw new ge("options.times was specified, so options.clock is required.");this._defaultAlpha=void 0,this._defaultNightAlpha=void 0,this._defaultDayAlpha=void 0,this._defaultBrightness=void 0,this._defaultContrast=void 0,this._defaultHue=void 0,this._defaultSaturation=void 0,this._defaultGamma=void 0,this._defaultMinificationFilter=void 0,this._defaultMagnificationFilter=void 0,this._getFeatureInfoUrl=e.getFeatureInfoUrl??e.url;let t=ve.createIfNeeded(e.url),n=ve.createIfNeeded(this._getFeatureInfoUrl);t.setQueryParameters(pf.DefaultParameters,!0),n.setQueryParameters(pf.GetFeatureInfoDefaultParameters,!0),l(e.parameters)&&t.setQueryParameters(oxe(e.parameters)),l(e.getFeatureInfoParameters)&&n.setQueryParameters(oxe(e.getFeatureInfoParameters));let i=this;this._reload=void 0,l(e.times)&&(this._timeDynamicImagery=new gS({clock:e.clock,times:e.times,requestImageFunction:function(s,a,c,d,u){return rxe(i,s,a,c,d,u)},reloadFunction:function(){l(i._reload)&&i._reload()}}));let o={};if(o.layers=e.layers,o.bbox="{westProjected},{southProjected},{eastProjected},{northProjected}",o.width="{width}",o.height="{height}",parseFloat(t.queryParameters.version)>=1.3){o.crs=e.crs??(e.tilingScheme&&e.tilingScheme.projection instanceof Ti?"EPSG:3857":"CRS:84");let s=o.crs.split(":");if(s[0]==="EPSG"&&s.length===2){let a=Number(s[1]);(a>=4e3&&a<5e3&&!ert.includes(a)||$ot.includes(a))&&(o.bbox="{southProjected},{westProjected},{northProjected},{eastProjected}")}}else o.srs=e.srs??(e.tilingScheme&&e.tilingScheme.projection instanceof Ti?"EPSG:3857":"EPSG:4326");t.setQueryParameters(o,!0),n.setQueryParameters(o,!0);let r={query_layers:e.layers,info_format:"{format}"};parseFloat(n.queryParameters.version)>=1.3?(r.i="{i}",r.j="{j}"):(r.x="{i}",r.y="{j}"),n.setQueryParameters(r,!0),this._resource=t,this._pickFeaturesResource=n,this._layers=e.layers,this._tileProvider=new Ss({url:t,pickFeaturesUrl:n,tilingScheme:e.tilingScheme??new to({ellipsoid:e.ellipsoid}),rectangle:e.rectangle,tileWidth:e.tileWidth,tileHeight:e.tileHeight,minimumLevel:e.minimumLevel,maximumLevel:e.maximumLevel,subdomains:e.subdomains,tileDiscardPolicy:e.tileDiscardPolicy,credit:e.credit,getFeatureInfoFormats:e.getFeatureInfoFormats??pf.DefaultGetFeatureInfoFormats,enablePickFeatures:e.enablePickFeatures})}function rxe(e,t,n,i,o,r){let s=l(r)?r.data:void 0,a=e._tileProvider;return l(s)&&a._resource.setQueryParameters(s),a.requestImage(t,n,i,o)}function trt(e,t,n,i,o,r,s){let a=l(s)?s.data:void 0,c=e._tileProvider;return l(a)&&c._pickFeaturesResource.setQueryParameters(a),c.pickFeatures(t,n,i,o,r)}Object.defineProperties(pf.prototype,{url:{get:function(){return this._resource._url}},proxy:{get:function(){return this._resource.proxy}},layers:{get:function(){return this._layers}},tileWidth:{get:function(){return this._tileProvider.tileWidth}},tileHeight:{get:function(){return this._tileProvider.tileHeight}},maximumLevel:{get:function(){return this._tileProvider.maximumLevel}},minimumLevel:{get:function(){return this._tileProvider.minimumLevel}},tilingScheme:{get:function(){return this._tileProvider.tilingScheme}},rectangle:{get:function(){return this._tileProvider.rectangle}},tileDiscardPolicy:{get:function(){return this._tileProvider.tileDiscardPolicy}},errorEvent:{get:function(){return this._tileProvider.errorEvent}},credit:{get:function(){return this._tileProvider.credit}},hasAlphaChannel:{get:function(){return this._tileProvider.hasAlphaChannel}},enablePickFeatures:{get:function(){return this._tileProvider.enablePickFeatures},set:function(e){this._tileProvider.enablePickFeatures=e}},clock:{get:function(){return this._timeDynamicImagery.clock},set:function(e){this._timeDynamicImagery.clock=e}},times:{get:function(){return this._timeDynamicImagery.times},set:function(e){this._timeDynamicImagery.times=e}},getFeatureInfoUrl:{get:function(){return this._getFeatureInfoUrl}}});pf.prototype.getTileCredits=function(e,t,n){return this._tileProvider.getTileCredits(e,t,n)};pf.prototype.requestImage=function(e,t,n,i){let o,r=this._timeDynamicImagery,s;return l(r)&&(s=r.currentInterval,o=r.getFromCache(e,t,n,i)),l(o)||(o=rxe(this,e,t,n,i,s)),l(o)&&l(r)&&r.checkApproachingInterval(e,t,n,i),o};pf.prototype.pickFeatures=function(e,t,n,i,o){let r=this._timeDynamicImagery,s=l(r)?r.currentInterval:void 0;return trt(this,e,t,n,i,o,s)};pf.DefaultParameters=Object.freeze({service:"WMS",version:"1.1.1",request:"GetMap",styles:"",format:"image/jpeg"});pf.GetFeatureInfoDefaultParameters=Object.freeze({service:"WMS",version:"1.1.1",request:"GetFeatureInfo"});pf.DefaultGetFeatureInfoFormats=Object.freeze([Object.freeze(new ff("json","application/json")),Object.freeze(new ff("xml","text/xml")),Object.freeze(new ff("text","text/html"))]);function oxe(e){let t={};for(let n in e)e.hasOwnProperty(n)&&(t[n.toLowerCase()]=e[n]);return t}var sX=pf;var Kei=x(T(),1);function Xu(e){e=e??B.EMPTY_OBJECT,this._defaultAlpha=void 0,this._defaultNightAlpha=void 0,this._defaultDayAlpha=void 0,this._defaultBrightness=void 0,this._defaultContrast=void 0,this._defaultHue=void 0,this._defaultSaturation=void 0,this._defaultGamma=void 0,this._defaultMinificationFilter=void 0,this._defaultMagnificationFilter=void 0,this._getFeatureInfoUrl=e.getFeatureInfoUrl??e.url;let t=ve.createIfNeeded(e.url),n=ve.createIfNeeded(this._getFeatureInfoUrl),i=e.style,o=e.tileMatrixSetID,r=t.url,s=e.format??"image/jpeg",a=r.match(/{/g);if(!l(a)||a.length===1&&/{s}/.test(r)?(t.setQueryParameters(Xu.DefaultParameters,!0),this._useKvp=!0):(t.setTemplateValues(Xu.DefaultParameters,!0),this._useKvp=!1),this._useKvp){n.setQueryParameters(Xu.GetFeatureInfoDefaultParameters,!0),l(e.getFeatureInfoParameters)&&n.setQueryParameters(sxe(e.getFeatureInfoParameters));let u={infoformat:"{format}",i:"{i}",j:"{j}"};n.setQueryParameters(u,!0)}else n.setTemplateValues(Xu.GetFeatureInfoDefaultParameters,!0),l(e.getFeatureInfoParameters)&&n.setTemplateValues(sxe(e.getFeatureInfoParameters));this._resource=t,this._tileMatrixLabels=e.tileMatrixLabels,this._format=s,this._dimensions=e.dimensions,this._tilematrixset=o;let c={};c.tilematrix="{TileMatrix}",c.layer=e.layer,c.style=i,c.tilerow="{TileRow}",c.tilecol="{TileCol}",c.tilematrixset=o,this._useKvp?(t.setQueryParameters(c,!0),t.setQueryParameters({format:s},!0),n.setQueryParameters({format:s},!0),n.setQueryParameters(c,!0)):(c.Style=i,t.setTemplateValues(c),t.setTemplateValues({format:s}),n.setTemplateValues(c));let d=this;this._reload=void 0,l(e.times)&&(this._timeDynamicImagery=new gS({clock:e.clock,times:e.times,requestImageFunction:function(u,m,p,b,f){return axe(d,u,m,p,b,f)},reloadFunction:function(){l(d._reload)&&d._reload()}})),this._errorEvent=new Se,this._tileProvider=new Ss({url:t,pickFeaturesUrl:n,tilingScheme:e.tilingScheme??new Xr({ellipsoid:e.ellipsoid}),rectangle:e.rectangle,tileWidth:e.tileWidth,tileHeight:e.tileHeight,minimumLevel:e.minimumLevel,maximumLevel:e.maximumLevel,subdomains:e.subdomains,tileDiscardPolicy:e.tileDiscardPolicy,credit:e.credit,getFeatureInfoFormats:e.getFeatureInfoFormats??Xu.DefaultGetFeatureInfoFormats,enablePickFeatures:e.enablePickFeatures??(this._useKvp||l(e.getFeatureInfoUrl)),customTags:irt(this)})}function axe(e,t,n,i,o,r){let s=e._tileProvider;return cxe(e,s._resource,r),s.requestImage(t,n,i,o)}function nrt(e,t,n,i,o,r,s){let a=e._tileProvider;return cxe(e,a._pickFeaturesResource,s),a.pickFeatures(t,n,i,o,r)}Object.defineProperties(Xu.prototype,{url:{get:function(){return this._resource.url}},proxy:{get:function(){return this._resource.proxy}},tileWidth:{get:function(){return this._tileProvider.tileWidth}},tileHeight:{get:function(){return this._tileProvider.tileHeight}},maximumLevel:{get:function(){return this._tileProvider.maximumLevel}},minimumLevel:{get:function(){return this._tileProvider.minimumLevel}},tilingScheme:{get:function(){return this._tileProvider.tilingScheme}},rectangle:{get:function(){return this._tileProvider.rectangle}},tileDiscardPolicy:{get:function(){return this._tileProvider.tileDiscardPolicy}},errorEvent:{get:function(){return this._tileProvider.errorEvent}},format:{get:function(){return this._format}},credit:{get:function(){return this._tileProvider.credit}},hasAlphaChannel:{get:function(){return!0}},enablePickFeatures:{get:function(){return this._tileProvider.enablePickFeatures},set:function(e){this._tileProvider.enablePickFeatures=e}},clock:{get:function(){return this._timeDynamicImagery.clock},set:function(e){this._timeDynamicImagery.clock=e}},times:{get:function(){return this._timeDynamicImagery.times},set:function(e){this._timeDynamicImagery.times=e}},dimensions:{get:function(){return this._dimensions},set:function(e){this._dimensions!==e&&(this._dimensions=e,l(this._reload)&&this._reload())}},getFeatureInfoUrl:{get:function(){return this._getFeatureInfoUrl}}});Xu.prototype.getTileCredits=function(e,t,n){return this._tileProvider.getTileCredits(e,t,n)};Xu.prototype.requestImage=function(e,t,n,i){let o,r=this._timeDynamicImagery,s;return l(r)&&(s=r.currentInterval,o=r.getFromCache(e,t,n,i)),l(o)||(o=axe(this,e,t,n,i,s)),l(o)&&l(r)&&r.checkApproachingInterval(e,t,n,i),o};Xu.prototype.pickFeatures=function(e,t,n,i,o){let r=this._timeDynamicImagery,s=l(r)?r.currentInterval:void 0;return nrt(this,e,t,n,i,o,s)};Xu.DefaultParameters=Object.freeze({service:"WMTS",version:"1.0.0",request:"GetTile"});Xu.GetFeatureInfoDefaultParameters=Object.freeze({service:"WMTS",version:"1.0.0",request:"GetFeatureInfo"});Xu.DefaultGetFeatureInfoFormats=Object.freeze([Object.freeze(new ff("json","application/json")),Object.freeze(new ff("xml","text/xml")),Object.freeze(new ff("text","text/html"))]);function cxe(e,t,n){let i=e._dimensions,o=l(n)?n.data:void 0;if(!e._useKvp)l(i)&&t.setTemplateValues(i),l(o)&&t.setTemplateValues(o);else{let r={};l(i)&&(r=It(r,i)),l(o)&&(r=It(r,o)),t.setQueryParameters(r)}}function irt(e){function t(n){let i=e._tileMatrixLabels;return l(i)?i[n]:n.toString()}return{TileMatrix:function(n,i,o,r){return t(r)},tilematrix:function(n,i,o,r){return t(r)},TileRow:function(n,i,o){return o.toString()},tilerow:function(n,i,o){return o.toString()},TileCol:function(n,i,o){return i.toString()},tilecol:function(n,i,o){return i.toString()},TileMatrixSet:function(n){return e._tilematrixset},tilematrixset:function(n){return e._tilematrixset}}}function sxe(e){let t={};for(let n in e)e.hasOwnProperty(n)&&(t[n.toLowerCase()]=e[n]);return t}var aX=Xu;var cti=x(T(),1);var qei=x(T(),1);var UC={};UC.defaultApiKey=void 0;UC.mapTilesApiEndpoint=new ve({url:"https://tile.googleapis.com/"});UC.defaultStreetViewStaticApiKey=void 0;UC.streetViewStaticApiEndpoint=new ve({url:"https://maps.googleapis.com/maps/api/streetview"});UC.getDefaultCredit=function(){return new Lt('<img alt="Google" src="https://assets.ion.cesium.com/google-credit.png" style="vertical-align:-6px">',!0)};var _a=UC;var lxe=/\/$/;function jb(e){e=e??B.EMPTY_OBJECT,this._maximumLevel=e.maximumLevel??22,this._minimumLevel=e.minimumLevel??0,this._session=e.session,this._key=e.key,this._tileWidth=e.tileWidth,this._tileHeight=e.tileHeight;let t=e.url instanceof Ur?e.url:ve.createIfNeeded(e.url??_a.mapTilesApiEndpoint),n=t.getUrlComponent();lxe.test(n)||(n+="/");let i=`${n}v1/2dtiles/{z}/{x}/{y}`;this._viewportUrl=`${n}tile/v1/viewport`,t.url=i,t.setQueryParameters({session:encodeURIComponent(e.session),key:encodeURIComponent(e.key)}),this._resource=t.clone();let o;l(e.credit)&&(o=e.credit,typeof o=="string"&&(o=new Lt(o)));let r=new Ss({url:t,credit:o,tileWidth:e.tileWidth,tileHeight:e.tileHeight,ellipsoid:e.ellipsoid,rectangle:e.rectangle,maximumLevel:this._maximumLevel,minimumLevel:this._minimumLevel});r._resource=t,this._imageryProvider=r,this._tileCredits=t.credits,this._attributionsByLevel=void 0}Object.defineProperties(jb.prototype,{url:{get:function(){return this._imageryProvider.url}},rectangle:{get:function(){return this._imageryProvider.rectangle}},tileWidth:{get:function(){return this._imageryProvider.tileWidth}},tileHeight:{get:function(){return this._imageryProvider.tileHeight}},maximumLevel:{get:function(){return this._imageryProvider.maximumLevel}},minimumLevel:{get:function(){return this._imageryProvider.minimumLevel}},tilingScheme:{get:function(){return this._imageryProvider.tilingScheme}},tileDiscardPolicy:{get:function(){return this._imageryProvider.tileDiscardPolicy}},errorEvent:{get:function(){return this._imageryProvider.errorEvent}},credit:{get:function(){return this._imageryProvider.credit}},proxy:{get:function(){return this._imageryProvider.proxy}},hasAlphaChannel:{get:function(){return this._imageryProvider.hasAlphaChannel}}});jb.fromIonAssetId=async function(e){e=e??{},e.mapType=e.mapType??"satellite",e.language=e.language??"en_US",e.region=e.region??"US";let t=e.overlayLayerType,n=dxe(e),i=Ur._createEndpointResource(e.assetId,{queryParameters:{options:JSON.stringify(n)}}),o={language:e.language,region:e.region,ellipsoid:e.ellipsoid,minimumLevel:e.minimumLevel,maximumLevel:e.maximumLevel,rectangle:e.rectangle,credit:e.credit},r=await i.fetchJson(),s=r.options.url;return delete r.options.url,r.options={...r.options,...o},O7(s,r,i)};jb.fromUrl=async function(e){e=e??{},e.mapType=e.mapType??"satellite",e.language=e.language??"en_US",e.region=e.region??"US",e.url=e.url??_a.mapTilesApiEndpoint,e.key=e.key??_a.defaultApiKey;let t=e.overlayLayerType,n=await rrt(e);return new jb({...n,...e,credit:e.credit??_a.getDefaultCredit()})};jb.prototype.getTileCredits=function(e,t,n){if(!l(this._attributionsByLevel)||!l(this._tileCredits))return;let o=this._attributionsByLevel.get(n);return l(this._tileCredits)?this._tileCredits.concat(o):o};jb.prototype.requestImage=function(e,t,n,i){let o=this._imageryProvider.requestImage(e,t,n,i);if(l(o))return l(this._attributionsByLevel)?o:Promise.all([o,this.getViewportCredits()]).then(r=>r[0])};jb.prototype.pickFeatures=function(e,t,n,i,o){};jb.prototype.getViewportCredits=async function(){let e=this._maximumLevel,t=[];for(let o=0;o<e+1;o++)t.push(ort(this._resource,this._viewportUrl,o));let n=await Promise.all(t),i=new Map;for(let o=0;o<e+1;o++){let r=[],s=n[o];if(s){let a=new Lt(s);r.push(a)}i.set(o,r)}return this._attributionsByLevel=i,i};async function ort(e,t,n){return(await e.getDerivedResource({url:t,queryParameters:{zoom:n,north:90,south:-90,east:180,west:-180},data:JSON.stringify(B.EMPTY_OBJECT)}).fetchJson()).copyright}function dxe(e){let{mapType:t,overlayLayerType:n,styles:i}=e,o={mapType:t,overlay:!1};return t==="terrain"&&!l(n)&&(o.layerTypes=["layerRoadmap"]),l(n)&&(o.mapType="satellite",o.overlay=!0,o.layerTypes=[n]),l(i)&&(o.styles=i),o}async function rrt(e){let{language:t,region:n,key:i,url:o}=e,r=dxe(e),s=o.url??o;lxe.test(s)||(s+="/");let a=await ve.post({url:`${s}v1/createSession`,queryParameters:{key:i},data:JSON.stringify({...r,language:t,region:n})});return JSON.parse(a)}var cX=jb;var bti=x(T(),1);var srt=/\/$/;function DC(e){e=e??{};let t=e.tilesetId??"microsoft.imagery";this._maximumLevel=e.maximumLevel??22,this._minimumLevel=e.minimumLevel??0,this._subscriptionKey=e.subscriptionKey??e["subscription-key"],this._tilesetId=e.tilesetId;let n=e.url instanceof Ur?e.url:ve.createIfNeeded(e.url??"https://atlas.microsoft.com/"),i=n.getUrlComponent();srt.test(i)||(i+="/");let o=`${i}map/tile`;this._viewportUrl=`${i}map/attribution`,n.url=o,n.setQueryParameters({"api-version":"2024-04-01",tilesetId:t,"subscription-key":this._subscriptionKey,zoom:"{z}",x:"{x}",y:"{y}"}),this._resource=n;let r;l(e.credit)&&(r=e.credit,typeof r=="string"&&(r=new Lt(r)));let s=new Ss({...e,maximumLevel:this._maximumLevel,minimumLevel:this._minimumLevel,url:n,credit:r});s._resource=n,this._imageryProvider=s,this._tileCredits=n.credits,this._attributionsByLevel=void 0}Object.defineProperties(DC.prototype,{url:{get:function(){return this._imageryProvider.url}},rectangle:{get:function(){return this._imageryProvider.rectangle}},tileWidth:{get:function(){return this._imageryProvider.tileWidth}},tileHeight:{get:function(){return this._imageryProvider.tileHeight}},maximumLevel:{get:function(){return this._imageryProvider.maximumLevel}},minimumLevel:{get:function(){return this._imageryProvider.minimumLevel}},tilingScheme:{get:function(){return this._imageryProvider.tilingScheme}},tileDiscardPolicy:{get:function(){return this._imageryProvider.tileDiscardPolicy}},errorEvent:{get:function(){return this._imageryProvider.errorEvent}},credit:{get:function(){return this._imageryProvider.credit}},proxy:{get:function(){return this._imageryProvider.proxy}},hasAlphaChannel:{get:function(){return this._imageryProvider.hasAlphaChannel}}});DC.prototype.getTileCredits=function(e,t,n){if(!l(this._attributionsByLevel)||!l(this._tileCredits))return;let o=this._attributionsByLevel.get(n);return l(this._tileCredits)?this._tileCredits.concat(o):o};DC.prototype.requestImage=function(e,t,n,i){let o=this._imageryProvider.requestImage(e,t,n,i);if(l(o))return l(this._attributionsByLevel)?o:Promise.all([o,this.getViewportCredits()]).then(r=>r[0])};DC.prototype.pickFeatures=function(e,t,n,i,o){};DC.prototype.getViewportCredits=async function(){let e=this._maximumLevel,t=[];for(let o=0;o<e+1;o++)t.push(art(this._resource,this._viewportUrl,this._subscriptionKey,this._tilesetId,o));let n=await Promise.all(t),i=new Map;for(let o=0;o<e+1;o++){let r=[],s=n[o].join(",");if(s){let a=new Lt(s);r.push(a)}i.set(o,r)}return this._attributionsByLevel=i,i};async function art(e,t,n,i,o){return(await e.getDerivedResource({url:t,queryParameters:{zoom:o,bounds:"-180,-90,180,90"},data:JSON.stringify(B.EMPTY_OBJECT)}).fetchJson()).copyrights}var lX=DC;var crt=async(e,t,n)=>Zx.fromUrl(new Ur(t,n)),lrt=async(e,{options:t})=>Jb.fromUrl(e,t),drt=async(e,{options:t})=>$P.fromUrl(e,t),urt=async(e,{options:t})=>{let n=t.channel;return delete t.channel,nX.fromUrl(e,n,t)},mrt=async(e,{options:t})=>new iX({url:e,...t}),hrt=async(e,{options:t})=>oX.fromUrl(e,t),frt=async(e,{options:t})=>Zx.fromUrl(e,t),prt=async(e,{options:t})=>new Ss({url:e,...t}),brt=async(e,{options:t})=>new sX({url:e,...t}),grt=async(e,{options:t})=>new aX({url:e,...t}),O7=async(e,t,n)=>{delete t.externalType,t.url=e;let i=new Ur(t,n),o=(r,s)=>{delete s.externalType,s.url=e;let{options:a}=s;r.setQueryParameters({session:a.session,key:a.key})};return i.refreshCallback=o,new cX({...t.options,url:i})},yrt=async(e,t,n)=>{delete t.externalType,t.url=e;let i=new Ur(t,n),o=(r,s)=>{delete s.externalType,s.url=e;let{options:a}=s;r.setQueryParameters({"subscription-key":a["subscription-key"]})};return i.refreshCallback=o,new lX({...t.options,url:i})},xrt={ARCGIS_MAPSERVER:lrt,BING:drt,GOOGLE_EARTH:urt,MAPBOX:mrt,SINGLE_TILE:hrt,TMS:frt,URL_TEMPLATE:prt,WMS:brt,WMTS:grt,GOOGLE_2D_MAPS:O7,AZURE_MAPS:yrt,defaultFactoryCallback:crt},OC=Object.freeze(xrt);function Bp(){this._defaultAlpha=void 0,this._defaultNightAlpha=void 0,this._defaultDayAlpha=void 0,this._defaultBrightness=void 0,this._defaultContrast=void 0,this._defaultHue=void 0,this._defaultSaturation=void 0,this._defaultGamma=void 0,this._defaultMinificationFilter=void 0,this._defaultMagnificationFilter=void 0,this._tileCredits=void 0,this._errorEvent=new Se}Object.defineProperties(Bp.prototype,{rectangle:{get:function(){return this._imageryProvider.rectangle}},tileWidth:{get:function(){return this._imageryProvider.tileWidth}},tileHeight:{get:function(){return this._imageryProvider.tileHeight}},maximumLevel:{get:function(){return this._imageryProvider.maximumLevel}},minimumLevel:{get:function(){return this._imageryProvider.minimumLevel}},tilingScheme:{get:function(){return this._imageryProvider.tilingScheme}},tileDiscardPolicy:{get:function(){return this._imageryProvider.tileDiscardPolicy}},errorEvent:{get:function(){return this._errorEvent}},credit:{get:function(){return this._imageryProvider.credit}},hasAlphaChannel:{get:function(){return this._imageryProvider.hasAlphaChannel}},proxy:{get:function(){}}});Bp.fromAssetId=async function(e,t){t=t??B.EMPTY_OBJECT;let n=Ur._createEndpointResource(e,t),i=e.toString()+t.accessToken+t.server,o=Bp._endpointCache[i];l(o)||(o=n.fetchJson(),Bp._endpointCache[i]=o);let r=await o;if(r.type!=="IMAGERY")throw new ae(`Cesium ion asset ${e} is not an imagery asset.`);let s=r.externalType,a=OC.defaultFactoryCallback;r=$e(r,!0),r.options=r.options??{};let c=r.options?.url;if(delete t.url,l(s)&&(a=OC[s],!l(a)))throw new ae(`Unrecognized Cesium ion imagery type: ${s}`);let d=await a(c,r,n),u=new Bp(t);return d.errorEvent.addEventListener(function(m){m.provider=u,u._errorEvent.raiseEvent(m)}),u._tileCredits=Ur.getCreditsFromEndpoint(r,n),u._imageryProvider=d,u};Bp.prototype.getTileCredits=function(e,t,n){let i=this._imageryProvider.getTileCredits(e,t,n);return l(i)?this._tileCredits.concat(i):this._tileCredits};Bp.prototype.requestImage=function(e,t,n,i){return this._imageryProvider.requestImage(e,t,n,i)};Bp.prototype.pickFeatures=function(e,t,n,i,o){return this._imageryProvider.pickFeatures(e,t,n,i,o)};Bp._endpointCache={};var nd=Bp;var kti=x(T(),1),uxe={AERIAL:2,AERIAL_WITH_LABELS:3,ROAD:4};Object.freeze(uxe);var Qb=uxe;function Trt(e){e=e??B.EMPTY_OBJECT;let t=e.style??Qb.AERIAL;return nd.fromAssetId(t)}var qb=Trt;var qti=x(T(),1);function Ds(){ge.throwInstantiationError()}Object.defineProperties(Ds.prototype,{errorEvent:{get:ge.throwInstantiationError},credit:{get:ge.throwInstantiationError},tilingScheme:{get:ge.throwInstantiationError},hasWaterMask:{get:ge.throwInstantiationError},hasVertexNormals:{get:ge.throwInstantiationError},availability:{get:ge.throwInstantiationError}});var mxe=[];Ds.getRegularGridIndices=function(e,t){let n=mxe[e];l(n)||(mxe[e]=n=[]);let i=n[t];return l(i)||(e*t<W.SIXTY_FOUR_KILOBYTES?i=n[t]=new Uint16Array((e-1)*(t-1)*6):i=n[t]=new Uint32Array((e-1)*(t-1)*6),bxe(e,t,i,0)),i};var hxe=[];Ds.getRegularGridIndicesAndEdgeIndices=function(e,t){let n=hxe[e];l(n)||(hxe[e]=n=[]);let i=n[t];if(!l(i)){let o=Ds.getRegularGridIndices(e,t),r=pxe(e,t),s=r.westIndicesSouthToNorth,a=r.southIndicesEastToWest,c=r.eastIndicesNorthToSouth,d=r.northIndicesWestToEast;i=n[t]={indices:o,westIndicesSouthToNorth:s,southIndicesEastToWest:a,eastIndicesNorthToSouth:c,northIndicesWestToEast:d}}return i};var fxe=[];Ds.getRegularGridAndSkirtIndicesAndEdgeIndices=function(e,t){let n=fxe[e];l(n)||(fxe[e]=n=[]);let i=n[t];if(!l(i)){let o=e*t,r=(e-1)*(t-1)*6,s=e*2+t*2,a=Math.max(0,s-4)*6,c=o+s,d=r+a,u=pxe(e,t),m=u.westIndicesSouthToNorth,p=u.southIndicesEastToWest,b=u.eastIndicesNorthToSouth,f=u.northIndicesWestToEast,y=Oe.createTypedArray(c,d);bxe(e,t,y,0),Ds.addSkirtIndices(m,p,b,f,o,y,r),i=n[t]={indices:y,westIndicesSouthToNorth:m,southIndicesEastToWest:p,eastIndicesNorthToSouth:b,northIndicesWestToEast:f,indexCountWithoutSkirts:r}}return i};Ds.getSkirtVertexCount=function(e,t,n,i){return e.length+t.length+n.length+i.length};Ds.getSkirtIndexCount=function(e){return(e-4)*2*3};Ds.getSkirtIndexCountWithFilledCorners=function(e){return((e-4)*2+4)*3};Ds.addSkirtIndices=function(e,t,n,i,o,r,s){let a=o;s=bB(e,a,r,s),a+=e.length,s=bB(t,a,r,s),a+=t.length,s=bB(n,a,r,s),a+=n.length,bB(i,a,r,s)};Ds.addSkirtIndicesWithFilledCorners=function(e,t,n,i,o,r,s){Ds.addSkirtIndices(e,t,n,i,o,r,s);let a=Ds.getSkirtVertexCount(e,t,n,i),c=Ds.getSkirtIndexCount(a),d=s+c,u=e[0],m=i[0],p=n[0],b=t[0],f=o,y=f+e.length-1,_=y+1,S=_+t.length-1,Z=S+1,R=Z+n.length-1,C=R+1,E=C+i.length-1;r[d+0]=u,r[d+1]=f,r[d+2]=S,r[d+3]=b,r[d+4]=_,r[d+5]=R,r[d+6]=p,r[d+7]=Z,r[d+8]=E,r[d+9]=m,r[d+10]=C,r[d+11]=y};function pxe(e,t){let n=new Array(t),i=new Array(e),o=new Array(t),r=new Array(e),s;for(s=0;s<e;++s)r[s]=s,i[s]=e*t-1-s;for(s=0;s<t;++s)o[s]=(s+1)*e-1,n[s]=(t-s-1)*e;return{westIndicesSouthToNorth:n,southIndicesEastToWest:i,eastIndicesNorthToSouth:o,northIndicesWestToEast:r}}function bxe(e,t,n,i){let o=0;for(let r=0;r<t-1;++r){for(let s=0;s<e-1;++s){let a=o,c=a+e,d=c+1,u=a+1;n[i++]=a,n[i++]=c,n[i++]=u,n[i++]=u,n[i++]=c,n[i++]=d,++o}++o}}function bB(e,t,n,i){let o=e[0],r=e.length;for(let s=1;s<r;++s){let a=e[s];n[i++]=o,n[i++]=a,n[i++]=t,n[i++]=t,n[i++]=a,n[i++]=t+1,o=a,++t}return i}Ds.heightmapTerrainQuality=.25;Ds.getEstimatedLevelZeroGeometricErrorForAHeightmap=function(e,t,n){return e.maximumRadius*2*Math.PI*Ds.heightmapTerrainQuality/(t*n)};Ds.prototype.requestTileGeometry=ge.throwInstantiationError;Ds.prototype.getLevelMaximumGeometricError=ge.throwInstantiationError;Ds.prototype.getTileDataAvailable=ge.throwInstantiationError;Ds.prototype.loadTileDataAvailability=ge.throwInstantiationError;var Qo=Ds;var rni=x(T(),1);var eni=x(T(),1),gxe={UNLOADED:0,TRANSITIONING:1,RECEIVED:2,TEXTURE_LOADED:3,READY:4,FAILED:5,INVALID:6,PLACEHOLDER:7};Object.freeze(gxe);var Dn=gxe;function BC(e,t,n,i,o){if(this.imageryLayer=e,this.x=t,this.y=n,this.level=i,this.request=void 0,i!==0){let r=t/2|0,s=n/2|0,a=i-1;this.parent=e.getImageryFromCache(r,s,a)}this.state=Dn.UNLOADED,this.imageUrl=void 0,this.image=void 0,this.texture=void 0,this.textureWebMercator=void 0,this.credits=void 0,this.referenceCount=0,!l(o)&&e.ready&&(o=e.imageryProvider.tilingScheme.tileXYToRectangle(t,n,i)),this.rectangle=o}BC.createPlaceholder=function(e){let t=new BC(e,0,0,0);return t.addReference(),t.state=Dn.PLACEHOLDER,t};BC.prototype.addReference=function(){++this.referenceCount};BC.prototype.releaseReference=function(){return--this.referenceCount,this.referenceCount===0?(this.imageryLayer.removeImageryFromCache(this),l(this.parent)&&this.parent.releaseReference(),l(this.image)&&l(this.image.destroy)&&this.image.destroy(),l(this.texture)&&this.texture.destroy(),l(this.textureWebMercator)&&this.texture!==this.textureWebMercator&&this.textureWebMercator.destroy(),ue(this),0):this.referenceCount};BC.prototype.processStateMachine=function(e,t,n){this.state===Dn.UNLOADED&&!n&&(this.state=Dn.TRANSITIONING,this.imageryLayer._requestImagery(this)),this.state===Dn.RECEIVED&&(this.state=Dn.TRANSITIONING,this.imageryLayer._createTexture(e.context,this));let i=this.state===Dn.READY&&t&&!this.texture;(this.state===Dn.TEXTURE_LOADED||i)&&(this.state=Dn.TRANSITIONING,this.imageryLayer._reprojectTexture(e,this,t))};var zC=BC;var lni=x(T(),1);function B7(e,t,n){this.readyImagery=void 0,this.loadingImagery=e,this.textureCoordinateRectangle=t,this.textureTranslationAndScale=void 0,this.useWebMercatorT=n}B7.prototype.freeResources=function(){l(this.readyImagery)&&this.readyImagery.releaseReference(),l(this.loadingImagery)&&this.loadingImagery.releaseReference()};B7.prototype.processStateMachine=function(e,t,n){let i=this.loadingImagery,o=i.imageryLayer;if(i.processStateMachine(t,!this.useWebMercatorT,n),i.state===Dn.READY)return l(this.readyImagery)&&this.readyImagery.releaseReference(),this.readyImagery=this.loadingImagery,this.loadingImagery=void 0,this.textureTranslationAndScale=o._calculateTextureTranslationAndScale(e,this),!0;let r=i.parent,s;for(;l(r)&&(r.state!==Dn.READY||!this.useWebMercatorT&&!l(r.texture));)r.state!==Dn.FAILED&&r.state!==Dn.INVALID&&(s=s||r),r=r.parent;return this.readyImagery!==r&&(l(this.readyImagery)&&this.readyImagery.releaseReference(),this.readyImagery=r,l(r)&&(r.addReference(),this.textureTranslationAndScale=o._calculateTextureTranslationAndScale(e,this))),i.state===Dn.FAILED||i.state===Dn.INVALID?l(s)?(s.processStateMachine(t,!this.useWebMercatorT,n),!1):!0:!1};var HC=B7;function zi(e,t){this._imageryProvider=e,this._readyEvent=new Se,this._errorEvent=new Se,t=t??B.EMPTY_OBJECT,e=e??B.EMPTY_OBJECT,this.alpha=t.alpha??e._defaultAlpha??1,this.nightAlpha=t.nightAlpha??e._defaultNightAlpha??1,this.dayAlpha=t.dayAlpha??e._defaultDayAlpha??1,this.brightness=t.brightness??e._defaultBrightness??zi.DEFAULT_BRIGHTNESS,this.contrast=t.contrast??e._defaultContrast??zi.DEFAULT_CONTRAST,this.hue=t.hue??e._defaultHue??zi.DEFAULT_HUE,this.saturation=t.saturation??e._defaultSaturation??zi.DEFAULT_SATURATION,this.gamma=t.gamma??e._defaultGamma??zi.DEFAULT_GAMMA,this.splitDirection=t.splitDirection??zi.DEFAULT_SPLIT,this.minificationFilter=t.minificationFilter??e._defaultMinificationFilter??zi.DEFAULT_MINIFICATION_FILTER,this.magnificationFilter=t.magnificationFilter??e._defaultMagnificationFilter??zi.DEFAULT_MAGNIFICATION_FILTER,this.show=t.show??!0,this._minimumTerrainLevel=t.minimumTerrainLevel,this._maximumTerrainLevel=t.maximumTerrainLevel,this._rectangle=t.rectangle??re.MAX_VALUE,this._maximumAnisotropy=t.maximumAnisotropy,this._imageryCache={},this._skeletonPlaceholder=new HC(zC.createPlaceholder(this)),this._show=!0,this._layerIndex=-1,this._isBaseLayer=!1,this._requestImageError=void 0,this._reprojectComputeCommands=[],this.cutoutRectangle=t.cutoutRectangle,this.colorToAlpha=t.colorToAlpha,this.colorToAlphaThreshold=t.colorToAlphaThreshold??zi.DEFAULT_APPLY_COLOR_TO_ALPHA_THRESHOLD}Object.defineProperties(zi.prototype,{imageryProvider:{get:function(){return this._imageryProvider}},ready:{get:function(){return l(this._imageryProvider)}},errorEvent:{get:function(){return this._errorEvent}},readyEvent:{get:function(){return this._readyEvent}},rectangle:{get:function(){return this._rectangle}}});zi.DEFAULT_BRIGHTNESS=1;zi.DEFAULT_CONTRAST=1;zi.DEFAULT_HUE=0;zi.DEFAULT_SATURATION=1;zi.DEFAULT_GAMMA=1;zi.DEFAULT_SPLIT=kr.NONE;zi.DEFAULT_MINIFICATION_FILTER=Ht.LINEAR;zi.DEFAULT_MAGNIFICATION_FILTER=$n.LINEAR;zi.DEFAULT_APPLY_COLOR_TO_ALPHA_THRESHOLD=.004;zi.fromProviderAsync=function(e,t){let n=new zi(void 0,t);return Crt(n,Promise.resolve(e)),n};zi.fromWorldImagery=function(e){return e=e??B.EMPTY_OBJECT,zi.fromProviderAsync(qb({style:e.style}),e)};zi.prototype.isBaseLayer=function(){return this._isBaseLayer};zi.prototype.isDestroyed=function(){return!1};zi.prototype.destroy=function(){return ue(this)};var Txe=new re,yxe=new re,z7=new re,_xe=new re;zi.prototype.getImageryRectangle=function(){let e=this._imageryProvider,t=this._rectangle;return re.intersection(e.rectangle,t)};zi.prototype._createTileImagerySkeletons=function(e,t,n){let i=e.data;if(!l(t)||l(this._minimumTerrainLevel)&&e.level<this._minimumTerrainLevel||l(this._maximumTerrainLevel)&&e.level>this._maximumTerrainLevel)return!1;l(n)||(n=i.imagery.length);let o=this._imageryProvider;if(!this.ready)return this._skeletonPlaceholder.loadingImagery.addReference(),i.imagery.splice(n,0,this._skeletonPlaceholder),!0;let r=o.tilingScheme.projection instanceof Ti&&e.rectangle.north<Ti.MaximumLatitude&&e.rectangle.south>-Ti.MaximumLatitude,s=re.intersection(o.rectangle,this._rectangle,Txe),a=re.intersection(e.rectangle,s,yxe);if(!l(a)){if(!this.isBaseLayer())return!1;let G=s,v=e.rectangle;a=yxe,v.south>=G.north?a.north=a.south=G.north:v.north<=G.south?a.north=a.south=G.south:(a.south=Math.max(v.south,G.south),a.north=Math.min(v.north,G.north)),v.west>=G.east?a.west=a.east=G.east:v.east<=G.west?a.west=a.east=G.west:(a.west=Math.max(v.west,G.west),a.east=Math.min(v.east,G.east))}let c=0;a.south>0?c=a.south:a.north<0&&(c=a.north);let u=1*t.getLevelMaximumGeometricError(e.level),m=Zrt(this,u,c);m=Math.max(0,m);let p=o.maximumLevel;if(m>p&&(m=p),l(o.minimumLevel)){let G=o.minimumLevel;m<G&&(m=G)}let b=o.tilingScheme,f=b.positionToTileXY(re.northwest(a),m),y=b.positionToTileXY(re.southeast(a),m),_=e.rectangle.width/512,S=e.rectangle.height/512,Z=b.tileXYToRectangle(f.x,f.y,m);Math.abs(Z.south-e.rectangle.north)<S&&f.y<y.y&&++f.y,Math.abs(Z.east-e.rectangle.west)<_&&f.x<y.x&&++f.x;let R=b.tileXYToRectangle(y.x,y.y,m);Math.abs(R.north-e.rectangle.south)<S&&y.y>f.y&&--y.y,Math.abs(R.west-e.rectangle.east)<_&&y.x>f.x&&--y.x;let C=re.clone(e.rectangle,_xe),E=b.tileXYToRectangle(f.x,f.y,m),A=re.intersection(E,s,z7),L;r?(b.rectangleToNativeRectangle(C,C),b.rectangleToNativeRectangle(E,E),b.rectangleToNativeRectangle(A,A),b.rectangleToNativeRectangle(s,s),L=b.tileXYToNativeRectangle.bind(b),_=C.width/512,S=C.height/512):L=b.tileXYToRectangle.bind(b);let F,I=0,N=1,g;!this.isBaseLayer()&&Math.abs(A.west-C.west)>=_&&(I=Math.min(1,(A.west-C.west)/C.width)),!this.isBaseLayer()&&Math.abs(A.north-C.north)>=S&&(N=Math.max(0,(A.north-C.south)/C.height));let V=N;for(let G=f.x;G<=y.x;G++)if(F=I,E=L(G,f.y,m),A=re.simpleIntersection(E,s,z7),!!l(A)){I=Math.min(1,(A.east-C.west)/C.width),G===y.x&&(this.isBaseLayer()||Math.abs(A.east-C.east)<_)&&(I=1),N=V;for(let v=f.y;v<=y.y;v++){if(g=N,E=L(G,v,m),A=re.simpleIntersection(E,s,z7),!l(A))continue;N=Math.max(0,(A.south-C.south)/C.height),v===y.y&&(this.isBaseLayer()||Math.abs(A.south-C.south)<S)&&(N=0);let X=new ce(F,N,I,g),Y=this.getImageryFromCache(G,v,m);i.imagery.splice(n,0,new HC(Y,X,r)),++n}}return!0};zi.prototype._calculateTextureTranslationAndScale=function(e,t){let n=t.readyImagery.rectangle,i=e.rectangle;if(t.useWebMercatorT){let c=t.readyImagery.imageryLayer.imageryProvider.tilingScheme;n=c.rectangleToNativeRectangle(n,Txe),i=c.rectangleToNativeRectangle(i,_xe)}let o=i.width,r=i.height,s=o/n.width,a=r/n.height;return new ce(s*(i.west-n.west)/o,a*(i.south-n.south)/r,s,a)};zi.prototype._requestImagery=function(e){let t=this._imageryProvider,n=this;function i(s){if(!l(s))return o();e.image=s,e.state=Dn.RECEIVED,e.request=void 0,tr.reportSuccess(n._requestImageError)}function o(s){if(e.request.state===Ri.CANCELLED){e.state=Dn.UNLOADED,e.request=void 0;return}e.state=Dn.FAILED,e.request=void 0;let a=`Failed to obtain image tile X: ${e.x} Y: ${e.y} Level: ${e.level}.`;n._requestImageError=tr.reportError(n._requestImageError,t,t.errorEvent,a,e.x,e.y,e.level,s),n._requestImageError.retry&&r()}function r(){let s=new Ar({throttle:!1,throttleByServer:!0,type:js.IMAGERY});e.request=s,e.state=Dn.TRANSITIONING;let a=t.requestImage(e.x,e.y,e.level,s);if(!l(a)){e.state=Dn.UNLOADED,e.request=void 0;return}l(t.getTileCredits)&&(e.credits=t.getTileCredits(e.x,e.y,e.level)),a.then(function(c){i(c)}).catch(function(c){o(c)})}r()};zi.prototype._createTextureWebGL=function(e,t){let n=new Ot({minificationFilter:this.minificationFilter,magnificationFilter:this.magnificationFilter}),i=t.image;return l(i.internalFormat)?new vt({context:e,pixelFormat:i.internalFormat,width:i.width,height:i.height,source:{arrayBufferView:i.bufferView},sampler:n}):new vt({context:e,source:i,pixelFormat:this._imageryProvider.hasAlphaChannel?Qe.RGBA:Qe.RGB,sampler:n})};zi.prototype._createTexture=function(e,t){let n=this._imageryProvider,i=t.image;if(l(n.tileDiscardPolicy)){let r=n.tileDiscardPolicy;if(l(r)){if(!r.isReady()){t.state=Dn.RECEIVED;return}if(r.shouldDiscardImage(i)){t.state=Dn.INVALID;return}}}let o=this._createTextureWebGL(e,t);n.tilingScheme.projection instanceof Ti?t.textureWebMercator=o:t.texture=o,t.image=void 0,t.state=Dn.TEXTURE_LOADED};function xxe(e,t,n){return`${e}:${t}:${n}`}zi.prototype._finalizeReprojectTexture=function(e,t){let n=this.minificationFilter,i=this.magnificationFilter;if(n===Ht.LINEAR&&i===$n.LINEAR&&!Qe.isCompressedFormat(t.pixelFormat)&&W.isPowerOfTwo(t.width)&&W.isPowerOfTwo(t.height)){n=Ht.LINEAR_MIPMAP_LINEAR;let r=wt.maximumTextureFilterAnisotropy,s=Math.min(r,this._maximumAnisotropy??r),a=xxe(n,i,s),c=e.cache.imageryLayerMipmapSamplers;l(c)||(c={},e.cache.imageryLayerMipmapSamplers=c);let d=c[a];l(d)||(d=c[a]=new Ot({wrapS:pn.CLAMP_TO_EDGE,wrapT:pn.CLAMP_TO_EDGE,minificationFilter:n,magnificationFilter:i,maximumAnisotropy:s})),t.generateMipmap(Cm.NICEST),t.sampler=d}else{let r=xxe(n,i,0),s=e.cache.imageryLayerNonMipmapSamplers;l(s)||(s={},e.cache.imageryLayerNonMipmapSamplers=s);let a=s[r];l(a)||(a=s[r]=new Ot({wrapS:pn.CLAMP_TO_EDGE,wrapT:pn.CLAMP_TO_EDGE,minificationFilter:n,magnificationFilter:i})),t.sampler=a}};zi.prototype._reprojectTexture=function(e,t,n){let i=t.textureWebMercator||t.texture,o=t.rectangle,r=e.context;if(n=n??!0,n&&!(this._imageryProvider.tilingScheme.projection instanceof ki)&&o.width/i.width>1e-5){let s=this;t.addReference();let a=new bu({persists:!0,owner:this,preExecute:function(c){Srt(c,r,i,t.rectangle)},postExecute:function(c){t.texture=c,s._finalizeReprojectTexture(r,c),t.state=Dn.READY,t.releaseReference()},canceled:function(){t.state=Dn.TEXTURE_LOADED,t.releaseReference()}});this._reprojectComputeCommands.push(a)}else n&&(t.texture=i),this._finalizeReprojectTexture(r,i),t.state=Dn.READY};zi.prototype.queueReprojectionCommands=function(e){let t=this._reprojectComputeCommands,n=t.length;for(let i=0;i<n;++i)e.commandList.push(t[i]);t.length=0};zi.prototype.cancelReprojections=function(){this._reprojectComputeCommands.forEach(function(e){l(e.canceled)&&e.canceled()}),this._reprojectComputeCommands.length=0};zi.prototype.getImageryFromCache=function(e,t,n,i){let o=Sxe(e,t,n),r=this._imageryCache[o];return l(r)||(r=new zC(this,e,t,n,i),this._imageryCache[o]=r),r.addReference(),r};zi.prototype.removeImageryFromCache=function(e){let t=Sxe(e.x,e.y,e.level);delete this._imageryCache[t]};function Sxe(e,t,n){return JSON.stringify([e,t,n])}var gB={u_textureDimensions:function(){return this.textureDimensions},u_texture:function(){return this.texture},textureDimensions:new k,texture:void 0},_rt=fn.supportsTypedArrays()?new Float32Array(128):void 0;function Srt(e,t,n,i){let o=t.cache.imageryLayer_reproject;if(!l(o)){o=t.cache.imageryLayer_reproject={vertexArray:void 0,shaderProgram:void 0,sampler:void 0,destroy:function(){l(this.framebuffer)&&this.framebuffer.destroy(),l(this.vertexArray)&&this.vertexArray.destroy(),l(this.shaderProgram)&&this.shaderProgram.destroy()}};let _=new Float32Array(256),S=0;for(let A=0;A<64;++A){let L=A/63;_[S++]=0,_[S++]=L,_[S++]=1,_[S++]=L}let Z={position:0,webMercatorT:1},R=Qo.getRegularGridIndices(2,64),C=it.createIndexBuffer({context:t,typedArray:R,usage:Pe.STATIC_DRAW,indexDatatype:Oe.UNSIGNED_SHORT});o.vertexArray=new Un({context:t,attributes:[{index:Z.position,vertexBuffer:it.createVertexBuffer({context:t,typedArray:_,usage:Pe.STATIC_DRAW}),componentsPerAttribute:2},{index:Z.webMercatorT,vertexBuffer:it.createVertexBuffer({context:t,sizeInBytes:512,usage:Pe.STREAM_DRAW}),componentsPerAttribute:1}],indexBuffer:C});let E=new Je({sources:[o2]});o.shaderProgram=tn.fromCache({context:t,vertexShaderSource:E,fragmentShaderSource:i2,attributeLocations:Z}),o.sampler=new Ot({wrapS:pn.CLAMP_TO_EDGE,wrapT:pn.CLAMP_TO_EDGE,minificationFilter:Ht.LINEAR,magnificationFilter:$n.LINEAR})}n.sampler=o.sampler;let r=n.width,s=n.height;gB.textureDimensions.x=r,gB.textureDimensions.y=s,gB.texture=n;let a=Math.sin(i.south),c=.5*Math.log((1+a)/(1-a));a=Math.sin(i.north);let u=1/(.5*Math.log((1+a)/(1-a))-c),m=new vt({context:t,width:r,height:s,pixelFormat:n.pixelFormat,pixelDatatype:n.pixelDatatype,preMultiplyAlpha:n.preMultiplyAlpha});W.isPowerOfTwo(r)&&W.isPowerOfTwo(s)&&m.generateMipmap(Cm.NICEST);let p=i.south,b=i.north,f=_rt,y=0;for(let _=0;_<64;++_){let S=_/63,Z=W.lerp(p,b,S);a=Math.sin(Z);let C=(.5*Math.log((1+a)/(1-a))-c)*u;f[y++]=C,f[y++]=C}o.vertexArray.getAttribute(1).vertexBuffer.copyFromArrayView(f),e.shaderProgram=o.shaderProgram,e.outputTexture=m,e.uniformMap=gB,e.vertexArray=o.vertexArray}function Zrt(e,t,n){let i=e._imageryProvider,o=i.tilingScheme,r=o.ellipsoid,s=e._imageryProvider.tilingScheme.projection instanceof ki?1:Math.cos(n),a=o.rectangle,d=r.maximumRadius*a.width*s/(i.tileWidth*o.getNumberOfXTilesAtLevel(0))/t,u=Math.log(d)/Math.log(2);return Math.round(u)|0}function Rrt(e,t){e.numberOfListeners>0?e.raiseEvent(t):console.error(t)}async function Crt(e,t){let n;try{if(n=await Promise.resolve(t),e.isDestroyed())return;e._imageryProvider=n,e._readyEvent.raiseEvent(n)}catch(i){Rrt(e._errorEvent,i)}}var Zs=zi;var Qni=x(T(),1),H7=class{constructor(){this.alpha=!1,this.brightness=!1,this.contrast=!1,this.hue=!1,this.saturation=!1,this.gamma=!1,this.colorToAlpha=!1}},dX=H7;var vii=x(T(),1);var oii=x(T(),1);var $ni=x(T(),1),K7=class{constructor(t,n,i,o){this._minX=t??0,this._minY=n??0,this._maxX=i??0,this._maxY=o??0}get minX(){return this._minX}set minX(t){this._minX=t}get minY(){return this._minY}set minY(t){this._minY=t}get maxX(){return this._maxX}set maxX(t){this._maxX=t}get maxY(){return this._maxY}set maxY(t){this._maxY=t}contains(t,n){return t>=this.minX&&t<this.maxX&&n>=this.minY&&n<this.maxY}containsExclusive(t,n){return t>this.minX&&t<this.maxX&&n>this.minY&&n<this.maxY}containsInclusive(t,n){return t>=this.minX&&t<=this.maxX&&n>=this.minY&&n<=this.maxY}},KC=K7;var Vrt=new re,Zxe=new re,Ert=new re,Art=new re,Grt=new re,Lrt=new re,J7=class e{constructor(t,n,i,o,r){this._x=t,this._y=n,this._level=i,this._textureCoordinateRectangle=o,this._imagery=r}get x(){return this._x}get y(){return this._y}get level(){return this._level}get textureCoordinateRectangle(){return this._textureCoordinateRectangle}get imagery(){return this._imagery}static createImageryCoverages(t,n,i){if(!n.show)return[];let o=n.imageryProvider,r=e._clampImageryLevel(o,i),s=re.intersection(o.rectangle,n.rectangle,Vrt),a=o.tilingScheme,c=e._computeImageryRange(t,s,a,r),d=Art;a.rectangleToNativeRectangle(t,d);let u=Grt;a.rectangleToNativeRectangle(s,u);let m=(b,f,y)=>{let _=a.tileXYToRectangle(b,f,y),S=re.intersection(_,s,Ert);if(!l(S))return;let Z=Lrt;return a.rectangleToNativeRectangle(S,Z),Z};return e._computeImageryCoverages(n,c,r,d,m)}static _clampImageryLevel(t,n){let i=t.minimumLevel??0,o=t.maximumLevel??Number.POSITIVE_INFINITY,r=Math.min(o-1,Math.max(i,n));return Math.floor(r)}static _computeImageryRange(t,n,i,o){let r=e._computeOverlappedRectangle(t,n),s=i.positionToTileXY(re.northwest(r),o),a=i.positionToTileXY(re.southeast(r),o),c=new KC;c.minX=s.x,c.minY=s.y,c.maxX=a.x,c.maxY=a.y;let d=t.width/512,u=t.height/512,m=i.tileXYToRectangle(c.minX,c.minY,o);Math.abs(m.south-t.north)<u&&c.minY<c.maxY&&++c.minY,Math.abs(m.east-t.west)<d&&c.minX<c.maxX&&++c.minX;let f=i.tileXYToRectangle(c.maxX,c.maxY,o);return Math.abs(f.north-t.south)<u&&c.maxY>c.minY&&--c.maxY,Math.abs(f.west-t.east)<d&&c.maxX>c.minX&&--c.maxX,c}static _clampRectangle(t,n,i){return l(i)||(i=new re),t.south>=n.north?i.north=i.south=n.north:t.north<=n.south?i.north=i.south=n.south:(i.south=Math.max(t.south,n.south),i.north=Math.min(t.north,n.north)),t.west>=n.east?i.west=i.east=n.east:t.east<=n.west?i.west=i.east=n.west:(i.west=Math.max(t.west,n.west),i.east=Math.min(t.east,n.east)),i}static _computeOverlappedRectangle(t,n){let i=re.intersection(t,n,Zxe);return l(i)?i:e._clampRectangle(t,n,Zxe)}static _computeImageryCoverages(t,n,i,o,r){let s=[];for(let a=n.minX;a<=n.maxX;a++){let c=r(a,n.maxY,i);if(l(c))for(let d=n.minY;d<=n.maxY;d++){let u=r(a,d,i);if(!l(u))continue;let m=e._localizeToCartesianRectangle(u,o,void 0),p=t.getImageryFromCache(a,d,i),b=new e(a,d,i,m,p);s.push(b)}}return s}static _localizeToCartesianRectangle(t,n,i){l(i)||(i=new KC);let o=1/n.width,r=1/n.height;return i.minX=(t.west-n.west)*o,i.minY=(t.south-n.south)*r,i.maxX=(t.east-n.west)*o,i.maxY=(t.north-n.south)*r,i}},JC=J7;var gii=x(T(),1);var j7=class e{static createTextureCoordinatesForMappedPositions(t,n){let i=t.cartographicPositions,o=t.cartographicBoundingRectangle,r=t.numPositions;return e._createTextureCoordinates(i,r,o,n)}static _createTextureCoordinates(t,n,i,o){let r=new nt;nt.fromRectangle(i,o,r);let s=e.createProjectedPositions(t,o),a=e.computeTexCoords(s,r);return e.createTypedArrayFromCartesians2(n,a)}static createTextureCoordinatesAttributeForMappedPositions(t,n){let i=e.createTextureCoordinatesForMappedPositions(t,n);return e.createTexCoordAttribute(i)}static createCartographicPositions(t,n,i){let o=xa.readAttributeAsTypedArray(t),r=t.type,s=Dt.getNumberOfComponents(r),a=e.createIterableCartesian3FromTypedArray(o,s),c=e.transformCartesians3(a,n);return e.transformToCartographic(c,i)}static createIterableCartesian3FromTypedArray(t,n){let i=new h,o=t.length/n;return{[Symbol.iterator]:function*(){for(let s=0;s<o;s++)i.x=t[s*n+0],i.y=t[s*n+1],i.z=t[s*n+2],yield i}}}static map(t,n){return{[Symbol.iterator]:function*(){for(let o of t)yield n(o)}}}static computeCartographicBoundingRectangle(t,n){l(n)||(n=new re);let i=Number.NEGATIVE_INFINITY,o=Number.POSITIVE_INFINITY,r=Number.NEGATIVE_INFINITY,s=Number.POSITIVE_INFINITY;for(let a of t)i=Math.max(i,a.latitude),o=Math.min(o,a.latitude),r=Math.max(r,a.longitude),s=Math.min(s,a.longitude);return n.north=i,n.south=o,n.east=r,n.west=s,n}static transformCartesians3(t,n){let i=new h;return e.map(t,r=>(P.multiplyByPoint(n,r,i),i))}static transformToCartographic(t,n){let i=new pe;return e.map(t,r=>(n.cartesianToCartographic(r,i),i))}static createProjectedPositions(t,n){let i=new h;return e.map(t,r=>(n.project(r,i),i))}static computeTexCoords(t,n){let i=new k,o=1/n.width,r=1/n.height;return e.map(t,a=>{let c=(a.x-n.x)*o,d=(a.y-n.y)*r,u=Math.min(Math.max(c,0),1),m=Math.min(Math.max(d,0),1);return i.x=u,i.y=m,i})}static createTypedArrayFromCartesians2(t,n){let i=new Float32Array(t*2),o=0;for(let r of n)i[o*2+0]=r.x,i[o*2+1]=r.y,o++;return i}static createTexCoordAttribute(t){return{name:"Imagery Texture Coordinates",semantic:dt.TEXCOORD,setIndex:0,componentDatatype:J.FLOAT,type:Dt.VEC2,normalized:!1,count:t.length/2,min:void 0,max:void 0,constant:new k(0,0),quantization:void 0,typedArray:t,byteOffset:0,byteStride:void 0}}},yS=j7;var xii=x(T(),1);var Q7=class{constructor(t,n,i,o){this._cartographicPositions=t,this._numPositions=n,this._cartographicBoundingRectangle=i,this._ellipsoid=o}get cartographicPositions(){return this._cartographicPositions}get numPositions(){return this._numPositions}get cartographicBoundingRectangle(){return this._cartographicBoundingRectangle}get ellipsoid(){return this._ellipsoid}},uX=Q7;var q7=class e{constructor(t,n,i){this._model=t,this._runtimeNode=n,this._runtimePrimitive=i,this._mappedPositionsPerEllipsoid=void 0,this._mappedPositionsModelMatrix=new P,this._lastImageryLayersModificationCounter=0,this._imageryTexCoordAttributesPerProjection=void 0,this._currentImageryLayers=void 0,this._coveragesPerLayer=void 0,this._allImageriesReady=!1}coveragesForImageryLayer(t){let o=this._model.imageryLayers.indexOf(t);if(o===-1)throw new ge("Imagery layer is not part of the model");let r=this._coveragesPerLayer;if(!l(r))throw new ge("The coveragesPerLayer have not been computed yet");return r[o]}update(t){let n=this._model,r=n.content.tileset.imageryLayersModificationCounter;this._lastImageryLayersModificationCounter!==r&&(delete this._mappedPositionsPerEllipsoid,this._lastImageryLayersModificationCounter=r),this._mappedPositionsNeedUpdate&&(n.resetDrawCommands(),this._mappedPositionsPerEllipsoid=this._computeMappedPositionsPerEllipsoid(),this._deleteCoveragesPerLayer(),this._destroyImageryTexCoordAttributes()),l(this._imageryTexCoordAttributesPerProjection)||(this._imageryTexCoordAttributesPerProjection=this._computeImageryTexCoordsAttributesPerProjection(),this._uploadImageryTexCoordAttributes(t.context)),l(this._coveragesPerLayer)||(this._computeCoveragesPerLayer(),this._allImageriesReady=!1),this._allImageriesReady||this._updateImageries(t)}_deleteCoveragesPerLayer(){let t=this._coveragesPerLayer;if(!l(t))return;let n=this._currentImageryLayers,i=t.length;for(let o=0;o<i;o++){let r=n[o],s=t[o];this._deleteCoverages(r,s)}delete this._currentImageryLayers,delete this._coveragesPerLayer}_deleteCoverages(t,n){if(t.isDestroyed())return;let i=n.length;for(let o=0;o<i;o++)n[o].imagery.releaseReference()}_uploadImageryTexCoordAttributes(t){let n=this._imageryTexCoordAttributesPerProjection;if(!l(n))return;let i=n.length;for(let o=0;o<i;o++){let r=n[o],s=it.createVertexBuffer({context:t,typedArray:r.typedArray,usage:Pe.STATIC_DRAW});s.vertexArrayDestroyable=!1,r.buffer=s}}_destroyImageryTexCoordAttributes(){let t=this._imageryTexCoordAttributesPerProjection;if(!l(t))return;let n=t.length;for(let i=0;i<n;i++){let o=t[i];l(o)&&(l(o.buffer)&&(o.buffer.isDestroyed()||o.buffer.destroy()),t[i]=void 0)}delete this._imageryTexCoordAttributesPerProjection}get _mappedPositionsNeedUpdate(){if(!l(this._mappedPositionsPerEllipsoid))return!0;let t=this._model,n=this._mappedPositionsModelMatrix;return!P.equals(t.modelMatrix,n)}_computeMappedPositionsPerEllipsoid(){let t=this._model,n=this._runtimeNode,i=this._runtimePrimitive,o=e._obtainPrimitivePositionAttribute(i.primitive),r=o.count,s=e._computePrimitivePositionTransform(t,n,void 0),a=[],c=e._computeUniqueEllipsoids(t.imageryLayers),d=c.length;for(let u=0;u<d;u++){let m=c[u],p=yS.createCartographicPositions(o,s,m),b=yS.computeCartographicBoundingRectangle(p),f=new uX(p,r,b,m);a.push(f)}return P.clone(t.modelMatrix,this._mappedPositionsModelMatrix),a}static _computeUniqueEllipsoids(t){let n=new Set,i=t.length;for(let o=0;o<i;o++){let r=t.get(o),s=e._getEllipsoid(r);n.add(s)}return[...n]}_computeImageryTexCoordsAttributesPerProjection(){let n=this._model.imageryLayers,i=e._extractProjections(n),o=[...new Set(i)];return this._createImageryTexCoordAttributes(o)}static _extractProjections(t){let n=[],i=t.length;for(let o=0;o<i;o++){let r=t.get(o),s=e._getProjection(r);n.push(s)}return n}static _getProjection(t){return t.imageryProvider.tilingScheme.projection}_createImageryTexCoordAttributes(t){let n=[],i=t.length;for(let o=0;o<i;o++){let r=t[o],s=r.ellipsoid,a=this.mappedPositionsForEllipsoid(s),c=yS.createTextureCoordinatesAttributeForMappedPositions(a,r);n.push(c)}return n}_computeCoveragesPerLayer(){let t=[],n=[],o=this._model.imageryLayers,r=o.length;for(let s=0;s<r;s++){let a=o.get(s),c=this._computeCoverage(a);t.push(c),n.push(a)}this._coveragesPerLayer=t,this._currentImageryLayers=n}_computeCoverage(t){let i=this.mappedPositionsForImageryLayer(t).cartographicBoundingRectangle,o=this._computeImageryLevel(t,i);return JC.createImageryCoverages(i,t,o)}_computeImageryLevel(t,n){let i=t.imageryProvider,r=i.tilingScheme.rectangle,s=1,a=n.width,c=r.width;n.height>n.width&&(a=n.height,c=r.height);let d=Math.log2(s*c/a);return JC._clampImageryLevel(i,d)}_updateImageries(t){let n=this._model,i=this._coveragesPerLayer,o=i.length,r=!0;for(let s=0;s<o;s++){let a=i[s],c=a.length;for(let d=0;d<c;d++){let m=a[d].imagery;m.state===Dn.READY||m.state===Dn.FAILED||m.state===Dn.INVALID||(r=!1,m.processStateMachine(t,!1,!1))}}r&&n.resetDrawCommands(),this._allImageriesReady=r}mappedPositionsForImageryLayer(t){let n=e._getEllipsoid(t);return this.mappedPositionsForEllipsoid(n)}mappedPositionsForEllipsoid(t){let n=this._mappedPositionsPerEllipsoid;if(!l(n))throw new ge("The mappedPositions have not been computed yet");let i=n.length;for(let o=0;o<i;o++){let r=n[o];if(r.ellipsoid===t)return r}throw new ge(`Could not find mapped positions for ellipsoid ${t}`)}imageryTexCoordAttributesPerProjection(){let t=this._imageryTexCoordAttributesPerProjection;if(!l(t))throw new ge("The imagery texture coordinate attributes have not been computed yet");return this._imageryTexCoordAttributesPerProjection}get ready(){let t=this._coveragesPerLayer;return l(t)?this._allImageriesReady:!1}isDestroyed(){return!1}destroy(){if(!this.isDestroyed())return this._deleteCoveragesPerLayer(),this._destroyImageryTexCoordAttributes(),ue(this)}static _computePrimitivePositionTransform(t,n,i){l(i)||(i=new P);let o=t.sceneGraph;return P.clone(P.IDENTITY,i),P.multiply(i,t.modelMatrix,i),P.multiply(i,o.components.transform,i),P.multiply(i,o.axisCorrectionMatrix,i),P.multiply(i,n.computedTransform,i),i}static _obtainPrimitivePositionAttribute(t){let n=Zt.getAttributeBySemantic(t,"POSITION");if(!l(n))throw new ge("The primitive does not have a POSITION attribute");return n}static _getEllipsoid(t){return t.imageryProvider.tilingScheme.projection.ellipsoid}},xS=q7;var Iii=x(T(),1),$7=class{constructor(t,n,i,o,r){this.imageryLayer=t,this.texture=n,this.textureTranslationAndScale=i,this.textureCoordinateRectangle=o,this.imageryTexCoordAttributeSetIndex=r}},mX=$7;var Wrt=!1,vrt=new re,Frt=new re,eq=class e{static process(t,n,i){let o=t.model,r=n.modelPrimitiveImagery;if(!l(r)||!r.ready)return;let s=o.imageryLayers,a=xS._extractProjections(s),c=[...new Set(a)],d=e._computeIndexMapping(a,c),u=e._createImageryInputs(s,r,d);if(u.length===0)return;u.length>10&&(xt("imagery-texture-units",`Warning: Draped imagery requires ${u.length} texture units, truncating`),u.length=10),e._addImageryTexCoordAttributesToRenderResources(r,t);let m=[];for(let p=0;p<s.length;p++)m.push(s.get(p));e._processImageryInputs(m,t,u,c.length)}static _addImageryTexCoordAttributesToRenderResources(t,n){let i=t.imageryTexCoordAttributesPerProjection();for(let o of i)e._addImageryTexCoordAttributeToRenderResources(o,n)}static _addImageryTexCoordAttributeToRenderResources(t,n){let i=Dt.getNumberOfComponents(t.type),o={index:n.attributeIndex++,value:l(t.buffer)?void 0:t.constant,vertexBuffer:t.buffer,count:t.count,componentsPerAttribute:i,componentDatatype:t.componentDatatype,offsetInBytes:t.byteOffset,strideInBytes:t.byteStride,normalize:t.normalized};n.attributes.push(o)}static _processImageryInputs(t,n,i,o){let r=n.shaderBuilder,s=e._computeImageryFlags(t),a=i.length;r.addDefine("HAS_IMAGERY"),r.addDefine(`IMAGERY_TEXTURE_UNITS ${a}`),e._addAttributes(r,o),e._defineUniforms(r,s),e._buildSampleAndBlendFunction(r,s),e._createMainImageryShader(r,i,s);let c=n.uniformMap,d=e._createImageryUniforms(i);e._setImageryUniforms(c,d)}static _addAttributes(t,n){for(let r=0;r<n;r++)t.addAttribute("vec2",`a_imagery_texCoord_${r}`),t.addVarying("vec2",`v_imagery_texCoord_${r}`);let i="initializeImageryAttributes",o=`void ${i}()`;t.addFunction(i,o,fe.VERTEX);for(let r=0;r<n;r++)t.addFunctionLines(i,[`v_imagery_texCoord_${r} = a_imagery_texCoord_${r};`])}static _computeImageryFlags(t){let n=new dX;for(let i=0;i<t.length;i++){let o=t[i];n.alpha|=o.alpha!==1,n.brightness|=o.brightness!==Zs.DEFAULT_BRIGHTNESS,n.contrast|=o.contrast!==Zs.DEFAULT_CONTRAST,n.hue|=o.hue!==Zs.DEFAULT_HUE,n.saturation|=o.saturation!==Zs.DEFAULT_SATURATION,n.gamma|=o.gamma!==Zs.DEFAULT_GAMMA;let r=l(o.colorToAlpha)&&o.colorToAlphaThreshold>0;n.colorToAlpha|=r}return n}static _defineUniforms(t,n){t.addUniform("sampler2D","u_imageryTextures[IMAGERY_TEXTURE_UNITS]",fe.FRAGMENT),t.addUniform("vec4","u_imageryTextureCoordinateRectangle[IMAGERY_TEXTURE_UNITS]",fe.FRAGMENT),t.addUniform("vec4","u_imageryTextureTranslationAndScale[IMAGERY_TEXTURE_UNITS]",fe.FRAGMENT),n.alpha&&t.addUniform("float","u_imageryTextureAlpha[IMAGERY_TEXTURE_UNITS]",fe.FRAGMENT),n.brightness&&t.addUniform("float","u_imageryTextureBrightness[IMAGERY_TEXTURE_UNITS]",fe.FRAGMENT),n.contrast&&t.addUniform("float","u_imageryTextureContrast[IMAGERY_TEXTURE_UNITS]",fe.FRAGMENT),n.hue&&t.addUniform("float","u_imageryTextureHue[IMAGERY_TEXTURE_UNITS]",fe.FRAGMENT),n.saturation&&t.addUniform("float","u_imageryTextureSaturation[IMAGERY_TEXTURE_UNITS]",fe.FRAGMENT),n.gamma&&t.addUniform("float","u_imageryTextureOneOverGamma[IMAGERY_TEXTURE_UNITS]",fe.FRAGMENT),n.colorToAlpha&&t.addUniform("vec4","u_imageryTextureColorToAlpha[IMAGERY_TEXTURE_UNITS]",fe.FRAGMENT)}static _createSampleAndBlendFunctionSignature(t){let n="sampleAndBlend",i=[];i.push("vec4 previousColor"),i.push("sampler2D textureToSample"),i.push("vec2 textureCoordinates"),i.push("vec4 textureCoordinateRectangle"),i.push("vec4 textureCoordinateTranslationAndScale"),t.alpha&&i.push("float textureAlpha"),t.brightness&&i.push("float textureBrightness"),t.contrast&&i.push("float textureContrast"),t.hue&&i.push("float textureHue"),t.saturation&&i.push("float textureSaturation"),t.gamma&&i.push("float textureOneOverGamma"),t.colorToAlpha&&i.push("vec4 colorToAlpha");let o=i.join(", ");return`vec4 ${n}(${o})`}static _buildSampleAndBlendFunction(t,n){let i="sampleAndBlend",o=e._createSampleAndBlendFunctionSignature(n);t.addFunction(i,o,fe.FRAGMENT),t.addFunctionLines(i,["float effectiveAlpha = 1.0;"]),n.alpha&&t.addFunctionLines(i,["effectiveAlpha = textureAlpha;"]),t.addFunctionLines(i,["if (textureCoordinates.x < textureCoordinateRectangle.x) effectiveAlpha = 0.0;","if (textureCoordinates.x > textureCoordinateRectangle.z) effectiveAlpha = 0.0;","if (textureCoordinates.y < textureCoordinateRectangle.y) effectiveAlpha = 0.0;","if (textureCoordinates.y > textureCoordinateRectangle.w) effectiveAlpha = 0.0;","vec2 translation = textureCoordinateTranslationAndScale.xy;","vec2 scale = textureCoordinateTranslationAndScale.zw;","vec2 effectiveTextureCoordinates = textureCoordinates * scale + translation;","vec4 value = texture(textureToSample, effectiveTextureCoordinates);","value = czm_srgbToLinear(value);","vec3 color = value.rgb;","float alpha = value.a;"]),n.colorToAlpha&&t.addFunctionLines(i,["vec3 colorDiff = abs(color.rgb - colorToAlpha.rgb);","colorDiff.r = czm_maximumComponent(colorDiff);","alpha = czm_branchFreeTernary(colorDiff.r < colorToAlpha.a, 0.0, alpha);"]),n.gamma?t.addFunctionLines(i,["color = pow(color, vec3(textureOneOverGamma));"]):t.addFunctionLines(i,["vec4 tempColor = czm_gammaCorrect(vec4(color, alpha));","color = tempColor.rgb;","alpha = tempColor.a;"]),n.brightness&&t.addFunctionLines(i,["color = mix(vec3(0.0), color, textureBrightness);"]),n.contrast&&t.addFunctionLines(i,["color = mix(vec3(0.5), color, textureContrast);"]),n.hue&&t.addFunctionLines(i,["color = czm_hue(color, textureHue);"]),n.saturation&&t.addFunctionLines(i,["color = czm_saturation(color, textureSaturation);"]),t.addFunctionLines(i,["float sourceAlpha = alpha * effectiveAlpha;","float outAlpha = mix(previousColor.a, 1.0, sourceAlpha);","outAlpha += sign(outAlpha) - 1.0;","vec3 outColor = mix(previousColor.rgb * previousColor.a, color, sourceAlpha) / outAlpha;","vec4 result = vec4(outColor, max(outAlpha, 0.0));"]),Wrt&&t.addFunctionLines(i,["if (abs(textureCoordinates.x - textureCoordinateRectangle.x) < (1.0/256.0) || "," abs(textureCoordinates.x - textureCoordinateRectangle.z) < (1.0/256.0) || "," abs(textureCoordinates.y - textureCoordinateRectangle.y) < (1.0/256.0) || "," abs(textureCoordinates.y - textureCoordinateRectangle.w) < (1.0/256.0))","{"," result = vec4(1.0, 0.0, 0.0, effectiveAlpha);","}"]),t.addFunctionLines(i,["return result;"])}static _createSampleAndBlendCallArguments(t,n,i){let o=`v_imagery_texCoord_${n}`,r=[];return r.push("blendedBaseColor"),r.push(`u_imageryTextures[${i}]`),r.push(`${o}`),r.push(`u_imageryTextureCoordinateRectangle[${i}]`),r.push(`u_imageryTextureTranslationAndScale[${i}]`),t.alpha&&r.push(`u_imageryTextureAlpha[${i}]`),t.brightness&&r.push(`u_imageryTextureBrightness[${i}]`),t.contrast&&r.push(`u_imageryTextureContrast[${i}]`),t.hue&&r.push(`u_imageryTextureHue[${i}]`),t.saturation&&r.push(`u_imageryTextureSaturation[${i}]`),t.gamma&&r.push(`u_imageryTextureOneOverGamma[${i}]`),t.colorToAlpha&&r.push(`u_imageryTextureColorToAlpha[${i}]`),r.join(", ")}static _createMainImageryShader(t,n,i){let o="blendBaseColorWithImagery";t.addFunction(o,"vec4 blendBaseColorWithImagery(vec4 baseColorWithAlpha)",fe.FRAGMENT),t.addFunctionLines(o,["vec4 blendedBaseColor = baseColorWithAlpha;"]);for(let r=0;r<n.length;r++){let a=n[r].imageryTexCoordAttributeSetIndex,c=e._createSampleAndBlendCallArguments(i,a,r);t.addFunctionLines(o,[`blendedBaseColor = sampleAndBlend(${c});`])}t.addFunctionLines(o,["return blendedBaseColor;"])}static _createImageryUniforms(t){let n=t.length,i={};i.imageryTextures=Array(n),i.imageryTextureCoordinateRectangle=Array(n),i.imageryTextureTranslationAndScale=Array(n),i.imageryTextureAlpha=Array(n),i.imageryTextureBrightness=Array(n),i.imageryTextureContrast=Array(n),i.imageryTextureHue=Array(n),i.imageryTextureSaturation=Array(n),i.imageryTextureOneOverGamma=Array(n),i.imageryTextureColorToAlpha=Array(n);for(let o=0;o<n;o++){let r=t[o],s=r.imageryLayer,a=r.texture,c=r.textureCoordinateRectangle,d=r.textureTranslationAndScale;i.imageryTextures[o]=a,i.imageryTextureTranslationAndScale[o]=d,i.imageryTextureCoordinateRectangle[o]=c,i.imageryTextureAlpha[o]=s.alpha,i.imageryTextureBrightness[o]=s.brightness,i.imageryTextureContrast[o]=s.contrast,i.imageryTextureHue[o]=s.hue,i.imageryTextureSaturation[o]=s.saturation,i.imageryTextureOneOverGamma[o]=1/s.gamma;let u=i.imageryTextureColorToAlpha[o];if(l(u)||(u=new ce,i.imageryTextureColorToAlpha[o]=u),l(s.colorToAlpha)&&s.colorToAlphaThreshold>0){let p=s.colorToAlpha;u.x=p.red,u.y=p.green,u.z=p.blue,u.w=s.colorToAlphaThreshold}else u.w=-1}return i}static _setImageryUniforms(t,n){for(let i in n)if(n.hasOwnProperty(i)){let o=`u_${i}`;t[o]=function(){return n[i]}}}static _createImageryInputs(t,n,i){let o=[];for(let r=0;r<t.length;r++){let s=t.get(r);if(!s.show)continue;let a=i[r],d=n.mappedPositionsForImageryLayer(s).cartographicBoundingRectangle,u=n.coveragesForImageryLayer(s);for(let m=0;m<u.length;m++){let p=u[m],b=e._createImageryInput(s,p,d,a);l(b)&&o.push(b)}}return o}static _createImageryInput(t,n,i,o){let r=n.imagery;if(r.state===Dn.FAILED||r.state===Dn.INVALID)return;let s=r.textureWebMercator;if(!l(s)&&(s=r.texture,!l(s))){r.state===Dn.READY&&console.log(`Imagery at ${n.x}, ${n.y} (level ${n.level}) does not have any texture - state ${r.state}`);return}let a=e._computeTextureTranslationAndScale(t,i,r.rectangle),c=n.textureCoordinateRectangle,d=new ce(c.minX,c.minY,c.maxX,c.maxY);return new mX(t,s,a,d,o)}static _computeTextureTranslationAndScale(t,n,i){let o=t.imageryProvider.tilingScheme,r=o.rectangleToNativeRectangle(n,vrt),s=o.rectangleToNativeRectangle(i,Frt);return e._computeTextureTranslationAndScaleFromNative(r,s)}static _computeTextureTranslationAndScaleFromNative(t,n){let i=1/n.width,o=1/n.height,r=t.west-n.west,s=t.south-n.south,a=r*i,c=s*o,d=t.width*i,u=t.height*o;return new ce(a,c,d,u)}static _computeIndexMapping(t,n){let i=[],o=t.length;for(let r=0;r<o;r++){let s=t[r],a=n.indexOf(s);i.push(a)}return i}},hX=eq;var ioi=x(T(),1);var Jii=x(T(),1),fX=`#ifdef USE_IBL_LIGHTING +`;var UX={name:"SelectedFeatureIdPipelineStage",STRUCT_ID_SELECTED_FEATURE:"SelectedFeature",STRUCT_NAME_SELECTED_FEATURE:"SelectedFeature"};UX.process=function(e,t,n){let i=e.shaderBuilder;e.hasPropertyTable=!0;let o=e.model,r=e.runtimeNode.node,s=Tat(o,r,t),a=s.shaderDestination;i.addDefine("HAS_SELECTED_FEATURE_ID",void 0,a),i.addDefine("SELECTED_FEATURE_ID",s.variableName,a),i.addDefine(s.featureIdDefine,void 0,a),_at(i);let c=s.featureIds.nullFeatureId,d=e.uniformMap;l(c)&&(i.addDefine("HAS_NULL_FEATURE_ID",void 0,a),i.addUniform("int","model_nullFeatureId",a),d.model_nullFeatureId=function(){return c}),s.shaderDestination===fe.BOTH&&i.addVertexLines(aV),i.addFragmentLines(aV)};function iSe(e){return e instanceof Vn.FeatureIdTexture?"HAS_SELECTED_FEATURE_ID_TEXTURE":"HAS_SELECTED_FEATURE_ID_ATTRIBUTE"}function oSe(e){return e instanceof Vn.FeatureIdTexture?fe.FRAGMENT:fe.BOTH}function Tat(e,t,n){let i,o;return l(t.instances)&&(o=Zt.getFeatureIdsByLabel(t.instances.featureIds,e.instanceFeatureIdLabel),l(o))?(i=o.label??o.positionalLabel,{featureIds:o,variableName:i,shaderDestination:oSe(o),featureIdDefine:iSe(o)}):(o=Zt.getFeatureIdsByLabel(n.featureIds,e.featureIdLabel),i=o.label??o.positionalLabel,{featureIds:o,variableName:i,shaderDestination:oSe(o),featureIdDefine:iSe(o)})}function _at(e){e.addStructField(UX.STRUCT_ID_SELECTED_FEATURE,"int","id"),e.addStructField(UX.STRUCT_ID_SELECTED_FEATURE,"vec2","st"),e.addStructField(UX.STRUCT_ID_SELECTED_FEATURE,"vec4","color")}var Rx=UX;var Oa={name:"GeometryPipelineStage",STRUCT_ID_PROCESSED_ATTRIBUTES_VS:"ProcessedAttributesVS",STRUCT_ID_PROCESSED_ATTRIBUTES_FS:"ProcessedAttributesFS",STRUCT_NAME_PROCESSED_ATTRIBUTES:"ProcessedAttributes",FUNCTION_ID_INITIALIZE_ATTRIBUTES:"initializeAttributes",FUNCTION_SIGNATURE_INITIALIZE_ATTRIBUTES:"void initializeAttributes(out ProcessedAttributes attributes)",FUNCTION_ID_SET_DYNAMIC_VARYINGS_VS:"setDynamicVaryingsVS",FUNCTION_ID_SET_DYNAMIC_VARYINGS_FS:"setDynamicVaryingsFS",FUNCTION_SIGNATURE_SET_DYNAMIC_VARYINGS:"void setDynamicVaryings(inout ProcessedAttributes attributes)"};Oa.process=function(e,t,n){let{shaderBuilder:i,model:o}=e;i.addStruct(Oa.STRUCT_ID_PROCESSED_ATTRIBUTES_VS,"ProcessedAttributes",fe.VERTEX),i.addStruct(Oa.STRUCT_ID_PROCESSED_ATTRIBUTES_FS,"ProcessedAttributes",fe.FRAGMENT),i.addStruct(Rx.STRUCT_ID_SELECTED_FEATURE,Rx.STRUCT_NAME_SELECTED_FEATURE,fe.BOTH),i.addFunction(Oa.FUNCTION_ID_INITIALIZE_ATTRIBUTES,Oa.FUNCTION_SIGNATURE_INITIALIZE_ATTRIBUTES,fe.VERTEX),i.addVarying("vec3","v_positionWC"),i.addVarying("vec3","v_positionEC"),i.addStructField(Oa.STRUCT_ID_PROCESSED_ATTRIBUTES_FS,"vec3","positionWC"),i.addStructField(Oa.STRUCT_ID_PROCESSED_ATTRIBUTES_FS,"vec3","positionEC"),i.addFunction(Oa.FUNCTION_ID_SET_DYNAMIC_VARYINGS_VS,Oa.FUNCTION_SIGNATURE_SET_DYNAMIC_VARYINGS,fe.VERTEX),i.addFunction(Oa.FUNCTION_ID_SET_DYNAMIC_VARYINGS_FS,Oa.FUNCTION_SIGNATURE_SET_DYNAMIC_VARYINGS,fe.FRAGMENT),o.type===Br.TILE_PNTS&&i.addDefine("HAS_SRGB_COLOR",void 0,fe.FRAGMENT);let r=n.mode!==se.SCENE3D&&!n.scene3DOnly&&o._projectTo2D,s=l(e.runtimeNode.node.instances),a=r&&!s,c=t.attributes.length;for(let d=0;d<c;d++){let u=t.attributes[d],m=Dt.getAttributeLocationCount(u.type),p=u.semantic===dt.POSITION,b;m>1?(b=e.attributeIndex,e.attributeIndex+=m):p&&!a?b=0:b=e.attributeIndex++;let f=!p&&t.primitiveType===Ie.POINTS&&n.context.webgl2?"flat":void 0;Sat(e,u,b,m,r,s,f)}Wat(i,t.attributes),t.primitiveType===Ie.POINTS&&i.addDefine("PRIMITIVE_TYPE_POINTS"),i.addVertexLines(kX),i.addFragmentLines(wX)};function Sat(e,t,n,i,o,r,s){let a=e.shaderBuilder,c=Zt.getAttributeInfo(t),d=o&&!r;i>1?Cat(e,t,n,i):Rat(e,t,n,d),Eat(a,c,d),Vat(a,c,s),l(t.semantic)&&Zat(a,t),Aat(a,c,o),Gat(a,c,d),Lat(a,c)}function Zat(e,t){let{semantic:n,setIndex:i}=t;switch(n){case dt.NORMAL:e.addDefine("HAS_NORMALS");break;case dt.TANGENT:e.addDefine("HAS_TANGENTS");break;case dt.FEATURE_ID:e.addDefine(`HAS${n}_${i}`);break;case dt.TEXCOORD:case dt.COLOR:e.addDefine(`HAS_${n}_${i}`)}}function Rat(e,t,n,i){let{quantization:o,semantic:r,setIndex:s}=t,{type:a,componentDatatype:c}=l(o)?o:t;r===dt.FEATURE_ID&&s>=e.featureIdVertexAttributeSetIndex&&(e.featureIdVertexAttributeSetIndex=s+1);let d=r===dt.POSITION,u=d?0:n,m=Dt.getNumberOfComponents(a),p={index:u,value:l(t.buffer)?void 0:t.constant,vertexBuffer:t.buffer,count:t.count,componentsPerAttribute:m,componentDatatype:c,offsetInBytes:t.byteOffset,strideInBytes:t.byteStride,normalize:t.normalized};if(e.attributes.push(p),!d||!i)return;let b=e.runtimePrimitive.positionBuffer2D,f={index:n,vertexBuffer:b,count:t.count,componentsPerAttribute:m,componentDatatype:J.FLOAT,offsetInBytes:0,strideInBytes:void 0,normalize:t.normalized};e.attributes.push(f)}function Cat(e,t,n,i){let{quantization:o,normalized:r}=t,{type:s,componentDatatype:a}=l(o)?o:t,d=Dt.getNumberOfComponents(s)/i,u=J.getSizeInBytes(a),m=d*u,p=t.byteStride;for(let b=0;b<i;b++){let f=t.byteOffset+b*m,y={index:n+b,vertexBuffer:t.buffer,componentsPerAttribute:d,componentDatatype:a,offsetInBytes:f,strideInBytes:p,normalize:r};e.attributes.push(y)}}function Vat(e,t,n){let i=t.variableName,o=`v_${i}`,r;i==="normalMC"?(o="v_normalEC",r=t.glslType):i==="tangentMC"?(r="vec3",o="v_tangentEC"):r=t.glslType,e.addVarying(r,o,n)}function Eat(e,t,n){let i=t.attribute.semantic,o=t.variableName,r,s;t.isQuantized?(r=`a_quantized_${o}`,s=t.quantizedGlslType):(r=`a_${o}`,s=t.glslType);let a=i===dt.POSITION;a?e.setPositionAttribute(s,r):e.addAttribute(s,r),a&&n&&e.addAttribute("vec3","a_position2D")}function Aat(e,t,n){let i=Oa.STRUCT_ID_PROCESSED_ATTRIBUTES_VS,o=Oa.STRUCT_ID_PROCESSED_ATTRIBUTES_FS,{variableName:r,glslType:s}=t;r==="tangentMC"?(e.addStructField(i,"vec3","tangentMC"),e.addStructField(i,"float","tangentSignMC"),e.addStructField(o,"vec3","tangentEC")):r==="normalMC"?(e.addStructField(i,"vec3","normalMC"),e.addStructField(o,"vec3","normalEC")):(e.addStructField(i,s,r),e.addStructField(o,s,r)),r==="positionMC"&&n&&e.addStructField(i,"vec3","position2D")}function Gat(e,t,n){let i=Oa.FUNCTION_ID_INITIALIZE_ATTRIBUTES,o=t.variableName;if(o==="positionMC"&&n&&e.addFunctionLines(i,["attributes.position2D = a_position2D;"]),t.isQuantized)return;let s=[];o==="tangentMC"?(s.push("attributes.tangentMC = a_tangentMC.xyz;"),s.push("attributes.tangentSignMC = a_tangentMC.w;")):s.push(`attributes.${o} = a_${o};`),e.addFunctionLines(i,s)}function Lat(e,t){let{semantic:n,setIndex:i}=t.attribute;if(l(n)&&!l(i))return;let o=Oa.FUNCTION_ID_SET_DYNAMIC_VARYINGS_VS,r=t.variableName,s=`v_${r} = attributes.${r};`;e.addFunctionLines(o,[s]),o=Oa.FUNCTION_ID_SET_DYNAMIC_VARYINGS_FS,s=`attributes.${r} = v_${r};`,e.addFunctionLines(o,[s])}function Wat(e,t){let n=!1,i=!1;for(let o=0;o<t.length;o++){let r=t[o];r.semantic===dt.NORMAL?n=!0:r.semantic===dt.TANGENT&&(i=!0)}!n||!i||(e.addDefine("HAS_BITANGENTS"),e.addVarying("vec3","v_bitangentEC"),e.addStructField(Oa.STRUCT_ID_PROCESSED_ATTRIBUTES_VS,"vec3","bitangentMC"),e.addStructField(Oa.STRUCT_ID_PROCESSED_ATTRIBUTES_FS,"vec3","bitangentEC"))}var DX=Oa;var mxi=x(T(),1);var fyi=x(T(),1);var ugi=x(T(),1);var ogi=x(T(),1);var Qhi=x(T(),1),Zq=x(gu(),1);var Dhi=x(T(),1);var Sq,rSe="eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJub25jZSI6ImwwendUTkl3UVk5Uk5XdEkiLCJqdGkiOiJjZGFkZDZlNC0wMDI5LTQ5OTMtYWIwMC01ZWY4ZDVlNTBhMzYiLCJpZCI6MjU5LCJzdWIiOiJDZXNpdW1KUyIsImlzcyI6Imh0dHBzOi8vYXBpLmNlc2l1bS5jb20iLCJhdWQiOiIxLjE0NSBSZWxlYXNlIC0gRGVsZXRlIG9uIE5vdmVtYmVyIDEsIDIwMjYiLCJpYXQiOjE3ODc2MzQ3NzV9.3SPieoGxEZ22pnWLETAIFZveR0xXTzvOh8G4NYTxDSo",PB={};PB.defaultAccessToken=rSe;PB.defaultServer=new ve({url:"https://api.cesium.com/"});PB.getDefaultTokenCredit=function(e){if(e===rSe){if(!l(Sq)){let t=`<b> This application is using Cesium's default ion access token. Please assign <i>Cesium.Ion.defaultAccessToken</i> with an access token from your ion account before making any Cesium API calls. You can sign up for a free ion account at <a href="https://cesium.com">https://cesium.com</a>.</b>`;Sq=new Lt(t,!0)}return Sq}};var Bd=PB;function ml(e,t){let n,i=e.externalType,o=l(i);if(!o)n={url:e.url,retryAttempts:1,retryCallback:vat};else if(i==="3DTILES"||i==="STK_TERRAIN_SERVER")n={url:e.options.url};else throw new ae("Ion.createResource does not support external imagery assets; use IonImageryProvider instead.");ve.call(this,n),this._ionEndpoint=e,this._ionEndpointDomain=o?void 0:new Zq.default(e.url).authority(),this._ionEndpointResource=t,this._ionRoot=void 0,this._pendingPromise=void 0,this._credits=void 0,this._isExternal=o,this.refreshCallback=void 0}l(Object.create)&&(ml.prototype=Object.create(ve.prototype),ml.prototype.constructor=ml);ml.fromAssetId=function(e,t){let n=ml._createEndpointResource(e,t);return n.fetchJson().then(function(i){return new ml(i,n)})};Object.defineProperties(ml.prototype,{credits:{get:function(){return l(this._ionRoot)?this._ionRoot.credits:l(this._credits)?this._credits:(this._credits=ml.getCreditsFromEndpoint(this._ionEndpoint,this._ionEndpointResource),this._credits)}}});ml.getCreditsFromEndpoint=function(e,t){let n=e.attributions.map(Lt.getIonCredit),i=Bd.getDefaultTokenCredit(t.queryParameters.access_token);return l(i)&&n.push(Lt.clone(i)),n};ml.prototype.clone=function(e){let t=this._ionRoot??this;return l(e)||(e=Object.create(ml.prototype),ve.call(e,{url:this._url,parseUrl:!1}),e._ionEndpoint=t._ionEndpoint,e._ionEndpointDomain=t._ionEndpointDomain,e._ionEndpointResource=t._ionEndpointResource,e._ionRoot=void 0,e._pendingPromise=void 0,e._credits=void 0,e._isExternal=this._isExternal,e.refreshCallback=void 0),e=ve.prototype.clone.call(this,e),e._ionRoot=t,e._isExternal=this._isExternal,e};ml.prototype.fetchImage=function(e){if(!this._isExternal){let t=e;e={preferBlob:!0},l(t)&&(e.flipY=t.flipY,e.preferImageBitmap=t.preferImageBitmap)}return ve.prototype.fetchImage.call(this,e)};ml.prototype._makeRequest=function(e){return this._isExternal||new Zq.default(this.url).authority()!==this._ionEndpointDomain?ve.prototype._makeRequest.call(this,e):(e.headers=Rq(e.headers),e.headers.Authorization=`Bearer ${this._ionEndpoint.accessToken}`,ve.prototype._makeRequest.call(this,e))};ml._createEndpointResource=function(e,t){t=t??B.EMPTY_OBJECT;let n=t.server??Bd.defaultServer,i=t.accessToken??Bd.defaultAccessToken;n=ve.createIfNeeded(n);let o={url:`v1/assets/${e}/endpoint`};return l(i)&&(o.queryParameters={access_token:i}),l(t.queryParameters)&&(o.queryParameters={...o.queryParameters,...t.queryParameters}),o.headers=Rq(o.headers),n.getDerivedResource(o)};function Rq(e={}){return e["X-Cesium-Client"]="CesiumJS",typeof CESIUM_VERSION<"u"&&(e["X-Cesium-Client-Version"]=CESIUM_VERSION),e}ml._addClientHeaders=Rq;function vat(e,t){let n=e._ionRoot??e,i=n._ionEndpointResource,o=typeof Image<"u";return!l(t)||t.statusCode!==401&&!(o&&t.target instanceof Image)?Promise.resolve(!1):(l(n._pendingPromise)||(n._pendingPromise=i.fetchJson().then(function(r){let s=e.refreshCallback??n.refreshCallback;return l(s)&&s(n,r),n._ionEndpoint=r,n._ionEndpoint}).finally(function(r){return n._pendingPromise=void 0,r})),n._pendingPromise.then(function(r){return e._ionEndpoint=r,!0}))}var zr=ml;var Jbi=x(T(),1);var qfi=x(T(),1);var afi=x(T(),1);var Cq=new pe,Vq=new pe,sSe=new h,aSe=new h,Eq=class{constructor(t){mt(this,"_rectangleSouthwestInMeters");mt(this,"_rectangleNortheastInMeters");if(t=t??B.EMPTY_OBJECT,this._ellipsoid=t.ellipsoid??ne.default,this._numberOfLevelZeroTilesX=t.numberOfLevelZeroTilesX??1,this._numberOfLevelZeroTilesY=t.numberOfLevelZeroTilesY??1,this._projection=new Ti(this._ellipsoid),l(t.rectangleSouthwestInMeters)&&l(t.rectangleNortheastInMeters))this._rectangleSouthwestInMeters=t.rectangleSouthwestInMeters,this._rectangleNortheastInMeters=t.rectangleNortheastInMeters;else{let o=this._ellipsoid.maximumRadius*Math.PI;this._rectangleSouthwestInMeters=new k(-o,-o),this._rectangleNortheastInMeters=new k(o,o)}let{x:n,y:i}=this._rectangleSouthwestInMeters;h.fromElements(n,i,0,sSe),this._projection.unproject(sSe,Cq),{x:n,y:i}=this._rectangleNortheastInMeters,h.fromElements(n,i,0,aSe),this._projection.unproject(aSe,Vq),this._rectangle=new re(Cq.longitude,Cq.latitude,Vq.longitude,Vq.latitude)}get ellipsoid(){return this._ellipsoid}get rectangle(){return this._rectangle}get projection(){return this._projection}getNumberOfXTilesAtLevel(t){return this._numberOfLevelZeroTilesX<<t}getNumberOfYTilesAtLevel(t){return this._numberOfLevelZeroTilesY<<t}rectangleToNativeRectangle(t,n){let i=this._projection,o=i.project(re.southwest(t)),r=i.project(re.northeast(t));return l(n)?(n.west=o.x,n.south=o.y,n.east=r.x,n.north=r.y,n):new re(o.x,o.y,r.x,r.y)}tileXYToNativeRectangle(t,n,i,o){let r=this.getNumberOfXTilesAtLevel(i),s=this.getNumberOfYTilesAtLevel(i),a=(this._rectangleNortheastInMeters.x-this._rectangleSouthwestInMeters.x)/r,c=this._rectangleSouthwestInMeters.x+t*a,d=this._rectangleSouthwestInMeters.x+(t+1)*a,u=(this._rectangleNortheastInMeters.y-this._rectangleSouthwestInMeters.y)/s,m=this._rectangleNortheastInMeters.y-n*u,p=this._rectangleNortheastInMeters.y-(n+1)*u;return l(o)?(o.west=c,o.south=p,o.east=d,o.north=m,o):new re(c,p,d,m)}tileXYToRectangle(t,n,i,o){let r=this.tileXYToNativeRectangle(t,n,i,o),s=this._projection,a=s.unproject(new h(r.west,r.south)),c=s.unproject(new h(r.east,r.north));return r.west=a.longitude,r.south=a.latitude,r.east=c.longitude,r.north=c.latitude,r}positionToTileXY(t,n,i){let o=this._rectangle;if(!re.contains(o,t))return;let r=this.getNumberOfXTilesAtLevel(n),s=this.getNumberOfYTilesAtLevel(n),c=(this._rectangleNortheastInMeters.x-this._rectangleSouthwestInMeters.x)/r,u=(this._rectangleNortheastInMeters.y-this._rectangleSouthwestInMeters.y)/s,p=this._projection.project(t),b=p.x-this._rectangleSouthwestInMeters.x,f=this._rectangleNortheastInMeters.y-p.y,y=b/c|0;y>=r&&(y=r-1);let _=f/u|0;return _>=s&&(_=s-1),l(i)?(i.x=y,i.y=_,i):new k(y,_)}},Nr=Eq;var hfi=x(T(),1);var Aq,cSe="AAPTaeRGM19PsTpo1ePVkJZk4Tg..zqn3rpU4kUaF-8QMW-oWZntlxvKhdUFXLBoo5dQwRNEKd1EoKJh-Ha2zxbrz2Nhz2tV_gLVZTQwFHLzJHKwsGDz4GTKV8jeUgb12Ci9CeU_9sOrauJYnGK2vHhtSSAQ-73rmKzNG_2lZ0zuCCEKslxCmXUw2mT1Cpk0RoCCtDheWByX1e7Lnb3LKCBDt9VhGFSGCOiaFfizFRLld8LWukKgxCgluTpKgUuUi4OytX84roEpm6mP7PE91AT1_5Uash6To",cV={};cV.defaultAccessToken=cSe;cV.defaultWorldImageryServer=new ve({url:"https://ibasemaps-api.arcgis.com/arcgis/rest/services/World_Imagery/MapServer"});cV.defaultWorldHillshadeServer=new ve({url:"https://ibasemaps-api.arcgis.com/arcgis/rest/services/Elevation/World_Hillshade/MapServer"});cV.defaultWorldOceanServer=new ve({url:"https://ibasemaps-api.arcgis.com/arcgis/rest/services/Ocean/World_Ocean_Base/MapServer"});cV.getDefaultTokenCredit=function(e){if(e===cSe){if(!l(Aq)){let t='<b> This application is using a default ArcGIS access token. Please assign <i>Cesium.ArcGisMapService.defaultAccessToken</i> with an API key from your ArcGIS Developer account before using the ArcGIS tile services. You can sign up for a free ArcGIS Developer account at <a href="https://developers.arcgis.com/">https://developers.arcgis.com/</a>.</b>';Aq=new Lt(t,!0)}return Aq}};var wu=cV;var xfi=x(T(),1);function Gq(e){e=e??B.EMPTY_OBJECT,this._pixelsToCheck=e.pixelsToCheck,this._missingImagePixels=void 0,this._missingImageByteLength=void 0,this._isReady=!1;let t=ve.createIfNeeded(e.missingImageUrl),n=this;function i(r){l(r.blob)&&(n._missingImageByteLength=r.blob.size);let s=Fh(r);if(e.disableCheckIfAllPixelsAreTransparent){let a=!0,c=r.width,d=e.pixelsToCheck;for(let u=0,m=d.length;a&&u<m;++u){let p=d[u],b=p.x*4+p.y*c;s[b+3]>0&&(a=!1)}a&&(s=void 0)}n._missingImagePixels=s,n._isReady=!0}function o(){n._missingImagePixels=void 0,n._isReady=!0}t.fetchImage({preferBlob:!0,preferImageBitmap:!0,flipY:!0}).then(i).catch(o)}Gq.prototype.isReady=function(){return this._isReady};Gq.prototype.shouldDiscardImage=function(e){let t=this._pixelsToCheck,n=this._missingImagePixels;if(!l(n)||l(e.blob)&&e.blob.size!==this._missingImageByteLength)return!1;let i=Fh(e),o=e.width;for(let r=0,s=t.length;r<s;++r){let a=t[r],c=a.x*4+a.y*o;for(let d=0;d<4;++d){let u=c+d;if(i[u]!==n[u])return!1}}return!0};var OX=Gq;var Sfi=x(T(),1);function Lq(){this.name=void 0,this.description=void 0,this.position=void 0,this.data=void 0,this.imageryLayer=void 0}Lq.prototype.configureNameFromProperties=function(e){let t=10,n;for(let i in e)if(e.hasOwnProperty(i)&&e[i]){let o=i.toLowerCase();t>1&&o==="name"?(t=1,n=i):t>2&&o==="title"?(t=2,n=i):t>3&&/name/i.test(i)?(t=3,n=i):t>4&&/title/i.test(i)&&(t=4,n=i)}l(n)&&(this.name=e[n])};Lq.prototype.configureDescriptionFromProperties=function(e){function t(n){let i='<table class="cesium-infoBox-defaultTable">';for(let o in n)if(n.hasOwnProperty(o)){let r=n[o];l(r)&&(typeof r=="object"?i+=`<tr><td>${o}</td><td>${t(r)}</td></tr>`:i+=`<tr><td>${o}</td><td>${r}</td></tr>`)}return i+="</table>",i}this.description=t(e)};var Rf=Lq;var Afi=x(T(),1);function lV(){ge.throwInstantiationError()}Object.defineProperties(lV.prototype,{rectangle:{get:ge.throwInstantiationError},tileWidth:{get:ge.throwInstantiationError},tileHeight:{get:ge.throwInstantiationError},maximumLevel:{get:ge.throwInstantiationError},minimumLevel:{get:ge.throwInstantiationError},tilingScheme:{get:ge.throwInstantiationError},tileDiscardPolicy:{get:ge.throwInstantiationError},errorEvent:{get:ge.throwInstantiationError},credit:{get:ge.throwInstantiationError},proxy:{get:ge.throwInstantiationError},hasAlphaChannel:{get:ge.throwInstantiationError}});lV.prototype.getTileCredits=function(e,t,n){ge.throwInstantiationError()};lV.prototype.requestImage=function(e,t,n,i){ge.throwInstantiationError()};lV.prototype.pickFeatures=function(e,t,n,i,o){ge.throwInstantiationError()};var Fat=/\.ktx2$/i;lV.loadImage=function(e,t){let n=ve.createIfNeeded(t);return Fat.test(n.url)?Ad(n):l(e)&&l(e.tileDiscardPolicy)?n.fetchImage({preferBlob:!0,preferImageBitmap:!0,flipY:!0}):n.fetchImage({preferImageBitmap:!0,flipY:!0})};var ku=lV;var Lfi=x(T(),1),lSe={SATELLITE:1,OCEANS:2,HILLSHADE:3};Object.freeze(lSe);var Cf=lSe;function dSe(e){this.useTiles=e.usePreCachedTilesIfAvailable??!0;let t=e.ellipsoid;this.tilingScheme=e.tilingScheme??new eo({ellipsoid:t}),this.rectangle=e.rectangle??this.tilingScheme.rectangle,this.ellipsoid=t;let n=e.credit;typeof n=="string"&&(n=new Lt(n)),this.credit=n,this.tileCredits=void 0,this.tileDiscardPolicy=e.tileDiscardPolicy,this.tileWidth=e.tileWidth??256,this.tileHeight=e.tileHeight??256,this.maximumLevel=e.maximumLevel}dSe.prototype.build=function(e){e._useTiles=this.useTiles,e._tilingScheme=this.tilingScheme,e._rectangle=this.rectangle,e._credit=this.credit,e._tileCredits=this.tileCredits,e._tileDiscardPolicy=this.tileDiscardPolicy,e._tileWidth=this.tileWidth,e._tileHeight=this.tileHeight,e._maximumLevel=this.maximumLevel,this.useTiles&&!l(this.tileDiscardPolicy)&&(e._tileDiscardPolicy=new OX({missingImageUrl:uSe(e,0,0,this.maximumLevel).url,pixelsToCheck:[new k(0,0),new k(200,20),new k(20,200),new k(80,110),new k(160,130)],disableCheckIfAllPixelsAreTransparent:!0}))};function Iat(e,t){let n=e.tileInfo;if(!l(n))t.useTiles=!1;else{if(t.tileWidth=n.rows,t.tileHeight=n.cols,n.spatialReference.wkid===102100||n.spatialReference.wkid===102113)t.tilingScheme=new Nr({ellipsoid:t.ellipsoid});else if(e.tileInfo.spatialReference.wkid===4326)t.tilingScheme=new eo({ellipsoid:t.ellipsoid});else{let i=`Tile spatial reference WKID ${e.tileInfo.spatialReference.wkid} is not supported.`;throw new ae(i)}if(t.maximumLevel=e.tileInfo.lods.length-1,l(e.fullExtent)){if(l(e.fullExtent.spatialReference)&&l(e.fullExtent.spatialReference.wkid))if(e.fullExtent.spatialReference.wkid===102100||e.fullExtent.spatialReference.wkid===102113){let i=new Ti,o=e.fullExtent,r=i.unproject(new h(Math.max(o.xmin,-t.tilingScheme.ellipsoid.maximumRadius*Math.PI),Math.max(o.ymin,-t.tilingScheme.ellipsoid.maximumRadius*Math.PI),0)),s=i.unproject(new h(Math.min(o.xmax,t.tilingScheme.ellipsoid.maximumRadius*Math.PI),Math.min(o.ymax,t.tilingScheme.ellipsoid.maximumRadius*Math.PI),0));t.rectangle=new re(r.longitude,r.latitude,s.longitude,s.latitude)}else if(e.fullExtent.spatialReference.wkid===4326)t.rectangle=re.fromDegrees(e.fullExtent.xmin,e.fullExtent.ymin,e.fullExtent.xmax,e.fullExtent.ymax);else{let i=`fullExtent.spatialReference WKID ${e.fullExtent.spatialReference.wkid} is not supported.`;throw new ae(i)}}else t.rectangle=t.tilingScheme.rectangle;t.useTiles=!0}l(e.copyrightText)&&e.copyrightText.length>0&&(l(t.credit)?t.tileCredits=[new Lt(e.copyrightText)]:t.credit=new Lt(e.copyrightText))}function Pat(e,t){let n=`An error occurred while accessing ${e.url}`;throw l(t)&&l(t.message)&&(n+=`: ${t.message}`),new ae(n)}async function Xat(e,t){let n=e.getDerivedResource({queryParameters:{f:"json"}});try{let i=await n.fetchJson();Iat(i,t)}catch(i){Pat(e,i)}}function Qp(e){e=e??B.EMPTY_OBJECT,this._defaultAlpha=void 0,this._defaultNightAlpha=void 0,this._defaultDayAlpha=void 0,this._defaultBrightness=void 0,this._defaultContrast=void 0,this._defaultHue=void 0,this._defaultSaturation=void 0,this._defaultGamma=void 0,this._defaultMinificationFilter=void 0,this._defaultMagnificationFilter=void 0,this._tileDiscardPolicy=e.tileDiscardPolicy,this._tileWidth=e.tileWidth??256,this._tileHeight=e.tileHeight??256,this._maximumLevel=e.maximumLevel,this._tilingScheme=e.tilingScheme??new eo({ellipsoid:e.ellipsoid}),this._useTiles=e.usePreCachedTilesIfAvailable??!0,this._rectangle=e.rectangle??this._tilingScheme.rectangle,this._layers=e.layers,this._credit=e.credit,this._tileCredits=void 0,this.enablePickFeatures=e.enablePickFeatures??!0,this._errorEvent=new Se}Qp.fromBasemapType=async function(e,t){t=t??B.EMPTY_OBJECT;let n,i,o;switch(e){case Cf.SATELLITE:{n=t.token??wu.defaultAccessToken,i=ve.createIfNeeded(wu.defaultWorldImageryServer),i.appendForwardSlash();let r=wu.getDefaultTokenCredit(n);l(r)&&(o=Lt.clone(r))}break;case Cf.OCEANS:{n=t.token??wu.defaultAccessToken,i=ve.createIfNeeded(wu.defaultWorldOceanServer),i.appendForwardSlash();let r=wu.getDefaultTokenCredit(n);l(r)&&(o=Lt.clone(r))}break;case Cf.HILLSHADE:{n=t.token??wu.defaultAccessToken,i=ve.createIfNeeded(wu.defaultWorldHillshadeServer),i.appendForwardSlash();let r=wu.getDefaultTokenCredit(n);l(r)&&(o=Lt.clone(r))}break;default:}return Qp.fromUrl(i,{...t,token:n,credit:o,usePreCachedTilesIfAvailable:!0})};function uSe(e,t,n,i,o){let r;if(e._useTiles)r=e._resource.getDerivedResource({url:`tile/${i}/${n}/${t}`,request:o});else{let s=e._tilingScheme.tileXYToNativeRectangle(t,n,i),c={bbox:`${s.west},${s.south},${s.east},${s.north}`,size:`${e._tileWidth},${e._tileHeight}`,format:"png32",transparent:!0,f:"image"};e._tilingScheme.projection instanceof ki?(c.bboxSR=4326,c.imageSR=4326):(c.bboxSR=3857,c.imageSR=3857),e.layers&&(c.layers=`show:${e.layers}`),r=e._resource.getDerivedResource({url:"export",request:o,queryParameters:c})}return r}Object.defineProperties(Qp.prototype,{url:{get:function(){return this._resource._url}},token:{get:function(){return this._resource.queryParameters.token}},proxy:{get:function(){return this._resource.proxy}},tileWidth:{get:function(){return this._tileWidth}},tileHeight:{get:function(){return this._tileHeight}},maximumLevel:{get:function(){return this._maximumLevel}},minimumLevel:{get:function(){return 0}},tilingScheme:{get:function(){return this._tilingScheme}},rectangle:{get:function(){return this._rectangle}},tileDiscardPolicy:{get:function(){return this._tileDiscardPolicy}},errorEvent:{get:function(){return this._errorEvent}},credit:{get:function(){return this._credit}},usingPrecachedTiles:{get:function(){return this._useTiles}},hasAlphaChannel:{get:function(){return!0}},layers:{get:function(){return this._layers}}});Qp.fromUrl=async function(e,t){t=t??B.EMPTY_OBJECT;let n=ve.createIfNeeded(e);n.appendForwardSlash(),l(t.token)&&n.setQueryParameters({token:t.token});let i=new Qp(t);i._resource=n;let o=new dSe(t);return(t.usePreCachedTilesIfAvailable??!0)&&await Xat(n,o),o.build(i),i};Qp.prototype.getTileCredits=function(e,t,n){return this._tileCredits};Qp.prototype.requestImage=function(e,t,n,i){return ku.loadImage(this,uSe(this,e,t,n,i))};Qp.prototype.pickFeatures=function(e,t,n,i,o){if(!this.enablePickFeatures)return;let r=this._tilingScheme.tileXYToNativeRectangle(e,t,n),s,a,c;if(this._tilingScheme.projection instanceof ki)s=W.toDegrees(i),a=W.toDegrees(o),c="4326";else{let p=this._tilingScheme.projection.project(new pe(i,o,0));s=p.x,a=p.y,c="3857"}let d="visible";l(this._layers)&&(d+=`:${this._layers}`);let u={f:"json",tolerance:2,geometryType:"esriGeometryPoint",geometry:`${s},${a}`,mapExtent:`${r.west},${r.south},${r.east},${r.north}`,imageDisplay:`${this._tileWidth},${this._tileHeight},96`,sr:c,layers:d};return this._resource.getDerivedResource({url:"identify",queryParameters:u}).fetchJson().then(function(p){let b=[],f=p.results;if(!l(f))return b;for(let y=0;y<f.length;++y){let _=f[y],S=new Rf;if(S.data=_,S.name=_.value,S.properties=_.attributes,S.configureDescriptionFromProperties(_.attributes),_.geometryType==="esriGeometryPoint"&&_.geometry){let Z=_.geometry.spatialReference&&_.geometry.spatialReference.wkid?_.geometry.spatialReference.wkid:4326;if(Z===4326||Z===4283)S.position=pe.fromDegrees(_.geometry.x,_.geometry.y,_.geometry.z);else if(Z===102100||Z===900913||Z===3857){let R=new Ti;S.position=R.unproject(new h(_.geometry.x,_.geometry.y,_.geometry.z))}}b.push(S)}return b})};Qp._metadataCache={};var tg=Qp;var Zpi=x(T(),1);var npi=x(T(),1);function XB(e,t,n,i,o,r,s){this.provider=e,this.message=t,this.x=n,this.y=i,this.level=o,this.timesRetried=r??0,this.retry=!1,this.error=s}XB.reportError=function(e,t,n,i,o,r,s,a){let c=e;return l(e)?(c.provider=t,c.message=i,c.x=o,c.y=r,c.level=s,c.retry=!1,c.error=a,++c.timesRetried):c=new XB(t,i,o,r,s,0,a),l(n)&&n.numberOfListeners>0?n.raiseEvent(c):l(t)&&console.log(`An error occurred in "${t.constructor.name}": ${Wp(i)}`),c};XB.reportSuccess=function(e){l(e)&&(e.timesRetried=-1)};var tr=XB;var opi=x(T(),1),mSe={AERIAL:"Aerial",AERIAL_WITH_LABELS:"AerialWithLabels",AERIAL_WITH_LABELS_ON_DEMAND:"AerialWithLabelsOnDemand",ROAD:"Road",ROAD_ON_DEMAND:"RoadOnDemand",CANVAS_DARK:"CanvasDark",CANVAS_LIGHT:"CanvasLight",CANVAS_GRAY:"CanvasGray",ORDNANCE_SURVEY:"OrdnanceSurvey",COLLINS_BART:"CollinsBart"};Object.freeze(mSe);var dV=mSe;var api=x(T(),1);function BX(e){}BX.prototype.isReady=function(){return!0};BX.prototype.shouldDiscardImage=function(e){return BX.EMPTY_IMAGE===e};var NB;Object.defineProperties(BX,{EMPTY_IMAGE:{get:function(){return l(NB)||(NB=new Image,NB.src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAQAAAC1HAwCAAAAC0lEQVR42mNkYAAAAAYAAjCB0C8AAAAASUVORK5CYII="),NB}}});var uV=BX;function hSe(e){this.tileWidth=void 0,this.tileHeight=void 0,this.maximumLevel=void 0,this.imageUrlSubdomains=void 0,this.imageUrlTemplate=void 0,this.attributionList=void 0}hSe.prototype.build=function(e){e._tileWidth=this.tileWidth,e._tileHeight=this.tileHeight,e._maximumLevel=this.maximumLevel,e._imageUrlSubdomains=this.imageUrlSubdomains,e._imageUrlTemplate=this.imageUrlTemplate;let t=e._attributionList=this.attributionList;t||(t=[]),e._attributionList=t;for(let n=0,i=t.length;n<i;++n){let o=t[n];if(o.credit instanceof Lt)break;o.credit=new Lt(o.attribution);let r=o.coverageAreas;for(let s=0,a=o.coverageAreas.length;s<a;++s){let c=r[s],d=c.bbox;c.bbox=new re(W.toRadians(d[1]),W.toRadians(d[0]),W.toRadians(d[3]),W.toRadians(d[2]))}}};function Nat(e,t){if(e.resourceSets.length!==1)throw new ae("metadata does not specify one resource in resourceSets");let n=e.resourceSets[0].resources[0];t.tileWidth=n.imageWidth,t.tileHeight=n.imageHeight,t.maximumLevel=n.zoomMax-1,t.imageUrlSubdomains=n.imageUrlSubdomains,t.imageUrlTemplate=n.imageUrl;let i=n.imageryProviders;l(n.imageryProviders)&&(i=n.imageryProviders.filter(o=>o.coverageAreas?.some(r=>l(r.bbox)))),t.attributionList=i}function Yat(e,t,n){let i=`An error occurred while accessing ${e.url}`;throw l(t)&&l(t.message)&&(i+=`: ${t.message}`),tr.reportError(void 0,n,l(n)?n._errorEvent:void 0,i,void 0,void 0,void 0,t),new ae(i)}async function Mat(e,t,n){let i=e.url,o=Za._metadataCache[i];l(o)||(o=e.fetchJson(),Za._metadataCache[i]=o);try{let r=await o;return Nat(r,t)}catch(r){Yat(e,r,n)}}function Za(e){e=e??B.EMPTY_OBJECT,this._defaultAlpha=void 0,this._defaultNightAlpha=void 0,this._defaultDayAlpha=void 0,this._defaultBrightness=void 0,this._defaultContrast=void 0,this._defaultHue=void 0,this._defaultSaturation=void 0,this._defaultGamma=1,this._defaultMinificationFilter=void 0,this._defaultMagnificationFilter=void 0,this._mapStyle=e.mapStyle??dV.AERIAL,this._mapLayer=e.mapLayer,this._culture=e.culture??"",this._key=e.key,this._tileDiscardPolicy=e.tileDiscardPolicy,l(this._tileDiscardPolicy)||(this._tileDiscardPolicy=new uV),this._proxy=e.proxy,this._credit=new Lt(`<a href="https://www.microsoft.com/en-us/maps/bing-maps/product"><img src="${Za.logoUrl}" title="Bing Imagery"/></a>`),this._tilingScheme=new Nr({numberOfLevelZeroTilesX:2,numberOfLevelZeroTilesY:2,ellipsoid:e.ellipsoid}),this._tileWidth=void 0,this._tileHeight=void 0,this._maximumLevel=void 0,this._imageUrlTemplate=void 0,this._imageUrlSubdomains=void 0,this._attributionList=void 0,this._errorEvent=new Se}Object.defineProperties(Za.prototype,{url:{get:function(){return this._resource.url}},proxy:{get:function(){return this._resource.proxy}},key:{get:function(){return this._key}},mapStyle:{get:function(){return this._mapStyle}},mapLayer:{get:function(){return this._mapLayer}},culture:{get:function(){return this._culture}},tileWidth:{get:function(){return this._tileWidth}},tileHeight:{get:function(){return this._tileHeight}},maximumLevel:{get:function(){return this._maximumLevel}},minimumLevel:{get:function(){return 0}},tilingScheme:{get:function(){return this._tilingScheme}},rectangle:{get:function(){return this._tilingScheme.rectangle}},tileDiscardPolicy:{get:function(){return this._tileDiscardPolicy}},errorEvent:{get:function(){return this._errorEvent}},credit:{get:function(){return this._credit}},hasAlphaChannel:{get:function(){return l(this.mapLayer)}}});Za.fromUrl=async function(e,t){t=t??B.EMPTY_OBJECT;let n=t.tileProtocol;l(n)?n.length>0&&n[n.length-1]===":"&&(n=n.substr(0,n.length-1)):n=document.location.protocol==="http:"?"http":"https";let i=t.mapStyle??dV.AERIAL,o=ve.createIfNeeded(e);o.appendForwardSlash();let r={incl:"ImageryProviders",key:t.key,uriScheme:n};l(t.mapLayer)&&(r.mapLayer=t.mapLayer),l(t.culture)&&(r.culture=t.culture);let s=o.getDerivedResource({url:`REST/v1/Imagery/Metadata/${i}`,queryParameters:r}),a=new Za(t);a._resource=o;let c=new hSe(t);return await Mat(s,c),c.build(a),a};var wat=new re;Za.prototype.getTileCredits=function(e,t,n){let i=this._tilingScheme.tileXYToRectangle(e,t,n,wat);return Dat(this._attributionList,n,i)};Za.prototype.requestImage=function(e,t,n,i){let o=ku.loadImage(this,kat(this,e,t,n,i));if(l(o))return o.catch(function(r){return l(r.blob)&&r.blob.size===0?uV.EMPTY_IMAGE:Promise.reject(r)})};Za.prototype.pickFeatures=function(e,t,n,i,o){};Za.tileXYToQuadKey=function(e,t,n){let i="";for(let o=n;o>=0;--o){let r=1<<o,s=0;(e&r)!==0&&(s|=1),(t&r)!==0&&(s|=2),i+=s}return i};Za.quadKeyToTileXY=function(e){let t=0,n=0,i=e.length-1;for(let o=i;o>=0;--o){let r=1<<o,s=+e[i-o];(s&1)!==0&&(t|=r),(s&2)!==0&&(n|=r)}return{x:t,y:n,level:i}};Za._logoUrl=void 0;Object.defineProperties(Za,{logoUrl:{get:function(){return l(Za._logoUrl)||(Za._logoUrl=en("Assets/Images/bing_maps_credit.png")),Za._logoUrl},set:function(e){Za._logoUrl=e}}});function kat(e,t,n,i,o){let r=e._imageUrlTemplate,s=e._imageUrlSubdomains,a=(t+n+i)%s.length;return e._resource.getDerivedResource({url:r,request:o,templateValues:{quadkey:Za.tileXYToQuadKey(t,n,i),subdomain:s[a],culture:e._culture},queryParameters:{n:"z"}})}var Uat=new re;function Dat(e,t,n){++t;let i=[];for(let o=0,r=e.length;o<r;++o){let s=e[o],a=s.coverageAreas,c=!1;for(let d=0,u=s.coverageAreas.length;!c&&d<u;++d){let m=a[d];if(t>=m.zoomMin&&t<=m.zoomMax){let p=re.intersection(n,m.bbox,Uat);l(p)&&(c=!0)}}c&&i.push(s.credit)}return i}Za._metadataCache={};var zX=Za;var e0i=x(T(),1);var Mpi=x(T(),1);var fSe=/{[^}]+}/g,pSe={x:Hat,y:Jat,z:qat,s:$at,reverseX:Kat,reverseY:jat,reverseZ:Qat,westDegrees:ect,southDegrees:tct,eastDegrees:nct,northDegrees:ict,westProjected:oct,southProjected:rct,eastProjected:sct,northProjected:act,width:cct,height:lct},Oat=It(pSe,{i:dct,j:uct,reverseI:mct,reverseJ:hct,longitudeDegrees:pct,latitudeDegrees:bct,longitudeProjected:gct,latitudeProjected:yct,format:Tct});function HX(e){e=e??B.EMPTY_OBJECT,this._errorEvent=new Se;let t=ve.createIfNeeded(e.url),n=ve.createIfNeeded(e.pickFeaturesUrl);this._resource=t,this._urlSchemeZeroPadding=e.urlSchemeZeroPadding,this._getFeatureInfoFormats=e.getFeatureInfoFormats,this._pickFeaturesResource=n;let i=e.subdomains;Array.isArray(i)?i=i.slice():l(i)&&i.length>0?i=i.split(""):i=["a","b","c"],this._subdomains=i,this._tileWidth=e.tileWidth??256,this._tileHeight=e.tileHeight??256,this._minimumLevel=e.minimumLevel??0,this._maximumLevel=e.maximumLevel,this._tilingScheme=e.tilingScheme??new Nr({ellipsoid:e.ellipsoid}),this._rectangle=e.rectangle??this._tilingScheme.rectangle,this._rectangle=re.intersection(this._rectangle,this._tilingScheme.rectangle),this._tileDiscardPolicy=e.tileDiscardPolicy;let o=e.credit;typeof o=="string"&&(o=new Lt(o)),this._credit=o,this._hasAlphaChannel=e.hasAlphaChannel??!0;let r=e.customTags,s=It(pSe,r),a=It(Oat,r);this._tags=s,this._pickFeaturesTags=a,this._defaultAlpha=void 0,this._defaultNightAlpha=void 0,this._defaultDayAlpha=void 0,this._defaultBrightness=void 0,this._defaultContrast=void 0,this._defaultHue=void 0,this._defaultSaturation=void 0,this._defaultGamma=void 0,this._defaultMinificationFilter=void 0,this._defaultMagnificationFilter=void 0,this.enablePickFeatures=e.enablePickFeatures??!0}Object.defineProperties(HX.prototype,{url:{get:function(){return this._resource.url}},urlSchemeZeroPadding:{get:function(){return this._urlSchemeZeroPadding}},pickFeaturesUrl:{get:function(){return this._pickFeaturesResource.url}},proxy:{get:function(){return this._resource.proxy}},tileWidth:{get:function(){return this._tileWidth}},tileHeight:{get:function(){return this._tileHeight}},maximumLevel:{get:function(){return this._maximumLevel}},minimumLevel:{get:function(){return this._minimumLevel}},tilingScheme:{get:function(){return this._tilingScheme}},rectangle:{get:function(){return this._rectangle}},tileDiscardPolicy:{get:function(){return this._tileDiscardPolicy}},errorEvent:{get:function(){return this._errorEvent}},credit:{get:function(){return this._credit}},hasAlphaChannel:{get:function(){return this._hasAlphaChannel}}});HX.prototype.getTileCredits=function(e,t,n){};HX.prototype.requestImage=function(e,t,n,i){return ku.loadImage(this,Bat(this,e,t,n,i))};HX.prototype.pickFeatures=function(e,t,n,i,o){if(!this.enablePickFeatures||!l(this._pickFeaturesResource)||this._getFeatureInfoFormats.length===0)return;let r=0,s=this;function a(d,u){return d.callback(u)}function c(){if(r>=s._getFeatureInfoFormats.length)return Promise.resolve([]);let d=s._getFeatureInfoFormats[r],u=zat(s,e,t,n,i,o,d.format);return++r,d.type==="json"?u.fetchJson().then(d.callback).catch(c):d.type==="xml"?u.fetchXML().then(d.callback).catch(c):d.type==="text"||d.type==="html"?u.fetchText().then(d.callback).catch(c):u.fetch({responseType:d.format}).then(a.bind(void 0,d)).catch(c)}return c()};var YB=!1,Uu=new re,MB=!1,KX=new re;function Bat(e,t,n,i,o){YB=!1,MB=!1;let r=e._resource,s=r.getUrlComponent(!0),a=e._tags,c={},d=s.match(fSe);return l(d)&&d.forEach(function(u){let m=u.substring(1,u.length-1);l(a[m])&&(c[m]=a[m](e,t,n,i))}),r.getDerivedResource({request:o,templateValues:c})}var Wq=!1,hV=new k,vq=!1;function zat(e,t,n,i,o,r,s){YB=!1,MB=!1,Wq=!1,vq=!1;let a=e._pickFeaturesResource,c=a.getUrlComponent(!0),d=e._pickFeaturesTags,u={},m=c.match(fSe);return l(m)&&m.forEach(function(p){let b=p.substring(1,p.length-1);l(d[b])&&(u[b]=d[b](e,t,n,i,o,r,s))}),a.getDerivedResource({templateValues:u})}function fV(e,t,n){if(e&&e.urlSchemeZeroPadding&&e.urlSchemeZeroPadding.hasOwnProperty(t)){let i=e.urlSchemeZeroPadding[t];if(typeof i=="string"){let o=i.length;o>1&&(n=n.length>=o?n:new Array(o-n.toString().length+1).join("0")+n)}}return n}function Hat(e,t,n,i){return fV(e,"{x}",t)}function Kat(e,t,n,i){let o=e.tilingScheme.getNumberOfXTilesAtLevel(i)-t-1;return fV(e,"{reverseX}",o)}function Jat(e,t,n,i){return fV(e,"{y}",n)}function jat(e,t,n,i){let o=e.tilingScheme.getNumberOfYTilesAtLevel(i)-n-1;return fV(e,"{reverseY}",o)}function Qat(e,t,n,i){let o=e.maximumLevel,r=l(o)&&i<o?o-i-1:i;return fV(e,"{reverseZ}",r)}function qat(e,t,n,i){return fV(e,"{z}",i)}function $at(e,t,n,i){let o=(t+n+i)%e._subdomains.length;return e._subdomains[o]}function wB(e,t,n,i){YB||(e.tilingScheme.tileXYToRectangle(t,n,i,Uu),Uu.west=W.toDegrees(Uu.west),Uu.south=W.toDegrees(Uu.south),Uu.east=W.toDegrees(Uu.east),Uu.north=W.toDegrees(Uu.north),YB=!0)}function ect(e,t,n,i){return wB(e,t,n,i),Uu.west}function tct(e,t,n,i){return wB(e,t,n,i),Uu.south}function nct(e,t,n,i){return wB(e,t,n,i),Uu.east}function ict(e,t,n,i){return wB(e,t,n,i),Uu.north}function kB(e,t,n,i){MB||(e.tilingScheme.tileXYToNativeRectangle(t,n,i,KX),MB=!0)}function oct(e,t,n,i){return kB(e,t,n,i),KX.west}function rct(e,t,n,i){return kB(e,t,n,i),KX.south}function sct(e,t,n,i){return kB(e,t,n,i),KX.east}function act(e,t,n,i){return kB(e,t,n,i),KX.north}function cct(e,t,n,i){return e.tileWidth}function lct(e,t,n,i){return e.tileHeight}function dct(e,t,n,i,o,r,s){return UB(e,t,n,i,o,r),hV.x}function uct(e,t,n,i,o,r,s){return UB(e,t,n,i,o,r),hV.y}function mct(e,t,n,i,o,r,s){return UB(e,t,n,i,o,r),e.tileWidth-hV.x-1}function hct(e,t,n,i,o,r,s){return UB(e,t,n,i,o,r),e.tileHeight-hV.y-1}var fct=new re,mV=new h;function UB(e,t,n,i,o,r,s){if(Wq)return;Fq(e,t,n,i,o,r);let a=mV,c=e.tilingScheme.tileXYToNativeRectangle(t,n,i,fct);hV.x=e.tileWidth*(a.x-c.west)/c.width|0,hV.y=e.tileHeight*(c.north-a.y)/c.height|0,Wq=!0}function pct(e,t,n,i,o,r,s){return W.toDegrees(o)}function bct(e,t,n,i,o,r,s){return W.toDegrees(r)}function gct(e,t,n,i,o,r,s){return Fq(e,t,n,i,o,r),mV.x}function yct(e,t,n,i,o,r,s){return Fq(e,t,n,i,o,r),mV.y}var xct=new pe;function Fq(e,t,n,i,o,r,s){if(!vq){if(e.tilingScheme.projection instanceof ki)mV.x=W.toDegrees(o),mV.y=W.toDegrees(r);else{let a=xct;a.longitude=o,a.latitude=r,e.tilingScheme.projection.project(a,mV)}vq=!0}}function Tct(e,t,n,i,o,r,s){return s}var Rs=HX;function Qm(e){Rs.call(this,e)}Qm._requestMetadata=async function(e,t,n,i){try{let o=await n.fetchXML();return Qm._metadataSuccess(o,e,t,n,i)}catch(o){if(o instanceof Sp)return Qm._metadataFailure(e,t);throw o}};Qm.fromUrl=async function(e,t){let n=ve.createIfNeeded(e);n.appendForwardSlash();let i=n,o=n.getDerivedResource({url:"tilemapresource.xml"});t=t??B.EMPTY_OBJECT;let r=await Qm._requestMetadata(t,i,o);return new Qm(r)};l(Object.create)&&(Qm.prototype=Object.create(Rs.prototype),Qm.prototype.constructor=Qm);function bSe(e,t){return e.west<t.rectangle.west&&(e.west=t.rectangle.west),e.east>t.rectangle.east&&(e.east=t.rectangle.east),e.south<t.rectangle.south&&(e.south=t.rectangle.south),e.north>t.rectangle.north&&(e.north=t.rectangle.north),e}function gSe(e,t,n){let i=e.positionToTileXY(re.southwest(t),n),o=e.positionToTileXY(re.northeast(t),n);return(Math.abs(o.x-i.x)+1)*(Math.abs(o.y-i.y)+1)>4?0:n}Qm._metadataSuccess=function(e,t,n,i,o){let r=/tileformat/i,s=/tileset/i,a=/tilesets/i,c=/boundingbox/i,d,u,m,p=[],b=e.childNodes[0].childNodes;for(let F=0;F<b.length;F++)if(r.test(b.item(F).nodeName))d=b.item(F);else if(a.test(b.item(F).nodeName)){m=b.item(F);let I=b.item(F).childNodes;for(let N=0;N<I.length;N++)s.test(I.item(N).nodeName)&&p.push(I.item(N))}else c.test(b.item(F).nodeName)&&(u=b.item(F));let f;if(!l(m)||!l(u))throw f=`Unable to find expected tilesets or bbox attributes in ${i.url}.`,l(o)&&tr.reportError(void 0,o,o.errorEvent,f),new ae(f);let y=t.fileExtension??d.getAttribute("extension"),_=t.tileWidth??parseInt(d.getAttribute("width"),10),S=t.tileHeight??parseInt(d.getAttribute("height"),10),Z=t.minimumLevel??parseInt(p[0].getAttribute("order"),10),R=t.maximumLevel??parseInt(p[p.length-1].getAttribute("order"),10),C=m.getAttribute("profile"),E=t.tilingScheme;if(!l(E))if(C==="geodetic"||C==="global-geodetic")E=new eo({ellipsoid:t.ellipsoid});else if(C==="mercator"||C==="global-mercator")E=new Nr({ellipsoid:t.ellipsoid});else throw f=`${i.url} specifies an unsupported profile attribute, ${C}.`,l(o)&&tr.reportError(void 0,o,o.errorEvent,f),new ae(f);let A=re.clone(t.rectangle);if(!l(A)){let F,I,N,g;t.flipXY??!1?(N=new k(parseFloat(u.getAttribute("miny")),parseFloat(u.getAttribute("minx"))),g=new k(parseFloat(u.getAttribute("maxy")),parseFloat(u.getAttribute("maxx")))):(N=new k(parseFloat(u.getAttribute("minx")),parseFloat(u.getAttribute("miny"))),g=new k(parseFloat(u.getAttribute("maxx")),parseFloat(u.getAttribute("maxy"))));let G=C==="geodetic"||C==="mercator";if(E.projection instanceof ki||G)F=pe.fromDegrees(N.x,N.y),I=pe.fromDegrees(g.x,g.y);else{let v=E.projection;F=v.unproject(N),I=v.unproject(g)}A=new re(F.longitude,F.latitude,I.longitude,I.latitude)}return A=bSe(A,E),Z=gSe(E,A,Z),{url:n.getDerivedResource({url:`{z}/{x}/{reverseY}.${y}`}),tilingScheme:E,rectangle:A,tileWidth:_,tileHeight:S,minimumLevel:Z,maximumLevel:R,tileDiscardPolicy:t.tileDiscardPolicy,credit:t.credit}};Qm._metadataFailure=function(e,t){let n=e.fileExtension??"png",i=e.tileWidth??256,o=e.tileHeight??256,r=e.maximumLevel,s=l(e.tilingScheme)?e.tilingScheme:new Nr({ellipsoid:e.ellipsoid}),a=e.rectangle??s.rectangle;a=bSe(a,s);let c=gSe(s,a,e.minimumLevel);return{url:t.getDerivedResource({url:`{z}/{x}/{reverseY}.${n}`}),tilingScheme:s,rectangle:a,tileWidth:i,tileHeight:o,minimumLevel:c,maximumLevel:r,tileDiscardPolicy:e.tileDiscardPolicy,credit:e.credit}};var Cx=Qm;var h0i=x(T(),1);function ySe(e){this.channel=e.channel,this.ellipsoid=e.ellipsoid,this.tilingScheme=void 0,this.version=void 0}ySe.prototype.build=function(e){e._channel=this.channel,e._version=this.version,e._tilingScheme=this.tilingScheme};function _ct(e,t){let n;try{n=JSON.parse(e)}catch{n=JSON.parse(e.replace(/([\[\{,])[\n\r ]*([A-Za-z0-9]+)[\n\r ]*:/g,'$1"$2":'))}let i;for(let o=0;o<n.layers.length;o++)if(n.layers[o].id===t.channel){i=n.layers[o];break}if(!l(i)){let o=`Could not find layer with channel (id) of ${t.channel}.`;throw new ae(o)}if(!l(i.version)){let o=`Could not find a version in channel (id) ${t.channel}.`;throw new ae(o)}if(t.version=i.version,l(n.projection)&&n.projection==="flat")t.tilingScheme=new eo({numberOfLevelZeroTilesX:2,numberOfLevelZeroTilesY:2,rectangle:new re(-Math.PI,-Math.PI,Math.PI,Math.PI),ellipsoid:t.ellipsoid});else if(!l(n.projection)||n.projection==="mercator")t.tilingScheme=new Nr({numberOfLevelZeroTilesX:2,numberOfLevelZeroTilesY:2,ellipsoid:t.ellipsoid});else{let o=`Unsupported projection ${n.projection}.`;throw new ae(o)}return!0}function Sct(e,t,n){let i=`An error occurred while accessing ${t.url}.`;throw l(e)&&l(e.message)&&(i+=`: ${e.message}`),tr.reportError(void 0,n,l(n)?n._errorEvent:void 0,i),new ae(i)}async function Zct(e,t,n){try{let i=await e.fetchText();_ct(i,t)}catch(i){Sct(i,e,n)}}function zd(e){e=e??{},this._defaultAlpha=void 0,this._defaultNightAlpha=void 0,this._defaultDayAlpha=void 0,this._defaultBrightness=void 0,this._defaultContrast=void 0,this._defaultHue=void 0,this._defaultSaturation=void 0,this._defaultGamma=1.9,this._defaultMinificationFilter=void 0,this._defaultMagnificationFilter=void 0,this._tileDiscardPolicy=e.tileDiscardPolicy,this._channel=e.channel,this._requestType="ImageryMaps",this._credit=new Lt(`<a href="http://www.google.com/enterprise/mapsearth/products/earthenterprise.html"><img src="${zd.logoUrl}" title="Google Imagery"/></a>`),this._tilingScheme=void 0,this._version=void 0,this._tileWidth=256,this._tileHeight=256,this._maximumLevel=e.maximumLevel,this._errorEvent=new Se}Object.defineProperties(zd.prototype,{url:{get:function(){return this._url}},path:{get:function(){return this._path}},proxy:{get:function(){return this._resource.proxy}},channel:{get:function(){return this._channel}},tileWidth:{get:function(){return this._tileWidth}},tileHeight:{get:function(){return this._tileHeight}},maximumLevel:{get:function(){return this._maximumLevel}},minimumLevel:{get:function(){return 0}},tilingScheme:{get:function(){return this._tilingScheme}},version:{get:function(){return this._version}},requestType:{get:function(){return this._requestType}},rectangle:{get:function(){return this._tilingScheme.rectangle}},tileDiscardPolicy:{get:function(){return this._tileDiscardPolicy}},errorEvent:{get:function(){return this._errorEvent}},credit:{get:function(){return this._credit}},hasAlphaChannel:{get:function(){return!0}}});zd.fromUrl=async function(e,t,n){n=n??{};let i=n.path??"/default_map",o=ve.createIfNeeded(e).getDerivedResource({url:i[0]==="/"?i.substring(1):i});o.appendForwardSlash();let r=o.getDerivedResource({url:"query",queryParameters:{request:"Json",vars:"geeServerDefs",is2d:"t"}}),s=new ySe(n);s.channel=t,await Zct(r,s);let a=new zd(n);return s.build(a),a._resource=o,a._url=e,a._path=i,a};zd.prototype.getTileCredits=function(e,t,n){};zd.prototype.requestImage=function(e,t,n,i){let o=this._resource.getDerivedResource({url:"query",request:i,queryParameters:{request:this._requestType,channel:this._channel,version:this._version,x:e,y:t,z:n+1}});return ku.loadImage(this,o)};zd.prototype.pickFeatures=function(e,t,n,i,o){};zd._logoUrl=void 0;Object.defineProperties(zd,{logoUrl:{get:function(){return l(zd._logoUrl)||(zd._logoUrl=en("Assets/Images/google_earth_credit.png")),zd._logoUrl},set:function(e){zd._logoUrl=e}}});var JX=zd;var T0i=x(T(),1);var Rct=/\/$/,xSe=new Lt('© <a href="https://www.mapbox.com/about/maps/">Mapbox</a> © <a href="http://www.openstreetmap.org/copyright">OpenStreetMap</a> <strong><a href="https://www.mapbox.com/map-feedback/">Improve this map</a></strong>');function pV(e){e=e??B.EMPTY_OBJECT;let t=e.mapId,n=e.accessToken;this._defaultAlpha=void 0,this._defaultNightAlpha=void 0,this._defaultDayAlpha=void 0,this._defaultBrightness=void 0,this._defaultContrast=void 0,this._defaultHue=void 0,this._defaultSaturation=void 0,this._defaultGamma=void 0,this._defaultMinificationFilter=void 0,this._defaultMagnificationFilter=void 0;let i=ve.createIfNeeded(e.url??"https://{s}.tiles.mapbox.com/v4/");this._mapId=t,this._accessToken=n;let o=e.format??"png";/\./.test(o)||(o=`.${o}`),this._format=o;let r=i.getUrlComponent();Rct.test(r)||(r+="/"),r+=`${t}/{z}/{x}/{y}${this._format}`,i.url=r,i.setQueryParameters({access_token:n});let s;l(e.credit)?(s=e.credit,typeof s=="string"&&(s=new Lt(s))):s=xSe,this._resource=i,this._imageryProvider=new Rs({url:i,credit:s,ellipsoid:e.ellipsoid,minimumLevel:e.minimumLevel,maximumLevel:e.maximumLevel,rectangle:e.rectangle})}Object.defineProperties(pV.prototype,{url:{get:function(){return this._imageryProvider.url}},rectangle:{get:function(){return this._imageryProvider.rectangle}},tileWidth:{get:function(){return this._imageryProvider.tileWidth}},tileHeight:{get:function(){return this._imageryProvider.tileHeight}},maximumLevel:{get:function(){return this._imageryProvider.maximumLevel}},minimumLevel:{get:function(){return this._imageryProvider.minimumLevel}},tilingScheme:{get:function(){return this._imageryProvider.tilingScheme}},tileDiscardPolicy:{get:function(){return this._imageryProvider.tileDiscardPolicy}},errorEvent:{get:function(){return this._imageryProvider.errorEvent}},credit:{get:function(){return this._imageryProvider.credit}},proxy:{get:function(){return this._imageryProvider.proxy}},hasAlphaChannel:{get:function(){return this._imageryProvider.hasAlphaChannel}}});pV.prototype.getTileCredits=function(e,t,n){};pV.prototype.requestImage=function(e,t,n,i){return this._imageryProvider.requestImage(e,t,n,i)};pV.prototype.pickFeatures=function(e,t,n,i,o){return this._imageryProvider.pickFeatures(e,t,n,i,o)};pV._defaultCredit=xSe;var jX=pV;var v0i=x(T(),1);function PS(e){e=e??B.EMPTY_OBJECT,this._defaultAlpha=void 0,this._defaultNightAlpha=void 0,this._defaultDayAlpha=void 0,this._defaultBrightness=void 0,this._defaultContrast=void 0,this._defaultHue=void 0,this._defaultSaturation=void 0,this._defaultGamma=void 0,this._defaultMinificationFilter=void 0,this._defaultMagnificationFilter=void 0;let t=e.rectangle??re.MAX_VALUE,n=new eo({rectangle:t,numberOfLevelZeroTilesX:1,numberOfLevelZeroTilesY:1,ellipsoid:e.ellipsoid});this._tilingScheme=n,this._image=void 0,this._texture=void 0,this._hasError=!1,this._errorEvent=new Se;let i=e.credit;typeof i=="string"&&(i=new Lt(i)),this._credit=i;let o=ve.createIfNeeded(e.url);this._resource=o,this._tileWidth=e.tileWidth,this._tileHeight=e.tileHeight}Object.defineProperties(PS.prototype,{url:{get:function(){return this._resource.url}},proxy:{get:function(){return this._resource.proxy}},tileWidth:{get:function(){return this._tileWidth}},tileHeight:{get:function(){return this._tileHeight}},maximumLevel:{get:function(){return 0}},minimumLevel:{get:function(){return 0}},tilingScheme:{get:function(){return this._tilingScheme}},rectangle:{get:function(){return this._tilingScheme.rectangle}},tileDiscardPolicy:{get:function(){}},errorEvent:{get:function(){return this._errorEvent}},credit:{get:function(){return this._credit}},hasAlphaChannel:{get:function(){return!0}}});function Cct(e,t,n,i){let o=`Failed to load image ${e.url}`;l(t)&&l(t.message)&&(o+=`: ${t.message}`);let r=tr.reportError(i,n,l(n)?n._errorEvent:void 0,o,0,0,0,t);if(r.retry)return Iq(e,n,r);throw l(n)&&(n._hasError=!0),new ae(o)}async function Iq(e,t,n){try{return await ku.loadImage(null,e)}catch(i){return Cct(e,i,t,n)}}PS.fromUrl=async function(e,t){let n=ve.createIfNeeded(e),i=await Iq(n);t=t??B.EMPTY_OBJECT;let o=new PS({...t,url:e,tileWidth:i.width,tileHeight:i.height});return o._image=i,o};PS.prototype.getTileCredits=function(e,t,n){};PS.prototype.requestImage=async function(e,t,n,i){if(!this._hasError&&!l(this._image)){let o=await Iq(this._resource,this);return this._image=o,tr.reportSuccess(this._errorEvent),o}return this._image};PS.prototype.pickFeatures=function(e,t,n,i,o){};var QX=PS;var nbi=x(T(),1);var Y0i=x(T(),1);function Vct(e,t,n){this.type=e,l(t)||(e==="json"?t="application/json":e==="xml"?t="text/xml":e==="html"?t="text/html":e==="text"&&(t="text/plain")),this.format=t,l(n)||(e==="json"?n=Ect:e==="xml"?n=Wct:(e==="html"||e==="text")&&(n=TSe)),this.callback=n}function Ect(e){let t=[],n=e.features;for(let i=0;i<n.length;++i){let o=n[i],r=new Rf;if(r.data=o,r.properties=o.properties,r.configureNameFromProperties(o.properties),r.configureDescriptionFromProperties(o.properties),l(o.geometry)&&o.geometry.type==="Point"){let s=o.geometry.coordinates[0],a=o.geometry.coordinates[1];r.position=pe.fromDegrees(s,a)}t.push(r)}return t}var Pq="http://www.mapinfo.com/mxp",Act="http://www.esri.com/wms",Gct="http://www.opengis.net/wfs",Lct="http://www.opengis.net/gml";function Wct(e){let t=e.documentElement;if(t.localName==="MultiFeatureCollection"&&t.namespaceURI===Pq)return vct(e);if(t.localName==="FeatureInfoResponse"&&t.namespaceURI===Act)return Fct(e);if(t.localName==="FeatureCollection"&&t.namespaceURI===Gct)return Ict(e);if(t.localName==="ServiceExceptionReport")throw new ae(new XMLSerializer().serializeToString(t));return t.localName==="msGMLOutput"?Pct(e):Xct(e)}function vct(e){let t=[],i=e.documentElement.getElementsByTagNameNS(Pq,"Feature");for(let o=0;o<i.length;++o){let r=i[o],s={},a=r.getElementsByTagNameNS(Pq,"Val");for(let d=0;d<a.length;++d){let u=a[d];if(u.hasAttribute("ref")){let m=u.getAttribute("ref"),p=u.textContent.trim();s[m]=p}}let c=new Rf;c.data=r,c.properties=s,c.configureNameFromProperties(s),c.configureDescriptionFromProperties(s),t.push(c)}return t}function Fct(e){let t=e.documentElement,n=[],i,o=t.getElementsByTagNameNS("*","FIELDS");if(o.length>0)for(let r=0;r<o.length;++r){let s=o[r];i={};let a=s.attributes;for(let c=0;c<a.length;++c){let d=a[c];i[d.name]=d.value}n.push(DB(s,i))}else{let r=t.getElementsByTagNameNS("*","FeatureInfo");for(let s=0;s<r.length;++s){let a=r[s];i={};let c=a.childNodes;for(let d=0;d<c.length;++d){let u=c[d];u.nodeType===Node.ELEMENT_NODE&&(i[u.localName]=u.textContent)}n.push(DB(a,i))}}return n}function Ict(e){let t=[],i=e.documentElement.getElementsByTagNameNS(Lct,"featureMember");for(let o=0;o<i.length;++o){let r=i[o],s={};Xq(r,s),t.push(DB(r,s))}return t}function Pct(e){let t=[],n,i=e.documentElement.childNodes;for(let r=0;r<i.length;r++)if(i[r].nodeType===Node.ELEMENT_NODE){n=i[r];break}if(!l(n))throw new ae("Unable to find first child of the feature info xml document");let o=n.childNodes;for(let r=0;r<o.length;++r){let s=o[r];if(s.nodeType===Node.ELEMENT_NODE){let a={};Xq(s,a),t.push(DB(s,a))}}return t}function Xq(e,t){let n=!0;for(let i=0;i<e.childNodes.length;++i){let o=e.childNodes[i];o.nodeType===Node.ELEMENT_NODE&&(n=!1),!(o.localName==="Point"||o.localName==="LineString"||o.localName==="Polygon"||o.localName==="boundedBy")&&o.hasChildNodes()&&Xq(o,t)&&(t[o.localName]=o.textContent)}return n}function DB(e,t){let n=new Rf;return n.data=e,n.properties=t,n.configureNameFromProperties(t),n.configureDescriptionFromProperties(t),n}function Xct(e){let t=new XMLSerializer().serializeToString(e),n=document.createElement("div"),i=document.createElement("pre");i.textContent=t,n.appendChild(i);let o=new Rf;return o.data=e,o.description=n.innerHTML,[o]}var Nct=/<body>\s*<\/body>/im,Yct=/<ServiceExceptionReport([\s\S]*)<\/ServiceExceptionReport>/im,Mct=/<title>([\s\S]*)<\/title>/im;function TSe(e){if(Nct.test(e)||Yct.test(e))return;let t,n=Mct.exec(e);n&&n.length>1&&(t=n[1]);let i=new Rf;return i.name=t,i.description=e,i.data=e,[i]}var Vf=Vct;var B0i=x(T(),1);function qX(e){e=e??B.EMPTY_OBJECT,this._tileCache={},this._tilesRequestedForInterval=[];let t=this._clock=e.clock;this._times=e.times,this._requestImageFunction=e.requestImageFunction,this._reloadFunction=e.reloadFunction,this._currentIntervalIndex=-1,t.onTick.addEventListener(this._clockOnTick,this),this._clockOnTick(t)}Object.defineProperties(qX.prototype,{clock:{get:function(){return this._clock},set:function(e){this._clock!==e&&(this._clock=e,this._clockOnTick(e),this._reloadFunction())}},times:{get:function(){return this._times},set:function(e){this._times!==e&&(this._times=e,this._clockOnTick(this._clock),this._reloadFunction())}},currentInterval:{get:function(){return this._times.get(this._currentIntervalIndex)}}});qX.prototype.getFromCache=function(e,t,n,i){let o=_Se(e,t,n),r,s=this._tileCache[this._currentIntervalIndex];if(l(s)&&l(s[o])){let a=s[o];r=a.promise.catch(function(c){throw i.state=a.request.state,c}),delete s[o]}return r};qX.prototype.checkApproachingInterval=function(e,t,n,i){let o=_Se(e,t,n),r=this._tilesRequestedForInterval,s=SSe(this),a={key:o,priorityFunction:i.priorityFunction};(!l(s)||!ZSe(this,a,s))&&r.push(a),r.length>=512&&r.splice(0,256)};qX.prototype._clockOnTick=function(e){let t=e.currentTime,i=this._times.indexOf(t),o=this._currentIntervalIndex;if(i!==o){let s=this._tileCache[o];for(let a in s)s.hasOwnProperty(a)&&s[a].request.cancel();delete this._tileCache[o],this._tilesRequestedForInterval=[],this._currentIntervalIndex=i,this._reloadFunction();return}let r=SSe(this);if(l(r)){let s=this._tilesRequestedForInterval,a=!0;for(;a&&s.length!==0;){let c=s.pop();a=ZSe(this,c,r),a||s.push(c)}}};function _Se(e,t,n){return`${e}-${t}-${n}`}function wct(e){let t=e.split("-");if(t.length===3)return{x:Number(t[0]),y:Number(t[1]),level:Number(t[2])}}function SSe(e){let t=e._times;if(!l(t))return;let n=e._clock,i=n.currentTime,o=n.canAnimate&&n.shouldAnimate,r=n.multiplier;if(!o&&r!==0)return;let s,a=t.indexOf(i);if(a<0)return;let c=t.get(a);return r>0?(s=Q.secondsDifference(c.stop,i),++a):(s=Q.secondsDifference(c.start,i),--a),s/=r,a>=0&&s<=5?t.get(a):void 0}function ZSe(e,t,n){let i=e._times.indexOf(n.start),o=e._tileCache,r=o[i];l(r)||(r=o[i]={});let s=t.key;if(l(r[s]))return!0;let a=wct(s),c=new Ar({throttle:!1,throttleByServer:!0,type:js.IMAGERY,priorityFunction:t.priorityFunction}),d=e._requestImageFunction(a.x,a.y,a.level,c,n);return l(d)?(r[s]={promise:d,request:c},!0):!1}var XS=qX;var kct=[3034,3035,3042,3043,3044],Uct=[4471,4559];function Ef(e){if(e=e??B.EMPTY_OBJECT,l(e.times)&&!l(e.clock))throw new ge("options.times was specified, so options.clock is required.");this._defaultAlpha=void 0,this._defaultNightAlpha=void 0,this._defaultDayAlpha=void 0,this._defaultBrightness=void 0,this._defaultContrast=void 0,this._defaultHue=void 0,this._defaultSaturation=void 0,this._defaultGamma=void 0,this._defaultMinificationFilter=void 0,this._defaultMagnificationFilter=void 0,this._getFeatureInfoUrl=e.getFeatureInfoUrl??e.url;let t=ve.createIfNeeded(e.url),n=ve.createIfNeeded(this._getFeatureInfoUrl);t.setQueryParameters(Ef.DefaultParameters,!0),n.setQueryParameters(Ef.GetFeatureInfoDefaultParameters,!0),l(e.parameters)&&t.setQueryParameters(RSe(e.parameters)),l(e.getFeatureInfoParameters)&&n.setQueryParameters(RSe(e.getFeatureInfoParameters));let i=this;this._reload=void 0,l(e.times)&&(this._timeDynamicImagery=new XS({clock:e.clock,times:e.times,requestImageFunction:function(s,a,c,d,u){return CSe(i,s,a,c,d,u)},reloadFunction:function(){l(i._reload)&&i._reload()}}));let o={};if(o.layers=e.layers,o.bbox="{westProjected},{southProjected},{eastProjected},{northProjected}",o.width="{width}",o.height="{height}",parseFloat(t.queryParameters.version)>=1.3){o.crs=e.crs??(e.tilingScheme&&e.tilingScheme.projection instanceof Ti?"EPSG:3857":"CRS:84");let s=o.crs.split(":");if(s[0]==="EPSG"&&s.length===2){let a=Number(s[1]);(a>=4e3&&a<5e3&&!Uct.includes(a)||kct.includes(a))&&(o.bbox="{southProjected},{westProjected},{northProjected},{eastProjected}")}}else o.srs=e.srs??(e.tilingScheme&&e.tilingScheme.projection instanceof Ti?"EPSG:3857":"EPSG:4326");t.setQueryParameters(o,!0),n.setQueryParameters(o,!0);let r={query_layers:e.layers,info_format:"{format}"};parseFloat(n.queryParameters.version)>=1.3?(r.i="{i}",r.j="{j}"):(r.x="{i}",r.y="{j}"),n.setQueryParameters(r,!0),this._resource=t,this._pickFeaturesResource=n,this._layers=e.layers,this._tileProvider=new Rs({url:t,pickFeaturesUrl:n,tilingScheme:e.tilingScheme??new eo({ellipsoid:e.ellipsoid}),rectangle:e.rectangle,tileWidth:e.tileWidth,tileHeight:e.tileHeight,minimumLevel:e.minimumLevel,maximumLevel:e.maximumLevel,subdomains:e.subdomains,tileDiscardPolicy:e.tileDiscardPolicy,credit:e.credit,getFeatureInfoFormats:e.getFeatureInfoFormats??Ef.DefaultGetFeatureInfoFormats,enablePickFeatures:e.enablePickFeatures})}function CSe(e,t,n,i,o,r){let s=l(r)?r.data:void 0,a=e._tileProvider;return l(s)&&a._resource.setQueryParameters(s),a.requestImage(t,n,i,o)}function Dct(e,t,n,i,o,r,s){let a=l(s)?s.data:void 0,c=e._tileProvider;return l(a)&&c._pickFeaturesResource.setQueryParameters(a),c.pickFeatures(t,n,i,o,r)}Object.defineProperties(Ef.prototype,{url:{get:function(){return this._resource._url}},proxy:{get:function(){return this._resource.proxy}},layers:{get:function(){return this._layers}},tileWidth:{get:function(){return this._tileProvider.tileWidth}},tileHeight:{get:function(){return this._tileProvider.tileHeight}},maximumLevel:{get:function(){return this._tileProvider.maximumLevel}},minimumLevel:{get:function(){return this._tileProvider.minimumLevel}},tilingScheme:{get:function(){return this._tileProvider.tilingScheme}},rectangle:{get:function(){return this._tileProvider.rectangle}},tileDiscardPolicy:{get:function(){return this._tileProvider.tileDiscardPolicy}},errorEvent:{get:function(){return this._tileProvider.errorEvent}},credit:{get:function(){return this._tileProvider.credit}},hasAlphaChannel:{get:function(){return this._tileProvider.hasAlphaChannel}},enablePickFeatures:{get:function(){return this._tileProvider.enablePickFeatures},set:function(e){this._tileProvider.enablePickFeatures=e}},clock:{get:function(){return this._timeDynamicImagery.clock},set:function(e){this._timeDynamicImagery.clock=e}},times:{get:function(){return this._timeDynamicImagery.times},set:function(e){this._timeDynamicImagery.times=e}},getFeatureInfoUrl:{get:function(){return this._getFeatureInfoUrl}}});Ef.prototype.getTileCredits=function(e,t,n){return this._tileProvider.getTileCredits(e,t,n)};Ef.prototype.requestImage=function(e,t,n,i){let o,r=this._timeDynamicImagery,s;return l(r)&&(s=r.currentInterval,o=r.getFromCache(e,t,n,i)),l(o)||(o=CSe(this,e,t,n,i,s)),l(o)&&l(r)&&r.checkApproachingInterval(e,t,n,i),o};Ef.prototype.pickFeatures=function(e,t,n,i,o){let r=this._timeDynamicImagery,s=l(r)?r.currentInterval:void 0;return Dct(this,e,t,n,i,o,s)};Ef.DefaultParameters=Object.freeze({service:"WMS",version:"1.1.1",request:"GetMap",styles:"",format:"image/jpeg"});Ef.GetFeatureInfoDefaultParameters=Object.freeze({service:"WMS",version:"1.1.1",request:"GetFeatureInfo"});Ef.DefaultGetFeatureInfoFormats=Object.freeze([Object.freeze(new Vf("json","application/json")),Object.freeze(new Vf("xml","text/xml")),Object.freeze(new Vf("text","text/html"))]);function RSe(e){let t={};for(let n in e)e.hasOwnProperty(n)&&(t[n.toLowerCase()]=e[n]);return t}var $X=Ef;var hbi=x(T(),1);function Du(e){e=e??B.EMPTY_OBJECT,this._defaultAlpha=void 0,this._defaultNightAlpha=void 0,this._defaultDayAlpha=void 0,this._defaultBrightness=void 0,this._defaultContrast=void 0,this._defaultHue=void 0,this._defaultSaturation=void 0,this._defaultGamma=void 0,this._defaultMinificationFilter=void 0,this._defaultMagnificationFilter=void 0,this._getFeatureInfoUrl=e.getFeatureInfoUrl??e.url;let t=ve.createIfNeeded(e.url),n=ve.createIfNeeded(this._getFeatureInfoUrl),i=e.style,o=e.tileMatrixSetID,r=t.url,s=e.format??"image/jpeg",a=r.match(/{/g);if(!l(a)||a.length===1&&/{s}/.test(r)?(t.setQueryParameters(Du.DefaultParameters,!0),this._useKvp=!0):(t.setTemplateValues(Du.DefaultParameters,!0),this._useKvp=!1),this._useKvp){n.setQueryParameters(Du.GetFeatureInfoDefaultParameters,!0),l(e.getFeatureInfoParameters)&&n.setQueryParameters(VSe(e.getFeatureInfoParameters));let u={infoformat:"{format}",i:"{i}",j:"{j}"};n.setQueryParameters(u,!0)}else n.setTemplateValues(Du.GetFeatureInfoDefaultParameters,!0),l(e.getFeatureInfoParameters)&&n.setTemplateValues(VSe(e.getFeatureInfoParameters));this._resource=t,this._tileMatrixLabels=e.tileMatrixLabels,this._format=s,this._dimensions=e.dimensions,this._tilematrixset=o;let c={};c.tilematrix="{TileMatrix}",c.layer=e.layer,c.style=i,c.tilerow="{TileRow}",c.tilecol="{TileCol}",c.tilematrixset=o,this._useKvp?(t.setQueryParameters(c,!0),t.setQueryParameters({format:s},!0),n.setQueryParameters({format:s},!0),n.setQueryParameters(c,!0)):(c.Style=i,t.setTemplateValues(c),t.setTemplateValues({format:s}),n.setTemplateValues(c));let d=this;this._reload=void 0,l(e.times)&&(this._timeDynamicImagery=new XS({clock:e.clock,times:e.times,requestImageFunction:function(u,m,p,b,f){return ESe(d,u,m,p,b,f)},reloadFunction:function(){l(d._reload)&&d._reload()}})),this._errorEvent=new Se,this._tileProvider=new Rs({url:t,pickFeaturesUrl:n,tilingScheme:e.tilingScheme??new Nr({ellipsoid:e.ellipsoid}),rectangle:e.rectangle,tileWidth:e.tileWidth,tileHeight:e.tileHeight,minimumLevel:e.minimumLevel,maximumLevel:e.maximumLevel,subdomains:e.subdomains,tileDiscardPolicy:e.tileDiscardPolicy,credit:e.credit,getFeatureInfoFormats:e.getFeatureInfoFormats??Du.DefaultGetFeatureInfoFormats,enablePickFeatures:e.enablePickFeatures??(this._useKvp||l(e.getFeatureInfoUrl)),customTags:Bct(this)})}function ESe(e,t,n,i,o,r){let s=e._tileProvider;return ASe(e,s._resource,r),s.requestImage(t,n,i,o)}function Oct(e,t,n,i,o,r,s){let a=e._tileProvider;return ASe(e,a._pickFeaturesResource,s),a.pickFeatures(t,n,i,o,r)}Object.defineProperties(Du.prototype,{url:{get:function(){return this._resource.url}},proxy:{get:function(){return this._resource.proxy}},tileWidth:{get:function(){return this._tileProvider.tileWidth}},tileHeight:{get:function(){return this._tileProvider.tileHeight}},maximumLevel:{get:function(){return this._tileProvider.maximumLevel}},minimumLevel:{get:function(){return this._tileProvider.minimumLevel}},tilingScheme:{get:function(){return this._tileProvider.tilingScheme}},rectangle:{get:function(){return this._tileProvider.rectangle}},tileDiscardPolicy:{get:function(){return this._tileProvider.tileDiscardPolicy}},errorEvent:{get:function(){return this._tileProvider.errorEvent}},format:{get:function(){return this._format}},credit:{get:function(){return this._tileProvider.credit}},hasAlphaChannel:{get:function(){return!0}},enablePickFeatures:{get:function(){return this._tileProvider.enablePickFeatures},set:function(e){this._tileProvider.enablePickFeatures=e}},clock:{get:function(){return this._timeDynamicImagery.clock},set:function(e){this._timeDynamicImagery.clock=e}},times:{get:function(){return this._timeDynamicImagery.times},set:function(e){this._timeDynamicImagery.times=e}},dimensions:{get:function(){return this._dimensions},set:function(e){this._dimensions!==e&&(this._dimensions=e,l(this._reload)&&this._reload())}},getFeatureInfoUrl:{get:function(){return this._getFeatureInfoUrl}}});Du.prototype.getTileCredits=function(e,t,n){return this._tileProvider.getTileCredits(e,t,n)};Du.prototype.requestImage=function(e,t,n,i){let o,r=this._timeDynamicImagery,s;return l(r)&&(s=r.currentInterval,o=r.getFromCache(e,t,n,i)),l(o)||(o=ESe(this,e,t,n,i,s)),l(o)&&l(r)&&r.checkApproachingInterval(e,t,n,i),o};Du.prototype.pickFeatures=function(e,t,n,i,o){let r=this._timeDynamicImagery,s=l(r)?r.currentInterval:void 0;return Oct(this,e,t,n,i,o,s)};Du.DefaultParameters=Object.freeze({service:"WMTS",version:"1.0.0",request:"GetTile"});Du.GetFeatureInfoDefaultParameters=Object.freeze({service:"WMTS",version:"1.0.0",request:"GetFeatureInfo"});Du.DefaultGetFeatureInfoFormats=Object.freeze([Object.freeze(new Vf("json","application/json")),Object.freeze(new Vf("xml","text/xml")),Object.freeze(new Vf("text","text/html"))]);function ASe(e,t,n){let i=e._dimensions,o=l(n)?n.data:void 0;if(!e._useKvp)l(i)&&t.setTemplateValues(i),l(o)&&t.setTemplateValues(o);else{let r={};l(i)&&(r=It(r,i)),l(o)&&(r=It(r,o)),t.setQueryParameters(r)}}function Bct(e){function t(n){let i=e._tileMatrixLabels;return l(i)?i[n]:n.toString()}return{TileMatrix:function(n,i,o,r){return t(r)},tilematrix:function(n,i,o,r){return t(r)},TileRow:function(n,i,o){return o.toString()},tilerow:function(n,i,o){return o.toString()},TileCol:function(n,i,o){return i.toString()},tilecol:function(n,i,o){return i.toString()},TileMatrixSet:function(n){return e._tilematrixset},tilematrixset:function(n){return e._tilematrixset}}}function VSe(e){let t={};for(let n in e)e.hasOwnProperty(n)&&(t[n.toLowerCase()]=e[n]);return t}var eN=Du;var Ebi=x(T(),1);var gbi=x(T(),1);var bV={};bV.defaultApiKey=void 0;bV.mapTilesApiEndpoint=new ve({url:"https://tile.googleapis.com/"});bV.defaultStreetViewStaticApiKey=void 0;bV.streetViewStaticApiEndpoint=new ve({url:"https://maps.googleapis.com/maps/api/streetview"});bV.getDefaultCredit=function(){return new Lt('<img alt="Google" src="https://assets.ion.cesium.com/google-credit.png" style="vertical-align:-6px">',!0)};var Ra=bV;var GSe=/\/$/;function ng(e){e=e??B.EMPTY_OBJECT,this._maximumLevel=e.maximumLevel??22,this._minimumLevel=e.minimumLevel??0,this._session=e.session,this._key=e.key,this._tileWidth=e.tileWidth,this._tileHeight=e.tileHeight;let t=e.url instanceof zr?e.url:ve.createIfNeeded(e.url??Ra.mapTilesApiEndpoint),n=t.getUrlComponent();GSe.test(n)||(n+="/");let i=`${n}v1/2dtiles/{z}/{x}/{y}`;this._viewportUrl=`${n}tile/v1/viewport`,t.url=i,t.setQueryParameters({session:encodeURIComponent(e.session),key:encodeURIComponent(e.key)}),this._resource=t.clone();let o;l(e.credit)&&(o=e.credit,typeof o=="string"&&(o=new Lt(o)));let r=new Rs({url:t,credit:o,tileWidth:e.tileWidth,tileHeight:e.tileHeight,ellipsoid:e.ellipsoid,rectangle:e.rectangle,maximumLevel:this._maximumLevel,minimumLevel:this._minimumLevel});r._resource=t,this._imageryProvider=r,this._tileCredits=t.credits,this._attributionsByLevel=void 0}Object.defineProperties(ng.prototype,{url:{get:function(){return this._imageryProvider.url}},rectangle:{get:function(){return this._imageryProvider.rectangle}},tileWidth:{get:function(){return this._imageryProvider.tileWidth}},tileHeight:{get:function(){return this._imageryProvider.tileHeight}},maximumLevel:{get:function(){return this._imageryProvider.maximumLevel}},minimumLevel:{get:function(){return this._imageryProvider.minimumLevel}},tilingScheme:{get:function(){return this._imageryProvider.tilingScheme}},tileDiscardPolicy:{get:function(){return this._imageryProvider.tileDiscardPolicy}},errorEvent:{get:function(){return this._imageryProvider.errorEvent}},credit:{get:function(){return this._imageryProvider.credit}},proxy:{get:function(){return this._imageryProvider.proxy}},hasAlphaChannel:{get:function(){return this._imageryProvider.hasAlphaChannel}}});ng.fromIonAssetId=async function(e){e=e??{},e.mapType=e.mapType??"satellite",e.language=e.language??"en_US",e.region=e.region??"US";let t=e.overlayLayerType,n=LSe(e),i=zr._createEndpointResource(e.assetId,{queryParameters:{options:JSON.stringify(n)}}),o={language:e.language,region:e.region,ellipsoid:e.ellipsoid,minimumLevel:e.minimumLevel,maximumLevel:e.maximumLevel,rectangle:e.rectangle,credit:e.credit},r=await i.fetchJson(),s=r.options.url;return delete r.options.url,r.options={...r.options,...o},Nq(s,r,i)};ng.fromUrl=async function(e){e=e??{},e.mapType=e.mapType??"satellite",e.language=e.language??"en_US",e.region=e.region??"US",e.url=e.url??Ra.mapTilesApiEndpoint,e.key=e.key??Ra.defaultApiKey;let t=e.overlayLayerType,n=await Hct(e);return new ng({...n,...e,credit:e.credit??Ra.getDefaultCredit()})};ng.prototype.getTileCredits=function(e,t,n){if(!l(this._attributionsByLevel)||!l(this._tileCredits))return;let o=this._attributionsByLevel.get(n);return l(this._tileCredits)?this._tileCredits.concat(o):o};ng.prototype.requestImage=function(e,t,n,i){let o=this._imageryProvider.requestImage(e,t,n,i);if(l(o))return l(this._attributionsByLevel)?o:Promise.all([o,this.getViewportCredits()]).then(r=>r[0])};ng.prototype.pickFeatures=function(e,t,n,i,o){};ng.prototype.getViewportCredits=async function(){let e=this._maximumLevel,t=[];for(let o=0;o<e+1;o++)t.push(zct(this._resource,this._viewportUrl,o));let n=await Promise.all(t),i=new Map;for(let o=0;o<e+1;o++){let r=[],s=n[o];if(s){let a=new Lt(s);r.push(a)}i.set(o,r)}return this._attributionsByLevel=i,i};async function zct(e,t,n){return(await e.getDerivedResource({url:t,queryParameters:{zoom:n,north:90,south:-90,east:180,west:-180},data:JSON.stringify(B.EMPTY_OBJECT)}).fetchJson()).copyright}function LSe(e){let{mapType:t,overlayLayerType:n,styles:i}=e,o={mapType:t,overlay:!1};return t==="terrain"&&!l(n)&&(o.layerTypes=["layerRoadmap"]),l(n)&&(o.mapType="satellite",o.overlay=!0,o.layerTypes=[n]),l(i)&&(o.styles=i),o}async function Hct(e){let{language:t,region:n,key:i,url:o}=e,r=LSe(e),s=o.url??o;GSe.test(s)||(s+="/");let a=await ve.post({url:`${s}v1/createSession`,queryParameters:{key:i},data:JSON.stringify({...r,language:t,region:n})});return JSON.parse(a)}var tN=ng;var Pbi=x(T(),1);var Kct=/\/$/;function gV(e){e=e??{};let t=e.tilesetId??"microsoft.imagery";this._maximumLevel=e.maximumLevel??22,this._minimumLevel=e.minimumLevel??0,this._subscriptionKey=e.subscriptionKey??e["subscription-key"],this._tilesetId=e.tilesetId;let n=e.url instanceof zr?e.url:ve.createIfNeeded(e.url??"https://atlas.microsoft.com/"),i=n.getUrlComponent();Kct.test(i)||(i+="/");let o=`${i}map/tile`;this._viewportUrl=`${i}map/attribution`,n.url=o,n.setQueryParameters({"api-version":"2024-04-01",tilesetId:t,"subscription-key":this._subscriptionKey,zoom:"{z}",x:"{x}",y:"{y}"}),this._resource=n;let r;l(e.credit)&&(r=e.credit,typeof r=="string"&&(r=new Lt(r)));let s=new Rs({...e,maximumLevel:this._maximumLevel,minimumLevel:this._minimumLevel,url:n,credit:r});s._resource=n,this._imageryProvider=s,this._tileCredits=n.credits,this._attributionsByLevel=void 0}Object.defineProperties(gV.prototype,{url:{get:function(){return this._imageryProvider.url}},rectangle:{get:function(){return this._imageryProvider.rectangle}},tileWidth:{get:function(){return this._imageryProvider.tileWidth}},tileHeight:{get:function(){return this._imageryProvider.tileHeight}},maximumLevel:{get:function(){return this._imageryProvider.maximumLevel}},minimumLevel:{get:function(){return this._imageryProvider.minimumLevel}},tilingScheme:{get:function(){return this._imageryProvider.tilingScheme}},tileDiscardPolicy:{get:function(){return this._imageryProvider.tileDiscardPolicy}},errorEvent:{get:function(){return this._imageryProvider.errorEvent}},credit:{get:function(){return this._imageryProvider.credit}},proxy:{get:function(){return this._imageryProvider.proxy}},hasAlphaChannel:{get:function(){return this._imageryProvider.hasAlphaChannel}}});gV.prototype.getTileCredits=function(e,t,n){if(!l(this._attributionsByLevel)||!l(this._tileCredits))return;let o=this._attributionsByLevel.get(n);return l(this._tileCredits)?this._tileCredits.concat(o):o};gV.prototype.requestImage=function(e,t,n,i){let o=this._imageryProvider.requestImage(e,t,n,i);if(l(o))return l(this._attributionsByLevel)?o:Promise.all([o,this.getViewportCredits()]).then(r=>r[0])};gV.prototype.pickFeatures=function(e,t,n,i,o){};gV.prototype.getViewportCredits=async function(){let e=this._maximumLevel,t=[];for(let o=0;o<e+1;o++)t.push(Jct(this._resource,this._viewportUrl,this._subscriptionKey,this._tilesetId,o));let n=await Promise.all(t),i=new Map;for(let o=0;o<e+1;o++){let r=[],s=n[o].join(",");if(s){let a=new Lt(s);r.push(a)}i.set(o,r)}return this._attributionsByLevel=i,i};async function Jct(e,t,n,i,o){return(await e.getDerivedResource({url:t,queryParameters:{zoom:o,bounds:"-180,-90,180,90"},data:JSON.stringify(B.EMPTY_OBJECT)}).fetchJson()).copyrights}var nN=gV;var jct=async(e,t,n)=>Cx.fromUrl(new zr(t,n)),Qct=async(e,{options:t})=>tg.fromUrl(e,t),qct=async(e,{options:t})=>zX.fromUrl(e,t),$ct=async(e,{options:t})=>{let n=t.channel;return delete t.channel,JX.fromUrl(e,n,t)},elt=async(e,{options:t})=>new jX({url:e,...t}),tlt=async(e,{options:t})=>QX.fromUrl(e,t),nlt=async(e,{options:t})=>Cx.fromUrl(e,t),ilt=async(e,{options:t})=>new Rs({url:e,...t}),olt=async(e,{options:t})=>new $X({url:e,...t}),rlt=async(e,{options:t})=>new eN({url:e,...t}),Nq=async(e,t,n)=>{delete t.externalType,t.url=e;let i=new zr(t,n),o=(r,s)=>{delete s.externalType,s.url=e;let{options:a}=s;r.setQueryParameters({session:a.session,key:a.key})};return i.refreshCallback=o,new tN({...t.options,url:i})},slt=async(e,t,n)=>{delete t.externalType,t.url=e;let i=new zr(t,n),o=(r,s)=>{delete s.externalType,s.url=e;let{options:a}=s;r.setQueryParameters({"subscription-key":a["subscription-key"]})};return i.refreshCallback=o,new nN({...t.options,url:i})},alt={ARCGIS_MAPSERVER:Qct,BING:qct,GOOGLE_EARTH:$ct,MAPBOX:elt,SINGLE_TILE:tlt,TMS:nlt,URL_TEMPLATE:ilt,WMS:olt,WMTS:rlt,GOOGLE_2D_MAPS:Nq,AZURE_MAPS:slt,defaultFactoryCallback:jct},yV=Object.freeze(alt);function qp(){this._defaultAlpha=void 0,this._defaultNightAlpha=void 0,this._defaultDayAlpha=void 0,this._defaultBrightness=void 0,this._defaultContrast=void 0,this._defaultHue=void 0,this._defaultSaturation=void 0,this._defaultGamma=void 0,this._defaultMinificationFilter=void 0,this._defaultMagnificationFilter=void 0,this._tileCredits=void 0,this._errorEvent=new Se}Object.defineProperties(qp.prototype,{rectangle:{get:function(){return this._imageryProvider.rectangle}},tileWidth:{get:function(){return this._imageryProvider.tileWidth}},tileHeight:{get:function(){return this._imageryProvider.tileHeight}},maximumLevel:{get:function(){return this._imageryProvider.maximumLevel}},minimumLevel:{get:function(){return this._imageryProvider.minimumLevel}},tilingScheme:{get:function(){return this._imageryProvider.tilingScheme}},tileDiscardPolicy:{get:function(){return this._imageryProvider.tileDiscardPolicy}},errorEvent:{get:function(){return this._errorEvent}},credit:{get:function(){return this._imageryProvider.credit}},hasAlphaChannel:{get:function(){return this._imageryProvider.hasAlphaChannel}},proxy:{get:function(){}}});qp.fromAssetId=async function(e,t){t=t??B.EMPTY_OBJECT;let n=zr._createEndpointResource(e,t),i=e.toString()+t.accessToken+t.server,o=qp._endpointCache[i];l(o)||(o=n.fetchJson(),qp._endpointCache[i]=o);let r=await o;if(r.type!=="IMAGERY")throw new ae(`Cesium ion asset ${e} is not an imagery asset.`);let s=r.externalType,a=yV.defaultFactoryCallback;r=$e(r,!0),r.options=r.options??{};let c=r.options?.url;if(delete t.url,l(s)&&(a=yV[s],!l(a)))throw new ae(`Unrecognized Cesium ion imagery type: ${s}`);let d=await a(c,r,n),u=new qp(t);return d.errorEvent.addEventListener(function(m){m.provider=u,u._errorEvent.raiseEvent(m)}),u._tileCredits=zr.getCreditsFromEndpoint(r,n),u._imageryProvider=d,u};qp.prototype.getTileCredits=function(e,t,n){let i=this._imageryProvider.getTileCredits(e,t,n);return l(i)?this._tileCredits.concat(i):this._tileCredits};qp.prototype.requestImage=function(e,t,n,i){return this._imageryProvider.requestImage(e,t,n,i)};qp.prototype.pickFeatures=function(e,t,n,i,o){return this._imageryProvider.pickFeatures(e,t,n,i,o)};qp._endpointCache={};var sd=qp;var sgi=x(T(),1),WSe={AERIAL:2,AERIAL_WITH_LABELS:3,ROAD:4};Object.freeze(WSe);var ig=WSe;function clt(e){e=e??B.EMPTY_OBJECT;let t=e.style??ig.AERIAL;return sd.fromAssetId(t)}var og=clt;var ggi=x(T(),1);function Us(){ge.throwInstantiationError()}Object.defineProperties(Us.prototype,{errorEvent:{get:ge.throwInstantiationError},credit:{get:ge.throwInstantiationError},tilingScheme:{get:ge.throwInstantiationError},hasWaterMask:{get:ge.throwInstantiationError},hasVertexNormals:{get:ge.throwInstantiationError},availability:{get:ge.throwInstantiationError}});var vSe=[];Us.getRegularGridIndices=function(e,t){let n=vSe[e];l(n)||(vSe[e]=n=[]);let i=n[t];return l(i)||(e*t<W.SIXTY_FOUR_KILOBYTES?i=n[t]=new Uint16Array((e-1)*(t-1)*6):i=n[t]=new Uint32Array((e-1)*(t-1)*6),XSe(e,t,i,0)),i};var FSe=[];Us.getRegularGridIndicesAndEdgeIndices=function(e,t){let n=FSe[e];l(n)||(FSe[e]=n=[]);let i=n[t];if(!l(i)){let o=Us.getRegularGridIndices(e,t),r=PSe(e,t),s=r.westIndicesSouthToNorth,a=r.southIndicesEastToWest,c=r.eastIndicesNorthToSouth,d=r.northIndicesWestToEast;i=n[t]={indices:o,westIndicesSouthToNorth:s,southIndicesEastToWest:a,eastIndicesNorthToSouth:c,northIndicesWestToEast:d}}return i};var ISe=[];Us.getRegularGridAndSkirtIndicesAndEdgeIndices=function(e,t){let n=ISe[e];l(n)||(ISe[e]=n=[]);let i=n[t];if(!l(i)){let o=e*t,r=(e-1)*(t-1)*6,s=e*2+t*2,a=Math.max(0,s-4)*6,c=o+s,d=r+a,u=PSe(e,t),m=u.westIndicesSouthToNorth,p=u.southIndicesEastToWest,b=u.eastIndicesNorthToSouth,f=u.northIndicesWestToEast,y=Oe.createTypedArray(c,d);XSe(e,t,y,0),Us.addSkirtIndices(m,p,b,f,o,y,r),i=n[t]={indices:y,westIndicesSouthToNorth:m,southIndicesEastToWest:p,eastIndicesNorthToSouth:b,northIndicesWestToEast:f,indexCountWithoutSkirts:r}}return i};Us.getSkirtVertexCount=function(e,t,n,i){return e.length+t.length+n.length+i.length};Us.getSkirtIndexCount=function(e){return(e-4)*2*3};Us.getSkirtIndexCountWithFilledCorners=function(e){return((e-4)*2+4)*3};Us.addSkirtIndices=function(e,t,n,i,o,r,s){let a=o;s=OB(e,a,r,s),a+=e.length,s=OB(t,a,r,s),a+=t.length,s=OB(n,a,r,s),a+=n.length,OB(i,a,r,s)};Us.addSkirtIndicesWithFilledCorners=function(e,t,n,i,o,r,s){Us.addSkirtIndices(e,t,n,i,o,r,s);let a=Us.getSkirtVertexCount(e,t,n,i),c=Us.getSkirtIndexCount(a),d=s+c,u=e[0],m=i[0],p=n[0],b=t[0],f=o,y=f+e.length-1,_=y+1,S=_+t.length-1,Z=S+1,R=Z+n.length-1,C=R+1,E=C+i.length-1;r[d+0]=u,r[d+1]=f,r[d+2]=S,r[d+3]=b,r[d+4]=_,r[d+5]=R,r[d+6]=p,r[d+7]=Z,r[d+8]=E,r[d+9]=m,r[d+10]=C,r[d+11]=y};function PSe(e,t){let n=new Array(t),i=new Array(e),o=new Array(t),r=new Array(e),s;for(s=0;s<e;++s)r[s]=s,i[s]=e*t-1-s;for(s=0;s<t;++s)o[s]=(s+1)*e-1,n[s]=(t-s-1)*e;return{westIndicesSouthToNorth:n,southIndicesEastToWest:i,eastIndicesNorthToSouth:o,northIndicesWestToEast:r}}function XSe(e,t,n,i){let o=0;for(let r=0;r<t-1;++r){for(let s=0;s<e-1;++s){let a=o,c=a+e,d=c+1,u=a+1;n[i++]=a,n[i++]=c,n[i++]=u,n[i++]=u,n[i++]=c,n[i++]=d,++o}++o}}function OB(e,t,n,i){let o=e[0],r=e.length;for(let s=1;s<r;++s){let a=e[s];n[i++]=o,n[i++]=a,n[i++]=t,n[i++]=t,n[i++]=a,n[i++]=t+1,o=a,++t}return i}Us.heightmapTerrainQuality=.25;Us.getEstimatedLevelZeroGeometricErrorForAHeightmap=function(e,t,n){return e.maximumRadius*2*Math.PI*Us.heightmapTerrainQuality/(t*n)};Us.prototype.requestTileGeometry=ge.throwInstantiationError;Us.prototype.getLevelMaximumGeometricError=ge.throwInstantiationError;Us.prototype.getTileDataAvailable=ge.throwInstantiationError;Us.prototype.loadTileDataAvailability=ge.throwInstantiationError;var Qo=Us;var Rgi=x(T(),1);var xgi=x(T(),1),NSe={UNLOADED:0,TRANSITIONING:1,RECEIVED:2,TEXTURE_LOADED:3,READY:4,FAILED:5,INVALID:6,PLACEHOLDER:7};Object.freeze(NSe);var Dn=NSe;function xV(e,t,n,i,o){if(this.imageryLayer=e,this.x=t,this.y=n,this.level=i,this.request=void 0,i!==0){let r=t/2|0,s=n/2|0,a=i-1;this.parent=e.getImageryFromCache(r,s,a)}this.state=Dn.UNLOADED,this.imageUrl=void 0,this.image=void 0,this.texture=void 0,this.textureWebMercator=void 0,this.credits=void 0,this.referenceCount=0,!l(o)&&e.ready&&(o=e.imageryProvider.tilingScheme.tileXYToRectangle(t,n,i)),this.rectangle=o}xV.createPlaceholder=function(e){let t=new xV(e,0,0,0);return t.addReference(),t.state=Dn.PLACEHOLDER,t};xV.prototype.addReference=function(){++this.referenceCount};xV.prototype.releaseReference=function(){return--this.referenceCount,this.referenceCount===0?(this.imageryLayer.removeImageryFromCache(this),l(this.parent)&&this.parent.releaseReference(),l(this.image)&&l(this.image.destroy)&&this.image.destroy(),l(this.texture)&&this.texture.destroy(),l(this.textureWebMercator)&&this.texture!==this.textureWebMercator&&this.textureWebMercator.destroy(),ue(this),0):this.referenceCount};xV.prototype.processStateMachine=function(e,t,n){this.state===Dn.UNLOADED&&!n&&(this.state=Dn.TRANSITIONING,this.imageryLayer._requestImagery(this)),this.state===Dn.RECEIVED&&(this.state=Dn.TRANSITIONING,this.imageryLayer._createTexture(e.context,this));let i=this.state===Dn.READY&&t&&!this.texture;(this.state===Dn.TEXTURE_LOADED||i)&&(this.state=Dn.TRANSITIONING,this.imageryLayer._reprojectTexture(e,this,t))};var TV=xV;var Agi=x(T(),1);function Yq(e,t,n){this.readyImagery=void 0,this.loadingImagery=e,this.textureCoordinateRectangle=t,this.textureTranslationAndScale=void 0,this.useWebMercatorT=n}Yq.prototype.freeResources=function(){l(this.readyImagery)&&this.readyImagery.releaseReference(),l(this.loadingImagery)&&this.loadingImagery.releaseReference()};Yq.prototype.processStateMachine=function(e,t,n){let i=this.loadingImagery,o=i.imageryLayer;if(i.processStateMachine(t,!this.useWebMercatorT,n),i.state===Dn.READY)return l(this.readyImagery)&&this.readyImagery.releaseReference(),this.readyImagery=this.loadingImagery,this.loadingImagery=void 0,this.textureTranslationAndScale=o._calculateTextureTranslationAndScale(e,this),!0;let r=i.parent,s;for(;l(r)&&(r.state!==Dn.READY||!this.useWebMercatorT&&!l(r.texture));)r.state!==Dn.FAILED&&r.state!==Dn.INVALID&&(s=s||r),r=r.parent;return this.readyImagery!==r&&(l(this.readyImagery)&&this.readyImagery.releaseReference(),this.readyImagery=r,l(r)&&(r.addReference(),this.textureTranslationAndScale=o._calculateTextureTranslationAndScale(e,this))),i.state===Dn.FAILED||i.state===Dn.INVALID?l(s)?(s.processStateMachine(t,!this.useWebMercatorT,n),!1):!0:!1};var _V=Yq;function zi(e,t){this._imageryProvider=e,this._readyEvent=new Se,this._errorEvent=new Se,t=t??B.EMPTY_OBJECT,e=e??B.EMPTY_OBJECT,this.alpha=t.alpha??e._defaultAlpha??1,this.nightAlpha=t.nightAlpha??e._defaultNightAlpha??1,this.dayAlpha=t.dayAlpha??e._defaultDayAlpha??1,this.brightness=t.brightness??e._defaultBrightness??zi.DEFAULT_BRIGHTNESS,this.contrast=t.contrast??e._defaultContrast??zi.DEFAULT_CONTRAST,this.hue=t.hue??e._defaultHue??zi.DEFAULT_HUE,this.saturation=t.saturation??e._defaultSaturation??zi.DEFAULT_SATURATION,this.gamma=t.gamma??e._defaultGamma??zi.DEFAULT_GAMMA,this.splitDirection=t.splitDirection??zi.DEFAULT_SPLIT,this.minificationFilter=t.minificationFilter??e._defaultMinificationFilter??zi.DEFAULT_MINIFICATION_FILTER,this.magnificationFilter=t.magnificationFilter??e._defaultMagnificationFilter??zi.DEFAULT_MAGNIFICATION_FILTER,this.show=t.show??!0,this._minimumTerrainLevel=t.minimumTerrainLevel,this._maximumTerrainLevel=t.maximumTerrainLevel,this._rectangle=t.rectangle??re.MAX_VALUE,this._maximumAnisotropy=t.maximumAnisotropy,this._imageryCache={},this._skeletonPlaceholder=new _V(TV.createPlaceholder(this)),this._show=!0,this._layerIndex=-1,this._isBaseLayer=!1,this._requestImageError=void 0,this._reprojectComputeCommands=[],this.cutoutRectangle=t.cutoutRectangle,this.colorToAlpha=t.colorToAlpha,this.colorToAlphaThreshold=t.colorToAlphaThreshold??zi.DEFAULT_APPLY_COLOR_TO_ALPHA_THRESHOLD}Object.defineProperties(zi.prototype,{imageryProvider:{get:function(){return this._imageryProvider}},ready:{get:function(){return l(this._imageryProvider)}},errorEvent:{get:function(){return this._errorEvent}},readyEvent:{get:function(){return this._readyEvent}},rectangle:{get:function(){return this._rectangle}}});zi.DEFAULT_BRIGHTNESS=1;zi.DEFAULT_CONTRAST=1;zi.DEFAULT_HUE=0;zi.DEFAULT_SATURATION=1;zi.DEFAULT_GAMMA=1;zi.DEFAULT_SPLIT=Ur.NONE;zi.DEFAULT_MINIFICATION_FILTER=Ht.LINEAR;zi.DEFAULT_MAGNIFICATION_FILTER=$n.LINEAR;zi.DEFAULT_APPLY_COLOR_TO_ALPHA_THRESHOLD=.004;zi.fromProviderAsync=function(e,t){let n=new zi(void 0,t);return hlt(n,Promise.resolve(e)),n};zi.fromWorldImagery=function(e){return e=e??B.EMPTY_OBJECT,zi.fromProviderAsync(og({style:e.style}),e)};zi.prototype.isBaseLayer=function(){return this._isBaseLayer};zi.prototype.isDestroyed=function(){return!1};zi.prototype.destroy=function(){return ue(this)};var wSe=new re,YSe=new re,Mq=new re,kSe=new re;zi.prototype.getImageryRectangle=function(){let e=this._imageryProvider,t=this._rectangle;return re.intersection(e.rectangle,t)};zi.prototype._createTileImagerySkeletons=function(e,t,n){let i=e.data;if(!l(t)||l(this._minimumTerrainLevel)&&e.level<this._minimumTerrainLevel||l(this._maximumTerrainLevel)&&e.level>this._maximumTerrainLevel)return!1;l(n)||(n=i.imagery.length);let o=this._imageryProvider;if(!this.ready)return this._skeletonPlaceholder.loadingImagery.addReference(),i.imagery.splice(n,0,this._skeletonPlaceholder),!0;let r=o.tilingScheme.projection instanceof Ti&&e.rectangle.north<Ti.MaximumLatitude&&e.rectangle.south>-Ti.MaximumLatitude,s=re.intersection(o.rectangle,this._rectangle,wSe),a=re.intersection(e.rectangle,s,YSe);if(!l(a)){if(!this.isBaseLayer())return!1;let G=s,v=e.rectangle;a=YSe,v.south>=G.north?a.north=a.south=G.north:v.north<=G.south?a.north=a.south=G.south:(a.south=Math.max(v.south,G.south),a.north=Math.min(v.north,G.north)),v.west>=G.east?a.west=a.east=G.east:v.east<=G.west?a.west=a.east=G.west:(a.west=Math.max(v.west,G.west),a.east=Math.min(v.east,G.east))}let c=0;a.south>0?c=a.south:a.north<0&&(c=a.north);let u=1*t.getLevelMaximumGeometricError(e.level),m=ult(this,u,c);m=Math.max(0,m);let p=o.maximumLevel;if(m>p&&(m=p),l(o.minimumLevel)){let G=o.minimumLevel;m<G&&(m=G)}let b=o.tilingScheme,f=b.positionToTileXY(re.northwest(a),m),y=b.positionToTileXY(re.southeast(a),m),_=e.rectangle.width/512,S=e.rectangle.height/512,Z=b.tileXYToRectangle(f.x,f.y,m);Math.abs(Z.south-e.rectangle.north)<S&&f.y<y.y&&++f.y,Math.abs(Z.east-e.rectangle.west)<_&&f.x<y.x&&++f.x;let R=b.tileXYToRectangle(y.x,y.y,m);Math.abs(R.north-e.rectangle.south)<S&&y.y>f.y&&--y.y,Math.abs(R.west-e.rectangle.east)<_&&y.x>f.x&&--y.x;let C=re.clone(e.rectangle,kSe),E=b.tileXYToRectangle(f.x,f.y,m),A=re.intersection(E,s,Mq),L;r?(b.rectangleToNativeRectangle(C,C),b.rectangleToNativeRectangle(E,E),b.rectangleToNativeRectangle(A,A),b.rectangleToNativeRectangle(s,s),L=b.tileXYToNativeRectangle.bind(b),_=C.width/512,S=C.height/512):L=b.tileXYToRectangle.bind(b);let F,I=0,N=1,g;!this.isBaseLayer()&&Math.abs(A.west-C.west)>=_&&(I=Math.min(1,(A.west-C.west)/C.width)),!this.isBaseLayer()&&Math.abs(A.north-C.north)>=S&&(N=Math.max(0,(A.north-C.south)/C.height));let V=N;for(let G=f.x;G<=y.x;G++)if(F=I,E=L(G,f.y,m),A=re.simpleIntersection(E,s,Mq),!!l(A)){I=Math.min(1,(A.east-C.west)/C.width),G===y.x&&(this.isBaseLayer()||Math.abs(A.east-C.east)<_)&&(I=1),N=V;for(let v=f.y;v<=y.y;v++){if(g=N,E=L(G,v,m),A=re.simpleIntersection(E,s,Mq),!l(A))continue;N=Math.max(0,(A.south-C.south)/C.height),v===y.y&&(this.isBaseLayer()||Math.abs(A.south-C.south)<S)&&(N=0);let X=new ce(F,N,I,g),Y=this.getImageryFromCache(G,v,m);i.imagery.splice(n,0,new _V(Y,X,r)),++n}}return!0};zi.prototype._calculateTextureTranslationAndScale=function(e,t){let n=t.readyImagery.rectangle,i=e.rectangle;if(t.useWebMercatorT){let c=t.readyImagery.imageryLayer.imageryProvider.tilingScheme;n=c.rectangleToNativeRectangle(n,wSe),i=c.rectangleToNativeRectangle(i,kSe)}let o=i.width,r=i.height,s=o/n.width,a=r/n.height;return new ce(s*(i.west-n.west)/o,a*(i.south-n.south)/r,s,a)};zi.prototype._requestImagery=function(e){let t=this._imageryProvider,n=this;function i(s){if(!l(s))return o();e.image=s,e.state=Dn.RECEIVED,e.request=void 0,tr.reportSuccess(n._requestImageError)}function o(s){if(e.request.state===Ri.CANCELLED){e.state=Dn.UNLOADED,e.request=void 0;return}e.state=Dn.FAILED,e.request=void 0;let a=`Failed to obtain image tile X: ${e.x} Y: ${e.y} Level: ${e.level}.`;n._requestImageError=tr.reportError(n._requestImageError,t,t.errorEvent,a,e.x,e.y,e.level,s),n._requestImageError.retry&&r()}function r(){let s=new Ar({throttle:!1,throttleByServer:!0,type:js.IMAGERY});e.request=s,e.state=Dn.TRANSITIONING;let a=t.requestImage(e.x,e.y,e.level,s);if(!l(a)){e.state=Dn.UNLOADED,e.request=void 0;return}l(t.getTileCredits)&&(e.credits=t.getTileCredits(e.x,e.y,e.level)),a.then(function(c){i(c)}).catch(function(c){o(c)})}r()};zi.prototype._createTextureWebGL=function(e,t){let n=new Ot({minificationFilter:this.minificationFilter,magnificationFilter:this.magnificationFilter}),i=t.image;return l(i.internalFormat)?new vt({context:e,pixelFormat:i.internalFormat,width:i.width,height:i.height,source:{arrayBufferView:i.bufferView},sampler:n}):new vt({context:e,source:i,pixelFormat:this._imageryProvider.hasAlphaChannel?Qe.RGBA:Qe.RGB,sampler:n})};zi.prototype._createTexture=function(e,t){let n=this._imageryProvider,i=t.image;if(l(n.tileDiscardPolicy)){let r=n.tileDiscardPolicy;if(l(r)){if(!r.isReady()){t.state=Dn.RECEIVED;return}if(r.shouldDiscardImage(i)){t.state=Dn.INVALID;return}}}let o=this._createTextureWebGL(e,t);n.tilingScheme.projection instanceof Ti?t.textureWebMercator=o:t.texture=o,t.image=void 0,t.state=Dn.TEXTURE_LOADED};function MSe(e,t,n){return`${e}:${t}:${n}`}zi.prototype._finalizeReprojectTexture=function(e,t){let n=this.minificationFilter,i=this.magnificationFilter;if(n===Ht.LINEAR&&i===$n.LINEAR&&!Qe.isCompressedFormat(t.pixelFormat)&&W.isPowerOfTwo(t.width)&&W.isPowerOfTwo(t.height)){n=Ht.LINEAR_MIPMAP_LINEAR;let r=wt.maximumTextureFilterAnisotropy,s=Math.min(r,this._maximumAnisotropy??r),a=MSe(n,i,s),c=e.cache.imageryLayerMipmapSamplers;l(c)||(c={},e.cache.imageryLayerMipmapSamplers=c);let d=c[a];l(d)||(d=c[a]=new Ot({wrapS:pn.CLAMP_TO_EDGE,wrapT:pn.CLAMP_TO_EDGE,minificationFilter:n,magnificationFilter:i,maximumAnisotropy:s})),t.generateMipmap(Rm.NICEST),t.sampler=d}else{let r=MSe(n,i,0),s=e.cache.imageryLayerNonMipmapSamplers;l(s)||(s={},e.cache.imageryLayerNonMipmapSamplers=s);let a=s[r];l(a)||(a=s[r]=new Ot({wrapS:pn.CLAMP_TO_EDGE,wrapT:pn.CLAMP_TO_EDGE,minificationFilter:n,magnificationFilter:i})),t.sampler=a}};zi.prototype._reprojectTexture=function(e,t,n){let i=t.textureWebMercator||t.texture,o=t.rectangle,r=e.context;if(n=n??!0,n&&!(this._imageryProvider.tilingScheme.projection instanceof ki)&&o.width/i.width>1e-5){let s=this;t.addReference();let a=new bu({persists:!0,owner:this,preExecute:function(c){dlt(c,r,i,t.rectangle)},postExecute:function(c){t.texture=c,s._finalizeReprojectTexture(r,c),t.state=Dn.READY,t.releaseReference()},canceled:function(){t.state=Dn.TEXTURE_LOADED,t.releaseReference()}});this._reprojectComputeCommands.push(a)}else n&&(t.texture=i),this._finalizeReprojectTexture(r,i),t.state=Dn.READY};zi.prototype.queueReprojectionCommands=function(e){let t=this._reprojectComputeCommands,n=t.length;for(let i=0;i<n;++i)e.commandList.push(t[i]);t.length=0};zi.prototype.cancelReprojections=function(){this._reprojectComputeCommands.forEach(function(e){l(e.canceled)&&e.canceled()}),this._reprojectComputeCommands.length=0};zi.prototype.getImageryFromCache=function(e,t,n,i){let o=USe(e,t,n),r=this._imageryCache[o];return l(r)||(r=new TV(this,e,t,n,i),this._imageryCache[o]=r),r.addReference(),r};zi.prototype.removeImageryFromCache=function(e){let t=USe(e.x,e.y,e.level);delete this._imageryCache[t]};function USe(e,t,n){return JSON.stringify([e,t,n])}var BB={u_textureDimensions:function(){return this.textureDimensions},u_texture:function(){return this.texture},textureDimensions:new k,texture:void 0},llt=fn.supportsTypedArrays()?new Float32Array(128):void 0;function dlt(e,t,n,i){let o=t.cache.imageryLayer_reproject;if(!l(o)){o=t.cache.imageryLayer_reproject={vertexArray:void 0,shaderProgram:void 0,sampler:void 0,destroy:function(){l(this.framebuffer)&&this.framebuffer.destroy(),l(this.vertexArray)&&this.vertexArray.destroy(),l(this.shaderProgram)&&this.shaderProgram.destroy()}};let _=new Float32Array(256),S=0;for(let A=0;A<64;++A){let L=A/63;_[S++]=0,_[S++]=L,_[S++]=1,_[S++]=L}let Z={position:0,webMercatorT:1},R=Qo.getRegularGridIndices(2,64),C=it.createIndexBuffer({context:t,typedArray:R,usage:Pe.STATIC_DRAW,indexDatatype:Oe.UNSIGNED_SHORT});o.vertexArray=new Un({context:t,attributes:[{index:Z.position,vertexBuffer:it.createVertexBuffer({context:t,typedArray:_,usage:Pe.STATIC_DRAW}),componentsPerAttribute:2},{index:Z.webMercatorT,vertexBuffer:it.createVertexBuffer({context:t,sizeInBytes:512,usage:Pe.STREAM_DRAW}),componentsPerAttribute:1}],indexBuffer:C});let E=new Je({sources:[o2]});o.shaderProgram=tn.fromCache({context:t,vertexShaderSource:E,fragmentShaderSource:i2,attributeLocations:Z}),o.sampler=new Ot({wrapS:pn.CLAMP_TO_EDGE,wrapT:pn.CLAMP_TO_EDGE,minificationFilter:Ht.LINEAR,magnificationFilter:$n.LINEAR})}n.sampler=o.sampler;let r=n.width,s=n.height;BB.textureDimensions.x=r,BB.textureDimensions.y=s,BB.texture=n;let a=Math.sin(i.south),c=.5*Math.log((1+a)/(1-a));a=Math.sin(i.north);let u=1/(.5*Math.log((1+a)/(1-a))-c),m=new vt({context:t,width:r,height:s,pixelFormat:n.pixelFormat,pixelDatatype:n.pixelDatatype,preMultiplyAlpha:n.preMultiplyAlpha});W.isPowerOfTwo(r)&&W.isPowerOfTwo(s)&&m.generateMipmap(Rm.NICEST);let p=i.south,b=i.north,f=llt,y=0;for(let _=0;_<64;++_){let S=_/63,Z=W.lerp(p,b,S);a=Math.sin(Z);let C=(.5*Math.log((1+a)/(1-a))-c)*u;f[y++]=C,f[y++]=C}o.vertexArray.getAttribute(1).vertexBuffer.copyFromArrayView(f),e.shaderProgram=o.shaderProgram,e.outputTexture=m,e.uniformMap=BB,e.vertexArray=o.vertexArray}function ult(e,t,n){let i=e._imageryProvider,o=i.tilingScheme,r=o.ellipsoid,s=e._imageryProvider.tilingScheme.projection instanceof ki?1:Math.cos(n),a=o.rectangle,d=r.maximumRadius*a.width*s/(i.tileWidth*o.getNumberOfXTilesAtLevel(0))/t,u=Math.log(d)/Math.log(2);return Math.round(u)|0}function mlt(e,t){e.numberOfListeners>0?e.raiseEvent(t):console.error(t)}async function hlt(e,t){let n;try{if(n=await Promise.resolve(t),e.isDestroyed())return;e._imageryProvider=n,e._readyEvent.raiseEvent(n)}catch(i){mlt(e._errorEvent,i)}}var Cs=zi;var byi=x(T(),1),wq=class{constructor(){this.alpha=!1,this.brightness=!1,this.contrast=!1,this.hue=!1,this.saturation=!1,this.gamma=!1,this.colorToAlpha=!1}},iN=wq;var Qyi=x(T(),1);var Zyi=x(T(),1);var yyi=x(T(),1),kq=class{constructor(t,n,i,o){this._minX=t??0,this._minY=n??0,this._maxX=i??0,this._maxY=o??0}get minX(){return this._minX}set minX(t){this._minX=t}get minY(){return this._minY}set minY(t){this._minY=t}get maxX(){return this._maxX}set maxX(t){this._maxX=t}get maxY(){return this._maxY}set maxY(t){this._maxY=t}contains(t,n){return t>=this.minX&&t<this.maxX&&n>=this.minY&&n<this.maxY}containsExclusive(t,n){return t>this.minX&&t<this.maxX&&n>this.minY&&n<this.maxY}containsInclusive(t,n){return t>=this.minX&&t<=this.maxX&&n>=this.minY&&n<=this.maxY}},SV=kq;var flt=new re,DSe=new re,plt=new re,blt=new re,glt=new re,ylt=new re,Uq=class e{constructor(t,n,i,o,r){this._x=t,this._y=n,this._level=i,this._textureCoordinateRectangle=o,this._imagery=r}get x(){return this._x}get y(){return this._y}get level(){return this._level}get textureCoordinateRectangle(){return this._textureCoordinateRectangle}get imagery(){return this._imagery}static createImageryCoverages(t,n,i){if(!n.show)return[];let o=n.imageryProvider,r=e._clampImageryLevel(o,i),s=re.intersection(o.rectangle,n.rectangle,flt),a=o.tilingScheme,c=e._computeImageryRange(t,s,a,r),d=blt;a.rectangleToNativeRectangle(t,d);let u=glt;a.rectangleToNativeRectangle(s,u);let m=(b,f,y)=>{let _=a.tileXYToRectangle(b,f,y),S=re.intersection(_,s,plt);if(!l(S))return;let Z=ylt;return a.rectangleToNativeRectangle(S,Z),Z};return e._computeImageryCoverages(n,c,r,d,m)}static _clampImageryLevel(t,n){let i=t.minimumLevel??0,o=t.maximumLevel??Number.POSITIVE_INFINITY,r=Math.min(o-1,Math.max(i,n));return Math.floor(r)}static _computeImageryRange(t,n,i,o){let r=e._computeOverlappedRectangle(t,n),s=i.positionToTileXY(re.northwest(r),o),a=i.positionToTileXY(re.southeast(r),o),c=new SV;c.minX=s.x,c.minY=s.y,c.maxX=a.x,c.maxY=a.y;let d=t.width/512,u=t.height/512,m=i.tileXYToRectangle(c.minX,c.minY,o);Math.abs(m.south-t.north)<u&&c.minY<c.maxY&&++c.minY,Math.abs(m.east-t.west)<d&&c.minX<c.maxX&&++c.minX;let f=i.tileXYToRectangle(c.maxX,c.maxY,o);return Math.abs(f.north-t.south)<u&&c.maxY>c.minY&&--c.maxY,Math.abs(f.west-t.east)<d&&c.maxX>c.minX&&--c.maxX,c}static _clampRectangle(t,n,i){return l(i)||(i=new re),t.south>=n.north?i.north=i.south=n.north:t.north<=n.south?i.north=i.south=n.south:(i.south=Math.max(t.south,n.south),i.north=Math.min(t.north,n.north)),t.west>=n.east?i.west=i.east=n.east:t.east<=n.west?i.west=i.east=n.west:(i.west=Math.max(t.west,n.west),i.east=Math.min(t.east,n.east)),i}static _computeOverlappedRectangle(t,n){let i=re.intersection(t,n,DSe);return l(i)?i:e._clampRectangle(t,n,DSe)}static _computeImageryCoverages(t,n,i,o,r){let s=[];for(let a=n.minX;a<=n.maxX;a++){let c=r(a,n.maxY,i);if(l(c))for(let d=n.minY;d<=n.maxY;d++){let u=r(a,d,i);if(!l(u))continue;let m=e._localizeToCartesianRectangle(u,o,void 0),p=t.getImageryFromCache(a,d,i),b=new e(a,d,i,m,p);s.push(b)}}return s}static _localizeToCartesianRectangle(t,n,i){l(i)||(i=new SV);let o=1/n.width,r=1/n.height;return i.minX=(t.west-n.west)*o,i.minY=(t.south-n.south)*r,i.maxX=(t.east-n.west)*o,i.maxY=(t.north-n.south)*r,i}},ZV=Uq;var Xyi=x(T(),1);var Dq=class e{static createTextureCoordinatesForMappedPositions(t,n){let i=t.cartographicPositions,o=t.cartographicBoundingRectangle,r=t.numPositions;return e._createTextureCoordinates(i,r,o,n)}static _createTextureCoordinates(t,n,i,o){let r=new nt;nt.fromRectangle(i,o,r);let s=e.createProjectedPositions(t,o),a=e.computeTexCoords(s,r);return e.createTypedArrayFromCartesians2(n,a)}static createTextureCoordinatesAttributeForMappedPositions(t,n){let i=e.createTextureCoordinatesForMappedPositions(t,n);return e.createTexCoordAttribute(i)}static createCartographicPositions(t,n,i){let o=Sa.readAttributeAsTypedArray(t),r=t.type,s=Dt.getNumberOfComponents(r),a=e.createIterableCartesian3FromTypedArray(o,s),c=e.transformCartesians3(a,n);return e.transformToCartographic(c,i)}static createIterableCartesian3FromTypedArray(t,n){let i=new h,o=t.length/n;return{[Symbol.iterator]:function*(){for(let s=0;s<o;s++)i.x=t[s*n+0],i.y=t[s*n+1],i.z=t[s*n+2],yield i}}}static map(t,n){return{[Symbol.iterator]:function*(){for(let o of t)yield n(o)}}}static computeCartographicBoundingRectangle(t,n){l(n)||(n=new re);let i=Number.NEGATIVE_INFINITY,o=Number.POSITIVE_INFINITY,r=Number.NEGATIVE_INFINITY,s=Number.POSITIVE_INFINITY;for(let a of t)i=Math.max(i,a.latitude),o=Math.min(o,a.latitude),r=Math.max(r,a.longitude),s=Math.min(s,a.longitude);return n.north=i,n.south=o,n.east=r,n.west=s,n}static transformCartesians3(t,n){let i=new h;return e.map(t,r=>(P.multiplyByPoint(n,r,i),i))}static transformToCartographic(t,n){let i=new pe;return e.map(t,r=>(n.cartesianToCartographic(r,i),i))}static createProjectedPositions(t,n){let i=new h;return e.map(t,r=>(n.project(r,i),i))}static computeTexCoords(t,n){let i=new k,o=1/n.width,r=1/n.height;return e.map(t,a=>{let c=(a.x-n.x)*o,d=(a.y-n.y)*r,u=Math.min(Math.max(c,0),1),m=Math.min(Math.max(d,0),1);return i.x=u,i.y=m,i})}static createTypedArrayFromCartesians2(t,n){let i=new Float32Array(t*2),o=0;for(let r of n)i[o*2+0]=r.x,i[o*2+1]=r.y,o++;return i}static createTexCoordAttribute(t){return{name:"Imagery Texture Coordinates",semantic:dt.TEXCOORD,setIndex:0,componentDatatype:J.FLOAT,type:Dt.VEC2,normalized:!1,count:t.length/2,min:void 0,max:void 0,constant:new k(0,0),quantization:void 0,typedArray:t,byteOffset:0,byteStride:void 0}}},NS=Dq;var Yyi=x(T(),1);var Oq=class{constructor(t,n,i,o){this._cartographicPositions=t,this._numPositions=n,this._cartographicBoundingRectangle=i,this._ellipsoid=o}get cartographicPositions(){return this._cartographicPositions}get numPositions(){return this._numPositions}get cartographicBoundingRectangle(){return this._cartographicBoundingRectangle}get ellipsoid(){return this._ellipsoid}},oN=Oq;var Bq=class e{constructor(t,n,i){this._model=t,this._runtimeNode=n,this._runtimePrimitive=i,this._mappedPositionsPerEllipsoid=void 0,this._mappedPositionsModelMatrix=new P,this._lastImageryLayersModificationCounter=0,this._imageryTexCoordAttributesPerProjection=void 0,this._currentImageryLayers=void 0,this._coveragesPerLayer=void 0,this._allImageriesReady=!1}coveragesForImageryLayer(t){let o=this._model.imageryLayers.indexOf(t);if(o===-1)throw new ge("Imagery layer is not part of the model");let r=this._coveragesPerLayer;if(!l(r))throw new ge("The coveragesPerLayer have not been computed yet");return r[o]}update(t){let n=this._model,r=n.content.tileset.imageryLayersModificationCounter;this._lastImageryLayersModificationCounter!==r&&(delete this._mappedPositionsPerEllipsoid,this._lastImageryLayersModificationCounter=r),this._mappedPositionsNeedUpdate&&(n.resetDrawCommands(),this._mappedPositionsPerEllipsoid=this._computeMappedPositionsPerEllipsoid(),this._deleteCoveragesPerLayer(),this._destroyImageryTexCoordAttributes()),l(this._imageryTexCoordAttributesPerProjection)||(this._imageryTexCoordAttributesPerProjection=this._computeImageryTexCoordsAttributesPerProjection(),this._uploadImageryTexCoordAttributes(t.context)),l(this._coveragesPerLayer)||(this._computeCoveragesPerLayer(),this._allImageriesReady=!1),this._allImageriesReady||this._updateImageries(t)}_deleteCoveragesPerLayer(){let t=this._coveragesPerLayer;if(!l(t))return;let n=this._currentImageryLayers,i=t.length;for(let o=0;o<i;o++){let r=n[o],s=t[o];this._deleteCoverages(r,s)}delete this._currentImageryLayers,delete this._coveragesPerLayer}_deleteCoverages(t,n){if(t.isDestroyed())return;let i=n.length;for(let o=0;o<i;o++)n[o].imagery.releaseReference()}_uploadImageryTexCoordAttributes(t){let n=this._imageryTexCoordAttributesPerProjection;if(!l(n))return;let i=n.length;for(let o=0;o<i;o++){let r=n[o],s=it.createVertexBuffer({context:t,typedArray:r.typedArray,usage:Pe.STATIC_DRAW});s.vertexArrayDestroyable=!1,r.buffer=s}}_destroyImageryTexCoordAttributes(){let t=this._imageryTexCoordAttributesPerProjection;if(!l(t))return;let n=t.length;for(let i=0;i<n;i++){let o=t[i];l(o)&&(l(o.buffer)&&(o.buffer.isDestroyed()||o.buffer.destroy()),t[i]=void 0)}delete this._imageryTexCoordAttributesPerProjection}get _mappedPositionsNeedUpdate(){if(!l(this._mappedPositionsPerEllipsoid))return!0;let t=this._model,n=this._mappedPositionsModelMatrix;return!P.equals(t.modelMatrix,n)}_computeMappedPositionsPerEllipsoid(){let t=this._model,n=this._runtimeNode,i=this._runtimePrimitive,o=e._obtainPrimitivePositionAttribute(i.primitive),r=o.count,s=e._computePrimitivePositionTransform(t,n,void 0),a=[],c=e._computeUniqueEllipsoids(t.imageryLayers),d=c.length;for(let u=0;u<d;u++){let m=c[u],p=NS.createCartographicPositions(o,s,m),b=NS.computeCartographicBoundingRectangle(p),f=new oN(p,r,b,m);a.push(f)}return P.clone(t.modelMatrix,this._mappedPositionsModelMatrix),a}static _computeUniqueEllipsoids(t){let n=new Set,i=t.length;for(let o=0;o<i;o++){let r=t.get(o),s=e._getEllipsoid(r);n.add(s)}return[...n]}_computeImageryTexCoordsAttributesPerProjection(){let n=this._model.imageryLayers,i=e._extractProjections(n),o=[...new Set(i)];return this._createImageryTexCoordAttributes(o)}static _extractProjections(t){let n=[],i=t.length;for(let o=0;o<i;o++){let r=t.get(o),s=e._getProjection(r);n.push(s)}return n}static _getProjection(t){return t.imageryProvider.tilingScheme.projection}_createImageryTexCoordAttributes(t){let n=[],i=t.length;for(let o=0;o<i;o++){let r=t[o],s=r.ellipsoid,a=this.mappedPositionsForEllipsoid(s),c=NS.createTextureCoordinatesAttributeForMappedPositions(a,r);n.push(c)}return n}_computeCoveragesPerLayer(){let t=[],n=[],o=this._model.imageryLayers,r=o.length;for(let s=0;s<r;s++){let a=o.get(s),c=this._computeCoverage(a);t.push(c),n.push(a)}this._coveragesPerLayer=t,this._currentImageryLayers=n}_computeCoverage(t){let i=this.mappedPositionsForImageryLayer(t).cartographicBoundingRectangle,o=this._computeImageryLevel(t,i);return ZV.createImageryCoverages(i,t,o)}_computeImageryLevel(t,n){let i=t.imageryProvider,r=i.tilingScheme.rectangle,s=1,a=n.width,c=r.width;n.height>n.width&&(a=n.height,c=r.height);let d=Math.log2(s*c/a);return ZV._clampImageryLevel(i,d)}_updateImageries(t){let n=this._model,i=this._coveragesPerLayer,o=i.length,r=!0;for(let s=0;s<o;s++){let a=i[s],c=a.length;for(let d=0;d<c;d++){let m=a[d].imagery;m.state===Dn.READY||m.state===Dn.FAILED||m.state===Dn.INVALID||(r=!1,m.processStateMachine(t,!1,!1))}}r&&n.resetDrawCommands(),this._allImageriesReady=r}mappedPositionsForImageryLayer(t){let n=e._getEllipsoid(t);return this.mappedPositionsForEllipsoid(n)}mappedPositionsForEllipsoid(t){let n=this._mappedPositionsPerEllipsoid;if(!l(n))throw new ge("The mappedPositions have not been computed yet");let i=n.length;for(let o=0;o<i;o++){let r=n[o];if(r.ellipsoid===t)return r}throw new ge(`Could not find mapped positions for ellipsoid ${t}`)}imageryTexCoordAttributesPerProjection(){let t=this._imageryTexCoordAttributesPerProjection;if(!l(t))throw new ge("The imagery texture coordinate attributes have not been computed yet");return this._imageryTexCoordAttributesPerProjection}get ready(){let t=this._coveragesPerLayer;return l(t)?this._allImageriesReady:!1}isDestroyed(){return!1}destroy(){if(!this.isDestroyed())return this._deleteCoveragesPerLayer(),this._destroyImageryTexCoordAttributes(),ue(this)}static _computePrimitivePositionTransform(t,n,i){l(i)||(i=new P);let o=t.sceneGraph;return P.clone(P.IDENTITY,i),P.multiply(i,t.modelMatrix,i),P.multiply(i,o.components.transform,i),P.multiply(i,o.axisCorrectionMatrix,i),P.multiply(i,n.computedTransform,i),i}static _obtainPrimitivePositionAttribute(t){let n=Zt.getAttributeBySemantic(t,"POSITION");if(!l(n))throw new ge("The primitive does not have a POSITION attribute");return n}static _getEllipsoid(t){return t.imageryProvider.tilingScheme.projection.ellipsoid}},YS=Bq;var $yi=x(T(),1),zq=class{constructor(t,n,i,o,r){this.imageryLayer=t,this.texture=n,this.textureTranslationAndScale=i,this.textureCoordinateRectangle=o,this.imageryTexCoordAttributeSetIndex=r}},rN=zq;var xlt=!1,Tlt=new re,_lt=new re,Hq=class e{static process(t,n,i){let o=t.model,r=n.modelPrimitiveImagery;if(!l(r)||!r.ready)return;let s=o.imageryLayers,a=YS._extractProjections(s),c=[...new Set(a)],d=e._computeIndexMapping(a,c),u=e._createImageryInputs(s,r,d);if(u.length===0)return;u.length>10&&(xt("imagery-texture-units",`Warning: Draped imagery requires ${u.length} texture units, truncating`),u.length=10),e._addImageryTexCoordAttributesToRenderResources(r,t);let m=[];for(let p=0;p<s.length;p++)m.push(s.get(p));e._processImageryInputs(m,t,u,c.length)}static _addImageryTexCoordAttributesToRenderResources(t,n){let i=t.imageryTexCoordAttributesPerProjection();for(let o of i)e._addImageryTexCoordAttributeToRenderResources(o,n)}static _addImageryTexCoordAttributeToRenderResources(t,n){let i=Dt.getNumberOfComponents(t.type),o={index:n.attributeIndex++,value:l(t.buffer)?void 0:t.constant,vertexBuffer:t.buffer,count:t.count,componentsPerAttribute:i,componentDatatype:t.componentDatatype,offsetInBytes:t.byteOffset,strideInBytes:t.byteStride,normalize:t.normalized};n.attributes.push(o)}static _processImageryInputs(t,n,i,o){let r=n.shaderBuilder,s=e._computeImageryFlags(t),a=i.length;r.addDefine("HAS_IMAGERY"),r.addDefine(`IMAGERY_TEXTURE_UNITS ${a}`),e._addAttributes(r,o),e._defineUniforms(r,s),e._buildSampleAndBlendFunction(r,s),e._createMainImageryShader(r,i,s);let c=n.uniformMap,d=e._createImageryUniforms(i);e._setImageryUniforms(c,d)}static _addAttributes(t,n){for(let r=0;r<n;r++)t.addAttribute("vec2",`a_imagery_texCoord_${r}`),t.addVarying("vec2",`v_imagery_texCoord_${r}`);let i="initializeImageryAttributes",o=`void ${i}()`;t.addFunction(i,o,fe.VERTEX);for(let r=0;r<n;r++)t.addFunctionLines(i,[`v_imagery_texCoord_${r} = a_imagery_texCoord_${r};`])}static _computeImageryFlags(t){let n=new iN;for(let i=0;i<t.length;i++){let o=t[i];n.alpha|=o.alpha!==1,n.brightness|=o.brightness!==Cs.DEFAULT_BRIGHTNESS,n.contrast|=o.contrast!==Cs.DEFAULT_CONTRAST,n.hue|=o.hue!==Cs.DEFAULT_HUE,n.saturation|=o.saturation!==Cs.DEFAULT_SATURATION,n.gamma|=o.gamma!==Cs.DEFAULT_GAMMA;let r=l(o.colorToAlpha)&&o.colorToAlphaThreshold>0;n.colorToAlpha|=r}return n}static _defineUniforms(t,n){t.addUniform("sampler2D","u_imageryTextures[IMAGERY_TEXTURE_UNITS]",fe.FRAGMENT),t.addUniform("vec4","u_imageryTextureCoordinateRectangle[IMAGERY_TEXTURE_UNITS]",fe.FRAGMENT),t.addUniform("vec4","u_imageryTextureTranslationAndScale[IMAGERY_TEXTURE_UNITS]",fe.FRAGMENT),n.alpha&&t.addUniform("float","u_imageryTextureAlpha[IMAGERY_TEXTURE_UNITS]",fe.FRAGMENT),n.brightness&&t.addUniform("float","u_imageryTextureBrightness[IMAGERY_TEXTURE_UNITS]",fe.FRAGMENT),n.contrast&&t.addUniform("float","u_imageryTextureContrast[IMAGERY_TEXTURE_UNITS]",fe.FRAGMENT),n.hue&&t.addUniform("float","u_imageryTextureHue[IMAGERY_TEXTURE_UNITS]",fe.FRAGMENT),n.saturation&&t.addUniform("float","u_imageryTextureSaturation[IMAGERY_TEXTURE_UNITS]",fe.FRAGMENT),n.gamma&&t.addUniform("float","u_imageryTextureOneOverGamma[IMAGERY_TEXTURE_UNITS]",fe.FRAGMENT),n.colorToAlpha&&t.addUniform("vec4","u_imageryTextureColorToAlpha[IMAGERY_TEXTURE_UNITS]",fe.FRAGMENT)}static _createSampleAndBlendFunctionSignature(t){let n="sampleAndBlend",i=[];i.push("vec4 previousColor"),i.push("sampler2D textureToSample"),i.push("vec2 textureCoordinates"),i.push("vec4 textureCoordinateRectangle"),i.push("vec4 textureCoordinateTranslationAndScale"),t.alpha&&i.push("float textureAlpha"),t.brightness&&i.push("float textureBrightness"),t.contrast&&i.push("float textureContrast"),t.hue&&i.push("float textureHue"),t.saturation&&i.push("float textureSaturation"),t.gamma&&i.push("float textureOneOverGamma"),t.colorToAlpha&&i.push("vec4 colorToAlpha");let o=i.join(", ");return`vec4 ${n}(${o})`}static _buildSampleAndBlendFunction(t,n){let i="sampleAndBlend",o=e._createSampleAndBlendFunctionSignature(n);t.addFunction(i,o,fe.FRAGMENT),t.addFunctionLines(i,["float effectiveAlpha = 1.0;"]),n.alpha&&t.addFunctionLines(i,["effectiveAlpha = textureAlpha;"]),t.addFunctionLines(i,["if (textureCoordinates.x < textureCoordinateRectangle.x) effectiveAlpha = 0.0;","if (textureCoordinates.x > textureCoordinateRectangle.z) effectiveAlpha = 0.0;","if (textureCoordinates.y < textureCoordinateRectangle.y) effectiveAlpha = 0.0;","if (textureCoordinates.y > textureCoordinateRectangle.w) effectiveAlpha = 0.0;","vec2 translation = textureCoordinateTranslationAndScale.xy;","vec2 scale = textureCoordinateTranslationAndScale.zw;","vec2 effectiveTextureCoordinates = textureCoordinates * scale + translation;","vec4 value = texture(textureToSample, effectiveTextureCoordinates);","value = czm_srgbToLinear(value);","vec3 color = value.rgb;","float alpha = value.a;"]),n.colorToAlpha&&t.addFunctionLines(i,["vec3 colorDiff = abs(color.rgb - colorToAlpha.rgb);","colorDiff.r = czm_maximumComponent(colorDiff);","alpha = czm_branchFreeTernary(colorDiff.r < colorToAlpha.a, 0.0, alpha);"]),n.gamma?t.addFunctionLines(i,["color = pow(color, vec3(textureOneOverGamma));"]):t.addFunctionLines(i,["vec4 tempColor = czm_gammaCorrect(vec4(color, alpha));","color = tempColor.rgb;","alpha = tempColor.a;"]),n.brightness&&t.addFunctionLines(i,["color = mix(vec3(0.0), color, textureBrightness);"]),n.contrast&&t.addFunctionLines(i,["color = mix(vec3(0.5), color, textureContrast);"]),n.hue&&t.addFunctionLines(i,["color = czm_hue(color, textureHue);"]),n.saturation&&t.addFunctionLines(i,["color = czm_saturation(color, textureSaturation);"]),t.addFunctionLines(i,["float sourceAlpha = alpha * effectiveAlpha;","float outAlpha = mix(previousColor.a, 1.0, sourceAlpha);","outAlpha += sign(outAlpha) - 1.0;","vec3 outColor = mix(previousColor.rgb * previousColor.a, color, sourceAlpha) / outAlpha;","vec4 result = vec4(outColor, max(outAlpha, 0.0));"]),xlt&&t.addFunctionLines(i,["if (abs(textureCoordinates.x - textureCoordinateRectangle.x) < (1.0/256.0) || "," abs(textureCoordinates.x - textureCoordinateRectangle.z) < (1.0/256.0) || "," abs(textureCoordinates.y - textureCoordinateRectangle.y) < (1.0/256.0) || "," abs(textureCoordinates.y - textureCoordinateRectangle.w) < (1.0/256.0))","{"," result = vec4(1.0, 0.0, 0.0, effectiveAlpha);","}"]),t.addFunctionLines(i,["return result;"])}static _createSampleAndBlendCallArguments(t,n,i){let o=`v_imagery_texCoord_${n}`,r=[];return r.push("blendedBaseColor"),r.push(`u_imageryTextures[${i}]`),r.push(`${o}`),r.push(`u_imageryTextureCoordinateRectangle[${i}]`),r.push(`u_imageryTextureTranslationAndScale[${i}]`),t.alpha&&r.push(`u_imageryTextureAlpha[${i}]`),t.brightness&&r.push(`u_imageryTextureBrightness[${i}]`),t.contrast&&r.push(`u_imageryTextureContrast[${i}]`),t.hue&&r.push(`u_imageryTextureHue[${i}]`),t.saturation&&r.push(`u_imageryTextureSaturation[${i}]`),t.gamma&&r.push(`u_imageryTextureOneOverGamma[${i}]`),t.colorToAlpha&&r.push(`u_imageryTextureColorToAlpha[${i}]`),r.join(", ")}static _createMainImageryShader(t,n,i){let o="blendBaseColorWithImagery";t.addFunction(o,"vec4 blendBaseColorWithImagery(vec4 baseColorWithAlpha)",fe.FRAGMENT),t.addFunctionLines(o,["vec4 blendedBaseColor = baseColorWithAlpha;"]);for(let r=0;r<n.length;r++){let a=n[r].imageryTexCoordAttributeSetIndex,c=e._createSampleAndBlendCallArguments(i,a,r);t.addFunctionLines(o,[`blendedBaseColor = sampleAndBlend(${c});`])}t.addFunctionLines(o,["return blendedBaseColor;"])}static _createImageryUniforms(t){let n=t.length,i={};i.imageryTextures=Array(n),i.imageryTextureCoordinateRectangle=Array(n),i.imageryTextureTranslationAndScale=Array(n),i.imageryTextureAlpha=Array(n),i.imageryTextureBrightness=Array(n),i.imageryTextureContrast=Array(n),i.imageryTextureHue=Array(n),i.imageryTextureSaturation=Array(n),i.imageryTextureOneOverGamma=Array(n),i.imageryTextureColorToAlpha=Array(n);for(let o=0;o<n;o++){let r=t[o],s=r.imageryLayer,a=r.texture,c=r.textureCoordinateRectangle,d=r.textureTranslationAndScale;i.imageryTextures[o]=a,i.imageryTextureTranslationAndScale[o]=d,i.imageryTextureCoordinateRectangle[o]=c,i.imageryTextureAlpha[o]=s.alpha,i.imageryTextureBrightness[o]=s.brightness,i.imageryTextureContrast[o]=s.contrast,i.imageryTextureHue[o]=s.hue,i.imageryTextureSaturation[o]=s.saturation,i.imageryTextureOneOverGamma[o]=1/s.gamma;let u=i.imageryTextureColorToAlpha[o];if(l(u)||(u=new ce,i.imageryTextureColorToAlpha[o]=u),l(s.colorToAlpha)&&s.colorToAlphaThreshold>0){let p=s.colorToAlpha;u.x=p.red,u.y=p.green,u.z=p.blue,u.w=s.colorToAlphaThreshold}else u.w=-1}return i}static _setImageryUniforms(t,n){for(let i in n)if(n.hasOwnProperty(i)){let o=`u_${i}`;t[o]=function(){return n[i]}}}static _createImageryInputs(t,n,i){let o=[];for(let r=0;r<t.length;r++){let s=t.get(r);if(!s.show)continue;let a=i[r],d=n.mappedPositionsForImageryLayer(s).cartographicBoundingRectangle,u=n.coveragesForImageryLayer(s);for(let m=0;m<u.length;m++){let p=u[m],b=e._createImageryInput(s,p,d,a);l(b)&&o.push(b)}}return o}static _createImageryInput(t,n,i,o){let r=n.imagery;if(r.state===Dn.FAILED||r.state===Dn.INVALID)return;let s=r.textureWebMercator;if(!l(s)&&(s=r.texture,!l(s))){r.state===Dn.READY&&console.log(`Imagery at ${n.x}, ${n.y} (level ${n.level}) does not have any texture - state ${r.state}`);return}let a=e._computeTextureTranslationAndScale(t,i,r.rectangle),c=n.textureCoordinateRectangle,d=new ce(c.minX,c.minY,c.maxX,c.maxY);return new rN(t,s,a,d,o)}static _computeTextureTranslationAndScale(t,n,i){let o=t.imageryProvider.tilingScheme,r=o.rectangleToNativeRectangle(n,Tlt),s=o.rectangleToNativeRectangle(i,_lt);return e._computeTextureTranslationAndScaleFromNative(r,s)}static _computeTextureTranslationAndScaleFromNative(t,n){let i=1/n.width,o=1/n.height,r=t.west-n.west,s=t.south-n.south,a=r*i,c=s*o,d=t.width*i,u=t.height*o;return new ce(a,c,d,u)}static _computeIndexMapping(t,n){let i=[],o=t.length;for(let r=0;r<o;r++){let s=t[r],a=n.indexOf(s);i.push(a)}return i}},sN=Hq;var Sxi=x(T(),1);var fxi=x(T(),1),aN=`#ifdef USE_IBL_LIGHTING vec3 computeIBL(vec3 position, vec3 normal, vec3 lightDirection, vec3 lightColorHdr, czm_modelMaterial material) { #if defined(DIFFUSE_IBL) || defined(SPECULAR_IBL) @@ -9011,7 +9007,7 @@ color = czm_linearToSrgb(color); #endif material.diffuse = color; } -`;var Qii=x(T(),1),Rxe={UNLIT:0,PBR:1};Object.freeze(Rxe);var zp=Rxe;var Cxe={name:"LightingPipelineStage"};Cxe.process=function(e,t){let{model:n,lightingOptions:i,shaderBuilder:o}=e;if(l(n.lightColor)){o.addDefine("USE_CUSTOM_LIGHT_COLOR",void 0,fe.FRAGMENT),o.addUniform("vec3","model_lightColorHdr",fe.FRAGMENT);let s=e.uniformMap;s.model_lightColorHdr=function(){return n.lightColor}}let{lightingModel:r}=i;r===zp.PBR?o.addDefine("LIGHTING_PBR",void 0,fe.FRAGMENT):o.addDefine("LIGHTING_UNLIT",void 0,fe.FRAGMENT),o.addFragmentLines(fX)};var pX=Cxe;var Aoi=x(T(),1);var roi=x(T(),1),bX=`bool isDefaultStyleColor(vec3 color) +`;var bxi=x(T(),1),OSe={UNLIT:0,PBR:1};Object.freeze(OSe);var $p=OSe;var BSe={name:"LightingPipelineStage"};BSe.process=function(e,t){let{model:n,lightingOptions:i,shaderBuilder:o}=e;if(l(n.lightColor)){o.addDefine("USE_CUSTOM_LIGHT_COLOR",void 0,fe.FRAGMENT),o.addUniform("vec3","model_lightColorHdr",fe.FRAGMENT);let s=e.uniformMap;s.model_lightColorHdr=function(){return n.lightColor}}let{lightingModel:r}=i;r===$p.PBR?o.addDefine("LIGHTING_PBR",void 0,fe.FRAGMENT):o.addDefine("LIGHTING_UNLIT",void 0,fe.FRAGMENT),o.addFragmentLines(aN)};var cN=BSe;var Hxi=x(T(),1);var Rxi=x(T(),1),lN=`bool isDefaultStyleColor(vec3 color) { return all(greaterThan(color, vec3(1.0 - czm_epsilon3))); } @@ -9460,7 +9456,7 @@ setClearcoat(material, attributes); #endif #endif } -`;var aoi=x(T(),1),gX=`#ifdef HAS_CONSTANT_LOD +`;var Vxi=x(T(),1),dN=`#ifdef HAS_CONSTANT_LOD float modelScaleX = length(czm_model[0].xyz); float modelScaleY = length(czm_model[1].xyz); float modelScaleZ = length(czm_model[2].xyz); @@ -9469,7 +9465,7 @@ vec3 enuDir = (u_constantLodWorldToEnu * czm_model * vec4(v_positionMC, 0.0)).xy v_constantLodUvCustom.xy = (enuDir.yx + u_constantLodOffset) / modelScale; v_constantLodUvCustom.z = u_constantLodDistance / modelScale; #endif -`;var loi=x(T(),1),yX=`#ifdef HAS_CONSTANT_LOD +`;var Axi=x(T(),1),uN=`#ifdef HAS_CONSTANT_LOD vec4 constantLodTextureLookup(sampler2D textureSampler, vec3 constantLodParams) { bool atMaxClamp = v_constantLodUvCustom.z >= constantLodParams.y; bool atMinClamp = v_constantLodUvCustom.z <= constantLodParams.x; @@ -9512,8 +9508,8 @@ tc2 = czm_computeTextureTransform(tc2, textureTransform); return mix(texture(textureSampler, tc1), texture(textureSampler, tc2), f); } #endif -`;var{Material:Irt,MetallicRoughness:tq,SpecularGlossiness:nq,Specular:Vxe,Clearcoat:Exe}=Vn,Axe={name:"MaterialPipelineStage",_processTexture:Od,_processTextureTransform:Gxe};Axe.process=function(e,t,n){let i=t.material,{model:o,uniformMap:r,shaderBuilder:s}=e;l(r.u_constantLodDistance)||(r.u_constantLodDistance=function(){let Z=o.boundingSphere,R=n.camera;if(l(Z)&&l(R)){let C=h.distance(R.positionWC,Z.center);return Math.max(C,.1)}return 1});let a=l(o.classificationType),c=a,{defaultTexture:d,defaultNormalTexture:u,defaultEmissiveTexture:m}=n.context;Mrt(i,r,s,d,u,m,c,e),l(i.specularGlossiness)?wrt(i.specularGlossiness,r,s,d,c,e):(l(i.specular)&&Zt.supportedExtensions.KHR_materials_specular&&krt(i.specular,r,s,d,c),l(i.anisotropy)&&Zt.supportedExtensions.KHR_materials_anisotropy&&Drt(i.anisotropy,r,s,d,c),l(i.clearcoat)&&Zt.supportedExtensions.KHR_materials_clearcoat&&Ort(i.clearcoat,r,s,d,c),Brt(i.metallicRoughness,r,s,d,c,e));let p=Zt.getAttributeBySemantic(t,dt.NORMAL),b=l(o.pointCloudShading)&&!o.pointCloudShading.normalShading;l(i.planarFill)&&Prt(i.planarFill,t,e,n);let f=l(i.planarFill)&&i.planarFill.backgroundFill,y=e.lightingOptions;i.unlit||!p||a||b||f?y.lightingModel=zp.UNLIT:y.lightingModel=zp.PBR;let _=o.backFaceCulling&&!i.doubleSided;e.renderStateOptions.cull.enabled=_;let S=e.alphaOptions;i.alphaMode===Mp.BLEND?S.pass=Le.TRANSLUCENT:i.alphaMode===Mp.MASK&&(S.alphaCutoff=i.alphaCutoff),l(i.pointDiameter)&&(s.addDefine("HAS_POINT_DIAMETER",void 0,fe.BOTH),s.addUniform("float","u_pointDiameter",fe.VERTEX),r.u_pointDiameter=function(){return i.pointDiameter*n.pixelRatio}),l(i.lineStyle)&&Nrt(i.lineStyle,t,n,r,s),s.addFragmentLines(bX),i.doubleSided&&s.addDefine("HAS_DOUBLE_SIDED_MATERIAL",void 0,fe.BOTH)};function Prt(e,t,n,i){let{uniformMap:o,shaderBuilder:r}=n;if(i.planarFillRequested=!0,r.addDefine("HAS_PLANAR_FILL_DEPTH",void 0,fe.FRAGMENT),e.backgroundFill&&r.addDefine("HAS_BACKGROUND_FILL",void 0,fe.FRAGMENT),!(l(t.featureIds)&&t.featureIds.length>0))return;let a=t.featureIds[0].positionalLabel;r.addDefine("PLANAR_FILL_FEATURE_ID",a,fe.FRAGMENT),e.behind?r.addDefine("HAS_PLANAR_FILL_BEHIND",void 0,fe.FRAGMENT):(n.planarFillIdPass=!0,r.addDefine("HAS_PLANAR_FILL_ID_PASS",void 0,fe.FRAGMENT),r.addUniform("bool","u_isPlanarFillIdPass",fe.FRAGMENT),o.u_isPlanarFillIdPass=function(){return!1})}function Xrt(e,t,n,i,o,r){let s=n.constantLod;if(!l(s)||!l(r))return;let a=`HAS_${o}_CONSTANT_LOD`;if(e.addDefine(a,void 0,fe.BOTH),!l(t.u_constantLodOffset)){e.addDefine("HAS_CONSTANT_LOD",void 0,fe.BOTH),e.addVarying("vec3","v_constantLodUvCustom"),e.addUniform("vec2","u_constantLodOffset",fe.VERTEX),e.addUniform("float","u_constantLodDistance",fe.VERTEX),e.addUniform("mat4","u_constantLodWorldToEnu",fe.VERTEX),e.addFragmentLines(yX);let d=gX.split(` -`).filter(u=>!u.trim().startsWith("//")||u.includes("#"));e.addFunctionLines("setDynamicVaryingsVS",d)}let c=`${i}ConstantLodParams`;if(e.addUniform("vec3",c,fe.FRAGMENT),t[c]=function(){return new h(s.minClampDistance,s.maxClampDistance,s.repetitions)},!l(t.u_constantLodOffset)){t.u_constantLodOffset=function(){return s.offset};let d=P.clone(P.IDENTITY),u=!1;t.u_constantLodWorldToEnu=function(){if(!u){let m=r.model.boundingSphere;if(l(m)){let p=m.center,b=_t.eastNorthUpToFixedFrame(p);P.inverse(b,d),u=!0}}return u?d:P.IDENTITY}}}function Nrt(e,t,n,i,o){let{width:r,pattern:s}=e;l(r)&&(o.addUniform("float","u_lineWidth",fe.VERTEX),i.u_lineWidth=function(){return r*n.pixelRatio}),l(s)&&(o.addDefine("HAS_LINE_PATTERN",void 0,fe.BOTH),o.addUniform("float","u_linePattern",fe.FRAGMENT),o.addVarying("float","v_lineCoord"),i.u_linePattern=function(){return s});let a=Zt.getAttributeBySemantic(t,dt.CUMULATIVE_DISTANCE);if(l(s)&&l(a)&&(t.primitiveType===Ie.LINES||t.primitiveType===Ie.TRIANGLE_STRIP)){o.addDefine("HAS_LINE_CUMULATIVE_DISTANCE",void 0,fe.VERTEX),a.normalized&&o.addDefine("LINE_CUM_DIST_NORMALIZED",void 0,fe.VERTEX),o.addUniform("float","u_cumulativeDistanceMax",fe.VERTEX),o.addUniform("float","u_pixelsPerWorld",fe.VERTEX);let c=l(a.max)?a.max:1;i.u_cumulativeDistanceMax=function(){return c},i.u_pixelsPerWorld=function(){let u=n.camera.frustum,m=1,p;return l(u.right)&&l(u.left)?p=u.right-u.left:l(u.width)&&(p=u.width),l(p)&&p>0&&(m=n.context.drawingBufferWidth/p),m};let d=Zt.getAttributeInfo(a).variableName;o.addVertexLines(` +`;var{Material:Slt,MetallicRoughness:Kq,SpecularGlossiness:Jq,Specular:zSe,Clearcoat:HSe}=Vn,KSe={name:"MaterialPipelineStage",_processTexture:Hd,_processTextureTransform:JSe};KSe.process=function(e,t,n){let i=t.material,{model:o,uniformMap:r,shaderBuilder:s}=e;l(r.u_constantLodDistance)||(r.u_constantLodDistance=function(){let Z=o.boundingSphere,R=n.camera;if(l(Z)&&l(R)){let C=h.distance(R.positionWC,Z.center);return Math.max(C,.1)}return 1});let a=l(o.classificationType),c=a,{defaultTexture:d,defaultNormalTexture:u,defaultEmissiveTexture:m}=n.context;Elt(i,r,s,d,u,m,c,e),l(i.specularGlossiness)?Alt(i.specularGlossiness,r,s,d,c,e):(l(i.specular)&&Zt.supportedExtensions.KHR_materials_specular&&Glt(i.specular,r,s,d,c),l(i.anisotropy)&&Zt.supportedExtensions.KHR_materials_anisotropy&&Wlt(i.anisotropy,r,s,d,c),l(i.clearcoat)&&Zt.supportedExtensions.KHR_materials_clearcoat&&vlt(i.clearcoat,r,s,d,c),Flt(i.metallicRoughness,r,s,d,c,e));let p=Zt.getAttributeBySemantic(t,dt.NORMAL),b=l(o.pointCloudShading)&&!o.pointCloudShading.normalShading;l(i.planarFill)&&Zlt(i.planarFill,t,e,n);let f=l(i.planarFill)&&i.planarFill.backgroundFill,y=e.lightingOptions;i.unlit||!p||a||b||f?y.lightingModel=$p.UNLIT:y.lightingModel=$p.PBR;let _=o.backFaceCulling&&!i.doubleSided;e.renderStateOptions.cull.enabled=_;let S=e.alphaOptions;i.alphaMode===Bp.BLEND?S.pass=Le.TRANSLUCENT:i.alphaMode===Bp.MASK&&(S.alphaCutoff=i.alphaCutoff),l(i.pointDiameter)&&(s.addDefine("HAS_POINT_DIAMETER",void 0,fe.BOTH),s.addUniform("float","u_pointDiameter",fe.VERTEX),r.u_pointDiameter=function(){return i.pointDiameter*n.pixelRatio}),l(i.lineStyle)&&Clt(i.lineStyle,t,n,r,s),s.addFragmentLines(lN),i.doubleSided&&s.addDefine("HAS_DOUBLE_SIDED_MATERIAL",void 0,fe.BOTH)};function Zlt(e,t,n,i){let{uniformMap:o,shaderBuilder:r}=n;if(i.planarFillRequested=!0,r.addDefine("HAS_PLANAR_FILL_DEPTH",void 0,fe.FRAGMENT),e.backgroundFill&&r.addDefine("HAS_BACKGROUND_FILL",void 0,fe.FRAGMENT),!(l(t.featureIds)&&t.featureIds.length>0))return;let a=t.featureIds[0].positionalLabel;r.addDefine("PLANAR_FILL_FEATURE_ID",a,fe.FRAGMENT),e.behind?r.addDefine("HAS_PLANAR_FILL_BEHIND",void 0,fe.FRAGMENT):(n.planarFillIdPass=!0,r.addDefine("HAS_PLANAR_FILL_ID_PASS",void 0,fe.FRAGMENT),r.addUniform("bool","u_isPlanarFillIdPass",fe.FRAGMENT),o.u_isPlanarFillIdPass=function(){return!1})}function Rlt(e,t,n,i,o,r){let s=n.constantLod;if(!l(s)||!l(r))return;let a=`HAS_${o}_CONSTANT_LOD`;if(e.addDefine(a,void 0,fe.BOTH),!l(t.u_constantLodOffset)){e.addDefine("HAS_CONSTANT_LOD",void 0,fe.BOTH),e.addVarying("vec3","v_constantLodUvCustom"),e.addUniform("vec2","u_constantLodOffset",fe.VERTEX),e.addUniform("float","u_constantLodDistance",fe.VERTEX),e.addUniform("mat4","u_constantLodWorldToEnu",fe.VERTEX),e.addFragmentLines(uN);let d=dN.split(` +`).filter(u=>!u.trim().startsWith("//")||u.includes("#"));e.addFunctionLines("setDynamicVaryingsVS",d)}let c=`${i}ConstantLodParams`;if(e.addUniform("vec3",c,fe.FRAGMENT),t[c]=function(){return new h(s.minClampDistance,s.maxClampDistance,s.repetitions)},!l(t.u_constantLodOffset)){t.u_constantLodOffset=function(){return s.offset};let d=P.clone(P.IDENTITY),u=!1;t.u_constantLodWorldToEnu=function(){if(!u){let m=r.model.boundingSphere;if(l(m)){let p=m.center,b=_t.eastNorthUpToFixedFrame(p);P.inverse(b,d),u=!0}}return u?d:P.IDENTITY}}}function Clt(e,t,n,i,o){let{width:r,pattern:s}=e;l(r)&&(o.addUniform("float","u_lineWidth",fe.VERTEX),i.u_lineWidth=function(){return r*n.pixelRatio}),l(s)&&(o.addDefine("HAS_LINE_PATTERN",void 0,fe.BOTH),o.addUniform("float","u_linePattern",fe.FRAGMENT),o.addVarying("float","v_lineCoord"),i.u_linePattern=function(){return s});let a=Zt.getAttributeBySemantic(t,dt.CUMULATIVE_DISTANCE);if(l(s)&&l(a)&&(t.primitiveType===Ie.LINES||t.primitiveType===Ie.TRIANGLE_STRIP)){o.addDefine("HAS_LINE_CUMULATIVE_DISTANCE",void 0,fe.VERTEX),a.normalized&&o.addDefine("LINE_CUM_DIST_NORMALIZED",void 0,fe.VERTEX),o.addUniform("float","u_cumulativeDistanceMax",fe.VERTEX),o.addUniform("float","u_pixelsPerWorld",fe.VERTEX);let c=l(a.max)?a.max:1;i.u_cumulativeDistanceMax=function(){return c},i.u_pixelsPerWorld=function(){let u=n.camera.frustum,m=1,p;return l(u.right)&&l(u.left)?p=u.right-u.left:l(u.width)&&(p=u.width),l(p)&&p>0&&(m=n.context.drawingBufferWidth/p),m};let d=Zt.getAttributeInfo(a).variableName;o.addVertexLines(` #ifdef HAS_LINE_CUMULATIVE_DISTANCE void lineStyleStageVS(in ProcessedAttributes attributes) { @@ -9540,7 +9536,7 @@ void lineStyleStageVS(in ProcessedAttributes attributes) } } #endif -`)}function Gxe(e,t,n,i,o){let r=`HAS_${o}_TEXTURE_TRANSFORM`;e.addDefine(r,void 0,fe.FRAGMENT);let s=`${i}Transform`;e.addUniform("mat3",s,fe.FRAGMENT),t[s]=function(){return n.transform}}function Yrt(e,t,n,i,o){let r=`HAS_${o}_TEXTURE_SCALE`;e.addDefine(r,void 0,fe.FRAGMENT);let s=`${i}Scale`;e.addUniform("float",s,fe.FRAGMENT),t[s]=function(){return n.scale}}function Od(e,t,n,i,o,r,s){e.addUniform("sampler2D",i,fe.FRAGMENT),t[i]=function(){return n.texture??r};let a=`HAS_${o}_TEXTURE`;e.addDefine(a,void 0,fe.FRAGMENT);let d=`v_texCoord_${n.texCoord}`,u=`TEXCOORD_${o}`;e.addDefine(u,d,fe.FRAGMENT);let m=n.transform;l(m)&&!q.equals(m,q.IDENTITY)&&Gxe(e,t,n,i,o);let{scale:p}=n;l(p)&&p!==1&&Yrt(e,t,n,i,o),Xrt(e,t,n,i,o,s)}function Mrt(e,t,n,i,o,r,s,a){let{emissiveFactor:c,emissiveTexture:d,normalTexture:u,occlusionTexture:m}=e;l(c)&&!h.equals(c,Irt.DEFAULT_EMISSIVE_FACTOR)&&(n.addUniform("vec3","u_emissiveFactor",fe.FRAGMENT),t.u_emissiveFactor=function(){return e.emissiveFactor},n.addDefine("HAS_EMISSIVE_FACTOR",void 0,fe.FRAGMENT),l(d)&&!s&&Od(n,t,d,"u_emissiveTexture","EMISSIVE",r));let p;if(l(e.metallicRoughness)&&l(e.metallicRoughness.baseColorTexture)&&l(e.metallicRoughness.baseColorTexture.constantLod)?p=e.metallicRoughness.baseColorTexture.constantLod:l(e.specularGlossiness)&&l(e.specularGlossiness.diffuseTexture)&&l(e.specularGlossiness.diffuseTexture.constantLod)&&(p=e.specularGlossiness.diffuseTexture.constantLod),l(u)&&!s){let b=u;l(u.constantLod)&&l(p)&&(b=Object.create(Object.getPrototypeOf(u)),Object.assign(b,u),b.constantLod=p),Od(n,t,b,"u_normalTexture","NORMAL",o,a)}l(m)&&!s&&Od(n,t,m,"u_occlusionTexture","OCCLUSION",i)}function wrt(e,t,n,i,o,r){let{diffuseTexture:s,diffuseFactor:a,specularGlossinessTexture:c,specularFactor:d,glossinessFactor:u}=e;n.addDefine("USE_SPECULAR_GLOSSINESS",void 0,fe.FRAGMENT),l(s)&&!o&&Od(n,t,s,"u_diffuseTexture","DIFFUSE",i,r),l(a)&&!ce.equals(a,nq.DEFAULT_DIFFUSE_FACTOR)&&(n.addUniform("vec4","u_diffuseFactor",fe.FRAGMENT),t.u_diffuseFactor=function(){return e.diffuseFactor},n.addDefine("HAS_DIFFUSE_FACTOR",void 0,fe.FRAGMENT)),l(c)&&!o&&Od(n,t,c,"u_specularGlossinessTexture","SPECULAR_GLOSSINESS",i),l(d)&&!h.equals(d,nq.DEFAULT_SPECULAR_FACTOR)&&(n.addUniform("vec3","u_legacySpecularFactor",fe.FRAGMENT),t.u_legacySpecularFactor=function(){return e.specularFactor},n.addDefine("HAS_LEGACY_SPECULAR_FACTOR",void 0,fe.FRAGMENT)),l(u)&&u!==nq.DEFAULT_GLOSSINESS_FACTOR&&(n.addUniform("float","u_glossinessFactor",fe.FRAGMENT),t.u_glossinessFactor=function(){return e.glossinessFactor},n.addDefine("HAS_GLOSSINESS_FACTOR",void 0,fe.FRAGMENT))}function krt(e,t,n,i,o){let{specularTexture:r,specularFactor:s,specularColorTexture:a,specularColorFactor:c}=e;n.addDefine("USE_SPECULAR",void 0,fe.FRAGMENT),l(r)&&!o&&Od(n,t,r,"u_specularTexture","SPECULAR",i),l(s)&&s!==Vxe.DEFAULT_SPECULAR_FACTOR&&(n.addUniform("float","u_specularFactor",fe.FRAGMENT),t.u_specularFactor=function(){return e.specularFactor},n.addDefine("HAS_SPECULAR_FACTOR",void 0,fe.FRAGMENT)),l(a)&&!o&&Od(n,t,a,"u_specularColorTexture","SPECULAR_COLOR",i),l(c)&&!h.equals(c,Vxe.DEFAULT_SPECULAR_COLOR_FACTOR)&&(n.addUniform("vec3","u_specularColorFactor",fe.FRAGMENT),t.u_specularColorFactor=function(){return e.specularColorFactor},n.addDefine("HAS_SPECULAR_COLOR_FACTOR",void 0,fe.FRAGMENT))}var Urt=new h;function Drt(e,t,n,i,o){let{anisotropyStrength:r,anisotropyRotation:s,anisotropyTexture:a}=e;n.addDefine("USE_ANISOTROPY",void 0,fe.FRAGMENT),l(a)&&!o&&Od(n,t,a,"u_anisotropyTexture","ANISOTROPY",i);let c=Math.cos(s),d=Math.sin(s);n.addUniform("vec3","u_anisotropy",fe.FRAGMENT),t.u_anisotropy=function(){return h.fromElements(c,d,r,Urt)}}function Ort(e,t,n,i,o){let{clearcoatFactor:r,clearcoatTexture:s,clearcoatRoughnessFactor:a,clearcoatRoughnessTexture:c,clearcoatNormalTexture:d}=e;n.addDefine("USE_CLEARCOAT",void 0,fe.FRAGMENT),l(r)&&r!==Exe.DEFAULT_CLEARCOAT_FACTOR&&(n.addUniform("float","u_clearcoatFactor",fe.FRAGMENT),t.u_clearcoatFactor=function(){return e.clearcoatFactor},n.addDefine("HAS_CLEARCOAT_FACTOR",void 0,fe.FRAGMENT)),l(s)&&!o&&Od(n,t,s,"u_clearcoatTexture","CLEARCOAT",i),l(a)&&r!==Exe.DEFAULT_CLEARCOAT_ROUGHNESS_FACTOR&&(n.addUniform("float","u_clearcoatRoughnessFactor",fe.FRAGMENT),t.u_clearcoatRoughnessFactor=function(){return e.clearcoatRoughnessFactor},n.addDefine("HAS_CLEARCOAT_ROUGHNESS_FACTOR",void 0,fe.FRAGMENT)),l(c)&&!o&&Od(n,t,c,"u_clearcoatRoughnessTexture","CLEARCOAT_ROUGHNESS",i),l(d)&&!o&&Od(n,t,d,"u_clearcoatNormalTexture","CLEARCOAT_NORMAL",i)}function Brt(e,t,n,i,o,r){n.addDefine("USE_METALLIC_ROUGHNESS",void 0,fe.FRAGMENT);let s=e.baseColorTexture;l(s)&&!o&&Od(n,t,s,"u_baseColorTexture","BASE_COLOR",i,r);let a=e.baseColorFactor;l(a)&&!ce.equals(a,tq.DEFAULT_BASE_COLOR_FACTOR)&&(n.addUniform("vec4","u_baseColorFactor",fe.FRAGMENT),t.u_baseColorFactor=function(){return e.baseColorFactor},n.addDefine("HAS_BASE_COLOR_FACTOR",void 0,fe.FRAGMENT));let c=e.metallicRoughnessTexture;l(c)&&!o&&Od(n,t,c,"u_metallicRoughnessTexture","METALLIC_ROUGHNESS",i);let d=e.metallicFactor;l(d)&&d!==tq.DEFAULT_METALLIC_FACTOR&&(n.addUniform("float","u_metallicFactor",fe.FRAGMENT),t.u_metallicFactor=function(){return e.metallicFactor},n.addDefine("HAS_METALLIC_FACTOR",void 0,fe.FRAGMENT));let u=e.roughnessFactor;l(u)&&u!==tq.DEFAULT_ROUGHNESS_FACTOR&&(n.addUniform("float","u_roughnessFactor",fe.FRAGMENT),t.u_roughnessFactor=function(){return e.roughnessFactor},n.addDefine("HAS_ROUGHNESS_FACTOR",void 0,fe.FRAGMENT))}var xX=Axe;var Woi=x(T(),1);var id={name:"MetadataPickingPipelineStage",METADATA_PICKING_ENABLED:"METADATA_PICKING_ENABLED",METADATA_PICKING_VALUE_TYPE:"METADATA_PICKING_VALUE_TYPE",METADATA_PICKING_VALUE_STRING:"METADATA_PICKING_VALUE_STRING",METADATA_PICKING_VALUE_COMPONENT_X:"METADATA_PICKING_VALUE_COMPONENT_X",METADATA_PICKING_VALUE_COMPONENT_Y:"METADATA_PICKING_VALUE_COMPONENT_Y",METADATA_PICKING_VALUE_COMPONENT_Z:"METADATA_PICKING_VALUE_COMPONENT_Z",METADATA_PICKING_VALUE_COMPONENT_W:"METADATA_PICKING_VALUE_COMPONENT_W"};id.process=function(e,t,n){let i=e.shaderBuilder;i.addDefine(id.METADATA_PICKING_VALUE_TYPE,"float",fe.FRAGMENT),i.addDefine(id.METADATA_PICKING_VALUE_STRING,"0.0",fe.FRAGMENT),i.addDefine(id.METADATA_PICKING_VALUE_COMPONENT_X,"0.0",fe.FRAGMENT),i.addDefine(id.METADATA_PICKING_VALUE_COMPONENT_Y,"0.0",fe.FRAGMENT),i.addDefine(id.METADATA_PICKING_VALUE_COMPONENT_Z,"0.0",fe.FRAGMENT),i.addDefine(id.METADATA_PICKING_VALUE_COMPONENT_W,"0.0",fe.FRAGMENT),i.addFunction("metadataPickingStage","void metadataPickingStage(Metadata metadata, MetadataClass metadataClass, inout vec4 metadataValues)",fe.FRAGMENT),i.addFunctionLines("metadataPickingStage",[`${id.METADATA_PICKING_VALUE_TYPE} value = ${id.METADATA_PICKING_VALUE_TYPE}(${id.METADATA_PICKING_VALUE_STRING});`,`metadataValues.x = ${id.METADATA_PICKING_VALUE_COMPONENT_X};`,`metadataValues.y = ${id.METADATA_PICKING_VALUE_COMPONENT_Y};`,`metadataValues.z = ${id.METADATA_PICKING_VALUE_COMPONENT_Z};`,`metadataValues.w = ${id.METADATA_PICKING_VALUE_COMPONENT_W};`],fe.FRAGMENT)};var Nu=id;var koi=x(T(),1);var Foi=x(T(),1),TX=`void morphTargetsStage(inout ProcessedAttributes attributes) +`)}function JSe(e,t,n,i,o){let r=`HAS_${o}_TEXTURE_TRANSFORM`;e.addDefine(r,void 0,fe.FRAGMENT);let s=`${i}Transform`;e.addUniform("mat3",s,fe.FRAGMENT),t[s]=function(){return n.transform}}function Vlt(e,t,n,i,o){let r=`HAS_${o}_TEXTURE_SCALE`;e.addDefine(r,void 0,fe.FRAGMENT);let s=`${i}Scale`;e.addUniform("float",s,fe.FRAGMENT),t[s]=function(){return n.scale}}function Hd(e,t,n,i,o,r,s){e.addUniform("sampler2D",i,fe.FRAGMENT),t[i]=function(){return n.texture??r};let a=`HAS_${o}_TEXTURE`;e.addDefine(a,void 0,fe.FRAGMENT);let d=`v_texCoord_${n.texCoord}`,u=`TEXCOORD_${o}`;e.addDefine(u,d,fe.FRAGMENT);let m=n.transform;l(m)&&!q.equals(m,q.IDENTITY)&&JSe(e,t,n,i,o);let{scale:p}=n;l(p)&&p!==1&&Vlt(e,t,n,i,o),Rlt(e,t,n,i,o,s)}function Elt(e,t,n,i,o,r,s,a){let{emissiveFactor:c,emissiveTexture:d,normalTexture:u,occlusionTexture:m}=e;l(c)&&!h.equals(c,Slt.DEFAULT_EMISSIVE_FACTOR)&&(n.addUniform("vec3","u_emissiveFactor",fe.FRAGMENT),t.u_emissiveFactor=function(){return e.emissiveFactor},n.addDefine("HAS_EMISSIVE_FACTOR",void 0,fe.FRAGMENT),l(d)&&!s&&Hd(n,t,d,"u_emissiveTexture","EMISSIVE",r));let p;if(l(e.metallicRoughness)&&l(e.metallicRoughness.baseColorTexture)&&l(e.metallicRoughness.baseColorTexture.constantLod)?p=e.metallicRoughness.baseColorTexture.constantLod:l(e.specularGlossiness)&&l(e.specularGlossiness.diffuseTexture)&&l(e.specularGlossiness.diffuseTexture.constantLod)&&(p=e.specularGlossiness.diffuseTexture.constantLod),l(u)&&!s){let b=u;l(u.constantLod)&&l(p)&&(b=Object.create(Object.getPrototypeOf(u)),Object.assign(b,u),b.constantLod=p),Hd(n,t,b,"u_normalTexture","NORMAL",o,a)}l(m)&&!s&&Hd(n,t,m,"u_occlusionTexture","OCCLUSION",i)}function Alt(e,t,n,i,o,r){let{diffuseTexture:s,diffuseFactor:a,specularGlossinessTexture:c,specularFactor:d,glossinessFactor:u}=e;n.addDefine("USE_SPECULAR_GLOSSINESS",void 0,fe.FRAGMENT),l(s)&&!o&&Hd(n,t,s,"u_diffuseTexture","DIFFUSE",i,r),l(a)&&!ce.equals(a,Jq.DEFAULT_DIFFUSE_FACTOR)&&(n.addUniform("vec4","u_diffuseFactor",fe.FRAGMENT),t.u_diffuseFactor=function(){return e.diffuseFactor},n.addDefine("HAS_DIFFUSE_FACTOR",void 0,fe.FRAGMENT)),l(c)&&!o&&Hd(n,t,c,"u_specularGlossinessTexture","SPECULAR_GLOSSINESS",i),l(d)&&!h.equals(d,Jq.DEFAULT_SPECULAR_FACTOR)&&(n.addUniform("vec3","u_legacySpecularFactor",fe.FRAGMENT),t.u_legacySpecularFactor=function(){return e.specularFactor},n.addDefine("HAS_LEGACY_SPECULAR_FACTOR",void 0,fe.FRAGMENT)),l(u)&&u!==Jq.DEFAULT_GLOSSINESS_FACTOR&&(n.addUniform("float","u_glossinessFactor",fe.FRAGMENT),t.u_glossinessFactor=function(){return e.glossinessFactor},n.addDefine("HAS_GLOSSINESS_FACTOR",void 0,fe.FRAGMENT))}function Glt(e,t,n,i,o){let{specularTexture:r,specularFactor:s,specularColorTexture:a,specularColorFactor:c}=e;n.addDefine("USE_SPECULAR",void 0,fe.FRAGMENT),l(r)&&!o&&Hd(n,t,r,"u_specularTexture","SPECULAR",i),l(s)&&s!==zSe.DEFAULT_SPECULAR_FACTOR&&(n.addUniform("float","u_specularFactor",fe.FRAGMENT),t.u_specularFactor=function(){return e.specularFactor},n.addDefine("HAS_SPECULAR_FACTOR",void 0,fe.FRAGMENT)),l(a)&&!o&&Hd(n,t,a,"u_specularColorTexture","SPECULAR_COLOR",i),l(c)&&!h.equals(c,zSe.DEFAULT_SPECULAR_COLOR_FACTOR)&&(n.addUniform("vec3","u_specularColorFactor",fe.FRAGMENT),t.u_specularColorFactor=function(){return e.specularColorFactor},n.addDefine("HAS_SPECULAR_COLOR_FACTOR",void 0,fe.FRAGMENT))}var Llt=new h;function Wlt(e,t,n,i,o){let{anisotropyStrength:r,anisotropyRotation:s,anisotropyTexture:a}=e;n.addDefine("USE_ANISOTROPY",void 0,fe.FRAGMENT),l(a)&&!o&&Hd(n,t,a,"u_anisotropyTexture","ANISOTROPY",i);let c=Math.cos(s),d=Math.sin(s);n.addUniform("vec3","u_anisotropy",fe.FRAGMENT),t.u_anisotropy=function(){return h.fromElements(c,d,r,Llt)}}function vlt(e,t,n,i,o){let{clearcoatFactor:r,clearcoatTexture:s,clearcoatRoughnessFactor:a,clearcoatRoughnessTexture:c,clearcoatNormalTexture:d}=e;n.addDefine("USE_CLEARCOAT",void 0,fe.FRAGMENT),l(r)&&r!==HSe.DEFAULT_CLEARCOAT_FACTOR&&(n.addUniform("float","u_clearcoatFactor",fe.FRAGMENT),t.u_clearcoatFactor=function(){return e.clearcoatFactor},n.addDefine("HAS_CLEARCOAT_FACTOR",void 0,fe.FRAGMENT)),l(s)&&!o&&Hd(n,t,s,"u_clearcoatTexture","CLEARCOAT",i),l(a)&&r!==HSe.DEFAULT_CLEARCOAT_ROUGHNESS_FACTOR&&(n.addUniform("float","u_clearcoatRoughnessFactor",fe.FRAGMENT),t.u_clearcoatRoughnessFactor=function(){return e.clearcoatRoughnessFactor},n.addDefine("HAS_CLEARCOAT_ROUGHNESS_FACTOR",void 0,fe.FRAGMENT)),l(c)&&!o&&Hd(n,t,c,"u_clearcoatRoughnessTexture","CLEARCOAT_ROUGHNESS",i),l(d)&&!o&&Hd(n,t,d,"u_clearcoatNormalTexture","CLEARCOAT_NORMAL",i)}function Flt(e,t,n,i,o,r){n.addDefine("USE_METALLIC_ROUGHNESS",void 0,fe.FRAGMENT);let s=e.baseColorTexture;l(s)&&!o&&Hd(n,t,s,"u_baseColorTexture","BASE_COLOR",i,r);let a=e.baseColorFactor;l(a)&&!ce.equals(a,Kq.DEFAULT_BASE_COLOR_FACTOR)&&(n.addUniform("vec4","u_baseColorFactor",fe.FRAGMENT),t.u_baseColorFactor=function(){return e.baseColorFactor},n.addDefine("HAS_BASE_COLOR_FACTOR",void 0,fe.FRAGMENT));let c=e.metallicRoughnessTexture;l(c)&&!o&&Hd(n,t,c,"u_metallicRoughnessTexture","METALLIC_ROUGHNESS",i);let d=e.metallicFactor;l(d)&&d!==Kq.DEFAULT_METALLIC_FACTOR&&(n.addUniform("float","u_metallicFactor",fe.FRAGMENT),t.u_metallicFactor=function(){return e.metallicFactor},n.addDefine("HAS_METALLIC_FACTOR",void 0,fe.FRAGMENT));let u=e.roughnessFactor;l(u)&&u!==Kq.DEFAULT_ROUGHNESS_FACTOR&&(n.addUniform("float","u_roughnessFactor",fe.FRAGMENT),t.u_roughnessFactor=function(){return e.roughnessFactor},n.addDefine("HAS_ROUGHNESS_FACTOR",void 0,fe.FRAGMENT))}var mN=KSe;var jxi=x(T(),1);var ad={name:"MetadataPickingPipelineStage",METADATA_PICKING_ENABLED:"METADATA_PICKING_ENABLED",METADATA_PICKING_VALUE_TYPE:"METADATA_PICKING_VALUE_TYPE",METADATA_PICKING_VALUE_STRING:"METADATA_PICKING_VALUE_STRING",METADATA_PICKING_VALUE_COMPONENT_X:"METADATA_PICKING_VALUE_COMPONENT_X",METADATA_PICKING_VALUE_COMPONENT_Y:"METADATA_PICKING_VALUE_COMPONENT_Y",METADATA_PICKING_VALUE_COMPONENT_Z:"METADATA_PICKING_VALUE_COMPONENT_Z",METADATA_PICKING_VALUE_COMPONENT_W:"METADATA_PICKING_VALUE_COMPONENT_W"};ad.process=function(e,t,n){let i=e.shaderBuilder;i.addDefine(ad.METADATA_PICKING_VALUE_TYPE,"float",fe.FRAGMENT),i.addDefine(ad.METADATA_PICKING_VALUE_STRING,"0.0",fe.FRAGMENT),i.addDefine(ad.METADATA_PICKING_VALUE_COMPONENT_X,"0.0",fe.FRAGMENT),i.addDefine(ad.METADATA_PICKING_VALUE_COMPONENT_Y,"0.0",fe.FRAGMENT),i.addDefine(ad.METADATA_PICKING_VALUE_COMPONENT_Z,"0.0",fe.FRAGMENT),i.addDefine(ad.METADATA_PICKING_VALUE_COMPONENT_W,"0.0",fe.FRAGMENT),i.addFunction("metadataPickingStage","void metadataPickingStage(Metadata metadata, MetadataClass metadataClass, inout vec4 metadataValues)",fe.FRAGMENT),i.addFunctionLines("metadataPickingStage",[`${ad.METADATA_PICKING_VALUE_TYPE} value = ${ad.METADATA_PICKING_VALUE_TYPE}(${ad.METADATA_PICKING_VALUE_STRING});`,`metadataValues.x = ${ad.METADATA_PICKING_VALUE_COMPONENT_X};`,`metadataValues.y = ${ad.METADATA_PICKING_VALUE_COMPONENT_Y};`,`metadataValues.z = ${ad.METADATA_PICKING_VALUE_COMPONENT_Z};`,`metadataValues.w = ${ad.METADATA_PICKING_VALUE_COMPONENT_W};`],fe.FRAGMENT)};var Ou=ad;var sTi=x(T(),1);var qxi=x(T(),1),hN=`void morphTargetsStage(inout ProcessedAttributes attributes) { vec3 positionMC = attributes.positionMC; attributes.positionMC = getMorphedPosition(positionMC); @@ -9553,7 +9549,7 @@ vec3 tangentMC = attributes.tangentMC; attributes.tangentMC = getMorphedTangent(tangentMC); #endif } -`;var Pc={name:"MorphTargetsPipelineStage",FUNCTION_ID_GET_MORPHED_POSITION:"getMorphedPosition",FUNCTION_SIGNATURE_GET_MORPHED_POSITION:"vec3 getMorphedPosition(in vec3 position)",FUNCTION_ID_GET_MORPHED_NORMAL:"getMorphedNormal",FUNCTION_SIGNATURE_GET_MORPHED_NORMAL:"vec3 getMorphedNormal(in vec3 normal)",FUNCTION_ID_GET_MORPHED_TANGENT:"getMorphedTangent",FUNCTION_SIGNATURE_GET_MORPHED_TANGENT:"vec3 getMorphedTangent(in vec3 tangent)"};Pc.process=function(e,t){let n=e.shaderBuilder;n.addDefine("HAS_MORPH_TARGETS",void 0,fe.VERTEX),Qrt(n);let i=t.morphTargets.length;for(let a=0;a<i;a++){let c=t.morphTargets[a].attributes,d=c.length;for(let u=0;u<d;u++){let m=c[u],p=m.semantic;p!==dt.POSITION&&p!==dt.NORMAL&&p!==dt.TANGENT||(Hrt(e,m,e.attributeIndex,a),e.attributeIndex++)}}qrt(n);let r=e.runtimeNode.morphWeights.length;n.addUniform("float",`u_morphWeights[${r}]`,fe.VERTEX),n.addVertexLines(TX);let s={u_morphWeights:function(){return e.runtimeNode.morphWeights}};e.uniformMap=It(s,e.uniformMap)};var zrt={attributeString:void 0,functionId:void 0};function Hrt(e,t,n,i){let o=e.shaderBuilder;Krt(e,t,n);let r=Jrt(t,zrt);jrt(o,r,i)}function Krt(e,t,n){let i={index:n,value:l(t.buffer)?void 0:t.constant,vertexBuffer:t.buffer,componentsPerAttribute:Dt.getNumberOfComponents(t.type),componentDatatype:t.componentDatatype,offsetInBytes:t.byteOffset,strideInBytes:t.byteStride,normalize:t.normalized};e.attributes.push(i)}function Jrt(e,t){switch(e.semantic){case dt.POSITION:t.attributeString="Position",t.functionId=Pc.FUNCTION_ID_GET_MORPHED_POSITION;break;case dt.NORMAL:t.attributeString="Normal",t.functionId=Pc.FUNCTION_ID_GET_MORPHED_NORMAL;break;case dt.TANGENT:t.attributeString="Tangent",t.functionId=Pc.FUNCTION_ID_GET_MORPHED_TANGENT;break;default:break}return t}function jrt(e,t,n){let i=t.attributeString,o=`a_target${i}_${n}`,r=`morphed${i} += u_morphWeights[${n}] * a_target${i}_${n};`;e.addAttribute("vec3",o),e.addFunctionLines(t.functionId,[r])}function Qrt(e){e.addFunction(Pc.FUNCTION_ID_GET_MORPHED_POSITION,Pc.FUNCTION_SIGNATURE_GET_MORPHED_POSITION,fe.VERTEX),e.addFunctionLines(Pc.FUNCTION_ID_GET_MORPHED_POSITION,["vec3 morphedPosition = position;"]),e.addFunction(Pc.FUNCTION_ID_GET_MORPHED_NORMAL,Pc.FUNCTION_SIGNATURE_GET_MORPHED_NORMAL,fe.VERTEX),e.addFunctionLines(Pc.FUNCTION_ID_GET_MORPHED_NORMAL,["vec3 morphedNormal = normal;"]),e.addFunction(Pc.FUNCTION_ID_GET_MORPHED_TANGENT,Pc.FUNCTION_SIGNATURE_GET_MORPHED_TANGENT,fe.VERTEX),e.addFunctionLines(Pc.FUNCTION_ID_GET_MORPHED_TANGENT,["vec3 morphedTangent = tangent;"])}function qrt(e){e.addFunctionLines(Pc.FUNCTION_ID_GET_MORPHED_POSITION,["return morphedPosition;"]),e.addFunctionLines(Pc.FUNCTION_ID_GET_MORPHED_NORMAL,["return morphedNormal;"]),e.addFunctionLines(Pc.FUNCTION_ID_GET_MORPHED_TANGENT,["return morphedTangent;"])}var _X=Pc;var Qoi=x(T(),1);var Lxe={name:"PickingPipelineStage"};function iq(e){return`vec4(rgba8UnormToUint32(${e}), isEdge ? 1.0 : 0.0, -v_positionEC.z, 0.0)`}Lxe.process=function(e,t,n){let i=n.context,o=e.runtimeNode,r=e.shaderBuilder,s=e.model,a=o.node.instances;if(e.hasPropertyTable)$rt(e,t,a,i);else if(l(a))est(e,i);else{let c=Wxe(e),d=i.createPickId(c);s._pipelineResources.push(d),s._pickIds.push(d),r.addUniform("vec4","czm_pickColor",fe.FRAGMENT);let u=e.uniformMap;u.czm_pickColor=function(){return d.color},e.pickId="czm_pickColor",e.snapId=iq(e.pickId)}!l(s.classificationType)&&s.hasDrapedVectors()&&(e.pickId=`vectorPickColorOver(${e.pickId})`)};function Wxe(e,t){let n=e.model;if(l(n.pickObject))return n.pickObject;let i={model:n,node:e.runtimeNode,primitive:e.runtimePrimitive},o;if(Or.is3DTiles(n.type)){let r=n.content;o={content:r,primitive:r.tileset,detail:i}}else o={primitive:n,detail:i};return o.id=n.id,l(t)&&(o.instanceId=t),o}function $rt(e,t,n){let i=e.model,o,r,s=i.featureIdLabel,a=i.instanceFeatureIdLabel;l(i.featureTableId)?o=i.featureTableId:l(n)?(r=Zt.getFeatureIdsByLabel(n.featureIds,a),o=r.propertyTableId):(r=Zt.getFeatureIdsByLabel(t.featureIds,s),o=r.propertyTableId);let c=i.featureTables[o];e.shaderBuilder.addUniform("sampler2D","model_pickTexture",fe.FRAGMENT);let u=c.batchTexture;e.uniformMap.model_pickTexture=function(){return u.pickTexture??u.defaultTexture},e.pickId="((selectedFeature.id < int(model_featuresLength)) ? texture(model_pickTexture, selectedFeature.st) : vec4(0.0))",e.snapId=iq(e.pickId)}function est(e,t){let n=e.instanceCount,i=new Array(n),o=new Uint8Array(n*4),r=e.model,s=r._pipelineResources;for(let m=0;m<n;m++){let p=Wxe(e,m),b=t.createPickId(p);s.push(b),i[m]=b;let f=b.color;o[m*4+0]=U.floatToByte(f.red),o[m*4+1]=U.floatToByte(f.green),o[m*4+2]=U.floatToByte(f.blue),o[m*4+3]=U.floatToByte(f.alpha)}r._pickIds=i;let a=it.createVertexBuffer({context:t,typedArray:o,usage:Pe.STATIC_DRAW});a.vertexArrayDestroyable=!1,r.statistics.addBuffer(a,!1),s.push(a);let d={index:e.attributeIndex++,vertexBuffer:a,componentsPerAttribute:4,componentDatatype:J.UNSIGNED_BYTE,normalize:!0,offsetInBytes:0,strideInBytes:0,instanceDivisor:1};e.attributes.push(d);let u=e.shaderBuilder;u.addDefine("USE_PICKING",void 0,fe.BOTH),u.addAttribute("vec4","a_pickColor"),u.addVarying("vec4","v_pickColor"),e.pickId="v_pickColor",e.snapId=iq(e.pickId)}var SX=Lxe;var xri=x(T(),1);var $oi=x(T(),1),vxe={ADD:0,REPLACE:1};Object.freeze(vxe);var xr=vxe;var tri=x(T(),1),ZX=`float getPointSizeFromAttenuation(vec3 positionEC) { +`;var Pc={name:"MorphTargetsPipelineStage",FUNCTION_ID_GET_MORPHED_POSITION:"getMorphedPosition",FUNCTION_SIGNATURE_GET_MORPHED_POSITION:"vec3 getMorphedPosition(in vec3 position)",FUNCTION_ID_GET_MORPHED_NORMAL:"getMorphedNormal",FUNCTION_SIGNATURE_GET_MORPHED_NORMAL:"vec3 getMorphedNormal(in vec3 normal)",FUNCTION_ID_GET_MORPHED_TANGENT:"getMorphedTangent",FUNCTION_SIGNATURE_GET_MORPHED_TANGENT:"vec3 getMorphedTangent(in vec3 tangent)"};Pc.process=function(e,t){let n=e.shaderBuilder;n.addDefine("HAS_MORPH_TARGETS",void 0,fe.VERTEX),Mlt(n);let i=t.morphTargets.length;for(let a=0;a<i;a++){let c=t.morphTargets[a].attributes,d=c.length;for(let u=0;u<d;u++){let m=c[u],p=m.semantic;p!==dt.POSITION&&p!==dt.NORMAL&&p!==dt.TANGENT||(Plt(e,m,e.attributeIndex,a),e.attributeIndex++)}}wlt(n);let r=e.runtimeNode.morphWeights.length;n.addUniform("float",`u_morphWeights[${r}]`,fe.VERTEX),n.addVertexLines(hN);let s={u_morphWeights:function(){return e.runtimeNode.morphWeights}};e.uniformMap=It(s,e.uniformMap)};var Ilt={attributeString:void 0,functionId:void 0};function Plt(e,t,n,i){let o=e.shaderBuilder;Xlt(e,t,n);let r=Nlt(t,Ilt);Ylt(o,r,i)}function Xlt(e,t,n){let i={index:n,value:l(t.buffer)?void 0:t.constant,vertexBuffer:t.buffer,componentsPerAttribute:Dt.getNumberOfComponents(t.type),componentDatatype:t.componentDatatype,offsetInBytes:t.byteOffset,strideInBytes:t.byteStride,normalize:t.normalized};e.attributes.push(i)}function Nlt(e,t){switch(e.semantic){case dt.POSITION:t.attributeString="Position",t.functionId=Pc.FUNCTION_ID_GET_MORPHED_POSITION;break;case dt.NORMAL:t.attributeString="Normal",t.functionId=Pc.FUNCTION_ID_GET_MORPHED_NORMAL;break;case dt.TANGENT:t.attributeString="Tangent",t.functionId=Pc.FUNCTION_ID_GET_MORPHED_TANGENT;break;default:break}return t}function Ylt(e,t,n){let i=t.attributeString,o=`a_target${i}_${n}`,r=`morphed${i} += u_morphWeights[${n}] * a_target${i}_${n};`;e.addAttribute("vec3",o),e.addFunctionLines(t.functionId,[r])}function Mlt(e){e.addFunction(Pc.FUNCTION_ID_GET_MORPHED_POSITION,Pc.FUNCTION_SIGNATURE_GET_MORPHED_POSITION,fe.VERTEX),e.addFunctionLines(Pc.FUNCTION_ID_GET_MORPHED_POSITION,["vec3 morphedPosition = position;"]),e.addFunction(Pc.FUNCTION_ID_GET_MORPHED_NORMAL,Pc.FUNCTION_SIGNATURE_GET_MORPHED_NORMAL,fe.VERTEX),e.addFunctionLines(Pc.FUNCTION_ID_GET_MORPHED_NORMAL,["vec3 morphedNormal = normal;"]),e.addFunction(Pc.FUNCTION_ID_GET_MORPHED_TANGENT,Pc.FUNCTION_SIGNATURE_GET_MORPHED_TANGENT,fe.VERTEX),e.addFunctionLines(Pc.FUNCTION_ID_GET_MORPHED_TANGENT,["vec3 morphedTangent = tangent;"])}function wlt(e){e.addFunctionLines(Pc.FUNCTION_ID_GET_MORPHED_POSITION,["return morphedPosition;"]),e.addFunctionLines(Pc.FUNCTION_ID_GET_MORPHED_NORMAL,["return morphedNormal;"]),e.addFunctionLines(Pc.FUNCTION_ID_GET_MORPHED_TANGENT,["return morphedTangent;"])}var fN=Pc;var bTi=x(T(),1);var jSe={name:"PickingPipelineStage"};function jq(e){return`vec4(rgba8UnormToUint32(${e}), isEdge ? 1.0 : 0.0, -v_positionEC.z, 0.0)`}jSe.process=function(e,t,n){let i=n.context,o=e.runtimeNode,r=e.shaderBuilder,s=e.model,a=o.node.instances;if(e.hasPropertyTable)klt(e,t,a,i);else if(l(a))Ult(e,i);else{let c=QSe(e),d=i.createPickId(c);s._pipelineResources.push(d),s._pickIds.push(d),r.addUniform("vec4","czm_pickColor",fe.FRAGMENT);let u=e.uniformMap;u.czm_pickColor=function(){return d.color},e.pickId="czm_pickColor",e.snapId=jq(e.pickId)}!l(s.classificationType)&&s.hasDrapedVectors()&&(e.pickId=`vectorPickColorOver(${e.pickId})`)};function QSe(e,t){let n=e.model;if(l(n.pickObject))return n.pickObject;let i={model:n,node:e.runtimeNode,primitive:e.runtimePrimitive},o;if(Br.is3DTiles(n.type)){let r=n.content;o={content:r,primitive:r.tileset,detail:i}}else o={primitive:n,detail:i};return o.id=n.id,l(t)&&(o.instanceId=t),o}function klt(e,t,n){let i=e.model,o,r,s=i.featureIdLabel,a=i.instanceFeatureIdLabel;l(i.featureTableId)?o=i.featureTableId:l(n)?(r=Zt.getFeatureIdsByLabel(n.featureIds,a),o=r.propertyTableId):(r=Zt.getFeatureIdsByLabel(t.featureIds,s),o=r.propertyTableId);let c=i.featureTables[o];e.shaderBuilder.addUniform("sampler2D","model_pickTexture",fe.FRAGMENT);let u=c.batchTexture;e.uniformMap.model_pickTexture=function(){return u.pickTexture??u.defaultTexture},e.pickId="((selectedFeature.id < int(model_featuresLength)) ? texture(model_pickTexture, selectedFeature.st) : vec4(0.0))",e.snapId=jq(e.pickId)}function Ult(e,t){let n=e.instanceCount,i=new Array(n),o=new Uint8Array(n*4),r=e.model,s=r._pipelineResources;for(let m=0;m<n;m++){let p=QSe(e,m),b=t.createPickId(p);s.push(b),i[m]=b;let f=b.color;o[m*4+0]=U.floatToByte(f.red),o[m*4+1]=U.floatToByte(f.green),o[m*4+2]=U.floatToByte(f.blue),o[m*4+3]=U.floatToByte(f.alpha)}r._pickIds=i;let a=it.createVertexBuffer({context:t,typedArray:o,usage:Pe.STATIC_DRAW});a.vertexArrayDestroyable=!1,r.statistics.addBuffer(a,!1),s.push(a);let d={index:e.attributeIndex++,vertexBuffer:a,componentsPerAttribute:4,componentDatatype:J.UNSIGNED_BYTE,normalize:!0,offsetInBytes:0,strideInBytes:0,instanceDivisor:1};e.attributes.push(d);let u=e.shaderBuilder;u.addDefine("USE_PICKING",void 0,fe.BOTH),u.addAttribute("vec4","a_pickColor"),u.addVarying("vec4","v_pickColor"),e.pickId="v_pickColor",e.snapId=jq(e.pickId)}var pN=jSe;var YTi=x(T(),1);var yTi=x(T(),1),qSe={ADD:0,REPLACE:1};Object.freeze(qSe);var Tr=qSe;var TTi=x(T(),1),bN=`float getPointSizeFromAttenuation(vec3 positionEC) { float pointSize = model_pointCloudParameters.x; float geometricError = model_pointCloudParameters.y; float depthMultiplier = model_pointCloudParameters.z; @@ -9591,10 +9587,10 @@ return 1.0; #endif } #endif -`;var tst=new ce,Ixe={name:"PointCloudStylingPipelineStage"};Ixe.process=function(e,t,n){let i=e.shaderBuilder,o=e.model,r=o.style,s=o.structuralMetadata,a=l(s)?s.propertyAttributes:void 0,c=l(o.featureTableId)&&o.featureTables[o.featureTableId].featuresLength>0,d=!l(a)&&c;if(l(r)&&!d){let y=rst(a),_=sst(r,y);ast(i,_);let Z=cst(_).indexOf("normalMC")>=0,R=Zt.getAttributeBySemantic(t,dt.NORMAL);if(Z&&!R)throw new ae("Style references the NORMAL semantic but the point cloud does not have normals");i.addDefine("COMPUTE_POSITION_WC_STYLE",void 0,fe.VERTEX),_.styleTranslucent&&(e.alphaOptions.pass=Le.TRANSLUCENT)}let u=o.pointCloudShading;u.attenuation&&i.addDefine("HAS_POINT_CLOUD_ATTENUATION",void 0,fe.VERTEX),u.backFaceCulling&&i.addDefine("HAS_POINT_CLOUD_BACK_FACE_CULLING",void 0,fe.VERTEX);let m,p,b;Or.is3DTiles(o.type)&&(p=!0,m=o.content,b=m.tile.refine===xr.ADD),i.addUniform("vec4","model_pointCloudParameters",fe.VERTEX),i.addVertexLines(ZX);let f=e.uniformMap;f.model_pointCloudParameters=function(){let y=tst,_=1;p&&(_=b?5:m.tileset.memoryAdjustedScreenSpaceError),y.x=u.maximumAttenuation??_,y.x*=n.pixelRatio;let S=nst(e,t,u,m);y.y=S*u.geometricErrorScale;let Z=n.context,R=n.camera.frustum,C;return n.mode===se.SCENE2D||R instanceof yn?C=Number.POSITIVE_INFINITY:C=Z.drawingBufferHeight/n.camera.frustum.sseDenominator,y.z=C,p&&(y.w=m.tileset.timeSinceLoad),y}};var Fxe=new h;function nst(e,t,n,i){if(l(i)){let u=i.tile.geometricError;if(u>0)return u}if(l(n.baseResolution))return n.baseResolution;let o=Zt.getAttributeBySemantic(t,dt.POSITION),r=o.count,s=e.runtimeNode.transform,a=h.subtract(o.max,o.min,Fxe);a=P.multiplyByPointAsVector(s,a,Fxe);let c=a.x*a.y*a.z;return W.cbrt(c/r)}var ist={colorStyleFunction:void 0,showStyleFunction:void 0,pointSizeStyleFunction:void 0,styleTranslucent:!1},ost={POSITION:"attributes.positionMC",POSITION_ABSOLUTE:"v_positionWC",COLOR:"attributes.color_0",NORMAL:"attributes.normalMC"};function rst(e){let t=$e(ost);if(!l(e))return t;for(let n=0;n<e.length;n++){let o=e[n].properties;for(let r in o)o.hasOwnProperty(r)&&(t[r]=`metadata.${r}`)}return t}var oq="ProcessedAttributes attributes, Metadata metadata, float tiles3d_tileset_time";function sst(e,t){let n=ist,i={translucent:!1};return n.colorStyleFunction=e.getColorShaderFunction(`getColorFromStyle(${oq})`,t,i),n.showStyleFunction=e.getShowShaderFunction(`getShowFromStyle(${oq})`,t,i),n.pointSizeStyleFunction=e.getPointSizeShaderFunction(`getPointSizeFromStyle(${oq})`,t,i),n.styleTranslucent=l(n.colorStyleFunction)&&i.translucent,n}function ast(e,t){let n=t.colorStyleFunction;l(n)&&(e.addDefine("HAS_POINT_CLOUD_COLOR_STYLE",void 0,fe.BOTH),e.addVertexLines(n),e.addVarying("vec4","v_pointCloudColor"));let i=t.showStyleFunction;l(i)&&(e.addDefine("HAS_POINT_CLOUD_SHOW_STYLE",void 0,fe.BOTH),e.addVertexLines(i),e.addVarying("float","v_pointCloudShow"));let o=t.pointSizeStyleFunction;l(o)&&(e.addDefine("HAS_POINT_CLOUD_POINT_SIZE_STYLE",void 0,fe.VERTEX),e.addVertexLines(o))}function rq(e,t){let n=/attributes\.(\w+)/g,i=n.exec(e);for(;i!==null;){let o=i[1];t.indexOf(o)===-1&&t.push(o),i=n.exec(e)}}function cst(e){let t=e.colorStyleFunction,n=e.showStyleFunction,i=e.pointSizeStyleFunction,o=[];return l(t)&&rq(t,o),l(n)&&rq(n,o),l(i)&&rq(i,o),o}var RX=Ixe;var Lri=x(T(),1);var _ri=x(T(),1),CX=`void primitiveOutlineStage() { +`;var Dlt=new ce,eZe={name:"PointCloudStylingPipelineStage"};eZe.process=function(e,t,n){let i=e.shaderBuilder,o=e.model,r=o.style,s=o.structuralMetadata,a=l(s)?s.propertyAttributes:void 0,c=l(o.featureTableId)&&o.featureTables[o.featureTableId].featuresLength>0,d=!l(a)&&c;if(l(r)&&!d){let y=Hlt(a),_=Klt(r,y);Jlt(i,_);let Z=jlt(_).indexOf("normalMC")>=0,R=Zt.getAttributeBySemantic(t,dt.NORMAL);if(Z&&!R)throw new ae("Style references the NORMAL semantic but the point cloud does not have normals");i.addDefine("COMPUTE_POSITION_WC_STYLE",void 0,fe.VERTEX),_.styleTranslucent&&(e.alphaOptions.pass=Le.TRANSLUCENT)}let u=o.pointCloudShading;u.attenuation&&i.addDefine("HAS_POINT_CLOUD_ATTENUATION",void 0,fe.VERTEX),u.backFaceCulling&&i.addDefine("HAS_POINT_CLOUD_BACK_FACE_CULLING",void 0,fe.VERTEX);let m,p,b;Br.is3DTiles(o.type)&&(p=!0,m=o.content,b=m.tile.refine===Tr.ADD),i.addUniform("vec4","model_pointCloudParameters",fe.VERTEX),i.addVertexLines(bN);let f=e.uniformMap;f.model_pointCloudParameters=function(){let y=Dlt,_=1;p&&(_=b?5:m.tileset.memoryAdjustedScreenSpaceError),y.x=u.maximumAttenuation??_,y.x*=n.pixelRatio;let S=Olt(e,t,u,m);y.y=S*u.geometricErrorScale;let Z=n.context,R=n.camera.frustum,C;return n.mode===se.SCENE2D||R instanceof yn?C=Number.POSITIVE_INFINITY:C=Z.drawingBufferHeight/n.camera.frustum.sseDenominator,y.z=C,p&&(y.w=m.tileset.timeSinceLoad),y}};var $Se=new h;function Olt(e,t,n,i){if(l(i)){let u=i.tile.geometricError;if(u>0)return u}if(l(n.baseResolution))return n.baseResolution;let o=Zt.getAttributeBySemantic(t,dt.POSITION),r=o.count,s=e.runtimeNode.transform,a=h.subtract(o.max,o.min,$Se);a=P.multiplyByPointAsVector(s,a,$Se);let c=a.x*a.y*a.z;return W.cbrt(c/r)}var Blt={colorStyleFunction:void 0,showStyleFunction:void 0,pointSizeStyleFunction:void 0,styleTranslucent:!1},zlt={POSITION:"attributes.positionMC",POSITION_ABSOLUTE:"v_positionWC",COLOR:"attributes.color_0",NORMAL:"attributes.normalMC"};function Hlt(e){let t=$e(zlt);if(!l(e))return t;for(let n=0;n<e.length;n++){let o=e[n].properties;for(let r in o)o.hasOwnProperty(r)&&(t[r]=`metadata.${r}`)}return t}var Qq="ProcessedAttributes attributes, Metadata metadata, float tiles3d_tileset_time";function Klt(e,t){let n=Blt,i={translucent:!1};return n.colorStyleFunction=e.getColorShaderFunction(`getColorFromStyle(${Qq})`,t,i),n.showStyleFunction=e.getShowShaderFunction(`getShowFromStyle(${Qq})`,t,i),n.pointSizeStyleFunction=e.getPointSizeShaderFunction(`getPointSizeFromStyle(${Qq})`,t,i),n.styleTranslucent=l(n.colorStyleFunction)&&i.translucent,n}function Jlt(e,t){let n=t.colorStyleFunction;l(n)&&(e.addDefine("HAS_POINT_CLOUD_COLOR_STYLE",void 0,fe.BOTH),e.addVertexLines(n),e.addVarying("vec4","v_pointCloudColor"));let i=t.showStyleFunction;l(i)&&(e.addDefine("HAS_POINT_CLOUD_SHOW_STYLE",void 0,fe.BOTH),e.addVertexLines(i),e.addVarying("float","v_pointCloudShow"));let o=t.pointSizeStyleFunction;l(o)&&(e.addDefine("HAS_POINT_CLOUD_POINT_SIZE_STYLE",void 0,fe.VERTEX),e.addVertexLines(o))}function qq(e,t){let n=/attributes\.(\w+)/g,i=n.exec(e);for(;i!==null;){let o=i[1];t.indexOf(o)===-1&&t.push(o),i=n.exec(e)}}function jlt(e){let t=e.colorStyleFunction,n=e.showStyleFunction,i=e.pointSizeStyleFunction,o=[];return l(t)&&qq(t,o),l(n)&&qq(n,o),l(i)&&qq(i,o),o}var gN=eZe;var JTi=x(T(),1);var wTi=x(T(),1),yN=`void primitiveOutlineStage() { v_outlineCoordinates = a_outlineCoordinates; } -`;var Zri=x(T(),1),VX=`void primitiveOutlineStage(inout czm_modelMaterial material) { +`;var UTi=x(T(),1),xN=`void primitiveOutlineStage(inout czm_modelMaterial material) { if (!model_showOutline) { return; } @@ -9607,7 +9603,7 @@ texture(model_outlineTexture, vec2(v_outlineCoordinates.z, 0.5)).r; float outlineness = max(outlineX, max(outlineY, outlineZ)); material.diffuse = mix(material.diffuse, model_outlineColor.rgb, model_outlineColor.a * outlineness); } -`;var Pxe={name:"PrimitiveOutlinePipelineStage"};Pxe.process=function(e,t,n){let i=e.shaderBuilder,o=e.uniformMap;i.addDefine("HAS_PRIMITIVE_OUTLINE",void 0,fe.BOTH),i.addAttribute("vec3","a_outlineCoordinates"),i.addVarying("vec3","v_outlineCoordinates");let r=t.outlineCoordinates,s={index:e.attributeIndex++,vertexBuffer:r.buffer,componentsPerAttribute:Dt.getNumberOfComponents(r.type),componentDatatype:r.componentDatatype,offsetInBytes:r.byteOffset,strideInBytes:r.byteStride,normalize:r.normalized};e.attributes.push(s),i.addUniform("sampler2D","model_outlineTexture",fe.FRAGMENT);let a=mS.createTexture(n.context);o.model_outlineTexture=function(){return a};let c=e.model;i.addUniform("vec4","model_outlineColor",fe.FRAGMENT),o.model_outlineColor=function(){return c.outlineColor},i.addUniform("bool","model_showOutline",fe.FRAGMENT),o.model_showOutline=function(){return c.showOutline},i.addVertexLines(CX),i.addFragmentLines(VX)};var EX=Pxe;var Xri=x(T(),1);var Xxe={name:"PrimitiveStatisticsPipelineStage",_countGeometry:Nxe,_count2DPositions:Yxe,_countMorphTargetAttributes:Mxe,_countMaterialTextures:wxe,_countFeatureIdTextures:kxe,_countBinaryMetadata:Uxe};Xxe.process=function(e,t,n){let i=e.model,o=i.statistics;Nxe(o,t),Yxe(o,e.runtimePrimitive),Mxe(o,t),wxe(o,t.material),kxe(o,t.featureIds),Uxe(o,i)};function Nxe(e,t){let n=l(t.indices)?t.indices.count:Zt.getAttributeBySemantic(t,"POSITION").count,i=t.primitiveType;i===Ie.POINTS?e.pointsLength+=n:Ie.isTriangles(i)&&(e.trianglesLength+=lst(i,n));let o=t.attributes,r=o.length;for(let c=0;c<r;c++){let d=o[c];if(l(d.buffer)){let u=l(d.typedArray);e.addBuffer(d.buffer,u)}}let s=t.outlineCoordinates;l(s)&&l(s.buffer)&&e.addBuffer(s.buffer,!1);let a=t.indices;if(l(a)&&l(a.buffer)){let c=l(a.typedArray);e.addBuffer(a.buffer,c)}}function lst(e,t){switch(e){case Ie.TRIANGLES:return t/3;case Ie.TRIANGLE_STRIP:case Ie.TRIANGLE_FAN:return Math.max(t-2,0);default:return 0}}function Yxe(e,t){let n=t.positionBuffer2D;l(n)&&e.addBuffer(n,!0)}function Mxe(e,t){let n=t.morphTargets;if(!l(n))return;let i=!1,o=n.length;for(let r=0;r<o;r++){let s=n[r].attributes,a=s.length;for(let c=0;c<a;c++){let d=s[c];l(d.buffer)&&e.addBuffer(d.buffer,i)}}}function wxe(e,t){let n=dst(t),i=n.length;for(let o=0;o<i;o++){let r=n[o];l(r)&&l(r.texture)&&e.addTexture(r.texture)}}function dst(e){let t=e.metallicRoughness,n=[e.emissiveTexture,e.normalTexture,e.occlusionTexture,t.baseColorTexture,t.metallicRoughnessTexture],i=e.specularGlossiness;return l(i)&&(n.push(i.diffuseTexture),n.push(i.specularGlossinessTexture)),n}function kxe(e,t){let n=t.length;for(let i=0;i<n;i++){let o=t[i];if(o instanceof Vn.FeatureIdTexture){let r=o.textureReader;l(r.texture)&&e.addTexture(r.texture)}}}function Uxe(e,t){let n=t.structuralMetadata;l(n)&&(ust(e,n),e.propertyTablesByteLength+=n.propertyTablesByteLength);let i=t.featureTables;if(!l(i))return;let o=i.length;for(let r=0;r<o;r++){let s=i[r];e.addBatchTexture(s.batchTexture)}}function ust(e,t){let n=t.propertyTextures;if(!l(n))return;let i=n.length;for(let o=0;o<i;o++){let s=n[o].properties;for(let a in s)if(s.hasOwnProperty(a)){let d=s[a].textureReader;l(d.texture)&&e.addTexture(d.texture)}}}var AX=Xxe;var Qri=x(T(),1);var mst=new P,hst=new P,Dxe={name:"SceneMode2DPipelineStage"};Dxe.process=function(e,t,n){let i=Zt.getAttributeBySemantic(t,dt.POSITION),o=e.shaderBuilder,r=e.model,s=r.sceneGraph.computedModelMatrix,a=e.runtimeNode.computedTransform,c=P.multiplyTransformation(s,a,mst),d=bst(e,c,n),u=e.runtimePrimitive;u.boundingSphere2D=d;let m=e.runtimeNode.node.instances;if(l(m))return;if(l(i.typedArray)){let y=xst(i,c,d,n);u.positionBuffer2D=y,r._modelResources.push(y),i.typedArray=void 0}o.addDefine("USE_2D_POSITIONS",void 0,fe.VERTEX),o.addUniform("mat4","u_modelView2D",fe.VERTEX);let p=P.fromTranslation(d.center,new P),b=n.context,f={u_modelView2D:function(){return P.multiplyTransformation(b.uniformState.view,p,hst)}};e.uniformMap=It(f,e.uniformMap)};var fst=new h,pst=new h;function bst(e,t,n){let i=P.multiplyByPoint(t,e.positionMin,fst),o=fo.computeActualEllipsoidPosition(n,i,i),r=P.multiplyByPoint(t,e.positionMax,pst),s=fo.computeActualEllipsoidPosition(n,r,r);return me.fromCornerPoints(o,s,new me)}var Oxe=new h;function gst(e,t){let n=e.length,i=new Float32Array(n),o=t.quantizedVolumeOffset,r=t.quantizedVolumeStepSize;for(let s=0;s<n;s+=3){let a=h.fromArray(e,s,Oxe),c=h.multiplyComponents(a,r,a),d=h.add(c,o,c);i[s]=d.x,i[s+1]=d.y,i[s+2]=d.z}return i}function yst(e,t,n,i){let o;l(e.quantization)?o=gst(e.typedArray,e.quantization):o=e.typedArray.slice();let r=e.byteOffset/Float32Array.BYTES_PER_ELEMENT,s=o.length,a=l(e.byteStride)?e.byteStride/Float32Array.BYTES_PER_ELEMENT:3;for(let c=r;c<s;c+=a){let d=h.fromArray(o,c,Oxe);if(isNaN(d.x)||isNaN(d.y)||isNaN(d.z))continue;let u=P.multiplyByPoint(t,d,d),m=fo.computeActualEllipsoidPosition(i,u,u),p=h.subtract(m,n,m);o[c]=p.x,o[c+1]=p.y,o[c+2]=p.z}return o}function xst(e,t,n,i){let o=$e(i);o.mode=se.COLUMBUS_VIEW;let r=n.center,s=yst(e,t,r,o),a=it.createVertexBuffer({context:i.context,typedArray:s,usage:Pe.STATIC_DRAW});return a.vertexArrayDestroyable=!1,a}var GX=Dxe;var rsi=x(T(),1);var $ri=x(T(),1),LX=`void skinningStage(inout ProcessedAttributes attributes) +`;var tZe={name:"PrimitiveOutlinePipelineStage"};tZe.process=function(e,t,n){let i=e.shaderBuilder,o=e.uniformMap;i.addDefine("HAS_PRIMITIVE_OUTLINE",void 0,fe.BOTH),i.addAttribute("vec3","a_outlineCoordinates"),i.addVarying("vec3","v_outlineCoordinates");let r=t.outlineCoordinates,s={index:e.attributeIndex++,vertexBuffer:r.buffer,componentsPerAttribute:Dt.getNumberOfComponents(r.type),componentDatatype:r.componentDatatype,offsetInBytes:r.byteOffset,strideInBytes:r.byteStride,normalize:r.normalized};e.attributes.push(s),i.addUniform("sampler2D","model_outlineTexture",fe.FRAGMENT);let a=AS.createTexture(n.context);o.model_outlineTexture=function(){return a};let c=e.model;i.addUniform("vec4","model_outlineColor",fe.FRAGMENT),o.model_outlineColor=function(){return c.outlineColor},i.addUniform("bool","model_showOutline",fe.FRAGMENT),o.model_showOutline=function(){return c.showOutline},i.addVertexLines(yN),i.addFragmentLines(xN)};var TN=tZe;var t_i=x(T(),1);var nZe={name:"PrimitiveStatisticsPipelineStage",_countGeometry:iZe,_count2DPositions:oZe,_countMorphTargetAttributes:rZe,_countMaterialTextures:sZe,_countFeatureIdTextures:aZe,_countBinaryMetadata:cZe};nZe.process=function(e,t,n){let i=e.model,o=i.statistics;iZe(o,t),oZe(o,e.runtimePrimitive),rZe(o,t),sZe(o,t.material),aZe(o,t.featureIds),cZe(o,i)};function iZe(e,t){let n=l(t.indices)?t.indices.count:Zt.getAttributeBySemantic(t,"POSITION").count,i=t.primitiveType;i===Ie.POINTS?e.pointsLength+=n:Ie.isTriangles(i)&&(e.trianglesLength+=Qlt(i,n));let o=t.attributes,r=o.length;for(let c=0;c<r;c++){let d=o[c];if(l(d.buffer)){let u=l(d.typedArray);e.addBuffer(d.buffer,u)}}let s=t.outlineCoordinates;l(s)&&l(s.buffer)&&e.addBuffer(s.buffer,!1);let a=t.indices;if(l(a)&&l(a.buffer)){let c=l(a.typedArray);e.addBuffer(a.buffer,c)}}function Qlt(e,t){switch(e){case Ie.TRIANGLES:return t/3;case Ie.TRIANGLE_STRIP:case Ie.TRIANGLE_FAN:return Math.max(t-2,0);default:return 0}}function oZe(e,t){let n=t.positionBuffer2D;l(n)&&e.addBuffer(n,!0)}function rZe(e,t){let n=t.morphTargets;if(!l(n))return;let i=!1,o=n.length;for(let r=0;r<o;r++){let s=n[r].attributes,a=s.length;for(let c=0;c<a;c++){let d=s[c];l(d.buffer)&&e.addBuffer(d.buffer,i)}}}function sZe(e,t){let n=qlt(t),i=n.length;for(let o=0;o<i;o++){let r=n[o];l(r)&&l(r.texture)&&e.addTexture(r.texture)}}function qlt(e){let t=e.metallicRoughness,n=[e.emissiveTexture,e.normalTexture,e.occlusionTexture,t.baseColorTexture,t.metallicRoughnessTexture],i=e.specularGlossiness;return l(i)&&(n.push(i.diffuseTexture),n.push(i.specularGlossinessTexture)),n}function aZe(e,t){let n=t.length;for(let i=0;i<n;i++){let o=t[i];if(o instanceof Vn.FeatureIdTexture){let r=o.textureReader;l(r.texture)&&e.addTexture(r.texture)}}}function cZe(e,t){let n=t.structuralMetadata;l(n)&&($lt(e,n),e.propertyTablesByteLength+=n.propertyTablesByteLength);let i=t.featureTables;if(!l(i))return;let o=i.length;for(let r=0;r<o;r++){let s=i[r];e.addBatchTexture(s.batchTexture)}}function $lt(e,t){let n=t.propertyTextures;if(!l(n))return;let i=n.length;for(let o=0;o<i;o++){let s=n[o].properties;for(let a in s)if(s.hasOwnProperty(a)){let d=s[a].textureReader;l(d.texture)&&e.addTexture(d.texture)}}}var _N=nZe;var b_i=x(T(),1);var edt=new P,tdt=new P,lZe={name:"SceneMode2DPipelineStage"};lZe.process=function(e,t,n){let i=Zt.getAttributeBySemantic(t,dt.POSITION),o=e.shaderBuilder,r=e.model,s=r.sceneGraph.computedModelMatrix,a=e.runtimeNode.computedTransform,c=P.multiplyTransformation(s,a,edt),d=odt(e,c,n),u=e.runtimePrimitive;u.boundingSphere2D=d;let m=e.runtimeNode.node.instances;if(l(m))return;if(l(i.typedArray)){let y=adt(i,c,d,n);u.positionBuffer2D=y,r._modelResources.push(y),i.typedArray=void 0}o.addDefine("USE_2D_POSITIONS",void 0,fe.VERTEX),o.addUniform("mat4","u_modelView2D",fe.VERTEX);let p=P.fromTranslation(d.center,new P),b=n.context,f={u_modelView2D:function(){return P.multiplyTransformation(b.uniformState.view,p,tdt)}};e.uniformMap=It(f,e.uniformMap)};var ndt=new h,idt=new h;function odt(e,t,n){let i=P.multiplyByPoint(t,e.positionMin,ndt),o=fo.computeActualEllipsoidPosition(n,i,i),r=P.multiplyByPoint(t,e.positionMax,idt),s=fo.computeActualEllipsoidPosition(n,r,r);return me.fromCornerPoints(o,s,new me)}var dZe=new h;function rdt(e,t){let n=e.length,i=new Float32Array(n),o=t.quantizedVolumeOffset,r=t.quantizedVolumeStepSize;for(let s=0;s<n;s+=3){let a=h.fromArray(e,s,dZe),c=h.multiplyComponents(a,r,a),d=h.add(c,o,c);i[s]=d.x,i[s+1]=d.y,i[s+2]=d.z}return i}function sdt(e,t,n,i){let o;l(e.quantization)?o=rdt(e.typedArray,e.quantization):o=e.typedArray.slice();let r=e.byteOffset/Float32Array.BYTES_PER_ELEMENT,s=o.length,a=l(e.byteStride)?e.byteStride/Float32Array.BYTES_PER_ELEMENT:3;for(let c=r;c<s;c+=a){let d=h.fromArray(o,c,dZe);if(isNaN(d.x)||isNaN(d.y)||isNaN(d.z))continue;let u=P.multiplyByPoint(t,d,d),m=fo.computeActualEllipsoidPosition(i,u,u),p=h.subtract(m,n,m);o[c]=p.x,o[c+1]=p.y,o[c+2]=p.z}return o}function adt(e,t,n,i){let o=$e(i);o.mode=se.COLUMBUS_VIEW;let r=n.center,s=sdt(e,t,r,o),a=it.createVertexBuffer({context:i.context,typedArray:s,usage:Pe.STATIC_DRAW});return a.vertexArrayDestroyable=!1,a}var SN=lZe;var R_i=x(T(),1);var y_i=x(T(),1),ZN=`void skinningStage(inout ProcessedAttributes attributes) { mat4 skinningMatrix = getSkinningMatrix(); mat3 skinningMatrixMat3 = mat3(skinningMatrix); @@ -9622,7 +9618,7 @@ vec3 tangentMC = attributes.tangentMC; attributes.tangentMC = skinningMatrixMat3 * tangentMC; #endif } -`;var TS={name:"SkinningPipelineStage",FUNCTION_ID_GET_SKINNING_MATRIX:"getSkinningMatrix",FUNCTION_SIGNATURE_GET_SKINNING_MATRIX:"mat4 getSkinningMatrix()"};TS.process=function(e,t){let n=e.shaderBuilder;n.addDefine("HAS_SKINNING",void 0,fe.VERTEX),_st(n,t);let i=e.runtimeNode,o=i.computedJointMatrices;n.addUniform("mat4",`u_jointMatrices[${o.length}]`,fe.VERTEX),n.addVertexLines(LX);let r={u_jointMatrices:function(){return i.computedJointMatrices}};e.uniformMap=It(r,e.uniformMap)};function Tst(e){let t=-1,n=e.attributes,i=n.length;for(let o=0;o<i;o++){let r=n[o];(r.semantic===dt.JOINTS||r.semantic===dt.WEIGHTS)&&(t=Math.max(t,r.setIndex))}return t}function _st(e,t){e.addFunction(TS.FUNCTION_ID_GET_SKINNING_MATRIX,TS.FUNCTION_SIGNATURE_GET_SKINNING_MATRIX,fe.VERTEX),e.addFunctionLines(TS.FUNCTION_ID_GET_SKINNING_MATRIX,["mat4 skinnedMatrix = mat4(0);"]);let i,o,r=["x","y","z","w"],s=Tst(t);for(i=0;i<=s;i++)for(o=0;o<=3;o++){let c=r[o],d=`skinnedMatrix += a_weights_${i}.${c} * u_jointMatrices[int(a_joints_${i}.${c})];`;e.addFunctionLines(TS.FUNCTION_ID_GET_SKINNING_MATRIX,[d])}e.addFunctionLines(TS.FUNCTION_ID_GET_SKINNING_MATRIX,["return skinnedMatrix;"])}var WX=TS;var msi=x(T(),1);var asi=x(T(),1),vX=`void verticalExaggerationStage( +`;var MS={name:"SkinningPipelineStage",FUNCTION_ID_GET_SKINNING_MATRIX:"getSkinningMatrix",FUNCTION_SIGNATURE_GET_SKINNING_MATRIX:"mat4 getSkinningMatrix()"};MS.process=function(e,t){let n=e.shaderBuilder;n.addDefine("HAS_SKINNING",void 0,fe.VERTEX),ldt(n,t);let i=e.runtimeNode,o=i.computedJointMatrices;n.addUniform("mat4",`u_jointMatrices[${o.length}]`,fe.VERTEX),n.addVertexLines(ZN);let r={u_jointMatrices:function(){return i.computedJointMatrices}};e.uniformMap=It(r,e.uniformMap)};function cdt(e){let t=-1,n=e.attributes,i=n.length;for(let o=0;o<i;o++){let r=n[o];(r.semantic===dt.JOINTS||r.semantic===dt.WEIGHTS)&&(t=Math.max(t,r.setIndex))}return t}function ldt(e,t){e.addFunction(MS.FUNCTION_ID_GET_SKINNING_MATRIX,MS.FUNCTION_SIGNATURE_GET_SKINNING_MATRIX,fe.VERTEX),e.addFunctionLines(MS.FUNCTION_ID_GET_SKINNING_MATRIX,["mat4 skinnedMatrix = mat4(0);"]);let i,o,r=["x","y","z","w"],s=cdt(t);for(i=0;i<=s;i++)for(o=0;o<=3;o++){let c=r[o],d=`skinnedMatrix += a_weights_${i}.${c} * u_jointMatrices[int(a_joints_${i}.${c})];`;e.addFunctionLines(MS.FUNCTION_ID_GET_SKINNING_MATRIX,[d])}e.addFunctionLines(MS.FUNCTION_ID_GET_SKINNING_MATRIX,["return skinnedMatrix;"])}var RN=MS;var W_i=x(T(),1);var V_i=x(T(),1),CN=`void verticalExaggerationStage( inout ProcessedAttributes attributes ) { vec4 vertexPositionENU = czm_modelToEnu * vec4(attributes.positionMC, 1.0); @@ -9647,12 +9643,12 @@ float shift = u_verticalExaggerationAndRelativeHeight.y; float exaggeration = (vertexHeight - shift) * (stretch - 1.0); attributes.positionMC += exaggeration * exaggerationDirectionScaledMC; } -`;var Bxe={name:"VerticalExaggerationPipelineStage"},Sst=new k;Bxe.process=function(e,t,n){let{shaderBuilder:i,uniformMap:o}=e;i.addVertexLines(vX),i.addDefine("HAS_VERTICAL_EXAGGERATION",void 0,fe.VERTEX),i.addUniform("vec2","u_verticalExaggerationAndRelativeHeight",fe.VERTEX),o.u_verticalExaggerationAndRelativeHeight=function(){return k.fromElements(n.verticalExaggeration,n.verticalExaggerationRelativeHeight,Sst)}};var FX=Bxe;var Asi=x(T(),1);var gsi=x(T(),1);var sq={};function Zst(e){let t=Oe.createTypedArray(e,e*2),n=e,i=0;for(let o=0;o<n;o+=3)t[i++]=o,t[i++]=o+1,t[i++]=o+1,t[i++]=o+2,t[i++]=o+2,t[i++]=o;return t}function Rst(e,t){let n=t.length,i=Oe.createTypedArray(e,n*2),o=0;for(let r=0;r<n;r+=3){let s=t[r],a=t[r+1],c=t[r+2];i[o++]=s,i[o++]=a,i[o++]=a,i[o++]=c,i[o++]=c,i[o++]=s}return i}function Cst(e){let t=e-2,n=2+t*4,i=Oe.createTypedArray(e,n),o=0;i[o++]=0,i[o++]=1;for(let r=0;r<t;r++)i[o++]=r+1,i[o++]=r+2,i[o++]=r+2,i[o++]=r;return i}function Vst(e,t){let i=t.length-2,o=2+i*4,r=Oe.createTypedArray(e,o),s=0;r[s++]=t[0],r[s++]=t[1];for(let a=0;a<i;a++){let c=t[a],d=t[a+1],u=t[a+2];r[s++]=d,r[s++]=u,r[s++]=u,r[s++]=c}return r}function Est(e){let t=e-2,n=2+t*4,i=Oe.createTypedArray(e,n),o=0;i[o++]=0,i[o++]=1;for(let r=0;r<t;r++)i[o++]=r+1,i[o++]=r+2,i[o++]=r+2,i[o++]=0;return i}function Ast(e,t){let i=t.length-2,o=2+i*4,r=Oe.createTypedArray(e,o),s=0,a=t[0];r[s++]=a,r[s++]=t[1];for(let c=0;c<i;c++){let d=t[c+1],u=t[c+2];r[s++]=d,r[s++]=u,r[s++]=u,r[s++]=a}return r}sq.createWireframeIndices=function(e,t,n){let i=l(n);if(e===Ie.TRIANGLES)return i?Rst(t,n):Zst(t);if(e===Ie.TRIANGLE_STRIP)return i?Vst(t,n):Cst(t);if(e===Ie.TRIANGLE_FAN)return i?Ast(t,n):Est(t)};sq.getWireframeIndicesCount=function(e,t){return e===Ie.TRIANGLES?t*2:e===Ie.TRIANGLE_STRIP||e===Ie.TRIANGLE_FAN?2+(t-2)*4:t};var jC=sq;var zxe={name:"WireframePipelineStage"};zxe.process=function(e,t,n){e.shaderBuilder.addDefine("HAS_WIREFRAME",void 0,fe.FRAGMENT);let o=e.model,r=Gst(t,e.indices,n);o._pipelineResources.push(r),e.wireframeIndexBuffer=r,o.statistics.addBuffer(r,!1);let a=e.primitiveType,c=e.count;e.primitiveType=Ie.LINES,e.count=jC.getWireframeIndicesCount(a,c)};function Gst(e,t,n){let o=Zt.getAttributeBySemantic(e,dt.POSITION).count,r=n.context.webgl2,s;if(l(t)){let u=t.buffer,m=t.count;l(u)&&r?(s=u.sizeInBytes===m?new Uint8Array(m):Oe.createTypedArray(o,m),u.getBufferData(s)):s=t.typedArray}let a=e.primitiveType,c=jC.createWireframeIndices(a,o,s),d=Oe.fromSizeInBytes(c.BYTES_PER_ELEMENT);return it.createIndexBuffer({context:n.context,typedArray:c,usage:Pe.STATIC_DRAW,indexDatatype:d})}var IX=zxe;function Hxe(e){e=e??B.EMPTY_OBJECT;let t=e.primitive,n=e.node,i=e.model;this.primitive=t,this.node=n,this.model=i,this.pipelineStages=[],this.drawCommand=void 0,this.boundingSphere=void 0,this.boundingSphere2D=void 0,this.positionBuffer2D=void 0,this.batchLengths=void 0,this.batchOffsets=void 0,this.updateStages=[]}Hxe.prototype.configurePipeline=function(e){let t=this.pipelineStages;t.length=0;let n=this.primitive,i=this.node,o=this.model,r=o.customShader,s=o.style,a=e.context.webgl2,d=e.mode!==se.SCENE3D&&!e.scene3DOnly&&o._projectTo2D,u=e.verticalExaggeration!==1&&o.hasVerticalExaggeration,m=l(n.morphTargets)&&n.morphTargets.length>0,p=l(i.skin),b=l(o.imageryLayers)&&o.imageryLayers.length>0,f=l(r),_=!(f&&l(r.fragmentShaderText))||r.mode!==Kb.REPLACE_MATERIAL,S=Zt.hasQuantizedAttributes(n.attributes),Z=o.debugWireframe&&Ie.isTriangles(n.primitiveType)&&(o._enableDebugWireframe||a),R=o.pointCloudShading,C=l(R)&&R.attenuation,E=l(R)&&R.backFaceCulling,A=n.primitiveType===Ie.POINTS&&(l(s)||C||E),L=o._enableShowOutline&&l(n.outlineCoordinates),F=l(n.edgeVisibility),I=Lst(o,i,n),N=l(o.classificationType);d&&t.push(GX),t.push(jP),Z&&t.push(IX),N&&t.push(GP),m&&t.push(_X),p&&t.push(WX),A&&t.push(RX),S&&t.push(kP),b&&(L?xt("outlines-and-draping","Primitive outlines disable imagery draping"):t.push(hX)),_&&t.push(xX),t.push(Tx),t.push(Um),t.push(Nu),I.hasPropertyTable&&(t.push(Sx),t.push(AP),t.push(vP)),u&&t.push(FX),f&&t.push(MP),t.push(pX),o.allowPicking&&t.push(SX),L&&t.push(EX),F&&(e.edgeVisibilityRequested=!0,t.push(zP),t.push(DP)),t.push(EP),t.push(AX)};function Lst(e,t,n){let i;return l(t.instances)&&(i=Zt.getFeatureIdsByLabel(t.instances.featureIds,e.instanceFeatureIdLabel),l(i))?{hasFeatureIds:!0,hasPropertyTable:l(i.propertyTableId)}:(i=Zt.getFeatureIdsByLabel(n.featureIds,e.featureIdLabel),l(i)?{hasFeatureIds:!0,hasPropertyTable:l(i.propertyTableId)}:{hasFeatureIds:!1,hasPropertyTable:!1})}var PX=Hxe;var mai=x(T(),1);function aq(e){e=e??B.EMPTY_OBJECT,this._sceneGraph=e.sceneGraph;let t=e.skin;this._skin=t,this._inverseBindMatrices=void 0,this._joints=[],this._jointMatrices=[],Wst(this)}Object.defineProperties(aq.prototype,{skin:{get:function(){return this._skin}},sceneGraph:{get:function(){return this._sceneGraph}},inverseBindMatrices:{get:function(){return this._inverseBindMatrices}},joints:{get:function(){return this._joints}},jointMatrices:{get:function(){return this._jointMatrices}}});function Wst(e){let t=e.skin,n=t.inverseBindMatrices;e._inverseBindMatrices=n;let i=t.joints,o=i.length,r=e.sceneGraph._runtimeNodes,s=e.joints,a=e._jointMatrices;for(let c=0;c<o;c++){let d=i[c].index,u=r[d];s.push(u);let m=n[c],p=Kxe(u,m,new P);a.push(p)}}function Kxe(e,t,n){let i=P.multiplyTransformation(e.transformToRoot,e.transform,n);return n=P.multiplyTransformation(i,t,n),n}aq.prototype.updateJointMatrices=function(){let e=this._jointMatrices,t=e.length;for(let n=0;n<t;n++){let i=this.joints[n],o=this.inverseBindMatrices[n];e[n]=Kxe(i,o,e[n])}};var XX=aq;var Tai=x(T(),1);var fai=x(T(),1);function vst(){this.pass=void 0,this.alphaCutoff=void 0}var _S=vst;function Fst(e){this.shaderBuilder=new lb,this.model=e,this.uniformMap={},this.alphaOptions=new _S,this.renderStateOptions=ze.getState(ze.fromCache({depthTest:{enabled:!0,func:sc.LESS_OR_EQUAL}})),this.hasSilhouette=!1,this.hasSkipLevelOfDetail=!1,this.nodeRenderResources=[]}var NX=Fst;var Wai=x(T(),1);var Sai=x(T(),1),YX=`void silhouetteStage(inout vec4 color) { +`;var uZe={name:"VerticalExaggerationPipelineStage"},ddt=new k;uZe.process=function(e,t,n){let{shaderBuilder:i,uniformMap:o}=e;i.addVertexLines(CN),i.addDefine("HAS_VERTICAL_EXAGGERATION",void 0,fe.VERTEX),i.addUniform("vec2","u_verticalExaggerationAndRelativeHeight",fe.VERTEX),o.u_verticalExaggerationAndRelativeHeight=function(){return k.fromElements(n.verticalExaggeration,n.verticalExaggerationRelativeHeight,ddt)}};var VN=uZe;var H_i=x(T(),1);var X_i=x(T(),1);var $q={};function udt(e){let t=Oe.createTypedArray(e,e*2),n=e,i=0;for(let o=0;o<n;o+=3)t[i++]=o,t[i++]=o+1,t[i++]=o+1,t[i++]=o+2,t[i++]=o+2,t[i++]=o;return t}function mdt(e,t){let n=t.length,i=Oe.createTypedArray(e,n*2),o=0;for(let r=0;r<n;r+=3){let s=t[r],a=t[r+1],c=t[r+2];i[o++]=s,i[o++]=a,i[o++]=a,i[o++]=c,i[o++]=c,i[o++]=s}return i}function hdt(e){let t=e-2,n=2+t*4,i=Oe.createTypedArray(e,n),o=0;i[o++]=0,i[o++]=1;for(let r=0;r<t;r++)i[o++]=r+1,i[o++]=r+2,i[o++]=r+2,i[o++]=r;return i}function fdt(e,t){let i=t.length-2,o=2+i*4,r=Oe.createTypedArray(e,o),s=0;r[s++]=t[0],r[s++]=t[1];for(let a=0;a<i;a++){let c=t[a],d=t[a+1],u=t[a+2];r[s++]=d,r[s++]=u,r[s++]=u,r[s++]=c}return r}function pdt(e){let t=e-2,n=2+t*4,i=Oe.createTypedArray(e,n),o=0;i[o++]=0,i[o++]=1;for(let r=0;r<t;r++)i[o++]=r+1,i[o++]=r+2,i[o++]=r+2,i[o++]=0;return i}function bdt(e,t){let i=t.length-2,o=2+i*4,r=Oe.createTypedArray(e,o),s=0,a=t[0];r[s++]=a,r[s++]=t[1];for(let c=0;c<i;c++){let d=t[c+1],u=t[c+2];r[s++]=d,r[s++]=u,r[s++]=u,r[s++]=a}return r}$q.createWireframeIndices=function(e,t,n){let i=l(n);if(e===Ie.TRIANGLES)return i?mdt(t,n):udt(t);if(e===Ie.TRIANGLE_STRIP)return i?fdt(t,n):hdt(t);if(e===Ie.TRIANGLE_FAN)return i?bdt(t,n):pdt(t)};$q.getWireframeIndicesCount=function(e,t){return e===Ie.TRIANGLES?t*2:e===Ie.TRIANGLE_STRIP||e===Ie.TRIANGLE_FAN?2+(t-2)*4:t};var RV=$q;var mZe={name:"WireframePipelineStage"};mZe.process=function(e,t,n){e.shaderBuilder.addDefine("HAS_WIREFRAME",void 0,fe.FRAGMENT);let o=e.model,r=gdt(t,e.indices,n);o._pipelineResources.push(r),e.wireframeIndexBuffer=r,o.statistics.addBuffer(r,!1);let a=e.primitiveType,c=e.count;e.primitiveType=Ie.LINES,e.count=RV.getWireframeIndicesCount(a,c)};function gdt(e,t,n){let o=Zt.getAttributeBySemantic(e,dt.POSITION).count,r=n.context.webgl2,s;if(l(t)){let u=t.buffer,m=t.count;l(u)&&r?(s=u.sizeInBytes===m?new Uint8Array(m):Oe.createTypedArray(o,m),u.getBufferData(s)):s=t.typedArray}let a=e.primitiveType,c=RV.createWireframeIndices(a,o,s),d=Oe.fromSizeInBytes(c.BYTES_PER_ELEMENT);return it.createIndexBuffer({context:n.context,typedArray:c,usage:Pe.STATIC_DRAW,indexDatatype:d})}var EN=mZe;function hZe(e){e=e??B.EMPTY_OBJECT;let t=e.primitive,n=e.node,i=e.model;this.primitive=t,this.node=n,this.model=i,this.pipelineStages=[],this.drawCommand=void 0,this.boundingSphere=void 0,this.boundingSphere2D=void 0,this.positionBuffer2D=void 0,this.batchLengths=void 0,this.batchOffsets=void 0,this.updateStages=[]}hZe.prototype.configurePipeline=function(e){let t=this.pipelineStages;t.length=0;let n=this.primitive,i=this.node,o=this.model,r=o.customShader,s=o.style,a=e.context.webgl2,d=e.mode!==se.SCENE3D&&!e.scene3DOnly&&o._projectTo2D,u=e.verticalExaggeration!==1&&o.hasVerticalExaggeration,m=l(n.morphTargets)&&n.morphTargets.length>0,p=l(i.skin),b=l(o.imageryLayers)&&o.imageryLayers.length>0,f=l(r),_=!(f&&l(r.fragmentShaderText))||r.mode!==eg.REPLACE_MATERIAL,S=Zt.hasQuantizedAttributes(n.attributes),Z=o.debugWireframe&&Ie.isTriangles(n.primitiveType)&&(o._enableDebugWireframe||a),R=o.pointCloudShading,C=l(R)&&R.attenuation,E=l(R)&&R.backFaceCulling,A=n.primitiveType===Ie.POINTS&&(l(s)||C||E),L=o._enableShowOutline&&l(n.outlineCoordinates),F=l(n.edgeVisibility),I=ydt(o,i,n),N=l(o.classificationType);d&&t.push(SN),t.push(DX),Z&&t.push(EN),N&&t.push(SX),m&&t.push(fN),p&&t.push(RN),A&&t.push(gN),S&&t.push(IX),b&&(L?xt("outlines-and-draping","Primitive outlines disable imagery draping"):t.push(sN)),_&&t.push(mN),t.push(Sx),t.push(jm),t.push(Ou),I.hasPropertyTable&&(t.push(Rx),t.push(_X),t.push(CX)),u&&t.push(VN),f&&t.push(vX),t.push(cN),o.allowPicking&&t.push(pN),L&&t.push(TN),F&&(e.edgeVisibilityRequested=!0,t.push(MX),t.push(XX)),t.push(TX),t.push(_N)};function ydt(e,t,n){let i;return l(t.instances)&&(i=Zt.getFeatureIdsByLabel(t.instances.featureIds,e.instanceFeatureIdLabel),l(i))?{hasFeatureIds:!0,hasPropertyTable:l(i.propertyTableId)}:(i=Zt.getFeatureIdsByLabel(n.featureIds,e.featureIdLabel),l(i)?{hasFeatureIds:!0,hasPropertyTable:l(i.propertyTableId)}:{hasFeatureIds:!1,hasPropertyTable:!1})}var AN=hZe;var WSi=x(T(),1);function e$(e){e=e??B.EMPTY_OBJECT,this._sceneGraph=e.sceneGraph;let t=e.skin;this._skin=t,this._inverseBindMatrices=void 0,this._joints=[],this._jointMatrices=[],xdt(this)}Object.defineProperties(e$.prototype,{skin:{get:function(){return this._skin}},sceneGraph:{get:function(){return this._sceneGraph}},inverseBindMatrices:{get:function(){return this._inverseBindMatrices}},joints:{get:function(){return this._joints}},jointMatrices:{get:function(){return this._jointMatrices}}});function xdt(e){let t=e.skin,n=t.inverseBindMatrices;e._inverseBindMatrices=n;let i=t.joints,o=i.length,r=e.sceneGraph._runtimeNodes,s=e.joints,a=e._jointMatrices;for(let c=0;c<o;c++){let d=i[c].index,u=r[d];s.push(u);let m=n[c],p=fZe(u,m,new P);a.push(p)}}function fZe(e,t,n){let i=P.multiplyTransformation(e.transformToRoot,e.transform,n);return n=P.multiplyTransformation(i,t,n),n}e$.prototype.updateJointMatrices=function(){let e=this._jointMatrices,t=e.length;for(let n=0;n<t;n++){let i=this.joints[n],o=this.inverseBindMatrices[n];e[n]=fZe(i,o,e[n])}};var GN=e$;var MSi=x(T(),1);var FSi=x(T(),1);function Tdt(){this.pass=void 0,this.alphaCutoff=void 0}var wS=Tdt;function _dt(e){this.shaderBuilder=new lb,this.model=e,this.uniformMap={},this.alphaOptions=new wS,this.renderStateOptions=ze.getState(ze.fromCache({depthTest:{enabled:!0,func:sc.LESS_OR_EQUAL}})),this.hasSilhouette=!1,this.hasSkipLevelOfDetail=!1,this.nodeRenderResources=[]}var LN=_dt;var jSi=x(T(),1);var kSi=x(T(),1),WN=`void silhouetteStage(inout vec4 color) { if(model_silhouettePass) { color = czm_gammaCorrect(model_silhouetteColor); } } -`;var Rai=x(T(),1),MX=`void silhouetteStage(in ProcessedAttributes attributes, inout vec4 positionClip) { +`;var DSi=x(T(),1),vN=`void silhouetteStage(in ProcessedAttributes attributes, inout vec4 positionClip) { #ifdef HAS_NORMALS if(model_silhouettePass) { vec3 normal = normalize(czm_normal3D * attributes.normalMC); @@ -9662,14 +9658,14 @@ positionClip.xy += normal.xy * positionClip.w * model_silhouetteSize * czm_pixel } #endif } -`;var yB={name:"ModelSilhouettePipelineStage"};yB.silhouettesLength=0;yB.process=function(e,t,n){l(t._silhouetteId)||(t._silhouetteId=++yB.silhouettesLength);let i=e.shaderBuilder;i.addDefine("HAS_SILHOUETTE",void 0,fe.BOTH),i.addVertexLines(MX),i.addFragmentLines(YX),i.addUniform("vec4","model_silhouetteColor",fe.FRAGMENT),i.addUniform("float","model_silhouetteSize",fe.VERTEX),i.addUniform("bool","model_silhouettePass",fe.BOTH);let o={model_silhouetteColor:function(){return t.silhouetteColor},model_silhouetteSize:function(){return t.silhouetteSize},model_silhouettePass:function(){return!1}};e.uniformMap=It(o,e.uniformMap),e.hasSilhouette=!0};var wX=yB;var Yai=x(T(),1);var Fai=x(T(),1),kX=`void modelSplitterStage() +`;var zB={name:"ModelSilhouettePipelineStage"};zB.silhouettesLength=0;zB.process=function(e,t,n){l(t._silhouetteId)||(t._silhouetteId=++zB.silhouettesLength);let i=e.shaderBuilder;i.addDefine("HAS_SILHOUETTE",void 0,fe.BOTH),i.addVertexLines(vN),i.addFragmentLines(WN),i.addUniform("vec4","model_silhouetteColor",fe.FRAGMENT),i.addUniform("float","model_silhouetteSize",fe.VERTEX),i.addUniform("bool","model_silhouettePass",fe.BOTH);let o={model_silhouetteColor:function(){return t.silhouetteColor},model_silhouetteSize:function(){return t.silhouetteSize},model_silhouettePass:function(){return!1}};e.uniformMap=It(o,e.uniformMap),e.hasSilhouette=!0};var FN=zB;var iZi=x(T(),1);var qSi=x(T(),1),IN=`void modelSplitterStage() { #ifndef SHADOW_MAP if (model_splitDirection < 0.0 && gl_FragCoord.x > czm_splitPosition) discard; if (model_splitDirection > 0.0 && gl_FragCoord.x < czm_splitPosition) discard; #endif } -`;var xB={name:"ModelSplitterPipelineStage",SPLIT_DIRECTION_UNIFORM_NAME:"model_splitDirection"};xB.process=function(e,t,n){let i=e.shaderBuilder;i.addDefine("HAS_MODEL_SPLITTER",void 0,fe.FRAGMENT),i.addFragmentLines(kX);let o={};i.addUniform("float",xB.SPLIT_DIRECTION_UNIFORM_NAME,fe.FRAGMENT),o[xB.SPLIT_DIRECTION_UNIFORM_NAME]=function(){return t.splitDirection},e.uniformMap=It(o,e.uniformMap)};var UX=xB;var kai=x(T(),1);function Ist(e,t){this.model=e.model,this.shaderBuilder=e.shaderBuilder.clone(),this.uniformMap=$e(e.uniformMap),this.alphaOptions=$e(e.alphaOptions),this.renderStateOptions=$e(e.renderStateOptions,!0),this.hasSilhouette=e.hasSilhouette,this.hasSkipLevelOfDetail=e.hasSkipLevelOfDetail,this.runtimeNode=t,this.attributes=[],this.attributeIndex=1,this.featureIdVertexAttributeSetIndex=0,this.instanceCount=0,this.primitiveRenderResources=[]}var DX=Ist;var $ai=x(T(),1);var Bai=x(T(),1);function Pst(e){e=e??B.EMPTY_OBJECT,this.lightingModel=e.lightingModel??zp.UNLIT}var OX=Pst;function Xst(e,t){this.model=e.model,this.runtimeNode=e.runtimeNode,this.attributes=e.attributes.slice(),this.attributeIndex=e.attributeIndex,this.featureIdVertexAttributeSetIndex=e.featureIdVertexAttributeSetIndex,this.uniformMap=$e(e.uniformMap),this.alphaOptions=$e(e.alphaOptions),this.renderStateOptions=$e(e.renderStateOptions,!0),this.hasSilhouette=e.hasSilhouette,this.hasSkipLevelOfDetail=e.hasSkipLevelOfDetail,this.planarFillIdPass=!1,this.shaderBuilder=e.shaderBuilder.clone(),this.instanceCount=e.instanceCount,this.runtimePrimitive=t;let n=t.primitive;this.count=l(n.indices)?n.indices.count:Zt.getAttributeBySemantic(n,"POSITION").count,this.hasPropertyTable=!1,this.indices=n.indices,this.wireframeIndexBuffer=void 0,this.primitiveType=n.primitiveType;let i=Zt.getPositionMinMax(n,this.runtimeNode.instancingTranslationMin,this.runtimeNode.instancingTranslationMax);this.positionMin=h.clone(i.min,new h),this.positionMax=h.clone(i.max,new h),this.boundingSphere=me.fromCornerPoints(this.positionMin,this.positionMax,new me),this.lightingOptions=new OX,this.pickId=void 0,this.snapId=void 0}var BX=Xst;var nli=x(T(),1);var fci=x(T(),1);function lq(e){e=e??B.EMPTY_OBJECT;let t=e.command,n=e.primitiveRenderResources,i=n.model;this._command=t,this._model=i,this._runtimePrimitive=n.runtimePrimitive,this._modelMatrix=t.modelMatrix,this._boundingVolume=t.boundingVolume,this._cullFace=t.renderState.cull.face;let o=i.classificationType;this._classificationType=o,this._classifiesTerrain=o!==ni.CESIUM_3D_TILE,this._classifies3DTiles=o!==ni.TERRAIN,this._useDebugWireframe=i._enableDebugWireframe&&i.debugWireframe,this._pickId=n.pickId,this._commandListTerrain=[],this._commandList3DTiles=[],this._commandListIgnoreShow=[],this._commandListDebugWireframe=[],this._commandListTerrainPicking=[],this._commandList3DTilesPicking=[],wst(this)}function Nst(e){return{colorMask:{red:!1,green:!1,blue:!1,alpha:!1},stencilTest:{enabled:!0,frontFunction:e,frontOperation:{fail:Ft.KEEP,zFail:Ft.DECREMENT_WRAP,zPass:Ft.KEEP},backFunction:e,backOperation:{fail:Ft.KEEP,zFail:Ft.INCREMENT_WRAP,zPass:Ft.KEEP},reference:Jt.CESIUM_3D_TILE_MASK,mask:Jt.CESIUM_3D_TILE_MASK},stencilMask:Jt.CLASSIFICATION_MASK,depthTest:{enabled:!0,func:sc.LESS_OR_EQUAL},depthMask:!1}}var Yst={stencilTest:{enabled:!0,frontFunction:ii.NOT_EQUAL,frontOperation:{fail:Ft.ZERO,zFail:Ft.ZERO,zPass:Ft.ZERO},backFunction:ii.NOT_EQUAL,backOperation:{fail:Ft.ZERO,zFail:Ft.ZERO,zPass:Ft.ZERO},reference:0,mask:Jt.CLASSIFICATION_MASK},stencilMask:Jt.CLASSIFICATION_MASK,depthTest:{enabled:!1},depthMask:!1,blending:on.PRE_MULTIPLIED_ALPHA_BLEND},Mst={stencilTest:{enabled:!0,frontFunction:ii.NOT_EQUAL,frontOperation:{fail:Ft.ZERO,zFail:Ft.ZERO,zPass:Ft.ZERO},backFunction:ii.NOT_EQUAL,backOperation:{fail:Ft.ZERO,zFail:Ft.ZERO,zPass:Ft.ZERO},reference:0,mask:Jt.CLASSIFICATION_MASK},stencilMask:Jt.CLASSIFICATION_MASK,depthTest:{enabled:!1},depthMask:!1},Qxe=[];function wst(e){let t=e._command,n=Qxe;if(e._useDebugWireframe){t.pass=Le.OPAQUE,n.length=0,n.push(t),e._commandListDebugWireframe=zX(e,n,e._commandListDebugWireframe);let r=e._commandListDebugWireframe,s=r.length;for(let a=0;a<s;a++){let c=r[a];c.count*=2,c.offset*=2}return}let o=e.model.allowPicking;if(e._classifiesTerrain){let r=Le.TERRAIN_CLASSIFICATION,s=cq(t,r),a=Jxe(t,r);n.length=0,n.push(s,a),e._commandListTerrain=zX(e,n,e._commandListTerrain),o&&(e._commandListTerrainPicking=jxe(e,n,e._commandListTerrainPicking))}if(e._classifies3DTiles){let r=Le.CESIUM_3D_TILE_CLASSIFICATION,s=cq(t,r),a=Jxe(t,r);n.length=0,n.push(s,a),e._commandList3DTiles=zX(e,n,e._commandList3DTiles),o&&(e._commandList3DTilesPicking=jxe(e,n,e._commandList3DTilesPicking))}}function zX(e,t,n){let i=e._runtimePrimitive,o=i.batchLengths,r=i.batchOffsets,s=o.length,a=t.length;for(let c=0;c<s;c++){let d=o[c],u=r[c];for(let m=0;m<a;m++){let p=t[m],b=lt.shallowClone(p);b.count=d,b.offset=u,n.push(b)}}return n}function cq(e,t){let n=lt.shallowClone(e);n.cull=!1,n.pass=t;let i=t===Le.TERRAIN_CLASSIFICATION?ii.ALWAYS:ii.EQUAL,o=Nst(i);return n.renderState=ze.fromCache(o),n}function Jxe(e,t){let n=lt.shallowClone(e);return n.cull=!1,n.pass=t,n.renderState=ze.fromCache(Yst),n}var kst=[];function jxe(e,t,n){let i=ze.fromCache(Mst),o=t[0],r=t[1],s=lt.shallowClone(o);s.cull=!0,s.pickOnly=!0;let a=lt.shallowClone(r);a.cull=!0,a.pickOnly=!0,a.renderState=i,a.pickId=e._pickId;let c=kst;return c.length=0,c.push(s,a),zX(e,c,n)}Object.defineProperties(lq.prototype,{command:{get:function(){return this._command}},runtimePrimitive:{get:function(){return this._runtimePrimitive}},batchLengths:{get:function(){return this._runtimePrimitive.batchLengths}},batchOffsets:{get:function(){return this._runtimePrimitive.batchOffsets}},model:{get:function(){return this._model}},classificationType:{get:function(){return this._classificationType}},modelMatrix:{get:function(){return this._modelMatrix},set:function(e){this._modelMatrix=P.clone(e,this._modelMatrix);let t=this._runtimePrimitive.boundingSphere;this._boundingVolume=me.transform(t,this._modelMatrix,this._boundingVolume)}},boundingVolume:{get:function(){return this._boundingVolume}},cullFace:{get:function(){return this._cullFace},set:function(e){this._cullFace=e}}});lq.prototype.pushCommands=function(e,t){let n=e.passes;if(n.render){if(this._useDebugWireframe){ei(t,this._commandListDebugWireframe);return}if(this._classifiesTerrain&&ei(t,this._commandListTerrain),this._classifies3DTiles&&ei(t,this._commandList3DTiles),e.invertClassification&&this._classifies3DTiles){if(this._commandListIgnoreShow.length===0){let o=Le.CESIUM_3D_TILE_CLASSIFICATION_IGNORE_SHOW,r=cq(this._command,o),s=Qxe;s.length=0,s.push(r),this._commandListIgnoreShow=zX(this,s,this._commandListIgnoreShow)}ei(t,this._commandListIgnoreShow)}}return n.pick&&(this._classifiesTerrain&&ei(t,this._commandListTerrainPicking),this._classifies3DTiles&&ei(t,this._commandList3DTilesPicking)),t};var HX=lq;var Xci=x(T(),1);function QC(e){e=e??B.EMPTY_OBJECT;let t=e.command,n=e.primitiveRenderResources,i=n.model;this._model=i;let o=n.runtimePrimitive;this._runtimePrimitive=o,this._primitiveRenderResources=n;let r=t.pass===Le.TRANSLUCENT,a=!o.primitive.material.doubleSided&&!r,c=n.hasSilhouette,d=!r&&!c,u=n.hasSkipLevelOfDetail&&!r,m=c,p=l(n.edgeGeometry);this._command=t,this._modelMatrix=P.clone(t.modelMatrix),this._boundingVolume=me.clone(t.boundingVolume),this._modelMatrix2D=new P,this._boundingVolume2D=new me,this._modelMatrix2DDirty=!1,this._backFaceCulling=t.renderState.cull.enabled,this._cullFace=t.renderState.cull.face,this._shadows=i.shadows,this._debugShowBoundingVolume=t.debugShowBoundingVolume,this._usesBackFaceCulling=a,this._needsTranslucentCommand=d,this._needsSkipLevelOfDetailCommands=u,this._needsSilhouetteCommands=m,this._needsEdgeCommands=p,this._needsPlanarFillIdCommand=n.planarFillIdPass,this._originalCommand=void 0,this._translucentCommand=void 0,this._skipLodBackfaceCommand=void 0,this._skipLodStencilCommand=void 0,this._silhouetteModelCommand=void 0,this._silhouetteColorCommand=void 0,this._edgeCommand=void 0,this._edgeSnapCommand=void 0,this._planarFillIdCommand=void 0,this._derivedCommands=[],this._has2DCommands=!1,Ust(this)}function Om(e){this.command=e.command,this.updateShadows=e.updateShadows,this.updateBackFaceCulling=e.updateBackFaceCulling,this.updateCullFace=e.updateCullFace,this.updateDebugShowBoundingVolume=e.updateDebugShowBoundingVolume,this.is2D=e.is2D??!1,this.derivedCommand2D=void 0}Om.clone=function(e){return new Om({command:e.command,updateShadows:e.updateShadows,updateBackFaceCulling:e.updateBackFaceCulling,updateCullFace:e.updateCullFace,updateDebugShowBoundingVolume:e.updateDebugShowBoundingVolume,is2D:e.is2D,derivedCommand2D:e.derivedCommand2D})};function Ust(e){let t=e._command;t.modelMatrix=e._modelMatrix,t.boundingVolume=e._boundingVolume;let n=e._model,i=e._usesBackFaceCulling,o=e._derivedCommands;if(e._originalCommand=new Om({command:t,updateShadows:!0,updateBackFaceCulling:i,updateCullFace:i,updateDebugShowBoundingVolume:!0,is2D:!1}),o.push(e._originalCommand),e._needsTranslucentCommand&&(e._translucentCommand=new Om({command:Jst(t),updateShadows:!0,updateBackFaceCulling:!1,updateCullFace:!1,updateDebugShowBoundingVolume:!0}),o.push(e._translucentCommand)),e._needsSkipLevelOfDetailCommands&&(e._skipLodBackfaceCommand=new Om({command:nat(t),updateShadows:!1,updateBackFaceCulling:!1,updateCullFace:i,updateDebugShowBoundingVolume:!1}),e._skipLodStencilCommand=new Om({command:iat(t,n),updateShadows:!0,updateBackFaceCulling:i,updateCullFace:i,updateDebugShowBoundingVolume:!0}),o.push(e._skipLodBackfaceCommand),o.push(e._skipLodStencilCommand)),e._needsSilhouetteCommands&&(e._silhouetteModelCommand=new Om({command:jst(t,n),updateShadows:!0,updateBackFaceCulling:i,updateCullFace:i,updateDebugShowBoundingVolume:!0}),e._silhouetteColorCommand=new Om({command:Qst(t,n),updateShadows:!1,updateBackFaceCulling:!1,updateCullFace:!1,updateDebugShowBoundingVolume:!1}),o.push(e._silhouetteModelCommand),o.push(e._silhouetteColorCommand)),e._needsEdgeCommands){let r=e._primitiveRenderResources,s=r.edgeGeometry,a=l(s.lineWidth)?s.lineWidth:1,c=1;e._edgeCommand=new Om({command:qxe(t,r,a),updateShadows:!1,updateBackFaceCulling:!1,updateCullFace:!1,updateDebugShowBoundingVolume:!1}),e._edgeSnapCommand=new Om({command:qxe(t,r,c),updateShadows:!1,updateBackFaceCulling:!1,updateCullFace:!1,updateDebugShowBoundingVolume:!1}),o.push(e._edgeCommand),o.push(e._edgeSnapCommand)}e._needsPlanarFillIdCommand&&(e._planarFillIdCommand=new Om({command:qst(t),updateShadows:!1,updateBackFaceCulling:!1,updateCullFace:!1,updateDebugShowBoundingVolume:!1}),o.push(e._planarFillIdCommand)),e._primitiveRenderResources=void 0}Object.defineProperties(QC.prototype,{command:{get:function(){return this._command}},runtimePrimitive:{get:function(){return this._runtimePrimitive}},model:{get:function(){return this._model}},primitiveType:{get:function(){return this._command.primitiveType}},modelMatrix:{get:function(){return this._modelMatrix},set:function(e){this._modelMatrix=P.clone(e,this._modelMatrix),this._modelMatrix2DDirty=!0,this._boundingVolume=me.transform(this.runtimePrimitive.boundingSphere,this._modelMatrix,this._boundingVolume)}},boundingVolume:{get:function(){return this._boundingVolume}},shadows:{get:function(){return this._shadows},set:function(e){this._shadows=e,Ost(this)}},backFaceCulling:{get:function(){return this._backFaceCulling},set:function(e){this._backFaceCulling!==e&&(this._backFaceCulling=e,Bst(this))}},cullFace:{get:function(){return this._cullFace},set:function(e){this._cullFace!==e&&(this._cullFace=e,zst(this))}},debugShowBoundingVolume:{get:function(){return this._debugShowBoundingVolume},set:function(e){this._debugShowBoundingVolume!==e&&(this._debugShowBoundingVolume=e,Hst(this))}}});function Dst(e,t){let n=e._modelMatrix;e._modelMatrix2D=P.clone(n,e._modelMatrix2D),e._modelMatrix2D[13]-=W.sign(n[13])*2*W.PI*t.mapProjection.ellipsoid.maximumRadius,e._boundingVolume2D=me.transform(e.runtimePrimitive.boundingSphere,e._modelMatrix2D,e._boundingVolume2D)}function Ost(e){let t=e.shadows,n=vn.castShadows(t),i=vn.receiveShadows(t),o=e._derivedCommands;for(let r=0;r<o.length;++r){let s=o[r];if(s.updateShadows){let a=s.command;a.castShadows=n,a.receiveShadows=i}}}function Bst(e){let t=e.backFaceCulling,n=e._derivedCommands;for(let i=0;i<n.length;++i){let o=n[i];if(o.updateBackFaceCulling){let r=o.command,s=$e(r.renderState,!0);s.cull.enabled=t,r.renderState=ze.fromCache(s)}}}function zst(e){let t=e.cullFace,n=e._derivedCommands;for(let i=0;i<n.length;++i){let o=n[i];if(o.updateCullFace){let r=o.command,s=$e(r.renderState,!0);s.cull.face=t,r.renderState=ze.fromCache(s)}}}function Hst(e){let t=e.debugShowBoundingVolume,n=e._derivedCommands;for(let i=0;i<n.length;++i){let o=n[i];if(o.updateDebugShowBoundingVolume){let r=o.command;r.debugShowBoundingVolume=t}}}QC.prototype.pushCommands=function(e,t){let n=TB(this,e);n&&!this._has2DCommands&&(Kst(this),this._has2DCommands=!0,this._modelMatrix2DDirty=!0),this._modelMatrix2DDirty&&(Dst(this,e),this._modelMatrix2DDirty=!1);let i=this.model.styleCommandsNeeded;if(!(this._needsTranslucentCommand&&l(i)&&(i!==uf.ALL_OPAQUE&&Hp(t,this._translucentCommand,n),i===uf.ALL_TRANSLUCENT))){if(this._needsSkipLevelOfDetailCommands){let{tileset:o,tile:r}=this._model.content;if(o.hasMixedContent){r._finalResolution||Hp(o._backfaceCommands,this._skipLodBackfaceCommand,n),$st(this,r,n),Hp(t,this._skipLodStencilCommand,n);return}}if(this._needsSilhouetteCommands){Hp(t,this._silhouetteModelCommand,n);return}return this._model.edgeDisplayMode===km.EDGES_ONLY&&this._needsEdgeCommands||Hp(t,this._originalCommand,n),t}};QC.prototype.pushSilhouetteCommands=function(e,t){let n=TB(this,e);return Hp(t,this._silhouetteColorCommand,n),t};QC.prototype.pushEdgeCommands=function(e,t){if(!l(this._edgeCommand))return t;let n=this._model.edgeDisplayMode,i=e.passes,o=TB(this,e);if(i.snap){let s=this._edgeSnapCommand;return s.command.pass=Le.CESIUM_3D_TILE_EDGES_DIRECT,l(s.derivedCommand2D)&&(s.derivedCommand2D.command.pass=Le.CESIUM_3D_TILE_EDGES_DIRECT),Hp(t,s,o),t}if(i.pick){if(n!==km.EDGES_ONLY)return t;let s=this._edgeCommand;return s.command.pass=Le.CESIUM_3D_TILE_EDGES_DIRECT,l(s.derivedCommand2D)&&(s.derivedCommand2D.command.pass=Le.CESIUM_3D_TILE_EDGES_DIRECT),Hp(t,s,o),t}if(n===km.SURFACES_ONLY)return t;let r=n===km.EDGES_ONLY?Le.CESIUM_3D_TILE_EDGES_DIRECT:Le.CESIUM_3D_TILE_EDGES;return this._edgeCommand.command.pass=r,l(this._edgeCommand.derivedCommand2D)&&(this._edgeCommand.derivedCommand2D.command.pass=r),Hp(t,this._edgeCommand,o),t};QC.prototype.pushPlanarFillIdCommands=function(e,t){if(!l(this._planarFillIdCommand))return t;let n=TB(this,e);return Hp(t,this._planarFillIdCommand,n),t};function Hp(e,t,n){e.push(t.command),n&&e.push(t.derivedCommand2D.command)}function TB(e,t){if(t.mode!==se.SCENE2D||e.model._projectTo2D)return!1;let i=e.model.sceneGraph._boundingSphere2D,o=i.center.y-i.radius,r=i.center.y+i.radius,s=t.mapProjection.ellipsoid.maximumRadius*W.PI;return o<s&&r>s||o<-s&&r>-s}function $b(e,t){if(!l(t))return;let n=Om.clone(t),i=lt.shallowClone(t.command);return i.modelMatrix=e._modelMatrix2D,i.boundingVolume=e._boundingVolume2D,n.command=i,n.updateShadows=!1,n.is2D=!0,t.derivedCommand2D=n,e._derivedCommands.push(n),n}function Kst(e){$b(e,e._originalCommand),$b(e,e._translucentCommand),$b(e,e._skipLodBackfaceCommand),$b(e,e._skipLodStencilCommand),$b(e,e._silhouetteModelCommand),$b(e,e._silhouetteColorCommand),$b(e,e._edgeCommand),$b(e,e._edgeSnapCommand),$b(e,e._planarFillIdCommand)}function Jst(e){let t=lt.shallowClone(e);t.pass=Le.TRANSLUCENT;let n=$e(e.renderState,!0);return n.cull.enabled=!1,n.depthMask=!1,n.blending=on.ALPHA_BLEND,t.renderState=ze.fromCache(n),t}function jst(e,t){let n=t._silhouetteId%255,i=lt.shallowClone(e),o=$e(e.renderState,!0);return o.stencilTest={enabled:!0,frontFunction:ie.ALWAYS,backFunction:ie.ALWAYS,reference:n,mask:-1,frontOperation:{fail:ie.KEEP,zFail:ie.KEEP,zPass:ie.REPLACE},backOperation:{fail:ie.KEEP,zFail:ie.KEEP,zPass:ie.REPLACE}},t.isInvisible()&&(o.colorMask={red:!1,green:!1,blue:!1,alpha:!1}),i.renderState=ze.fromCache(o),i}function Qst(e,t){let n=t._silhouetteId%255,i=lt.shallowClone(e),o=$e(e.renderState,!0);o.cull.enabled=!1,(e.pass===Le.TRANSLUCENT||t.silhouetteColor.alpha<1)&&(i.pass=Le.TRANSLUCENT,o.depthMask=!1,o.blending=on.ALPHA_BLEND),o.stencilTest={enabled:!0,frontFunction:ie.NOTEQUAL,backFunction:ie.NOTEQUAL,reference:n,mask:-1,frontOperation:{fail:ie.KEEP,zFail:ie.KEEP,zPass:ie.KEEP},backOperation:{fail:ie.KEEP,zFail:ie.KEEP,zPass:ie.KEEP}};let s=$e(e.uniformMap);return s.model_silhouettePass=function(){return!0},i.renderState=ze.fromCache(o),i.uniformMap=s,i.castShadows=!1,i.receiveShadows=!1,i}function qxe(e,t,n){let i=t.edgeGeometry,o=lt.shallowClone(e);o.vertexArray=i.vertexArray,o.primitiveType=i.primitiveType,o.count=i.indexCount,l(i.shaderProgram)&&(o.shaderProgram=i.shaderProgram),o.pass=i.pass;let r=$e(e.uniformMap);return r.u_isEdgePass=function(){return!0},r.u_lineWidth=function(){return n},o.uniformMap=r,o.castShadows=!1,o.receiveShadows=!1,o}function qst(e){let t=lt.shallowClone(e);t.pass=Le.CESIUM_3D_TILE_PLANAR_FILL_ID,t.castShadows=!1,t.receiveShadows=!1;let n=$e(e.renderState,!0);n.blending.enabled=!1,t.renderState=ze.fromCache(n);let i=$e(e.uniformMap);return i.u_isPlanarFillIdPass=function(){return!0},t.uniformMap=i,t}function $st(e,t,n){let i=e._skipLodStencilCommand,o=i.command,r=t._selectionDepth,s=eat(o);if(r!==s){let a=tat(r),c=$e(o.renderState,!0);c.stencilTest.reference=a,o.renderState=ze.fromCache(c),n&&(i.derivedCommand2D.renderState=c)}}function eat(e){return(e.renderState.stencilTest.reference&Jt.SKIP_LOD_MASK)>>>Jt.SKIP_LOD_BIT_SHIFT}function tat(e){return Jt.CESIUM_3D_TILE_MASK|e<<Jt.SKIP_LOD_BIT_SHIFT}function nat(e){let t=lt.shallowClone(e),n=$e(e.renderState,!0);n.cull.enabled=!0,n.cull.face=Di.FRONT,n.colorMask={red:!1,green:!1,blue:!1,alpha:!1},n.polygonOffset={enabled:!0,factor:5,units:5};let i=$e(t.uniformMap),o=new k(5,5);return i.u_polygonOffset=function(){return o},t.renderState=ze.fromCache(n),t.uniformMap=i,t.castShadows=!1,t.receiveShadows=!1,t}function iat(e){let t=lt.shallowClone(e),n=$e(e.renderState,!0),{stencilTest:i}=n;return i.enabled=!0,i.mask=Jt.SKIP_LOD_MASK,i.reference=Jt.CESIUM_3D_TILE_MASK,i.frontFunction=ii.GREATER_OR_EQUAL,i.frontOperation.zPass=Ft.REPLACE,i.backFunction=ii.GREATER_OR_EQUAL,i.backOperation.zPass=Ft.REPLACE,n.stencilMask=Jt.CESIUM_3D_TILE_MASK|Jt.SKIP_LOD_MASK,t.renderState=ze.fromCache(n),t}var KX=QC;var Yci=x(T(),1),JX=`precision highp float; +`;var HB={name:"ModelSplitterPipelineStage",SPLIT_DIRECTION_UNIFORM_NAME:"model_splitDirection"};HB.process=function(e,t,n){let i=e.shaderBuilder;i.addDefine("HAS_MODEL_SPLITTER",void 0,fe.FRAGMENT),i.addFragmentLines(IN);let o={};i.addUniform("float",HB.SPLIT_DIRECTION_UNIFORM_NAME,fe.FRAGMENT),o[HB.SPLIT_DIRECTION_UNIFORM_NAME]=function(){return t.splitDirection},e.uniformMap=It(o,e.uniformMap)};var PN=HB;var sZi=x(T(),1);function Sdt(e,t){this.model=e.model,this.shaderBuilder=e.shaderBuilder.clone(),this.uniformMap=$e(e.uniformMap),this.alphaOptions=$e(e.alphaOptions),this.renderStateOptions=$e(e.renderStateOptions,!0),this.hasSilhouette=e.hasSilhouette,this.hasSkipLevelOfDetail=e.hasSkipLevelOfDetail,this.runtimeNode=t,this.attributes=[],this.attributeIndex=1,this.featureIdVertexAttributeSetIndex=0,this.instanceCount=0,this.primitiveRenderResources=[]}var XN=Sdt;var yZi=x(T(),1);var dZi=x(T(),1);function Zdt(e){e=e??B.EMPTY_OBJECT,this.lightingModel=e.lightingModel??$p.UNLIT}var NN=Zdt;function Rdt(e,t){this.model=e.model,this.runtimeNode=e.runtimeNode,this.attributes=e.attributes.slice(),this.attributeIndex=e.attributeIndex,this.featureIdVertexAttributeSetIndex=e.featureIdVertexAttributeSetIndex,this.uniformMap=$e(e.uniformMap),this.alphaOptions=$e(e.alphaOptions),this.renderStateOptions=$e(e.renderStateOptions,!0),this.hasSilhouette=e.hasSilhouette,this.hasSkipLevelOfDetail=e.hasSkipLevelOfDetail,this.planarFillIdPass=!1,this.shaderBuilder=e.shaderBuilder.clone(),this.instanceCount=e.instanceCount,this.runtimePrimitive=t;let n=t.primitive;this.count=l(n.indices)?n.indices.count:Zt.getAttributeBySemantic(n,"POSITION").count,this.hasPropertyTable=!1,this.indices=n.indices,this.wireframeIndexBuffer=void 0,this.primitiveType=n.primitiveType;let i=Zt.getPositionMinMax(n,this.runtimeNode.instancingTranslationMin,this.runtimeNode.instancingTranslationMax);this.positionMin=h.clone(i.min,new h),this.positionMax=h.clone(i.max,new h),this.boundingSphere=me.fromCornerPoints(this.positionMin,this.positionMax,new me),this.lightingOptions=new NN,this.pickId=void 0,this.snapId=void 0}var YN=Rdt;var _Ri=x(T(),1);var FZi=x(T(),1);function n$(e){e=e??B.EMPTY_OBJECT;let t=e.command,n=e.primitiveRenderResources,i=n.model;this._command=t,this._model=i,this._runtimePrimitive=n.runtimePrimitive,this._modelMatrix=t.modelMatrix,this._boundingVolume=t.boundingVolume,this._cullFace=t.renderState.cull.face;let o=i.classificationType;this._classificationType=o,this._classifiesTerrain=o!==ti.CESIUM_3D_TILE,this._classifies3DTiles=o!==ti.TERRAIN,this._useDebugWireframe=i._enableDebugWireframe&&i.debugWireframe,this._pickId=n.pickId,this._commandListTerrain=[],this._commandList3DTiles=[],this._commandListIgnoreShow=[],this._commandListDebugWireframe=[],this._commandListTerrainPicking=[],this._commandList3DTilesPicking=[],Adt(this)}function Cdt(e){return{colorMask:{red:!1,green:!1,blue:!1,alpha:!1},stencilTest:{enabled:!0,frontFunction:e,frontOperation:{fail:Ft.KEEP,zFail:Ft.DECREMENT_WRAP,zPass:Ft.KEEP},backFunction:e,backOperation:{fail:Ft.KEEP,zFail:Ft.INCREMENT_WRAP,zPass:Ft.KEEP},reference:Jt.CESIUM_3D_TILE_MASK,mask:Jt.CESIUM_3D_TILE_MASK},stencilMask:Jt.CLASSIFICATION_MASK,depthTest:{enabled:!0,func:sc.LESS_OR_EQUAL},depthMask:!1}}var Vdt={stencilTest:{enabled:!0,frontFunction:ni.NOT_EQUAL,frontOperation:{fail:Ft.ZERO,zFail:Ft.ZERO,zPass:Ft.ZERO},backFunction:ni.NOT_EQUAL,backOperation:{fail:Ft.ZERO,zFail:Ft.ZERO,zPass:Ft.ZERO},reference:0,mask:Jt.CLASSIFICATION_MASK},stencilMask:Jt.CLASSIFICATION_MASK,depthTest:{enabled:!1},depthMask:!1,blending:on.PRE_MULTIPLIED_ALPHA_BLEND},Edt={stencilTest:{enabled:!0,frontFunction:ni.NOT_EQUAL,frontOperation:{fail:Ft.ZERO,zFail:Ft.ZERO,zPass:Ft.ZERO},backFunction:ni.NOT_EQUAL,backOperation:{fail:Ft.ZERO,zFail:Ft.ZERO,zPass:Ft.ZERO},reference:0,mask:Jt.CLASSIFICATION_MASK},stencilMask:Jt.CLASSIFICATION_MASK,depthTest:{enabled:!1},depthMask:!1},gZe=[];function Adt(e){let t=e._command,n=gZe;if(e._useDebugWireframe){t.pass=Le.OPAQUE,n.length=0,n.push(t),e._commandListDebugWireframe=MN(e,n,e._commandListDebugWireframe);let r=e._commandListDebugWireframe,s=r.length;for(let a=0;a<s;a++){let c=r[a];c.count*=2,c.offset*=2}return}let o=e.model.allowPicking;if(e._classifiesTerrain){let r=Le.TERRAIN_CLASSIFICATION,s=t$(t,r),a=pZe(t,r);n.length=0,n.push(s,a),e._commandListTerrain=MN(e,n,e._commandListTerrain),o&&(e._commandListTerrainPicking=bZe(e,n,e._commandListTerrainPicking))}if(e._classifies3DTiles){let r=Le.CESIUM_3D_TILE_CLASSIFICATION,s=t$(t,r),a=pZe(t,r);n.length=0,n.push(s,a),e._commandList3DTiles=MN(e,n,e._commandList3DTiles),o&&(e._commandList3DTilesPicking=bZe(e,n,e._commandList3DTilesPicking))}}function MN(e,t,n){let i=e._runtimePrimitive,o=i.batchLengths,r=i.batchOffsets,s=o.length,a=t.length;for(let c=0;c<s;c++){let d=o[c],u=r[c];for(let m=0;m<a;m++){let p=t[m],b=lt.shallowClone(p);b.count=d,b.offset=u,n.push(b)}}return n}function t$(e,t){let n=lt.shallowClone(e);n.cull=!1,n.pass=t;let i=t===Le.TERRAIN_CLASSIFICATION?ni.ALWAYS:ni.EQUAL,o=Cdt(i);return n.renderState=ze.fromCache(o),n}function pZe(e,t){let n=lt.shallowClone(e);return n.cull=!1,n.pass=t,n.renderState=ze.fromCache(Vdt),n}var Gdt=[];function bZe(e,t,n){let i=ze.fromCache(Edt),o=t[0],r=t[1],s=lt.shallowClone(o);s.cull=!0,s.pickOnly=!0;let a=lt.shallowClone(r);a.cull=!0,a.pickOnly=!0,a.renderState=i,a.pickId=e._pickId;let c=Gdt;return c.length=0,c.push(s,a),MN(e,c,n)}Object.defineProperties(n$.prototype,{command:{get:function(){return this._command}},runtimePrimitive:{get:function(){return this._runtimePrimitive}},batchLengths:{get:function(){return this._runtimePrimitive.batchLengths}},batchOffsets:{get:function(){return this._runtimePrimitive.batchOffsets}},model:{get:function(){return this._model}},classificationType:{get:function(){return this._classificationType}},modelMatrix:{get:function(){return this._modelMatrix},set:function(e){this._modelMatrix=P.clone(e,this._modelMatrix);let t=this._runtimePrimitive.boundingSphere;this._boundingVolume=me.transform(t,this._modelMatrix,this._boundingVolume)}},boundingVolume:{get:function(){return this._boundingVolume}},cullFace:{get:function(){return this._cullFace},set:function(e){this._cullFace=e}}});n$.prototype.pushCommands=function(e,t){let n=e.passes;if(n.render){if(this._useDebugWireframe){ei(t,this._commandListDebugWireframe);return}if(this._classifiesTerrain&&ei(t,this._commandListTerrain),this._classifies3DTiles&&ei(t,this._commandList3DTiles),e.invertClassification&&this._classifies3DTiles){if(this._commandListIgnoreShow.length===0){let o=Le.CESIUM_3D_TILE_CLASSIFICATION_IGNORE_SHOW,r=t$(this._command,o),s=gZe;s.length=0,s.push(r),this._commandListIgnoreShow=MN(this,s,this._commandListIgnoreShow)}ei(t,this._commandListIgnoreShow)}}return n.pick&&(this._classifiesTerrain&&ei(t,this._commandListTerrainPicking),this._classifies3DTiles&&ei(t,this._commandList3DTilesPicking)),t};var wN=n$;var tRi=x(T(),1);function CV(e){e=e??B.EMPTY_OBJECT;let t=e.command,n=e.primitiveRenderResources,i=n.model;this._model=i;let o=n.runtimePrimitive;this._runtimePrimitive=o,this._primitiveRenderResources=n;let r=t.pass===Le.TRANSLUCENT,a=!o.primitive.material.doubleSided&&!r,c=n.hasSilhouette,d=!r&&!c,u=n.hasSkipLevelOfDetail&&!r,m=c,p=l(n.edgeGeometry);this._command=t,this._modelMatrix=P.clone(t.modelMatrix),this._boundingVolume=me.clone(t.boundingVolume),this._modelMatrix2D=new P,this._boundingVolume2D=new me,this._modelMatrix2DDirty=!1,this._backFaceCulling=t.renderState.cull.enabled,this._cullFace=t.renderState.cull.face,this._shadows=i.shadows,this._debugShowBoundingVolume=t.debugShowBoundingVolume,this._usesBackFaceCulling=a,this._needsTranslucentCommand=d,this._needsSkipLevelOfDetailCommands=u,this._needsSilhouetteCommands=m,this._needsEdgeCommands=p,this._needsPlanarFillIdCommand=n.planarFillIdPass,this._originalCommand=void 0,this._translucentCommand=void 0,this._skipLodBackfaceCommand=void 0,this._skipLodStencilCommand=void 0,this._silhouetteModelCommand=void 0,this._silhouetteColorCommand=void 0,this._edgeCommand=void 0,this._edgeSnapCommand=void 0,this._planarFillIdCommand=void 0,this._derivedCommands=[],this._has2DCommands=!1,Ldt(this)}function qm(e){this.command=e.command,this.updateShadows=e.updateShadows,this.updateBackFaceCulling=e.updateBackFaceCulling,this.updateCullFace=e.updateCullFace,this.updateDebugShowBoundingVolume=e.updateDebugShowBoundingVolume,this.is2D=e.is2D??!1,this.derivedCommand2D=void 0}qm.clone=function(e){return new qm({command:e.command,updateShadows:e.updateShadows,updateBackFaceCulling:e.updateBackFaceCulling,updateCullFace:e.updateCullFace,updateDebugShowBoundingVolume:e.updateDebugShowBoundingVolume,is2D:e.is2D,derivedCommand2D:e.derivedCommand2D})};function Ldt(e){let t=e._command;t.modelMatrix=e._modelMatrix,t.boundingVolume=e._boundingVolume;let n=e._model,i=e._usesBackFaceCulling,o=e._derivedCommands;if(e._originalCommand=new qm({command:t,updateShadows:!0,updateBackFaceCulling:i,updateCullFace:i,updateDebugShowBoundingVolume:!0,is2D:!1}),o.push(e._originalCommand),e._needsTranslucentCommand&&(e._translucentCommand=new qm({command:Ndt(t),updateShadows:!0,updateBackFaceCulling:!1,updateCullFace:!1,updateDebugShowBoundingVolume:!0}),o.push(e._translucentCommand)),e._needsSkipLevelOfDetailCommands&&(e._skipLodBackfaceCommand=new qm({command:Odt(t),updateShadows:!1,updateBackFaceCulling:!1,updateCullFace:i,updateDebugShowBoundingVolume:!1}),e._skipLodStencilCommand=new qm({command:Bdt(t,n),updateShadows:!0,updateBackFaceCulling:i,updateCullFace:i,updateDebugShowBoundingVolume:!0}),o.push(e._skipLodBackfaceCommand),o.push(e._skipLodStencilCommand)),e._needsSilhouetteCommands&&(e._silhouetteModelCommand=new qm({command:Ydt(t,n),updateShadows:!0,updateBackFaceCulling:i,updateCullFace:i,updateDebugShowBoundingVolume:!0}),e._silhouetteColorCommand=new qm({command:Mdt(t,n),updateShadows:!1,updateBackFaceCulling:!1,updateCullFace:!1,updateDebugShowBoundingVolume:!1}),o.push(e._silhouetteModelCommand),o.push(e._silhouetteColorCommand)),e._needsEdgeCommands){let r=e._primitiveRenderResources,s=r.edgeGeometry,a=l(s.lineWidth)?s.lineWidth:1,c=1;e._edgeCommand=new qm({command:yZe(t,r,a),updateShadows:!1,updateBackFaceCulling:!1,updateCullFace:!1,updateDebugShowBoundingVolume:!1}),e._edgeSnapCommand=new qm({command:yZe(t,r,c),updateShadows:!1,updateBackFaceCulling:!1,updateCullFace:!1,updateDebugShowBoundingVolume:!1}),o.push(e._edgeCommand),o.push(e._edgeSnapCommand)}e._needsPlanarFillIdCommand&&(e._planarFillIdCommand=new qm({command:wdt(t),updateShadows:!1,updateBackFaceCulling:!1,updateCullFace:!1,updateDebugShowBoundingVolume:!1}),o.push(e._planarFillIdCommand)),e._primitiveRenderResources=void 0}Object.defineProperties(CV.prototype,{command:{get:function(){return this._command}},runtimePrimitive:{get:function(){return this._runtimePrimitive}},model:{get:function(){return this._model}},primitiveType:{get:function(){return this._command.primitiveType}},modelMatrix:{get:function(){return this._modelMatrix},set:function(e){this._modelMatrix=P.clone(e,this._modelMatrix),this._modelMatrix2DDirty=!0,this._boundingVolume=me.transform(this.runtimePrimitive.boundingSphere,this._modelMatrix,this._boundingVolume)}},boundingVolume:{get:function(){return this._boundingVolume}},shadows:{get:function(){return this._shadows},set:function(e){this._shadows=e,vdt(this)}},backFaceCulling:{get:function(){return this._backFaceCulling},set:function(e){this._backFaceCulling!==e&&(this._backFaceCulling=e,Fdt(this))}},cullFace:{get:function(){return this._cullFace},set:function(e){this._cullFace!==e&&(this._cullFace=e,Idt(this))}},debugShowBoundingVolume:{get:function(){return this._debugShowBoundingVolume},set:function(e){this._debugShowBoundingVolume!==e&&(this._debugShowBoundingVolume=e,Pdt(this))}}});function Wdt(e,t){let n=e._modelMatrix;e._modelMatrix2D=P.clone(n,e._modelMatrix2D),e._modelMatrix2D[13]-=W.sign(n[13])*2*W.PI*t.mapProjection.ellipsoid.maximumRadius,e._boundingVolume2D=me.transform(e.runtimePrimitive.boundingSphere,e._modelMatrix2D,e._boundingVolume2D)}function vdt(e){let t=e.shadows,n=Wn.castShadows(t),i=Wn.receiveShadows(t),o=e._derivedCommands;for(let r=0;r<o.length;++r){let s=o[r];if(s.updateShadows){let a=s.command;a.castShadows=n,a.receiveShadows=i}}}function Fdt(e){let t=e.backFaceCulling,n=e._derivedCommands;for(let i=0;i<n.length;++i){let o=n[i];if(o.updateBackFaceCulling){let r=o.command,s=$e(r.renderState,!0);s.cull.enabled=t,r.renderState=ze.fromCache(s)}}}function Idt(e){let t=e.cullFace,n=e._derivedCommands;for(let i=0;i<n.length;++i){let o=n[i];if(o.updateCullFace){let r=o.command,s=$e(r.renderState,!0);s.cull.face=t,r.renderState=ze.fromCache(s)}}}function Pdt(e){let t=e.debugShowBoundingVolume,n=e._derivedCommands;for(let i=0;i<n.length;++i){let o=n[i];if(o.updateDebugShowBoundingVolume){let r=o.command;r.debugShowBoundingVolume=t}}}CV.prototype.pushCommands=function(e,t){let n=KB(this,e);n&&!this._has2DCommands&&(Xdt(this),this._has2DCommands=!0,this._modelMatrix2DDirty=!0),this._modelMatrix2DDirty&&(Wdt(this,e),this._modelMatrix2DDirty=!1);let i=this.model.styleCommandsNeeded;if(!(this._needsTranslucentCommand&&l(i)&&(i!==Zf.ALL_OPAQUE&&e0(t,this._translucentCommand,n),i===Zf.ALL_TRANSLUCENT))){if(this._needsSkipLevelOfDetailCommands){let{tileset:o,tile:r}=this._model.content;if(o.hasMixedContent){r._finalResolution||e0(o._backfaceCommands,this._skipLodBackfaceCommand,n),kdt(this,r,n),e0(t,this._skipLodStencilCommand,n);return}}if(this._needsSilhouetteCommands){e0(t,this._silhouetteModelCommand,n);return}return this._model.edgeDisplayMode===Bm.EDGES_ONLY&&this._needsEdgeCommands||e0(t,this._originalCommand,n),t}};CV.prototype.pushSilhouetteCommands=function(e,t){let n=KB(this,e);return e0(t,this._silhouetteColorCommand,n),t};CV.prototype.pushEdgeCommands=function(e,t){if(!l(this._edgeCommand))return t;let n=this._model.edgeDisplayMode,i=e.passes,o=KB(this,e);if(i.snap){let s=this._edgeSnapCommand;return s.command.pass=Le.CESIUM_3D_TILE_EDGES_DIRECT,l(s.derivedCommand2D)&&(s.derivedCommand2D.command.pass=Le.CESIUM_3D_TILE_EDGES_DIRECT),e0(t,s,o),t}if(i.pick){if(n!==Bm.EDGES_ONLY)return t;let s=this._edgeCommand;return s.command.pass=Le.CESIUM_3D_TILE_EDGES_DIRECT,l(s.derivedCommand2D)&&(s.derivedCommand2D.command.pass=Le.CESIUM_3D_TILE_EDGES_DIRECT),e0(t,s,o),t}if(n===Bm.SURFACES_ONLY)return t;let r=n===Bm.EDGES_ONLY?Le.CESIUM_3D_TILE_EDGES_DIRECT:Le.CESIUM_3D_TILE_EDGES;return this._edgeCommand.command.pass=r,l(this._edgeCommand.derivedCommand2D)&&(this._edgeCommand.derivedCommand2D.command.pass=r),e0(t,this._edgeCommand,o),t};CV.prototype.pushPlanarFillIdCommands=function(e,t){if(!l(this._planarFillIdCommand))return t;let n=KB(this,e);return e0(t,this._planarFillIdCommand,n),t};function e0(e,t,n){e.push(t.command),n&&e.push(t.derivedCommand2D.command)}function KB(e,t){if(t.mode!==se.SCENE2D||e.model._projectTo2D)return!1;let i=e.model.sceneGraph._boundingSphere2D,o=i.center.y-i.radius,r=i.center.y+i.radius,s=t.mapProjection.ellipsoid.maximumRadius*W.PI;return o<s&&r>s||o<-s&&r>-s}function rg(e,t){if(!l(t))return;let n=qm.clone(t),i=lt.shallowClone(t.command);return i.modelMatrix=e._modelMatrix2D,i.boundingVolume=e._boundingVolume2D,n.command=i,n.updateShadows=!1,n.is2D=!0,t.derivedCommand2D=n,e._derivedCommands.push(n),n}function Xdt(e){rg(e,e._originalCommand),rg(e,e._translucentCommand),rg(e,e._skipLodBackfaceCommand),rg(e,e._skipLodStencilCommand),rg(e,e._silhouetteModelCommand),rg(e,e._silhouetteColorCommand),rg(e,e._edgeCommand),rg(e,e._edgeSnapCommand),rg(e,e._planarFillIdCommand)}function Ndt(e){let t=lt.shallowClone(e);t.pass=Le.TRANSLUCENT;let n=$e(e.renderState,!0);return n.cull.enabled=!1,n.depthMask=!1,n.blending=on.ALPHA_BLEND,t.renderState=ze.fromCache(n),t}function Ydt(e,t){let n=t._silhouetteId%255,i=lt.shallowClone(e),o=$e(e.renderState,!0);return o.stencilTest={enabled:!0,frontFunction:ie.ALWAYS,backFunction:ie.ALWAYS,reference:n,mask:-1,frontOperation:{fail:ie.KEEP,zFail:ie.KEEP,zPass:ie.REPLACE},backOperation:{fail:ie.KEEP,zFail:ie.KEEP,zPass:ie.REPLACE}},t.isInvisible()&&(o.colorMask={red:!1,green:!1,blue:!1,alpha:!1}),i.renderState=ze.fromCache(o),i}function Mdt(e,t){let n=t._silhouetteId%255,i=lt.shallowClone(e),o=$e(e.renderState,!0);o.cull.enabled=!1,(e.pass===Le.TRANSLUCENT||t.silhouetteColor.alpha<1)&&(i.pass=Le.TRANSLUCENT,o.depthMask=!1,o.blending=on.ALPHA_BLEND),o.stencilTest={enabled:!0,frontFunction:ie.NOTEQUAL,backFunction:ie.NOTEQUAL,reference:n,mask:-1,frontOperation:{fail:ie.KEEP,zFail:ie.KEEP,zPass:ie.KEEP},backOperation:{fail:ie.KEEP,zFail:ie.KEEP,zPass:ie.KEEP}};let s=$e(e.uniformMap);return s.model_silhouettePass=function(){return!0},i.renderState=ze.fromCache(o),i.uniformMap=s,i.castShadows=!1,i.receiveShadows=!1,i}function yZe(e,t,n){let i=t.edgeGeometry,o=lt.shallowClone(e);o.vertexArray=i.vertexArray,o.primitiveType=i.primitiveType,o.count=i.indexCount,l(i.shaderProgram)&&(o.shaderProgram=i.shaderProgram),o.pass=i.pass;let r=$e(e.uniformMap);return r.u_isEdgePass=function(){return!0},r.u_lineWidth=function(){return n},o.uniformMap=r,o.castShadows=!1,o.receiveShadows=!1,o}function wdt(e){let t=lt.shallowClone(e);t.pass=Le.CESIUM_3D_TILE_PLANAR_FILL_ID,t.castShadows=!1,t.receiveShadows=!1;let n=$e(e.renderState,!0);n.blending.enabled=!1,t.renderState=ze.fromCache(n);let i=$e(e.uniformMap);return i.u_isPlanarFillIdPass=function(){return!0},t.uniformMap=i,t}function kdt(e,t,n){let i=e._skipLodStencilCommand,o=i.command,r=t._selectionDepth,s=Udt(o);if(r!==s){let a=Ddt(r),c=$e(o.renderState,!0);c.stencilTest.reference=a,o.renderState=ze.fromCache(c),n&&(i.derivedCommand2D.renderState=c)}}function Udt(e){return(e.renderState.stencilTest.reference&Jt.SKIP_LOD_MASK)>>>Jt.SKIP_LOD_BIT_SHIFT}function Ddt(e){return Jt.CESIUM_3D_TILE_MASK|e<<Jt.SKIP_LOD_BIT_SHIFT}function Odt(e){let t=lt.shallowClone(e),n=$e(e.renderState,!0);n.cull.enabled=!0,n.cull.face=Ui.FRONT,n.colorMask={red:!1,green:!1,blue:!1,alpha:!1},n.polygonOffset={enabled:!0,factor:5,units:5};let i=$e(t.uniformMap),o=new k(5,5);return i.u_polygonOffset=function(){return o},t.renderState=ze.fromCache(n),t.uniformMap=i,t.castShadows=!1,t.receiveShadows=!1,t}function Bdt(e){let t=lt.shallowClone(e),n=$e(e.renderState,!0),{stencilTest:i}=n;return i.enabled=!0,i.mask=Jt.SKIP_LOD_MASK,i.reference=Jt.CESIUM_3D_TILE_MASK,i.frontFunction=ni.GREATER_OR_EQUAL,i.frontOperation.zPass=Ft.REPLACE,i.backFunction=ni.GREATER_OR_EQUAL,i.backOperation.zPass=Ft.REPLACE,n.stencilMask=Jt.CESIUM_3D_TILE_MASK|Jt.SKIP_LOD_MASK,t.renderState=ze.fromCache(n),t}var kN=CV;var iRi=x(T(),1),UN=`precision highp float; czm_modelVertexOutput defaultVertexOutput(vec3 positionMC) { czm_modelVertexOutput vsOutput; vsOutput.positionMC = positionMC; @@ -9784,7 +9780,7 @@ edgeVisibilityStageVS(); v_pointCloudShow = show; #endif } -`;var wci=x(T(),1),jX=`precision highp float; +`;var rRi=x(T(),1),DN=`precision highp float; const float PLANAR_DEPTH_PULL = 0.9995; const float BEHIND_DEPTH_PUSH = 1.0002; const float FEATURE_ID_TOLERANCE = 0.5; @@ -9930,25 +9926,29 @@ gl_FragDepth *= BEHIND_DEPTH_PUSH; } #endif } -`;function $xe(){}$xe.buildModelDrawCommand=function(e,t){let n=e.shaderBuilder,i=oat(e,n,t),o=rat(e,i,t),r=e.model;return l(r.classificationType)?new HX({primitiveRenderResources:e,command:o}):new KX({primitiveRenderResources:e,command:o})};function oat(e,t,n){t.addVertexLines(JX),t.addFragmentLines(jX);let i=e.model,o=t.buildShaderProgram(n.context);return i._pipelineResources.push(o),o}function rat(e,t,n){let i=sat(e),o=new Un({context:n.context,indexBuffer:i,attributes:e.attributes}),r=e.model;r._pipelineResources.push(o);let s=e.alphaOptions.pass,a=r.sceneGraph,c=n.mode===se.SCENE3D,d,u;if(!c&&!n.scene3DOnly&&r._projectTo2D)d=P.multiplyTransformation(a._computedModelMatrix,e.runtimeNode.computedTransform,new P),u=e.runtimePrimitive.boundingSphere2D;else{let Z=c?a._computedModelMatrix:a._computedModelMatrix2D;d=P.multiplyTransformation(Z,e.runtimeNode.computedTransform,new P),u=me.transform(e.boundingSphere,d)}let m=$e(ze.fromCache(e.renderStateOptions),!0);m.cull.face=Zt.getCullFace(d,e.primitiveType),m=ze.fromCache(m);let p=l(r.classificationType),b=p?!1:vn.castShadows(r.shadows),f=p?!1:vn.receiveShadows(r.shadows),y=p?void 0:e.pickId,_=p?void 0:e.snapId;return new lt({boundingVolume:u,modelMatrix:d,uniformMap:e.uniformMap,renderState:m,vertexArray:o,shaderProgram:t,cull:r.cull,pass:s,count:e.count,owner:r,pickId:y,snapId:_,pickMetadataAllowed:!0,instanceCount:e.instanceCount,primitiveType:e.primitiveType,debugShowBoundingVolume:r.debugShowBoundingVolume,castShadows:b,receiveShadows:f})}function sat(e){let t=e.wireframeIndexBuffer;if(l(t))return t;let n=e.indices;if(l(n))return n.buffer}var QX=$xe;function dl(e){e=e??B.EMPTY_OBJECT;let t=e.modelComponents;this._model=e.model,this._components=t,this._pipelineStages=[],this._updateStages=[],this._runtimeNodes=[],this._rootNodes=[],this._skinnedNodes=[],this._runtimeSkins=[],this.modelPipelineStages=[],this._boundingSphere=void 0,this._positionMin=void 0,this._positionMax=void 0,this._boundingSphere2D=void 0,this._computedModelMatrix=P.clone(P.IDENTITY),this._computedModelMatrix2D=P.clone(P.IDENTITY),this._axisCorrectionMatrix=Zt.getAxisCorrectionMatrix(t.upAxis,t.forwardAxis,new P),this._runtimeArticulations={},aat(this)}Object.defineProperties(dl.prototype,{components:{get:function(){return this._components}},computedModelMatrix:{get:function(){return this._computedModelMatrix}},axisCorrectionMatrix:{get:function(){return this._axisCorrectionMatrix}},boundingSphere:{get:function(){return this._boundingSphere}}});function aat(e){let t=e._components,n=t.scene,o=e._model.modelMatrix;eTe(e,o);let r=t.articulations,s=r.length,a=e._runtimeArticulations;for(let Z=0;Z<s;Z++){let R=r[Z],C=new cP({articulation:R,sceneGraph:e}),E=C.name;a[E]=C}let c=t.nodes,d=c.length;e._runtimeNodes=new Array(d);let m=n.nodes.length,p=P.IDENTITY;for(let Z=0;Z<m;Z++){let R=n.nodes[Z],C=tTe(e,R,p);e._rootNodes.push(C)}let b=t.skins,f=e._runtimeSkins,y=b.length;for(let Z=0;Z<y;Z++){let R=b[Z];f.push(new XX({skin:R,sceneGraph:e}))}let _=e._skinnedNodes,S=_.length;for(let Z=0;Z<S;Z++){let R=_[Z],C=e._runtimeNodes[R],A=c[R].skin.index;C._runtimeSkin=f[A],C.updateJointMatrices()}e.applyArticulations()}function eTe(e,t){let n=e._components,i=e._model;e._computedModelMatrix=P.multiplyTransformation(t,n.transform,e._computedModelMatrix),e._computedModelMatrix=P.multiplyTransformation(e._computedModelMatrix,e._axisCorrectionMatrix,e._computedModelMatrix),e._computedModelMatrix=P.multiplyByUniformScale(e._computedModelMatrix,i.computedScale,e._computedModelMatrix)}var cat=new h;function lat(e,t){let n=e._computedModelMatrix,i=P.getTranslation(n,cat);if(!h.equals(i,h.ZERO))e._computedModelMatrix2D=_t.basisTo2D(t.mapProjection,n,e._computedModelMatrix2D);else{let o=e.boundingSphere.center,r=_t.ellipsoidTo2DModelMatrix(t.mapProjection,o,e._computedModelMatrix2D);e._computedModelMatrix2D=P.multiply(r,n,e._computedModelMatrix2D)}e._boundingSphere2D=me.transform(e._boundingSphere,e._computedModelMatrix2D,e._boundingSphere2D)}function tTe(e,t,n){let i=[],o=Zt.getNodeTransform(t),r=t.children.length;for(let u=0;u<r;u++){let m=t.children[u],p=P.multiplyTransformation(n,o,new P),b=tTe(e,m,p);i.push(b)}let s=new VP({node:t,transform:o,transformToRoot:n,children:i,sceneGraph:e}),a=t.primitives.length;for(let u=0;u<a;u++)s.runtimePrimitives.push(new PX({primitive:t.primitives[u],node:t,model:e._model}));let c=t.index;e._runtimeNodes[c]=s,l(t.skin)&&e._skinnedNodes.push(c);let d=t.name;if(l(d)){let u=e._model,m=new yP(u,s);u._nodesByName[d]=m}return c}var dat=new h,uat=new h,mat=new h,hat=new h;dl.prototype.buildDrawCommands=function(e){let t=this.buildRenderResources(e);this.computeBoundingVolumes(t),this.createDrawCommands(t,e)};dl.prototype.buildRenderResources=function(e){let t=this._model,n=new NX(t);t.statistics.clear(),this.configurePipeline(e);let i=this.modelPipelineStages;for(let o=0;o<i.length;o++)i[o].process(n,t,e);for(let o=0;o<this._runtimeNodes.length;o++){let r=this._runtimeNodes[o];if(!l(r))continue;r.configurePipeline();let s=r.pipelineStages,a=new DX(n,r);n.nodeRenderResources[o]=a;for(let c=0;c<s.length;c++)s[c].process(a,r.node,e);for(let c=0;c<r.runtimePrimitives.length;c++){let d=r.runtimePrimitives[c];d.configurePipeline(e);let u=d.pipelineStages,m=new BX(a,d);a.primitiveRenderResources[c]=m;for(let p=0;p<u.length;p++)u[p].process(m,d.primitive,e)}}return n};dl.prototype.computeBoundingVolumes=function(e){let t=this._model,n=h.fromElements(Number.MAX_VALUE,Number.MAX_VALUE,Number.MAX_VALUE,dat),i=h.fromElements(-Number.MAX_VALUE,-Number.MAX_VALUE,-Number.MAX_VALUE,uat);for(let o=0;o<this._runtimeNodes.length;o++){let r=this._runtimeNodes[o];if(!l(r))continue;let s=e.nodeRenderResources[o],a=r.computedTransform;for(let c=0;c<r.runtimePrimitives.length;c++){let d=r.runtimePrimitives[c],u=s.primitiveRenderResources[c];d.boundingSphere=me.clone(u.boundingSphere,new me);let m=P.multiplyByPoint(a,u.positionMin,mat),p=P.multiplyByPoint(a,u.positionMax,hat);h.minimumByComponent(n,m,n),h.minimumByComponent(n,p,n),h.maximumByComponent(i,p,i),h.maximumByComponent(i,m,i)}}this._positionMin=h.clone(n,this._positionMin),this._positionMax=h.clone(i,this._positionMax),this._boundingSphere=me.fromCornerPoints(n,i,new me),this._boundingSphere=me.transformWithoutScale(this._boundingSphere,this._axisCorrectionMatrix,this._boundingSphere),this._boundingSphere=me.transform(this._boundingSphere,this._components.transform,this._boundingSphere),t._boundingSphere=me.transform(this._boundingSphere,t.modelMatrix,t._boundingSphere),t._initialRadius=t._boundingSphere.radius,t._boundingSphere.radius*=t._clampedScale};dl.prototype.createDrawCommands=function(e,t){for(let n=0;n<this._runtimeNodes.length;n++){let i=this._runtimeNodes[n];if(!l(i))continue;let o=e.nodeRenderResources[n];for(let r=0;r<i.runtimePrimitives.length;r++){let s=i.runtimePrimitives[r],a=o.primitiveRenderResources[r],c=QX.buildModelDrawCommand(a,t);s.drawCommand=c}}};dl.prototype.configurePipeline=function(e){let t=this.modelPipelineStages;t.length=0;let n=this._model,i=e.fog.enabled&&e.fog.renderable;if(l(n.color)&&t.push(xx),l(n.classificationType))return;n.imageBasedLighting.enabled&&t.push(sP),n.isClippingEnabled()&&t.push(uP);let o=(n._clippingPolygonData?.polygonRings.length??0)>0;n.isClippingPolygonsEnabled()&&o&&t.push(fP),n.hasDrapedVectors()&&t.push(gP),n.hasSilhouette(e)&&t.push(wX),l(n.splitDirection)&&n.splitDirection!==kr.NONE&&t.push(UX),Or.is3DTiles(n.type)&&t.push(tP),i&&t.push(oP)};dl.prototype.update=function(e,t){let n,i,o;for(n=0;n<this._runtimeNodes.length;n++){let r=this._runtimeNodes[n];if(!l(r))continue;for(i=0;i<r.updateStages.length;i++)r.updateStages[i].update(r,this,e);let s=e.mode!==se.SCENE3D&&this._model._projectTo2D;for(t&&!s&&this.updateJointMatrices(),i=0;i<r.runtimePrimitives.length;i++){let a=r.runtimePrimitives[i];for(o=0;o<a.updateStages.length;o++)a.updateStages[o].update(a,this)}}};dl.prototype.updateModelMatrix=function(e,t){eTe(this,e),t.mode!==se.SCENE3D&&lat(this,t);let n=this._rootNodes;for(let i=0;i<n.length;i++){let o=this._runtimeNodes[n[i]];o._transformDirty=!0}};dl.prototype.updateJointMatrices=function(){let e=this._skinnedNodes,t=e.length;for(let n=0;n<t;n++){let i=e[n];this._runtimeNodes[i].updateJointMatrices()}};function nTe(e,t,n,i,o){if(n&&!t.show)return;let r=t.children.length;for(let c=0;c<r;c++){let d=t.getChild(c);nTe(e,d,n,i,o)}let s=t.runtimePrimitives,a=s.length;for(let c=0;c<a;c++){let d=s[c];i(d,o)}}function _B(e,t,n,i){let o=e._rootNodes,r=o.length;for(let s=0;s<r;s++){let a=o[s],c=e._runtimeNodes[a];nTe(e,c,t,n,i)}}var fat={backFaceCulling:void 0};dl.prototype.updateBackFaceCulling=function(e){let t=fat;t.backFaceCulling=e,_B(this,!1,pat,t)};function pat(e,t){let n=e.drawCommand;n.backFaceCulling=t.backFaceCulling}var bat={shadowMode:void 0};dl.prototype.updateShadows=function(e){let t=bat;t.shadowMode=e,_B(this,!1,gat,t)};function gat(e,t){let n=e.drawCommand;n.shadows=t.shadowMode}var yat={debugShowBoundingVolume:void 0};dl.prototype.updateShowBoundingVolume=function(e){let t=yat;t.debugShowBoundingVolume=e,_B(this,!1,xat,t)};function xat(e,t){let n=e.drawCommand;n.debugShowBoundingVolume=t.debugShowBoundingVolume}var iTe=[],oTe=[],rTe=[],Tat={frameState:void 0,hasSilhouette:void 0};dl.prototype.pushDrawCommands=function(e){let t=iTe;t.length=0;let n=oTe;n.length=0;let i=rTe;i.length=0;let o=Tat;o.hasSilhouette=this._model.hasSilhouette(e),o.frameState=e,_B(this,!0,_at,o),ei(e.commandList,t),ei(e.commandList,n),ei(e.commandList,i)};function _at(e,t){let n=t.frameState,i=t.hasSilhouette,o=n.passes,r=iTe,s=oTe,a=rTe,c=e.drawCommand;c.pushCommands(n,n.commandList);let d=e.primitive.material;l(d)&&l(d.planarFill)&&(n.planarFillRequested=!0),i&&!o.pick&&c.pushSilhouetteCommands(n,r),l(c.pushEdgeCommands)&&c.pushEdgeCommands(n,s),l(c.pushPlanarFillIdCommands)&&c.pushPlanarFillIdCommands(n,a)}dl.prototype.setArticulationStage=function(e,t){let n=e.split(" ");if(n.length!==2)return;let i=n[0],o=n[1],r=this._runtimeArticulations[i];l(r)&&r.setArticulationStage(o,t)};dl.prototype.applyArticulations=function(){let e=this._runtimeArticulations;for(let t in e)e.hasOwnProperty(t)&&e[t].apply()};var qX=dl;var Xli=x(T(),1);function Rx(){this.pointsLength=0,this.trianglesLength=0,this.geometryByteLength=0,this.texturesByteLength=0,this.propertyTablesByteLength=0,this._bufferIdSet={},this._textureIdByteLengths={},this._batchTextureIdMap=new kt}Object.defineProperties(Rx.prototype,{batchTexturesByteLength:{get:function(){let e=this._batchTextureIdMap.length,t=this._batchTextureIdMap.values,n=0;for(let i=0;i<e;i++)n+=t[i].byteLength;return n}}});Rx.prototype.clear=function(){this.pointsLength=0,this.trianglesLength=0,this.geometryByteLength=0,this.texturesByteLength=0,this.propertyTablesByteLength=0,this._bufferIdSet={},this._textureIdByteLengths={},this._batchTextureIdMap.removeAll()};Rx.prototype.addBuffer=function(e,t){if(!this._bufferIdSet.hasOwnProperty(e._id)){let n=t?2:1;this.geometryByteLength+=e.sizeInBytes*n}this._bufferIdSet[e._id]=!0};Rx.prototype.addTexture=function(e){this._textureIdByteLengths.hasOwnProperty(e._id)||(this.texturesByteLength+=e.sizeInBytes,this._textureIdByteLengths[e._id]=e.sizeInBytes)};Rx.prototype.getTextureIds=function(){return Object.keys(this._textureIdByteLengths)};Rx.prototype.getTextureByteLengthById=function(e){return this._textureIdByteLengths[e]};Rx.prototype.addBatchTexture=function(e){this._batchTextureIdMap.contains(e._id)||this._batchTextureIdMap.set(e._id,e)};var $X=Rx;var xdi=x(T(),1);var lTe=x(eD(),1);var Jli=x(T(),1);var sTe={},SS=Uint32Array.BYTES_PER_ELEMENT;sTe.parse=function(e,t){t=t??0;let n=new Uint8Array(e),i=new DataView(e);t+=SS;let o=i.getUint32(t,!0);if(o!==1)throw new ae(`Only Point Cloud tile version 1 is supported. Version ${o} is not.`);t+=SS,t+=SS;let r=i.getUint32(t,!0);if(r===0)throw new ae("Feature table must have a byte length greater than zero");t+=SS;let s=i.getUint32(t,!0);t+=SS;let a=i.getUint32(t,!0);t+=SS;let c=i.getUint32(t,!0);t+=SS;let d=vr(n,t,r);t+=r;let u=new Uint8Array(e,t,s);t+=s;let m,p;a>0&&(m=vr(n,t,a),Object.keys(m).length===0&&(m=void 0),t+=a,c>0&&(p=new Uint8Array(e,t,c),p=new Uint8Array(p)));let b=new lf(d,u),f=b.getGlobalProperty("POINTS_LENGTH");if(b.featuresLength=f,!l(f))throw new ae("Feature table global property: POINTS_LENGTH must be defined");let y=b.getGlobalProperty("RTC_CENTER",J.FLOAT,3);l(y)&&(y=h.unpack(y));let _=Zat(b,m);if(_.rtcCenter=y,_.pointsLength=f,!_.hasPositions){let S=Rat(b);_.positions=S,_.hasPositions=_.hasPositions||l(S)}if(!_.hasPositions)throw new ae("Either POSITION or POSITION_QUANTIZED must be defined.");if(!_.hasNormals){let S=Vat(b);_.normals=S,_.hasNormals=_.hasNormals||l(S)}if(!_.hasColors){let S=Cat(b);_.colors=S,_.hasColors=_.hasColors||l(S),_.hasConstantColor=l(_.constantColor),_.isTranslucent=l(S)&&S.isTranslucent}if(!_.hasBatchIds){let S=Eat(b);_.batchIds=S,_.hasBatchIds=_.hasBatchIds||l(S)}if(_.hasBatchIds){let S=b.getGlobalProperty("BATCH_LENGTH");if(!l(S))throw new ae("Global property: BATCH_LENGTH must be defined when BATCH_ID is defined.");_.batchLength=S}return(l(m)||l(p))&&(_.batchTableJson=m,_.batchTableBinary=p),Sat(_),_};function Sat(e){let t=e.batchTableJson;if(!l(t))return;let n=e.batchTableBinary;if(l(n))return;let i=Object.keys(e.draco?.batchTableProperties??{}),o=[];for(let r of Object.keys(t)){let a=t[r].byteOffset;l(a)&&(i.includes(r)||o.push(r))}for(let r of o)xt("PntsParser-invalidBinaryBodyReference",`The point cloud data contained a binary property ${r} that could not be resolved - skipping`),delete t[r]}function Zat(e,t){let n=e.json,i,o,r,s=l(n.extensions)?n.extensions["3DTILES_draco_point_compression"]:void 0,a=l(t)&&l(t.extensions)?t.extensions["3DTILES_draco_point_compression"]:void 0;l(a)&&(r=a.properties);let c,d,u,m,p;if(l(s)){o=s.properties;let f=s.byteOffset,y=s.byteLength;if(!l(o)||!l(f)||!l(y))throw new ae("Draco properties, byteOffset, and byteLength must be defined");i=e.buffer.slice(f,f+y),c=l(o.POSITION),d=l(o.RGB)||l(o.RGBA),u=l(o.NORMAL),m=l(o.BATCH_ID),p=l(o.RGBA)}let b;return l(i)&&(b={buffer:i,featureTableProperties:o,batchTableProperties:r,properties:It(o,r),dequantizeInShader:!0}),{draco:b,hasPositions:c,hasColors:d,isTranslucent:p,hasNormals:u,hasBatchIds:m}}function Rat(e){let t=e.json,n;if(l(t.POSITION))return n=e.getPropertyArray("POSITION",J.FLOAT,3),{name:dt.POSITION,semantic:dt.POSITION,typedArray:n,isQuantized:!1,componentDatatype:J.FLOAT,type:Dt.VEC3};if(l(t.POSITION_QUANTIZED)){n=e.getPropertyArray("POSITION_QUANTIZED",J.UNSIGNED_SHORT,3);let i=e.getGlobalProperty("QUANTIZED_VOLUME_SCALE",J.FLOAT,3);if(!l(i))throw new ae("Global property: QUANTIZED_VOLUME_SCALE must be defined for quantized positions.");let o=65535,r=e.getGlobalProperty("QUANTIZED_VOLUME_OFFSET",J.FLOAT,3);if(!l(r))throw new ae("Global property: QUANTIZED_VOLUME_OFFSET must be defined for quantized positions.");return{name:dt.POSITION,semantic:dt.POSITION,typedArray:n,isQuantized:!0,componentDatatype:J.FLOAT,type:Dt.VEC3,quantizedRange:o,quantizedVolumeOffset:h.unpack(r),quantizedVolumeScale:h.unpack(i),quantizedComponentDatatype:J.UNSIGNED_SHORT,quantizedType:Dt.VEC3}}}function Cat(e){let t=e.json,n;if(l(t.RGBA))return n=e.getPropertyArray("RGBA",J.UNSIGNED_BYTE,4),{name:dt.COLOR,semantic:dt.COLOR,setIndex:0,typedArray:n,componentDatatype:J.UNSIGNED_BYTE,type:Dt.VEC4,normalized:!0,isRGB565:!1,isTranslucent:!0};if(l(t.RGB))return n=e.getPropertyArray("RGB",J.UNSIGNED_BYTE,3),{name:"COLOR",semantic:dt.COLOR,setIndex:0,typedArray:n,componentDatatype:J.UNSIGNED_BYTE,type:Dt.VEC3,normalized:!0,isRGB565:!1,isTranslucent:!1};if(l(t.RGB565))return n=e.getPropertyArray("RGB565",J.UNSIGNED_SHORT,1),{name:"COLOR",semantic:dt.COLOR,setIndex:0,typedArray:n,componentDatatype:J.FLOAT,type:Dt.VEC3,normalized:!1,isRGB565:!0,isTranslucent:!1};if(l(t.CONSTANT_RGBA)){let i=e.getGlobalProperty("CONSTANT_RGBA",J.UNSIGNED_BYTE,4),o=i[3],r=U.fromBytes(i[0],i[1],i[2],o),s=o<255;return{name:dt.COLOR,semantic:dt.COLOR,setIndex:0,constantColor:r,componentDatatype:J.FLOAT,type:Dt.VEC4,isQuantized:!1,isTranslucent:s}}}function Vat(e){let t=e.json,n;if(l(t.NORMAL))return n=e.getPropertyArray("NORMAL",J.FLOAT,3),{name:dt.NORMAL,semantic:dt.NORMAL,typedArray:n,octEncoded:!1,octEncodedZXY:!1,componentDatatype:J.FLOAT,type:Dt.VEC3};if(l(t.NORMAL_OCT16P))return n=e.getPropertyArray("NORMAL_OCT16P",J.UNSIGNED_BYTE,2),{name:dt.NORMAL,semantic:dt.NORMAL,typedArray:n,octEncoded:!0,octEncodedZXY:!1,quantizedRange:(1<<8)-1,quantizedType:Dt.VEC2,quantizedComponentDatatype:J.UNSIGNED_BYTE,componentDatatype:J.FLOAT,type:Dt.VEC3}}function Eat(e){let t=e.json;if(l(t.BATCH_ID)){let n=e.getPropertyArray("BATCH_ID",J.UNSIGNED_SHORT,1);return{name:dt.FEATURE_ID,semantic:dt.FEATURE_ID,setIndex:0,typedArray:n,componentDatatype:J.fromTypedArray(n),type:Dt.SCALAR}}}var ZS=sTe;var Aat=Vn.Components,Gat=Vn.Scene,Lat=Vn.Node,Wat=Vn.Primitive,vat=Vn.Attribute,aTe=Vn.Quantization,Fat=Vn.FeatureIdAttribute,Iat=Vn.Material,Pat=Vn.MetallicRoughness,dq=class extends io{constructor(t){super(),t=t??B.EMPTY_OBJECT;let n=t.arrayBuffer,i=t.byteOffset??0;this._arrayBuffer=n,this._byteOffset=i,this._loadAttributesFor2D=t.loadAttributesFor2D??!1,this._parsedContent=void 0,this._decodePromise=void 0,this._decodedAttributes=void 0,this._promise=void 0,this._error=void 0,this._state=Rt.UNLOADED,this._buffers=[],this._components=void 0,this._transform=P.IDENTITY}get cacheKey(){}get components(){return this._components}get transform(){return this._transform}load(){if(l(this._promise))return this._promise;this._parsedContent=ZS.parse(this._arrayBuffer,this._byteOffset),this._state=Rt.PROCESSING,this._promise=Promise.resolve(this)}process(t){if(l(this._error)){let n=this._error;throw this._error=void 0,n}if(this._state===Rt.READY)return!0;if(this._state===Rt.PROCESSING){if(l(this._decodePromise))return!1;this._decodePromise=Xat(this,t.context)}return!1}unload(){let t=this._buffers;for(let n=0;n<t.length;n++)t[n].destroy();t.length=0,this._components=void 0,this._parsedContent=void 0,this._arrayBuffer=void 0}};function Xat(e,t){let i=e._parsedContent.draco,o;if(l(i)?o=vb.decodePointCloud(i,t):o=Promise.resolve(),!!l(o))return e._decodePromise=o,o.then(function(r){if(!e.isDestroyed())return l(r)&&Nat(e,i,r),Kat(e,t),e._state=Rt.READY,e}).catch(function(r){e.unload(),e._state=Rt.FAILED;let s="Failed to load Draco pnts";e._error=e.getError(s,r)})}function Nat(e,t,n){e._state=Rt.READY;let i=e._parsedContent,o;if(l(n.POSITION)){if(o={name:"POSITION",semantic:dt.POSITION,typedArray:n.POSITION.array,componentDatatype:J.FLOAT,type:Dt.VEC3,isQuantized:!1},l(n.POSITION.data.quantization)){let a=n.POSITION.data.quantization,c=a.range,d=h.fromElements(c,c,c),u=h.unpack(a.minValues),m=(1<<a.quantizationBits)-1;o.isQuantized=!0,o.quantizedRange=m,o.quantizedVolumeOffset=u,o.quantizedVolumeScale=d,o.quantizedComponentDatatype=m<=255?J.UNSIGNED_BYTE:J.UNSIGNED_SHORT,o.quantizedType=Dt.VEC3}i.positions=o}if(l(n.NORMAL)){if(o={name:"NORMAL",semantic:dt.NORMAL,typedArray:n.NORMAL.array,componentDatatype:J.FLOAT,type:Dt.VEC3,isQuantized:!1,octEncoded:!1,octEncodedZXY:!1},l(n.NORMAL.data.quantization)){let a=(1<<n.NORMAL.data.quantization.quantizationBits)-1;o.quantizedRange=a,o.octEncoded=!0,o.octEncodedZXY=!0,o.quantizedComponentDatatype=J.UNSIGNED_BYTE,o.quantizedType=Dt.VEC2}i.normals=o}if(l(n.RGBA)?i.colors={name:"COLOR",semantic:dt.COLOR,setIndex:0,typedArray:n.RGBA.array,componentDatatype:J.UNSIGNED_BYTE,type:Dt.VEC4,normalized:!0,isTranslucent:!0}:l(n.RGB)&&(i.colors={name:"COLOR",semantic:dt.COLOR,setIndex:0,typedArray:n.RGB.array,componentDatatype:J.UNSIGNED_BYTE,type:Dt.VEC3,normalized:!0,isTranslucent:!1}),l(n.BATCH_ID)){let a=n.BATCH_ID.array;i.batchIds={name:"_FEATURE_ID",semantic:dt.FEATURE_ID,setIndex:0,typedArray:a,componentDatatype:J.fromTypedArray(a),type:Dt.SCALAR}}let r=i.batchTableJson,s=t.batchTableProperties;for(let a in s)if(s.hasOwnProperty(a)){let c=n[a];l(r)||(r={}),i.hasDracoBatchTable=!0;let d=c.data;r[a]={byteOffset:d.byteOffset,type:Yat(d.componentsPerAttribute),componentType:Mat(d.componentDatatype),typedArray:c.array}}i.batchTableJson=r}function Yat(e){switch(e){case 1:return"SCALAR";case 2:return"VEC2";case 3:return"VEC3";case 4:return"VEC4"}}function Mat(e){switch(e){case ie.BYTE:return"BYTE";case ie.UNSIGNED_BYTE:return"UNSIGNED_BYTE";case ie.SHORT:return"SHORT";case ie.UNSIGNED_SHORT:return"UNSIGNED_SHORT";case ie.INT:return"INT";case ie.UNSIGNED_INT:return"UNSIGNED_INT";case ie.DOUBLE:return"DOUBLE";case ie.FLOAT:return"FLOAT"}}function eN(e,t,n){let i=t.typedArray,o;if(t.octEncoded&&(o=new aTe,o.octEncoded=t.octEncoded,o.octEncodedZXY=t.octEncodedZXY,o.normalizationRange=t.quantizedRange,o.type=t.quantizedType,o.componentDatatype=t.quantizedComponentDatatype),t.isQuantized){o=new aTe;let a=t.quantizedRange;o.normalizationRange=a,o.quantizedVolumeOffset=h.ZERO;let c=t.quantizedVolumeScale;o.quantizedVolumeDimensions=c,o.quantizedVolumeStepSize=h.divideByScalar(c,a,new h),o.componentDatatype=t.quantizedComponentDatatype,o.type=t.quantizedType}let r=new vat;if(r.name=t.name,r.semantic=t.semantic,r.setIndex=t.setIndex,r.componentDatatype=t.componentDatatype,r.type=t.type,r.normalized=t.normalized??!1,r.min=t.min,r.max=t.max,r.quantization=o,t.isRGB565&&(i=dn.decodeRGB565(i)),l(t.constantColor)){let a=new Array(4);r.constant=U.pack(t.constantColor,a)}else{let a=it.createVertexBuffer({typedArray:i,context:n,usage:Pe.STATIC_DRAW});a.vertexArrayDestroyable=!1,e._buffers.push(a),r.buffer=a}let s=e._loadAttributesFor2D;return r.semantic===dt.POSITION&&s&&(r.typedArray=i),r}var cTe,SB;function wat(e){if(!l(SB)){cTe=new lTe.default(0),SB=new Array(e);for(let t=0;t<e;++t)SB[t]=cTe.random()}return SB}var kat=new h,Uat=new h,Dat=new h;function Oat(e){let t=e.typedArray,n=20,i=t.length/3,o=Math.min(i,n),r=wat(n),s=Number.MAX_VALUE,a=-Number.MAX_VALUE,c=h.fromElements(s,s,s,kat),d=h.fromElements(a,a,a,Uat),u,m,p;if(e.isQuantized)c=h.ZERO,d=e.quantizedVolumeScale;else for(u=0;u<o;++u)m=Math.floor(r[u]*i),p=h.unpack(t,m*3,Dat),h.minimumByComponent(c,p,c),h.maximumByComponent(d,p,d);e.min=h.clone(c),e.max=h.clone(d)}var Bat={name:dt.COLOR,semantic:dt.COLOR,setIndex:0,constantColor:U.DARKGRAY,componentDatatype:J.FLOAT,type:Dt.VEC4,isQuantized:!1,isTranslucent:!1};function zat(e,t,n){let i=[],o,r=t.positions;return l(r)&&(Oat(r),o=eN(e,r,n),o.count=t.pointsLength,i.push(o)),l(t.normals)&&(o=eN(e,t.normals,n),o.count=t.pointsLength,i.push(o)),l(t.colors)?(o=eN(e,t.colors,n),o.count=t.pointsLength,i.push(o)):(o=eN(e,Bat,n),o.count=t.pointsLength,i.push(o)),l(t.batchIds)&&(o=eN(e,t.batchIds,n),o.count=t.pointsLength,i.push(o)),i}function Hat(e,t){let n=e.batchLength,i=e.pointsLength,o=e.batchTableJson,r=e.batchTableBinary,s=!l(e.batchIds);return l(r)||l(o)||e.hasDracoBatchTable?Ob({count:n??i,batchTable:o,binaryBody:r,parseAsPropertyAttributes:s,customAttributeOutput:t}):new wa({schema:{},propertyTables:[]})}function Kat(e,t){let n=e._parsedContent,i=new Pat;i.metallicFactor=0,i.roughnessFactor=.9;let o=new Iat;o.metallicRoughness=i;let r=n.colors;l(r)&&r.isTranslucent&&(o.alphaMode=Mp.BLEND);let s=!l(n.normals);o.unlit=s;let a=new Wat;if(a.attributes=zat(e,n,t),a.primitiveType=Ie.POINTS,a.material=o,l(n.batchIds)){let b=new Fat;b.propertyTableId=0,b.setIndex=0,b.positionalLabel="featureId_0",a.featureIds.push(b)}let c=new Lat;c.index=0,c.primitives=[a];let d=new Gat;d.nodes=[c],d.upAxis=Bi.Z,d.forwardAxis=Bi.X;let u=new Aat;u.scene=d,u.nodes=[c];let m=[];u.structuralMetadata=Hat(n,m),m.length>0&&Jat(e,a,m,t),l(n.rtcCenter)&&(u.transform=P.multiplyByTranslation(u.transform,n.rtcCenter,u.transform));let p=n.positions;l(p)&&p.isQuantized&&(u.transform=P.multiplyByTranslation(u.transform,p.quantizedVolumeOffset,u.transform)),e._components=u,e._parsedContent=void 0,e._arrayBuffer=void 0}function Jat(e,t,n,i){let o=t.attributes,r=n.length;for(let s=0;s<r;s++){let a=n[s],c=it.createVertexBuffer({typedArray:a.typedArray,context:i,usage:Pe.STATIC_DRAW});c.vertexArrayDestroyable=!1,e._buffers.push(c),a.buffer=c,a.typedArray=void 0,o.push(a)}t.propertyAttributeIds=[0]}var tN=dq;var Xdi=x(T(),1);var ZB=new h,dTe=new h,uTe=new h,nN=new h,jat=new h,Qat=new h,qat=new pe,$at=new me;function RB(e,t,n,i){let o=t*n;return i.x=e[o],i.y=e[o+1],i.z=e[o+2],i}var ect=32,uq=new Map,mq=[];function tct(e,t,n,i,o,r){let s=e.origin.x,a=e.origin.y,c=e.origin.z,d=e.direction.x,u=e.direction.y,m=e.direction.z,p=W.EPSILON6;for(let b=0;b<i;b+=3){let f=n[b]*3,y=n[b+1]*3,_=n[b+2]*3,S=t[f],Z=t[f+1],R=t[f+2],C=t[y]-S,E=t[y+1]-Z,A=t[y+2]-R,L=t[_]-S,F=t[_+1]-Z,I=t[_+2]-R,N=u*I-m*F,g=m*L-d*I,V=d*F-u*L,G=C*N+E*g+A*V,v=s-S,X=a-Z,Y=c-R,D;if(o){if(G<p)continue;let M=v*N+X*g+Y*V;if(M<0||M>G)continue;let O=X*A-Y*E,w=Y*C-v*A,z=v*E-X*C,K=d*O+u*w+m*z;if(K<0||M+K>G)continue;D=(L*O+F*w+I*z)/G}else{if(Math.abs(G)<p)continue;let M=1/G,O=(v*N+X*g+Y*V)*M;if(O<0||O>1)continue;let w=X*A-Y*E,z=Y*C-v*A,K=v*E-X*C,te=(d*w+u*z+m*K)*M;if(te<0||O+te>1)continue;D=(L*w+F*z+I*K)*M}D>=0&&D<r&&(r=D)}return r}function qC(e,t,n,i,o,r,s){if(!e._ready||n.mode===se.MORPHING)return;let a=Number.MAX_VALUE;r=r??ne.default,i=i??1,o=o??0;let c=n.mode!==se.SCENE3D?n.mapProjection:void 0;if(xa.forEachPrimitive(e,{mapProjection:c},function(d,u,m,p){if(l(d.boundingSphere)&&m.length===1){let R=me.transform(d.boundingSphere,p,$at),C=xi.raySphere(t,R);if(!l(C))return}if(!l(u.indices))return;let b,f,y=Zt.getAttributeBySemantic(u,dt.POSITION),_=uq.get(u);l(_)||(_={},l(y)&&(_.vertices=xa.readAttributeAsTypedArray(y)),l(u.indices)&&(_.indices=xa.readIndicesAsTypedArray(u.indices)),uq.set(u,_),mq.push(u),mq.length>ect&&uq.delete(mq.shift())),l(y)&&(f=Dt.getNumberOfComponents(y.type),b=_.vertices);let S=_.indices;if(!l(S)||!l(b))return;let Z=S.length;if(m.length===1&&i===1){let R=m[0].transform;if(!l(_.world)||!P.equals(_.worldTransform,R)){let L=b.length/f,F=new Float64Array(L*3);for(let I=0;I<L;I++)RB(b,I,f,ZB),P.multiplyByPoint(R,ZB,nN),F[I*3]=nN.x,F[I*3+1]=nN.y,F[I*3+2]=nN.z;_.world=F,_.worldTransform=P.clone(R,_.worldTransform)}let C=_.world,E=e.backFaceCulling??!0,A=tct(t,C,S,Z,E,a);A<a&&(a=A);return}for(let R=0;R<Z;R+=3){let C=S[R],E=S[R+1],A=S[R+2];RB(b,C,f,ZB),RB(b,E,f,dTe),RB(b,A,f,uTe);for(let L of m){let F=P.multiplyByPoint(L.transform,ZB,nN),I=P.multiplyByPoint(L.transform,dTe,jat),N=P.multiplyByPoint(L.transform,uTe,Qat);i!==1&&(_o.getPosition(F,r,i,o,F),_o.getPosition(I,r,i,o,I),_o.getPosition(N,r,i,o,N));let g=xi.rayTriangleParametric(t,F,I,N,e.backFaceCulling??!0);l(g)&&g<a&&g>=0&&(a=g)}}}),a!==Number.MAX_VALUE){if(s=gn.getPoint(t,a,s),n.mode!==se.SCENE3D){h.fromElements(s.y,s.z,s.x,s);let d=n.mapProjection,u=d.ellipsoid,m=d.unproject(s,qat);u.cartographicToCartesian(m,s)}return s}}var Bdi=x(T(),1);var Ydi=x(T(),1),hq=class{constructor(t){this.show=t.show,this.alpha=t.alpha,this.brightness=t.brightness,this.contrast=t.contrast,this.hue=t.hue,this.saturation=t.saturation,this.gamma=t.gamma,this.colorToAlpha=t.colorToAlpha}},iN=hq;var fq=class{constructor(t){this._model=t,this._modelPrimitiveImageries=void 0,this._imageryConfigurations=[]}update(t){if(!this._hasImagery){this._deleteModelPrimitiveImageries();return}this._allImageryLayersReady&&(l(this._modelPrimitiveImageries)||(this._modelPrimitiveImageries=this._createModelPrimitiveImageries()),this._updateModelPrimitiveImageries(t),this._checkForModifiedImageryConfigurations())}_createModelPrimitiveImageries(){let t=this._model,n=this._collectRuntimeNodesAndPrimitives(),i=[],o=n.length;for(let r=0;r<o;r++){let s=n[r],a=s.runtimeNode,c=s.runtimePrimitive,d=new xS(t,a,c);c.primitive.modelPrimitiveImagery=d,i.push(d)}return i}_collectRuntimeNodesAndPrimitives(){let i=this._model.sceneGraph._runtimeNodes,o=[];for(let r=0;r<i.length;r++){let s=i[r];if(l(s))for(let a=0;a<s.runtimePrimitives.length;a++){let c=s.runtimePrimitives[a];o.push({runtimeNode:s,runtimePrimitive:c})}}return o}_updateModelPrimitiveImageries(t){if(!l(this._modelPrimitiveImageries))throw new ge("The modelPrimitiveImageries have not been created");let n=this._modelPrimitiveImageries,i=n.length;for(let o=0;o<i;o++)n[o].update(t)}_deleteModelPrimitiveImageries(){let t=this._modelPrimitiveImageries;if(!l(t))return;let n=t.length;for(let i=0;i<n;i++)t[i].destroy();delete this._modelPrimitiveImageries,this._model.resetDrawCommands()}get ready(){return this._hasImagery?!(!this._allImageryLayersReady||!this._allModelPrimitiveImageriesReady):!0}get _hasImagery(){let n=this._model.imageryLayers;return l(n)&&n.length>0}get _allImageryLayersReady(){if(!this._hasImagery)return!0;let t=this._model.imageryLayers,n=t.length;for(let i=0;i<n;i++)if(!t.get(i).ready)return!1;return!0}get _allModelPrimitiveImageriesReady(){let t=this._modelPrimitiveImageries;if(!l(t))return!1;let n=t.length;for(let i=0;i<n;i++)if(!t[i].ready)return!1;return!0}_checkForModifiedImageryConfigurations(){this._imageryConfigurationsModified()&&(this._updateImageryConfigurations(),this._model.resetDrawCommands())}_imageryConfigurationsModified(){let n=this._model.imageryLayers,i=this._imageryConfigurations;if(n.length!==i.length)return!0;for(let o=0;o<n.length;o++){let r=n.get(o),s=i[o];if(r.show!==s.show||r.alpha!==s.alpha||r.brightness!==s.brightness||r.contrast!==s.contrast||r.hue!==s.hue||r.saturation!==s.saturation||r.gamma!==s.gamma||r.colorToAlpha!==s.colorToAlpha)return!0}return!1}_updateImageryConfigurations(){let n=this._model.imageryLayers,i=this._imageryConfigurations;i.length=n.length;for(let o=0;o<n.length;o++){let r=n.get(o);i[o]=new iN(r)}}isDestroyed(){return!1}destroy(){if(!this.isDestroyed())return this._deleteModelPrimitiveImageries(),ue(this)}},oN=fq;function Vo(e){e=e??B.EMPTY_OBJECT,this._loader=e.loader,this._resource=e.resource,this.type=e.type??Or.GLTF,this.modelMatrix=P.clone(e.modelMatrix??P.IDENTITY),this._modelMatrix=P.clone(this.modelMatrix),this._scale=e.scale??1,this._minimumPixelSize=e.minimumPixelSize??0,this._maximumScale=e.maximumScale,this._clampedScale=l(this._maximumScale)?Math.min(this._scale,this._maximumScale):this._scale,this._computedScale=this._clampedScale,this._updateModelMatrix=!1,this.referenceMatrix=void 0,this._iblReferenceFrameMatrix=q.clone(q.IDENTITY),this._clippingPlanesMatrix=P.clone(P.IDENTITY),this._resourcesLoaded=!1,this._drawCommandsBuilt=!1,this._ready=!1,this._customShader=e.customShader,this._content=e.content,this._texturesLoaded=!1,this._defaultTexture=void 0,this._activeAnimations=new qI(this),this._clampAnimations=e.clampAnimations??!0,this._userAnimationDirty=!1,this._id=e.id,this._idDirty=!1,this._color=U.clone(e.color),this._colorBlendMode=e.colorBlendMode??al.HIGHLIGHT,this._colorBlendAmount=e.colorBlendAmount??.5;let t=e.silhouetteColor??U.RED;this._silhouetteColor=U.clone(t),this._silhouetteSize=e.silhouetteSize??0,this._silhouetteDirty=!1,this._silhouetteId=void 0,this._cull=e.cull??!0,this._opaquePass=e.opaquePass??Le.OPAQUE,this._allowPicking=e.allowPicking??!0,this._show=e.show??!0,this._style=void 0,this._styleDirty=!1,this._styleCommandsNeeded=void 0;let n=e.featureIdLabel??"featureId_0";typeof n=="number"&&(n=`featureId_${n}`),this._featureIdLabel=n;let i=e.instanceFeatureIdLabel??"instanceFeatureId_0";typeof i=="number"&&(i=`instanceFeatureId_${i}`),this._instanceFeatureIdLabel=i,this._featureTables=[],this._featureTableId=void 0,this._featureTableIdDirty=!0,this._pipelineResources=[],this._modelResources=[],this._pickIds=[],this._boundingSphere=new me,this._initialRadius=void 0,this._heightReference=e.heightReference??He.NONE,this._heightDirty=this._heightReference!==He.NONE,this._removeUpdateHeightCallback=void 0,this._enableVerticalExaggeration=e.enableVerticalExaggeration??!0,this._hasVerticalExaggeration=!1,this._clampedModelMatrix=void 0,this._heightAboveSurface=void 0,this._lastSurfaceHeight=void 0,this._lastSurfaceQueryFrame=-1,this._lastSurfaceQueryMissed=!1;let o=e.scene;l(o)&&l(o.terrainProviderChanged)&&(this._terrainProviderChangedCallback=o.terrainProviderChanged.addEventListener(()=>{this._heightDirty=!0})),this._scene=o,this._distanceDisplayCondition=e.distanceDisplayCondition;let r=new Up(e.pointCloudShading);this._pointCloudShading=r,this._attenuation=r.attenuation,this._pointCloudBackFaceCulling=r.backFaceCulling;let s=e.clippingPlanes;l(s)&&s.owner===void 0?gs.setOwner(s,this,"_clippingPlanes"):this._clippingPlanes=s,this._clippingPlanesState=0;let a=e.clippingPolygons;l(a)&&a.owner===void 0?vc.setOwner(a,this,"_clippingPolygons"):this._clippingPolygons=a,this._clippingPolygonsState=0,this._clippingPolygonsNeedRebake=!1,this._removeClippingPolygonAdded=void 0,this._removeClippingPolygonRemoved=void 0,fTe(this),this._vectorData=void 0,this._vectorLookupFlags=0,this._clippingPolygonData=void 0,this._rectangle=new re,this._modelImagery=new oN(this),this._lightColor=h.clone(e.lightColor),this._imageBasedLighting=l(e.imageBasedLighting)?e.imageBasedLighting:new B_,this._shouldDestroyImageBasedLighting=!l(e.imageBasedLighting),this._environmentMapManager=void 0;let c=new Yb(e.environmentMapOptions);Yb.setOwner(c,this,"_environmentMapManager"),this._backFaceCulling=e.backFaceCulling??!0,this._backFaceCullingDirty=!1,this._shadows=e.shadows??vn.ENABLED,this._shadowsDirty=!1,this._debugShowBoundingVolumeDirty=!1,this._debugShowBoundingVolume=e.debugShowBoundingVolume??!1,this._enableDebugWireframe=e.enableDebugWireframe??!1,this._enableShowOutline=e.enableShowOutline??!0,this._debugWireframe=e.debugWireframe??!1,this._edgeDisplayMode=e.edgeDisplayMode??km.SURFACES_ONLY,this._debugWireframe===!0&&this._enableDebugWireframe===!1&&this.type===Or.GLTF&&xt("model-debug-wireframe-ignored","enableDebugWireframe must be set to true in Model.fromGltf, otherwise debugWireframe will be ignored.");let d=e.credit;typeof d=="string"&&(d=new Lt(d)),this._credits=[],this._credit=d,this._resourceCredits=[],this._gltfCredits=[],this._showCreditsOnScreen=e.showCreditsOnScreen??!1,this._showCreditsOnScreenDirty=!0,this._splitDirection=e.splitDirection??kr.NONE,this._enableShowOutline=e.enableShowOutline??!0,this.showOutline=e.showOutline??!0,this.outlineColor=e.outlineColor??U.BLACK,this._classificationType=e.classificationType,this._statistics=new $X,this._sceneMode=void 0,this._projectTo2D=e.projectTo2D??!1,this._enablePick=e.enablePick??!1,this._fogRenderable=void 0,this._skipLevelOfDetail=!1,this._ignoreCommands=e.ignoreCommands??!1,this._errorEvent=new Se,this._readyEvent=new Se,this._texturesReadyEvent=new Se,this._sceneGraph=void 0,this._nodesByName={},this.pickObject=e.pickObject}function pq(e,t){if(e._errorEvent.numberOfListeners>0){e._errorEvent.raiseEvent(t);return}console.log(t)}function nct(e,t){let n=e._featureTables,i=t.propertyTables,o=i.length;for(let r=0;r<o;r++){let s=i[r],a=new eP({model:e,propertyTable:s});n.push(a)}return n}function ict(e,t){let n=t._featureIdLabel,i=t._instanceFeatureIdLabel,o,r,s,a;for(o=0;o<e.nodes.length;o++)if(a=e.nodes[o],l(a.instances)&&(s=Zt.getFeatureIdsByLabel(a.instances.featureIds,i),l(s)&&l(s.propertyTableId)))return s.propertyTableId;for(o=0;o<e.nodes.length;o++)for(a=e.nodes[o],r=0;r<a.primitives.length;r++){let c=a.primitives[r],d=Zt.getFeatureIdsByLabel(c.featureIds,n);if(l(d))return d.propertyTableId}if(t._featureTables.length===1)return 0}function yq(e,t){if(!l(e)&&!l(t))return!1;if(l(e)!==l(t))return!0;let n=e.alpha,i=t.alpha;return Math.floor(n)!==Math.floor(i)||Math.ceil(n)!==Math.ceil(i)}Object.defineProperties(Vo.prototype,{ready:{get:function(){return this._ready}},errorEvent:{get:function(){return this._errorEvent}},readyEvent:{get:function(){return this._readyEvent}},incrementallyLoadTextures:{get:function(){return this._loader.incrementallyLoadTextures??!1}},texturesReadyEvent:{get:function(){return this._texturesReadyEvent}},loader:{get:function(){return this._loader}},statistics:{get:function(){return this._statistics}},activeAnimations:{get:function(){return this._activeAnimations}},clampAnimations:{get:function(){return this._clampAnimations},set:function(e){this._clampAnimations=e}},cull:{get:function(){return this._cull}},opaquePass:{get:function(){return this._opaquePass}},pointCloudShading:{get:function(){return this._pointCloudShading},set:function(e){e!==this._pointCloudShading&&this.resetDrawCommands(),this._pointCloudShading=e}},customShader:{get:function(){return this._customShader},set:function(e){e!==this._customShader&&this.resetDrawCommands(),this._customShader=e}},sceneGraph:{get:function(){return this._sceneGraph}},content:{get:function(){return this._content}},heightReference:{get:function(){return this._heightReference},set:function(e){e!==this._heightReference&&(this._heightDirty=!0),this._heightReference=e}},distanceDisplayCondition:{get:function(){return this._distanceDisplayCondition},set:function(e){this._distanceDisplayCondition=Bt.clone(e,this._distanceDisplayCondition)}},structuralMetadata:{get:function(){return this._sceneGraph.components.structuralMetadata}},featureTableId:{get:function(){return this._featureTableId},set:function(e){this._featureTableId=e}},featureTables:{get:function(){return this._featureTables},set:function(e){this._featureTables=e}},id:{get:function(){return this._id},set:function(e){e!==this._id&&(this._idDirty=!0),this._id=e}},allowPicking:{get:function(){return this._allowPicking}},style:{get:function(){return this._style},set:function(e){this._style=e,this._styleDirty=!0}},color:{get:function(){return this._color},set:function(e){yq(e,this._color)&&this.resetDrawCommands(),this._color=U.clone(e,this._color)}},colorBlendMode:{get:function(){return this._colorBlendMode},set:function(e){this._colorBlendMode=e}},colorBlendAmount:{get:function(){return this._colorBlendAmount},set:function(e){this._colorBlendAmount=e}},silhouetteColor:{get:function(){return this._silhouetteColor},set:function(e){if(!U.equals(e,this._silhouetteColor)){let t=yq(e,this._silhouetteColor);this._silhouetteDirty=this._silhouetteDirty||t}this._silhouetteColor=U.clone(e,this._silhouetteColor)}},silhouetteSize:{get:function(){return this._silhouetteSize},set:function(e){if(e!==this._silhouetteSize){let t=this._silhouetteSize,n=e>0&&t===0||e===0&&t>0;this._silhouetteDirty=this._silhouetteDirty||n,this._backFaceCullingDirty=this._backFaceCullingDirty||n}this._silhouetteSize=e}},heightAboveSurface:{get:function(){return this._heightAboveSurface}},boundingSphere:{get:function(){let e=l(this._clampedModelMatrix)?this._clampedModelMatrix:this.modelMatrix;return bTe(this,e),this._boundingSphere}},debugShowBoundingVolume:{get:function(){return this._debugShowBoundingVolume},set:function(e){this._debugShowBoundingVolume!==e&&(this._debugShowBoundingVolumeDirty=!0),this._debugShowBoundingVolume=e}},debugWireframe:{get:function(){return this._debugWireframe},set:function(e){this._debugWireframe!==e&&this.resetDrawCommands(),this._debugWireframe=e,this._debugWireframe===!0&&this._enableDebugWireframe===!1&&this.type===Or.GLTF&&xt("model-debug-wireframe-ignored","enableDebugWireframe must be set to true in Model.fromGltfAsync, otherwise debugWireframe will be ignored.")}},edgeDisplayMode:{get:function(){return this._edgeDisplayMode},set:function(e){this._edgeDisplayMode=e}},show:{get:function(){return this._show},set:function(e){this._show=e}},featureIdLabel:{get:function(){return this._featureIdLabel},set:function(e){typeof e=="number"&&(e=`featureId_${e}`),e!==this._featureIdLabel&&(this._featureTableIdDirty=!0),this._featureIdLabel=e}},instanceFeatureIdLabel:{get:function(){return this._instanceFeatureIdLabel},set:function(e){typeof e=="number"&&(e=`instanceFeatureId_${e}`),e!==this._instanceFeatureIdLabel&&(this._featureTableIdDirty=!0),this._instanceFeatureIdLabel=e}},clippingPlanes:{get:function(){return this._clippingPlanes},set:function(e){e!==this._clippingPlanes&&(gs.setOwner(e,this,"_clippingPlanes"),this.resetDrawCommands())}},clippingPolygons:{get:function(){return this._clippingPolygons},set:function(e){e!==this._clippingPolygons&&(vc.setOwner(e,this,"_clippingPolygons"),fTe(this),this.resetDrawCommands(),this._clippingPolygonsState=0,this._clippingPolygonsNeedRebake=!0,l(this._clippingPolygonData)&&(vc.releaseRectangleData(this._clippingPolygonData),this._clippingPolygonData=void 0))}},enableVerticalExaggeration:{get:function(){return this._enableVerticalExaggeration},set:function(e){e!==this._enableVerticalExaggeration&&this.resetDrawCommands(),this._enableVerticalExaggeration=e}},hasVerticalExaggeration:{get:function(){return this._hasVerticalExaggeration}},imageryLayers:{get:function(){if(l(this._content)){let e=this._content.tileset;if(l(e))return e.imageryLayers}}},lightColor:{get:function(){return this._lightColor},set:function(e){l(e)!==l(this._lightColor)&&this.resetDrawCommands(),this._lightColor=h.clone(e,this._lightColor)}},imageBasedLighting:{get:function(){return this._imageBasedLighting},set:function(e){e!==this._imageBasedLighting&&(this._shouldDestroyImageBasedLighting&&!this._imageBasedLighting.isDestroyed()&&this._imageBasedLighting.destroy(),this._imageBasedLighting=e,this._shouldDestroyImageBasedLighting=!1,this.resetDrawCommands())}},environmentMapManager:{get:function(){return this._environmentMapManager},set:function(e){e!==this.environmentMapManager&&(Yb.setOwner(e,this,"_environmentMapManager"),this.resetDrawCommands())}},backFaceCulling:{get:function(){return this._backFaceCulling},set:function(e){e!==this._backFaceCulling&&(this._backFaceCullingDirty=!0),this._backFaceCulling=e}},scale:{get:function(){return this._scale},set:function(e){e!==this._scale&&(this._updateModelMatrix=!0),this._scale=e}},computedScale:{get:function(){return this._computedScale}},minimumPixelSize:{get:function(){return this._minimumPixelSize},set:function(e){e!==this._minimumPixelSize&&(this._updateModelMatrix=!0),this._minimumPixelSize=e}},maximumScale:{get:function(){return this._maximumScale},set:function(e){e!==this._maximumScale&&(this._updateModelMatrix=!0),this._maximumScale=e}},shadows:{get:function(){return this._shadows},set:function(e){e!==this._shadows&&(this._shadowsDirty=!0),this._shadows=e}},credit:{get:function(){return this._credit}},showCreditsOnScreen:{get:function(){return this._showCreditsOnScreen},set:function(e){this._showCreditsOnScreen!==e&&(this._showCreditsOnScreenDirty=!0),this._showCreditsOnScreen=e}},splitDirection:{get:function(){return this._splitDirection},set:function(e){this._splitDirection!==e&&this.resetDrawCommands(),this._splitDirection=e}},classificationType:{get:function(){return this._classificationType}},pickIds:{get:function(){return this._pickIds}},styleCommandsNeeded:{get:function(){return this._styleCommandsNeeded}}});Vo.prototype.getRectangle=function(e){let t=this._content?.tile?.contentBoundingVolume;return l(t?.rectangle)?t.rectangle:(e=e??this._scene?.ellipsoid??ne.default,re.fromBoundingSphere(this.boundingSphere,e,this._rectangle))};Vo.prototype.getNode=function(e){return this._nodesByName[e]};Vo.prototype.setArticulationStage=function(e,t){this._sceneGraph.setArticulationStage(e,t)};Vo.prototype.applyArticulations=function(){this._sceneGraph.applyArticulations()};Vo.prototype.getExtension=function(e){return this._loader.components.extensions[e]};Vo.prototype.makeStyleDirty=function(){this._styleDirty=!0};Vo.prototype.resetDrawCommands=function(){this._drawCommandsBuilt=!1};var oct=new P,rct=new q,sct=new P;Vo.prototype.update=function(e){let t=!1;try{t=act(this,e)}catch(i){if(!this._loader.incrementallyLoadTextures&&i.name==="TextureError")pq(this,i);else{let o=Zt.getError("model",this._resource,i);pq(this,o)}}if(cct(this,e),lct(this,e),dct(this,e),!this._resourcesLoaded&&t){this._resourcesLoaded=!0;let i=this._loader.components;if(!l(i)){if(this._loader.isUnloaded())return;let s=Zt.getError("model",this._resource,new ae("Failed to load model."));pq(s),this._rejectLoad=this._rejectLoad&&this._rejectLoad(s)}let o=i.structuralMetadata;l(o)&&o.propertyTableCount>0&&nct(this,o);let r=new qX({model:this,modelComponents:i});this._sceneGraph=r,this._gltfCredits=r.components.asset.credits}if(!this._resourcesLoaded||e.mode===se.MORPHING)return;let n=this._modelImagery;if(n.update(e),!(!n.ready&&!(this._content?.tileset?._asynchronouslyLoadImagery??!1))){if(uct(this),mct(this),hct(this,e),fct(this),pct(this,e),bct(this,e),gct(this,e),yct(this,e),_ct(this,e),Sct(this,e),Zct(this,e),Rct(this,e),this._defaultTexture=e.context.defaultTexture,Cct(this,e),Ect(this,e),Lct(this),Wct(this,e),Pct(this,e),!this._ready){e.afterRender.push(()=>{this._ready=!0,this._readyEvent.raiseEvent(this)});return}this._loader.incrementallyLoadTextures&&!this._texturesLoaded&&this._loader.texturesLoaded&&(this.resetDrawCommands(),this._texturesLoaded=!0,this._texturesReadyEvent.raiseEvent(this)),Fct(this),Xct(this,e),Nct(this),Mct(this,e)}};function act(e,t){return!e._resourcesLoaded||e._loader.incrementallyLoadTextures&&!e._texturesLoaded?(t.afterRender.push(()=>!0),e._loader.process(t)):!0}function cct(e,t){l(e._customShader)&&e._customShader.update(t)}function lct(e,t){let n=e._environmentMapManager,i=t.passes.pick||t.passes.pickVoxel;e._ready&&n.owner===e&&!i&&(n.position=e._boundingSphere.center,n.shouldUpdate=!l(e._imageBasedLighting.sphericalHarmonicCoefficients)||!l(e._imageBasedLighting.specularEnvironmentMaps),n.update(t),n.shouldRegenerateShaders&&e.resetDrawCommands())}function dct(e,t){e._imageBasedLighting.update(t),e._imageBasedLighting.shouldRegenerateShaders&&e.resetDrawCommands()}function uct(e){if(!e._featureTableIdDirty)return;e._featureTableIdDirty=!1;let t=e._sceneGraph.components,n=t.structuralMetadata;l(n)&&n.propertyTableCount>0&&(e.featureTableId=ict(t,e),e._styleDirty=!0,e.resetDrawCommands())}function mct(e){e._styleDirty&&(e.applyStyle(e._style),e._styleDirty=!1)}function hct(e,t){let n=e._featureTables,i=n.length,o=!1;for(let r=0;r<i;r++)n[r].update(t),n[r].styleCommandsNeededDirty&&(o=!0);o&&hTe(e)}function hTe(e){let t=e.featureTables[e.featureTableId];e._styleCommandsNeeded=uf.getStyleCommandsNeeded(t.featuresLength,t.batchTexture.translucentFeaturesLength)}function fct(e){let t=e.pointCloudShading;t.attenuation!==e._attenuation&&(e.resetDrawCommands(),e._attenuation=t.attenuation),t.backFaceCulling!==e._pointCloudBackFaceCulling&&(e.resetDrawCommands(),e._pointCloudBackFaceCulling=t.backFaceCulling)}function pct(e,t){e._silhouetteDirty&&(yTe(t)&&e.resetDrawCommands(),e._silhouetteDirty=!1)}function bct(e,t){let n=e.hasSkipLevelOfDetail(t);n!==e._skipLevelOfDetail&&(e.resetDrawCommands(),e._skipLevelOfDetail=n)}function gct(e,t){let n=0;e.isClippingEnabled()&&(e._clippingPlanes.owner===e&&e._clippingPlanes.update(t),n=e._clippingPlanes.clippingPlanesState),n!==e._clippingPlanesState&&(e.resetDrawCommands(),e._clippingPlanesState=n)}function fTe(e){e._removeClippingPolygonAdded=e._removeClippingPolygonAdded&&e._removeClippingPolygonAdded(),e._removeClippingPolygonRemoved=e._removeClippingPolygonRemoved&&e._removeClippingPolygonRemoved();let t=e._clippingPolygons;if(!l(t)||t.owner!==e)return;let n=()=>{e._clippingPolygonsNeedRebake=!0};e._removeClippingPolygonAdded=t.polygonAdded.addEventListener(n),e._removeClippingPolygonRemoved=t.polygonRemoved.addEventListener(n)}function yct(e,t){let n=e._clippingPolygons,i=e.isClippingPolygonsEnabled(),o=0;i&&(n.owner===e&&n.update(t),o=n.clippingPolygonsState),o!==e._clippingPolygonsState&&(e.resetDrawCommands(),e._clippingPolygonsState=o);let r=(e._clippingPolygonData?.polygonRings.length??0)>0;if(e._clippingPolygonsNeedRebake&&(e._clippingPolygonsNeedRebake=!1,l(e._clippingPolygonData)&&(vc.releaseRectangleData(e._clippingPolygonData),e._clippingPolygonData=void 0)),!i||!e._ready)return;l(e._clippingPolygonData)||(e._clippingPolygonData=n.requestRectangleData(e.getRectangle(n.ellipsoid),t.context));let s=(e._clippingPolygonData?.polygonRings.length??0)>0;r!==s&&e.resetDrawCommands()}var xct=new re;function pTe(e){l(e._vectorData)&&(e._scene?.vectorProvider?.releaseTileData(e._vectorData),e._vectorData=void 0)}function Tct(e){if(e?.show!==!0)return 0;let t=1;return t|=e.hasPolylines?2:0,t|=e.hasPolygons?4:0,t}function _ct(e,t){let n=e._scene?.vectorProvider;if(l(n)&&l(e._content)&&e.ready&&t.mode===se.SCENE3D){let r=e._content?.tile?.contentBoundingVolume.rectangle??re.fromBoundingSphere(e.boundingSphere,n.ellipsoid,xct);e._vectorData=l(e._vectorData)?n.updateDataForRectangle(r,t.context,e._vectorData,He.CLAMP_TO_3D_TILE):n.requestDataForRectangle(r,t.context,He.CLAMP_TO_3D_TILE)}else pTe(e);let o=Tct(e._vectorData);o!==e._vectorLookupFlags&&(e.resetDrawCommands(),e._vectorLookupFlags=o)}function Sct(e,t){t.mode!==e._sceneMode&&(e._projectTo2D?e.resetDrawCommands():e._updateModelMatrix=!0,e._sceneMode=t.mode)}function Zct(e,t){let n=t.fog.enabled&&t.fog.renderable;n!==e._fogRenderable&&(e.resetDrawCommands(),e._fogRenderable=n)}function Rct(e,t){if(e.enableVerticalExaggeration){let n=t.verticalExaggeration!==1;e.hasVerticalExaggeration!==n&&(e.resetDrawCommands(),e._hasVerticalExaggeration=n)}else e.hasVerticalExaggeration&&(e.resetDrawCommands(),e._hasVerticalExaggeration=!1)}function Cct(e,t){e._drawCommandsBuilt||(e.destroyPipelineResources(),e._sceneGraph.buildDrawCommands(t),e._drawCommandsBuilt=!0)}function Vct(e,t){if(e===t)return!0;if(!l(e)||!l(t))return!1;for(let n=0;n<16;n++)if(e[n]!==t[n])return!1;return!0}function xq(e,t){if(!l(e)||!l(t))return P.clone(e,t);for(let n=0;n<16;n++)t[n]=e[n];return t}function Ect(e,t){Vct(e.modelMatrix,e._modelMatrix)||(e._updateModelMatrix=!0,e._modelMatrix=xq(e.modelMatrix,e._modelMatrix))}var Cx=new h,bq=new pe,Act=new pe,Gct=200,mTe=30;function Lct(e){let t=e.heightReference!==He.NONE&&l(e._scene)&&e._scene.frameState.frameNumber-e._lastSurfaceQueryFrame>=mTe;if(!e._updateModelMatrix&&!e._heightDirty&&e._minimumPixelSize===0&&!t)return;if(!e._updateModelMatrix&&!e._heightDirty&&l(e._removeUpdateHeightCallback)&&!t){e._updateModelMatrix=!0;return}let n=e._scene;if(!l(n)||e.heightReference===He.NONE){l(e._removeUpdateHeightCallback)&&(e._removeUpdateHeightCallback(),e._removeUpdateHeightCallback=void 0),e._clampedModelMatrix=void 0;return}let i=n.ellipsoid??ne.default,o=e.modelMatrix;Cx.x=o[12],Cx.y=o[13],Cx.z=o[14];let r=i.cartesianToCartographic(Cx,Act);l(e._clampedModelMatrix)||(e._clampedModelMatrix=P.clone(o,new P));let s=n.frameState.frameNumber,a=e.heightReference===He.CLIP_TO_GROUND,c=s-e._lastSurfaceQueryFrame<mTe,d=a&&l(e._lastSurfaceHeight)&&r.height>e._lastSurfaceHeight+Gct,u=d&&c,m=a&&c&&e._lastSurfaceQueryMissed;if(!((a&&e._lastSurfaceQueryMissed||d)&&l(e._removeUpdateHeightCallback))){l(e._removeUpdateHeightCallback)&&e._removeUpdateHeightCallback();let y=pe.clone(r),_=Bct(e,i,y);e._removeUpdateHeightCallback=n.updateHeight(y,S=>{let Z=n.getHeight(y,e.heightReference);l(Z)&&(S.height=Z,e._lastSurfaceQueryFrame=n.frameState.frameNumber,e._lastSurfaceQueryMissed=!1),e._lastSurfaceHeight=S.height,_(S)},e.heightReference)}let f;u||m?f=e._lastSurfaceHeight:(e._lastSurfaceQueryFrame=s,f=n.getHeight(r,e.heightReference),e._lastSurfaceQueryMissed=!l(f),l(f)?e._lastSurfaceHeight=f:f=e._lastSurfaceHeight),l(f)?(pe.clone(r,bq),bq.height=f,gTe(e,i,r,bq)):xq(o,e._clampedModelMatrix),e._heightDirty=!1,e._updateModelMatrix=!0}function Wct(e,t){if(!e._updateModelMatrix&&e._minimumPixelSize===0)return;let n=l(e._clampedModelMatrix)?e._clampedModelMatrix:e.modelMatrix;bTe(e,n),vct(e,n,t)}function bTe(e,t){e._clampedScale=l(e._maximumScale)?Math.min(e._scale,e._maximumScale):e._scale,e._boundingSphere.center=h.multiplyByScalar(e._sceneGraph.boundingSphere.center,e._clampedScale,e._boundingSphere.center),e._boundingSphere.radius=e._initialRadius*e._clampedScale,e._boundingSphere=me.transform(e._boundingSphere,t,e._boundingSphere)}function vct(e,t,n){let i=e.scale;if(e.minimumPixelSize!==0&&!e._projectTo2D){let o=n.context,r=Math.max(o.drawingBufferWidth,o.drawingBufferHeight);P.getTranslation(t,Cx),e._sceneMode!==se.SCENE3D&&fo.computeActualEllipsoidPosition(n,Cx,Cx);let s=e._boundingSphere.radius,a=wct(Cx,s,n),c=1/a;Math.min(c*(2*s),r)<e.minimumPixelSize&&(i=e.minimumPixelSize*a/(2*e._initialRadius))}e._computedScale=l(e.maximumScale)?Math.min(e.maximumScale,i):i}function Fct(e){if(!e._idDirty)return;e._idDirty=!1;let t=e._id,n=e._pickIds,i=n.length;for(let o=0;o<i;++o)n[o].object.id=t}var Ict=new q(1,0,0,0,0,1,0,-1,0);function Pct(e,t){let n=l(e._clampedModelMatrix)?e._clampedModelMatrix:e.modelMatrix,i=e.referenceMatrix??n,o=t.context,r=rct,s=oct;if(s=P.multiply(o.uniformState.view3D,i,s),r=P.getRotation(s,r),r=q.transpose(r,r),e._iblReferenceFrameMatrix=q.multiply(Ict,r,e._iblReferenceFrameMatrix),e.isClippingEnabled()){let a=P.multiply(i,e._clippingPlanes.modelMatrix,sct);e._clippingPlanesMatrix=P.inverseTranspose(a,e._clippingPlanesMatrix)}}function Xct(e,t){let n=e._sceneGraph;if(e._updateModelMatrix||e._minimumPixelSize!==0){let o=l(e._clampedModelMatrix)?e._clampedModelMatrix:e.modelMatrix;n.updateModelMatrix(o,t),e._updateModelMatrix&&(e._clippingPolygonsNeedRebake=!0),e._updateModelMatrix=!1}e._backFaceCullingDirty&&(n.updateBackFaceCulling(e._backFaceCulling),e._backFaceCullingDirty=!1),e._shadowsDirty&&(n.updateShadows(e._shadows),e._shadowsDirty=!1),e._debugShowBoundingVolumeDirty&&(n.updateShowBoundingVolume(e._debugShowBoundingVolume),e._debugShowBoundingVolumeDirty=!1);let i=!1;!l(e.classificationType)&&e._show&&(i=e._userAnimationDirty||e._activeAnimations.update(t)),n.update(t,i),e._userAnimationDirty=!1}function Nct(e){if(!e._showCreditsOnScreenDirty)return;e._showCreditsOnScreenDirty=!1,e._credits.length=0;let t=e._showCreditsOnScreen;if(l(e._credit)){let s=Lt.clone(e._credit);s.showOnScreen=s.showOnScreen||t,e._credits.push(s)}let n=e._resourceCredits,i=n.length;for(let s=0;s<i;s++){let a=Lt.clone(n[s]);a.showOnScreen=a.showOnScreen||t,e._credits.push(a)}let o=e._gltfCredits,r=o.length;for(let s=0;s<r;s++){let a=Lt.clone(o[s]);a.showOnScreen=a.showOnScreen||t,e._credits.push(a)}}function Yct(e){return e.isClippingPolygonsEnabled()&&e._clippingPolygons.inverse&&(e._clippingPolygonData?.polygonRings.length??0)===0}function Mct(e,t){let n=Hct(e,t),i=e.isInvisible(),o=e.hasSilhouette(t),r=e._show&&e._computedScale!==0&&n&&(!i||o)&&!Yct(e),s=t.passes,a=s.render||s.pick&&e.allowPicking;r&&!e._ignoreCommands&&a&&(Kct(e,t),e._sceneGraph.pushDrawCommands(t))}var gq=new me;function wct(e,t,n){return gq.center=e,gq.radius=t,n.camera.getPixelSize(gq,n.context.drawingBufferWidth,n.context.drawingBufferHeight)}var CB=new h,kct=new h,VB=new h,Uct=new h,Dct=new P;function Oct(e,t,n){let i=e._sceneGraph;if(!l(i)||!l(i._positionMin))return 0;let o=i._positionMin,r=i._positionMax,s=t.geodeticSurfaceNormalCartographic(n,Uct),a=P.multiplyTransformation(i._components.transform,i._axisCorrectionMatrix,Dct),c=e.scale,d=e.modelMatrix,u=0;for(let m=0;m<8;m++){let p=h.fromElements(m&1?r.x:o.x,m&2?r.y:o.y,m&4?r.z:o.z,kct);h.multiplyByScalar(p,c,p),P.multiplyByPoint(a,p,VB),P.multiplyByPointAsVector(d,VB,VB);let b=h.dot(VB,s);b<u&&(u=b)}return-u}function gTe(e,t,n,i){if(e.heightReference===He.CLIP_TO_GROUND){let r=i.height+Oct(e,t,i);e._heightAboveSurface=Math.max(0,n.height-r),i.height=Math.max(n.height,r)}else ky(e.heightReference)&&(i.height+=n.height);t.cartographicToCartesian(i,CB);let o=e._clampedModelMatrix;xq(e.modelMatrix,o),o[12]=CB.x,o[13]=CB.y,o[14]=CB.z,e._heightDirty=!0}function Bct(e,t,n){return function(i){gTe(e,t,n,i)}}var zct=new h;function Hct(e,t){let n=e.distanceDisplayCondition;if(!l(n))return!0;let i=n.near*n.near,o=n.far*n.far,r;if(t.mode===se.SCENE2D){let a=(t.camera.frustum.right-t.camera.frustum.left)*.5;r=a*a}else{let s=P.getTranslation(e.modelMatrix,zct);fo.computeActualEllipsoidPosition(t,s,s),r=h.distanceSquared(s,t.camera.positionWC)}return r>=i&&r<=o}function Kct(e,t){let n=t.creditDisplay,i=e._credits,o=i.length;for(let r=0;r<o;r++)n.addCreditToNextFrame(i[r])}Vo.prototype.isTranslucent=function(){let e=this.color;return l(e)&&e.alpha>0&&e.alpha<1};Vo.prototype.isInvisible=function(){let e=this.color;return l(e)&&e.alpha===0};function yTe(e){return e.context.stencilBuffer}Vo.prototype.hasSilhouette=function(e){return yTe(e)&&this._silhouetteSize>0&&this._silhouetteColor.alpha>0&&!l(this._classificationType)};Vo.prototype.hasSkipLevelOfDetail=function(e){if(!Or.is3DTiles(this.type))return!1;let t=e.context.stencilBuffer,n=this._content.tileset;return t&&n.isSkippingLevelOfDetail};Vo.prototype.isClippingEnabled=function(){let e=this._clippingPlanes;return l(e)&&e.enabled&&e.length!==0};Vo.prototype.pick=function(e,t,n,i,o){return qC(this,e,t,n,i,o)};Vo.prototype.isClippingPolygonsEnabled=function(){let e=this._clippingPolygons;return l(e)&&e.enabled&&e.length!==0};Vo.prototype.hasDrapedVectors=function(){return this._vectorData?.show===!0};Vo.prototype.isDestroyed=function(){return!1};Vo.prototype.destroy=function(){let e=this._loader;l(e)&&e.destroy();let t=this._featureTables;if(l(t)){let o=t.length;for(let r=0;r<o;r++)t[r].destroy()}this.destroyPipelineResources(),this.destroyModelResources(),pTe(this),l(this._removeUpdateHeightCallback)&&(this._removeUpdateHeightCallback(),this._removeUpdateHeightCallback=void 0),l(this._terrainProviderChangedCallback)&&(this._terrainProviderChangedCallback(),this._terrainProviderChangedCallback=void 0),this._removeClippingPolygonAdded=this._removeClippingPolygonAdded&&this._removeClippingPolygonAdded(),this._removeClippingPolygonRemoved=this._removeClippingPolygonRemoved&&this._removeClippingPolygonRemoved();let n=this._clippingPlanes;l(n)&&!n.isDestroyed()&&n.owner===this&&n.destroy(),this._clippingPlanes=void 0,l(this._clippingPolygonData)&&vc.releaseRectangleData(this._clippingPolygonData),this._clippingPolygonData=void 0,this._clippingPolygons=void 0,this._shouldDestroyImageBasedLighting&&!this._imageBasedLighting.isDestroyed()&&this._imageBasedLighting.destroy(),this._imageBasedLighting=void 0;let i=this._environmentMapManager;!i.isDestroyed()&&i.owner===this&&i.destroy(),this._environmentMapManager=void 0,ue(this)};Vo.prototype.destroyPipelineResources=function(){let e=this._pipelineResources;for(let t=0;t<e.length;t++)e[t].destroy();this._pipelineResources.length=0,this._pickIds.length=0};Vo.prototype.destroyModelResources=function(){let e=this._modelResources;for(let t=0;t<e.length;t++)e[t].destroy();this._modelResources.length=0};Vo.fromGltfAsync=async function(e){e=e??B.EMPTY_OBJECT;let t=e.url??e.gltf,n={releaseGltfJson:e.releaseGltfJson,asynchronous:e.asynchronous,incrementallyLoadTextures:e.incrementallyLoadTextures,upAxis:e.upAxis,forwardAxis:e.forwardAxis,loadAttributesFor2D:e.projectTo2D,enablePick:e.enablePick,loadIndicesForWireframe:e.enableDebugWireframe,loadPrimitiveOutline:e.enableShowOutline,loadForClassification:l(e.classificationType)},i=e.basePath??"",o=ve.createIfNeeded(i);l(t.asset)?(n.gltfJson=t,n.baseResource=o,n.gltfResource=o):t instanceof Uint8Array?(n.typedArray=t,n.baseResource=o,n.gltfResource=o):n.gltfResource=ve.createIfNeeded(t);let r=new vu(n),a=l(e.content)?Or.TILE_GLTF:Or.GLTF,c=n.gltfResource,d=rN(r,a,e);d.resource=c,d.environmentMapOptions=e.environmentMapOptions;try{await r.load()}catch(b){throw r.destroy(),Zt.getError("model",c,b)}let u=e.gltfCallback;l(u)&&u(r.gltfJson);let m=new Vo(d),p=m._resource.credits;if(l(p)){let b=p.length;for(let f=0;f<b;f++)m._resourceCredits.push(Lt.clone(p[f]))}return m};Vo.fromB3dm=async function(e){let t={b3dmResource:e.resource,arrayBuffer:e.arrayBuffer,byteOffset:e.byteOffset,releaseGltfJson:e.releaseGltfJson,asynchronous:e.asynchronous,incrementallyLoadTextures:e.incrementallyLoadTextures,upAxis:e.upAxis,forwardAxis:e.forwardAxis,loadAttributesFor2D:e.projectTo2D,enablePick:e.enablePick,loadIndicesForWireframe:e.enableDebugWireframe,loadPrimitiveOutline:e.enableShowOutline,loadForClassification:l(e.classificationType)},n=new DI(t);try{await n.load();let i=rN(n,Or.TILE_B3DM,e);return new Vo(i)}catch(i){throw n.destroy(),i}};Vo.fromPnts=async function(e){let t={arrayBuffer:e.arrayBuffer,byteOffset:e.byteOffset,loadAttributesFor2D:e.projectTo2D},n=new tN(t);try{await n.load();let i=rN(n,Or.TILE_PNTS,e);return new Vo(i)}catch(i){throw n.destroy(),i}};Vo.fromI3dm=async function(e){let t={i3dmResource:e.resource,arrayBuffer:e.arrayBuffer,byteOffset:e.byteOffset,releaseGltfJson:e.releaseGltfJson,asynchronous:e.asynchronous,incrementallyLoadTextures:e.incrementallyLoadTextures,upAxis:e.upAxis,forwardAxis:e.forwardAxis,loadAttributesFor2D:e.projectTo2D,enablePick:e.enablePick,loadIndicesForWireframe:e.enableDebugWireframe,loadPrimitiveOutline:e.enableShowOutline},n=new zI(t);try{await n.load();let i=rN(n,Or.TILE_I3DM,e);return new Vo(i)}catch(i){throw n.destroy(),i}};Vo.fromGeoJson=async function(e){let t={geoJson:e.geoJson},n=new OI(t),i=rN(n,Or.TILE_GEOJSON,e);return new Vo(i)};var Jct=new U;Vo.prototype.applyColorAndShow=function(e){let t=U.clone(this._color,Jct),n=l(e)&&l(e.color),i=l(e)&&l(e.show);this._color=n?e.color.evaluateColor(void 0,this._color):U.clone(U.WHITE,this._color),this._show=i?e.show.evaluate(void 0):!0,yq(t,this._color)&&this.resetDrawCommands()};Vo.prototype.applyStyle=function(e){let t=this.type===Or.TILE_PNTS,n=l(this.featureTableId)&&this.featureTables[this.featureTableId].featuresLength>0,i=l(this.structuralMetadata)?this.structuralMetadata.propertyAttributes:void 0,o=l(i)&&l(i[0]);if(t&&(!n||o)){this.resetDrawCommands();return}n?(this.featureTables[this.featureTableId].applyStyle(e),hTe(this,e)):(this.applyColorAndShow(e),this._styleCommandsNeeded=void 0)};function rN(e,t,n){return{loader:e,type:t,resource:n.resource,show:n.show,modelMatrix:n.modelMatrix,scale:n.scale,enableVerticalExaggeration:n.enableVerticalExaggeration,minimumPixelSize:n.minimumPixelSize,maximumScale:n.maximumScale,id:n.id,allowPicking:n.allowPicking,clampAnimations:n.clampAnimations,shadows:n.shadows,debugShowBoundingVolume:n.debugShowBoundingVolume,enableDebugWireframe:n.enableDebugWireframe,debugWireframe:n.debugWireframe,cull:n.cull,opaquePass:n.opaquePass,customShader:n.customShader,content:n.content,heightReference:n.heightReference,scene:n.scene,distanceDisplayCondition:n.distanceDisplayCondition,color:n.color,colorBlendAmount:n.colorBlendAmount,colorBlendMode:n.colorBlendMode,edgeDisplayMode:n.edgeDisplayMode,silhouetteColor:n.silhouetteColor,silhouetteSize:n.silhouetteSize,enableShowOutline:n.enableShowOutline,showOutline:n.showOutline,outlineColor:n.outlineColor,clippingPlanes:n.clippingPlanes,clippingPolygons:n.clippingPolygons,lightColor:n.lightColor,imageBasedLighting:n.imageBasedLighting,backFaceCulling:n.backFaceCulling,credit:n.credit,showCreditsOnScreen:n.showCreditsOnScreen,splitDirection:n.splitDirection,projectTo2D:n.projectTo2D,enablePick:n.enablePick,featureIdLabel:n.featureIdLabel,instanceFeatureIdLabel:n.instanceFeatureIdLabel,pointCloudShading:n.pointCloudShading,classificationType:n.classificationType,pickObject:n.pickObject}}var Yu=Vo;var Tq=class e{constructor(t,n,i){this._tileset=t,this._tile=n,this._resource=i,this._model=void 0,this._metadata=void 0,this._group=void 0,this._ready=!1}get featuresLength(){let t=this._model,n=t.featureTables,i=t.featureTableId;return l(n)&&l(n[i])?n[i].featuresLength:0}get pointsLength(){return this._model.statistics.pointsLength}get trianglesLength(){return this._model.statistics.trianglesLength}get geometryByteLength(){return this._model.statistics.geometryByteLength}get texturesByteLength(){return this._model.statistics.texturesByteLength}get batchTableByteLength(){let t=this._model.statistics;return t.propertyTablesByteLength+t.batchTexturesByteLength}get innerContents(){}get ready(){return this._ready}get tileset(){return this._tileset}get tile(){return this._tile}get url(){return this._resource.getUrlComponent(!0)}get batchTable(){let t=this._model,n=t.featureTables,i=t.featureTableId;if(l(n)&&l(n[i]))return n[i]}get metadata(){return this._metadata}set metadata(t){this._metadata=t}get group(){return this._group}set group(t){this._group=t}getTextureIds(){return this._model.statistics.getTextureIds()}getTextureByteLengthById(t){return this._model.statistics.getTextureByteLengthById(t)}getExtension(t){return this._model.getExtension(t)}getFeature(t){let n=this._model,i=n.featureTableId;return n.featureTables[i].getFeature(t)}hasProperty(t,n){let i=this._model,o=i.featureTableId;return l(o)?i.featureTables[o].hasProperty(t,n):!1}applyDebugSettings(t,n){n=t?n:U.WHITE,this.featuresLength===0?this._model.color=n:l(this.batchTable)&&this.batchTable.setAllColor(n)}applyStyle(t){this._model.style=t}update(t,n){let i=this._model,o=this._tile;i.colorBlendAmount=t.colorBlendAmount,i.colorBlendMode=t.colorBlendMode,i.modelMatrix=o.computedTransform,i.customShader=t.customShader,i.featureIdLabel=t.featureIdLabel,i.instanceFeatureIdLabel=t.instanceFeatureIdLabel,i.lightColor=t.lightColor,i.imageBasedLighting=t.imageBasedLighting,i.backFaceCulling=t.backFaceCulling,i.shadows=t.shadows,i.showCreditsOnScreen=t.showCreditsOnScreen,i.splitDirection=t.splitDirection,i.debugWireframe=t.debugWireframe,i.edgeDisplayMode=t.edgeDisplayMode,i.showOutline=t.showOutline,i.outlineColor=t.outlineColor,i.pointCloudShading=t.pointCloudShading;let r=t.clippingPlanes;i.referenceMatrix=t.clippingPlanesOriginMatrix,l(r)&&o.clippingPlanesDirty&&(i._clippingPlanes=r.enabled&&o._isClipped?r:void 0);let s=t.environmentMapManager;i.environmentMapManager!==r&&(i._environmentMapManager=s),l(r)&&l(i._clippingPlanes)&&i._clippingPlanes!==r&&(i._clippingPlanes=r,i._clippingPlanesState=0);let a=t.clippingPolygons;l(a)&&o.clippingPolygonsDirty&&(i._clippingPolygons=a.enabled&&o._isClippedByPolygon?a:void 0),l(a)&&l(i._clippingPolygons)&&i._clippingPolygons!==a&&(i._clippingPolygons=a,i._clippingPolygonsState=0),o.clippingPolygonsNeedRebake&&(i._clippingPolygonsNeedRebake=!0),i.update(n),!this._ready&&i.ready&&(i.activeAnimations.addAll({loop:wd.REPEAT}),this._ready=!0)}isDestroyed(){return!1}destroy(){return this._model=this._model&&this._model.destroy(),ue(this)}static async fromGltf(t,n,i,o){let r=new e(t,n,i),a=sN(t,n,r,{gltf:o,basePath:i}),c=t.vectorClassificationOnly?void 0:t.classificationType;a.classificationType=c;let d=await Yu.fromGltfAsync(a);return r._model=d,r}static async fromB3dm(t,n,i,o,r){let s=new e(t,n,i),c=sN(t,n,s,{arrayBuffer:o,byteOffset:r,resource:i}),d=t.vectorClassificationOnly?void 0:t.classificationType;c.classificationType=d;let u=await Yu.fromB3dm(c);return s._model=u,s}static async fromI3dm(t,n,i,o,r){let s=new e(t,n,i),c=sN(t,n,s,{arrayBuffer:o,byteOffset:r,resource:i}),d=await Yu.fromI3dm(c);return s._model=d,s}static async fromPnts(t,n,i,o,r){let s=new e(t,n,i),c=sN(t,n,s,{arrayBuffer:o,byteOffset:r,resource:i}),d=await Yu.fromPnts(c);return s._model=d,s}static async fromGeoJson(t,n,i,o){let r=new e(t,n,i),a=sN(t,n,r,{geoJson:o,resource:i}),c=await Yu.fromGeoJson(a);return r._model=c,r}pick(t,n,i){if(!l(this._model)||!this._ready)return;let o=n.verticalExaggeration,r=n.verticalExaggerationRelativeHeight;return this._model.pick(t,n,o,r,ne.WGS84,i)}};function sN(e,t,n,i){let o={cull:!1,releaseGltfJson:!0,opaquePass:Le.CESIUM_3D_TILE,modelMatrix:t.computedTransform,upAxis:e._modelUpAxis,forwardAxis:e._modelForwardAxis,incrementallyLoadTextures:!1,customShader:e.customShader,content:n,scene:e._scene,colorBlendMode:e.colorBlendMode,colorBlendAmount:e.colorBlendAmount,lightColor:e.lightColor,imageBasedLighting:e.imageBasedLighting,featureIdLabel:e.featureIdLabel,instanceFeatureIdLabel:e.instanceFeatureIdLabel,pointCloudShading:e.pointCloudShading,clippingPlanes:e.clippingPlanes,backFaceCulling:e.backFaceCulling,shadows:e.shadows,showCreditsOnScreen:e.showCreditsOnScreen,splitDirection:e.splitDirection,enableDebugWireframe:e._enableDebugWireframe,debugWireframe:e.debugWireframe,projectTo2D:e._projectTo2D,enablePick:e._enablePick,enableShowOutline:e._enableShowOutline,showOutline:e.showOutline,outlineColor:e.outlineColor};return It(i,o)}var Mu=Tq;var jui=x(T(),1);var _q=class e{constructor(t,n,i){this._tileset=t,this._tile=n,this._resource=i,this.featurePropertiesDirty=!1,this._metadata=void 0,this._group=void 0,this._ready=!1}get featuresLength(){return 0}get pointsLength(){return 0}get trianglesLength(){return 0}get geometryByteLength(){return 0}get texturesByteLength(){return 0}get batchTableByteLength(){return 0}get innerContents(){}get ready(){return this._ready}get tileset(){return this._tileset}get tile(){return this._tile}get url(){return this._resource.getUrlComponent(!0)}get batchTable(){}get metadata(){return this._metadata}set metadata(t){this._metadata=t}get group(){return this._group}set group(t){this._group=t}static fromJson(t,n,i,o){let r=new e(t,n,i);return r._tileset.loadTileset(r._resource,o,r._tile),r._ready=!0,r}hasProperty(t,n){return!1}getFeature(t){}applyDebugSettings(t,n){}applyStyle(t){}update(t,n){}pick(t,n,i){}isDestroyed(){return!1}destroy(){return ue(this)}},aN=_q;var Ibi=x(T(),1);var Bpi=x(T(),1);var fhi=x(T(),1);var Emi=x(T(),1);var nmi=x(T(),1);var qui=x(T(),1),jct=Object.freeze({NONE:0,LOADING:2,LOADED:3,ERROR:4,FAILED:5}),Os=jct;function bf(e){this._billboardCollection=e,this._id=void 0,this._loadState=Os.NONE,this._loadError=void 0,this._index=-1,this._width=void 0,this._height=void 0,this._hasSubregion=!1,this.dirty=!1}Object.defineProperties(bf.prototype,{loadError:{get:function(){return this._loadError}},loadState:{get:function(){return this._loadState}},ready:{get:function(){return this._loadState===Os.LOADED}},hasImage:{get:function(){return this._loadState!==Os.NONE}},id:{get:function(){return this._id}},width:{get:function(){return this._width}},height:{get:function(){return this._height}}});bf.prototype.unload=async function(){this._loadState!==Os.NONE&&(this._id=void 0,this._loadError=void 0,this._loadState=Os.NONE,this._index=-1,this._width=void 0,this._height=void 0,this.dirty=!0)};bf.prototype.loadImage=async function(e,t,n,i){if(this._id===e)return;let o=this._billboardCollection,r=o.billboardTextureCache,s=r.get(e);if(l(s)&&t.loadState===Os.LOADING||t.loadState===Os.LOADED){bf.clone(s,this);return}l(s)||(s=new bf(o),r.set(e,s)),s._id=this._id=e,s._loadState=this._loadState=Os.LOADING,s._loadError=this._loadError=void 0;let a,c=this._billboardCollection.textureAtlas;try{let u=c.addImage(e,t,n,i);typeof u=="number"?a=u:a=await u}catch(u){if(s._loadState=Os.ERROR,s._loadError=u,this._id!==e)return;this._loadState=Os.ERROR,this._loadError=u;return}if(!l(a)||a===-1){if(s._loadState=Os.FAILED,s._index=-1,this._id!==e)return;this._loadState=Os.FAILED,this._index=-1;return}s._index=a,s._loadState=Os.LOADED;let d=c.rectangles[a];s._width=d.width,s._height=d.height,this._id===e&&(this._index=a,this._loadState=Os.LOADED,this._width=d.width,this._height=d.height,this.dirty=!0)};bf.prototype.addImageSubRegion=function(e,t){this._id=e,this._loadError=void 0,this._hasSubregion=!0;let i=this._billboardCollection.textureAtlas.addImageSubRegion(e,t);if(typeof i=="number"){this.setImageSubRegion(i,t);return}this.loadImageSubRegion(e,t,i)};bf.prototype.loadImageSubRegion=async function(e,t,n){let i;try{this._loadState=Os.LOADING,i=await n}catch(o){this._loadState=Os.ERROR,this._loadError=o;return}this._id===e&&(this._loadState=Os.LOADED,this.setImageSubRegion(i,t))};bf.prototype.setImageSubRegion=function(e,t){if(this._index!==e){if(!l(e)||e===-1){this._loadState=Os.FAILED,this._index=-1,this._width=void 0,this._height=void 0;return}this._width=t.width,this._height=t.height,this._index=e,this.dirty=!0}};bf.prototype.computeTextureCoordinates=function(e){return this._billboardCollection.textureAtlas.computeTextureCoordinates(this._index,e)};bf.clone=function(e,t){if(t._id=e._id,t._loadState=e._loadState,t._loadError=void 0,t._index=e._index,t._width=e._width,t._height=e._height,t._hasSubregion=e._hasSubregion,e.ready){t.dirty=!0;return}return(async()=>{let i=e._id;await e._billboardCollection.textureAtlas._indexPromiseById.get(i),t._id===i&&(e._hasSubregion&&await Promise.resolve(),t._id=i,t._loadState=e._loadState,t._loadError=e._loadError,t._index=e._index,t._width=e._width,t._height=e._height,t.dirty=!0)})(),t};var eg=bf;function Xi(e,t){e=e??B.EMPTY_OBJECT;let n=e.translucencyByDistance,i=e.pixelOffsetScaleByDistance,o=e.scaleByDistance,r=e.distanceDisplayCondition;l(n)&&(n=Kt.clone(n)),l(i)&&(i=Kt.clone(i)),l(o)&&(o=Kt.clone(o)),l(r)&&(r=Bt.clone(r)),this._show=e.show??!0,this._position=h.clone(e.position??h.ZERO),this._actualPosition=h.clone(this._position),this._pixelOffset=k.clone(e.pixelOffset??k.ZERO),this._translate=new k(0,0),this._eyeOffset=h.clone(e.eyeOffset??h.ZERO),this._heightReference=e.heightReference??He.NONE,this._verticalOrigin=e.verticalOrigin??zn.CENTER,this._horizontalOrigin=e.horizontalOrigin??Ui.CENTER,this._scale=e.scale??1,this._color=U.clone(e.color??U.WHITE),this._rotation=e.rotation??0,this._alignedAxis=h.clone(e.alignedAxis??h.ZERO),this._width=e.width,this._height=e.height,this._scaleByDistance=o,this._translucencyByDistance=n,this._pixelOffsetScaleByDistance=i,this._sizeInMeters=e.sizeInMeters??!1,this._distanceDisplayCondition=r,this._disableDepthTestDistance=e.disableDepthTestDistance,this._id=e.id,this._collection=e.collection??t,this._pickId=void 0,this._pickPrimitive=e._pickPrimitive??this,this._billboardCollection=t,this._dirty=!1,this._index=-1,this._batchIndex=void 0,this._imageTexture=new eg(t),this._imageId=e.imageId,this._imageWidth=void 0,this._imageHeight=void 0,this._labelDimensions=void 0,this._labelHorizontalOrigin=void 0,this._labelTranslate=void 0;let s=e.image;l(s)&&(this._computeImageTextureProperties(e.imageId,s),this._imageTexture.loadImage(this._imageId,s,this._imageWidth,this._imageHeight)),l(e.imageSubRegion)&&this._imageTexture.addImageSubRegion(this._imageId,e.imageSubRegion),this._actualClampedPosition=void 0,this._removeCallbackFunc=void 0,this._lastSurfaceHeight=void 0,this._lastSurfaceQueryFrame=-1,this._lastSurfaceQueryMissed=!1,this._clampedToSurface=!1,this._clampingCartesian=void 0,this._clampingHeight=0,this._clampingHeightValid=!1,this._mode=se.SCENE3D,this._clusterShow=!0,this._outlineColor=U.clone(e.outlineColor??U.BLACK),this._outlineWidth=e.outlineWidth??0,this._updateClamping(),this._splitDirection=e.splitDirection??kr.NONE,this._positionFromParent=!1}var xTe=Xi.SHOW_INDEX=0,AB=Xi.POSITION_INDEX=1,ATe=Xi.PIXEL_OFFSET_INDEX=2,Qct=Xi.EYE_OFFSET_INDEX=3,qct=Xi.HORIZONTAL_ORIGIN_INDEX=4,$ct=Xi.VERTICAL_ORIGIN_INDEX=5,elt=Xi.SCALE_INDEX=6,TTe=Xi.IMAGE_INDEX_INDEX=7,_Te=Xi.COLOR_INDEX=8,tlt=Xi.ROTATION_INDEX=9,nlt=Xi.ALIGNED_AXIS_INDEX=10,ilt=Xi.SCALE_BY_DISTANCE_INDEX=11,olt=Xi.TRANSLUCENCY_BY_DISTANCE_INDEX=12,rlt=Xi.PIXEL_OFFSET_SCALE_BY_DISTANCE_INDEX=13,slt=Xi.DISTANCE_DISPLAY_CONDITION=14,alt=Xi.DISABLE_DEPTH_DISTANCE=15;Xi.TEXTURE_COORDINATE_BOUNDS=16;var STe=Xi.SDF_INDEX=17,clt=Xi.SPLIT_DIRECTION_INDEX=18;Xi.NUMBER_OF_PROPERTIES=19;function Nr(e,t){let n=e._billboardCollection;l(n)&&(n._updateBillboard(e,t),e._dirty=!0)}function Sq(e,t){return e===t||l(e)&&l(t)&&e.x===t.x&&e.y===t.y&&e.z===t.z}function RS(e,t){if(l(e))return l(t)?(t.x=e.x,t.y=e.y,t.z=e.z,t):new h(e.x,e.y,e.z)}Object.defineProperties(Xi.prototype,{show:{get:function(){return this._show},set:function(e){this._show!==e&&(this._show=e,Nr(this,xTe))}},position:{get:function(){return this._position},set:function(e){let t=this._position;Sq(t,e)||(RS(e,t),RS(e,this._actualPosition),this._updateClamping(),Nr(this,AB))}},heightReference:{get:function(){return this._heightReference},set:function(e){let t=this._heightReference;e!==t&&(this._heightReference=e,this._updateClamping(),Nr(this,AB))}},pixelOffset:{get:function(){return this._pixelOffset},set:function(e){let t=this._pixelOffset;k.equals(t,e)||(k.clone(e,t),Nr(this,ATe))}},scaleByDistance:{get:function(){return this._scaleByDistance},set:function(e){let t=this._scaleByDistance;Kt.equals(t,e)||(this._scaleByDistance=Kt.clone(e,t),Nr(this,ilt))}},translucencyByDistance:{get:function(){return this._translucencyByDistance},set:function(e){let t=this._translucencyByDistance;Kt.equals(t,e)||(this._translucencyByDistance=Kt.clone(e,t),Nr(this,olt))}},pixelOffsetScaleByDistance:{get:function(){return this._pixelOffsetScaleByDistance},set:function(e){let t=this._pixelOffsetScaleByDistance;Kt.equals(t,e)||(this._pixelOffsetScaleByDistance=Kt.clone(e,t),Nr(this,rlt))}},eyeOffset:{get:function(){return this._eyeOffset},set:function(e){let t=this._eyeOffset;h.equals(t,e)||(h.clone(e,t),Nr(this,Qct))}},horizontalOrigin:{get:function(){return this._horizontalOrigin},set:function(e){this._horizontalOrigin!==e&&(this._horizontalOrigin=e,Nr(this,qct))}},verticalOrigin:{get:function(){return this._verticalOrigin},set:function(e){this._verticalOrigin!==e&&(this._verticalOrigin=e,Nr(this,$ct))}},scale:{get:function(){return this._scale},set:function(e){this._scale!==e&&(this._scale=e,Nr(this,elt))}},color:{get:function(){return this._color},set:function(e){let t=this._color;U.equals(t,e)||(U.clone(e,t),Nr(this,_Te))}},rotation:{get:function(){return this._rotation},set:function(e){this._rotation!==e&&(this._rotation=e,Nr(this,tlt))}},alignedAxis:{get:function(){return this._alignedAxis},set:function(e){let t=this._alignedAxis;h.equals(t,e)||(h.clone(e,t),Nr(this,nlt))}},width:{get:function(){return this._width??this._imageTexture.width},set:function(e){this._width!==e&&(this._width=e,Nr(this,TTe))}},height:{get:function(){return this._height??this._imageTexture.height},set:function(e){this._height!==e&&(this._height=e,Nr(this,TTe))}},sizeInMeters:{get:function(){return this._sizeInMeters},set:function(e){this._sizeInMeters!==e&&(this._sizeInMeters=e,Nr(this,_Te))}},distanceDisplayCondition:{get:function(){return this._distanceDisplayCondition},set:function(e){Bt.equals(e,this._distanceDisplayCondition)||(this._distanceDisplayCondition=Bt.clone(e,this._distanceDisplayCondition),Nr(this,slt))}},disableDepthTestDistance:{get:function(){return this._disableDepthTestDistance},set:function(e){this._disableDepthTestDistance!==e&&(this._disableDepthTestDistance=e,Nr(this,alt))}},id:{get:function(){return this._id},set:function(e){this._id=e,l(this._pickId)&&(this._pickId.object.id=e)}},pickPrimitive:{get:function(){return this._pickPrimitive},set:function(e){this._pickPrimitive=e,l(this._pickId)&&(this._pickId.object.primitive=e)}},pickId:{get:function(){return this._pickId}},image:{get:function(){return this._imageTexture.id},set:function(e){if(!l(e)){this._imageTexture.unload();return}this._computeImageTextureProperties(void 0,e),this._imageTexture.loadImage(this._imageId,e,this._imageWidth,this._imageHeight)}},ready:{get:function(){return this._imageTexture.ready}},loadError:{get:function(){return this._imageTexture.loadError}},textureDirty:{get:function(){return this._imageTexture.dirty},set:function(e){this._imageTexture.dirty=e}},_clampedPosition:{get:function(){return this._actualClampedPosition},set:function(e){this._actualClampedPosition=RS(e,this._actualClampedPosition),Nr(this,AB)}},clusterShow:{get:function(){return this._clusterShow},set:function(e){this._clusterShow!==e&&(this._clusterShow=e,Nr(this,xTe))}},outlineColor:{get:function(){return this._outlineColor},set:function(e){let t=this._outlineColor;U.equals(t,e)||(U.clone(e,t),Nr(this,STe))}},outlineWidth:{get:function(){return this._outlineWidth},set:function(e){this._outlineWidth!==e&&(this._outlineWidth=e,Nr(this,STe))}},splitDirection:{get:function(){return this._splitDirection},set:function(e){this._splitDirection!==e&&(this._splitDirection=e,Nr(this,clt))}}});Xi.prototype.getPickId=function(e){return l(this._pickId)||(this._pickId=e.createPickId({primitive:this._pickPrimitive,collection:this._collection,id:this._id})),this._pickId};Xi.prototype._updateClamping=function(){Xi._updateClamping(this._billboardCollection,this)};var GB=new pe,llt=new pe,ZTe=200,RTe=30;function CTe(e,t,n,i){let o=t.cartographicToCartesian(i,e._clampedPosition);ky(e._heightReference)?e._mode===se.SCENE3D?(i.height+=n.height,t.cartographicToCartesian(i,o)):o.x+=n.height:e._heightReference===He.CLIP_TO_GROUND&&n.height>i.height&&(e._mode===se.SCENE3D?(i.height=n.height,t.cartographicToCartesian(i,o)):o.x=n.height),e._clampedPosition=o}Xi._updateClamping=function(e,t){if(!l(e)||!l(e._scene))return;let n=e._scene,i=n.ellipsoid??ne.default,o=n.frameState.mode,r=o!==t._mode;if(t._mode=o,(t._heightReference===He.NONE||r)&&l(t._removeCallbackFunc)&&(t._removeCallbackFunc(),t._removeCallbackFunc=void 0,t._clampedPosition=void 0,t._lastSurfaceHeight=void 0,t._clampedToSurface=!1),t._heightReference===He.NONE||t._positionFromParent||!l(t._position))return;let s=n.frameState.frameNumber;if(t._clampingHeightValid&&t._heightReference===He.CLIP_TO_GROUND&&o===se.SCENE3D&&l(t._removeCallbackFunc)&&l(t._lastSurfaceHeight)&&s-t._lastSurfaceQueryFrame<RTe){let _=t._position,S=t._clampingCartesian,Z=_.x-S.x,R=_.y-S.y,C=_.z-S.z,E=Math.sqrt(Z*Z+R*R+C*C);if(t._clampingHeight-E>t._lastSurfaceHeight+ZTe){t._clampedToSurface=!0,t._clampedPosition=_;return}}let a=i.cartesianToCartographic(t._position,llt);if(!l(a)){t._actualClampedPosition=void 0,t._clampingHeightValid=!1;return}t._clampingCartesian=RS(t._position,t._clampingCartesian),t._clampingHeight=a.height,t._clampingHeightValid=!0;let c=t._heightReference===He.CLIP_TO_GROUND,d=s-t._lastSurfaceQueryFrame<RTe,u=c&&l(t._lastSurfaceHeight)&&a.height>t._lastSurfaceHeight+ZTe,m=u&&d,p=c&&d&&t._lastSurfaceQueryMissed;if(!((c&&t._lastSurfaceQueryMissed||u)&&l(t._removeCallbackFunc))){l(t._removeCallbackFunc)&&t._removeCallbackFunc();let _=pe.clone(a);t._removeCallbackFunc=n.updateHeight(_,S=>{let Z=n.getHeight(_,t._heightReference);l(Z)&&(S.height=Z,t._lastSurfaceQueryFrame=n.frameState.frameNumber,t._lastSurfaceQueryMissed=!1),t._lastSurfaceHeight=S.height,t._clampedToSurface=!0,CTe(t,i,_,S)},t._heightReference)}pe.clone(a,GB);let y;m||p?y=t._lastSurfaceHeight:(t._lastSurfaceQueryFrame=s,y=n.getHeight(a,t._heightReference),t._lastSurfaceQueryMissed=!l(y),l(y)?t._lastSurfaceHeight=y:y=t._lastSurfaceHeight),t._clampedToSurface=l(y),l(y)&&(GB.height=y),CTe(t,i,a,GB)};Xi.prototype.computeTextureCoordinates=function(e){return this._imageTexture.computeTextureCoordinates(e)};Xi.prototype.setImage=function(e,t){this._computeImageTextureProperties(e,t),this._imageTexture.loadImage(this._imageId,t,this._imageWidth,this._imageHeight)};Xi.prototype.setImageTexture=function(e){eg.clone(e,this._imageTexture)};var VTe=512;Xi.prototype._computeImageTextureProperties=function(e,t){if(this._imageWidth=void 0,this._imageHeight=void 0,!l(t)){this._imageId=Qn();return}let n;typeof t=="string"?n=t:t instanceof ve?n=t._url:l(t.src)&&(n=t.src),this._imageId=e??n??Qn(),l(this._width)&&l(this._height)&&!this._sizeInMeters&&dlt(n)&&(this._imageWidth=Math.min(this._width,VTe),this._imageHeight=Math.min(this._height,VTe))};function dlt(e){return l(e)?Ih(e)?e.startsWith("data:image/svg+xml"):eb(e)==="svg":!1}Xi.prototype.setImageSubRegion=function(e,t){this._imageTexture.addImageSubRegion(e,t)};Xi.prototype._setTranslate=function(e){let t=this._translate;k.equals(t,e)||(k.clone(e,t),Nr(this,ATe))};Xi.prototype._getActualPosition=function(){return l(this._clampedPosition)?this._clampedPosition:this._actualPosition};Xi.prototype._setActualPosition=function(e){l(this._clampedPosition)||h.clone(e,this._actualPosition),Nr(this,AB)};var ETe=new ce;Xi._computeActualPosition=function(e,t,n,i){return l(e._clampedPosition)?(n.mode!==e._mode&&e._updateClamping(),e._clampedPosition):n.mode===se.SCENE3D?t:(P.multiplyByPoint(i,t,ETe),fo.computeActualEllipsoidPosition(n,ETe))};var GTe=new h;Xi._computeScreenSpacePosition=function(e,t,n,i,o,r){let s=P.multiplyByPoint(e,t,GTe),a=fo.worldWithEyeOffsetToWindowCoordinates(o,s,n,r);if(l(a))return k.add(a,i,a),a};var EB=new k(0,0);Xi.prototype.computeScreenSpacePosition=function(e,t){let n=this._billboardCollection;l(t)||(t=new k),k.clone(this._pixelOffset,EB),k.add(EB,this._translate,EB);let i=n.modelMatrix,o=this._position;if(l(this._clampedPosition)&&(o=this._clampedPosition,e.mode!==se.SCENE3D)){let s=e.mapProjection,a=s.ellipsoid,c=s.unproject(o,GB);o=a.cartographicToCartesian(c,GTe),i=P.IDENTITY}return Xi._computeScreenSpacePosition(i,o,this._eyeOffset,EB,e,t)};Xi.getScreenSpaceBoundingBox=function(e,t,n){let i=e.width,o=e.height,r=e.scale;i*=r,o*=r;let s=t.x;e.horizontalOrigin===Ui.RIGHT?s-=i:e.horizontalOrigin===Ui.CENTER&&(s-=i*.5);let a=t.y;return e.verticalOrigin===zn.BOTTOM||e.verticalOrigin===zn.BASELINE?a-=o:e.verticalOrigin===zn.CENTER&&(a-=o*.5),l(n)||(n=new nt),n.x=s,n.y=a,n.width=i,n.height=o,n};Xi.prototype.equals=function(e){return this===e||l(e)&&this._id===e._id&&h.equals(this._position,e._position)&&this.image===e.image&&this._show===e._show&&this._scale===e._scale&&this._verticalOrigin===e._verticalOrigin&&this._horizontalOrigin===e._horizontalOrigin&&this._heightReference===e._heightReference&&U.equals(this._color,e._color)&&k.equals(this._pixelOffset,e._pixelOffset)&&k.equals(this._translate,e._translate)&&h.equals(this._eyeOffset,e._eyeOffset)&&Kt.equals(this._scaleByDistance,e._scaleByDistance)&&Kt.equals(this._translucencyByDistance,e._translucencyByDistance)&&Kt.equals(this._pixelOffsetScaleByDistance,e._pixelOffsetScaleByDistance)&&Bt.equals(this._distanceDisplayCondition,e._distanceDisplayCondition)&&this._disableDepthTestDistance===e._disableDepthTestDistance&&this._splitDirection===e._splitDirection};Xi.prototype._destroy=function(){l(this._customData)&&(this._billboardCollection._scene.globe._surface.removeTileCustomData(this._customData),this._customData=void 0),l(this._removeCallbackFunc)&&(this._removeCallbackFunc(),this._removeCallbackFunc=void 0),this.image=void 0,this._pickId=this._pickId&&this._pickId.destroy(),this._billboardCollection=void 0};var Mo=Xi;var Gmi=x(T(),1),ult={FONT_SIZE:48,PADDING:10,RADIUS:8,CUTOFF:.25},Da=Object.freeze(ult);var mlt=Mo.SHOW_INDEX,cN=Mo.POSITION_INDEX,WTe=Mo.PIXEL_OFFSET_INDEX,vTe=Mo.EYE_OFFSET_INDEX,hlt=Mo.HORIZONTAL_ORIGIN_INDEX,flt=Mo.VERTICAL_ORIGIN_INDEX,plt=Mo.SCALE_INDEX,CS=Mo.IMAGE_INDEX_INDEX,FTe=Mo.COLOR_INDEX,blt=Mo.ROTATION_INDEX,glt=Mo.ALIGNED_AXIS_INDEX,ITe=Mo.SCALE_BY_DISTANCE_INDEX,PTe=Mo.TRANSLUCENCY_BY_DISTANCE_INDEX,XTe=Mo.PIXEL_OFFSET_SCALE_BY_DISTANCE_INDEX,NTe=Mo.DISTANCE_DISPLAY_CONDITION,ylt=Mo.DISABLE_DEPTH_DISTANCE,xlt=Mo.TEXTURE_COORDINATE_BOUNDS,YTe=Mo.SDF_INDEX,MTe=Mo.SPLIT_DIRECTION_INDEX,Aq=Mo.NUMBER_OF_PROPERTIES,Do={direction:0,positionHighAndScale:1,positionLowAndRotation:2,compressedAttribute0:3,compressedAttribute1:4,compressedAttribute2:5,eyeOffset:6,scaleByDistance:7,pixelOffsetScaleByDistance:8,compressedAttribute3:9,textureCoordinateBoundsOrLabelTranslate:10,a_batchId:11,sdf:12,splitDirection:13};function zm(e){e=e??B.EMPTY_OBJECT,this._scene=e.scene,this._batchTable=e.batchTable;let t=e.textureAtlas;l(t)||(t=new x_),this._textureAtlas=t,this._textureAtlasGUID=t.guid,this._destroyTextureAtlas=!0,this._billboardTextureCache=new Map,this._sp=void 0,this._spTranslucent=void 0,this._rsOpaque=void 0,this._rsTranslucent=void 0,this._vaf=void 0,this._billboards=[],this._billboardsToUpdate=[],this._billboardsToUpdateIndex=0,this._billboardsRemoved=!1,this._createVertexArray=!1,this._shaderRotation=!1,this._compiledShaderRotation=!1,this._shaderAlignedAxis=!1,this._compiledShaderAlignedAxis=!1,this._shaderScaleByDistance=!1,this._compiledShaderScaleByDistance=!1,this._shaderTranslucencyByDistance=!1,this._compiledShaderTranslucencyByDistance=!1,this._shaderPixelOffsetScaleByDistance=!1,this._compiledShaderPixelOffsetScaleByDistance=!1,this._shaderDistanceDisplayCondition=!1,this._compiledShaderDistanceDisplayCondition=!1,this._shaderDisableDepthDistance=!1,this._compiledShaderDisableDepthDistance=!1,this._shaderClampToGround=!1,this._compiledShaderClampToGround=!1,this._propertiesChanged=new Uint32Array(Aq),this._maxSize=0,this._maxEyeOffset=0,this._maxScale=1,this._maxPixelOffset=0,this._allHorizontalCenter=!0,this._allVerticalCenter=!0,this._allSizedInMeters=!0,this._baseVolume=new me,this._baseVolumeWC=new me,this._baseVolume2D=new me,this._boundingVolume=new me,this._boundingVolumeDirty=!1,this._colorCommands=[],this._allBillboardsReady=!1,this.show=e.show??!0,this.modelMatrix=P.clone(e.modelMatrix??P.IDENTITY),this._modelMatrix=P.clone(P.IDENTITY),this.debugShowBoundingVolume=e.debugShowBoundingVolume??!1,this.debugShowTextureAtlas=e.debugShowTextureAtlas??!1,this.blendOption=e.blendOption??Yi.OPAQUE_AND_TRANSLUCENT,this._blendOption=void 0,this._mode=se.SCENE3D,this._buffersUsage=[Pe.STATIC_DRAW,Pe.STATIC_DRAW,Pe.STATIC_DRAW,Pe.STATIC_DRAW,Pe.STATIC_DRAW,Pe.STATIC_DRAW,Pe.STATIC_DRAW,Pe.STATIC_DRAW,Pe.STATIC_DRAW,Pe.STATIC_DRAW,Pe.STATIC_DRAW,Pe.STATIC_DRAW,Pe.STATIC_DRAW,Pe.STATIC_DRAW,Pe.STATIC_DRAW,Pe.STATIC_DRAW,Pe.STATIC_DRAW],this._highlightColor=U.clone(U.WHITE),this._coarseDepthTestDistance=e.coarseDepthTestDistance??ne.default.minimumRadius/10,this._threePointDepthTestDistance=e.threePointDepthTestDistance??ne.default.minimumRadius/1e3,this._uniforms={u_atlas:()=>this.textureAtlas.texture,u_highlightColor:()=>this._highlightColor,u_coarseDepthTestDistance:()=>this._coarseDepthTestDistance,u_threePointDepthTestDistance:()=>this._threePointDepthTestDistance};let n=this._scene;l(n)&&l(n.terrainProviderChanged)&&(this._removeCallbackFunc=n.terrainProviderChanged.addEventListener(function(){let i=this._billboards,o=i.length;for(let r=0;r<o;++r)l(i[r])&&i[r]._updateClamping()},this))}Object.defineProperties(zm.prototype,{length:{get:function(){return Gq(this),this._billboards.length}},textureAtlas:{get:function(){return this._textureAtlas},set:function(e){this._textureAtlas!==e&&(this._textureAtlas=this._destroyTextureAtlas&&this._textureAtlas&&this._textureAtlas.destroy(),this._textureAtlas=e)}},destroyTextureAtlas:{get:function(){return this._destroyTextureAtlas},set:function(e){this._destroyTextureAtlas=e}},sizeInBytes:{get:function(){return this._textureAtlas.sizeInBytes}},ready:{get:function(){return this._allBillboardsReady}},billboardTextureCache:{get:function(){return this._billboardTextureCache}},coarseDepthTestDistance:{get:function(){return this._coarseDepthTestDistance},set:function(e){this._coarseDepthTestDistance=e}},threePointDepthTestDistance:{get:function(){return this._threePointDepthTestDistance},set:function(e){this._threePointDepthTestDistance=e}}});function wTe(e){let t=e.length;for(let n=0;n<t;++n)e[n]&&e[n]._destroy()}zm.prototype.add=function(e){let t=new Mo(e,this);return t._index=this._billboards.length,this._billboards.push(t),this._createVertexArray=!0,t};zm.prototype.remove=function(e){return this.contains(e)?(this._billboards[e._index]=void 0,this._billboardsRemoved=!0,this._createVertexArray=!0,e._destroy(),!0):!1};zm.prototype.removeAll=function(){wTe(this._billboards),this._billboards=[],this._billboardsToUpdate=[],this._billboardsToUpdateIndex=0,this._billboardsRemoved=!1,this._createVertexArray=!0};function Gq(e){if(e._billboardsRemoved){e._billboardsRemoved=!1;let t=[],n=e._billboards,i=n.length;for(let o=0,r=0;o<i;++o){let s=n[o];l(s)&&(s._index=r++,t.push(s))}e._billboards=t}}zm.prototype._updateBillboard=function(e,t){e._dirty||(this._billboardsToUpdate[this._billboardsToUpdateIndex++]=e),++this._propertiesChanged[t]};zm.prototype.contains=function(e){return l(e)&&e._billboardCollection===this};zm.prototype.get=function(e){return Gq(this),this._billboards[e]};function LTe(e){let t=e.cache.billboardCollection_indexBufferInstanced;return l(t)||(t=it.createIndexBuffer({context:e,typedArray:new Uint16Array([0,1,2,0,2,3]),usage:Pe.STATIC_DRAW,indexDatatype:Oe.UNSIGNED_SHORT}),t.vertexArrayDestroyable=!1,e.cache.billboardCollection_indexBufferInstanced=t),t}function Tlt(e){let t=e.cache.billboardCollection_vertexBufferInstanced;return l(t)||(t=it.createVertexBuffer({context:e,typedArray:new Float32Array([0,0,1,0,1,1,0,1]),usage:Pe.STATIC_DRAW}),t.vertexArrayDestroyable=!1,e.cache.billboardCollection_vertexBufferInstanced=t),t}zm.prototype.computeNewBuffersUsage=function(){let e=this._buffersUsage,t=!1,n=this._propertiesChanged;for(let i=0;i<Aq;++i){let o=n[i]===0?Pe.STATIC_DRAW:Pe.STREAM_DRAW;t=t||e[i]!==o,e[i]=o}return t};function _lt(e,t,n,i,o){let r=[{index:Do.positionHighAndScale,componentsPerAttribute:4,componentDatatype:J.FLOAT,usage:n[cN]},{index:Do.positionLowAndRotation,componentsPerAttribute:4,componentDatatype:J.FLOAT,usage:n[cN]},{index:Do.compressedAttribute0,componentsPerAttribute:4,componentDatatype:J.FLOAT,usage:n[WTe]},{index:Do.compressedAttribute1,componentsPerAttribute:4,componentDatatype:J.FLOAT,usage:n[PTe]},{index:Do.compressedAttribute2,componentsPerAttribute:4,componentDatatype:J.FLOAT,usage:n[FTe]},{index:Do.eyeOffset,componentsPerAttribute:4,componentDatatype:J.FLOAT,usage:n[vTe]},{index:Do.scaleByDistance,componentsPerAttribute:4,componentDatatype:J.FLOAT,usage:n[ITe]},{index:Do.pixelOffsetScaleByDistance,componentsPerAttribute:4,componentDatatype:J.FLOAT,usage:n[XTe]},{index:Do.compressedAttribute3,componentsPerAttribute:4,componentDatatype:J.FLOAT,usage:n[NTe]},{index:Do.textureCoordinateBoundsOrLabelTranslate,componentsPerAttribute:4,componentDatatype:J.FLOAT,usage:n[xlt]},{index:Do.splitDirection,componentsPerAttribute:1,componentDatatype:J.FLOAT,usage:n[MTe]},{index:Do.direction,componentsPerAttribute:2,componentDatatype:J.FLOAT,vertexBuffer:Tlt(e)}];return l(i)&&r.push({index:Do.a_batchId,componentsPerAttribute:1,componentDatatype:J.FLOAT,bufferUsage:Pe.STATIC_DRAW}),o&&r.push({index:Do.sdf,componentsPerAttribute:2,componentDatatype:J.FLOAT,usage:n[YTe]}),new db(e,r,t,!0)}var Zq=new An;function kTe(e,t){let n=e.center,i=t.x-n.x,o=t.y-n.y,r=t.z-n.z,s=Math.sqrt(i*i+o*o+r*r);s>e.radius&&(e.radius=s)}function UTe(e,t,n,i){let o=n[Do.positionHighAndScale],r=n[Do.positionLowAndRotation],s=i._getActualPosition();e._mode===se.SCENE3D&&(kTe(e._baseVolume,s),e._boundingVolumeDirty=!0),An.fromCartesian(s,Zq);let a=i.scale,c=i.rotation;c!==0&&(e._shaderRotation=!0),e._maxScale=Math.max(e._maxScale,a);let d=Zq.high,u=Zq.low;o(i._index,d.x,d.y,d.z,a),r(i._index,u.x,u.y,u.z,c)}var Vx=new k,Bm=32768,Lq=65536,Rq=4096,VS=256,Slt=128,Zlt=32,Rlt=8,LB=4,Clt=1/256,DTe=new nt;function OTe(e,t,n,i){let o=n[Do.compressedAttribute0],r=i.pixelOffset,s=r.x,a=r.y,c=i._translate,d=c.x,u=c.y;e._maxPixelOffset=Math.max(e._maxPixelOffset,Math.abs(s+d),Math.abs(-a+u));let m=i.horizontalOrigin,p=i._verticalOrigin,b=i.show&&i.clusterShow;i.color.alpha===0&&(b=!1),p===zn.BASELINE&&(p=zn.BOTTOM),e._allHorizontalCenter=e._allHorizontalCenter&&m===Ui.CENTER,e._allVerticalCenter=e._allVerticalCenter&&p===zn.CENTER;let f=0,y=0;if(i.ready){let L=i.computeTextureCoordinates(DTe);f=L.x,y=L.y}let _=Math.floor(W.clamp(s,-Bm,Bm)+Bm)*Slt;_+=(m+1)*Zlt,_+=(p+1)*Rlt,_+=(b?1:0)*LB;let S=Math.floor(W.clamp(a,-Bm,Bm)+Bm)*VS,Z=Math.floor(W.clamp(d*LB,-Bm,Bm)+Bm)*VS,R=(W.clamp(u*LB,-Bm,Bm)+Bm)*Clt,C=Math.floor(R),E=Math.floor((R-C)*VS);S+=C,Z+=E,Vx.x=f,Vx.y=y;let A=dn.compressTextureCoordinates(Vx);o(i._index,_,S,Z,A)}function BTe(e,t,n,i){let o=n[Do.compressedAttribute1],r=i.alignedAxis;h.equals(r,h.ZERO)||(r=h.normalize(r,new h),e._shaderAlignedAxis=!0);let s=0,a=1,c=1,d=1,u=i.translucencyByDistance;l(u)&&(s=u.near,a=u.nearValue,c=u.far,d=u.farValue,(a!==1||d!==1)&&(e._shaderTranslucencyByDistance=!0));let m=Math.round(i.width??0);e._maxSize=Math.max(e._maxSize,m);let p=W.clamp(m,0,Lq),b=0;Math.abs(h.magnitudeSquared(r)-1)<W.EPSILON6&&(b=dn.octEncodeFloat(r)),a=W.clamp(a,0,1),a=a===1?255:a*255|0,p=p*VS+a,d=W.clamp(d,0,1),d=d===1?255:d*255|0,b=b*VS+d,o(i._index,p,b,s,c)}function Vq(e,t,n,i){let o=n[Do.compressedAttribute2],r=i.color,s=l(e._batchTable)?U.WHITE:i.getPickId(t.context).color,a=i.sizeInMeters?1:0,c=i.alignedAxis,d=h.equals(c,h.ZERO)?c:h.normalize(c,new h),u=Math.abs(h.magnitudeSquared(d)-1)<W.EPSILON6?1:0;e._allSizedInMeters=e._allSizedInMeters&&a===1;let m=i.height??0;e._maxSize=Math.max(e._maxSize,m);let p=i._labelHorizontalOrigin??-2;p+=2;let b=dn.encodeRGB8(r),f=dn.encodeRGB8(s),y=U.floatToByte(r.alpha)*Lq+U.floatToByte(s.alpha)*VS+(a*2+u),_=m*LB+p;o(i._index,b,f,y,_)}function Eq(e,t,n,i){let o=n[Do.eyeOffset],r=i.eyeOffset,s=r.z;if(i._heightReference!==He.NONE&&(s*=1.005),e._maxEyeOffset=Math.max(e._maxEyeOffset,Math.abs(r.x),Math.abs(r.y),Math.abs(s)),Vx.x=0,Vx.y=0,i.ready){let c=i.computeTextureCoordinates(DTe);Vx.x=c.width,Vx.y=c.height}let a=dn.compressTextureCoordinates(Vx);o(i._index,r.x,r.y,s,a)}function zTe(e,t,n,i){let o=n[Do.scaleByDistance],r=0,s=1,a=1,c=1,d=i.scaleByDistance;l(d)&&(r=d.near,s=d.nearValue,a=d.far,c=d.farValue,(s!==1||c!==1)&&(e._shaderScaleByDistance=!0)),o(i._index,r,s,a,c)}function HTe(e,t,n,i){let o=n[Do.pixelOffsetScaleByDistance],r=0,s=1,a=1,c=1,d=i.pixelOffsetScaleByDistance;l(d)&&(r=d.near,s=d.nearValue,a=d.far,c=d.farValue,(s!==1||c!==1)&&(e._shaderPixelOffsetScaleByDistance=!0)),o(i._index,r,s,a,c)}function KTe(e,t,n,i){let o=n[Do.compressedAttribute3],r=0,s=Number.MAX_VALUE,a=i.distanceDisplayCondition;l(a)&&(r=a.near,s=a.far,r*=r,s*=s,e._shaderDistanceDisplayCondition=!0);let c=i.disableDepthTestDistance,d=bs(i.heightReference)&&t.context.depthTexture;c*=c,(d||c>0)&&(e._shaderDisableDepthDistance=!0,c===Number.POSITIVE_INFINITY&&(c=-1));let u,m;l(i._labelDimensions)?(m=i._labelDimensions.x,u=i._labelDimensions.y):(m=i.width??0,u=i.height??0);let p=Math.floor(W.clamp(m,0,Rq)),b=Math.floor(W.clamp(u,0,Rq)),f=p*Rq+b;o(i._index,r,s,c,f)}function JTe(e,t,n,i){if(bs(i.heightReference)){let a=e._scene,c=t.context,d=t.globeTranslucencyState.translucent,u=l(a.globe)&&a.globe.depthTestAgainstTerrain;e._shaderClampToGround=c.depthTexture&&!d&&u}let o=n[Do.textureCoordinateBoundsOrLabelTranslate],r=0,s=0;l(i._labelTranslate)&&(r=i._labelTranslate.x,s=i._labelTranslate.y),o(i._index,r,s,0,0)}function Vlt(e,t,n,i){if(!l(e._batchTable))return;let o=n[Do.a_batchId],r=i._batchIndex;o(i._index,r)}function jTe(e,t,n,i){if(!e._sdf)return;let o=n[Do.sdf],r=i.outlineColor,s=i.outlineWidth,a=dn.encodeRGB8(r),c=s/Da.RADIUS,d=U.floatToByte(r.alpha)*Lq+U.floatToByte(c)*VS;o(i._index,a,d)}function QTe(e,t,n,i){let o=n[Do.splitDirection],r=0,s=i.splitDirection;l(s)&&(r=s),o(i._index,r)}function Elt(e,t,n,i){UTe(e,t,n,i),OTe(e,t,n,i),BTe(e,t,n,i),Vq(e,t,n,i),Eq(e,t,n,i),zTe(e,t,n,i),HTe(e,t,n,i),KTe(e,t,n,i),JTe(e,t,n,i),Vlt(e,t,n,i),jTe(e,t,n,i),QTe(e,t,n,i)}function Cq(e,t,n,i,o,r){let s;i.mode===se.SCENE3D?(s=e._baseVolume,e._boundingVolumeDirty=!0):s=e._baseVolume2D;let a=[];for(let c=0;c<n;++c){let d=t[c],u=d.position,m=Mo._computeActualPosition(d,u,i,o);l(m)&&(d._setActualPosition(m),r?a.push(m):kTe(s,m))}r&&me.fromPoints(a,s)}function Alt(e,t){let n=t.mode,i=e._billboards,o=e._billboardsToUpdate,r=e._modelMatrix;e._createVertexArray||e._mode!==n||n!==se.SCENE3D&&!P.equals(r,e.modelMatrix)?(e._mode=n,P.clone(e.modelMatrix,r),e._createVertexArray=!0,(n===se.SCENE3D||n===se.SCENE2D||n===se.COLUMBUS_VIEW)&&Cq(e,i,i.length,t,r,!0)):n===se.MORPHING?Cq(e,i,i.length,t,r,!0):(n===se.SCENE2D||n===se.COLUMBUS_VIEW)&&Cq(e,o,e._billboardsToUpdateIndex,t,r,!1)}function Glt(e,t,n){let i=1;(!e._allSizedInMeters||e._maxPixelOffset!==0)&&(i=t.camera.getPixelSize(n,t.context.drawingBufferWidth,t.context.drawingBufferHeight));let o=i*e._maxScale*e._maxSize*2;e._allHorizontalCenter&&e._allVerticalCenter&&(o*=.5);let r=i*e._maxPixelOffset+e._maxEyeOffset;n.radius+=o+r}function Llt(e,t){let i=t.createViewportQuadCommand(`uniform sampler2D billboard_texture; -in vec2 v_textureCoordinates; +`;function xZe(){}xZe.buildModelDrawCommand=function(e,t){let n=e.shaderBuilder,i=zdt(e,n,t),o=Hdt(e,i,t),r=e.model;return l(r.classificationType)?new wN({primitiveRenderResources:e,command:o}):new kN({primitiveRenderResources:e,command:o})};function zdt(e,t,n){t.addVertexLines(UN),t.addFragmentLines(DN);let i=e.model,o=t.buildShaderProgram(n.context);return i._pipelineResources.push(o),o}function Hdt(e,t,n){let i=Kdt(e),o=new Un({context:n.context,indexBuffer:i,attributes:e.attributes}),r=e.model;r._pipelineResources.push(o);let s=e.alphaOptions.pass,a=r.sceneGraph,c=n.mode===se.SCENE3D,d,u;if(!c&&!n.scene3DOnly&&r._projectTo2D)d=P.multiplyTransformation(a._computedModelMatrix,e.runtimeNode.computedTransform,new P),u=e.runtimePrimitive.boundingSphere2D;else{let Z=c?a._computedModelMatrix:a._computedModelMatrix2D;d=P.multiplyTransformation(Z,e.runtimeNode.computedTransform,new P),u=me.transform(e.boundingSphere,d)}let m=$e(ze.fromCache(e.renderStateOptions),!0);m.cull.face=Zt.getCullFace(d,e.primitiveType),m=ze.fromCache(m);let p=l(r.classificationType),b=p?!1:Wn.castShadows(r.shadows),f=p?!1:Wn.receiveShadows(r.shadows),y=p?void 0:e.pickId,_=p?void 0:e.snapId;return new lt({boundingVolume:u,modelMatrix:d,uniformMap:e.uniformMap,renderState:m,vertexArray:o,shaderProgram:t,cull:r.cull,pass:s,count:e.count,owner:r,pickId:y,snapId:_,pickMetadataAllowed:!0,instanceCount:e.instanceCount,primitiveType:e.primitiveType,debugShowBoundingVolume:r.debugShowBoundingVolume,castShadows:b,receiveShadows:f})}function Kdt(e){let t=e.wireframeIndexBuffer;if(l(t))return t;let n=e.indices;if(l(n))return n.buffer}var ON=xZe;function hl(e){e=e??B.EMPTY_OBJECT;let t=e.modelComponents;this._model=e.model,this._components=t,this._pipelineStages=[],this._updateStages=[],this._runtimeNodes=[],this._rootNodes=[],this._skinnedNodes=[],this._runtimeSkins=[],this.modelPipelineStages=[],this._boundingSphere=void 0,this._positionMin=void 0,this._positionMax=void 0,this._boundingSphere2D=void 0,this._computedModelMatrix=P.clone(P.IDENTITY),this._computedModelMatrix2D=P.clone(P.IDENTITY),this._axisCorrectionMatrix=Zt.getAxisCorrectionMatrix(t.upAxis,t.forwardAxis,new P),this._runtimeArticulations={},Jdt(this)}Object.defineProperties(hl.prototype,{components:{get:function(){return this._components}},computedModelMatrix:{get:function(){return this._computedModelMatrix}},axisCorrectionMatrix:{get:function(){return this._axisCorrectionMatrix}},boundingSphere:{get:function(){return this._boundingSphere}}});function Jdt(e){let t=e._components,n=t.scene,o=e._model.modelMatrix;TZe(e,o);let r=t.articulations,s=r.length,a=e._runtimeArticulations;for(let Z=0;Z<s;Z++){let R=r[Z],C=new tX({articulation:R,sceneGraph:e}),E=C.name;a[E]=C}let c=t.nodes,d=c.length;e._runtimeNodes=new Array(d);let m=n.nodes.length,p=P.IDENTITY;for(let Z=0;Z<m;Z++){let R=n.nodes[Z],C=_Ze(e,R,p);e._rootNodes.push(C)}let b=t.skins,f=e._runtimeSkins,y=b.length;for(let Z=0;Z<y;Z++){let R=b[Z];f.push(new GN({skin:R,sceneGraph:e}))}let _=e._skinnedNodes,S=_.length;for(let Z=0;Z<S;Z++){let R=_[Z],C=e._runtimeNodes[R],A=c[R].skin.index;C._runtimeSkin=f[A],C.updateJointMatrices()}e.applyArticulations()}function TZe(e,t){let n=e._components,i=e._model;e._computedModelMatrix=P.multiplyTransformation(t,n.transform,e._computedModelMatrix),e._computedModelMatrix=P.multiplyTransformation(e._computedModelMatrix,e._axisCorrectionMatrix,e._computedModelMatrix),e._computedModelMatrix=P.multiplyByUniformScale(e._computedModelMatrix,i.computedScale,e._computedModelMatrix)}var jdt=new h;function Qdt(e,t){let n=e._computedModelMatrix,i=P.getTranslation(n,jdt);if(!h.equals(i,h.ZERO))e._computedModelMatrix2D=_t.basisTo2D(t.mapProjection,n,e._computedModelMatrix2D);else{let o=e.boundingSphere.center,r=_t.ellipsoidTo2DModelMatrix(t.mapProjection,o,e._computedModelMatrix2D);e._computedModelMatrix2D=P.multiply(r,n,e._computedModelMatrix2D)}e._boundingSphere2D=me.transform(e._boundingSphere,e._computedModelMatrix2D,e._boundingSphere2D)}function _Ze(e,t,n){let i=[],o=Zt.getNodeTransform(t),r=t.children.length;for(let u=0;u<r;u++){let m=t.children[u],p=P.multiplyTransformation(n,o,new P),b=_Ze(e,m,p);i.push(b)}let s=new xX({node:t,transform:o,transformToRoot:n,children:i,sceneGraph:e}),a=t.primitives.length;for(let u=0;u<a;u++)s.runtimePrimitives.push(new AN({primitive:t.primitives[u],node:t,model:e._model}));let c=t.index;e._runtimeNodes[c]=s,l(t.skin)&&e._skinnedNodes.push(c);let d=t.name;if(l(d)){let u=e._model,m=new uX(u,s);u._nodesByName[d]=m}return c}var qdt=new h,$dt=new h,eut=new h,tut=new h;hl.prototype.buildDrawCommands=function(e){let t=this.buildRenderResources(e);this.computeBoundingVolumes(t),this.createDrawCommands(t,e)};hl.prototype.buildRenderResources=function(e){let t=this._model,n=new LN(t);t.statistics.clear(),this.configurePipeline(e);let i=this.modelPipelineStages;for(let o=0;o<i.length;o++)i[o].process(n,t,e);for(let o=0;o<this._runtimeNodes.length;o++){let r=this._runtimeNodes[o];if(!l(r))continue;r.configurePipeline();let s=r.pipelineStages,a=new XN(n,r);n.nodeRenderResources[o]=a;for(let c=0;c<s.length;c++)s[c].process(a,r.node,e);for(let c=0;c<r.runtimePrimitives.length;c++){let d=r.runtimePrimitives[c];d.configurePipeline(e);let u=d.pipelineStages,m=new YN(a,d);a.primitiveRenderResources[c]=m;for(let p=0;p<u.length;p++)u[p].process(m,d.primitive,e)}}return n};hl.prototype.computeBoundingVolumes=function(e){let t=this._model,n=h.fromElements(Number.MAX_VALUE,Number.MAX_VALUE,Number.MAX_VALUE,qdt),i=h.fromElements(-Number.MAX_VALUE,-Number.MAX_VALUE,-Number.MAX_VALUE,$dt);for(let o=0;o<this._runtimeNodes.length;o++){let r=this._runtimeNodes[o];if(!l(r))continue;let s=e.nodeRenderResources[o],a=r.computedTransform;for(let c=0;c<r.runtimePrimitives.length;c++){let d=r.runtimePrimitives[c],u=s.primitiveRenderResources[c];d.boundingSphere=me.clone(u.boundingSphere,new me);let m=P.multiplyByPoint(a,u.positionMin,eut),p=P.multiplyByPoint(a,u.positionMax,tut);h.minimumByComponent(n,m,n),h.minimumByComponent(n,p,n),h.maximumByComponent(i,p,i),h.maximumByComponent(i,m,i)}}this._positionMin=h.clone(n,this._positionMin),this._positionMax=h.clone(i,this._positionMax),this._boundingSphere=me.fromCornerPoints(n,i,new me),this._boundingSphere=me.transformWithoutScale(this._boundingSphere,this._axisCorrectionMatrix,this._boundingSphere),this._boundingSphere=me.transform(this._boundingSphere,this._components.transform,this._boundingSphere),t._boundingSphere=me.transform(this._boundingSphere,t.modelMatrix,t._boundingSphere),t._initialRadius=t._boundingSphere.radius,t._boundingSphere.radius*=t._clampedScale};hl.prototype.createDrawCommands=function(e,t){for(let n=0;n<this._runtimeNodes.length;n++){let i=this._runtimeNodes[n];if(!l(i))continue;let o=e.nodeRenderResources[n];for(let r=0;r<i.runtimePrimitives.length;r++){let s=i.runtimePrimitives[r],a=o.primitiveRenderResources[r],c=ON.buildModelDrawCommand(a,t);s.drawCommand=c}}};hl.prototype.configurePipeline=function(e){let t=this.modelPipelineStages;t.length=0;let n=this._model,i=e.fog.enabled&&e.fog.renderable;if(l(n.color)&&t.push(_x),l(n.classificationType))return;n.imageBasedLighting.enabled&&t.push($P),n.isClippingEnabled()&&t.push(oX);let o=(n._clippingPolygonData?.polygonRings.length??0)>0;n.isClippingPolygonsEnabled()&&o&&t.push(aX),n.hasDrapedVectors()&&t.push(dX),n.hasSilhouette(e)&&t.push(FN),l(n.splitDirection)&&n.splitDirection!==Ur.NONE&&t.push(PN),Br.is3DTiles(n.type)&&t.push(KP),i&&t.push(QP)};hl.prototype.update=function(e,t){let n,i,o;for(n=0;n<this._runtimeNodes.length;n++){let r=this._runtimeNodes[n];if(!l(r))continue;for(i=0;i<r.updateStages.length;i++)r.updateStages[i].update(r,this,e);let s=e.mode!==se.SCENE3D&&this._model._projectTo2D;for(t&&!s&&this.updateJointMatrices(),i=0;i<r.runtimePrimitives.length;i++){let a=r.runtimePrimitives[i];for(o=0;o<a.updateStages.length;o++)a.updateStages[o].update(a,this)}}};hl.prototype.updateModelMatrix=function(e,t){TZe(this,e),t.mode!==se.SCENE3D&&Qdt(this,t);let n=this._rootNodes;for(let i=0;i<n.length;i++){let o=this._runtimeNodes[n[i]];o._transformDirty=!0}};hl.prototype.updateJointMatrices=function(){let e=this._skinnedNodes,t=e.length;for(let n=0;n<t;n++){let i=e[n];this._runtimeNodes[i].updateJointMatrices()}};function SZe(e,t,n,i,o){if(n&&!t.show)return;let r=t.children.length;for(let c=0;c<r;c++){let d=t.getChild(c);SZe(e,d,n,i,o)}let s=t.runtimePrimitives,a=s.length;for(let c=0;c<a;c++){let d=s[c];i(d,o)}}function JB(e,t,n,i){let o=e._rootNodes,r=o.length;for(let s=0;s<r;s++){let a=o[s],c=e._runtimeNodes[a];SZe(e,c,t,n,i)}}var nut={backFaceCulling:void 0};hl.prototype.updateBackFaceCulling=function(e){let t=nut;t.backFaceCulling=e,JB(this,!1,iut,t)};function iut(e,t){let n=e.drawCommand;n.backFaceCulling=t.backFaceCulling}var out={shadowMode:void 0};hl.prototype.updateShadows=function(e){let t=out;t.shadowMode=e,JB(this,!1,rut,t)};function rut(e,t){let n=e.drawCommand;n.shadows=t.shadowMode}var sut={debugShowBoundingVolume:void 0};hl.prototype.updateShowBoundingVolume=function(e){let t=sut;t.debugShowBoundingVolume=e,JB(this,!1,aut,t)};function aut(e,t){let n=e.drawCommand;n.debugShowBoundingVolume=t.debugShowBoundingVolume}var ZZe=[],RZe=[],CZe=[],cut={frameState:void 0,hasSilhouette:void 0};hl.prototype.pushDrawCommands=function(e){let t=ZZe;t.length=0;let n=RZe;n.length=0;let i=CZe;i.length=0;let o=cut;o.hasSilhouette=this._model.hasSilhouette(e),o.frameState=e,JB(this,!0,lut,o),ei(e.commandList,t),ei(e.commandList,n),ei(e.commandList,i)};function lut(e,t){let n=t.frameState,i=t.hasSilhouette,o=n.passes,r=ZZe,s=RZe,a=CZe,c=e.drawCommand;c.pushCommands(n,n.commandList);let d=e.primitive.material;l(d)&&l(d.planarFill)&&(n.planarFillRequested=!0),i&&!o.pick&&c.pushSilhouetteCommands(n,r),l(c.pushEdgeCommands)&&c.pushEdgeCommands(n,s),l(c.pushPlanarFillIdCommands)&&c.pushPlanarFillIdCommands(n,a)}hl.prototype.setArticulationStage=function(e,t){let n=e.split(" ");if(n.length!==2)return;let i=n[0],o=n[1],r=this._runtimeArticulations[i];l(r)&&r.setArticulationStage(o,t)};hl.prototype.applyArticulations=function(){let e=this._runtimeArticulations;for(let t in e)e.hasOwnProperty(t)&&e[t].apply()};var BN=hl;var t1i=x(T(),1);function Vx(){this.pointsLength=0,this.trianglesLength=0,this.geometryByteLength=0,this.texturesByteLength=0,this.propertyTablesByteLength=0,this._bufferIdSet={},this._textureIdByteLengths={},this._batchTextureIdMap=new kt}Object.defineProperties(Vx.prototype,{batchTexturesByteLength:{get:function(){let e=this._batchTextureIdMap.length,t=this._batchTextureIdMap.values,n=0;for(let i=0;i<e;i++)n+=t[i].byteLength;return n}}});Vx.prototype.clear=function(){this.pointsLength=0,this.trianglesLength=0,this.geometryByteLength=0,this.texturesByteLength=0,this.propertyTablesByteLength=0,this._bufferIdSet={},this._textureIdByteLengths={},this._batchTextureIdMap.removeAll()};Vx.prototype.addBuffer=function(e,t){if(!this._bufferIdSet.hasOwnProperty(e._id)){let n=t?2:1;this.geometryByteLength+=e.sizeInBytes*n}this._bufferIdSet[e._id]=!0};Vx.prototype.addTexture=function(e){this._textureIdByteLengths.hasOwnProperty(e._id)||(this.texturesByteLength+=e.sizeInBytes,this._textureIdByteLengths[e._id]=e.sizeInBytes)};Vx.prototype.getTextureIds=function(){return Object.keys(this._textureIdByteLengths)};Vx.prototype.getTextureByteLengthById=function(e){return this._textureIdByteLengths[e]};Vx.prototype.addBatchTexture=function(e){this._batchTextureIdMap.contains(e._id)||this._batchTextureIdMap.set(e._id,e)};var zN=Vx;var Y1i=x(T(),1);var GZe=x(eD(),1);var f1i=x(T(),1);var VZe={},kS=Uint32Array.BYTES_PER_ELEMENT;VZe.parse=function(e,t){t=t??0;let n=new Uint8Array(e),i=new DataView(e);t+=kS;let o=i.getUint32(t,!0);if(o!==1)throw new ae(`Only Point Cloud tile version 1 is supported. Version ${o} is not.`);t+=kS,t+=kS;let r=i.getUint32(t,!0);if(r===0)throw new ae("Feature table must have a byte length greater than zero");t+=kS;let s=i.getUint32(t,!0);t+=kS;let a=i.getUint32(t,!0);t+=kS;let c=i.getUint32(t,!0);t+=kS;let d=Pr(n,t,r);t+=r;let u=new Uint8Array(e,t,s);t+=s;let m,p;a>0&&(m=Pr(n,t,a),Object.keys(m).length===0&&(m=void 0),t+=a,c>0&&(p=new Uint8Array(e,t,c),p=new Uint8Array(p)));let b=new Tf(d,u),f=b.getGlobalProperty("POINTS_LENGTH");if(b.featuresLength=f,!l(f))throw new ae("Feature table global property: POINTS_LENGTH must be defined");let y=b.getGlobalProperty("RTC_CENTER",J.FLOAT,3);l(y)&&(y=h.unpack(y));let _=uut(b,m);if(_.rtcCenter=y,_.pointsLength=f,!_.hasPositions){let S=mut(b);_.positions=S,_.hasPositions=_.hasPositions||l(S)}if(!_.hasPositions)throw new ae("Either POSITION or POSITION_QUANTIZED must be defined.");if(!_.hasNormals){let S=fut(b);_.normals=S,_.hasNormals=_.hasNormals||l(S)}if(!_.hasColors){let S=hut(b);_.colors=S,_.hasColors=_.hasColors||l(S),_.hasConstantColor=l(_.constantColor),_.isTranslucent=l(S)&&S.isTranslucent}if(!_.hasBatchIds){let S=put(b);_.batchIds=S,_.hasBatchIds=_.hasBatchIds||l(S)}if(_.hasBatchIds){let S=b.getGlobalProperty("BATCH_LENGTH");if(!l(S))throw new ae("Global property: BATCH_LENGTH must be defined when BATCH_ID is defined.");_.batchLength=S}return(l(m)||l(p))&&(_.batchTableJson=m,_.batchTableBinary=p),dut(_),_};function dut(e){let t=e.batchTableJson;if(!l(t))return;let n=e.batchTableBinary;if(l(n))return;let i=Object.keys(e.draco?.batchTableProperties??{}),o=[];for(let r of Object.keys(t)){let a=t[r].byteOffset;l(a)&&(i.includes(r)||o.push(r))}for(let r of o)xt("PntsParser-invalidBinaryBodyReference",`The point cloud data contained a binary property ${r} that could not be resolved - skipping`),delete t[r]}function uut(e,t){let n=e.json,i,o,r,s=l(n.extensions)?n.extensions["3DTILES_draco_point_compression"]:void 0,a=l(t)&&l(t.extensions)?t.extensions["3DTILES_draco_point_compression"]:void 0;l(a)&&(r=a.properties);let c,d,u,m,p;if(l(s)){o=s.properties;let f=s.byteOffset,y=s.byteLength;if(!l(o)||!l(f)||!l(y))throw new ae("Draco properties, byteOffset, and byteLength must be defined");i=e.buffer.slice(f,f+y),c=l(o.POSITION),d=l(o.RGB)||l(o.RGBA),u=l(o.NORMAL),m=l(o.BATCH_ID),p=l(o.RGBA)}let b;return l(i)&&(b={buffer:i,featureTableProperties:o,batchTableProperties:r,properties:It(o,r),dequantizeInShader:!0}),{draco:b,hasPositions:c,hasColors:d,isTranslucent:p,hasNormals:u,hasBatchIds:m}}function mut(e){let t=e.json,n;if(l(t.POSITION))return n=e.getPropertyArray("POSITION",J.FLOAT,3),{name:dt.POSITION,semantic:dt.POSITION,typedArray:n,isQuantized:!1,componentDatatype:J.FLOAT,type:Dt.VEC3};if(l(t.POSITION_QUANTIZED)){n=e.getPropertyArray("POSITION_QUANTIZED",J.UNSIGNED_SHORT,3);let i=e.getGlobalProperty("QUANTIZED_VOLUME_SCALE",J.FLOAT,3);if(!l(i))throw new ae("Global property: QUANTIZED_VOLUME_SCALE must be defined for quantized positions.");let o=65535,r=e.getGlobalProperty("QUANTIZED_VOLUME_OFFSET",J.FLOAT,3);if(!l(r))throw new ae("Global property: QUANTIZED_VOLUME_OFFSET must be defined for quantized positions.");return{name:dt.POSITION,semantic:dt.POSITION,typedArray:n,isQuantized:!0,componentDatatype:J.FLOAT,type:Dt.VEC3,quantizedRange:o,quantizedVolumeOffset:h.unpack(r),quantizedVolumeScale:h.unpack(i),quantizedComponentDatatype:J.UNSIGNED_SHORT,quantizedType:Dt.VEC3}}}function hut(e){let t=e.json,n;if(l(t.RGBA))return n=e.getPropertyArray("RGBA",J.UNSIGNED_BYTE,4),{name:dt.COLOR,semantic:dt.COLOR,setIndex:0,typedArray:n,componentDatatype:J.UNSIGNED_BYTE,type:Dt.VEC4,normalized:!0,isRGB565:!1,isTranslucent:!0};if(l(t.RGB))return n=e.getPropertyArray("RGB",J.UNSIGNED_BYTE,3),{name:"COLOR",semantic:dt.COLOR,setIndex:0,typedArray:n,componentDatatype:J.UNSIGNED_BYTE,type:Dt.VEC3,normalized:!0,isRGB565:!1,isTranslucent:!1};if(l(t.RGB565))return n=e.getPropertyArray("RGB565",J.UNSIGNED_SHORT,1),{name:"COLOR",semantic:dt.COLOR,setIndex:0,typedArray:n,componentDatatype:J.FLOAT,type:Dt.VEC3,normalized:!1,isRGB565:!0,isTranslucent:!1};if(l(t.CONSTANT_RGBA)){let i=e.getGlobalProperty("CONSTANT_RGBA",J.UNSIGNED_BYTE,4),o=i[3],r=U.fromBytes(i[0],i[1],i[2],o),s=o<255;return{name:dt.COLOR,semantic:dt.COLOR,setIndex:0,constantColor:r,componentDatatype:J.FLOAT,type:Dt.VEC4,isQuantized:!1,isTranslucent:s}}}function fut(e){let t=e.json,n;if(l(t.NORMAL))return n=e.getPropertyArray("NORMAL",J.FLOAT,3),{name:dt.NORMAL,semantic:dt.NORMAL,typedArray:n,octEncoded:!1,octEncodedZXY:!1,componentDatatype:J.FLOAT,type:Dt.VEC3};if(l(t.NORMAL_OCT16P))return n=e.getPropertyArray("NORMAL_OCT16P",J.UNSIGNED_BYTE,2),{name:dt.NORMAL,semantic:dt.NORMAL,typedArray:n,octEncoded:!0,octEncodedZXY:!1,quantizedRange:(1<<8)-1,quantizedType:Dt.VEC2,quantizedComponentDatatype:J.UNSIGNED_BYTE,componentDatatype:J.FLOAT,type:Dt.VEC3}}function put(e){let t=e.json;if(l(t.BATCH_ID)){let n=e.getPropertyArray("BATCH_ID",J.UNSIGNED_SHORT,1);return{name:dt.FEATURE_ID,semantic:dt.FEATURE_ID,setIndex:0,typedArray:n,componentDatatype:J.fromTypedArray(n),type:Dt.SCALAR}}}var US=VZe;var but=Vn.Components,gut=Vn.Scene,yut=Vn.Node,xut=Vn.Primitive,Tut=Vn.Attribute,EZe=Vn.Quantization,_ut=Vn.FeatureIdAttribute,Sut=Vn.Material,Zut=Vn.MetallicRoughness,i$=class extends oo{constructor(t){super(),t=t??B.EMPTY_OBJECT;let n=t.arrayBuffer,i=t.byteOffset??0;this._arrayBuffer=n,this._byteOffset=i,this._loadAttributesFor2D=t.loadAttributesFor2D??!1,this._parsedContent=void 0,this._decodePromise=void 0,this._decodedAttributes=void 0,this._promise=void 0,this._error=void 0,this._state=Rt.UNLOADED,this._buffers=[],this._components=void 0,this._transform=P.IDENTITY}get cacheKey(){}get components(){return this._components}get transform(){return this._transform}load(){if(l(this._promise))return this._promise;this._parsedContent=US.parse(this._arrayBuffer,this._byteOffset),this._state=Rt.PROCESSING,this._promise=Promise.resolve(this)}process(t){if(l(this._error)){let n=this._error;throw this._error=void 0,n}if(this._state===Rt.READY)return!0;if(this._state===Rt.PROCESSING){if(l(this._decodePromise))return!1;this._decodePromise=Rut(this,t.context)}return!1}unload(){let t=this._buffers;for(let n=0;n<t.length;n++)t[n].destroy();t.length=0,this._components=void 0,this._parsedContent=void 0,this._arrayBuffer=void 0}};function Rut(e,t){let i=e._parsedContent.draco,o;if(l(i)?o=Bb.decodePointCloud(i,t):o=Promise.resolve(),!!l(o))return e._decodePromise=o,o.then(function(r){if(!e.isDestroyed())return l(r)&&Cut(e,i,r),Xut(e,t),e._state=Rt.READY,e}).catch(function(r){e.unload(),e._state=Rt.FAILED;let s="Failed to load Draco pnts";e._error=e.getError(s,r)})}function Cut(e,t,n){e._state=Rt.READY;let i=e._parsedContent,o;if(l(n.POSITION)){if(o={name:"POSITION",semantic:dt.POSITION,typedArray:n.POSITION.array,componentDatatype:J.FLOAT,type:Dt.VEC3,isQuantized:!1},l(n.POSITION.data.quantization)){let a=n.POSITION.data.quantization,c=a.range,d=h.fromElements(c,c,c),u=h.unpack(a.minValues),m=(1<<a.quantizationBits)-1;o.isQuantized=!0,o.quantizedRange=m,o.quantizedVolumeOffset=u,o.quantizedVolumeScale=d,o.quantizedComponentDatatype=m<=255?J.UNSIGNED_BYTE:J.UNSIGNED_SHORT,o.quantizedType=Dt.VEC3}i.positions=o}if(l(n.NORMAL)){if(o={name:"NORMAL",semantic:dt.NORMAL,typedArray:n.NORMAL.array,componentDatatype:J.FLOAT,type:Dt.VEC3,isQuantized:!1,octEncoded:!1,octEncodedZXY:!1},l(n.NORMAL.data.quantization)){let a=(1<<n.NORMAL.data.quantization.quantizationBits)-1;o.quantizedRange=a,o.octEncoded=!0,o.octEncodedZXY=!0,o.quantizedComponentDatatype=J.UNSIGNED_BYTE,o.quantizedType=Dt.VEC2}i.normals=o}if(l(n.RGBA)?i.colors={name:"COLOR",semantic:dt.COLOR,setIndex:0,typedArray:n.RGBA.array,componentDatatype:J.UNSIGNED_BYTE,type:Dt.VEC4,normalized:!0,isTranslucent:!0}:l(n.RGB)&&(i.colors={name:"COLOR",semantic:dt.COLOR,setIndex:0,typedArray:n.RGB.array,componentDatatype:J.UNSIGNED_BYTE,type:Dt.VEC3,normalized:!0,isTranslucent:!1}),l(n.BATCH_ID)){let a=n.BATCH_ID.array;i.batchIds={name:"_FEATURE_ID",semantic:dt.FEATURE_ID,setIndex:0,typedArray:a,componentDatatype:J.fromTypedArray(a),type:Dt.SCALAR}}let r=i.batchTableJson,s=t.batchTableProperties;for(let a in s)if(s.hasOwnProperty(a)){let c=n[a];l(r)||(r={}),i.hasDracoBatchTable=!0;let d=c.data;r[a]={byteOffset:d.byteOffset,type:Vut(d.componentsPerAttribute),componentType:Eut(d.componentDatatype),typedArray:c.array}}i.batchTableJson=r}function Vut(e){switch(e){case 1:return"SCALAR";case 2:return"VEC2";case 3:return"VEC3";case 4:return"VEC4"}}function Eut(e){switch(e){case ie.BYTE:return"BYTE";case ie.UNSIGNED_BYTE:return"UNSIGNED_BYTE";case ie.SHORT:return"SHORT";case ie.UNSIGNED_SHORT:return"UNSIGNED_SHORT";case ie.INT:return"INT";case ie.UNSIGNED_INT:return"UNSIGNED_INT";case ie.DOUBLE:return"DOUBLE";case ie.FLOAT:return"FLOAT"}}function HN(e,t,n){let i=t.typedArray,o;if(t.octEncoded&&(o=new EZe,o.octEncoded=t.octEncoded,o.octEncodedZXY=t.octEncodedZXY,o.normalizationRange=t.quantizedRange,o.type=t.quantizedType,o.componentDatatype=t.quantizedComponentDatatype),t.isQuantized){o=new EZe;let a=t.quantizedRange;o.normalizationRange=a,o.quantizedVolumeOffset=h.ZERO;let c=t.quantizedVolumeScale;o.quantizedVolumeDimensions=c,o.quantizedVolumeStepSize=h.divideByScalar(c,a,new h),o.componentDatatype=t.quantizedComponentDatatype,o.type=t.quantizedType}let r=new Tut;if(r.name=t.name,r.semantic=t.semantic,r.setIndex=t.setIndex,r.componentDatatype=t.componentDatatype,r.type=t.type,r.normalized=t.normalized??!1,r.min=t.min,r.max=t.max,r.quantization=o,t.isRGB565&&(i=dn.decodeRGB565(i)),l(t.constantColor)){let a=new Array(4);r.constant=U.pack(t.constantColor,a)}else{let a=it.createVertexBuffer({typedArray:i,context:n,usage:Pe.STATIC_DRAW});a.vertexArrayDestroyable=!1,e._buffers.push(a),r.buffer=a}let s=e._loadAttributesFor2D;return r.semantic===dt.POSITION&&s&&(r.typedArray=i),r}var AZe,jB;function Aut(e){if(!l(jB)){AZe=new GZe.default(0),jB=new Array(e);for(let t=0;t<e;++t)jB[t]=AZe.random()}return jB}var Gut=new h,Lut=new h,Wut=new h;function vut(e){let t=e.typedArray,n=20,i=t.length/3,o=Math.min(i,n),r=Aut(n),s=Number.MAX_VALUE,a=-Number.MAX_VALUE,c=h.fromElements(s,s,s,Gut),d=h.fromElements(a,a,a,Lut),u,m,p;if(e.isQuantized)c=h.ZERO,d=e.quantizedVolumeScale;else for(u=0;u<o;++u)m=Math.floor(r[u]*i),p=h.unpack(t,m*3,Wut),h.minimumByComponent(c,p,c),h.maximumByComponent(d,p,d);e.min=h.clone(c),e.max=h.clone(d)}var Fut={name:dt.COLOR,semantic:dt.COLOR,setIndex:0,constantColor:U.DARKGRAY,componentDatatype:J.FLOAT,type:Dt.VEC4,isQuantized:!1,isTranslucent:!1};function Iut(e,t,n){let i=[],o,r=t.positions;return l(r)&&(vut(r),o=HN(e,r,n),o.count=t.pointsLength,i.push(o)),l(t.normals)&&(o=HN(e,t.normals,n),o.count=t.pointsLength,i.push(o)),l(t.colors)?(o=HN(e,t.colors,n),o.count=t.pointsLength,i.push(o)):(o=HN(e,Fut,n),o.count=t.pointsLength,i.push(o)),l(t.batchIds)&&(o=HN(e,t.batchIds,n),o.count=t.pointsLength,i.push(o)),i}function Put(e,t){let n=e.batchLength,i=e.pointsLength,o=e.batchTableJson,r=e.batchTableBinary,s=!l(e.batchIds);return l(r)||l(o)||e.hasDracoBatchTable?jb({count:n??i,batchTable:o,binaryBody:r,parseAsPropertyAttributes:s,customAttributeOutput:t}):new Ua({schema:{},propertyTables:[]})}function Xut(e,t){let n=e._parsedContent,i=new Zut;i.metallicFactor=0,i.roughnessFactor=.9;let o=new Sut;o.metallicRoughness=i;let r=n.colors;l(r)&&r.isTranslucent&&(o.alphaMode=Bp.BLEND);let s=!l(n.normals);o.unlit=s;let a=new xut;if(a.attributes=Iut(e,n,t),a.primitiveType=Ie.POINTS,a.material=o,l(n.batchIds)){let b=new _ut;b.propertyTableId=0,b.setIndex=0,b.positionalLabel="featureId_0",a.featureIds.push(b)}let c=new yut;c.index=0,c.primitives=[a];let d=new gut;d.nodes=[c],d.upAxis=Bi.Z,d.forwardAxis=Bi.X;let u=new but;u.scene=d,u.nodes=[c];let m=[];u.structuralMetadata=Put(n,m),m.length>0&&Nut(e,a,m,t),l(n.rtcCenter)&&(u.transform=P.multiplyByTranslation(u.transform,n.rtcCenter,u.transform));let p=n.positions;l(p)&&p.isQuantized&&(u.transform=P.multiplyByTranslation(u.transform,p.quantizedVolumeOffset,u.transform)),e._components=u,e._parsedContent=void 0,e._arrayBuffer=void 0}function Nut(e,t,n,i){let o=t.attributes,r=n.length;for(let s=0;s<r;s++){let a=n[s],c=it.createVertexBuffer({typedArray:a.typedArray,context:i,usage:Pe.STATIC_DRAW});c.vertexArrayDestroyable=!1,e._buffers.push(c),a.buffer=c,a.typedArray=void 0,o.push(a)}t.propertyAttributeIds=[0]}var KN=i$;var tCi=x(T(),1);var QB=new h,LZe=new h,WZe=new h,JN=new h,Yut=new h,Mut=new h,wut=new pe,kut=new me;function qB(e,t,n,i){let o=t*n;return i.x=e[o],i.y=e[o+1],i.z=e[o+2],i}var Uut=32,o$=new Map,r$=[];function Dut(e,t,n,i,o,r){let s=e.origin.x,a=e.origin.y,c=e.origin.z,d=e.direction.x,u=e.direction.y,m=e.direction.z,p=W.EPSILON6;for(let b=0;b<i;b+=3){let f=n[b]*3,y=n[b+1]*3,_=n[b+2]*3,S=t[f],Z=t[f+1],R=t[f+2],C=t[y]-S,E=t[y+1]-Z,A=t[y+2]-R,L=t[_]-S,F=t[_+1]-Z,I=t[_+2]-R,N=u*I-m*F,g=m*L-d*I,V=d*F-u*L,G=C*N+E*g+A*V,v=s-S,X=a-Z,Y=c-R,D;if(o){if(G<p)continue;let M=v*N+X*g+Y*V;if(M<0||M>G)continue;let O=X*A-Y*E,w=Y*C-v*A,z=v*E-X*C,K=d*O+u*w+m*z;if(K<0||M+K>G)continue;D=(L*O+F*w+I*z)/G}else{if(Math.abs(G)<p)continue;let M=1/G,O=(v*N+X*g+Y*V)*M;if(O<0||O>1)continue;let w=X*A-Y*E,z=Y*C-v*A,K=v*E-X*C,te=(d*w+u*z+m*K)*M;if(te<0||O+te>1)continue;D=(L*w+F*z+I*K)*M}D>=0&&D<r&&(r=D)}return r}function VV(e,t,n,i,o,r,s){if(!e._ready||n.mode===se.MORPHING)return;let a=Number.MAX_VALUE;r=r??ne.default,i=i??1,o=o??0;let c=n.mode!==se.SCENE3D?n.mapProjection:void 0;if(Sa.forEachPrimitive(e,{mapProjection:c},function(d,u,m,p){if(l(d.boundingSphere)&&m.length===1){let R=me.transform(d.boundingSphere,p,kut),C=xi.raySphere(t,R);if(!l(C))return}if(!l(u.indices))return;let b,f,y=Zt.getAttributeBySemantic(u,dt.POSITION),_=o$.get(u);l(_)||(_={},l(y)&&(_.vertices=Sa.readAttributeAsTypedArray(y)),l(u.indices)&&(_.indices=Sa.readIndicesAsTypedArray(u.indices)),o$.set(u,_),r$.push(u),r$.length>Uut&&o$.delete(r$.shift())),l(y)&&(f=Dt.getNumberOfComponents(y.type),b=_.vertices);let S=_.indices;if(!l(S)||!l(b))return;let Z=S.length;if(m.length===1&&i===1){let R=m[0].transform;if(!l(_.world)||!P.equals(_.worldTransform,R)){let L=b.length/f,F=new Float64Array(L*3);for(let I=0;I<L;I++)qB(b,I,f,QB),P.multiplyByPoint(R,QB,JN),F[I*3]=JN.x,F[I*3+1]=JN.y,F[I*3+2]=JN.z;_.world=F,_.worldTransform=P.clone(R,_.worldTransform)}let C=_.world,E=e.backFaceCulling??!0,A=Dut(t,C,S,Z,E,a);A<a&&(a=A);return}for(let R=0;R<Z;R+=3){let C=S[R],E=S[R+1],A=S[R+2];qB(b,C,f,QB),qB(b,E,f,LZe),qB(b,A,f,WZe);for(let L of m){let F=P.multiplyByPoint(L.transform,QB,JN),I=P.multiplyByPoint(L.transform,LZe,Yut),N=P.multiplyByPoint(L.transform,WZe,Mut);i!==1&&(_o.getPosition(F,r,i,o,F),_o.getPosition(I,r,i,o,I),_o.getPosition(N,r,i,o,N));let g=xi.rayTriangleParametric(t,F,I,N,e.backFaceCulling??!0);l(g)&&g<a&&g>=0&&(a=g)}}}),a!==Number.MAX_VALUE){if(s=gn.getPoint(t,a,s),n.mode!==se.SCENE3D){h.fromElements(s.y,s.z,s.x,s);let d=n.mapProjection,u=d.ellipsoid,m=d.unproject(s,wut);u.cartographicToCartesian(m,s)}return s}}var dCi=x(T(),1);var iCi=x(T(),1),s$=class{constructor(t){this.show=t.show,this.alpha=t.alpha,this.brightness=t.brightness,this.contrast=t.contrast,this.hue=t.hue,this.saturation=t.saturation,this.gamma=t.gamma,this.colorToAlpha=t.colorToAlpha}},jN=s$;var a$=class{constructor(t){this._model=t,this._modelPrimitiveImageries=void 0,this._imageryConfigurations=[]}update(t){if(!this._hasImagery){this._deleteModelPrimitiveImageries();return}this._allImageryLayersReady&&(l(this._modelPrimitiveImageries)||(this._modelPrimitiveImageries=this._createModelPrimitiveImageries()),this._updateModelPrimitiveImageries(t),this._checkForModifiedImageryConfigurations())}_createModelPrimitiveImageries(){let t=this._model,n=this._collectRuntimeNodesAndPrimitives(),i=[],o=n.length;for(let r=0;r<o;r++){let s=n[r],a=s.runtimeNode,c=s.runtimePrimitive,d=new YS(t,a,c);c.primitive.modelPrimitiveImagery=d,i.push(d)}return i}_collectRuntimeNodesAndPrimitives(){let i=this._model.sceneGraph._runtimeNodes,o=[];for(let r=0;r<i.length;r++){let s=i[r];if(l(s))for(let a=0;a<s.runtimePrimitives.length;a++){let c=s.runtimePrimitives[a];o.push({runtimeNode:s,runtimePrimitive:c})}}return o}_updateModelPrimitiveImageries(t){if(!l(this._modelPrimitiveImageries))throw new ge("The modelPrimitiveImageries have not been created");let n=this._modelPrimitiveImageries,i=n.length;for(let o=0;o<i;o++)n[o].update(t)}_deleteModelPrimitiveImageries(){let t=this._modelPrimitiveImageries;if(!l(t))return;let n=t.length;for(let i=0;i<n;i++)t[i].destroy();delete this._modelPrimitiveImageries,this._model.resetDrawCommands()}get ready(){return this._hasImagery?!(!this._allImageryLayersReady||!this._allModelPrimitiveImageriesReady):!0}get _hasImagery(){let n=this._model.imageryLayers;return l(n)&&n.length>0}get _allImageryLayersReady(){if(!this._hasImagery)return!0;let t=this._model.imageryLayers,n=t.length;for(let i=0;i<n;i++)if(!t.get(i).ready)return!1;return!0}get _allModelPrimitiveImageriesReady(){let t=this._modelPrimitiveImageries;if(!l(t))return!1;let n=t.length;for(let i=0;i<n;i++)if(!t[i].ready)return!1;return!0}_checkForModifiedImageryConfigurations(){this._imageryConfigurationsModified()&&(this._updateImageryConfigurations(),this._model.resetDrawCommands())}_imageryConfigurationsModified(){let n=this._model.imageryLayers,i=this._imageryConfigurations;if(n.length!==i.length)return!0;for(let o=0;o<n.length;o++){let r=n.get(o),s=i[o];if(r.show!==s.show||r.alpha!==s.alpha||r.brightness!==s.brightness||r.contrast!==s.contrast||r.hue!==s.hue||r.saturation!==s.saturation||r.gamma!==s.gamma||r.colorToAlpha!==s.colorToAlpha)return!0}return!1}_updateImageryConfigurations(){let n=this._model.imageryLayers,i=this._imageryConfigurations;i.length=n.length;for(let o=0;o<n.length;o++){let r=n.get(o);i[o]=new jN(r)}}isDestroyed(){return!1}destroy(){if(!this.isDestroyed())return this._deleteModelPrimitiveImageries(),ue(this)}},QN=a$;function Vo(e){e=e??B.EMPTY_OBJECT,this._loader=e.loader,this._resource=e.resource,this.type=e.type??Br.GLTF,this.modelMatrix=P.clone(e.modelMatrix??P.IDENTITY),this._modelMatrix=P.clone(this.modelMatrix),this._scale=e.scale??1,this._minimumPixelSize=e.minimumPixelSize??0,this._maximumScale=e.maximumScale,this._clampedScale=l(this._maximumScale)?Math.min(this._scale,this._maximumScale):this._scale,this._computedScale=this._clampedScale,this._updateModelMatrix=!1,this.referenceMatrix=void 0,this._iblReferenceFrameMatrix=q.clone(q.IDENTITY),this._clippingPlanesMatrix=P.clone(P.IDENTITY),this._resourcesLoaded=!1,this._drawCommandsBuilt=!1,this._ready=!1,this._customShader=e.customShader,this._content=e.content,this._texturesLoaded=!1,this._defaultTexture=void 0,this._activeAnimations=new BP(this),this._clampAnimations=e.clampAnimations??!0,this._userAnimationDirty=!1,this._id=e.id,this._idDirty=!1,this._color=U.clone(e.color),this._colorBlendMode=e.colorBlendMode??ol.HIGHLIGHT,this._colorBlendAmount=e.colorBlendAmount??.5;let t=e.silhouetteColor??U.RED;this._silhouetteColor=U.clone(t),this._silhouetteSize=e.silhouetteSize??0,this._silhouetteDirty=!1,this._silhouetteId=void 0,this._cull=e.cull??!0,this._opaquePass=e.opaquePass??Le.OPAQUE,this._allowPicking=e.allowPicking??!0,this._show=e.show??!0,this._style=void 0,this._styleDirty=!1,this._styleCommandsNeeded=void 0;let n=e.featureIdLabel??"featureId_0";typeof n=="number"&&(n=`featureId_${n}`),this._featureIdLabel=n;let i=e.instanceFeatureIdLabel??"instanceFeatureId_0";typeof i=="number"&&(i=`instanceFeatureId_${i}`),this._instanceFeatureIdLabel=i,this._featureTables=[],this._featureTableId=void 0,this._featureTableIdDirty=!0,this._pipelineResources=[],this._modelResources=[],this._pickIds=[],this._boundingSphere=new me,this._initialRadius=void 0,this._heightReference=e.heightReference??He.NONE,this._heightDirty=this._heightReference!==He.NONE,this._removeUpdateHeightCallback=void 0,this._enableVerticalExaggeration=e.enableVerticalExaggeration??!0,this._hasVerticalExaggeration=!1,this._clampedModelMatrix=void 0,this._heightAboveSurface=void 0,this._lastSurfaceHeight=void 0,this._lastSurfaceQueryFrame=-1,this._lastSurfaceQueryMissed=!1;let o=e.scene;l(o)&&l(o.terrainProviderChanged)&&(this._terrainProviderChangedCallback=o.terrainProviderChanged.addEventListener(()=>{this._heightDirty=!0})),this._scene=o,this._distanceDisplayCondition=e.distanceDisplayCondition;let r=new jp(e.pointCloudShading);this._pointCloudShading=r,this._attenuation=r.attenuation,this._pointCloudBackFaceCulling=r.backFaceCulling;let s=e.clippingPlanes;l(s)&&s.owner===void 0?_s.setOwner(s,this,"_clippingPlanes"):this._clippingPlanes=s,this._clippingPlanesState=0;let a=e.clippingPolygons;l(a)&&a.owner===void 0?vc.setOwner(a,this,"_clippingPolygons"):this._clippingPolygons=a,this._clippingPolygonsState=0,this._clippingPolygonsNeedRebake=!1,this._removeClippingPolygonAdded=void 0,this._removeClippingPolygonRemoved=void 0,IZe(this),this._vectorData=void 0,this._vectorLookupFlags=0,this._clippingPolygonData=void 0,this._rectangle=new re,this._modelImagery=new QN(this),this._lightColor=h.clone(e.lightColor),this._imageBasedLighting=l(e.imageBasedLighting)?e.imageBasedLighting:new WS,this._shouldDestroyImageBasedLighting=!l(e.imageBasedLighting),this._environmentMapManager=void 0;let c=new kb(e.environmentMapOptions);kb.setOwner(c,this,"_environmentMapManager"),this._backFaceCulling=e.backFaceCulling??!0,this._backFaceCullingDirty=!1,this._shadows=e.shadows??Wn.ENABLED,this._shadowsDirty=!1,this._debugShowBoundingVolumeDirty=!1,this._debugShowBoundingVolume=e.debugShowBoundingVolume??!1,this._enableDebugWireframe=e.enableDebugWireframe??!1,this._enableShowOutline=e.enableShowOutline??!0,this._debugWireframe=e.debugWireframe??!1,this._edgeDisplayMode=e.edgeDisplayMode??Bm.SURFACES_ONLY,this._debugWireframe===!0&&this._enableDebugWireframe===!1&&this.type===Br.GLTF&&xt("model-debug-wireframe-ignored","enableDebugWireframe must be set to true in Model.fromGltf, otherwise debugWireframe will be ignored.");let d=e.credit;typeof d=="string"&&(d=new Lt(d)),this._credits=[],this._credit=d,this._resourceCredits=[],this._gltfCredits=[],this._showCreditsOnScreen=e.showCreditsOnScreen??!1,this._showCreditsOnScreenDirty=!0,this._splitDirection=e.splitDirection??Ur.NONE,this._enableShowOutline=e.enableShowOutline??!0,this.showOutline=e.showOutline??!0,this.outlineColor=e.outlineColor??U.BLACK,this._classificationType=e.classificationType,this._statistics=new zN,this._sceneMode=void 0,this._projectTo2D=e.projectTo2D??!1,this._enablePick=e.enablePick??!1,this._fogRenderable=void 0,this._skipLevelOfDetail=!1,this._ignoreCommands=e.ignoreCommands??!1,this._errorEvent=new Se,this._readyEvent=new Se,this._texturesReadyEvent=new Se,this._sceneGraph=void 0,this._nodesByName={},this.pickObject=e.pickObject}function c$(e,t){if(e._errorEvent.numberOfListeners>0){e._errorEvent.raiseEvent(t);return}console.log(t)}function Out(e,t){let n=e._featureTables,i=t.propertyTables,o=i.length;for(let r=0;r<o;r++){let s=i[r],a=new HP({model:e,propertyTable:s});n.push(a)}return n}function But(e,t){let n=t._featureIdLabel,i=t._instanceFeatureIdLabel,o,r,s,a;for(o=0;o<e.nodes.length;o++)if(a=e.nodes[o],l(a.instances)&&(s=Zt.getFeatureIdsByLabel(a.instances.featureIds,i),l(s)&&l(s.propertyTableId)))return s.propertyTableId;for(o=0;o<e.nodes.length;o++)for(a=e.nodes[o],r=0;r<a.primitives.length;r++){let c=a.primitives[r],d=Zt.getFeatureIdsByLabel(c.featureIds,n);if(l(d))return d.propertyTableId}if(t._featureTables.length===1)return 0}function u$(e,t){if(!l(e)&&!l(t))return!1;if(l(e)!==l(t))return!0;let n=e.alpha,i=t.alpha;return Math.floor(n)!==Math.floor(i)||Math.ceil(n)!==Math.ceil(i)}Object.defineProperties(Vo.prototype,{ready:{get:function(){return this._ready}},errorEvent:{get:function(){return this._errorEvent}},readyEvent:{get:function(){return this._readyEvent}},incrementallyLoadTextures:{get:function(){return this._loader.incrementallyLoadTextures??!1}},texturesReadyEvent:{get:function(){return this._texturesReadyEvent}},loader:{get:function(){return this._loader}},statistics:{get:function(){return this._statistics}},activeAnimations:{get:function(){return this._activeAnimations}},clampAnimations:{get:function(){return this._clampAnimations},set:function(e){this._clampAnimations=e}},cull:{get:function(){return this._cull}},opaquePass:{get:function(){return this._opaquePass}},pointCloudShading:{get:function(){return this._pointCloudShading},set:function(e){e!==this._pointCloudShading&&this.resetDrawCommands(),this._pointCloudShading=e}},customShader:{get:function(){return this._customShader},set:function(e){e!==this._customShader&&this.resetDrawCommands(),this._customShader=e}},sceneGraph:{get:function(){return this._sceneGraph}},content:{get:function(){return this._content}},heightReference:{get:function(){return this._heightReference},set:function(e){e!==this._heightReference&&(this._heightDirty=!0),this._heightReference=e}},distanceDisplayCondition:{get:function(){return this._distanceDisplayCondition},set:function(e){this._distanceDisplayCondition=Bt.clone(e,this._distanceDisplayCondition)}},structuralMetadata:{get:function(){return this._sceneGraph.components.structuralMetadata}},featureTableId:{get:function(){return this._featureTableId},set:function(e){this._featureTableId=e}},featureTables:{get:function(){return this._featureTables},set:function(e){this._featureTables=e}},id:{get:function(){return this._id},set:function(e){e!==this._id&&(this._idDirty=!0),this._id=e}},allowPicking:{get:function(){return this._allowPicking}},style:{get:function(){return this._style},set:function(e){this._style=e,this._styleDirty=!0}},color:{get:function(){return this._color},set:function(e){u$(e,this._color)&&this.resetDrawCommands(),this._color=U.clone(e,this._color)}},colorBlendMode:{get:function(){return this._colorBlendMode},set:function(e){this._colorBlendMode=e}},colorBlendAmount:{get:function(){return this._colorBlendAmount},set:function(e){this._colorBlendAmount=e}},silhouetteColor:{get:function(){return this._silhouetteColor},set:function(e){if(!U.equals(e,this._silhouetteColor)){let t=u$(e,this._silhouetteColor);this._silhouetteDirty=this._silhouetteDirty||t}this._silhouetteColor=U.clone(e,this._silhouetteColor)}},silhouetteSize:{get:function(){return this._silhouetteSize},set:function(e){if(e!==this._silhouetteSize){let t=this._silhouetteSize,n=e>0&&t===0||e===0&&t>0;this._silhouetteDirty=this._silhouetteDirty||n,this._backFaceCullingDirty=this._backFaceCullingDirty||n}this._silhouetteSize=e}},heightAboveSurface:{get:function(){return this._heightAboveSurface}},boundingSphere:{get:function(){let e=l(this._clampedModelMatrix)?this._clampedModelMatrix:this.modelMatrix;return XZe(this,e),this._boundingSphere}},debugShowBoundingVolume:{get:function(){return this._debugShowBoundingVolume},set:function(e){this._debugShowBoundingVolume!==e&&(this._debugShowBoundingVolumeDirty=!0),this._debugShowBoundingVolume=e}},debugWireframe:{get:function(){return this._debugWireframe},set:function(e){this._debugWireframe!==e&&this.resetDrawCommands(),this._debugWireframe=e,this._debugWireframe===!0&&this._enableDebugWireframe===!1&&this.type===Br.GLTF&&xt("model-debug-wireframe-ignored","enableDebugWireframe must be set to true in Model.fromGltfAsync, otherwise debugWireframe will be ignored.")}},edgeDisplayMode:{get:function(){return this._edgeDisplayMode},set:function(e){this._edgeDisplayMode=e}},show:{get:function(){return this._show},set:function(e){this._show=e}},featureIdLabel:{get:function(){return this._featureIdLabel},set:function(e){typeof e=="number"&&(e=`featureId_${e}`),e!==this._featureIdLabel&&(this._featureTableIdDirty=!0),this._featureIdLabel=e}},instanceFeatureIdLabel:{get:function(){return this._instanceFeatureIdLabel},set:function(e){typeof e=="number"&&(e=`instanceFeatureId_${e}`),e!==this._instanceFeatureIdLabel&&(this._featureTableIdDirty=!0),this._instanceFeatureIdLabel=e}},clippingPlanes:{get:function(){return this._clippingPlanes},set:function(e){e!==this._clippingPlanes&&(_s.setOwner(e,this,"_clippingPlanes"),this.resetDrawCommands())}},clippingPolygons:{get:function(){return this._clippingPolygons},set:function(e){e!==this._clippingPolygons&&(vc.setOwner(e,this,"_clippingPolygons"),IZe(this),this.resetDrawCommands(),this._clippingPolygonsState=0,this._clippingPolygonsNeedRebake=!0,l(this._clippingPolygonData)&&(vc.releaseRectangleData(this._clippingPolygonData),this._clippingPolygonData=void 0))}},enableVerticalExaggeration:{get:function(){return this._enableVerticalExaggeration},set:function(e){e!==this._enableVerticalExaggeration&&this.resetDrawCommands(),this._enableVerticalExaggeration=e}},hasVerticalExaggeration:{get:function(){return this._hasVerticalExaggeration}},imageryLayers:{get:function(){if(l(this._content)){let e=this._content.tileset;if(l(e))return e.imageryLayers}}},lightColor:{get:function(){return this._lightColor},set:function(e){l(e)!==l(this._lightColor)&&this.resetDrawCommands(),this._lightColor=h.clone(e,this._lightColor)}},imageBasedLighting:{get:function(){return this._imageBasedLighting},set:function(e){e!==this._imageBasedLighting&&(this._shouldDestroyImageBasedLighting&&!this._imageBasedLighting.isDestroyed()&&this._imageBasedLighting.destroy(),this._imageBasedLighting=e,this._shouldDestroyImageBasedLighting=!1,this.resetDrawCommands())}},environmentMapManager:{get:function(){return this._environmentMapManager},set:function(e){e!==this.environmentMapManager&&(kb.setOwner(e,this,"_environmentMapManager"),this.resetDrawCommands())}},backFaceCulling:{get:function(){return this._backFaceCulling},set:function(e){e!==this._backFaceCulling&&(this._backFaceCullingDirty=!0),this._backFaceCulling=e}},scale:{get:function(){return this._scale},set:function(e){e!==this._scale&&(this._updateModelMatrix=!0),this._scale=e}},computedScale:{get:function(){return this._computedScale}},minimumPixelSize:{get:function(){return this._minimumPixelSize},set:function(e){e!==this._minimumPixelSize&&(this._updateModelMatrix=!0),this._minimumPixelSize=e}},maximumScale:{get:function(){return this._maximumScale},set:function(e){e!==this._maximumScale&&(this._updateModelMatrix=!0),this._maximumScale=e}},shadows:{get:function(){return this._shadows},set:function(e){e!==this._shadows&&(this._shadowsDirty=!0),this._shadows=e}},credit:{get:function(){return this._credit}},showCreditsOnScreen:{get:function(){return this._showCreditsOnScreen},set:function(e){this._showCreditsOnScreen!==e&&(this._showCreditsOnScreenDirty=!0),this._showCreditsOnScreen=e}},splitDirection:{get:function(){return this._splitDirection},set:function(e){this._splitDirection!==e&&this.resetDrawCommands(),this._splitDirection=e}},classificationType:{get:function(){return this._classificationType}},pickIds:{get:function(){return this._pickIds}},styleCommandsNeeded:{get:function(){return this._styleCommandsNeeded}}});Vo.prototype.getRectangle=function(e){let t=this._content?.tile?.contentBoundingVolume;return l(t?.rectangle)?t.rectangle:(e=e??this._scene?.ellipsoid??ne.default,re.fromBoundingSphere(this.boundingSphere,e,this._rectangle))};Vo.prototype.getNode=function(e){return this._nodesByName[e]};Vo.prototype.setArticulationStage=function(e,t){this._sceneGraph.setArticulationStage(e,t)};Vo.prototype.applyArticulations=function(){this._sceneGraph.applyArticulations()};Vo.prototype.getExtension=function(e){return this._loader.components.extensions[e]};Vo.prototype.makeStyleDirty=function(){this._styleDirty=!0};Vo.prototype.resetDrawCommands=function(){this._drawCommandsBuilt=!1};var zut=new P,Hut=new q,Kut=new P;Vo.prototype.update=function(e){let t=!1;try{t=Jut(this,e)}catch(i){if(!this._loader.incrementallyLoadTextures&&i.name==="TextureError")c$(this,i);else{let o=Zt.getError("model",this._resource,i);c$(this,o)}}if(jut(this,e),Qut(this,e),qut(this,e),!this._resourcesLoaded&&t){this._resourcesLoaded=!0;let i=this._loader.components;if(!l(i)){if(this._loader.isUnloaded())return;let s=Zt.getError("model",this._resource,new ae("Failed to load model."));c$(s),this._rejectLoad=this._rejectLoad&&this._rejectLoad(s)}let o=i.structuralMetadata;l(o)&&o.propertyTableCount>0&&Out(this,o);let r=new BN({model:this,modelComponents:i});this._sceneGraph=r,this._gltfCredits=r.components.asset.credits}if(!this._resourcesLoaded||e.mode===se.MORPHING)return;let n=this._modelImagery;if(n.update(e),!(!n.ready&&!(this._content?.tileset?._asynchronouslyLoadImagery??!1))){if($ut(this),emt(this),tmt(this,e),nmt(this),imt(this,e),omt(this,e),rmt(this,e),smt(this,e),lmt(this,e),dmt(this,e),umt(this,e),mmt(this,e),this._defaultTexture=e.context.defaultTexture,hmt(this,e),pmt(this,e),ymt(this),xmt(this,e),Zmt(this,e),!this._ready){e.afterRender.push(()=>{this._ready=!0,this._readyEvent.raiseEvent(this)});return}this._loader.incrementallyLoadTextures&&!this._texturesLoaded&&this._loader.texturesLoaded&&(this.resetDrawCommands(),this._texturesLoaded=!0,this._texturesReadyEvent.raiseEvent(this)),_mt(this),Rmt(this,e),Cmt(this),Emt(this,e)}};function Jut(e,t){return!e._resourcesLoaded||e._loader.incrementallyLoadTextures&&!e._texturesLoaded?(t.afterRender.push(()=>!0),e._loader.process(t)):!0}function jut(e,t){l(e._customShader)&&e._customShader.update(t)}function Qut(e,t){let n=e._environmentMapManager,i=t.passes.pick||t.passes.pickVoxel;e._ready&&n.owner===e&&!i&&(n.position=e._boundingSphere.center,n.shouldUpdate=!l(e._imageBasedLighting.sphericalHarmonicCoefficients)||!l(e._imageBasedLighting.specularEnvironmentMaps),n.update(t),n.shouldRegenerateShaders&&e.resetDrawCommands())}function qut(e,t){e._imageBasedLighting.update(t),e._imageBasedLighting.shouldRegenerateShaders&&e.resetDrawCommands()}function $ut(e){if(!e._featureTableIdDirty)return;e._featureTableIdDirty=!1;let t=e._sceneGraph.components,n=t.structuralMetadata;l(n)&&n.propertyTableCount>0&&(e.featureTableId=But(t,e),e._styleDirty=!0,e.resetDrawCommands())}function emt(e){e._styleDirty&&(e.applyStyle(e._style),e._styleDirty=!1)}function tmt(e,t){let n=e._featureTables,i=n.length,o=!1;for(let r=0;r<i;r++)n[r].update(t),n[r].styleCommandsNeededDirty&&(o=!0);o&&FZe(e)}function FZe(e){let t=e.featureTables[e.featureTableId];e._styleCommandsNeeded=Zf.getStyleCommandsNeeded(t.featuresLength,t.batchTexture.translucentFeaturesLength)}function nmt(e){let t=e.pointCloudShading;t.attenuation!==e._attenuation&&(e.resetDrawCommands(),e._attenuation=t.attenuation),t.backFaceCulling!==e._pointCloudBackFaceCulling&&(e.resetDrawCommands(),e._pointCloudBackFaceCulling=t.backFaceCulling)}function imt(e,t){e._silhouetteDirty&&(YZe(t)&&e.resetDrawCommands(),e._silhouetteDirty=!1)}function omt(e,t){let n=e.hasSkipLevelOfDetail(t);n!==e._skipLevelOfDetail&&(e.resetDrawCommands(),e._skipLevelOfDetail=n)}function rmt(e,t){let n=0;e.isClippingEnabled()&&(e._clippingPlanes.owner===e&&e._clippingPlanes.update(t),n=e._clippingPlanes.clippingPlanesState),n!==e._clippingPlanesState&&(e.resetDrawCommands(),e._clippingPlanesState=n)}function IZe(e){e._removeClippingPolygonAdded=e._removeClippingPolygonAdded&&e._removeClippingPolygonAdded(),e._removeClippingPolygonRemoved=e._removeClippingPolygonRemoved&&e._removeClippingPolygonRemoved();let t=e._clippingPolygons;if(!l(t)||t.owner!==e)return;let n=()=>{e._clippingPolygonsNeedRebake=!0};e._removeClippingPolygonAdded=t.polygonAdded.addEventListener(n),e._removeClippingPolygonRemoved=t.polygonRemoved.addEventListener(n)}function smt(e,t){let n=e._clippingPolygons,i=e.isClippingPolygonsEnabled(),o=0;i&&(n.owner===e&&n.update(t),o=n.clippingPolygonsState),o!==e._clippingPolygonsState&&(e.resetDrawCommands(),e._clippingPolygonsState=o);let r=(e._clippingPolygonData?.polygonRings.length??0)>0;if(e._clippingPolygonsNeedRebake&&(e._clippingPolygonsNeedRebake=!1,l(e._clippingPolygonData)&&(vc.releaseRectangleData(e._clippingPolygonData),e._clippingPolygonData=void 0)),!i||!e._ready)return;l(e._clippingPolygonData)||(e._clippingPolygonData=n.requestRectangleData(e.getRectangle(n.ellipsoid),t.context));let s=(e._clippingPolygonData?.polygonRings.length??0)>0;r!==s&&e.resetDrawCommands()}var amt=new re;function PZe(e){l(e._vectorData)&&(e._scene?.vectorProvider?.releaseTileData(e._vectorData),e._vectorData=void 0)}function cmt(e){if(e?.show!==!0)return 0;let t=1;return t|=e.hasPolylines?2:0,t|=e.hasPolygons?4:0,t}function lmt(e,t){let n=e._scene?.vectorProvider;if(l(n)&&l(e._content)&&e.ready&&t.mode===se.SCENE3D){let r=e._content?.tile?.contentBoundingVolume.rectangle??re.fromBoundingSphere(e.boundingSphere,n.ellipsoid,amt);e._vectorData=l(e._vectorData)?n.updateDataForRectangle(r,t.context,e._vectorData,He.CLAMP_TO_3D_TILE):n.requestDataForRectangle(r,t.context,He.CLAMP_TO_3D_TILE)}else PZe(e);let o=cmt(e._vectorData);o!==e._vectorLookupFlags&&(e.resetDrawCommands(),e._vectorLookupFlags=o)}function dmt(e,t){t.mode!==e._sceneMode&&(e._projectTo2D?e.resetDrawCommands():e._updateModelMatrix=!0,e._sceneMode=t.mode)}function umt(e,t){let n=t.fog.enabled&&t.fog.renderable;n!==e._fogRenderable&&(e.resetDrawCommands(),e._fogRenderable=n)}function mmt(e,t){if(e.enableVerticalExaggeration){let n=t.verticalExaggeration!==1;e.hasVerticalExaggeration!==n&&(e.resetDrawCommands(),e._hasVerticalExaggeration=n)}else e.hasVerticalExaggeration&&(e.resetDrawCommands(),e._hasVerticalExaggeration=!1)}function hmt(e,t){e._drawCommandsBuilt||(e.destroyPipelineResources(),e._sceneGraph.buildDrawCommands(t),e._drawCommandsBuilt=!0)}function fmt(e,t){if(e===t)return!0;if(!l(e)||!l(t))return!1;for(let n=0;n<16;n++)if(e[n]!==t[n])return!1;return!0}function m$(e,t){if(!l(e)||!l(t))return P.clone(e,t);for(let n=0;n<16;n++)t[n]=e[n];return t}function pmt(e,t){fmt(e.modelMatrix,e._modelMatrix)||(e._updateModelMatrix=!0,e._modelMatrix=m$(e.modelMatrix,e._modelMatrix))}var Ex=new h,l$=new pe,bmt=new pe,gmt=200,vZe=30;function ymt(e){let t=e.heightReference!==He.NONE&&l(e._scene)&&e._scene.frameState.frameNumber-e._lastSurfaceQueryFrame>=vZe;if(!e._updateModelMatrix&&!e._heightDirty&&e._minimumPixelSize===0&&!t)return;if(!e._updateModelMatrix&&!e._heightDirty&&l(e._removeUpdateHeightCallback)&&!t){e._updateModelMatrix=!0;return}let n=e._scene;if(!l(n)||e.heightReference===He.NONE){l(e._removeUpdateHeightCallback)&&(e._removeUpdateHeightCallback(),e._removeUpdateHeightCallback=void 0),e._clampedModelMatrix=void 0;return}let i=n.ellipsoid??ne.default,o=e.modelMatrix;Ex.x=o[12],Ex.y=o[13],Ex.z=o[14];let r=i.cartesianToCartographic(Ex,bmt);l(e._clampedModelMatrix)||(e._clampedModelMatrix=P.clone(o,new P));let s=n.frameState.frameNumber,a=e.heightReference===He.CLIP_TO_GROUND,c=s-e._lastSurfaceQueryFrame<vZe,d=a&&l(e._lastSurfaceHeight)&&r.height>e._lastSurfaceHeight+gmt,u=d&&c,m=a&&c&&e._lastSurfaceQueryMissed;if(!((a&&e._lastSurfaceQueryMissed||d)&&l(e._removeUpdateHeightCallback))){l(e._removeUpdateHeightCallback)&&e._removeUpdateHeightCallback();let y=pe.clone(r),_=Fmt(e,i,y);e._removeUpdateHeightCallback=n.updateHeight(y,S=>{let Z=n.getHeight(y,e.heightReference);l(Z)&&(S.height=Z,e._lastSurfaceQueryFrame=n.frameState.frameNumber,e._lastSurfaceQueryMissed=!1),e._lastSurfaceHeight=S.height,_(S)},e.heightReference)}let f;u||m?f=e._lastSurfaceHeight:(e._lastSurfaceQueryFrame=s,f=n.getHeight(r,e.heightReference),e._lastSurfaceQueryMissed=!l(f),l(f)?e._lastSurfaceHeight=f:f=e._lastSurfaceHeight),l(f)?(pe.clone(r,l$),l$.height=f,NZe(e,i,r,l$)):m$(o,e._clampedModelMatrix),e._heightDirty=!1,e._updateModelMatrix=!0}function xmt(e,t){if(!e._updateModelMatrix&&e._minimumPixelSize===0)return;let n=l(e._clampedModelMatrix)?e._clampedModelMatrix:e.modelMatrix;XZe(e,n),Tmt(e,n,t)}function XZe(e,t){e._clampedScale=l(e._maximumScale)?Math.min(e._scale,e._maximumScale):e._scale,e._boundingSphere.center=h.multiplyByScalar(e._sceneGraph.boundingSphere.center,e._clampedScale,e._boundingSphere.center),e._boundingSphere.radius=e._initialRadius*e._clampedScale,e._boundingSphere=me.transform(e._boundingSphere,t,e._boundingSphere)}function Tmt(e,t,n){let i=e.scale;if(e.minimumPixelSize!==0&&!e._projectTo2D){let o=n.context,r=Math.max(o.drawingBufferWidth,o.drawingBufferHeight);P.getTranslation(t,Ex),e._sceneMode!==se.SCENE3D&&fo.computeActualEllipsoidPosition(n,Ex,Ex);let s=e._boundingSphere.radius,a=Amt(Ex,s,n),c=1/a;Math.min(c*(2*s),r)<e.minimumPixelSize&&(i=e.minimumPixelSize*a/(2*e._initialRadius))}e._computedScale=l(e.maximumScale)?Math.min(e.maximumScale,i):i}function _mt(e){if(!e._idDirty)return;e._idDirty=!1;let t=e._id,n=e._pickIds,i=n.length;for(let o=0;o<i;++o)n[o].object.id=t}var Smt=new q(1,0,0,0,0,1,0,-1,0);function Zmt(e,t){let n=l(e._clampedModelMatrix)?e._clampedModelMatrix:e.modelMatrix,i=e.referenceMatrix??n,o=t.context,r=Hut,s=zut;if(s=P.multiply(o.uniformState.view3D,i,s),r=P.getRotation(s,r),r=q.transpose(r,r),e._iblReferenceFrameMatrix=q.multiply(Smt,r,e._iblReferenceFrameMatrix),e.isClippingEnabled()){let a=P.multiply(i,e._clippingPlanes.modelMatrix,Kut);e._clippingPlanesMatrix=P.inverseTranspose(a,e._clippingPlanesMatrix)}}function Rmt(e,t){let n=e._sceneGraph;if(e._updateModelMatrix||e._minimumPixelSize!==0){let o=l(e._clampedModelMatrix)?e._clampedModelMatrix:e.modelMatrix;n.updateModelMatrix(o,t),e._updateModelMatrix&&(e._clippingPolygonsNeedRebake=!0),e._updateModelMatrix=!1}e._backFaceCullingDirty&&(n.updateBackFaceCulling(e._backFaceCulling),e._backFaceCullingDirty=!1),e._shadowsDirty&&(n.updateShadows(e._shadows),e._shadowsDirty=!1),e._debugShowBoundingVolumeDirty&&(n.updateShowBoundingVolume(e._debugShowBoundingVolume),e._debugShowBoundingVolumeDirty=!1);let i=!1;!l(e.classificationType)&&e._show&&(i=e._userAnimationDirty||e._activeAnimations.update(t)),n.update(t,i),e._userAnimationDirty=!1}function Cmt(e){if(!e._showCreditsOnScreenDirty)return;e._showCreditsOnScreenDirty=!1,e._credits.length=0;let t=e._showCreditsOnScreen;if(l(e._credit)){let s=Lt.clone(e._credit);s.showOnScreen=s.showOnScreen||t,e._credits.push(s)}let n=e._resourceCredits,i=n.length;for(let s=0;s<i;s++){let a=Lt.clone(n[s]);a.showOnScreen=a.showOnScreen||t,e._credits.push(a)}let o=e._gltfCredits,r=o.length;for(let s=0;s<r;s++){let a=Lt.clone(o[s]);a.showOnScreen=a.showOnScreen||t,e._credits.push(a)}}function Vmt(e){return e.isClippingPolygonsEnabled()&&e._clippingPolygons.inverse&&(e._clippingPolygonData?.polygonRings.length??0)===0}function Emt(e,t){let n=Pmt(e,t),i=e.isInvisible(),o=e.hasSilhouette(t),r=e._show&&e._computedScale!==0&&n&&(!i||o)&&!Vmt(e),s=t.passes,a=s.render||s.pick&&e.allowPicking;r&&!e._ignoreCommands&&a&&(Xmt(e,t),e._sceneGraph.pushDrawCommands(t))}var d$=new me;function Amt(e,t,n){return d$.center=e,d$.radius=t,n.camera.getPixelSize(d$,n.context.drawingBufferWidth,n.context.drawingBufferHeight)}var $B=new h,Gmt=new h,e3=new h,Lmt=new h,Wmt=new P;function vmt(e,t,n){let i=e._sceneGraph;if(!l(i)||!l(i._positionMin))return 0;let o=i._positionMin,r=i._positionMax,s=t.geodeticSurfaceNormalCartographic(n,Lmt),a=P.multiplyTransformation(i._components.transform,i._axisCorrectionMatrix,Wmt),c=e.scale,d=e.modelMatrix,u=0;for(let m=0;m<8;m++){let p=h.fromElements(m&1?r.x:o.x,m&2?r.y:o.y,m&4?r.z:o.z,Gmt);h.multiplyByScalar(p,c,p),P.multiplyByPoint(a,p,e3),P.multiplyByPointAsVector(d,e3,e3);let b=h.dot(e3,s);b<u&&(u=b)}return-u}function NZe(e,t,n,i){if(e.heightReference===He.CLIP_TO_GROUND){let r=i.height+vmt(e,t,i);e._heightAboveSurface=Math.max(0,n.height-r),i.height=Math.max(n.height,r)}else Uy(e.heightReference)&&(i.height+=n.height);t.cartographicToCartesian(i,$B);let o=e._clampedModelMatrix;m$(e.modelMatrix,o),o[12]=$B.x,o[13]=$B.y,o[14]=$B.z,e._heightDirty=!0}function Fmt(e,t,n){return function(i){NZe(e,t,n,i)}}var Imt=new h;function Pmt(e,t){let n=e.distanceDisplayCondition;if(!l(n))return!0;let i=n.near*n.near,o=n.far*n.far,r;if(t.mode===se.SCENE2D){let a=(t.camera.frustum.right-t.camera.frustum.left)*.5;r=a*a}else{let s=P.getTranslation(e.modelMatrix,Imt);fo.computeActualEllipsoidPosition(t,s,s),r=h.distanceSquared(s,t.camera.positionWC)}return r>=i&&r<=o}function Xmt(e,t){let n=t.creditDisplay,i=e._credits,o=i.length;for(let r=0;r<o;r++)n.addCreditToNextFrame(i[r])}Vo.prototype.isTranslucent=function(){let e=this.color;return l(e)&&e.alpha>0&&e.alpha<1};Vo.prototype.isInvisible=function(){let e=this.color;return l(e)&&e.alpha===0};function YZe(e){return e.context.stencilBuffer}Vo.prototype.hasSilhouette=function(e){return YZe(e)&&this._silhouetteSize>0&&this._silhouetteColor.alpha>0&&!l(this._classificationType)};Vo.prototype.hasSkipLevelOfDetail=function(e){if(!Br.is3DTiles(this.type))return!1;let t=e.context.stencilBuffer,n=this._content.tileset;return t&&n.isSkippingLevelOfDetail};Vo.prototype.isClippingEnabled=function(){let e=this._clippingPlanes;return l(e)&&e.enabled&&e.length!==0};Vo.prototype.pick=function(e,t,n,i,o){return VV(this,e,t,n,i,o)};Vo.prototype.isClippingPolygonsEnabled=function(){let e=this._clippingPolygons;return l(e)&&e.enabled&&e.length!==0};Vo.prototype.hasDrapedVectors=function(){return this._vectorData?.show===!0};Vo.prototype.isDestroyed=function(){return!1};Vo.prototype.destroy=function(){let e=this._loader;l(e)&&e.destroy();let t=this._featureTables;if(l(t)){let o=t.length;for(let r=0;r<o;r++)t[r].destroy()}this.destroyPipelineResources(),this.destroyModelResources(),PZe(this),l(this._removeUpdateHeightCallback)&&(this._removeUpdateHeightCallback(),this._removeUpdateHeightCallback=void 0),l(this._terrainProviderChangedCallback)&&(this._terrainProviderChangedCallback(),this._terrainProviderChangedCallback=void 0),this._removeClippingPolygonAdded=this._removeClippingPolygonAdded&&this._removeClippingPolygonAdded(),this._removeClippingPolygonRemoved=this._removeClippingPolygonRemoved&&this._removeClippingPolygonRemoved();let n=this._clippingPlanes;l(n)&&!n.isDestroyed()&&n.owner===this&&n.destroy(),this._clippingPlanes=void 0,l(this._clippingPolygonData)&&vc.releaseRectangleData(this._clippingPolygonData),this._clippingPolygonData=void 0,this._clippingPolygons=void 0,this._shouldDestroyImageBasedLighting&&!this._imageBasedLighting.isDestroyed()&&this._imageBasedLighting.destroy(),this._imageBasedLighting=void 0;let i=this._environmentMapManager;!i.isDestroyed()&&i.owner===this&&i.destroy(),this._environmentMapManager=void 0,ue(this)};Vo.prototype.destroyPipelineResources=function(){let e=this._pipelineResources;for(let t=0;t<e.length;t++)e[t].destroy();this._pipelineResources.length=0,this._pickIds.length=0};Vo.prototype.destroyModelResources=function(){let e=this._modelResources;for(let t=0;t<e.length;t++)e[t].destroy();this._modelResources.length=0};Vo.fromGltfAsync=async function(e){e=e??B.EMPTY_OBJECT;let t=e.url??e.gltf,n={releaseGltfJson:e.releaseGltfJson,asynchronous:e.asynchronous,incrementallyLoadTextures:e.incrementallyLoadTextures,upAxis:e.upAxis,forwardAxis:e.forwardAxis,loadAttributesFor2D:e.projectTo2D,enablePick:e.enablePick,loadIndicesForWireframe:e.enableDebugWireframe,loadPrimitiveOutline:e.enableShowOutline,loadForClassification:l(e.classificationType)},i=e.basePath??"",o=ve.createIfNeeded(i);l(t.asset)?(n.gltfJson=t,n.baseResource=o,n.gltfResource=o):t instanceof Uint8Array?(n.typedArray=t,n.baseResource=o,n.gltfResource=o):n.gltfResource=ve.createIfNeeded(t);let r=new Mu(n),a=l(e.content)?Br.TILE_GLTF:Br.GLTF,c=n.gltfResource,d=qN(r,a,e);d.resource=c,d.environmentMapOptions=e.environmentMapOptions;try{await r.load()}catch(b){throw r.destroy(),Zt.getError("model",c,b)}let u=e.gltfCallback;l(u)&&u(r.gltfJson);let m=new Vo(d),p=m._resource.credits;if(l(p)){let b=p.length;for(let f=0;f<b;f++)m._resourceCredits.push(Lt.clone(p[f]))}return m};Vo.fromB3dm=async function(e){let t={b3dmResource:e.resource,arrayBuffer:e.arrayBuffer,byteOffset:e.byteOffset,releaseGltfJson:e.releaseGltfJson,asynchronous:e.asynchronous,incrementallyLoadTextures:e.incrementallyLoadTextures,upAxis:e.upAxis,forwardAxis:e.forwardAxis,loadAttributesFor2D:e.projectTo2D,enablePick:e.enablePick,loadIndicesForWireframe:e.enableDebugWireframe,loadPrimitiveOutline:e.enableShowOutline,loadForClassification:l(e.classificationType)},n=new XP(t);try{await n.load();let i=qN(n,Br.TILE_B3DM,e);return new Vo(i)}catch(i){throw n.destroy(),i}};Vo.fromPnts=async function(e){let t={arrayBuffer:e.arrayBuffer,byteOffset:e.byteOffset,loadAttributesFor2D:e.projectTo2D},n=new KN(t);try{await n.load();let i=qN(n,Br.TILE_PNTS,e);return new Vo(i)}catch(i){throw n.destroy(),i}};Vo.fromI3dm=async function(e){let t={i3dmResource:e.resource,arrayBuffer:e.arrayBuffer,byteOffset:e.byteOffset,releaseGltfJson:e.releaseGltfJson,asynchronous:e.asynchronous,incrementallyLoadTextures:e.incrementallyLoadTextures,upAxis:e.upAxis,forwardAxis:e.forwardAxis,loadAttributesFor2D:e.projectTo2D,enablePick:e.enablePick,loadIndicesForWireframe:e.enableDebugWireframe,loadPrimitiveOutline:e.enableShowOutline},n=new MP(t);try{await n.load();let i=qN(n,Br.TILE_I3DM,e);return new Vo(i)}catch(i){throw n.destroy(),i}};Vo.fromGeoJson=async function(e){let t={geoJson:e.geoJson},n=new NP(t),i=qN(n,Br.TILE_GEOJSON,e);return new Vo(i)};var Nmt=new U;Vo.prototype.applyColorAndShow=function(e){let t=U.clone(this._color,Nmt),n=l(e)&&l(e.color),i=l(e)&&l(e.show);this._color=n?e.color.evaluateColor(void 0,this._color):U.clone(U.WHITE,this._color),this._show=i?e.show.evaluate(void 0):!0,u$(t,this._color)&&this.resetDrawCommands()};Vo.prototype.applyStyle=function(e){let t=this.type===Br.TILE_PNTS,n=l(this.featureTableId)&&this.featureTables[this.featureTableId].featuresLength>0,i=l(this.structuralMetadata)?this.structuralMetadata.propertyAttributes:void 0,o=l(i)&&l(i[0]);if(t&&(!n||o)){this.resetDrawCommands();return}n?(this.featureTables[this.featureTableId].applyStyle(e),FZe(this,e)):(this.applyColorAndShow(e),this._styleCommandsNeeded=void 0)};function qN(e,t,n){return{loader:e,type:t,resource:n.resource,show:n.show,modelMatrix:n.modelMatrix,scale:n.scale,enableVerticalExaggeration:n.enableVerticalExaggeration,minimumPixelSize:n.minimumPixelSize,maximumScale:n.maximumScale,id:n.id,allowPicking:n.allowPicking,clampAnimations:n.clampAnimations,shadows:n.shadows,debugShowBoundingVolume:n.debugShowBoundingVolume,enableDebugWireframe:n.enableDebugWireframe,debugWireframe:n.debugWireframe,cull:n.cull,opaquePass:n.opaquePass,customShader:n.customShader,content:n.content,heightReference:n.heightReference,scene:n.scene,distanceDisplayCondition:n.distanceDisplayCondition,color:n.color,colorBlendAmount:n.colorBlendAmount,colorBlendMode:n.colorBlendMode,edgeDisplayMode:n.edgeDisplayMode,silhouetteColor:n.silhouetteColor,silhouetteSize:n.silhouetteSize,enableShowOutline:n.enableShowOutline,showOutline:n.showOutline,outlineColor:n.outlineColor,clippingPlanes:n.clippingPlanes,clippingPolygons:n.clippingPolygons,lightColor:n.lightColor,imageBasedLighting:n.imageBasedLighting,backFaceCulling:n.backFaceCulling,credit:n.credit,showCreditsOnScreen:n.showCreditsOnScreen,splitDirection:n.splitDirection,projectTo2D:n.projectTo2D,enablePick:n.enablePick,featureIdLabel:n.featureIdLabel,instanceFeatureIdLabel:n.instanceFeatureIdLabel,pointCloudShading:n.pointCloudShading,classificationType:n.classificationType,pickObject:n.pickObject}}var Bu=Vo;var Ymt=1,Mmt=!0,wmt=0,kmt=!0,Umt=!0,Dmt=Wn.ENABLED,Omt=He.NONE,Bmt=U.RED,zmt=0,Hmt=U.WHITE,Kmt=ol.HIGHLIGHT,Jmt=.5,jmt=new k(1,1),MZe={maximumPositionEpsilon:Number.POSITIVE_INFINITY},Qmt=new P,qmt=new P,wZe=new U,kZe=new Array(4),$mt=new h;function Ax(e,t){t.collectionChanged.addEventListener(Ax.prototype._onCollectionChanged,this),this._scene=e,this._primitives=e.primitives,this._entityCollection=t,this._modelHash={},this._entitiesToVisualize=new kt,this._onCollectionChanged(t,t.values,[],[])}function eht(e,t){return e instanceof mi?e.valueOf():j.getValueOrUndefined(e,t)}function tht(e,t){return t!==e.uri?!1:t instanceof ve?t._url===e.uriUrl&&t._queryParameters===e.uriQueryParameters&&t._templateValues===e.uriTemplateValues:!0}function UZe(e,t){e.uri=t,t instanceof ve&&(e.uriUrl=t._url,e.uriQueryParameters=t._queryParameters,e.uriTemplateValues=t._templateValues)}function nht(e,t){if(!l(t))return P.clone(e);for(let n=0;n<16;n++)t[n]=e[n];return t}async function iht(e,t,n,i,o){let r=e._primitives,s=e._modelHash;try{let a=await Bu.fromGltfAsync({url:n,incrementallyLoadTextures:i,scene:e._scene,environmentMapOptions:o});if(e.isDestroyed()||!l(s[t.id]))return;a.id=t,r.add(a),s[t.id].modelPrimitive=a,a.errorEvent.addEventListener(c=>{l(s[t.id])&&(console.log(c),c.name!=="TextureError"&&a.incrementallyLoadTextures&&(s[t.id].loadFailed=!0))})}catch(a){if(e.isDestroyed()||!l(s[t.id]))return;console.log(a),s[t.id].loadFailed=!0}}Ax.prototype.update=function(e){let t=this._entitiesToVisualize.values,n=this._modelHash,i=this._primitives;for(let o=0,r=t.length;o<r;o++){let s=t[o],a=s._model,c,d=n[s.id],u=s.isShowing&&s.isAvailable(e)&&j.getValueOrDefault(a._show,e,!0),m,p;if(u&&(m=s.computeModelMatrix(e,Qmt),p=eht(a._uri,e),u=l(m)&&l(p)),!u){l(d)&&d.modelPrimitive&&(d.modelPrimitive.show=!1);continue}if((!l(d)||!tht(d,p))&&(c=ve.createIfNeeded(p),l(d)&&c.url===d.url&&(UZe(d,p),c=void 0)),l(c)){l(d?.modelPrimitive)&&(i.removeAndDestroy(d.modelPrimitive),delete n[s.id]),d={modelPrimitive:void 0,url:c.url,uri:void 0,uriUrl:void 0,uriQueryParameters:void 0,uriTemplateValues:void 0,animationsRunning:!1,nodeTransformationsScratch:{},articulationsScratch:{},loadFailed:!1,modelUpdated:!1,environmentMapOptionsScratch:{...MZe}},n[s.id]=d,UZe(d,p);let y=j.getValueOrDefault(a._incrementallyLoadTextures,e,kmt),_=j.getValueOrDefault(a._environmentMapOptions,e,MZe,d.environmentMapOptionsScratch);iht(this,s,c,y,_)}let b=d.modelPrimitive;if(!l(b))continue;b.show=!0,b.scale=j.getValueOrDefault(a._scale,e,Ymt),b.enableVerticalExaggeration=j.getValueOrDefault(a._enableVerticalExaggeration,e,Mmt),b.minimumPixelSize=j.getValueOrDefault(a._minimumPixelSize,e,wmt),b.maximumScale=j.getValueOrUndefined(a._maximumScale,e),b.modelMatrix=nht(m,b.modelMatrix),b.shadows=j.getValueOrDefault(a._shadows,e,Dmt),b.heightReference=j.getValueOrDefault(a._heightReference,e,Omt),b.distanceDisplayCondition=j.getValueOrUndefined(a._distanceDisplayCondition,e),b.silhouetteColor=j.getValueOrDefault(a._silhouetteColor,e,Bmt,wZe),b.silhouetteSize=j.getValueOrDefault(a._silhouetteSize,e,zmt),b.color=j.getValueOrDefault(a._color,e,Hmt,wZe),b.colorBlendMode=j.getValueOrDefault(a._colorBlendMode,e,Kmt),b.colorBlendAmount=j.getValueOrDefault(a._colorBlendAmount,e,Jmt),b.clippingPlanes=j.getValueOrUndefined(a._clippingPlanes,e),b.clampAnimations=j.getValueOrDefault(a._clampAnimations,e,Umt),b.imageBasedLighting.imageBasedLightingFactor=j.getValueOrDefault(a._imageBasedLightingFactor,e,jmt);let f=j.getValueOrUndefined(a._lightColor,e);if(l(f)&&(U.pack(f,kZe,0),f=h.unpack(kZe,0,$mt)),b.lightColor=f,b.customShader=j.getValueOrUndefined(a._customShader,e),n[s.id].modelUpdated=!0,b.ready){let y=j.getValueOrDefault(a._runAnimations,e,!0);d.animationsRunning!==y&&(y?b.activeAnimations.addAll({loop:Dd.REPEAT}):b.activeAnimations.removeAll(),d.animationsRunning=y);let _=j.getValueOrUndefined(a._nodeTransformations,e,d.nodeTransformationsScratch);if(l(_)){let R=Object.keys(_);for(let C=0,E=R.length;C<E;++C){let A=R[C],L=_[A];if(!l(L))continue;let F=b.getNode(A);if(!l(F))continue;let I=P.fromTranslationRotationScale(L,qmt);F.matrix=P.multiply(F.originalMatrix,I,I)}}let S=!1,Z=j.getValueOrUndefined(a._articulations,e,d.articulationsScratch);if(l(Z)){let R=Object.keys(Z);for(let C=0,E=R.length;C<E;++C){let A=R[C],L=Z[A];l(L)&&(S=!0,b.setArticulationStage(A,L))}}S&&b.applyArticulations()}}return!0};Ax.prototype.isDestroyed=function(){return!1};Ax.prototype.destroy=function(){this._entityCollection.collectionChanged.removeEventListener(Ax.prototype._onCollectionChanged,this);let e=this._entitiesToVisualize.values,t=this._modelHash,n=this._primitives;for(let i=e.length-1;i>-1;i--)h$(this,e[i],t,n);return ue(this)};var $N=new h,oht=new pe;Ax.prototype.getBoundingSphere=function(e,t){let n=this._modelHash[e.id];if(!l(n))return Wt.FAILED;if(n.loadFailed)return Wt.FAILED;let i=n.modelPrimitive;if(!l(i)||!i.show)return Wt.PENDING;if(!i.ready||!n.modelUpdated)return Wt.PENDING;let o=this._scene,r=o.ellipsoid??ne.default;if(i.heightReference!==He.NONE){let a=i.modelMatrix;$N.x=a[12],$N.y=a[13],$N.z=a[14];let c=r.cartesianToCartographic($N,oht),d=o.getHeight(c,i.heightReference);if(l(d)||(d=i._lastSurfaceHeight),!l(d)){let u=this._modelHash,m=zh(o,n,$N,[i],()=>u[e.id]===n);if(m===void 0)return Wt.PENDING;m!==null&&(d=m)}return l(d)&&(i.heightReference===He.CLIP_TO_GROUND?c.height<d&&(c.height=d):gs(i.heightReference)?c.height=d:c.height+=d),me.clone(i.boundingSphere,t),t.center=r.cartographicToCartesian(c),Wt.DONE}return me.clone(i.boundingSphere,t),Wt.DONE};Ax.prototype._onCollectionChanged=function(e,t,n,i){let o,r,s=this._entitiesToVisualize,a=this._modelHash,c=this._primitives;for(o=t.length-1;o>-1;o--)r=t[o],l(r._model)&&l(r._position)&&s.set(r.id,r);for(o=i.length-1;o>-1;o--)r=i[o],l(r._model)&&l(r._position)?(rht(r,a),s.set(r.id,r)):(h$(this,r,a,c),s.remove(r.id));for(o=n.length-1;o>-1;o--)r=n[o],h$(this,r,a,c),s.remove(r.id)};function h$(e,t,n,i){let o=n[t.id];l(o)&&(i.removeAndDestroy(o.modelPrimitive),delete n[t.id])}function rht(e,t){let n=t[e.id];l(n)&&(n.nodeTransformationsScratch={},n.articulationsScratch={})}var eY=Ax;var yki=x(T(),1);var aki=x(T(),1);var VVi=x(T(),1);function t0(e){e=e??0,this._array=new Array(e),this._length=e}Object.defineProperties(t0.prototype,{length:{get:function(){return this._length},set:function(e){let t=this._array,n=this._length;if(e<n)for(let i=e;i<n;++i)t[i]=void 0;else e>t.length&&(t.length=e);this._length=e}},values:{get:function(){return this._array}}});t0.prototype.get=function(e){return this._array[e]};t0.prototype.set=function(e,t){e>=this._length&&(this.length=e+1),this._array[e]=t};t0.prototype.peek=function(){return this._array[this._length-1]};t0.prototype.push=function(e){let t=this.length++;this._array[t]=e};t0.prototype.pop=function(){if(this._length===0)return;let e=this._array[this._length-1];return--this.length,e};t0.prototype.reserve=function(e){e>this._array.length&&(this._array.length=e)};t0.prototype.resize=function(e){this.length=e};t0.prototype.trim=function(e){e=e??this._length,this._array.length=e};var cd=t0;var sMi=x(T(),1);var GVi=x(T(),1);function DZe(e){e=e??B.EMPTY_OBJECT,this._metadata=e.metadata}Object.defineProperties(DZe.prototype,{metadata:{get:function(){return this._metadata}}});var DS=DZe;var QPi=x(T(),1);var XVi=x(T(),1);var f$=class e{constructor(t,n,i,o){this._tileset=t,this._tile=n,this._resource=i,l(o)||(o=[]),this._contents=o,this._metadata=void 0,this._group=void 0,this._ready=!1}get featurePropertiesDirty(){let t=this._contents,n=t.length;for(let i=0;i<n;++i)if(t[i].featurePropertiesDirty)return!0;return!1}set featurePropertiesDirty(t){let n=this._contents,i=n.length;for(let o=0;o<i;++o)n[o].featurePropertiesDirty=t}get featuresLength(){return 0}get pointsLength(){return 0}get trianglesLength(){return 0}get geometryByteLength(){return 0}get texturesByteLength(){return 0}get batchTableByteLength(){return 0}get innerContents(){return this._contents}get ready(){return this._ready}get tileset(){return this._tileset}get tile(){return this._tile}get url(){return this._resource.getUrlComponent(!0)}get metadata(){return this._metadata}set metadata(t){this._metadata=t;let n=this._contents,i=n.length;for(let o=0;o<i;++o)n[o].metadata=t}get batchTable(){}get group(){return this._group}set group(t){this._group=t;let n=this._contents,i=n.length;for(let o=0;o<i;++o)n[o].group=t}static async fromTileType(t,n,i,o,r,s){r=r??0;let a=new Uint8Array(o),c=new DataView(o);r+=tY;let d=c.getUint32(r,!0);if(d!==1)throw new ae(`Only Composite Tile version 1 is supported. Version ${d} is not.`);r+=tY,r+=tY;let u=c.getUint32(r,!0);r+=tY;let m=i.queryParameters.compositeIndex;l(m)?m=`${m}_`:m="";let p=[];p.length=u;for(let y=0;y<u;++y){let _=bf(a,r),S=c.getUint32(r+tY*2,!0),Z=s[_],R=`${m}${y}`,C=i.getDerivedResource({queryParameters:{compositeIndex:R}});if(l(Z))p[y]=Promise.resolve(Z(t,n,C,o,r));else throw new ae(`Unknown tile content type, ${_}, inside Composite tile`);r+=S}let b=await Promise.all(p);return new e(t,n,i,b)}hasProperty(t,n){return!1}getFeature(t){}applyDebugSettings(t,n){let i=this._contents,o=i.length;for(let r=0;r<o;++r)i[r].applyDebugSettings(t,n)}applyStyle(t){let n=this._contents,i=n.length;for(let o=0;o<i;++o)n[o].applyStyle(t)}update(t,n){let i=this._contents,o=i.length,r=!0;for(let s=0;s<o;++s)i[s].update(t,n),r=r&&i[s].ready;!this._ready&&r&&(this._ready=!0)}pick(t,n,i){if(!this._ready)return;let o,r=Number.POSITIVE_INFINITY,s=this._contents,a=s.length;for(let c=0;c<a;++c){let d=s[c].pick(t,n,i);if(!l(d))continue;let u=h.distance(t.origin,d);u<r&&(o=d,r=u)}if(l(o))return i}isDestroyed(){return!1}destroy(){let t=this._contents,n=t.length;for(let i=0;i<n;++i)t[i].destroy();return ue(this)}},tY=Uint32Array.BYTES_PER_ELEMENT,nY=f$;var qEi=x(T(),1);var UEi=x(T(),1);var YVi=x(T(),1);function sht(e){this.offset=e.offset,this.count=e.count,this.color=e.color,this.batchIds=e.batchIds}var n0=sht;var LEi=x(T(),1);var eEi=x(T(),1);var kVi=x(T(),1),p$=class{add(t,n,i){if(typeof arguments[0]!="string")for(let o in arguments[0])this.add(o,arguments[0][o],arguments[1]);else(Array.isArray(t)?t:[t]).forEach(function(o){this[o]=this[o]||[],n&&this[o][i?"unshift":"push"](n)},this)}run(t,n){this[t]=this[t]||[],this[t].forEach(function(i){i.call(n&&n.context?n.context:n,n)})}},b$=class{constructor(t){this.jsep=t,this.registered={}}register(...t){t.forEach(n=>{if(typeof n!="object"||!n.name||!n.init)throw new Error("Invalid JSEP plugin format");this.registered[n.name]||(n.init(this.jsep),this.registered[n.name]=n)})}},Kd=class e{static get version(){return"1.4.0"}static toString(){return"JavaScript Expression Parser (JSEP) v"+e.version}static addUnaryOp(t){return e.max_unop_len=Math.max(t.length,e.max_unop_len),e.unary_ops[t]=1,e}static addBinaryOp(t,n,i){return e.max_binop_len=Math.max(t.length,e.max_binop_len),e.binary_ops[t]=n,i?e.right_associative.add(t):e.right_associative.delete(t),e}static addIdentifierChar(t){return e.additional_identifier_chars.add(t),e}static addLiteral(t,n){return e.literals[t]=n,e}static removeUnaryOp(t){return delete e.unary_ops[t],t.length===e.max_unop_len&&(e.max_unop_len=e.getMaxKeyLen(e.unary_ops)),e}static removeAllUnaryOps(){return e.unary_ops={},e.max_unop_len=0,e}static removeIdentifierChar(t){return e.additional_identifier_chars.delete(t),e}static removeBinaryOp(t){return delete e.binary_ops[t],t.length===e.max_binop_len&&(e.max_binop_len=e.getMaxKeyLen(e.binary_ops)),e.right_associative.delete(t),e}static removeAllBinaryOps(){return e.binary_ops={},e.max_binop_len=0,e}static removeLiteral(t){return delete e.literals[t],e}static removeAllLiterals(){return e.literals={},e}get char(){return this.expr.charAt(this.index)}get code(){return this.expr.charCodeAt(this.index)}constructor(t){this.expr=t,this.index=0}static parse(t){return new e(t).parse()}static getMaxKeyLen(t){return Math.max(0,...Object.keys(t).map(n=>n.length))}static isDecimalDigit(t){return t>=48&&t<=57}static binaryPrecedence(t){return e.binary_ops[t]||0}static isIdentifierStart(t){return t>=65&&t<=90||t>=97&&t<=122||t>=128&&!e.binary_ops[String.fromCharCode(t)]||e.additional_identifier_chars.has(String.fromCharCode(t))}static isIdentifierPart(t){return e.isIdentifierStart(t)||e.isDecimalDigit(t)}throwError(t){let n=new Error(t+" at character "+this.index);throw n.index=this.index,n.description=t,n}runHook(t,n){if(e.hooks[t]){let i={context:this,node:n};return e.hooks.run(t,i),i.node}return n}searchHook(t){if(e.hooks[t]){let n={context:this};return e.hooks[t].find(function(i){return i.call(n.context,n),n.node}),n.node}}gobbleSpaces(){let t=this.code;for(;t===e.SPACE_CODE||t===e.TAB_CODE||t===e.LF_CODE||t===e.CR_CODE;)t=this.expr.charCodeAt(++this.index);this.runHook("gobble-spaces")}parse(){this.runHook("before-all");let t=this.gobbleExpressions(),n=t.length===1?t[0]:{type:e.COMPOUND,body:t};return this.runHook("after-all",n)}gobbleExpressions(t){let n=[],i,o;for(;this.index<this.expr.length;)if(i=this.code,i===e.SEMCOL_CODE||i===e.COMMA_CODE)this.index++;else if(o=this.gobbleExpression())n.push(o);else if(this.index<this.expr.length){if(i===t)break;this.throwError('Unexpected "'+this.char+'"')}return n}gobbleExpression(){let t=this.searchHook("gobble-expression")||this.gobbleBinaryExpression();return this.gobbleSpaces(),this.runHook("after-expression",t)}gobbleBinaryOp(){this.gobbleSpaces();let t=this.expr.substr(this.index,e.max_binop_len),n=t.length;for(;n>0;){if(e.binary_ops.hasOwnProperty(t)&&(!e.isIdentifierStart(this.code)||this.index+t.length<this.expr.length&&!e.isIdentifierPart(this.expr.charCodeAt(this.index+t.length))))return this.index+=n,t;t=t.substr(0,--n)}return!1}gobbleBinaryExpression(){let t,n,i,o,r,s,a,c,d;if(s=this.gobbleToken(),!s||(n=this.gobbleBinaryOp(),!n))return s;for(r={value:n,prec:e.binaryPrecedence(n),right_a:e.right_associative.has(n)},a=this.gobbleToken(),a||this.throwError("Expected expression after "+n),o=[s,r,a];n=this.gobbleBinaryOp();){if(i=e.binaryPrecedence(n),i===0){this.index-=n.length;break}r={value:n,prec:i,right_a:e.right_associative.has(n)},d=n;let u=m=>r.right_a&&m.right_a?i>m.prec:i<=m.prec;for(;o.length>2&&u(o[o.length-2]);)a=o.pop(),n=o.pop().value,s=o.pop(),t={type:e.BINARY_EXP,operator:n,left:s,right:a},o.push(t);t=this.gobbleToken(),t||this.throwError("Expected expression after "+d),o.push(r,t)}for(c=o.length-1,t=o[c];c>1;)t={type:e.BINARY_EXP,operator:o[c-1].value,left:o[c-2],right:t},c-=2;return t}gobbleToken(){let t,n,i,o;if(this.gobbleSpaces(),o=this.searchHook("gobble-token"),o)return this.runHook("after-token",o);if(t=this.code,e.isDecimalDigit(t)||t===e.PERIOD_CODE)return this.gobbleNumericLiteral();if(t===e.SQUOTE_CODE||t===e.DQUOTE_CODE)o=this.gobbleStringLiteral();else if(t===e.OBRACK_CODE)o=this.gobbleArray();else{for(n=this.expr.substr(this.index,e.max_unop_len),i=n.length;i>0;){if(e.unary_ops.hasOwnProperty(n)&&(!e.isIdentifierStart(this.code)||this.index+n.length<this.expr.length&&!e.isIdentifierPart(this.expr.charCodeAt(this.index+n.length)))){this.index+=i;let r=this.gobbleToken();return r||this.throwError("missing unaryOp argument"),this.runHook("after-token",{type:e.UNARY_EXP,operator:n,argument:r,prefix:!0})}n=n.substr(0,--i)}e.isIdentifierStart(t)?(o=this.gobbleIdentifier(),e.literals.hasOwnProperty(o.name)?o={type:e.LITERAL,value:e.literals[o.name],raw:o.name}:o.name===e.this_str&&(o={type:e.THIS_EXP})):t===e.OPAREN_CODE&&(o=this.gobbleGroup())}return o?(o=this.gobbleTokenProperty(o),this.runHook("after-token",o)):this.runHook("after-token",!1)}gobbleTokenProperty(t){this.gobbleSpaces();let n=this.code;for(;n===e.PERIOD_CODE||n===e.OBRACK_CODE||n===e.OPAREN_CODE||n===e.QUMARK_CODE;){let i;if(n===e.QUMARK_CODE){if(this.expr.charCodeAt(this.index+1)!==e.PERIOD_CODE)break;i=!0,this.index+=2,this.gobbleSpaces(),n=this.code}this.index++,n===e.OBRACK_CODE?(t={type:e.MEMBER_EXP,computed:!0,object:t,property:this.gobbleExpression()},t.property||this.throwError('Unexpected "'+this.char+'"'),this.gobbleSpaces(),n=this.code,n!==e.CBRACK_CODE&&this.throwError("Unclosed ["),this.index++):n===e.OPAREN_CODE?t={type:e.CALL_EXP,arguments:this.gobbleArguments(e.CPAREN_CODE),callee:t}:(n===e.PERIOD_CODE||i)&&(i&&this.index--,this.gobbleSpaces(),t={type:e.MEMBER_EXP,computed:!1,object:t,property:this.gobbleIdentifier()}),i&&(t.optional=!0),this.gobbleSpaces(),n=this.code}return t}gobbleNumericLiteral(){let t="",n,i;for(;e.isDecimalDigit(this.code);)t+=this.expr.charAt(this.index++);if(this.code===e.PERIOD_CODE)for(t+=this.expr.charAt(this.index++);e.isDecimalDigit(this.code);)t+=this.expr.charAt(this.index++);if(n=this.char,n==="e"||n==="E"){for(t+=this.expr.charAt(this.index++),n=this.char,(n==="+"||n==="-")&&(t+=this.expr.charAt(this.index++));e.isDecimalDigit(this.code);)t+=this.expr.charAt(this.index++);e.isDecimalDigit(this.expr.charCodeAt(this.index-1))||this.throwError("Expected exponent ("+t+this.char+")")}return i=this.code,e.isIdentifierStart(i)?this.throwError("Variable names cannot start with a number ("+t+this.char+")"):(i===e.PERIOD_CODE||t.length===1&&t.charCodeAt(0)===e.PERIOD_CODE)&&this.throwError("Unexpected period"),{type:e.LITERAL,value:parseFloat(t),raw:t}}gobbleStringLiteral(){let t="",n=this.index,i=this.expr.charAt(this.index++),o=!1;for(;this.index<this.expr.length;){let r=this.expr.charAt(this.index++);if(r===i){o=!0;break}else if(r==="\\")switch(r=this.expr.charAt(this.index++),r){case"n":t+=` +`;break;case"r":t+="\r";break;case"t":t+=" ";break;case"b":t+="\b";break;case"f":t+="\f";break;case"v":t+="\v";break;default:t+=r}else t+=r}return o||this.throwError('Unclosed quote after "'+t+'"'),{type:e.LITERAL,value:t,raw:this.expr.substring(n,this.index)}}gobbleIdentifier(){let t=this.code,n=this.index;for(e.isIdentifierStart(t)?this.index++:this.throwError("Unexpected "+this.char);this.index<this.expr.length&&(t=this.code,e.isIdentifierPart(t));)this.index++;return{type:e.IDENTIFIER,name:this.expr.slice(n,this.index)}}gobbleArguments(t){let n=[],i=!1,o=0;for(;this.index<this.expr.length;){this.gobbleSpaces();let r=this.code;if(r===t){i=!0,this.index++,t===e.CPAREN_CODE&&o&&o>=n.length&&this.throwError("Unexpected token "+String.fromCharCode(t));break}else if(r===e.COMMA_CODE){if(this.index++,o++,o!==n.length){if(t===e.CPAREN_CODE)this.throwError("Unexpected token ,");else if(t===e.CBRACK_CODE)for(let s=n.length;s<o;s++)n.push(null)}}else if(n.length!==o&&o!==0)this.throwError("Expected comma");else{let s=this.gobbleExpression();(!s||s.type===e.COMPOUND)&&this.throwError("Expected comma"),n.push(s)}}return i||this.throwError("Expected "+String.fromCharCode(t)),n}gobbleGroup(){this.index++;let t=this.gobbleExpressions(e.CPAREN_CODE);if(this.code===e.CPAREN_CODE)return this.index++,t.length===1?t[0]:t.length?{type:e.SEQUENCE_EXP,expressions:t}:!1;this.throwError("Unclosed (")}gobbleArray(){return this.index++,{type:e.ARRAY_EXP,elements:this.gobbleArguments(e.CBRACK_CODE)}}},aht=new p$;Object.assign(Kd,{hooks:aht,plugins:new b$(Kd),COMPOUND:"Compound",SEQUENCE_EXP:"SequenceExpression",IDENTIFIER:"Identifier",MEMBER_EXP:"MemberExpression",LITERAL:"Literal",THIS_EXP:"ThisExpression",CALL_EXP:"CallExpression",UNARY_EXP:"UnaryExpression",BINARY_EXP:"BinaryExpression",ARRAY_EXP:"ArrayExpression",TAB_CODE:9,LF_CODE:10,CR_CODE:13,SPACE_CODE:32,PERIOD_CODE:46,COMMA_CODE:44,SQUOTE_CODE:39,DQUOTE_CODE:34,OPAREN_CODE:40,CPAREN_CODE:41,OBRACK_CODE:91,CBRACK_CODE:93,QUMARK_CODE:63,SEMCOL_CODE:59,COLON_CODE:58,unary_ops:{"-":1,"!":1,"~":1,"+":1},binary_ops:{"||":1,"??":1,"&&":2,"|":3,"^":4,"&":5,"==":6,"!=":6,"===":6,"!==":6,"<":7,">":7,"<=":7,">=":7,"<<":8,">>":8,">>>":8,"+":9,"-":9,"*":10,"/":10,"%":10,"**":11},right_associative:new Set(["**"]),additional_identifier_chars:new Set(["$","_"]),literals:{true:!0,false:!1,null:null},this_str:"this"});Kd.max_unop_len=Kd.getMaxKeyLen(Kd.unary_ops);Kd.max_binop_len=Kd.getMaxKeyLen(Kd.binary_ops);var Gx=e=>new Kd(e).parse(),cht=Object.getOwnPropertyNames(class{});Object.getOwnPropertyNames(Kd).filter(e=>!cht.includes(e)&&Gx[e]===void 0).forEach(e=>{Gx[e]=Kd[e]});Gx.Jsep=Kd;var lht="ConditionalExpression",dht={name:"ternary",init(e){e.hooks.add("after-expression",function(n){if(n.node&&this.code===e.QUMARK_CODE){this.index++;let i=n.node,o=this.gobbleExpression();if(o||this.throwError("Expected expression"),this.gobbleSpaces(),this.code===e.COLON_CODE){this.index++;let r=this.gobbleExpression();if(r||this.throwError("Expected expression"),n.node={type:lht,test:i,consequent:o,alternate:r},i.operator&&e.binary_ops[i.operator]<=.9){let s=i;for(;s.right.operator&&e.binary_ops[s.right.operator]<=.9;)s=s.right;n.node.test=s.right,s.right=n.node,n.node=i}}else this.throwError("Expected :")}})}};Gx.plugins.register(dht);var DVi=x(T(),1),OZe={VARIABLE:0,UNARY:1,BINARY:2,TERNARY:3,CONDITIONAL:4,MEMBER:5,FUNCTION_CALL:6,ARRAY:7,REGEX:8,VARIABLE_IN_STRING:9,LITERAL_NULL:10,LITERAL_BOOLEAN:11,LITERAL_NUMBER:12,LITERAL_STRING:13,LITERAL_COLOR:14,LITERAL_VECTOR:15,LITERAL_REGEX:16,LITERAL_UNDEFINED:17,BUILTIN_VARIABLE:18};Object.freeze(OZe);var Pt=OZe;function Af(e,t){this._expression=e,e=Zht(e,t),e=Cht(Rht(e)),Gx.addBinaryOp("=~",0),Gx.addBinaryOp("!~",0);let n;try{n=Gx(e)}catch(i){throw new ae(i)}this._runtimeAst=ji(this,n)}Object.defineProperties(Af.prototype,{expression:{get:function(){return this._expression}}});var kn={arrayIndex:0,arrayArray:[[]],cartesian2Index:0,cartesian3Index:0,cartesian4Index:0,cartesian2Array:[new k],cartesian3Array:[new h],cartesian4Array:[new ce],reset:function(){this.arrayIndex=0,this.cartesian2Index=0,this.cartesian3Index=0,this.cartesian4Index=0},getArray:function(){this.arrayIndex>=this.arrayArray.length&&this.arrayArray.push([]);let e=this.arrayArray[this.arrayIndex++];return e.length=0,e},getCartesian2:function(){return this.cartesian2Index>=this.cartesian2Array.length&&this.cartesian2Array.push(new k),this.cartesian2Array[this.cartesian2Index++]},getCartesian3:function(){return this.cartesian3Index>=this.cartesian3Array.length&&this.cartesian3Array.push(new h),this.cartesian3Array[this.cartesian3Index++]},getCartesian4:function(){return this.cartesian4Index>=this.cartesian4Array.length&&this.cartesian4Array.push(new ce),this.cartesian4Array[this.cartesian4Index++]}};Af.prototype.evaluate=function(e,t){kn.reset();let n=this._runtimeAst.evaluate(e);return t instanceof U&&n instanceof ce?U.fromCartesian4(n,t):n instanceof k||n instanceof h||n instanceof ce?n.clone(t):n};Af.prototype.evaluateColor=function(e,t){kn.reset();let n=this._runtimeAst.evaluate(e);return U.fromCartesian4(n,t)};Af.prototype.getShaderFunction=function(e,t,n,i){let o=this.getShaderExpression(t,n);return o=`${i} ${e} +{ + return ${o}; +} +`,o};Af.prototype.getShaderExpression=function(e,t){return this._runtimeAst.getShaderExpression(e,t)};Af.prototype.getVariables=function(){let e=[];return this._runtimeAst.getVariables(e),e=e.filter(function(t,n,i){return i.indexOf(t)===n}),e};var uht=["!","-","+"],BZe=["+","-","*","/","%","===","!==",">",">=","<","<=","&&","||","!~","=~"],iY=/\${(.*?)}/g,mht=/\\/g,hht="@#%",fht=/@#%/g,i3=new U,o3={abs:Ba(Math.abs),sqrt:Ba(Math.sqrt),cos:Ba(Math.cos),sin:Ba(Math.sin),tan:Ba(Math.tan),acos:Ba(Math.acos),asin:Ba(Math.asin),atan:Ba(Math.atan),radians:Ba(W.toRadians),degrees:Ba(W.toDegrees),sign:Ba(W.sign),floor:Ba(Math.floor),ceil:Ba(Math.ceil),round:Ba(Math.round),exp:Ba(Math.exp),exp2:Ba(bht),log:Ba(Math.log),log2:Ba(ght),fract:Ba(pht),length:yht,normalize:xht},r3={atan2:t3(Math.atan2,!1),pow:t3(Math.pow,!1),min:t3(Math.min,!0),max:t3(Math.max,!0),distance:Tht,dot:_ht,cross:Sht},x$={clamp:zZe(W.clamp,!0),mix:zZe(W.lerp,!0)};function pht(e){return e-Math.floor(e)}function bht(e){return Math.pow(2,e)}function ght(e){return W.log2(e)}function Ba(e){return function(t,n){if(typeof n=="number")return e(n);if(n instanceof k)return k.fromElements(e(n.x),e(n.y),kn.getCartesian2());if(n instanceof h)return h.fromElements(e(n.x),e(n.y),e(n.z),kn.getCartesian3());if(n instanceof ce)return ce.fromElements(e(n.x),e(n.y),e(n.z),e(n.w),kn.getCartesian4());throw new ae(`Function "${t}" requires a vector or number argument. Argument is ${n}.`)}}function t3(e,t){return function(n,i,o){if(t&&typeof o=="number"){if(typeof i=="number")return e(i,o);if(i instanceof k)return k.fromElements(e(i.x,o),e(i.y,o),kn.getCartesian2());if(i instanceof h)return h.fromElements(e(i.x,o),e(i.y,o),e(i.z,o),kn.getCartesian3());if(i instanceof ce)return ce.fromElements(e(i.x,o),e(i.y,o),e(i.z,o),e(i.w,o),kn.getCartesian4())}if(typeof i=="number"&&typeof o=="number")return e(i,o);if(i instanceof k&&o instanceof k)return k.fromElements(e(i.x,o.x),e(i.y,o.y),kn.getCartesian2());if(i instanceof h&&o instanceof h)return h.fromElements(e(i.x,o.x),e(i.y,o.y),e(i.z,o.z),kn.getCartesian3());if(i instanceof ce&&o instanceof ce)return ce.fromElements(e(i.x,o.x),e(i.y,o.y),e(i.z,o.z),e(i.w,o.w),kn.getCartesian4());throw new ae(`Function "${n}" requires vector or number arguments of matching types. Arguments are ${i} and ${o}.`)}}function zZe(e,t){return function(n,i,o,r){if(t&&typeof r=="number"){if(typeof i=="number"&&typeof o=="number")return e(i,o,r);if(i instanceof k&&o instanceof k)return k.fromElements(e(i.x,o.x,r),e(i.y,o.y,r),kn.getCartesian2());if(i instanceof h&&o instanceof h)return h.fromElements(e(i.x,o.x,r),e(i.y,o.y,r),e(i.z,o.z,r),kn.getCartesian3());if(i instanceof ce&&o instanceof ce)return ce.fromElements(e(i.x,o.x,r),e(i.y,o.y,r),e(i.z,o.z,r),e(i.w,o.w,r),kn.getCartesian4())}if(typeof i=="number"&&typeof o=="number"&&typeof r=="number")return e(i,o,r);if(i instanceof k&&o instanceof k&&r instanceof k)return k.fromElements(e(i.x,o.x,r.x),e(i.y,o.y,r.y),kn.getCartesian2());if(i instanceof h&&o instanceof h&&r instanceof h)return h.fromElements(e(i.x,o.x,r.x),e(i.y,o.y,r.y),e(i.z,o.z,r.z),kn.getCartesian3());if(i instanceof ce&&o instanceof ce&&r instanceof ce)return ce.fromElements(e(i.x,o.x,r.x),e(i.y,o.y,r.y),e(i.z,o.z,r.z),e(i.w,o.w,r.w),kn.getCartesian4());throw new ae(`Function "${n}" requires vector or number arguments of matching types. Arguments are ${i}, ${o}, and ${r}.`)}}function yht(e,t){if(typeof t=="number")return Math.abs(t);if(t instanceof k)return k.magnitude(t);if(t instanceof h)return h.magnitude(t);if(t instanceof ce)return ce.magnitude(t);throw new ae(`Function "${e}" requires a vector or number argument. Argument is ${t}.`)}function xht(e,t){if(typeof t=="number")return 1;if(t instanceof k)return k.normalize(t,kn.getCartesian2());if(t instanceof h)return h.normalize(t,kn.getCartesian3());if(t instanceof ce)return ce.normalize(t,kn.getCartesian4());throw new ae(`Function "${e}" requires a vector or number argument. Argument is ${t}.`)}function Tht(e,t,n){if(typeof t=="number"&&typeof n=="number")return Math.abs(t-n);if(t instanceof k&&n instanceof k)return k.distance(t,n);if(t instanceof h&&n instanceof h)return h.distance(t,n);if(t instanceof ce&&n instanceof ce)return ce.distance(t,n);throw new ae(`Function "${e}" requires vector or number arguments of matching types. Arguments are ${t} and ${n}.`)}function _ht(e,t,n){if(typeof t=="number"&&typeof n=="number")return t*n;if(t instanceof k&&n instanceof k)return k.dot(t,n);if(t instanceof h&&n instanceof h)return h.dot(t,n);if(t instanceof ce&&n instanceof ce)return ce.dot(t,n);throw new ae(`Function "${e}" requires vector or number arguments of matching types. Arguments are ${t} and ${n}.`)}function Sht(e,t,n){if(t instanceof h&&n instanceof h)return h.cross(t,n,kn.getCartesian3());throw new ae(`Function "${e}" requires vec3 arguments. Arguments are ${t} and ${n}.`)}function Mt(e,t,n,i,o){this._type=e,this._value=t,this._left=n,this._right=i,this._test=o,this.evaluate=void 0,Pht(this)}function Zht(e,t){if(!l(t))return e;for(let n in t)if(t.hasOwnProperty(n)){let i=new RegExp(`\\$\\{${n}\\}`,"g"),o=`(${t[n]})`;l(o)&&(e=e.replace(i,o))}return e}function Rht(e){return e.replace(mht,hht)}function y$(e){return e.replace(fht,"\\")}function Cht(e){let t=e,n="",i=t.indexOf("${");for(;i>=0;){let o=t.indexOf("'"),r=t.indexOf('"'),s;if(o>=0&&o<i)s=t.indexOf("'",o+1),n+=t.substr(0,s+1),t=t.substr(s+1),i=t.indexOf("${");else if(r>=0&&r<i)s=t.indexOf('"',r+1),n+=t.substr(0,s+1),t=t.substr(s+1),i=t.indexOf("${");else{n+=t.substr(0,i);let a=t.indexOf("}");if(a<0)throw new ae("Unmatched {.");n+=`czm_${t.substr(i+2,a-(i+2))}`,t=t.substr(a+1),i=t.indexOf("${")}}return n+=t,n}function Vht(e){let t=typeof e.value;if(e.value===null)return new Mt(Pt.LITERAL_NULL,null);if(t==="boolean")return new Mt(Pt.LITERAL_BOOLEAN,e.value);if(t==="number")return new Mt(Pt.LITERAL_NUMBER,e.value);if(t==="string")return e.value.indexOf("${")>=0?new Mt(Pt.VARIABLE_IN_STRING,e.value):new Mt(Pt.LITERAL_STRING,y$(e.value))}function Eht(e,t){let n=t.arguments,i=n.length,o,r,s,a;if(t.callee.type==="MemberExpression"){o=t.callee.property.name;let c=t.callee.object;if(o==="test"||o==="exec"){if(!l(c.callee)||c.callee.name!=="regExp")throw new ae(`${o} is not a function.`);return i===0?o==="test"?new Mt(Pt.LITERAL_BOOLEAN,!1):new Mt(Pt.LITERAL_NULL,null):(s=ji(e,c),a=ji(e,n[0]),new Mt(Pt.FUNCTION_CALL,o,s,a))}else if(o==="toString")return r=ji(e,c),new Mt(Pt.FUNCTION_CALL,o,r);throw new ae(`Unexpected function call "${o}".`)}if(o=t.callee.name,o==="color"){if(i===0)return new Mt(Pt.LITERAL_COLOR,o);if(r=ji(e,n[0]),l(n[1])){let c=ji(e,n[1]);return new Mt(Pt.LITERAL_COLOR,o,[r,c])}return new Mt(Pt.LITERAL_COLOR,o,[r])}else if(o==="rgb"||o==="hsl"){if(i<3)throw new ae(`${o} requires three arguments.`);return r=[ji(e,n[0]),ji(e,n[1]),ji(e,n[2])],new Mt(Pt.LITERAL_COLOR,o,r)}else if(o==="rgba"||o==="hsla"){if(i<4)throw new ae(`${o} requires four arguments.`);return r=[ji(e,n[0]),ji(e,n[1]),ji(e,n[2]),ji(e,n[3])],new Mt(Pt.LITERAL_COLOR,o,r)}else if(o==="vec2"||o==="vec3"||o==="vec4"){r=new Array(i);for(let c=0;c<i;++c)r[c]=ji(e,n[c]);return new Mt(Pt.LITERAL_VECTOR,o,r)}else{if(o==="isNaN"||o==="isFinite")return i===0?o==="isNaN"?new Mt(Pt.LITERAL_BOOLEAN,!0):new Mt(Pt.LITERAL_BOOLEAN,!1):(r=ji(e,n[0]),new Mt(Pt.UNARY,o,r));if(o==="isExactClass"||o==="isClass"){if(i<1||i>1)throw new ae(`${o} requires exactly one argument.`);return r=ji(e,n[0]),new Mt(Pt.UNARY,o,r)}else if(o==="getExactClassName"){if(i>0)throw new ae(`${o} does not take any argument.`);return new Mt(Pt.UNARY,o)}else if(l(o3[o])){if(i!==1)throw new ae(`${o} requires exactly one argument.`);return r=ji(e,n[0]),new Mt(Pt.UNARY,o,r)}else if(l(r3[o])){if(i!==2)throw new ae(`${o} requires exactly two arguments.`);return s=ji(e,n[0]),a=ji(e,n[1]),new Mt(Pt.BINARY,o,s,a)}else if(l(x$[o])){if(i!==3)throw new ae(`${o} requires exactly three arguments.`);s=ji(e,n[0]),a=ji(e,n[1]);let c=ji(e,n[2]);return new Mt(Pt.TERNARY,o,s,a,c)}else{if(o==="Boolean")return i===0?new Mt(Pt.LITERAL_BOOLEAN,!1):(r=ji(e,n[0]),new Mt(Pt.UNARY,o,r));if(o==="Number")return i===0?new Mt(Pt.LITERAL_NUMBER,0):(r=ji(e,n[0]),new Mt(Pt.UNARY,o,r));if(o==="String")return i===0?new Mt(Pt.LITERAL_STRING,""):(r=ji(e,n[0]),new Mt(Pt.UNARY,o,r));if(o==="regExp")return Aht(e,t)}}throw new ae(`Unexpected function call "${o}".`)}function Aht(e,t){let n=t.arguments;if(n.length===0)return new Mt(Pt.LITERAL_REGEX,new RegExp);let i=ji(e,n[0]),o;if(n.length>1){let r=ji(e,n[1]);if(g$(i)&&g$(r)){try{o=new RegExp(y$(String(i._value)),r._value)}catch(s){throw new ae(s)}return new Mt(Pt.LITERAL_REGEX,o)}return new Mt(Pt.REGEX,i,r)}if(g$(i)){try{o=new RegExp(y$(String(i._value)))}catch(r){throw new ae(r)}return new Mt(Pt.LITERAL_REGEX,o)}return new Mt(Pt.REGEX,i)}function Ght(e){if(Fht(e.name)){let t=Iht(e.name);return t.substr(0,8)==="tiles3d_"?new Mt(Pt.BUILTIN_VARIABLE,t):new Mt(Pt.VARIABLE,t)}else{if(e.name==="NaN")return new Mt(Pt.LITERAL_NUMBER,NaN);if(e.name==="Infinity")return new Mt(Pt.LITERAL_NUMBER,1/0);if(e.name==="undefined")return new Mt(Pt.LITERAL_UNDEFINED,void 0)}throw new ae(`${e.name} is not defined.`)}function Lht(e){let t=e.property.name;if(t==="PI")return new Mt(Pt.LITERAL_NUMBER,Math.PI);if(t==="E")return new Mt(Pt.LITERAL_NUMBER,Math.E)}function Wht(e){if(e.property.name==="POSITIVE_INFINITY")return new Mt(Pt.LITERAL_NUMBER,Number.POSITIVE_INFINITY)}function vht(e,t){if(t.object.name==="Math")return Lht(t);if(t.object.name==="Number")return Wht(t);let n,i=ji(e,t.object);return t.computed?(n=ji(e,t.property),new Mt(Pt.MEMBER,"brackets",i,n)):(n=new Mt(Pt.LITERAL_STRING,t.property.name),new Mt(Pt.MEMBER,"dot",i,n))}function g$(e){return e._type>=Pt.LITERAL_NULL}function Fht(e){return e.substr(0,4)==="czm_"}function Iht(e){return e.substr(4)}function ji(e,t){let n,i,o,r;if(t.type==="Literal")n=Vht(t);else if(t.type==="CallExpression")n=Eht(e,t);else if(t.type==="Identifier")n=Ght(t);else if(t.type==="UnaryExpression"){i=t.operator;let s=ji(e,t.argument);if(uht.indexOf(i)>-1)n=new Mt(Pt.UNARY,i,s);else throw new ae(`Unexpected operator "${i}".`)}else if(t.type==="BinaryExpression")if(i=t.operator,o=ji(e,t.left),r=ji(e,t.right),BZe.indexOf(i)>-1)n=new Mt(Pt.BINARY,i,o,r);else throw new ae(`Unexpected operator "${i}".`);else if(t.type==="LogicalExpression")i=t.operator,o=ji(e,t.left),r=ji(e,t.right),BZe.indexOf(i)>-1&&(n=new Mt(Pt.BINARY,i,o,r));else if(t.type==="ConditionalExpression"){let s=ji(e,t.test);o=ji(e,t.consequent),r=ji(e,t.alternate),n=new Mt(Pt.CONDITIONAL,"?",o,r,s)}else if(t.type==="MemberExpression")n=vht(e,t);else if(t.type==="ArrayExpression"){let s=[];for(let a=0;a<t.elements.length;a++)s[a]=ji(e,t.elements[a]);n=new Mt(Pt.ARRAY,s)}else throw t.type==="Compound"?new ae("Provide exactly one expression."):new ae("Cannot parse expression.");return n}function Pht(e){e._type===Pt.CONDITIONAL?e.evaluate=e._evaluateConditional:e._type===Pt.FUNCTION_CALL?e._value==="test"?e.evaluate=e._evaluateRegExpTest:e._value==="exec"?e.evaluate=e._evaluateRegExpExec:e._value==="toString"&&(e.evaluate=e._evaluateToString):e._type===Pt.UNARY?e._value==="!"?e.evaluate=e._evaluateNot:e._value==="-"?e.evaluate=e._evaluateNegative:e._value==="+"?e.evaluate=e._evaluatePositive:e._value==="isNaN"?e.evaluate=e._evaluateNaN:e._value==="isFinite"?e.evaluate=e._evaluateIsFinite:e._value==="isExactClass"?e.evaluate=e._evaluateIsExactClass:e._value==="isClass"?e.evaluate=e._evaluateIsClass:e._value==="getExactClassName"?e.evaluate=e._evaluateGetExactClassName:e._value==="Boolean"?e.evaluate=e._evaluateBooleanConversion:e._value==="Number"?e.evaluate=e._evaluateNumberConversion:e._value==="String"?e.evaluate=e._evaluateStringConversion:l(o3[e._value])&&(e.evaluate=Nht(e._value)):e._type===Pt.BINARY?e._value==="+"?e.evaluate=e._evaluatePlus:e._value==="-"?e.evaluate=e._evaluateMinus:e._value==="*"?e.evaluate=e._evaluateTimes:e._value==="/"?e.evaluate=e._evaluateDivide:e._value==="%"?e.evaluate=e._evaluateMod:e._value==="==="?e.evaluate=e._evaluateEqualsStrict:e._value==="!=="?e.evaluate=e._evaluateNotEqualsStrict:e._value==="<"?e.evaluate=e._evaluateLessThan:e._value==="<="?e.evaluate=e._evaluateLessThanOrEquals:e._value===">"?e.evaluate=e._evaluateGreaterThan:e._value===">="?e.evaluate=e._evaluateGreaterThanOrEquals:e._value==="&&"?e.evaluate=e._evaluateAnd:e._value==="||"?e.evaluate=e._evaluateOr:e._value==="=~"?e.evaluate=e._evaluateRegExpMatch:e._value==="!~"?e.evaluate=e._evaluateRegExpNotMatch:l(r3[e._value])&&(e.evaluate=Yht(e._value)):e._type===Pt.TERNARY?e.evaluate=Mht(e._value):e._type===Pt.MEMBER?e._value==="brackets"?e.evaluate=e._evaluateMemberBrackets:e.evaluate=e._evaluateMemberDot:e._type===Pt.ARRAY?e.evaluate=e._evaluateArray:e._type===Pt.VARIABLE?e.evaluate=e._evaluateVariable:e._type===Pt.VARIABLE_IN_STRING?e.evaluate=e._evaluateVariableString:e._type===Pt.LITERAL_COLOR?e.evaluate=e._evaluateLiteralColor:e._type===Pt.LITERAL_VECTOR?e.evaluate=e._evaluateLiteralVector:e._type===Pt.LITERAL_STRING?e.evaluate=e._evaluateLiteralString:e._type===Pt.REGEX?e.evaluate=e._evaluateRegExp:e._type===Pt.BUILTIN_VARIABLE?e._value==="tiles3d_tileset_time"&&(e.evaluate=Xht):e.evaluate=e._evaluateLiteral}function Xht(e){return l(e)?e.content.tileset.timeSinceLoad:0}function Nht(e){let t=o3[e];return function(n){let i=this._left.evaluate(n);return t(e,i)}}function Yht(e){let t=r3[e];return function(n){let i=this._left.evaluate(n),o=this._right.evaluate(n);return t(e,i,o)}}function Mht(e){let t=x$[e];return function(n){let i=this._left.evaluate(n),o=this._right.evaluate(n),r=this._test.evaluate(n);return t(e,i,o,r)}}function s3(e,t){if(l(e))return e.getPropertyInherited(t)}Mt.prototype._evaluateLiteral=function(){return this._value};Mt.prototype._evaluateLiteralColor=function(e){let t=i3,n=this._left;if(this._value==="color")l(n)?n.length>1?(U.fromCssColorString(n[0].evaluate(e),t),t.alpha=n[1].evaluate(e)):U.fromCssColorString(n[0].evaluate(e),t):U.fromBytes(255,255,255,255,t);else if(this._value==="rgb")U.fromBytes(n[0].evaluate(e),n[1].evaluate(e),n[2].evaluate(e),255,t);else if(this._value==="rgba"){let i=n[3].evaluate(e)*255;U.fromBytes(n[0].evaluate(e),n[1].evaluate(e),n[2].evaluate(e),i,t)}else this._value==="hsl"?U.fromHsl(n[0].evaluate(e),n[1].evaluate(e),n[2].evaluate(e),1,t):this._value==="hsla"&&U.fromHsl(n[0].evaluate(e),n[1].evaluate(e),n[2].evaluate(e),n[3].evaluate(e),t);return ce.fromColor(t,kn.getCartesian4())};Mt.prototype._evaluateLiteralVector=function(e){let t=kn.getArray(),n=this._value,i=this._left,o=i.length;for(let a=0;a<o;++a){let c=i[a].evaluate(e);if(typeof c=="number")t.push(c);else if(c instanceof k)t.push(c.x,c.y);else if(c instanceof h)t.push(c.x,c.y,c.z);else if(c instanceof ce)t.push(c.x,c.y,c.z,c.w);else throw new ae(`${n} argument must be a vector or number. Argument is ${c}.`)}let r=t.length,s=parseInt(n.charAt(3));if(r===0)throw new ae(`Invalid ${n} constructor. No valid arguments.`);if(r<s&&r>1)throw new ae(`Invalid ${n} constructor. Not enough arguments.`);if(r>s&&o>1)throw new ae(`Invalid ${n} constructor. Too many arguments.`);if(r===1){let a=t[0];t.push(a,a,a)}if(n==="vec2")return k.fromArray(t,0,kn.getCartesian2());if(n==="vec3")return h.fromArray(t,0,kn.getCartesian3());if(n==="vec4")return ce.fromArray(t,0,kn.getCartesian4())};Mt.prototype._evaluateLiteralString=function(){return this._value};Mt.prototype._evaluateVariableString=function(e){let t=this._value,n=iY.exec(t);for(;n!==null;){let i=n[0],o=n[1],r=s3(e,o);l(r)||(r=""),t=t.replace(i,r),iY.lastIndex+=r.length-i.length,n=iY.exec(t)}return t};Mt.prototype._evaluateVariable=function(e){return s3(e,this._value)};function OS(e){return e._value==="feature"}Mt.prototype._evaluateMemberDot=function(e){if(OS(this._left))return s3(e,this._right.evaluate(e));let t=this._left.evaluate(e);if(!l(t))return;let n=this._right.evaluate(e);if(t instanceof k||t instanceof h||t instanceof ce){if(n==="r")return t.x;if(n==="g")return t.y;if(n==="b")return t.z;if(n==="a")return t.w}return t[n]};Mt.prototype._evaluateMemberBrackets=function(e){if(OS(this._left))return s3(e,this._right.evaluate(e));let t=this._left.evaluate(e);if(!l(t))return;let n=this._right.evaluate(e);if(t instanceof k||t instanceof h||t instanceof ce){if(n===0||n==="r")return t.x;if(n===1||n==="g")return t.y;if(n===2||n==="b")return t.z;if(n===3||n==="a")return t.w}return t[n]};Mt.prototype._evaluateArray=function(e){let t=[];for(let n=0;n<this._value.length;n++)t[n]=this._value[n].evaluate(e);return t};Mt.prototype._evaluateNot=function(e){let t=this._left.evaluate(e);if(typeof t!="boolean")throw new ae(`Operator "!" requires a boolean argument. Argument is ${t}.`);return!t};Mt.prototype._evaluateNegative=function(e){let t=this._left.evaluate(e);if(t instanceof k)return k.negate(t,kn.getCartesian2());if(t instanceof h)return h.negate(t,kn.getCartesian3());if(t instanceof ce)return ce.negate(t,kn.getCartesian4());if(typeof t=="number")return-t;throw new ae(`Operator "-" requires a vector or number argument. Argument is ${t}.`)};Mt.prototype._evaluatePositive=function(e){let t=this._left.evaluate(e);if(!(t instanceof k||t instanceof h||t instanceof ce||typeof t=="number"))throw new ae(`Operator "+" requires a vector or number argument. Argument is ${t}.`);return t};Mt.prototype._evaluateLessThan=function(e){let t=this._left.evaluate(e),n=this._right.evaluate(e);if(typeof t!="number"||typeof n!="number")throw new ae(`Operator "<" requires number arguments. Arguments are ${t} and ${n}.`);return t<n};Mt.prototype._evaluateLessThanOrEquals=function(e){let t=this._left.evaluate(e),n=this._right.evaluate(e);if(typeof t!="number"||typeof n!="number")throw new ae(`Operator "<=" requires number arguments. Arguments are ${t} and ${n}.`);return t<=n};Mt.prototype._evaluateGreaterThan=function(e){let t=this._left.evaluate(e),n=this._right.evaluate(e);if(typeof t!="number"||typeof n!="number")throw new ae(`Operator ">" requires number arguments. Arguments are ${t} and ${n}.`);return t>n};Mt.prototype._evaluateGreaterThanOrEquals=function(e){let t=this._left.evaluate(e),n=this._right.evaluate(e);if(typeof t!="number"||typeof n!="number")throw new ae(`Operator ">=" requires number arguments. Arguments are ${t} and ${n}.`);return t>=n};Mt.prototype._evaluateOr=function(e){let t=this._left.evaluate(e);if(typeof t!="boolean")throw new ae(`Operator "||" requires boolean arguments. First argument is ${t}.`);if(t)return!0;let n=this._right.evaluate(e);if(typeof n!="boolean")throw new ae(`Operator "||" requires boolean arguments. Second argument is ${n}.`);return t||n};Mt.prototype._evaluateAnd=function(e){let t=this._left.evaluate(e);if(typeof t!="boolean")throw new ae(`Operator "&&" requires boolean arguments. First argument is ${t}.`);if(!t)return!1;let n=this._right.evaluate(e);if(typeof n!="boolean")throw new ae(`Operator "&&" requires boolean arguments. Second argument is ${n}.`);return t&&n};Mt.prototype._evaluatePlus=function(e){let t=this._left.evaluate(e),n=this._right.evaluate(e);if(n instanceof k&&t instanceof k)return k.add(t,n,kn.getCartesian2());if(n instanceof h&&t instanceof h)return h.add(t,n,kn.getCartesian3());if(n instanceof ce&&t instanceof ce)return ce.add(t,n,kn.getCartesian4());if(typeof t=="string"||typeof n=="string")return t+n;if(typeof t=="number"&&typeof n=="number")return t+n;throw new ae(`Operator "+" requires vector or number arguments of matching types, or at least one string argument. Arguments are ${t} and ${n}.`)};Mt.prototype._evaluateMinus=function(e){let t=this._left.evaluate(e),n=this._right.evaluate(e);if(n instanceof k&&t instanceof k)return k.subtract(t,n,kn.getCartesian2());if(n instanceof h&&t instanceof h)return h.subtract(t,n,kn.getCartesian3());if(n instanceof ce&&t instanceof ce)return ce.subtract(t,n,kn.getCartesian4());if(typeof t=="number"&&typeof n=="number")return t-n;throw new ae(`Operator "-" requires vector or number arguments of matching types. Arguments are ${t} and ${n}.`)};Mt.prototype._evaluateTimes=function(e){let t=this._left.evaluate(e),n=this._right.evaluate(e);if(n instanceof k&&t instanceof k)return k.multiplyComponents(t,n,kn.getCartesian2());if(n instanceof k&&typeof t=="number")return k.multiplyByScalar(n,t,kn.getCartesian2());if(t instanceof k&&typeof n=="number")return k.multiplyByScalar(t,n,kn.getCartesian2());if(n instanceof h&&t instanceof h)return h.multiplyComponents(t,n,kn.getCartesian3());if(n instanceof h&&typeof t=="number")return h.multiplyByScalar(n,t,kn.getCartesian3());if(t instanceof h&&typeof n=="number")return h.multiplyByScalar(t,n,kn.getCartesian3());if(n instanceof ce&&t instanceof ce)return ce.multiplyComponents(t,n,kn.getCartesian4());if(n instanceof ce&&typeof t=="number")return ce.multiplyByScalar(n,t,kn.getCartesian4());if(t instanceof ce&&typeof n=="number")return ce.multiplyByScalar(t,n,kn.getCartesian4());if(typeof t=="number"&&typeof n=="number")return t*n;throw new ae(`Operator "*" requires vector or number arguments. If both arguments are vectors they must be matching types. Arguments are ${t} and ${n}.`)};Mt.prototype._evaluateDivide=function(e){let t=this._left.evaluate(e),n=this._right.evaluate(e);if(n instanceof k&&t instanceof k)return k.divideComponents(t,n,kn.getCartesian2());if(t instanceof k&&typeof n=="number")return k.divideByScalar(t,n,kn.getCartesian2());if(n instanceof h&&t instanceof h)return h.divideComponents(t,n,kn.getCartesian3());if(t instanceof h&&typeof n=="number")return h.divideByScalar(t,n,kn.getCartesian3());if(n instanceof ce&&t instanceof ce)return ce.divideComponents(t,n,kn.getCartesian4());if(t instanceof ce&&typeof n=="number")return ce.divideByScalar(t,n,kn.getCartesian4());if(typeof t=="number"&&typeof n=="number")return t/n;throw new ae(`Operator "/" requires vector or number arguments of matching types, or a number as the second argument. Arguments are ${t} and ${n}.`)};Mt.prototype._evaluateMod=function(e){let t=this._left.evaluate(e),n=this._right.evaluate(e);if(n instanceof k&&t instanceof k)return k.fromElements(t.x%n.x,t.y%n.y,kn.getCartesian2());if(n instanceof h&&t instanceof h)return h.fromElements(t.x%n.x,t.y%n.y,t.z%n.z,kn.getCartesian3());if(n instanceof ce&&t instanceof ce)return ce.fromElements(t.x%n.x,t.y%n.y,t.z%n.z,t.w%n.w,kn.getCartesian4());if(typeof t=="number"&&typeof n=="number")return t%n;throw new ae(`Operator "%" requires vector or number arguments of matching types. Arguments are ${t} and ${n}.`)};Mt.prototype._evaluateEqualsStrict=function(e){let t=this._left.evaluate(e),n=this._right.evaluate(e);return n instanceof k&&t instanceof k||n instanceof h&&t instanceof h||n instanceof ce&&t instanceof ce?t.equals(n):t===n};Mt.prototype._evaluateNotEqualsStrict=function(e){let t=this._left.evaluate(e),n=this._right.evaluate(e);return n instanceof k&&t instanceof k||n instanceof h&&t instanceof h||n instanceof ce&&t instanceof ce?!t.equals(n):t!==n};Mt.prototype._evaluateConditional=function(e){let t=this._test.evaluate(e);if(typeof t!="boolean")throw new ae(`Conditional argument of conditional expression must be a boolean. Argument is ${t}.`);return t?this._left.evaluate(e):this._right.evaluate(e)};Mt.prototype._evaluateNaN=function(e){return isNaN(this._left.evaluate(e))};Mt.prototype._evaluateIsFinite=function(e){return isFinite(this._left.evaluate(e))};Mt.prototype._evaluateIsExactClass=function(e){return l(e)?e.isExactClass(this._left.evaluate(e)):!1};Mt.prototype._evaluateIsClass=function(e){return l(e)?e.isClass(this._left.evaluate(e)):!1};Mt.prototype._evaluateGetExactClassName=function(e){if(l(e))return e.getExactClassName()};Mt.prototype._evaluateBooleanConversion=function(e){return!!this._left.evaluate(e)};Mt.prototype._evaluateNumberConversion=function(e){return Number(this._left.evaluate(e))};Mt.prototype._evaluateStringConversion=function(e){return String(this._left.evaluate(e))};Mt.prototype._evaluateRegExp=function(e){let t=this._value.evaluate(e),n="";l(this._left)&&(n=this._left.evaluate(e));let i;try{i=new RegExp(t,n)}catch(o){throw new ae(o)}return i};Mt.prototype._evaluateRegExpTest=function(e){let t=this._left.evaluate(e),n=this._right.evaluate(e);if(!(t instanceof RegExp&&typeof n=="string"))throw new ae(`RegExp.test requires the first argument to be a RegExp and the second argument to be a string. Arguments are ${t} and ${n}.`);return t.test(n)};Mt.prototype._evaluateRegExpMatch=function(e){let t=this._left.evaluate(e),n=this._right.evaluate(e);if(t instanceof RegExp&&typeof n=="string")return t.test(n);if(n instanceof RegExp&&typeof t=="string")return n.test(t);throw new ae(`Operator "=~" requires one RegExp argument and one string argument. Arguments are ${t} and ${n}.`)};Mt.prototype._evaluateRegExpNotMatch=function(e){let t=this._left.evaluate(e),n=this._right.evaluate(e);if(t instanceof RegExp&&typeof n=="string")return!t.test(n);if(n instanceof RegExp&&typeof t=="string")return!n.test(t);throw new ae(`Operator "!~" requires one RegExp argument and one string argument. Arguments are ${t} and ${n}.`)};Mt.prototype._evaluateRegExpExec=function(e){let t=this._left.evaluate(e),n=this._right.evaluate(e);if(!(t instanceof RegExp&&typeof n=="string"))throw new ae(`RegExp.exec requires the first argument to be a RegExp and the second argument to be a string. Arguments are ${t} and ${n}.`);let i=t.exec(n);return l(i)?i[1]:null};Mt.prototype._evaluateToString=function(e){let t=this._left.evaluate(e);if(t instanceof RegExp||t instanceof k||t instanceof h||t instanceof ce)return String(t);throw new ae(`Unexpected function call "${this._value}".`)};function HZe(e){let t=e._left,n=t.length;for(let a=0;a<n;++a)if(t[a]._type!==Pt.LITERAL_NUMBER)return;let i=t[0]._value,o=t[1]._value,r=t[2]._value,s=n===4?t[3]._value:1;return U.fromHsl(i,o,r,s,i3)}function KZe(e){let t=e._left,n=t.length;for(let o=0;o<n;++o)if(t[o]._type!==Pt.LITERAL_NUMBER)return;let i=i3;return i.red=t[0]._value/255,i.green=t[1]._value/255,i.blue=t[2]._value/255,i.alpha=n===4?t[3]._value:1,i}function Lx(e){return e%1===0?e.toFixed(1):e.toString()}function wht(e){let t=Lx(e.red),n=Lx(e.green),i=Lx(e.blue);return`vec3(${t}, ${n}, ${i})`}function n3(e){let t=Lx(e.red),n=Lx(e.green),i=Lx(e.blue),o=Lx(e.alpha);return`vec4(${t}, ${n}, ${i}, ${o})`}function JZe(e,t,n,i){let o=e.length,r=new Array(o);for(let s=0;s<o;++s)r[s]=e[s].getShaderExpression(t,n,i);return r}function jZe(e,t){return l(t[e])?t[e]:Af.NULL_SENTINEL}Af.NULL_SENTINEL="czm_infinity";Mt.prototype.getShaderExpression=function(e,t,n){let i,o,r,s,a=this._type,c=this._value;l(this._left)&&(Array.isArray(this._left)?o=JZe(this._left,e,t,this):o=this._left.getShaderExpression(e,t,this)),l(this._right)&&(r=this._right.getShaderExpression(e,t,this)),l(this._test)&&(s=this._test.getShaderExpression(e,t,this)),Array.isArray(this._value)&&(c=JZe(this._value,e,t,this));let d,u,m;switch(a){case Pt.VARIABLE:return OS(this)?void 0:jZe(c,e);case Pt.UNARY:if(c==="Boolean")return`bool(${o})`;if(c==="Number")return`float(${o})`;if(c==="round")return`floor(${o} + 0.5)`;if(l(o3[c]))return`${c}(${o})`;if(c==="isNaN")return`(${o} != ${o})`;if(c==="isFinite")return`(abs(${o}) < czm_infinity)`;if(c==="String"||c==="isExactClass"||c==="isClass"||c==="getExactClassName")throw new ae(`Error generating style shader: "${c}" is not supported.`);return c+o;case Pt.BINARY:return c==="%"?`mod(${o}, ${r})`:c==="==="?`(${o} == ${r})`:c==="!=="?`(${o} != ${r})`:c==="atan2"?`atan(${o}, ${r})`:l(r3[c])?`${c}(${o}, ${r})`:`(${o} ${c} ${r})`;case Pt.TERNARY:if(l(x$[c]))return`${c}(${o}, ${r}, ${s})`;break;case Pt.CONDITIONAL:return`(${s} ? ${o} : ${r})`;case Pt.MEMBER:return OS(this._left)?jZe(r,e):r==="r"||r==="x"||r==="0.0"?`${o}[0]`:r==="g"||r==="y"||r==="1.0"?`${o}[1]`:r==="b"||r==="z"||r==="2.0"?`${o}[2]`:r==="a"||r==="w"||r==="3.0"?`${o}[3]`:`${o}[int(${r})]`;case Pt.FUNCTION_CALL:throw new ae(`Error generating style shader: "${c}" is not supported.`);case Pt.ARRAY:if(c.length===4)return`vec4(${c[0]}, ${c[1]}, ${c[2]}, ${c[3]})`;if(c.length===3)return`vec3(${c[0]}, ${c[1]}, ${c[2]})`;if(c.length===2)return`vec2(${c[0]}, ${c[1]})`;throw new ae("Error generating style shader: Invalid array length. Array length should be 2, 3, or 4.");case Pt.REGEX:throw new ae("Error generating style shader: Regular expressions are not supported.");case Pt.VARIABLE_IN_STRING:throw new ae("Error generating style shader: Converting a variable to a string is not supported.");case Pt.LITERAL_NULL:return Af.NULL_SENTINEL;case Pt.LITERAL_BOOLEAN:return c?"true":"false";case Pt.LITERAL_NUMBER:return Lx(c);case Pt.LITERAL_STRING:if(l(n)&&n._type===Pt.MEMBER&&(c==="r"||c==="g"||c==="b"||c==="a"||c==="x"||c==="y"||c==="z"||c==="w"||OS(n._left)))return c;if(i=U.fromCssColorString(c,i3),l(i))return wht(i);throw new ae("Error generating style shader: String literals are not supported.");case Pt.LITERAL_COLOR:if(d=o,c==="color"){if(l(d)){if(d.length>1){let p=d[0],b=d[1];return b!=="1.0"&&(t.translucent=!0),`vec4(${p}, ${b})`}}else return"vec4(1.0)";return`vec4(${d[0]}, 1.0)`}else{if(c==="rgb")return i=KZe(this),l(i)?n3(i):`vec4(${d[0]} / 255.0, ${d[1]} / 255.0, ${d[2]} / 255.0, 1.0)`;if(c==="rgba")return d[3]!=="1.0"&&(t.translucent=!0),i=KZe(this),l(i)?n3(i):`vec4(${d[0]} / 255.0, ${d[1]} / 255.0, ${d[2]} / 255.0, ${d[3]})`;if(c==="hsl")return i=HZe(this),l(i)?n3(i):`vec4(czm_HSLToRGB(vec3(${d[0]}, ${d[1]}, ${d[2]})), 1.0)`;if(c==="hsla")return i=HZe(this),l(i)?(i.alpha!==1&&(t.translucent=!0),n3(i)):(d[3]!=="1.0"&&(t.translucent=!0),`vec4(czm_HSLToRGB(vec3(${d[0]}, ${d[1]}, ${d[2]})), ${d[3]})`)}break;case Pt.LITERAL_VECTOR:u=o.length,m=`${c}(`;for(let p=0;p<u;++p)m+=o[p],p<u-1&&(m+=", ");return m+=")",m;case Pt.LITERAL_REGEX:throw new ae("Error generating style shader: Regular expressions are not supported.");case Pt.LITERAL_UNDEFINED:return Af.NULL_SENTINEL;case Pt.BUILTIN_VARIABLE:if(c==="tiles3d_tileset_time")return c}};Mt.prototype.getVariables=function(e,t){let n,i,o,r=this._type,s=this._value;if(l(this._left))if(Array.isArray(this._left))for(n=this._left,i=n.length,o=0;o<i;++o)n[o].getVariables(e,this);else this._left.getVariables(e,this);if(l(this._right)&&this._right.getVariables(e,this),l(this._test)&&this._test.getVariables(e,this),Array.isArray(this._value))for(n=this._value,i=n.length,o=0;o<i;++o)n[o].getVariables(e,this);let a;switch(r){case Pt.VARIABLE:OS(this)||e.push(s);break;case Pt.VARIABLE_IN_STRING:for(a=iY.exec(s);a!==null;)e.push(a[1]),a=iY.exec(s);break;case Pt.LITERAL_STRING:l(t)&&t._type===Pt.MEMBER&&OS(t._left)&&e.push(s);break}};var $m=Af;function sg(e){e=e??B.EMPTY_OBJECT,this._batchTable=e.batchTable,this._batchIds=e.batchIds,this._positions=e.positions,this._vertexBatchIds=e.vertexBatchIds,this._indices=e.indices,this._indexCounts=e.indexCounts,this._indexOffsets=e.indexOffsets,this._batchedIndices=e.batchedIndices,this._boundingVolume=e.boundingVolume,this._boundingVolumes=e.boundingVolumes,this._center=e.center??h.ZERO,this._va=void 0,this._sp=void 0,this._spStencil=void 0,this._spPick=void 0,this._uniformMap=void 0,this._vaSwap=void 0,this._rsStencilDepthPass=void 0,this._rsStencilDepthPass3DTiles=void 0,this._rsColorPass=void 0,this._rsPickPass=void 0,this._rsWireframe=void 0,this._commands=[],this._commandsIgnoreShow=[],this._pickCommands=[],this._constantColor=U.clone(U.WHITE),this._highlightColor=this._constantColor,this._batchDirty=!0,this._pickCommandsDirty=!0,this._framesSinceLastRebatch=0,this._updatingAllCommands=!1,this._trianglesLength=this._indices.length/3,this._geometryByteLength=this._indices.byteLength+this._positions.byteLength+this._vertexBatchIds.byteLength,this.debugWireframe=!1,this._debugWireframe=this.debugWireframe,this._wireframeDirty=!1,this.forceRebatch=!1,this.classificationType=e.classificationType??ti.BOTH,this._vertexShaderSource=e._vertexShaderSource,this._fragmentShaderSource=e._fragmentShaderSource,this._attributeLocations=e._attributeLocations,this._uniformMap=e._uniformMap,this._pickId=e._pickId,this._modelMatrix=e._modelMatrix,this._boundingSphere=e._boundingSphere,this._batchIdLookUp={};let t=this._batchIds.length;for(let n=0;n<t;++n){let i=this._batchIds[n];this._batchIdLookUp[i]=n}}Object.defineProperties(sg.prototype,{trianglesLength:{get:function(){return this._trianglesLength}},geometryByteLength:{get:function(){return this._geometryByteLength}}});var kht={position:0,a_batchId:1};function Uht(e,t){if(l(e._va))return;let n=it.createVertexBuffer({context:t,typedArray:e._positions,usage:Pe.STATIC_DRAW}),i=it.createVertexBuffer({context:t,typedArray:e._vertexBatchIds,usage:Pe.STATIC_DRAW}),o=it.createIndexBuffer({context:t,typedArray:e._indices,usage:Pe.DYNAMIC_DRAW,indexDatatype:e._indices.BYTES_PER_ELEMENT===2?Oe.UNSIGNED_SHORT:Oe.UNSIGNED_INT}),r=[{index:0,vertexBuffer:n,componentDatatype:J.fromTypedArray(e._positions),componentsPerAttribute:3},{index:1,vertexBuffer:i,componentDatatype:J.fromTypedArray(e._vertexBatchIds),componentsPerAttribute:1}];e._va=new Un({context:t,attributes:r,indexBuffer:o}),t.webgl2&&(e._vaSwap=new Un({context:t,attributes:r,indexBuffer:it.createIndexBuffer({context:t,sizeInBytes:o.sizeInBytes,usage:Pe.DYNAMIC_DRAW,indexDatatype:o.indexDatatype})})),e._batchedPositions=void 0,e._transferrableBatchIds=void 0,e._vertexBatchIds=void 0}function Dht(e,t){if(l(e._sp))return;let n=e._batchTable,i=e._attributeLocations??kht,o=e._pickId,r=e._vertexShaderSource,s=e._fragmentShaderSource;if(l(r)){e._sp=tn.fromCache({context:t,vertexShaderSource:r,fragmentShaderSource:s,attributeLocations:i}),e._spStencil=e._sp,s=Je.replaceMain(s,"czm_non_pick_main"),s=`${s}void main() +{ + czm_non_pick_main(); + out_FragColor = ${o}; +} +`,e._spPick=tn.fromCache({context:t,vertexShaderSource:r,fragmentShaderSource:s,attributeLocations:i});return}let a=n.getVertexShaderCallback(!1,"a_batchId",void 0)(R1),c=n.getFragmentShaderCallback(!1,void 0,!0)(Yy);o=n.getPickId();let d=new Je({sources:[a]}),u=new Je({defines:["VECTOR_TILE"],sources:[c]});e._sp=tn.fromCache({context:t,vertexShaderSource:d,fragmentShaderSource:u,attributeLocations:i}),d=new Je({sources:[R1]}),u=new Je({defines:["VECTOR_TILE"],sources:[Yy]}),e._spStencil=tn.fromCache({context:t,vertexShaderSource:d,fragmentShaderSource:u,attributeLocations:i}),c=Je.replaceMain(c,"czm_non_pick_main"),c=`${c} void main() { - out_FragColor = texture(billboard_texture, v_textureCoordinates); + czm_non_pick_main(); + out_FragColor = ${o}; } -`,{uniformMap:{billboard_texture:function(){return e.textureAtlas.texture}}});return i.pass=Le.OVERLAY,i}var Wlt=[];zm.prototype.update=function(e){if(Gq(this),!this.show)return;let t=e.context;if(!t.instancedArrays||!(wt.maximumVertexTextureImageUnits>0))throw new ge("Beginning in CesiumJS 1.140, billboards and labels require device support for WebGL 2, or WebGL 1 with ANGLE_instanced_arrays and MAX_VERTEX_TEXTURE_IMAGE_UNITS > 0. For more information or to share feedback, see: https://github.com/CesiumGS/cesium/issues/13053");let n=this._billboards,i=n.length,o=!0;for(let L=0;L<i;++L){let F=n[L];l(F.loadError)&&(console.error(`Error loading image for billboard: ${F.loadError}`),F.image=void 0),F.textureDirty&&this._updateBillboard(F,CS),F.show&&(o=o&&F.ready)}let r=this._textureAtlas;if(e.afterRender.push(()=>{if(!this.isDestroyed())return r.update(e.context)}),!l(r.texture))return;Alt(this,e),n=this._billboards,i=n.length;let s=this._billboardsToUpdate,a=this._billboardsToUpdateIndex,c=this._propertiesChanged,d=r.guid,u=this._createVertexArray||this._textureAtlasGUID!==d;this._textureAtlasGUID=d;let m,p=e.passes,b=p.pick;if(u||!b&&this.computeNewBuffersUsage()){this._createVertexArray=!1;for(let L=0;L<Aq;++L)c[L]=0;if(this._vaf=this._vaf&&this._vaf.destroy(),i>0){this._vaf=_lt(t,i,this._buffersUsage,this._batchTable,this._sdf),m=this._vaf.writers;for(let L=0;L<i;++L){let F=this._billboards[L];F._dirty=!1,F.textureDirty=!1,Elt(this,e,m,F)}this._vaf.commit(LTe(t))}this._billboardsToUpdateIndex=0}else if(a>0){let L=Wlt;L.length=0,(c[cN]||c[blt]||c[plt])&&L.push(UTe),(c[CS]||c[WTe]||c[hlt]||c[flt]||c[mlt])&&(L.push(OTe),L.push(Eq)),(c[CS]||c[glt]||c[PTe])&&(L.push(BTe),L.push(Vq)),(c[CS]||c[FTe])&&L.push(Vq),(c[CS]||c[vTe])&&L.push(Eq),c[ITe]&&L.push(zTe),c[XTe]&&L.push(HTe),(c[NTe]||c[ylt]||c[CS]||c[cN])&&L.push(KTe),(c[CS]||c[cN])&&L.push(JTe),c[YTe]&&L.push(jTe),c[MTe]&&L.push(QTe);let F=L.length;if(m=this._vaf.writers,a/i>.1){for(let I=0;I<a;++I){let N=s[I];N._dirty=!1,N.textureDirty=!1;for(let g=0;g<F;++g)L[g](this,e,m,N)}this._vaf.commit(LTe(t))}else{for(let I=0;I<a;++I){let N=s[I];N._dirty=!1,N.textureDirty=!1;for(let g=0;g<F;++g)L[g](this,e,m,N);this._vaf.subCommit(N._index,1)}this._vaf.endSubCommits()}this._billboardsToUpdateIndex=0}if(a>i*1.5&&(s.length=i),!l(this._vaf)||!l(this._vaf.va))return;this._boundingVolumeDirty&&(this._boundingVolumeDirty=!1,me.transform(this._baseVolume,this.modelMatrix,this._baseVolumeWC));let f,y=P.IDENTITY;e.mode===se.SCENE3D?(y=this.modelMatrix,f=me.clone(this._baseVolumeWC,this._boundingVolume)):f=me.clone(this._baseVolume2D,this._boundingVolume),Glt(this,e,f);let _=this._blendOption!==this.blendOption;if(this._blendOption=this.blendOption,_){this._blendOption===Yi.OPAQUE||this._blendOption===Yi.OPAQUE_AND_TRANSLUCENT?this._rsOpaque=ze.fromCache({depthTest:{enabled:!0,func:ie.LESS},depthMask:!0}):this._rsOpaque=void 0;let L=this._blendOption===Yi.TRANSLUCENT;this._blendOption===Yi.TRANSLUCENT||this._blendOption===Yi.OPAQUE_AND_TRANSLUCENT?this._rsTranslucent=ze.fromCache({depthTest:{enabled:!0,func:L?ie.LEQUAL:ie.LESS},depthMask:L,blending:on.ALPHA_BLEND}):this._rsTranslucent=void 0}this._shaderDisableDepthDistance=this._shaderDisableDepthDistance||e.minimumDisableDepthTestDistance!==0;let S,Z,R,C,E;if(_||this._shaderRotation!==this._compiledShaderRotation||this._shaderAlignedAxis!==this._compiledShaderAlignedAxis||this._shaderScaleByDistance!==this._compiledShaderScaleByDistance||this._shaderTranslucencyByDistance!==this._compiledShaderTranslucencyByDistance||this._shaderPixelOffsetScaleByDistance!==this._compiledShaderPixelOffsetScaleByDistance||this._shaderDistanceDisplayCondition!==this._compiledShaderDistanceDisplayCondition||this._shaderDisableDepthDistance!==this._compiledShaderDisableDepthDistance||this._shaderClampToGround!==this._compiledShaderClampToGround||this._sdf!==this._compiledSDF){S=Cv,Z=Rv,E=["INSTANCED"],l(this._batchTable)&&(E.push("VECTOR_TILE"),S=this._batchTable.getVertexShaderCallback(!1,"a_batchId",void 0)(S),Z=this._batchTable.getFragmentShaderCallback(!1,void 0)(Z)),R=new Je({defines:E,sources:[S]}),this._shaderRotation&&R.defines.push("ROTATION"),this._shaderAlignedAxis&&R.defines.push("ALIGNED_AXIS"),this._shaderScaleByDistance&&R.defines.push("EYE_DISTANCE_SCALING"),this._shaderTranslucencyByDistance&&R.defines.push("EYE_DISTANCE_TRANSLUCENCY"),this._shaderPixelOffsetScaleByDistance&&R.defines.push("EYE_DISTANCE_PIXEL_OFFSET"),this._shaderDistanceDisplayCondition&&R.defines.push("DISTANCE_DISPLAY_CONDITION"),this._shaderDisableDepthDistance&&R.defines.push("DISABLE_DEPTH_DISTANCE"),this._shaderClampToGround&&R.defines.push("VS_THREE_POINT_DEPTH_CHECK");let L=1-Da.CUTOFF;this._sdf&&R.defines.push("SDF");let F=l(this._batchTable)?"VECTOR_TILE":"";this._blendOption===Yi.OPAQUE_AND_TRANSLUCENT&&(C=new Je({defines:["OPAQUE",F],sources:[Z]}),this._shaderClampToGround&&C.defines.push("VS_THREE_POINT_DEPTH_CHECK"),this._sdf&&(C.defines.push("SDF"),C.defines.push(`SDF_EDGE ${L}`)),this._sp=tn.replaceCache({context:t,shaderProgram:this._sp,vertexShaderSource:R,fragmentShaderSource:C,attributeLocations:Do}),C=new Je({defines:["TRANSLUCENT",F],sources:[Z]}),this._shaderClampToGround&&C.defines.push("VS_THREE_POINT_DEPTH_CHECK"),this._sdf&&(C.defines.push("SDF"),C.defines.push(`SDF_EDGE ${L}`)),this._spTranslucent=tn.replaceCache({context:t,shaderProgram:this._spTranslucent,vertexShaderSource:R,fragmentShaderSource:C,attributeLocations:Do})),this._blendOption===Yi.OPAQUE&&(C=new Je({defines:[F],sources:[Z]}),this._shaderClampToGround&&C.defines.push("VS_THREE_POINT_DEPTH_CHECK"),this._sdf&&(C.defines.push("SDF"),C.defines.push(`SDF_EDGE ${L}`)),this._sp=tn.replaceCache({context:t,shaderProgram:this._sp,vertexShaderSource:R,fragmentShaderSource:C,attributeLocations:Do})),this._blendOption===Yi.TRANSLUCENT&&(C=new Je({defines:[F],sources:[Z]}),this._shaderClampToGround&&C.defines.push("VS_THREE_POINT_DEPTH_CHECK"),this._sdf&&(C.defines.push("SDF"),C.defines.push(`SDF_EDGE ${L}`)),this._spTranslucent=tn.replaceCache({context:t,shaderProgram:this._spTranslucent,vertexShaderSource:R,fragmentShaderSource:C,attributeLocations:Do})),this._compiledShaderRotation=this._shaderRotation,this._compiledShaderAlignedAxis=this._shaderAlignedAxis,this._compiledShaderScaleByDistance=this._shaderScaleByDistance,this._compiledShaderTranslucencyByDistance=this._shaderTranslucencyByDistance,this._compiledShaderPixelOffsetScaleByDistance=this._shaderPixelOffsetScaleByDistance,this._compiledShaderDistanceDisplayCondition=this._shaderDistanceDisplayCondition,this._compiledShaderDisableDepthDistance=this._shaderDisableDepthDistance,this._compiledShaderClampToGround=this._shaderClampToGround,this._compiledSDF=this._sdf}let A=e.commandList;if(p.render||p.pick){let L=this._colorCommands,F=this._blendOption===Yi.OPAQUE,I=this._blendOption===Yi.OPAQUE_AND_TRANSLUCENT,N=this._vaf.va,g=N.length,V=this._uniforms,G;l(this._batchTable)?(V=this._batchTable.getUniformMapCallback()(V),G=this._batchTable.getPickId()):G="v_pickColor",L.length=g;let v=I?g*2:g;for(let X=0;X<v;++X){let Y=L[X];l(Y)||(Y=L[X]=new lt);let D=F||I&&X%2===0;Y.pass=D||!I?Le.OPAQUE:Le.TRANSLUCENT,Y.owner=this;let M=I?Math.floor(X/2):X;Y.boundingVolume=f,Y.modelMatrix=y,Y.count=N[M].indicesCount,Y.shaderProgram=D?this._sp:this._spTranslucent,Y.uniformMap=V,Y.vertexArray=N[M].va,Y.renderState=D?this._rsOpaque:this._rsTranslucent,Y.debugShowBoundingVolume=this.debugShowBoundingVolume,Y.pickId=G,Y.count=6,Y.instanceCount=i,A.push(Y)}this.debugShowTextureAtlas&&(l(this.debugCommand)||(this.debugCommand=Llt(this,e.context)),A.push(this.debugCommand))}this._allBillboardsReady=o};zm.prototype.isDestroyed=function(){return!1};zm.prototype.destroy=function(){return l(this._removeCallbackFunc)&&(this._removeCallbackFunc(),this._removeCallbackFunc=void 0),this._textureAtlas=this._destroyTextureAtlas&&this._textureAtlas&&this._textureAtlas.destroy(),this._sp=this._sp&&this._sp.destroy(),this._spTranslucent=this._spTranslucent&&this._spTranslucent.destroy(),this._vaf=this._vaf&&this._vaf.destroy(),wTe(this._billboards),ue(this)};var wu=zm;var Zhi=x(T(),1);var bhi=x(T(),1);function vlt(e,t,n,i,o){return function(){let r=document.createElement("canvas"),s=o+2*i;r.height=r.width=s;let a=r.getContext("2d");return a.clearRect(0,0,s,s),i!==0&&(a.beginPath(),a.arc(s/2,s/2,s/2,0,2*Math.PI,!0),a.closePath(),a.fillStyle=n,a.fill(),e<1&&(a.save(),a.globalCompositeOperation="destination-out",a.beginPath(),a.arc(s/2,s/2,o/2,0,2*Math.PI,!0),a.closePath(),a.fillStyle="black",a.fill(),a.restore())),a.beginPath(),a.arc(s/2,s/2,o/2,0,2*Math.PI,!0),a.closePath(),a.fillStyle=t,a.fill(),r}}var ES=vlt;var Flt=new pe,gf=class{constructor(t,n,i,o,r){this._content=t,this._billboard=i,this._label=o,this._polyline=r,this._batchId=n,this._billboardImage=void 0,this._billboardColor=void 0,this._billboardOutlineColor=void 0,this._billboardOutlineWidth=void 0,this._billboardSize=void 0,this._pointSize=void 0,this._color=void 0,this._pointSize=void 0,this._pointOutlineColor=void 0,this._pointOutlineWidth=void 0,this._heightOffset=void 0,this._pickIds=new Array(3),$C(this)}get show(){return this._label.show}set show(t){this._label.show=t,this._billboard.show=t,this._polyline.show=t}get color(){return this._color}set color(t){this._color=U.clone(t,this._color),$C(this)}get pointSize(){return this._pointSize}set pointSize(t){this._pointSize=t,$C(this)}get pointOutlineColor(){return this._pointOutlineColor}set pointOutlineColor(t){this._pointOutlineColor=U.clone(t,this._pointOutlineColor),$C(this)}get pointOutlineWidth(){return this._pointOutlineWidth}set pointOutlineWidth(t){this._pointOutlineWidth=t,$C(this)}get labelColor(){return this._label.fillColor}set labelColor(t){this._label.fillColor=t,this._polyline.show=this._label.show&&t.alpha>0}get labelOutlineColor(){return this._label.outlineColor}set labelOutlineColor(t){this._label.outlineColor=t}get labelOutlineWidth(){return this._label.outlineWidth}set labelOutlineWidth(t){this._label.outlineWidth=t}get font(){return this._label.font}set font(t){this._label.font=t}get labelStyle(){return this._label.style}set labelStyle(t){this._label.style=t}get labelText(){return this._label.text}set labelText(t){l(t)||(t=""),this._label.text=t}get backgroundColor(){return this._label.backgroundColor}set backgroundColor(t){this._label.backgroundColor=t}get backgroundPadding(){return this._label.backgroundPadding}set backgroundPadding(t){this._label.backgroundPadding=t}get backgroundEnabled(){return this._label.showBackground}set backgroundEnabled(t){this._label.showBackground=t}get scaleByDistance(){return this._label.scaleByDistance}set scaleByDistance(t){this._label.scaleByDistance=t,this._billboard.scaleByDistance=t}get translucencyByDistance(){return this._label.translucencyByDistance}set translucencyByDistance(t){this._label.translucencyByDistance=t,this._billboard.translucencyByDistance=t}get distanceDisplayCondition(){return this._label.distanceDisplayCondition}set distanceDisplayCondition(t){this._label.distanceDisplayCondition=t,this._polyline.distanceDisplayCondition=t,this._billboard.distanceDisplayCondition=t}get heightOffset(){return this._heightOffset}set heightOffset(t){let n=this._heightOffset??0,i=this._content.tileset.ellipsoid,o=i.cartesianToCartographic(this._billboard.position,Flt);o.height=o.height-n+t;let r=i.cartographicToCartesian(o);this._billboard.position=r,this._label.position=this._billboard.position,this._polyline.positions=[this._polyline.positions[0],r],this._heightOffset=t}get anchorLineEnabled(){return this._polyline.show}set anchorLineEnabled(t){this._polyline.show=t}get anchorLineColor(){return this._polyline.material.uniforms.color}set anchorLineColor(t){this._polyline.material.uniforms.color=U.clone(t,this._polyline.material.uniforms.color)}get image(){return this._billboardImage}set image(t){let n=this._billboardImage!==t;this._billboardImage=t,n&&$C(this)}get disableDepthTestDistance(){return this._label.disableDepthTestDistance}set disableDepthTestDistance(t){this._label.disableDepthTestDistance=t,this._billboard.disableDepthTestDistance=t}get horizontalOrigin(){return this._billboard.horizontalOrigin}set horizontalOrigin(t){this._billboard.horizontalOrigin=t}get verticalOrigin(){return this._billboard.verticalOrigin}set verticalOrigin(t){this._billboard.verticalOrigin=t}get labelHorizontalOrigin(){return this._label.horizontalOrigin}set labelHorizontalOrigin(t){this._label.horizontalOrigin=t}get labelVerticalOrigin(){return this._label.verticalOrigin}set labelVerticalOrigin(t){this._label.verticalOrigin=t}get content(){return this._content}get tileset(){return this._content.tileset}get primitive(){return this._content.tileset}get pickIds(){let t=this._pickIds;return t[0]=this._billboard.pickId,t[1]=this._label.pickId,t[2]=this._polyline.pickId,t}hasProperty(t){return this._content.batchTable.hasProperty(this._batchId,t)}getPropertyIds(t){return this._content.batchTable.getPropertyIds(this._batchId,t)}getProperty(t){return this._content.batchTable.getProperty(this._batchId,t)}getPropertyInherited(t){return ea.getPropertyInherited(this._content,this._batchId,t)}setProperty(t,n){this._content.batchTable.setProperty(this._batchId,t,n),this._content.featurePropertiesDirty=!0}isExactClass(t){return this._content.batchTable.isExactClass(this._batchId,t)}isClass(t){return this._content.batchTable.isClass(this._batchId,t)}getExactClassName(){return this._content.batchTable.getExactClassName(this._batchId)}};mt(gf,"defaultColor",U.WHITE),mt(gf,"defaultPointOutlineColor",U.BLACK),mt(gf,"defaultPointOutlineWidth",0),mt(gf,"defaultPointSize",8);function $C(e){let t=e._billboard;if(l(e._billboardImage)&&e._billboardImage!==t.image){t.image=e._billboardImage;return}if(l(e._billboardImage))return;let n=e._color??gf.defaultColor,i=e._pointOutlineColor??gf.defaultPointOutlineColor,o=e._pointOutlineWidth??gf.defaultPointOutlineWidth,r=e._pointSize??gf.defaultPointSize,s=e._billboardColor,a=e._billboardOutlineColor,c=e._billboardOutlineWidth,d=e._billboardSize;if(U.equals(n,s)&&U.equals(i,a)&&o===c&&r===d)return;e._billboardColor=U.clone(n,e._billboardColor),e._billboardOutlineColor=U.clone(i,e._billboardOutlineColor),e._billboardOutlineWidth=o,e._billboardSize=r;let u=n.alpha,m=n.toCssColorString(),p=i.toCssColorString(),b=JSON.stringify([m,r,p,o]);t.setImage(b,ES(u,m,p,o,r))}var tg=gf;var gfi=x(T(),1);var Ghi=x(T(),1);function Ilt(e,t){let n=e.measureText(t);if(!/\S/.test(t))return{width:n.width,height:0,ascent:0,descent:0,minx:0};let o=Math.round(n.actualBoundingBoxAscent),r=Math.round(n.actualBoundingBoxDescent),s=Math.max(o+r,1);return{width:n.width,height:s,ascent:o,descent:r,minx:-Math.round(n.actualBoundingBoxLeft)}}var AS;function Plt(e,t){if(e==="")return;t=t??B.EMPTY_OBJECT;let n=t.font??"10px sans-serif",i=t.stroke??!1,o=t.fill??!0,r=t.strokeWidth??1,s=t.backgroundColor??U.TRANSPARENT,a=t.padding??0,c=a*2,d=document.createElement("canvas");d.width=1,d.height=1,d.style.font=n;let u=d.getContext("2d",{willReadFrequently:!0});l(AS)||(l(u.imageSmoothingEnabled)?AS="imageSmoothingEnabled":l(u.mozImageSmoothingEnabled)?AS="mozImageSmoothingEnabled":l(u.webkitImageSmoothingEnabled)?AS="webkitImageSmoothingEnabled":l(u.msImageSmoothingEnabled)&&(AS="msImageSmoothingEnabled")),u.font=n,u.lineJoin="round",u.lineWidth=r,u[AS]=!1,d.style.visibility="hidden",document.body.appendChild(d);let m=Ilt(u,e);d.dimensions=m,document.body.removeChild(d),d.style.visibility="";let p=!/\S/.test(e),b=i&&!p?Math.ceil(r/2):0,f=b*2,y=-m.minx+b,_=Math.ceil(m.width)+y+c+b,S=m.height+c+f,Z=m.ascent+a+b;if(d.width=_,d.height=S,u.font=n,u.lineJoin="round",u.lineWidth=r,u[AS]=!1,s!==U.TRANSPARENT&&(u.fillStyle=s.toCssColorString(),u.fillRect(0,0,d.width,d.height)),i){let R=t.strokeColor??U.BLACK;u.strokeStyle=R.toCssColorString(),u.strokeText(e,y+a,Z)}if(o){let R=t.fillColor??U.WHITE;u.fillStyle=R.toCssColorString(),u.fillText(e,y+a,Z)}return d}var GS=Plt;var d_e=x(t_e(),1);var Jhi=x(T(),1);var Fhi=x(T(),1),n_e={FILL:0,OUTLINE:1,FILL_AND_OUTLINE:2};Object.freeze(n_e);var Tr=n_e;var i_e={},o_e=0,Nlt=256,Ylt=new U(.165,.165,.165,.8),Mlt=new k(7,5),ia=Object.freeze({LTR:0,RTL:1,WEAK:2,BRACKETS:3});function LS(e){!e._rebindAllGlyphs&&!e._repositionAllGlyphs&&e._labelCollection._labelsToUpdate.push(e),e._rebindAllGlyphs=!0}function dN(e){!e._rebindAllGlyphs&&!e._repositionAllGlyphs&&e._labelCollection._labelsToUpdate.push(e),e._repositionAllGlyphs=!0}function uN(e,t){return document.defaultView.getComputedStyle(e,null).getPropertyValue(t)}function s_e(e){let t=i_e[e._font];if(!l(t)){let n=document.createElement("div");n.style.position="absolute",n.style.opacity=0,n.style.font=e._font,document.body.appendChild(n);let i=parseFloat(uN(n,"line-height"));isNaN(i)&&(i=void 0),t={family:uN(n,"font-family"),size:uN(n,"font-size").replace("px",""),style:uN(n,"font-style"),weight:uN(n,"font-weight"),lineHeight:i},document.body.removeChild(n),o_e<Nlt&&(i_e[e._font]=t,o_e++)}e._fontFamily=t.family,e._fontSize=t.size,e._fontStyle=t.style,e._fontWeight=t.weight,e._lineHeight=t.lineHeight}function yf(e,t){e=e??B.EMPTY_OBJECT;let n=e.translucencyByDistance,i=e.pixelOffsetScaleByDistance,o=e.scaleByDistance,r=e.distanceDisplayCondition;l(n)&&(n=Kt.clone(n)),l(i)&&(i=Kt.clone(i)),l(o)&&(o=Kt.clone(o)),l(r)&&(r=Bt.clone(r)),this._renderedText=void 0,this._text=void 0,this._show=e.show??!0,this._font=e.font??"30px sans-serif",this._fillColor=U.clone(e.fillColor??U.WHITE),this._outlineColor=U.clone(e.outlineColor??U.BLACK),this._outlineWidth=e.outlineWidth??1,this._showBackground=e.showBackground??!1,this._backgroundColor=U.clone(e.backgroundColor??Ylt),this._backgroundPadding=k.clone(e.backgroundPadding??Mlt),this._style=e.style??Tr.FILL,this._verticalOrigin=e.verticalOrigin??zn.BASELINE,this._horizontalOrigin=e.horizontalOrigin??Ui.LEFT,this._pixelOffset=k.clone(e.pixelOffset??k.ZERO),this._eyeOffset=h.clone(e.eyeOffset??h.ZERO),this._position=h.clone(e.position??h.ZERO),this._scale=e.scale??1,this._id=e.id,this._translucencyByDistance=n,this._pixelOffsetScaleByDistance=i,this._scaleByDistance=o,this._heightReference=e.heightReference??He.NONE,this._distanceDisplayCondition=r,this._disableDepthTestDistance=e.disableDepthTestDistance,this._labelCollection=t,this._glyphs=[],this._backgroundBillboard=void 0,this._batchIndex=void 0,this._rebindAllGlyphs=!0,this._repositionAllGlyphs=!0,this._actualClampedPosition=void 0,this._removeCallbackFunc=void 0,this._lastSurfaceHeight=void 0,this._lastSurfaceQueryFrame=-1,this._lastSurfaceQueryMissed=!1,this._clampedToSurface=!1,this._clampingCartesian=void 0,this._clampingHeight=0,this._clampingHeightValid=!1,this._mode=void 0,this._clusterShow=!0,this.text=e.text??"",this._relativeSize=1,s_e(this),this._updateClamping()}Object.defineProperties(yf.prototype,{show:{get:function(){return this._show},set:function(e){if(this._show!==e){this._show=e;let t=this._glyphs;for(let i=0,o=t.length;i<o;i++){let r=t[i].billboard;l(r)&&(r.show=e)}let n=this._backgroundBillboard;l(n)&&(n.show=e)}}},position:{get:function(){return this._position},set:function(e){let t=this._position;if(!Sq(t,e)){RS(e,t);let n=this._glyphs;for(let o=0,r=n.length;o<r;o++){let s=n[o].billboard;l(s)&&(s.position=e)}let i=this._backgroundBillboard;l(i)&&(i.position=e),this._updateClamping()}}},heightReference:{get:function(){return this._heightReference},set:function(e){if(e!==this._heightReference){this._heightReference=e;let t=this._glyphs;for(let i=0,o=t.length;i<o;i++){let r=t[i].billboard;l(r)&&(r.heightReference=e)}let n=this._backgroundBillboard;l(n)&&(n.heightReference=e),dN(this),this._updateClamping()}}},text:{get:function(){return this._text},set:function(e){if(this._text!==e){this._text=e;let t=yf.filterUnsupportedCharacters(e);this._renderedText=yf.enableRightToLeftDetection?Blt(t):t,LS(this)}}},font:{get:function(){return this._font},set:function(e){this._font!==e&&(this._font=e,LS(this),s_e(this))}},fillColor:{get:function(){return this._fillColor},set:function(e){let t=this._fillColor;U.equals(t,e)||(U.clone(e,t),LS(this))}},outlineColor:{get:function(){return this._outlineColor},set:function(e){let t=this._outlineColor;U.equals(t,e)||(U.clone(e,t),LS(this))}},outlineWidth:{get:function(){return this._outlineWidth},set:function(e){this._outlineWidth!==e&&(this._outlineWidth=e,LS(this))}},showBackground:{get:function(){return this._showBackground},set:function(e){this._showBackground!==e&&(this._showBackground=e,LS(this))}},backgroundColor:{get:function(){return this._backgroundColor},set:function(e){let t=this._backgroundColor;if(!U.equals(t,e)){U.clone(e,t);let n=this._backgroundBillboard;l(n)&&(n.color=t)}}},backgroundPadding:{get:function(){return this._backgroundPadding},set:function(e){let t=this._backgroundPadding;k.equals(t,e)||(k.clone(e,t),dN(this))}},style:{get:function(){return this._style},set:function(e){this._style!==e&&(this._style=e,LS(this))}},pixelOffset:{get:function(){return this._pixelOffset},set:function(e){let t=this._pixelOffset;if(!k.equals(t,e)){k.clone(e,t);let n=this._glyphs;for(let o=0,r=n.length;o<r;o++){let s=n[o];l(s.billboard)&&(s.billboard.pixelOffset=e)}let i=this._backgroundBillboard;l(i)&&(i.pixelOffset=e)}}},translucencyByDistance:{get:function(){return this._translucencyByDistance},set:function(e){let t=this._translucencyByDistance;if(!Kt.equals(t,e)){this._translucencyByDistance=Kt.clone(e,t);let n=this._glyphs;for(let o=0,r=n.length;o<r;o++){let s=n[o];l(s.billboard)&&(s.billboard.translucencyByDistance=e)}let i=this._backgroundBillboard;l(i)&&(i.translucencyByDistance=e)}}},pixelOffsetScaleByDistance:{get:function(){return this._pixelOffsetScaleByDistance},set:function(e){let t=this._pixelOffsetScaleByDistance;if(!Kt.equals(t,e)){this._pixelOffsetScaleByDistance=Kt.clone(e,t);let n=this._glyphs;for(let o=0,r=n.length;o<r;o++){let s=n[o];l(s.billboard)&&(s.billboard.pixelOffsetScaleByDistance=e)}let i=this._backgroundBillboard;l(i)&&(i.pixelOffsetScaleByDistance=e)}}},scaleByDistance:{get:function(){return this._scaleByDistance},set:function(e){let t=this._scaleByDistance;if(!Kt.equals(t,e)){this._scaleByDistance=Kt.clone(e,t);let n=this._glyphs;for(let o=0,r=n.length;o<r;o++){let s=n[o];l(s.billboard)&&(s.billboard.scaleByDistance=e)}let i=this._backgroundBillboard;l(i)&&(i.scaleByDistance=e)}}},eyeOffset:{get:function(){return this._eyeOffset},set:function(e){let t=this._eyeOffset;if(!h.equals(t,e)){h.clone(e,t);let n=this._glyphs;for(let o=0,r=n.length;o<r;o++){let s=n[o];l(s.billboard)&&(s.billboard.eyeOffset=e)}let i=this._backgroundBillboard;l(i)&&(i.eyeOffset=e)}}},horizontalOrigin:{get:function(){return this._horizontalOrigin},set:function(e){this._horizontalOrigin!==e&&(this._horizontalOrigin=e,dN(this))}},verticalOrigin:{get:function(){return this._verticalOrigin},set:function(e){if(this._verticalOrigin!==e){this._verticalOrigin=e;let t=this._glyphs;for(let i=0,o=t.length;i<o;i++){let r=t[i];l(r.billboard)&&(r.billboard.verticalOrigin=e)}let n=this._backgroundBillboard;l(n)&&(n.verticalOrigin=e),dN(this)}}},scale:{get:function(){return this._scale},set:function(e){if(this._scale!==e){this._scale=e;let t=this._glyphs;for(let i=0,o=t.length;i<o;i++){let r=t[i];l(r.billboard)&&(r.billboard.scale=e*this._relativeSize)}let n=this._backgroundBillboard;l(n)&&(n.scale=e*this._relativeSize),dN(this)}}},totalScale:{get:function(){return this._scale*this._relativeSize}},distanceDisplayCondition:{get:function(){return this._distanceDisplayCondition},set:function(e){if(!Bt.equals(e,this._distanceDisplayCondition)){this._distanceDisplayCondition=Bt.clone(e,this._distanceDisplayCondition);let t=this._glyphs;for(let i=0,o=t.length;i<o;i++){let r=t[i];l(r.billboard)&&(r.billboard.distanceDisplayCondition=e)}let n=this._backgroundBillboard;l(n)&&(n.distanceDisplayCondition=e)}}},disableDepthTestDistance:{get:function(){return this._disableDepthTestDistance},set:function(e){if(this._disableDepthTestDistance!==e){this._disableDepthTestDistance=e;let t=this._glyphs;for(let i=0,o=t.length;i<o;i++){let r=t[i];l(r.billboard)&&(r.billboard.disableDepthTestDistance=e)}let n=this._backgroundBillboard;l(n)&&(n.disableDepthTestDistance=e)}}},id:{get:function(){return this._id},set:function(e){if(this._id!==e){this._id=e;let t=this._glyphs;for(let i=0,o=t.length;i<o;i++){let r=t[i];l(r.billboard)&&(r.billboard.id=e)}let n=this._backgroundBillboard;l(n)&&(n.id=e)}}},pickId:{get:function(){if(!(this._glyphs.length===0||!l(this._glyphs[0].billboard)))return this._glyphs[0].billboard.pickId}},_clampedPosition:{get:function(){return this._actualClampedPosition},set:function(e){this._actualClampedPosition=RS(e,this._actualClampedPosition);let t=this._glyphs;for(let i=0,o=t.length;i<o;i++){let r=t[i];l(r.billboard)&&(r.billboard._clampedPosition=e)}let n=this._backgroundBillboard;l(n)&&(n._clampedPosition=e)}},clusterShow:{get:function(){return this._clusterShow},set:function(e){if(this._clusterShow!==e){this._clusterShow=e;let t=this._glyphs;for(let i=0,o=t.length;i<o;i++){let r=t[i];l(r.billboard)&&(r.billboard.clusterShow=e)}let n=this._backgroundBillboard;l(n)&&(n.clusterShow=e)}}},ready:{get:function(){if(this._rebindAllGlyphs||this._repositionAllGlyphs||l(this._backgroundBillboard)&&!this._backgroundBillboard.ready)return!1;let e=this._glyphs;for(let t=0,n=e.length;t<n;t++){let i=e[t];if(l(i.billboard)&&!i.billboard.ready)return!1}return!0}}});yf.prototype._updateClamping=function(){Mo._updateClamping(this._labelCollection,this)};yf.prototype.computeScreenSpacePosition=function(e,t){l(t)||(t=new k);let i=this._labelCollection.modelMatrix,o=l(this._actualClampedPosition)?this._actualClampedPosition:this._position;return Mo._computeScreenSpacePosition(i,o,this._eyeOffset,this._pixelOffset,e,t)};yf.getScreenSpaceBoundingBox=function(e,t,n){let i,o,r,s,a=e.totalScale,c=e._backgroundBillboard;if(l(c))i=t.x+c._translate.x,o=t.y-c._translate.y,r=c.width*a,s=c.height*a,e.verticalOrigin===zn.BOTTOM||e.verticalOrigin===zn.BASELINE?o-=s:e.verticalOrigin===zn.CENTER&&(o-=s*.5);else{i=Number.POSITIVE_INFINITY,o=Number.POSITIVE_INFINITY;let d=0,u=0,m=e._glyphs,p=m.length;for(let b=0;b<p;++b){let f=m[b],y=f.billboard;if(!l(y))continue;let _=t.x+y._translate.x,S=t.y-y._translate.y,Z=f.dimensions.width*a,R=f.dimensions.height*a;e.verticalOrigin===zn.BOTTOM||e.verticalOrigin===zn.BASELINE?S-=R:e.verticalOrigin===zn.CENTER&&(S-=R*.5),e._verticalOrigin===zn.TOP?S+=Da.PADDING*a:(e._verticalOrigin===zn.BOTTOM||e._verticalOrigin===zn.BASELINE)&&(S-=Da.PADDING*a),i=Math.min(i,_),o=Math.min(o,S),d=Math.max(d,_+Z),u=Math.max(u,S+R)}r=d-i,s=u-o}return l(n)||(n=new nt),n.x=i,n.y=o,n.width=r,n.height=s,n};yf.filterUnsupportedCharacters=function(e){let t=new RegExp(/[\u0000-\u0008\u000E-\u001F\u00ad\u202a-\u206f\u200b-\u200f]/,"g");return e.replace(t,"")};yf.prototype.equals=function(e){return this===e||l(e)&&this._show===e._show&&this._scale===e._scale&&this._outlineWidth===e._outlineWidth&&this._showBackground===e._showBackground&&this._style===e._style&&this._verticalOrigin===e._verticalOrigin&&this._horizontalOrigin===e._horizontalOrigin&&this._heightReference===e._heightReference&&this._renderedText===e._renderedText&&this._font===e._font&&h.equals(this._position,e._position)&&U.equals(this._fillColor,e._fillColor)&&U.equals(this._outlineColor,e._outlineColor)&&U.equals(this._backgroundColor,e._backgroundColor)&&k.equals(this._backgroundPadding,e._backgroundPadding)&&k.equals(this._pixelOffset,e._pixelOffset)&&h.equals(this._eyeOffset,e._eyeOffset)&&Kt.equals(this._translucencyByDistance,e._translucencyByDistance)&&Kt.equals(this._pixelOffsetScaleByDistance,e._pixelOffsetScaleByDistance)&&Kt.equals(this._scaleByDistance,e._scaleByDistance)&&Bt.equals(this._distanceDisplayCondition,e._distanceDisplayCondition)&&this._disableDepthTestDistance===e._disableDepthTestDistance&&this._id===e._id};yf.prototype.isDestroyed=function(){return!1};yf.enableRightToLeftDetection=!1;function wlt(e,t){let n=/[a-zA-Z0-9]/,i=/[()[\]{}<>]/,o=[],r="",s=ia.LTR,a="",c=e.length;for(let d=0;d<c;++d){let u=e.charAt(d);t.test(u)?a=ia.RTL:n.test(u)?a=ia.LTR:i.test(u)?a=ia.BRACKETS:a=ia.WEAK,d===0&&(s=a),s===a&&a!==ia.BRACKETS?r+=u:(r!==""&&o.push({Type:s,Word:r}),s=a,r=u)}return o.push({Type:a,Word:r}),o}function klt(e){return e.split("").reverse().join("")}function mN(e,t,n){return e.slice(0,t)+n+e.slice(t)}function Ult(e){switch(e){case"(":return")";case")":return"(";case"[":return"]";case"]":return"[";case"{":return"}";case"}":return"{";case"<":return">";case">":return"<"}}var Dlt="\u05D0-\u05EA",Olt="\u0600-\u06FF\u0750-\u077F\u08A0-\u08FF",r_e=new RegExp(`[${Dlt}${Olt}]`);function Blt(e){let t=e.split(` -`),n="";for(let i=0;i<t.length;i++){let o=t[i],r=r_e.test(o.charAt(0)),s=wlt(o,r_e),a=0,c="";for(let d=0;d<s.length;++d){let u=s[d],m=u.Type===ia.BRACKETS?Ult(u.Word):klt(u.Word);r?u.Type===ia.RTL?(c=m+c,a=0):u.Type===ia.LTR?(c=mN(c,a,u.Word),a+=u.Word.length):(u.Type===ia.WEAK||u.Type===ia.BRACKETS)&&(u.Type===ia.WEAK&&s[d-1].Type===ia.BRACKETS?c=m+c:s[d-1].Type===ia.RTL?(c=m+c,a=0):s.length>d+1?s[d+1].Type===ia.RTL?(c=m+c,a=0):(c=mN(c,a,u.Word),a+=u.Word.length):c=mN(c,0,m)):u.Type===ia.RTL?c=mN(c,a,m):u.Type===ia.LTR?(c+=u.Word,a=c.length):(u.Type===ia.WEAK||u.Type===ia.BRACKETS)&&(d>0&&s[d-1].Type===ia.RTL?s.length>d+1?s[d+1].Type===ia.RTL?c=mN(c,a,m):(c+=u.Word,a=c.length):c+=u.Word:(c+=u.Word,a=c.length))}n+=c,i<t.length-1&&(n+=` -`)}return n}var Ex=yf;var u_e=x(a_e(),1);function Hlt(){this.dimensions=void 0,this.billboardTexture=void 0,this.billboard=void 0}var Klt=1.2,c_e="ID_WHITE_PIXEL",Wq=new k(4,4),Jlt=new nt(1,1,1,1);function jlt(e,t){let n=t._backgroundBillboardTexture;if(!n.hasImage){let o=document.createElement("canvas");o.width=Wq.x,o.height=Wq.y;let r=o.getContext("2d");r.fillStyle="#fff",r.fillRect(0,0,o.width,o.height),n.loadImage(c_e,o),n.addImageSubRegion(c_e,Jlt)}let i=e.add({collection:t});return i.setImageTexture(n),i._positionFromParent=!0,i._labelTranslate=new k,i}var ng={};function Qlt(e,t,n,i,o,r){return ng.font=t,ng.fillColor=n,ng.strokeColor=i,ng.strokeWidth=o,ng.padding=Da.PADDING,ng.fill=r===Tr.FILL||r===Tr.FILL_AND_OUTLINE,ng.stroke=r===Tr.OUTLINE||r===Tr.FILL_AND_OUTLINE,ng.backgroundColor=U.BLACK,GS(e,ng)}function vq(e,t){let n=t.billboard;l(n)&&(n.show=!1,n._clampedPosition=void 0,l(n._removeCallbackFunc)&&(n._removeCallbackFunc(),n._removeCallbackFunc=void 0),e._spareBillboards.push(n),t.billboard=void 0)}var qlt=new u_e.default,$lt=/\s/;function edt(e,t){let n=t._renderedText,i=qlt.splitGraphemes(n),o=i.length,r=t._glyphs,s=r.length;if(t._relativeSize=t._fontSize/Da.FONT_SIZE,o<s)for(let p=o;p<s;++p)vq(e,r[p]);r.length=o;let a=t._backgroundBillboard,c=e._backgroundBillboardCollection;t._showBackground&&!l(a)&&(a=jlt(c,e),t._backgroundBillboard=a),tdt(c,t,a);let d=e._glyphBillboardCollection,u=d.billboardTextureCache,m=e._textDimensionsCache;for(let p=0;p<o;++p){let b=i[p],f=t._verticalOrigin,y=JSON.stringify([b,t._fontFamily,t._fontStyle,t._fontWeight,+f]),_=m[y],S=u.get(y);if(!l(S)||!l(_)){S=new eg(d),u.set(y,S);let E=`${t._fontStyle} ${t._fontWeight} ${Da.FONT_SIZE}px ${t._fontFamily}`,A=Qlt(b,E,U.WHITE,U.WHITE,0,Tr.FILL);if(_=A.dimensions,m[y]=_,A.width>0&&A.height>0&&!$lt.test(b)){let L=(0,d_e.default)(A,{cutoff:Da.CUTOFF,radius:Da.RADIUS}),F=A.getContext("2d"),I=A.width,N=A.height,g=F.getImageData(0,0,I,N);for(let V=0;V<I;V++)for(let G=0;G<N;G++){let v=G*I+V,X=L[v]*255,Y=v*4;g.data[Y+0]=X,g.data[Y+1]=X,g.data[Y+2]=X,g.data[Y+3]=X}F.putImageData(g,0,0),S.loadImage(y,A)}}let Z=r[p];if(l(Z)||(Z=new Hlt,Z.dimensions=_,Z.billboardTexture=S,r[p]=Z),Z.billboardTexture.id!==y&&(Z.billboardTexture=S,Z.dimensions=_),!S.hasImage){vq(e,Z);continue}let R=Z.billboard,C=e._spareBillboards;l(R)||(C.length>0?R=C.pop():(R=d.add({collection:e}),R._labelDimensions=new k,R._labelTranslate=new k,R._positionFromParent=!0),Z.billboard=R),R.setImageTexture(S),R.show=t._show,R.position=t._position,R.eyeOffset=t._eyeOffset,R.pixelOffset=t._pixelOffset,R.horizontalOrigin=Ui.LEFT,R.verticalOrigin=t._verticalOrigin,R.heightReference=t._heightReference,l(t._clampedPosition)&&(R._clampedPosition=t._clampedPosition),R.scale=t.totalScale,R.pickPrimitive=t,R.id=t._id,R.translucencyByDistance=t._translucencyByDistance,R.pixelOffsetScaleByDistance=t._pixelOffsetScaleByDistance,R.scaleByDistance=t._scaleByDistance,R.distanceDisplayCondition=t._distanceDisplayCondition,R.disableDepthTestDistance=t._disableDepthTestDistance,R._batchIndex=t._batchIndex,R.outlineColor=t.outlineColor,t.style===Tr.FILL_AND_OUTLINE?(R.color=t._fillColor,R.outlineWidth=t.outlineWidth):t.style===Tr.FILL?(R.color=t._fillColor,R.outlineWidth=0):t.style===Tr.OUTLINE&&(R.color=U.TRANSPARENT,R.outlineWidth=t.outlineWidth)}t._repositionAllGlyphs=!0}function tdt(e,t,n){if(!l(n))return;let i=t.show&&t._showBackground&&t._renderedText.split(` -`).join("").length>0;if(t.show&&!i){e.remove(n),t._backgroundBillboard=void 0;return}n.color=t._backgroundColor,n.show=t._show,n.position=t._position,n.eyeOffset=t._eyeOffset,n.pixelOffset=t._pixelOffset,n.horizontalOrigin=Ui.LEFT,n.verticalOrigin=t._verticalOrigin,n.heightReference=t._heightReference,l(t._clampedPosition)&&(n._clampedPosition=t._clampedPosition),n.scale=t.totalScale,n.pickPrimitive=t,n.id=t._id,n.translucencyByDistance=t._translucencyByDistance,n.pixelOffsetScaleByDistance=t._pixelOffsetScaleByDistance,n.scaleByDistance=t._scaleByDistance,n.distanceDisplayCondition=t._distanceDisplayCondition,n.disableDepthTestDistance=t._disableDepthTestDistance,n.clusterShow=t.clusterShow}function l_e(e,t,n){return t===Ui.CENTER?-e/2:t===Ui.RIGHT?-(e+n.x):n.x}var Br=new k,ndt=new k;function idt(e){let t=e._glyphs,n=e._renderedText,i=0,o=0,r=[],s=Number.NEGATIVE_INFINITY,a=0,c=1,d=t.length,u=e._backgroundBillboard,m=k.clone(l(u)?e._backgroundPadding:k.ZERO,ndt);m.x/=e._relativeSize,m.y/=e._relativeSize;for(let I=0;I<d;++I){if(n.charAt(I)===` -`){r.push(i),++c,i=0;continue}let g=t[I].dimensions;l(g)&&(a=Math.max(a,g.height-g.descent),s=Math.max(s,g.descent),i+=g.width-g.minx,I<d-1&&(i+=t[I+1].dimensions.minx),o=Math.max(o,i))}r.push(i);let p=a+s,b=e.totalScale,f=e._horizontalOrigin,y=e._verticalOrigin,_=0,S=r[_],Z=l_e(S,f,m),R=(l(e._lineHeight)?e._lineHeight:Klt*e._fontSize)/e._relativeSize,C=R*(c-1),E=o,A=p+C;l(u)&&(E+=m.x*2,A+=m.y*2,u._labelHorizontalOrigin=f),Br.x=Z*b,Br.y=0;let L=!0,F=0;for(let I=0;I<d;++I){if(n.charAt(I)===` -`){++_,F+=R,S=r[_],Z=l_e(S,f,m),Br.x=Z*b,L=!0;continue}let N=t[I],g=N.dimensions;if(l(g)&&(y===zn.TOP?(Br.y=g.height-a-m.y,Br.y+=Da.PADDING):y===zn.CENTER?Br.y=(C+g.height-a)/2:y===zn.BASELINE?(Br.y=C,Br.y-=Da.PADDING):(Br.y=C+s+m.y,Br.y-=Da.PADDING),Br.y=(Br.y-g.descent-F)*b,L&&(Br.x-=Da.PADDING*b,L=!1),l(N.billboard)&&(N.billboard._setTranslate(Br),N.billboard._labelDimensions.x=E,N.billboard._labelDimensions.y=A,N.billboard._labelHorizontalOrigin=f,bs(e.heightReference)&&(N.billboard._labelTranslate=k.clone(Br,N.billboard._labelTranslate))),I<d-1)){let V=t[I+1];Br.x+=(g.width-g.minx+V.dimensions.minx)*b}}l(u)&&n.split(` -`).join("").length>0&&(f===Ui.CENTER?Z=-o/2-m.x:f===Ui.RIGHT?Z=-(o+m.x*2):Z=0,Br.x=Z*b,y===zn.TOP?Br.y=p-a-s:y===zn.CENTER?Br.y=(p-a)/2-s:y===zn.BASELINE?Br.y=-m.y-s:Br.y=0,Br.y=Br.y*b,u.width=E,u.height=A,u._setTranslate(Br),u._labelTranslate=k.clone(Br,u._labelTranslate))}function m_e(e,t){let n=t._glyphs;for(let i=0,o=n.length;i<o;++i)vq(e,n[i]);l(t._backgroundBillboard)&&(e._backgroundBillboardCollection.remove(t._backgroundBillboard),t._backgroundBillboard=void 0),t._labelCollection=void 0,l(t._removeCallbackFunc)&&t._removeCallbackFunc(),ue(t)}function Kp(e){e=e??B.EMPTY_OBJECT,this._scene=e.scene,this._batchTable=e.batchTable;let t=new wu({scene:this._scene,textureAtlas:new x_({initialSize:Wq}),coarseDepthTestDistance:e.coarseDepthTestDistance,threePointDepthTestDistance:e.threePointDepthTestDistance});this._backgroundBillboardCollection=t,this._backgroundBillboardTexture=new eg(t),this._glyphBillboardCollection=new wu({scene:this._scene,batchTable:this._batchTable,coarseDepthTestDistance:e.coarseDepthTestDistance,threePointDepthTestDistance:e.threePointDepthTestDistance}),this._glyphBillboardCollection._sdf=!0,this._spareBillboards=[],this._textDimensionsCache={},this._labels=[],this._labelsToUpdate=[],this._totalGlyphCount=0,this._highlightColor=U.clone(U.WHITE),this.show=e.show??!0,this.modelMatrix=P.clone(e.modelMatrix??P.IDENTITY),this.debugShowBoundingVolume=e.debugShowBoundingVolume??!1,this.blendOption=e.blendOption??Yi.OPAQUE_AND_TRANSLUCENT}Object.defineProperties(Kp.prototype,{length:{get:function(){return this._labels.length}},sizeInBytes:{get:function(){return this._glyphBillboardCollection.sizeInBytes+this._backgroundBillboardCollection.sizeInBytes}},ready:{get:function(){let e=this._backgroundBillboardCollection.get(0);return l(e)&&!e.ready?!1:this._glyphBillboardCollection.ready}},coarseDepthTestDistance:{get:function(){return this._backgroundBillboardCollection.coarseDepthTestDistance},set:function(e){this._backgroundBillboardCollection.coarseDepthTestDistance=e,this._glyphBillboardCollection.coarseDepthTestDistance=e}},threePointDepthTestDistance:{get:function(){return this._backgroundBillboardCollection.threePointDepthTestDistance},set:function(e){this._backgroundBillboardCollection.threePointDepthTestDistance=e,this._glyphBillboardCollection.threePointDepthTestDistance=e}}});Kp.prototype.add=function(e){let t=new Ex(e,this);return this._labels.push(t),this._labelsToUpdate.push(t),t};Kp.prototype.remove=function(e){if(l(e)&&e._labelCollection===this){let t=this._labels.indexOf(e);if(t!==-1)return this._labels.splice(t,1),m_e(this,e),!0}return!1};Kp.prototype.removeAll=function(){let e=this._labels;for(let t=0,n=e.length;t<n;++t)m_e(this,e[t]);e.length=0};Kp.prototype.contains=function(e){return l(e)&&e._labelCollection===this};Kp.prototype.get=function(e){return this._labels[e]};Kp.prototype.update=function(e){if(!this.show)return;let t=this._glyphBillboardCollection,n=this._backgroundBillboardCollection;t.modelMatrix=this.modelMatrix,t.debugShowBoundingVolume=this.debugShowBoundingVolume,n.modelMatrix=this.modelMatrix,n.debugShowBoundingVolume=this.debugShowBoundingVolume;let i=this._labelsToUpdate.length;for(let r=0;r<i;++r){let s=this._labelsToUpdate[r];if(s.isDestroyed())continue;let a=s._glyphs.length;s._rebindAllGlyphs&&(edt(this,s),s._rebindAllGlyphs=!1),s._repositionAllGlyphs&&(idt(s),s._repositionAllGlyphs=!1);let c=s._glyphs.length-a;this._totalGlyphCount+=c}let o=n.length>0?Yi.TRANSLUCENT:this.blendOption;t.blendOption=o,n.blendOption=o,t._highlightColor=this._highlightColor,n._highlightColor=this._highlightColor,this._labelsToUpdate.length=0,n.update(e),t.update(e)};Kp.prototype.isDestroyed=function(){return!1};Kp.prototype.destroy=function(){return this.removeAll(),this._glyphBillboardCollection=this._glyphBillboardCollection.destroy(),this._backgroundBillboardCollection=this._backgroundBillboardCollection.destroy(),ue(this)};var Jp=Kp;var Cpi=x(T(),1);var kfi=x(T(),1);var Gfi=x(T(),1);var od={};od.numberOfPoints=function(e,t,n){let i=h.distance(e,t);return Math.ceil(i/n)};od.numberOfPointsRhumbLine=function(e,t,n){let i=Math.pow(e.longitude-t.longitude,2)+Math.pow(e.latitude-t.latitude,2);return Math.max(1,Math.ceil(Math.sqrt(i/(n*n))))};var odt=new pe;od.extractHeights=function(e,t){let n=e.length,i=new Array(n);for(let o=0;o<n;o++){let r=e[o];i[o]=t.cartesianToCartographic(r,odt).height}return i};var rdt=new P,sdt=new h,h_e=new h,adt=new cn(h.UNIT_X,0),f_e=new h,cdt=new cn(h.UNIT_X,0),ldt=new h,ddt=new h,Iq=[];function b_e(e,t,n){let i=Iq;i.length=e;let o;if(t===n){for(o=0;o<e;o++)i[o]=t;return i}let s=(n-t)/e;for(o=0;o<e;o++){let a=t+o*s;i[o]=a}return i}var FB=new pe,vB=new pe,Ax=new h,Pq=new h,udt=new h,Fq=new gb,hN=new Gc;function mdt(e,t,n,i,o,r,s,a){let c=i.scaleToGeodeticSurface(e,Pq),d=i.scaleToGeodeticSurface(t,udt),u=od.numberOfPoints(e,t,n),m=i.cartesianToCartographic(c,FB),p=i.cartesianToCartographic(d,vB),b=b_e(u,o,r);Fq.setEndPoints(m,p);let f=Fq.surfaceDistance/u,y=a;m.height=o;let _=i.cartographicToCartesian(m,Ax);h.pack(_,s,y),y+=3;for(let S=1;S<u;S++){let Z=Fq.interpolateUsingSurfaceDistance(S*f,vB);Z.height=b[S],_=i.cartographicToCartesian(Z,Ax),h.pack(_,s,y),y+=3}return y}function hdt(e,t,n,i,o,r,s,a){let c=i.cartesianToCartographic(e,FB),d=i.cartesianToCartographic(t,vB),u=od.numberOfPointsRhumbLine(c,d,n);c.height=0,d.height=0;let m=b_e(u,o,r);hN.ellipsoid.equals(i)||(hN=new Gc(void 0,void 0,i)),hN.setEndPoints(c,d);let p=hN.surfaceDistance/u,b=a;c.height=o;let f=i.cartographicToCartesian(c,Ax);h.pack(f,s,b),b+=3;for(let y=1;y<u;y++){let _=hN.interpolateUsingSurfaceDistance(y*p,vB);_.height=m[y],f=i.cartographicToCartesian(_,Ax),h.pack(f,s,b),b+=3}return b}od.wrapLongitude=function(e,t){let n=[],i=[];if(l(e)&&e.length>0){t=t??P.IDENTITY;let o=P.inverseTransformation(t,rdt),r=P.multiplyByPoint(o,h.ZERO,sdt),s=h.normalize(P.multiplyByPointAsVector(o,h.UNIT_Y,h_e),h_e),a=cn.fromPointNormal(r,s,adt),c=h.normalize(P.multiplyByPointAsVector(o,h.UNIT_X,f_e),f_e),d=cn.fromPointNormal(r,c,cdt),u=1;n.push(h.clone(e[0]));let m=n[0],p=e.length;for(let b=1;b<p;++b){let f=e[b];if(cn.getPointDistance(d,m)<0||cn.getPointDistance(d,f)<0){let y=xi.lineSegmentPlane(m,f,a,ldt);if(l(y)){let _=h.multiplyByScalar(s,5e-9,ddt);cn.getPointDistance(a,m)<0&&h.negate(_,_),n.push(h.add(y,_,new h)),i.push(u+1),h.negate(_,_),n.push(h.add(y,_,new h)),u=1}}n.push(h.clone(e[b])),u++,m=f}i.push(u)}return{positions:n,lengths:i}};od.generateArc=function(e){l(e)||(e={});let t=e.positions,n=t.length,i=e.ellipsoid??ne.default,o=e.height??0,r=Array.isArray(o);if(n<1)return[];if(n===1){let y=i.scaleToGeodeticSurface(t[0],Pq);if(o=r?o[0]:o,o!==0){let _=i.geodeticSurfaceNormal(y,Ax);h.multiplyByScalar(_,o,_),h.add(y,_,y)}return[y.x,y.y,y.z]}let s=e.minDistance;if(!l(s)){let y=e.granularity??W.RADIANS_PER_DEGREE;s=W.chordLength(y,i.maximumRadius)}let a=0,c;for(c=0;c<n-1;c++)a+=od.numberOfPoints(t[c],t[c+1],s);let d=(a+1)*3,u=new Array(d),m=0;for(c=0;c<n-1;c++){let y=t[c],_=t[c+1],S=r?o[c]:o,Z=r?o[c+1]:o;m=mdt(y,_,s,i,S,Z,u,m)}Iq.length=0;let p=t[n-1],b=i.cartesianToCartographic(p,FB);b.height=r?o[n-1]:o;let f=i.cartographicToCartesian(b,Ax);return h.pack(f,u,d-3),u};var p_e=new pe,fdt=new pe;od.generateRhumbArc=function(e){l(e)||(e={});let t=e.positions,n=t.length,i=e.ellipsoid??ne.default,o=e.height??0,r=Array.isArray(o);if(n<1)return[];if(n===1){let S=i.scaleToGeodeticSurface(t[0],Pq);if(o=r?o[0]:o,o!==0){let Z=i.geodeticSurfaceNormal(S,Ax);h.multiplyByScalar(Z,o,Z),h.add(S,Z,S)}return[S.x,S.y,S.z]}let s=e.granularity??W.RADIANS_PER_DEGREE,a=0,c,d=i.cartesianToCartographic(t[0],p_e),u;for(c=0;c<n-1;c++)u=i.cartesianToCartographic(t[c+1],fdt),a+=od.numberOfPointsRhumbLine(d,u,s),d=pe.clone(u,p_e);let m=(a+1)*3,p=new Array(m),b=0;for(c=0;c<n-1;c++){let S=t[c],Z=t[c+1],R=r?o[c]:o,C=r?o[c+1]:o;b=hdt(S,Z,s,i,R,C,p,b)}Iq.length=0;let f=t[n-1],y=i.cartesianToCartographic(f,FB);y.height=r?o[n-1]:o;let _=i.cartographicToCartesian(y,Ax);return h.pack(_,p,m-3),p};od.generateCartesianArc=function(e){let t=od.generateArc(e),n=t.length/3,i=new Array(n);for(let o=0;o<n;o++)i[o]=h.unpack(t,o*3);return i};od.generateCartesianRhumbArc=function(e){let t=od.generateRhumbArc(e),n=t.length/3,i=new Array(n);for(let o=0;o<n;o++)i[o]=h.unpack(t,o*3);return i};var oo=od;function ku(e,t){e=e??B.EMPTY_OBJECT,this._show=e.show??!0,this._width=e.width??1,this._loop=e.loop??!1,this._distanceDisplayCondition=e.distanceDisplayCondition,this._material=e.material,l(this._material)||(this._material=eo.fromType(eo.ColorType,{color:new U(1,1,1,1)}));let n=e.positions;l(n)||(n=[]),this._positions=n,this._actualPositions=Yo(n,h.equalsEpsilon),this._loop&&this._actualPositions.length>2&&(this._actualPositions===this._positions&&(this._actualPositions=n.slice()),this._actualPositions.push(h.clone(this._actualPositions[0]))),this._length=this._actualPositions.length,this._id=e.id;let i;l(t)&&(i=P.clone(t.modelMatrix)),this._modelMatrix=i,this._segments=oo.wrapLongitude(this._actualPositions,i),this._actualLength=void 0,this._propertiesChanged=new Uint32Array(y_e),this._polylineCollection=t,this._dirty=!1,this._pickId=void 0,this._boundingVolume=me.fromPoints(this._actualPositions),this._boundingVolumeWC=me.transform(this._boundingVolume,this._modelMatrix),this._boundingVolume2D=new me}var g_e=ku.POSITION_INDEX=0,pdt=ku.SHOW_INDEX=1,bdt=ku.WIDTH_INDEX=2,gdt=ku.MATERIAL_INDEX=3,fN=ku.POSITION_SIZE_INDEX=4,ydt=ku.DISTANCE_DISPLAY_CONDITION=5,y_e=ku.NUMBER_OF_PROPERTIES=6;function ig(e,t){++e._propertiesChanged[t];let n=e._polylineCollection;l(n)&&(n._updatePolyline(e,t),e._dirty=!0)}Object.defineProperties(ku.prototype,{show:{get:function(){return this._show},set:function(e){e!==this._show&&(this._show=e,ig(this,pdt))}},positions:{get:function(){return this._positions},set:function(e){let t=Yo(e,h.equalsEpsilon);this._loop&&t.length>2&&(t===e&&(t=e.slice()),t.push(h.clone(t[0]))),(this._actualPositions.length!==t.length||this._actualPositions.length!==this._length)&&ig(this,fN),this._positions=e,this._actualPositions=t,this._length=t.length,this._boundingVolume=me.fromPoints(this._actualPositions,this._boundingVolume),this._boundingVolumeWC=me.transform(this._boundingVolume,this._modelMatrix,this._boundingVolumeWC),ig(this,g_e),this.update()}},material:{get:function(){return this._material},set:function(e){this._material!==e&&(this._material=e,ig(this,gdt))}},width:{get:function(){return this._width},set:function(e){let t=this._width;e!==t&&(this._width=e,ig(this,bdt))}},loop:{get:function(){return this._loop},set:function(e){if(e!==this._loop){let t=this._actualPositions;e?t.length>2&&!h.equals(t[0],t[t.length-1])&&(t.length===this._positions.length&&(this._actualPositions=t=this._positions.slice()),t.push(h.clone(t[0]))):t.length>2&&h.equals(t[0],t[t.length-1])&&(t.length-1===this._positions.length?this._actualPositions=this._positions:t.pop()),this._loop=e,ig(this,fN)}}},id:{get:function(){return this._id},set:function(e){this._id=e,l(this._pickId)&&(this._pickId.object.id=e)}},pickId:{get:function(){return this._pickId}},isDestroyed:{get:function(){return!l(this._polylineCollection)}},distanceDisplayCondition:{get:function(){return this._distanceDisplayCondition},set:function(e){Bt.equals(e,this._distanceDisplayCondition)||(this._distanceDisplayCondition=Bt.clone(e,this._distanceDisplayCondition),ig(this,ydt))}}});ku.prototype.update=function(){let e=P.IDENTITY;l(this._polylineCollection)&&(e=this._polylineCollection.modelMatrix);let t=this._segments.positions.length,n=this._segments.lengths,i=this._propertiesChanged[g_e]>0||this._propertiesChanged[fN]>0;if((!P.equals(e,this._modelMatrix)||i)&&(this._segments=oo.wrapLongitude(this._actualPositions,e),this._boundingVolumeWC=me.transform(this._boundingVolume,e,this._boundingVolumeWC)),this._modelMatrix=P.clone(e,this._modelMatrix),this._segments.positions.length!==t)ig(this,fN);else{let o=n.length;for(let r=0;r<o;++r)if(n[r]!==this._segments.lengths[r]){ig(this,fN);break}}};ku.prototype.getPickId=function(e){return l(this._pickId)||(this._pickId=e.createPickId({primitive:this,collection:this._polylineCollection,id:this._id})),this._pickId};ku.prototype._clean=function(){this._dirty=!1;let e=this._propertiesChanged;for(let t=0;t<y_e-1;++t)e[t]=0};ku.prototype._destroy=function(){this._pickId=this._pickId&&this._pickId.destroy(),this._material=this._material&&this._material.destroy(),this._polylineCollection=void 0};var Hm=ku;var xdt=Hm.SHOW_INDEX,Tdt=Hm.WIDTH_INDEX,Nq=Hm.POSITION_INDEX,_dt=Hm.MATERIAL_INDEX,x_e=Hm.POSITION_SIZE_INDEX,Sdt=Hm.DISTANCE_DISPLAY_CONDITION,V_e=Hm.NUMBER_OF_PROPERTIES,Bd={texCoordExpandAndBatchIndex:0,position3DHigh:1,position3DLow:2,position2DHigh:3,position2DLow:4,prevPosition3DHigh:5,prevPosition3DLow:6,prevPosition2DHigh:7,prevPosition2DLow:8,nextPosition3DHigh:9,nextPosition3DLow:10,nextPosition2DHigh:11,nextPosition2DLow:12};function xf(e){e=e??B.EMPTY_OBJECT,this.show=e.show??!0,this.modelMatrix=P.clone(e.modelMatrix??P.IDENTITY),this._modelMatrix=P.clone(P.IDENTITY),this.debugShowBoundingVolume=e.debugShowBoundingVolume??!1,this._opaqueRS=void 0,this._translucentRS=void 0,this._colorCommands=[],this._polylinesUpdated=!1,this._polylinesRemoved=!1,this._createVertexArray=!1,this._propertiesChanged=new Uint32Array(V_e),this._polylines=[],this._polylineBuckets={},this._positionBufferUsage={bufferUsage:Pe.STATIC_DRAW,frameCount:0},this._mode=void 0,this._polylinesToUpdate=[],this._vertexArrays=[],this._positionBuffer=void 0,this._texCoordExpandAndBatchIndexBuffer=void 0,this._batchTable=void 0,this._createBatchTable=!1,this._useHighlightColor=!1,this._highlightColor=U.clone(U.WHITE);let t=this;this._uniformMap={u_highlightColor:function(){return t._highlightColor}}}Object.defineProperties(xf.prototype,{length:{get:function(){return Yq(this),this._polylines.length}}});xf.prototype.add=function(e){let t=new Hm(e,this);return t._index=this._polylines.length,this._polylines.push(t),this._createVertexArray=!0,this._createBatchTable=!0,t};xf.prototype.remove=function(e){if(this.contains(e)){if(this._polylinesRemoved=!0,this._createVertexArray=!0,this._createBatchTable=!0,l(e._bucket)){let t=e._bucket;t.shaderProgram=t.shaderProgram&&t.shaderProgram.destroy()}return e._destroy(),!0}return!1};xf.prototype.removeAll=function(){Mq(this),W_e(this),this._polylineBuckets={},this._polylinesRemoved=!1,this._polylines.length=0,this._polylinesToUpdate.length=0,this._createVertexArray=!0};xf.prototype.contains=function(e){return l(e)&&e._polylineCollection===this};xf.prototype.get=function(e){return Yq(this),this._polylines[e]};function Zdt(e,t){l(e._batchTable)&&e._batchTable.destroy();let n=[{functionName:"batchTable_getWidthAndShow",componentDatatype:J.UNSIGNED_BYTE,componentsPerAttribute:2},{functionName:"batchTable_getPickColor",componentDatatype:J.UNSIGNED_BYTE,componentsPerAttribute:4,normalize:!0},{functionName:"batchTable_getCenterHigh",componentDatatype:J.FLOAT,componentsPerAttribute:3},{functionName:"batchTable_getCenterLowAndRadius",componentDatatype:J.FLOAT,componentsPerAttribute:4},{functionName:"batchTable_getDistanceDisplayCondition",componentDatatype:J.FLOAT,componentsPerAttribute:2}];e._batchTable=new Z_(t,n,e._polylines.length)}var E_e=new An,A_e=new ce,G_e=new k;xf.prototype.update=function(e){if(Yq(this),this._polylines.length===0||!this.show)return;Gdt(this,e);let t=e.context,n=e.mapProjection,i,o=this._propertiesChanged;if(this._createBatchTable){if(wt.maximumVertexTextureImageUnits===0)throw new ae("Vertex texture fetch support is required to render polylines. The maximum number of vertex texture image units must be greater than zero.");Zdt(this,t),this._createBatchTable=!1}if(this._createVertexArray||Cdt(this))S_e(this,t,n);else if(this._polylinesUpdated){let c=this._polylinesToUpdate;if(this._mode!==se.SCENE3D){let d=c.length;for(let u=0;u<d;++u)i=c[u],i.update()}if(o[x_e]||o[_dt])S_e(this,t,n);else{let d=c.length,u=this._polylineBuckets;for(let m=0;m<d;++m){i=c[m],o=i._propertiesChanged;let p=i._bucket,b=0;for(let f in u)if(u.hasOwnProperty(f)){if(u[f]===p){o[Nq]&&p.writeUpdate(b,i,this._positionBuffer,n);break}b+=u[f].lengthOfPositions}if((o[xdt]||o[Tdt])&&this._batchTable.setBatchedAttribute(i._index,0,new k(i._width,i._show)),this._batchTable.attributes.length>2){if(o[Nq]||o[x_e]){let f=e.mode===se.SCENE2D?i._boundingVolume2D:i._boundingVolumeWC,y=An.fromCartesian(f.center,E_e),_=ce.fromElements(y.low.x,y.low.y,y.low.z,f.radius,A_e);this._batchTable.setBatchedAttribute(i._index,2,y.high),this._batchTable.setBatchedAttribute(i._index,3,_)}if(o[Sdt]){let f=G_e;f.x=0,f.y=Number.MAX_VALUE;let y=i.distanceDisplayCondition;l(y)&&(f.x=y.near,f.y=y.far),this._batchTable.setBatchedAttribute(i._index,4,f)}}i._clean()}}c.length=0,this._polylinesUpdated=!1}o=this._propertiesChanged;for(let c=0;c<V_e;++c)o[c]=0;let r=P.IDENTITY;e.mode===se.SCENE3D&&(r=this.modelMatrix);let s=e.passes,a=e.morphTime!==0;if((!l(this._opaqueRS)||this._opaqueRS.depthTest.enabled!==a)&&(this._opaqueRS=ze.fromCache({depthMask:a,depthTest:{enabled:a}})),(!l(this._translucentRS)||this._translucentRS.depthTest.enabled!==a)&&(this._translucentRS=ze.fromCache({blending:on.ALPHA_BLEND,depthMask:!a,depthTest:{enabled:a}})),this._batchTable.update(e),s.render||s.pick){let c=this._colorCommands;Rdt(this,e,c,r)}};var pN=new me,T_e=new me;function Rdt(e,t,n,i){let o=t.context,r=t.commandList,s=n.length,a=0,c=!0,d=e._vertexArrays,u=e.debugShowBoundingVolume,p=e._batchTable.getUniformMapCallback(),b=d.length;for(let f=0;f<b;++f){let y=d[f],_=y.buckets,S=_.length;for(let Z=0;Z<S;++Z){let R=_[Z],C=R.offset,E=R.bucket.shaderProgram,A=R.bucket.polylines,L=A.length,F,I,N=0,g,V;for(let G=0;G<L;++G){let v=A[G],X=Edt(v._material);if(X!==F){if(l(F)&&N>0){let O=I.isTranslucent();a>=s?(g=new lt({owner:e}),n.push(g)):g=n[a],++a,V=It(p(I._uniforms),e._uniformMap),g.boundingVolume=me.clone(pN,g.boundingVolume),g.modelMatrix=i,g.shaderProgram=E,g.vertexArray=y.va,g.renderState=O?e._translucentRS:e._opaqueRS,g.pass=O?Le.TRANSLUCENT:Le.OPAQUE,g.debugShowBoundingVolume=u,g.pickId="v_pickColor",g.uniformMap=V,g.count=N,g.offset=C,C+=N,N=0,c=!0,r.push(g)}I=v._material,I.update(o),F=X}let Y=v._locatorBuckets,D=Y.length;for(let O=0;O<D;++O){let w=Y[O];w.locator===R&&(N+=w.count)}let M;t.mode===se.SCENE3D?M=v._boundingVolumeWC:t.mode===se.COLUMBUS_VIEW?M=v._boundingVolume2D:t.mode===se.SCENE2D?l(v._boundingVolume2D)&&(M=me.clone(v._boundingVolume2D,T_e),M.center.x=0):l(v._boundingVolumeWC)&&l(v._boundingVolume2D)&&(M=me.union(v._boundingVolumeWC,v._boundingVolume2D,T_e)),c?(c=!1,me.clone(M,pN)):me.union(M,pN,pN)}l(F)&&N>0&&(a>=s?(g=new lt({owner:e}),n.push(g)):g=n[a],++a,V=It(p(I._uniforms),e._uniformMap),g.boundingVolume=me.clone(pN,g.boundingVolume),g.modelMatrix=i,g.shaderProgram=E,g.vertexArray=y.va,g.renderState=I.isTranslucent()?e._translucentRS:e._opaqueRS,g.pass=I.isTranslucent()?Le.TRANSLUCENT:Le.OPAQUE,g.debugShowBoundingVolume=u,g.pickId="v_pickColor",g.uniformMap=V,g.count=N,g.offset=C,c=!0,r.push(g)),F=void 0}}n.length=a}xf.prototype.isDestroyed=function(){return!1};xf.prototype.destroy=function(){return L_e(this),Mq(this),W_e(this),this._batchTable=this._batchTable&&this._batchTable.destroy(),ue(this)};function Cdt(e){let t=!1,n=e._propertiesChanged,i=e._positionBufferUsage;return n[Nq]?(i.bufferUsage!==Pe.STREAM_DRAW&&(t=!0,i.bufferUsage=Pe.STREAM_DRAW),i.frameCount=100):i.bufferUsage!==Pe.STATIC_DRAW&&(i.frameCount===0?(t=!0,i.bufferUsage=Pe.STATIC_DRAW):i.frameCount--),t}var __e=[0,0,0];function S_e(e,t,n){e._createVertexArray=!1,Mq(e),L_e(e),Adt(e);let i=[[]],o,r=e._batchTable,s=e._useHighlightColor,a=[0],c=0,d=[[]],u=0,m=e._polylineBuckets,p,b;for(p in m)m.hasOwnProperty(p)&&(b=m[p],b.updateShader(t,r,s),u+=b.lengthOfPositions);if(u>0){let f=e._mode,y=new Float32Array(6*u*3),_=new Float32Array(u*4),S,Z=0,R=0,C=0;for(p in m)if(m.hasOwnProperty(p)){b=m[p],b.write(y,_,Z,R,C,r,t,n),f===se.MORPHING&&(l(S)||(S=new Float32Array(6*u*3)),b.writeForMorph(S,Z));let V=b.lengthOfPositions;Z+=6*V*3,R+=V*4,C+=V*4,c=b.updateIndices(i,a,d,c)}let E=e._positionBufferUsage.bufferUsage,A=Pe.STATIC_DRAW;e._positionBuffer=it.createVertexBuffer({context:t,typedArray:y,usage:E});let L;l(S)&&(L=it.createVertexBuffer({context:t,typedArray:S,usage:E})),e._texCoordExpandAndBatchIndexBuffer=it.createVertexBuffer({context:t,typedArray:_,usage:A});let F=3*Float32Array.BYTES_PER_ELEMENT,I=4*Float32Array.BYTES_PER_ELEMENT,N=0,g=i.length;for(let V=0;V<g;++V)if(o=i[V],o.length>0){let G=new Uint16Array(o),v=it.createIndexBuffer({context:t,typedArray:G,usage:Pe.STATIC_DRAW,indexDatatype:Oe.UNSIGNED_SHORT});N+=a[V];let X=6*(V*(F*W.SIXTY_FOUR_KILOBYTES)-N*F),Y=F+X,D=F+Y,M=F+D,O=F+M,w=F+O,z=V*(I*W.SIXTY_FOUR_KILOBYTES)-N*I,K=[{index:Bd.position3DHigh,componentsPerAttribute:3,componentDatatype:J.FLOAT,offsetInBytes:X,strideInBytes:6*F},{index:Bd.position3DLow,componentsPerAttribute:3,componentDatatype:J.FLOAT,offsetInBytes:Y,strideInBytes:6*F},{index:Bd.position2DHigh,componentsPerAttribute:3,componentDatatype:J.FLOAT,offsetInBytes:X,strideInBytes:6*F},{index:Bd.position2DLow,componentsPerAttribute:3,componentDatatype:J.FLOAT,offsetInBytes:Y,strideInBytes:6*F},{index:Bd.prevPosition3DHigh,componentsPerAttribute:3,componentDatatype:J.FLOAT,offsetInBytes:D,strideInBytes:6*F},{index:Bd.prevPosition3DLow,componentsPerAttribute:3,componentDatatype:J.FLOAT,offsetInBytes:M,strideInBytes:6*F},{index:Bd.prevPosition2DHigh,componentsPerAttribute:3,componentDatatype:J.FLOAT,offsetInBytes:D,strideInBytes:6*F},{index:Bd.prevPosition2DLow,componentsPerAttribute:3,componentDatatype:J.FLOAT,offsetInBytes:M,strideInBytes:6*F},{index:Bd.nextPosition3DHigh,componentsPerAttribute:3,componentDatatype:J.FLOAT,offsetInBytes:O,strideInBytes:6*F},{index:Bd.nextPosition3DLow,componentsPerAttribute:3,componentDatatype:J.FLOAT,offsetInBytes:w,strideInBytes:6*F},{index:Bd.nextPosition2DHigh,componentsPerAttribute:3,componentDatatype:J.FLOAT,offsetInBytes:O,strideInBytes:6*F},{index:Bd.nextPosition2DLow,componentsPerAttribute:3,componentDatatype:J.FLOAT,offsetInBytes:w,strideInBytes:6*F},{index:Bd.texCoordExpandAndBatchIndex,componentsPerAttribute:4,componentDatatype:J.FLOAT,vertexBuffer:e._texCoordExpandAndBatchIndexBuffer,offsetInBytes:z}],te,H,$,ee;f===se.SCENE3D?(H=e._positionBuffer,te="vertexBuffer",$=__e,ee="value"):f===se.SCENE2D||f===se.COLUMBUS_VIEW?(H=__e,te="value",$=e._positionBuffer,ee="vertexBuffer"):(H=L,te="vertexBuffer",$=e._positionBuffer,ee="vertexBuffer"),K[0][te]=H,K[1][te]=H,K[2][ee]=$,K[3][ee]=$,K[4][te]=H,K[5][te]=H,K[6][ee]=$,K[7][ee]=$,K[8][te]=H,K[9][te]=H,K[10][ee]=$,K[11][ee]=$;let le=new Un({context:t,attributes:K,indexBuffer:v});e._vertexArrays.push({va:le,buckets:d[V]})}}}function Vdt(e,t){return t instanceof vt?t.id:t}var IB=[];function Edt(e){let t=eo._uniformList[e.type],n=t.length;IB.length=2*n;let i=0;for(let o=0;o<n;++o){let r=t[o];IB[i]=r,IB[i+1]=e._uniforms[r](),i+=2}return`${e.type}:${JSON.stringify(IB,Vdt)}`}function Adt(e){let t=e._mode,n=e._modelMatrix,i=e._polylineBuckets={},o=e._polylines,r=o.length;for(let s=0;s<r;++s){let a=o[s];if(a._actualPositions.length>1){a.update();let c=a.material,d=i[c.type];l(d)||(d=i[c.type]=new jp(c,t,n)),d.addPolyline(a)}}}function Gdt(e,t){let n=t.mode;(e._mode!==n||!P.equals(e._modelMatrix,e.modelMatrix))&&(e._mode=n,e._modelMatrix=P.clone(e.modelMatrix),e._createVertexArray=!0)}function Yq(e){if(e._polylinesRemoved){e._polylinesRemoved=!1;let t=[],n=[],i=0,o,r=e._polylines.length;for(let s=0;s<r;++s)o=e._polylines[s],o.isDestroyed||(o._index=i++,n.push(o),t.push(o));e._polylines=t,e._polylinesToUpdate=n}}function Mq(e){let t=e._polylines,n=t.length;for(let i=0;i<n;++i)if(!t[i].isDestroyed){let o=t[i]._bucket;l(o)&&(o.shaderProgram=o.shaderProgram&&o.shaderProgram.destroy())}}function L_e(e){let t=e._vertexArrays.length;for(let n=0;n<t;++n)e._vertexArrays[n].va.destroy();e._vertexArrays.length=0}xf.prototype._updatePolyline=function(e,t){this._polylinesUpdated=!0,e._dirty||this._polylinesToUpdate.push(e),++this._propertiesChanged[t]};function W_e(e){let t=e._polylines,n=t.length;for(let i=0;i<n;++i)t[i].isDestroyed||t[i]._destroy()}function Xq(e,t,n){this.count=e,this.offset=t,this.bucket=n}function jp(e,t,n){this.polylines=[],this.lengthOfPositions=0,this.material=e,this.shaderProgram=void 0,this.mode=t,this.modelMatrix=n}jp.prototype.addPolyline=function(e){this.polylines.push(e),e._actualLength=this.getPolylinePositionsLength(e),this.lengthOfPositions+=e._actualLength,e._bucket=this};jp.prototype.updateShader=function(e,t,n){if(l(this.shaderProgram))return;let i=["DISTANCE_DISPLAY_CONDITION"];n&&i.push("VECTOR_TILE"),this.material.shaderSource.search(/in\s+float\s+v_polylineAngle;/g)!==-1&&i.push("POLYLINE_DASH"),i.push("CLIP_POLYLINE");let o=new Je({defines:i,sources:[`in vec4 v_pickColor; -`,this.material.shaderSource,T_]}),r=t.getVertexShaderCallback()(e2),s=new Je({defines:i,sources:[Ul,r]});this.shaderProgram=tn.fromCache({context:e,vertexShaderSource:s,fragmentShaderSource:o,attributeLocations:Bd})};function v_e(e){return h.dot(h.UNIT_X,e._boundingVolume.center)<0||e._boundingVolume.intersectPlane(cn.ORIGIN_ZX_PLANE)===qt.INTERSECTING}jp.prototype.getPolylinePositionsLength=function(e){let t;if(this.mode===se.SCENE3D||!v_e(e))return t=e._actualPositions.length,t*4-4;let n=0,i=e._segments.lengths;t=i.length;for(let o=0;o<t;++o)n+=i[o]*4-4;return n};var Sa=new h,Km=new h,Jm=new h,PB=new h,Ldt=new ce,Wdt=new k;jp.prototype.write=function(e,t,n,i,o,r,s,a){let c=this.mode,d=a.ellipsoid.maximumRadius*W.PI,u=this.polylines,m=u.length;for(let p=0;p<m;++p){let b=u[p],f=b.width,y=b.show&&f>0,_=b._index,S=this.getSegments(b,a),Z=S.positions,R=S.lengths,C=Z.length,E=b.getPickId(s).color,A=0,L=0,F;for(let D=0;D<C;++D){D===0?b._loop?F=Z[C-2]:(F=PB,h.subtract(Z[0],Z[1],F),h.add(Z[0],F,F)):F=Z[D-1],h.clone(F,Km),h.clone(Z[D],Sa),D===C-1?b._loop?F=Z[1]:(F=PB,h.subtract(Z[C-1],Z[C-2],F),h.add(Z[C-1],F,F)):F=Z[D+1],h.clone(F,Jm);let M=R[A];D===L+M&&(L+=M,++A);let O=D-L===0,w=D===L+R[A]-1;c===se.SCENE2D&&(Km.z=0,Sa.z=0,Jm.z=0),(c===se.SCENE2D||c===se.MORPHING)&&(O||w)&&d-Math.abs(Sa.x)<1&&((Sa.x<0&&Km.x>0||Sa.x>0&&Km.x<0)&&h.clone(Sa,Km),(Sa.x<0&&Jm.x>0||Sa.x>0&&Jm.x<0)&&h.clone(Sa,Jm));let z=O?2:0,K=w?2:4;for(let te=z;te<K;++te){An.writeElements(Sa,e,n),An.writeElements(Km,e,n+6),An.writeElements(Jm,e,n+12);let H=te-2<0?-1:1;t[o]=D/(C-1),t[o+1]=2*(te%2)-1,t[o+2]=H,t[o+3]=_,n+=18,o+=4}}let I=Ldt;I.x=U.floatToByte(E.red),I.y=U.floatToByte(E.green),I.z=U.floatToByte(E.blue),I.w=U.floatToByte(E.alpha);let N=Wdt;N.x=f,N.y=y?1:0;let g=c===se.SCENE2D?b._boundingVolume2D:b._boundingVolumeWC,V=An.fromCartesian(g.center,E_e),G=V.high,v=ce.fromElements(V.low.x,V.low.y,V.low.z,g.radius,A_e),X=G_e;X.x=0,X.y=Number.MAX_VALUE;let Y=b.distanceDisplayCondition;l(Y)&&(X.x=Y.near,X.y=Y.far),r.setBatchedAttribute(_,0,N),r.setBatchedAttribute(_,1,I),r.attributes.length>2&&(r.setBatchedAttribute(_,2,G),r.setBatchedAttribute(_,3,v),r.setBatchedAttribute(_,4,X))}};var vdt=new h,Fdt=new h,Idt=new h,Z_e=new h;jp.prototype.writeForMorph=function(e,t){let n=this.modelMatrix,i=this.polylines,o=i.length;for(let r=0;r<o;++r){let s=i[r],a=s._segments.positions,c=s._segments.lengths,d=a.length,u=0,m=0;for(let p=0;p<d;++p){let b;p===0?s._loop?b=a[d-2]:(b=Z_e,h.subtract(a[0],a[1],b),h.add(a[0],b,b)):b=a[p-1],b=P.multiplyByPoint(n,b,Fdt);let f=P.multiplyByPoint(n,a[p],vdt),y;p===d-1?s._loop?y=a[1]:(y=Z_e,h.subtract(a[d-1],a[d-2],y),h.add(a[d-1],y,y)):y=a[p+1],y=P.multiplyByPoint(n,y,Idt);let _=c[u];p===m+_&&(m+=_,++u);let S=p-m===0,Z=p===m+c[u]-1,R=S?2:0,C=Z?2:4;for(let E=R;E<C;++E)An.writeElements(f,e,t),An.writeElements(b,e,t+6),An.writeElements(y,e,t+12),t+=18}}};var Pdt=new Array(1);jp.prototype.updateIndices=function(e,t,n,i){let o=n.length-1,r=new Xq(0,i,this);n[o].push(r);let s=0,a=e[e.length-1],c=0;a.length>0&&(c=a[a.length-1]+1);let d=this.polylines,u=d.length;for(let m=0;m<u;++m){let p=d[m];p._locatorBuckets=[];let b;if(this.mode===se.SCENE3D){b=Pdt;let y=p._actualPositions.length;if(y>0)b[0]=y;else continue}else b=p._segments.lengths;let f=b.length;if(f>0){let y=0;for(let _=0;_<f;++_){let S=b[_]-1;for(let Z=0;Z<S;++Z)c+4>W.SIXTY_FOUR_KILOBYTES&&(p._locatorBuckets.push({locator:r,count:y}),y=0,t.push(4),a=[],e.push(a),c=0,r.count=s,s=0,i=0,r=new Xq(0,0,this),n[++o]=[r]),a.push(c,c+2,c+1),a.push(c+1,c+2,c+3),y+=6,s+=6,i+=6,c+=4}p._locatorBuckets.push({locator:r,count:y}),c+4>W.SIXTY_FOUR_KILOBYTES&&(t.push(0),a=[],e.push(a),c=0,r.count=s,i=0,s=0,r=new Xq(0,0,this),n[++o]=[r])}p._clean()}return r.count=s,i};jp.prototype.getPolylineStartIndex=function(e){let t=this.polylines,n=0,i=t.length;for(let o=0;o<i;++o){let r=t[o];if(r===e)break;n+=r._actualLength}return n};var eV={positions:void 0,lengths:void 0},R_e=new Array(1),Xdt=new h,Ndt=new pe;jp.prototype.getSegments=function(e,t){let n=e._actualPositions;if(this.mode===se.SCENE3D)return R_e[0]=n.length,eV.positions=n,eV.lengths=R_e,eV;v_e(e)&&(n=e._segments.positions);let i=t.ellipsoid,o=[],r=this.modelMatrix,s=n.length,a,c=Xdt;for(let d=0;d<s;++d)a=n[d],c=P.multiplyByPoint(r,a,c),o.push(t.project(i.cartesianToCartographic(c,Ndt)));if(o.length>0){e._boundingVolume2D=me.fromPoints(o,e._boundingVolume2D);let d=e._boundingVolume2D.center;e._boundingVolume2D.center=new h(d.z,d.x,d.y)}return eV.positions=o,eV.lengths=e._segments.lengths,eV};var C_e;jp.prototype.writeUpdate=function(e,t,n,i){let o=this.mode,r=i.ellipsoid.maximumRadius*W.PI,s=t._actualLength;if(s){e+=this.getPolylineStartIndex(t);let a=C_e,c=6*s*3;!l(a)||a.length<c?a=C_e=new Float32Array(c):a.length>c&&(a=new Float32Array(a.buffer,0,c));let d=this.getSegments(t,i),u=d.positions,m=d.lengths,p=0,b=0,f=0,y;s=u.length;for(let _=0;_<s;++_){_===0?t._loop?y=u[s-2]:(y=PB,h.subtract(u[0],u[1],y),h.add(u[0],y,y)):y=u[_-1],h.clone(y,Km),h.clone(u[_],Sa),_===s-1?t._loop?y=u[1]:(y=PB,h.subtract(u[s-1],u[s-2],y),h.add(u[s-1],y,y)):y=u[_+1],h.clone(y,Jm);let S=m[b];_===f+S&&(f+=S,++b);let Z=_-f===0,R=_===f+m[b]-1;o===se.SCENE2D&&(Km.z=0,Sa.z=0,Jm.z=0),(o===se.SCENE2D||o===se.MORPHING)&&(Z||R)&&r-Math.abs(Sa.x)<1&&((Sa.x<0&&Km.x>0||Sa.x>0&&Km.x<0)&&h.clone(Sa,Km),(Sa.x<0&&Jm.x>0||Sa.x>0&&Jm.x<0)&&h.clone(Sa,Jm));let C=Z?2:0,E=R?2:4;for(let A=C;A<E;++A)An.writeElements(Sa,a,p),An.writeElements(Km,a,p+6),An.writeElements(Jm,a,p+12),p+=18}n.copyFromArrayView(a,18*Float32Array.BYTES_PER_ELEMENT*e)}};var Tf=xf;function Gx(e){this._positions=e.positions,this._batchTable=e.batchTable,this._batchIds=e.batchIds,this._rectangle=e.rectangle,this._minHeight=e.minimumHeight,this._maxHeight=e.maximumHeight,this._heightReference=e.heightReference,this._billboardCollection=new wu({batchTable:e.batchTable,scene:e.scene}),this._labelCollection=new Jp({batchTable:e.batchTable,scene:e.scene}),this._polylineCollection=new Tf,this._polylineCollection._useHighlightColor=!0,this._packedBuffer=void 0,this._ready=!1,this._promise=void 0,this._error=void 0}Object.defineProperties(Gx.prototype,{ready:{get:function(){return this._ready}},pointsLength:{get:function(){return this._billboardCollection.length}},texturesByteLength:{get:function(){let e=this._billboardCollection.sizeInBytes,t=this._labelCollection.sizeInBytes;return e+t}}});function Ydt(e,t){let n=e._rectangle,i=e._minHeight,o=e._maxHeight,r=2+re.packedLength+ne.packedLength,s=new Float64Array(r),a=0;return s[a++]=i,s[a++]=o,re.pack(n,s,a),a+=re.packedLength,ne.pack(t,s,a),s}var Mdt=new qn("createVectorTilePoints",5),wdt=new h;function kdt(e,t){let n=e._positions,i=e._packedBuffer;l(i)||(n=e._positions=n.slice(),e._batchIds=e._batchIds.slice(),i=e._packedBuffer=Ydt(e,t));let o=[n.buffer,i.buffer],r={positions:n.buffer,packedBuffer:i.buffer},s=Mdt.scheduleTask(r,o);if(l(s))return s.then(a=>{if(e.isDestroyed())return;e._positions=new Float64Array(a.positions);let c=e._billboardCollection,d=e._labelCollection,u=e._polylineCollection;n=e._positions;let m=e._batchIds,p=n.length/3,b=e._heightReference??He.NONE;for(let f=0;f<p;++f){let y=m[f],_=h.unpack(n,f*3,wdt),S=c.add();S.position=_,S._batchIndex=y,S.heightReference=b;let Z=d.add();Z.text=" ",Z.position=_,Z._batchIndex=y,Z.heightReference=b;let R=u.add();R.positions=[h.clone(_),h.clone(_)]}e._positions=void 0,e._packedBuffer=void 0,e._ready=!0}).catch(a=>{e.isDestroyed()||(e._error=a)})}Gx.prototype.createFeatures=function(e,t){let n=this._billboardCollection,i=this._labelCollection,o=this._polylineCollection,r=this._batchIds,s=r.length;for(let a=0;a<s;++a){let c=r[a],d=n.get(a),u=i.get(a),m=o.get(a);t[c]=new tg(e,c,d,u,m)}};Gx.prototype.applyDebugSettings=function(e,t){e?(U.clone(t,this._billboardCollection._highlightColor),U.clone(t,this._labelCollection._highlightColor),U.clone(t,this._polylineCollection._highlightColor)):(U.clone(U.WHITE,this._billboardCollection._highlightColor),U.clone(U.WHITE,this._labelCollection._highlightColor),U.clone(U.WHITE,this._polylineCollection._highlightColor))};function Udt(e,t){let n=e._batchIds,i=n.length;for(let o=0;o<i;++o){let r=n[o],s=t[r];s.show=!0,s.pointSize=tg.defaultPointSize,s.color=tg.defaultColor,s.pointOutlineColor=tg.defaultPointOutlineColor,s.pointOutlineWidth=tg.defaultPointOutlineWidth,s.labelColor=U.WHITE,s.labelOutlineColor=U.WHITE,s.labelOutlineWidth=1,s.font="30px sans-serif",s.labelStyle=Tr.FILL,s.labelText=void 0,s.backgroundColor=new U(.165,.165,.165,.8),s.backgroundPadding=new k(7,5),s.backgroundEnabled=!1,s.scaleByDistance=void 0,s.translucencyByDistance=void 0,s.distanceDisplayCondition=void 0,s.heightOffset=0,s.anchorLineEnabled=!1,s.anchorLineColor=U.WHITE,s.image=void 0,s.disableDepthTestDistance=0,s.horizontalOrigin=Ui.CENTER,s.verticalOrigin=zn.CENTER,s.labelHorizontalOrigin=Ui.RIGHT,s.labelVerticalOrigin=zn.BASELINE}}var Ddt=new U,Odt=new U,Bdt=new U,zdt=new U,Hdt=new U,Kdt=new U,bN=new Kt,gN=new Kt,wq=new Bt;Gx.prototype.applyStyle=function(e,t){if(!l(e)){Udt(this,t);return}let n=this._batchIds,i=n.length;for(let o=0;o<i;++o){let r=n[o],s=t[r];if(l(e.show)&&(s.show=e.show.evaluate(s)),l(e.pointSize)&&(s.pointSize=e.pointSize.evaluate(s)),l(e.color)&&(s.color=e.color.evaluateColor(s,Ddt)),l(e.pointOutlineColor)&&(s.pointOutlineColor=e.pointOutlineColor.evaluateColor(s,Odt)),l(e.pointOutlineWidth)&&(s.pointOutlineWidth=e.pointOutlineWidth.evaluate(s)),l(e.labelColor)&&(s.labelColor=e.labelColor.evaluateColor(s,Bdt)),l(e.labelOutlineColor)&&(s.labelOutlineColor=e.labelOutlineColor.evaluateColor(s,zdt)),l(e.labelOutlineWidth)&&(s.labelOutlineWidth=e.labelOutlineWidth.evaluate(s)),l(e.font)&&(s.font=e.font.evaluate(s)),l(e.labelStyle)&&(s.labelStyle=e.labelStyle.evaluate(s)),l(e.labelText)?s.labelText=e.labelText.evaluate(s):s.labelText=void 0,l(e.backgroundColor)&&(s.backgroundColor=e.backgroundColor.evaluateColor(s,Hdt)),l(e.backgroundPadding)&&(s.backgroundPadding=e.backgroundPadding.evaluate(s)),l(e.backgroundEnabled)&&(s.backgroundEnabled=e.backgroundEnabled.evaluate(s)),l(e.scaleByDistance)){let a=e.scaleByDistance.evaluate(s);l(a)?(bN.near=a.x,bN.nearValue=a.y,bN.far=a.z,bN.farValue=a.w,s.scaleByDistance=bN):s.scaleByDistance=void 0}else s.scaleByDistance=void 0;if(l(e.translucencyByDistance)){let a=e.translucencyByDistance.evaluate(s);l(a)?(gN.near=a.x,gN.nearValue=a.y,gN.far=a.z,gN.farValue=a.w,s.translucencyByDistance=gN):s.translucencyByDistance=void 0}else s.translucencyByDistance=void 0;if(l(e.distanceDisplayCondition)){let a=e.distanceDisplayCondition.evaluate(s);l(a)?(wq.near=a.x,wq.far=a.y,s.distanceDisplayCondition=wq):s.distanceDisplayCondition=void 0}else s.distanceDisplayCondition=void 0;l(e.heightOffset)&&(s.heightOffset=e.heightOffset.evaluate(s)),l(e.anchorLineEnabled)&&(s.anchorLineEnabled=e.anchorLineEnabled.evaluate(s)),l(e.anchorLineColor)&&(s.anchorLineColor=e.anchorLineColor.evaluateColor(s,Kdt)),l(e.image)?s.image=e.image.evaluate(s):s.image=void 0,l(e.disableDepthTestDistance)&&(s.disableDepthTestDistance=e.disableDepthTestDistance.evaluate(s)),l(e.horizontalOrigin)&&(s.horizontalOrigin=e.horizontalOrigin.evaluate(s)),l(e.verticalOrigin)&&(s.verticalOrigin=e.verticalOrigin.evaluate(s)),l(e.labelHorizontalOrigin)&&(s.labelHorizontalOrigin=e.labelHorizontalOrigin.evaluate(s)),l(e.labelVerticalOrigin)&&(s.labelVerticalOrigin=e.labelVerticalOrigin.evaluate(s))}};Gx.prototype.update=function(e){if(!this._ready&&(l(this._promise)||(this._promise=kdt(this,e.mapProjection.ellipsoid)),l(this._error))){let t=this._error;throw this._error=void 0,t}this._polylineCollection.update(e),this._billboardCollection.update(e),this._labelCollection.update(e)};Gx.prototype.isDestroyed=function(){return!1};Gx.prototype.destroy=function(){return this._billboardCollection=this._billboardCollection&&this._billboardCollection.destroy(),this._labelCollection=this._labelCollection&&this._labelCollection.destroy(),this._polylineCollection=this._polylineCollection&&this._polylineCollection.destroy(),ue(this)};var yN=Gx;var r0i=x(T(),1);function og(e){this._batchTable=e.batchTable,this._batchIds=e.batchIds,this._positions=e.positions,this._counts=e.counts,this._indices=e.indices,this._indexCounts=e.indexCounts,this._indexOffsets=void 0,this._batchTableColors=void 0,this._packedBuffer=void 0,this._batchedPositions=void 0,this._transferrableBatchIds=void 0,this._vertexBatchIds=void 0,this._ellipsoid=e.ellipsoid??ne.WGS84,this._minimumHeight=e.minimumHeight,this._maximumHeight=e.maximumHeight,this._polygonMinimumHeights=e.polygonMinimumHeights,this._polygonMaximumHeights=e.polygonMaximumHeights,this._center=e.center??h.ZERO,this._rectangle=e.rectangle,this._center=void 0,this._boundingVolume=e.boundingVolume,this._boundingVolumes=void 0,this._batchedIndices=void 0,this._ready=!1,this._promise=void 0,this._error=void 0,this._primitive=void 0,this.debugWireframe=!1,this.forceRebatch=!1,this.classificationType=ni.BOTH}Object.defineProperties(og.prototype,{trianglesLength:{get:function(){return l(this._primitive)?this._primitive.trianglesLength:0}},geometryByteLength:{get:function(){return l(this._primitive)?this._primitive.geometryByteLength:0}},ready:{get:function(){return this._ready}}});function Jdt(e){let t=new Float64Array(3+h.packedLength+ne.packedLength+re.packedLength),n=0;return t[n++]=e._indices.BYTES_PER_ELEMENT,t[n++]=e._minimumHeight,t[n++]=e._maximumHeight,h.pack(e._center,t,n),n+=h.packedLength,ne.pack(e._ellipsoid,t,n),n+=ne.packedLength,re.pack(e._rectangle,t,n),t}function jdt(e,t){let n=1,i=t[n++],o=e._boundingVolumes=new Array(i);for(let a=0;a<i;++a)o[a]=nn.unpack(t,n),n+=nn.packedLength;let r=t[n++],s=e._batchedIndices=new Array(r);for(let a=0;a<r;++a){let c=U.unpack(t,n);n+=U.packedLength;let d=t[n++],u=t[n++],m=t[n++],p=new Array(m);for(let b=0;b<m;++b)p[b]=t[n++];s[a]=new Pp({color:c,offset:d,count:u,batchIds:p})}}var Qdt=new qn("createVectorTilePolygons",5),qdt=new U;function $dt(e){if(l(e._primitive))return;let t=e._positions,n=e._counts,i=e._indexCounts,o=e._indices,r=e._transferrableBatchIds,s=e._batchTableColors,a=e._packedBuffer;if(!l(s)){t=e._positions=e._positions.slice(),n=e._counts=e._counts.slice(),i=e._indexCounts=e._indexCounts.slice(),o=e._indices=e._indices.slice(),e._center=e._ellipsoid.cartographicToCartesian(re.center(e._rectangle)),r=e._transferrableBatchIds=new Uint32Array(e._batchIds),s=e._batchTableColors=new Uint32Array(r.length);let b=e._batchTable,f=s.length;for(let y=0;y<f;++y){let _=b.getColor(y,qdt);s[y]=_.toRgba()}a=e._packedBuffer=Jdt(e)}let c=[t.buffer,n.buffer,i.buffer,o.buffer,r.buffer,s.buffer,a.buffer],d={packedBuffer:a.buffer,positions:t.buffer,counts:n.buffer,indexCounts:i.buffer,indices:o.buffer,batchIds:r.buffer,batchTableColors:s.buffer},u=e._polygonMinimumHeights,m=e._polygonMaximumHeights;l(u)&&l(m)&&(u=u.slice(),m=m.slice(),c.push(u.buffer,m.buffer),d.minimumHeights=u,d.maximumHeights=m);let p=Qdt.scheduleTask(d,c);if(l(p))return p.then(b=>{if(e.isDestroyed())return;e._positions=void 0,e._counts=void 0,e._polygonMinimumHeights=void 0,e._polygonMaximumHeights=void 0;let f=new Float64Array(b.packedBuffer),y=f[0];jdt(e,f),e._indices=Oe.getSizeInBytes(y)===2?new Uint16Array(b.indices):new Uint32Array(b.indices),e._indexOffsets=new Uint32Array(b.indexOffsets),e._indexCounts=new Uint32Array(b.indexCounts),e._batchedPositions=new Float32Array(b.positions),e._vertexBatchIds=new Uint16Array(b.batchIds),eut(e),e._ready=!0}).catch(b=>{e.isDestroyed()||(e._error=b)})}function eut(e){l(e._primitive)||(e._primitive=new j_({batchTable:e._batchTable,positions:e._batchedPositions,batchIds:e._batchIds,vertexBatchIds:e._vertexBatchIds,indices:e._indices,indexOffsets:e._indexOffsets,indexCounts:e._indexCounts,batchedIndices:e._batchedIndices,boundingVolume:e._boundingVolume,boundingVolumes:e._boundingVolumes,center:e._center}),e._batchTable=void 0,e._batchIds=void 0,e._positions=void 0,e._counts=void 0,e._indices=void 0,e._indexCounts=void 0,e._indexOffsets=void 0,e._batchTableColors=void 0,e._packedBuffer=void 0,e._batchedPositions=void 0,e._transferrableBatchIds=void 0,e._vertexBatchIds=void 0,e._ellipsoid=void 0,e._minimumHeight=void 0,e._maximumHeight=void 0,e._polygonMinimumHeights=void 0,e._polygonMaximumHeights=void 0,e._center=void 0,e._rectangle=void 0,e._boundingVolume=void 0,e._boundingVolumes=void 0,e._batchedIndices=void 0)}og.prototype.createFeatures=function(e,t){this._primitive.createFeatures(e,t)};og.prototype.applyDebugSettings=function(e,t){this._primitive.applyDebugSettings(e,t)};og.prototype.applyStyle=function(e,t){this._primitive.applyStyle(e,t)};og.prototype.updateCommands=function(e,t){this._primitive.updateCommands(e,t)};og.prototype.update=function(e){if(!this._ready){if(l(this._promise)||(this._promise=$dt(this)),l(this._error)){let t=this._error;throw this._error=void 0,t}return}this._primitive.debugWireframe=this.debugWireframe,this._primitive.forceRebatch=this.forceRebatch,this._primitive.classificationType=this.classificationType,this._primitive.update(e)};og.prototype.isDestroyed=function(){return!1};og.prototype.destroy=function(){return this._primitive=this._primitive&&this._primitive.destroy(),ue(this)};var xN=og;var G0i=x(T(),1);function _f(e){this._positions=e.positions,this._widths=e.widths,this._counts=e.counts,this._batchIds=e.batchIds,this._ellipsoid=e.ellipsoid??ne.WGS84,this._minimumHeight=e.minimumHeight,this._maximumHeight=e.maximumHeight,this._center=e.center,this._rectangle=e.rectangle,this._boundingVolume=e.boundingVolume,this._batchTable=e.batchTable,this._va=void 0,this._sp=void 0,this._rs=void 0,this._uniformMap=void 0,this._command=void 0,this._transferrableBatchIds=void 0,this._packedBuffer=void 0,this._keepDecodedPositions=e.keepDecodedPositions,this._decodedPositions=void 0,this._decodedPositionOffsets=void 0,this._currentPositions=void 0,this._previousPositions=void 0,this._nextPositions=void 0,this._expandAndWidth=void 0,this._vertexBatchIds=void 0,this._indices=void 0,this._constantColor=U.clone(U.WHITE),this._highlightColor=this._constantColor,this._trianglesLength=0,this._geometryByteLength=0,this._ready=!1,this._promise=void 0,this._error=void 0}Object.defineProperties(_f.prototype,{trianglesLength:{get:function(){return this._trianglesLength}},geometryByteLength:{get:function(){return this._geometryByteLength}},ready:{get:function(){return this._ready}}});function tut(e){let t=e._rectangle,n=e._minimumHeight,i=e._maximumHeight,o=e._ellipsoid,r=e._center,s=2+re.packedLength+ne.packedLength+h.packedLength,a=new Float64Array(s),c=0;return a[c++]=n,a[c++]=i,re.pack(t,a,c),c+=re.packedLength,ne.pack(o,a,c),c+=ne.packedLength,h.pack(r,a,c),a}var nut=new qn("createVectorTilePolylines",5),tV={previousPosition:0,currentPosition:1,nextPosition:2,expandAndWidth:3,a_batchId:4};function iut(e,t){if(l(e._va))return;let n=e._positions,i=e._widths,o=e._counts,r=e._transferrableBatchIds,s=e._packedBuffer;l(s)||(n=e._positions=n.slice(),i=e._widths=i.slice(),o=e._counts=o.slice(),r=e._transferrableBatchIds=e._batchIds.slice(),s=e._packedBuffer=tut(e));let a=[n.buffer,i.buffer,o.buffer,r.buffer,s.buffer],c={positions:n.buffer,widths:i.buffer,counts:o.buffer,batchIds:r.buffer,packedBuffer:s.buffer,keepDecodedPositions:e._keepDecodedPositions},d=nut.scheduleTask(c,a);if(l(d))return d.then(function(u){if(e.isDestroyed())return;e._keepDecodedPositions&&(e._decodedPositions=new Float64Array(u.decodedPositions),e._decodedPositionOffsets=new Uint32Array(u.decodedPositionOffsets)),e._currentPositions=new Float32Array(u.currentPositions),e._previousPositions=new Float32Array(u.previousPositions),e._nextPositions=new Float32Array(u.nextPositions),e._expandAndWidth=new Float32Array(u.expandAndWidth),e._vertexBatchIds=new Uint16Array(u.batchIds);let m=u.indexDatatype;e._indices=m===Oe.UNSIGNED_SHORT?new Uint16Array(u.indices):new Uint32Array(u.indices),out(e,t),e._ready=!0}).catch(u=>{e.isDestroyed()||(e._error=u)})}function out(e,t){if(!l(e._va)){let n=e._currentPositions,i=e._previousPositions,o=e._nextPositions,r=e._expandAndWidth,s=e._vertexBatchIds,a=e._indices,c=i.byteLength+n.byteLength+o.byteLength;c+=r.byteLength+s.byteLength+a.byteLength,e._trianglesLength=a.length/3,e._geometryByteLength=c;let d=it.createVertexBuffer({context:t,typedArray:i,usage:Pe.STATIC_DRAW}),u=it.createVertexBuffer({context:t,typedArray:n,usage:Pe.STATIC_DRAW}),m=it.createVertexBuffer({context:t,typedArray:o,usage:Pe.STATIC_DRAW}),p=it.createVertexBuffer({context:t,typedArray:r,usage:Pe.STATIC_DRAW}),b=it.createVertexBuffer({context:t,typedArray:s,usage:Pe.STATIC_DRAW}),f=it.createIndexBuffer({context:t,typedArray:a,usage:Pe.STATIC_DRAW,indexDatatype:a.BYTES_PER_ELEMENT===2?Oe.UNSIGNED_SHORT:Oe.UNSIGNED_INT}),y=[{index:tV.previousPosition,vertexBuffer:d,componentDatatype:J.FLOAT,componentsPerAttribute:3},{index:tV.currentPosition,vertexBuffer:u,componentDatatype:J.FLOAT,componentsPerAttribute:3},{index:tV.nextPosition,vertexBuffer:m,componentDatatype:J.FLOAT,componentsPerAttribute:3},{index:tV.expandAndWidth,vertexBuffer:p,componentDatatype:J.FLOAT,componentsPerAttribute:2},{index:tV.a_batchId,vertexBuffer:b,componentDatatype:J.UNSIGNED_SHORT,componentsPerAttribute:1}];e._va=new Un({context:t,attributes:y,indexBuffer:f}),e._positions=void 0,e._widths=void 0,e._counts=void 0,e._ellipsoid=void 0,e._minimumHeight=void 0,e._maximumHeight=void 0,e._rectangle=void 0,e._transferrableBatchIds=void 0,e._packedBuffer=void 0,e._currentPositions=void 0,e._previousPositions=void 0,e._nextPositions=void 0,e._expandAndWidth=void 0,e._vertexBatchIds=void 0,e._indices=void 0}}var TN=new P,F_e=new h;function rut(e,t){l(e._uniformMap)||(e._uniformMap={u_modifiedModelView:function(){let n=t.uniformState.view;return P.clone(n,TN),P.multiplyByPoint(TN,e._center,F_e),P.setTranslation(TN,F_e,TN),TN},u_highlightColor:function(){return e._highlightColor}})}function sut(e){if(l(e._rs))return;let t={enabled:!0,factor:-5,units:-5};e._rs=ze.fromCache({blending:on.ALPHA_BLEND,depthMask:!1,depthTest:{enabled:!0},polygonOffset:t})}var aut=`uniform vec4 u_highlightColor; +`;let m=new Je({sources:[a]}),p=new Je({defines:["VECTOR_TILE"],sources:[c]});e._spPick=tn.fromCache({context:t,vertexShaderSource:m,fragmentShaderSource:p,attributeLocations:i})}function QZe(e){let t=e?ni.EQUAL:ni.ALWAYS;return{colorMask:{red:!1,green:!1,blue:!1,alpha:!1},stencilTest:{enabled:!0,frontFunction:t,frontOperation:{fail:Ft.KEEP,zFail:Ft.DECREMENT_WRAP,zPass:Ft.KEEP},backFunction:t,backOperation:{fail:Ft.KEEP,zFail:Ft.INCREMENT_WRAP,zPass:Ft.KEEP},reference:Jt.CESIUM_3D_TILE_MASK,mask:Jt.CESIUM_3D_TILE_MASK},stencilMask:Jt.CLASSIFICATION_MASK,depthTest:{enabled:!0,func:sc.LESS_OR_EQUAL},depthMask:!1}}var Oht={stencilTest:{enabled:!0,frontFunction:ni.NOT_EQUAL,frontOperation:{fail:Ft.ZERO,zFail:Ft.ZERO,zPass:Ft.ZERO},backFunction:ni.NOT_EQUAL,backOperation:{fail:Ft.ZERO,zFail:Ft.ZERO,zPass:Ft.ZERO},reference:0,mask:Jt.CLASSIFICATION_MASK},stencilMask:Jt.CLASSIFICATION_MASK,depthTest:{enabled:!1},depthMask:!1,blending:on.PRE_MULTIPLIED_ALPHA_BLEND},Bht={stencilTest:{enabled:!0,frontFunction:ni.NOT_EQUAL,frontOperation:{fail:Ft.ZERO,zFail:Ft.ZERO,zPass:Ft.ZERO},backFunction:ni.NOT_EQUAL,backOperation:{fail:Ft.ZERO,zFail:Ft.ZERO,zPass:Ft.ZERO},reference:0,mask:Jt.CLASSIFICATION_MASK},stencilMask:Jt.CLASSIFICATION_MASK,depthTest:{enabled:!1},depthMask:!1};function zht(e){l(e._rsStencilDepthPass)||(e._rsStencilDepthPass=ze.fromCache(QZe(!1)),e._rsStencilDepthPass3DTiles=ze.fromCache(QZe(!0)),e._rsColorPass=ze.fromCache(Oht),e._rsPickPass=ze.fromCache(Bht))}var BS=new P,qZe=new h;function Hht(e,t){if(l(e._uniformMap))return;let n={u_modifiedModelViewProjection:function(){let i=t.uniformState.view,o=t.uniformState.projection;return P.clone(i,BS),P.multiplyByPoint(BS,e._center,qZe),P.setTranslation(BS,qZe,BS),P.multiply(o,BS,BS),BS},u_highlightColor:function(){return e._highlightColor}};e._uniformMap=e._batchTable.getUniformMapCallback()(n)}function T$(e,t,n,i,o,r,s){let a=e.constructor.BYTES_PER_ELEMENT,c=r.length;for(let d=0;d<c;++d){let u=r[d],m=s[u],p=i[m],b=o[m],f=new e.constructor(e.buffer,a*p,b);t.set(f,n),i[m]=n,n+=b}return n}function Kht(e,t){let n=e._indices,i=e._indexOffsets,o=e._indexCounts,r=e._batchIdLookUp,s=new n.constructor(n.length),a=t.pop(),c=[a],d=T$(n,s,0,i,o,a.batchIds,r);for(a.offset=0,a.count=d;t.length>0;){let u=t.pop();if(U.equals(u.color,a.color))d=T$(n,s,d,i,o,u.batchIds,r),a.batchIds=a.batchIds.concat(u.batchIds),a.count=d-a.offset;else{let m=d;d=T$(n,s,d,i,o,u.batchIds,r),u.offset=m,u.count=d-m,c.push(u),a=u}}e._va.indexBuffer.copyFromArrayView(s),e._indices=s,e._batchedIndices=c}function _$(e,t,n,i,o,r,s){let a=e.bytesPerIndex,c=r.length;for(let d=0;d<c;++d){let u=r[d],m=s[u],p=i[m],b=o[m];t.copyFromBuffer(e,p*a,n*a,b*a),i[m]=n,n+=b}return n}function Jht(e,t){let n=e._indexOffsets,i=e._indexCounts,o=e._batchIdLookUp,r=t.pop(),s=[r],a=e._va.indexBuffer,c=e._vaSwap.indexBuffer,d=_$(a,c,0,n,i,r.batchIds,o);for(r.offset=0,r.count=d;t.length>0;){let m=t.pop();if(U.equals(m.color,r.color))d=_$(a,c,d,n,i,m.batchIds,o),r.batchIds=r.batchIds.concat(m.batchIds),r.count=d-r.offset;else{let p=d;d=_$(a,c,d,n,i,m.batchIds,o),m.offset=p,m.count=d-p,s.push(m),r=m}}let u=e._va;e._va=e._vaSwap,e._vaSwap=u,e._batchedIndices=s}function jht(e,t){return t.color.toRgba()-e.color.toRgba()}function Qht(e,t){if(!e._batchDirty)return!1;let n=e._batchedIndices,i=n.length,o=!1,r={};for(let s=0;s<i;++s){let c=n[s].color.toRgba();if(l(r[c])){o=!0;break}else r[c]=!0}if(!o)return e._batchDirty=!1,!1;if(o&&!e.forceRebatch&&e._framesSinceLastRebatch<120){++e._framesSinceLastRebatch;return}return n.sort(jht),t.webgl2?Jht(e,n):Kht(e,n),e._framesSinceLastRebatch=0,e._batchDirty=!1,e._pickCommandsDirty=!0,e._wireframeDirty=!0,!0}function qht(e,t){let n=Qht(e,t),i=e._commands,o=e._batchedIndices,r=o.length,s=r*2;if(l(i)&&!n&&i.length===s)return;i.length=s;let a=e._va,c=e._sp,d=e._modelMatrix??P.IDENTITY,u=e._uniformMap,m=e._boundingVolume;for(let p=0;p<r;++p){let b=o[p].offset,f=o[p].count,y=i[p*2];l(y)||(y=i[p*2]=new lt({owner:e})),y.vertexArray=a,y.modelMatrix=d,y.offset=b,y.count=f,y.renderState=e._rsStencilDepthPass,y.shaderProgram=c,y.uniformMap=u,y.boundingVolume=m,y.cull=!1,y.pass=Le.TERRAIN_CLASSIFICATION;let _=lt.shallowClone(y,y.derivedCommands.tileset);_.renderState=e._rsStencilDepthPass3DTiles,_.pass=Le.CESIUM_3D_TILE_CLASSIFICATION,y.derivedCommands.tileset=_;let S=i[p*2+1];l(S)||(S=i[p*2+1]=new lt({owner:e})),S.vertexArray=a,S.modelMatrix=d,S.offset=b,S.count=f,S.renderState=e._rsColorPass,S.shaderProgram=c,S.uniformMap=u,S.boundingVolume=m,S.cull=!1,S.pass=Le.TERRAIN_CLASSIFICATION;let Z=lt.shallowClone(S,S.derivedCommands.tileset);Z.pass=Le.CESIUM_3D_TILE_CLASSIFICATION,S.derivedCommands.tileset=Z}e._commandsDirty=!0}function $ht(e,t){if(e.classificationType===ti.TERRAIN||!t.invertClassification||l(e._commandsIgnoreShow)&&!e._commandsDirty)return;let n=e._commands,i=e._commandsIgnoreShow,o=e._spStencil,r=n.length,s=i.length=r/2,a=0;for(let c=0;c<s;++c){let d=i[c]=lt.shallowClone(n[a],i[c]);d.shaderProgram=o,d.pass=Le.CESIUM_3D_TILE_CLASSIFICATION_IGNORE_SHOW,a+=2}e._commandsDirty=!1}function eft(e){if(!e._pickCommandsDirty)return;let t=e._indexOffsets.length,n=e._pickCommands;n.length=t*2;let i=e._va,o=e._spStencil,r=e._spPick,s=e._modelMatrix??P.IDENTITY,a=e._uniformMap;for(let c=0;c<t;++c){let d=e._indexOffsets[c],u=e._indexCounts[c],m=l(e._boundingVolumes)?e._boundingVolumes[c]:e.boundingVolume,p=n[c*2];l(p)||(p=n[c*2]=new lt({owner:e,pickOnly:!0})),p.vertexArray=i,p.modelMatrix=s,p.offset=d,p.count=u,p.renderState=e._rsStencilDepthPass,p.shaderProgram=o,p.uniformMap=a,p.boundingVolume=m,p.pass=Le.TERRAIN_CLASSIFICATION;let b=lt.shallowClone(p,p.derivedCommands.tileset);b.renderState=e._rsStencilDepthPass3DTiles,b.pass=Le.CESIUM_3D_TILE_CLASSIFICATION,p.derivedCommands.tileset=b;let f=n[c*2+1];l(f)||(f=n[c*2+1]=new lt({owner:e,pickOnly:!0})),f.vertexArray=i,f.modelMatrix=s,f.offset=d,f.count=u,f.renderState=e._rsPickPass,f.shaderProgram=r,f.uniformMap=a,f.boundingVolume=m,f.pass=Le.TERRAIN_CLASSIFICATION;let y=lt.shallowClone(f,f.derivedCommands.tileset);y.pass=Le.CESIUM_3D_TILE_CLASSIFICATION,f.derivedCommands.tileset=y}e._pickCommandsDirty=!1}sg.prototype.createFeatures=function(e,t){let n=this._batchIds,i=n.length;for(let o=0;o<i;++o){let r=n[o];t[r]=new ia(e,r)}};sg.prototype.applyDebugSettings=function(e,t){this._highlightColor=e?t:this._constantColor};function tft(e,t){e._updatingAllCommands=!0;let n=e._batchIds,i=n.length,o;for(o=0;o<i;++o){let s=n[o],a=t[s];a.show=!0,a.color=U.WHITE}let r=e._batchedIndices;for(i=r.length,o=0;o<i;++o)r[o].color=U.clone(U.WHITE);e._updatingAllCommands=!1,e._batchDirty=!0}var nft=new U,ift=U.WHITE,oft=!0,rft=/\$/;sg.prototype.applyStyle=function(e,t){if(!l(e)){tft(this,t);return}let n=e.color,i=n instanceof $m&&!rft.test(n.expression);this._updatingAllCommands=i;let o=this._batchIds,r=o.length,s;for(s=0;s<r;++s){let a=o[s],c=t[a];c.color=l(e.color)?e.color.evaluateColor(c,nft):ift,c.show=l(e.show)?e.show.evaluate(c):oft}if(i){let a=this._batchedIndices;for(r=a.length,s=0;s<r;++s)a[s].color=U.clone(U.WHITE);this._updatingAllCommands=!1,this._batchDirty=!0}};sg.prototype.updateCommands=function(e,t){if(this._updatingAllCommands)return;let n=this._batchIdLookUp,i=n[e];if(!l(i))return;let o=this._indexOffsets,r=this._indexCounts,s=o[i],a=r[i],c=this._batchedIndices,d=c.length,u;for(u=0;u<d;++u){let y=c[u].offset,_=c[u].count;if(s>=y&&s<y+_)break}c.push(new n0({color:U.clone(t),offset:s,count:a,batchIds:[e]}));let m=[],p=[],b=c[u].batchIds,f=b.length;for(let y=0;y<f;++y){let _=b[y];if(_===e)continue;let S=n[_];o[S]<s?m.push(_):p.push(_)}p.length!==0&&c.push(new n0({color:U.clone(c[u].color),offset:s+a,count:c[u].offset+c[u].count-(s+a),batchIds:p})),m.length!==0?(c[u].count=s-c[u].offset,c[u].batchIds=m):c.splice(u,1),this._batchDirty=!0};function $Ze(e,t,n,i){let o=e.classificationType,r=o!==ti.CESIUM_3D_TILE,s=o!==ti.TERRAIN,a=t.commandList,c=n.length,d,u;for(u=0;u<c;++u)r&&(d=n[u],d.pass=Le.TERRAIN_CLASSIFICATION,a.push(d)),s&&(d=n[u].derivedCommands.tileset,d.pass=Le.CESIUM_3D_TILE_CLASSIFICATION,a.push(d));if(!(!t.invertClassification||!l(i)))for(c=i.length,u=0;u<c;++u)a.push(i[u])}function sft(e,t){let n=e.commandList,i=t.length;for(let o=0;o<i;o+=2){let r=t[o+1];r.pass=Le.OPAQUE,n.push(r)}}function aft(e){let t=e.debugWireframe===e._debugWireframe;if(t=t&&!(e.debugWireframe&&e._wireframeDirty),t)return;l(e._rsWireframe)||(e._rsWireframe=ze.fromCache({}));let n,i;e.debugWireframe?(n=e._rsWireframe,i=Ie.LINES):(n=e._rsColorPass,i=Ie.TRIANGLES);let o=e._commands,r=o.length;for(let s=0;s<r;s+=2){let a=o[s+1];a.renderState=n,a.primitiveType=i}e._debugWireframe=e.debugWireframe,e._wireframeDirty=!1}sg.prototype.update=function(e){let t=e.context;Uht(this,t),Dht(this,t),zht(this),Hht(this,t);let n=e.passes;n.render&&(qht(this,t),$ht(this,e),aft(this),this._debugWireframe?sft(e,this._commands):$Ze(this,e,this._commands,this._commandsIgnoreShow)),n.pick&&(eft(this),$Ze(this,e,this._pickCommands))};sg.prototype.isDestroyed=function(){return!1};sg.prototype.destroy=function(){return this._va=this._va&&this._va.destroy(),this._sp=this._sp&&this._sp.destroy(),this._spPick=this._spPick&&this._spPick.destroy(),this._vaSwap=this._vaSwap&&this._vaSwap.destroy(),ue(this)};var zS=sg;function zu(e){this._boxes=e.boxes,this._boxBatchIds=e.boxBatchIds,this._cylinders=e.cylinders,this._cylinderBatchIds=e.cylinderBatchIds,this._ellipsoids=e.ellipsoids,this._ellipsoidBatchIds=e.ellipsoidBatchIds,this._spheres=e.spheres,this._sphereBatchIds=e.sphereBatchIds,this._modelMatrix=e.modelMatrix,this._batchTable=e.batchTable,this._boundingVolume=e.boundingVolume,this._center=e.center,l(this._center)||(l(this._boundingVolume)?this._center=h.clone(this._boundingVolume.center):this._center=h.clone(h.ZERO)),this._boundingVolumes=void 0,this._batchedIndices=void 0,this._indices=void 0,this._indexOffsets=void 0,this._indexCounts=void 0,this._positions=void 0,this._vertexBatchIds=void 0,this._batchIds=void 0,this._batchTableColors=void 0,this._packedBuffer=void 0,this._ready=!1,this._promise=void 0,this._error=void 0,this._verticesPromise=void 0,this._primitive=void 0,this.debugWireframe=!1,this.forceRebatch=!1,this.classificationType=ti.BOTH}Object.defineProperties(zu.prototype,{trianglesLength:{get:function(){return l(this._primitive)?this._primitive.trianglesLength:0}},geometryByteLength:{get:function(){return l(this._primitive)?this._primitive.geometryByteLength:0}},ready:{get:function(){return this._ready}}});zu.packedBoxLength=P.packedLength+h.packedLength;zu.packedCylinderLength=P.packedLength+2;zu.packedEllipsoidLength=P.packedLength+h.packedLength;zu.packedSphereLength=h.packedLength+1;function cft(e){let t=new Float64Array(P.packedLength+h.packedLength),n=0;return h.pack(e._center,t,n),n+=h.packedLength,P.pack(e._modelMatrix,t,n),t}function lft(e,t){let n=0,i=t[n++],o=t[n++],r=e._boundingVolumes=new Array(o);for(let c=0;c<o;++c)r[c]=me.unpack(t,n),n+=me.packedLength;let s=t[n++],a=e._batchedIndices=new Array(s);for(let c=0;c<s;++c){let d=U.unpack(t,n);n+=U.packedLength;let u=t[n++],m=t[n++],p=t[n++],b=new Array(p);for(let f=0;f<p;++f)b[f]=t[n++];a[c]=new n0({color:d,offset:u,count:m,batchIds:b})}return i}var dft=new qn("createVectorTileGeometries",5),uft=new U;function mft(e){if(!l(e._primitive)&&!l(e._verticesPromise)){let t=e._boxes,n=e._boxBatchIds,i=e._cylinders,o=e._cylinderBatchIds,r=e._ellipsoids,s=e._ellipsoidBatchIds,a=e._spheres,c=e._sphereBatchIds,d=e._batchTableColors,u=e._packedBuffer;if(!l(d)){let f=0;l(e._boxes)&&(t=e._boxes=t.slice(),n=e._boxBatchIds=n.slice(),f+=n.length),l(e._cylinders)&&(i=e._cylinders=i.slice(),o=e._cylinderBatchIds=o.slice(),f+=o.length),l(e._ellipsoids)&&(r=e._ellipsoids=r.slice(),s=e._ellipsoidBatchIds=s.slice(),f+=s.length),l(e._spheres)&&(a=e._sphere=a.slice(),c=e._sphereBatchIds=c.slice(),f+=c.length),d=e._batchTableColors=new Uint32Array(f);let y=e._batchTable;for(let _=0;_<f;++_){let S=y.getColor(_,uft);d[_]=S.toRgba()}u=e._packedBuffer=cft(e)}let m=[];l(t)&&m.push(t.buffer,n.buffer),l(i)&&m.push(i.buffer,o.buffer),l(r)&&m.push(r.buffer,s.buffer),l(a)&&m.push(a.buffer,c.buffer),m.push(d.buffer,u.buffer);let p={boxes:l(t)?t.buffer:void 0,boxBatchIds:l(t)?n.buffer:void 0,cylinders:l(i)?i.buffer:void 0,cylinderBatchIds:l(i)?o.buffer:void 0,ellipsoids:l(r)?r.buffer:void 0,ellipsoidBatchIds:l(r)?s.buffer:void 0,spheres:l(a)?a.buffer:void 0,sphereBatchIds:l(a)?c.buffer:void 0,batchTableColors:d.buffer,packedBuffer:u.buffer},b=e._verticesPromise=dft.scheduleTask(p,m);return l(b)?b.then(function(f){if(e.isDestroyed())return;let y=new Float64Array(f.packedBuffer);lft(e,y)===2?e._indices=new Uint16Array(f.indices):e._indices=new Uint32Array(f.indices),e._indexOffsets=new Uint32Array(f.indexOffsets),e._indexCounts=new Uint32Array(f.indexCounts),e._positions=new Float32Array(f.positions),e._vertexBatchIds=new Uint16Array(f.vertexBatchIds),e._batchIds=new Uint16Array(f.batchIds),hft(e),e._ready=!0}).catch(f=>{e.isDestroyed()||(e._error=f)}):void 0}}function hft(e){l(e._primitive)||(e._primitive=new zS({batchTable:e._batchTable,positions:e._positions,batchIds:e._batchIds,vertexBatchIds:e._vertexBatchIds,indices:e._indices,indexOffsets:e._indexOffsets,indexCounts:e._indexCounts,batchedIndices:e._batchedIndices,boundingVolume:e._boundingVolume,boundingVolumes:e._boundingVolumes,center:e._center,pickObject:e._pickObject??e}),e._boxes=void 0,e._boxBatchIds=void 0,e._cylinders=void 0,e._cylinderBatchIds=void 0,e._ellipsoids=void 0,e._ellipsoidBatchIds=void 0,e._spheres=void 0,e._sphereBatchIds=void 0,e._center=void 0,e._modelMatrix=void 0,e._batchTable=void 0,e._boundingVolume=void 0,e._boundingVolumes=void 0,e._batchedIndices=void 0,e._indices=void 0,e._indexOffsets=void 0,e._indexCounts=void 0,e._positions=void 0,e._vertexBatchIds=void 0,e._batchIds=void 0,e._batchTableColors=void 0,e._packedBuffer=void 0,e._verticesPromise=void 0)}zu.prototype.createFeatures=function(e,t){this._primitive.createFeatures(e,t)};zu.prototype.applyDebugSettings=function(e,t){this._primitive.applyDebugSettings(e,t)};zu.prototype.applyStyle=function(e,t){this._primitive.applyStyle(e,t)};zu.prototype.updateCommands=function(e,t){this._primitive.updateCommands(e,t)};zu.prototype.update=function(e){if(!this._ready){if(l(this._promise)||(this._promise=mft(this)),l(this._error)){let t=this._error;throw this._error=void 0,t}return}this._primitive.debugWireframe=this.debugWireframe,this._primitive.forceRebatch=this.forceRebatch,this._primitive.classificationType=this.classificationType,this._primitive.update(e)};zu.prototype.isDestroyed=function(){return!1};zu.prototype.destroy=function(){return this._primitive=this._primitive&&this._primitive.destroy(),ue(this)};var ag=zu;var S$=class{constructor(t,n,i,o,r){this._tileset=t,this._tile=n,this._resource=i,this._geometries=void 0,this._metadata=void 0,this._batchTable=void 0,this._features=void 0,this.featurePropertiesDirty=!1,this._group=void 0,this._ready=!1,bft(this,o,r)}get featuresLength(){return l(this._batchTable)?this._batchTable.featuresLength:0}get pointsLength(){return 0}get trianglesLength(){return l(this._geometries)?this._geometries.trianglesLength:0}get geometryByteLength(){return l(this._geometries)?this._geometries.geometryByteLength:0}get texturesByteLength(){return 0}get batchTableByteLength(){return l(this._batchTable)?this._batchTable.batchTableByteLength:0}get innerContents(){}get ready(){return this._ready}get tileset(){return this._tileset}get tile(){return this._tile}get url(){return this._resource.getUrlComponent(!0)}get metadata(){return this._metadata}set metadata(t){this._metadata=t}get batchTable(){return this._batchTable}get group(){return this._group}set group(t){this._group=t}hasProperty(t,n){return this._batchTable.hasProperty(t,n)}getFeature(t){return eRe(this),this._features[t]}applyDebugSettings(t,n){l(this._geometries)&&this._geometries.applyDebugSettings(t,n)}applyStyle(t){eRe(this),l(this._geometries)&&this._geometries.applyStyle(t,this._features)}update(t,n){l(this._geometries)&&(this._geometries.classificationType=this._tileset.classificationType,this._geometries.debugWireframe=this._tileset.debugWireframe,this._geometries.update(n)),l(this._batchTable)&&this._geometries.ready&&(this._batchTable.update(t,n),this._ready=!0)}pick(t,n,i){}isDestroyed(){return!1}destroy(){return this._geometries=this._geometries&&this._geometries.destroy(),this._batchTable=this._batchTable&&this._batchTable.destroy(),ue(this)}};function fft(e){return function(t,n){l(e._geometries)&&e._geometries.updateCommands(t,n)}}function pft(e,t){let n,i,o,r,s,a=e.BOXES_LENGTH??0,c=e.CYLINDERS_LENGTH??0,d=e.ELLIPSOIDS_LENGTH??0,u=e.SPHERES_LENGTH??0;if(a>0&&l(e.BOX_BATCH_IDS)){let f=t.byteOffset+e.BOX_BATCH_IDS.byteOffset;n=new Uint16Array(t.buffer,f,a)}if(c>0&&l(e.CYLINDER_BATCH_IDS)){let f=t.byteOffset+e.CYLINDER_BATCH_IDS.byteOffset;i=new Uint16Array(t.buffer,f,c)}if(d>0&&l(e.ELLIPSOID_BATCH_IDS)){let f=t.byteOffset+e.ELLIPSOID_BATCH_IDS.byteOffset;o=new Uint16Array(t.buffer,f,d)}if(u>0&&l(e.SPHERE_BATCH_IDS)){let f=t.byteOffset+e.SPHERE_BATCH_IDS.byteOffset;r=new Uint16Array(t.buffer,f,u)}let m=l(n)||l(i)||l(o)||l(r),p=a>0&&!l(n)||c>0&&!l(i)||d>0&&!l(o)||u>0&&!l(r);if(m&&p)throw new ae("If one group of batch ids is defined, then all batch ids must be defined");if(!l(n)&&!l(i)&&!l(o)&&!l(r)){let f=0;if(!l(n)&&a>0)for(n=new Uint16Array(a),s=0;s<a;++s)n[s]=f++;if(!l(i)&&c>0)for(i=new Uint16Array(c),s=0;s<c;++s)i[s]=f++;if(!l(o)&&d>0)for(o=new Uint16Array(d),s=0;s<d;++s)o[s]=f++;if(!l(r)&&u>0)for(r=new Uint16Array(u),s=0;s<u;++s)r[s]=f++}return{boxes:n,cylinders:i,ellipsoids:o,spheres:r}}var HS=Uint32Array.BYTES_PER_ELEMENT;function bft(e,t,n){n=n??0;let i=new Uint8Array(t),o=new DataView(t);n+=HS;let r=o.getUint32(n,!0);if(r!==1)throw new ae(`Only Geometry tile version 1 is supported. Version ${r} is not.`);n+=HS;let s=o.getUint32(n,!0);if(n+=HS,s===0){e._ready=!0;return}let a=o.getUint32(n,!0);if(n+=HS,a===0)throw new ae("Feature table must have a byte length greater than zero");let c=o.getUint32(n,!0);n+=HS;let d=o.getUint32(n,!0);n+=HS;let u=o.getUint32(n,!0);n+=HS;let m=Pr(i,n,a);n+=a;let p=new Uint8Array(t,n,c);n+=c;let b,f;d>0&&(b=Pr(i,n,d),n+=d,u>0&&(f=new Uint8Array(t,n,u),f=new Uint8Array(f)));let y=m.BOXES_LENGTH??0,_=m.CYLINDERS_LENGTH??0,S=m.ELLIPSOIDS_LENGTH??0,Z=m.SPHERES_LENGTH??0,R=y+_+S+Z,C=new _f(e,R,b,f,fft(e));if(e._batchTable=C,R===0)return;let E=e.tile.computedTransform,A;l(m.RTC_CENTER)&&(A=h.unpack(m.RTC_CENTER),P.multiplyByPoint(E,A,A));let L=pft(m,p);if(y>0||_>0||S>0||Z>0){let F,I,N,g;if(y>0){let V=p.byteOffset+m.BOXES.byteOffset;F=new Float32Array(p.buffer,V,ag.packedBoxLength*y)}if(_>0){let V=p.byteOffset+m.CYLINDERS.byteOffset;I=new Float32Array(p.buffer,V,ag.packedCylinderLength*_)}if(S>0){let V=p.byteOffset+m.ELLIPSOIDS.byteOffset;N=new Float32Array(p.buffer,V,ag.packedEllipsoidLength*S)}if(Z>0){let V=p.byteOffset+m.SPHERES.byteOffset;g=new Float32Array(p.buffer,V,ag.packedSphereLength*Z)}return e._geometries=new ag({boxes:F,boxBatchIds:L.boxes,cylinders:I,cylinderBatchIds:L.cylinders,ellipsoids:N,ellipsoidBatchIds:L.ellipsoids,spheres:g,sphereBatchIds:L.spheres,center:A,modelMatrix:E,batchTable:C,boundingVolume:e.tile.boundingVolume.boundingVolume}),e}return Promise.resolve(e)}function eRe(e){let t=e.featuresLength;if(!l(e._features)&&t>0){let n=new Array(t);l(e._geometries)&&e._geometries.createFeatures(e,n),e._features=n}}var oY=S$;var tGi=x(T(),1);var eAi=x(T(),1);var Z$={};Z$.encode2D=function(e,t,n){let i=Math.pow(2,e),o={x:t,y:n},r,s,a,c=BigInt(0);for(a=i/2;a>0;a/=2)r=(o.x&a)>0?1:0,s=(o.y&a)>0?1:0,c+=BigInt((3*r^s)*a*a),tRe(i,o,r,s);return c};Z$.decode2D=function(e,t){let n=Math.pow(2,e),i={x:0,y:0},o,r,s,a;for(s=1,a=t;s<n;s*=2)o=1&Number(a/BigInt(2)),r=1&Number(a^BigInt(o)),tRe(s,i,o,r),i.x+=s*o,i.y+=s*r,a/=BigInt(4);return[i.x,i.y]};function tRe(e,t,n,i){if(i!==0)return;n===1&&(t.x=e-1-t.x,t.y=e-1-t.y);let o=t.x;t.x=t.y,t.y=o}var EV=Z$;var aAi=x(T(),1);var KS=30,gft=1<<KS,yft=1<<KS+1>>>0,R$=2*KS+1,Wx=4,oRe=[],rRe=[],xft=[[0,1,3,2],[0,2,3,1],[3,2,0,1],[3,1,0,2]],vx=1,AV=2,a3=[vx,0,0,vx|AV];function Ds(e){if(!fn.supportsBigInt())throw new ae("S2 required BigInt support");this._cellId=e,this._level=Ds.getLevel(e)}Ds.fromToken=function(e){return new Ds(Ds.getIdFromToken(e))};Ds.isValidId=function(e){return!(e<=0||e>>BigInt(R$)>5||!(e&~e+BigInt(1)&BigInt("0x1555555555555555")))};Ds.isValidToken=function(e){return/^[0-9a-fA-F]{1,16}$/.test(e)?Ds.isValidId(Ds.getIdFromToken(e)):!1};Ds.getIdFromToken=function(e){return BigInt("0x"+e+"0".repeat(16-e.length))};Ds.getTokenFromId=function(e){let t=Math.floor(Gft(e)/4),n=e.toString(16).replace(/0*$/,"");return Array(17-t-n.length).join("0")+n};Ds.getLevel=function(e){let t=0;for(;e!==BigInt(0)&&!(e&BigInt(1));)t++,e=e>>BigInt(1);return KS-(t>>1)};Ds.prototype.getChild=function(e){let t=cRe(this._cellId)>>BigInt(2),n=this._cellId+BigInt(2*e+1-4)*t;return new Ds(n)};Ds.prototype.getParent=function(){let e=cRe(this._cellId)<<BigInt(2);return new Ds(this._cellId&~e+BigInt(1)|e)};Ds.prototype.getParentAtLevel=function(e){let t=Eft(e);return new Ds(this._cellId&-t|t)};Ds.prototype.getCenter=function(e){e=e??ne.WGS84;let t=Tft(this._cellId,this._level);t=h.normalize(t,t);let n=pe.fromCartesian(t,ne.UNIT_SPHERE);return pe.toCartesian(n,e,new h)};Ds.prototype.getVertex=function(e,t){t=t??ne.WGS84;let n=_ft(this._cellId,this._level,e);n=h.normalize(n,n);let i=pe.fromCartesian(n,ne.UNIT_SPHERE);return pe.toCartesian(i,t,new h)};Ds.fromFacePositionLevel=function(e,t,n){let i=(e<4?"0":"")+(e<2?"0":"")+e.toString(2),o=t.toString(2),r=Array(2*n-o.length+1).join("0"),s=Array(R$-2*n).join("0"),a=BigInt(`0b${i}${r}${o}1${s}`);return new Ds(a)};function Tft(e,t){let n=Sft(e,t);return Zft(n[0],n[1],n[2])}function _ft(e,t,n){let i=sRe(e,t),o=Rft([i[1],i[2]],t),r=n>>1&1;return aRe(i[0],o[0][r^n&1],o[1][r])}function Sft(e,t){let n=sRe(e),i=n[0],o=n[1],r=n[2],s=t===30,a=!s&&(BigInt(o)^e>>BigInt(2))&BigInt(1),c=s?1:a?2:0,d=(o<<1)+c,u=(r<<1)+c;return[i,d,u]}function sRe(e){oRe.length===0&&Vft();let t=Number(e>>BigInt(R$)),n=t&vx,i=(1<<Wx)-1,o=0,r=0;for(let s=7;s>=0;s--){let c=(1<<2*(s===7?KS-7*Wx:Wx))-1;n+=Number(e>>BigInt(s*2*Wx+1)&BigInt(c))<<2,n=rRe[n];let d=s*Wx;o+=n>>Wx+2<<d,r+=(n>>2&i)<<d,n&=vx|AV}return[t,o,r]}function Zft(e,t,n){let i=nRe(t),o=nRe(n),r=c3(i),s=c3(o);return aRe(e,r,s)}function aRe(e,t,n){switch(e){case 0:return new h(1,t,n);case 1:return new h(-t,1,n);case 2:return new h(-t,-n,1);case 3:return new h(-1,-n,-t);case 4:return new h(n,-1,-t);default:return new h(n,t,-1)}}function c3(e){return e>=.5?1/3*(4*e*e-1):1/3*(1-4*(1-e)*(1-e))}function nRe(e){return 1/yft*e}function Rft(e,t){let n=[[],[]],i=Cft(t);for(let o=0;o<2;++o){let r=e[o]&-i,s=r+i;n[o][0]=c3(iRe(r)),n[o][1]=c3(iRe(s))}return n}function Cft(e){return 1<<KS-e>>>0}function iRe(e){return 1/gft*e}function Fx(e,t,n,i,o,r){if(e===Wx){let s=(t<<Wx)+n;oRe[(s<<2)+i]=(o<<2)+r,rRe[(o<<2)+i]=(s<<2)+r}else{e++,t<<=1,n<<=1,o<<=2;let s=xft[r];Fx(e,t+(s[0]>>1),n+(s[0]&1),i,o,r^a3[0]),Fx(e,t+(s[1]>>1),n+(s[1]&1),i,o+1,r^a3[1]),Fx(e,t+(s[2]>>1),n+(s[2]&1),i,o+2,r^a3[2]),Fx(e,t+(s[3]>>1),n+(s[3]&1),i,o+3,r^a3[3])}}function Vft(){Fx(0,0,0,0,0,0),Fx(0,0,0,vx,0,vx),Fx(0,0,0,AV,0,AV),Fx(0,0,0,vx|AV,0,vx|AV)}function cRe(e){return e&~e+BigInt(1)}function Eft(e){return BigInt(1)<<BigInt(2*(KS-e))}var Aft=[64,0,1,39,2,15,40,23,3,12,16,59,41,19,24,54,4,64,13,10,17,62,60,28,42,30,20,51,25,44,55,47,5,32,65,38,14,22,11,58,18,53,63,9,61,27,29,50,43,46,31,37,21,57,52,8,26,49,45,36,56,7,48,35,6,34,33,0];function Gft(e){return Aft[(-e&e)%BigInt(67)]}var cg=Ds;var IAi=x(T(),1);var uAi=x(T(),1);function C$(e){let t=e.lengthBits,n=e.availableCount,i=e.constant,o=e.bitstream;if(l(i))n=t;else{let r=Math.ceil(t/8);if(o.length!==r)throw new ae(`Availability bitstream must be exactly ${r} bytes long to store ${t} bits. Actual bitstream was ${o.length} bytes long.`);let s=e.computeAvailableCountEnabled??!1;!l(n)&&s&&(n=Lft(o,t))}this._lengthBits=t,this._availableCount=n,this._constant=i,this._bitstream=o}function Lft(e,t){let n=0;for(let i=0;i<t;i++){let o=i>>3,r=i%8;n+=e[o]>>r&1}return n}Object.defineProperties(C$.prototype,{lengthBits:{get:function(){return this._lengthBits}},availableCount:{get:function(){return this._availableCount}}});C$.prototype.getBit=function(e){if(l(this._constant))return this._constant;let t=e>>3,n=e%8;return(this._bitstream[t]>>n&1)===1};var GV=C$;var fAi=x(T(),1);function lg(e){e=e??B.EMPTY_OBJECT;let t=e.metadataTable,n=e.class,i=e.entityId,o=e.propertyTableJson;this._class=n,this._metadataTable=t,this._entityId=i,this._extensions=o.extensions,this._extras=o.extras}Object.defineProperties(lg.prototype,{class:{get:function(){return this._class}},extras:{get:function(){return this._extras}},extensions:{get:function(){return this._extensions}}});lg.prototype.hasProperty=function(e){return this._metadataTable.hasProperty(e)};lg.prototype.hasPropertyBySemantic=function(e){return this._metadataTable.hasPropertyBySemantic(e)};lg.prototype.getPropertyIds=function(e){return this._metadataTable.getPropertyIds(e)};lg.prototype.getProperty=function(e){return this._metadataTable.getProperty(this._entityId,e)};lg.prototype.setProperty=function(e,t){return this._metadataTable.setProperty(this._entityId,e,t)};lg.prototype.getPropertyBySemantic=function(e){return this._metadataTable.getPropertyBySemantic(this._entityId,e)};lg.prototype.setPropertyBySemantic=function(e,t){return this._metadataTable.setPropertyBySemantic(this._entityId,e,t)};var LV=lg;var bAi=x(T(),1);var rY={QUADTREE:"QUADTREE",OCTREE:"OCTREE"};rY.getBranchingFactor=function(e){switch(e){case rY.OCTREE:return 8;case rY.QUADTREE:return 4}};Object.freeze(rY);var Os=rY;var _Ai=x(T(),1);function dg(e){e=e??B.EMPTY_OBJECT;let t=e.subtreeMetadata,n=e.class,i=l(t.properties)?t.properties:{};this._class=n,this._properties=i,this._extras=t.extras,this._extensions=t.extensions}Object.defineProperties(dg.prototype,{class:{get:function(){return this._class}},extras:{get:function(){return this._extras}},extensions:{get:function(){return this._extensions}}});dg.prototype.hasProperty=function(e){return Jn.hasProperty(e,this._properties,this._class)};dg.prototype.hasPropertyBySemantic=function(e){return Jn.hasPropertyBySemantic(e,this._properties,this._class)};dg.prototype.getPropertyIds=function(e){return Jn.getPropertyIds(this._properties,this._class,e)};dg.prototype.getProperty=function(e){return Jn.getProperty(e,this._properties,this._class)};dg.prototype.setProperty=function(e,t){return Jn.setProperty(e,t,this._properties,this._class)};dg.prototype.getPropertyBySemantic=function(e){return Jn.getPropertyBySemantic(e,this._properties,this._class)};dg.prototype.setPropertyBySemantic=function(e,t){return Jn.setPropertyBySemantic(e,t,this._properties,this._class)};var sY=dg;function mc(e,t,n){this._resource=e,this._subtreeJson=void 0,this._bufferLoader=void 0,this._tileAvailability=void 0,this._contentAvailabilityBitstreams=[],this._childSubtreeAvailability=void 0,this._implicitCoordinates=n,this._subtreeLevels=t.subtreeLevels,this._subdivisionScheme=t.subdivisionScheme,this._branchingFactor=t.branchingFactor,this._metadata=void 0,this._tileMetadataTable=void 0,this._tilePropertyTableJson=void 0,this._contentMetadataTables=[],this._contentPropertyTableJsons=[],this._tileJumpBuffer=void 0,this._contentJumpBuffers=[],this._ready=!1}Object.defineProperties(mc.prototype,{ready:{get:function(){return this._ready}},metadata:{get:function(){return this._metadata}},tileMetadataTable:{get:function(){return this._tileMetadataTable}},tilePropertyTableJson:{get:function(){return this._tilePropertyTableJson}},contentMetadataTables:{get:function(){return this._contentMetadataTables}},contentPropertyTableJsons:{get:function(){return this._contentPropertyTableJsons}},implicitCoordinates:{get:function(){return this._implicitCoordinates}}});mc.prototype.tileIsAvailableAtIndex=function(e){return this._tileAvailability.getBit(e)};mc.prototype.tileIsAvailableAtCoordinates=function(e){let t=this.getTileIndex(e);return this.tileIsAvailableAtIndex(t)};mc.prototype.contentIsAvailableAtIndex=function(e,t){return t=t??0,this._contentAvailabilityBitstreams[t].getBit(e)};mc.prototype.contentIsAvailableAtCoordinates=function(e,t){let n=this.getTileIndex(e);return this.contentIsAvailableAtIndex(n,t)};mc.prototype.childSubtreeIsAvailableAtIndex=function(e){return this._childSubtreeAvailability.getBit(e)};mc.prototype.childSubtreeIsAvailableAtCoordinates=function(e){let t=this.getChildSubtreeIndex(e);return this.childSubtreeIsAvailableAtIndex(t)};mc.prototype.getLevelOffset=function(e){let t=this._branchingFactor;return(Math.pow(t,e)-1)/(t-1)};mc.prototype.getParentMortonIndex=function(e){let t=2;return this._subdivisionScheme===Os.OCTREE&&(t=3),e>>t};mc.fromSubtreeJson=async function(e,t,n,i,o){let r=new mc(e,i,o),s;l(t)?s={json:t,binary:void 0}:s=Wft(n);let a=s.json;r._subtreeJson=a;let c;if(ro(a,"3DTILES_metadata"))c=a.extensions["3DTILES_metadata"];else if(l(a.tileMetadata)){let Z=a.tileMetadata;c=a.propertyTables[Z]}let d=[];if(l(a.contentMetadata)){let Z=a.contentMetadata.length;for(let R=0;R<Z;R++){let C=a.contentMetadata[R];d.push(a.propertyTables[C])}}let u,m=i.metadataSchema,p=a.subtreeMetadata;if(l(p)){let Z=p.class,R=m.classes[Z];u=new sY({subtreeMetadata:p,class:R})}r._metadata=u,r._tilePropertyTableJson=c,r._contentPropertyTableJsons=d;let b={constant:0};a.contentAvailabilityHeaders=[],ro(a,"3DTILES_multiple_contents")?a.contentAvailabilityHeaders=a.extensions["3DTILES_multiple_contents"].contentAvailability:Array.isArray(a.contentAvailability)?a.contentAvailabilityHeaders=a.contentAvailability:a.contentAvailabilityHeaders.push(a.contentAvailability??b);let f=vft(a.buffers),y=Fft(a.bufferViews,f);Ift(a,y),l(c)&&lRe(c,y);for(let Z=0;Z<d.length;Z++){let R=d[Z];lRe(R,y)}let _=await Pft(r,f,s.binary),S=Nft(y,_);return Yft(r,a,i,S),l(c)&&(Mft(r,i,S),kft(r)),wft(r,i,S),Uft(r),r._ready=!0,r};function Wft(e){let n=new DataView(e.buffer,e.byteOffset),i=8,o=n.getUint32(i,!0);i+=8;let r=n.getUint32(i,!0);i+=8;let s=Pr(e,i,o);i+=o;let a=e.subarray(i,i+r);return{json:s,binary:a}}function vft(e){e=l(e)?e:[];for(let t=0;t<e.length;t++){let n=e[t];n.isExternal=l(n.uri),n.isActive=!1}return e}function Fft(e,t){e=l(e)?e:[];for(let n=0;n<e.length;n++){let i=e[n],o=t[i.buffer];i.bufferHeader=o,i.isActive=!1}return e}function Ift(e,t){let n,i=e.tileAvailability;l(i.bitstream)?n=t[i.bitstream]:l(i.bufferView)&&(n=t[i.bufferView]),l(n)&&(n.isActive=!0,n.bufferHeader.isActive=!0);let o=e.contentAvailabilityHeaders;for(let s=0;s<o.length;s++)n=void 0,l(o[s].bitstream)?n=t[o[s].bitstream]:l(o[s].bufferView)&&(n=t[o[s].bufferView]),l(n)&&(n.isActive=!0,n.bufferHeader.isActive=!0);n=void 0;let r=e.childSubtreeAvailability;l(r.bitstream)?n=t[r.bitstream]:l(r.bufferView)&&(n=t[r.bufferView]),l(n)&&(n.isActive=!0,n.bufferHeader.isActive=!0)}function lRe(e,t){let n=e.properties,i;for(let o in n)if(n.hasOwnProperty(o)){let r=n[o],s=r.values??r.bufferView;i=t[s],i.isActive=!0,i.bufferHeader.isActive=!0;let a=r.stringOffsets??r.stringOffsetBufferView;l(a)&&(i=t[a],i.isActive=!0,i.bufferHeader.isActive=!0);let c=r.arrayOffsets??r.arrayOffsetBufferView;l(c)&&(i=t[c],i.isActive=!0,i.bufferHeader.isActive=!0)}}function Pft(e,t,n){let i=[];for(let o=0;o<t.length;o++){let r=t[o];if(!r.isActive)i.push(Promise.resolve(void 0));else if(r.isExternal){let s=Xft(e,r);i.push(s)}else i.push(Promise.resolve(n))}return Promise.all(i).then(function(o){let r={};for(let s=0;s<o.length;s++){let a=o[s];l(a)&&(r[s]=a)}return r})}async function Xft(e,t){let i=e._resource.getDerivedResource({url:t.uri}),o=Yi.getExternalBufferLoader({resource:i});e._bufferLoader=o;try{await o.load()}catch(r){if(o.isDestroyed())return;throw r}return o.typedArray}function Nft(e,t){let n={};for(let i=0;i<e.length;i++){let o=e[i];if(!o.isActive)continue;let r=o.byteOffset,s=r+o.byteLength,c=t[o.buffer].subarray(r,s);n[i]=c}return n}function Yft(e,t,n,i){let o=n.branchingFactor,r=n.subtreeLevels,s=(Math.pow(o,r)-1)/(o-1),a=Math.pow(o,r),c=ro(t,"3DTILES_metadata"),d=l(e._tilePropertyTableJson),u=c||d;e._tileAvailability=V$(t.tileAvailability,i,s,u);let m=e._contentPropertyTableJsons.length>0;u=u||m;for(let p=0;p<t.contentAvailabilityHeaders.length;p++){let b=V$(t.contentAvailabilityHeaders[p],i,s,u);e._contentAvailabilityBitstreams.push(b)}e._childSubtreeAvailability=V$(t.childSubtreeAvailability,i,a)}function V$(e,t,n,i){if(l(e.constant))return new GV({constant:!!e.constant,lengthBits:n,availableCount:e.availableCount});let o;return l(e.bitstream)?o=t[e.bitstream]:l(e.bufferView)&&(o=t[e.bufferView]),new GV({bitstream:o,lengthBits:n,availableCount:e.availableCount,computeAvailableCountEnabled:i})}function Mft(e,t,n){let i=e._tilePropertyTableJson,o=e._tileAvailability.availableCount,r=t.metadataSchema,s=i.class,a=r.classes[s];e._tileMetadataTable=new zm({class:a,count:o,properties:i.properties,bufferViews:n})}function wft(e,t,n){let i=e._contentPropertyTableJsons,o=e._contentAvailabilityBitstreams,r=t.metadataSchema,s=e._contentMetadataTables;for(let a=0;a<i.length;a++){let c=i[a],u=o[a].availableCount,m=c.class,p=r.classes[m],b=new zm({class:p,count:u,properties:c.properties,bufferViews:n});s.push(b)}}function dRe(e){let t=0,n=e.lengthBits,i=e.availableCount,o;i<256?o=new Uint8Array(n):i<65536?o=new Uint16Array(n):o=new Uint32Array(n);for(let r=0;r<e.lengthBits;r++)e.getBit(r)&&(o[r]=t,t++);return o}function kft(e){let t=dRe(e._tileAvailability);e._tileJumpBuffer=t}function Uft(e){let t=e._contentJumpBuffers,n=e._contentAvailabilityBitstreams;for(let i=0;i<n.length;i++){let o=n[i],r=dRe(o);t.push(r)}}mc.prototype.getTileIndex=function(e){let t=e.level-this._implicitCoordinates.level;if(t<0||this._subtreeLevels<=t)throw new ae("level is out of bounds for this subtree");return e.getSubtreeCoordinates().getOffsetCoordinates(e).tileIndex};mc.prototype.getChildSubtreeIndex=function(e){if(e.level-this._implicitCoordinates.level!==this._implicitCoordinates.subtreeLevels)throw new ae("level is out of bounds for this subtree");return e.getParentSubtreeCoordinates().getOffsetCoordinates(e).mortonIndex};function Dft(e,t){if(!l(e._tileMetadataTable))return;let n=e.getTileIndex(t);if(e._tileAvailability.getBit(n))return e._tileJumpBuffer[n]}function Oft(e,t,n){let i=e._contentMetadataTables;if(!l(i))return;let o=i[n];if(!l(o))return;let r=e._contentAvailabilityBitstreams[n],s=e.getTileIndex(t);if(r.getBit(s))return e._contentJumpBuffers[n][s]}mc.prototype.getTileMetadataView=function(e){let t=Dft(this,e);if(!l(t))return;let n=this._tileMetadataTable;return new LV({class:n.class,metadataTable:n,entityId:t,propertyTableJson:this._tilePropertyTableJson})};mc.prototype.getContentMetadataView=function(e,t){let n=Oft(this,e,t);if(!l(n))return;let i=this._contentMetadataTables[t],o=this._contentPropertyTableJsons[t];return new LV({class:i.class,metadataTable:i,entityId:n,contentIndex:t,propertyTableJson:o})};mc.prototype.isDestroyed=function(){return!1};mc.prototype.destroy=function(){return l(this._bufferLoader)&&Yi.unload(this._bufferLoader),ue(this)};var ug=mc;var XAi=x(T(),1),uRe={ID:"ID",NAME:"NAME",DESCRIPTION:"DESCRIPTION",TILESET_TILE_COUNT:"TILESET_TILE_COUNT",TILE_BOUNDING_BOX:"TILE_BOUNDING_BOX",TILE_BOUNDING_REGION:"TILE_BOUNDING_REGION",TILE_BOUNDING_SPHERE:"TILE_BOUNDING_SPHERE",TILE_MINIMUM_HEIGHT:"TILE_MINIMUM_HEIGHT",TILE_MAXIMUM_HEIGHT:"TILE_MAXIMUM_HEIGHT",TILE_HORIZON_OCCLUSION_POINT:"TILE_HORIZON_OCCLUSION_POINT",TILE_GEOMETRIC_ERROR:"TILE_GEOMETRIC_ERROR",CONTENT_BOUNDING_BOX:"CONTENT_BOUNDING_BOX",CONTENT_BOUNDING_REGION:"CONTENT_BOUNDING_REGION",CONTENT_BOUNDING_SPHERE:"CONTENT_BOUNDING_SPHERE",CONTENT_MINIMUM_HEIGHT:"CONTENT_MINIMUM_HEIGHT",CONTENT_MAXIMUM_HEIGHT:"CONTENT_MAXIMUM_HEIGHT",CONTENT_HORIZON_OCCLUSION_POINT:"CONTENT_HORIZON_OCCLUSION_POINT"};Object.freeze(uRe);var eh=uRe;var MAi=x(T(),1);var Ix={};Ix.parseAllBoundingVolumeSemantics=function(e,t){return{boundingVolume:Ix.parseBoundingVolumeSemantic(e,t),minimumHeight:Ix._parseMinimumHeight(e,t),maximumHeight:Ix._parseMaximumHeight(e,t)}};Ix.parseBoundingVolumeSemantic=function(e,t){let n=`${e}_BOUNDING_BOX`,i=t.getPropertyBySemantic(n);if(l(i))return{box:i};let o=`${e}_BOUNDING_REGION`,r=t.getPropertyBySemantic(o);if(l(r))return{region:r};let s=`${e}_BOUNDING_SPHERE`,a=t.getPropertyBySemantic(s);if(l(a))return{sphere:a}};Ix._parseMinimumHeight=function(e,t){let n=`${e}_MINIMUM_HEIGHT`;return t.getPropertyBySemantic(n)};Ix._parseMaximumHeight=function(e,t){let n=`${e}_MAXIMUM_HEIGHT`;return t.getPropertyBySemantic(n)};var Px=Ix;var WV=class e{constructor(t,n,i){let o=n.implicitTileset,r=n.implicitCoordinates;this._implicitTileset=o,this._implicitCoordinates=r,this._implicitSubtree=void 0,this._tileset=t,this._tile=n,this._resource=i,this._metadata=void 0,this.featurePropertiesDirty=!1,this._group=void 0;let s=r.getTemplateValues(),a=o.subtreeUriTemplate.getDerivedResource({templateValues:s});this._url=a.getUrlComponent(!0),this._ready=!1}get featuresLength(){return 0}get pointsLength(){return 0}get trianglesLength(){return 0}get geometryByteLength(){return 0}get texturesByteLength(){return 0}get batchTableByteLength(){return 0}get innerContents(){}get ready(){return this._ready}get tileset(){return this._tileset}get tile(){return this._tile}get url(){return this._url}get metadata(){}set metadata(t){}get batchTable(){}get group(){return this._group}set group(t){this._group=t}static async fromSubtreeJson(t,n,i,o,r,s){s=s??0;let a;l(r)&&(a=new Uint8Array(r,s));let c=n.implicitTileset,d=n.implicitCoordinates,u=await ug.fromSubtreeJson(i,o,a,c,d),m=new e(t,n,i);return m._implicitSubtree=u,Bft(m,u),m._ready=!0,m}hasProperty(t,n){return!1}getFeature(t){}applyDebugSettings(t,n){}applyStyle(t){}update(t,n){}pick(t,n,i){}isDestroyed(){return!1}destroy(){return this._implicitSubtree=this._implicitSubtree&&this._implicitSubtree.destroy(),ue(this)}};function Bft(e,t){let n=e._tile,i=e._implicitCoordinates.childIndex,o=Hft(e,t,n,i),r=e._tileset.statistics;n.children.push(o.rootTile),r.numberOfTilesTotal++;let s=zft(e,t,o.bottomRow);for(let a=0;a<s.length;a++){let c=s[a],d=c.tile,u=npt(e,d,c.childIndex);d.children.push(u),r.numberOfTilesTotal++}}function zft(e,t,n){let i=[],o=e._implicitTileset.branchingFactor;for(let r=0;r<n.length;r++){let s=n[r];if(l(s))for(let a=0;a<o;a++){let c=r*o+a;t.childSubtreeIsAvailableAtIndex(c)&&i.push({tile:s,childIndex:a})}}return i}function Hft(e,t,n,i){let s=mRe(e,t,n,i,0,!0),a=e._tileset.statistics,c=[s],d=[],u=e._implicitTileset;for(let m=1;m<u.subtreeLevels;m++){let p=t.getLevelOffset(m),b=u.branchingFactor*c.length;for(let f=0;f<b;f++){let y=p+f;if(!t.tileIsAvailableAtIndex(y)){d.push(void 0);continue}let _=t.getParentMortonIndex(f),S=c[_],Z=f%u.branchingFactor,R=mRe(e,t,S,Z,y);S.children.push(R),a.numberOfTilesTotal++,d.push(R)}c=d,d=[]}return{rootTile:s,bottomRow:c}}function hRe(e,t,n){let i=eh.TILE_GEOMETRIC_ERROR;return l(e)&&e.hasPropertyBySemantic(i)?e.getPropertyBySemantic(i):t.geometricError/Math.pow(2,n.level)}function mRe(e,t,n,i,o,r){let s=e._implicitTileset,a;r??!1?a=n.implicitCoordinates:a=n.implicitCoordinates.getChildCoordinates(i);let c,d;l(t.tilePropertyTableJson)&&(c=t.getTileMetadataView(a),d=Px.parseAllBoundingVolumeSemantics("TILE",c));let m=t.contentPropertyTableJsons.length,p=!1;for(let E=0;E<m;E++)if(t.contentIsAvailableAtCoordinates(a,E)){p=!0;break}let b=jft(s,a,i,r,n,d),f=[];for(let E=0;E<s.contentCount;E++){if(!t.contentIsAvailableAtIndex(o,E))continue;let F={uri:s.contentUriTemplates[E].getDerivedResource({templateValues:a.getTemplateValues()}).url},I;if(t.contentPropertyTableJsons.length>0){let g=t.getContentMetadataView(a,E);I=Px.parseAllBoundingVolumeSemantics("CONTENT",g)}let N=Qft(b,I);l(N)&&(F.boundingVolume=N),f.push(It(F,s.contentHeaders[E]))}let y=hRe(c,s,a),_={boundingVolume:b,geometricError:y,refine:s.refine,contents:f},S=!0,Z=$e(s.tileHeader,S);delete Z.boundingVolume,delete Z.transform,delete Z.metadata;let R=It(_,Z,S),C=yRe(e,s.baseResource,R,n);return C.implicitCoordinates=a,C.implicitSubtree=t,C.metadata=c,C.hasImplicitContentMetadata=p,C}function l3(e,t){return l(e)&&l(t)&&(l(t.minimumHeight)||l(t.maximumHeight))&&(ro(e,"3DTILES_bounding_volume_S2")||l(e.region))}function A$(e,t){l(t)&&(ro(e,"3DTILES_bounding_volume_S2")?Jft(e.extensions["3DTILES_bounding_volume_S2"],t.minimumHeight,t.maximumHeight):l(e.region)&&Kft(e.region,t.minimumHeight,t.maximumHeight))}function Kft(e,t,n){l(t)&&(e[4]=t),l(n)&&(e[5]=n)}function Jft(e,t,n){l(t)&&(e.minimumHeight=t),l(n)&&(e.maximumHeight=n)}function jft(e,t,n,i,o,r){let s;return!l(r)||!l(r.boundingVolume)||!l3(r.boundingVolume,r)&&l3(e.boundingVolume,r)?s=fRe(e,t,n,i??!1,o):s=r.boundingVolume,A$(s,r),s}function Qft(e,t){let n;return l(t)&&(n=t.boundingVolume),l3(n,t)?A$(n,t):l3(e,t)&&(n=$e(e,!0),A$(n,t)),n}function fRe(e,t,n,i,o){let r=e.boundingVolume;return ro(r,"3DTILES_bounding_volume_S2")?pRe(i,o,n,t.level,t.x,t.y,t.z):l(r.region)?{region:gRe(r.region,t.level,t.x,t.y,t.z)}:{box:bRe(r.box,t.level,t.x,t.y,t.z)}}function pRe(e,t,n,i,o,r,s){let a=t._boundingVolume;if(e)return{extensions:{"3DTILES_bounding_volume_S2":{token:cg.getTokenFromId(a.s2Cell._cellId),minimumHeight:a.minimumHeight,maximumHeight:a.maximumHeight}}};let c=Number(t._boundingVolume.s2Cell._cellId>>BigInt(61)),d=c%2===0?EV.encode2D(i,o,r):EV.encode2D(i,r,o),u=cg.fromFacePositionLevel(c,BigInt(d),i),m,p;if(l(s)){let b=(a.maximumHeight+a.minimumHeight)/2;m=n<4?a.minimumHeight:b,p=n<4?b:a.maximumHeight}else m=a.minimumHeight,p=a.maximumHeight;return{extensions:{"3DTILES_bounding_volume_S2":{token:cg.getTokenFromId(u._cellId),minimumHeight:m,maximumHeight:p}}}}var qft=new h,$ft=new h,E$=new h,ept=new q;function bRe(e,t,n,i,o){if(t===0)return e;let r=h.unpack(e,0,$ft),s=q.unpack(e,3,ept),a=Math.pow(2,-t),c=-1+(2*n+1)*a,d=-1+(2*i+1)*a,u=0,m=h.fromElements(a,a,1,qft);l(o)&&(u=-1+(2*o+1)*a,m.z=a);let p=h.fromElements(c,d,u,E$);p=q.multiplyByVector(s,p,E$),p=h.add(p,r,E$);let b=q.clone(s);b=q.multiplyByScale(b,m,b);let f=new Array(12);return h.pack(p,f),q.pack(b,f,3),f}var tpt=new re;function gRe(e,t,n,i,o){if(t===0)return e.slice();let r=re.unpack(e,0,tpt),s=e[4],a=e[5],c=Math.pow(2,-t),d=c*r.width,u=W.negativePiToPi(r.west+n*d),m=W.negativePiToPi(u+d),p=c*r.height,b=W.negativePiToPi(r.south+i*p),f=W.negativePiToPi(b+p),y=s,_=a;if(l(o)){let S=c*(a-s);y+=o*S,_=y+S}return[u,b,m,f,y,_]}function npt(e,t,n){let i=e._implicitTileset,o=t.implicitCoordinates.getChildCoordinates(n),r=fRe(i,o,n,!1,t),s=hRe(void 0,i,o),a=i.subtreeUriTemplate.getDerivedResource({templateValues:o.getTemplateValues()}).url,c={boundingVolume:r,geometricError:s,refine:i.refine,contents:[{uri:a}]},d=yRe(e,i.baseResource,c,t);return d.implicitTileset=i,d.implicitCoordinates=o,d}function yRe(e,t,n,i){let o=e._tile.constructor;return new o(e._tileset,t,n,i)}WV._deriveBoundingBox=bRe;WV._deriveBoundingRegion=gRe;WV._deriveBoundingVolumeS2=pRe;var vV=WV;var uGi=x(T(),1);var G$=class e{constructor(t,n,i){this._tileset=t,this._tile=n,this._resource=i,this._model=void 0,this._metadata=void 0,this._group=void 0,this._ready=!1}get featuresLength(){let t=this._model,n=t.featureTables,i=t.featureTableId;return l(n)&&l(n[i])?n[i].featuresLength:0}get pointsLength(){return this._model.statistics.pointsLength}get trianglesLength(){return this._model.statistics.trianglesLength}get geometryByteLength(){return this._model.statistics.geometryByteLength}get texturesByteLength(){return this._model.statistics.texturesByteLength}get batchTableByteLength(){let t=this._model.statistics;return t.propertyTablesByteLength+t.batchTexturesByteLength}get innerContents(){}get ready(){return this._ready}get tileset(){return this._tileset}get tile(){return this._tile}get url(){return this._resource.getUrlComponent(!0)}get batchTable(){let t=this._model,n=t.featureTables,i=t.featureTableId;if(l(n)&&l(n[i]))return n[i]}get metadata(){return this._metadata}set metadata(t){this._metadata=t}get group(){return this._group}set group(t){this._group=t}getTextureIds(){return this._model.statistics.getTextureIds()}getTextureByteLengthById(t){return this._model.statistics.getTextureByteLengthById(t)}getExtension(t){return this._model.getExtension(t)}getFeature(t){let n=this._model,i=n.featureTableId;return n.featureTables[i].getFeature(t)}hasProperty(t,n){let i=this._model,o=i.featureTableId;return l(o)?i.featureTables[o].hasProperty(t,n):!1}applyDebugSettings(t,n){n=t?n:U.WHITE,this.featuresLength===0?this._model.color=n:l(this.batchTable)&&this.batchTable.setAllColor(n)}applyStyle(t){this._model.style=t}update(t,n){let i=this._model,o=this._tile;i.colorBlendAmount=t.colorBlendAmount,i.colorBlendMode=t.colorBlendMode,i.modelMatrix=o.computedTransform,i.customShader=t.customShader,i.featureIdLabel=t.featureIdLabel,i.instanceFeatureIdLabel=t.instanceFeatureIdLabel,i.lightColor=t.lightColor,i.imageBasedLighting=t.imageBasedLighting,i.backFaceCulling=t.backFaceCulling,i.shadows=t.shadows,i.showCreditsOnScreen=t.showCreditsOnScreen,i.splitDirection=t.splitDirection,i.debugWireframe=t.debugWireframe,i.edgeDisplayMode=t.edgeDisplayMode,i.showOutline=t.showOutline,i.outlineColor=t.outlineColor,i.pointCloudShading=t.pointCloudShading;let r=t.clippingPlanes;i.referenceMatrix=t.clippingPlanesOriginMatrix,l(r)&&o.clippingPlanesDirty&&(i._clippingPlanes=r.enabled&&o._isClipped?r:void 0);let s=t.environmentMapManager;i.environmentMapManager!==r&&(i._environmentMapManager=s),l(r)&&l(i._clippingPlanes)&&i._clippingPlanes!==r&&(i._clippingPlanes=r,i._clippingPlanesState=0);let a=t.clippingPolygons;l(a)&&o.clippingPolygonsDirty&&(i._clippingPolygons=a.enabled&&o._isClippedByPolygon?a:void 0),l(a)&&l(i._clippingPolygons)&&i._clippingPolygons!==a&&(i._clippingPolygons=a,i._clippingPolygonsState=0),o.clippingPolygonsNeedRebake&&(i._clippingPolygonsNeedRebake=!0),i.update(n),!this._ready&&i.ready&&(i.activeAnimations.addAll({loop:Dd.REPEAT}),this._ready=!0)}isDestroyed(){return!1}destroy(){return this._model=this._model&&this._model.destroy(),ue(this)}static async fromGltf(t,n,i,o){let r=new e(t,n,i),a=aY(t,n,r,{gltf:o,basePath:i}),c=t.vectorClassificationOnly?void 0:t.classificationType;a.classificationType=c;let d=await Bu.fromGltfAsync(a);return r._model=d,r}static async fromB3dm(t,n,i,o,r){let s=new e(t,n,i),c=aY(t,n,s,{arrayBuffer:o,byteOffset:r,resource:i}),d=t.vectorClassificationOnly?void 0:t.classificationType;c.classificationType=d;let u=await Bu.fromB3dm(c);return s._model=u,s}static async fromI3dm(t,n,i,o,r){let s=new e(t,n,i),c=aY(t,n,s,{arrayBuffer:o,byteOffset:r,resource:i}),d=await Bu.fromI3dm(c);return s._model=d,s}static async fromPnts(t,n,i,o,r){let s=new e(t,n,i),c=aY(t,n,s,{arrayBuffer:o,byteOffset:r,resource:i}),d=await Bu.fromPnts(c);return s._model=d,s}static async fromGeoJson(t,n,i,o){let r=new e(t,n,i),a=aY(t,n,r,{geoJson:o,resource:i}),c=await Bu.fromGeoJson(a);return r._model=c,r}pick(t,n,i){if(!l(this._model)||!this._ready)return;let o=n.verticalExaggeration,r=n.verticalExaggerationRelativeHeight;return this._model.pick(t,n,o,r,ne.WGS84,i)}};function aY(e,t,n,i){let o={cull:!1,releaseGltfJson:!0,opaquePass:Le.CESIUM_3D_TILE,modelMatrix:t.computedTransform,upAxis:e._modelUpAxis,forwardAxis:e._modelForwardAxis,incrementallyLoadTextures:!1,customShader:e.customShader,content:n,scene:e._scene,colorBlendMode:e.colorBlendMode,colorBlendAmount:e.colorBlendAmount,lightColor:e.lightColor,imageBasedLighting:e.imageBasedLighting,featureIdLabel:e.featureIdLabel,instanceFeatureIdLabel:e.instanceFeatureIdLabel,pointCloudShading:e.pointCloudShading,clippingPlanes:e.clippingPlanes,backFaceCulling:e.backFaceCulling,shadows:e.shadows,showCreditsOnScreen:e.showCreditsOnScreen,splitDirection:e.splitDirection,enableDebugWireframe:e._enableDebugWireframe,debugWireframe:e.debugWireframe,projectTo2D:e._projectTo2D,enablePick:e._enablePick,enableShowOutline:e._enableShowOutline,showOutline:e.showOutline,outlineColor:e.outlineColor};return It(i,o)}var Hu=G$;var fGi=x(T(),1);var L$=class e{constructor(t,n,i){this._tileset=t,this._tile=n,this._resource=i,this.featurePropertiesDirty=!1,this._metadata=void 0,this._group=void 0,this._ready=!1}get featuresLength(){return 0}get pointsLength(){return 0}get trianglesLength(){return 0}get geometryByteLength(){return 0}get texturesByteLength(){return 0}get batchTableByteLength(){return 0}get innerContents(){}get ready(){return this._ready}get tileset(){return this._tileset}get tile(){return this._tile}get url(){return this._resource.getUrlComponent(!0)}get batchTable(){}get metadata(){return this._metadata}set metadata(t){this._metadata=t}get group(){return this._group}set group(t){this._group=t}static fromJson(t,n,i,o){let r=new e(t,n,i);return r._tileset.loadTileset(r._resource,o,r._tile),r._ready=!0,r}hasProperty(t,n){return!1}getFeature(t){}applyDebugSettings(t,n){}applyStyle(t){}update(t,n){}pick(t,n,i){}isDestroyed(){return!1}destroy(){return ue(this)}},cY=L$;var Gvi=x(T(),1);var wLi=x(T(),1);var ZGi=x(T(),1);var bGi=x(T(),1);function ipt(e,t,n,i,o){return function(){let r=document.createElement("canvas"),s=o+2*i;r.height=r.width=s;let a=r.getContext("2d");return a.clearRect(0,0,s,s),i!==0&&(a.beginPath(),a.arc(s/2,s/2,s/2,0,2*Math.PI,!0),a.closePath(),a.fillStyle=n,a.fill(),e<1&&(a.save(),a.globalCompositeOperation="destination-out",a.beginPath(),a.arc(s/2,s/2,o/2,0,2*Math.PI,!0),a.closePath(),a.fillStyle="black",a.fill(),a.restore())),a.beginPath(),a.arc(s/2,s/2,o/2,0,2*Math.PI,!0),a.closePath(),a.fillStyle=t,a.fill(),r}}var JS=ipt;var opt=new pe,Gf=class{constructor(t,n,i,o,r){this._content=t,this._billboard=i,this._label=o,this._polyline=r,this._batchId=n,this._billboardImage=void 0,this._billboardColor=void 0,this._billboardOutlineColor=void 0,this._billboardOutlineWidth=void 0,this._billboardSize=void 0,this._pointSize=void 0,this._color=void 0,this._pointSize=void 0,this._pointOutlineColor=void 0,this._pointOutlineWidth=void 0,this._heightOffset=void 0,this._pickIds=new Array(3),FV(this)}get show(){return this._label.show}set show(t){this._label.show=t,this._billboard.show=t,this._polyline.show=t}get color(){return this._color}set color(t){this._color=U.clone(t,this._color),FV(this)}get pointSize(){return this._pointSize}set pointSize(t){this._pointSize=t,FV(this)}get pointOutlineColor(){return this._pointOutlineColor}set pointOutlineColor(t){this._pointOutlineColor=U.clone(t,this._pointOutlineColor),FV(this)}get pointOutlineWidth(){return this._pointOutlineWidth}set pointOutlineWidth(t){this._pointOutlineWidth=t,FV(this)}get labelColor(){return this._label.fillColor}set labelColor(t){this._label.fillColor=t,this._polyline.show=this._label.show&&t.alpha>0}get labelOutlineColor(){return this._label.outlineColor}set labelOutlineColor(t){this._label.outlineColor=t}get labelOutlineWidth(){return this._label.outlineWidth}set labelOutlineWidth(t){this._label.outlineWidth=t}get font(){return this._label.font}set font(t){this._label.font=t}get labelStyle(){return this._label.style}set labelStyle(t){this._label.style=t}get labelText(){return this._label.text}set labelText(t){l(t)||(t=""),this._label.text=t}get backgroundColor(){return this._label.backgroundColor}set backgroundColor(t){this._label.backgroundColor=t}get backgroundPadding(){return this._label.backgroundPadding}set backgroundPadding(t){this._label.backgroundPadding=t}get backgroundEnabled(){return this._label.showBackground}set backgroundEnabled(t){this._label.showBackground=t}get scaleByDistance(){return this._label.scaleByDistance}set scaleByDistance(t){this._label.scaleByDistance=t,this._billboard.scaleByDistance=t}get translucencyByDistance(){return this._label.translucencyByDistance}set translucencyByDistance(t){this._label.translucencyByDistance=t,this._billboard.translucencyByDistance=t}get distanceDisplayCondition(){return this._label.distanceDisplayCondition}set distanceDisplayCondition(t){this._label.distanceDisplayCondition=t,this._polyline.distanceDisplayCondition=t,this._billboard.distanceDisplayCondition=t}get heightOffset(){return this._heightOffset}set heightOffset(t){let n=this._heightOffset??0,i=this._content.tileset.ellipsoid,o=i.cartesianToCartographic(this._billboard.position,opt);o.height=o.height-n+t;let r=i.cartographicToCartesian(o);this._billboard.position=r,this._label.position=this._billboard.position,this._polyline.positions=[this._polyline.positions[0],r],this._heightOffset=t}get anchorLineEnabled(){return this._polyline.show}set anchorLineEnabled(t){this._polyline.show=t}get anchorLineColor(){return this._polyline.material.uniforms.color}set anchorLineColor(t){this._polyline.material.uniforms.color=U.clone(t,this._polyline.material.uniforms.color)}get image(){return this._billboardImage}set image(t){let n=this._billboardImage!==t;this._billboardImage=t,n&&FV(this)}get disableDepthTestDistance(){return this._label.disableDepthTestDistance}set disableDepthTestDistance(t){this._label.disableDepthTestDistance=t,this._billboard.disableDepthTestDistance=t}get horizontalOrigin(){return this._billboard.horizontalOrigin}set horizontalOrigin(t){this._billboard.horizontalOrigin=t}get verticalOrigin(){return this._billboard.verticalOrigin}set verticalOrigin(t){this._billboard.verticalOrigin=t}get labelHorizontalOrigin(){return this._label.horizontalOrigin}set labelHorizontalOrigin(t){this._label.horizontalOrigin=t}get labelVerticalOrigin(){return this._label.verticalOrigin}set labelVerticalOrigin(t){this._label.verticalOrigin=t}get content(){return this._content}get tileset(){return this._content.tileset}get primitive(){return this._content.tileset}get pickIds(){let t=this._pickIds;return t[0]=this._billboard.pickId,t[1]=this._label.pickId,t[2]=this._polyline.pickId,t}hasProperty(t){return this._content.batchTable.hasProperty(this._batchId,t)}getPropertyIds(t){return this._content.batchTable.getPropertyIds(this._batchId,t)}getProperty(t){return this._content.batchTable.getProperty(this._batchId,t)}getPropertyInherited(t){return ia.getPropertyInherited(this._content,this._batchId,t)}setProperty(t,n){this._content.batchTable.setProperty(this._batchId,t,n),this._content.featurePropertiesDirty=!0}isExactClass(t){return this._content.batchTable.isExactClass(this._batchId,t)}isClass(t){return this._content.batchTable.isClass(this._batchId,t)}getExactClassName(){return this._content.batchTable.getExactClassName(this._batchId)}};mt(Gf,"defaultColor",U.WHITE),mt(Gf,"defaultPointOutlineColor",U.BLACK),mt(Gf,"defaultPointOutlineWidth",0),mt(Gf,"defaultPointSize",8);function FV(e){let t=e._billboard;if(l(e._billboardImage)&&e._billboardImage!==t.image){t.image=e._billboardImage;return}if(l(e._billboardImage))return;let n=e._color??Gf.defaultColor,i=e._pointOutlineColor??Gf.defaultPointOutlineColor,o=e._pointOutlineWidth??Gf.defaultPointOutlineWidth,r=e._pointSize??Gf.defaultPointSize,s=e._billboardColor,a=e._billboardOutlineColor,c=e._billboardOutlineWidth,d=e._billboardSize;if(U.equals(n,s)&&U.equals(i,a)&&o===c&&r===d)return;e._billboardColor=U.clone(n,e._billboardColor),e._billboardOutlineColor=U.clone(i,e._billboardOutlineColor),e._billboardOutlineWidth=o,e._billboardSize=r;let u=n.alpha,m=n.toCssColorString(),p=i.toCssColorString(),b=JSON.stringify([m,r,p,o]);t.setImage(b,JS(u,m,p,o,r))}var mg=Gf;var TLi=x(T(),1);var XGi=x(T(),1);function Ku(e,t){e=e??B.EMPTY_OBJECT,this._show=e.show??!0,this._width=e.width??1,this._loop=e.loop??!1,this._distanceDisplayCondition=e.distanceDisplayCondition,this._material=e.material,l(this._material)||(this._material=to.fromType(to.ColorType,{color:new U(1,1,1,1)}));let n=e.positions;l(n)||(n=[]),this._positions=n,this._actualPositions=Yo(n,h.equalsEpsilon),this._loop&&this._actualPositions.length>2&&(this._actualPositions===this._positions&&(this._actualPositions=n.slice()),this._actualPositions.push(h.clone(this._actualPositions[0]))),this._length=this._actualPositions.length,this._id=e.id;let i;l(t)&&(i=P.clone(t.modelMatrix)),this._modelMatrix=i,this._segments=io.wrapLongitude(this._actualPositions,i),this._actualLength=void 0,this._propertiesChanged=new Uint32Array(TRe),this._polylineCollection=t,this._dirty=!1,this._pickId=void 0,this._boundingVolume=me.fromPoints(this._actualPositions),this._boundingVolumeWC=me.transform(this._boundingVolume,this._modelMatrix),this._boundingVolume2D=new me}var xRe=Ku.POSITION_INDEX=0,rpt=Ku.SHOW_INDEX=1,spt=Ku.WIDTH_INDEX=2,apt=Ku.MATERIAL_INDEX=3,lY=Ku.POSITION_SIZE_INDEX=4,cpt=Ku.DISTANCE_DISPLAY_CONDITION=5,TRe=Ku.NUMBER_OF_PROPERTIES=6;function hg(e,t){++e._propertiesChanged[t];let n=e._polylineCollection;l(n)&&(n._updatePolyline(e,t),e._dirty=!0)}Object.defineProperties(Ku.prototype,{show:{get:function(){return this._show},set:function(e){e!==this._show&&(this._show=e,hg(this,rpt))}},positions:{get:function(){return this._positions},set:function(e){let t=Yo(e,h.equalsEpsilon);this._loop&&t.length>2&&(t===e&&(t=e.slice()),t.push(h.clone(t[0]))),(this._actualPositions.length!==t.length||this._actualPositions.length!==this._length)&&hg(this,lY),this._positions=e,this._actualPositions=t,this._length=t.length,this._boundingVolume=me.fromPoints(this._actualPositions,this._boundingVolume),this._boundingVolumeWC=me.transform(this._boundingVolume,this._modelMatrix,this._boundingVolumeWC),hg(this,xRe),this.update()}},material:{get:function(){return this._material},set:function(e){this._material!==e&&(this._material=e,hg(this,apt))}},width:{get:function(){return this._width},set:function(e){let t=this._width;e!==t&&(this._width=e,hg(this,spt))}},loop:{get:function(){return this._loop},set:function(e){if(e!==this._loop){let t=this._actualPositions;e?t.length>2&&!h.equals(t[0],t[t.length-1])&&(t.length===this._positions.length&&(this._actualPositions=t=this._positions.slice()),t.push(h.clone(t[0]))):t.length>2&&h.equals(t[0],t[t.length-1])&&(t.length-1===this._positions.length?this._actualPositions=this._positions:t.pop()),this._loop=e,hg(this,lY)}}},id:{get:function(){return this._id},set:function(e){this._id=e,l(this._pickId)&&(this._pickId.object.id=e)}},pickId:{get:function(){return this._pickId}},isDestroyed:{get:function(){return!l(this._polylineCollection)}},distanceDisplayCondition:{get:function(){return this._distanceDisplayCondition},set:function(e){Bt.equals(e,this._distanceDisplayCondition)||(this._distanceDisplayCondition=Bt.clone(e,this._distanceDisplayCondition),hg(this,cpt))}}});Ku.prototype.update=function(){let e=P.IDENTITY;l(this._polylineCollection)&&(e=this._polylineCollection.modelMatrix);let t=this._segments.positions.length,n=this._segments.lengths,i=this._propertiesChanged[xRe]>0||this._propertiesChanged[lY]>0;if((!P.equals(e,this._modelMatrix)||i)&&(this._segments=io.wrapLongitude(this._actualPositions,e),this._boundingVolumeWC=me.transform(this._boundingVolume,e,this._boundingVolumeWC)),this._modelMatrix=P.clone(e,this._modelMatrix),this._segments.positions.length!==t)hg(this,lY);else{let o=n.length;for(let r=0;r<o;++r)if(n[r]!==this._segments.lengths[r]){hg(this,lY);break}}};Ku.prototype.getPickId=function(e){return l(this._pickId)||(this._pickId=e.createPickId({primitive:this,collection:this._polylineCollection,id:this._id})),this._pickId};Ku.prototype._clean=function(){this._dirty=!1;let e=this._propertiesChanged;for(let t=0;t<TRe-1;++t)e[t]=0};Ku.prototype._destroy=function(){this._pickId=this._pickId&&this._pickId.destroy(),this._material=this._material&&this._material.destroy(),this._polylineCollection=void 0};var th=Ku;var lpt=th.SHOW_INDEX,dpt=th.WIDTH_INDEX,v$=th.POSITION_INDEX,upt=th.MATERIAL_INDEX,_Re=th.POSITION_SIZE_INDEX,mpt=th.DISTANCE_DISPLAY_CONDITION,ARe=th.NUMBER_OF_PROPERTIES,Jd={texCoordExpandAndBatchIndex:0,position3DHigh:1,position3DLow:2,position2DHigh:3,position2DLow:4,prevPosition3DHigh:5,prevPosition3DLow:6,prevPosition2DHigh:7,prevPosition2DLow:8,nextPosition3DHigh:9,nextPosition3DLow:10,nextPosition2DHigh:11,nextPosition2DLow:12};function Lf(e){e=e??B.EMPTY_OBJECT,this.show=e.show??!0,this.modelMatrix=P.clone(e.modelMatrix??P.IDENTITY),this._modelMatrix=P.clone(P.IDENTITY),this.debugShowBoundingVolume=e.debugShowBoundingVolume??!1,this._opaqueRS=void 0,this._translucentRS=void 0,this._colorCommands=[],this._polylinesUpdated=!1,this._polylinesRemoved=!1,this._createVertexArray=!1,this._propertiesChanged=new Uint32Array(ARe),this._polylines=[],this._polylineBuckets={},this._positionBufferUsage={bufferUsage:Pe.STATIC_DRAW,frameCount:0},this._mode=void 0,this._polylinesToUpdate=[],this._vertexArrays=[],this._positionBuffer=void 0,this._texCoordExpandAndBatchIndexBuffer=void 0,this._batchTable=void 0,this._createBatchTable=!1,this._useHighlightColor=!1,this._highlightColor=U.clone(U.WHITE);let t=this;this._uniformMap={u_highlightColor:function(){return t._highlightColor}}}Object.defineProperties(Lf.prototype,{length:{get:function(){return F$(this),this._polylines.length}}});Lf.prototype.add=function(e){let t=new th(e,this);return t._index=this._polylines.length,this._polylines.push(t),this._createVertexArray=!0,this._createBatchTable=!0,t};Lf.prototype.remove=function(e){if(this.contains(e)){if(this._polylinesRemoved=!0,this._createVertexArray=!0,this._createBatchTable=!0,l(e._bucket)){let t=e._bucket;t.shaderProgram=t.shaderProgram&&t.shaderProgram.destroy()}return e._destroy(),!0}return!1};Lf.prototype.removeAll=function(){I$(this),FRe(this),this._polylineBuckets={},this._polylinesRemoved=!1,this._polylines.length=0,this._polylinesToUpdate.length=0,this._createVertexArray=!0};Lf.prototype.contains=function(e){return l(e)&&e._polylineCollection===this};Lf.prototype.get=function(e){return F$(this),this._polylines[e]};function hpt(e,t){l(e._batchTable)&&e._batchTable.destroy();let n=[{functionName:"batchTable_getWidthAndShow",componentDatatype:J.UNSIGNED_BYTE,componentsPerAttribute:2},{functionName:"batchTable_getPickColor",componentDatatype:J.UNSIGNED_BYTE,componentsPerAttribute:4,normalize:!0},{functionName:"batchTable_getCenterHigh",componentDatatype:J.FLOAT,componentsPerAttribute:3},{functionName:"batchTable_getCenterLowAndRadius",componentDatatype:J.FLOAT,componentsPerAttribute:4},{functionName:"batchTable_getDistanceDisplayCondition",componentDatatype:J.FLOAT,componentsPerAttribute:2}];e._batchTable=new C_(t,n,e._polylines.length)}var GRe=new An,LRe=new ce,WRe=new k;Lf.prototype.update=function(e){if(F$(this),this._polylines.length===0||!this.show)return;xpt(this,e);let t=e.context,n=e.mapProjection,i,o=this._propertiesChanged;if(this._createBatchTable){if(wt.maximumVertexTextureImageUnits===0)throw new ae("Vertex texture fetch support is required to render polylines. The maximum number of vertex texture image units must be greater than zero.");hpt(this,t),this._createBatchTable=!1}if(this._createVertexArray||ppt(this))RRe(this,t,n);else if(this._polylinesUpdated){let c=this._polylinesToUpdate;if(this._mode!==se.SCENE3D){let d=c.length;for(let u=0;u<d;++u)i=c[u],i.update()}if(o[_Re]||o[upt])RRe(this,t,n);else{let d=c.length,u=this._polylineBuckets;for(let m=0;m<d;++m){i=c[m],o=i._propertiesChanged;let p=i._bucket,b=0;for(let f in u)if(u.hasOwnProperty(f)){if(u[f]===p){o[v$]&&p.writeUpdate(b,i,this._positionBuffer,n);break}b+=u[f].lengthOfPositions}if((o[lpt]||o[dpt])&&this._batchTable.setBatchedAttribute(i._index,0,new k(i._width,i._show)),this._batchTable.attributes.length>2){if(o[v$]||o[_Re]){let f=e.mode===se.SCENE2D?i._boundingVolume2D:i._boundingVolumeWC,y=An.fromCartesian(f.center,GRe),_=ce.fromElements(y.low.x,y.low.y,y.low.z,f.radius,LRe);this._batchTable.setBatchedAttribute(i._index,2,y.high),this._batchTable.setBatchedAttribute(i._index,3,_)}if(o[mpt]){let f=WRe;f.x=0,f.y=Number.MAX_VALUE;let y=i.distanceDisplayCondition;l(y)&&(f.x=y.near,f.y=y.far),this._batchTable.setBatchedAttribute(i._index,4,f)}}i._clean()}}c.length=0,this._polylinesUpdated=!1}o=this._propertiesChanged;for(let c=0;c<ARe;++c)o[c]=0;let r=P.IDENTITY;e.mode===se.SCENE3D&&(r=this.modelMatrix);let s=e.passes,a=e.morphTime!==0;if((!l(this._opaqueRS)||this._opaqueRS.depthTest.enabled!==a)&&(this._opaqueRS=ze.fromCache({depthMask:a,depthTest:{enabled:a}})),(!l(this._translucentRS)||this._translucentRS.depthTest.enabled!==a)&&(this._translucentRS=ze.fromCache({blending:on.ALPHA_BLEND,depthMask:!a,depthTest:{enabled:a}})),this._batchTable.update(e),s.render||s.pick){let c=this._colorCommands;fpt(this,e,c,r)}};var dY=new me,SRe=new me;function fpt(e,t,n,i){let o=t.context,r=t.commandList,s=n.length,a=0,c=!0,d=e._vertexArrays,u=e.debugShowBoundingVolume,p=e._batchTable.getUniformMapCallback(),b=d.length;for(let f=0;f<b;++f){let y=d[f],_=y.buckets,S=_.length;for(let Z=0;Z<S;++Z){let R=_[Z],C=R.offset,E=R.bucket.shaderProgram,A=R.bucket.polylines,L=A.length,F,I,N=0,g,V;for(let G=0;G<L;++G){let v=A[G],X=gpt(v._material);if(X!==F){if(l(F)&&N>0){let O=I.isTranslucent();a>=s?(g=new lt({owner:e}),n.push(g)):g=n[a],++a,V=It(p(I._uniforms),e._uniformMap),g.boundingVolume=me.clone(dY,g.boundingVolume),g.modelMatrix=i,g.shaderProgram=E,g.vertexArray=y.va,g.renderState=O?e._translucentRS:e._opaqueRS,g.pass=O?Le.TRANSLUCENT:Le.OPAQUE,g.debugShowBoundingVolume=u,g.pickId="v_pickColor",g.uniformMap=V,g.count=N,g.offset=C,C+=N,N=0,c=!0,r.push(g)}I=v._material,I.update(o),F=X}let Y=v._locatorBuckets,D=Y.length;for(let O=0;O<D;++O){let w=Y[O];w.locator===R&&(N+=w.count)}let M;t.mode===se.SCENE3D?M=v._boundingVolumeWC:t.mode===se.COLUMBUS_VIEW?M=v._boundingVolume2D:t.mode===se.SCENE2D?l(v._boundingVolume2D)&&(M=me.clone(v._boundingVolume2D,SRe),M.center.x=0):l(v._boundingVolumeWC)&&l(v._boundingVolume2D)&&(M=me.union(v._boundingVolumeWC,v._boundingVolume2D,SRe)),c?(c=!1,me.clone(M,dY)):me.union(M,dY,dY)}l(F)&&N>0&&(a>=s?(g=new lt({owner:e}),n.push(g)):g=n[a],++a,V=It(p(I._uniforms),e._uniformMap),g.boundingVolume=me.clone(dY,g.boundingVolume),g.modelMatrix=i,g.shaderProgram=E,g.vertexArray=y.va,g.renderState=I.isTranslucent()?e._translucentRS:e._opaqueRS,g.pass=I.isTranslucent()?Le.TRANSLUCENT:Le.OPAQUE,g.debugShowBoundingVolume=u,g.pickId="v_pickColor",g.uniformMap=V,g.count=N,g.offset=C,c=!0,r.push(g)),F=void 0}}n.length=a}Lf.prototype.isDestroyed=function(){return!1};Lf.prototype.destroy=function(){return vRe(this),I$(this),FRe(this),this._batchTable=this._batchTable&&this._batchTable.destroy(),ue(this)};function ppt(e){let t=!1,n=e._propertiesChanged,i=e._positionBufferUsage;return n[v$]?(i.bufferUsage!==Pe.STREAM_DRAW&&(t=!0,i.bufferUsage=Pe.STREAM_DRAW),i.frameCount=100):i.bufferUsage!==Pe.STATIC_DRAW&&(i.frameCount===0?(t=!0,i.bufferUsage=Pe.STATIC_DRAW):i.frameCount--),t}var ZRe=[0,0,0];function RRe(e,t,n){e._createVertexArray=!1,I$(e),vRe(e),ypt(e);let i=[[]],o,r=e._batchTable,s=e._useHighlightColor,a=[0],c=0,d=[[]],u=0,m=e._polylineBuckets,p,b;for(p in m)m.hasOwnProperty(p)&&(b=m[p],b.updateShader(t,r,s),u+=b.lengthOfPositions);if(u>0){let f=e._mode,y=new Float32Array(6*u*3),_=new Float32Array(u*4),S,Z=0,R=0,C=0;for(p in m)if(m.hasOwnProperty(p)){b=m[p],b.write(y,_,Z,R,C,r,t,n),f===se.MORPHING&&(l(S)||(S=new Float32Array(6*u*3)),b.writeForMorph(S,Z));let V=b.lengthOfPositions;Z+=6*V*3,R+=V*4,C+=V*4,c=b.updateIndices(i,a,d,c)}let E=e._positionBufferUsage.bufferUsage,A=Pe.STATIC_DRAW;e._positionBuffer=it.createVertexBuffer({context:t,typedArray:y,usage:E});let L;l(S)&&(L=it.createVertexBuffer({context:t,typedArray:S,usage:E})),e._texCoordExpandAndBatchIndexBuffer=it.createVertexBuffer({context:t,typedArray:_,usage:A});let F=3*Float32Array.BYTES_PER_ELEMENT,I=4*Float32Array.BYTES_PER_ELEMENT,N=0,g=i.length;for(let V=0;V<g;++V)if(o=i[V],o.length>0){let G=new Uint16Array(o),v=it.createIndexBuffer({context:t,typedArray:G,usage:Pe.STATIC_DRAW,indexDatatype:Oe.UNSIGNED_SHORT});N+=a[V];let X=6*(V*(F*W.SIXTY_FOUR_KILOBYTES)-N*F),Y=F+X,D=F+Y,M=F+D,O=F+M,w=F+O,z=V*(I*W.SIXTY_FOUR_KILOBYTES)-N*I,K=[{index:Jd.position3DHigh,componentsPerAttribute:3,componentDatatype:J.FLOAT,offsetInBytes:X,strideInBytes:6*F},{index:Jd.position3DLow,componentsPerAttribute:3,componentDatatype:J.FLOAT,offsetInBytes:Y,strideInBytes:6*F},{index:Jd.position2DHigh,componentsPerAttribute:3,componentDatatype:J.FLOAT,offsetInBytes:X,strideInBytes:6*F},{index:Jd.position2DLow,componentsPerAttribute:3,componentDatatype:J.FLOAT,offsetInBytes:Y,strideInBytes:6*F},{index:Jd.prevPosition3DHigh,componentsPerAttribute:3,componentDatatype:J.FLOAT,offsetInBytes:D,strideInBytes:6*F},{index:Jd.prevPosition3DLow,componentsPerAttribute:3,componentDatatype:J.FLOAT,offsetInBytes:M,strideInBytes:6*F},{index:Jd.prevPosition2DHigh,componentsPerAttribute:3,componentDatatype:J.FLOAT,offsetInBytes:D,strideInBytes:6*F},{index:Jd.prevPosition2DLow,componentsPerAttribute:3,componentDatatype:J.FLOAT,offsetInBytes:M,strideInBytes:6*F},{index:Jd.nextPosition3DHigh,componentsPerAttribute:3,componentDatatype:J.FLOAT,offsetInBytes:O,strideInBytes:6*F},{index:Jd.nextPosition3DLow,componentsPerAttribute:3,componentDatatype:J.FLOAT,offsetInBytes:w,strideInBytes:6*F},{index:Jd.nextPosition2DHigh,componentsPerAttribute:3,componentDatatype:J.FLOAT,offsetInBytes:O,strideInBytes:6*F},{index:Jd.nextPosition2DLow,componentsPerAttribute:3,componentDatatype:J.FLOAT,offsetInBytes:w,strideInBytes:6*F},{index:Jd.texCoordExpandAndBatchIndex,componentsPerAttribute:4,componentDatatype:J.FLOAT,vertexBuffer:e._texCoordExpandAndBatchIndexBuffer,offsetInBytes:z}],te,H,$,ee;f===se.SCENE3D?(H=e._positionBuffer,te="vertexBuffer",$=ZRe,ee="value"):f===se.SCENE2D||f===se.COLUMBUS_VIEW?(H=ZRe,te="value",$=e._positionBuffer,ee="vertexBuffer"):(H=L,te="vertexBuffer",$=e._positionBuffer,ee="vertexBuffer"),K[0][te]=H,K[1][te]=H,K[2][ee]=$,K[3][ee]=$,K[4][te]=H,K[5][te]=H,K[6][ee]=$,K[7][ee]=$,K[8][te]=H,K[9][te]=H,K[10][ee]=$,K[11][ee]=$;let le=new Un({context:t,attributes:K,indexBuffer:v});e._vertexArrays.push({va:le,buckets:d[V]})}}}function bpt(e,t){return t instanceof vt?t.id:t}var d3=[];function gpt(e){let t=to._uniformList[e.type],n=t.length;d3.length=2*n;let i=0;for(let o=0;o<n;++o){let r=t[o];d3[i]=r,d3[i+1]=e._uniforms[r](),i+=2}return`${e.type}:${JSON.stringify(d3,bpt)}`}function ypt(e){let t=e._mode,n=e._modelMatrix,i=e._polylineBuckets={},o=e._polylines,r=o.length;for(let s=0;s<r;++s){let a=o[s];if(a._actualPositions.length>1){a.update();let c=a.material,d=i[c.type];l(d)||(d=i[c.type]=new i0(c,t,n)),d.addPolyline(a)}}}function xpt(e,t){let n=t.mode;(e._mode!==n||!P.equals(e._modelMatrix,e.modelMatrix))&&(e._mode=n,e._modelMatrix=P.clone(e.modelMatrix),e._createVertexArray=!0)}function F$(e){if(e._polylinesRemoved){e._polylinesRemoved=!1;let t=[],n=[],i=0,o,r=e._polylines.length;for(let s=0;s<r;++s)o=e._polylines[s],o.isDestroyed||(o._index=i++,n.push(o),t.push(o));e._polylines=t,e._polylinesToUpdate=n}}function I$(e){let t=e._polylines,n=t.length;for(let i=0;i<n;++i)if(!t[i].isDestroyed){let o=t[i]._bucket;l(o)&&(o.shaderProgram=o.shaderProgram&&o.shaderProgram.destroy())}}function vRe(e){let t=e._vertexArrays.length;for(let n=0;n<t;++n)e._vertexArrays[n].va.destroy();e._vertexArrays.length=0}Lf.prototype._updatePolyline=function(e,t){this._polylinesUpdated=!0,e._dirty||this._polylinesToUpdate.push(e),++this._propertiesChanged[t]};function FRe(e){let t=e._polylines,n=t.length;for(let i=0;i<n;++i)t[i].isDestroyed||t[i]._destroy()}function W$(e,t,n){this.count=e,this.offset=t,this.bucket=n}function i0(e,t,n){this.polylines=[],this.lengthOfPositions=0,this.material=e,this.shaderProgram=void 0,this.mode=t,this.modelMatrix=n}i0.prototype.addPolyline=function(e){this.polylines.push(e),e._actualLength=this.getPolylinePositionsLength(e),this.lengthOfPositions+=e._actualLength,e._bucket=this};i0.prototype.updateShader=function(e,t,n){if(l(this.shaderProgram))return;let i=["DISTANCE_DISPLAY_CONDITION"];n&&i.push("VECTOR_TILE"),this.material.shaderSource.search(/in\s+float\s+v_polylineAngle;/g)!==-1&&i.push("POLYLINE_DASH"),i.push("CLIP_POLYLINE");let o=new Je({defines:i,sources:[`in vec4 v_pickColor; +`,this.material.shaderSource,T_]}),r=t.getVertexShaderCallback()(e2),s=new Je({defines:i,sources:[Ul,r]});this.shaderProgram=tn.fromCache({context:e,vertexShaderSource:s,fragmentShaderSource:o,attributeLocations:Jd})};function IRe(e){return h.dot(h.UNIT_X,e._boundingVolume.center)<0||e._boundingVolume.intersectPlane(cn.ORIGIN_ZX_PLANE)===qt.INTERSECTING}i0.prototype.getPolylinePositionsLength=function(e){let t;if(this.mode===se.SCENE3D||!IRe(e))return t=e._actualPositions.length,t*4-4;let n=0,i=e._segments.lengths;t=i.length;for(let o=0;o<t;++o)n+=i[o]*4-4;return n};var Ca=new h,nh=new h,ih=new h,u3=new h,Tpt=new ce,_pt=new k;i0.prototype.write=function(e,t,n,i,o,r,s,a){let c=this.mode,d=a.ellipsoid.maximumRadius*W.PI,u=this.polylines,m=u.length;for(let p=0;p<m;++p){let b=u[p],f=b.width,y=b.show&&f>0,_=b._index,S=this.getSegments(b,a),Z=S.positions,R=S.lengths,C=Z.length,E=b.getPickId(s).color,A=0,L=0,F;for(let D=0;D<C;++D){D===0?b._loop?F=Z[C-2]:(F=u3,h.subtract(Z[0],Z[1],F),h.add(Z[0],F,F)):F=Z[D-1],h.clone(F,nh),h.clone(Z[D],Ca),D===C-1?b._loop?F=Z[1]:(F=u3,h.subtract(Z[C-1],Z[C-2],F),h.add(Z[C-1],F,F)):F=Z[D+1],h.clone(F,ih);let M=R[A];D===L+M&&(L+=M,++A);let O=D-L===0,w=D===L+R[A]-1;c===se.SCENE2D&&(nh.z=0,Ca.z=0,ih.z=0),(c===se.SCENE2D||c===se.MORPHING)&&(O||w)&&d-Math.abs(Ca.x)<1&&((Ca.x<0&&nh.x>0||Ca.x>0&&nh.x<0)&&h.clone(Ca,nh),(Ca.x<0&&ih.x>0||Ca.x>0&&ih.x<0)&&h.clone(Ca,ih));let z=O?2:0,K=w?2:4;for(let te=z;te<K;++te){An.writeElements(Ca,e,n),An.writeElements(nh,e,n+6),An.writeElements(ih,e,n+12);let H=te-2<0?-1:1;t[o]=D/(C-1),t[o+1]=2*(te%2)-1,t[o+2]=H,t[o+3]=_,n+=18,o+=4}}let I=Tpt;I.x=U.floatToByte(E.red),I.y=U.floatToByte(E.green),I.z=U.floatToByte(E.blue),I.w=U.floatToByte(E.alpha);let N=_pt;N.x=f,N.y=y?1:0;let g=c===se.SCENE2D?b._boundingVolume2D:b._boundingVolumeWC,V=An.fromCartesian(g.center,GRe),G=V.high,v=ce.fromElements(V.low.x,V.low.y,V.low.z,g.radius,LRe),X=WRe;X.x=0,X.y=Number.MAX_VALUE;let Y=b.distanceDisplayCondition;l(Y)&&(X.x=Y.near,X.y=Y.far),r.setBatchedAttribute(_,0,N),r.setBatchedAttribute(_,1,I),r.attributes.length>2&&(r.setBatchedAttribute(_,2,G),r.setBatchedAttribute(_,3,v),r.setBatchedAttribute(_,4,X))}};var Spt=new h,Zpt=new h,Rpt=new h,CRe=new h;i0.prototype.writeForMorph=function(e,t){let n=this.modelMatrix,i=this.polylines,o=i.length;for(let r=0;r<o;++r){let s=i[r],a=s._segments.positions,c=s._segments.lengths,d=a.length,u=0,m=0;for(let p=0;p<d;++p){let b;p===0?s._loop?b=a[d-2]:(b=CRe,h.subtract(a[0],a[1],b),h.add(a[0],b,b)):b=a[p-1],b=P.multiplyByPoint(n,b,Zpt);let f=P.multiplyByPoint(n,a[p],Spt),y;p===d-1?s._loop?y=a[1]:(y=CRe,h.subtract(a[d-1],a[d-2],y),h.add(a[d-1],y,y)):y=a[p+1],y=P.multiplyByPoint(n,y,Rpt);let _=c[u];p===m+_&&(m+=_,++u);let S=p-m===0,Z=p===m+c[u]-1,R=S?2:0,C=Z?2:4;for(let E=R;E<C;++E)An.writeElements(f,e,t),An.writeElements(b,e,t+6),An.writeElements(y,e,t+12),t+=18}}};var Cpt=new Array(1);i0.prototype.updateIndices=function(e,t,n,i){let o=n.length-1,r=new W$(0,i,this);n[o].push(r);let s=0,a=e[e.length-1],c=0;a.length>0&&(c=a[a.length-1]+1);let d=this.polylines,u=d.length;for(let m=0;m<u;++m){let p=d[m];p._locatorBuckets=[];let b;if(this.mode===se.SCENE3D){b=Cpt;let y=p._actualPositions.length;if(y>0)b[0]=y;else continue}else b=p._segments.lengths;let f=b.length;if(f>0){let y=0;for(let _=0;_<f;++_){let S=b[_]-1;for(let Z=0;Z<S;++Z)c+4>W.SIXTY_FOUR_KILOBYTES&&(p._locatorBuckets.push({locator:r,count:y}),y=0,t.push(4),a=[],e.push(a),c=0,r.count=s,s=0,i=0,r=new W$(0,0,this),n[++o]=[r]),a.push(c,c+2,c+1),a.push(c+1,c+2,c+3),y+=6,s+=6,i+=6,c+=4}p._locatorBuckets.push({locator:r,count:y}),c+4>W.SIXTY_FOUR_KILOBYTES&&(t.push(0),a=[],e.push(a),c=0,r.count=s,i=0,s=0,r=new W$(0,0,this),n[++o]=[r])}p._clean()}return r.count=s,i};i0.prototype.getPolylineStartIndex=function(e){let t=this.polylines,n=0,i=t.length;for(let o=0;o<i;++o){let r=t[o];if(r===e)break;n+=r._actualLength}return n};var IV={positions:void 0,lengths:void 0},VRe=new Array(1),Vpt=new h,Ept=new pe;i0.prototype.getSegments=function(e,t){let n=e._actualPositions;if(this.mode===se.SCENE3D)return VRe[0]=n.length,IV.positions=n,IV.lengths=VRe,IV;IRe(e)&&(n=e._segments.positions);let i=t.ellipsoid,o=[],r=this.modelMatrix,s=n.length,a,c=Vpt;for(let d=0;d<s;++d)a=n[d],c=P.multiplyByPoint(r,a,c),o.push(t.project(i.cartesianToCartographic(c,Ept)));if(o.length>0){e._boundingVolume2D=me.fromPoints(o,e._boundingVolume2D);let d=e._boundingVolume2D.center;e._boundingVolume2D.center=new h(d.z,d.x,d.y)}return IV.positions=o,IV.lengths=e._segments.lengths,IV};var ERe;i0.prototype.writeUpdate=function(e,t,n,i){let o=this.mode,r=i.ellipsoid.maximumRadius*W.PI,s=t._actualLength;if(s){e+=this.getPolylineStartIndex(t);let a=ERe,c=6*s*3;!l(a)||a.length<c?a=ERe=new Float32Array(c):a.length>c&&(a=new Float32Array(a.buffer,0,c));let d=this.getSegments(t,i),u=d.positions,m=d.lengths,p=0,b=0,f=0,y;s=u.length;for(let _=0;_<s;++_){_===0?t._loop?y=u[s-2]:(y=u3,h.subtract(u[0],u[1],y),h.add(u[0],y,y)):y=u[_-1],h.clone(y,nh),h.clone(u[_],Ca),_===s-1?t._loop?y=u[1]:(y=u3,h.subtract(u[s-1],u[s-2],y),h.add(u[s-1],y,y)):y=u[_+1],h.clone(y,ih);let S=m[b];_===f+S&&(f+=S,++b);let Z=_-f===0,R=_===f+m[b]-1;o===se.SCENE2D&&(nh.z=0,Ca.z=0,ih.z=0),(o===se.SCENE2D||o===se.MORPHING)&&(Z||R)&&r-Math.abs(Ca.x)<1&&((Ca.x<0&&nh.x>0||Ca.x>0&&nh.x<0)&&h.clone(Ca,nh),(Ca.x<0&&ih.x>0||Ca.x>0&&ih.x<0)&&h.clone(Ca,ih));let C=Z?2:0,E=R?2:4;for(let A=C;A<E;++A)An.writeElements(Ca,a,p),An.writeElements(nh,a,p+6),An.writeElements(ih,a,p+12),p+=18}n.copyFromArrayView(a,18*Float32Array.BYTES_PER_ELEMENT*e)}};var Wf=Lf;function Xx(e){this._positions=e.positions,this._batchTable=e.batchTable,this._batchIds=e.batchIds,this._rectangle=e.rectangle,this._minHeight=e.minimumHeight,this._maxHeight=e.maximumHeight,this._heightReference=e.heightReference,this._billboardCollection=new Cu({batchTable:e.batchTable,scene:e.scene}),this._labelCollection=new Xp({batchTable:e.batchTable,scene:e.scene}),this._polylineCollection=new Wf,this._polylineCollection._useHighlightColor=!0,this._packedBuffer=void 0,this._ready=!1,this._promise=void 0,this._error=void 0}Object.defineProperties(Xx.prototype,{ready:{get:function(){return this._ready}},pointsLength:{get:function(){return this._billboardCollection.length}},texturesByteLength:{get:function(){let e=this._billboardCollection.sizeInBytes,t=this._labelCollection.sizeInBytes;return e+t}}});function Apt(e,t){let n=e._rectangle,i=e._minHeight,o=e._maxHeight,r=2+re.packedLength+ne.packedLength,s=new Float64Array(r),a=0;return s[a++]=i,s[a++]=o,re.pack(n,s,a),a+=re.packedLength,ne.pack(t,s,a),s}var Gpt=new qn("createVectorTilePoints",5),Lpt=new h;function Wpt(e,t){let n=e._positions,i=e._packedBuffer;l(i)||(n=e._positions=n.slice(),e._batchIds=e._batchIds.slice(),i=e._packedBuffer=Apt(e,t));let o=[n.buffer,i.buffer],r={positions:n.buffer,packedBuffer:i.buffer},s=Gpt.scheduleTask(r,o);if(l(s))return s.then(a=>{if(e.isDestroyed())return;e._positions=new Float64Array(a.positions);let c=e._billboardCollection,d=e._labelCollection,u=e._polylineCollection;n=e._positions;let m=e._batchIds,p=n.length/3,b=e._heightReference??He.NONE;for(let f=0;f<p;++f){let y=m[f],_=h.unpack(n,f*3,Lpt),S=c.add();S.position=_,S._batchIndex=y,S.heightReference=b;let Z=d.add();Z.text=" ",Z.position=_,Z._batchIndex=y,Z.heightReference=b;let R=u.add();R.positions=[h.clone(_),h.clone(_)]}e._positions=void 0,e._packedBuffer=void 0,e._ready=!0}).catch(a=>{e.isDestroyed()||(e._error=a)})}Xx.prototype.createFeatures=function(e,t){let n=this._billboardCollection,i=this._labelCollection,o=this._polylineCollection,r=this._batchIds,s=r.length;for(let a=0;a<s;++a){let c=r[a],d=n.get(a),u=i.get(a),m=o.get(a);t[c]=new mg(e,c,d,u,m)}};Xx.prototype.applyDebugSettings=function(e,t){e?(U.clone(t,this._billboardCollection._highlightColor),U.clone(t,this._labelCollection._highlightColor),U.clone(t,this._polylineCollection._highlightColor)):(U.clone(U.WHITE,this._billboardCollection._highlightColor),U.clone(U.WHITE,this._labelCollection._highlightColor),U.clone(U.WHITE,this._polylineCollection._highlightColor))};function vpt(e,t){let n=e._batchIds,i=n.length;for(let o=0;o<i;++o){let r=n[o],s=t[r];s.show=!0,s.pointSize=mg.defaultPointSize,s.color=mg.defaultColor,s.pointOutlineColor=mg.defaultPointOutlineColor,s.pointOutlineWidth=mg.defaultPointOutlineWidth,s.labelColor=U.WHITE,s.labelOutlineColor=U.WHITE,s.labelOutlineWidth=1,s.font="30px sans-serif",s.labelStyle=yr.FILL,s.labelText=void 0,s.backgroundColor=new U(.165,.165,.165,.8),s.backgroundPadding=new k(7,5),s.backgroundEnabled=!1,s.scaleByDistance=void 0,s.translucencyByDistance=void 0,s.distanceDisplayCondition=void 0,s.heightOffset=0,s.anchorLineEnabled=!1,s.anchorLineColor=U.WHITE,s.image=void 0,s.disableDepthTestDistance=0,s.horizontalOrigin=Di.CENTER,s.verticalOrigin=zn.CENTER,s.labelHorizontalOrigin=Di.RIGHT,s.labelVerticalOrigin=zn.BASELINE}}var Fpt=new U,Ipt=new U,Ppt=new U,Xpt=new U,Npt=new U,Ypt=new U,uY=new Kt,mY=new Kt,P$=new Bt;Xx.prototype.applyStyle=function(e,t){if(!l(e)){vpt(this,t);return}let n=this._batchIds,i=n.length;for(let o=0;o<i;++o){let r=n[o],s=t[r];if(l(e.show)&&(s.show=e.show.evaluate(s)),l(e.pointSize)&&(s.pointSize=e.pointSize.evaluate(s)),l(e.color)&&(s.color=e.color.evaluateColor(s,Fpt)),l(e.pointOutlineColor)&&(s.pointOutlineColor=e.pointOutlineColor.evaluateColor(s,Ipt)),l(e.pointOutlineWidth)&&(s.pointOutlineWidth=e.pointOutlineWidth.evaluate(s)),l(e.labelColor)&&(s.labelColor=e.labelColor.evaluateColor(s,Ppt)),l(e.labelOutlineColor)&&(s.labelOutlineColor=e.labelOutlineColor.evaluateColor(s,Xpt)),l(e.labelOutlineWidth)&&(s.labelOutlineWidth=e.labelOutlineWidth.evaluate(s)),l(e.font)&&(s.font=e.font.evaluate(s)),l(e.labelStyle)&&(s.labelStyle=e.labelStyle.evaluate(s)),l(e.labelText)?s.labelText=e.labelText.evaluate(s):s.labelText=void 0,l(e.backgroundColor)&&(s.backgroundColor=e.backgroundColor.evaluateColor(s,Npt)),l(e.backgroundPadding)&&(s.backgroundPadding=e.backgroundPadding.evaluate(s)),l(e.backgroundEnabled)&&(s.backgroundEnabled=e.backgroundEnabled.evaluate(s)),l(e.scaleByDistance)){let a=e.scaleByDistance.evaluate(s);l(a)?(uY.near=a.x,uY.nearValue=a.y,uY.far=a.z,uY.farValue=a.w,s.scaleByDistance=uY):s.scaleByDistance=void 0}else s.scaleByDistance=void 0;if(l(e.translucencyByDistance)){let a=e.translucencyByDistance.evaluate(s);l(a)?(mY.near=a.x,mY.nearValue=a.y,mY.far=a.z,mY.farValue=a.w,s.translucencyByDistance=mY):s.translucencyByDistance=void 0}else s.translucencyByDistance=void 0;if(l(e.distanceDisplayCondition)){let a=e.distanceDisplayCondition.evaluate(s);l(a)?(P$.near=a.x,P$.far=a.y,s.distanceDisplayCondition=P$):s.distanceDisplayCondition=void 0}else s.distanceDisplayCondition=void 0;l(e.heightOffset)&&(s.heightOffset=e.heightOffset.evaluate(s)),l(e.anchorLineEnabled)&&(s.anchorLineEnabled=e.anchorLineEnabled.evaluate(s)),l(e.anchorLineColor)&&(s.anchorLineColor=e.anchorLineColor.evaluateColor(s,Ypt)),l(e.image)?s.image=e.image.evaluate(s):s.image=void 0,l(e.disableDepthTestDistance)&&(s.disableDepthTestDistance=e.disableDepthTestDistance.evaluate(s)),l(e.horizontalOrigin)&&(s.horizontalOrigin=e.horizontalOrigin.evaluate(s)),l(e.verticalOrigin)&&(s.verticalOrigin=e.verticalOrigin.evaluate(s)),l(e.labelHorizontalOrigin)&&(s.labelHorizontalOrigin=e.labelHorizontalOrigin.evaluate(s)),l(e.labelVerticalOrigin)&&(s.labelVerticalOrigin=e.labelVerticalOrigin.evaluate(s))}};Xx.prototype.update=function(e){if(!this._ready&&(l(this._promise)||(this._promise=Wpt(this,e.mapProjection.ellipsoid)),l(this._error))){let t=this._error;throw this._error=void 0,t}this._polylineCollection.update(e),this._billboardCollection.update(e),this._labelCollection.update(e)};Xx.prototype.isDestroyed=function(){return!1};Xx.prototype.destroy=function(){return this._billboardCollection=this._billboardCollection&&this._billboardCollection.destroy(),this._labelCollection=this._labelCollection&&this._labelCollection.destroy(),this._polylineCollection=this._polylineCollection&&this._polylineCollection.destroy(),ue(this)};var hY=Xx;var eWi=x(T(),1);function fg(e){this._batchTable=e.batchTable,this._batchIds=e.batchIds,this._positions=e.positions,this._counts=e.counts,this._indices=e.indices,this._indexCounts=e.indexCounts,this._indexOffsets=void 0,this._batchTableColors=void 0,this._packedBuffer=void 0,this._batchedPositions=void 0,this._transferrableBatchIds=void 0,this._vertexBatchIds=void 0,this._ellipsoid=e.ellipsoid??ne.WGS84,this._minimumHeight=e.minimumHeight,this._maximumHeight=e.maximumHeight,this._polygonMinimumHeights=e.polygonMinimumHeights,this._polygonMaximumHeights=e.polygonMaximumHeights,this._center=e.center??h.ZERO,this._rectangle=e.rectangle,this._center=void 0,this._boundingVolume=e.boundingVolume,this._boundingVolumes=void 0,this._batchedIndices=void 0,this._ready=!1,this._promise=void 0,this._error=void 0,this._primitive=void 0,this.debugWireframe=!1,this.forceRebatch=!1,this.classificationType=ti.BOTH}Object.defineProperties(fg.prototype,{trianglesLength:{get:function(){return l(this._primitive)?this._primitive.trianglesLength:0}},geometryByteLength:{get:function(){return l(this._primitive)?this._primitive.geometryByteLength:0}},ready:{get:function(){return this._ready}}});function Mpt(e){let t=new Float64Array(3+h.packedLength+ne.packedLength+re.packedLength),n=0;return t[n++]=e._indices.BYTES_PER_ELEMENT,t[n++]=e._minimumHeight,t[n++]=e._maximumHeight,h.pack(e._center,t,n),n+=h.packedLength,ne.pack(e._ellipsoid,t,n),n+=ne.packedLength,re.pack(e._rectangle,t,n),t}function wpt(e,t){let n=1,i=t[n++],o=e._boundingVolumes=new Array(i);for(let a=0;a<i;++a)o[a]=nn.unpack(t,n),n+=nn.packedLength;let r=t[n++],s=e._batchedIndices=new Array(r);for(let a=0;a<r;++a){let c=U.unpack(t,n);n+=U.packedLength;let d=t[n++],u=t[n++],m=t[n++],p=new Array(m);for(let b=0;b<m;++b)p[b]=t[n++];s[a]=new n0({color:c,offset:d,count:u,batchIds:p})}}var kpt=new qn("createVectorTilePolygons",5),Upt=new U;function Dpt(e){if(l(e._primitive))return;let t=e._positions,n=e._counts,i=e._indexCounts,o=e._indices,r=e._transferrableBatchIds,s=e._batchTableColors,a=e._packedBuffer;if(!l(s)){t=e._positions=e._positions.slice(),n=e._counts=e._counts.slice(),i=e._indexCounts=e._indexCounts.slice(),o=e._indices=e._indices.slice(),e._center=e._ellipsoid.cartographicToCartesian(re.center(e._rectangle)),r=e._transferrableBatchIds=new Uint32Array(e._batchIds),s=e._batchTableColors=new Uint32Array(r.length);let b=e._batchTable,f=s.length;for(let y=0;y<f;++y){let _=b.getColor(y,Upt);s[y]=_.toRgba()}a=e._packedBuffer=Mpt(e)}let c=[t.buffer,n.buffer,i.buffer,o.buffer,r.buffer,s.buffer,a.buffer],d={packedBuffer:a.buffer,positions:t.buffer,counts:n.buffer,indexCounts:i.buffer,indices:o.buffer,batchIds:r.buffer,batchTableColors:s.buffer},u=e._polygonMinimumHeights,m=e._polygonMaximumHeights;l(u)&&l(m)&&(u=u.slice(),m=m.slice(),c.push(u.buffer,m.buffer),d.minimumHeights=u,d.maximumHeights=m);let p=kpt.scheduleTask(d,c);if(l(p))return p.then(b=>{if(e.isDestroyed())return;e._positions=void 0,e._counts=void 0,e._polygonMinimumHeights=void 0,e._polygonMaximumHeights=void 0;let f=new Float64Array(b.packedBuffer),y=f[0];wpt(e,f),e._indices=Oe.getSizeInBytes(y)===2?new Uint16Array(b.indices):new Uint32Array(b.indices),e._indexOffsets=new Uint32Array(b.indexOffsets),e._indexCounts=new Uint32Array(b.indexCounts),e._batchedPositions=new Float32Array(b.positions),e._vertexBatchIds=new Uint16Array(b.batchIds),Opt(e),e._ready=!0}).catch(b=>{e.isDestroyed()||(e._error=b)})}function Opt(e){l(e._primitive)||(e._primitive=new zS({batchTable:e._batchTable,positions:e._batchedPositions,batchIds:e._batchIds,vertexBatchIds:e._vertexBatchIds,indices:e._indices,indexOffsets:e._indexOffsets,indexCounts:e._indexCounts,batchedIndices:e._batchedIndices,boundingVolume:e._boundingVolume,boundingVolumes:e._boundingVolumes,center:e._center}),e._batchTable=void 0,e._batchIds=void 0,e._positions=void 0,e._counts=void 0,e._indices=void 0,e._indexCounts=void 0,e._indexOffsets=void 0,e._batchTableColors=void 0,e._packedBuffer=void 0,e._batchedPositions=void 0,e._transferrableBatchIds=void 0,e._vertexBatchIds=void 0,e._ellipsoid=void 0,e._minimumHeight=void 0,e._maximumHeight=void 0,e._polygonMinimumHeights=void 0,e._polygonMaximumHeights=void 0,e._center=void 0,e._rectangle=void 0,e._boundingVolume=void 0,e._boundingVolumes=void 0,e._batchedIndices=void 0)}fg.prototype.createFeatures=function(e,t){this._primitive.createFeatures(e,t)};fg.prototype.applyDebugSettings=function(e,t){this._primitive.applyDebugSettings(e,t)};fg.prototype.applyStyle=function(e,t){this._primitive.applyStyle(e,t)};fg.prototype.updateCommands=function(e,t){this._primitive.updateCommands(e,t)};fg.prototype.update=function(e){if(!this._ready){if(l(this._promise)||(this._promise=Dpt(this)),l(this._error)){let t=this._error;throw this._error=void 0,t}return}this._primitive.debugWireframe=this.debugWireframe,this._primitive.forceRebatch=this.forceRebatch,this._primitive.classificationType=this.classificationType,this._primitive.update(e)};fg.prototype.isDestroyed=function(){return!1};fg.prototype.destroy=function(){return this._primitive=this._primitive&&this._primitive.destroy(),ue(this)};var fY=fg;var RWi=x(T(),1);function vf(e){this._positions=e.positions,this._widths=e.widths,this._counts=e.counts,this._batchIds=e.batchIds,this._ellipsoid=e.ellipsoid??ne.WGS84,this._minimumHeight=e.minimumHeight,this._maximumHeight=e.maximumHeight,this._center=e.center,this._rectangle=e.rectangle,this._boundingVolume=e.boundingVolume,this._batchTable=e.batchTable,this._va=void 0,this._sp=void 0,this._rs=void 0,this._uniformMap=void 0,this._command=void 0,this._transferrableBatchIds=void 0,this._packedBuffer=void 0,this._keepDecodedPositions=e.keepDecodedPositions,this._decodedPositions=void 0,this._decodedPositionOffsets=void 0,this._currentPositions=void 0,this._previousPositions=void 0,this._nextPositions=void 0,this._expandAndWidth=void 0,this._vertexBatchIds=void 0,this._indices=void 0,this._constantColor=U.clone(U.WHITE),this._highlightColor=this._constantColor,this._trianglesLength=0,this._geometryByteLength=0,this._ready=!1,this._promise=void 0,this._error=void 0}Object.defineProperties(vf.prototype,{trianglesLength:{get:function(){return this._trianglesLength}},geometryByteLength:{get:function(){return this._geometryByteLength}},ready:{get:function(){return this._ready}}});function Bpt(e){let t=e._rectangle,n=e._minimumHeight,i=e._maximumHeight,o=e._ellipsoid,r=e._center,s=2+re.packedLength+ne.packedLength+h.packedLength,a=new Float64Array(s),c=0;return a[c++]=n,a[c++]=i,re.pack(t,a,c),c+=re.packedLength,ne.pack(o,a,c),c+=ne.packedLength,h.pack(r,a,c),a}var zpt=new qn("createVectorTilePolylines",5),PV={previousPosition:0,currentPosition:1,nextPosition:2,expandAndWidth:3,a_batchId:4};function Hpt(e,t){if(l(e._va))return;let n=e._positions,i=e._widths,o=e._counts,r=e._transferrableBatchIds,s=e._packedBuffer;l(s)||(n=e._positions=n.slice(),i=e._widths=i.slice(),o=e._counts=o.slice(),r=e._transferrableBatchIds=e._batchIds.slice(),s=e._packedBuffer=Bpt(e));let a=[n.buffer,i.buffer,o.buffer,r.buffer,s.buffer],c={positions:n.buffer,widths:i.buffer,counts:o.buffer,batchIds:r.buffer,packedBuffer:s.buffer,keepDecodedPositions:e._keepDecodedPositions},d=zpt.scheduleTask(c,a);if(l(d))return d.then(function(u){if(e.isDestroyed())return;e._keepDecodedPositions&&(e._decodedPositions=new Float64Array(u.decodedPositions),e._decodedPositionOffsets=new Uint32Array(u.decodedPositionOffsets)),e._currentPositions=new Float32Array(u.currentPositions),e._previousPositions=new Float32Array(u.previousPositions),e._nextPositions=new Float32Array(u.nextPositions),e._expandAndWidth=new Float32Array(u.expandAndWidth),e._vertexBatchIds=new Uint16Array(u.batchIds);let m=u.indexDatatype;e._indices=m===Oe.UNSIGNED_SHORT?new Uint16Array(u.indices):new Uint32Array(u.indices),Kpt(e,t),e._ready=!0}).catch(u=>{e.isDestroyed()||(e._error=u)})}function Kpt(e,t){if(!l(e._va)){let n=e._currentPositions,i=e._previousPositions,o=e._nextPositions,r=e._expandAndWidth,s=e._vertexBatchIds,a=e._indices,c=i.byteLength+n.byteLength+o.byteLength;c+=r.byteLength+s.byteLength+a.byteLength,e._trianglesLength=a.length/3,e._geometryByteLength=c;let d=it.createVertexBuffer({context:t,typedArray:i,usage:Pe.STATIC_DRAW}),u=it.createVertexBuffer({context:t,typedArray:n,usage:Pe.STATIC_DRAW}),m=it.createVertexBuffer({context:t,typedArray:o,usage:Pe.STATIC_DRAW}),p=it.createVertexBuffer({context:t,typedArray:r,usage:Pe.STATIC_DRAW}),b=it.createVertexBuffer({context:t,typedArray:s,usage:Pe.STATIC_DRAW}),f=it.createIndexBuffer({context:t,typedArray:a,usage:Pe.STATIC_DRAW,indexDatatype:a.BYTES_PER_ELEMENT===2?Oe.UNSIGNED_SHORT:Oe.UNSIGNED_INT}),y=[{index:PV.previousPosition,vertexBuffer:d,componentDatatype:J.FLOAT,componentsPerAttribute:3},{index:PV.currentPosition,vertexBuffer:u,componentDatatype:J.FLOAT,componentsPerAttribute:3},{index:PV.nextPosition,vertexBuffer:m,componentDatatype:J.FLOAT,componentsPerAttribute:3},{index:PV.expandAndWidth,vertexBuffer:p,componentDatatype:J.FLOAT,componentsPerAttribute:2},{index:PV.a_batchId,vertexBuffer:b,componentDatatype:J.UNSIGNED_SHORT,componentsPerAttribute:1}];e._va=new Un({context:t,attributes:y,indexBuffer:f}),e._positions=void 0,e._widths=void 0,e._counts=void 0,e._ellipsoid=void 0,e._minimumHeight=void 0,e._maximumHeight=void 0,e._rectangle=void 0,e._transferrableBatchIds=void 0,e._packedBuffer=void 0,e._currentPositions=void 0,e._previousPositions=void 0,e._nextPositions=void 0,e._expandAndWidth=void 0,e._vertexBatchIds=void 0,e._indices=void 0}}var pY=new P,PRe=new h;function Jpt(e,t){l(e._uniformMap)||(e._uniformMap={u_modifiedModelView:function(){let n=t.uniformState.view;return P.clone(n,pY),P.multiplyByPoint(pY,e._center,PRe),P.setTranslation(pY,PRe,pY),pY},u_highlightColor:function(){return e._highlightColor}})}function jpt(e){if(l(e._rs))return;let t={enabled:!0,factor:-5,units:-5};e._rs=ze.fromCache({blending:on.ALPHA_BLEND,depthMask:!1,depthTest:{enabled:!0},polygonOffset:t})}var Qpt=`uniform vec4 u_highlightColor; void main() { out_FragColor = u_highlightColor; } -`;function cut(e,t){if(l(e._sp))return;let n=e._batchTable,i=n.getVertexShaderCallback(!1,"a_batchId",void 0)(p2),o=n.getFragmentShaderCallback(!1,void 0,!1)(aut),r=new Je({defines:["VECTOR_TILE","CLIP_POLYLINE"],sources:[Ul,i]}),s=new Je({defines:["VECTOR_TILE"],sources:[o]});e._sp=tn.fromCache({context:t,vertexShaderSource:r,fragmentShaderSource:s,attributeLocations:tV})}function lut(e,t){if(!l(e._command)){let n=e._batchTable.getUniformMapCallback()(e._uniformMap);e._command=new lt({owner:e,vertexArray:e._va,renderState:e._rs,shaderProgram:e._sp,uniformMap:n,boundingVolume:e._boundingVolume,pass:Le.TRANSLUCENT,pickId:e._batchTable.getPickId()})}t.commandList.push(e._command)}_f.getPolylinePositions=function(e,t){let n=e._batchIds,i=e._decodedPositions,o=e._decodedPositionOffsets;if(!l(n)||!l(i))return;let r,s,a=n.length,c=0,d=0;for(r=0;r<a;++r)n[r]===t&&(c+=o[r+1]-o[r]);if(c===0)return;let u=new Float64Array(c*3);for(r=0;r<a;++r)if(n[r]===t){let m=o[r],p=o[r+1]-m;for(s=0;s<p;++s){let b=(m+s)*3;u[d++]=i[b],u[d++]=i[b+1],u[d++]=i[b+2]}}return u};_f.prototype.getPositions=function(e){return _f.getPolylinePositions(this,e)};_f.prototype.createFeatures=function(e,t){let n=this._batchIds,i=n.length;for(let o=0;o<i;++o){let r=n[o];t[r]=new ea(e,r)}};_f.prototype.applyDebugSettings=function(e,t){this._highlightColor=e?t:this._constantColor};function dut(e,t){let n=e._batchIds,i=n.length;for(let o=0;o<i;++o){let r=n[o],s=t[r];s.show=!0,s.color=U.WHITE}}var uut=new U,mut=U.WHITE,hut=!0;_f.prototype.applyStyle=function(e,t){if(!l(e)){dut(this,t);return}let n=this._batchIds,i=n.length;for(let o=0;o<i;++o){let r=n[o],s=t[r];s.color=l(e.color)?e.color.evaluateColor(s,uut):mut,s.show=l(e.show)?e.show.evaluate(s):hut}};_f.prototype.update=function(e){let t=e.context;if(!this._ready){if(l(this._promise)||(this._promise=iut(this,t)),l(this._error)){let i=this._error;throw this._error=void 0,i}return}rut(this,t),cut(this,t),sut(this);let n=e.passes;(n.render||n.pick)&&lut(this,e)};_f.prototype.isDestroyed=function(){return!1};_f.prototype.destroy=function(){return this._va=this._va&&this._va.destroy(),this._sp=this._sp&&this._sp.destroy(),ue(this)};var WS=_f;var lbi=x(T(),1);function rg(e){this._positions=e.positions,this._widths=e.widths,this._counts=e.counts,this._batchIds=e.batchIds,this._ellipsoid=e.ellipsoid??ne.WGS84,this._minimumHeight=e.minimumHeight,this._maximumHeight=e.maximumHeight,this._center=e.center,this._rectangle=e.rectangle,this._batchTable=e.batchTable,this._va=void 0,this._sp=void 0,this._rs=void 0,this._uniformMap=void 0,this._command=void 0,this._transferrableBatchIds=void 0,this._packedBuffer=void 0,this._minimumMaximumVectorHeights=new k(Pi._defaultMinTerrainHeight,Pi._defaultMaxTerrainHeight),this._boundingVolume=nn.fromRectangle(e.rectangle,Pi._defaultMinTerrainHeight,Pi._defaultMaxTerrainHeight,this._ellipsoid),this._classificationType=e.classificationType,this._keepDecodedPositions=e.keepDecodedPositions,this._decodedPositions=void 0,this._decodedPositionOffsets=void 0,this._startEllipsoidNormals=void 0,this._endEllipsoidNormals=void 0,this._startPositionAndHeights=void 0,this._startFaceNormalAndVertexCornerIds=void 0,this._endPositionAndHeights=void 0,this._endFaceNormalAndHalfWidths=void 0,this._vertexBatchIds=void 0,this._indices=void 0,this._constantColor=U.clone(U.WHITE),this._highlightColor=this._constantColor,this._trianglesLength=0,this._geometryByteLength=0,this._ready=!1,this._promise=void 0,this._error=void 0}Object.defineProperties(rg.prototype,{trianglesLength:{get:function(){return this._trianglesLength}},geometryByteLength:{get:function(){return this._geometryByteLength}},ready:{get:function(){return this._ready}}});function fut(e,t,n){let i=Pi.getMinimumMaximumHeights(t,n),o=i.minimumTerrainHeight,r=i.maximumTerrainHeight,s=e._minimumMaximumVectorHeights;s.x=o,s.y=r;let a=e._boundingVolume,c=e._rectangle;nn.fromRectangle(c,o,r,n,a)}function put(e){let t=e._rectangle,n=e._minimumHeight,i=e._maximumHeight,o=e._ellipsoid,r=e._center,s=2+re.packedLength+ne.packedLength+h.packedLength,a=new Float64Array(s),c=0;return a[c++]=n,a[c++]=i,re.pack(t,a,c),c+=re.packedLength,ne.pack(o,a,c),c+=ne.packedLength,h.pack(r,a,c),a}var but=new qn("createVectorTileClampedPolylines"),Lx={startEllipsoidNormal:0,endEllipsoidNormal:1,startPositionAndHeight:2,endPositionAndHeight:3,startFaceNormalAndVertexCorner:4,endFaceNormalAndHalfWidth:5,a_batchId:6};function gut(e,t){if(l(e._va))return;let n=e._positions,i=e._widths,o=e._counts,r=e._transferrableBatchIds,s=e._packedBuffer;l(s)||(n=e._positions=n.slice(),i=e._widths=i.slice(),o=e._counts=o.slice(),r=e._transferrableBatchIds=e._batchIds.slice(),s=e._packedBuffer=put(e));let a=[n.buffer,i.buffer,o.buffer,r.buffer,s.buffer],c={positions:n.buffer,widths:i.buffer,counts:o.buffer,batchIds:r.buffer,packedBuffer:s.buffer,keepDecodedPositions:e._keepDecodedPositions},d=but.scheduleTask(c,a);if(l(d))return d.then(function(u){if(e.isDestroyed())return;e._keepDecodedPositions&&(e._decodedPositions=new Float64Array(u.decodedPositions),e._decodedPositionOffsets=new Uint32Array(u.decodedPositionOffsets)),e._startEllipsoidNormals=new Float32Array(u.startEllipsoidNormals),e._endEllipsoidNormals=new Float32Array(u.endEllipsoidNormals),e._startPositionAndHeights=new Float32Array(u.startPositionAndHeights),e._startFaceNormalAndVertexCornerIds=new Float32Array(u.startFaceNormalAndVertexCornerIds),e._endPositionAndHeights=new Float32Array(u.endPositionAndHeights),e._endFaceNormalAndHalfWidths=new Float32Array(u.endFaceNormalAndHalfWidths),e._vertexBatchIds=new Uint16Array(u.vertexBatchIds);let m=u.indexDatatype;e._indices=m===Oe.UNSIGNED_SHORT?new Uint16Array(u.indices):new Uint32Array(u.indices),yut(e,t),e._ready=!0}).catch(u=>{e.isDestroyed()||(e._error=u)})}function yut(e,t){if(!l(e._va)){let n=e._startEllipsoidNormals,i=e._endEllipsoidNormals,o=e._startPositionAndHeights,r=e._endPositionAndHeights,s=e._startFaceNormalAndVertexCornerIds,a=e._endFaceNormalAndHalfWidths,c=e._vertexBatchIds,d=e._indices,u=n.byteLength+i.byteLength;u+=o.byteLength+r.byteLength,u+=s.byteLength+a.byteLength,u+=c.byteLength+d.byteLength,e._trianglesLength=d.length/3,e._geometryByteLength=u;let m=it.createVertexBuffer({context:t,typedArray:n,usage:Pe.STATIC_DRAW}),p=it.createVertexBuffer({context:t,typedArray:i,usage:Pe.STATIC_DRAW}),b=it.createVertexBuffer({context:t,typedArray:o,usage:Pe.STATIC_DRAW}),f=it.createVertexBuffer({context:t,typedArray:r,usage:Pe.STATIC_DRAW}),y=it.createVertexBuffer({context:t,typedArray:s,usage:Pe.STATIC_DRAW}),_=it.createVertexBuffer({context:t,typedArray:a,usage:Pe.STATIC_DRAW}),S=it.createVertexBuffer({context:t,typedArray:c,usage:Pe.STATIC_DRAW}),Z=it.createIndexBuffer({context:t,typedArray:d,usage:Pe.STATIC_DRAW,indexDatatype:d.BYTES_PER_ELEMENT===2?Oe.UNSIGNED_SHORT:Oe.UNSIGNED_INT}),R=[{index:Lx.startEllipsoidNormal,vertexBuffer:m,componentDatatype:J.FLOAT,componentsPerAttribute:3},{index:Lx.endEllipsoidNormal,vertexBuffer:p,componentDatatype:J.FLOAT,componentsPerAttribute:3},{index:Lx.startPositionAndHeight,vertexBuffer:b,componentDatatype:J.FLOAT,componentsPerAttribute:4},{index:Lx.endPositionAndHeight,vertexBuffer:f,componentDatatype:J.FLOAT,componentsPerAttribute:4},{index:Lx.startFaceNormalAndVertexCorner,vertexBuffer:y,componentDatatype:J.FLOAT,componentsPerAttribute:4},{index:Lx.endFaceNormalAndHalfWidth,vertexBuffer:_,componentDatatype:J.FLOAT,componentsPerAttribute:4},{index:Lx.a_batchId,vertexBuffer:S,componentDatatype:J.UNSIGNED_SHORT,componentsPerAttribute:1}];e._va=new Un({context:t,attributes:R,indexBuffer:Z}),e._positions=void 0,e._widths=void 0,e._counts=void 0,e._ellipsoid=void 0,e._minimumHeight=void 0,e._maximumHeight=void 0,e._rectangle=void 0,e._transferrableBatchIds=void 0,e._packedBuffer=void 0,e._startEllipsoidNormals=void 0,e._endEllipsoidNormals=void 0,e._startPositionAndHeights=void 0,e._startFaceNormalAndVertexCornerIds=void 0,e._endPositionAndHeights=void 0,e._endFaceNormalAndHalfWidths=void 0,e._vertexBatchIds=void 0,e._indices=void 0}}var _N=new P,I_e=new h;function xut(e,t){l(e._uniformMap)||(e._uniformMap={u_modifiedModelView:function(){let n=t.uniformState.view;return P.clone(n,_N),P.multiplyByPoint(_N,e._center,I_e),P.setTranslation(_N,I_e,_N),_N},u_highlightColor:function(){return e._highlightColor},u_minimumMaximumVectorHeights:function(){return e._minimumMaximumVectorHeights}})}function P_e(e){return ze.fromCache({cull:{enabled:!0,face:Di.FRONT},blending:on.PRE_MULTIPLIED_ALPHA_BLEND,depthMask:!1,stencilTest:{enabled:e,frontFunction:ii.EQUAL,frontOperation:{fail:Ft.KEEP,zFail:Ft.KEEP,zPass:Ft.KEEP},backFunction:ii.EQUAL,backOperation:{fail:Ft.KEEP,zFail:Ft.KEEP,zPass:Ft.KEEP},reference:Jt.CESIUM_3D_TILE_MASK,mask:Jt.CESIUM_3D_TILE_MASK}})}function Tut(e){l(e._rs)||(e._rs=P_e(!1),e._rs3DTiles=P_e(!0))}function _ut(e,t){if(l(e._sp))return;let n=e._batchTable,i=n.getVertexShaderCallback(!1,"a_batchId",void 0)(f2),o=n.getFragmentShaderCallback(!1,void 0,!0)(h2),r=new Je({defines:["VECTOR_TILE","CLIP_POLYLINE"],sources:[Ul,i]}),s=new Je({defines:["VECTOR_TILE"],sources:[o]});e._sp=tn.fromCache({context:t,vertexShaderSource:r,fragmentShaderSource:s,attributeLocations:Lx})}function Sut(e,t){let n=e._command;if(!l(e._command)){let o=e._batchTable.getUniformMapCallback()(e._uniformMap);n=e._command=new lt({owner:e,vertexArray:e._va,renderState:e._rs,shaderProgram:e._sp,uniformMap:o,boundingVolume:e._boundingVolume,pass:Le.TERRAIN_CLASSIFICATION,pickId:e._batchTable.getPickId()});let r=lt.shallowClone(n,n.derivedCommands.tileset);r.renderState=e._rs3DTiles,r.pass=Le.CESIUM_3D_TILE_CLASSIFICATION,n.derivedCommands.tileset=r}let i=e._classificationType;(i===ni.TERRAIN||i===ni.BOTH)&&t.commandList.push(n),(i===ni.CESIUM_3D_TILE||i===ni.BOTH)&&t.commandList.push(n.derivedCommands.tileset)}rg.prototype.getPositions=function(e){return WS.getPolylinePositions(this,e)};rg.prototype.createFeatures=function(e,t){let n=this._batchIds,i=n.length;for(let o=0;o<i;++o){let r=n[o];t[r]=new ea(e,r)}};rg.prototype.applyDebugSettings=function(e,t){this._highlightColor=e?t:this._constantColor};function Zut(e,t){let n=e._batchIds,i=n.length;for(let o=0;o<i;++o){let r=n[o],s=t[r];s.show=!0,s.color=U.WHITE}}var Rut=new U,Cut=U.WHITE,Vut=!0;rg.prototype.applyStyle=function(e,t){if(!l(e)){Zut(this,t);return}let n=this._batchIds,i=n.length;for(let o=0;o<i;++o){let r=n[o],s=t[r];s.color=l(e.color)?e.color.evaluateColor(s,Rut):Cut,s.show=l(e.show)?e.show.evaluate(s):Vut}};function Eut(e){return Pi.initialize().then(function(){fut(e,e._rectangle,e._ellipsoid)}).catch(t=>{e.isDestroyed()||(e._error=t)})}rg.prototype.update=function(e){let t=e.context;if(!this._ready){if(l(this._promise)||(this._promise=Eut(this).then(gut(this,t))),l(this._error)){let i=this._error;throw this._error=void 0,i}return}xut(this,t),_ut(this,t),Tut(this);let n=e.passes;(n.render||n.pick)&&Sut(this,e)};rg.prototype.isDestroyed=function(){return!1};rg.prototype.destroy=function(){return this._va=this._va&&this._va.destroy(),this._sp=this._sp&&this._sp.destroy(),ue(this)};var SN=rg;var pbi=x(T(),1);var kq=32767,Aut=new pe,Gut=new h;function Lut(e,t,n,i,o){let r=e.length/3,s=e.subarray(0,r),a=e.subarray(r,2*r),c=e.subarray(2*r,3*r);dn.zigZagDeltaDecode(s,a,c);let d=new Float64Array(e.length);for(let u=0;u<r;++u){let m=s[u],p=a[u],b=c[u],f=W.lerp(t.west,t.east,m/kq),y=W.lerp(t.south,t.north,p/kq),_=W.lerp(n,i,b/kq),S=pe.fromRadians(f,y,_,Aut),Z=o.cartographicToCartesian(S,Gut);h.pack(Z,d,u*3)}return d}var ZN=Lut;var Dq=class{constructor(t,n,i,o,r){this._tileset=t,this._tile=n,this._resource=i,this._polygons=void 0,this._polylines=void 0,this._points=void 0,this._metadata=void 0,this._batchTable=void 0,this._features=void 0,this.featurePropertiesDirty=!1,this._group=void 0,this._ready=!1,Put(this,o,r)}get featuresLength(){return l(this._batchTable)?this._batchTable.featuresLength:0}get pointsLength(){return l(this._points)?this._points.pointsLength:0}get trianglesLength(){let t=0;return l(this._polygons)&&(t+=this._polygons.trianglesLength),l(this._polylines)&&(t+=this._polylines.trianglesLength),t}get geometryByteLength(){let t=0;return l(this._polygons)&&(t+=this._polygons.geometryByteLength),l(this._polylines)&&(t+=this._polylines.geometryByteLength),t}get texturesByteLength(){return l(this._points)?this._points.texturesByteLength:0}get batchTableByteLength(){return l(this._batchTable)?this._batchTable.batchTableByteLength:0}get innerContents(){}get ready(){return this._ready}get tileset(){return this._tileset}get tile(){return this._tile}get url(){return this._resource.getUrlComponent(!0)}get metadata(){return this._metadata}set metadata(t){this._metadata=t}get batchTable(){return this._batchTable}get group(){return this._group}set group(t){this._group=t}hasProperty(t,n){return this._batchTable.hasProperty(t,n)}getFeature(t){return l(this._features)||Uq(this),this._features[t]}applyDebugSettings(t,n){l(this._polygons)&&this._polygons.applyDebugSettings(t,n),l(this._polylines)&&this._polylines.applyDebugSettings(t,n),l(this._points)&&this._points.applyDebugSettings(t,n)}applyStyle(t){l(this._features)||Uq(this),l(this._polygons)&&this._polygons.applyStyle(t,this._features),l(this._polylines)&&this._polylines.applyStyle(t,this._features),l(this._points)&&this._points.applyStyle(t,this._features)}update(t,n){let i=!0;l(this._polygons)&&(this._polygons.classificationType=this._tileset.classificationType,this._polygons.debugWireframe=this._tileset.debugWireframe,this._polygons.update(n),i=i&&this._polygons.ready),l(this._polylines)&&(this._polylines.update(n),i=i&&this._polylines.ready),l(this._points)&&(this._points.update(n),i=i&&this._points.ready),l(this._batchTable)&&i&&(l(this._features)||Uq(this),this._batchTable.update(t,n),this._ready=!0)}pick(t,n,i){}getPolylinePositions(t){let n=this._polylines;if(l(n))return n.getPositions(t)}isDestroyed(){return!1}destroy(){return this._polygons=this._polygons&&this._polygons.destroy(),this._polylines=this._polylines&&this._polylines.destroy(),this._points=this._points&&this._points.destroy(),this._batchTable=this._batchTable&&this._batchTable.destroy(),ue(this)}};function Wut(e){return function(t,n){l(e._polygons)&&e._polygons.updateCommands(t,n)}}function vut(e,t){let n,i,o,r,s=e.POLYGONS_LENGTH??0,a=e.POLYLINES_LENGTH??0,c=e.POINTS_LENGTH??0;if(s>0&&l(e.POLYGON_BATCH_IDS)){let p=t.byteOffset+e.POLYGON_BATCH_IDS.byteOffset;n=new Uint16Array(t.buffer,p,s)}if(a>0&&l(e.POLYLINE_BATCH_IDS)){let p=t.byteOffset+e.POLYLINE_BATCH_IDS.byteOffset;i=new Uint16Array(t.buffer,p,a)}if(c>0&&l(e.POINT_BATCH_IDS)){let p=t.byteOffset+e.POINT_BATCH_IDS.byteOffset;o=new Uint16Array(t.buffer,p,c)}let d=l(n)||l(i)||l(o),u=s>0&&!l(n)||a>0&&!l(i)||c>0&&!l(o);if(d&&u)throw new ae("If one group of batch ids is defined, then all batch ids must be defined");if(!l(n)&&!l(i)&&!l(o)){let p=0;if(!l(n)&&s>0)for(n=new Uint16Array(s),r=0;r<s;++r)n[r]=p++;if(!l(i)&&a>0)for(i=new Uint16Array(a),r=0;r<a;++r)i[r]=p++;if(!l(o)&&c>0)for(o=new Uint16Array(c),r=0;r<c;++r)o[r]=p++}return{polygons:n,polylines:i,points:o}}var Sf=Uint32Array.BYTES_PER_ELEMENT;function Fut(e){return new WS(e)}function Iut(e){return new SN(e)}function Put(e,t,n){n=n??0;let i=new Uint8Array(t),o=new DataView(t);n+=Sf;let r=o.getUint32(n,!0);if(r!==1)throw new ae(`Only Vector tile version 1 is supported. Version ${r} is not.`);n+=Sf;let s=o.getUint32(n,!0);if(n+=Sf,s===0){e._ready=!0;return}let a=o.getUint32(n,!0);if(n+=Sf,a===0)throw new ae("Feature table must have a byte length greater than zero");let c=o.getUint32(n,!0);n+=Sf;let d=o.getUint32(n,!0);n+=Sf;let u=o.getUint32(n,!0);n+=Sf;let m=o.getUint32(n,!0);n+=Sf;let p=o.getUint32(n,!0);n+=Sf;let b=o.getUint32(n,!0);n+=Sf,n+=Sf;let f=vr(i,n,a);n+=a;let y=new Uint8Array(t,n,c);n+=c;let _,S;d>0&&(_=vr(i,n,d),n+=d,u>0&&(S=new Uint8Array(t,n,u),S=new Uint8Array(S),n+=u));let Z=f.POLYGONS_LENGTH??0,R=f.POLYLINES_LENGTH??0,C=f.POINTS_LENGTH??0,E=Z+R+C,A=new tf(e,E,_,S,Wut(e));if(e._batchTable=A,E===0)return;let L=new lf(f,y),F=L.getGlobalProperty("REGION");if(!l(F))throw new ae("Feature table global property: REGION must be defined");let I=re.unpack(F),N=F[4],g=F[5],V=e._tile.computedTransform,G=L.getGlobalProperty("RTC_CENTER",J.FLOAT,3);l(G)?(G=h.unpack(G),P.multiplyByPoint(V,G,G)):(G=re.center(I),G.height=W.lerp(N,g,.5),G=ne.WGS84.cartographicToCartesian(G));let v=vut(f,y);if(n+=(4-n%4)%4,Z>0){L.featuresLength=Z;let Y=L.getPropertyArray("POLYGON_COUNTS",J.UNSIGNED_INT,1)??L.getPropertyArray("POLYGON_COUNT",J.UNSIGNED_INT,1);if(!l(Y))throw new ae("Feature table property: POLYGON_COUNTS must be defined when POLYGONS_LENGTH is greater than 0");let D=L.getPropertyArray("POLYGON_INDEX_COUNTS",J.UNSIGNED_INT,1)??L.getPropertyArray("POLYGON_INDEX_COUNT",J.UNSIGNED_INT,1);if(!l(D))throw new ae("Feature table property: POLYGON_INDEX_COUNTS must be defined when POLYGONS_LENGTH is greater than 0");let M=Y.reduce(function(H,$){return H+$*2},0),O=D.reduce(function(H,$){return H+$},0),w=new Uint32Array(t,n,O);n+=m;let z=new Uint16Array(t,n,M);n+=p;let K,te;l(f.POLYGON_MINIMUM_HEIGHTS)&&l(f.POLYGON_MAXIMUM_HEIGHTS)&&(K=L.getPropertyArray("POLYGON_MINIMUM_HEIGHTS",J.FLOAT,1),te=L.getPropertyArray("POLYGON_MAXIMUM_HEIGHTS",J.FLOAT,1)),e._polygons=new xN({positions:z,counts:Y,indexCounts:D,indices:w,minimumHeight:N,maximumHeight:g,polygonMinimumHeights:K,polygonMaximumHeights:te,center:G,rectangle:I,boundingVolume:e.tile.boundingVolume.boundingVolume,batchTable:A,batchIds:v.polygons,modelMatrix:V})}let X=e._tileset;if(R>0){L.featuresLength=R;let Y=L.getPropertyArray("POLYLINE_COUNTS",J.UNSIGNED_INT,1)??L.getPropertyArray("POLYLINE_COUNT",J.UNSIGNED_INT,1);if(!l(Y))throw new ae("Feature table property: POLYLINE_COUNTS must be defined when POLYLINES_LENGTH is greater than 0");let D=L.getPropertyArray("POLYLINE_WIDTHS",J.UNSIGNED_SHORT,1);if(!l(D)){D=new Uint16Array(R);for(let K=0;K<R;++K)D[K]=2}let M=Y.reduce(function(K,te){return K+te*3},0),O=new Uint16Array(t,n,M);n+=b;let w=X.examineVectorLinesFunction;if(l(w)){let K=ZN(new Uint16Array(O),I,N,g,ne.WGS84);Xut(K,Y,v.polylines,A,e.url,w)}let z=Fut;l(X.classificationType)&&(z=Iut),e._polylines=z({positions:O,widths:D,counts:Y,batchIds:v.polylines,minimumHeight:N,maximumHeight:g,center:G,rectangle:I,boundingVolume:e.tile.boundingVolume.boundingVolume,batchTable:A,classificationType:X.classificationType,keepDecodedPositions:X.vectorKeepDecodedPositions})}if(C>0){let Y=new Uint16Array(t,n,C*3);e._points=new yN({positions:Y,batchIds:v.points,minimumHeight:N,maximumHeight:g,rectangle:I,batchTable:A,heightReference:X.heightReference,scene:X.scene})}}function Uq(e){let t=e.featuresLength;if(!l(e._features)&&t>0){let n=new Array(t);l(e._polygons)&&e._polygons.createFeatures(e,n),l(e._polylines)&&e._polylines.createFeatures(e,n),l(e._points)&&e._points.createFeatures(e,n),e._features=n}}function Xut(e,t,n,i,o,r){let s=t.length,a=0;for(let c=0;c<s;c++){let d=t[c]*3,u=e.slice(a,a+d);a+=d,r(u,n[c],o,i)}}var RN=Dq;var Gxi=x(T(),1);var wbi=x(T(),1);var{ERR_CAPACITY:Ybi}=na.Error,Nut=new h,XB=class XB extends rs{constructor(){super(...arguments);mt(this,"_collection",null)}static clone(n,i){return super.clone(n,i),i.setPosition(n.getPosition(Nut)),i}get vertexOffset(){return this._getUint32(XB.Layout.POSITION_OFFSET_U32)}get vertexCount(){return 1}getPosition(n){let i=this._collection._positionView;return h.fromArray(i,this.vertexOffset*3,n)}setPosition(n){let i=this._collection,o=this.vertexOffset;i._positionView[o*3]=n.x,i._positionView[o*3+1]=n.y,i._positionView[o*3+2]=n.z,this._dirty=!0,i._makeDirtyBoundingVolume()}toJSON(){return{...super.toJSON(),position:h.pack(this.getPosition(),[])}}};mt(XB,"Layout",{...rs.Layout,POSITION_OFFSET_U32:rs.Layout.__BYTE_LENGTH,__BYTE_LENGTH:rs.Layout.__BYTE_LENGTH+4});var Oq=XB,Xc=Oq;var Zgi=x(T(),1);var pgi=x(T(),1);var Bbi=x(T(),1);var CN=class CN extends $l{constructor(t=B.EMPTY_OBJECT){super(t),this.size=t.size??1}static pack(t,n,i){super.pack(t,n,i),n.setUint8(this.Layout.SIZE_U8+i,t.size)}static unpack(t,n,i){return super.unpack(t,n,i),i.size=t.getUint8(this.Layout.SIZE_U8+n),i}toJSON(){return{...super.toJSON(),size:this.size}}};mt(CN,"Layout",{...$l.Layout,SIZE_U8:$l.Layout.__BYTE_LENGTH,__BYTE_LENGTH:$l.Layout.__BYTE_LENGTH+4}),mt(CN,"DEFAULT_MATERIAL",Object.freeze(new CN));var Bq=CN,Zf=Bq;var zq={positionHigh:0,positionLow:1,pickColor:2,showSizeColorAlpha:3,outlineWidthColorAlpha:4},X_e={position:0,pickColor:1,showSizeColorAlpha:2,outlineWidthColorAlpha:3},vS=new Xc,Rf=new Zf,VN=new U,N_e=new h,Hq=new An;function Yut(e,t,n){let i=t.context;n=n||{destroy:Mut};let o=e._positionDatatype===J.DOUBLE,r=o?zq:X_e;if(!l(n.attributeArrays)){let a=e.primitiveCountMax;n.attributeArrays={...o?{positionHigh:new Float32Array(a*3),positionLow:new Float32Array(a*3)}:{position:e._positionView},pickColor:new Uint8Array(a*4),showSizeColorAlpha:new Float32Array(a*4),outlineWidthColorAlpha:new Float32Array(a*3)}}if(e._dirtyCount>0){let{attributeArrays:a}=n,c=a.positionHigh,d=a.positionLow,u=a.pickColor,m=a.showSizeColorAlpha,p=a.outlineWidthColorAlpha,{_dirtyOffset:b,_dirtyCount:f}=e;for(let y=b,_=b+f;y<_;y++)e.get(y,vS),vS._dirty&&(o&&(vS.getPosition(N_e),An.fromCartesian(N_e,Hq),h.pack(Hq.high,c,y*3),h.pack(Hq.low,d,y*3)),vS.getMaterial(Rf),U.fromRgba(vS._pickId,VN),u[y*4]=U.floatToByte(VN.red),u[y*4+1]=U.floatToByte(VN.green),u[y*4+2]=U.floatToByte(VN.blue),u[y*4+3]=U.floatToByte(VN.alpha),m[y*4]=vS.show?1:0,m[y*4+1]=Rf.size,m[y*4+2]=dn.encodeRGB8(Rf.color),m[y*4+3]=Rf.color.alpha,p[y*3]=Rf.outlineWidth,p[y*3+1]=dn.encodeRGB8(Rf.outlineWidth>0?Rf.outlineColor:Rf.color),p[y*3+2]=Rf.outlineWidth>0?Rf.outlineColor.alpha:Rf.color.alpha,vS._dirty=!1)}if(l(n.vertexArray)){if(e._dirtyCount>0){for(let a in r)if(Object.hasOwn(r,a)){let c=a;n.vertexArray.copyAttributeFromRange(r[c],n.attributeArrays[c],e._dirtyOffset,e._dirtyCount)}}}else{let{attributeArrays:a}=n;n.vertexArray=new Un({context:i,attributes:[...o?[{index:zq.positionHigh,componentDatatype:J.FLOAT,componentsPerAttribute:3,vertexBuffer:it.createVertexBuffer({typedArray:a.positionHigh,context:i,usage:Pe.STATIC_DRAW})},{index:zq.positionLow,componentDatatype:J.FLOAT,componentsPerAttribute:3,vertexBuffer:it.createVertexBuffer({typedArray:a.positionLow,context:i,usage:Pe.STATIC_DRAW})}]:[{index:X_e.position,componentDatatype:e._positionDatatype,componentsPerAttribute:3,normalize:e._positionNormalized,vertexBuffer:it.createVertexBuffer({typedArray:e._positionView,context:i,usage:Pe.STATIC_DRAW})}],{index:r.pickColor,componentDatatype:J.UNSIGNED_BYTE,componentsPerAttribute:4,vertexBuffer:it.createVertexBuffer({typedArray:a.pickColor,context:i,usage:Pe.STATIC_DRAW})},{index:r.showSizeColorAlpha,componentDatatype:J.FLOAT,componentsPerAttribute:4,vertexBuffer:it.createVertexBuffer({typedArray:a.showSizeColorAlpha,context:i,usage:Pe.STATIC_DRAW})},{index:r.outlineWidthColorAlpha,componentDatatype:J.FLOAT,componentsPerAttribute:3,vertexBuffer:it.createVertexBuffer({typedArray:a.outlineWidthColorAlpha,context:i,usage:Pe.STATIC_DRAW})}]})}l(n.renderState)||(n.renderState=ze.fromCache({blending:e._blendOption===Yi.OPAQUE?on.DISABLED:on.ALPHA_BLEND,depthTest:{enabled:!0}})),l(n.shaderProgram)||(n.shaderProgram=tn.fromCache({context:i,vertexShaderSource:new Je({sources:[Av],defines:o?["USE_FLOAT64"]:[]}),fragmentShaderSource:new Je({sources:[Ev]}),attributeLocations:r})),l(n.command)||(n.command=new lt({vertexArray:n.vertexArray,renderState:n.renderState,shaderProgram:n.shaderProgram,primitiveType:Ie.POINTS,pass:e._blendOption===Yi.OPAQUE?Le.OPAQUE:Le.TRANSLUCENT,pickId:e._allowPicking?"v_pickColor":void 0,owner:e,count:e.primitiveCount,modelMatrix:e.modelMatrix,boundingVolume:e.boundingVolume,debugShowBoundingVolume:e.debugShowBoundingVolume}));let s=n.command;return s.count!==e.primitiveCount&&(s.count=e.primitiveCount),s.debugShowBoundingVolume!==e.debugShowBoundingVolume&&(s.debugShowBoundingVolume=e.debugShowBoundingVolume),t.commandList.push(s),e._makeClean(),n}function Mut(){let e=this;l(e.vertexArray)&&e.vertexArray.destroy(),l(e.shaderProgram)&&e.shaderProgram.destroy(),l(e.renderState)&&ze.removeFromCache(e.renderState)}var EN=Yut;var Kq=class e extends na{constructor(t=B.EMPTY_OBJECT){super({...t,vertexCountMax:t.primitiveCountMax})}_getCollectionClass(){return e}_getPrimitiveClass(){return Xc}_getMaterialClass(){return Zf}_cloneEmpty(t=B.EMPTY_OBJECT){return new e(this._cloneEmptyBaseArgs(t))}add(t,n=new Xc){return super.add(t,n),n._setUint32(Xc.Layout.POSITION_OFFSET_U32,this._positionCount++),n.setPosition(t.position??h.ZERO),n}update(t){super.update(t);let n=t.passes;this.show&&(n.render||n.pick)&&(this._renderContext=EN(this,t,this._renderContext))}},zd=Kq;var nyi=x(T(),1);var Kgi=x(T(),1);var FS={positionHigh:0,positionLow:1,prevPositionHigh:2,prevPositionLow:3,nextPositionHigh:4,nextPositionLow:5,pickColor:6,showColorWidthAndTexCoord:7,alpha:8},NB={position:0,prevPosition:1,nextPosition:2,pickColor:3,showColorWidthAndTexCoord:4,alpha:5},ul=new ya,AN=new Wu,GN=new U,Y_e=new h,M_e=new h,w_e=new h,Jq=new An,jq=new An,Qq=new An;function wut(e,t,n){let i=t.context;n=n||{destroy:Dut};let o=e._positionDatatype===J.DOUBLE,r=o?FS:NB;if(!l(n.attributeArrays)||!l(n.indexArray)){let c=e.vertexCountMax-e.primitiveCount,d=e.vertexCountMax*2;n.indexArray=Oe.createTypedArray(d,c*6),n.attributeArrays={...o?{positionHigh:new Float32Array(d*3),positionLow:new Float32Array(d*3),prevPositionHigh:new Float32Array(d*3),prevPositionLow:new Float32Array(d*3),nextPositionHigh:new Float32Array(d*3),nextPositionLow:new Float32Array(d*3)}:{position:J.createTypedArray(e._positionDatatype,d*3),prevPosition:J.createTypedArray(e._positionDatatype,d*3),nextPosition:J.createTypedArray(e._positionDatatype,d*3)},pickColor:new Uint8Array(d*4),showColorWidthAndTexCoord:new Float32Array(d*4),alpha:new Uint8Array(d)}}if(e._dirtyCount>0){let{_dirtyOffset:c,_dirtyCount:d}=e,u=e.widthUnits==="meters",m=n.indexArray,{pickColor:p,showColorWidthAndTexCoord:b,alpha:f,position:y,prevPosition:_,nextPosition:S,positionHigh:Z,positionLow:R,prevPositionHigh:C,prevPositionLow:E,nextPositionHigh:A,nextPositionLow:L}=n.attributeArrays;for(let F=c,I=c+d;F<I;F++){if(e.get(F,ul),!ul._dirty)continue;ul.getMaterial(AN);let N=dn.encodeRGB8(AN.color),g=AN.color.alpha,V=u?-AN.width:AN.width;U.fromRgba(ul._pickId,GN);let G=ul.show,v=ul.vertexOffset*2,X=(ul.vertexOffset-F)*6,Y=e._positionView,D=ul.vertexOffset*3;for(let M=0,O=ul.vertexCount;M<O;M++){let w=M===0,z=M===O-1,K=Y[D+M*3],te=Y[D+M*3+1],H=Y[D+M*3+2],$,ee,le,_e,he,Ze;w?(_e=Y[D+3],he=Y[D+3+1],Ze=Y[D+3+2],$=2*K-_e,ee=2*te-he,le=2*H-Ze):z?($=Y[D+(M-1)*3],ee=Y[D+(M-1)*3+1],le=Y[D+(M-1)*3+2],_e=2*K-$,he=2*te-ee,Ze=2*H-le):($=Y[D+(M-1)*3],ee=Y[D+(M-1)*3+1],le=Y[D+(M-1)*3+2],_e=Y[D+(M+1)*3],he=Y[D+(M+1)*3+1],Ze=Y[D+(M+1)*3+2]),z||(m[X]=v,m[X+1]=v+1,m[X+2]=v+2,m[X+3]=v+2,m[X+4]=v+1,m[X+5]=v+3,X+=6),o&&(h.fromElements(K,te,H,Y_e),h.fromElements($,ee,le,M_e),h.fromElements(_e,he,Ze,w_e),An.fromCartesian(Y_e,Jq),An.fromCartesian(M_e,jq),An.fromCartesian(w_e,Qq));for(let ye=0;ye<2;ye++)o?(h.pack(Jq.high,Z,v*3),h.pack(Jq.low,R,v*3),h.pack(jq.high,C,v*3),h.pack(jq.low,E,v*3),h.pack(Qq.high,A,v*3),h.pack(Qq.low,L,v*3)):(y[v*3]=K,y[v*3+1]=te,y[v*3+2]=H,_[v*3]=$,_[v*3+1]=ee,_[v*3+2]=le,S[v*3]=_e,S[v*3+1]=he,S[v*3+2]=Ze),p[v*4]=U.floatToByte(GN.red),p[v*4+1]=U.floatToByte(GN.green),p[v*4+2]=U.floatToByte(GN.blue),p[v*4+3]=U.floatToByte(GN.alpha),b[v*4]=G?1:0,b[v*4+1]=N,b[v*4+2]=V,b[v*4+3]=M/(O-1),f[v]=g*255,v++}ul._dirty=!1}}if(l(n.vertexArray)){if(e._dirtyCount>0){let{indexOffset:c,indexCount:d,vertexOffset:u,vertexCount:m}=Uut(e);n.vertexArray.copyIndexFromRange(n.indexArray,c,d);for(let p in r)if(Object.hasOwn(r,p)){let b=p;n.vertexArray.copyAttributeFromRange(r[b],n.attributeArrays[b],u,m)}}}else{let c=n.attributeArrays;n.vertexArray=new Un({context:i,indexBuffer:it.createIndexBuffer({context:i,typedArray:n.indexArray,usage:Pe.STATIC_DRAW,indexDatatype:Oe.fromTypedArray(n.indexArray)}),attributes:[...o?[{index:FS.positionHigh,componentDatatype:J.FLOAT,componentsPerAttribute:3,vertexBuffer:it.createVertexBuffer({typedArray:c.positionHigh,context:i,usage:Pe.STATIC_DRAW})},{index:FS.positionLow,componentDatatype:J.FLOAT,componentsPerAttribute:3,vertexBuffer:it.createVertexBuffer({typedArray:c.positionLow,context:i,usage:Pe.STATIC_DRAW})},{index:FS.prevPositionHigh,componentDatatype:J.FLOAT,componentsPerAttribute:3,vertexBuffer:it.createVertexBuffer({typedArray:c.prevPositionHigh,context:i,usage:Pe.STATIC_DRAW})},{index:FS.prevPositionLow,componentDatatype:J.FLOAT,componentsPerAttribute:3,vertexBuffer:it.createVertexBuffer({typedArray:c.prevPositionLow,context:i,usage:Pe.STATIC_DRAW})},{index:FS.nextPositionHigh,componentDatatype:J.FLOAT,componentsPerAttribute:3,vertexBuffer:it.createVertexBuffer({typedArray:c.nextPositionHigh,context:i,usage:Pe.STATIC_DRAW})},{index:FS.nextPositionLow,componentDatatype:J.FLOAT,componentsPerAttribute:3,vertexBuffer:it.createVertexBuffer({typedArray:c.nextPositionLow,context:i,usage:Pe.STATIC_DRAW})}]:[{index:NB.position,componentDatatype:e._positionDatatype,componentsPerAttribute:3,normalize:e._positionNormalized,vertexBuffer:it.createVertexBuffer({typedArray:c.position,context:i,usage:Pe.STATIC_DRAW})},{index:NB.prevPosition,componentDatatype:e._positionDatatype,componentsPerAttribute:3,normalize:e._positionNormalized,vertexBuffer:it.createVertexBuffer({typedArray:c.prevPosition,context:i,usage:Pe.STATIC_DRAW})},{index:NB.nextPosition,componentDatatype:e._positionDatatype,componentsPerAttribute:3,normalize:e._positionNormalized,vertexBuffer:it.createVertexBuffer({typedArray:c.nextPosition,context:i,usage:Pe.STATIC_DRAW})}],{index:r.pickColor,componentDatatype:J.UNSIGNED_BYTE,componentsPerAttribute:4,vertexBuffer:it.createVertexBuffer({typedArray:c.pickColor,context:i,usage:Pe.STATIC_DRAW})},{index:r.showColorWidthAndTexCoord,componentDatatype:J.FLOAT,componentsPerAttribute:4,vertexBuffer:it.createVertexBuffer({typedArray:c.showColorWidthAndTexCoord,context:i,usage:Pe.STATIC_DRAW})},{index:r.alpha,componentDatatype:J.UNSIGNED_BYTE,componentsPerAttribute:1,vertexBuffer:it.createVertexBuffer({typedArray:c.alpha,context:i,usage:Pe.STATIC_DRAW})}]})}l(n.renderState)||(n.renderState=ze.fromCache({blending:e._blendOption===Yi.OPAQUE?on.DISABLED:on.ALPHA_BLEND,depthTest:{enabled:!0}})),l(n.shaderProgram)||(n.shaderProgram=tn.fromCache({context:i,vertexShaderSource:new Je({sources:[Ul,vv],defines:o?["USE_FLOAT64"]:[]}),fragmentShaderSource:new Je({sources:[Wv]}),attributeLocations:r}));let s=kut(e);l(n.command)||(n.command=new lt({vertexArray:n.vertexArray,renderState:n.renderState,shaderProgram:n.shaderProgram,primitiveType:Ie.TRIANGLES,pass:e._blendOption===Yi.OPAQUE?Le.OPAQUE:Le.TRANSLUCENT,pickId:e._allowPicking?"v_pickColor":void 0,owner:e,count:s,modelMatrix:e.modelMatrix,boundingVolume:e.boundingVolume,debugShowBoundingVolume:e.debugShowBoundingVolume}));let a=n.command;return a.count!==s&&(a.count=s),a.debugShowBoundingVolume!==e.debugShowBoundingVolume&&(a.debugShowBoundingVolume=e.debugShowBoundingVolume),t.commandList.push(a),e._makeClean(),n}function kut(e){return(e.vertexCount-e.primitiveCount)*6}function Uut(e){let{_dirtyOffset:t,_dirtyCount:n}=e;e.get(t,ul);let i=ul.vertexOffset*2,r=(ul.vertexOffset-t)*6;e.get(t+n-1,ul);let s=(ul.vertexOffset+ul.vertexCount)*2-i,c=(s/2-n)*6;return{indexOffset:r,indexCount:c,vertexOffset:i,vertexCount:s}}function Dut(){let e=this;l(e.vertexArray)&&e.vertexArray.destroy(),l(e.shaderProgram)&&e.shaderProgram.destroy(),l(e.renderState)&&ze.removeFromCache(e.renderState)}var LN=wut;var qq=class e extends na{constructor(t=B.EMPTY_OBJECT){super(t);let n=t.widthUnits??"pixels";this._widthUnits=n}get widthUnits(){return this._widthUnits}_getCollectionClass(){return e}_getPrimitiveClass(){return ya}_getMaterialClass(){return Wu}_cloneEmpty(t=B.EMPTY_OBJECT){return new e({widthUnits:this._widthUnits,...this._cloneEmptyBaseArgs(t)})}add(t,n=new ya){super.add(t,n);let i=this._positionCount;return n._setUint32(ya.Layout.POSITION_OFFSET_U32,i),n._setUint32(ya.Layout.POSITION_COUNT_U32,0),l(t.positions)&&n.setPositions(t.positions),n}update(t){super.update(t),this._isRendered(t)&&(this._renderContext=LN(this,t,this._renderContext))}},ml=qq;var gyi=x(T(),1);var cyi=x(T(),1);function nV(e,t){this._conditionsExpression=$e(e,!0),this._conditions=e.conditions,this._runtimeConditions=void 0,But(this,t)}Object.defineProperties(nV.prototype,{conditionsExpression:{get:function(){return this._conditionsExpression}}});function Out(e,t){this.condition=e,this.expression=t}function But(e,t){let n=[],i=e._conditions;if(!l(i))return;let o=i.length;for(let r=0;r<o;++r){let s=i[r],a=String(s[0]),c=String(s[1]);n.push(new Out(new Fm(a,t),new Fm(c,t)))}e._runtimeConditions=n}nV.prototype.evaluate=function(e,t){let n=this._runtimeConditions;if(!l(n))return;let i=n.length;for(let o=0;o<i;++o){let r=n[o];if(r.condition.evaluate(e))return r.expression.evaluate(e,t)}};nV.prototype.evaluateColor=function(e,t){let n=this._runtimeConditions;if(!l(n))return;let i=n.length;for(let o=0;o<i;++o){let r=n[o];if(r.condition.evaluate(e))return r.expression.evaluateColor(e,t)}};nV.prototype.getShaderFunction=function(e,t,n,i){let o=this._runtimeConditions;if(!l(o)||o.length===0)return;let r="",s=o.length;for(let a=0;a<s;++a){let c=o[a],d=c.condition.getShaderExpression(t,n),u=c.expression.getShaderExpression(t,n);r+=` ${a===0?"if":"else if"} (${d}) +`;function qpt(e,t){if(l(e._sp))return;let n=e._batchTable,i=n.getVertexShaderCallback(!1,"a_batchId",void 0)(p2),o=n.getFragmentShaderCallback(!1,void 0,!1)(Qpt),r=new Je({defines:["VECTOR_TILE","CLIP_POLYLINE"],sources:[Ul,i]}),s=new Je({defines:["VECTOR_TILE"],sources:[o]});e._sp=tn.fromCache({context:t,vertexShaderSource:r,fragmentShaderSource:s,attributeLocations:PV})}function $pt(e,t){if(!l(e._command)){let n=e._batchTable.getUniformMapCallback()(e._uniformMap);e._command=new lt({owner:e,vertexArray:e._va,renderState:e._rs,shaderProgram:e._sp,uniformMap:n,boundingVolume:e._boundingVolume,pass:Le.TRANSLUCENT,pickId:e._batchTable.getPickId()})}t.commandList.push(e._command)}vf.getPolylinePositions=function(e,t){let n=e._batchIds,i=e._decodedPositions,o=e._decodedPositionOffsets;if(!l(n)||!l(i))return;let r,s,a=n.length,c=0,d=0;for(r=0;r<a;++r)n[r]===t&&(c+=o[r+1]-o[r]);if(c===0)return;let u=new Float64Array(c*3);for(r=0;r<a;++r)if(n[r]===t){let m=o[r],p=o[r+1]-m;for(s=0;s<p;++s){let b=(m+s)*3;u[d++]=i[b],u[d++]=i[b+1],u[d++]=i[b+2]}}return u};vf.prototype.getPositions=function(e){return vf.getPolylinePositions(this,e)};vf.prototype.createFeatures=function(e,t){let n=this._batchIds,i=n.length;for(let o=0;o<i;++o){let r=n[o];t[r]=new ia(e,r)}};vf.prototype.applyDebugSettings=function(e,t){this._highlightColor=e?t:this._constantColor};function e0t(e,t){let n=e._batchIds,i=n.length;for(let o=0;o<i;++o){let r=n[o],s=t[r];s.show=!0,s.color=U.WHITE}}var t0t=new U,n0t=U.WHITE,i0t=!0;vf.prototype.applyStyle=function(e,t){if(!l(e)){e0t(this,t);return}let n=this._batchIds,i=n.length;for(let o=0;o<i;++o){let r=n[o],s=t[r];s.color=l(e.color)?e.color.evaluateColor(s,t0t):n0t,s.show=l(e.show)?e.show.evaluate(s):i0t}};vf.prototype.update=function(e){let t=e.context;if(!this._ready){if(l(this._promise)||(this._promise=Hpt(this,t)),l(this._error)){let i=this._error;throw this._error=void 0,i}return}Jpt(this,t),qpt(this,t),jpt(this);let n=e.passes;(n.render||n.pick)&&$pt(this,e)};vf.prototype.isDestroyed=function(){return!1};vf.prototype.destroy=function(){return this._va=this._va&&this._va.destroy(),this._sp=this._sp&&this._sp.destroy(),ue(this)};var jS=vf;var ovi=x(T(),1);function pg(e){this._positions=e.positions,this._widths=e.widths,this._counts=e.counts,this._batchIds=e.batchIds,this._ellipsoid=e.ellipsoid??ne.WGS84,this._minimumHeight=e.minimumHeight,this._maximumHeight=e.maximumHeight,this._center=e.center,this._rectangle=e.rectangle,this._batchTable=e.batchTable,this._va=void 0,this._sp=void 0,this._rs=void 0,this._uniformMap=void 0,this._command=void 0,this._transferrableBatchIds=void 0,this._packedBuffer=void 0,this._minimumMaximumVectorHeights=new k(Pi._defaultMinTerrainHeight,Pi._defaultMaxTerrainHeight),this._boundingVolume=nn.fromRectangle(e.rectangle,Pi._defaultMinTerrainHeight,Pi._defaultMaxTerrainHeight,this._ellipsoid),this._classificationType=e.classificationType,this._keepDecodedPositions=e.keepDecodedPositions,this._decodedPositions=void 0,this._decodedPositionOffsets=void 0,this._startEllipsoidNormals=void 0,this._endEllipsoidNormals=void 0,this._startPositionAndHeights=void 0,this._startFaceNormalAndVertexCornerIds=void 0,this._endPositionAndHeights=void 0,this._endFaceNormalAndHalfWidths=void 0,this._vertexBatchIds=void 0,this._indices=void 0,this._constantColor=U.clone(U.WHITE),this._highlightColor=this._constantColor,this._trianglesLength=0,this._geometryByteLength=0,this._ready=!1,this._promise=void 0,this._error=void 0}Object.defineProperties(pg.prototype,{trianglesLength:{get:function(){return this._trianglesLength}},geometryByteLength:{get:function(){return this._geometryByteLength}},ready:{get:function(){return this._ready}}});function o0t(e,t,n){let i=Pi.getMinimumMaximumHeights(t,n),o=i.minimumTerrainHeight,r=i.maximumTerrainHeight,s=e._minimumMaximumVectorHeights;s.x=o,s.y=r;let a=e._boundingVolume,c=e._rectangle;nn.fromRectangle(c,o,r,n,a)}function r0t(e){let t=e._rectangle,n=e._minimumHeight,i=e._maximumHeight,o=e._ellipsoid,r=e._center,s=2+re.packedLength+ne.packedLength+h.packedLength,a=new Float64Array(s),c=0;return a[c++]=n,a[c++]=i,re.pack(t,a,c),c+=re.packedLength,ne.pack(o,a,c),c+=ne.packedLength,h.pack(r,a,c),a}var s0t=new qn("createVectorTileClampedPolylines"),Nx={startEllipsoidNormal:0,endEllipsoidNormal:1,startPositionAndHeight:2,endPositionAndHeight:3,startFaceNormalAndVertexCorner:4,endFaceNormalAndHalfWidth:5,a_batchId:6};function a0t(e,t){if(l(e._va))return;let n=e._positions,i=e._widths,o=e._counts,r=e._transferrableBatchIds,s=e._packedBuffer;l(s)||(n=e._positions=n.slice(),i=e._widths=i.slice(),o=e._counts=o.slice(),r=e._transferrableBatchIds=e._batchIds.slice(),s=e._packedBuffer=r0t(e));let a=[n.buffer,i.buffer,o.buffer,r.buffer,s.buffer],c={positions:n.buffer,widths:i.buffer,counts:o.buffer,batchIds:r.buffer,packedBuffer:s.buffer,keepDecodedPositions:e._keepDecodedPositions},d=s0t.scheduleTask(c,a);if(l(d))return d.then(function(u){if(e.isDestroyed())return;e._keepDecodedPositions&&(e._decodedPositions=new Float64Array(u.decodedPositions),e._decodedPositionOffsets=new Uint32Array(u.decodedPositionOffsets)),e._startEllipsoidNormals=new Float32Array(u.startEllipsoidNormals),e._endEllipsoidNormals=new Float32Array(u.endEllipsoidNormals),e._startPositionAndHeights=new Float32Array(u.startPositionAndHeights),e._startFaceNormalAndVertexCornerIds=new Float32Array(u.startFaceNormalAndVertexCornerIds),e._endPositionAndHeights=new Float32Array(u.endPositionAndHeights),e._endFaceNormalAndHalfWidths=new Float32Array(u.endFaceNormalAndHalfWidths),e._vertexBatchIds=new Uint16Array(u.vertexBatchIds);let m=u.indexDatatype;e._indices=m===Oe.UNSIGNED_SHORT?new Uint16Array(u.indices):new Uint32Array(u.indices),c0t(e,t),e._ready=!0}).catch(u=>{e.isDestroyed()||(e._error=u)})}function c0t(e,t){if(!l(e._va)){let n=e._startEllipsoidNormals,i=e._endEllipsoidNormals,o=e._startPositionAndHeights,r=e._endPositionAndHeights,s=e._startFaceNormalAndVertexCornerIds,a=e._endFaceNormalAndHalfWidths,c=e._vertexBatchIds,d=e._indices,u=n.byteLength+i.byteLength;u+=o.byteLength+r.byteLength,u+=s.byteLength+a.byteLength,u+=c.byteLength+d.byteLength,e._trianglesLength=d.length/3,e._geometryByteLength=u;let m=it.createVertexBuffer({context:t,typedArray:n,usage:Pe.STATIC_DRAW}),p=it.createVertexBuffer({context:t,typedArray:i,usage:Pe.STATIC_DRAW}),b=it.createVertexBuffer({context:t,typedArray:o,usage:Pe.STATIC_DRAW}),f=it.createVertexBuffer({context:t,typedArray:r,usage:Pe.STATIC_DRAW}),y=it.createVertexBuffer({context:t,typedArray:s,usage:Pe.STATIC_DRAW}),_=it.createVertexBuffer({context:t,typedArray:a,usage:Pe.STATIC_DRAW}),S=it.createVertexBuffer({context:t,typedArray:c,usage:Pe.STATIC_DRAW}),Z=it.createIndexBuffer({context:t,typedArray:d,usage:Pe.STATIC_DRAW,indexDatatype:d.BYTES_PER_ELEMENT===2?Oe.UNSIGNED_SHORT:Oe.UNSIGNED_INT}),R=[{index:Nx.startEllipsoidNormal,vertexBuffer:m,componentDatatype:J.FLOAT,componentsPerAttribute:3},{index:Nx.endEllipsoidNormal,vertexBuffer:p,componentDatatype:J.FLOAT,componentsPerAttribute:3},{index:Nx.startPositionAndHeight,vertexBuffer:b,componentDatatype:J.FLOAT,componentsPerAttribute:4},{index:Nx.endPositionAndHeight,vertexBuffer:f,componentDatatype:J.FLOAT,componentsPerAttribute:4},{index:Nx.startFaceNormalAndVertexCorner,vertexBuffer:y,componentDatatype:J.FLOAT,componentsPerAttribute:4},{index:Nx.endFaceNormalAndHalfWidth,vertexBuffer:_,componentDatatype:J.FLOAT,componentsPerAttribute:4},{index:Nx.a_batchId,vertexBuffer:S,componentDatatype:J.UNSIGNED_SHORT,componentsPerAttribute:1}];e._va=new Un({context:t,attributes:R,indexBuffer:Z}),e._positions=void 0,e._widths=void 0,e._counts=void 0,e._ellipsoid=void 0,e._minimumHeight=void 0,e._maximumHeight=void 0,e._rectangle=void 0,e._transferrableBatchIds=void 0,e._packedBuffer=void 0,e._startEllipsoidNormals=void 0,e._endEllipsoidNormals=void 0,e._startPositionAndHeights=void 0,e._startFaceNormalAndVertexCornerIds=void 0,e._endPositionAndHeights=void 0,e._endFaceNormalAndHalfWidths=void 0,e._vertexBatchIds=void 0,e._indices=void 0}}var bY=new P,XRe=new h;function l0t(e,t){l(e._uniformMap)||(e._uniformMap={u_modifiedModelView:function(){let n=t.uniformState.view;return P.clone(n,bY),P.multiplyByPoint(bY,e._center,XRe),P.setTranslation(bY,XRe,bY),bY},u_highlightColor:function(){return e._highlightColor},u_minimumMaximumVectorHeights:function(){return e._minimumMaximumVectorHeights}})}function NRe(e){return ze.fromCache({cull:{enabled:!0,face:Ui.FRONT},blending:on.PRE_MULTIPLIED_ALPHA_BLEND,depthMask:!1,stencilTest:{enabled:e,frontFunction:ni.EQUAL,frontOperation:{fail:Ft.KEEP,zFail:Ft.KEEP,zPass:Ft.KEEP},backFunction:ni.EQUAL,backOperation:{fail:Ft.KEEP,zFail:Ft.KEEP,zPass:Ft.KEEP},reference:Jt.CESIUM_3D_TILE_MASK,mask:Jt.CESIUM_3D_TILE_MASK}})}function d0t(e){l(e._rs)||(e._rs=NRe(!1),e._rs3DTiles=NRe(!0))}function u0t(e,t){if(l(e._sp))return;let n=e._batchTable,i=n.getVertexShaderCallback(!1,"a_batchId",void 0)(f2),o=n.getFragmentShaderCallback(!1,void 0,!0)(h2),r=new Je({defines:["VECTOR_TILE","CLIP_POLYLINE"],sources:[Ul,i]}),s=new Je({defines:["VECTOR_TILE"],sources:[o]});e._sp=tn.fromCache({context:t,vertexShaderSource:r,fragmentShaderSource:s,attributeLocations:Nx})}function m0t(e,t){let n=e._command;if(!l(e._command)){let o=e._batchTable.getUniformMapCallback()(e._uniformMap);n=e._command=new lt({owner:e,vertexArray:e._va,renderState:e._rs,shaderProgram:e._sp,uniformMap:o,boundingVolume:e._boundingVolume,pass:Le.TERRAIN_CLASSIFICATION,pickId:e._batchTable.getPickId()});let r=lt.shallowClone(n,n.derivedCommands.tileset);r.renderState=e._rs3DTiles,r.pass=Le.CESIUM_3D_TILE_CLASSIFICATION,n.derivedCommands.tileset=r}let i=e._classificationType;(i===ti.TERRAIN||i===ti.BOTH)&&t.commandList.push(n),(i===ti.CESIUM_3D_TILE||i===ti.BOTH)&&t.commandList.push(n.derivedCommands.tileset)}pg.prototype.getPositions=function(e){return jS.getPolylinePositions(this,e)};pg.prototype.createFeatures=function(e,t){let n=this._batchIds,i=n.length;for(let o=0;o<i;++o){let r=n[o];t[r]=new ia(e,r)}};pg.prototype.applyDebugSettings=function(e,t){this._highlightColor=e?t:this._constantColor};function h0t(e,t){let n=e._batchIds,i=n.length;for(let o=0;o<i;++o){let r=n[o],s=t[r];s.show=!0,s.color=U.WHITE}}var f0t=new U,p0t=U.WHITE,b0t=!0;pg.prototype.applyStyle=function(e,t){if(!l(e)){h0t(this,t);return}let n=this._batchIds,i=n.length;for(let o=0;o<i;++o){let r=n[o],s=t[r];s.color=l(e.color)?e.color.evaluateColor(s,f0t):p0t,s.show=l(e.show)?e.show.evaluate(s):b0t}};function g0t(e){return Pi.initialize().then(function(){o0t(e,e._rectangle,e._ellipsoid)}).catch(t=>{e.isDestroyed()||(e._error=t)})}pg.prototype.update=function(e){let t=e.context;if(!this._ready){if(l(this._promise)||(this._promise=g0t(this).then(a0t(this,t))),l(this._error)){let i=this._error;throw this._error=void 0,i}return}l0t(this,t),u0t(this,t),d0t(this);let n=e.passes;(n.render||n.pick)&&m0t(this,e)};pg.prototype.isDestroyed=function(){return!1};pg.prototype.destroy=function(){return this._va=this._va&&this._va.destroy(),this._sp=this._sp&&this._sp.destroy(),ue(this)};var gY=pg;var dvi=x(T(),1);var X$=32767,y0t=new pe,x0t=new h;function T0t(e,t,n,i,o){let r=e.length/3,s=e.subarray(0,r),a=e.subarray(r,2*r),c=e.subarray(2*r,3*r);dn.zigZagDeltaDecode(s,a,c);let d=new Float64Array(e.length);for(let u=0;u<r;++u){let m=s[u],p=a[u],b=c[u],f=W.lerp(t.west,t.east,m/X$),y=W.lerp(t.south,t.north,p/X$),_=W.lerp(n,i,b/X$),S=pe.fromRadians(f,y,_,y0t),Z=o.cartographicToCartesian(S,x0t);h.pack(Z,d,u*3)}return d}var yY=T0t;var Y$=class{constructor(t,n,i,o,r){this._tileset=t,this._tile=n,this._resource=i,this._polygons=void 0,this._polylines=void 0,this._points=void 0,this._metadata=void 0,this._batchTable=void 0,this._features=void 0,this.featurePropertiesDirty=!1,this._group=void 0,this._ready=!1,C0t(this,o,r)}get featuresLength(){return l(this._batchTable)?this._batchTable.featuresLength:0}get pointsLength(){return l(this._points)?this._points.pointsLength:0}get trianglesLength(){let t=0;return l(this._polygons)&&(t+=this._polygons.trianglesLength),l(this._polylines)&&(t+=this._polylines.trianglesLength),t}get geometryByteLength(){let t=0;return l(this._polygons)&&(t+=this._polygons.geometryByteLength),l(this._polylines)&&(t+=this._polylines.geometryByteLength),t}get texturesByteLength(){return l(this._points)?this._points.texturesByteLength:0}get batchTableByteLength(){return l(this._batchTable)?this._batchTable.batchTableByteLength:0}get innerContents(){}get ready(){return this._ready}get tileset(){return this._tileset}get tile(){return this._tile}get url(){return this._resource.getUrlComponent(!0)}get metadata(){return this._metadata}set metadata(t){this._metadata=t}get batchTable(){return this._batchTable}get group(){return this._group}set group(t){this._group=t}hasProperty(t,n){return this._batchTable.hasProperty(t,n)}getFeature(t){return l(this._features)||N$(this),this._features[t]}applyDebugSettings(t,n){l(this._polygons)&&this._polygons.applyDebugSettings(t,n),l(this._polylines)&&this._polylines.applyDebugSettings(t,n),l(this._points)&&this._points.applyDebugSettings(t,n)}applyStyle(t){l(this._features)||N$(this),l(this._polygons)&&this._polygons.applyStyle(t,this._features),l(this._polylines)&&this._polylines.applyStyle(t,this._features),l(this._points)&&this._points.applyStyle(t,this._features)}update(t,n){let i=!0;l(this._polygons)&&(this._polygons.classificationType=this._tileset.classificationType,this._polygons.debugWireframe=this._tileset.debugWireframe,this._polygons.update(n),i=i&&this._polygons.ready),l(this._polylines)&&(this._polylines.update(n),i=i&&this._polylines.ready),l(this._points)&&(this._points.update(n),i=i&&this._points.ready),l(this._batchTable)&&i&&(l(this._features)||N$(this),this._batchTable.update(t,n),this._ready=!0)}pick(t,n,i){}getPolylinePositions(t){let n=this._polylines;if(l(n))return n.getPositions(t)}isDestroyed(){return!1}destroy(){return this._polygons=this._polygons&&this._polygons.destroy(),this._polylines=this._polylines&&this._polylines.destroy(),this._points=this._points&&this._points.destroy(),this._batchTable=this._batchTable&&this._batchTable.destroy(),ue(this)}};function _0t(e){return function(t,n){l(e._polygons)&&e._polygons.updateCommands(t,n)}}function S0t(e,t){let n,i,o,r,s=e.POLYGONS_LENGTH??0,a=e.POLYLINES_LENGTH??0,c=e.POINTS_LENGTH??0;if(s>0&&l(e.POLYGON_BATCH_IDS)){let p=t.byteOffset+e.POLYGON_BATCH_IDS.byteOffset;n=new Uint16Array(t.buffer,p,s)}if(a>0&&l(e.POLYLINE_BATCH_IDS)){let p=t.byteOffset+e.POLYLINE_BATCH_IDS.byteOffset;i=new Uint16Array(t.buffer,p,a)}if(c>0&&l(e.POINT_BATCH_IDS)){let p=t.byteOffset+e.POINT_BATCH_IDS.byteOffset;o=new Uint16Array(t.buffer,p,c)}let d=l(n)||l(i)||l(o),u=s>0&&!l(n)||a>0&&!l(i)||c>0&&!l(o);if(d&&u)throw new ae("If one group of batch ids is defined, then all batch ids must be defined");if(!l(n)&&!l(i)&&!l(o)){let p=0;if(!l(n)&&s>0)for(n=new Uint16Array(s),r=0;r<s;++r)n[r]=p++;if(!l(i)&&a>0)for(i=new Uint16Array(a),r=0;r<a;++r)i[r]=p++;if(!l(o)&&c>0)for(o=new Uint16Array(c),r=0;r<c;++r)o[r]=p++}return{polygons:n,polylines:i,points:o}}var Ff=Uint32Array.BYTES_PER_ELEMENT;function Z0t(e){return new jS(e)}function R0t(e){return new gY(e)}function C0t(e,t,n){n=n??0;let i=new Uint8Array(t),o=new DataView(t);n+=Ff;let r=o.getUint32(n,!0);if(r!==1)throw new ae(`Only Vector tile version 1 is supported. Version ${r} is not.`);n+=Ff;let s=o.getUint32(n,!0);if(n+=Ff,s===0){e._ready=!0;return}let a=o.getUint32(n,!0);if(n+=Ff,a===0)throw new ae("Feature table must have a byte length greater than zero");let c=o.getUint32(n,!0);n+=Ff;let d=o.getUint32(n,!0);n+=Ff;let u=o.getUint32(n,!0);n+=Ff;let m=o.getUint32(n,!0);n+=Ff;let p=o.getUint32(n,!0);n+=Ff;let b=o.getUint32(n,!0);n+=Ff,n+=Ff;let f=Pr(i,n,a);n+=a;let y=new Uint8Array(t,n,c);n+=c;let _,S;d>0&&(_=Pr(i,n,d),n+=d,u>0&&(S=new Uint8Array(t,n,u),S=new Uint8Array(S),n+=u));let Z=f.POLYGONS_LENGTH??0,R=f.POLYLINES_LENGTH??0,C=f.POINTS_LENGTH??0,E=Z+R+C,A=new _f(e,E,_,S,_0t(e));if(e._batchTable=A,E===0)return;let L=new Tf(f,y),F=L.getGlobalProperty("REGION");if(!l(F))throw new ae("Feature table global property: REGION must be defined");let I=re.unpack(F),N=F[4],g=F[5],V=e._tile.computedTransform,G=L.getGlobalProperty("RTC_CENTER",J.FLOAT,3);l(G)?(G=h.unpack(G),P.multiplyByPoint(V,G,G)):(G=re.center(I),G.height=W.lerp(N,g,.5),G=ne.WGS84.cartographicToCartesian(G));let v=S0t(f,y);if(n+=(4-n%4)%4,Z>0){L.featuresLength=Z;let Y=L.getPropertyArray("POLYGON_COUNTS",J.UNSIGNED_INT,1)??L.getPropertyArray("POLYGON_COUNT",J.UNSIGNED_INT,1);if(!l(Y))throw new ae("Feature table property: POLYGON_COUNTS must be defined when POLYGONS_LENGTH is greater than 0");let D=L.getPropertyArray("POLYGON_INDEX_COUNTS",J.UNSIGNED_INT,1)??L.getPropertyArray("POLYGON_INDEX_COUNT",J.UNSIGNED_INT,1);if(!l(D))throw new ae("Feature table property: POLYGON_INDEX_COUNTS must be defined when POLYGONS_LENGTH is greater than 0");let M=Y.reduce(function(H,$){return H+$*2},0),O=D.reduce(function(H,$){return H+$},0),w=new Uint32Array(t,n,O);n+=m;let z=new Uint16Array(t,n,M);n+=p;let K,te;l(f.POLYGON_MINIMUM_HEIGHTS)&&l(f.POLYGON_MAXIMUM_HEIGHTS)&&(K=L.getPropertyArray("POLYGON_MINIMUM_HEIGHTS",J.FLOAT,1),te=L.getPropertyArray("POLYGON_MAXIMUM_HEIGHTS",J.FLOAT,1)),e._polygons=new fY({positions:z,counts:Y,indexCounts:D,indices:w,minimumHeight:N,maximumHeight:g,polygonMinimumHeights:K,polygonMaximumHeights:te,center:G,rectangle:I,boundingVolume:e.tile.boundingVolume.boundingVolume,batchTable:A,batchIds:v.polygons,modelMatrix:V})}let X=e._tileset;if(R>0){L.featuresLength=R;let Y=L.getPropertyArray("POLYLINE_COUNTS",J.UNSIGNED_INT,1)??L.getPropertyArray("POLYLINE_COUNT",J.UNSIGNED_INT,1);if(!l(Y))throw new ae("Feature table property: POLYLINE_COUNTS must be defined when POLYLINES_LENGTH is greater than 0");let D=L.getPropertyArray("POLYLINE_WIDTHS",J.UNSIGNED_SHORT,1);if(!l(D)){D=new Uint16Array(R);for(let K=0;K<R;++K)D[K]=2}let M=Y.reduce(function(K,te){return K+te*3},0),O=new Uint16Array(t,n,M);n+=b;let w=X.examineVectorLinesFunction;if(l(w)){let K=yY(new Uint16Array(O),I,N,g,ne.WGS84);V0t(K,Y,v.polylines,A,e.url,w)}let z=Z0t;l(X.classificationType)&&(z=R0t),e._polylines=z({positions:O,widths:D,counts:Y,batchIds:v.polylines,minimumHeight:N,maximumHeight:g,center:G,rectangle:I,boundingVolume:e.tile.boundingVolume.boundingVolume,batchTable:A,classificationType:X.classificationType,keepDecodedPositions:X.vectorKeepDecodedPositions})}if(C>0){let Y=new Uint16Array(t,n,C*3);e._points=new hY({positions:Y,batchIds:v.points,minimumHeight:N,maximumHeight:g,rectangle:I,batchTable:A,heightReference:X.heightReference,scene:X.scene})}}function N$(e){let t=e.featuresLength;if(!l(e._features)&&t>0){let n=new Array(t);l(e._polygons)&&e._polygons.createFeatures(e,n),l(e._polylines)&&e._polylines.createFeatures(e,n),l(e._points)&&e._points.createFeatures(e,n),e._features=n}}function V0t(e,t,n,i,o,r){let s=t.length,a=0;for(let c=0;c<s;c++){let d=t[c]*3,u=e.slice(a,a+d);a+=d,r(u,n[c],o,i)}}var xY=Y$;var RIi=x(T(),1);var Pvi=x(T(),1);var{ERR_CAPACITY:Fvi}=na.Error,E0t=new h,m3=class m3 extends ss{constructor(){super(...arguments);mt(this,"_collection",null)}static clone(n,i){return super.clone(n,i),i.setPosition(n.getPosition(E0t)),i}get vertexOffset(){return this._getUint32(m3.Layout.POSITION_OFFSET_U32)}get vertexCount(){return 1}getPosition(n){let i=this._collection._positionView;return h.fromArray(i,this.vertexOffset*3,n)}setPosition(n){let i=this._collection,o=this.vertexOffset;i._positionView[o*3]=n.x,i._positionView[o*3+1]=n.y,i._positionView[o*3+2]=n.z,this._dirty=!0,i._makeDirtyBoundingVolume()}toJSON(){return{...super.toJSON(),position:h.pack(this.getPosition(),[])}}};mt(m3,"Layout",{...ss.Layout,POSITION_OFFSET_U32:ss.Layout.__BYTE_LENGTH,__BYTE_LENGTH:ss.Layout.__BYTE_LENGTH+4});var M$=m3,Xc=M$;var y2i=x(T(),1);var d2i=x(T(),1);var wvi=x(T(),1);var TY=class TY extends ed{constructor(t=B.EMPTY_OBJECT){super(t),this.size=t.size??1}static pack(t,n,i){super.pack(t,n,i),n.setUint8(this.Layout.SIZE_U8+i,t.size)}static unpack(t,n,i){return super.unpack(t,n,i),i.size=t.getUint8(this.Layout.SIZE_U8+n),i}toJSON(){return{...super.toJSON(),size:this.size}}};mt(TY,"Layout",{...ed.Layout,SIZE_U8:ed.Layout.__BYTE_LENGTH,__BYTE_LENGTH:ed.Layout.__BYTE_LENGTH+4}),mt(TY,"DEFAULT_MATERIAL",Object.freeze(new TY));var w$=TY,If=w$;var k$={positionHigh:0,positionLow:1,pickColor:2,showSizeColorAlpha:3,outlineWidthColorAlpha:4},YRe={position:0,pickColor:1,showSizeColorAlpha:2,outlineWidthColorAlpha:3},QS=new Xc,Pf=new If,_Y=new U,MRe=new h,U$=new An;function A0t(e,t,n){let i=t.context;n=n||{destroy:G0t};let o=e._positionDatatype===J.DOUBLE,r=o?k$:YRe;if(!l(n.attributeArrays)){let a=e.primitiveCountMax;n.attributeArrays={...o?{positionHigh:new Float32Array(a*3),positionLow:new Float32Array(a*3)}:{position:e._positionView},pickColor:new Uint8Array(a*4),showSizeColorAlpha:new Float32Array(a*4),outlineWidthColorAlpha:new Float32Array(a*3)}}if(e._dirtyCount>0){let{attributeArrays:a}=n,c=a.positionHigh,d=a.positionLow,u=a.pickColor,m=a.showSizeColorAlpha,p=a.outlineWidthColorAlpha,{_dirtyOffset:b,_dirtyCount:f}=e;for(let y=b,_=b+f;y<_;y++)e.get(y,QS),QS._dirty&&(o&&(QS.getPosition(MRe),An.fromCartesian(MRe,U$),h.pack(U$.high,c,y*3),h.pack(U$.low,d,y*3)),QS.getMaterial(Pf),U.fromRgba(QS._pickId,_Y),u[y*4]=U.floatToByte(_Y.red),u[y*4+1]=U.floatToByte(_Y.green),u[y*4+2]=U.floatToByte(_Y.blue),u[y*4+3]=U.floatToByte(_Y.alpha),m[y*4]=QS.show?1:0,m[y*4+1]=Pf.size,m[y*4+2]=dn.encodeRGB8(Pf.color),m[y*4+3]=Pf.color.alpha,p[y*3]=Pf.outlineWidth,p[y*3+1]=dn.encodeRGB8(Pf.outlineWidth>0?Pf.outlineColor:Pf.color),p[y*3+2]=Pf.outlineWidth>0?Pf.outlineColor.alpha:Pf.color.alpha,QS._dirty=!1)}if(l(n.vertexArray)){if(e._dirtyCount>0){for(let a in r)if(Object.hasOwn(r,a)){let c=a;n.vertexArray.copyAttributeFromRange(r[c],n.attributeArrays[c],e._dirtyOffset,e._dirtyCount)}}}else{let{attributeArrays:a}=n;n.vertexArray=new Un({context:i,attributes:[...o?[{index:k$.positionHigh,componentDatatype:J.FLOAT,componentsPerAttribute:3,vertexBuffer:it.createVertexBuffer({typedArray:a.positionHigh,context:i,usage:Pe.STATIC_DRAW})},{index:k$.positionLow,componentDatatype:J.FLOAT,componentsPerAttribute:3,vertexBuffer:it.createVertexBuffer({typedArray:a.positionLow,context:i,usage:Pe.STATIC_DRAW})}]:[{index:YRe.position,componentDatatype:e._positionDatatype,componentsPerAttribute:3,normalize:e._positionNormalized,vertexBuffer:it.createVertexBuffer({typedArray:e._positionView,context:i,usage:Pe.STATIC_DRAW})}],{index:r.pickColor,componentDatatype:J.UNSIGNED_BYTE,componentsPerAttribute:4,vertexBuffer:it.createVertexBuffer({typedArray:a.pickColor,context:i,usage:Pe.STATIC_DRAW})},{index:r.showSizeColorAlpha,componentDatatype:J.FLOAT,componentsPerAttribute:4,vertexBuffer:it.createVertexBuffer({typedArray:a.showSizeColorAlpha,context:i,usage:Pe.STATIC_DRAW})},{index:r.outlineWidthColorAlpha,componentDatatype:J.FLOAT,componentsPerAttribute:3,vertexBuffer:it.createVertexBuffer({typedArray:a.outlineWidthColorAlpha,context:i,usage:Pe.STATIC_DRAW})}]})}l(n.renderState)||(n.renderState=ze.fromCache({blending:e._blendOption===Ni.OPAQUE?on.DISABLED:on.ALPHA_BLEND,depthTest:{enabled:!0}})),l(n.shaderProgram)||(n.shaderProgram=tn.fromCache({context:i,vertexShaderSource:new Je({sources:[Av],defines:o?["USE_FLOAT64"]:[]}),fragmentShaderSource:new Je({sources:[Ev]}),attributeLocations:r})),l(n.command)||(n.command=new lt({vertexArray:n.vertexArray,renderState:n.renderState,shaderProgram:n.shaderProgram,primitiveType:Ie.POINTS,pass:e._blendOption===Ni.OPAQUE?Le.OPAQUE:Le.TRANSLUCENT,pickId:e._allowPicking?"v_pickColor":void 0,owner:e,count:e.primitiveCount,modelMatrix:e.modelMatrix,boundingVolume:e.boundingVolume,debugShowBoundingVolume:e.debugShowBoundingVolume}));let s=n.command;return s.count!==e.primitiveCount&&(s.count=e.primitiveCount),s.debugShowBoundingVolume!==e.debugShowBoundingVolume&&(s.debugShowBoundingVolume=e.debugShowBoundingVolume),t.commandList.push(s),e._makeClean(),n}function G0t(){let e=this;l(e.vertexArray)&&e.vertexArray.destroy(),l(e.shaderProgram)&&e.shaderProgram.destroy(),l(e.renderState)&&ze.removeFromCache(e.renderState)}var SY=A0t;var D$=class e extends na{constructor(t=B.EMPTY_OBJECT){super({...t,vertexCountMax:t.primitiveCountMax})}_getCollectionClass(){return e}_getPrimitiveClass(){return Xc}_getMaterialClass(){return If}_cloneEmpty(t=B.EMPTY_OBJECT){return new e(this._cloneEmptyBaseArgs(t))}add(t,n=new Xc){return super.add(t,n),n._setUint32(Xc.Layout.POSITION_OFFSET_U32,this._positionCount++),n.setPosition(t.position??h.ZERO),n}update(t){super.update(t);let n=t.passes;this.show&&(n.render||n.pick)&&(this._renderContext=SY(this,t,this._renderContext))}},jd=D$;var Q2i=x(T(),1);var D2i=x(T(),1);var qS={positionHigh:0,positionLow:1,prevPositionHigh:2,prevPositionLow:3,nextPositionHigh:4,nextPositionLow:5,pickColor:6,showColorWidthAndTexCoord:7,alpha:8},h3={position:0,prevPosition:1,nextPosition:2,pickColor:3,showColorWidthAndTexCoord:4,alpha:5},fl=new Ta,ZY=new Nu,RY=new U,wRe=new h,kRe=new h,URe=new h,O$=new An,B$=new An,z$=new An;function L0t(e,t,n){let i=t.context;n=n||{destroy:F0t};let o=e._positionDatatype===J.DOUBLE,r=o?qS:h3;if(!l(n.attributeArrays)||!l(n.indexArray)){let c=e.vertexCountMax-e.primitiveCount,d=e.vertexCountMax*2;n.indexArray=Oe.createTypedArray(d,c*6),n.attributeArrays={...o?{positionHigh:new Float32Array(d*3),positionLow:new Float32Array(d*3),prevPositionHigh:new Float32Array(d*3),prevPositionLow:new Float32Array(d*3),nextPositionHigh:new Float32Array(d*3),nextPositionLow:new Float32Array(d*3)}:{position:J.createTypedArray(e._positionDatatype,d*3),prevPosition:J.createTypedArray(e._positionDatatype,d*3),nextPosition:J.createTypedArray(e._positionDatatype,d*3)},pickColor:new Uint8Array(d*4),showColorWidthAndTexCoord:new Float32Array(d*4),alpha:new Uint8Array(d)}}if(e._dirtyCount>0){let{_dirtyOffset:c,_dirtyCount:d}=e,u=e.widthUnits==="meters",m=n.indexArray,{pickColor:p,showColorWidthAndTexCoord:b,alpha:f,position:y,prevPosition:_,nextPosition:S,positionHigh:Z,positionLow:R,prevPositionHigh:C,prevPositionLow:E,nextPositionHigh:A,nextPositionLow:L}=n.attributeArrays;for(let F=c,I=c+d;F<I;F++){if(e.get(F,fl),!fl._dirty)continue;fl.getMaterial(ZY);let N=dn.encodeRGB8(ZY.color),g=ZY.color.alpha,V=u?-ZY.width:ZY.width;U.fromRgba(fl._pickId,RY);let G=fl.show,v=fl.vertexOffset*2,X=(fl.vertexOffset-F)*6,Y=e._positionView,D=fl.vertexOffset*3;for(let M=0,O=fl.vertexCount;M<O;M++){let w=M===0,z=M===O-1,K=Y[D+M*3],te=Y[D+M*3+1],H=Y[D+M*3+2],$,ee,le,_e,he,Ze;w?(_e=Y[D+3],he=Y[D+3+1],Ze=Y[D+3+2],$=2*K-_e,ee=2*te-he,le=2*H-Ze):z?($=Y[D+(M-1)*3],ee=Y[D+(M-1)*3+1],le=Y[D+(M-1)*3+2],_e=2*K-$,he=2*te-ee,Ze=2*H-le):($=Y[D+(M-1)*3],ee=Y[D+(M-1)*3+1],le=Y[D+(M-1)*3+2],_e=Y[D+(M+1)*3],he=Y[D+(M+1)*3+1],Ze=Y[D+(M+1)*3+2]),z||(m[X]=v,m[X+1]=v+1,m[X+2]=v+2,m[X+3]=v+2,m[X+4]=v+1,m[X+5]=v+3,X+=6),o&&(h.fromElements(K,te,H,wRe),h.fromElements($,ee,le,kRe),h.fromElements(_e,he,Ze,URe),An.fromCartesian(wRe,O$),An.fromCartesian(kRe,B$),An.fromCartesian(URe,z$));for(let ye=0;ye<2;ye++)o?(h.pack(O$.high,Z,v*3),h.pack(O$.low,R,v*3),h.pack(B$.high,C,v*3),h.pack(B$.low,E,v*3),h.pack(z$.high,A,v*3),h.pack(z$.low,L,v*3)):(y[v*3]=K,y[v*3+1]=te,y[v*3+2]=H,_[v*3]=$,_[v*3+1]=ee,_[v*3+2]=le,S[v*3]=_e,S[v*3+1]=he,S[v*3+2]=Ze),p[v*4]=U.floatToByte(RY.red),p[v*4+1]=U.floatToByte(RY.green),p[v*4+2]=U.floatToByte(RY.blue),p[v*4+3]=U.floatToByte(RY.alpha),b[v*4]=G?1:0,b[v*4+1]=N,b[v*4+2]=V,b[v*4+3]=M/(O-1),f[v]=g*255,v++}fl._dirty=!1}}if(l(n.vertexArray)){if(e._dirtyCount>0){let{indexOffset:c,indexCount:d,vertexOffset:u,vertexCount:m}=v0t(e);n.vertexArray.copyIndexFromRange(n.indexArray,c,d);for(let p in r)if(Object.hasOwn(r,p)){let b=p;n.vertexArray.copyAttributeFromRange(r[b],n.attributeArrays[b],u,m)}}}else{let c=n.attributeArrays;n.vertexArray=new Un({context:i,indexBuffer:it.createIndexBuffer({context:i,typedArray:n.indexArray,usage:Pe.STATIC_DRAW,indexDatatype:Oe.fromTypedArray(n.indexArray)}),attributes:[...o?[{index:qS.positionHigh,componentDatatype:J.FLOAT,componentsPerAttribute:3,vertexBuffer:it.createVertexBuffer({typedArray:c.positionHigh,context:i,usage:Pe.STATIC_DRAW})},{index:qS.positionLow,componentDatatype:J.FLOAT,componentsPerAttribute:3,vertexBuffer:it.createVertexBuffer({typedArray:c.positionLow,context:i,usage:Pe.STATIC_DRAW})},{index:qS.prevPositionHigh,componentDatatype:J.FLOAT,componentsPerAttribute:3,vertexBuffer:it.createVertexBuffer({typedArray:c.prevPositionHigh,context:i,usage:Pe.STATIC_DRAW})},{index:qS.prevPositionLow,componentDatatype:J.FLOAT,componentsPerAttribute:3,vertexBuffer:it.createVertexBuffer({typedArray:c.prevPositionLow,context:i,usage:Pe.STATIC_DRAW})},{index:qS.nextPositionHigh,componentDatatype:J.FLOAT,componentsPerAttribute:3,vertexBuffer:it.createVertexBuffer({typedArray:c.nextPositionHigh,context:i,usage:Pe.STATIC_DRAW})},{index:qS.nextPositionLow,componentDatatype:J.FLOAT,componentsPerAttribute:3,vertexBuffer:it.createVertexBuffer({typedArray:c.nextPositionLow,context:i,usage:Pe.STATIC_DRAW})}]:[{index:h3.position,componentDatatype:e._positionDatatype,componentsPerAttribute:3,normalize:e._positionNormalized,vertexBuffer:it.createVertexBuffer({typedArray:c.position,context:i,usage:Pe.STATIC_DRAW})},{index:h3.prevPosition,componentDatatype:e._positionDatatype,componentsPerAttribute:3,normalize:e._positionNormalized,vertexBuffer:it.createVertexBuffer({typedArray:c.prevPosition,context:i,usage:Pe.STATIC_DRAW})},{index:h3.nextPosition,componentDatatype:e._positionDatatype,componentsPerAttribute:3,normalize:e._positionNormalized,vertexBuffer:it.createVertexBuffer({typedArray:c.nextPosition,context:i,usage:Pe.STATIC_DRAW})}],{index:r.pickColor,componentDatatype:J.UNSIGNED_BYTE,componentsPerAttribute:4,vertexBuffer:it.createVertexBuffer({typedArray:c.pickColor,context:i,usage:Pe.STATIC_DRAW})},{index:r.showColorWidthAndTexCoord,componentDatatype:J.FLOAT,componentsPerAttribute:4,vertexBuffer:it.createVertexBuffer({typedArray:c.showColorWidthAndTexCoord,context:i,usage:Pe.STATIC_DRAW})},{index:r.alpha,componentDatatype:J.UNSIGNED_BYTE,componentsPerAttribute:1,vertexBuffer:it.createVertexBuffer({typedArray:c.alpha,context:i,usage:Pe.STATIC_DRAW})}]})}l(n.renderState)||(n.renderState=ze.fromCache({blending:e._blendOption===Ni.OPAQUE?on.DISABLED:on.ALPHA_BLEND,depthTest:{enabled:!0}})),l(n.shaderProgram)||(n.shaderProgram=tn.fromCache({context:i,vertexShaderSource:new Je({sources:[Ul,vv],defines:o?["USE_FLOAT64"]:[]}),fragmentShaderSource:new Je({sources:[Wv]}),attributeLocations:r}));let s=W0t(e);l(n.command)||(n.command=new lt({vertexArray:n.vertexArray,renderState:n.renderState,shaderProgram:n.shaderProgram,primitiveType:Ie.TRIANGLES,pass:e._blendOption===Ni.OPAQUE?Le.OPAQUE:Le.TRANSLUCENT,pickId:e._allowPicking?"v_pickColor":void 0,owner:e,count:s,modelMatrix:e.modelMatrix,boundingVolume:e.boundingVolume,debugShowBoundingVolume:e.debugShowBoundingVolume}));let a=n.command;return a.count!==s&&(a.count=s),a.debugShowBoundingVolume!==e.debugShowBoundingVolume&&(a.debugShowBoundingVolume=e.debugShowBoundingVolume),t.commandList.push(a),e._makeClean(),n}function W0t(e){return(e.vertexCount-e.primitiveCount)*6}function v0t(e){let{_dirtyOffset:t,_dirtyCount:n}=e;e.get(t,fl);let i=fl.vertexOffset*2,r=(fl.vertexOffset-t)*6;e.get(t+n-1,fl);let s=(fl.vertexOffset+fl.vertexCount)*2-i,c=(s/2-n)*6;return{indexOffset:r,indexCount:c,vertexOffset:i,vertexCount:s}}function F0t(){let e=this;l(e.vertexArray)&&e.vertexArray.destroy(),l(e.shaderProgram)&&e.shaderProgram.destroy(),l(e.renderState)&&ze.removeFromCache(e.renderState)}var CY=L0t;var H$=class e extends na{constructor(t=B.EMPTY_OBJECT){super(t);let n=t.widthUnits??"pixels";this._widthUnits=n}get widthUnits(){return this._widthUnits}_getCollectionClass(){return e}_getPrimitiveClass(){return Ta}_getMaterialClass(){return Nu}_cloneEmpty(t=B.EMPTY_OBJECT){return new e({widthUnits:this._widthUnits,...this._cloneEmptyBaseArgs(t)})}add(t,n=new Ta){super.add(t,n);let i=this._positionCount;return n._setUint32(Ta.Layout.POSITION_OFFSET_U32,i),n._setUint32(Ta.Layout.POSITION_COUNT_U32,0),l(t.positions)&&n.setPositions(t.positions),n}update(t){super.update(t),this._isRendered(t)&&(this._renderContext=CY(this,t,this._renderContext))}},pl=H$;var mFi=x(T(),1);var iFi=x(T(),1);function XV(e,t){this._conditionsExpression=$e(e,!0),this._conditions=e.conditions,this._runtimeConditions=void 0,P0t(this,t)}Object.defineProperties(XV.prototype,{conditionsExpression:{get:function(){return this._conditionsExpression}}});function I0t(e,t){this.condition=e,this.expression=t}function P0t(e,t){let n=[],i=e._conditions;if(!l(i))return;let o=i.length;for(let r=0;r<o;++r){let s=i[r],a=String(s[0]),c=String(s[1]);n.push(new I0t(new $m(a,t),new $m(c,t)))}e._runtimeConditions=n}XV.prototype.evaluate=function(e,t){let n=this._runtimeConditions;if(!l(n))return;let i=n.length;for(let o=0;o<i;++o){let r=n[o];if(r.condition.evaluate(e))return r.expression.evaluate(e,t)}};XV.prototype.evaluateColor=function(e,t){let n=this._runtimeConditions;if(!l(n))return;let i=n.length;for(let o=0;o<i;++o){let r=n[o];if(r.condition.evaluate(e))return r.expression.evaluateColor(e,t)}};XV.prototype.getShaderFunction=function(e,t,n,i){let o=this._runtimeConditions;if(!l(o)||o.length===0)return;let r="",s=o.length;for(let a=0;a<s;++a){let c=o[a],d=c.condition.getShaderExpression(t,n),u=c.expression.getShaderExpression(t,n);r+=` ${a===0?"if":"else if"} (${d}) { return ${u}; } @@ -9956,20 +9956,20 @@ void main() { ${r} return ${i}(1.0); } -`,r};nV.prototype.getVariables=function(){let e=[],t=this._runtimeConditions;if(!l(t)||t.length===0)return e;let n=t.length;for(let i=0;i<n;++i){let o=t[i];ei(e,o.condition.getVariables()),ei(e,o.expression.getVariables())}return e=e.filter(function(i,o,r){return r.indexOf(i)===o}),e};var WN=nV;function Wx(e){this._style={},this._ready=!1,this._show=void 0,this._color=void 0,this._pointSize=void 0,this._pointOutlineColor=void 0,this._pointOutlineWidth=void 0,this._labelColor=void 0,this._labelOutlineColor=void 0,this._labelOutlineWidth=void 0,this._font=void 0,this._labelStyle=void 0,this._labelText=void 0,this._backgroundColor=void 0,this._backgroundPadding=void 0,this._backgroundEnabled=void 0,this._scaleByDistance=void 0,this._translucencyByDistance=void 0,this._distanceDisplayCondition=void 0,this._heightOffset=void 0,this._anchorLineEnabled=void 0,this._anchorLineColor=void 0,this._image=void 0,this._disableDepthTestDistance=void 0,this._horizontalOrigin=void 0,this._verticalOrigin=void 0,this._labelHorizontalOrigin=void 0,this._labelVerticalOrigin=void 0,this._meta=void 0,this._lineWidth=void 0,this._colorShaderFunction=void 0,this._showShaderFunction=void 0,this._pointSizeShaderFunction=void 0,this._colorShaderFunctionReady=!1,this._showShaderFunctionReady=!1,this._pointSizeShaderFunctionReady=!1,this._colorShaderTranslucent=!1,zut(this,e)}function zut(e,t){t=$e(t,!0)??e._style,e._style=t,e.show=t.show,e.color=t.color,e.pointSize=t.pointSize,e.pointOutlineColor=t.pointOutlineColor,e.pointOutlineWidth=t.pointOutlineWidth,e.labelColor=t.labelColor,e.labelOutlineColor=t.labelOutlineColor,e.labelOutlineWidth=t.labelOutlineWidth,e.labelStyle=t.labelStyle,e.font=t.font,e.labelText=t.labelText,e.backgroundColor=t.backgroundColor,e.backgroundPadding=t.backgroundPadding,e.backgroundEnabled=t.backgroundEnabled,e.scaleByDistance=t.scaleByDistance,e.translucencyByDistance=t.translucencyByDistance,e.distanceDisplayCondition=t.distanceDisplayCondition,e.heightOffset=t.heightOffset,e.anchorLineEnabled=t.anchorLineEnabled,e.anchorLineColor=t.anchorLineColor,e.image=t.image,e.disableDepthTestDistance=t.disableDepthTestDistance,e.horizontalOrigin=t.horizontalOrigin,e.verticalOrigin=t.verticalOrigin,e.labelHorizontalOrigin=t.labelHorizontalOrigin,e.labelVerticalOrigin=t.labelVerticalOrigin,e.lineWidth=t.lineWidth;let n={};if(l(t.meta)){let i=t.defines,o=t.meta??B.EMPTY_OBJECT;for(let r in o)o.hasOwnProperty(r)&&(n[r]=new Fm(o[r],i))}e._meta=n,e._ready=!0}function _r(e,t){let n=(e._style??B.EMPTY_OBJECT).defines;if(l(t)){if(typeof t=="boolean"||typeof t=="number")return new Fm(String(t));if(typeof t=="string")return new Fm(t,n);if(l(t.conditions))return new WN(t,n)}else return;return t}function Sr(e){if(l(e)){if(l(e.expression))return e.expression;if(l(e.conditionsExpression))return $e(e.conditionsExpression,!0)}else return;return e}Object.defineProperties(Wx.prototype,{style:{get:function(){return this._style}},show:{get:function(){return this._show},set:function(e){this._show=_r(this,e),this._style.show=Sr(this._show),this._showShaderFunctionReady=!1}},color:{get:function(){return this._color},set:function(e){this._color=_r(this,e),this._style.color=Sr(this._color),this._colorShaderFunctionReady=!1}},pointSize:{get:function(){return this._pointSize},set:function(e){this._pointSize=_r(this,e),this._style.pointSize=Sr(this._pointSize),this._pointSizeShaderFunctionReady=!1}},pointOutlineColor:{get:function(){return this._pointOutlineColor},set:function(e){this._pointOutlineColor=_r(this,e),this._style.pointOutlineColor=Sr(this._pointOutlineColor)}},pointOutlineWidth:{get:function(){return this._pointOutlineWidth},set:function(e){this._pointOutlineWidth=_r(this,e),this._style.pointOutlineWidth=Sr(this._pointOutlineWidth)}},labelColor:{get:function(){return this._labelColor},set:function(e){this._labelColor=_r(this,e),this._style.labelColor=Sr(this._labelColor)}},labelOutlineColor:{get:function(){return this._labelOutlineColor},set:function(e){this._labelOutlineColor=_r(this,e),this._style.labelOutlineColor=Sr(this._labelOutlineColor)}},labelOutlineWidth:{get:function(){return this._labelOutlineWidth},set:function(e){this._labelOutlineWidth=_r(this,e),this._style.labelOutlineWidth=Sr(this._labelOutlineWidth)}},font:{get:function(){return this._font},set:function(e){this._font=_r(this,e),this._style.font=Sr(this._font)}},labelStyle:{get:function(){return this._labelStyle},set:function(e){this._labelStyle=_r(this,e),this._style.labelStyle=Sr(this._labelStyle)}},labelText:{get:function(){return this._labelText},set:function(e){this._labelText=_r(this,e),this._style.labelText=Sr(this._labelText)}},backgroundColor:{get:function(){return this._backgroundColor},set:function(e){this._backgroundColor=_r(this,e),this._style.backgroundColor=Sr(this._backgroundColor)}},backgroundPadding:{get:function(){return this._backgroundPadding},set:function(e){this._backgroundPadding=_r(this,e),this._style.backgroundPadding=Sr(this._backgroundPadding)}},backgroundEnabled:{get:function(){return this._backgroundEnabled},set:function(e){this._backgroundEnabled=_r(this,e),this._style.backgroundEnabled=Sr(this._backgroundEnabled)}},scaleByDistance:{get:function(){return this._scaleByDistance},set:function(e){this._scaleByDistance=_r(this,e),this._style.scaleByDistance=Sr(this._scaleByDistance)}},translucencyByDistance:{get:function(){return this._translucencyByDistance},set:function(e){this._translucencyByDistance=_r(this,e),this._style.translucencyByDistance=Sr(this._translucencyByDistance)}},distanceDisplayCondition:{get:function(){return this._distanceDisplayCondition},set:function(e){this._distanceDisplayCondition=_r(this,e),this._style.distanceDisplayCondition=Sr(this._distanceDisplayCondition)}},heightOffset:{get:function(){return this._heightOffset},set:function(e){this._heightOffset=_r(this,e),this._style.heightOffset=Sr(this._heightOffset)}},anchorLineEnabled:{get:function(){return this._anchorLineEnabled},set:function(e){this._anchorLineEnabled=_r(this,e),this._style.anchorLineEnabled=Sr(this._anchorLineEnabled)}},anchorLineColor:{get:function(){return this._anchorLineColor},set:function(e){this._anchorLineColor=_r(this,e),this._style.anchorLineColor=Sr(this._anchorLineColor)}},image:{get:function(){return this._image},set:function(e){this._image=_r(this,e),this._style.image=Sr(this._image)}},disableDepthTestDistance:{get:function(){return this._disableDepthTestDistance},set:function(e){this._disableDepthTestDistance=_r(this,e),this._style.disableDepthTestDistance=Sr(this._disableDepthTestDistance)}},horizontalOrigin:{get:function(){return this._horizontalOrigin},set:function(e){this._horizontalOrigin=_r(this,e),this._style.horizontalOrigin=Sr(this._horizontalOrigin)}},verticalOrigin:{get:function(){return this._verticalOrigin},set:function(e){this._verticalOrigin=_r(this,e),this._style.verticalOrigin=Sr(this._verticalOrigin)}},labelHorizontalOrigin:{get:function(){return this._labelHorizontalOrigin},set:function(e){this._labelHorizontalOrigin=_r(this,e),this._style.labelHorizontalOrigin=Sr(this._labelHorizontalOrigin)}},labelVerticalOrigin:{get:function(){return this._labelVerticalOrigin},set:function(e){this._labelVerticalOrigin=_r(this,e),this._style.labelVerticalOrigin=Sr(this._labelVerticalOrigin)}},lineWidth:{get:function(){return this._lineWidth},set:function(e){this._lineWidth=_r(this,e),this._style.lineWidth=Sr(this._lineWidth)}},meta:{get:function(){return this._meta},set:function(e){this._meta=e}}});Wx.fromUrl=function(e){return ve.createIfNeeded(e).fetchJson(e).then(function(n){return new Wx(n)})};Wx.prototype.getColorShaderFunction=function(e,t,n){return this._colorShaderFunctionReady?(n.translucent=this._colorShaderTranslucent,this._colorShaderFunction):(this._colorShaderFunctionReady=!0,l(this.color)&&l(this.color.getShaderFunction)?this._colorShaderFunction=this.color.getShaderFunction(e,t,n,"vec4"):this._colorShaderFunction=void 0,this._colorShaderTranslucent=n.translucent,this._colorShaderFunction)};Wx.prototype.getShowShaderFunction=function(e,t,n){return this._showShaderFunctionReady?this._showShaderFunction:(this._showShaderFunctionReady=!0,l(this.show)&&l(this.show.getShaderFunction)?this._showShaderFunction=this.show.getShaderFunction(e,t,n,"bool"):this._showShaderFunction=void 0,this._showShaderFunction)};Wx.prototype.getPointSizeShaderFunction=function(e,t,n){return this._pointSizeShaderFunctionReady?this._pointSizeShaderFunction:(this._pointSizeShaderFunctionReady=!0,l(this.pointSize)&&l(this.pointSize.getShaderFunction)?this._pointSizeShaderFunction=this.pointSize.getShaderFunction(e,t,n,"float"):this._pointSizeShaderFunction=void 0,this._pointSizeShaderFunction)};Wx.prototype.getVariables=function(){let e=[];return l(this.color)&&l(this.color.getVariables)&&ei(e,this.color.getVariables()),l(this.show)&&l(this.show.getVariables)&&ei(e,this.show.getVariables()),l(this.pointSize)&&l(this.pointSize.getVariables)&&ei(e,this.pointSize.getVariables()),e=e.filter(function(t,n,i){return i.indexOf(t)===n}),e};var sg=Wx;var Eyi=x(T(),1);var D_e=new re,k_e=new re,$q=new re,YB=new Map;YB.set(ml,{packCollectionData:Ts.packPolylineCollectionData,packTilePrimitives:Ts.packPolylineSegments});YB.set(Ma,{packCollectionData:Ts.packPolygonCollectionData,packTilePrimitives:Ts.packPolygonRings});var e$=class{constructor(t){this._tilingScheme=t.tilingScheme,this.antialias=t.antialias??!0,this.minimumTileScreenPixels=t.minimumTileScreenPixels??256,this._heightReferenceByCollection=new Map,this._collectionDataCache=new WeakMap,this._markedThisFrame=new Set,this._markedFrameNumber=-1,this._dirtyRectangles=[]}get tilingScheme(){return this._tilingScheme}set tilingScheme(t){this._tilingScheme=t}get ellipsoid(){return this._tilingScheme.ellipsoid}remove(t){this._markedThisFrame.delete(t),this._heightReferenceByCollection.delete(t)&&this._markCollectionRegionDirty(t)}has(t){return this._heightReferenceByCollection.has(t)}static isSupported(t){return YB.has(t.constructor)}markForFrame(t,n,i){this._beginFrame(n),this._markedThisFrame.add(t),this._heightReferenceByCollection.has(t)||this._markCollectionRegionDirty(t),this._heightReferenceByCollection.set(t,i)}_beginFrame(t){if(t!==this._markedFrameNumber){for(let n of this._heightReferenceByCollection.keys())this._markedThisFrame.has(n)||(this._heightReferenceByCollection.delete(n),this._markCollectionRegionDirty(n));this._markedThisFrame.clear(),this._markedFrameNumber=t}}_markCollectionRegionDirty(t){let n=re.fromBoundingSphere(t.boundingVolume,this._tilingScheme.ellipsoid,new re);this._dirtyRectangles.push(n)}requestTileData(t,n,i,o,r){let s=this._tilingScheme.tileXYToRectangle(t,n,i,D_e);return this.requestDataForRectangle(s,o,r)}requestDataForRectangle(t,n,i){let o=this._tilingScheme,r=this._heightReferenceByCollection,s={show:!0,hasPolylines:!1,hasPolygons:!1,rectangle:re.clone(t),collectionVersions:new Map,minimumTileScreenPixels:this.minimumTileScreenPixels,metersPerUv:Hut(t,o.ellipsoid)};for(let[d,u]of r){if(!U_e(u,i))continue;let m=re.fromBoundingSphere(d.boundingVolume,o.ellipsoid,k_e);if(!!!re.intersection(t,m,$q))continue;let b=YB.get(d.constructor),f=this._getCollectionDataCached(d,b.packCollectionData);s.collectionVersions.set(d,f.version),b.packTilePrimitives(d,f,t,s)}let a=l(s.polylineSegments)&&s.polylineSegments.length>0,c=l(s.polygonRings)&&s.polygonRings.length>0;return s.hasPolylines=a,s.hasPolygons=c,!a&&!c?(s.show=!1,s):(a&&(Ts.packPolylineGrid(s),Ts.packPolylineTextures(n,s)),c&&(Ts.packPolygonGrid(s),Ts.packPolygonTextures(n,s)),Ts.packPrimitiveTextures(n,s),s)}releaseTileData(t){Ts.freeResources(t)}updateTileData(t,n,i,o,r,s){let a=this._dirtyRectangles,c=this._tilingScheme;return Kut(t,n,i,a,c)?(this.releaseTileData(r),this.requestTileData(t,n,i,o,s)):r}updateDataForRectangle(t,n,i,o){return this._isStale(i,t,o)?(this.releaseTileData(i),this.requestDataForRectangle(t,n,o)):i}_isStale(t,n,i){if(!re.equals(t.rectangle,n))return!0;let o=t.collectionVersions,r=this._heightReferenceByCollection,s=0;for(let[a,c]of r){if(!U_e(c,i))continue;let d=re.fromBoundingSphere(a.boundingVolume,this._tilingScheme.ellipsoid,k_e),u=!!re.intersection(n,d,$q),m=o.get(a);if(!u){if(l(m))return!0;continue}if(!l(m)||(s++,a._dirtyCount>0||m!==a._version))return!0}return s!==o.size}makeClean(){this._dirtyRectangles.length=0}update(t){l(t)&&this._beginFrame(t);for(let n of this._heightReferenceByCollection.keys()){let i=this._collectionDataCache.get(n);!l(i)||!(n._dirtyCount>0||i.version!==n._version)||(l(i.rectangle)&&this._dirtyRectangles.push(re.clone(i.rectangle)),this._markCollectionRegionDirty(n))}}_getCollectionDataCached(t,n){let i=this._collectionDataCache.get(t),o=t._dirtyCount>0,r=i?.version!==t._version;if(l(i)&&!o&&!r)return i;let s=this.ellipsoid,a=n(t,s,i);return a.version=t._version+(o?1:0),a.rectangle=re.fromBoundingSphere(t.boundingVolume,s,a.rectangle),this._collectionDataCache.set(t,a),t._makeClean(),a}};function U_e(e,t){return e===He.CLAMP_TO_GROUND||e===t}function Hut(e,t){let n=t.maximumRadius,i=(e.south+e.north)*.5;return new k(e.width*n*Math.cos(i),e.height*n)}function Kut(e,t,n,i,o){if(i.length===0)return!1;let r=o.tileXYToRectangle(e,t,n,D_e);for(let s=0;s<i.length;s++)if(re.intersection(r,i[s],$q))return!0;return!1}var ag=e$;var axi=x(T(),1);var Uyi=x(T(),1);var O_e=new Xc,B_e=new ya,z_e=new Ir,Jut=new Zf,jut=new Wu,Qut=new Lu,t$=class{constructor(t,n,i=0){mt(this,"_color",new U);mt(this,"_outlineColor",new U);this._content=t,this._batchId=n,this._batchTableId=i,this._primitivesByCollection=new Map}addPrimitiveByCollection(t,n){let i=this._primitivesByCollection.get(t);i||(i=[],this._primitivesByCollection.set(t,i)),i.push(n)}get show(){for(let t of this._iteratePrimitives())if(t.show)return!0;return!1}set show(t){for(let n of this._iteratePrimitives())n.show=t}get color(){for(let t of this._iterateMaterials())return U.clone(t.color,this._color);return U.clone(U.WHITE,this._color)}set color(t){for(let n of this._iterateMaterials())U.clone(t,n.color)}get pointSize(){for(let t of this._iteratePointMaterials())return t.size;return 1}set pointSize(t){for(let n of this._iteratePointMaterials())n.size=t}get pointOutlineColor(){for(let t of this._iteratePointMaterials())return U.clone(t.outlineColor,this._outlineColor);return U.clone(U.WHITE,this._outlineColor)}set pointOutlineColor(t){for(let n of this._iteratePointMaterials())U.clone(t,n.outlineColor)}get pointOutlineWidth(){for(let t of this._iteratePointMaterials())return t.outlineWidth;return 0}set pointOutlineWidth(t){for(let n of this._iteratePointMaterials())n.outlineWidth=t}get lineWidth(){for(let t of this._iteratePolylineMaterials())return t.width;return 1}set lineWidth(t){for(let n of this._iteratePolylineMaterials())n.width=t}get lineOutlineColor(){for(let t of this._iteratePolylineMaterials())return U.clone(t.outlineColor,this._outlineColor);return U.clone(U.WHITE,this._outlineColor)}set lineOutlineColor(t){for(let n of this._iteratePolylineMaterials())U.clone(t,n.outlineColor)}get lineOutlineWidth(){for(let t of this._iteratePolylineMaterials())return t.outlineWidth;return 0}set lineOutlineWidth(t){for(let n of this._iteratePolylineMaterials())n.outlineWidth=t}get polygonOutlineColor(){for(let t of this._iteratePolygonMaterials())return U.clone(t.outlineColor,this._outlineColor);return U.clone(U.WHITE,this._outlineColor)}set polygonOutlineColor(t){for(let n of this._iteratePolygonMaterials())U.clone(t,n.outlineColor)}get polygonOutlineWidth(){for(let t of this._iteratePolygonMaterials())return t.outlineWidth;return 0}set polygonOutlineWidth(t){for(let n of this._iteratePolygonMaterials())n.outlineWidth=t}get content(){return this._content}get tileset(){return this._content.tileset}get primitive(){return this._content.tileset}get featureId(){return this._batchId}get _batchTable(){return this._content.batchTables[this._batchTableId]}get pickIds(){let t=[];for(let n of this._iteratePrimitives())t.push(n._pickId);return t}hasProperty(t){return l(this._batchTable)?this._batchTable.hasProperty(this._batchId,t):!1}getPropertyIds(t){return l(this._batchTable)?this._batchTable.getPropertyIds(this._batchId,t):[]}getProperty(t){if(l(this._batchTable))return this._batchTable.getProperty(this._batchId,t)}getPropertyInherited(t){return ea.getPropertyInherited(this._content,this._batchId,t,this._batchTable)}setProperty(t,n){throw new ge("Not implemented")}isExactClass(t){return l(this._batchTable)?this._batchTable.isExactClass(this._batchId,t):!1}isClass(t){return l(this._batchTable)?this._batchTable.isClass(this._batchId,t):!1}getExactClassName(){if(l(this._batchTable))return this._batchTable.getExactClassName(this._batchId)}*_iteratePrimitives(){yield*this._iteratePrimitivesWith(zd,O_e),yield*this._iteratePrimitivesWith(ml,B_e),yield*this._iteratePrimitivesWith(Ma,z_e)}*_iteratePrimitivesWith(t,n){let i=this._content._collections;for(let o=0;o<i.length;o++){let r=i[o],s=this._primitivesByCollection.get(o);if(s&&r instanceof t)for(let a of s)r.get(a,n),yield n}}*_iterateMaterials(){yield*this._iteratePointMaterials(),yield*this._iteratePolylineMaterials(),yield*this._iteratePolygonMaterials()}*_iteratePointMaterials(){yield*this._iterateMaterialsWith(zd,O_e,Jut)}*_iteratePolylineMaterials(){yield*this._iterateMaterialsWith(ml,B_e,jut)}*_iteratePolygonMaterials(){yield*this._iterateMaterialsWith(Ma,z_e,Qut)}*_iterateMaterialsWith(t,n,i){for(let o of this._iteratePrimitivesWith(t,n))o.getMaterial(i),yield i,o.setMaterial(i)}},IS=t$;var H_e=new h,qut=new Xc,$ut=new ya,J_e=new Ir;function emt(e,t){let n=t.scene.nodes,i={collections:[],collectionLocalMatrices:[],collectionFeatureTableIds:new Map,featuresByTableId:new Map};for(let o=0;o<n.length;o++)j_e(e,n[o],P.IDENTITY,i);return i}function MB(e){let t=e.BYTES_PER_ELEMENT*8;return Math.pow(2,t)-1}function tmt(e){let t={pointPrimitiveCount:0,pointVertexCount:0,polylinePrimitiveCount:0,polylineVertexCount:0,polygonPrimitiveCount:0,polygonVertexCount:0,polygonHoleCount:0,polygonTriangleCount:0},n=e.vector,i=e.polygon,o=e.primitiveType,s=Zt.getAttributeBySemantic(e,dt.POSITION).count,a=e.indices?xa.readIndicesAsTypedArray(e.indices):void 0;if(o===Ie.POINTS)t.pointPrimitiveCount+=s,t.pointVertexCount+=s;else if(o===Ie.LINE_STRIP){let c=n?n.count:K_e(a);t.polylinePrimitiveCount+=c,t.polylineVertexCount+=a.length-c+1}else if(o===Ie.TRIANGLES||o===Ie.LINE_LOOP)if(n){t.polygonPrimitiveCount+=n.count,t.polygonVertexCount+=s,t.polygonTriangleCount+=a.length/3;let c=n.polygonHoleCounts;if(c)for(let d=0;d<c.length;d++)t.polygonHoleCount+=c[d]}else{let c=K_e(i.loopIndices);t.polygonPrimitiveCount+=i.count,t.polygonVertexCount+=i.loopIndices.length-c+1,t.polygonTriangleCount+=i.triangleIndices.length,t.polygonHoleCount+=c-i.count}else throw new ae(`Unexpected primitive type: ${o}`);return t}function K_e(e){let t=MB(e),n=0;for(let i=0;i<e.length;i++)e[i]===t&&i+1<e.length&&n++;return n+1}function nmt(e,t,n,i,o){let r=Zt.getAttributeBySemantic(t,dt.POSITION),s=r.typedArray??(n.positionNormalized?xa.readAttributeAsRawCompactTypedArray(r):xa.readAttributeAsTypedArray(r)),a=t.indices?xa.readIndicesAsTypedArray(t.indices):void 0,c=imt(e,t,o);n instanceof zd?omt(n,i,s,a,c):n instanceof ml?rmt(n,i,s,a,c):n instanceof Ma&&(l(t.vector)?smt(n,i,s,a,c,t.vector):amt(n,i,s,c,t.polygon))}function imt(e,t,n){let i=e.tileset.featureIdLabel,o=Zt.getFeatureIdsByLabel(t.featureIds,i);if(!(o instanceof Vn.FeatureIdAttribute))return()=>{};let r=Zt.getAttributeBySemantic(t,dt.FEATURE_ID,o.setIndex),s=r.typedArray??xa.readAttributeAsTypedArray(r);for(let a=0;a<s.length;a++){let c=s[a];if(!n.has(c)){let d=new IS(e,c,o.propertyTableId);n.set(c,d)}}return function(c){let d=s[c];if(d!==o.nullFeatureId)return n.get(d)}}function omt(e,t,n,i,o){let r=n.length/3;for(let s=0,a=i?i.length:r;s<a;s++){let c=i?i[s]:s;h.fromArray(n,c*3,H_e);let d=o(c);d&&d.addPrimitiveByCollection(t,s),e.add({position:H_e,pickObject:d,featureId:d?.featureId},qut)}}function rmt(e,t,n,i,o){let r=MB(i),s=0,a=0,c=0;for(let d=0;d<i.length;d++){if(i[d]===r?a=d-s:d+1===i.length&&(a=d+1-s),a===0)continue;let m=s+a,p=i.subarray(s,m),b=Q_e(n,p,3),f=o(i[s]);f&&f.addPrimitiveByCollection(t,c),e.add({positions:b,pickObject:f,featureId:f?.featureId},$ut),s=d+1,a=0,c++}}function smt(e,t,n,i,o,r){let s=r.polygonAttributeOffsets,a=r.polygonIndicesOffsets,c=r.polygonHoleCounts,d=r.polygonHoleOffsets,u=n.length/3,m=s.length;for(let p=0;p<m;p++){let b=s[p],f=p+1<m?s[p+1]:u,y=n.subarray(b*3,f*3),_;if(l(c)&&c[p]>0){let E=c[p];_=d.slice(p,p+E);for(let A=0;A<E;A++)_[A]-=b}let S=a[p],Z=p+1<m?a[p+1]:i.length,R=i.slice(S,Z);for(let E=0;E<R.length;E++)R[E]-=b;let C=o(b);C&&C.addPrimitiveByCollection(t,p),e.add({positions:y,triangles:R,holes:_,pickObject:C,featureId:C?.featureId},J_e)}}function amt(e,t,n,i,o){let r=o.loopIndices.constructor,s=new r(o.loopIndices.length),a=MB(o.loopIndices);for(let c=0;c<o.count;c++){let d=c+1===o.count,u=o.loopIndicesOffsets[c],m=d?o.loopIndices.length:o.loopIndicesOffsets[c+1],p=o.loopIndices.subarray(u,m),b=Q_e(n,p,3,s),f=[];for(let Z=0;Z<p.length;Z++){let R=Z+1===p.length;p[Z]===a&&!R&&f.push(Z)}let y=new r(f),_;if(l(o.triangleIndices)){let Z=o.triangleIndicesOffsets[c],R=d?o.triangleIndices.length:o.triangleIndicesOffsets[c+1];_=o.triangleIndices.subarray(Z,R);for(let C=0;C<_.length;C++)_[C]=s[_[C]]}else throw new Error("Runtime triangulation not yet supported.");let S=i(p[0]);S&&S.addPrimitiveByCollection(t,c),e.add({positions:b,triangles:_,holes:y,pickObject:S,featureId:S?.featureId},J_e)}}function j_e(e,t,n,i){let o=Zt.getNodeTransform(t),r=P.multiplyTransformation(n,o,new P),s=t.primitives;for(let c=0;c<s.length;c++){let d=s[c],u=d.primitiveType,m,p=tmt(d),b=Zt.getAttributeBySemantic(d,dt.POSITION),f=b.normalized??!1,y=b.componentDatatype;u===Ie.POINTS?m=new zd({primitiveCountMax:p.pointPrimitiveCount,allowPicking:!0,positionNormalized:f,positionDatatype:y}):u===Ie.LINE_STRIP?m=new ml({primitiveCountMax:p.polylinePrimitiveCount,vertexCountMax:p.polylineVertexCount,allowPicking:!0,positionNormalized:f,positionDatatype:y}):(u===Ie.TRIANGLES||u===Ie.LINE_LOOP)&&(m=new Ma({primitiveCountMax:p.polygonPrimitiveCount,vertexCountMax:p.polygonVertexCount,holeCountMax:p.polygonHoleCount,triangleCountMax:p.polygonTriangleCount,allowPicking:!0,positionNormalized:f,positionDatatype:y}));let S=d.featureIds?.[0]?.propertyTableId;i.featuresByTableId.has(S)||i.featuresByTableId.set(S,new Map),i.collections.push(m),i.collectionLocalMatrices.push(P.clone(r)),i.collectionFeatureTableIds.set(m,S),nmt(e,d,m,i.collections.length-1,i.featuresByTableId.get(S))}let a=t.children;for(let c=0;c<a.length;c++)j_e(e,a[c],r,i)}function Q_e(e,t,n,i){let o=MB(t),r=0;for(let d=0;d<t.length;d++)t[d]!==o&&r++;let s=e.constructor,a=new s(r*n),c=0;for(let d=0;d<t.length;d++){let u=t[d];if(i&&(i[u]=u===o?o:c),u!==o){for(let m=0;m<n;m++)a[c*n+m]=e[u*n+m];c++}}return a}var vN=emt;var wB=new Xc,kB=new ya,UB=new Ir,FN=new Zf,n$=new Wu,q_e=new Lu,$_e=new P,i$=class e{constructor(t,n,i){this._tileset=t,this._tile=n,this._resource=i,this._model=void 0,this._collections=[],this._collectionLocalMatrices=[],this._collectionFeatureTableIds=new Map,this._featuresByTableId=new Map,this._metadata=void 0,this._group=void 0,this.featurePropertiesDirty=!1,this._ready=!1,this._modelMatrix=P.clone(P.IDENTITY)}get featuresLength(){return this.batchTables.reduce((t,n)=>t+n.featuresLength,0)}get pointsLength(){return this._collections.filter(t=>t instanceof zd).reduce((t,n)=>t+n.primitiveCount,0)}get trianglesLength(){return this._collections.reduce((t,n)=>n instanceof Ma?t+n.triangleCount:n instanceof ml?t+(n.vertexCount-n.primitiveCount)*2:t,0)}get geometryByteLength(){return this._collections.reduce((t,n)=>t+n.byteLength,0)}get texturesByteLength(){return 0}get batchTableByteLength(){return this.batchTables.reduce((t,n)=>t+n.batchTableByteLength,0)}get innerContents(){}get ready(){return this._ready}get tileset(){return this._tileset}get tile(){return this._tile}get url(){return this._resource.getUrlComponent(!0)}get batchTables(){return this._model._featureTables}get batchTable(){throw new ge("Deprecated: Use `content.batchTables`.")}get metadata(){return this._metadata}set metadata(t){this._metadata=t}get group(){return this._group}set group(t){this._group=t}getFeature(t,n){return this._featuresByTableId.get(n)?.get(t)}hasProperty(t,n,i){let o=this.getFeature(t,i);return o?o.hasProperty(n):!1}applyDebugSettings(t,n){let i=t?`color("${n.toCssHexString()}", 1.0)`:'color("white", 1.0)';this.applyStyle(new sg({color:i}))}applyStyle(t){let n=r=>r instanceof zd,i=r=>r instanceof ml,o=r=>r instanceof Ma;for(let r of this._collections.filter(n)){let s=this._collectionFeatureTableIds.get(r);for(let a=0,c=r.primitiveCount;a<c;a++){r.get(a,wB);let d=this.getFeature(wB.featureId,s);l(t.show)&&(wB.show=t.show.evaluate(d)),l(t.color)&&t.color.evaluate(d,FN.color),l(t.pointSize)&&(FN.size=t.pointSize.evaluate(d)),l(t.pointOutlineWidth)&&(FN.outlineWidth=t.pointOutlineWidth.evaluate(d)),l(t.pointOutlineColor)&&t.pointOutlineColor.evaluate(d,FN.outlineColor),wB.setMaterial(FN)}}for(let r of this._collections.filter(i)){let s=this._collectionFeatureTableIds.get(r);for(let a=0,c=r.primitiveCount;a<c;a++){r.get(a,kB);let d=this.getFeature(kB.featureId,s);l(t.show)&&(kB.show=t.show.evaluate(d)),l(t.color)&&t.color.evaluate(d,n$.color),l(t.lineWidth)&&(n$.width=t.lineWidth.evaluate(d)),kB.setMaterial(n$)}}for(let r of this._collections.filter(o)){let s=this._collectionFeatureTableIds.get(r);for(let a=0,c=r.primitiveCount;a<c;a++){r.get(a,UB);let d=this.getFeature(UB.featureId,s);l(t.show)&&(UB.show=t.show.evaluate(d)),l(t.color)&&t.color.evaluate(d,q_e.color),UB.setMaterial(q_e)}}}update(t,n){let i=this._tileset,o=i._scene?.vectorProvider;if(l(this._model)&&!this._ready){let s=this._model;s.modelMatrix=this._tile.computedTransform,s.update(n),s.ready&&(lmt(this),this._ready=!0)}P.multiplyTransformation(this._tile.computedTransform,this._modelMatrix,$_e);let r=l(o)&&this._tile._selectedFrame===n.frameNumber;for(let s=0;s<this._collections.length;s++){let a=this._collections[s];P.multiplyTransformation($_e,this._collectionLocalMatrices[s],a.modelMatrix),!bs(i._heightReference)||!ag.isSupported(a)?a.update(n):r&&o.markForFrame(a,n.frameNumber,i._heightReference)}}pick(t,n,i){}isDestroyed(){return!1}destroy(){let t=this._tileset._scene?.vectorProvider;this._model?.destroy(),this._model=void 0;for(let n of this._collections)t?.remove(n),n.destroy();return this._collections.length=0,ue(this)}static async fromGltf(t,n,i,o){let r=new e(t,n,i),s=cmt(t,n,r,o),a=await Yu.fromGltfAsync(s);return a.show=!1,r._model=a,r}};function cmt(e,t,n,i){return{gltf:i,basePath:n._resource,cull:!1,releaseGltfJson:!0,opaquePass:Le.CESIUM_3D_TILE,modelMatrix:t.computedTransform,upAxis:e._modelUpAxis,forwardAxis:e._modelForwardAxis,incrementallyLoadTextures:!1,content:n,featureIdLabel:e.featureIdLabel,instanceFeatureIdLabel:e.instanceFeatureIdLabel,projectTo2D:e._projectTo2D,enablePick:e._enablePick,enableDebugWireframe:e._enableDebugWireframe,enableShowOutline:!1}}function lmt(e){let t=e._model.sceneGraph.components,n=Zt.getAxisCorrectionMatrix(t.upAxis,t.forwardAxis,new P);P.multiplyTransformation(t.transform,n,e._modelMatrix);let i=vN(e,t);e._collections=i.collections,e._collectionLocalMatrices=i.collectionLocalMatrices,e._collectionFeatureTableIds=i.collectionFeatureTableIds,e._featuresByTableId=i.featuresByTableId}var vx=i$;var BTi=x(T(),1);var FTi=x(T(),1);var Pxi=x(T(),1);function uc(){}uc._maxSortingConcurrency=Math.max(fn.hardwareConcurrency-1,1);uc._sorterTaskProcessor=void 0;uc._taskProcessorReady=!1;uc._error=void 0;uc._getSorterTaskProcessor=function(){if(!l(uc._sorterTaskProcessor)){let e=new qn("gaussianSplatSorter",uc._maxSortingConcurrency);e.initWebAssemblyModule({wasmBinaryFile:"ThirdParty/wasm_splats_bg.wasm"}).then(function(t){t?uc._taskProcessorReady=!0:uc._error=new ae("Gaussian splat sorter could not be initialized.")}).catch(t=>{uc._error=t}),uc._sorterTaskProcessor=e}return uc._sorterTaskProcessor};uc.radixSortIndexes=function(e){let t=uc._getSorterTaskProcessor();if(l(uc._error))throw uc._error;if(uc._taskProcessorReady)return t.scheduleTask(e,[e.primitive.positions.buffer])};var PS=uc;var kxi=x(T(),1);function mc(){}mc._maxSortingConcurrency=Math.max(fn.hardwareConcurrency-1,1);mc._textureTaskProcessor=void 0;mc._taskProcessorReady=!1;mc._error=void 0;mc._getTextureTaskProcessor=function(){if(!l(mc._textureTaskProcessor)){let e=new qn("gaussianSplatTextureGenerator",mc._maxSortingConcurrency);e.initWebAssemblyModule({wasmBinaryFile:"ThirdParty/wasm_splats_bg.wasm"}).then(function(t){t?mc._taskProcessorReady=!0:mc._error=new ae("Gaussian splat sorter could not be initialized.")}).catch(t=>{mc._error=t}),mc._textureTaskProcessor=e}return mc._textureTaskProcessor};mc.generateFromAttributes=function(e){let t=mc._getTextureTaskProcessor();if(l(mc._error))throw mc._error;if(!mc._taskProcessorReady)return;let{attributes:n}=e;return t.scheduleTask(e,[n.positions.buffer,n.scales.buffer,n.rotations.buffer,n.colors.buffer])};var IN=mc;var Kxi=x(T(),1);function dmt(e){let t=new lb;this.shaderBuilder=t,this.uniformMap={},this.renderStateOptions=ze.getState(ze.fromCache({depthTest:{enabled:!0,func:sc.LESS_OR_EQUAL}})),this.alphaOptions=new _S,this.hasSkipLevelOfDetail=!1,e._useLogDepth&&t.addDefine("LOG_DEPTH_READ_ONLY",void 0,fe.FRAGMENT)}var PN=dmt;var XS=new P,rSe=new P,XN=new P,Ei=new q,NN=new Ne,umt=new h,mmt=new Ne,hmt=new h,fmt=1e-12,DB=1e-5,o$=1e-7,Oa={IDLE:0,WAITING:1,SORTING:2,SORTED:3,ERROR:4},Bs={BUILDING:"BUILDING",TEXTURE_PENDING:"TEXTURE_PENDING",TEXTURE_READY:"TEXTURE_READY",SORTING:"SORTING",READY:"READY"},pmt=2,bmt=30,gmt=3,ymt=.008726646259971648,xmt=1;function Tmt(e,t){let n=e._lastSteadySortFrameNumber>=0?t.frameNumber-e._lastSteadySortFrameNumber:Number.POSITIVE_INFINITY;if(e._lastSteadySortFrameNumber>=0&&n<gmt)return!1;let i=t.camera;return l(i)?!e._hasLastSteadySortCameraPosition||!e._hasLastSteadySortCameraDirection||h.distance(i.positionWC,e._lastSteadySortCameraPosition)>=xmt?!0:h.angleBetween(i.directionWC,e._lastSteadySortCameraDirection)>=ymt:!1}function eSe(e,t){e._lastSteadySortFrameNumber=t.frameNumber;let n=t.camera;l(n)&&(h.clone(n.positionWC,e._lastSteadySortCameraPosition),e._hasLastSteadySortCameraPosition=!0,h.clone(n.directionWC,e._lastSteadySortCameraDirection),e._hasLastSteadySortCameraDirection=!0)}function _mt(e,t){let n=e._selectedTileSet;if(!l(n)||n.size!==t.length)return!0;for(let i=0;i<t.length;i++)if(!n.has(t[i]))return!0;return!1}function tSe(e,t){return l(t)&&t.requestId===e._sortRequestId&&t.dataGeneration===e._splatDataGeneration}function r$(e){l(e)&&(l(e.gaussianSplatTexture)&&(e.gaussianSplatTexture.destroy(),e.gaussianSplatTexture=void 0),l(e.sphericalHarmonicsTexture)&&(e.sphericalHarmonicsTexture.destroy(),e.sphericalHarmonicsTexture=void 0))}function nSe(e,t,n){if(!l(t))return;e._retiredTextures.push({texture:t,frameNumber:n})}function Smt(e,t){let n=e._retiredTextures;if(!l(n)||n.length===0)return;let i=[];for(let o=0;o<n.length;o++){let r=n[o];t-r.frameNumber>0?r.texture.destroy():i.push(r)}e._retiredTextures=i}function Zmt(e,t){let n=e?.[t];return l(n)?n.buffer:void 0}function Rmt(e,t,n,i){let o=e._aggregateScratchBuffers[t];l(o)||(o=[],e._aggregateScratchBuffers[t]=o);let r=Zmt(e._snapshot,t);for(let a=0;a<o.length;a++){let c=o[a];if(c.length>=i&&c.buffer!==r)return c}let s=J.createTypedArray(n,i);return o.push(s),s}function Cmt(e,t){return e.length===t?e:e.subarray(0,t)}function Vmt(e,t,n){if(!l(t.indexes)||t.state!==Bs.READY)throw new ge("Committing snapshot before it is READY.");let i=n.frameNumber,o=e._snapshot,r=l(o)?o.gaussianSplatTexture:e.gaussianSplatTexture;l(r)&&r!==t.gaussianSplatTexture&&nSe(e,r,i);let s=l(o)?o.sphericalHarmonicsTexture:e.sphericalHarmonicsTexture;l(s)&&s!==t.sphericalHarmonicsTexture&&nSe(e,s,i),e._snapshot=t,e._positions=t.positions,e._rotations=t.rotations,e._scales=t.scales,e._colors=t.colors,e._shData=t.shData,e._sphericalHarmonicsDegree=t.sphericalHarmonicsDegree,e._numSplats=t.numSplats,e._indexes=t.indexes,e.gaussianSplatTexture=t.gaussianSplatTexture,e.sphericalHarmonicsTexture=t.sphericalHarmonicsTexture,e._lastTextureWidth=t.lastTextureWidth,e._lastTextureHeight=t.lastTextureHeight,e._splatRowMask=t.splatRowMask,e._splatRowShift=t.splatRowShift,e._splatBudgetSSEScale=t.splatBudgetSSEScale??1,e._hasGaussianSplatTexture=l(t.gaussianSplatTexture),e._needsGaussianSplatTexture=!1,e._gaussianSplatTexturePending=!1,e._vertexArray=void 0,e._vertexArrayLen=-1,e._drawCommand=void 0,e._sorterPromise=void 0,e._activeSort=void 0,e._sorterState=Oa.IDLE,e._dirty=!1}async function Emt(e,t,n,i){try{let o=await i,r=wt.maximumTextureSize,s=r,a=Math.ceil(n.numSplats/(r/2)),c=Math.log2(r/2),d=r/2-1;if(a>r){let b=n.numSplats;a=r;let f=s/2;if(n.numSplats=r*f,n.positions=n.positions.subarray(0,n.numSplats*3),n.rotations=n.rotations.subarray(0,n.numSplats*4),n.scales=n.scales.subarray(0,n.numSplats*3),n.colors=n.colors.subarray(0,n.numSplats*4),l(n.shData)){let y=n.shData.length/b;n.shData=n.shData.subarray(0,Math.floor(n.numSplats*y))}n.splatBudgetSSEScale=b/n.numSplats,console.warn(`[GaussianSplat][HARD CAP] ${b} splats exceed the maximum texture capacity (${r}\xD7${f} = ${n.numSplats} splats at width=${s}). Rendering only the first ${n.numSplats} splats to avoid a WebGL crash. Increasing maximumScreenSpaceError by ${n.splatBudgetSSEScale.toFixed(2)}x next frame.`)}else n.splatBudgetSSEScale=1;let u=s*a*4,m;u<=o.data.length?m=o.data.subarray(0,u):(m=new Uint32Array(u),m.set(o.data));let p={width:s,height:a,data:m};if(n.splatRowMask=d,n.splatRowShift=c,e._pendingSnapshot!==n){n.state=Bs.BUILDING;return}if(!l(n.gaussianSplatTexture))n.gaussianSplatTexture=oSe(t.context,p);else if(n.lastTextureHeight!==p.height||n.lastTextureWidth!==p.width){let b=n.gaussianSplatTexture;n.gaussianSplatTexture=oSe(t.context,p),b.destroy()}else n.gaussianSplatTexture.copyFrom({source:{width:p.width,height:p.height,arrayBufferView:p.data}});if(n.lastTextureHeight=p.height,n.lastTextureWidth=p.width,l(n.shData)&&n.sphericalHarmonicsDegree>0){let b=n.sphericalHarmonicsTexture,f=wt.maximumTextureSize,y=n.shCoefficientCount/3,_=Math.floor(f/y),S=_*(y*2),Z=Math.ceil(n.numSplats/_);if(Z>f)console.warn(`[GaussianSplat][SHTexture] ${n.numSplats} splats require SH height ${Z} > maxTex ${f}. Disabling spherical harmonics for this snapshot (color-only fallback).`),n.sphericalHarmonicsDegree=0,l(b)&&b.destroy(),n.sphericalHarmonicsTexture=void 0;else{let R=new Uint32Array(f*Z*2),C=0;for(let E=0;C<n.shData.length;E+=f*2)R.set(n.shData.subarray(C,C+S),E),C+=S;n.sphericalHarmonicsTexture=Gmt(t.context,{data:R,width:f,height:Z}),l(b)&&b.destroy()}}n.state=Bs.TEXTURE_READY}catch(o){console.error("Error generating Gaussian splat texture:",o),n.state=Bs.BUILDING}}async function Amt(e,t,n,i){try{let o=await i;if(!l(n)||n.snapshot!==e._pendingSnapshot)return;let r=n.expectedCount,s=r,a=o?.length;if(r!==s||a!==r){e._pendingSortPromise=void 0,e._pendingSort=void 0,n.snapshot.state===Bs.SORTING&&(n.snapshot.state=Bs.TEXTURE_READY);return}let c=n.snapshot;c.indexes=o,c.state=Bs.READY,e._pendingSortPromise=void 0,e._pendingSort=void 0,Vmt(e,c,t),e._pendingSnapshot=void 0,rd.buildGSplatDrawCommand(e,t)}catch(o){if(!l(n)||n.snapshot!==e._pendingSnapshot)return;e._pendingSortPromise=void 0,e._pendingSort=void 0,n.snapshot.state===Bs.SORTING&&(n.snapshot.state=Bs.TEXTURE_READY),e._sorterState=Oa.ERROR,e._sorterError=o}}async function iSe(e,t,n){try{let i=await n,o=tSe(e,t),r=t?.expectedCount,s=r,a=i?.length;if(!o||(r!==s||a!==r)){o&&(e._sorterPromise=void 0,e._sorterState=Oa.IDLE);return}e._indexes=i,e._sorterState=Oa.SORTED}catch(i){if(!tSe(e,t))return;e._sorterState=Oa.ERROR,e._sorterError=i}}function Gmt(e,t){return new vt({context:e,source:{width:t.width,height:t.height,arrayBufferView:t.data},preMultiplyAlpha:!1,skipColorSpaceConversion:!0,pixelFormat:Qe.RG_INTEGER,pixelDatatype:Ue.UNSIGNED_INT,flipY:!1,sampler:Ot.NEAREST})}function oSe(e,t){return new vt({context:e,source:{width:t.width,height:t.height,arrayBufferView:t.data},preMultiplyAlpha:!1,skipColorSpaceConversion:!0,pixelFormat:Qe.RGBA_INTEGER,pixelDatatype:Ue.UNSIGNED_INT,flipY:!1,sampler:Ot.NEAREST})}function rd(e){e=e??B.EMPTY_OBJECT,this._positions=void 0,this._rotations=void 0,this._scales=void 0,this._colors=void 0,this._indexes=void 0,this._numSplats=0,this._needsGaussianSplatTexture=!0,this._snapshot=void 0,this._pendingSnapshot=void 0,this._retiredTextures=[],this._aggregateScratchBuffers={positions:[],scales:[],rotations:[],colors:[]},this._scratchAggregateShBuffer=void 0,this._selectedTilesStableFrames=0,this._needsSnapshotRebuild=!1,this._snapshotRebuildStallFrames=0,this._prevViewMatrix=new P,this._debugShowBoundingVolume=e.debugShowBoundingVolume??!1,this.gaussianSplatTexture=void 0,this.sphericalHarmonicsTexture=void 0,this._lastTextureWidth=0,this._lastTextureHeight=0,this._vertexArray=void 0,this._vertexArrayLen=-1,this._splitDirection=kr.NONE,this._dirty=!1,this._tileset=e.tileset,this._baseTilesetUpdate=this._tileset.update,this._tileset.update=this._wrappedUpdate.bind(this),this._tileset.tileLoad.addEventListener(this.onTileLoad,this),this._tileset.tileVisible.addEventListener(this.onTileVisible,this),this.selectedTileLength=0,this._selectedTileSet=new Set,this._ready=!1,this._hasGaussianSplatTexture=!1,this._gaussianSplatTexturePending=!1,this._drawCommand=void 0,this._drawCommandModelMatrix=new P,this._rootTransform=void 0,this._axisCorrectionMatrix=Zt.getAxisCorrectionMatrix(Bi.Y,Bi.X,new P),this._shInverseRotation=new q,this._isDestroyed=!1,this._sorterState=Oa.IDLE,this._sorterPromise=void 0,this._splatDataGeneration=0,this._sortRequestId=0,this._activeSort=void 0,this._pendingSortPromise=void 0,this._pendingSort=void 0,this._lastSteadySortFrameNumber=-1,this._lastSteadySortCameraPosition=new h,this._hasLastSteadySortCameraPosition=!1,this._lastSteadySortCameraDirection=new h,this._hasLastSteadySortCameraDirection=!1,this._sorterError=void 0,this._splatRowMask=0,this._splatRowShift=0,this._splatBudgetSSEScale=1}Object.defineProperties(rd.prototype,{ready:{get:function(){return this._ready}},isStable:{get:function(){return!this._dirty&&(!l(this._pendingSnapshot)||this._pendingSnapshot.state===Bs.READY)}},splitDirection:{get:function(){return this._splitDirection},set:function(e){this._splitDirection!==e&&(this._splitDirection=e,this._dirty=!0)}}});rd.prototype._wrappedUpdate=function(e){let t=this._tileset;if(this._splatBudgetSSEScale!==1){let n=t.maximumScreenSpaceError;t.maximumScreenSpaceError*=this._splatBudgetSSEScale,this._baseTilesetUpdate.call(t,e),t.maximumScreenSpaceError=n}else this._baseTilesetUpdate.call(t,e);this.update(e)};rd.prototype.destroy=function(){if(this._positions=void 0,this._rotations=void 0,this._scales=void 0,this._colors=void 0,this._indexes=void 0,r$(this._pendingSnapshot),r$(this._snapshot),l(this._retiredTextures))for(let t=0;t<this._retiredTextures.length;t++)this._retiredTextures[t].texture.destroy();this._retiredTextures=[],this._pendingSnapshot=void 0,this._snapshot=void 0,this._aggregateScratchBuffers=void 0,this.gaussianSplatTexture=void 0,this.sphericalHarmonicsTexture=void 0;let e=this._drawCommand;return l(e)&&(e.shaderProgram=e.shaderProgram&&e.shaderProgram.destroy()),l(this._vertexArray)&&(this._vertexArray.destroy(),this._vertexArray=void 0),this._tileset.update=this._baseTilesetUpdate.bind(this._tileset),ue(this)};rd.prototype.isDestroyed=function(){return this._isDestroyed};rd.prototype.onTileLoad=function(e){this._dirty=!0};rd.prototype.onTileVisible=function(e){};rd.transformTile=function(e){let t=e.computedTransform,n=e.content.gltfPrimitive,i=e.tileset.gaussianSplatPrimitive;i._rootTransform===void 0&&(i._rootTransform=_t.eastNorthUpToFixedFrame(e.tileset.boundingSphere.center));let o=i._rootTransform,r=P.multiplyTransformation(t,i._axisCorrectionMatrix,XS);P.multiplyTransformation(r,e.content.worldTransform,r);let s=P.inverse(o,rSe),a=P.multiplyTransformation(s,r,XS),c=e.content._lastSplatTransform;if(e.content._transformed&&l(c)&&P.equalsEpsilon(a,c,fmt))return;let d=e.content.positions,u=e.content.rotations,m=e.content.scales,p=Math.sqrt(a[0]*a[0]+a[1]*a[1]+a[2]*a[2]),b=Math.sqrt(a[4]*a[4]+a[5]*a[5]+a[6]*a[6]),f=Math.sqrt(a[8]*a[8]+a[9]*a[9]+a[10]*a[10]);Ei[0]=a[0]/p,Ei[1]=a[1]/p,Ei[2]=a[2]/p,Ei[3]=a[4]/b,Ei[4]=a[5]/b,Ei[5]=a[6]/b,Ei[6]=a[8]/f,Ei[7]=a[9]/f,Ei[8]=a[10]/f;let y=Ei[0]*Ei[3]+Ei[1]*Ei[4]+Ei[2]*Ei[5],_=Ei[0]*Ei[6]+Ei[1]*Ei[7]+Ei[2]*Ei[8],S=Ei[3]*Ei[6]+Ei[4]*Ei[7]+Ei[5]*Ei[8],Z=Math.abs(p-1)<=o$&&Math.abs(b-1)<=o$&&Math.abs(f-1)<=o$,R=Math.abs(y)<=DB&&Math.abs(_)<=DB&&Math.abs(S)<=DB,C=Ei[0]*(Ei[4]*Ei[8]-Ei[5]*Ei[7])-Ei[3]*(Ei[1]*Ei[8]-Ei[2]*Ei[7])+Ei[6]*(Ei[1]*Ei[5]-Ei[2]*Ei[4]),E=Z&&R&&Math.abs(C-1)<=DB;Ne.fromRotationMatrix(Ei,NN),Ne.normalize(NN,NN);let A=Zt.getAttributeBySemantic(n,dt.POSITION).typedArray,L=Zt.getAttributeBySemantic(n,dt.ROTATION).typedArray,F=Zt.getAttributeBySemantic(n,dt.SCALE).typedArray,I=umt,N=mmt,g=hmt;for(let V=0;V<A.length/3;++V)I.x=A[V*3],I.y=A[V*3+1],I.z=A[V*3+2],N.x=L[V*4],N.y=L[V*4+1],N.z=L[V*4+2],N.w=L[V*4+3],g.x=F[V*3],g.y=F[V*3+1],g.z=F[V*3+2],E?(P.multiplyByPoint(a,I,I),Ne.multiply(NN,N,N),Ne.normalize(N,N)):(P.fromTranslationQuaternionRotationScale(I,N,g,XN),P.multiplyTransformation(a,XN,XN),P.getTranslation(XN,I),P.getScale(XN,g),Ne.multiply(NN,N,N),Ne.normalize(N,N)),d[V*3]=I.x,d[V*3+1]=I.y,d[V*3+2]=I.z,u[V*4]=N.x,u[V*4+1]=N.y,u[V*4+2]=N.z,u[V*4+3]=N.w,m[V*3]=g.x,m[V*3+1]=g.y,m[V*3+2]=g.z;e.content._lastSplatTransform=P.clone(a,e.content._lastSplatTransform),e.content._transformed=!0};rd.generateSplatTexture=function(e,t,n){if(!l(n)||n.state!==Bs.BUILDING)return;n.state=Bs.TEXTURE_PENDING;let i=IN.generateFromAttributes({attributes:{positions:new Float32Array(n.positions),scales:new Float32Array(n.scales),rotations:new Float32Array(n.rotations),colors:new Uint8Array(n.colors)},count:n.numSplats});if(!l(i)){n.state=Bs.BUILDING;return}Emt(e,t,n,i)};rd.buildGSplatDrawCommand=function(e,t){let n=e._tileset,i=new PN(e),{shaderBuilder:o}=i,r=i.renderStateOptions;r.cull.enabled=!1,r.depthMask=!1,r.depthTest.enabled=!0,r.blending=on.PRE_MULTIPLIED_ALPHA_BLEND,i.alphaOptions.pass=Le.GAUSSIAN_SPLATS,o.addAttribute("vec2","a_screenQuadPosition"),o.addAttribute("float","a_splatIndex"),o.addVarying("vec4","v_splatColor"),o.addVarying("vec2","v_vertPos"),o.addUniform("float","u_splitDirection",fe.VERTEX),o.addVarying("float","v_splitDirection"),o.addUniform("highp usampler2D","u_splatAttributeTexture",fe.VERTEX),o.addUniform("float","u_sphericalHarmonicsDegree",fe.VERTEX),o.addUniform("float","u_splatScale",fe.VERTEX),o.addUniform("vec3","u_cameraPositionWC",fe.VERTEX),o.addUniform("mat3","u_inverseModelRotation",fe.VERTEX);let s=i.uniformMap;o.addUniform("int","u_splatRowMask",fe.VERTEX),o.addUniform("int","u_splatRowShift",fe.VERTEX);let a=e.gaussianSplatTexture;s.u_splatAttributeTexture=function(){return a},s.u_splatRowMask=function(){return e._splatRowMask},s.u_splatRowShift=function(){return e._splatRowShift},e._sphericalHarmonicsDegree>0&&(o.addDefine("HAS_SPHERICAL_HARMONICS","1",fe.VERTEX),o.addUniform("highp usampler2D","u_sphericalHarmonicsTexture",fe.VERTEX),s.u_sphericalHarmonicsTexture=function(){return e.sphericalHarmonicsTexture}),s.u_sphericalHarmonicsDegree=function(){return e._sphericalHarmonicsDegree},s.u_cameraPositionWC=function(){return h.clone(t.camera.positionWC)},s.u_inverseModelRotation=function(){return e._shInverseRotation},s.u_splitDirection=function(){return e.splitDirection};let c=l(e._indexes)?e._indexes.length:e._numSplats;i.instanceCount=c,i.count=4,i.primitiveType=Ie.TRIANGLE_STRIP,o.addVertexLines(n2),o.addFragmentLines(t2);let d=o.buildShaderProgram(t.context),u=$e(ze.fromCache(i.renderStateOptions),!0);u.cull.face=Zt.getCullFace(n.modelMatrix,Ie.TRIANGLE_STRIP),u=ze.fromCache(u);let m={screenQuadPosition:0,splatIndex:2},p=new Vn.Attribute;if(p.name="_SPLAT_INDEXES",p.typedArray=e._indexes,p.componentDatatype=J.UNSIGNED_INT,p.type=Dt.SCALAR,p.normalized=!1,p.count=i.instanceCount,p.constant=0,p.instanceDivisor=1,!l(e._vertexArray)||e._indexes.length>e._vertexArrayLen){let S=new At({attributes:{screenQuadPosition:new Xe({componentDatatype:J.FLOAT,componentsPerAttribute:2,values:[-1,-1,1,-1,1,1,-1,1],name:"_SCREEN_QUAD_POS",variableName:"screenQuadPosition"}),splatIndex:{...p,variableName:"splatIndex"}},primitiveType:Ie.TRIANGLE_STRIP});e._vertexArray=Un.fromGeometry({context:t.context,geometry:S,attributeLocations:m,bufferUsage:Pe.DYNAMIC_DRAW,interleave:!1})}else e._vertexArray.getAttribute(1).vertexBuffer.copyFromArrayView(e._indexes);e._vertexArrayLen=e._indexes.length;let f=P.clone(e._rootTransform,e._drawCommandModelMatrix),y=e._vertexArray,_=new lt({boundingVolume:n.boundingSphere,modelMatrix:f,uniformMap:s,renderState:u,vertexArray:y,shaderProgram:d,cull:r.cull.enabled,pass:Le.GAUSSIAN_SPLATS,count:i.count,owner:e,instanceCount:i.instanceCount,primitiveType:Ie.TRIANGLE_STRIP,debugShowBoundingVolume:n.debugShowBoundingVolume,castShadows:!1,receiveShadows:!1});e._drawCommand=_};rd.prototype.update=function(e){let t=this._tileset;if(Smt(this,e.frameNumber),!t.show)return;if(this._drawCommand&&e.commandList.push(this._drawCommand),t._modelMatrixChanged){this._dirty=!0;return}let n=l(this._rootTransform);if(e.passes.pick===!0)return;this.splitDirection!==t.splitDirection&&(this.splitDirection=t.splitDirection);let i=e.camera;if(l(i)){if(this._sorterState===Oa.IDLE){let o=t._selectedTiles.length!==0&&_mt(this,t._selectedTiles);t._selectedTiles.length===0?(this._selectedTilesStableFrames=0,this._needsSnapshotRebuild=!1,this._snapshotRebuildStallFrames=0):o?this._selectedTilesStableFrames=0:this._selectedTilesStableFrames++,(o||this._dirty)&&(this._needsSnapshotRebuild=!0);let r=this._selectedTilesStableFrames>=pmt,s=!l(this._snapshot)&&!l(this._pendingSnapshot)&&!l(this._drawCommand);this._needsSnapshotRebuild&&t._selectedTiles.length!==0?this._snapshotRebuildStallFrames++:this._snapshotRebuildStallFrames=0;let a=r||s||this._snapshotRebuildStallFrames>=bmt;if(!(this._dirty||this._needsSnapshotRebuild||o||l(this._pendingSnapshot)||l(this._pendingSortPromise)||!l(this._drawCommand))&&P.equals(i.viewMatrix,this._prevViewMatrix))return;if(t._selectedTiles.length!==0&&this._needsSnapshotRebuild&&a){this._splatDataGeneration++,this._activeSort=void 0,this._sorterPromise=void 0,this._sorterState=Oa.IDLE,this._pendingSortPromise=void 0,this._pendingSort=void 0,l(this._pendingSnapshot)&&r$(this._pendingSnapshot);let d=t._selectedTiles;this._rootTransform=_t.eastNorthUpToFixedFrame(t.boundingSphere.center);{let C=d[0],E=P.multiplyTransformation(C.computedTransform,this._axisCorrectionMatrix,rSe);P.multiplyTransformation(E,C.content.worldTransform??P.IDENTITY,E),P.getRotation(P.inverse(E,E),this._shInverseRotation)}for(let C of d)rd.transformTile(C);let u=d.reduce((C,E)=>C+E.content.pointsLength,0),m=(C,E,A,L)=>{let F,I=0,N=0;for(let g of d){let V=A(g.content),G=l(L)?L:Dt.getNumberOfComponents(V.type),v=l(V.typedArray)?V.typedArray:V;N+=v.length,l(F)||(F=Rmt(this,C,E,u*G))}if(!l(F))return J.createTypedArray(E,0);for(let g of d){let V=g.content,G=A(V),v=l(G.typedArray)?G.typedArray:G;F.set(v,I),I+=v.length}return Cmt(F,N)},p=()=>{let C=0;for(let F of d)if(F.content.sphericalHarmonicsDegree>0){switch(F.content.sphericalHarmonicsDegree){case 1:C=9;break;case 2:C=24;break;case 3:C=45;break}break}if(C===0)return;let E=u*(C*(2/3));(!l(this._scratchAggregateShBuffer)||this._scratchAggregateShBuffer.length<E)&&(this._scratchAggregateShBuffer=new Uint32Array(E));let A=this._scratchAggregateShBuffer,L=0;for(let F of d){let I=F.content.packedSphericalHarmonicsData;F.content.sphericalHarmonicsDegree>0&&(A.set(I,L),L+=I.length)}return L<A.length?A.subarray(0,L):A},b=m("positions",J.FLOAT,C=>C.positions,3),f=m("scales",J.FLOAT,C=>C.scales,3),y=m("rotations",J.FLOAT,C=>C.rotations,4),_=m("colors",J.UNSIGNED_BYTE,C=>Zt.getAttributeBySemantic(C.gltfPrimitive,dt.COLOR)),S=d[0].content.sphericalHarmonicsDegree,Z=S>0?d[0].content.sphericalHarmonicsCoefficientCount:0,R=p();this._pendingSnapshot={generation:this._splatDataGeneration,positions:b,rotations:y,scales:f,colors:_,shData:R,sphericalHarmonicsDegree:S,shCoefficientCount:Z,numSplats:u,indexes:void 0,gaussianSplatTexture:void 0,sphericalHarmonicsTexture:void 0,lastTextureWidth:0,lastTextureHeight:0,splatRowMask:0,splatRowShift:0,state:Bs.BUILDING},this.selectedTileLength=t._selectedTiles.length,this._selectedTileSet=new Set(t._selectedTiles),this._dirty=!1,this._needsSnapshotRebuild=!1,this._snapshotRebuildStallFrames=0}if(l(this._pendingSnapshot)){let d=this._pendingSnapshot;if(d.state===Bs.BUILDING){rd.generateSplatTexture(this,e,d);return}if(d.state===Bs.TEXTURE_PENDING||d.state===Bs.TEXTURE_READY&&!l(d.gaussianSplatTexture)||!n)return;if(P.clone(i.viewMatrix,this._prevViewMatrix),P.multiply(i.viewMatrix,this._rootTransform,XS),d.state===Bs.TEXTURE_READY&&!l(this._pendingSortPromise)){let u=++this._sortRequestId,m=this._splatDataGeneration;this._pendingSort={requestId:u,dataGeneration:m,expectedCount:d.numSplats,snapshot:d};let p=PS.radixSortIndexes({primitive:{positions:new Float32Array(d.positions),modelView:Float32Array.from(XS),count:d.numSplats},sortType:"Index"});if(!l(p)){this._pendingSortPromise=void 0,this._pendingSort=void 0,d.state=Bs.TEXTURE_READY;return}this._pendingSortPromise=p,d.state=Bs.SORTING;let b=this._pendingSort;Amt(this,e,b,p);return}if(!l(this._pendingSortPromise)){d.state===Bs.SORTING&&(d.state=Bs.TEXTURE_READY);return}return}if(this._numSplats===0||!n)return;if(P.clone(i.viewMatrix,this._prevViewMatrix),P.multiply(i.viewMatrix,this._rootTransform,XS),!l(this._sorterPromise)){if(!Tmt(this,e))return;let d=++this._sortRequestId,u=this._splatDataGeneration,m=this._numSplats;this._activeSort={requestId:d,dataGeneration:u,expectedCount:m};let p=PS.radixSortIndexes({primitive:{positions:new Float32Array(this._positions),modelView:Float32Array.from(XS),count:this._numSplats},sortType:"Index"});if(this._sorterPromise=p,l(p)){eSe(this,e);let b=this._activeSort;this._sorterState=Oa.SORTING,iSe(this,b,p);return}}if(!l(this._sorterPromise)){this._sorterState=Oa.WAITING;return}this._sorterState=Oa.SORTING;return}else if(this._sorterState===Oa.WAITING){if(!l(this._sorterPromise)){let o=++this._sortRequestId,r=this._splatDataGeneration,s=this._numSplats;this._activeSort={requestId:o,dataGeneration:r,expectedCount:s};let a=PS.radixSortIndexes({primitive:{positions:new Float32Array(this._positions),modelView:Float32Array.from(XS),count:this._numSplats},sortType:"Index"});if(this._sorterPromise=a,l(a)){eSe(this,e);let c=this._activeSort;this._sorterState=Oa.SORTING,iSe(this,c,a);return}}if(!l(this._sorterPromise)){this._sorterState=Oa.WAITING;return}this._sorterState=Oa.SORTING;return}else{if(this._sorterState===Oa.SORTING)return;if(this._sorterState===Oa.SORTED)rd.buildGSplatDrawCommand(this,e),this._sorterState=Oa.IDLE,this._dirty=!1,this._sorterPromise=void 0,this._activeSort=void 0;else if(this._sorterState===Oa.ERROR)throw this._sorterError}this._dirty=!1}};var YN=rd;var a$=class e{constructor(t,n,i,o){this._tileset=n,this._tile=i,this._resource=o,this._loader=t,l(this._tileset.gaussianSplatPrimitive)||(this._tileset.gaussianSplatPrimitive=new YN({tileset:this._tileset})),this._positions=void 0,this._rotations=void 0,this._scales=void 0,this.gltfPrimitive=void 0,this.worldTransform=void 0,this.featurePropertiesDirty=!1,this._metadata=void 0,this._group=void 0,this._ready=!1,this._transformed=!1,this._sphericalHarmonicsDegree=0,this._sphericalHarmonicsCoefficientCount=0,this._packedSphericalHarmonicsData=void 0,this._lastSplatTransform=void 0}static tilesetRequiresGaussianSplattingExt(t){let n=!1;return t.isGltfExtensionRequired instanceof Function&&(n=t.isGltfExtensionRequired("KHR_gaussian_splatting")&&t.isGltfExtensionRequired("KHR_gaussian_splatting_compression_spz_2"),t.isGltfExtensionRequired("KHR_spz_gaussian_splats_compression")&&Jo("KHR_spz_gaussian_splats_compression",`Support for the original KHR_spz_gaussian_splats_compression extension has been removed in favor of the up to date KHR_gaussian_splatting and KHR_gaussian_splatting_compression_spz_2 extensions +`,r};XV.prototype.getVariables=function(){let e=[],t=this._runtimeConditions;if(!l(t)||t.length===0)return e;let n=t.length;for(let i=0;i<n;++i){let o=t[i];ei(e,o.condition.getVariables()),ei(e,o.expression.getVariables())}return e=e.filter(function(i,o,r){return r.indexOf(i)===o}),e};var VY=XV;function Yx(e){this._style={},this._ready=!1,this._show=void 0,this._color=void 0,this._pointSize=void 0,this._pointOutlineColor=void 0,this._pointOutlineWidth=void 0,this._labelColor=void 0,this._labelOutlineColor=void 0,this._labelOutlineWidth=void 0,this._font=void 0,this._labelStyle=void 0,this._labelText=void 0,this._backgroundColor=void 0,this._backgroundPadding=void 0,this._backgroundEnabled=void 0,this._scaleByDistance=void 0,this._translucencyByDistance=void 0,this._distanceDisplayCondition=void 0,this._heightOffset=void 0,this._anchorLineEnabled=void 0,this._anchorLineColor=void 0,this._image=void 0,this._disableDepthTestDistance=void 0,this._horizontalOrigin=void 0,this._verticalOrigin=void 0,this._labelHorizontalOrigin=void 0,this._labelVerticalOrigin=void 0,this._meta=void 0,this._lineWidth=void 0,this._colorShaderFunction=void 0,this._showShaderFunction=void 0,this._pointSizeShaderFunction=void 0,this._colorShaderFunctionReady=!1,this._showShaderFunctionReady=!1,this._pointSizeShaderFunctionReady=!1,this._colorShaderTranslucent=!1,X0t(this,e)}function X0t(e,t){t=$e(t,!0)??e._style,e._style=t,e.show=t.show,e.color=t.color,e.pointSize=t.pointSize,e.pointOutlineColor=t.pointOutlineColor,e.pointOutlineWidth=t.pointOutlineWidth,e.labelColor=t.labelColor,e.labelOutlineColor=t.labelOutlineColor,e.labelOutlineWidth=t.labelOutlineWidth,e.labelStyle=t.labelStyle,e.font=t.font,e.labelText=t.labelText,e.backgroundColor=t.backgroundColor,e.backgroundPadding=t.backgroundPadding,e.backgroundEnabled=t.backgroundEnabled,e.scaleByDistance=t.scaleByDistance,e.translucencyByDistance=t.translucencyByDistance,e.distanceDisplayCondition=t.distanceDisplayCondition,e.heightOffset=t.heightOffset,e.anchorLineEnabled=t.anchorLineEnabled,e.anchorLineColor=t.anchorLineColor,e.image=t.image,e.disableDepthTestDistance=t.disableDepthTestDistance,e.horizontalOrigin=t.horizontalOrigin,e.verticalOrigin=t.verticalOrigin,e.labelHorizontalOrigin=t.labelHorizontalOrigin,e.labelVerticalOrigin=t.labelVerticalOrigin,e.lineWidth=t.lineWidth;let n={};if(l(t.meta)){let i=t.defines,o=t.meta??B.EMPTY_OBJECT;for(let r in o)o.hasOwnProperty(r)&&(n[r]=new $m(o[r],i))}e._meta=n,e._ready=!0}function _r(e,t){let n=(e._style??B.EMPTY_OBJECT).defines;if(l(t)){if(typeof t=="boolean"||typeof t=="number")return new $m(String(t));if(typeof t=="string")return new $m(t,n);if(l(t.conditions))return new VY(t,n)}else return;return t}function Sr(e){if(l(e)){if(l(e.expression))return e.expression;if(l(e.conditionsExpression))return $e(e.conditionsExpression,!0)}else return;return e}Object.defineProperties(Yx.prototype,{style:{get:function(){return this._style}},show:{get:function(){return this._show},set:function(e){this._show=_r(this,e),this._style.show=Sr(this._show),this._showShaderFunctionReady=!1}},color:{get:function(){return this._color},set:function(e){this._color=_r(this,e),this._style.color=Sr(this._color),this._colorShaderFunctionReady=!1}},pointSize:{get:function(){return this._pointSize},set:function(e){this._pointSize=_r(this,e),this._style.pointSize=Sr(this._pointSize),this._pointSizeShaderFunctionReady=!1}},pointOutlineColor:{get:function(){return this._pointOutlineColor},set:function(e){this._pointOutlineColor=_r(this,e),this._style.pointOutlineColor=Sr(this._pointOutlineColor)}},pointOutlineWidth:{get:function(){return this._pointOutlineWidth},set:function(e){this._pointOutlineWidth=_r(this,e),this._style.pointOutlineWidth=Sr(this._pointOutlineWidth)}},labelColor:{get:function(){return this._labelColor},set:function(e){this._labelColor=_r(this,e),this._style.labelColor=Sr(this._labelColor)}},labelOutlineColor:{get:function(){return this._labelOutlineColor},set:function(e){this._labelOutlineColor=_r(this,e),this._style.labelOutlineColor=Sr(this._labelOutlineColor)}},labelOutlineWidth:{get:function(){return this._labelOutlineWidth},set:function(e){this._labelOutlineWidth=_r(this,e),this._style.labelOutlineWidth=Sr(this._labelOutlineWidth)}},font:{get:function(){return this._font},set:function(e){this._font=_r(this,e),this._style.font=Sr(this._font)}},labelStyle:{get:function(){return this._labelStyle},set:function(e){this._labelStyle=_r(this,e),this._style.labelStyle=Sr(this._labelStyle)}},labelText:{get:function(){return this._labelText},set:function(e){this._labelText=_r(this,e),this._style.labelText=Sr(this._labelText)}},backgroundColor:{get:function(){return this._backgroundColor},set:function(e){this._backgroundColor=_r(this,e),this._style.backgroundColor=Sr(this._backgroundColor)}},backgroundPadding:{get:function(){return this._backgroundPadding},set:function(e){this._backgroundPadding=_r(this,e),this._style.backgroundPadding=Sr(this._backgroundPadding)}},backgroundEnabled:{get:function(){return this._backgroundEnabled},set:function(e){this._backgroundEnabled=_r(this,e),this._style.backgroundEnabled=Sr(this._backgroundEnabled)}},scaleByDistance:{get:function(){return this._scaleByDistance},set:function(e){this._scaleByDistance=_r(this,e),this._style.scaleByDistance=Sr(this._scaleByDistance)}},translucencyByDistance:{get:function(){return this._translucencyByDistance},set:function(e){this._translucencyByDistance=_r(this,e),this._style.translucencyByDistance=Sr(this._translucencyByDistance)}},distanceDisplayCondition:{get:function(){return this._distanceDisplayCondition},set:function(e){this._distanceDisplayCondition=_r(this,e),this._style.distanceDisplayCondition=Sr(this._distanceDisplayCondition)}},heightOffset:{get:function(){return this._heightOffset},set:function(e){this._heightOffset=_r(this,e),this._style.heightOffset=Sr(this._heightOffset)}},anchorLineEnabled:{get:function(){return this._anchorLineEnabled},set:function(e){this._anchorLineEnabled=_r(this,e),this._style.anchorLineEnabled=Sr(this._anchorLineEnabled)}},anchorLineColor:{get:function(){return this._anchorLineColor},set:function(e){this._anchorLineColor=_r(this,e),this._style.anchorLineColor=Sr(this._anchorLineColor)}},image:{get:function(){return this._image},set:function(e){this._image=_r(this,e),this._style.image=Sr(this._image)}},disableDepthTestDistance:{get:function(){return this._disableDepthTestDistance},set:function(e){this._disableDepthTestDistance=_r(this,e),this._style.disableDepthTestDistance=Sr(this._disableDepthTestDistance)}},horizontalOrigin:{get:function(){return this._horizontalOrigin},set:function(e){this._horizontalOrigin=_r(this,e),this._style.horizontalOrigin=Sr(this._horizontalOrigin)}},verticalOrigin:{get:function(){return this._verticalOrigin},set:function(e){this._verticalOrigin=_r(this,e),this._style.verticalOrigin=Sr(this._verticalOrigin)}},labelHorizontalOrigin:{get:function(){return this._labelHorizontalOrigin},set:function(e){this._labelHorizontalOrigin=_r(this,e),this._style.labelHorizontalOrigin=Sr(this._labelHorizontalOrigin)}},labelVerticalOrigin:{get:function(){return this._labelVerticalOrigin},set:function(e){this._labelVerticalOrigin=_r(this,e),this._style.labelVerticalOrigin=Sr(this._labelVerticalOrigin)}},lineWidth:{get:function(){return this._lineWidth},set:function(e){this._lineWidth=_r(this,e),this._style.lineWidth=Sr(this._lineWidth)}},meta:{get:function(){return this._meta},set:function(e){this._meta=e}}});Yx.fromUrl=function(e){return ve.createIfNeeded(e).fetchJson(e).then(function(n){return new Yx(n)})};Yx.prototype.getColorShaderFunction=function(e,t,n){return this._colorShaderFunctionReady?(n.translucent=this._colorShaderTranslucent,this._colorShaderFunction):(this._colorShaderFunctionReady=!0,l(this.color)&&l(this.color.getShaderFunction)?this._colorShaderFunction=this.color.getShaderFunction(e,t,n,"vec4"):this._colorShaderFunction=void 0,this._colorShaderTranslucent=n.translucent,this._colorShaderFunction)};Yx.prototype.getShowShaderFunction=function(e,t,n){return this._showShaderFunctionReady?this._showShaderFunction:(this._showShaderFunctionReady=!0,l(this.show)&&l(this.show.getShaderFunction)?this._showShaderFunction=this.show.getShaderFunction(e,t,n,"bool"):this._showShaderFunction=void 0,this._showShaderFunction)};Yx.prototype.getPointSizeShaderFunction=function(e,t,n){return this._pointSizeShaderFunctionReady?this._pointSizeShaderFunction:(this._pointSizeShaderFunctionReady=!0,l(this.pointSize)&&l(this.pointSize.getShaderFunction)?this._pointSizeShaderFunction=this.pointSize.getShaderFunction(e,t,n,"float"):this._pointSizeShaderFunction=void 0,this._pointSizeShaderFunction)};Yx.prototype.getVariables=function(){let e=[];return l(this.color)&&l(this.color.getVariables)&&ei(e,this.color.getVariables()),l(this.show)&&l(this.show.getVariables)&&ei(e,this.show.getVariables()),l(this.pointSize)&&l(this.pointSize.getVariables)&&ei(e,this.pointSize.getVariables()),e=e.filter(function(t,n,i){return i.indexOf(t)===n}),e};var bg=Yx;var SFi=x(T(),1);var BRe=new re,DRe=new re,K$=new re,f3=new Map;f3.set(pl,{packCollectionData:Ss.packPolylineCollectionData,packTilePrimitives:Ss.packPolylineSegments});f3.set(ka,{packCollectionData:Ss.packPolygonCollectionData,packTilePrimitives:Ss.packPolygonRings});var J$=class{constructor(t){this._tilingScheme=t.tilingScheme,this.antialias=t.antialias??!0,this.minimumTileScreenPixels=t.minimumTileScreenPixels??256,this._heightReferenceByCollection=new Map,this._collectionDataCache=new WeakMap,this._markedThisFrame=new Set,this._markedFrameNumber=-1,this._dirtyRectangles=[]}get tilingScheme(){return this._tilingScheme}set tilingScheme(t){this._tilingScheme=t}get ellipsoid(){return this._tilingScheme.ellipsoid}remove(t){this._markedThisFrame.delete(t),this._heightReferenceByCollection.delete(t)&&this._markCollectionRegionDirty(t)}has(t){return this._heightReferenceByCollection.has(t)}static isSupported(t){return f3.has(t.constructor)}markForFrame(t,n,i){this._beginFrame(n),this._markedThisFrame.add(t),this._heightReferenceByCollection.has(t)||this._markCollectionRegionDirty(t),this._heightReferenceByCollection.set(t,i)}_beginFrame(t){if(t!==this._markedFrameNumber){for(let n of this._heightReferenceByCollection.keys())this._markedThisFrame.has(n)||(this._heightReferenceByCollection.delete(n),this._markCollectionRegionDirty(n));this._markedThisFrame.clear(),this._markedFrameNumber=t}}_markCollectionRegionDirty(t){let n=re.fromBoundingSphere(t.boundingVolume,this._tilingScheme.ellipsoid,new re);this._dirtyRectangles.push(n)}requestTileData(t,n,i,o,r){let s=this._tilingScheme.tileXYToRectangle(t,n,i,BRe);return this.requestDataForRectangle(s,o,r)}requestDataForRectangle(t,n,i){let o=this._tilingScheme,r=this._heightReferenceByCollection,s={show:!0,hasPolylines:!1,hasPolygons:!1,rectangle:re.clone(t),collectionVersions:new Map,minimumTileScreenPixels:this.minimumTileScreenPixels,metersPerUv:N0t(t,o.ellipsoid)};for(let[d,u]of r){if(!ORe(u,i))continue;let m=re.fromBoundingSphere(d.boundingVolume,o.ellipsoid,DRe);if(!!!re.intersection(t,m,K$))continue;let b=f3.get(d.constructor),f=this._getCollectionDataCached(d,b.packCollectionData);s.collectionVersions.set(d,f.version),b.packTilePrimitives(d,f,t,s)}let a=l(s.polylineSegments)&&s.polylineSegments.length>0,c=l(s.polygonRings)&&s.polygonRings.length>0;return s.hasPolylines=a,s.hasPolygons=c,!a&&!c?(s.show=!1,s):(a&&(Ss.packPolylineGrid(s),Ss.packPolylineTextures(n,s)),c&&(Ss.packPolygonGrid(s),Ss.packPolygonTextures(n,s)),Ss.packPrimitiveTextures(n,s),s)}releaseTileData(t){Ss.freeResources(t)}updateTileData(t,n,i,o,r,s){let a=this._dirtyRectangles,c=this._tilingScheme;return Y0t(t,n,i,a,c)?(this.releaseTileData(r),this.requestTileData(t,n,i,o,s)):r}updateDataForRectangle(t,n,i,o){return this._isStale(i,t,o)?(this.releaseTileData(i),this.requestDataForRectangle(t,n,o)):i}_isStale(t,n,i){if(!re.equals(t.rectangle,n))return!0;let o=t.collectionVersions,r=this._heightReferenceByCollection,s=0;for(let[a,c]of r){if(!ORe(c,i))continue;let d=re.fromBoundingSphere(a.boundingVolume,this._tilingScheme.ellipsoid,DRe),u=!!re.intersection(n,d,K$),m=o.get(a);if(!u){if(l(m))return!0;continue}if(!l(m)||(s++,a._dirtyCount>0||m!==a._version))return!0}return s!==o.size}makeClean(){this._dirtyRectangles.length=0}update(t){l(t)&&this._beginFrame(t);for(let n of this._heightReferenceByCollection.keys()){let i=this._collectionDataCache.get(n);!l(i)||!(n._dirtyCount>0||i.version!==n._version)||(l(i.rectangle)&&this._dirtyRectangles.push(re.clone(i.rectangle)),this._markCollectionRegionDirty(n))}}_getCollectionDataCached(t,n){let i=this._collectionDataCache.get(t),o=t._dirtyCount>0,r=i?.version!==t._version;if(l(i)&&!o&&!r)return i;let s=this.ellipsoid,a=n(t,s,i);return a.version=t._version+(o?1:0),a.rectangle=re.fromBoundingSphere(t.boundingVolume,s,a.rectangle),this._collectionDataCache.set(t,a),t._makeClean(),a}};function ORe(e,t){return e===He.CLAMP_TO_GROUND||e===t}function N0t(e,t){let n=t.maximumRadius,i=(e.south+e.north)*.5;return new k(e.width*n*Math.cos(i),e.height*n)}function Y0t(e,t,n,i,o){if(i.length===0)return!1;let r=o.tileXYToRectangle(e,t,n,BRe);for(let s=0;s<i.length;s++)if(re.intersection(r,i[s],K$))return!0;return!1}var gg=J$;var nIi=x(T(),1);var NFi=x(T(),1);var zRe=new Xc,HRe=new Ta,KRe=new Ir,M0t=new If,w0t=new Nu,k0t=new Xu,j$=class{constructor(t,n,i=0){mt(this,"_color",new U);mt(this,"_outlineColor",new U);this._content=t,this._batchId=n,this._batchTableId=i,this._primitivesByCollection=new Map}addPrimitiveByCollection(t,n){let i=this._primitivesByCollection.get(t);i||(i=[],this._primitivesByCollection.set(t,i)),i.push(n)}get show(){for(let t of this._iteratePrimitives())if(t.show)return!0;return!1}set show(t){for(let n of this._iteratePrimitives())n.show=t}get color(){for(let t of this._iterateMaterials())return U.clone(t.color,this._color);return U.clone(U.WHITE,this._color)}set color(t){for(let n of this._iterateMaterials())U.clone(t,n.color)}get pointSize(){for(let t of this._iteratePointMaterials())return t.size;return 1}set pointSize(t){for(let n of this._iteratePointMaterials())n.size=t}get pointOutlineColor(){for(let t of this._iteratePointMaterials())return U.clone(t.outlineColor,this._outlineColor);return U.clone(U.WHITE,this._outlineColor)}set pointOutlineColor(t){for(let n of this._iteratePointMaterials())U.clone(t,n.outlineColor)}get pointOutlineWidth(){for(let t of this._iteratePointMaterials())return t.outlineWidth;return 0}set pointOutlineWidth(t){for(let n of this._iteratePointMaterials())n.outlineWidth=t}get lineWidth(){for(let t of this._iteratePolylineMaterials())return t.width;return 1}set lineWidth(t){for(let n of this._iteratePolylineMaterials())n.width=t}get lineOutlineColor(){for(let t of this._iteratePolylineMaterials())return U.clone(t.outlineColor,this._outlineColor);return U.clone(U.WHITE,this._outlineColor)}set lineOutlineColor(t){for(let n of this._iteratePolylineMaterials())U.clone(t,n.outlineColor)}get lineOutlineWidth(){for(let t of this._iteratePolylineMaterials())return t.outlineWidth;return 0}set lineOutlineWidth(t){for(let n of this._iteratePolylineMaterials())n.outlineWidth=t}get polygonOutlineColor(){for(let t of this._iteratePolygonMaterials())return U.clone(t.outlineColor,this._outlineColor);return U.clone(U.WHITE,this._outlineColor)}set polygonOutlineColor(t){for(let n of this._iteratePolygonMaterials())U.clone(t,n.outlineColor)}get polygonOutlineWidth(){for(let t of this._iteratePolygonMaterials())return t.outlineWidth;return 0}set polygonOutlineWidth(t){for(let n of this._iteratePolygonMaterials())n.outlineWidth=t}get content(){return this._content}get tileset(){return this._content.tileset}get primitive(){return this._content.tileset}get featureId(){return this._batchId}get _batchTable(){return this._content.batchTables[this._batchTableId]}get pickIds(){let t=[];for(let n of this._iteratePrimitives())t.push(n._pickId);return t}hasProperty(t){return l(this._batchTable)?this._batchTable.hasProperty(this._batchId,t):!1}getPropertyIds(t){return l(this._batchTable)?this._batchTable.getPropertyIds(this._batchId,t):[]}getProperty(t){if(l(this._batchTable))return this._batchTable.getProperty(this._batchId,t)}getPropertyInherited(t){return ia.getPropertyInherited(this._content,this._batchId,t,this._batchTable)}setProperty(t,n){throw new ge("Not implemented")}isExactClass(t){return l(this._batchTable)?this._batchTable.isExactClass(this._batchId,t):!1}isClass(t){return l(this._batchTable)?this._batchTable.isClass(this._batchId,t):!1}getExactClassName(){if(l(this._batchTable))return this._batchTable.getExactClassName(this._batchId)}*_iteratePrimitives(){yield*this._iteratePrimitivesWith(jd,zRe),yield*this._iteratePrimitivesWith(pl,HRe),yield*this._iteratePrimitivesWith(ka,KRe)}*_iteratePrimitivesWith(t,n){let i=this._content._collections;for(let o=0;o<i.length;o++){let r=i[o],s=this._primitivesByCollection.get(o);if(s&&r instanceof t)for(let a of s)r.get(a,n),yield n}}*_iterateMaterials(){yield*this._iteratePointMaterials(),yield*this._iteratePolylineMaterials(),yield*this._iteratePolygonMaterials()}*_iteratePointMaterials(){yield*this._iterateMaterialsWith(jd,zRe,M0t)}*_iteratePolylineMaterials(){yield*this._iterateMaterialsWith(pl,HRe,w0t)}*_iteratePolygonMaterials(){yield*this._iterateMaterialsWith(ka,KRe,k0t)}*_iterateMaterialsWith(t,n,i){for(let o of this._iteratePrimitivesWith(t,n))o.getMaterial(i),yield i,o.setMaterial(i)}},$S=j$;var JRe=new h,U0t=new Xc,D0t=new Ta,QRe=new Ir;function O0t(e,t){let n=t.scene.nodes,i={collections:[],collectionLocalMatrices:[],collectionFeatureTableIds:new Map,featuresByTableId:new Map};for(let o=0;o<n.length;o++)qRe(e,n[o],P.IDENTITY,i);return i}function p3(e){let t=e.BYTES_PER_ELEMENT*8;return Math.pow(2,t)-1}function B0t(e){let t={pointPrimitiveCount:0,pointVertexCount:0,polylinePrimitiveCount:0,polylineVertexCount:0,polygonPrimitiveCount:0,polygonVertexCount:0,polygonHoleCount:0,polygonTriangleCount:0},n=e.vector,i=e.polygon,o=e.primitiveType,s=Zt.getAttributeBySemantic(e,dt.POSITION).count,a=e.indices?Sa.readIndicesAsTypedArray(e.indices):void 0;if(o===Ie.POINTS)t.pointPrimitiveCount+=s,t.pointVertexCount+=s;else if(o===Ie.LINE_STRIP){let c=n?n.count:jRe(a);t.polylinePrimitiveCount+=c,t.polylineVertexCount+=a.length-c+1}else if(o===Ie.TRIANGLES||o===Ie.LINE_LOOP)if(n){t.polygonPrimitiveCount+=n.count,t.polygonVertexCount+=s,t.polygonTriangleCount+=a.length/3;let c=n.polygonHoleCounts;if(c)for(let d=0;d<c.length;d++)t.polygonHoleCount+=c[d]}else{let c=jRe(i.loopIndices);t.polygonPrimitiveCount+=i.count,t.polygonVertexCount+=i.loopIndices.length-c+1,t.polygonTriangleCount+=i.triangleIndices.length,t.polygonHoleCount+=c-i.count}else throw new ae(`Unexpected primitive type: ${o}`);return t}function jRe(e){let t=p3(e),n=0;for(let i=0;i<e.length;i++)e[i]===t&&i+1<e.length&&n++;return n+1}function z0t(e,t,n,i,o){let r=Zt.getAttributeBySemantic(t,dt.POSITION),s=r.typedArray??(n.positionNormalized?Sa.readAttributeAsRawCompactTypedArray(r):Sa.readAttributeAsTypedArray(r)),a=t.indices?Sa.readIndicesAsTypedArray(t.indices):void 0,c=H0t(e,t,o);n instanceof jd?K0t(n,i,s,a,c):n instanceof pl?J0t(n,i,s,a,c):n instanceof ka&&(l(t.vector)?j0t(n,i,s,a,c,t.vector):Q0t(n,i,s,c,t.polygon))}function H0t(e,t,n){let i=e.tileset.featureIdLabel,o=Zt.getFeatureIdsByLabel(t.featureIds,i);if(!(o instanceof Vn.FeatureIdAttribute))return()=>{};let r=Zt.getAttributeBySemantic(t,dt.FEATURE_ID,o.setIndex),s=r.typedArray??Sa.readAttributeAsTypedArray(r);for(let a=0;a<s.length;a++){let c=s[a];if(!n.has(c)){let d=new $S(e,c,o.propertyTableId);n.set(c,d)}}return function(c){let d=s[c];if(d!==o.nullFeatureId)return n.get(d)}}function K0t(e,t,n,i,o){let r=n.length/3;for(let s=0,a=i?i.length:r;s<a;s++){let c=i?i[s]:s;h.fromArray(n,c*3,JRe);let d=o(c);d&&d.addPrimitiveByCollection(t,s),e.add({position:JRe,pickObject:d,featureId:d?.featureId},U0t)}}function J0t(e,t,n,i,o){let r=p3(i),s=0,a=0,c=0;for(let d=0;d<i.length;d++){if(i[d]===r?a=d-s:d+1===i.length&&(a=d+1-s),a===0)continue;let m=s+a,p=i.subarray(s,m),b=$Re(n,p,3),f=o(i[s]);f&&f.addPrimitiveByCollection(t,c),e.add({positions:b,pickObject:f,featureId:f?.featureId},D0t),s=d+1,a=0,c++}}function j0t(e,t,n,i,o,r){let s=r.polygonAttributeOffsets,a=r.polygonIndicesOffsets,c=r.polygonHoleCounts,d=r.polygonHoleOffsets,u=n.length/3,m=s.length;for(let p=0;p<m;p++){let b=s[p],f=p+1<m?s[p+1]:u,y=n.subarray(b*3,f*3),_;if(l(c)&&c[p]>0){let E=c[p];_=d.slice(p,p+E);for(let A=0;A<E;A++)_[A]-=b}let S=a[p],Z=p+1<m?a[p+1]:i.length,R=i.slice(S,Z);for(let E=0;E<R.length;E++)R[E]-=b;let C=o(b);C&&C.addPrimitiveByCollection(t,p),e.add({positions:y,triangles:R,holes:_,pickObject:C,featureId:C?.featureId},QRe)}}function Q0t(e,t,n,i,o){let r=o.loopIndices.constructor,s=new r(o.loopIndices.length),a=p3(o.loopIndices);for(let c=0;c<o.count;c++){let d=c+1===o.count,u=o.loopIndicesOffsets[c],m=d?o.loopIndices.length:o.loopIndicesOffsets[c+1],p=o.loopIndices.subarray(u,m),b=$Re(n,p,3,s),f=[];for(let Z=0;Z<p.length;Z++){let R=Z+1===p.length;p[Z]===a&&!R&&f.push(Z)}let y=new r(f),_;if(l(o.triangleIndices)){let Z=o.triangleIndicesOffsets[c],R=d?o.triangleIndices.length:o.triangleIndicesOffsets[c+1];_=o.triangleIndices.subarray(Z,R);for(let C=0;C<_.length;C++)_[C]=s[_[C]]}else throw new Error("Runtime triangulation not yet supported.");let S=i(p[0]);S&&S.addPrimitiveByCollection(t,c),e.add({positions:b,triangles:_,holes:y,pickObject:S,featureId:S?.featureId},QRe)}}function qRe(e,t,n,i){let o=Zt.getNodeTransform(t),r=P.multiplyTransformation(n,o,new P),s=t.primitives;for(let c=0;c<s.length;c++){let d=s[c],u=d.primitiveType,m,p=B0t(d),b=Zt.getAttributeBySemantic(d,dt.POSITION),f=b.normalized??!1,y=b.componentDatatype;u===Ie.POINTS?m=new jd({primitiveCountMax:p.pointPrimitiveCount,allowPicking:!0,positionNormalized:f,positionDatatype:y}):u===Ie.LINE_STRIP?m=new pl({primitiveCountMax:p.polylinePrimitiveCount,vertexCountMax:p.polylineVertexCount,allowPicking:!0,positionNormalized:f,positionDatatype:y}):(u===Ie.TRIANGLES||u===Ie.LINE_LOOP)&&(m=new ka({primitiveCountMax:p.polygonPrimitiveCount,vertexCountMax:p.polygonVertexCount,holeCountMax:p.polygonHoleCount,triangleCountMax:p.polygonTriangleCount,allowPicking:!0,positionNormalized:f,positionDatatype:y}));let S=d.featureIds?.[0]?.propertyTableId;i.featuresByTableId.has(S)||i.featuresByTableId.set(S,new Map),i.collections.push(m),i.collectionLocalMatrices.push(P.clone(r)),i.collectionFeatureTableIds.set(m,S),z0t(e,d,m,i.collections.length-1,i.featuresByTableId.get(S))}let a=t.children;for(let c=0;c<a.length;c++)qRe(e,a[c],r,i)}function $Re(e,t,n,i){let o=p3(t),r=0;for(let d=0;d<t.length;d++)t[d]!==o&&r++;let s=e.constructor,a=new s(r*n),c=0;for(let d=0;d<t.length;d++){let u=t[d];if(i&&(i[u]=u===o?o:c),u!==o){for(let m=0;m<n;m++)a[c*n+m]=e[u*n+m];c++}}return a}var EY=O0t;var b3=new Xc,g3=new Ta,y3=new Ir,AY=new If,Q$=new Nu,e1e=new Xu,t1e=new P,q$=class e{constructor(t,n,i){this._tileset=t,this._tile=n,this._resource=i,this._model=void 0,this._collections=[],this._collectionLocalMatrices=[],this._collectionFeatureTableIds=new Map,this._featuresByTableId=new Map,this._metadata=void 0,this._group=void 0,this.featurePropertiesDirty=!1,this._ready=!1,this._modelMatrix=P.clone(P.IDENTITY)}get featuresLength(){return this.batchTables.reduce((t,n)=>t+n.featuresLength,0)}get pointsLength(){return this._collections.filter(t=>t instanceof jd).reduce((t,n)=>t+n.primitiveCount,0)}get trianglesLength(){return this._collections.reduce((t,n)=>n instanceof ka?t+n.triangleCount:n instanceof pl?t+(n.vertexCount-n.primitiveCount)*2:t,0)}get geometryByteLength(){return this._collections.reduce((t,n)=>t+n.byteLength,0)}get texturesByteLength(){return 0}get batchTableByteLength(){return this.batchTables.reduce((t,n)=>t+n.batchTableByteLength,0)}get innerContents(){}get ready(){return this._ready}get tileset(){return this._tileset}get tile(){return this._tile}get url(){return this._resource.getUrlComponent(!0)}get batchTables(){return this._model._featureTables}get batchTable(){throw new ge("Deprecated: Use `content.batchTables`.")}get metadata(){return this._metadata}set metadata(t){this._metadata=t}get group(){return this._group}set group(t){this._group=t}getFeature(t,n){return this._featuresByTableId.get(n)?.get(t)}hasProperty(t,n,i){let o=this.getFeature(t,i);return o?o.hasProperty(n):!1}applyDebugSettings(t,n){let i=t?`color("${n.toCssHexString()}", 1.0)`:'color("white", 1.0)';this.applyStyle(new bg({color:i}))}applyStyle(t){let n=r=>r instanceof jd,i=r=>r instanceof pl,o=r=>r instanceof ka;for(let r of this._collections.filter(n)){let s=this._collectionFeatureTableIds.get(r);for(let a=0,c=r.primitiveCount;a<c;a++){r.get(a,b3);let d=this.getFeature(b3.featureId,s);l(t.show)&&(b3.show=t.show.evaluate(d)),l(t.color)&&t.color.evaluate(d,AY.color),l(t.pointSize)&&(AY.size=t.pointSize.evaluate(d)),l(t.pointOutlineWidth)&&(AY.outlineWidth=t.pointOutlineWidth.evaluate(d)),l(t.pointOutlineColor)&&t.pointOutlineColor.evaluate(d,AY.outlineColor),b3.setMaterial(AY)}}for(let r of this._collections.filter(i)){let s=this._collectionFeatureTableIds.get(r);for(let a=0,c=r.primitiveCount;a<c;a++){r.get(a,g3);let d=this.getFeature(g3.featureId,s);l(t.show)&&(g3.show=t.show.evaluate(d)),l(t.color)&&t.color.evaluate(d,Q$.color),l(t.lineWidth)&&(Q$.width=t.lineWidth.evaluate(d)),g3.setMaterial(Q$)}}for(let r of this._collections.filter(o)){let s=this._collectionFeatureTableIds.get(r);for(let a=0,c=r.primitiveCount;a<c;a++){r.get(a,y3);let d=this.getFeature(y3.featureId,s);l(t.show)&&(y3.show=t.show.evaluate(d)),l(t.color)&&t.color.evaluate(d,e1e.color),y3.setMaterial(e1e)}}}update(t,n){let i=this._tileset,o=i._scene?.vectorProvider;if(l(this._model)&&!this._ready){let s=this._model;s.modelMatrix=this._tile.computedTransform,s.update(n),s.ready&&($0t(this),this._ready=!0)}P.multiplyTransformation(this._tile.computedTransform,this._modelMatrix,t1e);let r=l(o)&&this._tile._selectedFrame===n.frameNumber;for(let s=0;s<this._collections.length;s++){let a=this._collections[s];P.multiplyTransformation(t1e,this._collectionLocalMatrices[s],a.modelMatrix),!gs(i._heightReference)||!gg.isSupported(a)?a.update(n):r&&o.markForFrame(a,n.frameNumber,i._heightReference)}}pick(t,n,i){}isDestroyed(){return!1}destroy(){let t=this._tileset._scene?.vectorProvider;this._model?.destroy(),this._model=void 0;for(let n of this._collections)t?.remove(n),n.destroy();return this._collections.length=0,ue(this)}static async fromGltf(t,n,i,o){let r=new e(t,n,i),s=q0t(t,n,r,o),a=await Bu.fromGltfAsync(s);return a.show=!1,r._model=a,r}};function q0t(e,t,n,i){return{gltf:i,basePath:n._resource,cull:!1,releaseGltfJson:!0,opaquePass:Le.CESIUM_3D_TILE,modelMatrix:t.computedTransform,upAxis:e._modelUpAxis,forwardAxis:e._modelForwardAxis,incrementallyLoadTextures:!1,content:n,featureIdLabel:e.featureIdLabel,instanceFeatureIdLabel:e.instanceFeatureIdLabel,projectTo2D:e._projectTo2D,enablePick:e._enablePick,enableDebugWireframe:e._enableDebugWireframe,enableShowOutline:!1}}function $0t(e){let t=e._model.sceneGraph.components,n=Zt.getAxisCorrectionMatrix(t.upAxis,t.forwardAxis,new P);P.multiplyTransformation(t.transform,n,e._modelMatrix);let i=EY(e,t);e._collections=i.collections,e._collectionLocalMatrices=i.collectionLocalMatrices,e._collectionFeatureTableIds=i.collectionFeatureTableIds,e._featuresByTableId=i.featuresByTableId}var Mx=q$;var wPi=x(T(),1);var APi=x(T(),1);var LIi=x(T(),1);function hc(){}hc._maxSortingConcurrency=Math.max(fn.hardwareConcurrency-1,1);hc._sorterTaskProcessor=void 0;hc._taskProcessorReady=!1;hc._error=void 0;hc._getSorterTaskProcessor=function(){if(!l(hc._sorterTaskProcessor)){let e=new qn("gaussianSplatSorter",hc._maxSortingConcurrency);e.initWebAssemblyModule({wasmBinaryFile:"ThirdParty/wasm_splats_bg.wasm"}).then(function(t){t?hc._taskProcessorReady=!0:hc._error=new ae("Gaussian splat sorter could not be initialized.")}).catch(t=>{hc._error=t}),hc._sorterTaskProcessor=e}return hc._sorterTaskProcessor};hc.radixSortIndexes=function(e){let t=hc._getSorterTaskProcessor();if(l(hc._error))throw hc._error;if(hc._taskProcessorReady)return t.scheduleTask(e,[e.primitive.positions.buffer])};var eZ=hc;var XIi=x(T(),1);function fc(){}fc._maxSortingConcurrency=Math.max(fn.hardwareConcurrency-1,1);fc._textureTaskProcessor=void 0;fc._taskProcessorReady=!1;fc._error=void 0;fc._getTextureTaskProcessor=function(){if(!l(fc._textureTaskProcessor)){let e=new qn("gaussianSplatTextureGenerator",fc._maxSortingConcurrency);e.initWebAssemblyModule({wasmBinaryFile:"ThirdParty/wasm_splats_bg.wasm"}).then(function(t){t?fc._taskProcessorReady=!0:fc._error=new ae("Gaussian splat sorter could not be initialized.")}).catch(t=>{fc._error=t}),fc._textureTaskProcessor=e}return fc._textureTaskProcessor};fc.generateFromAttributes=function(e){let t=fc._getTextureTaskProcessor();if(l(fc._error))throw fc._error;if(!fc._taskProcessorReady)return;let{attributes:n}=e;return t.scheduleTask(e,[n.positions.buffer,n.scales.buffer,n.rotations.buffer,n.colors.buffer])};var GY=fc;var DIi=x(T(),1);function ebt(e){let t=new lb;this.shaderBuilder=t,this.uniformMap={},this.renderStateOptions=ze.getState(ze.fromCache({depthTest:{enabled:!0,func:sc.LESS_OR_EQUAL}})),this.alphaOptions=new wS,this.hasSkipLevelOfDetail=!1,e._useLogDepth&&t.addDefine("LOG_DEPTH_READ_ONLY",void 0,fe.FRAGMENT)}var LY=ebt;var tZ=new P,a1e=new P,WY=new P,Ei=new q,vY=new Ne,tbt=new h,nbt=new Ne,ibt=new h,obt=1e-12,x3=1e-5,$$=1e-7,za={IDLE:0,WAITING:1,SORTING:2,SORTED:3,ERROR:4},Bs={BUILDING:"BUILDING",TEXTURE_PENDING:"TEXTURE_PENDING",TEXTURE_READY:"TEXTURE_READY",SORTING:"SORTING",READY:"READY"},rbt=2,sbt=30,abt=3,cbt=.008726646259971648,lbt=1;function dbt(e,t){let n=e._lastSteadySortFrameNumber>=0?t.frameNumber-e._lastSteadySortFrameNumber:Number.POSITIVE_INFINITY;if(e._lastSteadySortFrameNumber>=0&&n<abt)return!1;let i=t.camera;return l(i)?!e._hasLastSteadySortCameraPosition||!e._hasLastSteadySortCameraDirection||h.distance(i.positionWC,e._lastSteadySortCameraPosition)>=lbt?!0:h.angleBetween(i.directionWC,e._lastSteadySortCameraDirection)>=cbt:!1}function n1e(e,t){e._lastSteadySortFrameNumber=t.frameNumber;let n=t.camera;l(n)&&(h.clone(n.positionWC,e._lastSteadySortCameraPosition),e._hasLastSteadySortCameraPosition=!0,h.clone(n.directionWC,e._lastSteadySortCameraDirection),e._hasLastSteadySortCameraDirection=!0)}function ubt(e,t){let n=e._selectedTileSet;if(!l(n)||n.size!==t.length)return!0;for(let i=0;i<t.length;i++)if(!n.has(t[i]))return!0;return!1}function i1e(e,t){return l(t)&&t.requestId===e._sortRequestId&&t.dataGeneration===e._splatDataGeneration}function eee(e){l(e)&&(l(e.gaussianSplatTexture)&&(e.gaussianSplatTexture.destroy(),e.gaussianSplatTexture=void 0),l(e.sphericalHarmonicsTexture)&&(e.sphericalHarmonicsTexture.destroy(),e.sphericalHarmonicsTexture=void 0))}function o1e(e,t,n){if(!l(t))return;e._retiredTextures.push({texture:t,frameNumber:n})}function mbt(e,t){let n=e._retiredTextures;if(!l(n)||n.length===0)return;let i=[];for(let o=0;o<n.length;o++){let r=n[o];t-r.frameNumber>0?r.texture.destroy():i.push(r)}e._retiredTextures=i}function hbt(e,t){let n=e?.[t];return l(n)?n.buffer:void 0}function fbt(e,t,n,i){let o=e._aggregateScratchBuffers[t];l(o)||(o=[],e._aggregateScratchBuffers[t]=o);let r=hbt(e._snapshot,t);for(let a=0;a<o.length;a++){let c=o[a];if(c.length>=i&&c.buffer!==r)return c}let s=J.createTypedArray(n,i);return o.push(s),s}function pbt(e,t){return e.length===t?e:e.subarray(0,t)}function bbt(e,t,n){if(!l(t.indexes)||t.state!==Bs.READY)throw new ge("Committing snapshot before it is READY.");let i=n.frameNumber,o=e._snapshot,r=l(o)?o.gaussianSplatTexture:e.gaussianSplatTexture;l(r)&&r!==t.gaussianSplatTexture&&o1e(e,r,i);let s=l(o)?o.sphericalHarmonicsTexture:e.sphericalHarmonicsTexture;l(s)&&s!==t.sphericalHarmonicsTexture&&o1e(e,s,i),e._snapshot=t,e._positions=t.positions,e._rotations=t.rotations,e._scales=t.scales,e._colors=t.colors,e._shData=t.shData,e._sphericalHarmonicsDegree=t.sphericalHarmonicsDegree,e._numSplats=t.numSplats,e._indexes=t.indexes,e.gaussianSplatTexture=t.gaussianSplatTexture,e.sphericalHarmonicsTexture=t.sphericalHarmonicsTexture,e._lastTextureWidth=t.lastTextureWidth,e._lastTextureHeight=t.lastTextureHeight,e._splatRowMask=t.splatRowMask,e._splatRowShift=t.splatRowShift,e._splatBudgetSSEScale=t.splatBudgetSSEScale??1,e._hasGaussianSplatTexture=l(t.gaussianSplatTexture),e._needsGaussianSplatTexture=!1,e._gaussianSplatTexturePending=!1,e._vertexArray=void 0,e._vertexArrayLen=-1,e._drawCommand=void 0,e._sorterPromise=void 0,e._activeSort=void 0,e._sorterState=za.IDLE,e._dirty=!1}async function gbt(e,t,n,i){try{let o=await i,r=wt.maximumTextureSize,s=r,a=Math.ceil(n.numSplats/(r/2)),c=Math.log2(r/2),d=r/2-1;if(a>r){let b=n.numSplats;a=r;let f=s/2;if(n.numSplats=r*f,n.positions=n.positions.subarray(0,n.numSplats*3),n.rotations=n.rotations.subarray(0,n.numSplats*4),n.scales=n.scales.subarray(0,n.numSplats*3),n.colors=n.colors.subarray(0,n.numSplats*4),l(n.shData)){let y=n.shData.length/b;n.shData=n.shData.subarray(0,Math.floor(n.numSplats*y))}n.splatBudgetSSEScale=b/n.numSplats,console.warn(`[GaussianSplat][HARD CAP] ${b} splats exceed the maximum texture capacity (${r}\xD7${f} = ${n.numSplats} splats at width=${s}). Rendering only the first ${n.numSplats} splats to avoid a WebGL crash. Increasing maximumScreenSpaceError by ${n.splatBudgetSSEScale.toFixed(2)}x next frame.`)}else n.splatBudgetSSEScale=1;let u=s*a*4,m;u<=o.data.length?m=o.data.subarray(0,u):(m=new Uint32Array(u),m.set(o.data));let p={width:s,height:a,data:m};if(n.splatRowMask=d,n.splatRowShift=c,e._pendingSnapshot!==n){n.state=Bs.BUILDING;return}if(!l(n.gaussianSplatTexture))n.gaussianSplatTexture=s1e(t.context,p);else if(n.lastTextureHeight!==p.height||n.lastTextureWidth!==p.width){let b=n.gaussianSplatTexture;n.gaussianSplatTexture=s1e(t.context,p),b.destroy()}else n.gaussianSplatTexture.copyFrom({source:{width:p.width,height:p.height,arrayBufferView:p.data}});if(n.lastTextureHeight=p.height,n.lastTextureWidth=p.width,l(n.shData)&&n.sphericalHarmonicsDegree>0){let b=n.sphericalHarmonicsTexture,f=wt.maximumTextureSize,y=n.shCoefficientCount/3,_=Math.floor(f/y),S=_*(y*2),Z=Math.ceil(n.numSplats/_);if(Z>f)console.warn(`[GaussianSplat][SHTexture] ${n.numSplats} splats require SH height ${Z} > maxTex ${f}. Disabling spherical harmonics for this snapshot (color-only fallback).`),n.sphericalHarmonicsDegree=0,l(b)&&b.destroy(),n.sphericalHarmonicsTexture=void 0;else{let R=new Uint32Array(f*Z*2),C=0;for(let E=0;C<n.shData.length;E+=f*2)R.set(n.shData.subarray(C,C+S),E),C+=S;n.sphericalHarmonicsTexture=xbt(t.context,{data:R,width:f,height:Z}),l(b)&&b.destroy()}}n.state=Bs.TEXTURE_READY}catch(o){console.error("Error generating Gaussian splat texture:",o),n.state=Bs.BUILDING}}async function ybt(e,t,n,i){try{let o=await i;if(!l(n)||n.snapshot!==e._pendingSnapshot)return;let r=n.expectedCount,s=r,a=o?.length;if(r!==s||a!==r){e._pendingSortPromise=void 0,e._pendingSort=void 0,n.snapshot.state===Bs.SORTING&&(n.snapshot.state=Bs.TEXTURE_READY);return}let c=n.snapshot;c.indexes=o,c.state=Bs.READY,e._pendingSortPromise=void 0,e._pendingSort=void 0,bbt(e,c,t),e._pendingSnapshot=void 0,ld.buildGSplatDrawCommand(e,t)}catch(o){if(!l(n)||n.snapshot!==e._pendingSnapshot)return;e._pendingSortPromise=void 0,e._pendingSort=void 0,n.snapshot.state===Bs.SORTING&&(n.snapshot.state=Bs.TEXTURE_READY),e._sorterState=za.ERROR,e._sorterError=o}}async function r1e(e,t,n){try{let i=await n,o=i1e(e,t),r=t?.expectedCount,s=r,a=i?.length;if(!o||(r!==s||a!==r)){o&&(e._sorterPromise=void 0,e._sorterState=za.IDLE);return}e._indexes=i,e._sorterState=za.SORTED}catch(i){if(!i1e(e,t))return;e._sorterState=za.ERROR,e._sorterError=i}}function xbt(e,t){return new vt({context:e,source:{width:t.width,height:t.height,arrayBufferView:t.data},preMultiplyAlpha:!1,skipColorSpaceConversion:!0,pixelFormat:Qe.RG_INTEGER,pixelDatatype:Ue.UNSIGNED_INT,flipY:!1,sampler:Ot.NEAREST})}function s1e(e,t){return new vt({context:e,source:{width:t.width,height:t.height,arrayBufferView:t.data},preMultiplyAlpha:!1,skipColorSpaceConversion:!0,pixelFormat:Qe.RGBA_INTEGER,pixelDatatype:Ue.UNSIGNED_INT,flipY:!1,sampler:Ot.NEAREST})}function ld(e){e=e??B.EMPTY_OBJECT,this._positions=void 0,this._rotations=void 0,this._scales=void 0,this._colors=void 0,this._indexes=void 0,this._numSplats=0,this._needsGaussianSplatTexture=!0,this._snapshot=void 0,this._pendingSnapshot=void 0,this._retiredTextures=[],this._aggregateScratchBuffers={positions:[],scales:[],rotations:[],colors:[]},this._scratchAggregateShBuffer=void 0,this._selectedTilesStableFrames=0,this._needsSnapshotRebuild=!1,this._snapshotRebuildStallFrames=0,this._prevViewMatrix=new P,this._debugShowBoundingVolume=e.debugShowBoundingVolume??!1,this.gaussianSplatTexture=void 0,this.sphericalHarmonicsTexture=void 0,this._lastTextureWidth=0,this._lastTextureHeight=0,this._vertexArray=void 0,this._vertexArrayLen=-1,this._splitDirection=Ur.NONE,this._dirty=!1,this._tileset=e.tileset,this._baseTilesetUpdate=this._tileset.update,this._tileset.update=this._wrappedUpdate.bind(this),this._tileset.tileLoad.addEventListener(this.onTileLoad,this),this._tileset.tileVisible.addEventListener(this.onTileVisible,this),this.selectedTileLength=0,this._selectedTileSet=new Set,this._ready=!1,this._hasGaussianSplatTexture=!1,this._gaussianSplatTexturePending=!1,this._drawCommand=void 0,this._drawCommandModelMatrix=new P,this._rootTransform=void 0,this._axisCorrectionMatrix=Zt.getAxisCorrectionMatrix(Bi.Y,Bi.X,new P),this._shInverseRotation=new q,this._isDestroyed=!1,this._sorterState=za.IDLE,this._sorterPromise=void 0,this._splatDataGeneration=0,this._sortRequestId=0,this._activeSort=void 0,this._pendingSortPromise=void 0,this._pendingSort=void 0,this._lastSteadySortFrameNumber=-1,this._lastSteadySortCameraPosition=new h,this._hasLastSteadySortCameraPosition=!1,this._lastSteadySortCameraDirection=new h,this._hasLastSteadySortCameraDirection=!1,this._sorterError=void 0,this._splatRowMask=0,this._splatRowShift=0,this._splatBudgetSSEScale=1}Object.defineProperties(ld.prototype,{ready:{get:function(){return this._ready}},isStable:{get:function(){return!this._dirty&&(!l(this._pendingSnapshot)||this._pendingSnapshot.state===Bs.READY)}},splitDirection:{get:function(){return this._splitDirection},set:function(e){this._splitDirection!==e&&(this._splitDirection=e,this._dirty=!0)}}});ld.prototype._wrappedUpdate=function(e){let t=this._tileset;if(this._splatBudgetSSEScale!==1){let n=t.maximumScreenSpaceError;t.maximumScreenSpaceError*=this._splatBudgetSSEScale,this._baseTilesetUpdate.call(t,e),t.maximumScreenSpaceError=n}else this._baseTilesetUpdate.call(t,e);this.update(e)};ld.prototype.destroy=function(){if(this._positions=void 0,this._rotations=void 0,this._scales=void 0,this._colors=void 0,this._indexes=void 0,eee(this._pendingSnapshot),eee(this._snapshot),l(this._retiredTextures))for(let t=0;t<this._retiredTextures.length;t++)this._retiredTextures[t].texture.destroy();this._retiredTextures=[],this._pendingSnapshot=void 0,this._snapshot=void 0,this._aggregateScratchBuffers=void 0,this.gaussianSplatTexture=void 0,this.sphericalHarmonicsTexture=void 0;let e=this._drawCommand;return l(e)&&(e.shaderProgram=e.shaderProgram&&e.shaderProgram.destroy()),l(this._vertexArray)&&(this._vertexArray.destroy(),this._vertexArray=void 0),this._tileset.update=this._baseTilesetUpdate.bind(this._tileset),ue(this)};ld.prototype.isDestroyed=function(){return this._isDestroyed};ld.prototype.onTileLoad=function(e){this._dirty=!0};ld.prototype.onTileVisible=function(e){};ld.transformTile=function(e){let t=e.computedTransform,n=e.content.gltfPrimitive,i=e.tileset.gaussianSplatPrimitive;i._rootTransform===void 0&&(i._rootTransform=_t.eastNorthUpToFixedFrame(e.tileset.boundingSphere.center));let o=i._rootTransform,r=P.multiplyTransformation(t,i._axisCorrectionMatrix,tZ);P.multiplyTransformation(r,e.content.worldTransform,r);let s=P.inverse(o,a1e),a=P.multiplyTransformation(s,r,tZ),c=e.content._lastSplatTransform;if(e.content._transformed&&l(c)&&P.equalsEpsilon(a,c,obt))return;let d=e.content.positions,u=e.content.rotations,m=e.content.scales,p=Math.sqrt(a[0]*a[0]+a[1]*a[1]+a[2]*a[2]),b=Math.sqrt(a[4]*a[4]+a[5]*a[5]+a[6]*a[6]),f=Math.sqrt(a[8]*a[8]+a[9]*a[9]+a[10]*a[10]);Ei[0]=a[0]/p,Ei[1]=a[1]/p,Ei[2]=a[2]/p,Ei[3]=a[4]/b,Ei[4]=a[5]/b,Ei[5]=a[6]/b,Ei[6]=a[8]/f,Ei[7]=a[9]/f,Ei[8]=a[10]/f;let y=Ei[0]*Ei[3]+Ei[1]*Ei[4]+Ei[2]*Ei[5],_=Ei[0]*Ei[6]+Ei[1]*Ei[7]+Ei[2]*Ei[8],S=Ei[3]*Ei[6]+Ei[4]*Ei[7]+Ei[5]*Ei[8],Z=Math.abs(p-1)<=$$&&Math.abs(b-1)<=$$&&Math.abs(f-1)<=$$,R=Math.abs(y)<=x3&&Math.abs(_)<=x3&&Math.abs(S)<=x3,C=Ei[0]*(Ei[4]*Ei[8]-Ei[5]*Ei[7])-Ei[3]*(Ei[1]*Ei[8]-Ei[2]*Ei[7])+Ei[6]*(Ei[1]*Ei[5]-Ei[2]*Ei[4]),E=Z&&R&&Math.abs(C-1)<=x3;Ne.fromRotationMatrix(Ei,vY),Ne.normalize(vY,vY);let A=Zt.getAttributeBySemantic(n,dt.POSITION).typedArray,L=Zt.getAttributeBySemantic(n,dt.ROTATION).typedArray,F=Zt.getAttributeBySemantic(n,dt.SCALE).typedArray,I=tbt,N=nbt,g=ibt;for(let V=0;V<A.length/3;++V)I.x=A[V*3],I.y=A[V*3+1],I.z=A[V*3+2],N.x=L[V*4],N.y=L[V*4+1],N.z=L[V*4+2],N.w=L[V*4+3],g.x=F[V*3],g.y=F[V*3+1],g.z=F[V*3+2],E?(P.multiplyByPoint(a,I,I),Ne.multiply(vY,N,N),Ne.normalize(N,N)):(P.fromTranslationQuaternionRotationScale(I,N,g,WY),P.multiplyTransformation(a,WY,WY),P.getTranslation(WY,I),P.getScale(WY,g),Ne.multiply(vY,N,N),Ne.normalize(N,N)),d[V*3]=I.x,d[V*3+1]=I.y,d[V*3+2]=I.z,u[V*4]=N.x,u[V*4+1]=N.y,u[V*4+2]=N.z,u[V*4+3]=N.w,m[V*3]=g.x,m[V*3+1]=g.y,m[V*3+2]=g.z;e.content._lastSplatTransform=P.clone(a,e.content._lastSplatTransform),e.content._transformed=!0};ld.generateSplatTexture=function(e,t,n){if(!l(n)||n.state!==Bs.BUILDING)return;n.state=Bs.TEXTURE_PENDING;let i=GY.generateFromAttributes({attributes:{positions:new Float32Array(n.positions),scales:new Float32Array(n.scales),rotations:new Float32Array(n.rotations),colors:new Uint8Array(n.colors)},count:n.numSplats});if(!l(i)){n.state=Bs.BUILDING;return}gbt(e,t,n,i)};ld.buildGSplatDrawCommand=function(e,t){let n=e._tileset,i=new LY(e),{shaderBuilder:o}=i,r=i.renderStateOptions;r.cull.enabled=!1,r.depthMask=!1,r.depthTest.enabled=!0,r.blending=on.PRE_MULTIPLIED_ALPHA_BLEND,i.alphaOptions.pass=Le.GAUSSIAN_SPLATS,o.addAttribute("vec2","a_screenQuadPosition"),o.addAttribute("float","a_splatIndex"),o.addVarying("vec4","v_splatColor"),o.addVarying("vec2","v_vertPos"),o.addUniform("float","u_splitDirection",fe.VERTEX),o.addVarying("float","v_splitDirection"),o.addUniform("highp usampler2D","u_splatAttributeTexture",fe.VERTEX),o.addUniform("float","u_sphericalHarmonicsDegree",fe.VERTEX),o.addUniform("float","u_splatScale",fe.VERTEX),o.addUniform("vec3","u_cameraPositionWC",fe.VERTEX),o.addUniform("mat3","u_inverseModelRotation",fe.VERTEX);let s=i.uniformMap;o.addUniform("int","u_splatRowMask",fe.VERTEX),o.addUniform("int","u_splatRowShift",fe.VERTEX);let a=e.gaussianSplatTexture;s.u_splatAttributeTexture=function(){return a},s.u_splatRowMask=function(){return e._splatRowMask},s.u_splatRowShift=function(){return e._splatRowShift},e._sphericalHarmonicsDegree>0&&(o.addDefine("HAS_SPHERICAL_HARMONICS","1",fe.VERTEX),o.addUniform("highp usampler2D","u_sphericalHarmonicsTexture",fe.VERTEX),s.u_sphericalHarmonicsTexture=function(){return e.sphericalHarmonicsTexture}),s.u_sphericalHarmonicsDegree=function(){return e._sphericalHarmonicsDegree},s.u_cameraPositionWC=function(){return h.clone(t.camera.positionWC)},s.u_inverseModelRotation=function(){return e._shInverseRotation},s.u_splitDirection=function(){return e.splitDirection};let c=l(e._indexes)?e._indexes.length:e._numSplats;i.instanceCount=c,i.count=4,i.primitiveType=Ie.TRIANGLE_STRIP,o.addVertexLines(n2),o.addFragmentLines(t2);let d=o.buildShaderProgram(t.context),u=$e(ze.fromCache(i.renderStateOptions),!0);u.cull.face=Zt.getCullFace(n.modelMatrix,Ie.TRIANGLE_STRIP),u=ze.fromCache(u);let m={screenQuadPosition:0,splatIndex:2},p=new Vn.Attribute;if(p.name="_SPLAT_INDEXES",p.typedArray=e._indexes,p.componentDatatype=J.UNSIGNED_INT,p.type=Dt.SCALAR,p.normalized=!1,p.count=i.instanceCount,p.constant=0,p.instanceDivisor=1,!l(e._vertexArray)||e._indexes.length>e._vertexArrayLen){let S=new At({attributes:{screenQuadPosition:new Xe({componentDatatype:J.FLOAT,componentsPerAttribute:2,values:[-1,-1,1,-1,1,1,-1,1],name:"_SCREEN_QUAD_POS",variableName:"screenQuadPosition"}),splatIndex:{...p,variableName:"splatIndex"}},primitiveType:Ie.TRIANGLE_STRIP});e._vertexArray=Un.fromGeometry({context:t.context,geometry:S,attributeLocations:m,bufferUsage:Pe.DYNAMIC_DRAW,interleave:!1})}else e._vertexArray.getAttribute(1).vertexBuffer.copyFromArrayView(e._indexes);e._vertexArrayLen=e._indexes.length;let f=P.clone(e._rootTransform,e._drawCommandModelMatrix),y=e._vertexArray,_=new lt({boundingVolume:n.boundingSphere,modelMatrix:f,uniformMap:s,renderState:u,vertexArray:y,shaderProgram:d,cull:r.cull.enabled,pass:Le.GAUSSIAN_SPLATS,count:i.count,owner:e,instanceCount:i.instanceCount,primitiveType:Ie.TRIANGLE_STRIP,debugShowBoundingVolume:n.debugShowBoundingVolume,castShadows:!1,receiveShadows:!1});e._drawCommand=_};ld.prototype.update=function(e){let t=this._tileset;if(mbt(this,e.frameNumber),!t.show)return;if(this._drawCommand&&e.commandList.push(this._drawCommand),t._modelMatrixChanged){this._dirty=!0;return}let n=l(this._rootTransform);if(e.passes.pick===!0)return;this.splitDirection!==t.splitDirection&&(this.splitDirection=t.splitDirection);let i=e.camera;if(l(i)){if(this._sorterState===za.IDLE){let o=t._selectedTiles.length!==0&&ubt(this,t._selectedTiles);t._selectedTiles.length===0?(this._selectedTilesStableFrames=0,this._needsSnapshotRebuild=!1,this._snapshotRebuildStallFrames=0):o?this._selectedTilesStableFrames=0:this._selectedTilesStableFrames++,(o||this._dirty)&&(this._needsSnapshotRebuild=!0);let r=this._selectedTilesStableFrames>=rbt,s=!l(this._snapshot)&&!l(this._pendingSnapshot)&&!l(this._drawCommand);this._needsSnapshotRebuild&&t._selectedTiles.length!==0?this._snapshotRebuildStallFrames++:this._snapshotRebuildStallFrames=0;let a=r||s||this._snapshotRebuildStallFrames>=sbt;if(!(this._dirty||this._needsSnapshotRebuild||o||l(this._pendingSnapshot)||l(this._pendingSortPromise)||!l(this._drawCommand))&&P.equals(i.viewMatrix,this._prevViewMatrix))return;if(t._selectedTiles.length!==0&&this._needsSnapshotRebuild&&a){this._splatDataGeneration++,this._activeSort=void 0,this._sorterPromise=void 0,this._sorterState=za.IDLE,this._pendingSortPromise=void 0,this._pendingSort=void 0,l(this._pendingSnapshot)&&eee(this._pendingSnapshot);let d=t._selectedTiles;this._rootTransform=_t.eastNorthUpToFixedFrame(t.boundingSphere.center);{let C=d[0],E=P.multiplyTransformation(C.computedTransform,this._axisCorrectionMatrix,a1e);P.multiplyTransformation(E,C.content.worldTransform??P.IDENTITY,E),P.getRotation(P.inverse(E,E),this._shInverseRotation)}for(let C of d)ld.transformTile(C);let u=d.reduce((C,E)=>C+E.content.pointsLength,0),m=(C,E,A,L)=>{let F,I=0,N=0;for(let g of d){let V=A(g.content),G=l(L)?L:Dt.getNumberOfComponents(V.type),v=l(V.typedArray)?V.typedArray:V;N+=v.length,l(F)||(F=fbt(this,C,E,u*G))}if(!l(F))return J.createTypedArray(E,0);for(let g of d){let V=g.content,G=A(V),v=l(G.typedArray)?G.typedArray:G;F.set(v,I),I+=v.length}return pbt(F,N)},p=()=>{let C=0;for(let F of d)if(F.content.sphericalHarmonicsDegree>0){switch(F.content.sphericalHarmonicsDegree){case 1:C=9;break;case 2:C=24;break;case 3:C=45;break}break}if(C===0)return;let E=u*(C*(2/3));(!l(this._scratchAggregateShBuffer)||this._scratchAggregateShBuffer.length<E)&&(this._scratchAggregateShBuffer=new Uint32Array(E));let A=this._scratchAggregateShBuffer,L=0;for(let F of d){let I=F.content.packedSphericalHarmonicsData;F.content.sphericalHarmonicsDegree>0&&(A.set(I,L),L+=I.length)}return L<A.length?A.subarray(0,L):A},b=m("positions",J.FLOAT,C=>C.positions,3),f=m("scales",J.FLOAT,C=>C.scales,3),y=m("rotations",J.FLOAT,C=>C.rotations,4),_=m("colors",J.UNSIGNED_BYTE,C=>Zt.getAttributeBySemantic(C.gltfPrimitive,dt.COLOR)),S=d[0].content.sphericalHarmonicsDegree,Z=S>0?d[0].content.sphericalHarmonicsCoefficientCount:0,R=p();this._pendingSnapshot={generation:this._splatDataGeneration,positions:b,rotations:y,scales:f,colors:_,shData:R,sphericalHarmonicsDegree:S,shCoefficientCount:Z,numSplats:u,indexes:void 0,gaussianSplatTexture:void 0,sphericalHarmonicsTexture:void 0,lastTextureWidth:0,lastTextureHeight:0,splatRowMask:0,splatRowShift:0,state:Bs.BUILDING},this.selectedTileLength=t._selectedTiles.length,this._selectedTileSet=new Set(t._selectedTiles),this._dirty=!1,this._needsSnapshotRebuild=!1,this._snapshotRebuildStallFrames=0}if(l(this._pendingSnapshot)){let d=this._pendingSnapshot;if(d.state===Bs.BUILDING){ld.generateSplatTexture(this,e,d);return}if(d.state===Bs.TEXTURE_PENDING||d.state===Bs.TEXTURE_READY&&!l(d.gaussianSplatTexture)||!n)return;if(P.clone(i.viewMatrix,this._prevViewMatrix),P.multiply(i.viewMatrix,this._rootTransform,tZ),d.state===Bs.TEXTURE_READY&&!l(this._pendingSortPromise)){let u=++this._sortRequestId,m=this._splatDataGeneration;this._pendingSort={requestId:u,dataGeneration:m,expectedCount:d.numSplats,snapshot:d};let p=eZ.radixSortIndexes({primitive:{positions:new Float32Array(d.positions),modelView:Float32Array.from(tZ),count:d.numSplats},sortType:"Index"});if(!l(p)){this._pendingSortPromise=void 0,this._pendingSort=void 0,d.state=Bs.TEXTURE_READY;return}this._pendingSortPromise=p,d.state=Bs.SORTING;let b=this._pendingSort;ybt(this,e,b,p);return}if(!l(this._pendingSortPromise)){d.state===Bs.SORTING&&(d.state=Bs.TEXTURE_READY);return}return}if(this._numSplats===0||!n)return;if(P.clone(i.viewMatrix,this._prevViewMatrix),P.multiply(i.viewMatrix,this._rootTransform,tZ),!l(this._sorterPromise)){if(!dbt(this,e))return;let d=++this._sortRequestId,u=this._splatDataGeneration,m=this._numSplats;this._activeSort={requestId:d,dataGeneration:u,expectedCount:m};let p=eZ.radixSortIndexes({primitive:{positions:new Float32Array(this._positions),modelView:Float32Array.from(tZ),count:this._numSplats},sortType:"Index"});if(this._sorterPromise=p,l(p)){n1e(this,e);let b=this._activeSort;this._sorterState=za.SORTING,r1e(this,b,p);return}}if(!l(this._sorterPromise)){this._sorterState=za.WAITING;return}this._sorterState=za.SORTING;return}else if(this._sorterState===za.WAITING){if(!l(this._sorterPromise)){let o=++this._sortRequestId,r=this._splatDataGeneration,s=this._numSplats;this._activeSort={requestId:o,dataGeneration:r,expectedCount:s};let a=eZ.radixSortIndexes({primitive:{positions:new Float32Array(this._positions),modelView:Float32Array.from(tZ),count:this._numSplats},sortType:"Index"});if(this._sorterPromise=a,l(a)){n1e(this,e);let c=this._activeSort;this._sorterState=za.SORTING,r1e(this,c,a);return}}if(!l(this._sorterPromise)){this._sorterState=za.WAITING;return}this._sorterState=za.SORTING;return}else{if(this._sorterState===za.SORTING)return;if(this._sorterState===za.SORTED)ld.buildGSplatDrawCommand(this,e),this._sorterState=za.IDLE,this._dirty=!1,this._sorterPromise=void 0,this._activeSort=void 0;else if(this._sorterState===za.ERROR)throw this._sorterError}this._dirty=!1}};var FY=ld;var nee=class e{constructor(t,n,i,o){this._tileset=n,this._tile=i,this._resource=o,this._loader=t,l(this._tileset.gaussianSplatPrimitive)||(this._tileset.gaussianSplatPrimitive=new FY({tileset:this._tileset})),this._positions=void 0,this._rotations=void 0,this._scales=void 0,this.gltfPrimitive=void 0,this.worldTransform=void 0,this.featurePropertiesDirty=!1,this._metadata=void 0,this._group=void 0,this._ready=!1,this._transformed=!1,this._sphericalHarmonicsDegree=0,this._sphericalHarmonicsCoefficientCount=0,this._packedSphericalHarmonicsData=void 0,this._lastSplatTransform=void 0}static tilesetRequiresGaussianSplattingExt(t){let n=!1;return t.isGltfExtensionRequired instanceof Function&&(n=t.isGltfExtensionRequired("KHR_gaussian_splatting")&&t.isGltfExtensionRequired("KHR_gaussian_splatting_compression_spz_2"),t.isGltfExtensionRequired("KHR_spz_gaussian_splats_compression")&&Jo("KHR_spz_gaussian_splats_compression",`Support for the original KHR_spz_gaussian_splats_compression extension has been removed in favor of the up to date KHR_gaussian_splatting and KHR_gaussian_splatting_compression_spz_2 extensions -Please retile your tileset with the KHR_gaussian_splatting and KHR_gaussian_splatting_compression_spz_2 extensions.`)),n}get featuresLength(){return 0}get pointsLength(){return this.gltfPrimitive.attributes[0].count}get trianglesLength(){return 0}get geometryByteLength(){return 0}get texturesByteLength(){let t=this._tileset?.gaussianSplatPrimitive;if(!l(t))return 0;let n=t.gaussianSplatTexture,i=t.selectedTileLength;return!l(n)||i===0?0:n.sizeInBytes/i}get batchTableByteLength(){return 0}get innerContents(){}get ready(){return this._ready}get transformed(){return this._transformed}get tileset(){return this._tileset}get tile(){return this._tile}get url(){return this._resource.getUrlComponent(!0)}get batchTable(){}get metadata(){return this._metadata}set metadata(t){this._metadata=t}get group(){return this._group}set group(t){this._group=t}get positions(){return this._positions}get rotations(){return this._rotations}get scales(){return this._scales}get sphericalHarmonicsCoefficientCount(){return this._sphericalHarmonicsCoefficientCount}get sphericalHarmonicsDegree(){return this._sphericalHarmonicsDegree}get packedSphericalHarmonicsData(){return this._packedSphericalHarmonicsData}static async fromGltf(t,n,i,o){let r=i,s=ve.createIfNeeded(r),a={releaseGltfJson:!1,upAxis:Bi.Y,forwardAxis:Bi.Z};l(o.asset)?(a.gltfJson=o,a.baseResource=s,a.gltfResource=s):o instanceof Uint8Array?(a.typedArray=o,a.baseResource=s,a.gltfResource=s):a.gltfResource=ve.createIfNeeded(o);let c=new vu(a);try{await c.load()}catch(d){throw c.destroy(),new ae(`Failed to load glTF: ${d.message}`)}return new e(c,t,n,i)}update(t,n){let i=this._loader;if(!this._ready){if(n.afterRender.push(()=>!0),!l(i)){this._ready=!0;return}if(this._resourcesLoaded){this.gltfPrimitive=i.components.scene.nodes[0].primitives[0],this.worldTransform=i.components.scene.nodes[0].matrix,this._ready=!0,this._positions=Zt.getAttributeBySemantic(this.gltfPrimitive,dt.POSITION).typedArray.slice(),this._rotations=Zt.getAttributeBySemantic(this.gltfPrimitive,dt.ROTATION).typedArray.slice(),this._scales=Zt.getAttributeBySemantic(this.gltfPrimitive,dt.SCALE).typedArray.slice();let{l:o,n:r}=Wmt(this.gltfPrimitive.attributes);this._sphericalHarmonicsDegree=o,this._sphericalHarmonicsCoefficientCount=r,this._packedSphericalHarmonicsData=Pmt(this);return}this._resourcesLoaded=i.process(n)}}hasProperty(t,n){return!1}getFeature(t){}applyDebugSettings(t,n){}applyStyle(t){}pick(t,n,i){}isDestroyed(){return this.isDestroyed}destroy(){return this.splatPrimitive=void 0,this._tile=void 0,this._tileset=void 0,this._resource=void 0,this._ready=!1,this._group=void 0,this._metadata=void 0,this._resourcesLoaded=!1,this._lastSplatTransform=void 0,l(this._loader)&&(this._loader.destroy(),this._loader=void 0),ue(this)}};function Lmt(e){return`${e.startsWith("KHR_gaussian_splatting:")?"KHR_gaussian_splatting:":"_"}SH_DEGREE_`}function Wmt(e){switch(e.filter(n=>n.name.includes("SH_DEGREE_")).length){default:case 0:return{l:0,n:0};case 3:return{l:1,n:9};case 8:return{l:2,n:24};case 15:return{l:3,n:45}}}var sSe=new ArrayBuffer(4),vmt=new Float32Array(sSe),Fmt=new Uint32Array(sSe);function s$(e){vmt[0]=e;let t=Fmt[0],n=t>>31&1,i=t>>23&255,o=t&8388607,r;if(i===255)r=n<<15|31744|(o?512:0);else if(i===0)r=n<<15;else{let s=i-127+15;s>=31?r=n<<15|31744:s<=0?r=n<<15:r=n<<15|s<<10|o>>>13}return r}function Imt(e){let t=Lmt(e),n="_COEF_",i=t.length,o=e.indexOf(n,i),r=parseInt(e.slice(i,o),10),s=parseInt(e.slice(o+n.length),10);return{l:r,n:s}}function Pmt(e){let t=e.sphericalHarmonicsDegree,n=e.sphericalHarmonicsCoefficientCount,i=e.pointsLength*(n*(2/3)),o=new Uint32Array(i),r=e.gltfPrimitive.attributes.filter(d=>d.name.includes("SH_DEGREE_")),s=0,a=[0,9,24];switch(t){case 1:s=9;break;case 2:s=24;break;case 3:s=45;break}r.sort((d,u)=>d.name<u.name?-1:d.name>u.name?1:0);let c=s*(2/3);for(let d=0;d<r.length;d++){let{l:u,n:m}=Imt(r[d].name);for(let p=0;p<e.pointsLength;p++){let b=a[u-1]*2/3,f=p*c+b+m*2,y=p*3;o[f]=s$(r[d].typedArray[y])|s$(r[d].typedArray[y+1])<<16,o[f+1]=s$(r[d].typedArray[y+2])}}return o}var Fx=a$;var aSe={b3dm:function(e,t,n,i,o){return Mu.fromB3dm(e,t,n,i,o)},pnts:function(e,t,n,i,o){return Mu.fromPnts(e,t,n,i,o)},i3dm:function(e,t,n,i,o){return Mu.fromI3dm(e,t,n,i,o)},cmpt:function(e,t,n,i,o){return PF.fromTileType(e,t,n,i,o,aSe)},externalTileset:function(e,t,n,i){return aN.fromJson(e,t,n,i)},geom:function(e,t,n,i,o){return new YF(e,t,n,i,o)},vctr:function(e,t,n,i,o){return new RN(e,t,n,i,o)},subt:function(e,t,n,i,o){return rC.fromSubtreeJson(e,t,n,void 0,i,o)},subtreeJson:function(e,t,n,i){return rC.fromSubtreeJson(e,t,n,i)},glb:function(e,t,n,i,o){if(i.byteLength<12)throw new ae("Invalid glb content");let a=new DataView(i,o).getUint32(8,!0),c=new Uint8Array(i,o,a);return Fx.tilesetRequiresGaussianSplattingExt(e)?Fx.fromGltf(e,t,n,c):e.hasExtension("3DTILES_content_gltf_vector")||e.isGltfExtensionUsed("CESIUM_mesh_vector")?vx.fromGltf(e,t,n,c):Mu.fromGltf(e,t,n,c)},gltf:function(e,t,n,i){return Fx.tilesetRequiresGaussianSplattingExt(e)?Fx.fromGltf(e,t,n,i):e.hasExtension("3DTILES_content_gltf_vector")||e.isGltfExtensionUsed("CESIUM_mesh_vector")?vx.fromGltf(e,t,n,i):Mu.fromGltf(e,t,n,i)},geoJson:function(e,t,n,i){return Mu.fromGeoJson(e,t,n,i)}},NS=aSe;var o_i=x(T(),1),cSe={UNLOADED:0,LOADING:1,PROCESSING:2,READY:3,EXPIRED:4,FAILED:5};Object.freeze(cSe);var Fo=cSe;var s_i=x(T(),1),jm={BATCHED_3D_MODEL:"b3dm",INSTANCED_3D_MODEL:"i3dm",COMPOSITE:"cmpt",POINT_CLOUD:"pnts",VECTOR:"vctr",GEOMETRY:"geom",GLTF:"gltf",GLTF_BINARY:"glb",IMPLICIT_SUBTREE:"subt",IMPLICIT_SUBTREE_JSON:"subtreeJson",EXTERNAL_TILESET:"externalTileset",MULTIPLE_CONTENT:"multipleContent",GEOJSON:"geoJson",VOXEL_BINARY:"voxl",VOXEL_JSON:"voxelJson"};jm.isBinaryFormat=function(e){switch(e){case jm.BATCHED_3D_MODEL:case jm.INSTANCED_3D_MODEL:case jm.COMPOSITE:case jm.POINT_CLOUD:case jm.VECTOR:case jm.GEOMETRY:case jm.IMPLICIT_SUBTREE:case jm.VOXEL_BINARY:case jm.GLTF_BINARY:return!0;default:return!1}};Object.freeze(jm);var Za=jm;var c_i=x(T(),1),lSe={NOT_COMPUTED:-1,USE_OPTIMIZATION:1,SKIP_OPTIMIZATION:0};Object.freeze(lSe);var Qm=lSe;var d_i=x(T(),1),Ra={RENDER:0,PICK:1,SHADOW:2,PRELOAD:3,PRELOAD_FLIGHT:4,REQUEST_RENDER_MODE_DEFER_CHECK:5,MOST_DETAILED_PRELOAD:6,MOST_DETAILED_PICK:7,NUMBER_OF_PASSES:8},cg=new Array(Ra.NUMBER_OF_PASSES);cg[Ra.RENDER]=Object.freeze({pass:Ra.RENDER,isRender:!0,requestTiles:!0,ignoreCommands:!1});cg[Ra.PICK]=Object.freeze({pass:Ra.PICK,isRender:!1,requestTiles:!1,ignoreCommands:!1});cg[Ra.SHADOW]=Object.freeze({pass:Ra.SHADOW,isRender:!1,requestTiles:!0,ignoreCommands:!1});cg[Ra.PRELOAD]=Object.freeze({pass:Ra.PRELOAD,isRender:!1,requestTiles:!0,ignoreCommands:!0});cg[Ra.PRELOAD_FLIGHT]=Object.freeze({pass:Ra.PRELOAD_FLIGHT,isRender:!1,requestTiles:!0,ignoreCommands:!0});cg[Ra.REQUEST_RENDER_MODE_DEFER_CHECK]=Object.freeze({pass:Ra.REQUEST_RENDER_MODE_DEFER_CHECK,isRender:!1,requestTiles:!0,ignoreCommands:!0});cg[Ra.MOST_DETAILED_PRELOAD]=Object.freeze({pass:Ra.MOST_DETAILED_PRELOAD,isRender:!1,requestTiles:!0,ignoreCommands:!0});cg[Ra.MOST_DETAILED_PICK]=Object.freeze({pass:Ra.MOST_DETAILED_PICK,isRender:!1,requestTiles:!1,ignoreCommands:!1});Ra.getPassOptions=function(e){return cg[e]};Object.freeze(Ra);var lr=Ra;var h_i=x(T(),1);var c$=class{constructor(t,n){this._tileset=t,this._tile=n,this.featurePropertiesDirty=!1}get featuresLength(){return 0}get pointsLength(){return 0}get trianglesLength(){return 0}get geometryByteLength(){return 0}get texturesByteLength(){return 0}get batchTableByteLength(){return 0}get innerContents(){}get ready(){return!0}get tileset(){return this._tileset}get tile(){return this._tile}get url(){}get metadata(){}set metadata(t){}get batchTable(){}get group(){}set group(t){}hasProperty(t,n){return!1}getFeature(t){}applyDebugSettings(t,n){}applyStyle(t){}update(t,n){}pick(t,n,i){}isDestroyed(){return!1}destroy(){return ue(this)}},Qp=c$;var R_i=x(T(),1);var g_i=x(T(),1);function lg(e){e=e??B.EMPTY_OBJECT;let t=e.content,n=e.class;this._class=n,this._properties=t.properties,this._extensions=t.extensions,this._extras=t.extras}Object.defineProperties(lg.prototype,{class:{get:function(){return this._class}},extras:{get:function(){return this._extras}},extensions:{get:function(){return this._extensions}}});lg.prototype.hasProperty=function(e){return Jn.hasProperty(e,this._properties,this._class)};lg.prototype.hasPropertyBySemantic=function(e){return Jn.hasPropertyBySemantic(e,this._properties,this._class)};lg.prototype.getPropertyIds=function(e){return Jn.getPropertyIds(this._properties,this._class,e)};lg.prototype.getProperty=function(e){return Jn.getProperty(e,this._properties,this._class)};lg.prototype.setProperty=function(e,t){return Jn.setProperty(e,t,this._properties,this._class)};lg.prototype.getPropertyBySemantic=function(e){return Jn.getPropertyBySemantic(e,this._properties,this._class)};lg.prototype.setPropertyBySemantic=function(e,t){return Jn.setPropertyBySemantic(e,t,this._properties,this._class)};var MN=lg;function l$(e,t){let n=no(t,"3DTILES_metadata")?t.extensions["3DTILES_metadata"]:t.metadata;if(!l(n))return;if(!l(e.schema)){l$._oneTimeWarning("findContentMetadata-missing-root-schema","Could not find a metadata schema for content metadata. For tilesets that contain external tilesets, make sure the schema is added to the root tileset.json.");return}let i=e.schema.classes??B.EMPTY_OBJECT;if(l(n.class)){let o=i[n.class];return new MN({content:n,class:o})}}l$._oneTimeWarning=xt;var YS=l$;var A_i=x(T(),1);function Xmt(e,t){let n=e.metadataExtension;if(!l(n))return;let i=n.groups,o=no(t,"3DTILES_metadata")?t.extensions["3DTILES_metadata"].group:t.group;if(typeof o=="number")return i[o];let r=n.groupIds.findIndex(function(s){return s===o});return r>=0?i[r]:void 0}var MS=Xmt;var M_i=x(T(),1);var v_i=x(T(),1);function dg(e){e=e??B.EMPTY_OBJECT;let t=e.tile,n=e.class;this._class=n,this._properties=t.properties,this._extensions=t.extensions,this._extras=t.extras}Object.defineProperties(dg.prototype,{class:{get:function(){return this._class}},extras:{get:function(){return this._extras}},extensions:{get:function(){return this._extensions}}});dg.prototype.hasProperty=function(e){return Jn.hasProperty(e,this._properties,this._class)};dg.prototype.hasPropertyBySemantic=function(e){return Jn.hasPropertyBySemantic(e,this._properties,this._class)};dg.prototype.getPropertyIds=function(e){return Jn.getPropertyIds(this._properties,this._class,e)};dg.prototype.getProperty=function(e){return Jn.getProperty(e,this._properties,this._class)};dg.prototype.setProperty=function(e,t){return Jn.setProperty(e,t,this._properties,this._class)};dg.prototype.getPropertyBySemantic=function(e){return Jn.getPropertyBySemantic(e,this._properties,this._class)};dg.prototype.setPropertyBySemantic=function(e,t){return Jn.setPropertyBySemantic(e,t,this._properties,this._class)};var wN=dg;function d$(e,t){let n=no(t,"3DTILES_metadata")?t.extensions["3DTILES_metadata"]:t.metadata;if(!l(n))return;if(!l(e.schema)){d$._oneTimeWarning("findTileMetadata-missing-root-schema","Could not find a metadata schema for tile metadata. For tilesets that contain external tilesets, make sure the schema is added to the root tileset.json.");return}let i=e.schema.classes??B.EMPTY_OBJECT;if(l(n.class)){let o=i[n.class];return new wN({tile:n,class:o})}}d$._oneTimeWarning=xt;var kN=d$;var aSi=x(T(),1);var z_i=x(T(),1);function Nmt(e){let t=new Uint8Array(e),n=ef(t);if(n==="glTF"&&(n="glb"),Za.isBinaryFormat(n))return{contentType:n,binaryPayload:t};let i=Ymt(t);if(l(i.root))return{contentType:Za.EXTERNAL_TILESET,jsonPayload:i};if(l(i.asset))return{contentType:Za.GLTF,jsonPayload:i};if(l(i.tileAvailability))return{contentType:Za.IMPLICIT_SUBTREE_JSON,jsonPayload:i};if(l(i.type))return{contentType:Za.GEOJSON,jsonPayload:i};if(l(i.voxelTable))return{contentType:Za.VOXEL_JSON,jsonPayload:i};throw new ae("Invalid tile content.")}function Ymt(e){let t;try{t=vr(e)}catch{throw new ae("Invalid tile content.")}return t}var ug=Nmt;var u$=class{constructor(t,n,i,o){this._tileset=t,this._tile=n,this._tilesetResource=i,this._contents=[],this._contentsCreated=!1;let r=l(o.contents)?o.contents:o.content;this._innerContentHeaders=r,this._requestsInFlight=0,this._cancelCount=0,this._externalTilesetCount=0;let s=this._innerContentHeaders.length;this._arrayFetchPromises=new Array(s),this._requests=new Array(s),this._ready=!1,this._innerContentResources=new Array(s),this._serverKeys=new Array(s);for(let a=0;a<s;a++){let c=i.getDerivedResource({url:r[a].uri}),d=Hc.getServerKey(c.getUrlComponent());this._innerContentResources[a]=c,this._serverKeys[a]=d}}get featurePropertiesDirty(){let t=this._contents,n=t.length;for(let i=0;i<n;++i)if(t[i].featurePropertiesDirty)return!0;return!1}set featurePropertiesDirty(t){let n=this._contents,i=n.length;for(let o=0;o<i;++o)n[o].featurePropertiesDirty=t}get featuresLength(){return 0}get pointsLength(){return 0}get trianglesLength(){return 0}get geometryByteLength(){return 0}get texturesByteLength(){return 0}get batchTableByteLength(){return 0}get innerContents(){return this._contents}get ready(){return this._contentsCreated?this._ready:!1}get tileset(){return this._tileset}get tile(){return this._tile}get url(){}get metadata(){}set metadata(t){}get batchTable(){}get group(){}set group(t){}get innerContentUrls(){return this._innerContentHeaders.map(function(t){return t.uri})}requestInnerContents(){if(!Mmt(this._serverKeys)){this.tileset.statistics.numberOfAttemptedRequests+=this._serverKeys.length;return}let t=this._innerContentHeaders;m$(this,t.length);let n=this._cancelCount;for(let i=0;i<t.length;i++)this._arrayFetchPromises[i]=wmt(this,i,n,this._tile._contentState);return kmt(this)}cancelRequests(){for(let t=0;t<this._requests.length;t++){let n=this._requests[t];l(n)&&n.cancel()}}hasProperty(t,n){return!1}getFeature(t){}applyDebugSettings(t,n){let i=this._contents,o=i.length;for(let r=0;r<o;++r)i[r].applyDebugSettings(t,n)}applyStyle(t){let n=this._contents,i=n.length;for(let o=0;o<i;++o)n[o].applyStyle(t)}update(t,n){let i=this._contents,o=i.length,r=!0;for(let s=0;s<o;++s)i[s].update(t,n),r=r&&i[s].ready;!this._ready&&r&&(this._ready=!0)}pick(t,n,i){if(!this._ready)return;let o,r=Number.POSITIVE_INFINITY,s=this._contents,a=s.length;for(let c=0;c<a;++c){let d=s[c].pick(t,n,i);if(!l(d))continue;let u=h.distance(t.origin,d);u<r&&(o=d,r=u)}if(l(o))return i}isDestroyed(){return!1}destroy(){let t=this._contents,n=t.length;for(let i=0;i<n;++i)t[i].destroy();return ue(this)}};function m$(e,t){e._requestsInFlight+=t,e.tileset.statistics.numberOfPendingRequests+=t}function dSe(e,t){e._cancelCount++,e._tile._contentState=t;let n=e.tileset.statistics;n.numberOfPendingRequests-=e._requestsInFlight,n.numberOfAttemptedRequests+=e._requestsInFlight,e._requestsInFlight=0;let i=e._innerContentHeaders.length;e._arrayFetchPromises=new Array(i)}function Mmt(e){let t={};for(let n=0;n<e.length;n++){let i=e[n];l(t[i])?t[i]++:t[i]=1}for(let n in t)if(t.hasOwnProperty(n)&&!Hc.serverHasOpenSlots(n,t[n]))return!1;return Hc.heapHasOpenSlots(e.length)}function wmt(e,t,n,i){let o=e._innerContentResources[t].clone(),r=e.tile,s=function(){return r._priority},a=e._serverKeys[t],c=new Ar({throttle:!0,throttleByServer:!0,type:js.TILES3D,priorityFunction:s,serverKey:a});o.request=c,e._requests[t]=c;let d=o.fetchArrayBuffer();if(l(d))return d.then(function(u){if(!(n<e._cancelCount)){if(o.request.cancelled||o.request.state===Ri.CANCELLED){dSe(e,i);return}return m$(e,-1),u}}).catch(function(u){if(!(n<e._cancelCount)){if(o.request.cancelled||o.request.state===Ri.CANCELLED){dSe(e,i);return}m$(e,-1),uSe(e,t,u)}})}async function kmt(e){let t=e._cancelCount,n=await Promise.all(e._arrayFetchPromises);if(t<e._cancelCount)return;let i=n.map((r,s)=>Umt(e,r,s)),o=await Promise.all(i);if(e._contentsCreated=!0,e._contents=o.filter(l),e._externalTilesetCount===e._contents.length){let r=e._tile;r.hasRenderableContent=!1}return o}async function Umt(e,t,n){if(l(t))try{let i=ug(t),o=e._tileset,r=e._innerContentResources[n],s=e._tile;i.contentType===Za.EXTERNAL_TILESET&&(e._externalTilesetCount++,s.hasTilesetContent=!0),e._disableSkipLevelOfDetail=e._disableSkipLevelOfDetail||i.contentType===Za.GEOMETRY||i.contentType===Za.VECTOR;let a,c=NS[i.contentType];l(i.binaryPayload)?a=await Promise.resolve(c(o,s,r,i.binaryPayload.buffer,0)):a=await Promise.resolve(c(o,s,r,i.jsonPayload));let d=e._innerContentHeaders[n];if(s.hasImplicitContentMetadata){let m=s.implicitSubtree,p=s.implicitCoordinates;a.metadata=m.getContentMetadataView(p,n)}else s.hasImplicitContent||(a.metadata=YS(o,d));let u=MS(o,d);return l(u)&&(a.group=new z_({metadata:u})),a}catch(i){uSe(e,n,i)}}function uSe(e,t,n){let i=e._tileset,o=e._innerContentResources[t].url,r=l(n.message)?n.message:n.toString();i.tileFailed.numberOfListeners>0?i.tileFailed.raiseEvent({url:o,message:r}):(console.log(`A content failed to load: ${o}`),console.log(`Error: ${r}`))}var UN=u$;var tZi=x(T(),1);var XSi=x(T(),1);var gSi=x(T(),1);var mSe=Math.cos,hSe=Math.sin,Dmt=Math.sqrt,h$={};h$.computePosition=function(e,t,n,i,o,r,s){let a=t.radiiSquared,c=e.nwCorner,d=e.boundingRectangle,u=c.latitude-e.granYCos*i+o*e.granXSin,m=mSe(u),p=hSe(u),b=a.z*p,f=c.longitude+i*e.granYSin+o*e.granXCos,y=m*mSe(f),_=m*hSe(f),S=a.x*y,Z=a.y*_,R=Dmt(S*y+Z*_+b*p);if(r.x=S/R,r.y=Z/R,r.z=b/R,n){let C=e.stNwCorner;l(C)?(u=C.latitude-e.stGranYCos*i+o*e.stGranXSin,f=C.longitude+i*e.stGranYSin+o*e.stGranXCos,s.x=(f-e.stWest)*e.lonScalar,s.y=(u-e.stSouth)*e.latScalar):(s.x=(f-d.west)*e.lonScalar,s.y=(u-d.south)*e.latScalar)}};var Omt=new Ji,qm=new h,Bmt=new pe,OB=new h,DN=new ki;function fSe(e,t,n,i,o,r,s){let a=Math.cos(t),c=i*a,d=n*a,u=Math.sin(t),m=i*u,p=n*u;DN._ellipsoid=ne.default,qm=DN.project(e,qm),qm=h.subtract(qm,OB,qm);let b=Ji.fromRotation(t,Omt);qm=Ji.multiplyByVector(b,qm,qm),qm=h.add(qm,OB,qm),e=DN.unproject(qm,e),r-=1,s-=1;let f=e.latitude,y=f+r*p,_=f-c*s,S=f-c*s+r*p,Z=Math.max(f,y,_,S),R=Math.min(f,y,_,S),C=e.longitude,E=C+r*d,A=C+s*m,L=C+s*m+r*d,F=Math.max(C,E,A,L),I=Math.min(C,E,A,L);return{north:Z,south:R,east:F,west:I,granYCos:c,granYSin:m,granXCos:d,granXSin:p,nwCorner:e}}h$.computeOptions=function(e,t,n,i,o,r,s){let a=e.east,c=e.west,d=e.north,u=e.south,m=!1,p=!1;d===W.PI_OVER_TWO&&(m=!0),u===-W.PI_OVER_TWO&&(p=!0);let b,f=d-u;c>a?b=W.TWO_PI-c+a:b=a-c;let y=Math.ceil(b/t)+1,_=Math.ceil(f/t)+1,S=b/(y-1),Z=f/(_-1),R=re.northwest(e,r),C=re.center(e,Bmt);(n!==0||i!==0)&&(C.longitude<R.longitude&&(C.longitude+=W.TWO_PI),DN._ellipsoid=ne.default,OB=DN.project(C,OB));let E=Z,A=S,L=0,F=0,I=re.clone(e,o),N={granYCos:E,granYSin:L,granXCos:A,granXSin:F,nwCorner:R,boundingRectangle:I,width:y,height:_,northCap:m,southCap:p};if(n!==0){let g=fSe(R,n,S,Z,C,y,_);d=g.north,u=g.south,a=g.east,c=g.west,N.granYCos=g.granYCos,N.granYSin=g.granYSin,N.granXCos=g.granXCos,N.granXSin=g.granXSin,I.north=d,I.south=u,I.east=a,I.west=c}if(i!==0){n=n-i;let g=re.northwest(I,s),V=fSe(g,n,S,Z,C,y,_);N.stGranYCos=V.granYCos,N.stGranXCos=V.granXCos,N.stGranYSin=V.granYSin,N.stGranXSin=V.granXSin,N.stNwCorner=g,N.stWest=V.west,N.stSouth=V.south}return N};var Ca=h$;var zmt=new me,Hmt=new me,Kmt=new h,Jmt=new re;function pSe(e,t){let n=e._ellipsoid,i=t.height,o=t.width,r=t.northCap,s=t.southCap,a=i,c=2,d=0,u=4;r&&(c-=1,a-=1,d+=1,u-=2),s&&(c-=1,a-=1,d+=1,u-=2),d+=c*o+2*a-u;let m=new Float64Array(d*3),p=0,b=0,f,y=Kmt;if(r)Ca.computePosition(t,n,!1,b,0,y),m[p++]=y.x,m[p++]=y.y,m[p++]=y.z;else for(f=0;f<o;f++)Ca.computePosition(t,n,!1,b,f,y),m[p++]=y.x,m[p++]=y.y,m[p++]=y.z;for(f=o-1,b=1;b<i;b++)Ca.computePosition(t,n,!1,b,f,y),m[p++]=y.x,m[p++]=y.y,m[p++]=y.z;if(b=i-1,!s)for(f=o-2;f>=0;f--)Ca.computePosition(t,n,!1,b,f,y),m[p++]=y.x,m[p++]=y.y,m[p++]=y.z;for(f=0,b=i-2;b>0;b--)Ca.computePosition(t,n,!1,b,f,y),m[p++]=y.x,m[p++]=y.y,m[p++]=y.z;let _=m.length/3*2,S=Oe.createTypedArray(m.length/3,_),Z=0;for(let C=0;C<m.length/3-1;C++)S[Z++]=C,S[Z++]=C+1;S[Z++]=m.length/3-1,S[Z]=0;let R=new At({attributes:new Rn,primitiveType:Ie.LINES});return R.attributes.position=new Xe({componentDatatype:J.DOUBLE,componentsPerAttribute:3,values:m}),R.indices=S,R}function jmt(e,t){let n=e._surfaceHeight,i=e._extrudedHeight,o=e._ellipsoid,r=pSe(e,t),s=t.height,a=t.width,c=hi.scaleToGeodeticHeight(r.attributes.position.values,n,o,!1),d=c.length,u=new Float64Array(d*2);u.set(c);let m=hi.scaleToGeodeticHeight(r.attributes.position.values,i,o);u.set(m,d),r.attributes.position.values=u;let p=t.northCap,b=t.southCap,f=4;p&&(f-=1),b&&(f-=1);let y=(u.length/3+f)*2,_=Oe.createTypedArray(u.length/3,y);d=u.length/6;let S=0;for(let R=0;R<d-1;R++)_[S++]=R,_[S++]=R+1,_[S++]=R+d,_[S++]=R+d+1;_[S++]=d-1,_[S++]=0,_[S++]=d+d-1,_[S++]=d,_[S++]=0,_[S++]=d;let Z;if(p)Z=s-1;else{let R=a-1;_[S++]=R,_[S++]=R+d,Z=a+s-2}if(_[S++]=Z,_[S++]=Z+d,!b){let R=a+Z-1;_[S++]=R,_[S]=R+d}return r.indices=_,r}function oV(e){e=e??B.EMPTY_OBJECT;let t=e.rectangle,n=e.granularity??W.RADIANS_PER_DEGREE,i=e.ellipsoid??ne.default,o=e.rotation??0,r=e.height??0,s=e.extrudedHeight??r;this._rectangle=re.clone(t),this._granularity=n,this._ellipsoid=i,this._surfaceHeight=Math.max(r,s),this._rotation=o,this._extrudedHeight=Math.min(r,s),this._offsetAttribute=e.offsetAttribute,this._workerName="createRectangleOutlineGeometry"}oV.packedLength=re.packedLength+ne.packedLength+5;oV.pack=function(e,t,n){return n=n??0,re.pack(e._rectangle,t,n),n+=re.packedLength,ne.pack(e._ellipsoid,t,n),n+=ne.packedLength,t[n++]=e._granularity,t[n++]=e._surfaceHeight,t[n++]=e._rotation,t[n++]=e._extrudedHeight,t[n]=e._offsetAttribute??-1,t};var bSe=new re,gSe=ne.clone(ne.UNIT_SPHERE),iV={rectangle:bSe,ellipsoid:gSe,granularity:void 0,height:void 0,rotation:void 0,extrudedHeight:void 0,offsetAttribute:void 0};oV.unpack=function(e,t,n){t=t??0;let i=re.unpack(e,t,bSe);t+=re.packedLength;let o=ne.unpack(e,t,gSe);t+=ne.packedLength;let r=e[t++],s=e[t++],a=e[t++],c=e[t++],d=e[t];return l(n)?(n._rectangle=re.clone(i,n._rectangle),n._ellipsoid=ne.clone(o,n._ellipsoid),n._surfaceHeight=s,n._rotation=a,n._extrudedHeight=c,n._offsetAttribute=d===-1?void 0:d,n):(iV.granularity=r,iV.height=s,iV.rotation=a,iV.extrudedHeight=c,iV.offsetAttribute=d===-1?void 0:d,new oV(iV))};var Qmt=new pe;oV.createGeometry=function(e){let t=e._rectangle,n=e._ellipsoid,i=Ca.computeOptions(t,e._granularity,e._rotation,0,Jmt,Qmt),o,r;if(W.equalsEpsilon(t.north,t.south,W.EPSILON10)||W.equalsEpsilon(t.east,t.west,W.EPSILON10))return;let s=e._surfaceHeight,a=e._extrudedHeight,c=!W.equalsEpsilon(s,a,0,W.EPSILON2),d;if(c){if(o=jmt(e,i),l(e._offsetAttribute)){let p=o.attributes.position.values.length/3,b=new Uint8Array(p);e._offsetAttribute===bn.TOP?b=b.fill(1,0,p/2):(d=e._offsetAttribute===bn.NONE?0:1,b=b.fill(d)),o.attributes.applyOffset=new Xe({componentDatatype:J.UNSIGNED_BYTE,componentsPerAttribute:1,values:b})}let u=me.fromRectangle3D(t,n,s,Hmt),m=me.fromRectangle3D(t,n,a,zmt);r=me.union(u,m)}else{if(o=pSe(e,i),o.attributes.position.values=hi.scaleToGeodeticHeight(o.attributes.position.values,s,n,!1),l(e._offsetAttribute)){let u=o.attributes.position.values.length;d=e._offsetAttribute===bn.NONE?0:1;let m=new Uint8Array(u/3).fill(d);o.attributes.applyOffset=new Xe({componentDatatype:J.UNSIGNED_BYTE,componentsPerAttribute:1,values:m})}r=me.fromRectangle3D(t,n,s)}return new At({attributes:o.attributes,indices:o.indices,primitiveType:Ie.LINES,boundingSphere:r,offsetAttribute:e._offsetAttribute})};var wS=oV;function sV(e){this.rectangle=re.clone(e.rectangle),this.minimumHeight=e.minimumHeight??0,this.maximumHeight=e.maximumHeight??0,this.southwestCornerCartesian=new h,this.northeastCornerCartesian=new h,this.westNormal=new h,this.southNormal=new h,this.eastNormal=new h,this.northNormal=new h;let t=e.ellipsoid??ne.WGS84;nht(this,e.rectangle,t),this._orientedBoundingBox=void 0,this._boundingSphere=void 0,(e.computeBoundingVolumes??!0)&&this.computeBoundingVolumes(t)}Object.defineProperties(sV.prototype,{boundingVolume:{get:function(){return this._orientedBoundingBox}},boundingSphere:{get:function(){return this._boundingSphere}}});sV.prototype.computeBoundingVolumes=function(e){this._orientedBoundingBox=nn.fromRectangle(this.rectangle,this.minimumHeight,this.maximumHeight,e),this._boundingSphere=me.fromOrientedBoundingBox(this._orientedBoundingBox)};var ySe=new h,BB=new h,xSe=new h,qmt=new h,$mt=new h,eht=new h,tht=new h,$m=new pe,TSe=new cn(h.UNIT_X,0),rV=new gn;function nht(e,t,n){n.cartographicToCartesian(re.southwest(t),e.southwestCornerCartesian),n.cartographicToCartesian(re.northeast(t),e.northeastCornerCartesian),$m.longitude=t.west,$m.latitude=(t.south+t.north)*.5,$m.height=0;let i=n.cartographicToCartesian($m,eht),o=h.cross(i,h.UNIT_Z,qmt);h.normalize(o,e.westNormal),$m.longitude=t.east;let r=n.cartographicToCartesian($m,tht),s=h.cross(h.UNIT_Z,r,ySe);h.normalize(s,e.eastNormal);let a=h.subtract(i,r,ySe);h.magnitude(a)===0&&(a=h.clone(o,a));let c=h.normalize(a,$mt),d=t.south,u;if(d>0){$m.longitude=(t.west+t.east)*.5,$m.latitude=d;let y=n.cartographicToCartesian($m,rV.origin);h.clone(c,rV.direction);let _=cn.fromPointNormal(e.southwestCornerCartesian,e.westNormal,TSe);xi.rayPlane(rV,_,e.southwestCornerCartesian),u=n.geodeticSurfaceNormal(y,BB)}else u=n.geodeticSurfaceNormalCartographic(re.southeast(t),BB);let m=h.cross(u,a,xSe);h.normalize(m,e.southNormal);let p=t.north,b;if(p<0){$m.longitude=(t.west+t.east)*.5,$m.latitude=p;let y=n.cartographicToCartesian($m,rV.origin);h.negate(c,rV.direction);let _=cn.fromPointNormal(e.northeastCornerCartesian,e.eastNormal,TSe);xi.rayPlane(rV,_,e.northeastCornerCartesian),b=n.geodeticSurfaceNormal(y,BB)}else b=n.geodeticSurfaceNormalCartographic(re.northwest(t),BB);let f=h.cross(a,b,xSe);h.normalize(f,e.northNormal)}var iht=new h,oht=new h,rht=new h(0,-1,0),sht=new h(0,0,-1),_Se=new h;function aht(e,t){let n=t.camera,i=n.positionWC,o=n.positionCartographic,r=0;if(!re.contains(e.rectangle,o)){let d=e.southwestCornerCartesian,u=e.northeastCornerCartesian,m=e.westNormal,p=e.southNormal,b=e.eastNormal,f=e.northNormal;t.mode!==se.SCENE3D&&(d=t.mapProjection.project(re.southwest(e.rectangle),iht),d.z=d.y,d.y=d.x,d.x=0,u=t.mapProjection.project(re.northeast(e.rectangle),oht),u.z=u.y,u.y=u.x,u.x=0,m=rht,b=h.UNIT_Y,p=sht,f=h.UNIT_Z);let y=h.subtract(i,d,_Se),_=h.dot(y,m),S=h.dot(y,p),Z=h.subtract(i,u,_Se),R=h.dot(Z,b),C=h.dot(Z,f);_>0?r+=_*_:R>0&&(r+=R*R),S>0?r+=S*S:C>0&&(r+=C*C)}let s,a,c;if(t.mode===se.SCENE3D?(s=o.height,a=e.minimumHeight,c=e.maximumHeight):(s=i.x,a=0,c=0),s>c){let d=s-c;r+=d*d}else if(s<a){let d=a-s;r+=d*d}return Math.sqrt(r)}sV.prototype.distanceToCamera=function(e){let t=aht(this,e);if(e.mode===se.SCENE3D&&l(this._orientedBoundingBox)){let n=Math.sqrt(this._orientedBoundingBox.distanceSquaredTo(e.camera.positionWC));return Math.max(t,n)}return t};sV.prototype.intersectPlane=function(e){return this._orientedBoundingBox.intersectPlane(e)};sV.prototype.createDebugVolume=function(e){let t=P.clone(P.IDENTITY),n=new wS({rectangle:this.rectangle,height:this.minimumHeight,extrudedHeight:this.maximumHeight}),i=new Yt({geometry:n,id:"outline",modelMatrix:t,attributes:{color:$t.fromColor(e)}});return new In({geometryInstances:i,appearance:new Tn({translucent:!1,flat:!0}),asynchronous:!1})};var Uu=sV;var kZi=x(T(),1);var RZi=x(T(),1);var aZi=x(T(),1);var ON={},cht=new h,SSe=new h,ZSe=new h,RSe=new h,CSe=new nn;ON.validOutline=function(e){let n=nn.fromPoints(e,CSe).halfAxes,i=q.getColumn(n,0,SSe),o=q.getColumn(n,1,ZSe),r=q.getColumn(n,2,RSe),s=h.magnitude(i),a=h.magnitude(o),c=h.magnitude(r);return!(s===0&&(a===0||c===0)||a===0&&c===0)};ON.computeProjectTo2DArguments=function(e,t,n,i){let o=nn.fromPoints(e,CSe),r=o.halfAxes,s=q.getColumn(r,0,SSe),a=q.getColumn(r,1,ZSe),c=q.getColumn(r,2,RSe),d=h.magnitude(s),u=h.magnitude(a),m=h.magnitude(c),p=Math.min(d,u,m);if(d===0&&(u===0||m===0)||u===0&&m===0)return!1;let b,f;return(p===u||p===m)&&(b=s),p===d?b=a:p===m&&(f=a),(p===d||p===u)&&(f=c),h.normalize(b,n),h.normalize(f,i),h.clone(o.center,t),!0};function VSe(e,t,n,i,o){let r=h.subtract(e,t,cht),s=h.dot(n,r),a=h.dot(i,r);return k.fromElements(s,a,o)}ON.createProjectPointsTo2DFunction=function(e,t,n){return function(i){let o=new Array(i.length);for(let r=0;r<i.length;r++)o[r]=VSe(i[r],e,t,n);return o}};ON.createProjectPointTo2DFunction=function(e,t,n){return function(i,o){return VSe(i,e,t,n,o)}};var mg=ON;function lht(e){let t=e.length,n=new Float64Array(t*3),i=Oe.createTypedArray(t,t*2),o=0,r=0;for(let a=0;a<t;a++){let c=e[a];n[o++]=c.x,n[o++]=c.y,n[o++]=c.z,i[r++]=a,i[r++]=(a+1)%t}let s=new Rn({position:new Xe({componentDatatype:J.DOUBLE,componentsPerAttribute:3,values:n})});return new At({attributes:s,indices:i,primitiveType:Ie.LINES})}function kS(e){e=e??B.EMPTY_OBJECT;let t=e.polygonHierarchy;this._polygonHierarchy=t,this._workerName="createCoplanarPolygonOutlineGeometry",this.packedLength=oi.computeHierarchyPackedLength(t,h)+1}kS.fromPositions=function(e){e=e??B.EMPTY_OBJECT;let t={polygonHierarchy:{positions:e.positions}};return new kS(t)};kS.pack=function(e,t,n){return n=n??0,n=oi.packPolygonHierarchy(e._polygonHierarchy,t,n,h),t[n]=e.packedLength,t};var dht={polygonHierarchy:{}};kS.unpack=function(e,t,n){t=t??0;let i=oi.unpackPolygonHierarchy(e,t,h);t=i.startingIndex,delete i.startingIndex;let o=e[t];return l(n)||(n=new kS(dht)),n._polygonHierarchy=i,n.packedLength=o,n};kS.createGeometry=function(e){let t=e._polygonHierarchy,n=t.positions;if(n=Yo(n,h.equalsEpsilon,!0),n.length<3||!mg.validOutline(n))return;let o=oi.polygonOutlinesFromHierarchy(t,!1);if(o.length===0)return;let r=[];for(let c=0;c<o.length;c++){let d=new Yt({geometry:lht(o[c])});r.push(d)}let s=Bn.combineInstances(r)[0],a=me.fromPoints(t.positions);return new At({attributes:s.attributes,indices:s.indices,primitiveType:s.primitiveType,boundingSphere:a})};var eh=kS;var zB=new pe;function BN(e){let t=Gb.fromToken(e.token),n=e.minimumHeight??0,i=e.maximumHeight??0,o=e.ellipsoid??ne.WGS84;this.s2Cell=t,this.minimumHeight=n,this.maximumHeight=i,this.ellipsoid=o;let r=xht(t,n,i,o);this._boundingPlanes=r;let s=Zht(r);this._vertices=s,this._edgeNormals=new Array(6),this._edgeNormals[0]=_$(r[0],s.slice(0,4));let a;for(a=0;a<4;a++)this._edgeNormals[0][a]=h.negate(this._edgeNormals[0][a],this._edgeNormals[0][a]);for(this._edgeNormals[1]=_$(r[1],s.slice(4,8)),a=0;a<4;a++)this._edgeNormals[2+a]=_$(r[2+a],[s[a%4],s[(a+1)%4],s[4+(a+1)%4],s[4+a]]);for(this._planeVertices=[this._vertices.slice(0,4),this._vertices.slice(4,8)],a=0;a<4;a++)this._planeVertices.push([this._vertices[a%4],this._vertices[(a+1)%4],this._vertices[4+(a+1)%4],this._vertices[4+a]]);let c=t.getCenter();zB=o.cartesianToCartographic(c,zB),zB.height=(i+n)/2,this.center=o.cartographicToCartesian(zB,c),this._boundingSphere=me.fromPoints(s)}var uht=new h,mht=new pe,hht=new h,fht=new pe,pht=new h,bht=new h,ght=new h,yht=new h;function xht(e,t,n,i){let o=new Array(6),r=e.getCenter(),s=i.geodeticSurfaceNormal(r,uht),a=i.cartesianToCartographic(r,mht);a.height=n;let c=i.cartographicToCartesian(a,hht),d=cn.fromPointNormal(c,s);o[0]=d;let u=0,m,p=[],b,f;for(m=0;m<4;m++){b=e.getVertex(m),p[m]=b,f=i.cartesianToCartographic(b,fht),f.height=t;let _=cn.getPointDistance(d,i.cartographicToCartesian(f,pht));_<u&&(u=_)}let y=cn.clone(d);for(y.normal=h.negate(y.normal,y.normal),y.distance=y.distance*-1+u,o[1]=y,m=0;m<4;m++){b=p[m];let _=p[(m+1)%4],S=i.geodeticSurfaceNormal(b,bht),Z=h.subtract(_,b,yht),R=h.cross(Z,S,ght);R=h.normalize(R,R),o[2+m]=cn.fromPointNormal(b,R)}return o}var US=new h,DS=new h,OS=new h,f$=new h,p$=new h,b$=new h,Tht=new h,_ht=new h,Sht=new h,g$=new h,y$=new h,x$=new h,Ix=new h,qp=new q;function ESe(e,t,n){US=e.normal,DS=t.normal,OS=n.normal,f$=h.multiplyByScalar(e.normal,-e.distance,f$),p$=h.multiplyByScalar(t.normal,-t.distance,p$),b$=h.multiplyByScalar(n.normal,-n.distance,b$),g$=h.multiplyByScalar(h.cross(DS,OS,Tht),h.dot(f$,US),g$),y$=h.multiplyByScalar(h.cross(OS,US,_ht),h.dot(p$,DS),y$),x$=h.multiplyByScalar(h.cross(US,DS,Sht),h.dot(b$,OS),x$),qp[0]=US.x,qp[1]=DS.x,qp[2]=OS.x,qp[3]=US.y,qp[4]=DS.y,qp[5]=OS.y,qp[6]=US.z,qp[7]=DS.z,qp[8]=OS.z;let i=q.determinant(qp);return Ix=h.add(g$,y$,Ix),Ix=h.add(Ix,x$,Ix),new h(Ix.x/i,Ix.y/i,Ix.z/i)}function Zht(e){let t=new Array(8);for(let n=0;n<4;n++)t[n]=ESe(e[0],e[2+(n+3)%4],e[2+n%4]),t[n+4]=ESe(e[1],e[2+(n+3)%4],e[2+n%4]);return t}var T$=new h,aV=new h;function _$(e,t){let n=[];for(let i=0;i<4;i++)T$=h.subtract(t[(i+1)%4],t[i],T$),aV=h.cross(e.normal,T$,aV),aV=h.normalize(aV,aV),n[i]=h.clone(aV);return n}Object.defineProperties(BN.prototype,{boundingVolume:{get:function(){return this}},boundingSphere:{get:function(){return this._boundingSphere}}});var S$=new h;BN.prototype.distanceToCamera=function(e){let t=e.camera.positionWC,n=[],i=[],o;cn.getPointDistance(this._boundingPlanes[0],t)>0?(n.push(0),i.push(this._planeVertices[0]),o=this._edgeNormals[0]):cn.getPointDistance(this._boundingPlanes[1],t)>0&&(n.push(1),i.push(this._planeVertices[1]),o=this._edgeNormals[1]);let r,s;for(r=0;r<4;r++)s=2+r,cn.getPointDistance(this._boundingPlanes[s],t)>0&&(n.push(s),i.push(this._planeVertices[s]),o=this._edgeNormals[s]);if(n.length===0)return 0;let a,c;if(n.length===1)return c=this._boundingPlanes[n[0]],a=Z$(cn.projectPointOntoPlane(c,t,S$),i[0],c,o),h.distance(a,t);if(n.length===2){if(n[0]===0){let p=[this._vertices[4*n[0]+(n[1]-2)],this._vertices[4*n[0]+(n[1]-2+1)%4]];return a=ASe(t,p[0],p[1]),h.distance(a,t)}let u=Number.MAX_VALUE,m;for(r=0;r<2;r++)c=this._boundingPlanes[n[r]],a=Z$(cn.projectPointOntoPlane(c,t,S$),i[r],c,this._edgeNormals[n[r]]),m=h.distanceSquared(a,t),m<u&&(u=m);return Math.sqrt(u)}else if(n.length>3)return a=Z$(cn.projectPointOntoPlane(this._boundingPlanes[1],t,S$),this._planeVertices[1],this._boundingPlanes[1],this._edgeNormals[1]),h.distance(a,t);let d=n[1]===2&&n[2]===5?0:1;return n[0]===0?h.distance(t,this._vertices[(n[1]-2+d)%4]):h.distance(t,this._vertices[4+(n[1]-2+d)%4])};var Rht=new h,Cht=new h;function ASe(e,t,n){let i=h.subtract(n,t,Rht),o=h.subtract(e,t,Cht),r=h.dot(i,o);if(r<=0)return t;let s=h.dot(i,i);return r>=s?n:(r=r/s,new h((1-r)*t.x+r*n.x,(1-r)*t.y+r*n.y,(1-r)*t.z+r*n.z))}var Vht=new cn(h.UNIT_X,0);function Z$(e,t,n,i){let o=Number.MAX_VALUE,r,s,a;for(let c=0;c<t.length;c++){let d=cn.fromPointNormal(t[c],i[c],Vht);cn.getPointDistance(d,e)<0||(a=ASe(e,t[c],t[(c+1)%4]),r=h.distance(e,a),r<o&&(o=r,s=a))}return l(s)?s:e}BN.prototype.intersectPlane=function(e){let t=0,n=0;for(let i=0;i<this._vertices.length;i++)h.dot(e.normal,this._vertices[i])+e.distance<0?n++:t++;return t===this._vertices.length?qt.INSIDE:n===this._vertices.length?qt.OUTSIDE:qt.INTERSECTING};BN.prototype.createDebugVolume=function(e){let t=P.clone(P.IDENTITY),n=new eh({polygonHierarchy:{positions:this._planeVertices[0]}}),i=eh.createGeometry(n),o=new Yt({geometry:i,id:"outline",modelMatrix:t,attributes:{color:$t.fromColor(e)}}),r=new eh({polygonHierarchy:{positions:this._planeVertices[1]}}),s=eh.createGeometry(r),a=new Yt({geometry:s,id:"outline",modelMatrix:t,attributes:{color:$t.fromColor(e)}}),c=[];for(let d=0;d<4;d++){let u=new eh({polygonHierarchy:{positions:this._planeVertices[2+d]}}),m=eh.createGeometry(u);c[d]=new Yt({geometry:m,id:"outline",modelMatrix:t,attributes:{color:$t.fromColor(e)}})}return new In({geometryInstances:[c[0],c[1],c[2],c[3],a,o],appearance:new Tn({translucent:!1,flat:!0}),asynchronous:!1})};var zN=BN;var yRi=x(T(),1);var aRi=x(T(),1);var nRi=x(T(),1);var Eht=new h(1,1,1),HB=Math.cos,KB=Math.sin;function cV(e){e=e??B.EMPTY_OBJECT;let t=e.radii??Eht,n=e.innerRadii??t,i=e.minimumClock??0,o=e.maximumClock??W.TWO_PI,r=e.minimumCone??0,s=e.maximumCone??W.PI,a=Math.round(e.stackPartitions??10),c=Math.round(e.slicePartitions??8),d=Math.round(e.subdivisions??128);this._radii=h.clone(t),this._innerRadii=h.clone(n),this._minimumClock=i,this._maximumClock=o,this._minimumCone=r,this._maximumCone=s,this._stackPartitions=a,this._slicePartitions=c,this._subdivisions=d,this._offsetAttribute=e.offsetAttribute,this._workerName="createEllipsoidOutlineGeometry"}cV.packedLength=2*h.packedLength+8;cV.pack=function(e,t,n){return n=n??0,h.pack(e._radii,t,n),n+=h.packedLength,h.pack(e._innerRadii,t,n),n+=h.packedLength,t[n++]=e._minimumClock,t[n++]=e._maximumClock,t[n++]=e._minimumCone,t[n++]=e._maximumCone,t[n++]=e._stackPartitions,t[n++]=e._slicePartitions,t[n++]=e._subdivisions,t[n]=e._offsetAttribute??-1,t};var GSe=new h,LSe=new h,hg={radii:GSe,innerRadii:LSe,minimumClock:void 0,maximumClock:void 0,minimumCone:void 0,maximumCone:void 0,stackPartitions:void 0,slicePartitions:void 0,subdivisions:void 0,offsetAttribute:void 0};cV.unpack=function(e,t,n){t=t??0;let i=h.unpack(e,t,GSe);t+=h.packedLength;let o=h.unpack(e,t,LSe);t+=h.packedLength;let r=e[t++],s=e[t++],a=e[t++],c=e[t++],d=e[t++],u=e[t++],m=e[t++],p=e[t];return l(n)?(n._radii=h.clone(i,n._radii),n._innerRadii=h.clone(o,n._innerRadii),n._minimumClock=r,n._maximumClock=s,n._minimumCone=a,n._maximumCone=c,n._stackPartitions=d,n._slicePartitions=u,n._subdivisions=m,n._offsetAttribute=p===-1?void 0:p,n):(hg.minimumClock=r,hg.maximumClock=s,hg.minimumCone=a,hg.maximumCone=c,hg.stackPartitions=d,hg.slicePartitions=u,hg.subdivisions=m,hg.offsetAttribute=p===-1?void 0:p,new cV(hg))};cV.createGeometry=function(e){let t=e._radii;if(t.x<=0||t.y<=0||t.z<=0)return;let n=e._innerRadii;if(n.x<=0||n.y<=0||n.z<=0)return;let i=e._minimumClock,o=e._maximumClock,r=e._minimumCone,s=e._maximumCone,a=e._subdivisions,c=ne.fromCartesian3(t),d=e._slicePartitions+1,u=e._stackPartitions+1;d=Math.round(d*Math.abs(o-i)/W.TWO_PI),u=Math.round(u*Math.abs(s-r)/W.PI),d<2&&(d=2),u<2&&(u=2);let m=0,p=1,b=n.x!==t.x||n.y!==t.y||n.z!==t.z,f=!1,y=!1;b&&(p=2,r>0&&(f=!0,m+=d),s<Math.PI&&(y=!0,m+=d));let _=a*p*(u+d),S=new Float64Array(_*3),Z=2*(_+m-(d+u)*p),R=Oe.createTypedArray(_,Z),C,E,A,L,F=0,I=new Array(u),N=new Array(u);for(C=0;C<u;C++)L=r+C*(s-r)/(u-1),I[C]=KB(L),N[C]=HB(L);let g=new Array(a),V=new Array(a);for(C=0;C<a;C++)A=i+C*(o-i)/(a-1),g[C]=KB(A),V[C]=HB(A);for(C=0;C<u;C++)for(E=0;E<a;E++)S[F++]=t.x*I[C]*V[E],S[F++]=t.y*I[C]*g[E],S[F++]=t.z*N[C];if(b)for(C=0;C<u;C++)for(E=0;E<a;E++)S[F++]=n.x*I[C]*V[E],S[F++]=n.y*I[C]*g[E],S[F++]=n.z*N[C];for(I.length=a,N.length=a,C=0;C<a;C++)L=r+C*(s-r)/(a-1),I[C]=KB(L),N[C]=HB(L);for(g.length=d,V.length=d,C=0;C<d;C++)A=i+C*(o-i)/(d-1),g[C]=KB(A),V[C]=HB(A);for(C=0;C<a;C++)for(E=0;E<d;E++)S[F++]=t.x*I[C]*V[E],S[F++]=t.y*I[C]*g[E],S[F++]=t.z*N[C];if(b)for(C=0;C<a;C++)for(E=0;E<d;E++)S[F++]=n.x*I[C]*V[E],S[F++]=n.y*I[C]*g[E],S[F++]=n.z*N[C];for(F=0,C=0;C<u*p;C++){let X=C*a;for(E=0;E<a-1;E++)R[F++]=X+E,R[F++]=X+E+1}let G=u*a*p;for(C=0;C<d;C++)for(E=0;E<a-1;E++)R[F++]=G+C+E*d,R[F++]=G+C+(E+1)*d;if(b)for(G=u*a*p+d*a,C=0;C<d;C++)for(E=0;E<a-1;E++)R[F++]=G+C+E*d,R[F++]=G+C+(E+1)*d;if(b){let X=u*a*p,Y=X+a*d;if(f)for(C=0;C<d;C++)R[F++]=X+C,R[F++]=Y+C;if(y)for(X+=a*d-d,Y+=a*d-d,C=0;C<d;C++)R[F++]=X+C,R[F++]=Y+C}let v=new Rn({position:new Xe({componentDatatype:J.DOUBLE,componentsPerAttribute:3,values:S})});if(l(e._offsetAttribute)){let X=S.length,Y=e._offsetAttribute===bn.NONE?0:1,D=new Uint8Array(X/3).fill(Y);v.applyOffset=new Xe({componentDatatype:J.UNSIGNED_BYTE,componentsPerAttribute:1,values:D})}return new At({attributes:v,indices:R,primitiveType:Ie.LINES,boundingSphere:me.fromEllipsoid(c),offsetAttribute:e._offsetAttribute})};var Du=cV;function lV(e){let t=e.radius??1,i={radii:new h(t,t,t),stackPartitions:e.stackPartitions,slicePartitions:e.slicePartitions,subdivisions:e.subdivisions};this._ellipsoidGeometry=new Du(i),this._workerName="createSphereOutlineGeometry"}lV.packedLength=Du.packedLength;lV.pack=function(e,t,n){return Du.pack(e._ellipsoidGeometry,t,n)};var Aht=new Du,BS={radius:void 0,radii:new h,stackPartitions:void 0,slicePartitions:void 0,subdivisions:void 0};lV.unpack=function(e,t,n){let i=Du.unpack(e,t,Aht);return BS.stackPartitions=i._stackPartitions,BS.slicePartitions=i._slicePartitions,BS.subdivisions=i._subdivisions,l(n)?(h.clone(i._radii,BS.radii),n._ellipsoidGeometry=new Du(BS),n):(BS.radius=i._radii.x,new lV(BS))};lV.createGeometry=function(e){return Du.createGeometry(e._ellipsoidGeometry)};var fg=lV;function dV(e,t){t===0&&(t=W.EPSILON7),this._boundingSphere=new me(e,t)}Object.defineProperties(dV.prototype,{center:{get:function(){return this._boundingSphere.center}},radius:{get:function(){return this._boundingSphere.radius}},boundingVolume:{get:function(){return this._boundingSphere}},boundingSphere:{get:function(){return this._boundingSphere}}});dV.prototype.distanceToCamera=function(e){let t=this._boundingSphere;return Math.max(0,h.distance(t.center,e.camera.positionWC)-t.radius)};dV.prototype.intersectPlane=function(e){return me.intersectPlane(this._boundingSphere,e)};dV.prototype.update=function(e,t){h.clone(e,this._boundingSphere.center),this._boundingSphere.radius=t};dV.prototype.createDebugVolume=function(e){let t=new fg({radius:this.radius}),n=P.fromTranslation(this.center,P.clone(P.IDENTITY)),i=new Yt({geometry:t,id:"outline",modelMatrix:n,attributes:{color:$t.fromColor(e)}});return new In({geometryInstances:i,appearance:new Tn({translucent:!1,flat:!0}),asynchronous:!1})};var pg=dV;var WRi=x(T(),1);var Ght=new h,Lht=new h,Wht=new h,vht=new h;function zS(e,t,n){n=h.cross(e,t,n);let i=h.magnitude(n);return h.multiplyByScalar(n,W.EPSILON7/i,n)}function R$(e,t){let n=h.normalize(e,vht),i=h.equalsEpsilon(n,h.UNIT_X,W.EPSILON6)?h.UNIT_Y:h.UNIT_X;return zS(e,i,t)}function WSe(e){let t=q.getColumn(e,0,Ght),n=q.getColumn(e,1,Lht),i=q.getColumn(e,2,Wht),o=h.equals(t,h.ZERO),r=h.equals(n,h.ZERO),s=h.equals(i,h.ZERO);return!o&&!r&&!s?e:o&&r&&s?(e[0]=W.EPSILON7,e[4]=W.EPSILON7,e[8]=W.EPSILON7,e):(o&&!r&&!s?t=zS(n,i,t):!o&&r&&!s?n=zS(t,i,n):!o&&!r&&s?i=zS(n,t,i):o?r?s||(t=R$(i,t),n=zS(i,t,n)):(t=R$(n,t),i=zS(n,t,i)):(n=R$(t,n),i=zS(n,t,i)),q.setColumn(e,0,t,e),q.setColumn(e,1,n,e),q.setColumn(e,2,i,e),e)}function uV(e,t){t=WSe(t),this._orientedBoundingBox=new nn(e,t),this._boundingSphere=me.fromOrientedBoundingBox(this._orientedBoundingBox)}Object.defineProperties(uV.prototype,{boundingVolume:{get:function(){return this._orientedBoundingBox}},boundingSphere:{get:function(){return this._boundingSphere}}});uV.prototype.distanceToCamera=function(e){return Math.sqrt(this._orientedBoundingBox.distanceSquaredTo(e.camera.positionWC))};uV.prototype.intersectPlane=function(e){return this._orientedBoundingBox.intersectPlane(e)};uV.prototype.update=function(e,t){h.clone(e,this._orientedBoundingBox.center),t=WSe(t),q.clone(t,this._orientedBoundingBox.halfAxes),me.fromOrientedBoundingBox(this._orientedBoundingBox,this._boundingSphere)};uV.prototype.createDebugVolume=function(e){let t=new Bh({minimum:new h(-1,-1,-1),maximum:new h(1,1,1)}),n=P.fromRotationTranslation(this.boundingVolume.halfAxes,this.boundingVolume.center),i=new Yt({geometry:t,id:"outline",modelMatrix:n,attributes:{color:$t.fromColor(e)}});return new In({geometryInstances:i,appearance:new Tn({translucent:!1,flat:!0}),asynchronous:!1})};var Hd=uV;function dr(e,t,n,i){this._tileset=e,this._header=n;let o=l(n.contents),r=o&&n.contents.length>1||no(n,"3DTILES_multiple_contents"),s=o&&!r?n.contents[0]:n.content;this._contentHeader=s,this.transform=l(n.transform)?P.unpack(n.transform):P.clone(P.IDENTITY);let a=l(i)?i.computedTransform:e.modelMatrix,c=P.multiply(a,this.transform,new P),d=l(i)?i._initialTransform:P.IDENTITY;this._initialTransform=P.multiply(d,this.transform,new P),this.computedTransform=c,this.metadata=kN(e,n),this._verticalExaggeration=1,this._verticalExaggerationRelativeHeight=0,this._boundingVolume=this.createBoundingVolume(n.boundingVolume,c),this._boundingVolume2D=void 0;let u;l(s)&&l(s.boundingVolume)&&(u=this.createBoundingVolume(s.boundingVolume,c)),this._contentBoundingVolume=u,this._contentBoundingVolume2D=void 0;let m;l(n.viewerRequestVolume)&&(m=this.createBoundingVolume(n.viewerRequestVolume,c)),this._viewerRequestVolume=m,this.geometricError=n.geometricError,this._geometricError=n.geometricError,l(this._geometricError)||(this._geometricError=l(i)?i._geometricError:e._geometricError,dr._deprecationWarning("geometricErrorUndefined","Required property geometricError is undefined for this tile. Using parent's geometric error instead.")),this.updateGeometricErrorScale();let p;l(n.refine)?((n.refine==="replace"||n.refine==="add")&&dr._deprecationWarning("lowercase-refine",`This tile uses a lowercase refine "${n.refine}". Instead use "${n.refine.toUpperCase()}".`),p=n.refine.toUpperCase()==="REPLACE"?xr.REPLACE:xr.ADD):l(i)?p=i.refine:p=xr.REPLACE,this.refine=p,this.children=[],this.parent=i;let b,f=!1,y,_,S;if(t=ve.createIfNeeded(t),r)y=Fo.UNLOADED,_=t.clone();else if(l(s)){let E=s.uri;l(s.url)&&(dr._deprecationWarning("contentUrl",'This tileset JSON uses the "content.url" property which has been deprecated. Use "content.uri" instead.'),E=s.url),E===""?(dr._deprecationWarning("contentUriEmpty","content.uri property is an empty string, which creates a circular dependency, making this tileset invalid. Omit the content property instead"),b=new Qp(e,this),f=!0,y=Fo.READY):(y=Fo.UNLOADED,_=t.getDerivedResource({url:E}),S=Hc.getServerKey(_.getUrlComponent()))}else b=new Qp(e,this),f=!0,y=Fo.READY;this._content=b,this._contentResource=_,this._contentState=y,this._expiredContent=void 0,this._serverKey=S,this.hasEmptyContent=f,this.hasTilesetContent=!1,this.hasImplicitContent=!1,this.hasRenderableContent=!f,this.hasImplicitContentMetadata=!1,this.hasMultipleContents=r,this.cacheNode=void 0;let Z=n.expire,R,C;l(Z)&&(R=Z.duration,l(Z.date)&&(C=Q.fromIso8601(Z.date))),this.expireDuration=R,this.expireDate=C,this.lastStyleTime=0,this._optimChildrenWithinParent=Qm.NOT_COMPUTED,this.clippingPlanesDirty=!1,this.clippingPolygonsDirty=!1,this.clippingPolygonsNeedRebake=!1,this.priorityDeferred=!1,this.implicitTileset=void 0,this.implicitCoordinates=void 0,this.implicitSubtree=void 0,this._distanceToCamera=0,this._centerZDepth=0,this._screenSpaceError=0,this._screenSpaceErrorProgressiveResolution=0,this._visibilityPlaneMask=0,this._visible=!1,this._inRequestVolume=!1,this._finalResolution=!0,this._depth=0,this._stackLength=0,this._selectionDepth=0,this._updatedVisibilityFrame=0,this._touchedFrame=0,this._visitedFrame=0,this._selectedFrame=0,this._wasSelectedLastFrame=!1,this._requestedFrame=0,this._ancestorWithContent=void 0,this._ancestorWithContentAvailable=void 0,this._refines=!1,this._shouldSelect=!1,this._isClipped=!0,this._isClippedByPolygon=!1,this._clippingPlanesState=0,this._clippingPolygonsState=0,this._debugBoundingVolume=void 0,this._debugContentBoundingVolume=void 0,this._debugViewerRequestVolume=void 0,this._debugColor=U.fromRandom({alpha:1}),this._debugColorizeTiles=!1,this._priority=0,this._priorityHolder=this,this._priorityProgressiveResolution=!1,this._priorityProgressiveResolutionScreenSpaceErrorLeaf=!1,this._priorityReverseScreenSpaceError=0,this._foveatedFactor=0,this._wasMinPriorityChild=!1,this._loadTimestamp=new Q,this._commandsLength=0,this._color=void 0,this._colorDirty=!1,this._request=void 0}dr._deprecationWarning=Jo;Object.defineProperties(dr.prototype,{tileset:{get:function(){return this._tileset}},content:{get:function(){return this._content}},boundingVolume:{get:function(){return this._boundingVolume}},contentBoundingVolume:{get:function(){return this._contentBoundingVolume??this._boundingVolume}},boundingSphere:{get:function(){return this._boundingVolume.boundingSphere}},isVisible:{get:function(){return this._visible&&this._inRequestVolume}},extras:{get:function(){return this._header.extras}},color:{get:function(){return l(this._color)||(this._color=new U),U.clone(this._color)},set:function(e){this._color=U.clone(e,this._color),this._colorDirty=!0}},contentAvailable:{get:function(){return this.contentReady&&this.hasRenderableContent||l(this._expiredContent)&&!this.contentFailed}},contentReady:{get:function(){return this._contentState===Fo.READY}},contentUnloaded:{get:function(){return this._contentState===Fo.UNLOADED}},hasUnloadedRenderableContent:{get:function(){return this.hasRenderableContent&&this.contentUnloaded}},contentExpired:{get:function(){return this._contentState===Fo.EXPIRED}},contentFailed:{get:function(){return this._contentState===Fo.FAILED}},commandsLength:{get:function(){return this._commandsLength}}});var Px=new h;function Fht(e,t){let{tileset:n,boundingSphere:i}=e,{radius:o,center:r}=i,{camera:s}=t,a=h.multiplyByScalar(s.directionWC,e._centerZDepth,Px),c=h.add(s.positionWC,a,Px),d=h.subtract(c,r,Px);if(h.magnitude(d)>o){let C=h.normalize(d,Px),E=h.multiplyByScalar(C,o,Px),A=h.add(r,E,Px),L=h.subtract(A,s.positionWC,Px),F=h.normalize(L,Px);e._foveatedFactor=1-Math.abs(h.dot(s.directionWC,F))}else e._foveatedFactor=0;let p=e.refine===xr.REPLACE,b=n.isSkippingLevelOfDetail;if(p&&!b||!n.foveatedScreenSpaceError||n.foveatedConeSize===1||e._priorityProgressiveResolution&&p&&b||n._pass===lr.PRELOAD_FLIGHT||n._pass===lr.PRELOAD)return!1;let f=1-Math.cos(s.frustum.fov*.5),y=n.foveatedConeSize*f;if(e._foveatedFactor<=y)return!1;let _=f-y,S=W.clamp((e._foveatedFactor-y)/_,0,1),Z=n.foveatedInterpolationCallback(n.foveatedMinimumScreenSpaceErrorRelaxation,n.memoryAdjustedScreenSpaceError,S),R=e._screenSpaceError===0&&l(e.parent)?e.parent._screenSpaceError*.5:e._screenSpaceError;return n.memoryAdjustedScreenSpaceError-Z<=R}var NSe=new Q;dr.prototype.getScreenSpaceError=function(e,t,n){let i=this._tileset,o=n??1,r=l(this.parent)?this.parent.geometricError:i._scaledGeometricError,s=t?r:this.geometricError;if(s===0)return 0;let{camera:a,context:c}=e,d=a.frustum,u=c.drawingBufferWidth,m=c.drawingBufferHeight*o,p;if(e.mode===se.SCENE2D||d instanceof yn){let b=d.offCenterFrustum;l(b)&&(d=b);let f=Math.max(d.top-d.bottom,d.right-d.left)/Math.max(u,m);p=s/f}else{let b=Math.max(this._distanceToCamera,W.EPSILON7),f=d.sseDenominator;if(p=s*m/(b*f),i.dynamicScreenSpaceError){let y=i._dynamicScreenSpaceErrorComputedDensity,_=i.dynamicScreenSpaceErrorFactor,S=W.fog(b,y)*_;p-=S}}return p/=e.pixelRatio,p};function Iht(e,t){if(e.progressiveResolutionHeightFraction<=0||e.progressiveResolutionHeightFraction>.5)return!1;let n=e.memoryAdjustedScreenSpaceError,i=t._screenSpaceErrorProgressiveResolution>n;t._priorityProgressiveResolutionScreenSpaceErrorLeaf=!1;let o=t.parent,r=t._screenSpaceErrorProgressiveResolution<=n,s=l(o)&&o._screenSpaceErrorProgressiveResolution>n;return r&&s&&(t._priorityProgressiveResolutionScreenSpaceErrorLeaf=!0,i=!0),i}function Pht(e,t){let n=t.parent,o=l(n)&&(!e.isSkippingLevelOfDetail||t._screenSpaceError===0||n.hasTilesetContent||n.hasImplicitContent)?n._screenSpaceError:t._screenSpaceError;return e.root._screenSpaceError-o}dr.prototype.updateVisibility=function(e){let{parent:t,tileset:n}=this;if(this._updatedVisibilityFrame===n._updatedVisibilityFrame)return;let i=l(t)?t.computedTransform:n.modelMatrix,o=l(t)?t._visibilityPlaneMask:$s.MASK_INDETERMINATE;this.updateTransform(i,e),this._distanceToCamera=this.distanceToTile(e),this._centerZDepth=this.distanceToTileCenter(e),this._screenSpaceError=this.getScreenSpaceError(e,!1),this._screenSpaceErrorProgressiveResolution=this.getScreenSpaceError(e,!1,n.progressiveResolutionHeightFraction),this._visibilityPlaneMask=this.visibility(e,o),this._visible=this._visibilityPlaneMask!==$s.MASK_OUTSIDE,this._inRequestVolume=this.insideViewerRequestVolume(e),this._priorityReverseScreenSpaceError=Pht(n,this),this._priorityProgressiveResolution=Iht(n,this),this.priorityDeferred=Fht(this,e),this._updatedVisibilityFrame=n._updatedVisibilityFrame};dr.prototype.updateExpiration=function(){if(l(this.expireDate)&&this.contentReady&&!this.hasEmptyContent&&!this.hasMultipleContents){let e=Q.now(NSe);Q.lessThan(this.expireDate,e)&&(this._contentState=Fo.EXPIRED,this._expiredContent=this._content)}};function Xht(e){if(!l(e.expireDuration))return;let t=Q.now(NSe);Q.addSeconds(t,e.expireDuration,t),l(e.expireDate)?Q.lessThan(e.expireDate,t)&&Q.clone(t,e.expireDate):e.expireDate=Q.clone(t)}function Nht(e){return function(){return e._priority}}dr.prototype.requestContent=function(){if(!this.hasEmptyContent)return this.hasMultipleContents?Yht(this):wht(this)};function Yht(e){let t=e._content,n=e._tileset;if(!l(t)){let o=no(e._header,"3DTILES_multiple_contents")?e._header.extensions["3DTILES_multiple_contents"]:e._header;t=new UN(n,e,e._contentResource.clone(),o),e._content=t}let i=t.requestInnerContents();if(l(i))return e._contentState=Fo.LOADING,i.then(o=>{if(!e.isDestroyed()&&l(o))return e._contentState=Fo.PROCESSING,t}).catch(o=>{if(!e.isDestroyed())throw e._contentState=Fo.FAILED,o})}async function Mht(e,t,n,i,o){let r=e._contentState;e._contentState=Fo.LOADING,++t.statistics.numberOfPendingRequests;let s;try{s=await o}catch(a){if(--t.statistics.numberOfPendingRequests,e.isDestroyed())return;if(n.cancelled||n.state===Ri.CANCELLED){e._contentState=r,++t.statistics.numberOfAttemptedRequests;return}if(YSe(e,a))return i&&(e.expireDate=void 0),e._content=new Qp(t,e),vSe(e),e._contentState=Fo.PROCESSING,e._content;throw e._contentState=Fo.FAILED,a}if(e.isDestroyed()){--t.statistics.numberOfPendingRequests;return}if(n.cancelled||n.state===Ri.CANCELLED){e._contentState=r,--t.statistics.numberOfPendingRequests,++t.statistics.numberOfAttemptedRequests;return}try{let a=await kht(e,s);return--t.statistics.numberOfPendingRequests,e.isDestroyed()?void 0:(i&&(e.expireDate=void 0),e._content=a,a instanceof Qp&&vSe(e),e._contentState=Fo.PROCESSING,a)}catch(a){if(--t.statistics.numberOfPendingRequests,e.isDestroyed())return;throw e._contentState=Fo.FAILED,a}}function wht(e){let t=e._contentResource.clone(),n=e.contentExpired;n&&t.setQueryParameters({expired:e.expireDate.toString()});let i=new Ar({throttle:!0,throttleByServer:!0,type:js.TILES3D,priorityFunction:Nht(e),serverKey:e._serverKey});e._request=i,t.request=i;let o=e._tileset,r=t.fetchArrayBuffer();if(!l(r)){++o.statistics.numberOfAttemptedRequests;return}return Mht(e,o,i,n,r)}function YSe(e,t){let i=e._tileset?._runtimeContentCodec?.missingTilePolicy;return!l(i)||!l(t.statusCode)?!1:i.statusCodes.includes(t.statusCode)}function vSe(e){e.hasEmptyContent=!0,e.hasRenderableContent=!1}dr._isEmptyTile=YSe;async function kht(e,t){let n=e._tileset,i=n?._runtimeContentCodec;if(l(i)&&typeof i.createContent=="function"){let d=await Promise.resolve(i.createContent(n,e,e._contentResource,t));return e.isDestroyed()?void 0:d}let o=ug(t);n._disableSkipLevelOfDetail=n._disableSkipLevelOfDetail||o.contentType===Za.GEOMETRY||o.contentType===Za.VECTOR,(o.contentType===Za.IMPLICIT_SUBTREE||o.contentType===Za.IMPLICIT_SUBTREE_JSON)&&(e.hasImplicitContent=!0,e.hasRenderableContent=!1),o.contentType===Za.EXTERNAL_TILESET&&(e.hasTilesetContent=!0,e.hasRenderableContent=!1);let r,s=NS[o.contentType];if(e.isDestroyed())return;l(o.binaryPayload)?r=await Promise.resolve(s(n,e,e._contentResource,o.binaryPayload.buffer,0)):r=await Promise.resolve(s(n,e,e._contentResource,o.jsonPayload));let a=e._contentHeader;if(e.hasImplicitContentMetadata){let d=e.implicitSubtree,u=e.implicitCoordinates;r.metadata=d.getContentMetadataView(u,0)}else e.hasImplicitContent||(r.metadata=YS(n,a));let c=MS(n,a);return l(c)&&(r.group=new z_({metadata:c})),r}dr.prototype.cancelRequests=function(){this.hasMultipleContents?this._content.cancelRequests():this._request.cancel()};dr.prototype.unloadTilesetContent=function(){this.hasTilesetContent&&(this._content=this._content&&this._content.destroy(),this._contentState=Fo.UNLOADED,this._expiredContent=void 0,this.expireDate=void 0,this.hasTilesetContent=!1,this.hasRenderableContent=!0,this._selectedFrame=0,this.lastStyleTime=0)};dr.prototype.unloadContent=function(){this.hasRenderableContent&&(this._content=this._content&&this._content.destroy(),this._contentState=Fo.UNLOADED,this.lastStyleTime=0,this.clippingPlanesDirty=this._clippingPlanesState===0,this._clippingPlanesState=0,this.clippingPolygonsDirty=this._clippingPolygonsState===0,this._clippingPolygonsState=0,this.clippingPolygonsNeedRebake=!1,this._debugColorizeTiles=!1,this._debugBoundingVolume=this._debugBoundingVolume&&this._debugBoundingVolume.destroy(),this._debugContentBoundingVolume=this._debugContentBoundingVolume&&this._debugContentBoundingVolume.destroy(),this._debugViewerRequestVolume=this._debugViewerRequestVolume&&this._debugViewerRequestVolume.destroy())};var MSe=new me;function V$(e,t){if(t.mode!==se.SCENE3D&&!l(e._boundingVolume2D)){let n=e._boundingVolume.boundingSphere,i=me.projectTo2D(n,t.mapProjection,MSe);e._boundingVolume2D=new pg(i.center,i.radius)}return t.mode!==se.SCENE3D?e._boundingVolume2D:e._boundingVolume}function Uht(e,t){if(t.mode!==se.SCENE3D&&!l(e._contentBoundingVolume2D)){let n=e._contentBoundingVolume.boundingSphere,i=me.projectTo2D(n,t.mapProjection,MSe);e._contentBoundingVolume2D=new pg(i.center,i.radius)}return t.mode!==se.SCENE3D?e._contentBoundingVolume2D:e._contentBoundingVolume}dr.prototype.visibility=function(e,t){let n=e.cullingVolume,i=V$(this,e),o=this._tileset,r=o.clippingPlanes;if(l(r)&&r.enabled){let a=r.computeIntersectionWithBoundingVolume(i,o.clippingPlanesOriginMatrix);if(this._isClipped=a!==qt.INSIDE,a===qt.OUTSIDE)return $s.MASK_OUTSIDE}let s=o.clippingPolygons;if(l(s)&&s.enabled){let a=s.computeIntersectionWithBoundingVolume(i);this._isClippedByPolygon=a!==qt.OUTSIDE}return n.computeVisibilityWithPlaneMask(i,t)};dr.prototype.contentVisibility=function(e){if(!l(this._contentBoundingVolume))return qt.INSIDE;if(this._visibilityPlaneMask===$s.MASK_INSIDE)return qt.INSIDE;let t=e.cullingVolume,n=Uht(this,e),i=this._tileset,o=i.clippingPlanes;if(l(o)&&o.enabled){let s=o.computeIntersectionWithBoundingVolume(n,i.clippingPlanesOriginMatrix);if(this._isClipped=s!==qt.INSIDE,s===qt.OUTSIDE)return qt.OUTSIDE}let r=i.clippingPolygons;if(l(r)&&r.enabled){let s=r.computeIntersectionWithBoundingVolume(n);if(this._isClippedByPolygon=s!==qt.OUTSIDE,s===qt.INSIDE)return qt.OUTSIDE}return t.computeVisibility(n)};dr.prototype.distanceToTile=function(e){return V$(this,e).distanceToCamera(e)};var Dht=new h;dr.prototype.distanceToTileCenter=function(e){let n=V$(this,e).boundingVolume,i=h.subtract(n.center,e.camera.positionWC,Dht);return h.dot(e.camera.directionWC,i)};dr.prototype.insideViewerRequestVolume=function(e){let t=this._viewerRequestVolume;return!l(t)||t.distanceToCamera(e)===0};var wSe=new q,kSe=new h,Oht=new q,E$=new h,USe=new re,DSe=new nn,C$=new P;function Bht(e,t,n){let i=h.fromElements(e[0],e[1],e[2],E$),o=q.fromArray(e,3,Oht);i=P.multiplyByPoint(t,i,i);let r=P.getMatrix3(t,wSe);return o=q.multiply(r,o,o),l(n)?(n.update(i,o),n):new Hd(i,o)}function FSe(e,t,n,i){let o=re.unpack(e,0,USe),r=e[4],s=e[5],a=nn.fromRectangle(o,r,s,ne.WGS84,DSe),c=a.center,d=a.halfAxes;t=P.multiplyTransformation(t,P.inverseTransformation(n,C$),C$),c=P.multiplyByPoint(t,c,c);let u=P.getMatrix3(t,wSe);return d=q.multiply(u,d,d),l(i)&&i instanceof Hd?(i.update(c,d),i):new Hd(c,d)}function zht(e,t,n,i){if(!P.equalsEpsilon(t,n,W.EPSILON8))return i instanceof Hd?FSe(e,t,n,i):FSe(e,t,n,void 0);let o=re.unpack(e,0,USe);return i instanceof Uu?(i.rectangle=re.clone(o,i.rectangle),i.minimumHeight=e[4],i.maximumHeight=e[5],i.computeBoundingVolumes(ne.WGS84),i):new Uu({rectangle:o,minimumHeight:e[4],maximumHeight:e[5]})}function Hht(e,t,n){let i=h.fromElements(e[0],e[1],e[2],E$),o=e[3];i=P.multiplyByPoint(t,i,i);let r=P.getScale(t,kSe),s=h.maximumComponent(r);return o*=s,l(n)?(n.update(i,o),n):new pg(i,o)}dr.prototype.createBoundingVolume=function(e,t,n){let i=this.metadata,o;if(l(i)&&(o=lx.parseBoundingVolumeSemantic("TILE",i)),l(o)&&(e=o),!l(e))throw new ae("boundingVolume must be defined");if(no(e,"3DTILES_bounding_volume_S2"))return new zN(e.extensions["3DTILES_bounding_volume_S2"]);let{box:r,region:s,sphere:a}=e;if(l(r)){let c=Bht(r,t,n);return this._verticalExaggeration!==1&&ISe(c,this._verticalExaggeration,this._verticalExaggerationRelativeHeight),c}if(l(s)){let c=zht(s,t,this._initialTransform,n);return this._verticalExaggeration===1||(c instanceof Hd?ISe(c,this._verticalExaggeration,this._verticalExaggerationRelativeHeight):(c.minimumHeight=_o.getHeight(c.minimumHeight,this._verticalExaggeration,this._verticalExaggerationRelativeHeight),c.maximumHeight=_o.getHeight(c.maximumHeight,this._verticalExaggeration,this._verticalExaggerationRelativeHeight),c.computeBoundingVolumes(ne.WGS84))),c}if(l(a)){let c=Hht(a,t,n);if(this._verticalExaggeration!==1){let d=_o.getPosition(c.center,ne.WGS84,this._verticalExaggeration,this._verticalExaggerationRelativeHeight,E$),u=c.radius*this._verticalExaggeration;c.update(d,u)}return c}throw new ae("boundingVolume must contain a sphere, region, or box")};var Kht=h.unpackArray(new Array(24).fill(0));function ISe(e,t,n){let i=e.boundingVolume.computeCorners(Kht).map(r=>_o.getPosition(r,ne.WGS84,t,n,r)),o=nn.fromPoints(i,DSe);e.update(o.center,o.halfAxes)}dr.prototype.updateTransform=function(e,t){e=e??P.IDENTITY;let n=P.multiplyTransformation(e,this.transform,C$),i=!P.equals(n,this.computedTransform),o=l(t)&&(this._verticalExaggeration!==t.verticalExaggeration||this._verticalExaggerationRelativeHeight!==t.verticalExaggerationRelativeHeight);if(!i&&!o)return;i&&P.clone(n,this.computedTransform),o&&(this._verticalExaggeration=t.verticalExaggeration,this._verticalExaggerationRelativeHeight=t.verticalExaggerationRelativeHeight);let r=this._header,s=this._contentHeader;this._boundingVolume=this.createBoundingVolume(r.boundingVolume,this.computedTransform,this._boundingVolume),l(this._contentBoundingVolume)&&(this._contentBoundingVolume=this.createBoundingVolume(s.boundingVolume,this.computedTransform,this._contentBoundingVolume)),l(this._viewerRequestVolume)&&(this._viewerRequestVolume=this.createBoundingVolume(r.viewerRequestVolume,this.computedTransform,this._viewerRequestVolume)),this.updateGeometricErrorScale(),this._debugBoundingVolume=this._debugBoundingVolume&&this._debugBoundingVolume.destroy(),this._debugContentBoundingVolume=this._debugContentBoundingVolume&&this._debugContentBoundingVolume.destroy(),this._debugViewerRequestVolume=this._debugViewerRequestVolume&&this._debugViewerRequestVolume.destroy()};dr.prototype.updateGeometricErrorScale=function(){let e=P.getScale(this.computedTransform,kSe),t=h.maximumComponent(e);if(this.geometricError=this._geometricError*t,!l(this.parent)){let n=this._tileset;n._scaledGeometricError=n._geometricError*t}};function Jht(e,t,n,i){if(!i.isRender)return;let o=l(e._contentHeader)&&l(e._contentHeader.boundingVolume),r=t.debugShowBoundingVolume||t.debugShowContentBoundingVolume&&!o;if(r){let c;e._finalResolution?e.hasRenderableContent?c=U.WHITE:c=U.DARKGRAY:c=U.YELLOW,l(e._debugBoundingVolume)||(e._debugBoundingVolume=e._boundingVolume.createDebugVolume(c)),e._debugBoundingVolume.update(n);let d=e._debugBoundingVolume.getGeometryInstanceAttributes("outline");d.color=$t.toValue(c,d.color)}else!r&&l(e._debugBoundingVolume)&&(e._debugBoundingVolume=e._debugBoundingVolume.destroy());t.debugShowContentBoundingVolume&&o?(l(e._debugContentBoundingVolume)||(e._debugContentBoundingVolume=e._contentBoundingVolume.createDebugVolume(U.BLUE)),e._debugContentBoundingVolume.update(n)):!t.debugShowContentBoundingVolume&&l(e._debugContentBoundingVolume)&&(e._debugContentBoundingVolume=e._debugContentBoundingVolume.destroy()),t.debugShowViewerRequestVolume&&l(e._viewerRequestVolume)?(l(e._debugViewerRequestVolume)||(e._debugViewerRequestVolume=e._viewerRequestVolume.createDebugVolume(U.YELLOW)),e._debugViewerRequestVolume.update(n)):!t.debugShowViewerRequestVolume&&l(e._debugViewerRequestVolume)&&(e._debugViewerRequestVolume=e._debugViewerRequestVolume.destroy());let s=t.debugColorizeTiles&&!e._debugColorizeTiles||l(t._heatmap.tilePropertyName),a=!t.debugColorizeTiles&&e._debugColorizeTiles;s?(t._heatmap.colorize(e,n),e._debugColorizeTiles=!0,e.color=e._debugColor):a&&(e._debugColorizeTiles=!1,e.color=U.WHITE),e._colorDirty&&(e._colorDirty=!1,e._content.applyDebugSettings(!0,e._color)),a&&t.makeStyleDirty()}function jht(e,t,n){let i=e._expiredContent;if(!e.hasMultipleContents&&l(i)){if(!e.contentReady){try{i.update(t,n)}catch{}return}e._expiredContent.destroy(),e._expiredContent=void 0}if(l(e.content))try{e.content.update(t,n)}catch(o){throw e._contentState=Fo.FAILED,o}}function Qht(e,t){let n=t.clippingPlanes,i=0;l(n)&&e._isClipped&&n.enabled&&(i=n.clippingPlanesState),i!==e._clippingPlanesState&&(e._clippingPlanesState=i,e.clippingPlanesDirty=!0)}function qht(e,t){let n=t.clippingPolygons,i=0;l(n)&&e._isClippedByPolygon&&n.enabled&&(i=n.clippingPolygonsState),i!==e._clippingPolygonsState&&(e._clippingPolygonsState=i,e.clippingPolygonsDirty=!0)}dr.prototype.update=function(e,t,n){let{commandList:i}=t,o=i.length;Qht(this,e),qht(this,e),Jht(this,e,t,n),jht(this,e,t);let r=i.length;this._commandsLength=r-o;for(let s=o;s<r;++s){let a=i[s],c=a.pass===Le.TRANSLUCENT;a.depthForTranslucentClassification=c}this.clippingPlanesDirty=!1,this.clippingPolygonsDirty=!1,this.clippingPolygonsNeedRebake=!1};var PSe=[];dr.prototype.process=function(e,t){!this.contentExpired&&!this.contentReady&&this._content.ready&&(Xht(this),this._selectedFrame=0,this.lastStyleTime=0,Q.now(this._loadTimestamp),this._contentState=Fo.READY,!this.hasTilesetContent&&!this.hasImplicitContent&&(e._statistics.incrementLoadCounts(this.content),++e._statistics.numberOfTilesWithContentReady,++e._statistics.numberOfLoadedTilesTotal,e._cache.add(this)));let n=t.commandList;t.commandList=PSe;try{this._content.update(e,t)}catch(i){throw this._contentState=Fo.FAILED,i}PSe.length=0,t.commandList=n};function XSe(e,t,n){let i=e*Math.pow(10,t);return parseInt(i)*Math.pow(10,n)}function JB(e,t,n){return Math.max(W.normalize(e,t,n)-W.EPSILON7,0)}dr.prototype.updatePriority=function(){let e=this.tileset,t=e.preferLeaves,n=e._minimumPriority,i=e._maximumPriority,o=4,r=1,s=0,a=o,c=s+a,d=o,u=c+d,m=r,p=Math.pow(10,u),b=u+m,f=r,y=Math.pow(10,b),_=b+f,S=Math.pow(10,_),Z=JB(this._depth,n.depth,i.depth);Z=t?1-Z:Z;let C=!e.isSkippingLevelOfDetail&&this.refine===xr.REPLACE?JB(this._priorityHolder._distanceToCamera,n.distance,i.distance):JB(this._priorityReverseScreenSpaceError,n.reverseScreenSpaceError,i.reverseScreenSpaceError),E=XSe(C,a,s),A=this._priorityProgressiveResolution?0:p,L=JB(this._priorityHolder._foveatedFactor,n.foveatedFactor,i.foveatedFactor),F=XSe(L,d,c),I=this.priorityDeferred?y:0,N=e._pass===lr.PRELOAD_FLIGHT?0:S;this._priority=Z+E+A+F+I+N};dr.prototype.isDestroyed=function(){return!1};dr.prototype.destroy=function(){return this._content=this._content&&this._content.destroy(),this._expiredContent=this._expiredContent&&!this._expiredContent.isDestroyed()&&this._expiredContent.destroy(),this._debugBoundingVolume=this._debugBoundingVolume&&this._debugBoundingVolume.destroy(),this._debugContentBoundingVolume=this._debugContentBoundingVolume&&this._debugContentBoundingVolume.destroy(),this._debugViewerRequestVolume=this._debugViewerRequestVolume&&this._debugViewerRequestVolume.destroy(),ue(this)};var th=dr;var w1i=x(T(),1);var G1i=x(T(),1);function bg(e){e=e??B.EMPTY_OBJECT;let t=e.id,n=e.group,i=e.class,o=l(n.properties)?n.properties:{};this._class=i,this._properties=o,this._id=t,this._extras=n.extras,this._extensions=n.extensions}Object.defineProperties(bg.prototype,{class:{get:function(){return this._class}},id:{get:function(){return this._id}},extras:{get:function(){return this._extras}},extensions:{get:function(){return this._extensions}}});bg.prototype.hasProperty=function(e){return Jn.hasProperty(e,this._properties,this._class)};bg.prototype.hasPropertyBySemantic=function(e){return Jn.hasPropertyBySemantic(e,this._properties,this._class)};bg.prototype.getPropertyIds=function(e){return Jn.getPropertyIds(this._properties,this._class,e)};bg.prototype.getProperty=function(e){return Jn.getProperty(e,this._properties,this._class)};bg.prototype.setProperty=function(e,t){return Jn.setProperty(e,t,this._properties,this._class)};bg.prototype.getPropertyBySemantic=function(e){return Jn.getPropertyBySemantic(e,this._properties,this._class)};bg.prototype.setPropertyBySemantic=function(e,t){return Jn.setPropertyBySemantic(e,t,this._properties,this._class)};var mV=bg;var I1i=x(T(),1);function gg(e){e=e??B.EMPTY_OBJECT;let t=e.tileset,n=e.class,i=l(t.properties)?t.properties:{};this._class=n,this._properties=i,this._extras=t.extras,this._extensions=t.extensions}Object.defineProperties(gg.prototype,{class:{get:function(){return this._class}},extras:{get:function(){return this._extras}},extensions:{get:function(){return this._extensions}}});gg.prototype.hasProperty=function(e){return Jn.hasProperty(e,this._properties,this._class)};gg.prototype.hasPropertyBySemantic=function(e){return Jn.hasPropertyBySemantic(e,this._properties,this._class)};gg.prototype.getPropertyIds=function(e){return Jn.getPropertyIds(this._properties,this._class,e)};gg.prototype.getProperty=function(e){return Jn.getProperty(e,this._properties,this._class)};gg.prototype.setProperty=function(e,t){return Jn.setProperty(e,t,this._properties,this._class)};gg.prototype.getPropertyBySemantic=function(e){return Jn.getPropertyBySemantic(e,this._properties,this._class)};gg.prototype.setPropertyBySemantic=function(e,t){return Jn.setPropertyBySemantic(e,t,this._properties,this._class)};var HN=gg;function OSe(e){e=e??B.EMPTY_OBJECT;let t=e.metadataJson,n=e.schema,i=t.metadata??t.tileset,o;l(i)&&(o=new HN({tileset:i,class:n.classes[i.class]}));let r=[],s=[],a=t.groups;if(Array.isArray(a)){let c=a.length;for(let d=0;d<c;d++){let u=a[d];s.push(new mV({group:u,class:n.classes[u.class]}))}}else if(l(a)){r=Object.keys(a).sort();let c=r.length;for(let d=0;d<c;d++){let u=r[d];if(a.hasOwnProperty(u)){let m=a[u];s.push(new mV({id:u,group:a[u],class:n.classes[m.class]}))}}}this._schema=n,this._groups=s,this._groupIds=r,this._tileset=o,this._statistics=t.statistics,this._extras=t.extras,this._extensions=t.extensions}Object.defineProperties(OSe.prototype,{schema:{get:function(){return this._schema}},groups:{get:function(){return this._groups}},groupIds:{get:function(){return this._groupIds}},tileset:{get:function(){return this._tileset}},statistics:{get:function(){return this._statistics}},extras:{get:function(){return this._extras}},extensions:{get:function(){return this._extensions}}});var HS=OSe;var z1i=x(T(),1);var BSe={},$ht=new h;BSe.checkChildrenWithinParent=function(e){let t=e.children,n=t.length,i=e.boundingVolume;if(i instanceof Hd||i instanceof Uu){let o=i._orientedBoundingBox;e._optimChildrenWithinParent=Qm.USE_OPTIMIZATION;for(let r=0;r<n;++r){let a=t[r].boundingVolume;if(!(a instanceof Hd||a instanceof Uu)){e._optimChildrenWithinParent=Qm.SKIP_OPTIMIZATION;break}let c=a._orientedBoundingBox,d=h.subtract(c.center,o.center,$ht),u=h.magnitude(d);h.divideByScalar(d,u,d);let m=Math.abs(o.halfAxes[0]*d.x)+Math.abs(o.halfAxes[1]*d.y)+Math.abs(o.halfAxes[2]*d.z)+Math.abs(o.halfAxes[3]*d.x)+Math.abs(o.halfAxes[4]*d.y)+Math.abs(o.halfAxes[5]*d.z)+Math.abs(o.halfAxes[6]*d.x)+Math.abs(o.halfAxes[7]*d.y)+Math.abs(o.halfAxes[8]*d.z),p=Math.abs(c.halfAxes[0]*d.x)+Math.abs(c.halfAxes[1]*d.y)+Math.abs(c.halfAxes[2]*d.z)+Math.abs(c.halfAxes[3]*d.x)+Math.abs(c.halfAxes[4]*d.y)+Math.abs(c.halfAxes[5]*d.z)+Math.abs(c.halfAxes[6]*d.x)+Math.abs(c.halfAxes[7]*d.y)+Math.abs(c.halfAxes[8]*d.z);if(m<=p+u){e._optimChildrenWithinParent=Qm.SKIP_OPTIMIZATION;break}}}return e._optimChildrenWithinParent===Qm.USE_OPTIMIZATION};var KN=BSe;var $1i=x(T(),1);var J1i=x(T(),1);function JN(){this.head=void 0,this.tail=void 0,this._length=0}Object.defineProperties(JN.prototype,{length:{get:function(){return this._length}}});function eft(e,t,n){this.item=e,this.previous=t,this.next=n}JN.prototype.add=function(e){let t=new eft(e,this.tail,void 0);return l(this.tail)?(this.tail.next=t,this.tail=t):(this.head=t,this.tail=t),++this._length,t};function zSe(e,t){l(t.previous)&&l(t.next)?(t.previous.next=t.next,t.next.previous=t.previous):l(t.previous)?(t.previous.next=void 0,e.tail=t.previous):l(t.next)?(t.next.previous=void 0,e.head=t.next):(e.head=void 0,e.tail=void 0),t.next=void 0,t.previous=void 0}JN.prototype.remove=function(e){l(e)&&(zSe(this,e),--this._length)};JN.prototype.splice=function(e,t){if(e===t)return;zSe(this,t);let n=e.next;e.next=t,this.tail===e?this.tail=t:n.previous=t,t.next=n,t.previous=e};var jN=JN;function Xx(){this._list=new jN,this._sentinel=this._list.add(),this._trimTiles=!1}Xx.prototype.reset=function(){this._list.splice(this._list.tail,this._sentinel)};Xx.prototype.touch=function(e){let t=e.cacheNode;l(t)&&this._list.splice(this._sentinel,t)};Xx.prototype.add=function(e){l(e.cacheNode)||(e.cacheNode=this._list.add(e))};Xx.prototype.forEachLoadedTile=function(e){for(let t=this._list.head;l(t);t=t.next)l(t.item)&&e(t.item)};Xx.prototype.unloadTile=function(e,t,n){let i=t.cacheNode;l(i)&&(this._list.remove(i),t.cacheNode=void 0,n(e,t))};Xx.prototype.unloadTiles=function(e,t){let n=this._trimTiles;this._trimTiles=!1;let i=this._list,o=this._sentinel,r=i.head;for(;r!==o&&(e.totalMemoryUsageInBytes>e.cacheBytes||n);){let s=r.item;r=r.next,this.unloadTile(e,s,t)}};Xx.prototype.trim=function(){this._trimTiles=!0};var QN=Xx;var rCi=x(T(),1);function jB(e){this.tilePropertyName=e,this._minimum=Number.MAX_VALUE,this._maximum=-Number.MAX_VALUE,this._previousMinimum=Number.MAX_VALUE,this._previousMaximum=-Number.MAX_VALUE,this._referenceMinimum={},this._referenceMaximum={}}function G$(e,t){let n;return t==="_loadTimestamp"?n=Q.toDate(e).getTime():n=e,n}jB.prototype.setReferenceMinimumMaximum=function(e,t,n){this._referenceMinimum[n]=G$(e,n),this._referenceMaximum[n]=G$(t,n)};function tft(e,t){let n=e.tilePropertyName;if(l(n)){let i=G$(t[n],n);return l(i)?(e._maximum=Math.max(i,e._maximum),e._minimum=Math.min(i,e._minimum),i):(e.tilePropertyName=void 0,i)}}var A$=[new U(.1,.1,.1,1),new U(.153,.278,.878,1),new U(.827,.231,.49,1),new U(.827,.188,.22,1),new U(1,.592,.259,1),new U(1,.843,0,1)];jB.prototype.colorize=function(e,t){let n=this.tilePropertyName;if(!l(n)||!e.contentAvailable||e._selectedFrame!==t.frameNumber)return;let i=tft(this,e),o=this._previousMinimum,r=this._previousMaximum;if(o===Number.MAX_VALUE||r===-Number.MAX_VALUE)return;let s=r-o+W.EPSILON7,c=W.clamp(i-o,0,s)/s,d=A$.length-1,u=c*d,m=Math.floor(u),p=Math.ceil(u),b=u-m,f=A$[m],y=A$[p],_=U.clone(U.WHITE);_.red=W.lerp(f.red,y.red,b),_.green=W.lerp(f.green,y.green,b),_.blue=W.lerp(f.blue,y.blue,b),e._debugColor=_};jB.prototype.resetMinimumMaximum=function(){let e=this.tilePropertyName;if(l(e)){let t=this._referenceMinimum[e],n=this._referenceMaximum[e],i=l(t)&&l(n);this._previousMinimum=i?t:this._minimum,this._previousMaximum=i?n:this._maximum,this._minimum=Number.MAX_VALUE,this._maximum=-Number.MAX_VALUE}};var qN=jB;var lCi=x(T(),1);function hV(){this.selected=0,this.visited=0,this.numberOfCommands=0,this.numberOfAttemptedRequests=0,this.numberOfPendingRequests=0,this.numberOfTilesProcessing=0,this.numberOfTilesWithContentReady=0,this.numberOfTilesTotal=0,this.numberOfLoadedTilesTotal=0,this.numberOfFeaturesSelected=0,this.numberOfFeaturesLoaded=0,this.numberOfPointsSelected=0,this.numberOfPointsLoaded=0,this.numberOfTrianglesSelected=0,this.numberOfTilesStyled=0,this.numberOfFeaturesStyled=0,this.numberOfTilesCulledWithChildrenUnion=0,this.geometryByteLength=0,this.texturesByteLength=0,this.texturesReferenceCounterById={},this.batchTableByteLength=0}hV.prototype.clear=function(){this.selected=0,this.visited=0,this.numberOfCommands=0,this.numberOfAttemptedRequests=0,this.numberOfFeaturesSelected=0,this.numberOfPointsSelected=0,this.numberOfTrianglesSelected=0,this.numberOfTilesStyled=0,this.numberOfFeaturesStyled=0,this.numberOfTilesCulledWithChildrenUnion=0};hV.prototype.incrementSelectionCounts=function(e){this.numberOfFeaturesSelected+=e.featuresLength,this.numberOfPointsSelected+=e.pointsLength,this.numberOfTrianglesSelected+=e.trianglesLength;let t=e.innerContents;if(l(t)){let n=t.length;for(let i=0;i<n;++i)this.incrementSelectionCounts(t[i])}};hV.prototype.incrementLoadCounts=function(e){if(this.numberOfFeaturesLoaded+=e.featuresLength,this.numberOfPointsLoaded+=e.pointsLength,this.geometryByteLength+=e.geometryByteLength,this.batchTableByteLength+=e.batchTableByteLength,!(e instanceof Mu))this.texturesByteLength+=e.texturesByteLength;else{let n=e.getTextureIds();for(let i of n){let o=this.texturesReferenceCounterById[i]??0;if(o===0){let r=e.getTextureByteLengthById(i);this.texturesByteLength+=r}this.texturesReferenceCounterById[i]=o+1}}let t=e.innerContents;if(l(t)){let n=t.length;for(let i=0;i<n;++i)this.incrementLoadCounts(t[i])}};hV.prototype.decrementLoadCounts=function(e){if(this.numberOfFeaturesLoaded-=e.featuresLength,this.numberOfPointsLoaded-=e.pointsLength,this.geometryByteLength-=e.geometryByteLength,this.batchTableByteLength-=e.batchTableByteLength,!(e instanceof Mu))this.texturesByteLength-=e.texturesByteLength;else{let n=e.getTextureIds();for(let i of n){let o=this.texturesReferenceCounterById[i];if(o===1){delete this.texturesReferenceCounterById[i];let r=e.getTextureByteLengthById(i);this.texturesByteLength-=r}else this.texturesReferenceCounterById[i]=o-1}}let t=e.innerContents;if(l(t)){let n=t.length;for(let i=0;i<n;++i)this.decrementLoadCounts(t[i])}};hV.clone=function(e,t){t.selected=e.selected,t.visited=e.visited,t.numberOfCommands=e.numberOfCommands,t.numberOfAttemptedRequests=e.numberOfAttemptedRequests,t.numberOfPendingRequests=e.numberOfPendingRequests,t.numberOfTilesProcessing=e.numberOfTilesProcessing,t.numberOfTilesWithContentReady=e.numberOfTilesWithContentReady,t.numberOfTilesTotal=e.numberOfTilesTotal,t.numberOfFeaturesSelected=e.numberOfFeaturesSelected,t.numberOfFeaturesLoaded=e.numberOfFeaturesLoaded,t.numberOfPointsSelected=e.numberOfPointsSelected,t.numberOfPointsLoaded=e.numberOfPointsLoaded,t.numberOfTrianglesSelected=e.numberOfTrianglesSelected,t.numberOfTilesStyled=e.numberOfTilesStyled,t.numberOfFeaturesStyled=e.numberOfFeaturesStyled,t.numberOfTilesCulledWithChildrenUnion=e.numberOfTilesCulledWithChildrenUnion,t.geometryByteLength=e.geometryByteLength,t.texturesByteLength=e.texturesByteLength,t.batchTableByteLength=e.batchTableByteLength};var Cf=hV;var mCi=x(T(),1);function $N(){this._style=void 0,this._styleDirty=!1,this._lastStyleTime=0}Object.defineProperties($N.prototype,{style:{get:function(){return this._style},set:function(e){e!==this._style&&(this._style=e,this._styleDirty=!0)}}});$N.prototype.makeDirty=function(){this._styleDirty=!0};$N.prototype.resetDirty=function(){this._styleDirty=!1};$N.prototype.applyStyle=function(e){if(!l(e.root)||l(this._style)&&!this._style._ready)return;let t=this._styleDirty;t&&++this._lastStyleTime;let n=this._lastStyleTime,i=e._statistics,o=t?e._selectedTiles:e._selectedTilesToStyle,r=o.length;for(let s=0;s<r;++s){let a=o[s];if(a.lastStyleTime!==n){let c=a.content;a.lastStyleTime=n,c.applyStyle(this._style),i.numberOfFeaturesStyled+=c.featuresLength,++i.numberOfTilesStyled}}};var eY=$N;var pCi=x(T(),1);function HSe(e,t,n){this.context=e,this.commandList=[],this.panoramaCommandList=[],this.shadowMaps=[],this.brdfLutGenerator=void 0,this.environmentMap=void 0,this.sphericalHarmonicCoefficients=void 0,this.specularEnvironmentMaps=void 0,this.specularEnvironmentMapsMaximumLOD=void 0,this.mode=se.SCENE3D,this.morphTime=se.getMorphTime(se.SCENE3D),this.frameNumber=0,this.newFrame=!1,this.time=void 0,this.jobScheduler=n,this.mapProjection=void 0,this.camera=void 0,this.cameraUnderground=!1,this.globeTranslucencyState=void 0,this.cullingVolume=void 0,this.occluder=void 0,this.maximumScreenSpaceError=void 0,this.pixelRatio=1,this.passes={render:!1,pick:!1,pickVoxel:!1,snap:!1,depth:!1,postProcess:!1,offscreen:!1},this.creditDisplay=t,this.afterRender=[],this.scene3DOnly=!1,this.fog={enabled:!1,renderable:!1,density:void 0,visualDensityScalar:void 0,sse:void 0,minimumBrightness:void 0},this.atmosphere=void 0,this.verticalExaggeration=1,this.verticalExaggerationRelativeHeight=0,this.shadowState={shadowsEnabled:!0,shadowMaps:[],lightShadowMaps:[],nearPlane:1,farPlane:5e3,closestObjectSize:1e3,lastDirtyTime:0,outOfView:!0},this.splitPosition=0,this.frustumSplits=[],this.backgroundColor=void 0,this.light=void 0,this.minimumDisableDepthTestDistance=void 0,this.invertClassification=!1,this.invertClassificationColor=void 0,this.useLogDepth=!1,this.tilesetPassState=void 0,this.minimumTerrainHeight=0,this.pickingMetadata=!1,this.pickedMetadataInfo=void 0,this.edgeVisibilityRequested=!1,this.planarFillRequested=!1}HSe.maximumFrameNumber=15e6;var Nx=HSe;var ZCi=x(T(),1);function nft(e,t,n){let i=no(t,"3DTILES_implicit_tiling")?t.extensions["3DTILES_implicit_tiling"]:t.implicitTiling;this.baseResource=e,this.geometricError=t.geometricError,this.metadataSchema=n;let o=t.boundingVolume;if(!l(o.box)&&!l(o.region)&&!no(o,"3DTILES_bounding_volume_S2")&&!no(o,"3DTILES_bounding_volume_cylinder"))throw new ae("Only box, region, 3DTILES_bounding_volume_S2, and 3DTILES_bounding_volume_cylinder are supported for implicit tiling");this.boundingVolume=o,this.refine=t.refine,this.subtreeUriTemplate=new ve({url:i.subtrees.uri}),this.contentUriTemplates=[],this.contentHeaders=[];let r=ift(t);for(let s=0;s<r.length;s++){let a=r[s];this.contentHeaders.push($e(a,!0));let c=new ve({url:a.uri});this.contentUriTemplates.push(c)}this.contentCount=this.contentHeaders.length,this.tileHeader=oft(t),this.subdivisionScheme=Us[i.subdivisionScheme],this.branchingFactor=Us.getBranchingFactor(this.subdivisionScheme),this.subtreeLevels=i.subtreeLevels,l(i.availableLevels)?this.availableLevels=i.availableLevels:this.availableLevels=i.maximumLevel+1}function ift(e){if(no(e,"3DTILES_multiple_contents")){let t=e.extensions["3DTILES_multiple_contents"];return l(t.contents)?t.contents:t.content}return l(e.contents)?e.contents:l(e.content)?[e.content]:[]}function oft(e){let t=$e(e,!0);return l(t.extensions)&&(delete t.extensions["3DTILES_implicit_tiling"],delete t.extensions["3DTILES_multiple_contents"],Object.keys(t.extensions).length===0&&delete t.extensions),delete t.implicitTiling,delete t.contents,delete t.content,t}var $p=nft;var WCi=x(T(),1);var VCi=x(T(),1);var tY={};function KSe(e){return e=(e^e<<8)&16711935,e=(e^e<<4)&252645135,e=(e^e<<2)&858993459,e=(e^e<<1)&1431655765,e}function L$(e){return e=(e^e<<16)&50331903,e=(e^e<<8)&50393103,e=(e^e<<4)&51130563,e=(e^e<<2)&153391689,e}function JSe(e){return e&=1431655765,e=(e^e>>1)&858993459,e=(e^e>>2)&252645135,e=(e^e>>4)&16711935,e=(e^e>>8)&65535,e}function W$(e){return e&=153391689,e=(e^e>>2)&51130563,e=(e^e>>4)&50393103,e=(e^e>>8)&4278190335,e=(e^e>>16)&1023,e}tY.encode2D=function(e,t){return(KSe(e)|KSe(t)<<1)>>>0};tY.decode2D=function(e,t){return l(t)||(t=new Array(2)),t[0]=JSe(e),t[1]=JSe(e>>1),t};tY.encode3D=function(e,t,n){return L$(e)|L$(t)<<1|L$(n)<<2};tY.decode3D=function(e,t){return l(t)||(t=new Array(3)),t[0]=W$(e),t[1]=W$(e>>1),t[2]=W$(e>>2),t};var Yx=tY;function Zr(e){this.subdivisionScheme=e.subdivisionScheme,this.subtreeLevels=e.subtreeLevels,this.level=e.level,this.x=e.x,this.y=e.y,this.z=void 0,e.subdivisionScheme===Us.OCTREE&&(this.z=e.z)}Object.defineProperties(Zr.prototype,{childIndex:{get:function(){let e=0;return e|=this.x&1,e|=(this.y&1)<<1,this.subdivisionScheme===Us.OCTREE&&(e|=(this.z&1)<<2),e}},mortonIndex:{get:function(){return this.subdivisionScheme===Us.OCTREE?Yx.encode3D(this.x,this.y,this.z):Yx.encode2D(this.x,this.y)}},tileIndex:{get:function(){let e=this.subdivisionScheme===Us.OCTREE?((1<<3*this.level)-1)/7:((1<<2*this.level)-1)/3,t=this.mortonIndex;return e+t}}});Zr.prototype.getDescendantCoordinates=function(e){let t=this.level+e.level,n=(this.x<<e.level)+e.x,i=(this.y<<e.level)+e.y;if(this.subdivisionScheme===Us.OCTREE){let o=(this.z<<e.level)+e.z;return new Zr({subdivisionScheme:this.subdivisionScheme,subtreeLevels:this.subtreeLevels,level:t,x:n,y:i,z:o})}return new Zr({subdivisionScheme:this.subdivisionScheme,subtreeLevels:this.subtreeLevels,level:t,x:n,y:i})};Zr.prototype.getAncestorCoordinates=function(e){let t=1<<e,n=this.level-e,i=Math.floor(this.x/t),o=Math.floor(this.y/t);if(this.subdivisionScheme===Us.OCTREE){let r=Math.floor(this.z/t);return new Zr({subdivisionScheme:this.subdivisionScheme,subtreeLevels:this.subtreeLevels,level:n,x:i,y:o,z:r})}return new Zr({subdivisionScheme:this.subdivisionScheme,subtreeLevels:this.subtreeLevels,level:n,x:i,y:o})};Zr.prototype.getOffsetCoordinates=function(e){let t=e.level-this.level,n=1<<t,i=e.x%n,o=e.y%n;if(this.subdivisionScheme===Us.OCTREE){let r=e.z%n;return new Zr({subdivisionScheme:this.subdivisionScheme,subtreeLevels:this.subtreeLevels,level:t,x:i,y:o,z:r})}return new Zr({subdivisionScheme:this.subdivisionScheme,subtreeLevels:this.subtreeLevels,level:t,x:i,y:o})};Zr.prototype.getChildCoordinates=function(e){let t=this.level+1,n=2*this.x+e%2,i=2*this.y+Math.floor(e/2)%2;if(this.subdivisionScheme===Us.OCTREE){let o=2*this.z+Math.floor(e/4)%2;return new Zr({subdivisionScheme:this.subdivisionScheme,subtreeLevels:this.subtreeLevels,level:t,x:n,y:i,z:o})}return new Zr({subdivisionScheme:this.subdivisionScheme,subtreeLevels:this.subtreeLevels,level:t,x:n,y:i})};Zr.prototype.getSubtreeCoordinates=function(){return this.getAncestorCoordinates(this.level%this.subtreeLevels)};Zr.prototype.getParentSubtreeCoordinates=function(){return this.getAncestorCoordinates(this.level%this.subtreeLevels+this.subtreeLevels)};Zr.prototype.isAncestor=function(e){let t=e.level-this.level;if(t<=0)return!1;let n=e.x>>t,i=e.y>>t,o=this.x===n,r=this.y===i;if(this.subdivisionScheme===Us.OCTREE){let s=e.z>>t,a=this.z===s;return o&&r&&a}return o&&r};Zr.prototype.isEqual=function(e){return this.subdivisionScheme===e.subdivisionScheme&&this.subtreeLevels===e.subtreeLevels&&this.level===e.level&&this.x===e.x&&this.y===e.y&&(this.subdivisionScheme===Us.OCTREE?this.z===e.z:!0)};Zr.prototype.isImplicitTilesetRoot=function(){return this.level===0};Zr.prototype.isSubtreeRoot=function(){return this.level%this.subtreeLevels===0};Zr.prototype.isBottomOfSubtree=function(){return this.level%this.subtreeLevels===this.subtreeLevels-1};Zr.prototype.getTemplateValues=function(){let e={level:this.level,x:this.x,y:this.y};return this.subdivisionScheme===Us.OCTREE&&(e.z=this.z),e};var jSe=[0,0,0];Zr.fromMortonIndex=function(e,t,n,i){let o;return e===Us.OCTREE?(o=Yx.decode3D(i,jSe),new Zr({subdivisionScheme:e,subtreeLevels:t,level:n,x:o[0],y:o[1],z:o[2]})):(o=Yx.decode2D(i,jSe),new Zr({subdivisionScheme:e,subtreeLevels:t,level:n,x:o[0],y:o[1]}))};Zr.fromTileIndex=function(e,t,n){let i,o,r;return e===Us.OCTREE?(i=Math.floor(W.log2(7*n+1)/3),o=((1<<3*i)-1)/7,r=n-o):(i=Math.floor(W.log2(3*n+1)/2),o=((1<<2*i)-1)/3,r=n-o),Zr.fromMortonIndex(e,t,i,r)};var e0=Zr;var OCi=x(T(),1);var YCi=x(T(),1);function yg(){}yg.selectTiles=function(e,t){ge.throwInstantiationError()};yg.sortChildrenByDistanceToCamera=function(e,t){return t._distanceToCamera===0&&e._distanceToCamera===0?t._centerZDepth-e._centerZDepth:t._distanceToCamera-e._distanceToCamera};yg.canTraverse=function(e){return e.children.length===0?!1:e.hasTilesetContent||e.hasImplicitContent?!e.contentExpired:e._screenSpaceError>e.tileset.memoryAdjustedScreenSpaceError};yg.selectTile=function(e,t){if(e.contentVisibility(t)===qt.OUTSIDE)return;e._wasSelectedLastFrame=!0;let{content:n,tileset:i}=e;n.featurePropertiesDirty?(n.featurePropertiesDirty=!1,e.lastStyleTime=0,i._selectedTilesToStyle.push(e)):e._selectedFrame<t.frameNumber-1&&(i._selectedTilesToStyle.push(e),e._wasSelectedLastFrame=!1),e._selectedFrame=t.frameNumber,i._selectedTiles.push(e)};yg.visitTile=function(e,t){++e.tileset._statistics.visited,e._visitedFrame=t.frameNumber};yg.touchTile=function(e,t){e._touchedFrame!==t.frameNumber&&(e.tileset._cache.touch(e),e._touchedFrame=t.frameNumber)};yg.loadTile=function(e,t){let{tileset:n}=e;if(e._requestedFrame===t.frameNumber||!e.hasUnloadedRenderableContent&&!e.contentExpired||!rft(e,t))return;let i=t.camera.timeSinceMoved<n.foveatedTimeDelay;e.priorityDeferred&&i||(e._requestedFrame=t.frameNumber,n._requestedTiles.push(e))};function rft(e,t){let{tileset:n}=e;if(!n._cullRequestsWhileMoving)return!0;let{positionWCDeltaMagnitude:i,positionWCDeltaMagnitudeLastFrame:o}=t.camera,r=i!==0?i:o,s=Math.max(e.boundingSphere.radius*2,1);return n.cullRequestsWhileMovingMultiplier*r/s<1}yg.updateTile=function(e,t){QSe(e,t),e.updateExpiration(),e._wasMinPriorityChild=!1,e._priorityHolder=e,cft(e),e._shouldSelect=!1,e._finalResolution=!0};function QSe(e,t){if(e.updateVisibility(t),!e.isVisible)return;let n=e.children.length>0;if((e.hasTilesetContent||e.hasImplicitContent)&&n){let r=e.children[0];QSe(r,t),e._visible=r._visible;return}if(sft(e,t)){e._visible=!1;return}let i=e.refine===xr.REPLACE,o=e._optimChildrenWithinParent===Qm.USE_OPTIMIZATION;if(i&&o&&n&&!aft(e,t)){++e.tileset._statistics.numberOfTilesCulledWithChildrenUnion,e._visible=!1;return}}function sft(e,t){let{parent:n,tileset:i}=e;return!l(n)||n.hasTilesetContent||n.hasImplicitContent||n.refine!==xr.ADD?!1:e.getScreenSpaceError(t,!0)<=i.memoryAdjustedScreenSpaceError}function aft(e,t){let n=!1,i=e.children;for(let o=0;o<i.length;++o){let r=i[o];r.updateVisibility(t),n=n||r.isVisible}return n}function cft(e){let t=e.tileset._minimumPriority,n=e.tileset._maximumPriority,i=e._priorityHolder;n.distance=Math.max(i._distanceToCamera,n.distance),t.distance=Math.min(i._distanceToCamera,t.distance),n.depth=Math.max(e._depth,n.depth),t.depth=Math.min(e._depth,t.depth),n.foveatedFactor=Math.max(i._foveatedFactor,n.foveatedFactor),t.foveatedFactor=Math.min(i._foveatedFactor,t.foveatedFactor),n.reverseScreenSpaceError=Math.max(e._priorityReverseScreenSpaceError,n.reverseScreenSpaceError),t.reverseScreenSpaceError=Math.min(e._priorityReverseScreenSpaceError,t.reverseScreenSpaceError)}var Ba=yg;function qSe(){}var nY={stack:new Jl,stackMaximumLength:0};qSe.selectTiles=function(e,t){e._selectedTiles.length=0,e._requestedTiles.length=0,e.hasMixedContent=!1;let n=!0,i=e.root;if(i.updateVisibility(t),!i.isVisible)return n;let{touchTile:o,visitTile:r}=Ba,s=nY.stack;for(s.push(i);s.length>0;){nY.stackMaximumLength=Math.max(nY.stackMaximumLength,s.length);let a=s.pop(),c=a.refine===xr.ADD,d=a.refine===xr.REPLACE,u=lft(a);u&&dft(a,s,t),(c||d&&!u)&&(uft(e,a),o(a,t),mft(a,t),a.hasRenderableContent&&!a.contentAvailable&&(n=!1)),r(a,t)}return nY.stack.trim(nY.stackMaximumLength),n};function lft(e){return e.children.length===0?!1:e.hasTilesetContent||e.hasImplicitContent?!e.contentExpired:(e.hasEmptyContent,!0)}function dft(e,t,n){let{children:i}=e;for(let o=0;o<i.length;++o){let r=i[o];r.updateVisibility(n),r.isVisible&&t.push(r)}}function uft(e,t){(t.hasUnloadedRenderableContent||t.contentExpired)&&(t._priority=0,e._requestedTiles.push(t))}function mft(e,t){e.contentAvailable&&e.contentVisibility(t)!==qt.OUTSIDE&&e.tileset._selectedTiles.push(e)}var iY=qSe;var jCi=x(T(),1);function $Se(){}var oY={stack:new Jl,stackMaximumLength:0},rY={stack:new Jl,stackMaximumLength:0};$Se.selectTiles=function(e,t){if(e._requestedTiles.length=0,e.debugFreezeFrame)return;e._selectedTiles.length=0,e._selectedTilesToStyle.length=0,e._emptyTiles.length=0,e.hasMixedContent=!1;let n=e.root;if(Ba.updateTile(n,t),!n.isVisible||n.getScreenSpaceError(t,!0)<=e.memoryAdjustedScreenSpaceError)return;fft(n,t),oY.stack.trim(oY.stackMaximumLength),rY.stack.trim(rY.stackMaximumLength);let i=e._requestedTiles;for(let o=0;o<i.length;++o)i[o].updatePriority()};function v$(e,t){e.contentAvailable&&Ba.selectTile(e,t)}function hft(e,t,n){let i=e.refine===xr.REPLACE,{tileset:o,children:r}=e,{updateTile:s,loadTile:a,touchTile:c}=Ba;for(let f=0;f<r.length;++f)s(r[f],n);r.sort(Ba.sortChildrenByDistanceToCamera);let d=i&&e.hasRenderableContent,u=!0,m=!1,p=-1,b=Number.MAX_VALUE;for(let f=0;f<r.length;++f){let y=r[f];if(y.isVisible?(t.push(y),y._foveatedFactor<b&&(p=f,b=y._foveatedFactor),m=!0):(d||o.loadSiblings)&&(y._foveatedFactor<b&&(p=f,b=y._foveatedFactor),a(y,n),c(y,n)),d){let _;y._inRequestVolume?y.hasRenderableContent?_=y.contentAvailable:_=pft(y,n):_=!1,u=u&&_}}if(m||(u=!1),p!==-1&&i){let f=r[p];f._wasMinPriorityChild=!0;let y=(e._wasMinPriorityChild||e===o.root)&&b<=e._priorityHolder._foveatedFactor?e._priorityHolder:e;y._foveatedFactor=Math.min(f._foveatedFactor,y._foveatedFactor),y._distanceToCamera=Math.min(f._distanceToCamera,y._distanceToCamera);for(let _=0;_<r.length;++_)r[_]._priorityHolder=y}return u}function fft(e,t){let{tileset:n}=e,{canTraverse:i,loadTile:o,visitTile:r,touchTile:s}=Ba,a=oY.stack;for(a.push(e);a.length>0;){oY.stackMaximumLength=Math.max(oY.stackMaximumLength,a.length);let c=a.pop(),d=c.parent,u=!l(d)||d._refines;c._refines=i(c)?hft(c,a,t)&&u:!1;let m=!c._refines&&u;c.hasRenderableContent?c.refine===xr.ADD?(v$(c,t),o(c,t)):c.refine===xr.REPLACE&&(o(c,t),m&&v$(c,t)):(n._emptyTiles.push(c),o(c,t),m&&v$(c,t)),r(c,t),s(c,t)}}function pft(e,t){let{canTraverse:n,updateTile:i,loadTile:o,touchTile:r}=Ba,s=e.tileset.hasExtension("3DTILES_content_gltf_vector"),a=!0,c=rY.stack;for(c.push(e);c.length>0;){rY.stackMaximumLength=Math.max(rY.stackMaximumLength,c.length);let d=c.pop(),u=d.children,m=u.length,p=!d.hasRenderableContent&&n(d);if((s?d.hasRenderableContent:!p)&&!d.contentAvailable&&(a=!1),i(d,t),d.isVisible||(o(d,t),r(d,t)),p)for(let f=0;f<m;++f){let y=u[f];c.push(y)}}return e.hasEmptyContent||a}var sY=$Se;var nVi=x(T(),1);function eZe(){}var aY={stack:new Jl,stackMaximumLength:0},cY={stack:new Jl,stackMaximumLength:0},xg={stack:new Jl,stackMaximumLength:0,ancestorStack:new Jl,ancestorStackMaximumLength:0},bft=2;eZe.selectTiles=function(e,t){if(e._requestedTiles.length=0,e.debugFreezeFrame)return;e._selectedTiles.length=0,e._selectedTilesToStyle.length=0,e._emptyTiles.length=0,e.hasMixedContent=!1;let n=e.root;if(Ba.updateTile(n,t),!n.isVisible||n.getScreenSpaceError(t,!0)<=e.memoryAdjustedScreenSpaceError)return;Sft(n,t),Zft(n,t),aY.stack.trim(aY.stackMaximumLength),cY.stack.trim(cY.stackMaximumLength),xg.stack.trim(xg.stackMaximumLength),xg.ancestorStack.trim(xg.ancestorStackMaximumLength);let i=e._requestedTiles;for(let o=0;o<i.length;++o)i[o].updatePriority()};function gft(e,t){let{updateTile:n,touchTile:i,selectTile:o}=Ba,r=cY.stack;for(r.push(e);r.length>0;){cY.stackMaximumLength=Math.max(cY.stackMaximumLength,r.length);let a=r.pop().children;for(let c=0;c<a.length;++c){let d=a[c];d.isVisible&&(d.contentAvailable?(n(d,t),i(d,t),o(d,t)):d._depth-e._depth<bft&&r.push(d))}}}function QB(e,t){let n=e.contentAvailable?e:e._ancestorWithContentAvailable;l(n)?n._shouldSelect=!0:gft(e,t)}function yft(e,t){e._ancestorWithContent=void 0,e._ancestorWithContentAvailable=void 0;let{parent:n}=e;if(!l(n))return;let i=!n.hasUnloadedRenderableContent||n._requestedFrame===t.frameNumber;e._ancestorWithContent=i?n:n._ancestorWithContent,e._ancestorWithContentAvailable=n.contentAvailable?n:n._ancestorWithContentAvailable}function xft(e,t){let n=t._ancestorWithContent;return!e.immediatelyLoadDesiredLevelOfDetail&&(t._priorityProgressiveResolutionScreenSpaceErrorLeaf||l(n)&&t._screenSpaceError<n._screenSpaceError/e.skipScreenSpaceErrorFactor&&t._depth>n._depth+e.skipLevels)}function Tft(e,t,n){let{tileset:i,children:o}=e,{updateTile:r,loadTile:s,touchTile:a}=Ba;for(let d=0;d<o.length;++d)r(o[d],n);o.sort(Ba.sortChildrenByDistanceToCamera);let c=!1;for(let d=0;d<o.length;++d){let u=o[d];u.isVisible?(t.push(u),c=!0):i.loadSiblings&&(s(u,n),a(u,n))}return c}function _ft(e,t){let{tileset:n}=e;return n.immediatelyLoadDesiredLevelOfDetail?!1:l(e._ancestorWithContent)?e._screenSpaceError===0?e.parent._screenSpaceError>t:e._screenSpaceError>t:!0}function Sft(e,t){let{tileset:n}=e,i=n.immediatelyLoadDesiredLevelOfDetail?Number.MAX_VALUE:Math.max(n.baseScreenSpaceError,n.memoryAdjustedScreenSpaceError),{canTraverse:o,loadTile:r,visitTile:s,touchTile:a}=Ba,c=aY.stack;for(c.push(e);c.length>0;){aY.stackMaximumLength=Math.max(aY.stackMaximumLength,c.length);let d=c.pop();yft(d,t);let u=d.parent,m=!l(u)||u._refines;d._refines=o(d)?Tft(d,c,t)&&m:!1;let p=!d._refines&&m;d.hasRenderableContent?d.refine===xr.ADD?(QB(d,t),r(d,t)):d.refine===xr.REPLACE&&(_ft(d,i)?(r(d,t),p&&QB(d,t)):p?(QB(d,t),r(d,t)):xft(n,d)&&r(d,t)):(n._emptyTiles.push(d),r(d,t),p&&QB(d,t)),s(d,t),a(d,t)}}function Zft(e,t){let{selectTile:n,canTraverse:i}=Ba,{stack:o,ancestorStack:r}=xg,s;for(o.push(e);o.length>0||r.length>0;){if(xg.stackMaximumLength=Math.max(xg.stackMaximumLength,o.length),xg.ancestorStackMaximumLength=Math.max(xg.ancestorStackMaximumLength,r.length),r.length>0){let d=r.peek();if(d._stackLength===o.length){r.pop(),d!==s&&(d._finalResolution=!1),n(d,t);continue}}let a=o.pop();if(!l(a))continue;let c=i(a);if(a._shouldSelect)if(a.refine===xr.ADD)n(a,t);else{if(a._selectionDepth=r.length,a._selectionDepth>0&&(a.tileset.hasMixedContent=!0),s=a,!c){n(a,t);continue}r.push(a),a._stackLength=o.length}if(c){let d=a.children;for(let u=0;u<d.length;++u){let m=d[u];m.isVisible&&o.push(m)}}}}var lY=eZe;var fVi=x(T(),1);function Va(){this._layers=[],this.layerAdded=new Se,this.layerRemoved=new Se,this.layerMoved=new Se,this.layerShownOrHidden=new Se}Object.defineProperties(Va.prototype,{length:{get:function(){return this._layers.length}}});Va.prototype.add=function(e,t){l(t)?this._layers.splice(t,0,e):(t=this._layers.length,this._layers.push(e)),this._update(),this.layerAdded.raiseEvent(e,t);let i=e.readyEvent.addEventListener(()=>{this.layerShownOrHidden.raiseEvent(e,e._layerIndex,e.show),i()})};Va.prototype.addImageryProvider=function(e,t){let n=new Zs(e);return this.add(n,t),n};Va.prototype.remove=function(e,t){t=t??!0;let n=this._layers.indexOf(e);return n!==-1?(this._layers.splice(n,1),this._update(),this.layerRemoved.raiseEvent(e,n),t&&e.destroy(),!0):!1};Va.prototype.removeAll=function(e){e=e??!0;let t=this._layers;for(let n=0,i=t.length;n<i;n++){let o=t[n];this.layerRemoved.raiseEvent(o,n),e&&o.destroy()}this._layers=[]};Va.prototype.contains=function(e){return this.indexOf(e)!==-1};Va.prototype.indexOf=function(e){return this._layers.indexOf(e)};Va.prototype.get=function(e){return this._layers[e]};function qB(e,t){return e.indexOf(t)}function tZe(e,t,n){let i=e._layers;if(t=W.clamp(t,0,i.length-1),n=W.clamp(n,0,i.length-1),t===n)return;let o=i[t];i[t]=i[n],i[n]=o,e._update(),e.layerMoved.raiseEvent(o,n,t)}Va.prototype.raise=function(e){let t=qB(this._layers,e);tZe(this,t,t+1)};Va.prototype.lower=function(e){let t=qB(this._layers,e);tZe(this,t,t-1)};Va.prototype.raiseToTop=function(e){let t=qB(this._layers,e);t!==this._layers.length-1&&(this._layers.splice(t,1),this._layers.push(e),this._update(),this.layerMoved.raiseEvent(e,this._layers.length-1,t))};Va.prototype.lowerToBottom=function(e){let t=qB(this._layers,e);t!==0&&(this._layers.splice(t,1),this._layers.splice(0,0,e),this._update(),this.layerMoved.raiseEvent(e,0,t))};var nZe=new re;function iZe(e,t,n,i){let o=e.globe._surface._tilesToRender,r;for(let a=0;!l(r)&&a<o.length;++a){let c=o[a];re.contains(c.rectangle,t)&&(r=c)}if(!l(r))return;let s=r.data.imagery;for(let a=s.length-1;a>=0;--a){let c=s[a],d=c.readyImagery;if(!l(d)||!d.imageryLayer.ready)continue;let u=d.imageryLayer.imageryProvider;if(n&&!l(u.pickFeatures)||!re.contains(d.rectangle,t))continue;let m=nZe,p=1/1024;m.west=W.lerp(r.rectangle.west,r.rectangle.east,c.textureCoordinateRectangle.x-p),m.east=W.lerp(r.rectangle.west,r.rectangle.east,c.textureCoordinateRectangle.z+p),m.south=W.lerp(r.rectangle.south,r.rectangle.north,c.textureCoordinateRectangle.y-p),m.north=W.lerp(r.rectangle.south,r.rectangle.north,c.textureCoordinateRectangle.w+p),re.contains(m,t)&&i(d)}}Va.prototype.pickImageryLayers=function(e,t){let n=t.globe.pick(e,t);if(!l(n))return;let i=t.ellipsoid.cartesianToCartographic(n),o=[];if(iZe(t,i,!1,function(r){o.push(r.imageryLayer)}),o.length!==0)return o};var Rft=new re,Cft=new re,F$=new k,I$=new k,Vft=new pe,Eft=new pe;function Aft(e,t,n,i){let o=n.imageryProvider.tilingScheme,r=o.rectangleToNativeRectangle(e,Rft),s=1/1024,a=Cft;a.west=W.lerp(r.west,r.east,t.minX-s),a.east=W.lerp(r.west,r.east,t.maxX+s),a.south=W.lerp(r.south,r.north,t.minY-s),a.north=W.lerp(r.south,r.north,t.maxY+s),l(i)||(i=new re);let c=o.projection;if(c instanceof ki)return i.west=W.toRadians(a.west),i.south=W.toRadians(a.south),i.east=W.toRadians(a.east),i.north=W.toRadians(a.north),i;F$.x=a.west,F$.y=a.south,I$.x=a.east,I$.y=a.north;let d=c.unproject(F$,Vft),u=c.unproject(I$,Eft);return i.west=d.longitude,i.south=d.latitude,i.east=u.longitude,i.north=u.latitude,i}function Gft(e,t,n){let i=e._modelImagery;if(!l(i))return;let o=i._modelPrimitiveImageries;if(l(o))for(let r=0;r<o.length;r++){let s=o[r],a=s._coveragesPerLayer;if(l(a))for(let c=a.length-1;c>=0;--c){let d=a[c];for(let u=0;u<d.length;u++){let m=d[u],p=m.imagery,b=p.imageryLayer,f=b.imageryProvider;if(!l(f.pickFeatures)||!l(p)||p.state!==Dn.READY||!re.contains(p.rectangle,t))continue;let _=s.mappedPositionsForImageryLayer(b).cartographicBoundingRectangle,S=Aft(_,m.textureCoordinateRectangle,b,nZe);re.contains(S,t)&&n(p)}}}}Va.prototype.pickImageryLayerFeatures=function(e,t){let n;l(t.globe)&&(n=t.globe.pick(e,t));let i;if(!l(n)){let c=t.pickFromRay(e);if(!l(c)||(n=c.position,!l(n)))return;l(c.object)&&l(c.object.detail)&&(i=c.object.detail.model)}let o=t.ellipsoid.cartesianToCartographic(n),r=[],s=[];function a(c){if(!c.imageryLayer.ready)return;let u=c.imageryLayer.imageryProvider.pickFeatures(c.x,c.y,c.level,o.longitude,o.latitude);l(u)&&(r.push(u),s.push(c.imageryLayer))}if(l(t.globe)&&iZe(t,o,!0,function(c){a(c)}),l(i)&&Gft(i,o,function(c){a(c)}),r.length!==0)return Promise.all(r).then(function(c){let d=[];for(let u=0;u<c.length;++u){let m=c[u],p=s[u];if(l(m)&&m.length>0)for(let b=0;b<m.length;++b){let f=m[b];f.imageryLayer=p,l(f.position)||(f.position=o),d.push(f)}}return d})};Va.prototype.queueReprojectionCommands=function(e){let t=this._layers;for(let n=0,i=t.length;n<i;++n)t[n].queueReprojectionCommands(e)};Va.prototype.cancelReprojections=function(){let e=this._layers;for(let t=0,n=e.length;t<n;++t)e[t].cancelReprojections()};Va.prototype.isDestroyed=function(){return!1};Va.prototype.destroy=function(){return this.removeAll(!0),ue(this)};Va.prototype._update=function(){let e=!0,t=this._layers,n,i,o,r;for(o=0,r=t.length;o<r;++o)i=t[o],i._layerIndex=o,i.show?(i._isBaseLayer=e,e=!1):i._isBaseLayer=!1,i.show!==i._show&&(l(i._show)&&(l(n)||(n=[]),n.push(i)),i._show=i.show);if(l(n))for(o=0,r=n.length;o<r;++o)i=n[o],this.layerShownOrHidden.raiseEvent(i,i._layerIndex,i.show)};var KS=Va;function ur(e){e=e??B.EMPTY_OBJECT,this._url=void 0,this._basePath=void 0,this._root=void 0,this._resource=void 0,this._asset=void 0,this._properties=void 0,this._geometricError=void 0,this._scaledGeometricError=void 0,this._extensionsUsed=void 0,this._extensions=void 0,this._modelUpAxis=void 0,this._modelForwardAxis=void 0,this._cache=new QN,this._externalTilesetTiles=[],this._externalTilesetSweepIndex=0,this._externalTilesetSweepCount=8,this._externalTilesetIdleFrames=e.externalTilesetIdleFrames??120,this._processingQueue=[],this._selectedTiles=[],this._emptyTiles=[],this._requestedTiles=[],this._selectedTilesToStyle=[],this._loadTimestamp=void 0,this._timeSinceLoad=0,this._updatedVisibilityFrame=0,this._updatedModelMatrixFrame=0,this._modelMatrixChanged=!1,this._previousModelMatrix=void 0,this._extras=void 0,this._credits=void 0,this._showCreditsOnScreen=e.showCreditsOnScreen??!1,this._cullWithChildrenBounds=e.cullWithChildrenBounds??!0,this._allTilesAdditive=!0,this._hasMixedContent=!1,this._stencilClearCommand=void 0,this._backfaceCommands=new Jl,this._maximumScreenSpaceError=e.maximumScreenSpaceError??16,this._memoryAdjustedScreenSpaceError=this._maximumScreenSpaceError,this._cacheBytes=e.cacheBytes??512*1024*1024;let t=e.maximumCacheOverflowBytes??512*1024*1024;this._maximumCacheOverflowBytes=t,this._styleEngine=new eY,this._styleApplied=!1,this._modelMatrix=l(e.modelMatrix)?P.clone(e.modelMatrix):P.clone(P.IDENTITY),this._addHeightCallbacks=[],this._statistics=new Cf,this._statisticsLast=new Cf,this._statisticsPerPass=new Array(lr.NUMBER_OF_PASSES);for(let o=0;o<lr.NUMBER_OF_PASSES;++o)this._statisticsPerPass[o]=new Cf;this._requestedTilesInFlight=[],this._maximumPriority={foveatedFactor:-Number.MAX_VALUE,depth:-Number.MAX_VALUE,distance:-Number.MAX_VALUE,reverseScreenSpaceError:-Number.MAX_VALUE},this._minimumPriority={foveatedFactor:Number.MAX_VALUE,depth:Number.MAX_VALUE,distance:Number.MAX_VALUE,reverseScreenSpaceError:Number.MAX_VALUE},this._heatmap=new qN(e.debugHeatmapTilePropertyName),this.cullRequestsWhileMoving=e.cullRequestsWhileMoving??!0,this._cullRequestsWhileMoving=!1,this.cullRequestsWhileMovingMultiplier=e.cullRequestsWhileMovingMultiplier??60,this.progressiveResolutionHeightFraction=W.clamp(e.progressiveResolutionHeightFraction??.3,0,.5),this.preferLeaves=e.preferLeaves??!1,this._tilesLoaded=!1,this._initialTilesLoaded=!1,this._tileDebugLabels=void 0,this._classificationType=e.classificationType,this._heightReference=e.heightReference,this._scene=e.scene,this._ellipsoid=e.ellipsoid??ne.WGS84,this._initialClippingPlanesOriginMatrix=P.IDENTITY,this._clippingPlanesOriginMatrix=void 0,this._clippingPlanesOriginMatrixDirty=!0,this._vectorClassificationOnly=e.vectorClassificationOnly??!1,this._vectorKeepDecodedPositions=e.vectorKeepDecodedPositions??!1,this._imageryLayers=new KS(this),this._imageryLayersModificationCounter=0,this._imageryLayersListener=()=>{this._imageryLayersModificationCounter++},this.imageryLayers.layerAdded.addEventListener(this._imageryLayersListener),this.imageryLayers.layerRemoved.addEventListener(this._imageryLayersListener),this.imageryLayers.layerMoved.addEventListener(this._imageryLayersListener),this.imageryLayers.layerShownOrHidden.addEventListener(this._imageryLayersListener),this._asynchronouslyLoadImagery=e.asynchronouslyLoadImagery??!1,this.preloadWhenHidden=e.preloadWhenHidden??!1,this.preloadFlightDestinations=e.preloadFlightDestinations??!0,this._pass=void 0,this.dynamicScreenSpaceError=e.dynamicScreenSpaceError??!0,this.foveatedScreenSpaceError=e.foveatedScreenSpaceError??!0,this._foveatedConeSize=e.foveatedConeSize??.1,this._foveatedMinimumScreenSpaceErrorRelaxation=e.foveatedMinimumScreenSpaceErrorRelaxation??0,this.foveatedInterpolationCallback=e.foveatedInterpolationCallback??W.lerp,this.foveatedTimeDelay=e.foveatedTimeDelay??.2,this.dynamicScreenSpaceErrorDensity=e.dynamicScreenSpaceErrorDensity??2e-4,this.dynamicScreenSpaceErrorFactor=e.dynamicScreenSpaceErrorFactor??24,this.dynamicScreenSpaceErrorHeightFalloff=e.dynamicScreenSpaceErrorHeightFalloff??.25,this._dynamicScreenSpaceErrorComputedDensity=0,this.shadows=e.shadows??vn.ENABLED,this.show=e.show??!0,this.colorBlendMode=Xd.HIGHLIGHT,this.colorBlendAmount=.5,this._pointCloudShading=new Up(e.pointCloudShading),this._pointCloudEyeDomeLighting=new kb,this.loadProgress=new Se,this.allTilesLoaded=new Se,this.initialTilesLoaded=new Se,this.tileLoad=new Se,this.tileUnload=new Se,this.tileFailed=new Se,this.tileVisible=new Se,this.skipLevelOfDetail=e.skipLevelOfDetail??!1,this._disableSkipLevelOfDetail=!1,this._runtimeContentCodec=void 0,this.baseScreenSpaceError=e.baseScreenSpaceError??1024,this.skipScreenSpaceErrorFactor=e.skipScreenSpaceErrorFactor??16,this.skipLevels=e.skipLevels??1,this.immediatelyLoadDesiredLevelOfDetail=e.immediatelyLoadDesiredLevelOfDetail??!1,this.loadSiblings=e.loadSiblings??!1,this._clippingPlanes=void 0,l(e.clippingPlanes)&&gs.setOwner(e.clippingPlanes,this,"_clippingPlanes"),this._clippingPolygons=void 0,this._clippingPolygonsNeedRebake=!1,this._removeClippingPolygonAdded=void 0,this._removeClippingPolygonRemoved=void 0,l(e.clippingPolygons)&&(vc.setOwner(e.clippingPolygons,this,"_clippingPolygons"),cZe(this)),l(e.imageBasedLighting)?(this._imageBasedLighting=e.imageBasedLighting,this._shouldDestroyImageBasedLighting=!1):(this._imageBasedLighting=new B_,this._shouldDestroyImageBasedLighting=!0),this._environmentMapManager=new Yb(e.environmentMapOptions),this.lightColor=e.lightColor,this.backFaceCulling=e.backFaceCulling??!0,this._enableShowOutline=e.enableShowOutline??!0,this.showOutline=e.showOutline??!0,this.outlineColor=e.outlineColor??U.BLACK,this.splitDirection=e.splitDirection??kr.NONE,this.enableCollision=e.enableCollision??!1,this.maximumHeightQueryGeometricError=e.maximumHeightQueryGeometricError??500,this._projectTo2D=e.projectTo2D??!1,this._enablePick=e.enablePick??!1,this.debugFreezeFrame=e.debugFreezeFrame??!1,this.debugColorizeTiles=e.debugColorizeTiles??!1,this._enableDebugWireframe=e.enableDebugWireframe??!1,this.debugWireframe=e.debugWireframe??!1,this.debugWireframe===!0&&this._enableDebugWireframe===!1&&xt("tileset-debug-wireframe-ignored","enableDebugWireframe must be set to true in the Cesium3DTileset constructor, otherwise debugWireframe will be ignored."),this.edgeDisplayMode=e.edgeDisplayMode??km.SURFACES_ONLY,this.debugShowBoundingVolume=e.debugShowBoundingVolume??!1,this.debugShowContentBoundingVolume=e.debugShowContentBoundingVolume??!1,this.debugShowViewerRequestVolume=e.debugShowViewerRequestVolume??!1,this._tileDebugLabels=void 0,this.debugPickedTileLabelOnly=!1,this.debugPickedTile=void 0,this.debugPickPosition=void 0,this.debugShowGeometricError=e.debugShowGeometricError??!1,this.debugShowRenderingStatistics=e.debugShowRenderingStatistics??!1,this.debugShowMemoryUsage=e.debugShowMemoryUsage??!1,this.debugShowUrl=e.debugShowUrl??!1,this.examineVectorLinesFunction=void 0,this._metadataExtension=void 0,this._customShader=e.customShader;let n=e.featureIdLabel??"featureId_0";typeof n=="number"&&(n=`featureId_${n}`),this._featureIdLabel=n;let i=e.instanceFeatureIdLabel??"instanceFeatureId_0";typeof i=="number"&&(i=`instanceFeatureId_${i}`),this._instanceFeatureIdLabel=i}Object.defineProperties(ur.prototype,{isCesium3DTileset:{get:function(){return!0}},asset:{get:function(){return this._asset}},extensions:{get:function(){return this._extensions}},clippingPlanes:{get:function(){return this._clippingPlanes},set:function(e){gs.setOwner(e,this,"_clippingPlanes")}},clippingPolygons:{get:function(){return this._clippingPolygons},set:function(e){vc.setOwner(e,this,"_clippingPolygons"),cZe(this),this._clippingPolygonsNeedRebake=!0}},imageryLayers:{get:function(){return this._imageryLayers}},imageryLayersModificationCounter:{get:function(){return this._imageryLayersModificationCounter}},asynchronouslyLoadImagery:{get:function(){return this._asynchronouslyLoadImagery}},properties:{get:function(){return this._properties}},tilesLoaded:{get:function(){return this._tilesLoaded}},resource:{get:function(){return this._resource}},basePath:{get:function(){return Jo("Cesium3DTileset.basePath","Cesium3DTileset.basePath has been deprecated. All tiles are relative to the url of the tileset JSON file that contains them. Use the url property instead."),this._basePath}},style:{get:function(){return this._styleEngine.style},set:function(e){this._styleEngine.style=e}},customShader:{get:function(){return this._customShader},set:function(e){this._customShader=e}},hasMixedContent:{get:function(){return this._hasMixedContent},set:function(e){this._hasMixedContent=e}},isSkippingLevelOfDetail:{get:function(){return this.skipLevelOfDetail&&!l(this._classificationType)&&!this._disableSkipLevelOfDetail&&!this._allTilesAdditive}},metadataExtension:{get:function(){return this._metadataExtension}},metadata:{get:function(){if(l(this._metadataExtension))return this._metadataExtension.tileset}},schema:{get:function(){if(l(this._metadataExtension))return this._metadataExtension.schema}},maximumScreenSpaceError:{get:function(){return this._maximumScreenSpaceError},set:function(e){this._maximumScreenSpaceError=e,this._memoryAdjustedScreenSpaceError=e}},cacheBytes:{get:function(){return this._cacheBytes},set:function(e){this._cacheBytes=e}},maximumCacheOverflowBytes:{get:function(){return this._maximumCacheOverflowBytes},set:function(e){this._maximumCacheOverflowBytes=e}},externalTilesetIdleFrames:{get:function(){return this._externalTilesetIdleFrames},set:function(e){this._externalTilesetIdleFrames=e}},memoryAdjustedScreenSpaceError:{get:function(){return this._memoryAdjustedScreenSpaceError}},pointCloudShading:{get:function(){return this._pointCloudShading},set:function(e){this._pointCloudShading=e}},root:{get:function(){return this._root}},boundingSphere:{get:function(){return this._root.updateTransform(this._modelMatrix),this._root.boundingSphere}},modelMatrix:{get:function(){return this._modelMatrix},set:function(e){this._modelMatrix=P.clone(e,this._modelMatrix)}},timeSinceLoad:{get:function(){return this._timeSinceLoad}},totalMemoryUsageInBytes:{get:function(){let e=this._statistics;return e.texturesByteLength+e.geometryByteLength+e.batchTableByteLength}},clippingPlanesOriginMatrix:{get:function(){return l(this._clippingPlanesOriginMatrix)?(this._clippingPlanesOriginMatrixDirty&&(P.multiply(this.root.computedTransform,this._initialClippingPlanesOriginMatrix,this._clippingPlanesOriginMatrix),this._clippingPlanesOriginMatrixDirty=!1),this._clippingPlanesOriginMatrix):P.IDENTITY}},styleEngine:{get:function(){return this._styleEngine}},statistics:{get:function(){return this._statistics}},classificationType:{get:function(){return this._classificationType}},heightReference:{get:function(){return this._heightReference}},scene:{get:function(){return this._scene}},ellipsoid:{get:function(){return this._ellipsoid}},foveatedConeSize:{get:function(){return this._foveatedConeSize},set:function(e){this._foveatedConeSize=e}},foveatedMinimumScreenSpaceErrorRelaxation:{get:function(){return this._foveatedMinimumScreenSpaceErrorRelaxation},set:function(e){this._foveatedMinimumScreenSpaceErrorRelaxation=e}},extras:{get:function(){return this._extras}},imageBasedLighting:{get:function(){return this._imageBasedLighting},set:function(e){e!==this._imageBasedLighting&&(this._shouldDestroyImageBasedLighting&&!this._imageBasedLighting.isDestroyed()&&this._imageBasedLighting.destroy(),this._imageBasedLighting=e,this._shouldDestroyImageBasedLighting=!1)}},environmentMapManager:{get:function(){return this._environmentMapManager}},vectorClassificationOnly:{get:function(){return this._vectorClassificationOnly}},vectorKeepDecodedPositions:{get:function(){return this._vectorKeepDecodedPositions}},showCreditsOnScreen:{get:function(){return this._showCreditsOnScreen},set:function(e){this._showCreditsOnScreen=e,hZe(this)}},featureIdLabel:{get:function(){return this._featureIdLabel},set:function(e){typeof e=="number"&&(e=`featureId_${e}`),this._featureIdLabel=e}},instanceFeatureIdLabel:{get:function(){return this._instanceFeatureIdLabel},set:function(e){typeof e=="number"&&(e=`instanceFeatureId_${e}`),this._instanceFeatureIdLabel=e}}});ur.fromIonAssetId=async function(e,t){let n=await Ur.fromAssetId(e);return ur.fromUrl(n,t)};ur.fromUrl=async function(e,t){t=t??B.EMPTY_OBJECT;let n=ve.createIfNeeded(e),i;n.extension==="json"?i=n.getBaseUri(!0):n.isDataUri&&(i="");let o=await ur.loadJson(n),r=await Lft(n,o),s=new ur(t);s._resource=n,s._url=n.url,s._basePath=i,s._metadataExtension=r,s._geometricError=o.geometricError,s._scaledGeometricError=o.geometricError;let a=o.asset;s._asset=a,s._extras=o.extras,hZe(s);let c=l(o.asset.gltfUpAxis)?Bi.fromName(o.asset.gltfUpAxis):Bi.Y,d=t.modelUpAxis??c,u=t.modelForwardAxis??Bi.X;s._properties=o.properties,s._extensionsUsed=o.extensionsUsed,s._extensions=o.extensions,s._modelUpAxis=d,s._modelForwardAxis=u,s._root=s.loadTileset(n,o);let p=s._root.createBoundingVolume(o.root.boundingVolume,P.IDENTITY).boundingSphere.center,b=s._ellipsoid.cartesianToCartographic(p);return l(b)&&b.height>Pi._defaultMinTerrainHeight&&(s._initialClippingPlanesOriginMatrix=_t.eastNorthUpToFixedFrame(p)),s._clippingPlanesOriginMatrix=P.clone(s._initialClippingPlanesOriginMatrix),s};ur.loadJson=function(e){return ve.createIfNeeded(e).fetchJson()};ur.prototype.makeStyleDirty=function(){this._styleEngine.makeDirty()};ur.prototype.loadTileset=function(e,t,n){let i=t.asset;if(!l(i))throw new ae("Tileset must have an asset property.");if(i.version!=="0.0"&&i.version!=="1.0"&&i.version!=="1.1")throw new ae("The tileset must be 3D Tiles version 0.0, 1.0, or 1.1");l(t.extensionsRequired)&&ur.checkSupportedExtensions(t.extensionsRequired);let o=this._statistics;l(n)&&this._externalTilesetTiles.push(n);let r=i.tilesetVersion;l(r)&&(this._basePath+=`?v=${r}`,e=e.clone(),e.setQueryParameters({v:r}));let s=oZe(this,e,t.root,n);l(n)&&(n.children.push(s),s._depth=n._depth+1);let a=[];for(a.push(s);a.length>0;){let c=a.pop();++o.numberOfTilesTotal,this._allTilesAdditive=this._allTilesAdditive&&c.refine===xr.ADD;let d=c._header.children;if(l(d))for(let u=0;u<d.length;++u){let m=d[u],p=oZe(this,e,m,c);c.children.push(p),p._depth=c._depth+1,a.push(p)}this._cullWithChildrenBounds&&KN.checkChildrenWithinParent(c)}return s};function oZe(e,t,n,i){if(!(l(n.implicitTiling)||no(n,"3DTILES_implicit_tiling")))return new th(e,t,n,i);let r=e.schema,s=new $p(t,n,r),a=new e0({subdivisionScheme:s.subdivisionScheme,subtreeLevels:s.subtreeLevels,level:0,x:0,y:0,z:0}),c=s.subtreeUriTemplate.getDerivedResource({templateValues:a.getTemplateValues()}).url,u=$e(n,!0);u.contents=[{uri:c}],delete u.content,delete u.extensions;let m=new th(e,t,u,i);return m.implicitTileset=s,m.implicitCoordinates=a,m}async function Lft(e,t){let n=no(t,"3DTILES_metadata")?t.extensions["3DTILES_metadata"]:t,i;if(l(n.schemaUri))e=e.getDerivedResource({url:n.schemaUri}),i=Ni.getSchemaLoader({resource:e});else if(l(n.schema))i=Ni.getSchemaLoader({schema:n.schema});else return;await i.load();let o=new HS({schema:i.schema,metadataJson:n});return Ni.unload(i),o}var rZe=new h,Wft=new pe,vft=new P,Fft=new h,Ift=new h,Pft=new h,Xft=new h;function Nft(e,t){let n,i,o,r,s,a=t.camera,c=e._root,d=c.contentBoundingVolume;if(d instanceof Uu)n=h.normalize(a.positionWC,rZe),i=a.directionWC,o=a.positionCartographic.height,r=d.minimumHeight,s=d.maximumHeight;else{let y=P.inverseTransformation(c.computedTransform,vft),_=t.mapProjection.ellipsoid,S=d.boundingVolume,Z=P.multiplyByPoint(y,S.center,Fft);if(h.magnitude(Z)>_.minimumRadius){let R=pe.fromCartesian(Z,_,Wft);n=h.normalize(a.positionWC,rZe),i=a.directionWC,o=a.positionCartographic.height,r=0,s=R.height*2}else{let R=P.multiplyByPoint(y,a.positionWC,Ift);if(n=h.UNIT_Z,i=P.multiplyByPointAsVector(y,a.directionWC,Pft),i=h.normalize(i,i),o=R.z,d instanceof Hd){let C=q.getColumn(S.halfAxes,2,Xft),E=h.magnitude(C);r=Z.z-E,s=Z.z+E}else if(d instanceof pg){let C=S.radius;r=Z.z-C,s=Z.z+C}}}let u=e.dynamicScreenSpaceErrorHeightFalloff,m=r+(s-r)*u,p=s,b=W.clamp((o-m)/(p-m),0,1),f=1-Math.abs(h.dot(i,n));f=f*(1-b),e._dynamicScreenSpaceErrorComputedDensity=e.dynamicScreenSpaceErrorDensity*f}function Yft(e,t){if(t.hasEmptyContent)return;let{statistics:n}=e,i=t.contentExpired,o=t.requestContent();l(o)&&(o.then(r=>{!l(r)||t.isDestroyed()||e.isDestroyed()||(e._processingQueue.push(t),++n.numberOfTilesProcessing)}).catch(r=>{lZe(r,e,t)}),i&&(t.hasTilesetContent||t.hasImplicitContent?uZe(e,t):(n.decrementLoadCounts(t.content),--n.numberOfTilesWithContentReady)),e._requestedTilesInFlight.push(t))}function aZe(e,t){return e._priority-t._priority}ur.prototype.postPassesUpdate=function(e){l(this._root)&&(Mft(this,e),ipt(this,e),this._cache.unloadTiles(this,mZe),tpt(this,e),this._styleApplied&&this._styleEngine.resetDirty(),this._styleApplied=!1)};function cZe(e){e._removeClippingPolygonAdded=e._removeClippingPolygonAdded&&e._removeClippingPolygonAdded(),e._removeClippingPolygonRemoved=e._removeClippingPolygonRemoved&&e._removeClippingPolygonRemoved();let t=e._clippingPolygons;if(!l(t))return;let n=()=>{e._clippingPolygonsNeedRebake=!0};e._removeClippingPolygonAdded=t.polygonAdded.addEventListener(n),e._removeClippingPolygonRemoved=t.polygonRemoved.addEventListener(n)}ur.prototype.prePassesUpdate=function(e){if(!l(this._root))return;zft(this,e);let t=this._clippingPlanes;this._clippingPlanesOriginMatrixDirty=!0,l(t)&&t.enabled&&t.update(e);let n=this._clippingPolygons;l(n)&&n.enabled&&n.update(e),this._clippingPolygonsNeedRebake&&(this._clippingPolygonsNeedRebake=!1,this._cache.forEachLoadedTile(i=>{i.clippingPolygonsNeedRebake=!0})),l(this._loadTimestamp)||(this._loadTimestamp=Q.clone(e.time)),this._timeSinceLoad=Math.max(Q.secondsDifference(e.time,this._loadTimestamp)*1e3,0),this.dynamicScreenSpaceError&&Nft(this,e),e.newFrame&&this._cache.reset()};function Mft(e,t){let n=e._requestedTilesInFlight,i=0;for(let o=0;o<n.length;++o){let r=n[o],s=t.frameNumber-r._touchedFrame>=1;if(r._contentState!==Fo.LOADING){++i;continue}else if(s){r.cancelRequests(),++i;continue}i>0&&(n[o-i]=r)}n.length-=i}function wft(e){let t=e._requestedTiles;t.sort(aZe);for(let n=0;n<t.length;++n)Yft(e,t[n])}function lZe(e,t,n){if(t.isDestroyed())return;let i;n.isDestroyed()||(i=n._contentResource.url);let o=l(e.message)?e.message:e.toString();t.tileFailed.numberOfListeners>0?t.tileFailed.raiseEvent({url:i,message:o}):(console.log(`A 3D tile failed to load: ${i}`),console.log(`Error: ${o}`),console.log(e.stack))}function kft(e){let t=e._processingQueue,n=0;for(let i=0;i<t.length;++i){let o=t[i];if(o.isDestroyed()||o._contentState!==Fo.PROCESSING){++n;continue}n>0&&(t[i-n]=o)}t.length-=n}var Uft=new pe,Dft=new pe,Oft=new h;function Bft(e,t,n){if(!e.enableCollision||!e.show||t._wasSelectedLastFrame)return;let i=e._addHeightCallbacks,o=t.boundingSphere,r=i.length;for(let s=0;s<r;++s){let a=i[s];if(a.invoked)continue;let c=a.ellipsoid,d=pe.clone(a.positionCartographic,Uft),u=pe.fromCartesian(o.center,c,Dft);l(u)&&(d.height=u.height);let m=pe.toCartesian(d,c,Oft);h.distance(m,o.center)<=o.radius&&(a.invoked=!0,n.afterRender.push(()=>{l(a.callback)&&a.callback(),a.invoked=!1}))}}function zft(e,t){kft(e);let n=e._processingQueue,{cacheBytes:i,maximumCacheOverflowBytes:o,statistics:r}=e,s=i+o,a=!1;for(let c=0;c<n.length;++c){if(e.totalMemoryUsageInBytes>s){a=!0;break}let d=n[c];try{d.process(e,t),d.contentReady&&(--r.numberOfTilesProcessing,e.tileLoad.raiseEvent(d))}catch(u){--r.numberOfTilesProcessing,lZe(u,e,d)}}e.totalMemoryUsageInBytes<i?Kft(e):a&&n.length>0&&Hft(e)}function Hft(e){e._memoryAdjustedScreenSpaceError*=1.02;let t=e._processingQueue;for(let n=0;n<t.length;++n)t[n].updatePriority();t.sort(aZe)}function Kft(e){e._memoryAdjustedScreenSpaceError=Math.max(e.memoryAdjustedScreenSpaceError/1.02,e.maximumScreenSpaceError)}var $B=new h,Jft={maximumFractionDigits:3};function sZe(e){let t=e/1048576;return t<1?t.toLocaleString(void 0,Jft):Math.round(t).toLocaleString()}function P$(e){let{halfAxes:t,radius:n,center:i}=e.boundingVolume.boundingVolume,o=h.clone(i,$B);if(l(t))o.x+=.75*(t[0]+t[3]+t[6]),o.y+=.75*(t[1]+t[4]+t[7]),o.z+=.75*(t[2]+t[5]+t[8]);else if(l(n)){let r=h.normalize(i,$B);r=h.multiplyByScalar(r,.75*n,$B),o=h.add(r,i,$B)}return o}function X$(e,t,n){let i="",o=0;if(t.debugShowGeometricError&&(i+=` +Please retile your tileset with the KHR_gaussian_splatting and KHR_gaussian_splatting_compression_spz_2 extensions.`)),n}get featuresLength(){return 0}get pointsLength(){return this.gltfPrimitive.attributes[0].count}get trianglesLength(){return 0}get geometryByteLength(){return 0}get texturesByteLength(){let t=this._tileset?.gaussianSplatPrimitive;if(!l(t))return 0;let n=t.gaussianSplatTexture,i=t.selectedTileLength;return!l(n)||i===0?0:n.sizeInBytes/i}get batchTableByteLength(){return 0}get innerContents(){}get ready(){return this._ready}get transformed(){return this._transformed}get tileset(){return this._tileset}get tile(){return this._tile}get url(){return this._resource.getUrlComponent(!0)}get batchTable(){}get metadata(){return this._metadata}set metadata(t){this._metadata=t}get group(){return this._group}set group(t){this._group=t}get positions(){return this._positions}get rotations(){return this._rotations}get scales(){return this._scales}get sphericalHarmonicsCoefficientCount(){return this._sphericalHarmonicsCoefficientCount}get sphericalHarmonicsDegree(){return this._sphericalHarmonicsDegree}get packedSphericalHarmonicsData(){return this._packedSphericalHarmonicsData}static async fromGltf(t,n,i,o){let r=i,s=ve.createIfNeeded(r),a={releaseGltfJson:!1,upAxis:Bi.Y,forwardAxis:Bi.Z};l(o.asset)?(a.gltfJson=o,a.baseResource=s,a.gltfResource=s):o instanceof Uint8Array?(a.typedArray=o,a.baseResource=s,a.gltfResource=s):a.gltfResource=ve.createIfNeeded(o);let c=new Mu(a);try{await c.load()}catch(d){throw c.destroy(),new ae(`Failed to load glTF: ${d.message}`)}return new e(c,t,n,i)}update(t,n){let i=this._loader;if(!this._ready){if(n.afterRender.push(()=>!0),!l(i)){this._ready=!0;return}if(this._resourcesLoaded){this.gltfPrimitive=i.components.scene.nodes[0].primitives[0],this.worldTransform=i.components.scene.nodes[0].matrix,this._ready=!0,this._positions=Zt.getAttributeBySemantic(this.gltfPrimitive,dt.POSITION).typedArray.slice(),this._rotations=Zt.getAttributeBySemantic(this.gltfPrimitive,dt.ROTATION).typedArray.slice(),this._scales=Zt.getAttributeBySemantic(this.gltfPrimitive,dt.SCALE).typedArray.slice();let{l:o,n:r}=_bt(this.gltfPrimitive.attributes);this._sphericalHarmonicsDegree=o,this._sphericalHarmonicsCoefficientCount=r,this._packedSphericalHarmonicsData=Cbt(this);return}this._resourcesLoaded=i.process(n)}}hasProperty(t,n){return!1}getFeature(t){}applyDebugSettings(t,n){}applyStyle(t){}pick(t,n,i){}isDestroyed(){return this.isDestroyed}destroy(){return this.splatPrimitive=void 0,this._tile=void 0,this._tileset=void 0,this._resource=void 0,this._ready=!1,this._group=void 0,this._metadata=void 0,this._resourcesLoaded=!1,this._lastSplatTransform=void 0,l(this._loader)&&(this._loader.destroy(),this._loader=void 0),ue(this)}};function Tbt(e){return`${e.startsWith("KHR_gaussian_splatting:")?"KHR_gaussian_splatting:":"_"}SH_DEGREE_`}function _bt(e){switch(e.filter(n=>n.name.includes("SH_DEGREE_")).length){default:case 0:return{l:0,n:0};case 3:return{l:1,n:9};case 8:return{l:2,n:24};case 15:return{l:3,n:45}}}var c1e=new ArrayBuffer(4),Sbt=new Float32Array(c1e),Zbt=new Uint32Array(c1e);function tee(e){Sbt[0]=e;let t=Zbt[0],n=t>>31&1,i=t>>23&255,o=t&8388607,r;if(i===255)r=n<<15|31744|(o?512:0);else if(i===0)r=n<<15;else{let s=i-127+15;s>=31?r=n<<15|31744:s<=0?r=n<<15:r=n<<15|s<<10|o>>>13}return r}function Rbt(e){let t=Tbt(e),n="_COEF_",i=t.length,o=e.indexOf(n,i),r=parseInt(e.slice(i,o),10),s=parseInt(e.slice(o+n.length),10);return{l:r,n:s}}function Cbt(e){let t=e.sphericalHarmonicsDegree,n=e.sphericalHarmonicsCoefficientCount,i=e.pointsLength*(n*(2/3)),o=new Uint32Array(i),r=e.gltfPrimitive.attributes.filter(d=>d.name.includes("SH_DEGREE_")),s=0,a=[0,9,24];switch(t){case 1:s=9;break;case 2:s=24;break;case 3:s=45;break}r.sort((d,u)=>d.name<u.name?-1:d.name>u.name?1:0);let c=s*(2/3);for(let d=0;d<r.length;d++){let{l:u,n:m}=Rbt(r[d].name);for(let p=0;p<e.pointsLength;p++){let b=a[u-1]*2/3,f=p*c+b+m*2,y=p*3;o[f]=tee(r[d].typedArray[y])|tee(r[d].typedArray[y+1])<<16,o[f+1]=tee(r[d].typedArray[y+2])}}return o}var wx=nee;var l1e={b3dm:function(e,t,n,i,o){return Hu.fromB3dm(e,t,n,i,o)},pnts:function(e,t,n,i,o){return Hu.fromPnts(e,t,n,i,o)},i3dm:function(e,t,n,i,o){return Hu.fromI3dm(e,t,n,i,o)},cmpt:function(e,t,n,i,o){return nY.fromTileType(e,t,n,i,o,l1e)},externalTileset:function(e,t,n,i){return cY.fromJson(e,t,n,i)},geom:function(e,t,n,i,o){return new oY(e,t,n,i,o)},vctr:function(e,t,n,i,o){return new xY(e,t,n,i,o)},subt:function(e,t,n,i,o){return vV.fromSubtreeJson(e,t,n,void 0,i,o)},subtreeJson:function(e,t,n,i){return vV.fromSubtreeJson(e,t,n,i)},glb:function(e,t,n,i,o){if(i.byteLength<12)throw new ae("Invalid glb content");let a=new DataView(i,o).getUint32(8,!0),c=new Uint8Array(i,o,a);return wx.tilesetRequiresGaussianSplattingExt(e)?wx.fromGltf(e,t,n,c):e.hasExtension("3DTILES_content_gltf_vector")||e.isGltfExtensionUsed("CESIUM_mesh_vector")?Mx.fromGltf(e,t,n,c):Hu.fromGltf(e,t,n,c)},gltf:function(e,t,n,i){return wx.tilesetRequiresGaussianSplattingExt(e)?wx.fromGltf(e,t,n,i):e.hasExtension("3DTILES_content_gltf_vector")||e.isGltfExtensionUsed("CESIUM_mesh_vector")?Mx.fromGltf(e,t,n,i):Hu.fromGltf(e,t,n,i)},geoJson:function(e,t,n,i){return Hu.fromGeoJson(e,t,n,i)}},nZ=l1e;var $Pi=x(T(),1),d1e={UNLOADED:0,LOADING:1,PROCESSING:2,READY:3,EXPIRED:4,FAILED:5};Object.freeze(d1e);var Fo=d1e;var tXi=x(T(),1),oh={BATCHED_3D_MODEL:"b3dm",INSTANCED_3D_MODEL:"i3dm",COMPOSITE:"cmpt",POINT_CLOUD:"pnts",VECTOR:"vctr",GEOMETRY:"geom",GLTF:"gltf",GLTF_BINARY:"glb",IMPLICIT_SUBTREE:"subt",IMPLICIT_SUBTREE_JSON:"subtreeJson",EXTERNAL_TILESET:"externalTileset",MULTIPLE_CONTENT:"multipleContent",GEOJSON:"geoJson",VOXEL_BINARY:"voxl",VOXEL_JSON:"voxelJson"};oh.isBinaryFormat=function(e){switch(e){case oh.BATCHED_3D_MODEL:case oh.INSTANCED_3D_MODEL:case oh.COMPOSITE:case oh.POINT_CLOUD:case oh.VECTOR:case oh.GEOMETRY:case oh.IMPLICIT_SUBTREE:case oh.VOXEL_BINARY:case oh.GLTF_BINARY:return!0;default:return!1}};Object.freeze(oh);var Va=oh;var iXi=x(T(),1),u1e={NOT_COMPUTED:-1,USE_OPTIMIZATION:1,SKIP_OPTIMIZATION:0};Object.freeze(u1e);var rh=u1e;var rXi=x(T(),1),Ea={RENDER:0,PICK:1,SHADOW:2,PRELOAD:3,PRELOAD_FLIGHT:4,REQUEST_RENDER_MODE_DEFER_CHECK:5,MOST_DETAILED_PRELOAD:6,MOST_DETAILED_PICK:7,NUMBER_OF_PASSES:8},yg=new Array(Ea.NUMBER_OF_PASSES);yg[Ea.RENDER]=Object.freeze({pass:Ea.RENDER,isRender:!0,requestTiles:!0,ignoreCommands:!1});yg[Ea.PICK]=Object.freeze({pass:Ea.PICK,isRender:!1,requestTiles:!1,ignoreCommands:!1});yg[Ea.SHADOW]=Object.freeze({pass:Ea.SHADOW,isRender:!1,requestTiles:!0,ignoreCommands:!1});yg[Ea.PRELOAD]=Object.freeze({pass:Ea.PRELOAD,isRender:!1,requestTiles:!0,ignoreCommands:!0});yg[Ea.PRELOAD_FLIGHT]=Object.freeze({pass:Ea.PRELOAD_FLIGHT,isRender:!1,requestTiles:!0,ignoreCommands:!0});yg[Ea.REQUEST_RENDER_MODE_DEFER_CHECK]=Object.freeze({pass:Ea.REQUEST_RENDER_MODE_DEFER_CHECK,isRender:!1,requestTiles:!0,ignoreCommands:!0});yg[Ea.MOST_DETAILED_PRELOAD]=Object.freeze({pass:Ea.MOST_DETAILED_PRELOAD,isRender:!1,requestTiles:!0,ignoreCommands:!0});yg[Ea.MOST_DETAILED_PICK]=Object.freeze({pass:Ea.MOST_DETAILED_PICK,isRender:!1,requestTiles:!1,ignoreCommands:!1});Ea.getPassOptions=function(e){return yg[e]};Object.freeze(Ea);var lr=Ea;var cXi=x(T(),1);var iee=class{constructor(t,n){this._tileset=t,this._tile=n,this.featurePropertiesDirty=!1}get featuresLength(){return 0}get pointsLength(){return 0}get trianglesLength(){return 0}get geometryByteLength(){return 0}get texturesByteLength(){return 0}get batchTableByteLength(){return 0}get innerContents(){}get ready(){return!0}get tileset(){return this._tileset}get tile(){return this._tile}get url(){}get metadata(){}set metadata(t){}get batchTable(){}get group(){}set group(t){}hasProperty(t,n){return!1}getFeature(t){}applyDebugSettings(t,n){}applyStyle(t){}update(t,n){}pick(t,n,i){}isDestroyed(){return!1}destroy(){return ue(this)}},o0=iee;var xXi=x(T(),1);var mXi=x(T(),1);function xg(e){e=e??B.EMPTY_OBJECT;let t=e.content,n=e.class;this._class=n,this._properties=t.properties,this._extensions=t.extensions,this._extras=t.extras}Object.defineProperties(xg.prototype,{class:{get:function(){return this._class}},extras:{get:function(){return this._extras}},extensions:{get:function(){return this._extensions}}});xg.prototype.hasProperty=function(e){return Jn.hasProperty(e,this._properties,this._class)};xg.prototype.hasPropertyBySemantic=function(e){return Jn.hasPropertyBySemantic(e,this._properties,this._class)};xg.prototype.getPropertyIds=function(e){return Jn.getPropertyIds(this._properties,this._class,e)};xg.prototype.getProperty=function(e){return Jn.getProperty(e,this._properties,this._class)};xg.prototype.setProperty=function(e,t){return Jn.setProperty(e,t,this._properties,this._class)};xg.prototype.getPropertyBySemantic=function(e){return Jn.getPropertyBySemantic(e,this._properties,this._class)};xg.prototype.setPropertyBySemantic=function(e,t){return Jn.setPropertyBySemantic(e,t,this._properties,this._class)};var IY=xg;function oee(e,t){let n=ro(t,"3DTILES_metadata")?t.extensions["3DTILES_metadata"]:t.metadata;if(!l(n))return;if(!l(e.schema)){oee._oneTimeWarning("findContentMetadata-missing-root-schema","Could not find a metadata schema for content metadata. For tilesets that contain external tilesets, make sure the schema is added to the root tileset.json.");return}let i=e.schema.classes??B.EMPTY_OBJECT;if(l(n.class)){let o=i[n.class];return new IY({content:n,class:o})}}oee._oneTimeWarning=xt;var iZ=oee;var ZXi=x(T(),1);function Vbt(e,t){let n=e.metadataExtension;if(!l(n))return;let i=n.groups,o=ro(t,"3DTILES_metadata")?t.extensions["3DTILES_metadata"].group:t.group;if(typeof o=="number")return i[o];let r=n.groupIds.findIndex(function(s){return s===o});return r>=0?i[r]:void 0}var oZ=Vbt;var IXi=x(T(),1);var EXi=x(T(),1);function Tg(e){e=e??B.EMPTY_OBJECT;let t=e.tile,n=e.class;this._class=n,this._properties=t.properties,this._extensions=t.extensions,this._extras=t.extras}Object.defineProperties(Tg.prototype,{class:{get:function(){return this._class}},extras:{get:function(){return this._extras}},extensions:{get:function(){return this._extensions}}});Tg.prototype.hasProperty=function(e){return Jn.hasProperty(e,this._properties,this._class)};Tg.prototype.hasPropertyBySemantic=function(e){return Jn.hasPropertyBySemantic(e,this._properties,this._class)};Tg.prototype.getPropertyIds=function(e){return Jn.getPropertyIds(this._properties,this._class,e)};Tg.prototype.getProperty=function(e){return Jn.getProperty(e,this._properties,this._class)};Tg.prototype.setProperty=function(e,t){return Jn.setProperty(e,t,this._properties,this._class)};Tg.prototype.getPropertyBySemantic=function(e){return Jn.getPropertyBySemantic(e,this._properties,this._class)};Tg.prototype.setPropertyBySemantic=function(e,t){return Jn.setPropertyBySemantic(e,t,this._properties,this._class)};var PY=Tg;function ree(e,t){let n=ro(t,"3DTILES_metadata")?t.extensions["3DTILES_metadata"]:t.metadata;if(!l(n))return;if(!l(e.schema)){ree._oneTimeWarning("findTileMetadata-missing-root-schema","Could not find a metadata schema for tile metadata. For tilesets that contain external tilesets, make sure the schema is added to the root tileset.json.");return}let i=e.schema.classes??B.EMPTY_OBJECT;if(l(n.class)){let o=i[n.class];return new PY({tile:n,class:o})}}ree._oneTimeWarning=xt;var XY=ree;var nNi=x(T(),1);var kXi=x(T(),1);function Ebt(e){let t=new Uint8Array(e),n=bf(t);if(n==="glTF"&&(n="glb"),Va.isBinaryFormat(n))return{contentType:n,binaryPayload:t};let i=Abt(t);if(l(i.root))return{contentType:Va.EXTERNAL_TILESET,jsonPayload:i};if(l(i.asset))return{contentType:Va.GLTF,jsonPayload:i};if(l(i.tileAvailability))return{contentType:Va.IMPLICIT_SUBTREE_JSON,jsonPayload:i};if(l(i.type))return{contentType:Va.GEOJSON,jsonPayload:i};if(l(i.voxelTable))return{contentType:Va.VOXEL_JSON,jsonPayload:i};throw new ae("Invalid tile content.")}function Abt(e){let t;try{t=Pr(e)}catch{throw new ae("Invalid tile content.")}return t}var _g=Ebt;var see=class{constructor(t,n,i,o){this._tileset=t,this._tile=n,this._tilesetResource=i,this._contents=[],this._contentsCreated=!1;let r=l(o.contents)?o.contents:o.content;this._innerContentHeaders=r,this._requestsInFlight=0,this._cancelCount=0,this._externalTilesetCount=0;let s=this._innerContentHeaders.length;this._arrayFetchPromises=new Array(s),this._requests=new Array(s),this._ready=!1,this._innerContentResources=new Array(s),this._serverKeys=new Array(s);for(let a=0;a<s;a++){let c=i.getDerivedResource({url:r[a].uri}),d=Hc.getServerKey(c.getUrlComponent());this._innerContentResources[a]=c,this._serverKeys[a]=d}}get featurePropertiesDirty(){let t=this._contents,n=t.length;for(let i=0;i<n;++i)if(t[i].featurePropertiesDirty)return!0;return!1}set featurePropertiesDirty(t){let n=this._contents,i=n.length;for(let o=0;o<i;++o)n[o].featurePropertiesDirty=t}get featuresLength(){return 0}get pointsLength(){return 0}get trianglesLength(){return 0}get geometryByteLength(){return 0}get texturesByteLength(){return 0}get batchTableByteLength(){return 0}get innerContents(){return this._contents}get ready(){return this._contentsCreated?this._ready:!1}get tileset(){return this._tileset}get tile(){return this._tile}get url(){}get metadata(){}set metadata(t){}get batchTable(){}get group(){}set group(t){}get innerContentUrls(){return this._innerContentHeaders.map(function(t){return t.uri})}requestInnerContents(){if(!Gbt(this._serverKeys)){this.tileset.statistics.numberOfAttemptedRequests+=this._serverKeys.length;return}let t=this._innerContentHeaders;aee(this,t.length);let n=this._cancelCount;for(let i=0;i<t.length;i++)this._arrayFetchPromises[i]=Lbt(this,i,n,this._tile._contentState);return Wbt(this)}cancelRequests(){for(let t=0;t<this._requests.length;t++){let n=this._requests[t];l(n)&&n.cancel()}}hasProperty(t,n){return!1}getFeature(t){}applyDebugSettings(t,n){let i=this._contents,o=i.length;for(let r=0;r<o;++r)i[r].applyDebugSettings(t,n)}applyStyle(t){let n=this._contents,i=n.length;for(let o=0;o<i;++o)n[o].applyStyle(t)}update(t,n){let i=this._contents,o=i.length,r=!0;for(let s=0;s<o;++s)i[s].update(t,n),r=r&&i[s].ready;!this._ready&&r&&(this._ready=!0)}pick(t,n,i){if(!this._ready)return;let o,r=Number.POSITIVE_INFINITY,s=this._contents,a=s.length;for(let c=0;c<a;++c){let d=s[c].pick(t,n,i);if(!l(d))continue;let u=h.distance(t.origin,d);u<r&&(o=d,r=u)}if(l(o))return i}isDestroyed(){return!1}destroy(){let t=this._contents,n=t.length;for(let i=0;i<n;++i)t[i].destroy();return ue(this)}};function aee(e,t){e._requestsInFlight+=t,e.tileset.statistics.numberOfPendingRequests+=t}function m1e(e,t){e._cancelCount++,e._tile._contentState=t;let n=e.tileset.statistics;n.numberOfPendingRequests-=e._requestsInFlight,n.numberOfAttemptedRequests+=e._requestsInFlight,e._requestsInFlight=0;let i=e._innerContentHeaders.length;e._arrayFetchPromises=new Array(i)}function Gbt(e){let t={};for(let n=0;n<e.length;n++){let i=e[n];l(t[i])?t[i]++:t[i]=1}for(let n in t)if(t.hasOwnProperty(n)&&!Hc.serverHasOpenSlots(n,t[n]))return!1;return Hc.heapHasOpenSlots(e.length)}function Lbt(e,t,n,i){let o=e._innerContentResources[t].clone(),r=e.tile,s=function(){return r._priority},a=e._serverKeys[t],c=new Ar({throttle:!0,throttleByServer:!0,type:js.TILES3D,priorityFunction:s,serverKey:a});o.request=c,e._requests[t]=c;let d=o.fetchArrayBuffer();if(l(d))return d.then(function(u){if(!(n<e._cancelCount)){if(o.request.cancelled||o.request.state===Ri.CANCELLED){m1e(e,i);return}return aee(e,-1),u}}).catch(function(u){if(!(n<e._cancelCount)){if(o.request.cancelled||o.request.state===Ri.CANCELLED){m1e(e,i);return}aee(e,-1),h1e(e,t,u)}})}async function Wbt(e){let t=e._cancelCount,n=await Promise.all(e._arrayFetchPromises);if(t<e._cancelCount)return;let i=n.map((r,s)=>vbt(e,r,s)),o=await Promise.all(i);if(e._contentsCreated=!0,e._contents=o.filter(l),e._externalTilesetCount===e._contents.length){let r=e._tile;r.hasRenderableContent=!1}return o}async function vbt(e,t,n){if(l(t))try{let i=_g(t),o=e._tileset,r=e._innerContentResources[n],s=e._tile;i.contentType===Va.EXTERNAL_TILESET&&(e._externalTilesetCount++,s.hasTilesetContent=!0),e._disableSkipLevelOfDetail=e._disableSkipLevelOfDetail||i.contentType===Va.GEOMETRY||i.contentType===Va.VECTOR;let a,c=nZ[i.contentType];l(i.binaryPayload)?a=await Promise.resolve(c(o,s,r,i.binaryPayload.buffer,0)):a=await Promise.resolve(c(o,s,r,i.jsonPayload));let d=e._innerContentHeaders[n];if(s.hasImplicitContentMetadata){let m=s.implicitSubtree,p=s.implicitCoordinates;a.metadata=m.getContentMetadataView(p,n)}else s.hasImplicitContent||(a.metadata=iZ(o,d));let u=oZ(o,d);return l(u)&&(a.group=new DS({metadata:u})),a}catch(i){h1e(e,n,i)}}function h1e(e,t,n){let i=e._tileset,o=e._innerContentResources[t].url,r=l(n.message)?n.message:n.toString();i.tileFailed.numberOfListeners>0?i.tileFailed.raiseEvent({url:o,message:r}):(console.log(`A content failed to load: ${o}`),console.log(`Error: ${r}`))}var NY=see;var _Ni=x(T(),1);function YV(e){this.rectangle=re.clone(e.rectangle),this.minimumHeight=e.minimumHeight??0,this.maximumHeight=e.maximumHeight??0,this.southwestCornerCartesian=new h,this.northeastCornerCartesian=new h,this.westNormal=new h,this.southNormal=new h,this.eastNormal=new h,this.northNormal=new h;let t=e.ellipsoid??ne.WGS84;Nbt(this,e.rectangle,t),this._orientedBoundingBox=void 0,this._boundingSphere=void 0,(e.computeBoundingVolumes??!0)&&this.computeBoundingVolumes(t)}Object.defineProperties(YV.prototype,{boundingVolume:{get:function(){return this._orientedBoundingBox}},boundingSphere:{get:function(){return this._boundingSphere}}});YV.prototype.computeBoundingVolumes=function(e){this._orientedBoundingBox=nn.fromRectangle(this.rectangle,this.minimumHeight,this.maximumHeight,e),this._boundingSphere=me.fromOrientedBoundingBox(this._orientedBoundingBox)};var f1e=new h,T3=new h,p1e=new h,Fbt=new h,Ibt=new h,Pbt=new h,Xbt=new h,sh=new pe,b1e=new cn(h.UNIT_X,0),NV=new gn;function Nbt(e,t,n){n.cartographicToCartesian(re.southwest(t),e.southwestCornerCartesian),n.cartographicToCartesian(re.northeast(t),e.northeastCornerCartesian),sh.longitude=t.west,sh.latitude=(t.south+t.north)*.5,sh.height=0;let i=n.cartographicToCartesian(sh,Pbt),o=h.cross(i,h.UNIT_Z,Fbt);h.normalize(o,e.westNormal),sh.longitude=t.east;let r=n.cartographicToCartesian(sh,Xbt),s=h.cross(h.UNIT_Z,r,f1e);h.normalize(s,e.eastNormal);let a=h.subtract(i,r,f1e);h.magnitude(a)===0&&(a=h.clone(o,a));let c=h.normalize(a,Ibt),d=t.south,u;if(d>0){sh.longitude=(t.west+t.east)*.5,sh.latitude=d;let y=n.cartographicToCartesian(sh,NV.origin);h.clone(c,NV.direction);let _=cn.fromPointNormal(e.southwestCornerCartesian,e.westNormal,b1e);xi.rayPlane(NV,_,e.southwestCornerCartesian),u=n.geodeticSurfaceNormal(y,T3)}else u=n.geodeticSurfaceNormalCartographic(re.southeast(t),T3);let m=h.cross(u,a,p1e);h.normalize(m,e.southNormal);let p=t.north,b;if(p<0){sh.longitude=(t.west+t.east)*.5,sh.latitude=p;let y=n.cartographicToCartesian(sh,NV.origin);h.negate(c,NV.direction);let _=cn.fromPointNormal(e.northeastCornerCartesian,e.eastNormal,b1e);xi.rayPlane(NV,_,e.northeastCornerCartesian),b=n.geodeticSurfaceNormal(y,T3)}else b=n.geodeticSurfaceNormalCartographic(re.northwest(t),T3);let f=h.cross(a,b,p1e);h.normalize(f,e.northNormal)}var Ybt=new h,Mbt=new h,wbt=new h(0,-1,0),kbt=new h(0,0,-1),g1e=new h;function Ubt(e,t){let n=t.camera,i=n.positionWC,o=n.positionCartographic,r=0;if(!re.contains(e.rectangle,o)){let d=e.southwestCornerCartesian,u=e.northeastCornerCartesian,m=e.westNormal,p=e.southNormal,b=e.eastNormal,f=e.northNormal;t.mode!==se.SCENE3D&&(d=t.mapProjection.project(re.southwest(e.rectangle),Ybt),d.z=d.y,d.y=d.x,d.x=0,u=t.mapProjection.project(re.northeast(e.rectangle),Mbt),u.z=u.y,u.y=u.x,u.x=0,m=wbt,b=h.UNIT_Y,p=kbt,f=h.UNIT_Z);let y=h.subtract(i,d,g1e),_=h.dot(y,m),S=h.dot(y,p),Z=h.subtract(i,u,g1e),R=h.dot(Z,b),C=h.dot(Z,f);_>0?r+=_*_:R>0&&(r+=R*R),S>0?r+=S*S:C>0&&(r+=C*C)}let s,a,c;if(t.mode===se.SCENE3D?(s=o.height,a=e.minimumHeight,c=e.maximumHeight):(s=i.x,a=0,c=0),s>c){let d=s-c;r+=d*d}else if(s<a){let d=a-s;r+=d*d}return Math.sqrt(r)}YV.prototype.distanceToCamera=function(e){let t=Ubt(this,e);if(e.mode===se.SCENE3D&&l(this._orientedBoundingBox)){let n=Math.sqrt(this._orientedBoundingBox.distanceSquaredTo(e.camera.positionWC));return Math.max(t,n)}return t};YV.prototype.intersectPlane=function(e){return this._orientedBoundingBox.intersectPlane(e)};YV.prototype.createDebugVolume=function(e){let t=P.clone(P.IDENTITY),n=new sS({rectangle:this.rectangle,height:this.minimumHeight,extrudedHeight:this.maximumHeight}),i=new Yt({geometry:n,id:"outline",modelMatrix:t,attributes:{color:$t.fromColor(e)}});return new In({geometryInstances:i,appearance:new Tn({translucent:!1,flat:!0}),asynchronous:!1})};var Ju=YV;var YNi=x(T(),1);var _3=new pe;function YY(e){let t=cg.fromToken(e.token),n=e.minimumHeight??0,i=e.maximumHeight??0,o=e.ellipsoid??ne.WGS84;this.s2Cell=t,this.minimumHeight=n,this.maximumHeight=i,this.ellipsoid=o;let r=Qbt(t,n,i,o);this._boundingPlanes=r;let s=tgt(r);this._vertices=s,this._edgeNormals=new Array(6),this._edgeNormals[0]=pee(r[0],s.slice(0,4));let a;for(a=0;a<4;a++)this._edgeNormals[0][a]=h.negate(this._edgeNormals[0][a],this._edgeNormals[0][a]);for(this._edgeNormals[1]=pee(r[1],s.slice(4,8)),a=0;a<4;a++)this._edgeNormals[2+a]=pee(r[2+a],[s[a%4],s[(a+1)%4],s[4+(a+1)%4],s[4+a]]);for(this._planeVertices=[this._vertices.slice(0,4),this._vertices.slice(4,8)],a=0;a<4;a++)this._planeVertices.push([this._vertices[a%4],this._vertices[(a+1)%4],this._vertices[4+(a+1)%4],this._vertices[4+a]]);let c=t.getCenter();_3=o.cartesianToCartographic(c,_3),_3.height=(i+n)/2,this.center=o.cartographicToCartesian(_3,c),this._boundingSphere=me.fromPoints(s)}var Dbt=new h,Obt=new pe,Bbt=new h,zbt=new pe,Hbt=new h,Kbt=new h,Jbt=new h,jbt=new h;function Qbt(e,t,n,i){let o=new Array(6),r=e.getCenter(),s=i.geodeticSurfaceNormal(r,Dbt),a=i.cartesianToCartographic(r,Obt);a.height=n;let c=i.cartographicToCartesian(a,Bbt),d=cn.fromPointNormal(c,s);o[0]=d;let u=0,m,p=[],b,f;for(m=0;m<4;m++){b=e.getVertex(m),p[m]=b,f=i.cartesianToCartographic(b,zbt),f.height=t;let _=cn.getPointDistance(d,i.cartographicToCartesian(f,Hbt));_<u&&(u=_)}let y=cn.clone(d);for(y.normal=h.negate(y.normal,y.normal),y.distance=y.distance*-1+u,o[1]=y,m=0;m<4;m++){b=p[m];let _=p[(m+1)%4],S=i.geodeticSurfaceNormal(b,Kbt),Z=h.subtract(_,b,jbt),R=h.cross(Z,S,Jbt);R=h.normalize(R,R),o[2+m]=cn.fromPointNormal(b,R)}return o}var rZ=new h,sZ=new h,aZ=new h,cee=new h,lee=new h,dee=new h,qbt=new h,$bt=new h,egt=new h,uee=new h,mee=new h,hee=new h,kx=new h,r0=new q;function y1e(e,t,n){rZ=e.normal,sZ=t.normal,aZ=n.normal,cee=h.multiplyByScalar(e.normal,-e.distance,cee),lee=h.multiplyByScalar(t.normal,-t.distance,lee),dee=h.multiplyByScalar(n.normal,-n.distance,dee),uee=h.multiplyByScalar(h.cross(sZ,aZ,qbt),h.dot(cee,rZ),uee),mee=h.multiplyByScalar(h.cross(aZ,rZ,$bt),h.dot(lee,sZ),mee),hee=h.multiplyByScalar(h.cross(rZ,sZ,egt),h.dot(dee,aZ),hee),r0[0]=rZ.x,r0[1]=sZ.x,r0[2]=aZ.x,r0[3]=rZ.y,r0[4]=sZ.y,r0[5]=aZ.y,r0[6]=rZ.z,r0[7]=sZ.z,r0[8]=aZ.z;let i=q.determinant(r0);return kx=h.add(uee,mee,kx),kx=h.add(kx,hee,kx),new h(kx.x/i,kx.y/i,kx.z/i)}function tgt(e){let t=new Array(8);for(let n=0;n<4;n++)t[n]=y1e(e[0],e[2+(n+3)%4],e[2+n%4]),t[n+4]=y1e(e[1],e[2+(n+3)%4],e[2+n%4]);return t}var fee=new h,MV=new h;function pee(e,t){let n=[];for(let i=0;i<4;i++)fee=h.subtract(t[(i+1)%4],t[i],fee),MV=h.cross(e.normal,fee,MV),MV=h.normalize(MV,MV),n[i]=h.clone(MV);return n}Object.defineProperties(YY.prototype,{boundingVolume:{get:function(){return this}},boundingSphere:{get:function(){return this._boundingSphere}}});var bee=new h;YY.prototype.distanceToCamera=function(e){let t=e.camera.positionWC,n=[],i=[],o;cn.getPointDistance(this._boundingPlanes[0],t)>0?(n.push(0),i.push(this._planeVertices[0]),o=this._edgeNormals[0]):cn.getPointDistance(this._boundingPlanes[1],t)>0&&(n.push(1),i.push(this._planeVertices[1]),o=this._edgeNormals[1]);let r,s;for(r=0;r<4;r++)s=2+r,cn.getPointDistance(this._boundingPlanes[s],t)>0&&(n.push(s),i.push(this._planeVertices[s]),o=this._edgeNormals[s]);if(n.length===0)return 0;let a,c;if(n.length===1)return c=this._boundingPlanes[n[0]],a=gee(cn.projectPointOntoPlane(c,t,bee),i[0],c,o),h.distance(a,t);if(n.length===2){if(n[0]===0){let p=[this._vertices[4*n[0]+(n[1]-2)],this._vertices[4*n[0]+(n[1]-2+1)%4]];return a=x1e(t,p[0],p[1]),h.distance(a,t)}let u=Number.MAX_VALUE,m;for(r=0;r<2;r++)c=this._boundingPlanes[n[r]],a=gee(cn.projectPointOntoPlane(c,t,bee),i[r],c,this._edgeNormals[n[r]]),m=h.distanceSquared(a,t),m<u&&(u=m);return Math.sqrt(u)}else if(n.length>3)return a=gee(cn.projectPointOntoPlane(this._boundingPlanes[1],t,bee),this._planeVertices[1],this._boundingPlanes[1],this._edgeNormals[1]),h.distance(a,t);let d=n[1]===2&&n[2]===5?0:1;return n[0]===0?h.distance(t,this._vertices[(n[1]-2+d)%4]):h.distance(t,this._vertices[4+(n[1]-2+d)%4])};var ngt=new h,igt=new h;function x1e(e,t,n){let i=h.subtract(n,t,ngt),o=h.subtract(e,t,igt),r=h.dot(i,o);if(r<=0)return t;let s=h.dot(i,i);return r>=s?n:(r=r/s,new h((1-r)*t.x+r*n.x,(1-r)*t.y+r*n.y,(1-r)*t.z+r*n.z))}var ogt=new cn(h.UNIT_X,0);function gee(e,t,n,i){let o=Number.MAX_VALUE,r,s,a;for(let c=0;c<t.length;c++){let d=cn.fromPointNormal(t[c],i[c],ogt);cn.getPointDistance(d,e)<0||(a=x1e(e,t[c],t[(c+1)%4]),r=h.distance(e,a),r<o&&(o=r,s=a))}return l(s)?s:e}YY.prototype.intersectPlane=function(e){let t=0,n=0;for(let i=0;i<this._vertices.length;i++)h.dot(e.normal,this._vertices[i])+e.distance<0?n++:t++;return t===this._vertices.length?qt.INSIDE:n===this._vertices.length?qt.OUTSIDE:qt.INTERSECTING};YY.prototype.createDebugVolume=function(e){let t=P.clone(P.IDENTITY),n=new Ym({polygonHierarchy:{positions:this._planeVertices[0]}}),i=Ym.createGeometry(n),o=new Yt({geometry:i,id:"outline",modelMatrix:t,attributes:{color:$t.fromColor(e)}}),r=new Ym({polygonHierarchy:{positions:this._planeVertices[1]}}),s=Ym.createGeometry(r),a=new Yt({geometry:s,id:"outline",modelMatrix:t,attributes:{color:$t.fromColor(e)}}),c=[];for(let d=0;d<4;d++){let u=new Ym({polygonHierarchy:{positions:this._planeVertices[2+d]}}),m=Ym.createGeometry(u);c[d]=new Yt({geometry:m,id:"outline",modelMatrix:t,attributes:{color:$t.fromColor(e)}})}return new In({geometryInstances:[c[0],c[1],c[2],c[3],a,o],appearance:new Tn({translucent:!1,flat:!0}),asynchronous:!1})};var MY=YY;var eYi=x(T(),1);var DNi=x(T(),1);function wV(e){let t=e.radius??1,i={radii:new h(t,t,t),stackPartitions:e.stackPartitions,slicePartitions:e.slicePartitions,subdivisions:e.subdivisions};this._ellipsoidGeometry=new Wu(i),this._workerName="createSphereOutlineGeometry"}wV.packedLength=Wu.packedLength;wV.pack=function(e,t,n){return Wu.pack(e._ellipsoidGeometry,t,n)};var rgt=new Wu,cZ={radius:void 0,radii:new h,stackPartitions:void 0,slicePartitions:void 0,subdivisions:void 0};wV.unpack=function(e,t,n){let i=Wu.unpack(e,t,rgt);return cZ.stackPartitions=i._stackPartitions,cZ.slicePartitions=i._slicePartitions,cZ.subdivisions=i._subdivisions,l(n)?(h.clone(i._radii,cZ.radii),n._ellipsoidGeometry=new Wu(cZ),n):(cZ.radius=i._radii.x,new wV(cZ))};wV.createGeometry=function(e){return Wu.createGeometry(e._ellipsoidGeometry)};var Sg=wV;function kV(e,t){t===0&&(t=W.EPSILON7),this._boundingSphere=new me(e,t)}Object.defineProperties(kV.prototype,{center:{get:function(){return this._boundingSphere.center}},radius:{get:function(){return this._boundingSphere.radius}},boundingVolume:{get:function(){return this._boundingSphere}},boundingSphere:{get:function(){return this._boundingSphere}}});kV.prototype.distanceToCamera=function(e){let t=this._boundingSphere;return Math.max(0,h.distance(t.center,e.camera.positionWC)-t.radius)};kV.prototype.intersectPlane=function(e){return me.intersectPlane(this._boundingSphere,e)};kV.prototype.update=function(e,t){h.clone(e,this._boundingSphere.center),this._boundingSphere.radius=t};kV.prototype.createDebugVolume=function(e){let t=new Sg({radius:this.radius}),n=P.fromTranslation(this.center,P.clone(P.IDENTITY)),i=new Yt({geometry:t,id:"outline",modelMatrix:n,attributes:{color:$t.fromColor(e)}});return new In({geometryInstances:i,appearance:new Tn({translucent:!1,flat:!0}),asynchronous:!1})};var Zg=kV;var hYi=x(T(),1);var sgt=new h,agt=new h,cgt=new h,lgt=new h;function lZ(e,t,n){n=h.cross(e,t,n);let i=h.magnitude(n);return h.multiplyByScalar(n,W.EPSILON7/i,n)}function yee(e,t){let n=h.normalize(e,lgt),i=h.equalsEpsilon(n,h.UNIT_X,W.EPSILON6)?h.UNIT_Y:h.UNIT_X;return lZ(e,i,t)}function T1e(e){let t=q.getColumn(e,0,sgt),n=q.getColumn(e,1,agt),i=q.getColumn(e,2,cgt),o=h.equals(t,h.ZERO),r=h.equals(n,h.ZERO),s=h.equals(i,h.ZERO);return!o&&!r&&!s?e:o&&r&&s?(e[0]=W.EPSILON7,e[4]=W.EPSILON7,e[8]=W.EPSILON7,e):(o&&!r&&!s?t=lZ(n,i,t):!o&&r&&!s?n=lZ(t,i,n):!o&&!r&&s?i=lZ(n,t,i):o?r?s||(t=yee(i,t),n=lZ(i,t,n)):(t=yee(n,t),i=lZ(n,t,i)):(n=yee(t,n),i=lZ(n,t,i)),q.setColumn(e,0,t,e),q.setColumn(e,1,n,e),q.setColumn(e,2,i,e),e)}function UV(e,t){t=T1e(t),this._orientedBoundingBox=new nn(e,t),this._boundingSphere=me.fromOrientedBoundingBox(this._orientedBoundingBox)}Object.defineProperties(UV.prototype,{boundingVolume:{get:function(){return this._orientedBoundingBox}},boundingSphere:{get:function(){return this._boundingSphere}}});UV.prototype.distanceToCamera=function(e){return Math.sqrt(this._orientedBoundingBox.distanceSquaredTo(e.camera.positionWC))};UV.prototype.intersectPlane=function(e){return this._orientedBoundingBox.intersectPlane(e)};UV.prototype.update=function(e,t){h.clone(e,this._orientedBoundingBox.center),t=T1e(t),q.clone(t,this._orientedBoundingBox.halfAxes),me.fromOrientedBoundingBox(this._orientedBoundingBox,this._boundingSphere)};UV.prototype.createDebugVolume=function(e){let t=new tf({minimum:new h(-1,-1,-1),maximum:new h(1,1,1)}),n=P.fromRotationTranslation(this.boundingVolume.halfAxes,this.boundingVolume.center),i=new Yt({geometry:t,id:"outline",modelMatrix:n,attributes:{color:$t.fromColor(e)}});return new In({geometryInstances:i,appearance:new Tn({translucent:!1,flat:!0}),asynchronous:!1})};var Qd=UV;function dr(e,t,n,i){this._tileset=e,this._header=n;let o=l(n.contents),r=o&&n.contents.length>1||ro(n,"3DTILES_multiple_contents"),s=o&&!r?n.contents[0]:n.content;this._contentHeader=s,this.transform=l(n.transform)?P.unpack(n.transform):P.clone(P.IDENTITY);let a=l(i)?i.computedTransform:e.modelMatrix,c=P.multiply(a,this.transform,new P),d=l(i)?i._initialTransform:P.IDENTITY;this._initialTransform=P.multiply(d,this.transform,new P),this.computedTransform=c,this.metadata=XY(e,n),this._verticalExaggeration=1,this._verticalExaggerationRelativeHeight=0,this._boundingVolume=this.createBoundingVolume(n.boundingVolume,c),this._boundingVolume2D=void 0;let u;l(s)&&l(s.boundingVolume)&&(u=this.createBoundingVolume(s.boundingVolume,c)),this._contentBoundingVolume=u,this._contentBoundingVolume2D=void 0;let m;l(n.viewerRequestVolume)&&(m=this.createBoundingVolume(n.viewerRequestVolume,c)),this._viewerRequestVolume=m,this.geometricError=n.geometricError,this._geometricError=n.geometricError,l(this._geometricError)||(this._geometricError=l(i)?i._geometricError:e._geometricError,dr._deprecationWarning("geometricErrorUndefined","Required property geometricError is undefined for this tile. Using parent's geometric error instead.")),this.updateGeometricErrorScale();let p;l(n.refine)?((n.refine==="replace"||n.refine==="add")&&dr._deprecationWarning("lowercase-refine",`This tile uses a lowercase refine "${n.refine}". Instead use "${n.refine.toUpperCase()}".`),p=n.refine.toUpperCase()==="REPLACE"?Tr.REPLACE:Tr.ADD):l(i)?p=i.refine:p=Tr.REPLACE,this.refine=p,this.children=[],this.parent=i;let b,f=!1,y,_,S;if(t=ve.createIfNeeded(t),r)y=Fo.UNLOADED,_=t.clone();else if(l(s)){let E=s.uri;l(s.url)&&(dr._deprecationWarning("contentUrl",'This tileset JSON uses the "content.url" property which has been deprecated. Use "content.uri" instead.'),E=s.url),E===""?(dr._deprecationWarning("contentUriEmpty","content.uri property is an empty string, which creates a circular dependency, making this tileset invalid. Omit the content property instead"),b=new o0(e,this),f=!0,y=Fo.READY):(y=Fo.UNLOADED,_=t.getDerivedResource({url:E}),S=Hc.getServerKey(_.getUrlComponent()))}else b=new o0(e,this),f=!0,y=Fo.READY;this._content=b,this._contentResource=_,this._contentState=y,this._expiredContent=void 0,this._serverKey=S,this.hasEmptyContent=f,this.hasTilesetContent=!1,this.hasImplicitContent=!1,this.hasRenderableContent=!f,this.hasImplicitContentMetadata=!1,this.hasMultipleContents=r,this.cacheNode=void 0;let Z=n.expire,R,C;l(Z)&&(R=Z.duration,l(Z.date)&&(C=Q.fromIso8601(Z.date))),this.expireDuration=R,this.expireDate=C,this.lastStyleTime=0,this._optimChildrenWithinParent=rh.NOT_COMPUTED,this.clippingPlanesDirty=!1,this.clippingPolygonsDirty=!1,this.clippingPolygonsNeedRebake=!1,this.priorityDeferred=!1,this.implicitTileset=void 0,this.implicitCoordinates=void 0,this.implicitSubtree=void 0,this._distanceToCamera=0,this._centerZDepth=0,this._screenSpaceError=0,this._screenSpaceErrorProgressiveResolution=0,this._visibilityPlaneMask=0,this._visible=!1,this._inRequestVolume=!1,this._finalResolution=!0,this._depth=0,this._stackLength=0,this._selectionDepth=0,this._updatedVisibilityFrame=0,this._touchedFrame=0,this._visitedFrame=0,this._selectedFrame=0,this._wasSelectedLastFrame=!1,this._requestedFrame=0,this._ancestorWithContent=void 0,this._ancestorWithContentAvailable=void 0,this._refines=!1,this._shouldSelect=!1,this._isClipped=!0,this._isClippedByPolygon=!1,this._clippingPlanesState=0,this._clippingPolygonsState=0,this._debugBoundingVolume=void 0,this._debugContentBoundingVolume=void 0,this._debugViewerRequestVolume=void 0,this._debugColor=U.fromRandom({alpha:1}),this._debugColorizeTiles=!1,this._priority=0,this._priorityHolder=this,this._priorityProgressiveResolution=!1,this._priorityProgressiveResolutionScreenSpaceErrorLeaf=!1,this._priorityReverseScreenSpaceError=0,this._foveatedFactor=0,this._wasMinPriorityChild=!1,this._loadTimestamp=new Q,this._commandsLength=0,this._color=void 0,this._colorDirty=!1,this._request=void 0}dr._deprecationWarning=Jo;Object.defineProperties(dr.prototype,{tileset:{get:function(){return this._tileset}},content:{get:function(){return this._content}},boundingVolume:{get:function(){return this._boundingVolume}},contentBoundingVolume:{get:function(){return this._contentBoundingVolume??this._boundingVolume}},boundingSphere:{get:function(){return this._boundingVolume.boundingSphere}},isVisible:{get:function(){return this._visible&&this._inRequestVolume}},extras:{get:function(){return this._header.extras}},color:{get:function(){return l(this._color)||(this._color=new U),U.clone(this._color)},set:function(e){this._color=U.clone(e,this._color),this._colorDirty=!0}},contentAvailable:{get:function(){return this.contentReady&&this.hasRenderableContent||l(this._expiredContent)&&!this.contentFailed}},contentReady:{get:function(){return this._contentState===Fo.READY}},contentUnloaded:{get:function(){return this._contentState===Fo.UNLOADED}},hasUnloadedRenderableContent:{get:function(){return this.hasRenderableContent&&this.contentUnloaded}},contentExpired:{get:function(){return this._contentState===Fo.EXPIRED}},contentFailed:{get:function(){return this._contentState===Fo.FAILED}},commandsLength:{get:function(){return this._commandsLength}}});var Ux=new h;function dgt(e,t){let{tileset:n,boundingSphere:i}=e,{radius:o,center:r}=i,{camera:s}=t,a=h.multiplyByScalar(s.directionWC,e._centerZDepth,Ux),c=h.add(s.positionWC,a,Ux),d=h.subtract(c,r,Ux);if(h.magnitude(d)>o){let C=h.normalize(d,Ux),E=h.multiplyByScalar(C,o,Ux),A=h.add(r,E,Ux),L=h.subtract(A,s.positionWC,Ux),F=h.normalize(L,Ux);e._foveatedFactor=1-Math.abs(h.dot(s.directionWC,F))}else e._foveatedFactor=0;let p=e.refine===Tr.REPLACE,b=n.isSkippingLevelOfDetail;if(p&&!b||!n.foveatedScreenSpaceError||n.foveatedConeSize===1||e._priorityProgressiveResolution&&p&&b||n._pass===lr.PRELOAD_FLIGHT||n._pass===lr.PRELOAD)return!1;let f=1-Math.cos(s.frustum.fov*.5),y=n.foveatedConeSize*f;if(e._foveatedFactor<=y)return!1;let _=f-y,S=W.clamp((e._foveatedFactor-y)/_,0,1),Z=n.foveatedInterpolationCallback(n.foveatedMinimumScreenSpaceErrorRelaxation,n.memoryAdjustedScreenSpaceError,S),R=e._screenSpaceError===0&&l(e.parent)?e.parent._screenSpaceError*.5:e._screenSpaceError;return n.memoryAdjustedScreenSpaceError-Z<=R}var V1e=new Q;dr.prototype.getScreenSpaceError=function(e,t,n){let i=this._tileset,o=n??1,r=l(this.parent)?this.parent.geometricError:i._scaledGeometricError,s=t?r:this.geometricError;if(s===0)return 0;let{camera:a,context:c}=e,d=a.frustum,u=c.drawingBufferWidth,m=c.drawingBufferHeight*o,p;if(e.mode===se.SCENE2D||d instanceof yn){let b=d.offCenterFrustum;l(b)&&(d=b);let f=Math.max(d.top-d.bottom,d.right-d.left)/Math.max(u,m);p=s/f}else{let b=Math.max(this._distanceToCamera,W.EPSILON7),f=d.sseDenominator;if(p=s*m/(b*f),i.dynamicScreenSpaceError){let y=i._dynamicScreenSpaceErrorComputedDensity,_=i.dynamicScreenSpaceErrorFactor,S=W.fog(b,y)*_;p-=S}}return p/=e.pixelRatio,p};function ugt(e,t){if(e.progressiveResolutionHeightFraction<=0||e.progressiveResolutionHeightFraction>.5)return!1;let n=e.memoryAdjustedScreenSpaceError,i=t._screenSpaceErrorProgressiveResolution>n;t._priorityProgressiveResolutionScreenSpaceErrorLeaf=!1;let o=t.parent,r=t._screenSpaceErrorProgressiveResolution<=n,s=l(o)&&o._screenSpaceErrorProgressiveResolution>n;return r&&s&&(t._priorityProgressiveResolutionScreenSpaceErrorLeaf=!0,i=!0),i}function mgt(e,t){let n=t.parent,o=l(n)&&(!e.isSkippingLevelOfDetail||t._screenSpaceError===0||n.hasTilesetContent||n.hasImplicitContent)?n._screenSpaceError:t._screenSpaceError;return e.root._screenSpaceError-o}dr.prototype.updateVisibility=function(e){let{parent:t,tileset:n}=this;if(this._updatedVisibilityFrame===n._updatedVisibilityFrame)return;let i=l(t)?t.computedTransform:n.modelMatrix,o=l(t)?t._visibilityPlaneMask:$s.MASK_INDETERMINATE;this.updateTransform(i,e),this._distanceToCamera=this.distanceToTile(e),this._centerZDepth=this.distanceToTileCenter(e),this._screenSpaceError=this.getScreenSpaceError(e,!1),this._screenSpaceErrorProgressiveResolution=this.getScreenSpaceError(e,!1,n.progressiveResolutionHeightFraction),this._visibilityPlaneMask=this.visibility(e,o),this._visible=this._visibilityPlaneMask!==$s.MASK_OUTSIDE,this._inRequestVolume=this.insideViewerRequestVolume(e),this._priorityReverseScreenSpaceError=mgt(n,this),this._priorityProgressiveResolution=ugt(n,this),this.priorityDeferred=dgt(this,e),this._updatedVisibilityFrame=n._updatedVisibilityFrame};dr.prototype.updateExpiration=function(){if(l(this.expireDate)&&this.contentReady&&!this.hasEmptyContent&&!this.hasMultipleContents){let e=Q.now(V1e);Q.lessThan(this.expireDate,e)&&(this._contentState=Fo.EXPIRED,this._expiredContent=this._content)}};function hgt(e){if(!l(e.expireDuration))return;let t=Q.now(V1e);Q.addSeconds(t,e.expireDuration,t),l(e.expireDate)?Q.lessThan(e.expireDate,t)&&Q.clone(t,e.expireDate):e.expireDate=Q.clone(t)}function fgt(e){return function(){return e._priority}}dr.prototype.requestContent=function(){if(!this.hasEmptyContent)return this.hasMultipleContents?pgt(this):ggt(this)};function pgt(e){let t=e._content,n=e._tileset;if(!l(t)){let o=ro(e._header,"3DTILES_multiple_contents")?e._header.extensions["3DTILES_multiple_contents"]:e._header;t=new NY(n,e,e._contentResource.clone(),o),e._content=t}let i=t.requestInnerContents();if(l(i))return e._contentState=Fo.LOADING,i.then(o=>{if(!e.isDestroyed()&&l(o))return e._contentState=Fo.PROCESSING,t}).catch(o=>{if(!e.isDestroyed())throw e._contentState=Fo.FAILED,o})}async function bgt(e,t,n,i,o){let r=e._contentState;e._contentState=Fo.LOADING,++t.statistics.numberOfPendingRequests;let s;try{s=await o}catch(a){if(--t.statistics.numberOfPendingRequests,e.isDestroyed())return;if(n.cancelled||n.state===Ri.CANCELLED){e._contentState=r,++t.statistics.numberOfAttemptedRequests;return}if(E1e(e,a))return i&&(e.expireDate=void 0),e._content=new o0(t,e),_1e(e),e._contentState=Fo.PROCESSING,e._content;throw e._contentState=Fo.FAILED,a}if(e.isDestroyed()){--t.statistics.numberOfPendingRequests;return}if(n.cancelled||n.state===Ri.CANCELLED){e._contentState=r,--t.statistics.numberOfPendingRequests,++t.statistics.numberOfAttemptedRequests;return}try{let a=await ygt(e,s);return--t.statistics.numberOfPendingRequests,e.isDestroyed()?void 0:(i&&(e.expireDate=void 0),e._content=a,a instanceof o0&&_1e(e),e._contentState=Fo.PROCESSING,a)}catch(a){if(--t.statistics.numberOfPendingRequests,e.isDestroyed())return;throw e._contentState=Fo.FAILED,a}}function ggt(e){let t=e._contentResource.clone(),n=e.contentExpired;n&&t.setQueryParameters({expired:e.expireDate.toString()});let i=new Ar({throttle:!0,throttleByServer:!0,type:js.TILES3D,priorityFunction:fgt(e),serverKey:e._serverKey});e._request=i,t.request=i;let o=e._tileset,r=t.fetchArrayBuffer();if(!l(r)){++o.statistics.numberOfAttemptedRequests;return}return bgt(e,o,i,n,r)}function E1e(e,t){let i=e._tileset?._runtimeContentCodec?.missingTilePolicy;return!l(i)||!l(t.statusCode)?!1:i.statusCodes.includes(t.statusCode)}function _1e(e){e.hasEmptyContent=!0,e.hasRenderableContent=!1}dr._isEmptyTile=E1e;async function ygt(e,t){let n=e._tileset,i=n?._runtimeContentCodec;if(l(i)&&typeof i.createContent=="function"){let d=await Promise.resolve(i.createContent(n,e,e._contentResource,t));return e.isDestroyed()?void 0:d}let o=_g(t);n._disableSkipLevelOfDetail=n._disableSkipLevelOfDetail||o.contentType===Va.GEOMETRY||o.contentType===Va.VECTOR,(o.contentType===Va.IMPLICIT_SUBTREE||o.contentType===Va.IMPLICIT_SUBTREE_JSON)&&(e.hasImplicitContent=!0,e.hasRenderableContent=!1),o.contentType===Va.EXTERNAL_TILESET&&(e.hasTilesetContent=!0,e.hasRenderableContent=!1);let r,s=nZ[o.contentType];if(e.isDestroyed())return;l(o.binaryPayload)?r=await Promise.resolve(s(n,e,e._contentResource,o.binaryPayload.buffer,0)):r=await Promise.resolve(s(n,e,e._contentResource,o.jsonPayload));let a=e._contentHeader;if(e.hasImplicitContentMetadata){let d=e.implicitSubtree,u=e.implicitCoordinates;r.metadata=d.getContentMetadataView(u,0)}else e.hasImplicitContent||(r.metadata=iZ(n,a));let c=oZ(n,a);return l(c)&&(r.group=new DS({metadata:c})),r}dr.prototype.cancelRequests=function(){this.hasMultipleContents?this._content.cancelRequests():this._request.cancel()};dr.prototype.unloadTilesetContent=function(){this.hasTilesetContent&&(this._content=this._content&&this._content.destroy(),this._contentState=Fo.UNLOADED,this._expiredContent=void 0,this.expireDate=void 0,this.hasTilesetContent=!1,this.hasRenderableContent=!0,this._selectedFrame=0,this.lastStyleTime=0)};dr.prototype.unloadContent=function(){this.hasRenderableContent&&(this._content=this._content&&this._content.destroy(),this._contentState=Fo.UNLOADED,this.lastStyleTime=0,this.clippingPlanesDirty=this._clippingPlanesState===0,this._clippingPlanesState=0,this.clippingPolygonsDirty=this._clippingPolygonsState===0,this._clippingPolygonsState=0,this.clippingPolygonsNeedRebake=!1,this._debugColorizeTiles=!1,this._debugBoundingVolume=this._debugBoundingVolume&&this._debugBoundingVolume.destroy(),this._debugContentBoundingVolume=this._debugContentBoundingVolume&&this._debugContentBoundingVolume.destroy(),this._debugViewerRequestVolume=this._debugViewerRequestVolume&&this._debugViewerRequestVolume.destroy())};var A1e=new me;function Tee(e,t){if(t.mode!==se.SCENE3D&&!l(e._boundingVolume2D)){let n=e._boundingVolume.boundingSphere,i=me.projectTo2D(n,t.mapProjection,A1e);e._boundingVolume2D=new Zg(i.center,i.radius)}return t.mode!==se.SCENE3D?e._boundingVolume2D:e._boundingVolume}function xgt(e,t){if(t.mode!==se.SCENE3D&&!l(e._contentBoundingVolume2D)){let n=e._contentBoundingVolume.boundingSphere,i=me.projectTo2D(n,t.mapProjection,A1e);e._contentBoundingVolume2D=new Zg(i.center,i.radius)}return t.mode!==se.SCENE3D?e._contentBoundingVolume2D:e._contentBoundingVolume}dr.prototype.visibility=function(e,t){let n=e.cullingVolume,i=Tee(this,e),o=this._tileset,r=o.clippingPlanes;if(l(r)&&r.enabled){let a=r.computeIntersectionWithBoundingVolume(i,o.clippingPlanesOriginMatrix);if(this._isClipped=a!==qt.INSIDE,a===qt.OUTSIDE)return $s.MASK_OUTSIDE}let s=o.clippingPolygons;if(l(s)&&s.enabled){let a=s.computeIntersectionWithBoundingVolume(i);this._isClippedByPolygon=a!==qt.OUTSIDE}return n.computeVisibilityWithPlaneMask(i,t)};dr.prototype.contentVisibility=function(e){if(!l(this._contentBoundingVolume))return qt.INSIDE;if(this._visibilityPlaneMask===$s.MASK_INSIDE)return qt.INSIDE;let t=e.cullingVolume,n=xgt(this,e),i=this._tileset,o=i.clippingPlanes;if(l(o)&&o.enabled){let s=o.computeIntersectionWithBoundingVolume(n,i.clippingPlanesOriginMatrix);if(this._isClipped=s!==qt.INSIDE,s===qt.OUTSIDE)return qt.OUTSIDE}let r=i.clippingPolygons;if(l(r)&&r.enabled){let s=r.computeIntersectionWithBoundingVolume(n);if(this._isClippedByPolygon=s!==qt.OUTSIDE,s===qt.INSIDE)return qt.OUTSIDE}return t.computeVisibility(n)};dr.prototype.distanceToTile=function(e){return Tee(this,e).distanceToCamera(e)};var Tgt=new h;dr.prototype.distanceToTileCenter=function(e){let n=Tee(this,e).boundingVolume,i=h.subtract(n.center,e.camera.positionWC,Tgt);return h.dot(e.camera.directionWC,i)};dr.prototype.insideViewerRequestVolume=function(e){let t=this._viewerRequestVolume;return!l(t)||t.distanceToCamera(e)===0};var G1e=new q,L1e=new h,_gt=new q,_ee=new h,W1e=new re,v1e=new nn,xee=new P;function Sgt(e,t,n){let i=h.fromElements(e[0],e[1],e[2],_ee),o=q.fromArray(e,3,_gt);i=P.multiplyByPoint(t,i,i);let r=P.getMatrix3(t,G1e);return o=q.multiply(r,o,o),l(n)?(n.update(i,o),n):new Qd(i,o)}function S1e(e,t,n,i){let o=re.unpack(e,0,W1e),r=e[4],s=e[5],a=nn.fromRectangle(o,r,s,ne.WGS84,v1e),c=a.center,d=a.halfAxes;t=P.multiplyTransformation(t,P.inverseTransformation(n,xee),xee),c=P.multiplyByPoint(t,c,c);let u=P.getMatrix3(t,G1e);return d=q.multiply(u,d,d),l(i)&&i instanceof Qd?(i.update(c,d),i):new Qd(c,d)}function Zgt(e,t,n,i){if(!P.equalsEpsilon(t,n,W.EPSILON8))return i instanceof Qd?S1e(e,t,n,i):S1e(e,t,n,void 0);let o=re.unpack(e,0,W1e);return i instanceof Ju?(i.rectangle=re.clone(o,i.rectangle),i.minimumHeight=e[4],i.maximumHeight=e[5],i.computeBoundingVolumes(ne.WGS84),i):new Ju({rectangle:o,minimumHeight:e[4],maximumHeight:e[5]})}function Rgt(e,t,n){let i=h.fromElements(e[0],e[1],e[2],_ee),o=e[3];i=P.multiplyByPoint(t,i,i);let r=P.getScale(t,L1e),s=h.maximumComponent(r);return o*=s,l(n)?(n.update(i,o),n):new Zg(i,o)}dr.prototype.createBoundingVolume=function(e,t,n){let i=this.metadata,o;if(l(i)&&(o=Px.parseBoundingVolumeSemantic("TILE",i)),l(o)&&(e=o),!l(e))throw new ae("boundingVolume must be defined");if(ro(e,"3DTILES_bounding_volume_S2"))return new MY(e.extensions["3DTILES_bounding_volume_S2"]);let{box:r,region:s,sphere:a}=e;if(l(r)){let c=Sgt(r,t,n);return this._verticalExaggeration!==1&&Z1e(c,this._verticalExaggeration,this._verticalExaggerationRelativeHeight),c}if(l(s)){let c=Zgt(s,t,this._initialTransform,n);return this._verticalExaggeration===1||(c instanceof Qd?Z1e(c,this._verticalExaggeration,this._verticalExaggerationRelativeHeight):(c.minimumHeight=_o.getHeight(c.minimumHeight,this._verticalExaggeration,this._verticalExaggerationRelativeHeight),c.maximumHeight=_o.getHeight(c.maximumHeight,this._verticalExaggeration,this._verticalExaggerationRelativeHeight),c.computeBoundingVolumes(ne.WGS84))),c}if(l(a)){let c=Rgt(a,t,n);if(this._verticalExaggeration!==1){let d=_o.getPosition(c.center,ne.WGS84,this._verticalExaggeration,this._verticalExaggerationRelativeHeight,_ee),u=c.radius*this._verticalExaggeration;c.update(d,u)}return c}throw new ae("boundingVolume must contain a sphere, region, or box")};var Cgt=h.unpackArray(new Array(24).fill(0));function Z1e(e,t,n){let i=e.boundingVolume.computeCorners(Cgt).map(r=>_o.getPosition(r,ne.WGS84,t,n,r)),o=nn.fromPoints(i,v1e);e.update(o.center,o.halfAxes)}dr.prototype.updateTransform=function(e,t){e=e??P.IDENTITY;let n=P.multiplyTransformation(e,this.transform,xee),i=!P.equals(n,this.computedTransform),o=l(t)&&(this._verticalExaggeration!==t.verticalExaggeration||this._verticalExaggerationRelativeHeight!==t.verticalExaggerationRelativeHeight);if(!i&&!o)return;i&&P.clone(n,this.computedTransform),o&&(this._verticalExaggeration=t.verticalExaggeration,this._verticalExaggerationRelativeHeight=t.verticalExaggerationRelativeHeight);let r=this._header,s=this._contentHeader;this._boundingVolume=this.createBoundingVolume(r.boundingVolume,this.computedTransform,this._boundingVolume),l(this._contentBoundingVolume)&&(this._contentBoundingVolume=this.createBoundingVolume(s.boundingVolume,this.computedTransform,this._contentBoundingVolume)),l(this._viewerRequestVolume)&&(this._viewerRequestVolume=this.createBoundingVolume(r.viewerRequestVolume,this.computedTransform,this._viewerRequestVolume)),this.updateGeometricErrorScale(),this._debugBoundingVolume=this._debugBoundingVolume&&this._debugBoundingVolume.destroy(),this._debugContentBoundingVolume=this._debugContentBoundingVolume&&this._debugContentBoundingVolume.destroy(),this._debugViewerRequestVolume=this._debugViewerRequestVolume&&this._debugViewerRequestVolume.destroy()};dr.prototype.updateGeometricErrorScale=function(){let e=P.getScale(this.computedTransform,L1e),t=h.maximumComponent(e);if(this.geometricError=this._geometricError*t,!l(this.parent)){let n=this._tileset;n._scaledGeometricError=n._geometricError*t}};function Vgt(e,t,n,i){if(!i.isRender)return;let o=l(e._contentHeader)&&l(e._contentHeader.boundingVolume),r=t.debugShowBoundingVolume||t.debugShowContentBoundingVolume&&!o;if(r){let c;e._finalResolution?e.hasRenderableContent?c=U.WHITE:c=U.DARKGRAY:c=U.YELLOW,l(e._debugBoundingVolume)||(e._debugBoundingVolume=e._boundingVolume.createDebugVolume(c)),e._debugBoundingVolume.update(n);let d=e._debugBoundingVolume.getGeometryInstanceAttributes("outline");d.color=$t.toValue(c,d.color)}else!r&&l(e._debugBoundingVolume)&&(e._debugBoundingVolume=e._debugBoundingVolume.destroy());t.debugShowContentBoundingVolume&&o?(l(e._debugContentBoundingVolume)||(e._debugContentBoundingVolume=e._contentBoundingVolume.createDebugVolume(U.BLUE)),e._debugContentBoundingVolume.update(n)):!t.debugShowContentBoundingVolume&&l(e._debugContentBoundingVolume)&&(e._debugContentBoundingVolume=e._debugContentBoundingVolume.destroy()),t.debugShowViewerRequestVolume&&l(e._viewerRequestVolume)?(l(e._debugViewerRequestVolume)||(e._debugViewerRequestVolume=e._viewerRequestVolume.createDebugVolume(U.YELLOW)),e._debugViewerRequestVolume.update(n)):!t.debugShowViewerRequestVolume&&l(e._debugViewerRequestVolume)&&(e._debugViewerRequestVolume=e._debugViewerRequestVolume.destroy());let s=t.debugColorizeTiles&&!e._debugColorizeTiles||l(t._heatmap.tilePropertyName),a=!t.debugColorizeTiles&&e._debugColorizeTiles;s?(t._heatmap.colorize(e,n),e._debugColorizeTiles=!0,e.color=e._debugColor):a&&(e._debugColorizeTiles=!1,e.color=U.WHITE),e._colorDirty&&(e._colorDirty=!1,e._content.applyDebugSettings(!0,e._color)),a&&t.makeStyleDirty()}function Egt(e,t,n){let i=e._expiredContent;if(!e.hasMultipleContents&&l(i)){if(!e.contentReady){try{i.update(t,n)}catch{}return}e._expiredContent.destroy(),e._expiredContent=void 0}if(l(e.content))try{e.content.update(t,n)}catch(o){throw e._contentState=Fo.FAILED,o}}function Agt(e,t){let n=t.clippingPlanes,i=0;l(n)&&e._isClipped&&n.enabled&&(i=n.clippingPlanesState),i!==e._clippingPlanesState&&(e._clippingPlanesState=i,e.clippingPlanesDirty=!0)}function Ggt(e,t){let n=t.clippingPolygons,i=0;l(n)&&e._isClippedByPolygon&&n.enabled&&(i=n.clippingPolygonsState),i!==e._clippingPolygonsState&&(e._clippingPolygonsState=i,e.clippingPolygonsDirty=!0)}dr.prototype.update=function(e,t,n){let{commandList:i}=t,o=i.length;Agt(this,e),Ggt(this,e),Vgt(this,e,t,n),Egt(this,e,t);let r=i.length;this._commandsLength=r-o;for(let s=o;s<r;++s){let a=i[s],c=a.pass===Le.TRANSLUCENT;a.depthForTranslucentClassification=c}this.clippingPlanesDirty=!1,this.clippingPolygonsDirty=!1,this.clippingPolygonsNeedRebake=!1};var R1e=[];dr.prototype.process=function(e,t){!this.contentExpired&&!this.contentReady&&this._content.ready&&(hgt(this),this._selectedFrame=0,this.lastStyleTime=0,Q.now(this._loadTimestamp),this._contentState=Fo.READY,!this.hasTilesetContent&&!this.hasImplicitContent&&(e._statistics.incrementLoadCounts(this.content),++e._statistics.numberOfTilesWithContentReady,++e._statistics.numberOfLoadedTilesTotal,e._cache.add(this)));let n=t.commandList;t.commandList=R1e;try{this._content.update(e,t)}catch(i){throw this._contentState=Fo.FAILED,i}R1e.length=0,t.commandList=n};function C1e(e,t,n){let i=e*Math.pow(10,t);return parseInt(i)*Math.pow(10,n)}function S3(e,t,n){return Math.max(W.normalize(e,t,n)-W.EPSILON7,0)}dr.prototype.updatePriority=function(){let e=this.tileset,t=e.preferLeaves,n=e._minimumPriority,i=e._maximumPriority,o=4,r=1,s=0,a=o,c=s+a,d=o,u=c+d,m=r,p=Math.pow(10,u),b=u+m,f=r,y=Math.pow(10,b),_=b+f,S=Math.pow(10,_),Z=S3(this._depth,n.depth,i.depth);Z=t?1-Z:Z;let C=!e.isSkippingLevelOfDetail&&this.refine===Tr.REPLACE?S3(this._priorityHolder._distanceToCamera,n.distance,i.distance):S3(this._priorityReverseScreenSpaceError,n.reverseScreenSpaceError,i.reverseScreenSpaceError),E=C1e(C,a,s),A=this._priorityProgressiveResolution?0:p,L=S3(this._priorityHolder._foveatedFactor,n.foveatedFactor,i.foveatedFactor),F=C1e(L,d,c),I=this.priorityDeferred?y:0,N=e._pass===lr.PRELOAD_FLIGHT?0:S;this._priority=Z+E+A+F+I+N};dr.prototype.isDestroyed=function(){return!1};dr.prototype.destroy=function(){return this._content=this._content&&this._content.destroy(),this._expiredContent=this._expiredContent&&!this._expiredContent.isDestroyed()&&this._expiredContent.destroy(),this._debugBoundingVolume=this._debugBoundingVolume&&this._debugBoundingVolume.destroy(),this._debugContentBoundingVolume=this._debugContentBoundingVolume&&this._debugContentBoundingVolume.destroy(),this._debugViewerRequestVolume=this._debugViewerRequestVolume&&this._debugViewerRequestVolume.destroy(),ue(this)};var ah=dr;var SMi=x(T(),1);var uMi=x(T(),1);function Rg(e){e=e??B.EMPTY_OBJECT;let t=e.id,n=e.group,i=e.class,o=l(n.properties)?n.properties:{};this._class=i,this._properties=o,this._id=t,this._extras=n.extras,this._extensions=n.extensions}Object.defineProperties(Rg.prototype,{class:{get:function(){return this._class}},id:{get:function(){return this._id}},extras:{get:function(){return this._extras}},extensions:{get:function(){return this._extensions}}});Rg.prototype.hasProperty=function(e){return Jn.hasProperty(e,this._properties,this._class)};Rg.prototype.hasPropertyBySemantic=function(e){return Jn.hasPropertyBySemantic(e,this._properties,this._class)};Rg.prototype.getPropertyIds=function(e){return Jn.getPropertyIds(this._properties,this._class,e)};Rg.prototype.getProperty=function(e){return Jn.getProperty(e,this._properties,this._class)};Rg.prototype.setProperty=function(e,t){return Jn.setProperty(e,t,this._properties,this._class)};Rg.prototype.getPropertyBySemantic=function(e){return Jn.getPropertyBySemantic(e,this._properties,this._class)};Rg.prototype.setPropertyBySemantic=function(e,t){return Jn.setPropertyBySemantic(e,t,this._properties,this._class)};var DV=Rg;var bMi=x(T(),1);function Cg(e){e=e??B.EMPTY_OBJECT;let t=e.tileset,n=e.class,i=l(t.properties)?t.properties:{};this._class=n,this._properties=i,this._extras=t.extras,this._extensions=t.extensions}Object.defineProperties(Cg.prototype,{class:{get:function(){return this._class}},extras:{get:function(){return this._extras}},extensions:{get:function(){return this._extensions}}});Cg.prototype.hasProperty=function(e){return Jn.hasProperty(e,this._properties,this._class)};Cg.prototype.hasPropertyBySemantic=function(e){return Jn.hasPropertyBySemantic(e,this._properties,this._class)};Cg.prototype.getPropertyIds=function(e){return Jn.getPropertyIds(this._properties,this._class,e)};Cg.prototype.getProperty=function(e){return Jn.getProperty(e,this._properties,this._class)};Cg.prototype.setProperty=function(e,t){return Jn.setProperty(e,t,this._properties,this._class)};Cg.prototype.getPropertyBySemantic=function(e){return Jn.getPropertyBySemantic(e,this._properties,this._class)};Cg.prototype.setPropertyBySemantic=function(e,t){return Jn.setPropertyBySemantic(e,t,this._properties,this._class)};var wY=Cg;function F1e(e){e=e??B.EMPTY_OBJECT;let t=e.metadataJson,n=e.schema,i=t.metadata??t.tileset,o;l(i)&&(o=new wY({tileset:i,class:n.classes[i.class]}));let r=[],s=[],a=t.groups;if(Array.isArray(a)){let c=a.length;for(let d=0;d<c;d++){let u=a[d];s.push(new DV({group:u,class:n.classes[u.class]}))}}else if(l(a)){r=Object.keys(a).sort();let c=r.length;for(let d=0;d<c;d++){let u=r[d];if(a.hasOwnProperty(u)){let m=a[u];s.push(new DV({id:u,group:a[u],class:n.classes[m.class]}))}}}this._schema=n,this._groups=s,this._groupIds=r,this._tileset=o,this._statistics=t.statistics,this._extras=t.extras,this._extensions=t.extensions}Object.defineProperties(F1e.prototype,{schema:{get:function(){return this._schema}},groups:{get:function(){return this._groups}},groupIds:{get:function(){return this._groupIds}},tileset:{get:function(){return this._tileset}},statistics:{get:function(){return this._statistics}},extras:{get:function(){return this._extras}},extensions:{get:function(){return this._extensions}}});var dZ=F1e;var AMi=x(T(),1);var I1e={},Lgt=new h;I1e.checkChildrenWithinParent=function(e){let t=e.children,n=t.length,i=e.boundingVolume;if(i instanceof Qd||i instanceof Ju){let o=i._orientedBoundingBox;e._optimChildrenWithinParent=rh.USE_OPTIMIZATION;for(let r=0;r<n;++r){let a=t[r].boundingVolume;if(!(a instanceof Qd||a instanceof Ju)){e._optimChildrenWithinParent=rh.SKIP_OPTIMIZATION;break}let c=a._orientedBoundingBox,d=h.subtract(c.center,o.center,Lgt),u=h.magnitude(d);h.divideByScalar(d,u,d);let m=Math.abs(o.halfAxes[0]*d.x)+Math.abs(o.halfAxes[1]*d.y)+Math.abs(o.halfAxes[2]*d.z)+Math.abs(o.halfAxes[3]*d.x)+Math.abs(o.halfAxes[4]*d.y)+Math.abs(o.halfAxes[5]*d.z)+Math.abs(o.halfAxes[6]*d.x)+Math.abs(o.halfAxes[7]*d.y)+Math.abs(o.halfAxes[8]*d.z),p=Math.abs(c.halfAxes[0]*d.x)+Math.abs(c.halfAxes[1]*d.y)+Math.abs(c.halfAxes[2]*d.z)+Math.abs(c.halfAxes[3]*d.x)+Math.abs(c.halfAxes[4]*d.y)+Math.abs(c.halfAxes[5]*d.z)+Math.abs(c.halfAxes[6]*d.x)+Math.abs(c.halfAxes[7]*d.y)+Math.abs(c.halfAxes[8]*d.z);if(m<=p+u){e._optimChildrenWithinParent=rh.SKIP_OPTIMIZATION;break}}}return e._optimChildrenWithinParent===rh.USE_OPTIMIZATION};var kY=I1e;var PMi=x(T(),1);var WMi=x(T(),1);function UY(){this.head=void 0,this.tail=void 0,this._length=0}Object.defineProperties(UY.prototype,{length:{get:function(){return this._length}}});function Wgt(e,t,n){this.item=e,this.previous=t,this.next=n}UY.prototype.add=function(e){let t=new Wgt(e,this.tail,void 0);return l(this.tail)?(this.tail.next=t,this.tail=t):(this.head=t,this.tail=t),++this._length,t};function P1e(e,t){l(t.previous)&&l(t.next)?(t.previous.next=t.next,t.next.previous=t.previous):l(t.previous)?(t.previous.next=void 0,e.tail=t.previous):l(t.next)?(t.next.previous=void 0,e.head=t.next):(e.head=void 0,e.tail=void 0),t.next=void 0,t.previous=void 0}UY.prototype.remove=function(e){l(e)&&(P1e(this,e),--this._length)};UY.prototype.splice=function(e,t){if(e===t)return;P1e(this,t);let n=e.next;e.next=t,this.tail===e?this.tail=t:n.previous=t,t.next=n,t.previous=e};var DY=UY;function Dx(){this._list=new DY,this._sentinel=this._list.add(),this._trimTiles=!1}Dx.prototype.reset=function(){this._list.splice(this._list.tail,this._sentinel)};Dx.prototype.touch=function(e){let t=e.cacheNode;l(t)&&this._list.splice(this._sentinel,t)};Dx.prototype.add=function(e){l(e.cacheNode)||(e.cacheNode=this._list.add(e))};Dx.prototype.forEachLoadedTile=function(e){for(let t=this._list.head;l(t);t=t.next)l(t.item)&&e(t.item)};Dx.prototype.unloadTile=function(e,t,n){let i=t.cacheNode;l(i)&&(this._list.remove(i),t.cacheNode=void 0,n(e,t))};Dx.prototype.unloadTiles=function(e,t){let n=this._trimTiles;this._trimTiles=!1;let i=this._list,o=this._sentinel,r=i.head;for(;r!==o&&(e.totalMemoryUsageInBytes>e.cacheBytes||n);){let s=r.item;r=r.next,this.unloadTile(e,s,t)}};Dx.prototype.trim=function(){this._trimTiles=!0};var OY=Dx;var kMi=x(T(),1);function Z3(e){this.tilePropertyName=e,this._minimum=Number.MAX_VALUE,this._maximum=-Number.MAX_VALUE,this._previousMinimum=Number.MAX_VALUE,this._previousMaximum=-Number.MAX_VALUE,this._referenceMinimum={},this._referenceMaximum={}}function Zee(e,t){let n;return t==="_loadTimestamp"?n=Q.toDate(e).getTime():n=e,n}Z3.prototype.setReferenceMinimumMaximum=function(e,t,n){this._referenceMinimum[n]=Zee(e,n),this._referenceMaximum[n]=Zee(t,n)};function vgt(e,t){let n=e.tilePropertyName;if(l(n)){let i=Zee(t[n],n);return l(i)?(e._maximum=Math.max(i,e._maximum),e._minimum=Math.min(i,e._minimum),i):(e.tilePropertyName=void 0,i)}}var See=[new U(.1,.1,.1,1),new U(.153,.278,.878,1),new U(.827,.231,.49,1),new U(.827,.188,.22,1),new U(1,.592,.259,1),new U(1,.843,0,1)];Z3.prototype.colorize=function(e,t){let n=this.tilePropertyName;if(!l(n)||!e.contentAvailable||e._selectedFrame!==t.frameNumber)return;let i=vgt(this,e),o=this._previousMinimum,r=this._previousMaximum;if(o===Number.MAX_VALUE||r===-Number.MAX_VALUE)return;let s=r-o+W.EPSILON7,c=W.clamp(i-o,0,s)/s,d=See.length-1,u=c*d,m=Math.floor(u),p=Math.ceil(u),b=u-m,f=See[m],y=See[p],_=U.clone(U.WHITE);_.red=W.lerp(f.red,y.red,b),_.green=W.lerp(f.green,y.green,b),_.blue=W.lerp(f.blue,y.blue,b),e._debugColor=_};Z3.prototype.resetMinimumMaximum=function(){let e=this.tilePropertyName;if(l(e)){let t=this._referenceMinimum[e],n=this._referenceMaximum[e],i=l(t)&&l(n);this._previousMinimum=i?t:this._minimum,this._previousMaximum=i?n:this._maximum,this._minimum=Number.MAX_VALUE,this._maximum=-Number.MAX_VALUE}};var BY=Z3;var BMi=x(T(),1);function OV(){this.selected=0,this.visited=0,this.numberOfCommands=0,this.numberOfAttemptedRequests=0,this.numberOfPendingRequests=0,this.numberOfTilesProcessing=0,this.numberOfTilesWithContentReady=0,this.numberOfTilesTotal=0,this.numberOfLoadedTilesTotal=0,this.numberOfFeaturesSelected=0,this.numberOfFeaturesLoaded=0,this.numberOfPointsSelected=0,this.numberOfPointsLoaded=0,this.numberOfTrianglesSelected=0,this.numberOfTilesStyled=0,this.numberOfFeaturesStyled=0,this.numberOfTilesCulledWithChildrenUnion=0,this.geometryByteLength=0,this.texturesByteLength=0,this.texturesReferenceCounterById={},this.batchTableByteLength=0}OV.prototype.clear=function(){this.selected=0,this.visited=0,this.numberOfCommands=0,this.numberOfAttemptedRequests=0,this.numberOfFeaturesSelected=0,this.numberOfPointsSelected=0,this.numberOfTrianglesSelected=0,this.numberOfTilesStyled=0,this.numberOfFeaturesStyled=0,this.numberOfTilesCulledWithChildrenUnion=0};OV.prototype.incrementSelectionCounts=function(e){this.numberOfFeaturesSelected+=e.featuresLength,this.numberOfPointsSelected+=e.pointsLength,this.numberOfTrianglesSelected+=e.trianglesLength;let t=e.innerContents;if(l(t)){let n=t.length;for(let i=0;i<n;++i)this.incrementSelectionCounts(t[i])}};OV.prototype.incrementLoadCounts=function(e){if(this.numberOfFeaturesLoaded+=e.featuresLength,this.numberOfPointsLoaded+=e.pointsLength,this.geometryByteLength+=e.geometryByteLength,this.batchTableByteLength+=e.batchTableByteLength,!(e instanceof Hu))this.texturesByteLength+=e.texturesByteLength;else{let n=e.getTextureIds();for(let i of n){let o=this.texturesReferenceCounterById[i]??0;if(o===0){let r=e.getTextureByteLengthById(i);this.texturesByteLength+=r}this.texturesReferenceCounterById[i]=o+1}}let t=e.innerContents;if(l(t)){let n=t.length;for(let i=0;i<n;++i)this.incrementLoadCounts(t[i])}};OV.prototype.decrementLoadCounts=function(e){if(this.numberOfFeaturesLoaded-=e.featuresLength,this.numberOfPointsLoaded-=e.pointsLength,this.geometryByteLength-=e.geometryByteLength,this.batchTableByteLength-=e.batchTableByteLength,!(e instanceof Hu))this.texturesByteLength-=e.texturesByteLength;else{let n=e.getTextureIds();for(let i of n){let o=this.texturesReferenceCounterById[i];if(o===1){delete this.texturesReferenceCounterById[i];let r=e.getTextureByteLengthById(i);this.texturesByteLength-=r}else this.texturesReferenceCounterById[i]=o-1}}let t=e.innerContents;if(l(t)){let n=t.length;for(let i=0;i<n;++i)this.decrementLoadCounts(t[i])}};OV.clone=function(e,t){t.selected=e.selected,t.visited=e.visited,t.numberOfCommands=e.numberOfCommands,t.numberOfAttemptedRequests=e.numberOfAttemptedRequests,t.numberOfPendingRequests=e.numberOfPendingRequests,t.numberOfTilesProcessing=e.numberOfTilesProcessing,t.numberOfTilesWithContentReady=e.numberOfTilesWithContentReady,t.numberOfTilesTotal=e.numberOfTilesTotal,t.numberOfFeaturesSelected=e.numberOfFeaturesSelected,t.numberOfFeaturesLoaded=e.numberOfFeaturesLoaded,t.numberOfPointsSelected=e.numberOfPointsSelected,t.numberOfPointsLoaded=e.numberOfPointsLoaded,t.numberOfTrianglesSelected=e.numberOfTrianglesSelected,t.numberOfTilesStyled=e.numberOfTilesStyled,t.numberOfFeaturesStyled=e.numberOfFeaturesStyled,t.numberOfTilesCulledWithChildrenUnion=e.numberOfTilesCulledWithChildrenUnion,t.geometryByteLength=e.geometryByteLength,t.texturesByteLength=e.texturesByteLength,t.batchTableByteLength=e.batchTableByteLength};var Xf=OV;var KMi=x(T(),1);function zY(){this._style=void 0,this._styleDirty=!1,this._lastStyleTime=0}Object.defineProperties(zY.prototype,{style:{get:function(){return this._style},set:function(e){e!==this._style&&(this._style=e,this._styleDirty=!0)}}});zY.prototype.makeDirty=function(){this._styleDirty=!0};zY.prototype.resetDirty=function(){this._styleDirty=!1};zY.prototype.applyStyle=function(e){if(!l(e.root)||l(this._style)&&!this._style._ready)return;let t=this._styleDirty;t&&++this._lastStyleTime;let n=this._lastStyleTime,i=e._statistics,o=t?e._selectedTiles:e._selectedTilesToStyle,r=o.length;for(let s=0;s<r;++s){let a=o[s];if(a.lastStyleTime!==n){let c=a.content;a.lastStyleTime=n,c.applyStyle(this._style),i.numberOfFeaturesStyled+=c.featuresLength,++i.numberOfTilesStyled}}};var HY=zY;var QMi=x(T(),1);function X1e(e,t,n){this.context=e,this.commandList=[],this.panoramaCommandList=[],this.shadowMaps=[],this.brdfLutGenerator=void 0,this.environmentMap=void 0,this.sphericalHarmonicCoefficients=void 0,this.specularEnvironmentMaps=void 0,this.specularEnvironmentMapsMaximumLOD=void 0,this.mode=se.SCENE3D,this.morphTime=se.getMorphTime(se.SCENE3D),this.frameNumber=0,this.newFrame=!1,this.time=void 0,this.jobScheduler=n,this.mapProjection=void 0,this.camera=void 0,this.cameraUnderground=!1,this.globeTranslucencyState=void 0,this.cullingVolume=void 0,this.occluder=void 0,this.maximumScreenSpaceError=void 0,this.pixelRatio=1,this.passes={render:!1,pick:!1,pickVoxel:!1,snap:!1,depth:!1,postProcess:!1,offscreen:!1},this.creditDisplay=t,this.afterRender=[],this.scene3DOnly=!1,this.fog={enabled:!1,renderable:!1,density:void 0,visualDensityScalar:void 0,sse:void 0,minimumBrightness:void 0},this.atmosphere=void 0,this.verticalExaggeration=1,this.verticalExaggerationRelativeHeight=0,this.shadowState={shadowsEnabled:!0,shadowMaps:[],lightShadowMaps:[],nearPlane:1,farPlane:5e3,closestObjectSize:1e3,lastDirtyTime:0,outOfView:!0},this.splitPosition=0,this.frustumSplits=[],this.backgroundColor=void 0,this.light=void 0,this.minimumDisableDepthTestDistance=void 0,this.invertClassification=!1,this.invertClassificationColor=void 0,this.useLogDepth=!1,this.tilesetPassState=void 0,this.minimumTerrainHeight=0,this.pickingMetadata=!1,this.pickedMetadataInfo=void 0,this.edgeVisibilityRequested=!1,this.planarFillRequested=!1}X1e.maximumFrameNumber=15e6;var Ox=X1e;var rwi=x(T(),1);function Fgt(e,t,n){let i=ro(t,"3DTILES_implicit_tiling")?t.extensions["3DTILES_implicit_tiling"]:t.implicitTiling;this.baseResource=e,this.geometricError=t.geometricError,this.metadataSchema=n;let o=t.boundingVolume;if(!l(o.box)&&!l(o.region)&&!ro(o,"3DTILES_bounding_volume_S2")&&!ro(o,"3DTILES_bounding_volume_cylinder"))throw new ae("Only box, region, 3DTILES_bounding_volume_S2, and 3DTILES_bounding_volume_cylinder are supported for implicit tiling");this.boundingVolume=o,this.refine=t.refine,this.subtreeUriTemplate=new ve({url:i.subtrees.uri}),this.contentUriTemplates=[],this.contentHeaders=[];let r=Igt(t);for(let s=0;s<r.length;s++){let a=r[s];this.contentHeaders.push($e(a,!0));let c=new ve({url:a.uri});this.contentUriTemplates.push(c)}this.contentCount=this.contentHeaders.length,this.tileHeader=Pgt(t),this.subdivisionScheme=Os[i.subdivisionScheme],this.branchingFactor=Os.getBranchingFactor(this.subdivisionScheme),this.subtreeLevels=i.subtreeLevels,l(i.availableLevels)?this.availableLevels=i.availableLevels:this.availableLevels=i.maximumLevel+1}function Igt(e){if(ro(e,"3DTILES_multiple_contents")){let t=e.extensions["3DTILES_multiple_contents"];return l(t.contents)?t.contents:t.content}return l(e.contents)?e.contents:l(e.content)?[e.content]:[]}function Pgt(e){let t=$e(e,!0);return l(t.extensions)&&(delete t.extensions["3DTILES_implicit_tiling"],delete t.extensions["3DTILES_multiple_contents"],Object.keys(t.extensions).length===0&&delete t.extensions),delete t.implicitTiling,delete t.contents,delete t.content,t}var s0=Fgt;var hwi=x(T(),1);var cwi=x(T(),1);var KY={};function N1e(e){return e=(e^e<<8)&16711935,e=(e^e<<4)&252645135,e=(e^e<<2)&858993459,e=(e^e<<1)&1431655765,e}function Ree(e){return e=(e^e<<16)&50331903,e=(e^e<<8)&50393103,e=(e^e<<4)&51130563,e=(e^e<<2)&153391689,e}function Y1e(e){return e&=1431655765,e=(e^e>>1)&858993459,e=(e^e>>2)&252645135,e=(e^e>>4)&16711935,e=(e^e>>8)&65535,e}function Cee(e){return e&=153391689,e=(e^e>>2)&51130563,e=(e^e>>4)&50393103,e=(e^e>>8)&4278190335,e=(e^e>>16)&1023,e}KY.encode2D=function(e,t){return(N1e(e)|N1e(t)<<1)>>>0};KY.decode2D=function(e,t){return l(t)||(t=new Array(2)),t[0]=Y1e(e),t[1]=Y1e(e>>1),t};KY.encode3D=function(e,t,n){return Ree(e)|Ree(t)<<1|Ree(n)<<2};KY.decode3D=function(e,t){return l(t)||(t=new Array(3)),t[0]=Cee(e),t[1]=Cee(e>>1),t[2]=Cee(e>>2),t};var Bx=KY;function Zr(e){this.subdivisionScheme=e.subdivisionScheme,this.subtreeLevels=e.subtreeLevels,this.level=e.level,this.x=e.x,this.y=e.y,this.z=void 0,e.subdivisionScheme===Os.OCTREE&&(this.z=e.z)}Object.defineProperties(Zr.prototype,{childIndex:{get:function(){let e=0;return e|=this.x&1,e|=(this.y&1)<<1,this.subdivisionScheme===Os.OCTREE&&(e|=(this.z&1)<<2),e}},mortonIndex:{get:function(){return this.subdivisionScheme===Os.OCTREE?Bx.encode3D(this.x,this.y,this.z):Bx.encode2D(this.x,this.y)}},tileIndex:{get:function(){let e=this.subdivisionScheme===Os.OCTREE?((1<<3*this.level)-1)/7:((1<<2*this.level)-1)/3,t=this.mortonIndex;return e+t}}});Zr.prototype.getDescendantCoordinates=function(e){let t=this.level+e.level,n=(this.x<<e.level)+e.x,i=(this.y<<e.level)+e.y;if(this.subdivisionScheme===Os.OCTREE){let o=(this.z<<e.level)+e.z;return new Zr({subdivisionScheme:this.subdivisionScheme,subtreeLevels:this.subtreeLevels,level:t,x:n,y:i,z:o})}return new Zr({subdivisionScheme:this.subdivisionScheme,subtreeLevels:this.subtreeLevels,level:t,x:n,y:i})};Zr.prototype.getAncestorCoordinates=function(e){let t=1<<e,n=this.level-e,i=Math.floor(this.x/t),o=Math.floor(this.y/t);if(this.subdivisionScheme===Os.OCTREE){let r=Math.floor(this.z/t);return new Zr({subdivisionScheme:this.subdivisionScheme,subtreeLevels:this.subtreeLevels,level:n,x:i,y:o,z:r})}return new Zr({subdivisionScheme:this.subdivisionScheme,subtreeLevels:this.subtreeLevels,level:n,x:i,y:o})};Zr.prototype.getOffsetCoordinates=function(e){let t=e.level-this.level,n=1<<t,i=e.x%n,o=e.y%n;if(this.subdivisionScheme===Os.OCTREE){let r=e.z%n;return new Zr({subdivisionScheme:this.subdivisionScheme,subtreeLevels:this.subtreeLevels,level:t,x:i,y:o,z:r})}return new Zr({subdivisionScheme:this.subdivisionScheme,subtreeLevels:this.subtreeLevels,level:t,x:i,y:o})};Zr.prototype.getChildCoordinates=function(e){let t=this.level+1,n=2*this.x+e%2,i=2*this.y+Math.floor(e/2)%2;if(this.subdivisionScheme===Os.OCTREE){let o=2*this.z+Math.floor(e/4)%2;return new Zr({subdivisionScheme:this.subdivisionScheme,subtreeLevels:this.subtreeLevels,level:t,x:n,y:i,z:o})}return new Zr({subdivisionScheme:this.subdivisionScheme,subtreeLevels:this.subtreeLevels,level:t,x:n,y:i})};Zr.prototype.getSubtreeCoordinates=function(){return this.getAncestorCoordinates(this.level%this.subtreeLevels)};Zr.prototype.getParentSubtreeCoordinates=function(){return this.getAncestorCoordinates(this.level%this.subtreeLevels+this.subtreeLevels)};Zr.prototype.isAncestor=function(e){let t=e.level-this.level;if(t<=0)return!1;let n=e.x>>t,i=e.y>>t,o=this.x===n,r=this.y===i;if(this.subdivisionScheme===Os.OCTREE){let s=e.z>>t,a=this.z===s;return o&&r&&a}return o&&r};Zr.prototype.isEqual=function(e){return this.subdivisionScheme===e.subdivisionScheme&&this.subtreeLevels===e.subtreeLevels&&this.level===e.level&&this.x===e.x&&this.y===e.y&&(this.subdivisionScheme===Os.OCTREE?this.z===e.z:!0)};Zr.prototype.isImplicitTilesetRoot=function(){return this.level===0};Zr.prototype.isSubtreeRoot=function(){return this.level%this.subtreeLevels===0};Zr.prototype.isBottomOfSubtree=function(){return this.level%this.subtreeLevels===this.subtreeLevels-1};Zr.prototype.getTemplateValues=function(){let e={level:this.level,x:this.x,y:this.y};return this.subdivisionScheme===Os.OCTREE&&(e.z=this.z),e};var M1e=[0,0,0];Zr.fromMortonIndex=function(e,t,n,i){let o;return e===Os.OCTREE?(o=Bx.decode3D(i,M1e),new Zr({subdivisionScheme:e,subtreeLevels:t,level:n,x:o[0],y:o[1],z:o[2]})):(o=Bx.decode2D(i,M1e),new Zr({subdivisionScheme:e,subtreeLevels:t,level:n,x:o[0],y:o[1]}))};Zr.fromTileIndex=function(e,t,n){let i,o,r;return e===Os.OCTREE?(i=Math.floor(W.log2(7*n+1)/3),o=((1<<3*i)-1)/7,r=n-o):(i=Math.floor(W.log2(3*n+1)/2),o=((1<<2*i)-1)/3,r=n-o),Zr.fromMortonIndex(e,t,i,r)};var a0=Zr;var Vwi=x(T(),1);var Twi=x(T(),1);function Vg(){}Vg.selectTiles=function(e,t){ge.throwInstantiationError()};Vg.sortChildrenByDistanceToCamera=function(e,t){return t._distanceToCamera===0&&e._distanceToCamera===0?t._centerZDepth-e._centerZDepth:t._distanceToCamera-e._distanceToCamera};Vg.canTraverse=function(e){return e.children.length===0?!1:e.hasTilesetContent||e.hasImplicitContent?!e.contentExpired:e._screenSpaceError>e.tileset.memoryAdjustedScreenSpaceError};Vg.selectTile=function(e,t){if(e.contentVisibility(t)===qt.OUTSIDE)return;e._wasSelectedLastFrame=!0;let{content:n,tileset:i}=e;n.featurePropertiesDirty?(n.featurePropertiesDirty=!1,e.lastStyleTime=0,i._selectedTilesToStyle.push(e)):e._selectedFrame<t.frameNumber-1&&(i._selectedTilesToStyle.push(e),e._wasSelectedLastFrame=!1),e._selectedFrame=t.frameNumber,i._selectedTiles.push(e)};Vg.visitTile=function(e,t){++e.tileset._statistics.visited,e._visitedFrame=t.frameNumber};Vg.touchTile=function(e,t){e._touchedFrame!==t.frameNumber&&(e.tileset._cache.touch(e),e._touchedFrame=t.frameNumber)};Vg.loadTile=function(e,t){let{tileset:n}=e;if(e._requestedFrame===t.frameNumber||!e.hasUnloadedRenderableContent&&!e.contentExpired||!Xgt(e,t))return;let i=t.camera.timeSinceMoved<n.foveatedTimeDelay;e.priorityDeferred&&i||(e._requestedFrame=t.frameNumber,n._requestedTiles.push(e))};function Xgt(e,t){let{tileset:n}=e;if(!n._cullRequestsWhileMoving)return!0;let{positionWCDeltaMagnitude:i,positionWCDeltaMagnitudeLastFrame:o}=t.camera,r=i!==0?i:o,s=Math.max(e.boundingSphere.radius*2,1);return n.cullRequestsWhileMovingMultiplier*r/s<1}Vg.updateTile=function(e,t){w1e(e,t),e.updateExpiration(),e._wasMinPriorityChild=!1,e._priorityHolder=e,Mgt(e),e._shouldSelect=!1,e._finalResolution=!0};function w1e(e,t){if(e.updateVisibility(t),!e.isVisible)return;let n=e.children.length>0;if((e.hasTilesetContent||e.hasImplicitContent)&&n){let r=e.children[0];w1e(r,t),e._visible=r._visible;return}if(Ngt(e,t)){e._visible=!1;return}let i=e.refine===Tr.REPLACE,o=e._optimChildrenWithinParent===rh.USE_OPTIMIZATION;if(i&&o&&n&&!Ygt(e,t)){++e.tileset._statistics.numberOfTilesCulledWithChildrenUnion,e._visible=!1;return}}function Ngt(e,t){let{parent:n,tileset:i}=e;return!l(n)||n.hasTilesetContent||n.hasImplicitContent||n.refine!==Tr.ADD?!1:e.getScreenSpaceError(t,!0)<=i.memoryAdjustedScreenSpaceError}function Ygt(e,t){let n=!1,i=e.children;for(let o=0;o<i.length;++o){let r=i[o];r.updateVisibility(t),n=n||r.isVisible}return n}function Mgt(e){let t=e.tileset._minimumPriority,n=e.tileset._maximumPriority,i=e._priorityHolder;n.distance=Math.max(i._distanceToCamera,n.distance),t.distance=Math.min(i._distanceToCamera,t.distance),n.depth=Math.max(e._depth,n.depth),t.depth=Math.min(e._depth,t.depth),n.foveatedFactor=Math.max(i._foveatedFactor,n.foveatedFactor),t.foveatedFactor=Math.min(i._foveatedFactor,t.foveatedFactor),n.reverseScreenSpaceError=Math.max(e._priorityReverseScreenSpaceError,n.reverseScreenSpaceError),t.reverseScreenSpaceError=Math.min(e._priorityReverseScreenSpaceError,t.reverseScreenSpaceError)}var Ha=Vg;function k1e(){}var JY={stack:new cd,stackMaximumLength:0};k1e.selectTiles=function(e,t){e._selectedTiles.length=0,e._requestedTiles.length=0,e.hasMixedContent=!1;let n=!0,i=e.root;if(i.updateVisibility(t),!i.isVisible)return n;let{touchTile:o,visitTile:r}=Ha,s=JY.stack;for(s.push(i);s.length>0;){JY.stackMaximumLength=Math.max(JY.stackMaximumLength,s.length);let a=s.pop(),c=a.refine===Tr.ADD,d=a.refine===Tr.REPLACE,u=wgt(a);u&&kgt(a,s,t),(c||d&&!u)&&(Ugt(e,a),o(a,t),Dgt(a,t),a.hasRenderableContent&&!a.contentAvailable&&(n=!1)),r(a,t)}return JY.stack.trim(JY.stackMaximumLength),n};function wgt(e){return e.children.length===0?!1:e.hasTilesetContent||e.hasImplicitContent?!e.contentExpired:(e.hasEmptyContent,!0)}function kgt(e,t,n){let{children:i}=e;for(let o=0;o<i.length;++o){let r=i[o];r.updateVisibility(n),r.isVisible&&t.push(r)}}function Ugt(e,t){(t.hasUnloadedRenderableContent||t.contentExpired)&&(t._priority=0,e._requestedTiles.push(t))}function Dgt(e,t){e.contentAvailable&&e.contentVisibility(t)!==qt.OUTSIDE&&e.tileset._selectedTiles.push(e)}var jY=k1e;var vwi=x(T(),1);function U1e(){}var QY={stack:new cd,stackMaximumLength:0},qY={stack:new cd,stackMaximumLength:0};U1e.selectTiles=function(e,t){if(e._requestedTiles.length=0,e.debugFreezeFrame)return;e._selectedTiles.length=0,e._selectedTilesToStyle.length=0,e._emptyTiles.length=0,e.hasMixedContent=!1;let n=e.root;if(Ha.updateTile(n,t),!n.isVisible||n.getScreenSpaceError(t,!0)<=e.memoryAdjustedScreenSpaceError)return;Bgt(n,t),QY.stack.trim(QY.stackMaximumLength),qY.stack.trim(qY.stackMaximumLength);let i=e._requestedTiles;for(let o=0;o<i.length;++o)i[o].updatePriority()};function Vee(e,t){e.contentAvailable&&Ha.selectTile(e,t)}function Ogt(e,t,n){let i=e.refine===Tr.REPLACE,{tileset:o,children:r}=e,{updateTile:s,loadTile:a,touchTile:c}=Ha;for(let f=0;f<r.length;++f)s(r[f],n);r.sort(Ha.sortChildrenByDistanceToCamera);let d=i&&e.hasRenderableContent,u=!0,m=!1,p=-1,b=Number.MAX_VALUE;for(let f=0;f<r.length;++f){let y=r[f];if(y.isVisible?(t.push(y),y._foveatedFactor<b&&(p=f,b=y._foveatedFactor),m=!0):(d||o.loadSiblings)&&(y._foveatedFactor<b&&(p=f,b=y._foveatedFactor),a(y,n),c(y,n)),d){let _;y._inRequestVolume?y.hasRenderableContent?_=y.contentAvailable:_=zgt(y,n):_=!1,u=u&&_}}if(m||(u=!1),p!==-1&&i){let f=r[p];f._wasMinPriorityChild=!0;let y=(e._wasMinPriorityChild||e===o.root)&&b<=e._priorityHolder._foveatedFactor?e._priorityHolder:e;y._foveatedFactor=Math.min(f._foveatedFactor,y._foveatedFactor),y._distanceToCamera=Math.min(f._distanceToCamera,y._distanceToCamera);for(let _=0;_<r.length;++_)r[_]._priorityHolder=y}return u}function Bgt(e,t){let{tileset:n}=e,{canTraverse:i,loadTile:o,visitTile:r,touchTile:s}=Ha,a=QY.stack;for(a.push(e);a.length>0;){QY.stackMaximumLength=Math.max(QY.stackMaximumLength,a.length);let c=a.pop(),d=c.parent,u=!l(d)||d._refines;c._refines=i(c)?Ogt(c,a,t)&&u:!1;let m=!c._refines&&u;c.hasRenderableContent?c.refine===Tr.ADD?(Vee(c,t),o(c,t)):c.refine===Tr.REPLACE&&(o(c,t),m&&Vee(c,t)):(n._emptyTiles.push(c),o(c,t),m&&Vee(c,t)),r(c,t),s(c,t)}}function zgt(e,t){let{canTraverse:n,updateTile:i,loadTile:o,touchTile:r}=Ha,s=e.tileset.hasExtension("3DTILES_content_gltf_vector"),a=!0,c=qY.stack;for(c.push(e);c.length>0;){qY.stackMaximumLength=Math.max(qY.stackMaximumLength,c.length);let d=c.pop(),u=d.children,m=u.length,p=!d.hasRenderableContent&&n(d);if((s?d.hasRenderableContent:!p)&&!d.contentAvailable&&(a=!1),i(d,t),d.isVisible||(o(d,t),r(d,t)),p)for(let f=0;f<m;++f){let y=u[f];c.push(y)}}return e.hasEmptyContent||a}var $Y=U1e;var Ywi=x(T(),1);function D1e(){}var eM={stack:new cd,stackMaximumLength:0},tM={stack:new cd,stackMaximumLength:0},Eg={stack:new cd,stackMaximumLength:0,ancestorStack:new cd,ancestorStackMaximumLength:0},Hgt=2;D1e.selectTiles=function(e,t){if(e._requestedTiles.length=0,e.debugFreezeFrame)return;e._selectedTiles.length=0,e._selectedTilesToStyle.length=0,e._emptyTiles.length=0,e.hasMixedContent=!1;let n=e.root;if(Ha.updateTile(n,t),!n.isVisible||n.getScreenSpaceError(t,!0)<=e.memoryAdjustedScreenSpaceError)return;$gt(n,t),eyt(n,t),eM.stack.trim(eM.stackMaximumLength),tM.stack.trim(tM.stackMaximumLength),Eg.stack.trim(Eg.stackMaximumLength),Eg.ancestorStack.trim(Eg.ancestorStackMaximumLength);let i=e._requestedTiles;for(let o=0;o<i.length;++o)i[o].updatePriority()};function Kgt(e,t){let{updateTile:n,touchTile:i,selectTile:o}=Ha,r=tM.stack;for(r.push(e);r.length>0;){tM.stackMaximumLength=Math.max(tM.stackMaximumLength,r.length);let a=r.pop().children;for(let c=0;c<a.length;++c){let d=a[c];d.isVisible&&(d.contentAvailable?(n(d,t),i(d,t),o(d,t)):d._depth-e._depth<Hgt&&r.push(d))}}}function R3(e,t){let n=e.contentAvailable?e:e._ancestorWithContentAvailable;l(n)?n._shouldSelect=!0:Kgt(e,t)}function Jgt(e,t){e._ancestorWithContent=void 0,e._ancestorWithContentAvailable=void 0;let{parent:n}=e;if(!l(n))return;let i=!n.hasUnloadedRenderableContent||n._requestedFrame===t.frameNumber;e._ancestorWithContent=i?n:n._ancestorWithContent,e._ancestorWithContentAvailable=n.contentAvailable?n:n._ancestorWithContentAvailable}function jgt(e,t){let n=t._ancestorWithContent;return!e.immediatelyLoadDesiredLevelOfDetail&&(t._priorityProgressiveResolutionScreenSpaceErrorLeaf||l(n)&&t._screenSpaceError<n._screenSpaceError/e.skipScreenSpaceErrorFactor&&t._depth>n._depth+e.skipLevels)}function Qgt(e,t,n){let{tileset:i,children:o}=e,{updateTile:r,loadTile:s,touchTile:a}=Ha;for(let d=0;d<o.length;++d)r(o[d],n);o.sort(Ha.sortChildrenByDistanceToCamera);let c=!1;for(let d=0;d<o.length;++d){let u=o[d];u.isVisible?(t.push(u),c=!0):i.loadSiblings&&(s(u,n),a(u,n))}return c}function qgt(e,t){let{tileset:n}=e;return n.immediatelyLoadDesiredLevelOfDetail?!1:l(e._ancestorWithContent)?e._screenSpaceError===0?e.parent._screenSpaceError>t:e._screenSpaceError>t:!0}function $gt(e,t){let{tileset:n}=e,i=n.immediatelyLoadDesiredLevelOfDetail?Number.MAX_VALUE:Math.max(n.baseScreenSpaceError,n.memoryAdjustedScreenSpaceError),{canTraverse:o,loadTile:r,visitTile:s,touchTile:a}=Ha,c=eM.stack;for(c.push(e);c.length>0;){eM.stackMaximumLength=Math.max(eM.stackMaximumLength,c.length);let d=c.pop();Jgt(d,t);let u=d.parent,m=!l(u)||u._refines;d._refines=o(d)?Qgt(d,c,t)&&m:!1;let p=!d._refines&&m;d.hasRenderableContent?d.refine===Tr.ADD?(R3(d,t),r(d,t)):d.refine===Tr.REPLACE&&(qgt(d,i)?(r(d,t),p&&R3(d,t)):p?(R3(d,t),r(d,t)):jgt(n,d)&&r(d,t)):(n._emptyTiles.push(d),r(d,t),p&&R3(d,t)),s(d,t),a(d,t)}}function eyt(e,t){let{selectTile:n,canTraverse:i}=Ha,{stack:o,ancestorStack:r}=Eg,s;for(o.push(e);o.length>0||r.length>0;){if(Eg.stackMaximumLength=Math.max(Eg.stackMaximumLength,o.length),Eg.ancestorStackMaximumLength=Math.max(Eg.ancestorStackMaximumLength,r.length),r.length>0){let d=r.peek();if(d._stackLength===o.length){r.pop(),d!==s&&(d._finalResolution=!1),n(d,t);continue}}let a=o.pop();if(!l(a))continue;let c=i(a);if(a._shouldSelect)if(a.refine===Tr.ADD)n(a,t);else{if(a._selectionDepth=r.length,a._selectionDepth>0&&(a.tileset.hasMixedContent=!0),s=a,!c){n(a,t);continue}r.push(a),a._stackLength=o.length}if(c){let d=a.children;for(let u=0;u<d.length;++u){let m=d[u];m.isVisible&&o.push(m)}}}}var nM=D1e;var jwi=x(T(),1);function Aa(){this._layers=[],this.layerAdded=new Se,this.layerRemoved=new Se,this.layerMoved=new Se,this.layerShownOrHidden=new Se}Object.defineProperties(Aa.prototype,{length:{get:function(){return this._layers.length}}});Aa.prototype.add=function(e,t){l(t)?this._layers.splice(t,0,e):(t=this._layers.length,this._layers.push(e)),this._update(),this.layerAdded.raiseEvent(e,t);let i=e.readyEvent.addEventListener(()=>{this.layerShownOrHidden.raiseEvent(e,e._layerIndex,e.show),i()})};Aa.prototype.addImageryProvider=function(e,t){let n=new Cs(e);return this.add(n,t),n};Aa.prototype.remove=function(e,t){t=t??!0;let n=this._layers.indexOf(e);return n!==-1?(this._layers.splice(n,1),this._update(),this.layerRemoved.raiseEvent(e,n),t&&e.destroy(),!0):!1};Aa.prototype.removeAll=function(e){e=e??!0;let t=this._layers;for(let n=0,i=t.length;n<i;n++){let o=t[n];this.layerRemoved.raiseEvent(o,n),e&&o.destroy()}this._layers=[]};Aa.prototype.contains=function(e){return this.indexOf(e)!==-1};Aa.prototype.indexOf=function(e){return this._layers.indexOf(e)};Aa.prototype.get=function(e){return this._layers[e]};function C3(e,t){return e.indexOf(t)}function O1e(e,t,n){let i=e._layers;if(t=W.clamp(t,0,i.length-1),n=W.clamp(n,0,i.length-1),t===n)return;let o=i[t];i[t]=i[n],i[n]=o,e._update(),e.layerMoved.raiseEvent(o,n,t)}Aa.prototype.raise=function(e){let t=C3(this._layers,e);O1e(this,t,t+1)};Aa.prototype.lower=function(e){let t=C3(this._layers,e);O1e(this,t,t-1)};Aa.prototype.raiseToTop=function(e){let t=C3(this._layers,e);t!==this._layers.length-1&&(this._layers.splice(t,1),this._layers.push(e),this._update(),this.layerMoved.raiseEvent(e,this._layers.length-1,t))};Aa.prototype.lowerToBottom=function(e){let t=C3(this._layers,e);t!==0&&(this._layers.splice(t,1),this._layers.splice(0,0,e),this._update(),this.layerMoved.raiseEvent(e,0,t))};var B1e=new re;function z1e(e,t,n,i){let o=e.globe._surface._tilesToRender,r;for(let a=0;!l(r)&&a<o.length;++a){let c=o[a];re.contains(c.rectangle,t)&&(r=c)}if(!l(r))return;let s=r.data.imagery;for(let a=s.length-1;a>=0;--a){let c=s[a],d=c.readyImagery;if(!l(d)||!d.imageryLayer.ready)continue;let u=d.imageryLayer.imageryProvider;if(n&&!l(u.pickFeatures)||!re.contains(d.rectangle,t))continue;let m=B1e,p=1/1024;m.west=W.lerp(r.rectangle.west,r.rectangle.east,c.textureCoordinateRectangle.x-p),m.east=W.lerp(r.rectangle.west,r.rectangle.east,c.textureCoordinateRectangle.z+p),m.south=W.lerp(r.rectangle.south,r.rectangle.north,c.textureCoordinateRectangle.y-p),m.north=W.lerp(r.rectangle.south,r.rectangle.north,c.textureCoordinateRectangle.w+p),re.contains(m,t)&&i(d)}}Aa.prototype.pickImageryLayers=function(e,t){let n=t.globe.pick(e,t);if(!l(n))return;let i=t.ellipsoid.cartesianToCartographic(n),o=[];if(z1e(t,i,!1,function(r){o.push(r.imageryLayer)}),o.length!==0)return o};var tyt=new re,nyt=new re,Eee=new k,Aee=new k,iyt=new pe,oyt=new pe;function ryt(e,t,n,i){let o=n.imageryProvider.tilingScheme,r=o.rectangleToNativeRectangle(e,tyt),s=1/1024,a=nyt;a.west=W.lerp(r.west,r.east,t.minX-s),a.east=W.lerp(r.west,r.east,t.maxX+s),a.south=W.lerp(r.south,r.north,t.minY-s),a.north=W.lerp(r.south,r.north,t.maxY+s),l(i)||(i=new re);let c=o.projection;if(c instanceof ki)return i.west=W.toRadians(a.west),i.south=W.toRadians(a.south),i.east=W.toRadians(a.east),i.north=W.toRadians(a.north),i;Eee.x=a.west,Eee.y=a.south,Aee.x=a.east,Aee.y=a.north;let d=c.unproject(Eee,iyt),u=c.unproject(Aee,oyt);return i.west=d.longitude,i.south=d.latitude,i.east=u.longitude,i.north=u.latitude,i}function syt(e,t,n){let i=e._modelImagery;if(!l(i))return;let o=i._modelPrimitiveImageries;if(l(o))for(let r=0;r<o.length;r++){let s=o[r],a=s._coveragesPerLayer;if(l(a))for(let c=a.length-1;c>=0;--c){let d=a[c];for(let u=0;u<d.length;u++){let m=d[u],p=m.imagery,b=p.imageryLayer,f=b.imageryProvider;if(!l(f.pickFeatures)||!l(p)||p.state!==Dn.READY||!re.contains(p.rectangle,t))continue;let _=s.mappedPositionsForImageryLayer(b).cartographicBoundingRectangle,S=ryt(_,m.textureCoordinateRectangle,b,B1e);re.contains(S,t)&&n(p)}}}}Aa.prototype.pickImageryLayerFeatures=function(e,t){let n;l(t.globe)&&(n=t.globe.pick(e,t));let i;if(!l(n)){let c=t.pickFromRay(e);if(!l(c)||(n=c.position,!l(n)))return;l(c.object)&&l(c.object.detail)&&(i=c.object.detail.model)}let o=t.ellipsoid.cartesianToCartographic(n),r=[],s=[];function a(c){if(!c.imageryLayer.ready)return;let u=c.imageryLayer.imageryProvider.pickFeatures(c.x,c.y,c.level,o.longitude,o.latitude);l(u)&&(r.push(u),s.push(c.imageryLayer))}if(l(t.globe)&&z1e(t,o,!0,function(c){a(c)}),l(i)&&syt(i,o,function(c){a(c)}),r.length!==0)return Promise.all(r).then(function(c){let d=[];for(let u=0;u<c.length;++u){let m=c[u],p=s[u];if(l(m)&&m.length>0)for(let b=0;b<m.length;++b){let f=m[b];f.imageryLayer=p,l(f.position)||(f.position=o),d.push(f)}}return d})};Aa.prototype.queueReprojectionCommands=function(e){let t=this._layers;for(let n=0,i=t.length;n<i;++n)t[n].queueReprojectionCommands(e)};Aa.prototype.cancelReprojections=function(){let e=this._layers;for(let t=0,n=e.length;t<n;++t)e[t].cancelReprojections()};Aa.prototype.isDestroyed=function(){return!1};Aa.prototype.destroy=function(){return this.removeAll(!0),ue(this)};Aa.prototype._update=function(){let e=!0,t=this._layers,n,i,o,r;for(o=0,r=t.length;o<r;++o)i=t[o],i._layerIndex=o,i.show?(i._isBaseLayer=e,e=!1):i._isBaseLayer=!1,i.show!==i._show&&(l(i._show)&&(l(n)||(n=[]),n.push(i)),i._show=i.show);if(l(n))for(o=0,r=n.length;o<r;++o)i=n[o],this.layerShownOrHidden.raiseEvent(i,i._layerIndex,i.show)};var uZ=Aa;function ur(e){e=e??B.EMPTY_OBJECT,this._url=void 0,this._basePath=void 0,this._root=void 0,this._resource=void 0,this._asset=void 0,this._properties=void 0,this._geometricError=void 0,this._scaledGeometricError=void 0,this._extensionsUsed=void 0,this._extensions=void 0,this._modelUpAxis=void 0,this._modelForwardAxis=void 0,this._cache=new OY,this._externalTilesetTiles=[],this._externalTilesetSweepIndex=0,this._externalTilesetSweepCount=8,this._externalTilesetIdleFrames=e.externalTilesetIdleFrames??120,this._processingQueue=[],this._selectedTiles=[],this._emptyTiles=[],this._requestedTiles=[],this._selectedTilesToStyle=[],this._loadTimestamp=void 0,this._timeSinceLoad=0,this._updatedVisibilityFrame=0,this._updatedModelMatrixFrame=0,this._modelMatrixChanged=!1,this._previousModelMatrix=void 0,this._extras=void 0,this._credits=void 0,this._showCreditsOnScreen=e.showCreditsOnScreen??!1,this._cullWithChildrenBounds=e.cullWithChildrenBounds??!0,this._allTilesAdditive=!0,this._hasMixedContent=!1,this._stencilClearCommand=void 0,this._backfaceCommands=new cd,this._maximumScreenSpaceError=e.maximumScreenSpaceError??16,this._memoryAdjustedScreenSpaceError=this._maximumScreenSpaceError,this._cacheBytes=e.cacheBytes??512*1024*1024;let t=e.maximumCacheOverflowBytes??512*1024*1024;this._maximumCacheOverflowBytes=t,this._styleEngine=new HY,this._styleApplied=!1,this._modelMatrix=l(e.modelMatrix)?P.clone(e.modelMatrix):P.clone(P.IDENTITY),this._addHeightCallbacks=[],this._statistics=new Xf,this._statisticsLast=new Xf,this._statisticsPerPass=new Array(lr.NUMBER_OF_PASSES);for(let o=0;o<lr.NUMBER_OF_PASSES;++o)this._statisticsPerPass[o]=new Xf;this._requestedTilesInFlight=[],this._maximumPriority={foveatedFactor:-Number.MAX_VALUE,depth:-Number.MAX_VALUE,distance:-Number.MAX_VALUE,reverseScreenSpaceError:-Number.MAX_VALUE},this._minimumPriority={foveatedFactor:Number.MAX_VALUE,depth:Number.MAX_VALUE,distance:Number.MAX_VALUE,reverseScreenSpaceError:Number.MAX_VALUE},this._heatmap=new BY(e.debugHeatmapTilePropertyName),this.cullRequestsWhileMoving=e.cullRequestsWhileMoving??!0,this._cullRequestsWhileMoving=!1,this.cullRequestsWhileMovingMultiplier=e.cullRequestsWhileMovingMultiplier??60,this.progressiveResolutionHeightFraction=W.clamp(e.progressiveResolutionHeightFraction??.3,0,.5),this.preferLeaves=e.preferLeaves??!1,this._tilesLoaded=!1,this._initialTilesLoaded=!1,this._tileDebugLabels=void 0,this._classificationType=e.classificationType,this._heightReference=e.heightReference,this._scene=e.scene,this._ellipsoid=e.ellipsoid??ne.WGS84,this._initialClippingPlanesOriginMatrix=P.IDENTITY,this._clippingPlanesOriginMatrix=void 0,this._clippingPlanesOriginMatrixDirty=!0,this._vectorClassificationOnly=e.vectorClassificationOnly??!1,this._vectorKeepDecodedPositions=e.vectorKeepDecodedPositions??!1,this._imageryLayers=new uZ(this),this._imageryLayersModificationCounter=0,this._imageryLayersListener=()=>{this._imageryLayersModificationCounter++},this.imageryLayers.layerAdded.addEventListener(this._imageryLayersListener),this.imageryLayers.layerRemoved.addEventListener(this._imageryLayersListener),this.imageryLayers.layerMoved.addEventListener(this._imageryLayersListener),this.imageryLayers.layerShownOrHidden.addEventListener(this._imageryLayersListener),this._asynchronouslyLoadImagery=e.asynchronouslyLoadImagery??!1,this.preloadWhenHidden=e.preloadWhenHidden??!1,this.preloadFlightDestinations=e.preloadFlightDestinations??!0,this._pass=void 0,this.dynamicScreenSpaceError=e.dynamicScreenSpaceError??!0,this.foveatedScreenSpaceError=e.foveatedScreenSpaceError??!0,this._foveatedConeSize=e.foveatedConeSize??.1,this._foveatedMinimumScreenSpaceErrorRelaxation=e.foveatedMinimumScreenSpaceErrorRelaxation??0,this.foveatedInterpolationCallback=e.foveatedInterpolationCallback??W.lerp,this.foveatedTimeDelay=e.foveatedTimeDelay??.2,this.dynamicScreenSpaceErrorDensity=e.dynamicScreenSpaceErrorDensity??2e-4,this.dynamicScreenSpaceErrorFactor=e.dynamicScreenSpaceErrorFactor??24,this.dynamicScreenSpaceErrorHeightFalloff=e.dynamicScreenSpaceErrorHeightFalloff??.25,this._dynamicScreenSpaceErrorComputedDensity=0,this.shadows=e.shadows??Wn.ENABLED,this.show=e.show??!0,this.colorBlendMode=Ud.HIGHLIGHT,this.colorBlendAmount=.5,this._pointCloudShading=new jp(e.pointCloudShading),this._pointCloudEyeDomeLighting=new Hb,this.loadProgress=new Se,this.allTilesLoaded=new Se,this.initialTilesLoaded=new Se,this.tileLoad=new Se,this.tileUnload=new Se,this.tileFailed=new Se,this.tileVisible=new Se,this.skipLevelOfDetail=e.skipLevelOfDetail??!1,this._disableSkipLevelOfDetail=!1,this._runtimeContentCodec=void 0,this.baseScreenSpaceError=e.baseScreenSpaceError??1024,this.skipScreenSpaceErrorFactor=e.skipScreenSpaceErrorFactor??16,this.skipLevels=e.skipLevels??1,this.immediatelyLoadDesiredLevelOfDetail=e.immediatelyLoadDesiredLevelOfDetail??!1,this.loadSiblings=e.loadSiblings??!1,this._clippingPlanes=void 0,l(e.clippingPlanes)&&_s.setOwner(e.clippingPlanes,this,"_clippingPlanes"),this._clippingPolygons=void 0,this._clippingPolygonsNeedRebake=!1,this._removeClippingPolygonAdded=void 0,this._removeClippingPolygonRemoved=void 0,l(e.clippingPolygons)&&(vc.setOwner(e.clippingPolygons,this,"_clippingPolygons"),Q1e(this)),l(e.imageBasedLighting)?(this._imageBasedLighting=e.imageBasedLighting,this._shouldDestroyImageBasedLighting=!1):(this._imageBasedLighting=new WS,this._shouldDestroyImageBasedLighting=!0),this._environmentMapManager=new kb(e.environmentMapOptions),this.lightColor=e.lightColor,this.backFaceCulling=e.backFaceCulling??!0,this._enableShowOutline=e.enableShowOutline??!0,this.showOutline=e.showOutline??!0,this.outlineColor=e.outlineColor??U.BLACK,this.splitDirection=e.splitDirection??Ur.NONE,this.enableCollision=e.enableCollision??!1,this.maximumHeightQueryGeometricError=e.maximumHeightQueryGeometricError??500,this._projectTo2D=e.projectTo2D??!1,this._enablePick=e.enablePick??!1,this.debugFreezeFrame=e.debugFreezeFrame??!1,this.debugColorizeTiles=e.debugColorizeTiles??!1,this._enableDebugWireframe=e.enableDebugWireframe??!1,this.debugWireframe=e.debugWireframe??!1,this.debugWireframe===!0&&this._enableDebugWireframe===!1&&xt("tileset-debug-wireframe-ignored","enableDebugWireframe must be set to true in the Cesium3DTileset constructor, otherwise debugWireframe will be ignored."),this.edgeDisplayMode=e.edgeDisplayMode??Bm.SURFACES_ONLY,this.debugShowBoundingVolume=e.debugShowBoundingVolume??!1,this.debugShowContentBoundingVolume=e.debugShowContentBoundingVolume??!1,this.debugShowViewerRequestVolume=e.debugShowViewerRequestVolume??!1,this._tileDebugLabels=void 0,this.debugPickedTileLabelOnly=!1,this.debugPickedTile=void 0,this.debugPickPosition=void 0,this.debugShowGeometricError=e.debugShowGeometricError??!1,this.debugShowRenderingStatistics=e.debugShowRenderingStatistics??!1,this.debugShowMemoryUsage=e.debugShowMemoryUsage??!1,this.debugShowUrl=e.debugShowUrl??!1,this.examineVectorLinesFunction=void 0,this._metadataExtension=void 0,this._customShader=e.customShader;let n=e.featureIdLabel??"featureId_0";typeof n=="number"&&(n=`featureId_${n}`),this._featureIdLabel=n;let i=e.instanceFeatureIdLabel??"instanceFeatureId_0";typeof i=="number"&&(i=`instanceFeatureId_${i}`),this._instanceFeatureIdLabel=i}Object.defineProperties(ur.prototype,{isCesium3DTileset:{get:function(){return!0}},asset:{get:function(){return this._asset}},extensions:{get:function(){return this._extensions}},clippingPlanes:{get:function(){return this._clippingPlanes},set:function(e){_s.setOwner(e,this,"_clippingPlanes")}},clippingPolygons:{get:function(){return this._clippingPolygons},set:function(e){vc.setOwner(e,this,"_clippingPolygons"),Q1e(this),this._clippingPolygonsNeedRebake=!0}},imageryLayers:{get:function(){return this._imageryLayers}},imageryLayersModificationCounter:{get:function(){return this._imageryLayersModificationCounter}},asynchronouslyLoadImagery:{get:function(){return this._asynchronouslyLoadImagery}},properties:{get:function(){return this._properties}},tilesLoaded:{get:function(){return this._tilesLoaded}},resource:{get:function(){return this._resource}},basePath:{get:function(){return Jo("Cesium3DTileset.basePath","Cesium3DTileset.basePath has been deprecated. All tiles are relative to the url of the tileset JSON file that contains them. Use the url property instead."),this._basePath}},style:{get:function(){return this._styleEngine.style},set:function(e){this._styleEngine.style=e}},customShader:{get:function(){return this._customShader},set:function(e){this._customShader=e}},hasMixedContent:{get:function(){return this._hasMixedContent},set:function(e){this._hasMixedContent=e}},isSkippingLevelOfDetail:{get:function(){return this.skipLevelOfDetail&&!l(this._classificationType)&&!this._disableSkipLevelOfDetail&&!this._allTilesAdditive}},metadataExtension:{get:function(){return this._metadataExtension}},metadata:{get:function(){if(l(this._metadataExtension))return this._metadataExtension.tileset}},schema:{get:function(){if(l(this._metadataExtension))return this._metadataExtension.schema}},maximumScreenSpaceError:{get:function(){return this._maximumScreenSpaceError},set:function(e){this._maximumScreenSpaceError=e,this._memoryAdjustedScreenSpaceError=e}},cacheBytes:{get:function(){return this._cacheBytes},set:function(e){this._cacheBytes=e}},maximumCacheOverflowBytes:{get:function(){return this._maximumCacheOverflowBytes},set:function(e){this._maximumCacheOverflowBytes=e}},externalTilesetIdleFrames:{get:function(){return this._externalTilesetIdleFrames},set:function(e){this._externalTilesetIdleFrames=e}},memoryAdjustedScreenSpaceError:{get:function(){return this._memoryAdjustedScreenSpaceError}},pointCloudShading:{get:function(){return this._pointCloudShading},set:function(e){this._pointCloudShading=e}},root:{get:function(){return this._root}},boundingSphere:{get:function(){return this._root.updateTransform(this._modelMatrix),this._root.boundingSphere}},modelMatrix:{get:function(){return this._modelMatrix},set:function(e){this._modelMatrix=P.clone(e,this._modelMatrix)}},timeSinceLoad:{get:function(){return this._timeSinceLoad}},totalMemoryUsageInBytes:{get:function(){let e=this._statistics;return e.texturesByteLength+e.geometryByteLength+e.batchTableByteLength}},clippingPlanesOriginMatrix:{get:function(){return l(this._clippingPlanesOriginMatrix)?(this._clippingPlanesOriginMatrixDirty&&(P.multiply(this.root.computedTransform,this._initialClippingPlanesOriginMatrix,this._clippingPlanesOriginMatrix),this._clippingPlanesOriginMatrixDirty=!1),this._clippingPlanesOriginMatrix):P.IDENTITY}},styleEngine:{get:function(){return this._styleEngine}},statistics:{get:function(){return this._statistics}},classificationType:{get:function(){return this._classificationType}},heightReference:{get:function(){return this._heightReference}},scene:{get:function(){return this._scene}},ellipsoid:{get:function(){return this._ellipsoid}},foveatedConeSize:{get:function(){return this._foveatedConeSize},set:function(e){this._foveatedConeSize=e}},foveatedMinimumScreenSpaceErrorRelaxation:{get:function(){return this._foveatedMinimumScreenSpaceErrorRelaxation},set:function(e){this._foveatedMinimumScreenSpaceErrorRelaxation=e}},extras:{get:function(){return this._extras}},imageBasedLighting:{get:function(){return this._imageBasedLighting},set:function(e){e!==this._imageBasedLighting&&(this._shouldDestroyImageBasedLighting&&!this._imageBasedLighting.isDestroyed()&&this._imageBasedLighting.destroy(),this._imageBasedLighting=e,this._shouldDestroyImageBasedLighting=!1)}},environmentMapManager:{get:function(){return this._environmentMapManager}},vectorClassificationOnly:{get:function(){return this._vectorClassificationOnly}},vectorKeepDecodedPositions:{get:function(){return this._vectorKeepDecodedPositions}},showCreditsOnScreen:{get:function(){return this._showCreditsOnScreen},set:function(e){this._showCreditsOnScreen=e,nCe(this)}},featureIdLabel:{get:function(){return this._featureIdLabel},set:function(e){typeof e=="number"&&(e=`featureId_${e}`),this._featureIdLabel=e}},instanceFeatureIdLabel:{get:function(){return this._instanceFeatureIdLabel},set:function(e){typeof e=="number"&&(e=`instanceFeatureId_${e}`),this._instanceFeatureIdLabel=e}}});ur.fromIonAssetId=async function(e,t){let n=await zr.fromAssetId(e);return ur.fromUrl(n,t)};ur.fromUrl=async function(e,t){t=t??B.EMPTY_OBJECT;let n=ve.createIfNeeded(e),i;n.extension==="json"?i=n.getBaseUri(!0):n.isDataUri&&(i="");let o=await ur.loadJson(n),r=await ayt(n,o),s=new ur(t);s._resource=n,s._url=n.url,s._basePath=i,s._metadataExtension=r,s._geometricError=o.geometricError,s._scaledGeometricError=o.geometricError;let a=o.asset;s._asset=a,s._extras=o.extras,nCe(s);let c=l(o.asset.gltfUpAxis)?Bi.fromName(o.asset.gltfUpAxis):Bi.Y,d=t.modelUpAxis??c,u=t.modelForwardAxis??Bi.X;s._properties=o.properties,s._extensionsUsed=o.extensionsUsed,s._extensions=o.extensions,s._modelUpAxis=d,s._modelForwardAxis=u,s._root=s.loadTileset(n,o);let p=s._root.createBoundingVolume(o.root.boundingVolume,P.IDENTITY).boundingSphere.center,b=s._ellipsoid.cartesianToCartographic(p);return l(b)&&b.height>Pi._defaultMinTerrainHeight&&(s._initialClippingPlanesOriginMatrix=_t.eastNorthUpToFixedFrame(p)),s._clippingPlanesOriginMatrix=P.clone(s._initialClippingPlanesOriginMatrix),s};ur.loadJson=function(e){return ve.createIfNeeded(e).fetchJson()};ur.prototype.makeStyleDirty=function(){this._styleEngine.makeDirty()};ur.prototype.loadTileset=function(e,t,n){let i=t.asset;if(!l(i))throw new ae("Tileset must have an asset property.");if(i.version!=="0.0"&&i.version!=="1.0"&&i.version!=="1.1")throw new ae("The tileset must be 3D Tiles version 0.0, 1.0, or 1.1");l(t.extensionsRequired)&&ur.checkSupportedExtensions(t.extensionsRequired);let o=this._statistics;l(n)&&this._externalTilesetTiles.push(n);let r=i.tilesetVersion;l(r)&&(this._basePath+=`?v=${r}`,e=e.clone(),e.setQueryParameters({v:r}));let s=H1e(this,e,t.root,n);l(n)&&(n.children.push(s),s._depth=n._depth+1);let a=[];for(a.push(s);a.length>0;){let c=a.pop();++o.numberOfTilesTotal,this._allTilesAdditive=this._allTilesAdditive&&c.refine===Tr.ADD;let d=c._header.children;if(l(d))for(let u=0;u<d.length;++u){let m=d[u],p=H1e(this,e,m,c);c.children.push(p),p._depth=c._depth+1,a.push(p)}this._cullWithChildrenBounds&&kY.checkChildrenWithinParent(c)}return s};function H1e(e,t,n,i){if(!(l(n.implicitTiling)||ro(n,"3DTILES_implicit_tiling")))return new ah(e,t,n,i);let r=e.schema,s=new s0(t,n,r),a=new a0({subdivisionScheme:s.subdivisionScheme,subtreeLevels:s.subtreeLevels,level:0,x:0,y:0,z:0}),c=s.subtreeUriTemplate.getDerivedResource({templateValues:a.getTemplateValues()}).url,u=$e(n,!0);u.contents=[{uri:c}],delete u.content,delete u.extensions;let m=new ah(e,t,u,i);return m.implicitTileset=s,m.implicitCoordinates=a,m}async function ayt(e,t){let n=ro(t,"3DTILES_metadata")?t.extensions["3DTILES_metadata"]:t,i;if(l(n.schemaUri))e=e.getDerivedResource({url:n.schemaUri}),i=Yi.getSchemaLoader({resource:e});else if(l(n.schema))i=Yi.getSchemaLoader({schema:n.schema});else return;await i.load();let o=new dZ({schema:i.schema,metadataJson:n});return Yi.unload(i),o}var K1e=new h,cyt=new pe,lyt=new P,dyt=new h,uyt=new h,myt=new h,hyt=new h;function fyt(e,t){let n,i,o,r,s,a=t.camera,c=e._root,d=c.contentBoundingVolume;if(d instanceof Ju)n=h.normalize(a.positionWC,K1e),i=a.directionWC,o=a.positionCartographic.height,r=d.minimumHeight,s=d.maximumHeight;else{let y=P.inverseTransformation(c.computedTransform,lyt),_=t.mapProjection.ellipsoid,S=d.boundingVolume,Z=P.multiplyByPoint(y,S.center,dyt);if(h.magnitude(Z)>_.minimumRadius){let R=pe.fromCartesian(Z,_,cyt);n=h.normalize(a.positionWC,K1e),i=a.directionWC,o=a.positionCartographic.height,r=0,s=R.height*2}else{let R=P.multiplyByPoint(y,a.positionWC,uyt);if(n=h.UNIT_Z,i=P.multiplyByPointAsVector(y,a.directionWC,myt),i=h.normalize(i,i),o=R.z,d instanceof Qd){let C=q.getColumn(S.halfAxes,2,hyt),E=h.magnitude(C);r=Z.z-E,s=Z.z+E}else if(d instanceof Zg){let C=S.radius;r=Z.z-C,s=Z.z+C}}}let u=e.dynamicScreenSpaceErrorHeightFalloff,m=r+(s-r)*u,p=s,b=W.clamp((o-m)/(p-m),0,1),f=1-Math.abs(h.dot(i,n));f=f*(1-b),e._dynamicScreenSpaceErrorComputedDensity=e.dynamicScreenSpaceErrorDensity*f}function pyt(e,t){if(t.hasEmptyContent)return;let{statistics:n}=e,i=t.contentExpired,o=t.requestContent();l(o)&&(o.then(r=>{!l(r)||t.isDestroyed()||e.isDestroyed()||(e._processingQueue.push(t),++n.numberOfTilesProcessing)}).catch(r=>{q1e(r,e,t)}),i&&(t.hasTilesetContent||t.hasImplicitContent?eCe(e,t):(n.decrementLoadCounts(t.content),--n.numberOfTilesWithContentReady)),e._requestedTilesInFlight.push(t))}function j1e(e,t){return e._priority-t._priority}ur.prototype.postPassesUpdate=function(e){l(this._root)&&(byt(this,e),Iyt(this,e),this._cache.unloadTiles(this,tCe),vyt(this,e),this._styleApplied&&this._styleEngine.resetDirty(),this._styleApplied=!1)};function Q1e(e){e._removeClippingPolygonAdded=e._removeClippingPolygonAdded&&e._removeClippingPolygonAdded(),e._removeClippingPolygonRemoved=e._removeClippingPolygonRemoved&&e._removeClippingPolygonRemoved();let t=e._clippingPolygons;if(!l(t))return;let n=()=>{e._clippingPolygonsNeedRebake=!0};e._removeClippingPolygonAdded=t.polygonAdded.addEventListener(n),e._removeClippingPolygonRemoved=t.polygonRemoved.addEventListener(n)}ur.prototype.prePassesUpdate=function(e){if(!l(this._root))return;Zyt(this,e);let t=this._clippingPlanes;this._clippingPlanesOriginMatrixDirty=!0,l(t)&&t.enabled&&t.update(e);let n=this._clippingPolygons;l(n)&&n.enabled&&n.update(e),this._clippingPolygonsNeedRebake&&(this._clippingPolygonsNeedRebake=!1,this._cache.forEachLoadedTile(i=>{i.clippingPolygonsNeedRebake=!0})),l(this._loadTimestamp)||(this._loadTimestamp=Q.clone(e.time)),this._timeSinceLoad=Math.max(Q.secondsDifference(e.time,this._loadTimestamp)*1e3,0),this.dynamicScreenSpaceError&&fyt(this,e),e.newFrame&&this._cache.reset()};function byt(e,t){let n=e._requestedTilesInFlight,i=0;for(let o=0;o<n.length;++o){let r=n[o],s=t.frameNumber-r._touchedFrame>=1;if(r._contentState!==Fo.LOADING){++i;continue}else if(s){r.cancelRequests(),++i;continue}i>0&&(n[o-i]=r)}n.length-=i}function gyt(e){let t=e._requestedTiles;t.sort(j1e);for(let n=0;n<t.length;++n)pyt(e,t[n])}function q1e(e,t,n){if(t.isDestroyed())return;let i;n.isDestroyed()||(i=n._contentResource.url);let o=l(e.message)?e.message:e.toString();t.tileFailed.numberOfListeners>0?t.tileFailed.raiseEvent({url:i,message:o}):(console.log(`A 3D tile failed to load: ${i}`),console.log(`Error: ${o}`),console.log(e.stack))}function yyt(e){let t=e._processingQueue,n=0;for(let i=0;i<t.length;++i){let o=t[i];if(o.isDestroyed()||o._contentState!==Fo.PROCESSING){++n;continue}n>0&&(t[i-n]=o)}t.length-=n}var xyt=new pe,Tyt=new pe,_yt=new h;function Syt(e,t,n){if(!e.enableCollision||!e.show||t._wasSelectedLastFrame)return;let i=e._addHeightCallbacks,o=t.boundingSphere,r=i.length;for(let s=0;s<r;++s){let a=i[s];if(a.invoked)continue;let c=a.ellipsoid,d=pe.clone(a.positionCartographic,xyt),u=pe.fromCartesian(o.center,c,Tyt);l(u)&&(d.height=u.height);let m=pe.toCartesian(d,c,_yt);h.distance(m,o.center)<=o.radius&&(a.invoked=!0,n.afterRender.push(()=>{l(a.callback)&&a.callback(),a.invoked=!1}))}}function Zyt(e,t){yyt(e);let n=e._processingQueue,{cacheBytes:i,maximumCacheOverflowBytes:o,statistics:r}=e,s=i+o,a=!1;for(let c=0;c<n.length;++c){if(e.totalMemoryUsageInBytes>s){a=!0;break}let d=n[c];try{d.process(e,t),d.contentReady&&(--r.numberOfTilesProcessing,e.tileLoad.raiseEvent(d))}catch(u){--r.numberOfTilesProcessing,q1e(u,e,d)}}e.totalMemoryUsageInBytes<i?Cyt(e):a&&n.length>0&&Ryt(e)}function Ryt(e){e._memoryAdjustedScreenSpaceError*=1.02;let t=e._processingQueue;for(let n=0;n<t.length;++n)t[n].updatePriority();t.sort(j1e)}function Cyt(e){e._memoryAdjustedScreenSpaceError=Math.max(e.memoryAdjustedScreenSpaceError/1.02,e.maximumScreenSpaceError)}var V3=new h,Vyt={maximumFractionDigits:3};function J1e(e){let t=e/1048576;return t<1?t.toLocaleString(void 0,Vyt):Math.round(t).toLocaleString()}function Gee(e){let{halfAxes:t,radius:n,center:i}=e.boundingVolume.boundingVolume,o=h.clone(i,V3);if(l(t))o.x+=.75*(t[0]+t[3]+t[6]),o.y+=.75*(t[1]+t[4]+t[7]),o.z+=.75*(t[2]+t[5]+t[8]);else if(l(n)){let r=h.normalize(i,V3);r=h.multiplyByScalar(r,.75*n,V3),o=h.add(r,i,V3)}return o}function Lee(e,t,n){let i="",o=0;if(t.debugShowGeometricError&&(i+=` Geometric error: ${e.geometricError}`,o++),t.debugShowRenderingStatistics&&(i+=` Commands: ${e.commandsLength}`,o++,e.content.pointsLength>0&&(i+=` Points: ${e.content.pointsLength}`,o++),e.content.trianglesLength>0&&(i+=` Triangles: ${e.content.trianglesLength}`,o++),i+=` Features: ${e.content.featuresLength}`,o++),t.debugShowMemoryUsage&&(i+=` -Texture Memory: ${sZe(e.content.texturesByteLength)}`,i+=` -Geometry Memory: ${sZe(e.content.geometryByteLength)}`,o+=2),t.debugShowUrl)if(e.hasMultipleContents){i+=` +Texture Memory: ${J1e(e.content.texturesByteLength)}`,i+=` +Geometry Memory: ${J1e(e.content.geometryByteLength)}`,o+=2),t.debugShowUrl)if(e.hasMultipleContents){i+=` Urls:`;let s=e.content.innerContentUrls;for(let a=0;a<s.length;a++)i+=` - ${s[a]}`;o+=s.length}else i+=` -Url: ${e._contentHeader.uri}`,o++;let r={text:i.substring(1),position:n,font:`${19-o}px sans-serif`,showBackground:!0,disableDepthTestDistance:Number.POSITIVE_INFINITY};return t._tileDebugLabels.add(r)}function jft(e,t){let n=e._selectedTiles,i=n.length,o=e._emptyTiles,r=o.length;if(e._tileDebugLabels.removeAll(),e.debugPickedTileLabelOnly){if(l(e.debugPickedTile)){let s=l(e.debugPickPosition)?e.debugPickPosition:P$(e.debugPickedTile),a=X$(e.debugPickedTile,e,s);a.pixelOffset=new k(15,-15)}}else{for(let s=0;s<i;++s){let a=n[s];X$(a,e,P$(a))}for(let s=0;s<r;++s){let a=o[s];(a.hasTilesetContent||a.hasImplicitContent)&&X$(a,e,P$(a))}}e._tileDebugLabels.update(t)}function Qft(e,t,n){e._styleEngine.applyStyle(e),e._styleApplied=!0;let{commandList:i,context:o}=t,r=i.length,s=e._selectedTiles,a=e.isSkippingLevelOfDetail&&e._hasMixedContent&&o.stencilBuffer&&s.length>0;e._backfaceCommands.length=0,a&&(l(e._stencilClearCommand)||(e._stencilClearCommand=new ui({stencil:0,pass:Le.CESIUM_3D_TILE,renderState:ze.fromCache({stencilMask:Jt.SKIP_LOD_MASK})})),i.push(e._stencilClearCommand));let{statistics:c,tileVisible:d}=e,u=n.isRender,m=i.length;for(let f=0;f<s.length;++f){let y=s[f];u&&d.raiseEvent(y),Bft(e,y,t),y.update(e,t,n),c.incrementSelectionCounts(y.content),++c.selected}let p=e._emptyTiles;for(let f=0;f<p.length;++f)p[f].update(e,t,n);let b=i.length-m;if(e._backfaceCommands.trim(),a){let f=e._backfaceCommands.values,y=f.length;i.length+=y;for(let _=b-1;_>=0;--_)i[m+y+_]=i[m+_];for(let _=0;_<y;++_)i[m+_]=f[_]}b=i.length-r,c.numberOfCommands=b,u&&(e.pointCloudShading.attenuation&&e.pointCloudShading.eyeDomeLighting&&b>0&&e._pointCloudEyeDomeLighting.update(t,r,e.pointCloudShading,e.boundingSphere),e.debugShowGeometricError||e.debugShowRenderingStatistics||e.debugShowMemoryUsage||e.debugShowUrl?(l(e._tileDebugLabels)||(e._tileDebugLabels=new Jp),jft(e,t)):e._tileDebugLabels=e._tileDebugLabels&&e._tileDebugLabels.destroy())}var dZe=[],qft=[];function uZe(e,t){let n=t,i=dZe;for(i.push(t);i.length>0;){t=i.pop();let o=t.children;for(let r=0;r<o.length;++r)i.push(o[r]);t!==n&&(npt(e,t),--e._statistics.numberOfTilesTotal)}n.children=[]}function mZe(e,t){e.tileUnload.raiseEvent(t),e._statistics.decrementLoadCounts(t.content),--e._statistics.numberOfTilesWithContentReady,t.unloadContent()}function e3(e,t){let n=e-t;return n<0?n+Nx.maximumFrameNumber:n}var $ft=64;function ept(e,t,n){let i=qft;for(i.length=0,i.push(e);i.length>0;){let o=i.pop(),r=o._contentState;if(r===Fo.LOADING||r===Fo.PROCESSING||!o.hasEmptyContent&&!o.hasTilesetContent&&r!==Fo.UNLOADED&&r!==Fo.FAILED||l(o.cacheNode)||Math.min(e3(t,o._visitedFrame),e3(t,o._touchedFrame),e3(t,o._selectedFrame),e3(t,o._requestedFrame))<n)return i.length=0,!0;let c=o.children;for(let d=0;d<c.length;++d)i.push(c[d])}return!1}function tpt(e,t){let n=e._externalTilesetTiles,i=t.frameNumber,o=e._externalTilesetIdleFrames,r=e._externalTilesetSweepCount,s=0,a=0;for(;s<r&&a<$ft&&n.length>0;){++a,e._externalTilesetSweepIndex>=n.length&&(e._externalTilesetSweepIndex=0);let c=e._externalTilesetSweepIndex,d=n[c];if(d.isDestroyed()||!d.hasTilesetContent||d.children.length===0){n.splice(c,1);continue}++e._externalTilesetSweepIndex,++s,!ept(d,i,o)&&(uZe(e,d),d.unloadTilesetContent(),n.splice(c,1),e._externalTilesetSweepIndex=c)}}function npt(e,t){e._cache.unloadTile(e,t,mZe),t.destroy()}ur.prototype.trimLoadedTiles=function(){this._cache.trim()};function ipt(e,t){let n=e._statistics,i=e._statisticsLast,o=n.numberOfPendingRequests,r=n.numberOfTilesProcessing,s=i.numberOfPendingRequests,a=i.numberOfTilesProcessing;Cf.clone(n,i);let c=o!==s||r!==a;c&&t.afterRender.push(function(){return e.loadProgress.raiseEvent(o,r),!0}),e._tilesLoaded=n.numberOfPendingRequests===0&&n.numberOfTilesProcessing===0&&n.numberOfAttemptedRequests===0,c&&e._tilesLoaded&&(t.afterRender.push(function(){return e.allTilesLoaded.raiseEvent(),!0}),e._initialTilesLoaded||(e._initialTilesLoaded=!0,t.afterRender.push(function(){return e.initialTilesLoaded.raiseEvent(),!0})))}function opt(e){e._heatmap.resetMinimumMaximum(),e._minimumPriority.depth=Number.MAX_VALUE,e._maximumPriority.depth=-Number.MAX_VALUE,e._minimumPriority.foveatedFactor=Number.MAX_VALUE,e._maximumPriority.foveatedFactor=-Number.MAX_VALUE,e._minimumPriority.distance=Number.MAX_VALUE,e._maximumPriority.distance=-Number.MAX_VALUE,e._minimumPriority.reverseScreenSpaceError=Number.MAX_VALUE,e._maximumPriority.reverseScreenSpaceError=-Number.MAX_VALUE}function rpt(e,t){t.frameNumber===e._updatedModelMatrixFrame&&l(e._previousModelMatrix)||(e._updatedModelMatrixFrame=t.frameNumber,e._modelMatrixChanged=!P.equals(e.modelMatrix,e._previousModelMatrix),e._modelMatrixChanged&&(e._previousModelMatrix=P.clone(e.modelMatrix,e._previousModelMatrix)))}function spt(e,t,n,i){if(t.mode===se.MORPHING||!l(e._root))return!1;let o=e._statistics;o.clear(),++e._updatedVisibilityFrame,opt(e),rpt(e,t),e._cullRequestsWhileMoving=e.cullRequestsWhileMoving&&!e._modelMatrixChanged;let r=e.getTraversal(i).selectTiles(e,t);if(i.requestTiles&&wft(e),Qft(e,t,i),Cf.clone(o,n),i.isRender){let s=e._credits;if(l(s)&&o.selected!==0)for(let a=0;a<s.length;++a){let c=s[a];t.creditDisplay.addCreditToNextFrame(c)}}return r}function hZe(e){let t=e._credits;l(t)||(t=[]),t.length=0,l(e.resource.credits)&&e.resource.credits.forEach(i=>{t.push(Lt.clone(i))});let n=e.asset.extras;if(l(n)&&l(n.cesium)&&l(n.cesium.credits)){let i=n.cesium.credits;for(let o=0;o<i.length;++o){let r=i[o];t.push(new Lt(r.html))}}t.forEach(i=>i.showOnScreen=i.showOnScreen||e._showCreditsOnScreen),e._credits=t}ur.prototype.getTraversal=function(e){let{pass:t}=e;return t===lr.MOST_DETAILED_PRELOAD||t===lr.MOST_DETAILED_PICK?iY:this.isSkippingLevelOfDetail?lY:sY};ur.prototype.update=function(e){this.updateForPass(e,e.tilesetPassState)};ur.prototype.updateForPass=function(e,t){this.imageryLayers._update();let n=t.pass;if(n===lr.PRELOAD&&(!this.preloadWhenHidden||this.show)||n===lr.PRELOAD_FLIGHT&&(!this.preloadFlightDestinations||!this.show&&!this.preloadWhenHidden)||n===lr.REQUEST_RENDER_MODE_DEFER_CHECK&&(!this._cullRequestsWhileMoving&&this.foveatedTimeDelay<=0||!this.show))return;let i=e.commandList,o=e.camera,r=e.cullingVolume;t.ready=!1;let s=lr.getPassOptions(n),a=s.ignoreCommands,c=t.commandList??i,d=c.length;if(e.commandList=c,e.camera=t.camera??o,e.cullingVolume=t.cullingVolume??r,s.isRender){let m=this._environmentMapManager;l(this._root)&&(m.position=this.boundingSphere.center),m.update(e)}let u=this._statisticsPerPass[n];(this.show||a)&&(this._pass=n,t.ready=spt(this,e,u,s)),a&&(c.length=d),e.commandList=i,e.camera=o,e.cullingVolume=r};ur.prototype.hasExtension=function(e){return l(this._extensionsUsed)?this._extensionsUsed.indexOf(e)>-1:!1};ur.prototype.isDestroyed=function(){return!1};ur.prototype.destroy=function(){if(this._tileDebugLabels=this._tileDebugLabels&&this._tileDebugLabels.destroy(),this._removeClippingPolygonAdded=this._removeClippingPolygonAdded&&this._removeClippingPolygonAdded(),this._removeClippingPolygonRemoved=this._removeClippingPolygonRemoved&&this._removeClippingPolygonRemoved(),this._clippingPlanes=this._clippingPlanes&&this._clippingPlanes.destroy(),this._clippingPolygons=void 0,l(this._root)){let e=dZe;for(e.push(this._root);e.length>0;){let t=e.pop();t.destroy();let n=t.children;for(let i=0;i<n.length;++i)e.push(n[i])}}return this._root=void 0,this._shouldDestroyImageBasedLighting&&!this._imageBasedLighting.isDestroyed()&&this._imageBasedLighting.destroy(),this._imageBasedLighting=void 0,this._environmentMapManager.isDestroyed()||this._environmentMapManager.destroy(),this._environmentMapManager=void 0,this._imageryLayers.isDestroyed()||(this.imageryLayers.layerAdded.removeEventListener(this._imageryLayersListener),this.imageryLayers.layerRemoved.removeEventListener(this._imageryLayersListener),this.imageryLayers.layerMoved.removeEventListener(this._imageryLayersListener),this.imageryLayers.layerShownOrHidden.removeEventListener(this._imageryLayersListener),this._imageryLayers.destroy()),this._imageryLayers=void 0,ue(this)};ur.supportedExtensions={"3DTILES_metadata":!0,"3DTILES_implicit_tiling":!0,"3DTILES_content_gltf":!0,"3DTILES_content_gltf_vector":!0,"3DTILES_multiple_contents":!0,"3DTILES_bounding_volume_S2":!0,"3DTILES_batch_table_hierarchy":!0,"3DTILES_draco_point_compression":!0,MAXAR_content_geojson:!0};ur.checkSupportedExtensions=function(e){for(let t=0;t<e.length;t++)if(!ur.supportedExtensions[e[t]])throw new ae(`Unsupported 3D Tiles Extension: ${e[t]}`)};var apt=new gn,cpt=new h,lpt=new h,dpt=new pe;ur.prototype.getHeight=function(e,t){let n=t.ellipsoid;l(n)||(n=ne.WGS84);let i=apt,o=n.cartographicToCartesian(e,cpt),r=n.geodeticSurfaceNormal(o,i.direction);i.origin=h.add(o,h.multiplyByScalar(r,2*n.maximumRadius,i.origin),i.origin),i.direction=h.negate(r,i.direction);let s=this.pick(i,t.frameState,lpt,this.maximumHeightQueryGeometricError);if(l(s))return n.cartesianToCartographic(s,dpt)?.height};ur.prototype.updateHeight=function(e,t,n){n=n??ne.WGS84;let i={positionCartographic:e,ellipsoid:n,callback:t,invoked:!1},o=()=>{let r=this._addHeightCallbacks,s=r.length;for(let a=0;a<s;++a)if(r[a]===i){r.splice(a,1);break}i.callback&&(i.callback=void 0)};return this._addHeightCallbacks.push(i),o};var upt=new h;ur.prototype.pick=function(e,t,n,i){if(!t.context.webgl2&&!this._enablePick)return;let o=this._selectedTiles,r=o.length,s=[],a=e.origin.x,c=e.origin.y,d=e.origin.z,u=e.direction.x,m=e.direction.y,p=e.direction.z,b=u*u+m*m+p*p;for(let S=0;S<r;++S){let Z=o[S];if(l(i)&&Z.geometricError>i||!l(Z.content))continue;let R=Z.contentBoundingVolume.boundingSphere,C=R.center,E=a-C.x,A=c-C.y,L=d-C.z,F=2*(u*E+m*A+p*L),I=E*E+A*A+L*L-R.radius*R.radius;F*F-4*b*I<0||s.push(Z)}let f=s.length,y,_=Number.POSITIVE_INFINITY;for(let S=0;S<f;++S){let R=s[S].content.pick(e,t,upt);if(l(R)){let C=h.distanceSquared(R,e.origin);C<_&&(_=C,y=h.clone(R,n))}}return y};ur.prototype.isGltfExtensionUsed=function(e){if(this.hasExtension("3DTILES_content_gltf")){if(!l(this.extensions))return!1;let t=this.extensions["3DTILES_content_gltf"]?.extensionsUsed;return l(t)?t.indexOf(e)>-1:!1}return!1};ur.prototype.isGltfExtensionRequired=function(e){if(this.isGltfExtensionUsed(e)){let t=this.extensions["3DTILES_content_gltf"].extensionsRequired;return l(t)?t.indexOf(e)>-1:!1}return!1};var zr=ur;var mpt=new P;function Mx(e,t){t.collectionChanged.addEventListener(Mx.prototype._onCollectionChanged,this),this._scene=e,this._primitives=e.primitives,this._entityCollection=t,this._tilesetHash={},this._entitiesToVisualize=new kt,this._onCollectionChanged(t,t.values,[],[])}Mx.prototype.update=function(e){let t=this._entitiesToVisualize.values,n=this._tilesetHash,i=this._primitives;for(let o=0,r=t.length;o<r;o++){let s=t[o],a=s._tileset,c,d=n[s.id],u=s.isShowing&&s.isAvailable(e)&&j.getValueOrDefault(a._show,e,!0),m;u&&(m=s.computeModelMatrix(e,mpt),c=ve.createIfNeeded(j.getValueOrUndefined(a._uri,e)));let p=l(d)?d.tilesetPrimitive:void 0;if(!u){l(p)&&(p.show=!1);continue}(!l(d)||c.url!==d.url)&&(l(p)&&i.removeAndDestroy(p),delete n[s.id],hpt(c,n,s,i)),l(p)&&(p.show=!0,l(m)&&(p.modelMatrix=m),p.maximumScreenSpaceError=j.getValueOrDefault(a.maximumScreenSpaceError,e,p.maximumScreenSpaceError))}return!0};Mx.prototype.isDestroyed=function(){return!1};Mx.prototype.destroy=function(){this._entityCollection.collectionChanged.removeEventListener(Mx.prototype._onCollectionChanged,this);let e=this._entitiesToVisualize.values,t=this._tilesetHash,n=this._primitives;for(let i=e.length-1;i>-1;i--)N$(this,e[i],t,n);return ue(this)};Mx.prototype.getBoundingSphere=function(e,t){let n=this._tilesetHash[e.id];if(!l(n)||n.loadFail)return Wt.FAILED;let i=n.tilesetPrimitive;return l(i)?i.show?(me.clone(i.boundingSphere,t),Wt.DONE):Wt.FAILED:Wt.PENDING};Mx.prototype._onCollectionChanged=function(e,t,n,i){let o,r,s=this._entitiesToVisualize,a=this._tilesetHash,c=this._primitives;for(o=t.length-1;o>-1;o--)r=t[o],l(r._tileset)&&s.set(r.id,r);for(o=i.length-1;o>-1;o--)r=i[o],l(r._tileset)?s.set(r.id,r):(N$(this,r,a,c),s.remove(r.id));for(o=n.length-1;o>-1;o--)r=n[o],N$(this,r,a,c),s.remove(r.id)};function N$(e,t,n,i){let o=n[t.id];l(o)&&(l(o.tilesetPrimitive)&&i.removeAndDestroy(o.tilesetPrimitive),delete n[t.id])}async function hpt(e,t,n,i){t[n.id]={url:e.url,loadFail:!1};try{let o=await zr.fromUrl(e);if(o.id=n,i.add(o),!l(t[n.id]))return;t[n.id].tilesetPrimitive=o}catch(o){console.error(o),t[n.id].loadFail=!0}}var dY=Mx;var zEi=x(T(),1);var fpt=U.WHITE,ppt=U.BLACK,bpt=new k(2,2);function fV(e){e=e??B.EMPTY_OBJECT,this._definitionChanged=new Se,this._evenColor=void 0,this._evenColorSubscription=void 0,this._oddColor=void 0,this._oddColorSubscription=void 0,this._repeat=void 0,this._repeatSubscription=void 0,this.evenColor=e.evenColor,this.oddColor=e.oddColor,this.repeat=e.repeat}Object.defineProperties(fV.prototype,{isConstant:{get:function(){return j.isConstant(this._evenColor)&&j.isConstant(this._oddColor)&&j.isConstant(this._repeat)}},definitionChanged:{get:function(){return this._definitionChanged}},evenColor:be("evenColor"),oddColor:be("oddColor"),repeat:be("repeat")});fV.prototype.getType=function(e){return"Checkerboard"};var gpt=new Q;fV.prototype.getValue=function(e,t){return l(e)||(e=Q.now(gpt)),l(t)||(t={}),t.lightColor=j.getValueOrClonedDefault(this._evenColor,e,fpt,t.lightColor),t.darkColor=j.getValueOrClonedDefault(this._oddColor,e,ppt,t.darkColor),t.repeat=j.getValueOrDefault(this._repeat,e,bpt),t};fV.prototype.equals=function(e){return this===e||e instanceof fV&&j.equals(this._evenColor,e._evenColor)&&j.equals(this._oddColor,e._oddColor)&&j.equals(this._repeat,e._repeat)};var pV=fV;var dAi=x(T(),1);var iAi=x(T(),1);var fZe={id:void 0};function uY(e){if(e._firing){e._refire=!0;return}if(e._suspendCount===0){let t=e._addedEntities,n=e._removedEntities,i=e._changedEntities;if(i.length!==0||t.length!==0||n.length!==0){e._firing=!0;do{e._refire=!1;let o=t.values.slice(0),r=n.values.slice(0),s=i.values.slice(0);t.removeAll(),n.removeAll(),i.removeAll(),e._collectionChanged.raiseEvent(e,o,r,s)}while(e._refire);e._firing=!1}}}function hl(e){this._owner=e,this._entities=new kt,this._addedEntities=new kt,this._removedEntities=new kt,this._changedEntities=new kt,this._suspendCount=0,this._collectionChanged=new Se,this._id=Qn(),this._show=!0,this._firing=!1,this._refire=!1}hl.prototype.suspendEvents=function(){this._suspendCount++};hl.prototype.resumeEvents=function(){this._suspendCount--,uY(this)};Object.defineProperties(hl.prototype,{collectionChanged:{get:function(){return this._collectionChanged}},id:{get:function(){return this._id}},values:{get:function(){return this._entities.values}},show:{get:function(){return this._show},set:function(e){if(e===this._show)return;this.suspendEvents();let t,n=[],i=this._entities.values,o=i.length;for(t=0;t<o;t++)n.push(i[t].isShowing);for(this._show=e,t=0;t<o;t++){let r=n[t],s=i[t];r!==s.isShowing&&s.definitionChanged.raiseEvent(s,"isShowing",s.isShowing,r)}this.resumeEvents()}},owner:{get:function(){return this._owner}}});hl.prototype.computeAvailability=function(){let e=ot.MAXIMUM_VALUE,t=ot.MINIMUM_VALUE,n=this._entities.values;for(let i=0,o=n.length;i<o;i++){let s=n[i].availability;if(l(s)){let a=s.start,c=s.stop;Q.lessThan(a,e)&&!a.equals(ot.MINIMUM_VALUE)&&(e=a),Q.greaterThan(c,t)&&!c.equals(ot.MAXIMUM_VALUE)&&(t=c)}}return ot.MAXIMUM_VALUE.equals(e)&&(e=ot.MINIMUM_VALUE),ot.MINIMUM_VALUE.equals(t)&&(t=ot.MAXIMUM_VALUE),new Cn({start:e,stop:t})};hl.prototype.add=function(e){e instanceof er||(e=new er(e));let t=e.id,n=this._entities;if(n.contains(t))throw new ge(`An entity with id ${t} already exists in this collection.`);return e.entityCollection=this,n.set(t,e),this._removedEntities.remove(t)||this._addedEntities.set(t,e),e.definitionChanged.addEventListener(hl.prototype._onEntityDefinitionChanged,this),uY(this),e};hl.prototype.remove=function(e){return l(e)?this.removeById(e.id):!1};hl.prototype.contains=function(e){return this._entities.get(e.id)===e};hl.prototype.removeById=function(e){if(!l(e))return!1;let n=this._entities.get(e);return this._entities.remove(e)?(this._addedEntities.remove(e)||(this._removedEntities.set(e,n),this._changedEntities.remove(e)),this._entities.remove(e),n.definitionChanged.removeEventListener(hl.prototype._onEntityDefinitionChanged,this),uY(this),!0):!1};hl.prototype.removeAll=function(){let e=this._entities,t=e.length,n=e.values,i=this._addedEntities,o=this._removedEntities;for(let r=0;r<t;r++){let s=n[r],a=s.id,c=i.get(a);l(c)||(s.definitionChanged.removeEventListener(hl.prototype._onEntityDefinitionChanged,this),o.set(a,s))}e.removeAll(),i.removeAll(),this._changedEntities.removeAll(),uY(this)};hl.prototype.getById=function(e){return this._entities.get(e)};hl.prototype.getOrCreateEntity=function(e){let t=this._entities.get(e);return l(t)||(fZe.id=e,t=new er(fZe),this.add(t)),t};hl.prototype._onEntityDefinitionChanged=function(e){let t=e.id;this._addedEntities.contains(t)||this._changedEntities.set(t,e),uY(this)};var za=hl;var t3={id:void 0},bV=new Array(2);function Y$(e){let t=e.propertyNames,n=t.length;for(let i=0;i<n;i++)e[t[i]]=void 0;e._name=void 0,e._availability=void 0}function pZe(e,t,n,i){bV[0]=n,bV[1]=i.id,t[JSON.stringify(bV)]=i.definitionChanged.addEventListener(Rs.prototype._onDefinitionChanged,e)}function bZe(e,t,n,i){bV[0]=n,bV[1]=i.id;let o=JSON.stringify(bV);t[o](),t[o]=void 0}function wx(e){if(e._shouldRecomposite=!0,e._suspendCount!==0)return;let t=e._collections,n=t.length,i=e._collectionsCopy,o=i.length,r,s,a,c,d,u=e._composite,m=new za(e),p=e._eventHash,b;for(r=0;r<o;r++)for(d=i[r],d.collectionChanged.removeEventListener(Rs.prototype._onCollectionChanged,e),a=d.values,b=d.id,c=a.length-1;c>-1;c--)s=a[c],bZe(e,p,b,s);for(r=n-1;r>=0;r--)for(d=t[r],d.collectionChanged.addEventListener(Rs.prototype._onCollectionChanged,e),a=d.values,b=d.id,c=a.length-1;c>-1;c--){s=a[c],pZe(e,p,b,s);let y=m.getById(s.id);l(y)||(y=u.getById(s.id),l(y)?Y$(y):(t3.id=s.id,y=new er(t3)),m.add(y)),y.merge(s)}e._collectionsCopy=t.slice(0),u.suspendEvents(),u.removeAll();let f=m.values;for(r=0;r<f.length;r++)u.add(f[r]);u.resumeEvents()}function Rs(e,t){this._owner=t,this._composite=new za(this),this._suspendCount=0,this._collections=l(e)?e.slice():[],this._collectionsCopy=[],this._id=Qn(),this._eventHash={},wx(this),this._shouldRecomposite=!1}Object.defineProperties(Rs.prototype,{collectionChanged:{get:function(){return this._composite._collectionChanged}},id:{get:function(){return this._id}},values:{get:function(){return this._composite.values}},owner:{get:function(){return this._owner}}});Rs.prototype.addCollection=function(e,t){l(t)?this._collections.splice(t,0,e):this._collections.push(e),wx(this)};Rs.prototype.removeCollection=function(e){let t=this._collections.indexOf(e);return t!==-1?(this._collections.splice(t,1),wx(this),!0):!1};Rs.prototype.removeAllCollections=function(){this._collections.length=0,wx(this)};Rs.prototype.containsCollection=function(e){return this._collections.indexOf(e)!==-1};Rs.prototype.contains=function(e){return this._composite.contains(e)};Rs.prototype.indexOfCollection=function(e){return this._collections.indexOf(e)};Rs.prototype.getCollection=function(e){return this._collections[e]};Rs.prototype.getCollectionsLength=function(){return this._collections.length};function n3(e,t){return e.indexOf(t)}function gZe(e,t,n){let i=e._collections;if(t=W.clamp(t,0,i.length-1),n=W.clamp(n,0,i.length-1),t===n)return;let o=i[t];i[t]=i[n],i[n]=o,wx(e)}Rs.prototype.raiseCollection=function(e){let t=n3(this._collections,e);gZe(this,t,t+1)};Rs.prototype.lowerCollection=function(e){let t=n3(this._collections,e);gZe(this,t,t-1)};Rs.prototype.raiseCollectionToTop=function(e){let t=n3(this._collections,e);t!==this._collections.length-1&&(this._collections.splice(t,1),this._collections.push(e),wx(this))};Rs.prototype.lowerCollectionToBottom=function(e){let t=n3(this._collections,e);t!==0&&(this._collections.splice(t,1),this._collections.splice(0,0,e),wx(this))};Rs.prototype.suspendEvents=function(){this._suspendCount++,this._composite.suspendEvents()};Rs.prototype.resumeEvents=function(){this._suspendCount--,this._shouldRecomposite&&this._suspendCount===0&&(wx(this),this._shouldRecomposite=!1),this._composite.resumeEvents()};Rs.prototype.computeAvailability=function(){return this._composite.computeAvailability()};Rs.prototype.getById=function(e){return this._composite.getById(e)};Rs.prototype._onCollectionChanged=function(e,t,n){let i=this._collectionsCopy,o=i.length,r=this._composite;r.suspendEvents();let s,a,c,d,u=n.length,m=this._eventHash,p=e.id;for(s=0;s<u;s++){let f=n[s];bZe(this,m,p,f);let y=f.id;for(a=o-1;a>=0;a--)c=i[a].getById(y),l(c)&&(l(d)||(d=r.getById(y),Y$(d)),d.merge(c));l(d)||r.removeById(y),d=void 0}let b=t.length;for(s=0;s<b;s++){let f=t[s];pZe(this,m,p,f);let y=f.id;for(a=o-1;a>=0;a--)c=i[a].getById(y),l(c)&&(l(d)||(d=r.getById(y),l(d)?Y$(d):(t3.id=y,d=new er(t3),r.add(d))),d.merge(c));d=void 0}r.resumeEvents()};Rs.prototype._onDefinitionChanged=function(e,t,n,i){let o=this._collections,r=this._composite,s=o.length,a=e.id,c=r.getById(a),d=c[t],u=!l(d),m=!0;for(let p=s-1;p>=0;p--){let b=o[p].getById(e.id);if(l(b)){let f=b[t];if(l(f)){if(m)if(m=!1,l(f.merge)&&l(f.clone))d=f.clone(d);else{d=f;break}d.merge(f)}}}u&&c.propertyNames.indexOf(t)===-1&&c.addProperty(t),c[t]=d};var M$=Rs;var YAi=x(T(),1);var WAi=x(T(),1);var mAi=x(T(),1);function w$(){this._removalFunctions=[]}w$.prototype.add=function(e,t,n){let i=e.addEventListener(t,n);this._removalFunctions.push(i);let o=this;return function(){i();let r=o._removalFunctions;r.splice(r.indexOf(i),1)}};w$.prototype.removeAll=function(){let e=this._removalFunctions;for(let t=0,n=e.length;t<n;++t)e[t]();e.length=0};var Hr=w$;var ZAi=x(T(),1);function D$(e,t){return Q.compare(e.start,t.start)}function Cs(e){if(this._intervals=[],this._changedEvent=new Se,l(e)){let t=e.length;for(let n=0;n<t;n++)this.addInterval(e[n])}}Object.defineProperties(Cs.prototype,{changedEvent:{get:function(){return this._changedEvent}},start:{get:function(){let e=this._intervals;return e.length===0?void 0:e[0].start}},isStartIncluded:{get:function(){let e=this._intervals;return e.length===0?!1:e[0].isStartIncluded}},stop:{get:function(){let e=this._intervals,t=e.length;return t===0?void 0:e[t-1].stop}},isStopIncluded:{get:function(){let e=this._intervals,t=e.length;return t===0?!1:e[t-1].isStopIncluded}},length:{get:function(){return this._intervals.length}},isEmpty:{get:function(){return this._intervals.length===0}}});Cs.prototype.equals=function(e,t){if(this===e)return!0;if(!(e instanceof Cs))return!1;let n=this._intervals,i=e._intervals,o=n.length;if(o!==i.length)return!1;for(let r=0;r<o;r++)if(!Cn.equals(n[r],i[r],t))return!1;return!0};Cs.prototype.get=function(e){return this._intervals[e]};Cs.prototype.removeAll=function(){this._intervals.length>0&&(this._intervals.length=0,this._changedEvent.raiseEvent(this))};Cs.prototype.findIntervalContainingDate=function(e){let t=this.indexOf(e);return t>=0?this._intervals[t]:void 0};Cs.prototype.findDataForIntervalContainingDate=function(e){let t=this.indexOf(e);return t>=0?this._intervals[t].data:void 0};Cs.prototype.contains=function(e){return this.indexOf(e)>=0};var k$=new Cn;Cs.prototype.indexOf=function(e){let t=this._intervals;k$.start=e,k$.stop=e;let n=Eo(t,k$,D$);return n>=0?t[n].isStartIncluded?n:n>0&&t[n-1].stop.equals(e)&&t[n-1].isStopIncluded?n-1:~n:(n=~n,n>0&&n-1<t.length&&Cn.contains(t[n-1],e)?n-1:~n)};Cs.prototype.findInterval=function(e){e=e??B.EMPTY_OBJECT;let t=e.start,n=e.stop,i=e.isStartIncluded,o=e.isStopIncluded,r=this._intervals;for(let s=0,a=r.length;s<a;s++){let c=r[s];if((!l(t)||c.start.equals(t))&&(!l(n)||c.stop.equals(n))&&(!l(i)||c.isStartIncluded===i)&&(!l(o)||c.isStopIncluded===o))return r[s]}};Cs.prototype.addInterval=function(e,t){if(e.isEmpty)return;let n=this._intervals;if(n.length===0||Q.greaterThan(e.start,n[n.length-1].stop)){n.push(e),this._changedEvent.raiseEvent(this);return}let i=Eo(n,e,D$);i<0?i=~i:i>0&&e.isStartIncluded&&n[i-1].isStartIncluded&&n[i-1].start.equals(e.start)?--i:i<n.length&&!e.isStartIncluded&&n[i].isStartIncluded&&n[i].start.equals(e.start)&&++i;let o;for(i>0&&(o=Q.compare(n[i-1].stop,e.start),(o>0||o===0&&(n[i-1].isStopIncluded||e.isStartIncluded))&&((l(t)?t(n[i-1].data,e.data):n[i-1].data===e.data)?(Q.greaterThan(e.stop,n[i-1].stop)?e=new Cn({start:n[i-1].start,stop:e.stop,isStartIncluded:n[i-1].isStartIncluded,isStopIncluded:e.isStopIncluded,data:e.data}):e=new Cn({start:n[i-1].start,stop:n[i-1].stop,isStartIncluded:n[i-1].isStartIncluded,isStopIncluded:n[i-1].isStopIncluded||e.stop.equals(n[i-1].stop)&&e.isStopIncluded,data:e.data}),n.splice(i-1,1),--i):(o=Q.compare(n[i-1].stop,e.stop),(o>0||o===0&&n[i-1].isStopIncluded&&!e.isStopIncluded)&&n.splice(i,0,new Cn({start:e.stop,stop:n[i-1].stop,isStartIncluded:!e.isStopIncluded,isStopIncluded:n[i-1].isStopIncluded,data:n[i-1].data})),n[i-1]=new Cn({start:n[i-1].start,stop:e.start,isStartIncluded:n[i-1].isStartIncluded,isStopIncluded:!e.isStartIncluded,data:n[i-1].data}))));i<n.length&&(o=Q.compare(e.stop,n[i].start),o>0||o===0&&(e.isStopIncluded||n[i].isStartIncluded));)if(l(t)?t(n[i].data,e.data):n[i].data===e.data)e=new Cn({start:e.start,stop:Q.greaterThan(n[i].stop,e.stop)?n[i].stop:e.stop,isStartIncluded:e.isStartIncluded,isStopIncluded:Q.greaterThan(n[i].stop,e.stop)?n[i].isStopIncluded:e.isStopIncluded,data:e.data}),n.splice(i,1);else if(n[i]=new Cn({start:e.stop,stop:n[i].stop,isStartIncluded:!e.isStopIncluded,isStopIncluded:n[i].isStopIncluded,data:n[i].data}),n[i].isEmpty)n.splice(i,1);else break;n.splice(i,0,e),this._changedEvent.raiseEvent(this)};Cs.prototype.removeInterval=function(e){if(e.isEmpty)return!1;let t=this._intervals,n=Eo(t,e,D$);n<0&&(n=~n);let i=!1;for(n>0&&(Q.greaterThan(t[n-1].stop,e.start)||t[n-1].stop.equals(e.start)&&t[n-1].isStopIncluded&&e.isStartIncluded)&&(i=!0,(Q.greaterThan(t[n-1].stop,e.stop)||t[n-1].isStopIncluded&&!e.isStopIncluded&&t[n-1].stop.equals(e.stop))&&t.splice(n,0,new Cn({start:e.stop,stop:t[n-1].stop,isStartIncluded:!e.isStopIncluded,isStopIncluded:t[n-1].isStopIncluded,data:t[n-1].data})),t[n-1]=new Cn({start:t[n-1].start,stop:e.start,isStartIncluded:t[n-1].isStartIncluded,isStopIncluded:!e.isStartIncluded,data:t[n-1].data})),n<t.length&&!e.isStartIncluded&&t[n].isStartIncluded&&e.start.equals(t[n].start)&&(i=!0,t.splice(n,0,new Cn({start:t[n].start,stop:t[n].start,isStartIncluded:!0,isStopIncluded:!0,data:t[n].data})),++n);n<t.length&&Q.greaterThan(e.stop,t[n].stop);)i=!0,t.splice(n,1);return n<t.length&&e.stop.equals(t[n].stop)&&(i=!0,!e.isStopIncluded&&t[n].isStopIncluded?n+1<t.length&&t[n+1].start.equals(e.stop)&&t[n].data===t[n+1].data?(t.splice(n,1),t[n]=new Cn({start:t[n].start,stop:t[n].stop,isStartIncluded:!0,isStopIncluded:t[n].isStopIncluded,data:t[n].data})):t[n]=new Cn({start:e.stop,stop:e.stop,isStartIncluded:!0,isStopIncluded:!0,data:t[n].data}):t.splice(n,1)),n<t.length&&(Q.greaterThan(e.stop,t[n].start)||e.stop.equals(t[n].start)&&e.isStopIncluded&&t[n].isStartIncluded)&&(i=!0,t[n]=new Cn({start:e.stop,stop:t[n].stop,isStartIncluded:!e.isStopIncluded,isStopIncluded:t[n].isStopIncluded,data:t[n].data})),i&&this._changedEvent.raiseEvent(this),i};Cs.prototype.intersect=function(e,t,n){let i=new Cs,o=0,r=0,s=this._intervals,a=e._intervals;for(;o<s.length&&r<a.length;){let c=s[o],d=a[r];if(Q.lessThan(c.stop,d.start))++o;else if(Q.lessThan(d.stop,c.start))++r;else{if(l(n)||l(t)&&t(c.data,d.data)||!l(t)&&d.data===c.data){let u=Cn.intersect(c,d,new Cn,n);u.isEmpty||i.addInterval(u,t)}Q.lessThan(c.stop,d.stop)||c.stop.equals(d.stop)&&!c.isStopIncluded&&d.isStopIncluded?++o:++r}}return i};Cs.fromJulianDateArray=function(e,t){l(t)||(t=new Cs);let n=e.julianDates,i=n.length,o=e.dataCallback,r=e.isStartIncluded??!0,s=e.isStopIncluded??!0,a=e.leadingInterval??!1,c=e.trailingInterval??!1,d,u=0;a&&(++u,d=new Cn({start:ot.MINIMUM_VALUE,stop:n[0],isStartIncluded:!0,isStopIncluded:!r}),d.data=l(o)?o(d,t.length):t.length,t.addInterval(d));for(let m=0;m<i-1;++m){let p=n[m],b=n[m+1];d=new Cn({start:p,stop:b,isStartIncluded:t.length===u?r:!0,isStopIncluded:m===i-2?s:!1}),d.data=l(o)?o(d,t.length):t.length,t.addInterval(d)}return c&&(d=new Cn({start:n[i-1],stop:ot.MAXIMUM_VALUE,isStartIncluded:!s,isStopIncluded:!0}),d.data=l(o)?o(d,t.length):t.length,t.addInterval(d)),t};var fl=new vh,mY=[0,31,28,31,30,31,30,31,31,30,31,30,31];function U$(e,t,n){l(n)||(n=new Q),Q.toGregorianDate(e,fl);let i=fl.millisecond+t.millisecond,o=fl.second+t.second,r=fl.minute+t.minute,s=fl.hour+t.hour,a=fl.day+t.day,c=fl.month+t.month,d=fl.year+t.year;for(i>=1e3&&(o+=Math.floor(i/1e3),i=i%1e3),o>=60&&(r+=Math.floor(o/60),o=o%60),r>=60&&(s+=Math.floor(r/60),r=r%60),s>=24&&(a+=Math.floor(s/24),s=s%24),mY[2]=Pl(d)?29:28;a>mY[c]||c>=13;)a>mY[c]&&(a-=mY[c],++c),c>=13&&(--c,d+=Math.floor(c/12),c=c%12,++c),mY[2]=Pl(d)?29:28;return fl.millisecond=i,fl.second=o,fl.minute=r,fl.hour=s,fl.day=a,fl.month=c,fl.year=d,Q.fromGregorianDate(fl,n)}var ypt=new Q,xpt=/P(?:([\d.,]+)Y)?(?:([\d.,]+)M)?(?:([\d.,]+)W)?(?:([\d.,]+)D)?(?:T(?:([\d.,]+)H)?(?:([\d.,]+)M)?(?:([\d.,]+)S)?)?/;function yZe(e,t){if(!l(e)||e.length===0)return!1;if(t.year=0,t.month=0,t.day=0,t.hour=0,t.minute=0,t.second=0,t.millisecond=0,e[0]==="P"){let n=e.match(xpt);if(!l(n))return!1;if(l(n[1])&&(t.year=Number(n[1].replace(",","."))),l(n[2])&&(t.month=Number(n[2].replace(",","."))),l(n[3])&&(t.day=Number(n[3].replace(",","."))*7),l(n[4])&&(t.day+=Number(n[4].replace(",","."))),l(n[5])&&(t.hour=Number(n[5].replace(",","."))),l(n[6])&&(t.minute=Number(n[6].replace(",","."))),l(n[7])){let i=Number(n[7].replace(",","."));t.second=Math.floor(i),t.millisecond=i%1*1e3}}else e[e.length-1]!=="Z"&&(e+="Z"),Q.toGregorianDate(Q.fromIso8601(e,ypt),t);return t.year||t.month||t.day||t.hour||t.minute||t.second||t.millisecond}var hY=new vh;Cs.fromIso8601=function(e,t){let n=e.iso8601.split("/"),i=Q.fromIso8601(n[0]),o=Q.fromIso8601(n[1]),r=[];if(!yZe(n[2],hY))r.push(i,o);else{let s=Q.clone(i);for(r.push(s);Q.compare(s,o)<0;)s=U$(s,hY),Q.compare(o,s)<=0&&Q.clone(o,s),r.push(s)}return Cs.fromJulianDateArray({julianDates:r,isStartIncluded:e.isStartIncluded,isStopIncluded:e.isStopIncluded,leadingInterval:e.leadingInterval,trailingInterval:e.trailingInterval,dataCallback:e.dataCallback},t)};Cs.fromIso8601DateArray=function(e,t){return Cs.fromJulianDateArray({julianDates:e.iso8601Dates.map(function(n){return Q.fromIso8601(n)}),isStartIncluded:e.isStartIncluded,isStopIncluded:e.isStopIncluded,leadingInterval:e.leadingInterval,trailingInterval:e.trailingInterval,dataCallback:e.dataCallback},t)};Cs.fromIso8601DurationArray=function(e,t){let n=e.epoch,i=e.iso8601Durations,o=e.relativeToPrevious??!1,r=[],s,a,c=i.length;for(let d=0;d<c;++d)(yZe(i[d],hY)||d===0)&&(o&&l(a)?s=U$(a,hY):s=U$(n,hY),r.push(s),a=s);return Cs.fromJulianDateArray({julianDates:r,isStartIncluded:e.isStartIncluded,isStopIncluded:e.isStopIncluded,leadingInterval:e.leadingInterval,trailingInterval:e.trailingInterval,dataCallback:e.dataCallback},t)};var Vs=Cs;function Tpt(e,t,n,i){function o(){n.raiseEvent(e)}let r=[];t.removeAll();let s=i.length;for(let a=0;a<s;a++){let c=i.get(a);l(c.data)&&r.indexOf(c.data)===-1&&t.add(c.data.definitionChanged,o)}}function JS(){this._eventHelper=new Hr,this._definitionChanged=new Se,this._intervals=new Vs,this._intervals.changedEvent.addEventListener(JS.prototype._intervalsChanged,this)}Object.defineProperties(JS.prototype,{isConstant:{get:function(){return this._intervals.isEmpty}},definitionChanged:{get:function(){return this._definitionChanged}},intervals:{get:function(){return this._intervals}}});var _pt=new Q;JS.prototype.getValue=function(e,t){l(e)||(e=Q.now(_pt));let n=this._intervals.findDataForIntervalContainingDate(e);if(l(n))return n.getValue(e,t)};JS.prototype.equals=function(e){return this===e||e instanceof JS&&this._intervals.equals(e._intervals,j.equals)};JS.prototype._intervalsChanged=function(){Tpt(this,this._eventHelper,this._definitionChanged,this._intervals),this._definitionChanged.raiseEvent(this)};var pl=JS;function kx(){this._definitionChanged=new Se,this._composite=new pl,this._composite.definitionChanged.addEventListener(kx.prototype._raiseDefinitionChanged,this)}Object.defineProperties(kx.prototype,{isConstant:{get:function(){return this._composite.isConstant}},definitionChanged:{get:function(){return this._definitionChanged}},intervals:{get:function(){return this._composite._intervals}}});kx.prototype.getType=function(e){let t=this._composite._intervals.findDataForIntervalContainingDate(e);if(l(t))return t.getType(e)};var Spt=new Q;kx.prototype.getValue=function(e,t){l(e)||(e=Q.now(Spt));let n=this._composite._intervals.findDataForIntervalContainingDate(e);if(l(n))return n.getValue(e,t)};kx.prototype.equals=function(e){return this===e||e instanceof kx&&this._composite.equals(e._composite,j.equals)};kx.prototype._raiseDefinitionChanged=function(){this._definitionChanged.raiseEvent(this)};var gV=kx;var zAi=x(T(),1);function Ux(e){this._referenceFrame=e??Oi.FIXED,this._definitionChanged=new Se,this._composite=new pl,this._composite.definitionChanged.addEventListener(Ux.prototype._raiseDefinitionChanged,this)}Object.defineProperties(Ux.prototype,{isConstant:{get:function(){return this._composite.isConstant}},definitionChanged:{get:function(){return this._definitionChanged}},intervals:{get:function(){return this._composite.intervals}},referenceFrame:{get:function(){return this._referenceFrame},set:function(e){this._referenceFrame=e}}});var Zpt=new Q;Ux.prototype.getValue=function(e,t){return l(e)||(e=Q.now(Zpt)),this.getValueInReferenceFrame(e,Oi.FIXED,t)};Ux.prototype.getValueInReferenceFrame=function(e,t,n){let i=this._composite._intervals.findDataForIntervalContainingDate(e);if(l(i))return i.getValueInReferenceFrame(e,t,n)};Ux.prototype.equals=function(e){return this===e||e instanceof Ux&&this._referenceFrame===e._referenceFrame&&this._composite.equals(e._composite,j.equals)};Ux.prototype._raiseDefinitionChanged=function(){this._definitionChanged.raiseEvent(this)};var hc=Ux;var kLi=x(T(),1);var kGi=x(T(),1);var KAi=x(T(),1),xZe={ROUNDED:0,MITERED:1,BEVELED:2};Object.freeze(xZe);var ro=xZe;var xGi=x(T(),1);var lGi=x(T(),1);var fc=[new h,new h],Rpt=new h,Cpt=new h,Vpt=new h,Ept=new h,Apt=new h,Gpt=new h,Lpt=new h,Wpt=new h,vpt=new h,yV=new h,i3=new h,fY={},O$=new pe;function Fpt(e,t){let n=new Array(e.length);for(let i=0;i<e.length;i++){let o=e[i];O$=t.cartesianToCartographic(o,O$),n[i]=O$.height,e[i]=t.scaleToGeodeticSurface(o,o)}return n}function B$(e,t,n,i){let o=e[0],r=e[1],s=h.angleBetween(o,r),a=Math.ceil(s/i),c=new Array(a),d;if(t===n){for(d=0;d<a;d++)c[d]=t;return c.push(n),c}let m=(n-t)/a;for(d=1;d<a;d++){let p=t+d*m;c[d]=p}return c[0]=t,c.push(n),c}var o3=new h,r3=new h;function Ipt(e,t,n,i){let o=new Ms(n,i),r=o.projectPointOntoPlane(h.add(n,e,o3),o3),s=o.projectPointOntoPlane(h.add(n,t,r3),r3),a=k.angleBetween(r,s);return s.x*r.y-s.y*r.x>=0?-a:a}var Ppt=new h(-1,0,0),jS=new P,Xpt=new P,z$=new q,Npt=q.IDENTITY.clone(),Ypt=new h,Mpt=new ce,TZe=new h;function Tg(e,t,n,i,o,r,s,a){let c=Ypt,d=Mpt;jS=_t.eastNorthUpToFixedFrame(e,o,jS),c=P.multiplyByPointAsVector(jS,Ppt,c),c=h.normalize(c,c);let u=Ipt(c,t,e,o);z$=q.fromRotationZ(u,z$),TZe.z=r,jS=P.multiplyTransformation(jS,P.fromRotationTranslation(z$,TZe,Xpt),jS);let m=Npt;m[0]=s;for(let p=0;p<a;p++)for(let b=0;b<n.length;b+=3)d=h.fromArray(n,b,d),d=q.multiplyByVector(m,d,d),d=P.multiplyByPoint(jS,d,d),i.push(d.x,d.y,d.z);return i}var wpt=new h;function H$(e,t,n,i,o,r,s){for(let a=0;a<e.length;a+=3){let c=h.fromArray(e,a,wpt);i=Tg(c,t,n,i,o,r[a/3],s,1)}return i}function kpt(e,t){let n=e.length,i=new Array(n*6),o=0,r=t.x+t.width/2,s=t.y+t.height/2,a=e[0];i[o++]=a.x-r,i[o++]=0,i[o++]=a.y-s;for(let c=1;c<n;c++){a=e[c];let d=a.x-r,u=a.y-s;i[o++]=d,i[o++]=0,i[o++]=u,i[o++]=d,i[o++]=0,i[o++]=u}return a=e[0],i[o++]=a.x-r,i[o++]=0,i[o]=a.y-s,i}function _Ze(e,t){let n=e.length,i=new Array(n*3),o=0,r=t.x+t.width/2,s=t.y+t.height/2;for(let a=0;a<n;a++)i[o++]=e[a].x-r,i[o++]=0,i[o++]=e[a].y-s;return i}var SZe=new Ne,ZZe=new h,RZe=new q;function CZe(e,t,n,i,o,r,s,a,c,d){let u=h.angleBetween(h.subtract(t,e,yV),h.subtract(n,e,i3)),m=i===ro.BEVELED?0:Math.ceil(u/W.toRadians(5)),p;o?p=q.fromQuaternion(Ne.fromAxisAngle(h.negate(e,yV),u/(m+1),SZe),RZe):p=q.fromQuaternion(Ne.fromAxisAngle(e,u/(m+1),SZe),RZe);let b,f;if(t=h.clone(t,ZZe),m>0){let y=d?2:1;for(let _=0;_<m;_++)t=q.multiplyByVector(p,t,t),b=h.subtract(t,e,yV),b=h.normalize(b,b),o||(b=h.negate(b,b)),f=r.scaleToGeodeticSurface(t,i3),s=Tg(f,b,a,s,r,c,1,y)}else b=h.subtract(t,e,yV),b=h.normalize(b,b),o||(b=h.negate(b,b)),f=r.scaleToGeodeticSurface(t,i3),s=Tg(f,b,a,s,r,c,1,1),n=h.clone(n,ZZe),b=h.subtract(n,e,yV),b=h.normalize(b,b),o||(b=h.negate(b,b)),f=r.scaleToGeodeticSurface(n,i3),s=Tg(f,b,a,s,r,c,1,1);return s}fY.removeDuplicatesFromShape=function(e){let t=e.length,n=[];for(let i=t-1,o=0;o<t;i=o++){let r=e[i],s=e[o];k.equals(r,s)||n.push(s)}return n};fY.angleIsGreaterThanPi=function(e,t,n,i){let o=new Ms(n,i),r=o.projectPointOntoPlane(h.add(n,e,o3),o3),s=o.projectPointOntoPlane(h.add(n,t,r3),r3);return s.x*r.y-s.y*r.x>=0};var Upt=new h,Dpt=new h;fY.computePositions=function(e,t,n,i,o){let r=i._ellipsoid,s=Fpt(e,r),a=i._granularity,c=i._cornerType,d=o?kpt(t,n):_Ze(t,n),u=o?_Ze(t,n):void 0,m=n.height/2,p=n.width/2,b=e.length,f=[],y=o?[]:void 0,_=Rpt,S=Cpt,Z=Vpt,R=Ept,C=Apt,E=Gpt,A=Lpt,L=Wpt,F=vpt,I=e[0],N=e[1];R=r.geodeticSurfaceNormal(I,R),_=h.subtract(N,I,_),_=h.normalize(_,_),L=h.cross(R,_,L),L=h.normalize(L,L);let g=s[0],V=s[1];o&&(y=Tg(I,L,u,y,r,g+m,1,1)),F=h.clone(I,F),I=N,S=h.negate(_,S);let G,v;for(let D=1;D<b-1;D++){let M=o?2:1;if(N=e[D+1],I.equals(N)){xt("Positions are too close and are considered equivalent with rounding error.");continue}_=h.subtract(N,I,_),_=h.normalize(_,_),R=r.geodeticSurfaceNormal(I,R);let O=h.multiplyByScalar(R,h.dot(_,R),Upt);h.subtract(_,O,O),h.normalize(O,O);let w=h.multiplyByScalar(R,h.dot(S,R),Dpt);if(h.subtract(S,w,w),h.normalize(w,w),!W.equalsEpsilon(Math.abs(h.dot(O,w)),1,W.EPSILON7)){Z=h.add(_,S,Z),Z=h.normalize(Z,Z),Z=h.cross(Z,R,Z),Z=h.cross(R,Z,Z),Z=h.normalize(Z,Z);let K=1/Math.max(.25,h.magnitude(h.cross(Z,S,yV))),te=fY.angleIsGreaterThanPi(_,S,I,r);te?(C=h.add(I,h.multiplyByScalar(Z,K*p,Z),C),E=h.add(C,h.multiplyByScalar(L,p,E),E),fc[0]=h.clone(F,fc[0]),fc[1]=h.clone(E,fc[1]),G=B$(fc,g+m,V+m,a),v=oo.generateArc({positions:fc,granularity:a,ellipsoid:r}),f=H$(v,L,d,f,r,G,1),L=h.cross(R,_,L),L=h.normalize(L,L),A=h.add(C,h.multiplyByScalar(L,p,A),A),c===ro.ROUNDED||c===ro.BEVELED?CZe(C,E,A,c,te,r,f,d,V+m,o):(Z=h.negate(Z,Z),f=Tg(I,Z,d,f,r,V+m,K,M)),F=h.clone(A,F)):(C=h.add(I,h.multiplyByScalar(Z,K*p,Z),C),E=h.add(C,h.multiplyByScalar(L,-p,E),E),fc[0]=h.clone(F,fc[0]),fc[1]=h.clone(E,fc[1]),G=B$(fc,g+m,V+m,a),v=oo.generateArc({positions:fc,granularity:a,ellipsoid:r}),f=H$(v,L,d,f,r,G,1),L=h.cross(R,_,L),L=h.normalize(L,L),A=h.add(C,h.multiplyByScalar(L,-p,A),A),c===ro.ROUNDED||c===ro.BEVELED?CZe(C,E,A,c,te,r,f,d,V+m,o):f=Tg(I,Z,d,f,r,V+m,K,M),F=h.clone(A,F)),S=h.negate(_,S)}else f=Tg(F,L,d,f,r,g+m,1,1),F=I;g=V,V=s[D+1],I=N}fc[0]=h.clone(F,fc[0]),fc[1]=h.clone(I,fc[1]),G=B$(fc,g+m,V+m,a),v=oo.generateArc({positions:fc,granularity:a,ellipsoid:r}),f=H$(v,L,d,f,r,G,1),o&&(y=Tg(I,L,u,y,r,V+m,1,1)),b=f.length;let X=o?b+y.length:b,Y=new Float64Array(X);return Y.set(f),o&&Y.set(y,b),Y};var Vf=fY;var J$={},xV=new h,LZe=new h,Opt=new h,VZe=new h,sd=[new h,new h],WZe=new h,vZe=new h,FZe=new h,Bpt=new h,zpt=new h,Hpt=new h,Kpt=new h,Jpt=new h,jpt=new h,Qpt=new h,EZe=new Ne,AZe=new q;function s3(e,t,n,i,o){let r=h.angleBetween(h.subtract(t,e,xV),h.subtract(n,e,LZe)),s=i===ro.BEVELED?1:Math.ceil(r/W.toRadians(5))+1,a=s*3,c=new Array(a);c[a-3]=n.x,c[a-2]=n.y,c[a-1]=n.z;let d;o?d=q.fromQuaternion(Ne.fromAxisAngle(h.negate(e,xV),r/s,EZe),AZe):d=q.fromQuaternion(Ne.fromAxisAngle(e,r/s,EZe),AZe);let u=0;t=h.clone(t,xV);for(let m=0;m<s;m++)t=q.multiplyByVector(d,t,t),c[u++]=t.x,c[u++]=t.y,c[u++]=t.z;return c}function qpt(e){let t=WZe,n=vZe,i=FZe,o=e[1];n=h.fromArray(e[1],o.length-3,n),i=h.fromArray(e[0],0,i),t=h.midpoint(n,i,t);let r=s3(t,n,i,ro.ROUNDED,!1),s=e.length-1,a=e[s-1];o=e[s],n=h.fromArray(a,a.length-3,n),i=h.fromArray(o,0,i),t=h.midpoint(n,i,t);let c=s3(t,n,i,ro.ROUNDED,!1);return[r,c]}function GZe(e,t,n,i){let o=xV;return i?o=h.add(e,t,o):(t=h.negate(t,t),o=h.add(e,t,o)),[o.x,o.y,o.z,n.x,n.y,n.z]}function K$(e,t,n,i){let o=new Array(e.length),r=new Array(e.length),s=h.multiplyByScalar(t,n,xV),a=h.negate(s,LZe),c=0,d=e.length-1;for(let u=0;u<e.length;u+=3){let m=h.fromArray(e,u,Opt),p=h.add(m,a,VZe);o[c++]=p.x,o[c++]=p.y,o[c++]=p.z;let b=h.add(m,s,VZe);r[d--]=b.z,r[d--]=b.y,r[d--]=b.x}return i.push(o,r),i}J$.addAttribute=function(e,t,n,i){let o=t.x,r=t.y,s=t.z;l(n)&&(e[n]=o,e[n+1]=r,e[n+2]=s),l(i)&&(e[i]=s,e[i-1]=r,e[i-2]=o)};var $pt=new h,e0t=new h;J$.computePositions=function(e){let t=e.granularity,n=e.positions,i=e.ellipsoid,o=e.width/2,r=e.cornerType,s=e.saveAttributes,a=WZe,c=vZe,d=FZe,u=Bpt,m=zpt,p=Hpt,b=Kpt,f=Jpt,y=jpt,_=Qpt,S=[],Z=s?[]:void 0,R=s?[]:void 0,C=n[0],E=n[1];c=h.normalize(h.subtract(E,C,c),c),a=i.geodeticSurfaceNormal(C,a),u=h.normalize(h.cross(a,c,u),u),s&&(Z.push(u.x,u.y,u.z),R.push(a.x,a.y,a.z)),b=h.clone(C,b),C=E,d=h.negate(c,d);let A,L=[],F,I=n.length;for(F=1;F<I-1;F++){a=i.geodeticSurfaceNormal(C,a),E=n[F+1],c=h.normalize(h.subtract(E,C,c),c);let g=h.multiplyByScalar(a,h.dot(c,a),$pt);h.subtract(c,g,g),h.normalize(g,g);let V=h.multiplyByScalar(a,h.dot(d,a),e0t);if(h.subtract(d,V,V),h.normalize(V,V),!W.equalsEpsilon(Math.abs(h.dot(g,V)),1,W.EPSILON7)){m=h.normalize(h.add(c,d,m),m),m=h.cross(m,a,m),m=h.cross(a,m,m),m=h.normalize(m,m);let v=o/Math.max(.25,h.magnitude(h.cross(m,d,xV))),X=Vf.angleIsGreaterThanPi(c,d,C,i);m=h.multiplyByScalar(m,v,m),X?(f=h.add(C,m,f),_=h.add(f,h.multiplyByScalar(u,o,_),_),y=h.add(f,h.multiplyByScalar(u,o*2,y),y),sd[0]=h.clone(b,sd[0]),sd[1]=h.clone(_,sd[1]),A=oo.generateArc({positions:sd,granularity:t,ellipsoid:i}),S=K$(A,u,o,S),s&&(Z.push(u.x,u.y,u.z),R.push(a.x,a.y,a.z)),p=h.clone(y,p),u=h.normalize(h.cross(a,c,u),u),y=h.add(f,h.multiplyByScalar(u,o*2,y),y),b=h.add(f,h.multiplyByScalar(u,o,b),b),r===ro.ROUNDED||r===ro.BEVELED?L.push({leftPositions:s3(f,p,y,r,X)}):L.push({leftPositions:GZe(C,h.negate(m,m),y,X)})):(y=h.add(C,m,y),_=h.add(y,h.negate(h.multiplyByScalar(u,o,_),_),_),f=h.add(y,h.negate(h.multiplyByScalar(u,o*2,f),f),f),sd[0]=h.clone(b,sd[0]),sd[1]=h.clone(_,sd[1]),A=oo.generateArc({positions:sd,granularity:t,ellipsoid:i}),S=K$(A,u,o,S),s&&(Z.push(u.x,u.y,u.z),R.push(a.x,a.y,a.z)),p=h.clone(f,p),u=h.normalize(h.cross(a,c,u),u),f=h.add(y,h.negate(h.multiplyByScalar(u,o*2,f),f),f),b=h.add(y,h.negate(h.multiplyByScalar(u,o,b),b),b),r===ro.ROUNDED||r===ro.BEVELED?L.push({rightPositions:s3(y,p,f,r,X)}):L.push({rightPositions:GZe(C,m,f,X)})),d=h.negate(c,d)}C=E}a=i.geodeticSurfaceNormal(C,a),sd[0]=h.clone(b,sd[0]),sd[1]=h.clone(C,sd[1]),A=oo.generateArc({positions:sd,granularity:t,ellipsoid:i}),S=K$(A,u,o,S),s&&(Z.push(u.x,u.y,u.z),R.push(a.x,a.y,a.z));let N;return r===ro.ROUNDED&&(N=qpt(S)),{positions:S,corners:L,lefts:Z,normals:R,endPositions:N}};var bo=J$;var XZe=new h,NZe=new h,a3=new h,c3=new h,t0t=new h,YZe=new h,Dx=new h,TV=new h;function MZe(e,t){for(let n=0;n<e.length;n++)e[n]=t.scaleToGeodeticSurface(e[n],e[n]);return e}function Ef(e,t,n,i,o,r){let s=e.normals,a=e.tangents,c=e.bitangents,d=h.normalize(h.cross(n,t,Dx),Dx);r.normal&&bo.addAttribute(s,t,i,o),r.tangent&&bo.addAttribute(a,d,i,o),r.bitangent&&bo.addAttribute(c,n,i,o)}function wZe(e,t,n){let i=e.positions,o=e.corners,r=e.endPositions,s=e.lefts,a=e.normals,c=new Rn,d=0,u=0,m,p=0,b;for(m=0;m<i.length;m+=2)b=i[m].length-3,d+=b,p+=b*2,u+=i[m+1].length-3;for(d+=3,u+=3,m=0;m<o.length;m++){let $=o[m].leftPositions;l($)?(b=$.length,d+=b,p+=b):(b=o[m].rightPositions.length,u+=b,p+=b)}let f=l(r),y;f&&(y=r[0].length-3,d+=y,u+=y,y/=3,p+=y*6);let _=d+u,S=new Float64Array(_),Z=t.normal?new Float32Array(_):void 0,R=t.tangent?new Float32Array(_):void 0,C=t.bitangent?new Float32Array(_):void 0,E={normals:Z,tangents:R,bitangents:C},A=0,L=_-1,F,I,N,g,V=XZe,G=NZe,v,X,Y=y/2,D=Oe.createTypedArray(_/3,p),M=0;if(f){X=a3,v=c3;let $=r[0];for(V=h.fromArray(a,0,V),G=h.fromArray(s,0,G),m=0;m<Y;m++)X=h.fromArray($,(Y-1-m)*3,X),v=h.fromArray($,(Y+m)*3,v),bo.addAttribute(S,v,A),bo.addAttribute(S,X,void 0,L),Ef(E,V,G,A,L,t),I=A/3,g=I+1,F=(L-2)/3,N=F-1,D[M++]=F,D[M++]=I,D[M++]=N,D[M++]=N,D[M++]=I,D[M++]=g,A+=3,L-=3}let O=0,w=0,z=i[O++],K=i[O++];S.set(z,A),S.set(K,L-K.length+1),G=h.fromArray(s,w,G);let te,H;for(b=K.length-3,m=0;m<b;m+=3)te=n.geodeticSurfaceNormal(h.fromArray(z,m,Dx),Dx),H=n.geodeticSurfaceNormal(h.fromArray(K,b-m,TV),TV),V=h.normalize(h.add(te,H,V),V),Ef(E,V,G,A,L,t),I=A/3,g=I+1,F=(L-2)/3,N=F-1,D[M++]=F,D[M++]=I,D[M++]=N,D[M++]=N,D[M++]=I,D[M++]=g,A+=3,L-=3;for(te=n.geodeticSurfaceNormal(h.fromArray(z,b,Dx),Dx),H=n.geodeticSurfaceNormal(h.fromArray(K,b,TV),TV),V=h.normalize(h.add(te,H,V),V),w+=3,m=0;m<o.length;m++){let $,ee=o[m],le=ee.leftPositions,_e=ee.rightPositions,he,Ze,ye=YZe,Ge=a3,Ae=c3;if(V=h.fromArray(a,w,V),l(le)){for(Ef(E,V,G,void 0,L,t),L-=3,he=g,Ze=N,$=0;$<le.length/3;$++)ye=h.fromArray(le,$*3,ye),D[M++]=he,D[M++]=Ze-$-1,D[M++]=Ze-$,bo.addAttribute(S,ye,void 0,L),Ge=h.fromArray(S,(Ze-$-1)*3,Ge),Ae=h.fromArray(S,he*3,Ae),G=h.normalize(h.subtract(Ge,Ae,G),G),Ef(E,V,G,void 0,L,t),L-=3;ye=h.fromArray(S,he*3,ye),Ge=h.subtract(h.fromArray(S,Ze*3,Ge),ye,Ge),Ae=h.subtract(h.fromArray(S,(Ze-$)*3,Ae),ye,Ae),G=h.normalize(h.add(Ge,Ae,G),G),Ef(E,V,G,A,void 0,t),A+=3}else{for(Ef(E,V,G,A,void 0,t),A+=3,he=N,Ze=g,$=0;$<_e.length/3;$++)ye=h.fromArray(_e,$*3,ye),D[M++]=he,D[M++]=Ze+$,D[M++]=Ze+$+1,bo.addAttribute(S,ye,A),Ge=h.fromArray(S,he*3,Ge),Ae=h.fromArray(S,(Ze+$)*3,Ae),G=h.normalize(h.subtract(Ge,Ae,G),G),Ef(E,V,G,A,void 0,t),A+=3;ye=h.fromArray(S,he*3,ye),Ge=h.subtract(h.fromArray(S,(Ze+$)*3,Ge),ye,Ge),Ae=h.subtract(h.fromArray(S,Ze*3,Ae),ye,Ae),G=h.normalize(h.negate(h.add(Ae,Ge,G),G),G),Ef(E,V,G,void 0,L,t),L-=3}for(z=i[O++],K=i[O++],z.splice(0,3),K.splice(K.length-3,3),S.set(z,A),S.set(K,L-K.length+1),b=K.length-3,w+=3,G=h.fromArray(s,w,G),$=0;$<K.length;$+=3)te=n.geodeticSurfaceNormal(h.fromArray(z,$,Dx),Dx),H=n.geodeticSurfaceNormal(h.fromArray(K,b-$,TV),TV),V=h.normalize(h.add(te,H,V),V),Ef(E,V,G,A,L,t),g=A/3,I=g-1,N=(L-2)/3,F=N+1,D[M++]=F,D[M++]=I,D[M++]=N,D[M++]=N,D[M++]=I,D[M++]=g,A+=3,L-=3;A-=3,L+=3}if(V=h.fromArray(a,a.length-3,V),Ef(E,V,G,A,L,t),f){A+=3,L-=3,X=a3,v=c3;let $=r[1];for(m=0;m<Y;m++)X=h.fromArray($,(y-m-1)*3,X),v=h.fromArray($,m*3,v),bo.addAttribute(S,X,void 0,L),bo.addAttribute(S,v,A),Ef(E,V,G,A,L,t),g=A/3,I=g-1,N=(L-2)/3,F=N+1,D[M++]=F,D[M++]=I,D[M++]=N,D[M++]=N,D[M++]=I,D[M++]=g,A+=3,L-=3}if(c.position=new Xe({componentDatatype:J.DOUBLE,componentsPerAttribute:3,values:S}),t.st){let $=new Float32Array(_/3*2),ee,le,_e=0;if(f){d/=3,u/=3;let he=Math.PI/(y+1);le=1/(d-y+1),ee=1/(u-y+1);let Ze,ye=y/2;for(m=ye+1;m<y+1;m++)Ze=W.PI_OVER_TWO+he*m,$[_e++]=ee*(1+Math.cos(Ze)),$[_e++]=.5*(1+Math.sin(Ze));for(m=1;m<u-y+1;m++)$[_e++]=m*ee,$[_e++]=0;for(m=y;m>ye;m--)Ze=W.PI_OVER_TWO-m*he,$[_e++]=1-ee*(1+Math.cos(Ze)),$[_e++]=.5*(1+Math.sin(Ze));for(m=ye;m>0;m--)Ze=W.PI_OVER_TWO-he*m,$[_e++]=1-le*(1+Math.cos(Ze)),$[_e++]=.5*(1+Math.sin(Ze));for(m=d-y;m>0;m--)$[_e++]=m*le,$[_e++]=1;for(m=1;m<ye+1;m++)Ze=W.PI_OVER_TWO+he*m,$[_e++]=le*(1+Math.cos(Ze)),$[_e++]=.5*(1+Math.sin(Ze))}else{for(d/=3,u/=3,le=1/(d-1),ee=1/(u-1),m=0;m<u;m++)$[_e++]=m*ee,$[_e++]=0;for(m=d;m>0;m--)$[_e++]=(m-1)*le,$[_e++]=1}c.st=new Xe({componentDatatype:J.FLOAT,componentsPerAttribute:2,values:$})}return t.normal&&(c.normal=new Xe({componentDatatype:J.FLOAT,componentsPerAttribute:3,values:E.normals})),t.tangent&&(c.tangent=new Xe({componentDatatype:J.FLOAT,componentsPerAttribute:3,values:E.tangents})),t.bitangent&&(c.bitangent=new Xe({componentDatatype:J.FLOAT,componentsPerAttribute:3,values:E.bitangents})),{attributes:c,indices:D}}function n0t(e,t){if(!t.normal&&!t.tangent&&!t.bitangent&&!t.st)return e;let n=e.position.values,i,o;(t.normal||t.bitangent)&&(i=e.normal.values,o=e.bitangent.values);let r=e.position.values.length/18,s=r*3,a=r*2,c=s*2,d;if(t.normal||t.bitangent||t.tangent){let u=t.normal?new Float32Array(s*6):void 0,m=t.tangent?new Float32Array(s*6):void 0,p=t.bitangent?new Float32Array(s*6):void 0,b=XZe,f=NZe,y=a3,_=c3,S=t0t,Z=YZe,R=c;for(d=0;d<s;d+=3){let C=R+c;b=h.fromArray(n,d,b),f=h.fromArray(n,d+s,f),y=h.fromArray(n,(d+3)%s,y),f=h.subtract(f,b,f),y=h.subtract(y,b,y),_=h.normalize(h.cross(f,y,_),_),t.normal&&(bo.addAttribute(u,_,C),bo.addAttribute(u,_,C+3),bo.addAttribute(u,_,R),bo.addAttribute(u,_,R+3)),(t.tangent||t.bitangent)&&(Z=h.fromArray(i,d,Z),t.bitangent&&(bo.addAttribute(p,Z,C),bo.addAttribute(p,Z,C+3),bo.addAttribute(p,Z,R),bo.addAttribute(p,Z,R+3)),t.tangent&&(S=h.normalize(h.cross(Z,_,S),S),bo.addAttribute(m,S,C),bo.addAttribute(m,S,C+3),bo.addAttribute(m,S,R),bo.addAttribute(m,S,R+3))),R+=6}if(t.normal){for(u.set(i),d=0;d<s;d+=3)u[d+s]=-i[d],u[d+s+1]=-i[d+1],u[d+s+2]=-i[d+2];e.normal.values=u}else e.normal=void 0;if(t.bitangent?(p.set(o),p.set(o,s),e.bitangent.values=p):e.bitangent=void 0,t.tangent){let C=e.tangent.values;m.set(C),m.set(C,s),e.tangent.values=m}}if(t.st){let u=e.st.values,m=new Float32Array(a*6);m.set(u),m.set(u,a);let p=a*2;for(let b=0;b<2;b++){for(m[p++]=u[0],m[p++]=u[1],d=2;d<a;d+=2){let f=u[d],y=u[d+1];m[p++]=f,m[p++]=y,m[p++]=f,m[p++]=y}m[p++]=u[0],m[p++]=u[1]}e.st.values=m}return e}function j$(e,t,n){n[t++]=e[0],n[t++]=e[1],n[t++]=e[2];for(let i=3;i<e.length;i+=3){let o=e[i],r=e[i+1],s=e[i+2];n[t++]=o,n[t++]=r,n[t++]=s,n[t++]=o,n[t++]=r,n[t++]=s}return n[t++]=e[0],n[t++]=e[1],n[t]=e[2],n}function i0t(e,t){let n=new Me({position:t.position,normal:t.normal||t.bitangent||e.shadowVolume,tangent:t.tangent,bitangent:t.normal||t.bitangent,st:t.st}),i=e.ellipsoid,o=bo.computePositions(e),r=wZe(o,n,i),s=e.height,a=e.extrudedHeight,c=r.attributes,d=r.indices,u=c.position.values,m=u.length,p=new Float64Array(m*6),b=new Float64Array(m);b.set(u);let f=new Float64Array(m*4);u=hi.scaleToGeodeticHeight(u,s,i),f=j$(u,0,f),b=hi.scaleToGeodeticHeight(b,a,i),f=j$(b,m*2,f),p.set(u),p.set(b,m),p.set(f,m*2),c.position.values=p,c=n0t(c,t);let y,_=m/3;if(e.shadowVolume){let I=c.normal.values;m=I.length;let N=new Float32Array(m*6);for(y=0;y<m;y++)I[y]=-I[y];N.set(I,m),N=j$(I,m*4,N),c.extrudeDirection=new Xe({componentDatatype:J.FLOAT,componentsPerAttribute:3,values:N}),t.normal||(c.normal=void 0)}if(l(e.offsetAttribute)){let I=new Uint8Array(_*6);if(e.offsetAttribute===bn.TOP)I=I.fill(1,0,_).fill(1,_*2,_*4);else{let N=e.offsetAttribute===bn.NONE?0:1;I=I.fill(N)}c.applyOffset=new Xe({componentDatatype:J.UNSIGNED_BYTE,componentsPerAttribute:1,values:I})}let S=d.length,Z=_+_,R=Oe.createTypedArray(p.length/3,S*2+Z*3);R.set(d);let C=S;for(y=0;y<S;y+=3){let I=d[y],N=d[y+1],g=d[y+2];R[C++]=g+_,R[C++]=N+_,R[C++]=I+_}let E,A,L,F;for(y=0;y<Z;y+=2)E=y+Z,A=E+Z,L=E+1,F=A+1,R[C++]=E,R[C++]=A,R[C++]=L,R[C++]=L,R[C++]=A,R[C++]=F;return{attributes:c,indices:R}}var IZe=new h,pY=new h,ih=new pe;function PZe(e,t,n,i,o,r){let s=h.subtract(t,e,IZe);h.normalize(s,s);let a=n.geodeticSurfaceNormal(e,pY),c=h.cross(s,a,IZe);h.multiplyByScalar(c,i,c);let d=o.latitude,u=o.longitude,m=r.latitude,p=r.longitude;h.add(e,c,pY),n.cartesianToCartographic(pY,ih);let b=ih.latitude,f=ih.longitude;d=Math.min(d,b),u=Math.min(u,f),m=Math.max(m,b),p=Math.max(p,f),h.subtract(e,c,pY),n.cartesianToCartographic(pY,ih),b=ih.latitude,f=ih.longitude,d=Math.min(d,b),u=Math.min(u,f),m=Math.max(m,b),p=Math.max(p,f),o.latitude=d,o.longitude=u,r.latitude=m,r.longitude=p}var nh=new h,bY=new h,Kd=new pe,Jd=new pe;function kZe(e,t,n,i,o){e=MZe(e,t);let r=Yo(e,h.equalsEpsilon),s=r.length;if(s<2||n<=0)return new re;let a=n*.5;Kd.latitude=Number.POSITIVE_INFINITY,Kd.longitude=Number.POSITIVE_INFINITY,Jd.latitude=Number.NEGATIVE_INFINITY,Jd.longitude=Number.NEGATIVE_INFINITY;let c,d;if(i===ro.ROUNDED){let p=r[0];h.subtract(p,r[1],nh),h.normalize(nh,nh),h.multiplyByScalar(nh,a,nh),h.add(p,nh,bY),t.cartesianToCartographic(bY,ih),c=ih.latitude,d=ih.longitude,Kd.latitude=Math.min(Kd.latitude,c),Kd.longitude=Math.min(Kd.longitude,d),Jd.latitude=Math.max(Jd.latitude,c),Jd.longitude=Math.max(Jd.longitude,d)}for(let p=0;p<s-1;++p)PZe(r[p],r[p+1],t,a,Kd,Jd);let u=r[s-1];h.subtract(u,r[s-2],nh),h.normalize(nh,nh),h.multiplyByScalar(nh,a,nh),h.add(u,nh,bY),PZe(u,bY,t,a,Kd,Jd),i===ro.ROUNDED&&(t.cartesianToCartographic(bY,ih),c=ih.latitude,d=ih.longitude,Kd.latitude=Math.min(Kd.latitude,c),Kd.longitude=Math.min(Kd.longitude,d),Jd.latitude=Math.max(Jd.latitude,c),Jd.longitude=Math.max(Jd.longitude,d));let m=l(o)?o:new re;return m.north=Jd.latitude,m.south=Kd.latitude,m.east=Jd.longitude,m.west=Kd.longitude,m}function Sg(e){e=e??B.EMPTY_OBJECT;let t=e.positions,n=e.width,i=e.height??0,o=e.extrudedHeight??i;this._positions=t,this._ellipsoid=ne.clone(e.ellipsoid??ne.default),this._vertexFormat=Me.clone(e.vertexFormat??Me.DEFAULT),this._width=n,this._height=Math.max(i,o),this._extrudedHeight=Math.min(i,o),this._cornerType=e.cornerType??ro.ROUNDED,this._granularity=e.granularity??W.RADIANS_PER_DEGREE,this._shadowVolume=e.shadowVolume??!1,this._workerName="createCorridorGeometry",this._offsetAttribute=e.offsetAttribute,this._rectangle=void 0,this.packedLength=1+t.length*h.packedLength+ne.packedLength+Me.packedLength+7}Sg.pack=function(e,t,n){n=n??0;let i=e._positions,o=i.length;t[n++]=o;for(let r=0;r<o;++r,n+=h.packedLength)h.pack(i[r],t,n);return ne.pack(e._ellipsoid,t,n),n+=ne.packedLength,Me.pack(e._vertexFormat,t,n),n+=Me.packedLength,t[n++]=e._width,t[n++]=e._height,t[n++]=e._extrudedHeight,t[n++]=e._cornerType,t[n++]=e._granularity,t[n++]=e._shadowVolume?1:0,t[n]=e._offsetAttribute??-1,t};var UZe=ne.clone(ne.UNIT_SPHERE),DZe=new Me,_g={positions:void 0,ellipsoid:UZe,vertexFormat:DZe,width:void 0,height:void 0,extrudedHeight:void 0,cornerType:void 0,granularity:void 0,shadowVolume:void 0,offsetAttribute:void 0};Sg.unpack=function(e,t,n){t=t??0;let i=e[t++],o=new Array(i);for(let f=0;f<i;++f,t+=h.packedLength)o[f]=h.unpack(e,t);let r=ne.unpack(e,t,UZe);t+=ne.packedLength;let s=Me.unpack(e,t,DZe);t+=Me.packedLength;let a=e[t++],c=e[t++],d=e[t++],u=e[t++],m=e[t++],p=e[t++]===1,b=e[t];return l(n)?(n._positions=o,n._ellipsoid=ne.clone(r,n._ellipsoid),n._vertexFormat=Me.clone(s,n._vertexFormat),n._width=a,n._height=c,n._extrudedHeight=d,n._cornerType=u,n._granularity=m,n._shadowVolume=p,n._offsetAttribute=b===-1?void 0:b,n):(_g.positions=o,_g.width=a,_g.height=c,_g.extrudedHeight=d,_g.cornerType=u,_g.granularity=m,_g.shadowVolume=p,_g.offsetAttribute=b===-1?void 0:b,new Sg(_g))};Sg.computeRectangle=function(e,t){e=e??B.EMPTY_OBJECT;let n=e.positions,i=e.width,o=e.ellipsoid??ne.default,r=e.cornerType??ro.ROUNDED;return kZe(n,o,i,r,t)};Sg.createGeometry=function(e){let t=e._positions,n=e._width,i=e._ellipsoid;t=MZe(t,i);let o=Yo(t,h.equalsEpsilon);if(o.length<2||n<=0)return;let r=e._height,s=e._extrudedHeight,a=!W.equalsEpsilon(r,s,0,W.EPSILON2),c=e._vertexFormat,d={ellipsoid:i,positions:o,width:n,cornerType:e._cornerType,granularity:e._granularity,saveAttributes:!0},u;if(a)d.height=r,d.extrudedHeight=s,d.shadowVolume=e._shadowVolume,d.offsetAttribute=e._offsetAttribute,u=i0t(d,c);else{let b=bo.computePositions(d);if(u=wZe(b,c,i),u.attributes.position.values=hi.scaleToGeodeticHeight(u.attributes.position.values,r,i),l(e._offsetAttribute)){let f=e._offsetAttribute===bn.NONE?0:1,y=u.attributes.position.values.length,_=new Uint8Array(y/3).fill(f);u.attributes.applyOffset=new Xe({componentDatatype:J.UNSIGNED_BYTE,componentsPerAttribute:1,values:_})}}let m=u.attributes,p=me.fromVertices(m.position.values,void 0,3);return c.position||(u.attributes.position.values=void 0),new At({attributes:m,indices:u.indices,primitiveType:Ie.TRIANGLES,boundingSphere:p,offsetAttribute:e._offsetAttribute})};Sg.createShadowVolume=function(e,t,n){let i=e._granularity,o=e._ellipsoid,r=t(i,o),s=n(i,o);return new Sg({positions:e._positions,width:e._width,cornerType:e._cornerType,ellipsoid:o,granularity:i,extrudedHeight:r,height:s,vertexFormat:Me.POSITION_ONLY,shadowVolume:!0})};Object.defineProperties(Sg.prototype,{rectangle:{get:function(){return l(this._rectangle)||(this._rectangle=kZe(this._positions,this._ellipsoid,this._width,this._cornerType)),this._rectangle}},textureCoordinateRotationPoints:{get:function(){return[0,0,0,1,1,0]}}});var QS=Sg;var sLi=x(T(),1);var OZe=new h,BZe=new h,o0t=new h;function r0t(e,t){for(let n=0;n<e.length;n++)e[n]=t.scaleToGeodeticSurface(e[n],e[n]);return e}function zZe(e,t){let n=[],i=e.positions,o=e.corners,r=e.endPositions,s=new Rn,a,c=0,d=0,u,m=0,p;for(u=0;u<i.length;u+=2)p=i[u].length-3,c+=p,m+=p/3*4,d+=i[u+1].length-3;for(c+=3,d+=3,u=0;u<o.length;u++){let X=o[u].leftPositions;l(X)?(p=X.length,c+=p,m+=p/3*2):(p=o[u].rightPositions.length,d+=p,m+=p/3*2)}let b=l(r),f;b&&(f=r[0].length-3,c+=f,d+=f,f/=3,m+=f*4);let y=c+d,_=new Float64Array(y),S=0,Z=y-1,R,C,E,A,L,F,I=f/2,N=Oe.createTypedArray(y/3,m+4),g=0;if(N[g++]=S/3,N[g++]=(Z-2)/3,b){n.push(S/3),F=OZe,L=BZe;let X=r[0];for(u=0;u<I;u++)F=h.fromArray(X,(I-1-u)*3,F),L=h.fromArray(X,(I+u)*3,L),bo.addAttribute(_,L,S),bo.addAttribute(_,F,void 0,Z),C=S/3,A=C+1,R=(Z-2)/3,E=R-1,N[g++]=R,N[g++]=E,N[g++]=C,N[g++]=A,S+=3,Z-=3}let V=0,G=i[V++],v=i[V++];for(_.set(G,S),_.set(v,Z-v.length+1),p=v.length-3,n.push(S/3,(Z-2)/3),u=0;u<p;u+=3)C=S/3,A=C+1,R=(Z-2)/3,E=R-1,N[g++]=R,N[g++]=E,N[g++]=C,N[g++]=A,S+=3,Z-=3;for(u=0;u<o.length;u++){let X;a=o[u];let Y=a.leftPositions,D=a.rightPositions,M,O=o0t;if(l(Y)){for(Z-=3,M=E,n.push(A),X=0;X<Y.length/3;X++)O=h.fromArray(Y,X*3,O),N[g++]=M-X-1,N[g++]=M-X,bo.addAttribute(_,O,void 0,Z),Z-=3;n.push(M-Math.floor(Y.length/6)),t===ro.BEVELED&&n.push((Z-2)/3+1),S+=3}else{for(S+=3,M=A,n.push(E),X=0;X<D.length/3;X++)O=h.fromArray(D,X*3,O),N[g++]=M+X,N[g++]=M+X+1,bo.addAttribute(_,O,S),S+=3;n.push(M+Math.floor(D.length/6)),t===ro.BEVELED&&n.push(S/3-1),Z-=3}for(G=i[V++],v=i[V++],G.splice(0,3),v.splice(v.length-3,3),_.set(G,S),_.set(v,Z-v.length+1),X=0;X<v.length;X+=3)A=S/3,C=A-1,E=(Z-2)/3,R=E+1,N[g++]=R,N[g++]=E,N[g++]=C,N[g++]=A,S+=3,Z-=3;S-=3,Z+=3,n.push(S/3,(Z-2)/3)}if(b){S+=3,Z-=3,F=OZe,L=BZe;let X=r[1];for(u=0;u<I;u++)F=h.fromArray(X,(f-u-1)*3,F),L=h.fromArray(X,u*3,L),bo.addAttribute(_,F,void 0,Z),bo.addAttribute(_,L,S),A=S/3,C=A-1,E=(Z-2)/3,R=E+1,N[g++]=R,N[g++]=E,N[g++]=C,N[g++]=A,S+=3,Z-=3;n.push(S/3)}else n.push(S/3,(Z-2)/3);return N[g++]=S/3,N[g]=(Z-2)/3,s.position=new Xe({componentDatatype:J.DOUBLE,componentsPerAttribute:3,values:_}),{attributes:s,indices:N,wallIndices:n}}function s0t(e){let t=e.ellipsoid,n=bo.computePositions(e),i=zZe(n,e.cornerType),o=i.wallIndices,r=e.height,s=e.extrudedHeight,a=i.attributes,c=i.indices,d=a.position.values,u=d.length,m=new Float64Array(u);m.set(d);let p=new Float64Array(u*2);if(d=hi.scaleToGeodeticHeight(d,r,t),m=hi.scaleToGeodeticHeight(m,s,t),p.set(d),p.set(m,u),a.position.values=p,u/=3,l(e.offsetAttribute)){let R=new Uint8Array(u*2);if(e.offsetAttribute===bn.TOP)R=R.fill(1,0,u);else{let C=e.offsetAttribute===bn.NONE?0:1;R=R.fill(C)}a.applyOffset=new Xe({componentDatatype:J.UNSIGNED_BYTE,componentsPerAttribute:1,values:R})}let b,f=c.length,y=Oe.createTypedArray(p.length/3,(f+o.length)*2);y.set(c);let _=f;for(b=0;b<f;b+=2){let R=c[b],C=c[b+1];y[_++]=R+u,y[_++]=C+u}let S,Z;for(b=0;b<o.length;b++)S=o[b],Z=S+u,y[_++]=S,y[_++]=Z;return{attributes:a,indices:y}}function gY(e){e=e??B.EMPTY_OBJECT;let t=e.positions,n=e.width,i=e.height??0,o=e.extrudedHeight??i;this._positions=t,this._ellipsoid=ne.clone(e.ellipsoid??ne.default),this._width=n,this._height=Math.max(i,o),this._extrudedHeight=Math.min(i,o),this._cornerType=e.cornerType??ro.ROUNDED,this._granularity=e.granularity??W.RADIANS_PER_DEGREE,this._offsetAttribute=e.offsetAttribute,this._workerName="createCorridorOutlineGeometry",this.packedLength=1+t.length*h.packedLength+ne.packedLength+6}gY.pack=function(e,t,n){n=n??0;let i=e._positions,o=i.length;t[n++]=o;for(let r=0;r<o;++r,n+=h.packedLength)h.pack(i[r],t,n);return ne.pack(e._ellipsoid,t,n),n+=ne.packedLength,t[n++]=e._width,t[n++]=e._height,t[n++]=e._extrudedHeight,t[n++]=e._cornerType,t[n++]=e._granularity,t[n]=e._offsetAttribute??-1,t};var HZe=ne.clone(ne.UNIT_SPHERE),Ox={positions:void 0,ellipsoid:HZe,width:void 0,height:void 0,extrudedHeight:void 0,cornerType:void 0,granularity:void 0,offsetAttribute:void 0};gY.unpack=function(e,t,n){t=t??0;let i=e[t++],o=new Array(i);for(let p=0;p<i;++p,t+=h.packedLength)o[p]=h.unpack(e,t);let r=ne.unpack(e,t,HZe);t+=ne.packedLength;let s=e[t++],a=e[t++],c=e[t++],d=e[t++],u=e[t++],m=e[t];return l(n)?(n._positions=o,n._ellipsoid=ne.clone(r,n._ellipsoid),n._width=s,n._height=a,n._extrudedHeight=c,n._cornerType=d,n._granularity=u,n._offsetAttribute=m===-1?void 0:m,n):(Ox.positions=o,Ox.width=s,Ox.height=a,Ox.extrudedHeight=c,Ox.cornerType=d,Ox.granularity=u,Ox.offsetAttribute=m===-1?void 0:m,new gY(Ox))};gY.createGeometry=function(e){let t=e._positions,n=e._width,i=e._ellipsoid;t=r0t(t,i);let o=Yo(t,h.equalsEpsilon);if(o.length<2||n<=0)return;let r=e._height,s=e._extrudedHeight,a=!W.equalsEpsilon(r,s,0,W.EPSILON2),c={ellipsoid:i,positions:o,width:n,cornerType:e._cornerType,granularity:e._granularity,saveAttributes:!1},d;if(a)c.height=r,c.extrudedHeight=s,c.offsetAttribute=e._offsetAttribute,d=s0t(c);else{let p=bo.computePositions(c);if(d=zZe(p,c.cornerType),d.attributes.position.values=hi.scaleToGeodeticHeight(d.attributes.position.values,r,i),l(e._offsetAttribute)){let b=d.attributes.position.values.length,f=e._offsetAttribute===bn.NONE?0:1,y=new Uint8Array(b/3).fill(f);d.attributes.applyOffset=new Xe({componentDatatype:J.UNSIGNED_BYTE,componentsPerAttribute:1,values:y})}}let u=d.attributes,m=me.fromVertices(u.position.values,void 0,3);return new At({attributes:u,indices:d.indices,primitiveType:Ie.LINES,boundingSphere:m,offsetAttribute:e._offsetAttribute})};var yY=gY;var yLi=x(T(),1);var a0t=new mi(0);function ad(e){Wi.call(this,e),this._zIndex=0,this._terrainOffsetProperty=void 0}l(Object.create)&&(ad.prototype=Object.create(Wi.prototype),ad.prototype.constructor=ad);Object.defineProperties(ad.prototype,{zIndex:{get:function(){return this._zIndex}},terrainOffsetProperty:{get:function(){return this._terrainOffsetProperty}}});ad.prototype._isOnTerrain=function(e,t){return this._fillEnabled&&!l(t.height)&&!l(t.extrudedHeight)&&Dl.isSupported(this._scene)};ad.prototype._getIsClosed=function(e){let t=e.height,n=e.extrudedHeight;return t===0||l(n)&&n!==t};ad.prototype._computeCenter=ge.throwInstantiationError;ad.prototype._onEntityPropertyChanged=function(e,t,n,i){if(Wi.prototype._onEntityPropertyChanged.call(this,e,t,n,i),this._observedPropertyNames.indexOf(t)===-1)return;let o=this._entity[this._geometryPropertyName];if(!l(o))return;l(o.zIndex)&&(l(o.height)||l(o.extrudedHeight))&&xt(xt.geometryZIndex),this._zIndex=o.zIndex??a0t,l(this._terrainOffsetProperty)&&(this._terrainOffsetProperty.destroy(),this._terrainOffsetProperty=void 0);let r=o.heightReference,s=o.extrudedHeightReference;if(l(r)||l(s)){let a=new Qh(this._computeCenter.bind(this),!this._dynamic);this._terrainOffsetProperty=new w_(this._scene,a,r,s)}};ad.prototype.destroy=function(){l(this._terrainOffsetProperty)&&(this._terrainOffsetProperty.destroy(),this._terrainOffsetProperty=void 0),Wi.prototype.destroy.call(this)};ad.getGeometryHeight=function(e,t){if(!l(e)){t!==He.NONE&&xt(xt.geometryHeightReference);return}return bs(t)?0:e};ad.getGeometryExtrudedHeight=function(e,t){if(!l(e)){t!==He.NONE&&xt(xt.geometryExtrudedHeightReference);return}return bs(t)?ad.CLAMP_TO_GROUND:e};ad.CLAMP_TO_GROUND="clamp";ad.computeGeometryOffsetAttribute=function(e,t,n,i){(!l(e)||!l(t))&&(t=He.NONE),(!l(n)||!l(i))&&(i=He.NONE);let o=0;if(t!==He.NONE&&o++,i===He.RELATIVE_TO_GROUND&&o++,o===2)return bn.ALL;if(o===1)return bn.TOP};var ri=ad;var KZe=new U,JZe=h.ZERO,jZe=new h,QZe=new re;function c0t(e){this.id=e,this.vertexFormat=void 0,this.positions=void 0,this.width=void 0,this.cornerType=void 0,this.height=void 0,this.extrudedHeight=void 0,this.granularity=void 0,this.offsetAttribute=void 0}function Af(e,t){ri.call(this,{entity:e,scene:t,geometryOptions:new c0t(e),geometryPropertyName:"corridor",observedPropertyNames:["availability","corridor"]}),this._onEntityPropertyChanged(e,"corridor",e.corridor,void 0)}l(Object.create)&&(Af.prototype=Object.create(ri.prototype),Af.prototype.constructor=Af);Af.prototype.createFillGeometryInstance=function(e){let t=this._entity,n=t.isAvailable(e),i={show:new Wn(n&&t.isShowing&&this._showProperty.getValue(e)&&this._fillProperty.getValue(e)),distanceDisplayCondition:ti.fromDistanceDisplayCondition(this._distanceDisplayConditionProperty.getValue(e)),offset:void 0,color:void 0};if(this._materialProperty instanceof Qt){let o;l(this._materialProperty.color)&&(this._materialProperty.color.isConstant||n)&&(o=this._materialProperty.color.getValue(e,KZe)),l(o)||(o=U.WHITE),i.color=$t.fromColor(o)}return l(this._options.offsetAttribute)&&(i.offset=Ro.fromCartesian3(j.getValueOrDefault(this._terrainOffsetProperty,e,JZe,jZe))),new Yt({id:t,geometry:new QS(this._options),attributes:i})};Af.prototype.createOutlineGeometryInstance=function(e){let t=this._entity,n=t.isAvailable(e),i=j.getValueOrDefault(this._outlineColorProperty,e,U.BLACK,KZe),o={show:new Wn(n&&t.isShowing&&this._showProperty.getValue(e)&&this._showOutlineProperty.getValue(e)),color:$t.fromColor(i),distanceDisplayCondition:ti.fromDistanceDisplayCondition(this._distanceDisplayConditionProperty.getValue(e)),offset:void 0};return l(this._options.offsetAttribute)&&(o.offset=Ro.fromCartesian3(j.getValueOrDefault(this._terrainOffsetProperty,e,JZe,jZe))),new Yt({id:t,geometry:new yY(this._options),attributes:o})};Af.prototype._computeCenter=function(e,t){let n=j.getValueOrUndefined(this._entity.corridor.positions,e);if(!(!l(n)||n.length===0))return h.clone(n[Math.floor(n.length/2)],t)};Af.prototype._isHidden=function(e,t){return!l(t.positions)||!l(t.width)||Wi.prototype._isHidden.call(this,e,t)};Af.prototype._isDynamic=function(e,t){return!t.positions.isConstant||!j.isConstant(t.height)||!j.isConstant(t.extrudedHeight)||!j.isConstant(t.granularity)||!j.isConstant(t.width)||!j.isConstant(t.outlineWidth)||!j.isConstant(t.cornerType)||!j.isConstant(t.zIndex)||this._onTerrain&&!j.isConstant(this._materialProperty)&&!(this._materialProperty instanceof Qt)};Af.prototype._setStaticOptions=function(e,t){let n=j.getValueOrUndefined(t.height,ot.MINIMUM_VALUE),i=j.getValueOrDefault(t.heightReference,ot.MINIMUM_VALUE,He.NONE),o=j.getValueOrUndefined(t.extrudedHeight,ot.MINIMUM_VALUE),r=j.getValueOrDefault(t.extrudedHeightReference,ot.MINIMUM_VALUE,He.NONE);l(o)&&!l(n)&&(n=0);let s=this._options;s.vertexFormat=this._materialProperty instanceof Qt?Tn.VERTEX_FORMAT:Co.MaterialSupport.TEXTURED.vertexFormat,s.positions=t.positions.getValue(ot.MINIMUM_VALUE,s.positions),s.width=t.width.getValue(ot.MINIMUM_VALUE),s.granularity=j.getValueOrUndefined(t.granularity,ot.MINIMUM_VALUE),s.cornerType=j.getValueOrUndefined(t.cornerType,ot.MINIMUM_VALUE),s.offsetAttribute=ri.computeGeometryOffsetAttribute(n,i,o,r),s.height=ri.getGeometryHeight(n,i),o=ri.getGeometryExtrudedHeight(o,r),o===ri.CLAMP_TO_GROUND&&(o=Pi.getMinimumMaximumHeights(QS.computeRectangle(s,QZe)).minimumTerrainHeight),s.extrudedHeight=o};Af.DynamicGeometryUpdater=_V;function _V(e,t,n){Li.call(this,e,t,n)}l(Object.create)&&(_V.prototype=Object.create(Li.prototype),_V.prototype.constructor=_V);_V.prototype._isHidden=function(e,t,n){let i=this._options;return!l(i.positions)||!l(i.width)||Li.prototype._isHidden.call(this,e,t,n)};_V.prototype._setOptions=function(e,t,n){let i=this._options,o=j.getValueOrUndefined(t.height,n),r=j.getValueOrDefault(t.heightReference,n,He.NONE),s=j.getValueOrUndefined(t.extrudedHeight,n),a=j.getValueOrDefault(t.extrudedHeightReference,n,He.NONE);l(s)&&!l(o)&&(o=0),i.positions=j.getValueOrUndefined(t.positions,n),i.width=j.getValueOrUndefined(t.width,n),i.granularity=j.getValueOrUndefined(t.granularity,n),i.cornerType=j.getValueOrUndefined(t.cornerType,n),i.offsetAttribute=ri.computeGeometryOffsetAttribute(o,r,s,a),i.height=ri.getGeometryHeight(o,r),s=ri.getGeometryExtrudedHeight(s,a),s===ri.CLAMP_TO_GROUND&&(s=Pi.getMinimumMaximumHeights(QS.computeRectangle(i,QZe)).minimumTerrainHeight),i.extrudedHeight=s};var xY=Af;var mvi=x(T(),1);var OLi=x(T(),1);function l3(){ge.throwInstantiationError()}Object.defineProperties(l3.prototype,{name:{get:ge.throwInstantiationError},clock:{get:ge.throwInstantiationError},entities:{get:ge.throwInstantiationError},isLoading:{get:ge.throwInstantiationError},changedEvent:{get:ge.throwInstantiationError},errorEvent:{get:ge.throwInstantiationError},loadingEvent:{get:ge.throwInstantiationError},show:{get:ge.throwInstantiationError},clustering:{get:ge.throwInstantiationError}});l3.prototype.update=function(e){ge.throwInstantiationError()};l3.setLoading=function(e,t){e._isLoading!==t&&(t?e._entityCollection.suspendEvents():e._entityCollection.resumeEvents(),e._isLoading=t,e._loading.raiseEvent(e,t))};var Es=l3;var svi=x(T(),1);var QLi=x(T(),1);function t0(e,t){this._ellipsoid=e,this._cameraPosition=new h,this._cameraPositionInScaledSpace=new h,this._distanceToLimbInScaledSpaceSquared=0,l(t)&&(this.cameraPosition=t)}Object.defineProperties(t0.prototype,{ellipsoid:{get:function(){return this._ellipsoid}},cameraPosition:{get:function(){return this._cameraPosition},set:function(e){let n=this._ellipsoid.transformPositionToScaledSpace(e,this._cameraPositionInScaledSpace),i=h.magnitudeSquared(n)-1;h.clone(e,this._cameraPosition),this._cameraPositionInScaledSpace=n,this._distanceToLimbInScaledSpaceSquared=i}}});var qZe=new h;t0.prototype.isPointVisible=function(e){let n=this._ellipsoid.transformPositionToScaledSpace(e,qZe);return q$(n,this._cameraPositionInScaledSpace,this._distanceToLimbInScaledSpaceSquared)};t0.prototype.isScaledSpacePointVisible=function(e){return q$(e,this._cameraPositionInScaledSpace,this._distanceToLimbInScaledSpaceSquared)};var l0t=new h;t0.prototype.isScaledSpacePointVisiblePossiblyUnderEllipsoid=function(e,t){let n=this._ellipsoid,i,o;return l(t)&&t<0&&n.minimumRadius>-t?(o=l0t,o.x=this._cameraPosition.x/(n.radii.x+t),o.y=this._cameraPosition.y/(n.radii.y+t),o.z=this._cameraPosition.z/(n.radii.z+t),i=o.x*o.x+o.y*o.y+o.z*o.z-1):(o=this._cameraPositionInScaledSpace,i=this._distanceToLimbInScaledSpaceSquared),q$(e,o,i)};t0.prototype.computeHorizonCullingPoint=function(e,t,n){return tRe(this._ellipsoid,e,t,n)};var $Ze=ne.clone(ne.UNIT_SPHERE);t0.prototype.computeHorizonCullingPointPossiblyUnderEllipsoid=function(e,t,n,i){let o=eRe(this._ellipsoid,n,$Ze);return tRe(o,e,t,i)};t0.prototype.computeHorizonCullingPointFromVertices=function(e,t,n,i,o){return nRe(this._ellipsoid,e,t,n,i,o)};t0.prototype.computeHorizonCullingPointFromVerticesPossiblyUnderEllipsoid=function(e,t,n,i,o,r){let s=eRe(this._ellipsoid,o,$Ze);return nRe(s,e,t,n,i,r)};var d0t=[];t0.prototype.computeHorizonCullingPointFromRectangle=function(e,t,n){let i=re.subsample(e,t,0,d0t),o=me.fromPoints(i);if(!(h.magnitude(o.center)<.1*t.minimumRadius))return this.computeHorizonCullingPoint(o.center,i,n)};var u0t=new h;function eRe(e,t,n){if(l(t)&&t<0&&e.minimumRadius>-t){let i=h.fromElements(e.radii.x+t,e.radii.y+t,e.radii.z+t,u0t);e=ne.fromCartesian3(i,n)}return e}function tRe(e,t,n,i){l(i)||(i=new h);let o=rRe(e,t),r=0;for(let s=0,a=n.length;s<a;++s){let c=n[s],d=iRe(e,c,o);if(d<0)return;r=Math.max(r,d)}return oRe(o,r,i)}var d3=new h;function nRe(e,t,n,i,o,r){l(r)||(r=new h),i=i??3,o=o??h.ZERO;let s=rRe(e,t),a=0;for(let c=0,d=n.length;c<d;c+=i){d3.x=n[c]+o.x,d3.y=n[c+1]+o.y,d3.z=n[c+2]+o.z;let u=iRe(e,d3,s);if(u<0)return;a=Math.max(a,u)}return oRe(s,a,r)}function q$(e,t,n){let i=t,o=n,r=h.subtract(e,i,qZe),s=-h.dot(r,i);return!(o<0?s>0:s>o&&s*s/h.magnitudeSquared(r)>o)}var m0t=new h,h0t=new h;function iRe(e,t,n){let i=e.transformPositionToScaledSpace(t,m0t),o=h.magnitudeSquared(i),r=Math.sqrt(o),s=h.divideByScalar(i,r,h0t);o=Math.max(1,o),r=Math.max(1,r);let a=h.dot(s,n),c=h.magnitude(h.cross(s,n,s)),d=1/r,u=Math.sqrt(o-1)*d;return 1/(a*d-c*u)}function oRe(e,t,n){if(!(t<=0||t===1/0||t!==t))return h.multiplyByScalar(e,t,n)}var Q$=new h;function rRe(e,t){return h.equals(t,h.ZERO)?t:(e.transformPositionToScaledSpace(t,Q$),h.normalize(Q$,Q$))}var Gf=t0;var mWi=x(T(),1);function as(e,t){e=e??B.EMPTY_OBJECT;let n=e.translucencyByDistance,i=e.scaleByDistance,o=e.distanceDisplayCondition;l(n)&&(n=Kt.clone(n)),l(i)&&(i=Kt.clone(i)),l(o)&&(o=Bt.clone(o)),this._show=e.show??!0,this._position=h.clone(e.position??h.ZERO),this._actualPosition=h.clone(this._position),this._color=U.clone(e.color??U.WHITE),this._outlineColor=U.clone(e.outlineColor??U.TRANSPARENT),this._outlineWidth=e.outlineWidth??0,this._pixelSize=e.pixelSize??10,this._scaleByDistance=i,this._translucencyByDistance=n,this._distanceDisplayCondition=o,this._disableDepthTestDistance=e.disableDepthTestDistance??0,this._id=e.id,this._collection=e.collection??t,this._clusterShow=!0,this._pickId=void 0,this._pointPrimitiveCollection=t,this._dirty=!1,this._index=-1,this._splitDirection=e.splitDirection??kr.NONE}var sRe=as.SHOW_INDEX=0,lRe=as.POSITION_INDEX=1,f0t=as.COLOR_INDEX=2,p0t=as.OUTLINE_COLOR_INDEX=3,b0t=as.OUTLINE_WIDTH_INDEX=4,g0t=as.PIXEL_SIZE_INDEX=5,y0t=as.SCALE_BY_DISTANCE_INDEX=6,x0t=as.TRANSLUCENCY_BY_DISTANCE_INDEX=7,T0t=as.DISTANCE_DISPLAY_CONDITION_INDEX=8,_0t=as.DISABLE_DEPTH_DISTANCE_INDEX=9,S0t=as.SPLIT_DIRECTION_INDEX=10;as.NUMBER_OF_PROPERTIES=11;function Ou(e,t){let n=e._pointPrimitiveCollection;l(n)&&(n._updatePointPrimitive(e,t),e._dirty=!0)}Object.defineProperties(as.prototype,{show:{get:function(){return this._show},set:function(e){this._show!==e&&(this._show=e,Ou(this,sRe))}},position:{get:function(){return this._position},set:function(e){let t=this._position;h.equals(t,e)||(h.clone(e,t),h.clone(e,this._actualPosition),Ou(this,lRe))}},scaleByDistance:{get:function(){return this._scaleByDistance},set:function(e){let t=this._scaleByDistance;Kt.equals(t,e)||(this._scaleByDistance=Kt.clone(e,t),Ou(this,y0t))}},translucencyByDistance:{get:function(){return this._translucencyByDistance},set:function(e){let t=this._translucencyByDistance;Kt.equals(t,e)||(this._translucencyByDistance=Kt.clone(e,t),Ou(this,x0t))}},pixelSize:{get:function(){return this._pixelSize},set:function(e){this._pixelSize!==e&&(this._pixelSize=e,Ou(this,g0t))}},color:{get:function(){return this._color},set:function(e){let t=this._color;U.equals(t,e)||(U.clone(e,t),Ou(this,f0t))}},outlineColor:{get:function(){return this._outlineColor},set:function(e){let t=this._outlineColor;U.equals(t,e)||(U.clone(e,t),Ou(this,p0t))}},outlineWidth:{get:function(){return this._outlineWidth},set:function(e){this._outlineWidth!==e&&(this._outlineWidth=e,Ou(this,b0t))}},distanceDisplayCondition:{get:function(){return this._distanceDisplayCondition},set:function(e){Bt.equals(this._distanceDisplayCondition,e)||(this._distanceDisplayCondition=Bt.clone(e,this._distanceDisplayCondition),Ou(this,T0t))}},disableDepthTestDistance:{get:function(){return this._disableDepthTestDistance},set:function(e){this._disableDepthTestDistance!==e&&(this._disableDepthTestDistance=e,Ou(this,_0t))}},id:{get:function(){return this._id},set:function(e){this._id=e,l(this._pickId)&&(this._pickId.object.id=e)}},pickId:{get:function(){return this._pickId}},clusterShow:{get:function(){return this._clusterShow},set:function(e){this._clusterShow!==e&&(this._clusterShow=e,Ou(this,sRe))}},splitDirection:{get:function(){return this._splitDirection},set:function(e){this._splitDirection!==e&&(this._splitDirection=e,Ou(this,S0t))}}});as.prototype.getPickId=function(e){return l(this._pickId)||(this._pickId=e.createPickId({primitive:this,collection:this._collection,id:this._id})),this._pickId};as.prototype._getActualPosition=function(){return this._actualPosition};as.prototype._setActualPosition=function(e){h.clone(e,this._actualPosition),Ou(this,lRe)};var aRe=new ce;as._computeActualPosition=function(e,t,n){return t.mode===se.SCENE3D?e:(P.multiplyByPoint(n,e,aRe),fo.computeActualEllipsoidPosition(t,aRe))};var cRe=new ce;as._computeScreenSpacePosition=function(e,t,n,i){let o=P.multiplyByVector(e,ce.fromElements(t.x,t.y,t.z,1,cRe),cRe);return fo.worldToWindowCoordinates(n,o,i)};as.prototype.computeScreenSpacePosition=function(e,t){let n=this._pointPrimitiveCollection;l(t)||(t=new k);let i=n.modelMatrix,o=as._computeScreenSpacePosition(i,this._actualPosition,e,t);if(l(o))return o.y=e.canvas.clientHeight-o.y,o};as.getScreenSpaceBoundingBox=function(e,t,n){let i=e.pixelSize,o=i*.5,r=t.x-o,s=t.y-o,a=i,c=i;return l(n)||(n=new nt),n.x=r,n.y=s,n.width=a,n.height=c,n};as.prototype.equals=function(e){return this===e||l(e)&&this._id===e._id&&h.equals(this._position,e._position)&&U.equals(this._color,e._color)&&this._pixelSize===e._pixelSize&&this._outlineWidth===e._outlineWidth&&this._show===e._show&&U.equals(this._outlineColor,e._outlineColor)&&Kt.equals(this._scaleByDistance,e._scaleByDistance)&&Kt.equals(this._translucencyByDistance,e._translucencyByDistance)&&Bt.equals(this._distanceDisplayCondition,e._distanceDisplayCondition)&&this._disableDepthTestDistance===e._disableDepthTestDistance&&this._splitDirection===e._splitDirection};as.prototype._destroy=function(){this._pickId=this._pickId&&this._pickId.destroy(),this._pointPrimitiveCollection=void 0};var Ea=as;var wWi=x(T(),1);var Z0t=Ea.SHOW_INDEX,tee=Ea.POSITION_INDEX,dRe=Ea.COLOR_INDEX,R0t=Ea.OUTLINE_COLOR_INDEX,C0t=Ea.OUTLINE_WIDTH_INDEX,V0t=Ea.PIXEL_SIZE_INDEX,uRe=Ea.SCALE_BY_DISTANCE_INDEX,mRe=Ea.TRANSLUCENCY_BY_DISTANCE_INDEX,hRe=Ea.DISTANCE_DISPLAY_CONDITION_INDEX,E0t=Ea.DISABLE_DEPTH_DISTANCE_INDEX,A0t=Ea.SPLIT_DIRECTION_INDEX,nee=Ea.NUMBER_OF_PROPERTIES,bl={positionHighAndSize:0,positionLowAndOutline:1,compressedAttribute0:2,compressedAttribute1:3,scaleByDistance:4,distanceDisplayConditionAndDisableDepthAndSplitDirection:5};function oh(e){e=e??B.EMPTY_OBJECT,this._sp=void 0,this._spTranslucent=void 0,this._rsOpaque=void 0,this._rsTranslucent=void 0,this._vaf=void 0,this._pointPrimitives=[],this._pointPrimitivesToUpdate=[],this._pointPrimitivesToUpdateIndex=0,this._pointPrimitivesRemoved=!1,this._createVertexArray=!1,this._shaderScaleByDistance=!1,this._compiledShaderScaleByDistance=!1,this._shaderTranslucencyByDistance=!1,this._compiledShaderTranslucencyByDistance=!1,this._shaderDistanceDisplayCondition=!1,this._compiledShaderDistanceDisplayCondition=!1,this._shaderDisableDepthDistance=!1,this._compiledShaderDisableDepthDistance=!1,this._propertiesChanged=new Uint32Array(nee),this._maxPixelSize=1,this._baseVolume=new me,this._baseVolumeWC=new me,this._baseVolume2D=new me,this._boundingVolume=new me,this._boundingVolumeDirty=!1,this._colorCommands=[],this.show=e.show??!0,this.modelMatrix=P.clone(e.modelMatrix??P.IDENTITY),this._modelMatrix=P.clone(P.IDENTITY),this.debugShowBoundingVolume=e.debugShowBoundingVolume??!1,this.blendOption=e.blendOption??Yi.OPAQUE_AND_TRANSLUCENT,this._blendOption=void 0,this._mode=se.SCENE3D,this._maxTotalPointSize=1,this._buffersUsage=[Pe.STATIC_DRAW,Pe.STATIC_DRAW,Pe.STATIC_DRAW,Pe.STATIC_DRAW,Pe.STATIC_DRAW,Pe.STATIC_DRAW,Pe.STATIC_DRAW,Pe.STATIC_DRAW,Pe.STATIC_DRAW];let t=this;this._uniforms={u_maxTotalPointSize:function(){return t._maxTotalPointSize}}}Object.defineProperties(oh.prototype,{length:{get:function(){return iee(this),this._pointPrimitives.length}}});function fRe(e){let t=e.length;for(let n=0;n<t;++n)e[n]&&e[n]._destroy()}oh.prototype.add=function(e){let t=new Ea(e,this);return t._index=this._pointPrimitives.length,this._pointPrimitives.push(t),this._createVertexArray=!0,t};oh.prototype.remove=function(e){return this.contains(e)?(this._pointPrimitives[e._index]=null,this._pointPrimitivesRemoved=!0,this._createVertexArray=!0,e._destroy(),!0):!1};oh.prototype.removeAll=function(){fRe(this._pointPrimitives),this._pointPrimitives=[],this._pointPrimitivesToUpdate=[],this._pointPrimitivesToUpdateIndex=0,this._pointPrimitivesRemoved=!1,this._createVertexArray=!0};function iee(e){if(e._pointPrimitivesRemoved){e._pointPrimitivesRemoved=!1;let t=[],n=e._pointPrimitives,i=n.length;for(let o=0,r=0;o<i;++o){let s=n[o];s&&(s._index=r++,t.push(s))}e._pointPrimitives=t}}oh.prototype._updatePointPrimitive=function(e,t){e._dirty||(this._pointPrimitivesToUpdate[this._pointPrimitivesToUpdateIndex++]=e),++this._propertiesChanged[t]};oh.prototype.contains=function(e){return l(e)&&e._pointPrimitiveCollection===this};oh.prototype.get=function(e){return iee(this),this._pointPrimitives[e]};oh.prototype.computeNewBuffersUsage=function(){let e=this._buffersUsage,t=!1,n=this._propertiesChanged;for(let i=0;i<nee;++i){let o=n[i]===0?Pe.STATIC_DRAW:Pe.STREAM_DRAW;t=t||e[i]!==o,e[i]=o}return t};function G0t(e,t,n){return new db(e,[{index:bl.positionHighAndSize,componentsPerAttribute:4,componentDatatype:J.FLOAT,usage:n[tee]},{index:bl.positionLowAndShow,componentsPerAttribute:4,componentDatatype:J.FLOAT,usage:n[tee]},{index:bl.compressedAttribute0,componentsPerAttribute:4,componentDatatype:J.FLOAT,usage:n[dRe]},{index:bl.compressedAttribute1,componentsPerAttribute:4,componentDatatype:J.FLOAT,usage:n[mRe]},{index:bl.scaleByDistance,componentsPerAttribute:4,componentDatatype:J.FLOAT,usage:n[uRe]},{index:bl.distanceDisplayConditionAndDisableDepthAndSplitDirection,componentsPerAttribute:4,componentDatatype:J.FLOAT,usage:n[hRe]}],t)}var $$=new An,u3=new U;function pRe(e,t,n,i){let o=i._index,r=i._getActualPosition();e._mode===se.SCENE3D&&(me.expand(e._baseVolume,r,e._baseVolume),e._boundingVolumeDirty=!0),An.fromCartesian(r,$$);let s=i.pixelSize,a=i.outlineWidth;e._maxPixelSize=Math.max(e._maxPixelSize,s+a);let c=n[bl.positionHighAndSize],d=$$.high;c(o,d.x,d.y,d.z,s);let u=n[bl.positionLowAndOutline],m=$$.low;u(o,m.x,m.y,m.z,a)}var L0t=256;function bRe(e,t,n,i){let o=i._index,r=i.color,s=i.outlineColor,a=i.getPickId(t).color;u3.red=r.alpha,u3.green=s.alpha,u3.blue=a.alpha;let c=n[bl.compressedAttribute0];c(o,dn.encodeRGB8(r),dn.encodeRGB8(s),dn.encodeRGB8(a),dn.encodeRGB8(u3))}function gRe(e,t,n,i){let o=i._index,r=0,s=1,a=1,c=1,d=i.translucencyByDistance;l(d)&&(r=d.near,s=d.nearValue,a=d.far,c=d.farValue,(s!==1||c!==1)&&(e._shaderTranslucencyByDistance=!0));let u=i.show&&i.clusterShow;i.color.alpha===0&&i.outlineColor.alpha===0&&(u=!1),s=W.clamp(s,0,1),s=s===1?255:s*255|0;let m=(u?1:0)*L0t+s;c=W.clamp(c,0,1),c=c===1?255:c*255|0;let p=c,b=n[bl.compressedAttribute1];b(o,m,p,r,a)}function yRe(e,t,n,i){let o=i._index,r=n[bl.scaleByDistance],s=0,a=1,c=1,d=1,u=i.scaleByDistance;l(u)&&(s=u.near,a=u.nearValue,c=u.far,d=u.farValue,(a!==1||d!==1)&&(e._shaderScaleByDistance=!0)),r(o,s,a,c,d)}function xRe(e,t,n,i){let o=i._index,r=n[bl.distanceDisplayConditionAndDisableDepthAndSplitDirection],s=0,a=Number.MAX_VALUE,c=i.distanceDisplayCondition;l(c)&&(s=c.near,a=c.far,s*=s,a*=a,e._shaderDistanceDisplayCondition=!0);let d=i.disableDepthTestDistance;d*=d,d>0&&(e._shaderDisableDepthDistance=!0,d===Number.POSITIVE_INFINITY&&(d=-1));let u=0,m=i.splitDirection;l(m)&&(u=m),r(o,s,a,d,u)}function W0t(e,t,n,i){pRe(e,t,n,i),bRe(e,t,n,i),gRe(e,t,n,i),yRe(e,t,n,i),xRe(e,t,n,i)}function eee(e,t,n,i,o,r){let s;i.mode===se.SCENE3D?(s=e._baseVolume,e._boundingVolumeDirty=!0):s=e._baseVolume2D;let a=[];for(let c=0;c<n;++c){let d=t[c],u=d.position,m=Ea._computeActualPosition(u,i,o);l(m)&&(d._setActualPosition(m),r?a.push(m):me.expand(s,m,s))}r&&me.fromPoints(a,s)}function v0t(e,t){let n=t.mode,i=e._pointPrimitives,o=e._pointPrimitivesToUpdate,r=e._modelMatrix;e._createVertexArray||e._mode!==n||n!==se.SCENE3D&&!P.equals(r,e.modelMatrix)?(e._mode=n,P.clone(e.modelMatrix,r),e._createVertexArray=!0,(n===se.SCENE3D||n===se.SCENE2D||n===se.COLUMBUS_VIEW)&&eee(e,i,i.length,t,r,!0)):n===se.MORPHING?eee(e,i,i.length,t,r,!0):(n===se.SCENE2D||n===se.COLUMBUS_VIEW)&&eee(e,o,e._pointPrimitivesToUpdateIndex,t,r,!1)}function F0t(e,t,n){let o=t.camera.getPixelSize(n,t.context.drawingBufferWidth,t.context.drawingBufferHeight)*e._maxPixelSize;n.radius+=o}var I0t=[];oh.prototype.update=function(e){if(iee(this),!this.show)return;this._maxTotalPointSize=wt.maximumAliasedPointSize,v0t(this,e);let n=this._pointPrimitives.length,i=this._pointPrimitivesToUpdate,o=this._pointPrimitivesToUpdateIndex,r=this._propertiesChanged,s=this._createVertexArray,a,c=e.context,d=e.passes,u=d.pick;if(s||!u&&this.computeNewBuffersUsage()){this._createVertexArray=!1;for(let E=0;E<nee;++E)r[E]=0;if(this._vaf=this._vaf&&this._vaf.destroy(),n>0){this._vaf=G0t(c,n,this._buffersUsage),a=this._vaf.writers;for(let E=0;E<n;++E){let A=this._pointPrimitives[E];A._dirty=!1,W0t(this,c,a,A)}this._vaf.commit()}this._pointPrimitivesToUpdateIndex=0}else if(o>0){let E=I0t;E.length=0,(r[tee]||r[C0t]||r[V0t])&&E.push(pRe),(r[dRe]||r[R0t])&&E.push(bRe),(r[Z0t]||r[mRe])&&E.push(gRe),r[uRe]&&E.push(yRe),(r[hRe]||r[E0t]||r[A0t])&&E.push(xRe);let A=E.length;if(a=this._vaf.writers,o/n>.1){for(let L=0;L<o;++L){let F=i[L];F._dirty=!1;for(let I=0;I<A;++I)E[I](this,c,a,F)}this._vaf.commit()}else{for(let L=0;L<o;++L){let F=i[L];F._dirty=!1;for(let I=0;I<A;++I)E[I](this,c,a,F);this._vaf.subCommit(F._index,1)}this._vaf.endSubCommits()}this._pointPrimitivesToUpdateIndex=0}if(o>n*1.5&&(i.length=n),!l(this._vaf)||!l(this._vaf.va))return;this._boundingVolumeDirty&&(this._boundingVolumeDirty=!1,me.transform(this._baseVolume,this.modelMatrix,this._baseVolumeWC));let m,p=P.IDENTITY;e.mode===se.SCENE3D?(p=this.modelMatrix,m=me.clone(this._baseVolumeWC,this._boundingVolume)):m=me.clone(this._baseVolume2D,this._boundingVolume),F0t(this,e,m);let b=this._blendOption!==this.blendOption;this._blendOption=this.blendOption,b&&(this._blendOption===Yi.OPAQUE||this._blendOption===Yi.OPAQUE_AND_TRANSLUCENT?this._rsOpaque=ze.fromCache({depthTest:{enabled:!0,func:ie.LEQUAL},depthMask:!0}):this._rsOpaque=void 0,this._blendOption===Yi.TRANSLUCENT||this._blendOption===Yi.OPAQUE_AND_TRANSLUCENT?this._rsTranslucent=ze.fromCache({depthTest:{enabled:!0,func:ie.LEQUAL},depthMask:!1,blending:on.ALPHA_BLEND}):this._rsTranslucent=void 0),this._shaderDisableDepthDistance=this._shaderDisableDepthDistance||e.minimumDisableDepthTestDistance!==0;let f,y;(b||this._shaderScaleByDistance&&!this._compiledShaderScaleByDistance||this._shaderTranslucencyByDistance&&!this._compiledShaderTranslucencyByDistance||this._shaderDistanceDisplayCondition&&!this._compiledShaderDistanceDisplayCondition||this._shaderDisableDepthDistance!==this._compiledShaderDisableDepthDistance)&&(f=new Je({sources:[Jv]}),this._shaderScaleByDistance&&f.defines.push("EYE_DISTANCE_SCALING"),this._shaderTranslucencyByDistance&&f.defines.push("EYE_DISTANCE_TRANSLUCENCY"),this._shaderDistanceDisplayCondition&&f.defines.push("DISTANCE_DISPLAY_CONDITION"),this._shaderDisableDepthDistance&&f.defines.push("DISABLE_DEPTH_DISTANCE"),this._blendOption===Yi.OPAQUE_AND_TRANSLUCENT&&(y=new Je({defines:["OPAQUE"],sources:[Ny]}),this._sp=tn.replaceCache({context:c,shaderProgram:this._sp,vertexShaderSource:f,fragmentShaderSource:y,attributeLocations:bl}),y=new Je({defines:["TRANSLUCENT"],sources:[Ny]}),this._spTranslucent=tn.replaceCache({context:c,shaderProgram:this._spTranslucent,vertexShaderSource:f,fragmentShaderSource:y,attributeLocations:bl})),this._blendOption===Yi.OPAQUE&&(y=new Je({sources:[Ny]}),this._sp=tn.replaceCache({context:c,shaderProgram:this._sp,vertexShaderSource:f,fragmentShaderSource:y,attributeLocations:bl})),this._blendOption===Yi.TRANSLUCENT&&(y=new Je({sources:[Ny]}),this._spTranslucent=tn.replaceCache({context:c,shaderProgram:this._spTranslucent,vertexShaderSource:f,fragmentShaderSource:y,attributeLocations:bl})),this._compiledShaderScaleByDistance=this._shaderScaleByDistance,this._compiledShaderTranslucencyByDistance=this._shaderTranslucencyByDistance,this._compiledShaderDistanceDisplayCondition=this._shaderDistanceDisplayCondition,this._compiledShaderDisableDepthDistance=this._shaderDisableDepthDistance);let _,S,Z,R,C=e.commandList;if(d.render||u){let E=this._colorCommands,A=this._blendOption===Yi.OPAQUE,L=this._blendOption===Yi.OPAQUE_AND_TRANSLUCENT;_=this._vaf.va,S=_.length,E.length=S;let F=L?S*2:S;for(R=0;R<F;++R){let I=A||L&&R%2===0;Z=E[R],l(Z)||(Z=E[R]=new lt),Z.primitiveType=Ie.POINTS,Z.pass=I||!L?Le.OPAQUE:Le.TRANSLUCENT,Z.owner=this;let N=L?Math.floor(R/2):R;Z.boundingVolume=m,Z.modelMatrix=p,Z.shaderProgram=I?this._sp:this._spTranslucent,Z.uniformMap=this._uniforms,Z.vertexArray=_[N].va,Z.renderState=I?this._rsOpaque:this._rsTranslucent,Z.debugShowBoundingVolume=this.debugShowBoundingVolume,Z.pickId="v_pickColor",C.push(Z)}}};oh.prototype.isDestroyed=function(){return!1};oh.prototype.destroy=function(){return this._sp=this._sp&&this._sp.destroy(),this._spTranslucent=this._spTranslucent&&this._spTranslucent.destroy(),this._spPick=this._spPick&&this._spPick.destroy(),this._vaf=this._vaf&&this._vaf.destroy(),fRe(this._pointPrimitives),ue(this)};var SV=oh;var UWi=x(T(),1),TRe=[Int8Array,Uint8Array,Uint8ClampedArray,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array],oee=1,TY=8,cs=new Uint32Array(96),SY=class e{static from(t){if(!t||t.byteLength===void 0||t.buffer)throw new Error("Data must be an instance of ArrayBuffer or SharedArrayBuffer.");let[n,i]=new Uint8Array(t,0,2);if(n!==219)throw new Error("Data does not appear to be in a KDBush format.");let o=i>>4;if(o!==oee)throw new Error(`Got v${o} data when expected v${oee}.`);let r=TRe[i&15];if(!r)throw new Error("Unrecognized array type.");let[s]=new Uint16Array(t,2,1),[a]=new Uint32Array(t,4,1);return new e(a,s,r,void 0,t)}constructor(t,n=64,i=Float64Array,o=ArrayBuffer,r){if(isNaN(t)||t<0)throw new Error(`Unexpected numItems value: ${t}.`);this.numItems=+t,this.nodeSize=Math.min(Math.max(+n,2),65535),this.ArrayType=i,this.IndexArrayType=t<65536?Uint16Array:Uint32Array;let s=TRe.indexOf(this.ArrayType),a=t*2*this.ArrayType.BYTES_PER_ELEMENT,c=t*this.IndexArrayType.BYTES_PER_ELEMENT,d=(8-c%8)%8;if(s<0)throw new Error(`Unexpected typed array class: ${i}.`);if(r)this.data=r,this.ids=new this.IndexArrayType(r,TY,t),this.coords=new i(r,TY+c+d,t*2),this._pos=t*2,this._finished=!0;else{let u=this.data=new o(TY+a+c+d);this.ids=new this.IndexArrayType(u,TY,t),this.coords=new i(u,TY+c+d,t*2),this._pos=0,this._finished=!1,new Uint8Array(u,0,2).set([219,(oee<<4)+s]),new Uint16Array(u,2,1)[0]=n,new Uint32Array(u,4,1)[0]=t}}add(t,n){let i=this._pos>>1;return this.ids[i]=i,this.coords[this._pos++]=t,this.coords[this._pos++]=n,i}finish(){let t=this._pos>>1;if(t!==this.numItems)throw new Error(`Added ${t} items when expected ${this.numItems}.`);return see(this.ids,this.coords,this.nodeSize,0,this.numItems-1,0),this._finished=!0,this}range(t,n,i,o){if(!this._finished)throw new Error("Data not yet indexed - call index.finish().");let{ids:r,coords:s,nodeSize:a}=this;cs[0]=0,cs[1]=r.length-1,cs[2]=0;let c=3,d=[];for(;c>0;){let u=cs[--c],m=cs[--c],p=cs[--c];if(m-p<=a){for(let _=p;_<=m;_++){let S=s[2*_],Z=s[2*_+1];S>=t&&S<=i&&Z>=n&&Z<=o&&d.push(r[_])}continue}let b=p+m>>1,f=s[2*b],y=s[2*b+1];f>=t&&f<=i&&y>=n&&y<=o&&d.push(r[b]),(u===0?t<=f:n<=y)&&(cs[c++]=p,cs[c++]=b-1,cs[c++]=1-u),(u===0?i>=f:o>=y)&&(cs[c++]=b+1,cs[c++]=m,cs[c++]=1-u)}return d}within(t,n,i){let o=[];return this.withinInto(t,n,i,o),o}withinInto(t,n,i,o){if(!this._finished)throw new Error("Data not yet indexed - call index.finish().");let{ids:r,coords:s,nodeSize:a}=this;cs[0]=0,cs[1]=r.length-1,cs[2]=0;let c=3,d=0,u=i*i;for(;c>0;){let m=cs[--c],p=cs[--c],b=cs[--c];if(p-b<=a){for(let S=b;S<=p;S++)_Re(s[2*S],s[2*S+1],t,n)<=u&&(o[d++]=r[S]);continue}let f=b+p>>1,y=s[2*f],_=s[2*f+1];_Re(y,_,t,n)<=u&&(o[d++]=r[f]),(m===0?t-i<=y:n-i<=_)&&(cs[c++]=b,cs[c++]=f-1,cs[c++]=1-m),(m===0?t+i>=y:n+i>=_)&&(cs[c++]=f+1,cs[c++]=p,cs[c++]=1-m)}return d}};function see(e,t,n,i,o,r){if(o-i<=n)return;let s=i+o>>1;SRe(e,t,s,i,o,r),see(e,t,n,i,s-1,1-r),see(e,t,n,s+1,o,1-r)}function SRe(e,t,n,i,o,r){for(;o>i;){if(o-i>600){let d=o-i+1,u=n-i+1,m=Math.log(d),p=.5*Math.exp(2*m/3),b=.5*Math.sqrt(m*p*(d-p)/d)*(u-d/2<0?-1:1),f=Math.max(i,Math.floor(n-u*p/d+b)),y=Math.min(o,Math.floor(n+(d-u)*p/d+b));SRe(e,t,n,f,y,r)}let s=t[2*n+r],a=i,c=o;for(_Y(e,t,i,n),t[2*o+r]>s&&_Y(e,t,i,o);a<c;){for(_Y(e,t,a,c),a++,c--;t[2*a+r]<s;)a++;for(;t[2*c+r]>s;)c--}t[2*i+r]===s?_Y(e,t,i,c):(c++,_Y(e,t,c,o)),c<=n&&(i=c+1),n<=c&&(o=c-1)}}function _Y(e,t,n,i){ree(e,n,i),ree(t,2*n,2*i),ree(t,2*n+1,2*i+1)}function ree(e,t,n){let i=e[t];e[t]=e[n],e[n]=i}function _Re(e,t,n,i){let o=e-n,r=t-i;return o*o+r*r}function Lf(e){e=e??B.EMPTY_OBJECT,this._enabled=e.enabled??!1,this._pixelRange=e.pixelRange??80,this._minimumClusterSize=e.minimumClusterSize??2,this._clusterBillboards=e.clusterBillboards??!0,this._clusterLabels=e.clusterLabels??!0,this._clusterPoints=e.clusterPoints??!0,this._labelCollection=void 0,this._billboardCollection=void 0,this._pointCollection=void 0,this._clusterBillboardCollection=void 0,this._clusterLabelCollection=void 0,this._clusterPointCollection=void 0,this._collectionIndicesByEntity={},this._unusedLabelIndices=[],this._unusedBillboardIndices=[],this._unusedPointIndices=[],this._previousClusters=[],this._previousHeight=void 0,this._enabledDirty=!1,this._clusterDirty=!1,this._cluster=void 0,this._removeEventListener=void 0,this._clusterEvent=new Se,this.show=e.show??!0}function ZRe(e,t){e.x-=t,e.y-=t,e.width+=t*2,e.height+=t*2}var P0t=new nt;function RRe(e,t,n,i,o){if(l(e._labelCollection)&&i._clusterLabels?o=Ex.getScreenSpaceBoundingBox(e,t,o):l(e._billboardCollection)&&i._clusterBillboards?o=Mo.getScreenSpaceBoundingBox(e,t,o):l(e._pointPrimitiveCollection)&&i._clusterPoints&&(o=Ea.getScreenSpaceBoundingBox(e,t,o)),ZRe(o,n),i._clusterLabels&&!l(e._labelCollection)&&l(e.id)&&VRe(i,e.id.id)&&l(e.id._label)){let r=i._collectionIndicesByEntity[e.id.id].labelIndex,s=i._labelCollection.get(r),a=Ex.getScreenSpaceBoundingBox(s,t,P0t);ZRe(a,n),o=nt.union(o,a,o)}return o}function X0t(e,t){if(e.clusterShow=!0,!l(e._labelCollection)&&l(e.id)&&VRe(t,e.id.id)&&l(e.id._label)){let n=t._collectionIndicesByEntity[e.id.id].labelIndex,i=t._labelCollection.get(n);i.clusterShow=!0}}function CRe(e,t,n,i){let o={billboard:i._clusterBillboardCollection.add(),label:i._clusterLabelCollection.add(),point:i._clusterPointCollection.add()};o.billboard.show=!1,o.point.show=!1,o.label.show=!0,o.label.text=t.toLocaleString(),o.label.id=n,o.billboard.position=o.label.position=o.point.position=e,i._clusterEvent.raiseEvent(n,o)}function VRe(e,t){return l(e)&&l(e._collectionIndicesByEntity[t])&&l(e._collectionIndicesByEntity[t].labelIndex)}function aee(e,t,n,i,o){if(!l(e))return;let r=e.length;for(let s=0;s<r;++s){let a=e.get(s);if(a.clusterShow=!1,!a.show||o._scene.mode===se.SCENE3D&&!i.isPointVisible(a.position))continue;let c=o._clusterLabels&&l(a._labelCollection),d=o._clusterBillboards&&l(a.id._billboard),u=o._clusterPoints&&l(a.id._point);if(c&&(u||d))continue;let m=a.computeScreenSpacePosition(n);l(m)&&t.push({index:s,collection:e,clustered:!1,coord:m})}}var N0t=new nt,Y0t=new nt,M0t=new nt;function w0t(e){return function(t){if(l(t)&&t<.05||!e.enabled)return;let n=e._scene,i=e._labelCollection,o=e._billboardCollection,r=e._pointCollection;if(!l(i)&&!l(o)&&!l(r)||!e._clusterBillboards&&!e._clusterLabels&&!e._clusterPoints)return;let s=e._clusterLabelCollection,a=e._clusterBillboardCollection,c=e._clusterPointCollection;l(s)?s.removeAll():s=e._clusterLabelCollection=new Jp({scene:n}),l(a)?a.removeAll():a=e._clusterBillboardCollection=new wu({scene:n}),l(c)?c.removeAll():c=e._clusterPointCollection=new SV;let d=e._pixelRange,u=e._minimumClusterSize,m=e._previousClusters,p=[],b=e._previousHeight,f=n.camera.positionCartographic.height,y=n.ellipsoid,_=n.camera.positionWC,S=new Gf(y,_),Z=[];e._clusterLabels&&aee(i,Z,n,S,e),e._clusterBillboards&&aee(o,Z,n,S,e),e._clusterPoints&&aee(r,Z,n,S,e);let R,C,E,A,L,F,I,N,g,V,G,v;if(Z.length>0){let X=new SY(Z.length,64,Float64Array);for(let Y=0;Y<Z.length;++Y)X.add(Z[Y].coord.x,Z[Y].coord.y);if(X.finish(),f<b)for(E=m.length,R=0;R<E;++R){let Y=m[R];if(!S.isPointVisible(Y.position))continue;let D=Mo._computeScreenSpacePosition(P.IDENTITY,Y.position,h.ZERO,k.ZERO,n);if(!l(D))continue;let M=1-f/b,O=Y.width=Y.width*M,w=Y.height=Y.height*M;O=Math.max(O,Y.minimumWidth),w=Math.max(w,Y.minimumHeight);let z=D.x-O*.5,K=D.y-w*.5,te=D.x+O,H=D.y+w;for(L=X.range(z,K,te,H),F=L.length,V=0,g=[],C=0;C<F;++C)I=L[C],N=Z[I],N.clustered||(++V,G=N.collection,v=N.index,g.push(G.get(v).id));if(V>=u)for(CRe(Y.position,V,g,e),p.push(Y),C=0;C<F;++C)Z[L[C]].clustered=!0}for(E=Z.length,R=0;R<E;++R){let Y=Z[R];if(Y.clustered)continue;Y.clustered=!0,G=Y.collection,v=Y.index;let D=G.get(v);A=RRe(D,Y.coord,d,e,N0t);let M=nt.clone(A,Y0t);L=X.range(A.x,A.y,A.x+A.width,A.y+A.height),F=L.length;let O=h.clone(D.position);for(V=1,g=[D.id],C=0;C<F;++C)if(I=L[C],N=Z[I],!N.clustered){let w=N.collection.get(N.index),z=RRe(w,N.coord,d,e,M0t);h.add(w.position,O,O),nt.union(M,z,M),++V,g.push(w.id)}if(V>=u){let w=h.multiplyByScalar(O,1/V,O);for(CRe(w,V,g,e),p.push({position:w,width:M.width,height:M.height,minimumWidth:A.width,minimumHeight:A.height}),C=0;C<F;++C)Z[L[C]].clustered=!0}else X0t(D,e)}}s.length===0&&(s.destroy(),e._clusterLabelCollection=void 0),a.length===0&&(a.destroy(),e._clusterBillboardCollection=void 0),c.length===0&&(c.destroy(),e._clusterPointCollection=void 0),e._previousClusters=p,e._previousHeight=f}}Lf.prototype._initialize=function(e){this._scene=e;let t=w0t(this);this._cluster=t,this._removeEventListener=e.camera.changed.addEventListener(t)};Object.defineProperties(Lf.prototype,{enabled:{get:function(){return this._enabled},set:function(e){this._enabledDirty=e!==this._enabled,this._enabled=e}},pixelRange:{get:function(){return this._pixelRange},set:function(e){this._clusterDirty=this._clusterDirty||e!==this._pixelRange,this._pixelRange=e}},minimumClusterSize:{get:function(){return this._minimumClusterSize},set:function(e){this._clusterDirty=this._clusterDirty||e!==this._minimumClusterSize,this._minimumClusterSize=e}},clusterEvent:{get:function(){return this._clusterEvent}},clusterBillboards:{get:function(){return this._clusterBillboards},set:function(e){this._clusterDirty=this._clusterDirty||e!==this._clusterBillboards,this._clusterBillboards=e}},clusterLabels:{get:function(){return this._clusterLabels},set:function(e){this._clusterDirty=this._clusterDirty||e!==this._clusterLabels,this._clusterLabels=e}},clusterPoints:{get:function(){return this._clusterPoints},set:function(e){this._clusterDirty=this._clusterDirty||e!==this._clusterPoints,this._clusterPoints=e}},ready:{get:function(){return!this._enabledDirty&&!this._clusterDirty&&(!l(this._billboardCollection)||this._billboardCollection.ready)&&(!l(this._labelCollection)||this._labelCollection.ready)}}});function lee(e,t,n,i){return function(o){let r=this[e];l(this._collectionIndicesByEntity)||(this._collectionIndicesByEntity={});let s=this._collectionIndicesByEntity[o.id];if(l(s)||(s=this._collectionIndicesByEntity[o.id]={billboardIndex:void 0,labelIndex:void 0,pointIndex:void 0}),l(r)&&l(s[i]))return r.get(s[i]);l(r)||(r=this[e]=new t({scene:this._scene}));let a,c,d=this[n];d.length>0?(a=d.shift(),c=r.get(a)):(c=r.add(),a=r.length-1),s[i]=a;let u=this;return Promise.resolve().then(function(){u._clusterDirty=!0}),c}}function dee(e,t){let n=e._collectionIndicesByEntity[t];!l(n.billboardIndex)&&!l(n.labelIndex)&&!l(n.pointIndex)&&delete e._collectionIndicesByEntity[t]}Lf.prototype.getLabel=lee("_labelCollection",Jp,"_unusedLabelIndices","labelIndex");Lf.prototype.removeLabel=function(e){let t=this._collectionIndicesByEntity&&this._collectionIndicesByEntity[e.id];if(!l(this._labelCollection)||!l(t)||!l(t.labelIndex))return;let n=t.labelIndex;t.labelIndex=void 0,dee(this,e.id);let i=this._labelCollection.get(n);i.show=!1,i.text="",i.id=void 0,this._unusedLabelIndices.push(n),this._clusterDirty=!0};Lf.prototype.getBillboard=lee("_billboardCollection",wu,"_unusedBillboardIndices","billboardIndex");Lf.prototype.removeBillboard=function(e){let t=this._collectionIndicesByEntity&&this._collectionIndicesByEntity[e.id];if(!l(this._billboardCollection)||!l(t)||!l(t.billboardIndex))return;let n=t.billboardIndex;t.billboardIndex=void 0,dee(this,e.id);let i=this._billboardCollection.get(n);i.id=void 0,i.show=!1,i.image=void 0,this._unusedBillboardIndices.push(n),this._clusterDirty=!0};Lf.prototype.getPoint=lee("_pointCollection",SV,"_unusedPointIndices","pointIndex");Lf.prototype.removePoint=function(e){let t=this._collectionIndicesByEntity&&this._collectionIndicesByEntity[e.id];if(!l(this._pointCollection)||!l(t)||!l(t.pointIndex))return;let n=t.pointIndex;t.pointIndex=void 0,dee(this,e.id);let i=this._pointCollection.get(n);i.show=!1,i.id=void 0,this._unusedPointIndices.push(n),this._clusterDirty=!0};function cee(e){if(!l(e))return;let t=e.length;for(let n=0;n<t;++n)e.get(n).clusterShow=!0}function k0t(e){e.enabled||(l(e._clusterLabelCollection)&&e._clusterLabelCollection.destroy(),l(e._clusterBillboardCollection)&&e._clusterBillboardCollection.destroy(),l(e._clusterPointCollection)&&e._clusterPointCollection.destroy(),e._clusterLabelCollection=void 0,e._clusterBillboardCollection=void 0,e._clusterPointCollection=void 0,cee(e._labelCollection),cee(e._billboardCollection),cee(e._pointCollection))}Lf.prototype.update=function(e){if(!this.show)return;let t,n=this._labelCollection;l(n)&&n.length>0&&!n.ready&&(t=e.commandList,e.commandList=[],n.update(e),e.commandList=t);let i=this._billboardCollection;l(i)&&i.length>0&&!i.ready&&(t=e.commandList,e.commandList=[],i.update(e),e.commandList=t),this._enabledDirty&&(this._enabledDirty=!1,k0t(this),this._clusterDirty=!0),this._clusterDirty&&(this._cluster(),this._clusterDirty=l(n)&&!n.ready||l(i)&&!i.ready),l(this._clusterLabelCollection)&&this._clusterLabelCollection.update(e),l(this._clusterBillboardCollection)&&this._clusterBillboardCollection.update(e),l(this._clusterPointCollection)&&this._clusterPointCollection.update(e),l(n)&&n.update(e),l(i)&&i.update(e),l(this._pointCollection)&&this._pointCollection.update(e)};Lf.prototype.destroy=function(){l(this._removeEventListener)&&(this._removeEventListener(),this._removeEventListener=void 0),this._labelCollection=this._labelCollection&&this._labelCollection.destroy(),this._billboardCollection=this._billboardCollection&&this._billboardCollection.destroy(),this._pointCollection=this._pointCollection&&this._pointCollection.destroy(),this._clusterLabelCollection=this._clusterLabelCollection&&this._clusterLabelCollection.destroy(),this._clusterBillboardCollection=this._clusterBillboardCollection&&this._clusterBillboardCollection.destroy(),this._clusterPointCollection=this._clusterPointCollection&&this._clusterPointCollection.destroy(),this._labelCollection=void 0,this._billboardCollection=void 0,this._pointCollection=void 0,this._clusterBillboardCollection=void 0,this._clusterLabelCollection=void 0,this._clusterPointCollection=void 0,this._collectionIndicesByEntity=void 0,this._unusedLabelIndices=[],this._unusedBillboardIndices=[],this._unusedPointIndices=[],this._previousClusters=[],this._previousHeight=void 0,this._enabledDirty=!1,this._pixelRangeDirty=!1,this._minimumClusterSizeDirty=!1};var Bu=Lf;function uee(e){this._name=e,this._clock=void 0,this._changed=new Se,this._error=new Se,this._isLoading=!1,this._loading=new Se,this._entityCollection=new za(this),this._entityCluster=new Bu}Object.defineProperties(uee.prototype,{name:{get:function(){return this._name},set:function(e){this._name!==e&&(this._name=e,this._changed.raiseEvent(this))}},clock:{get:function(){return this._clock},set:function(e){this._clock!==e&&(this._clock=e,this._changed.raiseEvent(this))}},entities:{get:function(){return this._entityCollection}},isLoading:{get:function(){return this._isLoading},set:function(e){Es.setLoading(this,e)}},changedEvent:{get:function(){return this._changed}},errorEvent:{get:function(){return this._error}},loadingEvent:{get:function(){return this._loading}},show:{get:function(){return this._entityCollection.show},set:function(e){this._entityCollection.show=e}},clustering:{get:function(){return this._entityCluster},set:function(e){this._entityCluster=e}}});uee.prototype.update=function(e){return!0};var ZY=uee;var p2i=x(T(),1);var vvi=x(T(),1);var pvi=x(T(),1);var ERe={};ERe.computePositions=function(e,t,n,i,o){let r=e*.5,s=-r,a=i+i,c=o?2*a:a,d=new Float64Array(c*3),u,m=0,p=0,b=o?a*3:0,f=o?(a+i)*3:i*3;for(u=0;u<i;u++){let y=u/i*W.TWO_PI,_=Math.cos(y),S=Math.sin(y),Z=_*n,R=S*n,C=_*t,E=S*t;d[p+b]=Z,d[p+b+1]=R,d[p+b+2]=s,d[p+f]=C,d[p+f+1]=E,d[p+f+2]=r,p+=3,o&&(d[m++]=Z,d[m++]=R,d[m++]=s,d[m++]=C,d[m++]=E,d[m++]=r)}return d};var qS=ERe;var mee=new k,U0t=new h,D0t=new h,O0t=new h,B0t=new h;function Zg(e){e=e??B.EMPTY_OBJECT;let t=e.length,n=e.topRadius,i=e.bottomRadius,o=e.vertexFormat??Me.DEFAULT,r=e.slices??128;this._length=t,this._topRadius=n,this._bottomRadius=i,this._vertexFormat=Me.clone(o),this._slices=r,this._offsetAttribute=e.offsetAttribute,this._workerName="createCylinderGeometry"}Zg.packedLength=Me.packedLength+5;Zg.pack=function(e,t,n){return n=n??0,Me.pack(e._vertexFormat,t,n),n+=Me.packedLength,t[n++]=e._length,t[n++]=e._topRadius,t[n++]=e._bottomRadius,t[n++]=e._slices,t[n]=e._offsetAttribute??-1,t};var ARe=new Me,ZV={vertexFormat:ARe,length:void 0,topRadius:void 0,bottomRadius:void 0,slices:void 0,offsetAttribute:void 0};Zg.unpack=function(e,t,n){t=t??0;let i=Me.unpack(e,t,ARe);t+=Me.packedLength;let o=e[t++],r=e[t++],s=e[t++],a=e[t++],c=e[t];return l(n)?(n._vertexFormat=Me.clone(i,n._vertexFormat),n._length=o,n._topRadius=r,n._bottomRadius=s,n._slices=a,n._offsetAttribute=c===-1?void 0:c,n):(ZV.length=o,ZV.topRadius=r,ZV.bottomRadius=s,ZV.slices=a,ZV.offsetAttribute=c===-1?void 0:c,new Zg(ZV))};Zg.createGeometry=function(e){let t=e._length,n=e._topRadius,i=e._bottomRadius,o=e._vertexFormat,r=e._slices;if(t<=0||n<0||i<0||n===0&&i===0)return;let s=r+r,a=r+s,c=s+s,d=qS.computePositions(t,n,i,r,!0),u=o.st?new Float32Array(c*2):void 0,m=o.normal?new Float32Array(c*3):void 0,p=o.tangent?new Float32Array(c*3):void 0,b=o.bitangent?new Float32Array(c*3):void 0,f,y=o.normal||o.tangent||o.bitangent;if(y){let L=o.tangent||o.bitangent,F=0,I=0,N=0,g=Math.atan2(i-n,t),V=U0t;V.z=Math.sin(g);let G=Math.cos(g),v=O0t,X=D0t;for(f=0;f<r;f++){let Y=f/r*W.TWO_PI,D=G*Math.cos(Y),M=G*Math.sin(Y);y&&(V.x=D,V.y=M,L&&(v=h.normalize(h.cross(h.UNIT_Z,V,v),v)),o.normal&&(m[F++]=V.x,m[F++]=V.y,m[F++]=V.z,m[F++]=V.x,m[F++]=V.y,m[F++]=V.z),o.tangent&&(p[I++]=v.x,p[I++]=v.y,p[I++]=v.z,p[I++]=v.x,p[I++]=v.y,p[I++]=v.z),o.bitangent&&(X=h.normalize(h.cross(V,v,X),X),b[N++]=X.x,b[N++]=X.y,b[N++]=X.z,b[N++]=X.x,b[N++]=X.y,b[N++]=X.z))}for(f=0;f<r;f++)o.normal&&(m[F++]=0,m[F++]=0,m[F++]=-1),o.tangent&&(p[I++]=1,p[I++]=0,p[I++]=0),o.bitangent&&(b[N++]=0,b[N++]=-1,b[N++]=0);for(f=0;f<r;f++)o.normal&&(m[F++]=0,m[F++]=0,m[F++]=1),o.tangent&&(p[I++]=1,p[I++]=0,p[I++]=0),o.bitangent&&(b[N++]=0,b[N++]=1,b[N++]=0)}let _=12*r-12,S=Oe.createTypedArray(c,_),Z=0,R=0;for(f=0;f<r-1;f++)S[Z++]=R,S[Z++]=R+2,S[Z++]=R+3,S[Z++]=R,S[Z++]=R+3,S[Z++]=R+1,R+=2;for(S[Z++]=s-2,S[Z++]=0,S[Z++]=1,S[Z++]=s-2,S[Z++]=1,S[Z++]=s-1,f=1;f<r-1;f++)S[Z++]=s+f+1,S[Z++]=s+f,S[Z++]=s;for(f=1;f<r-1;f++)S[Z++]=a,S[Z++]=a+f,S[Z++]=a+f+1;let C=0;if(o.st){let L=Math.max(n,i);for(f=0;f<c;f++){let F=h.fromArray(d,f*3,B0t);u[C++]=(F.x+L)/(2*L),u[C++]=(F.y+L)/(2*L)}}let E=new Rn;o.position&&(E.position=new Xe({componentDatatype:J.DOUBLE,componentsPerAttribute:3,values:d})),o.normal&&(E.normal=new Xe({componentDatatype:J.FLOAT,componentsPerAttribute:3,values:m})),o.tangent&&(E.tangent=new Xe({componentDatatype:J.FLOAT,componentsPerAttribute:3,values:p})),o.bitangent&&(E.bitangent=new Xe({componentDatatype:J.FLOAT,componentsPerAttribute:3,values:b})),o.st&&(E.st=new Xe({componentDatatype:J.FLOAT,componentsPerAttribute:2,values:u})),mee.x=t*.5,mee.y=Math.max(i,n);let A=new me(h.ZERO,k.magnitude(mee));if(l(e._offsetAttribute)){t=d.length;let L=e._offsetAttribute===bn.NONE?0:1,F=new Uint8Array(t/3).fill(L);E.applyOffset=new Xe({componentDatatype:J.UNSIGNED_BYTE,componentsPerAttribute:1,values:F})}return new At({attributes:E,indices:S,primitiveType:Ie.TRIANGLES,boundingSphere:A,offsetAttribute:e._offsetAttribute})};var hee;Zg.getUnitCylinder=function(){return l(hee)||(hee=Zg.createGeometry(new Zg({topRadius:1,bottomRadius:1,length:1,vertexFormat:Me.POSITION_ONLY}))),hee};var RY=Zg;var Hvi=x(T(),1);var fee=new k;function RV(e){e=e??B.EMPTY_OBJECT;let t=e.length,n=e.topRadius,i=e.bottomRadius,o=e.slices??128,r=Math.max(e.numberOfVerticalLines??16,0);this._length=t,this._topRadius=n,this._bottomRadius=i,this._slices=o,this._numberOfVerticalLines=r,this._offsetAttribute=e.offsetAttribute,this._workerName="createCylinderOutlineGeometry"}RV.packedLength=6;RV.pack=function(e,t,n){return n=n??0,t[n++]=e._length,t[n++]=e._topRadius,t[n++]=e._bottomRadius,t[n++]=e._slices,t[n++]=e._numberOfVerticalLines,t[n]=e._offsetAttribute??-1,t};var $S={length:void 0,topRadius:void 0,bottomRadius:void 0,slices:void 0,numberOfVerticalLines:void 0,offsetAttribute:void 0};RV.unpack=function(e,t,n){t=t??0;let i=e[t++],o=e[t++],r=e[t++],s=e[t++],a=e[t++],c=e[t];return l(n)?(n._length=i,n._topRadius=o,n._bottomRadius=r,n._slices=s,n._numberOfVerticalLines=a,n._offsetAttribute=c===-1?void 0:c,n):($S.length=i,$S.topRadius=o,$S.bottomRadius=r,$S.slices=s,$S.numberOfVerticalLines=a,$S.offsetAttribute=c===-1?void 0:c,new RV($S))};RV.createGeometry=function(e){let t=e._length,n=e._topRadius,i=e._bottomRadius,o=e._slices,r=e._numberOfVerticalLines;if(t<=0||n<0||i<0||n===0&&i===0)return;let s=o*2,a=qS.computePositions(t,n,i,o,!1),c=o*2,d;if(r>0){let y=Math.min(r,o);d=Math.round(o/y),c+=y}let u=Oe.createTypedArray(s,c*2),m=0,p;for(p=0;p<o-1;p++)u[m++]=p,u[m++]=p+1,u[m++]=p+o,u[m++]=p+1+o;if(u[m++]=o-1,u[m++]=0,u[m++]=o+o-1,u[m++]=o,r>0)for(p=0;p<o;p+=d)u[m++]=p,u[m++]=p+o;let b=new Rn;b.position=new Xe({componentDatatype:J.DOUBLE,componentsPerAttribute:3,values:a}),fee.x=t*.5,fee.y=Math.max(i,n);let f=new me(h.ZERO,k.magnitude(fee));if(l(e._offsetAttribute)){t=a.length;let y=e._offsetAttribute===bn.NONE?0:1,_=new Uint8Array(t/3).fill(y);b.applyOffset=new Xe({componentDatatype:J.UNSIGNED_BYTE,componentsPerAttribute:1,values:_})}return new At({attributes:b,indices:u,primitiveType:Ie.LINES,boundingSphere:f,offsetAttribute:e._offsetAttribute})};var CY=RV;var GRe=h.ZERO,LRe=new h,z0t=new h,WRe=new U;function H0t(e){this.id=e,this.vertexFormat=void 0,this.length=void 0,this.topRadius=void 0,this.bottomRadius=void 0,this.slices=void 0,this.numberOfVerticalLines=void 0,this.offsetAttribute=void 0}function zu(e,t){Wi.call(this,{entity:e,scene:t,geometryOptions:new H0t(e),geometryPropertyName:"cylinder",observedPropertyNames:["availability","position","orientation","cylinder"]}),this._onEntityPropertyChanged(e,"cylinder",e.cylinder,void 0)}l(Object.create)&&(zu.prototype=Object.create(Wi.prototype),zu.prototype.constructor=zu);Object.defineProperties(zu.prototype,{terrainOffsetProperty:{get:function(){return this._terrainOffsetProperty}}});zu.prototype.createFillGeometryInstance=function(e){let t=this._entity,n=t.isAvailable(e),i=new Wn(n&&t.isShowing&&this._showProperty.getValue(e)&&this._fillProperty.getValue(e)),o=this._distanceDisplayConditionProperty.getValue(e),r=ti.fromDistanceDisplayCondition(o),s={show:i,distanceDisplayCondition:r,color:void 0,offset:void 0};if(this._materialProperty instanceof Qt){let a;l(this._materialProperty.color)&&(this._materialProperty.color.isConstant||n)&&(a=this._materialProperty.color.getValue(e,WRe)),l(a)||(a=U.WHITE),s.color=$t.fromColor(a)}return l(this._options.offsetAttribute)&&(s.offset=Ro.fromCartesian3(j.getValueOrDefault(this._terrainOffsetProperty,e,GRe,LRe))),new Yt({id:t,geometry:new RY(this._options),modelMatrix:t.computeModelMatrixForHeightReference(e,t.cylinder.heightReference,this._options.length*.5,this._scene.ellipsoid),attributes:s})};zu.prototype.createOutlineGeometryInstance=function(e){let t=this._entity,n=t.isAvailable(e),i=j.getValueOrDefault(this._outlineColorProperty,e,U.BLACK,WRe),o=this._distanceDisplayConditionProperty.getValue(e),r={show:new Wn(n&&t.isShowing&&this._showProperty.getValue(e)&&this._showOutlineProperty.getValue(e)),color:$t.fromColor(i),distanceDisplayCondition:ti.fromDistanceDisplayCondition(o),offset:void 0};return l(this._options.offsetAttribute)&&(r.offset=Ro.fromCartesian3(j.getValueOrDefault(this._terrainOffsetProperty,e,GRe,LRe))),new Yt({id:t,geometry:new CY(this._options),modelMatrix:t.computeModelMatrixForHeightReference(e,t.cylinder.heightReference,this._options.length*.5,this._scene.ellipsoid),attributes:r})};zu.prototype._computeCenter=function(e,t){return j.getValueOrUndefined(this._entity.position,e,t)};zu.prototype._isHidden=function(e,t){return!l(e.position)||!l(t.length)||!l(t.topRadius)||!l(t.bottomRadius)||Wi.prototype._isHidden.call(this,e,t)};zu.prototype._isDynamic=function(e,t){return!e.position.isConstant||!j.isConstant(e.orientation)||!t.length.isConstant||!t.topRadius.isConstant||!t.bottomRadius.isConstant||!j.isConstant(t.slices)||!j.isConstant(t.outlineWidth)||!j.isConstant(t.numberOfVerticalLines)};zu.prototype._setStaticOptions=function(e,t){let n=j.getValueOrDefault(t.heightReference,ot.MINIMUM_VALUE,He.NONE),i=this._options;i.vertexFormat=this._materialProperty instanceof Qt?Tn.VERTEX_FORMAT:Co.MaterialSupport.TEXTURED.vertexFormat,i.length=t.length.getValue(ot.MINIMUM_VALUE),i.topRadius=t.topRadius.getValue(ot.MINIMUM_VALUE),i.bottomRadius=t.bottomRadius.getValue(ot.MINIMUM_VALUE),i.slices=j.getValueOrUndefined(t.slices,ot.MINIMUM_VALUE),i.numberOfVerticalLines=j.getValueOrUndefined(t.numberOfVerticalLines,ot.MINIMUM_VALUE),i.offsetAttribute=n!==He.NONE?bn.ALL:void 0};zu.prototype._onEntityPropertyChanged=Cb;zu.DynamicGeometryUpdater=CV;function CV(e,t,n){Li.call(this,e,t,n)}l(Object.create)&&(CV.prototype=Object.create(Li.prototype),CV.prototype.constructor=CV);CV.prototype._isHidden=function(e,t,n){let i=this._options,o=j.getValueOrUndefined(e.position,n,z0t);return!l(o)||!l(i.length)||!l(i.topRadius)||!l(i.bottomRadius)||Li.prototype._isHidden.call(this,e,t,n)};CV.prototype._setOptions=function(e,t,n){let i=j.getValueOrDefault(t.heightReference,n,He.NONE),o=this._options;o.length=j.getValueOrUndefined(t.length,n),o.topRadius=j.getValueOrUndefined(t.topRadius,n),o.bottomRadius=j.getValueOrUndefined(t.bottomRadius,n),o.slices=j.getValueOrUndefined(t.slices,n),o.numberOfVerticalLines=j.getValueOrUndefined(t.numberOfVerticalLines,n),o.offsetAttribute=i!==He.NONE?bn.ALL:void 0};var VY=zu;var yNi=x(T(),1);var g2i=x(T(),1),vRe={UNBOUNDED:0,CLAMPED:1,LOOP_STOP:2};Object.freeze(vRe);var As=vRe;var x2i=x(T(),1),FRe={TICK_DEPENDENT:0,SYSTEM_CLOCK_MULTIPLIER:1,SYSTEM_CLOCK:2};Object.freeze(FRe);var Oo=FRe;var _2i=x(T(),1),IRe={NONE:0,HOLD:1,EXTRAPOLATE:2,LINEAR_EXTRAPOLATE:3};Object.freeze(IRe);var cd=IRe;var Z2i=x(T(),1),PRe=x(gu(),1);function K0t(e){let t=new PRe.default(e);t.normalize();let n=t.path(),i=n.lastIndexOf("/");return i!==-1&&(n=n.substr(i+1)),n}var Rg=K0t;var E2i=x(T(),1);var J0t=W.factorial;function pee(e,t,n,i,o,r){let s=0,a,c,d;if(i>0){for(c=0;c<o;c++){for(a=!1,d=0;d<r.length&&!a;d++)c===r[d]&&(a=!0);a||(r.push(c),s+=pee(e,t,n,i-1,o,r),r.splice(r.length-1,1))}return s}for(s=1,c=0;c<o;c++){for(a=!1,d=0;d<r.length&&!a;d++)c===r[d]&&(a=!0);a||(s*=e-n[t[c]])}return s}var j0t=[],bee=class{static get type(){return"Hermite"}static getRequiredDataPoints(t,n){return n=n??0,Math.max(Math.floor((t+1)/(n+1)),2)}static interpolateOrderZero(t,n,i,o,r){l(r)||(r=new Array(o));let s,a,c,d,u,m,p=n.length,b=new Array(o);for(s=0;s<o;s++){r[s]=0;let S=new Array(p);for(b[s]=S,a=0;a<p;a++)S[a]=[]}let f=p,y=new Array(f);for(s=0;s<f;s++)y[s]=s;let _=p-1;for(d=0;d<o;d++){for(a=0;a<f;a++)m=y[a]*o+d,b[d][0].push(i[m]);for(s=1;s<f;s++){let S=!1;for(a=0;a<f-s;a++){let Z=n[y[a]],R=n[y[a+s]],C;R-Z<=0?(m=y[a]*o+o*s+d,C=i[m],b[d][s].push(C/J0t(s))):(C=b[d][s-1][a+1]-b[d][s-1][a],b[d][s].push(C/(R-Z))),S=S||C!==0}S||(_=s-1)}}for(c=0,u=0;c<=u;c++)for(s=c;s<=_;s++){let S=pee(t,y,n,c,s,[]);for(d=0;d<o;d++){let Z=b[d][s][0];r[d+c*o]+=Z*S}}return r}static interpolate(t,n,i,o,r,s,a){let c=o*(s+1);l(a)||(a=new Array(c));for(let Z=0;Z<c;Z++)a[Z]=0;let d=n.length,u=new Array(d*(r+1)),m;for(m=0;m<d;m++)for(let Z=0;Z<r+1;Z++)u[m*(r+1)+Z]=m;let p=u.length,b=j0t,f=Q0t(b,u,n,i,o,r),y=[],_=p*(p+1)/2,S=Math.min(f,s);for(let Z=0;Z<=S;Z++)for(m=Z;m<=f;m++){y.length=0;let R=pee(t,u,n,Z,m,y),C=Math.floor(m*(1-m)/2)+p*m;for(let E=0;E<o;E++){let A=Math.floor(E*_),L=b[A+C];a[E+Z*o]+=L*R}}return a}};function Q0t(e,t,n,i,o,r){let s,a,c=-1,d=t.length,u=d*(d+1)/2;for(let m=0;m<o;m++){let p=Math.floor(m*u);for(s=0;s<d;s++)a=t[s]*o*(r+1)+m,e[p+s]=i[a];for(let b=1;b<d;b++){let f=0,y=Math.floor(b*(1-b)/2)+d*b,_=!1;for(s=0;s<d-b;s++){let S=n[t[s]],Z=n[t[s+b]],R,C;if(Z-S<=0)a=t[s]*o*(r+1)+o*b+m,R=i[a],C=R/W.factorial(b),e[p+y+f]=C,f++;else{let E=Math.floor((b-1)*(2-b)/2)+d*(b-1);R=e[p+E+s+1]-e[p+E+s],C=R/(Z-S),e[p+y+f]=C,f++}_=_||R!==0}_&&(c=Math.max(c,b))}}return c}var EY=bee;var L2i=x(T(),1);var gee=class{static get type(){return"Lagrange"}static getRequiredDataPoints(t){return Math.max(t+1,2)}static interpolateOrderZero(t,n,i,o,r){l(r)||(r=new Array(o));let s,a,c=n.length;for(s=0;s<o;s++)r[s]=0;for(s=0;s<c;s++){let d=1;for(a=0;a<c;a++)if(a!==s){let u=n[s]-n[a];d*=(t-n[a])/u}for(a=0;a<o;a++)r[a]+=d*i[s*o+a]}return r}},AY=gee;var F2i=x(T(),1);var yee=class{static get type(){return"Linear"}static getRequiredDataPoints(t){return 2}static interpolateOrderZero(t,n,i,o,r){l(r)||(r=new Array(o));let s,a,c,d=n[0],u=n[1];for(s=0;s<o;s++)a=i[s],c=i[s+o],r[s]=((c-a)*t+u*a-d*c)/(u-d);return r}},Bx=yee;var X2i=x(T(),1);function gl(e,t,n){this.clock=e??0,this.cone=t??0,this.magnitude=n??1}gl.fromCartesian3=function(e,t){let n=e.x,i=e.y,o=e.z,r=n*n+i*i;return l(t)||(t=new gl),t.clock=Math.atan2(i,n),t.cone=Math.atan2(Math.sqrt(r),o),t.magnitude=Math.sqrt(r+o*o),t};gl.clone=function(e,t){if(l(e))return l(t)?(t.clock=e.clock,t.cone=e.cone,t.magnitude=e.magnitude,t):new gl(e.clock,e.cone,e.magnitude)};gl.normalize=function(e,t){return l(t)?(t.clock=e.clock,t.cone=e.cone,t.magnitude=1,t):new gl(e.clock,e.cone,1)};gl.equals=function(e,t){return e===t||l(e)&&l(t)&&e.clock===t.clock&&e.cone===t.cone&&e.magnitude===t.magnitude};gl.equalsEpsilon=function(e,t,n){return n=n??0,e===t||l(e)&&l(t)&&Math.abs(e.clock-t.clock)<=n&&Math.abs(e.cone-t.cone)<=n&&Math.abs(e.magnitude-t.magnitude)<=n};gl.prototype.equals=function(e){return gl.equals(this,e)};gl.prototype.clone=function(e){return gl.clone(this,e)};gl.prototype.equalsEpsilon=function(e,t){return gl.equalsEpsilon(this,e,t)};gl.prototype.toString=function(){return`(${this.clock}, ${this.cone}, ${this.magnitude})`};var GY=gl;var IY=x(gu(),1);var eFi=x(T(),1);var H2i=x(T(),1);var Y2i=x(T(),1),xee;typeof performance<"u"&&typeof performance.now=="function"&&isFinite(performance.now())?xee=function(){return performance.now()}:xee=function(){return Date.now()};var Zn=xee;function Tee(e){e=e??B.EMPTY_OBJECT;let t=e.currentTime,n=e.startTime,i=e.stopTime;l(t)?t=Q.clone(t):l(n)?t=Q.clone(n):l(i)?t=Q.addDays(i,-1,new Q):t=Q.now(),l(n)?n=Q.clone(n):n=Q.clone(t),l(i)?i=Q.clone(i):i=Q.addDays(n,1,new Q),this.startTime=n,this.stopTime=i,this.clockRange=e.clockRange??As.UNBOUNDED,this.canAnimate=e.canAnimate??!0,this.onTick=new Se,this.onStop=new Se,this._currentTime=void 0,this._multiplier=void 0,this._clockStep=void 0,this._shouldAnimate=void 0,this._lastSystemTime=Zn(),this.currentTime=t,this.multiplier=e.multiplier??1,this.shouldAnimate=e.shouldAnimate??!1,this.clockStep=e.clockStep??Oo.SYSTEM_CLOCK_MULTIPLIER}Object.defineProperties(Tee.prototype,{currentTime:{get:function(){return this._currentTime},set:function(e){Q.equals(this._currentTime,e)||(this._clockStep===Oo.SYSTEM_CLOCK&&(this._clockStep=Oo.SYSTEM_CLOCK_MULTIPLIER),this._currentTime=e)}},multiplier:{get:function(){return this._multiplier},set:function(e){this._multiplier!==e&&(this._clockStep===Oo.SYSTEM_CLOCK&&(this._clockStep=Oo.SYSTEM_CLOCK_MULTIPLIER),this._multiplier=e)}},clockStep:{get:function(){return this._clockStep},set:function(e){e===Oo.SYSTEM_CLOCK&&(this._multiplier=1,this._shouldAnimate=!0,this._currentTime=Q.now()),this._clockStep=e}},shouldAnimate:{get:function(){return this._shouldAnimate},set:function(e){this._shouldAnimate!==e&&(this._clockStep===Oo.SYSTEM_CLOCK&&(this._clockStep=Oo.SYSTEM_CLOCK_MULTIPLIER),this._shouldAnimate=e)}}});Tee.prototype.tick=function(){let e=Zn(),t=Q.clone(this._currentTime);if(this.canAnimate&&this._shouldAnimate){let n=this._clockStep;if(n===Oo.SYSTEM_CLOCK)t=Q.now(t);else{let i=this._multiplier;if(n===Oo.TICK_DEPENDENT)t=Q.addSeconds(t,i,t);else{let a=e-this._lastSystemTime;t=Q.addSeconds(t,i*(a/1e3),t)}let o=this.clockRange,r=this.startTime,s=this.stopTime;if(o===As.CLAMPED)Q.lessThan(t,r)?t=Q.clone(r,t):Q.greaterThan(t,s)&&(t=Q.clone(s,t),this.onStop.raiseEvent(this));else if(o===As.LOOP_STOP)for(Q.lessThan(t,r)&&(t=Q.clone(r,t));Q.greaterThan(t,s);)t=Q.addSeconds(r,Q.secondsDifference(t,s),t),this.onStop.raiseEvent(this)}}return this._currentTime=t,this._lastSystemTime=e,this.onTick.raiseEvent(this),t};var Wf=Tee;function eZ(){this._definitionChanged=new Se,this._startTime=void 0,this._stopTime=void 0,this._currentTime=void 0,this._clockRange=void 0,this._clockStep=void 0,this._multiplier=void 0}Object.defineProperties(eZ.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},startTime:zl("startTime"),stopTime:zl("stopTime"),currentTime:zl("currentTime"),clockRange:zl("clockRange"),clockStep:zl("clockStep"),multiplier:zl("multiplier")});eZ.prototype.clone=function(e){return l(e)||(e=new eZ),e.startTime=this.startTime,e.stopTime=this.stopTime,e.currentTime=this.currentTime,e.clockRange=this.clockRange,e.clockStep=this.clockStep,e.multiplier=this.multiplier,e};eZ.prototype.equals=function(e){return this===e||l(e)&&Q.equals(this.startTime,e.startTime)&&Q.equals(this.stopTime,e.stopTime)&&Q.equals(this.currentTime,e.currentTime)&&this.clockRange===e.clockRange&&this.clockStep===e.clockStep&&this.multiplier===e.multiplier};eZ.prototype.merge=function(e){this.startTime=this.startTime??e.startTime,this.stopTime=this.stopTime??e.stopTime,this.currentTime=this.currentTime??e.currentTime,this.clockRange=this.clockRange??e.clockRange,this.clockStep=this.clockStep??e.clockStep,this.multiplier=this.multiplier??e.multiplier};eZ.prototype.getValue=function(e){return l(e)||(e=new Wf),e.startTime=this.startTime??e.startTime,e.stopTime=this.stopTime??e.stopTime,e.currentTime=this.currentTime??e.currentTime,e.clockRange=this.clockRange??e.clockRange,e.multiplier=this.multiplier??e.multiplier,e.clockStep=this.clockStep??e.clockStep,e};var vf=eZ;var dFi=x(T(),1);var q0t=U.WHITE,$0t=.1,ebt=new k(8,8),tbt=new k(0,0),nbt=new k(1,1);function VV(e){e=e??B.EMPTY_OBJECT,this._definitionChanged=new Se,this._color=void 0,this._colorSubscription=void 0,this._cellAlpha=void 0,this._cellAlphaSubscription=void 0,this._lineCount=void 0,this._lineCountSubscription=void 0,this._lineThickness=void 0,this._lineThicknessSubscription=void 0,this._lineOffset=void 0,this._lineOffsetSubscription=void 0,this.color=e.color,this.cellAlpha=e.cellAlpha,this.lineCount=e.lineCount,this.lineThickness=e.lineThickness,this.lineOffset=e.lineOffset}Object.defineProperties(VV.prototype,{isConstant:{get:function(){return j.isConstant(this._color)&&j.isConstant(this._cellAlpha)&&j.isConstant(this._lineCount)&&j.isConstant(this._lineThickness)&&j.isConstant(this._lineOffset)}},definitionChanged:{get:function(){return this._definitionChanged}},color:be("color"),cellAlpha:be("cellAlpha"),lineCount:be("lineCount"),lineThickness:be("lineThickness"),lineOffset:be("lineOffset")});VV.prototype.getType=function(e){return"Grid"};var ibt=new Q;VV.prototype.getValue=function(e,t){return l(e)||(e=Q.now(ibt)),l(t)||(t={}),t.color=j.getValueOrClonedDefault(this._color,e,q0t,t.color),t.cellAlpha=j.getValueOrDefault(this._cellAlpha,e,$0t),t.lineCount=j.getValueOrClonedDefault(this._lineCount,e,ebt,t.lineCount),t.lineThickness=j.getValueOrClonedDefault(this._lineThickness,e,nbt,t.lineThickness),t.lineOffset=j.getValueOrClonedDefault(this._lineOffset,e,tbt,t.lineOffset),t};VV.prototype.equals=function(e){return this===e||e instanceof VV&&j.equals(this._color,e._color)&&j.equals(this._cellAlpha,e._cellAlpha)&&j.equals(this._lineCount,e._lineCount)&&j.equals(this._lineThickness,e._lineThickness)&&j.equals(this._lineOffset,e._lineOffset)};var EV=VV;var mFi=x(T(),1),XRe={WHOLE:0,PORTIONS:1};Object.freeze(XRe);var n0=XRe;var TFi=x(T(),1);function AV(e){this._definitionChanged=new Se,this._color=void 0,this._colorSubscription=void 0,this.color=e}Object.defineProperties(AV.prototype,{isConstant:{get:function(){return j.isConstant(this._color)}},definitionChanged:{get:function(){return this._definitionChanged}},color:be("color")});AV.prototype.getType=function(e){return"PolylineArrow"};var obt=new Q;AV.prototype.getValue=function(e,t){return l(e)||(e=Q.now(obt)),l(t)||(t={}),t.color=j.getValueOrClonedDefault(this._color,e,U.WHITE,t.color),t};AV.prototype.equals=function(e){return this===e||e instanceof AV&&j.equals(this._color,e._color)};var GV=AV;var GFi=x(T(),1);var rbt=U.WHITE,sbt=U.TRANSPARENT,abt=16,cbt=255;function LV(e){e=e??B.EMPTY_OBJECT,this._definitionChanged=new Se,this._color=void 0,this._colorSubscription=void 0,this._gapColor=void 0,this._gapColorSubscription=void 0,this._dashLength=void 0,this._dashLengthSubscription=void 0,this._dashPattern=void 0,this._dashPatternSubscription=void 0,this.color=e.color,this.gapColor=e.gapColor,this.dashLength=e.dashLength,this.dashPattern=e.dashPattern}Object.defineProperties(LV.prototype,{isConstant:{get:function(){return j.isConstant(this._color)&&j.isConstant(this._gapColor)&&j.isConstant(this._dashLength)&&j.isConstant(this._dashPattern)}},definitionChanged:{get:function(){return this._definitionChanged}},color:be("color"),gapColor:be("gapColor"),dashLength:be("dashLength"),dashPattern:be("dashPattern")});LV.prototype.getType=function(e){return"PolylineDash"};var lbt=new Q;LV.prototype.getValue=function(e,t){return l(e)||(e=Q.now(lbt)),l(t)||(t={}),t.color=j.getValueOrClonedDefault(this._color,e,rbt,t.color),t.gapColor=j.getValueOrClonedDefault(this._gapColor,e,sbt,t.gapColor),t.dashLength=j.getValueOrDefault(this._dashLength,e,abt,t.dashLength),t.dashPattern=j.getValueOrDefault(this._dashPattern,e,cbt,t.dashPattern),t};LV.prototype.equals=function(e){return this===e||e instanceof LV&&j.equals(this._color,e._color)&&j.equals(this._gapColor,e._gapColor)&&j.equals(this._dashLength,e._dashLength)&&j.equals(this._dashPattern,e._dashPattern)};var WV=LV;var YFi=x(T(),1);var dbt=U.WHITE,ubt=.25,mbt=1;function vV(e){e=e??B.EMPTY_OBJECT,this._definitionChanged=new Se,this._color=void 0,this._colorSubscription=void 0,this._glowPower=void 0,this._glowPowerSubscription=void 0,this._taperPower=void 0,this._taperPowerSubscription=void 0,this.color=e.color,this.glowPower=e.glowPower,this.taperPower=e.taperPower}Object.defineProperties(vV.prototype,{isConstant:{get:function(){return j.isConstant(this._color)&&j.isConstant(this._glow)}},definitionChanged:{get:function(){return this._definitionChanged}},color:be("color"),glowPower:be("glowPower"),taperPower:be("taperPower")});vV.prototype.getType=function(e){return"PolylineGlow"};var hbt=new Q;vV.prototype.getValue=function(e,t){return l(e)||(e=Q.now(hbt)),l(t)||(t={}),t.color=j.getValueOrClonedDefault(this._color,e,dbt,t.color),t.glowPower=j.getValueOrDefault(this._glowPower,e,ubt,t.glowPower),t.taperPower=j.getValueOrDefault(this._taperPower,e,mbt,t.taperPower),t};vV.prototype.equals=function(e){return this===e||e instanceof vV&&j.equals(this._color,e._color)&&j.equals(this._glowPower,e._glowPower)&&j.equals(this._taperPower,e._taperPower)};var FV=vV;var HFi=x(T(),1);var fbt=U.WHITE,pbt=U.BLACK,bbt=1;function IV(e){e=e??B.EMPTY_OBJECT,this._definitionChanged=new Se,this._color=void 0,this._colorSubscription=void 0,this._outlineColor=void 0,this._outlineColorSubscription=void 0,this._outlineWidth=void 0,this._outlineWidthSubscription=void 0,this.color=e.color,this.outlineColor=e.outlineColor,this.outlineWidth=e.outlineWidth}Object.defineProperties(IV.prototype,{isConstant:{get:function(){return j.isConstant(this._color)&&j.isConstant(this._outlineColor)&&j.isConstant(this._outlineWidth)}},definitionChanged:{get:function(){return this._definitionChanged}},color:be("color"),outlineColor:be("outlineColor"),outlineWidth:be("outlineWidth")});IV.prototype.getType=function(e){return"PolylineOutline"};var gbt=new Q;IV.prototype.getValue=function(e,t){return l(e)||(e=Q.now(gbt)),l(t)||(t={}),t.color=j.getValueOrClonedDefault(this._color,e,fbt,t.color),t.outlineColor=j.getValueOrClonedDefault(this._outlineColor,e,pbt,t.outlineColor),t.outlineWidth=j.getValueOrDefault(this._outlineWidth,e,bbt),t};IV.prototype.equals=function(e){return this===e||e instanceof IV&&j.equals(this._color,e._color)&&j.equals(this._outlineColor,e._outlineColor)&&j.equals(this._outlineWidth,e._outlineWidth)};var zx=IV;var tIi=x(T(),1);function Cg(e,t){this._value=void 0,this._definitionChanged=new Se,this._eventHelper=new Hr,this._referenceFrame=t??Oi.FIXED,this.setValue(e)}Object.defineProperties(Cg.prototype,{isConstant:{get:function(){let e=this._value;if(!l(e))return!0;let t=e.length;for(let n=0;n<t;n++)if(!j.isConstant(e[n]))return!1;return!0}},definitionChanged:{get:function(){return this._definitionChanged}},referenceFrame:{get:function(){return this._referenceFrame}}});var ybt=new Q;Cg.prototype.getValue=function(e,t){return l(e)||(e=Q.now(ybt)),this.getValueInReferenceFrame(e,Oi.FIXED,t)};Cg.prototype.getValueInReferenceFrame=function(e,t,n){let i=this._value;if(!l(i))return;let o=i.length;l(n)||(n=new Array(o));let r=0,s=0;for(;r<o;){let c=i[r].getValueInReferenceFrame(e,t,n[r]);l(c)&&(n[s]=c,s++),r++}return n.length=s,n};Cg.prototype.setValue=function(e){let t=this._eventHelper;if(t.removeAll(),l(e)){this._value=e.slice();let n=e.length;for(let i=0;i<n;i++){let o=e[i];l(o)&&t.add(o.definitionChanged,Cg.prototype._raiseDefinitionChanged,this)}}else this._value=void 0;this._definitionChanged.raiseEvent(this)};Cg.prototype.equals=function(e){return this===e||e instanceof Cg&&this._referenceFrame===e._referenceFrame&&j.arrayEquals(this._value,e._value)};Cg.prototype._raiseDefinitionChanged=function(){this._definitionChanged.raiseEvent(this)};var Vg=Cg;var cIi=x(T(),1);function Hx(e){this._value=void 0,this._definitionChanged=new Se,this._eventHelper=new Hr,this.setValue(e)}Object.defineProperties(Hx.prototype,{isConstant:{get:function(){let e=this._value;if(!l(e))return!0;let t=e.length;for(let n=0;n<t;n++)if(!j.isConstant(e[n]))return!1;return!0}},definitionChanged:{get:function(){return this._definitionChanged}}});var xbt=new Q;Hx.prototype.getValue=function(e,t){l(e)||(e=Q.now(xbt));let n=this._value;if(!l(n))return;let i=n.length;l(t)||(t=new Array(i));let o=0,r=0;for(;o<i;){let a=this._value[o].getValue(e,t[o]);l(a)&&(t[r]=a,r++),o++}return t.length=r,t};Hx.prototype.setValue=function(e){let t=this._eventHelper;if(t.removeAll(),l(e)){this._value=e.slice();let n=e.length;for(let i=0;i<n;i++){let o=e[i];l(o)&&t.add(o.definitionChanged,Hx.prototype._raiseDefinitionChanged,this)}}else this._value=void 0;this._definitionChanged.raiseEvent(this)};Hx.prototype.equals=function(e){return this===e||e instanceof Hx&&j.arrayEquals(this._value,e._value)};Hx.prototype._raiseDefinitionChanged=function(){this._definitionChanged.raiseEvent(this)};var PV=Hx;var fIi=x(T(),1);function tZ(e){let t=e._targetProperty;if(!l(t)){let n=e._targetEntity;if(!l(n)){if(n=e._targetCollection.getById(e._targetId),!l(n)){e._targetEntity=e._targetProperty=void 0;return}n.definitionChanged.addEventListener(Hu.prototype._onTargetEntityDefinitionChanged,e),e._targetEntity=n}let i=e._targetPropertyNames;t=e._targetEntity;for(let o=0,r=i.length;o<r&&l(t);++o)t=t[i[o]];e._targetProperty=t}return t}function Hu(e,t,n){this._targetCollection=e,this._targetId=t,this._targetPropertyNames=n,this._targetProperty=void 0,this._targetEntity=void 0,this._definitionChanged=new Se,e.collectionChanged.addEventListener(Hu.prototype._onCollectionChanged,this)}Object.defineProperties(Hu.prototype,{isConstant:{get:function(){return j.isConstant(tZ(this))}},definitionChanged:{get:function(){return this._definitionChanged}},referenceFrame:{get:function(){let e=tZ(this);return l(e)?e.referenceFrame:void 0}},targetId:{get:function(){return this._targetId}},targetCollection:{get:function(){return this._targetCollection}},targetPropertyNames:{get:function(){return this._targetPropertyNames}},resolvedProperty:{get:function(){return tZ(this)}}});Hu.fromString=function(e,t){let n,i=[],o=!0,r=!1,s="";for(let a=0;a<t.length;++a){let c=t.charAt(a);r?(s+=c,r=!1):c==="\\"?r=!0:o&&c==="#"?(n=s,o=!1,s=""):!o&&c==="."?(i.push(s),s=""):s+=c}return i.push(s),new Hu(e,n,i)};var Tbt=new Q;Hu.prototype.getValue=function(e,t){let n=tZ(this);return l(e)||(e=Q.now(Tbt)),l(n)?n.getValue(e,t):void 0};Hu.prototype.getValueInReferenceFrame=function(e,t,n){let i=tZ(this);return l(i)?i.getValueInReferenceFrame(e,t,n):void 0};Hu.prototype.getType=function(e){let t=tZ(this);return l(t)?t.getType(e):void 0};Hu.prototype.equals=function(e){if(this===e)return!0;let t=this._targetPropertyNames,n=e._targetPropertyNames;if(this._targetCollection!==e._targetCollection||this._targetId!==e._targetId||t.length!==n.length)return!1;let i=this._targetPropertyNames.length;for(let o=0;o<i;o++)if(t[o]!==n[o])return!1;return!0};Hu.prototype._onTargetEntityDefinitionChanged=function(e,t,n,i){l(this._targetProperty)&&this._targetPropertyNames[0]===t&&(this._targetProperty=void 0,this._definitionChanged.raiseEvent(this))};Hu.prototype._onCollectionChanged=function(e,t,n){let i=this._targetEntity;l(i)&&n.indexOf(i)!==-1?(i.definitionChanged.removeEventListener(Hu.prototype._onTargetEntityDefinitionChanged,this),this._targetEntity=this._targetProperty=void 0):l(i)||(i=tZ(this),l(i)&&this._definitionChanged.raiseEvent(this))};var Eg=Hu;var yIi=x(T(),1);var _bt={packedLength:1,pack:function(e,t,n){return n=n??0,t[n]=e,t},unpack:function(e,t,n){return t=t??0,e[t]},convertPackedArrayForInterpolation:function(e,t,n,i){l(i)||(i=[]),t=t??0,n=n??e.length;let o;for(let r=0,s=n-t+1;r<s;r++){let a=e[t+r];r===0||Math.abs(o-a)<Math.PI?i[r]=a:i[r]=a-W.TWO_PI,o=a}},unpackInterpolationResult:function(e,t,n,i,o){return o=e[0],o<0?o+W.TWO_PI:o}},rh=_bt;var XIi=x(T(),1);var VIi=x(T(),1);var NRe={packedLength:1,pack:function(e,t,n){n=n??0,t[n]=e},unpack:function(e,t,n){return t=t??0,e[t]}};function YRe(e,t,n){let i,o=e.length,r=n.length,s=o+r;if(e.length=s,o!==t){let a=o-1;for(i=s-1;i>=t;i--)e[i]=e[a--]}for(i=0;i<r;i++)e[t++]=n[i]}function MRe(e,t){return e instanceof Q?e:typeof e=="string"?Q.fromIso8601(e):Q.addSeconds(t,e,new Q)}var _ee=[],See=[];function m3(e,t,n,i,o){let r=0,s,a,c,d,u,m;for(;r<i.length;){u=MRe(i[r],e),c=Eo(t,u,Q.compare);let p=0,b=0;if(c<0){for(c=~c,d=c*o,a=void 0,m=t[c];r<i.length&&(u=MRe(i[r],e),!(l(a)&&Q.compare(a,u)>=0||l(m)&&Q.compare(u,m)>=0));){for(_ee[p++]=u,r=r+1,s=0;s<o;s++)See[b++]=i[r],r=r+1;a=u}p>0&&(See.length=b,YRe(n,d,See),_ee.length=p,YRe(t,c,_ee))}else{for(s=0;s<o;s++)r++,n[c*o+s]=i[r];r++}}}function sh(e,t){let n=e;n===Number&&(n=NRe);let i=n.packedLength,o=n.packedInterpolationLength??i,r=0,s;if(l(t)){let a=t.length;s=new Array(a);for(let c=0;c<a;c++){let d=t[c];d===Number&&(d=NRe);let u=d.packedLength;i+=u,o+=d.packedInterpolationLength??u,s[c]=d}r=a}this._type=e,this._innerType=n,this._interpolationDegree=1,this._interpolationAlgorithm=Bx,this._lastInterpolationAlgorithm=Bx,this._numberOfPoints=0,this._times=[],this._values=[],this._xTable=[],this._yTable=[],this._packedLength=i,this._packedInterpolationLength=o,this._updateTableLength=!0,this._interpolationResult=new Array(o),this._definitionChanged=new Se,this._derivativeTypes=t,this._innerDerivativeTypes=s,this._inputOrder=r,this._forwardExtrapolationType=cd.NONE,this._forwardExtrapolationDuration=0,this._backwardExtrapolationType=cd.NONE,this._backwardExtrapolationDuration=0}Object.defineProperties(sh.prototype,{isConstant:{get:function(){return this._values.length===0}},definitionChanged:{get:function(){return this._definitionChanged}},type:{get:function(){return this._type}},derivativeTypes:{get:function(){return this._derivativeTypes}},interpolationDegree:{get:function(){return this._interpolationDegree}},interpolationAlgorithm:{get:function(){return this._interpolationAlgorithm}},forwardExtrapolationType:{get:function(){return this._forwardExtrapolationType},set:function(e){this._forwardExtrapolationType!==e&&(this._forwardExtrapolationType=e,this._definitionChanged.raiseEvent(this))}},forwardExtrapolationDuration:{get:function(){return this._forwardExtrapolationDuration},set:function(e){this._forwardExtrapolationDuration!==e&&(this._forwardExtrapolationDuration=e,this._definitionChanged.raiseEvent(this))}},backwardExtrapolationType:{get:function(){return this._backwardExtrapolationType},set:function(e){this._backwardExtrapolationType!==e&&(this._backwardExtrapolationType=e,this._definitionChanged.raiseEvent(this))}},backwardExtrapolationDuration:{get:function(){return this._backwardExtrapolationDuration},set:function(e){this._backwardExtrapolationDuration!==e&&(this._backwardExtrapolationDuration=e,this._definitionChanged.raiseEvent(this))}}});var Sbt=new Q;sh.prototype.getValue=function(e,t){l(e)||(e=Q.now(Sbt));let n=this._times,i=n.length;if(i===0)return;let o,r=this._innerType,s=this._values,a=Eo(n,e,Q.compare);var c=!1;if(a<0){if(a=~a,a===0){let A=n[a];if(o=this._backwardExtrapolationDuration,this._backwardExtrapolationType===cd.NONE||o!==0&&Q.secondsDifference(A,e)>o)return;if(this._backwardExtrapolationType===cd.HOLD)return r.unpack(s,0,t);c=this._backwardExtrapolationType===cd.LINEAR_EXTRAPOLATE}if(a>=i){a=i-1;let A=n[a];if(o=this._forwardExtrapolationDuration,this._forwardExtrapolationType===cd.NONE||o!==0&&Q.secondsDifference(e,A)>o)return;if(this._forwardExtrapolationType===cd.HOLD)return a=i-1,r.unpack(s,a*r.packedLength,t);c=this._forwardExtrapolationType===cd.LINEAR_EXTRAPOLATE}let m=this._xTable,p=this._yTable;var d,u;c?(d=Cesium.LinearApproximation,u=1):(d=this._interpolationAlgorithm,u=this._interpolationDegree),this._lastInterpolationAlgorithm!=d&&(this._lastInterpolationAlgorithm=d,this._updateTableLength=!0);let b=this._packedInterpolationLength,f=this._inputOrder;if(this._updateTableLength){this._updateTableLength=!1;let A=Math.min(d.getRequiredDataPoints(u,f),i);A!==this._numberOfPoints&&(this._numberOfPoints=A,m.length=A,p.length=A*b)}let y=this._numberOfPoints-1;if(y<1)return;let _=0,S=i-1;if(S-_+1>=y+1){let A=a-(y/2|0)-1;A<_&&(A=_);let L=A+y;L>S&&(L=S,A=L-y,A<_&&(A=_)),_=A,S=L}let R=S-_+1;for(let A=0;A<R;++A)m[A]=Q.secondsDifference(n[_+A],n[S]);if(l(r.convertPackedArrayForInterpolation))r.convertPackedArrayForInterpolation(s,_,S,p);else{let A=0,L=this._packedLength,F=_*L,I=(S+1)*L;for(;F<I;)p[A]=s[F],F++,A++}let C=Q.secondsDifference(e,n[S]),E;if(f===0||!l(d.interpolate))E=d.interpolateOrderZero(C,m,p,b,this._interpolationResult);else{let A=Math.floor(b/(f+1));E=d.interpolate(C,m,p,A,f,f,this._interpolationResult)}return l(r.unpackInterpolationResult)?r.unpackInterpolationResult(E,s,_,S,t):r.unpack(E,0,t)}return r.unpack(s,a*this._packedLength,t)};sh.prototype.setInterpolationOptions=function(e){if(!l(e))return;let t=!1,n=e.interpolationAlgorithm,i=e.interpolationDegree;l(n)&&this._interpolationAlgorithm!==n&&(this._interpolationAlgorithm=n,t=!0),l(i)&&this._interpolationDegree!==i&&(this._interpolationDegree=i,t=!0),t&&(this._updateTableLength=!0,this._definitionChanged.raiseEvent(this))};sh.prototype.addSample=function(e,t,n){let i=this._innerDerivativeTypes,o=l(i),r=this._innerType,s=[];if(s.push(e),r.pack(t,s,s.length),o){let a=i.length;for(let c=0;c<a;c++)i[c].pack(n[c],s,s.length)}m3(void 0,this._times,this._values,s,this._packedLength),this._updateTableLength=!0,this._definitionChanged.raiseEvent(this)};sh.prototype.addSamples=function(e,t,n){let i=this._innerDerivativeTypes,o=l(i),r=this._innerType,s=e.length,a=[];for(let c=0;c<s;c++)if(a.push(e[c]),r.pack(t[c],a,a.length),o){let d=n[c],u=i.length;for(let m=0;m<u;m++)i[m].pack(d[m],a,a.length)}m3(void 0,this._times,this._values,a,this._packedLength),this._updateTableLength=!0,this._definitionChanged.raiseEvent(this)};sh.prototype.getSample=function(e){let t=this._times,n=t.length;if(l(n))return e<0&&(e+=n),t[e]};sh.prototype.addSamplesPackedArray=function(e,t){m3(t,this._times,this._values,e,this._packedLength),this._updateTableLength=!0,this._definitionChanged.raiseEvent(this)};sh.prototype.removeSample=function(e){let t=Eo(this._times,e,Q.compare);return t<0?!1:(wRe(this,t,1),!0)};function wRe(e,t,n){let i=e._packedLength;e._times.splice(t,n),e._values.splice(t*i,n*i),e._updateTableLength=!0,e._definitionChanged.raiseEvent(e)}sh.prototype.removeSamples=function(e){let t=this._times,n=Eo(t,e.start,Q.compare);n<0?n=~n:e.isStartIncluded||++n;let i=Eo(t,e.stop,Q.compare);i<0?i=~i:e.isStopIncluded&&++i,wRe(this,n,i-n)};sh.prototype.equals=function(e){if(this===e)return!0;if(!l(e)||this._type!==e._type||this._interpolationDegree!==e._interpolationDegree||this._interpolationAlgorithm!==e._interpolationAlgorithm)return!1;let t=this._derivativeTypes,n=l(t),i=e._derivativeTypes,o=l(i);if(n!==o)return!1;let r,s;if(n){if(s=t.length,s!==i.length)return!1;for(r=0;r<s;r++)if(t[r]!==i[r])return!1}let a=this._times,c=e._times;if(s=a.length,s!==c.length)return!1;for(r=0;r<s;r++)if(!Q.equals(a[r],c[r]))return!1;let d=this._values,u=e._values;for(s=d.length,r=0;r<s;r++)if(d[r]!==u[r])return!1;return!0};sh._mergeNewSamples=m3;var Ku=sh;function ah(e,t){t=t??0;let n;if(t>0){n=new Array(t);for(let i=0;i<t;i++)n[i]=h}this._numberOfDerivatives=t,this._property=new Ku(h,n),this._definitionChanged=new Se,this._referenceFrame=e??Oi.FIXED,this._property._definitionChanged.addEventListener(function(){this._definitionChanged.raiseEvent(this)},this)}Object.defineProperties(ah.prototype,{isConstant:{get:function(){return this._property.isConstant}},definitionChanged:{get:function(){return this._definitionChanged}},referenceFrame:{get:function(){return this._referenceFrame}},interpolationDegree:{get:function(){return this._property.interpolationDegree}},interpolationAlgorithm:{get:function(){return this._property.interpolationAlgorithm}},numberOfDerivatives:{get:function(){return this._numberOfDerivatives}},forwardExtrapolationType:{get:function(){return this._property.forwardExtrapolationType},set:function(e){this._property.forwardExtrapolationType=e}},forwardExtrapolationDuration:{get:function(){return this._property.forwardExtrapolationDuration},set:function(e){this._property.forwardExtrapolationDuration=e}},backwardExtrapolationType:{get:function(){return this._property.backwardExtrapolationType},set:function(e){this._property.backwardExtrapolationType=e}},backwardExtrapolationDuration:{get:function(){return this._property.backwardExtrapolationDuration},set:function(e){this._property.backwardExtrapolationDuration=e}}});var Zbt=new Q;ah.prototype.getValue=function(e,t){return l(e)||(e=Q.now(Zbt)),this.getValueInReferenceFrame(e,Oi.FIXED,t)};ah.prototype.getValueInReferenceFrame=function(e,t,n){if(n=this._property.getValue(e,n),l(n))return Hh.convertToReferenceFrame(e,n,this._referenceFrame,t,n)};ah.prototype.setInterpolationOptions=function(e){this._property.setInterpolationOptions(e)};ah.prototype.addSample=function(e,t,n){let i=this._numberOfDerivatives;this._property.addSample(e,t,n)};ah.prototype.addSamples=function(e,t,n){this._property.addSamples(e,t,n)};ah.prototype.addSamplesPackedArray=function(e,t){this._property.addSamplesPackedArray(e,t)};ah.prototype.removeSample=function(e){return this._property.removeSample(e)};ah.prototype.removeSamples=function(e){this._property.removeSamples(e)};ah.prototype.equals=function(e){return this===e||e instanceof ah&&j.equals(this._property,e._property)&&this._referenceFrame===e._referenceFrame};var pc=ah;var KIi=x(T(),1);var YIi=x(T(),1),kRe={HORIZONTAL:0,VERTICAL:1};Object.freeze(kRe);var Ff=kRe;var Rbt=Ff.HORIZONTAL,Cbt=U.WHITE,Vbt=U.BLACK,Ebt=0,Abt=1;function XV(e){e=e??B.EMPTY_OBJECT,this._definitionChanged=new Se,this._orientation=void 0,this._orientationSubscription=void 0,this._evenColor=void 0,this._evenColorSubscription=void 0,this._oddColor=void 0,this._oddColorSubscription=void 0,this._offset=void 0,this._offsetSubscription=void 0,this._repeat=void 0,this._repeatSubscription=void 0,this.orientation=e.orientation,this.evenColor=e.evenColor,this.oddColor=e.oddColor,this.offset=e.offset,this.repeat=e.repeat}Object.defineProperties(XV.prototype,{isConstant:{get:function(){return j.isConstant(this._orientation)&&j.isConstant(this._evenColor)&&j.isConstant(this._oddColor)&&j.isConstant(this._offset)&&j.isConstant(this._repeat)}},definitionChanged:{get:function(){return this._definitionChanged}},orientation:be("orientation"),evenColor:be("evenColor"),oddColor:be("oddColor"),offset:be("offset"),repeat:be("repeat")});XV.prototype.getType=function(e){return"Stripe"};var Gbt=new Q;XV.prototype.getValue=function(e,t){return l(e)||(e=Q.now(Gbt)),l(t)||(t={}),t.horizontal=j.getValueOrDefault(this._orientation,e,Rbt)===Ff.HORIZONTAL,t.evenColor=j.getValueOrClonedDefault(this._evenColor,e,Cbt,t.evenColor),t.oddColor=j.getValueOrClonedDefault(this._oddColor,e,Vbt,t.oddColor),t.offset=j.getValueOrDefault(this._offset,e,Ebt),t.repeat=j.getValueOrDefault(this._repeat,e,Abt),t};XV.prototype.equals=function(e){return this===e||e instanceof XV&&j.equals(this._orientation,e._orientation)&&j.equals(this._evenColor,e._evenColor)&&j.equals(this._oddColor,e._oddColor)&&j.equals(this._offset,e._offset)&&j.equals(this._repeat,e._repeat)};var NV=XV;var iPi=x(T(),1);function Kx(e){this._definitionChanged=new Se,this._intervals=new Vs,this._intervals.changedEvent.addEventListener(Kx.prototype._intervalsChanged,this),this._referenceFrame=e??Oi.FIXED}Object.defineProperties(Kx.prototype,{isConstant:{get:function(){return this._intervals.isEmpty}},definitionChanged:{get:function(){return this._definitionChanged}},intervals:{get:function(){return this._intervals}},referenceFrame:{get:function(){return this._referenceFrame}}});var Lbt=new Q;Kx.prototype.getValue=function(e,t){return l(e)||(e=Q.now(Lbt)),this.getValueInReferenceFrame(e,Oi.FIXED,t)};Kx.prototype.getValueInReferenceFrame=function(e,t,n){let i=this._intervals.findDataForIntervalContainingDate(e);if(l(i))return Hh.convertToReferenceFrame(e,i,this._referenceFrame,t,n)};Kx.prototype.equals=function(e){return this===e||e instanceof Kx&&this._intervals.equals(e._intervals,j.equals)&&this._referenceFrame===e._referenceFrame};Kx.prototype._intervalsChanged=function(){this._definitionChanged.raiseEvent(this)};var Ag=Kx;var dPi=x(T(),1);function nZ(){this._definitionChanged=new Se,this._intervals=new Vs,this._intervals.changedEvent.addEventListener(nZ.prototype._intervalsChanged,this)}Object.defineProperties(nZ.prototype,{isConstant:{get:function(){return this._intervals.isEmpty}},definitionChanged:{get:function(){return this._definitionChanged}},intervals:{get:function(){return this._intervals}}});var Wbt=new Q;nZ.prototype.getValue=function(e,t){l(e)||(e=Q.now(Wbt));let n=this._intervals.findDataForIntervalContainingDate(e);return l(n)&&typeof n.clone=="function"?n.clone(t):n};nZ.prototype.equals=function(e){return this===e||e instanceof nZ&&this._intervals.equals(e._intervals,j.equals)};nZ.prototype._intervalsChanged=function(){this._definitionChanged.raiseEvent(this)};var Gg=nZ;var GPi=x(T(),1);var gPi=x(T(),1);function YV(e,t){this._position=void 0,this._subscription=void 0,this._definitionChanged=new Se,this._normalize=t??!0,this.position=e}Object.defineProperties(YV.prototype,{isConstant:{get:function(){return j.isConstant(this._position)}},definitionChanged:{get:function(){return this._definitionChanged}},position:{get:function(){return this._position},set:function(e){let t=this._position;t!==e&&(l(t)&&this._subscription(),this._position=e,l(e)&&(this._subscription=e._definitionChanged.addEventListener(function(){this._definitionChanged.raiseEvent(this)},this)),this._definitionChanged.raiseEvent(this))}},normalize:{get:function(){return this._normalize},set:function(e){this._normalize!==e&&(this._normalize=e,this._definitionChanged.raiseEvent(this))}}});var vbt=new h,URe=new h,DRe=new Q,Fbt=new Q,Zee=1/60;YV.prototype.getValue=function(e,t){return this._getValue(e,t)};YV.prototype._getValue=function(e,t,n){l(e)||(e=Q.now(Fbt)),l(t)||(t=new h);let i=this._position;if(j.isConstant(i))return this._normalize?void 0:h.clone(h.ZERO,t);let o=i.getValue(e,vbt),r=i.getValue(Q.addSeconds(e,Zee,DRe),URe);if(!l(o)||!l(r)&&(r=o,o=i.getValue(Q.addSeconds(e,-Zee,DRe),URe),!l(o)))return;if(h.equals(o,r))return this._normalize?void 0:h.clone(h.ZERO,t);l(n)&&o.clone(n);let s=h.subtract(r,o,t);return this._normalize?h.normalize(s,t):h.divideByScalar(s,Zee,t)};YV.prototype.equals=function(e){return this===e||e instanceof YV&&j.equals(this._position,e._position)};var Lg=YV;function LY(e,t){this._velocityVectorProperty=new Lg(e,!0),this._subscription=void 0,this._ellipsoid=void 0,this._definitionChanged=new Se,this.ellipsoid=t??ne.default;let n=this;this._velocityVectorProperty.definitionChanged.addEventListener(function(){n._definitionChanged.raiseEvent(n)})}Object.defineProperties(LY.prototype,{isConstant:{get:function(){return j.isConstant(this._velocityVectorProperty)}},definitionChanged:{get:function(){return this._definitionChanged}},position:{get:function(){return this._velocityVectorProperty.position},set:function(e){this._velocityVectorProperty.position=e}},ellipsoid:{get:function(){return this._ellipsoid},set:function(e){this._ellipsoid!==e&&(this._ellipsoid=e,this._definitionChanged.raiseEvent(this))}}});var ORe=new h,Ibt=new h,BRe=new q,Pbt=new Q;LY.prototype.getValue=function(e,t){l(e)||(e=Q.now(Pbt));let n=this._velocityVectorProperty._getValue(e,Ibt,ORe);if(l(n))return _t.rotationMatrixFromPositionVelocity(ORe,n,this._ellipsoid,BRe),Ne.fromRotationMatrix(BRe,t)};LY.prototype.equals=function(e){return this===e||e instanceof LY&&j.equals(this._velocityVectorProperty,e._velocityVectorProperty)&&(this._ellipsoid===e._ellipsoid||this._ellipsoid.equals(e._ellipsoid))};var WY=LY;var vPi=x(T(),1);var Wg={COMPLETE:0,BELOW_ELLIPSOID_HORIZON:1,ABOVE_ELLIPSOID_HORIZON:2};Wg.validate=function(e){return e===Wg.COMPLETE||e===Wg.BELOW_ELLIPSOID_HORIZON||e===Wg.ABOVE_ELLIPSOID_HORIZON};Wg.toString=function(e){switch(e){case Wg.COMPLETE:return"COMPLETE";case Wg.BELOW_ELLIPSOID_HORIZON:return"BELOW_ELLIPSOID_HORIZON";case Wg.ABOVE_ELLIPSOID_HORIZON:return"ABOVE_ELLIPSOID_HORIZON";default:throw new ge("SensorVolumePortionToDisplay value is not valid and cannot be converted to a String.")}};var MV=Wg;function Jx(){}Jx.packedLength=h.packedLength;Jx.unpack=h.unpack;Jx.pack=h.pack;var Ree;function vY(e,t){return t[0]==="#"&&(t=Ree+t),Eg.fromString(e,t)}function zRe(e,t,n){if(l(n.reference))return vY(t,n.reference);if(l(n.velocityReference)){let i=vY(t,n.velocityReference);switch(e){case h:case Jx:return new Lg(i,e===Jx);case Ne:return new WY(i)}}throw new ae(`${JSON.stringify(n)} is not valid CZML.`)}function Xbt(e,t){return new Qh(function(n,i){return t(e.getValue(n,i))},e.isConstant)}var go=new h,ld=new GY,yl=new pe,iZ=new Cn,h3=new Ne;function Nbt(e){let t=e.rgbaf;if(l(t))return t;let n=e.rgba;if(!l(n))return;let i=n.length;if(i===U.packedLength)return[U.byteToFloat(n[0]),U.byteToFloat(n[1]),U.byteToFloat(n[2]),U.byteToFloat(n[3])];t=new Array(i);for(let o=0;o<i;o+=5)t[o]=n[o],t[o+1]=U.byteToFloat(n[o+1]),t[o+2]=U.byteToFloat(n[o+2]),t[o+3]=U.byteToFloat(n[o+3]),t[o+4]=U.byteToFloat(n[o+4]);return t}function HRe(e,t){let n=e.uri??e;return l(t)?t.getDerivedResource({url:n}):ve.createIfNeeded(n)}function Ybt(e){let t=e.wsen;if(l(t))return t;let n=e.wsenDegrees;if(!l(n))return;let i=n.length;if(i===re.packedLength)return[W.toRadians(n[0]),W.toRadians(n[1]),W.toRadians(n[2]),W.toRadians(n[3])];t=new Array(i);for(let o=0;o<i;o+=5)t[o]=n[o],t[o+1]=W.toRadians(n[o+1]),t[o+2]=W.toRadians(n[o+2]),t[o+3]=W.toRadians(n[o+3]),t[o+4]=W.toRadians(n[o+4]);return t}function Mbt(e){let t=e.length;if(ld.magnitude=1,t===2)return ld.clock=e[0],ld.cone=e[1],h.fromSpherical(ld,go),[go.x,go.y,go.z];let n=new Array(t/3*4);for(let i=0,o=0;i<t;i+=3,o+=4)n[o]=e[i],ld.clock=e[i+1],ld.cone=e[i+2],h.fromSpherical(ld,go),n[o+1]=go.x,n[o+2]=go.y,n[o+3]=go.z;return n}function wbt(e){let t=e.length;if(t===3)return ld.clock=e[0],ld.cone=e[1],ld.magnitude=e[2],h.fromSpherical(ld,go),[go.x,go.y,go.z];let n=new Array(t);for(let i=0;i<t;i+=4)n[i]=e[i],ld.clock=e[i+1],ld.cone=e[i+2],ld.magnitude=e[i+3],h.fromSpherical(ld,go),n[i+1]=go.x,n[i+2]=go.y,n[i+3]=go.z;return n}function kbt(e){let t=e.length;if(t===3)return yl.longitude=e[0],yl.latitude=e[1],yl.height=e[2],ne.default.cartographicToCartesian(yl,go),[go.x,go.y,go.z];let n=new Array(t);for(let i=0;i<t;i+=4)n[i]=e[i],yl.longitude=e[i+1],yl.latitude=e[i+2],yl.height=e[i+3],ne.default.cartographicToCartesian(yl,go),n[i+1]=go.x,n[i+2]=go.y,n[i+3]=go.z;return n}function Ubt(e){let t=e.length;if(t===3)return yl.longitude=W.toRadians(e[0]),yl.latitude=W.toRadians(e[1]),yl.height=e[2],ne.default.cartographicToCartesian(yl,go),[go.x,go.y,go.z];let n=new Array(t);for(let i=0;i<t;i+=4)n[i]=e[i],yl.longitude=W.toRadians(e[i+1]),yl.latitude=W.toRadians(e[i+2]),yl.height=e[i+3],ne.default.cartographicToCartesian(yl,go),n[i+1]=go.x,n[i+2]=go.y,n[i+3]=go.z;return n}function Cee(e){let t=e.cartesian;if(l(t))return t;let n=e.cartesianVelocity;if(l(n))return n;let i=e.unitCartesian;if(l(i))return i;let o=e.unitSpherical;if(l(o))return Mbt(o);let r=e.spherical;if(l(r))return wbt(r);let s=e.cartographicRadians;if(l(s))return kbt(s);let a=e.cartographicDegrees;if(l(a))return Ubt(a);throw new ae(`${JSON.stringify(e)} is not a valid CZML interval.`)}function KRe(e,t){h.unpack(e,t,go),h.normalize(go,go),h.pack(go,e,t)}function Dbt(e){let t=Cee(e);if(t.length===3)return KRe(t,0),t;for(let n=1;n<t.length;n+=4)KRe(t,n);return t}function JRe(e,t){Ne.unpack(e,t,h3),Ne.normalize(h3,h3),Ne.pack(h3,e,t)}function Obt(e){let t=e.unitQuaternion;if(l(t)){if(t.length===4)return JRe(t,0),t;for(let n=1;n<t.length;n+=5)JRe(t,n)}return t}function jRe(e){return typeof e=="boolean"?Boolean:typeof e=="number"?Number:typeof e=="string"?String:e.hasOwnProperty("array")?Array:e.hasOwnProperty("boolean")?Boolean:e.hasOwnProperty("boundingRectangle")?nt:e.hasOwnProperty("cartesian2")?k:e.hasOwnProperty("cartesian")||e.hasOwnProperty("spherical")||e.hasOwnProperty("cartographicRadians")||e.hasOwnProperty("cartographicDegrees")?h:e.hasOwnProperty("unitCartesian")||e.hasOwnProperty("unitSpherical")?Jx:e.hasOwnProperty("rgba")||e.hasOwnProperty("rgbaf")?U:e.hasOwnProperty("arcType")?un:e.hasOwnProperty("classificationType")?ni:e.hasOwnProperty("colorBlendMode")?al:e.hasOwnProperty("cornerType")?ro:e.hasOwnProperty("heightReference")?He:e.hasOwnProperty("horizontalOrigin")?Ui:e.hasOwnProperty("date")?Q:e.hasOwnProperty("labelStyle")?Tr:e.hasOwnProperty("number")?Number:e.hasOwnProperty("nearFarScalar")?Kt:e.hasOwnProperty("distanceDisplayCondition")?Bt:e.hasOwnProperty("object")||e.hasOwnProperty("value")?Object:e.hasOwnProperty("unitQuaternion")?Ne:e.hasOwnProperty("pathMode")?n0:e.hasOwnProperty("shadowMode")?vn:e.hasOwnProperty("string")?String:e.hasOwnProperty("stripeOrientation")?Ff:e.hasOwnProperty("wsen")||e.hasOwnProperty("wsenDegrees")?re:e.hasOwnProperty("uri")?IY.default:e.hasOwnProperty("verticalOrigin")?zn:Object}function Bbt(e,t,n){switch(e){case un:return un[t.arcType??t];case Array:return t.array;case Boolean:return t.boolean??t;case nt:return t.boundingRectangle;case k:return t.cartesian2;case h:return Cee(t);case Jx:return Dbt(t);case U:return Nbt(t);case ni:return ni[t.classificationType??t];case al:return al[t.colorBlendMode??t];case ro:return ro[t.cornerType??t];case He:return He[t.heightReference??t];case Ui:return Ui[t.horizontalOrigin??t];case Image:return HRe(t,n);case Q:return Q.fromIso8601(t.date??t);case Tr:return Tr[t.labelStyle??t];case Number:return t.number??t;case Kt:return t.nearFarScalar;case Bt:return t.distanceDisplayCondition;case Object:return t.object??t.value??t;case n0:return n0[t.pathMode??t];case Ne:return Obt(t);case rh:return t.number??t;case MV:return MV[t.portionToDisplay??t];case vn:return vn[t.shadowMode??t.shadows??t];case String:return t.string??t;case Ff:return Ff[t.stripeOrientation??t];case re:return Ybt(t);case IY.default:return HRe(t,n);case zn:return zn[t.verticalOrigin??t];default:throw new ae(`Unknown CzmlDataSource interval type: ${e}`)}}var zbt={HERMITE:EY,LAGRANGE:AY,LINEAR:Bx};function f3(e,t){let n=e.interpolationAlgorithm,i=e.interpolationDegree;(l(n)||l(i))&&t.setInterpolationOptions({interpolationAlgorithm:zbt[n],interpolationDegree:i});let o=e.forwardExtrapolationType;l(o)&&(t.forwardExtrapolationType=cd[o]);let r=e.forwardExtrapolationDuration;l(r)&&(t.forwardExtrapolationDuration=r);let s=e.backwardExtrapolationType;l(s)&&(t.backwardExtrapolationType=cd[s]);let a=e.backwardExtrapolationDuration;l(a)&&(t.backwardExtrapolationDuration=a)}var QRe={iso8601:void 0};function Kr(e){if(l(e))return QRe.iso8601=e,Cn.fromIso8601(QRe)}function Vee(e){let t=ot.MAXIMUM_INTERVAL.clone();return t.data=e,t}function qRe(e){let t=new pl;return t.intervals.addInterval(Vee(e)),t}function $Re(e){let t=new hc(e.referenceFrame);return t.intervals.addInterval(Vee(e)),t}function p3(e,t,n,i,o,r,s){let a=Kr(i.interval);l(o)&&(l(a)?a=Cn.intersect(a,o,iZ):a=o);let c,d,u,m=!l(i.reference)&&!l(i.velocityReference),p=l(a)&&!a.equals(ot.MAXIMUM_INTERVAL);if(i.delete===!0){if(!p){t[n]=void 0;return}return d1e(t[n],a)}let b=!1;if(m){if(d=Bbt(e,i,r),!l(d))return;c=e.packedLength??1,u=d.length??1,b=!l(i.array)&&typeof d!="string"&&u>c&&e!==Object}let f=typeof e.unpack=="function"&&e!==rh;if(!b&&!p){m?t[n]=new mi(f?e.unpack(d,0):d):t[n]=zRe(e,s,i);return}let y=t[n],_,S=i.epoch;if(l(S)&&(_=Q.fromIso8601(S)),b&&!p){y instanceof Ku||(t[n]=y=new Ku(e)),y.addSamplesPackedArray(d,_),f3(i,y);return}let Z;if(!b&&p){a=a.clone(),m?a.data=f?e.unpack(d,0):d:a.data=zRe(e,s,i),l(y)||(t[n]=y=m?new Gg:new pl),m&&y instanceof Gg?y.intervals.addInterval(a):y instanceof pl?(m&&(a.data=new mi(a.data)),y.intervals.addInterval(a)):(t[n]=y=qRe(y),m&&(a.data=new mi(a.data)),y.intervals.addInterval(a));return}l(y)||(t[n]=y=new pl),y instanceof pl||(t[n]=y=qRe(y));let R=y.intervals;Z=R.findInterval(a),(!l(Z)||!(Z.data instanceof Ku))&&(Z=a.clone(),Z.data=new Ku(e),R.addInterval(Z)),Z.data.addSamplesPackedArray(d,_),f3(i,Z.data)}function d1e(e,t){if(e instanceof Ku){e.removeSamples(t);return}else if(e instanceof Gg){e.intervals.removeInterval(t);return}else if(e instanceof pl){let n=e.intervals;for(let i=0;i<n.length;++i){let o=Cn.intersect(n.get(i),t,iZ);o.isEmpty||d1e(o.data,t)}n.removeInterval(t);return}}function Ce(e,t,n,i,o,r,s){if(l(i))if(Array.isArray(i))for(let a=0,c=i.length;a<c;++a)p3(e,t,n,i[a],o,r,s);else p3(e,t,n,i,o,r,s)}function e1e(e,t,n,i,o,r){let s=Kr(n.interval);l(i)&&(l(s)?s=Cn.intersect(s,i,iZ):s=i);let a=l(n.cartesianVelocity)?1:0,c=h.packedLength*(a+1),d,u,m=!l(n.reference),p=l(s)&&!s.equals(ot.MAXIMUM_INTERVAL);if(n.delete===!0){if(!p){e[t]=void 0;return}return u1e(e[t],s)}let b,f=!1;if(m&&(l(n.referenceFrame)&&(b=Oi[n.referenceFrame]),b=b??Oi.FIXED,d=Cee(n),u=d.length??1,f=u>c),!f&&!p){m?e[t]=new Bl(h.unpack(d),b):e[t]=vY(r,n.reference);return}let y=e[t],_,S=n.epoch;if(l(S)&&(_=Q.fromIso8601(S)),f&&!p){(!(y instanceof pc)||l(b)&&y.referenceFrame!==b)&&(e[t]=y=new pc(b,a)),y.addSamplesPackedArray(d,_),f3(n,y);return}let Z;if(!f&&p){s=s.clone(),m?s.data=h.unpack(d):s.data=vY(r,n.reference),l(y)||(m?y=new Ag(b):y=new hc(b),e[t]=y),m&&y instanceof Ag&&l(b)&&y.referenceFrame===b?y.intervals.addInterval(s):y instanceof hc?(m&&(s.data=new Bl(s.data,b)),y.intervals.addInterval(s)):(e[t]=y=$Re(y),m&&(s.data=new Bl(s.data,b)),y.intervals.addInterval(s));return}l(y)?y instanceof hc||(e[t]=y=$Re(y)):e[t]=y=new hc(b);let R=y.intervals;Z=R.findInterval(s),(!l(Z)||!(Z.data instanceof pc)||l(b)&&Z.data.referenceFrame!==b)&&(Z=s.clone(),Z.data=new pc(b,a),R.addInterval(Z)),Z.data.addSamplesPackedArray(d,_),f3(n,Z.data)}function u1e(e,t){if(e instanceof pc){e.removeSamples(t);return}else if(e instanceof Ag){e.intervals.removeInterval(t);return}else if(e instanceof hc){let n=e.intervals;for(let i=0;i<n.length;++i){let o=Cn.intersect(n.get(i),t,iZ);o.isEmpty||u1e(o.data,t)}n.removeInterval(t);return}}function m1e(e,t,n,i,o,r){if(l(n))if(Array.isArray(n))for(let s=0,a=n.length;s<a;++s)e1e(e,t,n[s],i,o,r);else e1e(e,t,n,i,o,r)}function t1e(e,t,n,i){l(n.references)?b3(e,t,n.references,n.interval,i,PV,pl):(l(n.cartesian2)?n.array=k.unpackArray(n.cartesian2):l(n.cartesian)&&(n.array=k.unpackArray(n.cartesian)),l(n.array)&&Ce(Array,e,t,n,void 0,void 0,i))}function n1e(e,t,n,i,o,r){let s=Kr(n.interval);l(i)&&(l(s)?s=Cn.intersect(s,i,iZ):s=i);let a=e[t],c,d;if(l(s)){a instanceof gV||(a=new gV,e[t]=a);let m=a.intervals;d=m.findInterval({start:s.start,stop:s.stop}),l(d)?c=d.data:(d=s.clone(),m.addInterval(d))}else c=a;let u;l(n.solidColor)?(c instanceof Qt||(c=new Qt),u=n.solidColor,Ce(U,c,"color",u.color,void 0,void 0,r)):l(n.grid)?(c instanceof EV||(c=new EV),u=n.grid,Ce(U,c,"color",u.color,void 0,o,r),Ce(Number,c,"cellAlpha",u.cellAlpha,void 0,o,r),Ce(k,c,"lineCount",u.lineCount,void 0,o,r),Ce(k,c,"lineThickness",u.lineThickness,void 0,o,r),Ce(k,c,"lineOffset",u.lineOffset,void 0,o,r)):l(n.image)?(c instanceof By||(c=new By),u=n.image,Ce(Image,c,"image",u.image,void 0,o,r),Ce(k,c,"repeat",u.repeat,void 0,o,r),Ce(U,c,"color",u.color,void 0,o,r),Ce(Boolean,c,"transparent",u.transparent,void 0,o,r)):l(n.stripe)?(c instanceof NV||(c=new NV),u=n.stripe,Ce(Ff,c,"orientation",u.orientation,void 0,o,r),Ce(U,c,"evenColor",u.evenColor,void 0,o,r),Ce(U,c,"oddColor",u.oddColor,void 0,o,r),Ce(Number,c,"offset",u.offset,void 0,o,r),Ce(Number,c,"repeat",u.repeat,void 0,o,r)):l(n.polylineOutline)?(c instanceof zx||(c=new zx),u=n.polylineOutline,Ce(U,c,"color",u.color,void 0,o,r),Ce(U,c,"outlineColor",u.outlineColor,void 0,o,r),Ce(Number,c,"outlineWidth",u.outlineWidth,void 0,o,r)):l(n.polylineGlow)?(c instanceof FV||(c=new FV),u=n.polylineGlow,Ce(U,c,"color",u.color,void 0,o,r),Ce(Number,c,"glowPower",u.glowPower,void 0,o,r),Ce(Number,c,"taperPower",u.taperPower,void 0,o,r)):l(n.polylineArrow)?(c instanceof GV||(c=new GV),u=n.polylineArrow,Ce(U,c,"color",u.color,void 0,void 0,r)):l(n.polylineDash)?(c instanceof WV||(c=new WV),u=n.polylineDash,Ce(U,c,"color",u.color,void 0,void 0,r),Ce(U,c,"gapColor",u.gapColor,void 0,void 0,r),Ce(Number,c,"dashLength",u.dashLength,void 0,o,r),Ce(Number,c,"dashPattern",u.dashPattern,void 0,o,r)):l(n.checkerboard)&&(c instanceof pV||(c=new pV),u=n.checkerboard,Ce(U,c,"evenColor",u.evenColor,void 0,o,r),Ce(U,c,"oddColor",u.oddColor,void 0,o,r),Ce(k,c,"repeat",u.repeat,void 0,o,r)),l(d)?d.data=c:e[t]=c}function Ju(e,t,n,i,o,r){if(l(n))if(Array.isArray(n))for(let s=0,a=n.length;s<a;++s)n1e(e,t,n[s],i,o,r);else n1e(e,t,n,i,o,r)}function Hbt(e,t,n,i){let o=t.name;l(o)&&(e.name=t.name)}function Kbt(e,t,n,i){let o=t.description;l(o)&&Ce(String,e,"description",o,void 0,i,n)}function Jbt(e,t,n,i){let o=t.position;l(o)&&m1e(e,"position",o,void 0,i,n)}function jbt(e,t,n,i){let o=t.viewFrom;l(o)&&Ce(h,e,"viewFrom",o,void 0,i,n)}function Qbt(e,t,n,i){let o=t.orientation;l(o)&&Ce(Ne,e,"orientation",o,void 0,i,n)}function qbt(e,t,n,i){let o=t.properties;if(l(o)){l(e.properties)||(e.properties=new Hl);for(let r in o)if(o.hasOwnProperty(r)){e.properties.hasProperty(r)||e.properties.addProperty(r);let s=o[r];if(Array.isArray(s))for(let a=0,c=s.length;a<c;++a)p3(jRe(s[a]),e.properties,r,s[a],void 0,i,n);else p3(jRe(s),e.properties,r,s,void 0,i,n)}}}function b3(e,t,n,i,o,r,s){let a=n.map(function(c){return vY(o,c)});if(l(i)){i=Kr(i);let c=e[t];if(!(c instanceof s)){let d=new s;d.intervals.addInterval(Vee(c)),e[t]=c=d}i.data=new r(a),c.intervals.addInterval(i)}else e[t]=new r(a)}function i1e(e,t,n,i){let o=n.references;l(o)?b3(e,t,o,n.interval,i,PV,pl):Ce(Array,e,t,n,void 0,void 0,i)}function o1e(e,t,n,i){if(l(n))if(Array.isArray(n))for(let o=0,r=n.length;o<r;++o)i1e(e,t,n[o],i);else i1e(e,t,n,i)}function r1e(e,t,n,i){let o=n.references;l(o)?b3(e,t,o,n.interval,i,Vg,hc):(l(n.cartesian)?n.array=h.unpackArray(n.cartesian):l(n.cartographicRadians)?n.array=h.fromRadiansArrayHeights(n.cartographicRadians,ne.default):l(n.cartographicDegrees)&&(n.array=h.fromDegreesArrayHeights(n.cartographicDegrees,ne.default)),l(n.array)&&Ce(Array,e,t,n,void 0,void 0,i))}function PY(e,t,n,i){if(l(n))if(Array.isArray(n))for(let o=0,r=n.length;o<r;++o)r1e(e,t,n[o],i);else r1e(e,t,n,i)}function $bt(e){return h.unpackArray(e)}function egt(e){return h.fromRadiansArrayHeights(e,ne.default)}function tgt(e){return h.fromDegreesArrayHeights(e,ne.default)}function s1e(e,t,n,i){let o=n.references;if(l(o)){let r=o.map(function(s){let a={};return b3(a,"positions",s,n.interval,i,Vg,hc),a.positions});e[t]=new Vg(r)}else l(n.cartesian)?n.array=n.cartesian.map($bt):l(n.cartographicRadians)?n.array=n.cartographicRadians.map(egt):l(n.cartographicDegrees)&&(n.array=n.cartographicDegrees.map(tgt)),l(n.array)&&Ce(Array,e,t,n,void 0,void 0,i)}function ngt(e,t,n,i){if(l(n))if(Array.isArray(n))for(let o=0,r=n.length;o<r;++o)s1e(e,t,n[o],i);else s1e(e,t,n,i)}function igt(e,t,n,i){if(l(n))if(Array.isArray(n))for(let o=0,r=n.length;o<r;o++)t1e(e,t,n[o],i);else t1e(e,t,n,i)}function ogt(e,t,n,i){let o=t.availability;if(!l(o))return;let r;if(Array.isArray(o))for(let s=0,a=o.length;s<a;++s)l(r)||(r=new Vs),r.addInterval(Kr(o[s]));else r=new Vs,r.addInterval(Kr(o));e.availability=r}function rgt(e,t,n,i,o){l(t)&&Ce(Jx,e,"alignedAxis",t,n,i,o)}function sgt(e,t,n,i){let o=t.billboard;if(!l(o))return;let r=Kr(o.interval),s=e.billboard;l(s)||(e.billboard=s=new jc),Ce(Boolean,s,"show",o.show,r,i,n),Ce(Image,s,"image",o.image,r,i,n),Ce(Number,s,"scale",o.scale,r,i,n),Ce(k,s,"pixelOffset",o.pixelOffset,r,i,n),Ce(h,s,"eyeOffset",o.eyeOffset,r,i,n),Ce(Ui,s,"horizontalOrigin",o.horizontalOrigin,r,i,n),Ce(zn,s,"verticalOrigin",o.verticalOrigin,r,i,n),Ce(He,s,"heightReference",o.heightReference,r,i,n),Ce(U,s,"color",o.color,r,i,n),Ce(rh,s,"rotation",o.rotation,r,i,n),rgt(s,o.alignedAxis,r,i,n),Ce(Boolean,s,"sizeInMeters",o.sizeInMeters,r,i,n),Ce(Number,s,"width",o.width,r,i,n),Ce(Number,s,"height",o.height,r,i,n),Ce(Kt,s,"scaleByDistance",o.scaleByDistance,r,i,n),Ce(Kt,s,"translucencyByDistance",o.translucencyByDistance,r,i,n),Ce(Kt,s,"pixelOffsetScaleByDistance",o.pixelOffsetScaleByDistance,r,i,n),Ce(nt,s,"imageSubRegion",o.imageSubRegion,r,i,n),Ce(Bt,s,"distanceDisplayCondition",o.distanceDisplayCondition,r,i,n),Ce(Number,s,"disableDepthTestDistance",o.disableDepthTestDistance,r,i,n)}function agt(e,t,n,i){let o=t.box;if(!l(o))return;let r=Kr(o.interval),s=e.box;l(s)||(e.box=s=new L_),Ce(Boolean,s,"show",o.show,r,i,n),Ce(h,s,"dimensions",o.dimensions,r,i,n),Ce(He,s,"heightReference",o.heightReference,r,i,n),Ce(Boolean,s,"fill",o.fill,r,i,n),Ju(s,"material",o.material,r,i,n),Ce(Boolean,s,"outline",o.outline,r,i,n),Ce(U,s,"outlineColor",o.outlineColor,r,i,n),Ce(Number,s,"outlineWidth",o.outlineWidth,r,i,n),Ce(vn,s,"shadows",o.shadows,r,i,n),Ce(Bt,s,"distanceDisplayCondition",o.distanceDisplayCondition,r,i,n)}function cgt(e,t,n,i){let o=t.corridor;if(!l(o))return;let r=Kr(o.interval),s=e.corridor;l(s)||(e.corridor=s=new v_),Ce(Boolean,s,"show",o.show,r,i,n),PY(s,"positions",o.positions,n),Ce(Number,s,"width",o.width,r,i,n),Ce(Number,s,"height",o.height,r,i,n),Ce(He,s,"heightReference",o.heightReference,r,i,n),Ce(Number,s,"extrudedHeight",o.extrudedHeight,r,i,n),Ce(He,s,"extrudedHeightReference",o.extrudedHeightReference,r,i,n),Ce(ro,s,"cornerType",o.cornerType,r,i,n),Ce(Number,s,"granularity",o.granularity,r,i,n),Ce(Boolean,s,"fill",o.fill,r,i,n),Ju(s,"material",o.material,r,i,n),Ce(Boolean,s,"outline",o.outline,r,i,n),Ce(U,s,"outlineColor",o.outlineColor,r,i,n),Ce(Number,s,"outlineWidth",o.outlineWidth,r,i,n),Ce(vn,s,"shadows",o.shadows,r,i,n),Ce(Bt,s,"distanceDisplayCondition",o.distanceDisplayCondition,r,i,n),Ce(ni,s,"classificationType",o.classificationType,r,i,n),Ce(Number,s,"zIndex",o.zIndex,r,i,n)}function lgt(e,t,n,i){let o=t.cylinder;if(!l(o))return;let r=Kr(o.interval),s=e.cylinder;l(s)||(e.cylinder=s=new F_),Ce(Boolean,s,"show",o.show,r,i,n),Ce(Number,s,"length",o.length,r,i,n),Ce(Number,s,"topRadius",o.topRadius,r,i,n),Ce(Number,s,"bottomRadius",o.bottomRadius,r,i,n),Ce(He,s,"heightReference",o.heightReference,r,i,n),Ce(Boolean,s,"fill",o.fill,r,i,n),Ju(s,"material",o.material,r,i,n),Ce(Boolean,s,"outline",o.outline,r,i,n),Ce(U,s,"outlineColor",o.outlineColor,r,i,n),Ce(Number,s,"outlineWidth",o.outlineWidth,r,i,n),Ce(Number,s,"numberOfVerticalLines",o.numberOfVerticalLines,r,i,n),Ce(Number,s,"slices",o.slices,r,i,n),Ce(vn,s,"shadows",o.shadows,r,i,n),Ce(Bt,s,"distanceDisplayCondition",o.distanceDisplayCondition,r,i,n)}function dgt(e,t){let n=e.version;if(l(n)&&typeof n=="string"){let r=n.split(".");if(r.length===2){if(r[0]!=="1")throw new ae("Cesium only supports CZML version 1.");t._version=n}}if(!l(t._version))throw new ae("CZML version information invalid. It is expected to be a property on the document object in the <Major>.<Minor> version format.");let i=t._documentPacket;l(e.name)&&(i.name=e.name);let o=e.clock;if(l(o)){let r=i.clock;l(r)?(r.interval=o.interval??r.interval,r.currentTime=o.currentTime??r.currentTime,r.range=o.range??r.range,r.step=o.step??r.step,r.multiplier=o.multiplier??r.multiplier):i.clock={interval:o.interval,currentTime:o.currentTime,range:o.range,step:o.step,multiplier:o.multiplier}}}function ugt(e,t,n,i){let o=t.ellipse;if(!l(o))return;let r=Kr(o.interval),s=e.ellipse;l(s)||(e.ellipse=s=new I_),Ce(Boolean,s,"show",o.show,r,i,n),Ce(Number,s,"semiMajorAxis",o.semiMajorAxis,r,i,n),Ce(Number,s,"semiMinorAxis",o.semiMinorAxis,r,i,n),Ce(Number,s,"height",o.height,r,i,n),Ce(He,s,"heightReference",o.heightReference,r,i,n),Ce(Number,s,"extrudedHeight",o.extrudedHeight,r,i,n),Ce(He,s,"extrudedHeightReference",o.extrudedHeightReference,r,i,n),Ce(rh,s,"rotation",o.rotation,r,i,n),Ce(rh,s,"stRotation",o.stRotation,r,i,n),Ce(Number,s,"granularity",o.granularity,r,i,n),Ce(Boolean,s,"fill",o.fill,r,i,n),Ju(s,"material",o.material,r,i,n),Ce(Boolean,s,"outline",o.outline,r,i,n),Ce(U,s,"outlineColor",o.outlineColor,r,i,n),Ce(Number,s,"outlineWidth",o.outlineWidth,r,i,n),Ce(Number,s,"numberOfVerticalLines",o.numberOfVerticalLines,r,i,n),Ce(vn,s,"shadows",o.shadows,r,i,n),Ce(Bt,s,"distanceDisplayCondition",o.distanceDisplayCondition,r,i,n),Ce(ni,s,"classificationType",o.classificationType,r,i,n),Ce(Number,s,"zIndex",o.zIndex,r,i,n)}function mgt(e,t,n,i){let o=t.ellipsoid;if(!l(o))return;let r=Kr(o.interval),s=e.ellipsoid;l(s)||(e.ellipsoid=s=new P_),Ce(Boolean,s,"show",o.show,r,i,n),Ce(h,s,"radii",o.radii,r,i,n),Ce(h,s,"innerRadii",o.innerRadii,r,i,n),Ce(Number,s,"minimumClock",o.minimumClock,r,i,n),Ce(Number,s,"maximumClock",o.maximumClock,r,i,n),Ce(Number,s,"minimumCone",o.minimumCone,r,i,n),Ce(Number,s,"maximumCone",o.maximumCone,r,i,n),Ce(He,s,"heightReference",o.heightReference,r,i,n),Ce(Boolean,s,"fill",o.fill,r,i,n),Ju(s,"material",o.material,r,i,n),Ce(Boolean,s,"outline",o.outline,r,i,n),Ce(U,s,"outlineColor",o.outlineColor,r,i,n),Ce(Number,s,"outlineWidth",o.outlineWidth,r,i,n),Ce(Number,s,"stackPartitions",o.stackPartitions,r,i,n),Ce(Number,s,"slicePartitions",o.slicePartitions,r,i,n),Ce(Number,s,"subdivisions",o.subdivisions,r,i,n),Ce(vn,s,"shadows",o.shadows,r,i,n),Ce(Bt,s,"distanceDisplayCondition",o.distanceDisplayCondition,r,i,n)}function hgt(e,t,n,i){let o=t.label;if(!l(o))return;let r=Kr(o.interval),s=e.label;l(s)||(e.label=s=new Kh),Ce(Boolean,s,"show",o.show,r,i,n),Ce(String,s,"text",o.text,r,i,n),Ce(String,s,"font",o.font,r,i,n),Ce(Tr,s,"style",o.style,r,i,n),Ce(Number,s,"scale",o.scale,r,i,n),Ce(Boolean,s,"showBackground",o.showBackground,r,i,n),Ce(U,s,"backgroundColor",o.backgroundColor,r,i,n),Ce(k,s,"backgroundPadding",o.backgroundPadding,r,i,n),Ce(k,s,"pixelOffset",o.pixelOffset,r,i,n),Ce(h,s,"eyeOffset",o.eyeOffset,r,i,n),Ce(Ui,s,"horizontalOrigin",o.horizontalOrigin,r,i,n),Ce(zn,s,"verticalOrigin",o.verticalOrigin,r,i,n),Ce(He,s,"heightReference",o.heightReference,r,i,n),Ce(U,s,"fillColor",o.fillColor,r,i,n),Ce(U,s,"outlineColor",o.outlineColor,r,i,n),Ce(Number,s,"outlineWidth",o.outlineWidth,r,i,n),Ce(Kt,s,"translucencyByDistance",o.translucencyByDistance,r,i,n),Ce(Kt,s,"pixelOffsetScaleByDistance",o.pixelOffsetScaleByDistance,r,i,n),Ce(Kt,s,"scaleByDistance",o.scaleByDistance,r,i,n),Ce(Bt,s,"distanceDisplayCondition",o.distanceDisplayCondition,r,i,n),Ce(Number,s,"disableDepthTestDistance",o.disableDepthTestDistance,r,i,n)}function fgt(e,t,n,i){let o=t.model;if(!l(o))return;let r=Kr(o.interval),s=e.model;l(s)||(e.model=s=new Sb),Ce(Boolean,s,"show",o.show,r,i,n),Ce(IY.default,s,"uri",o.gltf,r,i,n),Ce(Number,s,"scale",o.scale,r,i,n),Ce(Number,s,"minimumPixelSize",o.minimumPixelSize,r,i,n),Ce(Number,s,"maximumScale",o.maximumScale,r,i,n),Ce(Boolean,s,"incrementallyLoadTextures",o.incrementallyLoadTextures,r,i,n),Ce(Boolean,s,"runAnimations",o.runAnimations,r,i,n),Ce(Boolean,s,"clampAnimations",o.clampAnimations,r,i,n),Ce(vn,s,"shadows",o.shadows,r,i,n),Ce(He,s,"heightReference",o.heightReference,r,i,n),Ce(U,s,"silhouetteColor",o.silhouetteColor,r,i,n),Ce(Number,s,"silhouetteSize",o.silhouetteSize,r,i,n),Ce(U,s,"color",o.color,r,i,n),Ce(al,s,"colorBlendMode",o.colorBlendMode,r,i,n),Ce(Number,s,"colorBlendAmount",o.colorBlendAmount,r,i,n),Ce(Bt,s,"distanceDisplayCondition",o.distanceDisplayCondition,r,i,n);let a,c,d=o.nodeTransformations;if(l(d))if(Array.isArray(d))for(a=0,c=d.length;a<c;++a)a1e(s,d[a],r,i,n);else a1e(s,d,r,i,n);let u=o.articulations;if(l(u))if(Array.isArray(u))for(a=0,c=u.length;a<c;++a)c1e(s,u[a],r,i,n);else c1e(s,u,r,i,n)}function a1e(e,t,n,i,o){let r=Kr(t.interval);l(n)&&(l(r)?r=Cn.intersect(r,n,iZ):r=n);let s=e.nodeTransformations,a=Object.keys(t);for(let c=0,d=a.length;c<d;++c){let u=a[c];if(u==="interval")continue;let m=t[u];if(!l(m))continue;l(s)||(e.nodeTransformations=s=new Hl),s.hasProperty(u)||s.addProperty(u);let p=s[u];l(p)||(s[u]=p=new X_),Ce(h,p,"translation",m.translation,r,i,o),Ce(Ne,p,"rotation",m.rotation,r,i,o),Ce(h,p,"scale",m.scale,r,i,o)}}function c1e(e,t,n,i,o){let r=Kr(t.interval);l(n)&&(l(r)?r=Cn.intersect(r,n,iZ):r=n);let s=e.articulations,a=Object.keys(t);for(let c=0,d=a.length;c<d;++c){let u=a[c];if(u==="interval")continue;let m=t[u];l(m)&&(l(s)||(e.articulations=s=new Hl),s.hasProperty(u)||s.addProperty(u),Ce(Number,s,u,m,r,i,o))}}function pgt(e,t,n,i){let o=t.path;if(!l(o))return;let r=Kr(o.interval),s=e.path;l(s)||(e.path=s=new Zb),Ce(Boolean,s,"show",o.show,r,i,n),Ce(Number,s,"leadTime",o.leadTime,r,i,n),Ce(Number,s,"trailTime",o.trailTime,r,i,n),Ce(Number,s,"width",o.width,r,i,n),Ce(Number,s,"resolution",o.resolution,r,i,n),Ju(s,"material",o.material,r,i,n),Ce(Bt,s,"distanceDisplayCondition",o.distanceDisplayCondition,r,i,n),Ce(String,s,"relativeTo",o.relativeTo,r,i,n),Ce(n0,s,"materialMode",o.materialMode,r,i,n)}function bgt(e,t,n,i){let o=t.point;if(!l(o))return;let r=Kr(o.interval),s=e.point;l(s)||(e.point=s=new Y_),Ce(Boolean,s,"show",o.show,r,i,n),Ce(Number,s,"pixelSize",o.pixelSize,r,i,n),Ce(He,s,"heightReference",o.heightReference,r,i,n),Ce(U,s,"color",o.color,r,i,n),Ce(U,s,"outlineColor",o.outlineColor,r,i,n),Ce(Number,s,"outlineWidth",o.outlineWidth,r,i,n),Ce(Kt,s,"scaleByDistance",o.scaleByDistance,r,i,n),Ce(Kt,s,"translucencyByDistance",o.translucencyByDistance,r,i,n),Ce(Bt,s,"distanceDisplayCondition",o.distanceDisplayCondition,r,i,n),Ce(Number,s,"disableDepthTestDistance",o.disableDepthTestDistance,r,i,n)}function FY(e){this.polygon=e,this._definitionChanged=new Se}Object.defineProperties(FY.prototype,{isConstant:{get:function(){let e=this.polygon._positions,t=this.polygon._holes;return(!l(e)||e.isConstant)&&(!l(t)||t.isConstant)}},definitionChanged:{get:function(){return this._definitionChanged}}});FY.prototype.getValue=function(e,t){let n;l(this.polygon._positions)&&(n=this.polygon._positions.getValue(e));let i;return l(this.polygon._holes)&&(i=this.polygon._holes.getValue(e),l(i)&&(i=i.map(function(o){return new Lc(o)}))),l(t)?(t.positions=n,t.holes=i,t):new Lc(n,i)};FY.prototype.equals=function(e){return this===e||e instanceof FY&&j.equals(this.polygon._positions,e.polygon._positions)&&j.equals(this.polygon._holes,e.polygon._holes)};function ggt(e,t,n,i){let o=t.polygon;if(!l(o))return;let r=Kr(o.interval),s=e.polygon;l(s)||(e.polygon=s=new Jh),Ce(Boolean,s,"show",o.show,r,i,n),PY(s,"_positions",o.positions,n),ngt(s,"_holes",o.holes,n),(l(s._positions)||l(s._holes))&&(s.hierarchy=new FY(s)),Ce(Number,s,"height",o.height,r,i,n),Ce(He,s,"heightReference",o.heightReference,r,i,n),Ce(Number,s,"extrudedHeight",o.extrudedHeight,r,i,n),Ce(He,s,"extrudedHeightReference",o.extrudedHeightReference,r,i,n),Ce(rh,s,"stRotation",o.stRotation,r,i,n),Ce(Number,s,"granularity",o.granularity,r,i,n),Ce(Boolean,s,"fill",o.fill,r,i,n),Ju(s,"material",o.material,r,i,n),Ce(Boolean,s,"outline",o.outline,r,i,n),Ce(U,s,"outlineColor",o.outlineColor,r,i,n),Ce(Number,s,"outlineWidth",o.outlineWidth,r,i,n),Ce(Boolean,s,"perPositionHeight",o.perPositionHeight,r,i,n),Ce(Boolean,s,"closeTop",o.closeTop,r,i,n),Ce(Boolean,s,"closeBottom",o.closeBottom,r,i,n),Ce(un,s,"arcType",o.arcType,r,i,n),Ce(vn,s,"shadows",o.shadows,r,i,n),Ce(Bt,s,"distanceDisplayCondition",o.distanceDisplayCondition,r,i,n),Ce(ni,s,"classificationType",o.classificationType,r,i,n),Ce(Number,s,"zIndex",o.zIndex,r,i,n)}function ygt(e){return e?un.GEODESIC:un.NONE}function xgt(e,t,n,i){let o=t.polyline;if(!l(o))return;let r=Kr(o.interval),s=e.polyline;if(l(s)||(e.polyline=s=new qc),Ce(Boolean,s,"show",o.show,r,i,n),PY(s,"positions",o.positions,n),Ce(Number,s,"width",o.width,r,i,n),Ce(Number,s,"granularity",o.granularity,r,i,n),Ju(s,"material",o.material,r,i,n),Ju(s,"depthFailMaterial",o.depthFailMaterial,r,i,n),Ce(un,s,"arcType",o.arcType,r,i,n),Ce(Boolean,s,"clampToGround",o.clampToGround,r,i,n),Ce(vn,s,"shadows",o.shadows,r,i,n),Ce(Bt,s,"distanceDisplayCondition",o.distanceDisplayCondition,r,i,n),Ce(ni,s,"classificationType",o.classificationType,r,i,n),Ce(Number,s,"zIndex",o.zIndex,r,i,n),l(o.followSurface)&&!l(o.arcType)){let a={};Ce(Boolean,a,"followSurface",o.followSurface,r,i,n),s.arcType=Xbt(a.followSurface,ygt)}}function Tgt(e,t,n,i){let o=t.polylineVolume;if(!l(o))return;let r=Kr(o.interval),s=e.polylineVolume;l(s)||(e.polylineVolume=s=new M_),PY(s,"positions",o.positions,n),igt(s,"shape",o.shape,n),Ce(Boolean,s,"show",o.show,r,i,n),Ce(ro,s,"cornerType",o.cornerType,r,i,n),Ce(Boolean,s,"fill",o.fill,r,i,n),Ju(s,"material",o.material,r,i,n),Ce(Boolean,s,"outline",o.outline,r,i,n),Ce(U,s,"outlineColor",o.outlineColor,r,i,n),Ce(Number,s,"outlineWidth",o.outlineWidth,r,i,n),Ce(Number,s,"granularity",o.granularity,r,i,n),Ce(vn,s,"shadows",o.shadows,r,i,n),Ce(Bt,s,"distanceDisplayCondition",o.distanceDisplayCondition,r,i,n)}function _gt(e,t,n,i){let o=t.rectangle;if(!l(o))return;let r=Kr(o.interval),s=e.rectangle;l(s)||(e.rectangle=s=new jh),Ce(Boolean,s,"show",o.show,r,i,n),Ce(re,s,"coordinates",o.coordinates,r,i,n),Ce(Number,s,"height",o.height,r,i,n),Ce(He,s,"heightReference",o.heightReference,r,i,n),Ce(Number,s,"extrudedHeight",o.extrudedHeight,r,i,n),Ce(He,s,"extrudedHeightReference",o.extrudedHeightReference,r,i,n),Ce(rh,s,"rotation",o.rotation,r,i,n),Ce(rh,s,"stRotation",o.stRotation,r,i,n),Ce(Number,s,"granularity",o.granularity,r,i,n),Ce(Boolean,s,"fill",o.fill,r,i,n),Ju(s,"material",o.material,r,i,n),Ce(Boolean,s,"outline",o.outline,r,i,n),Ce(U,s,"outlineColor",o.outlineColor,r,i,n),Ce(Number,s,"outlineWidth",o.outlineWidth,r,i,n),Ce(vn,s,"shadows",o.shadows,r,i,n),Ce(Bt,s,"distanceDisplayCondition",o.distanceDisplayCondition,r,i,n),Ce(ni,s,"classificationType",o.classificationType,r,i,n),Ce(Number,s,"zIndex",o.zIndex,r,i,n)}function Sgt(e,t,n,i){let o=t.tileset;if(!l(o))return;let r=Kr(o.interval),s=e.tileset;l(s)||(e.tileset=s=new N_),Ce(Boolean,s,"show",o.show,r,i,n),Ce(IY.default,s,"uri",o.uri,r,i,n),Ce(Number,s,"maximumScreenSpaceError",o.maximumScreenSpaceError,r,i,n)}function Zgt(e,t,n,i){let o=t.wall;if(!l(o))return;let r=Kr(o.interval),s=e.wall;l(s)||(e.wall=s=new Rb),Ce(Boolean,s,"show",o.show,r,i,n),PY(s,"positions",o.positions,n),o1e(s,"minimumHeights",o.minimumHeights,n),o1e(s,"maximumHeights",o.maximumHeights,n),Ce(Number,s,"granularity",o.granularity,r,i,n),Ce(Boolean,s,"fill",o.fill,r,i,n),Ju(s,"material",o.material,r,i,n),Ce(Boolean,s,"outline",o.outline,r,i,n),Ce(U,s,"outlineColor",o.outlineColor,r,i,n),Ce(Number,s,"outlineWidth",o.outlineWidth,r,i,n),Ce(vn,s,"shadows",o.shadows,r,i,n),Ce(Bt,s,"distanceDisplayCondition",o.distanceDisplayCondition,r,i,n)}function l1e(e,t,n,i,o){let r=e.id;if(l(r)||(r=Qn()),Ree=r,!l(o._version)&&r!=="document")throw new ae("The first CZML packet is required to be the document object.");if(e.delete===!0)t.removeById(r);else if(r==="document")dgt(e,o);else{let s=t.getOrCreateEntity(r),a=e.parent;l(a)&&(s.parent=t.getOrCreateEntity(a));for(let c=n.length-1;c>-1;c--)n[c](s,e,t,i)}Ree=void 0}function Rgt(e){let t,n=e._documentPacket.clock;if(!l(n)){if(!l(e._clock)){let o=e._entityCollection.computeAvailability();if(!o.start.equals(ot.MINIMUM_VALUE)){let r=o.start,s=o.stop,a=Q.secondsDifference(s,r),c=Math.round(a/120);return t=new vf,t.startTime=Q.clone(r),t.stopTime=Q.clone(s),t.clockRange=As.LOOP_STOP,t.multiplier=c,t.currentTime=Q.clone(r),t.clockStep=Oo.SYSTEM_CLOCK_MULTIPLIER,e._clock=t,!0}}return!1}l(e._clock)?t=e._clock.clone():(t=new vf,t.startTime=ot.MINIMUM_VALUE.clone(),t.stopTime=ot.MAXIMUM_VALUE.clone(),t.currentTime=ot.MINIMUM_VALUE.clone(),t.clockRange=As.LOOP_STOP,t.clockStep=Oo.SYSTEM_CLOCK_MULTIPLIER,t.multiplier=1);let i=Kr(n.interval);return l(i)&&(t.startTime=i.start,t.stopTime=i.stop),l(n.currentTime)&&(t.currentTime=Q.fromIso8601(n.currentTime)),l(n.range)&&(t.clockRange=As[n.range]??As.LOOP_STOP),l(n.step)&&(t.clockStep=Oo[n.step]??Oo.SYSTEM_CLOCK_MULTIPLIER),l(n.multiplier)&&(t.multiplier=n.multiplier),t.equals(e._clock)?!1:(e._clock=t.clone(e._clock),!0)}function h1e(e,t,n,i){n=n??B.EMPTY_OBJECT;let o=t,r=n.sourceUri,s=n.credit;if(typeof s=="string"&&(s=new Lt(s)),e._credit=s,typeof t=="string"||t instanceof ve){t=ve.createIfNeeded(t),o=t.fetchJson(),r=r??t.clone();let a=e._resourceCredits,c=t.credits;if(l(c)){let d=c.length;for(let u=0;u<d;u++)a.push(c[u])}}return r=ve.createIfNeeded(r),Es.setLoading(e,!0),Promise.resolve(o).then(function(a){return Cgt(e,a,r,i)}).catch(function(a){return Es.setLoading(e,!1),e._error.raiseEvent(e,a),console.log(a),Promise.reject(a)})}function Cgt(e,t,n,i){Es.setLoading(e,!0);let o=e._entityCollection;i&&(e._version=void 0,e._documentPacket=new f1e,o.removeAll()),oa._processCzml(t,o,n,void 0,e);let r=Rgt(e),s=e._documentPacket;return l(s.name)&&e._name!==s.name?(e._name=s.name,r=!0):!l(e._name)&&l(n)&&(e._name=Rg(n.getUrlComponent()),r=!0),Es.setLoading(e,!1),r&&e._changed.raiseEvent(e),e}function f1e(){this.name=void 0,this.clock=void 0}function oa(e){this._name=e,this._changed=new Se,this._error=new Se,this._isLoading=!1,this._loading=new Se,this._clock=void 0,this._documentPacket=new f1e,this._version=void 0,this._entityCollection=new za(this),this._entityCluster=new Bu,this._credit=void 0,this._resourceCredits=[]}oa.load=function(e,t){return new oa().load(e,t)};Object.defineProperties(oa.prototype,{name:{get:function(){return this._name}},clock:{get:function(){return this._clock}},entities:{get:function(){return this._entityCollection}},isLoading:{get:function(){return this._isLoading}},changedEvent:{get:function(){return this._changed}},errorEvent:{get:function(){return this._error}},loadingEvent:{get:function(){return this._loading}},show:{get:function(){return this._entityCollection.show},set:function(e){this._entityCollection.show=e}},clustering:{get:function(){return this._entityCluster},set:function(e){this._entityCluster=e}},credit:{get:function(){return this._credit}}});oa.updaters=[sgt,agt,cgt,lgt,ugt,mgt,hgt,fgt,Hbt,Kbt,pgt,bgt,ggt,xgt,Tgt,qbt,_gt,Jbt,Sgt,jbt,Zgt,Qbt,ogt];oa.registerUpdater=function(e){oa.updaters.includes(e)||oa.updaters.push(e)};oa.unregisterUpdater=function(e){if(oa.updaters.includes(e)){let t=oa.updaters.indexOf(e);oa.updaters.splice(t,1)}};oa.prototype.process=function(e,t){return h1e(this,e,t,!1)};oa.prototype.load=function(e,t){return h1e(this,e,t,!0)};oa.prototype.update=function(e){return!0};oa.processPacketData=Ce;oa.processPositionPacketData=m1e;oa.processMaterialPacketData=Ju;oa._processCzml=function(e,t,n,i,o){if(i=i??oa.updaters,Array.isArray(e))for(let r=0,s=e.length;r<s;++r)l1e(e[r],t,i,n,o);else l1e(e,t,i,n,o)};var XY=oa;var ZNi=x(T(),1);function dd(){this._dataSources=[],this._dataSourceAdded=new Se,this._dataSourceRemoved=new Se,this._dataSourceMoved=new Se}Object.defineProperties(dd.prototype,{length:{get:function(){return this._dataSources.length}},dataSourceAdded:{get:function(){return this._dataSourceAdded}},dataSourceRemoved:{get:function(){return this._dataSourceRemoved}},dataSourceMoved:{get:function(){return this._dataSourceMoved}}});dd.prototype.add=function(e){let t=this,n=this._dataSources;return Promise.resolve(e).then(function(i){return n===t._dataSources&&(t._dataSources.push(i),t._dataSourceAdded.raiseEvent(t,i)),i})};dd.prototype.remove=function(e,t){t=t??!1;let n=this._dataSources.indexOf(e);return n!==-1?(this._dataSources.splice(n,1),this._dataSourceRemoved.raiseEvent(this,e),t&&typeof e.destroy=="function"&&e.destroy(),!0):!1};dd.prototype.removeAll=function(e){e=e??!1;let t=this._dataSources;for(let n=0,i=t.length;n<i;++n){let o=t[n];this._dataSourceRemoved.raiseEvent(this,o),e&&typeof o.destroy=="function"&&o.destroy()}this._dataSources=[]};dd.prototype.contains=function(e){return this.indexOf(e)!==-1};dd.prototype.indexOf=function(e){return this._dataSources.indexOf(e)};dd.prototype.get=function(e){return this._dataSources[e]};dd.prototype.getByName=function(e){return this._dataSources.filter(function(t){return t.name===e})};function g3(e,t){return e.indexOf(t)}function p1e(e,t,n){let i=e._dataSources,o=i.length-1;if(t=W.clamp(t,0,o),n=W.clamp(n,0,o),t===n)return;let r=i[t];i[t]=i[n],i[n]=r,e.dataSourceMoved.raiseEvent(r,n,t)}dd.prototype.raise=function(e){let t=g3(this._dataSources,e);p1e(this,t,t+1)};dd.prototype.lower=function(e){let t=g3(this._dataSources,e);p1e(this,t,t-1)};dd.prototype.raiseToTop=function(e){let t=g3(this._dataSources,e);t!==this._dataSources.length-1&&(this._dataSources.splice(t,1),this._dataSources.push(e),this.dataSourceMoved.raiseEvent(e,this._dataSources.length-1,t))};dd.prototype.lowerToBottom=function(e){let t=g3(this._dataSources,e);t!==0&&(this._dataSources.splice(t,1),this._dataSources.splice(0,0,e),this.dataSourceMoved.raiseEvent(e,0,t))};dd.prototype.isDestroyed=function(){return!1};dd.prototype.destroy=function(){return this.removeAll(!0),ue(this)};var NY=dd;var tKi=x(T(),1);var PNi=x(T(),1);var LNi=x(T(),1);function bc(e){e=e??B.EMPTY_OBJECT,this._primitives=[],this._guid=Qn(),this._primitiveAdded=new Se,this._primitiveRemoved=new Se,this._zIndex=void 0,this.show=e.show??!0,this.destroyPrimitives=e.destroyPrimitives??!0,this._countReferences=e.countReferences??!1}Object.defineProperties(bc.prototype,{length:{get:function(){return this._primitives.length}},primitiveAdded:{get:function(){return this._primitiveAdded}},primitiveRemoved:{get:function(){return this._primitiveRemoved}}});bc.prototype.add=function(e,t){let n=l(t),i=e._external=e._external||{},o=i._composites=i._composites||{};return o[this._guid]={collection:this},n?this._primitives.splice(t,0,e):this._primitives.push(e),this._countReferences&&(l(i._referenceCount)?++i._referenceCount:i._referenceCount=1),this._primitiveAdded.raiseEvent(e),e};bc.prototype.remove=function(e){if(this.contains(e)){let t=this._primitives.indexOf(e);if(t!==-1)return this._primitives.splice(t,1),delete e._external._composites[this._guid],this._countReferences&&e._external._referenceCount--,this.destroyPrimitives&&(!this._countReferences||e._external._referenceCount<=0)&&e.destroy(),this._primitiveRemoved.raiseEvent(e),!0}return!1};bc.prototype.removeAndDestroy=function(e){let t=this.remove(e);return t&&!this.destroyPrimitives&&e.destroy(),t};bc.prototype.removeAll=function(){let e=this._primitives,t=e.length;for(let n=0;n<t;++n){let i=e[n];delete i._external._composites[this._guid],this._countReferences&&i._external._referenceCount--,this.destroyPrimitives&&(!this._countReferences||i._external._referenceCount<=0)&&i.destroy(),this._primitiveRemoved.raiseEvent(i)}this._primitives=[]};bc.prototype.contains=function(e){return!!(l(e)&&e._external&&e._external._composites&&e._external._composites[this._guid])};function y3(e,t){return e._primitives.indexOf(t)}bc.prototype.raise=function(e){if(l(e)){let t=y3(this,e),n=this._primitives;if(t!==n.length-1){let i=n[t];n[t]=n[t+1],n[t+1]=i}}};bc.prototype.raiseToTop=function(e){if(l(e)){let t=y3(this,e),n=this._primitives;t!==n.length-1&&(n.splice(t,1),n.push(e))}};bc.prototype.lower=function(e){if(l(e)){let t=y3(this,e),n=this._primitives;if(t!==0){let i=n[t];n[t]=n[t-1],n[t-1]=i}}};bc.prototype.lowerToBottom=function(e){if(l(e)){let t=y3(this,e),n=this._primitives;t!==0&&(n.splice(t,1),n.unshift(e))}};bc.prototype.get=function(e){return this._primitives[e]};bc.prototype.update=function(e){if(!this.show)return;let t=this._primitives;for(let n=0;n<t.length;++n)t[n].update(e)};bc.prototype.prePassesUpdate=function(e){let t=this._primitives;for(let n=0;n<t.length;++n){let i=t[n];l(i.prePassesUpdate)&&i.prePassesUpdate(e)}};bc.prototype.updateForPass=function(e,t){let n=this._primitives;for(let i=0;i<n.length;++i){let o=n[i];l(o.updateForPass)&&o.updateForPass(e,t)}};bc.prototype.postPassesUpdate=function(e){let t=this._primitives;for(let n=0;n<t.length;++n){let i=t[n];l(i.postPassesUpdate)&&i.postPassesUpdate(e)}};bc.prototype.isDestroyed=function(){return!1};bc.prototype.destroy=function(){return this.removeAll(),ue(this)};var xl=bc;function i0(){this._length=0,this._collections={},this._collectionsArray=[],this.show=!0}Object.defineProperties(i0.prototype,{length:{get:function(){return this._length}}});i0.prototype.add=function(e,t){t=t??0;let n=this._collections[t];if(!l(n)){n=new xl({destroyPrimitives:!1}),n._zIndex=t,this._collections[t]=n;let i=this._collectionsArray,o=0;for(;o<i.length&&i[o]._zIndex<t;)o++;i.splice(o,0,n)}return n.add(e),this._length++,e._zIndex=t,e};i0.prototype.set=function(e,t){return t===e._zIndex||(this.remove(e,!0),this.add(e,t)),e};i0.prototype.remove=function(e,t){if(this.contains(e)){let n=e._zIndex,i=this._collections[n],o;return t?o=i.remove(e):o=i.removeAndDestroy(e),o&&this._length--,i.length===0&&(this._collectionsArray.splice(this._collectionsArray.indexOf(i),1),this._collections[n]=void 0,i.destroy()),o}return!1};i0.prototype.removeAll=function(){let e=this._collectionsArray;for(let t=0;t<e.length;t++){let n=e[t];n.destroyPrimitives=!0,n.destroy()}this._collections={},this._collectionsArray=[],this._length=0};i0.prototype.contains=function(e){if(!l(e))return!1;let t=this._collections[e._zIndex];return l(t)&&t.contains(e)};i0.prototype.update=function(e){if(!this.show)return;let t=this._collectionsArray;for(let n=0;n<t.length;n++)t[n].update(e)};i0.prototype.isDestroyed=function(){return!1};i0.prototype.destroy=function(){return this.removeAll(),ue(this)};var YY=i0;var xBi=x(T(),1);var wNi=x(T(),1);function wV(e,t){this._primitives=e,this._orderedGroundPrimitives=t,this._dynamicUpdaters=new kt}wV.prototype.add=function(e,t){this._dynamicUpdaters.set(t.id,t.createDynamicUpdater(this._primitives,this._orderedGroundPrimitives))};wV.prototype.remove=function(e){let t=e.id,n=this._dynamicUpdaters.get(t);l(n)&&(this._dynamicUpdaters.remove(t),n.destroy())};wV.prototype.update=function(e){let t=this._dynamicUpdaters.values;for(let n=0,i=t.length;n<i;n++)t[n].update(e);return!0};wV.prototype.removeAllPrimitives=function(){let e=this._dynamicUpdaters.values;for(let t=0,n=e.length;t<n;t++)e[t].destroy();this._dynamicUpdaters.removeAll()};wV.prototype.getBoundingSphere=function(e,t){return e=this._dynamicUpdaters.get(e.id),l(e)&&l(e.getBoundingSphere)?e.getBoundingSphere(t):Wt.FAILED};var oZ=wV;var CDi=x(T(),1);var nMi=x(T(),1);var gYi=x(T(),1);var zNi=x(T(),1);var Aee={},x3=new h,b1e=new h,g1e=new Ne,y1e=new q;function kV(e,t,n,i,o,r,s,a,c,d){let u=e+t;h.multiplyByScalar(i,Math.cos(u),x3),h.multiplyByScalar(n,Math.sin(u),b1e),h.add(x3,b1e,x3);let m=Math.cos(e);m=m*m;let p=Math.sin(e);p=p*p;let f=r/Math.sqrt(s*m+o*p)/a;return Ne.fromAxisAngle(x3,f,g1e),q.fromQuaternion(g1e,y1e),q.multiplyByVector(y1e,c,d),h.normalize(d,d),h.multiplyByScalar(d,a,d),d}var x1e=new h,T1e=new h,Eee=new h,Vgt=new h;Aee.raisePositionsToHeight=function(e,t,n){let i=t.ellipsoid,o=t.height,r=t.extrudedHeight,s=n?e.length/3*2:e.length/3,a=new Float64Array(s*3),c=e.length,d=n?c:0;for(let u=0;u<c;u+=3){let m=u+1,p=u+2,b=h.fromArray(e,u,x1e);i.scaleToGeodeticSurface(b,b);let f=h.clone(b,T1e),y=i.geodeticSurfaceNormal(b,Vgt),_=h.multiplyByScalar(y,o,Eee);h.add(b,_,b),n&&(h.multiplyByScalar(y,r,_),h.add(f,_,f),a[u+d]=f.x,a[m+d]=f.y,a[p+d]=f.z),a[u]=b.x,a[m]=b.y,a[p]=b.z}return a};var Egt=new h,Agt=new h,Ggt=new h;Aee.computeEllipsePositions=function(e,t,n){let i=e.semiMinorAxis,o=e.semiMajorAxis,r=e.rotation,s=e.center,a=e.granularity*8,c=i*i,d=o*o,u=o*i,m=h.magnitude(s),p=h.normalize(s,Egt),b=h.cross(h.UNIT_Z,s,Agt);b=h.normalize(b,b);let f=h.cross(p,b,Ggt),y=1+Math.ceil(W.PI_OVER_TWO/a),_=W.PI_OVER_TWO/(y-1),S=W.PI_OVER_TWO-y*_;S<0&&(y-=Math.ceil(Math.abs(S)/_));let Z=2*(y*(y+2)),R=t?new Array(Z*3):void 0,C=0,E=x1e,A=T1e,L=y*4*3,F=L-1,I=0,N=n?new Array(L):void 0,g,V,G,v,X;for(S=W.PI_OVER_TWO,E=kV(S,r,f,b,c,u,d,m,p,E),t&&(R[C++]=E.x,R[C++]=E.y,R[C++]=E.z),n&&(N[F--]=E.z,N[F--]=E.y,N[F--]=E.x),S=W.PI_OVER_TWO-_,g=1;g<y+1;++g){if(E=kV(S,r,f,b,c,u,d,m,p,E),A=kV(Math.PI-S,r,f,b,c,u,d,m,p,A),t){for(R[C++]=E.x,R[C++]=E.y,R[C++]=E.z,G=2*g+2,V=1;V<G-1;++V)v=V/(G-1),X=h.lerp(E,A,v,Eee),R[C++]=X.x,R[C++]=X.y,R[C++]=X.z;R[C++]=A.x,R[C++]=A.y,R[C++]=A.z}n&&(N[F--]=E.z,N[F--]=E.y,N[F--]=E.x,N[I++]=A.x,N[I++]=A.y,N[I++]=A.z),S=W.PI_OVER_TWO-(g+1)*_}for(g=y;g>1;--g){if(S=W.PI_OVER_TWO-(g-1)*_,E=kV(-S,r,f,b,c,u,d,m,p,E),A=kV(S+Math.PI,r,f,b,c,u,d,m,p,A),t){for(R[C++]=E.x,R[C++]=E.y,R[C++]=E.z,G=2*(g-1)+2,V=1;V<G-1;++V)v=V/(G-1),X=h.lerp(E,A,v,Eee),R[C++]=X.x,R[C++]=X.y,R[C++]=X.z;R[C++]=A.x,R[C++]=A.y,R[C++]=A.z}n&&(N[F--]=E.z,N[F--]=E.y,N[F--]=E.x,N[I++]=A.x,N[I++]=A.y,N[I++]=A.z)}S=W.PI_OVER_TWO,E=kV(-S,r,f,b,c,u,d,m,p,E);let Y={};return t&&(R[C++]=E.x,R[C++]=E.y,R[C]=E.z,Y.positions=R,Y.numPts=y),n&&(N[F--]=E.z,N[F--]=E.y,N[F]=E.x,Y.outerPositions=N),Y};var jd=Aee;var UV=new h,Gee=new h,Lee=new h,_1e=new h,Aa=new k,S1e=new q,Lgt=new q,Wee=new Ne,Z1e=new h,R1e=new h,C1e=new h,S3=new pe,V1e=new h,E1e=new k,A1e=new k;function G1e(e,t,n){let i=t.vertexFormat,o=t.center,r=t.semiMajorAxis,s=t.semiMinorAxis,a=t.ellipsoid,c=t.stRotation,d=n?e.length/3*2:e.length/3,u=t.shadowVolume,m=i.st?new Float32Array(d*2):void 0,p=i.normal?new Float32Array(d*3):void 0,b=i.tangent?new Float32Array(d*3):void 0,f=i.bitangent?new Float32Array(d*3):void 0,y=u?new Float32Array(d*3):void 0,_=0,S=Z1e,Z=R1e,R=C1e,C=new ki(a),E=C.project(a.cartesianToCartographic(o,S3),V1e),A=a.scaleToGeodeticSurface(o,UV);a.geodeticSurfaceNormal(A,A);let L=S1e,F=Lgt;if(c!==0){let X=Ne.fromAxisAngle(A,c,Wee);L=q.fromQuaternion(X,L),X=Ne.fromAxisAngle(A,-c,Wee),F=q.fromQuaternion(X,F)}else L=q.clone(q.IDENTITY,L),F=q.clone(q.IDENTITY,F);let I=k.fromElements(Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY,E1e),N=k.fromElements(Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY,A1e),g=e.length,V=n?g:0,G=V/3*2;for(let X=0;X<g;X+=3){let Y=X+1,D=X+2,M=h.fromArray(e,X,UV);if(i.st){let O=q.multiplyByVector(L,M,Gee),w=C.project(a.cartesianToCartographic(O,S3),Lee);h.subtract(w,E,w),Aa.x=(w.x+r)/(2*r),Aa.y=(w.y+s)/(2*s),I.x=Math.min(Aa.x,I.x),I.y=Math.min(Aa.y,I.y),N.x=Math.max(Aa.x,N.x),N.y=Math.max(Aa.y,N.y),n&&(m[_+G]=Aa.x,m[_+1+G]=Aa.y),m[_++]=Aa.x,m[_++]=Aa.y}(i.normal||i.tangent||i.bitangent||u)&&(S=a.geodeticSurfaceNormal(M,S),u&&(y[X+V]=-S.x,y[Y+V]=-S.y,y[D+V]=-S.z),(i.normal||i.tangent||i.bitangent)&&((i.tangent||i.bitangent)&&(Z=h.normalize(h.cross(h.UNIT_Z,S,Z),Z),q.multiplyByVector(F,Z,Z)),i.normal&&(p[X]=S.x,p[Y]=S.y,p[D]=S.z,n&&(p[X+V]=-S.x,p[Y+V]=-S.y,p[D+V]=-S.z)),i.tangent&&(b[X]=Z.x,b[Y]=Z.y,b[D]=Z.z,n&&(b[X+V]=-Z.x,b[Y+V]=-Z.y,b[D+V]=-Z.z)),i.bitangent&&(R=h.normalize(h.cross(S,Z,R),R),f[X]=R.x,f[Y]=R.y,f[D]=R.z,n&&(f[X+V]=R.x,f[Y+V]=R.y,f[D+V]=R.z))))}if(i.st){g=m.length;for(let X=0;X<g;X+=2)m[X]=(m[X]-I.x)/(N.x-I.x),m[X+1]=(m[X+1]-I.y)/(N.y-I.y)}let v=new Rn;if(i.position){let X=jd.raisePositionsToHeight(e,t,n);v.position=new Xe({componentDatatype:J.DOUBLE,componentsPerAttribute:3,values:X})}if(i.st&&(v.st=new Xe({componentDatatype:J.FLOAT,componentsPerAttribute:2,values:m})),i.normal&&(v.normal=new Xe({componentDatatype:J.FLOAT,componentsPerAttribute:3,values:p})),i.tangent&&(v.tangent=new Xe({componentDatatype:J.FLOAT,componentsPerAttribute:3,values:b})),i.bitangent&&(v.bitangent=new Xe({componentDatatype:J.FLOAT,componentsPerAttribute:3,values:f})),u&&(v.extrudeDirection=new Xe({componentDatatype:J.FLOAT,componentsPerAttribute:3,values:y})),n&&l(t.offsetAttribute)){let X=new Uint8Array(d);if(t.offsetAttribute===bn.TOP)X=X.fill(1,0,d/2);else{let Y=t.offsetAttribute===bn.NONE?0:1;X=X.fill(Y)}v.applyOffset=new Xe({componentDatatype:J.UNSIGNED_BYTE,componentsPerAttribute:1,values:X})}return v}function L1e(e){let t=new Array(12*(e*(e+1))-6),n=0,i,o,r,s,a;for(i=0,r=1,s=0;s<3;s++)t[n++]=r++,t[n++]=i,t[n++]=r;for(s=2;s<e+1;++s){for(r=s*(s+1)-1,i=(s-1)*s-1,t[n++]=r++,t[n++]=i,t[n++]=r,o=2*s,a=0;a<o-1;++a)t[n++]=r,t[n++]=i++,t[n++]=i,t[n++]=r++,t[n++]=i,t[n++]=r;t[n++]=r++,t[n++]=i,t[n++]=r}for(o=e*2,++r,++i,s=0;s<o-1;++s)t[n++]=r,t[n++]=i++,t[n++]=i,t[n++]=r++,t[n++]=i,t[n++]=r;for(t[n++]=r,t[n++]=i++,t[n++]=i,t[n++]=r++,t[n++]=i++,t[n++]=i,++i,s=e-1;s>1;--s){for(t[n++]=i++,t[n++]=i,t[n++]=r,o=2*s,a=0;a<o-1;++a)t[n++]=r,t[n++]=i++,t[n++]=i,t[n++]=r++,t[n++]=i,t[n++]=r;t[n++]=i++,t[n++]=i++,t[n++]=r++}for(s=0;s<3;s++)t[n++]=i++,t[n++]=i,t[n++]=r;return t}var rZ=new h;function Wgt(e){let t=e.center;rZ=h.multiplyByScalar(e.ellipsoid.geodeticSurfaceNormal(t,rZ),e.height,rZ),rZ=h.add(t,rZ,rZ);let n=new me(rZ,e.semiMajorAxis),i=jd.computeEllipsePositions(e,!0,!1),o=i.positions,r=i.numPts,s=G1e(o,e,!1),a=L1e(r);return a=Oe.createTypedArray(o.length/3,a),{boundingSphere:n,attributes:s,indices:a}}function vgt(e,t){let n=t.vertexFormat,i=t.center,o=t.semiMajorAxis,r=t.semiMinorAxis,s=t.ellipsoid,a=t.height,c=t.extrudedHeight,d=t.stRotation,u=e.length/3*2,m=new Float64Array(u*3),p=n.st?new Float32Array(u*2):void 0,b=n.normal?new Float32Array(u*3):void 0,f=n.tangent?new Float32Array(u*3):void 0,y=n.bitangent?new Float32Array(u*3):void 0,_=t.shadowVolume,S=_?new Float32Array(u*3):void 0,Z=0,R=Z1e,C=R1e,E=C1e,A=new ki(s),L=A.project(s.cartesianToCartographic(i,S3),V1e),F=s.scaleToGeodeticSurface(i,UV);s.geodeticSurfaceNormal(F,F);let I=Ne.fromAxisAngle(F,d,Wee),N=q.fromQuaternion(I,S1e),g=k.fromElements(Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY,E1e),V=k.fromElements(Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY,A1e),G=e.length,v=G/3*2;for(let Y=0;Y<G;Y+=3){let D=Y+1,M=Y+2,O=h.fromArray(e,Y,UV),w;if(n.st){let K=q.multiplyByVector(N,O,Gee),te=A.project(s.cartesianToCartographic(K,S3),Lee);h.subtract(te,L,te),Aa.x=(te.x+o)/(2*o),Aa.y=(te.y+r)/(2*r),g.x=Math.min(Aa.x,g.x),g.y=Math.min(Aa.y,g.y),V.x=Math.max(Aa.x,V.x),V.y=Math.max(Aa.y,V.y),p[Z+v]=Aa.x,p[Z+1+v]=Aa.y,p[Z++]=Aa.x,p[Z++]=Aa.y}O=s.scaleToGeodeticSurface(O,O),w=h.clone(O,Gee),R=s.geodeticSurfaceNormal(O,R),_&&(S[Y+G]=-R.x,S[D+G]=-R.y,S[M+G]=-R.z);let z=h.multiplyByScalar(R,a,_1e);if(O=h.add(O,z,O),z=h.multiplyByScalar(R,c,z),w=h.add(w,z,w),n.position&&(m[Y+G]=w.x,m[D+G]=w.y,m[M+G]=w.z,m[Y]=O.x,m[D]=O.y,m[M]=O.z),n.normal||n.tangent||n.bitangent){E=h.clone(R,E);let K=h.fromArray(e,(Y+3)%G,_1e);h.subtract(K,O,K);let te=h.subtract(w,O,Lee);R=h.normalize(h.cross(te,K,R),R),n.normal&&(b[Y]=R.x,b[D]=R.y,b[M]=R.z,b[Y+G]=R.x,b[D+G]=R.y,b[M+G]=R.z),n.tangent&&(C=h.normalize(h.cross(E,R,C),C),f[Y]=C.x,f[D]=C.y,f[M]=C.z,f[Y+G]=C.x,f[Y+1+G]=C.y,f[Y+2+G]=C.z),n.bitangent&&(y[Y]=E.x,y[D]=E.y,y[M]=E.z,y[Y+G]=E.x,y[D+G]=E.y,y[M+G]=E.z)}}if(n.st){G=p.length;for(let Y=0;Y<G;Y+=2)p[Y]=(p[Y]-g.x)/(V.x-g.x),p[Y+1]=(p[Y+1]-g.y)/(V.y-g.y)}let X=new Rn;if(n.position&&(X.position=new Xe({componentDatatype:J.DOUBLE,componentsPerAttribute:3,values:m})),n.st&&(X.st=new Xe({componentDatatype:J.FLOAT,componentsPerAttribute:2,values:p})),n.normal&&(X.normal=new Xe({componentDatatype:J.FLOAT,componentsPerAttribute:3,values:b})),n.tangent&&(X.tangent=new Xe({componentDatatype:J.FLOAT,componentsPerAttribute:3,values:f})),n.bitangent&&(X.bitangent=new Xe({componentDatatype:J.FLOAT,componentsPerAttribute:3,values:y})),_&&(X.extrudeDirection=new Xe({componentDatatype:J.FLOAT,componentsPerAttribute:3,values:S})),l(t.offsetAttribute)){let Y=new Uint8Array(u);if(t.offsetAttribute===bn.TOP)Y=Y.fill(1,0,u/2);else{let D=t.offsetAttribute===bn.NONE?0:1;Y=Y.fill(D)}X.applyOffset=new Xe({componentDatatype:J.UNSIGNED_BYTE,componentsPerAttribute:1,values:Y})}return X}function Fgt(e){let t=e.length/3,n=Oe.createTypedArray(t,t*6),i=0;for(let o=0;o<t;o++){let r=o,s=o+t,a=(r+1)%t,c=a+t;n[i++]=r,n[i++]=s,n[i++]=a,n[i++]=a,n[i++]=s,n[i++]=c}return n}var T3=new me,_3=new me;function Igt(e){let t=e.center,n=e.ellipsoid,i=e.semiMajorAxis,o=h.multiplyByScalar(n.geodeticSurfaceNormal(t,UV),e.height,UV);T3.center=h.add(t,o,T3.center),T3.radius=i,o=h.multiplyByScalar(n.geodeticSurfaceNormal(t,o),e.extrudedHeight,o),_3.center=h.add(t,o,_3.center),_3.radius=i;let r=jd.computeEllipsePositions(e,!0,!0),s=r.positions,a=r.numPts,c=r.outerPositions,d=me.union(T3,_3),u=G1e(s,e,!0),m=L1e(a),p=m.length;m.length=p*2;let b=s.length/3;for(let C=0;C<p;C+=3)m[C+p]=m[C+2]+b,m[C+1+p]=m[C+1]+b,m[C+2+p]=m[C]+b;let f=Oe.createTypedArray(b*2/3,m),y=new At({attributes:u,indices:f,primitiveType:Ie.TRIANGLES}),_=vgt(c,e);m=Fgt(c);let S=Oe.createTypedArray(c.length*2/3,m),Z=new At({attributes:_,indices:S,primitiveType:Ie.TRIANGLES}),R=Bn.combineInstances([new Yt({geometry:y}),new Yt({geometry:Z})]);return{boundingSphere:d,attributes:R[0].attributes,indices:R[0].indices}}function W1e(e,t,n,i,o,r,s){let c=jd.computeEllipsePositions({center:e,semiMajorAxis:t,semiMinorAxis:n,rotation:i,granularity:o},!1,!0).outerPositions,d=c.length/3,u=new Array(d);for(let p=0;p<d;++p)u[p]=h.fromArray(c,p*3);let m=re.fromCartesianArray(u,r,s);return m.width>W.PI&&(m.north=m.north>0?W.PI_OVER_TWO-W.EPSILON7:m.north,m.south=m.south<0?W.EPSILON7-W.PI_OVER_TWO:m.south,m.east=W.PI,m.west=-W.PI),m}function r0(e){e=e??B.EMPTY_OBJECT;let t=e.center,n=e.ellipsoid??ne.default,i=e.semiMajorAxis,o=e.semiMinorAxis,r=e.granularity??W.RADIANS_PER_DEGREE,s=e.vertexFormat??Me.DEFAULT,a=e.height??0,c=e.extrudedHeight??a;this._center=h.clone(t),this._semiMajorAxis=i,this._semiMinorAxis=o,this._ellipsoid=ne.clone(n),this._rotation=e.rotation??0,this._stRotation=e.stRotation??0,this._height=Math.max(c,a),this._granularity=r,this._vertexFormat=Me.clone(s),this._extrudedHeight=Math.min(c,a),this._shadowVolume=e.shadowVolume??!1,this._workerName="createEllipseGeometry",this._offsetAttribute=e.offsetAttribute,this._rectangle=void 0,this._textureCoordinateRotationPoints=void 0}r0.packedLength=h.packedLength+ne.packedLength+Me.packedLength+9;r0.pack=function(e,t,n){return n=n??0,h.pack(e._center,t,n),n+=h.packedLength,ne.pack(e._ellipsoid,t,n),n+=ne.packedLength,Me.pack(e._vertexFormat,t,n),n+=Me.packedLength,t[n++]=e._semiMajorAxis,t[n++]=e._semiMinorAxis,t[n++]=e._rotation,t[n++]=e._stRotation,t[n++]=e._height,t[n++]=e._granularity,t[n++]=e._extrudedHeight,t[n++]=e._shadowVolume?1:0,t[n]=e._offsetAttribute??-1,t};var v1e=new h,F1e=new ne,I1e=new Me,o0={center:v1e,ellipsoid:F1e,vertexFormat:I1e,semiMajorAxis:void 0,semiMinorAxis:void 0,rotation:void 0,stRotation:void 0,height:void 0,granularity:void 0,extrudedHeight:void 0,shadowVolume:void 0,offsetAttribute:void 0};r0.unpack=function(e,t,n){t=t??0;let i=h.unpack(e,t,v1e);t+=h.packedLength;let o=ne.unpack(e,t,F1e);t+=ne.packedLength;let r=Me.unpack(e,t,I1e);t+=Me.packedLength;let s=e[t++],a=e[t++],c=e[t++],d=e[t++],u=e[t++],m=e[t++],p=e[t++],b=e[t++]===1,f=e[t];return l(n)?(n._center=h.clone(i,n._center),n._ellipsoid=ne.clone(o,n._ellipsoid),n._vertexFormat=Me.clone(r,n._vertexFormat),n._semiMajorAxis=s,n._semiMinorAxis=a,n._rotation=c,n._stRotation=d,n._height=u,n._granularity=m,n._extrudedHeight=p,n._shadowVolume=b,n._offsetAttribute=f===-1?void 0:f,n):(o0.height=u,o0.extrudedHeight=p,o0.granularity=m,o0.stRotation=d,o0.rotation=c,o0.semiMajorAxis=s,o0.semiMinorAxis=a,o0.shadowVolume=b,o0.offsetAttribute=f===-1?void 0:f,new r0(o0))};r0.computeRectangle=function(e,t){e=e??B.EMPTY_OBJECT;let n=e.center,i=e.ellipsoid??ne.default,o=e.semiMajorAxis,r=e.semiMinorAxis,s=e.granularity??W.RADIANS_PER_DEGREE,a=e.rotation??0;return W1e(n,o,r,a,s,i,t)};r0.createGeometry=function(e){if(e._semiMajorAxis<=0||e._semiMinorAxis<=0)return;let t=e._height,n=e._extrudedHeight,i=!W.equalsEpsilon(t,n,0,W.EPSILON2);e._center=e._ellipsoid.scaleToGeodeticSurface(e._center,e._center);let o={center:e._center,semiMajorAxis:e._semiMajorAxis,semiMinorAxis:e._semiMinorAxis,ellipsoid:e._ellipsoid,rotation:e._rotation,height:t,granularity:e._granularity,vertexFormat:e._vertexFormat,stRotation:e._stRotation},r;if(i)o.extrudedHeight=n,o.shadowVolume=e._shadowVolume,o.offsetAttribute=e._offsetAttribute,r=Igt(o);else if(r=Wgt(o),l(e._offsetAttribute)){let s=r.attributes.position.values.length,a=e._offsetAttribute===bn.NONE?0:1,c=new Uint8Array(s/3).fill(a);r.attributes.applyOffset=new Xe({componentDatatype:J.UNSIGNED_BYTE,componentsPerAttribute:1,values:c})}return new At({attributes:r.attributes,indices:r.indices,primitiveType:Ie.TRIANGLES,boundingSphere:r.boundingSphere,offsetAttribute:e._offsetAttribute})};r0.createShadowVolume=function(e,t,n){let i=e._granularity,o=e._ellipsoid,r=t(i,o),s=n(i,o);return new r0({center:e._center,semiMajorAxis:e._semiMajorAxis,semiMinorAxis:e._semiMinorAxis,ellipsoid:o,rotation:e._rotation,stRotation:e._stRotation,granularity:i,extrudedHeight:r,height:s,vertexFormat:Me.POSITION_ONLY,shadowVolume:!0})};function Pgt(e){let t=-e._stRotation;if(t===0)return[0,0,0,1,1,0];let i=jd.computeEllipsePositions({center:e._center,semiMajorAxis:e._semiMajorAxis,semiMinorAxis:e._semiMinorAxis,rotation:e._rotation,granularity:e._granularity},!1,!0).outerPositions,o=i.length/3,r=new Array(o);for(let c=0;c<o;++c)r[c]=h.fromArray(i,c*3);let s=e._ellipsoid,a=e.rectangle;return At._textureCoordinateRotationPoints(r,t,s,a)}Object.defineProperties(r0.prototype,{rectangle:{get:function(){return l(this._rectangle)||(this._rectangle=W1e(this._center,this._semiMajorAxis,this._semiMinorAxis,this._rotation,this._granularity,this._ellipsoid)),this._rectangle}},textureCoordinateRotationPoints:{get:function(){return l(this._textureCoordinateRotationPoints)||(this._textureCoordinateRotationPoints=Pgt(this)),this._textureCoordinateRotationPoints}}});var ud=r0;var FYi=x(T(),1);var P1e=new h,sZ=new h;function Xgt(e){let t=e.center;sZ=h.multiplyByScalar(e.ellipsoid.geodeticSurfaceNormal(t,sZ),e.height,sZ),sZ=h.add(t,sZ,sZ);let n=new me(sZ,e.semiMajorAxis),i=jd.computeEllipsePositions(e,!1,!0).outerPositions,o=new Rn({position:new Xe({componentDatatype:J.DOUBLE,componentsPerAttribute:3,values:jd.raisePositionsToHeight(i,e,!1)})}),r=i.length/3,s=Oe.createTypedArray(r,r*2),a=0;for(let c=0;c<r;++c)s[a++]=c,s[a++]=(c+1)%r;return{boundingSphere:n,attributes:o,indices:s}}var Z3=new me,R3=new me;function Ngt(e){let t=e.center,n=e.ellipsoid,i=e.semiMajorAxis,o=h.multiplyByScalar(n.geodeticSurfaceNormal(t,P1e),e.height,P1e);Z3.center=h.add(t,o,Z3.center),Z3.radius=i,o=h.multiplyByScalar(n.geodeticSurfaceNormal(t,o),e.extrudedHeight,o),R3.center=h.add(t,o,R3.center),R3.radius=i;let r=jd.computeEllipsePositions(e,!1,!0).outerPositions,s=new Rn({position:new Xe({componentDatatype:J.DOUBLE,componentsPerAttribute:3,values:jd.raisePositionsToHeight(r,e,!0)})});r=s.position.values;let a=me.union(Z3,R3),c=r.length/3;if(l(e.offsetAttribute)){let f=new Uint8Array(c);if(e.offsetAttribute===bn.TOP)f=f.fill(1,0,c/2);else{let y=e.offsetAttribute===bn.NONE?0:1;f=f.fill(y)}s.applyOffset=new Xe({componentDatatype:J.UNSIGNED_BYTE,componentsPerAttribute:1,values:f})}let d=e.numberOfVerticalLines??16;d=W.clamp(d,0,c/2);let u=Oe.createTypedArray(c,c*2+d*2);c/=2;let m=0,p;for(p=0;p<c;++p)u[m++]=p,u[m++]=(p+1)%c,u[m++]=p+c,u[m++]=(p+1)%c+c;let b;if(d>0){let f=Math.min(d,c);b=Math.round(c/f);let y=Math.min(b*d,c);for(p=0;p<y;p+=b)u[m++]=p,u[m++]=p+c}return{boundingSphere:a,attributes:s,indices:u}}function DV(e){e=e??B.EMPTY_OBJECT;let t=e.center,n=e.ellipsoid??ne.default,i=e.semiMajorAxis,o=e.semiMinorAxis,r=e.granularity??W.RADIANS_PER_DEGREE,s=e.height??0,a=e.extrudedHeight??s;this._center=h.clone(t),this._semiMajorAxis=i,this._semiMinorAxis=o,this._ellipsoid=ne.clone(n),this._rotation=e.rotation??0,this._height=Math.max(a,s),this._granularity=r,this._extrudedHeight=Math.min(a,s),this._numberOfVerticalLines=Math.max(e.numberOfVerticalLines??16,0),this._offsetAttribute=e.offsetAttribute,this._workerName="createEllipseOutlineGeometry"}DV.packedLength=h.packedLength+ne.packedLength+8;DV.pack=function(e,t,n){return n=n??0,h.pack(e._center,t,n),n+=h.packedLength,ne.pack(e._ellipsoid,t,n),n+=ne.packedLength,t[n++]=e._semiMajorAxis,t[n++]=e._semiMinorAxis,t[n++]=e._rotation,t[n++]=e._height,t[n++]=e._granularity,t[n++]=e._extrudedHeight,t[n++]=e._numberOfVerticalLines,t[n]=e._offsetAttribute??-1,t};var X1e=new h,N1e=new ne,vg={center:X1e,ellipsoid:N1e,semiMajorAxis:void 0,semiMinorAxis:void 0,rotation:void 0,height:void 0,granularity:void 0,extrudedHeight:void 0,numberOfVerticalLines:void 0,offsetAttribute:void 0};DV.unpack=function(e,t,n){t=t??0;let i=h.unpack(e,t,X1e);t+=h.packedLength;let o=ne.unpack(e,t,N1e);t+=ne.packedLength;let r=e[t++],s=e[t++],a=e[t++],c=e[t++],d=e[t++],u=e[t++],m=e[t++],p=e[t];return l(n)?(n._center=h.clone(i,n._center),n._ellipsoid=ne.clone(o,n._ellipsoid),n._semiMajorAxis=r,n._semiMinorAxis=s,n._rotation=a,n._height=c,n._granularity=d,n._extrudedHeight=u,n._numberOfVerticalLines=m,n._offsetAttribute=p===-1?void 0:p,n):(vg.height=c,vg.extrudedHeight=u,vg.granularity=d,vg.rotation=a,vg.semiMajorAxis=r,vg.semiMinorAxis=s,vg.numberOfVerticalLines=m,vg.offsetAttribute=p===-1?void 0:p,new DV(vg))};DV.createGeometry=function(e){if(e._semiMajorAxis<=0||e._semiMinorAxis<=0)return;let t=e._height,n=e._extrudedHeight,i=!W.equalsEpsilon(t,n,0,W.EPSILON2);e._center=e._ellipsoid.scaleToGeodeticSurface(e._center,e._center);let o={center:e._center,semiMajorAxis:e._semiMajorAxis,semiMinorAxis:e._semiMinorAxis,ellipsoid:e._ellipsoid,rotation:e._rotation,height:t,granularity:e._granularity,numberOfVerticalLines:e._numberOfVerticalLines},r;if(i)o.extrudedHeight=n,o.offsetAttribute=e._offsetAttribute,r=Ngt(o);else if(r=Xgt(o),l(e._offsetAttribute)){let s=r.attributes.position.values.length,a=e._offsetAttribute===bn.NONE?0:1,c=new Uint8Array(s/3).fill(a);r.attributes.applyOffset=new Xe({componentDatatype:J.UNSIGNED_BYTE,componentsPerAttribute:1,values:c})}return new At({attributes:r.attributes,indices:r.indices,primitiveType:Ie.LINES,boundingSphere:r.boundingSphere,offsetAttribute:e._offsetAttribute})};var ju=DV;var Y1e=new U,M1e=h.ZERO,w1e=new h,k1e=new re;function Ygt(e){this.id=e,this.vertexFormat=void 0,this.center=void 0,this.semiMajorAxis=void 0,this.semiMinorAxis=void 0,this.rotation=void 0,this.height=void 0,this.extrudedHeight=void 0,this.granularity=void 0,this.stRotation=void 0,this.numberOfVerticalLines=void 0,this.offsetAttribute=void 0}function If(e,t){ri.call(this,{entity:e,scene:t,geometryOptions:new Ygt(e),geometryPropertyName:"ellipse",observedPropertyNames:["availability","position","ellipse"]}),this._onEntityPropertyChanged(e,"ellipse",e.ellipse,void 0)}l(Object.create)&&(If.prototype=Object.create(ri.prototype),If.prototype.constructor=If);If.prototype.createFillGeometryInstance=function(e){let t=this._entity,n=t.isAvailable(e),i={show:new Wn(n&&t.isShowing&&this._showProperty.getValue(e)&&this._fillProperty.getValue(e)),distanceDisplayCondition:ti.fromDistanceDisplayCondition(this._distanceDisplayConditionProperty.getValue(e)),offset:void 0,color:void 0};if(this._materialProperty instanceof Qt){let o;l(this._materialProperty.color)&&(this._materialProperty.color.isConstant||n)&&(o=this._materialProperty.color.getValue(e,Y1e)),l(o)||(o=U.WHITE),i.color=$t.fromColor(o)}return l(this._options.offsetAttribute)&&(i.offset=Ro.fromCartesian3(j.getValueOrDefault(this._terrainOffsetProperty,e,M1e,w1e))),new Yt({id:t,geometry:new ud(this._options),attributes:i})};If.prototype.createOutlineGeometryInstance=function(e){let t=this._entity,n=t.isAvailable(e),i=j.getValueOrDefault(this._outlineColorProperty,e,U.BLACK,Y1e),o=this._distanceDisplayConditionProperty.getValue(e),r={show:new Wn(n&&t.isShowing&&this._showProperty.getValue(e)&&this._showOutlineProperty.getValue(e)),color:$t.fromColor(i),distanceDisplayCondition:ti.fromDistanceDisplayCondition(o),offset:void 0};return l(this._options.offsetAttribute)&&(r.offset=Ro.fromCartesian3(j.getValueOrDefault(this._terrainOffsetProperty,e,M1e,w1e))),new Yt({id:t,geometry:new ju(this._options),attributes:r})};If.prototype._computeCenter=function(e,t){return j.getValueOrUndefined(this._entity.position,e,t)};If.prototype._isHidden=function(e,t){let n=e.position;return!l(n)||!l(t.semiMajorAxis)||!l(t.semiMinorAxis)||Wi.prototype._isHidden.call(this,e,t)};If.prototype._isDynamic=function(e,t){return!e.position.isConstant||!t.semiMajorAxis.isConstant||!t.semiMinorAxis.isConstant||!j.isConstant(t.rotation)||!j.isConstant(t.height)||!j.isConstant(t.extrudedHeight)||!j.isConstant(t.granularity)||!j.isConstant(t.stRotation)||!j.isConstant(t.outlineWidth)||!j.isConstant(t.numberOfVerticalLines)||!j.isConstant(t.zIndex)||this._onTerrain&&!j.isConstant(this._materialProperty)&&!(this._materialProperty instanceof Qt)};If.prototype._setStaticOptions=function(e,t){let n=j.getValueOrUndefined(t.height,ot.MINIMUM_VALUE),i=j.getValueOrDefault(t.heightReference,ot.MINIMUM_VALUE,He.NONE),o=j.getValueOrUndefined(t.extrudedHeight,ot.MINIMUM_VALUE),r=j.getValueOrDefault(t.extrudedHeightReference,ot.MINIMUM_VALUE,He.NONE);l(o)&&!l(n)&&(n=0);let s=this._options;s.vertexFormat=this._materialProperty instanceof Qt?Tn.VERTEX_FORMAT:Co.MaterialSupport.TEXTURED.vertexFormat,s.center=e.position.getValue(ot.MINIMUM_VALUE,s.center),s.semiMajorAxis=t.semiMajorAxis.getValue(ot.MINIMUM_VALUE,s.semiMajorAxis),s.semiMinorAxis=t.semiMinorAxis.getValue(ot.MINIMUM_VALUE,s.semiMinorAxis),s.rotation=j.getValueOrUndefined(t.rotation,ot.MINIMUM_VALUE),s.granularity=j.getValueOrUndefined(t.granularity,ot.MINIMUM_VALUE),s.stRotation=j.getValueOrUndefined(t.stRotation,ot.MINIMUM_VALUE),s.numberOfVerticalLines=j.getValueOrUndefined(t.numberOfVerticalLines,ot.MINIMUM_VALUE),s.offsetAttribute=ri.computeGeometryOffsetAttribute(n,i,o,r),s.height=ri.getGeometryHeight(n,i),o=ri.getGeometryExtrudedHeight(o,r),o===ri.CLAMP_TO_GROUND&&(o=Pi.getMinimumMaximumHeights(ud.computeRectangle(s,k1e)).minimumTerrainHeight),s.extrudedHeight=o};If.DynamicGeometryUpdater=OV;function OV(e,t,n){Li.call(this,e,t,n)}l(Object.create)&&(OV.prototype=Object.create(Li.prototype),OV.prototype.constructor=OV);OV.prototype._isHidden=function(e,t,n){let i=this._options;return!l(i.center)||!l(i.semiMajorAxis)||!l(i.semiMinorAxis)||Li.prototype._isHidden.call(this,e,t,n)};OV.prototype._setOptions=function(e,t,n){let i=this._options,o=j.getValueOrUndefined(t.height,n),r=j.getValueOrDefault(t.heightReference,n,He.NONE),s=j.getValueOrUndefined(t.extrudedHeight,n),a=j.getValueOrDefault(t.extrudedHeightReference,n,He.NONE);l(s)&&!l(o)&&(o=0),i.center=j.getValueOrUndefined(e.position,n,i.center),i.semiMajorAxis=j.getValueOrUndefined(t.semiMajorAxis,n),i.semiMinorAxis=j.getValueOrUndefined(t.semiMinorAxis,n),i.rotation=j.getValueOrUndefined(t.rotation,n),i.granularity=j.getValueOrUndefined(t.granularity,n),i.stRotation=j.getValueOrUndefined(t.stRotation,n),i.numberOfVerticalLines=j.getValueOrUndefined(t.numberOfVerticalLines,n),i.offsetAttribute=ri.computeGeometryOffsetAttribute(o,r,s,a),i.height=ri.getGeometryHeight(o,r),s=ri.getGeometryExtrudedHeight(s,a),s===ri.CLAMP_TO_GROUND&&(s=Pi.getMinimumMaximumHeights(ud.computeRectangle(i,k1e)).minimumTerrainHeight),i.extrudedHeight=s};var MY=If;var zMi=x(T(),1);var xMi=x(T(),1);var Mgt=new h,wgt=new h,kgt=new h,Ugt=new h,Dgt=new h,Ogt=new h(1,1,1),U1e=Math.cos,D1e=Math.sin;function Fg(e){e=e??B.EMPTY_OBJECT;let t=e.radii??Ogt,n=e.innerRadii??t,i=e.minimumClock??0,o=e.maximumClock??W.TWO_PI,r=e.minimumCone??0,s=e.maximumCone??W.PI,a=Math.round(e.stackPartitions??64),c=Math.round(e.slicePartitions??64),d=e.vertexFormat??Me.DEFAULT;this._radii=h.clone(t),this._innerRadii=h.clone(n),this._minimumClock=i,this._maximumClock=o,this._minimumCone=r,this._maximumCone=s,this._stackPartitions=a,this._slicePartitions=c,this._vertexFormat=Me.clone(d),this._offsetAttribute=e.offsetAttribute,this._workerName="createEllipsoidGeometry"}Fg.packedLength=2*h.packedLength+Me.packedLength+7;Fg.pack=function(e,t,n){return n=n??0,h.pack(e._radii,t,n),n+=h.packedLength,h.pack(e._innerRadii,t,n),n+=h.packedLength,Me.pack(e._vertexFormat,t,n),n+=Me.packedLength,t[n++]=e._minimumClock,t[n++]=e._maximumClock,t[n++]=e._minimumCone,t[n++]=e._maximumCone,t[n++]=e._stackPartitions,t[n++]=e._slicePartitions,t[n]=e._offsetAttribute??-1,t};var O1e=new h,B1e=new h,z1e=new Me,jx={radii:O1e,innerRadii:B1e,vertexFormat:z1e,minimumClock:void 0,maximumClock:void 0,minimumCone:void 0,maximumCone:void 0,stackPartitions:void 0,slicePartitions:void 0,offsetAttribute:void 0};Fg.unpack=function(e,t,n){t=t??0;let i=h.unpack(e,t,O1e);t+=h.packedLength;let o=h.unpack(e,t,B1e);t+=h.packedLength;let r=Me.unpack(e,t,z1e);t+=Me.packedLength;let s=e[t++],a=e[t++],c=e[t++],d=e[t++],u=e[t++],m=e[t++],p=e[t];return l(n)?(n._radii=h.clone(i,n._radii),n._innerRadii=h.clone(o,n._innerRadii),n._vertexFormat=Me.clone(r,n._vertexFormat),n._minimumClock=s,n._maximumClock=a,n._minimumCone=c,n._maximumCone=d,n._stackPartitions=u,n._slicePartitions=m,n._offsetAttribute=p===-1?void 0:p,n):(jx.minimumClock=s,jx.maximumClock=a,jx.minimumCone=c,jx.maximumCone=d,jx.stackPartitions=u,jx.slicePartitions=m,jx.offsetAttribute=p===-1?void 0:p,new Fg(jx))};Fg.createGeometry=function(e){let t=e._radii;if(t.x<=0||t.y<=0||t.z<=0)return;let n=e._innerRadii;if(n.x<=0||n.y<=0||n.z<=0)return;let i=e._minimumClock,o=e._maximumClock,r=e._minimumCone,s=e._maximumCone,a=e._vertexFormat,c=e._slicePartitions+1,d=e._stackPartitions+1;c=Math.round(c*Math.abs(o-i)/W.TWO_PI),d=Math.round(d*Math.abs(s-r)/W.PI),c<2&&(c=2),d<2&&(d=2);let u,m,p=0,b=[r],f=[i];for(u=0;u<d;u++)b.push(r+u*(s-r)/(d-1));for(b.push(s),m=0;m<c;m++)f.push(i+m*(o-i)/(c-1));f.push(o);let y=b.length,_=f.length,S=0,Z=1,R=n.x!==t.x||n.y!==t.y||n.z!==t.z,C=!1,E=!1,A=!1;R&&(Z=2,r>0&&(C=!0,S+=c-1),s<Math.PI&&(E=!0,S+=c-1),(o-i)%W.TWO_PI?(A=!0,S+=(d-1)*2+1):S+=1);let L=_*y*Z,F=new Float64Array(L*3),I=new Array(L).fill(!1),N=new Array(L).fill(!1),g=c*d*Z,V=6*(g+S+1-(c+d)*Z),G=Oe.createTypedArray(g,V),v=a.normal?new Float32Array(L*3):void 0,X=a.tangent?new Float32Array(L*3):void 0,Y=a.bitangent?new Float32Array(L*3):void 0,D=a.st?new Float32Array(L*2):void 0,M=new Array(y),O=new Array(y);for(u=0;u<y;u++)M[u]=D1e(b[u]),O[u]=U1e(b[u]);let w=new Array(_),z=new Array(_);for(m=0;m<_;m++)z[m]=U1e(f[m]),w[m]=D1e(f[m]);for(u=0;u<y;u++)for(m=0;m<_;m++)F[p++]=t.x*M[u]*z[m],F[p++]=t.y*M[u]*w[m],F[p++]=t.z*O[u];let K=L/2;if(R)for(u=0;u<y;u++)for(m=0;m<_;m++)F[p++]=n.x*M[u]*z[m],F[p++]=n.y*M[u]*w[m],F[p++]=n.z*O[u],I[K]=!0,u>0&&u!==y-1&&m!==0&&m!==_-1&&(N[K]=!0),K++;p=0;let te,H;for(u=1;u<y-2;u++)for(te=u*_,H=(u+1)*_,m=1;m<_-2;m++)G[p++]=H+m,G[p++]=H+m+1,G[p++]=te+m+1,G[p++]=H+m,G[p++]=te+m+1,G[p++]=te+m;if(R){let Be=y*_;for(u=1;u<y-2;u++)for(te=Be+u*_,H=Be+(u+1)*_,m=1;m<_-2;m++)G[p++]=H+m,G[p++]=te+m,G[p++]=te+m+1,G[p++]=H+m,G[p++]=te+m+1,G[p++]=H+m+1}let $,ee;if(R){if(C)for(ee=y*_,u=1;u<_-2;u++)G[p++]=u,G[p++]=u+1,G[p++]=ee+u+1,G[p++]=u,G[p++]=ee+u+1,G[p++]=ee+u;if(E)for($=y*_-_,ee=y*_*Z-_,u=1;u<_-2;u++)G[p++]=$+u+1,G[p++]=$+u,G[p++]=ee+u,G[p++]=$+u+1,G[p++]=ee+u,G[p++]=ee+u+1}if(A){for(u=1;u<y-2;u++)ee=_*y+_*u,$=_*u,G[p++]=ee,G[p++]=$+_,G[p++]=$,G[p++]=ee,G[p++]=ee+_,G[p++]=$+_;for(u=1;u<y-2;u++)ee=_*y+_*(u+1)-1,$=_*(u+1)-1,G[p++]=$+_,G[p++]=ee,G[p++]=$,G[p++]=$+_,G[p++]=ee+_,G[p++]=ee}let le=new Rn;a.position&&(le.position=new Xe({componentDatatype:J.DOUBLE,componentsPerAttribute:3,values:F}));let _e=0,he=0,Ze=0,ye=0,Ge=L/2,Ae,Fe=ne.fromCartesian3(t),tt=ne.fromCartesian3(n);if(a.st||a.normal||a.tangent||a.bitangent){for(u=0;u<L;u++){Ae=I[u]?tt:Fe;let Be=h.fromArray(F,u*3,Mgt),je=Ae.geodeticSurfaceNormal(Be,wgt);if(N[u]&&h.negate(je,je),a.st){let qe=k.negate(je,Dgt);D[_e++]=Math.atan2(qe.y,qe.x)/W.TWO_PI+.5,D[_e++]=Math.asin(je.z)/Math.PI+.5}if(a.normal&&(v[he++]=je.x,v[he++]=je.y,v[he++]=je.z),a.tangent||a.bitangent){let qe=kgt,We=0,Ke;if(I[u]&&(We=Ge),!C&&u>=We&&u<We+_*2?Ke=h.UNIT_X:Ke=h.UNIT_Z,h.cross(Ke,je,qe),h.normalize(qe,qe),a.tangent&&(X[Ze++]=qe.x,X[Ze++]=qe.y,X[Ze++]=qe.z),a.bitangent){let ct=h.cross(je,qe,Ugt);h.normalize(ct,ct),Y[ye++]=ct.x,Y[ye++]=ct.y,Y[ye++]=ct.z}}}a.st&&(le.st=new Xe({componentDatatype:J.FLOAT,componentsPerAttribute:2,values:D})),a.normal&&(le.normal=new Xe({componentDatatype:J.FLOAT,componentsPerAttribute:3,values:v})),a.tangent&&(le.tangent=new Xe({componentDatatype:J.FLOAT,componentsPerAttribute:3,values:X})),a.bitangent&&(le.bitangent=new Xe({componentDatatype:J.FLOAT,componentsPerAttribute:3,values:Y}))}if(l(e._offsetAttribute)){let Be=F.length,je=e._offsetAttribute===bn.NONE?0:1,qe=new Uint8Array(Be/3).fill(je);le.applyOffset=new Xe({componentDatatype:J.UNSIGNED_BYTE,componentsPerAttribute:1,values:qe})}return new At({attributes:le,indices:G,primitiveType:Ie.TRIANGLES,boundingSphere:me.fromEllipsoid(Fe),offsetAttribute:e._offsetAttribute})};var vee;Fg.getUnitEllipsoid=function(){return l(vee)||(vee=Fg.createGeometry(new Fg({radii:new h(1,1,1),vertexFormat:Me.POSITION_ONLY}))),vee};var Ha=Fg;var Bgt=new Qt(U.WHITE),Fee=h.ZERO,Iee=new h,zgt=new h,Hgt=new h,Pee=new U,Kgt=new h(1,1,1);function Jgt(e){this.id=e,this.vertexFormat=void 0,this.radii=void 0,this.innerRadii=void 0,this.minimumClock=void 0,this.maximumClock=void 0,this.minimumCone=void 0,this.maximumCone=void 0,this.stackPartitions=void 0,this.slicePartitions=void 0,this.subdivisions=void 0,this.offsetAttribute=void 0}function Qu(e,t){Wi.call(this,{entity:e,scene:t,geometryOptions:new Jgt(e),geometryPropertyName:"ellipsoid",observedPropertyNames:["availability","position","orientation","ellipsoid"]}),this._onEntityPropertyChanged(e,"ellipsoid",e.ellipsoid,void 0)}l(Object.create)&&(Qu.prototype=Object.create(Wi.prototype),Qu.prototype.constructor=Qu);Object.defineProperties(Qu.prototype,{terrainOffsetProperty:{get:function(){return this._terrainOffsetProperty}}});Qu.prototype.createFillGeometryInstance=function(e,t,n){let i=this._entity,o=i.isAvailable(e),r,s=new Wn(o&&i.isShowing&&this._showProperty.getValue(e)&&this._fillProperty.getValue(e)),a=this._distanceDisplayConditionProperty.getValue(e),c=ti.fromDistanceDisplayCondition(a),d={show:s,distanceDisplayCondition:c,color:void 0,offset:void 0};if(this._materialProperty instanceof Qt){let u;l(this._materialProperty.color)&&(this._materialProperty.color.isConstant||o)&&(u=this._materialProperty.color.getValue(e,Pee)),l(u)||(u=U.WHITE),r=$t.fromColor(u),d.color=r}return l(this._options.offsetAttribute)&&(d.offset=Ro.fromCartesian3(j.getValueOrDefault(this._terrainOffsetProperty,e,Fee,Iee))),new Yt({id:i,geometry:new Ha(this._options),modelMatrix:t?void 0:i.computeModelMatrixForHeightReference(e,i.ellipsoid.heightReference,this._options.radii.z*.5,this._scene.ellipsoid,n),attributes:d})};Qu.prototype.createOutlineGeometryInstance=function(e,t,n){let i=this._entity,o=i.isAvailable(e),r=j.getValueOrDefault(this._outlineColorProperty,e,U.BLACK,Pee),s=this._distanceDisplayConditionProperty.getValue(e),a={show:new Wn(o&&i.isShowing&&this._showProperty.getValue(e)&&this._showOutlineProperty.getValue(e)),color:$t.fromColor(r),distanceDisplayCondition:ti.fromDistanceDisplayCondition(s),offset:void 0};return l(this._options.offsetAttribute)&&(a.offset=Ro.fromCartesian3(j.getValueOrDefault(this._terrainOffsetProperty,e,Fee,Iee))),new Yt({id:i,geometry:new Du(this._options),modelMatrix:t?void 0:i.computeModelMatrixForHeightReference(e,i.ellipsoid.heightReference,this._options.radii.z*.5,this._scene.ellipsoid,n),attributes:a})};Qu.prototype._computeCenter=function(e,t){return j.getValueOrUndefined(this._entity.position,e,t)};Qu.prototype._isHidden=function(e,t){return!l(e.position)||!l(t.radii)||Wi.prototype._isHidden.call(this,e,t)};Qu.prototype._isDynamic=function(e,t){return!e.position.isConstant||!j.isConstant(e.orientation)||!t.radii.isConstant||!j.isConstant(t.innerRadii)||!j.isConstant(t.stackPartitions)||!j.isConstant(t.slicePartitions)||!j.isConstant(t.outlineWidth)||!j.isConstant(t.minimumClock)||!j.isConstant(t.maximumClock)||!j.isConstant(t.minimumCone)||!j.isConstant(t.maximumCone)||!j.isConstant(t.subdivisions)};Qu.prototype._setStaticOptions=function(e,t){let n=j.getValueOrDefault(t.heightReference,ot.MINIMUM_VALUE,He.NONE),i=this._options;i.vertexFormat=this._materialProperty instanceof Qt?Tn.VERTEX_FORMAT:Co.MaterialSupport.TEXTURED.vertexFormat,i.radii=t.radii.getValue(ot.MINIMUM_VALUE,i.radii),i.innerRadii=j.getValueOrUndefined(t.innerRadii,i.radii),i.minimumClock=j.getValueOrUndefined(t.minimumClock,ot.MINIMUM_VALUE),i.maximumClock=j.getValueOrUndefined(t.maximumClock,ot.MINIMUM_VALUE),i.minimumCone=j.getValueOrUndefined(t.minimumCone,ot.MINIMUM_VALUE),i.maximumCone=j.getValueOrUndefined(t.maximumCone,ot.MINIMUM_VALUE),i.stackPartitions=j.getValueOrUndefined(t.stackPartitions,ot.MINIMUM_VALUE),i.slicePartitions=j.getValueOrUndefined(t.slicePartitions,ot.MINIMUM_VALUE),i.subdivisions=j.getValueOrUndefined(t.subdivisions,ot.MINIMUM_VALUE),i.offsetAttribute=n!==He.NONE?bn.ALL:void 0};Qu.prototype._onEntityPropertyChanged=Cb;Qu.DynamicGeometryUpdater=wY;function wY(e,t,n){Li.call(this,e,t,n),this._scene=e._scene,this._modelMatrix=new P,this._attributes=void 0,this._outlineAttributes=void 0,this._lastSceneMode=void 0,this._lastShow=void 0,this._lastOutlineShow=void 0,this._lastOutlineWidth=void 0,this._lastOutlineColor=void 0,this._lastOffset=new h,this._material={}}l(Object.create)&&(wY.prototype=Object.create(Li.prototype),wY.prototype.constructor=wY);wY.prototype.update=function(e){let t=this._entity,n=t.ellipsoid;if(!t.isShowing||!t.isAvailable(e)||!j.getValueOrDefault(n.show,e,!0)){l(this._primitive)&&(this._primitive.show=!1),l(this._outlinePrimitive)&&(this._outlinePrimitive.show=!1);return}let i=j.getValueOrUndefined(n.radii,e,zgt),o=l(i)?t.computeModelMatrixForHeightReference(e,n.heightReference,i.z*.5,this._scene.ellipsoid,this._modelMatrix):void 0;if(!l(o)||!l(i)){l(this._primitive)&&(this._primitive.show=!1),l(this._outlinePrimitive)&&(this._outlinePrimitive.show=!1);return}let r=j.getValueOrDefault(n.fill,e,!0),s=j.getValueOrDefault(n.outline,e,!1),a=j.getValueOrClonedDefault(n.outlineColor,e,U.BLACK,Pee),c=yr.getValue(e,n.material??Bgt,this._material),d=j.getValueOrUndefined(n.innerRadii,e,Hgt),u=j.getValueOrUndefined(n.minimumClock,e),m=j.getValueOrUndefined(n.maximumClock,e),p=j.getValueOrUndefined(n.minimumCone,e),b=j.getValueOrUndefined(n.maximumCone,e),f=j.getValueOrUndefined(n.stackPartitions,e),y=j.getValueOrUndefined(n.slicePartitions,e),_=j.getValueOrUndefined(n.subdivisions,e),S=j.getValueOrDefault(n.outlineWidth,e,1),Z=j.getValueOrDefault(n.heightReference,e,He.NONE),R=Z!==He.NONE?bn.ALL:void 0,C=this._scene.mode,E=C===se.SCENE3D&&Z===He.NONE,A=this._options,L=this._geometryUpdater.shadowsProperty.getValue(e),I=this._geometryUpdater.distanceDisplayConditionProperty.getValue(e),N=j.getValueOrDefault(this._geometryUpdater.terrainOffsetProperty,e,Fee,Iee);if(!E||this._lastSceneMode!==C||!l(this._primitive)||A.stackPartitions!==f||A.slicePartitions!==y||l(d)&&!h.equals(A.innerRadii!==d)||A.minimumClock!==u||A.maximumClock!==m||A.minimumCone!==p||A.maximumCone!==b||A.subdivisions!==_||this._lastOutlineWidth!==S||A.offsetAttribute!==R){let V=this._primitives;V.removeAndDestroy(this._primitive),V.removeAndDestroy(this._outlinePrimitive),this._primitive=void 0,this._outlinePrimitive=void 0,this._lastSceneMode=C,this._lastOutlineWidth=S,A.stackPartitions=f,A.slicePartitions=y,A.subdivisions=_,A.offsetAttribute=R,A.radii=h.clone(E?Kgt:i,A.radii),l(d)?E?A.innerRadii=h.fromElements(d.x/i.x,d.y/i.y,d.z/i.z,A.innerRadii):A.innerRadii=h.clone(d,A.innerRadii):A.innerRadii=void 0,A.minimumClock=u,A.maximumClock=m,A.minimumCone=p,A.maximumCone=b;let G=new Co({material:c,translucent:c.isTranslucent(),closed:!0});A.vertexFormat=G.vertexFormat;let v=this._geometryUpdater.createFillGeometryInstance(e,E,this._modelMatrix);this._primitive=V.add(new In({geometryInstances:v,appearance:G,asynchronous:!1,shadows:L}));let X=this._geometryUpdater.createOutlineGeometryInstance(e,E,this._modelMatrix);this._outlinePrimitive=V.add(new In({geometryInstances:X,appearance:new Tn({flat:!0,translucent:X.attributes.color.value[3]!==255,renderState:{lineWidth:this._geometryUpdater._scene.clampLineWidth(S)}}),asynchronous:!1,shadows:L})),this._lastShow=r,this._lastOutlineShow=s,this._lastOutlineColor=U.clone(a,this._lastOutlineColor),this._lastDistanceDisplayCondition=I,this._lastOffset=h.clone(N,this._lastOffset)}else if(this._primitive.ready){let V=this._primitive,G=this._outlinePrimitive;V.show=!0,G.show=!0,V.appearance.material=c;let v=this._attributes;l(v)||(v=V.getGeometryInstanceAttributes(t),this._attributes=v),r!==this._lastShow&&(v.show=Wn.toValue(r,v.show),this._lastShow=r);let X=this._outlineAttributes;l(X)||(X=G.getGeometryInstanceAttributes(t),this._outlineAttributes=X),s!==this._lastOutlineShow&&(X.show=Wn.toValue(s,X.show),this._lastOutlineShow=s),U.equals(a,this._lastOutlineColor)||(X.color=$t.toValue(a,X.color),U.clone(a,this._lastOutlineColor)),Bt.equals(I,this._lastDistanceDisplayCondition)||(v.distanceDisplayCondition=ti.toValue(I,v.distanceDisplayCondition),X.distanceDisplayCondition=ti.toValue(I,X.distanceDisplayCondition),Bt.clone(I,this._lastDistanceDisplayCondition)),h.equals(N,this._lastOffset)||(v.offset=Ro.toValue(N,v.offset),X.offset=Ro.toValue(N,v.offset),h.clone(N,this._lastOffset))}E&&(i.x=Math.max(i.x,.001),i.y=Math.max(i.y,.001),i.z=Math.max(i.z,.001),o=P.multiplyByScale(o,i,o),this._primitive.modelMatrix=o,this._outlinePrimitive.modelMatrix=o)};var kY=Qu;var Pwi=x(T(),1);var owi=x(T(),1);function BV(e){e=e??B.EMPTY_OBJECT;let t=e.vertexFormat??Me.DEFAULT;this._vertexFormat=t,this._workerName="createPlaneGeometry"}BV.packedLength=Me.packedLength;BV.pack=function(e,t,n){return n=n??0,Me.pack(e._vertexFormat,t,n),t};var H1e=new Me,jgt={vertexFormat:H1e};BV.unpack=function(e,t,n){t=t??0;let i=Me.unpack(e,t,H1e);return l(n)?(n._vertexFormat=Me.clone(i,n._vertexFormat),n):new BV(jgt)};var C3=new h(-.5,-.5,0),V3=new h(.5,.5,0);BV.createGeometry=function(e){let t=e._vertexFormat,n=new Rn,i,o;if(t.position){if(o=new Float64Array(12),o[0]=C3.x,o[1]=C3.y,o[2]=0,o[3]=V3.x,o[4]=C3.y,o[5]=0,o[6]=V3.x,o[7]=V3.y,o[8]=0,o[9]=C3.x,o[10]=V3.y,o[11]=0,n.position=new Xe({componentDatatype:J.DOUBLE,componentsPerAttribute:3,values:o}),t.normal){let r=new Float32Array(12);r[0]=0,r[1]=0,r[2]=1,r[3]=0,r[4]=0,r[5]=1,r[6]=0,r[7]=0,r[8]=1,r[9]=0,r[10]=0,r[11]=1,n.normal=new Xe({componentDatatype:J.FLOAT,componentsPerAttribute:3,values:r})}if(t.st){let r=new Float32Array(8);r[0]=0,r[1]=0,r[2]=1,r[3]=0,r[4]=1,r[5]=1,r[6]=0,r[7]=1,n.st=new Xe({componentDatatype:J.FLOAT,componentsPerAttribute:2,values:r})}if(t.tangent){let r=new Float32Array(12);r[0]=1,r[1]=0,r[2]=0,r[3]=1,r[4]=0,r[5]=0,r[6]=1,r[7]=0,r[8]=0,r[9]=1,r[10]=0,r[11]=0,n.tangent=new Xe({componentDatatype:J.FLOAT,componentsPerAttribute:3,values:r})}if(t.bitangent){let r=new Float32Array(12);r[0]=0,r[1]=1,r[2]=0,r[3]=0,r[4]=1,r[5]=0,r[6]=0,r[7]=1,r[8]=0,r[9]=0,r[10]=1,r[11]=0,n.bitangent=new Xe({componentDatatype:J.FLOAT,componentsPerAttribute:3,values:r})}i=new Uint16Array(6),i[0]=0,i[1]=1,i[2]=2,i[3]=0,i[4]=2,i[5]=3}return new At({attributes:n,indices:i,primitiveType:Ie.TRIANGLES,boundingSphere:new me(h.ZERO,Math.sqrt(2))})};var UY=BV;var fwi=x(T(),1);function zV(){this._workerName="createPlaneOutlineGeometry"}zV.packedLength=0;zV.pack=function(e,t){return t};zV.unpack=function(e,t,n){return l(n)?n:new zV};var Qx=new h(-.5,-.5,0),E3=new h(.5,.5,0);zV.createGeometry=function(){let e=new Rn,t=new Uint16Array(8),n=new Float64Array(12);return n[0]=Qx.x,n[1]=Qx.y,n[2]=Qx.z,n[3]=E3.x,n[4]=Qx.y,n[5]=Qx.z,n[6]=E3.x,n[7]=E3.y,n[8]=Qx.z,n[9]=Qx.x,n[10]=E3.y,n[11]=Qx.z,e.position=new Xe({componentDatatype:J.DOUBLE,componentsPerAttribute:3,values:n}),t[0]=0,t[1]=1,t[2]=1,t[3]=2,t[4]=2,t[5]=3,t[6]=3,t[7]=0,new At({attributes:e,indices:t,primitiveType:Ie.LINES,boundingSphere:new me(h.ZERO,Math.sqrt(2))})};var DY=zV;var Qgt=new h,K1e=new U;function qgt(e){this.id=e,this.vertexFormat=void 0,this.plane=void 0,this.dimensions=void 0}function ch(e,t){Wi.call(this,{entity:e,scene:t,geometryOptions:new qgt(e),geometryPropertyName:"plane",observedPropertyNames:["availability","position","orientation","plane"]}),this._onEntityPropertyChanged(e,"plane",e.plane,void 0)}l(Object.create)&&(ch.prototype=Object.create(Wi.prototype),ch.prototype.constructor=ch);ch.prototype.createFillGeometryInstance=function(e){let t=this._entity,n=t.isAvailable(e),i,o,r=new Wn(n&&t.isShowing&&this._showProperty.getValue(e)&&this._fillProperty.getValue(e)),s=this._distanceDisplayConditionProperty.getValue(e),a=ti.fromDistanceDisplayCondition(s);if(this._materialProperty instanceof Qt){let b;l(this._materialProperty.color)&&(this._materialProperty.color.isConstant||n)&&(b=this._materialProperty.color.getValue(e,K1e)),l(b)||(b=U.WHITE),o=$t.fromColor(b),i={show:r,distanceDisplayCondition:a,color:o}}else i={show:r,distanceDisplayCondition:a};let c=t.plane,d=this._options,u=t.computeModelMatrix(e),m=j.getValueOrDefault(c.plane,e,d.plane),p=j.getValueOrUndefined(c.dimensions,e,d.dimensions);return d.plane=m,d.dimensions=p,u=Xee(m,p,u,u),new Yt({id:t,geometry:new UY(this._options),modelMatrix:u,attributes:i})};ch.prototype.createOutlineGeometryInstance=function(e){let t=this._entity,n=t.isAvailable(e),i=j.getValueOrDefault(this._outlineColorProperty,e,U.BLACK,K1e),o=this._distanceDisplayConditionProperty.getValue(e),r=t.plane,s=this._options,a=t.computeModelMatrix(e),c=j.getValueOrDefault(r.plane,e,s.plane),d=j.getValueOrUndefined(r.dimensions,e,s.dimensions);return s.plane=c,s.dimensions=d,a=Xee(c,d,a,a),new Yt({id:t,geometry:new DY,modelMatrix:a,attributes:{show:new Wn(n&&t.isShowing&&this._showProperty.getValue(e)&&this._showOutlineProperty.getValue(e)),color:$t.fromColor(i),distanceDisplayCondition:ti.fromDistanceDisplayCondition(o)}})};ch.prototype._isHidden=function(e,t){return!l(t.plane)||!l(t.dimensions)||!l(e.position)||Wi.prototype._isHidden.call(this,e,t)};ch.prototype._getIsClosed=function(e){return!1};ch.prototype._isDynamic=function(e,t){return!e.position.isConstant||!j.isConstant(e.orientation)||!t.plane.isConstant||!t.dimensions.isConstant||!j.isConstant(t.outlineWidth)};ch.prototype._setStaticOptions=function(e,t){let n=this._materialProperty instanceof Qt,i=this._options;i.vertexFormat=n?Tn.VERTEX_FORMAT:Co.MaterialSupport.TEXTURED.vertexFormat,i.plane=t.plane.getValue(ot.MINIMUM_VALUE,i.plane),i.dimensions=t.dimensions.getValue(ot.MINIMUM_VALUE,i.dimensions)};ch.DynamicGeometryUpdater=HV;function HV(e,t,n){Li.call(this,e,t,n)}l(Object.create)&&(HV.prototype=Object.create(Li.prototype),HV.prototype.constructor=HV);HV.prototype._isHidden=function(e,t,n){let i=this._options,o=j.getValueOrUndefined(e.position,n,Qgt);return!l(o)||!l(i.plane)||!l(i.dimensions)||Li.prototype._isHidden.call(this,e,t,n)};HV.prototype._setOptions=function(e,t,n){let i=this._options;i.plane=j.getValueOrDefault(t.plane,n,i.plane),i.dimensions=j.getValueOrUndefined(t.dimensions,n,i.dimensions)};var $gt=new h,eyt=new h,tyt=new h,nyt=new h,iyt=new q,oyt=new q,ryt=new P;function Xee(e,t,n,i){let o=e.normal,r=e.distance,s=h.multiplyByScalar(o,-r,tyt),a=h.clone(h.UNIT_Z,eyt);W.equalsEpsilon(Math.abs(h.dot(a,o)),1,W.EPSILON8)&&(a=h.clone(h.UNIT_Y,a));let c=h.cross(a,o,$gt);a=h.cross(o,c,a),h.normalize(c,c),h.normalize(a,a);let d=iyt;q.setColumn(d,0,c,d),q.setColumn(d,1,a,d),q.setColumn(d,2,o,d);let u=h.fromElements(t.x,t.y,1,nyt),m=q.multiplyByScale(d,u,oyt),p=P.fromRotationTranslation(m,s,ryt);return P.multiplyTransformation(n,p,i)}ch.createPrimitiveMatrix=Xee;var OY=ch;var iki=x(T(),1);var s9i=x(T(),1);var syt=new h,ayt=new nt,cyt=new k,lyt=new k,dyt=new h,uyt=new h,myt=new h,BY=new h,hyt=new h,fyt=new h,J1e=new Ne,pyt=new q,byt=new q,gyt=new h;function yyt(e,t,n,i,o,r,s,a,c){let d=e.positions,u=hi.triangulate(e.positions2D,e.holes);u.length<3&&(u=[0,1,2]);let m=Oe.createTypedArray(d.length,u.length);m.set(u);let p=pyt;if(i!==0){let g=Ne.fromAxisAngle(s,i,J1e);if(p=q.fromQuaternion(g,p),t.tangent||t.bitangent){g=Ne.fromAxisAngle(s,-i,J1e);let V=q.fromQuaternion(g,byt);a=h.normalize(q.multiplyByVector(V,a,a),a),t.bitangent&&(c=h.normalize(h.cross(s,a,c),c))}}else p=q.clone(q.IDENTITY,p);let b=lyt;t.st&&(b.x=n.x,b.y=n.y);let f=d.length,y=f*3,_=new Float64Array(y),S=t.normal?new Float32Array(y):void 0,Z=t.tangent?new Float32Array(y):void 0,R=t.bitangent?new Float32Array(y):void 0,C=t.st?new Float32Array(f*2):void 0,E=0,A=0,L=0,F=0,I=0;for(let g=0;g<f;g++){let V=d[g];if(_[E++]=V.x,_[E++]=V.y,_[E++]=V.z,t.st)if(l(o)&&o.positions.length===f)C[I++]=o.positions[g].x,C[I++]=o.positions[g].y;else{let G=q.multiplyByVector(p,V,syt),v=r(G,cyt);k.subtract(v,b,v);let X=W.clamp(v.x/n.width,0,1),Y=W.clamp(v.y/n.height,0,1);C[I++]=X,C[I++]=Y}t.normal&&(S[A++]=s.x,S[A++]=s.y,S[A++]=s.z),t.tangent&&(Z[F++]=a.x,Z[F++]=a.y,Z[F++]=a.z),t.bitangent&&(R[L++]=c.x,R[L++]=c.y,R[L++]=c.z)}let N=new Rn;return t.position&&(N.position=new Xe({componentDatatype:J.DOUBLE,componentsPerAttribute:3,values:_})),t.normal&&(N.normal=new Xe({componentDatatype:J.FLOAT,componentsPerAttribute:3,values:S})),t.tangent&&(N.tangent=new Xe({componentDatatype:J.FLOAT,componentsPerAttribute:3,values:Z})),t.bitangent&&(N.bitangent=new Xe({componentDatatype:J.FLOAT,componentsPerAttribute:3,values:R})),t.st&&(N.st=new Xe({componentDatatype:J.FLOAT,componentsPerAttribute:2,values:C})),new At({attributes:N,indices:m,primitiveType:Ie.TRIANGLES})}function aZ(e){e=e??B.EMPTY_OBJECT;let t=e.polygonHierarchy,n=e.textureCoordinates,i=e.vertexFormat??Me.DEFAULT;this._vertexFormat=Me.clone(i),this._polygonHierarchy=t,this._stRotation=e.stRotation??0,this._ellipsoid=ne.clone(e.ellipsoid??ne.default),this._workerName="createCoplanarPolygonGeometry",this._textureCoordinates=n,this.packedLength=oi.computeHierarchyPackedLength(t,h)+Me.packedLength+ne.packedLength+(l(n)?oi.computeHierarchyPackedLength(n,k):1)+2}aZ.fromPositions=function(e){e=e??B.EMPTY_OBJECT;let t={polygonHierarchy:{positions:e.positions},vertexFormat:e.vertexFormat,stRotation:e.stRotation,ellipsoid:e.ellipsoid,textureCoordinates:e.textureCoordinates};return new aZ(t)};aZ.pack=function(e,t,n){return n=n??0,n=oi.packPolygonHierarchy(e._polygonHierarchy,t,n,h),ne.pack(e._ellipsoid,t,n),n+=ne.packedLength,Me.pack(e._vertexFormat,t,n),n+=Me.packedLength,t[n++]=e._stRotation,l(e._textureCoordinates)?n=oi.packPolygonHierarchy(e._textureCoordinates,t,n,k):t[n++]=-1,t[n]=e.packedLength,t};var xyt=ne.clone(ne.UNIT_SPHERE),Tyt=new Me,_yt={polygonHierarchy:{}};aZ.unpack=function(e,t,n){t=t??0;let i=oi.unpackPolygonHierarchy(e,t,h);t=i.startingIndex,delete i.startingIndex;let o=ne.unpack(e,t,xyt);t+=ne.packedLength;let r=Me.unpack(e,t,Tyt);t+=Me.packedLength;let s=e[t++],a=e[t]===-1?void 0:oi.unpackPolygonHierarchy(e,t,k);l(a)?(t=a.startingIndex,delete a.startingIndex):t++;let c=e[t];return l(n)||(n=new aZ(_yt)),n._polygonHierarchy=i,n._ellipsoid=ne.clone(o,n._ellipsoid),n._vertexFormat=Me.clone(r,n._vertexFormat),n._stRotation=s,n._textureCoordinates=a,n.packedLength=c,n};aZ.createGeometry=function(e){let t=e._vertexFormat,n=e._polygonHierarchy,i=e._stRotation,o=e._textureCoordinates,r=l(o),s=n.positions;if(s=Yo(s,h.equalsEpsilon,!0),s.length<3)return;let a=dyt,c=uyt,d=myt,u=hyt,m=fyt;if(!mg.computeProjectTo2DArguments(s,BY,u,m))return;if(a=h.cross(u,m,a),a=h.normalize(a,a),!h.equalsEpsilon(BY,h.ZERO,W.EPSILON6)){let I=e._ellipsoid.geodeticSurfaceNormal(BY,gyt);h.dot(a,I)<0&&(a=h.negate(a,a),u=h.negate(u,u))}let b=mg.createProjectPointsTo2DFunction(BY,u,m),f=mg.createProjectPointTo2DFunction(BY,u,m);t.tangent&&(c=h.clone(u,c)),t.bitangent&&(d=h.clone(m,d));let y=oi.polygonsFromHierarchy(n,r,b,!1),_=y.hierarchy,S=y.polygons,Z=function(I){return I},R=r?oi.polygonsFromHierarchy(o,!0,Z,!1).polygons:void 0;if(_.length===0)return;s=_[0].outerRing;let C=me.fromPoints(s),E=oi.computeBoundingRectangle(a,f,s,i,ayt),A=[];for(let I=0;I<S.length;I++){let N=new Yt({geometry:yyt(S[I],t,E,i,r?R[I]:void 0,f,a,c,d)});A.push(N)}let L=Bn.combineInstances(A)[0];L.attributes.position.values=new Float64Array(L.attributes.position.values),L.indices=Oe.createTypedArray(L.attributes.position.values.length/3,L.indices);let F=L.attributes;return t.position||delete F.position,new At({attributes:F,indices:L.indices,primitiveType:L.primitiveType,boundingSphere:C})};var zY=aZ;var A9i=x(T(),1);var j1e=[],A3=[];function Syt(e,t,n,i,o){let s=Ms.fromPoints(t,e).projectPointsOntoPlane(t,j1e);hi.computeWindingOrder2D(s)===Qs.CLOCKWISE&&(s.reverse(),t=t.slice().reverse());let c,d,u=t.length,m=0;if(i)for(c=new Float64Array(u*2*3),d=0;d<u;d++){let f=t[d],y=t[(d+1)%u];c[m++]=f.x,c[m++]=f.y,c[m++]=f.z,c[m++]=y.x,c[m++]=y.y,c[m++]=y.z}else{let f=0;if(o===un.GEODESIC)for(d=0;d<u;d++)f+=oi.subdivideLineCount(t[d],t[(d+1)%u],n);else if(o===un.RHUMB)for(d=0;d<u;d++)f+=oi.subdivideRhumbLineCount(e,t[d],t[(d+1)%u],n);for(c=new Float64Array(f*3),d=0;d<u;d++){let y;o===un.GEODESIC?y=oi.subdivideLine(t[d],t[(d+1)%u],n,A3):o===un.RHUMB&&(y=oi.subdivideRhumbLine(e,t[d],t[(d+1)%u],n,A3));let _=y.length;for(let S=0;S<_;++S)c[m++]=y[S]}}u=c.length/3;let p=u*2,b=Oe.createTypedArray(u,p);for(m=0,d=0;d<u-1;d++)b[m++]=d,b[m++]=d+1;return b[m++]=u-1,b[m]=0,new Yt({geometry:new At({attributes:new Rn({position:new Xe({componentDatatype:J.DOUBLE,componentsPerAttribute:3,values:c})}),indices:b,primitiveType:Ie.LINES})})}function Zyt(e,t,n,i,o){let s=Ms.fromPoints(t,e).projectPointsOntoPlane(t,j1e);hi.computeWindingOrder2D(s)===Qs.CLOCKWISE&&(s.reverse(),t=t.slice().reverse());let c,d,u=t.length,m=new Array(u),p=0;if(i)for(c=new Float64Array(u*2*3*2),d=0;d<u;++d){m[d]=p/3;let _=t[d],S=t[(d+1)%u];c[p++]=_.x,c[p++]=_.y,c[p++]=_.z,c[p++]=S.x,c[p++]=S.y,c[p++]=S.z}else{let _=0;if(o===un.GEODESIC)for(d=0;d<u;d++)_+=oi.subdivideLineCount(t[d],t[(d+1)%u],n);else if(o===un.RHUMB)for(d=0;d<u;d++)_+=oi.subdivideRhumbLineCount(e,t[d],t[(d+1)%u],n);for(c=new Float64Array(_*3*2),d=0;d<u;++d){m[d]=p/3;let S;o===un.GEODESIC?S=oi.subdivideLine(t[d],t[(d+1)%u],n,A3):o===un.RHUMB&&(S=oi.subdivideRhumbLine(e,t[d],t[(d+1)%u],n,A3));let Z=S.length;for(let R=0;R<Z;++R)c[p++]=S[R]}}u=c.length/6;let b=m.length,f=(u*2+b)*2,y=Oe.createTypedArray(u+b,f);for(p=0,d=0;d<u;++d)y[p++]=d,y[p++]=(d+1)%u,y[p++]=d+u,y[p++]=(d+1)%u+u;for(d=0;d<b;d++){let _=m[d];y[p++]=_,y[p++]=_+u}return new Yt({geometry:new At({attributes:new Rn({position:new Xe({componentDatatype:J.DOUBLE,componentsPerAttribute:3,values:c})}),indices:y,primitiveType:Ie.LINES})})}function cZ(e){let t=e.polygonHierarchy,n=e.ellipsoid??ne.default,i=e.granularity??W.RADIANS_PER_DEGREE,o=e.perPositionHeight??!1,r=o&&l(e.extrudedHeight),s=e.arcType??un.GEODESIC,a=e.height??0,c=e.extrudedHeight??a;if(!r){let d=Math.max(a,c);c=Math.min(a,c),a=d}this._ellipsoid=ne.clone(n),this._granularity=i,this._height=a,this._extrudedHeight=c,this._arcType=s,this._polygonHierarchy=t,this._perPositionHeight=o,this._perPositionHeightExtrude=r,this._offsetAttribute=e.offsetAttribute,this._workerName="createPolygonOutlineGeometry",this.packedLength=oi.computeHierarchyPackedLength(t,h)+ne.packedLength+8}cZ.pack=function(e,t,n){return n=n??0,n=oi.packPolygonHierarchy(e._polygonHierarchy,t,n,h),ne.pack(e._ellipsoid,t,n),n+=ne.packedLength,t[n++]=e._height,t[n++]=e._extrudedHeight,t[n++]=e._granularity,t[n++]=e._perPositionHeightExtrude?1:0,t[n++]=e._perPositionHeight?1:0,t[n++]=e._arcType,t[n++]=e._offsetAttribute??-1,t[n]=e.packedLength,t};var Ryt=ne.clone(ne.UNIT_SPHERE),Cyt={polygonHierarchy:{}};cZ.unpack=function(e,t,n){t=t??0;let i=oi.unpackPolygonHierarchy(e,t,h);t=i.startingIndex,delete i.startingIndex;let o=ne.unpack(e,t,Ryt);t+=ne.packedLength;let r=e[t++],s=e[t++],a=e[t++],c=e[t++]===1,d=e[t++]===1,u=e[t++],m=e[t++],p=e[t];return l(n)||(n=new cZ(Cyt)),n._polygonHierarchy=i,n._ellipsoid=ne.clone(o,n._ellipsoid),n._height=r,n._extrudedHeight=s,n._granularity=a,n._perPositionHeight=d,n._perPositionHeightExtrude=c,n._arcType=u,n._offsetAttribute=m===-1?void 0:m,n.packedLength=p,n};cZ.fromPositions=function(e){e=e??B.EMPTY_OBJECT;let t={polygonHierarchy:{positions:e.positions},height:e.height,extrudedHeight:e.extrudedHeight,ellipsoid:e.ellipsoid,granularity:e.granularity,perPositionHeight:e.perPositionHeight,arcType:e.arcType,offsetAttribute:e.offsetAttribute};return new cZ(t)};cZ.createGeometry=function(e){let t=e._ellipsoid,n=e._granularity,i=e._polygonHierarchy,o=e._perPositionHeight,r=e._arcType,s=oi.polygonOutlinesFromHierarchy(i,!o,t);if(s.length===0)return;let a,c=[],d=W.chordLength(n,t.maximumRadius),u=e._height,m=e._extrudedHeight,p=e._perPositionHeightExtrude||!W.equalsEpsilon(u,m,0,W.EPSILON2),b,f;if(p)for(f=0;f<s.length;f++){if(a=Zyt(t,s[f],d,o,r),a.geometry=oi.scaleToGeodeticHeightExtruded(a.geometry,u,m,t,o),l(e._offsetAttribute)){let S=a.geometry.attributes.position.values.length/3,Z=new Uint8Array(S);e._offsetAttribute===bn.TOP?Z=Z.fill(1,0,S/2):(b=e._offsetAttribute===bn.NONE?0:1,Z=Z.fill(b)),a.geometry.attributes.applyOffset=new Xe({componentDatatype:J.UNSIGNED_BYTE,componentsPerAttribute:1,values:Z})}c.push(a)}else for(f=0;f<s.length;f++){if(a=Syt(t,s[f],d,o,r),a.geometry.attributes.position.values=hi.scaleToGeodeticHeight(a.geometry.attributes.position.values,u,t,!o),l(e._offsetAttribute)){let S=a.geometry.attributes.position.values.length;b=e._offsetAttribute===bn.NONE?0:1;let Z=new Uint8Array(S/3).fill(b);a.geometry.attributes.applyOffset=new Xe({componentDatatype:J.UNSIGNED_BYTE,componentsPerAttribute:1,values:Z})}c.push(a)}let y=Bn.combineInstances(c)[0],_=me.fromVertices(y.attributes.position.values);return new At({attributes:y.attributes,indices:y.indices,primitiveType:y.primitiveType,boundingSphere:_,offsetAttribute:e._offsetAttribute})};var HY=cZ;var Q1e="Entity polygons cannot have both height and perPositionHeight. height will be ignored",q1e="heightReference is not supported for entity polygons with perPositionHeight. heightReference will be ignored",$1e=new U,eCe=h.ZERO,tCe=new h,nCe=new re,Vyt=[],Eyt=new k;function Ayt(e){this.id=e,this.vertexFormat=void 0,this.polygonHierarchy=void 0,this.perPositionHeight=void 0,this.closeTop=void 0,this.closeBottom=void 0,this.height=void 0,this.extrudedHeight=void 0,this.granularity=void 0,this.stRotation=void 0,this.offsetAttribute=void 0,this.arcType=void 0,this.textureCoordinates=void 0}function qu(e,t){ri.call(this,{entity:e,scene:t,geometryOptions:new Ayt(e),geometryPropertyName:"polygon",observedPropertyNames:["availability","polygon"]}),this._onEntityPropertyChanged(e,"polygon",e.polygon,void 0)}l(Object.create)&&(qu.prototype=Object.create(ri.prototype),qu.prototype.constructor=qu);qu.prototype.createFillGeometryInstance=function(e){let t=this._entity,n=t.isAvailable(e),i=this._options,o={show:new Wn(n&&t.isShowing&&this._showProperty.getValue(e)&&this._fillProperty.getValue(e)),distanceDisplayCondition:ti.fromDistanceDisplayCondition(this._distanceDisplayConditionProperty.getValue(e)),offset:void 0,color:void 0};if(this._materialProperty instanceof Qt){let s;l(this._materialProperty.color)&&(this._materialProperty.color.isConstant||n)&&(s=this._materialProperty.color.getValue(e,$1e)),l(s)||(s=U.WHITE),o.color=$t.fromColor(s)}l(i.offsetAttribute)&&(o.offset=Ro.fromCartesian3(j.getValueOrDefault(this._terrainOffsetProperty,e,eCe,tCe)));let r;return i.perPositionHeight&&!l(i.extrudedHeight)?r=new zY(i):r=new kp(i),new Yt({id:t,geometry:r,attributes:o})};qu.prototype.createOutlineGeometryInstance=function(e){let t=this._entity,n=t.isAvailable(e),i=this._options,o=j.getValueOrDefault(this._outlineColorProperty,e,U.BLACK,$1e),r=this._distanceDisplayConditionProperty.getValue(e),s={show:new Wn(n&&t.isShowing&&this._showProperty.getValue(e)&&this._showOutlineProperty.getValue(e)),color:$t.fromColor(o),distanceDisplayCondition:ti.fromDistanceDisplayCondition(r),offset:void 0};l(i.offsetAttribute)&&(s.offset=Ro.fromCartesian3(j.getValueOrDefault(this._terrainOffsetProperty,e,eCe,tCe)));let a;return i.perPositionHeight&&!l(i.extrudedHeight)?a=new eh(i):a=new HY(i),new Yt({id:t,geometry:a,attributes:s})};qu.prototype._computeCenter=function(e,t){let n=j.getValueOrUndefined(this._entity.polygon.hierarchy,e);if(!l(n))return;let i=n.positions;if(i.length===0)return;let o=this._scene.ellipsoid,r=Ms.fromPoints(i,o),s=r.projectPointsOntoPlane(i,Vyt),a=s.length,c=0,d=a-1,u=new k;for(let p=0;p<a;d=p++){let b=s[p],f=s[d],y=b.x*f.y-f.x*b.y,_=k.add(b,f,Eyt);_=k.multiplyByScalar(_,y,_),u=k.add(u,_,u),c+=y}let m=1/(c*3);return u=k.multiplyByScalar(u,m,u),r.projectPointOntoEllipsoid(u,t)};qu.prototype._isHidden=function(e,t){return!l(t.hierarchy)||Wi.prototype._isHidden.call(this,e,t)};qu.prototype._isOnTerrain=function(e,t){let n=ri.prototype._isOnTerrain.call(this,e,t),i=t.perPositionHeight,o=l(i)&&(i.isConstant?i.getValue(ot.MINIMUM_VALUE):!0);return n&&!o};qu.prototype._isDynamic=function(e,t){return!t.hierarchy.isConstant||!j.isConstant(t.height)||!j.isConstant(t.extrudedHeight)||!j.isConstant(t.granularity)||!j.isConstant(t.stRotation)||!j.isConstant(t.textureCoordinates)||!j.isConstant(t.outlineWidth)||!j.isConstant(t.perPositionHeight)||!j.isConstant(t.closeTop)||!j.isConstant(t.closeBottom)||!j.isConstant(t.zIndex)||!j.isConstant(t.arcType)||this._onTerrain&&!j.isConstant(this._materialProperty)&&!(this._materialProperty instanceof Qt)};qu.prototype._setStaticOptions=function(e,t){let n=this._materialProperty instanceof Qt,i=this._options;i.vertexFormat=n?Tn.VERTEX_FORMAT:Co.MaterialSupport.TEXTURED.vertexFormat;let o=t.hierarchy.getValue(ot.MINIMUM_VALUE),r=j.getValueOrUndefined(t.height,ot.MINIMUM_VALUE),s=j.getValueOrDefault(t.heightReference,ot.MINIMUM_VALUE,He.NONE),a=j.getValueOrUndefined(t.extrudedHeight,ot.MINIMUM_VALUE),c=j.getValueOrDefault(t.extrudedHeightReference,ot.MINIMUM_VALUE,He.NONE),d=j.getValueOrDefault(t.perPositionHeight,ot.MINIMUM_VALUE,!1);r=ri.getGeometryHeight(r,s);let u;if(d?(l(r)&&(r=void 0,xt(Q1e)),s!==He.NONE&&d&&(r=void 0,xt(q1e))):(l(a)&&!l(r)&&(r=0),u=ri.computeGeometryOffsetAttribute(r,s,a,c)),i.polygonHierarchy=o,i.granularity=j.getValueOrUndefined(t.granularity,ot.MINIMUM_VALUE),i.stRotation=j.getValueOrUndefined(t.stRotation,ot.MINIMUM_VALUE),i.perPositionHeight=d,i.closeTop=j.getValueOrDefault(t.closeTop,ot.MINIMUM_VALUE,!0),i.closeBottom=j.getValueOrDefault(t.closeBottom,ot.MINIMUM_VALUE,!0),i.offsetAttribute=u,i.height=r,i.arcType=j.getValueOrDefault(t.arcType,ot.MINIMUM_VALUE,un.GEODESIC),i.textureCoordinates=j.getValueOrUndefined(t.textureCoordinates,ot.MINIMUM_VALUE),a=ri.getGeometryExtrudedHeight(a,c),a===ri.CLAMP_TO_GROUND){let m=kp.computeRectangleFromPositions(i.polygonHierarchy.positions,i.ellipsoid,i.arcType,nCe);a=Pi.getMinimumMaximumHeights(m).minimumTerrainHeight}i.extrudedHeight=a};qu.prototype._getIsClosed=function(e){let t=e.height,n=e.extrudedHeight,i=l(n)&&n!==t;return!e.perPositionHeight&&(!i&&t===0||i&&e.closeTop&&e.closeBottom)};qu.DynamicGeometryUpdater=KV;function KV(e,t,n){Li.call(this,e,t,n)}l(Object.create)&&(KV.prototype=Object.create(Li.prototype),KV.prototype.constructor=KV);KV.prototype._isHidden=function(e,t,n){return!l(this._options.polygonHierarchy)||Li.prototype._isHidden.call(this,e,t,n)};KV.prototype._setOptions=function(e,t,n){let i=this._options;i.polygonHierarchy=j.getValueOrUndefined(t.hierarchy,n);let o=j.getValueOrUndefined(t.height,n),r=j.getValueOrDefault(t.heightReference,n,He.NONE),s=j.getValueOrDefault(t.extrudedHeightReference,n,He.NONE),a=j.getValueOrUndefined(t.extrudedHeight,n),c=j.getValueOrUndefined(t.perPositionHeight,n);o=ri.getGeometryHeight(o,s);let d;if(c?(l(o)&&(o=void 0,xt(Q1e)),r!==He.NONE&&c&&(o=void 0,xt(q1e))):(l(a)&&!l(o)&&(o=0),d=ri.computeGeometryOffsetAttribute(o,r,a,s)),i.granularity=j.getValueOrUndefined(t.granularity,n),i.stRotation=j.getValueOrUndefined(t.stRotation,n),i.textureCoordinates=j.getValueOrUndefined(t.textureCoordinates,n),i.perPositionHeight=j.getValueOrUndefined(t.perPositionHeight,n),i.closeTop=j.getValueOrDefault(t.closeTop,n,!0),i.closeBottom=j.getValueOrDefault(t.closeBottom,n,!0),i.offsetAttribute=d,i.height=o,i.arcType=j.getValueOrDefault(t.arcType,n,un.GEODESIC),a=ri.getGeometryExtrudedHeight(a,s),a===ri.CLAMP_TO_GROUND){let u=kp.computeRectangleFromPositions(i.polygonHierarchy.positions,i.ellipsoid,i.arcType,nCe);a=Pi.getMinimumMaximumHeights(u).minimumTerrainHeight}i.extrudedHeight=a};var KY=qu;var uUi=x(T(),1);var Eki=x(T(),1);function Gyt(e,t,n,i){let o=new Rn;i.position&&(o.position=new Xe({componentDatatype:J.DOUBLE,componentsPerAttribute:3,values:e}));let r=t.length,s=e.length/3,a=(s-r*2)/(r*2),c=hi.triangulate(t),d=(a-1)*r*6+c.length*2,u=Oe.createTypedArray(s,d),m,p,b,f,y,_,S=r*2,Z=0;for(m=0;m<a-1;m++){for(p=0;p<r-1;p++)b=p*2+m*r*2,_=b+S,f=b+1,y=f+S,u[Z++]=f,u[Z++]=b,u[Z++]=y,u[Z++]=y,u[Z++]=b,u[Z++]=_;b=r*2-2+m*r*2,f=b+1,y=f+S,_=b+S,u[Z++]=f,u[Z++]=b,u[Z++]=y,u[Z++]=y,u[Z++]=b,u[Z++]=_}if(i.st||i.tangent||i.bitangent){let E=new Float32Array(s*2),A=1/(a-1),L=1/n.height,F=n.height/2,I,N,g=0;for(m=0;m<a;m++){for(I=m*A,N=L*(t[0].y+F),E[g++]=I,E[g++]=N,p=1;p<r;p++)N=L*(t[p].y+F),E[g++]=I,E[g++]=N,E[g++]=I,E[g++]=N;N=L*(t[0].y+F),E[g++]=I,E[g++]=N}for(p=0;p<r;p++)I=0,N=L*(t[p].y+F),E[g++]=I,E[g++]=N;for(p=0;p<r;p++)I=(a-1)*A,N=L*(t[p].y+F),E[g++]=I,E[g++]=N;o.st=new Xe({componentDatatype:J.FLOAT,componentsPerAttribute:2,values:new Float32Array(E)})}let R=s-r*2;for(m=0;m<c.length;m+=3){let E=c[m]+R,A=c[m+1]+R,L=c[m+2]+R;u[Z++]=E,u[Z++]=A,u[Z++]=L,u[Z++]=L+r,u[Z++]=A+r,u[Z++]=E+r}let C=new At({attributes:o,indices:u,boundingSphere:me.fromVertices(e),primitiveType:Ie.TRIANGLES});if(i.normal&&(C=Bn.computeNormal(C)),i.tangent||i.bitangent){try{C=Bn.computeTangentAndBitangent(C)}catch{xt("polyline-volume-tangent-bitangent","Unable to compute tangents and bitangents for polyline volume geometry")}i.tangent||(C.attributes.tangent=void 0),i.bitangent||(C.attributes.bitangent=void 0),i.st||(C.attributes.st=void 0)}return C}function jY(e){e=e??B.EMPTY_OBJECT;let t=e.polylinePositions,n=e.shapePositions;this._positions=t,this._shape=n,this._ellipsoid=ne.clone(e.ellipsoid??ne.default),this._cornerType=e.cornerType??ro.ROUNDED,this._vertexFormat=Me.clone(e.vertexFormat??Me.DEFAULT),this._granularity=e.granularity??W.RADIANS_PER_DEGREE,this._workerName="createPolylineVolumeGeometry";let i=1+t.length*h.packedLength;i+=1+n.length*k.packedLength,this.packedLength=i+ne.packedLength+Me.packedLength+2}jY.pack=function(e,t,n){n=n??0;let i,o=e._positions,r=o.length;for(t[n++]=r,i=0;i<r;++i,n+=h.packedLength)h.pack(o[i],t,n);let s=e._shape;for(r=s.length,t[n++]=r,i=0;i<r;++i,n+=k.packedLength)k.pack(s[i],t,n);return ne.pack(e._ellipsoid,t,n),n+=ne.packedLength,Me.pack(e._vertexFormat,t,n),n+=Me.packedLength,t[n++]=e._cornerType,t[n]=e._granularity,t};var iCe=ne.clone(ne.UNIT_SPHERE),oCe=new Me,JY={polylinePositions:void 0,shapePositions:void 0,ellipsoid:iCe,vertexFormat:oCe,cornerType:void 0,granularity:void 0};jY.unpack=function(e,t,n){t=t??0;let i,o=e[t++],r=new Array(o);for(i=0;i<o;++i,t+=h.packedLength)r[i]=h.unpack(e,t);o=e[t++];let s=new Array(o);for(i=0;i<o;++i,t+=k.packedLength)s[i]=k.unpack(e,t);let a=ne.unpack(e,t,iCe);t+=ne.packedLength;let c=Me.unpack(e,t,oCe);t+=Me.packedLength;let d=e[t++],u=e[t];return l(n)?(n._positions=r,n._shape=s,n._ellipsoid=ne.clone(a,n._ellipsoid),n._vertexFormat=Me.clone(c,n._vertexFormat),n._cornerType=d,n._granularity=u,n):(JY.polylinePositions=r,JY.shapePositions=s,JY.cornerType=d,JY.granularity=u,new jY(JY))};var Lyt=new nt;jY.createGeometry=function(e){let t=e._positions,n=Yo(t,h.equalsEpsilon),i=e._shape;if(i=Vf.removeDuplicatesFromShape(i),n.length<2||i.length<3)return;hi.computeWindingOrder2D(i)===Qs.CLOCKWISE&&i.reverse();let o=nt.fromPoints(i,Lyt),r=Vf.computePositions(n,i,o,e,!0);return Gyt(r,i,o,e._vertexFormat)};var QY=jY;var Kki=x(T(),1);function Wyt(e,t){let n=new Rn;n.position=new Xe({componentDatatype:J.DOUBLE,componentsPerAttribute:3,values:e});let i=t.length,o=n.position.values.length/3,s=e.length/3/i,a=Oe.createTypedArray(o,2*i*(s+1)),c,d,u=0;c=0;let m=c*i;for(d=0;d<i-1;d++)a[u++]=d+m,a[u++]=d+m+1;for(a[u++]=i-1+m,a[u++]=m,c=s-1,m=c*i,d=0;d<i-1;d++)a[u++]=d+m,a[u++]=d+m+1;for(a[u++]=i-1+m,a[u++]=m,c=0;c<s-1;c++){let b=i*c,f=b+i;for(d=0;d<i;d++)a[u++]=d+b,a[u++]=d+f}return new At({attributes:n,indices:Oe.createTypedArray(o,a),boundingSphere:me.fromVertices(e),primitiveType:Ie.LINES})}function $Y(e){e=e??B.EMPTY_OBJECT;let t=e.polylinePositions,n=e.shapePositions;this._positions=t,this._shape=n,this._ellipsoid=ne.clone(e.ellipsoid??ne.default),this._cornerType=e.cornerType??ro.ROUNDED,this._granularity=e.granularity??W.RADIANS_PER_DEGREE,this._workerName="createPolylineVolumeOutlineGeometry";let i=1+t.length*h.packedLength;i+=1+n.length*k.packedLength,this.packedLength=i+ne.packedLength+2}$Y.pack=function(e,t,n){n=n??0;let i,o=e._positions,r=o.length;for(t[n++]=r,i=0;i<r;++i,n+=h.packedLength)h.pack(o[i],t,n);let s=e._shape;for(r=s.length,t[n++]=r,i=0;i<r;++i,n+=k.packedLength)k.pack(s[i],t,n);return ne.pack(e._ellipsoid,t,n),n+=ne.packedLength,t[n++]=e._cornerType,t[n]=e._granularity,t};var rCe=ne.clone(ne.UNIT_SPHERE),qY={polylinePositions:void 0,shapePositions:void 0,ellipsoid:rCe,height:void 0,cornerType:void 0,granularity:void 0};$Y.unpack=function(e,t,n){t=t??0;let i,o=e[t++],r=new Array(o);for(i=0;i<o;++i,t+=h.packedLength)r[i]=h.unpack(e,t);o=e[t++];let s=new Array(o);for(i=0;i<o;++i,t+=k.packedLength)s[i]=k.unpack(e,t);let a=ne.unpack(e,t,rCe);t+=ne.packedLength;let c=e[t++],d=e[t];return l(n)?(n._positions=r,n._shape=s,n._ellipsoid=ne.clone(a,n._ellipsoid),n._cornerType=c,n._granularity=d,n):(qY.polylinePositions=r,qY.shapePositions=s,qY.cornerType=c,qY.granularity=d,new $Y(qY))};var vyt=new nt;$Y.createGeometry=function(e){let t=e._positions,n=Yo(t,h.equalsEpsilon),i=e._shape;if(i=Vf.removeDuplicatesFromShape(i),n.length<2||i.length<3)return;hi.computeWindingOrder2D(i)===Qs.CLOCKWISE&&i.reverse();let o=nt.fromPoints(i,vyt),r=Vf.computePositions(n,i,o,e,!1);return Wyt(r,i)};var eM=$Y;var sCe=new U;function Fyt(e){this.id=e,this.vertexFormat=void 0,this.polylinePositions=void 0,this.shapePositions=void 0,this.cornerType=void 0,this.granularity=void 0}function s0(e,t){Wi.call(this,{entity:e,scene:t,geometryOptions:new Fyt(e),geometryPropertyName:"polylineVolume",observedPropertyNames:["availability","polylineVolume"]}),this._onEntityPropertyChanged(e,"polylineVolume",e.polylineVolume,void 0)}l(Object.create)&&(s0.prototype=Object.create(Wi.prototype),s0.prototype.constructor=s0);s0.prototype.createFillGeometryInstance=function(e){let t=this._entity,n=t.isAvailable(e),i,o,r=new Wn(n&&t.isShowing&&this._showProperty.getValue(e)&&this._fillProperty.getValue(e)),s=this._distanceDisplayConditionProperty.getValue(e),a=ti.fromDistanceDisplayCondition(s);if(this._materialProperty instanceof Qt){let c;l(this._materialProperty.color)&&(this._materialProperty.color.isConstant||n)&&(c=this._materialProperty.color.getValue(e,sCe)),l(c)||(c=U.WHITE),o=$t.fromColor(c),i={show:r,distanceDisplayCondition:a,color:o}}else i={show:r,distanceDisplayCondition:a};return new Yt({id:t,geometry:new QY(this._options),attributes:i})};s0.prototype.createOutlineGeometryInstance=function(e){let t=this._entity,n=t.isAvailable(e),i=j.getValueOrDefault(this._outlineColorProperty,e,U.BLACK,sCe),o=this._distanceDisplayConditionProperty.getValue(e);return new Yt({id:t,geometry:new eM(this._options),attributes:{show:new Wn(n&&t.isShowing&&this._showProperty.getValue(e)&&this._showOutlineProperty.getValue(e)),color:$t.fromColor(i),distanceDisplayCondition:ti.fromDistanceDisplayCondition(o)}})};s0.prototype._isHidden=function(e,t){return!l(t.positions)||!l(t.shape)||Wi.prototype._isHidden.call(this,e,t)};s0.prototype._isDynamic=function(e,t){return!t.positions.isConstant||!t.shape.isConstant||!j.isConstant(t.granularity)||!j.isConstant(t.outlineWidth)||!j.isConstant(t.cornerType)};s0.prototype._setStaticOptions=function(e,t){let n=t.granularity,i=t.cornerType,o=this._options,r=this._materialProperty instanceof Qt;o.vertexFormat=r?Tn.VERTEX_FORMAT:Co.MaterialSupport.TEXTURED.vertexFormat,o.polylinePositions=t.positions.getValue(ot.MINIMUM_VALUE,o.polylinePositions),o.shapePositions=t.shape.getValue(ot.MINIMUM_VALUE,o.shape),o.granularity=l(n)?n.getValue(ot.MINIMUM_VALUE):void 0,o.cornerType=l(i)?i.getValue(ot.MINIMUM_VALUE):void 0};s0.DynamicGeometryUpdater=JV;function JV(e,t,n){Li.call(this,e,t,n)}l(Object.create)&&(JV.prototype=Object.create(Li.prototype),JV.prototype.constructor=JV);JV.prototype._isHidden=function(e,t,n){let i=this._options;return!l(i.polylinePositions)||!l(i.shapePositions)||Li.prototype._isHidden.call(this,e,t,n)};JV.prototype._setOptions=function(e,t,n){let i=this._options;i.polylinePositions=j.getValueOrUndefined(t.positions,n,i.polylinePositions),i.shapePositions=j.getValueOrUndefined(t.shape,n),i.granularity=j.getValueOrUndefined(t.granularity,n),i.cornerType=j.getValueOrUndefined(t.cornerType,n)};var tM=s0;var c5i=x(T(),1);var NUi=x(T(),1);var Nee=new h,lCe=new h,dCe=new h,uCe=new h,mCe=new re,Iyt=new k,Pyt=new me,Xyt=new me;function hCe(e,t){let n=new At({attributes:new Rn,primitiveType:Ie.TRIANGLES});return n.attributes.position=new Xe({componentDatatype:J.DOUBLE,componentsPerAttribute:3,values:t.positions}),e.normal&&(n.attributes.normal=new Xe({componentDatatype:J.FLOAT,componentsPerAttribute:3,values:t.normals})),e.tangent&&(n.attributes.tangent=new Xe({componentDatatype:J.FLOAT,componentsPerAttribute:3,values:t.tangents})),e.bitangent&&(n.attributes.bitangent=new Xe({componentDatatype:J.FLOAT,componentsPerAttribute:3,values:t.bitangents})),n}function Nyt(e,t,n,i){let o=e.length,r=t.normal?new Float32Array(o):void 0,s=t.tangent?new Float32Array(o):void 0,a=t.bitangent?new Float32Array(o):void 0,c=0,d=uCe,u=dCe,m=lCe;if(t.normal||t.tangent||t.bitangent)for(let p=0;p<o;p+=3){let b=h.fromArray(e,p,Nee),f=c+1,y=c+2;m=n.geodeticSurfaceNormal(b,m),(t.tangent||t.bitangent)&&(h.cross(h.UNIT_Z,m,u),q.multiplyByVector(i,u,u),h.normalize(u,u),t.bitangent&&h.normalize(h.cross(m,u,d),d)),t.normal&&(r[c]=m.x,r[f]=m.y,r[y]=m.z),t.tangent&&(s[c]=u.x,s[f]=u.y,s[y]=u.z),t.bitangent&&(a[c]=d.x,a[f]=d.y,a[y]=d.z),c+=3}return hCe(t,{positions:e,normals:r,tangents:s,bitangents:a})}var Yee=new h,fCe=new h;function Yyt(e,t,n){let i=e.length,o=t.normal?new Float32Array(i):void 0,r=t.tangent?new Float32Array(i):void 0,s=t.bitangent?new Float32Array(i):void 0,a=0,c=0,d=0,u=!0,m=uCe,p=dCe,b=lCe;if(t.normal||t.tangent||t.bitangent)for(let f=0;f<i;f+=6){let y=h.fromArray(e,f,Nee),_=h.fromArray(e,(f+6)%i,Yee);if(u){let S=h.fromArray(e,(f+3)%i,fCe);h.subtract(_,y,_),h.subtract(S,y,S),b=h.normalize(h.cross(S,_,b),b),u=!1}h.equalsEpsilon(_,y,W.EPSILON10)&&(u=!0),(t.tangent||t.bitangent)&&(m=n.geodeticSurfaceNormal(y,m),t.tangent&&(p=h.normalize(h.cross(m,b,p),p))),t.normal&&(o[a++]=b.x,o[a++]=b.y,o[a++]=b.z,o[a++]=b.x,o[a++]=b.y,o[a++]=b.z),t.tangent&&(r[c++]=p.x,r[c++]=p.y,r[c++]=p.z,r[c++]=p.x,r[c++]=p.y,r[c++]=p.z),t.bitangent&&(s[d++]=m.x,s[d++]=m.y,s[d++]=m.z,s[d++]=m.x,s[d++]=m.y,s[d++]=m.z)}return hCe(t,{positions:e,normals:o,tangents:r,bitangents:s})}function pCe(e,t){let n=e._vertexFormat,i=e._ellipsoid,o=t.height,r=t.width,s=t.northCap,a=t.southCap,c=0,d=o,u=o,m=0;s&&(c=1,u-=1,m+=1),a&&(d-=1,u-=1,m+=1),m+=r*u;let p=n.position?new Float64Array(m*3):void 0,b=n.st?new Float32Array(m*2):void 0,f=0,y=0,_=Nee,S=Iyt,Z=Number.MAX_VALUE,R=Number.MAX_VALUE,C=-Number.MAX_VALUE,E=-Number.MAX_VALUE;for(let V=c;V<d;++V)for(let G=0;G<r;++G)Ca.computePosition(t,i,n.st,V,G,_,S),p[f++]=_.x,p[f++]=_.y,p[f++]=_.z,n.st&&(b[y++]=S.x,b[y++]=S.y,Z=Math.min(Z,S.x),R=Math.min(R,S.y),C=Math.max(C,S.x),E=Math.max(E,S.y));if(s&&(Ca.computePosition(t,i,n.st,0,0,_,S),p[f++]=_.x,p[f++]=_.y,p[f++]=_.z,n.st&&(b[y++]=S.x,b[y++]=S.y,Z=S.x,R=S.y,C=S.x,E=S.y)),a&&(Ca.computePosition(t,i,n.st,o-1,0,_,S),p[f++]=_.x,p[f++]=_.y,p[f]=_.z,n.st&&(b[y++]=S.x,b[y]=S.y,Z=Math.min(Z,S.x),R=Math.min(R,S.y),C=Math.max(C,S.x),E=Math.max(E,S.y))),n.st&&(Z<0||R<0||C>1||E>1))for(let V=0;V<b.length;V+=2)b[V]=(b[V]-Z)/(C-Z),b[V+1]=(b[V+1]-R)/(E-R);let A=Nyt(p,n,i,t.tangentRotationMatrix),L=6*(r-1)*(u-1);s&&(L+=3*(r-1)),a&&(L+=3*(r-1));let F=Oe.createTypedArray(m,L),I=0,N=0,g;for(g=0;g<u-1;++g){for(let V=0;V<r-1;++V){let G=I,v=G+r,X=v+1,Y=G+1;F[N++]=G,F[N++]=v,F[N++]=Y,F[N++]=Y,F[N++]=v,F[N++]=X,++I}++I}if(s||a){let V=m-1,G=m-1;s&&a&&(V=m-2);let v,X;if(I=0,s)for(g=0;g<r-1;g++)v=I,X=v+1,F[N++]=V,F[N++]=v,F[N++]=X,++I;if(a)for(I=(u-1)*r,g=0;g<r-1;g++)v=I,X=v+1,F[N++]=v,F[N++]=G,F[N++]=X,++I}return A.indices=F,n.st&&(A.attributes.st=new Xe({componentDatatype:J.FLOAT,componentsPerAttribute:2,values:b})),A}function jV(e,t,n,i,o){return e[t++]=i[n],e[t++]=i[n+1],e[t++]=i[n+2],e[t++]=o[n],e[t++]=o[n+1],e[t]=o[n+2],e}function QV(e,t,n,i){return e[t++]=i[n],e[t++]=i[n+1],e[t++]=i[n],e[t]=i[n+1],e}var Mee=new Me;function Myt(e,t){let n=e._shadowVolume,i=e._offsetAttribute,o=e._vertexFormat,r=e._extrudedHeight,s=e._surfaceHeight,a=e._ellipsoid,c=t.height,d=t.width,u;if(n){let We=Me.clone(o,Mee);We.normal=!0,e._vertexFormat=We}let m=pCe(e,t);n&&(e._vertexFormat=o);let p=hi.scaleToGeodeticHeight(m.attributes.position.values,s,a,!1);p=new Float64Array(p);let b=p.length,f=b*2,y=new Float64Array(f);y.set(p);let _=hi.scaleToGeodeticHeight(m.attributes.position.values,r,a);y.set(_,b),m.attributes.position.values=y;let S=o.normal?new Float32Array(f):void 0,Z=o.tangent?new Float32Array(f):void 0,R=o.bitangent?new Float32Array(f):void 0,C=o.st?new Float32Array(f/3*2):void 0,E,A;if(o.normal){for(A=m.attributes.normal.values,S.set(A),u=0;u<b;u++)A[u]=-A[u];S.set(A,b),m.attributes.normal.values=S}if(n){A=m.attributes.normal.values,o.normal||(m.attributes.normal=void 0);let We=new Float32Array(f);for(u=0;u<b;u++)A[u]=-A[u];We.set(A,b),m.attributes.extrudeDirection=new Xe({componentDatatype:J.FLOAT,componentsPerAttribute:3,values:We})}let L,F=l(i);if(F){let We=b/3*2,Ke=new Uint8Array(We);i===bn.TOP?Ke=Ke.fill(1,0,We/2):(L=i===bn.NONE?0:1,Ke=Ke.fill(L)),m.attributes.applyOffset=new Xe({componentDatatype:J.UNSIGNED_BYTE,componentsPerAttribute:1,values:Ke})}if(o.tangent){let We=m.attributes.tangent.values;for(Z.set(We),u=0;u<b;u++)We[u]=-We[u];Z.set(We,b),m.attributes.tangent.values=Z}if(o.bitangent){let We=m.attributes.bitangent.values;R.set(We),R.set(We,b),m.attributes.bitangent.values=R}o.st&&(E=m.attributes.st.values,C.set(E),C.set(E,b/3*2),m.attributes.st.values=C);let I=m.indices,N=I.length,g=b/3,V=Oe.createTypedArray(f/3,N*2);for(V.set(I),u=0;u<N;u+=3)V[u+N]=I[u+2]+g,V[u+1+N]=I[u+1]+g,V[u+2+N]=I[u]+g;m.indices=V;let G=t.northCap,v=t.southCap,X=c,Y=2,D=0,M=4,O=4;G&&(Y-=1,X-=1,D+=1,M-=2,O-=1),v&&(Y-=1,X-=1,D+=1,M-=2,O-=1),D+=Y*d+2*X-M;let w=(D+O)*2,z=new Float64Array(w*3),K=n?new Float32Array(w*3):void 0,te=F?new Uint8Array(w):void 0,H=o.st?new Float32Array(w*2):void 0,$=i===bn.TOP;F&&!$&&(L=i===bn.ALL?1:0,te=te.fill(L));let ee=0,le=0,_e=0,he=0,Ze=d*X,ye;for(u=0;u<Ze;u+=d)ye=u*3,z=jV(z,ee,ye,p,_),ee+=6,o.st&&(H=QV(H,le,u*2,E),le+=4),n&&(_e+=3,K[_e++]=A[ye],K[_e++]=A[ye+1],K[_e++]=A[ye+2]),$&&(te[he++]=1,he+=1);if(v){let We=G?Ze+1:Ze;for(ye=We*3,u=0;u<2;u++)z=jV(z,ee,ye,p,_),ee+=6,o.st&&(H=QV(H,le,We*2,E),le+=4),n&&(_e+=3,K[_e++]=A[ye],K[_e++]=A[ye+1],K[_e++]=A[ye+2]),$&&(te[he++]=1,he+=1)}else for(u=Ze-d;u<Ze;u++)ye=u*3,z=jV(z,ee,ye,p,_),ee+=6,o.st&&(H=QV(H,le,u*2,E),le+=4),n&&(_e+=3,K[_e++]=A[ye],K[_e++]=A[ye+1],K[_e++]=A[ye+2]),$&&(te[he++]=1,he+=1);for(u=Ze-1;u>0;u-=d)ye=u*3,z=jV(z,ee,ye,p,_),ee+=6,o.st&&(H=QV(H,le,u*2,E),le+=4),n&&(_e+=3,K[_e++]=A[ye],K[_e++]=A[ye+1],K[_e++]=A[ye+2]),$&&(te[he++]=1,he+=1);if(G){let We=Ze;for(ye=We*3,u=0;u<2;u++)z=jV(z,ee,ye,p,_),ee+=6,o.st&&(H=QV(H,le,We*2,E),le+=4),n&&(_e+=3,K[_e++]=A[ye],K[_e++]=A[ye+1],K[_e++]=A[ye+2]),$&&(te[he++]=1,he+=1)}else for(u=d-1;u>=0;u--)ye=u*3,z=jV(z,ee,ye,p,_),ee+=6,o.st&&(H=QV(H,le,u*2,E),le+=4),n&&(_e+=3,K[_e++]=A[ye],K[_e++]=A[ye+1],K[_e++]=A[ye+2]),$&&(te[he++]=1,he+=1);let Ge=Yyt(z,o,a);o.st&&(Ge.attributes.st=new Xe({componentDatatype:J.FLOAT,componentsPerAttribute:2,values:H})),n&&(Ge.attributes.extrudeDirection=new Xe({componentDatatype:J.FLOAT,componentsPerAttribute:3,values:K})),F&&(Ge.attributes.applyOffset=new Xe({componentDatatype:J.UNSIGNED_BYTE,componentsPerAttribute:1,values:te}));let Ae=Oe.createTypedArray(w,D*6),Fe,tt,Be,je;b=z.length/3;let qe=0;for(u=0;u<b-1;u+=2){Fe=u,je=(Fe+2)%b;let We=h.fromArray(z,Fe*3,Yee),Ke=h.fromArray(z,je*3,fCe);h.equalsEpsilon(We,Ke,W.EPSILON10)||(tt=(Fe+1)%b,Be=(tt+2)%b,Ae[qe++]=Fe,Ae[qe++]=tt,Ae[qe++]=je,Ae[qe++]=je,Ae[qe++]=tt,Ae[qe++]=Be)}return Ge.indices=Ae,Ge=Bn.combineInstances([new Yt({geometry:m}),new Yt({geometry:Ge})]),Ge[0]}var wyt=[new h,new h,new h,new h],bCe=new pe,kyt=new pe;function wee(e,t,n,i,o){if(n===0)return re.clone(e,o);let r=Ca.computeOptions(e,t,n,0,mCe,bCe),s=r.height,a=r.width,c=wyt;return Ca.computePosition(r,i,!1,0,0,c[0]),Ca.computePosition(r,i,!1,0,a-1,c[1]),Ca.computePosition(r,i,!1,s-1,0,c[2]),Ca.computePosition(r,i,!1,s-1,a-1,c[3]),re.fromCartesianArray(c,i,o)}function a0(e){e=e??B.EMPTY_OBJECT;let t=e.rectangle,n=e.height??0,i=e.extrudedHeight??n;this._rectangle=re.clone(t),this._granularity=e.granularity??W.RADIANS_PER_DEGREE,this._ellipsoid=ne.clone(e.ellipsoid??ne.default),this._surfaceHeight=Math.max(n,i),this._rotation=e.rotation??0,this._stRotation=e.stRotation??0,this._vertexFormat=Me.clone(e.vertexFormat??Me.DEFAULT),this._extrudedHeight=Math.min(n,i),this._shadowVolume=e.shadowVolume??!1,this._workerName="createRectangleGeometry",this._offsetAttribute=e.offsetAttribute,this._rotatedRectangle=void 0,this._textureCoordinateRotationPoints=void 0}a0.packedLength=re.packedLength+ne.packedLength+Me.packedLength+7;a0.pack=function(e,t,n){return n=n??0,re.pack(e._rectangle,t,n),n+=re.packedLength,ne.pack(e._ellipsoid,t,n),n+=ne.packedLength,Me.pack(e._vertexFormat,t,n),n+=Me.packedLength,t[n++]=e._granularity,t[n++]=e._surfaceHeight,t[n++]=e._rotation,t[n++]=e._stRotation,t[n++]=e._extrudedHeight,t[n++]=e._shadowVolume?1:0,t[n]=e._offsetAttribute??-1,t};var gCe=new re,yCe=ne.clone(ne.UNIT_SPHERE),qx={rectangle:gCe,ellipsoid:yCe,vertexFormat:Mee,granularity:void 0,height:void 0,rotation:void 0,stRotation:void 0,extrudedHeight:void 0,shadowVolume:void 0,offsetAttribute:void 0};a0.unpack=function(e,t,n){t=t??0;let i=re.unpack(e,t,gCe);t+=re.packedLength;let o=ne.unpack(e,t,yCe);t+=ne.packedLength;let r=Me.unpack(e,t,Mee);t+=Me.packedLength;let s=e[t++],a=e[t++],c=e[t++],d=e[t++],u=e[t++],m=e[t++]===1,p=e[t];return l(n)?(n._rectangle=re.clone(i,n._rectangle),n._ellipsoid=ne.clone(o,n._ellipsoid),n._vertexFormat=Me.clone(r,n._vertexFormat),n._granularity=s,n._surfaceHeight=a,n._rotation=c,n._stRotation=d,n._extrudedHeight=u,n._shadowVolume=m,n._offsetAttribute=p===-1?void 0:p,n):(qx.granularity=s,qx.height=a,qx.rotation=c,qx.stRotation=d,qx.extrudedHeight=u,qx.shadowVolume=m,qx.offsetAttribute=p===-1?void 0:p,new a0(qx))};a0.computeRectangle=function(e,t){e=e??B.EMPTY_OBJECT;let n=e.rectangle,i=e.granularity??W.RADIANS_PER_DEGREE,o=e.ellipsoid??ne.default,r=e.rotation??0;return wee(n,i,r,o,t)};var Uyt=new q,aCe=new Ne,Dyt=new pe;a0.createGeometry=function(e){if(W.equalsEpsilon(e._rectangle.north,e._rectangle.south,W.EPSILON10)||W.equalsEpsilon(e._rectangle.east,e._rectangle.west,W.EPSILON10))return;let t=e._rectangle,n=e._ellipsoid,i=e._rotation,o=e._stRotation,r=e._vertexFormat,s=Ca.computeOptions(t,e._granularity,i,o,mCe,bCe,kyt),a=Uyt;if(o!==0||i!==0){let b=re.center(t,Dyt),f=n.geodeticSurfaceNormalCartographic(b,Yee);Ne.fromAxisAngle(f,-o,aCe),q.fromQuaternion(aCe,a)}else q.clone(q.IDENTITY,a);let c=e._surfaceHeight,d=e._extrudedHeight,u=!W.equalsEpsilon(c,d,0,W.EPSILON2);s.lonScalar=1/e._rectangle.width,s.latScalar=1/e._rectangle.height,s.tangentRotationMatrix=a;let m,p;if(t=e._rectangle,u){m=Myt(e,s);let b=me.fromRectangle3D(t,n,c,Xyt),f=me.fromRectangle3D(t,n,d,Pyt);p=me.union(b,f)}else{if(m=pCe(e,s),m.attributes.position.values=hi.scaleToGeodeticHeight(m.attributes.position.values,c,n,!1),l(e._offsetAttribute)){let b=m.attributes.position.values.length,f=e._offsetAttribute===bn.NONE?0:1,y=new Uint8Array(b/3).fill(f);m.attributes.applyOffset=new Xe({componentDatatype:J.UNSIGNED_BYTE,componentsPerAttribute:1,values:y})}p=me.fromRectangle3D(t,n,c)}return r.position||delete m.attributes.position,new At({attributes:m.attributes,indices:m.indices,primitiveType:m.primitiveType,boundingSphere:p,offsetAttribute:e._offsetAttribute})};a0.createShadowVolume=function(e,t,n){let i=e._granularity,o=e._ellipsoid,r=t(i,o),s=n(i,o);return new a0({rectangle:e._rectangle,rotation:e._rotation,ellipsoid:o,stRotation:e._stRotation,granularity:i,extrudedHeight:s,height:r,vertexFormat:Me.POSITION_ONLY,shadowVolume:!0})};var cCe=new re,Oyt=[new k,new k,new k],Byt=new Ji,zyt=new pe;function Hyt(e){if(e._stRotation===0)return[0,0,0,1,1,0];let t=re.clone(e._rectangle,cCe),n=e._granularity,i=e._ellipsoid,o=e._rotation-e._stRotation,r=wee(t,n,o,i,cCe),s=Oyt;s[0].x=r.west,s[0].y=r.south,s[1].x=r.west,s[1].y=r.north,s[2].x=r.east,s[2].y=r.south;let a=e.rectangle,c=Ji.fromRotation(e._stRotation,Byt),d=re.center(a,zyt);for(let f=0;f<3;++f){let y=s[f];y.x-=d.longitude,y.y-=d.latitude,Ji.multiplyByVector(c,y,y),y.x+=d.longitude,y.y+=d.latitude,y.x=(y.x-a.west)/a.width,y.y=(y.y-a.south)/a.height}let u=s[0],m=s[1],p=s[2],b=new Array(6);return k.pack(u,b),k.pack(m,b,2),k.pack(p,b,4),b}Object.defineProperties(a0.prototype,{rectangle:{get:function(){return l(this._rotatedRectangle)||(this._rotatedRectangle=wee(this._rectangle,this._granularity,this._rotation,this._ellipsoid)),this._rotatedRectangle}},textureCoordinateRotationPoints:{get:function(){return l(this._textureCoordinateRotationPoints)||(this._textureCoordinateRotationPoints=Hyt(this)),this._textureCoordinateRotationPoints}}});var lZ=a0;var xCe=new U,TCe=h.ZERO,_Ce=new h,SCe=new re,Kyt=new re,Jyt=new pe;function jyt(e){this.id=e,this.vertexFormat=void 0,this.rectangle=void 0,this.height=void 0,this.extrudedHeight=void 0,this.granularity=void 0,this.stRotation=void 0,this.rotation=void 0,this.offsetAttribute=void 0}function Pf(e,t){ri.call(this,{entity:e,scene:t,geometryOptions:new jyt(e),geometryPropertyName:"rectangle",observedPropertyNames:["availability","rectangle"]}),this._onEntityPropertyChanged(e,"rectangle",e.rectangle,void 0)}l(Object.create)&&(Pf.prototype=Object.create(ri.prototype),Pf.prototype.constructor=Pf);Pf.prototype.createFillGeometryInstance=function(e){let t=this._entity,n=t.isAvailable(e),i={show:new Wn(n&&t.isShowing&&this._showProperty.getValue(e)&&this._fillProperty.getValue(e)),distanceDisplayCondition:ti.fromDistanceDisplayCondition(this._distanceDisplayConditionProperty.getValue(e)),offset:void 0,color:void 0};if(this._materialProperty instanceof Qt){let o;l(this._materialProperty.color)&&(this._materialProperty.color.isConstant||n)&&(o=this._materialProperty.color.getValue(e,xCe)),l(o)||(o=U.WHITE),i.color=$t.fromColor(o)}return l(this._options.offsetAttribute)&&(i.offset=Ro.fromCartesian3(j.getValueOrDefault(this._terrainOffsetProperty,e,TCe,_Ce))),new Yt({id:t,geometry:new lZ(this._options),attributes:i})};Pf.prototype.createOutlineGeometryInstance=function(e){let t=this._entity,n=t.isAvailable(e),i=j.getValueOrDefault(this._outlineColorProperty,e,U.BLACK,xCe),o=this._distanceDisplayConditionProperty.getValue(e),r={show:new Wn(n&&t.isShowing&&this._showProperty.getValue(e)&&this._showOutlineProperty.getValue(e)),color:$t.fromColor(i),distanceDisplayCondition:ti.fromDistanceDisplayCondition(o),offset:void 0};return l(this._options.offsetAttribute)&&(r.offset=Ro.fromCartesian3(j.getValueOrDefault(this._terrainOffsetProperty,e,TCe,_Ce))),new Yt({id:t,geometry:new wS(this._options),attributes:r})};Pf.prototype._computeCenter=function(e,t){let n=j.getValueOrUndefined(this._entity.rectangle.coordinates,e,Kyt);if(!l(n))return;let i=re.center(n,Jyt);return pe.toCartesian(i,ne.default,t)};Pf.prototype._isHidden=function(e,t){return!l(t.coordinates)||Wi.prototype._isHidden.call(this,e,t)};Pf.prototype._isDynamic=function(e,t){return!t.coordinates.isConstant||!j.isConstant(t.height)||!j.isConstant(t.extrudedHeight)||!j.isConstant(t.granularity)||!j.isConstant(t.stRotation)||!j.isConstant(t.rotation)||!j.isConstant(t.outlineWidth)||!j.isConstant(t.zIndex)||this._onTerrain&&!j.isConstant(this._materialProperty)&&!(this._materialProperty instanceof Qt)};Pf.prototype._setStaticOptions=function(e,t){let n=this._materialProperty instanceof Qt,i=j.getValueOrUndefined(t.height,ot.MINIMUM_VALUE),o=j.getValueOrDefault(t.heightReference,ot.MINIMUM_VALUE,He.NONE),r=j.getValueOrUndefined(t.extrudedHeight,ot.MINIMUM_VALUE),s=j.getValueOrDefault(t.extrudedHeightReference,ot.MINIMUM_VALUE,He.NONE);l(r)&&!l(i)&&(i=0);let a=this._options;a.vertexFormat=n?Tn.VERTEX_FORMAT:Co.MaterialSupport.TEXTURED.vertexFormat,a.rectangle=t.coordinates.getValue(ot.MINIMUM_VALUE,a.rectangle),a.granularity=j.getValueOrUndefined(t.granularity,ot.MINIMUM_VALUE),a.stRotation=j.getValueOrUndefined(t.stRotation,ot.MINIMUM_VALUE),a.rotation=j.getValueOrUndefined(t.rotation,ot.MINIMUM_VALUE),a.offsetAttribute=ri.computeGeometryOffsetAttribute(i,o,r,s),a.height=ri.getGeometryHeight(i,o),r=ri.getGeometryExtrudedHeight(r,s),r===ri.CLAMP_TO_GROUND&&(r=Pi.getMinimumMaximumHeights(lZ.computeRectangle(a,SCe)).minimumTerrainHeight),a.extrudedHeight=r};Pf.DynamicGeometryUpdater=qV;function qV(e,t,n){Li.call(this,e,t,n)}l(Object.create)&&(qV.prototype=Object.create(Li.prototype),qV.prototype.constructor=qV);qV.prototype._isHidden=function(e,t,n){return!l(this._options.rectangle)||Li.prototype._isHidden.call(this,e,t,n)};qV.prototype._setOptions=function(e,t,n){let i=this._options,o=j.getValueOrUndefined(t.height,n),r=j.getValueOrDefault(t.heightReference,n,He.NONE),s=j.getValueOrUndefined(t.extrudedHeight,n),a=j.getValueOrDefault(t.extrudedHeightReference,n,He.NONE);l(s)&&!l(o)&&(o=0),i.rectangle=j.getValueOrUndefined(t.coordinates,n,i.rectangle),i.granularity=j.getValueOrUndefined(t.granularity,n),i.stRotation=j.getValueOrUndefined(t.stRotation,n),i.rotation=j.getValueOrUndefined(t.rotation,n),i.offsetAttribute=ri.computeGeometryOffsetAttribute(o,r,s,a),i.height=ri.getGeometryHeight(o,r),s=ri.getGeometryExtrudedHeight(s,a),s===ri.CLAMP_TO_GROUND&&(s=Pi.getMinimumMaximumHeights(lZ.computeRectangle(i,SCe)).minimumTerrainHeight),i.extrudedHeight=s};var nM=Pf;var dDi=x(T(),1);var v5i=x(T(),1);var b5i=x(T(),1);var ZCe={};function Qyt(e,t){return W.equalsEpsilon(e.latitude,t.latitude,W.EPSILON10)&&W.equalsEpsilon(e.longitude,t.longitude,W.EPSILON10)}var qyt=new pe,$yt=new pe;function ext(e,t,n,i){t=Yo(t,h.equalsEpsilon);let o=t.length;if(o<2)return;let r=l(i),s=l(n),a=new Array(o),c=new Array(o),d=new Array(o),u=t[0];a[0]=u;let m=e.cartesianToCartographic(u,qyt);s&&(m.height=n[0]),c[0]=m.height,r?d[0]=i[0]:d[0]=0;let p=c[0],b=d[0],f=p===b,y=1;for(let _=1;_<o;++_){let S=t[_],Z=e.cartesianToCartographic(S,$yt);s&&(Z.height=n[_]),f=f&&Z.height===0,Qyt(m,Z)?m.height<Z.height&&(c[y-1]=Z.height):(a[y]=S,c[y]=Z.height,r?d[y]=i[_]:d[y]=0,f=f&&c[y]===d[y],pe.clone(Z,m),++y)}if(!(f||y<2))return a.length=y,c.length=y,d.length=y,{positions:a,topHeights:c,bottomHeights:d}}var txt=new Array(2),nxt=new Array(2),ixt={positions:void 0,height:void 0,granularity:void 0,ellipsoid:void 0};ZCe.computePositions=function(e,t,n,i,o,r){let s=ext(e,t,n,i);if(!l(s))return;t=s.positions,n=s.topHeights,i=s.bottomHeights;let a=t.length,c=a-2,d,u,m=W.chordLength(o,e.maximumRadius),p=ixt;if(p.minDistance=m,p.ellipsoid=e,r){let b=0,f;for(f=0;f<a-1;f++)b+=oo.numberOfPoints(t[f],t[f+1],m)+1;d=new Float64Array(b*3),u=new Float64Array(b*3);let y=txt,_=nxt;p.positions=y,p.height=_;let S=0;for(f=0;f<a-1;f++){y[0]=t[f],y[1]=t[f+1],_[0]=n[f],_[1]=n[f+1];let Z=oo.generateArc(p);d.set(Z,S),_[0]=i[f],_[1]=i[f+1],u.set(oo.generateArc(p),S),S+=Z.length}}else p.positions=t,p.height=n,d=new Float64Array(oo.generateArc(p)),p.height=i,u=new Float64Array(oo.generateArc(p));return{bottomPositions:u,topPositions:d,numCorners:c}};var dZ=ZCe;var kee=new h,G3=new h,oxt=new h,RCe=new h,rxt=new h,sxt=new h,axt=new h;function uZ(e){e=e??B.EMPTY_OBJECT;let t=e.positions,n=e.maximumHeights,i=e.minimumHeights,o=e.vertexFormat??Me.DEFAULT,r=e.granularity??W.RADIANS_PER_DEGREE,s=e.ellipsoid??ne.default;this._positions=t,this._minimumHeights=i,this._maximumHeights=n,this._vertexFormat=Me.clone(o),this._granularity=r,this._ellipsoid=ne.clone(s),this._workerName="createWallGeometry";let a=1+t.length*h.packedLength+2;l(i)&&(a+=i.length),l(n)&&(a+=n.length),this.packedLength=a+ne.packedLength+Me.packedLength+1}uZ.pack=function(e,t,n){n=n??0;let i,o=e._positions,r=o.length;for(t[n++]=r,i=0;i<r;++i,n+=h.packedLength)h.pack(o[i],t,n);let s=e._minimumHeights;if(r=l(s)?s.length:0,t[n++]=r,l(s))for(i=0;i<r;++i)t[n++]=s[i];let a=e._maximumHeights;if(r=l(a)?a.length:0,t[n++]=r,l(a))for(i=0;i<r;++i)t[n++]=a[i];return ne.pack(e._ellipsoid,t,n),n+=ne.packedLength,Me.pack(e._vertexFormat,t,n),n+=Me.packedLength,t[n]=e._granularity,t};var CCe=ne.clone(ne.UNIT_SPHERE),VCe=new Me,iM={positions:void 0,minimumHeights:void 0,maximumHeights:void 0,ellipsoid:CCe,vertexFormat:VCe,granularity:void 0};uZ.unpack=function(e,t,n){t=t??0;let i,o=e[t++],r=new Array(o);for(i=0;i<o;++i,t+=h.packedLength)r[i]=h.unpack(e,t);o=e[t++];let s;if(o>0)for(s=new Array(o),i=0;i<o;++i)s[i]=e[t++];o=e[t++];let a;if(o>0)for(a=new Array(o),i=0;i<o;++i)a[i]=e[t++];let c=ne.unpack(e,t,CCe);t+=ne.packedLength;let d=Me.unpack(e,t,VCe);t+=Me.packedLength;let u=e[t];return l(n)?(n._positions=r,n._minimumHeights=s,n._maximumHeights=a,n._ellipsoid=ne.clone(c,n._ellipsoid),n._vertexFormat=Me.clone(d,n._vertexFormat),n._granularity=u,n):(iM.positions=r,iM.minimumHeights=s,iM.maximumHeights=a,iM.granularity=u,new uZ(iM))};uZ.fromConstantHeights=function(e){e=e??B.EMPTY_OBJECT;let t=e.positions,n,i,o=e.minimumHeight,r=e.maximumHeight,s=l(o),a=l(r);if(s||a){let d=t.length;n=s?new Array(d):void 0,i=a?new Array(d):void 0;for(let u=0;u<d;++u)s&&(n[u]=o),a&&(i[u]=r)}let c={positions:t,maximumHeights:i,minimumHeights:n,ellipsoid:e.ellipsoid,vertexFormat:e.vertexFormat};return new uZ(c)};uZ.createGeometry=function(e){let t=e._positions,n=e._minimumHeights,i=e._maximumHeights,o=e._vertexFormat,r=e._granularity,s=e._ellipsoid,a=dZ.computePositions(s,t,i,n,r,!0);if(!l(a))return;let c=a.bottomPositions,d=a.topPositions,u=a.numCorners,m=d.length,p=m*2,b=o.position?new Float64Array(p):void 0,f=o.normal?new Float32Array(p):void 0,y=o.tangent?new Float32Array(p):void 0,_=o.bitangent?new Float32Array(p):void 0,S=o.st?new Float32Array(p/3*2):void 0,Z=0,R=0,C=0,E=0,A=0,L=axt,F=sxt,I=rxt,N=!0;m/=3;let g,V=0,G=1/(m-u-1);for(g=0;g<m;++g){let M=g*3,O=h.fromArray(d,M,kee),w=h.fromArray(c,M,G3);if(o.position&&(b[Z++]=w.x,b[Z++]=w.y,b[Z++]=w.z,b[Z++]=O.x,b[Z++]=O.y,b[Z++]=O.z),o.st&&(S[A++]=V,S[A++]=0,S[A++]=V,S[A++]=1),o.normal||o.tangent||o.bitangent){let z=h.clone(h.ZERO,RCe),K=h.subtract(O,s.geodeticSurfaceNormal(O,G3),G3);if(g+1<m&&(z=h.fromArray(d,M+3,RCe)),N){let te=h.subtract(z,O,oxt),H=h.subtract(K,O,kee);L=h.normalize(h.cross(H,te,L),L),N=!1}h.equalsEpsilon(O,z,W.EPSILON10)?N=!0:(V+=G,o.tangent&&(F=h.normalize(h.subtract(z,O,F),F)),o.bitangent&&(I=h.normalize(h.cross(L,F,I),I))),o.normal&&(f[R++]=L.x,f[R++]=L.y,f[R++]=L.z,f[R++]=L.x,f[R++]=L.y,f[R++]=L.z),o.tangent&&(y[E++]=F.x,y[E++]=F.y,y[E++]=F.z,y[E++]=F.x,y[E++]=F.y,y[E++]=F.z),o.bitangent&&(_[C++]=I.x,_[C++]=I.y,_[C++]=I.z,_[C++]=I.x,_[C++]=I.y,_[C++]=I.z)}}let v=new Rn;o.position&&(v.position=new Xe({componentDatatype:J.DOUBLE,componentsPerAttribute:3,values:b})),o.normal&&(v.normal=new Xe({componentDatatype:J.FLOAT,componentsPerAttribute:3,values:f})),o.tangent&&(v.tangent=new Xe({componentDatatype:J.FLOAT,componentsPerAttribute:3,values:y})),o.bitangent&&(v.bitangent=new Xe({componentDatatype:J.FLOAT,componentsPerAttribute:3,values:_})),o.st&&(v.st=new Xe({componentDatatype:J.FLOAT,componentsPerAttribute:2,values:S}));let X=p/3;p-=6*(u+1);let Y=Oe.createTypedArray(X,p),D=0;for(g=0;g<X-2;g+=2){let M=g,O=g+2,w=h.fromArray(b,M*3,kee),z=h.fromArray(b,O*3,G3);if(h.equalsEpsilon(w,z,W.EPSILON10))continue;let K=g+1,te=g+3;Y[D++]=K,Y[D++]=M,Y[D++]=te,Y[D++]=te,Y[D++]=M,Y[D++]=O}return new At({attributes:v,indices:Y,primitiveType:Ie.TRIANGLES,boundingSphere:me.fromVertices(b)})};var oM=uZ;var H5i=x(T(),1);var ECe=new h,ACe=new h;function mZ(e){e=e??B.EMPTY_OBJECT;let t=e.positions,n=e.maximumHeights,i=e.minimumHeights,o=e.granularity??W.RADIANS_PER_DEGREE,r=e.ellipsoid??ne.default;this._positions=t,this._minimumHeights=i,this._maximumHeights=n,this._granularity=o,this._ellipsoid=ne.clone(r),this._workerName="createWallOutlineGeometry";let s=1+t.length*h.packedLength+2;l(i)&&(s+=i.length),l(n)&&(s+=n.length),this.packedLength=s+ne.packedLength+1}mZ.pack=function(e,t,n){n=n??0;let i,o=e._positions,r=o.length;for(t[n++]=r,i=0;i<r;++i,n+=h.packedLength)h.pack(o[i],t,n);let s=e._minimumHeights;if(r=l(s)?s.length:0,t[n++]=r,l(s))for(i=0;i<r;++i)t[n++]=s[i];let a=e._maximumHeights;if(r=l(a)?a.length:0,t[n++]=r,l(a))for(i=0;i<r;++i)t[n++]=a[i];return ne.pack(e._ellipsoid,t,n),n+=ne.packedLength,t[n]=e._granularity,t};var GCe=ne.clone(ne.UNIT_SPHERE),rM={positions:void 0,minimumHeights:void 0,maximumHeights:void 0,ellipsoid:GCe,granularity:void 0};mZ.unpack=function(e,t,n){t=t??0;let i,o=e[t++],r=new Array(o);for(i=0;i<o;++i,t+=h.packedLength)r[i]=h.unpack(e,t);o=e[t++];let s;if(o>0)for(s=new Array(o),i=0;i<o;++i)s[i]=e[t++];o=e[t++];let a;if(o>0)for(a=new Array(o),i=0;i<o;++i)a[i]=e[t++];let c=ne.unpack(e,t,GCe);t+=ne.packedLength;let d=e[t];return l(n)?(n._positions=r,n._minimumHeights=s,n._maximumHeights=a,n._ellipsoid=ne.clone(c,n._ellipsoid),n._granularity=d,n):(rM.positions=r,rM.minimumHeights=s,rM.maximumHeights=a,rM.granularity=d,new mZ(rM))};mZ.fromConstantHeights=function(e){e=e??B.EMPTY_OBJECT;let t=e.positions,n,i,o=e.minimumHeight,r=e.maximumHeight,s=l(o),a=l(r);if(s||a){let d=t.length;n=s?new Array(d):void 0,i=a?new Array(d):void 0;for(let u=0;u<d;++u)s&&(n[u]=o),a&&(i[u]=r)}let c={positions:t,maximumHeights:i,minimumHeights:n,ellipsoid:e.ellipsoid};return new mZ(c)};mZ.createGeometry=function(e){let t=e._positions,n=e._minimumHeights,i=e._maximumHeights,o=e._granularity,r=e._ellipsoid,s=dZ.computePositions(r,t,i,n,o,!1);if(!l(s))return;let a=s.bottomPositions,c=s.topPositions,d=c.length,u=d*2,m=new Float64Array(u),p=0;d/=3;let b;for(b=0;b<d;++b){let Z=b*3,R=h.fromArray(c,Z,ECe),C=h.fromArray(a,Z,ACe);m[p++]=C.x,m[p++]=C.y,m[p++]=C.z,m[p++]=R.x,m[p++]=R.y,m[p++]=R.z}let f=new Rn({position:new Xe({componentDatatype:J.DOUBLE,componentsPerAttribute:3,values:m})}),y=u/3;u=2*y-4+y;let _=Oe.createTypedArray(y,u),S=0;for(b=0;b<y-2;b+=2){let Z=b,R=b+2,C=h.fromArray(m,Z*3,ECe),E=h.fromArray(m,R*3,ACe);if(h.equalsEpsilon(C,E,W.EPSILON10))continue;let A=b+1,L=b+3;_[S++]=A,_[S++]=Z,_[S++]=A,_[S++]=L,_[S++]=Z,_[S++]=R}return _[S++]=y-2,_[S]=y-1,new At({attributes:f,indices:_,primitiveType:Ie.LINES,boundingSphere:me.fromVertices(m)})};var sM=mZ;var LCe=new U;function cxt(e){this.id=e,this.vertexFormat=void 0,this.positions=void 0,this.minimumHeights=void 0,this.maximumHeights=void 0,this.granularity=void 0}function Xf(e,t){Wi.call(this,{entity:e,scene:t,geometryOptions:new cxt(e),geometryPropertyName:"wall",observedPropertyNames:["availability","wall"]}),this._onEntityPropertyChanged(e,"wall",e.wall,void 0)}l(Object.create)&&(Xf.prototype=Object.create(Wi.prototype),Xf.prototype.constructor=Xf);Xf.prototype.createFillGeometryInstance=function(e){let t=this._entity,n=t.isAvailable(e),i,o,r=new Wn(n&&t.isShowing&&this._showProperty.getValue(e)&&this._fillProperty.getValue(e)),s=this._distanceDisplayConditionProperty.getValue(e),a=ti.fromDistanceDisplayCondition(s);if(this._materialProperty instanceof Qt){let c;l(this._materialProperty.color)&&(this._materialProperty.color.isConstant||n)&&(c=this._materialProperty.color.getValue(e,LCe)),l(c)||(c=U.WHITE),o=$t.fromColor(c),i={show:r,distanceDisplayCondition:a,color:o}}else i={show:r,distanceDisplayCondition:a};return new Yt({id:t,geometry:new oM(this._options),attributes:i})};Xf.prototype.createOutlineGeometryInstance=function(e){let t=this._entity,n=t.isAvailable(e),i=j.getValueOrDefault(this._outlineColorProperty,e,U.BLACK,LCe),o=this._distanceDisplayConditionProperty.getValue(e);return new Yt({id:t,geometry:new sM(this._options),attributes:{show:new Wn(n&&t.isShowing&&this._showProperty.getValue(e)&&this._showOutlineProperty.getValue(e)),color:$t.fromColor(i),distanceDisplayCondition:ti.fromDistanceDisplayCondition(o)}})};Xf.prototype._isHidden=function(e,t){return!l(t.positions)||Wi.prototype._isHidden.call(this,e,t)};Xf.prototype._getIsClosed=function(e){return!1};Xf.prototype._isDynamic=function(e,t){return!t.positions.isConstant||!j.isConstant(t.minimumHeights)||!j.isConstant(t.maximumHeights)||!j.isConstant(t.outlineWidth)||!j.isConstant(t.granularity)};Xf.prototype._setStaticOptions=function(e,t){let n=t.minimumHeights,i=t.maximumHeights,o=t.granularity,r=this._materialProperty instanceof Qt,s=this._options;s.vertexFormat=r?Tn.VERTEX_FORMAT:Co.MaterialSupport.TEXTURED.vertexFormat,s.positions=t.positions.getValue(ot.MINIMUM_VALUE,s.positions),s.minimumHeights=l(n)?n.getValue(ot.MINIMUM_VALUE,s.minimumHeights):void 0,s.maximumHeights=l(i)?i.getValue(ot.MINIMUM_VALUE,s.maximumHeights):void 0,s.granularity=l(o)?o.getValue(ot.MINIMUM_VALUE):void 0};Xf.DynamicGeometryUpdater=$V;function $V(e,t,n){Li.call(this,e,t,n)}l(Object.create)&&($V.prototype=Object.create(Li.prototype),$V.prototype.constructor=$V);$V.prototype._isHidden=function(e,t,n){return!l(this._options.positions)||Li.prototype._isHidden.call(this,e,t,n)};$V.prototype._setOptions=function(e,t,n){let i=this._options;i.positions=j.getValueOrUndefined(t.positions,n,i.positions),i.minimumHeights=j.getValueOrUndefined(t.minimumHeights,n,i.minimumHeights),i.maximumHeights=j.getValueOrUndefined(t.maximumHeights,n,i.maximumHeights),i.granularity=j.getValueOrUndefined(t.granularity,n)};var aM=Xf;var hZ=[VF,VY,xY,MY,kY,OY,KY,tM,nM,aM];function fZ(e,t){this.entity=e,this.scene=t;let n=new Array(hZ.length),i=new Se,o=new Hr;for(let r=0;r<n.length;r++){let s=new hZ[r](e,t);o.add(s.geometryChanged,a=>{i.raiseEvent(a)}),n[r]=s}this.updaters=n,this.geometryChanged=i,this.eventHelper=o,this._removeEntitySubscription=e.definitionChanged.addEventListener(fZ.prototype._onEntityPropertyChanged,this)}fZ.prototype._onEntityPropertyChanged=function(e,t,n,i){let o=this.updaters;for(let r=0;r<o.length;r++)o[r]._onEntityPropertyChanged(e,t,n,i)};fZ.prototype.forEach=function(e){let t=this.updaters;for(let n=0;n<t.length;n++)e(t[n])};fZ.prototype.destroy=function(){this.eventHelper.removeAll();let e=this.updaters;for(let t=0;t<e.length;t++)e[t].destroy();this._removeEntitySubscription(),ue(this)};fZ.registerUpdater=function(e){hZ.includes(e)||hZ.push(e)};fZ.unregisterUpdater=function(e){if(hZ.includes(e)){let t=hZ.indexOf(e);hZ.splice(t,1)}};var pZ=fZ;var kDi=x(T(),1);var WCe=new U,lxt=new Bt,dxt=new Bt,uxt=h.ZERO,mxt=new h;function Nf(e,t,n,i,o,r,s){this.translucent=t,this.appearanceType=n,this.depthFailAppearanceType=i,this.depthFailMaterialProperty=o,this.depthFailMaterial=void 0,this.closed=r,this.shadows=s,this.primitives=e,this.createPrimitive=!1,this.waitingOnCreate=!1,this.primitive=void 0,this.oldPrimitive=void 0,this.geometry=new kt,this.updaters=new kt,this.updatersWithAttributes=new kt,this.attributes=new kt,this.subscriptions=new kt,this.showsUpdated=new kt,this.itemsToRemove=[],this.invalidated=!1;let a;l(o)&&(a=o.definitionChanged.addEventListener(Nf.prototype.onMaterialChanged,this)),this.removeMaterialSubscription=a}Nf.prototype.onMaterialChanged=function(){this.invalidated=!0};Nf.prototype.isMaterial=function(e){let t=this.depthFailMaterialProperty,n=e.depthFailMaterialProperty;return n===t?!0:l(t)?t.equals(n):!1};Nf.prototype.add=function(e,t){let n=e.id;if(this.createPrimitive=!0,this.geometry.set(n,t),this.updaters.set(n,e),!e.hasConstantFill||!e.fillMaterialProperty.isConstant||!j.isConstant(e.distanceDisplayConditionProperty)||!j.isConstant(e.terrainOffsetProperty))this.updatersWithAttributes.set(n,e);else{let i=this;this.subscriptions.set(n,e.entity.definitionChanged.addEventListener(function(o,r,s,a){r==="isShowing"&&i.showsUpdated.set(e.id,e)}))}};Nf.prototype.remove=function(e){let t=e.id;if(this.createPrimitive=this.geometry.remove(t)||this.createPrimitive,this.updaters.remove(t)){this.updatersWithAttributes.remove(t);let n=this.subscriptions.get(t);return l(n)&&(n(),this.subscriptions.remove(t),this.showsUpdated.remove(t)),!0}return!1};Nf.prototype.update=function(e){let t=!0,n=0,i=this.primitive,o=this.primitives,r;if(this.createPrimitive){let s=this.geometry.values;if(s.length>0){l(i)&&(l(this.oldPrimitive)?o.remove(i):this.oldPrimitive=i);let c;if(l(this.depthFailAppearanceType)){l(this.depthFailMaterialProperty)&&(this.depthFailMaterial=yr.getValue(e,this.depthFailMaterialProperty,this.depthFailMaterial));let u=this.depthFailAppearanceType;c=new u({material:this.depthFailMaterial,translucent:this.translucent,closed:this.closed})}let d=this.appearanceType;i=new In({show:!1,asynchronous:!0,geometryInstances:s.slice(),appearance:new d({translucent:this.translucent,closed:this.closed}),depthFailAppearance:c,shadows:this.shadows}),o.add(i),t=!1}else{l(i)&&(o.remove(i),i=void 0);let c=this.oldPrimitive;l(c)&&(o.remove(c),this.oldPrimitive=void 0)}this.attributes.removeAll(),this.primitive=i,this.createPrimitive=!1,this.waitingOnCreate=!0}else if(l(i)&&i.ready){i.show=!0,l(this.oldPrimitive)&&(o.remove(this.oldPrimitive),this.oldPrimitive=void 0),l(this.depthFailAppearanceType)&&!(this.depthFailMaterialProperty instanceof Qt)&&(this.depthFailMaterial=yr.getValue(e,this.depthFailMaterialProperty,this.depthFailMaterial),this.primitive.depthFailAppearance.material=this.depthFailMaterial);let s=this.updatersWithAttributes.values,a=s.length,c=this.waitingOnCreate;for(r=0;r<a;r++){let d=s[r],u=this.geometry.get(d.id),m=this.attributes.get(u.id.id);if(l(m)||(m=i.getGeometryInstanceAttributes(u.id),this.attributes.set(u.id.id,m)),!d.fillMaterialProperty.isConstant||c){let _=d.fillMaterialProperty.color,S=j.getValueOrDefault(_,e,U.WHITE,WCe);U.equals(m._lastColor,S)||(m._lastColor=U.clone(S,m._lastColor),m.color=$t.toValue(S,m.color),(this.translucent&&m.color[3]===255||!this.translucent&&m.color[3]!==255)&&(this.itemsToRemove[n++]=d))}if(l(this.depthFailAppearanceType)&&d.depthFailMaterialProperty instanceof Qt&&(!d.depthFailMaterialProperty.isConstant||c)){let _=d.depthFailMaterialProperty.color,S=j.getValueOrDefault(_,e,U.WHITE,WCe);U.equals(m._lastDepthFailColor,S)||(m._lastDepthFailColor=U.clone(S,m._lastDepthFailColor),m.depthFailColor=$t.toValue(S,m.depthFailColor))}let p=d.entity.isShowing&&(d.hasConstantFill||d.isFilled(e)),b=m.show[0]===1;p!==b&&(m.show=Wn.toValue(p,m.show));let f=d.distanceDisplayConditionProperty;if(!j.isConstant(f)){let _=j.getValueOrDefault(f,e,dxt,lxt);Bt.equals(_,m._lastDistanceDisplayCondition)||(m._lastDistanceDisplayCondition=Bt.clone(_,m._lastDistanceDisplayCondition),m.distanceDisplayCondition=ti.toValue(_,m.distanceDisplayCondition))}let y=d.terrainOffsetProperty;if(!j.isConstant(y)){let _=j.getValueOrDefault(y,e,uxt,mxt);h.equals(_,m._lastOffset)||(m._lastOffset=h.clone(_,m._lastOffset),m.offset=Ro.toValue(_,m.offset))}}this.updateShows(i),this.waitingOnCreate=!1}else l(i)&&!i.ready&&(t=!1);return this.itemsToRemove.length=n,t};Nf.prototype.updateShows=function(e){let t=this.showsUpdated.values,n=t.length;for(let i=0;i<n;i++){let o=t[i],r=this.geometry.get(o.id),s=this.attributes.get(r.id.id);l(s)||(s=e.getGeometryInstanceAttributes(r.id),this.attributes.set(r.id.id,s));let a=o.entity.isShowing,c=s.show[0]===1;a!==c&&(s.show=Wn.toValue(a,s.show),r.attributes.show.value[0]=s.show[0])}this.showsUpdated.removeAll()};Nf.prototype.contains=function(e){return this.updaters.contains(e.id)};Nf.prototype.getBoundingSphere=function(e,t){let n=this.primitive;if(!n.ready)return Wt.PENDING;let i=n.getGeometryInstanceAttributes(e.entity);return!l(i)||!l(i.boundingSphere)||l(i.show)&&i.show[0]===0?Wt.FAILED:(i.boundingSphere.clone(t),Wt.DONE)};Nf.prototype.destroy=function(){let e=this.primitive,t=this.primitives;l(e)&&t.remove(e);let n=this.oldPrimitive;l(n)&&t.remove(n),l(this.removeMaterialSubscription)&&this.removeMaterialSubscription()};function eE(e,t,n,i,o){this._solidItems=[],this._translucentItems=[],this._primitives=e,this._appearanceType=t,this._depthFailAppearanceType=n,this._closed=i,this._shadows=o}eE.prototype.add=function(e,t){let n,i,o=t.createFillGeometryInstance(e);o.attributes.color.value[3]===255?(n=this._solidItems,i=!1):(n=this._translucentItems,i=!0);let r=n.length;for(let a=0;a<r;a++){let c=n[a];if(c.isMaterial(t)){c.add(t,o);return}}let s=new Nf(this._primitives,i,this._appearanceType,this._depthFailAppearanceType,t.depthFailMaterialProperty,this._closed,this._shadows);s.add(t,o),n.push(s)};function vCe(e,t){let n=e.length;for(let i=n-1;i>=0;i--){let o=e[i];if(o.remove(t))return o.updaters.length===0&&(e.splice(i,1),o.destroy()),!0}return!1}eE.prototype.remove=function(e){vCe(this._solidItems,e)||vCe(this._translucentItems,e)};function FCe(e,t,n){let i=!1,o=t.length;for(let r=0;r<o;++r){let s=t[r],a=s.itemsToRemove,c=a.length;if(c>0)for(r=0;r<c;r++){let d=a[r];s.remove(d),e.add(n,d),i=!0}}return i}function L3(e,t,n,i){let o=t.length,r;for(r=o-1;r>=0;r--){let s=t[r];if(s.invalidated){t.splice(r,1);let a=s.updaters.values,c=a.length;for(let d=0;d<c;d++)e.add(n,a[d]);s.destroy()}}for(o=t.length,r=0;r<o;++r)i=t[r].update(n)&&i;return i}eE.prototype.update=function(e){let t=L3(this,this._solidItems,e,!0);t=L3(this,this._translucentItems,e,t)&&t;let n=FCe(this,this._solidItems,e),i=FCe(this,this._translucentItems,e);return(n||i)&&(t=L3(this,this._solidItems,e,t)&&t,t=L3(this,this._translucentItems,e,t)&&t),t};function ICe(e,t,n){let i=e.length;for(let o=0;o<i;o++){let r=e[o];if(r.contains(t))return r.getBoundingSphere(t,n)}return Wt.FAILED}eE.prototype.getBoundingSphere=function(e,t){let n=ICe(this._solidItems,e,t);return n===Wt.FAILED?ICe(this._translucentItems,e,t):n};function PCe(e){let t=e.length;for(let n=0;n<t;n++)e[n].destroy();e.length=0}eE.prototype.removeAllPrimitives=function(){PCe(this._solidItems),PCe(this._translucentItems)};var lh=eE;var iOi=x(T(),1);var hxt=new Bt,fxt=new Bt,pxt=h.ZERO,bxt=new h;function Yf(e,t,n,i,o,r,s){this.primitives=e,this.appearanceType=t,this.materialProperty=n,this.depthFailAppearanceType=i,this.depthFailMaterialProperty=o,this.closed=r,this.shadows=s,this.updaters=new kt,this.createPrimitive=!0,this.primitive=void 0,this.oldPrimitive=void 0,this.geometry=new kt,this.material=void 0,this.depthFailMaterial=void 0,this.updatersWithAttributes=new kt,this.attributes=new kt,this.invalidated=!1,this.removeMaterialSubscription=n.definitionChanged.addEventListener(Yf.prototype.onMaterialChanged,this),this.subscriptions=new kt,this.showsUpdated=new kt}Yf.prototype.onMaterialChanged=function(){this.invalidated=!0};Yf.prototype.isMaterial=function(e){let t=this.materialProperty,n=e.fillMaterialProperty,i=this.depthFailMaterialProperty,o=e.depthFailMaterialProperty;if(n===t&&o===i)return!0;let r=l(t)&&t.equals(n);return r=(!l(i)&&!l(o)||l(i)&&i.equals(o))&&r,r};Yf.prototype.add=function(e,t){let n=t.id;if(this.updaters.set(n,t),this.geometry.set(n,t.createFillGeometryInstance(e)),!t.hasConstantFill||!t.fillMaterialProperty.isConstant||!j.isConstant(t.distanceDisplayConditionProperty)||!j.isConstant(t.terrainOffsetProperty))this.updatersWithAttributes.set(n,t);else{let i=this;this.subscriptions.set(n,t.entity.definitionChanged.addEventListener(function(o,r,s,a){r==="isShowing"&&i.showsUpdated.set(t.id,t)}))}this.createPrimitive=!0};Yf.prototype.remove=function(e){let t=e.id;if(this.createPrimitive=this.geometry.remove(t)||this.createPrimitive,this.updaters.remove(t)){this.updatersWithAttributes.remove(t);let n=this.subscriptions.get(t);return l(n)&&(n(),this.subscriptions.remove(t),this.showsUpdated.remove(t)),!0}return!1};var gxt=new U;Yf.prototype.update=function(e){let t=!0,n=this.primitive,i=this.primitives,o=this.geometry.values,r;if(this.createPrimitive){if(o.length>0){l(n)&&(l(this.oldPrimitive)?i.remove(n):this.oldPrimitive=n),this.material=yr.getValue(e,this.materialProperty,this.material);let a;if(l(this.depthFailMaterialProperty)){this.depthFailMaterial=yr.getValue(e,this.depthFailMaterialProperty,this.depthFailMaterial);let d=this.depthFailAppearanceType;a=new d({material:this.depthFailMaterial,translucent:this.depthFailMaterial.isTranslucent(),closed:this.closed})}let c=this.appearanceType;n=new In({show:!1,asynchronous:!0,geometryInstances:o.slice(),appearance:new c({material:this.material,translucent:this.material.isTranslucent(),closed:this.closed}),depthFailAppearance:a,shadows:this.shadows}),i.add(n),t=!1}else{l(n)&&(i.remove(n),n=void 0);let a=this.oldPrimitive;l(a)&&(i.remove(a),this.oldPrimitive=void 0)}this.attributes.removeAll(),this.primitive=n,this.createPrimitive=!1}else if(l(n)&&n.ready){n.show=!0,l(this.oldPrimitive)&&(i.remove(this.oldPrimitive),this.oldPrimitive=void 0),this.material=yr.getValue(e,this.materialProperty,this.material),this.primitive.appearance.material=this.material,l(this.depthFailAppearanceType)&&!(this.depthFailMaterialProperty instanceof Qt)&&(this.depthFailMaterial=yr.getValue(e,this.depthFailMaterialProperty,this.depthFailMaterial),this.primitive.depthFailAppearance.material=this.depthFailMaterial);let s=this.updatersWithAttributes.values,a=s.length;for(r=0;r<a;r++){let c=s[r],d=c.entity,u=this.geometry.get(c.id),m=this.attributes.get(u.id.id);if(l(m)||(m=n.getGeometryInstanceAttributes(u.id),this.attributes.set(u.id.id,m)),l(this.depthFailAppearanceType)&&this.depthFailMaterialProperty instanceof Qt&&!c.depthFailMaterialProperty.isConstant){let _=c.depthFailMaterialProperty.color,S=j.getValueOrDefault(_,e,U.WHITE,gxt);U.equals(m._lastDepthFailColor,S)||(m._lastDepthFailColor=U.clone(S,m._lastDepthFailColor),m.depthFailColor=$t.toValue(S,m.depthFailColor))}let p=d.isShowing&&(c.hasConstantFill||c.isFilled(e)),b=m.show[0]===1;p!==b&&(m.show=Wn.toValue(p,m.show));let f=c.distanceDisplayConditionProperty;if(!j.isConstant(f)){let _=j.getValueOrDefault(f,e,fxt,hxt);Bt.equals(_,m._lastDistanceDisplayCondition)||(m._lastDistanceDisplayCondition=Bt.clone(_,m._lastDistanceDisplayCondition),m.distanceDisplayCondition=ti.toValue(_,m.distanceDisplayCondition))}let y=c.terrainOffsetProperty;if(!j.isConstant(y)){let _=j.getValueOrDefault(y,e,pxt,bxt);h.equals(_,m._lastOffset)||(m._lastOffset=h.clone(_,m._lastOffset),m.offset=Ro.toValue(_,m.offset))}}this.updateShows(n)}else l(n)&&!n.ready&&(t=!1);return t};Yf.prototype.updateShows=function(e){let t=this.showsUpdated.values,n=t.length;for(let i=0;i<n;i++){let o=t[i],r=o.entity,s=this.geometry.get(o.id),a=this.attributes.get(s.id.id);l(a)||(a=e.getGeometryInstanceAttributes(s.id),this.attributes.set(s.id.id,a));let c=r.isShowing,d=a.show[0]===1;c!==d&&(a.show=Wn.toValue(c,a.show),s.attributes.show.value[0]=a.show[0])}this.showsUpdated.removeAll()};Yf.prototype.contains=function(e){return this.updaters.contains(e.id)};Yf.prototype.getBoundingSphere=function(e,t){let n=this.primitive;if(!n.ready)return Wt.PENDING;let i=n.getGeometryInstanceAttributes(e.entity);return!l(i)||!l(i.boundingSphere)||l(i.show)&&i.show[0]===0?Wt.FAILED:(i.boundingSphere.clone(t),Wt.DONE)};Yf.prototype.destroy=function(){let e=this.primitive,t=this.primitives;l(e)&&t.remove(e);let n=this.oldPrimitive;l(n)&&t.remove(n),this.removeMaterialSubscription()};function tE(e,t,n,i,o){this._items=[],this._primitives=e,this._appearanceType=t,this._depthFailAppearanceType=n,this._closed=i,this._shadows=o}tE.prototype.add=function(e,t){let n=this._items,i=n.length;for(let r=0;r<i;r++){let s=n[r];if(s.isMaterial(t)){s.add(e,t);return}}let o=new Yf(this._primitives,this._appearanceType,t.fillMaterialProperty,this._depthFailAppearanceType,t.depthFailMaterialProperty,this._closed,this._shadows);o.add(e,t),n.push(o)};tE.prototype.remove=function(e){let t=this._items,n=t.length;for(let i=n-1;i>=0;i--){let o=t[i];if(o.remove(e)){o.updaters.length===0&&(t.splice(i,1),o.destroy());break}}};tE.prototype.update=function(e){let t,n=this._items,i=n.length;for(t=i-1;t>=0;t--){let r=n[t];if(r.invalidated){n.splice(t,1);let s=r.updaters.values,a=s.length;for(let c=0;c<a;c++)this.add(e,s[c]);r.destroy()}}let o=!0;for(t=0;t<n.length;t++)o=n[t].update(e)&&o;return o};tE.prototype.getBoundingSphere=function(e,t){let n=this._items,i=n.length;for(let o=0;o<i;o++){let r=n[o];if(r.contains(e))return r.getBoundingSphere(e,t)}return Wt.FAILED};tE.prototype.removeAllPrimitives=function(){let e=this._items,t=e.length;for(let n=0;n<t;n++)e[n].destroy();this._items.length=0};var dh=tE;var ROi=x(T(),1);var uOi=x(T(),1);var cOi=x(T(),1);var rOi=x(T(),1);function W3(e,t,n=0,i=e.length-1,o=yxt){for(;i>n;){if(i-n>600){let c=i-n+1,d=t-n+1,u=Math.log(c),m=.5*Math.exp(2*u/3),p=.5*Math.sqrt(u*m*(c-m)/c)*(d-c/2<0?-1:1),b=Math.max(n,Math.floor(t-d*m/c+p)),f=Math.min(i,Math.floor(t+(c-d)*m/c+p));W3(e,t,b,f,o)}let r=e[t],s=n,a=i;for(cM(e,n,t),o(e[i],r)>0&&cM(e,n,i);s<a;){for(cM(e,s,a),s++,a--;o(e[s],r)<0;)s++;for(;o(e[a],r)>0;)a--}o(e[n],r)===0?cM(e,n,a):(a++,cM(e,a,i)),a<=t&&(n=a+1),t<=a&&(i=a-1)}}function cM(e,t,n){let i=e[t];e[t]=e[n],e[n]=i}function yxt(e,t){return e<t?-1:e>t?1:0}var uM=class{constructor(t=9){this._maxEntries=Math.max(4,t),this._minEntries=Math.max(2,Math.ceil(this._maxEntries*.4)),this.clear()}all(){return this._all(this.data,[])}search(t){let n=this.data,i=[];if(!F3(t,n))return i;let o=this.toBBox,r=[];for(;n;){for(let s=0;s<n.children.length;s++){let a=n.children[s],c=n.leaf?o(a):a;F3(t,c)&&(n.leaf?i.push(a):Dee(t,c)?this._all(a,i):r.push(a))}n=r.pop()}return i}collides(t){let n=this.data;if(!F3(t,n))return!1;let i=[];for(;n;){for(let o=0;o<n.children.length;o++){let r=n.children[o],s=n.leaf?this.toBBox(r):r;if(F3(t,s)){if(n.leaf||Dee(t,s))return!0;i.push(r)}}n=i.pop()}return!1}load(t){if(!(t&&t.length))return this;if(t.length<this._minEntries){for(let i=0;i<t.length;i++)this.insert(t[i]);return this}let n=this._build(t.slice(),0,t.length-1,0);if(!this.data.children.length)this.data=n;else if(this.data.height===n.height)this._splitRoot(this.data,n);else{if(this.data.height<n.height){let i=this.data;this.data=n,n=i}this._insert(n,this.data.height-n.height-1,!0)}return this}insert(t){return t&&this._insert(t,this.data.height-1),this}clear(){return this.data=iE([]),this}remove(t,n){if(!t)return this;let i=this.data,o=this.toBBox(t),r=[],s=[],a,c,d;for(;i||r.length;){if(i||(i=r.pop(),c=r[r.length-1],a=s.pop(),d=!0),i.leaf){let u=xxt(t,i.children,n);if(u!==-1)return i.children.splice(u,1),r.push(i),this._condense(r),this}!d&&!i.leaf&&Dee(i,o)?(r.push(i),s.push(a),a=0,c=i,i=i.children[0]):c?(a++,i=c.children[a],d=!1):i=null}return this}toBBox(t){return t}compareMinX(t,n){return t.minX-n.minX}compareMinY(t,n){return t.minY-n.minY}toJSON(){return this.data}fromJSON(t){return this.data=t,this}_all(t,n){let i=[];for(;t;)t.leaf?n.push(...t.children):i.push(...t.children),t=i.pop();return n}_build(t,n,i,o){let r=i-n+1,s=this._maxEntries,a;if(r<=s)return a=iE(t.slice(n,i+1)),nE(a,this.toBBox),a;o||(o=Math.ceil(Math.log(r)/Math.log(s)),s=Math.ceil(r/Math.pow(s,o-1))),a=iE([]),a.leaf=!1,a.height=o;let c=Math.ceil(r/s),d=c*Math.ceil(Math.sqrt(s));XCe(t,n,i,d,this.compareMinX);for(let u=n;u<=i;u+=d){let m=Math.min(u+d-1,i);XCe(t,u,m,c,this.compareMinY);for(let p=u;p<=m;p+=c){let b=Math.min(p+c-1,m);a.children.push(this._build(t,p,b,o-1))}}return nE(a,this.toBBox),a}_chooseSubtree(t,n,i,o){for(;o.push(n),!(n.leaf||o.length-1===i);){let r=1/0,s=1/0,a;for(let c=0;c<n.children.length;c++){let d=n.children[c],u=Uee(d),m=Sxt(t,d)-u;m<s?(s=m,r=u<r?u:r,a=d):m===s&&u<r&&(r=u,a=d)}n=a||n.children[0]}return n}_insert(t,n,i){let o=i?t:this.toBBox(t),r=[],s=this._chooseSubtree(o,this.data,n,r);for(s.children.push(t),dM(s,o);n>=0&&r[n].children.length>this._maxEntries;)this._split(r,n),n--;this._adjustParentBBoxes(o,r,n)}_split(t,n){let i=t[n],o=i.children.length,r=this._minEntries;this._chooseSplitAxis(i,r,o);let s=this._chooseSplitIndex(i,r,o),a=iE(i.children.splice(s,i.children.length-s));a.height=i.height,a.leaf=i.leaf,nE(i,this.toBBox),nE(a,this.toBBox),n?t[n-1].children.push(a):this._splitRoot(i,a)}_splitRoot(t,n){this.data=iE([t,n]),this.data.height=t.height+1,this.data.leaf=!1,nE(this.data,this.toBBox)}_chooseSplitIndex(t,n,i){let o,r=1/0,s=1/0;for(let a=n;a<=i-n;a++){let c=lM(t,0,a,this.toBBox),d=lM(t,a,i,this.toBBox),u=Zxt(c,d),m=Uee(c)+Uee(d);u<r?(r=u,o=a,s=m<s?m:s):u===r&&m<s&&(s=m,o=a)}return o||i-n}_chooseSplitAxis(t,n,i){let o=t.leaf?this.compareMinX:Txt,r=t.leaf?this.compareMinY:_xt,s=this._allDistMargin(t,n,i,o),a=this._allDistMargin(t,n,i,r);s<a&&t.children.sort(o)}_allDistMargin(t,n,i,o){t.children.sort(o);let r=this.toBBox,s=lM(t,0,n,r),a=lM(t,i-n,i,r),c=v3(s)+v3(a);for(let d=n;d<i-n;d++){let u=t.children[d];dM(s,t.leaf?r(u):u),c+=v3(s)}for(let d=i-n-1;d>=n;d--){let u=t.children[d];dM(a,t.leaf?r(u):u),c+=v3(a)}return c}_adjustParentBBoxes(t,n,i){for(let o=i;o>=0;o--)dM(n[o],t)}_condense(t){for(let n=t.length-1,i;n>=0;n--)t[n].children.length===0?n>0?(i=t[n-1].children,i.splice(i.indexOf(t[n]),1)):this.clear():nE(t[n],this.toBBox)}};function xxt(e,t,n){if(!n)return t.indexOf(e);for(let i=0;i<t.length;i++)if(n(e,t[i]))return i;return-1}function nE(e,t){lM(e,0,e.children.length,t,e)}function lM(e,t,n,i,o){o||(o=iE(null)),o.minX=1/0,o.minY=1/0,o.maxX=-1/0,o.maxY=-1/0;for(let r=t;r<n;r++){let s=e.children[r];dM(o,e.leaf?i(s):s)}return o}function dM(e,t){return e.minX=Math.min(e.minX,t.minX),e.minY=Math.min(e.minY,t.minY),e.maxX=Math.max(e.maxX,t.maxX),e.maxY=Math.max(e.maxY,t.maxY),e}function Txt(e,t){return e.minX-t.minX}function _xt(e,t){return e.minY-t.minY}function Uee(e){return(e.maxX-e.minX)*(e.maxY-e.minY)}function v3(e){return e.maxX-e.minX+(e.maxY-e.minY)}function Sxt(e,t){return(Math.max(t.maxX,e.maxX)-Math.min(t.minX,e.minX))*(Math.max(t.maxY,e.maxY)-Math.min(t.minY,e.minY))}function Zxt(e,t){let n=Math.max(e.minX,t.minX),i=Math.max(e.minY,t.minY),o=Math.min(e.maxX,t.maxX),r=Math.min(e.maxY,t.maxY);return Math.max(0,o-n)*Math.max(0,r-i)}function Dee(e,t){return e.minX<=t.minX&&e.minY<=t.minY&&t.maxX<=e.maxX&&t.maxY<=e.maxY}function F3(e,t){return t.minX<=e.maxX&&t.minY<=e.maxY&&t.maxX>=e.minX&&t.maxY>=e.minY}function iE(e){return{children:e,height:1,leaf:!0,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0}}function XCe(e,t,n,i,o){let r=[t,n];for(;r.length;){if(n=r.pop(),t=r.pop(),n-t<=i)continue;let s=t+Math.ceil((n-t)/i/2)*i;W3(e,s,t,n,o),r.push(t,s,s,n)}}function I3(){this._tree=new uM}function bZ(){this.minX=0,this.minY=0,this.maxX=0,this.maxY=0,this.id=""}bZ.fromRectangleAndId=function(e,t,n){return n.minX=t.west,n.minY=t.south,n.maxX=t.east,n.maxY=t.north,n.id=e,n};I3.prototype.insert=function(e,t){let n=bZ.fromRectangleAndId(e,t,new bZ);this._tree.insert(n)};function Rxt(e,t){return e.id===t.id}var Cxt=new bZ;I3.prototype.remove=function(e,t){let n=bZ.fromRectangleAndId(e,t,Cxt);this._tree.remove(n,Rxt)};var Vxt=new bZ;I3.prototype.collides=function(e){let t=bZ.fromRectangleAndId("",e,Vxt);return this._tree.collides(t)};var gZ=I3;var Ext=new U,Axt=new Bt,Gxt=new Bt;function Ig(e,t,n,i){this.primitives=e,this.zIndex=i,this.classificationType=t,this.color=n,this.createPrimitive=!1,this.waitingOnCreate=!1,this.primitive=void 0,this.oldPrimitive=void 0,this.geometry=new kt,this.updaters=new kt,this.updatersWithAttributes=new kt,this.attributes=new kt,this.subscriptions=new kt,this.showsUpdated=new kt,this.itemsToRemove=[],this.isDirty=!1,this.rectangleCollisionCheck=new gZ}Ig.prototype.overlapping=function(e){return this.rectangleCollisionCheck.collides(e)};Ig.prototype.add=function(e,t){let n=e.id;if(this.createPrimitive=!0,this.geometry.set(n,t),this.updaters.set(n,e),this.rectangleCollisionCheck.insert(n,t.geometry.rectangle),!e.hasConstantFill||!e.fillMaterialProperty.isConstant||!j.isConstant(e.distanceDisplayConditionProperty))this.updatersWithAttributes.set(n,e);else{let i=this;this.subscriptions.set(n,e.entity.definitionChanged.addEventListener(function(o,r,s,a){r==="isShowing"&&i.showsUpdated.set(e.id,e)}))}};Ig.prototype.remove=function(e){let t=e.id,n=this.geometry.get(t);if(this.createPrimitive=this.geometry.remove(t)||this.createPrimitive,this.updaters.remove(t)){this.rectangleCollisionCheck.remove(t,n.geometry.rectangle),this.updatersWithAttributes.remove(t);let i=this.subscriptions.get(t);return l(i)&&(i(),this.subscriptions.remove(t),this.showsUpdated.remove(t)),!0}return!1};Ig.prototype.update=function(e){let t=!0,n=0,i=this.primitive,o=this.primitives,r;if(this.createPrimitive){let s=this.geometry.values;if(s.length>0)l(i)&&(l(this.oldPrimitive)?o.remove(i):this.oldPrimitive=i),i=new Dl({show:!1,asynchronous:!0,geometryInstances:s.slice(),classificationType:this.classificationType}),o.add(i,this.zIndex),t=!1;else{l(i)&&(o.remove(i),i=void 0);let c=this.oldPrimitive;l(c)&&(o.remove(c),this.oldPrimitive=void 0)}this.attributes.removeAll(),this.primitive=i,this.createPrimitive=!1,this.waitingOnCreate=!0}else if(l(i)&&i.ready){i.show=!0,l(this.oldPrimitive)&&(o.remove(this.oldPrimitive),this.oldPrimitive=void 0);let s=this.updatersWithAttributes.values,a=s.length,c=this.waitingOnCreate;for(r=0;r<a;r++){let d=s[r],u=this.geometry.get(d.id),m=this.attributes.get(u.id.id);if(l(m)||(m=i.getGeometryInstanceAttributes(u.id),this.attributes.set(u.id.id,m)),!d.fillMaterialProperty.isConstant||c){let y=d.fillMaterialProperty.color,_=j.getValueOrDefault(y,e,U.WHITE,Ext);U.equals(m._lastColor,_)||(m._lastColor=U.clone(_,m._lastColor),m.color=$t.toValue(_,m.color))}let p=d.entity.isShowing&&(d.hasConstantFill||d.isFilled(e)),b=m.show[0]===1;p!==b&&(m.show=Wn.toValue(p,m.show));let f=d.distanceDisplayConditionProperty;if(!j.isConstant(f)){let y=j.getValueOrDefault(f,e,Gxt,Axt);Bt.equals(y,m._lastDistanceDisplayCondition)||(m._lastDistanceDisplayCondition=Bt.clone(y,m._lastDistanceDisplayCondition),m.distanceDisplayCondition=ti.toValue(y,m.distanceDisplayCondition))}}this.updateShows(i),this.waitingOnCreate=!1}else l(i)&&!i.ready&&(t=!1);return this.itemsToRemove.length=n,t};Ig.prototype.updateShows=function(e){let t=this.showsUpdated.values,n=t.length;for(let i=0;i<n;i++){let o=t[i],r=this.geometry.get(o.id),s=this.attributes.get(r.id.id);l(s)||(s=e.getGeometryInstanceAttributes(r.id),this.attributes.set(r.id.id,s));let a=o.entity.isShowing,c=s.show[0]===1;a!==c&&(s.show=Wn.toValue(a,s.show),r.attributes.show.value[0]=s.show[0])}this.showsUpdated.removeAll()};Ig.prototype.contains=function(e){return this.updaters.contains(e.id)};Ig.prototype.getBoundingSphere=function(e,t){let n=this.primitive;if(!n.ready)return Wt.PENDING;let i=n.getBoundingSphere(e.entity);return l(i)?(i.clone(t),Wt.DONE):Wt.FAILED};Ig.prototype.removeAllPrimitives=function(){let e=this.primitives,t=this.primitive;l(t)&&(e.remove(t),this.primitive=void 0,this.geometry.removeAll(),this.updaters.removeAll());let n=this.oldPrimitive;l(n)&&(e.remove(n),this.oldPrimitive=void 0)};function oE(e,t){this._batches=[],this._primitives=e,this._classificationType=t}oE.prototype.add=function(e,t){let n=t.createFillGeometryInstance(e),i=this._batches,o=j.getValueOrDefault(t.zIndex,0),r,s=i.length;for(let a=0;a<s;++a){let c=i[a];if(c.zIndex===o&&!c.overlapping(n.geometry.rectangle)){r=c;break}}return l(r)||(r=new Ig(this._primitives,this._classificationType,n.attributes.color.value,o),i.push(r)),r.add(t,n),r};oE.prototype.remove=function(e){let t=this._batches,n=t.length;for(let i=0;i<n;++i)if(t[i].remove(e))return};oE.prototype.update=function(e){let t,n,i=!0,o=this._batches,r=o.length;for(t=0;t<r;++t)i=o[t].update(e)&&i;for(t=0;t<r;++t){let s=o[t],a=s.itemsToRemove,c=a.length;for(let d=0;d<c;d++){n=a[d],s.remove(n);let u=this.add(e,n);s.isDirty=!0,u.isDirty=!0}}for(t=r-1;t>=0;--t){let s=o[t];s.isDirty&&(i=o[t].update(e)&&i,s.isDirty=!1),s.geometry.length===0&&o.splice(t,1)}return i};oE.prototype.getBoundingSphere=function(e,t){let n=this._batches,i=n.length;for(let o=0;o<i;++o){let r=n[o];if(r.contains(e))return r.getBoundingSphere(e,t)}return Wt.FAILED};oE.prototype.removeAllPrimitives=function(){let e=this._batches,t=e.length;for(let n=0;n<t;++n)e[n].removeAllPrimitives()};var rE=oE;var YOi=x(T(),1);var Lxt=new Bt,Wxt=new Bt;function c0(e,t,n,i,o,r){this.primitives=e,this.classificationType=t,this.appearanceType=n,this.materialProperty=i,this.updaters=new kt,this.createPrimitive=!0,this.primitive=void 0,this.oldPrimitive=void 0,this.geometry=new kt,this.material=void 0,this.updatersWithAttributes=new kt,this.attributes=new kt,this.subscriptions=new kt,this.showsUpdated=new kt,this.usingSphericalTextureCoordinates=o,this.zIndex=r,this.rectangleCollisionCheck=new gZ}c0.prototype.overlapping=function(e){return this.rectangleCollisionCheck.collides(e)};c0.prototype.isMaterial=function(e){let t=this.materialProperty,n=e.fillMaterialProperty;return n===t||n instanceof Qt&&t instanceof Qt?!0:l(t)&&t.equals(n)};c0.prototype.add=function(e,t,n){let i=t.id;if(this.updaters.set(i,t),this.geometry.set(i,n),this.rectangleCollisionCheck.insert(i,n.geometry.rectangle),!t.hasConstantFill||!t.fillMaterialProperty.isConstant||!j.isConstant(t.distanceDisplayConditionProperty))this.updatersWithAttributes.set(i,t);else{let o=this;this.subscriptions.set(i,t.entity.definitionChanged.addEventListener(function(r,s,a,c){s==="isShowing"&&o.showsUpdated.set(t.id,t)}))}this.createPrimitive=!0};c0.prototype.remove=function(e){let t=e.id,n=this.geometry.get(t);if(this.createPrimitive=this.geometry.remove(t)||this.createPrimitive,this.updaters.remove(t)){this.rectangleCollisionCheck.remove(t,n.geometry.rectangle),this.updatersWithAttributes.remove(t);let i=this.subscriptions.get(t);return l(i)&&(i(),this.subscriptions.remove(t),this.showsUpdated.remove(t)),!0}return!1};c0.prototype.update=function(e){let t=!0,n=this.primitive,i=this.primitives,o=this.geometry.values,r;if(this.createPrimitive){if(o.length>0){l(n)&&(l(this.oldPrimitive)?i.remove(n):this.oldPrimitive=n),this.material=yr.getValue(e,this.materialProperty,this.material);let a=this.appearanceType;n=new Dl({show:!1,asynchronous:!0,geometryInstances:o.slice(),appearance:new a({material:this.material}),classificationType:this.classificationType}),i.add(n,this.zIndex),t=!1}else{l(n)&&(i.remove(n),n=void 0);let a=this.oldPrimitive;l(a)&&(i.remove(a),this.oldPrimitive=void 0)}this.attributes.removeAll(),this.primitive=n,this.createPrimitive=!1}else if(l(n)&&n.ready){n.show=!0,l(this.oldPrimitive)&&(i.remove(this.oldPrimitive),this.oldPrimitive=void 0),this.material=yr.getValue(e,this.materialProperty,this.material),this.primitive.appearance.material=this.material;let s=this.updatersWithAttributes.values,a=s.length;for(r=0;r<a;r++){let c=s[r],d=c.entity,u=this.geometry.get(c.id),m=this.attributes.get(u.id.id);l(m)||(m=n.getGeometryInstanceAttributes(u.id),this.attributes.set(u.id.id,m));let p=d.isShowing&&(c.hasConstantFill||c.isFilled(e)),b=m.show[0]===1;p!==b&&(m.show=Wn.toValue(p,m.show));let f=c.distanceDisplayConditionProperty;if(!j.isConstant(f)){let y=j.getValueOrDefault(f,e,Wxt,Lxt);Bt.equals(y,m._lastDistanceDisplayCondition)||(m._lastDistanceDisplayCondition=Bt.clone(y,m._lastDistanceDisplayCondition),m.distanceDisplayCondition=ti.toValue(y,m.distanceDisplayCondition))}}this.updateShows(n)}else l(n)&&!n.ready&&(t=!1);return t};c0.prototype.updateShows=function(e){let t=this.showsUpdated.values,n=t.length;for(let i=0;i<n;i++){let o=t[i],r=o.entity,s=this.geometry.get(o.id),a=this.attributes.get(s.id.id);l(a)||(a=e.getGeometryInstanceAttributes(s.id),this.attributes.set(s.id.id,a));let c=r.isShowing,d=a.show[0]===1;c!==d&&(a.show=Wn.toValue(c,a.show),s.attributes.show.value[0]=a.show[0])}this.showsUpdated.removeAll()};c0.prototype.contains=function(e){return this.updaters.contains(e.id)};c0.prototype.getBoundingSphere=function(e,t){let n=this.primitive;if(!n.ready)return Wt.PENDING;let i=n.getGeometryInstanceAttributes(e.entity);return!l(i)||!l(i.boundingSphere)||l(i.show)&&i.show[0]===0?Wt.FAILED:(i.boundingSphere.clone(t),Wt.DONE)};c0.prototype.destroy=function(){let e=this.primitive,t=this.primitives;l(e)&&t.remove(e);let n=this.oldPrimitive;l(n)&&t.remove(n)};function sE(e,t,n){this._items=[],this._primitives=e,this._classificationType=t,this._appearanceType=n}sE.prototype.add=function(e,t){let n=this._items,i=n.length,o=t.createFillGeometryInstance(e),r=Ru.shouldUseSphericalCoordinates(o.geometry.rectangle),s=j.getValueOrDefault(t.zIndex,0);for(let c=0;c<i;++c){let d=n[c];if(d.isMaterial(t)&&d.usingSphericalTextureCoordinates===r&&d.zIndex===s&&!d.overlapping(o.geometry.rectangle)){d.add(e,t,o);return}}let a=new c0(this._primitives,this._classificationType,this._appearanceType,t.fillMaterialProperty,r,s);a.add(e,t,o),n.push(a)};sE.prototype.remove=function(e){let t=this._items,n=t.length;for(let i=n-1;i>=0&&!t[i].remove(e);i--);};sE.prototype.update=function(e){let t,n=this._items,i=n.length;for(t=i-1;t>=0;t--){let r=n[t];r.updaters.length===0&&(n.splice(t,1),r.destroy())}let o=!0;for(t=0;t<n.length;t++)o=n[t].update(e)&&o;return o};sE.prototype.getBoundingSphere=function(e,t){let n=this._items,i=n.length;for(let o=0;o<i;o++){let r=n[o];if(r.contains(e))return r.getBoundingSphere(e,t)}return Wt.FAILED};sE.prototype.removeAllPrimitives=function(){let e=this._items,t=e.length;for(let n=0;n<t;n++)e[n].destroy();this._items.length=0};var mM=sE;var $Oi=x(T(),1);var vxt=new U,Fxt=new Bt,Ixt=new Bt,Pxt=h.ZERO,Xxt=new h;function Pg(e,t,n,i){this.translucent=t,this.width=n,this.shadows=i,this.primitives=e,this.createPrimitive=!1,this.waitingOnCreate=!1,this.primitive=void 0,this.oldPrimitive=void 0,this.geometry=new kt,this.updaters=new kt,this.updatersWithAttributes=new kt,this.attributes=new kt,this.itemsToRemove=[],this.subscriptions=new kt,this.showsUpdated=new kt}Pg.prototype.add=function(e,t){let n=e.id;if(this.createPrimitive=!0,this.geometry.set(n,t),this.updaters.set(n,e),!e.hasConstantOutline||!e.outlineColorProperty.isConstant||!j.isConstant(e.distanceDisplayConditionProperty)||!j.isConstant(e.terrainOffsetProperty))this.updatersWithAttributes.set(n,e);else{let i=this;this.subscriptions.set(n,e.entity.definitionChanged.addEventListener(function(o,r,s,a){r==="isShowing"&&i.showsUpdated.set(e.id,e)}))}};Pg.prototype.remove=function(e){let t=e.id;if(this.createPrimitive=this.geometry.remove(t)||this.createPrimitive,this.updaters.remove(t)){this.updatersWithAttributes.remove(t);let n=this.subscriptions.get(t);return l(n)&&(n(),this.subscriptions.remove(t),this.showsUpdated.remove(t)),!0}return!1};Pg.prototype.update=function(e){let t=!0,n=0,i=this.primitive,o=this.primitives,r;if(this.createPrimitive){let s=this.geometry.values;if(s.length>0)l(i)&&(l(this.oldPrimitive)?o.remove(i):this.oldPrimitive=i),i=new In({show:!1,asynchronous:!0,geometryInstances:s.slice(),appearance:new Tn({flat:!0,translucent:this.translucent,renderState:{lineWidth:this.width}}),shadows:this.shadows}),o.add(i),t=!1;else{l(i)&&(o.remove(i),i=void 0);let c=this.oldPrimitive;l(c)&&(o.remove(c),this.oldPrimitive=void 0)}this.attributes.removeAll(),this.primitive=i,this.createPrimitive=!1,this.waitingOnCreate=!0}else if(l(i)&&i.ready){i.show=!0,l(this.oldPrimitive)&&(o.remove(this.oldPrimitive),this.oldPrimitive=void 0);let s=this.updatersWithAttributes.values,a=s.length,c=this.waitingOnCreate;for(r=0;r<a;r++){let d=s[r],u=this.geometry.get(d.id),m=this.attributes.get(u.id.id);if(l(m)||(m=i.getGeometryInstanceAttributes(u.id),this.attributes.set(u.id.id,m)),!d.outlineColorProperty.isConstant||c){let _=d.outlineColorProperty,S=j.getValueOrDefault(_,e,U.WHITE,vxt);U.equals(m._lastColor,S)||(m._lastColor=U.clone(S,m._lastColor),m.color=$t.toValue(S,m.color),(this.translucent&&m.color[3]===255||!this.translucent&&m.color[3]!==255)&&(this.itemsToRemove[n++]=d))}let p=d.entity.isShowing&&(d.hasConstantOutline||d.isOutlineVisible(e)),b=m.show[0]===1;p!==b&&(m.show=Wn.toValue(p,m.show));let f=d.distanceDisplayConditionProperty;if(!j.isConstant(f)){let _=j.getValueOrDefault(f,e,Ixt,Fxt);Bt.equals(_,m._lastDistanceDisplayCondition)||(m._lastDistanceDisplayCondition=Bt.clone(_,m._lastDistanceDisplayCondition),m.distanceDisplayCondition=ti.toValue(_,m.distanceDisplayCondition))}let y=d.terrainOffsetProperty;if(!j.isConstant(y)){let _=j.getValueOrDefault(y,e,Pxt,Xxt);h.equals(_,m._lastOffset)||(m._lastOffset=h.clone(_,m._lastOffset),m.offset=Ro.toValue(_,m.offset))}}this.updateShows(i),this.waitingOnCreate=!1}else l(i)&&!i.ready&&(t=!1);return this.itemsToRemove.length=n,t};Pg.prototype.updateShows=function(e){let t=this.showsUpdated.values,n=t.length;for(let i=0;i<n;i++){let o=t[i],r=this.geometry.get(o.id),s=this.attributes.get(r.id.id);l(s)||(s=e.getGeometryInstanceAttributes(r.id),this.attributes.set(r.id.id,s));let a=o.entity.isShowing,c=s.show[0]===1;a!==c&&(s.show=Wn.toValue(a,s.show),r.attributes.show.value[0]=s.show[0])}this.showsUpdated.removeAll()};Pg.prototype.contains=function(e){return this.updaters.contains(e.id)};Pg.prototype.getBoundingSphere=function(e,t){let n=this.primitive;if(!n.ready)return Wt.PENDING;let i=n.getGeometryInstanceAttributes(e.entity);return!l(i)||!l(i.boundingSphere)||l(i.show)&&i.show[0]===0?Wt.FAILED:(i.boundingSphere.clone(t),Wt.DONE)};Pg.prototype.removeAllPrimitives=function(){let e=this.primitives,t=this.primitive;l(t)&&(e.remove(t),this.primitive=void 0,this.geometry.removeAll(),this.updaters.removeAll());let n=this.oldPrimitive;l(n)&&(e.remove(n),this.oldPrimitive=void 0)};function aE(e,t,n){this._primitives=e,this._scene=t,this._shadows=n,this._solidBatches=new kt,this._translucentBatches=new kt}aE.prototype.add=function(e,t){let n=t.createOutlineGeometryInstance(e),i=this._scene.clampLineWidth(t.outlineWidth),o,r;n.attributes.color.value[3]===255?(o=this._solidBatches,r=o.get(i),l(r)||(r=new Pg(this._primitives,!1,i,this._shadows),o.set(i,r)),r.add(t,n)):(o=this._translucentBatches,r=o.get(i),l(r)||(r=new Pg(this._primitives,!0,i,this._shadows),o.set(i,r)),r.add(t,n))};aE.prototype.remove=function(e){let t,n=this._solidBatches.values,i=n.length;for(t=0;t<i;t++)if(n[t].remove(e))return;let o=this._translucentBatches.values,r=o.length;for(t=0;t<r;t++)if(o[t].remove(e))return};aE.prototype.update=function(e){let t,n,i,o,r=this._solidBatches.values,s=r.length,a=this._translucentBatches.values,c=a.length,d,u=!0,m;do{for(m=!1,n=0;n<s;n++){o=r[n],u=o.update(e),d=o.itemsToRemove;let p=d.length;if(p>0)for(m=!0,t=0;t<p;t++)i=d[t],o.remove(i),this.add(e,i)}for(n=0;n<c;n++){o=a[n],u=o.update(e),d=o.itemsToRemove;let p=d.length;if(p>0)for(m=!0,t=0;t<p;t++)i=d[t],o.remove(i),this.add(e,i)}}while(m);return u};aE.prototype.getBoundingSphere=function(e,t){let n,i=this._solidBatches.values,o=i.length;for(n=0;n<o;n++){let a=i[n];if(a.contains(e))return a.getBoundingSphere(e,t)}let r=this._translucentBatches.values,s=r.length;for(n=0;n<s;n++){let a=r[n];if(a.contains(e))return a.getBoundingSphere(e,t)}return Wt.FAILED};aE.prototype.removeAllPrimitives=function(){let e,t=this._solidBatches.values,n=t.length;for(e=0;e<n;e++)t[e].removeAllPrimitives();let i=this._translucentBatches.values,o=i.length;for(e=0;e<o;e++)i[e].removeAllPrimitives()};var cE=aE;var Nxt=[];function Qd(e,t,n,i){n=n??e.primitives,i=i??e.groundPrimitives,this._scene=e,this._primitives=n,this._groundPrimitives=i,this._entityCollection=void 0,this._addedObjects=new kt,this._removedObjects=new kt,this._changedObjects=new kt;let o=vn.NUMBER_OF_SHADOW_MODES;this._outlineBatches=new Array(o*2),this._closedColorBatches=new Array(o*2),this._closedMaterialBatches=new Array(o*2),this._openColorBatches=new Array(o*2),this._openMaterialBatches=new Array(o*2);let r=er.supportsMaterialsforEntitiesOnTerrain(e);this._supportsMaterialsforEntitiesOnTerrain=r;let s;for(s=0;s<o;++s)this._outlineBatches[s]=new cE(n,e,s,!1),this._outlineBatches[o+s]=new cE(n,e,s,!0),this._closedColorBatches[s]=new lh(n,Tn,void 0,!0,s,!0),this._closedColorBatches[o+s]=new lh(n,Tn,void 0,!0,s,!1),this._closedMaterialBatches[s]=new dh(n,Co,void 0,!0,s,!0),this._closedMaterialBatches[o+s]=new dh(n,Co,void 0,!0,s,!1),this._openColorBatches[s]=new lh(n,Tn,void 0,!1,s,!0),this._openColorBatches[o+s]=new lh(n,Tn,void 0,!1,s,!1),this._openMaterialBatches[s]=new dh(n,Co,void 0,!1,s,!0),this._openMaterialBatches[o+s]=new dh(n,Co,void 0,!1,s,!1);let a=ni.NUMBER_OF_CLASSIFICATION_TYPES,c=new Array(a),d=[];if(r)for(s=0;s<a;++s)d.push(new mM(i,s,Co)),c[s]=new rE(i,s);else for(s=0;s<a;++s)c[s]=new rE(i,s);this._groundColorBatches=c,this._groundMaterialBatches=d,this._dynamicBatch=new oZ(n,i),this._batches=this._outlineBatches.concat(this._closedColorBatches,this._closedMaterialBatches,this._openColorBatches,this._openMaterialBatches,this._groundColorBatches,this._groundMaterialBatches,this._dynamicBatch),this._subscriptions=new kt,this._updaterSets=new kt,this._entityCollection=t,t.collectionChanged.addEventListener(Qd.prototype._onCollectionChanged,this),this._onCollectionChanged(t,t.values,Nxt)}Qd.registerUpdater=function(e){pZ.registerUpdater(e)};Qd.unregisterUpdater=function(e){pZ.unregisterUpdater(e)};Qd.prototype.update=function(e){let t=this._addedObjects,n=t.values,i=this._removedObjects,o=i.values,r=this._changedObjects,s=r.values,a,c,d,u,m=this;for(a=s.length-1;a>-1;a--)c=s[a],d=c.id,u=this._updaterSets.get(d),u.entity===c?u.forEach(function(y){m._removeUpdater(y),m._insertUpdaterIntoBatch(e,y)}):(o.push(c),n.push(c));for(a=o.length-1;a>-1;a--)c=o[a],d=c.id,u=this._updaterSets.get(d),u.forEach(this._removeUpdater.bind(this)),u.destroy(),this._updaterSets.remove(d),this._subscriptions.get(d)(),this._subscriptions.remove(d);for(a=n.length-1;a>-1;a--)c=n[a],d=c.id,u=new pZ(c,this._scene),this._updaterSets.set(d,u),u.forEach(function(y){m._insertUpdaterIntoBatch(e,y)}),this._subscriptions.set(d,u.geometryChanged.addEventListener(Qd._onGeometryChanged,this));t.removeAll(),i.removeAll(),r.removeAll();let p=!0,b=this._batches,f=b.length;for(a=0;a<f;a++)p=b[a].update(e)&&p;return p};var Yxt=[],Mxt=new me;Qd.prototype.getBoundingSphere=function(e,t){let n=Yxt,i=Mxt,o=0,r,s=this._batches,a=s.length,c=e.id,d=this._updaterSets.get(c).updaters;for(let u=0;u<d.length;u++){let m=d[u];for(let p=0;p<a;p++){if(r=s[p].getBoundingSphere(m,i),r===Wt.PENDING)return Wt.PENDING;r===Wt.DONE&&(n[o]=me.clone(i,n[o]),o++)}}return o===0?Wt.FAILED:(n.length=o,me.fromBoundingSpheres(n,t),Wt.DONE)};Qd.prototype.isDestroyed=function(){return!1};Qd.prototype.destroy=function(){this._entityCollection.collectionChanged.removeEventListener(Qd.prototype._onCollectionChanged,this),this._addedObjects.removeAll(),this._removedObjects.removeAll();let e,t=this._batches,n=t.length;for(e=0;e<n;e++)t[e].removeAllPrimitives();let i=this._subscriptions.values;for(n=i.length,e=0;e<n;e++)i[e]();this._subscriptions.removeAll();let o=this._updaterSets.values;for(n=o.length,e=0;e<n;e++)o[e].destroy();return this._updaterSets.removeAll(),ue(this)};Qd.prototype._removeUpdater=function(e){let t=this._batches,n=t.length;for(let i=0;i<n;i++)t[i].remove(e)};Qd.prototype._insertUpdaterIntoBatch=function(e,t){if(t.isDynamic){this._dynamicBatch.add(e,t);return}let n;(t.outlineEnabled||t.fillEnabled)&&(n=t.shadowsProperty.getValue(e));let i=vn.NUMBER_OF_SHADOW_MODES;if(t.outlineEnabled&&(l(t.terrainOffsetProperty)?this._outlineBatches[i+n].add(e,t):this._outlineBatches[n].add(e,t)),t.fillEnabled)if(t.onTerrain){let o=t.classificationTypeProperty.getValue(e);t.fillMaterialProperty instanceof Qt?this._groundColorBatches[o].add(e,t):this._groundMaterialBatches[o].add(e,t)}else t.isClosed?t.fillMaterialProperty instanceof Qt?l(t.terrainOffsetProperty)?this._closedColorBatches[i+n].add(e,t):this._closedColorBatches[n].add(e,t):l(t.terrainOffsetProperty)?this._closedMaterialBatches[i+n].add(e,t):this._closedMaterialBatches[n].add(e,t):t.fillMaterialProperty instanceof Qt?l(t.terrainOffsetProperty)?this._openColorBatches[i+n].add(e,t):this._openColorBatches[n].add(e,t):l(t.terrainOffsetProperty)?this._openMaterialBatches[i+n].add(e,t):this._openMaterialBatches[n].add(e,t)};Qd._onGeometryChanged=function(e){let t=this._removedObjects,n=this._changedObjects,i=e.entity,o=i.id;!l(t.get(o))&&!l(n.get(o))&&n.set(o,i)};Qd.prototype._onCollectionChanged=function(e,t,n){let i=this._addedObjects,o=this._removedObjects,r=this._changedObjects,s,a,c;for(s=n.length-1;s>-1;s--)c=n[s],a=c.id,i.remove(a)||(o.set(a,c),r.remove(a));for(s=t.length-1;s>-1;s--)c=t[s],a=c.id,o.remove(a)?r.set(a,c):i.set(a,c)};var hM=Qd;var YBi=x(T(),1);var wxt=1,kxt="30px sans-serif",Uxt=Tr.FILL,Dxt=U.WHITE,Oxt=U.BLACK,Bxt=1,zxt=!1,Hxt=new U(.165,.165,.165,.8),Kxt=new k(7,5),Jxt=k.ZERO,jxt=h.ZERO,Qxt=He.NONE,qxt=Ui.CENTER,$xt=zn.CENTER,eTt=new h,tTt=new U,nTt=new U,iTt=new U,oTt=new k,rTt=new h,sTt=new k,aTt=new Kt,cTt=new Kt,lTt=new Kt,dTt=new Bt;function NCe(e){this.entity=e,this.label=void 0,this.index=void 0}function $x(e,t){t.collectionChanged.addEventListener($x.prototype._onCollectionChanged,this),this._cluster=e,this._entityCollection=t,this._items=new kt,this._onCollectionChanged(t,t.values,[],[])}$x.prototype.update=function(e){let t=this._items.values,n=this._cluster;for(let i=0,o=t.length;i<o;i++){let r=t[i],s=r.entity,a=s._label,c,d=r.label,u=s.isShowing&&s.isAvailable(e)&&j.getValueOrDefault(a._show,e,!0),m;if(u&&(m=j.getValueOrUndefined(s._position,e,eTt),c=j.getValueOrUndefined(a._text,e),u=l(m)&&l(c)),!u){Oee(r,s,n);continue}j.isConstant(s._position)||(n._clusterDirty=!0);let p=!1,b=j.getValueOrDefault(a._heightReference,e,Qxt);l(d)||(d=n.getLabel(s),d.id=s,r.label=d,p=h.equals(d.position,m)&&d.heightReference===b),d.show=!0,d.position=m,d.text=c,d.scale=j.getValueOrDefault(a._scale,e,wxt),d.font=j.getValueOrDefault(a._font,e,kxt),d.style=j.getValueOrDefault(a._style,e,Uxt),d.fillColor=j.getValueOrDefault(a._fillColor,e,Dxt,tTt),d.outlineColor=j.getValueOrDefault(a._outlineColor,e,Oxt,nTt),d.outlineWidth=j.getValueOrDefault(a._outlineWidth,e,Bxt),d.showBackground=j.getValueOrDefault(a._showBackground,e,zxt),d.backgroundColor=j.getValueOrDefault(a._backgroundColor,e,Hxt,iTt),d.backgroundPadding=j.getValueOrDefault(a._backgroundPadding,e,Kxt,oTt),d.pixelOffset=j.getValueOrDefault(a._pixelOffset,e,Jxt,sTt),d.eyeOffset=j.getValueOrDefault(a._eyeOffset,e,jxt,rTt),d.heightReference=b,d.horizontalOrigin=j.getValueOrDefault(a._horizontalOrigin,e,qxt),d.verticalOrigin=j.getValueOrDefault(a._verticalOrigin,e,$xt),d.translucencyByDistance=j.getValueOrUndefined(a._translucencyByDistance,e,aTt),d.pixelOffsetScaleByDistance=j.getValueOrUndefined(a._pixelOffsetScaleByDistance,e,cTt),d.scaleByDistance=j.getValueOrUndefined(a._scaleByDistance,e,lTt),d.distanceDisplayCondition=j.getValueOrUndefined(a._distanceDisplayCondition,e,dTt),d.disableDepthTestDistance=j.getValueOrUndefined(a._disableDepthTestDistance,e),p&&d._updateClamping()}return!0};$x.prototype.getBoundingSphere=function(e,t){let n=this._items.get(e.id);if(!l(n)||!l(n.label))return Wt.FAILED;let i=n.label;if(i.heightReference===He.NONE)t.center=h.clone(i.position,t.center);else if(i._clampedToSurface)t.center=h.clone(i._clampedPosition,t.center);else{let o=this._cluster._scene,r=this._items,s=Oh(o,n,i.position,[i],()=>r.get(e.id)===n);if(s===void 0)return Wt.PENDING;s===null?t.center=h.clone(i.position,t.center):t.center=mb(i.position,s,i.heightReference,o.ellipsoid??ne.default,t.center)}return t.radius=0,Wt.DONE};$x.prototype.isDestroyed=function(){return!1};$x.prototype.destroy=function(){this._entityCollection.collectionChanged.removeEventListener($x.prototype._onCollectionChanged,this);let e=this._entityCollection.values;for(let t=0;t<e.length;t++)this._cluster.removeLabel(e[t]);return ue(this)};$x.prototype._onCollectionChanged=function(e,t,n,i){let o,r,s=this._items,a=this._cluster;for(o=t.length-1;o>-1;o--)r=t[o],l(r._label)&&l(r._position)&&s.set(r.id,new NCe(r));for(o=i.length-1;o>-1;o--)r=i[o],l(r._label)&&l(r._position)?s.contains(r.id)||s.set(r.id,new NCe(r)):(Oee(s.get(r.id),r,a),s.remove(r.id));for(o=n.length-1;o>-1;o--)r=n[o],Oee(s.get(r.id),r,a),s.remove(r.id)};function Oee(e,t,n){l(e)&&(e.label=void 0,n.removeLabel(t))}var fM=$x;var s3i=x(T(),1);var uTt=1,mTt=!0,hTt=0,fTt=!0,pTt=!0,bTt=vn.ENABLED,gTt=He.NONE,yTt=U.RED,xTt=0,TTt=U.WHITE,_Tt=al.HIGHLIGHT,STt=.5,ZTt=new k(1,1),YCe={maximumPositionEpsilon:Number.POSITIVE_INFINITY},RTt=new P,CTt=new P,MCe=new U,wCe=new Array(4),VTt=new h;function eT(e,t){t.collectionChanged.addEventListener(eT.prototype._onCollectionChanged,this),this._scene=e,this._primitives=e.primitives,this._entityCollection=t,this._modelHash={},this._entitiesToVisualize=new kt,this._onCollectionChanged(t,t.values,[],[])}function ETt(e,t){return e instanceof mi?e.valueOf():j.getValueOrUndefined(e,t)}function ATt(e,t){return t!==e.uri?!1:t instanceof ve?t._url===e.uriUrl&&t._queryParameters===e.uriQueryParameters&&t._templateValues===e.uriTemplateValues:!0}function kCe(e,t){e.uri=t,t instanceof ve&&(e.uriUrl=t._url,e.uriQueryParameters=t._queryParameters,e.uriTemplateValues=t._templateValues)}function GTt(e,t){if(!l(t))return P.clone(e);for(let n=0;n<16;n++)t[n]=e[n];return t}async function LTt(e,t,n,i,o){let r=e._primitives,s=e._modelHash;try{let a=await Yu.fromGltfAsync({url:n,incrementallyLoadTextures:i,scene:e._scene,environmentMapOptions:o});if(e.isDestroyed()||!l(s[t.id]))return;a.id=t,r.add(a),s[t.id].modelPrimitive=a,a.errorEvent.addEventListener(c=>{l(s[t.id])&&(console.log(c),c.name!=="TextureError"&&a.incrementallyLoadTextures&&(s[t.id].loadFailed=!0))})}catch(a){if(e.isDestroyed()||!l(s[t.id]))return;console.log(a),s[t.id].loadFailed=!0}}eT.prototype.update=function(e){let t=this._entitiesToVisualize.values,n=this._modelHash,i=this._primitives;for(let o=0,r=t.length;o<r;o++){let s=t[o],a=s._model,c,d=n[s.id],u=s.isShowing&&s.isAvailable(e)&&j.getValueOrDefault(a._show,e,!0),m,p;if(u&&(m=s.computeModelMatrix(e,RTt),p=ETt(a._uri,e),u=l(m)&&l(p)),!u){l(d)&&d.modelPrimitive&&(d.modelPrimitive.show=!1);continue}if((!l(d)||!ATt(d,p))&&(c=ve.createIfNeeded(p),l(d)&&c.url===d.url&&(kCe(d,p),c=void 0)),l(c)){l(d?.modelPrimitive)&&(i.removeAndDestroy(d.modelPrimitive),delete n[s.id]),d={modelPrimitive:void 0,url:c.url,uri:void 0,uriUrl:void 0,uriQueryParameters:void 0,uriTemplateValues:void 0,animationsRunning:!1,nodeTransformationsScratch:{},articulationsScratch:{},loadFailed:!1,modelUpdated:!1,environmentMapOptionsScratch:{...YCe}},n[s.id]=d,kCe(d,p);let y=j.getValueOrDefault(a._incrementallyLoadTextures,e,fTt),_=j.getValueOrDefault(a._environmentMapOptions,e,YCe,d.environmentMapOptionsScratch);LTt(this,s,c,y,_)}let b=d.modelPrimitive;if(!l(b))continue;b.show=!0,b.scale=j.getValueOrDefault(a._scale,e,uTt),b.enableVerticalExaggeration=j.getValueOrDefault(a._enableVerticalExaggeration,e,mTt),b.minimumPixelSize=j.getValueOrDefault(a._minimumPixelSize,e,hTt),b.maximumScale=j.getValueOrUndefined(a._maximumScale,e),b.modelMatrix=GTt(m,b.modelMatrix),b.shadows=j.getValueOrDefault(a._shadows,e,bTt),b.heightReference=j.getValueOrDefault(a._heightReference,e,gTt),b.distanceDisplayCondition=j.getValueOrUndefined(a._distanceDisplayCondition,e),b.silhouetteColor=j.getValueOrDefault(a._silhouetteColor,e,yTt,MCe),b.silhouetteSize=j.getValueOrDefault(a._silhouetteSize,e,xTt),b.color=j.getValueOrDefault(a._color,e,TTt,MCe),b.colorBlendMode=j.getValueOrDefault(a._colorBlendMode,e,_Tt),b.colorBlendAmount=j.getValueOrDefault(a._colorBlendAmount,e,STt),b.clippingPlanes=j.getValueOrUndefined(a._clippingPlanes,e),b.clampAnimations=j.getValueOrDefault(a._clampAnimations,e,pTt),b.imageBasedLighting.imageBasedLightingFactor=j.getValueOrDefault(a._imageBasedLightingFactor,e,ZTt);let f=j.getValueOrUndefined(a._lightColor,e);if(l(f)&&(U.pack(f,wCe,0),f=h.unpack(wCe,0,VTt)),b.lightColor=f,b.customShader=j.getValueOrUndefined(a._customShader,e),n[s.id].modelUpdated=!0,b.ready){let y=j.getValueOrDefault(a._runAnimations,e,!0);d.animationsRunning!==y&&(y?b.activeAnimations.addAll({loop:wd.REPEAT}):b.activeAnimations.removeAll(),d.animationsRunning=y);let _=j.getValueOrUndefined(a._nodeTransformations,e,d.nodeTransformationsScratch);if(l(_)){let R=Object.keys(_);for(let C=0,E=R.length;C<E;++C){let A=R[C],L=_[A];if(!l(L))continue;let F=b.getNode(A);if(!l(F))continue;let I=P.fromTranslationRotationScale(L,CTt);F.matrix=P.multiply(F.originalMatrix,I,I)}}let S=!1,Z=j.getValueOrUndefined(a._articulations,e,d.articulationsScratch);if(l(Z)){let R=Object.keys(Z);for(let C=0,E=R.length;C<E;++C){let A=R[C],L=Z[A];l(L)&&(S=!0,b.setArticulationStage(A,L))}}S&&b.applyArticulations()}}return!0};eT.prototype.isDestroyed=function(){return!1};eT.prototype.destroy=function(){this._entityCollection.collectionChanged.removeEventListener(eT.prototype._onCollectionChanged,this);let e=this._entitiesToVisualize.values,t=this._modelHash,n=this._primitives;for(let i=e.length-1;i>-1;i--)Bee(this,e[i],t,n);return ue(this)};var pM=new h,WTt=new pe;eT.prototype.getBoundingSphere=function(e,t){let n=this._modelHash[e.id];if(!l(n))return Wt.FAILED;if(n.loadFailed)return Wt.FAILED;let i=n.modelPrimitive;if(!l(i)||!i.show)return Wt.PENDING;if(!i.ready||!n.modelUpdated)return Wt.PENDING;let o=this._scene,r=o.ellipsoid??ne.default;if(i.heightReference!==He.NONE){let a=i.modelMatrix;pM.x=a[12],pM.y=a[13],pM.z=a[14];let c=r.cartesianToCartographic(pM,WTt),d=o.getHeight(c,i.heightReference);if(l(d)||(d=i._lastSurfaceHeight),!l(d)){let u=this._modelHash,m=Oh(o,n,pM,[i],()=>u[e.id]===n);if(m===void 0)return Wt.PENDING;m!==null&&(d=m)}return l(d)&&(i.heightReference===He.CLIP_TO_GROUND?c.height<d&&(c.height=d):bs(i.heightReference)?c.height=d:c.height+=d),me.clone(i.boundingSphere,t),t.center=r.cartographicToCartesian(c),Wt.DONE}return me.clone(i.boundingSphere,t),Wt.DONE};eT.prototype._onCollectionChanged=function(e,t,n,i){let o,r,s=this._entitiesToVisualize,a=this._modelHash,c=this._primitives;for(o=t.length-1;o>-1;o--)r=t[o],l(r._model)&&l(r._position)&&s.set(r.id,r);for(o=i.length-1;o>-1;o--)r=i[o],l(r._model)&&l(r._position)?(vTt(r,a),s.set(r.id,r)):(Bee(this,r,a,c),s.remove(r.id));for(o=n.length-1;o>-1;o--)r=n[o],Bee(this,r,a,c),s.remove(r.id)};function Bee(e,t,n,i){let o=n[t.id];l(o)&&(i.removeAndDestroy(o.modelPrimitive),delete n[t.id])}function vTt(e,t){let n=t[e.id];l(n)&&(n.nodeTransformationsScratch={},n.articulationsScratch={})}var bM=eT;var U3i=x(T(),1);var f3i=x(T(),1);function tT(e){this._definitionChanged=new Se,this._value=void 0,this._removeSubscription=void 0,this.setValue(e)}Object.defineProperties(tT.prototype,{isConstant:{get:function(){return j.isConstant(this._value)}},definitionChanged:{get:function(){return this._definitionChanged}},referenceFrame:{get:function(){return l(this._value)?this._value.referenceFrame:Oi.FIXED}}});var FTt=new Q;tT.prototype.getValue=function(e,t){return l(e)||(e=Q.now(FTt)),this.getValueInReferenceFrame(e,Oi.FIXED,t)};tT.prototype.setValue=function(e){this._value!==e&&(this._value=e,l(this._removeSubscription)&&(this._removeSubscription(),this._removeSubscription=void 0),l(e)&&(this._removeSubscription=e.definitionChanged.addEventListener(this._raiseDefinitionChanged,this)),this._definitionChanged.raiseEvent(this))};tT.prototype.getValueInReferenceFrame=function(e,t,n){if(l(this._value))return n=this._value.getValueInReferenceFrame(e,t,n),l(n)?ne.default.scaleToGeodeticSurface(n,n):void 0};tT.prototype.equals=function(e){return this===e||e instanceof tT&&this._value===e._value};tT.prototype._raiseDefinitionChanged=function(){this._definitionChanged.raiseEvent(this)};var l0=tT;var UCe=new q,DCe=new q,OCe=new q,ITt=new h,BCe=new h,PTt=new h,XTt=new h,P3=new Ne,X3=new P,N3=new q;function yM(e,t,n,i,o){if(!(!l(t)||!l(n))){if(h.subtract(t,n,o),l(i.orientation))i.orientation.getValue(e,P3)&&(Ne.conjugate(P3,P3),q.fromQuaternion(P3,N3),q.multiplyByVector(N3,o,o));else if(l(Kee(e,i.position,X3)))P.inverse(X3,X3),P.getRotation(X3,N3),q.multiplyByVector(N3,o,o);else return;return o}}function Kee(e,t,n){let i=t.getValue(e,ITt);if(l(i)){let o=Q.addSeconds(e,.01,new Q),r=t.getValue(o,BCe);if(l(r)&&!h.equalsEpsilon(i,r,W.EPSILON16)){let s=_t.computeFixedToIcrfMatrix(e,UCe),a=_t.computeFixedToIcrfMatrix(o,DCe),c;!l(s)||!l(a)?(c=_t.computeTemeToPseudoFixedMatrix(e,OCe),s=q.transpose(c,UCe),a=_t.computeTemeToPseudoFixedMatrix(o,DCe),q.transpose(a,a)):c=q.transpose(s,OCe);let d=PTt;h.normalize(i,d),h.normalize(r,r),q.multiplyByVector(s,d,d),q.multiplyByVector(a,r,r);let u=h.cross(d,r,XTt);if(!h.equalsEpsilon(u,h.ZERO,W.EPSILON16)){let m=h.cross(u,d,BCe);return q.multiplyByVector(c,m,m),q.multiplyByVector(c,u,u),q.multiplyByVector(c,d,d),h.normalize(m,m),h.normalize(u,u),h.normalize(d,d),l(n)||(n=new P),n[0]=m.x,n[1]=m.y,n[2]=m.z,n[3]=0,n[4]=u.x,n[5]=u.y,n[6]=u.z,n[7]=0,n[8]=d.x,n[9]=d.y,n[10]=d.z,n[11]=0,n[12]=i.x,n[13]=i.y,n[14]=i.z,n[15]=1,n}}}}var zCe=60,qCe=1,$Ce=new Cn,zee=new Cn,Hee=new Cn;function HCe(e){this.entity=e,this.polyline=void 0,this.segmentPolylines=[],this.index=void 0,this.updater=void 0}var Y3=new h;function NTt(e,t,n,i,o,r,s,a,c){let d,u,m=!1;r instanceof er&&(d=r,u=d.position,r=Oi.FIXED,m=!0);let p=a,b,f;b=e.getValueInReferenceFrame(t,r,c[p]),m?(f=u.getValueInReferenceFrame(t,r,Y3),b=yM(t,b,f,d,b),l(b)&&(c[p++]=b)):l(b)&&(c[p++]=b);let y=!l(o)||Q.lessThanOrEquals(o,t)||Q.greaterThanOrEquals(o,n),_=0,S=i.length,Z=i[_],R=n,C=!1,E,A,L;for(;_<S;){if(!y&&Q.greaterThanOrEquals(Z,o)&&(b=e.getValueInReferenceFrame(o,r,c[p]),m?(f=u.getValueInReferenceFrame(o,r,Y3),l(b)&&l(f)&&(b=yM(o,b,f,d,b),l(b)&&(c[p++]=b))):l(b)&&(c[p++]=b),y=!0),Q.greaterThan(Z,t)&&Q.lessThan(Z,R)&&!Z.equals(o)&&(b=e.getValueInReferenceFrame(Z,r,c[p]),m?(f=u.getValueInReferenceFrame(Z,r,Y3),l(b)&&l(f)&&(b=yM(Z,b,f,d,b),l(b)&&(c[p++]=b))):l(b)&&(c[p++]=b)),_<S-1){if(s>0&&!C){let F=i[_+1],I=Q.secondsDifference(F,Z);C=I>s,C&&(E=Math.ceil(I/s),A=0,L=I/Math.max(E,2),E=Math.max(E-1,1))}if(C&&A<E){Z=Q.addSeconds(Z,L,new Q),A++;continue}}C=!1,_++,Z=i[_]}return b=e.getValueInReferenceFrame(n,r,c[p]),m?(f=u.getValueInReferenceFrame(n,r,Y3),l(b)&&l(f)&&(b=yM(n,b,f,d,b),l(b)&&(c[p++]=b))):l(b)&&(c[p++]=b),p}function YTt(e,t,n,i,o,r,s,a){let c,d=0,u=s,m=t,p=!l(i)||Q.lessThanOrEquals(i,t)||Q.greaterThanOrEquals(i,n);for(;Q.lessThan(m,n);)!p&&Q.greaterThanOrEquals(m,i)&&(p=!0,c=e.getValueInReferenceFrame(i,o,a[u]),l(c)&&(a[u]=c,u++)),c=e.getValueInReferenceFrame(m,o,a[u]),l(c)&&(a[u]=c,u++),d++,m=Q.addSeconds(t,r*d,new Q);return c=e.getValueInReferenceFrame(n,o,a[u]),l(c)&&(a[u]=c,u++),u}function MTt(e,t,n,i,o,r,s,a){let c,d=0,u=s,m=t,p=Math.max(r,60),b=!l(i)||Q.lessThanOrEquals(i,t)||Q.greaterThanOrEquals(i,n);for(;Q.lessThan(m,n);)!b&&Q.greaterThanOrEquals(m,i)&&(b=!0,c=e.getValueInReferenceFrame(i,o,a[u]),l(c)&&(a[u]=c,u++)),c=e.getValueInReferenceFrame(m,o,a[u]),l(c)&&(a[u]=c,u++),d++,m=Q.addSeconds(t,p*d,new Q);return c=e.getValueInReferenceFrame(n,o,a[u]),l(c)&&(a[u]=c,u++),u}function wTt(e,t,n,i,o,r,s,a){Hee.start=t,Hee.stop=n;let c=s,d=e.intervals;for(let u=0;u<d.length;u++){let m=d.get(u);if(!Cn.intersect(m,Hee,$Ce).isEmpty){let p=m.start;m.isStartIncluded||(m.isStopIncluded?p=m.stop:p=Q.addSeconds(m.start,Q.secondsDifference(m.stop,m.start)/2,new Q));let b=e.getValueInReferenceFrame(p,o,a[c]);l(b)&&(a[c]=b,c++)}}return c}function kTt(e,t,n,i,o,r,s,a){let c=e.getValueInReferenceFrame(t,o,a[s]);return l(c)&&(a[s++]=c),s}function UTt(e,t,n,i,o,r,s,a){zee.start=t,zee.stop=n;let c=s,d=e.intervals;for(let u=0;u<d.length;u++){let m=d.get(u);if(!Cn.intersect(m,zee,$Ce).isEmpty){let p=m.start,b=m.stop,f=t;Q.greaterThan(p,f)&&(f=p);let y=n;Q.lessThan(b,y)&&(y=b),c=eVe(m.data,f,y,i,o,r,c,a)}}return c}function eVe(e,t,n,i,o,r,s,a){for(;e instanceof Eg;)e=e.resolvedProperty;if(e instanceof pc){let c=e._property._times;s=NTt(e,t,n,c,i,o,r,s,a)}else e instanceof EF?s=YTt(e,t,n,i,o,r,s,a):e instanceof hc?s=UTt(e,t,n,i,o,r,s,a):e instanceof Ag?s=wTt(e,t,n,i,o,r,s,a):e instanceof Bl||e instanceof l0&&j.isConstant(e)?s=kTt(e,t,n,i,o,r,s,a):s=MTt(e,t,n,i,o,r,s,a);return s}function Jee(e,t,n,i,o,r,s){l(s)||(s=[]);let a=eVe(e,t,n,i,o,r,0,s);return s.length=a,s}var KCe=new q,JCe=new Ne,jCe=new q,gM=new Cn,M3=new Cn,yZ=new Cn;function DTt(e){let t=[];if(!l(e))return t;for(let n in e){if(n[0]!=="_"||n==="_definitionChanged"||n.endsWith("Subscription"))continue;let i=e[n];l(i)&&typeof i.getValue=="function"&&!j.isConstant(i)&&t.push(i)}return t}function QCe(e,t,n,i,o,r,s,a,c,d,u){e.sort(Q.compare),e=Yo(e,Q.equalsEpsilon);let m=u;for(let p=0;p<e.length-1;p++){let b=e[p],f=e[p+1];if(!Q.lessThan(b,f))continue;let y=Q.addSeconds(b,Q.secondsDifference(f,b)/2,new Q),_=Jee(t,b,f,n,c,a,[]);if(_.length<2)continue;let S=r.segmentPolylines[m];l(S)||(S=s.add(),S.id=o,r.segmentPolylines[m]=S),S.show=!0,S.positions=_,S.material=yr.getValue(y,d,S.material),S.width=j.getValueOrDefault(i._width,n,qCe),m++}return m}function xM(e,t){this._unusedIndexes=[],this._polylineCollection=new Tf,this._scene=e,this._referenceFrame=t,e.primitives.add(this._polylineCollection)}xM.prototype.update=function(e){let t=this._referenceFrame;if(t===Oi.INERTIAL){let n=_t.computeIcrfToFixedMatrix(e,KCe);l(n)||(n=_t.computeTemeToPseudoFixedMatrix(e,KCe)),P.fromRotationTranslation(n,h.ZERO,this._polylineCollection.modelMatrix)}else if(t instanceof er){let n=t.position.getValue(e);l(t.orientation)?l(t.orientation.getValue(e,JCe))&&(q.fromQuaternion(JCe,jCe),P.fromRotationTranslation(jCe,n,this._polylineCollection.modelMatrix)):Kee(e,t.position,this._polylineCollection.modelMatrix)}};xM.prototype.updateObject=function(e,t){let n=t.entity,i=n._path,o=n._position,r,s,a=i._show,c=t.polyline,d=n.isShowing&&n.isAvailable(e)&&(!l(a)||a.getValue(e));if(d){let f=j.getValueOrUndefined(i._leadTime,e),y=j.getValueOrUndefined(i._trailTime,e),_=n._availability,S=l(_),Z=l(f),R=l(y);if(d=S||Z&&R,d){if(R&&(r=Q.addSeconds(e,-y,new Q)),Z&&(s=Q.addSeconds(e,f,new Q)),S){let C=_.start,E=_.stop;(!R||Q.greaterThan(C,r))&&(r=C),(!Z||Q.lessThan(E,s))&&(s=E)}d=Q.lessThan(r,s)}}if(!d){l(c)&&(this._unusedIndexes.push(t.index),t.polyline=void 0,c.show=!1,t.index=void 0);for(let f=0;f<t.segmentPolylines.length;f++)t.segmentPolylines[f].show=!1;return}if(!l(c)){let f=this._unusedIndexes;if(f.length>0){let _=f.pop();c=this._polylineCollection.get(_),t.index=_}else t.index=this._polylineCollection.length,c=this._polylineCollection.add();c.id=n,t.polyline=c}let u=j.getValueOrDefault(i._resolution,e,zCe),m=Jee(o,r,s,e,this._referenceFrame,u,c.positions.slice());if(m.length<2){c.show=!1;for(let f=0;f<t.segmentPolylines.length;f++)t.segmentPolylines[f].show=!1;return}c.show=!0,c.positions=m,c.material=yr.getValue(e,i.material,c.material);let p=j.getValueOrUndefined(i.materialMode,e),b=i.material;if(p===n0.PORTIONS&&!b.isConstant){l(c)&&(c.show=!1);let f=u>0?u:zCe,y=b.intervals,_=0;if(l(y)){gM.start=r,gM.stop=s,gM.isStartIncluded=!0,gM.isStopIncluded=!0;for(let S=0;S<y.length;S++){let Z=y.get(S);if(!Cn.intersect(Z,gM,M3))continue;let R=M3.start,C=M3.stop;if(Q.greaterThanOrEquals(R,C))continue;let E=DTt(Z.data),A=[Q.clone(R),Q.clone(C)];for(let L=0;L<E.length;L++){let F=E[L],I=F.intervals;if(l(I))for(let N=0;N<I.length;N++){let g=I.get(N);Cn.intersect(g,M3,yZ)&&(Q.greaterThan(yZ.start,R)&&Q.lessThan(yZ.start,C)&&A.push(Q.clone(yZ.start)),Q.greaterThan(yZ.stop,R)&&Q.lessThan(yZ.stop,C)&&A.push(Q.clone(yZ.stop)))}else if(!j.isConstant(F)){let N=Q.clone(R);for(;Q.lessThan(N,C);)A.push(Q.clone(N)),N=Q.addSeconds(N,f,new Q)}}_=QCe(A,o,e,i,n,t,this._polylineCollection,f,this._referenceFrame,Z.data,_)}}else{let S=[Q.clone(r),Q.clone(s)],Z=Q.addSeconds(r,f,new Q);for(;Q.lessThan(Z,s);)S.push(Q.clone(Z)),Z=Q.addSeconds(Z,f,new Q);_=QCe(S,o,e,i,n,t,this._polylineCollection,f,this._referenceFrame,i.material,_)}for(let S=_;S<t.segmentPolylines.length;S++)l(t.segmentPolylines[S])&&(t.segmentPolylines[S].show=!1)}else for(let f=0;f<t.segmentPolylines.length;f++)t.segmentPolylines[f].show=!1;c.width=j.getValueOrDefault(i._width,e,qCe),c.distanceDisplayCondition=j.getValueOrUndefined(i._distanceDisplayCondition,e,c.distanceDisplayCondition)};xM.prototype.removeObject=function(e){let t=e.polyline;l(t)&&(this._unusedIndexes.push(e.index),e.polyline=void 0,t.show=!1,t.id=void 0,e.index=void 0);for(let n=0;n<e.segmentPolylines.length;n++)e.segmentPolylines[n].show=!1;e.segmentPolylines.length=0};xM.prototype.destroy=function(){return this._scene.primitives.remove(this._polylineCollection),ue(this)};function d0(e,t){t.collectionChanged.addEventListener(d0.prototype._onCollectionChanged,this),this._scene=e,this._updaters={},this._entityCollection=t,this._items=new kt,this._onCollectionChanged(t,t.values,[],[])}d0.prototype.update=function(e){let t=this._updaters;for(let i in t)t.hasOwnProperty(i)&&t[i].update(e);let n=this._items.values;if(n.length===0&&l(this._updaters)&&Object.keys(this._updaters).length>0){for(let i in t)t.hasOwnProperty(i)&&t[i].destroy();this._updaters={}}for(let i=0,o=n.length;i<o;i++){let r=n[i],s=r.entity,a=s._position,c=s._path,d=r.updater,u=!1,m=Oi.FIXED,p=m.toString();if(this._scene.mode===se.SCENE3D){let f=j.getValueOrUndefined(c.relativeTo,e);l(f)?f==="FIXED"?(m=Oi.FIXED,p=m.toString()):f==="INERTIAL"?(m=Oi.INERTIAL,p=m.toString()):(u=!0,m=this._entityCollection.getById(f),p=f):(m=a.referenceFrame,p=m.toString())}let b=this._updaters[p];if(d===b&&l(b)){b.updateObject(e,r);continue}l(d)&&d.removeObject(r),!(u&&!l(m))&&(l(b)||(b=new xM(this._scene,m),b.update(e),this._updaters[p]=b),r.updater=b,l(b)&&b.updateObject(e,r))}return!0};d0.prototype.isDestroyed=function(){return!1};d0.prototype.destroy=function(){this._entityCollection.collectionChanged.removeEventListener(d0.prototype._onCollectionChanged,this);let e=this._updaters;for(let t in e)e.hasOwnProperty(t)&&e[t].destroy();return ue(this)};d0.prototype._onCollectionChanged=function(e,t,n,i){let o,r,s,a=this._items;for(o=t.length-1;o>-1;o--)r=t[o],l(r._path)&&l(r._position)&&a.set(r.id,new HCe(r));for(o=i.length-1;o>-1;o--)r=i[o],l(r._path)&&l(r._position)?a.contains(r.id)||a.set(r.id,new HCe(r)):(s=a.get(r.id),l(s)&&(l(s.updater)&&s.updater.removeObject(s),a.remove(r.id)));for(o=n.length-1;o>-1;o--)r=n[o],s=a.get(r.id),l(s)&&(l(s.updater)&&s.updater.removeObject(s),a.remove(r.id))};d0._subSample=Jee;d0._computeVvlhTransform=Kee;d0._transformToEntityFrame=yM;var TM=d0;var rzi=x(T(),1);var tVe=U.WHITE,nVe=U.BLACK,iVe=0,oVe=1,rVe=0,sVe=kr.NONE,aVe=new U,OTt=new h,cVe=new U,lVe=new Kt,dVe=new Kt,uVe=new Bt;function mVe(e){this.entity=e,this.pointPrimitive=void 0,this.billboard=void 0,this.color=void 0,this.outlineColor=void 0,this.pixelSize=void 0,this.outlineWidth=void 0}function nT(e,t){t.collectionChanged.addEventListener(nT.prototype._onCollectionChanged,this),this._cluster=e,this._entityCollection=t,this._items=new kt,this._onCollectionChanged(t,t.values,[],[])}nT.prototype.update=function(e){let t=this._items.values,n=this._cluster;for(let i=0,o=t.length;i<o;i++){let r=t[i],s=r.entity,a=s._point,c=r.pointPrimitive,d=r.billboard,u=j.getValueOrDefault(a._heightReference,e,He.NONE),m=s.isShowing&&s.isAvailable(e)&&j.getValueOrDefault(a._show,e,!0),p;if(m&&(p=j.getValueOrUndefined(s._position,e,OTt),m=l(p)),!m){_M(r,s,n);continue}j.isConstant(s._position)||(n._clusterDirty=!0);let b=!1,f=!1;if(u!==He.NONE&&!l(d)?(l(c)&&(_M(r,s,n),c=void 0),d=n.getBillboard(s),d.id=s,d.image=void 0,r.billboard=d,b=!0,f=h.equals(d.position,p)&&d.heightReference===u):u===He.NONE&&!l(c)&&(l(d)&&(_M(r,s,n),d=void 0),c=n.getPoint(s),c.id=s,r.pointPrimitive=c),l(c))c.show=!0,c.position=p,c.scaleByDistance=j.getValueOrUndefined(a._scaleByDistance,e,lVe),c.translucencyByDistance=j.getValueOrUndefined(a._translucencyByDistance,e,dVe),c.color=j.getValueOrDefault(a._color,e,tVe,aVe),c.outlineColor=j.getValueOrDefault(a._outlineColor,e,nVe,cVe),c.outlineWidth=j.getValueOrDefault(a._outlineWidth,e,iVe),c.pixelSize=j.getValueOrDefault(a._pixelSize,e,oVe),c.distanceDisplayCondition=j.getValueOrUndefined(a._distanceDisplayCondition,e,uVe),c.disableDepthTestDistance=j.getValueOrDefault(a._disableDepthTestDistance,e,rVe),c.splitDirection=j.getValueOrDefault(a._splitDirection,e,sVe);else if(l(d)){d.show=!0,d.position=p,d.scaleByDistance=j.getValueOrUndefined(a._scaleByDistance,e,lVe),d.translucencyByDistance=j.getValueOrUndefined(a._translucencyByDistance,e,dVe),d.distanceDisplayCondition=j.getValueOrUndefined(a._distanceDisplayCondition,e,uVe),d.disableDepthTestDistance=j.getValueOrDefault(a._disableDepthTestDistance,e,rVe),d.splitDirection=j.getValueOrDefault(a._splitDirection,e,sVe),d.heightReference=u;let y=j.getValueOrDefault(a._color,e,tVe,aVe),_=j.getValueOrDefault(a._outlineColor,e,nVe,cVe),S=Math.round(j.getValueOrDefault(a._outlineWidth,e,iVe)),Z=Math.max(1,Math.round(j.getValueOrDefault(a._pixelSize,e,oVe)));if(S>0?(d.scale=1,b=b||S!==r.outlineWidth||Z!==r.pixelSize||!U.equals(y,r.color)||!U.equals(_,r.outlineColor)):(d.scale=Z/50,Z=50,b=b||S!==r.outlineWidth||!U.equals(y,r.color)||!U.equals(_,r.outlineColor)),b){r.color=U.clone(y,r.color),r.outlineColor=U.clone(_,r.outlineColor),r.pixelSize=Z,r.outlineWidth=S;let R=y.alpha,C=y.toCssColorString(),E=_.toCssColorString(),A=JSON.stringify([C,Z,E,S]);d.setImage(A,ES(R,C,E,S,Z))}f&&d._updateClamping()}}return!0};nT.prototype.getBoundingSphere=function(e,t){let n=this._items.get(e.id);if(!l(n)||!(l(n.pointPrimitive)||l(n.billboard)))return Wt.FAILED;if(l(n.pointPrimitive))t.center=h.clone(n.pointPrimitive.position,t.center);else{let i=n.billboard;if(i._clampedToSurface)t.center=h.clone(i._clampedPosition,t.center);else{let o=this._cluster._scene,r=this._items,s=Oh(o,n,i.position,[i],()=>r.get(e.id)===n);if(s===void 0)return Wt.PENDING;s===null?t.center=h.clone(i.position,t.center):t.center=mb(i.position,s,i.heightReference,o.ellipsoid??ne.default,t.center)}}return t.radius=0,Wt.DONE};nT.prototype.isDestroyed=function(){return!1};nT.prototype.destroy=function(){this._entityCollection.collectionChanged.removeEventListener(nT.prototype._onCollectionChanged,this);let e=this._entityCollection.values;for(let t=0;t<e.length;t++)this._cluster.removePoint(e[t]);return ue(this)};nT.prototype._onCollectionChanged=function(e,t,n,i){let o,r,s=this._items,a=this._cluster;for(o=t.length-1;o>-1;o--)r=t[o],l(r._point)&&l(r._position)&&s.set(r.id,new mVe(r));for(o=i.length-1;o>-1;o--)r=i[o],l(r._point)&&l(r._position)?s.contains(r.id)||s.set(r.id,new mVe(r)):(_M(s.get(r.id),r,a),s.remove(r.id));for(o=n.length-1;o>-1;o--)r=n[o],_M(s.get(r.id),r,a),s.remove(r.id)};function _M(e,t,n){if(l(e)){let i=e.pointPrimitive;if(l(i)){e.pointPrimitive=void 0,n.removePoint(t);return}let o=e.billboard;l(o)&&(e.billboard=void 0,n.removeBillboard(t))}}var SM=nT;var IHi=x(T(),1);var tHi=x(T(),1);var Czi=x(T(),1);var gVe=[];function BTt(e,t,n,i,o){let r=gVe;r.length=o;let s,a=n.red,c=n.green,d=n.blue,u=n.alpha,m=i.red,p=i.green,b=i.blue,f=i.alpha;if(U.equals(n,i)){for(s=0;s<o;s++)r[s]=U.clone(n);return r}let y=(m-a)/o,_=(p-c)/o,S=(b-d)/o,Z=(f-u)/o;for(s=0;s<o;s++)r[s]=new U(a+s*y,c+s*_,d+s*S,u+s*Z);return r}function ZM(e){e=e??B.EMPTY_OBJECT;let t=e.positions,n=e.colors,i=e.width??1,o=e.colorsPerVertex??!1;this._positions=t,this._colors=n,this._width=i,this._colorsPerVertex=o,this._vertexFormat=Me.clone(e.vertexFormat??Me.DEFAULT),this._arcType=e.arcType??un.GEODESIC,this._granularity=e.granularity??W.RADIANS_PER_DEGREE,this._ellipsoid=ne.clone(e.ellipsoid??ne.default),this._workerName="createPolylineGeometry";let r=1+t.length*h.packedLength;r+=l(n)?1+n.length*U.packedLength:1,this.packedLength=r+ne.packedLength+Me.packedLength+4}ZM.pack=function(e,t,n){n=n??0;let i,o=e._positions,r=o.length;for(t[n++]=r,i=0;i<r;++i,n+=h.packedLength)h.pack(o[i],t,n);let s=e._colors;for(r=l(s)?s.length:0,t[n++]=r,i=0;i<r;++i,n+=U.packedLength)U.pack(s[i],t,n);return ne.pack(e._ellipsoid,t,n),n+=ne.packedLength,Me.pack(e._vertexFormat,t,n),n+=Me.packedLength,t[n++]=e._width,t[n++]=e._colorsPerVertex?1:0,t[n++]=e._arcType,t[n]=e._granularity,t};var yVe=ne.clone(ne.UNIT_SPHERE),xVe=new Me,xZ={positions:void 0,colors:void 0,ellipsoid:yVe,vertexFormat:xVe,width:void 0,colorsPerVertex:void 0,arcType:void 0,granularity:void 0};ZM.unpack=function(e,t,n){t=t??0;let i,o=e[t++],r=new Array(o);for(i=0;i<o;++i,t+=h.packedLength)r[i]=h.unpack(e,t);o=e[t++];let s=o>0?new Array(o):void 0;for(i=0;i<o;++i,t+=U.packedLength)s[i]=U.unpack(e,t);let a=ne.unpack(e,t,yVe);t+=ne.packedLength;let c=Me.unpack(e,t,xVe);t+=Me.packedLength;let d=e[t++],u=e[t++]===1,m=e[t++],p=e[t];return l(n)?(n._positions=r,n._colors=s,n._ellipsoid=ne.clone(a,n._ellipsoid),n._vertexFormat=Me.clone(c,n._vertexFormat),n._width=d,n._colorsPerVertex=u,n._arcType=m,n._granularity=p,n):(xZ.positions=r,xZ.colors=s,xZ.width=d,xZ.colorsPerVertex=u,xZ.arcType=m,xZ.granularity=p,new ZM(xZ))};var hVe=new h,fVe=new h,pVe=new h,bVe=new h;ZM.createGeometry=function(e){let t=e._width,n=e._vertexFormat,i=e._colors,o=e._colorsPerVertex,r=e._arcType,s=e._granularity,a=e._ellipsoid,c,d,u,m=[],p=Yo(e._positions,h.equalsEpsilon,!1,m);if(l(i)&&m.length>0){let X=0,Y=m[0];i=i.filter(function(D,M){let O;return o?O=M===Y||M===0&&Y===1:O=M+1===Y,O?(X++,Y=m[X],!1):!0})}let b=p.length;if(b<2||t<=0)return;if(r===un.GEODESIC||r===un.RHUMB){let X,Y;r===un.GEODESIC?(X=W.chordLength(s,a.maximumRadius),Y=oo.numberOfPoints):(X=s,Y=oo.numberOfPointsRhumbLine);let D=oo.extractHeights(p,a);if(l(i)){let M=1;for(c=0;c<b-1;++c)M+=Y(p[c],p[c+1],X);let O=new Array(M),w=0;for(c=0;c<b-1;++c){let z=p[c],K=p[c+1],te=i[c],H=Y(z,K,X);if(o&&c<M){let $=i[c+1],ee=BTt(z,K,te,$,H),le=ee.length;for(d=0;d<le;++d)O[w++]=ee[d]}else for(d=0;d<H;++d)O[w++]=U.clone(te)}O[w]=U.clone(i[i.length-1]),i=O,gVe.length=0}r===un.GEODESIC?p=oo.generateCartesianArc({positions:p,minDistance:X,ellipsoid:a,height:D}):p=oo.generateCartesianRhumbArc({positions:p,granularity:X,ellipsoid:a,height:D})}b=p.length;let f=b*4-4,y=new Float64Array(f*3),_=new Float64Array(f*3),S=new Float64Array(f*3),Z=new Float32Array(f*2),R=n.st?new Float32Array(f*2):void 0,C=l(i)?new Uint8Array(f*4):void 0,E=0,A=0,L=0,F=0,I;for(d=0;d<b;++d){d===0?(I=hVe,h.subtract(p[0],p[1],I),h.add(p[0],I,I)):I=p[d-1],h.clone(I,pVe),h.clone(p[d],fVe),d===b-1?(I=hVe,h.subtract(p[b-1],p[b-2],I),h.add(p[b-1],I,I)):I=p[d+1],h.clone(I,bVe);let X,Y;l(C)&&(d!==0&&!o?X=i[d-1]:X=i[d],d!==b-1&&(Y=i[d]));let D=d===0?2:0,M=d===b-1?2:4;for(u=D;u<M;++u){h.pack(fVe,y,E),h.pack(pVe,_,E),h.pack(bVe,S,E),E+=3;let O=u-2<0?-1:1;if(Z[A++]=2*(u%2)-1,Z[A++]=O*t,n.st&&(R[L++]=d/(b-1),R[L++]=Math.max(Z[A-2],0)),l(C)){let w=u<2?X:Y;C[F++]=U.floatToByte(w.red),C[F++]=U.floatToByte(w.green),C[F++]=U.floatToByte(w.blue),C[F++]=U.floatToByte(w.alpha)}}}let N=new Rn;N.position=new Xe({componentDatatype:J.DOUBLE,componentsPerAttribute:3,values:y}),N.prevPosition=new Xe({componentDatatype:J.DOUBLE,componentsPerAttribute:3,values:_}),N.nextPosition=new Xe({componentDatatype:J.DOUBLE,componentsPerAttribute:3,values:S}),N.expandAndWidth=new Xe({componentDatatype:J.FLOAT,componentsPerAttribute:2,values:Z}),n.st&&(N.st=new Xe({componentDatatype:J.FLOAT,componentsPerAttribute:2,values:R})),l(C)&&(N.color=new Xe({componentDatatype:J.UNSIGNED_BYTE,componentsPerAttribute:4,values:C,normalize:!0}));let g=Oe.createTypedArray(f,b*6-6),V=0,G=0,v=b-1;for(d=0;d<v;++d)g[G++]=V,g[G++]=V+2,g[G++]=V+1,g[G++]=V+1,g[G++]=V+2,g[G++]=V+3,V+=4;return new At({attributes:N,indices:g,primitiveType:Ie.TRIANGLES,boundingSphere:me.fromPoints(p),geometryType:Sm.POLYLINES})};var Xg=ZM;var zTt=new mi(0),w3={},TVe=new U,HTt=new Qt(U.WHITE),KTt=new mi(!0),JTt=new mi(vn.DISABLED),jTt=new mi(new Bt),QTt=new mi(ni.BOTH);function qTt(){this.vertexFormat=void 0,this.positions=void 0,this.width=void 0,this.arcType=void 0,this.granularity=void 0}function $Tt(){this.positions=void 0,this.width=void 0,this.arcType=void 0,this.granularity=void 0}function Mf(e,t){this._entity=e,this._scene=t,this._entitySubscription=e.definitionChanged.addEventListener(Mf.prototype._onEntityPropertyChanged,this),this._fillEnabled=!1,this._dynamic=!1,this._geometryChanged=new Se,this._showProperty=void 0,this._materialProperty=void 0,this._shadowsProperty=void 0,this._distanceDisplayConditionProperty=void 0,this._classificationTypeProperty=void 0,this._depthFailMaterialProperty=void 0,this._geometryOptions=new qTt,this._groundGeometryOptions=new $Tt,this._id=`polyline-${e.id}`,this._clampToGround=!1,this._supportsPolylinesOnTerrain=er.supportsPolylinesOnTerrain(t),this._zIndex=0,this._onEntityPropertyChanged(e,"polyline",e.polyline,void 0)}Object.defineProperties(Mf.prototype,{id:{get:function(){return this._id}},entity:{get:function(){return this._entity}},fillEnabled:{get:function(){return this._fillEnabled}},hasConstantFill:{get:function(){return!this._fillEnabled||!l(this._entity.availability)&&j.isConstant(this._showProperty)}},fillMaterialProperty:{get:function(){return this._materialProperty}},depthFailMaterialProperty:{get:function(){return this._depthFailMaterialProperty}},outlineEnabled:{value:!1},hasConstantOutline:{value:!0},outlineColorProperty:{value:void 0},shadowsProperty:{get:function(){return this._shadowsProperty}},distanceDisplayConditionProperty:{get:function(){return this._distanceDisplayConditionProperty}},classificationTypeProperty:{get:function(){return this._classificationTypeProperty}},isDynamic:{get:function(){return this._dynamic}},isClosed:{value:!1},geometryChanged:{get:function(){return this._geometryChanged}},arcType:{get:function(){return this._arcType}},clampToGround:{get:function(){return this._clampToGround&&this._supportsPolylinesOnTerrain}},zIndex:{get:function(){return this._zIndex}}});Mf.prototype.isOutlineVisible=function(e){return!1};Mf.prototype.isFilled=function(e){let t=this._entity;return(this._fillEnabled&&t.isAvailable(e)&&this._showProperty.getValue(e))??!1};Mf.prototype.createFillGeometryInstance=function(e){let t=this._entity,n=t.isAvailable(e),i=new Wn(n&&t.isShowing&&this._showProperty.getValue(e)),o=this._distanceDisplayConditionProperty.getValue(e),r=ti.fromDistanceDisplayCondition(o),s={show:i,distanceDisplayCondition:r},a;return this._materialProperty instanceof Qt&&(l(this._materialProperty.color)&&(this._materialProperty.color.isConstant||n)&&(a=this._materialProperty.color.getValue(e,TVe)),l(a)||(a=U.WHITE),s.color=$t.fromColor(a)),this.clampToGround?new Yt({id:t,geometry:new E_(this._groundGeometryOptions),attributes:s}):(l(this._depthFailMaterialProperty)&&this._depthFailMaterialProperty instanceof Qt&&(l(this._depthFailMaterialProperty.color)&&(this._depthFailMaterialProperty.color.isConstant||n)&&(a=this._depthFailMaterialProperty.color.getValue(e,TVe)),l(a)||(a=U.WHITE),s.depthFailColor=$t.fromColor(a)),new Yt({id:t,geometry:new Xg(this._geometryOptions),attributes:s}))};Mf.prototype.createOutlineGeometryInstance=function(e){};Mf.prototype.isDestroyed=function(){return!1};Mf.prototype.destroy=function(){this._entitySubscription(),ue(this)};Mf.prototype._onEntityPropertyChanged=function(e,t,n,i){if(!(t==="availability"||t==="polyline"))return;let o=this._entity.polyline;if(!l(o)){this._fillEnabled&&(this._fillEnabled=!1,this._geometryChanged.raiseEvent(this));return}let r=o.positions,s=o.show;if(l(s)&&s.isConstant&&!s.getValue(ot.MINIMUM_VALUE)||!l(r)){this._fillEnabled&&(this._fillEnabled=!1,this._geometryChanged.raiseEvent(this));return}let a=o.zIndex,c=o.material??HTt,d=c instanceof Qt;this._materialProperty=c,this._depthFailMaterialProperty=o.depthFailMaterial,this._showProperty=s??KTt,this._shadowsProperty=o.shadows??JTt,this._distanceDisplayConditionProperty=o.distanceDisplayCondition??jTt,this._classificationTypeProperty=o.classificationType??QTt,this._fillEnabled=!0,this._zIndex=a??zTt;let u=o.width,m=o.arcType,p=o.clampToGround,b=o.granularity;if(!r.isConstant||!j.isConstant(u)||!j.isConstant(m)||!j.isConstant(b)||!j.isConstant(p)||!j.isConstant(a))this._dynamic||(this._dynamic=!0,this._geometryChanged.raiseEvent(this));else{let f=this._geometryOptions,y=r.getValue(ot.MINIMUM_VALUE,f.positions);if(!l(y)||y.length<2){this._fillEnabled&&(this._fillEnabled=!1,this._geometryChanged.raiseEvent(this));return}let _;d&&(!l(this._depthFailMaterialProperty)||this._depthFailMaterialProperty instanceof Qt)?_=ws.VERTEX_FORMAT:_=ac.VERTEX_FORMAT,f.vertexFormat=_,f.positions=y,f.width=l(u)?u.getValue(ot.MINIMUM_VALUE):void 0,f.arcType=l(m)?m.getValue(ot.MINIMUM_VALUE):void 0,f.granularity=l(b)?b.getValue(ot.MINIMUM_VALUE):void 0;let S=this._groundGeometryOptions;S.positions=y,S.width=f.width,S.arcType=f.arcType,S.granularity=f.granularity,this._clampToGround=l(p)?p.getValue(ot.MINIMUM_VALUE):!1,!this._clampToGround&&l(a)&&xt("Entity polylines must have clampToGround: true when using zIndex. zIndex will be ignored."),this._dynamic=!1,this._geometryChanged.raiseEvent(this)}};Mf.prototype.createDynamicUpdater=function(e,t){return new RM(e,t,this)};var lE={positions:void 0,granularity:void 0,height:void 0,ellipsoid:void 0};function RM(e,t,n){this._line=void 0,this._primitives=e,this._groundPrimitives=t,this._groundPolylinePrimitive=void 0,this._material=void 0,this._geometryUpdater=n,this._positions=[]}function _Ve(e){if(l(e._line))return e._line;let t=e._primitives,n=e._geometryUpdater._scene.id+t._guid,i=w3[n];!l(i)||i.isDestroyed()?(i=new Tf,w3[n]=i,t.add(i)):t.contains(i)||t.add(i);let o=i.add();return o.id=e._geometryUpdater._entity,e._line=o,o}RM.prototype.update=function(e){let t=this._geometryUpdater,n=t._entity,i=n.polyline,o=i.positions,r=j.getValueOrUndefined(o,e,this._positions);t._clampToGround=j.getValueOrDefault(i._clampToGround,e,!1),t._groundGeometryOptions.positions=r,t._groundGeometryOptions.width=j.getValueOrDefault(i._width,e,1),t._groundGeometryOptions.arcType=j.getValueOrDefault(i._arcType,e,un.GEODESIC),t._groundGeometryOptions.granularity=j.getValueOrDefault(i._granularity,e,9999);let s=this._groundPrimitives;if(l(this._groundPolylinePrimitive)&&(s.remove(this._groundPolylinePrimitive),this._groundPolylinePrimitive=void 0),t.clampToGround){if(!n.isShowing||!n.isAvailable(e)||!j.getValueOrDefault(i._show,e,!0)||!l(r)||r.length<2)return;let m=t.fillMaterialProperty,p;if(m instanceof Qt)p=new ws;else{let b=yr.getValue(e,m,this._material);p=new ac({material:b,translucent:b.isTranslucent()}),this._material=b}this._groundPolylinePrimitive=s.add(new zh({geometryInstances:t.createFillGeometryInstance(e),appearance:p,classificationType:t.classificationTypeProperty.getValue(e),asynchronous:!1}),j.getValueOrUndefined(t.zIndex,e)),l(this._line)&&(this._line.show=!1);return}let a=_Ve(this);if(!n.isShowing||!n.isAvailable(e)||!j.getValueOrDefault(i._show,e,!0)){a.show=!1;return}if(!l(r)||r.length<2){a.show=!1;return}let c=un.GEODESIC;c=j.getValueOrDefault(i._arcType,e,c);let d=t._scene.globe,u=t._scene.ellipsoid;c!==un.NONE&&l(d)&&(lE.ellipsoid=u,lE.positions=r,lE.granularity=j.getValueOrUndefined(i._granularity,e),lE.height=oo.extractHeights(r,u),c===un.GEODESIC?r=oo.generateCartesianArc(lE):r=oo.generateCartesianRhumbArc(lE)),a.show=!0,a.positions=r.slice(),a.material=yr.getValue(e,t.fillMaterialProperty,a.material),a.width=j.getValueOrDefault(i._width,e,1),a.distanceDisplayCondition=j.getValueOrUndefined(i._distanceDisplayCondition,e,a.distanceDisplayCondition)};RM.prototype.getBoundingSphere=function(e){if(this._geometryUpdater.clampToGround){let t=this._groundPolylinePrimitive;if(l(t)&&t.show&&t.ready){let n=t.getGeometryInstanceAttributes(this._geometryUpdater._entity);if(l(n)&&l(n.boundingSphere))return me.clone(n.boundingSphere,e),Wt.DONE}return l(t)&&!t.ready?Wt.PENDING:Wt.DONE}else{let t=_Ve(this);if(t.show&&t.positions.length>0)return me.fromPoints(t.positions,e),Wt.DONE}return Wt.FAILED};RM.prototype.isDestroyed=function(){return!1};RM.prototype.destroy=function(){let t=this._geometryUpdater._scene.id+this._primitives._guid,n=w3[t];l(n)&&(n.remove(this._line),n.length===0&&(this._primitives.removeAndDestroy(n),delete w3[t])),l(this._groundPolylinePrimitive)&&this._groundPrimitives.remove(this._groundPolylinePrimitive),ue(this)};var CM=Mf;var gHi=x(T(),1);var e_t=new U,t_t=new Bt,n_t=new Bt;function wf(e,t,n,i,o){let r;n instanceof Qt?r=ws:r=ac,this.orderedGroundPrimitives=e,this.classificationType=t,this.appearanceType=r,this.materialProperty=n,this.updaters=new kt,this.createPrimitive=!0,this.primitive=void 0,this.oldPrimitive=void 0,this.geometry=new kt,this.material=void 0,this.updatersWithAttributes=new kt,this.attributes=new kt,this.invalidated=!1,this.removeMaterialSubscription=n.definitionChanged.addEventListener(wf.prototype.onMaterialChanged,this),this.subscriptions=new kt,this.showsUpdated=new kt,this.zIndex=i,this._asynchronous=o}wf.prototype.onMaterialChanged=function(){this.invalidated=!0};wf.prototype.isMaterial=function(e){let t=this.materialProperty,n=e.fillMaterialProperty;return n===t||n instanceof Qt&&t instanceof Qt?!0:l(t)&&t.equals(n)};wf.prototype.add=function(e,t,n){let i=t.id;if(this.updaters.set(i,t),this.geometry.set(i,n),!t.hasConstantFill||!t.fillMaterialProperty.isConstant||!j.isConstant(t.distanceDisplayConditionProperty))this.updatersWithAttributes.set(i,t);else{let o=this;this.subscriptions.set(i,t.entity.definitionChanged.addEventListener(function(r,s,a,c){s==="isShowing"&&o.showsUpdated.set(t.id,t)}))}this.createPrimitive=!0};wf.prototype.remove=function(e){let t=e.id;if(this.createPrimitive=this.geometry.remove(t)||this.createPrimitive,this.updaters.remove(t)){this.updatersWithAttributes.remove(t);let n=this.subscriptions.get(t);return l(n)&&(n(),this.subscriptions.remove(t),this.showsUpdated.remove(t)),!0}return!1};wf.prototype.update=function(e){let t=!0,n=this.primitive,i=this.orderedGroundPrimitives,o=this.geometry.values,r;if(this.createPrimitive){if(o.length>0){l(n)&&(l(this.oldPrimitive)?i.remove(n):this.oldPrimitive=n);let a=this.appearanceType;n=new zh({show:!1,asynchronous:this._asynchronous,geometryInstances:o.slice(),appearance:new a,classificationType:this.classificationType}),this.appearanceType===ac&&(this.material=yr.getValue(e,this.materialProperty,this.material),n.appearance.material=this.material),i.add(n,this.zIndex),t=!1}else{l(n)&&(i.remove(n),n=void 0);let a=this.oldPrimitive;l(a)&&(i.remove(a),this.oldPrimitive=void 0)}this.attributes.removeAll(),this.primitive=n,this.createPrimitive=!1}else if(l(n)&&n.ready){n.show=!0,l(this.oldPrimitive)&&(i.remove(this.oldPrimitive),this.oldPrimitive=void 0),this.appearanceType===ac&&(this.material=yr.getValue(e,this.materialProperty,this.material),this.primitive.appearance.material=this.material);let s=this.updatersWithAttributes.values,a=s.length;for(r=0;r<a;r++){let c=s[r],d=c.entity,u=this.geometry.get(c.id),m=this.attributes.get(u.id.id);if(l(m)||(m=n.getGeometryInstanceAttributes(u.id),this.attributes.set(u.id.id,m)),!c.fillMaterialProperty.isConstant){let y=c.fillMaterialProperty.color,_=j.getValueOrDefault(y,e,U.WHITE,e_t);U.equals(m._lastColor,_)||(m._lastColor=U.clone(_,m._lastColor),m.color=$t.toValue(_,m.color))}let p=d.isShowing&&(c.hasConstantFill||c.isFilled(e)),b=m.show[0]===1;p!==b&&(m.show=Wn.toValue(p,m.show));let f=c.distanceDisplayConditionProperty;if(!j.isConstant(f)){let y=j.getValueOrDefault(f,e,n_t,t_t);Bt.equals(y,m._lastDistanceDisplayCondition)||(m._lastDistanceDisplayCondition=Bt.clone(y,m._lastDistanceDisplayCondition),m.distanceDisplayCondition=ti.toValue(y,m.distanceDisplayCondition))}}this.updateShows(n)}else l(n)&&!n.ready&&(t=!1);return t};wf.prototype.updateShows=function(e){let t=this.showsUpdated.values,n=t.length;for(let i=0;i<n;i++){let o=t[i],r=o.entity,s=this.geometry.get(o.id),a=this.attributes.get(s.id.id);l(a)||(a=e.getGeometryInstanceAttributes(s.id),this.attributes.set(s.id.id,a));let c=r.isShowing,d=a.show[0]===1;c!==d&&(a.show=Wn.toValue(c,a.show),s.attributes.show.value[0]=a.show[0])}this.showsUpdated.removeAll()};wf.prototype.contains=function(e){return this.updaters.contains(e.id)};wf.prototype.getBoundingSphere=function(e,t){let n=this.primitive;if(!n.ready)return Wt.PENDING;let i=n.getGeometryInstanceAttributes(e.entity);return!l(i)||!l(i.boundingSphere)||l(i.show)&&i.show[0]===0?Wt.FAILED:(i.boundingSphere.clone(t),Wt.DONE)};wf.prototype.destroy=function(){let e=this.primitive,t=this.orderedGroundPrimitives;l(e)&&t.remove(e);let n=this.oldPrimitive;l(n)&&t.remove(n),this.removeMaterialSubscription()};function dE(e,t,n){this._items=[],this._orderedGroundPrimitives=e,this._classificationType=t,this._asynchronous=n??!0}dE.prototype.add=function(e,t){let n=this._items,i=n.length,o=t.createFillGeometryInstance(e),r=j.getValueOrDefault(t.zIndex,0);for(let a=0;a<i;++a){let c=n[a];if(c.isMaterial(t)&&c.zIndex===r){c.add(e,t,o);return}}let s=new wf(this._orderedGroundPrimitives,this._classificationType,t.fillMaterialProperty,r,this._asynchronous);s.add(e,t,o),n.push(s)};dE.prototype.remove=function(e){let t=this._items,n=t.length;for(let i=n-1;i>=0;i--){let o=t[i];if(o.remove(e)){o.updaters.length===0&&(t.splice(i,1),o.destroy());break}}};dE.prototype.update=function(e){let t,n=this._items,i=n.length;for(t=i-1;t>=0;t--){let r=n[t];if(r.invalidated){n.splice(t,1);let s=r.updaters.values,a=s.length;for(let c=0;c<a;c++)this.add(e,s[c]);r.destroy()}}let o=!0;for(t=0;t<n.length;t++)o=n[t].update(e)&&o;return o};dE.prototype.getBoundingSphere=function(e,t){let n=this._items,i=n.length;for(let o=0;o<i;o++){let r=n[o];if(r.contains(e))return r.getBoundingSphere(e,t)}return Wt.FAILED};dE.prototype.removeAllPrimitives=function(){let e=this._items,t=e.length;for(let n=0;n<t;n++)e[n].destroy();this._items.length=0};var VM=dE;var i_t=[];function SVe(e,t){let n=e._batches,i=n.length;for(let o=0;o<i;o++)n[o].remove(t)}function ZVe(e,t,n){if(n.isDynamic){e._dynamicBatch.add(t,n);return}if(n.clampToGround&&n.fillEnabled){let s=n.classificationTypeProperty.getValue(t);e._groundBatches[s].add(t,n);return}let i;n.fillEnabled&&(i=n.shadowsProperty.getValue(t));let o=0;l(n.depthFailMaterialProperty)&&(o=n.depthFailMaterialProperty instanceof Qt?1:2);let r;l(i)&&(r=i+o*vn.NUMBER_OF_SHADOW_MODES),n.fillEnabled&&(n.fillMaterialProperty instanceof Qt?e._colorBatches[r].add(t,n):e._materialBatches[r].add(t,n))}function u0(e,t,n,i){i=i??e.groundPrimitives,n=n??e.primitives,this._scene=e,this._primitives=n,this._entityCollection=void 0,this._addedObjects=new kt,this._removedObjects=new kt,this._changedObjects=new kt;let o,r=vn.NUMBER_OF_SHADOW_MODES;for(this._colorBatches=new Array(r*3),this._materialBatches=new Array(r*3),o=0;o<r;++o)this._colorBatches[o]=new lh(n,ws,void 0,!1,o),this._materialBatches[o]=new dh(n,ac,void 0,!1,o),this._colorBatches[o+r]=new lh(n,ws,ws,!1,o),this._materialBatches[o+r]=new dh(n,ac,ws,!1,o),this._colorBatches[o+r*2]=new lh(n,ws,ac,!1,o),this._materialBatches[o+r*2]=new dh(n,ac,ac,!1,o);this._dynamicBatch=new oZ(n,i);let s=ni.NUMBER_OF_CLASSIFICATION_TYPES;for(this._groundBatches=new Array(s),o=0;o<s;++o)this._groundBatches[o]=new VM(i,o);this._batches=this._colorBatches.concat(this._materialBatches,this._dynamicBatch,this._groundBatches),this._subscriptions=new kt,this._updaters=new kt,this._entityCollection=t,t.collectionChanged.addEventListener(u0.prototype._onCollectionChanged,this),this._onCollectionChanged(t,t.values,i_t)}u0.prototype.update=function(e){let t=this._addedObjects,n=t.values,i=this._removedObjects,o=i.values,r=this._changedObjects,s=r.values,a,c,d,u;for(a=s.length-1;a>-1;a--)c=s[a],d=c.id,u=this._updaters.get(d),u.entity===c?(SVe(this,u),ZVe(this,e,u)):(o.push(c),n.push(c));for(a=o.length-1;a>-1;a--)c=o[a],d=c.id,u=this._updaters.get(d),SVe(this,u),u.destroy(),this._updaters.remove(d),this._subscriptions.get(d)(),this._subscriptions.remove(d);for(a=n.length-1;a>-1;a--)c=n[a],d=c.id,u=new CM(c,this._scene),this._updaters.set(d,u),ZVe(this,e,u),this._subscriptions.set(d,u.geometryChanged.addEventListener(u0._onGeometryChanged,this));t.removeAll(),i.removeAll(),r.removeAll();let m=!0,p=this._batches,b=p.length;for(a=0;a<b;a++)m=p[a].update(e)&&m;return m};var o_t=[],r_t=new me;u0.prototype.getBoundingSphere=function(e,t){let n=o_t,i=r_t,o=0,r,s=this._batches,a=s.length,c=this._updaters.get(e.id);for(let d=0;d<a;d++){if(r=s[d].getBoundingSphere(c,i),r===Wt.PENDING)return Wt.PENDING;r===Wt.DONE&&(n[o]=me.clone(i,n[o]),o++)}return o===0?Wt.FAILED:(n.length=o,me.fromBoundingSpheres(n,t),Wt.DONE)};u0.prototype.isDestroyed=function(){return!1};u0.prototype.destroy=function(){this._entityCollection.collectionChanged.removeEventListener(u0.prototype._onCollectionChanged,this),this._addedObjects.removeAll(),this._removedObjects.removeAll();let e,t=this._batches,n=t.length;for(e=0;e<n;e++)t[e].removeAllPrimitives();let i=this._subscriptions.values;for(n=i.length,e=0;e<n;e++)i[e]();return this._subscriptions.removeAll(),ue(this)};u0._onGeometryChanged=function(e){let t=this._removedObjects,n=this._changedObjects,i=e.entity,o=i.id;!l(t.get(o))&&!l(n.get(o))&&n.set(o,i)};u0.prototype._onCollectionChanged=function(e,t,n){let i=this._addedObjects,o=this._removedObjects,r=this._changedObjects,s,a,c;for(s=n.length-1;s>-1;s--)c=n[s],a=c.id,i.remove(a)||(o.set(a,c),r.remove(a));for(s=t.length-1;s>-1;s--)c=t[s],a=c.id,o.remove(a)?r.set(a,c):i.set(a,c)};var EM=u0;function qd(e){Dl.initializeTerrainHeights(),zh.initializeTerrainHeights();let t=e.scene,n=e.dataSourceCollection;this._eventHelper=new Hr,this._eventHelper.add(n.dataSourceAdded,this._onDataSourceAdded,this),this._eventHelper.add(n.dataSourceRemoved,this._onDataSourceRemoved,this),this._eventHelper.add(n.dataSourceMoved,this._onDataSourceMoved,this),this._eventHelper.add(t.postRender,this._postRender,this),this._dataSourceCollection=n,this._scene=t,this._visualizersCallback=e.visualizersCallback??qd.defaultVisualizersCallback;let i=!1,o=new xl,r=new xl;n.length>0&&(t.primitives.add(o),t.groundPrimitives.add(r),i=!0),this._primitives=o,this._groundPrimitives=r;for(let d=0,u=n.length;d<u;d++)this._onDataSourceAdded(n,n.get(d));let s=new ZY;this._onDataSourceAdded(void 0,s),this._defaultDataSource=s;let a,c;if(!i){let d=this,u=function(){t.primitives.add(o),t.groundPrimitives.add(r),a(),c(),d._removeDefaultDataSourceListener=void 0,d._removeDataSourceCollectionListener=void 0};a=s.entities.collectionChanged.addEventListener(u),c=n.dataSourceAdded.addEventListener(u)}this._removeDefaultDataSourceListener=a,this._removeDataSourceCollectionListener=c,this._ready=!1}var uE=[];qd.registerVisualizer=function(e){uE.includes(e)||uE.push(e)};qd.unregisterVisualizer=function(e){if(uE.includes(e)){let t=uE.indexOf(e);uE.splice(t,1)}};qd.defaultVisualizersCallback=function(e,t,n){let i=n.entities;return[new y2(t,i),new hM(e,i,n._primitives,n._groundPrimitives),new fM(t,i),new bM(e,i),new dY(e,i),new SM(t,i),new TM(e,i),new EM(e,i,n._primitives,n._groundPrimitives),...uE.map(o=>new o(e,i))]};Object.defineProperties(qd.prototype,{scene:{get:function(){return this._scene}},dataSources:{get:function(){return this._dataSourceCollection}},defaultDataSource:{get:function(){return this._defaultDataSource}},ready:{get:function(){return this._ready}}});qd.prototype.isDestroyed=function(){return!1};qd.prototype.destroy=function(){this._eventHelper.removeAll();let e=this._dataSourceCollection;for(let t=0,n=e.length;t<n;++t)this._onDataSourceRemoved(this._dataSourceCollection,e.get(t));return this._onDataSourceRemoved(void 0,this._defaultDataSource),l(this._removeDefaultDataSourceListener)?(this._removeDefaultDataSourceListener(),this._removeDataSourceCollectionListener()):(this._scene.primitives.remove(this._primitives),this._scene.groundPrimitives.remove(this._groundPrimitives)),ue(this)};qd.prototype.update=function(e){if(!Pi.initialized)return this._ready=!1,!1;let t=!0,n,i,o,r,s=this._dataSourceCollection,a=s.length;for(n=0;n<a;n++){let c=s.get(n);for(l(c.update)&&(t=c.update(e)&&t),o=c._visualizers,r=o.length,i=0;i<r;i++)t=o[i].update(e)&&t}for(o=this._defaultDataSource._visualizers,r=o.length,i=0;i<r;i++)t=o[i].update(e)&&t;return!this._ready&&t&&this._scene.requestRender(),this._ready=this._ready||t,t};qd.prototype._postRender=function(){let e=this._scene.frameState,t=this._dataSourceCollection,n=t.length;for(let i=0;i<n;i++){let o=t.get(i),r=o.credit;l(r)&&e.creditDisplay.addCreditToNextFrame(r);let s=o._resourceCredits;if(l(s)){let a=s.length;for(let c=0;c<a;c++)e.creditDisplay.addCreditToNextFrame(s[c])}}};var s_t=[],a_t=new me;qd.prototype.getBoundingSphere=function(e,t,n){if(!this._ready)return Wt.PENDING;let i,o,r=this._defaultDataSource;if(!r.entities.contains(e)){r=void 0;let p=this._dataSourceCollection;for(o=p.length,i=0;i<o;i++){let b=p.get(i);if(b.entities.contains(e)){r=b;break}}}if(!l(r))return Wt.FAILED;let s=s_t,a=a_t,c=0,d,u=r._visualizers,m=u.length;for(i=0;i<m;i++){let p=u[i];if(l(p.getBoundingSphere)){if(d=u[i].getBoundingSphere(e,a),!t&&d===Wt.PENDING)return Wt.PENDING;d===Wt.DONE&&(s[c]=me.clone(a,s[c]),c++)}}return c===0?Wt.FAILED:(s.length=c,me.fromBoundingSpheres(s,n),Wt.DONE)};qd.prototype._onDataSourceAdded=function(e,t){let n=this._scene,i=this._primitives,o=this._groundPrimitives,r=i.add(new xl),s=o.add(new YY);t._primitives=r,t._groundPrimitives=s;let a=t.clustering;a._initialize(n),r.add(a),t._visualizers=this._visualizersCallback(n,a,t)};qd.prototype._onDataSourceRemoved=function(e,t){let n=this._primitives,i=this._groundPrimitives,o=t._primitives,r=t._groundPrimitives,s=t.clustering;o.remove(s);let a=t._visualizers,c=a.length;for(let d=0;d<c;d++)a[d].destroy();n.remove(o),i.remove(r),t._visualizers=void 0};qd.prototype._onDataSourceMoved=function(e,t,n){let i=this._primitives,o=this._groundPrimitives,r=e._primitives,s=e._groundPrimitives;t===n+1?(i.raise(r),o.raise(s)):t===n-1?(i.lower(r),o.lower(s)):t===0?(i.lowerToBottom(r),o.lowerToBottom(s),i.raise(r),o.raise(s)):(i.raiseToTop(r),o.raiseToTop(s))};var AM=qd;var xKi=x(T(),1);var oKi=x(T(),1);function jee(e,t,n){this.heading=e??0,this.pitch=t??0,this.range=n??0}jee.clone=function(e,t){if(l(e))return l(t)||(t=new jee),t.heading=e.heading,t.pitch=e.pitch,t.range=e.range,t};var uh=jee;var RVe=new q,CVe=new q,VVe=new q,c_t=new P,k3=new h,EVe=new h,Qee=new h,qee=new h,AVe=new h,GVe=new h,l_t=new Ne,d_t=new h,u_t=new q,mE=new Q,m_t=1.25;function h_t(e,t,n,i,o,r,s,a,c,d){let u=e.scene.mode,m=o.getValue(c,e._lastCartesian);if(l(m)){let p=!1,b=!1,f,y,_;if(u===se.SCENE3D){Q.addSeconds(c,.001,mE);let L=o.getValue(mE,k3);if(l(L)||(Q.addSeconds(c,-.001,mE),L=o.getValue(mE,k3),b=!0),l(L)){let F=_t.computeFixedToIcrfMatrix(c,RVe),I=_t.computeFixedToIcrfMatrix(mE,CVe),N;!l(F)||!l(I)?(N=_t.computeTemeToPseudoFixedMatrix(c,VVe),F=q.transpose(N,RVe),I=_t.computeTemeToPseudoFixedMatrix(mE,CVe),q.transpose(I,I)):N=q.transpose(F,VVe);let g=q.multiplyByVector(F,m,AVe),V=q.multiplyByVector(I,L,GVe);h.subtract(g,V,qee);let G=h.magnitude(qee)*1e3,v=W.GRAVITATIONALPARAMETER,X=-v/(G*G-2*v/h.magnitude(g));X<0||X>m_t*d.maximumRadius?(f=EVe,h.normalize(m,f),h.negate(f,f),_=h.clone(h.UNIT_Z,Qee),y=h.cross(_,f,k3),h.magnitude(y)>W.EPSILON7&&(h.normalize(f,f),h.normalize(y,y),_=h.cross(f,y,Qee),h.normalize(_,_),p=!0)):h.equalsEpsilon(m,L,W.EPSILON7)||(_=EVe,h.normalize(g,_),h.normalize(V,V),y=h.cross(_,V,Qee),b&&(y=h.multiplyByScalar(y,-1,y)),h.equalsEpsilon(y,h.ZERO,W.EPSILON7)||(f=h.cross(y,_,k3),q.multiplyByVector(N,f,f),q.multiplyByVector(N,y,y),q.multiplyByVector(N,_,_),h.normalize(f,f),h.normalize(y,y),h.normalize(_,_),p=!0))}}l(e.boundingSphere)&&(m=e.boundingSphere.center);let S,Z,R;i&&(S=h.clone(t.position,qee),Z=h.clone(t.direction,AVe),R=h.clone(t.up,GVe));let C=c_t,E;l(s)&&(E=s.getValue(c,l_t));let A=r.getValue(c,d_t);if(a===bb.INERTIAL&&l(E))P.fromTranslationQuaternionRotationScale(m,E,h.ONE,C);else if(a===bb.VELOCITY&&l(A)){let L=_t.rotationMatrixFromPositionVelocity(m,A,d,u_t);P.fromRotationTranslation(L,m,C)}else a===bb.ENU||!p?_t.eastNorthUpToFixedFrame(m,d,C):(C[0]=f.x,C[1]=f.y,C[2]=f.z,C[3]=0,C[4]=y.x,C[5]=y.y,C[6]=y.z,C[7]=0,C[8]=_.x,C[9]=_.y,C[10]=_.z,C[11]=0,C[12]=m.x,C[13]=m.y,C[14]=m.z,C[15]=0);t._setTransform(C),i&&(h.clone(S,t.position),h.clone(Z,t.direction),h.clone(R,t.up),h.cross(Z,R,t.right))}if(n){let p=u===se.SCENE2D||h.equals(e._offset3D,h.ZERO)?void 0:e._offset3D;t.lookAtTransform(t.transform,p)}}function GM(e,t,n){this.entity=e,this.scene=t,this.ellipsoid=n??ne.default,this.boundingSphere=void 0,this._lastEntity=void 0,this._mode=void 0,this._lastCartesian=new h,this._defaultOffset3D=void 0,this._velocityProperty=new Lg(e.position,!0),this._offset3D=new h}Object.defineProperties(GM,{defaultOffset3D:{get:function(){return this._defaultOffset3D},set:function(e){this._defaultOffset3D=h.clone(e,new h)}}});GM.defaultOffset3D=new h(-14e3,3500,3500);var U3=new uh,f_t=new h;GM.prototype.update=function(e,t){let n=this.scene,i=this.ellipsoid,o=n.mode;if(o===se.MORPHING)return;let r=this.entity,s=r.trackingReferenceFrame,a=r.position;if(!l(a))return;let c=this._velocityProperty,d=r.orientation,u=r!==this._lastEntity,m=o!==this._mode,p=n.camera,b=u||m,f=!0;if(u){let y=r.viewFrom,_=l(y);if(!_&&l(t)){U3.pitch=-W.PI_OVER_FOUR,U3.range=0;let S=a.getValue(e,f_t);if(l(S)){let Z=2-1/Math.max(1,h.magnitude(S)/i.maximumRadius);U3.pitch*=Z}p.viewBoundingSphere(t,U3),this.boundingSphere=t,b=!1,f=!1}else(!_||!l(y.getValue(e,this._offset3D)))&&h.clone(GM._defaultOffset3D,this._offset3D)}else!m&&this._mode!==se.SCENE2D&&h.clone(p.position,this._offset3D);this._lastEntity=r,this._mode=o,h_t(this,p,b,f,a,c,d,s,e,i)};var LM=GM;var OQi=x(T(),1);var uQi=x(T(),1);var A4i=x(T(),1);m0();var xji=x(T(),1);var PJi=x(T(),1);gc();ZZ();xz();HM();var sAe={type:"module"},Zte="error",tSt="messageerror",aAe,Ste,cAe,Rte=!0;try{Rte=typeof structuredClone==Yr&&structuredClone(new DOMException("","AbortError")).code!==ke}catch{}oAe(nSt);function nSt(e,t){let{baseURI:n,chunkSize:i,workerStartupTimeout:o}=t,{wasmURI:r}=t;if(!e.interface){typeof r==Yr&&(r=r());let s;try{s=Zz(e.workerURI,n,e)}catch{return Tte(e),_te(e,t)}Object.assign(e,{worker:s,workerAlive:!1,terminated:!1,startupError:null,interface:{run:async()=>{try{return await iSt(e,{chunkSize:i,wasmURI:r,baseURI:n,workerStartupTimeout:o})}catch(a){if(a&&a.workerStartupFailed)return Tte(e),lAe(e),Sz(e,t);if(a&&a.codecImportFailed){if(e.reader)return lAe(e),Sz(e,t);e.onTaskFinished()}throw a}}}})}return e.interface}async function iSt(e,t){if(!e.worker){let{startupError:b}=e;e.startupError=null;let f=b||new Error(EZ);throw f.workerStartupFailed=!0,f}let n,i,o=new Promise((b,f)=>{n=b,i=f});Object.assign(e,{reader:null,writer:null,resolveResult:n,rejectResult:i,result:o});let{readable:r,options:s}=e,{writable:a,closed:c,abortPipe:d}=oSt(e.writable),u;try{u=Cte({type:qEe,options:s,config:t,readable:r,writable:a},e)}catch(b){d();try{await c}catch{}throw e.onTaskFinished(),b}u||Object.assign(e,{reader:r.getReader(),writer:a.getWriter()});let{workerStartupTimeout:m}=t;!e.workerAlive&&Number.isFinite(m)&&m>=0&&(e.startupTimeout=setTimeout(()=>rSt(e),m));try{let b=await o;return await p(),await c,b}catch(b){await p(),d();try{await c}catch{}throw b}async function p(){if(!u&&!a.locked)try{await a.getWriter().close()}catch{}}}function oSt(e){let t=new AbortController,{writable:n,readable:i}=new TransformStream,o=i.pipeTo(e,{preventClose:!0,preventAbort:!0,signal:t.signal});return o.catch(()=>{}),{writable:n,closed:o,abortPipe:()=>t.abort()}}function lAe(e){let{reader:t}=e;t&&t.releaseLock(),e.reader=null,e.writer=null}function Vte(e){let{worker:t}=e;if(t)try{t.terminate()}catch{}e.interface=null}function Zz(e,t,n,i,o=!0){let{createWorker:r}=n,s,a,c;if(r)s=r();else if(Ste===ke||aAe!==e){let d=typeof e==Yr;d?a=e(o):a=e;let u=a.startsWith("data:"),m=a.startsWith("blob:");if(u||m){i===ke&&(i=!1),i&&(c=sAe);try{s=new Worker(a,c)}catch(p){if(m)try{URL.revokeObjectURL(a)}catch{}if(d&&m)return Zz(e,t,n,i,!1);if(i)throw p;return Zz(e,t,n,!0,!1)}}else{i===ke&&(i=!0),i&&(c=sAe);try{a=new URL(a,t)}catch{}try{s=new Worker(a,c)}catch(p){if(i)return Zz(e,t,n,!1,o);throw p}}aAe=e,Ste=a,cAe=c}else s=new Worker(Ste,cAe);return s.addEventListener(QEe,d=>{n.workerAlive=!0,uAe(n),sSt(d,n)}),s.addEventListener(Zte,d=>dAe(d,n)),s.addEventListener(tSt,d=>dAe(d,n)),s}function rSt(e){if(e.startupTimeout=null,e.workerAlive)return;let{rejectResult:t,writer:n}=e;if(Vte(e),e.worker=null,t){let i=new Error(EZ);i.workerStartupFailed=!0,t(i),n&&n.releaseLock()}}function uAe(e){let{startupTimeout:t}=e;t&&(clearTimeout(t),e.startupTimeout=null)}function dAe(e,t){e.preventDefault&&e.preventDefault(),uAe(t);let{workerAlive:n,rejectResult:i,writer:o,onTaskFinished:r}=t;Vte(t),n||(t.worker=null);let s=e.error||new Error(e.message||Zte);n||(s=Object.assign(new Error(s.message||Zte),{workerStartupFailed:!0}),t.startupError=s),i&&(i(s),o&&o.releaseLock(),n&&r())}function Cte(e,{worker:t,writer:n,transferStreams:i,workerAlive:o}){try{let{value:r,readable:s,writable:a}=e,c=[];if(r&&(e.value=nz(r),c.push(e.value.buffer)),i&&Rte&&o?(s&&c.push(s),a&&c.push(a)):e.readable=e.writable=null,c.length)try{return t.postMessage(e,c),!0}catch{Rte=!1,e.readable=e.writable=null,t.postMessage(e)}else t.postMessage(e)}catch(r){throw n&&n.releaseLock(),r}}async function sSt({data:e},t){let{type:n,value:i,messageId:o,result:r,error:s}=e,{reader:a,writer:c,resolveResult:d,rejectResult:u,onTaskFinished:m,generation:p}=t,b=()=>t.generation!=p;try{if(s){let{message:y,stack:_,code:S,name:Z,outputSize:R,cause:C,codecImportFailed:E}=s,A=new Error(y);Object.assign(A,{stack:_,code:S,name:Z,outputSize:R}),C&&(A.cause=Object.assign(new Error(C.message),{name:C.name})),E&&(A.codecImportFailed=!0),f(A)}else{if(n==$Ee){let{value:y,done:_}=await a.read();b()||Cte({type:bte,value:y,done:_,messageId:o},t)}n==bte&&(await c.ready,await c.write(new Uint8Array(i)),b()||Cte({type:eAe,messageId:o},t)),n==tAe&&f(null,r)}}catch(y){b()||(Vte(t),f(y))}function f(y,_){b()||(y?u(y):d(_),c&&c.releaseLock(),y&&y.codecImportFailed||m())}}Hne();var Yji=x(T(),1);var Fji=x(T(),1);gc();m0();CZ();HM();Ez();vz();ste();ZZ();SE();ene();vM();var rie="File already exists",sie="Zip file comment exceeds 64KB",uGe="Invalid zip file comment (must be a Uint8Array)",mGe="File entry comment exceeds 64KB",hGe="Invalid file entry comment (must be a string)",fGe="Invalid date (must be a valid Date instance)",pGe="File entry name exceeds 64KB",aie="Version exceeds 65535",bGe="The strength must equal 1, 2, or 3",gGe="Encryption is not supported in USDZ files",yGe="Encryption is not supported when the 'passThrough' option is set",xGe="Invalid extra field (must be a Map)",TGe="Invalid extra field type (must be integer 0..65535)",_Ge="Invalid extra field data (must be a Uint8Array)",cH="Extra field data exceeds 64KB",CZt="Compression method not supported",SGe=-2147483648,ZGe=2147483647,tGe=BigInt(0),nGe=BigInt("0x7fffffffffffffff"),lH="Zip64 is not supported (set the 'zip64' option to 'true')",RGe="Undefined uncompressed size",CGe="Undefined compression method";var VGe="Undefined reader",EGe="Zip file not empty",AGe="Invalid uid (must be integer 0..2^32-1)",GGe="Invalid gid (must be integer 0..2^32-1)",LGe="Invalid UNIX mode (must be integer 0..65535)",WGe="Invalid unixExtraFieldType (must be 'infozip' or 'unix')",vGe="uid/gid must be 0..65535 for unixExtraFieldType 'unix' (use 'infozip' for larger ids)",FGe="Invalid msdosAttributesRaw (must be integer 0..255)",IGe="Invalid msdosAttributes (must be an object with boolean flags)",PGe="Invalid level (must be integer 0..9)",XGe="Signature data exceeds 64KB",iGe=new Uint8Array([7,0,2,0,65,69,3,0,0]),VZt=4,EZt=9,AZt=67,GZt=1,eie="infozip",tie="unix",LZt=9,Kne=0,oGe=[],lw=class{constructor(t,n={}){t=new FE(t);let{availableSize:i=TZ,maxSize:o=TZ}=t,r=i>0&&i!==TZ&&o>0&&o!==TZ;Object.assign(this,{writer:t,addSplitZipSignature:r,options:n,fileEntries:new Map,filenames:new Set,offset:n[WM]===ke?t.size||t.writable.size||0:n[WM],initialOffset:n[WM]===ke?0:n[WM]-(t.size||t.writable.size||0),pendingAddFileCalls:new Set,pendingErrors:[],bufferedWrites:0,lastFileEntry:ke})}prependZip(t){return Jne(this,WZt(this,t))}appendZip(t){return Jne(this,this.appendZipEntries(t))}async appendZipEntries(t){let n=this,{pendingAddFileCalls:i,filenames:o,fileEntries:r}=n;for(;i.size;)await Promise.allSettled(Array.from(i));let s,a=new Promise(u=>s=u);i.add(a);let c=[],d;try{t=new kg(t),await Nc(t),(t.size===ke||!t.readUint8Array)&&(t=new eu(await p0(t.readable)),await Nc(t));let{ZipReader:u}=await Promise.resolve().then(()=>(Hne(),QAe)),m=new u(t),p=await m.getEntries();await m.close(),await Nc(n.writer);let{directoryOffset:b}=m;p.forEach(({filename:_})=>{if(o.has(_))throw new Error(rie);o.add(_),c.push(_)}),n.writerLocked=!0;let{lockWriter:f}=n;n.lockWriter=new Promise(_=>d=()=>{n.writerLocked=!1,_()}),await f,n.addSplitZipSignature&&(delete n.addSplitZipSignature,await jZt(t)||(await T0(n.writer,YGe()),n.offset+=4));let y=await QZt(n,t,p,b);p.forEach(_=>{let{version:S,rawLastModDate:Z,rawFilename:R,bitFlag:C,encrypted:E,uncompressedSize:A,compressedSize:L,extraFieldZip64:F}=_,{compressionMethod:I,rawExtraField:N}=_,{level:g,languageEncodingFlag:V,dataDescriptor:G}=C;N=NGe(N||yo),_.extraFieldAES&&(I=99);let v=so(N),X=!!F&&F.uncompressedSize!==ke,Y=!!F&&F.compressedSize!==ke,D=DGe(g,V,G,E,I)&-7|g<<1,{headerArray:M,headerView:O}=UGe({version:S,bitFlag:D,compressionMethod:I,uncompressedSize:A,compressedSize:L,rawLastModDate:Z,rawFilename:R,zip64CompressedSize:Y,zip64UncompressedSize:X,extraFieldLength:v}),{crc32:w}=_;w!==ke&&Yc(O,10,w);let{offset:z,diskNumberStart:K}=y.get(_);Object.assign(_,{zip64UncompressedSize:X,zip64CompressedSize:Y,offset:z,diskNumberStart:K,zip64DiskNumberStart:!1,rawExtraFieldZip64:yo,rawExtraFieldAES:yo,rawExtraFieldExtendedTimestamp:yo,rawExtraFieldNTFS:yo,rawExtraFieldUnix:yo,rawExtraField:N,rawCentralExtraField:yo,extendedTimestamp:!1,headerArray:M,headerView:O}),r.set(_.filename,_)})}catch(u){throw c.forEach(m=>o.delete(m)),u}finally{s(),i.delete(a),d&&d()}}add(t="",n,i={}){let o=this,{pendingAddFileCalls:r}=o,s=vZt(o,t,n,i);r.add(s);let a=()=>r.delete(s);return Promise.prototype.then.call(s,a,a),Jne(o,s)}remove(t){let{filenames:n,fileEntries:i}=this;if(typeof t==_Z&&(t=i.get(t)),t&&t.filename!==ke){let{filename:o}=t;if(n.has(o)&&i.has(o))return n.delete(o),i.delete(o),!0}return!1}async close(t=yo,n={}){let i=this,{pendingAddFileCalls:o,writer:r}=this,{writable:s}=r;if(!(t instanceof Uint8Array))throw new Error(uGe);if(so(t)>65535)throw new Error(sie);for(;o.size;)await Promise.allSettled(Array.from(o));await Promise.allSettled(i.pendingErrors.map(d=>d.recorded));let a=i.pendingErrors.filter(d=>d.error&&!d.observed);if(a.length){let d=a.map(m=>m.error);a.forEach(m=>m.observed=!0);let[u]=d;try{u.entryErrors=d}catch{}throw u}return await BZt(i,t,n),!Wz(r)&&Qi(i,n,j3)||await s.getWriter().close(),r.getData?r.getData():s}};var nie=class extends Promise{then(t,n){let{watcher:i}=this;return i&&(i.observed=!0),super.then(t,n)}};function Jne(e,t){let n=new nie((o,r)=>Promise.prototype.then.call(t,o,r)),i={};return n.watcher=i,i.recorded=Promise.prototype.then.call(n,ke,o=>i.error=o),e.pendingErrors.push(i),n}async function WZt(e,t){if(e.filenames.size)throw new Error(EGe);await e.appendZipEntries(t)}async function vZt(e,t,n,i){if(i=Object.assign({},i),Qi(e,i,GZ)&&!t.endsWith("/")&&(t+="/"),e.filenames.has(t))throw new Error(rie);e.filenames.add(t),Kne<Yg().maxWorkers?Kne++:await new Promise(o=>oGe.push(o));try{return await FZt(e,t,n,i)}catch(o){throw e.filenames.delete(t),o}finally{let o=oGe.shift();o?o():Kne--}}async function FZt(e,t,n,i){let o=IZt(e,t,i);({name:t}=o);let r=PZt(e,t,i),{comment:s}=r,a=i[Nz];e.fileEntries.set(t,ke);let c=e.lastFileEntry,d={},u;r.resolvedOptions.keepOrder&&(d.lockFileEntry=new Promise(p=>u=p)),e.lastFileEntry=d;let m;try{let{resolvedOptions:p}=r;p.level!=0&&p.compressionMethod===ke&&!p.passThrough&&!await rAe(Yg())&&(p.level=0);let b=await XZt(e,n,r,i);({reader:n}=b);let f=dw(e.writer),y=Og(e.writer);i=Object.assign({},i,o.resolvedOptions,r.resolvedOptions,b.resolvedOptions,{signature:i[Xz],crc32:i.crc32===ke?i[Xz]:i.crc32,offset:e.offset-f,diskNumberStart:y,[fE]:e.options[fE]});let _=wZt(i),S=UZt(i),Z=so(_.localHeaderArray,S.dataDescriptorArray);m=await YZt(e,t,n,{headerInfo:_,dataDescriptorInfo:S,metadataSize:Z,fileEntry:d,previousFileEntry:c,releaseLockFileEntry:u},i)}catch(p){throw e.fileEntries.delete(t),p}finally{u&&u(c&&c.lockFileEntry)}return Object.assign(m,{name:t,comment:s,extraField:a,[Fz]:m.internalFileAttributes,[Iz]:m.externalFileAttributes}),new cT(m)}function IZt(e,t,n){let i=Qi(e,n,Dte),o=Qi(e,n,zte,i?20:768),r=Qi(e,n,Kte),s=OE(e,n,"uid"),a=OE(e,n,"gid"),c=OE(e,n,jte),d=Qi(e,n,iEe),u=Qi(e,n,Qte),m=Qi(e,n,qte),p=Qi(e,n,$te);if(bE(s,4294967295,AGe),bE(a,4294967295,GGe),bE(c,65535,LGe),d!==ke&&d!==eie&&d!==tie)throw new Error(WGe);if(d===tie&&(s!==ke&&s>65535||a!==ke&&a>65535))throw new Error(vGe);d===ke&&(s!==ke||a!==ke)&&(d=eie);let b=OE(e,n,kte),f=Qi(e,n,Ute),y=s!==ke||a!==ke||c!==ke||d||r,_=b!==ke||f!==ke;if(y?(i=!1,o=o&255|768):_&&(i=!0,o=o&255),bE(b,255,FGe),f&&(typeof f!==LVe||Array.isArray(f)))throw new Error(IGe);if(o>65535)throw new Error(aie);let S=kGe(e,n,wte,Iz),Z=S!==ke;Z||(S=0),!n[GZ]&&t.endsWith("/")&&(n[GZ]=!0);let R=Qi(e,n,GZ);if(R?(t.endsWith("/")||(t+="/"),Z||(S=16,i||(S|=16877<<16))):!i&&!Z&&(r?S=493<<16:S=420<<16),!i){let A=c!==ke||!!(u||m||p),L=S>>16&65535;c=c===ke?L:c&65535,u?c|=2048:u=!!(c&2048),m?c|=1024:m=!!(c&1024),p?c|=512:p=!!(c&512),(!Z||A)&&(R?c=c&-61441|16384:c&61440||(c|=32768),S=(c&65535)<<16|S&65535)}({msdosAttributesRaw:b,msdosAttributes:f}=kZt(b,f)),_&&(S=S&4294967295|b&255);let C=S>>16&65535,E=c!==ke&&(c&61440)==40960;return{name:t,resolvedOptions:{versionMadeBy:o,msDosCompatible:!!i,externalFileAttributes:S,unixExternalUpper:C,uid:s,gid:a,unixMode:c,unixExtraFieldType:d,symlink:E,setuid:u,setgid:m,sticky:p,msdosAttributesRaw:b,msdosAttributes:f}}}function PZt(e,t,n){let i=iie(e,n,nEe)||yE,o=i(t,Q3);if(o===ke&&(o=yE(t)),so(o)>65535)throw new Error(pGe);let r=n[qM]||"";if(typeof r!=_Z)throw new Error(hGe);let s=i(r,q3);if(s===ke&&(s=yE(r)),so(s)>65535)throw new Error(mGe);let a=Qi(e,n,Bte);if(a!==ke&&a>65535)throw new Error(aie);let c=$ne(e,n,IE,new Date),d=Qi(e,n,PE),u=$ne(e,n,ew),m=$ne(e,n,tw),p=kGe(e,n,Mte,Fz,0),b=Qi(e,n,B3),f=Qi(e,n,D3),y=Qi(e,n,O3);tz(f,y);let _=OE(e,n,zVe,3),S=Qi(e,n,Hte),Z=Qi(e,n,HVe,!0),R=Qi(e,n,KVe),C=Qi(e,n,JVe,!0),E=Qi(e,n,H3),A=Qi(e,n,J3),L=Qi(e,n,QVe),F=iie(e,n,qVe),I=Qi(e,n,$Ve,!0),N=ez(Qi(e,n,z3)),g=Qi(e,n,eEe,!0),V=Qi(e,n,Jte),G=b||V===ke?ke:uz(V);if(!b&&V!==ke&&V!==0&&V!==8&&!G)throw new Error(CZt);let v=OE(e,n,jVe);if(bE(v,LZt,PGe),e.options[fE]){if(f!==ke||y!==ke)throw new Error(gGe);v===ke&&V===ke&&(v=0)}b&&(v=ke);let X=Qi(e,n,K3),Y=Qi(e,n,ete);L&&Y===ke&&(Y=!1),(Y===ke||S&&!b)&&(Y=!0),v!==ke&&v!=6&&(X=!1);let D=Qi(e,n,Pz);if(!S&&(f!==ke||y!==ke)&&!(Number.isInteger(_)&&_>=1&&_<=3))throw new Error(bGe);let M=jne(n[Nz]),O=jne(n[oEe]),w=jne(n[rEe]);return{comment:r,resolvedOptions:{rawFilename:o,rawComment:s,version:a,lastModDate:c,rawLastModDate:d,lastAccessDate:u,creationDate:m,internalFileAttributes:p,passThrough:b,password:f,rawPassword:y,encryptionStrength:_,zipCrypto:S,extendedTimestamp:Z,ntfsTimestamp:R,keepOrder:C,useWebWorkers:E,transferStreams:A,bufferedWrite:L,createTempStream:F,dataDescriptorSignature:I,signal:N,useUnicodeFileNames:g,compressionMethod:V,format:G?G.format:ke,codecURI:G?G.codecURI:ke,codecVersionNeeded:G?G.versionNeeded:ke,level:v,useCompressionStream:X,dataDescriptor:Y,zip64:D,rawExtraField:M,rawLocalExtraField:O,rawCentralExtraField:w}}}function jne(e){if(!e)return yo;if(!(e instanceof Map))throw new Error(xGe);let t=0,n=0;e.forEach((r,s)=>{if(ite(s,65535,TGe),!(r instanceof Uint8Array))throw new Error(_Ge);if(so(r)>65535)throw new Error(cH);t+=4+so(r)});let i=new Uint8Array(t),o=fi(i);return e.forEach((r,s)=>{x0(o,n,s),x0(o,n+2,so(r)),hw(i,r,n+4),n+=4+so(r)}),i}async function XZt(e,t,{resolvedOptions:n},i){if(n.passThrough&&!t&&!Qi(e,i,GZ))throw new Error(VGe);let o;return t&&(t=new kg(t),await Nc(t),{size:o}=t),Object.assign({reader:t},NZt(e,!!t,o,n,i))}function NZt(e,t,n,i,o){let{passThrough:r,zipCrypto:s,password:a,rawPassword:c,encryptionStrength:d}=i,{dataDescriptor:u,zip64:m,level:p,compressionMethod:b}=i,f=0,y=0;if(r&&t){if(y=o[$M],y===ke)throw new Error(RGe);if(b===ke)throw new Error(CGe)}let _=m===!0,S=Qi(e,o,Ote);if(t&&r&&!S&&so(a,c))throw new Error(yGe);let Z=t&&(!!(a&&so(a)||c&&so(c))||r&&S);t||(p=0,b=0);let R=Z?s?12:16+d*4:0;t&&(r?(o.uncompressedSize=y,f=n===ke?dGe(y)+R:n):n===ke?(u=!0,(m||m===ke)&&(m=!0,y=f=4294967296)):(o.uncompressedSize=y=n,f=(oie(b,p)?dGe(y):y)+R));let C=!Z&&(!t||n===0&&!r)&&!oie(b,p);C&&!s&&Qi(e,o,ete)===ke&&(u=!1);let E=_||y>=4294967295,A=_||f>=4294967295;if(E||A){if(m===!1)throw new Error(lH);m=!0}return m=m||!1,{maximumCompressedSize:f,resolvedOptions:{dataDescriptor:u,emptyEntry:C,zip64:m,zip64UncompressedSize:E,zip64CompressedSize:A,uncompressedSize:y,level:p,compressionMethod:b,encrypted:Z}}}async function YZt(e,t,n,i,o){let{fileEntries:r,writer:s}=e,{keepOrder:a,dataDescriptor:c,emptyEntry:d,signal:u}=o,{headerInfo:m,fileEntry:p,previousFileEntry:b,releaseLockFileEntry:f}=i,y=e.options[fE],_=p,S,Z,R,C,E,A=0,L,F=a&&b?b.lockFileEntry:ke;r.set(t,_);try{o.bufferedWrite||!a||e.writerLocked||e.bufferedWrites||!c&&!d?(S=!0,e.bufferedWrites++,o.createTempStream?L=await o.createTempStream():L=new TransformStream(ke,ke,{highWaterMark:TZ}),L.size=0,await Nc(s)):(L=s,await F,await I()),await Nc(L);let g=dw(s);e.addSplitZipSignature&&!S&&await aGe(e,s),y&&!S&&rGe(i,e.offset-g);let{localHeaderArray:V}=m;S||await N();let G=Og(s),v=uw(e,s);if(_.diskNumberStart=G,S||(C=!0,E=s.size,await T0(L,V)),_=await MZt(n,L,_,i,Yg(),o),S||(C=!1),r.set(t,_),_.filename=t,S){if(await Promise.all([L.writable.getWriter().close(),F]),await I(),e.addSplitZipSignature&&await aGe(e,s),R=!0,E=s.size,await N(),_.diskNumberStart=Og(s),_.offset=uw(e,s),y){let X=i.metadataSize;rGe(i,e.offset-dw(s)),_.size+=i.metadataSize-X}OZt(_,m.localHeaderView,o),await T0(s,m.localHeaderArray),await MGe(L.readable,s,u,X=>A+=X),s.size+=L.size,R=!1}else _.diskNumberStart=G,_.offset=v;return e.offset+=_.size,_}catch(g){if(R||C){if(e.hasCorruptedEntries=!0,g)try{g.corruptedEntry=!0}catch{}e.offset+=s.size-E,S&&(e.offset+=A)}throw r.delete(t),g}finally{if(S&&e.bufferedWrites--,f&&f(F),Z&&Z(),S&&L&&L.dispose)try{await L.dispose()}catch{}}async function I(){e.writerLocked=!0;let{lockWriter:g}=e;e.lockWriter=new Promise(V=>Z=()=>{e.writerLocked=!1,V()}),await g}async function N(){BE(s,so(m.localHeaderArray))&&await s.closeDisk()}}async function MZt(e,t,{diskNumberStart:n,lockFileEntry:i},o,r,s){let{headerInfo:a,dataDescriptorInfo:c,metadataSize:d}=o,{headerArray:u,headerView:m,lastModDate:p,rawLastModDate:b,encrypted:f,compressed:y,version:_,compressionMethod:S,rawExtraFieldZip64:Z,localExtraFieldZip64Length:R,rawExtraFieldExtendedTimestamp:C,extraFieldExtendedTimestampFlag:E,rawExtraFieldNTFS:A,rawExtraFieldUnix:L,rawExtraFieldAES:F}=a,{dataDescriptorArray:I}=c,{rawFilename:N,lastAccessDate:g,creationDate:V,password:G,rawPassword:v,level:X,zip64:Y,zip64UncompressedSize:D,zip64CompressedSize:M,zipCrypto:O,dataDescriptor:w,directory:z,executable:K,versionMadeBy:te,rawComment:H,rawExtraField:$,rawCentralExtraField:ee,useWebWorkers:le,transferStreams:_e,onstart:he,onprogress:Ze,onend:ye,signal:Ge,encryptionStrength:Ae,extendedTimestamp:Fe,msDosCompatible:tt,internalFileAttributes:Be,externalFileAttributes:je,uid:qe,gid:We,unixMode:Ke,symlink:ct,setuid:Et,setgid:zt,sticky:ut,unixExternalUpper:bt,msdosAttributesRaw:ht,msdosAttributes:jt,useCompressionStream:st,passThrough:pt,format:Mi,codecURI:jn}=s,Si={lockFileEntry:i,versionMadeBy:te,zip64:Y,directory:!!z,executable:!!K,filenameUTF8:!0,rawFilename:N,commentUTF8:!0,rawComment:H,rawExtraFieldZip64:Z,localExtraFieldZip64Length:R,rawExtraFieldExtendedTimestamp:C,rawExtraFieldNTFS:A,rawExtraFieldUnix:L,rawExtraFieldAES:F,rawExtraField:$,rawCentralExtraField:ee,extendedTimestamp:Fe,msDosCompatible:tt,internalFileAttributes:Be,externalFileAttributes:je,diskNumberStart:n,uid:qe,gid:We,unixMode:Ke,symlink:!!ct,setuid:Et,setgid:zt,sticky:ut,unixExternalUpper:bt,msdosAttributesRaw:ht,msdosAttributes:jt},{crc32:Hi,uncompressedSize:Gi}=s,pi=0;pt||(Gi=0);let{writable:Zi}=t;if(e){let On=Uf(Lte(e)),rn=e.size,Hn={options:{codecType:EE,inputSize:rn,level:X,rawPassword:v,password:G,encryptionStrength:Ae,zipCrypto:f&&O,passwordVerification:f&&O&&b>>8&255,computeCrc32:!pt,compressed:y&&!pt,encrypted:f&&!pt,useWebWorkers:le,useCompressionStream:st,transferStreams:_e,format:Mi,codecURI:jn,compressionMethod:S},config:r,streamOptions:{signal:Ge,size:rn,onstart:he,onprogress:Ze,onend:ye}};try{let $i=await Vz({readable:On,writable:Zi},Hn);if(pi=$i.outputSize,t.size+=pi,pt||(Gi=$i.inputSize,(!f||O)&&(Hi=$i.crc32)),!M&&pi>=4294967295||!D&&Gi>=4294967295)throw new Error(lH)}catch($i){throw $i.outputSize!==ke&&(t.size+=$i.outputSize),$i}}return DZt({crc32:Hi,compressedSize:pi,uncompressedSize:Gi,headerInfo:a,dataDescriptorInfo:c},s),w&&await T0(t,I),Object.assign(Si,{uncompressedSize:Gi,compressedSize:pi,lastModDate:p,rawLastModDate:b,creationDate:V,lastAccessDate:g,encrypted:!!f,zipCrypto:!!O,size:d+pi,compressionMethod:S,version:_,headerArray:u,headerView:m,signature:Hi,crc32:f&&!O&&!pt?ke:Hi,extraFieldExtendedTimestampFlag:E,zip64UncompressedSize:D,zip64CompressedSize:M}),Si}function wZt(e){let{rawFilename:t,lastModDate:n,rawLastModDate:i,lastAccessDate:o,creationDate:r,level:s,zip64:a,zipCrypto:c,useUnicodeFileNames:d,dataDescriptor:u,directory:m,rawExtraField:p,rawLocalExtraField:b,encryptionStrength:f,extendedTimestamp:y,ntfsTimestamp:_,passThrough:S,encrypted:Z,zip64UncompressedSize:R,zip64CompressedSize:C,uncompressedSize:E,crc32:A}=e,{version:L,compressionMethod:F}=e,I=!m&&oie(F,s),N,g=S||!I,V=a&&(e.bufferedWrite||!u||!R&&!C||g),G=V||a&&u&&(R||C);if(a&&(R||C)){let ye=em(20);if(ye.writeUint16(1),ye.writeUint16(16),N=ye.array,V&&(ye.writeUint64(E),g)){let Ge=Z?c?12:16+f*4:0;ye.writeUint64(S?0:E+Ge)}}else N=yo;let v;if(Z&&!c){let Ze=em(so(iGe)+2);Ze.writeUint16(39169),Ze.writeBytes(iGe),v=Ze.array,v[8]=f}else v=yo;let X,Y,D;if(y){let Ze=rH(n),ye=wGe(Ze);if(ye){let Ae=9+(o?4:0)+(r?4:0),Fe=em(Ae);D=1+(o?2:0)+(r?4:0),Fe.writeUint16(21589),Fe.writeUint16(Ae-4),Fe.writeUint8(D),Fe.writeUint32(Ze),o&&Fe.writeUint32(cGe(rH(o))),r&&Fe.writeUint32(cGe(rH(r))),Y=Fe.array}else Y=yo;if(_===ke?!ye||!!(o||r):_)try{let Ae=qne(n),Fe=em(36);Fe.writeUint16(10),Fe.writeUint16(32),Fe.skip(4),Fe.writeUint16(1),Fe.writeUint16(24),Fe.writeUint64(Ae),Fe.writeUint64(o?qne(o):Ae),Fe.writeUint64(r?qne(r):Ae),X=Fe.array}catch{X=yo}else X=yo}else X=Y=yo;let M;try{let{uid:Ze,gid:ye,unixExtraFieldType:Ge}=e;if(Ge==eie&&(Ze!==ke||ye!==ke)){let Ae=sGe(Ze===ke?0:Ze),Fe=sGe(ye===ke?0:ye),tt=3+Ae.length+Fe.length,Be=em(4+tt);Be.writeUint16(30837),Be.writeUint16(tt),Be.writeUint8(1),Be.writeUint8(Ae.length),Be.writeBytes(Ae),Be.writeUint8(Fe.length),Be.writeBytes(Fe),M=Be.array}else if(Ge==tie&&(Ze!==ke||ye!==ke)){let Ae=em(8);Ae.writeUint16(30805),Ae.writeUint16(4),Ae.writeUint16((Ze===ke?0:Ze)&65535),Ae.writeUint16((ye===ke?0:ye)&65535),M=Ae.array}else M=yo}catch{M=yo}F===ke&&(F=I?8:0),L===ke&&(L=F==0&&!m&&!Z?10:20);let{codecVersionNeeded:O}=e;I&&O!==ke&&(L=L>O?L:O),a&&(L=L>45?L:45),Z&&!c&&(L=L>51?L:51,S&&A!==ke&&(v[VZt]=GZt),x0(fi(v),EZt,F),F=99);let w=G?so(N):0,z=w+so(v,Y,X,M,p,b),K=e[fE]?AZt:0;if(z+K>65535)throw new Error(cH);let te=new Date(Math.ceil(Math.floor(n.getTime()/1e3)/2)*2e3),{headerArray:H,headerView:$,rawLastModDate:ee}=UGe({version:L,bitFlag:DGe(s,d,u,Z,F),compressionMethod:F,uncompressedSize:E,lastModDate:te<hE?hE:te>$ee?$ee:te,rawLastModDate:i,rawFilename:t,zip64CompressedSize:C,zip64UncompressedSize:R,extraFieldLength:z}),le=em(30+so(t)+z),_e=le.array,he=fi(_e);return le.writeUint32(67324752),le.writeBytes(H),le.writeBytes(t),G&&le.writeBytes(N),le.writeBytes(v),le.writeBytes(Y),le.writeBytes(X),le.writeBytes(M),le.writeBytes(p),le.writeBytes(b),u&&(C||Yc(he,18,0),R||Yc(he,22,0)),{localHeaderArray:_e,localHeaderView:he,headerArray:H,headerView:$,lastModDate:n,rawLastModDate:ee,encrypted:Z,compressed:I,version:L,compressionMethod:F,extraFieldExtendedTimestampFlag:D,rawExtraFieldZip64:yo,localExtraFieldZip64Length:w,rawExtraFieldExtendedTimestamp:Y,rawExtraFieldNTFS:X,rawExtraFieldUnix:M,rawExtraFieldAES:v,extraFieldLength:z}}function rGe(e,t){let{headerInfo:n}=e,{localHeaderArray:i,extraFieldLength:o}=n,r=64-(t+so(i))%64;r<4&&(r+=64);let s=new Uint8Array(r),a=fi(s);x0(a,0,6534),x0(a,2,r-4);let c=i;n.localHeaderArray=i=new Uint8Array(so(c)+r),hw(i,c),hw(i,s,so(c));let d=fi(i);x0(d,28,o+r),n.localHeaderView=d,e.metadataSize+=r}function sGe(e){let t=new Uint8Array(4);fi(t).setUint32(0,e,!0);let i=4;for(;i>1&&t[i-1]===0;)i--;return t.subarray(0,i)}function kZt(e,t){if(e!==ke)e=e&255;else if(t!==ke){let{readOnly:n,hidden:i,system:o,directory:r,archive:s}=t,a=0;n&&(a|=1),i&&(a|=2),o&&(a|=4),r&&(a|=16),s&&(a|=32),e=a&255}return t===ke&&(t={readOnly:!!(e&1),hidden:!!(e&2),system:!!(e&4),directory:!!(e&16),archive:!!(e&32)}),{msdosAttributesRaw:e,msdosAttributes:t}}function UZt({zip64:e,dataDescriptor:t,dataDescriptorSignature:n}){let i=yo,o,r=0,s=e?20:12;return n&&(s+=4),t&&(i=new Uint8Array(s),o=fi(i),n&&(r=4,Yc(o,0,134695760))),{dataDescriptorArray:i,dataDescriptorView:o,dataDescriptorOffset:r}}function DZt({crc32:e,compressedSize:t,uncompressedSize:n,headerInfo:i,dataDescriptorInfo:o},{zip64:r,zipCrypto:s,passThrough:a,dataDescriptor:c}){let{headerView:d,encrypted:u}=i,{dataDescriptorView:m,dataDescriptorOffset:p}=o;(!u||s||a)&&e!==ke&&(Yc(d,10,e),c&&Yc(m,p,e)),r?c&&(mw(m,p+4,BigInt(t)),mw(m,p+12,BigInt(n))):(Yc(d,14,t),Yc(d,18,n),c&&(Yc(m,p+4,t),Yc(m,p+8,n)))}function OZt({rawFilename:e,encrypted:t,zip64:n,localExtraFieldZip64Length:i,crc32:o,compressedSize:r,uncompressedSize:s,zip64UncompressedSize:a,zip64CompressedSize:c},d,{dataDescriptor:u,passThrough:m}){if(u||((!t||m&&o!==ke)&&Yc(d,14,o),c||Yc(d,18,r),a||Yc(d,22,s)),n&&i){let p=30+so(e)+4;mw(d,p,BigInt(s)),mw(d,p+8,BigInt(r))}}async function BZt(e,t,n){let i=zZt(e.fileEntries),{directoryStart:o,directoryEnd:r,directoryArray:s}=await HZt(e,i,n),a=await KZt(e,s,n);await JZt(e,t,n,{directoryStart:o,directoryEnd:r,directoryDataLength:i,signatureLength:a})}function zZt(e){let t=0;for(let[,n]of e){let{rawFilename:i,rawExtraFieldAES:o,rawComment:r,rawExtraFieldNTFS:s,rawExtraFieldUnix:a,rawExtraField:c,rawCentralExtraField:d,extendedTimestamp:u,extraFieldExtendedTimestampFlag:m,lastModDate:p,zip64UncompressedSize:b,zip64CompressedSize:f,uncompressedSize:y,compressedSize:_}=n,S=n.offset>=4294967295,Z=n.diskNumberStart>=65535,R;if(S||Z||b||f){let L=4+(b?8:0)+(f?8:0)+(S?8:0)+(Z?4:0),F=em(L);F.writeUint16(1),F.writeUint16(L-4),b&&F.writeUint64(y),f&&F.writeUint64(_),S&&F.writeUint64(n.offset),Z&&F.writeUint32(n.diskNumberStart),R=F.array}else R=yo;n.rawExtraFieldZip64=R,n.zip64Offset=S,n.zip64DiskNumberStart=Z;let C,E=rH(p);if(u&&wGe(E)){let L=em(9);L.writeUint16(21589),L.writeUint16(5),L.writeUint8(m),L.writeUint32(E),C=L.array}else C=yo;n.rawExtraFieldExtendedTimestamp=C;let A=so(R,o,s,a,C,c,d);if(A>65535)throw new Error(cH);t+=46+so(i,r)+A}return t}async function HZt(e,t,n){let{fileEntries:i,writer:o}=e,r=new Uint8Array(t);await Nc(o);let s=0,a=0,c=Og(o),d=dw(o),u=0;for(let[m,p]of Array.from(i.values()).entries()){let{offset:b,rawFilename:f,rawExtraFieldZip64:y,rawExtraFieldAES:_,rawExtraFieldExtendedTimestamp:S,rawExtraFieldNTFS:Z,rawExtraFieldUnix:R,rawExtraField:C,rawCentralExtraField:E,rawComment:A,versionMadeBy:L,headerArray:F,headerView:I,zip64UncompressedSize:N,zip64CompressedSize:g,zip64DiskNumberStart:V,zip64Offset:G,internalFileAttributes:v,externalFileAttributes:X,diskNumberStart:Y,uncompressedSize:D,compressedSize:M}=p,O=so(y,_,S,Z,R,C,E),w=46+so(f,A)+O;BE(o,s+w-a)&&(await T0(o,r.slice(a,s)),a=s,u=0,await o.closeDisk()),m==0&&(c=Og(o),d=dw(o)),N||Yc(I,18,D),g||Yc(I,14,M),(G||V)&&p.version<45&&x0(I,0,45);let z=em(w);if(z.writeUint32(33639248),z.writeUint16(L),z.writeBytes(F.subarray(0,24)),z.writeUint16(O),z.writeUint16(so(A)),z.writeUint16(V?65535:Y),z.writeUint16(v),z.writeUint32(X),z.writeUint32(G?4294967295:b),z.writeBytes(f),z.writeBytes(y),z.writeBytes(_),z.writeBytes(S),z.writeBytes(Z),z.writeBytes(R),z.writeBytes(C),z.writeBytes(E),z.writeBytes(A),hw(r,z.array,s),s+=w,u++,n.onprogress)try{await n.onprogress(m+1,i.size,new cT(p))}catch{}}return await T0(o,a?r.slice(a):r),{directoryStart:{diskNumber:c,diskOffset:d},directoryEnd:{diskNumber:Og(o),entriesLength:u},directoryArray:r}}async function KZt(e,t,n){let i=iie(e,n,dEe);if(i){let o=await i(t),r=so(o);if(r>65535)throw new Error(XGe);let s=em(6+r);s.writeUint32(84233040),s.writeUint16(r),s.writeBytes(o);let{writer:a}=e;return BE(a,so(s.array))&&await a.closeDisk(),await T0(a,s.array),6+r}return 0}async function JZt(e,t,n,i){let{writer:o}=e,{directoryStart:r,directoryEnd:s,signatureLength:a}=i,{directoryDataLength:c}=i,d=e.fileEntries.size,u=r.diskNumber,m=uw(e,r),p=so(t);if(p>65535)throw new Error(sie);let b=Qi(e,n,Pz),f=Og(o);if(BE(o,(b?98:22)+p)&&f++,m>=4294967295||c>=4294967295||d>=65535||f>=65535){if(b===!1)throw new Error(lH);b=!0}let y=em(b?98:22);BE(o,so(y.array)+p)&&await o.closeDisk(),f=Og(o);let _=f==s.diskNumber?s.entriesLength:0;b&&(y.writeUint32(101075792),y.writeUint64(44),y.writeUint16(45),y.writeUint16(45),y.writeUint32(f),y.writeUint32(u),y.writeUint64(_),y.writeUint64(d),y.writeUint64(c),y.writeUint64(m),y.writeUint32(117853008),y.writeUint32(f),y.writeUint64(BigInt(uw(e,o))+BigInt(c)+BigInt(a)),y.writeUint32(f+1),Qi(e,n,tEe,!0)&&(f=65535,u=65535),_=65535,d=65535,m=4294967295,c=4294967295),y.writeUint32(101010256),y.writeUint16(f),y.writeUint16(u),y.writeUint16(_),y.writeUint16(d),y.writeUint32(c),y.writeUint32(m),y.writeUint16(p),await T0(o,y.array),p&&await T0(o,t)}function em(e){let t=new Uint8Array(e),n=fi(t),i=0;return{array:t,writeUint8:o=>{eRt(n,i,o),i+=1},writeUint16:o=>{x0(n,i,o),i+=2},writeUint32:o=>{Yc(n,i,o),i+=4},writeUint64:o=>{mw(n,i,BigInt(o)),i+=8},writeBytes:o=>{hw(t,o,i),i+=so(o)},skip:o=>i+=o}}function Og(e){let{diskNumber:t=0}=e;return t}function dw(e){let{diskOffset:t=0}=e;return t}function BE(e,t){let{availableSize:n=TZ}=e;return t>n}function uw(e,{diskNumber:t=0,diskOffset:n=0}){return e.offset-n-(t?e.initialOffset:0)}async function jZt(e){let t=await Mr(e,0,4);return $Zt(fi(t),0)==134695760}function NGe(e){let t=fi(e),n=0;for(;n+4<=so(e);){let i=4+aH(t,n+2);if(aH(t,n)==1)return NGe(mh(e.subarray(0,n),e.subarray(Math.min(n+i,so(e)))));n+=i}return e}async function QZt(e,t,n,i){let{writer:o}=e,r=new Map;if(o.closeDisk){let s=Array.from(n).sort((c,d)=>oH(t,c)-oH(t,d)),a=0;for(let c of s){let d=oH(t,c);await Qne(e,t,a,d-a),BE(o,await qZt(t,d))&&await o.closeDisk(),r.set(c,{offset:uw(e,o),diskNumberStart:Og(o)}),a=d}await Qne(e,t,a,i-a)}else{let s=e.offset;await Qne(e,t,0,i),n.forEach(a=>r.set(a,{offset:s+oH(t,a),diskNumberStart:0}))}return r}async function Qne(e,t,n,i){if(i>0){let{writer:o}=e,r=0;try{await MGe(Lte(t,{offset:n,size:i}),o,ke,s=>r+=s)}catch(s){e.hasCorruptedEntries=!0;try{s.corruptedEntry=!0}catch{}throw s}finally{o.size+=r,e.offset+=r}}}async function qZt(e,t){let n=await Mr(e,t,30);if(so(n)<30)return 30;let i=fi(n);return 30+aH(i,26)+aH(i,28)}function oH(e,{offset:t,diskNumberStart:n}){return t+(e.getDiskOffset?e.getDiskOffset(n):0)}function YGe(){let e=new Uint8Array(4);return Yc(fi(e),0,134695760),e}async function aGe(e,t){delete e.addSplitZipSignature,await T0(t,YGe()),e.offset+=4}async function T0(e,t){let{writable:n}=e,i=n.getWriter();try{await i.ready,e.size+=so(t),await i.write(t)}finally{i.releaseLock()}}async function MGe(e,t,n,i){let o=t.writable.getWriter();try{await e.pipeTo(new WritableStream({async write(r){await o.ready,await o.write(r),i(so(r))}}),{preventClose:!0,preventAbort:!0,signal:n})}finally{o.releaseLock()}}function qne(e){if(e){let t=(BigInt(e.getTime())+BigInt(116444736e5))*BigInt(1e4);return t<tGe?tGe:t>nGe?nGe:t}}function rH(e){return Math.floor(e.getTime()/1e3)}function wGe(e){return e>=SGe&&e<=ZGe}function cGe(e){return Math.min(ZGe,Math.max(SGe,e))}function Qi(e,t,n,i){let o=t[n]===ke?e.options[n]:t[n];return o===ke?i:o}function $ne(e,t,n,i){let o=Qi(e,t,n,i);if(o===null)return i;if(o!==ke&&(typeof o.getTime!=Yr||Number.isNaN(o.getTime())))throw new Error(fGe);return o}function iie(e,t,n){return pE(Qi(e,t,n))}function kGe(e,t,n,i,o){let r=lGe(t,n,i),s=r===ke?lGe(e.options,n,i):r;return s===ke?o:s}function lGe(e,t,n){return e[t]===ke?e[n]:e[t]}function OE(e,t,n,i){return SZ(Qi(e,t,n,i))}function dGe(e){return e+5*(Math.floor(e/16383)+1)}function oie(e,t){return e===ke?t===ke||t>0:e!==0}function aH(e,t){return e.getUint16(t,!0)}function $Zt(e,t){return e.getUint32(t,!0)}function eRt(e,t,n){e.setUint8(t,n)}function x0(e,t,n){e.setUint16(t,n,!0)}function Yc(e,t,n){e.setUint32(t,n,!0)}function mw(e,t,n){e.setBigUint64(t,n,!0)}function hw(e,t,n){e.set(t,n)}function so(...e){let t=0;return e.forEach(n=>n&&(t+=n.length)),t}function UGe({version:e,bitFlag:t,compressionMethod:n,uncompressedSize:i,compressedSize:o,lastModDate:r,rawLastModDate:s,rawFilename:a,zip64CompressedSize:c,zip64UncompressedSize:d,extraFieldLength:u}){let m=em(26),p=m.array,b=fi(p);if(m.writeUint16(e),m.writeUint16(t),m.writeUint16(n),s===ke){let f=new Uint32Array(1),y=fi(f);x0(y,0,(r.getHours()<<6|r.getMinutes())<<5|r.getSeconds()/2),x0(y,2,(r.getFullYear()-1980<<4|r.getMonth()+1)<<5|r.getDate()),s=f[0]}return m.writeUint32(s),m.skip(4),c||o!==ke?m.writeUint32(c?4294967295:o):m.skip(4),d||i!==ke?m.writeUint32(d?4294967295:i):m.skip(4),m.writeUint16(so(a)),m.writeUint16(u),{headerArray:p,headerView:b,rawLastModDate:s}}function DGe(e,t,n,i,o){let r=0;return t&&(r=r|2048),n&&(r=r|8),(o==8||o==9)&&(e>=0&&e<=3&&(r=r|6),e>3&&e<=5&&(r=r|4),e==9&&(r=r|2)),i&&(r=r|1),r}vz();vM();var kji=x(T(),1);m0();CZ();var Hji=x(T(),1);gc();m0();CZ();pte();var Jji=x(T(),1);var qji=x(T(),1);var jji=1024*1024;var n4i=x(T(),1);SE();var e4i=1024*1024;var s4i=x(T(),1);var i4i=1024*1024;var o4i=512*1024;var nRt={};try{gE({baseURI:nRt.url})}catch{}var cQi=x(T(),1);m0();var U4i=x(T(),1),iRt=[3,4,5,6,7,8,9,10,11,13,15,17,19,23,27,31,35,43,51,59,67,83,99,115,131,163,195,227,258],oRt=[0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0],rRt=[1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577],sRt=[0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13],aRt=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15],pw=new Uint8Array(288);pw.fill(8,0,144),pw.fill(9,144,256),pw.fill(7,256,280),pw.fill(8,280,288);var cRt=new Uint8Array(30).fill(5);function fw(e){let t=new Uint16Array(16);for(let o of e)t[o]++;t[0]=0;let n=new Uint16Array(17);for(let o=1;o<=15;o++)n[o+1]=n[o]+t[o];let i=new Uint16Array(e.length);for(let o=0;o<e.length;o++)e[o]&&(i[n[e[o]]++]=o);return{l:t,symbols:i}}var tm="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";function OGe(e){let t;e({wasmURI:()=>(t||(t="data:application/wasm;base64,"+(function(n){let i="",o=n.length,r=0;for(;r+2<o;r+=3){let a=n[r]<<16|n[r+1]<<8|n[r+2];i+=tm[a>>18&63]+tm[a>>12&63]+tm[a>>6&63]+tm[63&a]}let s=o-r;if(s===1){let a=n[r]<<16;i+=tm[a>>18&63]+tm[a>>12&63]+"=="}else if(s===2){let a=n[r]<<16|n[r+1]<<8;i+=tm[a>>18&63]+tm[a>>12&63]+tm[a>>6&63]+"="}return i})((function(n){let i=0,o=0,r=0,s=new Uint8Array(1024),a=0,c=0;for(;!c;){c=u(1);let _=u(2);if(_==0)m();else if(_==1)p(fw(pw),fw(cRt));else{if(_!=2)throw new Error("invalid deflate block type");p(...b())}}return s.subarray(0,a);function d(){if(i>=n.length)throw new Error("unexpected end of deflate data");return n[i++]}function u(_){for(;r<_;)o|=d()<<r,r+=8;let S=o&(1<<_)-1;return o>>>=_,r-=_,S}function m(){o=0,r=0;let _=d()|d()<<8;i+=2,y(a+_);for(let S=0;S<_;S++)s[a++]=d()}function p(_,S){let Z=f(_);for(;Z!=256;){if(Z<256)y(a+1),s[a++]=Z;else{let R=Z-257,C=iRt[R]+u(oRt[R]),E=f(S),A=rRt[E]+u(sRt[E]);y(a+C);let L=a-A;for(let F=0;F<C;F++)s[a++]=s[L+F]}Z=f(_)}}function b(){let _=u(5)+257,S=u(5)+1,Z=u(4)+4,R=new Uint8Array(19);for(let L=0;L<Z;L++)R[aRt[L]]=u(3);let C=fw(R),E=new Uint8Array(_+S),A=0;for(;A<E.length;){let L=f(C);if(L<16)E[A++]=L;else if(L==16){let F=E[A-1],I=u(2)+3;for(;I--;)E[A++]=F}else A+=L==17?u(3)+3:u(7)+11}return[fw(E.subarray(0,_)),fw(E.subarray(_))]}function f(_){let{l:S,symbols:Z}=_,R=0,C=0,E=0;for(let A=1;A<=15;A++){R|=u(1);let L=S[A];if(R-C<L)return Z[E+(R-C)];E+=L,C=C+L<<1,R<<=1}throw new Error("invalid huffman code")}function y(_){if(s.length<_){let S=2*s.length;for(;S<_;)S*=2;let Z=new Uint8Array(S);Z.set(s.subarray(0,a)),s=Z}}})((function(n){let i=(n=String(n).replace(/[^A-Za-z0-9+/=]/g,"")).length,o=[];for(let r=0;r<i;r+=4){let s=tm.indexOf(n[r])<<18|tm.indexOf(n[r+1])<<12|(63&tm.indexOf(n[r+2]))<<6|63&tm.indexOf(n[r+3]);o.push(s>>16&255),n[r+2]!=="="&&o.push(s>>8&255),n[r+3]!=="="&&o.push(255&s)}return new Uint8Array(o)})("zb19kF3XcSd2vu7He/fdmTvAABzigUTfK0gaSxiBkqghRarWc2jODIcgBCXRH/6DVSQEDkXcBwJ8M08Q5ZX5hp+mbUnLcqlcjEsbY72qWOVIFVWFu6GztEXb9Fq70Wa5iVKljVUp1WYrqz82tXJKteVKKUT46z73fQwGIEhq7XAKfOd+ndOnT5/uPn26+6jT249qpZS+t/OgGQ718EGN/5nhUD1oh+GGFNWDSj2o9PDBeMj/6eGDyXBUdEN+RT+hh/YTd8baGe2SRCudqpbGf0qpVGltrLa2FWUqUq7tXNt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7/LOmVECA2DN1Zy6UZXqw8qr0+pJ9SdK6yeRpspqp2Od6o4u9IImfYte0Q9Ott+02bSFNg6qg+oGdYNaUAvqRnWjOqQOqa7qqsPqsLpJ3aRW1Ip6p/23Adc7u/6eDH9Phb+nw98z4e/Z8PfCz6H/eke/Otlu017TznPqOfVr6tfU8+p59evq19VvqN9Qv6l+U31JfUl9WX1ZfUV9RdFdSu2kSmmt1M1aqVml1KU1pVRL+nezknvc13Bvv1IqUf7SXHZSNj/H/8yuf3bXP7frXzT1z7+wL9vcXdXuT5vX4/AvCf/S8K8V/rXDvyz864R/Of/zr+7P3tNUnzQTZ26fSpNW3I4y17G5mdGzyv/1/uzRhNt2KuV/iserUGkox6zVp+EdUGOLYSn4flPGKEmZ3iwrjTJKRisnZaONVkVL+R/PZy06oQWr/x8=")))),t)})}var oQi=x(T(),1);gc();m0();HM();Ez();var K4i=x(T(),1);var O4i=x(T(),1),mH="deflate",dH="deflate-raw",BGe="deflate64-raw",uH="gzip",Ls,zE,Bg,bw,zGe;function HGe(e){if(Ls=e,{malloc:zE,free:Bg,memory:bw}=Ls,typeof zE!="function"||typeof Bg!="function"||!bw)throw Ls=zE=Bg=bw=null,new Error("Invalid WASM module")}function KGe(e){zGe=e}function JGe(e,t,n={}){if(!Ls){let a=new Error("WASM module not loaded");throw a.cause=zGe,a}let i=typeof n.level=="number"?n.level:-1,o=typeof n.outBuffer=="number"?n.outBuffer:64*1024,r=typeof n.inBufferSize=="number"?n.inBufferSize:64*1024;return new TransformStream({start(){try{let a;if(this.out=zE(o),this.in=zE(r),this.inBufferSize=r,!this.out||!this.in)throw new Error("allocation failed");if(this._scratch=new Uint8Array(o),e?(this._process=Ls.deflate_process,this._last_consumed=Ls.deflate_last_consumed,this._end=Ls.deflate_end,this.streamHandle=Ls.deflate_new(),t===uH?a=Ls.deflate_init_gzip(this.streamHandle,i):t===dH?a=Ls.deflate_init_raw(this.streamHandle,i):a=Ls.deflate_init(this.streamHandle,i)):t===BGe?(this._process=Ls.inflate9_process,this._last_consumed=Ls.inflate9_last_consumed,this._end=Ls.inflate9_end,this.streamHandle=Ls.inflate9_new(),a=Ls.inflate9_init_raw(this.streamHandle)):(this._process=Ls.inflate_process,this._last_consumed=Ls.inflate_last_consumed,this._end=Ls.inflate_end,this.streamHandle=Ls.inflate_new(),t===dH?a=Ls.inflate_init_raw(this.streamHandle):t===uH?a=Ls.inflate_init_gzip(this.streamHandle):a=Ls.inflate_init(this.streamHandle)),a!==0)throw new Error("init failed:"+a)}catch(a){throw s(this),a}},transform(a,c){try{let d=a,u=new Uint8Array(bw.buffer),m=this._process,p=this._last_consumed,b=this.out,f=this._scratch,y=0;for(;y<d.length;){let _=Math.min(d.length-y,32768);if((!this.in||this.inBufferSize<_)&&(this.in&&Bg&&(Bg(this.in),this.in=0),this.in=zE(_),this.inBufferSize=_,!this.in))throw new Error("allocation failed");u.set(d.subarray(y,y+_),this.in);let S=m(this.streamHandle,this.in,_,b,o,0),Z=S&16777215;if(Z&&(f.set(u.subarray(b,b+Z),0),c.enqueue(f.slice(0,Z))),!e){let C=S>>24&255,E=C&128?C-256:C;if(E<0)throw new Error("process error:"+E)}let R=p(this.streamHandle);if(R===0)break;y+=R}}catch(d){s(this),c.error(d)}},flush(a){try{let c=new Uint8Array(bw.buffer),d=this._process,u=this.out,m=this._scratch;for(;;){let p=d(this.streamHandle,0,0,u,o,4),b=p&16777215,f=p>>24&255;if(!e){let y=f&128?f-256:f;if(y<0)throw new Error("process error:"+y)}if(b&&(m.set(c.subarray(u,u+b),0),a.enqueue(m.slice(0,b))),f===1||b===0)break}}catch(c){a.error(c)}finally{let c=s(this);c!==0&&a.error(new Error("end error:"+c))}},cancel(){s(this)}});function s(a){let c=0;return a.streamHandle&&a._end&&(c=a._end(a.streamHandle)),a.streamHandle=0,a.in&&Bg&&Bg(a.in),a.in=0,a.out&&Bg&&Bg(a.out),a.out=0,c}}var XZ=class{constructor(t=mH,n){return JGe(!0,t,n)}},NZ=class{constructor(t=mH,n){return JGe(!1,t,n)}};XZ.requiresModule=!0;NZ.requiresModule=!0;XZ.supportedFormats=[mH,dH,uH];NZ.supportedFormats=[mH,dH,uH,BGe];var jGe=!1;async function QGe(e,{baseURI:t}){if(!jGe)try{await lRt(e,t),jGe=!0}catch(n){throw KGe(n),n}}async function lRt(e,t){let n,i;try{try{i=new URL(e,t)}catch{}n=await(await fetch(i)).arrayBuffer()}catch(r){if(e.startsWith("data:application/wasm;base64,"))n=dRt(e);else throw r}let o=await WebAssembly.instantiate(n);HGe(o.instance.exports)}function dRt(e){let t=e.split(",")[1],n=atob(t),i=n.length,o=new Uint8Array(i);for(let r=0;r<i;++r)o[r]=n.charCodeAt(r);return o.buffer}var hH;iAe({initModule:e=>{if(!hH){let{wasmURI:t}=e;typeof t==Yr&&(t=t()),hH=QGe(t,e).catch(n=>{throw hH=null,n})}return hH}});gE({CompressionStreamFallback:XZ,DecompressionStreamFallback:NZ});OGe(gE);var cie=32,uRt="http://www.opengis.net/kml/2.2",Bf="http://www.google.com/kml/ext/2.2",mRt="http://www.w3.org/2000/xmlns/";function fH(e){this._files={},this._promises=[],this._count=0,this._modelCallback=e}var hRt=/^data:image\/([^,;]+)/;fH.prototype.texture=function(e){let t=this,n;if(typeof e=="string"||e instanceof ve){if(e=ve.createIfNeeded(e),!e.isDataUri)return e.url;let i=e.url.match(hRt);n=`texture_${++this._count}`,l(i)&&(n+=`.${i[1]}`);let o=e.fetchBlob().then(function(r){t._files[n]=r});return this._promises.push(o),n}if(e instanceof HTMLCanvasElement){n=`texture_${++this._count}.png`;let i=new Promise(o=>{e.toBlob(function(r){t._files[n]=r,o()})});return this._promises.push(i),n}return""};function fRt(e,t){return function(n){e._files[t]=n}}fH.prototype.model=function(e,t){let n=this._modelCallback;if(!l(n))throw new ae("Encountered a model entity while exporting to KML, but no model callback was supplied.");let i={},o=n(e,t,i);for(let r in i)if(i.hasOwnProperty(r)){let s=Promise.resolve(i[r]);this._promises.push(s),s.then(fRt(this,r))}return o};Object.defineProperties(fH.prototype,{promise:{get:function(){return Promise.all(this._promises)}},files:{get:function(){return this._files}}});function pH(e){this._time=e}pH.prototype.get=function(e,t,n){let i;return l(e)&&(i=l(e.getValue)?e.getValue(this._time,n):e),i??t};pH.prototype.getColor=function(e,t){let n=this.get(e,t);if(l(n))return MZ(n)};pH.prototype.getMaterialType=function(e){if(l(e))return e.getType(this._time)};function lie(){this._ids={},this._styles={},this._count=0}lie.prototype.get=function(e){let t=this._ids,n=e.innerHTML;if(l(t[n]))return t[n];let i=`style-${++this._count}`;return e.setAttribute("id",i),i=`#${i}`,t[n]=i,this._styles[n]=e,i};lie.prototype.save=function(e){let t=this._styles,n=e.childNodes[0];for(let i in t)t.hasOwnProperty(i)&&e.insertBefore(t[i],n)};function eLe(){this._ids={}}eLe.prototype.get=function(e){if(!l(e))return this.get(Qn());let t=this._ids;return l(t[e])?`${e.toString()}-${++t[e]}`:(t[e]=0,e)};function die(e){e=e??B.EMPTY_OBJECT;let t=e.entities,n=e.kmz??!1,i=die._createState(e),o=t.values.filter(function(d){return!l(d.parent)}),r=i.kmlDoc,s=r.documentElement;s.setAttributeNS(mRt,"xmlns:gx",Bf);let a=r.createElement("Document");s.appendChild(a),nLe(i,a,o),i.styleCache.save(a);let c=i.externalFileHandler;return c.promise.then(function(){let u=new XMLSerializer().serializeToString(i.kmlDoc);return n?pRt(u,c.files):{kml:u,externalFiles:c.files}})}async function pRt(e,t){let n=en("ThirdParty/Workers/zip-web-worker.js"),i=en("ThirdParty/zip-module.wasm");IM({workerURI:n,wasmURI:i});let o=new vE("application/vnd.google-earth.kmz"),r=new lw(o);await r.add("doc.kml",new jM(e));let s=Object.keys(t);return await tLe(r,s,t,0),await r.close(),{kmz:await o.getData()}}async function tLe(e,t,n,i){if(t.length===i)return;let o=t[i];return await e.add(o,new eu(n[o])),tLe(e,t,n,i+1)}die._createState=function(e){let t=e.entities,n=new lie,i=t.computeAvailability(),o=l(e.time)?e.time:i.start,r=e.defaultAvailability??i,s=e.sampleDuration??60;r.start===ot.MINIMUM_VALUE?r.stop===ot.MAXIMUM_VALUE?r=new Cn:Q.addSeconds(r.stop,-10*s,r.start):r.stop===ot.MAXIMUM_VALUE&&Q.addSeconds(r.start,10*s,r.stop);let a=new fH(e.modelCallback);return{kmlDoc:document.implementation.createDocument(uRt,"kml"),ellipsoid:e.ellipsoid??ne.default,idManager:new eLe,styleCache:n,externalFileHandler:a,time:o,valueGetter:new pH(o),sampleDuration:s,defaultAvailability:new Vs([r])}};function nLe(e,t,n){let i=e.kmlDoc,o=e.styleCache,r=e.valueGetter,s=e.idManager,a=n.length,c,d,u;for(let m=0;m<a;++m){let p=n[m];c=[],d=[],u=[],bRt(e,p,d,u),gRt(e,p.polyline,d,u),$Ge(e,p.rectangle,d,u,c),$Ge(e,p.polygon,d,u,c),_Rt(e,p,p.model,d,u);let b,f=p.availability;l(f)&&(b=i.createElement("TimeSpan"),Q.equals(f.start,ot.MINIMUM_VALUE)||b.appendChild(En(i,"begin",Q.toIso8601(f.start))),Q.equals(f.stop,ot.MAXIMUM_VALUE)||b.appendChild(En(i,"end",Q.toIso8601(f.stop))));for(let S=0;S<c.length;++S){let Z=c[S];Z.setAttribute("id",s.get(p.id)),Z.appendChild(En(i,"name",p.name)),Z.appendChild(En(i,"visibility",p.show)),Z.appendChild(En(i,"description",p.description)),l(b)&&Z.appendChild(b),t.appendChild(Z)}let y=d.length;if(y>0){let S=i.createElement("Placemark");S.setAttribute("id",s.get(p.id));let Z=p.name,R=p.label;if(l(R)){let E=i.createElement("LabelStyle"),A=r.get(R.text);Z=l(A)&&A.length>0?A:Z;let L=r.getColor(R.fillColor);l(L)&&(E.appendChild(En(i,"color",L)),E.appendChild(En(i,"colorMode","normal")));let F=r.get(R.scale);l(F)&&E.appendChild(En(i,"scale",F)),u.push(E)}S.appendChild(En(i,"name",Z)),S.appendChild(En(i,"visibility",p.show)),S.appendChild(En(i,"description",p.description)),l(b)&&S.appendChild(b),t.appendChild(S);let C=u.length;if(C>0){let E=i.createElement("Style");for(let A=0;A<C;++A)E.appendChild(u[A]);S.appendChild(En(i,"styleUrl",o.get(E)))}if(d.length===1)S.appendChild(d[0]);else if(d.length>1){let E=i.createElement("MultiGeometry");for(let A=0;A<y;++A)E.appendChild(d[A]);S.appendChild(E)}}let _=p._children;if(_.length>0){let S=i.createElement("Folder");S.setAttribute("id",s.get(p.id)),S.appendChild(En(i,"name",p.name)),S.appendChild(En(i,"visibility",p.show)),S.appendChild(En(i,"description",p.description)),t.appendChild(S),nLe(e,S,_)}}}var nu=new h,hd=new pe,Of=new Q;function bRt(e,t,n,i){let o=e.kmlDoc,r=e.ellipsoid,s=e.valueGetter,a=t.billboard??t.point;if(!l(a)&&!l(t.path))return;let c=t.position;if(!c.isConstant){iLe(e,t,a,n,i);return}s.get(c,void 0,nu);let d=En(o,"coordinates",YZ(nu,r)),u=o.createElement("Point"),m=o.createElement("altitudeMode");m.appendChild(wZ(e,a.heightReference)),u.appendChild(m),u.appendChild(d),n.push(u);let p=a instanceof jc?rLe(e,a):oLe(e,a);i.push(p)}function iLe(e,t,n,i,o){let r=e.kmlDoc,s=e.ellipsoid,a=e.valueGetter,c,d=t.position,u=!0;d instanceof hc?(c=d.intervals,u=!1):c=t.availability??e.defaultAvailability;let m=n instanceof Sb,p,b,f,y=[];for(p=0;p<c.length;++p){let S=c.get(p),Z=u?d:S.data,R=r.createElement("altitudeMode");Z instanceof l0?(Z=Z._value,R.appendChild(wZ(e,He.CLAMP_TO_GROUND))):l(n)?R.appendChild(wZ(e,n.heightReference)):R.appendChild(wZ(e,He.NONE));let C=[],E=[];if(Z.isConstant){a.get(Z,void 0,nu);let L=En(r,"coordinates",YZ(nu,s));C.push(Q.toIso8601(S.start)),E.push(L),C.push(Q.toIso8601(S.stop)),E.push(L)}else if(Z instanceof pc)for(f=Z._property._times,b=0;b<f.length;++b)C.push(Q.toIso8601(f[b])),Z.getValueInReferenceFrame(f[b],Oi.FIXED,nu),E.push(YZ(nu,s));else if(Z instanceof Ku){f=Z._times;let L=Z._values;for(b=0;b<f.length;++b)C.push(Q.toIso8601(f[b])),h.fromArray(L,b*3,nu),E.push(YZ(nu,s))}else{let L=e.sampleDuration;S.start.clone(Of),S.isStartIncluded||Q.addSeconds(Of,L,Of);let F=S.stop;for(;Q.lessThan(Of,F);)Z.getValue(Of,nu),C.push(Q.toIso8601(Of)),E.push(YZ(nu,s)),Q.addSeconds(Of,L,Of);S.isStopIncluded&&Q.equals(Of,F)&&(Z.getValue(Of,nu),C.push(Q.toIso8601(Of)),E.push(YZ(nu,s)))}let A=r.createElementNS(Bf,"Track");A.appendChild(R);for(let L=0;L<C.length;++L){let F=En(r,"when",C[L]),I=En(r,"coord",E[L],Bf);A.appendChild(F),A.appendChild(I)}m&&A.appendChild(sLe(e,n)),y.push(A)}if(y.length===1)i.push(y[0]);else if(y.length>1){let S=r.createElementNS(Bf,"MultiTrack");for(p=0;p<y.length;++p)S.appendChild(y[p]);i.push(S)}if(l(n)&&!m){let S=n instanceof jc?rLe(e,n):oLe(e,n);o.push(S)}let _=t.path;if(l(_)){let S=a.get(_.width),Z=_.material;if(l(Z)||l(S)){let R=r.createElement("LineStyle");l(S)&&R.appendChild(En(r,"width",S)),uie(e,Z,R),o.push(R)}}}function oLe(e,t){let n=e.kmlDoc,i=e.valueGetter,o=n.createElement("IconStyle"),r=i.getColor(t.color);l(r)&&(o.appendChild(En(n,"color",r)),o.appendChild(En(n,"colorMode","normal")));let s=i.get(t.pixelSize);return l(s)&&o.appendChild(En(n,"scale",s/cie)),o}function rLe(e,t){let n=e.kmlDoc,i=e.valueGetter,o=e.externalFileHandler,r=n.createElement("IconStyle"),s=i.get(t.image);if(l(s)){s=o.texture(s);let p=n.createElement("Icon");p.appendChild(En(n,"href",s));let b=i.get(t.imageSubRegion);l(b)&&(p.appendChild(En(n,"x",b.x,Bf)),p.appendChild(En(n,"y",b.y,Bf)),p.appendChild(En(n,"w",b.width,Bf)),p.appendChild(En(n,"h",b.height,Bf))),r.appendChild(p)}let a=i.getColor(t.color);l(a)&&(r.appendChild(En(n,"color",a)),r.appendChild(En(n,"colorMode","normal")));let c=i.get(t.scale);l(c)&&r.appendChild(En(n,"scale",c));let d=i.get(t.pixelOffset);if(l(d)){c=c??1,k.divideByScalar(d,c,d);let p=i.get(t.width,cie),b=i.get(t.height,cie),f=i.get(t.horizontalOrigin,Ui.CENTER);f===Ui.CENTER?d.x-=p*.5:f===Ui.RIGHT&&(d.x-=p);let y=i.get(t.verticalOrigin,zn.CENTER);y===zn.TOP?d.y+=b:y===zn.CENTER&&(d.y+=b*.5);let _=n.createElement("hotSpot");_.setAttribute("x",-d.x),_.setAttribute("y",d.y),_.setAttribute("xunits","pixels"),_.setAttribute("yunits","pixels"),r.appendChild(_)}let u=i.get(t.rotation),m=i.get(t.alignedAxis);return l(u)&&h.equals(h.UNIT_Z,m)&&(u=W.toDegrees(-u),u===0&&(u=360),r.appendChild(En(n,"heading",u))),r}function gRt(e,t,n,i){let o=e.kmlDoc,r=e.ellipsoid,s=e.valueGetter;if(!l(t))return;let a=o.createElement("LineString"),c=o.createElement("altitudeMode"),d=s.get(t.clampToGround,!1),u;d?(a.appendChild(En(o,"tessellate",!0)),u=o.createTextNode("clampToGround")):u=o.createTextNode("absolute"),c.appendChild(u),a.appendChild(c);let m=t.positions,p=s.get(m),b=En(o,"coordinates",YZ(p,r));a.appendChild(b);let f=s.get(t.zIndex);d&&l(f)&&a.appendChild(En(o,"drawOrder",f,Bf)),n.push(a);let y=o.createElement("LineStyle"),_=s.get(t.width);l(_)&&y.appendChild(En(o,"width",_)),uie(e,t.material,y),i.push(y)}function yRt(e,t,n){let i=e.kmlDoc,o=e.valueGetter,r=o.get(t.height,0);n>0&&(r=n);let s=t.coordinates,a=o.get(s),c=[],d=[re.northeast,re.southeast,re.southwest,re.northwest];for(let b=0;b<4;++b)d[b](a,hd),c.push(`${W.toDegrees(hd.longitude)},${W.toDegrees(hd.latitude)},${r}`);let u=En(i,"coordinates",c.join(" ")),m=i.createElement("outerBoundaryIs"),p=i.createElement("LinearRing");return p.appendChild(u),m.appendChild(p),[m]}function qGe(e,t,n,i){let o=e.kmlDoc,r=e.ellipsoid,s=[],a=t.length;for(let u=0;u<a;++u)pe.fromCartesian(t[u],r,hd),s.push(`${W.toDegrees(hd.longitude)},${W.toDegrees(hd.latitude)},${i?hd.height:n}`);let c=En(o,"coordinates",s.join(" ")),d=o.createElement("LinearRing");return d.appendChild(c),d}function xRt(e,t,n){let i=e.kmlDoc,o=e.valueGetter,r=o.get(t.height,0),s=o.get(t.perPositionHeight,!1);!s&&n>0&&(r=n);let a=[],c=t.hierarchy,d=o.get(c),u=Array.isArray(d)?d:d.positions,m=i.createElement("outerBoundaryIs");m.appendChild(qGe(e,u,r,s)),a.push(m);let p=d.holes;if(l(p)){let b=p.length;for(let f=0;f<b;++f){let y=i.createElement("innerBoundaryIs");y.appendChild(qGe(e,p[f].positions,r,s)),a.push(y)}}return a}function $Ge(e,t,n,i,o){let r=e.kmlDoc,s=e.valueGetter;if(!l(t))return;let a=t instanceof jh;if(a&&s.getMaterialType(t.material)==="Image"){TRt(e,t,o);return}let c=r.createElement("Polygon"),d=s.get(t.extrudedHeight,0);d>0&&c.appendChild(En(r,"extrude",!0));let u=a?yRt(e,t,d):xRt(e,t,d),m=u.length;for(let _=0;_<m;++_)c.appendChild(u[_]);let p=r.createElement("altitudeMode");p.appendChild(wZ(e,t.heightReference)),c.appendChild(p),n.push(c);let b=r.createElement("PolyStyle"),f=s.get(t.fill,!1);f&&b.appendChild(En(r,"fill",f)),uie(e,t.material,b);let y=s.get(t.outline,!1);if(y){b.appendChild(En(r,"outline",y));let _=r.createElement("LineStyle"),S=s.get(t.outlineWidth,1);_.appendChild(En(r,"width",S));let Z=s.getColor(t.outlineColor,U.BLACK);_.appendChild(En(r,"color",Z)),_.appendChild(En(r,"colorMode","normal")),i.push(_)}i.push(b)}function TRt(e,t,n){let i=e.kmlDoc,o=e.valueGetter,r=e.externalFileHandler,s=i.createElement("GroundOverlay"),a=i.createElement("altitudeMode");a.appendChild(wZ(e,t.heightReference)),s.appendChild(a);let c=o.get(t.height);l(c)&&s.appendChild(En(i,"altitude",c));let d=o.get(t.coordinates),u=i.createElement("LatLonBox");u.appendChild(En(i,"north",W.toDegrees(d.north))),u.appendChild(En(i,"south",W.toDegrees(d.south))),u.appendChild(En(i,"east",W.toDegrees(d.east))),u.appendChild(En(i,"west",W.toDegrees(d.west))),s.appendChild(u);let m=o.get(t.material),p=r.texture(m.image),b=i.createElement("Icon");b.appendChild(En(i,"href",p)),s.appendChild(b);let f=m.color;l(f)&&s.appendChild(En(i,"color",MZ(m.color))),n.push(s)}function sLe(e,t){let n=e.kmlDoc,i=e.valueGetter,o=e.externalFileHandler,r=n.createElement("Model"),s=i.get(t.scale);if(l(s)){let d=n.createElement("scale");d.appendChild(En(n,"x",s)),d.appendChild(En(n,"y",s)),d.appendChild(En(n,"z",s)),r.appendChild(d)}let a=n.createElement("Link"),c=o.model(t,e.time);return a.appendChild(En(n,"href",c)),r.appendChild(a),r}function _Rt(e,t,n,i,o){let r=e.kmlDoc,s=e.ellipsoid,a=e.valueGetter;if(!l(n))return;let c=t.position;if(!c.isConstant){iLe(e,t,n,i,o);return}let d=sLe(e,n),u=r.createElement("altitudeMode");u.appendChild(wZ(e,n.heightReference)),d.appendChild(u),a.get(c,void 0,nu),pe.fromCartesian(nu,s,hd);let m=r.createElement("Location");m.appendChild(En(r,"longitude",W.toDegrees(hd.longitude))),m.appendChild(En(r,"latitude",W.toDegrees(hd.latitude))),m.appendChild(En(r,"altitude",hd.height)),d.appendChild(m),i.push(d)}function uie(e,t,n){let i=e.kmlDoc,o=e.valueGetter;if(!l(t))return;let r=o.get(t);if(!l(r))return;let s,a=o.getMaterialType(t),c,d;switch(a){case"Image":s=MZ(U.WHITE);break;case"Color":case"Grid":case"PolylineGlow":case"PolylineArrow":case"PolylineDash":s=MZ(r.color);break;case"PolylineOutline":s=MZ(r.color),c=MZ(r.outlineColor),d=r.outlineWidth,n.appendChild(En(i,"outerColor",c,Bf)),n.appendChild(En(i,"outerWidth",d,Bf));break;case"Stripe":s=MZ(r.oddColor);break}l(s)&&(n.appendChild(En(i,"color",s)),n.appendChild(En(i,"colorMode","normal")))}function wZ(e,t){let n=e.kmlDoc,o=e.valueGetter.get(t,He.NONE),r;switch(o){case He.NONE:r=n.createTextNode("absolute");break;case He.CLAMP_TO_GROUND:r=n.createTextNode("clampToGround");break;case He.RELATIVE_TO_GROUND:r=n.createTextNode("relativeToGround");break}return r}function YZ(e,t){Array.isArray(e)||(e=[e]);let n=e.length,i=[];for(let o=0;o<n;++o)pe.fromCartesian(e[o],t,hd),i.push(`${W.toDegrees(hd.longitude)},${W.toDegrees(hd.latitude)},${hd.height}`);return i.join(" ")}function En(e,t,n,i){n=n??"",typeof n=="boolean"&&(n=n?"1":"0");let o=l(i)?e.createElementNS(i,t):e.createElement(t),r=n==="string"&&n.indexOf("<")!==-1?e.createCDATASection(n):e.createTextNode(n);return o.appendChild(r),o}function MZ(e){let t="",n=e.toBytes();for(let i=3;i>=0;--i)t+=n[i]<16?`0${n[i].toString(16)}`:n[i].toString(16);return t}var mie=die;var S6i=x(T(),1);var QQi=x(T(),1);function yw(){this._cache={}}yw.prototype.fromColor=function(e,t){return bH(void 0,void 0,e,t,this._cache)};yw.prototype.fromUrl=function(e,t,n){return bH(e,void 0,t,n,this._cache)};yw.prototype.fromMakiIconId=function(e,t,n){return bH(en(`Assets/Textures/maki/${encodeURIComponent(e)}.png`),void 0,t,n,this._cache)};yw.prototype.fromText=function(e,t,n){return bH(void 0,e,t,n,this._cache)};var SRt=new U;function ZRt(e,t,n){e.save(),e.scale(n/24,n/24),e.fillStyle=t.toCssColorString(),e.strokeStyle=t.brighten(.6,SRt).toCssColorString(),e.lineWidth=.846,e.beginPath(),e.moveTo(6.72,.422),e.lineTo(17.28,.422),e.bezierCurveTo(18.553,.422,19.577,1.758,19.577,3.415),e.lineTo(19.577,10.973),e.bezierCurveTo(19.577,12.63,18.553,13.966,17.282,13.966),e.lineTo(14.386,14.008),e.lineTo(11.826,23.578),e.lineTo(9.614,14.008),e.lineTo(6.719,13.965),e.bezierCurveTo(5.446,13.983,4.422,12.629,4.422,10.972),e.lineTo(4.422,3.416),e.bezierCurveTo(4.423,1.76,5.447,.423,6.718,.423),e.closePath(),e.fill(),e.stroke(),e.restore()}function aLe(e,t,n){let i=n/2.5,o=i,r=i;t.width>t.height?r=i*(t.height/t.width):t.width<t.height&&(o=i*(t.width/t.height));let s=Math.round((n-o)/2),a=Math.round(7/24*n-r/2);e.globalCompositeOperation="destination-out",e.drawImage(t,s-1,a,o,r),e.drawImage(t,s,a-1,o,r),e.drawImage(t,s+1,a,o,r),e.drawImage(t,s,a+1,o,r),e.globalCompositeOperation="destination-over",e.fillStyle=U.BLACK.toCssColorString(),e.fillRect(s-1,a-1,o+2,r+2),e.globalCompositeOperation="destination-out",e.drawImage(t,s,a,o,r),e.globalCompositeOperation="destination-over",e.fillStyle=U.WHITE.toCssColorString(),e.fillRect(s-1,a-2,o+2,r+2)}var gw=new Array(4);function bH(e,t,n,i,o){gw[0]=e,gw[1]=t,gw[2]=n,gw[3]=i;let r=JSON.stringify(gw),s=o[r];if(l(s))return s;let a=document.createElement("canvas");a.width=i,a.height=i;let c=a.getContext("2d");if(ZRt(c,n,i),l(e)){let u=ve.createIfNeeded(e).fetchImage().then(function(m){return aLe(c,m,i),o[r]=a,a});return o[r]=u,u}else if(l(t)){let d=GS(t,{font:`bold ${i}px sans-serif`});aLe(c,d,i)}return o[r]=a,a}var zg=yw;var k8i=x(T());var r8i=x(T());var n8i=x(T());var $Qi=x(T());function hie(e){return e}function gH(e){if(e==null)return hie;var t,n,i=e.scale[0],o=e.scale[1],r=e.translate[0],s=e.translate[1];return function(a,c){c||(t=n=0);var d=2,u=a.length,m=new Array(u);for(m[0]=(t+=a[0])*i+r,m[1]=(n+=a[1])*o+s;d<u;)m[d]=a[d],++d;return m}}var u8i=x(T());var a8i=x(T());function cLe(e,t){for(var n,i=e.length,o=i-t;o<--i;)n=e[o],e[o++]=e[i],e[i]=n}function fie(e,t){return typeof t=="string"&&(t=e.objects[t]),t.type==="GeometryCollection"?{type:"FeatureCollection",features:t.geometries.map(function(n){return lLe(e,n)})}:lLe(e,t)}function lLe(e,t){var n=t.id,i=t.bbox,o=t.properties==null?{}:t.properties,r=pie(e,t);return n==null&&i==null?{type:"Feature",properties:o,geometry:r}:i==null?{type:"Feature",id:n,properties:o,geometry:r}:{type:"Feature",id:n,bbox:i,properties:o,geometry:r}}function pie(e,t){var n=gH(e.transform),i=e.arcs;function o(u,m){m.length&&m.pop();for(var p=i[u<0?~u:u],b=0,f=p.length;b<f;++b)m.push(n(p[b],b));u<0&&cLe(m,f)}function r(u){return n(u)}function s(u){for(var m=[],p=0,b=u.length;p<b;++p)o(u[p],m);return m.length<2&&m.push(m[0]),m}function a(u){for(var m=s(u);m.length<4;)m.push(m[0]);return m}function c(u){return u.map(a)}function d(u){var m=u.type,p;switch(m){case"GeometryCollection":return{type:m,geometries:u.geometries.map(d)};case"Point":p=r(u.coordinates);break;case"MultiPoint":p=u.coordinates.map(r);break;case"LineString":p=s(u.arcs);break;case"MultiLineString":p=u.arcs.map(s);break;case"Polygon":p=c(u.arcs);break;case"MultiPolygon":p=u.arcs.map(c);break;default:return null}return{type:m,coordinates:p}}return d(t)}var g8i=x(T());var h8i=x(T());var _8i=x(T());var E8i=x(T());var Z8i=x(T());var I8i=x(T());var L8i=x(T());function yH(e){return h.fromDegrees(e[0],e[1],e[2])}var bie={"urn:ogc:def:crs:OGC:1.3:CRS84":yH,"EPSG:4326":yH,"urn:ogc:def:crs:EPSG::4326":yH},dLe={},uLe={},gie=48,yie,xie=U.ROYALBLUE,Tie=U.YELLOW,_ie=2,Sie=U.fromBytes(255,255,0,100),Zie=!1,ARt={small:24,medium:48,large:64},GRt=["title","description","marker-size","marker-symbol","marker-color","stroke","stroke-opacity","stroke-width","fill","fill-opacity"];function mLe(e,t){let n="";for(let i in e)if(e.hasOwnProperty(i)){if(i===t||GRt.indexOf(i)!==-1)continue;let o=e[i];l(o)&&(typeof o=="object"?n+=`<tr><th>${i}</th><td>${mLe(o)}</td></tr>`:n+=`<tr><th>${i}</th><td>${o}</td></tr>`)}return n.length>0&&(n=`<table class="cesium-infoBox-defaultTable"><tbody>${n}</tbody></table>`),n}function LRt(e,t,n){let i;return function(o,r){return l(i)||(i=e(t,n)),i}}function WRt(e,t){return new Qh(LRt(mLe,e,t),!0)}function xH(e,t,n){let i=e.id;if(!l(i)||e.type!=="Feature")i=Qn();else{let s=2,a=i;for(;l(t.getById(a));)a=`${i}_${s}`,s++;i=a}let o=t.getOrCreateEntity(i),r=e.properties;if(l(r)){o.properties=r;let s,a=r.title;if(l(a))o.name=a,s="title";else{let d=Number.MAX_VALUE;for(let u in r)if(r.hasOwnProperty(u)&&r[u]){let m=u.toLowerCase();if(d>1&&m==="title"){s=u;break}else d>2&&m==="name"?(d=2,s=u):d>3&&/title/i.test(u)?(d=3,s=u):d>4&&/name/i.test(u)&&(d=4,s=u)}l(s)&&(o.name=r[s])}let c=r.description;c!==null&&(o.description=l(c)?new mi(c):n(r,s))}return o}function Rie(e,t){let n=new Array(e.length);for(let i=0;i<e.length;i++)n[i]=t(e[i]);return n}var hLe={Feature:pLe,FeatureCollection:vRt,GeometryCollection:bLe,LineString:_Le,MultiLineString:SLe,MultiPoint:xLe,MultiPolygon:CLe,Point:yLe,Polygon:RLe,Topology:VLe},fLe={GeometryCollection:bLe,LineString:_Le,MultiLineString:SLe,MultiPoint:xLe,MultiPolygon:CLe,Point:yLe,Polygon:RLe,Topology:VLe};function pLe(e,t,n,i,o){if(t.geometry===null){xH(t,e._entityCollection,o.describe);return}if(!l(t.geometry))throw new ae("feature.geometry is required.");let r=t.geometry.type,s=fLe[r];if(!l(s))throw new ae(`Unknown geometry type: ${r}`);s(e,t,t.geometry,i,o)}function vRt(e,t,n,i,o){let r=t.features;for(let s=0,a=r.length;s<a;s++)pLe(e,r[s],void 0,i,o)}function bLe(e,t,n,i,o){let r=n.geometries;for(let s=0,a=r.length;s<a;s++){let c=r[s],d=c.type,u=fLe[d];if(!l(u))throw new ae(`Unknown geometry type: ${d}`);u(e,t,c,i,o)}}function gLe(e,t,n,i,o){let r=o.markerSymbol,s=o.markerColor,a=o.markerSize,c=t.properties;if(l(c)){let b=c["marker-color"];l(b)&&(s=U.fromCssColorString(b)),a=ARt[c["marker-size"]]??a;let f=c["marker-symbol"];l(f)&&(r=f)}let d;l(r)?r.length===1?d=e._pinBuilder.fromText(r.toUpperCase(),s,a):d=e._pinBuilder.fromMakiIconId(r,s,a):d=e._pinBuilder.fromColor(s,a);let u=new jc;u.verticalOrigin=new mi(zn.BOTTOM),i.length===2&&o.clampToGround&&(u.heightReference=He.CLAMP_TO_GROUND);let m=xH(t,e._entityCollection,o.describe);m.billboard=u,m.position=new Bl(n(i));let p=Promise.resolve(d).then(function(b){u.image=new mi(b)}).catch(function(){u.image=new mi(e._pinBuilder.fromColor(s,a))});e._promises.push(p)}function yLe(e,t,n,i,o){gLe(e,t,i,n.coordinates,o)}function xLe(e,t,n,i,o){let r=n.coordinates;for(let s=0;s<r.length;s++)gLe(e,t,i,r[s],o)}function TLe(e,t,n,i,o){let r=o.strokeMaterialProperty,s=o.strokeWidthProperty,a=t.properties;if(l(a)){let u=a["stroke-width"];l(u)&&(s=new mi(u));let m,p=a.stroke;l(p)&&(m=U.fromCssColorString(p));let b=a["stroke-opacity"];l(b)&&b!==1&&(l(m)||(m=r.color.getValue().clone()),m.alpha=b),l(m)&&(r=new Qt(m))}let c=xH(t,e._entityCollection,o.describe),d=new qc;c.polyline=d,d.clampToGround=o.clampToGround,d.material=r,d.width=s,d.positions=new mi(Rie(i,n)),d.arcType=un.RHUMB}function _Le(e,t,n,i,o){TLe(e,t,i,n.coordinates,o)}function SLe(e,t,n,i,o){let r=n.coordinates;for(let s=0;s<r.length;s++)TLe(e,t,i,r[s],o)}function ZLe(e,t,n,i,o){if(i.length===0||i[0].length===0)return;let r=o.strokeMaterialProperty.color,s=o.fillMaterialProperty,a=o.strokeWidthProperty,c=t.properties;if(l(c)){let b=c["stroke-width"];l(b)&&(a=new mi(b));let f,y=c.stroke;l(y)&&(f=U.fromCssColorString(y));let _=c["stroke-opacity"];l(_)&&_!==1&&(l(f)||(f=r.getValue().clone()),f.alpha=_),l(f)&&(r=new mi(f));let S,Z=c.fill,R=s.color.getValue();l(Z)&&(S=U.fromCssColorString(Z),S.alpha=R.alpha),_=c["fill-opacity"],l(_)&&_!==R.alpha&&(l(S)||(S=R.clone()),S.alpha=_),l(S)&&(s=new Qt(S))}let d=new Jh;d.outline=new mi(!0),d.outlineColor=r,d.outlineWidth=a,d.material=s,d.arcType=un.RHUMB;let u=[];for(let b=1,f=i.length;b<f;b++)u.push(new Lc(Rie(i[b],n)));let m=i[0];d.hierarchy=new mi(new Lc(Rie(m,n),u)),m[0].length>2?d.perPositionHeight=new mi(!0):o.clampToGround||(d.height=0);let p=xH(t,e._entityCollection,o.describe);p.polygon=d}function RLe(e,t,n,i,o){ZLe(e,t,i,n.coordinates,o)}function CLe(e,t,n,i,o){let r=n.coordinates;for(let s=0;s<r.length;s++)ZLe(e,t,i,r[s],o)}function VLe(e,t,n,i,o){for(let r in n.objects)if(n.objects.hasOwnProperty(r)){let s=fie(n,n.objects[r]),a=hLe[s.type];a(e,s,s,i,o)}}function uT(e){this._name=e,this._changed=new Se,this._error=new Se,this._isLoading=!1,this._loading=new Se,this._entityCollection=new za(this),this._promises=[],this._pinBuilder=new zg,this._entityCluster=new Bu,this._credit=void 0,this._resourceCredits=[]}uT.load=function(e,t){return new uT().load(e,t)};Object.defineProperties(uT,{markerSize:{get:function(){return gie},set:function(e){gie=e}},markerSymbol:{get:function(){return yie},set:function(e){yie=e}},markerColor:{get:function(){return xie},set:function(e){xie=e}},stroke:{get:function(){return Tie},set:function(e){Tie=e}},strokeWidth:{get:function(){return _ie},set:function(e){_ie=e}},fill:{get:function(){return Sie},set:function(e){Sie=e}},clampToGround:{get:function(){return Zie},set:function(e){Zie=e}},crsNames:{get:function(){return bie}},crsLinkHrefs:{get:function(){return dLe}},crsLinkTypes:{get:function(){return uLe}}});Object.defineProperties(uT.prototype,{name:{get:function(){return this._name},set:function(e){this._name!==e&&(this._name=e,this._changed.raiseEvent(this))}},clock:{value:void 0,writable:!1},entities:{get:function(){return this._entityCollection}},isLoading:{get:function(){return this._isLoading}},changedEvent:{get:function(){return this._changed}},errorEvent:{get:function(){return this._error}},loadingEvent:{get:function(){return this._loading}},show:{get:function(){return this._entityCollection.show},set:function(e){this._entityCollection.show=e}},clustering:{get:function(){return this._entityCluster},set:function(e){this._entityCluster=e}},credit:{get:function(){return this._credit}}});uT.prototype.load=function(e,t){return ELe(this,e,t,!0)};uT.prototype.process=function(e,t){return ELe(this,e,t,!1)};function ELe(e,t,n,i){Es.setLoading(e,!0),n=n??B.EMPTY_OBJECT;let o=n.credit;typeof o=="string"&&(o=new Lt(o)),e._credit=o;let r=t,s=n.sourceUri;if(typeof t=="string"||t instanceof ve){t=ve.createIfNeeded(t),r=t.fetchJson(),s=s??t.getUrlComponent();let a=e._resourceCredits,c=t.credits;if(l(c)){let d=c.length;for(let u=0;u<d;u++)a.push(c[u])}}return n={describe:n.describe??WRt,markerSize:n.markerSize??gie,markerSymbol:n.markerSymbol??yie,markerColor:n.markerColor??xie,strokeWidthProperty:new mi(n.strokeWidth??_ie),strokeMaterialProperty:new Qt(n.stroke??Tie),fillMaterialProperty:new Qt(n.fill??Sie),clampToGround:n.clampToGround??Zie},Promise.resolve(r).then(function(a){return FRt(e,a,n,s,i)}).catch(function(a){throw Es.setLoading(e,!1),e._error.raiseEvent(e,a),a})}uT.prototype.update=function(e){return!0};function FRt(e,t,n,i,o){let r;l(i)&&(r=Rg(i)),l(r)&&e._name!==r&&(e._name=r,e._changed.raiseEvent(e));let s=hLe[t.type];if(!l(s))throw new ae(`Unsupported GeoJSON object type: ${t.type}`);let a=t.crs,c=a!==null?yH:null;if(l(a)){if(!l(a.properties))throw new ae("crs.properties is undefined.");let d=a.properties;if(a.type==="name"){if(c=bie[d.name],!l(c))throw new ae(`Unknown crs name: ${d.name}`)}else if(a.type==="link"){let u=dLe[d.href];if(l(u)||(u=uLe[d.type]),!l(u))throw new ae(`Unable to resolve crs link: ${JSON.stringify(d)}`);c=u(d)}else if(a.type==="EPSG"){if(c=bie[`EPSG:${d.code}`],!l(c))throw new ae(`Unknown crs EPSG code: ${d.code}`)}else throw new ae(`Unknown crs type: ${a.type}`)}return Promise.resolve(c).then(function(d){return o&&e._entityCollection.removeAll(),d!==null&&s(e,t,t,d,n),Promise.all(e._promises).then(function(){return e._promises.length=0,Es.setLoading(e,!1),e})})}var mT=uT;var R6i=x(T(),1);function IRt(e){return typeof e=="string"&&(e=document.getElementById(e)),e}var Nn=IRt;var p$i=x(T(),1);var Gqi=x(T());var hqi=x(T());var V6i=x(T(),1),Cie=function(e,t){return Cie=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(n[o]=i[o])},Cie(e,t)};function _0(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");Cie(e,t);function n(){this.constructor=e}e.prototype=t===null?Object.create(t):(n.prototype=t.prototype,new n)}var ra=function(){return ra=Object.assign||function(t){for(var n,i=1,o=arguments.length;i<o;i++){n=arguments[i];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t},ra.apply(this,arguments)};function ALe(e,t){var n=typeof Symbol=="function"&&e[Symbol.iterator];if(!n)return e;var i=n.call(e),o,r=[],s;try{for(;(t===void 0||t-- >0)&&!(o=i.next()).done;)r.push(o.value)}catch(a){s={error:a}}finally{try{o&&!o.done&&(n=i.return)&&n.call(i)}finally{if(s)throw s.error}}return r}function GLe(e,t,n){if(n||arguments.length===2)for(var i=0,o=t.length,r;i<o;i++)(r||!(i in t))&&(r||(r=Array.prototype.slice.call(t,0,i)),r[i]=t[i]);return e.concat(r||Array.prototype.slice.call(t))}var A6i=x(T()),LLe="4.1.5";var L6i=x(T()),WLe=Object.prototype.hasOwnProperty;function nm(e){return typeof e=="boolean"}function vLe(e,t,n){var i;return e.length>t&&(n==null?(n="…",i=3):i=n.length,e=e.substring(0,t-i)+n),e}function hT(e,t){for(var n=e.length-1;n>=0;n--)t(e[n])===!0&&e.splice(n,1)}function zf(e){throw new Error("Unhandled case for value: '".concat(e,"'"))}var z6i=x(T());var F6i=x(T());var TH=/\s+/,_H=(function(){function e(t){t===void 0&&(t={}),this.tagName="",this.attrs={},this.innerHTML="",this.tagName=t.tagName||"",this.attrs=t.attrs||{},this.innerHTML=t.innerHtml||t.innerHTML||""}return e.prototype.setTagName=function(t){return this.tagName=t,this},e.prototype.getTagName=function(){return this.tagName},e.prototype.setAttr=function(t,n){var i=this.getAttrs();return i[t]=n,this},e.prototype.getAttr=function(t){return this.getAttrs()[t]},e.prototype.setAttrs=function(t){return Object.assign(this.getAttrs(),t),this},e.prototype.getAttrs=function(){return this.attrs},e.prototype.setClass=function(t){return this.setAttr("class",t)},e.prototype.addClass=function(t){for(var n=this.getClass(),i=n?n.split(TH):[],o=t.split(TH),r;r=o.shift();)i.indexOf(r)===-1&&i.push(r);return this.getAttrs().class=i.join(" "),this},e.prototype.removeClass=function(t){for(var n=this.getClass(),i=n?n.split(TH):[],o=t.split(TH),r;i.length&&(r=o.shift());){var s=i.indexOf(r);s!==-1&&i.splice(s,1)}return this.getAttrs().class=i.join(" "),this},e.prototype.getClass=function(){return this.getAttrs().class||""},e.prototype.hasClass=function(t){return(" "+this.getClass()+" ").indexOf(" "+t+" ")!==-1},e.prototype.setInnerHTML=function(t){return this.innerHTML=t,this},e.prototype.setInnerHtml=function(t){return this.setInnerHTML(t)},e.prototype.getInnerHTML=function(){return this.innerHTML||""},e.prototype.getInnerHtml=function(){return this.getInnerHTML()},e.prototype.toAnchorString=function(){var t=this.getTagName(),n=this.buildAttrsStr();return n=n?" "+n:"",["<",t,n,">",this.getInnerHtml(),"</",t,">"].join("")},e.prototype.buildAttrsStr=function(){var t=this.getAttrs(),n=[];for(var i in t)WLe.call(t,i)&&n.push(i+'="'+t[i]+'"');return n.join(" ")},e})();var P6i=x(T());function ILe(e,t,n){var i,o;if(n==null?(n="…",o=3,i=8):(o=n.length,i=n.length),e.length<=t)return e;var r=t-o,s=PRt(e);if(s.query){var a=s.query.match(/^(.*?)(?=(\?|#))(.*?)$/i);a&&(s.query=s.query.substr(0,a[1].length),e=FLe(s))}if(e.length<=t||(s.host&&(s.host=s.host.replace(/^www\./,""),e=FLe(s)),e.length<=t))return e;var c="";if(s.host&&(c+=s.host),c.length>=r)return s.host.length===t?(s.host.substr(0,t-o)+n).substr(0,r+i):Vie(c,r,n).substr(0,r+i);var d="";if(s.path&&(d+="/"+s.path),s.query&&(d+="?"+s.query),d)if((c+d).length>=r){if((c+d).length==t)return(c+d).substr(0,t);var u=r-c.length;return(c+Vie(d,u,n)).substr(0,r+i)}else c+=d;if(s.fragment){var m="#"+s.fragment;if((c+m).length>=r){if((c+m).length==t)return(c+m).substr(0,t);var p=r-c.length;return(c+Vie(m,p,n)).substr(0,r+i)}else c+=m}if(s.scheme&&s.host){var b=s.scheme+"://";if((c+b).length<r)return(b+c).substr(0,t)}if(c.length<=t)return c;var f="";return r>0&&(f=c.substr(-1*Math.floor(r/2))),(c.substr(0,Math.ceil(r/2))+n+f).substr(0,r+i)}function PRt(e){var t={},n=e,i=n.match(/^([a-z]+):\/\//i);return i&&(t.scheme=i[1],n=n.slice(i[0].length)),i=n.match(/^(.*?)(?=(\?|#|\/|$))/i),i&&(t.host=i[1],n=n.slice(i[0].length)),i=n.match(/^\/(.*?)(?=(\?|#|$))/i),i&&(t.path=i[1],n=n.slice(i[0].length)),i=n.match(/^\?(.*?)(?=(#|$))/i),i&&(t.query=i[1],n=n.slice(i[0].length)),i=n.match(/^#(.*?)$/i),i&&(t.fragment=i[1]),t}function FLe(e){var t="";return e.scheme&&e.host&&(t+=e.scheme+"://"),e.host&&(t+=e.host),e.path&&(t+="/"+e.path),e.query&&(t+="?"+e.query),e.fragment&&(t+="#"+e.fragment),t}function Vie(e,t,n){var i=t/2,o=Math.ceil(i),r=-1*Math.floor(i),s="";return r<0&&(s=e.substr(r)),e.substr(0,o)+n+s}var N6i=x(T());function PLe(e,t,n){if(e.length<=t)return e;var i,o;n==null?(n="…",i=8,o=3):(i=n.length,o=n.length);var r=t-o,s="";return r>0&&(s=e.substr(-1*Math.floor(r/2))),(e.substr(0,Math.ceil(r/2))+n+s).substr(0,r+i)}var w6i=x(T());function XLe(e,t,n){return vLe(e,t,n)}var NLe=(function(){function e(t){t===void 0&&(t={}),this.newWindow=!1,this.truncate={},this.className="",this.newWindow=t.newWindow||!1,this.truncate=t.truncate||{},this.className=t.className||""}return e.prototype.build=function(t){return new _H({tagName:"a",attrs:this.createAttrs(t),innerHtml:this.processAnchorText(t.getAnchorText())})},e.prototype.createAttrs=function(t){var n={href:t.getAnchorHref()},i=this.createCssClass(t);return i&&(n.class=i),this.newWindow&&(n.target="_blank",n.rel="noopener noreferrer"),this.truncate.length&&this.truncate.length<t.getAnchorText().length&&(n.title=t.getAnchorHref()),n},e.prototype.createCssClass=function(t){var n=this.className;if(n){for(var i=[n],o=t.getCssClassSuffixes(),r=0,s=o.length;r<s;r++)i.push(n+"-"+o[r]);return i.join(" ")}else return""},e.prototype.processAnchorText=function(t){return t=this.doTruncate(t),t},e.prototype.doTruncate=function(t){var n=this.truncate;if(!n.length)return t;var i=n.length,o=n.location;return o==="smart"?ILe(t,i):o==="middle"?PLe(t,i):XLe(t,i)},e})();var Q7i=x(T());var a7i=x(T());var K6i=x(T()),S0=(function(){function e(t){this._=null,this.matchedText="",this.offset=0,this.tagBuilder=t.tagBuilder,this.matchedText=t.matchedText,this.offset=t.offset}return e.prototype.getMatchedText=function(){return this.matchedText},e.prototype.setOffset=function(t){this.offset=t},e.prototype.getOffset=function(){return this.offset},e.prototype.getCssClassSuffixes=function(){return[this.type]},e.prototype.buildTag=function(){return this.tagBuilder.build(this)},e})();var n7i=x(T());var j6i=x(T());function YLe(e){return e>=0&&e<=31||e==127}function Hg(e){return e>=65&&e<=90||e>=97&&e<=122}function sa(e){return e>=48&&e<=57}function SH(e){return e==34||e==39}function fT(e){return e<8232?e<160?e>=9&&e<=13||e==32:e<5760?e==160:e==5760||e>=8192&&e<=8202:e<8287?e>=8232&&e<=8233||e==8239:e<12288?e==8287:e==12288||e==65279}function Hf(e){return e<4800?e<2949?e<2451?e<1425?e<768?e<192?e<169?e<65?e>=48&&e<=57:e>=65&&e<=90||e>=97&&e<=122:e<181?e>=169&&e<=170||e==174:e==181||e==186:e<710?e<216?e>=192&&e<=214:e>=216&&e<=246||e>=248&&e<=705:e<748?e>=710&&e<=721||e>=736&&e<=740:e==748||e==750:e<910?e<895?e<886?e>=768&&e<=884:e>=886&&e<=887||e>=890&&e<=893:e<904?e==895||e==902:e>=904&&e<=906||e==908:e<1155?e<931?e>=910&&e<=929:e>=931&&e<=1013||e>=1015&&e<=1153:e<1369?e>=1155&&e<=1327||e>=1329&&e<=1366:e==1369||e>=1377&&e<=1415:e<1808?e<1552?e<1476?e<1471?e>=1425&&e<=1469:e==1471||e>=1473&&e<=1474:e<1488?e>=1476&&e<=1477||e==1479:e>=1488&&e<=1514||e>=1520&&e<=1522:e<1749?e<1568?e>=1552&&e<=1562:e>=1568&&e<=1641||e>=1646&&e<=1747:e<1770?e>=1749&&e<=1756||e>=1759&&e<=1768:e>=1770&&e<=1788||e==1791:e<2230?e<2042?e<1869?e>=1808&&e<=1866:e>=1869&&e<=1969||e>=1984&&e<=2037:e<2112?e==2042||e>=2048&&e<=2093:e>=2112&&e<=2139||e>=2208&&e<=2228:e<2406?e<2260?e>=2230&&e<=2237:e>=2260&&e<=2273||e>=2275&&e<=2403:e<2437?e>=2406&&e<=2415||e>=2417&&e<=2435:e>=2437&&e<=2444||e>=2447&&e<=2448:e<2693?e<2579?e<2519?e<2486?e<2474?e>=2451&&e<=2472:e>=2474&&e<=2480||e==2482:e<2503?e>=2486&&e<=2489||e>=2492&&e<=2500:e>=2503&&e<=2504||e>=2507&&e<=2510:e<2534?e<2524?e==2519:e>=2524&&e<=2525||e>=2527&&e<=2531:e<2565?e>=2534&&e<=2545||e>=2561&&e<=2563:e>=2565&&e<=2570||e>=2575&&e<=2576:e<2631?e<2613?e<2602?e>=2579&&e<=2600:e>=2602&&e<=2608||e>=2610&&e<=2611:e<2620?e>=2613&&e<=2614||e>=2616&&e<=2617:e==2620||e>=2622&&e<=2626:e<2649?e<2635?e>=2631&&e<=2632:e>=2635&&e<=2637||e==2641:e<2662?e>=2649&&e<=2652||e==2654:e>=2662&&e<=2677||e>=2689&&e<=2691:e<2821?e<2759?e<2730?e<2703?e>=2693&&e<=2701:e>=2703&&e<=2705||e>=2707&&e<=2728:e<2741?e>=2730&&e<=2736||e>=2738&&e<=2739:e>=2741&&e<=2745||e>=2748&&e<=2757:e<2784?e<2763?e>=2759&&e<=2761:e>=2763&&e<=2765||e==2768:e<2809?e>=2784&&e<=2787||e>=2790&&e<=2799:e==2809||e>=2817&&e<=2819:e<2887?e<2858?e<2831?e>=2821&&e<=2828:e>=2831&&e<=2832||e>=2835&&e<=2856:e<2869?e>=2858&&e<=2864||e>=2866&&e<=2867:e>=2869&&e<=2873||e>=2876&&e<=2884:e<2911?e<2902?e>=2887&&e<=2888||e>=2891&&e<=2893:e>=2902&&e<=2903||e>=2908&&e<=2909:e<2929?e>=2911&&e<=2915||e>=2918&&e<=2927:e==2929||e>=2946&&e<=2947:e<3517?e<3205?e<3046?e<2984?e<2969?e<2958?e>=2949&&e<=2954:e>=2958&&e<=2960||e>=2962&&e<=2965:e<2974?e>=2969&&e<=2970||e==2972:e>=2974&&e<=2975||e>=2979&&e<=2980:e<3014?e<2990?e>=2984&&e<=2986:e>=2990&&e<=3001||e>=3006&&e<=3010:e<3024?e>=3014&&e<=3016||e>=3018&&e<=3021:e==3024||e==3031:e<3142?e<3086?e<3072?e>=3046&&e<=3055:e>=3072&&e<=3075||e>=3077&&e<=3084:e<3114?e>=3086&&e<=3088||e>=3090&&e<=3112:e>=3114&&e<=3129||e>=3133&&e<=3140:e<3160?e<3146?e>=3142&&e<=3144:e>=3146&&e<=3149||e>=3157&&e<=3158:e<3174?e>=3160&&e<=3162||e>=3168&&e<=3171:e>=3174&&e<=3183||e>=3200&&e<=3203:e<3333?e<3274?e<3242?e<3214?e>=3205&&e<=3212:e>=3214&&e<=3216||e>=3218&&e<=3240:e<3260?e>=3242&&e<=3251||e>=3253&&e<=3257:e>=3260&&e<=3268||e>=3270&&e<=3272:e<3296?e<3285?e>=3274&&e<=3277:e>=3285&&e<=3286||e==3294:e<3313?e>=3296&&e<=3299||e>=3302&&e<=3311:e>=3313&&e<=3314||e>=3329&&e<=3331:e<3423?e<3389?e<3342?e>=3333&&e<=3340:e>=3342&&e<=3344||e>=3346&&e<=3386:e<3402?e>=3389&&e<=3396||e>=3398&&e<=3400:e>=3402&&e<=3406||e>=3412&&e<=3415:e<3458?e<3430?e>=3423&&e<=3427:e>=3430&&e<=3439||e>=3450&&e<=3455:e<3482?e>=3458&&e<=3459||e>=3461&&e<=3478:e>=3482&&e<=3505||e>=3507&&e<=3515:e<3804?e<3722?e<3570?e<3535?e<3520?e==3517:e>=3520&&e<=3526||e==3530:e<3544?e>=3535&&e<=3540||e==3542:e>=3544&&e<=3551||e>=3558&&e<=3567:e<3664?e<3585?e>=3570&&e<=3571:e>=3585&&e<=3642||e>=3648&&e<=3662:e<3716?e>=3664&&e<=3673||e>=3713&&e<=3714:e==3716||e>=3719&&e<=3720:e<3754?e<3737?e<3725?e==3722:e==3725||e>=3732&&e<=3735:e<3749?e>=3737&&e<=3743||e>=3745&&e<=3747:e==3749||e==3751:e<3776?e<3757?e>=3754&&e<=3755:e>=3757&&e<=3769||e>=3771&&e<=3773:e<3784?e>=3776&&e<=3780||e==3782:e>=3784&&e<=3789||e>=3792&&e<=3801:e<4176?e<3902?e<3872?e<3840?e>=3804&&e<=3807:e==3840||e>=3864&&e<=3865:e<3895?e>=3872&&e<=3881||e==3893:e==3895||e==3897:e<3974?e<3913?e>=3902&&e<=3911:e>=3913&&e<=3948||e>=3953&&e<=3972:e<4038?e>=3974&&e<=3991||e>=3993&&e<=4028:e==4038||e>=4096&&e<=4169:e<4688?e<4301?e<4256?e>=4176&&e<=4253:e>=4256&&e<=4293||e==4295:e<4348?e==4301||e>=4304&&e<=4346:e>=4348&&e<=4680||e>=4682&&e<=4685:e<4746?e<4698?e>=4688&&e<=4694||e==4696:e>=4698&&e<=4701||e>=4704&&e<=4744:e<4786?e>=4746&&e<=4749||e>=4752&&e<=4784:e>=4786&&e<=4789||e>=4792&&e<=4798:e<11035?e<7416?e<6176?e<5873?e<4992?e<4824?e<4802?e==4800:e>=4802&&e<=4805||e>=4808&&e<=4822:e<4888?e>=4824&&e<=4880||e>=4882&&e<=4885:e>=4888&&e<=4954||e>=4957&&e<=4959:e<5121?e<5024?e>=4992&&e<=5007:e>=5024&&e<=5109||e>=5112&&e<=5117:e<5761?e>=5121&&e<=5740||e>=5743&&e<=5759:e>=5761&&e<=5786||e>=5792&&e<=5866:e<6002?e<5920?e<5888?e>=5873&&e<=5880:e>=5888&&e<=5900||e>=5902&&e<=5908:e<5984?e>=5920&&e<=5940||e>=5952&&e<=5971:e>=5984&&e<=5996||e>=5998&&e<=6e3:e<6108?e<6016?e>=6002&&e<=6003:e>=6016&&e<=6099||e==6103:e<6155?e>=6108&&e<=6109||e>=6112&&e<=6121:e>=6155&&e<=6157||e>=6160&&e<=6169:e<6783?e<6512?e<6400?e<6272?e>=6176&&e<=6263:e>=6272&&e<=6314||e>=6320&&e<=6389:e<6448?e>=6400&&e<=6430||e>=6432&&e<=6443:e>=6448&&e<=6459||e>=6470&&e<=6509:e<6608?e<6528?e>=6512&&e<=6516:e>=6528&&e<=6571||e>=6576&&e<=6601:e<6688?e>=6608&&e<=6617||e>=6656&&e<=6683:e>=6688&&e<=6750||e>=6752&&e<=6780:e<7040?e<6832?e<6800?e>=6783&&e<=6793:e>=6800&&e<=6809||e==6823:e<6992?e>=6832&&e<=6846||e>=6912&&e<=6987:e>=6992&&e<=7001||e>=7019&&e<=7027:e<7245?e<7168?e>=7040&&e<=7155:e>=7168&&e<=7223||e>=7232&&e<=7241:e<7376?e>=7245&&e<=7293||e>=7296&&e<=7304:e>=7376&&e<=7378||e>=7380&&e<=7414:e<8450?e<8130?e<8025?e<7960?e<7424?e>=7416&&e<=7417:e>=7424&&e<=7669||e>=7675&&e<=7957:e<8008?e>=7960&&e<=7965||e>=7968&&e<=8005:e>=8008&&e<=8013||e>=8016&&e<=8023:e<8031?e<8027?e==8025:e==8027||e==8029:e<8118?e>=8031&&e<=8061||e>=8064&&e<=8116:e>=8118&&e<=8124||e==8126:e<8205?e<8150?e<8134?e>=8130&&e<=8132:e>=8134&&e<=8140||e>=8144&&e<=8147:e<8178?e>=8150&&e<=8155||e>=8160&&e<=8172:e>=8178&&e<=8180||e>=8182&&e<=8188:e<8305?e<8252?e==8205:e==8252||e==8265:e<8336?e==8305||e==8319:e>=8336&&e<=8348||e>=8400&&e<=8432:e<8579?e<8486?e<8469?e<8455?e==8450:e==8455||e>=8458&&e<=8467:e<8482?e==8469||e>=8473&&e<=8477:e==8482||e==8484:e<8495?e<8488?e==8486:e==8488||e>=8490&&e<=8493:e<8517?e>=8495&&e<=8505||e>=8508&&e<=8511:e>=8517&&e<=8521||e==8526:e<9410?e<9e3?e<8592?e>=8579&&e<=8580:e>=8592&&e<=8703||e>=8986&&e<=8987:e<9193?e==9e3||e==9167:e>=9193&&e<=9203||e>=9208&&e<=9210:e<9723?e<9654?e==9410||e>=9642&&e<=9643:e==9654||e==9664:e<10548?e>=9723&&e<=9726||e>=9728&&e<=10175:e>=10548&&e<=10549||e>=11013&&e<=11015:e<43259?e<12445?e<11688?e<11520?e<11264?e<11088?e>=11035&&e<=11036:e==11088||e==11093:e<11360?e>=11264&&e<=11310||e>=11312&&e<=11358:e>=11360&&e<=11492||e>=11499&&e<=11507:e<11568?e<11559?e>=11520&&e<=11557:e==11559||e==11565:e<11647?e>=11568&&e<=11623||e==11631:e>=11647&&e<=11670||e>=11680&&e<=11686:e<11744?e<11712?e<11696?e>=11688&&e<=11694:e>=11696&&e<=11702||e>=11704&&e<=11710:e<11728?e>=11712&&e<=11718||e>=11720&&e<=11726:e>=11728&&e<=11734||e>=11736&&e<=11742:e<12330?e<11823?e>=11744&&e<=11775:e==11823||e>=12293&&e<=12294:e<12353?e>=12330&&e<=12341||e>=12347&&e<=12349:e>=12353&&e<=12438||e>=12441&&e<=12442:e<42512?e<12951?e<12549?e<12449?e>=12445&&e<=12447:e>=12449&&e<=12538||e>=12540&&e<=12543:e<12704?e>=12549&&e<=12589||e>=12593&&e<=12686:e>=12704&&e<=12730||e>=12784&&e<=12799:e<19968?e<12953?e==12951:e==12953||e>=13312&&e<=19893:e<42192?e>=19968&&e<=40917||e>=40960&&e<=42124:e>=42192&&e<=42237||e>=42240&&e<=42508:e<42891?e<42623?e<42560?e>=42512&&e<=42539:e>=42560&&e<=42610||e>=42612&&e<=42621:e<42775?e>=42623&&e<=42725||e>=42736&&e<=42737:e>=42775&&e<=42783||e>=42786&&e<=42888:e<43072?e<42928?e>=42891&&e<=42926:e>=42928&&e<=42935||e>=42999&&e<=43047:e<43216?e>=43072&&e<=43123||e>=43136&&e<=43205:e>=43216&&e<=43225||e>=43232&&e<=43255:e<55243?e<43744?e<43488?e<43312?e<43261?e==43259:e==43261||e>=43264&&e<=43309:e<43392?e>=43312&&e<=43347||e>=43360&&e<=43388:e>=43392&&e<=43456||e>=43471&&e<=43481:e<43600?e<43520?e>=43488&&e<=43518:e>=43520&&e<=43574||e>=43584&&e<=43597:e<43642?e>=43600&&e<=43609||e>=43616&&e<=43638:e>=43642&&e<=43714||e>=43739&&e<=43741:e<43824?e<43785?e<43762?e>=43744&&e<=43759:e>=43762&&e<=43766||e>=43777&&e<=43782:e<43808?e>=43785&&e<=43790||e>=43793&&e<=43798:e>=43808&&e<=43814||e>=43816&&e<=43822:e<44012?e<43868?e>=43824&&e<=43866:e>=43868&&e<=43877||e>=43888&&e<=44010:e<44032?e>=44012&&e<=44013||e>=44016&&e<=44025:e>=44032&&e<=55203||e>=55216&&e<=55238:e<64848?e<64298?e<64112?e<55296?e>=55243&&e<=55291:e>=55296&&e<=57343||e>=63744&&e<=64109:e<64275?e>=64112&&e<=64217||e>=64256&&e<=64262:e>=64275&&e<=64279||e>=64285&&e<=64296:e<64320?e<64312?e>=64298&&e<=64310:e>=64312&&e<=64316||e==64318:e<64326?e>=64320&&e<=64321||e>=64323&&e<=64324:e>=64326&&e<=64433||e>=64467&&e<=64829:e<65296?e<65024?e<64914?e>=64848&&e<=64911:e>=64914&&e<=64967||e>=65008&&e<=65019:e<65136?e>=65024&&e<=65039||e>=65056&&e<=65071:e>=65136&&e<=65140||e>=65142&&e<=65276:e<65474?e<65345?e>=65296&&e<=65305||e>=65313&&e<=65338:e>=65345&&e<=65370||e>=65382&&e<=65470:e<65490?e>=65474&&e<=65479||e>=65482&&e<=65487:e>=65490&&e<=65495||e>=65498&&e<=65500}function MLe(e){return e<47?e<42?e==33||e>=35&&e<=39:e>=42&&e<=43||e==45:e<63?e==47||e==61:e<94?e==63:e>=94&&e<=96||e>=123&&e<=126}function wLe(e){return e<91?e<47?e>=35&&e<=43||e==45:e<61?e==47:e==61||e==64:e<95?e==91||e==93:e<123?e==95:e>=123&&e<=126||e==10003}function ZH(e){return e<58?e<44?e==33:e==44||e==46:e<63?e>=58&&e<=59:e==63||e==94}function kLe(e){return e<91?e==40:e==91||e==123}function Eie(e){return e<93?e==41:e==93||e==125}var q6i=x(T()),ULe=/^(?:xn--vermgensberatung-pwb|xn--vermgensberater-ctb|xn--clchc0ea0b2g2a9gcd|xn--w4r85el8fhu5dnra|travelersinsurance|vermögensberatung|xn--5su34j936bgsg|xn--bck1b9a5dre4c|xn--mgbah1a3hjkrd|xn--mgbai9azgqp6j|xn--mgberp4a5d4ar|xn--xkc2dl3a5ee0h|vermögensberater|xn--fzys8d69uvgm|xn--mgba7c0bbn0a|xn--mgbcpq6gpa1a|xn--xkc2al3hye2a|americanexpress|kerryproperties|sandvikcoromant|xn--i1b6b1a6a2e|xn--kcrx77d1x4a|xn--lgbbat1ad8j|xn--mgba3a4f16a|xn--mgbc0a9azcg|xn--nqv7fs00ema|americanfamily|weatherchannel|xn--54b7fta0cc|xn--6qq986b3xl|xn--80aqecdr1a|xn--b4w605ferd|xn--fiq228c5hs|xn--h2breg3eve|xn--jlq480n2rg|xn--mgba3a3ejt|xn--mgbaam7a8h|xn--mgbayh7gpa|xn--mgbbh1a71e|xn--mgbca7dzdo|xn--mgbi4ecexp|xn--mgbx4cd0ab|xn--rvc1e0am3e|international|lifeinsurance|wolterskluwer|xn--cckwcxetd|xn--eckvdtc9d|xn--fpcrj9c3d|xn--fzc2c9e2c|xn--h2brj9c8c|xn--tiq49xqyj|xn--yfro4i67o|xn--ygbi2ammx|construction|lplfinancial|scholarships|versicherung|xn--3e0b707e|xn--45br5cyl|xn--4dbrk0ce|xn--80adxhks|xn--80asehdb|xn--8y0a063a|xn--gckr3f0f|xn--mgb9awbf|xn--mgbab2bd|xn--mgbgu82a|xn--mgbpl2fh|xn--mgbt3dhd|xn--mk1bu44c|xn--ngbc5azd|xn--ngbe9e0a|xn--ogbpf8fl|xn--qcka1pmc|accountants|barclaycard|blackfriday|blockbuster|bridgestone|calvinklein|contractors|creditunion|engineering|enterprises|investments|kerryhotels|lamborghini|motorcycles|olayangroup|photography|playstation|productions|progressive|redumbrella|williamhill|xn--11b4c3d|xn--1ck2e1b|xn--1qqw23a|xn--2scrj9c|xn--3bst00m|xn--3ds443g|xn--3hcrj9c|xn--42c2d9a|xn--45brj9c|xn--55qw42g|xn--6frz82g|xn--80ao21a|xn--9krt00a|xn--cck2b3b|xn--czr694b|xn--d1acj3b|xn--efvy88h|xn--fct429k|xn--fjq720a|xn--flw351e|xn--g2xx48c|xn--gecrj9c|xn--gk3at1e|xn--h2brj9c|xn--hxt814e|xn--imr513n|xn--j6w193g|xn--jvr189m|xn--kprw13d|xn--kpry57d|xn--mgbbh1a|xn--mgbtx2b|xn--mix891f|xn--nyqy26a|xn--otu796d|xn--pgbs0dh|xn--q9jyb4c|xn--rhqv96g|xn--rovu88b|xn--s9brj9c|xn--ses554g|xn--t60b56a|xn--vuq861b|xn--w4rs40l|xn--xhq521b|xn--zfr164b|சிங்கப்பூர்|accountant|apartments|associates|basketball|bnpparibas|boehringer|capitalone|consulting|creditcard|cuisinella|eurovision|extraspace|foundation|healthcare|immobilien|industries|management|mitsubishi|nextdirect|properties|protection|prudential|realestate|republican|restaurant|schaeffler|tatamotors|technology|university|vlaanderen|xn--30rr7y|xn--3pxu8k|xn--45q11c|xn--4gbrim|xn--55qx5d|xn--5tzm5g|xn--80aswg|xn--90a3ac|xn--9dbq2a|xn--9et52u|xn--c2br7g|xn--cg4bki|xn--czrs0t|xn--czru2d|xn--fiq64b|xn--fiqs8s|xn--fiqz9s|xn--io0a7i|xn--kput3i|xn--mxtq1m|xn--o3cw4h|xn--pssy2u|xn--q7ce6a|xn--unup4y|xn--wgbh1c|xn--wgbl6a|xn--y9a3aq|accenture|allfinanz|amsterdam|analytics|aquarelle|barcelona|bloomberg|christmas|community|directory|education|equipment|fairwinds|financial|firestone|fresenius|furniture|goldpoint|hisamitsu|homedepot|homegoods|homesense|institute|insurance|kuokgroup|landrover|lifestyle|marketing|marshalls|melbourne|microsoft|panasonic|pramerica|richardli|shangrila|solutions|statebank|statefarm|stockholm|travelers|vacations|xn--90ais|xn--c1avg|xn--d1alf|xn--e1a4c|xn--fhbei|xn--j1aef|xn--j1amh|xn--l1acc|xn--ngbrx|xn--nqv7f|xn--p1acf|xn--qxa6a|xn--tckwe|xn--vhquv|yodobashi|موريتانيا|abudhabi|airforce|allstate|attorney|barclays|barefoot|bargains|baseball|boutique|bradesco|broadway|brussels|builders|business|capetown|catering|catholic|cipriani|cleaning|clinique|clothing|commbank|computer|delivery|deloitte|democrat|diamonds|discount|discover|download|engineer|ericsson|exchange|feedback|fidelity|firmdale|football|frontier|goodyear|grainger|graphics|hdfcbank|helsinki|holdings|hospital|infiniti|ipiranga|istanbul|jpmorgan|lighting|lundbeck|marriott|mckinsey|memorial|merckmsd|mortgage|observer|partners|pharmacy|pictures|plumbing|property|redstone|reliance|saarland|samsclub|security|services|shopping|softbank|software|stcgroup|supplies|training|vanguard|ventures|verisign|woodside|xn--90ae|xn--node|xn--p1ai|xn--qxam|yokohama|السعودية|abogado|academy|agakhan|alibaba|android|athleta|auction|audible|auspost|banamex|bauhaus|bestbuy|booking|brother|capital|caravan|careers|channel|charity|chintai|citadel|clubmed|college|cologne|company|compare|contact|cooking|corsica|country|coupons|courses|cricket|cruises|dentist|digital|domains|exposed|express|farmers|fashion|ferrari|ferrero|finance|fishing|fitness|flights|florist|flowers|forsale|frogans|fujitsu|gallery|genting|godaddy|grocery|guitars|hamburg|hangout|hitachi|holiday|hosting|hotmail|hyundai|ismaili|jewelry|juniper|kitchen|komatsu|lacaixa|lanxess|lasalle|latrobe|leclerc|limited|lincoln|markets|monster|netbank|netflix|network|neustar|okinawa|organic|origins|philips|pioneer|politie|realtor|recipes|rentals|reviews|rexroth|samsung|sandvik|schmidt|schwarz|science|shiksha|singles|staples|storage|support|surgery|systems|temasek|theater|theatre|tickets|toshiba|trading|walmart|wanggou|watches|weather|website|wedding|whoswho|windows|winners|yamaxun|youtube|zuerich|католик|البحرين|الجزائر|العليان|پاکستان|كاثوليك|இந்தியா|abbott|abbvie|africa|agency|airbus|airtel|alipay|alsace|alstom|amazon|anquan|aramco|author|bayern|beauty|berlin|bharti|bostik|boston|broker|camera|career|casino|center|chanel|chrome|church|circle|claims|clinic|coffee|comsec|condos|coupon|credit|cruise|dating|datsun|dealer|degree|dental|design|direct|doctor|dunlop|dupont|durban|emerck|energy|estate|events|expert|family|flickr|futbol|gallup|garden|george|giving|global|google|gratis|health|hermes|hiphop|hockey|hotels|hughes|imamat|insure|intuit|jaguar|joburg|juegos|kaufen|kindle|kosher|latino|lawyer|lefrak|living|locker|london|luxury|madrid|maison|makeup|market|mattel|mobile|monash|mormon|moscow|museum|nagoya|nissan|nissay|norton|nowruz|office|olayan|online|oracle|orange|otsuka|pfizer|photos|physio|pictet|quebec|racing|realty|reisen|repair|report|review|rogers|ryukyu|safety|sakura|sanofi|school|schule|search|secure|select|shouji|soccer|social|stream|studio|supply|suzuki|swatch|sydney|taipei|taobao|target|tattoo|tennis|tienda|tjmaxx|tkmaxx|toyota|travel|unicom|viajes|viking|villas|virgin|vision|voting|voyage|walter|webcam|xihuan|yachts|yandex|zappos|москва|онлайн|ابوظبي|ارامكو|الاردن|المغرب|امارات|فلسطين|مليسيا|भारतम्|இலங்கை|ファッション|actor|adult|aetna|amfam|amica|apple|archi|audio|autos|azure|baidu|beats|bible|bingo|black|boats|bosch|build|canon|cards|chase|cheap|cisco|citic|click|cloud|coach|codes|crown|cymru|dance|deals|delta|drive|dubai|earth|edeka|email|epson|faith|fedex|final|forex|forum|gallo|games|gifts|gives|glass|globo|gmail|green|gripe|group|gucci|guide|homes|honda|horse|house|hyatt|ikano|irish|jetzt|koeln|kyoto|lamer|lease|legal|lexus|lilly|loans|locus|lotte|lotto|mango|media|miami|money|movie|music|nexus|nikon|ninja|nokia|nowtv|omega|osaka|paris|parts|party|phone|photo|pizza|place|poker|praxi|press|prime|promo|quest|radio|rehab|reise|ricoh|rocks|rodeo|rugby|salon|sener|seven|sharp|shell|shoes|skype|sling|smart|smile|solar|space|sport|stada|store|study|style|sucks|swiss|tatar|tires|tirol|tmall|today|tokyo|tools|toray|total|tours|trade|trust|tunes|tushu|ubank|vegas|video|vodka|volvo|wales|watch|weber|weibo|works|world|xerox|yahoo|ישראל|ایران|بازار|بھارت|سودان|سورية|همراه|भारोत|संगठन|বাংলা|భారత్|ഭാരതം|嘉里大酒店|aarp|able|aero|akdn|ally|amex|arab|army|arpa|arte|asda|asia|audi|auto|baby|band|bank|bbva|beer|best|bike|bing|blog|blue|bofa|bond|book|buzz|cafe|call|camp|care|cars|casa|case|cash|cbre|cern|chat|citi|city|club|cool|coop|cyou|data|date|dclk|deal|dell|desi|diet|dish|docs|dvag|erni|fage|fail|fans|farm|fast|fido|film|fire|fish|flir|food|ford|free|fund|game|gbiz|gent|ggee|gift|gmbh|gold|golf|goog|guge|guru|hair|haus|hdfc|help|here|host|hsbc|icbc|ieee|imdb|immo|info|itau|java|jeep|jobs|jprs|kddi|kids|kiwi|kpmg|kred|land|lego|lgbt|lidl|life|like|limo|link|live|loan|love|ltda|luxe|maif|meet|meme|menu|mini|mint|mobi|moda|moto|name|navy|news|next|nico|nike|ollo|open|page|pars|pccw|pics|ping|pink|play|plus|pohl|porn|post|prod|prof|qpon|read|reit|rent|rest|rich|room|rsvp|ruhr|safe|sale|sarl|save|saxo|scot|seat|seek|sexy|shia|shop|show|silk|sina|site|skin|sncf|sohu|song|sony|spot|star|surf|talk|taxi|team|tech|teva|tiaa|tips|town|toys|tube|vana|visa|viva|vivo|vote|voto|wang|weir|wien|wiki|wine|work|xbox|yoga|zara|zero|zone|дети|сайт|بارت|بيتك|ڀارت|تونس|شبكة|عراق|عمان|موقع|भारत|ভারত|ভাৰত|ਭਾਰਤ|ભારત|ଭାରତ|ಭಾರತ|ලංකා|アマゾン|グーグル|クラウド|ポイント|组织机构|電訊盈科|香格里拉|aaa|abb|abc|aco|ads|aeg|afl|aig|anz|aol|app|art|aws|axa|bar|bbc|bbt|bcg|bcn|bet|bid|bio|biz|bms|bmw|bom|boo|bot|box|buy|bzh|cab|cal|cam|car|cat|cba|cbn|ceo|cfa|cfd|com|cpa|crs|dad|day|dds|dev|dhl|diy|dnp|dog|dot|dtv|dvr|eat|eco|edu|esq|eus|fan|fit|fly|foo|fox|frl|ftr|fun|fyi|gal|gap|gay|gdn|gea|gle|gmo|gmx|goo|gop|got|gov|hbo|hiv|hkt|hot|how|ibm|ice|icu|ifm|inc|ing|ink|int|ist|itv|jcb|jio|jll|jmp|jnj|jot|joy|kfh|kia|kim|kpn|krd|lat|law|lds|llc|llp|lol|lpl|ltd|man|map|mba|med|men|mil|mit|mlb|mls|mma|moe|moi|mom|mov|msd|mtn|mtr|nab|nba|nec|net|new|nfl|ngo|nhk|now|nra|nrw|ntt|nyc|obi|one|ong|onl|ooo|org|ott|ovh|pay|pet|phd|pid|pin|pnc|pro|pru|pub|pwc|red|ren|ril|rio|rip|run|rwe|sap|sas|sbi|sbs|scb|sew|sex|sfr|ski|sky|soy|spa|srl|stc|tab|tax|tci|tdk|tel|thd|tjx|top|trv|tui|tvs|ubs|uno|uol|ups|vet|vig|vin|vip|wed|win|wme|wow|wtc|wtf|xin|xxx|xyz|you|yun|zip|бел|ком|қаз|мкд|мон|орг|рус|срб|укр|հայ|קום|عرب|قطر|كوم|مصر|कॉम|नेट|คอม|ไทย|ລາວ|ストア|セール|みんな|中文网|亚马逊|天主教|我爱你|新加坡|淡马锡|飞利浦|ac|ad|ae|af|ag|ai|al|am|ao|aq|ar|as|at|au|aw|ax|az|ba|bb|bd|be|bf|bg|bh|bi|bj|bm|bn|bo|br|bs|bt|bv|bw|by|bz|ca|cc|cd|cf|cg|ch|ci|ck|cl|cm|cn|co|cr|cu|cv|cw|cx|cy|cz|de|dj|dk|dm|do|dz|ec|ee|eg|er|es|et|eu|fi|fj|fk|fm|fo|fr|ga|gb|gd|ge|gf|gg|gh|gi|gl|gm|gn|gp|gq|gr|gs|gt|gu|gw|gy|hk|hm|hn|hr|ht|hu|id|ie|il|im|in|io|iq|ir|is|it|je|jm|jo|jp|ke|kg|kh|ki|km|kn|kp|kr|kw|ky|kz|la|lb|lc|li|lk|lr|ls|lt|lu|lv|ly|ma|mc|md|me|mg|mh|mk|ml|mm|mn|mo|mp|mq|mr|ms|mt|mu|mv|mw|mx|my|mz|na|nc|ne|nf|ng|ni|nl|no|np|nr|nu|nz|om|pa|pe|pf|pg|ph|pk|pl|pm|pn|pr|ps|pt|pw|py|qa|re|ro|rs|ru|rw|sa|sb|sc|sd|se|sg|sh|si|sj|sk|sl|sm|sn|so|sr|ss|st|su|sv|sx|sy|sz|tc|td|tf|tg|th|tj|tk|tl|tm|tn|to|tr|tt|tv|tw|tz|ua|ug|uk|us|uy|uz|va|vc|ve|vg|vi|vn|vu|wf|ws|ye|yt|za|zm|zw|ελ|ευ|бг|ею|рф|გე|닷넷|닷컴|삼성|한국|コム|世界|中信|中国|中國|企业|佛山|信息|健康|八卦|公司|公益|台湾|台灣|商城|商店|商标|嘉里|在线|大拿|娱乐|家電|广东|微博|慈善|手机|招聘|政务|政府|新闻|时尚|書籍|机构|游戏|澳門|点看|移动|网址|网店|网站|网络|联通|谷歌|购物|通販|集团|食品|餐厅|香港)$/;var Aie=/https?:\/\//i,DLe=new RegExp("^"+Aie.source,"i"),XRt=/^(javascript|vbscript):/i,NRt=/^[A-Za-z][-.+A-Za-z0-9]*:(\/\/)?([^:/]*)/,YRt=/^(?:\/\/)?([^/#?:]+)/,HE=Hg;function Gie(e){return Hg(e)||sa(e)||e===43||e===45||e===46}var Kg=Hf;function RH(e){return e===95||Kg(e)}function Lie(e){return Hf(e)||wLe(e)||ZH(e)}function CH(e){return e===47||e===63||e===35}function Wie(e){return ULe.test(e.toLowerCase())}function OLe(e){if(XRt.test(e))return!1;var t=e.match(NRt);if(!t)return!1;var n=!!t[1],i=t[2];return n?!0:!(i.indexOf(".")===-1||!/[A-Za-z]/.test(i))}function BLe(e){var t=e.match(YRt);if(!t)return!1;var n=t[0],i=n.split(".");if(i.length<2)return!1;var o=i[i.length-1];return!!Wie(o)}var MRt=/^(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$/,wRt=/[:/?#]/;function zLe(e){var t=e.split(wRt,1)[0];return MRt.test(t)}var kRt=/^(https?:\/\/)?(?:www\.)?/i,URt=/^\/\//,HLe=(function(e){_0(t,e);function t(n){var i=e.call(this,n)||this;return i.type="url",i.url="",i.urlMatchType="scheme",i.protocolRelativeMatch=!1,i.stripPrefix={scheme:!0,www:!0},i.stripTrailingSlash=!0,i.decodePercentEncoding=!0,i.protocolPrepended=!1,i.urlMatchType=n.urlMatchType,i.url=n.url,i.protocolRelativeMatch=n.protocolRelativeMatch,i.stripPrefix=n.stripPrefix,i.stripTrailingSlash=n.stripTrailingSlash,i.decodePercentEncoding=n.decodePercentEncoding,i}return t.prototype.getType=function(){return"url"},t.prototype.getUrlMatchType=function(){return this.urlMatchType},t.prototype.getUrl=function(){var n=this.url;return!this.protocolRelativeMatch&&this.urlMatchType!=="scheme"&&!this.protocolPrepended&&(n=this.url="http://"+n,this.protocolPrepended=!0),n},t.prototype.getAnchorHref=function(){var n=this.getUrl();return n.replace(/&/g,"&")},t.prototype.getAnchorText=function(){var n=this.getMatchedText();return this.protocolRelativeMatch&&(n=BRt(n)),this.stripPrefix.scheme&&(n=DRt(n)),this.stripPrefix.www&&(n=ORt(n)),this.stripTrailingSlash&&(n=zRt(n)),this.decodePercentEncoding&&(n=HRt(n)),n},t})(S0);function DRt(e){return e.replace(DLe,"")}function ORt(e){return e.includes("www.")?e.replace(kRt,"$1"):e}function BRt(e){return e.replace(URt,"")}function zRt(e){return e.charAt(e.length-1)==="/"&&(e=e.slice(0,-1)),e}function HRt(e){var t=e.replace(/%(?:22|26|27|3C|3E)/gi,function(n){return n==="%22"?""":n==="%26"?"&":n==="%27"?"'":n==="%3C"||n==="%3c"?"<":">"});if(t.includes("%"))try{return decodeURIComponent(t)}catch{}return t}var u7i=x(T());var KLe=/^mailto:/i,vie=Hf;function VH(e){return vie(e)||MLe(e)}function JLe(e){var t=e.split(".").pop();return Wie(t)}var p7i=x(T());var jLe=(function(e){_0(t,e);function t(n){var i=e.call(this,n)||this;return i.type="email",i.email="",i.email=n.email,i}return t.prototype.getType=function(){return"email"},t.prototype.getEmail=function(){return this.email},t.prototype.getAnchorHref=function(){return"mailto:"+this.email},t.prototype.getAnchorText=function(){return this.email},t})(S0);var y7i=x(T());function Fie(e){return e===95||Hf(e)}function QLe(e){return e.length<=140}var qLe=["twitter","facebook","instagram","tiktok","youtube"];var Z7i=x(T());var $Le=(function(e){_0(t,e);function t(n){var i=e.call(this,n)||this;return i.type="hashtag",i.serviceName="twitter",i.hashtag="",i.serviceName=n.serviceName,i.hashtag=n.hashtag,i}return t.prototype.getType=function(){return"hashtag"},t.prototype.getServiceName=function(){return this.serviceName},t.prototype.getHashtag=function(){return this.hashtag},t.prototype.getAnchorHref=function(){var n=this.serviceName,i=this.hashtag;switch(n){case"twitter":return"https://twitter.com/hashtag/"+i;case"facebook":return"https://www.facebook.com/hashtag/"+i;case"instagram":return"https://instagram.com/explore/tags/"+i;case"tiktok":return"https://www.tiktok.com/tag/"+i;case"youtube":return"https://youtube.com/hashtag/"+i;default:zf(n)}},t.prototype.getAnchorText=function(){return"#"+this.hashtag},t.prototype.getCssClassSuffixes=function(){var n=e.prototype.getCssClassSuffixes.call(this),i=this.getServiceName();return i&&n.push(i),n},t})(S0);var V7i=x(T());var KRt={twitter:/^@\w{1,15}$/,instagram:/^@[_\w]{1,30}$/,soundcloud:/^@[-a-z0-9_]{3,25}$/,tiktok:/^@[.\w]{1,23}[\w]$/,youtube:/^@[-.·\w]{3,30}$/};function Iie(e){return e===45||e===46||e===95||Hg(e)||sa(e)}function eWe(e,t){var n=KRt[t];return n.test(e)}var tWe=["twitter","instagram","soundcloud","tiktok","youtube"];var W7i=x(T());var nWe=(function(e){_0(t,e);function t(n){var i=e.call(this,n)||this;return i.type="mention",i.serviceName="twitter",i.mention="",i.mention=n.mention,i.serviceName=n.serviceName,i}return t.prototype.getType=function(){return"mention"},t.prototype.getMention=function(){return this.mention},t.prototype.getServiceName=function(){return this.serviceName},t.prototype.getAnchorHref=function(){switch(this.serviceName){case"twitter":return"https://twitter.com/"+this.mention;case"instagram":return"https://instagram.com/"+this.mention;case"soundcloud":return"https://soundcloud.com/"+this.mention;case"tiktok":return"https://www.tiktok.com/@"+this.mention;case"youtube":return"https://youtube.com/@"+this.mention;default:zf(this.serviceName)}},t.prototype.getAnchorText=function(){return"@"+this.mention},t.prototype.getCssClassSuffixes=function(){var n=e.prototype.getCssClassSuffixes.call(this),i=this.getServiceName();return i&&n.push(i),n},t})(S0);var F7i=x(T()),JRt=/[-. ()]/,jRt=/(?:(?:(?:(\+)?\d{1,3}[-. ]?)?\(?\d{3}\)?[-. ]?\d{3}[-. ]?\d{4})|(?:(\+)(?:9[976]\d|8[987530]\d|6[987]\d|5[90]\d|42\d|3[875]\d|2[98654321]\d|9[8543210]|8[6421]|6[6543210]|5[87654321]|4[987654310]|3[9643210]|2[70]|7|1)[-. ]?(?:\d[-. ]?){6,12}\d+))([,;]+[0-9]+#?)*/,QRt=/(0([1-9]-?[1-9]\d{3}|[1-9]{2}-?\d{3}|[1-9]{2}\d{1}-?\d{2}|[1-9]{2}\d{2}-?\d{1})-?\d{4}|0[789]0-?\d{4}-?\d{4}|050-?\d{4}-?\d{4})/,qRt=new RegExp("^".concat(jRt.source,"|").concat(QRt.source,"$"));function Pie(e){return e===45||e===46||e===32}function EH(e){return e===44||e===59}function iWe(e){var t=e.charAt(0)==="+"||JRt.test(e);return t&&qRt.test(e)}var N7i=x(T());var oWe=(function(e){_0(t,e);function t(n){var i=e.call(this,n)||this;return i.type="phone",i.number="",i.plusSign=!1,i.number=n.number,i.plusSign=n.plusSign,i}return t.prototype.getType=function(){return"phone"},t.prototype.getPhoneNumber=function(){return this.number},t.prototype.getNumber=function(){return this.getPhoneNumber()},t.prototype.getAnchorHref=function(){return"tel:"+(this.plusSign?"+":"")+this.number},t.prototype.getAnchorText=function(){return this.matchedText},t})(S0);var $Rt=(function(){function e(t,n){this.charIdx=0,this.matches=[],this._stateMachines=[],this.schemeUrlMachinesCount=0,this.text=t,this.tagBuilder=n.tagBuilder,this.stripPrefix=n.stripPrefix,this.stripTrailingSlash=n.stripTrailingSlash,this.decodePercentEncoding=n.decodePercentEncoding,this.hashtagServiceName=n.hashtagServiceName,this.mentionServiceName=n.mentionServiceName}return Object.defineProperty(e.prototype,"stateMachines",{get:function(){return this._stateMachines},enumerable:!1,configurable:!0}),e.prototype.addMachine=function(t){this._stateMachines.push(t),sWe(t)&&this.schemeUrlMachinesCount++},e.prototype.removeMachine=function(t){this._stateMachines=this._stateMachines.filter(function(n){return n!==t}),sWe(t)&&this.schemeUrlMachinesCount--},e.prototype.hasSchemeUrlMachine=function(){return this.schemeUrlMachinesCount>0},e})();function aWe(e,t){for(var n=new $Rt(e,t);n.charIdx<n.text.length;n.charIdx++){var i=e.charAt(n.charIdx),o=e.charCodeAt(n.charIdx);if(n.stateMachines.length===0)AH(n,i,o);else{for(var r=n.stateMachines.length-1;r>=0;r--){var s=n.stateMachines[r];switch(s.state){case 11:r1t(n,s,o);break;case 12:s1t(n,s,o);break;case 0:e1t(n,s,o);break;case 1:t1t(n,s,o);break;case 2:n1t(n,s,o);break;case 3:i1t(n,s,o);break;case 4:o1t(n,s,i,o);break;case 5:a1t(n,s,o);break;case 6:c1t(n,s,i,o);break;case 7:l1t(n,s,i,o);break;case 13:d1t(n,s,o);break;case 14:u1t(n,s,o);break;case 8:m1t(n,s,o);break;case 9:h1t(n,s,o);break;case 10:f1t(n,s,o);break;case 15:p1t(n,s,i,o);break;case 16:b1t(n,s,i,o);break;case 17:g1t(n,s,i,o);break;case 18:y1t(n,s,i,o);break;case 19:x1t(n,s,i,o);break;case 20:T1t(n,s,o);break;case 21:_1t(n,s,o);break;case 22:kZ(n,s,o);break;case 23:S1t(n,s,o);break;case 24:Z1t(n,s,o);break;case 25:R1t(n,s,o);break;case 26:C1t(n,s,o);break;case 27:V1t(n,s,o);break;case 28:E1t(n,s,o);break;case 29:A1t(n,s,o);break;case 30:G1t(n,s,o);break;case 31:L1t(n,s,o);break;case 32:v1t(n,s,i,o);break;case 33:F1t(n,s,o);break;case 34:I1t(n,s,o);break;case 35:P1t(n,s,o);break;case 36:X1t(n,s,i,o);break;case 37:W1t(n,s,i,o);break;case 38:N1t(n,s,i,o);break;case 39:Y1t(n,s,i,o);break;case 40:M1t(n,s,o);break;case 41:w1t(n,s,o);break;default:zf(s.state)}}if(!n.hasSchemeUrlMachine()&&n.charIdx>0&&HE(o)){var a=n.text.charCodeAt(n.charIdx-1);HE(a)||n.addMachine(GH(n.charIdx,0))}}}for(var c=n.stateMachines.length-1;c>=0;c--)n.stateMachines.forEach(function(d){return Ws(n,d)});return n.matches}function AH(e,t,n){var i=e.charIdx;if(n===35)e.addMachine(B1t(i,28));else if(n===64)e.addMachine(z1t(i,30));else if(n===47)e.addMachine(Nie(i,11));else if(n===43)e.addMachine(Xie(i,37));else if(n===40)e.addMachine(Xie(i,32));else{if(sa(n)&&(e.addMachine(Xie(i,38)),e.addMachine(D1t(i,13))),vie(n)){var o=t.toLowerCase()==="m"?15:22;e.addMachine(O1t(i,o))}HE(n)&&e.addMachine(GH(i,0)),Hf(n)&&e.addMachine(Nie(i,5))}}function e1t(e,t,n){n===58?t.state=2:n===45?t.state=1:Gie(n)||e.removeMachine(t)}function t1t(e,t,n){var i=e.charIdx;n===45||(n===47?(e.removeMachine(t),e.addMachine(Nie(i,11))):Gie(n)?t.state=0:e.removeMachine(t))}function n1t(e,t,n){var i=e.charIdx;n===47?t.state=3:n===46?e.removeMachine(t):Kg(n)?(t.state=5,HE(n)&&e.addMachine(GH(i,0))):e.removeMachine(t)}function i1t(e,t,n){n===47?t.state=4:Lie(n)?(t.state=10,t.acceptStateReached=!0):Ws(e,t)}function o1t(e,t,n,i){i===47?(t.state=10,t.acceptStateReached=!0):Kg(i)?(t.state=5,t.acceptStateReached=!0):e.removeMachine(t)}function r1t(e,t,n){n===47?t.state=12:e.removeMachine(t)}function s1t(e,t,n){Kg(n)?t.state=5:e.removeMachine(t)}function a1t(e,t,n){n===46?t.state=7:n===45?t.state=6:n===58?t.state=8:CH(n)?t.state=10:RH(n)||Ws(e,t)}function c1t(e,t,n,i){i===45||(i===46?Ws(e,t):Kg(i)?t.state=5:Ws(e,t))}function l1t(e,t,n,i){i===46?Ws(e,t):Kg(i)?(t.state=5,t.acceptStateReached=!0):Ws(e,t)}function d1t(e,t,n){n===46?t.state=14:n===58?t.state=8:sa(n)||(CH(n)?t.state=10:Hf(n)?e.removeMachine(t):Ws(e,t))}function u1t(e,t,n){sa(n)?(t.octetsEncountered++,t.octetsEncountered===4&&(t.acceptStateReached=!0),t.state=13):Ws(e,t)}function m1t(e,t,n){sa(n)?t.state=9:Ws(e,t)}function h1t(e,t,n){sa(n)||(CH(n)?t.state=10:Ws(e,t))}function f1t(e,t,n){Lie(n)||Ws(e,t)}function p1t(e,t,n,i){n.toLowerCase()==="a"?t.state=16:kZ(e,t,i)}function b1t(e,t,n,i){n.toLowerCase()==="i"?t.state=17:kZ(e,t,i)}function g1t(e,t,n,i){n.toLowerCase()==="l"?t.state=18:kZ(e,t,i)}function y1t(e,t,n,i){n.toLowerCase()==="t"?t.state=19:kZ(e,t,i)}function x1t(e,t,n,i){n.toLowerCase()==="o"?t.state=20:kZ(e,t,i)}function T1t(e,t,n){n===58?t.state=21:kZ(e,t,n)}function _1t(e,t,n){VH(n)?t.state=22:e.removeMachine(t)}function kZ(e,t,n){n===46?t.state=23:n===64?t.state=24:VH(n)?t.state=22:e.removeMachine(t)}function S1t(e,t,n){n===46||n===64?e.removeMachine(t):VH(n)?t.state=22:e.removeMachine(t)}function Z1t(e,t,n){Kg(n)?t.state=25:e.removeMachine(t)}function R1t(e,t,n){n===46?t.state=27:n===45?t.state=26:RH(n)||Ws(e,t)}function C1t(e,t,n){n===45||n===46?Ws(e,t):RH(n)?t.state=25:Ws(e,t)}function V1t(e,t,n){n===46||n===45?Ws(e,t):Kg(n)?(t.state=25,t.acceptStateReached=!0):Ws(e,t)}function E1t(e,t,n){Fie(n)?(t.state=29,t.acceptStateReached=!0):e.removeMachine(t)}function A1t(e,t,n){Fie(n)||Ws(e,t)}function G1t(e,t,n){Iie(n)?(t.state=31,t.acceptStateReached=!0):e.removeMachine(t)}function L1t(e,t,n){Iie(n)||(Hf(n)?e.removeMachine(t):Ws(e,t))}function W1t(e,t,n,i){sa(i)?t.state=38:(e.removeMachine(t),AH(e,n,i))}function v1t(e,t,n,i){sa(i)?t.state=33:e.removeMachine(t),AH(e,n,i)}function F1t(e,t,n){sa(n)?t.state=34:e.removeMachine(t)}function I1t(e,t,n){sa(n)?t.state=35:e.removeMachine(t)}function P1t(e,t,n){n===41?t.state=36:e.removeMachine(t)}function X1t(e,t,n,i){sa(i)?t.state=38:Pie(i)?t.state=39:e.removeMachine(t)}function N1t(e,t,n,i){var o=e.charIdx;t.acceptStateReached=!0,EH(i)?t.state=40:i===35?t.state=41:sa(i)||(i===40?t.state=32:Pie(i)?t.state=39:(Ws(e,t),HE(i)&&e.addMachine(GH(o,0))))}function Y1t(e,t,n,i){sa(i)?t.state=38:i===40?t.state=32:(Ws(e,t),AH(e,n,i))}function M1t(e,t,n){EH(n)||(n===35?t.state=41:sa(n)?t.state=38:Ws(e,t))}function w1t(e,t,n){EH(n)?t.state=40:sa(n)?e.removeMachine(t):Ws(e,t)}function Ws(e,t){var n=e.matches,i=e.text,o=e.charIdx,r=e.tagBuilder,s=e.stripPrefix,a=e.stripTrailingSlash,c=e.decodePercentEncoding,d=e.hashtagServiceName,u=e.mentionServiceName;if(e.removeMachine(t),!!t.acceptStateReached){var m=t.startIdx,p=i.slice(t.startIdx,o);switch(p=U1t(p),t.type){case 0:{var b=i.charCodeAt(t.startIdx-1);if(b===64)return;switch(t.matchType){case 0:{var f=Aie.exec(p);if(f&&(m=m+f.index,p=p.slice(f.index)),!OLe(p))return;break}case 1:{if(!BLe(p))return;break}case 2:{if(!zLe(p))return;break}default:zf(t)}n.push(new HLe({tagBuilder:r,matchedText:p,offset:m,urlMatchType:k1t(t.matchType),url:p,protocolRelativeMatch:p.slice(0,2)==="//",stripPrefix:s,stripTrailingSlash:a,decodePercentEncoding:c}));break}case 1:{JLe(p)&&n.push(new jLe({tagBuilder:r,matchedText:p,offset:m,email:p.replace(KLe,"")}));break}case 2:{QLe(p)&&n.push(new $Le({tagBuilder:r,matchedText:p,offset:m,serviceName:d,hashtag:p.slice(1)}));break}case 3:{eWe(p,u)&&n.push(new nWe({tagBuilder:r,matchedText:p,offset:m,serviceName:u,mention:p.slice(1)}));break}case 4:{if(p=p.replace(/ +$/g,""),iWe(p)){var y=p.replace(/[^0-9,;#]/g,"");n.push(new oWe({tagBuilder:r,matchedText:p,offset:m,number:y,plusSign:p.charAt(0)==="+"}))}break}default:zf(t)}}}function k1t(e){switch(e){case 0:return"scheme";case 1:return"tld";case 2:return"ipV4";default:zf(e)}}var rWe={")":"(","}":"{","]":"["};function U1t(e){for(var t={"(":0,"{":0,"[":0},n=0;n<e.length;n++){var i=e.charAt(n),o=e.charCodeAt(n);kLe(o)?t[i]++:Eie(o)&&t[rWe[i]]--}for(var r=e.length-1;r>=0;){var i=e.charAt(r),o=e.charCodeAt(r);if(Eie(o)){var s=rWe[i];if(t[s]<0)t[s]++,r--;else break}else if(ZH(o))r--;else break}return e.slice(0,r+1)}function GH(e,t){return{type:0,startIdx:e,state:t,acceptStateReached:!1,matchType:0}}function Nie(e,t){return{type:0,startIdx:e,state:t,acceptStateReached:!1,matchType:1}}function D1t(e,t){return{type:0,startIdx:e,state:t,acceptStateReached:!1,matchType:2,octetsEncountered:1}}function O1t(e,t){return{type:1,startIdx:e,state:t,acceptStateReached:!1}}function B1t(e,t){return{type:2,startIdx:e,state:t,acceptStateReached:!1}}function z1t(e,t){return{type:3,startIdx:e,state:t,acceptStateReached:!1}}function Xie(e,t){return{type:4,startIdx:e,state:t,acceptStateReached:!1}}function sWe(e){return e.type===0&&e.matchType===0}var nqi=x(T());var Z0=(function(){function e(t){t===void 0&&(t={}),this.idx=t.idx!==void 0?t.idx:-1,this.type=t.type||"tag",this.name=t.name||"",this.isOpening=!!t.isOpening,this.isClosing=!!t.isClosing}return e})(),Mie=new Z0,H1t=(function(){function e(t,n){this.charIdx=0,this.state=0,this.currentDataIdx=0,this.currentTag=Mie,this.html=t,this.callbacks=n}return e})();function cWe(e,t){for(var n=new H1t(e,t),i=e.length;n.charIdx<i;){var o=e.charAt(n.charIdx),r=e.charCodeAt(n.charIdx);switch(n.state){case 0:K1t(n,o);break;case 1:J1t(n,o,r);break;case 2:Q1t(n,o,r);break;case 3:j1t(n,o,r);break;case 4:q1t(n,o,r);break;case 5:$1t(n,o,r);break;case 6:eCt(n,o,r);break;case 7:tCt(n,o,r);break;case 8:nCt(n,o);break;case 9:iCt(n,o);break;case 10:oCt(n,o,r);break;case 11:rCt(n,o,r);break;case 12:sCt(n,o);break;case 13:aCt(n);break;case 14:cCt(n,o);break;case 15:lCt(n,o);break;case 16:dCt(n,o);break;case 17:uCt(n,o);break;case 18:mCt(n,o);break;case 19:hCt(n,o);break;case 20:fCt(n,o);break;default:zf(n.state)}n.charIdx++}n.currentDataIdx<n.charIdx&&pCt(n)}function K1t(e,t){t==="<"&&R0(e)}function J1t(e,t,n){t==="!"?e.state=13:t==="/"?(e.state=2,e.currentTag=new Z0(ra(ra({},e.currentTag),{isClosing:!0}))):t==="<"?R0(e):Hg(n)?(e.state=3,e.currentTag=new Z0(ra(ra({},e.currentTag),{isOpening:!0}))):(e.state=0,e.currentTag=Mie)}function j1t(e,t,n){fT(n)?(e.currentTag=new Z0(ra(ra({},e.currentTag),{name:Yie(e)})),e.state=4):t==="<"?R0(e):t==="/"?(e.currentTag=new Z0(ra(ra({},e.currentTag),{name:Yie(e)})),e.state=12):t===">"?(e.currentTag=new Z0(ra(ra({},e.currentTag),{name:Yie(e)})),C0(e)):!Hg(n)&&!sa(n)&&t!==":"&&bh(e)}function Q1t(e,t,n){t===">"?bh(e):Hg(n)?e.state=3:bh(e)}function q1t(e,t,n){fT(n)||(t==="/"?e.state=12:t===">"?C0(e):t==="<"?R0(e):t==="="||SH(n)||YLe(n)?bh(e):e.state=5)}function $1t(e,t,n){fT(n)?e.state=6:t==="/"?e.state=12:t==="="?e.state=7:t===">"?C0(e):t==="<"?R0(e):SH(n)&&bh(e)}function eCt(e,t,n){fT(n)||(t==="/"?e.state=12:t==="="?e.state=7:t===">"?C0(e):t==="<"?R0(e):SH(n)?bh(e):e.state=5)}function tCt(e,t,n){fT(n)||(t==='"'?e.state=8:t==="'"?e.state=9:/[>=`]/.test(t)?bh(e):t==="<"?R0(e):e.state=10)}function nCt(e,t){t==='"'&&(e.state=11)}function iCt(e,t){t==="'"&&(e.state=11)}function oCt(e,t,n){fT(n)?e.state=4:t===">"?C0(e):t==="<"&&R0(e)}function rCt(e,t,n){fT(n)?e.state=4:t==="/"?e.state=12:t===">"?C0(e):t==="<"?R0(e):(e.state=4,bCt(e))}function sCt(e,t){t===">"?(e.currentTag=new Z0(ra(ra({},e.currentTag),{isClosing:!0})),C0(e)):bh(e)}function aCt(e){var t=e.html,n=e.charIdx;t.slice(n,n+2)==="--"?(e.charIdx++,e.currentTag=new Z0(ra(ra({},e.currentTag),{type:"comment"})),e.state=14):t.slice(n,n+7).toUpperCase()==="DOCTYPE"?(e.charIdx+=6,e.currentTag=new Z0(ra(ra({},e.currentTag),{type:"doctype"})),e.state=20):bh(e)}function cCt(e,t){t==="-"?e.state=15:t===">"?bh(e):e.state=16}function lCt(e,t){t==="-"?e.state=18:t===">"?bh(e):e.state=16}function dCt(e,t){t==="-"&&(e.state=17)}function uCt(e,t){t==="-"?e.state=18:e.state=16}function mCt(e,t){t===">"?C0(e):t==="!"?e.state=19:t==="-"||(e.state=16)}function hCt(e,t){t==="-"?e.state=17:t===">"?C0(e):e.state=16}function fCt(e,t){t===">"?C0(e):t==="<"&&R0(e)}function bh(e){e.state=0,e.currentTag=Mie}function R0(e){e.state=1,e.currentTag=new Z0({idx:e.charIdx})}function C0(e){var t=e.html.slice(e.currentDataIdx,e.currentTag.idx);t&&e.callbacks.onText(t,e.currentDataIdx);var n=e.currentTag;n.type==="comment"?e.callbacks.onComment(n.idx):n.type==="doctype"?e.callbacks.onDoctype(n.idx):(n.isOpening&&e.callbacks.onOpenTag(n.name,n.idx),n.isClosing&&e.callbacks.onCloseTag(n.name,n.idx)),bh(e),e.currentDataIdx=e.charIdx+1}function pCt(e){var t=e.html.slice(e.currentDataIdx,e.charIdx);e.callbacks.onText(t,e.currentDataIdx),e.currentDataIdx=e.charIdx+1}function Yie(e){var t=e.currentTag.idx+(e.currentTag.isClosing?2:1);return e.html.slice(t,e.charIdx).toLowerCase()}function bCt(e){e.charIdx--}var gCt=(function(){function e(t){t===void 0&&(t={}),this.version=e.version,this.urls={},this.email=!0,this.phone=!0,this.hashtag=!1,this.mention=!1,this.newWindow=!0,this.stripPrefix={scheme:!0,www:!0},this.stripTrailingSlash=!0,this.decodePercentEncoding=!0,this.truncate={length:0,location:"end"},this.className="",this.replaceFn=null,this.context=void 0,this.sanitizeHtml=!1,this.tagBuilder=null,this.urls=yCt(t.urls),this.email=nm(t.email)?t.email:this.email,this.phone=nm(t.phone)?t.phone:this.phone,this.hashtag=t.hashtag||this.hashtag,this.mention=t.mention||this.mention,this.newWindow=nm(t.newWindow)?t.newWindow:this.newWindow,this.stripPrefix=xCt(t.stripPrefix),this.stripTrailingSlash=nm(t.stripTrailingSlash)?t.stripTrailingSlash:this.stripTrailingSlash,this.decodePercentEncoding=nm(t.decodePercentEncoding)?t.decodePercentEncoding:this.decodePercentEncoding,this.sanitizeHtml=t.sanitizeHtml||!1;var n=this.mention;if(n!==!1&&tWe.indexOf(n)===-1)throw new Error("invalid `mention` cfg '".concat(n,"' - see docs"));var i=this.hashtag;if(i!==!1&&qLe.indexOf(i)===-1)throw new Error("invalid `hashtag` cfg '".concat(i,"' - see docs"));this.truncate=TCt(t.truncate),this.className=t.className||this.className,this.replaceFn=t.replaceFn||this.replaceFn,this.context=t.context||this}return e.link=function(t,n){var i=new e(n);return i.link(t)},e.parse=function(t,n){var i=new e(n);return i.parse(t)},e.prototype.parse=function(t){var n=this,i=["a","style","script"],o=0,r=[];return cWe(t,{onOpenTag:function(s){i.indexOf(s)>=0&&o++},onText:function(s,a){if(o===0){var c=/( | |<|<|>|>|"|"|')/gi,d=s.split(c),u=a;d.forEach(function(m,p){if(p%2===0){var b=n.parseText(m,u);r.push.apply(r,GLe([],ALe(b),!1))}u+=m.length})}},onCloseTag:function(s){i.indexOf(s)>=0&&(o=Math.max(o-1,0))},onComment:function(){},onDoctype:function(){}}),r=this.compactMatches(r),r=this.removeUnwantedMatches(r),r},e.prototype.compactMatches=function(t){t.sort(_Ct);for(var n=0;n<t.length-1;){var i=t[n],o=i.getOffset(),r=i.getMatchedText().length;if(n+1<t.length&&t[n+1].getOffset()===o){var s=t[n+1].getMatchedText().length>r?n:n+1;t.splice(s,1);continue}n++}return t},e.prototype.removeUnwantedMatches=function(t){return this.hashtag||hT(t,function(n){return n.getType()==="hashtag"}),this.email||hT(t,function(n){return n.getType()==="email"}),this.phone||hT(t,function(n){return n.getType()==="phone"}),this.mention||hT(t,function(n){return n.getType()==="mention"}),this.urls.schemeMatches||hT(t,function(n){return n.getType()==="url"&&n.getUrlMatchType()==="scheme"}),this.urls.tldMatches||hT(t,function(n){return n.getType()==="url"&&n.getUrlMatchType()==="tld"}),this.urls.ipV4Matches||hT(t,function(n){return n.getType()==="url"&&n.getUrlMatchType()==="ipV4"}),t},e.prototype.parseText=function(t,n){n=n||0;for(var i=aWe(t,{tagBuilder:this.getTagBuilder(),stripPrefix:this.stripPrefix,stripTrailingSlash:this.stripTrailingSlash,decodePercentEncoding:this.decodePercentEncoding,hashtagServiceName:this.hashtag,mentionServiceName:this.mention||"twitter"}),o=0,r=i.length;o<r;o++)i[o].setOffset(n+i[o].getOffset());return i},e.prototype.link=function(t){if(!t)return"";this.sanitizeHtml&&(t=t.replace(/</g,"<").replace(/>/g,">"));for(var n=this.parse(t),i=new Array(n.length*2+1),o=0,r=0,s=n.length;r<s;r++){var a=n[r];i.push(t.substring(o,a.getOffset())),i.push(this.createMatchReturnVal(a)),o=a.getOffset()+a.getMatchedText().length}return i.push(t.substring(o)),i.join("")},e.prototype.createMatchReturnVal=function(t){var n;if(this.replaceFn&&(n=this.replaceFn.call(this.context,t)),typeof n=="string")return n;if(n===!1)return t.getMatchedText();if(n instanceof _H)return n.toAnchorString();var i=t.buildTag();return i.toAnchorString()},e.prototype.getTagBuilder=function(){var t=this.tagBuilder;return t||(t=this.tagBuilder=new NLe({newWindow:this.newWindow,truncate:this.truncate,className:this.className})),t},e.version=LLe,e})(),lWe=gCt;function yCt(e){return e==null&&(e=!0),nm(e)?{schemeMatches:e,tldMatches:e,ipV4Matches:e}:{schemeMatches:nm(e.schemeMatches)?e.schemeMatches:!0,tldMatches:nm(e.tldMatches)?e.tldMatches:!0,ipV4Matches:nm(e.ipV4Matches)?e.ipV4Matches:!0}}function xCt(e){return e==null&&(e=!0),nm(e)?{scheme:e,www:e}:{scheme:nm(e.scheme)?e.scheme:!0,www:nm(e.www)?e.www:!0}}function TCt(e){return typeof e=="number"?{length:e,location:"end"}:ra({length:Number.POSITIVE_INFINITY,location:"end"},e)}function _Ct(e,t){return e.getOffset()-t.getOffset()}var bqi=x(T());var fqi=x(T());var Cqi=x(T());var LH=lWe;var yWe;typeof DOMParser<"u"&&(yWe=new DOMParser);var SCt=new LH({stripPrefix:!1,email:!1,replaceFn:function(e,t){return t.urlMatchType==="scheme"||t.urlMatchType==="www"}}),WH=32,dWe=2414016,uWe=1,mWe=16093e3,hWe=.1,ZCt=[null,void 0,"http://www.topografix.com/GPX/1/1"],nr={gpx:ZCt};function RCt(e){return new Promise((t,n)=>{let i=new FileReader;i.addEventListener("load",function(){t(i.result)}),i.addEventListener("error",function(){n(i.error)}),i.readAsText(e)})}function wie(e,t){let n=_w(e,"id");return n=l(n)?n:Qn(),t.getOrCreateEntity(n)}function kie(e){let t=fWe(e,"lon"),n=fWe(e,"lat"),i=xw(e,"ele",nr.gpx);return h.fromDegrees(t,n,i)}function fWe(e,t){if(!l(e))return;let n=e.getAttribute(t);if(n!==null){let i=parseFloat(n);return isNaN(i)?void 0:i}}function _w(e,t){if(!l(e))return;let n=e.getAttribute(t);return n!==null?n:void 0}function pT(e,t,n){if(!l(e))return;let i=e.childNodes,o=i.length;for(let r=0;r<o;r++){let s=i[r];if(s.localName===t&&n.indexOf(s.namespaceURI)!==-1)return s}}function Uie(e,t,n){if(!l(e))return;let i=[],o=e.getElementsByTagName(t),r=o.length;for(let s=0;s<r;s++){let a=o[s];a.localName===t&&n.indexOf(a.namespaceURI)!==-1&&i.push(a)}return i}function xw(e,t,n){let i=pT(e,t,n);if(l(i)){let o=parseFloat(i.textContent);return isNaN(o)?void 0:o}}function iu(e,t,n){let i=pT(e,t,n);if(l(i))return i.textContent.trim()}function xWe(e){let t=new jc;return t.width=WH,t.height=WH,t.scaleByDistance=new Kt(dWe,uWe,mWe,hWe),t.pixelOffsetScaleByDistance=new Kt(dWe,uWe,mWe,hWe),t.verticalOrigin=new mi(zn.BOTTOM),t.image=e,t}function CCt(){let e=new Kh;return e.translucencyByDistance=new Kt(3e6,1,5e6,0),e.pixelOffset=new k(17,0),e.horizontalOrigin=Ui.LEFT,e.font="16px sans-serif",e.style=Tr.FILL_AND_OUTLINE,e}function TWe(e){let t=new qc;return t.width=4,t.material=new zx,t.material.color=l(e)?e:U.RED,t.material.outlineWidth=2,t.material.outlineColor=U.BLACK,t}var pWe={time:{text:"Time",tag:"time"},comment:{text:"Comment",tag:"cmt"},description:{text:"Description",tag:"desc"},source:{text:"Source",tag:"src"},number:{text:"GPS track/route number",tag:"number"},type:{text:"Type",tag:"type"}},Tw;typeof document<"u"&&(Tw=document.createElement("div"));function Die(e,t){let n,i="",o=Object.keys(pWe),r=o.length;for(n=0;n<r;n++){let u=o[n],m=pWe[u];m.value=iu(e,m.tag,nr.gpx)??"",l(m.value)&&m.value!==""&&(i=`${i}<p>${m.text}: ${m.value}</p>`)}if(!l(i)||i==="")return;i=SCt.link(i),Tw.innerHTML=i;let s=Tw.querySelectorAll("a");for(n=0;n<s.length;n++)s[n].setAttribute("target","_blank");let a=U.WHITE,c=U.BLACK,d='<div class="cesium-infoBox-description-lighter" style="';return d+="overflow:auto;",d+="word-wrap:break-word;",d+=`background-color:${a.toCssColorString()};`,d+=`color:${c.toCssColorString()};`,d+='">',d+=`${Tw.innerHTML}</div>`,Tw.innerHTML="",d}function _We(e,t,n,i){let o=kie(t),r=wie(t,n);r.position=o;let s=l(i.waypointImage)?i.waypointImage:e._pinBuilder.fromMakiIconId("marker",U.RED,WH);r.billboard=xWe(s);let a=iu(t,"name",nr.gpx);r.name=a,r.label=CCt(),r.label.text=a,r.description=Die(t,r),i.clampToGround&&(r.billboard.heightReference=He.CLAMP_TO_GROUND,r.label.heightReference=He.CLAMP_TO_GROUND)}function VCt(e,t,n,i){let o=wie(t,n);o.description=Die(t,o);let r=Uie(t,"rtept",nr.gpx),s=new Array(r.length);for(let a=0;a<r.length;a++)_We(e,r[a],n,i),s[a]=kie(r[a]);o.polyline=TWe(i.routeColor),i.clampToGround&&(o.polyline.clampToGround=!0),o.polyline.positions=s}function ECt(e,t,n,i){let o=wie(t,n);o.description=Die(t,o);let r=Uie(t,"trkseg",nr.gpx),s=[],a=[],c,d=!0,u=new pc;for(let m=0;m<r.length;m++)c=ACt(r[m]),s=s.concat(c.positions),c.times.length>0?(a=a.concat(c.times),u.addSamples(a,s),d=d&&!0):d=!1;if(d){let m=l(i.waypointImage)?i.waypointImage:e._pinBuilder.fromMakiIconId("marker",U.RED,WH);o.billboard=xWe(m),o.position=u,i.clampToGround&&(o.billboard.heightReference=He.CLAMP_TO_GROUND),o.availability=new Vs,o.availability.addInterval(new Cn({start:a[0],stop:a[a.length-1]}))}o.polyline=TWe(i.trackColor),o.polyline.positions=s,i.clampToGround&&(o.polyline.clampToGround=!0)}function ACt(e){let t={positions:[],times:[]},n=Uie(e,"trkpt",nr.gpx),i;for(let o=0;o<n.length;o++){let r=kie(n[o]);t.positions.push(r),i=iu(n[o],"time",nr.gpx),l(i)&&t.times.push(Q.fromIso8601(i))}return t}function GCt(e){let t=pT(e,"metadata",nr.gpx);if(l(t)){let n={name:iu(t,"name",nr.gpx),desc:iu(t,"desc",nr.gpx),author:LCt(t),copyright:vCt(t),link:SWe(t),time:iu(t,"time",nr.gpx),keywords:iu(t,"keywords",nr.gpx),bounds:FCt(t)};if(l(n.name)||l(n.desc)||l(n.author)||l(n.copyright)||l(n.link)||l(n.time)||l(n.keywords)||l(n.bounds))return n}}function LCt(e){let t=pT(e,"author",nr.gpx);if(l(t)){let n={name:iu(t,"name",nr.gpx),email:WCt(t),link:SWe(t)};if(l(n.name)||l(n.email)||l(n.link))return n}}function WCt(e){let t=pT(e,"email",nr.gpx);if(l(t)){let n=iu(t,"id",nr.gpx),i=iu(t,"domain",nr.gpx);return`${n}@${i}`}}function SWe(e){let t=pT(e,"link",nr.gpx);if(l(t)){let n={href:_w(t,"href"),text:iu(t,"text",nr.gpx),mimeType:iu(t,"type",nr.gpx)};if(l(n.href)||l(n.text)||l(n.mimeType))return n}}function vCt(e){let t=pT(e,"copyright",nr.gpx);if(l(t)){let n={author:_w(t,"author"),year:iu(t,"year",nr.gpx),license:iu(t,"license",nr.gpx)};if(l(n.author)||l(n.year)||l(n.license))return n}}function FCt(e){let t=pT(e,"bounds",nr.gpx);if(l(t)){let n={minLat:xw(t,"minlat",nr.gpx),maxLat:xw(t,"maxlat",nr.gpx),minLon:xw(t,"minlon",nr.gpx),maxLon:xw(t,"maxlon",nr.gpx)};if(l(n.minLat)||l(n.maxLat)||l(n.minLon)||l(n.maxLon))return n}}var bWe={wpt:_We,rte:VCt,trk:ECt};function ICt(e,t,n,i){let o=Object.keys(bWe),r=o.length;for(let s=0;s<r;s++){let a=o[s],c=bWe[a],d=t.childNodes,u=d.length;for(let m=0;m<u;m++){let p=d[m];p.localName===a&&nr.gpx.indexOf(p.namespaceURI)!==-1&&c(e,p,n,i)}}}function gWe(e,t,n){let i=e._entityCollection;i.removeAll();let o=t.documentElement,r=_w(o,"version"),s=_w(o,"creator"),a,c=GCt(o);l(c)&&(a=c.name),o.localName==="gpx"?ICt(e,o,i,n):console.log(`GPX - Unsupported node: ${o.localName}`);let d,u=i.computeAvailability(),m=u.start,p=u.stop,b=Q.equals(m,ot.MINIMUM_VALUE),f=Q.equals(p,ot.MAXIMUM_VALUE);if(!b||!f){let _;b&&(_=new Date,_.setHours(0,0,0,0),m=Q.fromDate(_)),f&&(_=new Date,_.setHours(24,0,0,0),p=Q.fromDate(_)),d=new vf,d.startTime=m,d.stopTime=p,d.currentTime=Q.clone(m),d.clockRange=As.LOOP_STOP,d.clockStep=Oo.SYSTEM_CLOCK_MULTIPLIER,d.multiplier=Math.round(Math.min(Math.max(Q.secondsDifference(p,m)/60,1),31556900))}let y=!1;return e._name!==a&&(e._name=a,y=!0),e._creator!==s&&(e._creator=s,y=!0),PCt(e._metadata,c)&&(e._metadata=c,y=!0),e._version!==r&&(e._version=r,y=!0),d!==e._clock&&(y=!0,e._clock=d),y&&e._changed.raiseEvent(e),Es.setLoading(e,!1),e}function PCt(e,t){return!l(e)&&!l(t)?!1:l(e)&&l(t)?e.name!==t.name||e.dec!==t.desc||e.src!==t.src||e.author!==t.author||e.copyright!==t.copyright||e.link!==t.link||e.time!==t.time||e.bounds!==t.bounds:!0}function XCt(e,t,n,i){i=i??B.EMPTY_OBJECT;let o=n;if(typeof n=="string"||n instanceof ve){n=ve.createIfNeeded(n),o=n.fetchBlob();let r=e._resourceCredits,s=n.credits;if(l(s)){let a=s.length;for(let c=0;c<a;c++)r.push(s[c])}}return Promise.resolve(o).then(function(r){return r instanceof Blob?RCt(r).then(function(s){let a,c;try{a=yWe.parseFromString(s,"application/xml")}catch(d){c=d.toString()}if(l(c)||a.body||a.documentElement.tagName==="parsererror"){let d=l(c)?c:a.documentElement.firstChild.nodeValue;throw d||(d=a.body.innerText),new ae(d)}return gWe(e,a,i)}):gWe(e,r,i)}).catch(function(r){return e._error.raiseEvent(e,r),console.log(r),Promise.reject(r)})}function KE(){this._changed=new Se,this._error=new Se,this._loading=new Se,this._clock=void 0,this._entityCollection=new za(this),this._entityCluster=new Bu,this._name=void 0,this._version=void 0,this._creator=void 0,this._metadata=void 0,this._isLoading=!1,this._pinBuilder=new zg}KE.load=function(e,t){return new KE().load(e,t)};Object.defineProperties(KE.prototype,{name:{get:function(){return this._name}},version:{get:function(){return this._version}},creator:{get:function(){return this._creator}},metadata:{get:function(){return this._metadata}},clock:{get:function(){return this._clock}},entities:{get:function(){return this._entityCollection}},isLoading:{get:function(){return this._isLoading}},changedEvent:{get:function(){return this._changed}},errorEvent:{get:function(){return this._error}},loadingEvent:{get:function(){return this._loading}},show:{get:function(){return this._entityCollection.show},set:function(e){this._entityCollection.show=e}},clustering:{get:function(){return this._entityCluster},set:function(e){this._entityCluster=e}}});KE.prototype.update=function(e){return!0};KE.prototype.load=function(e,t){if(!l(e))throw new ge("data is required.");t=t??B.EMPTY_OBJECT,Es.setLoading(this,!0);let n=this._name,i=this;return XCt(this,this._entityCollection,e,t).then(function(){let o,r=i._entityCollection.computeAvailability(),s=r.start,a=r.stop,c=Q.equals(s,ot.MINIMUM_VALUE),d=Q.equals(a,ot.MAXIMUM_VALUE);if(!c||!d){let m;c&&(m=new Date,m.setHours(0,0,0,0),s=Q.fromDate(m)),d&&(m=new Date,m.setHours(24,0,0,0),a=Q.fromDate(m)),o=new vf,o.startTime=s,o.stopTime=a,o.currentTime=Q.clone(s),o.clockRange=As.LOOP_STOP,o.clockStep=Oo.SYSTEM_CLOCK_MULTIPLIER,o.multiplier=Math.round(Math.min(Math.max(Q.secondsDifference(a,s)/60,1),31556900))}let u=!1;return o!==i._clock&&(i._clock=o,u=!0),n!==i._name&&(u=!0),u&&i._changed.raiseEvent(i),Es.setLoading(i,!1),i}).catch(function(o){return Es.setLoading(i,!1),i._error.raiseEvent(i,o),console.log(o),Promise.reject(o)})};var Sw=KE;var g$i=x(T(),1);function NCt(e,t){this.position=e,this.headingPitchRoll=t}var Zw=NCt;var oto=x(T(),1);var Gw=x(gu(),1);var x$i=x(T(),1);function YCt(e,t){this.position=e,this.headingPitchRange=t}var Rw=YCt;var Z$i=x(T(),1);function vH(e,t){this.id=t,this.name=e,this.playlistIndex=0,this.playlist=[],this.tourStart=new Se,this.tourEnd=new Se,this.entryStart=new Se,this.entryEnd=new Se,this._activeEntries=[]}vH.prototype.addPlaylistEntry=function(e){this.playlist.push(e)};vH.prototype.play=function(e,t){this.tourStart.raiseEvent();let n=this;RWe.call(this,e,t,function(i){n.playlistIndex=0,i||ZWe(n._activeEntries),n.tourEnd.raiseEvent(i)})};vH.prototype.stop=function(){ZWe(this._activeEntries)};function ZWe(e){for(let t=e.pop();t!==void 0;t=e.pop())t.stop()}function RWe(e,t,n){let i=this.playlist[this.playlistIndex];if(i){let o=MCt.bind(this,e,t,n);if(this._activeEntries.push(i),this.entryStart.raiseEvent(i),i.blocking)i.play(o,e.scene.camera,t);else{let r=this;i.play(function(){r.entryEnd.raiseEvent(i);let s=r._activeEntries.indexOf(i);s>=0&&r._activeEntries.splice(s,1)}),o(e,t,n)}}else l(n)&&n(!1)}function MCt(e,t,n,i){let o=this.playlist[this.playlistIndex];if(this.entryEnd.raiseEvent(o,i),i)n(i);else{let r=this._activeEntries.indexOf(o);r>=0&&this._activeEntries.splice(r,1),this.playlistIndex++,RWe.call(this,e,t,n)}}var Cw=vH;var w$i=x(T(),1);var I$i=x(T(),1);var W$i=x(T(),1),ao=Object.freeze({Linear:Object.freeze({None:function(e){return e},In:function(e){return e},Out:function(e){return e},InOut:function(e){return e}}),Quadratic:Object.freeze({In:function(e){return e*e},Out:function(e){return e*(2-e)},InOut:function(e){return(e*=2)<1?.5*e*e:-.5*(--e*(e-2)-1)}}),Cubic:Object.freeze({In:function(e){return e*e*e},Out:function(e){return--e*e*e+1},InOut:function(e){return(e*=2)<1?.5*e*e*e:.5*((e-=2)*e*e+2)}}),Quartic:Object.freeze({In:function(e){return e*e*e*e},Out:function(e){return 1- --e*e*e*e},InOut:function(e){return(e*=2)<1?.5*e*e*e*e:-.5*((e-=2)*e*e*e-2)}}),Quintic:Object.freeze({In:function(e){return e*e*e*e*e},Out:function(e){return--e*e*e*e*e+1},InOut:function(e){return(e*=2)<1?.5*e*e*e*e*e:.5*((e-=2)*e*e*e*e+2)}}),Sinusoidal:Object.freeze({In:function(e){return 1-Math.sin((1-e)*Math.PI/2)},Out:function(e){return Math.sin(e*Math.PI/2)},InOut:function(e){return .5*(1-Math.sin(Math.PI*(.5-e)))}}),Exponential:Object.freeze({In:function(e){return e===0?0:Math.pow(1024,e-1)},Out:function(e){return e===1?1:1-Math.pow(2,-10*e)},InOut:function(e){return e===0?0:e===1?1:(e*=2)<1?.5*Math.pow(1024,e-1):.5*(-Math.pow(2,-10*(e-1))+2)}}),Circular:Object.freeze({In:function(e){return 1-Math.sqrt(1-e*e)},Out:function(e){return Math.sqrt(1- --e*e)},InOut:function(e){return(e*=2)<1?-.5*(Math.sqrt(1-e*e)-1):.5*(Math.sqrt(1-(e-=2)*e)+1)}}),Elastic:Object.freeze({In:function(e){return e===0?0:e===1?1:-Math.pow(2,10*(e-1))*Math.sin((e-1.1)*5*Math.PI)},Out:function(e){return e===0?0:e===1?1:Math.pow(2,-10*e)*Math.sin((e-.1)*5*Math.PI)+1},InOut:function(e){return e===0?0:e===1?1:(e*=2,e<1?-.5*Math.pow(2,10*(e-1))*Math.sin((e-1.1)*5*Math.PI):.5*Math.pow(2,-10*(e-1))*Math.sin((e-1.1)*5*Math.PI)+1)}}),Back:Object.freeze({In:function(e){var t=1.70158;return e===1?1:e*e*((t+1)*e-t)},Out:function(e){var t=1.70158;return e===0?0:--e*e*((t+1)*e+t)+1},InOut:function(e){var t=2.5949095;return(e*=2)<1?.5*(e*e*((t+1)*e-t)):.5*((e-=2)*e*((t+1)*e+t)+2)}}),Bounce:Object.freeze({In:function(e){return 1-ao.Bounce.Out(1-e)},Out:function(e){return e<.36363636363636365?7.5625*e*e:e<.7272727272727273?7.5625*(e-=.5454545454545454)*e+.75:e<.9090909090909091?7.5625*(e-=.8181818181818182)*e+.9375:7.5625*(e-=.9545454545454546)*e+.984375},InOut:function(e){return e<.5?ao.Bounce.In(e*2)*.5:ao.Bounce.Out(e*2-1)*.5+.5}}),generatePow:function(e){return e===void 0&&(e=4),e=e<Number.EPSILON?Number.EPSILON:e,e=e>1e4?1e4:e,{In:function(t){return Math.pow(t,e)},Out:function(t){return 1-Math.pow(1-t,e)},InOut:function(t){return t<.5?Math.pow(t*2,e)/2:(1-Math.pow(2-t*2,e))/2+.5}}}}),Vw=function(){return performance.now()},wCt=(function(){function e(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];this._tweens={},this._tweensAddedDuringUpdate={},this.add.apply(this,t)}return e.prototype.getAll=function(){var t=this;return Object.keys(this._tweens).map(function(n){return t._tweens[n]})},e.prototype.removeAll=function(){this._tweens={}},e.prototype.add=function(){for(var t,n=[],i=0;i<arguments.length;i++)n[i]=arguments[i];for(var o=0,r=n;o<r.length;o++){var s=r[o];(t=s._group)===null||t===void 0||t.remove(s),s._group=this,this._tweens[s.getId()]=s,this._tweensAddedDuringUpdate[s.getId()]=s}},e.prototype.remove=function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];for(var i=0,o=t;i<o.length;i++){var r=o[i];r._group=void 0,delete this._tweens[r.getId()],delete this._tweensAddedDuringUpdate[r.getId()]}},e.prototype.allStopped=function(){return this.getAll().every(function(t){return!t.isPlaying()})},e.prototype.update=function(t,n){t===void 0&&(t=Vw()),n===void 0&&(n=!0);var i=Object.keys(this._tweens);if(i.length!==0)for(;i.length>0;){this._tweensAddedDuringUpdate={};for(var o=0;o<i.length;o++){var r=this._tweens[i[o]],s=!n;r&&r.update(t,s)===!1&&!n&&this.remove(r)}i=Object.keys(this._tweensAddedDuringUpdate)}},e})(),JE={Linear:function(e,t){var n=e.length-1,i=n*t,o=Math.floor(i),r=JE.Utils.Linear;return t<0?r(e[0],e[1],i):t>1?r(e[n],e[n-1],n-i):r(e[o],e[o+1>n?n:o+1],i-o)},Bezier:function(e,t){for(var n=0,i=e.length-1,o=Math.pow,r=JE.Utils.Bernstein,s=0;s<=i;s++)n+=o(1-t,i-s)*o(t,s)*e[s]*r(i,s);return n},CatmullRom:function(e,t){var n=e.length-1,i=n*t,o=Math.floor(i),r=JE.Utils.CatmullRom;return e[0]===e[n]?(t<0&&(o=Math.floor(i=n*(1+t))),r(e[(o-1+n)%n],e[o],e[(o+1)%n],e[(o+2)%n],i-o)):t<0?e[0]-(r(e[0],e[0],e[1],e[1],-i)-e[0]):t>1?e[n]-(r(e[n],e[n],e[n-1],e[n-1],i-n)-e[n]):r(e[o?o-1:0],e[o],e[n<o+1?n:o+1],e[n<o+2?n:o+2],i-o)},Utils:{Linear:function(e,t,n){return(t-e)*n+e},Bernstein:function(e,t){var n=JE.Utils.Factorial;return n(e)/n(t)/n(e-t)},Factorial:(function(){var e=[1];return function(t){var n=1;if(e[t])return e[t];for(var i=t;i>1;i--)n*=i;return e[t]=n,n}})(),CatmullRom:function(e,t,n,i,o){var r=(n-e)*.5,s=(i-t)*.5,a=o*o,c=o*a;return(2*t-2*n+r+s)*c+(-3*t+3*n-2*r-s)*a+r*o+t}}},CWe=(function(){function e(){}return e.nextId=function(){return e._nextId++},e._nextId=0,e})(),Oie=new wCt,VWe=(function(){function e(t,n){this._isPaused=!1,this._pauseStart=0,this._valuesStart={},this._valuesEnd={},this._valuesStartRepeat={},this._duration=1e3,this._isDynamic=!1,this._initialRepeat=0,this._repeat=0,this._yoyo=!1,this._isPlaying=!1,this._reversed=!1,this._delayTime=0,this._startTime=0,this._easingFunction=ao.Linear.None,this._interpolationFunction=JE.Linear,this._chainedTweens=[],this._onStartCallbackFired=!1,this._onEveryStartCallbackFired=!1,this._id=CWe.nextId(),this._isChainStopped=!1,this._propertiesAreSetUp=!1,this._goToEnd=!1,this._object=t,typeof n=="object"?(this._group=n,n.add(this)):n===!0&&(this._group=Oie,Oie.add(this))}return e.prototype.getId=function(){return this._id},e.prototype.isPlaying=function(){return this._isPlaying},e.prototype.isPaused=function(){return this._isPaused},e.prototype.getDuration=function(){return this._duration},e.prototype.to=function(t,n){if(n===void 0&&(n=1e3),this._isPlaying)throw new Error("Can not call Tween.to() while Tween is already started or paused. Stop the Tween first.");return this._valuesEnd=t,this._propertiesAreSetUp=!1,this._duration=n<0?0:n,this},e.prototype.duration=function(t){return t===void 0&&(t=1e3),this._duration=t<0?0:t,this},e.prototype.dynamic=function(t){return t===void 0&&(t=!1),this._isDynamic=t,this},e.prototype.start=function(t,n){if(t===void 0&&(t=Vw()),n===void 0&&(n=!1),this._isPlaying)return this;if(this._repeat=this._initialRepeat,this._reversed){this._reversed=!1;for(var i in this._valuesStartRepeat)this._swapEndStartRepeatValues(i),this._valuesStart[i]=this._valuesStartRepeat[i]}if(this._isPlaying=!0,this._isPaused=!1,this._onStartCallbackFired=!1,this._onEveryStartCallbackFired=!1,this._isChainStopped=!1,this._startTime=t,this._startTime+=this._delayTime,!this._propertiesAreSetUp||n){if(this._propertiesAreSetUp=!0,!this._isDynamic){var o={};for(var r in this._valuesEnd)o[r]=this._valuesEnd[r];this._valuesEnd=o}this._setupProperties(this._object,this._valuesStart,this._valuesEnd,this._valuesStartRepeat,n)}return this},e.prototype.startFromCurrentValues=function(t){return this.start(t,!0)},e.prototype._setupProperties=function(t,n,i,o,r){for(var s in i){var a=t[s],c=Array.isArray(a),d=c?"array":typeof a,u=!c&&Array.isArray(i[s]);if(!(d==="undefined"||d==="function")){if(u){var m=i[s];if(m.length===0)continue;for(var p=[a],b=0,f=m.length;b<f;b+=1){var y=this._handleRelativeValue(a,m[b]);if(isNaN(y)){u=!1,console.warn("Found invalid interpolation list. Skipping.");break}p.push(y)}u&&(i[s]=p)}if((d==="object"||c)&&a&&!u){n[s]=c?[]:{};var _=a;for(var S in _)n[s][S]=_[S];o[s]=c?[]:{};var m=i[s];if(!this._isDynamic){var Z={};for(var S in m)Z[S]=m[S];i[s]=m=Z}this._setupProperties(_,n[s],m,o[s],r)}else(typeof n[s]>"u"||r)&&(n[s]=a),c||(n[s]*=1),u?o[s]=i[s].slice().reverse():o[s]=n[s]||0}}},e.prototype.stop=function(){return this._isChainStopped||(this._isChainStopped=!0,this.stopChainedTweens()),this._isPlaying?(this._isPlaying=!1,this._isPaused=!1,this._onStopCallback&&this._onStopCallback(this._object),this):this},e.prototype.end=function(){return this._goToEnd=!0,this.update(this._startTime+this._duration),this},e.prototype.pause=function(t){return t===void 0&&(t=Vw()),this._isPaused||!this._isPlaying?this:(this._isPaused=!0,this._pauseStart=t,this)},e.prototype.resume=function(t){return t===void 0&&(t=Vw()),!this._isPaused||!this._isPlaying?this:(this._isPaused=!1,this._startTime+=t-this._pauseStart,this._pauseStart=0,this)},e.prototype.stopChainedTweens=function(){for(var t=0,n=this._chainedTweens.length;t<n;t++)this._chainedTweens[t].stop();return this},e.prototype.group=function(t){return t?(t.add(this),this):(console.warn("tween.group() without args has been removed, use group.add(tween) instead."),this)},e.prototype.remove=function(){var t;return(t=this._group)===null||t===void 0||t.remove(this),this},e.prototype.delay=function(t){return t===void 0&&(t=0),this._delayTime=t,this},e.prototype.repeat=function(t){return t===void 0&&(t=0),this._initialRepeat=t,this._repeat=t,this},e.prototype.repeatDelay=function(t){return this._repeatDelayTime=t,this},e.prototype.yoyo=function(t){return t===void 0&&(t=!1),this._yoyo=t,this},e.prototype.easing=function(t){return t===void 0&&(t=ao.Linear.None),this._easingFunction=t,this},e.prototype.interpolation=function(t){return t===void 0&&(t=JE.Linear),this._interpolationFunction=t,this},e.prototype.chain=function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];return this._chainedTweens=t,this},e.prototype.onStart=function(t){return this._onStartCallback=t,this},e.prototype.onEveryStart=function(t){return this._onEveryStartCallback=t,this},e.prototype.onUpdate=function(t){return this._onUpdateCallback=t,this},e.prototype.onRepeat=function(t){return this._onRepeatCallback=t,this},e.prototype.onComplete=function(t){return this._onCompleteCallback=t,this},e.prototype.onStop=function(t){return this._onStopCallback=t,this},e.prototype.update=function(t,n){var i=this,o;if(t===void 0&&(t=Vw()),n===void 0&&(n=e.autoStartOnUpdate),this._isPaused)return!0;var r;if(!this._goToEnd&&!this._isPlaying)if(n)this.start(t,!0);else return!1;if(this._goToEnd=!1,t<this._startTime)return!0;this._onStartCallbackFired===!1&&(this._onStartCallback&&this._onStartCallback(this._object),this._onStartCallbackFired=!0),this._onEveryStartCallbackFired===!1&&(this._onEveryStartCallback&&this._onEveryStartCallback(this._object),this._onEveryStartCallbackFired=!0);var s=t-this._startTime,a=this._duration+((o=this._repeatDelayTime)!==null&&o!==void 0?o:this._delayTime),c=this._duration+this._repeat*a,d=function(){if(i._duration===0||s>c)return 1;var y=Math.trunc(s/a),_=s-y*a,S=Math.min(_/i._duration,1);return S===0&&s===i._duration?1:S},u=d(),m=this._easingFunction(u);if(this._updateProperties(this._object,this._valuesStart,this._valuesEnd,m),this._onUpdateCallback&&this._onUpdateCallback(this._object,u),this._duration===0||s>=this._duration)if(this._repeat>0){var p=Math.min(Math.trunc((s-this._duration)/a)+1,this._repeat);isFinite(this._repeat)&&(this._repeat-=p);for(r in this._valuesStartRepeat)!this._yoyo&&typeof this._valuesEnd[r]=="string"&&(this._valuesStartRepeat[r]=this._valuesStartRepeat[r]+parseFloat(this._valuesEnd[r])),this._yoyo&&this._swapEndStartRepeatValues(r),this._valuesStart[r]=this._valuesStartRepeat[r];return this._yoyo&&(this._reversed=!this._reversed),this._startTime+=a*p,this._onRepeatCallback&&this._onRepeatCallback(this._object),this._onEveryStartCallbackFired=!1,!0}else{this._onCompleteCallback&&this._onCompleteCallback(this._object);for(var b=0,f=this._chainedTweens.length;b<f;b++)this._chainedTweens[b].start(this._startTime+this._duration,!1);return this._isPlaying=!1,!1}return!0},e.prototype._updateProperties=function(t,n,i,o){for(var r in i)if(n[r]!==void 0){var s=n[r]||0,a=i[r],c=Array.isArray(t[r]),d=Array.isArray(a),u=!c&&d;u?t[r]=this._interpolationFunction(a,o):typeof a=="object"&&a?this._updateProperties(t[r],s,a,o):(a=this._handleRelativeValue(s,a),typeof a=="number"&&(t[r]=s+(a-s)*o))}},e.prototype._handleRelativeValue=function(t,n){return typeof n!="string"?n:n.charAt(0)==="+"||n.charAt(0)==="-"?t+parseFloat(n):parseFloat(n)},e.prototype._swapEndStartRepeatValues=function(t){var n=this._valuesStartRepeat[t],i=this._valuesEnd[t];typeof i=="string"?this._valuesStartRepeat[t]=this._valuesStartRepeat[t]+parseFloat(i):this._valuesStartRepeat[t]=this._valuesEnd[t],this._valuesEnd[t]=n},e.autoStartOnUpdate=!1,e})();var R$i=CWe.nextId,V0=Oie,C$i=V0.getAll.bind(V0),V$i=V0.removeAll.bind(V0),E$i=V0.add.bind(V0),A$i=V0.remove.bind(V0),G$i=V0.update.bind(V0);var kCt={LINEAR_NONE:ao.Linear.None,QUADRATIC_IN:ao.Quadratic.In,QUADRATIC_OUT:ao.Quadratic.Out,QUADRATIC_IN_OUT:ao.Quadratic.InOut,CUBIC_IN:ao.Cubic.In,CUBIC_OUT:ao.Cubic.Out,CUBIC_IN_OUT:ao.Cubic.InOut,QUARTIC_IN:ao.Quartic.In,QUARTIC_OUT:ao.Quartic.Out,QUARTIC_IN_OUT:ao.Quartic.InOut,QUINTIC_IN:ao.Quintic.In,QUINTIC_OUT:ao.Quintic.Out,QUINTIC_IN_OUT:ao.Quintic.InOut,SINUSOIDAL_IN:ao.Sinusoidal.In,SINUSOIDAL_OUT:ao.Sinusoidal.Out,SINUSOIDAL_IN_OUT:ao.Sinusoidal.InOut,EXPONENTIAL_IN:ao.Exponential.In,EXPONENTIAL_OUT:ao.Exponential.Out,EXPONENTIAL_IN_OUT:ao.Exponential.InOut,CIRCULAR_IN:ao.Circular.In,CIRCULAR_OUT:ao.Circular.Out,CIRCULAR_IN_OUT:ao.Circular.InOut,ELASTIC_IN:ao.Elastic.In,ELASTIC_OUT:ao.Elastic.Out,ELASTIC_IN_OUT:ao.Elastic.InOut,BACK_IN:ao.Back.In,BACK_OUT:ao.Back.Out,BACK_IN_OUT:ao.Back.InOut,BOUNCE_IN:ao.Bounce.In,BOUNCE_OUT:ao.Bounce.Out,BOUNCE_IN_OUT:ao.Bounce.InOut},vs=Object.freeze(kCt);function FH(e,t,n){this.type="KmlTourFlyTo",this.blocking=!0,this.activeCamera=null,this.activeCallback=null,this.duration=e,this.view=n,this.flyToMode=t}FH.prototype.play=function(e,t,n){if(this.activeCamera=t,l(e)&&e!==null){let o=this;this.activeCallback=function(r){delete o.activeCallback,delete o.activeCamera,e(l(r)?!1:r)}}let i=this.getCameraOptions(n);if(this.view.headingPitchRoll)t.flyTo(i);else if(this.view.headingPitchRange){let o=new me(this.view.position);t.flyToBoundingSphere(o,i)}};FH.prototype.stop=function(){l(this.activeCamera)&&this.activeCamera.cancelFlight(),l(this.activeCallback)&&this.activeCallback(!0)};FH.prototype.getCameraOptions=function(e){let t={duration:this.duration};return l(this.activeCallback)&&(t.complete=this.activeCallback),this.flyToMode==="smooth"&&(t.easingFunction=vs.LINEAR_NONE),this.view.headingPitchRoll?(t.destination=this.view.position,t.orientation=this.view.headingPitchRoll):this.view.headingPitchRange&&(t.offset=this.view.headingPitchRange),l(e)&&(t=It(t,e)),t};var Ew=FH;var D$i=x(T(),1);function Bie(e){this.type="KmlTourWait",this.blocking=!0,this.duration=e,this.timeout=null}Bie.prototype.play=function(e){let t=this;this.activeCallback=e,this.timeout=setTimeout(function(){delete t.activeCallback,e(!1)},this.duration*1e3)};Bie.prototype.stop=function(){clearTimeout(this.timeout),l(this.activeCallback)&&this.activeCallback(!0)};var Aw=Bie;var XWe={avi:"video/x-msvideo",bmp:"image/bmp",bz2:"application/x-bzip2",chm:"application/vnd.ms-htmlhelp",css:"text/css",csv:"text/csv",doc:"application/msword",dvi:"application/x-dvi",eps:"application/postscript",flv:"video/x-flv",gif:"image/gif",gz:"application/x-gzip",htm:"text/html",html:"text/html",ico:"image/vnd.microsoft.icon",jnlp:"application/x-java-jnlp-file",jpeg:"image/jpeg",jpg:"image/jpeg",m3u:"audio/x-mpegurl",m4v:"video/mp4",mathml:"application/mathml+xml",mid:"audio/midi",midi:"audio/midi",mov:"video/quicktime",mp3:"audio/mpeg",mp4:"video/mp4",mp4v:"video/mp4",mpeg:"video/mpeg",mpg:"video/mpeg",odp:"application/vnd.oasis.opendocument.presentation",ods:"application/vnd.oasis.opendocument.spreadsheet",odt:"application/vnd.oasis.opendocument.text",ogg:"application/ogg",pdf:"application/pdf",png:"image/png",pps:"application/vnd.ms-powerpoint",ppt:"application/vnd.ms-powerpoint",ps:"application/postscript",qt:"video/quicktime",rdf:"application/rdf+xml",rss:"application/rss+xml",rtf:"application/rtf",svg:"image/svg+xml",swf:"application/x-shockwave-flash",text:"text/plain",tif:"image/tiff",tiff:"image/tiff",txt:"text/plain",wav:"audio/x-wav",wma:"audio/x-ms-wma",wmv:"video/x-ms-wmv",xml:"application/xml",zip:"application/zip",detectFromFilename:function(e){let t=e.toLowerCase();return t=eb(t),XWe[t]}},toe;typeof DOMParser<"u"&&(toe=new DOMParser);var UCt=new LH({stripPrefix:!1,email:!1,replaceFn:function(e){return e.urlMatchType==="scheme"||e.urlMatchType==="www"}}),bT=32,EWe=2414016,AWe=1,GWe=16093e3,LWe=.1,WWe=[null,void 0,"http://www.opengis.net/kml/2.2","http://earth.google.com/kml/2.2","http://earth.google.com/kml/2.1","http://earth.google.com/kml/2.0"],vWe=["http://www.google.com/kml/ext/2.2"],DCt=["http://www.w3.org/2005/Atom"],De={kml:WWe,gx:vWe,atom:DCt,kmlgx:WWe.concat(vWe)},noe={Document:zWe,Folder:cVt,Placemark:lVt,NetworkLink:yVt,GroundOverlay:pVt,PhotoOverlay:JWe,ScreenOverlay:fVt,Tour:uVt},jie=class{constructor(t){this._dataSource=t,this._deferred=Cd(),this._stack=[],this._promises=[],this._timeoutSet=!1,this._used=!1,this._started=0,this._timeThreshold=1e3}get dataSource(){return this._dataSource}addNodes(t,n){this._stack.push({nodes:t,index:0,processingData:n}),this._used=!0}addPromise(t){this._promises.push(t)}wait(){let t=this._deferred;return this._used||t.resolve(),Promise.all([t.promise,Promise.all(this._promises)])}process(){let t=this._stack.length===1;return t&&(this._started=Jg._getTimestamp()),this._process(t)}_giveUpTime(){if(this._timeoutSet)return;this._timeoutSet=!0,this._timeThreshold=50;let t=this;setTimeout(function(){t._timeoutSet=!1,t._started=Jg._getTimestamp(),t._process(!0)},0)}_nextNode(){let t=this._stack,n=t[t.length-1],i=n.index,o=n.nodes;if(i!==o.length)return++n.index,o[i]}_pop(){let t=this._stack;return t.pop(),t.length===0?(this._deferred.resolve(),!1):!0}_process(t){let n=this.dataSource,i=this._stack[this._stack.length-1].processingData,o=this._nextNode();for(;l(o);){let r=noe[o.localName];if(l(r)&&(De.kml.indexOf(o.namespaceURI)!==-1||De.gx.indexOf(o.namespaceURI)!==-1)&&(r(n,o,i,this),this._timeoutSet||Jg._getTimestamp()>this._started+this._timeThreshold)){this._giveUpTime();return}o=this._nextNode()}this._pop()&&t&&this._process(!0)}};function OCt(e){let t=e.slice(0,Math.min(4,e.size)),n=Cd(),i=new FileReader;return i.addEventListener("load",function(){n.resolve(new DataView(i.result).getUint32(0,!1)===1347093252)}),i.addEventListener("error",function(){n.reject(i.error)}),i.readAsArrayBuffer(t),n.promise}function BCt(e){let t=Cd(),n=new FileReader;return n.addEventListener("load",function(){t.resolve(n.result)}),n.addEventListener("error",function(){t.reject(n.error)}),n.readAsText(e),t.promise}function NWe(e){let t={xsi:"http://www.w3.org/2001/XMLSchema-instance"},n,i,o,r;for(let s in t)t.hasOwnProperty(s)&&(o=RegExp(`[< ]${s}:`),r=`xmlns:${s}=`,o.test(e)&&e.indexOf(r)===-1&&(l(n)||(n=e.substr(0,e.indexOf("<kml")+4),i=e.substr(n.length)),n+=` ${r}"${t[s]}"`));return l(n)&&(e=n+i),e}function YWe(e){let t=e.indexOf("xmlns:"),n=e.indexOf(">",t),i,o,r;for(;t!==-1&&t<n;)i=e.slice(t,e.indexOf('"',t)),o=t,t=e.indexOf(i,t+1),t!==-1?(r=e.indexOf('"',e.indexOf('"',t)+1),e=e.slice(0,t-1)+e.slice(r+1,e.length),t=e.indexOf("xmlns:",o-1)):t=e.indexOf("xmlns:",o+1);return e}async function zCt(e,t){let n=await e.getData(new QM);n=NWe(n),n=YWe(n),t.kml=toe.parseFromString(n,"application/xml")}async function zie(e,t){let n=XWe.detectFromFilename(e.filename)??"application/octet-stream",i=await e.getData(new JM(n));t[e.filename]=i}function im(e,t,n,i){let o=i.keys,r=new Gw.default("."),s=e.querySelectorAll(t);for(let a=0;a<s.length;a++){let c=s[a],d=c.getAttribute(n);if(l(d)){let m=new Gw.default(d).absoluteTo(r).toString(),p=o.indexOf(m);if(p!==-1){let b=o[p];c.setAttribute(n,i[b]),t==="a"&&c.getAttribute("download")===null&&c.setAttribute("download",b)}}}}function om(e,t,n,i){let o=e.querySelectorAll(t);for(let r=0;r<o.length;r++){let s=o[r],a=s.getAttribute(n),c=ioe(a,i);l(c)&&s.setAttribute(n,c.url)}}function MWe(e,t,n){let i=Ga(e,"id");i=l(i)&&i.length!==0?i:Qn(),l(n)&&(i=n+i);let o=t.getById(i);return l(o)&&(i=Qn(),l(n)&&(i=n+i)),o=t.add(new er({id:i})),l(o.kml)||(o.addProperty("kml"),o.kml=new eoe),o}function Lw(e,t){return e==="absolute"||e==="relativeToGround"||t==="relativeToSeaFloor"}function NH(e,t){if(!l(e))return h.fromDegrees(0,0,0,t);let n=e.match(/[^\s,\n]+/g);if(!l(n))return h.fromDegrees(0,0,0,t);let i=parseFloat(n[0]),o=parseFloat(n[1]),r=parseFloat(n[2]);return i=isNaN(i)?0:i,o=isNaN(o)?0:o,r=isNaN(r)?0:r,h.fromDegrees(i,o,r,t)}function IH(e,t){if(!l(e))return;let n=e.textContent.match(/[^\s\n]+/g);if(!l(n))return;let i=n.length,o=new Array(i),r=0;for(let s=0;s<i;s++)o[r++]=NH(n[s],t);return o}function gT(e,t){if(!l(e))return;let n=e.getAttribute(t);if(n!==null){let i=parseFloat(n);return isNaN(i)?void 0:i}}function Ga(e,t){if(!l(e))return;let n=e.getAttribute(t);return n!==null?n:void 0}function co(e,t,n){if(!l(e))return;let i=e.childNodes,o=i.length;for(let r=0;r<o;r++){let s=i[r];if(s.localName===t&&n.indexOf(s.namespaceURI)!==-1)return s}}function FWe(e,t,n){if(!l(e))return;let i=[],o=e.getElementsByTagNameNS("*",t),r=o.length;for(let s=0;s<r;s++){let a=o[s];a.localName===t&&n.indexOf(a.namespaceURI)!==-1&&i.push(a)}return i}function Kf(e,t,n){if(!l(e))return[];let i=[],o=e.childNodes,r=o.length;for(let s=0;s<r;s++){let a=o[s];a.localName===t&&n.indexOf(a.namespaceURI)!==-1&&i.push(a)}return i}function Ai(e,t,n){let i=co(e,t,n);if(l(i)){let o=parseFloat(i.textContent);return isNaN(o)?void 0:o}}function Yn(e,t,n){let i=co(e,t,n);if(l(i))return i.textContent.trim()}function Jf(e,t,n){let i=co(e,t,n);if(l(i)){let o=i.textContent.trim();return o==="1"||/^true$/i.test(o)}}function ioe(e,t,n){if(!l(e))return;let i;if(l(n)){e=e.replace(/\\/g,"/");let o=n[e];if(l(o))i=new ve({url:o});else{let r=new Gw.default(t.getUrlComponent()),s=new Gw.default(e);o=n[s.absoluteTo(r)],l(o)&&(i=new ve({url:o}))}}return l(i)||(i=t.getDerivedResource({url:e})),i}var ou={maximumRed:void 0,red:void 0,maximumGreen:void 0,green:void 0,maximumBlue:void 0,blue:void 0};function Qie(e,t){if(!l(e)||/^\s*$/gm.test(e))return;e[0]==="#"&&(e=e.substring(1));let n=parseInt(e.substring(0,2),16)/255,i=parseInt(e.substring(2,4),16)/255,o=parseInt(e.substring(4,6),16)/255,r=parseInt(e.substring(6,8),16)/255;return t?(r>0?(ou.maximumRed=r,ou.red=void 0):(ou.maximumRed=void 0,ou.red=0),o>0?(ou.maximumGreen=o,ou.green=void 0):(ou.maximumGreen=void 0,ou.green=0),i>0?(ou.maximumBlue=i,ou.blue=void 0):(ou.maximumBlue=void 0,ou.blue=0),ou.alpha=n,U.fromRandom(ou)):new U(r,o,i,n)}function UZ(e,t,n){let i=Yn(e,t,n);if(l(i))return Qie(i,Yn(e,"colorMode",n)==="random")}function HCt(e){let t=co(e,"TimeStamp",De.kmlgx),n=Yn(t,"when",De.kmlgx);if(!l(t)||!l(n)||n.length===0)return;let i=Q.fromIso8601(n),o=new Vs;return o.addInterval(new Cn({start:i,stop:ot.MAXIMUM_VALUE})),o}function KCt(e){let t=co(e,"TimeSpan",De.kmlgx);if(!l(t))return;let n,i=co(t,"begin",De.kmlgx),o=l(i)?Q.fromIso8601(i.textContent):void 0,r=co(t,"end",De.kmlgx),s=l(r)?Q.fromIso8601(r.textContent):void 0;if(l(o)&&l(s)){if(Q.lessThan(s,o)){let a=o;o=s,s=a}n=new Vs,n.addInterval(new Cn({start:o,stop:s}))}else l(o)?(n=new Vs,n.addInterval(new Cn({start:o,stop:ot.MAXIMUM_VALUE}))):l(s)&&(n=new Vs,n.addInterval(new Cn({start:ot.MINIMUM_VALUE,stop:s})));return n}function wWe(){let e=new jc;return e.width=bT,e.height=bT,e.scaleByDistance=new Kt(EWe,AWe,GWe,LWe),e.pixelOffsetScaleByDistance=new Kt(EWe,AWe,GWe,LWe),e}function ooe(){let e=new Jh;return e.outline=!0,e.outlineColor=U.WHITE,e}function kWe(){let e=new Kh;return e.translucencyByDistance=new Kt(3e6,1,5e6,0),e.pixelOffset=new k(17,0),e.horizontalOrigin=Ui.LEFT,e.font="16px sans-serif",e.style=Tr.FILL_AND_OUTLINE,e}function roe(e,t,n,i,o){let r=Yn(e,"href",De.kml);if(!l(r)||r.length===0)return;if(r.indexOf("root://icons/palette-")===0){let a=r.charAt(21),c=Ai(e,"x",De.gx)??0,d=Ai(e,"y",De.gx)??0;c=Math.min(c/32,7),d=7-Math.min(d/32,7);let u=8*d+c;r=`https://maps.google.com/mapfiles/kml/pal${a}/icon${u}.png`}let s=ioe(r,n,i);if(o){let a=Yn(e,"refreshMode",De.kml),c=Yn(e,"viewRefreshMode",De.kml);a==="onInterval"||a==="onExpire"?xt(`kml-refreshMode-${a}`,`KML - Unsupported Icon refreshMode: ${a}`):(c==="onStop"||c==="onRegion")&&xt(`kml-refreshMode-${c}`,`KML - Unsupported Icon viewRefreshMode: ${c}`);let d=Yn(e,"viewBoundScale",De.kml)??1,u=c==="onStop"?"BBOX=[bboxWest],[bboxSouth],[bboxEast],[bboxNorth]":"",m=Yn(e,"viewFormat",De.kml)??u,p=Yn(e,"httpQuery",De.kml);l(m)&&s.setQueryParameters(yu(XH(m))),l(p)&&s.setQueryParameters(yu(XH(p)));let b=t._ellipsoid;return aoe(s,t.camera,t.canvas,d,t._lastCameraView.bbox,b),s}return s}function JCt(e,t,n,i,o){let r=Ai(t,"scale",De.kml),s=Ai(t,"heading",De.kml),a=UZ(t,"color",De.kml),c=co(t,"Icon",De.kml),d=roe(c,e,i,o,!1);l(c)&&!l(d)&&(d=!1);let u=Ai(c,"x",De.gx),m=Ai(c,"y",De.gx),p=Ai(c,"w",De.gx),b=Ai(c,"h",De.gx),f=co(t,"hotSpot",De.kml),y=gT(f,"x"),_=gT(f,"y"),S=Ga(f,"xunits"),Z=Ga(f,"yunits"),R=n.billboard;l(R)||(R=wWe(),n.billboard=R),R.image=d,R.scale=r,R.color=a,(l(u)||l(m)||l(p)||l(b))&&(R.imageSubRegion=new nt(u,m,p,b)),l(s)&&s!==0&&(R.rotation=W.toRadians(-s),R.alignedAxis=h.UNIT_Z),r=r??1;let C,E;l(y)&&(S==="pixels"?C=-y*r:S==="insetPixels"?C=(y-bT)*r:S==="fraction"&&(C=-y*bT*r),C+=bT*.5*r),l(_)&&(Z==="pixels"?E=_*r:Z==="insetPixels"?E=(-_+bT)*r:Z==="fraction"&&(E=_*bT*r),E-=bT*.5*r),(l(C)||l(E))&&(R.pixelOffset=new k(C,E))}function PH(e,t,n,i,o){for(let r=0,s=t.childNodes.length;r<s;r++){let a=t.childNodes.item(r);if(a.localName==="IconStyle")JCt(e,a,n,i,o);else if(a.localName==="LabelStyle"){let c=n.label;l(c)||(c=kWe(),n.label=c),c.scale=Ai(a,"scale",De.kml)??c.scale,c.fillColor=UZ(a,"color",De.kml)??c.fillColor,c.text=n.name}else if(a.localName==="LineStyle"){let c=n.polyline;l(c)||(c=new qc,n.polyline=c),c.width=Ai(a,"width",De.kml),c.material=UZ(a,"color",De.kml),l(UZ(a,"outerColor",De.gx))&&xt("kml-gx:outerColor","KML - gx:outerColor is not supported in a LineStyle"),l(Ai(a,"outerWidth",De.gx))&&xt("kml-gx:outerWidth","KML - gx:outerWidth is not supported in a LineStyle"),l(Ai(a,"physicalWidth",De.gx))&&xt("kml-gx:physicalWidth","KML - gx:physicalWidth is not supported in a LineStyle"),l(Jf(a,"labelVisibility",De.gx))&&xt("kml-gx:labelVisibility","KML - gx:labelVisibility is not supported in a LineStyle")}else if(a.localName==="PolyStyle"){let c=n.polygon;l(c)||(c=ooe(),n.polygon=c),c.material=UZ(a,"color",De.kml)??c.material,c.fill=Jf(a,"fill",De.kml)??c.fill,c.outline=Jf(a,"outline",De.kml)??c.outline}else if(a.localName==="BalloonStyle"){let c=Qie(Yn(a,"bgColor",De.kml))??U.WHITE,d=Qie(Yn(a,"textColor",De.kml))??U.BLACK,u=Yn(a,"text",De.kml);n.addProperty("balloonStyle"),n.balloonStyle={bgColor:c,textColor:d,text:u}}else if(a.localName==="ListStyle"){let c=Yn(a,"listItemType",De.kml);(c==="radioFolder"||c==="checkOffOnly")&&xt(`kml-listStyle-${c}`,`KML - Unsupported ListStyle with listItemType: ${c}`)}}}function jCt(e,t,n,i,o){let r=new er,s,a=-1,c=t.childNodes,d=c.length;for(let m=0;m<d;m++){let p=c[m];(p.localName==="Style"||p.localName==="StyleMap")&&(a=m)}if(a!==-1){let m=c[a];if(m.localName==="Style")PH(e,m,r,i,o);else{let p=Kf(m,"Pair",De.kml);for(let b=0;b<p.length;b++){let f=p[b],y=Yn(f,"key",De.kml);if(y==="normal"){let _=Yn(f,"styleUrl",De.kml);if(l(_))s=n.getById(_),l(s)||(s=n.getById(`#${_}`)),l(s)&&r.merge(s);else{let S=co(f,"Style",De.kml);PH(e,S,r,i,o)}}else xt(`kml-styleMap-${y}`,`KML - Unsupported StyleMap key: ${y}`)}}}let u=Yn(t,"styleUrl",De.kml);if(l(u)){let m=u;if(u[0]!=="#"&&u.indexOf("#")!==-1){let p=u.split("#"),b=p[0];m=`${i.getDerivedResource({url:b}).getUrlComponent()}#${p[1]}`}s=n.getById(m),l(s)||(s=n.getById(`#${m}`)),l(s)&&r.merge(s)}return r}function QCt(e,t,n){return t.fetchXML().then(function(i){return UWe(e,i,n,t,!0)})}function UWe(e,t,n,i,o,r){let s,a,c,d,u=FWe(t,"Style",De.kml);if(l(u)){let y=u.length;for(s=0;s<y;s++)d=u[s],a=Ga(d,"id"),l(a)&&(a=`#${a}`,o&&l(i)&&(a=i.getUrlComponent()+a),l(n.getById(a))||(c=new er({id:a}),n.add(c),PH(e,d,c,i,r)))}let m=FWe(t,"StyleMap",De.kml);if(l(m)){let y=m.length;for(s=0;s<y;s++){let _=m[s];if(a=Ga(_,"id"),l(a)){let S=Kf(_,"Pair",De.kml);for(let Z=0;Z<S.length;Z++){let R=S[Z],C=Yn(R,"key",De.kml);if(C==="normal"){if(a=`#${a}`,o&&l(i)&&(a=i.getUrlComponent()+a),!l(n.getById(a))){c=n.getOrCreateEntity(a);let E=Yn(R,"styleUrl",De.kml);if(l(E)){E[0]!=="#"&&(E=`#${E}`),o&&l(i)&&(E=i.getUrlComponent()+E);let A=n.getById(E);l(A)&&c.merge(A)}else d=co(R,"Style",De.kml),PH(e,d,c,i,r)}}else xt(`kml-styleMap-${C}`,`KML - Unsupported StyleMap key: ${C}`)}}}}let p=[],b=t.getElementsByTagName("styleUrl"),f=b.length;for(s=0;s<f;s++){let y=b[s].textContent;if(y[0]!=="#"){let _=y.split("#");if(_.length===2){let S=_[0],Z=i.getDerivedResource({url:S});p.push(QCt(e,Z,n))}}}return p}function soe(e,t,n){let i=new Eg(e,t.id,["position"]),o=new l0(t.position);t.polyline=l(n.polyline)?n.polyline.clone():new qc,t.polyline.positions=new Vg([i,o])}function DWe(e,t){return!l(e)&&!l(t)||e==="clampToGround"?He.CLAMP_TO_GROUND:e==="relativeToGround"?He.RELATIVE_TO_GROUND:e==="absolute"?He.NONE:t==="clampToSeaFloor"?(xt("kml-gx:altitudeMode-clampToSeaFloor","KML - <gx:altitudeMode>:clampToSeaFloor is currently not supported, using <kml:altitudeMode>:clampToGround."),He.CLAMP_TO_GROUND):t==="relativeToSeaFloor"?(xt("kml-gx:altitudeMode-relativeToSeaFloor","KML - <gx:altitudeMode>:relativeToSeaFloor is currently not supported, using <kml:altitudeMode>:relativeToGround."),He.RELATIVE_TO_GROUND):(l(e)?xt("kml-altitudeMode-unknown",`KML - Unknown <kml:altitudeMode>:${e}, using <kml:altitudeMode>:CLAMP_TO_GROUND.`):xt("kml-gx:altitudeMode-unknown",`KML - Unknown <gx:altitudeMode>:${t}, using <kml:altitudeMode>:CLAMP_TO_GROUND.`),He.CLAMP_TO_GROUND)}function qCt(e,t,n){return n==="relativeToSeaFloor"||t==="absolute"||t==="relativeToGround"?e:((l(t)&&t!=="clampToGround"||l(n)&&n!=="clampToSeaFloor")&&xt("kml-altitudeMode-unknown",`KML - Unknown altitudeMode: ${t??n}`),new l0(e))}function $Ct(e,t,n,i){if(!l(e))return;if(n==="relativeToSeaFloor"||t==="absolute"||t==="relativeToGround")return e;(l(t)&&t!=="clampToGround"||l(n)&&n!=="clampToSeaFloor")&&xt("kml-altitudeMode-unknown",`KML - Unknown altitudeMode: ${t??n}`);let o=e.length;for(let r=0;r<o;r++){let s=e[r];i.scaleToGeodeticSurface(s,s)}return e}function YH(e,t,n,i){let o=t.label;l(o)||(o=l(n.label)?n.label.clone():kWe(),t.label=o),o.text=t.name;let r=t.billboard;if(l(r)||(r=l(n.billboard)?n.billboard.clone():wWe(),t.billboard=r),l(r.image)?r.image.getValue()||(r.image=void 0):r.image=e._pinBuilder.fromColor(U.YELLOW,64),l(r.scale)){let s=r.scale.getValue();s!==0?o.pixelOffset=new k(s*16+1,0):(o.pixelOffset=void 0,o.horizontalOrigin=void 0)}l(i)&&e._clampToGround&&(r.heightReference=i,o.heightReference=i)}function OWe(e,t){let n=e.path;l(n)||(n=new Zb,n.leadTime=0,e.path=n);let i=t.polyline;l(i)&&(n.material=i.material,n.width=i.width)}function eVt(e,t,n,i,o){let r=Yn(n,"coordinates",De.kml),s=Yn(n,"altitudeMode",De.kml),a=Yn(n,"altitudeMode",De.gx),c=Jf(n,"extrude",De.kml),d=e._ellipsoid,u=NH(r,d);return i.position=u,YH(e,i,o,DWe(s,a)),c&&Lw(s,a)&&soe(t,i,o),!0}function IWe(e,t,n,i,o){let r=co(n,"coordinates",De.kml),s=Yn(n,"altitudeMode",De.kml),a=Yn(n,"altitudeMode",De.gx),c=Jf(n,"extrude",De.kml),d=Jf(n,"tessellate",De.kml),u=Lw(s,a),m=Ai(n,"drawOrder",De.gx),p=e._ellipsoid,b=IH(r,p),f=o.polyline;if(u&&c){let y=new Rb;i.wall=y,y.positions=b;let _=o.polygon;l(_)&&(y.fill=_.fill,y.material=_.material),y.outline=!0,l(f)?(y.outlineColor=l(f.material)?f.material.color:U.WHITE,y.outlineWidth=f.width):l(_)&&(y.outlineColor=l(_.material)?_.material.color:U.WHITE)}else if(e._clampToGround&&!u&&d){let y=new qc;y.clampToGround=!0,i.polyline=y,y.positions=b,l(f)?(y.material=l(f.material)?f.material.color.getValue(ot.MINIMUM_VALUE):U.WHITE,y.width=f.width??1):(y.material=U.WHITE,y.width=1),y.zIndex=m}else l(m)&&xt("kml-gx:drawOrder","KML - gx:drawOrder is not supported in LineStrings when clampToGround is false"),e._clampToGround&&!d&&xt("kml-line-tesselate","Ignoring clampToGround for KML lines without the tessellate flag."),f=l(f)?f.clone():new qc,i.polyline=f,f.positions=$Ct(b,s,a,p),(!d||u)&&(f.arcType=un.NONE);return!0}function tVt(e,t,n,i,o){let r=co(n,"outerBoundaryIs",De.kml),s=co(r,"LinearRing",De.kml),a=co(s,"coordinates",De.kml),c=e._ellipsoid,d=IH(a,c),u=Jf(n,"extrude",De.kml),m=Yn(n,"altitudeMode",De.kml),p=Yn(n,"altitudeMode",De.gx),b=Lw(m,p),f=l(o.polygon)?o.polygon.clone():ooe(),y=o.polyline;if(l(y)&&(f.outlineColor=l(y.material)?y.material.color:U.WHITE,f.outlineWidth=y.width),i.polygon=f,b?(f.perPositionHeight=!0,f.extrudedHeight=u?0:void 0):e._clampToGround||(f.height=0),l(d)){let _=new Lc(d),S=Kf(n,"innerBoundaryIs",De.kml);for(let Z=0;Z<S.length;Z++){s=Kf(S[Z],"LinearRing",De.kml);for(let R=0;R<s.length;R++)a=co(s[R],"coordinates",De.kml),d=IH(a,c),l(d)&&_.holes.push(new Lc(d))}f.hierarchy=_}return!0}function nVt(e,t,n,i,o){let r=Yn(n,"altitudeMode",De.kml),s=Yn(n,"altitudeMode",De.gx),a=Kf(n,"coord",De.gx),c=Kf(n,"angles",De.gx),d=Kf(n,"when",De.kml),u=Jf(n,"extrude",De.kml),m=Lw(r,s),p=e._ellipsoid;c.length>0&&xt("kml-gx:angles","KML - gx:angles are not supported in gx:Tracks");let b=Math.min(a.length,d.length),f=[],y=[];for(let S=0;S<b;S++){let Z=NH(a[S].textContent,p);f.push(Z),y.push(Q.fromIso8601(d[S].textContent))}let _=new pc;return _.addSamples(y,f),i.position=_,YH(e,i,o,DWe(r,s)),OWe(i,o),i.availability=new Vs,d.length>0&&i.availability.addInterval(new Cn({start:y[0],stop:y[y.length-1]})),m&&u&&soe(t,i,o),!0}function PWe(e,t,n,i,o,r,s,a,c){let d=e[0],u=e[e.length-1],m=new pc;m.addSamples(e,t),n.intervals.addInterval(new Cn({start:d,stop:u,isStartIncluded:c,isStopIncluded:c,data:qCt(m,s,a)})),i.addInterval(new Cn({start:d,stop:u,isStartIncluded:c,isStopIncluded:c})),o.intervals.addInterval(new Cn({start:d,stop:u,isStartIncluded:c,isStopIncluded:c,data:r}))}function iVt(e,t,n,i,o){let r=Jf(n,"interpolate",De.gx),s=Kf(n,"Track",De.gx),a,c,d,u=!1,m=new Gg,p=new Vs,b=new hc,f=e._ellipsoid;for(let y=0,_=s.length;y<_;y++){let S=s[y],Z=Kf(S,"when",De.kml),R=Kf(S,"coord",De.gx),C=Yn(S,"altitudeMode",De.kml),E=Yn(S,"altitudeMode",De.gx),A=Lw(C,E),L=Jf(S,"extrude",De.kml),F=Math.min(R.length,Z.length),I=[];a=[];for(let N=0;N<F;N++){let g=NH(R[N].textContent,f);I.push(g),a.push(Q.fromIso8601(Z[N].textContent))}r&&(l(c)&&PWe([c,a[0]],[d,I[0]],b,p,m,!1,"absolute",void 0,!1),c=a[F-1],d=I[I.length-1]),PWe(a,I,b,p,m,A&&L,C,E,!0),u=u||A&&L}return i.availability=p,i.position=b,YH(e,i,o),OWe(i,o),u&&(soe(t,i,o),i.polyline.show=m),!0}var BWe={Point:eVt,LineString:IWe,LinearRing:IWe,Polygon:tVt,Track:nVt,MultiTrack:iVt,MultiGeometry:oVt,Model:rVt};function oVt(e,t,n,i,o,r){let s=n.childNodes,a=!1;for(let c=0,d=s.length;c<d;c++){let u=s.item(c),m=BWe[u.localName];if(l(m)){let p=MWe(u,t,r);p.parent=i,p.name=i.name,p.availability=i.availability,p.description=i.description,p.kml=i.kml,m(e,t,u,p,o)&&(a=!0)}}return a}function rVt(e,t,n,i,o){return xt("kml-unsupportedGeometry",`KML - Unsupported geometry: ${n.localName}`),!1}function sVt(e,t){let n=co(e,"ExtendedData",De.kml);if(!l(n))return;l(co(n,"SchemaData",De.kml))&&xt("kml-schemaData","KML - SchemaData is unsupported"),l(Ga(n,"xmlns:prefix"))&&xt("kml-extendedData","KML - ExtendedData with xmlns:prefix is unsupported");let i={},o=Kf(n,"Data",De.kml);if(l(o)){let r=o.length;for(let s=0;s<r;s++){let a=o[s],c=Ga(a,"name");l(c)&&(i[c]={displayName:Yn(a,"displayName",De.kml),value:Yn(a,"value",De.kml)})}}t.kml.extendedData=i}var Bo;typeof document<"u"&&(Bo=document.createElement("div"));function aVt(e,t,n,i,o){let r,s,a,c=t.kml,d=c.extendedData,u=Yn(e,"description",De.kml),m=t.balloonStyle??n.balloonStyle,p=U.WHITE,b=U.BLACK,f=u;l(m)&&(p=m.bgColor??U.WHITE,b=m.textColor??U.BLACK,f=m.text??u);let y;if(l(f)){if(f=f.replace("$[name]",t.name??""),f=f.replace("$[description]",u??""),f=f.replace("$[address]",c.address??""),f=f.replace("$[Snippet]",c.snippet??""),f=f.replace("$[id]",t.id),f=f.replace("$[geDirections]",""),l(d)){let Z=f.match(/\$\[.+?\]/g);if(Z!==null)for(r=0;r<Z.length;r++){let R=Z[r],C=R.substr(2,R.length-3),E=/\/displayName$/.test(C);C=C.replace(/\/displayName$/,""),y=d[C],l(y)&&(y=E?y.displayName:y.value),l(y)&&(f=f.replace(R,y??""))}}}else if(l(d)&&(a=Object.keys(d),a.length>0)){for(f='<table class="cesium-infoBox-defaultTable cesium-infoBox-defaultTable-lighter"><tbody>',r=0;r<a.length;r++)s=a[r],y=d[s],f+=`<tr><th>${y.displayName??s}</th><td>${y.value??""}</td></tr>`;f+="</tbody></table>"}if(!l(f))return;f=UCt.link(f),Bo.innerHTML=f;let _=Bo.querySelectorAll("a");for(r=0;r<_.length;r++)_[r].setAttribute("target","_blank");l(i)&&i.keys.length>1&&(im(Bo,"a","href",i),im(Bo,"link","href",i),im(Bo,"area","href",i),im(Bo,"img","src",i),im(Bo,"iframe","src",i),im(Bo,"video","src",i),im(Bo,"audio","src",i),im(Bo,"source","src",i),im(Bo,"track","src",i),im(Bo,"input","src",i),im(Bo,"embed","src",i),im(Bo,"script","src",i),im(Bo,"video","poster",i)),om(Bo,"a","href",o),om(Bo,"link","href",o),om(Bo,"area","href",o),om(Bo,"img","src",o),om(Bo,"iframe","src",o),om(Bo,"video","src",o),om(Bo,"audio","src",o),om(Bo,"source","src",o),om(Bo,"track","src",o),om(Bo,"input","src",o),om(Bo,"embed","src",o),om(Bo,"script","src",o),om(Bo,"video","poster",o);let S='<div class="cesium-infoBox-description-lighter" style="';S+="overflow:auto;",S+="word-wrap:break-word;",S+=`background-color:${p.toCssColorString()};`,S+=`color:${b.toCssColorString()};`,S+='">',S+=`${Bo.innerHTML}</div>`,Bo.innerHTML="",t.description=S}function MH(e,t,n){let i=n.entityCollection,o=n.parentEntity,r=n.sourceResource,s=n.uriResolver,a=MWe(t,i,n.context),c=a.kml,d=jCt(e,t,n.styleCollection,r,s),u=Yn(t,"name",De.kml);a.name=u,a.parent=o;let m=KCt(t);l(m)||(m=HCt(t)),a.availability=m,coe(a);function p(R){return R?R.show&&p(R.parent):!0}let b=Jf(t,"visibility",De.kml);a.show=p(o)&&(b??!0);let f=co(t,"author",De.atom),y=c.author;y.name=Yn(f,"name",De.atom),y.uri=Yn(f,"uri",De.atom),y.email=Yn(f,"email",De.atom);let _=co(t,"link",De.atom),S=c.link;S.href=Ga(_,"href"),S.hreflang=Ga(_,"hreflang"),S.rel=Ga(_,"rel"),S.type=Ga(_,"type"),S.title=Ga(_,"title"),S.length=Ga(_,"length"),c.address=Yn(t,"address",De.kml),c.phoneNumber=Yn(t,"phoneNumber",De.kml),c.snippet=Yn(t,"Snippet",De.kml),sVt(t,a),aVt(t,a,d,s,r);let Z=e._ellipsoid;return KWe(t,a,Z),HWe(t,a,Z),l(co(t,"Region",De.kml))&&xt("kml-region","KML - Placemark Regions are unsupported"),{entity:a,styleEntity:d}}function zWe(e,t,n,i){i.addNodes(t.childNodes,n),i.process()}function cVt(e,t,n,i){let o=MH(e,t,n),r=$e(n);r.parentEntity=o.entity,zWe(e,t,r,i)}function lVt(e,t,n,i){let o=MH(e,t,n),r=o.entity,s=o.styleEntity,a=!1,c=t.childNodes;for(let d=0,u=c.length;d<u&&!a;d++){let m=c.item(d),p=BWe[m.localName];l(p)&&(p(e,n.entityCollection,m,r,s,r.id),a=!0)}a||(r.merge(s),YH(e,r,s))}var dVt={FlyTo:hVt,Wait:mVt,SoundCue:Hie,AnimatedUpdate:Hie,TourControl:Hie};function uVt(e,t,n,i){let o=Yn(t,"name",De.kml),r=Ga(t,"id"),s=new Cw(o,r),a=co(t,"Playlist",De.gx);if(a){let c=e._ellipsoid,d=a.childNodes;for(let u=0;u<d.length;u++){let m=d[u];if(m.localName){let p=dVt[m.localName];p?p(s,m,c):console.log(`Unknown KML Tour playlist entry type ${m.localName}`)}}}e._kmlTours.push(s)}function Hie(e,t){xt(`KML Tour unsupported node ${t.localName}`)}function mVt(e,t){let n=Ai(t,"duration",De.gx);e.addPlaylistEntry(new Aw(n))}function hVt(e,t,n){let i=Ai(t,"duration",De.gx),o=Yn(t,"flyToMode",De.gx),r={kml:{}};KWe(t,r,n),HWe(t,r,n);let s=r.kml.lookAt||r.kml.camera,a=new Ew(i,o,s);e.addPlaylistEntry(a)}function HWe(e,t,n){let i=co(e,"Camera",De.kml);if(l(i)){let o=Ai(i,"longitude",De.kml)??0,r=Ai(i,"latitude",De.kml)??0,s=Ai(i,"altitude",De.kml)??0,a=Ai(i,"heading",De.kml)??0,c=Ai(i,"tilt",De.kml)??0,d=Ai(i,"roll",De.kml)??0,u=h.fromDegrees(o,r,s,n),m=Cc.fromDegrees(a,c-90,d);t.kml.camera=new Zw(u,m)}}function KWe(e,t,n){let i=co(e,"LookAt",De.kml);if(l(i)){let o=Ai(i,"longitude",De.kml)??0,r=Ai(i,"latitude",De.kml)??0,s=Ai(i,"altitude",De.kml)??0,a=Ai(i,"heading",De.kml),c=Ai(i,"tilt",De.kml),d=Ai(i,"range",De.kml)??0;c=W.toRadians(c??0),a=W.toRadians(a??0);let u=new uh(a,c-W.PI_OVER_TWO,d),m=h.fromDegrees(o,r,s,n);t.kml.lookAt=new Rw(m,u)}}function fVt(e,t,n,i){let o=n.screenOverlayContainer;if(!l(o))return;let r=n.sourceResource,s=n.uriResolver,a=co(t,"Icon",De.kml),c=roe(a,e,r,s,!1);if(!l(c))return;let d=document.createElement("img");e._screenOverlays.push(d),d.src=c.url,d.onload=function(){let u=["position: absolute"],m=co(t,"screenXY",De.kml),p=co(t,"overlayXY",De.kml),b=co(t,"size",De.kml),f,y,_,S,Z,R;l(b)&&(f=gT(b,"x"),y=gT(b,"y"),_=Ga(b,"xunits"),S=Ga(b,"yunits"),l(f)&&f!==-1&&f!==0&&(_==="fraction"?Z=`width: ${Math.floor(f*100)}%`:_==="pixels"&&(Z=`width: ${f}px`),u.push(Z)),l(y)&&y!==-1&&y!==0&&(S==="fraction"?R=`height: ${Math.floor(y*100)}%`:S==="pixels"&&(R=`height: ${y}px`),u.push(R))),d.style=u.join(";");let C=0,E=d.height;l(p)&&(f=gT(p,"x"),y=gT(p,"y"),_=Ga(p,"xunits"),S=Ga(p,"yunits"),l(f)&&(_==="fraction"?C=f*d.width:(_==="pixels"||_==="insetPixels")&&(C=f)),l(y)&&(S==="fraction"?E=y*d.height:(S==="pixels"||S==="insetPixels")&&(E=y))),l(m)&&(f=gT(m,"x"),y=gT(m,"y"),_=Ga(m,"xunits"),S=Ga(m,"yunits"),l(f)&&(_==="fraction"?Z=`left: calc(${Math.floor(f*100)}% - ${C}px)`:_==="pixels"?Z=`left: ${f-C}px`:_==="insetPixels"&&(Z=`right: ${f-C}px`),u.push(Z)),l(y)&&(S==="fraction"?R=`bottom: calc(${Math.floor(y*100)}% - ${E}px)`:S==="pixels"?R=`bottom: ${y-E}px`:S==="insetPixels"&&(R=`top: ${y-E}px`),u.push(R))),d.style=u.join(";")},o.appendChild(d)}function pVt(e,t,n,i){let r=MH(e,t,n).entity,s,a=!1,c=e._ellipsoid,d=IH(co(t,"LatLonQuad",De.gx),c),u=Ai(t,"drawOrder",De.kml);if(l(d))s=ooe(),s.hierarchy=new Lc(d),s.zIndex=u,r.polygon=s,a=!0;else{s=new jh,s.zIndex=u,r.rectangle=s;let f=co(t,"LatLonBox",De.kml);if(l(f)){let y=Ai(f,"west",De.kml),_=Ai(f,"south",De.kml),S=Ai(f,"east",De.kml),Z=Ai(f,"north",De.kml);l(y)&&(y=W.negativePiToPi(W.toRadians(y))),l(_)&&(_=W.clampToLatitudeRange(W.toRadians(_))),l(S)&&(S=W.negativePiToPi(W.toRadians(S))),l(Z)&&(Z=W.clampToLatitudeRange(W.toRadians(Z))),s.coordinates=new re(y,_,S,Z);let R=Ai(f,"rotation",De.kml);if(l(R)){let C=W.toRadians(R);s.rotation=C,s.stRotation=C}}}let m=co(t,"Icon",De.kml),p=roe(m,e,n.sourceResource,n.uriResolver,!0);if(l(p)){a&&xt("kml-gx:LatLonQuad","KML - gx:LatLonQuad Icon does not support texture projection.");let f=Ai(m,"x",De.gx),y=Ai(m,"y",De.gx),_=Ai(m,"w",De.gx),S=Ai(m,"h",De.gx);(l(f)||l(y)||l(_)||l(S))&&xt("kml-groundOverlay-xywh","KML - gx:x, gx:y, gx:w, gx:h aren't supported for GroundOverlays"),s.material=p,s.material.color=UZ(t,"color",De.kml),s.material.transparent=!0}else s.material=UZ(t,"color",De.kml);let b=Yn(t,"altitudeMode",De.kml);l(b)?b==="absolute"?(s.height=Ai(t,"altitude",De.kml),s.zIndex=void 0):b!=="clampToGround"&&xt("kml-altitudeMode-unknown",`KML - Unknown altitudeMode: ${b}`):(b=Yn(t,"altitudeMode",De.gx),b==="relativeToSeaFloor"?(xt("kml-altitudeMode-relativeToSeaFloor","KML - altitudeMode relativeToSeaFloor is currently not supported, treating as absolute."),s.height=Ai(t,"altitude",De.kml),s.zIndex=void 0):b==="clampToSeaFloor"?xt("kml-altitudeMode-clampToSeaFloor","KML - altitudeMode clampToSeaFloor is currently not supported, treating as clampToGround."):l(b)&&xt("kml-altitudeMode-unknown",`KML - Unknown altitudeMode: ${b}`))}function JWe(e,t,n,i){e._unsupportedNode.raiseEvent(e,n.parentEntity,t,n.entityCollection,n.styleCollection,n.sourceResource,n.uriResolver),xt(`kml-unsupportedFeature-${t.nodeName}`,`KML - Unsupported feature: ${t.nodeName}`)}var yT={INTERVAL:0,EXPIRE:1,STOP:2};function XH(e){if(!l(e)||e.length===0)return"";let t=e[0];return(t==="&"||t==="?")&&(e=e.substring(1)),e}var bVt=new re,jE=new pe,Kie=new k,gVt=new h;function aoe(e,t,n,i,o,r){function s(d){return d<-W.PI_OVER_TWO?-W.PI_OVER_TWO:d>W.PI_OVER_TWO?W.PI_OVER_TWO:d}function a(d){return d>W.PI?d-W.TWO_PI:d<-W.PI?d+W.TWO_PI:d}let c=e_(e.queryParameters);if(c=c.replace(/%5B/g,"[").replace(/%5D/g,"]"),l(t)&&t._mode!==se.MORPHING){let d,u;if(o=o??bVt,l(n)&&(Kie.x=n.clientWidth*.5,Kie.y=n.clientHeight*.5,d=t.pickEllipsoid(Kie,r,gVt)),l(d)?u=r.cartesianToCartographic(d,jE):(u=re.center(o,jE),d=r.cartographicToCartesian(u)),l(i)&&!W.equalsEpsilon(i,1,W.EPSILON9)){let S=o.width*i*.5,Z=o.height*i*.5;o=new re(a(u.longitude-S),s(u.latitude-Z),a(u.longitude+S),s(u.latitude+Z))}c=c.replace("[bboxWest]",W.toDegrees(o.west).toString()),c=c.replace("[bboxSouth]",W.toDegrees(o.south).toString()),c=c.replace("[bboxEast]",W.toDegrees(o.east).toString()),c=c.replace("[bboxNorth]",W.toDegrees(o.north).toString());let m=W.toDegrees(u.longitude).toString(),p=W.toDegrees(u.latitude).toString();c=c.replace("[lookatLon]",m),c=c.replace("[lookatLat]",p),c=c.replace("[lookatTilt]",W.toDegrees(t.pitch).toString()),c=c.replace("[lookatHeading]",W.toDegrees(t.heading).toString()),c=c.replace("[lookatRange]",h.distance(t.positionWC,d)),c=c.replace("[lookatTerrainLon]",m),c=c.replace("[lookatTerrainLat]",p),c=c.replace("[lookatTerrainAlt]",u.height.toString()),r.cartesianToCartographic(t.positionWC,jE),c=c.replace("[cameraLon]",W.toDegrees(jE.longitude).toString()),c=c.replace("[cameraLat]",W.toDegrees(jE.latitude).toString()),c=c.replace("[cameraAlt]",W.toDegrees(jE.height).toString());let b=t.frustum,f=b.aspectRatio,y="",_="";if(l(f)){let S=W.toDegrees(b.fov);f>1?(y=S,_=S/f):(_=S,y=S*f)}c=c.replace("[horizFov]",y.toString()),c=c.replace("[vertFov]",_.toString())}else c=c.replace("[bboxWest]","-180"),c=c.replace("[bboxSouth]","-90"),c=c.replace("[bboxEast]","180"),c=c.replace("[bboxNorth]","90"),c=c.replace("[lookatLon]",""),c=c.replace("[lookatLat]",""),c=c.replace("[lookatRange]",""),c=c.replace("[lookatTilt]",""),c=c.replace("[lookatHeading]",""),c=c.replace("[lookatTerrainLon]",""),c=c.replace("[lookatTerrainLat]",""),c=c.replace("[lookatTerrainAlt]",""),c=c.replace("[cameraLon]",""),c=c.replace("[cameraLat]",""),c=c.replace("[cameraAlt]",""),c=c.replace("[horizFov]",""),c=c.replace("[vertFov]","");l(n)?(c=c.replace("[horizPixels]",n.clientWidth),c=c.replace("[vertPixels]",n.clientHeight)):(c=c.replace("[horizPixels]",""),c=c.replace("[vertPixels]","")),c=c.replace("[terrainEnabled]","1"),c=c.replace("[clientVersion]","1"),c=c.replace("[kmlVersion]","2.2"),c=c.replace("[clientName]","Cesium"),c=c.replace("[language]","English"),e.setQueryParameters(yu(c))}function yVt(e,t,n,i){let r=MH(e,t,n).entity,s=n.sourceResource,a=n.uriResolver,c=co(t,"Link",De.kml);if(l(c)||(c=co(t,"Url",De.kml)),l(c)){let d=Yn(c,"href",De.kml),u,m;if(l(d)){let p=d;if(d=ioe(d,s,n.uriResolver),/^data:/.test(d.getUrlComponent()))/\.kmz/i.test(s.getUrlComponent())||(p=s.getDerivedResource({url:p}));else{if(p=d.clone(),u=Yn(c,"viewRefreshMode",De.kml),u==="onRegion"){xt("kml-refrehMode-onRegion","KML - Unsupported viewRefreshMode: onRegion");return}m=Yn(c,"viewBoundScale",De.kml)??1;let _=u==="onStop"?"BBOX=[bboxWest],[bboxSouth],[bboxEast],[bboxNorth]":"",S=Yn(c,"viewFormat",De.kml)??_,Z=Yn(c,"httpQuery",De.kml);l(S)&&d.setQueryParameters(yu(XH(S))),l(Z)&&d.setQueryParameters(yu(XH(Z)));let R=e._ellipsoid;aoe(d,e.camera,e.canvas,m,e._lastCameraView.bbox,R)}let b={sourceUri:p,uriResolver:a,context:r.id,screenOverlayContainer:n.screenOverlayContainer},f=new za,y=$ie(e,f,d,b).then(function(_){let S=e._entityCollection,Z=f.values;S.suspendEvents();for(let E=0;E<Z.length;E++){let A=Z[E];l(A.parent)||(A.parent=r,coe(A)),S.add(A)}S.resumeEvents();let R=Yn(c,"refreshMode",De.kml),C=Ai(c,"refreshInterval",De.kml)??0;if(R==="onInterval"&&C>0||R==="onExpire"||u==="onStop"){let E=co(_,"NetworkLinkControl",De.kml),A=l(E),L=Q.now(),F={id:Qn(),href:d,cookie:{},lastUpdated:L,updating:!1,entity:r,viewBoundScale:m,needsUpdate:!1,cameraUpdateTime:L},I=0;if(A&&(F.cookie=yu(Yn(E,"cookie",De.kml)??""),I=Ai(E,"minRefreshPeriod",De.kml)??0),R==="onInterval")A&&(C=Math.max(I,C)),F.refreshMode=yT.INTERVAL,F.time=C;else if(R==="onExpire"){let N;if(A&&(N=Yn(E,"expires",De.kml)),l(N))try{let g=Q.fromIso8601(N),V=Q.secondsDifference(g,L);V>0&&V<I&&Q.addSeconds(L,I,g),F.refreshMode=yT.EXPIRE,F.time=g}catch{xt("kml-refreshMode-onInterval-onExpire","KML - NetworkLinkControl expires is not a valid date")}else xt("kml-refreshMode-onExpire","KML - refreshMode of onExpire requires the NetworkLinkControl to have an expires element")}else l(e.camera)?(F.refreshMode=yT.STOP,F.time=Ai(c,"viewRefreshTime",De.kml)??0):xt("kml-refrehMode-onStop-noCamera","A NetworkLink with viewRefreshMode=onStop requires the `camera` property to be defined.");l(F.refreshMode)&&e._networkLinks.set(F.id,F)}}).catch(function(_){xt(`An error occured during loading ${d.url}`),e._error.raiseEvent(e,_)});i.addPromise(y)}}}function xVt(e,t,n,i){let o=noe[t.localName];return l(o)?o(e,t,n,i):JWe(e,t,n,i)}function qie(e,t,n,i,o,r,s){t.removeAll();let a=n.documentElement,c=a.localName==="Document"?a:co(a,"Document",De.kml),d=Yn(c,"name",De.kml);l(d)||(d=Rg(i.getUrlComponent())),l(e._name)||(e._name=d);let u=new Jg._DeferredLoading(e),m=new za(e);return Promise.all(UWe(e,n,m,i,!1,o)).then(function(){let p=n.documentElement;if(p.localName==="kml"){let f=p.childNodes;for(let y=0;y<f.length;y++){let _=f[y];if(l(noe[_.localName])){p=_;break}}}let b={parentEntity:void 0,entityCollection:t,styleCollection:m,sourceResource:i,uriResolver:o,context:s,screenOverlayContainer:r};return t.suspendEvents(),xVt(e,p,b,u),t.resumeEvents(),u.wait().then(function(){return n.documentElement})})}async function TVt(e,t,n,i,o){let r=en("ThirdParty/Workers/zip-web-worker.js"),s=en("ThirdParty/zip-module.wasm");IM({workerURI:r,wasmURI:s});let a=new FZ(new eu(n)),c=await a.getEntries(),d=[],u={},m;for(let p=0;p<c.length;p++){let b=c[p];b.directory||(/\.kml$/i.test(b.filename)&&(!l(m)||!/\//i.test(b.filename))?(l(m)&&d.push(zie(m,u)),m=b):d.push(zie(b,u)))}if(l(m)&&d.push(zCt(m,u)),await Promise.all(d),a.close(),!l(u.kml))throw new ae("KMZ file does not contain a KML document.");return u.keys=Object.keys(u),qie(e,t,u.kml,i,u,o)}function $ie(e,t,n,i){i=i??B.EMPTY_OBJECT;let o=i.sourceUri,r=i.uriResolver,s=i.context,a=i.screenOverlayContainer,c=n;if(typeof n=="string"||n instanceof ve){n=ve.createIfNeeded(n),c=n.fetchBlob(),o=o??n.clone();let d=e._resourceCredits,u=n.credits;if(l(u)){let m=u.length;for(let p=0;p<m;p++)d.push(u[p])}}else o=o??ve.DEFAULT.clone();return o=ve.createIfNeeded(o),l(a)&&(a=Nn(a)),Promise.resolve(c).then(function(d){return d instanceof Blob?OCt(d).then(function(u){return u?TVt(e,t,d,o,a):BCt(d).then(function(m){m=NWe(m),m=YWe(m);let p,b;try{p=toe.parseFromString(m,"application/xml")}catch(f){b=f.toString()}if(l(b)||p.body||p.documentElement.tagName==="parsererror"){let f=l(b)?b:p.documentElement.firstChild.nodeValue;throw f||(f=p.body.innerText),new ae(f)}return qie(e,t,p,o,r,a,s)})}):qie(e,t,d,o,r,a,s)}).catch(function(d){return e._error.raiseEvent(e,d),console.log(d),Promise.reject(d)})}var Jg=class e{constructor(t){t=t??B.EMPTY_OBJECT;let n=t.camera,i=t.canvas;this._changed=new Se,this._error=new Se,this._loading=new Se,this._refresh=new Se,this._unsupportedNode=new Se,this._clock=void 0,this._entityCollection=new za(this),this._name=void 0,this._isLoading=!1,this._pinBuilder=new zg,this._networkLinks=new kt,this._entityCluster=new Bu,this.canvas=i,this.camera=n,this._lastCameraView={position:l(n)?h.clone(n.positionWC):void 0,direction:l(n)?h.clone(n.directionWC):void 0,up:l(n)?h.clone(n.upWC):void 0,bbox:l(n)?n.computeViewRectangle():re.clone(re.MAX_VALUE)},this._ellipsoid=t.ellipsoid??ne.default;let o=t.credit;typeof o=="string"&&(o=new Lt(o)),this._credit=o,this._resourceCredits=[],this._kmlTours=[],this._screenOverlays=[]}static load(t,n){return n=n??B.EMPTY_OBJECT,new e(n).load(t,n)}get name(){return this._name}set name(t){this._name!==t&&(this._name=t,this._changed.raiseEvent(this))}get clock(){return this._clock}get entities(){return this._entityCollection}get isLoading(){return this._isLoading}get changedEvent(){return this._changed}get errorEvent(){return this._error}get loadingEvent(){return this._loading}get refreshEvent(){return this._refresh}get unsupportedNodeEvent(){return this._unsupportedNode}get show(){return this._entityCollection.show}set show(t){this._entityCollection.show=t}get clustering(){return this._entityCluster}set clustering(t){this._entityCluster=t}get credit(){return this._credit}get kmlTours(){return this._kmlTours}load(t,n){n=n??B.EMPTY_OBJECT,Es.setLoading(this,!0);let i=this._name;this._name=void 0,this._clampToGround=n.clampToGround??!1;let o=this;return $ie(this,this._entityCollection,t,n).then(function(){let r,s=o._entityCollection.computeAvailability(),a=s.start,c=s.stop,d=Q.equals(a,ot.MINIMUM_VALUE),u=Q.equals(c,ot.MAXIMUM_VALUE);if(!d||!u){let p;d&&(p=new Date,p.setHours(0,0,0,0),a=Q.fromDate(p)),u&&(p=new Date,p.setHours(24,0,0,0),c=Q.fromDate(p)),r=new vf,r.startTime=a,r.stopTime=c,r.currentTime=Q.clone(a),r.clockRange=As.LOOP_STOP,r.clockStep=Oo.SYSTEM_CLOCK_MULTIPLIER,r.multiplier=Math.round(Math.min(Math.max(Q.secondsDifference(c,a)/60,1),31556900))}let m=!1;return r!==o._clock&&(o._clock=r,m=!0),i!==o._name&&(m=!0),m&&o._changed.raiseEvent(o),Es.setLoading(o,!1),o}).catch(function(r){return Es.setLoading(o,!1),o._error.raiseEvent(o,r),console.log(r),Promise.reject(r)})}destroy(){for(;this._screenOverlays.length>0;)this._screenOverlays.pop().remove()}update(t){let n=this._networkLinks;if(n.length===0)return!0;let i=Q.now(),o=this;Jie.removeAll();function r(m){let p=m._children,b=p.length;for(let f=0;f<b;++f){let y=p[f];Jie.set(y.id,y),r(y)}}let s=!1,a=this._lastCameraView,c=this.camera;l(c)&&!(c.positionWC.equalsEpsilon(a.position,W.EPSILON7)&&c.directionWC.equalsEpsilon(a.direction,W.EPSILON7)&&c.upWC.equalsEpsilon(a.up,W.EPSILON7))&&(a.position=h.clone(c.positionWC),a.direction=h.clone(c.directionWC),a.up=h.clone(c.upWC),a.bbox=c.computeViewRectangle(),s=!0);let d=new kt,u=!1;return n.values.forEach(function(m){let p=m.entity;if(!Jie.contains(p.id)){if(!m.updating){let b=!1;if(m.refreshMode===yT.INTERVAL?Q.secondsDifference(i,m.lastUpdated)>m.time&&(b=!0):m.refreshMode===yT.EXPIRE?Q.greaterThan(i,m.time)&&(b=!0):m.refreshMode===yT.STOP&&(s&&(m.needsUpdate=!0,m.cameraUpdateTime=i),m.needsUpdate&&Q.secondsDifference(i,m.cameraUpdateTime)>=m.time&&(b=!0)),b){r(p),m.updating=!0;let f=new za,y=m.href.clone();y.setQueryParameters(m.cookie);let _=o._ellipsoid??ne.default;aoe(y,o.camera,o.canvas,m.viewBoundScale,a.bbox,_),$ie(o,f,y,{context:p.id}).then(_Vt(o,m,f,d,y)).catch(function(S){let Z=`NetworkLink ${m.href} refresh failed: ${S}`;console.log(Z),o._error.raiseEvent(o,Z)}),u=!0}}d.set(m.id,m)}}),u&&(this._networkLinks=d,this._changed.raiseEvent(this)),!0}};function coe(e){let t=e.parent;if(l(t)){let n=t.availability;if(l(n)){let i=e.availability;l(i)?i.intersect(n):e.availability=n}}}function _Vt(e,t,n,i,o){return function(r){if(!i.contains(t.id))return;let s=!1,a=co(r,"NetworkLinkControl",De.kml),c=l(a),d=0;if(c){if(l(co(a,"Update",De.kml))){xt("kml-networkLinkControl-update","KML - NetworkLinkControl updates aren't supported."),t.updating=!1,i.remove(t.id);return}t.cookie=yu(Yn(a,"cookie",De.kml)??""),d=Ai(a,"minRefreshPeriod",De.kml)??0}let u=Q.now(),m=t.refreshMode;if(m===yT.INTERVAL)l(a)&&(t.time=Math.max(d,t.time));else if(m===yT.EXPIRE){let L;if(l(a)&&(L=Yn(a,"expires",De.kml)),l(L))try{let F=Q.fromIso8601(L),I=Q.secondsDifference(F,u);I>0&&I<d&&Q.addSeconds(u,d,F),t.time=F}catch{xt("kml-networkLinkControl-expires","KML - NetworkLinkControl expires is not a valid date"),s=!0}else xt("kml-refreshMode-onExpire","KML - refreshMode of onExpire requires the NetworkLinkControl to have an expires element"),s=!0}let p=t.entity,b=e._entityCollection,f=n.values;function y(L){b.remove(L);let F=L._children,I=F.length;for(let N=0;N<I;++N)y(F[N])}b.suspendEvents();let _=b.values.slice(),S;for(S=0;S<_.length;++S){let L=_[S];L.parent===p&&(L.parent=void 0,y(L))}for(b.resumeEvents(),b.suspendEvents(),S=0;S<f.length;S++){let L=f[S];l(L.parent)||(L.parent=p,coe(L)),b.add(L)}b.resumeEvents(),s?i.remove(t.id):t.lastUpdated=u;let Z=b.computeAvailability(),R=Z.start,C=Z.stop,E=Q.equals(R,ot.MINIMUM_VALUE),A=Q.equals(C,ot.MAXIMUM_VALUE);if(!E||!A){let L=e._clock;(L.startTime!==R||L.stopTime!==C)&&(L.startTime=R,L.stopTime=C,e._changed.raiseEvent(e))}t.updating=!1,t.needsUpdate=!1,e._refresh.raiseEvent(e,o.getUrlComponent(!0))}}var Jie=new kt,eoe=class{constructor(){this.author={name:void 0,uri:void 0,email:void 0},this.link={href:void 0,hreflang:void 0,rel:void 0,type:void 0,title:void 0,length:void 0},this.address=void 0,this.phoneNumber=void 0,this.snippet=void 0,this.extendedData=void 0}};Jg._DeferredLoading=jie;Jg._getTimestamp=Zn;var DZ=Jg;var ato=x(T(),1);function Ww(){ge.throwInstantiationError()}Ww.prototype.update=ge.throwInstantiationError;Ww.prototype.getBoundingSphere=ge.throwInstantiationError;Ww.prototype.isDestroyed=ge.throwInstantiationError;Ww.prototype.destroy=ge.throwInstantiationError;var loe=Ww;var FGo=x(T(),1);var _to=x(T(),1);var pto=x(T(),1);var dto=x(T(),1);async function SVt(e,t,n,i){return l(i)||(i=!1),CVt(e,t,n,i)}function ZVt(e,t,n){let i=e[0],o=i.terrainProvider.requestTileGeometry(i.x,i.y,i.level);if(!o)return!1;let r;return n?r=o.then(QWe(i)):r=o.then(QWe(i)).catch(VVt(i)),e.shift(),t.push(r),!0}function RVt(e){return new Promise(function(t){setTimeout(t,e)})}function doe(e,t,n){return e.length?ZVt(e,t,n)?doe(e,t,n):RVt(100).then(()=>doe(e,t,n)):Promise.resolve()}function CVt(e,t,n,i){let o=e.tilingScheme,r,s=[],a={};for(r=0;r<n.length;++r){let d=o.positionToTileXY(n[r],t);if(!l(d))continue;let u=d.toString();if(!a.hasOwnProperty(u)){let m={x:d.x,y:d.y,level:t,tilingScheme:o,terrainProvider:e,positions:[]};a[u]=m,s.push(m)}a[u].positions.push(n[r])}let c=[];return doe(s,c,i).then(function(){return Promise.all(c).then(function(){return n})})}function jWe(e,t,n){let i=t.interpolateHeight(n,e.longitude,e.latitude);return i===void 0?!1:(e.height=i,!0)}function QWe(e){let t=e.positions,n=e.tilingScheme.tileXYToRectangle(e.x,e.y,e.level);return function(i){let o=!1;for(let r=0;r<t.length;++r){let s=t[r];if(!jWe(s,i,n)){o=!0;break}}return o?i.createMesh({tilingScheme:e.tilingScheme,x:e.x,y:e.y,level:e.level,throttle:!1}).then(function(){for(let r=0;r<t.length;++r){let s=t[r];jWe(s,i,n)}}):Promise.resolve()}}function VVt(e){let t=e.positions;return function(){for(let n=0;n<t.length;++n){let i=t[n];i.height=void 0}}}var vw=SVt;var uoe=new k;async function qWe(e,t,n){l(n)||(n=!1);let i=[],o=[],r=e.availability,s=[];for(let c=0;c<t.length;++c){let d=t[c],u=r.computeMaximumLevelAtPosition(d);if(o[c]=u,u===0){e.tilingScheme.positionToTileXY(d,1,uoe);let p=e.loadTileDataAvailability(uoe.x,uoe.y,1);l(p)&&s.push(p)}let m=i[u];l(m)||(i[u]=m=[]),m.push(d)}await Promise.all(s),await Promise.all(i.map(function(c,d){if(l(c))return vw(e,d,c,n)}));let a=[];for(let c=0;c<t.length;++c){let d=t[c];r.computeMaximumLevelAtPosition(d)!==o[c]&&a.push(d)}return a.length>0&&await qWe(e,a,n),t}var OZ=qWe;async function moe(e,t){let n=t.terrainProvider,i=t.mapProjection,o=i.ellipsoid,r,s=t.camera.getRectangleCameraCoordinates(e);if(t.mode===se.SCENE3D?r=o.cartesianToCartographic(s):r=i.unproject(s),!l(n))return r;let a=n.availability;if(!l(a)||t.mode===se.SCENE2D)return r;let c=[re.center(e),re.southeast(e),re.southwest(e),re.northeast(e),re.northwest(e)],d=await moe._sampleTerrainMostDetailed(n,c),u=!1,m=d.reduce(function(b,f){return l(f.height)?(u=!0,Math.max(f.height,b)):b},-Number.MAX_VALUE),p=r;return u&&(p.height+=m),p}moe._sampleTerrainMostDetailed=OZ;var BZ=moe;var Xso=x(T(),1);var $no=x(T(),1);var Ono=x(T(),1);var Zto=x(T(),1),$We={NONE:0,LERC:1};Object.freeze($We);var gh=$We;var qto=x(T(),1);var Xto=x(T(),1);var Cto=x(T(),1),eve={NONE:0,BITS12:1};Object.freeze(eve);var Ka=eve;var Fw=new h,EVt=new h,yh=new k,AVt=new P,GVt=new P,LVt=Math.pow(2,12);function Mc(e,t,n,i,o,r,s,a,c,d){let u=Ka.NONE,m,p;if(l(t)&&l(n)&&l(i)&&l(o)){let b=t.minimum,f=t.maximum,y=h.subtract(f,b,EVt),_=i-n;Math.max(h.maximumComponent(y),_)<LVt-1?u=Ka.BITS12:u=Ka.NONE;let Z=P.fromScale(y,AVt);Z=P.setTranslation(Z,b,Z);let R=P.fromScale(h.fromElements(1/y.x,1/y.y,1/y.z,Fw),GVt);R=P.multiplyByTranslation(R,h.negate(b,Fw),R),p=P.clone(o,new P);let C=P.getTranslation(o,Fw);C=h.subtract(C,e,Fw),p=P.setTranslation(p,C,p),p=P.multiply(p,Z,p),m=P.inverseTransformation(o,new P),m=P.multiply(R,m,m),o=P.multiply(o,Z,new P)}this.quantization=u,this.minimumHeight=n,this.maximumHeight=i,this.center=h.clone(e),this.toScaledENU=m,this.fromScaledENU=o,this.matrix=p,this.hasVertexNormals=r??!1,this.hasWebMercatorT=s??!1,this.hasGeodeticSurfaceNormals=a??!1,this.exaggeration=c??1,this.exaggerationRelativeHeight=d??0,this.stride=0,this._offsetGeodeticSurfaceNormal=0,this._offsetVertexNormal=0,this._calculateStrideAndOffsets()}Mc.prototype.encode=function(e,t,n,i,o,r,s,a){let c=i.x,d=i.y;if(this.quantization===Ka.BITS12){n=P.multiplyByPoint(this.toScaledENU,n,Fw),n.x=W.clamp(n.x,0,1),n.y=W.clamp(n.y,0,1),n.z=W.clamp(n.z,0,1);let u=this.maximumHeight-this.minimumHeight,m=W.clamp((o-this.minimumHeight)/u,0,1);k.fromElements(n.x,n.y,yh);let p=dn.compressTextureCoordinates(yh);k.fromElements(n.z,m,yh);let b=dn.compressTextureCoordinates(yh);k.fromElements(c,d,yh);let f=dn.compressTextureCoordinates(yh);if(e[t++]=p,e[t++]=b,e[t++]=f,this.hasWebMercatorT){k.fromElements(s,0,yh);let y=dn.compressTextureCoordinates(yh);e[t++]=y}}else e[t++]=n.x-this.center.x,e[t++]=n.y-this.center.y,e[t++]=n.z-this.center.z,e[t++]=o,e[t++]=c,e[t++]=d,this.hasWebMercatorT&&(e[t++]=s);return this.hasVertexNormals&&(e[t++]=dn.octPackFloat(r)),this.hasGeodeticSurfaceNormals&&(e[t++]=a.x,e[t++]=a.y,e[t++]=a.z),t};var WVt=new h,tve=new h;Mc.prototype.addGeodeticSurfaceNormals=function(e,t,n){if(this.hasGeodeticSurfaceNormals)return;let i=this.stride,o=e.length/i;this.hasGeodeticSurfaceNormals=!0,this._calculateStrideAndOffsets();let r=this.stride;for(let s=0;s<o;s++){for(let u=0;u<i;u++){let m=s*i+u,p=s*r+u;t[p]=e[m]}let a=this.decodePosition(t,s,WVt),c=n.geodeticSurfaceNormal(a,tve),d=s*r+this._offsetGeodeticSurfaceNormal;t[d]=c.x,t[d+1]=c.y,t[d+2]=c.z}};Mc.prototype.removeGeodeticSurfaceNormals=function(e,t){if(!this.hasGeodeticSurfaceNormals)return;let n=this.stride,i=e.length/n;this.hasGeodeticSurfaceNormals=!1,this._calculateStrideAndOffsets();let o=this.stride;for(let r=0;r<i;r++)for(let s=0;s<o;s++){let a=r*n+s,c=r*o+s;t[c]=e[a]}};Mc.prototype.decodePosition=function(e,t,n){if(l(n)||(n=new h),t*=this.stride,this.quantization===Ka.BITS12){let i=dn.decompressTextureCoordinates(e[t],yh);n.x=i.x,n.y=i.y;let o=dn.decompressTextureCoordinates(e[t+1],yh);return n.z=o.x,P.multiplyByPoint(this.fromScaledENU,n,n)}return n.x=e[t],n.y=e[t+1],n.z=e[t+2],h.add(n,this.center,n)};Mc.prototype.getExaggeratedPosition=function(e,t,n){n=this.decodePosition(e,t,n);let i=this.exaggeration,o=this.exaggerationRelativeHeight;if(i!==1&&this.hasGeodeticSurfaceNormals){let s=this.decodeGeodeticSurfaceNormal(e,t,tve),a=this.decodeHeight(e,t),c=_o.getHeight(a,i,o)-a;n.x+=s.x*c,n.y+=s.y*c,n.z+=s.z*c}return n};Mc.prototype.decodeTextureCoordinates=function(e,t,n){return l(n)||(n=new k),t*=this.stride,this.quantization===Ka.BITS12?dn.decompressTextureCoordinates(e[t+2],n):k.fromElements(e[t+4],e[t+5],n)};Mc.prototype.decodeHeight=function(e,t){return t*=this.stride,this.quantization===Ka.BITS12?dn.decompressTextureCoordinates(e[t+1],yh).y*(this.maximumHeight-this.minimumHeight)+this.minimumHeight:e[t+3]};Mc.prototype.decodeWebMercatorT=function(e,t){return t*=this.stride,this.quantization===Ka.BITS12?dn.decompressTextureCoordinates(e[t+3],yh).x:e[t+6]};Mc.prototype.getOctEncodedNormal=function(e,t,n){t=t*this.stride+this._offsetVertexNormal;let i=e[t]/256,o=Math.floor(i),r=(i-o)*256;return k.fromElements(o,r,n)};Mc.prototype.decodeNormal=function(e,t,n){let i=t*this.stride+this._offsetVertexNormal;return dn.octDecodeFloat(e[i],n)};Mc.prototype.decodeGeodeticSurfaceNormal=function(e,t,n){return t=t*this.stride+this._offsetGeodeticSurfaceNormal,n.x=e[t],n.y=e[t+1],n.z=e[t+2],n};Mc.prototype._calculateStrideAndOffsets=function(){let e=0;this.quantization===Ka.BITS12?e+=3:e+=6,this.hasWebMercatorT&&(e+=1),this.hasVertexNormals&&(this._offsetVertexNormal=e,e+=1),this.hasGeodeticSurfaceNormals&&(this._offsetGeodeticSurfaceNormal=e,e+=3),this.stride=e};var wH={position3DAndHeight:0,textureCoordAndEncodedNormals:1,geodeticSurfaceNormal:2},kH={compressed0:0,compressed1:1,geodeticSurfaceNormal:2};Mc.prototype.getAttributes=function(e){let t=J.FLOAT,n=J.getSizeInBytes(t),i=this.stride*n,o=0,r=[];function s(a,c){r.push({index:a,vertexBuffer:e,componentDatatype:t,componentsPerAttribute:c,offsetInBytes:o,strideInBytes:i}),o+=c*n}if(this.quantization===Ka.NONE){s(wH.position3DAndHeight,4);let a=2;a+=this.hasWebMercatorT?1:0,a+=this.hasVertexNormals?1:0,s(wH.textureCoordAndEncodedNormals,a),this.hasGeodeticSurfaceNormals&&s(wH.geodeticSurfaceNormal,3)}else{let a=this.hasWebMercatorT||this.hasVertexNormals,c=this.hasWebMercatorT&&this.hasVertexNormals;s(kH.compressed0,a?4:3),c&&s(kH.compressed1,1),this.hasGeodeticSurfaceNormals&&s(kH.geodeticSurfaceNormal,3)}return r};Mc.prototype.getAttributeLocations=function(){return this.quantization===Ka.NONE?wH:kH};Mc.clone=function(e,t){if(l(e))return l(t)||(t=new Mc),t.quantization=e.quantization,t.minimumHeight=e.minimumHeight,t.maximumHeight=e.maximumHeight,t.center=h.clone(e.center),t.toScaledENU=P.clone(e.toScaledENU),t.fromScaledENU=P.clone(e.fromScaledENU),t.matrix=P.clone(e.matrix),t.hasVertexNormals=e.hasVertexNormals,t.hasWebMercatorT=e.hasWebMercatorT,t.hasGeodeticSurfaceNormals=e.hasGeodeticSurfaceNormals,t.exaggeration=e.exaggeration,t.exaggerationRelativeHeight=e.exaggerationRelativeHeight,t._calculateStrideAndOffsets(),t};var Cr=Mc;var E0={};E0.DEFAULT_STRUCTURE=Object.freeze({heightScale:1,heightOffset:0,elementsPerHeight:1,stride:1,elementMultiplier:256,isBigEndian:!1});var hoe=new h,vVt=new P,FVt=new h,IVt=new h;E0.computeVertices=function(e){let t=Math.cos,n=Math.sin,i=Math.sqrt,o=Math.atan,r=Math.exp,s=W.PI_OVER_TWO,a=W.toRadians,c=e.heightmap,d=e.width,u=e.height,m=e.skirtHeight,p=m>0,b=e.isGeographic??!0,f=e.ellipsoid??ne.default,y=1/f.maximumRadius,_=re.clone(e.nativeRectangle),S=re.clone(e.rectangle),Z,R,C,E;l(S)?(Z=S.west,R=S.south,C=S.east,E=S.north):b?(Z=a(_.west),R=a(_.south),C=a(_.east),E=a(_.north)):(Z=_.west*y,R=s-2*o(r(-_.south*y)),C=_.east*y,E=s-2*o(r(-_.north*y)));let A=e.relativeToCenter,L=l(A);A=L?A:h.ZERO;let F=e.includeWebMercatorT??!1,I=e.exaggeration??1,N=e.exaggerationRelativeHeight??0,V=I!==1,G=e.structure??E0.DEFAULT_STRUCTURE,v=G.heightScale??E0.DEFAULT_STRUCTURE.heightScale,X=G.heightOffset??E0.DEFAULT_STRUCTURE.heightOffset,Y=G.elementsPerHeight??E0.DEFAULT_STRUCTURE.elementsPerHeight,D=G.stride??E0.DEFAULT_STRUCTURE.stride,M=G.elementMultiplier??E0.DEFAULT_STRUCTURE.elementMultiplier,O=G.isBigEndian??E0.DEFAULT_STRUCTURE.isBigEndian,w=re.computeWidth(_),z=re.computeHeight(_),K=w/(d-1),te=z/(u-1);b||(w*=y,z*=y);let H=f.radiiSquared,$=H.x,ee=H.y,le=H.z,_e=65536,he=-65536,Ze=_t.eastNorthUpToFixedFrame(A,f),ye=P.inverseTransformation(Ze,vVt),Ge,Ae;F&&(Ge=Ti.geodeticLatitudeToMercatorAngle(R),Ae=1/(Ti.geodeticLatitudeToMercatorAngle(E)-Ge));let Fe=FVt;Fe.x=Number.POSITIVE_INFINITY,Fe.y=Number.POSITIVE_INFINITY,Fe.z=Number.POSITIVE_INFINITY;let tt=IVt;tt.x=Number.NEGATIVE_INFINITY,tt.y=Number.NEGATIVE_INFINITY,tt.z=Number.NEGATIVE_INFINITY;let Be=Number.POSITIVE_INFINITY,je=d*u,qe=m>0?d*2+u*2:0,We=je+qe,Ke=new Array(We),ct=new Array(We),Et=new Array(We),zt=F?new Array(We):[],ut=V?new Array(We):[],bt=0,ht=u,jt=0,st=d;p&&(--bt,++ht,--jt,++st);let pt=1e-5;for(let On=bt;On<ht;++On){let rn=On;rn<0&&(rn=0),rn>=u&&(rn=u-1);let Hn=_.north-te*rn;b?Hn=a(Hn):Hn=s-2*o(r(-Hn*y));let $i=(Hn-R)/(E-R);$i=W.clamp($i,0,1);let Po=On===bt,hr=On===ht-1;m>0&&(Po?Hn+=pt*z:hr&&(Hn-=pt*z));let Is=t(Hn),Hs=n(Hn),or=le*Hs,yi;F&&(yi=(Ti.geodeticLatitudeToMercatorAngle(Hn)-Ge)*Ae);for(let fr=jt;fr<st;++fr){let mo=fr;mo<0&&(mo=0),mo>=d&&(mo=d-1);let Qr=rn*(d*D)+mo*D,Mn;if(Y===1)Mn=c[Qr];else{Mn=0;let qo;if(O)for(qo=0;qo<Y;++qo)Mn=Mn*M+c[Qr+qo];else for(qo=Y-1;qo>=0;--qo)Mn=Mn*M+c[Qr+qo]}Mn=Mn*v+X,he=Math.max(he,Mn),_e=Math.min(_e,Mn);let Ki=_.west+K*mo;b?Ki=a(Ki):Ki=Ki*y;let wi=(Ki-Z)/(C-Z);wi=W.clamp(wi,0,1);let Xo=rn*d+mo;if(m>0){let qo=fr===jt,Gl=fr===st-1,K0=Po||hr||qo||Gl;if((Po||hr)&&(qo||Gl))continue;K0&&(Mn-=m,qo?(Xo=je+(u-rn-1),Ki-=pt*w):hr?Xo=je+u+(d-mo-1):Gl?(Xo=je+u+d+rn,Ki+=pt*w):Po&&(Xo=je+u+d+u+mo))}let Dc=Is*t(Ki),bm=Is*n(Ki),bp=$*Dc,Lh=ee*bm,gp=1/i(bp*Dc+Lh*bm+or*Hs),Ps=bp*gp,$a=Lh*gp,BT=or*gp,si=new h;si.x=Ps+Dc*Mn,si.y=$a+bm*Mn,si.z=BT+Hs*Mn,P.multiplyByPoint(ye,si,hoe),h.minimumByComponent(hoe,Fe,Fe),h.maximumByComponent(hoe,tt,tt),Be=Math.min(Be,Mn),Ke[Xo]=si,Et[Xo]=new k(wi,$i),ct[Xo]=Mn,F&&(zt[Xo]=yi),V&&(ut[Xo]=f.geodeticSurfaceNormal(si))}}let Mi=me.fromPoints(Ke),jn;l(S)&&(jn=nn.fromRectangle(S,_e,he,f));let Si;L&&(Si=new Gf(f).computeHorizonCullingPointPossiblyUnderEllipsoid(A,Ke,_e));let Hi=new Zu(Fe,tt,A),Gi=new Cr(A,Hi,Be,he,Ze,!1,F,V,I,N),pi=new Float32Array(We*Gi.stride),Zi=0;for(let On=0;On<We;++On)Zi=Gi.encode(pi,Zi,Ke[On],Et[On],ct[On],void 0,zt[On],ut[On]);return{vertices:pi,maximumHeight:he,minimumHeight:_e,encoding:Gi,boundingSphere3D:Mi,orientedBoundingBox:jn,occludeePointInScaledSpace:Si}};var QE=E0;var tno=x(T(),1);function xT(){ge.throwInstantiationError()}Object.defineProperties(xT.prototype,{credits:{get:ge.throwInstantiationError},waterMask:{get:ge.throwInstantiationError}});xT.prototype.interpolateHeight=ge.throwInstantiationError;xT.prototype.isChildAvailable=ge.throwInstantiationError;xT.prototype.createMesh=ge.throwInstantiationError;xT.prototype.upsample=ge.throwInstantiationError;xT.prototype.wasCreatedByUpsampling=ge.throwInstantiationError;xT.maximumAsynchronousTasks=5;var ru=xT;var Eno=x(T(),1);var fno=x(T(),1);var PVt=3,poe=class{constructor(t,n,i){this._vertices=t,this._indices=n,this._encoding=i,this._inverseTransform=new P,this._needsRebuild=!0,this._rootNode=new boe}get needsRebuild(){return this._needsRebuild}set needsRebuild(t){this._needsRebuild=t}rayIntersect(t,n,i,o,r){this._needsRebuild&&YVt(this,n);let s=this._inverseTransform,a=NVt;a.origin=P.multiplyByPoint(s,t.origin,a.origin),a.direction=P.multiplyByPointAsVector(s,t.direction,a.direction);let c=[];return ive(this._rootNode,a,c),DVt(this,c,t,i,o,r)}},XVt=new qn("incrementallyBuildTerrainPicker"),boe=class e{constructor(){this.x=0,this.y=0,this.level=0,this.aabb=nve(this.x,this.y,this.level),this.intersectingTriangles=new Uint32Array(0),this.children=[],this.buildingChildren=!1}addChild(t){let n=new e;n.x=this.x*2+(t&1),n.y=this.y*2+(t>>1&1),n.level=this.level+1,n.aabb=nve(n.x,n.y,n.level),this.children[t]=n}},NVt=new gn,UH=[new h,new h,new h];function YVt(e,t){P.inverse(t,e._inverseTransform),e._needsRebuild=!1;let n=e._indices.length/3,i=new Uint32Array(n);for(let o=0;o<n;++o)i[o]=o;e._rootNode.intersectingTriangles=i,e._rootNode.children.length=0}var MVt=new h,wVt=new h;function nve(e,t,n){let i=1/Math.pow(2,n),o=h.fromElements(e*i-.5,t*i-.5,-.5,MVt),r=h.fromElements((e+1)*i-.5,(t+1)*i-.5,.5,wVt);return Zu.fromCorners(o,r)}function kVt(e,t,n,i,o){h.pack(n[0],e,9*o),h.pack(n[1],e,9*o+3),h.pack(n[2],e,9*o+6),t[o]=i}var UVt=new Ns;function ive(e,t,n){let i=xi.rayAxisAlignedBoundingBox(t,e.aabb,UVt);if(!l(i))return;if(!e.children.length||e.buildingChildren){n.push({node:e,interval:new Ns(i.start,i.stop)});return}for(let r=0;r<e.children.length;r++)ive(e.children[r],t,n)}function DVt(e,t,n,i,o,r){let s=t.sort(function(c,d){return c.interval.start-d.interval.start}),a=Number.MAX_VALUE;for(let c=0;c<s.length;c++){let d=s[c],u=OVt(e,n,d.node,i,o,r);if(a=Math.min(u,a),a!==Number.MAX_VALUE)break}if(a!==Number.MAX_VALUE)return gn.getPoint(n,a)}function OVt(e,t,n,i,o,r){let s=Number.MAX_VALUE,a=e._encoding,c=e._indices,d=e._vertices,u=n.intersectingTriangles.length,p=!(n.level>=PVt)&&!n.buildingChildren,b,f;p&&(b=new Float64Array(u*9),f=new Uint32Array(u));for(let y=0;y<u;y++){let _=n.intersectingTriangles[y],S=foe(a,o,r,t,d,c[3*_],UH[0]),Z=foe(a,o,r,t,d,c[3*_+1],UH[1]),R=foe(a,o,r,t,d,c[3*_+2],UH[2]),C=xi.rayTriangleParametric(t,S,Z,R,i);l(C)&&C<s&&C>=0&&(s=C),p&&kVt(b,f,UH,_,y)}if(p){for(let y=0;y<4;y++)n.addChild(y);zVt(e._inverseTransform,n,f,b)}return s}var BVt=new pe;function foe(e,t,n,i,o,r,s){let a=e.getExaggeratedPosition(o,r,s);if(t===se.SCENE3D)return a;let d=n.ellipsoid.cartesianToCartographic(a,BVt);a=n.project(d,s),a=h.fromElements(a.z,a.x,a.y,s);let u=W.TWO_PI*n.ellipsoid.maximumRadius,m=Math.round((i.origin.y-a.y)/u);return a.y+=m*u,a}async function zVt(e,t,n,i){t.buildingChildren=!0;let o=new Float64Array(16);P.pack(e,o,0);let r=new Float64Array(24);for(let u=0;u<4;u++)h.pack(t.children[u].aabb.minimum,r,u*6),h.pack(t.children[u].aabb.maximum,r,u*6+3);let s={aabbs:r,inverseTransform:o,triangleIndices:n,trianglePositions:i},a=[r.buffer,o.buffer,n.buffer,i.buffer],c=XVt.scheduleTask(s,a);if(!l(c)){t.buildingChildren=!1;return}(await c).intersectingTrianglesArrays.forEach((u,m)=>{l(t.children[m])&&(t.children[m].intersectingTriangles=new Uint32Array(u))}),t.intersectingTriangles=new Uint32Array(0),t.buildingChildren=!1}var Iw=poe;function Pw(e,t,n,i,o,r,s,a,c,d,u,m,p,b,f,y,_){this.center=e,this.vertices=t,this.stride=u??6,this.indices=n,this.indexCountWithoutSkirts=i,this.vertexCountWithoutSkirts=o,this.minimumHeight=r,this.maximumHeight=s,this.rectangle=a,this.boundingSphere3D=c,this.occludeePointInScaledSpace=d,this.orientedBoundingBox=m,this.encoding=p,this.westIndicesSouthToNorth=b,this.southIndicesEastToWest=f,this.eastIndicesNorthToSouth=y,this.northIndicesWestToEast=_,this._transform=new P,this._lastPickSceneMode=void 0,this._terrainPicker=new Iw(t,n,p)}Pw.prototype.getTransform=function(e,t){return this._lastPickSceneMode===e?this._transform:(this._terrainPicker.needsRebuild=!0,!l(e)||e===se.SCENE3D?HVt(this,this._transform):eEt(this,t,this._transform))};function HVt(e,t){let n=e.encoding.exaggeration,i=e.encoding.exaggerationRelativeHeight,o=_o.getHeight(e.minimumHeight,n,i),r=_o.getHeight(e.maximumHeight,n,i),s=nn.fromRectangle(e.rectangle,o,r,ne.default,e.orientedBoundingBox);return nn.computeTransformation(s,t),P.getScale(t,goe).z<=W.EPSILON16&&(goe.z=1,P.setScale(t,goe,t)),t}var KVt=new h,JVt=new h,jVt=new pe,QVt=new pe,qVt=new h,$Vt=new h,goe=new h;function eEt(e,t,n){let i=e.encoding.exaggeration,o=e.encoding.exaggerationRelativeHeight,r=_o.getHeight(e.minimumHeight,i,o),s=_o.getHeight(e.maximumHeight,i,o),a=t.project(pe.fromRadians(e.rectangle.west,e.rectangle.south,0,jVt),KVt),c=t.project(pe.fromRadians(e.rectangle.east,e.rectangle.north,0,QVt),JVt),d=s-r,u=h.fromElements(c.x-a.x,c.y-a.y,d>0?d:1,qVt),m=h.fromElements(a.x+u.x*.5,a.y+u.y*.5,r+u.z*.5,$Vt);return P.fromTranslation(m,n),P.setScale(n,u,n),P.multiply(_t.SWIZZLE_3D_TO_2D_MATRIX,n,n),n}Pw.prototype.pick=function(e,t,n,i){let o=this._terrainPicker.rayIntersect(e,this.getTransform(n,i),t,n,i);return this._lastPickSceneMode=n,o};Pw.prototype.updateExaggeration=function(e,t){this._terrainPicker._vertices=this.vertices,this._terrainPicker.needsRebuild=!0,this._lastPickSceneMode=void 0};Pw.prototype.updateSceneMode=function(e){this._terrainPicker.needsRebuild=!0,this._lastPickSceneMode=void 0};var yc=Pw;function jg(e){e=e??B.EMPTY_OBJECT,this._buffer=e.buffer,this._width=e.width,this._height=e.height,this._childTileMask=e.childTileMask??15,this._encoding=e.encoding??gh.NONE;let t=QE.DEFAULT_STRUCTURE,n=e.structure;l(n)?n!==t&&(n.heightScale=n.heightScale??t.heightScale,n.heightOffset=n.heightOffset??t.heightOffset,n.elementsPerHeight=n.elementsPerHeight??t.elementsPerHeight,n.stride=n.stride??t.stride,n.elementMultiplier=n.elementMultiplier??t.elementMultiplier,n.isBigEndian=n.isBigEndian??t.isBigEndian):n=t,this._structure=n,this._createdByUpsampling=e.createdByUpsampling??!1,this._waterMask=e.waterMask,this._skirtHeight=void 0,this._bufferType=this._encoding===gh.LERC?Float32Array:this._buffer.constructor,this._mesh=void 0}Object.defineProperties(jg.prototype,{credits:{get:function(){}},waterMask:{get:function(){return this._waterMask}},childTileMask:{get:function(){return this._childTileMask}}});var ove="createVerticesFromHeightmap",tEt=new qn(ove),nEt=new qn(ove,ru.maximumAsynchronousTasks);jg.prototype.createMesh=function(e){e=e??B.EMPTY_OBJECT;let t=e.tilingScheme,n=e.x,i=e.y,o=e.level,r=e.exaggeration??1,s=e.exaggerationRelativeHeight??0,a=e.throttle??!0,c=t.ellipsoid,d=t.tileXYToNativeRectangle(n,i,o),u=t.tileXYToRectangle(n,i,o),m=c.cartographicToCartesian(re.center(u)),p=this._structure,f=Qo.getEstimatedLevelZeroGeometricErrorForAHeightmap(c,this._width,t.getNumberOfXTilesAtLevel(0))/(1<<o);this._skirtHeight=Math.min(f*4,1e3);let _=(a?nEt:tEt).scheduleTask({heightmap:this._buffer,structure:p,includeWebMercatorT:!0,width:this._width,height:this._height,nativeRectangle:d,rectangle:u,relativeToCenter:m,ellipsoid:c,skirtHeight:this._skirtHeight,isGeographic:t.projection instanceof ki,exaggeration:r,exaggerationRelativeHeight:s,encoding:this._encoding});if(!l(_))return;let S=this;return Promise.resolve(_).then(function(Z){let R;S._skirtHeight>0?R=Qo.getRegularGridAndSkirtIndicesAndEdgeIndices(Z.gridWidth,Z.gridHeight):R=Qo.getRegularGridIndicesAndEdgeIndices(Z.gridWidth,Z.gridHeight);let C=Z.gridWidth*Z.gridHeight;return S._mesh=new yc(m,new Float32Array(Z.vertices),R.indices,R.indexCountWithoutSkirts,C,Z.minimumHeight,Z.maximumHeight,u,me.clone(Z.boundingSphere3D),h.clone(Z.occludeePointInScaledSpace),Z.numberOfAttributes,nn.clone(Z.orientedBoundingBox),Cr.clone(Z.encoding),R.westIndicesSouthToNorth,R.southIndicesEastToWest,R.eastIndicesNorthToSouth,R.northIndicesWestToEast),S._buffer=void 0,S._mesh})};jg.prototype._createMeshSync=function(e){let t=e.tilingScheme,n=e.x,i=e.y,o=e.level,r=e.exaggeration??1,s=e.exaggerationRelativeHeight??0,a=t.ellipsoid,c=t.tileXYToNativeRectangle(n,i,o),d=t.tileXYToRectangle(n,i,o),u=a.cartographicToCartesian(re.center(d)),m=this._structure,b=Qo.getEstimatedLevelZeroGeometricErrorForAHeightmap(a,this._width,t.getNumberOfXTilesAtLevel(0))/(1<<o);this._skirtHeight=Math.min(b*4,1e3);let f=QE.computeVertices({heightmap:this._buffer,structure:m,includeWebMercatorT:!0,width:this._width,height:this._height,nativeRectangle:c,rectangle:d,relativeToCenter:u,ellipsoid:a,skirtHeight:this._skirtHeight,isGeographic:t.projection instanceof ki,exaggeration:r,exaggerationRelativeHeight:s});this._buffer=void 0;let y;this._skirtHeight>0?y=Qo.getRegularGridAndSkirtIndicesAndEdgeIndices(this._width,this._height):y=Qo.getRegularGridIndicesAndEdgeIndices(this._width,this._height);let _=f.gridWidth*f.gridHeight;return this._mesh=new yc(u,f.vertices,y.indices,y.indexCountWithoutSkirts,_,f.minimumHeight,f.maximumHeight,d,f.boundingSphere3D,f.occludeePointInScaledSpace,f.encoding.stride,f.orientedBoundingBox,f.encoding,y.westIndicesSouthToNorth,y.southIndicesEastToWest,y.eastIndicesNorthToSouth,y.northIndicesWestToEast),this._mesh};jg.prototype.interpolateHeight=function(e,t,n){let i=this._width,o=this._height,r=this._structure,s=r.stride,a=r.elementsPerHeight,c=r.elementMultiplier,d=r.isBigEndian,u=r.heightOffset,m=r.heightScale,p=l(this._mesh),b=this._encoding===gh.LERC;if(!p&&b)return;let y;if(p){let _=this._mesh.vertices,S=this._mesh.encoding;y=rve(_,S,u,m,e,i,o,t,n)}else y=iEt(this._buffer,a,c,s,d,e,i,o,t,n),y=y*m+u;return y};jg.prototype.upsample=function(e,t,n,i,o,r,s){let a=this._mesh;if(!l(a))return;let c=this._width,d=this._height,u=this._structure,m=u.stride,p=new this._bufferType(c*d*m),b=a.vertices,f=a.encoding,y=e.tileXYToRectangle(t,n,i),_=e.tileXYToRectangle(o,r,s),S=u.heightOffset,Z=u.heightScale,R=u.elementsPerHeight,C=u.elementMultiplier,E=u.isBigEndian,A=Math.pow(C,R-1);for(let L=0;L<d;++L){let F=W.lerp(_.north,_.south,L/(d-1));for(let I=0;I<c;++I){let N=W.lerp(_.west,_.east,I/(c-1)),g=rve(b,f,S,Z,y,c,d,N,F);g=g<u.lowestEncodedHeight?u.lowestEncodedHeight:g,g=g>u.highestEncodedHeight?u.highestEncodedHeight:g,oEt(p,R,C,A,m,E,L*c+I,g)}}return Promise.resolve(new jg({buffer:p,width:c,height:d,childTileMask:0,structure:this._structure,createdByUpsampling:!0}))};jg.prototype.isChildAvailable=function(e,t,n,i){let o=2;return n!==e*2&&++o,i!==t*2&&(o-=2),(this._childTileMask&1<<o)!==0};jg.prototype.wasCreatedByUpsampling=function(){return this._createdByUpsampling};function iEt(e,t,n,i,o,r,s,a,c,d){let u=(c-r.west)*(s-1)/(r.east-r.west),m=(d-r.south)*(a-1)/(r.north-r.south),p=u|0,b=p+1;b>=s&&(b=s-1,p=s-2);let f=m|0,y=f+1;y>=a&&(y=a-1,f=a-2);let _=u-p,S=m-f;f=a-1-f,y=a-1-y;let Z=DH(e,t,n,i,o,f*s+p),R=DH(e,t,n,i,o,f*s+b),C=DH(e,t,n,i,o,y*s+p),E=DH(e,t,n,i,o,y*s+b);return sve(_,S,Z,R,C,E)}function rve(e,t,n,i,o,r,s,a,c){let d=(a-o.west)*(r-1)/(o.east-o.west),u=(c-o.south)*(s-1)/(o.north-o.south),m=d|0,p=m+1;p>=r&&(p=r-1,m=r-2);let b=u|0,f=b+1;f>=s&&(f=s-1,b=s-2);let y=d-m,_=u-b;b=s-1-b,f=s-1-f;let S=(t.decodeHeight(e,b*r+m)-n)/i,Z=(t.decodeHeight(e,b*r+p)-n)/i,R=(t.decodeHeight(e,f*r+m)-n)/i,C=(t.decodeHeight(e,f*r+p)-n)/i;return sve(y,_,S,Z,R,C)}function sve(e,t,n,i,o,r){return t<e?n+e*(i-n)+t*(r-i):n+e*(r-o)+t*(o-n)}function DH(e,t,n,i,o,r){r*=i;let s=0,a;if(o)for(a=0;a<t;++a)s=s*n+e[r+a];else for(a=t-1;a>=0;--a)s=s*n+e[r+a];return s}function oEt(e,t,n,i,o,r,s,a){s*=o;let c;if(r)for(c=0;c<t-1;++c)e[s+c]=a/i|0,a-=e[s+c]*i,i/=n;else for(c=t-1;c>0;--c)e[s+c]=a/i|0,a-=e[s+c]*i,i/=n;e[s+c]=a}var wc=jg;function qE(e){e=e??B.EMPTY_OBJECT,this._tilingScheme=e.tilingScheme,l(this._tilingScheme)||(this._tilingScheme=new to({ellipsoid:e.ellipsoid??ne.default})),this._levelZeroMaximumGeometricError=Qo.getEstimatedLevelZeroGeometricErrorForAHeightmap(this._tilingScheme.ellipsoid,64,this._tilingScheme.getNumberOfXTilesAtLevel(0)),this._errorEvent=new Se}Object.defineProperties(qE.prototype,{errorEvent:{get:function(){return this._errorEvent}},credit:{get:function(){}},tilingScheme:{get:function(){return this._tilingScheme}},hasWaterMask:{get:function(){return!1}},hasVertexNormals:{get:function(){return!1}},availability:{get:function(){}}});qE.prototype.requestTileGeometry=function(e,t,n,i){return Promise.resolve(new wc({buffer:new Uint8Array(256),width:16,height:16}))};qE.prototype.getLevelMaximumGeometricError=function(e){return this._levelZeroMaximumGeometricError/(1<<e)};qE.prototype.getTileDataAvailable=function(e,t,n){};qE.prototype.loadTileDataAvailability=function(e,t,n){};var A0=qE;var mio=x(T(),1);var iio=x(T(),1);var rEt=new k;function sEt(e,t){let n=e.unionClippingRegions,i=e.length,o=gs.useFloatTexture(t),r=gs.getTextureResolution(e,t,rEt),s=r.x,a=r.y,c=o?lEt(s,a):dEt(s,a);return c+=` -`,c+=n?aEt(i):cEt(i),c}function aEt(e){return`float clip(vec4 fragCoord, sampler2D clippingPlanes, mat4 clippingPlanesMatrix) +Url: ${e._contentHeader.uri}`,o++;let r={text:i.substring(1),position:n,font:`${19-o}px sans-serif`,showBackground:!0,disableDepthTestDistance:Number.POSITIVE_INFINITY};return t._tileDebugLabels.add(r)}function Eyt(e,t){let n=e._selectedTiles,i=n.length,o=e._emptyTiles,r=o.length;if(e._tileDebugLabels.removeAll(),e.debugPickedTileLabelOnly){if(l(e.debugPickedTile)){let s=l(e.debugPickPosition)?e.debugPickPosition:Gee(e.debugPickedTile),a=Lee(e.debugPickedTile,e,s);a.pixelOffset=new k(15,-15)}}else{for(let s=0;s<i;++s){let a=n[s];Lee(a,e,Gee(a))}for(let s=0;s<r;++s){let a=o[s];(a.hasTilesetContent||a.hasImplicitContent)&&Lee(a,e,Gee(a))}}e._tileDebugLabels.update(t)}function Ayt(e,t,n){e._styleEngine.applyStyle(e),e._styleApplied=!0;let{commandList:i,context:o}=t,r=i.length,s=e._selectedTiles,a=e.isSkippingLevelOfDetail&&e._hasMixedContent&&o.stencilBuffer&&s.length>0;e._backfaceCommands.length=0,a&&(l(e._stencilClearCommand)||(e._stencilClearCommand=new ui({stencil:0,pass:Le.CESIUM_3D_TILE,renderState:ze.fromCache({stencilMask:Jt.SKIP_LOD_MASK})})),i.push(e._stencilClearCommand));let{statistics:c,tileVisible:d}=e,u=n.isRender,m=i.length;for(let f=0;f<s.length;++f){let y=s[f];u&&d.raiseEvent(y),Syt(e,y,t),y.update(e,t,n),c.incrementSelectionCounts(y.content),++c.selected}let p=e._emptyTiles;for(let f=0;f<p.length;++f)p[f].update(e,t,n);let b=i.length-m;if(e._backfaceCommands.trim(),a){let f=e._backfaceCommands.values,y=f.length;i.length+=y;for(let _=b-1;_>=0;--_)i[m+y+_]=i[m+_];for(let _=0;_<y;++_)i[m+_]=f[_]}b=i.length-r,c.numberOfCommands=b,u&&(e.pointCloudShading.attenuation&&e.pointCloudShading.eyeDomeLighting&&b>0&&e._pointCloudEyeDomeLighting.update(t,r,e.pointCloudShading,e.boundingSphere),e.debugShowGeometricError||e.debugShowRenderingStatistics||e.debugShowMemoryUsage||e.debugShowUrl?(l(e._tileDebugLabels)||(e._tileDebugLabels=new Xp),Eyt(e,t)):e._tileDebugLabels=e._tileDebugLabels&&e._tileDebugLabels.destroy())}var $1e=[],Gyt=[];function eCe(e,t){let n=t,i=$1e;for(i.push(t);i.length>0;){t=i.pop();let o=t.children;for(let r=0;r<o.length;++r)i.push(o[r]);t!==n&&(Fyt(e,t),--e._statistics.numberOfTilesTotal)}n.children=[]}function tCe(e,t){e.tileUnload.raiseEvent(t),e._statistics.decrementLoadCounts(t.content),--e._statistics.numberOfTilesWithContentReady,t.unloadContent()}function E3(e,t){let n=e-t;return n<0?n+Ox.maximumFrameNumber:n}var Lyt=64;function Wyt(e,t,n){let i=Gyt;for(i.length=0,i.push(e);i.length>0;){let o=i.pop(),r=o._contentState;if(r===Fo.LOADING||r===Fo.PROCESSING||!o.hasEmptyContent&&!o.hasTilesetContent&&r!==Fo.UNLOADED&&r!==Fo.FAILED||l(o.cacheNode)||Math.min(E3(t,o._visitedFrame),E3(t,o._touchedFrame),E3(t,o._selectedFrame),E3(t,o._requestedFrame))<n)return i.length=0,!0;let c=o.children;for(let d=0;d<c.length;++d)i.push(c[d])}return!1}function vyt(e,t){let n=e._externalTilesetTiles,i=t.frameNumber,o=e._externalTilesetIdleFrames,r=e._externalTilesetSweepCount,s=0,a=0;for(;s<r&&a<Lyt&&n.length>0;){++a,e._externalTilesetSweepIndex>=n.length&&(e._externalTilesetSweepIndex=0);let c=e._externalTilesetSweepIndex,d=n[c];if(d.isDestroyed()||!d.hasTilesetContent||d.children.length===0){n.splice(c,1);continue}++e._externalTilesetSweepIndex,++s,!Wyt(d,i,o)&&(eCe(e,d),d.unloadTilesetContent(),n.splice(c,1),e._externalTilesetSweepIndex=c)}}function Fyt(e,t){e._cache.unloadTile(e,t,tCe),t.destroy()}ur.prototype.trimLoadedTiles=function(){this._cache.trim()};function Iyt(e,t){let n=e._statistics,i=e._statisticsLast,o=n.numberOfPendingRequests,r=n.numberOfTilesProcessing,s=i.numberOfPendingRequests,a=i.numberOfTilesProcessing;Xf.clone(n,i);let c=o!==s||r!==a;c&&t.afterRender.push(function(){return e.loadProgress.raiseEvent(o,r),!0}),e._tilesLoaded=n.numberOfPendingRequests===0&&n.numberOfTilesProcessing===0&&n.numberOfAttemptedRequests===0,c&&e._tilesLoaded&&(t.afterRender.push(function(){return e.allTilesLoaded.raiseEvent(),!0}),e._initialTilesLoaded||(e._initialTilesLoaded=!0,t.afterRender.push(function(){return e.initialTilesLoaded.raiseEvent(),!0})))}function Pyt(e){e._heatmap.resetMinimumMaximum(),e._minimumPriority.depth=Number.MAX_VALUE,e._maximumPriority.depth=-Number.MAX_VALUE,e._minimumPriority.foveatedFactor=Number.MAX_VALUE,e._maximumPriority.foveatedFactor=-Number.MAX_VALUE,e._minimumPriority.distance=Number.MAX_VALUE,e._maximumPriority.distance=-Number.MAX_VALUE,e._minimumPriority.reverseScreenSpaceError=Number.MAX_VALUE,e._maximumPriority.reverseScreenSpaceError=-Number.MAX_VALUE}function Xyt(e,t){t.frameNumber===e._updatedModelMatrixFrame&&l(e._previousModelMatrix)||(e._updatedModelMatrixFrame=t.frameNumber,e._modelMatrixChanged=!P.equals(e.modelMatrix,e._previousModelMatrix),e._modelMatrixChanged&&(e._previousModelMatrix=P.clone(e.modelMatrix,e._previousModelMatrix)))}function Nyt(e,t,n,i){if(t.mode===se.MORPHING||!l(e._root))return!1;let o=e._statistics;o.clear(),++e._updatedVisibilityFrame,Pyt(e),Xyt(e,t),e._cullRequestsWhileMoving=e.cullRequestsWhileMoving&&!e._modelMatrixChanged;let r=e.getTraversal(i).selectTiles(e,t);if(i.requestTiles&&gyt(e),Ayt(e,t,i),Xf.clone(o,n),i.isRender){let s=e._credits;if(l(s)&&o.selected!==0)for(let a=0;a<s.length;++a){let c=s[a];t.creditDisplay.addCreditToNextFrame(c)}}return r}function nCe(e){let t=e._credits;l(t)||(t=[]),t.length=0,l(e.resource.credits)&&e.resource.credits.forEach(i=>{t.push(Lt.clone(i))});let n=e.asset.extras;if(l(n)&&l(n.cesium)&&l(n.cesium.credits)){let i=n.cesium.credits;for(let o=0;o<i.length;++o){let r=i[o];t.push(new Lt(r.html))}}t.forEach(i=>i.showOnScreen=i.showOnScreen||e._showCreditsOnScreen),e._credits=t}ur.prototype.getTraversal=function(e){let{pass:t}=e;return t===lr.MOST_DETAILED_PRELOAD||t===lr.MOST_DETAILED_PICK?jY:this.isSkippingLevelOfDetail?nM:$Y};ur.prototype.update=function(e){this.updateForPass(e,e.tilesetPassState)};ur.prototype.updateForPass=function(e,t){this.imageryLayers._update();let n=t.pass;if(n===lr.PRELOAD&&(!this.preloadWhenHidden||this.show)||n===lr.PRELOAD_FLIGHT&&(!this.preloadFlightDestinations||!this.show&&!this.preloadWhenHidden)||n===lr.REQUEST_RENDER_MODE_DEFER_CHECK&&(!this._cullRequestsWhileMoving&&this.foveatedTimeDelay<=0||!this.show))return;let i=e.commandList,o=e.camera,r=e.cullingVolume;t.ready=!1;let s=lr.getPassOptions(n),a=s.ignoreCommands,c=t.commandList??i,d=c.length;if(e.commandList=c,e.camera=t.camera??o,e.cullingVolume=t.cullingVolume??r,s.isRender){let m=this._environmentMapManager;l(this._root)&&(m.position=this.boundingSphere.center),m.update(e)}let u=this._statisticsPerPass[n];(this.show||a)&&(this._pass=n,t.ready=Nyt(this,e,u,s)),a&&(c.length=d),e.commandList=i,e.camera=o,e.cullingVolume=r};ur.prototype.hasExtension=function(e){return l(this._extensionsUsed)?this._extensionsUsed.indexOf(e)>-1:!1};ur.prototype.isDestroyed=function(){return!1};ur.prototype.destroy=function(){if(this._tileDebugLabels=this._tileDebugLabels&&this._tileDebugLabels.destroy(),this._removeClippingPolygonAdded=this._removeClippingPolygonAdded&&this._removeClippingPolygonAdded(),this._removeClippingPolygonRemoved=this._removeClippingPolygonRemoved&&this._removeClippingPolygonRemoved(),this._clippingPlanes=this._clippingPlanes&&this._clippingPlanes.destroy(),this._clippingPolygons=void 0,l(this._root)){let e=$1e;for(e.push(this._root);e.length>0;){let t=e.pop();t.destroy();let n=t.children;for(let i=0;i<n.length;++i)e.push(n[i])}}return this._root=void 0,this._shouldDestroyImageBasedLighting&&!this._imageBasedLighting.isDestroyed()&&this._imageBasedLighting.destroy(),this._imageBasedLighting=void 0,this._environmentMapManager.isDestroyed()||this._environmentMapManager.destroy(),this._environmentMapManager=void 0,this._imageryLayers.isDestroyed()||(this.imageryLayers.layerAdded.removeEventListener(this._imageryLayersListener),this.imageryLayers.layerRemoved.removeEventListener(this._imageryLayersListener),this.imageryLayers.layerMoved.removeEventListener(this._imageryLayersListener),this.imageryLayers.layerShownOrHidden.removeEventListener(this._imageryLayersListener),this._imageryLayers.destroy()),this._imageryLayers=void 0,ue(this)};ur.supportedExtensions={"3DTILES_metadata":!0,"3DTILES_implicit_tiling":!0,"3DTILES_content_gltf":!0,"3DTILES_content_gltf_vector":!0,"3DTILES_multiple_contents":!0,"3DTILES_bounding_volume_S2":!0,"3DTILES_batch_table_hierarchy":!0,"3DTILES_draco_point_compression":!0,MAXAR_content_geojson:!0};ur.checkSupportedExtensions=function(e){for(let t=0;t<e.length;t++)if(!ur.supportedExtensions[e[t]])throw new ae(`Unsupported 3D Tiles Extension: ${e[t]}`)};var Yyt=new gn,Myt=new h,wyt=new h,kyt=new pe;ur.prototype.getHeight=function(e,t){let n=t.ellipsoid;l(n)||(n=ne.WGS84);let i=Yyt,o=n.cartographicToCartesian(e,Myt),r=n.geodeticSurfaceNormal(o,i.direction);i.origin=h.add(o,h.multiplyByScalar(r,2*n.maximumRadius,i.origin),i.origin),i.direction=h.negate(r,i.direction);let s=this.pick(i,t.frameState,wyt,this.maximumHeightQueryGeometricError);if(l(s))return n.cartesianToCartographic(s,kyt)?.height};ur.prototype.updateHeight=function(e,t,n){n=n??ne.WGS84;let i={positionCartographic:e,ellipsoid:n,callback:t,invoked:!1},o=()=>{let r=this._addHeightCallbacks,s=r.length;for(let a=0;a<s;++a)if(r[a]===i){r.splice(a,1);break}i.callback&&(i.callback=void 0)};return this._addHeightCallbacks.push(i),o};var Uyt=new h;ur.prototype.pick=function(e,t,n,i){if(!t.context.webgl2&&!this._enablePick)return;let o=this._selectedTiles,r=o.length,s=[],a=e.origin.x,c=e.origin.y,d=e.origin.z,u=e.direction.x,m=e.direction.y,p=e.direction.z,b=u*u+m*m+p*p;for(let S=0;S<r;++S){let Z=o[S];if(l(i)&&Z.geometricError>i||!l(Z.content))continue;let R=Z.contentBoundingVolume.boundingSphere,C=R.center,E=a-C.x,A=c-C.y,L=d-C.z,F=2*(u*E+m*A+p*L),I=E*E+A*A+L*L-R.radius*R.radius;F*F-4*b*I<0||s.push(Z)}let f=s.length,y,_=Number.POSITIVE_INFINITY;for(let S=0;S<f;++S){let R=s[S].content.pick(e,t,Uyt);if(l(R)){let C=h.distanceSquared(R,e.origin);C<_&&(_=C,y=h.clone(R,n))}}return y};ur.prototype.isGltfExtensionUsed=function(e){if(this.hasExtension("3DTILES_content_gltf")){if(!l(this.extensions))return!1;let t=this.extensions["3DTILES_content_gltf"]?.extensionsUsed;return l(t)?t.indexOf(e)>-1:!1}return!1};ur.prototype.isGltfExtensionRequired=function(e){if(this.isGltfExtensionUsed(e)){let t=this.extensions["3DTILES_content_gltf"].extensionsRequired;return l(t)?t.indexOf(e)>-1:!1}return!1};var Hr=ur;var Dyt=new P;function zx(e,t){t.collectionChanged.addEventListener(zx.prototype._onCollectionChanged,this),this._scene=e,this._primitives=e.primitives,this._entityCollection=t,this._tilesetHash={},this._entitiesToVisualize=new kt,this._onCollectionChanged(t,t.values,[],[])}zx.prototype.update=function(e){let t=this._entitiesToVisualize.values,n=this._tilesetHash,i=this._primitives;for(let o=0,r=t.length;o<r;o++){let s=t[o],a=s._tileset,c,d=n[s.id],u=s.isShowing&&s.isAvailable(e)&&j.getValueOrDefault(a._show,e,!0),m;u&&(m=s.computeModelMatrix(e,Dyt),c=ve.createIfNeeded(j.getValueOrUndefined(a._uri,e)));let p=l(d)?d.tilesetPrimitive:void 0;if(!u){l(p)&&(p.show=!1);continue}(!l(d)||c.url!==d.url)&&(l(p)&&i.removeAndDestroy(p),delete n[s.id],Oyt(c,n,s,i)),l(p)&&(p.show=!0,l(m)&&(p.modelMatrix=m),p.maximumScreenSpaceError=j.getValueOrDefault(a.maximumScreenSpaceError,e,p.maximumScreenSpaceError))}return!0};zx.prototype.isDestroyed=function(){return!1};zx.prototype.destroy=function(){this._entityCollection.collectionChanged.removeEventListener(zx.prototype._onCollectionChanged,this);let e=this._entitiesToVisualize.values,t=this._tilesetHash,n=this._primitives;for(let i=e.length-1;i>-1;i--)Wee(this,e[i],t,n);return ue(this)};zx.prototype.getBoundingSphere=function(e,t){let n=this._tilesetHash[e.id];if(!l(n)||n.loadFail)return Wt.FAILED;let i=n.tilesetPrimitive;return l(i)?i.show?(me.clone(i.boundingSphere,t),Wt.DONE):Wt.FAILED:Wt.PENDING};zx.prototype._onCollectionChanged=function(e,t,n,i){let o,r,s=this._entitiesToVisualize,a=this._tilesetHash,c=this._primitives;for(o=t.length-1;o>-1;o--)r=t[o],l(r._tileset)&&s.set(r.id,r);for(o=i.length-1;o>-1;o--)r=i[o],l(r._tileset)?s.set(r.id,r):(Wee(this,r,a,c),s.remove(r.id));for(o=n.length-1;o>-1;o--)r=n[o],Wee(this,r,a,c),s.remove(r.id)};function Wee(e,t,n,i){let o=n[t.id];l(o)&&(l(o.tilesetPrimitive)&&i.removeAndDestroy(o.tilesetPrimitive),delete n[t.id])}async function Oyt(e,t,n,i){t[n.id]={url:e.url,loadFail:!1};try{let o=await Hr.fromUrl(e);if(o.id=n,i.add(o),!l(t[n.id]))return;t[n.id].tilesetPrimitive=o}catch(o){console.error(o),t[n.id].loadFail=!0}}var iM=zx;var T5i=x(T(),1);var Cki=x(T(),1);function mZ(e,t,n){this._callback=void 0,this._isConstant=void 0,this._referenceFrame=n??Oi.FIXED,this._definitionChanged=new Se,this.setCallback(e,t)}Object.defineProperties(mZ.prototype,{isConstant:{get:function(){return this._isConstant}},definitionChanged:{get:function(){return this._definitionChanged}},referenceFrame:{get:function(){return this._referenceFrame}}});var Byt=new Q;mZ.prototype.getValue=function(e,t){return l(e)||(e=Q.now(Byt)),this.getValueInReferenceFrame(e,Oi.FIXED,t)};mZ.prototype.setCallback=function(e,t){let n=this._callback!==e||this._isConstant!==t;this._callback=e,this._isConstant=t,n&&this._definitionChanged.raiseEvent(this)};mZ.prototype.getValueInReferenceFrame=function(e,t,n){let i=this._callback(e,n);return Qh.convertToReferenceFrame(e,i,this._referenceFrame,t,n)};mZ.prototype.equals=function(e){return this===e||e instanceof mZ&&this._callback===e._callback&&this._isConstant===e._isConstant&&this._referenceFrame===e._referenceFrame};var oM=mZ;var qki=x(T(),1);var Oki=x(T(),1);var Xki=x(T(),1);function Iee(e,t){return Q.compare(e.start,t.start)}function Vs(e){if(this._intervals=[],this._changedEvent=new Se,l(e)){let t=e.length;for(let n=0;n<t;n++)this.addInterval(e[n])}}Object.defineProperties(Vs.prototype,{changedEvent:{get:function(){return this._changedEvent}},start:{get:function(){let e=this._intervals;return e.length===0?void 0:e[0].start}},isStartIncluded:{get:function(){let e=this._intervals;return e.length===0?!1:e[0].isStartIncluded}},stop:{get:function(){let e=this._intervals,t=e.length;return t===0?void 0:e[t-1].stop}},isStopIncluded:{get:function(){let e=this._intervals,t=e.length;return t===0?!1:e[t-1].isStopIncluded}},length:{get:function(){return this._intervals.length}},isEmpty:{get:function(){return this._intervals.length===0}}});Vs.prototype.equals=function(e,t){if(this===e)return!0;if(!(e instanceof Vs))return!1;let n=this._intervals,i=e._intervals,o=n.length;if(o!==i.length)return!1;for(let r=0;r<o;r++)if(!Cn.equals(n[r],i[r],t))return!1;return!0};Vs.prototype.get=function(e){return this._intervals[e]};Vs.prototype.removeAll=function(){this._intervals.length>0&&(this._intervals.length=0,this._changedEvent.raiseEvent(this))};Vs.prototype.findIntervalContainingDate=function(e){let t=this.indexOf(e);return t>=0?this._intervals[t]:void 0};Vs.prototype.findDataForIntervalContainingDate=function(e){let t=this.indexOf(e);return t>=0?this._intervals[t].data:void 0};Vs.prototype.contains=function(e){return this.indexOf(e)>=0};var vee=new Cn;Vs.prototype.indexOf=function(e){let t=this._intervals;vee.start=e,vee.stop=e;let n=Eo(t,vee,Iee);return n>=0?t[n].isStartIncluded?n:n>0&&t[n-1].stop.equals(e)&&t[n-1].isStopIncluded?n-1:~n:(n=~n,n>0&&n-1<t.length&&Cn.contains(t[n-1],e)?n-1:~n)};Vs.prototype.findInterval=function(e){e=e??B.EMPTY_OBJECT;let t=e.start,n=e.stop,i=e.isStartIncluded,o=e.isStopIncluded,r=this._intervals;for(let s=0,a=r.length;s<a;s++){let c=r[s];if((!l(t)||c.start.equals(t))&&(!l(n)||c.stop.equals(n))&&(!l(i)||c.isStartIncluded===i)&&(!l(o)||c.isStopIncluded===o))return r[s]}};Vs.prototype.addInterval=function(e,t){if(e.isEmpty)return;let n=this._intervals;if(n.length===0||Q.greaterThan(e.start,n[n.length-1].stop)){n.push(e),this._changedEvent.raiseEvent(this);return}let i=Eo(n,e,Iee);i<0?i=~i:i>0&&e.isStartIncluded&&n[i-1].isStartIncluded&&n[i-1].start.equals(e.start)?--i:i<n.length&&!e.isStartIncluded&&n[i].isStartIncluded&&n[i].start.equals(e.start)&&++i;let o;for(i>0&&(o=Q.compare(n[i-1].stop,e.start),(o>0||o===0&&(n[i-1].isStopIncluded||e.isStartIncluded))&&((l(t)?t(n[i-1].data,e.data):n[i-1].data===e.data)?(Q.greaterThan(e.stop,n[i-1].stop)?e=new Cn({start:n[i-1].start,stop:e.stop,isStartIncluded:n[i-1].isStartIncluded,isStopIncluded:e.isStopIncluded,data:e.data}):e=new Cn({start:n[i-1].start,stop:n[i-1].stop,isStartIncluded:n[i-1].isStartIncluded,isStopIncluded:n[i-1].isStopIncluded||e.stop.equals(n[i-1].stop)&&e.isStopIncluded,data:e.data}),n.splice(i-1,1),--i):(o=Q.compare(n[i-1].stop,e.stop),(o>0||o===0&&n[i-1].isStopIncluded&&!e.isStopIncluded)&&n.splice(i,0,new Cn({start:e.stop,stop:n[i-1].stop,isStartIncluded:!e.isStopIncluded,isStopIncluded:n[i-1].isStopIncluded,data:n[i-1].data})),n[i-1]=new Cn({start:n[i-1].start,stop:e.start,isStartIncluded:n[i-1].isStartIncluded,isStopIncluded:!e.isStartIncluded,data:n[i-1].data}))));i<n.length&&(o=Q.compare(e.stop,n[i].start),o>0||o===0&&(e.isStopIncluded||n[i].isStartIncluded));)if(l(t)?t(n[i].data,e.data):n[i].data===e.data)e=new Cn({start:e.start,stop:Q.greaterThan(n[i].stop,e.stop)?n[i].stop:e.stop,isStartIncluded:e.isStartIncluded,isStopIncluded:Q.greaterThan(n[i].stop,e.stop)?n[i].isStopIncluded:e.isStopIncluded,data:e.data}),n.splice(i,1);else if(n[i]=new Cn({start:e.stop,stop:n[i].stop,isStartIncluded:!e.isStopIncluded,isStopIncluded:n[i].isStopIncluded,data:n[i].data}),n[i].isEmpty)n.splice(i,1);else break;n.splice(i,0,e),this._changedEvent.raiseEvent(this)};Vs.prototype.removeInterval=function(e){if(e.isEmpty)return!1;let t=this._intervals,n=Eo(t,e,Iee);n<0&&(n=~n);let i=!1;for(n>0&&(Q.greaterThan(t[n-1].stop,e.start)||t[n-1].stop.equals(e.start)&&t[n-1].isStopIncluded&&e.isStartIncluded)&&(i=!0,(Q.greaterThan(t[n-1].stop,e.stop)||t[n-1].isStopIncluded&&!e.isStopIncluded&&t[n-1].stop.equals(e.stop))&&t.splice(n,0,new Cn({start:e.stop,stop:t[n-1].stop,isStartIncluded:!e.isStopIncluded,isStopIncluded:t[n-1].isStopIncluded,data:t[n-1].data})),t[n-1]=new Cn({start:t[n-1].start,stop:e.start,isStartIncluded:t[n-1].isStartIncluded,isStopIncluded:!e.isStartIncluded,data:t[n-1].data})),n<t.length&&!e.isStartIncluded&&t[n].isStartIncluded&&e.start.equals(t[n].start)&&(i=!0,t.splice(n,0,new Cn({start:t[n].start,stop:t[n].start,isStartIncluded:!0,isStopIncluded:!0,data:t[n].data})),++n);n<t.length&&Q.greaterThan(e.stop,t[n].stop);)i=!0,t.splice(n,1);return n<t.length&&e.stop.equals(t[n].stop)&&(i=!0,!e.isStopIncluded&&t[n].isStopIncluded?n+1<t.length&&t[n+1].start.equals(e.stop)&&t[n].data===t[n+1].data?(t.splice(n,1),t[n]=new Cn({start:t[n].start,stop:t[n].stop,isStartIncluded:!0,isStopIncluded:t[n].isStopIncluded,data:t[n].data})):t[n]=new Cn({start:e.stop,stop:e.stop,isStartIncluded:!0,isStopIncluded:!0,data:t[n].data}):t.splice(n,1)),n<t.length&&(Q.greaterThan(e.stop,t[n].start)||e.stop.equals(t[n].start)&&e.isStopIncluded&&t[n].isStartIncluded)&&(i=!0,t[n]=new Cn({start:e.stop,stop:t[n].stop,isStartIncluded:!e.isStopIncluded,isStopIncluded:t[n].isStopIncluded,data:t[n].data})),i&&this._changedEvent.raiseEvent(this),i};Vs.prototype.intersect=function(e,t,n){let i=new Vs,o=0,r=0,s=this._intervals,a=e._intervals;for(;o<s.length&&r<a.length;){let c=s[o],d=a[r];if(Q.lessThan(c.stop,d.start))++o;else if(Q.lessThan(d.stop,c.start))++r;else{if(l(n)||l(t)&&t(c.data,d.data)||!l(t)&&d.data===c.data){let u=Cn.intersect(c,d,new Cn,n);u.isEmpty||i.addInterval(u,t)}Q.lessThan(c.stop,d.stop)||c.stop.equals(d.stop)&&!c.isStopIncluded&&d.isStopIncluded?++o:++r}}return i};Vs.fromJulianDateArray=function(e,t){l(t)||(t=new Vs);let n=e.julianDates,i=n.length,o=e.dataCallback,r=e.isStartIncluded??!0,s=e.isStopIncluded??!0,a=e.leadingInterval??!1,c=e.trailingInterval??!1,d,u=0;a&&(++u,d=new Cn({start:ot.MINIMUM_VALUE,stop:n[0],isStartIncluded:!0,isStopIncluded:!r}),d.data=l(o)?o(d,t.length):t.length,t.addInterval(d));for(let m=0;m<i-1;++m){let p=n[m],b=n[m+1];d=new Cn({start:p,stop:b,isStartIncluded:t.length===u?r:!0,isStopIncluded:m===i-2?s:!1}),d.data=l(o)?o(d,t.length):t.length,t.addInterval(d)}return c&&(d=new Cn({start:n[i-1],stop:ot.MAXIMUM_VALUE,isStartIncluded:!s,isStopIncluded:!0}),d.data=l(o)?o(d,t.length):t.length,t.addInterval(d)),t};var bl=new vh,rM=[0,31,28,31,30,31,30,31,31,30,31,30,31];function Fee(e,t,n){l(n)||(n=new Q),Q.toGregorianDate(e,bl);let i=bl.millisecond+t.millisecond,o=bl.second+t.second,r=bl.minute+t.minute,s=bl.hour+t.hour,a=bl.day+t.day,c=bl.month+t.month,d=bl.year+t.year;for(i>=1e3&&(o+=Math.floor(i/1e3),i=i%1e3),o>=60&&(r+=Math.floor(o/60),o=o%60),r>=60&&(s+=Math.floor(r/60),r=r%60),s>=24&&(a+=Math.floor(s/24),s=s%24),rM[2]=Pl(d)?29:28;a>rM[c]||c>=13;)a>rM[c]&&(a-=rM[c],++c),c>=13&&(--c,d+=Math.floor(c/12),c=c%12,++c),rM[2]=Pl(d)?29:28;return bl.millisecond=i,bl.second=o,bl.minute=r,bl.hour=s,bl.day=a,bl.month=c,bl.year=d,Q.fromGregorianDate(bl,n)}var zyt=new Q,Hyt=/P(?:([\d.,]+)Y)?(?:([\d.,]+)M)?(?:([\d.,]+)W)?(?:([\d.,]+)D)?(?:T(?:([\d.,]+)H)?(?:([\d.,]+)M)?(?:([\d.,]+)S)?)?/;function iCe(e,t){if(!l(e)||e.length===0)return!1;if(t.year=0,t.month=0,t.day=0,t.hour=0,t.minute=0,t.second=0,t.millisecond=0,e[0]==="P"){let n=e.match(Hyt);if(!l(n))return!1;if(l(n[1])&&(t.year=Number(n[1].replace(",","."))),l(n[2])&&(t.month=Number(n[2].replace(",","."))),l(n[3])&&(t.day=Number(n[3].replace(",","."))*7),l(n[4])&&(t.day+=Number(n[4].replace(",","."))),l(n[5])&&(t.hour=Number(n[5].replace(",","."))),l(n[6])&&(t.minute=Number(n[6].replace(",","."))),l(n[7])){let i=Number(n[7].replace(",","."));t.second=Math.floor(i),t.millisecond=i%1*1e3}}else e[e.length-1]!=="Z"&&(e+="Z"),Q.toGregorianDate(Q.fromIso8601(e,zyt),t);return t.year||t.month||t.day||t.hour||t.minute||t.second||t.millisecond}var sM=new vh;Vs.fromIso8601=function(e,t){let n=e.iso8601.split("/"),i=Q.fromIso8601(n[0]),o=Q.fromIso8601(n[1]),r=[];if(!iCe(n[2],sM))r.push(i,o);else{let s=Q.clone(i);for(r.push(s);Q.compare(s,o)<0;)s=Fee(s,sM),Q.compare(o,s)<=0&&Q.clone(o,s),r.push(s)}return Vs.fromJulianDateArray({julianDates:r,isStartIncluded:e.isStartIncluded,isStopIncluded:e.isStopIncluded,leadingInterval:e.leadingInterval,trailingInterval:e.trailingInterval,dataCallback:e.dataCallback},t)};Vs.fromIso8601DateArray=function(e,t){return Vs.fromJulianDateArray({julianDates:e.iso8601Dates.map(function(n){return Q.fromIso8601(n)}),isStartIncluded:e.isStartIncluded,isStopIncluded:e.isStopIncluded,leadingInterval:e.leadingInterval,trailingInterval:e.trailingInterval,dataCallback:e.dataCallback},t)};Vs.fromIso8601DurationArray=function(e,t){let n=e.epoch,i=e.iso8601Durations,o=e.relativeToPrevious??!1,r=[],s,a,c=i.length;for(let d=0;d<c;++d)(iCe(i[d],sM)||d===0)&&(o&&l(a)?s=Fee(a,sM):s=Fee(n,sM),r.push(s),a=s);return Vs.fromJulianDateArray({julianDates:r,isStartIncluded:e.isStartIncluded,isStopIncluded:e.isStopIncluded,leadingInterval:e.leadingInterval,trailingInterval:e.trailingInterval,dataCallback:e.dataCallback},t)};var Es=Vs;function Kyt(e,t,n,i){function o(){n.raiseEvent(e)}let r=[];t.removeAll();let s=i.length;for(let a=0;a<s;a++){let c=i.get(a);l(c.data)&&r.indexOf(c.data)===-1&&t.add(c.data.definitionChanged,o)}}function hZ(){this._eventHelper=new kr,this._definitionChanged=new Se,this._intervals=new Es,this._intervals.changedEvent.addEventListener(hZ.prototype._intervalsChanged,this)}Object.defineProperties(hZ.prototype,{isConstant:{get:function(){return this._intervals.isEmpty}},definitionChanged:{get:function(){return this._definitionChanged}},intervals:{get:function(){return this._intervals}}});var Jyt=new Q;hZ.prototype.getValue=function(e,t){l(e)||(e=Q.now(Jyt));let n=this._intervals.findDataForIntervalContainingDate(e);if(l(n))return n.getValue(e,t)};hZ.prototype.equals=function(e){return this===e||e instanceof hZ&&this._intervals.equals(e._intervals,j.equals)};hZ.prototype._intervalsChanged=function(){Kyt(this,this._eventHelper,this._definitionChanged,this._intervals),this._definitionChanged.raiseEvent(this)};var gl=hZ;function Hx(e){this._referenceFrame=e??Oi.FIXED,this._definitionChanged=new Se,this._composite=new gl,this._composite.definitionChanged.addEventListener(Hx.prototype._raiseDefinitionChanged,this)}Object.defineProperties(Hx.prototype,{isConstant:{get:function(){return this._composite.isConstant}},definitionChanged:{get:function(){return this._definitionChanged}},intervals:{get:function(){return this._composite.intervals}},referenceFrame:{get:function(){return this._referenceFrame},set:function(e){this._referenceFrame=e}}});var jyt=new Q;Hx.prototype.getValue=function(e,t){return l(e)||(e=Q.now(jyt)),this.getValueInReferenceFrame(e,Oi.FIXED,t)};Hx.prototype.getValueInReferenceFrame=function(e,t,n){let i=this._composite._intervals.findDataForIntervalContainingDate(e);if(l(i))return i.getValueInReferenceFrame(e,t,n)};Hx.prototype.equals=function(e){return this===e||e instanceof Hx&&this._referenceFrame===e._referenceFrame&&this._composite.equals(e._composite,j.equals)};Hx.prototype._raiseDefinitionChanged=function(){this._definitionChanged.raiseEvent(this)};var pc=Hx;var eUi=x(T(),1),oCe={WHOLE:0,PORTIONS:1};Object.freeze(oCe);var c0=oCe;var sUi=x(T(),1);function rCe(e,t,n){let i=new WeakRef(t),o=e.addEventListener(function(){let r=i.deref();l(r)?n.apply(r,arguments):o()});return o}function fZ(e){let t=e._targetProperty;if(!l(t)){let n=e._targetEntity;if(!l(n)){if(n=e._targetCollection.getById(e._targetId),!l(n)){e._targetEntity=e._targetProperty=void 0;return}e._removeTargetListener=rCe(n.definitionChanged,e,ch.prototype._onTargetEntityDefinitionChanged),e._targetEntity=n}let i=e._targetPropertyNames;t=e._targetEntity;for(let o=0,r=i.length;o<r&&l(t);++o)t=t[i[o]];e._targetProperty=t}return t}function ch(e,t,n){this._targetCollection=e,this._targetId=t,this._targetPropertyNames=n,this._targetProperty=void 0,this._targetEntity=void 0,this._definitionChanged=new Se,this._removeTargetListener=void 0,rCe(e.collectionChanged,this,ch.prototype._onCollectionChanged)}Object.defineProperties(ch.prototype,{isConstant:{get:function(){return j.isConstant(fZ(this))}},definitionChanged:{get:function(){return this._definitionChanged}},referenceFrame:{get:function(){let e=fZ(this);return l(e)?e.referenceFrame:void 0}},targetId:{get:function(){return this._targetId}},targetCollection:{get:function(){return this._targetCollection}},targetPropertyNames:{get:function(){return this._targetPropertyNames}},resolvedProperty:{get:function(){return fZ(this)}}});ch.fromString=function(e,t){let n,i=[],o=!0,r=!1,s="";for(let a=0;a<t.length;++a){let c=t.charAt(a);r?(s+=c,r=!1):c==="\\"?r=!0:o&&c==="#"?(n=s,o=!1,s=""):!o&&c==="."?(i.push(s),s=""):s+=c}return i.push(s),new ch(e,n,i)};var Qyt=new Q;ch.prototype.getValue=function(e,t){let n=fZ(this);return l(e)||(e=Q.now(Qyt)),l(n)?n.getValue(e,t):void 0};ch.prototype.getValueInReferenceFrame=function(e,t,n){let i=fZ(this);return l(i)?i.getValueInReferenceFrame(e,t,n):void 0};ch.prototype.getType=function(e){let t=fZ(this);return l(t)?t.getType(e):void 0};ch.prototype.equals=function(e){if(this===e)return!0;let t=this._targetPropertyNames,n=e._targetPropertyNames;if(this._targetCollection!==e._targetCollection||this._targetId!==e._targetId||t.length!==n.length)return!1;let i=this._targetPropertyNames.length;for(let o=0;o<i;o++)if(t[o]!==n[o])return!1;return!0};ch.prototype._onTargetEntityDefinitionChanged=function(e,t,n,i){l(this._targetProperty)&&this._targetPropertyNames[0]===t&&(this._targetProperty=void 0,this._definitionChanged.raiseEvent(this))};ch.prototype._onCollectionChanged=function(e,t,n){let i=this._targetEntity;l(i)&&n.indexOf(i)!==-1?(this._removeTargetListener(),this._removeTargetListener=void 0,this._targetEntity=this._targetProperty=void 0):l(i)||(i=fZ(this),l(i)&&this._definitionChanged.raiseEvent(this))};var Ag=ch;var GUi=x(T(),1);var xUi=x(T(),1);var cUi=x(T(),1),sCe={NONE:0,HOLD:1,EXTRAPOLATE:2,LINEAR_EXTRAPOLATE:3};Object.freeze(sCe);var dd=sCe;var uUi=x(T(),1);var Pee=class{static get type(){return"Linear"}static getRequiredDataPoints(t){return 2}static interpolateOrderZero(t,n,i,o,r){l(r)||(r=new Array(o));let s,a,c,d=n[0],u=n[1];for(s=0;s<o;s++)a=i[s],c=i[s+o],r[s]=((c-a)*t+u*a-d*c)/(u-d);return r}},Kx=Pee;var aCe={packedLength:1,pack:function(e,t,n){n=n??0,t[n]=e},unpack:function(e,t,n){return t=t??0,e[t]}};function cCe(e,t,n){let i,o=e.length,r=n.length,s=o+r;if(e.length=s,o!==t){let a=o-1;for(i=s-1;i>=t;i--)e[i]=e[a--]}for(i=0;i<r;i++)e[t++]=n[i]}function lCe(e,t){return e instanceof Q?e:typeof e=="string"?Q.fromIso8601(e):Q.addSeconds(t,e,new Q)}var Xee=[],Nee=[];function A3(e,t,n,i,o){let r=0,s,a,c,d,u,m;for(;r<i.length;){u=lCe(i[r],e),c=Eo(t,u,Q.compare);let p=0,b=0;if(c<0){for(c=~c,d=c*o,a=void 0,m=t[c];r<i.length&&(u=lCe(i[r],e),!(l(a)&&Q.compare(a,u)>=0||l(m)&&Q.compare(u,m)>=0));){for(Xee[p++]=u,r=r+1,s=0;s<o;s++)Nee[b++]=i[r],r=r+1;a=u}p>0&&(Nee.length=b,cCe(n,d,Nee),Xee.length=p,cCe(t,c,Xee))}else{for(s=0;s<o;s++)r++,n[c*o+s]=i[r];r++}}}function lh(e,t){let n=e;n===Number&&(n=aCe);let i=n.packedLength,o=n.packedInterpolationLength??i,r=0,s;if(l(t)){let a=t.length;s=new Array(a);for(let c=0;c<a;c++){let d=t[c];d===Number&&(d=aCe);let u=d.packedLength;i+=u,o+=d.packedInterpolationLength??u,s[c]=d}r=a}this._type=e,this._innerType=n,this._interpolationDegree=1,this._interpolationAlgorithm=Kx,this._lastInterpolationAlgorithm=Kx,this._numberOfPoints=0,this._times=[],this._values=[],this._xTable=[],this._yTable=[],this._packedLength=i,this._packedInterpolationLength=o,this._updateTableLength=!0,this._interpolationResult=new Array(o),this._definitionChanged=new Se,this._derivativeTypes=t,this._innerDerivativeTypes=s,this._inputOrder=r,this._forwardExtrapolationType=dd.NONE,this._forwardExtrapolationDuration=0,this._backwardExtrapolationType=dd.NONE,this._backwardExtrapolationDuration=0}Object.defineProperties(lh.prototype,{isConstant:{get:function(){return this._values.length===0}},definitionChanged:{get:function(){return this._definitionChanged}},type:{get:function(){return this._type}},derivativeTypes:{get:function(){return this._derivativeTypes}},interpolationDegree:{get:function(){return this._interpolationDegree}},interpolationAlgorithm:{get:function(){return this._interpolationAlgorithm}},forwardExtrapolationType:{get:function(){return this._forwardExtrapolationType},set:function(e){this._forwardExtrapolationType!==e&&(this._forwardExtrapolationType=e,this._definitionChanged.raiseEvent(this))}},forwardExtrapolationDuration:{get:function(){return this._forwardExtrapolationDuration},set:function(e){this._forwardExtrapolationDuration!==e&&(this._forwardExtrapolationDuration=e,this._definitionChanged.raiseEvent(this))}},backwardExtrapolationType:{get:function(){return this._backwardExtrapolationType},set:function(e){this._backwardExtrapolationType!==e&&(this._backwardExtrapolationType=e,this._definitionChanged.raiseEvent(this))}},backwardExtrapolationDuration:{get:function(){return this._backwardExtrapolationDuration},set:function(e){this._backwardExtrapolationDuration!==e&&(this._backwardExtrapolationDuration=e,this._definitionChanged.raiseEvent(this))}}});var qyt=new Q;lh.prototype.getValue=function(e,t){l(e)||(e=Q.now(qyt));let n=this._times,i=n.length;if(i===0)return;let o,r=this._innerType,s=this._values,a=Eo(n,e,Q.compare);var c=!1;if(a<0){if(a=~a,a===0){let A=n[a];if(o=this._backwardExtrapolationDuration,this._backwardExtrapolationType===dd.NONE||o!==0&&Q.secondsDifference(A,e)>o)return;if(this._backwardExtrapolationType===dd.HOLD)return r.unpack(s,0,t);c=this._backwardExtrapolationType===dd.LINEAR_EXTRAPOLATE}if(a>=i){a=i-1;let A=n[a];if(o=this._forwardExtrapolationDuration,this._forwardExtrapolationType===dd.NONE||o!==0&&Q.secondsDifference(e,A)>o)return;if(this._forwardExtrapolationType===dd.HOLD)return a=i-1,r.unpack(s,a*r.packedLength,t);c=this._forwardExtrapolationType===dd.LINEAR_EXTRAPOLATE}let m=this._xTable,p=this._yTable;var d,u;c?(d=Cesium.LinearApproximation,u=1):(d=this._interpolationAlgorithm,u=this._interpolationDegree),this._lastInterpolationAlgorithm!=d&&(this._lastInterpolationAlgorithm=d,this._updateTableLength=!0);let b=this._packedInterpolationLength,f=this._inputOrder;if(this._updateTableLength){this._updateTableLength=!1;let A=Math.min(d.getRequiredDataPoints(u,f),i);A!==this._numberOfPoints&&(this._numberOfPoints=A,m.length=A,p.length=A*b)}let y=this._numberOfPoints-1;if(y<1)return;let _=0,S=i-1;if(S-_+1>=y+1){let A=a-(y/2|0)-1;A<_&&(A=_);let L=A+y;L>S&&(L=S,A=L-y,A<_&&(A=_)),_=A,S=L}let R=S-_+1;for(let A=0;A<R;++A)m[A]=Q.secondsDifference(n[_+A],n[S]);if(l(r.convertPackedArrayForInterpolation))r.convertPackedArrayForInterpolation(s,_,S,p);else{let A=0,L=this._packedLength,F=_*L,I=(S+1)*L;for(;F<I;)p[A]=s[F],F++,A++}let C=Q.secondsDifference(e,n[S]),E;if(f===0||!l(d.interpolate))E=d.interpolateOrderZero(C,m,p,b,this._interpolationResult);else{let A=Math.floor(b/(f+1));E=d.interpolate(C,m,p,A,f,f,this._interpolationResult)}return l(r.unpackInterpolationResult)?r.unpackInterpolationResult(E,s,_,S,t):r.unpack(E,0,t)}return r.unpack(s,a*this._packedLength,t)};lh.prototype.setInterpolationOptions=function(e){if(!l(e))return;let t=!1,n=e.interpolationAlgorithm,i=e.interpolationDegree;l(n)&&this._interpolationAlgorithm!==n&&(this._interpolationAlgorithm=n,t=!0),l(i)&&this._interpolationDegree!==i&&(this._interpolationDegree=i,t=!0),t&&(this._updateTableLength=!0,this._definitionChanged.raiseEvent(this))};lh.prototype.addSample=function(e,t,n){let i=this._innerDerivativeTypes,o=l(i),r=this._innerType,s=[];if(s.push(e),r.pack(t,s,s.length),o){let a=i.length;for(let c=0;c<a;c++)i[c].pack(n[c],s,s.length)}A3(void 0,this._times,this._values,s,this._packedLength),this._updateTableLength=!0,this._definitionChanged.raiseEvent(this)};lh.prototype.addSamples=function(e,t,n){let i=this._innerDerivativeTypes,o=l(i),r=this._innerType,s=e.length,a=[];for(let c=0;c<s;c++)if(a.push(e[c]),r.pack(t[c],a,a.length),o){let d=n[c],u=i.length;for(let m=0;m<u;m++)i[m].pack(d[m],a,a.length)}A3(void 0,this._times,this._values,a,this._packedLength),this._updateTableLength=!0,this._definitionChanged.raiseEvent(this)};lh.prototype.getSample=function(e){let t=this._times,n=t.length;if(l(n))return e<0&&(e+=n),t[e]};lh.prototype.addSamplesPackedArray=function(e,t){A3(t,this._times,this._values,e,this._packedLength),this._updateTableLength=!0,this._definitionChanged.raiseEvent(this)};lh.prototype.removeSample=function(e){let t=Eo(this._times,e,Q.compare);return t<0?!1:(dCe(this,t,1),!0)};function dCe(e,t,n){let i=e._packedLength;e._times.splice(t,n),e._values.splice(t*i,n*i),e._updateTableLength=!0,e._definitionChanged.raiseEvent(e)}lh.prototype.removeSamples=function(e){let t=this._times,n=Eo(t,e.start,Q.compare);n<0?n=~n:e.isStartIncluded||++n;let i=Eo(t,e.stop,Q.compare);i<0?i=~i:e.isStopIncluded&&++i,dCe(this,n,i-n)};lh.prototype.equals=function(e){if(this===e)return!0;if(!l(e)||this._type!==e._type||this._interpolationDegree!==e._interpolationDegree||this._interpolationAlgorithm!==e._interpolationAlgorithm)return!1;let t=this._derivativeTypes,n=l(t),i=e._derivativeTypes,o=l(i);if(n!==o)return!1;let r,s;if(n){if(s=t.length,s!==i.length)return!1;for(r=0;r<s;r++)if(t[r]!==i[r])return!1}let a=this._times,c=e._times;if(s=a.length,s!==c.length)return!1;for(r=0;r<s;r++)if(!Q.equals(a[r],c[r]))return!1;let d=this._values,u=e._values;for(s=d.length,r=0;r<s;r++)if(d[r]!==u[r])return!1;return!0};lh._mergeNewSamples=A3;var ju=lh;function dh(e,t){t=t??0;let n;if(t>0){n=new Array(t);for(let i=0;i<t;i++)n[i]=h}this._numberOfDerivatives=t,this._property=new ju(h,n),this._definitionChanged=new Se,this._referenceFrame=e??Oi.FIXED,this._property._definitionChanged.addEventListener(function(){this._definitionChanged.raiseEvent(this)},this)}Object.defineProperties(dh.prototype,{isConstant:{get:function(){return this._property.isConstant}},definitionChanged:{get:function(){return this._definitionChanged}},referenceFrame:{get:function(){return this._referenceFrame}},interpolationDegree:{get:function(){return this._property.interpolationDegree}},interpolationAlgorithm:{get:function(){return this._property.interpolationAlgorithm}},numberOfDerivatives:{get:function(){return this._numberOfDerivatives}},forwardExtrapolationType:{get:function(){return this._property.forwardExtrapolationType},set:function(e){this._property.forwardExtrapolationType=e}},forwardExtrapolationDuration:{get:function(){return this._property.forwardExtrapolationDuration},set:function(e){this._property.forwardExtrapolationDuration=e}},backwardExtrapolationType:{get:function(){return this._property.backwardExtrapolationType},set:function(e){this._property.backwardExtrapolationType=e}},backwardExtrapolationDuration:{get:function(){return this._property.backwardExtrapolationDuration},set:function(e){this._property.backwardExtrapolationDuration=e}}});var $yt=new Q;dh.prototype.getValue=function(e,t){return l(e)||(e=Q.now($yt)),this.getValueInReferenceFrame(e,Oi.FIXED,t)};dh.prototype.getValueInReferenceFrame=function(e,t,n){if(n=this._property.getValue(e,n),l(n))return Qh.convertToReferenceFrame(e,n,this._referenceFrame,t,n)};dh.prototype.setInterpolationOptions=function(e){this._property.setInterpolationOptions(e)};dh.prototype.addSample=function(e,t,n){let i=this._numberOfDerivatives;this._property.addSample(e,t,n)};dh.prototype.addSamples=function(e,t,n){this._property.addSamples(e,t,n)};dh.prototype.addSamplesPackedArray=function(e,t){this._property.addSamplesPackedArray(e,t)};dh.prototype.removeSample=function(e){return this._property.removeSample(e)};dh.prototype.removeSamples=function(e){this._property.removeSamples(e)};dh.prototype.equals=function(e){return this===e||e instanceof dh&&j.equals(this._property,e._property)&&this._referenceFrame===e._referenceFrame};var bc=dh;var NUi=x(T(),1);function Jx(e){this._definitionChanged=new Se,this._value=void 0,this._removeSubscription=void 0,this.setValue(e)}Object.defineProperties(Jx.prototype,{isConstant:{get:function(){return j.isConstant(this._value)}},definitionChanged:{get:function(){return this._definitionChanged}},referenceFrame:{get:function(){return l(this._value)?this._value.referenceFrame:Oi.FIXED}}});var ext=new Q;Jx.prototype.getValue=function(e,t){return l(e)||(e=Q.now(ext)),this.getValueInReferenceFrame(e,Oi.FIXED,t)};Jx.prototype.setValue=function(e){this._value!==e&&(this._value=e,l(this._removeSubscription)&&(this._removeSubscription(),this._removeSubscription=void 0),l(e)&&(this._removeSubscription=e.definitionChanged.addEventListener(this._raiseDefinitionChanged,this)),this._definitionChanged.raiseEvent(this))};Jx.prototype.getValueInReferenceFrame=function(e,t,n){if(l(this._value))return n=this._value.getValueInReferenceFrame(e,t,n),l(n)?ne.default.scaleToGeodeticSurface(n,n):void 0};Jx.prototype.equals=function(e){return this===e||e instanceof Jx&&this._value===e._value};Jx.prototype._raiseDefinitionChanged=function(){this._definitionChanged.raiseEvent(this)};var l0=Jx;var zUi=x(T(),1);function jx(e){this._definitionChanged=new Se,this._intervals=new Es,this._intervals.changedEvent.addEventListener(jx.prototype._intervalsChanged,this),this._referenceFrame=e??Oi.FIXED}Object.defineProperties(jx.prototype,{isConstant:{get:function(){return this._intervals.isEmpty}},definitionChanged:{get:function(){return this._definitionChanged}},intervals:{get:function(){return this._intervals}},referenceFrame:{get:function(){return this._referenceFrame}}});var txt=new Q;jx.prototype.getValue=function(e,t){return l(e)||(e=Q.now(txt)),this.getValueInReferenceFrame(e,Oi.FIXED,t)};jx.prototype.getValueInReferenceFrame=function(e,t,n){let i=this._intervals.findDataForIntervalContainingDate(e);if(l(i))return Qh.convertToReferenceFrame(e,i,this._referenceFrame,t,n)};jx.prototype.equals=function(e){return this===e||e instanceof jx&&this._intervals.equals(e._intervals,j.equals)&&this._referenceFrame===e._referenceFrame};jx.prototype._intervalsChanged=function(){this._definitionChanged.raiseEvent(this)};var Gg=jx;var uCe=new q,mCe=new q,hCe=new q,nxt=new h,fCe=new h,ixt=new h,oxt=new h,G3=new Ne,L3=new P,W3=new q;function cM(e,t,n,i,o){if(!(!l(t)||!l(n))){if(h.subtract(t,n,o),l(i.orientation))i.orientation.getValue(e,G3)&&(Ne.conjugate(G3,G3),q.fromQuaternion(G3,W3),q.multiplyByVector(W3,o,o));else if(l(wee(e,i.position,L3)))P.inverse(L3,L3),P.getRotation(L3,W3),q.multiplyByVector(W3,o,o);else return;return o}}function wee(e,t,n){let i=t.getValue(e,nxt);if(l(i)){let o=Q.addSeconds(e,.01,new Q),r=t.getValue(o,fCe);if(l(r)&&!h.equalsEpsilon(i,r,W.EPSILON16)){let s=_t.computeFixedToIcrfMatrix(e,uCe),a=_t.computeFixedToIcrfMatrix(o,mCe),c;!l(s)||!l(a)?(c=_t.computeTemeToPseudoFixedMatrix(e,hCe),s=q.transpose(c,uCe),a=_t.computeTemeToPseudoFixedMatrix(o,mCe),q.transpose(a,a)):c=q.transpose(s,hCe);let d=ixt;h.normalize(i,d),h.normalize(r,r),q.multiplyByVector(s,d,d),q.multiplyByVector(a,r,r);let u=h.cross(d,r,oxt);if(!h.equalsEpsilon(u,h.ZERO,W.EPSILON16)){let m=h.cross(u,d,fCe);return q.multiplyByVector(c,m,m),q.multiplyByVector(c,u,u),q.multiplyByVector(c,d,d),h.normalize(m,m),h.normalize(u,u),h.normalize(d,d),l(n)||(n=new P),n[0]=m.x,n[1]=m.y,n[2]=m.z,n[3]=0,n[4]=u.x,n[5]=u.y,n[6]=u.z,n[7]=0,n[8]=d.x,n[9]=d.y,n[10]=d.z,n[11]=0,n[12]=i.x,n[13]=i.y,n[14]=i.z,n[15]=1,n}}}}var pCe=60,_Ce=1,SCe=new Cn,Yee=new Cn,Mee=new Cn;function bCe(e){this.entity=e,this.polyline=void 0,this.segmentPolylines=[],this.index=void 0,this.updater=void 0}var v3=new h;function rxt(e,t,n,i,o,r,s,a,c){let d,u,m=!1;r instanceof er&&(d=r,u=d.position,r=Oi.FIXED,m=!0);let p=a,b,f;b=e.getValueInReferenceFrame(t,r,c[p]),m?(f=u.getValueInReferenceFrame(t,r,v3),b=cM(t,b,f,d,b),l(b)&&(c[p++]=b)):l(b)&&(c[p++]=b);let y=!l(o)||Q.lessThanOrEquals(o,t)||Q.greaterThanOrEquals(o,n),_=0,S=i.length,Z=i[_],R=n,C=!1,E,A,L;for(;_<S;){if(!y&&Q.greaterThanOrEquals(Z,o)&&(b=e.getValueInReferenceFrame(o,r,c[p]),m?(f=u.getValueInReferenceFrame(o,r,v3),l(b)&&l(f)&&(b=cM(o,b,f,d,b),l(b)&&(c[p++]=b))):l(b)&&(c[p++]=b),y=!0),Q.greaterThan(Z,t)&&Q.lessThan(Z,R)&&!Z.equals(o)&&(b=e.getValueInReferenceFrame(Z,r,c[p]),m?(f=u.getValueInReferenceFrame(Z,r,v3),l(b)&&l(f)&&(b=cM(Z,b,f,d,b),l(b)&&(c[p++]=b))):l(b)&&(c[p++]=b)),_<S-1){if(s>0&&!C){let F=i[_+1],I=Q.secondsDifference(F,Z);C=I>s,C&&(E=Math.ceil(I/s),A=0,L=I/Math.max(E,2),E=Math.max(E-1,1))}if(C&&A<E){Z=Q.addSeconds(Z,L,new Q),A++;continue}}C=!1,_++,Z=i[_]}return b=e.getValueInReferenceFrame(n,r,c[p]),m?(f=u.getValueInReferenceFrame(n,r,v3),l(b)&&l(f)&&(b=cM(n,b,f,d,b),l(b)&&(c[p++]=b))):l(b)&&(c[p++]=b),p}function sxt(e,t,n,i,o,r,s,a){let c,d=0,u=s,m=t,p=!l(i)||Q.lessThanOrEquals(i,t)||Q.greaterThanOrEquals(i,n);for(;Q.lessThan(m,n);)!p&&Q.greaterThanOrEquals(m,i)&&(p=!0,c=e.getValueInReferenceFrame(i,o,a[u]),l(c)&&(a[u]=c,u++)),c=e.getValueInReferenceFrame(m,o,a[u]),l(c)&&(a[u]=c,u++),d++,m=Q.addSeconds(t,r*d,new Q);return c=e.getValueInReferenceFrame(n,o,a[u]),l(c)&&(a[u]=c,u++),u}function axt(e,t,n,i,o,r,s,a){let c,d=0,u=s,m=t,p=Math.max(r,60),b=!l(i)||Q.lessThanOrEquals(i,t)||Q.greaterThanOrEquals(i,n);for(;Q.lessThan(m,n);)!b&&Q.greaterThanOrEquals(m,i)&&(b=!0,c=e.getValueInReferenceFrame(i,o,a[u]),l(c)&&(a[u]=c,u++)),c=e.getValueInReferenceFrame(m,o,a[u]),l(c)&&(a[u]=c,u++),d++,m=Q.addSeconds(t,p*d,new Q);return c=e.getValueInReferenceFrame(n,o,a[u]),l(c)&&(a[u]=c,u++),u}function cxt(e,t,n,i,o,r,s,a){Mee.start=t,Mee.stop=n;let c=s,d=e.intervals;for(let u=0;u<d.length;u++){let m=d.get(u);if(!Cn.intersect(m,Mee,SCe).isEmpty){let p=m.start;m.isStartIncluded||(m.isStopIncluded?p=m.stop:p=Q.addSeconds(m.start,Q.secondsDifference(m.stop,m.start)/2,new Q));let b=e.getValueInReferenceFrame(p,o,a[c]);l(b)&&(a[c]=b,c++)}}return c}function lxt(e,t,n,i,o,r,s,a){let c=e.getValueInReferenceFrame(t,o,a[s]);return l(c)&&(a[s++]=c),s}function dxt(e,t,n,i,o,r,s,a){Yee.start=t,Yee.stop=n;let c=s,d=e.intervals;for(let u=0;u<d.length;u++){let m=d.get(u);if(!Cn.intersect(m,Yee,SCe).isEmpty){let p=m.start,b=m.stop,f=t;Q.greaterThan(p,f)&&(f=p);let y=n;Q.lessThan(b,y)&&(y=b),c=ZCe(m.data,f,y,i,o,r,c,a)}}return c}function ZCe(e,t,n,i,o,r,s,a){for(;e instanceof Ag;)e=e.resolvedProperty;if(e instanceof bc){let c=e._property._times;s=rxt(e,t,n,c,i,o,r,s,a)}else e instanceof oM?s=sxt(e,t,n,i,o,r,s,a):e instanceof pc?s=dxt(e,t,n,i,o,r,s,a):e instanceof Gg?s=cxt(e,t,n,i,o,r,s,a):e instanceof zl||e instanceof l0&&j.isConstant(e)?s=lxt(e,t,n,i,o,r,s,a):s=axt(e,t,n,i,o,r,s,a);return s}function kee(e,t,n,i,o,r,s){l(s)||(s=[]);let a=ZCe(e,t,n,i,o,r,0,s);return s.length=a,s}var gCe=new q,yCe=new Ne,xCe=new q,aM=new Cn,F3=new Cn,pZ=new Cn;function uxt(e){let t=[];if(!l(e))return t;for(let n in e){if(n[0]!=="_"||n==="_definitionChanged"||n.endsWith("Subscription"))continue;let i=e[n];l(i)&&typeof i.getValue=="function"&&!j.isConstant(i)&&t.push(i)}return t}function TCe(e,t,n,i,o,r,s,a,c,d,u){e.sort(Q.compare),e=Yo(e,Q.equalsEpsilon);let m=u;for(let p=0;p<e.length-1;p++){let b=e[p],f=e[p+1];if(!Q.lessThan(b,f))continue;let y=Q.addSeconds(b,Q.secondsDifference(f,b)/2,new Q),_=kee(t,b,f,n,c,a,[]);if(_.length<2)continue;let S=r.segmentPolylines[m];l(S)||(S=s.add(),S.id=o,r.segmentPolylines[m]=S),S.show=!0,S.positions=_,S.material=xr.getValue(y,d,S.material),S.width=j.getValueOrDefault(i._width,n,_Ce),m++}return m}function lM(e,t){this._unusedIndexes=[],this._polylineCollection=new Wf,this._scene=e,this._referenceFrame=t,e.primitives.add(this._polylineCollection)}lM.prototype.update=function(e){let t=this._referenceFrame;if(t===Oi.INERTIAL){let n=_t.computeIcrfToFixedMatrix(e,gCe);l(n)||(n=_t.computeTemeToPseudoFixedMatrix(e,gCe)),P.fromRotationTranslation(n,h.ZERO,this._polylineCollection.modelMatrix)}else if(t instanceof er){let n=t.position.getValue(e);l(t.orientation)?l(t.orientation.getValue(e,yCe))&&(q.fromQuaternion(yCe,xCe),P.fromRotationTranslation(xCe,n,this._polylineCollection.modelMatrix)):wee(e,t.position,this._polylineCollection.modelMatrix)}};lM.prototype.updateObject=function(e,t){let n=t.entity,i=n._path,o=n._position,r,s,a=i._show,c=t.polyline,d=n.isShowing&&n.isAvailable(e)&&(!l(a)||a.getValue(e));if(d){let f=j.getValueOrUndefined(i._leadTime,e),y=j.getValueOrUndefined(i._trailTime,e),_=n._availability,S=l(_),Z=l(f),R=l(y);if(d=S||Z&&R,d){if(R&&(r=Q.addSeconds(e,-y,new Q)),Z&&(s=Q.addSeconds(e,f,new Q)),S){let C=_.start,E=_.stop;(!R||Q.greaterThan(C,r))&&(r=C),(!Z||Q.lessThan(E,s))&&(s=E)}d=Q.lessThan(r,s)}}if(!d){l(c)&&(this._unusedIndexes.push(t.index),t.polyline=void 0,c.show=!1,t.index=void 0);for(let f=0;f<t.segmentPolylines.length;f++)t.segmentPolylines[f].show=!1;return}if(!l(c)){let f=this._unusedIndexes;if(f.length>0){let _=f.pop();c=this._polylineCollection.get(_),t.index=_}else t.index=this._polylineCollection.length,c=this._polylineCollection.add();c.id=n,t.polyline=c}let u=j.getValueOrDefault(i._resolution,e,pCe),m=kee(o,r,s,e,this._referenceFrame,u,c.positions.slice());if(m.length<2){c.show=!1;for(let f=0;f<t.segmentPolylines.length;f++)t.segmentPolylines[f].show=!1;return}c.show=!0,c.positions=m,c.material=xr.getValue(e,i.material,c.material);let p=j.getValueOrUndefined(i.materialMode,e),b=i.material;if(p===c0.PORTIONS&&!b.isConstant){l(c)&&(c.show=!1);let f=u>0?u:pCe,y=b.intervals,_=0;if(l(y)){aM.start=r,aM.stop=s,aM.isStartIncluded=!0,aM.isStopIncluded=!0;for(let S=0;S<y.length;S++){let Z=y.get(S);if(!Cn.intersect(Z,aM,F3))continue;let R=F3.start,C=F3.stop;if(Q.greaterThanOrEquals(R,C))continue;let E=uxt(Z.data),A=[Q.clone(R),Q.clone(C)];for(let L=0;L<E.length;L++){let F=E[L],I=F.intervals;if(l(I))for(let N=0;N<I.length;N++){let g=I.get(N);Cn.intersect(g,F3,pZ)&&(Q.greaterThan(pZ.start,R)&&Q.lessThan(pZ.start,C)&&A.push(Q.clone(pZ.start)),Q.greaterThan(pZ.stop,R)&&Q.lessThan(pZ.stop,C)&&A.push(Q.clone(pZ.stop)))}else if(!j.isConstant(F)){let N=Q.clone(R);for(;Q.lessThan(N,C);)A.push(Q.clone(N)),N=Q.addSeconds(N,f,new Q)}}_=TCe(A,o,e,i,n,t,this._polylineCollection,f,this._referenceFrame,Z.data,_)}}else{let S=[Q.clone(r),Q.clone(s)],Z=Q.addSeconds(r,f,new Q);for(;Q.lessThan(Z,s);)S.push(Q.clone(Z)),Z=Q.addSeconds(Z,f,new Q);_=TCe(S,o,e,i,n,t,this._polylineCollection,f,this._referenceFrame,i.material,_)}for(let S=_;S<t.segmentPolylines.length;S++)l(t.segmentPolylines[S])&&(t.segmentPolylines[S].show=!1)}else for(let f=0;f<t.segmentPolylines.length;f++)t.segmentPolylines[f].show=!1;c.width=j.getValueOrDefault(i._width,e,_Ce),c.distanceDisplayCondition=j.getValueOrUndefined(i._distanceDisplayCondition,e,c.distanceDisplayCondition)};lM.prototype.removeObject=function(e){let t=e.polyline;l(t)&&(this._unusedIndexes.push(e.index),e.polyline=void 0,t.show=!1,t.id=void 0,e.index=void 0);for(let n=0;n<e.segmentPolylines.length;n++)e.segmentPolylines[n].show=!1;e.segmentPolylines.length=0};lM.prototype.destroy=function(){return this._scene.primitives.remove(this._polylineCollection),ue(this)};function d0(e,t){t.collectionChanged.addEventListener(d0.prototype._onCollectionChanged,this),this._scene=e,this._updaters={},this._entityCollection=t,this._items=new kt,this._onCollectionChanged(t,t.values,[],[])}d0.prototype.update=function(e){let t=this._updaters;for(let i in t)t.hasOwnProperty(i)&&t[i].update(e);let n=this._items.values;if(n.length===0&&l(this._updaters)&&Object.keys(this._updaters).length>0){for(let i in t)t.hasOwnProperty(i)&&t[i].destroy();this._updaters={}}for(let i=0,o=n.length;i<o;i++){let r=n[i],s=r.entity,a=s._position,c=s._path,d=r.updater,u=!1,m=Oi.FIXED,p=m.toString();if(this._scene.mode===se.SCENE3D){let f=j.getValueOrUndefined(c.relativeTo,e);l(f)?f==="FIXED"?(m=Oi.FIXED,p=m.toString()):f==="INERTIAL"?(m=Oi.INERTIAL,p=m.toString()):(u=!0,m=this._entityCollection.getById(f),p=f):(m=a.referenceFrame,p=m.toString())}let b=this._updaters[p];if(d===b&&l(b)){b.updateObject(e,r);continue}l(d)&&d.removeObject(r),!(u&&!l(m))&&(l(b)||(b=new lM(this._scene,m),b.update(e),this._updaters[p]=b),r.updater=b,l(b)&&b.updateObject(e,r))}return!0};d0.prototype.isDestroyed=function(){return!1};d0.prototype.destroy=function(){this._entityCollection.collectionChanged.removeEventListener(d0.prototype._onCollectionChanged,this);let e=this._updaters;for(let t in e)e.hasOwnProperty(t)&&e[t].destroy();return ue(this)};d0.prototype._onCollectionChanged=function(e,t,n,i){let o,r,s,a=this._items;for(o=t.length-1;o>-1;o--)r=t[o],l(r._path)&&l(r._position)&&a.set(r.id,new bCe(r));for(o=i.length-1;o>-1;o--)r=i[o],l(r._path)&&l(r._position)?a.contains(r.id)||a.set(r.id,new bCe(r)):(s=a.get(r.id),l(s)&&(l(s.updater)&&s.updater.removeObject(s),a.remove(r.id)));for(o=n.length-1;o>-1;o--)r=n[o],s=a.get(r.id),l(s)&&(l(s.updater)&&s.updater.removeObject(s),a.remove(r.id))};d0._subSample=kee;d0._computeVvlhTransform=wee;d0._transformToEntityFrame=cM;var dM=d0;var N5i=x(T(),1);var RCe=U.WHITE,CCe=U.BLACK,VCe=0,ECe=1,ACe=0,GCe=Ur.NONE,LCe=new U,mxt=new h,WCe=new U,vCe=new Kt,FCe=new Kt,ICe=new Bt;function PCe(e){this.entity=e,this.pointPrimitive=void 0,this.billboard=void 0,this.color=void 0,this.outlineColor=void 0,this.pixelSize=void 0,this.outlineWidth=void 0}function Qx(e,t){t.collectionChanged.addEventListener(Qx.prototype._onCollectionChanged,this),this._cluster=e,this._entityCollection=t,this._items=new kt,this._onCollectionChanged(t,t.values,[],[])}Qx.prototype.update=function(e){let t=this._items.values,n=this._cluster;for(let i=0,o=t.length;i<o;i++){let r=t[i],s=r.entity,a=s._point,c=r.pointPrimitive,d=r.billboard,u=j.getValueOrDefault(a._heightReference,e,He.NONE),m=s.isShowing&&s.isAvailable(e)&&j.getValueOrDefault(a._show,e,!0),p;if(m&&(p=j.getValueOrUndefined(s._position,e,mxt),m=l(p)),!m){uM(r,s,n);continue}j.isConstant(s._position)||(n._clusterDirty=!0);let b=!1,f=!1;if(u!==He.NONE&&!l(d)?(l(c)&&(uM(r,s,n),c=void 0),d=n.getBillboard(s),d.id=s,d.image=void 0,r.billboard=d,b=!0,f=h.equals(d.position,p)&&d.heightReference===u):u===He.NONE&&!l(c)&&(l(d)&&(uM(r,s,n),d=void 0),c=n.getPoint(s),c.id=s,r.pointPrimitive=c),l(c))c.show=!0,c.position=p,c.scaleByDistance=j.getValueOrUndefined(a._scaleByDistance,e,vCe),c.translucencyByDistance=j.getValueOrUndefined(a._translucencyByDistance,e,FCe),c.color=j.getValueOrDefault(a._color,e,RCe,LCe),c.outlineColor=j.getValueOrDefault(a._outlineColor,e,CCe,WCe),c.outlineWidth=j.getValueOrDefault(a._outlineWidth,e,VCe),c.pixelSize=j.getValueOrDefault(a._pixelSize,e,ECe),c.distanceDisplayCondition=j.getValueOrUndefined(a._distanceDisplayCondition,e,ICe),c.disableDepthTestDistance=j.getValueOrDefault(a._disableDepthTestDistance,e,ACe),c.splitDirection=j.getValueOrDefault(a._splitDirection,e,GCe);else if(l(d)){d.show=!0,d.position=p,d.scaleByDistance=j.getValueOrUndefined(a._scaleByDistance,e,vCe),d.translucencyByDistance=j.getValueOrUndefined(a._translucencyByDistance,e,FCe),d.distanceDisplayCondition=j.getValueOrUndefined(a._distanceDisplayCondition,e,ICe),d.disableDepthTestDistance=j.getValueOrDefault(a._disableDepthTestDistance,e,ACe),d.splitDirection=j.getValueOrDefault(a._splitDirection,e,GCe),d.heightReference=u;let y=j.getValueOrDefault(a._color,e,RCe,LCe),_=j.getValueOrDefault(a._outlineColor,e,CCe,WCe),S=Math.round(j.getValueOrDefault(a._outlineWidth,e,VCe)),Z=Math.max(1,Math.round(j.getValueOrDefault(a._pixelSize,e,ECe)));if(S>0?(d.scale=1,b=b||S!==r.outlineWidth||Z!==r.pixelSize||!U.equals(y,r.color)||!U.equals(_,r.outlineColor)):(d.scale=Z/50,Z=50,b=b||S!==r.outlineWidth||!U.equals(y,r.color)||!U.equals(_,r.outlineColor)),b){r.color=U.clone(y,r.color),r.outlineColor=U.clone(_,r.outlineColor),r.pixelSize=Z,r.outlineWidth=S;let R=y.alpha,C=y.toCssColorString(),E=_.toCssColorString(),A=JSON.stringify([C,Z,E,S]);d.setImage(A,JS(R,C,E,S,Z))}f&&d._updateClamping()}}return!0};Qx.prototype.getBoundingSphere=function(e,t){let n=this._items.get(e.id);if(!l(n)||!(l(n.pointPrimitive)||l(n.billboard)))return Wt.FAILED;if(l(n.pointPrimitive))t.center=h.clone(n.pointPrimitive.position,t.center);else{let i=n.billboard;if(i._clampedToSurface)t.center=h.clone(i._clampedPosition,t.center);else{let o=this._cluster._scene,r=this._items,s=zh(o,n,i.position,[i],()=>r.get(e.id)===n);if(s===void 0)return Wt.PENDING;s===null?t.center=h.clone(i.position,t.center):t.center=xb(i.position,s,i.heightReference,o.ellipsoid??ne.default,t.center)}}return t.radius=0,Wt.DONE};Qx.prototype.isDestroyed=function(){return!1};Qx.prototype.destroy=function(){this._entityCollection.collectionChanged.removeEventListener(Qx.prototype._onCollectionChanged,this);let e=this._entityCollection.values;for(let t=0;t<e.length;t++)this._cluster.removePoint(e[t]);return ue(this)};Qx.prototype._onCollectionChanged=function(e,t,n,i){let o,r,s=this._items,a=this._cluster;for(o=t.length-1;o>-1;o--)r=t[o],l(r._point)&&l(r._position)&&s.set(r.id,new PCe(r));for(o=i.length-1;o>-1;o--)r=i[o],l(r._point)&&l(r._position)?s.contains(r.id)||s.set(r.id,new PCe(r)):(uM(s.get(r.id),r,a),s.remove(r.id));for(o=n.length-1;o>-1;o--)r=n[o],uM(s.get(r.id),r,a),s.remove(r.id)};function uM(e,t,n){if(l(e)){let i=e.pointPrimitive;if(l(i)){e.pointPrimitive=void 0,n.removePoint(t);return}let o=e.billboard;l(o)&&(e.billboard=void 0,n.removeBillboard(t))}}var mM=Qx;var mOi=x(T(),1);var FDi=x(T(),1);var iDi=x(T(),1);var wCe=[];function hxt(e,t,n,i,o){let r=wCe;r.length=o;let s,a=n.red,c=n.green,d=n.blue,u=n.alpha,m=i.red,p=i.green,b=i.blue,f=i.alpha;if(U.equals(n,i)){for(s=0;s<o;s++)r[s]=U.clone(n);return r}let y=(m-a)/o,_=(p-c)/o,S=(b-d)/o,Z=(f-u)/o;for(s=0;s<o;s++)r[s]=new U(a+s*y,c+s*_,d+s*S,u+s*Z);return r}function hM(e){e=e??B.EMPTY_OBJECT;let t=e.positions,n=e.colors,i=e.width??1,o=e.colorsPerVertex??!1;this._positions=t,this._colors=n,this._width=i,this._colorsPerVertex=o,this._vertexFormat=Me.clone(e.vertexFormat??Me.DEFAULT),this._arcType=e.arcType??un.GEODESIC,this._granularity=e.granularity??W.RADIANS_PER_DEGREE,this._ellipsoid=ne.clone(e.ellipsoid??ne.default),this._workerName="createPolylineGeometry";let r=1+t.length*h.packedLength;r+=l(n)?1+n.length*U.packedLength:1,this.packedLength=r+ne.packedLength+Me.packedLength+4}hM.pack=function(e,t,n){n=n??0;let i,o=e._positions,r=o.length;for(t[n++]=r,i=0;i<r;++i,n+=h.packedLength)h.pack(o[i],t,n);let s=e._colors;for(r=l(s)?s.length:0,t[n++]=r,i=0;i<r;++i,n+=U.packedLength)U.pack(s[i],t,n);return ne.pack(e._ellipsoid,t,n),n+=ne.packedLength,Me.pack(e._vertexFormat,t,n),n+=Me.packedLength,t[n++]=e._width,t[n++]=e._colorsPerVertex?1:0,t[n++]=e._arcType,t[n]=e._granularity,t};var kCe=ne.clone(ne.UNIT_SPHERE),UCe=new Me,bZ={positions:void 0,colors:void 0,ellipsoid:kCe,vertexFormat:UCe,width:void 0,colorsPerVertex:void 0,arcType:void 0,granularity:void 0};hM.unpack=function(e,t,n){t=t??0;let i,o=e[t++],r=new Array(o);for(i=0;i<o;++i,t+=h.packedLength)r[i]=h.unpack(e,t);o=e[t++];let s=o>0?new Array(o):void 0;for(i=0;i<o;++i,t+=U.packedLength)s[i]=U.unpack(e,t);let a=ne.unpack(e,t,kCe);t+=ne.packedLength;let c=Me.unpack(e,t,UCe);t+=Me.packedLength;let d=e[t++],u=e[t++]===1,m=e[t++],p=e[t];return l(n)?(n._positions=r,n._colors=s,n._ellipsoid=ne.clone(a,n._ellipsoid),n._vertexFormat=Me.clone(c,n._vertexFormat),n._width=d,n._colorsPerVertex=u,n._arcType=m,n._granularity=p,n):(bZ.positions=r,bZ.colors=s,bZ.width=d,bZ.colorsPerVertex=u,bZ.arcType=m,bZ.granularity=p,new hM(bZ))};var XCe=new h,NCe=new h,YCe=new h,MCe=new h;hM.createGeometry=function(e){let t=e._width,n=e._vertexFormat,i=e._colors,o=e._colorsPerVertex,r=e._arcType,s=e._granularity,a=e._ellipsoid,c,d,u,m=[],p=Yo(e._positions,h.equalsEpsilon,!1,m);if(l(i)&&m.length>0){let X=0,Y=m[0];i=i.filter(function(D,M){let O;return o?O=M===Y||M===0&&Y===1:O=M+1===Y,O?(X++,Y=m[X],!1):!0})}let b=p.length;if(b<2||t<=0)return;if(r===un.GEODESIC||r===un.RHUMB){let X,Y;r===un.GEODESIC?(X=W.chordLength(s,a.maximumRadius),Y=io.numberOfPoints):(X=s,Y=io.numberOfPointsRhumbLine);let D=io.extractHeights(p,a);if(l(i)){let M=1;for(c=0;c<b-1;++c)M+=Y(p[c],p[c+1],X);let O=new Array(M),w=0;for(c=0;c<b-1;++c){let z=p[c],K=p[c+1],te=i[c],H=Y(z,K,X);if(o&&c<M){let $=i[c+1],ee=hxt(z,K,te,$,H),le=ee.length;for(d=0;d<le;++d)O[w++]=ee[d]}else for(d=0;d<H;++d)O[w++]=U.clone(te)}O[w]=U.clone(i[i.length-1]),i=O,wCe.length=0}r===un.GEODESIC?p=io.generateCartesianArc({positions:p,minDistance:X,ellipsoid:a,height:D}):p=io.generateCartesianRhumbArc({positions:p,granularity:X,ellipsoid:a,height:D})}b=p.length;let f=b*4-4,y=new Float64Array(f*3),_=new Float64Array(f*3),S=new Float64Array(f*3),Z=new Float32Array(f*2),R=n.st?new Float32Array(f*2):void 0,C=l(i)?new Uint8Array(f*4):void 0,E=0,A=0,L=0,F=0,I;for(d=0;d<b;++d){d===0?(I=XCe,h.subtract(p[0],p[1],I),h.add(p[0],I,I)):I=p[d-1],h.clone(I,YCe),h.clone(p[d],NCe),d===b-1?(I=XCe,h.subtract(p[b-1],p[b-2],I),h.add(p[b-1],I,I)):I=p[d+1],h.clone(I,MCe);let X,Y;l(C)&&(d!==0&&!o?X=i[d-1]:X=i[d],d!==b-1&&(Y=i[d]));let D=d===0?2:0,M=d===b-1?2:4;for(u=D;u<M;++u){h.pack(NCe,y,E),h.pack(YCe,_,E),h.pack(MCe,S,E),E+=3;let O=u-2<0?-1:1;if(Z[A++]=2*(u%2)-1,Z[A++]=O*t,n.st&&(R[L++]=d/(b-1),R[L++]=Math.max(Z[A-2],0)),l(C)){let w=u<2?X:Y;C[F++]=U.floatToByte(w.red),C[F++]=U.floatToByte(w.green),C[F++]=U.floatToByte(w.blue),C[F++]=U.floatToByte(w.alpha)}}}let N=new Rn;N.position=new Xe({componentDatatype:J.DOUBLE,componentsPerAttribute:3,values:y}),N.prevPosition=new Xe({componentDatatype:J.DOUBLE,componentsPerAttribute:3,values:_}),N.nextPosition=new Xe({componentDatatype:J.DOUBLE,componentsPerAttribute:3,values:S}),N.expandAndWidth=new Xe({componentDatatype:J.FLOAT,componentsPerAttribute:2,values:Z}),n.st&&(N.st=new Xe({componentDatatype:J.FLOAT,componentsPerAttribute:2,values:R})),l(C)&&(N.color=new Xe({componentDatatype:J.UNSIGNED_BYTE,componentsPerAttribute:4,values:C,normalize:!0}));let g=Oe.createTypedArray(f,b*6-6),V=0,G=0,v=b-1;for(d=0;d<v;++d)g[G++]=V,g[G++]=V+2,g[G++]=V+1,g[G++]=V+1,g[G++]=V+2,g[G++]=V+3,V+=4;return new At({attributes:N,indices:g,primitiveType:Ie.TRIANGLES,boundingSphere:me.fromPoints(p),geometryType:_m.POLYLINES})};var Lg=hM;var fxt=new mi(0),I3={},DCe=new U,pxt=new Qt(U.WHITE),bxt=new mi(!0),gxt=new mi(Wn.DISABLED),yxt=new mi(new Bt),xxt=new mi(ti.BOTH);function Txt(){this.vertexFormat=void 0,this.positions=void 0,this.width=void 0,this.arcType=void 0,this.granularity=void 0}function _xt(){this.positions=void 0,this.width=void 0,this.arcType=void 0,this.granularity=void 0}function Nf(e,t){this._entity=e,this._scene=t,this._entitySubscription=e.definitionChanged.addEventListener(Nf.prototype._onEntityPropertyChanged,this),this._fillEnabled=!1,this._dynamic=!1,this._geometryChanged=new Se,this._showProperty=void 0,this._materialProperty=void 0,this._shadowsProperty=void 0,this._distanceDisplayConditionProperty=void 0,this._classificationTypeProperty=void 0,this._depthFailMaterialProperty=void 0,this._geometryOptions=new Txt,this._groundGeometryOptions=new _xt,this._id=`polyline-${e.id}`,this._clampToGround=!1,this._supportsPolylinesOnTerrain=er.supportsPolylinesOnTerrain(t),this._zIndex=0,this._onEntityPropertyChanged(e,"polyline",e.polyline,void 0)}Object.defineProperties(Nf.prototype,{id:{get:function(){return this._id}},entity:{get:function(){return this._entity}},fillEnabled:{get:function(){return this._fillEnabled}},hasConstantFill:{get:function(){return!this._fillEnabled||!l(this._entity.availability)&&j.isConstant(this._showProperty)}},fillMaterialProperty:{get:function(){return this._materialProperty}},depthFailMaterialProperty:{get:function(){return this._depthFailMaterialProperty}},outlineEnabled:{value:!1},hasConstantOutline:{value:!0},outlineColorProperty:{value:void 0},shadowsProperty:{get:function(){return this._shadowsProperty}},distanceDisplayConditionProperty:{get:function(){return this._distanceDisplayConditionProperty}},classificationTypeProperty:{get:function(){return this._classificationTypeProperty}},isDynamic:{get:function(){return this._dynamic}},isClosed:{value:!1},geometryChanged:{get:function(){return this._geometryChanged}},arcType:{get:function(){return this._arcType}},clampToGround:{get:function(){return this._clampToGround&&this._supportsPolylinesOnTerrain}},zIndex:{get:function(){return this._zIndex}}});Nf.prototype.isOutlineVisible=function(e){return!1};Nf.prototype.isFilled=function(e){let t=this._entity;return(this._fillEnabled&&t.isAvailable(e)&&this._showProperty.getValue(e))??!1};Nf.prototype.createFillGeometryInstance=function(e){let t=this._entity,n=t.isAvailable(e),i=new vn(n&&t.isShowing&&this._showProperty.getValue(e)),o=this._distanceDisplayConditionProperty.getValue(e),r=ii.fromDistanceDisplayCondition(o),s={show:i,distanceDisplayCondition:r},a;return this._materialProperty instanceof Qt&&(l(this._materialProperty.color)&&(this._materialProperty.color.isConstant||n)&&(a=this._materialProperty.color.getValue(e,DCe)),l(a)||(a=U.WHITE),s.color=$t.fromColor(a)),this.clampToGround?new Yt({id:t,geometry:new __(this._groundGeometryOptions),attributes:s}):(l(this._depthFailMaterialProperty)&&this._depthFailMaterialProperty instanceof Qt&&(l(this._depthFailMaterialProperty.color)&&(this._depthFailMaterialProperty.color.isConstant||n)&&(a=this._depthFailMaterialProperty.color.getValue(e,DCe)),l(a)||(a=U.WHITE),s.depthFailColor=$t.fromColor(a)),new Yt({id:t,geometry:new Lg(this._geometryOptions),attributes:s}))};Nf.prototype.createOutlineGeometryInstance=function(e){};Nf.prototype.isDestroyed=function(){return!1};Nf.prototype.destroy=function(){this._entitySubscription(),ue(this)};Nf.prototype._onEntityPropertyChanged=function(e,t,n,i){if(!(t==="availability"||t==="polyline"))return;let o=this._entity.polyline;if(!l(o)){this._fillEnabled&&(this._fillEnabled=!1,this._geometryChanged.raiseEvent(this));return}let r=o.positions,s=o.show;if(l(s)&&s.isConstant&&!s.getValue(ot.MINIMUM_VALUE)||!l(r)){this._fillEnabled&&(this._fillEnabled=!1,this._geometryChanged.raiseEvent(this));return}let a=o.zIndex,c=o.material??pxt,d=c instanceof Qt;this._materialProperty=c,this._depthFailMaterialProperty=o.depthFailMaterial,this._showProperty=s??bxt,this._shadowsProperty=o.shadows??gxt,this._distanceDisplayConditionProperty=o.distanceDisplayCondition??yxt,this._classificationTypeProperty=o.classificationType??xxt,this._fillEnabled=!0,this._zIndex=a??fxt;let u=o.width,m=o.arcType,p=o.clampToGround,b=o.granularity;if(!r.isConstant||!j.isConstant(u)||!j.isConstant(m)||!j.isConstant(b)||!j.isConstant(p)||!j.isConstant(a))this._dynamic||(this._dynamic=!0,this._geometryChanged.raiseEvent(this));else{let f=this._geometryOptions,y=r.getValue(ot.MINIMUM_VALUE,f.positions);if(!l(y)||y.length<2){this._fillEnabled&&(this._fillEnabled=!1,this._geometryChanged.raiseEvent(this));return}let _;d&&(!l(this._depthFailMaterialProperty)||this._depthFailMaterialProperty instanceof Qt)?_=Ms.VERTEX_FORMAT:_=rc.VERTEX_FORMAT,f.vertexFormat=_,f.positions=y,f.width=l(u)?u.getValue(ot.MINIMUM_VALUE):void 0,f.arcType=l(m)?m.getValue(ot.MINIMUM_VALUE):void 0,f.granularity=l(b)?b.getValue(ot.MINIMUM_VALUE):void 0;let S=this._groundGeometryOptions;S.positions=y,S.width=f.width,S.arcType=f.arcType,S.granularity=f.granularity,this._clampToGround=l(p)?p.getValue(ot.MINIMUM_VALUE):!1,!this._clampToGround&&l(a)&&xt("Entity polylines must have clampToGround: true when using zIndex. zIndex will be ignored."),this._dynamic=!1,this._geometryChanged.raiseEvent(this)}};Nf.prototype.createDynamicUpdater=function(e,t){return new fM(e,t,this)};var BV={positions:void 0,granularity:void 0,height:void 0,ellipsoid:void 0};function fM(e,t,n){this._line=void 0,this._primitives=e,this._groundPrimitives=t,this._groundPolylinePrimitive=void 0,this._material=void 0,this._geometryUpdater=n,this._positions=[]}function OCe(e){if(l(e._line))return e._line;let t=e._primitives,n=e._geometryUpdater._scene.id+t._guid,i=I3[n];!l(i)||i.isDestroyed()?(i=new Wf,I3[n]=i,t.add(i)):t.contains(i)||t.add(i);let o=i.add();return o.id=e._geometryUpdater._entity,e._line=o,o}fM.prototype.update=function(e){let t=this._geometryUpdater,n=t._entity,i=n.polyline,o=i.positions,r=j.getValueOrUndefined(o,e,this._positions);t._clampToGround=j.getValueOrDefault(i._clampToGround,e,!1),t._groundGeometryOptions.positions=r,t._groundGeometryOptions.width=j.getValueOrDefault(i._width,e,1),t._groundGeometryOptions.arcType=j.getValueOrDefault(i._arcType,e,un.GEODESIC),t._groundGeometryOptions.granularity=j.getValueOrDefault(i._granularity,e,9999);let s=this._groundPrimitives;if(l(this._groundPolylinePrimitive)&&(s.remove(this._groundPolylinePrimitive),this._groundPolylinePrimitive=void 0),t.clampToGround){if(!n.isShowing||!n.isAvailable(e)||!j.getValueOrDefault(i._show,e,!0)||!l(r)||r.length<2)return;let m=t.fillMaterialProperty,p;if(m instanceof Qt)p=new Ms;else{let b=xr.getValue(e,m,this._material);p=new rc({material:b,translucent:b.isTranslucent()}),this._material=b}this._groundPolylinePrimitive=s.add(new Oh({geometryInstances:t.createFillGeometryInstance(e),appearance:p,classificationType:t.classificationTypeProperty.getValue(e),asynchronous:!1}),j.getValueOrUndefined(t.zIndex,e)),l(this._line)&&(this._line.show=!1);return}let a=OCe(this);if(!n.isShowing||!n.isAvailable(e)||!j.getValueOrDefault(i._show,e,!0)){a.show=!1;return}if(!l(r)||r.length<2){a.show=!1;return}let c=un.GEODESIC;c=j.getValueOrDefault(i._arcType,e,c);let d=t._scene.globe,u=t._scene.ellipsoid;c!==un.NONE&&l(d)&&(BV.ellipsoid=u,BV.positions=r,BV.granularity=j.getValueOrUndefined(i._granularity,e),BV.height=io.extractHeights(r,u),c===un.GEODESIC?r=io.generateCartesianArc(BV):r=io.generateCartesianRhumbArc(BV)),a.show=!0,a.positions=r.slice(),a.material=xr.getValue(e,t.fillMaterialProperty,a.material),a.width=j.getValueOrDefault(i._width,e,1),a.distanceDisplayCondition=j.getValueOrUndefined(i._distanceDisplayCondition,e,a.distanceDisplayCondition)};fM.prototype.getBoundingSphere=function(e){if(this._geometryUpdater.clampToGround){let t=this._groundPolylinePrimitive;if(l(t)&&t.show&&t.ready){let n=t.getGeometryInstanceAttributes(this._geometryUpdater._entity);if(l(n)&&l(n.boundingSphere))return me.clone(n.boundingSphere,e),Wt.DONE}return l(t)&&!t.ready?Wt.PENDING:Wt.DONE}else{let t=OCe(this);if(t.show&&t.positions.length>0)return me.fromPoints(t.positions,e),Wt.DONE}return Wt.FAILED};fM.prototype.isDestroyed=function(){return!1};fM.prototype.destroy=function(){let t=this._geometryUpdater._scene.id+this._primitives._guid,n=I3[t];l(n)&&(n.remove(this._line),n.length===0&&(this._primitives.removeAndDestroy(n),delete I3[t])),l(this._groundPolylinePrimitive)&&this._groundPrimitives.remove(this._groundPolylinePrimitive),ue(this)};var pM=Nf;var JDi=x(T(),1);var Sxt=new U,Zxt=new Bt,Rxt=new Bt;function Yf(e,t,n,i,o){let r;n instanceof Qt?r=Ms:r=rc,this.orderedGroundPrimitives=e,this.classificationType=t,this.appearanceType=r,this.materialProperty=n,this.updaters=new kt,this.createPrimitive=!0,this.primitive=void 0,this.oldPrimitive=void 0,this.geometry=new kt,this.material=void 0,this.updatersWithAttributes=new kt,this.attributes=new kt,this.invalidated=!1,this.removeMaterialSubscription=n.definitionChanged.addEventListener(Yf.prototype.onMaterialChanged,this),this.subscriptions=new kt,this.showsUpdated=new kt,this.zIndex=i,this._asynchronous=o}Yf.prototype.onMaterialChanged=function(){this.invalidated=!0};Yf.prototype.isMaterial=function(e){let t=this.materialProperty,n=e.fillMaterialProperty;return n===t||n instanceof Qt&&t instanceof Qt?!0:l(t)&&t.equals(n)};Yf.prototype.add=function(e,t,n){let i=t.id;if(this.updaters.set(i,t),this.geometry.set(i,n),!t.hasConstantFill||!t.fillMaterialProperty.isConstant||!j.isConstant(t.distanceDisplayConditionProperty))this.updatersWithAttributes.set(i,t);else{let o=this;this.subscriptions.set(i,t.entity.definitionChanged.addEventListener(function(r,s,a,c){s==="isShowing"&&o.showsUpdated.set(t.id,t)}))}this.createPrimitive=!0};Yf.prototype.remove=function(e){let t=e.id;if(this.createPrimitive=this.geometry.remove(t)||this.createPrimitive,this.updaters.remove(t)){this.updatersWithAttributes.remove(t);let n=this.subscriptions.get(t);return l(n)&&(n(),this.subscriptions.remove(t),this.showsUpdated.remove(t)),!0}return!1};Yf.prototype.update=function(e){let t=!0,n=this.primitive,i=this.orderedGroundPrimitives,o=this.geometry.values,r;if(this.createPrimitive){if(o.length>0){l(n)&&(l(this.oldPrimitive)?i.remove(n):this.oldPrimitive=n);let a=this.appearanceType;n=new Oh({show:!1,asynchronous:this._asynchronous,geometryInstances:o.slice(),appearance:new a,classificationType:this.classificationType}),this.appearanceType===rc&&(this.material=xr.getValue(e,this.materialProperty,this.material),n.appearance.material=this.material),i.add(n,this.zIndex),t=!1}else{l(n)&&(i.remove(n),n=void 0);let a=this.oldPrimitive;l(a)&&(i.remove(a),this.oldPrimitive=void 0)}this.attributes.removeAll(),this.primitive=n,this.createPrimitive=!1}else if(l(n)&&n.ready){n.show=!0,l(this.oldPrimitive)&&(i.remove(this.oldPrimitive),this.oldPrimitive=void 0),this.appearanceType===rc&&(this.material=xr.getValue(e,this.materialProperty,this.material),this.primitive.appearance.material=this.material);let s=this.updatersWithAttributes.values,a=s.length;for(r=0;r<a;r++){let c=s[r],d=c.entity,u=this.geometry.get(c.id),m=this.attributes.get(u.id.id);if(l(m)||(m=n.getGeometryInstanceAttributes(u.id),this.attributes.set(u.id.id,m)),!c.fillMaterialProperty.isConstant){let y=c.fillMaterialProperty.color,_=j.getValueOrDefault(y,e,U.WHITE,Sxt);U.equals(m._lastColor,_)||(m._lastColor=U.clone(_,m._lastColor),m.color=$t.toValue(_,m.color))}let p=d.isShowing&&(c.hasConstantFill||c.isFilled(e)),b=m.show[0]===1;p!==b&&(m.show=vn.toValue(p,m.show));let f=c.distanceDisplayConditionProperty;if(!j.isConstant(f)){let y=j.getValueOrDefault(f,e,Rxt,Zxt);Bt.equals(y,m._lastDistanceDisplayCondition)||(m._lastDistanceDisplayCondition=Bt.clone(y,m._lastDistanceDisplayCondition),m.distanceDisplayCondition=ii.toValue(y,m.distanceDisplayCondition))}}this.updateShows(n)}else l(n)&&!n.ready&&(t=!1);return t};Yf.prototype.updateShows=function(e){let t=this.showsUpdated.values,n=t.length;for(let i=0;i<n;i++){let o=t[i],r=o.entity,s=this.geometry.get(o.id),a=this.attributes.get(s.id.id);l(a)||(a=e.getGeometryInstanceAttributes(s.id),this.attributes.set(s.id.id,a));let c=r.isShowing,d=a.show[0]===1;c!==d&&(a.show=vn.toValue(c,a.show),s.attributes.show.value[0]=a.show[0])}this.showsUpdated.removeAll()};Yf.prototype.contains=function(e){return this.updaters.contains(e.id)};Yf.prototype.getBoundingSphere=function(e,t){let n=this.primitive;if(!n.ready)return Wt.PENDING;let i=n.getGeometryInstanceAttributes(e.entity);return!l(i)||!l(i.boundingSphere)||l(i.show)&&i.show[0]===0?Wt.FAILED:(i.boundingSphere.clone(t),Wt.DONE)};Yf.prototype.destroy=function(){let e=this.primitive,t=this.orderedGroundPrimitives;l(e)&&t.remove(e);let n=this.oldPrimitive;l(n)&&t.remove(n),this.removeMaterialSubscription()};function zV(e,t,n){this._items=[],this._orderedGroundPrimitives=e,this._classificationType=t,this._asynchronous=n??!0}zV.prototype.add=function(e,t){let n=this._items,i=n.length,o=t.createFillGeometryInstance(e),r=j.getValueOrDefault(t.zIndex,0);for(let a=0;a<i;++a){let c=n[a];if(c.isMaterial(t)&&c.zIndex===r){c.add(e,t,o);return}}let s=new Yf(this._orderedGroundPrimitives,this._classificationType,t.fillMaterialProperty,r,this._asynchronous);s.add(e,t,o),n.push(s)};zV.prototype.remove=function(e){let t=this._items,n=t.length;for(let i=n-1;i>=0;i--){let o=t[i];if(o.remove(e)){o.updaters.length===0&&(t.splice(i,1),o.destroy());break}}};zV.prototype.update=function(e){let t,n=this._items,i=n.length;for(t=i-1;t>=0;t--){let r=n[t];if(r.invalidated){n.splice(t,1);let s=r.updaters.values,a=s.length;for(let c=0;c<a;c++)this.add(e,s[c]);r.destroy()}}let o=!0;for(t=0;t<n.length;t++)o=n[t].update(e)&&o;return o};zV.prototype.getBoundingSphere=function(e,t){let n=this._items,i=n.length;for(let o=0;o<i;o++){let r=n[o];if(r.contains(e))return r.getBoundingSphere(e,t)}return Wt.FAILED};zV.prototype.removeAllPrimitives=function(){let e=this._items,t=e.length;for(let n=0;n<t;n++)e[n].destroy();this._items.length=0};var bM=zV;var Cxt=[];function BCe(e,t){let n=e._batches,i=n.length;for(let o=0;o<i;o++)n[o].remove(t)}function zCe(e,t,n){if(n.isDynamic){e._dynamicBatch.add(t,n);return}if(n.clampToGround&&n.fillEnabled){let s=n.classificationTypeProperty.getValue(t);e._groundBatches[s].add(t,n);return}let i;n.fillEnabled&&(i=n.shadowsProperty.getValue(t));let o=0;l(n.depthFailMaterialProperty)&&(o=n.depthFailMaterialProperty instanceof Qt?1:2);let r;l(i)&&(r=i+o*Wn.NUMBER_OF_SHADOW_MODES),n.fillEnabled&&(n.fillMaterialProperty instanceof Qt?e._colorBatches[r].add(t,n):e._materialBatches[r].add(t,n))}function u0(e,t,n,i){i=i??e.groundPrimitives,n=n??e.primitives,this._scene=e,this._primitives=n,this._entityCollection=void 0,this._addedObjects=new kt,this._removedObjects=new kt,this._changedObjects=new kt;let o,r=Wn.NUMBER_OF_SHADOW_MODES;for(this._colorBatches=new Array(r*3),this._materialBatches=new Array(r*3),o=0;o<r;++o)this._colorBatches[o]=new Um(n,Ms,void 0,!1,o),this._materialBatches[o]=new Dm(n,rc,void 0,!1,o),this._colorBatches[o+r]=new Um(n,Ms,Ms,!1,o),this._materialBatches[o+r]=new Dm(n,rc,Ms,!1,o),this._colorBatches[o+r*2]=new Um(n,Ms,rc,!1,o),this._materialBatches[o+r*2]=new Dm(n,rc,rc,!1,o);this._dynamicBatch=new B_(n,i);let s=ti.NUMBER_OF_CLASSIFICATION_TYPES;for(this._groundBatches=new Array(s),o=0;o<s;++o)this._groundBatches[o]=new bM(i,o);this._batches=this._colorBatches.concat(this._materialBatches,this._dynamicBatch,this._groundBatches),this._subscriptions=new kt,this._updaters=new kt,this._entityCollection=t,t.collectionChanged.addEventListener(u0.prototype._onCollectionChanged,this),this._onCollectionChanged(t,t.values,Cxt)}u0.prototype.update=function(e){let t=this._addedObjects,n=t.values,i=this._removedObjects,o=i.values,r=this._changedObjects,s=r.values,a,c,d,u;for(a=s.length-1;a>-1;a--)c=s[a],d=c.id,u=this._updaters.get(d),u.entity===c?(BCe(this,u),zCe(this,e,u)):(o.push(c),n.push(c));for(a=o.length-1;a>-1;a--)c=o[a],d=c.id,u=this._updaters.get(d),BCe(this,u),u.destroy(),this._updaters.remove(d),this._subscriptions.get(d)(),this._subscriptions.remove(d);for(a=n.length-1;a>-1;a--)c=n[a],d=c.id,u=new pM(c,this._scene),this._updaters.set(d,u),zCe(this,e,u),this._subscriptions.set(d,u.geometryChanged.addEventListener(u0._onGeometryChanged,this));t.removeAll(),i.removeAll(),r.removeAll();let m=!0,p=this._batches,b=p.length;for(a=0;a<b;a++)m=p[a].update(e)&&m;return m};var Vxt=[],Ext=new me;u0.prototype.getBoundingSphere=function(e,t){let n=Vxt,i=Ext,o=0,r,s=this._batches,a=s.length,c=this._updaters.get(e.id);for(let d=0;d<a;d++){if(r=s[d].getBoundingSphere(c,i),r===Wt.PENDING)return Wt.PENDING;r===Wt.DONE&&(n[o]=me.clone(i,n[o]),o++)}return o===0?Wt.FAILED:(n.length=o,me.fromBoundingSpheres(n,t),Wt.DONE)};u0.prototype.isDestroyed=function(){return!1};u0.prototype.destroy=function(){this._entityCollection.collectionChanged.removeEventListener(u0.prototype._onCollectionChanged,this),this._addedObjects.removeAll(),this._removedObjects.removeAll();let e,t=this._batches,n=t.length;for(e=0;e<n;e++)t[e].removeAllPrimitives();let i=this._subscriptions.values;for(n=i.length,e=0;e<n;e++)i[e]();return this._subscriptions.removeAll(),ue(this)};u0._onGeometryChanged=function(e){let t=this._removedObjects,n=this._changedObjects,i=e.entity,o=i.id;!l(t.get(o))&&!l(n.get(o))&&n.set(o,i)};u0.prototype._onCollectionChanged=function(e,t,n){let i=this._addedObjects,o=this._removedObjects,r=this._changedObjects,s,a,c;for(s=n.length-1;s>-1;s--)c=n[s],a=c.id,i.remove(a)||(o.set(a,c),r.remove(a));for(s=t.length-1;s>-1;s--)c=t[s],a=c.id,o.remove(a)?r.set(a,c):i.set(a,c)};var gM=u0;function qd(e){Bl.initializeTerrainHeights(),Oh.initializeTerrainHeights();let t=e.scene,n=e.dataSourceCollection;this._eventHelper=new kr,this._eventHelper.add(n.dataSourceAdded,this._onDataSourceAdded,this),this._eventHelper.add(n.dataSourceRemoved,this._onDataSourceRemoved,this),this._eventHelper.add(n.dataSourceMoved,this._onDataSourceMoved,this),this._eventHelper.add(t.postRender,this._postRender,this),this._dataSourceCollection=n,this._scene=t,this._visualizersCallback=e.visualizersCallback??qd.defaultVisualizersCallback;let i=!1,o=new Qc,r=new Qc;n.length>0&&(t.primitives.add(o),t.groundPrimitives.add(r),i=!0),this._primitives=o,this._groundPrimitives=r;for(let d=0,u=n.length;d<u;d++)this._onDataSourceAdded(n,n.get(d));let s=new LF;this._onDataSourceAdded(void 0,s),this._defaultDataSource=s;let a,c;if(!i){let d=this,u=function(){t.primitives.add(o),t.groundPrimitives.add(r),a(),c(),d._removeDefaultDataSourceListener=void 0,d._removeDataSourceCollectionListener=void 0};a=s.entities.collectionChanged.addEventListener(u),c=n.dataSourceAdded.addEventListener(u)}this._removeDefaultDataSourceListener=a,this._removeDataSourceCollectionListener=c,this._ready=!1}var HV=[];qd.registerVisualizer=function(e){HV.includes(e)||HV.push(e)};qd.unregisterVisualizer=function(e){if(HV.includes(e)){let t=HV.indexOf(e);HV.splice(t,1)}};qd.defaultVisualizersCallback=function(e,t,n){let i=n.entities;return[new eF(t,i),new LI(e,i,n._primitives,n._groundPrimitives),new WI(t,i),new eY(e,i),new iM(e,i),new mM(t,i),new dM(e,i),new gM(e,i,n._primitives,n._groundPrimitives),...HV.map(o=>new o(e,i))]};Object.defineProperties(qd.prototype,{scene:{get:function(){return this._scene}},dataSources:{get:function(){return this._dataSourceCollection}},defaultDataSource:{get:function(){return this._defaultDataSource}},ready:{get:function(){return this._ready}}});qd.prototype.isDestroyed=function(){return!1};qd.prototype.destroy=function(){this._eventHelper.removeAll();let e=this._dataSourceCollection;for(let t=0,n=e.length;t<n;++t)this._onDataSourceRemoved(this._dataSourceCollection,e.get(t));return this._onDataSourceRemoved(void 0,this._defaultDataSource),l(this._removeDefaultDataSourceListener)?(this._removeDefaultDataSourceListener(),this._removeDataSourceCollectionListener()):(this._scene.primitives.remove(this._primitives),this._scene.groundPrimitives.remove(this._groundPrimitives)),ue(this)};qd.prototype.update=function(e){if(!Pi.initialized)return this._ready=!1,!1;let t=!0,n,i,o,r,s=this._dataSourceCollection,a=s.length;for(n=0;n<a;n++){let c=s.get(n);for(l(c.update)&&(t=c.update(e)&&t),o=c._visualizers,r=o.length,i=0;i<r;i++)t=o[i].update(e)&&t}for(o=this._defaultDataSource._visualizers,r=o.length,i=0;i<r;i++)t=o[i].update(e)&&t;return!this._ready&&t&&this._scene.requestRender(),this._ready=this._ready||t,t};qd.prototype._postRender=function(){let e=this._scene.frameState,t=this._dataSourceCollection,n=t.length;for(let i=0;i<n;i++){let o=t.get(i),r=o.credit;l(r)&&e.creditDisplay.addCreditToNextFrame(r);let s=o._resourceCredits;if(l(s)){let a=s.length;for(let c=0;c<a;c++)e.creditDisplay.addCreditToNextFrame(s[c])}}};var Axt=[],Gxt=new me;qd.prototype.getBoundingSphere=function(e,t,n){if(!this._ready)return Wt.PENDING;let i,o,r=this._defaultDataSource;if(!r.entities.contains(e)){r=void 0;let p=this._dataSourceCollection;for(o=p.length,i=0;i<o;i++){let b=p.get(i);if(b.entities.contains(e)){r=b;break}}}if(!l(r))return Wt.FAILED;let s=Axt,a=Gxt,c=0,d,u=r._visualizers,m=u.length;for(i=0;i<m;i++){let p=u[i];if(l(p.getBoundingSphere)){if(d=u[i].getBoundingSphere(e,a),!t&&d===Wt.PENDING)return Wt.PENDING;d===Wt.DONE&&(s[c]=me.clone(a,s[c]),c++)}}return c===0?Wt.FAILED:(s.length=c,me.fromBoundingSpheres(s,n),Wt.DONE)};qd.prototype._onDataSourceAdded=function(e,t){let n=this._scene,i=this._primitives,o=this._groundPrimitives,r=i.add(new Qc),s=o.add(new $2);t._primitives=r,t._groundPrimitives=s;let a=t.clustering;a._initialize(n),r.add(a),t._visualizers=this._visualizersCallback(n,a,t)};qd.prototype._onDataSourceRemoved=function(e,t){let n=this._primitives,i=this._groundPrimitives,o=t._primitives,r=t._groundPrimitives,s=t.clustering;o.remove(s);let a=t._visualizers,c=a.length;for(let d=0;d<c;d++)a[d].destroy();n.remove(o),i.remove(r),t._visualizers=void 0};qd.prototype._onDataSourceMoved=function(e,t,n){let i=this._primitives,o=this._groundPrimitives,r=e._primitives,s=e._groundPrimitives;t===n+1?(i.raise(r),o.raise(s)):t===n-1?(i.lower(r),o.lower(s)):t===0?(i.lowerToBottom(r),o.lowerToBottom(s),i.raise(r),o.raise(s)):(i.raiseToTop(r),o.raiseToTop(s))};var yM=qd;var tBi=x(T(),1);var wOi=x(T(),1);function KV(e,t){this._position=void 0,this._subscription=void 0,this._definitionChanged=new Se,this._normalize=t??!0,this.position=e}Object.defineProperties(KV.prototype,{isConstant:{get:function(){return j.isConstant(this._position)}},definitionChanged:{get:function(){return this._definitionChanged}},position:{get:function(){return this._position},set:function(e){let t=this._position;t!==e&&(l(t)&&this._subscription(),this._position=e,l(e)&&(this._subscription=e._definitionChanged.addEventListener(function(){this._definitionChanged.raiseEvent(this)},this)),this._definitionChanged.raiseEvent(this))}},normalize:{get:function(){return this._normalize},set:function(e){this._normalize!==e&&(this._normalize=e,this._definitionChanged.raiseEvent(this))}}});var Lxt=new h,HCe=new h,KCe=new Q,Wxt=new Q,Uee=1/60;KV.prototype.getValue=function(e,t){return this._getValue(e,t)};KV.prototype._getValue=function(e,t,n){l(e)||(e=Q.now(Wxt)),l(t)||(t=new h);let i=this._position;if(j.isConstant(i))return this._normalize?void 0:h.clone(h.ZERO,t);let o=i.getValue(e,Lxt),r=i.getValue(Q.addSeconds(e,Uee,KCe),HCe);if(!l(o)||!l(r)&&(r=o,o=i.getValue(Q.addSeconds(e,-Uee,KCe),HCe),!l(o)))return;if(h.equals(o,r))return this._normalize?void 0:h.clone(h.ZERO,t);l(n)&&o.clone(n);let s=h.subtract(r,o,t);return this._normalize?h.normalize(s,t):h.divideByScalar(s,Uee,t)};KV.prototype.equals=function(e){return this===e||e instanceof KV&&j.equals(this._position,e._position)};var Wg=KV;var JCe=new q,jCe=new q,QCe=new q,vxt=new P,P3=new h,qCe=new h,Dee=new h,Oee=new h,$Ce=new h,eVe=new h,Fxt=new Ne,Ixt=new h,Pxt=new q,JV=new Q,Xxt=1.25;function Nxt(e,t,n,i,o,r,s,a,c,d){let u=e.scene.mode,m=o.getValue(c,e._lastCartesian);if(l(m)){let p=!1,b=!1,f,y,_;if(u===se.SCENE3D){Q.addSeconds(c,.001,JV);let L=o.getValue(JV,P3);if(l(L)||(Q.addSeconds(c,-.001,JV),L=o.getValue(JV,P3),b=!0),l(L)){let F=_t.computeFixedToIcrfMatrix(c,JCe),I=_t.computeFixedToIcrfMatrix(JV,jCe),N;!l(F)||!l(I)?(N=_t.computeTemeToPseudoFixedMatrix(c,QCe),F=q.transpose(N,JCe),I=_t.computeTemeToPseudoFixedMatrix(JV,jCe),q.transpose(I,I)):N=q.transpose(F,QCe);let g=q.multiplyByVector(F,m,$Ce),V=q.multiplyByVector(I,L,eVe);h.subtract(g,V,Oee);let G=h.magnitude(Oee)*1e3,v=W.GRAVITATIONALPARAMETER,X=-v/(G*G-2*v/h.magnitude(g));X<0||X>Xxt*d.maximumRadius?(f=qCe,h.normalize(m,f),h.negate(f,f),_=h.clone(h.UNIT_Z,Dee),y=h.cross(_,f,P3),h.magnitude(y)>W.EPSILON7&&(h.normalize(f,f),h.normalize(y,y),_=h.cross(f,y,Dee),h.normalize(_,_),p=!0)):h.equalsEpsilon(m,L,W.EPSILON7)||(_=qCe,h.normalize(g,_),h.normalize(V,V),y=h.cross(_,V,Dee),b&&(y=h.multiplyByScalar(y,-1,y)),h.equalsEpsilon(y,h.ZERO,W.EPSILON7)||(f=h.cross(y,_,P3),q.multiplyByVector(N,f,f),q.multiplyByVector(N,y,y),q.multiplyByVector(N,_,_),h.normalize(f,f),h.normalize(y,y),h.normalize(_,_),p=!0))}}l(e.boundingSphere)&&(m=e.boundingSphere.center);let S,Z,R;i&&(S=h.clone(t.position,Oee),Z=h.clone(t.direction,$Ce),R=h.clone(t.up,eVe));let C=vxt,E;l(s)&&(E=s.getValue(c,Fxt));let A=r.getValue(c,Ixt);if(a===Zb.INERTIAL&&l(E))P.fromTranslationQuaternionRotationScale(m,E,h.ONE,C);else if(a===Zb.VELOCITY&&l(A)){let L=_t.rotationMatrixFromPositionVelocity(m,A,d,Pxt);P.fromRotationTranslation(L,m,C)}else a===Zb.ENU||!p?_t.eastNorthUpToFixedFrame(m,d,C):(C[0]=f.x,C[1]=f.y,C[2]=f.z,C[3]=0,C[4]=y.x,C[5]=y.y,C[6]=y.z,C[7]=0,C[8]=_.x,C[9]=_.y,C[10]=_.z,C[11]=0,C[12]=m.x,C[13]=m.y,C[14]=m.z,C[15]=0);t._setTransform(C),i&&(h.clone(S,t.position),h.clone(Z,t.direction),h.clone(R,t.up),h.cross(Z,R,t.right))}if(n){let p=u===se.SCENE2D||h.equals(e._offset3D,h.ZERO)?void 0:e._offset3D;t.lookAtTransform(t.transform,p)}}function xM(e,t,n){this.entity=e,this.scene=t,this.ellipsoid=n??ne.default,this.boundingSphere=void 0,this._lastEntity=void 0,this._mode=void 0,this._lastCartesian=new h,this._defaultOffset3D=void 0,this._velocityProperty=new Wg(e.position,!0),this._offset3D=new h}Object.defineProperties(xM,{defaultOffset3D:{get:function(){return this._defaultOffset3D},set:function(e){this._defaultOffset3D=h.clone(e,new h)}}});xM.defaultOffset3D=new h(-14e3,3500,3500);var X3=new Am,Yxt=new h;xM.prototype.update=function(e,t){let n=this.scene,i=this.ellipsoid,o=n.mode;if(o===se.MORPHING)return;let r=this.entity,s=r.trackingReferenceFrame,a=r.position;if(!l(a))return;let c=this._velocityProperty,d=r.orientation,u=r!==this._lastEntity,m=o!==this._mode,p=n.camera,b=u||m,f=!0;if(u){let y=r.viewFrom,_=l(y);if(!_&&l(t)){X3.pitch=-W.PI_OVER_FOUR,X3.range=0;let S=a.getValue(e,Yxt);if(l(S)){let Z=2-1/Math.max(1,h.magnitude(S)/i.maximumRadius);X3.pitch*=Z}p.viewBoundingSphere(t,X3),this.boundingSphere=t,b=!1,f=!1}else(!_||!l(y.getValue(e,this._offset3D)))&&h.clone(xM._defaultOffset3D,this._offset3D)}else!m&&this._mode!==se.SCENE2D&&h.clone(p.position,this._offset3D);this._lastEntity=r,this._mode=o,Nxt(this,p,b,f,a,c,d,s,e,i)};var TM=xM;var iBi=x(T(),1);function Mxt(e){return typeof e=="string"&&(e=document.getElementById(e)),e}var Nn=Mxt;var gBi=x(T(),1);var uBi=x(T(),1);var sBi=x(T(),1);async function wxt(e,t,n,i){return l(i)||(i=!1),Dxt(e,t,n,i)}function kxt(e,t,n){let i=e[0],o=i.terrainProvider.requestTileGeometry(i.x,i.y,i.level);if(!o)return!1;let r;return n?r=o.then(nVe(i)):r=o.then(nVe(i)).catch(Oxt(i)),e.shift(),t.push(r),!0}function Uxt(e){return new Promise(function(t){setTimeout(t,e)})}function Bee(e,t,n){return e.length?kxt(e,t,n)?Bee(e,t,n):Uxt(100).then(()=>Bee(e,t,n)):Promise.resolve()}function Dxt(e,t,n,i){let o=e.tilingScheme,r,s=[],a={};for(r=0;r<n.length;++r){let d=o.positionToTileXY(n[r],t);if(!l(d))continue;let u=d.toString();if(!a.hasOwnProperty(u)){let m={x:d.x,y:d.y,level:t,tilingScheme:o,terrainProvider:e,positions:[]};a[u]=m,s.push(m)}a[u].positions.push(n[r])}let c=[];return Bee(s,c,i).then(function(){return Promise.all(c).then(function(){return n})})}function tVe(e,t,n){let i=t.interpolateHeight(n,e.longitude,e.latitude);return i===void 0?!1:(e.height=i,!0)}function nVe(e){let t=e.positions,n=e.tilingScheme.tileXYToRectangle(e.x,e.y,e.level);return function(i){let o=!1;for(let r=0;r<t.length;++r){let s=t[r];if(!tVe(s,i,n)){o=!0;break}}return o?i.createMesh({tilingScheme:e.tilingScheme,x:e.x,y:e.y,level:e.level,throttle:!1}).then(function(){for(let r=0;r<t.length;++r){let s=t[r];tVe(s,i,n)}}):Promise.resolve()}}function Oxt(e){let t=e.positions;return function(){for(let n=0;n<t.length;++n){let i=t[n];i.height=void 0}}}var _M=wxt;var zee=new k;async function iVe(e,t,n){l(n)||(n=!1);let i=[],o=[],r=e.availability,s=[];for(let c=0;c<t.length;++c){let d=t[c],u=r.computeMaximumLevelAtPosition(d);if(o[c]=u,u===0){e.tilingScheme.positionToTileXY(d,1,zee);let p=e.loadTileDataAvailability(zee.x,zee.y,1);l(p)&&s.push(p)}let m=i[u];l(m)||(i[u]=m=[]),m.push(d)}await Promise.all(s),await Promise.all(i.map(function(c,d){if(l(c))return _M(e,d,c,n)}));let a=[];for(let c=0;c<t.length;++c){let d=t[c];r.computeMaximumLevelAtPosition(d)!==o[c]&&a.push(d)}return a.length>0&&await iVe(e,a,n),t}var gZ=iVe;async function Hee(e,t){let n=t.terrainProvider,i=t.mapProjection,o=i.ellipsoid,r,s=t.camera.getRectangleCameraCoordinates(e);if(t.mode===se.SCENE3D?r=o.cartesianToCartographic(s):r=i.unproject(s),!l(n))return r;let a=n.availability;if(!l(a)||t.mode===se.SCENE2D)return r;let c=[re.center(e),re.southeast(e),re.southwest(e),re.northeast(e),re.northwest(e)],d=await Hee._sampleTerrainMostDetailed(n,c),u=!1,m=d.reduce(function(b,f){return l(f.height)?(u=!0,Math.max(f.height,b)):b},-Number.MAX_VALUE),p=r;return u&&(p.height+=m),p}Hee._sampleTerrainMostDetailed=gZ;var yZ=Hee;var vJi=x(T(),1);var J3i=x(T(),1);var w3i=x(T(),1);var xBi=x(T(),1),oVe={NONE:0,LERC:1};Object.freeze(oVe);var uh=oVe;var KBi=x(T(),1);var vBi=x(T(),1);var _Bi=x(T(),1),rVe={NONE:0,BITS12:1};Object.freeze(rVe);var Ka=rVe;var SM=new h,Bxt=new h,mh=new k,zxt=new P,Hxt=new P,Kxt=Math.pow(2,12);function Nc(e,t,n,i,o,r,s,a,c,d){let u=Ka.NONE,m,p;if(l(t)&&l(n)&&l(i)&&l(o)){let b=t.minimum,f=t.maximum,y=h.subtract(f,b,Bxt),_=i-n;Math.max(h.maximumComponent(y),_)<Kxt-1?u=Ka.BITS12:u=Ka.NONE;let Z=P.fromScale(y,zxt);Z=P.setTranslation(Z,b,Z);let R=P.fromScale(h.fromElements(1/y.x,1/y.y,1/y.z,SM),Hxt);R=P.multiplyByTranslation(R,h.negate(b,SM),R),p=P.clone(o,new P);let C=P.getTranslation(o,SM);C=h.subtract(C,e,SM),p=P.setTranslation(p,C,p),p=P.multiply(p,Z,p),m=P.inverseTransformation(o,new P),m=P.multiply(R,m,m),o=P.multiply(o,Z,new P)}this.quantization=u,this.minimumHeight=n,this.maximumHeight=i,this.center=h.clone(e),this.toScaledENU=m,this.fromScaledENU=o,this.matrix=p,this.hasVertexNormals=r??!1,this.hasWebMercatorT=s??!1,this.hasGeodeticSurfaceNormals=a??!1,this.exaggeration=c??1,this.exaggerationRelativeHeight=d??0,this.stride=0,this._offsetGeodeticSurfaceNormal=0,this._offsetVertexNormal=0,this._calculateStrideAndOffsets()}Nc.prototype.encode=function(e,t,n,i,o,r,s,a){let c=i.x,d=i.y;if(this.quantization===Ka.BITS12){n=P.multiplyByPoint(this.toScaledENU,n,SM),n.x=W.clamp(n.x,0,1),n.y=W.clamp(n.y,0,1),n.z=W.clamp(n.z,0,1);let u=this.maximumHeight-this.minimumHeight,m=W.clamp((o-this.minimumHeight)/u,0,1);k.fromElements(n.x,n.y,mh);let p=dn.compressTextureCoordinates(mh);k.fromElements(n.z,m,mh);let b=dn.compressTextureCoordinates(mh);k.fromElements(c,d,mh);let f=dn.compressTextureCoordinates(mh);if(e[t++]=p,e[t++]=b,e[t++]=f,this.hasWebMercatorT){k.fromElements(s,0,mh);let y=dn.compressTextureCoordinates(mh);e[t++]=y}}else e[t++]=n.x-this.center.x,e[t++]=n.y-this.center.y,e[t++]=n.z-this.center.z,e[t++]=o,e[t++]=c,e[t++]=d,this.hasWebMercatorT&&(e[t++]=s);return this.hasVertexNormals&&(e[t++]=dn.octPackFloat(r)),this.hasGeodeticSurfaceNormals&&(e[t++]=a.x,e[t++]=a.y,e[t++]=a.z),t};var Jxt=new h,sVe=new h;Nc.prototype.addGeodeticSurfaceNormals=function(e,t,n){if(this.hasGeodeticSurfaceNormals)return;let i=this.stride,o=e.length/i;this.hasGeodeticSurfaceNormals=!0,this._calculateStrideAndOffsets();let r=this.stride;for(let s=0;s<o;s++){for(let u=0;u<i;u++){let m=s*i+u,p=s*r+u;t[p]=e[m]}let a=this.decodePosition(t,s,Jxt),c=n.geodeticSurfaceNormal(a,sVe),d=s*r+this._offsetGeodeticSurfaceNormal;t[d]=c.x,t[d+1]=c.y,t[d+2]=c.z}};Nc.prototype.removeGeodeticSurfaceNormals=function(e,t){if(!this.hasGeodeticSurfaceNormals)return;let n=this.stride,i=e.length/n;this.hasGeodeticSurfaceNormals=!1,this._calculateStrideAndOffsets();let o=this.stride;for(let r=0;r<i;r++)for(let s=0;s<o;s++){let a=r*n+s,c=r*o+s;t[c]=e[a]}};Nc.prototype.decodePosition=function(e,t,n){if(l(n)||(n=new h),t*=this.stride,this.quantization===Ka.BITS12){let i=dn.decompressTextureCoordinates(e[t],mh);n.x=i.x,n.y=i.y;let o=dn.decompressTextureCoordinates(e[t+1],mh);return n.z=o.x,P.multiplyByPoint(this.fromScaledENU,n,n)}return n.x=e[t],n.y=e[t+1],n.z=e[t+2],h.add(n,this.center,n)};Nc.prototype.getExaggeratedPosition=function(e,t,n){n=this.decodePosition(e,t,n);let i=this.exaggeration,o=this.exaggerationRelativeHeight;if(i!==1&&this.hasGeodeticSurfaceNormals){let s=this.decodeGeodeticSurfaceNormal(e,t,sVe),a=this.decodeHeight(e,t),c=_o.getHeight(a,i,o)-a;n.x+=s.x*c,n.y+=s.y*c,n.z+=s.z*c}return n};Nc.prototype.decodeTextureCoordinates=function(e,t,n){return l(n)||(n=new k),t*=this.stride,this.quantization===Ka.BITS12?dn.decompressTextureCoordinates(e[t+2],n):k.fromElements(e[t+4],e[t+5],n)};Nc.prototype.decodeHeight=function(e,t){return t*=this.stride,this.quantization===Ka.BITS12?dn.decompressTextureCoordinates(e[t+1],mh).y*(this.maximumHeight-this.minimumHeight)+this.minimumHeight:e[t+3]};Nc.prototype.decodeWebMercatorT=function(e,t){return t*=this.stride,this.quantization===Ka.BITS12?dn.decompressTextureCoordinates(e[t+3],mh).x:e[t+6]};Nc.prototype.getOctEncodedNormal=function(e,t,n){t=t*this.stride+this._offsetVertexNormal;let i=e[t]/256,o=Math.floor(i),r=(i-o)*256;return k.fromElements(o,r,n)};Nc.prototype.decodeNormal=function(e,t,n){let i=t*this.stride+this._offsetVertexNormal;return dn.octDecodeFloat(e[i],n)};Nc.prototype.decodeGeodeticSurfaceNormal=function(e,t,n){return t=t*this.stride+this._offsetGeodeticSurfaceNormal,n.x=e[t],n.y=e[t+1],n.z=e[t+2],n};Nc.prototype._calculateStrideAndOffsets=function(){let e=0;this.quantization===Ka.BITS12?e+=3:e+=6,this.hasWebMercatorT&&(e+=1),this.hasVertexNormals&&(this._offsetVertexNormal=e,e+=1),this.hasGeodeticSurfaceNormals&&(this._offsetGeodeticSurfaceNormal=e,e+=3),this.stride=e};var N3={position3DAndHeight:0,textureCoordAndEncodedNormals:1,geodeticSurfaceNormal:2},Y3={compressed0:0,compressed1:1,geodeticSurfaceNormal:2};Nc.prototype.getAttributes=function(e){let t=J.FLOAT,n=J.getSizeInBytes(t),i=this.stride*n,o=0,r=[];function s(a,c){r.push({index:a,vertexBuffer:e,componentDatatype:t,componentsPerAttribute:c,offsetInBytes:o,strideInBytes:i}),o+=c*n}if(this.quantization===Ka.NONE){s(N3.position3DAndHeight,4);let a=2;a+=this.hasWebMercatorT?1:0,a+=this.hasVertexNormals?1:0,s(N3.textureCoordAndEncodedNormals,a),this.hasGeodeticSurfaceNormals&&s(N3.geodeticSurfaceNormal,3)}else{let a=this.hasWebMercatorT||this.hasVertexNormals,c=this.hasWebMercatorT&&this.hasVertexNormals;s(Y3.compressed0,a?4:3),c&&s(Y3.compressed1,1),this.hasGeodeticSurfaceNormals&&s(Y3.geodeticSurfaceNormal,3)}return r};Nc.prototype.getAttributeLocations=function(){return this.quantization===Ka.NONE?N3:Y3};Nc.clone=function(e,t){if(l(e))return l(t)||(t=new Nc),t.quantization=e.quantization,t.minimumHeight=e.minimumHeight,t.maximumHeight=e.maximumHeight,t.center=h.clone(e.center),t.toScaledENU=P.clone(e.toScaledENU),t.fromScaledENU=P.clone(e.fromScaledENU),t.matrix=P.clone(e.matrix),t.hasVertexNormals=e.hasVertexNormals,t.hasWebMercatorT=e.hasWebMercatorT,t.hasGeodeticSurfaceNormals=e.hasGeodeticSurfaceNormals,t.exaggeration=e.exaggeration,t.exaggerationRelativeHeight=e.exaggerationRelativeHeight,t._calculateStrideAndOffsets(),t};var Rr=Nc;var m0={};m0.DEFAULT_STRUCTURE=Object.freeze({heightScale:1,heightOffset:0,elementsPerHeight:1,stride:1,elementMultiplier:256,isBigEndian:!1});var Kee=new h,jxt=new P,Qxt=new h,qxt=new h;m0.computeVertices=function(e){let t=Math.cos,n=Math.sin,i=Math.sqrt,o=Math.atan,r=Math.exp,s=W.PI_OVER_TWO,a=W.toRadians,c=e.heightmap,d=e.width,u=e.height,m=e.skirtHeight,p=m>0,b=e.isGeographic??!0,f=e.ellipsoid??ne.default,y=1/f.maximumRadius,_=re.clone(e.nativeRectangle),S=re.clone(e.rectangle),Z,R,C,E;l(S)?(Z=S.west,R=S.south,C=S.east,E=S.north):b?(Z=a(_.west),R=a(_.south),C=a(_.east),E=a(_.north)):(Z=_.west*y,R=s-2*o(r(-_.south*y)),C=_.east*y,E=s-2*o(r(-_.north*y)));let A=e.relativeToCenter,L=l(A);A=L?A:h.ZERO;let F=e.includeWebMercatorT??!1,I=e.exaggeration??1,N=e.exaggerationRelativeHeight??0,V=I!==1,G=e.structure??m0.DEFAULT_STRUCTURE,v=G.heightScale??m0.DEFAULT_STRUCTURE.heightScale,X=G.heightOffset??m0.DEFAULT_STRUCTURE.heightOffset,Y=G.elementsPerHeight??m0.DEFAULT_STRUCTURE.elementsPerHeight,D=G.stride??m0.DEFAULT_STRUCTURE.stride,M=G.elementMultiplier??m0.DEFAULT_STRUCTURE.elementMultiplier,O=G.isBigEndian??m0.DEFAULT_STRUCTURE.isBigEndian,w=re.computeWidth(_),z=re.computeHeight(_),K=w/(d-1),te=z/(u-1);b||(w*=y,z*=y);let H=f.radiiSquared,$=H.x,ee=H.y,le=H.z,_e=65536,he=-65536,Ze=_t.eastNorthUpToFixedFrame(A,f),ye=P.inverseTransformation(Ze,jxt),Ge,Ae;F&&(Ge=Ti.geodeticLatitudeToMercatorAngle(R),Ae=1/(Ti.geodeticLatitudeToMercatorAngle(E)-Ge));let Fe=Qxt;Fe.x=Number.POSITIVE_INFINITY,Fe.y=Number.POSITIVE_INFINITY,Fe.z=Number.POSITIVE_INFINITY;let tt=qxt;tt.x=Number.NEGATIVE_INFINITY,tt.y=Number.NEGATIVE_INFINITY,tt.z=Number.NEGATIVE_INFINITY;let Be=Number.POSITIVE_INFINITY,je=d*u,qe=m>0?d*2+u*2:0,We=je+qe,Ke=new Array(We),ct=new Array(We),Et=new Array(We),zt=F?new Array(We):[],ut=V?new Array(We):[],bt=0,ht=u,jt=0,st=d;p&&(--bt,++ht,--jt,++st);let pt=1e-5;for(let On=bt;On<ht;++On){let rn=On;rn<0&&(rn=0),rn>=u&&(rn=u-1);let Hn=_.north-te*rn;b?Hn=a(Hn):Hn=s-2*o(r(-Hn*y));let $i=(Hn-R)/(E-R);$i=W.clamp($i,0,1);let Po=On===bt,hr=On===ht-1;m>0&&(Po?Hn+=pt*z:hr&&(Hn-=pt*z));let Is=t(Hn),Hs=n(Hn),or=le*Hs,yi;F&&(yi=(Ti.geodeticLatitudeToMercatorAngle(Hn)-Ge)*Ae);for(let fr=jt;fr<st;++fr){let mo=fr;mo<0&&(mo=0),mo>=d&&(mo=d-1);let Qr=rn*(d*D)+mo*D,Mn;if(Y===1)Mn=c[Qr];else{Mn=0;let qo;if(O)for(qo=0;qo<Y;++qo)Mn=Mn*M+c[Qr+qo];else for(qo=Y-1;qo>=0;--qo)Mn=Mn*M+c[Qr+qo]}Mn=Mn*v+X,he=Math.max(he,Mn),_e=Math.min(_e,Mn);let Ki=_.west+K*mo;b?Ki=a(Ki):Ki=Ki*y;let wi=(Ki-Z)/(C-Z);wi=W.clamp(wi,0,1);let Xo=rn*d+mo;if(m>0){let qo=fr===jt,Gl=fr===st-1,K0=Po||hr||qo||Gl;if((Po||hr)&&(qo||Gl))continue;K0&&(Mn-=m,qo?(Xo=je+(u-rn-1),Ki-=pt*w):hr?Xo=je+u+(d-mo-1):Gl?(Xo=je+u+d+rn,Ki+=pt*w):Po&&(Xo=je+u+d+u+mo))}let Dc=Is*t(Ki),pm=Is*n(Ki),bp=$*Dc,Lh=ee*pm,gp=1/i(bp*Dc+Lh*pm+or*Hs),Ps=bp*gp,$a=Lh*gp,BT=or*gp,si=new h;si.x=Ps+Dc*Mn,si.y=$a+pm*Mn,si.z=BT+Hs*Mn,P.multiplyByPoint(ye,si,Kee),h.minimumByComponent(Kee,Fe,Fe),h.maximumByComponent(Kee,tt,tt),Be=Math.min(Be,Mn),Ke[Xo]=si,Et[Xo]=new k(wi,$i),ct[Xo]=Mn,F&&(zt[Xo]=yi),V&&(ut[Xo]=f.geodeticSurfaceNormal(si))}}let Mi=me.fromPoints(Ke),jn;l(S)&&(jn=nn.fromRectangle(S,_e,he,f));let Si;L&&(Si=new Hh(f).computeHorizonCullingPointPossiblyUnderEllipsoid(A,Ke,_e));let Hi=new Su(Fe,tt,A),Gi=new Rr(A,Hi,Be,he,Ze,!1,F,V,I,N),pi=new Float32Array(We*Gi.stride),Zi=0;for(let On=0;On<We;++On)Zi=Gi.encode(pi,Zi,Ke[On],Et[On],ct[On],void 0,zt[On],ut[On]);return{vertices:pi,maximumHeight:he,minimumHeight:_e,encoding:Gi,boundingSphere3D:Mi,orientedBoundingBox:jn,occludeePointInScaledSpace:Si}};var jV=m0;var QBi=x(T(),1);function qx(){ge.throwInstantiationError()}Object.defineProperties(qx.prototype,{credits:{get:ge.throwInstantiationError},waterMask:{get:ge.throwInstantiationError}});qx.prototype.interpolateHeight=ge.throwInstantiationError;qx.prototype.isChildAvailable=ge.throwInstantiationError;qx.prototype.createMesh=ge.throwInstantiationError;qx.prototype.upsample=ge.throwInstantiationError;qx.prototype.wasCreatedByUpsampling=ge.throwInstantiationError;qx.maximumAsynchronousTasks=5;var $d=qx;var Z3i=x(T(),1);var d3i=x(T(),1);var $xt=3,jee=class{constructor(t,n,i){this._vertices=t,this._indices=n,this._encoding=i,this._inverseTransform=new P,this._needsRebuild=!0,this._rootNode=new Qee}get needsRebuild(){return this._needsRebuild}set needsRebuild(t){this._needsRebuild=t}rayIntersect(t,n,i,o,r){this._needsRebuild&&nTt(this,n);let s=this._inverseTransform,a=tTt;a.origin=P.multiplyByPoint(s,t.origin,a.origin),a.direction=P.multiplyByPointAsVector(s,t.direction,a.direction);let c=[];return cVe(this._rootNode,a,c),aTt(this,c,t,i,o,r)}},eTt=new qn("incrementallyBuildTerrainPicker"),Qee=class e{constructor(){this.x=0,this.y=0,this.level=0,this.aabb=aVe(this.x,this.y,this.level),this.intersectingTriangles=new Uint32Array(0),this.children=[],this.buildingChildren=!1}addChild(t){let n=new e;n.x=this.x*2+(t&1),n.y=this.y*2+(t>>1&1),n.level=this.level+1,n.aabb=aVe(n.x,n.y,n.level),this.children[t]=n}},tTt=new gn,M3=[new h,new h,new h];function nTt(e,t){P.inverse(t,e._inverseTransform),e._needsRebuild=!1;let n=e._indices.length/3,i=new Uint32Array(n);for(let o=0;o<n;++o)i[o]=o;e._rootNode.intersectingTriangles=i,e._rootNode.children.length=0}var iTt=new h,oTt=new h;function aVe(e,t,n){let i=1/Math.pow(2,n),o=h.fromElements(e*i-.5,t*i-.5,-.5,iTt),r=h.fromElements((e+1)*i-.5,(t+1)*i-.5,.5,oTt);return Su.fromCorners(o,r)}function rTt(e,t,n,i,o){h.pack(n[0],e,9*o),h.pack(n[1],e,9*o+3),h.pack(n[2],e,9*o+6),t[o]=i}var sTt=new Ns;function cVe(e,t,n){let i=xi.rayAxisAlignedBoundingBox(t,e.aabb,sTt);if(!l(i))return;if(!e.children.length||e.buildingChildren){n.push({node:e,interval:new Ns(i.start,i.stop)});return}for(let r=0;r<e.children.length;r++)cVe(e.children[r],t,n)}function aTt(e,t,n,i,o,r){let s=t.sort(function(c,d){return c.interval.start-d.interval.start}),a=Number.MAX_VALUE;for(let c=0;c<s.length;c++){let d=s[c],u=cTt(e,n,d.node,i,o,r);if(a=Math.min(u,a),a!==Number.MAX_VALUE)break}if(a!==Number.MAX_VALUE)return gn.getPoint(n,a)}function cTt(e,t,n,i,o,r){let s=Number.MAX_VALUE,a=e._encoding,c=e._indices,d=e._vertices,u=n.intersectingTriangles.length,p=!(n.level>=$xt)&&!n.buildingChildren,b,f;p&&(b=new Float64Array(u*9),f=new Uint32Array(u));for(let y=0;y<u;y++){let _=n.intersectingTriangles[y],S=Jee(a,o,r,t,d,c[3*_],M3[0]),Z=Jee(a,o,r,t,d,c[3*_+1],M3[1]),R=Jee(a,o,r,t,d,c[3*_+2],M3[2]),C=xi.rayTriangleParametric(t,S,Z,R,i);l(C)&&C<s&&C>=0&&(s=C),p&&rTt(b,f,M3,_,y)}if(p){for(let y=0;y<4;y++)n.addChild(y);dTt(e._inverseTransform,n,f,b)}return s}var lTt=new pe;function Jee(e,t,n,i,o,r,s){let a=e.getExaggeratedPosition(o,r,s);if(t===se.SCENE3D)return a;let d=n.ellipsoid.cartesianToCartographic(a,lTt);a=n.project(d,s),a=h.fromElements(a.z,a.x,a.y,s);let u=W.TWO_PI*n.ellipsoid.maximumRadius,m=Math.round((i.origin.y-a.y)/u);return a.y+=m*u,a}async function dTt(e,t,n,i){t.buildingChildren=!0;let o=new Float64Array(16);P.pack(e,o,0);let r=new Float64Array(24);for(let u=0;u<4;u++)h.pack(t.children[u].aabb.minimum,r,u*6),h.pack(t.children[u].aabb.maximum,r,u*6+3);let s={aabbs:r,inverseTransform:o,triangleIndices:n,trianglePositions:i},a=[r.buffer,o.buffer,n.buffer,i.buffer],c=eTt.scheduleTask(s,a);if(!l(c)){t.buildingChildren=!1;return}(await c).intersectingTrianglesArrays.forEach((u,m)=>{l(t.children[m])&&(t.children[m].intersectingTriangles=new Uint32Array(u))}),t.intersectingTriangles=new Uint32Array(0),t.buildingChildren=!1}var ZM=jee;function RM(e,t,n,i,o,r,s,a,c,d,u,m,p,b,f,y,_){this.center=e,this.vertices=t,this.stride=u??6,this.indices=n,this.indexCountWithoutSkirts=i,this.vertexCountWithoutSkirts=o,this.minimumHeight=r,this.maximumHeight=s,this.rectangle=a,this.boundingSphere3D=c,this.occludeePointInScaledSpace=d,this.orientedBoundingBox=m,this.encoding=p,this.westIndicesSouthToNorth=b,this.southIndicesEastToWest=f,this.eastIndicesNorthToSouth=y,this.northIndicesWestToEast=_,this._transform=new P,this._lastPickSceneMode=void 0,this._terrainPicker=new ZM(t,n,p)}RM.prototype.getTransform=function(e,t){return this._lastPickSceneMode===e?this._transform:(this._terrainPicker.needsRebuild=!0,!l(e)||e===se.SCENE3D?uTt(this,this._transform):yTt(this,t,this._transform))};function uTt(e,t){let n=e.encoding.exaggeration,i=e.encoding.exaggerationRelativeHeight,o=_o.getHeight(e.minimumHeight,n,i),r=_o.getHeight(e.maximumHeight,n,i),s=nn.fromRectangle(e.rectangle,o,r,ne.default,e.orientedBoundingBox);return nn.computeTransformation(s,t),P.getScale(t,qee).z<=W.EPSILON16&&(qee.z=1,P.setScale(t,qee,t)),t}var mTt=new h,hTt=new h,fTt=new pe,pTt=new pe,bTt=new h,gTt=new h,qee=new h;function yTt(e,t,n){let i=e.encoding.exaggeration,o=e.encoding.exaggerationRelativeHeight,r=_o.getHeight(e.minimumHeight,i,o),s=_o.getHeight(e.maximumHeight,i,o),a=t.project(pe.fromRadians(e.rectangle.west,e.rectangle.south,0,fTt),mTt),c=t.project(pe.fromRadians(e.rectangle.east,e.rectangle.north,0,pTt),hTt),d=s-r,u=h.fromElements(c.x-a.x,c.y-a.y,d>0?d:1,bTt),m=h.fromElements(a.x+u.x*.5,a.y+u.y*.5,r+u.z*.5,gTt);return P.fromTranslation(m,n),P.setScale(n,u,n),P.multiply(_t.SWIZZLE_3D_TO_2D_MATRIX,n,n),n}RM.prototype.pick=function(e,t,n,i){let o=this._terrainPicker.rayIntersect(e,this.getTransform(n,i),t,n,i);return this._lastPickSceneMode=n,o};RM.prototype.updateExaggeration=function(e,t){this._terrainPicker._vertices=this.vertices,this._terrainPicker.needsRebuild=!0,this._lastPickSceneMode=void 0};RM.prototype.updateSceneMode=function(e){this._terrainPicker.needsRebuild=!0,this._lastPickSceneMode=void 0};var gc=RM;function vg(e){e=e??B.EMPTY_OBJECT,this._buffer=e.buffer,this._width=e.width,this._height=e.height,this._childTileMask=e.childTileMask??15,this._encoding=e.encoding??uh.NONE;let t=jV.DEFAULT_STRUCTURE,n=e.structure;l(n)?n!==t&&(n.heightScale=n.heightScale??t.heightScale,n.heightOffset=n.heightOffset??t.heightOffset,n.elementsPerHeight=n.elementsPerHeight??t.elementsPerHeight,n.stride=n.stride??t.stride,n.elementMultiplier=n.elementMultiplier??t.elementMultiplier,n.isBigEndian=n.isBigEndian??t.isBigEndian):n=t,this._structure=n,this._createdByUpsampling=e.createdByUpsampling??!1,this._waterMask=e.waterMask,this._skirtHeight=void 0,this._bufferType=this._encoding===uh.LERC?Float32Array:this._buffer.constructor,this._mesh=void 0}Object.defineProperties(vg.prototype,{credits:{get:function(){}},waterMask:{get:function(){return this._waterMask}},childTileMask:{get:function(){return this._childTileMask}}});var lVe="createVerticesFromHeightmap",xTt=new qn(lVe),TTt=new qn(lVe,$d.maximumAsynchronousTasks);vg.prototype.createMesh=function(e){e=e??B.EMPTY_OBJECT;let t=e.tilingScheme,n=e.x,i=e.y,o=e.level,r=e.exaggeration??1,s=e.exaggerationRelativeHeight??0,a=e.throttle??!0,c=t.ellipsoid,d=t.tileXYToNativeRectangle(n,i,o),u=t.tileXYToRectangle(n,i,o),m=c.cartographicToCartesian(re.center(u)),p=this._structure,f=Qo.getEstimatedLevelZeroGeometricErrorForAHeightmap(c,this._width,t.getNumberOfXTilesAtLevel(0))/(1<<o);this._skirtHeight=Math.min(f*4,1e3);let _=(a?TTt:xTt).scheduleTask({heightmap:this._buffer,structure:p,includeWebMercatorT:!0,width:this._width,height:this._height,nativeRectangle:d,rectangle:u,relativeToCenter:m,ellipsoid:c,skirtHeight:this._skirtHeight,isGeographic:t.projection instanceof ki,exaggeration:r,exaggerationRelativeHeight:s,encoding:this._encoding});if(!l(_))return;let S=this;return Promise.resolve(_).then(function(Z){let R;S._skirtHeight>0?R=Qo.getRegularGridAndSkirtIndicesAndEdgeIndices(Z.gridWidth,Z.gridHeight):R=Qo.getRegularGridIndicesAndEdgeIndices(Z.gridWidth,Z.gridHeight);let C=Z.gridWidth*Z.gridHeight;return S._mesh=new gc(m,new Float32Array(Z.vertices),R.indices,R.indexCountWithoutSkirts,C,Z.minimumHeight,Z.maximumHeight,u,me.clone(Z.boundingSphere3D),h.clone(Z.occludeePointInScaledSpace),Z.numberOfAttributes,nn.clone(Z.orientedBoundingBox),Rr.clone(Z.encoding),R.westIndicesSouthToNorth,R.southIndicesEastToWest,R.eastIndicesNorthToSouth,R.northIndicesWestToEast),S._buffer=void 0,S._mesh})};vg.prototype._createMeshSync=function(e){let t=e.tilingScheme,n=e.x,i=e.y,o=e.level,r=e.exaggeration??1,s=e.exaggerationRelativeHeight??0,a=t.ellipsoid,c=t.tileXYToNativeRectangle(n,i,o),d=t.tileXYToRectangle(n,i,o),u=a.cartographicToCartesian(re.center(d)),m=this._structure,b=Qo.getEstimatedLevelZeroGeometricErrorForAHeightmap(a,this._width,t.getNumberOfXTilesAtLevel(0))/(1<<o);this._skirtHeight=Math.min(b*4,1e3);let f=jV.computeVertices({heightmap:this._buffer,structure:m,includeWebMercatorT:!0,width:this._width,height:this._height,nativeRectangle:c,rectangle:d,relativeToCenter:u,ellipsoid:a,skirtHeight:this._skirtHeight,isGeographic:t.projection instanceof ki,exaggeration:r,exaggerationRelativeHeight:s});this._buffer=void 0;let y;this._skirtHeight>0?y=Qo.getRegularGridAndSkirtIndicesAndEdgeIndices(this._width,this._height):y=Qo.getRegularGridIndicesAndEdgeIndices(this._width,this._height);let _=f.gridWidth*f.gridHeight;return this._mesh=new gc(u,f.vertices,y.indices,y.indexCountWithoutSkirts,_,f.minimumHeight,f.maximumHeight,d,f.boundingSphere3D,f.occludeePointInScaledSpace,f.encoding.stride,f.orientedBoundingBox,f.encoding,y.westIndicesSouthToNorth,y.southIndicesEastToWest,y.eastIndicesNorthToSouth,y.northIndicesWestToEast),this._mesh};vg.prototype.interpolateHeight=function(e,t,n){let i=this._width,o=this._height,r=this._structure,s=r.stride,a=r.elementsPerHeight,c=r.elementMultiplier,d=r.isBigEndian,u=r.heightOffset,m=r.heightScale,p=l(this._mesh),b=this._encoding===uh.LERC;if(!p&&b)return;let y;if(p){let _=this._mesh.vertices,S=this._mesh.encoding;y=dVe(_,S,u,m,e,i,o,t,n)}else y=_Tt(this._buffer,a,c,s,d,e,i,o,t,n),y=y*m+u;return y};vg.prototype.upsample=function(e,t,n,i,o,r,s){let a=this._mesh;if(!l(a))return;let c=this._width,d=this._height,u=this._structure,m=u.stride,p=new this._bufferType(c*d*m),b=a.vertices,f=a.encoding,y=e.tileXYToRectangle(t,n,i),_=e.tileXYToRectangle(o,r,s),S=u.heightOffset,Z=u.heightScale,R=u.elementsPerHeight,C=u.elementMultiplier,E=u.isBigEndian,A=Math.pow(C,R-1);for(let L=0;L<d;++L){let F=W.lerp(_.north,_.south,L/(d-1));for(let I=0;I<c;++I){let N=W.lerp(_.west,_.east,I/(c-1)),g=dVe(b,f,S,Z,y,c,d,N,F);g=g<u.lowestEncodedHeight?u.lowestEncodedHeight:g,g=g>u.highestEncodedHeight?u.highestEncodedHeight:g,STt(p,R,C,A,m,E,L*c+I,g)}}return Promise.resolve(new vg({buffer:p,width:c,height:d,childTileMask:0,structure:this._structure,createdByUpsampling:!0}))};vg.prototype.isChildAvailable=function(e,t,n,i){let o=2;return n!==e*2&&++o,i!==t*2&&(o-=2),(this._childTileMask&1<<o)!==0};vg.prototype.wasCreatedByUpsampling=function(){return this._createdByUpsampling};function _Tt(e,t,n,i,o,r,s,a,c,d){let u=(c-r.west)*(s-1)/(r.east-r.west),m=(d-r.south)*(a-1)/(r.north-r.south),p=u|0,b=p+1;b>=s&&(b=s-1,p=s-2);let f=m|0,y=f+1;y>=a&&(y=a-1,f=a-2);let _=u-p,S=m-f;f=a-1-f,y=a-1-y;let Z=w3(e,t,n,i,o,f*s+p),R=w3(e,t,n,i,o,f*s+b),C=w3(e,t,n,i,o,y*s+p),E=w3(e,t,n,i,o,y*s+b);return uVe(_,S,Z,R,C,E)}function dVe(e,t,n,i,o,r,s,a,c){let d=(a-o.west)*(r-1)/(o.east-o.west),u=(c-o.south)*(s-1)/(o.north-o.south),m=d|0,p=m+1;p>=r&&(p=r-1,m=r-2);let b=u|0,f=b+1;f>=s&&(f=s-1,b=s-2);let y=d-m,_=u-b;b=s-1-b,f=s-1-f;let S=(t.decodeHeight(e,b*r+m)-n)/i,Z=(t.decodeHeight(e,b*r+p)-n)/i,R=(t.decodeHeight(e,f*r+m)-n)/i,C=(t.decodeHeight(e,f*r+p)-n)/i;return uVe(y,_,S,Z,R,C)}function uVe(e,t,n,i,o,r){return t<e?n+e*(i-n)+t*(r-i):n+e*(r-o)+t*(o-n)}function w3(e,t,n,i,o,r){r*=i;let s=0,a;if(o)for(a=0;a<t;++a)s=s*n+e[r+a];else for(a=t-1;a>=0;--a)s=s*n+e[r+a];return s}function STt(e,t,n,i,o,r,s,a){s*=o;let c;if(r)for(c=0;c<t-1;++c)e[s+c]=a/i|0,a-=e[s+c]*i,i/=n;else for(c=t-1;c>0;--c)e[s+c]=a/i|0,a-=e[s+c]*i,i/=n;e[s+c]=a}var Yc=vg;function QV(e){e=e??B.EMPTY_OBJECT,this._tilingScheme=e.tilingScheme,l(this._tilingScheme)||(this._tilingScheme=new eo({ellipsoid:e.ellipsoid??ne.default})),this._levelZeroMaximumGeometricError=Qo.getEstimatedLevelZeroGeometricErrorForAHeightmap(this._tilingScheme.ellipsoid,64,this._tilingScheme.getNumberOfXTilesAtLevel(0)),this._errorEvent=new Se}Object.defineProperties(QV.prototype,{errorEvent:{get:function(){return this._errorEvent}},credit:{get:function(){}},tilingScheme:{get:function(){return this._tilingScheme}},hasWaterMask:{get:function(){return!1}},hasVertexNormals:{get:function(){return!1}},availability:{get:function(){}}});QV.prototype.requestTileGeometry=function(e,t,n,i){return Promise.resolve(new Yc({buffer:new Uint8Array(256),width:16,height:16}))};QV.prototype.getLevelMaximumGeometricError=function(e){return this._levelZeroMaximumGeometricError/(1<<e)};QV.prototype.getTileDataAvailable=function(e,t,n){};QV.prototype.loadTileDataAvailability=function(e,t,n){};var h0=QV;var czi=x(T(),1);var $3i=x(T(),1);var ZTt=new k;function RTt(e,t){let n=e.unionClippingRegions,i=e.length,o=_s.useFloatTexture(t),r=_s.getTextureResolution(e,t,ZTt),s=r.x,a=r.y,c=o?ETt(s,a):ATt(s,a);return c+=` +`,c+=n?CTt(i):VTt(i),c}function CTt(e){return`float clip(vec4 fragCoord, sampler2D clippingPlanes, mat4 clippingPlanesMatrix) { vec4 position = czm_windowToEyeCoordinates(fragCoord); vec3 clipNormal = vec3(0.0); @@ -9996,7 +9996,7 @@ Url: ${e._contentHeader.uri}`,o++;let r={text:i.substring(1),position:n,font:`${ } return clipAmount; } -`}function cEt(e){return`float clip(vec4 fragCoord, sampler2D clippingPlanes, mat4 clippingPlanesMatrix) +`}function VTt(e){return`float clip(vec4 fragCoord, sampler2D clippingPlanes, mat4 clippingPlanesMatrix) { bool clipped = true; vec4 position = czm_windowToEyeCoordinates(fragCoord); @@ -10019,7 +10019,7 @@ Url: ${e._contentHeader.uri}`,o++;let r={text:i.substring(1),position:n,font:`${ } return clipAmount; } -`}function lEt(e,t){let n=1/e,i=1/t,o=`${n}`;o.indexOf(".")===-1&&(o+=".0");let r=`${i}`;return r.indexOf(".")===-1&&(r+=".0"),`vec4 getClippingPlane(highp sampler2D packedClippingPlanes, int clippingPlaneNumber, mat4 transform) +`}function ETt(e,t){let n=1/e,i=1/t,o=`${n}`;o.indexOf(".")===-1&&(o+=".0");let r=`${i}`;return r.indexOf(".")===-1&&(r+=".0"),`vec4 getClippingPlane(highp sampler2D packedClippingPlanes, int clippingPlaneNumber, mat4 transform) { int pixY = clippingPlaneNumber / ${e}; int pixX = clippingPlaneNumber - (pixY * ${e}); @@ -10029,7 +10029,7 @@ Url: ${e._contentHeader.uri}`,o++;let r={text:i.substring(1),position:n,font:`${ vec4 plane = texture(packedClippingPlanes, vec2(u, v)); return czm_transformPlane(plane, transform); } -`}function dEt(e,t){let n=1/e,i=1/t,o=`${n}`;o.indexOf(".")===-1&&(o+=".0");let r=`${i}`;return r.indexOf(".")===-1&&(r+=".0"),`vec4 getClippingPlane(highp sampler2D packedClippingPlanes, int clippingPlaneNumber, mat4 transform) +`}function ATt(e,t){let n=1/e,i=1/t,o=`${n}`;o.indexOf(".")===-1&&(o+=".0");let r=`${i}`;return r.indexOf(".")===-1&&(r+=".0"),`vec4 getClippingPlane(highp sampler2D packedClippingPlanes, int clippingPlaneNumber, mat4 transform) { int clippingPlaneStartIndex = clippingPlaneNumber * 2; int pixY = clippingPlaneStartIndex / ${e}; @@ -10044,7 +10044,7 @@ Url: ${e._contentHeader.uri}`,o++;let r={text:i.substring(1),position:n,font:`${ plane.w = czm_unpackFloat(texture(packedClippingPlanes, vec2(u + ${o}, v))); return czm_transformPlane(plane, transform); } -`}var zZ=sEt;var yoe=class{constructor(t,n,i,o,r,s){this.numberOfDayTextures=t,this.flags=n,this.material=i,this.shaderProgram=o,this.clippingShaderState=r,this.clippingPolygonShaderState=s}},xoe=class{constructor(){this.baseVertexShaderSource=void 0,this.baseFragmentShaderSource=void 0,this._shadersByTexturesFlags=[],this.material=void 0}getShaderProgram(t){let n=t.frameState,i=t.surfaceTile,o=t.numberOfDayTextures,r=t.applyBrightness,s=t.applyContrast,a=t.applyHue,c=t.applySaturation,d=t.applyGamma,u=t.applyAlpha,m=t.applyDayNightAlpha,p=t.applySplit,b=t.hasWaterMask,f=t.showReflectiveOcean,y=t.showOceanWaves,_=t.enableLighting,S=t.dynamicAtmosphereLighting,Z=t.dynamicAtmosphereLightingFromSun,R=t.showGroundAtmosphere,C=t.perFragmentGroundAtmosphere,E=t.hasVertexNormals,A=t.useWebMercatorProjection,L=t.enableFog,F=t.enableClippingPlanes,I=t.clippingPlanes,N=t.enableClippingPolygons,g=t.clippingPolygons,V=t.clippedByBoundaries,G=t.hasImageryLayerCutout,v=t.colorCorrect,X=t.highlightFillTile,Y=t.colorToAlpha,D=t.hasGeodeticSurfaceNormals,M=t.hasExaggeration,O=t.showUndergroundColor,w=t.translucent,z=i.vectorData,K=z?.show,te=K&&z.hasPolylines,H=K&&z.hasPolygons,$=K&&t.vectorAntialias,ee=te&&z.hasMeterWidths,le=ee&&z.hasPixelWidths,_e=0,he="",ye=i.renderedMesh.encoding;ye.quantization===Ka.BITS12&&(_e=1,he="QUANTIZATION_BITS12");let Ae=0,Fe="";V&&(Ae=1,Fe="TILE_LIMIT_RECTANGLE");let tt=0,Be="";G&&(tt=1,Be="APPLY_IMAGERY_CUTOUT");let je=n.mode,qe=((je|+r<<2|+s<<3|+a<<4|+c<<5|+d<<6|+u<<7|+b<<8|+f<<9|+y<<10|+_<<11|+S<<12|+Z<<13|+R<<14|+C<<15|+E<<16|+A<<17|+L<<18|_e<<19|+p<<20|+F<<21|+N<<22|Ae<<23|tt<<24|+v<<25|+X<<26|+Y<<27|+D<<28|+M<<29|+O<<30|+w<<31)>>>0)+(m?4294967296:0)+(K?8589934592:0)+(te?17179869184:0)+(H?34359738368:0)+($?68719476736:0)+(ee?137438953472:0)+(le?274877906944:0),We=0;l(I)&&I.length>0&&(We=F?I.clippingPlanesState:0);let Ke=0;l(g)&&g.length>0&&(Ke=N?g.clippingPolygonsState:0);let ct=i.surfaceShader;if(l(ct)&&ct.numberOfDayTextures===o&&ct.flags===qe&&ct.material===this.material&&ct.clippingShaderState===We&&ct.clippingPolygonShaderState===Ke)return ct.shaderProgram;let Et=this._shadersByTexturesFlags[o];if(l(Et)||(Et=this._shadersByTexturesFlags[o]=[]),ct=Et[qe],!l(ct)||ct.material!==this.material||ct.clippingShaderState!==We||ct.clippingPolygonShaderState!==Ke){let zt=this.baseVertexShaderSource.clone(),ut=this.baseFragmentShaderSource.clone();We!==0&&ut.sources.unshift(zZ(I,n.context)),zt.defines.push(he),ut.defines.push(`TEXTURE_UNITS ${o}`,Fe,Be),r&&ut.defines.push("APPLY_BRIGHTNESS"),s&&ut.defines.push("APPLY_CONTRAST"),a&&ut.defines.push("APPLY_HUE"),c&&ut.defines.push("APPLY_SATURATION"),d&&ut.defines.push("APPLY_GAMMA"),u&&ut.defines.push("APPLY_ALPHA"),m&&ut.defines.push("APPLY_DAY_NIGHT_ALPHA"),b&&ut.defines.push("HAS_WATER_MASK"),f&&(ut.defines.push("SHOW_REFLECTIVE_OCEAN"),zt.defines.push("SHOW_REFLECTIVE_OCEAN")),y&&ut.defines.push("SHOW_OCEAN_WAVES"),Y&&ut.defines.push("APPLY_COLOR_TO_ALPHA"),O&&(zt.defines.push("UNDERGROUND_COLOR"),ut.defines.push("UNDERGROUND_COLOR")),w&&(zt.defines.push("TRANSLUCENT"),ut.defines.push("TRANSLUCENT")),_&&(E?(zt.defines.push("ENABLE_VERTEX_LIGHTING"),ut.defines.push("ENABLE_VERTEX_LIGHTING")):(zt.defines.push("ENABLE_DAYNIGHT_SHADING"),ut.defines.push("ENABLE_DAYNIGHT_SHADING"))),S&&(zt.defines.push("DYNAMIC_ATMOSPHERE_LIGHTING"),ut.defines.push("DYNAMIC_ATMOSPHERE_LIGHTING"),Z&&(zt.defines.push("DYNAMIC_ATMOSPHERE_LIGHTING_FROM_SUN"),ut.defines.push("DYNAMIC_ATMOSPHERE_LIGHTING_FROM_SUN"))),R&&(zt.defines.push("GROUND_ATMOSPHERE"),ut.defines.push("GROUND_ATMOSPHERE"),C&&(zt.defines.push("PER_FRAGMENT_GROUND_ATMOSPHERE"),ut.defines.push("PER_FRAGMENT_GROUND_ATMOSPHERE"))),zt.defines.push("INCLUDE_WEB_MERCATOR_Y"),ut.defines.push("INCLUDE_WEB_MERCATOR_Y"),L&&(zt.defines.push("FOG"),ut.defines.push("FOG")),p&&ut.defines.push("APPLY_SPLIT"),F&&ut.defines.push("ENABLE_CLIPPING_PLANES"),N&&(ut.defines.push("ENABLE_CLIPPING_POLYGONS"),g.inverse&&ut.defines.push("CLIPPING_INVERSE")),v&&ut.defines.push("COLOR_CORRECT"),X&&ut.defines.push("HIGHLIGHT_FILL_TILE"),D&&zt.defines.push("GEODETIC_SURFACE_NORMALS"),M&&zt.defines.push("EXAGGERATION"),K&&(ut.defines.push("HAS_VECTOR_LAYER"),te&&ut.defines.push("HAS_VECTOR_POLYLINES"),H&&ut.defines.push("HAS_VECTOR_POLYGONS"),$&&ut.defines.push("VECTOR_ANTIALIAS"),ee&&ut.defines.push("VECTOR_WIDTH_IN_METERS"),le&&ut.defines.push("VECTOR_WIDTH_MIXED_UNITS")),(K||N)&&ut.sources.unshift(ub);let bt=` vec4 computeDayColor(vec4 initialColor, vec3 textureCoordinates, float nightBlend) +`}var xZ=RTt;var $ee=class{constructor(t,n,i,o,r,s){this.numberOfDayTextures=t,this.flags=n,this.material=i,this.shaderProgram=o,this.clippingShaderState=r,this.clippingPolygonShaderState=s}},ete=class{constructor(){this.baseVertexShaderSource=void 0,this.baseFragmentShaderSource=void 0,this._shadersByTexturesFlags=[],this.material=void 0}getShaderProgram(t){let n=t.frameState,i=t.surfaceTile,o=t.numberOfDayTextures,r=t.applyBrightness,s=t.applyContrast,a=t.applyHue,c=t.applySaturation,d=t.applyGamma,u=t.applyAlpha,m=t.applyDayNightAlpha,p=t.applySplit,b=t.hasWaterMask,f=t.showReflectiveOcean,y=t.showOceanWaves,_=t.enableLighting,S=t.dynamicAtmosphereLighting,Z=t.dynamicAtmosphereLightingFromSun,R=t.showGroundAtmosphere,C=t.perFragmentGroundAtmosphere,E=t.hasVertexNormals,A=t.useWebMercatorProjection,L=t.enableFog,F=t.enableClippingPlanes,I=t.clippingPlanes,N=t.enableClippingPolygons,g=t.clippingPolygons,V=t.clippedByBoundaries,G=t.hasImageryLayerCutout,v=t.colorCorrect,X=t.highlightFillTile,Y=t.colorToAlpha,D=t.hasGeodeticSurfaceNormals,M=t.hasExaggeration,O=t.showUndergroundColor,w=t.translucent,z=i.vectorData,K=z?.show,te=K&&z.hasPolylines,H=K&&z.hasPolygons,$=K&&t.vectorAntialias,ee=te&&z.hasMeterWidths,le=ee&&z.hasPixelWidths,_e=0,he="",ye=i.renderedMesh.encoding;ye.quantization===Ka.BITS12&&(_e=1,he="QUANTIZATION_BITS12");let Ae=0,Fe="";V&&(Ae=1,Fe="TILE_LIMIT_RECTANGLE");let tt=0,Be="";G&&(tt=1,Be="APPLY_IMAGERY_CUTOUT");let je=n.mode,qe=((je|+r<<2|+s<<3|+a<<4|+c<<5|+d<<6|+u<<7|+b<<8|+f<<9|+y<<10|+_<<11|+S<<12|+Z<<13|+R<<14|+C<<15|+E<<16|+A<<17|+L<<18|_e<<19|+p<<20|+F<<21|+N<<22|Ae<<23|tt<<24|+v<<25|+X<<26|+Y<<27|+D<<28|+M<<29|+O<<30|+w<<31)>>>0)+(m?4294967296:0)+(K?8589934592:0)+(te?17179869184:0)+(H?34359738368:0)+($?68719476736:0)+(ee?137438953472:0)+(le?274877906944:0),We=0;l(I)&&I.length>0&&(We=F?I.clippingPlanesState:0);let Ke=0;l(g)&&g.length>0&&(Ke=N?g.clippingPolygonsState:0);let ct=i.surfaceShader;if(l(ct)&&ct.numberOfDayTextures===o&&ct.flags===qe&&ct.material===this.material&&ct.clippingShaderState===We&&ct.clippingPolygonShaderState===Ke)return ct.shaderProgram;let Et=this._shadersByTexturesFlags[o];if(l(Et)||(Et=this._shadersByTexturesFlags[o]=[]),ct=Et[qe],!l(ct)||ct.material!==this.material||ct.clippingShaderState!==We||ct.clippingPolygonShaderState!==Ke){let zt=this.baseVertexShaderSource.clone(),ut=this.baseFragmentShaderSource.clone();We!==0&&ut.sources.unshift(xZ(I,n.context)),zt.defines.push(he),ut.defines.push(`TEXTURE_UNITS ${o}`,Fe,Be),r&&ut.defines.push("APPLY_BRIGHTNESS"),s&&ut.defines.push("APPLY_CONTRAST"),a&&ut.defines.push("APPLY_HUE"),c&&ut.defines.push("APPLY_SATURATION"),d&&ut.defines.push("APPLY_GAMMA"),u&&ut.defines.push("APPLY_ALPHA"),m&&ut.defines.push("APPLY_DAY_NIGHT_ALPHA"),b&&ut.defines.push("HAS_WATER_MASK"),f&&(ut.defines.push("SHOW_REFLECTIVE_OCEAN"),zt.defines.push("SHOW_REFLECTIVE_OCEAN")),y&&ut.defines.push("SHOW_OCEAN_WAVES"),Y&&ut.defines.push("APPLY_COLOR_TO_ALPHA"),O&&(zt.defines.push("UNDERGROUND_COLOR"),ut.defines.push("UNDERGROUND_COLOR")),w&&(zt.defines.push("TRANSLUCENT"),ut.defines.push("TRANSLUCENT")),_&&(E?(zt.defines.push("ENABLE_VERTEX_LIGHTING"),ut.defines.push("ENABLE_VERTEX_LIGHTING")):(zt.defines.push("ENABLE_DAYNIGHT_SHADING"),ut.defines.push("ENABLE_DAYNIGHT_SHADING"))),S&&(zt.defines.push("DYNAMIC_ATMOSPHERE_LIGHTING"),ut.defines.push("DYNAMIC_ATMOSPHERE_LIGHTING"),Z&&(zt.defines.push("DYNAMIC_ATMOSPHERE_LIGHTING_FROM_SUN"),ut.defines.push("DYNAMIC_ATMOSPHERE_LIGHTING_FROM_SUN"))),R&&(zt.defines.push("GROUND_ATMOSPHERE"),ut.defines.push("GROUND_ATMOSPHERE"),C&&(zt.defines.push("PER_FRAGMENT_GROUND_ATMOSPHERE"),ut.defines.push("PER_FRAGMENT_GROUND_ATMOSPHERE"))),zt.defines.push("INCLUDE_WEB_MERCATOR_Y"),ut.defines.push("INCLUDE_WEB_MERCATOR_Y"),L&&(zt.defines.push("FOG"),ut.defines.push("FOG")),p&&ut.defines.push("APPLY_SPLIT"),F&&ut.defines.push("ENABLE_CLIPPING_PLANES"),N&&(ut.defines.push("ENABLE_CLIPPING_POLYGONS"),g.inverse&&ut.defines.push("CLIPPING_INVERSE")),v&&ut.defines.push("COLOR_CORRECT"),X&&ut.defines.push("HIGHLIGHT_FILL_TILE"),D&&zt.defines.push("GEODETIC_SURFACE_NORMALS"),M&&zt.defines.push("EXAGGERATION"),K&&(ut.defines.push("HAS_VECTOR_LAYER"),te&&ut.defines.push("HAS_VECTOR_POLYLINES"),H&&ut.defines.push("HAS_VECTOR_POLYGONS"),$&&ut.defines.push("VECTOR_ANTIALIAS"),ee&&ut.defines.push("VECTOR_WIDTH_IN_METERS"),le&&ut.defines.push("VECTOR_WIDTH_MIXED_UNITS")),(K||N)&&ut.sources.unshift(ub);let bt=` vec4 computeDayColor(vec4 initialColor, vec3 textureCoordinates, float nightBlend) { vec4 color = initialColor; `;G&&(bt+=` vec4 cutoutAndColorResult; @@ -10071,7 +10071,7 @@ Url: ${e._contentHeader.uri}`,o++;let r={text:i.substring(1),position:n,font:`${ nightBlend); `,G&&(bt+=` color = czm_branchFreeTernary(texelUnclipped, cutoutAndColorResult, color); `);bt+=` return color; - }`,ut.sources.push(bt),zt.sources.push(uEt(je)),zt.sources.push(mEt(A));let ht=tn.fromCache({context:n.context,vertexShaderSource:zt,fragmentShaderSource:ut,attributeLocations:ye.getAttributeLocations()});ct=Et[qe]=new yoe(o,qe,this.material,ht,We,Ke)}return i.surfaceShader=ct,ct.shaderProgram}destroy(){let t,n,i=this._shadersByTexturesFlags;for(let o in i)if(i.hasOwnProperty(o)){let r=i[o];if(!l(r))continue;for(t in r)r.hasOwnProperty(t)&&(n=r[t],l(n)&&n.shaderProgram.destroy())}return ue(this)}};function uEt(e){let t="vec4 getPosition(vec3 position, float height, vec2 textureCoordinates) { return getPosition3DMode(position, height, textureCoordinates); }",n="vec4 getPosition(vec3 position, float height, vec2 textureCoordinates) { return getPositionColumbusViewMode(position, height, textureCoordinates); }",i="vec4 getPosition(vec3 position, float height, vec2 textureCoordinates) { return getPositionMorphingMode(position, height, textureCoordinates); }",o;switch(e){case se.SCENE3D:o=t;break;case se.SCENE2D:case se.COLUMBUS_VIEW:o=n;break;case se.MORPHING:o=i;break}return o}function mEt(e){return e?"float get2DYPositionFraction(vec2 textureCoordinates) { return get2DMercatorYPositionFraction(textureCoordinates); }":"float get2DYPositionFraction(vec2 textureCoordinates) { return get2DGeographicYPositionFraction(textureCoordinates); }"}var Xw=xoe;var xro=x(T(),1);var fio=x(T(),1),ave={NONE:-1,PARTIAL:0,FULL:1};Object.freeze(ave);var Jr=ave;var Bio=x(T(),1);var bio=x(T(),1),cve={START:0,LOADING:1,DONE:2,FAILED:3};Object.freeze(cve);var Ja=cve;var yio=x(T(),1),lve={FAILED:0,UNLOADED:1,RECEIVING:2,RECEIVED:3,TRANSFORMING:4,TRANSFORMED:5,READY:6};Object.freeze(lve);var wo=lve;var G0=class e{constructor(){mt(this,"request");this.imagery=[],this.waterMaskTexture=void 0,this.waterMaskTranslationAndScale=new ce(0,0,1,1),this.terrainData=void 0,this.vectorData=void 0,this.clippingPolygonData=void 0,this.vertexArray=void 0,this.tileBoundingRegion=void 0,this.occludeePointInScaledSpace=new h,this.boundingVolumeSourceTile=void 0,this.boundingVolumeIsFromMesh=!1,this.terrainState=wo.UNLOADED,this.mesh=void 0,this.fill=void 0,this.pickBoundingSphere=new me,this.surfaceShader=void 0,this.isClipped=!0,this.clippedByBoundaries=!1}get eligibleForUnloading(){let t=this.terrainState,i=!(t===wo.RECEIVING||t===wo.TRANSFORMING),o=this.imagery;for(let r=0,s=o.length;i&&r<s;++r){let a=o[r];i=!l(a.loadingImagery)||a.loadingImagery.state!==Dn.TRANSITIONING}return i}get renderedMesh(){if(l(this.vertexArray))return this.mesh;if(l(this.fill))return this.fill.mesh}pick(t,n,i,o,r){if(!l(this.renderedMesh))return;let s=this.renderedMesh.pick(t,o,n,i);return h.clone(s,r)}freeResources(){l(this.waterMaskTexture)&&(--this.waterMaskTexture.referenceCount,this.waterMaskTexture.referenceCount===0&&this.waterMaskTexture.destroy(),this.waterMaskTexture=void 0),l(this.vectorData)&&(Ts.freeResources(this.vectorData),this.vectorData=void 0),l(this.clippingPolygonData)&&(vc.releaseRectangleData(this.clippingPolygonData),this.clippingPolygonData=void 0),this.terrainData=void 0,this.terrainState=wo.UNLOADED,this.mesh=void 0,this.fill=this.fill&&this.fill.destroy();let t=this.imagery;for(let n=0,i=t.length;n<i;++n)t[n].freeResources();this.imagery.length=0,this.freeVertexArray()}freeVertexArray(){e._freeVertexArray(this.vertexArray),this.vertexArray=void 0,e._freeVertexArray(this.wireframeVertexArray),this.wireframeVertexArray=void 0}static initialize(t,n,i,o){l(t.data)||(t.data=new e),t.state===Ja.START&&(hEt(t,n,i,o),t.state=Ja.LOADING)}static processStateMachine(t,n,i,o,r,s,a,c){e.initialize(t,i,o,r);let d=t.data;if(t.state===Ja.LOADING&&fEt(t,n,i,o,r,s,a),c)return;let u=t.renderable;t.renderable=l(d.vertexArray);let m=d.terrainState===wo.READY;t.upsampledFromParent=l(d.terrainData)&&d.terrainData.wasCreatedByUpsampling();let p=d.processImagery(t,i,n);if(m&&p){let b=t._loadedCallbacks,f={};for(let y in b)b.hasOwnProperty(y)&&(b[y](t)||(f[y]=b[y]));t._loadedCallbacks=f,t.state=Ja.DONE}u&&(t.renderable=!0)}processImagery(t,n,i,o){let r=t.data,s=t.upsampledFromParent,a=!1,c=!0,d=r.imagery,u,m;for(u=0,m=d.length;u<m;++u){let p=d[u];if(!l(p.loadingImagery)){s=!1;continue}if(p.loadingImagery.state===Dn.PLACEHOLDER){let f=p.loadingImagery.imageryLayer;if(f.ready){p.freeResources(),d.splice(u,1),f._createTileImagerySkeletons(t,n,u),--u,m=d.length;continue}else s=!1}let b=p.processStateMachine(t,i,o);c=c&&b,a=a||b||l(p.readyImagery),s=s&&l(p.loadingImagery)&&(p.loadingImagery.state===Dn.FAILED||p.loadingImagery.state===Dn.INVALID)}return t.upsampledFromParent=s,t.renderable=t.renderable&&(a||c),c}addGeodeticSurfaceNormals(t,n){dve(this,!0,t,n)}removeGeodeticSurfaceNormals(t){dve(this,!1,void 0,t)}updateExaggeration(t,n,i){let o=this,r=o.renderedMesh;if(r===void 0)return;let s=n.verticalExaggeration,a=n.verticalExaggerationRelativeHeight,c=s!==1,d=r.encoding,u=d.exaggeration!==s,m=d.exaggerationRelativeHeight!==a;if(u||m){if(u)if(c&&!d.hasGeodeticSurfaceNormals){let b=t.tilingScheme.ellipsoid;o.addGeodeticSurfaceNormals(b,n)}else!c&&d.hasGeodeticSurfaceNormals&&o.removeGeodeticSurfaceNormals(n);if(d.exaggeration=s,d.exaggerationRelativeHeight=a,i!==void 0){i._tileToUpdateHeights.push(t);let b=t.customData;for(let f of b)f.level=-1}r.updateExaggeration(s,a)}}updateSceneMode(t){let i=this.renderedMesh;i!==void 0&&i.updateSceneMode(t)}static _createVertexArrayForMesh(t,n){let i=n.vertices,o=it.createVertexBuffer({context:t,typedArray:i,usage:Pe.STATIC_DRAW}),r=n.encoding.getAttributes(o),s=n.indices.indexBuffers||{},a=s[t.id];if(!l(a)||a.isDestroyed()){let c=n.indices;a=it.createIndexBuffer({context:t,typedArray:c,usage:Pe.STATIC_DRAW,indexDatatype:Oe.fromSizeInBytes(c.BYTES_PER_ELEMENT)}),a.vertexArrayDestroyable=!1,a.referenceCount=1,s[t.id]=a,n.indices.indexBuffers=s}else++a.referenceCount;return new Un({context:t,attributes:r,indexBuffer:a})}static _freeVertexArray(t){if(l(t)){let n=t.indexBuffer;t.isDestroyed()||t.destroy(),l(n)&&!n.isDestroyed()&&l(n.referenceCount)&&(--n.referenceCount,n.referenceCount===0&&n.destroy())}}_findAncestorTileWithTerrainData(t){let n=t.parent;for(;l(n)&&(!l(n.data)||!l(n.data.terrainData)||n.data.terrainData.wasCreatedByUpsampling());)n=n.parent;return n}_computeWaterMaskTranslationAndScale(t,n,i){let o=n.rectangle,r=t.rectangle,s=r.width,a=r.height,c=s/o.width,d=a/o.height;return i.x=c*(r.west-o.west)/s,i.y=d*(r.south-o.south)/a,i.z=c,i.w=d,i}};function dve(e,t,n,i){let o=e.renderedMesh,r=o.vertices,s=o.encoding,a=r.length/s.stride,c=Cr.clone(s);c.hasGeodeticSurfaceNormals=t,c=Cr.clone(c);let d=c.stride,u=new Float32Array(a*d);t?s.addGeodeticSurfaceNormals(r,u,n):s.removeGeodeticSurfaceNormals(r,u),o.vertices=u,o.stride=d,o!==e.mesh?(G0._freeVertexArray(e.fill.vertexArray),e.fill.vertexArray=G0._createVertexArrayForMesh(i.context,o)):(G0._freeVertexArray(e.vertexArray),e.vertexArray=G0._createVertexArrayForMesh(i.context,o)),G0._freeVertexArray(e.wireframeVertexArray),e.wireframeVertexArray=void 0}function hEt(e,t,n,i){let o=t.getTileDataAvailable(e.x,e.y,e.level);if(!l(o)&&l(e.parent)){let s=e.parent,a=s.data;l(a)&&l(a.terrainData)&&(o=a.terrainData.isChildAvailable(s.x,s.y,e.x,e.y))}let r=e.data;o===!1&&(r.terrainState=wo.FAILED);for(let s=0,a=i.length;s<a;++s){let c=i.get(s);c.show&&c._createTileImagerySkeletons(e,t)}}function fEt(e,t,n,i,o,r,s){let a=e.data,c=e.parent;if(a.terrainState===wo.FAILED&&c!==void 0){let d=c.data;d!==void 0&&d.terrainData!==void 0&&d.terrainData.canUpsample!==!1||G0.processStateMachine(c,t,n,i,o,r,s,!0)}if(a.terrainState===wo.FAILED&&pEt(a,e,t,n,e.x,e.y,e.level),a.terrainState===wo.UNLOADED&&bEt(a,n,e.x,e.y,e.level),a.terrainState===wo.RECEIVED&&yEt(a,t,n,e.x,e.y,e.level),a.terrainState===wo.TRANSFORMED&&(xEt(a,t.context,n,e.x,e.y,e.level,s),a.updateExaggeration(e,t,r)),a.terrainState>=wo.RECEIVED&&a.waterMaskTexture===void 0&&n.hasWaterMask)if(a.terrainData.waterMask!==void 0)_Et(t.context,a);else{let u=a._findAncestorTileWithTerrainData(e),m=u?.data;l(u)&&l(m.waterMaskTexture)&&(a.waterMaskTexture=m.waterMaskTexture,++a.waterMaskTexture.referenceCount,a._computeWaterMaskTranslationAndScale(e,u,a.waterMaskTranslationAndScale))}}function pEt(e,t,n,i,o,r,s){let a=t.parent;if(!a){t.state=Ja.FAILED;return}let d=a.data.terrainData,u=a.x,m=a.y,p=a.level;if(!l(d))return;let b=d.upsample(i.tilingScheme,u,m,p,o,r,s);l(b)&&(e.terrainState=wo.RECEIVING,Promise.resolve(b).then(function(f){l(f)&&(e.terrainData=f,e.terrainState=wo.RECEIVED)}).catch(function(){e.terrainState=wo.FAILED}))}function bEt(e,t,n,i,o){function r(c){if(!l(c)){e.terrainState=wo.UNLOADED,e.request=void 0;return}e.terrainData=c,e.terrainState=wo.RECEIVED,e.request=void 0}function s(c){if(e.request.state===Ri.CANCELLED){e.terrainData=void 0,e.terrainState=wo.UNLOADED,e.request=void 0;return}e.terrainState=wo.FAILED,e.request=void 0;let d=`Failed to obtain terrain tile X: ${n} Y: ${i} Level: ${o}. Error message: "${c}"`;t._requestError=tr.reportError(t._requestError,t,t.errorEvent,d,n,i,o),t._requestError.retry&&a()}function a(){let c=new Ar({throttle:!1,throttleByServer:!0,type:js.TERRAIN});e.request=c;let d=t.requestTileGeometry(n,i,o,c);l(d)?(e.terrainState=wo.RECEIVING,Promise.resolve(d).then(function(u){r(u)}).catch(function(u){s(u)})):(e.terrainState=wo.UNLOADED,e.request=void 0)}a()}var gEt={tilingScheme:void 0,x:0,y:0,level:0,exaggeration:1,exaggerationRelativeHeight:0,throttle:!0};function yEt(e,t,n,i,o,r){let s=n.tilingScheme,a=gEt;a.tilingScheme=s,a.x=i,a.y=o,a.level=r,a.exaggeration=t.verticalExaggeration,a.exaggerationRelativeHeight=t.verticalExaggerationRelativeHeight,a.throttle=!0;let d=e.terrainData.createMesh(a);l(d)&&(e.terrainState=wo.TRANSFORMING,Promise.resolve(d).then(function(u){e.mesh=u,e.terrainState=wo.TRANSFORMED}).catch(function(){e.terrainState=wo.FAILED}))}function xEt(e,t,n,i,o,r,s){e.vertexArray=G0._createVertexArrayForMesh(t,e.mesh),e.terrainState=wo.READY,e.fill=e.fill&&e.fill.destroy(s)}function TEt(e){let t=e.cache.tile_waterMaskData;if(!l(t)){let n=vt.create({context:e,pixelFormat:Qe.LUMINANCE,pixelDatatype:Ue.UNSIGNED_BYTE,source:{arrayBufferView:new Uint8Array([255]),width:1,height:1}});n.referenceCount=1;let i=new Ot({wrapS:pn.CLAMP_TO_EDGE,wrapT:pn.CLAMP_TO_EDGE,minificationFilter:Ht.LINEAR,magnificationFilter:$n.LINEAR});t={allWaterTexture:n,sampler:i,destroy:function(){this.allWaterTexture.destroy()}},e.cache.tile_waterMaskData=t}return t}function _Et(e,t){let n=t.terrainData.waterMask,i=TEt(e),o,r=n.length;if(n instanceof ImageBitmap)o=vt.create({context:e,source:n,sampler:i.sampler,flipY:!1,skipColorSpaceConversion:!0});else if(r===1)if(n[0]!==0)o=i.allWaterTexture;else return;else{let s=Math.sqrt(r);o=vt.create({context:e,pixelFormat:Qe.LUMINANCE,pixelDatatype:Ue.UNSIGNED_BYTE,source:{width:s,height:s,arrayBufferView:n},sampler:i.sampler,flipY:!1}),o.referenceCount=0}++o.referenceCount,t.waterMaskTexture=o,ce.fromElements(0,0,1,1,t.waterMaskTranslationAndScale)}var xh=G0;var yoo=x(T(),1);var Kio=x(T(),1),SEt={WEST:0,NORTH:1,EAST:2,SOUTH:3,NORTHWEST:4,NORTHEAST:5,SOUTHWEST:6,SOUTHEAST:7},Gn=SEt;var jio=x(T(),1),uve={NONE:0,CULLED:1,RENDERED:2,REFINED:3,RENDERED_AND_KICKED:6,REFINED_AND_KICKED:7,CULLED_BUT_NEEDED:9,wasKicked:function(e){return e>=uve.RENDERED_AND_KICKED},originalResult:function(e){return e&3},kick:function(e){return e|4}},gi=uve;function eA(e){this.tile=e,this.frameLastUpdated=void 0,this.westMeshes=[],this.westTiles=[],this.southMeshes=[],this.southTiles=[],this.eastMeshes=[],this.eastTiles=[],this.northMeshes=[],this.northTiles=[],this.southwestMesh=void 0,this.southwestTile=void 0,this.southeastMesh=void 0,this.southeastTile=void 0,this.northwestMesh=void 0,this.northwestTile=void 0,this.northeastMesh=void 0,this.northeastTile=void 0,this.changedThisFrame=!0,this.visitedFrame=void 0,this.enqueuedFrame=void 0,this.mesh=void 0,this.vertexArray=void 0,this.waterMaskTexture=void 0,this.waterMaskTranslationAndScale=new ce}eA.prototype.update=function(e,t,n){this.changedThisFrame&&(yve(e,t,this.tile,n),this.changedThisFrame=!1)};eA.prototype.destroy=function(e){this._destroyVertexArray(e),l(this.waterMaskTexture)&&(--this.waterMaskTexture.referenceCount,this.waterMaskTexture.referenceCount===0&&this.waterMaskTexture.destroy(),this.waterMaskTexture=void 0)};eA.prototype._destroyVertexArray=function(e){l(this.vertexArray)&&(l(e)?e.push(this.vertexArray):xh._freeVertexArray(this.vertexArray),this.vertexArray=void 0)};var ZEt=new mx;eA.updateFillTiles=function(e,t,n,i){let o=e._quadtree,r=o._levelZeroTiles,s=o._lastSelectionFrameNumber,a=ZEt;a.clear();for(let d=0;d<t.length;++d){let u=t[d];l(u.data.vertexArray)&&a.enqueue(t[d])}let c=a.dequeue();for(;c!==void 0;){let d=c.findTileToWest(r),u=c.findTileToSouth(r),m=c.findTileToEast(r),p=c.findTileToNorth(r);La(e,n,c,d,s,Gn.EAST,!1,a,i),La(e,n,c,u,s,Gn.NORTH,!1,a,i),La(e,n,c,m,s,Gn.WEST,!1,a,i),La(e,n,c,p,s,Gn.SOUTH,!1,a,i);let b=d.findTileToNorth(r),f=d.findTileToSouth(r),y=m.findTileToNorth(r),_=m.findTileToSouth(r);La(e,n,c,b,s,Gn.SOUTHEAST,!1,a,i),La(e,n,c,y,s,Gn.SOUTHWEST,!1,a,i),La(e,n,c,f,s,Gn.NORTHEAST,!1,a,i),La(e,n,c,_,s,Gn.NORTHWEST,!1,a,i),c=a.dequeue()}};function La(e,t,n,i,o,r,s,a,c){if(i===void 0)return;let d=i;for(;d&&(d._lastSelectionResultFrame!==o||gi.wasKicked(d._lastSelectionResult)||gi.originalResult(d._lastSelectionResult)===gi.CULLED);){if(s)return;let u=d.parent;if(r>=Gn.NORTHWEST&&u!==void 0)switch(r){case Gn.NORTHWEST:d=d===u.northwestChild?u:void 0;break;case Gn.NORTHEAST:d=d===u.northeastChild?u:void 0;break;case Gn.SOUTHWEST:d=d===u.southwestChild?u:void 0;break;case Gn.SOUTHEAST:d=d===u.southeastChild?u:void 0;break}else d=u}if(d!==void 0){if(d._lastSelectionResult===gi.RENDERED){if(l(d.data.vertexArray))return;REt(e,t,n,d,r,o,a,c);return}if(gi.originalResult(i._lastSelectionResult)!==gi.CULLED)switch(r){case Gn.WEST:La(e,t,n,i.northwestChild,o,r,!0,a,c),La(e,t,n,i.southwestChild,o,r,!0,a,c);break;case Gn.EAST:La(e,t,n,i.southeastChild,o,r,!0,a,c),La(e,t,n,i.northeastChild,o,r,!0,a,c);break;case Gn.SOUTH:La(e,t,n,i.southwestChild,o,r,!0,a,c),La(e,t,n,i.southeastChild,o,r,!0,a,c);break;case Gn.NORTH:La(e,t,n,i.northeastChild,o,r,!0,a,c),La(e,t,n,i.northwestChild,o,r,!0,a,c);break;case Gn.NORTHWEST:La(e,t,n,i.northwestChild,o,r,!0,a,c);break;case Gn.NORTHEAST:La(e,t,n,i.northeastChild,o,r,!0,a,c);break;case Gn.SOUTHWEST:La(e,t,n,i.southwestChild,o,r,!0,a,c);break;case Gn.SOUTHEAST:La(e,t,n,i.southeastChild,o,r,!0,a,c);break;default:throw new ge("Invalid edge")}}}function REt(e,t,n,i,o,r,s,a){let c=i.data;if(c.fill===void 0)c.fill=new eA(i);else if(c.fill.visitedFrame===r)return;c.fill.enqueuedFrame!==r&&(c.fill.enqueuedFrame=r,c.fill.changedThisFrame=!1,s.enqueue(i)),CEt(e,t,n,i,o,a)}function CEt(e,t,n,i,o,r){let s=i.data.fill,a,c=n.data.fill;l(c)?(c.visitedFrame=t.frameNumber,c.changedThisFrame&&(yve(e,t,n,r),c.changedThisFrame=!1),a=n.data.fill.mesh):a=n.data.mesh;let d,u;switch(o){case Gn.WEST:d=s.westMeshes,u=s.westTiles;break;case Gn.SOUTH:d=s.southMeshes,u=s.southTiles;break;case Gn.EAST:d=s.eastMeshes,u=s.eastTiles;break;case Gn.NORTH:d=s.northMeshes,u=s.northTiles;break;case Gn.NORTHWEST:s.changedThisFrame=s.changedThisFrame||s.northwestMesh!==a,s.northwestMesh=a,s.northwestTile=n;return;case Gn.NORTHEAST:s.changedThisFrame=s.changedThisFrame||s.northeastMesh!==a,s.northeastMesh=a,s.northeastTile=n;return;case Gn.SOUTHWEST:s.changedThisFrame=s.changedThisFrame||s.southwestMesh!==a,s.southwestMesh=a,s.southwestTile=n;return;case Gn.SOUTHEAST:s.changedThisFrame=s.changedThisFrame||s.southeastMesh!==a,s.southeastMesh=a,s.southeastTile=n;return}if(n.level<=i.level){s.changedThisFrame=s.changedThisFrame||d[0]!==a||d.length!==1,d[0]=a,u[0]=n,d.length=1,u.length=1;return}let m,p,b,f,y=n.rectangle,_,S=i.rectangle;switch(o){case Gn.WEST:for(_=(S.north-S.south)*W.EPSILON5,m=0;m<u.length&&(b=u[m],f=b.rectangle,!W.greaterThan(y.north,f.south,_));++m);for(p=m;p<u.length&&(b=u[p],f=b.rectangle,!W.greaterThanOrEquals(y.south,f.north,_));++p);break;case Gn.SOUTH:for(_=(S.east-S.west)*W.EPSILON5,m=0;m<u.length&&(b=u[m],f=b.rectangle,!W.lessThan(y.west,f.east,_));++m);for(p=m;p<u.length&&(b=u[p],f=b.rectangle,!W.lessThanOrEquals(y.east,f.west,_));++p);break;case Gn.EAST:for(_=(S.north-S.south)*W.EPSILON5,m=0;m<u.length&&(b=u[m],f=b.rectangle,!W.lessThan(y.south,f.north,_));++m);for(p=m;p<u.length&&(b=u[p],f=b.rectangle,!W.lessThanOrEquals(y.north,f.south,_));++p);break;case Gn.NORTH:for(_=(S.east-S.west)*W.EPSILON5,m=0;m<u.length&&(b=u[m],f=b.rectangle,!W.greaterThan(y.east,f.west,_));++m);for(p=m;p<u.length&&(b=u[p],f=b.rectangle,!W.greaterThanOrEquals(y.west,f.east,_));++p);break}p-m===1?(s.changedThisFrame=s.changedThisFrame||d[m]!==a,d[m]=a,u[m]=n):(s.changedThisFrame=!0,d.splice(m,p-m,a),u.splice(m,p-m,n))}var HZ=new pe,VEt=new pe,$E=new h,Zoe=new h,Toe=new k,_oe=new k,rm=new k;function jH(){this.height=0,this.encodedNormal=new k}function OH(e,t,n,i,o,r,s,a,c){if(l(o))return o;let d;if(l(r)&&l(s))d=(r.height+s.height)*.5;else if(l(r))d=r.height;else if(l(s))d=s.height;else if(l(a))d=a.height;else{let m=e.tile.data.tileBoundingRegion,p=0,b=0;l(m)&&(p=m.minimumHeight,b=m.maximumHeight),d=(p+b)*.5}return xve(e,t,n,i,d,c),c}var EEt={minimumHeight:0,maximumHeight:0},AEt=new h,mve=new jH,hve=new jH,fve=new jH,pve=new jH,GEt=typeof Uint8Array<"u"?new Uint8Array(81):void 0,LEt={tilingScheme:void 0,x:0,y:0,level:0,exaggeration:1,exaggerationRelativeHeight:0};function yve(e,t,n,i){xh.initialize(n,e.terrainProvider,e.vectorProvider,e._imageryLayers);let o=n.data,r=o.fill,s=n.rectangle,a=t.verticalExaggeration,c=t.verticalExaggerationRelativeHeight,d=a!==1,u=n.tilingScheme.ellipsoid,m=zH(r,u,0,1,r.northwestTile,r.northwestMesh,r.northTiles,r.northMeshes,r.westTiles,r.westMeshes,fve),p=zH(r,u,0,0,r.southwestTile,r.southwestMesh,r.westTiles,r.westMeshes,r.southTiles,r.southMeshes,mve),b=zH(r,u,1,0,r.southeastTile,r.southeastMesh,r.southTiles,r.southMeshes,r.eastTiles,r.eastMeshes,hve),f=zH(r,u,1,1,r.northeastTile,r.northeastMesh,r.eastTiles,r.eastMeshes,r.northTiles,r.northMeshes,pve);m=OH(r,u,0,1,m,p,f,b,fve),p=OH(r,u,0,0,p,m,b,f,mve),b=OH(r,u,1,1,b,p,f,m,hve),f=OH(r,u,1,1,f,b,m,p,pve);let y=p.height,_=b.height,S=m.height,Z=f.height,R=Math.min(y,_,S,Z),C=Math.max(y,_,S,Z),E=(R+C)*.5,A,L,F=e.getLevelMaximumGeometricError(n.level),I=u.maximumRadius-F,N=Math.acos(I/u.maximumRadius)*4;if(N*=1.5,s.width>N&&C-R<=F){let G=new wc({width:9,height:9,buffer:GEt,structure:{heightOffset:C}}),v=LEt;v.tilingScheme=n.tilingScheme,v.x=n.x,v.y=n.y,v.level=n.level,v.exaggeration=a,v.exaggerationRelativeHeight=c,r.mesh=G._createMeshSync(v)}else{let G=d,v=re.center(s,VEt);v.height=E;let X=u.cartographicToCartesian(v,AEt),Y=new Cr(X,void 0,void 0,void 0,void 0,!0,!0,G,a,c),D=5,M;for(M=r.westMeshes,A=0,L=M.length;A<L;++A)D+=M[A].eastIndicesNorthToSouth.length;for(M=r.southMeshes,A=0,L=M.length;A<L;++A)D+=M[A].northIndicesWestToEast.length;for(M=r.eastMeshes,A=0,L=M.length;A<L;++A)D+=M[A].westIndicesSouthToNorth.length;for(M=r.northMeshes,A=0,L=M.length;A<L;++A)D+=M[A].southIndicesEastToWest.length;let O=EEt;O.minimumHeight=R,O.maximumHeight=C;let w=Y.stride,z=new Float32Array(D*w),K=0,te=K;K=BH(u,s,Y,z,K,0,1,m.height,m.encodedNormal,1,O),K=KH(r,u,Y,z,K,r.westTiles,r.westMeshes,Gn.EAST,O);let H=K;K=BH(u,s,Y,z,K,0,0,p.height,p.encodedNormal,0,O),K=KH(r,u,Y,z,K,r.southTiles,r.southMeshes,Gn.NORTH,O);let $=K;K=BH(u,s,Y,z,K,1,0,b.height,b.encodedNormal,0,O),K=KH(r,u,Y,z,K,r.eastTiles,r.eastMeshes,Gn.WEST,O);let ee=K;K=BH(u,s,Y,z,K,1,1,f.height,f.encodedNormal,1,O),K=KH(r,u,Y,z,K,r.northTiles,r.northMeshes,Gn.SOUTH,O),R=O.minimumHeight,C=O.maximumHeight;let le=nn.fromRectangle(s,R,C,n.tilingScheme.ellipsoid),_e=Ti.geodeticLatitudeToMercatorAngle(s.south),he=1/(Ti.geodeticLatitudeToMercatorAngle(s.north)-_e),Ze=(Ti.geodeticLatitudeToMercatorAngle(v.latitude)-_e)*he,ye=u.geodeticSurfaceNormalCartographic(HZ,Zoe),Ge=dn.octEncode(ye,Toe),Ae=K;Y.encode(z,K*w,le.center,k.fromElements(.5,.5,rm),E,Ge,Ze,ye),++K;let Fe=K,tt=Fe<256?1:2,Be=(Fe-1)*3,je=Be*tt,qe=(z.length-Fe*w)*Float32Array.BYTES_PER_ELEMENT,We;if(qe>=je){let bt=Fe*w*Float32Array.BYTES_PER_ELEMENT;We=Fe<256?new Uint8Array(z.buffer,bt,Be):new Uint16Array(z.buffer,bt,Be)}else We=Fe<256?new Uint8Array(Be):new Uint16Array(Be);z=new Float32Array(z.buffer,0,Fe*w);let Ke=0;for(A=0;A<Fe-2;++A)We[Ke++]=Ae,We[Ke++]=A,We[Ke++]=A+1;We[Ke++]=Ae,We[Ke++]=A,We[Ke]=0;let ct=[];for(A=H;A>=te;--A)ct.push(A);let Et=[];for(A=$;A>=H;--A)Et.push(A);let zt=[];for(A=ee;A>=$;--A)zt.push(A);let ut=[];for(ut.push(0),A=Ae-1;A>=ee;--A)ut.push(A);r.mesh=new yc(Y.center,z,We,Be,Fe,R,C,s,me.fromOrientedBoundingBox(le),NEt(e,le.center,s,R,C),Y.stride,le,Y,ct,Et,zt,ut)}let g=t.context;r._destroyVertexArray(i),r.vertexArray=xh._createVertexArrayForMesh(g,r.mesh),o.processImagery(n,e.terrainProvider,t,!0);let V=r.waterMaskTexture;if(r.waterMaskTexture=void 0,e.terrainProvider.hasWaterMask){let G=o._findAncestorTileWithTerrainData(n);l(G)&&l(G.data.waterMaskTexture)&&(r.waterMaskTexture=G.data.waterMaskTexture,++r.waterMaskTexture.referenceCount,o._computeWaterMaskTranslationAndScale(n,G,r.waterMaskTranslationAndScale))}l(V)&&(--V.referenceCount,V.referenceCount===0&&V.destroy())}function BH(e,t,n,i,o,r,s,a,c,d,u){let m=HZ;m.longitude=W.lerp(t.west,t.east,r),m.latitude=W.lerp(t.south,t.north,s),m.height=a;let p=e.cartographicToCartesian(m,$E),b;n.hasGeodeticSurfaceNormals&&(b=e.geodeticSurfaceNormal(p,Zoe));let f=_oe;return f.x=r,f.y=s,n.encode(i,o*n.stride,p,f,a,c,d,b),u.minimumHeight=Math.min(u.minimumHeight,a),u.maximumHeight=Math.max(u.maximumHeight,a),o+1}var JH=new re;function Nw(e,t,n,i){let o=e.rectangle,r=t.rectangle;t.x===0&&n.x===1&&e.x===e.tilingScheme.getNumberOfXTilesAtLevel(e.level)-1?(o=re.clone(e.rectangle,JH),o.west-=W.TWO_PI,o.east-=W.TWO_PI):e.x===0&&n.x===0&&t.x===t.tilingScheme.getNumberOfXTilesAtLevel(t.level)-1&&(o=re.clone(e.rectangle,JH),o.west+=W.TWO_PI,o.east+=W.TWO_PI);let s=o.east-o.west,a=(r.west-o.west)/s,c=(r.east-o.west)/s,d=o.north-o.south,u=(r.south-o.south)/d,m=(r.north-o.south)/d,p=(n.x-a)/(c-a),b=(n.y-u)/(m-u);return Math.abs(p)<Math.EPSILON5?p=0:Math.abs(p-1)<Math.EPSILON5&&(p=1),Math.abs(b)<Math.EPSILON5?b=0:Math.abs(b-1)<Math.EPSILON5&&(b=1),i.x=p,i.y=b,i}var WEt=new k;function Soe(e,t,n,i,o){let r=e.encoding,s=e.vertices;if(o.height=r.decodeHeight(s,t),r.hasVertexNormals)r.getOctEncodedNormal(s,t,o.encodedNormal);else{let a=o.encodedNormal;a.x=0,a.y=0}}var vEt=new k,FEt=new h;function IEt(e,t,n,i,o,r,s,a,c,d){let u=i.encoding,m=i.vertices,p=Nw(t,n,u.decodeTextureCoordinates(m,o,rm),rm),b=Nw(t,n,u.decodeTextureCoordinates(m,r,_oe),_oe),f;c?f=(s-p.x)/(b.x-p.x):f=(a-p.y)/(b.y-p.y);let y=u.decodeHeight(m,o),_=u.decodeHeight(m,r),S=n.rectangle;HZ.longitude=W.lerp(S.west,S.east,s),HZ.latitude=W.lerp(S.south,S.north,a),d.height=HZ.height=W.lerp(y,_,f);let Z;if(u.hasVertexNormals){let R=u.getOctEncodedNormal(m,o,WEt),C=u.getOctEncodedNormal(m,r,vEt),E=dn.octDecode(R.x,R.y,$E),A=dn.octDecode(C.x,C.y,FEt);Z=h.lerp(E,A,f,$E),h.normalize(Z,Z),dn.octEncode(Z,d.encodedNormal)}else Z=e.geodeticSurfaceNormalCartographic(HZ,$E),dn.octEncode(Z,d.encodedNormal)}function xve(e,t,n,i,o,r){r.height=o;let s=t.geodeticSurfaceNormalCartographic(HZ,$E);dn.octEncode(s,r.encodedNormal)}function zH(e,t,n,i,o,r,s,a,c,d,u){if(gve(e,t,a,s,!1,n,i,u)||gve(e,t,d,c,!0,n,i,u))return u;let p;if(Roe(o,r))return n===0?i===0?p=r.eastIndicesNorthToSouth[0]:p=r.southIndicesEastToWest[0]:i===0?p=r.northIndicesWestToEast[0]:p=r.westIndicesSouthToNorth[0],Soe(r,p,n,i,u),u;let b;if(n===0?i===0?b=HH(e.westMeshes,e.westTiles,Gn.EAST,e.southMeshes,e.southTiles,Gn.NORTH,n,i):b=HH(e.northMeshes,e.northTiles,Gn.SOUTH,e.westMeshes,e.westTiles,Gn.EAST,n,i):i===0?b=HH(e.southMeshes,e.southTiles,Gn.NORTH,e.eastMeshes,e.eastTiles,Gn.WEST,n,i):b=HH(e.eastMeshes,e.eastTiles,Gn.WEST,e.northMeshes,e.northTiles,Gn.SOUTH,n,i),l(b))return xve(e,t,n,i,b,u),u}function HH(e,t,n,i,o,r,s,a){let c=bve(e,t,!1,n,s,a),d=bve(i,o,!0,r,s,a);return l(c)&&l(d)?(c+d)*.5:l(c)?c:d}function KH(e,t,n,i,o,r,s,a,c){for(let d=0;d<r.length;++d)o=PEt(e,t,n,i,o,r[d],s[d],a,c);return o}function PEt(e,t,n,i,o,r,s,a,c){let d;a===Gn.EAST&&e.tile.x===0?(d=re.clone(r.rectangle,JH),d.west-=W.TWO_PI,d.east-=W.TWO_PI):a===Gn.WEST&&r.x===0&&(d=re.clone(r.rectangle,JH),d.west+=W.TWO_PI,d.east+=W.TWO_PI);let u=e.tile.rectangle,m,p;o>0&&(n.decodeTextureCoordinates(i,o-1,rm),m=rm.x,p=rm.y);let b,f;switch(a){case Gn.WEST:b=s.westIndicesSouthToNorth,f=!1;break;case Gn.NORTH:b=s.northIndicesWestToEast,f=!0;break;case Gn.EAST:b=s.eastIndicesNorthToSouth,f=!1;break;case Gn.SOUTH:b=s.southIndicesEastToWest,f=!0;break}let y=r,_=e.tile,S=s.encoding,Z=s.vertices,R=n.stride,C,E;S.hasWebMercatorT&&(C=Ti.geodeticLatitudeToMercatorAngle(u.south),E=1/(Ti.geodeticLatitudeToMercatorAngle(u.north)-C));for(let A=0;A<b.length;++A){let L=b[A],F=S.decodeTextureCoordinates(Z,L,rm);Nw(y,_,F,F);let I=F.x,N=F.y,g=f?I:N;if(g<0||g>1||Math.abs(I-m)<W.EPSILON5&&Math.abs(N-p)<W.EPSILON5)continue;let V=Math.abs(I)<W.EPSILON5||Math.abs(I-1)<W.EPSILON5,G=Math.abs(N)<W.EPSILON5||Math.abs(N-1)<W.EPSILON5;if(V&&G)continue;let v=S.decodePosition(Z,L,$E),X=S.decodeHeight(Z,L),Y;S.hasVertexNormals?Y=S.getOctEncodedNormal(Z,L,Toe):(Y=Toe,Y.x=0,Y.y=0);let D=N;if(S.hasWebMercatorT){let O=W.lerp(u.south,u.north,N);D=(Ti.geodeticLatitudeToMercatorAngle(O)-C)*E}let M;n.hasGeodeticSurfaceNormals&&(M=t.geodeticSurfaceNormal(v,Zoe)),n.encode(i,o*R,v,F,X,Y,D,M),c.minimumHeight=Math.min(c.minimumHeight,X),c.maximumHeight=Math.max(c.maximumHeight,X),++o}return o}function bve(e,t,n,i,o,r){let s,a,c;n?(s=0,a=e.length,c=1):(s=e.length-1,a=-1,c=-1);for(let d=s;d!==a;d+=c){let u=e[d],m=t[d];if(!Roe(m,u))continue;let p;switch(i){case Gn.WEST:p=u.westIndicesSouthToNorth;break;case Gn.SOUTH:p=u.southIndicesEastToWest;break;case Gn.EAST:p=u.eastIndicesNorthToSouth;break;case Gn.NORTH:p=u.northIndicesWestToEast;break}let b=p[n?0:p.length-1];if(l(b))return u.encoding.decodeHeight(u.vertices,b)}}function Roe(e,t){return l(t)&&(!l(e.data.fill)||!e.data.fill.changedThisFrame)}function gve(e,t,n,i,o,r,s,a){let c,d,u,m,p,b=i[o?0:n.length-1],f=n[o?0:n.length-1];if(Roe(b,f)&&(r===0?s===0?(c=o?f.northIndicesWestToEast:f.eastIndicesNorthToSouth,d=o,u=o):(c=o?f.eastIndicesNorthToSouth:f.southIndicesEastToWest,d=!o,u=!1):s===0?(c=o?f.westIndicesSouthToNorth:f.northIndicesWestToEast,d=!o,u=!0):(c=o?f.southIndicesEastToWest:f.westIndicesSouthToNorth,d=o,u=!o),c.length>0)){m=o?0:c.length-1,p=c[m],f.encoding.decodeTextureCoordinates(f.vertices,p,rm);let y=Nw(b,e.tile,rm,rm);if(y.x===r&&y.y===s)return Soe(f,p,r,s,a),!0;if(m=Eo(c,d?r:s,function(_,S){f.encoding.decodeTextureCoordinates(f.vertices,_,rm);let Z=Nw(b,e.tile,rm,rm);return u?d?Z.x-r:Z.y-s:d?r-Z.x:s-Z.y}),m<0){if(m=~m,m>0&&m<c.length)return IEt(t,b,e.tile,f,c[m-1],c[m],r,s,d,a),!0}else return Soe(f,c[m],r,s,a),!0}return!1}var XEt=[new h,new h,new h,new h];function NEt(e,t,n,i,o,r){let s=e.quadtree._occluders.ellipsoid,a=s.ellipsoid,c=XEt;return h.fromRadians(n.west,n.south,o,a,c[0]),h.fromRadians(n.east,n.south,o,a,c[1]),h.fromRadians(n.west,n.north,o,a,c[2]),h.fromRadians(n.east,n.north,o,a,c[3]),s.computeHorizonCullingPointPossiblyUnderEllipsoid(t,c,i,r)}var tA=eA;var Coe=class e{constructor(t){this.lightingFadeOutDistance=65e5,this.lightingFadeInDistance=9e6,this.hasWaterMask=!1,this.showWaterEffect=!1,this.oceanNormalMap=void 0,this.zoomedOutOceanSpecularIntensity=.5,this.enableLighting=!1,this.dynamicAtmosphereLighting=!1,this.dynamicAtmosphereLightingFromSun=!1,this.showGroundAtmosphere=!1,this.shadows=vn.RECEIVE_ONLY,this.vertexShadowDarkness=.3,this.fillHighlightColor=void 0,this.hueShift=0,this.saturationShift=0,this.brightnessShift=0,this.showSkirts=!0,this.backFaceCulling=!0,this.undergroundColor=void 0,this.undergroundColorAlphaByDistance=void 0,this.lambertDiffuseMultiplier=0,this.materialUniformMap=void 0,this._materialUniformMap=void 0,this._quadtree=void 0,this._terrainProvider=t.terrainProvider,this._vectorProvider=t.vectorProvider,this._imageryLayers=t.imageryLayers,this._surfaceShaderSet=t.surfaceShaderSet,this._renderState=void 0,this._blendRenderState=void 0,this._disableCullingRenderState=void 0,this._disableCullingBlendRenderState=void 0,this._errorEvent=new Se,this._removeLayerAddedListener=this._imageryLayers.layerAdded.addEventListener(e.prototype._onLayerAdded,this),this._removeLayerRemovedListener=this._imageryLayers.layerRemoved.addEventListener(e.prototype._onLayerRemoved,this),this._removeLayerMovedListener=this._imageryLayers.layerMoved.addEventListener(e.prototype._onLayerMoved,this),this._removeLayerShownListener=this._imageryLayers.layerShownOrHidden.addEventListener(e.prototype._onLayerShownOrHidden,this),this._imageryLayersUpdatedEvent=new Se,this._layerOrderChanged=!1,this._tilesToRenderByTextureCount=[],this._drawCommands=[],this._uniformMaps=[],this._usedDrawCommands=0,this._vertexArraysToDestroy=[],this._debug={wireframe:!1,boundingSphereTile:void 0,tilesRendered:0,texturesRendered:0},this._baseColor=void 0,this._firstPassInitialColor=void 0,this.baseColor=new U(0,0,.5,1),this._clippingPlanes=void 0,this._clippingPolygons=void 0,this._clippingPolygonsDirty=!1,this._removeClippingPolygonAdded=void 0,this._removeClippingPolygonRemoved=void 0,this.cartographicLimitRectangle=re.clone(re.MAX_VALUE),this._hasLoadedTilesThisFrame=!1,this._hasFillTilesThisFrame=!1,this._oldVerticalExaggeration=void 0,this._oldVerticalExaggerationRelativeHeight=void 0,this._oldSceneMode=se.SCENE3D}get baseColor(){return this._baseColor}set baseColor(t){this._baseColor=t,this._firstPassInitialColor=ce.fromColor(t,this._firstPassInitialColor)}get quadtree(){return this._quadtree}set quadtree(t){this._quadtree=t}get tilingScheme(){if(l(this._terrainProvider))return this._terrainProvider.tilingScheme}get errorEvent(){return this._errorEvent}get imageryLayersUpdatedEvent(){return this._imageryLayersUpdatedEvent}get terrainProvider(){return this._terrainProvider}set terrainProvider(t){this._terrainProvider!==t&&(this._terrainProvider=t,l(this._quadtree)&&this._quadtree.invalidateAllTiles())}get vectorProvider(){return this._vectorProvider}get clippingPlanes(){return this._clippingPlanes}set clippingPlanes(t){gs.setOwner(t,this,"_clippingPlanes")}get clippingPolygons(){return this._clippingPolygons}set clippingPolygons(t){if(t===this._clippingPolygons||(vc.setOwner(t,this,"_clippingPolygons"),this._removeClippingPolygonAdded=this._removeClippingPolygonAdded&&this._removeClippingPolygonAdded(),this._removeClippingPolygonRemoved=this._removeClippingPolygonRemoved&&this._removeClippingPolygonRemoved(),this._clippingPolygonsDirty=!0,!l(t)))return;let n=()=>{this._clippingPolygonsDirty=!0};this._removeClippingPolygonAdded=t.polygonAdded.addEventListener(n),this._removeClippingPolygonRemoved=t.polygonRemoved.addEventListener(n)}update(t){this._imageryLayers._update()}initialize(t){this._imageryLayers.queueReprojectionCommands(t),this._layerOrderChanged&&(this._layerOrderChanged=!1,this._quadtree.forEachLoadedTile(function(r){r.data.imagery.sort(wEt)}));let n=this._vectorProvider;n.minimumTileScreenPixels=MEt(this),n.update(t.frameNumber),this._quadtree.forEachRenderedTile(r=>{let s=r.data;l(s.vectorData)?s.vectorData=n.updateTileData(r.x,r.y,r.level,t.context,s.vectorData,He.CLAMP_TO_TERRAIN):s.vectorData=n.requestTileData(r.x,r.y,r.level,t.context,He.CLAMP_TO_TERRAIN)}),n.makeClean(),OEt(this,t);let i=this._vertexArraysToDestroy,o=i.length;for(let r=0;r<o;++r)xh._freeVertexArray(i[r]);i.length=0}beginUpdate(t){let n=this._tilesToRenderByTextureCount;for(let r=0,s=n.length;r<s;++r){let a=n[r];l(a)&&(a.length=0)}let i=this._clippingPlanes;l(i)&&i.enabled&&i.update(t);let o=this._clippingPolygons;l(o)&&o.enabled&&o.update(t),this._usedDrawCommands=0,this._hasLoadedTilesThisFrame=!1,this._hasFillTilesThisFrame=!1}endUpdate(t){if(!l(this._renderState)){this._renderState=ze.fromCache({cull:{enabled:!0},depthTest:{enabled:!0,func:sc.LESS}}),this._blendRenderState=ze.fromCache({cull:{enabled:!0},depthTest:{enabled:!0,func:sc.LESS_OR_EQUAL},blending:on.ALPHA_BLEND});let c=$e(this._renderState,!0);c.cull.enabled=!1,this._disableCullingRenderState=ze.fromCache(c),c=$e(this._blendRenderState,!0),c.cull.enabled=!1,this._disableCullingBlendRenderState=ze.fromCache(c)}this._hasFillTilesThisFrame&&this._hasLoadedTilesThisFrame&&tA.updateFillTiles(this,this._quadtree._tilesToRender,t,this._vertexArraysToDestroy);let n=this.quadtree,i=t.verticalExaggeration,o=t.verticalExaggerationRelativeHeight,r=this._oldVerticalExaggeration!==i||this._oldVerticalExaggerationRelativeHeight!==o;this._oldVerticalExaggeration=i,this._oldVerticalExaggerationRelativeHeight=o,r&&n.forEachLoadedTile(function(c){c.data.updateExaggeration(c,t,n)});let s=this._oldSceneMode!==t.mode;this._oldSceneMode=t.mode,s&&n.forEachLoadedTile(function(c){c.data.updateSceneMode(t.mode)}),this._clippingPolygonsDirty&&kEt(this);let a=this._tilesToRenderByTextureCount;for(let c=0,d=a.length;c<d;++c){let u=a[c];if(l(u))for(let m=0,p=u.length;m<p;++m){let b=u[m],f=b.data;UEt(this,b,f,t);let y=f.tileBoundingRegion;fAt(this,b,t),t.minimumTerrainHeight=Math.min(t.minimumTerrainHeight,y.minimumHeight)}}}updateForPick(t){let n=this._drawCommands;for(let i=0,o=this._usedDrawCommands;i<o;++i){let r=n[i];r.dirty=!0,r.derivedCommands.picking=void 0;let s=r.derivedCommands.logDepth?.command;l(s)&&(s.derivedCommands.picking=void 0),Rve(r,t)}}cancelReprojections(){this._imageryLayers.cancelReprojections()}getLevelMaximumGeometricError(t){return l(this._terrainProvider)?this._terrainProvider.getLevelMaximumGeometricError(t):0}loadTile(t,n){let i=n.data,o=!0,r;l(i)&&(o=i.boundingVolumeSourceTile!==n||n._lastSelectionResult===gi.CULLED_BUT_NEEDED,r=i.terrainState),xh.processStateMachine(n,t,this.terrainProvider,this.vectorProvider,this._imageryLayers,this.quadtree,this._vertexArraysToDestroy,o),i=n.data,o&&r!==i.terrainState&&this.computeTileVisibility(n,t,this.quadtree.occluders)!==Jr.NONE&&i.boundingVolumeSourceTile===n&&(o=!1,xh.processStateMachine(n,t,this.terrainProvider,this.vectorProvider,this._imageryLayers,this.quadtree,this._vertexArraysToDestroy,o))}computeTileVisibility(t,n,i){let o=this.computeDistanceToTile(t,n);t._distance=o;let r=Vve(this,n);if(n.fog.enabled&&!r&&W.fog(o,n.fog.density)>=1)return Jr.NONE;let s=t.data,a=s.tileBoundingRegion;if(s.boundingVolumeSourceTile===void 0)return Jr.PARTIAL;let c=n.cullingVolume,d=a.boundingVolume;l(d)||(d=a.boundingSphere),s.clippedByBoundaries=!1;let u=qH(t.rectangle,this.cartographicLimitRectangle),m=re.simpleIntersection(u,t.rectangle,Cve);if(!l(m))return Jr.NONE;if(re.equals(m,t.rectangle)||(s.clippedByBoundaries=!0),n.mode!==se.SCENE3D&&(d=BEt,me.fromRectangleWithHeights2D(t.rectangle,n.mapProjection,a.minimumHeight,a.maximumHeight,d),h.fromElements(d.center.z,d.center.x,d.center.y,d.center),n.mode===se.MORPHING&&l(s.renderedMesh)&&(d=me.union(a.boundingSphere,d,d))),!l(d))return Jr.PARTIAL;let p=this._clippingPlanes;if(l(p)&&p.enabled){let S=p.computeIntersectionWithBoundingVolume(d);if(t.isClipped=S!==qt.INSIDE,S===qt.OUTSIDE)return Jr.NONE}let b=this._clippingPolygons;if(l(b)&&b.enabled){let S=b.computeIntersectionWithBoundingVolume(a);t.isClipped=S!==qt.OUTSIDE}let f,y=c.computeVisibility(d);if(y===qt.OUTSIDE?f=Jr.NONE:y===qt.INTERSECTING?f=Jr.PARTIAL:y===qt.INSIDE&&(f=Jr.FULL),f===Jr.NONE)return f;let _=n.mode===se.SCENE3D&&n.camera.frustum instanceof yn;if(n.mode===se.SCENE3D&&!_&&l(i)&&!r){let S=s.occludeePointInScaledSpace;return!l(S)||i.ellipsoid.isScaledSpacePointVisiblePossiblyUnderEllipsoid(S,a.minimumHeight)?f:Jr.NONE}return f}canRefine(t){let n=t.data;return l(n.terrainData)?!0:this.terrainProvider.getTileDataAvailable(t.x*2,t.y*2,t.level+1)!==void 0}canRenderWithoutLosingDetail(t){let n=t.data,i=KEt;i.length=this._imageryLayers.length;let o=!1,r=!1,s;l(n)&&(o=n.terrainState===wo.READY,r=!0,s=n.imagery);let a,c;for(a=0,c=i.length;a<c;++a)i[a]=r;if(l(s))for(a=0,c=s.length;a<c;++a){let m=s[a],p=m.loadingImagery,b=!l(p)||p.state===Dn.FAILED||p.state===Dn.INVALID,f=(m.loadingImagery||m.readyImagery).imageryLayer._layerIndex;i[f]=b&&i[f]}let d=this.quadtree._lastSelectionFrameNumber,u=JEt;for(u.length=0,u.push(t.southwestChild,t.southeastChild,t.northwestChild,t.northeastChild);u.length>0;){let m=u.pop(),p=m._lastSelectionResultFrame===d?m._lastSelectionResult:gi.NONE;if(p===gi.RENDERED){let b=m.data;if(!l(b))continue;if(!o&&m.data.terrainState===wo.READY)return!1;let f=m.data.imagery;for(a=0,c=f.length;a<c;++a){let y=f[a],_=y.loadingImagery,S=!l(_)||_.state===Dn.FAILED||_.state===Dn.INVALID,Z=(y.loadingImagery||y.readyImagery).imageryLayer._layerIndex;if(S&&!i[Z])return!1}}else p===gi.REFINED&&u.push(m.southwestChild,m.southeastChild,m.northwestChild,m.northeastChild)}return!0}computeTileLoadPriority(t,n){let i=t.data;if(i===void 0)return 0;let o=i.tileBoundingRegion.boundingVolume;if(o===void 0)return 0;let r=n.camera.positionWC,s=n.camera.directionWC,a=h.subtract(o.center,r,jEt),c=h.magnitude(a);return c<W.EPSILON5?0:(h.divideByScalar(a,c,a),(1-h.dot(a,s))*t._distance)}showTileThisFrame(t,n){let i=0,o=t.data,r=o.imagery;for(let c=0,d=r.length;c<d;++c){let u=r[c];l(u.readyImagery)&&u.readyImagery.imageryLayer.alpha!==0&&++i}let s=this._tilesToRenderByTextureCount[i];l(s)||(s=[],this._tilesToRenderByTextureCount[i]=s),s.push(t),l(o.vertexArray)?this._hasLoadedTilesThisFrame=!0:this._hasFillTilesThisFrame=!0;let a=this._debug;++a.tilesRendered,a.texturesRendered+=i}computeDistanceToTile(t,n){oAt(t,this,n);let i=t.data;if(i.boundingVolumeSourceTile===void 0)return 9999999999;let r=i.tileBoundingRegion,s=r.minimumHeight,a=r.maximumHeight;if(i.boundingVolumeSourceTile!==t){let d=n.camera.positionCartographic.height,u=Math.abs(d-s),m=Math.abs(d-a);u>m?(r.minimumHeight=s,r.maximumHeight=s):(r.minimumHeight=a,r.maximumHeight=a)}let c=r.distanceToCamera(n);return r.minimumHeight=s,r.maximumHeight=a,c}isDestroyed(){return!1}destroy(){return this._tileProvider=this._tileProvider&&this._tileProvider.destroy(),this._clippingPlanes=this._clippingPlanes&&this._clippingPlanes.destroy(),this._clippingPolygons=void 0,this._removeLayerAddedListener=this._removeLayerAddedListener&&this._removeLayerAddedListener(),this._removeLayerRemovedListener=this._removeLayerRemovedListener&&this._removeLayerRemovedListener(),this._removeLayerMovedListener=this._removeLayerMovedListener&&this._removeLayerMovedListener(),this._removeLayerShownListener=this._removeLayerShownListener&&this._removeLayerShownListener(),this._removeClippingPolygonAdded=this._removeClippingPolygonAdded&&this._removeClippingPolygonAdded(),this._removeClippingPolygonRemoved=this._removeClippingPolygonRemoved&&this._removeClippingPolygonRemoved(),ue(this)}_onLayerAdded(t,n){if(!this.isDestroyed()&&t.show){let i=this._terrainProvider,o=this,r=this._imageryLayersUpdatedEvent,s=function(){t._imageryCache={},o._quadtree.forEachLoadedTile(function(a){if(l(a._loadedCallbacks[t._layerIndex]))return;let c,d=a.data.imagery,u=d.length,m=-1,p=0;for(c=0;c<u;++c){let f=d[c];if((f.readyImagery??f.loadingImagery).imageryLayer===t)m===-1&&(m=c),++p;else if(m!==-1)break}if(m===-1)return;let b=m+p;t._createTileImagerySkeletons(a,i,b)&&(a._loadedCallbacks[t._layerIndex]=rAt(p,t,i),a.state=Ja.LOADING)})};if(t.ready){let a=t.imageryProvider;a._reload=s}this._quadtree.forEachLoadedTile(function(a){t._createTileImagerySkeletons(a,i)&&(a.state=Ja.LOADING,a.level!==0&&(a._lastSelectionResultFrame!==o.quadtree._lastSelectionFrameNumber||a._lastSelectionResult!==gi.RENDERED)&&(a.renderable=!1))}),this._layerOrderChanged=!0,r.raiseEvent()}}_onLayerRemoved(t,n){this._quadtree.forEachLoadedTile(function(i){let o=i.data.imagery,r=-1,s=0;for(let a=0,c=o.length;a<c;++a){let d=o[a],u=d.loadingImagery;if(l(u)||(u=d.readyImagery),u.imageryLayer===t)r===-1&&(r=a),d.freeResources(),++s;else if(r!==-1)break}r!==-1&&o.splice(r,s)}),l(t.imageryProvider)&&(t.imageryProvider._reload=void 0),this._imageryLayersUpdatedEvent.raiseEvent()}_onLayerMoved(t,n,i){this._layerOrderChanged=!0,this._imageryLayersUpdatedEvent.raiseEvent()}_onLayerShownOrHidden(t,n,i){i?this._onLayerAdded(t,n):this._onLayerRemoved(t,n)}},YEt=new re;function MEt(e){let t=e.getLevelMaximumGeometricError(0);if(t<=0)return e._vectorProvider.minimumTileScreenPixels;let n=e.tilingScheme;return n.tileXYToRectangle(0,0,0,YEt).width*n.ellipsoid.maximumRadius/t*e._quadtree.maximumScreenSpaceError/2}function wEt(e,t){let n=e.loadingImagery;l(n)||(n=e.readyImagery);let i=t.loadingImagery;return l(i)||(i=t.readyImagery),n.imageryLayer._layerIndex-i.imageryLayer._layerIndex}function kEt(e){e._quadtree.forEachLoadedTile(function(t){let n=t.data;l(n?.clippingPolygonData)&&(vc.releaseRectangleData(n.clippingPolygonData),n.clippingPolygonData=void 0)}),e._clippingPolygonsDirty=!1}function UEt(e,t,n,i){let o=e._clippingPolygons;!l(o)||!o.enabled||!t.isClipped||l(n.clippingPolygonData)||(n.clippingPolygonData=o.requestRectangleData(t.rectangle,i.context))}function DEt(e,t){let n=e._clippingPolygons;return l(n)&&n.enabled&&n.length>0&&n.inverse&&(t.clippingPolygonData?.polygonRings.length??0)===0}function OEt(e,t){let n=t.creditDisplay,i=e._terrainProvider;l(i)&&l(i.credit)&&n.addCreditToNextFrame(i.credit);let o=e._imageryLayers;for(let r=0,s=o.length;r<s;++r){let a=o.get(r);a.ready&&a.show&&l(a.imageryProvider.credit)&&n.addCreditToNextFrame(a.imageryProvider.credit)}}function Rve(e,t){let n=t.globeTranslucencyState;if(n.translucent){let i=e.renderState.blending.enabled;n.pushDerivedCommands(e,i,t)}else t.commandList.push(e)}var BEt=new me,Cve=new re,zEt=new re,HEt=new pe;function qH(e,t){if(t.west<t.east)return t;let n=re.clone(t,zEt);return re.center(e,HEt).longitude>0?n.east=W.PI:n.west=-W.PI,n}function Vve(e,t){if(t.cameraUnderground||t.globeTranslucencyState.translucent)return!0;if(e.backFaceCulling)return!1;let n=e._clippingPlanes;if(l(n)&&n.enabled)return!0;let i=e._clippingPolygons;return!!(l(i)&&i.enabled||!re.equals(e.cartographicLimitRectangle,re.MAX_VALUE))}var KEt=[],JEt=[],jEt=new h,Tve=new P,QH=new P,QEt=new ce,qEt=new ce,$Et=new ce,eAt=new h,_ve=new h,tAt=new h,nAt=new h,iAt=[new h,new h,new h,new h];function Sve(e,t,n,i,o,r){let s=e.quadtree._occluders.ellipsoid,a=s.ellipsoid,c=iAt;return h.fromRadians(n.west,n.south,o,a,c[0]),h.fromRadians(n.east,n.south,o,a,c[1]),h.fromRadians(n.west,n.north,o,a,c[2]),h.fromRadians(n.east,n.north,o,a,c[3]),s.computeHorizonCullingPointPossiblyUnderEllipsoid(t,c,i,r)}function oAt(e,t,n){let i=e.data;i===void 0&&(i=e.data=new xh);let o=e.tilingScheme.ellipsoid;i.tileBoundingRegion===void 0&&(i.tileBoundingRegion=new Uu({computeBoundingVolumes:!1,rectangle:e.rectangle,ellipsoid:o,minimumHeight:0,maximumHeight:0}));let r=i.tileBoundingRegion,s=r.minimumHeight,a=r.maximumHeight,c=!1,d=e,u=i.mesh,m=i.terrainData;if(u!==void 0&&u.minimumHeight!==void 0&&u.maximumHeight!==void 0)r.minimumHeight=u.minimumHeight,r.maximumHeight=u.maximumHeight,c=!0;else if(m!==void 0&&m._minimumHeight!==void 0&&m._maximumHeight!==void 0)r.minimumHeight=m._minimumHeight,r.maximumHeight=m._maximumHeight;else{r.minimumHeight=Number.NaN,r.maximumHeight=Number.NaN;let p=e.parent;for(;p!==void 0;){let b=p.data;if(b!==void 0){let f=b.mesh,y=b.terrainData;if(f!==void 0&&f.minimumHeight!==void 0&&f.maximumHeight!==void 0){r.minimumHeight=f.minimumHeight,r.maximumHeight=f.maximumHeight;break}else if(y!==void 0&&y._minimumHeight!==void 0&&y._maximumHeight!==void 0){r.minimumHeight=y._minimumHeight,r.maximumHeight=y._maximumHeight;break}}p=p.parent}d=p}if(d!==void 0){let p=n.verticalExaggeration,b=n.verticalExaggerationRelativeHeight;if(p!==1&&(c=!1,r.minimumHeight=_o.getHeight(r.minimumHeight,p,b),r.maximumHeight=_o.getHeight(r.maximumHeight,p,b)),c)i.boundingVolumeIsFromMesh||(r._orientedBoundingBox=nn.clone(u.orientedBoundingBox,r._orientedBoundingBox),r._boundingSphere=me.clone(u.boundingSphere3D,r._boundingSphere),i.occludeePointInScaledSpace=h.clone(u.occludeePointInScaledSpace,i.occludeePointInScaledSpace),l(i.occludeePointInScaledSpace)||(i.occludeePointInScaledSpace=Sve(t,r._orientedBoundingBox.center,e.rectangle,r.minimumHeight,r.maximumHeight,i.occludeePointInScaledSpace)));else{let y=r._orientedBoundingBox===void 0||r._boundingSphere===void 0;(r.minimumHeight!==s||r.maximumHeight!==a||y)&&(r.computeBoundingVolumes(o),i.occludeePointInScaledSpace=Sve(t,r._orientedBoundingBox.center,e.rectangle,r.minimumHeight,r.maximumHeight,i.occludeePointInScaledSpace))}i.boundingVolumeSourceTile=d,i.boundingVolumeIsFromMesh=c}else i.boundingVolumeSourceTile=void 0,i.boundingVolumeIsFromMesh=!1}function rAt(e,t,n){return function(i){let o,r,s=-1,a=i.data.imagery,c=a.length,d;for(d=0;d<c;++d)if(o=a[d],r=o.readyImagery??o.loadingImagery,r.imageryLayer===t){s=d;break}if(s!==-1){let u=s+e;if(o=a[u],r=l(o)?o.readyImagery??o.loadingImagery:void 0,!l(r)||r.imageryLayer!==t)return!t._createTileImagerySkeletons(i,n,u);for(d=s;d<u;++d)a[d].freeResources();a.splice(s,e)}return!0}}var sAt=new P,aAt=new P;function Zve(e,t){let n={u_initialColor:function(){return this.properties.initialColor},u_fillHighlightColor:function(){return this.properties.fillHighlightColor},u_zoomedOutOceanSpecularIntensity:function(){return this.properties.zoomedOutOceanSpecularIntensity},u_oceanNormalMap:function(){return this.properties.oceanNormalMap},u_atmosphereLightIntensity:function(){return this.properties.atmosphereLightIntensity},u_atmosphereRayleighCoefficient:function(){return this.properties.atmosphereRayleighCoefficient},u_atmosphereMieCoefficient:function(){return this.properties.atmosphereMieCoefficient},u_atmosphereRayleighScaleHeight:function(){return this.properties.atmosphereRayleighScaleHeight},u_atmosphereMieScaleHeight:function(){return this.properties.atmosphereMieScaleHeight},u_atmosphereMieAnisotropy:function(){return this.properties.atmosphereMieAnisotropy},u_lightingFadeDistance:function(){return this.properties.lightingFadeDistance},u_nightFadeDistance:function(){return this.properties.nightFadeDistance},u_center3D:function(){return this.properties.center3D},u_verticalExaggerationAndRelativeHeight:function(){return this.properties.verticalExaggerationAndRelativeHeight},u_tileRectangle:function(){return this.properties.tileRectangle},u_modifiedModelView:function(){let i=e.context.uniformState.view,o=P.multiplyByPoint(i,this.properties.rtc,_ve);return P.setTranslation(i,o,Tve),Tve},u_modifiedModelViewProjection:function(){let i=e.context.uniformState.view,o=e.context.uniformState.projection,r=P.multiplyByPoint(i,this.properties.rtc,_ve);return P.setTranslation(i,r,QH),P.multiply(o,QH,QH),QH},u_dayTextures:function(){return this.properties.dayTextures},u_dayTextureTranslationAndScale:function(){return this.properties.dayTextureTranslationAndScale},u_dayTextureTexCoordsRectangle:function(){return this.properties.dayTextureTexCoordsRectangle},u_dayTextureUseWebMercatorT:function(){return this.properties.dayTextureUseWebMercatorT},u_dayTextureAlpha:function(){return this.properties.dayTextureAlpha},u_dayTextureNightAlpha:function(){return this.properties.dayTextureNightAlpha},u_dayTextureDayAlpha:function(){return this.properties.dayTextureDayAlpha},u_dayTextureBrightness:function(){return this.properties.dayTextureBrightness},u_dayTextureContrast:function(){return this.properties.dayTextureContrast},u_dayTextureHue:function(){return this.properties.dayTextureHue},u_dayTextureSaturation:function(){return this.properties.dayTextureSaturation},u_dayTextureOneOverGamma:function(){return this.properties.dayTextureOneOverGamma},u_dayIntensity:function(){return this.properties.dayIntensity},u_southAndNorthLatitude:function(){return this.properties.southAndNorthLatitude},u_southMercatorYAndOneOverHeight:function(){return this.properties.southMercatorYAndOneOverHeight},u_waterMask:function(){return this.properties.waterMask},u_waterMaskTranslationAndScale:function(){return this.properties.waterMaskTranslationAndScale},u_minMaxHeight:function(){return this.properties.minMaxHeight},u_scaleAndBias:function(){return this.properties.scaleAndBias},u_dayTextureSplit:function(){return this.properties.dayTextureSplit},u_dayTextureCutoutRectangles:function(){return this.properties.dayTextureCutoutRectangles},u_clippingPlanes:function(){let i=t._clippingPlanes;return l(i)&&l(i.texture)?i.texture:e.context.defaultTexture},u_cartographicLimitRectangle:function(){return this.properties.localizedCartographicLimitRectangle},u_clippingPlanesMatrix:function(){let i=t._clippingPlanes,o=l(i)?P.multiply(e.context.uniformState.view,i.modelMatrix,sAt):P.IDENTITY;return P.inverseTranspose(o,aAt)},u_clippingPlanesEdgeStyle:function(){let i=this.properties.clippingPlanesEdgeColor;return i.alpha=this.properties.clippingPlanesEdgeWidth,i},u_minimumBrightness:function(){return e.fog.minimumBrightness},u_hsbShift:function(){return this.properties.hsbShift},u_colorsToAlpha:function(){return this.properties.colorsToAlpha},u_frontFaceAlphaByDistance:function(){return this.properties.frontFaceAlphaByDistance},u_backFaceAlphaByDistance:function(){return this.properties.backFaceAlphaByDistance},u_translucencyRectangle:function(){return this.properties.localizedTranslucencyRectangle},u_undergroundColor:function(){return this.properties.undergroundColor},u_undergroundColorAlphaByDistance:function(){return this.properties.undergroundColorAlphaByDistance},u_lambertDiffuseMultiplier:function(){return this.properties.lambertDiffuseMultiplier},u_vertexShadowDarkness:function(){return this.properties.vertexShadowDarkness},u_vectorSegmentTexture:function(){return this.properties.vectorSegmentTexture??e.context.defaultTexture},u_vectorWidthTexture:function(){return this.properties.vectorWidthTexture??e.context.defaultTexture},u_vectorColorTexture:function(){return this.properties.vectorColorTexture??e.context.defaultTexture},u_vectorPickColorTexture:function(){return this.properties.vectorPickColorTexture??e.context.defaultTexture},u_vectorSegmentPrimitiveIndicesTexture:function(){return this.properties.vectorSegmentPrimitiveIndicesTexture??e.context.defaultTexture},u_vectorGridCellIndicesTexture:function(){return this.properties.vectorGridCellIndicesTexture??e.context.defaultTexture},u_vectorPolygonEdgeTexture:function(){return this.properties.vectorPolygonEdgeTexture??e.context.defaultTexture},u_vectorPolygonEdgePrimitiveIndicesTexture:function(){return this.properties.vectorPolygonEdgePrimitiveIndicesTexture??e.context.defaultTexture},u_vectorPolygonGridCellIndicesTexture:function(){return this.properties.vectorPolygonGridCellIndicesTexture??e.context.defaultTexture},u_vectorMetersPerUv:function(){return this.properties.vectorMetersPerUv},u_clippingEdgeTexture:function(){return this.properties.clippingEdgeTexture??e.context.defaultTexture},u_clippingEdgePrimitiveIndicesTexture:function(){return this.properties.clippingEdgePrimitiveIndicesTexture??e.context.defaultTexture},u_clippingGridCellIndicesTexture:function(){return this.properties.clippingGridCellIndicesTexture??e.context.defaultTexture},properties:{initialColor:new ce(0,0,.5,1),fillHighlightColor:new U(0,0,0,0),zoomedOutOceanSpecularIntensity:.5,oceanNormalMap:void 0,lightingFadeDistance:new k(65e5,9e6),nightFadeDistance:new k(1e7,4e7),atmosphereLightIntensity:10,atmosphereRayleighCoefficient:new h(55e-7,13e-6,284e-7),atmosphereMieCoefficient:new h(21e-6,21e-6,21e-6),atmosphereRayleighScaleHeight:1e4,atmosphereMieScaleHeight:3200,atmosphereMieAnisotropy:.9,hsbShift:new h,center3D:void 0,rtc:new h,modifiedModelView:new P,tileRectangle:new ce,verticalExaggerationAndRelativeHeight:new k(1,0),dayTextures:[],dayTextureTranslationAndScale:[],dayTextureTexCoordsRectangle:[],dayTextureUseWebMercatorT:[],dayTextureAlpha:[],dayTextureNightAlpha:[],dayTextureDayAlpha:[],dayTextureBrightness:[],dayTextureContrast:[],dayTextureHue:[],dayTextureSaturation:[],dayTextureOneOverGamma:[],dayTextureSplit:[],dayTextureCutoutRectangles:[],dayIntensity:0,colorsToAlpha:[],southAndNorthLatitude:new k,southMercatorYAndOneOverHeight:new k,waterMask:void 0,waterMaskTranslationAndScale:new ce,minMaxHeight:new k,scaleAndBias:new P,clippingPlanesEdgeColor:U.clone(U.WHITE),clippingPlanesEdgeWidth:0,localizedCartographicLimitRectangle:new ce,frontFaceAlphaByDistance:new ce,backFaceAlphaByDistance:new ce,localizedTranslucencyRectangle:new ce,undergroundColor:U.clone(U.TRANSPARENT),undergroundColorAlphaByDistance:new ce,lambertDiffuseMultiplier:0,vertexShadowDarkness:0,vectorSegmentTexture:void 0,vectorWidthTexture:void 0,vectorColorTexture:void 0,vectorPickColorTexture:void 0,vectorSegmentPrimitiveIndicesTexture:void 0,vectorGridCellIndicesTexture:void 0,vectorPolygonEdgeTexture:void 0,vectorPolygonEdgePrimitiveIndicesTexture:void 0,vectorPolygonGridCellIndicesTexture:void 0,vectorMetersPerUv:new k,clippingEdgeTexture:void 0,clippingEdgePrimitiveIndicesTexture:void 0,clippingGridCellIndicesTexture:void 0}};return l(t.materialUniformMap)?It(n,t.materialUniformMap):n}function cAt(e,t){let n=t.data,i,o;if(l(n.vertexArray)?(i=n.mesh,o=n.vertexArray):l(n.fill)&&l(n.fill.vertexArray)&&(i=n.fill.mesh,o=n.fill.vertexArray),!(!l(i)||!l(o))){if(l(n.wireframeVertexArray)){if(n.wireframeVertexArray.mesh===i)return;n.wireframeVertexArray.destroy(),n.wireframeVertexArray=void 0}n.wireframeVertexArray=lAt(e,o,i),n.wireframeVertexArray.mesh=i}}function lAt(e,t,n){let o={indices:n.indices,primitiveType:Ie.TRIANGLES};Bn.toWireframe(o);let r=o.indices,s=it.createIndexBuffer({context:e,typedArray:r,usage:Pe.STATIC_DRAW,indexDatatype:Oe.fromSizeInBytes(r.BYTES_PER_ELEMENT)});return new Un({context:e,attributes:t._attributes,indexBuffer:s})}var Eve,Ave,$H;(function(){let e=new Yt({geometry:Bh.fromDimensions({dimensions:new h(2,2,2)})}),t=new Yt({geometry:new fg({radius:1})}),n=new P,i,o;function r(s){return new In({geometryInstances:s,appearance:new Tn({translucent:!1,flat:!0}),asynchronous:!1})}Eve=function(s,a){return s===i||($H(),i=s,n=P.fromRotationTranslation(s.halfAxes,s.center,n),e.modelMatrix=n,e.attributes.color=$t.fromColor(a),o=r(e)),o},Ave=function(s,a){return s===i||($H(),i=s,n=P.fromTranslation(s.center,n),n=P.multiplyByUniformScale(n,s.radius,n),t.modelMatrix=n,t.attributes.color=$t.fromColor(a),o=r(t)),o},$H=function(){l(o)&&(o.destroy(),o=void 0,i=void 0)}})();var dAt=new ce(0,0,0,0),uAt={frameState:void 0,surfaceTile:void 0,numberOfDayTextures:void 0,applyBrightness:void 0,applyContrast:void 0,applyHue:void 0,applySaturation:void 0,applyGamma:void 0,applyAlpha:void 0,applyDayNightAlpha:void 0,applySplit:void 0,showReflectiveOcean:void 0,showOceanWaves:void 0,enableLighting:void 0,dynamicAtmosphereLighting:void 0,dynamicAtmosphereLightingFromSun:void 0,showGroundAtmosphere:void 0,perFragmentGroundAtmosphere:void 0,hasVertexNormals:void 0,useWebMercatorProjection:void 0,enableFog:void 0,enableClippingPlanes:void 0,clippingPlanes:void 0,enableClippingPolygons:void 0,clippingPolygons:void 0,clippedByBoundaries:void 0,hasImageryLayerCutout:void 0,colorCorrect:void 0,colorToAlpha:void 0,hasGeodeticSurfaceNormals:void 0,hasExaggeration:void 0,vectorAntialias:void 0},mAt=U.TRANSPARENT,hAt=new Kt;function fAt(e,t,n){let i=t.data;if(DEt(e,i))return;l(i.vertexArray)||(i.fill===void 0&&(i.fill=new tA(t)),i.fill.update(e,n));let o=n.creditDisplay,r=i.terrainData;if(l(r)&&l(r.credits)){let bt=r.credits;for(let ht=0,jt=bt.length;ht<jt;++ht)o.addCreditToNextFrame(bt[ht])}let s=wt.maximumTextureImageUnits,a=i.waterMaskTexture,c=i.waterMaskTranslationAndScale;!l(a)&&l(i.fill)&&(a=i.fill.waterMaskTexture,c=i.fill.waterMaskTranslationAndScale);let d=n.cameraUnderground,u=n.globeTranslucencyState,m=u.translucent,p=u.frontFaceAlphaByDistance,b=u.backFaceAlphaByDistance,f=u.rectangle,y=e.undergroundColor??mAt,_=e.undergroundColorAlphaByDistance??hAt,S=Vve(e,n)&&n.mode===se.SCENE3D&&y.alpha>0&&(_.nearValue>0||_.farValue>0),Z=e.lambertDiffuseMultiplier,R=e.vertexShadowDarkness,C=e.hasWaterMask&&l(a),E=C&&e.showWaterEffect,A=e.oceanNormalMap,L=E&&l(A),F=e.terrainProvider,I=l(F)&&e.terrainProvider.hasVertexNormals,N=n.fog.enabled&&n.fog.renderable&&!d,g=e.showGroundAtmosphere&&n.mode===se.SCENE3D,V=vn.castShadows(e.shadows)&&!m,G=vn.receiveShadows(e.shadows)&&!m,v=e.hueShift,X=e.saturationShift,Y=e.brightnessShift,D=!(W.equalsEpsilon(v,0,W.EPSILON7)&&W.equalsEpsilon(X,0,W.EPSILON7)&&W.equalsEpsilon(Y,0,W.EPSILON7)),M=!1;if(g){let bt=h.magnitude(n.camera.positionWC),ht=e.nightFadeOutDistance;M=bt>ht}C&&--s,L&&--s,l(n.shadowState)&&n.shadowState.shadowsEnabled&&--s,l(e.clippingPlanes)&&e.clippingPlanes.enabled&&--s,l(e.clippingPolygons)&&e.clippingPolygons.enabled&&(s-=3),s-=u.numberOfTextureUniforms;let O=i.renderedMesh,w=O.center,z=O.encoding,K=i.tileBoundingRegion,te=n.verticalExaggeration,H=n.verticalExaggerationRelativeHeight,$=te!==1,ee=z.hasGeodeticSurfaceNormals,le=QEt,_e=0,he=0,Ze=0,ye=0,Ge=!1;if(n.mode!==se.SCENE3D){let bt=n.mapProjection,ht=bt.project(re.southwest(t.rectangle),tAt),jt=bt.project(re.northeast(t.rectangle),nAt);if(le.x=ht.x,le.y=ht.y,le.z=jt.x,le.w=jt.y,n.mode!==se.MORPHING&&(w=eAt,w.x=0,w.y=(le.z+le.x)*.5,w.z=(le.w+le.y)*.5,le.x-=w.y,le.y-=w.z,le.z-=w.y,le.w-=w.z),n.mode===se.SCENE2D&&z.quantization===Ka.BITS12){let st=1/(Math.pow(2,12)-1)*.5,pt=(le.z-le.x)*st,Mi=(le.w-le.y)*st;le.x-=pt,le.y-=Mi,le.z+=pt,le.w+=Mi}bt instanceof Ti&&(_e=t.rectangle.south,he=t.rectangle.north,Ze=Ti.geodeticLatitudeToMercatorAngle(_e),ye=1/(Ti.geodeticLatitudeToMercatorAngle(he)-Ze),Ge=!0)}let Ae=uAt;Ae.frameState=n,Ae.surfaceTile=i,Ae.hasWaterMask=C,Ae.showReflectiveOcean=E,Ae.showOceanWaves=L,Ae.enableLighting=e.enableLighting,Ae.dynamicAtmosphereLighting=e.dynamicAtmosphereLighting,Ae.dynamicAtmosphereLightingFromSun=e.dynamicAtmosphereLightingFromSun,Ae.showGroundAtmosphere=g,Ae.atmosphereLightIntensity=e.atmosphereLightIntensity,Ae.atmosphereRayleighCoefficient=e.atmosphereRayleighCoefficient,Ae.atmosphereMieCoefficient=e.atmosphereMieCoefficient,Ae.atmosphereRayleighScaleHeight=e.atmosphereRayleighScaleHeight,Ae.atmosphereMieScaleHeight=e.atmosphereMieScaleHeight,Ae.atmosphereMieAnisotropy=e.atmosphereMieAnisotropy,Ae.perFragmentGroundAtmosphere=M,Ae.hasVertexNormals=I,Ae.useWebMercatorProjection=Ge,Ae.clippedByBoundaries=i.clippedByBoundaries,Ae.hasGeodeticSurfaceNormals=ee,Ae.hasExaggeration=$,Ae.vectorAntialias=e.vectorProvider.antialias;let Fe=i.imagery,tt=0,Be=Fe.length,je=e.showSkirts&&!d&&!m,qe=e.backFaceCulling&&!d&&!m,We=qe?e._renderState:e._disableCullingRenderState,Ke=qe?e._blendRenderState:e._disableCullingBlendRenderState,ct=We,Et=e._firstPassInitialColor,zt=n.context;if(l(e._debug.boundingSphereTile)||$H(),e._materialUniformMap!==e.materialUniformMap){e._materialUniformMap=e.materialUniformMap;let bt=e._drawCommands.length;for(let ht=0;ht<bt;++ht)e._uniformMaps[ht]=Zve(n,e)}do{let bt=0,ht,jt;if(e._drawCommands.length<=e._usedDrawCommands?(ht=new lt,ht.owner=t,ht.cull=!1,ht.boundingVolume=new me,ht.orientedBoundingBox=void 0,jt=Zve(n,e),e._drawCommands.push(ht),e._uniformMaps.push(jt)):(ht=e._drawCommands[e._usedDrawCommands],jt=e._uniformMaps[e._usedDrawCommands]),ht.owner=t,++e._usedDrawCommands,t===e._debug.boundingSphereTile){let Ps=K.boundingVolume,$a=K.boundingSphere;l(Ps)?Eve(Ps,U.RED).update(n):l($a)&&Ave($a,U.RED).update(n)}let st=jt.properties;ce.clone(Et,st.initialColor),st.oceanNormalMap=A,st.lightingFadeDistance.x=e.lightingFadeOutDistance,st.lightingFadeDistance.y=e.lightingFadeInDistance,st.nightFadeDistance.x=e.nightFadeOutDistance,st.nightFadeDistance.y=e.nightFadeInDistance,st.atmosphereLightIntensity=e.atmosphereLightIntensity,st.atmosphereRayleighCoefficient=e.atmosphereRayleighCoefficient,st.atmosphereMieCoefficient=e.atmosphereMieCoefficient,st.atmosphereRayleighScaleHeight=e.atmosphereRayleighScaleHeight,st.atmosphereMieScaleHeight=e.atmosphereMieScaleHeight,st.atmosphereMieAnisotropy=e.atmosphereMieAnisotropy,st.zoomedOutOceanSpecularIntensity=e.zoomedOutOceanSpecularIntensity;let pt=d?b:p,Mi=d?p:b;l(pt)&&(ce.fromElements(pt.near,pt.nearValue,pt.far,pt.farValue,st.frontFaceAlphaByDistance),ce.fromElements(Mi.near,Mi.nearValue,Mi.far,Mi.farValue,st.backFaceAlphaByDistance)),ce.fromElements(_.near,_.nearValue,_.far,_.farValue,st.undergroundColorAlphaByDistance),U.clone(y,st.undergroundColor),st.lambertDiffuseMultiplier=Z,st.vertexShadowDarkness=R;let jn=!l(i.vertexArray)&&l(e.fillHighlightColor)&&e.fillHighlightColor.alpha>0;jn&&U.clone(e.fillHighlightColor,st.fillHighlightColor),st.verticalExaggerationAndRelativeHeight.x=te,st.verticalExaggerationAndRelativeHeight.y=H,st.center3D=O.center,h.clone(w,st.rtc),ce.clone(le,st.tileRectangle),st.southAndNorthLatitude.x=_e,st.southAndNorthLatitude.y=he,st.southMercatorYAndOneOverHeight.x=Ze,st.southMercatorYAndOneOverHeight.y=ye;let Si=qEt,Hi=qH(t.rectangle,e.cartographicLimitRectangle),Gi=$Et,pi=qH(t.rectangle,f);h.fromElements(v,X,Y,st.hsbShift);let Zi=t.rectangle,On=1/Zi.width,rn=1/Zi.height;Si.x=(Hi.west-Zi.west)*On,Si.y=(Hi.south-Zi.south)*rn,Si.z=(Hi.east-Zi.west)*On,Si.w=(Hi.north-Zi.south)*rn,ce.clone(Si,st.localizedCartographicLimitRectangle),Gi.x=(pi.west-Zi.west)*On,Gi.y=(pi.south-Zi.south)*rn,Gi.z=(pi.east-Zi.west)*On,Gi.w=(pi.north-Zi.south)*rn,ce.clone(Gi,st.localizedTranslucencyRectangle);let Hn=N&&W.fog(t._distance,n.fog.density)>W.EPSILON3;D=D&&(Hn||g);let $i=!1,Po=!1,hr=!1,Is=!1,Hs=!1,or=!1,yi=!1,fr=!1,mo=!1,Qr=!1;for(;bt<s&&tt<Be;){let Ps=Fe[tt],$a=Ps.readyImagery;if(++tt,!l($a)||$a.imageryLayer.alpha===0)continue;let BT=Ps.useWebMercatorT?$a.textureWebMercator:$a.texture,si=$a.imageryLayer;l(Ps.textureTranslationAndScale)||(Ps.textureTranslationAndScale=si._calculateTextureTranslationAndScale(t,Ps)),st.dayTextures[bt]=BT,st.dayTextureTranslationAndScale[bt]=Ps.textureTranslationAndScale,st.dayTextureTexCoordsRectangle[bt]=Ps.textureCoordinateRectangle,st.dayTextureUseWebMercatorT[bt]=Ps.useWebMercatorT,st.dayTextureAlpha[bt]=si.alpha,or=or||st.dayTextureAlpha[bt]!==1,st.dayTextureNightAlpha[bt]=si.nightAlpha,yi=yi||st.dayTextureNightAlpha[bt]!==1,st.dayTextureDayAlpha[bt]=si.dayAlpha,yi=yi||st.dayTextureDayAlpha[bt]!==1,st.dayTextureBrightness[bt]=si.brightness,$i=$i||st.dayTextureBrightness[bt]!==Zs.DEFAULT_BRIGHTNESS,st.dayTextureContrast[bt]=si.contrast,Po=Po||st.dayTextureContrast[bt]!==Zs.DEFAULT_CONTRAST,st.dayTextureHue[bt]=si.hue,hr=hr||st.dayTextureHue[bt]!==Zs.DEFAULT_HUE,st.dayTextureSaturation[bt]=si.saturation,Is=Is||st.dayTextureSaturation[bt]!==Zs.DEFAULT_SATURATION,st.dayTextureOneOverGamma[bt]=1/si.gamma,Hs=Hs||st.dayTextureOneOverGamma[bt]!==1/Zs.DEFAULT_GAMMA,st.dayTextureSplit[bt]=si.splitDirection,fr=fr||st.dayTextureSplit[bt]!==0;let qo=st.dayTextureCutoutRectangles[bt];if(l(qo)||(qo=st.dayTextureCutoutRectangles[bt]=new ce),ce.clone(ce.ZERO,qo),l(si.cutoutRectangle)){let va=qH(Zi,si.cutoutRectangle),yp=re.simpleIntersection(va,Zi,Cve);mo=l(yp)||mo,qo.x=(va.west-Zi.west)*On,qo.y=(va.south-Zi.south)*rn,qo.z=(va.east-Zi.west)*On,qo.w=(va.north-Zi.south)*rn}let Gl=st.colorsToAlpha[bt];l(Gl)||(Gl=st.colorsToAlpha[bt]=new ce);let K0=l(si.colorToAlpha)&&si.colorToAlphaThreshold>0;if(Qr=Qr||K0,K0){let va=si.colorToAlpha;Gl.x=va.red,Gl.y=va.green,Gl.z=va.blue,Gl.w=si.colorToAlphaThreshold}else Gl.w=-1;if(l($a.credits)){let va=$a.credits;for(let yp=0,Ty=va.length;yp<Ty;++yp)o.addCreditToNextFrame(va[yp])}++bt}st.dayTextures.length=bt,st.waterMask=a,ce.clone(c,st.waterMaskTranslationAndScale),st.minMaxHeight.x=z.minimumHeight,st.minMaxHeight.y=z.maximumHeight,P.clone(z.matrix,st.scaleAndBias);let Mn=e._clippingPlanes,Ki=l(Mn)&&Mn.enabled&&t.isClipped;Ki&&(st.clippingPlanesEdgeColor=U.clone(Mn.edgeColor,st.clippingPlanesEdgeColor),st.clippingPlanesEdgeWidth=Mn.edgeWidth);let wi=i.vectorData;l(wi)&&(st.vectorSegmentTexture=wi.polylineSegmentTexture,st.vectorWidthTexture=wi.widthTexture,st.vectorColorTexture=wi.colorTexture,st.vectorPickColorTexture=wi.pickColorTexture,st.vectorSegmentPrimitiveIndicesTexture=wi.polylineSegmentPrimitiveIndicesTexture,st.vectorGridCellIndicesTexture=wi.polylineGridCellIndicesTexture,st.vectorPolygonEdgeTexture=wi.polygonEdgeTexture,st.vectorPolygonEdgePrimitiveIndicesTexture=wi.polygonEdgePrimitiveIndicesTexture,st.vectorPolygonGridCellIndicesTexture=wi.polygonGridCellIndicesTexture,k.clone(wi.metersPerUv,st.vectorMetersPerUv));let Xo=i.clippingPolygonData;l(Xo)&&(st.clippingEdgeTexture=Xo.polygonEdgeTexture,st.clippingEdgePrimitiveIndicesTexture=Xo.polygonEdgePrimitiveIndicesTexture,st.clippingGridCellIndicesTexture=Xo.polygonGridCellIndicesTexture);let Dc=e._clippingPolygons,bm=(Xo?.polygonRings.length??0)>0,bp=l(Dc)&&Dc.enabled&&Dc.length>0&&t.isClipped&&bm;Ae.numberOfDayTextures=bt,Ae.applyBrightness=$i,Ae.applyContrast=Po,Ae.applyHue=hr,Ae.applySaturation=Is,Ae.applyGamma=Hs,Ae.applyAlpha=or,Ae.applyDayNightAlpha=yi,Ae.applySplit=fr,Ae.enableFog=Hn,Ae.enableClippingPlanes=Ki,Ae.clippingPlanes=Mn,Ae.enableClippingPolygons=bp,Ae.clippingPolygons=Dc,Ae.hasImageryLayerCutout=mo,Ae.colorCorrect=D,Ae.highlightFillTile=jn,Ae.colorToAlpha=Qr,Ae.showUndergroundColor=S,Ae.translucent=m;let Lh=i.renderedMesh.indices.length;je||(Lh=i.renderedMesh.indexCountWithoutSkirts),ht.shaderProgram=e._surfaceShaderSet.getShaderProgram(Ae),ht.pickId=i.vectorData?.show?"vectorPickColorOver(vec4(0.0))":void 0,ht.castShadows=V,ht.receiveShadows=G,ht.renderState=ct,ht.primitiveType=Ie.TRIANGLES,ht.vertexArray=i.vertexArray||i.fill.vertexArray,ht.count=Lh,ht.uniformMap=jt,ht.pass=Le.GLOBE,e._debug.wireframe&&(cAt(zt,t),l(i.wireframeVertexArray)&&(ht.vertexArray=i.wireframeVertexArray,ht.primitiveType=Ie.LINES,ht.count=Lh*2));let ua=ht.boundingVolume,gp=ht.orientedBoundingBox;n.mode!==se.SCENE3D?(me.fromRectangleWithHeights2D(t.rectangle,n.mapProjection,K.minimumHeight,K.maximumHeight,ua),h.fromElements(ua.center.z,ua.center.x,ua.center.y,ua.center),n.mode===se.MORPHING&&me.union(K.boundingSphere,ua,ua)):(ht.boundingVolume=me.clone(K.boundingSphere,ua),ht.orientedBoundingBox=nn.clone(K.boundingVolume,gp)),ht.dirty=!0,m&&u.updateDerivedCommands(ht,n),Rve(ht,n),ct=Ke,Et=dAt}while(tt<Be)}var Yw=Coe;var Rro=x(T(),1);function Gve(){this._enabled=!1,this._frontFaceAlpha=1,this._frontFaceAlphaByDistance=void 0,this._backFaceAlpha=1,this._backFaceAlphaByDistance=void 0,this._rectangle=re.clone(re.MAX_VALUE)}Object.defineProperties(Gve.prototype,{enabled:{get:function(){return this._enabled},set:function(e){this._enabled=e}},frontFaceAlpha:{get:function(){return this._frontFaceAlpha},set:function(e){this._frontFaceAlpha=e}},frontFaceAlphaByDistance:{get:function(){return this._frontFaceAlphaByDistance},set:function(e){this._frontFaceAlphaByDistance=Kt.clone(e,this._frontFaceAlphaByDistance)}},backFaceAlpha:{get:function(){return this._backFaceAlpha},set:function(e){this._backFaceAlpha=e}},backFaceAlphaByDistance:{get:function(){return this._backFaceAlphaByDistance},set:function(e){this._backFaceAlphaByDistance=Kt.clone(e,this._backFaceAlphaByDistance)}},rectangle:{get:function(){return this._rectangle},set:function(e){l(e)||(e=re.clone(re.MAX_VALUE)),re.clone(e,this._rectangle)}}});var Mw=Gve;var oso=x(T(),1);var Aro=x(T(),1);var Voe=class{constructor(t){this._ellipsoid=new Gf(t.ellipsoid,h.ZERO)}get ellipsoid(){return this._ellipsoid}},ww=Voe;var Pro=x(T(),1);var Eoe=class{constructor(t){this.maxSize=t,this.cache=new Map}get(t){if(!this.cache.has(t))return;let n=this.cache.get(t);return this.cache.delete(t),this.cache.set(t,n),n}set(t,n){if(this.cache.has(t))this.cache.delete(t);else if(this.cache.size>=this.maxSize){let i=this.cache.keys().next().value;this.cache.delete(i)}this.cache.set(t,n)}get size(){return this.cache.size}clear(){this.cache.clear()}},pAt=1e3,Aoe=class e{constructor(t){this._tilingScheme=t.tilingScheme,this._x=t.x,this._y=t.y,this._level=t.level,this._parent=t.parent,this._rectangle=this._tilingScheme.tileXYToRectangle(this._x,this._y,this._level),this._southwestChild=void 0,this._southeastChild=void 0,this._northwestChild=void 0,this._northeastChild=void 0,this.replacementPrevious=void 0,this.replacementNext=void 0,this._distance=0,this._loadPriority=0,this._customData=new Set,this._customDataIterator=void 0,this._addedCustomData=[],this._removedCustomData=[],this._lastSelectionResult=gi.NONE,this._lastSelectionResultFrame=void 0,this._loadedCallbacks={},this._positionCache=new Eoe(pAt),this.state=Ja.START,this.renderable=!1,this.upsampledFromParent=!1,this.data=void 0}static createLevelZeroTiles(t){let n=t.getNumberOfXTilesAtLevel(0),i=t.getNumberOfYTilesAtLevel(0),o=new Array(n*i),r=0;for(let s=0;s<i;++s)for(let a=0;a<n;++a)o[r++]=new e({tilingScheme:t,x:a,y:s,level:0});return o}_getCacheKey(t,n){return gAt(t.longitude,t.latitude,this._rectangle,n)}getPositionCacheEntry(t,n){return this._positionCache.get(this._getCacheKey(t,n))}setPositionCacheEntry(t,n,i){this._positionCache.set(this._getCacheKey(t,n),i)}clearPositionCache(){this._positionCache.size>0&&this._positionCache.clear()}updateCustomData(){let t=this._addedCustomData,n=this._removedCustomData;if(t.length===0&&n.length===0)return;let i=this.customData;for(let o=0;o<t.length;++o){let r=t[o];if(!l(r))continue;i.add(r);let s=Lve(this,r.positionCartographic);r._pendingAddTile=s,r._pendingAddIndex=s._addedCustomData.length,s._addedCustomData.push(r)}this._addedCustomData.length=0;for(let o=0;o<n.length;++o){let r=n[o];if(!l(r))continue;i.has(r)&&i.delete(r);let s=Lve(this,r.positionCartographic);if(r._pendingAddTile===s&&s._addedCustomData[r._pendingAddIndex]===r){s._addedCustomData[r._pendingAddIndex]=void 0,r._pendingAddTile=void 0;continue}s._removedCustomData.push(r)}this._removedCustomData.length=0}get tilingScheme(){return this._tilingScheme}get x(){return this._x}get y(){return this._y}get level(){return this._level}get parent(){return this._parent}get rectangle(){return this._rectangle}get children(){return[this.northwestChild,this.northeastChild,this.southwestChild,this.southeastChild]}get southwestChild(){return l(this._southwestChild)||(this._southwestChild=new e({tilingScheme:this.tilingScheme,x:this.x*2,y:this.y*2+1,level:this.level+1,parent:this})),this._southwestChild}get southeastChild(){return l(this._southeastChild)||(this._southeastChild=new e({tilingScheme:this.tilingScheme,x:this.x*2+1,y:this.y*2+1,level:this.level+1,parent:this})),this._southeastChild}get northwestChild(){return l(this._northwestChild)||(this._northwestChild=new e({tilingScheme:this.tilingScheme,x:this.x*2,y:this.y*2,level:this.level+1,parent:this})),this._northwestChild}get northeastChild(){return l(this._northeastChild)||(this._northeastChild=new e({tilingScheme:this.tilingScheme,x:this.x*2+1,y:this.y*2,level:this.level+1,parent:this})),this._northeastChild}get customData(){return this._customData}get needsLoading(){return this.state<Ja.DONE}get eligibleForUnloading(){let t=!0;return l(this.data)&&(t=this.data.eligibleForUnloading,l(t)||(t=!0)),t}findLevelZeroTile(t,n,i){let o=this.tilingScheme.getNumberOfXTilesAtLevel(0);if(n<0?n+=o:n>=o&&(n-=o),!(i<0||i>=this.tilingScheme.getNumberOfYTilesAtLevel(0)))return t.filter(function(r){return r.x===n&&r.y===i})[0]}findTileToWest(t){let n=this.parent;if(n===void 0)return this.findLevelZeroTile(t,this.x-1,this.y);if(n.southeastChild===this)return n.southwestChild;if(n.northeastChild===this)return n.northwestChild;let i=n.findTileToWest(t);if(i!==void 0)return n.southwestChild===this?i.southeastChild:i.northeastChild}findTileToEast(t){let n=this.parent;if(n===void 0)return this.findLevelZeroTile(t,this.x+1,this.y);if(n.southwestChild===this)return n.southeastChild;if(n.northwestChild===this)return n.northeastChild;let i=n.findTileToEast(t);if(i!==void 0)return n.southeastChild===this?i.southwestChild:i.northwestChild}findTileToSouth(t){let n=this.parent;if(n===void 0)return this.findLevelZeroTile(t,this.x,this.y+1);if(n.northwestChild===this)return n.southwestChild;if(n.northeastChild===this)return n.southeastChild;let i=n.findTileToSouth(t);if(i!==void 0)return n.southwestChild===this?i.northwestChild:i.northeastChild}findTileToNorth(t){let n=this.parent;if(n===void 0)return this.findLevelZeroTile(t,this.x,this.y-1);if(n.southwestChild===this)return n.northwestChild;if(n.southeastChild===this)return n.northeastChild;let i=n.findTileToNorth(t);if(i!==void 0)return n.northwestChild===this?i.southwestChild:i.southeastChild}freeResources(){this.clearPositionCache(),this.state=Ja.START,this.renderable=!1,this.upsampledFromParent=!1;let t=this.data;l(t)&&l(t.freeResources)&&t.freeResources(),eK(this._southwestChild),this._southwestChild=void 0,eK(this._southeastChild),this._southeastChild=void 0,eK(this._northwestChild),this._northwestChild=void 0,eK(this._northeastChild),this._northeastChild=void 0}},bAt=256;function gAt(e,t,n,i){let o=n.width/bAt*i,r=Math.floor(e/o)*o,s=Math.floor(t/o)*o;return`${r.toFixed(10)},${s.toFixed(10)}`}var yAt=new pe;function Lve(e,t){let n=e.northwestChild.rectangle,i=re.southeast(n,yAt),o=t.longitude>=i.longitude?1:0;switch((t.latitude<i.latitude?1:0)*2+o){case 0:return e.northwestChild;case 1:return e.northeastChild;case 2:return e.southwestChild;default:return e.southeastChild}}function eK(e){l(e)&&e.freeResources()}var kw=Aoe;var Yro=x(T(),1);function tK(){this.head=void 0,this.tail=void 0,this.count=0,this._lastBeforeStartOfFrame=void 0}tK.prototype.markStartOfRenderFrame=function(){this._lastBeforeStartOfFrame=this.head};tK.prototype.trimTiles=function(e){let t=this.tail,n=!0;for(;n&&l(this._lastBeforeStartOfFrame)&&this.count>e&&l(t);){n=t!==this._lastBeforeStartOfFrame;let i=t.replacementPrevious;t.eligibleForUnloading&&(t.freeResources(),Wve(this,t)),t=i}};function Wve(e,t){let n=t.replacementPrevious,i=t.replacementNext;t===e._lastBeforeStartOfFrame&&(e._lastBeforeStartOfFrame=i),t===e.head?e.head=i:n.replacementNext=i,t===e.tail?e.tail=n:i.replacementPrevious=n,t.replacementPrevious=void 0,t.replacementNext=void 0,--e.count}tK.prototype.markTileRendered=function(e){let t=this.head;if(t===e){e===this._lastBeforeStartOfFrame&&(this._lastBeforeStartOfFrame=e.replacementNext);return}if(++this.count,!l(t)){e.replacementPrevious=void 0,e.replacementNext=void 0,this.head=e,this.tail=e;return}(l(e.replacementPrevious)||l(e.replacementNext))&&Wve(this,e),e.replacementPrevious=void 0,e.replacementNext=t,t.replacementPrevious=e,this.head=e};var Uw=tK;function Th(e){this._tileProvider=e.tileProvider,this._tileProvider.quadtree=this,this._debug={enableDebugOutput:!1,maxDepth:0,maxDepthVisited:0,tilesVisited:0,tilesCulled:0,tilesRendered:0,tilesWaitingForChildren:0,lastMaxDepth:-1,lastMaxDepthVisited:-1,lastTilesVisited:-1,lastTilesCulled:-1,lastTilesRendered:-1,lastTilesWaitingForChildren:-1,suspendLodUpdate:!1};let n=this._tileProvider.tilingScheme.ellipsoid;this._tilesRenderedThisFrame=new Set,this._tilesToRender=[],this._tileLoadQueueHigh=[],this._tileLoadQueueMedium=[],this._tileLoadQueueLow=[],this._tileReplacementQueue=new Uw,this._levelZeroTiles=void 0,this._loadQueueTimeSlice=5,this._tilesInvalidated=!1,this._addHeightCallbacks=[],this._removeHeightCallbacks=[],this._tileToUpdateHeights=[],this._updateHeightsTimeSlice=2,this._cameraPositionCartographic=void 0,this._cameraReferenceFrameOriginCartographic=void 0,this.maximumScreenSpaceError=e.maximumScreenSpaceError??2,this.tileCacheSize=e.tileCacheSize??100,this.loadingDescendantLimit=20,this.preloadAncestors=!0,this.preloadSiblings=!1,this._occluders=new ww({ellipsoid:n}),this._tileLoadProgressEvent=new Se,this._lastTileLoadQueueLength=0,this._lastSelectionFrameNumber=void 0}Object.defineProperties(Th.prototype,{tileProvider:{get:function(){return this._tileProvider}},tileLoadProgressEvent:{get:function(){return this._tileLoadProgressEvent}},occluders:{get:function(){return this._occluders}}});Th.prototype.invalidateAllTiles=function(){this._tilesInvalidated=!0};function xAt(e){let t=e._tileReplacementQueue;t.head=void 0,t.tail=void 0,t.count=0,Fve(e);let n=e._levelZeroTiles;if(l(n))for(let i=0;i<n.length;++i){let r=n[i].customData;for(let s of r)s.level=0,e._addHeightCallbacks.push(s);n[i].freeResources()}e._levelZeroTiles=void 0,e._tileProvider.cancelReprojections()}Th.prototype.forEachLoadedTile=function(e){let t=this._tileReplacementQueue.head;for(;l(t);)t.state!==Ja.START&&e(t),t=t.replacementNext};Th.prototype.forEachRenderedTile=function(e){let t=this._tilesRenderedThisFrame;for(let n of t)e(n)};Th.prototype.updateHeight=function(e,t){let n=this,i={positionOnEllipsoidSurface:void 0,positionCartographic:e,level:-1,callback:t};return i.removeFunc=function(){let o=n._addHeightCallbacks,r=o.length,s=!1;for(let a=0;a<r;++a)if(o[a]===i){o.splice(a,1),s=!0;break}s||n._removeHeightCallbacks.push(i),i.callback&&(i.callback=void 0)},n._addHeightCallbacks.push(i),i.removeFunc};Th.prototype.update=function(e){l(this._tileProvider.update)&&this._tileProvider.update(e)};function Fve(e){let t=e._debug;t.maxDepth=0,t.maxDepthVisited=0,t.tilesVisited=0,t.tilesCulled=0,t.tilesRendered=0,t.tilesWaitingForChildren=0,e._tileLoadQueueHigh.length=0,e._tileLoadQueueMedium.length=0,e._tileLoadQueueLow.length=0}Th.prototype.beginFrame=function(e){e.passes.render&&(this._tilesInvalidated&&(xAt(this),this._tilesInvalidated=!1),this._tileProvider.initialize(e),Fve(this),!this._debug.suspendLodUpdate&&(this._tileReplacementQueue.markStartOfRenderFrame(),this._tilesRenderedThisFrame.clear()))};Th.prototype.render=function(e){let t=e.passes,n=this._tileProvider;t.render&&(n.beginUpdate(e),ZAt(this,e),FAt(this,e),n.endUpdate(e)),t.pick&&this._tilesToRender.length>0&&n.updateForPick(e)};function TAt(e,t){let n=e._tileLoadQueueHigh.length+e._tileLoadQueueMedium.length+e._tileLoadQueueLow.length;if(n!==e._lastTileLoadQueueLength||e._tilesInvalidated){let o=Se.prototype.raiseEvent.bind(e._tileLoadProgressEvent,n);t.afterRender.push(()=>(o(),!0)),e._lastTileLoadQueueLength=n}let i=e._debug;i.enableDebugOutput&&!i.suspendLodUpdate&&(i.maxDepth=e._tilesToRender.reduce(function(o,r){return Math.max(o,r.level)},-1),i.tilesRendered=e._tilesToRender.length,(i.tilesVisited!==i.lastTilesVisited||i.tilesRendered!==i.lastTilesRendered||i.tilesCulled!==i.lastTilesCulled||i.maxDepth!==i.lastMaxDepth||i.tilesWaitingForChildren!==i.lastTilesWaitingForChildren||i.maxDepthVisited!==i.lastMaxDepthVisited)&&(console.log(`Visited ${i.tilesVisited}, Rendered: ${i.tilesRendered}, Culled: ${i.tilesCulled}, Max Depth Rendered: ${i.maxDepth}, Max Depth Visited: ${i.maxDepthVisited}, Waiting for children: ${i.tilesWaitingForChildren}`),i.lastTilesVisited=i.tilesVisited,i.lastTilesRendered=i.tilesRendered,i.lastTilesCulled=i.tilesCulled,i.lastMaxDepth=i.maxDepth,i.lastTilesWaitingForChildren=i.tilesWaitingForChildren,i.lastMaxDepthVisited=i.maxDepthVisited))}Th.prototype.endFrame=function(e){!e.passes.render||e.mode===se.MORPHING||(GAt(this,e),vAt(this,e),TAt(this,e))};Th.prototype.isDestroyed=function(){return!1};Th.prototype.destroy=function(){this._tileProvider=this._tileProvider&&this._tileProvider.destroy()};var Ow,vve=new pe;function _At(e,t){let n=re.center(e.rectangle,vve),i=n.longitude-Ow.longitude,o=n.latitude-Ow.latitude;n=re.center(t.rectangle,vve);let r=n.longitude-Ow.longitude,s=n.latitude-Ow.latitude;return i*i+o*o-(r*r+s*s)}var SAt=new h,Dw=[];function ZAt(e,t){let n=e._debug;if(n.suspendLodUpdate)return;let i=e._tilesToRender;i.length=0;let o=e._tileProvider;if(!l(e._levelZeroTiles)){let m=o.tilingScheme;if(l(m)){let p=o.tilingScheme;e._levelZeroTiles=kw.createLevelZeroTiles(p);let b=e._levelZeroTiles.length;if(Dw.length<b){Dw=new Array(b);for(let f=0;f<b;++f)Dw[f]===void 0&&(Dw[f]=new Bw)}}else return}e._occluders.ellipsoid.cameraPosition=t.camera.positionWC;let r=e._levelZeroTiles,s=r.length>1?e._occluders:void 0;Ow=t.camera.positionCartographic,r.sort(_At);let a=e._addHeightCallbacks,c=e._removeHeightCallbacks;a.forEach(m=>{let p=r.find(b=>re.contains(b.rectangle,m.positionCartographic));p&&p._addedCustomData.push(m)}),c.forEach(m=>{let p=r.find(b=>re.contains(b.rectangle,m.positionCartographic));p&&p._removedCustomData.push(m)}),r.forEach(m=>m.updateCustomData()),a.length=0,c.length=0;let d=t.camera;e._cameraPositionCartographic=d.positionCartographic;let u=P.getTranslation(d.transform,SAt);e._cameraReferenceFrameOriginCartographic=e.tileProvider.tilingScheme.ellipsoid.cartesianToCartographic(u,e._cameraReferenceFrameOriginCartographic);for(let m=0;m<r.length;++m){let p=r[m];e._tileReplacementQueue.markTileRendered(p),p.renderable?kc(e,p,o,t,s,!1,Dw[m]):(Qg(e,e._tileLoadQueueHigh,p,t),++n.tilesWaitingForChildren)}e._lastSelectionFrameNumber=t.frameNumber}function Qg(e,t,n,i){n.needsLoading&&(e.tileProvider.computeTileLoadPriority!==void 0&&(n._loadPriority=e.tileProvider.computeTileLoadPriority(n,i)),t.push(n))}function Bw(){this.allAreRenderable=!0,this.anyWereRenderedLastFrame=!1,this.notYetRenderableCount=0}function Ive(){this.southwest=new Bw,this.southeast=new Bw,this.northwest=new Bw,this.northeast=new Bw}Ive.prototype.combine=function(e){let t=this.southwest,n=this.southeast,i=this.northwest,o=this.northeast;e.allAreRenderable=t.allAreRenderable&&n.allAreRenderable&&i.allAreRenderable&&o.allAreRenderable,e.anyWereRenderedLastFrame=t.anyWereRenderedLastFrame||n.anyWereRenderedLastFrame||i.anyWereRenderedLastFrame||o.anyWereRenderedLastFrame,e.notYetRenderableCount=t.notYetRenderableCount+n.notYetRenderableCount+i.notYetRenderableCount+o.notYetRenderableCount};var Loe=new Array(31);for(let e=0;e<Loe.length;++e)Loe[e]=new Ive;function RAt(e,t,n,i,o){let r=e._debug;++r.tilesVisited,e._tileReplacementQueue.markTileRendered(n),n.updateCustomData(),n.level>r.maxDepthVisited&&(r.maxDepthVisited=n.level);let s=EAt(e,t,n)<e.maximumScreenSpaceError,a=n.southwestChild,c=n.southeastChild,d=n.northwestChild,u=n.northeastChild,m=e._lastSelectionFrameNumber,p=n._lastSelectionResultFrame===m?n._lastSelectionResult:gi.NONE,b=e.tileProvider;if(s||i){let f=gi.originalResult(p)===gi.RENDERED,y=gi.originalResult(p)===gi.CULLED||p===gi.NONE,_=n.state===Ja.DONE,S=f||y||_;if(S||l(b.canRenderWithoutLosingDetail)&&(S=b.canRenderWithoutLosingDetail(n)),S){s&&Qg(e,e._tileLoadQueueMedium,n,t),nK(e,n),o.allAreRenderable=n.renderable,o.anyWereRenderedLastFrame=p===gi.RENDERED,o.notYetRenderableCount=n.renderable?0:1,n._lastSelectionResultFrame=t.frameNumber,n._lastSelectionResult=gi.RENDERED,o.anyWereRenderedLastFrame||e._tileToUpdateHeights.push(n);return}i=!0,s&&Qg(e,e._tileLoadQueueHigh,n,t)}if(b.canRefine(n)){if(a.upsampledFromParent&&c.upsampledFromParent&&d.upsampledFromParent&&u.upsampledFromParent){nK(e,n),Qg(e,e._tileLoadQueueMedium,n,t),e._tileReplacementQueue.markTileRendered(a),e._tileReplacementQueue.markTileRendered(c),e._tileReplacementQueue.markTileRendered(d),e._tileReplacementQueue.markTileRendered(u),o.allAreRenderable=n.renderable,o.anyWereRenderedLastFrame=p===gi.RENDERED,o.notYetRenderableCount=n.renderable?0:1,n._lastSelectionResultFrame=t.frameNumber,n._lastSelectionResult=gi.RENDERED,o.anyWereRenderedLastFrame||e._tileToUpdateHeights.push(n);return}n._lastSelectionResultFrame=t.frameNumber,n._lastSelectionResult=gi.REFINED;let y=e._tilesToRender.length,_=e._tileLoadQueueLow.length,S=e._tileLoadQueueMedium.length,Z=e._tileLoadQueueHigh.length,R=e._tileToUpdateHeights.length;if(CAt(e,a,c,d,u,t,i,o),y!==e._tilesToRender.length){let C=o.allAreRenderable,E=o.anyWereRenderedLastFrame,A=o.notYetRenderableCount,L=!1;if(!C&&!E){let F=e._tilesToRender;for(let N=y;N<F.length;++N){let g=F[N];for(;g!==void 0&&g._lastSelectionResult!==gi.KICKED&&g!==n;)g._lastSelectionResult=gi.kick(g._lastSelectionResult),g=g.parent}e._tilesToRender.length=y,e._tileToUpdateHeights.length=R,nK(e,n),n._lastSelectionResult=gi.RENDERED;let I=p===gi.RENDERED;!I&&A>e.loadingDescendantLimit&&(e._tileLoadQueueLow.length=_,e._tileLoadQueueMedium.length=S,e._tileLoadQueueHigh.length=Z,Qg(e,e._tileLoadQueueMedium,n,t),o.notYetRenderableCount=n.renderable?0:1,L=!0),o.allAreRenderable=n.renderable,o.anyWereRenderedLastFrame=I,I||e._tileToUpdateHeights.push(n),++r.tilesWaitingForChildren}e.preloadAncestors&&!L&&Qg(e,e._tileLoadQueueLow,n,t)}return}n._lastSelectionResultFrame=t.frameNumber,n._lastSelectionResult=gi.RENDERED,nK(e,n),Qg(e,e._tileLoadQueueHigh,n,t),o.allAreRenderable=n.renderable,o.anyWereRenderedLastFrame=p===gi.RENDERED,o.notYetRenderableCount=n.renderable?0:1}function CAt(e,t,n,i,o,r,s,a){let c=r.camera.positionCartographic,d=e._tileProvider,u=e._occluders,m=Loe[t.level],p=m.southwest,b=m.southeast,f=m.northwest,y=m.northeast;c.longitude<t.rectangle.east?c.latitude<t.rectangle.north?(kc(e,t,d,r,u,s,p),kc(e,n,d,r,u,s,b),kc(e,i,d,r,u,s,f),kc(e,o,d,r,u,s,y)):(kc(e,i,d,r,u,s,f),kc(e,t,d,r,u,s,p),kc(e,o,d,r,u,s,y),kc(e,n,d,r,u,s,b)):c.latitude<t.rectangle.north?(kc(e,n,d,r,u,s,b),kc(e,t,d,r,u,s,p),kc(e,o,d,r,u,s,y),kc(e,i,d,r,u,s,f)):(kc(e,o,d,r,u,s,y),kc(e,i,d,r,u,s,f),kc(e,n,d,r,u,s,b),kc(e,t,d,r,u,s,p)),m.combine(a)}function VAt(e,t){let n=t.rectangle;return l(e._cameraPositionCartographic)&&re.contains(n,e._cameraPositionCartographic)||l(e._cameraReferenceFrameOriginCartographic)&&re.contains(n,e._cameraReferenceFrameOriginCartographic)}function kc(e,t,n,i,o,r,s){if(n.computeTileVisibility(t,i,o)!==Jr.NONE)return RAt(e,i,t,r,s);if(++e._debug.tilesCulled,e._tileReplacementQueue.markTileRendered(t),s.allAreRenderable=!0,s.anyWereRenderedLastFrame=!1,s.notYetRenderableCount=0,VAt(e,t)){(!l(t.data)||!l(t.data.vertexArray))&&Qg(e,e._tileLoadQueueMedium,t,i);let a=e._lastSelectionFrameNumber,c=t._lastSelectionResultFrame===a?t._lastSelectionResult:gi.NONE;c!==gi.CULLED_BUT_NEEDED&&c!==gi.RENDERED&&e._tileToUpdateHeights.push(t),t._lastSelectionResult=gi.CULLED_BUT_NEEDED}else e.preloadSiblings||t.level===0?(Qg(e,e._tileLoadQueueLow,t,i),t._lastSelectionResult=gi.CULLED):t._lastSelectionResult=gi.CULLED;t._lastSelectionResultFrame=i.frameNumber}function EAt(e,t,n){if(t.mode===se.SCENE2D||t.camera.frustum instanceof yn||t.camera.frustum instanceof ps)return AAt(e,t,n);let i=e._tileProvider.getLevelMaximumGeometricError(n.level),o=n._distance,r=t.context.drawingBufferHeight,s=t.camera.frustum.sseDenominator,a=i*r/(o*s);return t.fog.enabled&&(a-=W.fog(o,t.fog.density)*t.fog.sse),a/=t.pixelRatio,a}function AAt(e,t,n){let o=t.camera.frustum,r=o.offCenterFrustum;l(r)&&(o=r);let s=t.context,a=s.drawingBufferWidth,c=s.drawingBufferHeight,d=e._tileProvider.getLevelMaximumGeometricError(n.level),u=Math.max(o.top-o.bottom,o.right-o.left)/Math.max(a,c),m=d/u;return t.fog.enabled&&t.mode!==se.SCENE2D&&(m-=W.fog(n._distance,t.fog.density)*t.fog.sse),m/=t.pixelRatio,m}function nK(e,t){e._tilesToRender.push(t),e._tilesRenderedThisFrame.add(t)}function GAt(e,t){let n=e._tileLoadQueueHigh,i=e._tileLoadQueueMedium,o=e._tileLoadQueueLow;if(n.length===0&&i.length===0&&o.length===0)return;e._tileReplacementQueue.trimTiles(e.tileCacheSize);let r=Zn()+e._loadQueueTimeSlice,s=e._tileProvider,a=Goe(e,t,s,r,n,!1);a=Goe(e,t,s,r,i,a),Goe(e,t,s,r,o,a)}function LAt(e,t){return e._loadPriority-t._loadPriority}function Goe(e,t,n,i,o,r){n.computeTileLoadPriority!==void 0&&o.sort(LAt);for(let s=0,a=o.length;s<a&&(Zn()<i||!r);++s){let c=o[s];e._tileReplacementQueue.markTileRendered(c),n.loadTile(t,c),r=!0}return r}var nA=new gn,iK=new pe,TT=new h,WAt=[];function vAt(e,t){if(!l(e.tileProvider.tilingScheme))return;let n=WAt;n.length=0;let i=e._tileToUpdateHeights,o=Zn(),r=e._updateHeightsTimeSlice,s=o+r,a=t.mode,c=t.mapProjection,d=e.tileProvider.tilingScheme.ellipsoid,u;for(;i.length>0;){let m=i[0];if(!l(m.data)||!l(m.data.mesh)){let _=m._lastSelectionResultFrame===e._lastSelectionFrameNumber?m._lastSelectionResult:gi.NONE;(_===gi.RENDERED||_===gi.CULLED_BUT_NEEDED)&&n.push(m),m.clearPositionCache(),i.shift();continue}let p=m.customData;l(m._customDataIterator)||(m._customDataIterator=p.values());let b=m._customDataIterator,f=!1,y;for(;!(y=b.next()).done;){let _=y.value,S=m.data.terrainData,Z=l(S)&&S.wasCreatedByUpsampling();if(m.level>_.level&&!Z){let R,C=m.getPositionCacheEntry(_.positionCartographic,e.maximumScreenSpaceError);if(l(C))R=C;else{if(l(_.positionOnEllipsoidSurface)||(_.positionOnEllipsoidSurface=h.fromRadians(_.positionCartographic.longitude,_.positionCartographic.latitude,0,d)),a===se.SCENE3D){let E=d.geodeticSurfaceNormal(_.positionOnEllipsoidSurface,nA.direction),A=d.getSurfaceNormalIntersectionWithZAxis(_.positionOnEllipsoidSurface,11500,nA.origin);if(!l(A)){let L=0;l(m.data.tileBoundingRegion)&&(L=m.data.tileBoundingRegion.minimumHeight);let F=Math.min(L,-11500),I=h.multiplyByScalar(E,Math.abs(F)+1,TT);h.subtract(_.positionOnEllipsoidSurface,I,nA.origin)}}else pe.clone(_.positionCartographic,iK),iK.height=-11500,c.project(iK,TT),h.fromElements(TT.z,TT.x,TT.y,TT),h.clone(TT,nA.origin),h.clone(h.UNIT_X,nA.direction);R=m.data.pick(nA,a,c,!1,TT),l(R)&&m.setPositionCacheEntry(_.positionCartographic,e.maximumScreenSpaceError,h.clone(R))}if(l(R)){if(l(_.callback)){let E=d.cartesianToCartographic(R,iK);_.callback(E)}_.level=m.level}}if(Zn()>=s){f=!0;break}}if(f){m._customDataIterator=b;break}else m._customDataIterator=void 0,i.shift()}for(u=0;u<n.length;u++)i.push(n[u])}function FAt(e,t){let n=e._tileProvider,i=e._tilesToRender;for(let o=0,r=i.length;o<r;++o){let s=i[o];n.showTileThisFrame(s,t)}}var zw=Th;function jf(e){e=e??ne.default;let t=new A0({ellipsoid:e}),n=new KS,i=new ag({tilingScheme:t.tilingScheme});this._ellipsoid=e,this._imageryLayerCollection=n,this._surfaceShaderSet=new Xw,this._material=void 0,this._surface=new zw({tileProvider:new Yw({terrainProvider:t,imageryLayers:n,surfaceShaderSet:this._surfaceShaderSet,vectorProvider:i})}),this._terrainProvider=t,this._terrainProviderChanged=new Se,this._vectorProvider=i,this._undergroundColor=U.clone(U.BLACK),this._undergroundColorAlphaByDistance=new Kt(e.maximumRadius/1e3,0,e.maximumRadius/5,1),this._translucency=new Mw,voe(this),this.show=!0,this._oceanNormalMapResourceDirty=!0,this._oceanNormalMapResource=new ve({url:en("Assets/Textures/waterNormalsSmall.jpg")}),this.maximumScreenSpaceError=2,this.tileCacheSize=100,this.loadingDescendantLimit=20,this.preloadAncestors=!0,this.preloadSiblings=!1,this.fillHighlightColor=void 0,this.enableLighting=!1,this.lambertDiffuseMultiplier=.9,this.dynamicAtmosphereLighting=!0,this.dynamicAtmosphereLightingFromSun=!1,this.showGroundAtmosphere=ne.WGS84.equals(e),this.atmosphereLightIntensity=10,this.atmosphereRayleighCoefficient=new h(55e-7,13e-6,284e-7),this.atmosphereMieCoefficient=new h(21e-6,21e-6,21e-6),this.atmosphereRayleighScaleHeight=1e4,this.atmosphereMieScaleHeight=3200,this.atmosphereMieAnisotropy=.9,this.lightingFadeOutDistance=W.PI_OVER_TWO*e.minimumRadius,this.lightingFadeInDistance=W.PI*e.minimumRadius,this.nightFadeOutDistance=W.PI_OVER_TWO*e.minimumRadius,this.nightFadeInDistance=5*W.PI_OVER_TWO*e.minimumRadius,this.showWaterEffect=!0,this.depthTestAgainstTerrain=!1,this.shadows=vn.RECEIVE_ONLY,this.atmosphereHueShift=0,this.atmosphereSaturationShift=0,this.atmosphereBrightnessShift=0,this.showSkirts=!0,this.backFaceCulling=!0,this._oceanNormalMap=void 0,this._zoomedOutOceanSpecularIntensity=void 0,this.vertexShadowDarkness=.3}Object.defineProperties(jf.prototype,{ellipsoid:{get:function(){return this._ellipsoid}},imageryLayers:{get:function(){return this._imageryLayerCollection}},imageryLayersUpdatedEvent:{get:function(){return this._surface.tileProvider.imageryLayersUpdatedEvent}},tilesLoaded:{get:function(){return l(this._surface)?this._surface._tileLoadQueueHigh.length===0&&this._surface._tileLoadQueueMedium.length===0&&this._surface._tileLoadQueueLow.length===0:!0}},baseColor:{get:function(){return this._surface.tileProvider.baseColor},set:function(e){this._surface.tileProvider.baseColor=e}},clippingPlanes:{get:function(){return this._surface.tileProvider.clippingPlanes},set:function(e){this._surface.tileProvider.clippingPlanes=e}},clippingPolygons:{get:function(){return this._surface.tileProvider.clippingPolygons},set:function(e){this._surface.tileProvider.clippingPolygons=e}},cartographicLimitRectangle:{get:function(){return this._surface.tileProvider.cartographicLimitRectangle},set:function(e){l(e)||(e=re.clone(re.MAX_VALUE)),this._surface.tileProvider.cartographicLimitRectangle=e}},oceanNormalMapUrl:{get:function(){return this._oceanNormalMapResource.url},set:function(e){this._oceanNormalMapResource.url=e,this._oceanNormalMapResourceDirty=!0}},terrainProvider:{get:function(){return this._terrainProvider},set:function(e){e!==this._terrainProvider&&(this._terrainProvider=e,l(e)&&(this._vectorProvider.tilingScheme=e.tilingScheme),this._terrainProviderChanged.raiseEvent(e),l(this._material)&&voe(this))}},terrainProviderChanged:{get:function(){return this._terrainProviderChanged}},vectorProvider:{get:function(){return this._vectorProvider}},tileLoadProgressEvent:{get:function(){return this._surface.tileLoadProgressEvent}},material:{get:function(){return this._material},set:function(e){this._material!==e&&(this._material=e,voe(this))}},undergroundColor:{get:function(){return this._undergroundColor},set:function(e){this._undergroundColor=U.clone(e,this._undergroundColor)}},undergroundColorAlphaByDistance:{get:function(){return this._undergroundColorAlphaByDistance},set:function(e){this._undergroundColorAlphaByDistance=Kt.clone(e,this._undergroundColorAlphaByDistance)}},translucency:{get:function(){return this._translucency}}});function voe(e){let t=[],n=l(e._material)&&(l(e._material.shaderSource.match(/slope/))||l(e._material.shaderSource.match("normalEC"))),i=[Uh,_1];l(e._material)&&(!n||e._terrainProvider.hasVertexNormals)?(i.push(e._material.shaderSource),t.push("APPLY_MATERIAL"),e._surface._tileProvider.materialUniformMap=e._material._uniforms):e._surface._tileProvider.materialUniformMap=void 0,i.push(Hv),e._surfaceShaderSet.baseVertexShaderSource=new Je({sources:[Uh,_1,Kv],defines:t}),e._surfaceShaderSet.baseFragmentShaderSource=new Je({sources:i,defines:t}),e._surfaceShaderSet.material=e._material}function IAt(e){return function(t,n){let i=me.distanceSquaredTo(t.pickBoundingSphere,e),o=me.distanceSquaredTo(n.pickBoundingSphere,e);return i-o}}var PAt=[],XAt={start:0,stop:0};jf.prototype.pickWorldCoordinates=function(e,t,n,i){n=n??!0;let o=t.mode,r=t.mapProjection,s=PAt;s.length=0;for(let d of this._surface._tilesRenderedThisFrame){let u=d.data;if(!l(u))continue;let m=u.pickBoundingSphere;if(o!==se.SCENE3D)u.pickBoundingSphere=m=me.fromRectangleWithHeights2D(d.rectangle,r,u.tileBoundingRegion.minimumHeight,u.tileBoundingRegion.maximumHeight,m),h.fromElements(m.center.z,m.center.x,m.center.y,m.center);else if(l(u.renderedMesh))me.clone(u.tileBoundingRegion.boundingSphere,m);else continue;let p=xi.raySphere(e,m,XAt);l(p)&&s.push(u)}s.sort(IAt(e.origin));let a,c=s.length;for(let d=0;d<c&&(a=s[d].pick(e,t.mode,t.mapProjection,n,i),!l(a));++d);return a};var NAt=new pe;jf.prototype.pick=function(e,t,n){if(n=this.pickWorldCoordinates(e,t,!0,n),l(n)&&t.mode!==se.SCENE3D){n=h.fromElements(n.y,n.z,n.x,n);let i=t.mapProjection.unproject(n,NAt);n=this._ellipsoid.cartographicToCartesian(i,n)}return n};var YAt=new h,Pve=new h,MAt=new pe,wAt=new gn;function Woe(e,t){return l(e)&&re.contains(e.rectangle,t)?e:void 0}jf.prototype.getHeight=function(e){let t=this._surface._levelZeroTiles;if(!l(t))return;let n,i,o=t.length;for(i=0;i<o&&(n=t[i],!re.contains(n.rectangle,e));++i);if(i>=o)return;let r=n;for(;l(n);)n=Woe(n._southwestChild,e)||Woe(n._southeastChild,e)||Woe(n._northwestChild,e)||n._northeastChild,l(n)&&l(n.data)&&l(n.data.renderedMesh)&&(r=n);if(n=r,!l(n)||!l(n.data)||!l(n.data.renderedMesh))return;let s=this._surface._tileProvider.tilingScheme.projection,a=this._surface._tileProvider.tilingScheme.ellipsoid,c=h.fromRadians(e.longitude,e.latitude,0,a,YAt),d=wAt,u=a.geodeticSurfaceNormal(c,d.direction),m=a.getSurfaceNormalIntersectionWithZAxis(c,11500,d.origin);if(!l(m)){let b;l(n.data.tileBoundingRegion)&&(b=n.data.tileBoundingRegion.minimumHeight);let f=Math.min(b??0,-11500),y=h.multiplyByScalar(u,Math.abs(f)+1,Pve);h.subtract(c,y,d.origin)}let p=n.data.pick(d,se.SCENE3D,s,!1,Pve);if(l(p))return a.cartesianToCartographic(p,MAt).height};jf.prototype.update=function(e){this.show&&e.passes.render&&this._surface.update(e)};jf.prototype.beginFrame=function(e){let t=this._surface,n=t.tileProvider,i=this.terrainProvider,o=l(i)&&i.hasWaterMask&&i.hasWaterMask;if(o&&this._oceanNormalMapResourceDirty){this._oceanNormalMapResourceDirty=!1;let a=this._oceanNormalMapResource,c=a.url;if(l(c)){let d=this;a.fetchImage().then(function(u){c===d._oceanNormalMapResource.url&&(d._oceanNormalMap=d._oceanNormalMap&&d._oceanNormalMap.destroy(),d._oceanNormalMap=new vt({context:e.context,source:u}))})}else this._oceanNormalMap=this._oceanNormalMap&&this._oceanNormalMap.destroy()}let r=e.passes,s=e.mode;r.render&&(this.showGroundAtmosphere?this._zoomedOutOceanSpecularIntensity=.4:this._zoomedOutOceanSpecularIntensity=.5,t.maximumScreenSpaceError=this.maximumScreenSpaceError,t.tileCacheSize=this.tileCacheSize,t.loadingDescendantLimit=this.loadingDescendantLimit,t.preloadAncestors=this.preloadAncestors,t.preloadSiblings=this.preloadSiblings,n.terrainProvider=this.terrainProvider,n.lightingFadeOutDistance=this.lightingFadeOutDistance,n.lightingFadeInDistance=this.lightingFadeInDistance,n.nightFadeOutDistance=this.nightFadeOutDistance,n.nightFadeInDistance=this.nightFadeInDistance,n.zoomedOutOceanSpecularIntensity=s===se.SCENE3D?this._zoomedOutOceanSpecularIntensity:0,n.hasWaterMask=o,n.showWaterEffect=this.showWaterEffect,n.oceanNormalMap=this._oceanNormalMap,n.enableLighting=this.enableLighting,n.dynamicAtmosphereLighting=this.dynamicAtmosphereLighting,n.dynamicAtmosphereLightingFromSun=this.dynamicAtmosphereLightingFromSun,n.showGroundAtmosphere=this.showGroundAtmosphere,n.atmosphereLightIntensity=this.atmosphereLightIntensity,n.atmosphereRayleighCoefficient=this.atmosphereRayleighCoefficient,n.atmosphereMieCoefficient=this.atmosphereMieCoefficient,n.atmosphereRayleighScaleHeight=this.atmosphereRayleighScaleHeight,n.atmosphereMieScaleHeight=this.atmosphereMieScaleHeight,n.atmosphereMieAnisotropy=this.atmosphereMieAnisotropy,n.shadows=this.shadows,n.hueShift=this.atmosphereHueShift,n.saturationShift=this.atmosphereSaturationShift,n.brightnessShift=this.atmosphereBrightnessShift,n.fillHighlightColor=this.fillHighlightColor,n.showSkirts=this.showSkirts,n.backFaceCulling=this.backFaceCulling,n.vertexShadowDarkness=this.vertexShadowDarkness,n.undergroundColor=this._undergroundColor,n.undergroundColorAlphaByDistance=this._undergroundColorAlphaByDistance,n.lambertDiffuseMultiplier=this.lambertDiffuseMultiplier,t.beginFrame(e))};jf.prototype.render=function(e){this.show&&(l(this._material)&&this._material.update(e.context),this._surface.render(e))};jf.prototype.endFrame=function(e){this.show&&e.passes.render&&this._surface.endFrame(e)};jf.prototype.isDestroyed=function(){return!1};jf.prototype.destroy=function(){return this._surfaceShaderSet=this._surfaceShaderSet&&this._surfaceShaderSet.destroy(),this._surface=this._surface&&this._surface.destroy(),this._oceanNormalMap=this._oceanNormalMap&&this._oceanNormalMap.destroy(),ue(this)};var Hw=jf;var Mao=x(T(),1);var eao=x(T(),1);var Bso=x(T(),1);var Yso=x(T(),1);function kAt(e,t,n,i){this.rightAscension=e,this.declination=t,this.rotation=n,this.rotationRate=i}var Kw=kAt;var Jve={},UAt=32.184,DAt=2451545,Xve=-.0529921,Nve=-.1059842,Yve=13.0120009,Mve=13.3407154,wve=.9856003,kve=26.4057084,Uve=13.064993,Dve=.3287146,Ove=1.7484877,Bve=-.1589763,zve=.0036096,Hve=.1643573,Kve=12.9590088,Foe=new Q;Jve.ComputeMoon=function(e,t){l(e)||(e=Q.now()),Foe=Q.addSeconds(e,UAt,Foe);let n=Q.totalDays(Foe)-DAt,i=n/wn.DAYS_PER_JULIAN_CENTURY,o=(125.045+Xve*n)*W.RADIANS_PER_DEGREE,r=(250.089+Nve*n)*W.RADIANS_PER_DEGREE,s=(260.008+Yve*n)*W.RADIANS_PER_DEGREE,a=(176.625+Mve*n)*W.RADIANS_PER_DEGREE,c=(357.529+wve*n)*W.RADIANS_PER_DEGREE,d=(311.589+kve*n)*W.RADIANS_PER_DEGREE,u=(134.963+Uve*n)*W.RADIANS_PER_DEGREE,m=(276.617+Dve*n)*W.RADIANS_PER_DEGREE,p=(34.226+Ove*n)*W.RADIANS_PER_DEGREE,b=(15.134+Bve*n)*W.RADIANS_PER_DEGREE,f=(119.743+zve*n)*W.RADIANS_PER_DEGREE,y=(239.961+Hve*n)*W.RADIANS_PER_DEGREE,_=(25.053+Kve*n)*W.RADIANS_PER_DEGREE,S=Math.sin(o),Z=Math.sin(r),R=Math.sin(s),C=Math.sin(a),E=Math.sin(c),A=Math.sin(d),L=Math.sin(u),F=Math.sin(m),I=Math.sin(p),N=Math.sin(b),g=Math.sin(f),V=Math.sin(y),G=Math.sin(_),v=Math.cos(o),X=Math.cos(r),Y=Math.cos(s),D=Math.cos(a),M=Math.cos(c),O=Math.cos(d),w=Math.cos(u),z=Math.cos(m),K=Math.cos(p),te=Math.cos(b),H=Math.cos(f),$=Math.cos(y),ee=Math.cos(_),le=(269.9949+.0031*i-3.8787*S-.1204*Z+.07*R-.0172*C+.0072*A-.0052*N+.0043*G)*W.RADIANS_PER_DEGREE,_e=(66.5392+.013*i+1.5419*v+.0239*X-.0278*Y+.0068*D-.0029*O+9e-4*w+8e-4*te-9e-4*ee)*W.RADIANS_PER_DEGREE,he=(38.3213+13.17635815*n-14e-13*n*n+3.561*S+.1208*Z-.0642*R+.0158*C+.0252*E-.0066*A-.0047*L-.0046*F+.0028*I+.0052*N+.004*g+.0019*V-.0044*G)*W.RADIANS_PER_DEGREE,Ze=(13.17635815-14e-13*(2*n)+3.561*v*Xve+.1208*X*Nve-.0642*Y*Yve+.0158*D*Mve+.0252*M*wve-.0066*O*kve-.0047*w*Uve-.0046*z*Dve+.0028*K*Ove+.0052*te*Bve+.004*H*zve+.0019*$*Hve-.0044*ee*Kve)/86400*W.RADIANS_PER_DEGREE;return l(t)||(t=new Kw),t.rightAscension=le,t.declination=_e,t.rotation=he,t.rotationRate=Ze,t};var Jw=Jve;function jve(e){(!l(e)||typeof e!="function")&&(e=Jw.ComputeMoon),this._computeFunction=e}var OAt=new h,BAt=new h,zAt=new h;function HAt(e,t,n){let i=OAt;i.x=Math.cos(e+W.PI_OVER_TWO),i.y=Math.sin(e+W.PI_OVER_TWO),i.z=0;let o=Math.cos(t),r=zAt;r.x=o*Math.cos(e),r.y=o*Math.sin(e),r.z=Math.sin(t);let s=h.cross(r,i,BAt);return l(n)||(n=new q),n[0]=i.x,n[1]=s.x,n[2]=r.x,n[3]=i.y,n[4]=s.y,n[5]=r.y,n[6]=i.z,n[7]=s.z,n[8]=r.z,n}var KAt=new q,JAt=new Ne;jve.prototype.evaluate=function(e,t){l(e)||(e=Q.now());let n=this._computeFunction(e),i=HAt(n.rightAscension,n.declination,t),o=W.zeroToTwoPi(n.rotation),r=Ne.fromAxisAngle(h.UNIT_Z,o,JAt),s=q.fromQuaternion(Ne.conjugate(r,r),KAt);return q.multiply(s,i,i)};var jw=jve;var Rao=x(T(),1);var Ioe={position:0};function oK(e){e=e??B.EMPTY_OBJECT,this.center=h.clone(e.center??h.ZERO),this._center=new h,this.radii=h.clone(e.radii),this._radii=new h,this._oneOverEllipsoidRadiiSquared=new h,this._boundingSphere=new me,this.modelMatrix=P.clone(e.modelMatrix??P.IDENTITY),this._modelMatrix=new P,this._computedModelMatrix=new P,this.show=e.show??!0,this.material=e.material??eo.fromType(eo.ColorType),this._material=void 0,this._translucent=void 0,this.id=e.id,this._id=void 0,this.debugShowBoundingVolume=e.debugShowBoundingVolume??!1,this.onlySunLighting=e.onlySunLighting??!1,this._onlySunLighting=!1,this._depthTestEnabled=e.depthTestEnabled??!0,this._useLogDepth=!1,this._sp=void 0,this._rs=void 0,this._va=void 0,this._pickSP=void 0,this._pickId=void 0,this._colorCommand=new lt({owner:e._owner??this}),this._pickCommand=new lt({owner:e._owner??this,pickOnly:!0});let t=this;this._uniforms={u_radii:function(){return t.radii},u_oneOverEllipsoidRadiiSquared:function(){return t._oneOverEllipsoidRadiiSquared}},this._pickUniforms={czm_pickColor:function(){return t._pickId.color}}}function jAt(e){let t=e.cache.ellipsoidPrimitive_vertexArray;if(l(t))return t;let n=Vc.createGeometry(Vc.fromDimensions({dimensions:new h(2,2,2),vertexFormat:Me.POSITION_ONLY}));return t=Un.fromGeometry({context:e,geometry:n,attributeLocations:Ioe,bufferUsage:Pe.STATIC_DRAW,interleave:!0}),e.cache.ellipsoidPrimitive_vertexArray=t,t}oK.prototype.update=function(e){if(!this.show||e.mode!==se.SCENE3D||!l(this.center)||!l(this.radii))return;let t=e.context,n=this.material.isTranslucent(),i=this._translucent!==n;(!l(this._rs)||i)&&(this._translucent=n,this._rs=ze.fromCache({cull:{enabled:!0,face:Di.FRONT},depthTest:{enabled:this._depthTestEnabled},depthMask:!n&&t.fragmentDepth,blending:n?on.ALPHA_BLEND:void 0})),l(this._va)||(this._va=jAt(t));let o=!1,r=this.radii;if(!h.equals(this._radii,r)){h.clone(r,this._radii);let y=this._oneOverEllipsoidRadiiSquared;y.x=1/(r.x*r.x),y.y=1/(r.y*r.y),y.z=1/(r.z*r.z),o=!0}(!P.equals(this.modelMatrix,this._modelMatrix)||!h.equals(this.center,this._center))&&(P.clone(this.modelMatrix,this._modelMatrix),h.clone(this.center,this._center),P.multiplyByTranslation(this.modelMatrix,this.center,this._computedModelMatrix),o=!0),o&&(h.clone(h.ZERO,this._boundingSphere.center),this._boundingSphere.radius=h.maximumComponent(r),me.transform(this._boundingSphere,this._computedModelMatrix,this._boundingSphere));let s=this._material!==this.material;this._material=this.material,this._material.update(t);let a=this.onlySunLighting!==this._onlySunLighting;this._onlySunLighting=this.onlySunLighting;let c=e.useLogDepth,d=this._useLogDepth!==c;this._useLogDepth=c;let u=this._colorCommand,m,p;(s||a||i||d)&&(m=new Je({sources:[T1]}),p=new Je({sources:[this.material.shaderSource,x1]}),this.onlySunLighting&&p.defines.push("ONLY_SUN_LIGHTING"),!n&&t.fragmentDepth&&p.defines.push("WRITE_DEPTH"),this._useLogDepth&&(m.defines.push("LOG_DEPTH"),p.defines.push("LOG_DEPTH")),this._sp=tn.replaceCache({context:t,shaderProgram:this._sp,vertexShaderSource:m,fragmentShaderSource:p,attributeLocations:Ioe}),u.vertexArray=this._va,u.renderState=this._rs,u.shaderProgram=this._sp,u.uniformMap=It(this._uniforms,this.material._uniforms),u.executeInClosestFrustum=n);let b=e.commandList,f=e.passes;if(f.render&&(u.boundingVolume=this._boundingSphere,u.debugShowBoundingVolume=this.debugShowBoundingVolume,u.modelMatrix=this._computedModelMatrix,u.pass=n?Le.TRANSLUCENT:Le.OPAQUE,b.push(u)),f.pick){let y=this._pickCommand;(!l(this._pickId)||this._id!==this.id)&&(this._id=this.id,this._pickId=this._pickId&&this._pickId.destroy(),this._pickId=t.createPickId({primitive:this,id:this.id})),(s||a||!l(this._pickSP)||d)&&(m=new Je({sources:[T1]}),p=new Je({sources:[this.material.shaderSource,x1],pickColorQualifier:"uniform"}),this.onlySunLighting&&p.defines.push("ONLY_SUN_LIGHTING"),!n&&t.fragmentDepth&&p.defines.push("WRITE_DEPTH"),this._useLogDepth&&(m.defines.push("LOG_DEPTH"),p.defines.push("LOG_DEPTH")),this._pickSP=tn.replaceCache({context:t,shaderProgram:this._pickSP,vertexShaderSource:m,fragmentShaderSource:p,attributeLocations:Ioe}),y.vertexArray=this._va,y.renderState=this._rs,y.shaderProgram=this._pickSP,y.uniformMap=It(It(this._uniforms,this._pickUniforms),this.material._uniforms),y.executeInClosestFrustum=n),y.boundingVolume=this._boundingSphere,y.modelMatrix=this._computedModelMatrix,y.pass=n?Le.TRANSLUCENT:Le.OPAQUE,b.push(y)}};oK.prototype.isDestroyed=function(){return!1};oK.prototype.destroy=function(){return this._sp=this._sp&&this._sp.destroy(),this._pickSP=this._pickSP&&this._pickSP.destroy(),this._pickId=this._pickId&&this._pickId.destroy(),ue(this)};var Qw=oK;function qw(e){e=e??B.EMPTY_OBJECT;let t=e.textureUrl;l(t)||(t=en("Assets/Textures/moonSmall.jpg")),this.show=e.show??!0,this.textureUrl=t,this._ellipsoid=e.ellipsoid??ne.MOON,this.onlySunLighting=e.onlySunLighting??!0,this._ellipsoidPrimitive=new Qw({radii:this.ellipsoid.radii,material:eo.fromType(eo.ImageType),depthTestEnabled:!1,_owner:this}),this._ellipsoidPrimitive.material.translucent=!1,this._axes=new jw}Object.defineProperties(qw.prototype,{ellipsoid:{get:function(){return this._ellipsoid}}});var rK=new q,QAt=new q,qAt=new h,sK=[];qw.prototype.update=function(e){if(!this.show)return;let t=this._ellipsoidPrimitive;t.material.uniforms.image=this.textureUrl,t.onlySunLighting=this.onlySunLighting;let n=e.time;l(_t.computeIcrfToFixedMatrix(n,rK))||_t.computeTemeToPseudoFixedMatrix(n,rK);let i=this._axes.evaluate(n,QAt);q.transpose(i,i),q.multiply(rK,i,i);let o=Iy.computeMoonPositionInEarthInertialFrame(n,qAt);q.multiplyByVector(rK,o,o),P.fromRotationTranslation(i,o,t.modelMatrix);let r=e.commandList;return e.commandList=sK,sK.length=0,t.update(e),e.commandList=r,sK.length===1?sK[0]:void 0};qw.prototype.isDestroyed=function(){return!1};qw.prototype.destroy=function(){return this._ellipsoidPrimitive=this._ellipsoidPrimitive&&this._ellipsoidPrimitive.destroy(),ue(this)};var $w=qw;var pVo=x(T(),1);var kao=x(T(),1);var Poe=[],Xoe=[];function $At(e,t,n,i,o,r){let s=o-i+1,a=r-o,c=Poe,d=Xoe,u,m;for(u=0;u<s;++u)c[u]=e[i+u];for(m=0;m<a;++m)d[m]=e[o+m+1];u=0,m=0;for(let p=i;p<=r;++p){let b=c[u],f=d[m];u<s&&(m>=a||t(b,f,n)<=0)?(e[p]=b,++u):m<a&&(e[p]=f,++m)}}function Noe(e,t,n,i,o){if(i>=o)return;let r=Math.floor((i+o)*.5);Noe(e,t,n,i,r),Noe(e,t,n,r+1,o),$At(e,t,n,i,r,o)}function eGt(e,t,n){let i=e.length,o=Math.ceil(i*.5);Poe.length=o,Xoe.length=o,Noe(e,t,n,0,i-1),Poe.length=0,Xoe.length=0}var L0=eGt;var jao=x(T(),1);function _l(e,t){this._occluderPosition=h.clone(e.center),this._occluderRadius=e.radius,this._horizonDistance=0,this._horizonPlaneNormal=void 0,this._horizonPlanePosition=void 0,this._cameraPosition=void 0,this.cameraPosition=t}var aK=new h;Object.defineProperties(_l.prototype,{position:{get:function(){return this._occluderPosition}},radius:{get:function(){return this._occluderRadius}},cameraPosition:{set:function(e){e=h.clone(e,this._cameraPosition);let t=h.subtract(this._occluderPosition,e,aK),n=h.magnitudeSquared(t),i=this._occluderRadius*this._occluderRadius,o,r,s;if(n>i){o=Math.sqrt(n-i),n=1/Math.sqrt(n),r=h.multiplyByScalar(t,n,aK);let a=o*o*n;s=h.add(e,h.multiplyByScalar(r,a,aK),aK)}else o=Number.MAX_VALUE;this._horizonDistance=o,this._horizonPlaneNormal=r,this._horizonPlanePosition=s,this._cameraPosition=e}}});_l.fromBoundingSphere=function(e,t,n){return l(n)?(h.clone(e.center,n._occluderPosition),n._occluderRadius=e.radius,n.cameraPosition=t,n):new _l(e,t)};var qve=new h;_l.prototype.isPointVisible=function(e){if(this._horizonDistance!==Number.MAX_VALUE){let t=h.subtract(e,this._occluderPosition,qve),n=this._occluderRadius;if(n=h.magnitudeSquared(t)-n*n,n>0)return n=Math.sqrt(n)+this._horizonDistance,t=h.subtract(e,this._cameraPosition,t),n*n>h.magnitudeSquared(t)}return!1};var tGt=new h;_l.prototype.isBoundingSphereVisible=function(e){let t=h.clone(e.center,tGt),n=e.radius;if(this._horizonDistance!==Number.MAX_VALUE){let i=h.subtract(t,this._occluderPosition,qve),o=this._occluderRadius-n;if(o=h.magnitudeSquared(i)-o*o,n<this._occluderRadius)return o>0?(o=Math.sqrt(o)+this._horizonDistance,i=h.subtract(t,this._cameraPosition,i),o*o+n*n>h.magnitudeSquared(i)):!1;if(o>0){i=h.subtract(t,this._cameraPosition,i);let r=h.magnitudeSquared(i),s=this._occluderRadius*this._occluderRadius,a=n*n;return(this._horizonDistance*this._horizonDistance+s)*a>r*s?!0:(o=Math.sqrt(o)+this._horizonDistance,o*o+a>r)}return!0}return!1};var nGt=new h;_l.prototype.computeVisibility=function(e){let t=h.clone(e.center),n=e.radius;if(n>this._occluderRadius)return Jr.FULL;if(this._horizonDistance!==Number.MAX_VALUE){let i=h.subtract(t,this._occluderPosition,nGt),o=this._occluderRadius-n,r=h.magnitudeSquared(i);if(o=r-o*o,o>0){o=Math.sqrt(o)+this._horizonDistance,i=h.subtract(t,this._cameraPosition,i);let s=h.magnitudeSquared(i);return o*o+n*n<s?Jr.NONE:(o=this._occluderRadius+n,o=r-o*o,o>0?(o=Math.sqrt(o)+this._horizonDistance,s<o*o+n*n?Jr.FULL:Jr.PARTIAL):(i=h.subtract(t,this._horizonPlanePosition,i),h.dot(i,this._horizonPlaneNormal)>-n?Jr.PARTIAL:Jr.FULL))}}return Jr.NONE};var cK=new h;_l.computeOccludeePoint=function(e,t,n){let i=h.clone(t),o=h.clone(e.center),r=e.radius,s=n.length,a=h.normalize(h.subtract(i,o,cK),cK),c=-h.dot(a,o),d=_l._anyRotationVector(o,a,c),u=_l._horizonToPlaneNormalDotProduct(e,a,c,d,n[0]);if(!u)return;let m;for(let b=1;b<s;++b){if(m=_l._horizonToPlaneNormalDotProduct(e,a,c,d,n[b]),!m)return;m<u&&(u=m)}if(u<.0017453283658983088)return;let p=r/u;return h.add(o,h.multiplyByScalar(a,p,cK),cK)};var iGt=[];_l.computeOccludeePointFromRectangle=function(e,t){t=t??ne.default;let n=re.subsample(e,t,0,iGt),i=me.fromPoints(n),o=h.ZERO;if(!h.equals(o,i.center))return _l.computeOccludeePoint(new me(o,t.minimumRadius),i.center,n)};var oGt=new h;_l._anyRotationVector=function(e,t,n){let i=h.abs(t,oGt),o=i.x>i.y?0:1;(o===0&&i.z>i.x||o===1&&i.z>i.y)&&(o=2);let r=new h,s;o===0?(i.x=e.x,i.y=e.y+1,i.z=e.z+1,s=h.UNIT_X):o===1?(i.x=e.x+1,i.y=e.y,i.z=e.z+1,s=h.UNIT_Y):(i.x=e.x+1,i.y=e.y+1,i.z=e.z,s=h.UNIT_Z);let a=(h.dot(t,i)+n)/-h.dot(t,s);return h.normalize(h.subtract(h.add(i,h.multiplyByScalar(s,a,r),i),e,i),i)};var rGt=new h;_l._rotationVector=function(e,t,n,i,o){let r=h.subtract(i,e,rGt);if(r=h.normalize(r,r),h.dot(t,r)<.9999999847691291){let s=h.cross(t,r,r);if(h.magnitude(s)>W.EPSILON13)return h.normalize(s,new h)}return o};var Yoe=new h,sGt=new h,lK=new h,Qve=new h;_l._horizonToPlaneNormalDotProduct=function(e,t,n,i,o){let r=h.clone(o,Yoe),s=h.clone(e.center,sGt),a=e.radius,c=h.subtract(s,r,lK),d=h.magnitudeSquared(c),u=a*a;if(d<u)return!1;let m=d-u,p=Math.sqrt(m),f=1/Math.sqrt(d),_=p*f*p;c=h.normalize(c,c);let S=h.add(r,h.multiplyByScalar(c,_,Qve),Qve),Z=Math.sqrt(m-_*_),R=this._rotationVector(s,t,n,r,i),C=h.fromElements(R.x*R.x*c.x+(R.x*R.y-R.z)*c.y+(R.x*R.z+R.y)*c.z,(R.x*R.y+R.z)*c.x+R.y*R.y*c.y+(R.y*R.z-R.x)*c.z,(R.x*R.z-R.y)*c.x+(R.y*R.z+R.x)*c.y+R.z*R.z*c.z,Yoe);C=h.normalize(C,C);let E=h.multiplyByScalar(C,Z,Yoe);R=h.normalize(h.subtract(h.add(S,E,lK),s,lK),lK);let A=h.dot(t,R);R=h.normalize(h.subtract(h.subtract(S,E,R),s,R),R);let L=h.dot(t,R);return A<L?A:L};var e9=_l;var uco=x(T(),1);var rco=x(T(),1);function W0(e){e=e??B.EMPTY_OBJECT,this.left=e.left,this._left=void 0,this.right=e.right,this._right=void 0,this.top=e.top,this._top=void 0,this.bottom=e.bottom,this._bottom=void 0,this.near=e.near??1,this._near=this.near,this.far=e.far??5e8,this._far=this.far,this._cullingVolume=new $s,this._perspectiveMatrix=new P,this._infinitePerspective=new P}function Moe(e){let{top:t,bottom:n,right:i,left:o,near:r,far:s}=e;(t!==e._top||n!==e._bottom||o!==e._left||i!==e._right||r!==e._near||s!==e._far)&&(e._left=o,e._right=i,e._top=t,e._bottom=n,e._near=r,e._far=s,e._perspectiveMatrix=P.computePerspectiveOffCenter(o,i,n,t,r,s,e._perspectiveMatrix),e._infinitePerspective=P.computeInfinitePerspectiveOffCenter(o,i,n,t,r,e._infinitePerspective))}Object.defineProperties(W0.prototype,{projectionMatrix:{get:function(){return Moe(this),this._perspectiveMatrix}},infiniteProjectionMatrix:{get:function(){return Moe(this),this._infinitePerspective}}});var aGt=new h,cGt=new h,lGt=new h,dGt=new h;W0.prototype.computeCullingVolume=function(e,t,n){let i=this._cullingVolume.planes,o=this.top,r=this.bottom,s=this.right,a=this.left,c=this.near,d=this.far,u=h.cross(t,n,aGt),m=cGt;h.multiplyByScalar(t,c,m),h.add(e,m,m);let p=lGt;h.multiplyByScalar(t,d,p),h.add(e,p,p);let b=dGt;h.multiplyByScalar(u,a,b),h.add(m,b,b),h.subtract(b,e,b),h.normalize(b,b),h.cross(b,n,b),h.normalize(b,b);let f=i[0];return l(f)||(f=i[0]=new ce),f.x=b.x,f.y=b.y,f.z=b.z,f.w=-h.dot(b,e),h.multiplyByScalar(u,s,b),h.add(m,b,b),h.subtract(b,e,b),h.cross(n,b,b),h.normalize(b,b),f=i[1],l(f)||(f=i[1]=new ce),f.x=b.x,f.y=b.y,f.z=b.z,f.w=-h.dot(b,e),h.multiplyByScalar(n,r,b),h.add(m,b,b),h.subtract(b,e,b),h.cross(u,b,b),h.normalize(b,b),f=i[2],l(f)||(f=i[2]=new ce),f.x=b.x,f.y=b.y,f.z=b.z,f.w=-h.dot(b,e),h.multiplyByScalar(n,o,b),h.add(m,b,b),h.subtract(b,e,b),h.cross(b,u,b),h.normalize(b,b),f=i[3],l(f)||(f=i[3]=new ce),f.x=b.x,f.y=b.y,f.z=b.z,f.w=-h.dot(b,e),f=i[4],l(f)||(f=i[4]=new ce),f.x=t.x,f.y=t.y,f.z=t.z,f.w=-h.dot(t,m),h.negate(t,b),f=i[5],l(f)||(f=i[5]=new ce),f.x=b.x,f.y=b.y,f.z=b.z,f.w=-h.dot(b,p),this._cullingVolume};W0.prototype.getPixelDimensions=function(e,t,n,i,o){Moe(this);let r=1/this.near,s=this.top*r,a=2*i*n*s/t;s=this.right*r;let c=2*i*n*s/e;return o.x=c,o.y=a,o};W0.prototype.clone=function(e){return l(e)||(e=new W0),e.right=this.right,e.left=this.left,e.top=this.top,e.bottom=this.bottom,e.near=this.near,e.far=this.far,e._left=void 0,e._right=void 0,e._top=void 0,e._bottom=void 0,e._near=void 0,e._far=void 0,e};W0.prototype.equals=function(e){return l(e)&&e instanceof W0&&this.right===e.right&&this.left===e.left&&this.top===e.top&&this.bottom===e.bottom&&this.near===e.near&&this.far===e.far};W0.prototype.equalsEpsilon=function(e,t,n){return e===this||l(e)&&e instanceof W0&&W.equalsEpsilon(this.right,e.right,t,n)&&W.equalsEpsilon(this.left,e.left,t,n)&&W.equalsEpsilon(this.top,e.top,t,n)&&W.equalsEpsilon(this.bottom,e.bottom,t,n)&&W.equalsEpsilon(this.near,e.near,t,n)&&W.equalsEpsilon(this.far,e.far,t,n)};var fd=W0;function su(e){e=e??B.EMPTY_OBJECT,this._offCenterFrustum=new fd,this.fov=e.fov,this._fov=void 0,this._fovy=void 0,this._sseDenominator=void 0,this.aspectRatio=e.aspectRatio,this._aspectRatio=void 0,this.near=e.near??1,this._near=this.near,this.far=e.far??5e8,this._far=this.far,this.xOffset=e.xOffset??0,this._xOffset=this.xOffset,this.yOffset=e.yOffset??0,this._yOffset=this.yOffset}su.packedLength=6;su.pack=function(e,t,n){return n=n??0,t[n++]=e.fov,t[n++]=e.aspectRatio,t[n++]=e.near,t[n++]=e.far,t[n++]=e.xOffset,t[n]=e.yOffset,t};su.unpack=function(e,t,n){return t=t??0,l(n)||(n=new su),n.fov=e[t++],n.aspectRatio=e[t++],n.near=e[t++],n.far=e[t++],n.xOffset=e[t++],n.yOffset=e[t],n};function Qf(e){if(!(e.fov!==e._fov||e.aspectRatio!==e._aspectRatio||e.near!==e._near||e.far!==e._far||e.xOffset!==e._xOffset||e.yOffset!==e._yOffset))return;e._aspectRatio=e.aspectRatio,e._fov=e.fov,e._fovy=e.aspectRatio<=1?e.fov:Math.atan(Math.tan(e.fov*.5)/e.aspectRatio)*2,e._near=e.near,e._far=e.far,e._sseDenominator=2*Math.tan(.5*e._fovy),e._xOffset=e.xOffset,e._yOffset=e.yOffset;let n=e._offCenterFrustum;n.top=e.near*Math.tan(.5*e._fovy),n.bottom=-n.top,n.right=e.aspectRatio*n.top,n.left=-n.right,n.near=e.near,n.far=e.far,n.right+=e.xOffset,n.left+=e.xOffset,n.top+=e.yOffset,n.bottom+=e.yOffset}Object.defineProperties(su.prototype,{projectionMatrix:{get:function(){return Qf(this),this._offCenterFrustum.projectionMatrix}},infiniteProjectionMatrix:{get:function(){return Qf(this),this._offCenterFrustum.infiniteProjectionMatrix}},fovy:{get:function(){return Qf(this),this._fovy}},sseDenominator:{get:function(){return Qf(this),this._sseDenominator}},offCenterFrustum:{get:function(){return Qf(this),this._offCenterFrustum}}});su.prototype.computeCullingVolume=function(e,t,n){return Qf(this),this._offCenterFrustum.computeCullingVolume(e,t,n)};su.prototype.getPixelDimensions=function(e,t,n,i,o){return Qf(this),this._offCenterFrustum.getPixelDimensions(e,t,n,i,o)};su.prototype.clone=function(e){return l(e)||(e=new su),e.aspectRatio=this.aspectRatio,e.fov=this.fov,e.near=this.near,e.far=this.far,e._aspectRatio=void 0,e._fov=void 0,e._near=void 0,e._far=void 0,this._offCenterFrustum.clone(e._offCenterFrustum),e};su.prototype.equals=function(e){return!l(e)||!(e instanceof su)?!1:(Qf(this),Qf(e),this.fov===e.fov&&this.aspectRatio===e.aspectRatio&&this._offCenterFrustum.equals(e._offCenterFrustum))};su.prototype.equalsEpsilon=function(e,t,n){return!l(e)||!(e instanceof su)?!1:(Qf(this),Qf(e),W.equalsEpsilon(this.fov,e.fov,t,n)&&W.equalsEpsilon(this.aspectRatio,e.aspectRatio,t,n)&&this._offCenterFrustum.equalsEpsilon(e._offCenterFrustum,t,n))};var qi=su;var Zco=x(T(),1);function t9(){this._colorTexture=void 0,this._drawCommand=void 0}Object.defineProperties(t9.prototype,{colorTexture:{get:function(){return this._colorTexture}}});function uGt(e,t,n){let i=t.createViewportQuadCommand(Vv,{framebuffer:n,renderState:ze.fromCache({viewport:new nt(0,0,256,256)})});e._drawCommand=i}t9.prototype.update=function(e){if(!l(this._colorTexture)){let t=e.context,n=new vt({context:t,width:256,height:256,pixelFormat:Qe.RGBA,pixelDatatype:Ue.UNSIGNED_BYTE,sampler:Ot.NEAREST});this._colorTexture=n;let i=new fs({context:t,colorTextures:[n],destroyAttachments:!1});uGt(this,t,i),this._drawCommand.execute(t),i.destroy(),this._drawCommand.shaderProgram=this._drawCommand.shaderProgram&&this._drawCommand.shaderProgram.destroy()}};t9.prototype.isDestroyed=function(){return!1};t9.prototype.destroy=function(){return this._colorTexture=this._colorTexture&&this._colorTexture.destroy(),ue(this)};var n9=t9;var hlo=x(T(),1);var Pco=x(T(),1);var n2e={};function mGt(e,t,n){let i,o,r;if(e instanceof qi){let s=Math.tan(.5*e.fovy);return i=e.near,o=e.near*s,r=e.aspectRatio*o,Math.max(t*i/r,n*i/o)}else if(e instanceof fd)return i=e.near,o=e.top,r=e.right,Math.max(t*i/r,n*i/o);return Math.max(t,n)}var hGt=new h,$ve=new h;function i2e(e,t,n,i){if(l(i)&&n(.5)>i){let o=n(0),r=n(1),s=n(.5),a=s-o,c=s-r;return function(d){let u=n(d);if(d<=.5){let p=(u-o)/a;return W.lerp(e,-W.PI_OVER_TWO,p)}let m=(u-r)/c;return W.lerp(-W.PI_OVER_TWO,t,1-m)}}return function(o){return W.lerp(e,t,o)}}function koe(e,t,n,i,o){let r=o,s=Math.max(n,i);if(!l(r)){let a=e.position,c=t,d=e.up,u=e.right,m=e.frustum,p=h.subtract(a,c,hGt),b=h.magnitude(h.multiplyByScalar(d,h.dot(p,d),$ve)),f=h.magnitude(h.multiplyByScalar(u,h.dot(p,u),$ve));r=Math.min(mGt(m,b,f)*.2,1e9)}if(s<r){let d=-Math.pow((r-n)*1e6,.125),u=Math.pow((r-i)*1e6,1/8);return function(m){let p=m*(u-d)+d;return-Math.pow(p,8)/1e6+r}}return function(a){return W.lerp(n,i,a)}}function i9(e,t){return W.equalsEpsilon(e,W.TWO_PI,W.EPSILON11)&&(e=0),t>e+Math.PI?e+=W.TWO_PI:t<e-Math.PI&&(e-=W.TWO_PI),e}var o2e=new h;function fGt(e,t,n,i,o,r,s,a){let c=e.camera,d=h.clone(c.position,o2e),u=c.pitch,m=i9(c.heading,i),p=i9(c.roll,r),b=koe(c,n,d.z,n.z,s),f=i2e(u,o,b,a);function y(_){let S=_.time/t;c.setView({orientation:{heading:W.lerp(m,i,S),pitch:f(S),roll:W.lerp(p,r,S)}}),k.lerp(d,n,S,c.position),c.position.z=b(S)}return y}function pGt(e,t){e.longitude<t.longitude?e.longitude+=W.TWO_PI:t.longitude+=W.TWO_PI}function bGt(e,t){let n=e.longitude-t.longitude;n<-W.PI?e.longitude+=W.TWO_PI:n>W.PI&&(t.longitude+=W.TWO_PI)}var gGt=new pe,yGt=new pe;function xGt(e,t,n,i,o,r,s,a,c,d){let u=e.camera,p=e.mapProjection.ellipsoid,b=pe.clone(u.positionCartographic,gGt),f=u.pitch,y=i9(u.heading,i),_=i9(u.roll,r),S=p.cartesianToCartographic(n,yGt);b.longitude=W.zeroToTwoPi(b.longitude),S.longitude=W.zeroToTwoPi(S.longitude);let Z=!1;if(l(a)){let A=W.zeroToTwoPi(a),L=Math.min(b.longitude,S.longitude),F=Math.max(b.longitude,S.longitude),I=A>=L&&A<=F;if(l(c)){let N=Math.abs(b.longitude-S.longitude),g=W.TWO_PI-N;(I?N:g)<(I?g:N)*c&&!I&&(Z=!0)}else I||(Z=!0)}Z?pGt(b,S):bGt(b,S);let R=koe(u,n,b.height,S.height,s),C=i2e(f,o,R,d);function E(){let A=b.longitude,L=S.longitude,F=b.latitude,I=S.latitude;return function(g){let V=g.time/t,G=h.fromRadians(W.lerp(A,L,V),W.lerp(F,I,V),R(V),p);u.setView({destination:G,orientation:{heading:W.lerp(y,i,V),pitch:C(V),roll:W.lerp(_,r,V)}})}}return E()}function TGt(e,t,n,i,o,r,s){let a=e.camera,c=h.clone(a.position,o2e),d=i9(a.heading,i),u=a.frustum.right-a.frustum.left,m=koe(a,n,u,n.z,s);function p(b){let f=b.time/t;a.setView({orientation:{heading:W.lerp(d,i,f)}}),k.lerp(c,n,f,a.position);let y=m(f),_=a.frustum,S=_.top/_.right,Z=(y-(_.right-_.left))*.5;_.right+=Z,_.left-=Z,_.top=S*_.right,_.bottom=-_.top}return p}var e2e=new pe,_Gt=new h;function woe(e,t){return{startObject:{},stopObject:{},duration:0,complete:e,cancel:t}}function t2e(e,t){function n(){typeof t=="function"&&t(),e.enableInputs=!0}return n}n2e.createTween=function(e,t){t=t??B.EMPTY_OBJECT;let n=t.destination,i=e.mode;if(i===se.MORPHING)return woe();let o=t.convert??!0,r=e.mapProjection,s=r.ellipsoid,a=t.maximumHeight,c=t.flyOverLongitude,d=t.flyOverLongitudeWeight,u=t.pitchAdjustHeight,m=t.easingFunction;o&&i!==se.SCENE3D&&(s.cartesianToCartographic(n,e2e),n=r.project(e2e,_Gt));let p=e.camera,b=t.endTransform;l(b)&&p._setTransform(b);let f=t.duration;l(f)||(f=Math.ceil(h.distance(p.position,n)/1e6)+2,f=Math.min(f,3));let y=t.heading??0,_=t.pitch??-W.PI_OVER_TWO,S=t.roll??0,Z=e.screenSpaceCameraController;Z.enableInputs=!1;let R=t2e(Z,t.complete),C=t2e(Z,t.cancel),E=p.frustum,A=e.mode===se.SCENE2D;if(A=A&&k.equalsEpsilon(p.position,n,W.EPSILON6),A=A&&W.equalsEpsilon(Math.max(E.right-E.left,E.top-E.bottom),n.z,W.EPSILON6),A=A||e.mode!==se.SCENE2D&&h.equalsEpsilon(n,p.position,W.EPSILON10),A=A&&W.equalsEpsilon(W.negativePiToPi(y),W.negativePiToPi(p.heading),W.EPSILON10)&&W.equalsEpsilon(W.negativePiToPi(_),W.negativePiToPi(p.pitch),W.EPSILON10)&&W.equalsEpsilon(W.negativePiToPi(S),W.negativePiToPi(p.roll),W.EPSILON10),A)return woe(R,C);let L=new Array(4);if(L[se.SCENE2D]=TGt,L[se.SCENE3D]=xGt,L[se.COLUMBUS_VIEW]=fGt,f<=0)return woe(function(){L[i](e,1,n,y,_,S,a,c,d,u)({time:1}),typeof R=="function"&&R()},C);let F=L[i](e,f,n,y,_,S,a,c,d,u);if(!l(m)){let I=p.positionCartographic.height,N=i===se.SCENE3D?s.cartesianToCartographic(n).height:n.z;I>N&&I>11500?m=vs.CUBIC_OUT:m=vs.QUINTIC_IN_OUT}return{duration:f,easingFunction:m,startObject:{time:0},stopObject:{time:f},update:F,complete:R,cancel:C}};var o9=n2e;var Nco=x(T(),1),r2e={ROTATE:0,INFINITE_SCROLL:1};Object.freeze(r2e);var pd=r2e;function ln(e){this._scene=e,this._transform=P.clone(P.IDENTITY),this._invTransform=P.clone(P.IDENTITY),this._actualTransform=P.clone(P.IDENTITY),this._actualInvTransform=P.clone(P.IDENTITY),this._transformChanged=!1,this.position=new h,this._position=new h,this._positionWC=new h,this._positionCartographic=new pe,this._oldPositionWC=void 0,this.positionWCDeltaMagnitude=0,this.positionWCDeltaMagnitudeLastFrame=0,this.timeSinceMoved=0,this._lastMovedTimestamp=0,this.direction=new h,this._direction=new h,this._directionWC=new h,this.up=new h,this._up=new h,this._upWC=new h,this.right=new h,this._right=new h,this._rightWC=new h,this.frustum=new qi,this.frustum.aspectRatio=e.drawingBufferWidth/e.drawingBufferHeight,this.frustum.fov=W.toRadians(60),this.defaultMoveAmount=1e5,this.defaultLookAmount=Math.PI/60,this.defaultRotateAmount=Math.PI/3600,this.defaultZoomAmount=1e5,this.constrainedAxis=void 0,this.maximumZoomFactor=1.5,this._moveStart=new Se,this._moveEnd=new Se,this._changed=new Se,this._changedPosition=void 0,this._changedDirection=void 0,this._changedFrustum=void 0,this._changedHeading=void 0,this._changedRoll=void 0,this.percentageChanged=.5,this._viewMatrix=new P,this._invViewMatrix=new P,b2e(this),this._mode=se.SCENE3D,this._modeChanged=!0;let t=e.mapProjection;this._projection=t,this._maxCoord=t.project(new pe(Math.PI,W.PI_OVER_TWO)),this._max2Dfrustum=void 0,A2e(this,ln.DEFAULT_VIEW_RECTANGLE,this.position,!0);let n=h.magnitude(this.position);n+=n*ln.DEFAULT_VIEW_FACTOR,h.normalize(this.position,this.position),h.multiplyByScalar(this.position,n,this.position)}ln.TRANSFORM_2D=new P(0,0,1,0,1,0,0,0,0,1,0,0,0,0,0,1);ln.TRANSFORM_2D_INVERSE=P.inverseTransformation(ln.TRANSFORM_2D,new P);ln.DEFAULT_VIEW_RECTANGLE=re.fromDegrees(-95,-20,-70,90);ln.DEFAULT_VIEW_FACTOR=.5;ln.DEFAULT_OFFSET=new uh(0,-W.PI_OVER_FOUR,0);function b2e(e){P.computeView(e._position,e._direction,e._up,e._right,e._viewMatrix),P.multiply(e._viewMatrix,e._actualInvTransform,e._viewMatrix),P.inverseTransformation(e._viewMatrix,e._invViewMatrix)}function SGt(e){if(!l(e._oldPositionWC))e._oldPositionWC=h.clone(e.positionWC,e._oldPositionWC);else{e.positionWCDeltaMagnitudeLastFrame=e.positionWCDeltaMagnitude;let t=h.subtract(e.positionWC,e._oldPositionWC,e._oldPositionWC);e.positionWCDeltaMagnitude=h.magnitude(t),e._oldPositionWC=h.clone(e.positionWC,e._oldPositionWC),e.positionWCDeltaMagnitude>0?(e.timeSinceMoved=0,e._lastMovedTimestamp=Zn()):e.timeSinceMoved=Math.max(Zn()-e._lastMovedTimestamp,0)/1e3}}ln.prototype.canPreloadFlight=function(){return l(this._currentFlight)&&this._mode!==se.SCENE2D};ln.prototype._updateCameraChanged=function(){let e=this;if(SGt(e),e._changed.numberOfListeners===0)return;let t=e.percentageChanged,n=e.heading;l(e._changedHeading)||(e._changedHeading=n);let i=Math.abs(e._changedHeading-n)%W.TWO_PI;i=i>W.PI?W.TWO_PI-i:i;let o=i/Math.PI;o>t&&(e._changedHeading=n);let r=e.roll;l(e._changedRoll)||(e._changedRoll=r);let s=Math.abs(e._changedRoll-r)%W.TWO_PI;s=s>W.PI?W.TWO_PI-s:s;let a=s/Math.PI;if(a>t&&(e._changedRoll=r),(a>t||o>t)&&e._changed.raiseEvent(Math.max(a,o)),e._mode===se.SCENE2D){if(!l(e._changedFrustum)){e._changedPosition=h.clone(e.position,e._changedPosition),e._changedFrustum=e.frustum.clone();return}let p=e.position,b=e._changedPosition,f=e.frustum,y=e._changedFrustum,_=p.x+f.left,S=p.x+f.right,Z=b.x+y.left,R=b.x+y.right,C=p.y+f.bottom,E=p.y+f.top,A=b.y+y.bottom,L=b.y+y.top,F=Math.max(_,Z),I=Math.min(S,R),N=Math.max(C,A),g=Math.min(E,L),V;if(F>=I||N>=E)V=1;else{let G=y;_<Z&&S>R&&C<A&&E>L&&(G=f),V=1-(I-F)*(g-N)/((G.right-G.left)*(G.top-G.bottom))}V>t&&(e._changed.raiseEvent(V),e._changedPosition=h.clone(e.position,e._changedPosition),e._changedFrustum=e.frustum.clone(e._changedFrustum));return}if(!l(e._changedDirection)){e._changedPosition=h.clone(e.positionWC,e._changedPosition),e._changedDirection=h.clone(e.directionWC,e._changedDirection);return}let c=W.acosClamped(h.dot(e.directionWC,e._changedDirection)),d;l(e.frustum.fovy)?d=c/(e.frustum.fovy*.5):d=c;let m=h.distance(e.positionWC,e._changedPosition)/e.positionCartographic.height;(d>t||m>t)&&(e._changed.raiseEvent(Math.max(d,m)),e._changedPosition=h.clone(e.positionWC,e._changedPosition),e._changedDirection=h.clone(e.directionWC,e._changedDirection))};function ZGt(e){_t.basisTo2D(e._projection,e._transform,e._actualTransform)}var RGt=new pe,CGt=new h,dK=new h,VGt=new ce,EGt=new ce,AGt=new ce,GGt=new ce,LGt=new ce;function WGt(e){let t=e._projection,n=t.ellipsoid,i=P.getColumn(e._transform,3,VGt),o=n.cartesianToCartographic(i,RGt),r=t.project(o,CGt),s=EGt;s.x=r.z,s.y=r.x,s.z=r.y,s.w=1;let a=ce.clone(ce.UNIT_X,LGt),c=ce.add(P.getColumn(e._transform,0,dK),i,dK);n.cartesianToCartographic(c,o),t.project(o,r);let d=AGt;d.x=r.z,d.y=r.x,d.z=r.y,d.w=0,h.subtract(d,s,d),d.x=0;let u=GGt;if(h.magnitudeSquared(d)>W.EPSILON10)h.cross(a,d,u);else{let m=ce.add(P.getColumn(e._transform,1,dK),i,dK);n.cartesianToCartographic(m,o),t.project(o,r),u.x=r.z,u.y=r.x,u.z=r.y,u.w=0,h.subtract(u,s,u),u.x=0,h.magnitudeSquared(u)<W.EPSILON10&&(ce.clone(ce.UNIT_Y,d),ce.clone(ce.UNIT_Z,u))}h.cross(u,a,d),h.normalize(d,d),h.cross(a,d,u),h.normalize(u,u),P.setColumn(e._actualTransform,0,d,e._actualTransform),P.setColumn(e._actualTransform,1,u,e._actualTransform),P.setColumn(e._actualTransform,2,a,e._actualTransform),P.setColumn(e._actualTransform,3,s,e._actualTransform)}var Uoe=new h;function Zl(e){let t=e._mode,n=!1,i=0;t===se.SCENE2D&&(i=e.frustum.right-e.frustum.left,n=i!==e._positionCartographic.height);let o=e._position,r=!h.equals(o,e.position)||n;r&&(o=h.clone(e.position,e._position));let s=e._direction,a=!h.equals(s,e.direction);a&&(h.normalize(e.direction,e.direction),s=h.clone(e.direction,e._direction));let c=e._up,d=!h.equals(c,e.up);d&&(h.normalize(e.up,e.up),c=h.clone(e.up,e._up));let u=e._right,m=!h.equals(u,e.right);m&&(h.normalize(e.right,e.right),u=h.clone(e.right,e._right));let p=e._transformChanged||e._modeChanged;e._transformChanged=!1,p&&(P.inverseTransformation(e._transform,e._invTransform),e._mode===se.COLUMBUS_VIEW||e._mode===se.SCENE2D?P.equals(P.IDENTITY,e._transform)?P.clone(ln.TRANSFORM_2D,e._actualTransform):e._mode===se.COLUMBUS_VIEW?ZGt(e):WGt(e):P.clone(e._transform,e._actualTransform),P.inverseTransformation(e._actualTransform,e._actualInvTransform),e._modeChanged=!1);let b=e._actualTransform;if(r||p)if(e._positionWC=P.multiplyByPoint(b,o,e._positionWC),t===se.SCENE3D||t===se.MORPHING)e._positionCartographic=e._projection.ellipsoid.cartesianToCartographic(e._positionWC,e._positionCartographic);else{let f=Uoe;f.x=e._positionWC.y,f.y=e._positionWC.z,f.z=e._positionWC.x,t===se.SCENE2D&&(f.z=i),e._projection.unproject(f,e._positionCartographic)}if(a||d||m){let f=h.dot(s,h.cross(c,u,Uoe));if(Math.abs(1-f)>W.EPSILON2){let y=1/h.magnitudeSquared(c),_=h.dot(c,s)*y,S=h.multiplyByScalar(s,_,Uoe);c=h.normalize(h.subtract(c,S,e._up),e._up),h.clone(c,e.up),u=h.cross(s,c,e._right),h.clone(u,e.right)}}(a||p)&&(e._directionWC=P.multiplyByPointAsVector(b,s,e._directionWC),h.normalize(e._directionWC,e._directionWC)),(d||p)&&(e._upWC=P.multiplyByPointAsVector(b,c,e._upWC),h.normalize(e._upWC,e._upWC)),(m||p)&&(e._rightWC=P.multiplyByPointAsVector(b,u,e._rightWC),h.normalize(e._rightWC,e._rightWC)),(r||a||d||m||p)&&b2e(e)}function g2e(e,t){let n;return W.equalsEpsilon(Math.abs(e.z),1,W.EPSILON3)?n=Math.atan2(t.y,t.x)-W.PI_OVER_TWO:n=Math.atan2(e.y,e.x)-W.PI_OVER_TWO,W.TWO_PI-W.zeroToTwoPi(n)}function y2e(e){return W.PI_OVER_TWO-W.acosClamped(e.z)}function x2e(e,t,n){let i=0;return W.equalsEpsilon(Math.abs(e.z),1,W.EPSILON3)||(i=Math.atan2(-n.z,t.z),i=W.zeroToTwoPi(i+W.TWO_PI)),i}var hK=new P,fK=new P;Object.defineProperties(ln.prototype,{transform:{get:function(){return this._transform}},inverseTransform:{get:function(){return Zl(this),this._invTransform}},viewMatrix:{get:function(){return Zl(this),this._viewMatrix}},inverseViewMatrix:{get:function(){return Zl(this),this._invViewMatrix}},positionCartographic:{get:function(){return Zl(this),this._positionCartographic}},positionWC:{get:function(){return Zl(this),this._positionWC}},directionWC:{get:function(){return Zl(this),this._directionWC}},upWC:{get:function(){return Zl(this),this._upWC}},rightWC:{get:function(){return Zl(this),this._rightWC}},heading:{get:function(){if(this._mode!==se.MORPHING){let e=this._projection.ellipsoid,t=P.clone(this._transform,hK),n=_t.eastNorthUpToFixedFrame(this.positionWC,e,fK);this._setTransform(n);let i=g2e(this.direction,this.up);return this._setTransform(t),i}}},pitch:{get:function(){if(this._mode!==se.MORPHING){let e=this._projection.ellipsoid,t=P.clone(this._transform,hK),n=_t.eastNorthUpToFixedFrame(this.positionWC,e,fK);this._setTransform(n);let i=y2e(this.direction);return this._setTransform(t),i}}},roll:{get:function(){if(this._mode!==se.MORPHING){let e=this._projection.ellipsoid,t=P.clone(this._transform,hK),n=_t.eastNorthUpToFixedFrame(this.positionWC,e,fK);this._setTransform(n);let i=x2e(this.direction,this.up,this.right);return this._setTransform(t),i}}},moveStart:{get:function(){return this._moveStart}},moveEnd:{get:function(){return this._moveEnd}},changed:{get:function(){return this._changed}}});ln.prototype.update=function(e){let t=!1;if(e!==this._mode&&(this._mode=e,this._modeChanged=e!==se.MORPHING,t=this._mode===se.SCENE2D),t){let n=this._max2Dfrustum=this.frustum.clone(),i=2,o=n.top/n.right;n.right=this._maxCoord.x*i,n.left=-n.right,n.top=o*n.right,n.bottom=-n.top}this._mode===se.SCENE2D&&Z2e(this,this.position)};var vGt=new h,FGt=new h,IGt=new h;ln.prototype._setTransform=function(e){let t=h.clone(this.positionWC,vGt),n=h.clone(this.upWC,FGt),i=h.clone(this.directionWC,IGt);P.clone(e,this._transform),this._transformChanged=!0,Zl(this);let o=this._actualInvTransform;P.multiplyByPoint(o,t,this.position),P.multiplyByPointAsVector(o,i,this.direction),P.multiplyByPointAsVector(o,n,this.up),h.cross(this.direction,this.up,this.right),Zl(this)};var PGt=new k,XGt=new gn,NGt=new h,YGt=new h;function T2e(e){if(!P.equals(P.IDENTITY,e.transform))return h.magnitude(e.position);let t=e._scene,n=t.globe,i=PGt;i.x=t.drawingBufferWidth/t.pixelRatio/2,i.y=t.drawingBufferHeight/t.pixelRatio/2;let o;if(l(n)){let a=e.getPickRay(i,XGt);o=n.pickWorldCoordinates(a,t,!0,NGt)}let r;t.pickPositionSupported&&(r=t.pickPositionWorldCoordinates(i,YGt));let s;if(l(o)||l(r)){let a=l(r)?h.distance(r,e.positionWC):Number.POSITIVE_INFINITY,c=l(o)?h.distance(o,e.positionWC):Number.POSITIVE_INFINITY;s=Math.min(a,c)}else s=Math.max(e.positionCartographic.height,0);return s}ln.prototype._adjustOrthographicFrustum=function(e){this.frustum instanceof yn&&(!e&&this._positionCartographic.height<15e4||(this.frustum.width=T2e(this)))};var pK=new h,Hoe=new P,MGt=new P,Koe=new Ne,Joe=new q,_2e=new pe;function wGt(e,t,n){let i=P.clone(e.transform,Hoe),o=_t.eastNorthUpToFixedFrame(t,e._projection.ellipsoid,MGt);e._setTransform(o),h.clone(h.ZERO,e.position),n.heading=n.heading-W.PI_OVER_TWO;let r=Ne.fromHeadingPitchRoll(n,Koe),s=q.fromQuaternion(r,Joe);q.getColumn(s,0,e.direction),q.getColumn(s,2,e.up),h.cross(e.direction,e.up,e.right),e._setTransform(i),e._adjustOrthographicFrustum(!0)}function kGt(e,t,n,i){let o=P.clone(e.transform,Hoe);if(e._setTransform(P.IDENTITY),!h.equals(t,e.positionWC)){if(i){let a=e._projection,c=a.ellipsoid.cartesianToCartographic(t,_2e);t=a.project(c,pK)}h.clone(t,e.position)}n.heading=n.heading-W.PI_OVER_TWO;let r=Ne.fromHeadingPitchRoll(n,Koe),s=q.fromQuaternion(r,Joe);q.getColumn(s,0,e.direction),q.getColumn(s,2,e.up),h.cross(e.direction,e.up,e.right),e._setTransform(o),e._adjustOrthographicFrustum(!0)}function UGt(e,t,n,i){let o=P.clone(e.transform,Hoe);if(e._setTransform(P.IDENTITY),!h.equals(t,e.positionWC)){if(i){let c=e._projection,d=c.ellipsoid.cartesianToCartographic(t,_2e);t=c.project(d,pK)}k.clone(t,e.position);let r=-t.z*.5,s=-r,a=e.frustum;if(s>r){let c=a.top/a.right;a.right=s,a.left=r,a.top=a.right*c,a.bottom=-a.top}}if(e._scene.mapMode2D===pd.ROTATE){n.heading=n.heading-W.PI_OVER_TWO,n.pitch=-W.PI_OVER_TWO,n.roll=0;let r=Ne.fromHeadingPitchRoll(n,Koe),s=q.fromQuaternion(r,Joe);q.getColumn(s,2,e.up),h.cross(e.direction,e.up,e.right)}e._setTransform(o)}var DGt=new h,OGt=new h,BGt=new h;function S2e(e,t,n,i){let o=h.clone(n.direction,DGt),r=h.clone(n.up,OGt);if(e._scene.mode===se.SCENE3D){let a=e._projection.ellipsoid,c=_t.eastNorthUpToFixedFrame(t,a,hK),d=P.inverseTransformation(c,fK);P.multiplyByPointAsVector(d,o,o),P.multiplyByPointAsVector(d,r,r)}let s=h.cross(o,r,BGt);return i.heading=g2e(o,r),i.pitch=y2e(o),i.roll=x2e(o,r,s),i}var zoe={destination:void 0,orientation:{direction:void 0,up:void 0,heading:void 0,pitch:void 0,roll:void 0},convert:void 0,endTransform:void 0},iA=new Cc;ln.prototype.setView=function(e){e=e??B.EMPTY_OBJECT;let t=e.orientation??B.EMPTY_OBJECT,n=this._mode;if(n===se.MORPHING)return;l(e.endTransform)&&this._setTransform(e.endTransform);let i=e.convert??!0,o=e.destination??h.clone(this.positionWC,pK);l(o)&&l(o.west)&&(o=this.getRectangleCameraCoordinates(o,pK),i=!1),l(t.direction)&&(t=S2e(this,o,t,zoe.orientation)),iA.heading=t.heading??0,iA.pitch=t.pitch??-W.PI_OVER_TWO,iA.roll=t.roll??0,n===se.SCENE3D?wGt(this,o,iA):n===se.SCENE2D?UGt(this,o,iA,i):kGt(this,o,iA,i)};var zGt=new h;ln.prototype.flyHome=function(e){let t=this._mode;if(t===se.MORPHING&&this._scene.completeMorph(),t===se.SCENE2D)this.flyTo({destination:ln.DEFAULT_VIEW_RECTANGLE,duration:e,endTransform:P.IDENTITY});else if(t===se.SCENE3D){let n=this.getRectangleCameraCoordinates(ln.DEFAULT_VIEW_RECTANGLE),i=h.magnitude(n);i+=i*ln.DEFAULT_VIEW_FACTOR,h.normalize(n,n),h.multiplyByScalar(n,i,n),this.flyTo({destination:n,duration:e,endTransform:P.IDENTITY})}else if(t===se.COLUMBUS_VIEW){let n=this._projection.ellipsoid.maximumRadius,i=new h(0,-1,1);i=h.multiplyByScalar(h.normalize(i,i),5*n,i),this.flyTo({destination:i,duration:e,orientation:{heading:0,pitch:-Math.acos(h.normalize(i,zGt).z),roll:0},endTransform:P.IDENTITY,convert:!1})}};ln.prototype.worldToCameraCoordinates=function(e,t){return l(t)||(t=new ce),Zl(this),P.multiplyByVector(this._actualInvTransform,e,t)};ln.prototype.worldToCameraCoordinatesPoint=function(e,t){return l(t)||(t=new h),Zl(this),P.multiplyByPoint(this._actualInvTransform,e,t)};ln.prototype.worldToCameraCoordinatesVector=function(e,t){return l(t)||(t=new h),Zl(this),P.multiplyByPointAsVector(this._actualInvTransform,e,t)};ln.prototype.cameraToWorldCoordinates=function(e,t){return l(t)||(t=new ce),Zl(this),P.multiplyByVector(this._actualTransform,e,t)};ln.prototype.cameraToWorldCoordinatesPoint=function(e,t){return l(t)||(t=new h),Zl(this),P.multiplyByPoint(this._actualTransform,e,t)};ln.prototype.cameraToWorldCoordinatesVector=function(e,t){return l(t)||(t=new h),Zl(this),P.multiplyByPointAsVector(this._actualTransform,e,t)};function Z2e(e,t){let n=e._scene.mapMode2D===pd.ROTATE,i=e._maxCoord.x,o=e._maxCoord.y,r,s;n?(s=i,r=-s):(s=t.x-i*2,r=t.x+i*2),t.x>i&&(t.x=s),t.x<-i&&(t.x=r),t.y>o&&(t.y=o),t.y<-o&&(t.y=-o)}var s2e=new h;ln.prototype.move=function(e,t){let n=this.position;h.multiplyByScalar(e,t,s2e),h.add(n,s2e,n),this._mode===se.SCENE2D&&Z2e(this,n),this._adjustOrthographicFrustum(!0)};ln.prototype.moveForward=function(e){e=e??this.defaultMoveAmount,this._mode===se.SCENE2D?bK(this,e):this.move(this.direction,e)};ln.prototype.moveBackward=function(e){e=e??this.defaultMoveAmount,this._mode===se.SCENE2D?bK(this,-e):this.move(this.direction,-e)};ln.prototype.moveUp=function(e){e=e??this.defaultMoveAmount,this.move(this.up,e)};ln.prototype.moveDown=function(e){e=e??this.defaultMoveAmount,this.move(this.up,-e)};ln.prototype.moveRight=function(e){e=e??this.defaultMoveAmount,this.move(this.right,e)};ln.prototype.moveLeft=function(e){e=e??this.defaultMoveAmount,this.move(this.right,-e)};ln.prototype.lookLeft=function(e){e=e??this.defaultLookAmount,this._mode!==se.SCENE2D&&this.look(this.up,-e)};ln.prototype.lookRight=function(e){e=e??this.defaultLookAmount,this._mode!==se.SCENE2D&&this.look(this.up,e)};ln.prototype.lookUp=function(e){e=e??this.defaultLookAmount,this._mode!==se.SCENE2D&&this.look(this.right,-e)};ln.prototype.lookDown=function(e){e=e??this.defaultLookAmount,this._mode!==se.SCENE2D&&this.look(this.right,e)};var HGt=new Ne,KGt=new q;ln.prototype.look=function(e,t){let n=t??this.defaultLookAmount,i=Ne.fromAxisAngle(e,-n,HGt),o=q.fromQuaternion(i,KGt),r=this.direction,s=this.up,a=this.right;q.multiplyByVector(o,r,r),q.multiplyByVector(o,s,s),q.multiplyByVector(o,a,a)};ln.prototype.twistLeft=function(e){e=e??this.defaultLookAmount,this.look(this.direction,e)};ln.prototype.twistRight=function(e){e=e??this.defaultLookAmount,this.look(this.direction,-e)};var JGt=new Ne,jGt=new q;ln.prototype.rotate=function(e,t){let n=t??this.defaultRotateAmount,i=Ne.fromAxisAngle(e,-n,JGt),o=q.fromQuaternion(i,jGt);q.multiplyByVector(o,this.position,this.position),q.multiplyByVector(o,this.direction,this.direction),q.multiplyByVector(o,this.up,this.up),h.cross(this.direction,this.up,this.right),h.cross(this.right,this.direction,this.up),this._adjustOrthographicFrustum(!1)};ln.prototype.rotateDown=function(e){e=e??this.defaultRotateAmount,R2e(this,e)};ln.prototype.rotateUp=function(e){e=e??this.defaultRotateAmount,R2e(this,-e)};var QGt=new h,qGt=new h,$Gt=new h,a2e=new h;function R2e(e,t){let n=e.position;if(l(e.constrainedAxis)&&!h.equalsEpsilon(e.position,h.ZERO,W.EPSILON2)){let i=h.normalize(n,QGt),o=h.equalsEpsilon(i,e.constrainedAxis,W.EPSILON2),r=h.equalsEpsilon(i,h.negate(e.constrainedAxis,a2e),W.EPSILON2);if(!o&&!r){let s=h.normalize(e.constrainedAxis,qGt),a=h.dot(i,s),c=W.acosClamped(a);t>0&&t>c&&(t=c-W.EPSILON4),a=h.dot(i,h.negate(s,a2e)),c=W.acosClamped(a),t<0&&-t>c&&(t=-c+W.EPSILON4);let d=h.cross(s,i,$Gt);e.rotate(d,t)}else(o&&t<0||r&&t>0)&&e.rotate(e.right,t)}else e.rotate(e.right,t)}ln.prototype.rotateRight=function(e){e=e??this.defaultRotateAmount,C2e(this,-e)};ln.prototype.rotateLeft=function(e){e=e??this.defaultRotateAmount,C2e(this,e)};function C2e(e,t){l(e.constrainedAxis)?e.rotate(e.constrainedAxis,t):e.rotate(e.up,t)}function bK(e,t){let n=e.frustum,i;if(t=t*.5,Math.abs(n.top)+Math.abs(n.bottom)>Math.abs(n.left)+Math.abs(n.right)){let o=n.top-t,r=n.bottom+t,s=e._maxCoord.y;e._scene.mapMode2D===pd.ROTATE&&(s*=e.maximumZoomFactor),r>s&&(r=s,o=-s),o<=r&&(o=1,r=-1),i=n.right/n.top,n.top=o,n.bottom=r,n.right=n.top*i,n.left=-n.right}else{let o=n.right-t,r=n.left+t,s=e._maxCoord.x;e._scene.mapMode2D===pd.ROTATE&&(s*=e.maximumZoomFactor),o>s&&(o=s,r=-s),o<=r&&(o=1,r=-1),i=n.top/n.right,n.right=o,n.left=r,n.top=n.right*i,n.bottom=-n.top}}function V2e(e,t){e.move(e.direction,t)}ln.prototype.zoomIn=function(e){e=e??this.defaultZoomAmount,this._mode===se.SCENE2D?bK(this,e):V2e(this,e)};ln.prototype.zoomOut=function(e){e=e??this.defaultZoomAmount,this._mode===se.SCENE2D?bK(this,-e):V2e(this,-e)};ln.prototype.getMagnitude=function(){if(this._mode===se.SCENE3D)return h.magnitude(this.position);if(this._mode===se.COLUMBUS_VIEW)return Math.abs(this.position.z);if(this._mode===se.SCENE2D)return Math.max(this.frustum.right-this.frustum.left,this.frustum.top-this.frustum.bottom)};var eLt=new P;ln.prototype.lookAt=function(e,t){let i=this._scene.ellipsoid??ne.default,o=_t.eastNorthUpToFixedFrame(e,i,eLt);this.lookAtTransform(o,t)};var tLt=new h,nLt=new Ne,iLt=new Ne,oLt=new q;function E2e(e,t,n,i){t=W.clamp(t,-W.PI_OVER_TWO,W.PI_OVER_TWO),e=W.zeroToTwoPi(e)-W.PI_OVER_TWO;let o=Ne.fromAxisAngle(h.UNIT_Y,-t,nLt),r=Ne.fromAxisAngle(h.UNIT_Z,-e,iLt),s=Ne.multiply(r,o,r),a=q.fromQuaternion(s,oLt),c=h.clone(h.UNIT_X,i);return q.multiplyByVector(a,c,c),h.negate(c,c),h.multiplyByScalar(c,n,c),c}ln.prototype.lookAtTransform=function(e,t){if(this._setTransform(e),!l(t))return;let n;if(l(t.heading)?n=E2e(t.heading,t.pitch,t.range,tLt):n=t,this._mode===se.SCENE2D){k.clone(k.ZERO,this.position),h.negate(n,this.up),this.up.z=0,h.magnitudeSquared(this.up)<W.EPSILON10&&h.clone(h.UNIT_Y,this.up),h.normalize(this.up,this.up),this._setTransform(P.IDENTITY),h.negate(h.UNIT_Z,this.direction),h.cross(this.direction,this.up,this.right),h.normalize(this.right,this.right);let i=this.frustum,o=i.top/i.right;i.right=h.magnitude(n)*.5,i.left=-i.right,i.top=o*i.right,i.bottom=-i.top,this._setTransform(e);return}h.clone(n,this.position),h.negate(this.position,this.direction),h.normalize(this.direction,this.direction),h.cross(this.direction,h.UNIT_Z,this.right),h.magnitudeSquared(this.right)<W.EPSILON10&&h.clone(h.UNIT_X,this.right),h.normalize(this.right,this.right),h.cross(this.right,this.direction,this.up),h.normalize(this.up,this.up),this._adjustOrthographicFrustum(!0)};var rLt=new P,c2e=new h,sLt=new h,l2e=new h;ln.prototype.lookAtWorldPosition=function(e,t=ne.default){let n=P.clone(this._transform,rLt);this._setTransform(P.IDENTITY);let i=h.subtract(e,this.positionWC,c2e);h.magnitudeSquared(i)<W.EPSILON8&&(i=h.clone(this.directionWC,c2e)),i=h.normalize(i,this.direction);let o=t.geodeticSurfaceNormal(e,sLt),r=h.cross(i,o,l2e);h.magnitudeSquared(r)<W.EPSILON8&&(r=h.clone(this.rightWC,l2e)),h.normalize(r,this.right);let s=h.cross(r,i,this.up);h.normalize(s,this.up),this._setTransform(n)};var r9=new pe,aLt=new pe,cLt=new h,lLt=new h,dLt=new h,uLt=new h,mLt=new h,hLt=new h,fLt=new h,Doe=new h,pLt={direction:new h,right:new h,up:new h},d2e;function Sl(e,t,n,i){return Math.abs(h.dot(t,n))/i-h.dot(e,n)}function A2e(e,t,n,i){let o=e._projection.ellipsoid,r=i?e:pLt,{north:s,south:a,west:c}=t,{east:d}=t;c>d&&(d+=W.TWO_PI);let u=(c+d)*.5,m;if(a<-W.PI_OVER_TWO+W.RADIANS_PER_DEGREE&&s>W.PI_OVER_TWO-W.RADIANS_PER_DEGREE)m=0;else{let I=r9;I.longitude=u,I.latitude=s,I.height=0;let N=aLt;N.longitude=u,N.latitude=a,N.height=0;let g=d2e;(!l(g)||g.ellipsoid!==o)&&(d2e=g=new gb(void 0,void 0,o)),g.setEndPoints(I,N),m=g.interpolateUsingFraction(.5,r9).latitude}let p=r9;p.longitude=u,p.latitude=m,p.height=0;let b=o.cartographicToCartesian(p,fLt),f=r9;f.longitude=d,f.latitude=s;let y=o.cartographicToCartesian(f,cLt);f.longitude=c;let _=o.cartographicToCartesian(f,dLt);f.longitude=u;let S=o.cartographicToCartesian(f,mLt);f.latitude=a;let Z=o.cartographicToCartesian(f,hLt);f.longitude=d;let R=o.cartographicToCartesian(f,uLt);f.longitude=c;let C=o.cartographicToCartesian(f,lLt);h.subtract(_,b,_),h.subtract(R,b,R),h.subtract(y,b,y),h.subtract(C,b,C),h.subtract(S,b,S),h.subtract(Z,b,Z);let E=o.geodeticSurfaceNormal(b,r.direction);h.negate(E,E);let A=h.cross(E,h.UNIT_Z,r.right);h.normalize(A,A);let L=h.cross(A,E,r.up),F;if(e.frustum instanceof yn){let I=Math.max(h.distance(y,_),h.distance(R,C)),N=Math.max(h.distance(y,R),h.distance(_,C)),g,V,G=e.frustum._offCenterFrustum,v=G.right/G.top,X=N*v;I>X?(g=I,V=g/v):(V=N,g=X),F=Math.max(g,V)}else{let I=Math.tan(e.frustum.fovy*.5),N=e.frustum.aspectRatio*I;if(F=Math.max(Sl(E,L,_,I),Sl(E,L,R,I),Sl(E,L,y,I),Sl(E,L,C,I),Sl(E,L,S,I),Sl(E,L,Z,I),Sl(E,A,_,N),Sl(E,A,R,N),Sl(E,A,y,N),Sl(E,A,C,N),Sl(E,A,S,N),Sl(E,A,Z,N)),a<0&&s>0){let g=r9;g.longitude=c,g.latitude=0,g.height=0;let V=o.cartographicToCartesian(g,Doe);h.subtract(V,b,V),F=Math.max(F,Sl(E,L,V,I),Sl(E,A,V,N)),g.longitude=d,V=o.cartographicToCartesian(g,Doe),h.subtract(V,b,V),F=Math.max(F,Sl(E,L,V,I),Sl(E,A,V,N))}}return h.add(b,h.multiplyByScalar(E,-F,Doe),n)}var bLt=new pe,gLt=new h,yLt=new h;function xLt(e,t,n){let i=e._projection;t.west>t.east&&(t=re.MAX_VALUE);let o=e._actualTransform,r=e._actualInvTransform,s=bLt;s.longitude=t.east,s.latitude=t.north;let a=i.project(s,gLt);P.multiplyByPoint(o,a,a),P.multiplyByPoint(r,a,a),s.longitude=t.west,s.latitude=t.south;let c=i.project(s,yLt);if(P.multiplyByPoint(o,c,c),P.multiplyByPoint(r,c,c),n.x=(a.x-c.x)*.5+c.x,n.y=(a.y-c.y)*.5+c.y,l(e.frustum.fovy)){let d=Math.tan(e.frustum.fovy*.5),u=e.frustum.aspectRatio*d;n.z=Math.max((a.x-c.x)/u,(a.y-c.y)/d)*.5}else{let d=a.x-c.x,u=a.y-c.y;n.z=Math.max(d,u)}return n}var TLt=new pe,_Lt=new h,SLt=new h;function ZLt(e,t,n){let i=e._projection,o=t.east;t.west>t.east&&(e._scene.mapMode2D===pd.INFINITE_SCROLL?o+=W.TWO_PI:(t=re.MAX_VALUE,o=t.east));let r=TLt;r.longitude=o,r.latitude=t.north;let s=i.project(r,_Lt);r.longitude=t.west,r.latitude=t.south;let a=i.project(r,SLt),c=Math.abs(s.x-a.x)*.5,d=Math.abs(s.y-a.y)*.5,u,m,p=e.frustum.right/e.frustum.top,b=d*p;return c>b?(u=c,m=u/p):(m=d,u=b),d=Math.max(2*u,2*m),n.x=(s.x-a.x)*.5+a.x,n.y=(s.y-a.y)*.5+a.y,r=i.unproject(n,r),r.height=d,n=i.project(r,n),n}ln.prototype.getRectangleCameraCoordinates=function(e,t){let n=this._mode;if(l(t)||(t=new h),n===se.SCENE3D)return A2e(this,e,t);if(n===se.COLUMBUS_VIEW)return xLt(this,e,t);if(n===se.SCENE2D)return ZLt(this,e,t)};var RLt=new gn;function CLt(e,t,n,i){n=n??ne.default;let o=e.getPickRay(t,RLt),r=xi.rayEllipsoid(o,n);if(!r)return;let s=r.start>0?r.start:r.stop;return gn.getPoint(o,s,i)}var VLt=new gn;function ELt(e,t,n,i){let r=e.getPickRay(t,VLt).origin;r=h.fromElements(r.y,r.z,0,r);let s=n.unproject(r);if(!(s.latitude<-W.PI_OVER_TWO||s.latitude>W.PI_OVER_TWO))return n.ellipsoid.cartographicToCartesian(s,i)}var ALt=new gn;function GLt(e,t,n,i){let o=e.getPickRay(t,ALt),r=-o.origin.x/o.direction.x;gn.getPoint(o,r,i);let s=n.unproject(new h(i.y,i.z,0));if(!(s.latitude<-W.PI_OVER_TWO||s.latitude>W.PI_OVER_TWO||s.longitude<-Math.PI||s.longitude>Math.PI))return n.ellipsoid.cartographicToCartesian(s,i)}ln.prototype.pickEllipsoid=function(e,t,n){let i=this._scene.canvas;if(!(i.clientWidth===0||i.clientHeight===0)){if(l(n)||(n=new h),t=t??ne.default,this._mode===se.SCENE3D)n=CLt(this,e,t,n);else if(this._mode===se.SCENE2D)n=ELt(this,e,this._projection,n);else if(this._mode===se.COLUMBUS_VIEW)n=GLt(this,e,this._projection,n);else return;return n}};var LLt=new h,WLt=new h,vLt=new h;function FLt(e,t,n){let i=e._scene.canvas,o=i.clientWidth,r=i.clientHeight,s=Math.tan(e.frustum.fovy*.5),a=e.frustum.aspectRatio*s,c=e.frustum.near,d=2/o*t.x-1,u=2/r*(r-t.y)-1,m=e.positionWC;h.clone(m,n.origin);let p=h.multiplyByScalar(e.directionWC,c,LLt);h.add(m,p,p);let b=h.multiplyByScalar(e.rightWC,d*c*a,WLt),f=h.multiplyByScalar(e.upWC,u*c*s,vLt),y=h.add(p,b,n.direction);return h.add(y,f,y),h.subtract(y,m,y),h.normalize(y,y),n}var uK=new h;function ILt(e,t,n){let i=e._scene.canvas,o=i.clientWidth,r=i.clientHeight,s=e.frustum,a=s.offCenterFrustum;l(a)&&(s=a);let c=2/o*t.x-1;c*=(s.right-s.left)*.5;let d=2/r*(r-t.y)-1;d*=(s.top-s.bottom)*.5;let u=n.origin;if(h.clone(e.positionWC,u),h.multiplyByScalar(e.rightWC,c,uK),h.add(uK,u,u),h.multiplyByScalar(e.upWC,d,uK),h.add(uK,u,u),h.clone(e.directionWC,n.direction),e._mode===se.SCENE2D&&e._scene.mapMode2D===pd.INFINITE_SCROLL){let m=e._maxCoord.x;u.y=W.mod(u.y+m,2*m)-m}return n}ln.prototype.getPickRay=function(e,t){l(t)||(t=new gn);let n=this._scene.canvas;if(n.clientWidth<=0||n.clientHeight<=0)return;let i=this.frustum;return l(i.aspectRatio)&&l(i.fov)&&l(i.near)?FLt(this,e,t):ILt(this,e,t)};var PLt=new h,XLt=new h;ln.prototype.distanceToBoundingSphere=function(e){let t=h.subtract(this.positionWC,e.center,PLt),n=h.multiplyByScalar(this.directionWC,h.dot(t,this.directionWC),XLt);return Math.max(0,h.magnitude(n)-e.radius)};var NLt=new k;ln.prototype.getPixelSize=function(e,t,n){let i=this.distanceToBoundingSphere(e),o=this.frustum.getPixelDimensions(t,n,i,this._scene.pixelRatio,NLt);return Math.max(o.x,o.y)};function YLt(e,t,n,i,o,r){let s=h.clone(t);n.y>i?s.y-=n.y-i:n.y<-i&&(s.y+=-i-n.y),n.z>o?s.z-=n.z-o:n.z<-o&&(s.z+=-o-n.z);function a(c){let d=h.lerp(t,s,c.time,new h);e.worldToCameraCoordinatesPoint(d,e.position)}return{easingFunction:vs.EXPONENTIAL_OUT,startObject:{time:0},stopObject:{time:1},duration:r,update:a}}var MLt=new h,u2e=new h,wLt=new h,kLt=new h;function ULt(e,t){let n=e.position,i=e.direction,o=e.worldToCameraCoordinatesVector(h.UNIT_X,MLt),r=-h.dot(o,n)/h.dot(o,i),s=h.add(n,h.multiplyByScalar(i,r,u2e),u2e);e.cameraToWorldCoordinatesPoint(s,s),n=e.cameraToWorldCoordinatesPoint(e.position,wLt);let a=Math.tan(e.frustum.fovy*.5),c=e.frustum.aspectRatio*a,d=h.magnitude(h.subtract(n,s,kLt)),u=c*d,m=a*d,p=e._maxCoord.x,b=e._maxCoord.y,f=Math.max(u-p,p),y=Math.max(m-b,b);if(n.z<-f||n.z>f||n.y<-y||n.y>y){let _=s.y<-f||s.y>f,S=s.z<-y||s.z>y;if(_||S)return YLt(e,n,s,f,y,t)}}ln.prototype.createCorrectPositionTween=function(e){if(this._mode===se.COLUMBUS_VIEW)return ULt(this,e)};var DLt=new h,ja={destination:void 0,heading:void 0,pitch:void 0,roll:void 0,duration:void 0,complete:void 0,cancel:void 0,endTransform:void 0,maximumHeight:void 0,easingFunction:void 0};ln.prototype.cancelFlight=function(){l(this._currentFlight)&&(this._currentFlight.cancelTween(),this._currentFlight=void 0)};ln.prototype.completeFlight=function(){if(l(this._currentFlight)){this._currentFlight.cancelTween();let e={destination:void 0,orientation:{heading:void 0,pitch:void 0,roll:void 0}};e.destination=ja.destination,e.orientation.heading=ja.heading,e.orientation.pitch=ja.pitch,e.orientation.roll=ja.roll,this.setView(e),l(this._currentFlight.complete)&&this._currentFlight.complete(),this._currentFlight=void 0}};ln.prototype.flyTo=function(e){e=e??B.EMPTY_OBJECT;let t=e.destination;if(this._mode===se.MORPHING)return;this.cancelFlight();let i=t instanceof re;i&&(t=this.getRectangleCameraCoordinates(t,DLt));let o=e.orientation??B.EMPTY_OBJECT;if(l(o.direction)&&(o=S2e(this,t,o,zoe.orientation)),l(e.duration)&&e.duration<=0){let u=zoe;u.destination=e.destination,u.orientation.heading=o.heading,u.orientation.pitch=o.pitch,u.orientation.roll=o.roll,u.convert=e.convert,u.endTransform=e.endTransform,this.setView(u),typeof e.complete=="function"&&e.complete();return}let r=this,s;ja.destination=t,ja.heading=o.heading,ja.pitch=o.pitch,ja.roll=o.roll,ja.duration=e.duration,ja.complete=function(){s===r._currentFlight&&(r._currentFlight=void 0),l(e.complete)&&e.complete()},ja.cancel=e.cancel,ja.endTransform=e.endTransform,ja.convert=i?!1:e.convert,ja.maximumHeight=e.maximumHeight,ja.pitchAdjustHeight=e.pitchAdjustHeight,ja.flyOverLongitude=e.flyOverLongitude,ja.flyOverLongitudeWeight=e.flyOverLongitudeWeight,ja.easingFunction=e.easingFunction;let a=this._scene,c=o9.createTween(a,ja);if(c.duration===0){typeof c.complete=="function"&&c.complete();return}s=a.tweens.add(c),this._currentFlight=s;let d=this._scene.preloadFlightCamera;this._mode!==se.SCENE2D&&(l(d)||(d=ln.clone(this)),d.setView({destination:t,orientation:o}),this._scene.preloadFlightCullingVolume=d.frustum.computeCullingVolume(d.positionWC,d.directionWC,d.upWC))};function OLt(e,t){let n=e.frustum,i=Math.tan(n.fovy*.5),o=n.aspectRatio*i;return Math.max(t/o,t/i)}function BLt(e,t){let n=e.frustum,i=n.offCenterFrustum;l(i)&&(n=i);let o,r,s=n.right/n.top,a=t*s;return t>a?(o=t,r=o/s):(r=t,o=a),Math.max(o,r)*1.5}var zLt=100;function G2e(e,t,n){n=uh.clone(l(n)?n:ln.DEFAULT_OFFSET);let i=e._scene.screenSpaceCameraController.minimumZoomDistance,o=e._scene.screenSpaceCameraController.maximumZoomDistance,r=n.range;if(!l(r)||r===0){let s=t.radius;s===0?n.range=zLt:e.frustum instanceof yn||e._mode===se.SCENE2D?n.range=BLt(e,s):n.range=OLt(e,s),n.range=W.clamp(n.range,i,o)}return n}ln.prototype.viewBoundingSphere=function(e,t){t=G2e(this,e,t),this.lookAt(e.center,t)};var HLt=new P,m2e=new h,KLt=new h,JLt=new h,jLt=new h,QLt=new ce,qLt=new Ne,$Lt=new q;ln.prototype.flyToBoundingSphere=function(e,t){t=t??B.EMPTY_OBJECT;let n=this._mode===se.SCENE2D||this._mode===se.COLUMBUS_VIEW;this._setTransform(P.IDENTITY);let i=G2e(this,e,t.offset),o;n?o=h.multiplyByScalar(h.UNIT_Z,i.range,m2e):o=E2e(i.heading,i.pitch,i.range,m2e);let s=this._scene.ellipsoid??ne.default,a=_t.eastNorthUpToFixedFrame(e.center,s,HLt);P.multiplyByPoint(a,o,o);let c,d;if(!n){if(c=h.subtract(e.center,o,KLt),h.normalize(c,c),d=P.multiplyByPointAsVector(a,h.UNIT_Z,JLt),1-Math.abs(h.dot(c,d))<W.EPSILON6){let m=Ne.fromAxisAngle(c,i.heading,qLt),p=q.fromQuaternion(m,$Lt);h.fromCartesian4(P.getColumn(a,1,QLt),d),q.multiplyByVector(p,d,d)}let u=h.cross(c,d,jLt);h.cross(u,c,d),h.normalize(d,d)}this.flyTo({destination:o,orientation:{direction:c,up:d},duration:t.duration,complete:t.complete,cancel:t.cancel,endTransform:t.endTransform,maximumHeight:t.maximumHeight,easingFunction:t.easingFunction,flyOverLongitude:t.flyOverLongitude,flyOverLongitudeWeight:t.flyOverLongitudeWeight,pitchAdjustHeight:t.pitchAdjustHeight})};var h2e=new h,f2e=new h,Ooe=new h,p2e=new h,s9=[new h,new h,new h,new h];function eWt(e,t){let n=t.radii,i=e.positionWC,o=h.multiplyComponents(t.oneOverRadii,i,h2e),r=h.magnitude(o),s=h.normalize(o,f2e),a,c;h.equalsEpsilon(s,h.UNIT_Z,W.EPSILON10)?(a=new h(0,1,0),c=new h(0,0,1)):(a=h.normalize(h.cross(h.UNIT_Z,s,Ooe),Ooe),c=h.normalize(h.cross(s,a,p2e),p2e));let d=Math.sqrt(h.magnitudeSquared(o)-1),u=h.multiplyByScalar(s,1/r,h2e),m=d/r,p=h.multiplyByScalar(a,m,f2e),b=h.multiplyByScalar(c,m,Ooe),f=h.add(u,b,s9[0]);h.subtract(f,p,f),h.multiplyComponents(n,f,f);let y=h.subtract(u,b,s9[1]);h.subtract(y,p,y),h.multiplyComponents(n,y,y);let _=h.subtract(u,b,s9[2]);h.add(_,p,_),h.multiplyComponents(n,_,_);let S=h.add(u,b,s9[3]);return h.add(S,p,S),h.multiplyComponents(n,S,S),s9}var Boe=new k,tWt=new h,_T=[new pe,new pe,new pe,new pe];function mK(e,t,n,i,o,r){Boe.x=e,Boe.y=t;let s=i.pickEllipsoid(Boe,o,tWt);return l(s)?(_T[n]=o.cartesianToCartographic(s,_T[n]),1):(_T[n]=o.cartesianToCartographic(r[n],_T[n]),0)}ln.prototype.computeViewRectangle=function(e,t){e=e??ne.default;let n=this.frustum.computeCullingVolume(this.positionWC,this.directionWC,this.upWC),i=new me(h.ZERO,e.maximumRadius);if(n.computeVisibility(i)===qt.OUTSIDE)return;let r=this._scene.canvas,s=r.clientWidth,a=r.clientHeight,c=0,d=eWt(this,e);if(c+=mK(0,0,0,this,e,d),c+=mK(0,a,1,this,e,d),c+=mK(s,a,2,this,e,d),c+=mK(s,0,3,this,e,d),c<2)return re.MAX_VALUE;t=re.fromCartographicArray(_T,t);let u=0,m=_T[3].longitude;for(let p=0;p<4;++p){let b=_T[p].longitude,f=Math.abs(b-m);f>W.PI?u+=W.TWO_PI-f:u+=f,m=b}return W.equalsEpsilon(Math.abs(u),W.TWO_PI,W.EPSILON9)&&(t.west=-W.PI,t.east=W.PI,_T[0].latitude>=0?t.north=W.PI_OVER_TWO:t.south=-W.PI_OVER_TWO),t};ln.prototype.switchToPerspectiveFrustum=function(){if(this._mode===se.SCENE2D||this.frustum instanceof qi)return;let e=this._scene;this.frustum=new qi,this.frustum.aspectRatio=e.drawingBufferWidth/e.drawingBufferHeight,this.frustum.fov=W.toRadians(60)};ln.prototype.switchToOrthographicFrustum=function(){if(this._mode===se.SCENE2D||this.frustum instanceof yn)return;let e=T2e(this),t=this._scene;this.frustum=new yn,this.frustum.aspectRatio=t.drawingBufferWidth/t.drawingBufferHeight,this.frustum.width=e};ln.clone=function(e,t){return l(t)||(t=new ln(e._scene)),h.clone(e.position,t.position),h.clone(e.direction,t.direction),h.clone(e.up,t.up),h.clone(e.right,t.right),P.clone(e._transform,t.transform),t._transformChanged=!0,t.frustum=e.frustum.clone(),t};var Io=ln;var plo=x(T(),1);function nWt(e){this.pass=e.pass,this.commandList=e.commandList,this.camera=e.camera,this.cullingVolume=e.cullingVolume,this.ready=!1}var _h=nWt;var glo=x(T(),1),joe=class{constructor(){this._controllers=[],this._needsUpdate=new Set}get controllerCount(){return this._controllers.length}registerController(t,n,i){let o=i??this.controllerCount;this._controllers.splice(o,0,t),this._needsUpdate.add(t),t.connectedCallback(n)}unregisterController(t,n){let i=this._controllers,o=i.indexOf(t);o!==-1&&(i.splice(o,1),t.disconnectedCallback(n))}update(t,n){for(let i of this._controllers)i.enabled&&(this._needsUpdate.has(i)&&(i.firstUpdate(t,n),this._needsUpdate.delete(i)),i.update(t,n))}},a9=joe;var Rlo=x(T(),1);var P2e=x(gu(),1),L2e=576,iWt=100,c9="#ffffff",l9="#48b";function X2e(e,t){this.credit=e,this.count=t??1}function oWt(e,t){let n=e.length;for(let i=0;i<n;i++){let o=e[i];if(Lt.equals(o,t))return!0}return!1}function rWt(e){let t=e._previousCesiumCredit,n=e._currentCesiumCredit;Lt.equals(n,t)||(l(t)&&e._cesiumCreditContainer.removeChild(t.element),l(n)&&e._cesiumCreditContainer.appendChild(n.element),e._previousCesiumCredit=n)}var N2e="cesium-credit-delimiter";function W2e(e){let t=document.createElement("span");return t.textContent=e,t.className=N2e,t}function v2e(e,t){if(l(t)){let n=document.createElement(t);n._creditId=e._creditId,n.appendChild(e),e=n}return e}function F2e(e,t,n,i){let o=e.childNodes,r=-1;t.sort(function(s,a){return a.count-s.count});for(let s=0;s<t.length;++s){let a=t[s].credit;if(l(a)){if(r=s,l(n)&&(r*=2,s>0)){let d=r-1;if(o.length<=d)e.appendChild(W2e(n));else{let u=o[d];u.className!==N2e&&e.replaceChild(W2e(n),u)}}let c=a.element;if(o.length<=r)e.appendChild(v2e(c,i));else{let d=o[r];d._creditId!==a._id&&e.replaceChild(v2e(c,i),d)}}}for(++r;r<o.length;)e.removeChild(o[r])}function sWt(e){let t=e._lightboxCredits,n=e.viewport.clientWidth,i=e.viewport.clientHeight;n!==e._lastViewportWidth&&(n<L2e?(t.className="cesium-credit-lightbox cesium-credit-lightbox-mobile",t.style.marginTop="0"):(t.className="cesium-credit-lightbox cesium-credit-lightbox-expanded",t.style.marginTop=`${Math.floor((i-t.clientHeight)*.5)}px`),e._lastViewportWidth=n),n>=L2e&&i!==e._lastViewportHeight&&(t.style.marginTop=`${Math.floor((i-t.clientHeight)*.5)}px`,e._lastViewportHeight=i)}function I2e(e){return function(t){t.key!=="Enter"&&t.key!==" "||(t.preventDefault(),t.stopPropagation(),e())}}function aWt(e){let t=` + }`,ut.sources.push(bt),zt.sources.push(GTt(je)),zt.sources.push(LTt(A));let ht=tn.fromCache({context:n.context,vertexShaderSource:zt,fragmentShaderSource:ut,attributeLocations:ye.getAttributeLocations()});ct=Et[qe]=new $ee(o,qe,this.material,ht,We,Ke)}return i.surfaceShader=ct,ct.shaderProgram}destroy(){let t,n,i=this._shadersByTexturesFlags;for(let o in i)if(i.hasOwnProperty(o)){let r=i[o];if(!l(r))continue;for(t in r)r.hasOwnProperty(t)&&(n=r[t],l(n)&&n.shaderProgram.destroy())}return ue(this)}};function GTt(e){let t="vec4 getPosition(vec3 position, float height, vec2 textureCoordinates) { return getPosition3DMode(position, height, textureCoordinates); }",n="vec4 getPosition(vec3 position, float height, vec2 textureCoordinates) { return getPositionColumbusViewMode(position, height, textureCoordinates); }",i="vec4 getPosition(vec3 position, float height, vec2 textureCoordinates) { return getPositionMorphingMode(position, height, textureCoordinates); }",o;switch(e){case se.SCENE3D:o=t;break;case se.SCENE2D:case se.COLUMBUS_VIEW:o=n;break;case se.MORPHING:o=i;break}return o}function LTt(e){return e?"float get2DYPositionFraction(vec2 textureCoordinates) { return get2DMercatorYPositionFraction(textureCoordinates); }":"float get2DYPositionFraction(vec2 textureCoordinates) { return get2DGeographicYPositionFraction(textureCoordinates); }"}var CM=ete;var pKi=x(T(),1);var dzi=x(T(),1),mVe={NONE:-1,PARTIAL:0,FULL:1};Object.freeze(mVe);var Kr=mVe;var kzi=x(T(),1);var mzi=x(T(),1),hVe={START:0,LOADING:1,DONE:2,FAILED:3};Object.freeze(hVe);var Ja=hVe;var fzi=x(T(),1),fVe={FAILED:0,UNLOADED:1,RECEIVING:2,RECEIVED:3,TRANSFORMING:4,TRANSFORMED:5,READY:6};Object.freeze(fVe);var wo=fVe;var f0=class e{constructor(){mt(this,"request");this.imagery=[],this.waterMaskTexture=void 0,this.waterMaskTranslationAndScale=new ce(0,0,1,1),this.terrainData=void 0,this.vectorData=void 0,this.clippingPolygonData=void 0,this.vertexArray=void 0,this.tileBoundingRegion=void 0,this.occludeePointInScaledSpace=new h,this.boundingVolumeSourceTile=void 0,this.boundingVolumeIsFromMesh=!1,this.terrainState=wo.UNLOADED,this.mesh=void 0,this.fill=void 0,this.pickBoundingSphere=new me,this.surfaceShader=void 0,this.isClipped=!0,this.clippedByBoundaries=!1}get eligibleForUnloading(){let t=this.terrainState,i=!(t===wo.RECEIVING||t===wo.TRANSFORMING),o=this.imagery;for(let r=0,s=o.length;i&&r<s;++r){let a=o[r];i=!l(a.loadingImagery)||a.loadingImagery.state!==Dn.TRANSITIONING}return i}get renderedMesh(){if(l(this.vertexArray))return this.mesh;if(l(this.fill))return this.fill.mesh}pick(t,n,i,o,r){if(!l(this.renderedMesh))return;let s=this.renderedMesh.pick(t,o,n,i);return h.clone(s,r)}freeResources(){l(this.waterMaskTexture)&&(--this.waterMaskTexture.referenceCount,this.waterMaskTexture.referenceCount===0&&this.waterMaskTexture.destroy(),this.waterMaskTexture=void 0),l(this.vectorData)&&(Ss.freeResources(this.vectorData),this.vectorData=void 0),l(this.clippingPolygonData)&&(vc.releaseRectangleData(this.clippingPolygonData),this.clippingPolygonData=void 0),this.terrainData=void 0,this.terrainState=wo.UNLOADED,this.mesh=void 0,this.fill=this.fill&&this.fill.destroy();let t=this.imagery;for(let n=0,i=t.length;n<i;++n)t[n].freeResources();this.imagery.length=0,this.freeVertexArray()}freeVertexArray(){e._freeVertexArray(this.vertexArray),this.vertexArray=void 0,e._freeVertexArray(this.wireframeVertexArray),this.wireframeVertexArray=void 0}static initialize(t,n,i,o){l(t.data)||(t.data=new e),t.state===Ja.START&&(WTt(t,n,i,o),t.state=Ja.LOADING)}static processStateMachine(t,n,i,o,r,s,a,c){e.initialize(t,i,o,r);let d=t.data;if(t.state===Ja.LOADING&&vTt(t,n,i,o,r,s,a),c)return;let u=t.renderable;t.renderable=l(d.vertexArray);let m=d.terrainState===wo.READY;t.upsampledFromParent=l(d.terrainData)&&d.terrainData.wasCreatedByUpsampling();let p=d.processImagery(t,i,n);if(m&&p){let b=t._loadedCallbacks,f={};for(let y in b)b.hasOwnProperty(y)&&(b[y](t)||(f[y]=b[y]));t._loadedCallbacks=f,t.state=Ja.DONE}u&&(t.renderable=!0)}processImagery(t,n,i,o){let r=t.data,s=t.upsampledFromParent,a=!1,c=!0,d=r.imagery,u,m;for(u=0,m=d.length;u<m;++u){let p=d[u];if(!l(p.loadingImagery)){s=!1;continue}if(p.loadingImagery.state===Dn.PLACEHOLDER){let f=p.loadingImagery.imageryLayer;if(f.ready){p.freeResources(),d.splice(u,1),f._createTileImagerySkeletons(t,n,u),--u,m=d.length;continue}else s=!1}let b=p.processStateMachine(t,i,o);c=c&&b,a=a||b||l(p.readyImagery),s=s&&l(p.loadingImagery)&&(p.loadingImagery.state===Dn.FAILED||p.loadingImagery.state===Dn.INVALID)}return t.upsampledFromParent=s,t.renderable=t.renderable&&(a||c),c}addGeodeticSurfaceNormals(t,n){pVe(this,!0,t,n)}removeGeodeticSurfaceNormals(t){pVe(this,!1,void 0,t)}updateExaggeration(t,n,i){let o=this,r=o.renderedMesh;if(r===void 0)return;let s=n.verticalExaggeration,a=n.verticalExaggerationRelativeHeight,c=s!==1,d=r.encoding,u=d.exaggeration!==s,m=d.exaggerationRelativeHeight!==a;if(u||m){if(u)if(c&&!d.hasGeodeticSurfaceNormals){let b=t.tilingScheme.ellipsoid;o.addGeodeticSurfaceNormals(b,n)}else!c&&d.hasGeodeticSurfaceNormals&&o.removeGeodeticSurfaceNormals(n);if(d.exaggeration=s,d.exaggerationRelativeHeight=a,i!==void 0){i._tileToUpdateHeights.push(t);let b=t.customData;for(let f of b)f.level=-1}r.updateExaggeration(s,a)}}updateSceneMode(t){let i=this.renderedMesh;i!==void 0&&i.updateSceneMode(t)}static _createVertexArrayForMesh(t,n){let i=n.vertices,o=it.createVertexBuffer({context:t,typedArray:i,usage:Pe.STATIC_DRAW}),r=n.encoding.getAttributes(o),s=n.indices.indexBuffers||{},a=s[t.id];if(!l(a)||a.isDestroyed()){let c=n.indices;a=it.createIndexBuffer({context:t,typedArray:c,usage:Pe.STATIC_DRAW,indexDatatype:Oe.fromSizeInBytes(c.BYTES_PER_ELEMENT)}),a.vertexArrayDestroyable=!1,a.referenceCount=1,s[t.id]=a,n.indices.indexBuffers=s}else++a.referenceCount;return new Un({context:t,attributes:r,indexBuffer:a})}static _freeVertexArray(t){if(l(t)){let n=t.indexBuffer;t.isDestroyed()||t.destroy(),l(n)&&!n.isDestroyed()&&l(n.referenceCount)&&(--n.referenceCount,n.referenceCount===0&&n.destroy())}}_findAncestorTileWithTerrainData(t){let n=t.parent;for(;l(n)&&(!l(n.data)||!l(n.data.terrainData)||n.data.terrainData.wasCreatedByUpsampling());)n=n.parent;return n}_computeWaterMaskTranslationAndScale(t,n,i){let o=n.rectangle,r=t.rectangle,s=r.width,a=r.height,c=s/o.width,d=a/o.height;return i.x=c*(r.west-o.west)/s,i.y=d*(r.south-o.south)/a,i.z=c,i.w=d,i}};function pVe(e,t,n,i){let o=e.renderedMesh,r=o.vertices,s=o.encoding,a=r.length/s.stride,c=Rr.clone(s);c.hasGeodeticSurfaceNormals=t,c=Rr.clone(c);let d=c.stride,u=new Float32Array(a*d);t?s.addGeodeticSurfaceNormals(r,u,n):s.removeGeodeticSurfaceNormals(r,u),o.vertices=u,o.stride=d,o!==e.mesh?(f0._freeVertexArray(e.fill.vertexArray),e.fill.vertexArray=f0._createVertexArrayForMesh(i.context,o)):(f0._freeVertexArray(e.vertexArray),e.vertexArray=f0._createVertexArrayForMesh(i.context,o)),f0._freeVertexArray(e.wireframeVertexArray),e.wireframeVertexArray=void 0}function WTt(e,t,n,i){let o=t.getTileDataAvailable(e.x,e.y,e.level);if(!l(o)&&l(e.parent)){let s=e.parent,a=s.data;l(a)&&l(a.terrainData)&&(o=a.terrainData.isChildAvailable(s.x,s.y,e.x,e.y))}let r=e.data;o===!1&&(r.terrainState=wo.FAILED);for(let s=0,a=i.length;s<a;++s){let c=i.get(s);c.show&&c._createTileImagerySkeletons(e,t)}}function vTt(e,t,n,i,o,r,s){let a=e.data,c=e.parent;if(a.terrainState===wo.FAILED&&c!==void 0){let d=c.data;d!==void 0&&d.terrainData!==void 0&&d.terrainData.canUpsample!==!1||f0.processStateMachine(c,t,n,i,o,r,s,!0)}if(a.terrainState===wo.FAILED&&FTt(a,e,t,n,e.x,e.y,e.level),a.terrainState===wo.UNLOADED&&ITt(a,n,e.x,e.y,e.level),a.terrainState===wo.RECEIVED&&XTt(a,t,n,e.x,e.y,e.level),a.terrainState===wo.TRANSFORMED&&(NTt(a,t.context,n,e.x,e.y,e.level,s),a.updateExaggeration(e,t,r)),a.terrainState>=wo.RECEIVED&&a.waterMaskTexture===void 0&&n.hasWaterMask)if(a.terrainData.waterMask!==void 0)MTt(t.context,a);else{let u=a._findAncestorTileWithTerrainData(e),m=u?.data;l(u)&&l(m.waterMaskTexture)&&(a.waterMaskTexture=m.waterMaskTexture,++a.waterMaskTexture.referenceCount,a._computeWaterMaskTranslationAndScale(e,u,a.waterMaskTranslationAndScale))}}function FTt(e,t,n,i,o,r,s){let a=t.parent;if(!a){t.state=Ja.FAILED;return}let d=a.data.terrainData,u=a.x,m=a.y,p=a.level;if(!l(d))return;let b=d.upsample(i.tilingScheme,u,m,p,o,r,s);l(b)&&(e.terrainState=wo.RECEIVING,Promise.resolve(b).then(function(f){l(f)&&(e.terrainData=f,e.terrainState=wo.RECEIVED)}).catch(function(){e.terrainState=wo.FAILED}))}function ITt(e,t,n,i,o){function r(c){if(!l(c)){e.terrainState=wo.UNLOADED,e.request=void 0;return}e.terrainData=c,e.terrainState=wo.RECEIVED,e.request=void 0}function s(c){if(e.request.state===Ri.CANCELLED){e.terrainData=void 0,e.terrainState=wo.UNLOADED,e.request=void 0;return}e.terrainState=wo.FAILED,e.request=void 0;let d=`Failed to obtain terrain tile X: ${n} Y: ${i} Level: ${o}. Error message: "${c}"`;t._requestError=tr.reportError(t._requestError,t,t.errorEvent,d,n,i,o),t._requestError.retry&&a()}function a(){let c=new Ar({throttle:!1,throttleByServer:!0,type:js.TERRAIN});e.request=c;let d=t.requestTileGeometry(n,i,o,c);l(d)?(e.terrainState=wo.RECEIVING,Promise.resolve(d).then(function(u){r(u)}).catch(function(u){s(u)})):(e.terrainState=wo.UNLOADED,e.request=void 0)}a()}var PTt={tilingScheme:void 0,x:0,y:0,level:0,exaggeration:1,exaggerationRelativeHeight:0,throttle:!0};function XTt(e,t,n,i,o,r){let s=n.tilingScheme,a=PTt;a.tilingScheme=s,a.x=i,a.y=o,a.level=r,a.exaggeration=t.verticalExaggeration,a.exaggerationRelativeHeight=t.verticalExaggerationRelativeHeight,a.throttle=!0;let d=e.terrainData.createMesh(a);l(d)&&(e.terrainState=wo.TRANSFORMING,Promise.resolve(d).then(function(u){e.mesh=u,e.terrainState=wo.TRANSFORMED}).catch(function(){e.terrainState=wo.FAILED}))}function NTt(e,t,n,i,o,r,s){e.vertexArray=f0._createVertexArrayForMesh(t,e.mesh),e.terrainState=wo.READY,e.fill=e.fill&&e.fill.destroy(s)}function YTt(e){let t=e.cache.tile_waterMaskData;if(!l(t)){let n=vt.create({context:e,pixelFormat:Qe.LUMINANCE,pixelDatatype:Ue.UNSIGNED_BYTE,source:{arrayBufferView:new Uint8Array([255]),width:1,height:1}});n.referenceCount=1;let i=new Ot({wrapS:pn.CLAMP_TO_EDGE,wrapT:pn.CLAMP_TO_EDGE,minificationFilter:Ht.LINEAR,magnificationFilter:$n.LINEAR});t={allWaterTexture:n,sampler:i,destroy:function(){this.allWaterTexture.destroy()}},e.cache.tile_waterMaskData=t}return t}function MTt(e,t){let n=t.terrainData.waterMask,i=YTt(e),o,r=n.length;if(n instanceof ImageBitmap)o=vt.create({context:e,source:n,sampler:i.sampler,flipY:!1,skipColorSpaceConversion:!0});else if(r===1)if(n[0]!==0)o=i.allWaterTexture;else return;else{let s=Math.sqrt(r);o=vt.create({context:e,pixelFormat:Qe.LUMINANCE,pixelDatatype:Ue.UNSIGNED_BYTE,source:{width:s,height:s,arrayBufferView:n},sampler:i.sampler,flipY:!1}),o.referenceCount=0}++o.referenceCount,t.waterMaskTexture=o,ce.fromElements(0,0,1,1,t.waterMaskTranslationAndScale)}var hh=f0;var fHi=x(T(),1);var Ozi=x(T(),1),wTt={WEST:0,NORTH:1,EAST:2,SOUTH:3,NORTHWEST:4,NORTHEAST:5,SOUTHWEST:6,SOUTHEAST:7},Gn=wTt;var zzi=x(T(),1),bVe={NONE:0,CULLED:1,RENDERED:2,REFINED:3,RENDERED_AND_KICKED:6,REFINED_AND_KICKED:7,CULLED_BUT_NEEDED:9,wasKicked:function(e){return e>=bVe.RENDERED_AND_KICKED},originalResult:function(e){return e&3},kick:function(e){return e|4}},gi=bVe;function $V(e){this.tile=e,this.frameLastUpdated=void 0,this.westMeshes=[],this.westTiles=[],this.southMeshes=[],this.southTiles=[],this.eastMeshes=[],this.eastTiles=[],this.northMeshes=[],this.northTiles=[],this.southwestMesh=void 0,this.southwestTile=void 0,this.southeastMesh=void 0,this.southeastTile=void 0,this.northwestMesh=void 0,this.northwestTile=void 0,this.northeastMesh=void 0,this.northeastTile=void 0,this.changedThisFrame=!0,this.visitedFrame=void 0,this.enqueuedFrame=void 0,this.mesh=void 0,this.vertexArray=void 0,this.waterMaskTexture=void 0,this.waterMaskTranslationAndScale=new ce}$V.prototype.update=function(e,t,n){this.changedThisFrame&&(ZVe(e,t,this.tile,n),this.changedThisFrame=!1)};$V.prototype.destroy=function(e){this._destroyVertexArray(e),l(this.waterMaskTexture)&&(--this.waterMaskTexture.referenceCount,this.waterMaskTexture.referenceCount===0&&this.waterMaskTexture.destroy(),this.waterMaskTexture=void 0)};$V.prototype._destroyVertexArray=function(e){l(this.vertexArray)&&(l(e)?e.push(this.vertexArray):hh._freeVertexArray(this.vertexArray),this.vertexArray=void 0)};var kTt=new nx;$V.updateFillTiles=function(e,t,n,i){let o=e._quadtree,r=o._levelZeroTiles,s=o._lastSelectionFrameNumber,a=kTt;a.clear();for(let d=0;d<t.length;++d){let u=t[d];l(u.data.vertexArray)&&a.enqueue(t[d])}let c=a.dequeue();for(;c!==void 0;){let d=c.findTileToWest(r),u=c.findTileToSouth(r),m=c.findTileToEast(r),p=c.findTileToNorth(r);Ga(e,n,c,d,s,Gn.EAST,!1,a,i),Ga(e,n,c,u,s,Gn.NORTH,!1,a,i),Ga(e,n,c,m,s,Gn.WEST,!1,a,i),Ga(e,n,c,p,s,Gn.SOUTH,!1,a,i);let b=d.findTileToNorth(r),f=d.findTileToSouth(r),y=m.findTileToNorth(r),_=m.findTileToSouth(r);Ga(e,n,c,b,s,Gn.SOUTHEAST,!1,a,i),Ga(e,n,c,y,s,Gn.SOUTHWEST,!1,a,i),Ga(e,n,c,f,s,Gn.NORTHEAST,!1,a,i),Ga(e,n,c,_,s,Gn.NORTHWEST,!1,a,i),c=a.dequeue()}};function Ga(e,t,n,i,o,r,s,a,c){if(i===void 0)return;let d=i;for(;d&&(d._lastSelectionResultFrame!==o||gi.wasKicked(d._lastSelectionResult)||gi.originalResult(d._lastSelectionResult)===gi.CULLED);){if(s)return;let u=d.parent;if(r>=Gn.NORTHWEST&&u!==void 0)switch(r){case Gn.NORTHWEST:d=d===u.northwestChild?u:void 0;break;case Gn.NORTHEAST:d=d===u.northeastChild?u:void 0;break;case Gn.SOUTHWEST:d=d===u.southwestChild?u:void 0;break;case Gn.SOUTHEAST:d=d===u.southeastChild?u:void 0;break}else d=u}if(d!==void 0){if(d._lastSelectionResult===gi.RENDERED){if(l(d.data.vertexArray))return;UTt(e,t,n,d,r,o,a,c);return}if(gi.originalResult(i._lastSelectionResult)!==gi.CULLED)switch(r){case Gn.WEST:Ga(e,t,n,i.northwestChild,o,r,!0,a,c),Ga(e,t,n,i.southwestChild,o,r,!0,a,c);break;case Gn.EAST:Ga(e,t,n,i.southeastChild,o,r,!0,a,c),Ga(e,t,n,i.northeastChild,o,r,!0,a,c);break;case Gn.SOUTH:Ga(e,t,n,i.southwestChild,o,r,!0,a,c),Ga(e,t,n,i.southeastChild,o,r,!0,a,c);break;case Gn.NORTH:Ga(e,t,n,i.northeastChild,o,r,!0,a,c),Ga(e,t,n,i.northwestChild,o,r,!0,a,c);break;case Gn.NORTHWEST:Ga(e,t,n,i.northwestChild,o,r,!0,a,c);break;case Gn.NORTHEAST:Ga(e,t,n,i.northeastChild,o,r,!0,a,c);break;case Gn.SOUTHWEST:Ga(e,t,n,i.southwestChild,o,r,!0,a,c);break;case Gn.SOUTHEAST:Ga(e,t,n,i.southeastChild,o,r,!0,a,c);break;default:throw new ge("Invalid edge")}}}function UTt(e,t,n,i,o,r,s,a){let c=i.data;if(c.fill===void 0)c.fill=new $V(i);else if(c.fill.visitedFrame===r)return;c.fill.enqueuedFrame!==r&&(c.fill.enqueuedFrame=r,c.fill.changedThisFrame=!1,s.enqueue(i)),DTt(e,t,n,i,o,a)}function DTt(e,t,n,i,o,r){let s=i.data.fill,a,c=n.data.fill;l(c)?(c.visitedFrame=t.frameNumber,c.changedThisFrame&&(ZVe(e,t,n,r),c.changedThisFrame=!1),a=n.data.fill.mesh):a=n.data.mesh;let d,u;switch(o){case Gn.WEST:d=s.westMeshes,u=s.westTiles;break;case Gn.SOUTH:d=s.southMeshes,u=s.southTiles;break;case Gn.EAST:d=s.eastMeshes,u=s.eastTiles;break;case Gn.NORTH:d=s.northMeshes,u=s.northTiles;break;case Gn.NORTHWEST:s.changedThisFrame=s.changedThisFrame||s.northwestMesh!==a,s.northwestMesh=a,s.northwestTile=n;return;case Gn.NORTHEAST:s.changedThisFrame=s.changedThisFrame||s.northeastMesh!==a,s.northeastMesh=a,s.northeastTile=n;return;case Gn.SOUTHWEST:s.changedThisFrame=s.changedThisFrame||s.southwestMesh!==a,s.southwestMesh=a,s.southwestTile=n;return;case Gn.SOUTHEAST:s.changedThisFrame=s.changedThisFrame||s.southeastMesh!==a,s.southeastMesh=a,s.southeastTile=n;return}if(n.level<=i.level){s.changedThisFrame=s.changedThisFrame||d[0]!==a||d.length!==1,d[0]=a,u[0]=n,d.length=1,u.length=1;return}let m,p,b,f,y=n.rectangle,_,S=i.rectangle;switch(o){case Gn.WEST:for(_=(S.north-S.south)*W.EPSILON5,m=0;m<u.length&&(b=u[m],f=b.rectangle,!W.greaterThan(y.north,f.south,_));++m);for(p=m;p<u.length&&(b=u[p],f=b.rectangle,!W.greaterThanOrEquals(y.south,f.north,_));++p);break;case Gn.SOUTH:for(_=(S.east-S.west)*W.EPSILON5,m=0;m<u.length&&(b=u[m],f=b.rectangle,!W.lessThan(y.west,f.east,_));++m);for(p=m;p<u.length&&(b=u[p],f=b.rectangle,!W.lessThanOrEquals(y.east,f.west,_));++p);break;case Gn.EAST:for(_=(S.north-S.south)*W.EPSILON5,m=0;m<u.length&&(b=u[m],f=b.rectangle,!W.lessThan(y.south,f.north,_));++m);for(p=m;p<u.length&&(b=u[p],f=b.rectangle,!W.lessThanOrEquals(y.north,f.south,_));++p);break;case Gn.NORTH:for(_=(S.east-S.west)*W.EPSILON5,m=0;m<u.length&&(b=u[m],f=b.rectangle,!W.greaterThan(y.east,f.west,_));++m);for(p=m;p<u.length&&(b=u[p],f=b.rectangle,!W.greaterThanOrEquals(y.west,f.east,_));++p);break}p-m===1?(s.changedThisFrame=s.changedThisFrame||d[m]!==a,d[m]=a,u[m]=n):(s.changedThisFrame=!0,d.splice(m,p-m,a),u.splice(m,p-m,n))}var TZ=new pe,OTt=new pe,qV=new h,ote=new h,tte=new k,nte=new k,Qu=new k;function H3(){this.height=0,this.encodedNormal=new k}function k3(e,t,n,i,o,r,s,a,c){if(l(o))return o;let d;if(l(r)&&l(s))d=(r.height+s.height)*.5;else if(l(r))d=r.height;else if(l(s))d=s.height;else if(l(a))d=a.height;else{let m=e.tile.data.tileBoundingRegion,p=0,b=0;l(m)&&(p=m.minimumHeight,b=m.maximumHeight),d=(p+b)*.5}return RVe(e,t,n,i,d,c),c}var BTt={minimumHeight:0,maximumHeight:0},zTt=new h,gVe=new H3,yVe=new H3,xVe=new H3,TVe=new H3,HTt=typeof Uint8Array<"u"?new Uint8Array(81):void 0,KTt={tilingScheme:void 0,x:0,y:0,level:0,exaggeration:1,exaggerationRelativeHeight:0};function ZVe(e,t,n,i){hh.initialize(n,e.terrainProvider,e.vectorProvider,e._imageryLayers);let o=n.data,r=o.fill,s=n.rectangle,a=t.verticalExaggeration,c=t.verticalExaggerationRelativeHeight,d=a!==1,u=n.tilingScheme.ellipsoid,m=D3(r,u,0,1,r.northwestTile,r.northwestMesh,r.northTiles,r.northMeshes,r.westTiles,r.westMeshes,xVe),p=D3(r,u,0,0,r.southwestTile,r.southwestMesh,r.westTiles,r.westMeshes,r.southTiles,r.southMeshes,gVe),b=D3(r,u,1,0,r.southeastTile,r.southeastMesh,r.southTiles,r.southMeshes,r.eastTiles,r.eastMeshes,yVe),f=D3(r,u,1,1,r.northeastTile,r.northeastMesh,r.eastTiles,r.eastMeshes,r.northTiles,r.northMeshes,TVe);m=k3(r,u,0,1,m,p,f,b,xVe),p=k3(r,u,0,0,p,m,b,f,gVe),b=k3(r,u,1,1,b,p,f,m,yVe),f=k3(r,u,1,1,f,b,m,p,TVe);let y=p.height,_=b.height,S=m.height,Z=f.height,R=Math.min(y,_,S,Z),C=Math.max(y,_,S,Z),E=(R+C)*.5,A,L,F=e.getLevelMaximumGeometricError(n.level),I=u.maximumRadius-F,N=Math.acos(I/u.maximumRadius)*4;if(N*=1.5,s.width>N&&C-R<=F){let G=new Yc({width:9,height:9,buffer:HTt,structure:{heightOffset:C}}),v=KTt;v.tilingScheme=n.tilingScheme,v.x=n.x,v.y=n.y,v.level=n.level,v.exaggeration=a,v.exaggerationRelativeHeight=c,r.mesh=G._createMeshSync(v)}else{let G=d,v=re.center(s,OTt);v.height=E;let X=u.cartographicToCartesian(v,zTt),Y=new Rr(X,void 0,void 0,void 0,void 0,!0,!0,G,a,c),D=5,M;for(M=r.westMeshes,A=0,L=M.length;A<L;++A)D+=M[A].eastIndicesNorthToSouth.length;for(M=r.southMeshes,A=0,L=M.length;A<L;++A)D+=M[A].northIndicesWestToEast.length;for(M=r.eastMeshes,A=0,L=M.length;A<L;++A)D+=M[A].westIndicesSouthToNorth.length;for(M=r.northMeshes,A=0,L=M.length;A<L;++A)D+=M[A].southIndicesEastToWest.length;let O=BTt;O.minimumHeight=R,O.maximumHeight=C;let w=Y.stride,z=new Float32Array(D*w),K=0,te=K;K=U3(u,s,Y,z,K,0,1,m.height,m.encodedNormal,1,O),K=B3(r,u,Y,z,K,r.westTiles,r.westMeshes,Gn.EAST,O);let H=K;K=U3(u,s,Y,z,K,0,0,p.height,p.encodedNormal,0,O),K=B3(r,u,Y,z,K,r.southTiles,r.southMeshes,Gn.NORTH,O);let $=K;K=U3(u,s,Y,z,K,1,0,b.height,b.encodedNormal,0,O),K=B3(r,u,Y,z,K,r.eastTiles,r.eastMeshes,Gn.WEST,O);let ee=K;K=U3(u,s,Y,z,K,1,1,f.height,f.encodedNormal,1,O),K=B3(r,u,Y,z,K,r.northTiles,r.northMeshes,Gn.SOUTH,O),R=O.minimumHeight,C=O.maximumHeight;let le=nn.fromRectangle(s,R,C,n.tilingScheme.ellipsoid),_e=Ti.geodeticLatitudeToMercatorAngle(s.south),he=1/(Ti.geodeticLatitudeToMercatorAngle(s.north)-_e),Ze=(Ti.geodeticLatitudeToMercatorAngle(v.latitude)-_e)*he,ye=u.geodeticSurfaceNormalCartographic(TZ,ote),Ge=dn.octEncode(ye,tte),Ae=K;Y.encode(z,K*w,le.center,k.fromElements(.5,.5,Qu),E,Ge,Ze,ye),++K;let Fe=K,tt=Fe<256?1:2,Be=(Fe-1)*3,je=Be*tt,qe=(z.length-Fe*w)*Float32Array.BYTES_PER_ELEMENT,We;if(qe>=je){let bt=Fe*w*Float32Array.BYTES_PER_ELEMENT;We=Fe<256?new Uint8Array(z.buffer,bt,Be):new Uint16Array(z.buffer,bt,Be)}else We=Fe<256?new Uint8Array(Be):new Uint16Array(Be);z=new Float32Array(z.buffer,0,Fe*w);let Ke=0;for(A=0;A<Fe-2;++A)We[Ke++]=Ae,We[Ke++]=A,We[Ke++]=A+1;We[Ke++]=Ae,We[Ke++]=A,We[Ke]=0;let ct=[];for(A=H;A>=te;--A)ct.push(A);let Et=[];for(A=$;A>=H;--A)Et.push(A);let zt=[];for(A=ee;A>=$;--A)zt.push(A);let ut=[];for(ut.push(0),A=Ae-1;A>=ee;--A)ut.push(A);r.mesh=new gc(Y.center,z,We,Be,Fe,R,C,s,me.fromOrientedBoundingBox(le),t_t(e,le.center,s,R,C),Y.stride,le,Y,ct,Et,zt,ut)}let g=t.context;r._destroyVertexArray(i),r.vertexArray=hh._createVertexArrayForMesh(g,r.mesh),o.processImagery(n,e.terrainProvider,t,!0);let V=r.waterMaskTexture;if(r.waterMaskTexture=void 0,e.terrainProvider.hasWaterMask){let G=o._findAncestorTileWithTerrainData(n);l(G)&&l(G.data.waterMaskTexture)&&(r.waterMaskTexture=G.data.waterMaskTexture,++r.waterMaskTexture.referenceCount,o._computeWaterMaskTranslationAndScale(n,G,r.waterMaskTranslationAndScale))}l(V)&&(--V.referenceCount,V.referenceCount===0&&V.destroy())}function U3(e,t,n,i,o,r,s,a,c,d,u){let m=TZ;m.longitude=W.lerp(t.west,t.east,r),m.latitude=W.lerp(t.south,t.north,s),m.height=a;let p=e.cartographicToCartesian(m,qV),b;n.hasGeodeticSurfaceNormals&&(b=e.geodeticSurfaceNormal(p,ote));let f=nte;return f.x=r,f.y=s,n.encode(i,o*n.stride,p,f,a,c,d,b),u.minimumHeight=Math.min(u.minimumHeight,a),u.maximumHeight=Math.max(u.maximumHeight,a),o+1}var z3=new re;function VM(e,t,n,i){let o=e.rectangle,r=t.rectangle;t.x===0&&n.x===1&&e.x===e.tilingScheme.getNumberOfXTilesAtLevel(e.level)-1?(o=re.clone(e.rectangle,z3),o.west-=W.TWO_PI,o.east-=W.TWO_PI):e.x===0&&n.x===0&&t.x===t.tilingScheme.getNumberOfXTilesAtLevel(t.level)-1&&(o=re.clone(e.rectangle,z3),o.west+=W.TWO_PI,o.east+=W.TWO_PI);let s=o.east-o.west,a=(r.west-o.west)/s,c=(r.east-o.west)/s,d=o.north-o.south,u=(r.south-o.south)/d,m=(r.north-o.south)/d,p=(n.x-a)/(c-a),b=(n.y-u)/(m-u);return Math.abs(p)<Math.EPSILON5?p=0:Math.abs(p-1)<Math.EPSILON5&&(p=1),Math.abs(b)<Math.EPSILON5?b=0:Math.abs(b-1)<Math.EPSILON5&&(b=1),i.x=p,i.y=b,i}var JTt=new k;function ite(e,t,n,i,o){let r=e.encoding,s=e.vertices;if(o.height=r.decodeHeight(s,t),r.hasVertexNormals)r.getOctEncodedNormal(s,t,o.encodedNormal);else{let a=o.encodedNormal;a.x=0,a.y=0}}var jTt=new k,QTt=new h;function qTt(e,t,n,i,o,r,s,a,c,d){let u=i.encoding,m=i.vertices,p=VM(t,n,u.decodeTextureCoordinates(m,o,Qu),Qu),b=VM(t,n,u.decodeTextureCoordinates(m,r,nte),nte),f;c?f=(s-p.x)/(b.x-p.x):f=(a-p.y)/(b.y-p.y);let y=u.decodeHeight(m,o),_=u.decodeHeight(m,r),S=n.rectangle;TZ.longitude=W.lerp(S.west,S.east,s),TZ.latitude=W.lerp(S.south,S.north,a),d.height=TZ.height=W.lerp(y,_,f);let Z;if(u.hasVertexNormals){let R=u.getOctEncodedNormal(m,o,JTt),C=u.getOctEncodedNormal(m,r,jTt),E=dn.octDecode(R.x,R.y,qV),A=dn.octDecode(C.x,C.y,QTt);Z=h.lerp(E,A,f,qV),h.normalize(Z,Z),dn.octEncode(Z,d.encodedNormal)}else Z=e.geodeticSurfaceNormalCartographic(TZ,qV),dn.octEncode(Z,d.encodedNormal)}function RVe(e,t,n,i,o,r){r.height=o;let s=t.geodeticSurfaceNormalCartographic(TZ,qV);dn.octEncode(s,r.encodedNormal)}function D3(e,t,n,i,o,r,s,a,c,d,u){if(SVe(e,t,a,s,!1,n,i,u)||SVe(e,t,d,c,!0,n,i,u))return u;let p;if(rte(o,r))return n===0?i===0?p=r.eastIndicesNorthToSouth[0]:p=r.southIndicesEastToWest[0]:i===0?p=r.northIndicesWestToEast[0]:p=r.westIndicesSouthToNorth[0],ite(r,p,n,i,u),u;let b;if(n===0?i===0?b=O3(e.westMeshes,e.westTiles,Gn.EAST,e.southMeshes,e.southTiles,Gn.NORTH,n,i):b=O3(e.northMeshes,e.northTiles,Gn.SOUTH,e.westMeshes,e.westTiles,Gn.EAST,n,i):i===0?b=O3(e.southMeshes,e.southTiles,Gn.NORTH,e.eastMeshes,e.eastTiles,Gn.WEST,n,i):b=O3(e.eastMeshes,e.eastTiles,Gn.WEST,e.northMeshes,e.northTiles,Gn.SOUTH,n,i),l(b))return RVe(e,t,n,i,b,u),u}function O3(e,t,n,i,o,r,s,a){let c=_Ve(e,t,!1,n,s,a),d=_Ve(i,o,!0,r,s,a);return l(c)&&l(d)?(c+d)*.5:l(c)?c:d}function B3(e,t,n,i,o,r,s,a,c){for(let d=0;d<r.length;++d)o=$Tt(e,t,n,i,o,r[d],s[d],a,c);return o}function $Tt(e,t,n,i,o,r,s,a,c){let d;a===Gn.EAST&&e.tile.x===0?(d=re.clone(r.rectangle,z3),d.west-=W.TWO_PI,d.east-=W.TWO_PI):a===Gn.WEST&&r.x===0&&(d=re.clone(r.rectangle,z3),d.west+=W.TWO_PI,d.east+=W.TWO_PI);let u=e.tile.rectangle,m,p;o>0&&(n.decodeTextureCoordinates(i,o-1,Qu),m=Qu.x,p=Qu.y);let b,f;switch(a){case Gn.WEST:b=s.westIndicesSouthToNorth,f=!1;break;case Gn.NORTH:b=s.northIndicesWestToEast,f=!0;break;case Gn.EAST:b=s.eastIndicesNorthToSouth,f=!1;break;case Gn.SOUTH:b=s.southIndicesEastToWest,f=!0;break}let y=r,_=e.tile,S=s.encoding,Z=s.vertices,R=n.stride,C,E;S.hasWebMercatorT&&(C=Ti.geodeticLatitudeToMercatorAngle(u.south),E=1/(Ti.geodeticLatitudeToMercatorAngle(u.north)-C));for(let A=0;A<b.length;++A){let L=b[A],F=S.decodeTextureCoordinates(Z,L,Qu);VM(y,_,F,F);let I=F.x,N=F.y,g=f?I:N;if(g<0||g>1||Math.abs(I-m)<W.EPSILON5&&Math.abs(N-p)<W.EPSILON5)continue;let V=Math.abs(I)<W.EPSILON5||Math.abs(I-1)<W.EPSILON5,G=Math.abs(N)<W.EPSILON5||Math.abs(N-1)<W.EPSILON5;if(V&&G)continue;let v=S.decodePosition(Z,L,qV),X=S.decodeHeight(Z,L),Y;S.hasVertexNormals?Y=S.getOctEncodedNormal(Z,L,tte):(Y=tte,Y.x=0,Y.y=0);let D=N;if(S.hasWebMercatorT){let O=W.lerp(u.south,u.north,N);D=(Ti.geodeticLatitudeToMercatorAngle(O)-C)*E}let M;n.hasGeodeticSurfaceNormals&&(M=t.geodeticSurfaceNormal(v,ote)),n.encode(i,o*R,v,F,X,Y,D,M),c.minimumHeight=Math.min(c.minimumHeight,X),c.maximumHeight=Math.max(c.maximumHeight,X),++o}return o}function _Ve(e,t,n,i,o,r){let s,a,c;n?(s=0,a=e.length,c=1):(s=e.length-1,a=-1,c=-1);for(let d=s;d!==a;d+=c){let u=e[d],m=t[d];if(!rte(m,u))continue;let p;switch(i){case Gn.WEST:p=u.westIndicesSouthToNorth;break;case Gn.SOUTH:p=u.southIndicesEastToWest;break;case Gn.EAST:p=u.eastIndicesNorthToSouth;break;case Gn.NORTH:p=u.northIndicesWestToEast;break}let b=p[n?0:p.length-1];if(l(b))return u.encoding.decodeHeight(u.vertices,b)}}function rte(e,t){return l(t)&&(!l(e.data.fill)||!e.data.fill.changedThisFrame)}function SVe(e,t,n,i,o,r,s,a){let c,d,u,m,p,b=i[o?0:n.length-1],f=n[o?0:n.length-1];if(rte(b,f)&&(r===0?s===0?(c=o?f.northIndicesWestToEast:f.eastIndicesNorthToSouth,d=o,u=o):(c=o?f.eastIndicesNorthToSouth:f.southIndicesEastToWest,d=!o,u=!1):s===0?(c=o?f.westIndicesSouthToNorth:f.northIndicesWestToEast,d=!o,u=!0):(c=o?f.southIndicesEastToWest:f.westIndicesSouthToNorth,d=o,u=!o),c.length>0)){m=o?0:c.length-1,p=c[m],f.encoding.decodeTextureCoordinates(f.vertices,p,Qu);let y=VM(b,e.tile,Qu,Qu);if(y.x===r&&y.y===s)return ite(f,p,r,s,a),!0;if(m=Eo(c,d?r:s,function(_,S){f.encoding.decodeTextureCoordinates(f.vertices,_,Qu);let Z=VM(b,e.tile,Qu,Qu);return u?d?Z.x-r:Z.y-s:d?r-Z.x:s-Z.y}),m<0){if(m=~m,m>0&&m<c.length)return qTt(t,b,e.tile,f,c[m-1],c[m],r,s,d,a),!0}else return ite(f,c[m],r,s,a),!0}return!1}var e_t=[new h,new h,new h,new h];function t_t(e,t,n,i,o,r){let s=e.quadtree._occluders.ellipsoid,a=s.ellipsoid,c=e_t;return h.fromRadians(n.west,n.south,o,a,c[0]),h.fromRadians(n.east,n.south,o,a,c[1]),h.fromRadians(n.west,n.north,o,a,c[2]),h.fromRadians(n.east,n.north,o,a,c[3]),s.computeHorizonCullingPointPossiblyUnderEllipsoid(t,c,i,r)}var eE=$V;var ste=class e{constructor(t){this.lightingFadeOutDistance=65e5,this.lightingFadeInDistance=9e6,this.hasWaterMask=!1,this.showWaterEffect=!1,this.oceanNormalMap=void 0,this.zoomedOutOceanSpecularIntensity=.5,this.enableLighting=!1,this.dynamicAtmosphereLighting=!1,this.dynamicAtmosphereLightingFromSun=!1,this.showGroundAtmosphere=!1,this.shadows=Wn.RECEIVE_ONLY,this.vertexShadowDarkness=.3,this.fillHighlightColor=void 0,this.hueShift=0,this.saturationShift=0,this.brightnessShift=0,this.showSkirts=!0,this.backFaceCulling=!0,this.undergroundColor=void 0,this.undergroundColorAlphaByDistance=void 0,this.lambertDiffuseMultiplier=0,this.materialUniformMap=void 0,this._materialUniformMap=void 0,this._quadtree=void 0,this._terrainProvider=t.terrainProvider,this._vectorProvider=t.vectorProvider,this._imageryLayers=t.imageryLayers,this._surfaceShaderSet=t.surfaceShaderSet,this._renderState=void 0,this._blendRenderState=void 0,this._disableCullingRenderState=void 0,this._disableCullingBlendRenderState=void 0,this._errorEvent=new Se,this._removeLayerAddedListener=this._imageryLayers.layerAdded.addEventListener(e.prototype._onLayerAdded,this),this._removeLayerRemovedListener=this._imageryLayers.layerRemoved.addEventListener(e.prototype._onLayerRemoved,this),this._removeLayerMovedListener=this._imageryLayers.layerMoved.addEventListener(e.prototype._onLayerMoved,this),this._removeLayerShownListener=this._imageryLayers.layerShownOrHidden.addEventListener(e.prototype._onLayerShownOrHidden,this),this._imageryLayersUpdatedEvent=new Se,this._layerOrderChanged=!1,this._tilesToRenderByTextureCount=[],this._drawCommands=[],this._uniformMaps=[],this._usedDrawCommands=0,this._vertexArraysToDestroy=[],this._debug={wireframe:!1,boundingSphereTile:void 0,tilesRendered:0,texturesRendered:0},this._baseColor=void 0,this._firstPassInitialColor=void 0,this.baseColor=new U(0,0,.5,1),this._clippingPlanes=void 0,this._clippingPolygons=void 0,this._clippingPolygonsDirty=!1,this._removeClippingPolygonAdded=void 0,this._removeClippingPolygonRemoved=void 0,this.cartographicLimitRectangle=re.clone(re.MAX_VALUE),this._hasLoadedTilesThisFrame=!1,this._hasFillTilesThisFrame=!1,this._oldVerticalExaggeration=void 0,this._oldVerticalExaggerationRelativeHeight=void 0,this._oldSceneMode=se.SCENE3D}get baseColor(){return this._baseColor}set baseColor(t){this._baseColor=t,this._firstPassInitialColor=ce.fromColor(t,this._firstPassInitialColor)}get quadtree(){return this._quadtree}set quadtree(t){this._quadtree=t}get tilingScheme(){if(l(this._terrainProvider))return this._terrainProvider.tilingScheme}get errorEvent(){return this._errorEvent}get imageryLayersUpdatedEvent(){return this._imageryLayersUpdatedEvent}get terrainProvider(){return this._terrainProvider}set terrainProvider(t){this._terrainProvider!==t&&(this._terrainProvider=t,l(this._quadtree)&&this._quadtree.invalidateAllTiles())}get vectorProvider(){return this._vectorProvider}get clippingPlanes(){return this._clippingPlanes}set clippingPlanes(t){_s.setOwner(t,this,"_clippingPlanes")}get clippingPolygons(){return this._clippingPolygons}set clippingPolygons(t){if(t===this._clippingPolygons||(vc.setOwner(t,this,"_clippingPolygons"),this._removeClippingPolygonAdded=this._removeClippingPolygonAdded&&this._removeClippingPolygonAdded(),this._removeClippingPolygonRemoved=this._removeClippingPolygonRemoved&&this._removeClippingPolygonRemoved(),this._clippingPolygonsDirty=!0,!l(t)))return;let n=()=>{this._clippingPolygonsDirty=!0};this._removeClippingPolygonAdded=t.polygonAdded.addEventListener(n),this._removeClippingPolygonRemoved=t.polygonRemoved.addEventListener(n)}update(t){this._imageryLayers._update()}initialize(t){this._imageryLayers.queueReprojectionCommands(t),this._layerOrderChanged&&(this._layerOrderChanged=!1,this._quadtree.forEachLoadedTile(function(r){r.data.imagery.sort(o_t)}));let n=this._vectorProvider;n.minimumTileScreenPixels=i_t(this),n.update(t.frameNumber),this._quadtree.forEachRenderedTile(r=>{let s=r.data;l(s.vectorData)?s.vectorData=n.updateTileData(r.x,r.y,r.level,t.context,s.vectorData,He.CLAMP_TO_TERRAIN):s.vectorData=n.requestTileData(r.x,r.y,r.level,t.context,He.CLAMP_TO_TERRAIN)}),n.makeClean(),c_t(this,t);let i=this._vertexArraysToDestroy,o=i.length;for(let r=0;r<o;++r)hh._freeVertexArray(i[r]);i.length=0}beginUpdate(t){let n=this._tilesToRenderByTextureCount;for(let r=0,s=n.length;r<s;++r){let a=n[r];l(a)&&(a.length=0)}let i=this._clippingPlanes;l(i)&&i.enabled&&i.update(t);let o=this._clippingPolygons;l(o)&&o.enabled&&o.update(t),this._usedDrawCommands=0,this._hasLoadedTilesThisFrame=!1,this._hasFillTilesThisFrame=!1}endUpdate(t){if(!l(this._renderState)){this._renderState=ze.fromCache({cull:{enabled:!0},depthTest:{enabled:!0,func:sc.LESS}}),this._blendRenderState=ze.fromCache({cull:{enabled:!0},depthTest:{enabled:!0,func:sc.LESS_OR_EQUAL},blending:on.ALPHA_BLEND});let c=$e(this._renderState,!0);c.cull.enabled=!1,this._disableCullingRenderState=ze.fromCache(c),c=$e(this._blendRenderState,!0),c.cull.enabled=!1,this._disableCullingBlendRenderState=ze.fromCache(c)}this._hasFillTilesThisFrame&&this._hasLoadedTilesThisFrame&&eE.updateFillTiles(this,this._quadtree._tilesToRender,t,this._vertexArraysToDestroy);let n=this.quadtree,i=t.verticalExaggeration,o=t.verticalExaggerationRelativeHeight,r=this._oldVerticalExaggeration!==i||this._oldVerticalExaggerationRelativeHeight!==o;this._oldVerticalExaggeration=i,this._oldVerticalExaggerationRelativeHeight=o,r&&n.forEachLoadedTile(function(c){c.data.updateExaggeration(c,t,n)});let s=this._oldSceneMode!==t.mode;this._oldSceneMode=t.mode,s&&n.forEachLoadedTile(function(c){c.data.updateSceneMode(t.mode)}),this._clippingPolygonsDirty&&r_t(this);let a=this._tilesToRenderByTextureCount;for(let c=0,d=a.length;c<d;++c){let u=a[c];if(l(u))for(let m=0,p=u.length;m<p;++m){let b=u[m],f=b.data;s_t(this,b,f,t);let y=f.tileBoundingRegion;v_t(this,b,t),t.minimumTerrainHeight=Math.min(t.minimumTerrainHeight,y.minimumHeight)}}}updateForPick(t){let n=this._drawCommands;for(let i=0,o=this._usedDrawCommands;i<o;++i){let r=n[i];r.dirty=!0,r.derivedCommands.picking=void 0;let s=r.derivedCommands.logDepth?.command;l(s)&&(s.derivedCommands.picking=void 0),GVe(r,t)}}cancelReprojections(){this._imageryLayers.cancelReprojections()}getLevelMaximumGeometricError(t){return l(this._terrainProvider)?this._terrainProvider.getLevelMaximumGeometricError(t):0}loadTile(t,n){let i=n.data,o=!0,r;l(i)&&(o=i.boundingVolumeSourceTile!==n||n._lastSelectionResult===gi.CULLED_BUT_NEEDED,r=i.terrainState),hh.processStateMachine(n,t,this.terrainProvider,this.vectorProvider,this._imageryLayers,this.quadtree,this._vertexArraysToDestroy,o),i=n.data,o&&r!==i.terrainState&&this.computeTileVisibility(n,t,this.quadtree.occluders)!==Kr.NONE&&i.boundingVolumeSourceTile===n&&(o=!1,hh.processStateMachine(n,t,this.terrainProvider,this.vectorProvider,this._imageryLayers,this.quadtree,this._vertexArraysToDestroy,o))}computeTileVisibility(t,n,i){let o=this.computeDistanceToTile(t,n);t._distance=o;let r=WVe(this,n);if(n.fog.enabled&&!r&&W.fog(o,n.fog.density)>=1)return Kr.NONE;let s=t.data,a=s.tileBoundingRegion;if(s.boundingVolumeSourceTile===void 0)return Kr.PARTIAL;let c=n.cullingVolume,d=a.boundingVolume;l(d)||(d=a.boundingSphere),s.clippedByBoundaries=!1;let u=J3(t.rectangle,this.cartographicLimitRectangle),m=re.simpleIntersection(u,t.rectangle,LVe);if(!l(m))return Kr.NONE;if(re.equals(m,t.rectangle)||(s.clippedByBoundaries=!0),n.mode!==se.SCENE3D&&(d=l_t,me.fromRectangleWithHeights2D(t.rectangle,n.mapProjection,a.minimumHeight,a.maximumHeight,d),h.fromElements(d.center.z,d.center.x,d.center.y,d.center),n.mode===se.MORPHING&&l(s.renderedMesh)&&(d=me.union(a.boundingSphere,d,d))),!l(d))return Kr.PARTIAL;let p=this._clippingPlanes;if(l(p)&&p.enabled){let S=p.computeIntersectionWithBoundingVolume(d);if(t.isClipped=S!==qt.INSIDE,S===qt.OUTSIDE)return Kr.NONE}let b=this._clippingPolygons;if(l(b)&&b.enabled){let S=b.computeIntersectionWithBoundingVolume(a);t.isClipped=S!==qt.OUTSIDE}let f,y=c.computeVisibility(d);if(y===qt.OUTSIDE?f=Kr.NONE:y===qt.INTERSECTING?f=Kr.PARTIAL:y===qt.INSIDE&&(f=Kr.FULL),f===Kr.NONE)return f;let _=n.mode===se.SCENE3D&&n.camera.frustum instanceof yn;if(n.mode===se.SCENE3D&&!_&&l(i)&&!r){let S=s.occludeePointInScaledSpace;return!l(S)||i.ellipsoid.isScaledSpacePointVisiblePossiblyUnderEllipsoid(S,a.minimumHeight)?f:Kr.NONE}return f}canRefine(t){let n=t.data;return l(n.terrainData)?!0:this.terrainProvider.getTileDataAvailable(t.x*2,t.y*2,t.level+1)!==void 0}canRenderWithoutLosingDetail(t){let n=t.data,i=m_t;i.length=this._imageryLayers.length;let o=!1,r=!1,s;l(n)&&(o=n.terrainState===wo.READY,r=!0,s=n.imagery);let a,c;for(a=0,c=i.length;a<c;++a)i[a]=r;if(l(s))for(a=0,c=s.length;a<c;++a){let m=s[a],p=m.loadingImagery,b=!l(p)||p.state===Dn.FAILED||p.state===Dn.INVALID,f=(m.loadingImagery||m.readyImagery).imageryLayer._layerIndex;i[f]=b&&i[f]}let d=this.quadtree._lastSelectionFrameNumber,u=h_t;for(u.length=0,u.push(t.southwestChild,t.southeastChild,t.northwestChild,t.northeastChild);u.length>0;){let m=u.pop(),p=m._lastSelectionResultFrame===d?m._lastSelectionResult:gi.NONE;if(p===gi.RENDERED){let b=m.data;if(!l(b))continue;if(!o&&m.data.terrainState===wo.READY)return!1;let f=m.data.imagery;for(a=0,c=f.length;a<c;++a){let y=f[a],_=y.loadingImagery,S=!l(_)||_.state===Dn.FAILED||_.state===Dn.INVALID,Z=(y.loadingImagery||y.readyImagery).imageryLayer._layerIndex;if(S&&!i[Z])return!1}}else p===gi.REFINED&&u.push(m.southwestChild,m.southeastChild,m.northwestChild,m.northeastChild)}return!0}computeTileLoadPriority(t,n){let i=t.data;if(i===void 0)return 0;let o=i.tileBoundingRegion.boundingVolume;if(o===void 0)return 0;let r=n.camera.positionWC,s=n.camera.directionWC,a=h.subtract(o.center,r,f_t),c=h.magnitude(a);return c<W.EPSILON5?0:(h.divideByScalar(a,c,a),(1-h.dot(a,s))*t._distance)}showTileThisFrame(t,n){let i=0,o=t.data,r=o.imagery;for(let c=0,d=r.length;c<d;++c){let u=r[c];l(u.readyImagery)&&u.readyImagery.imageryLayer.alpha!==0&&++i}let s=this._tilesToRenderByTextureCount[i];l(s)||(s=[],this._tilesToRenderByTextureCount[i]=s),s.push(t),l(o.vertexArray)?this._hasLoadedTilesThisFrame=!0:this._hasFillTilesThisFrame=!0;let a=this._debug;++a.tilesRendered,a.texturesRendered+=i}computeDistanceToTile(t,n){S_t(t,this,n);let i=t.data;if(i.boundingVolumeSourceTile===void 0)return 9999999999;let r=i.tileBoundingRegion,s=r.minimumHeight,a=r.maximumHeight;if(i.boundingVolumeSourceTile!==t){let d=n.camera.positionCartographic.height,u=Math.abs(d-s),m=Math.abs(d-a);u>m?(r.minimumHeight=s,r.maximumHeight=s):(r.minimumHeight=a,r.maximumHeight=a)}let c=r.distanceToCamera(n);return r.minimumHeight=s,r.maximumHeight=a,c}isDestroyed(){return!1}destroy(){return this._tileProvider=this._tileProvider&&this._tileProvider.destroy(),this._clippingPlanes=this._clippingPlanes&&this._clippingPlanes.destroy(),this._clippingPolygons=void 0,this._removeLayerAddedListener=this._removeLayerAddedListener&&this._removeLayerAddedListener(),this._removeLayerRemovedListener=this._removeLayerRemovedListener&&this._removeLayerRemovedListener(),this._removeLayerMovedListener=this._removeLayerMovedListener&&this._removeLayerMovedListener(),this._removeLayerShownListener=this._removeLayerShownListener&&this._removeLayerShownListener(),this._removeClippingPolygonAdded=this._removeClippingPolygonAdded&&this._removeClippingPolygonAdded(),this._removeClippingPolygonRemoved=this._removeClippingPolygonRemoved&&this._removeClippingPolygonRemoved(),ue(this)}_onLayerAdded(t,n){if(!this.isDestroyed()&&t.show){let i=this._terrainProvider,o=this,r=this._imageryLayersUpdatedEvent,s=function(){t._imageryCache={},o._quadtree.forEachLoadedTile(function(a){if(l(a._loadedCallbacks[t._layerIndex]))return;let c,d=a.data.imagery,u=d.length,m=-1,p=0;for(c=0;c<u;++c){let f=d[c];if((f.readyImagery??f.loadingImagery).imageryLayer===t)m===-1&&(m=c),++p;else if(m!==-1)break}if(m===-1)return;let b=m+p;t._createTileImagerySkeletons(a,i,b)&&(a._loadedCallbacks[t._layerIndex]=Z_t(p,t,i),a.state=Ja.LOADING)})};if(t.ready){let a=t.imageryProvider;a._reload=s}this._quadtree.forEachLoadedTile(function(a){t._createTileImagerySkeletons(a,i)&&(a.state=Ja.LOADING,a.level!==0&&(a._lastSelectionResultFrame!==o.quadtree._lastSelectionFrameNumber||a._lastSelectionResult!==gi.RENDERED)&&(a.renderable=!1))}),this._layerOrderChanged=!0,r.raiseEvent()}}_onLayerRemoved(t,n){this._quadtree.forEachLoadedTile(function(i){let o=i.data.imagery,r=-1,s=0;for(let a=0,c=o.length;a<c;++a){let d=o[a],u=d.loadingImagery;if(l(u)||(u=d.readyImagery),u.imageryLayer===t)r===-1&&(r=a),d.freeResources(),++s;else if(r!==-1)break}r!==-1&&o.splice(r,s)}),l(t.imageryProvider)&&(t.imageryProvider._reload=void 0),this._imageryLayersUpdatedEvent.raiseEvent()}_onLayerMoved(t,n,i){this._layerOrderChanged=!0,this._imageryLayersUpdatedEvent.raiseEvent()}_onLayerShownOrHidden(t,n,i){i?this._onLayerAdded(t,n):this._onLayerRemoved(t,n)}},n_t=new re;function i_t(e){let t=e.getLevelMaximumGeometricError(0);if(t<=0)return e._vectorProvider.minimumTileScreenPixels;let n=e.tilingScheme;return n.tileXYToRectangle(0,0,0,n_t).width*n.ellipsoid.maximumRadius/t*e._quadtree.maximumScreenSpaceError/2}function o_t(e,t){let n=e.loadingImagery;l(n)||(n=e.readyImagery);let i=t.loadingImagery;return l(i)||(i=t.readyImagery),n.imageryLayer._layerIndex-i.imageryLayer._layerIndex}function r_t(e){e._quadtree.forEachLoadedTile(function(t){let n=t.data;l(n?.clippingPolygonData)&&(vc.releaseRectangleData(n.clippingPolygonData),n.clippingPolygonData=void 0)}),e._clippingPolygonsDirty=!1}function s_t(e,t,n,i){let o=e._clippingPolygons;!l(o)||!o.enabled||!t.isClipped||l(n.clippingPolygonData)||(n.clippingPolygonData=o.requestRectangleData(t.rectangle,i.context))}function a_t(e,t){let n=e._clippingPolygons;return l(n)&&n.enabled&&n.length>0&&n.inverse&&(t.clippingPolygonData?.polygonRings.length??0)===0}function c_t(e,t){let n=t.creditDisplay,i=e._terrainProvider;l(i)&&l(i.credit)&&n.addCreditToNextFrame(i.credit);let o=e._imageryLayers;for(let r=0,s=o.length;r<s;++r){let a=o.get(r);a.ready&&a.show&&l(a.imageryProvider.credit)&&n.addCreditToNextFrame(a.imageryProvider.credit)}}function GVe(e,t){let n=t.globeTranslucencyState;if(n.translucent){let i=e.renderState.blending.enabled;n.pushDerivedCommands(e,i,t)}else t.commandList.push(e)}var l_t=new me,LVe=new re,d_t=new re,u_t=new pe;function J3(e,t){if(t.west<t.east)return t;let n=re.clone(t,d_t);return re.center(e,u_t).longitude>0?n.east=W.PI:n.west=-W.PI,n}function WVe(e,t){if(t.cameraUnderground||t.globeTranslucencyState.translucent)return!0;if(e.backFaceCulling)return!1;let n=e._clippingPlanes;if(l(n)&&n.enabled)return!0;let i=e._clippingPolygons;return!!(l(i)&&i.enabled||!re.equals(e.cartographicLimitRectangle,re.MAX_VALUE))}var m_t=[],h_t=[],f_t=new h,CVe=new P,K3=new P,p_t=new ce,b_t=new ce,g_t=new ce,y_t=new h,VVe=new h,x_t=new h,T_t=new h,__t=[new h,new h,new h,new h];function EVe(e,t,n,i,o,r){let s=e.quadtree._occluders.ellipsoid,a=s.ellipsoid,c=__t;return h.fromRadians(n.west,n.south,o,a,c[0]),h.fromRadians(n.east,n.south,o,a,c[1]),h.fromRadians(n.west,n.north,o,a,c[2]),h.fromRadians(n.east,n.north,o,a,c[3]),s.computeHorizonCullingPointPossiblyUnderEllipsoid(t,c,i,r)}function S_t(e,t,n){let i=e.data;i===void 0&&(i=e.data=new hh);let o=e.tilingScheme.ellipsoid;i.tileBoundingRegion===void 0&&(i.tileBoundingRegion=new Ju({computeBoundingVolumes:!1,rectangle:e.rectangle,ellipsoid:o,minimumHeight:0,maximumHeight:0}));let r=i.tileBoundingRegion,s=r.minimumHeight,a=r.maximumHeight,c=!1,d=e,u=i.mesh,m=i.terrainData;if(u!==void 0&&u.minimumHeight!==void 0&&u.maximumHeight!==void 0)r.minimumHeight=u.minimumHeight,r.maximumHeight=u.maximumHeight,c=!0;else if(m!==void 0&&m._minimumHeight!==void 0&&m._maximumHeight!==void 0)r.minimumHeight=m._minimumHeight,r.maximumHeight=m._maximumHeight;else{r.minimumHeight=Number.NaN,r.maximumHeight=Number.NaN;let p=e.parent;for(;p!==void 0;){let b=p.data;if(b!==void 0){let f=b.mesh,y=b.terrainData;if(f!==void 0&&f.minimumHeight!==void 0&&f.maximumHeight!==void 0){r.minimumHeight=f.minimumHeight,r.maximumHeight=f.maximumHeight;break}else if(y!==void 0&&y._minimumHeight!==void 0&&y._maximumHeight!==void 0){r.minimumHeight=y._minimumHeight,r.maximumHeight=y._maximumHeight;break}}p=p.parent}d=p}if(d!==void 0){let p=n.verticalExaggeration,b=n.verticalExaggerationRelativeHeight;if(p!==1&&(c=!1,r.minimumHeight=_o.getHeight(r.minimumHeight,p,b),r.maximumHeight=_o.getHeight(r.maximumHeight,p,b)),c)i.boundingVolumeIsFromMesh||(r._orientedBoundingBox=nn.clone(u.orientedBoundingBox,r._orientedBoundingBox),r._boundingSphere=me.clone(u.boundingSphere3D,r._boundingSphere),i.occludeePointInScaledSpace=h.clone(u.occludeePointInScaledSpace,i.occludeePointInScaledSpace),l(i.occludeePointInScaledSpace)||(i.occludeePointInScaledSpace=EVe(t,r._orientedBoundingBox.center,e.rectangle,r.minimumHeight,r.maximumHeight,i.occludeePointInScaledSpace)));else{let y=r._orientedBoundingBox===void 0||r._boundingSphere===void 0;(r.minimumHeight!==s||r.maximumHeight!==a||y)&&(r.computeBoundingVolumes(o),i.occludeePointInScaledSpace=EVe(t,r._orientedBoundingBox.center,e.rectangle,r.minimumHeight,r.maximumHeight,i.occludeePointInScaledSpace))}i.boundingVolumeSourceTile=d,i.boundingVolumeIsFromMesh=c}else i.boundingVolumeSourceTile=void 0,i.boundingVolumeIsFromMesh=!1}function Z_t(e,t,n){return function(i){let o,r,s=-1,a=i.data.imagery,c=a.length,d;for(d=0;d<c;++d)if(o=a[d],r=o.readyImagery??o.loadingImagery,r.imageryLayer===t){s=d;break}if(s!==-1){let u=s+e;if(o=a[u],r=l(o)?o.readyImagery??o.loadingImagery:void 0,!l(r)||r.imageryLayer!==t)return!t._createTileImagerySkeletons(i,n,u);for(d=s;d<u;++d)a[d].freeResources();a.splice(s,e)}return!0}}var R_t=new P,C_t=new P;function AVe(e,t){let n={u_initialColor:function(){return this.properties.initialColor},u_fillHighlightColor:function(){return this.properties.fillHighlightColor},u_zoomedOutOceanSpecularIntensity:function(){return this.properties.zoomedOutOceanSpecularIntensity},u_oceanNormalMap:function(){return this.properties.oceanNormalMap},u_atmosphereLightIntensity:function(){return this.properties.atmosphereLightIntensity},u_atmosphereRayleighCoefficient:function(){return this.properties.atmosphereRayleighCoefficient},u_atmosphereMieCoefficient:function(){return this.properties.atmosphereMieCoefficient},u_atmosphereRayleighScaleHeight:function(){return this.properties.atmosphereRayleighScaleHeight},u_atmosphereMieScaleHeight:function(){return this.properties.atmosphereMieScaleHeight},u_atmosphereMieAnisotropy:function(){return this.properties.atmosphereMieAnisotropy},u_lightingFadeDistance:function(){return this.properties.lightingFadeDistance},u_nightFadeDistance:function(){return this.properties.nightFadeDistance},u_center3D:function(){return this.properties.center3D},u_verticalExaggerationAndRelativeHeight:function(){return this.properties.verticalExaggerationAndRelativeHeight},u_tileRectangle:function(){return this.properties.tileRectangle},u_modifiedModelView:function(){let i=e.context.uniformState.view,o=P.multiplyByPoint(i,this.properties.rtc,VVe);return P.setTranslation(i,o,CVe),CVe},u_modifiedModelViewProjection:function(){let i=e.context.uniformState.view,o=e.context.uniformState.projection,r=P.multiplyByPoint(i,this.properties.rtc,VVe);return P.setTranslation(i,r,K3),P.multiply(o,K3,K3),K3},u_dayTextures:function(){return this.properties.dayTextures},u_dayTextureTranslationAndScale:function(){return this.properties.dayTextureTranslationAndScale},u_dayTextureTexCoordsRectangle:function(){return this.properties.dayTextureTexCoordsRectangle},u_dayTextureUseWebMercatorT:function(){return this.properties.dayTextureUseWebMercatorT},u_dayTextureAlpha:function(){return this.properties.dayTextureAlpha},u_dayTextureNightAlpha:function(){return this.properties.dayTextureNightAlpha},u_dayTextureDayAlpha:function(){return this.properties.dayTextureDayAlpha},u_dayTextureBrightness:function(){return this.properties.dayTextureBrightness},u_dayTextureContrast:function(){return this.properties.dayTextureContrast},u_dayTextureHue:function(){return this.properties.dayTextureHue},u_dayTextureSaturation:function(){return this.properties.dayTextureSaturation},u_dayTextureOneOverGamma:function(){return this.properties.dayTextureOneOverGamma},u_dayIntensity:function(){return this.properties.dayIntensity},u_southAndNorthLatitude:function(){return this.properties.southAndNorthLatitude},u_southMercatorYAndOneOverHeight:function(){return this.properties.southMercatorYAndOneOverHeight},u_waterMask:function(){return this.properties.waterMask},u_waterMaskTranslationAndScale:function(){return this.properties.waterMaskTranslationAndScale},u_minMaxHeight:function(){return this.properties.minMaxHeight},u_scaleAndBias:function(){return this.properties.scaleAndBias},u_dayTextureSplit:function(){return this.properties.dayTextureSplit},u_dayTextureCutoutRectangles:function(){return this.properties.dayTextureCutoutRectangles},u_clippingPlanes:function(){let i=t._clippingPlanes;return l(i)&&l(i.texture)?i.texture:e.context.defaultTexture},u_cartographicLimitRectangle:function(){return this.properties.localizedCartographicLimitRectangle},u_clippingPlanesMatrix:function(){let i=t._clippingPlanes,o=l(i)?P.multiply(e.context.uniformState.view,i.modelMatrix,R_t):P.IDENTITY;return P.inverseTranspose(o,C_t)},u_clippingPlanesEdgeStyle:function(){let i=this.properties.clippingPlanesEdgeColor;return i.alpha=this.properties.clippingPlanesEdgeWidth,i},u_minimumBrightness:function(){return e.fog.minimumBrightness},u_hsbShift:function(){return this.properties.hsbShift},u_colorsToAlpha:function(){return this.properties.colorsToAlpha},u_frontFaceAlphaByDistance:function(){return this.properties.frontFaceAlphaByDistance},u_backFaceAlphaByDistance:function(){return this.properties.backFaceAlphaByDistance},u_translucencyRectangle:function(){return this.properties.localizedTranslucencyRectangle},u_undergroundColor:function(){return this.properties.undergroundColor},u_undergroundColorAlphaByDistance:function(){return this.properties.undergroundColorAlphaByDistance},u_lambertDiffuseMultiplier:function(){return this.properties.lambertDiffuseMultiplier},u_vertexShadowDarkness:function(){return this.properties.vertexShadowDarkness},u_vectorSegmentTexture:function(){return this.properties.vectorSegmentTexture??e.context.defaultTexture},u_vectorWidthTexture:function(){return this.properties.vectorWidthTexture??e.context.defaultTexture},u_vectorColorTexture:function(){return this.properties.vectorColorTexture??e.context.defaultTexture},u_vectorPickColorTexture:function(){return this.properties.vectorPickColorTexture??e.context.defaultTexture},u_vectorSegmentPrimitiveIndicesTexture:function(){return this.properties.vectorSegmentPrimitiveIndicesTexture??e.context.defaultTexture},u_vectorGridCellIndicesTexture:function(){return this.properties.vectorGridCellIndicesTexture??e.context.defaultTexture},u_vectorPolygonEdgeTexture:function(){return this.properties.vectorPolygonEdgeTexture??e.context.defaultTexture},u_vectorPolygonEdgePrimitiveIndicesTexture:function(){return this.properties.vectorPolygonEdgePrimitiveIndicesTexture??e.context.defaultTexture},u_vectorPolygonGridCellIndicesTexture:function(){return this.properties.vectorPolygonGridCellIndicesTexture??e.context.defaultTexture},u_vectorMetersPerUv:function(){return this.properties.vectorMetersPerUv},u_clippingEdgeTexture:function(){return this.properties.clippingEdgeTexture??e.context.defaultTexture},u_clippingEdgePrimitiveIndicesTexture:function(){return this.properties.clippingEdgePrimitiveIndicesTexture??e.context.defaultTexture},u_clippingGridCellIndicesTexture:function(){return this.properties.clippingGridCellIndicesTexture??e.context.defaultTexture},properties:{initialColor:new ce(0,0,.5,1),fillHighlightColor:new U(0,0,0,0),zoomedOutOceanSpecularIntensity:.5,oceanNormalMap:void 0,lightingFadeDistance:new k(65e5,9e6),nightFadeDistance:new k(1e7,4e7),atmosphereLightIntensity:10,atmosphereRayleighCoefficient:new h(55e-7,13e-6,284e-7),atmosphereMieCoefficient:new h(21e-6,21e-6,21e-6),atmosphereRayleighScaleHeight:1e4,atmosphereMieScaleHeight:3200,atmosphereMieAnisotropy:.9,hsbShift:new h,center3D:void 0,rtc:new h,modifiedModelView:new P,tileRectangle:new ce,verticalExaggerationAndRelativeHeight:new k(1,0),dayTextures:[],dayTextureTranslationAndScale:[],dayTextureTexCoordsRectangle:[],dayTextureUseWebMercatorT:[],dayTextureAlpha:[],dayTextureNightAlpha:[],dayTextureDayAlpha:[],dayTextureBrightness:[],dayTextureContrast:[],dayTextureHue:[],dayTextureSaturation:[],dayTextureOneOverGamma:[],dayTextureSplit:[],dayTextureCutoutRectangles:[],dayIntensity:0,colorsToAlpha:[],southAndNorthLatitude:new k,southMercatorYAndOneOverHeight:new k,waterMask:void 0,waterMaskTranslationAndScale:new ce,minMaxHeight:new k,scaleAndBias:new P,clippingPlanesEdgeColor:U.clone(U.WHITE),clippingPlanesEdgeWidth:0,localizedCartographicLimitRectangle:new ce,frontFaceAlphaByDistance:new ce,backFaceAlphaByDistance:new ce,localizedTranslucencyRectangle:new ce,undergroundColor:U.clone(U.TRANSPARENT),undergroundColorAlphaByDistance:new ce,lambertDiffuseMultiplier:0,vertexShadowDarkness:0,vectorSegmentTexture:void 0,vectorWidthTexture:void 0,vectorColorTexture:void 0,vectorPickColorTexture:void 0,vectorSegmentPrimitiveIndicesTexture:void 0,vectorGridCellIndicesTexture:void 0,vectorPolygonEdgeTexture:void 0,vectorPolygonEdgePrimitiveIndicesTexture:void 0,vectorPolygonGridCellIndicesTexture:void 0,vectorMetersPerUv:new k,clippingEdgeTexture:void 0,clippingEdgePrimitiveIndicesTexture:void 0,clippingGridCellIndicesTexture:void 0}};return l(t.materialUniformMap)?It(n,t.materialUniformMap):n}function V_t(e,t){let n=t.data,i,o;if(l(n.vertexArray)?(i=n.mesh,o=n.vertexArray):l(n.fill)&&l(n.fill.vertexArray)&&(i=n.fill.mesh,o=n.fill.vertexArray),!(!l(i)||!l(o))){if(l(n.wireframeVertexArray)){if(n.wireframeVertexArray.mesh===i)return;n.wireframeVertexArray.destroy(),n.wireframeVertexArray=void 0}n.wireframeVertexArray=E_t(e,o,i),n.wireframeVertexArray.mesh=i}}function E_t(e,t,n){let o={indices:n.indices,primitiveType:Ie.TRIANGLES};Bn.toWireframe(o);let r=o.indices,s=it.createIndexBuffer({context:e,typedArray:r,usage:Pe.STATIC_DRAW,indexDatatype:Oe.fromSizeInBytes(r.BYTES_PER_ELEMENT)});return new Un({context:e,attributes:t._attributes,indexBuffer:s})}var vVe,FVe,j3;(function(){let e=new Yt({geometry:tf.fromDimensions({dimensions:new h(2,2,2)})}),t=new Yt({geometry:new Sg({radius:1})}),n=new P,i,o;function r(s){return new In({geometryInstances:s,appearance:new Tn({translucent:!1,flat:!0}),asynchronous:!1})}vVe=function(s,a){return s===i||(j3(),i=s,n=P.fromRotationTranslation(s.halfAxes,s.center,n),e.modelMatrix=n,e.attributes.color=$t.fromColor(a),o=r(e)),o},FVe=function(s,a){return s===i||(j3(),i=s,n=P.fromTranslation(s.center,n),n=P.multiplyByUniformScale(n,s.radius,n),t.modelMatrix=n,t.attributes.color=$t.fromColor(a),o=r(t)),o},j3=function(){l(o)&&(o.destroy(),o=void 0,i=void 0)}})();var A_t=new ce(0,0,0,0),G_t={frameState:void 0,surfaceTile:void 0,numberOfDayTextures:void 0,applyBrightness:void 0,applyContrast:void 0,applyHue:void 0,applySaturation:void 0,applyGamma:void 0,applyAlpha:void 0,applyDayNightAlpha:void 0,applySplit:void 0,showReflectiveOcean:void 0,showOceanWaves:void 0,enableLighting:void 0,dynamicAtmosphereLighting:void 0,dynamicAtmosphereLightingFromSun:void 0,showGroundAtmosphere:void 0,perFragmentGroundAtmosphere:void 0,hasVertexNormals:void 0,useWebMercatorProjection:void 0,enableFog:void 0,enableClippingPlanes:void 0,clippingPlanes:void 0,enableClippingPolygons:void 0,clippingPolygons:void 0,clippedByBoundaries:void 0,hasImageryLayerCutout:void 0,colorCorrect:void 0,colorToAlpha:void 0,hasGeodeticSurfaceNormals:void 0,hasExaggeration:void 0,vectorAntialias:void 0},L_t=U.TRANSPARENT,W_t=new Kt;function v_t(e,t,n){let i=t.data;if(a_t(e,i))return;l(i.vertexArray)||(i.fill===void 0&&(i.fill=new eE(t)),i.fill.update(e,n));let o=n.creditDisplay,r=i.terrainData;if(l(r)&&l(r.credits)){let bt=r.credits;for(let ht=0,jt=bt.length;ht<jt;++ht)o.addCreditToNextFrame(bt[ht])}let s=wt.maximumTextureImageUnits,a=i.waterMaskTexture,c=i.waterMaskTranslationAndScale;!l(a)&&l(i.fill)&&(a=i.fill.waterMaskTexture,c=i.fill.waterMaskTranslationAndScale);let d=n.cameraUnderground,u=n.globeTranslucencyState,m=u.translucent,p=u.frontFaceAlphaByDistance,b=u.backFaceAlphaByDistance,f=u.rectangle,y=e.undergroundColor??L_t,_=e.undergroundColorAlphaByDistance??W_t,S=WVe(e,n)&&n.mode===se.SCENE3D&&y.alpha>0&&(_.nearValue>0||_.farValue>0),Z=e.lambertDiffuseMultiplier,R=e.vertexShadowDarkness,C=e.hasWaterMask&&l(a),E=C&&e.showWaterEffect,A=e.oceanNormalMap,L=E&&l(A),F=e.terrainProvider,I=l(F)&&e.terrainProvider.hasVertexNormals,N=n.fog.enabled&&n.fog.renderable&&!d,g=e.showGroundAtmosphere&&n.mode===se.SCENE3D,V=Wn.castShadows(e.shadows)&&!m,G=Wn.receiveShadows(e.shadows)&&!m,v=e.hueShift,X=e.saturationShift,Y=e.brightnessShift,D=!(W.equalsEpsilon(v,0,W.EPSILON7)&&W.equalsEpsilon(X,0,W.EPSILON7)&&W.equalsEpsilon(Y,0,W.EPSILON7)),M=!1;if(g){let bt=h.magnitude(n.camera.positionWC),ht=e.nightFadeOutDistance;M=bt>ht}C&&--s,L&&--s,l(n.shadowState)&&n.shadowState.shadowsEnabled&&--s,l(e.clippingPlanes)&&e.clippingPlanes.enabled&&--s,l(e.clippingPolygons)&&e.clippingPolygons.enabled&&(s-=3),s-=u.numberOfTextureUniforms;let O=i.renderedMesh,w=O.center,z=O.encoding,K=i.tileBoundingRegion,te=n.verticalExaggeration,H=n.verticalExaggerationRelativeHeight,$=te!==1,ee=z.hasGeodeticSurfaceNormals,le=p_t,_e=0,he=0,Ze=0,ye=0,Ge=!1;if(n.mode!==se.SCENE3D){let bt=n.mapProjection,ht=bt.project(re.southwest(t.rectangle),x_t),jt=bt.project(re.northeast(t.rectangle),T_t);if(le.x=ht.x,le.y=ht.y,le.z=jt.x,le.w=jt.y,n.mode!==se.MORPHING&&(w=y_t,w.x=0,w.y=(le.z+le.x)*.5,w.z=(le.w+le.y)*.5,le.x-=w.y,le.y-=w.z,le.z-=w.y,le.w-=w.z),n.mode===se.SCENE2D&&z.quantization===Ka.BITS12){let st=1/(Math.pow(2,12)-1)*.5,pt=(le.z-le.x)*st,Mi=(le.w-le.y)*st;le.x-=pt,le.y-=Mi,le.z+=pt,le.w+=Mi}bt instanceof Ti&&(_e=t.rectangle.south,he=t.rectangle.north,Ze=Ti.geodeticLatitudeToMercatorAngle(_e),ye=1/(Ti.geodeticLatitudeToMercatorAngle(he)-Ze),Ge=!0)}let Ae=G_t;Ae.frameState=n,Ae.surfaceTile=i,Ae.hasWaterMask=C,Ae.showReflectiveOcean=E,Ae.showOceanWaves=L,Ae.enableLighting=e.enableLighting,Ae.dynamicAtmosphereLighting=e.dynamicAtmosphereLighting,Ae.dynamicAtmosphereLightingFromSun=e.dynamicAtmosphereLightingFromSun,Ae.showGroundAtmosphere=g,Ae.atmosphereLightIntensity=e.atmosphereLightIntensity,Ae.atmosphereRayleighCoefficient=e.atmosphereRayleighCoefficient,Ae.atmosphereMieCoefficient=e.atmosphereMieCoefficient,Ae.atmosphereRayleighScaleHeight=e.atmosphereRayleighScaleHeight,Ae.atmosphereMieScaleHeight=e.atmosphereMieScaleHeight,Ae.atmosphereMieAnisotropy=e.atmosphereMieAnisotropy,Ae.perFragmentGroundAtmosphere=M,Ae.hasVertexNormals=I,Ae.useWebMercatorProjection=Ge,Ae.clippedByBoundaries=i.clippedByBoundaries,Ae.hasGeodeticSurfaceNormals=ee,Ae.hasExaggeration=$,Ae.vectorAntialias=e.vectorProvider.antialias;let Fe=i.imagery,tt=0,Be=Fe.length,je=e.showSkirts&&!d&&!m,qe=e.backFaceCulling&&!d&&!m,We=qe?e._renderState:e._disableCullingRenderState,Ke=qe?e._blendRenderState:e._disableCullingBlendRenderState,ct=We,Et=e._firstPassInitialColor,zt=n.context;if(l(e._debug.boundingSphereTile)||j3(),e._materialUniformMap!==e.materialUniformMap){e._materialUniformMap=e.materialUniformMap;let bt=e._drawCommands.length;for(let ht=0;ht<bt;++ht)e._uniformMaps[ht]=AVe(n,e)}do{let bt=0,ht,jt;if(e._drawCommands.length<=e._usedDrawCommands?(ht=new lt,ht.owner=t,ht.cull=!1,ht.boundingVolume=new me,ht.orientedBoundingBox=void 0,jt=AVe(n,e),e._drawCommands.push(ht),e._uniformMaps.push(jt)):(ht=e._drawCommands[e._usedDrawCommands],jt=e._uniformMaps[e._usedDrawCommands]),ht.owner=t,++e._usedDrawCommands,t===e._debug.boundingSphereTile){let Ps=K.boundingVolume,$a=K.boundingSphere;l(Ps)?vVe(Ps,U.RED).update(n):l($a)&&FVe($a,U.RED).update(n)}let st=jt.properties;ce.clone(Et,st.initialColor),st.oceanNormalMap=A,st.lightingFadeDistance.x=e.lightingFadeOutDistance,st.lightingFadeDistance.y=e.lightingFadeInDistance,st.nightFadeDistance.x=e.nightFadeOutDistance,st.nightFadeDistance.y=e.nightFadeInDistance,st.atmosphereLightIntensity=e.atmosphereLightIntensity,st.atmosphereRayleighCoefficient=e.atmosphereRayleighCoefficient,st.atmosphereMieCoefficient=e.atmosphereMieCoefficient,st.atmosphereRayleighScaleHeight=e.atmosphereRayleighScaleHeight,st.atmosphereMieScaleHeight=e.atmosphereMieScaleHeight,st.atmosphereMieAnisotropy=e.atmosphereMieAnisotropy,st.zoomedOutOceanSpecularIntensity=e.zoomedOutOceanSpecularIntensity;let pt=d?b:p,Mi=d?p:b;l(pt)&&(ce.fromElements(pt.near,pt.nearValue,pt.far,pt.farValue,st.frontFaceAlphaByDistance),ce.fromElements(Mi.near,Mi.nearValue,Mi.far,Mi.farValue,st.backFaceAlphaByDistance)),ce.fromElements(_.near,_.nearValue,_.far,_.farValue,st.undergroundColorAlphaByDistance),U.clone(y,st.undergroundColor),st.lambertDiffuseMultiplier=Z,st.vertexShadowDarkness=R;let jn=!l(i.vertexArray)&&l(e.fillHighlightColor)&&e.fillHighlightColor.alpha>0;jn&&U.clone(e.fillHighlightColor,st.fillHighlightColor),st.verticalExaggerationAndRelativeHeight.x=te,st.verticalExaggerationAndRelativeHeight.y=H,st.center3D=O.center,h.clone(w,st.rtc),ce.clone(le,st.tileRectangle),st.southAndNorthLatitude.x=_e,st.southAndNorthLatitude.y=he,st.southMercatorYAndOneOverHeight.x=Ze,st.southMercatorYAndOneOverHeight.y=ye;let Si=b_t,Hi=J3(t.rectangle,e.cartographicLimitRectangle),Gi=g_t,pi=J3(t.rectangle,f);h.fromElements(v,X,Y,st.hsbShift);let Zi=t.rectangle,On=1/Zi.width,rn=1/Zi.height;Si.x=(Hi.west-Zi.west)*On,Si.y=(Hi.south-Zi.south)*rn,Si.z=(Hi.east-Zi.west)*On,Si.w=(Hi.north-Zi.south)*rn,ce.clone(Si,st.localizedCartographicLimitRectangle),Gi.x=(pi.west-Zi.west)*On,Gi.y=(pi.south-Zi.south)*rn,Gi.z=(pi.east-Zi.west)*On,Gi.w=(pi.north-Zi.south)*rn,ce.clone(Gi,st.localizedTranslucencyRectangle);let Hn=N&&W.fog(t._distance,n.fog.density)>W.EPSILON3;D=D&&(Hn||g);let $i=!1,Po=!1,hr=!1,Is=!1,Hs=!1,or=!1,yi=!1,fr=!1,mo=!1,Qr=!1;for(;bt<s&&tt<Be;){let Ps=Fe[tt],$a=Ps.readyImagery;if(++tt,!l($a)||$a.imageryLayer.alpha===0)continue;let BT=Ps.useWebMercatorT?$a.textureWebMercator:$a.texture,si=$a.imageryLayer;l(Ps.textureTranslationAndScale)||(Ps.textureTranslationAndScale=si._calculateTextureTranslationAndScale(t,Ps)),st.dayTextures[bt]=BT,st.dayTextureTranslationAndScale[bt]=Ps.textureTranslationAndScale,st.dayTextureTexCoordsRectangle[bt]=Ps.textureCoordinateRectangle,st.dayTextureUseWebMercatorT[bt]=Ps.useWebMercatorT,st.dayTextureAlpha[bt]=si.alpha,or=or||st.dayTextureAlpha[bt]!==1,st.dayTextureNightAlpha[bt]=si.nightAlpha,yi=yi||st.dayTextureNightAlpha[bt]!==1,st.dayTextureDayAlpha[bt]=si.dayAlpha,yi=yi||st.dayTextureDayAlpha[bt]!==1,st.dayTextureBrightness[bt]=si.brightness,$i=$i||st.dayTextureBrightness[bt]!==Cs.DEFAULT_BRIGHTNESS,st.dayTextureContrast[bt]=si.contrast,Po=Po||st.dayTextureContrast[bt]!==Cs.DEFAULT_CONTRAST,st.dayTextureHue[bt]=si.hue,hr=hr||st.dayTextureHue[bt]!==Cs.DEFAULT_HUE,st.dayTextureSaturation[bt]=si.saturation,Is=Is||st.dayTextureSaturation[bt]!==Cs.DEFAULT_SATURATION,st.dayTextureOneOverGamma[bt]=1/si.gamma,Hs=Hs||st.dayTextureOneOverGamma[bt]!==1/Cs.DEFAULT_GAMMA,st.dayTextureSplit[bt]=si.splitDirection,fr=fr||st.dayTextureSplit[bt]!==0;let qo=st.dayTextureCutoutRectangles[bt];if(l(qo)||(qo=st.dayTextureCutoutRectangles[bt]=new ce),ce.clone(ce.ZERO,qo),l(si.cutoutRectangle)){let va=J3(Zi,si.cutoutRectangle),yp=re.simpleIntersection(va,Zi,LVe);mo=l(yp)||mo,qo.x=(va.west-Zi.west)*On,qo.y=(va.south-Zi.south)*rn,qo.z=(va.east-Zi.west)*On,qo.w=(va.north-Zi.south)*rn}let Gl=st.colorsToAlpha[bt];l(Gl)||(Gl=st.colorsToAlpha[bt]=new ce);let K0=l(si.colorToAlpha)&&si.colorToAlphaThreshold>0;if(Qr=Qr||K0,K0){let va=si.colorToAlpha;Gl.x=va.red,Gl.y=va.green,Gl.z=va.blue,Gl.w=si.colorToAlphaThreshold}else Gl.w=-1;if(l($a.credits)){let va=$a.credits;for(let yp=0,Ty=va.length;yp<Ty;++yp)o.addCreditToNextFrame(va[yp])}++bt}st.dayTextures.length=bt,st.waterMask=a,ce.clone(c,st.waterMaskTranslationAndScale),st.minMaxHeight.x=z.minimumHeight,st.minMaxHeight.y=z.maximumHeight,P.clone(z.matrix,st.scaleAndBias);let Mn=e._clippingPlanes,Ki=l(Mn)&&Mn.enabled&&t.isClipped;Ki&&(st.clippingPlanesEdgeColor=U.clone(Mn.edgeColor,st.clippingPlanesEdgeColor),st.clippingPlanesEdgeWidth=Mn.edgeWidth);let wi=i.vectorData;l(wi)&&(st.vectorSegmentTexture=wi.polylineSegmentTexture,st.vectorWidthTexture=wi.widthTexture,st.vectorColorTexture=wi.colorTexture,st.vectorPickColorTexture=wi.pickColorTexture,st.vectorSegmentPrimitiveIndicesTexture=wi.polylineSegmentPrimitiveIndicesTexture,st.vectorGridCellIndicesTexture=wi.polylineGridCellIndicesTexture,st.vectorPolygonEdgeTexture=wi.polygonEdgeTexture,st.vectorPolygonEdgePrimitiveIndicesTexture=wi.polygonEdgePrimitiveIndicesTexture,st.vectorPolygonGridCellIndicesTexture=wi.polygonGridCellIndicesTexture,k.clone(wi.metersPerUv,st.vectorMetersPerUv));let Xo=i.clippingPolygonData;l(Xo)&&(st.clippingEdgeTexture=Xo.polygonEdgeTexture,st.clippingEdgePrimitiveIndicesTexture=Xo.polygonEdgePrimitiveIndicesTexture,st.clippingGridCellIndicesTexture=Xo.polygonGridCellIndicesTexture);let Dc=e._clippingPolygons,pm=(Xo?.polygonRings.length??0)>0,bp=l(Dc)&&Dc.enabled&&Dc.length>0&&t.isClipped&±Ae.numberOfDayTextures=bt,Ae.applyBrightness=$i,Ae.applyContrast=Po,Ae.applyHue=hr,Ae.applySaturation=Is,Ae.applyGamma=Hs,Ae.applyAlpha=or,Ae.applyDayNightAlpha=yi,Ae.applySplit=fr,Ae.enableFog=Hn,Ae.enableClippingPlanes=Ki,Ae.clippingPlanes=Mn,Ae.enableClippingPolygons=bp,Ae.clippingPolygons=Dc,Ae.hasImageryLayerCutout=mo,Ae.colorCorrect=D,Ae.highlightFillTile=jn,Ae.colorToAlpha=Qr,Ae.showUndergroundColor=S,Ae.translucent=m;let Lh=i.renderedMesh.indices.length;je||(Lh=i.renderedMesh.indexCountWithoutSkirts),ht.shaderProgram=e._surfaceShaderSet.getShaderProgram(Ae),ht.pickId=i.vectorData?.show?"vectorPickColorOver(vec4(0.0))":void 0,ht.castShadows=V,ht.receiveShadows=G,ht.renderState=ct,ht.primitiveType=Ie.TRIANGLES,ht.vertexArray=i.vertexArray||i.fill.vertexArray,ht.count=Lh,ht.uniformMap=jt,ht.pass=Le.GLOBE,e._debug.wireframe&&(V_t(zt,t),l(i.wireframeVertexArray)&&(ht.vertexArray=i.wireframeVertexArray,ht.primitiveType=Ie.LINES,ht.count=Lh*2));let ua=ht.boundingVolume,gp=ht.orientedBoundingBox;n.mode!==se.SCENE3D?(me.fromRectangleWithHeights2D(t.rectangle,n.mapProjection,K.minimumHeight,K.maximumHeight,ua),h.fromElements(ua.center.z,ua.center.x,ua.center.y,ua.center),n.mode===se.MORPHING&&me.union(K.boundingSphere,ua,ua)):(ht.boundingVolume=me.clone(K.boundingSphere,ua),ht.orientedBoundingBox=nn.clone(K.boundingVolume,gp)),ht.dirty=!0,m&&u.updateDerivedCommands(ht,n),GVe(ht,n),ct=Ke,Et=A_t}while(tt<Be)}var EM=ste;var TKi=x(T(),1);function IVe(){this._enabled=!1,this._frontFaceAlpha=1,this._frontFaceAlphaByDistance=void 0,this._backFaceAlpha=1,this._backFaceAlphaByDistance=void 0,this._rectangle=re.clone(re.MAX_VALUE)}Object.defineProperties(IVe.prototype,{enabled:{get:function(){return this._enabled},set:function(e){this._enabled=e}},frontFaceAlpha:{get:function(){return this._frontFaceAlpha},set:function(e){this._frontFaceAlpha=e}},frontFaceAlphaByDistance:{get:function(){return this._frontFaceAlphaByDistance},set:function(e){this._frontFaceAlphaByDistance=Kt.clone(e,this._frontFaceAlphaByDistance)}},backFaceAlpha:{get:function(){return this._backFaceAlpha},set:function(e){this._backFaceAlpha=e}},backFaceAlphaByDistance:{get:function(){return this._backFaceAlphaByDistance},set:function(e){this._backFaceAlphaByDistance=Kt.clone(e,this._backFaceAlphaByDistance)}},rectangle:{get:function(){return this._rectangle},set:function(e){l(e)||(e=re.clone(re.MAX_VALUE)),re.clone(e,this._rectangle)}}});var AM=IVe;var eJi=x(T(),1);var RKi=x(T(),1);var ate=class{constructor(t){this._ellipsoid=new Hh(t.ellipsoid,h.ZERO)}get ellipsoid(){return this._ellipsoid}},GM=ate;var WKi=x(T(),1);var cte=class{constructor(t){this.maxSize=t,this.cache=new Map}get(t){if(!this.cache.has(t))return;let n=this.cache.get(t);return this.cache.delete(t),this.cache.set(t,n),n}set(t,n){if(this.cache.has(t))this.cache.delete(t);else if(this.cache.size>=this.maxSize){let i=this.cache.keys().next().value;this.cache.delete(i)}this.cache.set(t,n)}get size(){return this.cache.size}clear(){this.cache.clear()}},F_t=1e3,lte=class e{constructor(t){this._tilingScheme=t.tilingScheme,this._x=t.x,this._y=t.y,this._level=t.level,this._parent=t.parent,this._rectangle=this._tilingScheme.tileXYToRectangle(this._x,this._y,this._level),this._southwestChild=void 0,this._southeastChild=void 0,this._northwestChild=void 0,this._northeastChild=void 0,this.replacementPrevious=void 0,this.replacementNext=void 0,this._distance=0,this._loadPriority=0,this._customData=new Set,this._customDataIterator=void 0,this._addedCustomData=[],this._removedCustomData=[],this._lastSelectionResult=gi.NONE,this._lastSelectionResultFrame=void 0,this._loadedCallbacks={},this._positionCache=new cte(F_t),this.state=Ja.START,this.renderable=!1,this.upsampledFromParent=!1,this.data=void 0}static createLevelZeroTiles(t){let n=t.getNumberOfXTilesAtLevel(0),i=t.getNumberOfYTilesAtLevel(0),o=new Array(n*i),r=0;for(let s=0;s<i;++s)for(let a=0;a<n;++a)o[r++]=new e({tilingScheme:t,x:a,y:s,level:0});return o}_getCacheKey(t,n){return P_t(t.longitude,t.latitude,this._rectangle,n)}getPositionCacheEntry(t,n){return this._positionCache.get(this._getCacheKey(t,n))}setPositionCacheEntry(t,n,i){this._positionCache.set(this._getCacheKey(t,n),i)}clearPositionCache(){this._positionCache.size>0&&this._positionCache.clear()}updateCustomData(){let t=this._addedCustomData,n=this._removedCustomData;if(t.length===0&&n.length===0)return;let i=this.customData;for(let o=0;o<t.length;++o){let r=t[o];if(!l(r))continue;i.add(r);let s=PVe(this,r.positionCartographic);r._pendingAddTile=s,r._pendingAddIndex=s._addedCustomData.length,s._addedCustomData.push(r)}this._addedCustomData.length=0;for(let o=0;o<n.length;++o){let r=n[o];if(!l(r))continue;i.has(r)&&i.delete(r);let s=PVe(this,r.positionCartographic);if(r._pendingAddTile===s&&s._addedCustomData[r._pendingAddIndex]===r){s._addedCustomData[r._pendingAddIndex]=void 0,r._pendingAddTile=void 0;continue}s._removedCustomData.push(r)}this._removedCustomData.length=0}get tilingScheme(){return this._tilingScheme}get x(){return this._x}get y(){return this._y}get level(){return this._level}get parent(){return this._parent}get rectangle(){return this._rectangle}get children(){return[this.northwestChild,this.northeastChild,this.southwestChild,this.southeastChild]}get southwestChild(){return l(this._southwestChild)||(this._southwestChild=new e({tilingScheme:this.tilingScheme,x:this.x*2,y:this.y*2+1,level:this.level+1,parent:this})),this._southwestChild}get southeastChild(){return l(this._southeastChild)||(this._southeastChild=new e({tilingScheme:this.tilingScheme,x:this.x*2+1,y:this.y*2+1,level:this.level+1,parent:this})),this._southeastChild}get northwestChild(){return l(this._northwestChild)||(this._northwestChild=new e({tilingScheme:this.tilingScheme,x:this.x*2,y:this.y*2,level:this.level+1,parent:this})),this._northwestChild}get northeastChild(){return l(this._northeastChild)||(this._northeastChild=new e({tilingScheme:this.tilingScheme,x:this.x*2+1,y:this.y*2,level:this.level+1,parent:this})),this._northeastChild}get customData(){return this._customData}get needsLoading(){return this.state<Ja.DONE}get eligibleForUnloading(){let t=!0;return l(this.data)&&(t=this.data.eligibleForUnloading,l(t)||(t=!0)),t}findLevelZeroTile(t,n,i){let o=this.tilingScheme.getNumberOfXTilesAtLevel(0);if(n<0?n+=o:n>=o&&(n-=o),!(i<0||i>=this.tilingScheme.getNumberOfYTilesAtLevel(0)))return t.filter(function(r){return r.x===n&&r.y===i})[0]}findTileToWest(t){let n=this.parent;if(n===void 0)return this.findLevelZeroTile(t,this.x-1,this.y);if(n.southeastChild===this)return n.southwestChild;if(n.northeastChild===this)return n.northwestChild;let i=n.findTileToWest(t);if(i!==void 0)return n.southwestChild===this?i.southeastChild:i.northeastChild}findTileToEast(t){let n=this.parent;if(n===void 0)return this.findLevelZeroTile(t,this.x+1,this.y);if(n.southwestChild===this)return n.southeastChild;if(n.northwestChild===this)return n.northeastChild;let i=n.findTileToEast(t);if(i!==void 0)return n.southeastChild===this?i.southwestChild:i.northwestChild}findTileToSouth(t){let n=this.parent;if(n===void 0)return this.findLevelZeroTile(t,this.x,this.y+1);if(n.northwestChild===this)return n.southwestChild;if(n.northeastChild===this)return n.southeastChild;let i=n.findTileToSouth(t);if(i!==void 0)return n.southwestChild===this?i.northwestChild:i.northeastChild}findTileToNorth(t){let n=this.parent;if(n===void 0)return this.findLevelZeroTile(t,this.x,this.y-1);if(n.southwestChild===this)return n.northwestChild;if(n.southeastChild===this)return n.northeastChild;let i=n.findTileToNorth(t);if(i!==void 0)return n.northwestChild===this?i.southwestChild:i.southeastChild}freeResources(){this.clearPositionCache(),this.state=Ja.START,this.renderable=!1,this.upsampledFromParent=!1;let t=this.data;l(t)&&l(t.freeResources)&&t.freeResources(),Q3(this._southwestChild),this._southwestChild=void 0,Q3(this._southeastChild),this._southeastChild=void 0,Q3(this._northwestChild),this._northwestChild=void 0,Q3(this._northeastChild),this._northeastChild=void 0}},I_t=256;function P_t(e,t,n,i){let o=n.width/I_t*i,r=Math.floor(e/o)*o,s=Math.floor(t/o)*o;return`${r.toFixed(10)},${s.toFixed(10)}`}var X_t=new pe;function PVe(e,t){let n=e.northwestChild.rectangle,i=re.southeast(n,X_t),o=t.longitude>=i.longitude?1:0;switch((t.latitude<i.latitude?1:0)*2+o){case 0:return e.northwestChild;case 1:return e.northeastChild;case 2:return e.southwestChild;default:return e.southeastChild}}function Q3(e){l(e)&&e.freeResources()}var LM=lte;var IKi=x(T(),1);function q3(){this.head=void 0,this.tail=void 0,this.count=0,this._lastBeforeStartOfFrame=void 0}q3.prototype.markStartOfRenderFrame=function(){this._lastBeforeStartOfFrame=this.head};q3.prototype.trimTiles=function(e){let t=this.tail,n=!0;for(;n&&l(this._lastBeforeStartOfFrame)&&this.count>e&&l(t);){n=t!==this._lastBeforeStartOfFrame;let i=t.replacementPrevious;t.eligibleForUnloading&&(t.freeResources(),XVe(this,t)),t=i}};function XVe(e,t){let n=t.replacementPrevious,i=t.replacementNext;t===e._lastBeforeStartOfFrame&&(e._lastBeforeStartOfFrame=i),t===e.head?e.head=i:n.replacementNext=i,t===e.tail?e.tail=n:i.replacementPrevious=n,t.replacementPrevious=void 0,t.replacementNext=void 0,--e.count}q3.prototype.markTileRendered=function(e){let t=this.head;if(t===e){e===this._lastBeforeStartOfFrame&&(this._lastBeforeStartOfFrame=e.replacementNext);return}if(++this.count,!l(t)){e.replacementPrevious=void 0,e.replacementNext=void 0,this.head=e,this.tail=e;return}(l(e.replacementPrevious)||l(e.replacementNext))&&XVe(this,e),e.replacementPrevious=void 0,e.replacementNext=t,t.replacementPrevious=e,this.head=e};var WM=q3;function fh(e){this._tileProvider=e.tileProvider,this._tileProvider.quadtree=this,this._debug={enableDebugOutput:!1,maxDepth:0,maxDepthVisited:0,tilesVisited:0,tilesCulled:0,tilesRendered:0,tilesWaitingForChildren:0,lastMaxDepth:-1,lastMaxDepthVisited:-1,lastTilesVisited:-1,lastTilesCulled:-1,lastTilesRendered:-1,lastTilesWaitingForChildren:-1,suspendLodUpdate:!1};let n=this._tileProvider.tilingScheme.ellipsoid;this._tilesRenderedThisFrame=new Set,this._tilesToRender=[],this._tileLoadQueueHigh=[],this._tileLoadQueueMedium=[],this._tileLoadQueueLow=[],this._tileReplacementQueue=new WM,this._levelZeroTiles=void 0,this._loadQueueTimeSlice=5,this._tilesInvalidated=!1,this._addHeightCallbacks=[],this._removeHeightCallbacks=[],this._tileToUpdateHeights=[],this._updateHeightsTimeSlice=2,this._cameraPositionCartographic=void 0,this._cameraReferenceFrameOriginCartographic=void 0,this.maximumScreenSpaceError=e.maximumScreenSpaceError??2,this.tileCacheSize=e.tileCacheSize??100,this.loadingDescendantLimit=20,this.preloadAncestors=!0,this.preloadSiblings=!1,this._occluders=new GM({ellipsoid:n}),this._tileLoadProgressEvent=new Se,this._lastTileLoadQueueLength=0,this._lastSelectionFrameNumber=void 0}Object.defineProperties(fh.prototype,{tileProvider:{get:function(){return this._tileProvider}},tileLoadProgressEvent:{get:function(){return this._tileLoadProgressEvent}},occluders:{get:function(){return this._occluders}}});fh.prototype.invalidateAllTiles=function(){this._tilesInvalidated=!0};function N_t(e){let t=e._tileReplacementQueue;t.head=void 0,t.tail=void 0,t.count=0,YVe(e);let n=e._levelZeroTiles;if(l(n))for(let i=0;i<n.length;++i){let r=n[i].customData;for(let s of r)s.level=0,e._addHeightCallbacks.push(s);n[i].freeResources()}e._levelZeroTiles=void 0,e._tileProvider.cancelReprojections()}fh.prototype.forEachLoadedTile=function(e){let t=this._tileReplacementQueue.head;for(;l(t);)t.state!==Ja.START&&e(t),t=t.replacementNext};fh.prototype.forEachRenderedTile=function(e){let t=this._tilesRenderedThisFrame;for(let n of t)e(n)};fh.prototype.updateHeight=function(e,t){let n=this,i={positionOnEllipsoidSurface:void 0,positionCartographic:e,level:-1,callback:t};return i.removeFunc=function(){let o=n._addHeightCallbacks,r=o.length,s=!1;for(let a=0;a<r;++a)if(o[a]===i){o.splice(a,1),s=!0;break}s||n._removeHeightCallbacks.push(i),i.callback&&(i.callback=void 0)},n._addHeightCallbacks.push(i),i.removeFunc};fh.prototype.update=function(e){l(this._tileProvider.update)&&this._tileProvider.update(e)};function YVe(e){let t=e._debug;t.maxDepth=0,t.maxDepthVisited=0,t.tilesVisited=0,t.tilesCulled=0,t.tilesRendered=0,t.tilesWaitingForChildren=0,e._tileLoadQueueHigh.length=0,e._tileLoadQueueMedium.length=0,e._tileLoadQueueLow.length=0}fh.prototype.beginFrame=function(e){e.passes.render&&(this._tilesInvalidated&&(N_t(this),this._tilesInvalidated=!1),this._tileProvider.initialize(e),YVe(this),!this._debug.suspendLodUpdate&&(this._tileReplacementQueue.markStartOfRenderFrame(),this._tilesRenderedThisFrame.clear()))};fh.prototype.render=function(e){let t=e.passes,n=this._tileProvider;t.render&&(n.beginUpdate(e),k_t(this,e),Q_t(this,e),n.endUpdate(e)),t.pick&&this._tilesToRender.length>0&&n.updateForPick(e)};function Y_t(e,t){let n=e._tileLoadQueueHigh.length+e._tileLoadQueueMedium.length+e._tileLoadQueueLow.length;if(n!==e._lastTileLoadQueueLength||e._tilesInvalidated){let o=Se.prototype.raiseEvent.bind(e._tileLoadProgressEvent,n);t.afterRender.push(()=>(o(),!0)),e._lastTileLoadQueueLength=n}let i=e._debug;i.enableDebugOutput&&!i.suspendLodUpdate&&(i.maxDepth=e._tilesToRender.reduce(function(o,r){return Math.max(o,r.level)},-1),i.tilesRendered=e._tilesToRender.length,(i.tilesVisited!==i.lastTilesVisited||i.tilesRendered!==i.lastTilesRendered||i.tilesCulled!==i.lastTilesCulled||i.maxDepth!==i.lastMaxDepth||i.tilesWaitingForChildren!==i.lastTilesWaitingForChildren||i.maxDepthVisited!==i.lastMaxDepthVisited)&&(console.log(`Visited ${i.tilesVisited}, Rendered: ${i.tilesRendered}, Culled: ${i.tilesCulled}, Max Depth Rendered: ${i.maxDepth}, Max Depth Visited: ${i.maxDepthVisited}, Waiting for children: ${i.tilesWaitingForChildren}`),i.lastTilesVisited=i.tilesVisited,i.lastTilesRendered=i.tilesRendered,i.lastTilesCulled=i.tilesCulled,i.lastMaxDepth=i.maxDepth,i.lastTilesWaitingForChildren=i.tilesWaitingForChildren,i.lastMaxDepthVisited=i.maxDepthVisited))}fh.prototype.endFrame=function(e){!e.passes.render||e.mode===se.MORPHING||(H_t(this,e),j_t(this,e),Y_t(this,e))};fh.prototype.isDestroyed=function(){return!1};fh.prototype.destroy=function(){this._tileProvider=this._tileProvider&&this._tileProvider.destroy()};var FM,NVe=new pe;function M_t(e,t){let n=re.center(e.rectangle,NVe),i=n.longitude-FM.longitude,o=n.latitude-FM.latitude;n=re.center(t.rectangle,NVe);let r=n.longitude-FM.longitude,s=n.latitude-FM.latitude;return i*i+o*o-(r*r+s*s)}var w_t=new h,vM=[];function k_t(e,t){let n=e._debug;if(n.suspendLodUpdate)return;let i=e._tilesToRender;i.length=0;let o=e._tileProvider;if(!l(e._levelZeroTiles)){let m=o.tilingScheme;if(l(m)){let p=o.tilingScheme;e._levelZeroTiles=LM.createLevelZeroTiles(p);let b=e._levelZeroTiles.length;if(vM.length<b){vM=new Array(b);for(let f=0;f<b;++f)vM[f]===void 0&&(vM[f]=new IM)}}else return}e._occluders.ellipsoid.cameraPosition=t.camera.positionWC;let r=e._levelZeroTiles,s=r.length>1?e._occluders:void 0;FM=t.camera.positionCartographic,r.sort(M_t);let a=e._addHeightCallbacks,c=e._removeHeightCallbacks;a.forEach(m=>{let p=r.find(b=>re.contains(b.rectangle,m.positionCartographic));p&&p._addedCustomData.push(m)}),c.forEach(m=>{let p=r.find(b=>re.contains(b.rectangle,m.positionCartographic));p&&p._removedCustomData.push(m)}),r.forEach(m=>m.updateCustomData()),a.length=0,c.length=0;let d=t.camera;e._cameraPositionCartographic=d.positionCartographic;let u=P.getTranslation(d.transform,w_t);e._cameraReferenceFrameOriginCartographic=e.tileProvider.tilingScheme.ellipsoid.cartesianToCartographic(u,e._cameraReferenceFrameOriginCartographic);for(let m=0;m<r.length;++m){let p=r[m];e._tileReplacementQueue.markTileRendered(p),p.renderable?Mc(e,p,o,t,s,!1,vM[m]):(Fg(e,e._tileLoadQueueHigh,p,t),++n.tilesWaitingForChildren)}e._lastSelectionFrameNumber=t.frameNumber}function Fg(e,t,n,i){n.needsLoading&&(e.tileProvider.computeTileLoadPriority!==void 0&&(n._loadPriority=e.tileProvider.computeTileLoadPriority(n,i)),t.push(n))}function IM(){this.allAreRenderable=!0,this.anyWereRenderedLastFrame=!1,this.notYetRenderableCount=0}function MVe(){this.southwest=new IM,this.southeast=new IM,this.northwest=new IM,this.northeast=new IM}MVe.prototype.combine=function(e){let t=this.southwest,n=this.southeast,i=this.northwest,o=this.northeast;e.allAreRenderable=t.allAreRenderable&&n.allAreRenderable&&i.allAreRenderable&&o.allAreRenderable,e.anyWereRenderedLastFrame=t.anyWereRenderedLastFrame||n.anyWereRenderedLastFrame||i.anyWereRenderedLastFrame||o.anyWereRenderedLastFrame,e.notYetRenderableCount=t.notYetRenderableCount+n.notYetRenderableCount+i.notYetRenderableCount+o.notYetRenderableCount};var ute=new Array(31);for(let e=0;e<ute.length;++e)ute[e]=new MVe;function U_t(e,t,n,i,o){let r=e._debug;++r.tilesVisited,e._tileReplacementQueue.markTileRendered(n),n.updateCustomData(),n.level>r.maxDepthVisited&&(r.maxDepthVisited=n.level);let s=B_t(e,t,n)<e.maximumScreenSpaceError,a=n.southwestChild,c=n.southeastChild,d=n.northwestChild,u=n.northeastChild,m=e._lastSelectionFrameNumber,p=n._lastSelectionResultFrame===m?n._lastSelectionResult:gi.NONE,b=e.tileProvider;if(s||i){let f=gi.originalResult(p)===gi.RENDERED,y=gi.originalResult(p)===gi.CULLED||p===gi.NONE,_=n.state===Ja.DONE,S=f||y||_;if(S||l(b.canRenderWithoutLosingDetail)&&(S=b.canRenderWithoutLosingDetail(n)),S){s&&Fg(e,e._tileLoadQueueMedium,n,t),$3(e,n),o.allAreRenderable=n.renderable,o.anyWereRenderedLastFrame=p===gi.RENDERED,o.notYetRenderableCount=n.renderable?0:1,n._lastSelectionResultFrame=t.frameNumber,n._lastSelectionResult=gi.RENDERED,o.anyWereRenderedLastFrame||e._tileToUpdateHeights.push(n);return}i=!0,s&&Fg(e,e._tileLoadQueueHigh,n,t)}if(b.canRefine(n)){if(a.upsampledFromParent&&c.upsampledFromParent&&d.upsampledFromParent&&u.upsampledFromParent){$3(e,n),Fg(e,e._tileLoadQueueMedium,n,t),e._tileReplacementQueue.markTileRendered(a),e._tileReplacementQueue.markTileRendered(c),e._tileReplacementQueue.markTileRendered(d),e._tileReplacementQueue.markTileRendered(u),o.allAreRenderable=n.renderable,o.anyWereRenderedLastFrame=p===gi.RENDERED,o.notYetRenderableCount=n.renderable?0:1,n._lastSelectionResultFrame=t.frameNumber,n._lastSelectionResult=gi.RENDERED,o.anyWereRenderedLastFrame||e._tileToUpdateHeights.push(n);return}n._lastSelectionResultFrame=t.frameNumber,n._lastSelectionResult=gi.REFINED;let y=e._tilesToRender.length,_=e._tileLoadQueueLow.length,S=e._tileLoadQueueMedium.length,Z=e._tileLoadQueueHigh.length,R=e._tileToUpdateHeights.length;if(D_t(e,a,c,d,u,t,i,o),y!==e._tilesToRender.length){let C=o.allAreRenderable,E=o.anyWereRenderedLastFrame,A=o.notYetRenderableCount,L=!1;if(!C&&!E){let F=e._tilesToRender;for(let N=y;N<F.length;++N){let g=F[N];for(;g!==void 0&&g._lastSelectionResult!==gi.KICKED&&g!==n;)g._lastSelectionResult=gi.kick(g._lastSelectionResult),g=g.parent}e._tilesToRender.length=y,e._tileToUpdateHeights.length=R,$3(e,n),n._lastSelectionResult=gi.RENDERED;let I=p===gi.RENDERED;!I&&A>e.loadingDescendantLimit&&(e._tileLoadQueueLow.length=_,e._tileLoadQueueMedium.length=S,e._tileLoadQueueHigh.length=Z,Fg(e,e._tileLoadQueueMedium,n,t),o.notYetRenderableCount=n.renderable?0:1,L=!0),o.allAreRenderable=n.renderable,o.anyWereRenderedLastFrame=I,I||e._tileToUpdateHeights.push(n),++r.tilesWaitingForChildren}e.preloadAncestors&&!L&&Fg(e,e._tileLoadQueueLow,n,t)}return}n._lastSelectionResultFrame=t.frameNumber,n._lastSelectionResult=gi.RENDERED,$3(e,n),Fg(e,e._tileLoadQueueHigh,n,t),o.allAreRenderable=n.renderable,o.anyWereRenderedLastFrame=p===gi.RENDERED,o.notYetRenderableCount=n.renderable?0:1}function D_t(e,t,n,i,o,r,s,a){let c=r.camera.positionCartographic,d=e._tileProvider,u=e._occluders,m=ute[t.level],p=m.southwest,b=m.southeast,f=m.northwest,y=m.northeast;c.longitude<t.rectangle.east?c.latitude<t.rectangle.north?(Mc(e,t,d,r,u,s,p),Mc(e,n,d,r,u,s,b),Mc(e,i,d,r,u,s,f),Mc(e,o,d,r,u,s,y)):(Mc(e,i,d,r,u,s,f),Mc(e,t,d,r,u,s,p),Mc(e,o,d,r,u,s,y),Mc(e,n,d,r,u,s,b)):c.latitude<t.rectangle.north?(Mc(e,n,d,r,u,s,b),Mc(e,t,d,r,u,s,p),Mc(e,o,d,r,u,s,y),Mc(e,i,d,r,u,s,f)):(Mc(e,o,d,r,u,s,y),Mc(e,i,d,r,u,s,f),Mc(e,n,d,r,u,s,b),Mc(e,t,d,r,u,s,p)),m.combine(a)}function O_t(e,t){let n=t.rectangle;return l(e._cameraPositionCartographic)&&re.contains(n,e._cameraPositionCartographic)||l(e._cameraReferenceFrameOriginCartographic)&&re.contains(n,e._cameraReferenceFrameOriginCartographic)}function Mc(e,t,n,i,o,r,s){if(n.computeTileVisibility(t,i,o)!==Kr.NONE)return U_t(e,i,t,r,s);if(++e._debug.tilesCulled,e._tileReplacementQueue.markTileRendered(t),s.allAreRenderable=!0,s.anyWereRenderedLastFrame=!1,s.notYetRenderableCount=0,O_t(e,t)){(!l(t.data)||!l(t.data.vertexArray))&&Fg(e,e._tileLoadQueueMedium,t,i);let a=e._lastSelectionFrameNumber,c=t._lastSelectionResultFrame===a?t._lastSelectionResult:gi.NONE;c!==gi.CULLED_BUT_NEEDED&&c!==gi.RENDERED&&e._tileToUpdateHeights.push(t),t._lastSelectionResult=gi.CULLED_BUT_NEEDED}else e.preloadSiblings||t.level===0?(Fg(e,e._tileLoadQueueLow,t,i),t._lastSelectionResult=gi.CULLED):t._lastSelectionResult=gi.CULLED;t._lastSelectionResultFrame=i.frameNumber}function B_t(e,t,n){if(t.mode===se.SCENE2D||t.camera.frustum instanceof yn||t.camera.frustum instanceof ps)return z_t(e,t,n);let i=e._tileProvider.getLevelMaximumGeometricError(n.level),o=n._distance,r=t.context.drawingBufferHeight,s=t.camera.frustum.sseDenominator,a=i*r/(o*s);return t.fog.enabled&&(a-=W.fog(o,t.fog.density)*t.fog.sse),a/=t.pixelRatio,a}function z_t(e,t,n){let o=t.camera.frustum,r=o.offCenterFrustum;l(r)&&(o=r);let s=t.context,a=s.drawingBufferWidth,c=s.drawingBufferHeight,d=e._tileProvider.getLevelMaximumGeometricError(n.level),u=Math.max(o.top-o.bottom,o.right-o.left)/Math.max(a,c),m=d/u;return t.fog.enabled&&t.mode!==se.SCENE2D&&(m-=W.fog(n._distance,t.fog.density)*t.fog.sse),m/=t.pixelRatio,m}function $3(e,t){e._tilesToRender.push(t),e._tilesRenderedThisFrame.add(t)}function H_t(e,t){let n=e._tileLoadQueueHigh,i=e._tileLoadQueueMedium,o=e._tileLoadQueueLow;if(n.length===0&&i.length===0&&o.length===0)return;e._tileReplacementQueue.trimTiles(e.tileCacheSize);let r=Zn()+e._loadQueueTimeSlice,s=e._tileProvider,a=dte(e,t,s,r,n,!1);a=dte(e,t,s,r,i,a),dte(e,t,s,r,o,a)}function K_t(e,t){return e._loadPriority-t._loadPriority}function dte(e,t,n,i,o,r){n.computeTileLoadPriority!==void 0&&o.sort(K_t);for(let s=0,a=o.length;s<a&&(Zn()<i||!r);++s){let c=o[s];e._tileReplacementQueue.markTileRendered(c),n.loadTile(t,c),r=!0}return r}var tE=new gn,ez=new pe,$x=new h,J_t=[];function j_t(e,t){if(!l(e.tileProvider.tilingScheme))return;let n=J_t;n.length=0;let i=e._tileToUpdateHeights,o=Zn(),r=e._updateHeightsTimeSlice,s=o+r,a=t.mode,c=t.mapProjection,d=e.tileProvider.tilingScheme.ellipsoid,u;for(;i.length>0;){let m=i[0];if(!l(m.data)||!l(m.data.mesh)){let _=m._lastSelectionResultFrame===e._lastSelectionFrameNumber?m._lastSelectionResult:gi.NONE;(_===gi.RENDERED||_===gi.CULLED_BUT_NEEDED)&&n.push(m),m.clearPositionCache(),i.shift();continue}let p=m.customData;l(m._customDataIterator)||(m._customDataIterator=p.values());let b=m._customDataIterator,f=!1,y;for(;!(y=b.next()).done;){let _=y.value,S=m.data.terrainData,Z=l(S)&&S.wasCreatedByUpsampling();if(m.level>_.level&&!Z){let R,C=m.getPositionCacheEntry(_.positionCartographic,e.maximumScreenSpaceError);if(l(C))R=C;else{if(l(_.positionOnEllipsoidSurface)||(_.positionOnEllipsoidSurface=h.fromRadians(_.positionCartographic.longitude,_.positionCartographic.latitude,0,d)),a===se.SCENE3D){let E=d.geodeticSurfaceNormal(_.positionOnEllipsoidSurface,tE.direction),A=d.getSurfaceNormalIntersectionWithZAxis(_.positionOnEllipsoidSurface,11500,tE.origin);if(!l(A)){let L=0;l(m.data.tileBoundingRegion)&&(L=m.data.tileBoundingRegion.minimumHeight);let F=Math.min(L,-11500),I=h.multiplyByScalar(E,Math.abs(F)+1,$x);h.subtract(_.positionOnEllipsoidSurface,I,tE.origin)}}else pe.clone(_.positionCartographic,ez),ez.height=-11500,c.project(ez,$x),h.fromElements($x.z,$x.x,$x.y,$x),h.clone($x,tE.origin),h.clone(h.UNIT_X,tE.direction);R=m.data.pick(tE,a,c,!1,$x),l(R)&&m.setPositionCacheEntry(_.positionCartographic,e.maximumScreenSpaceError,h.clone(R))}if(l(R)){if(l(_.callback)){let E=d.cartesianToCartographic(R,ez);_.callback(E)}_.level=m.level}}if(Zn()>=s){f=!0;break}}if(f){m._customDataIterator=b;break}else m._customDataIterator=void 0,i.shift()}for(u=0;u<n.length;u++)i.push(n[u])}function Q_t(e,t){let n=e._tileProvider,i=e._tilesToRender;for(let o=0,r=i.length;o<r;++o){let s=i[o];n.showTileThisFrame(s,t)}}var PM=fh;function Mf(e){e=e??ne.default;let t=new h0({ellipsoid:e}),n=new uZ,i=new gg({tilingScheme:t.tilingScheme});this._ellipsoid=e,this._imageryLayerCollection=n,this._surfaceShaderSet=new CM,this._material=void 0,this._surface=new PM({tileProvider:new EM({terrainProvider:t,imageryLayers:n,surfaceShaderSet:this._surfaceShaderSet,vectorProvider:i})}),this._terrainProvider=t,this._terrainProviderChanged=new Se,this._vectorProvider=i,this._undergroundColor=U.clone(U.BLACK),this._undergroundColorAlphaByDistance=new Kt(e.maximumRadius/1e3,0,e.maximumRadius/5,1),this._translucency=new AM,hte(this),this.show=!0,this._oceanNormalMapResourceDirty=!0,this._oceanNormalMapResource=new ve({url:en("Assets/Textures/waterNormalsSmall.jpg")}),this.maximumScreenSpaceError=2,this.tileCacheSize=100,this.loadingDescendantLimit=20,this.preloadAncestors=!0,this.preloadSiblings=!1,this.fillHighlightColor=void 0,this.enableLighting=!1,this.lambertDiffuseMultiplier=.9,this.dynamicAtmosphereLighting=!0,this.dynamicAtmosphereLightingFromSun=!1,this.showGroundAtmosphere=ne.WGS84.equals(e),this.atmosphereLightIntensity=10,this.atmosphereRayleighCoefficient=new h(55e-7,13e-6,284e-7),this.atmosphereMieCoefficient=new h(21e-6,21e-6,21e-6),this.atmosphereRayleighScaleHeight=1e4,this.atmosphereMieScaleHeight=3200,this.atmosphereMieAnisotropy=.9,this.lightingFadeOutDistance=W.PI_OVER_TWO*e.minimumRadius,this.lightingFadeInDistance=W.PI*e.minimumRadius,this.nightFadeOutDistance=W.PI_OVER_TWO*e.minimumRadius,this.nightFadeInDistance=5*W.PI_OVER_TWO*e.minimumRadius,this.showWaterEffect=!0,this.depthTestAgainstTerrain=!1,this.shadows=Wn.RECEIVE_ONLY,this.atmosphereHueShift=0,this.atmosphereSaturationShift=0,this.atmosphereBrightnessShift=0,this.showSkirts=!0,this.backFaceCulling=!0,this._oceanNormalMap=void 0,this._zoomedOutOceanSpecularIntensity=void 0,this.vertexShadowDarkness=.3}Object.defineProperties(Mf.prototype,{ellipsoid:{get:function(){return this._ellipsoid}},imageryLayers:{get:function(){return this._imageryLayerCollection}},imageryLayersUpdatedEvent:{get:function(){return this._surface.tileProvider.imageryLayersUpdatedEvent}},tilesLoaded:{get:function(){return l(this._surface)?this._surface._tileLoadQueueHigh.length===0&&this._surface._tileLoadQueueMedium.length===0&&this._surface._tileLoadQueueLow.length===0:!0}},baseColor:{get:function(){return this._surface.tileProvider.baseColor},set:function(e){this._surface.tileProvider.baseColor=e}},clippingPlanes:{get:function(){return this._surface.tileProvider.clippingPlanes},set:function(e){this._surface.tileProvider.clippingPlanes=e}},clippingPolygons:{get:function(){return this._surface.tileProvider.clippingPolygons},set:function(e){this._surface.tileProvider.clippingPolygons=e}},cartographicLimitRectangle:{get:function(){return this._surface.tileProvider.cartographicLimitRectangle},set:function(e){l(e)||(e=re.clone(re.MAX_VALUE)),this._surface.tileProvider.cartographicLimitRectangle=e}},oceanNormalMapUrl:{get:function(){return this._oceanNormalMapResource.url},set:function(e){this._oceanNormalMapResource.url=e,this._oceanNormalMapResourceDirty=!0}},terrainProvider:{get:function(){return this._terrainProvider},set:function(e){e!==this._terrainProvider&&(this._terrainProvider=e,l(e)&&(this._vectorProvider.tilingScheme=e.tilingScheme),this._terrainProviderChanged.raiseEvent(e),l(this._material)&&hte(this))}},terrainProviderChanged:{get:function(){return this._terrainProviderChanged}},vectorProvider:{get:function(){return this._vectorProvider}},tileLoadProgressEvent:{get:function(){return this._surface.tileLoadProgressEvent}},material:{get:function(){return this._material},set:function(e){this._material!==e&&(this._material=e,hte(this))}},undergroundColor:{get:function(){return this._undergroundColor},set:function(e){this._undergroundColor=U.clone(e,this._undergroundColor)}},undergroundColorAlphaByDistance:{get:function(){return this._undergroundColorAlphaByDistance},set:function(e){this._undergroundColorAlphaByDistance=Kt.clone(e,this._undergroundColorAlphaByDistance)}},translucency:{get:function(){return this._translucency}}});function hte(e){let t=[],n=l(e._material)&&(l(e._material.shaderSource.match(/slope/))||l(e._material.shaderSource.match("normalEC"))),i=[Uh,_1];l(e._material)&&(!n||e._terrainProvider.hasVertexNormals)?(i.push(e._material.shaderSource),t.push("APPLY_MATERIAL"),e._surface._tileProvider.materialUniformMap=e._material._uniforms):e._surface._tileProvider.materialUniformMap=void 0,i.push(Hv),e._surfaceShaderSet.baseVertexShaderSource=new Je({sources:[Uh,_1,Kv],defines:t}),e._surfaceShaderSet.baseFragmentShaderSource=new Je({sources:i,defines:t}),e._surfaceShaderSet.material=e._material}function q_t(e){return function(t,n){let i=me.distanceSquaredTo(t.pickBoundingSphere,e),o=me.distanceSquaredTo(n.pickBoundingSphere,e);return i-o}}var $_t=[],eSt={start:0,stop:0};Mf.prototype.pickWorldCoordinates=function(e,t,n,i){n=n??!0;let o=t.mode,r=t.mapProjection,s=$_t;s.length=0;for(let d of this._surface._tilesRenderedThisFrame){let u=d.data;if(!l(u))continue;let m=u.pickBoundingSphere;if(o!==se.SCENE3D)u.pickBoundingSphere=m=me.fromRectangleWithHeights2D(d.rectangle,r,u.tileBoundingRegion.minimumHeight,u.tileBoundingRegion.maximumHeight,m),h.fromElements(m.center.z,m.center.x,m.center.y,m.center);else if(l(u.renderedMesh))me.clone(u.tileBoundingRegion.boundingSphere,m);else continue;let p=xi.raySphere(e,m,eSt);l(p)&&s.push(u)}s.sort(q_t(e.origin));let a,c=s.length;for(let d=0;d<c&&(a=s[d].pick(e,t.mode,t.mapProjection,n,i),!l(a));++d);return a};var tSt=new pe;Mf.prototype.pick=function(e,t,n){if(n=this.pickWorldCoordinates(e,t,!0,n),l(n)&&t.mode!==se.SCENE3D){n=h.fromElements(n.y,n.z,n.x,n);let i=t.mapProjection.unproject(n,tSt);n=this._ellipsoid.cartographicToCartesian(i,n)}return n};var nSt=new h,wVe=new h,iSt=new pe,oSt=new gn;function mte(e,t){return l(e)&&re.contains(e.rectangle,t)?e:void 0}Mf.prototype.getHeight=function(e){let t=this._surface._levelZeroTiles;if(!l(t))return;let n,i,o=t.length;for(i=0;i<o&&(n=t[i],!re.contains(n.rectangle,e));++i);if(i>=o)return;let r=n;for(;l(n);)n=mte(n._southwestChild,e)||mte(n._southeastChild,e)||mte(n._northwestChild,e)||n._northeastChild,l(n)&&l(n.data)&&l(n.data.renderedMesh)&&(r=n);if(n=r,!l(n)||!l(n.data)||!l(n.data.renderedMesh))return;let s=this._surface._tileProvider.tilingScheme.projection,a=this._surface._tileProvider.tilingScheme.ellipsoid,c=h.fromRadians(e.longitude,e.latitude,0,a,nSt),d=oSt,u=a.geodeticSurfaceNormal(c,d.direction),m=a.getSurfaceNormalIntersectionWithZAxis(c,11500,d.origin);if(!l(m)){let b;l(n.data.tileBoundingRegion)&&(b=n.data.tileBoundingRegion.minimumHeight);let f=Math.min(b??0,-11500),y=h.multiplyByScalar(u,Math.abs(f)+1,wVe);h.subtract(c,y,d.origin)}let p=n.data.pick(d,se.SCENE3D,s,!1,wVe);if(l(p))return a.cartesianToCartographic(p,iSt).height};Mf.prototype.update=function(e){this.show&&e.passes.render&&this._surface.update(e)};Mf.prototype.beginFrame=function(e){let t=this._surface,n=t.tileProvider,i=this.terrainProvider,o=l(i)&&i.hasWaterMask&&i.hasWaterMask;if(o&&this._oceanNormalMapResourceDirty){this._oceanNormalMapResourceDirty=!1;let a=this._oceanNormalMapResource,c=a.url;if(l(c)){let d=this;a.fetchImage().then(function(u){c===d._oceanNormalMapResource.url&&(d._oceanNormalMap=d._oceanNormalMap&&d._oceanNormalMap.destroy(),d._oceanNormalMap=new vt({context:e.context,source:u}))})}else this._oceanNormalMap=this._oceanNormalMap&&this._oceanNormalMap.destroy()}let r=e.passes,s=e.mode;r.render&&(this.showGroundAtmosphere?this._zoomedOutOceanSpecularIntensity=.4:this._zoomedOutOceanSpecularIntensity=.5,t.maximumScreenSpaceError=this.maximumScreenSpaceError,t.tileCacheSize=this.tileCacheSize,t.loadingDescendantLimit=this.loadingDescendantLimit,t.preloadAncestors=this.preloadAncestors,t.preloadSiblings=this.preloadSiblings,n.terrainProvider=this.terrainProvider,n.lightingFadeOutDistance=this.lightingFadeOutDistance,n.lightingFadeInDistance=this.lightingFadeInDistance,n.nightFadeOutDistance=this.nightFadeOutDistance,n.nightFadeInDistance=this.nightFadeInDistance,n.zoomedOutOceanSpecularIntensity=s===se.SCENE3D?this._zoomedOutOceanSpecularIntensity:0,n.hasWaterMask=o,n.showWaterEffect=this.showWaterEffect,n.oceanNormalMap=this._oceanNormalMap,n.enableLighting=this.enableLighting,n.dynamicAtmosphereLighting=this.dynamicAtmosphereLighting,n.dynamicAtmosphereLightingFromSun=this.dynamicAtmosphereLightingFromSun,n.showGroundAtmosphere=this.showGroundAtmosphere,n.atmosphereLightIntensity=this.atmosphereLightIntensity,n.atmosphereRayleighCoefficient=this.atmosphereRayleighCoefficient,n.atmosphereMieCoefficient=this.atmosphereMieCoefficient,n.atmosphereRayleighScaleHeight=this.atmosphereRayleighScaleHeight,n.atmosphereMieScaleHeight=this.atmosphereMieScaleHeight,n.atmosphereMieAnisotropy=this.atmosphereMieAnisotropy,n.shadows=this.shadows,n.hueShift=this.atmosphereHueShift,n.saturationShift=this.atmosphereSaturationShift,n.brightnessShift=this.atmosphereBrightnessShift,n.fillHighlightColor=this.fillHighlightColor,n.showSkirts=this.showSkirts,n.backFaceCulling=this.backFaceCulling,n.vertexShadowDarkness=this.vertexShadowDarkness,n.undergroundColor=this._undergroundColor,n.undergroundColorAlphaByDistance=this._undergroundColorAlphaByDistance,n.lambertDiffuseMultiplier=this.lambertDiffuseMultiplier,t.beginFrame(e))};Mf.prototype.render=function(e){this.show&&(l(this._material)&&this._material.update(e.context),this._surface.render(e))};Mf.prototype.endFrame=function(e){this.show&&e.passes.render&&this._surface.endFrame(e)};Mf.prototype.isDestroyed=function(){return!1};Mf.prototype.destroy=function(){return this._surfaceShaderSet=this._surfaceShaderSet&&this._surfaceShaderSet.destroy(),this._surface=this._surface&&this._surface.destroy(),this._oceanNormalMap=this._oceanNormalMap&&this._oceanNormalMap.destroy(),ue(this)};var XM=Mf;var Pji=x(T(),1);var jJi=x(T(),1);var kJi=x(T(),1);var IJi=x(T(),1);function rSt(e,t,n,i){this.rightAscension=e,this.declination=t,this.rotation=n,this.rotationRate=i}var NM=rSt;var eEe={},sSt=32.184,aSt=2451545,kVe=-.0529921,UVe=-.1059842,DVe=13.0120009,OVe=13.3407154,BVe=.9856003,zVe=26.4057084,HVe=13.064993,KVe=.3287146,JVe=1.7484877,jVe=-.1589763,QVe=.0036096,qVe=.1643573,$Ve=12.9590088,fte=new Q;eEe.ComputeMoon=function(e,t){l(e)||(e=Q.now()),fte=Q.addSeconds(e,sSt,fte);let n=Q.totalDays(fte)-aSt,i=n/wn.DAYS_PER_JULIAN_CENTURY,o=(125.045+kVe*n)*W.RADIANS_PER_DEGREE,r=(250.089+UVe*n)*W.RADIANS_PER_DEGREE,s=(260.008+DVe*n)*W.RADIANS_PER_DEGREE,a=(176.625+OVe*n)*W.RADIANS_PER_DEGREE,c=(357.529+BVe*n)*W.RADIANS_PER_DEGREE,d=(311.589+zVe*n)*W.RADIANS_PER_DEGREE,u=(134.963+HVe*n)*W.RADIANS_PER_DEGREE,m=(276.617+KVe*n)*W.RADIANS_PER_DEGREE,p=(34.226+JVe*n)*W.RADIANS_PER_DEGREE,b=(15.134+jVe*n)*W.RADIANS_PER_DEGREE,f=(119.743+QVe*n)*W.RADIANS_PER_DEGREE,y=(239.961+qVe*n)*W.RADIANS_PER_DEGREE,_=(25.053+$Ve*n)*W.RADIANS_PER_DEGREE,S=Math.sin(o),Z=Math.sin(r),R=Math.sin(s),C=Math.sin(a),E=Math.sin(c),A=Math.sin(d),L=Math.sin(u),F=Math.sin(m),I=Math.sin(p),N=Math.sin(b),g=Math.sin(f),V=Math.sin(y),G=Math.sin(_),v=Math.cos(o),X=Math.cos(r),Y=Math.cos(s),D=Math.cos(a),M=Math.cos(c),O=Math.cos(d),w=Math.cos(u),z=Math.cos(m),K=Math.cos(p),te=Math.cos(b),H=Math.cos(f),$=Math.cos(y),ee=Math.cos(_),le=(269.9949+.0031*i-3.8787*S-.1204*Z+.07*R-.0172*C+.0072*A-.0052*N+.0043*G)*W.RADIANS_PER_DEGREE,_e=(66.5392+.013*i+1.5419*v+.0239*X-.0278*Y+.0068*D-.0029*O+9e-4*w+8e-4*te-9e-4*ee)*W.RADIANS_PER_DEGREE,he=(38.3213+13.17635815*n-14e-13*n*n+3.561*S+.1208*Z-.0642*R+.0158*C+.0252*E-.0066*A-.0047*L-.0046*F+.0028*I+.0052*N+.004*g+.0019*V-.0044*G)*W.RADIANS_PER_DEGREE,Ze=(13.17635815-14e-13*(2*n)+3.561*v*kVe+.1208*X*UVe-.0642*Y*DVe+.0158*D*OVe+.0252*M*BVe-.0066*O*zVe-.0047*w*HVe-.0046*z*KVe+.0028*K*JVe+.0052*te*jVe+.004*H*QVe+.0019*$*qVe-.0044*ee*$Ve)/86400*W.RADIANS_PER_DEGREE;return l(t)||(t=new NM),t.rightAscension=le,t.declination=_e,t.rotation=he,t.rotationRate=Ze,t};var YM=eEe;function tEe(e){(!l(e)||typeof e!="function")&&(e=YM.ComputeMoon),this._computeFunction=e}var cSt=new h,lSt=new h,dSt=new h;function uSt(e,t,n){let i=cSt;i.x=Math.cos(e+W.PI_OVER_TWO),i.y=Math.sin(e+W.PI_OVER_TWO),i.z=0;let o=Math.cos(t),r=dSt;r.x=o*Math.cos(e),r.y=o*Math.sin(e),r.z=Math.sin(t);let s=h.cross(r,i,lSt);return l(n)||(n=new q),n[0]=i.x,n[1]=s.x,n[2]=r.x,n[3]=i.y,n[4]=s.y,n[5]=r.y,n[6]=i.z,n[7]=s.z,n[8]=r.z,n}var mSt=new q,hSt=new Ne;tEe.prototype.evaluate=function(e,t){l(e)||(e=Q.now());let n=this._computeFunction(e),i=uSt(n.rightAscension,n.declination,t),o=W.zeroToTwoPi(n.rotation),r=Ne.fromAxisAngle(h.UNIT_Z,o,hSt),s=q.fromQuaternion(Ne.conjugate(r,r),mSt);return q.multiply(s,i,i)};var MM=tEe;var Tji=x(T(),1);var pte={position:0};function tz(e){e=e??B.EMPTY_OBJECT,this.center=h.clone(e.center??h.ZERO),this._center=new h,this.radii=h.clone(e.radii),this._radii=new h,this._oneOverEllipsoidRadiiSquared=new h,this._boundingSphere=new me,this.modelMatrix=P.clone(e.modelMatrix??P.IDENTITY),this._modelMatrix=new P,this._computedModelMatrix=new P,this.show=e.show??!0,this.material=e.material??to.fromType(to.ColorType),this._material=void 0,this._translucent=void 0,this.id=e.id,this._id=void 0,this.debugShowBoundingVolume=e.debugShowBoundingVolume??!1,this.onlySunLighting=e.onlySunLighting??!1,this._onlySunLighting=!1,this._depthTestEnabled=e.depthTestEnabled??!0,this._useLogDepth=!1,this._sp=void 0,this._rs=void 0,this._va=void 0,this._pickSP=void 0,this._pickId=void 0,this._colorCommand=new lt({owner:e._owner??this}),this._pickCommand=new lt({owner:e._owner??this,pickOnly:!0});let t=this;this._uniforms={u_radii:function(){return t.radii},u_oneOverEllipsoidRadiiSquared:function(){return t._oneOverEllipsoidRadiiSquared}},this._pickUniforms={czm_pickColor:function(){return t._pickId.color}}}function fSt(e){let t=e.cache.ellipsoidPrimitive_vertexArray;if(l(t))return t;let n=Vc.createGeometry(Vc.fromDimensions({dimensions:new h(2,2,2),vertexFormat:Me.POSITION_ONLY}));return t=Un.fromGeometry({context:e,geometry:n,attributeLocations:pte,bufferUsage:Pe.STATIC_DRAW,interleave:!0}),e.cache.ellipsoidPrimitive_vertexArray=t,t}tz.prototype.update=function(e){if(!this.show||e.mode!==se.SCENE3D||!l(this.center)||!l(this.radii))return;let t=e.context,n=this.material.isTranslucent(),i=this._translucent!==n;(!l(this._rs)||i)&&(this._translucent=n,this._rs=ze.fromCache({cull:{enabled:!0,face:Ui.FRONT},depthTest:{enabled:this._depthTestEnabled},depthMask:!n&&t.fragmentDepth,blending:n?on.ALPHA_BLEND:void 0})),l(this._va)||(this._va=fSt(t));let o=!1,r=this.radii;if(!h.equals(this._radii,r)){h.clone(r,this._radii);let y=this._oneOverEllipsoidRadiiSquared;y.x=1/(r.x*r.x),y.y=1/(r.y*r.y),y.z=1/(r.z*r.z),o=!0}(!P.equals(this.modelMatrix,this._modelMatrix)||!h.equals(this.center,this._center))&&(P.clone(this.modelMatrix,this._modelMatrix),h.clone(this.center,this._center),P.multiplyByTranslation(this.modelMatrix,this.center,this._computedModelMatrix),o=!0),o&&(h.clone(h.ZERO,this._boundingSphere.center),this._boundingSphere.radius=h.maximumComponent(r),me.transform(this._boundingSphere,this._computedModelMatrix,this._boundingSphere));let s=this._material!==this.material;this._material=this.material,this._material.update(t);let a=this.onlySunLighting!==this._onlySunLighting;this._onlySunLighting=this.onlySunLighting;let c=e.useLogDepth,d=this._useLogDepth!==c;this._useLogDepth=c;let u=this._colorCommand,m,p;(s||a||i||d)&&(m=new Je({sources:[T1]}),p=new Je({sources:[this.material.shaderSource,x1]}),this.onlySunLighting&&p.defines.push("ONLY_SUN_LIGHTING"),!n&&t.fragmentDepth&&p.defines.push("WRITE_DEPTH"),this._useLogDepth&&(m.defines.push("LOG_DEPTH"),p.defines.push("LOG_DEPTH")),this._sp=tn.replaceCache({context:t,shaderProgram:this._sp,vertexShaderSource:m,fragmentShaderSource:p,attributeLocations:pte}),u.vertexArray=this._va,u.renderState=this._rs,u.shaderProgram=this._sp,u.uniformMap=It(this._uniforms,this.material._uniforms),u.executeInClosestFrustum=n);let b=e.commandList,f=e.passes;if(f.render&&(u.boundingVolume=this._boundingSphere,u.debugShowBoundingVolume=this.debugShowBoundingVolume,u.modelMatrix=this._computedModelMatrix,u.pass=n?Le.TRANSLUCENT:Le.OPAQUE,b.push(u)),f.pick){let y=this._pickCommand;(!l(this._pickId)||this._id!==this.id)&&(this._id=this.id,this._pickId=this._pickId&&this._pickId.destroy(),this._pickId=t.createPickId({primitive:this,id:this.id})),(s||a||!l(this._pickSP)||d)&&(m=new Je({sources:[T1]}),p=new Je({sources:[this.material.shaderSource,x1],pickColorQualifier:"uniform"}),this.onlySunLighting&&p.defines.push("ONLY_SUN_LIGHTING"),!n&&t.fragmentDepth&&p.defines.push("WRITE_DEPTH"),this._useLogDepth&&(m.defines.push("LOG_DEPTH"),p.defines.push("LOG_DEPTH")),this._pickSP=tn.replaceCache({context:t,shaderProgram:this._pickSP,vertexShaderSource:m,fragmentShaderSource:p,attributeLocations:pte}),y.vertexArray=this._va,y.renderState=this._rs,y.shaderProgram=this._pickSP,y.uniformMap=It(It(this._uniforms,this._pickUniforms),this.material._uniforms),y.executeInClosestFrustum=n),y.boundingVolume=this._boundingSphere,y.modelMatrix=this._computedModelMatrix,y.pass=n?Le.TRANSLUCENT:Le.OPAQUE,b.push(y)}};tz.prototype.isDestroyed=function(){return!1};tz.prototype.destroy=function(){return this._sp=this._sp&&this._sp.destroy(),this._pickSP=this._pickSP&&this._pickSP.destroy(),this._pickId=this._pickId&&this._pickId.destroy(),ue(this)};var wM=tz;function kM(e){e=e??B.EMPTY_OBJECT;let t=e.textureUrl;l(t)||(t=en("Assets/Textures/moonSmall.jpg")),this.show=e.show??!0,this.textureUrl=t,this._ellipsoid=e.ellipsoid??ne.MOON,this.onlySunLighting=e.onlySunLighting??!0,this._ellipsoidPrimitive=new wM({radii:this.ellipsoid.radii,material:to.fromType(to.ImageType),depthTestEnabled:!1,_owner:this}),this._ellipsoidPrimitive.material.translucent=!1,this._axes=new MM}Object.defineProperties(kM.prototype,{ellipsoid:{get:function(){return this._ellipsoid}}});var nz=new q,pSt=new q,bSt=new h,iz=[];kM.prototype.update=function(e){if(!this.show)return;let t=this._ellipsoidPrimitive;t.material.uniforms.image=this.textureUrl,t.onlySunLighting=this.onlySunLighting;let n=e.time;l(_t.computeIcrfToFixedMatrix(n,nz))||_t.computeTemeToPseudoFixedMatrix(n,nz);let i=this._axes.evaluate(n,pSt);q.transpose(i,i),q.multiply(nz,i,i);let o=Iy.computeMoonPositionInEarthInertialFrame(n,bSt);q.multiplyByVector(nz,o,o),P.fromRotationTranslation(i,o,t.modelMatrix);let r=e.commandList;return e.commandList=iz,iz.length=0,t.update(e),e.commandList=r,iz.length===1?iz[0]:void 0};kM.prototype.isDestroyed=function(){return!1};kM.prototype.destroy=function(){return this._ellipsoidPrimitive=this._ellipsoidPrimitive&&this._ellipsoidPrimitive.destroy(),ue(this)};var UM=kM;var Sho=x(T(),1);var Nji=x(T(),1);var bte=[],gte=[];function gSt(e,t,n,i,o,r){let s=o-i+1,a=r-o,c=bte,d=gte,u,m;for(u=0;u<s;++u)c[u]=e[i+u];for(m=0;m<a;++m)d[m]=e[o+m+1];u=0,m=0;for(let p=i;p<=r;++p){let b=c[u],f=d[m];u<s&&(m>=a||t(b,f,n)<=0)?(e[p]=b,++u):m<a&&(e[p]=f,++m)}}function yte(e,t,n,i,o){if(i>=o)return;let r=Math.floor((i+o)*.5);yte(e,t,n,i,r),yte(e,t,n,r+1,o),gSt(e,t,n,i,r,o)}function ySt(e,t,n){let i=e.length,o=Math.ceil(i*.5);bte.length=o,gte.length=o,yte(e,t,n,0,i-1),bte.length=0,gte.length=0}var p0=ySt;var zji=x(T(),1);function yl(e,t){this._occluderPosition=h.clone(e.center),this._occluderRadius=e.radius,this._horizonDistance=0,this._horizonPlaneNormal=void 0,this._horizonPlanePosition=void 0,this._cameraPosition=void 0,this.cameraPosition=t}var oz=new h;Object.defineProperties(yl.prototype,{position:{get:function(){return this._occluderPosition}},radius:{get:function(){return this._occluderRadius}},cameraPosition:{set:function(e){e=h.clone(e,this._cameraPosition);let t=h.subtract(this._occluderPosition,e,oz),n=h.magnitudeSquared(t),i=this._occluderRadius*this._occluderRadius,o,r,s;if(n>i){o=Math.sqrt(n-i),n=1/Math.sqrt(n),r=h.multiplyByScalar(t,n,oz);let a=o*o*n;s=h.add(e,h.multiplyByScalar(r,a,oz),oz)}else o=Number.MAX_VALUE;this._horizonDistance=o,this._horizonPlaneNormal=r,this._horizonPlanePosition=s,this._cameraPosition=e}}});yl.fromBoundingSphere=function(e,t,n){return l(n)?(h.clone(e.center,n._occluderPosition),n._occluderRadius=e.radius,n.cameraPosition=t,n):new yl(e,t)};var iEe=new h;yl.prototype.isPointVisible=function(e){if(this._horizonDistance!==Number.MAX_VALUE){let t=h.subtract(e,this._occluderPosition,iEe),n=this._occluderRadius;if(n=h.magnitudeSquared(t)-n*n,n>0)return n=Math.sqrt(n)+this._horizonDistance,t=h.subtract(e,this._cameraPosition,t),n*n>h.magnitudeSquared(t)}return!1};var xSt=new h;yl.prototype.isBoundingSphereVisible=function(e){let t=h.clone(e.center,xSt),n=e.radius;if(this._horizonDistance!==Number.MAX_VALUE){let i=h.subtract(t,this._occluderPosition,iEe),o=this._occluderRadius-n;if(o=h.magnitudeSquared(i)-o*o,n<this._occluderRadius)return o>0?(o=Math.sqrt(o)+this._horizonDistance,i=h.subtract(t,this._cameraPosition,i),o*o+n*n>h.magnitudeSquared(i)):!1;if(o>0){i=h.subtract(t,this._cameraPosition,i);let r=h.magnitudeSquared(i),s=this._occluderRadius*this._occluderRadius,a=n*n;return(this._horizonDistance*this._horizonDistance+s)*a>r*s?!0:(o=Math.sqrt(o)+this._horizonDistance,o*o+a>r)}return!0}return!1};var TSt=new h;yl.prototype.computeVisibility=function(e){let t=h.clone(e.center),n=e.radius;if(n>this._occluderRadius)return Kr.FULL;if(this._horizonDistance!==Number.MAX_VALUE){let i=h.subtract(t,this._occluderPosition,TSt),o=this._occluderRadius-n,r=h.magnitudeSquared(i);if(o=r-o*o,o>0){o=Math.sqrt(o)+this._horizonDistance,i=h.subtract(t,this._cameraPosition,i);let s=h.magnitudeSquared(i);return o*o+n*n<s?Kr.NONE:(o=this._occluderRadius+n,o=r-o*o,o>0?(o=Math.sqrt(o)+this._horizonDistance,s<o*o+n*n?Kr.FULL:Kr.PARTIAL):(i=h.subtract(t,this._horizonPlanePosition,i),h.dot(i,this._horizonPlaneNormal)>-n?Kr.PARTIAL:Kr.FULL))}}return Kr.NONE};var rz=new h;yl.computeOccludeePoint=function(e,t,n){let i=h.clone(t),o=h.clone(e.center),r=e.radius,s=n.length,a=h.normalize(h.subtract(i,o,rz),rz),c=-h.dot(a,o),d=yl._anyRotationVector(o,a,c),u=yl._horizonToPlaneNormalDotProduct(e,a,c,d,n[0]);if(!u)return;let m;for(let b=1;b<s;++b){if(m=yl._horizonToPlaneNormalDotProduct(e,a,c,d,n[b]),!m)return;m<u&&(u=m)}if(u<.0017453283658983088)return;let p=r/u;return h.add(o,h.multiplyByScalar(a,p,rz),rz)};var _St=[];yl.computeOccludeePointFromRectangle=function(e,t){t=t??ne.default;let n=re.subsample(e,t,0,_St),i=me.fromPoints(n),o=h.ZERO;if(!h.equals(o,i.center))return yl.computeOccludeePoint(new me(o,t.minimumRadius),i.center,n)};var SSt=new h;yl._anyRotationVector=function(e,t,n){let i=h.abs(t,SSt),o=i.x>i.y?0:1;(o===0&&i.z>i.x||o===1&&i.z>i.y)&&(o=2);let r=new h,s;o===0?(i.x=e.x,i.y=e.y+1,i.z=e.z+1,s=h.UNIT_X):o===1?(i.x=e.x+1,i.y=e.y,i.z=e.z+1,s=h.UNIT_Y):(i.x=e.x+1,i.y=e.y+1,i.z=e.z,s=h.UNIT_Z);let a=(h.dot(t,i)+n)/-h.dot(t,s);return h.normalize(h.subtract(h.add(i,h.multiplyByScalar(s,a,r),i),e,i),i)};var ZSt=new h;yl._rotationVector=function(e,t,n,i,o){let r=h.subtract(i,e,ZSt);if(r=h.normalize(r,r),h.dot(t,r)<.9999999847691291){let s=h.cross(t,r,r);if(h.magnitude(s)>W.EPSILON13)return h.normalize(s,new h)}return o};var xte=new h,RSt=new h,sz=new h,nEe=new h;yl._horizonToPlaneNormalDotProduct=function(e,t,n,i,o){let r=h.clone(o,xte),s=h.clone(e.center,RSt),a=e.radius,c=h.subtract(s,r,sz),d=h.magnitudeSquared(c),u=a*a;if(d<u)return!1;let m=d-u,p=Math.sqrt(m),f=1/Math.sqrt(d),_=p*f*p;c=h.normalize(c,c);let S=h.add(r,h.multiplyByScalar(c,_,nEe),nEe),Z=Math.sqrt(m-_*_),R=this._rotationVector(s,t,n,r,i),C=h.fromElements(R.x*R.x*c.x+(R.x*R.y-R.z)*c.y+(R.x*R.z+R.y)*c.z,(R.x*R.y+R.z)*c.x+R.y*R.y*c.y+(R.y*R.z-R.x)*c.z,(R.x*R.z-R.y)*c.x+(R.y*R.z+R.x)*c.y+R.z*R.z*c.z,xte);C=h.normalize(C,C);let E=h.multiplyByScalar(C,Z,xte);R=h.normalize(h.subtract(h.add(S,E,sz),s,sz),sz);let A=h.dot(t,R);R=h.normalize(h.subtract(h.subtract(S,E,R),s,R),R);let L=h.dot(t,R);return A<L?A:L};var DM=yl;var a4i=x(T(),1);var t4i=x(T(),1);function b0(e){e=e??B.EMPTY_OBJECT,this.left=e.left,this._left=void 0,this.right=e.right,this._right=void 0,this.top=e.top,this._top=void 0,this.bottom=e.bottom,this._bottom=void 0,this.near=e.near??1,this._near=this.near,this.far=e.far??5e8,this._far=this.far,this._cullingVolume=new $s,this._perspectiveMatrix=new P,this._infinitePerspective=new P}function Tte(e){let{top:t,bottom:n,right:i,left:o,near:r,far:s}=e;(t!==e._top||n!==e._bottom||o!==e._left||i!==e._right||r!==e._near||s!==e._far)&&(e._left=o,e._right=i,e._top=t,e._bottom=n,e._near=r,e._far=s,e._perspectiveMatrix=P.computePerspectiveOffCenter(o,i,n,t,r,s,e._perspectiveMatrix),e._infinitePerspective=P.computeInfinitePerspectiveOffCenter(o,i,n,t,r,e._infinitePerspective))}Object.defineProperties(b0.prototype,{projectionMatrix:{get:function(){return Tte(this),this._perspectiveMatrix}},infiniteProjectionMatrix:{get:function(){return Tte(this),this._infinitePerspective}}});var CSt=new h,VSt=new h,ESt=new h,ASt=new h;b0.prototype.computeCullingVolume=function(e,t,n){let i=this._cullingVolume.planes,o=this.top,r=this.bottom,s=this.right,a=this.left,c=this.near,d=this.far,u=h.cross(t,n,CSt),m=VSt;h.multiplyByScalar(t,c,m),h.add(e,m,m);let p=ESt;h.multiplyByScalar(t,d,p),h.add(e,p,p);let b=ASt;h.multiplyByScalar(u,a,b),h.add(m,b,b),h.subtract(b,e,b),h.normalize(b,b),h.cross(b,n,b),h.normalize(b,b);let f=i[0];return l(f)||(f=i[0]=new ce),f.x=b.x,f.y=b.y,f.z=b.z,f.w=-h.dot(b,e),h.multiplyByScalar(u,s,b),h.add(m,b,b),h.subtract(b,e,b),h.cross(n,b,b),h.normalize(b,b),f=i[1],l(f)||(f=i[1]=new ce),f.x=b.x,f.y=b.y,f.z=b.z,f.w=-h.dot(b,e),h.multiplyByScalar(n,r,b),h.add(m,b,b),h.subtract(b,e,b),h.cross(u,b,b),h.normalize(b,b),f=i[2],l(f)||(f=i[2]=new ce),f.x=b.x,f.y=b.y,f.z=b.z,f.w=-h.dot(b,e),h.multiplyByScalar(n,o,b),h.add(m,b,b),h.subtract(b,e,b),h.cross(b,u,b),h.normalize(b,b),f=i[3],l(f)||(f=i[3]=new ce),f.x=b.x,f.y=b.y,f.z=b.z,f.w=-h.dot(b,e),f=i[4],l(f)||(f=i[4]=new ce),f.x=t.x,f.y=t.y,f.z=t.z,f.w=-h.dot(t,m),h.negate(t,b),f=i[5],l(f)||(f=i[5]=new ce),f.x=b.x,f.y=b.y,f.z=b.z,f.w=-h.dot(b,p),this._cullingVolume};b0.prototype.getPixelDimensions=function(e,t,n,i,o){Tte(this);let r=1/this.near,s=this.top*r,a=2*i*n*s/t;s=this.right*r;let c=2*i*n*s/e;return o.x=c,o.y=a,o};b0.prototype.clone=function(e){return l(e)||(e=new b0),e.right=this.right,e.left=this.left,e.top=this.top,e.bottom=this.bottom,e.near=this.near,e.far=this.far,e._left=void 0,e._right=void 0,e._top=void 0,e._bottom=void 0,e._near=void 0,e._far=void 0,e};b0.prototype.equals=function(e){return l(e)&&e instanceof b0&&this.right===e.right&&this.left===e.left&&this.top===e.top&&this.bottom===e.bottom&&this.near===e.near&&this.far===e.far};b0.prototype.equalsEpsilon=function(e,t,n){return e===this||l(e)&&e instanceof b0&&W.equalsEpsilon(this.right,e.right,t,n)&&W.equalsEpsilon(this.left,e.left,t,n)&&W.equalsEpsilon(this.top,e.top,t,n)&&W.equalsEpsilon(this.bottom,e.bottom,t,n)&&W.equalsEpsilon(this.near,e.near,t,n)&&W.equalsEpsilon(this.far,e.far,t,n)};var ud=b0;function eu(e){e=e??B.EMPTY_OBJECT,this._offCenterFrustum=new ud,this.fov=e.fov,this._fov=void 0,this._fovy=void 0,this._sseDenominator=void 0,this.aspectRatio=e.aspectRatio,this._aspectRatio=void 0,this.near=e.near??1,this._near=this.near,this.far=e.far??5e8,this._far=this.far,this.xOffset=e.xOffset??0,this._xOffset=this.xOffset,this.yOffset=e.yOffset??0,this._yOffset=this.yOffset}eu.packedLength=6;eu.pack=function(e,t,n){return n=n??0,t[n++]=e.fov,t[n++]=e.aspectRatio,t[n++]=e.near,t[n++]=e.far,t[n++]=e.xOffset,t[n]=e.yOffset,t};eu.unpack=function(e,t,n){return t=t??0,l(n)||(n=new eu),n.fov=e[t++],n.aspectRatio=e[t++],n.near=e[t++],n.far=e[t++],n.xOffset=e[t++],n.yOffset=e[t],n};function wf(e){if(!(e.fov!==e._fov||e.aspectRatio!==e._aspectRatio||e.near!==e._near||e.far!==e._far||e.xOffset!==e._xOffset||e.yOffset!==e._yOffset))return;e._aspectRatio=e.aspectRatio,e._fov=e.fov,e._fovy=e.aspectRatio<=1?e.fov:Math.atan(Math.tan(e.fov*.5)/e.aspectRatio)*2,e._near=e.near,e._far=e.far,e._sseDenominator=2*Math.tan(.5*e._fovy),e._xOffset=e.xOffset,e._yOffset=e.yOffset;let n=e._offCenterFrustum;n.top=e.near*Math.tan(.5*e._fovy),n.bottom=-n.top,n.right=e.aspectRatio*n.top,n.left=-n.right,n.near=e.near,n.far=e.far,n.right+=e.xOffset,n.left+=e.xOffset,n.top+=e.yOffset,n.bottom+=e.yOffset}Object.defineProperties(eu.prototype,{projectionMatrix:{get:function(){return wf(this),this._offCenterFrustum.projectionMatrix}},infiniteProjectionMatrix:{get:function(){return wf(this),this._offCenterFrustum.infiniteProjectionMatrix}},fovy:{get:function(){return wf(this),this._fovy}},sseDenominator:{get:function(){return wf(this),this._sseDenominator}},offCenterFrustum:{get:function(){return wf(this),this._offCenterFrustum}}});eu.prototype.computeCullingVolume=function(e,t,n){return wf(this),this._offCenterFrustum.computeCullingVolume(e,t,n)};eu.prototype.getPixelDimensions=function(e,t,n,i,o){return wf(this),this._offCenterFrustum.getPixelDimensions(e,t,n,i,o)};eu.prototype.clone=function(e){return l(e)||(e=new eu),e.aspectRatio=this.aspectRatio,e.fov=this.fov,e.near=this.near,e.far=this.far,e._aspectRatio=void 0,e._fov=void 0,e._near=void 0,e._far=void 0,this._offCenterFrustum.clone(e._offCenterFrustum),e};eu.prototype.equals=function(e){return!l(e)||!(e instanceof eu)?!1:(wf(this),wf(e),this.fov===e.fov&&this.aspectRatio===e.aspectRatio&&this._offCenterFrustum.equals(e._offCenterFrustum))};eu.prototype.equalsEpsilon=function(e,t,n){return!l(e)||!(e instanceof eu)?!1:(wf(this),wf(e),W.equalsEpsilon(this.fov,e.fov,t,n)&&W.equalsEpsilon(this.aspectRatio,e.aspectRatio,t,n)&&this._offCenterFrustum.equalsEpsilon(e._offCenterFrustum,t,n))};var Qi=eu;var x4i=x(T(),1);function OM(){this._colorTexture=void 0,this._drawCommand=void 0}Object.defineProperties(OM.prototype,{colorTexture:{get:function(){return this._colorTexture}}});function GSt(e,t,n){let i=t.createViewportQuadCommand(Vv,{framebuffer:n,renderState:ze.fromCache({viewport:new nt(0,0,256,256)})});e._drawCommand=i}OM.prototype.update=function(e){if(!l(this._colorTexture)){let t=e.context,n=new vt({context:t,width:256,height:256,pixelFormat:Qe.RGBA,pixelDatatype:Ue.UNSIGNED_BYTE,sampler:Ot.NEAREST});this._colorTexture=n;let i=new fs({context:t,colorTextures:[n],destroyAttachments:!1});GSt(this,t,i),this._drawCommand.execute(t),i.destroy(),this._drawCommand.shaderProgram=this._drawCommand.shaderProgram&&this._drawCommand.shaderProgram.destroy()}};OM.prototype.isDestroyed=function(){return!1};OM.prototype.destroy=function(){return this._colorTexture=this._colorTexture&&this._colorTexture.destroy(),ue(this)};var BM=OM;var TQi=x(T(),1);var L4i=x(T(),1);var E4i=x(T(),1),so=Object.freeze({Linear:Object.freeze({None:function(e){return e},In:function(e){return e},Out:function(e){return e},InOut:function(e){return e}}),Quadratic:Object.freeze({In:function(e){return e*e},Out:function(e){return e*(2-e)},InOut:function(e){return(e*=2)<1?.5*e*e:-.5*(--e*(e-2)-1)}}),Cubic:Object.freeze({In:function(e){return e*e*e},Out:function(e){return--e*e*e+1},InOut:function(e){return(e*=2)<1?.5*e*e*e:.5*((e-=2)*e*e+2)}}),Quartic:Object.freeze({In:function(e){return e*e*e*e},Out:function(e){return 1- --e*e*e*e},InOut:function(e){return(e*=2)<1?.5*e*e*e*e:-.5*((e-=2)*e*e*e-2)}}),Quintic:Object.freeze({In:function(e){return e*e*e*e*e},Out:function(e){return--e*e*e*e*e+1},InOut:function(e){return(e*=2)<1?.5*e*e*e*e*e:.5*((e-=2)*e*e*e*e+2)}}),Sinusoidal:Object.freeze({In:function(e){return 1-Math.sin((1-e)*Math.PI/2)},Out:function(e){return Math.sin(e*Math.PI/2)},InOut:function(e){return .5*(1-Math.sin(Math.PI*(.5-e)))}}),Exponential:Object.freeze({In:function(e){return e===0?0:Math.pow(1024,e-1)},Out:function(e){return e===1?1:1-Math.pow(2,-10*e)},InOut:function(e){return e===0?0:e===1?1:(e*=2)<1?.5*Math.pow(1024,e-1):.5*(-Math.pow(2,-10*(e-1))+2)}}),Circular:Object.freeze({In:function(e){return 1-Math.sqrt(1-e*e)},Out:function(e){return Math.sqrt(1- --e*e)},InOut:function(e){return(e*=2)<1?-.5*(Math.sqrt(1-e*e)-1):.5*(Math.sqrt(1-(e-=2)*e)+1)}}),Elastic:Object.freeze({In:function(e){return e===0?0:e===1?1:-Math.pow(2,10*(e-1))*Math.sin((e-1.1)*5*Math.PI)},Out:function(e){return e===0?0:e===1?1:Math.pow(2,-10*e)*Math.sin((e-.1)*5*Math.PI)+1},InOut:function(e){return e===0?0:e===1?1:(e*=2,e<1?-.5*Math.pow(2,10*(e-1))*Math.sin((e-1.1)*5*Math.PI):.5*Math.pow(2,-10*(e-1))*Math.sin((e-1.1)*5*Math.PI)+1)}}),Back:Object.freeze({In:function(e){var t=1.70158;return e===1?1:e*e*((t+1)*e-t)},Out:function(e){var t=1.70158;return e===0?0:--e*e*((t+1)*e+t)+1},InOut:function(e){var t=2.5949095;return(e*=2)<1?.5*(e*e*((t+1)*e-t)):.5*((e-=2)*e*((t+1)*e+t)+2)}}),Bounce:Object.freeze({In:function(e){return 1-so.Bounce.Out(1-e)},Out:function(e){return e<.36363636363636365?7.5625*e*e:e<.7272727272727273?7.5625*(e-=.5454545454545454)*e+.75:e<.9090909090909091?7.5625*(e-=.8181818181818182)*e+.9375:7.5625*(e-=.9545454545454546)*e+.984375},InOut:function(e){return e<.5?so.Bounce.In(e*2)*.5:so.Bounce.Out(e*2-1)*.5+.5}}),generatePow:function(e){return e===void 0&&(e=4),e=e<Number.EPSILON?Number.EPSILON:e,e=e>1e4?1e4:e,{In:function(t){return Math.pow(t,e)},Out:function(t){return 1-Math.pow(1-t,e)},InOut:function(t){return t<.5?Math.pow(t*2,e)/2:(1-Math.pow(2-t*2,e))/2+.5}}}}),zM=function(){return performance.now()},LSt=(function(){function e(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];this._tweens={},this._tweensAddedDuringUpdate={},this.add.apply(this,t)}return e.prototype.getAll=function(){var t=this;return Object.keys(this._tweens).map(function(n){return t._tweens[n]})},e.prototype.removeAll=function(){this._tweens={}},e.prototype.add=function(){for(var t,n=[],i=0;i<arguments.length;i++)n[i]=arguments[i];for(var o=0,r=n;o<r.length;o++){var s=r[o];(t=s._group)===null||t===void 0||t.remove(s),s._group=this,this._tweens[s.getId()]=s,this._tweensAddedDuringUpdate[s.getId()]=s}},e.prototype.remove=function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];for(var i=0,o=t;i<o.length;i++){var r=o[i];r._group=void 0,delete this._tweens[r.getId()],delete this._tweensAddedDuringUpdate[r.getId()]}},e.prototype.allStopped=function(){return this.getAll().every(function(t){return!t.isPlaying()})},e.prototype.update=function(t,n){t===void 0&&(t=zM()),n===void 0&&(n=!0);var i=Object.keys(this._tweens);if(i.length!==0)for(;i.length>0;){this._tweensAddedDuringUpdate={};for(var o=0;o<i.length;o++){var r=this._tweens[i[o]],s=!n;r&&r.update(t,s)===!1&&!n&&this.remove(r)}i=Object.keys(this._tweensAddedDuringUpdate)}},e})(),nE={Linear:function(e,t){var n=e.length-1,i=n*t,o=Math.floor(i),r=nE.Utils.Linear;return t<0?r(e[0],e[1],i):t>1?r(e[n],e[n-1],n-i):r(e[o],e[o+1>n?n:o+1],i-o)},Bezier:function(e,t){for(var n=0,i=e.length-1,o=Math.pow,r=nE.Utils.Bernstein,s=0;s<=i;s++)n+=o(1-t,i-s)*o(t,s)*e[s]*r(i,s);return n},CatmullRom:function(e,t){var n=e.length-1,i=n*t,o=Math.floor(i),r=nE.Utils.CatmullRom;return e[0]===e[n]?(t<0&&(o=Math.floor(i=n*(1+t))),r(e[(o-1+n)%n],e[o],e[(o+1)%n],e[(o+2)%n],i-o)):t<0?e[0]-(r(e[0],e[0],e[1],e[1],-i)-e[0]):t>1?e[n]-(r(e[n],e[n],e[n-1],e[n-1],i-n)-e[n]):r(e[o?o-1:0],e[o],e[n<o+1?n:o+1],e[n<o+2?n:o+2],i-o)},Utils:{Linear:function(e,t,n){return(t-e)*n+e},Bernstein:function(e,t){var n=nE.Utils.Factorial;return n(e)/n(t)/n(e-t)},Factorial:(function(){var e=[1];return function(t){var n=1;if(e[t])return e[t];for(var i=t;i>1;i--)n*=i;return e[t]=n,n}})(),CatmullRom:function(e,t,n,i,o){var r=(n-e)*.5,s=(i-t)*.5,a=o*o,c=o*a;return(2*t-2*n+r+s)*c+(-3*t+3*n-2*r-s)*a+r*o+t}}},oEe=(function(){function e(){}return e.nextId=function(){return e._nextId++},e._nextId=0,e})(),_te=new LSt,rEe=(function(){function e(t,n){this._isPaused=!1,this._pauseStart=0,this._valuesStart={},this._valuesEnd={},this._valuesStartRepeat={},this._duration=1e3,this._isDynamic=!1,this._initialRepeat=0,this._repeat=0,this._yoyo=!1,this._isPlaying=!1,this._reversed=!1,this._delayTime=0,this._startTime=0,this._easingFunction=so.Linear.None,this._interpolationFunction=nE.Linear,this._chainedTweens=[],this._onStartCallbackFired=!1,this._onEveryStartCallbackFired=!1,this._id=oEe.nextId(),this._isChainStopped=!1,this._propertiesAreSetUp=!1,this._goToEnd=!1,this._object=t,typeof n=="object"?(this._group=n,n.add(this)):n===!0&&(this._group=_te,_te.add(this))}return e.prototype.getId=function(){return this._id},e.prototype.isPlaying=function(){return this._isPlaying},e.prototype.isPaused=function(){return this._isPaused},e.prototype.getDuration=function(){return this._duration},e.prototype.to=function(t,n){if(n===void 0&&(n=1e3),this._isPlaying)throw new Error("Can not call Tween.to() while Tween is already started or paused. Stop the Tween first.");return this._valuesEnd=t,this._propertiesAreSetUp=!1,this._duration=n<0?0:n,this},e.prototype.duration=function(t){return t===void 0&&(t=1e3),this._duration=t<0?0:t,this},e.prototype.dynamic=function(t){return t===void 0&&(t=!1),this._isDynamic=t,this},e.prototype.start=function(t,n){if(t===void 0&&(t=zM()),n===void 0&&(n=!1),this._isPlaying)return this;if(this._repeat=this._initialRepeat,this._reversed){this._reversed=!1;for(var i in this._valuesStartRepeat)this._swapEndStartRepeatValues(i),this._valuesStart[i]=this._valuesStartRepeat[i]}if(this._isPlaying=!0,this._isPaused=!1,this._onStartCallbackFired=!1,this._onEveryStartCallbackFired=!1,this._isChainStopped=!1,this._startTime=t,this._startTime+=this._delayTime,!this._propertiesAreSetUp||n){if(this._propertiesAreSetUp=!0,!this._isDynamic){var o={};for(var r in this._valuesEnd)o[r]=this._valuesEnd[r];this._valuesEnd=o}this._setupProperties(this._object,this._valuesStart,this._valuesEnd,this._valuesStartRepeat,n)}return this},e.prototype.startFromCurrentValues=function(t){return this.start(t,!0)},e.prototype._setupProperties=function(t,n,i,o,r){for(var s in i){var a=t[s],c=Array.isArray(a),d=c?"array":typeof a,u=!c&&Array.isArray(i[s]);if(!(d==="undefined"||d==="function")){if(u){var m=i[s];if(m.length===0)continue;for(var p=[a],b=0,f=m.length;b<f;b+=1){var y=this._handleRelativeValue(a,m[b]);if(isNaN(y)){u=!1,console.warn("Found invalid interpolation list. Skipping.");break}p.push(y)}u&&(i[s]=p)}if((d==="object"||c)&&a&&!u){n[s]=c?[]:{};var _=a;for(var S in _)n[s][S]=_[S];o[s]=c?[]:{};var m=i[s];if(!this._isDynamic){var Z={};for(var S in m)Z[S]=m[S];i[s]=m=Z}this._setupProperties(_,n[s],m,o[s],r)}else(typeof n[s]>"u"||r)&&(n[s]=a),c||(n[s]*=1),u?o[s]=i[s].slice().reverse():o[s]=n[s]||0}}},e.prototype.stop=function(){return this._isChainStopped||(this._isChainStopped=!0,this.stopChainedTweens()),this._isPlaying?(this._isPlaying=!1,this._isPaused=!1,this._onStopCallback&&this._onStopCallback(this._object),this):this},e.prototype.end=function(){return this._goToEnd=!0,this.update(this._startTime+this._duration),this},e.prototype.pause=function(t){return t===void 0&&(t=zM()),this._isPaused||!this._isPlaying?this:(this._isPaused=!0,this._pauseStart=t,this)},e.prototype.resume=function(t){return t===void 0&&(t=zM()),!this._isPaused||!this._isPlaying?this:(this._isPaused=!1,this._startTime+=t-this._pauseStart,this._pauseStart=0,this)},e.prototype.stopChainedTweens=function(){for(var t=0,n=this._chainedTweens.length;t<n;t++)this._chainedTweens[t].stop();return this},e.prototype.group=function(t){return t?(t.add(this),this):(console.warn("tween.group() without args has been removed, use group.add(tween) instead."),this)},e.prototype.remove=function(){var t;return(t=this._group)===null||t===void 0||t.remove(this),this},e.prototype.delay=function(t){return t===void 0&&(t=0),this._delayTime=t,this},e.prototype.repeat=function(t){return t===void 0&&(t=0),this._initialRepeat=t,this._repeat=t,this},e.prototype.repeatDelay=function(t){return this._repeatDelayTime=t,this},e.prototype.yoyo=function(t){return t===void 0&&(t=!1),this._yoyo=t,this},e.prototype.easing=function(t){return t===void 0&&(t=so.Linear.None),this._easingFunction=t,this},e.prototype.interpolation=function(t){return t===void 0&&(t=nE.Linear),this._interpolationFunction=t,this},e.prototype.chain=function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];return this._chainedTweens=t,this},e.prototype.onStart=function(t){return this._onStartCallback=t,this},e.prototype.onEveryStart=function(t){return this._onEveryStartCallback=t,this},e.prototype.onUpdate=function(t){return this._onUpdateCallback=t,this},e.prototype.onRepeat=function(t){return this._onRepeatCallback=t,this},e.prototype.onComplete=function(t){return this._onCompleteCallback=t,this},e.prototype.onStop=function(t){return this._onStopCallback=t,this},e.prototype.update=function(t,n){var i=this,o;if(t===void 0&&(t=zM()),n===void 0&&(n=e.autoStartOnUpdate),this._isPaused)return!0;var r;if(!this._goToEnd&&!this._isPlaying)if(n)this.start(t,!0);else return!1;if(this._goToEnd=!1,t<this._startTime)return!0;this._onStartCallbackFired===!1&&(this._onStartCallback&&this._onStartCallback(this._object),this._onStartCallbackFired=!0),this._onEveryStartCallbackFired===!1&&(this._onEveryStartCallback&&this._onEveryStartCallback(this._object),this._onEveryStartCallbackFired=!0);var s=t-this._startTime,a=this._duration+((o=this._repeatDelayTime)!==null&&o!==void 0?o:this._delayTime),c=this._duration+this._repeat*a,d=function(){if(i._duration===0||s>c)return 1;var y=Math.trunc(s/a),_=s-y*a,S=Math.min(_/i._duration,1);return S===0&&s===i._duration?1:S},u=d(),m=this._easingFunction(u);if(this._updateProperties(this._object,this._valuesStart,this._valuesEnd,m),this._onUpdateCallback&&this._onUpdateCallback(this._object,u),this._duration===0||s>=this._duration)if(this._repeat>0){var p=Math.min(Math.trunc((s-this._duration)/a)+1,this._repeat);isFinite(this._repeat)&&(this._repeat-=p);for(r in this._valuesStartRepeat)!this._yoyo&&typeof this._valuesEnd[r]=="string"&&(this._valuesStartRepeat[r]=this._valuesStartRepeat[r]+parseFloat(this._valuesEnd[r])),this._yoyo&&this._swapEndStartRepeatValues(r),this._valuesStart[r]=this._valuesStartRepeat[r];return this._yoyo&&(this._reversed=!this._reversed),this._startTime+=a*p,this._onRepeatCallback&&this._onRepeatCallback(this._object),this._onEveryStartCallbackFired=!1,!0}else{this._onCompleteCallback&&this._onCompleteCallback(this._object);for(var b=0,f=this._chainedTweens.length;b<f;b++)this._chainedTweens[b].start(this._startTime+this._duration,!1);return this._isPlaying=!1,!1}return!0},e.prototype._updateProperties=function(t,n,i,o){for(var r in i)if(n[r]!==void 0){var s=n[r]||0,a=i[r],c=Array.isArray(t[r]),d=Array.isArray(a),u=!c&&d;u?t[r]=this._interpolationFunction(a,o):typeof a=="object"&&a?this._updateProperties(t[r],s,a,o):(a=this._handleRelativeValue(s,a),typeof a=="number"&&(t[r]=s+(a-s)*o))}},e.prototype._handleRelativeValue=function(t,n){return typeof n!="string"?n:n.charAt(0)==="+"||n.charAt(0)==="-"?t+parseFloat(n):parseFloat(n)},e.prototype._swapEndStartRepeatValues=function(t){var n=this._valuesStartRepeat[t],i=this._valuesEnd[t];typeof i=="string"?this._valuesStartRepeat[t]=this._valuesStartRepeat[t]+parseFloat(i):this._valuesStartRepeat[t]=this._valuesEnd[t],this._valuesEnd[t]=n},e.autoStartOnUpdate=!1,e})();var T4i=oEe.nextId,g0=_te,_4i=g0.getAll.bind(g0),S4i=g0.removeAll.bind(g0),Z4i=g0.add.bind(g0),R4i=g0.remove.bind(g0),C4i=g0.update.bind(g0);var WSt={LINEAR_NONE:so.Linear.None,QUADRATIC_IN:so.Quadratic.In,QUADRATIC_OUT:so.Quadratic.Out,QUADRATIC_IN_OUT:so.Quadratic.InOut,CUBIC_IN:so.Cubic.In,CUBIC_OUT:so.Cubic.Out,CUBIC_IN_OUT:so.Cubic.InOut,QUARTIC_IN:so.Quartic.In,QUARTIC_OUT:so.Quartic.Out,QUARTIC_IN_OUT:so.Quartic.InOut,QUINTIC_IN:so.Quintic.In,QUINTIC_OUT:so.Quintic.Out,QUINTIC_IN_OUT:so.Quintic.InOut,SINUSOIDAL_IN:so.Sinusoidal.In,SINUSOIDAL_OUT:so.Sinusoidal.Out,SINUSOIDAL_IN_OUT:so.Sinusoidal.InOut,EXPONENTIAL_IN:so.Exponential.In,EXPONENTIAL_OUT:so.Exponential.Out,EXPONENTIAL_IN_OUT:so.Exponential.InOut,CIRCULAR_IN:so.Circular.In,CIRCULAR_OUT:so.Circular.Out,CIRCULAR_IN_OUT:so.Circular.InOut,ELASTIC_IN:so.Elastic.In,ELASTIC_OUT:so.Elastic.Out,ELASTIC_IN_OUT:so.Elastic.InOut,BACK_IN:so.Back.In,BACK_OUT:so.Back.Out,BACK_IN_OUT:so.Back.InOut,BOUNCE_IN:so.Bounce.In,BOUNCE_OUT:so.Bounce.Out,BOUNCE_IN_OUT:so.Bounce.InOut},As=Object.freeze(WSt);var U4i=x(T(),1);var lEe={};function vSt(e,t,n){let i,o,r;if(e instanceof Qi){let s=Math.tan(.5*e.fovy);return i=e.near,o=e.near*s,r=e.aspectRatio*o,Math.max(t*i/r,n*i/o)}else if(e instanceof ud)return i=e.near,o=e.top,r=e.right,Math.max(t*i/r,n*i/o);return Math.max(t,n)}var FSt=new h,sEe=new h;function dEe(e,t,n,i){if(l(i)&&n(.5)>i){let o=n(0),r=n(1),s=n(.5),a=s-o,c=s-r;return function(d){let u=n(d);if(d<=.5){let p=(u-o)/a;return W.lerp(e,-W.PI_OVER_TWO,p)}let m=(u-r)/c;return W.lerp(-W.PI_OVER_TWO,t,1-m)}}return function(o){return W.lerp(e,t,o)}}function Zte(e,t,n,i,o){let r=o,s=Math.max(n,i);if(!l(r)){let a=e.position,c=t,d=e.up,u=e.right,m=e.frustum,p=h.subtract(a,c,FSt),b=h.magnitude(h.multiplyByScalar(d,h.dot(p,d),sEe)),f=h.magnitude(h.multiplyByScalar(u,h.dot(p,u),sEe));r=Math.min(vSt(m,b,f)*.2,1e9)}if(s<r){let d=-Math.pow((r-n)*1e6,.125),u=Math.pow((r-i)*1e6,1/8);return function(m){let p=m*(u-d)+d;return-Math.pow(p,8)/1e6+r}}return function(a){return W.lerp(n,i,a)}}function HM(e,t){return W.equalsEpsilon(e,W.TWO_PI,W.EPSILON11)&&(e=0),t>e+Math.PI?e+=W.TWO_PI:t<e-Math.PI&&(e-=W.TWO_PI),e}var uEe=new h;function ISt(e,t,n,i,o,r,s,a){let c=e.camera,d=h.clone(c.position,uEe),u=c.pitch,m=HM(c.heading,i),p=HM(c.roll,r),b=Zte(c,n,d.z,n.z,s),f=dEe(u,o,b,a);function y(_){let S=_.time/t;c.setView({orientation:{heading:W.lerp(m,i,S),pitch:f(S),roll:W.lerp(p,r,S)}}),k.lerp(d,n,S,c.position),c.position.z=b(S)}return y}function PSt(e,t){e.longitude<t.longitude?e.longitude+=W.TWO_PI:t.longitude+=W.TWO_PI}function XSt(e,t){let n=e.longitude-t.longitude;n<-W.PI?e.longitude+=W.TWO_PI:n>W.PI&&(t.longitude+=W.TWO_PI)}var NSt=new pe,YSt=new pe;function MSt(e,t,n,i,o,r,s,a,c,d){let u=e.camera,p=e.mapProjection.ellipsoid,b=pe.clone(u.positionCartographic,NSt),f=u.pitch,y=HM(u.heading,i),_=HM(u.roll,r),S=p.cartesianToCartographic(n,YSt);b.longitude=W.zeroToTwoPi(b.longitude),S.longitude=W.zeroToTwoPi(S.longitude);let Z=!1;if(l(a)){let A=W.zeroToTwoPi(a),L=Math.min(b.longitude,S.longitude),F=Math.max(b.longitude,S.longitude),I=A>=L&&A<=F;if(l(c)){let N=Math.abs(b.longitude-S.longitude),g=W.TWO_PI-N;(I?N:g)<(I?g:N)*c&&!I&&(Z=!0)}else I||(Z=!0)}Z?PSt(b,S):XSt(b,S);let R=Zte(u,n,b.height,S.height,s),C=dEe(f,o,R,d);function E(){let A=b.longitude,L=S.longitude,F=b.latitude,I=S.latitude;return function(g){let V=g.time/t,G=h.fromRadians(W.lerp(A,L,V),W.lerp(F,I,V),R(V),p);u.setView({destination:G,orientation:{heading:W.lerp(y,i,V),pitch:C(V),roll:W.lerp(_,r,V)}})}}return E()}function wSt(e,t,n,i,o,r,s){let a=e.camera,c=h.clone(a.position,uEe),d=HM(a.heading,i),u=a.frustum.right-a.frustum.left,m=Zte(a,n,u,n.z,s);function p(b){let f=b.time/t;a.setView({orientation:{heading:W.lerp(d,i,f)}}),k.lerp(c,n,f,a.position);let y=m(f),_=a.frustum,S=_.top/_.right,Z=(y-(_.right-_.left))*.5;_.right+=Z,_.left-=Z,_.top=S*_.right,_.bottom=-_.top}return p}var aEe=new pe,kSt=new h;function Ste(e,t){return{startObject:{},stopObject:{},duration:0,complete:e,cancel:t}}function cEe(e,t){function n(){typeof t=="function"&&t(),e.enableInputs=!0}return n}lEe.createTween=function(e,t){t=t??B.EMPTY_OBJECT;let n=t.destination,i=e.mode;if(i===se.MORPHING)return Ste();let o=t.convert??!0,r=e.mapProjection,s=r.ellipsoid,a=t.maximumHeight,c=t.flyOverLongitude,d=t.flyOverLongitudeWeight,u=t.pitchAdjustHeight,m=t.easingFunction;o&&i!==se.SCENE3D&&(s.cartesianToCartographic(n,aEe),n=r.project(aEe,kSt));let p=e.camera,b=t.endTransform;l(b)&&p._setTransform(b);let f=t.duration;l(f)||(f=Math.ceil(h.distance(p.position,n)/1e6)+2,f=Math.min(f,3));let y=t.heading??0,_=t.pitch??-W.PI_OVER_TWO,S=t.roll??0,Z=e.screenSpaceCameraController;Z.enableInputs=!1;let R=cEe(Z,t.complete),C=cEe(Z,t.cancel),E=p.frustum,A=e.mode===se.SCENE2D;if(A=A&&k.equalsEpsilon(p.position,n,W.EPSILON6),A=A&&W.equalsEpsilon(Math.max(E.right-E.left,E.top-E.bottom),n.z,W.EPSILON6),A=A||e.mode!==se.SCENE2D&&h.equalsEpsilon(n,p.position,W.EPSILON10),A=A&&W.equalsEpsilon(W.negativePiToPi(y),W.negativePiToPi(p.heading),W.EPSILON10)&&W.equalsEpsilon(W.negativePiToPi(_),W.negativePiToPi(p.pitch),W.EPSILON10)&&W.equalsEpsilon(W.negativePiToPi(S),W.negativePiToPi(p.roll),W.EPSILON10),A)return Ste(R,C);let L=new Array(4);if(L[se.SCENE2D]=wSt,L[se.SCENE3D]=MSt,L[se.COLUMBUS_VIEW]=ISt,f<=0)return Ste(function(){L[i](e,1,n,y,_,S,a,c,d,u)({time:1}),typeof R=="function"&&R()},C);let F=L[i](e,f,n,y,_,S,a,c,d,u);if(!l(m)){let I=p.positionCartographic.height,N=i===se.SCENE3D?s.cartesianToCartographic(n).height:n.z;I>N&&I>11500?m=As.CUBIC_OUT:m=As.QUINTIC_IN_OUT}return{duration:f,easingFunction:m,startObject:{time:0},stopObject:{time:f},update:F,complete:R,cancel:C}};var KM=lEe;var O4i=x(T(),1),mEe={ROTATE:0,INFINITE_SCROLL:1};Object.freeze(mEe);var md=mEe;function ln(e){this._scene=e,this._transform=P.clone(P.IDENTITY),this._invTransform=P.clone(P.IDENTITY),this._actualTransform=P.clone(P.IDENTITY),this._actualInvTransform=P.clone(P.IDENTITY),this._transformChanged=!1,this.position=new h,this._position=new h,this._positionWC=new h,this._positionCartographic=new pe,this._oldPositionWC=void 0,this.positionWCDeltaMagnitude=0,this.positionWCDeltaMagnitudeLastFrame=0,this.timeSinceMoved=0,this._lastMovedTimestamp=0,this.direction=new h,this._direction=new h,this._directionWC=new h,this.up=new h,this._up=new h,this._upWC=new h,this.right=new h,this._right=new h,this._rightWC=new h,this.frustum=new Qi,this.frustum.aspectRatio=e.drawingBufferWidth/e.drawingBufferHeight,this.frustum.fov=W.toRadians(60),this.defaultMoveAmount=1e5,this.defaultLookAmount=Math.PI/60,this.defaultRotateAmount=Math.PI/3600,this.defaultZoomAmount=1e5,this.constrainedAxis=void 0,this.maximumZoomFactor=1.5,this._moveStart=new Se,this._moveEnd=new Se,this._changed=new Se,this._changedPosition=void 0,this._changedDirection=void 0,this._changedFrustum=void 0,this._changedHeading=void 0,this._changedRoll=void 0,this.percentageChanged=.5,this._viewMatrix=new P,this._invViewMatrix=new P,ZEe(this),this._mode=se.SCENE3D,this._modeChanged=!0;let t=e.mapProjection;this._projection=t,this._maxCoord=t.project(new pe(Math.PI,W.PI_OVER_TWO)),this._max2Dfrustum=void 0,PEe(this,ln.DEFAULT_VIEW_RECTANGLE,this.position,!0);let n=h.magnitude(this.position);n+=n*ln.DEFAULT_VIEW_FACTOR,h.normalize(this.position,this.position),h.multiplyByScalar(this.position,n,this.position)}ln.TRANSFORM_2D=new P(0,0,1,0,1,0,0,0,0,1,0,0,0,0,0,1);ln.TRANSFORM_2D_INVERSE=P.inverseTransformation(ln.TRANSFORM_2D,new P);ln.DEFAULT_VIEW_RECTANGLE=re.fromDegrees(-95,-20,-70,90);ln.DEFAULT_VIEW_FACTOR=.5;ln.DEFAULT_OFFSET=new Am(0,-W.PI_OVER_FOUR,0);function ZEe(e){P.computeView(e._position,e._direction,e._up,e._right,e._viewMatrix),P.multiply(e._viewMatrix,e._actualInvTransform,e._viewMatrix),P.inverseTransformation(e._viewMatrix,e._invViewMatrix)}function USt(e){if(!l(e._oldPositionWC))e._oldPositionWC=h.clone(e.positionWC,e._oldPositionWC);else{e.positionWCDeltaMagnitudeLastFrame=e.positionWCDeltaMagnitude;let t=h.subtract(e.positionWC,e._oldPositionWC,e._oldPositionWC);e.positionWCDeltaMagnitude=h.magnitude(t),e._oldPositionWC=h.clone(e.positionWC,e._oldPositionWC),e.positionWCDeltaMagnitude>0?(e.timeSinceMoved=0,e._lastMovedTimestamp=Zn()):e.timeSinceMoved=Math.max(Zn()-e._lastMovedTimestamp,0)/1e3}}ln.prototype.canPreloadFlight=function(){return l(this._currentFlight)&&this._mode!==se.SCENE2D};ln.prototype._updateCameraChanged=function(){let e=this;if(USt(e),e._changed.numberOfListeners===0)return;let t=e.percentageChanged,n=e.heading;l(e._changedHeading)||(e._changedHeading=n);let i=Math.abs(e._changedHeading-n)%W.TWO_PI;i=i>W.PI?W.TWO_PI-i:i;let o=i/Math.PI;o>t&&(e._changedHeading=n);let r=e.roll;l(e._changedRoll)||(e._changedRoll=r);let s=Math.abs(e._changedRoll-r)%W.TWO_PI;s=s>W.PI?W.TWO_PI-s:s;let a=s/Math.PI;if(a>t&&(e._changedRoll=r),(a>t||o>t)&&e._changed.raiseEvent(Math.max(a,o)),e._mode===se.SCENE2D){if(!l(e._changedFrustum)){e._changedPosition=h.clone(e.position,e._changedPosition),e._changedFrustum=e.frustum.clone();return}let p=e.position,b=e._changedPosition,f=e.frustum,y=e._changedFrustum,_=p.x+f.left,S=p.x+f.right,Z=b.x+y.left,R=b.x+y.right,C=p.y+f.bottom,E=p.y+f.top,A=b.y+y.bottom,L=b.y+y.top,F=Math.max(_,Z),I=Math.min(S,R),N=Math.max(C,A),g=Math.min(E,L),V;if(F>=I||N>=E)V=1;else{let G=y;_<Z&&S>R&&C<A&&E>L&&(G=f),V=1-(I-F)*(g-N)/((G.right-G.left)*(G.top-G.bottom))}V>t&&(e._changed.raiseEvent(V),e._changedPosition=h.clone(e.position,e._changedPosition),e._changedFrustum=e.frustum.clone(e._changedFrustum));return}if(!l(e._changedDirection)){e._changedPosition=h.clone(e.positionWC,e._changedPosition),e._changedDirection=h.clone(e.directionWC,e._changedDirection);return}let c=W.acosClamped(h.dot(e.directionWC,e._changedDirection)),d;l(e.frustum.fovy)?d=c/(e.frustum.fovy*.5):d=c;let m=h.distance(e.positionWC,e._changedPosition)/e.positionCartographic.height;(d>t||m>t)&&(e._changed.raiseEvent(Math.max(d,m)),e._changedPosition=h.clone(e.positionWC,e._changedPosition),e._changedDirection=h.clone(e.directionWC,e._changedDirection))};function DSt(e){_t.basisTo2D(e._projection,e._transform,e._actualTransform)}var OSt=new pe,BSt=new h,az=new h,zSt=new ce,HSt=new ce,KSt=new ce,JSt=new ce,jSt=new ce;function QSt(e){let t=e._projection,n=t.ellipsoid,i=P.getColumn(e._transform,3,zSt),o=n.cartesianToCartographic(i,OSt),r=t.project(o,BSt),s=HSt;s.x=r.z,s.y=r.x,s.z=r.y,s.w=1;let a=ce.clone(ce.UNIT_X,jSt),c=ce.add(P.getColumn(e._transform,0,az),i,az);n.cartesianToCartographic(c,o),t.project(o,r);let d=KSt;d.x=r.z,d.y=r.x,d.z=r.y,d.w=0,h.subtract(d,s,d),d.x=0;let u=JSt;if(h.magnitudeSquared(d)>W.EPSILON10)h.cross(a,d,u);else{let m=ce.add(P.getColumn(e._transform,1,az),i,az);n.cartesianToCartographic(m,o),t.project(o,r),u.x=r.z,u.y=r.x,u.z=r.y,u.w=0,h.subtract(u,s,u),u.x=0,h.magnitudeSquared(u)<W.EPSILON10&&(ce.clone(ce.UNIT_Y,d),ce.clone(ce.UNIT_Z,u))}h.cross(u,a,d),h.normalize(d,d),h.cross(a,d,u),h.normalize(u,u),P.setColumn(e._actualTransform,0,d,e._actualTransform),P.setColumn(e._actualTransform,1,u,e._actualTransform),P.setColumn(e._actualTransform,2,a,e._actualTransform),P.setColumn(e._actualTransform,3,s,e._actualTransform)}var Rte=new h;function Tl(e){let t=e._mode,n=!1,i=0;t===se.SCENE2D&&(i=e.frustum.right-e.frustum.left,n=i!==e._positionCartographic.height);let o=e._position,r=!h.equals(o,e.position)||n;r&&(o=h.clone(e.position,e._position));let s=e._direction,a=!h.equals(s,e.direction);a&&(h.normalize(e.direction,e.direction),s=h.clone(e.direction,e._direction));let c=e._up,d=!h.equals(c,e.up);d&&(h.normalize(e.up,e.up),c=h.clone(e.up,e._up));let u=e._right,m=!h.equals(u,e.right);m&&(h.normalize(e.right,e.right),u=h.clone(e.right,e._right));let p=e._transformChanged||e._modeChanged;e._transformChanged=!1,p&&(P.inverseTransformation(e._transform,e._invTransform),e._mode===se.COLUMBUS_VIEW||e._mode===se.SCENE2D?P.equals(P.IDENTITY,e._transform)?P.clone(ln.TRANSFORM_2D,e._actualTransform):e._mode===se.COLUMBUS_VIEW?DSt(e):QSt(e):P.clone(e._transform,e._actualTransform),P.inverseTransformation(e._actualTransform,e._actualInvTransform),e._modeChanged=!1);let b=e._actualTransform;if(r||p)if(e._positionWC=P.multiplyByPoint(b,o,e._positionWC),t===se.SCENE3D||t===se.MORPHING)e._positionCartographic=e._projection.ellipsoid.cartesianToCartographic(e._positionWC,e._positionCartographic);else{let f=Rte;f.x=e._positionWC.y,f.y=e._positionWC.z,f.z=e._positionWC.x,t===se.SCENE2D&&(f.z=i),e._projection.unproject(f,e._positionCartographic)}if(a||d||m){let f=h.dot(s,h.cross(c,u,Rte));if(Math.abs(1-f)>W.EPSILON2){let y=1/h.magnitudeSquared(c),_=h.dot(c,s)*y,S=h.multiplyByScalar(s,_,Rte);c=h.normalize(h.subtract(c,S,e._up),e._up),h.clone(c,e.up),u=h.cross(s,c,e._right),h.clone(u,e.right)}}(a||p)&&(e._directionWC=P.multiplyByPointAsVector(b,s,e._directionWC),h.normalize(e._directionWC,e._directionWC)),(d||p)&&(e._upWC=P.multiplyByPointAsVector(b,c,e._upWC),h.normalize(e._upWC,e._upWC)),(m||p)&&(e._rightWC=P.multiplyByPointAsVector(b,u,e._rightWC),h.normalize(e._rightWC,e._rightWC)),(r||a||d||m||p)&&ZEe(e)}function REe(e,t){let n;return W.equalsEpsilon(Math.abs(e.z),1,W.EPSILON3)?n=Math.atan2(t.y,t.x)-W.PI_OVER_TWO:n=Math.atan2(e.y,e.x)-W.PI_OVER_TWO,W.TWO_PI-W.zeroToTwoPi(n)}function CEe(e){return W.PI_OVER_TWO-W.acosClamped(e.z)}function VEe(e,t,n){let i=0;return W.equalsEpsilon(Math.abs(e.z),1,W.EPSILON3)||(i=Math.atan2(-n.z,t.z),i=W.zeroToTwoPi(i+W.TWO_PI)),i}var dz=new P,uz=new P;Object.defineProperties(ln.prototype,{transform:{get:function(){return this._transform}},inverseTransform:{get:function(){return Tl(this),this._invTransform}},viewMatrix:{get:function(){return Tl(this),this._viewMatrix}},inverseViewMatrix:{get:function(){return Tl(this),this._invViewMatrix}},positionCartographic:{get:function(){return Tl(this),this._positionCartographic}},positionWC:{get:function(){return Tl(this),this._positionWC}},directionWC:{get:function(){return Tl(this),this._directionWC}},upWC:{get:function(){return Tl(this),this._upWC}},rightWC:{get:function(){return Tl(this),this._rightWC}},heading:{get:function(){if(this._mode!==se.MORPHING){let e=this._projection.ellipsoid,t=P.clone(this._transform,dz),n=_t.eastNorthUpToFixedFrame(this.positionWC,e,uz);this._setTransform(n);let i=REe(this.direction,this.up);return this._setTransform(t),i}}},pitch:{get:function(){if(this._mode!==se.MORPHING){let e=this._projection.ellipsoid,t=P.clone(this._transform,dz),n=_t.eastNorthUpToFixedFrame(this.positionWC,e,uz);this._setTransform(n);let i=CEe(this.direction);return this._setTransform(t),i}}},roll:{get:function(){if(this._mode!==se.MORPHING){let e=this._projection.ellipsoid,t=P.clone(this._transform,dz),n=_t.eastNorthUpToFixedFrame(this.positionWC,e,uz);this._setTransform(n);let i=VEe(this.direction,this.up,this.right);return this._setTransform(t),i}}},moveStart:{get:function(){return this._moveStart}},moveEnd:{get:function(){return this._moveEnd}},changed:{get:function(){return this._changed}}});ln.prototype.update=function(e){let t=!1;if(e!==this._mode&&(this._mode=e,this._modeChanged=e!==se.MORPHING,t=this._mode===se.SCENE2D),t){let n=this._max2Dfrustum=this.frustum.clone(),i=2,o=n.top/n.right;n.right=this._maxCoord.x*i,n.left=-n.right,n.top=o*n.right,n.bottom=-n.top}this._mode===se.SCENE2D&&LEe(this,this.position)};var qSt=new h,$St=new h,eZt=new h;ln.prototype._setTransform=function(e){let t=h.clone(this.positionWC,qSt),n=h.clone(this.upWC,$St),i=h.clone(this.directionWC,eZt);P.clone(e,this._transform),this._transformChanged=!0,Tl(this);let o=this._actualInvTransform;P.multiplyByPoint(o,t,this.position),P.multiplyByPointAsVector(o,i,this.direction),P.multiplyByPointAsVector(o,n,this.up),h.cross(this.direction,this.up,this.right),Tl(this)};var tZt=new k,nZt=new gn,iZt=new h,oZt=new h;function EEe(e){if(!P.equals(P.IDENTITY,e.transform))return h.magnitude(e.position);let t=e._scene,n=t.globe,i=tZt;i.x=t.drawingBufferWidth/t.pixelRatio/2,i.y=t.drawingBufferHeight/t.pixelRatio/2;let o;if(l(n)){let a=e.getPickRay(i,nZt);o=n.pickWorldCoordinates(a,t,!0,iZt)}let r;t.pickPositionSupported&&(r=t.pickPositionWorldCoordinates(i,oZt));let s;if(l(o)||l(r)){let a=l(r)?h.distance(r,e.positionWC):Number.POSITIVE_INFINITY,c=l(o)?h.distance(o,e.positionWC):Number.POSITIVE_INFINITY;s=Math.min(a,c)}else s=Math.max(e.positionCartographic.height,0);return s}ln.prototype._adjustOrthographicFrustum=function(e){this.frustum instanceof yn&&(!e&&this._positionCartographic.height<15e4||(this.frustum.width=EEe(this)))};var mz=new h,Gte=new P,rZt=new P,Lte=new Ne,Wte=new q,AEe=new pe;function sZt(e,t,n){let i=P.clone(e.transform,Gte),o=_t.eastNorthUpToFixedFrame(t,e._projection.ellipsoid,rZt);e._setTransform(o),h.clone(h.ZERO,e.position),n.heading=n.heading-W.PI_OVER_TWO;let r=Ne.fromHeadingPitchRoll(n,Lte),s=q.fromQuaternion(r,Wte);q.getColumn(s,0,e.direction),q.getColumn(s,2,e.up),h.cross(e.direction,e.up,e.right),e._setTransform(i),e._adjustOrthographicFrustum(!0)}function aZt(e,t,n,i){let o=P.clone(e.transform,Gte);if(e._setTransform(P.IDENTITY),!h.equals(t,e.positionWC)){if(i){let a=e._projection,c=a.ellipsoid.cartesianToCartographic(t,AEe);t=a.project(c,mz)}h.clone(t,e.position)}n.heading=n.heading-W.PI_OVER_TWO;let r=Ne.fromHeadingPitchRoll(n,Lte),s=q.fromQuaternion(r,Wte);q.getColumn(s,0,e.direction),q.getColumn(s,2,e.up),h.cross(e.direction,e.up,e.right),e._setTransform(o),e._adjustOrthographicFrustum(!0)}function cZt(e,t,n,i){let o=P.clone(e.transform,Gte);if(e._setTransform(P.IDENTITY),!h.equals(t,e.positionWC)){if(i){let c=e._projection,d=c.ellipsoid.cartesianToCartographic(t,AEe);t=c.project(d,mz)}k.clone(t,e.position);let r=-t.z*.5,s=-r,a=e.frustum;if(s>r){let c=a.top/a.right;a.right=s,a.left=r,a.top=a.right*c,a.bottom=-a.top}}if(e._scene.mapMode2D===md.ROTATE){n.heading=n.heading-W.PI_OVER_TWO,n.pitch=-W.PI_OVER_TWO,n.roll=0;let r=Ne.fromHeadingPitchRoll(n,Lte),s=q.fromQuaternion(r,Wte);q.getColumn(s,2,e.up),h.cross(e.direction,e.up,e.right)}e._setTransform(o)}var lZt=new h,dZt=new h,uZt=new h;function GEe(e,t,n,i){let o=h.clone(n.direction,lZt),r=h.clone(n.up,dZt);if(e._scene.mode===se.SCENE3D){let a=e._projection.ellipsoid,c=_t.eastNorthUpToFixedFrame(t,a,dz),d=P.inverseTransformation(c,uz);P.multiplyByPointAsVector(d,o,o),P.multiplyByPointAsVector(d,r,r)}let s=h.cross(o,r,uZt);return i.heading=REe(o,r),i.pitch=CEe(o),i.roll=VEe(o,r,s),i}var Ate={destination:void 0,orientation:{direction:void 0,up:void 0,heading:void 0,pitch:void 0,roll:void 0},convert:void 0,endTransform:void 0},iE=new Cc;ln.prototype.setView=function(e){e=e??B.EMPTY_OBJECT;let t=e.orientation??B.EMPTY_OBJECT,n=this._mode;if(n===se.MORPHING)return;l(e.endTransform)&&this._setTransform(e.endTransform);let i=e.convert??!0,o=e.destination??h.clone(this.positionWC,mz);l(o)&&l(o.west)&&(o=this.getRectangleCameraCoordinates(o,mz),i=!1),l(t.direction)&&(t=GEe(this,o,t,Ate.orientation)),iE.heading=t.heading??0,iE.pitch=t.pitch??-W.PI_OVER_TWO,iE.roll=t.roll??0,n===se.SCENE3D?sZt(this,o,iE):n===se.SCENE2D?cZt(this,o,iE,i):aZt(this,o,iE,i)};var mZt=new h;ln.prototype.flyHome=function(e){let t=this._mode;if(t===se.MORPHING&&this._scene.completeMorph(),t===se.SCENE2D)this.flyTo({destination:ln.DEFAULT_VIEW_RECTANGLE,duration:e,endTransform:P.IDENTITY});else if(t===se.SCENE3D){let n=this.getRectangleCameraCoordinates(ln.DEFAULT_VIEW_RECTANGLE),i=h.magnitude(n);i+=i*ln.DEFAULT_VIEW_FACTOR,h.normalize(n,n),h.multiplyByScalar(n,i,n),this.flyTo({destination:n,duration:e,endTransform:P.IDENTITY})}else if(t===se.COLUMBUS_VIEW){let n=this._projection.ellipsoid.maximumRadius,i=new h(0,-1,1);i=h.multiplyByScalar(h.normalize(i,i),5*n,i),this.flyTo({destination:i,duration:e,orientation:{heading:0,pitch:-Math.acos(h.normalize(i,mZt).z),roll:0},endTransform:P.IDENTITY,convert:!1})}};ln.prototype.worldToCameraCoordinates=function(e,t){return l(t)||(t=new ce),Tl(this),P.multiplyByVector(this._actualInvTransform,e,t)};ln.prototype.worldToCameraCoordinatesPoint=function(e,t){return l(t)||(t=new h),Tl(this),P.multiplyByPoint(this._actualInvTransform,e,t)};ln.prototype.worldToCameraCoordinatesVector=function(e,t){return l(t)||(t=new h),Tl(this),P.multiplyByPointAsVector(this._actualInvTransform,e,t)};ln.prototype.cameraToWorldCoordinates=function(e,t){return l(t)||(t=new ce),Tl(this),P.multiplyByVector(this._actualTransform,e,t)};ln.prototype.cameraToWorldCoordinatesPoint=function(e,t){return l(t)||(t=new h),Tl(this),P.multiplyByPoint(this._actualTransform,e,t)};ln.prototype.cameraToWorldCoordinatesVector=function(e,t){return l(t)||(t=new h),Tl(this),P.multiplyByPointAsVector(this._actualTransform,e,t)};function LEe(e,t){let n=e._scene.mapMode2D===md.ROTATE,i=e._maxCoord.x,o=e._maxCoord.y,r,s;n?(s=i,r=-s):(s=t.x-i*2,r=t.x+i*2),t.x>i&&(t.x=s),t.x<-i&&(t.x=r),t.y>o&&(t.y=o),t.y<-o&&(t.y=-o)}var hEe=new h;ln.prototype.move=function(e,t){let n=this.position;h.multiplyByScalar(e,t,hEe),h.add(n,hEe,n),this._mode===se.SCENE2D&&LEe(this,n),this._adjustOrthographicFrustum(!0)};ln.prototype.moveForward=function(e){e=e??this.defaultMoveAmount,this._mode===se.SCENE2D?hz(this,e):this.move(this.direction,e)};ln.prototype.moveBackward=function(e){e=e??this.defaultMoveAmount,this._mode===se.SCENE2D?hz(this,-e):this.move(this.direction,-e)};ln.prototype.moveUp=function(e){e=e??this.defaultMoveAmount,this.move(this.up,e)};ln.prototype.moveDown=function(e){e=e??this.defaultMoveAmount,this.move(this.up,-e)};ln.prototype.moveRight=function(e){e=e??this.defaultMoveAmount,this.move(this.right,e)};ln.prototype.moveLeft=function(e){e=e??this.defaultMoveAmount,this.move(this.right,-e)};ln.prototype.lookLeft=function(e){e=e??this.defaultLookAmount,this._mode!==se.SCENE2D&&this.look(this.up,-e)};ln.prototype.lookRight=function(e){e=e??this.defaultLookAmount,this._mode!==se.SCENE2D&&this.look(this.up,e)};ln.prototype.lookUp=function(e){e=e??this.defaultLookAmount,this._mode!==se.SCENE2D&&this.look(this.right,-e)};ln.prototype.lookDown=function(e){e=e??this.defaultLookAmount,this._mode!==se.SCENE2D&&this.look(this.right,e)};var hZt=new Ne,fZt=new q;ln.prototype.look=function(e,t){let n=t??this.defaultLookAmount,i=Ne.fromAxisAngle(e,-n,hZt),o=q.fromQuaternion(i,fZt),r=this.direction,s=this.up,a=this.right;q.multiplyByVector(o,r,r),q.multiplyByVector(o,s,s),q.multiplyByVector(o,a,a)};ln.prototype.twistLeft=function(e){e=e??this.defaultLookAmount,this.look(this.direction,e)};ln.prototype.twistRight=function(e){e=e??this.defaultLookAmount,this.look(this.direction,-e)};var pZt=new Ne,bZt=new q;ln.prototype.rotate=function(e,t){let n=t??this.defaultRotateAmount,i=Ne.fromAxisAngle(e,-n,pZt),o=q.fromQuaternion(i,bZt);q.multiplyByVector(o,this.position,this.position),q.multiplyByVector(o,this.direction,this.direction),q.multiplyByVector(o,this.up,this.up),h.cross(this.direction,this.up,this.right),h.cross(this.right,this.direction,this.up),this._adjustOrthographicFrustum(!1)};ln.prototype.rotateDown=function(e){e=e??this.defaultRotateAmount,WEe(this,e)};ln.prototype.rotateUp=function(e){e=e??this.defaultRotateAmount,WEe(this,-e)};var gZt=new h,yZt=new h,xZt=new h,fEe=new h;function WEe(e,t){let n=e.position;if(l(e.constrainedAxis)&&!h.equalsEpsilon(e.position,h.ZERO,W.EPSILON2)){let i=h.normalize(n,gZt),o=h.equalsEpsilon(i,e.constrainedAxis,W.EPSILON2),r=h.equalsEpsilon(i,h.negate(e.constrainedAxis,fEe),W.EPSILON2);if(!o&&!r){let s=h.normalize(e.constrainedAxis,yZt),a=h.dot(i,s),c=W.acosClamped(a);t>0&&t>c&&(t=c-W.EPSILON4),a=h.dot(i,h.negate(s,fEe)),c=W.acosClamped(a),t<0&&-t>c&&(t=-c+W.EPSILON4);let d=h.cross(s,i,xZt);e.rotate(d,t)}else(o&&t<0||r&&t>0)&&e.rotate(e.right,t)}else e.rotate(e.right,t)}ln.prototype.rotateRight=function(e){e=e??this.defaultRotateAmount,vEe(this,-e)};ln.prototype.rotateLeft=function(e){e=e??this.defaultRotateAmount,vEe(this,e)};function vEe(e,t){l(e.constrainedAxis)?e.rotate(e.constrainedAxis,t):e.rotate(e.up,t)}function hz(e,t){let n=e.frustum,i;if(t=t*.5,Math.abs(n.top)+Math.abs(n.bottom)>Math.abs(n.left)+Math.abs(n.right)){let o=n.top-t,r=n.bottom+t,s=e._maxCoord.y;e._scene.mapMode2D===md.ROTATE&&(s*=e.maximumZoomFactor),r>s&&(r=s,o=-s),o<=r&&(o=1,r=-1),i=n.right/n.top,n.top=o,n.bottom=r,n.right=n.top*i,n.left=-n.right}else{let o=n.right-t,r=n.left+t,s=e._maxCoord.x;e._scene.mapMode2D===md.ROTATE&&(s*=e.maximumZoomFactor),o>s&&(o=s,r=-s),o<=r&&(o=1,r=-1),i=n.top/n.right,n.right=o,n.left=r,n.top=n.right*i,n.bottom=-n.top}}function FEe(e,t){e.move(e.direction,t)}ln.prototype.zoomIn=function(e){e=e??this.defaultZoomAmount,this._mode===se.SCENE2D?hz(this,e):FEe(this,e)};ln.prototype.zoomOut=function(e){e=e??this.defaultZoomAmount,this._mode===se.SCENE2D?hz(this,-e):FEe(this,-e)};ln.prototype.getMagnitude=function(){if(this._mode===se.SCENE3D)return h.magnitude(this.position);if(this._mode===se.COLUMBUS_VIEW)return Math.abs(this.position.z);if(this._mode===se.SCENE2D)return Math.max(this.frustum.right-this.frustum.left,this.frustum.top-this.frustum.bottom)};var TZt=new P;ln.prototype.lookAt=function(e,t){let i=this._scene.ellipsoid??ne.default,o=_t.eastNorthUpToFixedFrame(e,i,TZt);this.lookAtTransform(o,t)};var _Zt=new h,SZt=new Ne,ZZt=new Ne,RZt=new q;function IEe(e,t,n,i){t=W.clamp(t,-W.PI_OVER_TWO,W.PI_OVER_TWO),e=W.zeroToTwoPi(e)-W.PI_OVER_TWO;let o=Ne.fromAxisAngle(h.UNIT_Y,-t,SZt),r=Ne.fromAxisAngle(h.UNIT_Z,-e,ZZt),s=Ne.multiply(r,o,r),a=q.fromQuaternion(s,RZt),c=h.clone(h.UNIT_X,i);return q.multiplyByVector(a,c,c),h.negate(c,c),h.multiplyByScalar(c,n,c),c}ln.prototype.lookAtTransform=function(e,t){if(this._setTransform(e),!l(t))return;let n;if(l(t.heading)?n=IEe(t.heading,t.pitch,t.range,_Zt):n=t,this._mode===se.SCENE2D){k.clone(k.ZERO,this.position),h.negate(n,this.up),this.up.z=0,h.magnitudeSquared(this.up)<W.EPSILON10&&h.clone(h.UNIT_Y,this.up),h.normalize(this.up,this.up),this._setTransform(P.IDENTITY),h.negate(h.UNIT_Z,this.direction),h.cross(this.direction,this.up,this.right),h.normalize(this.right,this.right);let i=this.frustum,o=i.top/i.right;i.right=h.magnitude(n)*.5,i.left=-i.right,i.top=o*i.right,i.bottom=-i.top,this._setTransform(e);return}h.clone(n,this.position),h.negate(this.position,this.direction),h.normalize(this.direction,this.direction),h.cross(this.direction,h.UNIT_Z,this.right),h.magnitudeSquared(this.right)<W.EPSILON10&&h.clone(h.UNIT_X,this.right),h.normalize(this.right,this.right),h.cross(this.right,this.direction,this.up),h.normalize(this.up,this.up),this._adjustOrthographicFrustum(!0)};var CZt=new P,pEe=new h,VZt=new h,bEe=new h;ln.prototype.lookAtWorldPosition=function(e,t=ne.default){let n=P.clone(this._transform,CZt);this._setTransform(P.IDENTITY);let i=h.subtract(e,this.positionWC,pEe);h.magnitudeSquared(i)<W.EPSILON8&&(i=h.clone(this.directionWC,pEe)),i=h.normalize(i,this.direction);let o=t.geodeticSurfaceNormal(e,VZt),r=h.cross(i,o,bEe);h.magnitudeSquared(r)<W.EPSILON8&&(r=h.clone(this.rightWC,bEe)),h.normalize(r,this.right);let s=h.cross(r,i,this.up);h.normalize(s,this.up),this._setTransform(n)};var JM=new pe,EZt=new pe,AZt=new h,GZt=new h,LZt=new h,WZt=new h,vZt=new h,FZt=new h,IZt=new h,Cte=new h,PZt={direction:new h,right:new h,up:new h},gEe;function xl(e,t,n,i){return Math.abs(h.dot(t,n))/i-h.dot(e,n)}function PEe(e,t,n,i){let o=e._projection.ellipsoid,r=i?e:PZt,{north:s,south:a,west:c}=t,{east:d}=t;c>d&&(d+=W.TWO_PI);let u=(c+d)*.5,m;if(a<-W.PI_OVER_TWO+W.RADIANS_PER_DEGREE&&s>W.PI_OVER_TWO-W.RADIANS_PER_DEGREE)m=0;else{let I=JM;I.longitude=u,I.latitude=s,I.height=0;let N=EZt;N.longitude=u,N.latitude=a,N.height=0;let g=gEe;(!l(g)||g.ellipsoid!==o)&&(gEe=g=new mb(void 0,void 0,o)),g.setEndPoints(I,N),m=g.interpolateUsingFraction(.5,JM).latitude}let p=JM;p.longitude=u,p.latitude=m,p.height=0;let b=o.cartographicToCartesian(p,IZt),f=JM;f.longitude=d,f.latitude=s;let y=o.cartographicToCartesian(f,AZt);f.longitude=c;let _=o.cartographicToCartesian(f,LZt);f.longitude=u;let S=o.cartographicToCartesian(f,vZt);f.latitude=a;let Z=o.cartographicToCartesian(f,FZt);f.longitude=d;let R=o.cartographicToCartesian(f,WZt);f.longitude=c;let C=o.cartographicToCartesian(f,GZt);h.subtract(_,b,_),h.subtract(R,b,R),h.subtract(y,b,y),h.subtract(C,b,C),h.subtract(S,b,S),h.subtract(Z,b,Z);let E=o.geodeticSurfaceNormal(b,r.direction);h.negate(E,E);let A=h.cross(E,h.UNIT_Z,r.right);h.normalize(A,A);let L=h.cross(A,E,r.up),F;if(e.frustum instanceof yn){let I=Math.max(h.distance(y,_),h.distance(R,C)),N=Math.max(h.distance(y,R),h.distance(_,C)),g,V,G=e.frustum._offCenterFrustum,v=G.right/G.top,X=N*v;I>X?(g=I,V=g/v):(V=N,g=X),F=Math.max(g,V)}else{let I=Math.tan(e.frustum.fovy*.5),N=e.frustum.aspectRatio*I;if(F=Math.max(xl(E,L,_,I),xl(E,L,R,I),xl(E,L,y,I),xl(E,L,C,I),xl(E,L,S,I),xl(E,L,Z,I),xl(E,A,_,N),xl(E,A,R,N),xl(E,A,y,N),xl(E,A,C,N),xl(E,A,S,N),xl(E,A,Z,N)),a<0&&s>0){let g=JM;g.longitude=c,g.latitude=0,g.height=0;let V=o.cartographicToCartesian(g,Cte);h.subtract(V,b,V),F=Math.max(F,xl(E,L,V,I),xl(E,A,V,N)),g.longitude=d,V=o.cartographicToCartesian(g,Cte),h.subtract(V,b,V),F=Math.max(F,xl(E,L,V,I),xl(E,A,V,N))}}return h.add(b,h.multiplyByScalar(E,-F,Cte),n)}var XZt=new pe,NZt=new h,YZt=new h;function MZt(e,t,n){let i=e._projection;t.west>t.east&&(t=re.MAX_VALUE);let o=e._actualTransform,r=e._actualInvTransform,s=XZt;s.longitude=t.east,s.latitude=t.north;let a=i.project(s,NZt);P.multiplyByPoint(o,a,a),P.multiplyByPoint(r,a,a),s.longitude=t.west,s.latitude=t.south;let c=i.project(s,YZt);if(P.multiplyByPoint(o,c,c),P.multiplyByPoint(r,c,c),n.x=(a.x-c.x)*.5+c.x,n.y=(a.y-c.y)*.5+c.y,l(e.frustum.fovy)){let d=Math.tan(e.frustum.fovy*.5),u=e.frustum.aspectRatio*d;n.z=Math.max((a.x-c.x)/u,(a.y-c.y)/d)*.5}else{let d=a.x-c.x,u=a.y-c.y;n.z=Math.max(d,u)}return n}var wZt=new pe,kZt=new h,UZt=new h;function DZt(e,t,n){let i=e._projection,o=t.east;t.west>t.east&&(e._scene.mapMode2D===md.INFINITE_SCROLL?o+=W.TWO_PI:(t=re.MAX_VALUE,o=t.east));let r=wZt;r.longitude=o,r.latitude=t.north;let s=i.project(r,kZt);r.longitude=t.west,r.latitude=t.south;let a=i.project(r,UZt),c=Math.abs(s.x-a.x)*.5,d=Math.abs(s.y-a.y)*.5,u,m,p=e.frustum.right/e.frustum.top,b=d*p;return c>b?(u=c,m=u/p):(m=d,u=b),d=Math.max(2*u,2*m),n.x=(s.x-a.x)*.5+a.x,n.y=(s.y-a.y)*.5+a.y,r=i.unproject(n,r),r.height=d,n=i.project(r,n),n}ln.prototype.getRectangleCameraCoordinates=function(e,t){let n=this._mode;if(l(t)||(t=new h),n===se.SCENE3D)return PEe(this,e,t);if(n===se.COLUMBUS_VIEW)return MZt(this,e,t);if(n===se.SCENE2D)return DZt(this,e,t)};var OZt=new gn;function BZt(e,t,n,i){n=n??ne.default;let o=e.getPickRay(t,OZt),r=xi.rayEllipsoid(o,n);if(!r)return;let s=r.start>0?r.start:r.stop;return gn.getPoint(o,s,i)}var zZt=new gn;function HZt(e,t,n,i){let r=e.getPickRay(t,zZt).origin;r=h.fromElements(r.y,r.z,0,r);let s=n.unproject(r);if(!(s.latitude<-W.PI_OVER_TWO||s.latitude>W.PI_OVER_TWO))return n.ellipsoid.cartographicToCartesian(s,i)}var KZt=new gn;function JZt(e,t,n,i){let o=e.getPickRay(t,KZt),r=-o.origin.x/o.direction.x;gn.getPoint(o,r,i);let s=n.unproject(new h(i.y,i.z,0));if(!(s.latitude<-W.PI_OVER_TWO||s.latitude>W.PI_OVER_TWO||s.longitude<-Math.PI||s.longitude>Math.PI))return n.ellipsoid.cartographicToCartesian(s,i)}ln.prototype.pickEllipsoid=function(e,t,n){let i=this._scene.canvas;if(!(i.clientWidth===0||i.clientHeight===0)){if(l(n)||(n=new h),t=t??ne.default,this._mode===se.SCENE3D)n=BZt(this,e,t,n);else if(this._mode===se.SCENE2D)n=HZt(this,e,this._projection,n);else if(this._mode===se.COLUMBUS_VIEW)n=JZt(this,e,this._projection,n);else return;return n}};var jZt=new h,QZt=new h,qZt=new h;function $Zt(e,t,n){let i=e._scene.canvas,o=i.clientWidth,r=i.clientHeight,s=Math.tan(e.frustum.fovy*.5),a=e.frustum.aspectRatio*s,c=e.frustum.near,d=2/o*t.x-1,u=2/r*(r-t.y)-1,m=e.positionWC;h.clone(m,n.origin);let p=h.multiplyByScalar(e.directionWC,c,jZt);h.add(m,p,p);let b=h.multiplyByScalar(e.rightWC,d*c*a,QZt),f=h.multiplyByScalar(e.upWC,u*c*s,qZt),y=h.add(p,b,n.direction);return h.add(y,f,y),h.subtract(y,m,y),h.normalize(y,y),n}var cz=new h;function eRt(e,t,n){let i=e._scene.canvas,o=i.clientWidth,r=i.clientHeight,s=e.frustum,a=s.offCenterFrustum;l(a)&&(s=a);let c=2/o*t.x-1;c*=(s.right-s.left)*.5;let d=2/r*(r-t.y)-1;d*=(s.top-s.bottom)*.5;let u=n.origin;if(h.clone(e.positionWC,u),h.multiplyByScalar(e.rightWC,c,cz),h.add(cz,u,u),h.multiplyByScalar(e.upWC,d,cz),h.add(cz,u,u),h.clone(e.directionWC,n.direction),e._mode===se.SCENE2D&&e._scene.mapMode2D===md.INFINITE_SCROLL){let m=e._maxCoord.x;u.y=W.mod(u.y+m,2*m)-m}return n}ln.prototype.getPickRay=function(e,t){l(t)||(t=new gn);let n=this._scene.canvas;if(n.clientWidth<=0||n.clientHeight<=0)return;let i=this.frustum;return l(i.aspectRatio)&&l(i.fov)&&l(i.near)?$Zt(this,e,t):eRt(this,e,t)};var tRt=new h,nRt=new h;ln.prototype.distanceToBoundingSphere=function(e){let t=h.subtract(this.positionWC,e.center,tRt),n=h.multiplyByScalar(this.directionWC,h.dot(t,this.directionWC),nRt);return Math.max(0,h.magnitude(n)-e.radius)};var iRt=new k;ln.prototype.getPixelSize=function(e,t,n){let i=this.distanceToBoundingSphere(e),o=this.frustum.getPixelDimensions(t,n,i,this._scene.pixelRatio,iRt);return Math.max(o.x,o.y)};function oRt(e,t,n,i,o,r){let s=h.clone(t);n.y>i?s.y-=n.y-i:n.y<-i&&(s.y+=-i-n.y),n.z>o?s.z-=n.z-o:n.z<-o&&(s.z+=-o-n.z);function a(c){let d=h.lerp(t,s,c.time,new h);e.worldToCameraCoordinatesPoint(d,e.position)}return{easingFunction:As.EXPONENTIAL_OUT,startObject:{time:0},stopObject:{time:1},duration:r,update:a}}var rRt=new h,yEe=new h,sRt=new h,aRt=new h;function cRt(e,t){let n=e.position,i=e.direction,o=e.worldToCameraCoordinatesVector(h.UNIT_X,rRt),r=-h.dot(o,n)/h.dot(o,i),s=h.add(n,h.multiplyByScalar(i,r,yEe),yEe);e.cameraToWorldCoordinatesPoint(s,s),n=e.cameraToWorldCoordinatesPoint(e.position,sRt);let a=Math.tan(e.frustum.fovy*.5),c=e.frustum.aspectRatio*a,d=h.magnitude(h.subtract(n,s,aRt)),u=c*d,m=a*d,p=e._maxCoord.x,b=e._maxCoord.y,f=Math.max(u-p,p),y=Math.max(m-b,b);if(n.z<-f||n.z>f||n.y<-y||n.y>y){let _=s.y<-f||s.y>f,S=s.z<-y||s.z>y;if(_||S)return oRt(e,n,s,f,y,t)}}ln.prototype.createCorrectPositionTween=function(e){if(this._mode===se.COLUMBUS_VIEW)return cRt(this,e)};var lRt=new h,ja={destination:void 0,heading:void 0,pitch:void 0,roll:void 0,duration:void 0,complete:void 0,cancel:void 0,endTransform:void 0,maximumHeight:void 0,easingFunction:void 0};ln.prototype.cancelFlight=function(){l(this._currentFlight)&&(this._currentFlight.cancelTween(),this._currentFlight=void 0)};ln.prototype.completeFlight=function(){if(l(this._currentFlight)){this._currentFlight.cancelTween();let e={destination:void 0,orientation:{heading:void 0,pitch:void 0,roll:void 0}};e.destination=ja.destination,e.orientation.heading=ja.heading,e.orientation.pitch=ja.pitch,e.orientation.roll=ja.roll,this.setView(e),l(this._currentFlight.complete)&&this._currentFlight.complete(),this._currentFlight=void 0}};ln.prototype.flyTo=function(e){e=e??B.EMPTY_OBJECT;let t=e.destination;if(this._mode===se.MORPHING)return;this.cancelFlight();let i=t instanceof re;i&&(t=this.getRectangleCameraCoordinates(t,lRt));let o=e.orientation??B.EMPTY_OBJECT;if(l(o.direction)&&(o=GEe(this,t,o,Ate.orientation)),l(e.duration)&&e.duration<=0){let u=Ate;u.destination=e.destination,u.orientation.heading=o.heading,u.orientation.pitch=o.pitch,u.orientation.roll=o.roll,u.convert=e.convert,u.endTransform=e.endTransform,this.setView(u),typeof e.complete=="function"&&e.complete();return}let r=this,s;ja.destination=t,ja.heading=o.heading,ja.pitch=o.pitch,ja.roll=o.roll,ja.duration=e.duration,ja.complete=function(){s===r._currentFlight&&(r._currentFlight=void 0),l(e.complete)&&e.complete()},ja.cancel=e.cancel,ja.endTransform=e.endTransform,ja.convert=i?!1:e.convert,ja.maximumHeight=e.maximumHeight,ja.pitchAdjustHeight=e.pitchAdjustHeight,ja.flyOverLongitude=e.flyOverLongitude,ja.flyOverLongitudeWeight=e.flyOverLongitudeWeight,ja.easingFunction=e.easingFunction;let a=this._scene,c=KM.createTween(a,ja);if(c.duration===0){typeof c.complete=="function"&&c.complete();return}s=a.tweens.add(c),this._currentFlight=s;let d=this._scene.preloadFlightCamera;this._mode!==se.SCENE2D&&(l(d)||(d=ln.clone(this)),d.setView({destination:t,orientation:o}),this._scene.preloadFlightCullingVolume=d.frustum.computeCullingVolume(d.positionWC,d.directionWC,d.upWC))};function dRt(e,t){let n=e.frustum,i=Math.tan(n.fovy*.5),o=n.aspectRatio*i;return Math.max(t/o,t/i)}function uRt(e,t){let n=e.frustum,i=n.offCenterFrustum;l(i)&&(n=i);let o,r,s=n.right/n.top,a=t*s;return t>a?(o=t,r=o/s):(r=t,o=a),Math.max(o,r)*1.5}var mRt=100;function XEe(e,t,n){n=Am.clone(l(n)?n:ln.DEFAULT_OFFSET);let i=e._scene.screenSpaceCameraController.minimumZoomDistance,o=e._scene.screenSpaceCameraController.maximumZoomDistance,r=n.range;if(!l(r)||r===0){let s=t.radius;s===0?n.range=mRt:e.frustum instanceof yn||e._mode===se.SCENE2D?n.range=uRt(e,s):n.range=dRt(e,s),n.range=W.clamp(n.range,i,o)}return n}ln.prototype.viewBoundingSphere=function(e,t){t=XEe(this,e,t),this.lookAt(e.center,t)};var hRt=new P,xEe=new h,fRt=new h,pRt=new h,bRt=new h,gRt=new ce,yRt=new Ne,xRt=new q;ln.prototype.flyToBoundingSphere=function(e,t){t=t??B.EMPTY_OBJECT;let n=this._mode===se.SCENE2D||this._mode===se.COLUMBUS_VIEW;this._setTransform(P.IDENTITY);let i=XEe(this,e,t.offset),o;n?o=h.multiplyByScalar(h.UNIT_Z,i.range,xEe):o=IEe(i.heading,i.pitch,i.range,xEe);let s=this._scene.ellipsoid??ne.default,a=_t.eastNorthUpToFixedFrame(e.center,s,hRt);P.multiplyByPoint(a,o,o);let c,d;if(!n){if(c=h.subtract(e.center,o,fRt),h.normalize(c,c),d=P.multiplyByPointAsVector(a,h.UNIT_Z,pRt),1-Math.abs(h.dot(c,d))<W.EPSILON6){let m=Ne.fromAxisAngle(c,i.heading,yRt),p=q.fromQuaternion(m,xRt);h.fromCartesian4(P.getColumn(a,1,gRt),d),q.multiplyByVector(p,d,d)}let u=h.cross(c,d,bRt);h.cross(u,c,d),h.normalize(d,d)}this.flyTo({destination:o,orientation:{direction:c,up:d},duration:t.duration,complete:t.complete,cancel:t.cancel,endTransform:t.endTransform,maximumHeight:t.maximumHeight,easingFunction:t.easingFunction,flyOverLongitude:t.flyOverLongitude,flyOverLongitudeWeight:t.flyOverLongitudeWeight,pitchAdjustHeight:t.pitchAdjustHeight})};var TEe=new h,_Ee=new h,Vte=new h,SEe=new h,jM=[new h,new h,new h,new h];function TRt(e,t){let n=t.radii,i=e.positionWC,o=h.multiplyComponents(t.oneOverRadii,i,TEe),r=h.magnitude(o),s=h.normalize(o,_Ee),a,c;h.equalsEpsilon(s,h.UNIT_Z,W.EPSILON10)?(a=new h(0,1,0),c=new h(0,0,1)):(a=h.normalize(h.cross(h.UNIT_Z,s,Vte),Vte),c=h.normalize(h.cross(s,a,SEe),SEe));let d=Math.sqrt(h.magnitudeSquared(o)-1),u=h.multiplyByScalar(s,1/r,TEe),m=d/r,p=h.multiplyByScalar(a,m,_Ee),b=h.multiplyByScalar(c,m,Vte),f=h.add(u,b,jM[0]);h.subtract(f,p,f),h.multiplyComponents(n,f,f);let y=h.subtract(u,b,jM[1]);h.subtract(y,p,y),h.multiplyComponents(n,y,y);let _=h.subtract(u,b,jM[2]);h.add(_,p,_),h.multiplyComponents(n,_,_);let S=h.add(u,b,jM[3]);return h.add(S,p,S),h.multiplyComponents(n,S,S),jM}var Ete=new k,_Rt=new h,eT=[new pe,new pe,new pe,new pe];function lz(e,t,n,i,o,r){Ete.x=e,Ete.y=t;let s=i.pickEllipsoid(Ete,o,_Rt);return l(s)?(eT[n]=o.cartesianToCartographic(s,eT[n]),1):(eT[n]=o.cartesianToCartographic(r[n],eT[n]),0)}ln.prototype.computeViewRectangle=function(e,t){e=e??ne.default;let n=this.frustum.computeCullingVolume(this.positionWC,this.directionWC,this.upWC),i=new me(h.ZERO,e.maximumRadius);if(n.computeVisibility(i)===qt.OUTSIDE)return;let r=this._scene.canvas,s=r.clientWidth,a=r.clientHeight,c=0,d=TRt(this,e);if(c+=lz(0,0,0,this,e,d),c+=lz(0,a,1,this,e,d),c+=lz(s,a,2,this,e,d),c+=lz(s,0,3,this,e,d),c<2)return re.MAX_VALUE;t=re.fromCartographicArray(eT,t);let u=0,m=eT[3].longitude;for(let p=0;p<4;++p){let b=eT[p].longitude,f=Math.abs(b-m);f>W.PI?u+=W.TWO_PI-f:u+=f,m=b}return W.equalsEpsilon(Math.abs(u),W.TWO_PI,W.EPSILON9)&&(t.west=-W.PI,t.east=W.PI,eT[0].latitude>=0?t.north=W.PI_OVER_TWO:t.south=-W.PI_OVER_TWO),t};ln.prototype.switchToPerspectiveFrustum=function(){if(this._mode===se.SCENE2D||this.frustum instanceof Qi)return;let e=this._scene;this.frustum=new Qi,this.frustum.aspectRatio=e.drawingBufferWidth/e.drawingBufferHeight,this.frustum.fov=W.toRadians(60)};ln.prototype.switchToOrthographicFrustum=function(){if(this._mode===se.SCENE2D||this.frustum instanceof yn)return;let e=EEe(this),t=this._scene;this.frustum=new yn,this.frustum.aspectRatio=t.drawingBufferWidth/t.drawingBufferHeight,this.frustum.width=e};ln.clone=function(e,t){return l(t)||(t=new ln(e._scene)),h.clone(e.position,t.position),h.clone(e.direction,t.direction),h.clone(e.up,t.up),h.clone(e.right,t.right),P.clone(e._transform,t.transform),t._transformChanged=!0,t.frustum=e.frustum.clone(),t};var Io=ln;var SQi=x(T(),1);function SRt(e){this.pass=e.pass,this.commandList=e.commandList,this.camera=e.camera,this.cullingVolume=e.cullingVolume,this.ready=!1}var ph=SRt;var RQi=x(T(),1),vte=class{constructor(){this._controllers=[],this._needsUpdate=new Set}get controllerCount(){return this._controllers.length}registerController(t,n,i){let o=i??this.controllerCount;this._controllers.splice(o,0,t),this._needsUpdate.add(t),t.connectedCallback(n)}unregisterController(t,n){let i=this._controllers,o=i.indexOf(t);o!==-1&&(i.splice(o,1),t.disconnectedCallback(n))}update(t,n){for(let i of this._controllers)i.enabled&&(this._needsUpdate.has(i)&&(i.firstUpdate(t,n),this._needsUpdate.delete(i)),i.update(t,n))}},QM=vte;var WQi=x(T(),1);var UEe=x(gu(),1),NEe=576,ZRt=100,qM="#ffffff",$M="#48b";function DEe(e,t){this.credit=e,this.count=t??1}function RRt(e,t){let n=e.length;for(let i=0;i<n;i++){let o=e[i];if(Lt.equals(o,t))return!0}return!1}function CRt(e){let t=e._previousCesiumCredit,n=e._currentCesiumCredit;Lt.equals(n,t)||(l(t)&&e._cesiumCreditContainer.removeChild(t.element),l(n)&&e._cesiumCreditContainer.appendChild(n.element),e._previousCesiumCredit=n)}var OEe="cesium-credit-delimiter";function YEe(e){let t=document.createElement("span");return t.textContent=e,t.className=OEe,t}function MEe(e,t){if(l(t)){let n=document.createElement(t);n._creditId=e._creditId,n.appendChild(e),e=n}return e}function wEe(e,t,n,i){let o=e.childNodes,r=-1;t.sort(function(s,a){return a.count-s.count});for(let s=0;s<t.length;++s){let a=t[s].credit;if(l(a)){if(r=s,l(n)&&(r*=2,s>0)){let d=r-1;if(o.length<=d)e.appendChild(YEe(n));else{let u=o[d];u.className!==OEe&&e.replaceChild(YEe(n),u)}}let c=a.element;if(o.length<=r)e.appendChild(MEe(c,i));else{let d=o[r];d._creditId!==a._id&&e.replaceChild(MEe(c,i),d)}}}for(++r;r<o.length;)e.removeChild(o[r])}function VRt(e){let t=e._lightboxCredits,n=e.viewport.clientWidth,i=e.viewport.clientHeight;n!==e._lastViewportWidth&&(n<NEe?(t.className="cesium-credit-lightbox cesium-credit-lightbox-mobile",t.style.marginTop="0"):(t.className="cesium-credit-lightbox cesium-credit-lightbox-expanded",t.style.marginTop=`${Math.floor((i-t.clientHeight)*.5)}px`),e._lastViewportWidth=n),n>=NEe&&i!==e._lastViewportHeight&&(t.style.marginTop=`${Math.floor((i-t.clientHeight)*.5)}px`,e._lastViewportHeight=i)}function kEe(e){return function(t){t.key!=="Enter"&&t.key!==" "||(t.preventDefault(),t.stopPropagation(),e())}}function ERt(e){let t=` .cesium-credit-lightbox-overlay { display: none; z-index: 1; @@ -10085,19 +10085,19 @@ Url: ${e._contentHeader.uri}`,o++;let r={text:i.substring(1),position:n,font:`${ .cesium-credit-lightbox { background-color: #303336; - color: ${c9}; + color: ${qM}; position: relative; - min-height: ${iWt}px; + min-height: ${ZRt}px; margin: auto; } .cesium-credit-lightbox > ul > li a, .cesium-credit-lightbox > ul > li a:visited, .cesium-credit-wrapper a, .cesium-credit-wrapper a:visited { - color: ${c9}; + color: ${qM}; } .cesium-credit-lightbox > ul > li a:hover { - color: ${l9}; + color: ${$M}; } .cesium-credit-lightbox.cesium-credit-lightbox-expanded { border: 1px solid #444; @@ -10117,10 +10117,10 @@ Url: ${e._contentHeader.uri}`,o++;let r={text:i.substring(1),position:n,font:`${ position: absolute; top: 0; right: 6px; - color: ${c9}; + color: ${qM}; } .cesium-credit-lightbox-close:hover { - color: ${l9}; + color: ${$M}; } .cesium-credit-lightbox > ul { margin: 0; @@ -10139,20 +10139,20 @@ Url: ${e._contentHeader.uri}`,o++;let r={text:i.substring(1),position:n,font:`${ padding-left: 5px; cursor: pointer; text-decoration: underline; - color: ${c9}; + color: ${qM}; } .cesium-credit-expand-link:hover { - color: ${l9}; + color: ${$M}; } .cesium-credit-expand-link:focus-visible, .cesium-credit-lightbox-close:focus-visible { - outline: 2px solid ${l9}; + outline: 2px solid ${$M}; outline-offset: 2px; } .cesium-credit-text { - color: ${c9}; + color: ${qM}; } .cesium-credit-delimiter { @@ -10165,13 +10165,13 @@ Url: ${e._contentHeader.uri}`,o++;let r={text:i.substring(1),position:n,font:`${ } .cesium-credit-textContainer a:hover { - color: ${l9} + color: ${$M} } .cesium-credit-textContainer .cesium-credit-wrapper:first-of-type { padding-left: 5px; } -`;function n(r){if(r.shadowRoot)return r.shadowRoot;if(r.getRootNode){let s=r.getRootNode();if(s instanceof ShadowRoot)return s}}let i=n(e)??document.head,o=document.createElement("style");o.innerHTML=t,i.appendChild(o)}function jr(e,t,n){let i=this;n=n??document.body;let o=document.createElement("div");o.className="cesium-credit-lightbox-overlay",n.appendChild(o);let r=document.createElement("div");r.className="cesium-credit-lightbox",r.setAttribute("role","dialog"),r.setAttribute("aria-modal","true"),r.setAttribute("aria-label","Data attribution"),o.appendChild(r);function s(y){r.contains(y.target)||i.hideLightbox()}o.addEventListener("click",s,!1);function a(y){y.key==="Escape"&&(y.preventDefault(),i.hideLightbox())}o.addEventListener("keydown",a,!1);let c=document.createElement("div");c.className="cesium-credit-lightbox-title",c.textContent="Data provided by:",r.appendChild(c);let d=document.createElement("a");d.onclick=this.hideLightbox.bind(this),d.onkeydown=I2e(this.hideLightbox.bind(this)),d.innerHTML="×",d.className="cesium-credit-lightbox-close",d.setAttribute("role","button"),d.setAttribute("tabindex","0"),d.setAttribute("aria-label","Close data attribution"),r.appendChild(d);let u=document.createElement("ul");r.appendChild(u);let m=document.createElement("div");m.className="cesium-credit-logoContainer",m.style.display="inline",e.appendChild(m);let p=document.createElement("div");p.className="cesium-credit-textContainer",p.style.display="inline",e.appendChild(p);let b=document.createElement("a");b.className="cesium-credit-expand-link",b.onclick=this.showLightbox.bind(this),b.onkeydown=I2e(this.showLightbox.bind(this)),b.textContent="Data attribution",b.setAttribute("role","button"),b.setAttribute("tabindex","0"),b.setAttribute("aria-haspopup","dialog"),b.setAttribute("aria-expanded","false"),e.appendChild(b),aWt(e);let f=Lt.clone(jr.cesiumCredit);this._delimiter=t??"\u2022",this._screenContainer=p,this._cesiumCreditContainer=m,this._lastViewportHeight=void 0,this._lastViewportWidth=void 0,this._lightboxCredits=r,this._creditList=u,this._lightbox=o,this._hideLightbox=s,this._hideLightboxOnEscape=a,this._expandLink=b,this._closeButton=d,this._expanded=!1,this._staticCredits=[],this._cesiumCredit=f,this._previousCesiumCredit=void 0,this._currentCesiumCredit=f,this._creditDisplayElementPool=[],this._creditDisplayElementIndex=0,this._currentFrameCredits={screenCredits:new kt,lightboxCredits:new kt},this._defaultCredit=void 0,this.viewport=n,this.container=e}function Y2e(e,t,n,i){i=i??1;let o=t.get(n.id);if(l(o))o.count<Number.MAX_VALUE&&(o.count+=i);else{let r=e._creditDisplayElementPool,s=e._creditDisplayElementPoolIndex;s<r.length?(o=r[s],o.credit=n,o.count=i):(o=new X2e(n,i),r.push(o)),++e._creditDisplayElementPoolIndex,t.set(n.id,o)}}jr.prototype.addCreditToNextFrame=function(e){if(e.isIon()){l(this._defaultCredit)||(this._defaultCredit=Lt.clone(M2e())),this._currentCesiumCredit=this._defaultCredit;return}let t;e.showOnScreen?t=this._currentFrameCredits.screenCredits:t=this._currentFrameCredits.lightboxCredits,Y2e(this,t,e)};jr.prototype.addStaticCredit=function(e){let t=this._staticCredits;oWt(t,e)||t.push(e)};jr.prototype.removeStaticCredit=function(e){let t=this._staticCredits,n=t.indexOf(e);n!==-1&&t.splice(n,1)};jr.prototype.showLightbox=function(){this._lightbox.style.display="block",this._expanded=!0,this._expandLink.setAttribute("aria-expanded","true"),this._closeButton.focus()};jr.prototype.hideLightbox=function(){this._lightbox.style.display="none",this._expanded=!1,this._expandLink.setAttribute("aria-expanded","false"),this._expandLink.focus()};jr.prototype.update=function(){this._expanded&&sWt(this)};jr.prototype.beginFrame=function(){let e=this._currentFrameCredits;this._creditDisplayElementPoolIndex=0;let t=e.screenCredits,n=e.lightboxCredits;t.removeAll(),n.removeAll();let i=this._staticCredits;for(let o=0;o<i.length;++o){let r=i[o],s=r.showOnScreen?t:n;r.isIon()&&Lt.equals(jr.cesiumCredit,this._cesiumCredit)||Y2e(this,s,r,Number.MAX_VALUE)}Lt.equals(jr.cesiumCredit,this._cesiumCredit)||(this._cesiumCredit=Lt.clone(jr.cesiumCredit)),this._currentCesiumCredit=this._cesiumCredit};jr.prototype.endFrame=function(){let e=this._currentFrameCredits.screenCredits.values;F2e(this._screenContainer,e,this._delimiter,void 0);let t=this._currentFrameCredits.lightboxCredits.values;this._expandLink.style.display=t.length>0?"inline":"none",F2e(this._creditList,t,void 0,"li"),rWt(this)};jr.prototype.destroy=function(){return this._lightbox.removeEventListener("click",this._hideLightbox,!1),this._lightbox.removeEventListener("keydown",this._hideLightboxOnEscape,!1),this.container.removeChild(this._cesiumCreditContainer),this.container.removeChild(this._screenContainer),this.container.removeChild(this._expandLink),this.viewport.removeChild(this._lightbox),ue(this)};jr.prototype.isDestroyed=function(){return!1};jr._cesiumCredit=void 0;jr._cesiumCreditInitialized=!1;var gK;function M2e(){if(!l(gK)){let e=en("Assets/Images/ion-credit.png");e.indexOf("http://")!==0&&e.indexOf("https://")!==0&&e.indexOf("data:")!==0&&(e=new P2e.default(e).path()),gK=new Lt(`<a href="https://cesium.com/" target="_blank"><img src="${e}" style="vertical-align: -7px" title="Cesium ion"/></a>`,!0)}return jr._cesiumCreditInitialized||(jr._cesiumCredit=gK,jr._cesiumCreditInitialized=!0),gK}Object.defineProperties(jr,{cesiumCredit:{get:function(){return M2e(),jr._cesiumCredit},set:function(e){jr._cesiumCredit=e,jr._cesiumCreditInitialized=!0}}});jr.CreditDisplayElement=X2e;var d9=jr;var Tdo=x(T(),1);var klo=x(T(),1);var yK=0,cWt=1;function KZ(e){let t=e.frustum,n=e.orientation,i=e.origin,o=e.vertexFormat??Me.DEFAULT,r=e._drawNearPlane??!0,s,a;t instanceof qi?(s=yK,a=qi.packedLength):t instanceof yn&&(s=cWt,a=yn.packedLength),this._frustumType=s,this._frustum=t.clone(),this._origin=h.clone(i),this._orientation=Ne.clone(n),this._drawNearPlane=r,this._vertexFormat=o,this._workerName="createFrustumGeometry",this.packedLength=2+a+h.packedLength+Ne.packedLength+Me.packedLength}KZ.pack=function(e,t,n){n=n??0;let i=e._frustumType,o=e._frustum;return t[n++]=i,i===yK?(qi.pack(o,t,n),n+=qi.packedLength):(yn.pack(o,t,n),n+=yn.packedLength),h.pack(e._origin,t,n),n+=h.packedLength,Ne.pack(e._orientation,t,n),n+=Ne.packedLength,Me.pack(e._vertexFormat,t,n),n+=Me.packedLength,t[n]=e._drawNearPlane?1:0,t};var lWt=new qi,dWt=new yn,uWt=new Ne,mWt=new h,hWt=new Me;KZ.unpack=function(e,t,n){t=t??0;let i=e[t++],o;i===yK?(o=qi.unpack(e,t,lWt),t+=qi.packedLength):(o=yn.unpack(e,t,dWt),t+=yn.packedLength);let r=h.unpack(e,t,mWt);t+=h.packedLength;let s=Ne.unpack(e,t,uWt);t+=Ne.packedLength;let a=Me.unpack(e,t,hWt);t+=Me.packedLength;let c=e[t]===1;if(!l(n))return new KZ({frustum:o,origin:r,orientation:s,vertexFormat:a,_drawNearPlane:c});let d=i===n._frustumType?n._frustum:void 0;return n._frustum=o.clone(d),n._frustumType=i,n._origin=h.clone(r,n._origin),n._orientation=Ne.clone(s,n._orientation),n._vertexFormat=Me.clone(a,n._vertexFormat),n._drawNearPlane=c,n};function oA(e,t,n,i,o,r,s,a){let c=e/3*2;for(let d=0;d<4;++d)l(t)&&(t[e]=r.x,t[e+1]=r.y,t[e+2]=r.z),l(n)&&(n[e]=s.x,n[e+1]=s.y,n[e+2]=s.z),l(i)&&(i[e]=a.x,i[e+1]=a.y,i[e+2]=a.z),e+=3;o[c]=0,o[c+1]=0,o[c+2]=1,o[c+3]=0,o[c+4]=1,o[c+5]=1,o[c+6]=0,o[c+7]=1}var fWt=new q,pWt=new P,Qoe=new P,w2e=new h,k2e=new h,U2e=new h,bWt=new h,gWt=new h,yWt=new h,ST=new Array(3),u9=new Array(4);u9[0]=new ce(-1,-1,1,1);u9[1]=new ce(1,-1,1,1);u9[2]=new ce(1,1,1,1);u9[3]=new ce(-1,1,1,1);var D2e=new Array(4);for(let e=0;e<4;++e)D2e[e]=new ce;KZ._computeNearFarPlanes=function(e,t,n,i,o,r,s,a){let c=q.fromQuaternion(t,fWt),d=r??w2e,u=s??k2e,m=a??U2e;d=q.getColumn(c,0,d),u=q.getColumn(c,1,u),m=q.getColumn(c,2,m),h.normalize(d,d),h.normalize(u,u),h.normalize(m,m),h.negate(d,d);let p=P.computeView(e,m,u,d,pWt),b,f,y=i.projectionMatrix;if(n===yK){let _=P.multiply(y,p,Qoe);f=P.inverse(_,Qoe)}else b=P.inverseTransformation(p,Qoe);l(f)?(ST[0]=i.near,ST[1]=i.far):(ST[0]=0,ST[1]=i.near,ST[2]=i.far);for(let _=0;_<2;++_)for(let S=0;S<4;++S){let Z=ce.clone(u9[S],D2e[S]);if(l(f)){Z=P.multiplyByVector(f,Z,Z);let R=1/Z.w;h.multiplyByScalar(Z,R,Z),h.subtract(Z,e,Z),h.normalize(Z,Z);let C=h.dot(m,Z);h.multiplyByScalar(Z,ST[_]/C,Z),h.add(Z,e,Z)}else{let R=i.offCenterFrustum;l(R)&&(i=R);let C=ST[_],E=ST[_+1];Z.x=(Z.x*(i.right-i.left)+i.left+i.right)*.5,Z.y=(Z.y*(i.top-i.bottom)+i.bottom+i.top)*.5,Z.z=(Z.z*(C-E)-C-E)*.5,Z.w=1,P.multiplyByVector(b,Z,Z)}o[12*_+S*3]=Z.x,o[12*_+S*3+1]=Z.y,o[12*_+S*3+2]=Z.z}};KZ.createGeometry=function(e){let t=e._frustumType,n=e._frustum,i=e._origin,o=e._orientation,r=e._drawNearPlane,s=e._vertexFormat,a=r?6:5,c=new Float64Array(72);KZ._computeNearFarPlanes(i,o,t,n,c);let d=24;c[d]=c[12],c[d+1]=c[13],c[d+2]=c[14],c[d+3]=c[0],c[d+4]=c[1],c[d+5]=c[2],c[d+6]=c[9],c[d+7]=c[10],c[d+8]=c[11],c[d+9]=c[21],c[d+10]=c[22],c[d+11]=c[23],d+=12,c[d]=c[15],c[d+1]=c[16],c[d+2]=c[17],c[d+3]=c[3],c[d+4]=c[4],c[d+5]=c[5],c[d+6]=c[0],c[d+7]=c[1],c[d+8]=c[2],c[d+9]=c[12],c[d+10]=c[13],c[d+11]=c[14],d+=12,c[d]=c[3],c[d+1]=c[4],c[d+2]=c[5],c[d+3]=c[15],c[d+4]=c[16],c[d+5]=c[17],c[d+6]=c[18],c[d+7]=c[19],c[d+8]=c[20],c[d+9]=c[6],c[d+10]=c[7],c[d+11]=c[8],d+=12,c[d]=c[6],c[d+1]=c[7],c[d+2]=c[8],c[d+3]=c[18],c[d+4]=c[19],c[d+5]=c[20],c[d+6]=c[21],c[d+7]=c[22],c[d+8]=c[23],c[d+9]=c[9],c[d+10]=c[10],c[d+11]=c[11],r||(c=c.subarray(12));let u=new Rn({position:new Xe({componentDatatype:J.DOUBLE,componentsPerAttribute:3,values:c})});if(l(s.normal)||l(s.tangent)||l(s.bitangent)||l(s.st)){let p=l(s.normal)?new Float32Array(12*a):void 0,b=l(s.tangent)?new Float32Array(12*a):void 0,f=l(s.bitangent)?new Float32Array(12*a):void 0,y=l(s.st)?new Float32Array(8*a):void 0,_=w2e,S=k2e,Z=U2e,R=h.negate(_,bWt),C=h.negate(S,gWt),E=h.negate(Z,yWt);d=0,r&&(oA(d,p,b,f,y,E,_,S),d+=12),oA(d,p,b,f,y,Z,R,S),d+=12,oA(d,p,b,f,y,R,E,S),d+=12,oA(d,p,b,f,y,C,E,R),d+=12,oA(d,p,b,f,y,_,Z,S),d+=12,oA(d,p,b,f,y,S,Z,R),l(p)&&(u.normal=new Xe({componentDatatype:J.FLOAT,componentsPerAttribute:3,values:p})),l(b)&&(u.tangent=new Xe({componentDatatype:J.FLOAT,componentsPerAttribute:3,values:b})),l(f)&&(u.bitangent=new Xe({componentDatatype:J.FLOAT,componentsPerAttribute:3,values:f})),l(y)&&(u.st=new Xe({componentDatatype:J.FLOAT,componentsPerAttribute:2,values:y}))}let m=new Uint16Array(6*a);for(let p=0;p<a;++p){let b=p*6,f=p*4;m[b]=f,m[b+1]=f+1,m[b+2]=f+2,m[b+3]=f,m[b+4]=f+2,m[b+5]=f+3}return new At({attributes:u,indices:m,primitiveType:Ie.TRIANGLES,boundingSphere:me.fromVertices(c)})};var JZ=KZ;var tdo=x(T(),1);var qoe=0,xWt=1;function m9(e){let t=e.frustum,n=e.orientation,i=e.origin,o=e._drawNearPlane??!0,r,s;t instanceof qi?(r=qoe,s=qi.packedLength):t instanceof yn&&(r=xWt,s=yn.packedLength),this._frustumType=r,this._frustum=t.clone(),this._origin=h.clone(i),this._orientation=Ne.clone(n),this._drawNearPlane=o,this._workerName="createFrustumOutlineGeometry",this.packedLength=2+s+h.packedLength+Ne.packedLength}m9.pack=function(e,t,n){n=n??0;let i=e._frustumType,o=e._frustum;return t[n++]=i,i===qoe?(qi.pack(o,t,n),n+=qi.packedLength):(yn.pack(o,t,n),n+=yn.packedLength),h.pack(e._origin,t,n),n+=h.packedLength,Ne.pack(e._orientation,t,n),n+=Ne.packedLength,t[n]=e._drawNearPlane?1:0,t};var TWt=new qi,_Wt=new yn,SWt=new Ne,ZWt=new h;m9.unpack=function(e,t,n){t=t??0;let i=e[t++],o;i===qoe?(o=qi.unpack(e,t,TWt),t+=qi.packedLength):(o=yn.unpack(e,t,_Wt),t+=yn.packedLength);let r=h.unpack(e,t,ZWt);t+=h.packedLength;let s=Ne.unpack(e,t,SWt);t+=Ne.packedLength;let a=e[t]===1;if(!l(n))return new m9({frustum:o,origin:r,orientation:s,_drawNearPlane:a});let c=i===n._frustumType?n._frustum:void 0;return n._frustum=o.clone(c),n._frustumType=i,n._origin=h.clone(r,n._origin),n._orientation=Ne.clone(s,n._orientation),n._drawNearPlane=a,n};m9.createGeometry=function(e){let t=e._frustumType,n=e._frustum,i=e._origin,o=e._orientation,r=e._drawNearPlane,s=new Float64Array(24);JZ._computeNearFarPlanes(i,o,t,n,s);let a=new Rn({position:new Xe({componentDatatype:J.DOUBLE,componentsPerAttribute:3,values:s})}),c,d,u=r?2:1,m=new Uint16Array(8*(u+1)),p=r?0:1;for(;p<2;++p)c=r?p*8:0,d=p*4,m[c]=d,m[c+1]=d+1,m[c+2]=d+1,m[c+3]=d+2,m[c+4]=d+2,m[c+5]=d+3,m[c+6]=d+3,m[c+7]=d;for(p=0;p<2;++p)c=(u+p)*8,d=p*4,m[c]=d,m[c+1]=d+4,m[c+2]=d+1,m[c+3]=d+5,m[c+4]=d+2,m[c+5]=d+6,m[c+6]=d+3,m[c+7]=d+7;return new At({attributes:a,indices:m,primitiveType:Ie.LINES,boundingSphere:me.fromVertices(s)})};var h9=m9;function xK(e){e=e??B.EMPTY_OBJECT,this._camera=e.camera,this._frustumSplits=e.frustumSplits,this._color=e.color??U.CYAN,this._updateOnChange=e.updateOnChange??!0,this.show=e.show??!0,this.id=e.id,this._id=void 0,this._outlinePrimitives=[],this._planesPrimitives=[]}var RWt=new h,CWt=new q,VWt=new Ne,EWt=new qi,AWt=new fd,GWt=new yn,LWt=new ps,WWt=new U,vWt=[1,1e5];xK.prototype.update=function(e){if(!this.show)return;let t=this._planesPrimitives,n=this._outlinePrimitives,i,o;if(this._updateOnChange){for(o=t.length,i=0;i<o;++i)n[i]=n[i]&&n[i].destroy(),t[i]=t[i]&&t[i].destroy();t.length=0,n.length=0}if(t.length===0){let r=this._camera,s=r.frustum,a;s instanceof qi?a=EWt:s instanceof fd?a=AWt:s instanceof yn?a=GWt:a=LWt,a=s.clone(a);let c,d=this._frustumSplits;!l(d)||d.length<=1?(d=vWt,d[0]=this._camera.frustum.near,d[1]=this._camera.frustum.far,c=1):c=d.length-1;let u=r.positionWC,m=r.directionWC,p=r.upWC,b=r.rightWC;b=h.negate(b,RWt);let f=CWt;q.setColumn(f,0,b,f),q.setColumn(f,1,p,f),q.setColumn(f,2,m,f);let y=Ne.fromRotationMatrix(f,VWt);for(t.length=n.length=c,i=0;i<c;++i)a.near=d[i],a.far=d[i+1],t[i]=new In({geometryInstances:new Yt({geometry:new JZ({origin:u,orientation:y,frustum:a,_drawNearPlane:i===0}),attributes:{color:$t.fromColor(U.fromAlpha(this._color,.1,WWt))},id:this.id,pickPrimitive:this}),appearance:new Tn({translucent:!0,flat:!0}),asynchronous:!1}),n[i]=new In({geometryInstances:new Yt({geometry:new h9({origin:u,orientation:y,frustum:a,_drawNearPlane:i===0}),attributes:{color:$t.fromColor(this._color)},id:this.id,pickPrimitive:this}),appearance:new Tn({translucent:!1,flat:!0}),asynchronous:!1})}for(o=t.length,i=0;i<o;++i)n[i].update(e),t[i].update(e)};xK.prototype.isDestroyed=function(){return!1};xK.prototype.destroy=function(){let e=this._planesPrimitives.length;for(let t=0;t<e;++t)this._outlinePrimitives[t]=this._outlinePrimitives[t]&&this._outlinePrimitives[t].destroy(),this._planesPrimitives[t]=this._planesPrimitives[t]&&this._planesPrimitives[t].destroy();return ue(this)};var v0=xK;var Udo=x(T(),1);function p9(e){this._rs=void 0,this._sp=void 0,this._va=void 0,this._command=void 0,this._mode=void 0,this._useLogDepth=!1,this._ellipsoidOffset=e??0}var f9=fn.supportsTypedArrays()?new Float32Array(12):[],O2e=new h,B2e=new h,$oe=new h,z2e=new h,TK=new h;function FWt(e,t){let n=e.radii,i=t.camera,o,r,s;if(i.frustum instanceof yn)o=h.ZERO,r=i.rightWC,s=i.upWC;else{let m=i.positionWC,p=h.multiplyComponents(e.oneOverRadii,m,O2e),b=h.normalize(p,B2e),f=h.normalize(h.cross(h.UNIT_Z,p,$oe),$oe),y=h.normalize(h.cross(b,f,z2e),z2e),_=h.magnitude(p),S=Math.sqrt(_*_-1);o=h.multiplyByScalar(b,1/_,O2e);let Z=S/_;r=h.multiplyByScalar(f,Z,B2e),s=h.multiplyByScalar(y,Z,$oe)}let a=h.add(o,s,TK);h.subtract(a,r,a),h.multiplyComponents(n,a,a),h.pack(a,f9,0);let c=h.subtract(o,s,TK);h.subtract(c,r,c),h.multiplyComponents(n,c,c),h.pack(c,f9,3);let d=h.add(o,s,TK);h.add(d,r,d),h.multiplyComponents(n,d,d),h.pack(d,f9,6);let u=h.subtract(o,s,TK);return h.add(u,r,u),h.multiplyComponents(n,u,u),h.pack(u,f9,9),f9}p9.prototype.update=function(e){if(this._mode=e.mode,e.mode!==se.SCENE3D)return;let t=e.context,n=e.mapProjection.ellipsoid.radii,i=new ne(n.x+this._ellipsoidOffset,n.y+this._ellipsoidOffset,n.z+this._ellipsoidOffset),o=e.useLogDepth;if(l(this._command)||(this._rs=ze.fromCache({cull:{enabled:!0},depthTest:{enabled:!0},colorMask:{red:!1,green:!1,blue:!1,alpha:!1}}),this._command=new lt({renderState:this._rs,boundingVolume:new me(h.ZERO,i.maximumRadius),pass:Le.OPAQUE,owner:this})),!l(this._sp)||this._useLogDepth!==o){this._useLogDepth=o;let s=new Je({sources:[Bv]}),a=new Je({sources:[Ov]});o&&(a.defines.push("LOG_DEPTH"),s.defines.push("LOG_DEPTH")),this._sp=tn.replaceCache({shaderProgram:this._sp,context:t,vertexShaderSource:s,fragmentShaderSource:a,attributeLocations:{position:0}}),this._command.shaderProgram=this._sp}let r=FWt(i,e);if(l(this._va))this._va.getAttribute(0).vertexBuffer.copyFromArrayView(r);else{let s=new At({attributes:{position:new Xe({componentDatatype:J.FLOAT,componentsPerAttribute:3,values:r})},indices:[0,1,2,2,1,3],primitiveType:Ie.TRIANGLES});this._va=Un.fromGeometry({context:t,geometry:s,attributeLocations:{position:0},bufferUsage:Pe.DYNAMIC_DRAW}),this._command.vertexArray=this._va}};p9.prototype.execute=function(e,t){this._mode===se.SCENE3D&&this._command.execute(e,t)};p9.prototype.isDestroyed=function(){return!1};p9.prototype.destroy=function(){this._sp=this._sp&&this._sp.destroy(),this._va=this._va&&this._va.destroy()};var b9=p9;var Qdo=x(T(),1);function jZ(){}var IWt=/\bgl_FragDepth\b/,PWt=/\bdiscard\b/;function XWt(e,t){let n=e.shaderCache.getDerivedShaderProgram(t,"depthOnly");if(l(n))return n;let i=t.fragmentShaderSource,o=!1,r=i.sources;for(let a=0;a<r.length;++a)if(IWt.test(r[a])||PWt.test(r[a])){o=!0;break}let s=i.defines.indexOf("LOG_DEPTH")>=0;if(!o&&!s){let a=`void main() +`;function n(r){if(r.shadowRoot)return r.shadowRoot;if(r.getRootNode){let s=r.getRootNode();if(s instanceof ShadowRoot)return s}}let i=n(e)??document.head,o=document.createElement("style");o.innerHTML=t,i.appendChild(o)}function Jr(e,t,n){let i=this;n=n??document.body;let o=document.createElement("div");o.className="cesium-credit-lightbox-overlay",n.appendChild(o);let r=document.createElement("div");r.className="cesium-credit-lightbox",r.setAttribute("role","dialog"),r.setAttribute("aria-modal","true"),r.setAttribute("aria-label","Data attribution"),o.appendChild(r);function s(y){r.contains(y.target)||i.hideLightbox()}o.addEventListener("click",s,!1);function a(y){y.key==="Escape"&&(y.preventDefault(),i.hideLightbox())}o.addEventListener("keydown",a,!1);let c=document.createElement("div");c.className="cesium-credit-lightbox-title",c.textContent="Data provided by:",r.appendChild(c);let d=document.createElement("a");d.onclick=this.hideLightbox.bind(this),d.onkeydown=kEe(this.hideLightbox.bind(this)),d.innerHTML="×",d.className="cesium-credit-lightbox-close",d.setAttribute("role","button"),d.setAttribute("tabindex","0"),d.setAttribute("aria-label","Close data attribution"),r.appendChild(d);let u=document.createElement("ul");r.appendChild(u);let m=document.createElement("div");m.className="cesium-credit-logoContainer",m.style.display="inline",e.appendChild(m);let p=document.createElement("div");p.className="cesium-credit-textContainer",p.style.display="inline",e.appendChild(p);let b=document.createElement("a");b.className="cesium-credit-expand-link",b.onclick=this.showLightbox.bind(this),b.onkeydown=kEe(this.showLightbox.bind(this)),b.textContent="Data attribution",b.setAttribute("role","button"),b.setAttribute("tabindex","0"),b.setAttribute("aria-haspopup","dialog"),b.setAttribute("aria-expanded","false"),e.appendChild(b),ERt(e);let f=Lt.clone(Jr.cesiumCredit);this._delimiter=t??"\u2022",this._screenContainer=p,this._cesiumCreditContainer=m,this._lastViewportHeight=void 0,this._lastViewportWidth=void 0,this._lightboxCredits=r,this._creditList=u,this._lightbox=o,this._hideLightbox=s,this._hideLightboxOnEscape=a,this._expandLink=b,this._closeButton=d,this._expanded=!1,this._staticCredits=[],this._cesiumCredit=f,this._previousCesiumCredit=void 0,this._currentCesiumCredit=f,this._creditDisplayElementPool=[],this._creditDisplayElementIndex=0,this._currentFrameCredits={screenCredits:new kt,lightboxCredits:new kt},this._defaultCredit=void 0,this.viewport=n,this.container=e}function BEe(e,t,n,i){i=i??1;let o=t.get(n.id);if(l(o))o.count<Number.MAX_VALUE&&(o.count+=i);else{let r=e._creditDisplayElementPool,s=e._creditDisplayElementPoolIndex;s<r.length?(o=r[s],o.credit=n,o.count=i):(o=new DEe(n,i),r.push(o)),++e._creditDisplayElementPoolIndex,t.set(n.id,o)}}Jr.prototype.addCreditToNextFrame=function(e){if(e.isIon()){l(this._defaultCredit)||(this._defaultCredit=Lt.clone(zEe())),this._currentCesiumCredit=this._defaultCredit;return}let t;e.showOnScreen?t=this._currentFrameCredits.screenCredits:t=this._currentFrameCredits.lightboxCredits,BEe(this,t,e)};Jr.prototype.addStaticCredit=function(e){let t=this._staticCredits;RRt(t,e)||t.push(e)};Jr.prototype.removeStaticCredit=function(e){let t=this._staticCredits,n=t.indexOf(e);n!==-1&&t.splice(n,1)};Jr.prototype.showLightbox=function(){this._lightbox.style.display="block",this._expanded=!0,this._expandLink.setAttribute("aria-expanded","true"),this._closeButton.focus()};Jr.prototype.hideLightbox=function(){this._lightbox.style.display="none",this._expanded=!1,this._expandLink.setAttribute("aria-expanded","false"),this._expandLink.focus()};Jr.prototype.update=function(){this._expanded&&VRt(this)};Jr.prototype.beginFrame=function(){let e=this._currentFrameCredits;this._creditDisplayElementPoolIndex=0;let t=e.screenCredits,n=e.lightboxCredits;t.removeAll(),n.removeAll();let i=this._staticCredits;for(let o=0;o<i.length;++o){let r=i[o],s=r.showOnScreen?t:n;r.isIon()&&Lt.equals(Jr.cesiumCredit,this._cesiumCredit)||BEe(this,s,r,Number.MAX_VALUE)}Lt.equals(Jr.cesiumCredit,this._cesiumCredit)||(this._cesiumCredit=Lt.clone(Jr.cesiumCredit)),this._currentCesiumCredit=this._cesiumCredit};Jr.prototype.endFrame=function(){let e=this._currentFrameCredits.screenCredits.values;wEe(this._screenContainer,e,this._delimiter,void 0);let t=this._currentFrameCredits.lightboxCredits.values;this._expandLink.style.display=t.length>0?"inline":"none",wEe(this._creditList,t,void 0,"li"),CRt(this)};Jr.prototype.destroy=function(){return this._lightbox.removeEventListener("click",this._hideLightbox,!1),this._lightbox.removeEventListener("keydown",this._hideLightboxOnEscape,!1),this.container.removeChild(this._cesiumCreditContainer),this.container.removeChild(this._screenContainer),this.container.removeChild(this._expandLink),this.viewport.removeChild(this._lightbox),ue(this)};Jr.prototype.isDestroyed=function(){return!1};Jr._cesiumCredit=void 0;Jr._cesiumCreditInitialized=!1;var fz;function zEe(){if(!l(fz)){let e=en("Assets/Images/ion-credit.png");e.indexOf("http://")!==0&&e.indexOf("https://")!==0&&e.indexOf("data:")!==0&&(e=new UEe.default(e).path()),fz=new Lt(`<a href="https://cesium.com/" target="_blank"><img src="${e}" style="vertical-align: -7px" title="Cesium ion"/></a>`,!0)}return Jr._cesiumCreditInitialized||(Jr._cesiumCredit=fz,Jr._cesiumCreditInitialized=!0),fz}Object.defineProperties(Jr,{cesiumCredit:{get:function(){return zEe(),Jr._cesiumCredit},set:function(e){Jr._cesiumCredit=e,Jr._cesiumCreditInitialized=!0}}});Jr.CreditDisplayElement=DEe;var ew=Jr;var E8i=x(T(),1);var KQi=x(T(),1);var pz=0,ARt=1;function _Z(e){let t=e.frustum,n=e.orientation,i=e.origin,o=e.vertexFormat??Me.DEFAULT,r=e._drawNearPlane??!0,s,a;t instanceof Qi?(s=pz,a=Qi.packedLength):t instanceof yn&&(s=ARt,a=yn.packedLength),this._frustumType=s,this._frustum=t.clone(),this._origin=h.clone(i),this._orientation=Ne.clone(n),this._drawNearPlane=r,this._vertexFormat=o,this._workerName="createFrustumGeometry",this.packedLength=2+a+h.packedLength+Ne.packedLength+Me.packedLength}_Z.pack=function(e,t,n){n=n??0;let i=e._frustumType,o=e._frustum;return t[n++]=i,i===pz?(Qi.pack(o,t,n),n+=Qi.packedLength):(yn.pack(o,t,n),n+=yn.packedLength),h.pack(e._origin,t,n),n+=h.packedLength,Ne.pack(e._orientation,t,n),n+=Ne.packedLength,Me.pack(e._vertexFormat,t,n),n+=Me.packedLength,t[n]=e._drawNearPlane?1:0,t};var GRt=new Qi,LRt=new yn,WRt=new Ne,vRt=new h,FRt=new Me;_Z.unpack=function(e,t,n){t=t??0;let i=e[t++],o;i===pz?(o=Qi.unpack(e,t,GRt),t+=Qi.packedLength):(o=yn.unpack(e,t,LRt),t+=yn.packedLength);let r=h.unpack(e,t,vRt);t+=h.packedLength;let s=Ne.unpack(e,t,WRt);t+=Ne.packedLength;let a=Me.unpack(e,t,FRt);t+=Me.packedLength;let c=e[t]===1;if(!l(n))return new _Z({frustum:o,origin:r,orientation:s,vertexFormat:a,_drawNearPlane:c});let d=i===n._frustumType?n._frustum:void 0;return n._frustum=o.clone(d),n._frustumType=i,n._origin=h.clone(r,n._origin),n._orientation=Ne.clone(s,n._orientation),n._vertexFormat=Me.clone(a,n._vertexFormat),n._drawNearPlane=c,n};function oE(e,t,n,i,o,r,s,a){let c=e/3*2;for(let d=0;d<4;++d)l(t)&&(t[e]=r.x,t[e+1]=r.y,t[e+2]=r.z),l(n)&&(n[e]=s.x,n[e+1]=s.y,n[e+2]=s.z),l(i)&&(i[e]=a.x,i[e+1]=a.y,i[e+2]=a.z),e+=3;o[c]=0,o[c+1]=0,o[c+2]=1,o[c+3]=0,o[c+4]=1,o[c+5]=1,o[c+6]=0,o[c+7]=1}var IRt=new q,PRt=new P,Fte=new P,HEe=new h,KEe=new h,JEe=new h,XRt=new h,NRt=new h,YRt=new h,tT=new Array(3),tw=new Array(4);tw[0]=new ce(-1,-1,1,1);tw[1]=new ce(1,-1,1,1);tw[2]=new ce(1,1,1,1);tw[3]=new ce(-1,1,1,1);var jEe=new Array(4);for(let e=0;e<4;++e)jEe[e]=new ce;_Z._computeNearFarPlanes=function(e,t,n,i,o,r,s,a){let c=q.fromQuaternion(t,IRt),d=r??HEe,u=s??KEe,m=a??JEe;d=q.getColumn(c,0,d),u=q.getColumn(c,1,u),m=q.getColumn(c,2,m),h.normalize(d,d),h.normalize(u,u),h.normalize(m,m),h.negate(d,d);let p=P.computeView(e,m,u,d,PRt),b,f,y=i.projectionMatrix;if(n===pz){let _=P.multiply(y,p,Fte);f=P.inverse(_,Fte)}else b=P.inverseTransformation(p,Fte);l(f)?(tT[0]=i.near,tT[1]=i.far):(tT[0]=0,tT[1]=i.near,tT[2]=i.far);for(let _=0;_<2;++_)for(let S=0;S<4;++S){let Z=ce.clone(tw[S],jEe[S]);if(l(f)){Z=P.multiplyByVector(f,Z,Z);let R=1/Z.w;h.multiplyByScalar(Z,R,Z),h.subtract(Z,e,Z),h.normalize(Z,Z);let C=h.dot(m,Z);h.multiplyByScalar(Z,tT[_]/C,Z),h.add(Z,e,Z)}else{let R=i.offCenterFrustum;l(R)&&(i=R);let C=tT[_],E=tT[_+1];Z.x=(Z.x*(i.right-i.left)+i.left+i.right)*.5,Z.y=(Z.y*(i.top-i.bottom)+i.bottom+i.top)*.5,Z.z=(Z.z*(C-E)-C-E)*.5,Z.w=1,P.multiplyByVector(b,Z,Z)}o[12*_+S*3]=Z.x,o[12*_+S*3+1]=Z.y,o[12*_+S*3+2]=Z.z}};_Z.createGeometry=function(e){let t=e._frustumType,n=e._frustum,i=e._origin,o=e._orientation,r=e._drawNearPlane,s=e._vertexFormat,a=r?6:5,c=new Float64Array(72);_Z._computeNearFarPlanes(i,o,t,n,c);let d=24;c[d]=c[12],c[d+1]=c[13],c[d+2]=c[14],c[d+3]=c[0],c[d+4]=c[1],c[d+5]=c[2],c[d+6]=c[9],c[d+7]=c[10],c[d+8]=c[11],c[d+9]=c[21],c[d+10]=c[22],c[d+11]=c[23],d+=12,c[d]=c[15],c[d+1]=c[16],c[d+2]=c[17],c[d+3]=c[3],c[d+4]=c[4],c[d+5]=c[5],c[d+6]=c[0],c[d+7]=c[1],c[d+8]=c[2],c[d+9]=c[12],c[d+10]=c[13],c[d+11]=c[14],d+=12,c[d]=c[3],c[d+1]=c[4],c[d+2]=c[5],c[d+3]=c[15],c[d+4]=c[16],c[d+5]=c[17],c[d+6]=c[18],c[d+7]=c[19],c[d+8]=c[20],c[d+9]=c[6],c[d+10]=c[7],c[d+11]=c[8],d+=12,c[d]=c[6],c[d+1]=c[7],c[d+2]=c[8],c[d+3]=c[18],c[d+4]=c[19],c[d+5]=c[20],c[d+6]=c[21],c[d+7]=c[22],c[d+8]=c[23],c[d+9]=c[9],c[d+10]=c[10],c[d+11]=c[11],r||(c=c.subarray(12));let u=new Rn({position:new Xe({componentDatatype:J.DOUBLE,componentsPerAttribute:3,values:c})});if(l(s.normal)||l(s.tangent)||l(s.bitangent)||l(s.st)){let p=l(s.normal)?new Float32Array(12*a):void 0,b=l(s.tangent)?new Float32Array(12*a):void 0,f=l(s.bitangent)?new Float32Array(12*a):void 0,y=l(s.st)?new Float32Array(8*a):void 0,_=HEe,S=KEe,Z=JEe,R=h.negate(_,XRt),C=h.negate(S,NRt),E=h.negate(Z,YRt);d=0,r&&(oE(d,p,b,f,y,E,_,S),d+=12),oE(d,p,b,f,y,Z,R,S),d+=12,oE(d,p,b,f,y,R,E,S),d+=12,oE(d,p,b,f,y,C,E,R),d+=12,oE(d,p,b,f,y,_,Z,S),d+=12,oE(d,p,b,f,y,S,Z,R),l(p)&&(u.normal=new Xe({componentDatatype:J.FLOAT,componentsPerAttribute:3,values:p})),l(b)&&(u.tangent=new Xe({componentDatatype:J.FLOAT,componentsPerAttribute:3,values:b})),l(f)&&(u.bitangent=new Xe({componentDatatype:J.FLOAT,componentsPerAttribute:3,values:f})),l(y)&&(u.st=new Xe({componentDatatype:J.FLOAT,componentsPerAttribute:2,values:y}))}let m=new Uint16Array(6*a);for(let p=0;p<a;++p){let b=p*6,f=p*4;m[b]=f,m[b+1]=f+1,m[b+2]=f+2,m[b+3]=f,m[b+4]=f+2,m[b+5]=f+3}return new At({attributes:u,indices:m,primitiveType:Ie.TRIANGLES,boundingSphere:me.fromVertices(c)})};var SZ=_Z;var c8i=x(T(),1);var Ite=0,MRt=1;function nw(e){let t=e.frustum,n=e.orientation,i=e.origin,o=e._drawNearPlane??!0,r,s;t instanceof Qi?(r=Ite,s=Qi.packedLength):t instanceof yn&&(r=MRt,s=yn.packedLength),this._frustumType=r,this._frustum=t.clone(),this._origin=h.clone(i),this._orientation=Ne.clone(n),this._drawNearPlane=o,this._workerName="createFrustumOutlineGeometry",this.packedLength=2+s+h.packedLength+Ne.packedLength}nw.pack=function(e,t,n){n=n??0;let i=e._frustumType,o=e._frustum;return t[n++]=i,i===Ite?(Qi.pack(o,t,n),n+=Qi.packedLength):(yn.pack(o,t,n),n+=yn.packedLength),h.pack(e._origin,t,n),n+=h.packedLength,Ne.pack(e._orientation,t,n),n+=Ne.packedLength,t[n]=e._drawNearPlane?1:0,t};var wRt=new Qi,kRt=new yn,URt=new Ne,DRt=new h;nw.unpack=function(e,t,n){t=t??0;let i=e[t++],o;i===Ite?(o=Qi.unpack(e,t,wRt),t+=Qi.packedLength):(o=yn.unpack(e,t,kRt),t+=yn.packedLength);let r=h.unpack(e,t,DRt);t+=h.packedLength;let s=Ne.unpack(e,t,URt);t+=Ne.packedLength;let a=e[t]===1;if(!l(n))return new nw({frustum:o,origin:r,orientation:s,_drawNearPlane:a});let c=i===n._frustumType?n._frustum:void 0;return n._frustum=o.clone(c),n._frustumType=i,n._origin=h.clone(r,n._origin),n._orientation=Ne.clone(s,n._orientation),n._drawNearPlane=a,n};nw.createGeometry=function(e){let t=e._frustumType,n=e._frustum,i=e._origin,o=e._orientation,r=e._drawNearPlane,s=new Float64Array(24);SZ._computeNearFarPlanes(i,o,t,n,s);let a=new Rn({position:new Xe({componentDatatype:J.DOUBLE,componentsPerAttribute:3,values:s})}),c,d,u=r?2:1,m=new Uint16Array(8*(u+1)),p=r?0:1;for(;p<2;++p)c=r?p*8:0,d=p*4,m[c]=d,m[c+1]=d+1,m[c+2]=d+1,m[c+3]=d+2,m[c+4]=d+2,m[c+5]=d+3,m[c+6]=d+3,m[c+7]=d;for(p=0;p<2;++p)c=(u+p)*8,d=p*4,m[c]=d,m[c+1]=d+4,m[c+2]=d+1,m[c+3]=d+5,m[c+4]=d+2,m[c+5]=d+6,m[c+6]=d+3,m[c+7]=d+7;return new At({attributes:a,indices:m,primitiveType:Ie.LINES,boundingSphere:me.fromVertices(s)})};var iw=nw;function bz(e){e=e??B.EMPTY_OBJECT,this._camera=e.camera,this._frustumSplits=e.frustumSplits,this._color=e.color??U.CYAN,this._updateOnChange=e.updateOnChange??!0,this.show=e.show??!0,this.id=e.id,this._id=void 0,this._outlinePrimitives=[],this._planesPrimitives=[]}var ORt=new h,BRt=new q,zRt=new Ne,HRt=new Qi,KRt=new ud,JRt=new yn,jRt=new ps,QRt=new U,qRt=[1,1e5];bz.prototype.update=function(e){if(!this.show)return;let t=this._planesPrimitives,n=this._outlinePrimitives,i,o;if(this._updateOnChange){for(o=t.length,i=0;i<o;++i)n[i]=n[i]&&n[i].destroy(),t[i]=t[i]&&t[i].destroy();t.length=0,n.length=0}if(t.length===0){let r=this._camera,s=r.frustum,a;s instanceof Qi?a=HRt:s instanceof ud?a=KRt:s instanceof yn?a=JRt:a=jRt,a=s.clone(a);let c,d=this._frustumSplits;!l(d)||d.length<=1?(d=qRt,d[0]=this._camera.frustum.near,d[1]=this._camera.frustum.far,c=1):c=d.length-1;let u=r.positionWC,m=r.directionWC,p=r.upWC,b=r.rightWC;b=h.negate(b,ORt);let f=BRt;q.setColumn(f,0,b,f),q.setColumn(f,1,p,f),q.setColumn(f,2,m,f);let y=Ne.fromRotationMatrix(f,zRt);for(t.length=n.length=c,i=0;i<c;++i)a.near=d[i],a.far=d[i+1],t[i]=new In({geometryInstances:new Yt({geometry:new SZ({origin:u,orientation:y,frustum:a,_drawNearPlane:i===0}),attributes:{color:$t.fromColor(U.fromAlpha(this._color,.1,QRt))},id:this.id,pickPrimitive:this}),appearance:new Tn({translucent:!0,flat:!0}),asynchronous:!1}),n[i]=new In({geometryInstances:new Yt({geometry:new iw({origin:u,orientation:y,frustum:a,_drawNearPlane:i===0}),attributes:{color:$t.fromColor(this._color)},id:this.id,pickPrimitive:this}),appearance:new Tn({translucent:!1,flat:!0}),asynchronous:!1})}for(o=t.length,i=0;i<o;++i)n[i].update(e),t[i].update(e)};bz.prototype.isDestroyed=function(){return!1};bz.prototype.destroy=function(){let e=this._planesPrimitives.length;for(let t=0;t<e;++t)this._outlinePrimitives[t]=this._outlinePrimitives[t]&&this._outlinePrimitives[t].destroy(),this._planesPrimitives[t]=this._planesPrimitives[t]&&this._planesPrimitives[t].destroy();return ue(this)};var y0=bz;var J8i=x(T(),1);function rw(e){this._rs=void 0,this._sp=void 0,this._va=void 0,this._command=void 0,this._mode=void 0,this._useLogDepth=!1,this._ellipsoidOffset=e??0}var ow=fn.supportsTypedArrays()?new Float32Array(12):[],QEe=new h,qEe=new h,Pte=new h,$Ee=new h,gz=new h;function $Rt(e,t){let n=e.radii,i=t.camera,o,r,s;if(i.frustum instanceof yn)o=h.ZERO,r=i.rightWC,s=i.upWC;else{let m=i.positionWC,p=h.multiplyComponents(e.oneOverRadii,m,QEe),b=h.normalize(p,qEe),f=h.normalize(h.cross(h.UNIT_Z,p,Pte),Pte),y=h.normalize(h.cross(b,f,$Ee),$Ee),_=h.magnitude(p),S=Math.sqrt(_*_-1);o=h.multiplyByScalar(b,1/_,QEe);let Z=S/_;r=h.multiplyByScalar(f,Z,qEe),s=h.multiplyByScalar(y,Z,Pte)}let a=h.add(o,s,gz);h.subtract(a,r,a),h.multiplyComponents(n,a,a),h.pack(a,ow,0);let c=h.subtract(o,s,gz);h.subtract(c,r,c),h.multiplyComponents(n,c,c),h.pack(c,ow,3);let d=h.add(o,s,gz);h.add(d,r,d),h.multiplyComponents(n,d,d),h.pack(d,ow,6);let u=h.subtract(o,s,gz);return h.add(u,r,u),h.multiplyComponents(n,u,u),h.pack(u,ow,9),ow}rw.prototype.update=function(e){if(this._mode=e.mode,e.mode!==se.SCENE3D)return;let t=e.context,n=e.mapProjection.ellipsoid.radii,i=new ne(n.x+this._ellipsoidOffset,n.y+this._ellipsoidOffset,n.z+this._ellipsoidOffset),o=e.useLogDepth;if(l(this._command)||(this._rs=ze.fromCache({cull:{enabled:!0},depthTest:{enabled:!0},colorMask:{red:!1,green:!1,blue:!1,alpha:!1}}),this._command=new lt({renderState:this._rs,boundingVolume:new me(h.ZERO,i.maximumRadius),pass:Le.OPAQUE,owner:this})),!l(this._sp)||this._useLogDepth!==o){this._useLogDepth=o;let s=new Je({sources:[Bv]}),a=new Je({sources:[Ov]});o&&(a.defines.push("LOG_DEPTH"),s.defines.push("LOG_DEPTH")),this._sp=tn.replaceCache({shaderProgram:this._sp,context:t,vertexShaderSource:s,fragmentShaderSource:a,attributeLocations:{position:0}}),this._command.shaderProgram=this._sp}let r=$Rt(i,e);if(l(this._va))this._va.getAttribute(0).vertexBuffer.copyFromArrayView(r);else{let s=new At({attributes:{position:new Xe({componentDatatype:J.FLOAT,componentsPerAttribute:3,values:r})},indices:[0,1,2,2,1,3],primitiveType:Ie.TRIANGLES});this._va=Un.fromGeometry({context:t,geometry:s,attributeLocations:{position:0},bufferUsage:Pe.DYNAMIC_DRAW}),this._command.vertexArray=this._va}};rw.prototype.execute=function(e,t){this._mode===se.SCENE3D&&this._command.execute(e,t)};rw.prototype.isDestroyed=function(){return!1};rw.prototype.destroy=function(){this._sp=this._sp&&this._sp.destroy(),this._va=this._va&&this._va.destroy()};var sw=rw;var o6i=x(T(),1);function ZZ(){}var e1t=/\bgl_FragDepth\b/,t1t=/\bdiscard\b/;function n1t(e,t){let n=e.shaderCache.getDerivedShaderProgram(t,"depthOnly");if(l(n))return n;let i=t.fragmentShaderSource,o=!1,r=i.sources;for(let a=0;a<r.length;++a)if(e1t.test(r[a])||t1t.test(r[a])){o=!0;break}let s=i.defines.indexOf("LOG_DEPTH")>=0;if(!o&&!s){let a=`void main() { out_FragColor = vec4(1.0); } @@ -10180,32 +10180,32 @@ Url: ${e._contentHeader.uri}`,o++;let r={text:i.substring(1),position:n,font:`${ out_FragColor = vec4(1.0); czm_writeLogDepth(); } -`;i=new Je({defines:["LOG_DEPTH"],sources:[a]})}return e.shaderCache.createDerivedShaderProgram(t,"depthOnly",{vertexShaderSource:t.vertexShaderSource,fragmentShaderSource:i,attributeLocations:t._attributeLocations})}function NWt(e,t){let n=e._depthOnlyRenderStateCache,i=n[t.id];if(l(i))return i;let o=ze.getState(t);o.depthMask=!0,o.colorMask={red:!1,green:!1,blue:!1,alpha:!1};let r=ze.fromCache(o);return n[t.id]=r,r}jZ.createDepthOnlyDerivedCommand=function(e,t,n,i){l(i)||(i={});let o=i.depthOnlyCommand?.shaderProgram,r=i.depthOnlyCommand?.renderState;return i.depthOnlyCommand=lt.shallowClone(t,i.depthOnlyCommand),!l(o)||i.shaderProgramId!==t.shaderProgram.id?(i.depthOnlyCommand.shaderProgram=XWt(n,t.shaderProgram),i.depthOnlyCommand.renderState=NWt(e,t.renderState),i.shaderProgramId=t.shaderProgram.id):(i.depthOnlyCommand.shaderProgram=o,i.depthOnlyCommand.renderState=r),i};var YWt=/\s+czm_writeLogDepth\(/,MWt=/\s+czm_vertexLogDepth\(/;function wWt(e,t){if(t.fragmentShaderSource.defines.indexOf("LOG_DEPTH_READ_ONLY")>=0)return t;let i=e.shaderCache.getDerivedShaderProgram(t,"logDepth");if(l(i))return i;let o=t._attributeLocations,r=t.vertexShaderSource.clone(),s=t.fragmentShaderSource.clone();r.defines=l(r.defines)?r.defines.slice(0):[],r.defines.push("LOG_DEPTH"),s.defines=l(s.defines)?s.defines.slice(0):[],s.defines.push("LOG_DEPTH");let a=!1,c=r.sources;for(let u=0;u<c.length;++u)if(MWt.test(c[u])){a=!0;break}if(!a){for(let m=0;m<c.length;++m)c[m]=Je.replaceMain(c[m],"czm_log_depth_main");c.push(` +`;i=new Je({defines:["LOG_DEPTH"],sources:[a]})}return e.shaderCache.createDerivedShaderProgram(t,"depthOnly",{vertexShaderSource:t.vertexShaderSource,fragmentShaderSource:i,attributeLocations:t._attributeLocations})}function i1t(e,t){let n=e._depthOnlyRenderStateCache,i=n[t.id];if(l(i))return i;let o=ze.getState(t);o.depthMask=!0,o.colorMask={red:!1,green:!1,blue:!1,alpha:!1};let r=ze.fromCache(o);return n[t.id]=r,r}ZZ.createDepthOnlyDerivedCommand=function(e,t,n,i){l(i)||(i={});let o=i.depthOnlyCommand?.shaderProgram,r=i.depthOnlyCommand?.renderState;return i.depthOnlyCommand=lt.shallowClone(t,i.depthOnlyCommand),!l(o)||i.shaderProgramId!==t.shaderProgram.id?(i.depthOnlyCommand.shaderProgram=n1t(n,t.shaderProgram),i.depthOnlyCommand.renderState=i1t(e,t.renderState),i.shaderProgramId=t.shaderProgram.id):(i.depthOnlyCommand.shaderProgram=o,i.depthOnlyCommand.renderState=r),i};var o1t=/\s+czm_writeLogDepth\(/,r1t=/\s+czm_vertexLogDepth\(/;function s1t(e,t){if(t.fragmentShaderSource.defines.indexOf("LOG_DEPTH_READ_ONLY")>=0)return t;let i=e.shaderCache.getDerivedShaderProgram(t,"logDepth");if(l(i))return i;let o=t._attributeLocations,r=t.vertexShaderSource.clone(),s=t.fragmentShaderSource.clone();r.defines=l(r.defines)?r.defines.slice(0):[],r.defines.push("LOG_DEPTH"),s.defines=l(s.defines)?s.defines.slice(0):[],s.defines.push("LOG_DEPTH");let a=!1,c=r.sources;for(let u=0;u<c.length;++u)if(r1t.test(c[u])){a=!0;break}if(!a){for(let m=0;m<c.length;++m)c[m]=Je.replaceMain(c[m],"czm_log_depth_main");c.push(` void main() { czm_log_depth_main(); czm_vertexLogDepth(); } -`)}c=s.sources,a=!1;for(let u=0;u<c.length;++u)YWt.test(c[u])&&(a=!0);s.defines.indexOf("LOG_DEPTH_WRITE")!==-1&&(a=!0);let d="";if(!a){for(let u=0;u<c.length;u++)c[u]=Je.replaceMain(c[u],"czm_log_depth_main");d=` +`)}c=s.sources,a=!1;for(let u=0;u<c.length;++u)o1t.test(c[u])&&(a=!0);s.defines.indexOf("LOG_DEPTH_WRITE")!==-1&&(a=!0);let d="";if(!a){for(let u=0;u<c.length;u++)c[u]=Je.replaceMain(c[u],"czm_log_depth_main");d=` void main() { czm_log_depth_main(); czm_writeLogDepth(); } -`}return c.push(d),e.shaderCache.createDerivedShaderProgram(t,"logDepth",{vertexShaderSource:r,fragmentShaderSource:s,attributeLocations:o})}jZ.createLogDepthCommand=function(e,t,n){l(n)||(n={});let i=n.command?.shaderProgram;return n.command=lt.shallowClone(e,n.command),!l(i)||n.shaderProgramId!==e.shaderProgram.id?(n.command.shaderProgram=wWt(t,e.shaderProgram),n.shaderProgramId=e.shaderProgram.id):n.command.shaderProgram=i,n};function kWt(e,t,n){let i=e.shaderCache.getDerivedShaderProgram(t,"pick");if(l(i))return i;let o=t._attributeLocations,{sources:r,defines:s}=t.fragmentShaderSource,c=r.some(b=>b.includes("out_FragData"))?"out_FragData_0":"out_FragColor",d=`void main () +`}return c.push(d),e.shaderCache.createDerivedShaderProgram(t,"logDepth",{vertexShaderSource:r,fragmentShaderSource:s,attributeLocations:o})}ZZ.createLogDepthCommand=function(e,t,n){l(n)||(n={});let i=n.command?.shaderProgram;return n.command=lt.shallowClone(e,n.command),!l(i)||n.shaderProgramId!==e.shaderProgram.id?(n.command.shaderProgram=s1t(t,e.shaderProgram),n.shaderProgramId=e.shaderProgram.id):n.command.shaderProgram=i,n};function a1t(e,t,n){let i=e.shaderCache.getDerivedShaderProgram(t,"pick");if(l(i))return i;let o=t._attributeLocations,{sources:r,defines:s}=t.fragmentShaderSource,c=r.some(b=>b.includes("out_FragData"))?"out_FragData_0":"out_FragColor",d=`void main () { czm_non_pick_main(); if (${c}.a == 0.0) { discard; } ${c} = ${n}; -} `,u=r.length,m=new Array(u+1);for(let b=0;b<u;++b)m[b]=Je.replaceMain(r[b],"czm_non_pick_main");m[u]=d;let p=new Je({sources:m,defines:s});return e.shaderCache.createDerivedShaderProgram(t,"pick",{vertexShaderSource:t.vertexShaderSource,fragmentShaderSource:p,attributeLocations:o})}function ere(e,t){let n=e.picking.pickRenderStateCache,i=n[t.id];if(l(i))return i;let o=ze.getState(t);o.blending.enabled=!1,o.depthMask=!0;let r=ze.fromCache(o);return n[t.id]=r,r}jZ.createPickDerivedCommand=function(e,t,n,i){l(i)||(i={});let o=i.pickCommand?.shaderProgram,r=i.pickCommand?.renderState;return i.pickCommand=lt.shallowClone(t,i.pickCommand),!l(o)||i.shaderProgramId!==t.shaderProgram.id?(i.pickCommand.shaderProgram=kWt(n,t.shaderProgram,t.pickId),i.pickCommand.renderState=ere(e,t.renderState),i.shaderProgramId=t.shaderProgram.id):(i.pickCommand.shaderProgram=o,i.pickCommand.renderState=r),i};var UWt=`uint rgba8UnormToUint32(vec4 c) +} `,u=r.length,m=new Array(u+1);for(let b=0;b<u;++b)m[b]=Je.replaceMain(r[b],"czm_non_pick_main");m[u]=d;let p=new Je({sources:m,defines:s});return e.shaderCache.createDerivedShaderProgram(t,"pick",{vertexShaderSource:t.vertexShaderSource,fragmentShaderSource:p,attributeLocations:o})}function Xte(e,t){let n=e.picking.pickRenderStateCache,i=n[t.id];if(l(i))return i;let o=ze.getState(t);o.blending.enabled=!1,o.depthMask=!0;let r=ze.fromCache(o);return n[t.id]=r,r}ZZ.createPickDerivedCommand=function(e,t,n,i){l(i)||(i={});let o=i.pickCommand?.shaderProgram,r=i.pickCommand?.renderState;return i.pickCommand=lt.shallowClone(t,i.pickCommand),!l(o)||i.shaderProgramId!==t.shaderProgram.id?(i.pickCommand.shaderProgram=a1t(n,t.shaderProgram,t.pickId),i.pickCommand.renderState=Xte(e,t.renderState),i.shaderProgramId=t.shaderProgram.id):(i.pickCommand.shaderProgram=o,i.pickCommand.renderState=r),i};var c1t=`uint rgba8UnormToUint32(vec4 c) { uvec4 b = uvec4(c * 255.0 + 0.5); return (b.r) | (b.g << 8u) | (b.b << 16u) | (b.a << 24u); } -`;function DWt(e,t,n){let i=e.shaderCache.getDerivedShaderProgram(t,"snap");if(l(i))return i;let o=t._attributeLocations,{sources:r,defines:s}=t.fragmentShaderSource,c=r.some(b=>b.includes("out_FragData"))?"out_FragData_0":"out_FragColor",d=`${UWt} +`;function l1t(e,t,n){let i=e.shaderCache.getDerivedShaderProgram(t,"snap");if(l(i))return i;let o=t._attributeLocations,{sources:r,defines:s}=t.fragmentShaderSource,c=r.some(b=>b.includes("out_FragData"))?"out_FragData_0":"out_FragColor",d=`${c1t} void main () { czm_non_snap_main(); @@ -10213,11 +10213,11 @@ void main () discard; } ${c} = ${n}; -} `,u=r.length,m=new Array(u+1);for(let b=0;b<u;++b)m[b]=Je.replaceMain(r[b],"czm_non_snap_main");m[u]=d;let p=new Je({sources:m,defines:s});return e.shaderCache.createDerivedShaderProgram(t,"snap",{vertexShaderSource:t.vertexShaderSource,fragmentShaderSource:p,attributeLocations:o})}jZ.createSnapDerivedCommand=function(e,t,n,i){l(i)||(i={});let o=i.snapCommand?.shaderProgram,r=i.snapCommand?.renderState;return i.snapCommand=lt.shallowClone(t,i.snapCommand),!l(o)||i.shaderProgramId!==t.shaderProgram.id?(i.snapCommand.shaderProgram=DWt(n,t.shaderProgram,t.snapId),i.snapCommand.renderState=ere(e,t.renderState),i.shaderProgramId=t.shaderProgram.id):(i.snapCommand.shaderProgram=o,i.snapCommand.renderState=r),i};function rA(e,t,n){let i=e.length;for(let o=0;o<i;o++)e[o].trimStart().split(/\s+/)[0]===t&&(e[o]=`${t} ${n}`)}function OWt(e){return e.isArray?e.arrayLength:St.getComponentCount(e.type)}function H2e(e,t,n){return`((${e} - float(${t})) / float(${n}))`}function K2e(e,t){let n=Nt.getMaximum(t);return`(${e}) / float(${n})`}function BWt(e,t){let n="float(value)";if(t.hasValueTransform){let i=t.offset,o=t.scale;n=H2e(n,i,o)}return e.normalized||(n=K2e(n,e.componentType)),n}function zWt(e,t,n){let o=`float(${`value.${n}`})`;if(t.hasValueTransform){let r=t.offset[n],s=t.scale[n];o=H2e(o,r,s)}return e.normalized||(o=K2e(o,e.componentType)),o}function HWt(e,t,n){let i=n.schemaId,o=n.className,r=n.propertyName,s=`pickMetadata-${i}-${o}-${r}`,a=e.shaderCache.getDerivedShaderProgram(t,s);if(l(a))return a;let c=n.metadataProperty,d=n.classProperty,u=d.getGlslType(),m=["0.0","0.0","0.0","0.0"],p=OWt(d);if(p===1)m[0]=BWt(d,c);else{let _=["x","y","z","w"];for(let S=0;S<p;S++)m[S]=zWt(d,c,_[S])}let b=t.fragmentShaderSource.defines.slice();b.push(Nu.METADATA_PICKING_ENABLED),rA(b,Nu.METADATA_PICKING_VALUE_TYPE,u),rA(b,Nu.METADATA_PICKING_VALUE_STRING,`metadata.${r}`),rA(b,Nu.METADATA_PICKING_VALUE_COMPONENT_X,m[0]),rA(b,Nu.METADATA_PICKING_VALUE_COMPONENT_Y,m[1]),rA(b,Nu.METADATA_PICKING_VALUE_COMPONENT_Z,m[2]),rA(b,Nu.METADATA_PICKING_VALUE_COMPONENT_W,m[3]);let f=new Je({sources:t.fragmentShaderSource.sources,defines:b});return e.shaderCache.createDerivedShaderProgram(t,s,{vertexShaderSource:t.vertexShaderSource,fragmentShaderSource:f,attributeLocations:t._attributeLocations})}jZ.createPickMetadataDerivedCommand=function(e,t,n,i){return l(i)||(i={}),i.pickMetadataCommand=lt.shallowClone(t,i.pickMetadataCommand),i.pickMetadataCommand.shaderProgram=HWt(n,t.shaderProgram,t.pickedMetadataInfo),i.pickMetadataCommand.renderState=ere(e,t.renderState),i.shaderProgramId=t.shaderProgram.id,i};function KWt(e,t){let n=e.shaderCache.getDerivedShaderProgram(t,"HDR");if(l(n))return n;let i=t._attributeLocations,o=t.vertexShaderSource.clone(),r=t.fragmentShaderSource.clone();return o.defines=l(o.defines)?o.defines.slice(0):[],o.defines.push("HDR"),r.defines=l(r.defines)?r.defines.slice(0):[],r.defines.push("HDR"),e.shaderCache.createDerivedShaderProgram(t,"HDR",{vertexShaderSource:o,fragmentShaderSource:r,attributeLocations:i})}jZ.createHdrCommand=function(e,t,n){l(n)||(n={});let i=n.command?.shaderProgram;return n.command=lt.shallowClone(e,n.command),!l(i)||n.shaderProgramId!==e.shaderProgram.id?(n.command.shaderProgram=KWt(t,e.shaderProgram),n.shaderProgramId=e.shaderProgram.id):n.command.shaderProgram=i,n};var qf=jZ;var ouo=x(T(),1);function _K(e){this._scene=e,this._lastAlpha=void 0,this._lastBeta=void 0,this._lastGamma=void 0,this._alpha=void 0,this._beta=void 0,this._gamma=void 0;let t=this;function n(i){let o=i.alpha;if(!l(o)){t._alpha=void 0,t._beta=void 0,t._gamma=void 0;return}t._alpha=W.toRadians(o),t._beta=W.toRadians(i.beta),t._gamma=W.toRadians(i.gamma)}window.addEventListener("deviceorientation",n,!1),this._removeListener=function(){window.removeEventListener("deviceorientation",n,!1)}}var JWt=new Ne,J2e=new Ne,jWt=new q;function QWt(e,t,n,i){let o=e.direction,r=e.right,s=e.up,a=Ne.fromAxisAngle(o,n,J2e),c=Ne.fromAxisAngle(r,i,JWt),d=Ne.multiply(c,a,c),u=Ne.fromAxisAngle(s,t,J2e);Ne.multiply(u,d,d);let m=q.fromQuaternion(d,jWt);q.multiplyByVector(m,r,r),q.multiplyByVector(m,s,s),q.multiplyByVector(m,o,o)}_K.prototype.update=function(){if(!l(this._alpha))return;l(this._lastAlpha)||(this._lastAlpha=this._alpha,this._lastBeta=this._beta,this._lastGamma=this._gamma);let e=this._lastAlpha-this._alpha,t=this._lastBeta-this._beta,n=this._lastGamma-this._gamma;QWt(this._scene.camera,-e,t,n),this._lastAlpha=this._alpha,this._lastBeta=this._beta,this._lastGamma=this._gamma};_K.prototype.isDestroyed=function(){return!1};_K.prototype.destroy=function(){return this._removeListener(),ue(this)};var g9=_K;var duo=x(T(),1);function tre(){this.enabled=!0,this.renderable=!0,this.density=6e-4,this.heightScalar=.001,this._heightFalloff=.59,this.maxHeight=8e5,this.visualDensityScalar=.15,this.screenSpaceErrorFactor=2,this.minimumBrightness=.03}Object.defineProperties(tre.prototype,{heightFalloff:{get:function(){return this._heightFalloff},set:function(e){this._heightFalloff=e}}});var qWt=new h;tre.prototype.update=function(e){if(!(e.fog.enabled=this.enabled))return;e.fog.renderable=this.renderable;let n=e.camera,i=n.positionCartographic;if(!l(i)||i.height>this.maxHeight||e.mode!==se.SCENE3D){e.fog.enabled=!1,e.fog.density=0;return}let o=i.height,r=this.density*this.heightScalar*Math.pow(Math.max(o/this.maxHeight,W.EPSILON4),-Math.max(this._heightFalloff,0)),s=h.normalize(n.positionWC,qWt),a=Math.abs(h.dot(n.directionWC,s));r*=1-a,e.fog.density=r,e.fog.visualDensityScalar=this.visualDensityScalar,e.fog.sse=this.screenSpaceErrorFactor,e.fog.minimumBrightness=this.minimumBrightness};var y9=tre;var Zuo=x(T(),1);var xc={OPAQUE_FRONT_FACE:0,OPAQUE_BACK_FACE:1,DEPTH_ONLY_FRONT_FACE:2,DEPTH_ONLY_BACK_FACE:3,DEPTH_ONLY_FRONT_AND_BACK_FACE:4,TRANSLUCENT_FRONT_FACE:5,TRANSLUCENT_BACK_FACE:6,TRANSLUCENT_FRONT_FACE_MANUAL_DEPTH_TEST:7,TRANSLUCENT_BACK_FACE_MANUAL_DEPTH_TEST:8,PICK_FRONT_FACE:9,PICK_BACK_FACE:10,DERIVED_COMMANDS_MAXIMUM_LENGTH:11},QZ=xc.DERIVED_COMMANDS_MAXIMUM_LENGTH,rFe=["opaqueFrontFaceCommand","opaqueBackFaceCommand","depthOnlyFrontFaceCommand","depthOnlyBackFaceCommand","depthOnlyFrontAndBackFaceCommand","translucentFrontFaceCommand","translucentBackFaceCommand","translucentFrontFaceManualDepthTestCommand","translucentBackFaceManualDepthTestCommand","pickFrontFaceCommand","pickBackFaceCommand"];function qZ(){this._frontFaceAlphaByDistance=new Kt(0,1,0,1),this._backFaceAlphaByDistance=new Kt(0,1,0,1),this._frontFaceTranslucent=!1,this._backFaceTranslucent=!1,this._requiresManualDepthTest=!1,this._sunVisibleThroughGlobe=!1,this._environmentVisible=!1,this._useDepthPlane=!1,this._numberOfTextureUniforms=0,this._globeTranslucencyFramebuffer=void 0,this._rectangle=re.clone(re.MAX_VALUE),this._derivedCommandKey=0,this._derivedCommandsDirty=!1,this._derivedCommandPacks=void 0,this._derivedCommandTypes=new Array(QZ),this._derivedBlendCommandTypes=new Array(QZ),this._derivedPickCommandTypes=new Array(QZ),this._derivedCommandTypesToUpdate=new Array(QZ),this._derivedCommandsLength=0,this._derivedBlendCommandsLength=0,this._derivedPickCommandsLength=0,this._derivedCommandsToUpdateLength=0}Object.defineProperties(qZ.prototype,{frontFaceAlphaByDistance:{get:function(){return this._frontFaceAlphaByDistance}},backFaceAlphaByDistance:{get:function(){return this._backFaceAlphaByDistance}},translucent:{get:function(){return this._frontFaceTranslucent}},sunVisibleThroughGlobe:{get:function(){return this._sunVisibleThroughGlobe}},environmentVisible:{get:function(){return this._environmentVisible}},useDepthPlane:{get:function(){return this._useDepthPlane}},numberOfTextureUniforms:{get:function(){return this._numberOfTextureUniforms}},rectangle:{get:function(){return this._rectangle}}});qZ.prototype.update=function(e){let t=e.globe;if(!l(t)||!t.show){this._frontFaceTranslucent=!1,this._backFaceTranslucent=!1,this._sunVisibleThroughGlobe=!0,this._environmentVisible=!0,this._useDepthPlane=!1;return}this._frontFaceAlphaByDistance=j2e(t.translucency.enabled,t.translucency.frontFaceAlpha,t.translucency.frontFaceAlphaByDistance,this._frontFaceAlphaByDistance),this._backFaceAlphaByDistance=j2e(t.translucency.enabled,t.translucency.backFaceAlpha,t.translucency.backFaceAlphaByDistance,this._backFaceAlphaByDistance),this._frontFaceTranslucent=Q2e(t.translucency.enabled,this._frontFaceAlphaByDistance,t),this._backFaceTranslucent=Q2e(t.translucency.enabled,this._backFaceAlphaByDistance,t),this._requiresManualDepthTest=nvt(this,e,t),this._sunVisibleThroughGlobe=$Wt(this,e),this._environmentVisible=evt(this,e),this._useDepthPlane=tvt(this,e),this._numberOfTextureUniforms=ivt(this),this._rectangle=re.clone(t.translucency.rectangle,this._rectangle),ovt(this,e)};function j2e(e,t,n,i){return e?l(n)?(Kt.clone(n,i),i.nearValue*=t,i.farValue*=t,i):(i.nearValue=t,i.farValue=t,i):(i.nearValue=1,i.farValue=1,i)}function Q2e(e,t,n){return e&&(n.baseColor.alpha<1||t.nearValue<1||t.farValue<1)}function $Wt(e,t){let n=e._frontFaceTranslucent,i=e._backFaceTranslucent;return n&&(t.cameraUnderground||i)}function evt(e,t){return!t.cameraUnderground||e._frontFaceTranslucent}function tvt(e,t){return!t.cameraUnderground&&!e._frontFaceTranslucent}function nvt(e,t,n){return e._frontFaceTranslucent&&!e._backFaceTranslucent&&!n.depthTestAgainstTerrain&&t.mode!==se.SCENE2D&&t.context.depthTexture}function ivt(e){let t=0;return e._frontFaceTranslucent&&++t,e._requiresManualDepthTest&&++t,t}function ovt(e,t){e._derivedCommandsLength=nre(e,t,!1,!1,e._derivedCommandTypes),e._derivedBlendCommandsLength=nre(e,t,!0,!1,e._derivedBlendCommandTypes),e._derivedPickCommandsLength=nre(e,t,!1,!0,e._derivedPickCommandTypes);let n,i=0;for(n=0;n<e._derivedCommandsLength;++n)i|=1<<e._derivedCommandTypes[n];for(n=0;n<e._derivedBlendCommandsLength;++n)i|=1<<e._derivedBlendCommandTypes[n];for(n=0;n<e._derivedPickCommandsLength;++n)i|=1<<e._derivedPickCommandTypes[n];let o=0;for(n=0;n<QZ;++n)(i&1<<n)>0&&(e._derivedCommandTypesToUpdate[o++]=n);e._derivedCommandsToUpdateLength=o;let r=i!==e._derivedCommandKey;e._derivedCommandKey=i,e._derivedCommandsDirty=r,!l(e._derivedCommandPacks)&&e._frontFaceTranslucent&&(e._derivedCommandPacks=xvt())}function nre(e,t,n,i,o){let r=0,s=e._frontFaceTranslucent,a=e._backFaceTranslucent;if(!s)return r;let c=t.cameraUnderground,d=e._requiresManualDepthTest,u=i?xc.PICK_FRONT_FACE:d?xc.TRANSLUCENT_FRONT_FACE_MANUAL_DEPTH_TEST:xc.TRANSLUCENT_FRONT_FACE,m=i?xc.PICK_BACK_FACE:d?xc.TRANSLUCENT_BACK_FACE_MANUAL_DEPTH_TEST:xc.TRANSLUCENT_BACK_FACE;return t.mode===se.SCENE2D?(o[r++]=xc.DEPTH_ONLY_FRONT_FACE,o[r++]=u,r):(a?(n||(o[r++]=xc.DEPTH_ONLY_FRONT_AND_BACK_FACE),c?(o[r++]=u,o[r++]=m):(o[r++]=m,o[r++]=u)):c?(n||(o[r++]=xc.DEPTH_ONLY_BACK_FACE),o[r++]=xc.OPAQUE_FRONT_FACE,o[r++]=m):(n||(o[r++]=xc.DEPTH_ONLY_FRONT_FACE),o[r++]=xc.OPAQUE_BACK_FACE,o[r++]=u),r)}function Sh(e,t){let n=e.indexOf(t);n>-1&&e.splice(n,1)}function q2e(e,t){return e.indexOf(t)>-1}function rvt(e,t){Sh(e.defines,"TRANSLUCENT"),Sh(t.defines,"TRANSLUCENT")}function svt(e,t){Sh(e.defines,"GROUND_ATMOSPHERE"),Sh(t.defines,"GROUND_ATMOSPHERE"),Sh(e.defines,"FOG"),Sh(t.defines,"FOG"),Sh(e.defines,"TRANSLUCENT"),Sh(t.defines,"TRANSLUCENT")}function ire(e,t){if(q2e(t.defines,"TILE_LIMIT_RECTANGLE")||q2e(t.defines,"ENABLE_CLIPPING_PLANES"))return;let n=`void main() +} `,u=r.length,m=new Array(u+1);for(let b=0;b<u;++b)m[b]=Je.replaceMain(r[b],"czm_non_snap_main");m[u]=d;let p=new Je({sources:m,defines:s});return e.shaderCache.createDerivedShaderProgram(t,"snap",{vertexShaderSource:t.vertexShaderSource,fragmentShaderSource:p,attributeLocations:o})}ZZ.createSnapDerivedCommand=function(e,t,n,i){l(i)||(i={});let o=i.snapCommand?.shaderProgram,r=i.snapCommand?.renderState;return i.snapCommand=lt.shallowClone(t,i.snapCommand),!l(o)||i.shaderProgramId!==t.shaderProgram.id?(i.snapCommand.shaderProgram=l1t(n,t.shaderProgram,t.snapId),i.snapCommand.renderState=Xte(e,t.renderState),i.shaderProgramId=t.shaderProgram.id):(i.snapCommand.shaderProgram=o,i.snapCommand.renderState=r),i};function rE(e,t,n){let i=e.length;for(let o=0;o<i;o++)e[o].trimStart().split(/\s+/)[0]===t&&(e[o]=`${t} ${n}`)}function d1t(e){return e.isArray?e.arrayLength:St.getComponentCount(e.type)}function eAe(e,t,n){return`((${e} - float(${t})) / float(${n}))`}function tAe(e,t){let n=Nt.getMaximum(t);return`(${e}) / float(${n})`}function u1t(e,t){let n="float(value)";if(t.hasValueTransform){let i=t.offset,o=t.scale;n=eAe(n,i,o)}return e.normalized||(n=tAe(n,e.componentType)),n}function m1t(e,t,n){let o=`float(${`value.${n}`})`;if(t.hasValueTransform){let r=t.offset[n],s=t.scale[n];o=eAe(o,r,s)}return e.normalized||(o=tAe(o,e.componentType)),o}function h1t(e,t,n){let i=n.schemaId,o=n.className,r=n.propertyName,s=`pickMetadata-${i}-${o}-${r}`,a=e.shaderCache.getDerivedShaderProgram(t,s);if(l(a))return a;let c=n.metadataProperty,d=n.classProperty,u=d.getGlslType(),m=["0.0","0.0","0.0","0.0"],p=d1t(d);if(p===1)m[0]=u1t(d,c);else{let _=["x","y","z","w"];for(let S=0;S<p;S++)m[S]=m1t(d,c,_[S])}let b=t.fragmentShaderSource.defines.slice();b.push(Ou.METADATA_PICKING_ENABLED),rE(b,Ou.METADATA_PICKING_VALUE_TYPE,u),rE(b,Ou.METADATA_PICKING_VALUE_STRING,`metadata.${r}`),rE(b,Ou.METADATA_PICKING_VALUE_COMPONENT_X,m[0]),rE(b,Ou.METADATA_PICKING_VALUE_COMPONENT_Y,m[1]),rE(b,Ou.METADATA_PICKING_VALUE_COMPONENT_Z,m[2]),rE(b,Ou.METADATA_PICKING_VALUE_COMPONENT_W,m[3]);let f=new Je({sources:t.fragmentShaderSource.sources,defines:b});return e.shaderCache.createDerivedShaderProgram(t,s,{vertexShaderSource:t.vertexShaderSource,fragmentShaderSource:f,attributeLocations:t._attributeLocations})}ZZ.createPickMetadataDerivedCommand=function(e,t,n,i){return l(i)||(i={}),i.pickMetadataCommand=lt.shallowClone(t,i.pickMetadataCommand),i.pickMetadataCommand.shaderProgram=h1t(n,t.shaderProgram,t.pickedMetadataInfo),i.pickMetadataCommand.renderState=Xte(e,t.renderState),i.shaderProgramId=t.shaderProgram.id,i};function f1t(e,t){let n=e.shaderCache.getDerivedShaderProgram(t,"HDR");if(l(n))return n;let i=t._attributeLocations,o=t.vertexShaderSource.clone(),r=t.fragmentShaderSource.clone();return o.defines=l(o.defines)?o.defines.slice(0):[],o.defines.push("HDR"),r.defines=l(r.defines)?r.defines.slice(0):[],r.defines.push("HDR"),e.shaderCache.createDerivedShaderProgram(t,"HDR",{vertexShaderSource:o,fragmentShaderSource:r,attributeLocations:i})}ZZ.createHdrCommand=function(e,t,n){l(n)||(n={});let i=n.command?.shaderProgram;return n.command=lt.shallowClone(e,n.command),!l(i)||n.shaderProgramId!==e.shaderProgram.id?(n.command.shaderProgram=f1t(t,e.shaderProgram),n.shaderProgramId=e.shaderProgram.id):n.command.shaderProgram=i,n};var kf=ZZ;var u6i=x(T(),1);function yz(e){this._scene=e,this._lastAlpha=void 0,this._lastBeta=void 0,this._lastGamma=void 0,this._alpha=void 0,this._beta=void 0,this._gamma=void 0;let t=this;function n(i){let o=i.alpha;if(!l(o)){t._alpha=void 0,t._beta=void 0,t._gamma=void 0;return}t._alpha=W.toRadians(o),t._beta=W.toRadians(i.beta),t._gamma=W.toRadians(i.gamma)}window.addEventListener("deviceorientation",n,!1),this._removeListener=function(){window.removeEventListener("deviceorientation",n,!1)}}var p1t=new Ne,nAe=new Ne,b1t=new q;function g1t(e,t,n,i){let o=e.direction,r=e.right,s=e.up,a=Ne.fromAxisAngle(o,n,nAe),c=Ne.fromAxisAngle(r,i,p1t),d=Ne.multiply(c,a,c),u=Ne.fromAxisAngle(s,t,nAe);Ne.multiply(u,d,d);let m=q.fromQuaternion(d,b1t);q.multiplyByVector(m,r,r),q.multiplyByVector(m,s,s),q.multiplyByVector(m,o,o)}yz.prototype.update=function(){if(!l(this._alpha))return;l(this._lastAlpha)||(this._lastAlpha=this._alpha,this._lastBeta=this._beta,this._lastGamma=this._gamma);let e=this._lastAlpha-this._alpha,t=this._lastBeta-this._beta,n=this._lastGamma-this._gamma;g1t(this._scene.camera,-e,t,n),this._lastAlpha=this._alpha,this._lastBeta=this._beta,this._lastGamma=this._gamma};yz.prototype.isDestroyed=function(){return!1};yz.prototype.destroy=function(){return this._removeListener(),ue(this)};var aw=yz;var g6i=x(T(),1);function Nte(){this.enabled=!0,this.renderable=!0,this.density=6e-4,this.heightScalar=.001,this._heightFalloff=.59,this.maxHeight=8e5,this.visualDensityScalar=.15,this.screenSpaceErrorFactor=2,this.minimumBrightness=.03}Object.defineProperties(Nte.prototype,{heightFalloff:{get:function(){return this._heightFalloff},set:function(e){this._heightFalloff=e}}});var y1t=new h;Nte.prototype.update=function(e){if(!(e.fog.enabled=this.enabled))return;e.fog.renderable=this.renderable;let n=e.camera,i=n.positionCartographic;if(!l(i)||i.height>this.maxHeight||e.mode!==se.SCENE3D){e.fog.enabled=!1,e.fog.density=0;return}let o=i.height,r=this.density*this.heightScalar*Math.pow(Math.max(o/this.maxHeight,W.EPSILON4),-Math.max(this._heightFalloff,0)),s=h.normalize(n.positionWC,y1t),a=Math.abs(h.dot(n.directionWC,s));r*=1-a,e.fog.density=r,e.fog.visualDensityScalar=this.visualDensityScalar,e.fog.sse=this.screenSpaceErrorFactor,e.fog.minimumBrightness=this.minimumBrightness};var cw=Nte;var L6i=x(T(),1);var yc={OPAQUE_FRONT_FACE:0,OPAQUE_BACK_FACE:1,DEPTH_ONLY_FRONT_FACE:2,DEPTH_ONLY_BACK_FACE:3,DEPTH_ONLY_FRONT_AND_BACK_FACE:4,TRANSLUCENT_FRONT_FACE:5,TRANSLUCENT_BACK_FACE:6,TRANSLUCENT_FRONT_FACE_MANUAL_DEPTH_TEST:7,TRANSLUCENT_BACK_FACE_MANUAL_DEPTH_TEST:8,PICK_FRONT_FACE:9,PICK_BACK_FACE:10,DERIVED_COMMANDS_MAXIMUM_LENGTH:11},RZ=yc.DERIVED_COMMANDS_MAXIMUM_LENGTH,mAe=["opaqueFrontFaceCommand","opaqueBackFaceCommand","depthOnlyFrontFaceCommand","depthOnlyBackFaceCommand","depthOnlyFrontAndBackFaceCommand","translucentFrontFaceCommand","translucentBackFaceCommand","translucentFrontFaceManualDepthTestCommand","translucentBackFaceManualDepthTestCommand","pickFrontFaceCommand","pickBackFaceCommand"];function CZ(){this._frontFaceAlphaByDistance=new Kt(0,1,0,1),this._backFaceAlphaByDistance=new Kt(0,1,0,1),this._frontFaceTranslucent=!1,this._backFaceTranslucent=!1,this._requiresManualDepthTest=!1,this._sunVisibleThroughGlobe=!1,this._environmentVisible=!1,this._useDepthPlane=!1,this._numberOfTextureUniforms=0,this._globeTranslucencyFramebuffer=void 0,this._rectangle=re.clone(re.MAX_VALUE),this._derivedCommandKey=0,this._derivedCommandsDirty=!1,this._derivedCommandPacks=void 0,this._derivedCommandTypes=new Array(RZ),this._derivedBlendCommandTypes=new Array(RZ),this._derivedPickCommandTypes=new Array(RZ),this._derivedCommandTypesToUpdate=new Array(RZ),this._derivedCommandsLength=0,this._derivedBlendCommandsLength=0,this._derivedPickCommandsLength=0,this._derivedCommandsToUpdateLength=0}Object.defineProperties(CZ.prototype,{frontFaceAlphaByDistance:{get:function(){return this._frontFaceAlphaByDistance}},backFaceAlphaByDistance:{get:function(){return this._backFaceAlphaByDistance}},translucent:{get:function(){return this._frontFaceTranslucent}},sunVisibleThroughGlobe:{get:function(){return this._sunVisibleThroughGlobe}},environmentVisible:{get:function(){return this._environmentVisible}},useDepthPlane:{get:function(){return this._useDepthPlane}},numberOfTextureUniforms:{get:function(){return this._numberOfTextureUniforms}},rectangle:{get:function(){return this._rectangle}}});CZ.prototype.update=function(e){let t=e.globe;if(!l(t)||!t.show){this._frontFaceTranslucent=!1,this._backFaceTranslucent=!1,this._sunVisibleThroughGlobe=!0,this._environmentVisible=!0,this._useDepthPlane=!1;return}this._frontFaceAlphaByDistance=iAe(t.translucency.enabled,t.translucency.frontFaceAlpha,t.translucency.frontFaceAlphaByDistance,this._frontFaceAlphaByDistance),this._backFaceAlphaByDistance=iAe(t.translucency.enabled,t.translucency.backFaceAlpha,t.translucency.backFaceAlphaByDistance,this._backFaceAlphaByDistance),this._frontFaceTranslucent=oAe(t.translucency.enabled,this._frontFaceAlphaByDistance,t),this._backFaceTranslucent=oAe(t.translucency.enabled,this._backFaceAlphaByDistance,t),this._requiresManualDepthTest=S1t(this,e,t),this._sunVisibleThroughGlobe=x1t(this,e),this._environmentVisible=T1t(this,e),this._useDepthPlane=_1t(this,e),this._numberOfTextureUniforms=Z1t(this),this._rectangle=re.clone(t.translucency.rectangle,this._rectangle),R1t(this,e)};function iAe(e,t,n,i){return e?l(n)?(Kt.clone(n,i),i.nearValue*=t,i.farValue*=t,i):(i.nearValue=t,i.farValue=t,i):(i.nearValue=1,i.farValue=1,i)}function oAe(e,t,n){return e&&(n.baseColor.alpha<1||t.nearValue<1||t.farValue<1)}function x1t(e,t){let n=e._frontFaceTranslucent,i=e._backFaceTranslucent;return n&&(t.cameraUnderground||i)}function T1t(e,t){return!t.cameraUnderground||e._frontFaceTranslucent}function _1t(e,t){return!t.cameraUnderground&&!e._frontFaceTranslucent}function S1t(e,t,n){return e._frontFaceTranslucent&&!e._backFaceTranslucent&&!n.depthTestAgainstTerrain&&t.mode!==se.SCENE2D&&t.context.depthTexture}function Z1t(e){let t=0;return e._frontFaceTranslucent&&++t,e._requiresManualDepthTest&&++t,t}function R1t(e,t){e._derivedCommandsLength=Yte(e,t,!1,!1,e._derivedCommandTypes),e._derivedBlendCommandsLength=Yte(e,t,!0,!1,e._derivedBlendCommandTypes),e._derivedPickCommandsLength=Yte(e,t,!1,!0,e._derivedPickCommandTypes);let n,i=0;for(n=0;n<e._derivedCommandsLength;++n)i|=1<<e._derivedCommandTypes[n];for(n=0;n<e._derivedBlendCommandsLength;++n)i|=1<<e._derivedBlendCommandTypes[n];for(n=0;n<e._derivedPickCommandsLength;++n)i|=1<<e._derivedPickCommandTypes[n];let o=0;for(n=0;n<RZ;++n)(i&1<<n)>0&&(e._derivedCommandTypesToUpdate[o++]=n);e._derivedCommandsToUpdateLength=o;let r=i!==e._derivedCommandKey;e._derivedCommandKey=i,e._derivedCommandsDirty=r,!l(e._derivedCommandPacks)&&e._frontFaceTranslucent&&(e._derivedCommandPacks=M1t())}function Yte(e,t,n,i,o){let r=0,s=e._frontFaceTranslucent,a=e._backFaceTranslucent;if(!s)return r;let c=t.cameraUnderground,d=e._requiresManualDepthTest,u=i?yc.PICK_FRONT_FACE:d?yc.TRANSLUCENT_FRONT_FACE_MANUAL_DEPTH_TEST:yc.TRANSLUCENT_FRONT_FACE,m=i?yc.PICK_BACK_FACE:d?yc.TRANSLUCENT_BACK_FACE_MANUAL_DEPTH_TEST:yc.TRANSLUCENT_BACK_FACE;return t.mode===se.SCENE2D?(o[r++]=yc.DEPTH_ONLY_FRONT_FACE,o[r++]=u,r):(a?(n||(o[r++]=yc.DEPTH_ONLY_FRONT_AND_BACK_FACE),c?(o[r++]=u,o[r++]=m):(o[r++]=m,o[r++]=u)):c?(n||(o[r++]=yc.DEPTH_ONLY_BACK_FACE),o[r++]=yc.OPAQUE_FRONT_FACE,o[r++]=m):(n||(o[r++]=yc.DEPTH_ONLY_FRONT_FACE),o[r++]=yc.OPAQUE_BACK_FACE,o[r++]=u),r)}function bh(e,t){let n=e.indexOf(t);n>-1&&e.splice(n,1)}function rAe(e,t){return e.indexOf(t)>-1}function C1t(e,t){bh(e.defines,"TRANSLUCENT"),bh(t.defines,"TRANSLUCENT")}function V1t(e,t){bh(e.defines,"GROUND_ATMOSPHERE"),bh(t.defines,"GROUND_ATMOSPHERE"),bh(e.defines,"FOG"),bh(t.defines,"FOG"),bh(e.defines,"TRANSLUCENT"),bh(t.defines,"TRANSLUCENT")}function Mte(e,t){if(rAe(t.defines,"TILE_LIMIT_RECTANGLE")||rAe(t.defines,"ENABLE_CLIPPING_PLANES"))return;let n=`void main() { out_FragColor = vec4(1.0); } -`;t.sources=[n]}function ore(e,t){let n=t.sources,i=n.length;for(let r=0;r<i;++r)n[r]=Je.replaceMain(n[r],"czm_globe_translucency_main");n.push(` +`;t.sources=[n]}function wte(e,t){let n=t.sources,i=n.length;for(let r=0;r<i;++r)n[r]=Je.replaceMain(n[r],"czm_globe_translucency_main");n.push(` uniform sampler2D u_classificationTexture; void main() @@ -10244,7 +10244,7 @@ void main() } out_FragColor = classificationColor * vec4(classificationColor.aaa, 1.0) + out_FragColor * (1.0 - classificationColor.a); } -`)}function sFe(e,t){ore(e,t),Sh(e.defines,"GROUND_ATMOSPHERE"),Sh(t.defines,"GROUND_ATMOSPHERE"),Sh(e.defines,"FOG"),Sh(t.defines,"FOG")}function avt(e,t){ore(e,t),e.defines.push("GENERATE_POSITION"),t.defines.push("MANUAL_DEPTH_TEST")}function cvt(e,t){sFe(e,t),e.defines.push("GENERATE_POSITION"),t.defines.push("MANUAL_DEPTH_TEST")}function $2e(e,t){let n=`uniform sampler2D u_classificationTexture; +`)}function hAe(e,t){wte(e,t),bh(e.defines,"GROUND_ATMOSPHERE"),bh(t.defines,"GROUND_ATMOSPHERE"),bh(e.defines,"FOG"),bh(t.defines,"FOG")}function E1t(e,t){wte(e,t),e.defines.push("GENERATE_POSITION"),t.defines.push("MANUAL_DEPTH_TEST")}function A1t(e,t){hAe(e,t),e.defines.push("GENERATE_POSITION"),t.defines.push("MANUAL_DEPTH_TEST")}function sAe(e,t){let n=`uniform sampler2D u_classificationTexture; void main() { vec2 st = gl_FragCoord.xy / czm_viewport.zw; @@ -10255,13 +10255,13 @@ void main() } out_FragColor = pickColor; } -`;t.sources=[n]}function lvt(e,t,n,i,o,r){if(!l(o))return t;if(!i&&l(n))return n;let s=e.shaderCache.getDerivedShaderProgram(t,r);if(!l(s)){let a=t._attributeLocations,c=t.vertexShaderSource.clone(),d=t.fragmentShaderSource.clone();c.defines=l(c.defines)?c.defines.slice(0):[],d.defines=l(d.defines)?d.defines.slice(0):[],o(c,d),s=e.shaderCache.createDerivedShaderProgram(t,r,{vertexShaderSource:c,fragmentShaderSource:d,attributeLocations:a})}return s}function dvt(e){e.cull.face=Di.BACK,e.cull.enabled=!0}function uvt(e){e.cull.face=Di.FRONT,e.cull.enabled=!0}function mvt(e){e.cull.face=Di.BACK,e.cull.enabled=!0,e.colorMask={red:!1,green:!1,blue:!1,alpha:!1}}function hvt(e){e.cull.face=Di.FRONT,e.cull.enabled=!0,e.colorMask={red:!1,green:!1,blue:!1,alpha:!1}}function fvt(e){e.cull.enabled=!1,e.colorMask={red:!1,green:!1,blue:!1,alpha:!1}}function eFe(e){e.cull.face=Di.BACK,e.cull.enabled=!0,e.depthMask=!1,e.blending=on.ALPHA_BLEND}function tFe(e){e.cull.face=Di.FRONT,e.cull.enabled=!0,e.depthMask=!1,e.blending=on.ALPHA_BLEND}function pvt(e){e.cull.face=Di.BACK,e.cull.enabled=!0,e.blending.enabled=!1}function bvt(e){e.cull.face=Di.FRONT,e.cull.enabled=!0,e.blending.enabled=!1}function gvt(e,t,n,i,o){if(!l(i))return e;if(!n&&l(t))return t;let r=o[e.id];if(!l(r)){let s=ze.getState(e);i(s),r=ze.fromCache(s),o[e.id]=r}return r}function sA(e){return{u_classificationTexture:function(){return e._globeTranslucencyFramebuffer.classificationTexture}}}function yvt(e,t,n,i,o){return l(o)?!i&&l(n)?n:It(t,o(e),!1):t}function $f(e){this.pass=e.pass,this.pickOnly=e.pickOnly,this.getShaderProgramFunction=e.getShaderProgramFunction,this.getRenderStateFunction=e.getRenderStateFunction,this.getUniformMapFunction=e.getUniformMapFunction,this.renderStateCache={}}function xvt(){return[new $f({pass:Le.GLOBE,pickOnly:!1,getShaderProgramFunction:rvt,getRenderStateFunction:dvt,getUniformMapFunction:void 0}),new $f({pass:Le.GLOBE,pickOnly:!1,getShaderProgramFunction:svt,getRenderStateFunction:uvt,getUniformMapFunction:void 0}),new $f({pass:Le.GLOBE,pickOnly:!1,getShaderProgramFunction:ire,getRenderStateFunction:mvt,getUniformMapFunction:void 0}),new $f({pass:Le.GLOBE,pickOnly:!1,getShaderProgramFunction:ire,getRenderStateFunction:hvt,getUniformMapFunction:void 0}),new $f({pass:Le.GLOBE,pickOnly:!1,getShaderProgramFunction:ire,getRenderStateFunction:fvt,getUniformMapFunction:void 0}),new $f({pass:Le.TRANSLUCENT,pickOnly:!1,getShaderProgramFunction:ore,getRenderStateFunction:eFe,getUniformMapFunction:sA}),new $f({pass:Le.TRANSLUCENT,pickOnly:!1,getShaderProgramFunction:sFe,getRenderStateFunction:tFe,getUniformMapFunction:sA}),new $f({pass:Le.TRANSLUCENT,pickOnly:!1,getShaderProgramFunction:avt,getRenderStateFunction:eFe,getUniformMapFunction:sA}),new $f({pass:Le.TRANSLUCENT,pickOnly:!1,getShaderProgramFunction:cvt,getRenderStateFunction:tFe,getUniformMapFunction:sA}),new $f({pass:Le.TRANSLUCENT,pickOnly:!0,getShaderProgramFunction:$2e,getRenderStateFunction:pvt,getUniformMapFunction:sA}),new $f({pass:Le.TRANSLUCENT,pickOnly:!0,getShaderProgramFunction:$2e,getRenderStateFunction:bvt,getUniformMapFunction:sA})]}var nFe=new Array(QZ),iFe=new Array(QZ);qZ.prototype.updateDerivedCommands=function(e,t){let n=this._derivedCommandTypesToUpdate,i=this._derivedCommandsToUpdateLength;if(i!==0){for(let o=0;o<i;++o)iFe[o]=this._derivedCommandPacks[n[o]],nFe[o]=rFe[n[o]];Tvt(this,e,i,n,nFe,iFe,t)}};function Tvt(e,t,n,i,o,r,s){let a=t.derivedCommands.globeTranslucency,c=e._derivedCommandsDirty;if(t.dirty||!l(a)||c){t.dirty=!1,l(a)||(a={},t.derivedCommands.globeTranslucency=a);let d=s.frameNumber,u=a.uniformMapDirtyFrame??0,m=a.shaderProgramDirtyFrame??0,p=a.renderStateDirtyFrame??0,b=a.uniformMap!==t.uniformMap,f=a.shaderProgramId!==t.shaderProgram.id,y=a.renderStateId!==t.renderState.id;b&&(a.uniformMapDirtyFrame=d),f&&(a.shaderProgramDirtyFrame=d),y&&(a.renderStateDirtyFrame=d),a.uniformMap=t.uniformMap,a.shaderProgramId=t.shaderProgram.id,a.renderStateId=t.renderState.id;for(let _=0;_<n;++_){let S=r[_],Z=i[_],R=o[_],C=a[R],E,A,L;l(C)?(E=C.uniformMap,A=C.shaderProgram,L=C.renderState):(E=void 0,A=void 0,L=void 0),C=lt.shallowClone(t,C),a[R]=C;let F=C.derivedCommands.uniformMapDirtyFrame??0,I=C.derivedCommands.shaderProgramDirtyFrame??0,N=C.derivedCommands.renderStateDirtyFrame??0,g=b||F<u,V=f||I<m,G=y||N<p;g&&(C.derivedCommands.uniformMapDirtyFrame=d),V&&(C.derivedCommands.shaderProgramDirtyFrame=d),G&&(C.derivedCommands.renderStateDirtyFrame=d),C.derivedCommands.type=Z,C.pass=S.pass,C.pickOnly=S.pickOnly,C.uniformMap=yvt(e,t.uniformMap,E,g,S.getUniformMapFunction),C.shaderProgram=lvt(s.context,t.shaderProgram,A,V,S.getShaderProgramFunction,R),C.renderState=gvt(t.renderState,L,G,S.getRenderStateFunction,S.renderStateCache)}}}qZ.prototype.pushDerivedCommands=function(e,t,n){let i=n.passes.pick||n.passes.pickVoxel;if(i&&t)return;let o=this._derivedCommandTypes,r=this._derivedCommandsLength;if(i?(o=this._derivedPickCommandTypes,r=this._derivedPickCommandsLength):t&&(o=this._derivedBlendCommandTypes,r=this._derivedBlendCommandsLength),r===0){n.commandList.push(e);return}let s=e.derivedCommands.globeTranslucency;for(let a=0;a<r;++a){let c=rFe[o[a]];n.commandList.push(s[c])}};function aFe(e,t,n,i,o,r){for(let s=0;s<t;++s){let a=e[s],c=a.derivedCommands.type;(!l(r)||r.indexOf(c)>-1)&&n(a,i,o)}}function oFe(e,t,n,i,o){for(let r=0;r<t;++r)n(e[r],i,o)}var _vt=[xc.OPAQUE_FRONT_FACE,xc.OPAQUE_BACK_FACE],Svt=[xc.DEPTH_ONLY_FRONT_FACE,xc.DEPTH_ONLY_BACK_FACE,xc.DEPTH_ONLY_FRONT_AND_BACK_FACE];qZ.prototype.executeGlobeCommands=function(e,t,n,i,o){let r=i.context,s=e.commands[Le.GLOBE],a=e.indices[Le.GLOBE];a!==0&&(this._globeTranslucencyFramebuffer=n,n.clearClassification(r,o),aFe(s,a,t,i,o,_vt))};qZ.prototype.executeGlobeClassificationCommands=function(e,t,n,i,o){let{context:r}=i,{uniformState:s}=r,a=e.commands[Le.GLOBE],c=e.indices[Le.GLOBE],d=e.commands[Le.TERRAIN_CLASSIFICATION],u=e.indices[Le.TERRAIN_CLASSIFICATION];if(c===0||u===0)return;let m=this._frontFaceTranslucent,p=this._backFaceTranslucent;if((!m||!p)&&oFe(d,u,t,i,o),!m&&!p)return;this._globeTranslucencyFramebuffer=n;let b=s.globeDepthTexture,f=o.framebuffer;if(o.framebuffer=n.classificationFramebuffer,aFe(a,c,t,i,o,Svt),r.depthTexture){let y=n.packDepth(r,o);s.globeDepthTexture=y}oFe(d,u,t,i,o),s.globeDepthTexture=b,o.framebuffer=f};var x9=qZ;var Ouo=x(T(),1);var Cuo=x(T(),1),au=`uniform sampler2D colorTexture; +`;t.sources=[n]}function G1t(e,t,n,i,o,r){if(!l(o))return t;if(!i&&l(n))return n;let s=e.shaderCache.getDerivedShaderProgram(t,r);if(!l(s)){let a=t._attributeLocations,c=t.vertexShaderSource.clone(),d=t.fragmentShaderSource.clone();c.defines=l(c.defines)?c.defines.slice(0):[],d.defines=l(d.defines)?d.defines.slice(0):[],o(c,d),s=e.shaderCache.createDerivedShaderProgram(t,r,{vertexShaderSource:c,fragmentShaderSource:d,attributeLocations:a})}return s}function L1t(e){e.cull.face=Ui.BACK,e.cull.enabled=!0}function W1t(e){e.cull.face=Ui.FRONT,e.cull.enabled=!0}function v1t(e){e.cull.face=Ui.BACK,e.cull.enabled=!0,e.colorMask={red:!1,green:!1,blue:!1,alpha:!1}}function F1t(e){e.cull.face=Ui.FRONT,e.cull.enabled=!0,e.colorMask={red:!1,green:!1,blue:!1,alpha:!1}}function I1t(e){e.cull.enabled=!1,e.colorMask={red:!1,green:!1,blue:!1,alpha:!1}}function aAe(e){e.cull.face=Ui.BACK,e.cull.enabled=!0,e.depthMask=!1,e.blending=on.ALPHA_BLEND}function cAe(e){e.cull.face=Ui.FRONT,e.cull.enabled=!0,e.depthMask=!1,e.blending=on.ALPHA_BLEND}function P1t(e){e.cull.face=Ui.BACK,e.cull.enabled=!0,e.blending.enabled=!1}function X1t(e){e.cull.face=Ui.FRONT,e.cull.enabled=!0,e.blending.enabled=!1}function N1t(e,t,n,i,o){if(!l(i))return e;if(!n&&l(t))return t;let r=o[e.id];if(!l(r)){let s=ze.getState(e);i(s),r=ze.fromCache(s),o[e.id]=r}return r}function sE(e){return{u_classificationTexture:function(){return e._globeTranslucencyFramebuffer.classificationTexture}}}function Y1t(e,t,n,i,o){return l(o)?!i&&l(n)?n:It(t,o(e),!1):t}function Uf(e){this.pass=e.pass,this.pickOnly=e.pickOnly,this.getShaderProgramFunction=e.getShaderProgramFunction,this.getRenderStateFunction=e.getRenderStateFunction,this.getUniformMapFunction=e.getUniformMapFunction,this.renderStateCache={}}function M1t(){return[new Uf({pass:Le.GLOBE,pickOnly:!1,getShaderProgramFunction:C1t,getRenderStateFunction:L1t,getUniformMapFunction:void 0}),new Uf({pass:Le.GLOBE,pickOnly:!1,getShaderProgramFunction:V1t,getRenderStateFunction:W1t,getUniformMapFunction:void 0}),new Uf({pass:Le.GLOBE,pickOnly:!1,getShaderProgramFunction:Mte,getRenderStateFunction:v1t,getUniformMapFunction:void 0}),new Uf({pass:Le.GLOBE,pickOnly:!1,getShaderProgramFunction:Mte,getRenderStateFunction:F1t,getUniformMapFunction:void 0}),new Uf({pass:Le.GLOBE,pickOnly:!1,getShaderProgramFunction:Mte,getRenderStateFunction:I1t,getUniformMapFunction:void 0}),new Uf({pass:Le.TRANSLUCENT,pickOnly:!1,getShaderProgramFunction:wte,getRenderStateFunction:aAe,getUniformMapFunction:sE}),new Uf({pass:Le.TRANSLUCENT,pickOnly:!1,getShaderProgramFunction:hAe,getRenderStateFunction:cAe,getUniformMapFunction:sE}),new Uf({pass:Le.TRANSLUCENT,pickOnly:!1,getShaderProgramFunction:E1t,getRenderStateFunction:aAe,getUniformMapFunction:sE}),new Uf({pass:Le.TRANSLUCENT,pickOnly:!1,getShaderProgramFunction:A1t,getRenderStateFunction:cAe,getUniformMapFunction:sE}),new Uf({pass:Le.TRANSLUCENT,pickOnly:!0,getShaderProgramFunction:sAe,getRenderStateFunction:P1t,getUniformMapFunction:sE}),new Uf({pass:Le.TRANSLUCENT,pickOnly:!0,getShaderProgramFunction:sAe,getRenderStateFunction:X1t,getUniformMapFunction:sE})]}var lAe=new Array(RZ),dAe=new Array(RZ);CZ.prototype.updateDerivedCommands=function(e,t){let n=this._derivedCommandTypesToUpdate,i=this._derivedCommandsToUpdateLength;if(i!==0){for(let o=0;o<i;++o)dAe[o]=this._derivedCommandPacks[n[o]],lAe[o]=mAe[n[o]];w1t(this,e,i,n,lAe,dAe,t)}};function w1t(e,t,n,i,o,r,s){let a=t.derivedCommands.globeTranslucency,c=e._derivedCommandsDirty;if(t.dirty||!l(a)||c){t.dirty=!1,l(a)||(a={},t.derivedCommands.globeTranslucency=a);let d=s.frameNumber,u=a.uniformMapDirtyFrame??0,m=a.shaderProgramDirtyFrame??0,p=a.renderStateDirtyFrame??0,b=a.uniformMap!==t.uniformMap,f=a.shaderProgramId!==t.shaderProgram.id,y=a.renderStateId!==t.renderState.id;b&&(a.uniformMapDirtyFrame=d),f&&(a.shaderProgramDirtyFrame=d),y&&(a.renderStateDirtyFrame=d),a.uniformMap=t.uniformMap,a.shaderProgramId=t.shaderProgram.id,a.renderStateId=t.renderState.id;for(let _=0;_<n;++_){let S=r[_],Z=i[_],R=o[_],C=a[R],E,A,L;l(C)?(E=C.uniformMap,A=C.shaderProgram,L=C.renderState):(E=void 0,A=void 0,L=void 0),C=lt.shallowClone(t,C),a[R]=C;let F=C.derivedCommands.uniformMapDirtyFrame??0,I=C.derivedCommands.shaderProgramDirtyFrame??0,N=C.derivedCommands.renderStateDirtyFrame??0,g=b||F<u,V=f||I<m,G=y||N<p;g&&(C.derivedCommands.uniformMapDirtyFrame=d),V&&(C.derivedCommands.shaderProgramDirtyFrame=d),G&&(C.derivedCommands.renderStateDirtyFrame=d),C.derivedCommands.type=Z,C.pass=S.pass,C.pickOnly=S.pickOnly,C.uniformMap=Y1t(e,t.uniformMap,E,g,S.getUniformMapFunction),C.shaderProgram=G1t(s.context,t.shaderProgram,A,V,S.getShaderProgramFunction,R),C.renderState=N1t(t.renderState,L,G,S.getRenderStateFunction,S.renderStateCache)}}}CZ.prototype.pushDerivedCommands=function(e,t,n){let i=n.passes.pick||n.passes.pickVoxel;if(i&&t)return;let o=this._derivedCommandTypes,r=this._derivedCommandsLength;if(i?(o=this._derivedPickCommandTypes,r=this._derivedPickCommandsLength):t&&(o=this._derivedBlendCommandTypes,r=this._derivedBlendCommandsLength),r===0){n.commandList.push(e);return}let s=e.derivedCommands.globeTranslucency;for(let a=0;a<r;++a){let c=mAe[o[a]];n.commandList.push(s[c])}};function fAe(e,t,n,i,o,r){for(let s=0;s<t;++s){let a=e[s],c=a.derivedCommands.type;(!l(r)||r.indexOf(c)>-1)&&n(a,i,o)}}function uAe(e,t,n,i,o){for(let r=0;r<t;++r)n(e[r],i,o)}var k1t=[yc.OPAQUE_FRONT_FACE,yc.OPAQUE_BACK_FACE],U1t=[yc.DEPTH_ONLY_FRONT_FACE,yc.DEPTH_ONLY_BACK_FACE,yc.DEPTH_ONLY_FRONT_AND_BACK_FACE];CZ.prototype.executeGlobeCommands=function(e,t,n,i,o){let r=i.context,s=e.commands[Le.GLOBE],a=e.indices[Le.GLOBE];a!==0&&(this._globeTranslucencyFramebuffer=n,n.clearClassification(r,o),fAe(s,a,t,i,o,k1t))};CZ.prototype.executeGlobeClassificationCommands=function(e,t,n,i,o){let{context:r}=i,{uniformState:s}=r,a=e.commands[Le.GLOBE],c=e.indices[Le.GLOBE],d=e.commands[Le.TERRAIN_CLASSIFICATION],u=e.indices[Le.TERRAIN_CLASSIFICATION];if(c===0||u===0)return;let m=this._frontFaceTranslucent,p=this._backFaceTranslucent;if((!m||!p)&&uAe(d,u,t,i,o),!m&&!p)return;this._globeTranslucencyFramebuffer=n;let b=s.globeDepthTexture,f=o.framebuffer;if(o.framebuffer=n.classificationFramebuffer,fAe(a,c,t,i,o,U1t),r.depthTexture){let y=n.packDepth(r,o);s.globeDepthTexture=y}uAe(d,u,t,i,o),s.globeDepthTexture=b,o.framebuffer=f};var lw=CZ;var Q6i=x(T(),1);var v6i=x(T(),1),tu=`uniform sampler2D colorTexture; in vec2 v_textureCoordinates; void main() { out_FragColor = texture(colorTexture, v_textureCoordinates); } -`;function F0(){this._numSamples=1,this.previousFramebuffer=void 0,this._previousFramebuffer=void 0,this._depthStencilTexture=void 0,this._depthStencilRenderbuffer=void 0,this._fbo=new li({depthStencil:!0,createDepthAttachments:!1}),this._fboClassified=new li({depthStencil:!0,createDepthAttachments:!1}),this._rsUnclassified=void 0,this._rsClassified=void 0,this._unclassifiedCommand=void 0,this._classifiedCommand=void 0,this._translucentCommand=void 0,this._clearColorCommand=new ui({color:new U(0,0,0,0),owner:this}),this._clearCommand=new ui({color:new U(0,0,0,0),depth:1,stencil:0});let e=this;this._uniformMap={colorTexture:function(){return e._fbo.getColorTexture()},depthTexture:function(){return e._depthStencilTexture},classifiedTexture:function(){return e._fboClassified.getColorTexture()}}}Object.defineProperties(F0.prototype,{unclassifiedCommand:{get:function(){return this._unclassifiedCommand}}});F0.isTranslucencySupported=function(e){return e.depthTexture&&e.fragmentDepth};var Zvt={depthMask:!1,stencilTest:{enabled:!0,frontFunction:ii.EQUAL,frontOperation:{fail:Ft.KEEP,zFail:Ft.KEEP,zPass:Ft.KEEP},backFunction:ii.NEVER,reference:0,mask:Jt.CLASSIFICATION_MASK},blending:on.ALPHA_BLEND},Rvt={depthMask:!1,stencilTest:{enabled:!0,frontFunction:ii.NOT_EQUAL,frontOperation:{fail:Ft.KEEP,zFail:Ft.KEEP,zPass:Ft.KEEP},backFunction:ii.NEVER,reference:0,mask:Jt.CLASSIFICATION_MASK},blending:on.ALPHA_BLEND},Cvt={depthMask:!0,depthTest:{enabled:!0},stencilTest:Jt.setCesium3DTileBit(),stencilMask:Jt.CESIUM_3D_TILE_MASK,blending:on.ALPHA_BLEND},Vvt=`uniform sampler2D colorTexture; +`;function x0(){this._numSamples=1,this.previousFramebuffer=void 0,this._previousFramebuffer=void 0,this._depthStencilTexture=void 0,this._depthStencilRenderbuffer=void 0,this._fbo=new li({depthStencil:!0,createDepthAttachments:!1}),this._fboClassified=new li({depthStencil:!0,createDepthAttachments:!1}),this._rsUnclassified=void 0,this._rsClassified=void 0,this._unclassifiedCommand=void 0,this._classifiedCommand=void 0,this._translucentCommand=void 0,this._clearColorCommand=new ui({color:new U(0,0,0,0),owner:this}),this._clearCommand=new ui({color:new U(0,0,0,0),depth:1,stencil:0});let e=this;this._uniformMap={colorTexture:function(){return e._fbo.getColorTexture()},depthTexture:function(){return e._depthStencilTexture},classifiedTexture:function(){return e._fboClassified.getColorTexture()}}}Object.defineProperties(x0.prototype,{unclassifiedCommand:{get:function(){return this._unclassifiedCommand}}});x0.isTranslucencySupported=function(e){return e.depthTexture&&e.fragmentDepth};var D1t={depthMask:!1,stencilTest:{enabled:!0,frontFunction:ni.EQUAL,frontOperation:{fail:Ft.KEEP,zFail:Ft.KEEP,zPass:Ft.KEEP},backFunction:ni.NEVER,reference:0,mask:Jt.CLASSIFICATION_MASK},blending:on.ALPHA_BLEND},O1t={depthMask:!1,stencilTest:{enabled:!0,frontFunction:ni.NOT_EQUAL,frontOperation:{fail:Ft.KEEP,zFail:Ft.KEEP,zPass:Ft.KEEP},backFunction:ni.NEVER,reference:0,mask:Jt.CLASSIFICATION_MASK},blending:on.ALPHA_BLEND},B1t={depthMask:!0,depthTest:{enabled:!0},stencilTest:Jt.setCesium3DTileBit(),stencilMask:Jt.CESIUM_3D_TILE_MASK,blending:on.ALPHA_BLEND},z1t=`uniform sampler2D colorTexture; uniform sampler2D depthTexture; uniform sampler2D classifiedTexture; in vec2 v_textureCoordinates; @@ -10289,7 +10289,7 @@ void main() out_FragColor = color * highlightColor; gl_FragDepth = texture(depthTexture, v_textureCoordinates).r; } -`,Evt=`uniform sampler2D colorTexture; +`,H1t=`uniform sampler2D colorTexture; in vec2 v_textureCoordinates; void main() { @@ -10304,7 +10304,7 @@ void main() out_FragColor = color; #endif } -`;F0.prototype.update=function(e,t,n){let i=this._fbo.getColorTexture(),o=this.previousFramebuffer!==this._previousFramebuffer;this._previousFramebuffer=this.previousFramebuffer;let r=this._numSamples!==t,s=e.drawingBufferWidth,a=e.drawingBufferHeight,c=!l(i)||i.width!==s||i.height!==a;if((c||o||r)&&(this._numSamples=t,this._depthStencilTexture=this._depthStencilTexture&&this._depthStencilTexture.destroy(),this._depthStencilRenderbuffer=this._depthStencilRenderbuffer&&this._depthStencilRenderbuffer.destroy(),l(this._previousFramebuffer)||(this._depthStencilTexture=new vt({context:e,width:s,height:a,pixelFormat:Qe.DEPTH_STENCIL,pixelDatatype:Ue.UNSIGNED_INT_24_8}),t>1&&(this._depthStencilRenderbuffer=new _u({context:e,width:s,height:a,format:Ml.DEPTH24_STENCIL8,numSamples:t})))),!l(this._fbo.framebuffer)||c||o||r){this._fbo.destroy(),this._fboClassified.destroy();let d,u;l(this._previousFramebuffer)?(d=n.getDepthStencilTexture(),u=n.getDepthStencilRenderbuffer()):(d=this._depthStencilTexture,u=this._depthStencilRenderbuffer),this._fbo.setDepthStencilTexture(d),l(u)&&this._fbo.setDepthStencilRenderbuffer(u),this._fbo.update(e,s,a,t),l(this._previousFramebuffer)||(this._fboClassified.setDepthStencilTexture(d),this._fboClassified.update(e,s,a))}if(l(this._rsUnclassified)||(this._rsUnclassified=ze.fromCache(Zvt),this._rsClassified=ze.fromCache(Rvt),this._rsDefault=ze.fromCache(Cvt)),!l(this._unclassifiedCommand)||o||r){l(this._unclassifiedCommand)&&(this._unclassifiedCommand.shaderProgram=this._unclassifiedCommand.shaderProgram&&this._unclassifiedCommand.shaderProgram.destroy(),this._classifiedCommand.shaderProgram=this._classifiedCommand.shaderProgram&&this._classifiedCommand.shaderProgram.destroy());let d=l(this._previousFramebuffer)?Evt:Vvt,u=new Je({defines:["UNCLASSIFIED"],sources:[d]}),m=new Je({sources:[d]});this._unclassifiedCommand=e.createViewportQuadCommand(u,{renderState:l(this._previousFramebuffer)?this._rsUnclassified:this._rsDefault,uniformMap:this._uniformMap,owner:this}),this._classifiedCommand=e.createViewportQuadCommand(m,{renderState:l(this._previousFramebuffer)?this._rsClassified:this._rsDefault,uniformMap:this._uniformMap,owner:this}),l(this._translucentCommand)&&(this._translucentCommand.shaderProgram=this._translucentCommand.shaderProgram&&this._translucentCommand.shaderProgram.destroy()),l(this._previousFramebuffer)||(this._translucentCommand=e.createViewportQuadCommand(au,{renderState:this._rsUnclassified,uniformMap:this._uniformMap,owner:this}))}};F0.prototype.prepareTextures=function(e,t){this._fbo._numSamples>1&&this._fbo.prepareTextures(e,t)};F0.prototype.clear=function(e,t){l(this._previousFramebuffer)?this._fbo.clear(e,this._clearColorCommand,t):(this._fbo.clear(e,this._clearCommand,t),this._fboClassified.clear(e,this._clearCommand,t))};F0.prototype.executeClassified=function(e,t){if(!l(this._previousFramebuffer)){let n=t.framebuffer;this.prepareTextures(e,!0),t.framebuffer=this._fboClassified.framebuffer,this._translucentCommand.execute(e,t),t.framebuffer=n}this._classifiedCommand.execute(e,t)};F0.prototype.executeUnclassified=function(e,t){this._unclassifiedCommand.execute(e,t)};F0.prototype.isDestroyed=function(){return!1};F0.prototype.destroy=function(){return this._fbo.destroy(),this._fboClassified.destroy(),this._depthStencilTexture=this._depthStencilTexture&&this._depthStencilTexture.destroy(),this._depthStencilRenderbuffer=this._depthStencilRenderbuffer&&this._depthStencilRenderbuffer.destroy(),l(this._unclassifiedCommand)&&(this._unclassifiedCommand.shaderProgram=this._unclassifiedCommand.shaderProgram&&this._unclassifiedCommand.shaderProgram.destroy(),this._classifiedCommand.shaderProgram=this._classifiedCommand.shaderProgram&&this._classifiedCommand.shaderProgram.destroy()),ue(this)};var aA=F0;var Juo=x(T(),1);function SK(e){this._total=e,this.usedThisFrame=0,this.stolenFromMeThisFrame=0,this.starvedThisFrame=!1,this.starvedLastFrame=!1}Object.defineProperties(SK.prototype,{total:{get:function(){return this._total}}});function ZT(e){let t=new Array(Wc.NUMBER_OF_JOB_TYPES);t[Wc.TEXTURE]=new SK(l(e)?e[Wc.TEXTURE]:10),t[Wc.PROGRAM]=new SK(l(e)?e[Wc.PROGRAM]:10),t[Wc.BUFFER]=new SK(l(e)?e[Wc.BUFFER]:30);let n=t.length,i,o=0;for(i=0;i<n;++i)o+=t[i].total;let r=new Array(n);for(i=0;i<n;++i)r[i]=!1;this._totalBudget=o,this._totalUsedThisFrame=0,this._budgets=t,this._executedThisFrame=r}ZT.getTimestamp=Zn;Object.defineProperties(ZT.prototype,{totalBudget:{get:function(){return this._totalBudget}}});ZT.prototype.disableThisFrame=function(){this._totalUsedThisFrame=this._totalBudget};ZT.prototype.resetBudgets=function(){let e=this._budgets,t=e.length;for(let n=0;n<t;++n){let i=e[n];i.starvedLastFrame=i.starvedThisFrame,i.starvedThisFrame=!1,i.usedThisFrame=0,i.stolenFromMeThisFrame=0}this._totalUsedThisFrame=0};ZT.prototype.execute=function(e,t){let n=this._budgets,i=n[t],o=this._executedThisFrame[t];if(this._totalUsedThisFrame>=this._totalBudget&&o)return i.starvedThisFrame=!0,!1;let r;if(i.usedThisFrame+i.stolenFromMeThisFrame>=i.total){let c=n.length,d;for(d=0;d<c&&(r=n[d],!(r.usedThisFrame+r.stolenFromMeThisFrame<r.total&&!r.starvedLastFrame));++d);if(d===c&&o)return!1;o&&(i.starvedThisFrame=!0)}let s=ZT.getTimestamp();e.execute();let a=ZT.getTimestamp()-s;return this._totalUsedThisFrame+=a,r?r.stolenFromMeThisFrame+=a:i.usedThisFrame+=a,this._executedThisFrame[t]=!0,!0};var T9=ZT;var tmo=x(T(),1);function ZK(e){e=e??B.EMPTY_OBJECT;let t=Nn(e.container);this._container=t;let n=document.createElement("div");n.className="cesium-performanceDisplay";let i=document.createElement("div");i.className="cesium-performanceDisplay-fps",this._fpsText=document.createTextNode(""),i.appendChild(this._fpsText);let o=document.createElement("div");o.className="cesium-performanceDisplay-ms",this._msText=document.createTextNode(""),o.appendChild(this._msText),n.appendChild(o),n.appendChild(i),this._container.appendChild(n),this._lastFpsSampleTime=Zn(),this._lastMsSampleTime=Zn(),this._fpsFrameCount=0,this._msFrameCount=0,this._throttled=!1;let r=document.createElement("div");r.className="cesium-performanceDisplay-throttled",this._throttledText=document.createTextNode(""),r.appendChild(this._throttledText),n.appendChild(r)}Object.defineProperties(ZK.prototype,{throttled:{get:function(){return this._throttled},set:function(e){this._throttled!==e&&(e?this._throttledText.nodeValue="(throttled)":this._throttledText.nodeValue="",this._throttled=e)}}});ZK.prototype.update=function(e){let t=Zn(),n=e??!0;this._fpsFrameCount++;let i=t-this._lastFpsSampleTime;if(i>1e3){let r="N/A";n&&(r=this._fpsFrameCount*1e3/i|0),this._fpsText.nodeValue=`${r} FPS`,this._lastFpsSampleTime=t,this._fpsFrameCount=0}this._msFrameCount++;let o=t-this._lastMsSampleTime;if(o>200){let r="N/A";n&&(r=(o/this._msFrameCount).toFixed(2)),this._msText.nodeValue=`${r} MS`,this._lastMsSampleTime=t,this._msFrameCount=0}};ZK.prototype.destroy=function(){return ue(this)};var qg=ZK;var E0o=x(T(),1);var fmo=x(T(),1);var Tc={};Tc.decodeRawMetadataValue=function(e,t,n){switch(e){case Nt.INT8:return t.getInt8(n);case Nt.UINT8:return t.getUint8(n);case Nt.INT16:return t.getInt16(n,!0);case Nt.UINT16:return t.getUint16(n,!0);case Nt.INT32:return t.getInt32(n,!0);case Nt.UINT32:return t.getUint32(n,!0);case Nt.INT64:return t.getBigInt64(n,!0);case Nt.UINT64:return t.getBigUint64(n,!0);case Nt.FLOAT32:return t.getFloat32(n,!0);case Nt.FLOAT64:return t.getFloat64(n,!0)}throw new ae(`Invalid component type: ${e}`)};Tc.decodeRawMetadataValueComponent=function(e,t,n){let i=e.componentType,o=Tc.decodeRawMetadataValue(i,t,n);return e.normalized?Nt.normalize(o,i):o};Tc.decodeRawMetadataValueElement=function(e,t,n){let i=e.componentType,o=Nt.getSizeInBytes(i),r=e.type,s=St.getComponentCount(r),a=o*s;if(s>1){let u=Array(s);for(let m=0;m<s;m++){let p=n*a+m*o,b=Tc.decodeRawMetadataValueComponent(e,t,p);u[m]=b}return u}let c=n*a;return Tc.decodeRawMetadataValueComponent(e,t,c)};Tc.decodeRawMetadataValues=function(e,t){let n=new DataView(t.buffer,t.byteOffset,t.byteLength);if(e.isArray){let o=e.arrayLength,r=Array(o);for(let s=0;s<o;s++){let a=Tc.decodeRawMetadataValueElement(e,n,s);r[s]=a}return r}return Tc.decodeRawMetadataValueElement(e,n,0)};Tc.convertToObjectType=function(e,t){if(!l(t)||e===St.SCALAR||e===St.STRING||e===St.BOOLEAN||e===St.ENUM)return t;let n=t.map(i=>Number(i));switch(e){case St.VEC2:return k.unpack(n,0,new k);case St.VEC3:return h.unpack(n,0,new h);case St.VEC4:return ce.unpack(n,0,new ce);case St.MAT2:return Ji.unpack(n,0,new Ji);case St.MAT3:return q.unpack(n,0,new q);case St.MAT4:return P.unpack(n,0,new P)}throw new ae(`Invalid metadata object type: ${e}`)};Tc.convertFromObjectType=function(e,t){if(!l(t)||e===St.SCALAR||e===St.STRING||e===St.BOOLEAN||e===St.ENUM)return t;switch(e){case St.VEC2:return k.pack(t,Array(2));case St.VEC3:return h.pack(t,Array(3));case St.VEC4:return ce.pack(t,Array(4));case St.MAT2:return Ji.pack(t,Array(4));case St.MAT3:return q.pack(t,Array(9));case St.MAT4:return P.pack(t,Array(16))}throw new ae(`Invalid metadata object type: ${e}`)};Tc.decodeMetadataValues=function(e,t,n){let i=Tc.decodeRawMetadataValues(e,n);if(t.hasValueTransform){let r=Tc.convertFromObjectType(e.type,t.offset),s=Tc.convertFromObjectType(e.type,t.scale);i=Xp.valueTransformInPlace(i,r,s,Nt.applyValueTransform)}if(e.isArray){let r=e.arrayLength,s=Array(r);for(let a=0;a<r;a++){let c=i[a],d=Tc.convertToObjectType(e.type,c);s[a]=d}return s}return Tc.convertToObjectType(e.type,i)};var _9=Object.freeze(Tc);var _mo=x(T(),1);function $Z(){this._framebuffer=new li,this._textureToCopy=void 0,this._copyDepthCommand=void 0}Object.defineProperties($Z.prototype,{framebuffer:{get:function(){return this._framebuffer.framebuffer}}});function Avt(e,t,n){let{width:i,height:o}=n;e._framebuffer.update(t,i,o)}function Gvt(e,t,n){l(e._copyDepthCommand)||(e._copyDepthCommand=t.createViewportQuadCommand(`uniform highp sampler2D colorTexture; +`;x0.prototype.update=function(e,t,n){let i=this._fbo.getColorTexture(),o=this.previousFramebuffer!==this._previousFramebuffer;this._previousFramebuffer=this.previousFramebuffer;let r=this._numSamples!==t,s=e.drawingBufferWidth,a=e.drawingBufferHeight,c=!l(i)||i.width!==s||i.height!==a;if((c||o||r)&&(this._numSamples=t,this._depthStencilTexture=this._depthStencilTexture&&this._depthStencilTexture.destroy(),this._depthStencilRenderbuffer=this._depthStencilRenderbuffer&&this._depthStencilRenderbuffer.destroy(),l(this._previousFramebuffer)||(this._depthStencilTexture=new vt({context:e,width:s,height:a,pixelFormat:Qe.DEPTH_STENCIL,pixelDatatype:Ue.UNSIGNED_INT_24_8}),t>1&&(this._depthStencilRenderbuffer=new _u({context:e,width:s,height:a,format:Ml.DEPTH24_STENCIL8,numSamples:t})))),!l(this._fbo.framebuffer)||c||o||r){this._fbo.destroy(),this._fboClassified.destroy();let d,u;l(this._previousFramebuffer)?(d=n.getDepthStencilTexture(),u=n.getDepthStencilRenderbuffer()):(d=this._depthStencilTexture,u=this._depthStencilRenderbuffer),this._fbo.setDepthStencilTexture(d),l(u)&&this._fbo.setDepthStencilRenderbuffer(u),this._fbo.update(e,s,a,t),l(this._previousFramebuffer)||(this._fboClassified.setDepthStencilTexture(d),this._fboClassified.update(e,s,a))}if(l(this._rsUnclassified)||(this._rsUnclassified=ze.fromCache(D1t),this._rsClassified=ze.fromCache(O1t),this._rsDefault=ze.fromCache(B1t)),!l(this._unclassifiedCommand)||o||r){l(this._unclassifiedCommand)&&(this._unclassifiedCommand.shaderProgram=this._unclassifiedCommand.shaderProgram&&this._unclassifiedCommand.shaderProgram.destroy(),this._classifiedCommand.shaderProgram=this._classifiedCommand.shaderProgram&&this._classifiedCommand.shaderProgram.destroy());let d=l(this._previousFramebuffer)?H1t:z1t,u=new Je({defines:["UNCLASSIFIED"],sources:[d]}),m=new Je({sources:[d]});this._unclassifiedCommand=e.createViewportQuadCommand(u,{renderState:l(this._previousFramebuffer)?this._rsUnclassified:this._rsDefault,uniformMap:this._uniformMap,owner:this}),this._classifiedCommand=e.createViewportQuadCommand(m,{renderState:l(this._previousFramebuffer)?this._rsClassified:this._rsDefault,uniformMap:this._uniformMap,owner:this}),l(this._translucentCommand)&&(this._translucentCommand.shaderProgram=this._translucentCommand.shaderProgram&&this._translucentCommand.shaderProgram.destroy()),l(this._previousFramebuffer)||(this._translucentCommand=e.createViewportQuadCommand(tu,{renderState:this._rsUnclassified,uniformMap:this._uniformMap,owner:this}))}};x0.prototype.prepareTextures=function(e,t){this._fbo._numSamples>1&&this._fbo.prepareTextures(e,t)};x0.prototype.clear=function(e,t){l(this._previousFramebuffer)?this._fbo.clear(e,this._clearColorCommand,t):(this._fbo.clear(e,this._clearCommand,t),this._fboClassified.clear(e,this._clearCommand,t))};x0.prototype.executeClassified=function(e,t){if(!l(this._previousFramebuffer)){let n=t.framebuffer;this.prepareTextures(e,!0),t.framebuffer=this._fboClassified.framebuffer,this._translucentCommand.execute(e,t),t.framebuffer=n}this._classifiedCommand.execute(e,t)};x0.prototype.executeUnclassified=function(e,t){this._unclassifiedCommand.execute(e,t)};x0.prototype.isDestroyed=function(){return!1};x0.prototype.destroy=function(){return this._fbo.destroy(),this._fboClassified.destroy(),this._depthStencilTexture=this._depthStencilTexture&&this._depthStencilTexture.destroy(),this._depthStencilRenderbuffer=this._depthStencilRenderbuffer&&this._depthStencilRenderbuffer.destroy(),l(this._unclassifiedCommand)&&(this._unclassifiedCommand.shaderProgram=this._unclassifiedCommand.shaderProgram&&this._unclassifiedCommand.shaderProgram.destroy(),this._classifiedCommand.shaderProgram=this._classifiedCommand.shaderProgram&&this._classifiedCommand.shaderProgram.destroy()),ue(this)};var aE=x0;var n7i=x(T(),1);function xz(e){this._total=e,this.usedThisFrame=0,this.stolenFromMeThisFrame=0,this.starvedThisFrame=!1,this.starvedLastFrame=!1}Object.defineProperties(xz.prototype,{total:{get:function(){return this._total}}});function nT(e){let t=new Array(Ic.NUMBER_OF_JOB_TYPES);t[Ic.TEXTURE]=new xz(l(e)?e[Ic.TEXTURE]:10),t[Ic.PROGRAM]=new xz(l(e)?e[Ic.PROGRAM]:10),t[Ic.BUFFER]=new xz(l(e)?e[Ic.BUFFER]:30);let n=t.length,i,o=0;for(i=0;i<n;++i)o+=t[i].total;let r=new Array(n);for(i=0;i<n;++i)r[i]=!1;this._totalBudget=o,this._totalUsedThisFrame=0,this._budgets=t,this._executedThisFrame=r}nT.getTimestamp=Zn;Object.defineProperties(nT.prototype,{totalBudget:{get:function(){return this._totalBudget}}});nT.prototype.disableThisFrame=function(){this._totalUsedThisFrame=this._totalBudget};nT.prototype.resetBudgets=function(){let e=this._budgets,t=e.length;for(let n=0;n<t;++n){let i=e[n];i.starvedLastFrame=i.starvedThisFrame,i.starvedThisFrame=!1,i.usedThisFrame=0,i.stolenFromMeThisFrame=0}this._totalUsedThisFrame=0};nT.prototype.execute=function(e,t){let n=this._budgets,i=n[t],o=this._executedThisFrame[t];if(this._totalUsedThisFrame>=this._totalBudget&&o)return i.starvedThisFrame=!0,!1;let r;if(i.usedThisFrame+i.stolenFromMeThisFrame>=i.total){let c=n.length,d;for(d=0;d<c&&(r=n[d],!(r.usedThisFrame+r.stolenFromMeThisFrame<r.total&&!r.starvedLastFrame));++d);if(d===c&&o)return!1;o&&(i.starvedThisFrame=!0)}let s=nT.getTimestamp();e.execute();let a=nT.getTimestamp()-s;return this._totalUsedThisFrame+=a,r?r.stolenFromMeThisFrame+=a:i.usedThisFrame+=a,this._executedThisFrame[t]=!0,!0};var dw=nT;var c7i=x(T(),1);function Tz(e){e=e??B.EMPTY_OBJECT;let t=Nn(e.container);this._container=t;let n=document.createElement("div");n.className="cesium-performanceDisplay";let i=document.createElement("div");i.className="cesium-performanceDisplay-fps",this._fpsText=document.createTextNode(""),i.appendChild(this._fpsText);let o=document.createElement("div");o.className="cesium-performanceDisplay-ms",this._msText=document.createTextNode(""),o.appendChild(this._msText),n.appendChild(o),n.appendChild(i),this._container.appendChild(n),this._lastFpsSampleTime=Zn(),this._lastMsSampleTime=Zn(),this._fpsFrameCount=0,this._msFrameCount=0,this._throttled=!1;let r=document.createElement("div");r.className="cesium-performanceDisplay-throttled",this._throttledText=document.createTextNode(""),r.appendChild(this._throttledText),n.appendChild(r)}Object.defineProperties(Tz.prototype,{throttled:{get:function(){return this._throttled},set:function(e){this._throttled!==e&&(e?this._throttledText.nodeValue="(throttled)":this._throttledText.nodeValue="",this._throttled=e)}}});Tz.prototype.update=function(e){let t=Zn(),n=e??!0;this._fpsFrameCount++;let i=t-this._lastFpsSampleTime;if(i>1e3){let r="N/A";n&&(r=this._fpsFrameCount*1e3/i|0),this._fpsText.nodeValue=`${r} FPS`,this._lastFpsSampleTime=t,this._fpsFrameCount=0}this._msFrameCount++;let o=t-this._lastMsSampleTime;if(o>200){let r="N/A";n&&(r=(o/this._msFrameCount).toFixed(2)),this._msText.nodeValue=`${r} MS`,this._lastMsSampleTime=t,this._msFrameCount=0}};Tz.prototype.destroy=function(){return ue(this)};var Ig=Tz;var Ito=x(T(),1);var _7i=x(T(),1);var xc={};xc.decodeRawMetadataValue=function(e,t,n){switch(e){case Nt.INT8:return t.getInt8(n);case Nt.UINT8:return t.getUint8(n);case Nt.INT16:return t.getInt16(n,!0);case Nt.UINT16:return t.getUint16(n,!0);case Nt.INT32:return t.getInt32(n,!0);case Nt.UINT32:return t.getUint32(n,!0);case Nt.INT64:return t.getBigInt64(n,!0);case Nt.UINT64:return t.getBigUint64(n,!0);case Nt.FLOAT32:return t.getFloat32(n,!0);case Nt.FLOAT64:return t.getFloat64(n,!0)}throw new ae(`Invalid component type: ${e}`)};xc.decodeRawMetadataValueComponent=function(e,t,n){let i=e.componentType,o=xc.decodeRawMetadataValue(i,t,n);return e.normalized?Nt.normalize(o,i):o};xc.decodeRawMetadataValueElement=function(e,t,n){let i=e.componentType,o=Nt.getSizeInBytes(i),r=e.type,s=St.getComponentCount(r),a=o*s;if(s>1){let u=Array(s);for(let m=0;m<s;m++){let p=n*a+m*o,b=xc.decodeRawMetadataValueComponent(e,t,p);u[m]=b}return u}let c=n*a;return xc.decodeRawMetadataValueComponent(e,t,c)};xc.decodeRawMetadataValues=function(e,t){let n=new DataView(t.buffer,t.byteOffset,t.byteLength);if(e.isArray){let o=e.arrayLength,r=Array(o);for(let s=0;s<o;s++){let a=xc.decodeRawMetadataValueElement(e,n,s);r[s]=a}return r}return xc.decodeRawMetadataValueElement(e,n,0)};xc.convertToObjectType=function(e,t){if(!l(t)||e===St.SCALAR||e===St.STRING||e===St.BOOLEAN||e===St.ENUM)return t;let n=t.map(i=>Number(i));switch(e){case St.VEC2:return k.unpack(n,0,new k);case St.VEC3:return h.unpack(n,0,new h);case St.VEC4:return ce.unpack(n,0,new ce);case St.MAT2:return Ji.unpack(n,0,new Ji);case St.MAT3:return q.unpack(n,0,new q);case St.MAT4:return P.unpack(n,0,new P)}throw new ae(`Invalid metadata object type: ${e}`)};xc.convertFromObjectType=function(e,t){if(!l(t)||e===St.SCALAR||e===St.STRING||e===St.BOOLEAN||e===St.ENUM)return t;switch(e){case St.VEC2:return k.pack(t,Array(2));case St.VEC3:return h.pack(t,Array(3));case St.VEC4:return ce.pack(t,Array(4));case St.MAT2:return Ji.pack(t,Array(4));case St.MAT3:return q.pack(t,Array(9));case St.MAT4:return P.pack(t,Array(16))}throw new ae(`Invalid metadata object type: ${e}`)};xc.decodeMetadataValues=function(e,t,n){let i=xc.decodeRawMetadataValues(e,n);if(t.hasValueTransform){let r=xc.convertFromObjectType(e.type,t.offset),s=xc.convertFromObjectType(e.type,t.scale);i=zp.valueTransformInPlace(i,r,s,Nt.applyValueTransform)}if(e.isArray){let r=e.arrayLength,s=Array(r);for(let a=0;a<r;a++){let c=i[a],d=xc.convertToObjectType(e.type,c);s[a]=d}return s}return xc.convertToObjectType(e.type,i)};var uw=Object.freeze(xc);var A7i=x(T(),1);function VZ(){this._framebuffer=new li,this._textureToCopy=void 0,this._copyDepthCommand=void 0}Object.defineProperties(VZ.prototype,{framebuffer:{get:function(){return this._framebuffer.framebuffer}}});function K1t(e,t,n){let{width:i,height:o}=n;e._framebuffer.update(t,i,o)}function J1t(e,t,n){l(e._copyDepthCommand)||(e._copyDepthCommand=t.createViewportQuadCommand(`uniform highp sampler2D colorTexture; in vec2 v_textureCoordinates; @@ -10316,24 +10316,24 @@ void main() out_FragColor = czm_branchFreeTernary(globeDepth <= 0.0 || globeDepth >= 1.0 || depth < globeDepth && depth > 0.0 && depth < 1.0, czm_packDepth(depth), globeDepthPacked); } -`,{renderState:ze.fromCache(),uniformMap:{colorTexture:function(){return e._textureToCopy}},owner:e})),e._textureToCopy=n,e._copyDepthCommand.framebuffer=e.framebuffer}$Z.prototype.update=function(e,t){Avt(this,e,t),Gvt(this,e,t)};var Lvt=new ce,Wvt=new ce(1,1/255,1/65025,1/16581375);$Z.prototype.getDepth=function(e,t,n){if(!l(this.framebuffer))return;let i=e.readPixels({x:t,y:n,width:1,height:1,framebuffer:this.framebuffer}),o=ce.unpack(i,0,Lvt);return ce.divideByScalar(o,255,o),ce.dot(o,Wvt)};$Z.prototype.executeCopyDepth=function(e,t){this._copyDepthCommand.execute(e,t)};$Z.prototype.isDestroyed=function(){return!1};$Z.prototype.destroy=function(){return this._framebuffer.destroy(),l(this._copyDepthCommand)&&(this._copyDepthCommand.shaderProgram=l(this._copyDepthCommand.shaderProgram)&&this._copyDepthCommand.shaderProgram.destroy()),ue(this)};var S9=$Z;var e0o=x(T(),1);var Lmo=x(T(),1);function RT(){this._framebufferManager=new li({colorAttachmentsLength:3,createColorAttachments:!0,depthStencil:!0,supportsDepthTexture:!0,color:!0}),this._framebuffer=void 0,this._colorTexture=void 0,this._idTexture=void 0,this._depthTexture=void 0,this._depthStencilTexture=void 0,this._clearCommand=new ui({color:new U(0,0,0,0),depth:1,stencil:0,owner:this})}Object.defineProperties(RT.prototype,{framebuffer:{get:function(){return this._framebuffer}},colorTexture:{get:function(){return this._colorTexture}},idTexture:{get:function(){return this._idTexture}},depthTexture:{get:function(){return this._depthTexture}},depthStencilTexture:{get:function(){return this._depthStencilTexture}}});RT.prototype.update=function(e,t,n,i,o){let r=t.width,s=t.height,a=n?e.halfFloatingPointTexture?Ue.HALF_FLOAT:Ue.FLOAT:Ue.UNSIGNED_BYTE,c=this._framebufferManager.update(e,r,s,1,a,Qe.RGBA);return this._framebufferManager.framebuffer&&(this._framebuffer=this._framebufferManager.framebuffer,this._colorTexture=l(i)?i:this._framebufferManager.getColorTexture(0),this._idTexture=this._framebufferManager.getColorTexture(1),this._depthTexture=this._framebufferManager.getColorTexture(2),this._depthStencilTexture=l(o)?o:this._framebufferManager.getDepthStencilTexture()),c};RT.prototype.clear=function(e,t,n){this.getClearCommand(n).execute(e,t)};RT.prototype.getClearCommand=function(e){return this._clearCommand.framebuffer=this._framebuffer,l(e)&&U.clone(e,this._clearCommand.color),this._clearCommand};RT.prototype.getFramebuffer=function(e,t,n,i){return this.update(e,t,!1,n,i),this._framebuffer};RT.prototype.isDestroyed=function(){return!1};RT.prototype.destroy=function(){return this._framebufferManager=this._framebufferManager&&this._framebufferManager.destroy(),this._clearCommand=void 0,ue(this)};var Z9=RT;var Mmo=x(T(),1);function eR(){this._framebufferManager=new li({colorAttachmentsLength:1,createColorAttachments:!0,depthStencil:!0,supportsDepthTexture:!0,color:!0}),this._framebuffer=void 0,this._idTexture=void 0,this._depthStencilTexture=void 0,this._clearCommand=new ui({color:new U(0,0,0,0),depth:1,stencil:0,owner:this})}Object.defineProperties(eR.prototype,{framebuffer:{get:function(){return this._framebuffer}},idTexture:{get:function(){return this._idTexture}},depthStencilTexture:{get:function(){return this._depthStencilTexture}}});eR.prototype.update=function(e,t,n){let i=t.width,o=t.height,r=e.colorBufferFloat?Ue.FLOAT:Ue.UNSIGNED_BYTE,s=this._framebufferManager.update(e,i,o,1,r,Qe.RED);return this._framebufferManager.framebuffer&&(this._framebuffer=this._framebufferManager.framebuffer,this._idTexture=this._framebufferManager.getColorTexture(0),this._depthStencilTexture=this._framebufferManager.getDepthStencilTexture()),s};eR.prototype.getClearCommand=function(e){return this._clearCommand.framebuffer=this._framebuffer,l(e)&&U.clone(e,this._clearCommand.color),this._clearCommand};eR.prototype.releaseResources=function(){l(this._framebuffer)&&(this._framebufferManager.destroy(),this._framebuffer=void 0,this._idTexture=void 0,this._depthStencilTexture=void 0)};eR.prototype.isDestroyed=function(){return!1};eR.prototype.destroy=function(){return this._framebufferManager=this._framebufferManager&&this._framebufferManager.destroy(),this._clearCommand=void 0,ue(this)};var R9=eR;var Umo=x(T(),1);function vvt(e,t){this.near=e??0,this.far=t??0;let n=Le.NUMBER_OF_PASSES,i=new Array(n),o=new Array(n);for(let r=0;r<n;++r)i[r]=[],o[r]=0;this.commands=i,this.indices=o}var C9=vvt;var aho=x(T(),1);var Omo=x(T(),1),CT=`uniform highp sampler2D u_depthTexture; +`,{renderState:ze.fromCache(),uniformMap:{colorTexture:function(){return e._textureToCopy}},owner:e})),e._textureToCopy=n,e._copyDepthCommand.framebuffer=e.framebuffer}VZ.prototype.update=function(e,t){K1t(this,e,t),J1t(this,e,t)};var j1t=new ce,Q1t=new ce(1,1/255,1/65025,1/16581375);VZ.prototype.getDepth=function(e,t,n){if(!l(this.framebuffer))return;let i=e.readPixels({x:t,y:n,width:1,height:1,framebuffer:this.framebuffer}),o=ce.unpack(i,0,j1t);return ce.divideByScalar(o,255,o),ce.dot(o,Q1t)};VZ.prototype.executeCopyDepth=function(e,t){this._copyDepthCommand.execute(e,t)};VZ.prototype.isDestroyed=function(){return!1};VZ.prototype.destroy=function(){return this._framebuffer.destroy(),l(this._copyDepthCommand)&&(this._copyDepthCommand.shaderProgram=l(this._copyDepthCommand.shaderProgram)&&this._copyDepthCommand.shaderProgram.destroy()),ue(this)};var mw=VZ;var ato=x(T(),1);var N7i=x(T(),1);function iT(){this._framebufferManager=new li({colorAttachmentsLength:3,createColorAttachments:!0,depthStencil:!0,supportsDepthTexture:!0,color:!0}),this._framebuffer=void 0,this._colorTexture=void 0,this._idTexture=void 0,this._depthTexture=void 0,this._depthStencilTexture=void 0,this._clearCommand=new ui({color:new U(0,0,0,0),depth:1,stencil:0,owner:this})}Object.defineProperties(iT.prototype,{framebuffer:{get:function(){return this._framebuffer}},colorTexture:{get:function(){return this._colorTexture}},idTexture:{get:function(){return this._idTexture}},depthTexture:{get:function(){return this._depthTexture}},depthStencilTexture:{get:function(){return this._depthStencilTexture}}});iT.prototype.update=function(e,t,n,i,o){let r=t.width,s=t.height,a=n?e.halfFloatingPointTexture?Ue.HALF_FLOAT:Ue.FLOAT:Ue.UNSIGNED_BYTE,c=this._framebufferManager.update(e,r,s,1,a,Qe.RGBA);return this._framebufferManager.framebuffer&&(this._framebuffer=this._framebufferManager.framebuffer,this._colorTexture=l(i)?i:this._framebufferManager.getColorTexture(0),this._idTexture=this._framebufferManager.getColorTexture(1),this._depthTexture=this._framebufferManager.getColorTexture(2),this._depthStencilTexture=l(o)?o:this._framebufferManager.getDepthStencilTexture()),c};iT.prototype.clear=function(e,t,n){this.getClearCommand(n).execute(e,t)};iT.prototype.getClearCommand=function(e){return this._clearCommand.framebuffer=this._framebuffer,l(e)&&U.clone(e,this._clearCommand.color),this._clearCommand};iT.prototype.getFramebuffer=function(e,t,n,i){return this.update(e,t,!1,n,i),this._framebuffer};iT.prototype.isDestroyed=function(){return!1};iT.prototype.destroy=function(){return this._framebufferManager=this._framebufferManager&&this._framebufferManager.destroy(),this._clearCommand=void 0,ue(this)};var hw=iT;var z7i=x(T(),1);function EZ(){this._framebufferManager=new li({colorAttachmentsLength:1,createColorAttachments:!0,depthStencil:!0,supportsDepthTexture:!0,color:!0}),this._framebuffer=void 0,this._idTexture=void 0,this._depthStencilTexture=void 0,this._clearCommand=new ui({color:new U(0,0,0,0),depth:1,stencil:0,owner:this})}Object.defineProperties(EZ.prototype,{framebuffer:{get:function(){return this._framebuffer}},idTexture:{get:function(){return this._idTexture}},depthStencilTexture:{get:function(){return this._depthStencilTexture}}});EZ.prototype.update=function(e,t,n){let i=t.width,o=t.height,r=e.colorBufferFloat?Ue.FLOAT:Ue.UNSIGNED_BYTE,s=this._framebufferManager.update(e,i,o,1,r,Qe.RED);return this._framebufferManager.framebuffer&&(this._framebuffer=this._framebufferManager.framebuffer,this._idTexture=this._framebufferManager.getColorTexture(0),this._depthStencilTexture=this._framebufferManager.getDepthStencilTexture()),s};EZ.prototype.getClearCommand=function(e){return this._clearCommand.framebuffer=this._framebuffer,l(e)&&U.clone(e,this._clearCommand.color),this._clearCommand};EZ.prototype.releaseResources=function(){l(this._framebuffer)&&(this._framebufferManager.destroy(),this._framebuffer=void 0,this._idTexture=void 0,this._depthStencilTexture=void 0)};EZ.prototype.isDestroyed=function(){return!1};EZ.prototype.destroy=function(){return this._framebufferManager=this._framebufferManager&&this._framebufferManager.destroy(),this._clearCommand=void 0,ue(this)};var fw=EZ;var J7i=x(T(),1);function q1t(e,t){this.near=e??0,this.far=t??0;let n=Le.NUMBER_OF_PASSES,i=new Array(n),o=new Array(n);for(let r=0;r<n;++r)i[r]=[],o[r]=0;this.commands=i,this.indices=o}var pw=q1t;var fqi=x(T(),1);var Q7i=x(T(),1),oT=`uniform highp sampler2D u_depthTexture; in vec2 v_textureCoordinates; void main() { out_FragColor = czm_packDepth(texture(u_depthTexture, v_textureCoordinates).r); } -`;function I0(){this._picking=!1,this._snapping=!1,this._numSamples=1,this._tempCopyDepthTexture=void 0,this._pickColorFramebuffer=new li({depthStencil:!0,supportsDepthTexture:!0}),this._snapColorFramebuffer=new li({depthStencil:!0,supportsDepthTexture:!0,pixelDatatype:Ue.FLOAT,pixelFormat:Qe.RGBA}),this._outputFramebuffer=new li({depthStencil:!0,supportsDepthTexture:!0}),this._copyDepthFramebuffer=new li,this._tempCopyDepthFramebuffer=new li,this._updateDepthFramebuffer=new li({createColorAttachments:!1,createDepthAttachments:!1,depthStencil:!0}),this._clearGlobeColorCommand=void 0,this._copyColorCommand=void 0,this._copyDepthCommand=void 0,this._tempCopyDepthCommand=void 0,this._updateDepthCommand=void 0,this._viewport=new nt,this._rs=void 0,this._rsBlend=void 0,this._rsUpdate=void 0,this._useScissorTest=!1,this._scissorRectangle=void 0,this._useHdr=void 0,this._clearGlobeDepth=void 0}Object.defineProperties(I0.prototype,{colorFramebufferManager:{get:function(){return this._snapping?this._snapColorFramebuffer:this._picking?this._pickColorFramebuffer:this._outputFramebuffer}},framebuffer:{get:function(){return this.colorFramebufferManager.framebuffer}},depthStencilTexture:{get:function(){return this.colorFramebufferManager.getDepthStencilTexture()}},picking:{get:function(){return this._picking},set:function(e){this._picking=e}},snapping:{get:function(){return this._snapping},set:function(e){this._snapping=e}}});function cFe(e,t,n,i,o){let r=e._viewport;r.width=n,r.height=i;let s=!nt.equals(r,o.viewport),a=s!==e._useScissorTest;e._useScissorTest=s,nt.equals(e._scissorRectangle,o.viewport)||(e._scissorRectangle=nt.clone(o.viewport,e._scissorRectangle),a=!0),(!l(e._rs)||!nt.equals(r,e._rs.viewport)||a)&&(e._rs=ze.fromCache({viewport:r,scissorTest:{enabled:e._useScissorTest,rectangle:e._scissorRectangle}}),e._rsBlend=ze.fromCache({viewport:r,scissorTest:{enabled:e._useScissorTest,rectangle:e._scissorRectangle},blending:on.ALPHA_BLEND}),e._rsUpdate=ze.fromCache({viewport:r,scissorTest:{enabled:e._useScissorTest,rectangle:e._scissorRectangle},stencilTest:{enabled:!0,frontFunction:ii.EQUAL,frontOperation:{fail:Ft.KEEP,zFail:Ft.KEEP,zPass:Ft.KEEP},backFunction:ii.NEVER,reference:Jt.CESIUM_3D_TILE_MASK,mask:Jt.CESIUM_3D_TILE_MASK}})),l(e._copyDepthCommand)||(e._copyDepthCommand=t.createViewportQuadCommand(CT,{uniformMap:{u_depthTexture:function(){return e.colorFramebufferManager.getDepthStencilTexture()}},owner:e})),e._copyDepthCommand.framebuffer=e._copyDepthFramebuffer.framebuffer,e._copyDepthCommand.renderState=e._rs,l(e._copyColorCommand)||(e._copyColorCommand=t.createViewportQuadCommand(au,{uniformMap:{colorTexture:function(){return e.colorFramebufferManager.getColorTexture()}},owner:e})),e._copyColorCommand.renderState=e._rs,l(e._tempCopyDepthCommand)||(e._tempCopyDepthCommand=t.createViewportQuadCommand(CT,{uniformMap:{u_depthTexture:function(){return e._tempCopyDepthTexture}},owner:e})),e._tempCopyDepthCommand.framebuffer=e._tempCopyDepthFramebuffer.framebuffer,e._tempCopyDepthCommand.renderState=e._rs,l(e._updateDepthCommand)||(e._updateDepthCommand=t.createViewportQuadCommand(au,{uniformMap:{colorTexture:function(){return e._tempCopyDepthFramebuffer.getColorTexture()}},owner:e})),e._updateDepthCommand.framebuffer=e._updateDepthFramebuffer.framebuffer,e._updateDepthCommand.renderState=e._rsUpdate,l(e._clearGlobeColorCommand)||(e._clearGlobeColorCommand=new ui({color:new U(0,0,0,0),stencil:0,owner:e})),e._clearGlobeColorCommand.framebuffer=e.framebuffer}I0.prototype.update=function(e,t,n,i,o,r){let{width:s,height:a}=n,c=o?e.halfFloatingPointTexture?Ue.HALF_FLOAT:Ue.FLOAT:Ue.UNSIGNED_BYTE;this._numSamples=i,this.snapping?this._snapColorFramebuffer.update(e,s,a):this.picking?this._pickColorFramebuffer.update(e,s,a):this._outputFramebuffer.update(e,s,a,i,c),this._copyDepthFramebuffer.update(e,s,a),cFe(this,e,s,a,t),e.uniformState.globeDepthTexture=void 0,this._clearGlobeDepth=r};I0.prototype.prepareColorTextures=function(e,t){!this.picking&&this._numSamples>1&&this._outputFramebuffer.prepareTextures(e,t)};I0.prototype.executeCopyDepth=function(e,t){l(this._copyDepthCommand)&&(this.prepareColorTextures(e),this._copyDepthCommand.execute(e,t),e.uniformState.globeDepthTexture=this._copyDepthFramebuffer.getColorTexture())};I0.prototype.executeUpdateDepth=function(e,t,n){let i=l(n)?n:t.framebuffer.depthStencilTexture;if(!this._clearGlobeDepth&&i===this.colorFramebufferManager.getDepthStencilTexture()){l(this._copyDepthCommand)&&this._copyDepthCommand.execute(e,t);return}if(!l(this._updateDepthCommand))return;let o=this._updateDepthFramebuffer;if(!l(o.framebuffer)||o.getDepthStencilTexture()!==i||o.getColorTexture()!==this._copyDepthFramebuffer.getColorTexture()){let r=this._copyDepthFramebuffer.getColorTexture(),{width:s,height:a}=r;this._tempCopyDepthFramebuffer.destroy(),this._tempCopyDepthFramebuffer.update(e,s,a),o.setColorTexture(r,0),o.setDepthStencilTexture(i),o.update(e,s,a),cFe(this,e,s,a,t)}this._tempCopyDepthTexture=i,this._tempCopyDepthCommand.execute(e,t),this._updateDepthCommand.execute(e,t)};I0.prototype.executeCopyColor=function(e,t){l(this._copyColorCommand)&&this._copyColorCommand.execute(e,t)};I0.prototype.clear=function(e,t,n){let i=this._clearGlobeColorCommand;l(i)&&(U.clone(n,i.color),this.colorFramebufferManager.clear(e,i,t))};I0.prototype.isDestroyed=function(){return!1};I0.prototype.destroy=function(){return this._pickColorFramebuffer.destroy(),this._snapColorFramebuffer.destroy(),this._outputFramebuffer.destroy(),this._copyDepthFramebuffer.destroy(),this._tempCopyDepthFramebuffer.destroy(),this._updateDepthFramebuffer.destroy(),l(this._copyColorCommand)&&(this._copyColorCommand.shaderProgram=this._copyColorCommand.shaderProgram.destroy()),l(this._copyDepthCommand)&&(this._copyDepthCommand.shaderProgram=this._copyDepthCommand.shaderProgram.destroy()),l(this._tempCopyDepthCommand)&&(this._tempCopyDepthCommand.shaderProgram=this._tempCopyDepthCommand.shaderProgram.destroy()),l(this._updateDepthCommand)&&(this._updateDepthCommand.shaderProgram=this._updateDepthCommand.shaderProgram.destroy()),ue(this)};var V9=I0;var yho=x(T(),1);function tR(){this._framebuffer=new li({depthStencil:!0,supportsDepthTexture:!0}),this._packedDepthFramebuffer=new li,this._renderState=void 0,this._packedDepthCommand=void 0,this._clearCommand=void 0,this._viewport=new nt,this._useScissorTest=!1,this._scissorRectangle=void 0,this._useHdr=void 0}Object.defineProperties(tR.prototype,{classificationTexture:{get:function(){return this._framebuffer.getColorTexture()}},classificationFramebuffer:{get:function(){return this._framebuffer.framebuffer}},packedDepthFramebuffer:{get:function(){return this._packedDepthFramebuffer.framebuffer}},depthStencilTexture:{get:function(){return this._framebuffer.getDepthStencilTexture()}},depthStencilRenderbuffer:{get:function(){return this._framebuffer.getDepthStencilRenderbuffer()}},packedDepthTexture:{get:function(){return this._packedDepthFramebuffer.getColorTexture()}}});function Fvt(e){e._framebuffer.destroy(),e._packedDepthFramebuffer.destroy()}function Ivt(e,t,n,i,o){let r=o?t.halfFloatingPointTexture?Ue.HALF_FLOAT:Ue.FLOAT:Ue.UNSIGNED_BYTE;e._framebuffer.update(t,n,i,1,r),e._packedDepthFramebuffer.update(t,n,i)}function Pvt(e,t,n,i,o){e._viewport.width=n,e._viewport.height=i;let r=!nt.equals(e._viewport,o.viewport),s=r!==e._useScissorTest;e._useScissorTest=r,nt.equals(e._scissorRectangle,o.viewport)||(e._scissorRectangle=nt.clone(o.viewport,e._scissorRectangle),s=!0),(!l(e._renderState)||!nt.equals(e._viewport,e._renderState.viewport)||s)&&(e._renderState=ze.fromCache({viewport:e._viewport,scissorTest:{enabled:e._useScissorTest,rectangle:e._scissorRectangle}})),l(e._packedDepthCommand)||(e._packedDepthCommand=t.createViewportQuadCommand(CT,{uniformMap:{u_depthTexture:function(){return e.depthStencilTexture}},owner:e})),l(e._clearCommand)||(e._clearCommand=new ui({color:new U(0,0,0,0),depth:1,stencil:0,owner:e})),e._packedDepthCommand.framebuffer=e._packedDepthFramebuffer.framebuffer,e._packedDepthCommand.renderState=e._renderState,e._clearCommand.framebuffer=e.classificationFramebuffer,e._clearCommand.renderState=e._renderState}tR.prototype.updateAndClear=function(e,t,n,i){let o=t.width,r=t.height;Ivt(this,n,o,r,e),Pvt(this,n,o,r,i),this._useHdr=e};tR.prototype.clearClassification=function(e,t){this._clearCommand.execute(e,t)};tR.prototype.packDepth=function(e,t){return this._packedDepthCommand.execute(e,t),this.packedDepthTexture};tR.prototype.isDestroyed=function(){return!1};tR.prototype.destroy=function(){return Fvt(this),ue(this)};var E9=tR;var Nho=x(T(),1);function $g(e){this._numSamples=1,this._translucentMultipassSupport=!1,this._translucentMRTSupport=!1;let t=e.colorBufferFloat&&e.depthTexture&&e.floatBlend;this._translucentMRTSupport=e.drawBuffers&&t,this._translucentMultipassSupport=!this._translucentMRTSupport&&t,this._opaqueFBO=void 0,this._opaqueTexture=void 0,this._depthStencilTexture=void 0,this._accumulationTexture=void 0,this._translucentFBO=new li({colorAttachmentsLength:this._translucentMRTSupport?2:1,createColorAttachments:!1,createDepthAttachments:!1,depth:!0}),this._alphaFBO=new li({createColorAttachments:!1,createDepthAttachments:!1,depth:!0}),this._adjustTranslucentFBO=new li({colorAttachmentsLength:this._translucentMRTSupport?2:1,createColorAttachments:!1}),this._adjustAlphaFBO=new li({createColorAttachments:!1}),this._opaqueClearCommand=new ui({color:new U(0,0,0,0),owner:this}),this._translucentMRTClearCommand=new ui({color:new U(0,0,0,1),owner:this}),this._translucentMultipassClearCommand=new ui({color:new U(0,0,0,0),owner:this}),this._alphaClearCommand=new ui({color:new U(1,1,1,1),owner:this}),this._translucentRenderStateCache={},this._alphaRenderStateCache={},this._compositeCommand=void 0,this._adjustTranslucentCommand=void 0,this._adjustAlphaCommand=void 0,this._viewport=new nt,this._rs=void 0,this._useScissorTest=!1,this._scissorRectangle=void 0,this._useHDR=!1}function lFe(e){e._accumulationTexture=e._accumulationTexture&&!e._accumulationTexture.isDestroyed()&&e._accumulationTexture.destroy(),e._revealageTexture=e._revealageTexture&&!e._revealageTexture.isDestroyed()&&e._revealageTexture.destroy()}function rre(e){e._translucentFBO.destroy(),e._alphaFBO.destroy(),e._adjustTranslucentFBO.destroy(),e._adjustAlphaFBO.destroy()}function dFe(e){lFe(e),rre(e)}function Xvt(e,t,n,i){lFe(e),e._accumulationTexture=new vt({context:t,width:n,height:i,pixelFormat:Qe.RGBA,pixelDatatype:Ue.FLOAT}),e._revealageTexture=new vt({context:t,pixelFormat:Qe.RGBA,pixelDatatype:Ue.FLOAT,width:n,height:i,flipY:!1})}function Nvt(e,t){rre(e);let n=ie.FRAMEBUFFER_COMPLETE,i=!0,{width:o,height:r}=e._accumulationTexture;if(e._translucentMRTSupport&&(e._translucentFBO.setColorTexture(e._accumulationTexture,0),e._translucentFBO.setColorTexture(e._revealageTexture,1),e._translucentFBO.setDepthStencilTexture(e._depthStencilTexture),e._translucentFBO.update(t,o,r),e._adjustTranslucentFBO.setColorTexture(e._accumulationTexture,0),e._adjustTranslucentFBO.setColorTexture(e._revealageTexture,1),e._adjustTranslucentFBO.update(t,o,r),(e._translucentFBO.status!==n||e._adjustTranslucentFBO.status!==n)&&(rre(e),e._translucentMRTSupport=!1)),!e._translucentMRTSupport){e._translucentFBO.setColorTexture(e._accumulationTexture),e._translucentFBO.setDepthStencilTexture(e._depthStencilTexture),e._translucentFBO.update(t,o,r),e._alphaFBO.setColorTexture(e._revealageTexture),e._alphaFBO.setDepthStencilTexture(e._depthStencilTexture),e._alphaFBO.update(t,o,r),e._adjustTranslucentFBO.setColorTexture(e._accumulationTexture),e._adjustTranslucentFBO.update(t,o,r),e._adjustAlphaFBO.setColorTexture(e._revealageTexture),e._adjustAlphaFBO.update(t,o,r);let s=e._translucentFBO.status===n,a=e._alphaFBO.status===n,c=e._adjustTranslucentFBO.status===n,d=e._adjustAlphaFBO.status===n;(!s||!a||!c||!d)&&(dFe(e),e._translucentMultipassSupport=!1,i=!1)}return i}$g.prototype.update=function(e,t,n,i,o){if(!this.isSupported())return;this._opaqueFBO=n,this._opaqueTexture=n.getColorTexture(0),this._depthStencilTexture=n.getDepthStencilTexture();let{width:r,height:s}=this._opaqueTexture,a=this._accumulationTexture,c=!l(a)||a.width!==r||a.height!==s||i!==this._useHDR,d=this._numSamples!==o;if((c||d)&&(this._numSamples=o,Xvt(this,e,r,s)),(!l(this._translucentFBO.framebuffer)||c||d)&&!Nvt(this,e))return;this._useHDR=i;let u=this,m,p;l(this._compositeCommand)||(m=new Je({sources:[Yv]}),this._translucentMRTSupport&&m.defines.push("MRT"),p={u_opaque:function(){return u._opaqueTexture},u_accumulation:function(){return u._accumulationTexture},u_revealage:function(){return u._revealageTexture}},this._compositeCommand=e.createViewportQuadCommand(m,{uniformMap:p,owner:this})),l(this._adjustTranslucentCommand)||(this._translucentMRTSupport?(m=new Je({defines:["MRT"],sources:[y1]}),p={u_bgColor:function(){return u._translucentMRTClearCommand.color},u_depthTexture:function(){return u._depthStencilTexture}},this._adjustTranslucentCommand=e.createViewportQuadCommand(m,{uniformMap:p,owner:this})):this._translucentMultipassSupport&&(m=new Je({sources:[y1]}),p={u_bgColor:function(){return u._translucentMultipassClearCommand.color},u_depthTexture:function(){return u._depthStencilTexture}},this._adjustTranslucentCommand=e.createViewportQuadCommand(m,{uniformMap:p,owner:this}),p={u_bgColor:function(){return u._alphaClearCommand.color},u_depthTexture:function(){return u._depthStencilTexture}},this._adjustAlphaCommand=e.createViewportQuadCommand(m,{uniformMap:p,owner:this}))),this._viewport.width=r,this._viewport.height=s;let b=!nt.equals(this._viewport,t.viewport),f=b!==this._useScissorTest;this._useScissorTest=b,nt.equals(this._scissorRectangle,t.viewport)||(this._scissorRectangle=nt.clone(t.viewport,this._scissorRectangle),f=!0),(!l(this._rs)||!nt.equals(this._viewport,this._rs.viewport)||f)&&(this._rs=ze.fromCache({viewport:this._viewport,scissorTest:{enabled:this._useScissorTest,rectangle:this._scissorRectangle}})),l(this._compositeCommand)&&(this._compositeCommand.renderState=this._rs),this._adjustTranslucentCommand&&(this._adjustTranslucentCommand.renderState=this._rs),l(this._adjustAlphaCommand)&&(this._adjustAlphaCommand.renderState=this._rs)};var Yvt={enabled:!0,color:new U(0,0,0,0),equationRgb:Ac.ADD,equationAlpha:Ac.ADD,functionSourceRgb:$o.ONE,functionDestinationRgb:$o.ONE,functionSourceAlpha:$o.ZERO,functionDestinationAlpha:$o.ONE_MINUS_SOURCE_ALPHA},Mvt={enabled:!0,color:new U(0,0,0,0),equationRgb:Ac.ADD,equationAlpha:Ac.ADD,functionSourceRgb:$o.ONE,functionDestinationRgb:$o.ONE,functionSourceAlpha:$o.ONE,functionDestinationAlpha:$o.ONE},wvt={enabled:!0,color:new U(0,0,0,0),equationRgb:Ac.ADD,equationAlpha:Ac.ADD,functionSourceRgb:$o.ZERO,functionDestinationRgb:$o.ONE_MINUS_SOURCE_ALPHA,functionSourceAlpha:$o.ZERO,functionDestinationAlpha:$o.ONE_MINUS_SOURCE_ALPHA};function sre(e,t,n,i){let o=n[i.id];if(!l(o)){let r=ze.getState(i);r.depthMask=!1,r.blending=t,o=ze.fromCache(r),n[i.id]=o}return o}function kvt(e,t,n){return sre(t,Yvt,e._translucentRenderStateCache,n)}function Uvt(e,t,n){return sre(t,Mvt,e._translucentRenderStateCache,n)}function Dvt(e,t,n){return sre(t,wvt,e._alphaRenderStateCache,n)}var Ovt=` vec3 Ci = czm_out_FragColor.rgb * czm_out_FragColor.a; +`;function T0(){this._picking=!1,this._snapping=!1,this._numSamples=1,this._tempCopyDepthTexture=void 0,this._pickColorFramebuffer=new li({depthStencil:!0,supportsDepthTexture:!0}),this._snapColorFramebuffer=new li({depthStencil:!0,supportsDepthTexture:!0,pixelDatatype:Ue.FLOAT,pixelFormat:Qe.RGBA}),this._outputFramebuffer=new li({depthStencil:!0,supportsDepthTexture:!0}),this._copyDepthFramebuffer=new li,this._tempCopyDepthFramebuffer=new li,this._updateDepthFramebuffer=new li({createColorAttachments:!1,createDepthAttachments:!1,depthStencil:!0}),this._clearGlobeColorCommand=void 0,this._copyColorCommand=void 0,this._copyDepthCommand=void 0,this._tempCopyDepthCommand=void 0,this._updateDepthCommand=void 0,this._viewport=new nt,this._rs=void 0,this._rsBlend=void 0,this._rsUpdate=void 0,this._useScissorTest=!1,this._scissorRectangle=void 0,this._useHdr=void 0,this._clearGlobeDepth=void 0}Object.defineProperties(T0.prototype,{colorFramebufferManager:{get:function(){return this._snapping?this._snapColorFramebuffer:this._picking?this._pickColorFramebuffer:this._outputFramebuffer}},framebuffer:{get:function(){return this.colorFramebufferManager.framebuffer}},depthStencilTexture:{get:function(){return this.colorFramebufferManager.getDepthStencilTexture()}},picking:{get:function(){return this._picking},set:function(e){this._picking=e}},snapping:{get:function(){return this._snapping},set:function(e){this._snapping=e}}});function pAe(e,t,n,i,o){let r=e._viewport;r.width=n,r.height=i;let s=!nt.equals(r,o.viewport),a=s!==e._useScissorTest;e._useScissorTest=s,nt.equals(e._scissorRectangle,o.viewport)||(e._scissorRectangle=nt.clone(o.viewport,e._scissorRectangle),a=!0),(!l(e._rs)||!nt.equals(r,e._rs.viewport)||a)&&(e._rs=ze.fromCache({viewport:r,scissorTest:{enabled:e._useScissorTest,rectangle:e._scissorRectangle}}),e._rsBlend=ze.fromCache({viewport:r,scissorTest:{enabled:e._useScissorTest,rectangle:e._scissorRectangle},blending:on.ALPHA_BLEND}),e._rsUpdate=ze.fromCache({viewport:r,scissorTest:{enabled:e._useScissorTest,rectangle:e._scissorRectangle},stencilTest:{enabled:!0,frontFunction:ni.EQUAL,frontOperation:{fail:Ft.KEEP,zFail:Ft.KEEP,zPass:Ft.KEEP},backFunction:ni.NEVER,reference:Jt.CESIUM_3D_TILE_MASK,mask:Jt.CESIUM_3D_TILE_MASK}})),l(e._copyDepthCommand)||(e._copyDepthCommand=t.createViewportQuadCommand(oT,{uniformMap:{u_depthTexture:function(){return e.colorFramebufferManager.getDepthStencilTexture()}},owner:e})),e._copyDepthCommand.framebuffer=e._copyDepthFramebuffer.framebuffer,e._copyDepthCommand.renderState=e._rs,l(e._copyColorCommand)||(e._copyColorCommand=t.createViewportQuadCommand(tu,{uniformMap:{colorTexture:function(){return e.colorFramebufferManager.getColorTexture()}},owner:e})),e._copyColorCommand.renderState=e._rs,l(e._tempCopyDepthCommand)||(e._tempCopyDepthCommand=t.createViewportQuadCommand(oT,{uniformMap:{u_depthTexture:function(){return e._tempCopyDepthTexture}},owner:e})),e._tempCopyDepthCommand.framebuffer=e._tempCopyDepthFramebuffer.framebuffer,e._tempCopyDepthCommand.renderState=e._rs,l(e._updateDepthCommand)||(e._updateDepthCommand=t.createViewportQuadCommand(tu,{uniformMap:{colorTexture:function(){return e._tempCopyDepthFramebuffer.getColorTexture()}},owner:e})),e._updateDepthCommand.framebuffer=e._updateDepthFramebuffer.framebuffer,e._updateDepthCommand.renderState=e._rsUpdate,l(e._clearGlobeColorCommand)||(e._clearGlobeColorCommand=new ui({color:new U(0,0,0,0),stencil:0,owner:e})),e._clearGlobeColorCommand.framebuffer=e.framebuffer}T0.prototype.update=function(e,t,n,i,o,r){let{width:s,height:a}=n,c=o?e.halfFloatingPointTexture?Ue.HALF_FLOAT:Ue.FLOAT:Ue.UNSIGNED_BYTE;this._numSamples=i,this.snapping?this._snapColorFramebuffer.update(e,s,a):this.picking?this._pickColorFramebuffer.update(e,s,a):this._outputFramebuffer.update(e,s,a,i,c),this._copyDepthFramebuffer.update(e,s,a),pAe(this,e,s,a,t),e.uniformState.globeDepthTexture=void 0,this._clearGlobeDepth=r};T0.prototype.prepareColorTextures=function(e,t){!this.picking&&this._numSamples>1&&this._outputFramebuffer.prepareTextures(e,t)};T0.prototype.executeCopyDepth=function(e,t){l(this._copyDepthCommand)&&(this.prepareColorTextures(e),this._copyDepthCommand.execute(e,t),e.uniformState.globeDepthTexture=this._copyDepthFramebuffer.getColorTexture())};T0.prototype.executeUpdateDepth=function(e,t,n){let i=l(n)?n:t.framebuffer.depthStencilTexture;if(!this._clearGlobeDepth&&i===this.colorFramebufferManager.getDepthStencilTexture()){l(this._copyDepthCommand)&&this._copyDepthCommand.execute(e,t);return}if(!l(this._updateDepthCommand))return;let o=this._updateDepthFramebuffer;if(!l(o.framebuffer)||o.getDepthStencilTexture()!==i||o.getColorTexture()!==this._copyDepthFramebuffer.getColorTexture()){let r=this._copyDepthFramebuffer.getColorTexture(),{width:s,height:a}=r;this._tempCopyDepthFramebuffer.destroy(),this._tempCopyDepthFramebuffer.update(e,s,a),o.setColorTexture(r,0),o.setDepthStencilTexture(i),o.update(e,s,a),pAe(this,e,s,a,t)}this._tempCopyDepthTexture=i,this._tempCopyDepthCommand.execute(e,t),this._updateDepthCommand.execute(e,t)};T0.prototype.executeCopyColor=function(e,t){l(this._copyColorCommand)&&this._copyColorCommand.execute(e,t)};T0.prototype.clear=function(e,t,n){let i=this._clearGlobeColorCommand;l(i)&&(U.clone(n,i.color),this.colorFramebufferManager.clear(e,i,t))};T0.prototype.isDestroyed=function(){return!1};T0.prototype.destroy=function(){return this._pickColorFramebuffer.destroy(),this._snapColorFramebuffer.destroy(),this._outputFramebuffer.destroy(),this._copyDepthFramebuffer.destroy(),this._tempCopyDepthFramebuffer.destroy(),this._updateDepthFramebuffer.destroy(),l(this._copyColorCommand)&&(this._copyColorCommand.shaderProgram=this._copyColorCommand.shaderProgram.destroy()),l(this._copyDepthCommand)&&(this._copyDepthCommand.shaderProgram=this._copyDepthCommand.shaderProgram.destroy()),l(this._tempCopyDepthCommand)&&(this._tempCopyDepthCommand.shaderProgram=this._tempCopyDepthCommand.shaderProgram.destroy()),l(this._updateDepthCommand)&&(this._updateDepthCommand.shaderProgram=this._updateDepthCommand.shaderProgram.destroy()),ue(this)};var bw=T0;var Cqi=x(T(),1);function AZ(){this._framebuffer=new li({depthStencil:!0,supportsDepthTexture:!0}),this._packedDepthFramebuffer=new li,this._renderState=void 0,this._packedDepthCommand=void 0,this._clearCommand=void 0,this._viewport=new nt,this._useScissorTest=!1,this._scissorRectangle=void 0,this._useHdr=void 0}Object.defineProperties(AZ.prototype,{classificationTexture:{get:function(){return this._framebuffer.getColorTexture()}},classificationFramebuffer:{get:function(){return this._framebuffer.framebuffer}},packedDepthFramebuffer:{get:function(){return this._packedDepthFramebuffer.framebuffer}},depthStencilTexture:{get:function(){return this._framebuffer.getDepthStencilTexture()}},depthStencilRenderbuffer:{get:function(){return this._framebuffer.getDepthStencilRenderbuffer()}},packedDepthTexture:{get:function(){return this._packedDepthFramebuffer.getColorTexture()}}});function $1t(e){e._framebuffer.destroy(),e._packedDepthFramebuffer.destroy()}function eCt(e,t,n,i,o){let r=o?t.halfFloatingPointTexture?Ue.HALF_FLOAT:Ue.FLOAT:Ue.UNSIGNED_BYTE;e._framebuffer.update(t,n,i,1,r),e._packedDepthFramebuffer.update(t,n,i)}function tCt(e,t,n,i,o){e._viewport.width=n,e._viewport.height=i;let r=!nt.equals(e._viewport,o.viewport),s=r!==e._useScissorTest;e._useScissorTest=r,nt.equals(e._scissorRectangle,o.viewport)||(e._scissorRectangle=nt.clone(o.viewport,e._scissorRectangle),s=!0),(!l(e._renderState)||!nt.equals(e._viewport,e._renderState.viewport)||s)&&(e._renderState=ze.fromCache({viewport:e._viewport,scissorTest:{enabled:e._useScissorTest,rectangle:e._scissorRectangle}})),l(e._packedDepthCommand)||(e._packedDepthCommand=t.createViewportQuadCommand(oT,{uniformMap:{u_depthTexture:function(){return e.depthStencilTexture}},owner:e})),l(e._clearCommand)||(e._clearCommand=new ui({color:new U(0,0,0,0),depth:1,stencil:0,owner:e})),e._packedDepthCommand.framebuffer=e._packedDepthFramebuffer.framebuffer,e._packedDepthCommand.renderState=e._renderState,e._clearCommand.framebuffer=e.classificationFramebuffer,e._clearCommand.renderState=e._renderState}AZ.prototype.updateAndClear=function(e,t,n,i){let o=t.width,r=t.height;eCt(this,n,o,r,e),tCt(this,n,o,r,i),this._useHdr=e};AZ.prototype.clearClassification=function(e,t){this._clearCommand.execute(e,t)};AZ.prototype.packDepth=function(e,t){return this._packedDepthCommand.execute(e,t),this.packedDepthTexture};AZ.prototype.isDestroyed=function(){return!1};AZ.prototype.destroy=function(){return $1t(this),ue(this)};var gw=AZ;var Oqi=x(T(),1);function Pg(e){this._numSamples=1,this._translucentMultipassSupport=!1,this._translucentMRTSupport=!1;let t=e.colorBufferFloat&&e.depthTexture&&e.floatBlend;this._translucentMRTSupport=e.drawBuffers&&t,this._translucentMultipassSupport=!this._translucentMRTSupport&&t,this._opaqueFBO=void 0,this._opaqueTexture=void 0,this._depthStencilTexture=void 0,this._accumulationTexture=void 0,this._translucentFBO=new li({colorAttachmentsLength:this._translucentMRTSupport?2:1,createColorAttachments:!1,createDepthAttachments:!1,depth:!0}),this._alphaFBO=new li({createColorAttachments:!1,createDepthAttachments:!1,depth:!0}),this._adjustTranslucentFBO=new li({colorAttachmentsLength:this._translucentMRTSupport?2:1,createColorAttachments:!1}),this._adjustAlphaFBO=new li({createColorAttachments:!1}),this._opaqueClearCommand=new ui({color:new U(0,0,0,0),owner:this}),this._translucentMRTClearCommand=new ui({color:new U(0,0,0,1),owner:this}),this._translucentMultipassClearCommand=new ui({color:new U(0,0,0,0),owner:this}),this._alphaClearCommand=new ui({color:new U(1,1,1,1),owner:this}),this._translucentRenderStateCache={},this._alphaRenderStateCache={},this._compositeCommand=void 0,this._adjustTranslucentCommand=void 0,this._adjustAlphaCommand=void 0,this._viewport=new nt,this._rs=void 0,this._useScissorTest=!1,this._scissorRectangle=void 0,this._useHDR=!1}function bAe(e){e._accumulationTexture=e._accumulationTexture&&!e._accumulationTexture.isDestroyed()&&e._accumulationTexture.destroy(),e._revealageTexture=e._revealageTexture&&!e._revealageTexture.isDestroyed()&&e._revealageTexture.destroy()}function kte(e){e._translucentFBO.destroy(),e._alphaFBO.destroy(),e._adjustTranslucentFBO.destroy(),e._adjustAlphaFBO.destroy()}function gAe(e){bAe(e),kte(e)}function nCt(e,t,n,i){bAe(e),e._accumulationTexture=new vt({context:t,width:n,height:i,pixelFormat:Qe.RGBA,pixelDatatype:Ue.FLOAT}),e._revealageTexture=new vt({context:t,pixelFormat:Qe.RGBA,pixelDatatype:Ue.FLOAT,width:n,height:i,flipY:!1})}function iCt(e,t){kte(e);let n=ie.FRAMEBUFFER_COMPLETE,i=!0,{width:o,height:r}=e._accumulationTexture;if(e._translucentMRTSupport&&(e._translucentFBO.setColorTexture(e._accumulationTexture,0),e._translucentFBO.setColorTexture(e._revealageTexture,1),e._translucentFBO.setDepthStencilTexture(e._depthStencilTexture),e._translucentFBO.update(t,o,r),e._adjustTranslucentFBO.setColorTexture(e._accumulationTexture,0),e._adjustTranslucentFBO.setColorTexture(e._revealageTexture,1),e._adjustTranslucentFBO.update(t,o,r),(e._translucentFBO.status!==n||e._adjustTranslucentFBO.status!==n)&&(kte(e),e._translucentMRTSupport=!1)),!e._translucentMRTSupport){e._translucentFBO.setColorTexture(e._accumulationTexture),e._translucentFBO.setDepthStencilTexture(e._depthStencilTexture),e._translucentFBO.update(t,o,r),e._alphaFBO.setColorTexture(e._revealageTexture),e._alphaFBO.setDepthStencilTexture(e._depthStencilTexture),e._alphaFBO.update(t,o,r),e._adjustTranslucentFBO.setColorTexture(e._accumulationTexture),e._adjustTranslucentFBO.update(t,o,r),e._adjustAlphaFBO.setColorTexture(e._revealageTexture),e._adjustAlphaFBO.update(t,o,r);let s=e._translucentFBO.status===n,a=e._alphaFBO.status===n,c=e._adjustTranslucentFBO.status===n,d=e._adjustAlphaFBO.status===n;(!s||!a||!c||!d)&&(gAe(e),e._translucentMultipassSupport=!1,i=!1)}return i}Pg.prototype.update=function(e,t,n,i,o){if(!this.isSupported())return;this._opaqueFBO=n,this._opaqueTexture=n.getColorTexture(0),this._depthStencilTexture=n.getDepthStencilTexture();let{width:r,height:s}=this._opaqueTexture,a=this._accumulationTexture,c=!l(a)||a.width!==r||a.height!==s||i!==this._useHDR,d=this._numSamples!==o;if((c||d)&&(this._numSamples=o,nCt(this,e,r,s)),(!l(this._translucentFBO.framebuffer)||c||d)&&!iCt(this,e))return;this._useHDR=i;let u=this,m,p;l(this._compositeCommand)||(m=new Je({sources:[Yv]}),this._translucentMRTSupport&&m.defines.push("MRT"),p={u_opaque:function(){return u._opaqueTexture},u_accumulation:function(){return u._accumulationTexture},u_revealage:function(){return u._revealageTexture}},this._compositeCommand=e.createViewportQuadCommand(m,{uniformMap:p,owner:this})),l(this._adjustTranslucentCommand)||(this._translucentMRTSupport?(m=new Je({defines:["MRT"],sources:[y1]}),p={u_bgColor:function(){return u._translucentMRTClearCommand.color},u_depthTexture:function(){return u._depthStencilTexture}},this._adjustTranslucentCommand=e.createViewportQuadCommand(m,{uniformMap:p,owner:this})):this._translucentMultipassSupport&&(m=new Je({sources:[y1]}),p={u_bgColor:function(){return u._translucentMultipassClearCommand.color},u_depthTexture:function(){return u._depthStencilTexture}},this._adjustTranslucentCommand=e.createViewportQuadCommand(m,{uniformMap:p,owner:this}),p={u_bgColor:function(){return u._alphaClearCommand.color},u_depthTexture:function(){return u._depthStencilTexture}},this._adjustAlphaCommand=e.createViewportQuadCommand(m,{uniformMap:p,owner:this}))),this._viewport.width=r,this._viewport.height=s;let b=!nt.equals(this._viewport,t.viewport),f=b!==this._useScissorTest;this._useScissorTest=b,nt.equals(this._scissorRectangle,t.viewport)||(this._scissorRectangle=nt.clone(t.viewport,this._scissorRectangle),f=!0),(!l(this._rs)||!nt.equals(this._viewport,this._rs.viewport)||f)&&(this._rs=ze.fromCache({viewport:this._viewport,scissorTest:{enabled:this._useScissorTest,rectangle:this._scissorRectangle}})),l(this._compositeCommand)&&(this._compositeCommand.renderState=this._rs),this._adjustTranslucentCommand&&(this._adjustTranslucentCommand.renderState=this._rs),l(this._adjustAlphaCommand)&&(this._adjustAlphaCommand.renderState=this._rs)};var oCt={enabled:!0,color:new U(0,0,0,0),equationRgb:Gc.ADD,equationAlpha:Gc.ADD,functionSourceRgb:$o.ONE,functionDestinationRgb:$o.ONE,functionSourceAlpha:$o.ZERO,functionDestinationAlpha:$o.ONE_MINUS_SOURCE_ALPHA},rCt={enabled:!0,color:new U(0,0,0,0),equationRgb:Gc.ADD,equationAlpha:Gc.ADD,functionSourceRgb:$o.ONE,functionDestinationRgb:$o.ONE,functionSourceAlpha:$o.ONE,functionDestinationAlpha:$o.ONE},sCt={enabled:!0,color:new U(0,0,0,0),equationRgb:Gc.ADD,equationAlpha:Gc.ADD,functionSourceRgb:$o.ZERO,functionDestinationRgb:$o.ONE_MINUS_SOURCE_ALPHA,functionSourceAlpha:$o.ZERO,functionDestinationAlpha:$o.ONE_MINUS_SOURCE_ALPHA};function Ute(e,t,n,i){let o=n[i.id];if(!l(o)){let r=ze.getState(i);r.depthMask=!1,r.blending=t,o=ze.fromCache(r),n[i.id]=o}return o}function aCt(e,t,n){return Ute(t,oCt,e._translucentRenderStateCache,n)}function cCt(e,t,n){return Ute(t,rCt,e._translucentRenderStateCache,n)}function lCt(e,t,n){return Ute(t,sCt,e._alphaRenderStateCache,n)}var dCt=` vec3 Ci = czm_out_FragColor.rgb * czm_out_FragColor.a; float ai = czm_out_FragColor.a; float wzi = czm_alphaWeight(ai); out_FragData_0 = vec4(Ci * wzi, ai); out_FragData_1 = vec4(ai * wzi); -`,Bvt=` vec3 Ci = czm_out_FragColor.rgb * czm_out_FragColor.a; +`,uCt=` vec3 Ci = czm_out_FragColor.rgb * czm_out_FragColor.a; float ai = czm_out_FragColor.a; float wzi = czm_alphaWeight(ai); out_FragColor = vec4(Ci, ai) * wzi; -`,zvt=` float ai = czm_out_FragColor.a; +`,mCt=` float ai = czm_out_FragColor.a; out_FragColor = vec4(ai); -`;function are(e,t,n,i){let{shaderCache:o}=e,r=o.getDerivedShaderProgram(t,n);if(l(r))return r;let s=t._attributeLocations,a=t.fragmentShaderSource.clone();a.sources=a.sources.map(function(u){return Je.replaceMain(u,"czm_translucent_main").replace(/out_FragColor/g,"czm_out_FragColor").replace(/layout\s*\(location\s*=\s*0\)\s*out\s+vec4\s+out_FragColor;/g,"").replace(/\bdiscard\b/g,"czm_discard = true").replace(/czm_phong/g,"czm_translucentPhong")}),a.sources.splice(0,0,`#define CESIUM_REDIRECTED_COLOR_OUTPUT +`;function Dte(e,t,n,i){let{shaderCache:o}=e,r=o.getDerivedShaderProgram(t,n);if(l(r))return r;let s=t._attributeLocations,a=t.fragmentShaderSource.clone();a.sources=a.sources.map(function(u){return Je.replaceMain(u,"czm_translucent_main").replace(/out_FragColor/g,"czm_out_FragColor").replace(/layout\s*\(location\s*=\s*0\)\s*out\s+vec4\s+out_FragColor;/g,"").replace(/\bdiscard\b/g,"czm_discard = true").replace(/czm_phong/g,"czm_translucentPhong")}),a.sources.splice(0,0,`#define CESIUM_REDIRECTED_COLOR_OUTPUT vec4 czm_out_FragColor; bool czm_discard = false; `);let c=[...i.matchAll(/out_FragData_(\d+)/g)],d="";for(let u=0;u<c.length;u++){let m=c[u];d=`layout (location = ${m[1]}) out vec4 ${m[0]}; @@ -10345,12 +10345,12 @@ ${d}`}return a.sources.push(d),a.sources.push(`void main() discard; } ${i}} -`),o.createDerivedShaderProgram(t,n,{vertexShaderSource:t.vertexShaderSource,fragmentShaderSource:a,attributeLocations:s})}function Hvt(e,t){return are(e,t,"translucentMRT",Ovt)}function Kvt(e,t){return are(e,t,"translucentMultipass",Bvt)}function Jvt(e,t){return are(e,t,"alphaMultipass",zvt)}$g.prototype.createDerivedCommands=function(e,t,n){if(l(n)||(n={}),this._translucentMRTSupport){let a,c;return l(n.translucentCommand)&&(a=n.translucentCommand.shaderProgram,c=n.translucentCommand.renderState),n.translucentCommand=lt.shallowClone(e,n.translucentCommand),!l(a)||n.shaderProgramId!==e.shaderProgram.id?(n.translucentCommand.shaderProgram=Hvt(t,e.shaderProgram),n.translucentCommand.renderState=kvt(this,t,e.renderState),n.shaderProgramId=e.shaderProgram.id):(n.translucentCommand.shaderProgram=a,n.translucentCommand.renderState=c),n}let i,o,r,s;return l(n.translucentCommand)&&(i=n.translucentCommand.shaderProgram,o=n.translucentCommand.renderState,r=n.alphaCommand.shaderProgram,s=n.alphaCommand.renderState),n.translucentCommand=lt.shallowClone(e,n.translucentCommand),n.alphaCommand=lt.shallowClone(e,n.alphaCommand),!l(i)||n.shaderProgramId!==e.shaderProgram.id?(n.translucentCommand.shaderProgram=Kvt(t,e.shaderProgram),n.translucentCommand.renderState=Uvt(this,t,e.renderState),n.alphaCommand.shaderProgram=Jvt(t,e.shaderProgram),n.alphaCommand.renderState=Dvt(this,t,e.renderState),n.shaderProgramId=e.shaderProgram.id):(n.translucentCommand.shaderProgram=i,n.translucentCommand.renderState=o,n.alphaCommand.shaderProgram=r,n.alphaCommand.renderState=s),n};function jvt(e,t,n,i,o,r){let{context:s,frameState:a}=t,{useLogDepth:c,shadowState:d}=a,u=t._hdr,m=i.framebuffer,p=d.lightShadowsEnabled;i.framebuffer=e._adjustTranslucentFBO.framebuffer,e._adjustTranslucentCommand.execute(s,i),i.framebuffer=e._adjustAlphaFBO.framebuffer,e._adjustAlphaCommand.execute(s,i);let b=e._opaqueFBO.framebuffer;i.framebuffer=e._translucentFBO.framebuffer;for(let f=0;f<o.length;++f){let y=o[f];y=c?y.derivedCommands.logDepth.command:y,y=u?y.derivedCommands.hdr.command:y;let _=p&&y.receiveShadows?y.derivedCommands.oit.shadows.translucentCommand:y.derivedCommands.oit.translucentCommand;n(_,t,i,b)}if(l(r)){let f=r.unclassifiedCommand,y=p&&f.receiveShadows?f.derivedCommands.oit.shadows.translucentCommand:f.derivedCommands.oit.translucentCommand;n(y,t,i,b)}i.framebuffer=e._alphaFBO.framebuffer;for(let f=0;f<o.length;++f){let y=o[f];y=c?y.derivedCommands.logDepth.command:y,y=u?y.derivedCommands.hdr.command:y;let _=p&&y.receiveShadows?y.derivedCommands.oit.shadows.alphaCommand:y.derivedCommands.oit.alphaCommand;n(_,t,i,b)}if(l(r)){let f=r.unclassifiedCommand,y=p&&f.receiveShadows?f.derivedCommands.oit.shadows.alphaCommand:f.derivedCommands.oit.alphaCommand;n(y,t,i,b)}i.framebuffer=m}function Qvt(e,t,n,i,o,r){let{context:s,frameState:a}=t,{useLogDepth:c,shadowState:d}=a,u=t._hdr,m=i.framebuffer,p=d.lightShadowsEnabled;i.framebuffer=e._adjustTranslucentFBO.framebuffer,e._adjustTranslucentCommand.execute(s,i);let b=e._opaqueFBO.framebuffer;i.framebuffer=e._translucentFBO.framebuffer;for(let f=0;f<o.length;++f){let y=o[f];y=c?y.derivedCommands.logDepth.command:y,y=u?y.derivedCommands.hdr.command:y;let _=p&&y.receiveShadows?y.derivedCommands.oit.shadows.translucentCommand:y.derivedCommands.oit.translucentCommand;n(_,t,i,b)}if(l(r)){let f=r.unclassifiedCommand,y=p&&f.receiveShadows?f.derivedCommands.oit.shadows.translucentCommand:f.derivedCommands.oit.translucentCommand;n(y,t,i,b)}i.framebuffer=m}$g.prototype.executeCommands=function(e,t,n,i,o){if(this._translucentMRTSupport){Qvt(this,e,t,n,i,o);return}jvt(this,e,t,n,i,o)};$g.prototype.execute=function(e,t){this._compositeCommand.execute(e,t)};$g.prototype.clear=function(e,t,n){let i=t.framebuffer;t.framebuffer=this._opaqueFBO.framebuffer,U.clone(n,this._opaqueClearCommand.color),this._opaqueClearCommand.execute(e,t),t.framebuffer=this._translucentFBO.framebuffer,(this._translucentMRTSupport?this._translucentMRTClearCommand:this._translucentMultipassClearCommand).execute(e,t),this._translucentMultipassSupport&&(t.framebuffer=this._alphaFBO.framebuffer,this._alphaClearCommand.execute(e,t)),t.framebuffer=i};$g.prototype.isSupported=function(){return this._translucentMRTSupport||this._translucentMultipassSupport};$g.prototype.isDestroyed=function(){return!1};$g.prototype.destroy=function(){return dFe(this),l(this._compositeCommand)&&(this._compositeCommand.shaderProgram=this._compositeCommand.shaderProgram&&this._compositeCommand.shaderProgram.destroy()),l(this._adjustTranslucentCommand)&&(this._adjustTranslucentCommand.shaderProgram=this._adjustTranslucentCommand.shaderProgram&&this._adjustTranslucentCommand.shaderProgram.destroy()),l(this._adjustAlphaCommand)&&(this._adjustAlphaCommand.shaderProgram=this._adjustAlphaCommand.shaderProgram&&this._adjustAlphaCommand.shaderProgram.destroy()),ue(this)};var A9=$g;var Dho=x(T(),1);function G9(){this._framebuffer=new li({color:!1,depthStencil:!0,supportsDepthTexture:!0}),this._passState=void 0}Object.defineProperties(G9.prototype,{framebuffer:{get:function(){return this._framebuffer.framebuffer}}});function qvt(e){e._framebuffer.destroy()}function $vt(e,t){let n=t.drawingBufferWidth,i=t.drawingBufferHeight;e._framebuffer.update(t,n,i);let o=new oc(t);o.blendingEnabled=!1,o.scissorTest={enabled:!0,rectangle:new nt},o.viewport=new nt,e._passState=o}G9.prototype.update=function(e,t,n){let i=n.width,o=n.height;this._framebuffer.isDirty(i,o)&&$vt(this,e);let r=this.framebuffer,s=this._passState;return s.framebuffer=r,s.viewport.width=i,s.viewport.height=o,s.scissorTest.rectangle.x=t.x,s.scissorTest.rectangle.y=o-t.y,s.scissorTest.rectangle.width=1,s.scissorTest.rectangle.height=1,s};G9.prototype.isDestroyed=function(){return!1};G9.prototype.destroy=function(){return qvt(this),ue(this)};var L9=G9;var tfo=x(T(),1);function nR(e){let t=new oc(e);t.blendingEnabled=!1,t.scissorTest={enabled:!0,rectangle:new nt},t.viewport=new nt,this._context=e,this._fb=new li({depthStencil:!0}),this._passState=t,this._width=0,this._height=0}function uFe(e,t,n,i,o=1){let r=Math.max(n,i),s=r*r,a=Math.floor(n*.5),c=Math.floor(i*.5),d=0,u=0,m=0,p=-1,b=new Set;for(let f=0;f<s;++f){if(-a<=d&&d<=a&&-c<=u&&u<=c){let y=4*((c-u)*n+d+a),_=U.bytesToRgba(t[y],t[y+1],t[y+2],t[y+3]),S=e.getObjectByPickColor(_);if(l(S)&&(b.add(S),b.size>=o))break}if(d===u||d<0&&-d===u||d>0&&d===1-u){let y=m;m=-p,p=y}d+=m,u+=p}return[...b]}nR.prototype.begin=function(e,t){let n=this._context,{width:i,height:o}=t;return nt.clone(e,this._passState.scissorTest.rectangle),this._width=i,this._height=o,this._fb.update(n,i,o),this._passState.framebuffer=this._fb.framebuffer,this._passState.viewport.width=i,this._passState.viewport.height=o,this._passState};nR.prototype.endAsync=async function(e,t,n=1){let i=e.width??1,o=e.height??1,r=this._context,s=this._fb.framebuffer,a=Ue.UNSIGNED_BYTE,c=Qe.RGBA;l(s)&&s.numberOfColorAttachments>0&&(a=s.getColorTexture(0).pixelDatatype,c=s.getColorTexture(0).pixelFormat);let d=r.readPixelsToPBO({x:e.x,y:e.y,width:i,height:o,framebuffer:s}),u=_v.create({context:r});try{await u.waitForSignal(b=>t.afterRender.push(b));let m=Qe.createTypedArray(c,a,i,o);return d.getBufferData(m),uFe(r,m,i,o,n)}catch{throw new ae("Async Picking Request Timeout")}finally{u.destroy(),d.destroy()}};nR.prototype.end=function(e,t=1){let n=e.width??1,i=e.height??1,o=this._context,r=o.readPixels({x:e.x,y:e.y,width:n,height:i,framebuffer:this._fb.framebuffer});return uFe(o,r,n,i,t)};nR.prototype.readCenterPixel=function(e){let t=e.width??1,n=e.height??1,o=this._context.readPixels({x:e.x,y:e.y,width:t,height:n,framebuffer:this._fb.framebuffer}),r=Math.floor(t*.5),a=4*(Math.floor(n*.5)*t+r);return o.slice(a,a+4)};nR.prototype.isDestroyed=function(){return!1};nR.prototype.destroy=function(){return this._fb.destroy(),ue(this)};var W9=nR;var cfo=x(T(),1);function ey(){this._numSamples=1,this._colorFramebuffer=new li({depthStencil:!0,supportsDepthTexture:!0}),this._idFramebuffer=new li({depthStencil:!0,supportsDepthTexture:!0}),this._idClearColor=new U(0,0,0,0),this._clearCommand=new ui({color:new U(0,0,0,0),depth:1,owner:this})}function e2t(e){e._colorFramebuffer.destroy(),e._idFramebuffer.destroy()}Object.defineProperties(ey.prototype,{framebuffer:{get:function(){return this._colorFramebuffer.framebuffer}},idFramebuffer:{get:function(){return this._idFramebuffer.framebuffer}},depthStencilTexture:{get:function(){return this._colorFramebuffer.getDepthStencilTexture()}}});ey.prototype.update=function(e,t,n,i){let o=t.width,r=t.height,s=n?e.halfFloatingPointTexture?Ue.HALF_FLOAT:Ue.FLOAT:Ue.UNSIGNED_BYTE;this._numSamples=i,this._colorFramebuffer.update(e,o,r,i,s),this._idFramebuffer.update(e,o,r)};ey.prototype.clear=function(e,t,n){U.clone(n,this._clearCommand.color),U.clone(this._idClearColor,this._clearCommand.color),this._colorFramebuffer.clear(e,this._clearCommand,t),this._idFramebuffer.clear(e,this._clearCommand,t)};ey.prototype.getFramebuffer=function(){return this._colorFramebuffer.framebuffer};ey.prototype.getIdFramebuffer=function(){return this._idFramebuffer.framebuffer};ey.prototype.prepareColorTextures=function(e){this._numSamples>1&&this._colorFramebuffer.prepareTextures(e)};ey.prototype.isDestroyed=function(){return!1};ey.prototype.destroy=function(){return e2t(this),ue(this)};var iR=ey;var rpo=x(T(),1);var mfo=x(T(),1);function VT(){}var t2t={HAS_CLIPPING_PLANES:!0,ENABLE_CLIPPING_POLYGONS:!0};VT.hasClippingForShadowCast=function(e){let t=e.defines;return l(t)&&t.some(function(n){return t2t[n]===!0})};VT.getShadowCastShaderKeyword=function(e,t,n,i,o){return`castShadow ${e} ${t} ${n} ${i} ${o}`};VT.createShadowCastVertexShader=function(e,t,n){let i=e.defines.slice(0),o=e.sources.slice(0);i.push("SHADOW_MAP"),n&&i.push("GENERATE_POSITION");let r=Je.findPositionVarying(e),s=l(r);if(t&&!s){let a=o.length;for(let d=0;d<a;++d)o[d]=Je.replaceMain(o[d],"czm_shadow_cast_main");o.push(`out vec3 v_positionEC; +`),o.createDerivedShaderProgram(t,n,{vertexShaderSource:t.vertexShaderSource,fragmentShaderSource:a,attributeLocations:s})}function hCt(e,t){return Dte(e,t,"translucentMRT",dCt)}function fCt(e,t){return Dte(e,t,"translucentMultipass",uCt)}function pCt(e,t){return Dte(e,t,"alphaMultipass",mCt)}Pg.prototype.createDerivedCommands=function(e,t,n){if(l(n)||(n={}),this._translucentMRTSupport){let a,c;return l(n.translucentCommand)&&(a=n.translucentCommand.shaderProgram,c=n.translucentCommand.renderState),n.translucentCommand=lt.shallowClone(e,n.translucentCommand),!l(a)||n.shaderProgramId!==e.shaderProgram.id?(n.translucentCommand.shaderProgram=hCt(t,e.shaderProgram),n.translucentCommand.renderState=aCt(this,t,e.renderState),n.shaderProgramId=e.shaderProgram.id):(n.translucentCommand.shaderProgram=a,n.translucentCommand.renderState=c),n}let i,o,r,s;return l(n.translucentCommand)&&(i=n.translucentCommand.shaderProgram,o=n.translucentCommand.renderState,r=n.alphaCommand.shaderProgram,s=n.alphaCommand.renderState),n.translucentCommand=lt.shallowClone(e,n.translucentCommand),n.alphaCommand=lt.shallowClone(e,n.alphaCommand),!l(i)||n.shaderProgramId!==e.shaderProgram.id?(n.translucentCommand.shaderProgram=fCt(t,e.shaderProgram),n.translucentCommand.renderState=cCt(this,t,e.renderState),n.alphaCommand.shaderProgram=pCt(t,e.shaderProgram),n.alphaCommand.renderState=lCt(this,t,e.renderState),n.shaderProgramId=e.shaderProgram.id):(n.translucentCommand.shaderProgram=i,n.translucentCommand.renderState=o,n.alphaCommand.shaderProgram=r,n.alphaCommand.renderState=s),n};function bCt(e,t,n,i,o,r){let{context:s,frameState:a}=t,{useLogDepth:c,shadowState:d}=a,u=t._hdr,m=i.framebuffer,p=d.lightShadowsEnabled;i.framebuffer=e._adjustTranslucentFBO.framebuffer,e._adjustTranslucentCommand.execute(s,i),i.framebuffer=e._adjustAlphaFBO.framebuffer,e._adjustAlphaCommand.execute(s,i);let b=e._opaqueFBO.framebuffer;i.framebuffer=e._translucentFBO.framebuffer;for(let f=0;f<o.length;++f){let y=o[f];y=c?y.derivedCommands.logDepth.command:y,y=u?y.derivedCommands.hdr.command:y;let _=p&&y.receiveShadows?y.derivedCommands.oit.shadows.translucentCommand:y.derivedCommands.oit.translucentCommand;n(_,t,i,b)}if(l(r)){let f=r.unclassifiedCommand,y=p&&f.receiveShadows?f.derivedCommands.oit.shadows.translucentCommand:f.derivedCommands.oit.translucentCommand;n(y,t,i,b)}i.framebuffer=e._alphaFBO.framebuffer;for(let f=0;f<o.length;++f){let y=o[f];y=c?y.derivedCommands.logDepth.command:y,y=u?y.derivedCommands.hdr.command:y;let _=p&&y.receiveShadows?y.derivedCommands.oit.shadows.alphaCommand:y.derivedCommands.oit.alphaCommand;n(_,t,i,b)}if(l(r)){let f=r.unclassifiedCommand,y=p&&f.receiveShadows?f.derivedCommands.oit.shadows.alphaCommand:f.derivedCommands.oit.alphaCommand;n(y,t,i,b)}i.framebuffer=m}function gCt(e,t,n,i,o,r){let{context:s,frameState:a}=t,{useLogDepth:c,shadowState:d}=a,u=t._hdr,m=i.framebuffer,p=d.lightShadowsEnabled;i.framebuffer=e._adjustTranslucentFBO.framebuffer,e._adjustTranslucentCommand.execute(s,i);let b=e._opaqueFBO.framebuffer;i.framebuffer=e._translucentFBO.framebuffer;for(let f=0;f<o.length;++f){let y=o[f];y=c?y.derivedCommands.logDepth.command:y,y=u?y.derivedCommands.hdr.command:y;let _=p&&y.receiveShadows?y.derivedCommands.oit.shadows.translucentCommand:y.derivedCommands.oit.translucentCommand;n(_,t,i,b)}if(l(r)){let f=r.unclassifiedCommand,y=p&&f.receiveShadows?f.derivedCommands.oit.shadows.translucentCommand:f.derivedCommands.oit.translucentCommand;n(y,t,i,b)}i.framebuffer=m}Pg.prototype.executeCommands=function(e,t,n,i,o){if(this._translucentMRTSupport){gCt(this,e,t,n,i,o);return}bCt(this,e,t,n,i,o)};Pg.prototype.execute=function(e,t){this._compositeCommand.execute(e,t)};Pg.prototype.clear=function(e,t,n){let i=t.framebuffer;t.framebuffer=this._opaqueFBO.framebuffer,U.clone(n,this._opaqueClearCommand.color),this._opaqueClearCommand.execute(e,t),t.framebuffer=this._translucentFBO.framebuffer,(this._translucentMRTSupport?this._translucentMRTClearCommand:this._translucentMultipassClearCommand).execute(e,t),this._translucentMultipassSupport&&(t.framebuffer=this._alphaFBO.framebuffer,this._alphaClearCommand.execute(e,t)),t.framebuffer=i};Pg.prototype.isSupported=function(){return this._translucentMRTSupport||this._translucentMultipassSupport};Pg.prototype.isDestroyed=function(){return!1};Pg.prototype.destroy=function(){return gAe(this),l(this._compositeCommand)&&(this._compositeCommand.shaderProgram=this._compositeCommand.shaderProgram&&this._compositeCommand.shaderProgram.destroy()),l(this._adjustTranslucentCommand)&&(this._adjustTranslucentCommand.shaderProgram=this._adjustTranslucentCommand.shaderProgram&&this._adjustTranslucentCommand.shaderProgram.destroy()),l(this._adjustAlphaCommand)&&(this._adjustAlphaCommand.shaderProgram=this._adjustAlphaCommand.shaderProgram&&this._adjustAlphaCommand.shaderProgram.destroy()),ue(this)};var yw=Pg;var jqi=x(T(),1);function xw(){this._framebuffer=new li({color:!1,depthStencil:!0,supportsDepthTexture:!0}),this._passState=void 0}Object.defineProperties(xw.prototype,{framebuffer:{get:function(){return this._framebuffer.framebuffer}}});function yCt(e){e._framebuffer.destroy()}function xCt(e,t){let n=t.drawingBufferWidth,i=t.drawingBufferHeight;e._framebuffer.update(t,n,i);let o=new oc(t);o.blendingEnabled=!1,o.scissorTest={enabled:!0,rectangle:new nt},o.viewport=new nt,e._passState=o}xw.prototype.update=function(e,t,n){let i=n.width,o=n.height;this._framebuffer.isDirty(i,o)&&xCt(this,e);let r=this.framebuffer,s=this._passState;return s.framebuffer=r,s.viewport.width=i,s.viewport.height=o,s.scissorTest.rectangle.x=t.x,s.scissorTest.rectangle.y=o-t.y,s.scissorTest.rectangle.width=1,s.scissorTest.rectangle.height=1,s};xw.prototype.isDestroyed=function(){return!1};xw.prototype.destroy=function(){return yCt(this),ue(this)};var Tw=xw;var c$i=x(T(),1);function GZ(e){let t=new oc(e);t.blendingEnabled=!1,t.scissorTest={enabled:!0,rectangle:new nt},t.viewport=new nt,this._context=e,this._fb=new li({depthStencil:!0}),this._passState=t,this._width=0,this._height=0}function yAe(e,t,n,i,o=1){let r=Math.max(n,i),s=r*r,a=Math.floor(n*.5),c=Math.floor(i*.5),d=0,u=0,m=0,p=-1,b=new Set;for(let f=0;f<s;++f){if(-a<=d&&d<=a&&-c<=u&&u<=c){let y=4*((c-u)*n+d+a),_=U.bytesToRgba(t[y],t[y+1],t[y+2],t[y+3]),S=e.getObjectByPickColor(_);if(l(S)&&(b.add(S),b.size>=o))break}if(d===u||d<0&&-d===u||d>0&&d===1-u){let y=m;m=-p,p=y}d+=m,u+=p}return[...b]}GZ.prototype.begin=function(e,t){let n=this._context,{width:i,height:o}=t;return nt.clone(e,this._passState.scissorTest.rectangle),this._width=i,this._height=o,this._fb.update(n,i,o),this._passState.framebuffer=this._fb.framebuffer,this._passState.viewport.width=i,this._passState.viewport.height=o,this._passState};GZ.prototype.endAsync=async function(e,t,n=1){let i=e.width??1,o=e.height??1,r=this._context,s=this._fb.framebuffer,a=Ue.UNSIGNED_BYTE,c=Qe.RGBA;l(s)&&s.numberOfColorAttachments>0&&(a=s.getColorTexture(0).pixelDatatype,c=s.getColorTexture(0).pixelFormat);let d=r.readPixelsToPBO({x:e.x,y:e.y,width:i,height:o,framebuffer:s}),u=_v.create({context:r});try{await u.waitForSignal(b=>t.afterRender.push(b));let m=Qe.createTypedArray(c,a,i,o);return d.getBufferData(m),yAe(r,m,i,o,n)}catch{throw new ae("Async Picking Request Timeout")}finally{u.destroy(),d.destroy()}};GZ.prototype.end=function(e,t=1){let n=e.width??1,i=e.height??1,o=this._context,r=o.readPixels({x:e.x,y:e.y,width:n,height:i,framebuffer:this._fb.framebuffer});return yAe(o,r,n,i,t)};GZ.prototype.readCenterPixel=function(e){let t=e.width??1,n=e.height??1,o=this._context.readPixels({x:e.x,y:e.y,width:t,height:n,framebuffer:this._fb.framebuffer}),r=Math.floor(t*.5),a=4*(Math.floor(n*.5)*t+r);return o.slice(a,a+4)};GZ.prototype.isDestroyed=function(){return!1};GZ.prototype.destroy=function(){return this._fb.destroy(),ue(this)};var _w=GZ;var p$i=x(T(),1);function Xg(){this._numSamples=1,this._colorFramebuffer=new li({depthStencil:!0,supportsDepthTexture:!0}),this._idFramebuffer=new li({depthStencil:!0,supportsDepthTexture:!0}),this._idClearColor=new U(0,0,0,0),this._clearCommand=new ui({color:new U(0,0,0,0),depth:1,owner:this})}function TCt(e){e._colorFramebuffer.destroy(),e._idFramebuffer.destroy()}Object.defineProperties(Xg.prototype,{framebuffer:{get:function(){return this._colorFramebuffer.framebuffer}},idFramebuffer:{get:function(){return this._idFramebuffer.framebuffer}},depthStencilTexture:{get:function(){return this._colorFramebuffer.getDepthStencilTexture()}}});Xg.prototype.update=function(e,t,n,i){let o=t.width,r=t.height,s=n?e.halfFloatingPointTexture?Ue.HALF_FLOAT:Ue.FLOAT:Ue.UNSIGNED_BYTE;this._numSamples=i,this._colorFramebuffer.update(e,o,r,i,s),this._idFramebuffer.update(e,o,r)};Xg.prototype.clear=function(e,t,n){U.clone(n,this._clearCommand.color),U.clone(this._idClearColor,this._clearCommand.color),this._colorFramebuffer.clear(e,this._clearCommand,t),this._idFramebuffer.clear(e,this._clearCommand,t)};Xg.prototype.getFramebuffer=function(){return this._colorFramebuffer.framebuffer};Xg.prototype.getIdFramebuffer=function(){return this._idFramebuffer.framebuffer};Xg.prototype.prepareColorTextures=function(e){this._numSamples>1&&this._colorFramebuffer.prepareTextures(e)};Xg.prototype.isDestroyed=function(){return!1};Xg.prototype.destroy=function(){return TCt(this),ue(this)};var LZ=Xg;var meo=x(T(),1);var x$i=x(T(),1);function rT(){}var _Ct={HAS_CLIPPING_PLANES:!0,ENABLE_CLIPPING_POLYGONS:!0};rT.hasClippingForShadowCast=function(e){let t=e.defines;return l(t)&&t.some(function(n){return _Ct[n]===!0})};rT.getShadowCastShaderKeyword=function(e,t,n,i,o){return`castShadow ${e} ${t} ${n} ${i} ${o}`};rT.createShadowCastVertexShader=function(e,t,n){let i=e.defines.slice(0),o=e.sources.slice(0);i.push("SHADOW_MAP"),n&&i.push("GENERATE_POSITION");let r=Je.findPositionVarying(e),s=l(r);if(t&&!s){let a=o.length;for(let d=0;d<a;++d)o[d]=Je.replaceMain(o[d],"czm_shadow_cast_main");o.push(`out vec3 v_positionEC; void main() { czm_shadow_cast_main(); v_positionEC = (czm_inverseProjection * gl_Position).xyz; -}`)}return new Je({defines:i,sources:o})};VT.createShadowCastFragmentShader=function(e,t,n,i,o){let r=e.defines.slice(0),s=e.sources.slice(0);r.push("SHADOW_MAP");let a=Je.findPositionVarying(e),c=l(a);c||(a="v_positionEC");let d=s.length;for(let m=0;m<d;++m)s[m]=Je.replaceMain(s[m],"czm_shadow_cast_main");let u="";return t&&(c||(u+=`in vec3 v_positionEC; +}`)}return new Je({defines:i,sources:o})};rT.createShadowCastFragmentShader=function(e,t,n,i,o){let r=e.defines.slice(0),s=e.sources.slice(0);r.push("SHADOW_MAP");let a=Je.findPositionVarying(e),c=l(a);c||(a="v_positionEC");let d=s.length;for(let m=0;m<d;++m)s[m]=Je.replaceMain(s[m],"czm_shadow_cast_main");let u="";return t&&(c||(u+=`in vec3 v_positionEC; `),u+=`uniform vec4 shadowMap_lightPositionEC; `),i&&o?u+=`void main() { @@ -10374,7 +10374,7 @@ void main() `:n?u+=` out_FragColor = vec4(1.0); `:u+=` out_FragColor = czm_packDepth(gl_FragCoord.z); `,u+=`} -`,s.push(u),new Je({defines:r,sources:s})};VT.getShadowReceiveShaderKeyword=function(e,t,n,i){let o=e._usesDepthTexture,r=e._polygonOffsetSupported,s=e._isPointLight,a=e._isSpotLight,c=e._numberOfCascades>1,d=e.debugCascadeColors,u=e.softShadows;return`receiveShadow ${o}${r}${s}${a}${c}${d}${u}${t}${n}${i}`};VT.createShadowReceiveVertexShader=function(e,t,n){let i=e.defines.slice(0),o=e.sources.slice(0);return i.push("SHADOW_MAP"),t&&(n?i.push("GENERATE_POSITION_AND_NORMAL"):i.push("GENERATE_POSITION")),new Je({defines:i,sources:o})};VT.createShadowReceiveFragmentShader=function(e,t,n,i,o){let r=Je.findNormalVarying(e),s=!i&&l(r)||i&&o,a=Je.findPositionVarying(e),c=l(a),d=t._usesDepthTexture,u=t._polygonOffsetSupported,m=t._isPointLight,p=t._isSpotLight,b=t._numberOfCascades>1,f=t.debugCascadeColors,y=t.softShadows,_=m?t._pointBias:i?t._terrainBias:t._primitiveBias,S=e.defines.slice(0),Z=e.sources.slice(0),R=Z.length;for(let A=0;A<R;++A)Z[A]=Je.replaceMain(Z[A],"czm_shadow_receive_main");m?S.push("USE_CUBE_MAP_SHADOW"):d&&S.push("USE_SHADOW_DEPTH_TEXTURE"),y&&!m&&S.push("USE_SOFT_SHADOWS"),b&&n&&i&&(s?S.push("ENABLE_VERTEX_LIGHTING"):S.push("ENABLE_DAYNIGHT_SHADING")),n&&_.normalShading&&s&&(S.push("USE_NORMAL_SHADING"),_.normalShadingSmooth>0&&S.push("USE_NORMAL_SHADING_SMOOTH"));let C="";m?C+=`uniform samplerCube shadowMap_textureCube; +`,s.push(u),new Je({defines:r,sources:s})};rT.getShadowReceiveShaderKeyword=function(e,t,n,i){let o=e._usesDepthTexture,r=e._polygonOffsetSupported,s=e._isPointLight,a=e._isSpotLight,c=e._numberOfCascades>1,d=e.debugCascadeColors,u=e.softShadows;return`receiveShadow ${o}${r}${s}${a}${c}${d}${u}${t}${n}${i}`};rT.createShadowReceiveVertexShader=function(e,t,n){let i=e.defines.slice(0),o=e.sources.slice(0);return i.push("SHADOW_MAP"),t&&(n?i.push("GENERATE_POSITION_AND_NORMAL"):i.push("GENERATE_POSITION")),new Je({defines:i,sources:o})};rT.createShadowReceiveFragmentShader=function(e,t,n,i,o){let r=Je.findNormalVarying(e),s=!i&&l(r)||i&&o,a=Je.findPositionVarying(e),c=l(a),d=t._usesDepthTexture,u=t._polygonOffsetSupported,m=t._isPointLight,p=t._isSpotLight,b=t._numberOfCascades>1,f=t.debugCascadeColors,y=t.softShadows,_=m?t._pointBias:i?t._terrainBias:t._primitiveBias,S=e.defines.slice(0),Z=e.sources.slice(0),R=Z.length;for(let A=0;A<R;++A)Z[A]=Je.replaceMain(Z[A],"czm_shadow_receive_main");m?S.push("USE_CUBE_MAP_SHADOW"):d&&S.push("USE_SHADOW_DEPTH_TEXTURE"),y&&!m&&S.push("USE_SOFT_SHADOWS"),b&&n&&i&&(s?S.push("ENABLE_VERTEX_LIGHTING"):S.push("ENABLE_DAYNIGHT_SHADING")),n&&_.normalShading&&s&&(S.push("USE_NORMAL_SHADING"),_.normalShadingSmooth>0&&S.push("USE_NORMAL_SHADING_SMOOTH"));let C="";m?C+=`uniform samplerCube shadowMap_textureCube; `:C+=`uniform sampler2D shadowMap_texture; `;let E;return c?E=` return vec4(${a}, 1.0); `:E=`#ifndef LOG_DEPTH @@ -10485,7 +10485,7 @@ ${f?` // Draw cascade colors for debugging float visibility = czm_shadowVisibility(shadowMap_texture, shadowParameters); `,C+=` out_FragColor.rgb *= visibility; } -`,Z.push(C),new Je({defines:S,sources:Z})};var ep=VT;function P0(e){e=e??B.EMPTY_OBJECT;let t=e.context;this._enabled=e.enabled??!0,this._softShadows=e.softShadows??!1,this._normalOffset=e.normalOffset??!0,this.dirty=!0,this.fromLightSource=e.fromLightSource??!0,this.darkness=e.darkness??.3,this._darkness=this.darkness,this.fadingEnabled=e.fadingEnabled??!0,this.maximumDistance=e.maximumDistance??5e3,this._outOfView=!1,this._outOfViewPrevious=!1,this._needsUpdate=!0;let n=!0;(fn.isEdge()||(fn.isChrome()||fn.isFirefox())&&fn.isWindows()&&!t.depthTexture)&&(n=!1),this._polygonOffsetSupported=n,this._terrainBias={polygonOffset:n,polygonOffsetFactor:1.1,polygonOffsetUnits:4,normalOffset:this._normalOffset,normalOffsetScale:.5,normalShading:!0,normalShadingSmooth:.3,depthBias:1e-4},this._primitiveBias={polygonOffset:n,polygonOffsetFactor:1.1,polygonOffsetUnits:4,normalOffset:this._normalOffset,normalOffsetScale:.1,normalShading:!0,normalShadingSmooth:.05,depthBias:2e-5},this._pointBias={polygonOffset:!1,polygonOffsetFactor:1.1,polygonOffsetUnits:4,normalOffset:this._normalOffset,normalOffsetScale:0,normalShading:!0,normalShadingSmooth:.1,depthBias:5e-4},this._depthAttachment=void 0,this._colorAttachment=void 0,this._shadowMapMatrix=new P,this._shadowMapTexture=void 0,this._lightDirectionEC=new h,this._lightPositionEC=new ce,this._distance=0,this._lightCamera=e.lightCamera,this._shadowMapCamera=new RK,this._shadowMapCullingVolume=void 0,this._sceneCamera=void 0,this._boundingSphere=new me,this._isPointLight=e.isPointLight??!1,this._pointLightRadius=e.pointLightRadius??100,this._cascadesEnabled=this._isPointLight?!1:e.cascadesEnabled??!0,this._numberOfCascades=this._cascadesEnabled?e.numberOfCascades??4:0,this._fitNearFar=!0,this._maximumCascadeDistances=[25,150,700,Number.MAX_VALUE],this._textureSize=new k,this._isSpotLight=!1,this._cascadesEnabled?this._shadowMapCamera.frustum=new ps:l(this._lightCamera.frustum.fov)&&(this._isSpotLight=!0),this._cascadeSplits=[new ce,new ce],this._cascadeMatrices=[new P,new P,new P,new P],this._cascadeDistances=new ce;let i;this._isPointLight?i=6:this._cascadesEnabled?i=this._numberOfCascades:i=1,this._passes=new Array(i);for(let o=0;o<i;++o)this._passes[o]=new n2t(t);this.debugShow=!1,this.debugFreezeFrame=!1,this._debugFreezeFrame=!1,this._debugCascadeColors=!1,this._debugLightFrustum=void 0,this._debugCameraFrustum=void 0,this._debugCascadeFrustums=new Array(this._numberOfCascades),this._debugShadowViewCommand=void 0,this._usesDepthTexture=t.depthTexture,this._isPointLight&&(this._usesDepthTexture=!1),this._primitiveRenderState=void 0,this._terrainRenderState=void 0,this._pointRenderState=void 0,lre(this),this._clearCommand=new ui({depth:1,color:new U}),this._clearPassState=new oc(t),this._size=e.size??2048,this.size=this._size}P0.MAXIMUM_DISTANCE=2e4;function n2t(e){this.camera=new RK,this.passState=new oc(e),this.framebuffer=void 0,this.textureOffsets=void 0,this.commandList=[],this.cullingVolume=void 0}function cre(e,t){return ze.fromCache({cull:{enabled:!0,face:Di.BACK},depthTest:{enabled:!0},colorMask:{red:e,green:e,blue:e,alpha:e},depthMask:!0,polygonOffset:{enabled:t.polygonOffset,factor:t.polygonOffsetFactor,units:t.polygonOffsetUnits}})}function lre(e){let t=!e._usesDepthTexture;e._primitiveRenderState=cre(t,e._primitiveBias),e._terrainRenderState=cre(t,e._terrainBias),e._pointRenderState=cre(t,e._pointBias)}P0.prototype.debugCreateRenderStates=function(){lre(this)};Object.defineProperties(P0.prototype,{enabled:{get:function(){return this._enabled},set:function(e){this.dirty=this._enabled!==e,this._enabled=e}},normalOffset:{get:function(){return this._normalOffset},set:function(e){this.dirty=this._normalOffset!==e,this._normalOffset=e,this._terrainBias.normalOffset=e,this._primitiveBias.normalOffset=e,this._pointBias.normalOffset=e}},softShadows:{get:function(){return this._softShadows},set:function(e){this.dirty=this._softShadows!==e,this._softShadows=e}},size:{get:function(){return this._size},set:function(e){c2t(this,e)}},outOfView:{get:function(){return this._outOfView}},shadowMapCullingVolume:{get:function(){return this._shadowMapCullingVolume}},passes:{get:function(){return this._passes}},isPointLight:{get:function(){return this._isPointLight}},debugCascadeColors:{get:function(){return this._debugCascadeColors},set:function(e){this.dirty=this._debugCascadeColors!==e,this._debugCascadeColors=e}}});function dre(e){let t=e._passes.length;for(let n=0;n<t;++n){let i=e._passes[n],o=i.framebuffer;l(o)&&!o.isDestroyed()&&o.destroy(),i.framebuffer=void 0}e._depthAttachment=e._depthAttachment&&e._depthAttachment.destroy(),e._colorAttachment=e._colorAttachment&&e._colorAttachment.destroy()}function i2t(e,t){let n=new _u({context:t,width:e._textureSize.x,height:e._textureSize.y,format:Ml.DEPTH_COMPONENT16}),i=new vt({context:t,width:e._textureSize.x,height:e._textureSize.y,pixelFormat:Qe.RGBA,pixelDatatype:Ue.UNSIGNED_BYTE,sampler:Ot.NEAREST}),o=new fs({context:t,depthRenderbuffer:n,colorTextures:[i],destroyAttachments:!1}),r=e._passes.length;for(let s=0;s<r;++s){let a=e._passes[s];a.framebuffer=o,a.passState.framebuffer=o}e._shadowMapTexture=i,e._depthAttachment=n,e._colorAttachment=i}function o2t(e,t){let n=new vt({context:t,width:e._textureSize.x,height:e._textureSize.y,pixelFormat:Qe.DEPTH_STENCIL,pixelDatatype:Ue.UNSIGNED_INT_24_8,sampler:Ot.NEAREST}),i=new fs({context:t,depthStencilTexture:n,destroyAttachments:!1}),o=e._passes.length;for(let r=0;r<o;++r){let s=e._passes[r];s.framebuffer=i,s.passState.framebuffer=i}e._shadowMapTexture=n,e._depthAttachment=n}function r2t(e,t){let n=new _u({context:t,width:e._textureSize.x,height:e._textureSize.y,format:Ml.DEPTH_COMPONENT16}),i=new es({context:t,width:e._textureSize.x,height:e._textureSize.y,pixelFormat:Qe.RGBA,pixelDatatype:Ue.UNSIGNED_BYTE,sampler:Ot.NEAREST}),o=[i.negativeX,i.negativeY,i.negativeZ,i.positiveX,i.positiveY,i.positiveZ];for(let r=0;r<6;++r){let s=new fs({context:t,depthRenderbuffer:n,colorTextures:[o[r]],destroyAttachments:!1}),a=e._passes[r];a.framebuffer=s,a.passState.framebuffer=s}e._shadowMapTexture=i,e._depthAttachment=n,e._colorAttachment=i}function fFe(e,t){e._isPointLight?r2t(e,t):e._usesDepthTexture?o2t(e,t):i2t(e,t)}function s2t(e,t){e._usesDepthTexture&&e._passes[0].framebuffer.status!==ie.FRAMEBUFFER_COMPLETE&&(e._usesDepthTexture=!1,lre(e),dre(e),fFe(e,t))}function a2t(e,t){(!l(e._passes[0].framebuffer)||e._shadowMapTexture.width!==e._textureSize.x)&&(dre(e),fFe(e,t),s2t(e,t),pFe(e,t))}function pFe(e,t,n){n=n??0,(e._isPointLight||n===0)&&(e._clearCommand.framebuffer=e._passes[n].framebuffer,e._clearCommand.execute(t,e._clearPassState))}function c2t(e,t){e._size=t;let n=e._passes,i=n.length,o=e._textureSize;if(e._isPointLight){t=wt.maximumCubeMapSize>=t?t:wt.maximumCubeMapSize,o.x=t,o.y=t;let r=new nt(0,0,t,t);n[0].passState.viewport=r,n[1].passState.viewport=r,n[2].passState.viewport=r,n[3].passState.viewport=r,n[4].passState.viewport=r,n[5].passState.viewport=r}else i===1?(t=wt.maximumTextureSize>=t?t:wt.maximumTextureSize,o.x=t,o.y=t,n[0].passState.viewport=new nt(0,0,t,t)):i===4&&(t=wt.maximumTextureSize>=t*2?t:wt.maximumTextureSize/2,o.x=t*2,o.y=t*2,n[0].passState.viewport=new nt(0,0,t,t),n[1].passState.viewport=new nt(t,0,t,t),n[2].passState.viewport=new nt(0,t,t,t),n[3].passState.viewport=new nt(t,t,t,t));e._clearPassState.viewport=new nt(0,0,o.x,o.y);for(let r=0;r<i;++r){let s=n[r],a=s.passState.viewport,c=a.x/o.x,d=a.y/o.y,u=a.width/o.x,m=a.height/o.y;s.textureOffsets=new P(u,0,0,c,0,m,0,d,0,0,1,0,0,0,0,1)}}var l2t=new nt;function d2t(e,t){let n;e._isPointLight?n=`uniform samplerCube shadowMap_textureCube; +`,Z.push(C),new Je({defines:S,sources:Z})};var Df=rT;function _0(e){e=e??B.EMPTY_OBJECT;let t=e.context;this._enabled=e.enabled??!0,this._softShadows=e.softShadows??!1,this._normalOffset=e.normalOffset??!0,this.dirty=!0,this.fromLightSource=e.fromLightSource??!0,this.darkness=e.darkness??.3,this._darkness=this.darkness,this.fadingEnabled=e.fadingEnabled??!0,this.maximumDistance=e.maximumDistance??5e3,this._outOfView=!1,this._outOfViewPrevious=!1,this._needsUpdate=!0;let n=!0;(fn.isEdge()||(fn.isChrome()||fn.isFirefox())&&fn.isWindows()&&!t.depthTexture)&&(n=!1),this._polygonOffsetSupported=n,this._terrainBias={polygonOffset:n,polygonOffsetFactor:1.1,polygonOffsetUnits:4,normalOffset:this._normalOffset,normalOffsetScale:.5,normalShading:!0,normalShadingSmooth:.3,depthBias:1e-4},this._primitiveBias={polygonOffset:n,polygonOffsetFactor:1.1,polygonOffsetUnits:4,normalOffset:this._normalOffset,normalOffsetScale:.1,normalShading:!0,normalShadingSmooth:.05,depthBias:2e-5},this._pointBias={polygonOffset:!1,polygonOffsetFactor:1.1,polygonOffsetUnits:4,normalOffset:this._normalOffset,normalOffsetScale:0,normalShading:!0,normalShadingSmooth:.1,depthBias:5e-4},this._depthAttachment=void 0,this._colorAttachment=void 0,this._shadowMapMatrix=new P,this._shadowMapTexture=void 0,this._lightDirectionEC=new h,this._lightPositionEC=new ce,this._distance=0,this._lightCamera=e.lightCamera,this._shadowMapCamera=new _z,this._shadowMapCullingVolume=void 0,this._sceneCamera=void 0,this._boundingSphere=new me,this._isPointLight=e.isPointLight??!1,this._pointLightRadius=e.pointLightRadius??100,this._cascadesEnabled=this._isPointLight?!1:e.cascadesEnabled??!0,this._numberOfCascades=this._cascadesEnabled?e.numberOfCascades??4:0,this._fitNearFar=!0,this._maximumCascadeDistances=[25,150,700,Number.MAX_VALUE],this._textureSize=new k,this._isSpotLight=!1,this._cascadesEnabled?this._shadowMapCamera.frustum=new ps:l(this._lightCamera.frustum.fov)&&(this._isSpotLight=!0),this._cascadeSplits=[new ce,new ce],this._cascadeMatrices=[new P,new P,new P,new P],this._cascadeDistances=new ce;let i;this._isPointLight?i=6:this._cascadesEnabled?i=this._numberOfCascades:i=1,this._passes=new Array(i);for(let o=0;o<i;++o)this._passes[o]=new SCt(t);this.debugShow=!1,this.debugFreezeFrame=!1,this._debugFreezeFrame=!1,this._debugCascadeColors=!1,this._debugLightFrustum=void 0,this._debugCameraFrustum=void 0,this._debugCascadeFrustums=new Array(this._numberOfCascades),this._debugShadowViewCommand=void 0,this._usesDepthTexture=t.depthTexture,this._isPointLight&&(this._usesDepthTexture=!1),this._primitiveRenderState=void 0,this._terrainRenderState=void 0,this._pointRenderState=void 0,Bte(this),this._clearCommand=new ui({depth:1,color:new U}),this._clearPassState=new oc(t),this._size=e.size??2048,this.size=this._size}_0.MAXIMUM_DISTANCE=2e4;function SCt(e){this.camera=new _z,this.passState=new oc(e),this.framebuffer=void 0,this.textureOffsets=void 0,this.commandList=[],this.cullingVolume=void 0}function Ote(e,t){return ze.fromCache({cull:{enabled:!0,face:Ui.BACK},depthTest:{enabled:!0},colorMask:{red:e,green:e,blue:e,alpha:e},depthMask:!0,polygonOffset:{enabled:t.polygonOffset,factor:t.polygonOffsetFactor,units:t.polygonOffsetUnits}})}function Bte(e){let t=!e._usesDepthTexture;e._primitiveRenderState=Ote(t,e._primitiveBias),e._terrainRenderState=Ote(t,e._terrainBias),e._pointRenderState=Ote(t,e._pointBias)}_0.prototype.debugCreateRenderStates=function(){Bte(this)};Object.defineProperties(_0.prototype,{enabled:{get:function(){return this._enabled},set:function(e){this.dirty=this._enabled!==e,this._enabled=e}},normalOffset:{get:function(){return this._normalOffset},set:function(e){this.dirty=this._normalOffset!==e,this._normalOffset=e,this._terrainBias.normalOffset=e,this._primitiveBias.normalOffset=e,this._pointBias.normalOffset=e}},softShadows:{get:function(){return this._softShadows},set:function(e){this.dirty=this._softShadows!==e,this._softShadows=e}},size:{get:function(){return this._size},set:function(e){ACt(this,e)}},outOfView:{get:function(){return this._outOfView}},shadowMapCullingVolume:{get:function(){return this._shadowMapCullingVolume}},passes:{get:function(){return this._passes}},isPointLight:{get:function(){return this._isPointLight}},debugCascadeColors:{get:function(){return this._debugCascadeColors},set:function(e){this.dirty=this._debugCascadeColors!==e,this._debugCascadeColors=e}}});function zte(e){let t=e._passes.length;for(let n=0;n<t;++n){let i=e._passes[n],o=i.framebuffer;l(o)&&!o.isDestroyed()&&o.destroy(),i.framebuffer=void 0}e._depthAttachment=e._depthAttachment&&e._depthAttachment.destroy(),e._colorAttachment=e._colorAttachment&&e._colorAttachment.destroy()}function ZCt(e,t){let n=new _u({context:t,width:e._textureSize.x,height:e._textureSize.y,format:Ml.DEPTH_COMPONENT16}),i=new vt({context:t,width:e._textureSize.x,height:e._textureSize.y,pixelFormat:Qe.RGBA,pixelDatatype:Ue.UNSIGNED_BYTE,sampler:Ot.NEAREST}),o=new fs({context:t,depthRenderbuffer:n,colorTextures:[i],destroyAttachments:!1}),r=e._passes.length;for(let s=0;s<r;++s){let a=e._passes[s];a.framebuffer=o,a.passState.framebuffer=o}e._shadowMapTexture=i,e._depthAttachment=n,e._colorAttachment=i}function RCt(e,t){let n=new vt({context:t,width:e._textureSize.x,height:e._textureSize.y,pixelFormat:Qe.DEPTH_STENCIL,pixelDatatype:Ue.UNSIGNED_INT_24_8,sampler:Ot.NEAREST}),i=new fs({context:t,depthStencilTexture:n,destroyAttachments:!1}),o=e._passes.length;for(let r=0;r<o;++r){let s=e._passes[r];s.framebuffer=i,s.passState.framebuffer=i}e._shadowMapTexture=n,e._depthAttachment=n}function CCt(e,t){let n=new _u({context:t,width:e._textureSize.x,height:e._textureSize.y,format:Ml.DEPTH_COMPONENT16}),i=new es({context:t,width:e._textureSize.x,height:e._textureSize.y,pixelFormat:Qe.RGBA,pixelDatatype:Ue.UNSIGNED_BYTE,sampler:Ot.NEAREST}),o=[i.negativeX,i.negativeY,i.negativeZ,i.positiveX,i.positiveY,i.positiveZ];for(let r=0;r<6;++r){let s=new fs({context:t,depthRenderbuffer:n,colorTextures:[o[r]],destroyAttachments:!1}),a=e._passes[r];a.framebuffer=s,a.passState.framebuffer=s}e._shadowMapTexture=i,e._depthAttachment=n,e._colorAttachment=i}function _Ae(e,t){e._isPointLight?CCt(e,t):e._usesDepthTexture?RCt(e,t):ZCt(e,t)}function VCt(e,t){e._usesDepthTexture&&e._passes[0].framebuffer.status!==ie.FRAMEBUFFER_COMPLETE&&(e._usesDepthTexture=!1,Bte(e),zte(e),_Ae(e,t))}function ECt(e,t){(!l(e._passes[0].framebuffer)||e._shadowMapTexture.width!==e._textureSize.x)&&(zte(e),_Ae(e,t),VCt(e,t),SAe(e,t))}function SAe(e,t,n){n=n??0,(e._isPointLight||n===0)&&(e._clearCommand.framebuffer=e._passes[n].framebuffer,e._clearCommand.execute(t,e._clearPassState))}function ACt(e,t){e._size=t;let n=e._passes,i=n.length,o=e._textureSize;if(e._isPointLight){t=wt.maximumCubeMapSize>=t?t:wt.maximumCubeMapSize,o.x=t,o.y=t;let r=new nt(0,0,t,t);n[0].passState.viewport=r,n[1].passState.viewport=r,n[2].passState.viewport=r,n[3].passState.viewport=r,n[4].passState.viewport=r,n[5].passState.viewport=r}else i===1?(t=wt.maximumTextureSize>=t?t:wt.maximumTextureSize,o.x=t,o.y=t,n[0].passState.viewport=new nt(0,0,t,t)):i===4&&(t=wt.maximumTextureSize>=t*2?t:wt.maximumTextureSize/2,o.x=t*2,o.y=t*2,n[0].passState.viewport=new nt(0,0,t,t),n[1].passState.viewport=new nt(t,0,t,t),n[2].passState.viewport=new nt(0,t,t,t),n[3].passState.viewport=new nt(t,t,t,t));e._clearPassState.viewport=new nt(0,0,o.x,o.y);for(let r=0;r<i;++r){let s=n[r],a=s.passState.viewport,c=a.x/o.x,d=a.y/o.y,u=a.width/o.x,m=a.height/o.y;s.textureOffsets=new P(u,0,0,c,0,m,0,d,0,0,1,0,0,0,0,1)}}var GCt=new nt;function LCt(e,t){let n;e._isPointLight?n=`uniform samplerCube shadowMap_textureCube; in vec2 v_textureCoordinates; void main() { @@ -10546,7 +10546,7 @@ ${e._usesDepthTexture?` float shadow = texture(shadowMap_texture, v_textureCo `:` float shadow = czm_unpackDepth(texture(shadowMap_texture, v_textureCoordinates)); `} out_FragColor = vec4(vec3(shadow), 1.0); } -`;let i=t.createViewportQuadCommand(n,{uniformMap:{shadowMap_texture:function(){return e._shadowMapTexture},shadowMap_textureCube:function(){return e._shadowMapTexture}}});return i.pass=Le.OVERLAY,i}function u2t(e,t){let n=t.context,i=t.context.drawingBufferWidth,o=t.context.drawingBufferHeight,r=Math.min(i,o)*.3,s=l2t;s.x=i-r,s.y=0,s.width=r,s.height=r;let a=e._debugShadowViewCommand;l(a)||(a=d2t(e,n),e._debugShadowViewCommand=a),(!l(a.renderState)||!nt.equals(a.renderState.viewport,s))&&(a.renderState=ze.fromCache({viewport:nt.clone(s)})),t.commandList.push(e._debugShadowViewCommand)}var X0=new Array(8);X0[0]=new ce(-1,-1,-1,1);X0[1]=new ce(1,-1,-1,1);X0[2]=new ce(1,1,-1,1);X0[3]=new ce(-1,1,-1,1);X0[4]=new ce(-1,-1,1,1);X0[5]=new ce(1,-1,1,1);X0[6]=new ce(1,1,1,1);X0[7]=new ce(-1,1,1,1);var ET=new P,ure=new Array(8);for(let e=0;e<8;++e)ure[e]=new ce;function m2t(e,t){let n=new Yt({geometry:new Bh({minimum:new h(-.5,-.5,-.5),maximum:new h(.5,.5,.5)}),attributes:{color:$t.fromColor(t)}}),i=new Yt({geometry:new fg({radius:.5}),attributes:{color:$t.fromColor(t)}});return new In({geometryInstances:[n,i],appearance:new Tn({translucent:!1,flat:!0}),asynchronous:!1,modelMatrix:e})}var h2t=[U.RED,U.GREEN,U.BLUE,U.MAGENTA],f2t=new h;function p2t(e,t){u2t(e,t);let n=e.debugFreezeFrame&&!e._debugFreezeFrame;if(e._debugFreezeFrame=e.debugFreezeFrame,e.debugFreezeFrame&&(n&&(e._debugCameraFrustum=e._debugCameraFrustum&&e._debugCameraFrustum.destroy(),e._debugCameraFrustum=new v0({camera:e._sceneCamera,color:U.CYAN,updateOnChange:!1})),e._debugCameraFrustum.update(t)),e._cascadesEnabled){if(e.debugFreezeFrame){n&&(e._debugLightFrustum=e._debugLightFrustum&&e._debugLightFrustum.destroy(),e._debugLightFrustum=new v0({camera:e._shadowMapCamera,color:U.YELLOW,updateOnChange:!1})),e._debugLightFrustum.update(t);for(let i=0;i<e._numberOfCascades;++i)n&&(e._debugCascadeFrustums[i]=e._debugCascadeFrustums[i]&&e._debugCascadeFrustums[i].destroy(),e._debugCascadeFrustums[i]=new v0({camera:e._passes[i].camera,color:h2t[i],updateOnChange:!1})),e._debugCascadeFrustums[i].update(t)}}else if(e._isPointLight){if(!l(e._debugLightFrustum)||e._needsUpdate){let i=e._shadowMapCamera.positionWC,o=Ne.IDENTITY,r=e._pointLightRadius*2,s=h.fromElements(r,r,r,f2t),a=P.fromTranslationQuaternionRotationScale(i,o,s,ET);e._debugLightFrustum=e._debugLightFrustum&&e._debugLightFrustum.destroy(),e._debugLightFrustum=m2t(a,U.YELLOW)}e._debugLightFrustum.update(t)}else(!l(e._debugLightFrustum)||e._needsUpdate)&&(e._debugLightFrustum=new v0({camera:e._shadowMapCamera,color:U.YELLOW,updateOnChange:!1})),e._debugLightFrustum.update(t)}function RK(){this.viewMatrix=new P,this.inverseViewMatrix=new P,this.frustum=void 0,this.positionCartographic=new pe,this.positionWC=new h,this.directionWC=h.clone(h.UNIT_Z),this.upWC=h.clone(h.UNIT_Y),this.rightWC=h.clone(h.UNIT_X),this.viewProjectionMatrix=new P}RK.prototype.clone=function(e){P.clone(e.viewMatrix,this.viewMatrix),P.clone(e.inverseViewMatrix,this.inverseViewMatrix),this.frustum=e.frustum.clone(this.frustum),pe.clone(e.positionCartographic,this.positionCartographic),h.clone(e.positionWC,this.positionWC),h.clone(e.directionWC,this.directionWC),h.clone(e.upWC,this.upWC),h.clone(e.rightWC,this.rightWC)};var b2t=new P(.5,0,0,.5,0,.5,0,.5,0,0,.5,.5,0,0,0,1);RK.prototype.getViewProjection=function(){let e=this.viewMatrix,t=this.frustum.projectionMatrix;return P.multiply(t,e,this.viewProjectionMatrix),P.multiply(b2t,this.viewProjectionMatrix,this.viewProjectionMatrix),this.viewProjectionMatrix};var g2t=new Array(5),y2t=new qi,x2t=new Array(4),bFe=new h,gFe=new h;function T2t(e,t){let n=e._shadowMapCamera,i=e._sceneCamera,o=i.frustum.near,r=i.frustum.far,s=e._numberOfCascades,a,c=r-o,d=r/o,u=.9,m=!1;t.shadowState.closestObjectSize<200&&(m=!0,u=.9);let p=x2t,b=g2t;for(b[0]=o,b[s]=r,a=0;a<s;++a){let N=(a+1)/s,g=o*Math.pow(d,N),V=o+c*N,G=W.lerp(V,g,u);b[a+1]=G,p[a]=G-b[a]}if(m){for(a=0;a<s;++a)p[a]=Math.min(p[a],e._maximumCascadeDistances[a]);let N=b[0];for(a=0;a<s-1;++a)N+=p[a],b[a+1]=N}ce.unpack(b,0,e._cascadeSplits[0]),ce.unpack(b,1,e._cascadeSplits[1]),ce.unpack(p,0,e._cascadeDistances);let f=n.frustum,y=f.left,_=f.right,S=f.bottom,Z=f.top,R=f.near,C=f.far,E=n.positionWC,A=n.directionWC,L=n.upWC,F=i.frustum.clone(y2t),I=n.getViewProjection();for(a=0;a<s;++a){F.near=b[a],F.far=b[a+1];let N=P.multiply(F.projectionMatrix,i.viewMatrix,ET),g=P.inverse(N,ET),V=P.multiply(I,g,ET),G=h.fromElements(Number.MAX_VALUE,Number.MAX_VALUE,Number.MAX_VALUE,bFe),v=h.fromElements(-Number.MAX_VALUE,-Number.MAX_VALUE,-Number.MAX_VALUE,gFe);for(let O=0;O<8;++O){let w=ce.clone(X0[O],ure[O]);P.multiplyByVector(V,w,w),h.divideByScalar(w,w.w,w),h.minimumByComponent(w,G,G),h.maximumByComponent(w,v,v)}G.x=Math.max(G.x,0),G.y=Math.max(G.y,0),G.z=0,v.x=Math.min(v.x,1),v.y=Math.min(v.y,1),v.z=Math.min(v.z,1);let X=e._passes[a],Y=X.camera;Y.clone(n);let D=Y.frustum;D.left=y+G.x*(_-y),D.right=y+v.x*(_-y),D.bottom=S+G.y*(Z-S),D.top=S+v.y*(Z-S),D.near=R+G.z*(C-R),D.far=R+v.z*(C-R),X.cullingVolume=Y.frustum.computeCullingVolume(E,A,L);let M=e._cascadeMatrices[a];P.multiply(Y.getViewProjection(),i.inverseViewMatrix,M),P.multiply(X.textureOffsets,M,M)}}var _2t=new P,S2t=new h,Z2t=new h,mFe=new h;function R2t(e,t){let n=e._shadowMapCamera,i=e._sceneCamera,o=P.multiply(i.frustum.projectionMatrix,i.viewMatrix,ET),r=P.inverse(o,ET),s=n.directionWC,a=i.directionWC;h.equalsEpsilon(s,a,W.EPSILON10)&&(a=i.upWC);let c=h.cross(s,a,S2t);a=h.cross(c,s,Z2t),h.normalize(a,a),h.normalize(c,c);let d=h.fromElements(0,0,0,mFe),u=P.computeView(d,s,a,c,_2t),m=P.multiply(u,r,ET),p=h.fromElements(Number.MAX_VALUE,Number.MAX_VALUE,Number.MAX_VALUE,bFe),b=h.fromElements(-Number.MAX_VALUE,-Number.MAX_VALUE,-Number.MAX_VALUE,gFe);for(let C=0;C<8;++C){let E=ce.clone(X0[C],ure[C]);P.multiplyByVector(m,E,E),h.divideByScalar(E,E.w,E),h.minimumByComponent(E,p,p),h.maximumByComponent(E,b,b)}b.z+=1e3,p.z-=10;let f=mFe;f.x=-(.5*(p.x+b.x)),f.y=-(.5*(p.y+b.y)),f.z=-b.z;let y=P.fromTranslation(f,ET);u=P.multiply(y,u,u);let _=.5*(b.x-p.x),S=.5*(b.y-p.y),Z=b.z-p.z,R=n.frustum;R.left=-_,R.right=_,R.bottom=-S,R.top=S,R.near=.01,R.far=Z,P.clone(u,n.viewMatrix),P.inverse(u,n.inverseViewMatrix),P.getTranslation(n.inverseViewMatrix,n.positionWC),t.mapProjection.ellipsoid.cartesianToCartographic(n.positionWC,n.positionCartographic),h.clone(s,n.directionWC),h.clone(a,n.upWC),h.clone(c,n.rightWC)}var C2t=[new h(-1,0,0),new h(0,-1,0),new h(0,0,-1),new h(1,0,0),new h(0,1,0),new h(0,0,1)],V2t=[new h(0,-1,0),new h(0,0,-1),new h(0,-1,0),new h(0,-1,0),new h(0,0,1),new h(0,-1,0)],E2t=[new h(0,0,1),new h(1,0,0),new h(-1,0,0),new h(0,0,-1),new h(1,0,0),new h(1,0,0)];function A2t(e,t){let n=new qi;n.fov=W.PI_OVER_TWO,n.near=1,n.far=e._pointLightRadius,n.aspectRatio=1;for(let i=0;i<6;++i){let o=e._passes[i].camera;o.positionWC=e._shadowMapCamera.positionWC,o.positionCartographic=t.mapProjection.ellipsoid.cartesianToCartographic(o.positionWC,o.positionCartographic),o.directionWC=C2t[i],o.upWC=V2t[i],o.rightWC=E2t[i],P.computeView(o.positionWC,o.directionWC,o.upWC,o.rightWC,o.viewMatrix),P.inverse(o.viewMatrix,o.inverseViewMatrix),o.frustum=n}}var G2t=new h,L2t=new h,yFe=new me,hFe=yFe.center;function W2t(e,t){let n=e._sceneCamera,i=e._shadowMapCamera,o=yFe;if(e._cascadesEnabled){if(n.frustum.near>=e.maximumDistance){e._outOfView=!0,e._needsUpdate=!1;return}let r=t.mapProjection.ellipsoid.geodeticSurfaceNormal(n.positionWC,G2t),s=h.negate(i.directionWC,L2t),a=h.dot(r,s);if(e.fadingEnabled){let c=W.clamp(a/.1,0,1);e._darkness=W.lerp(1,e.darkness,c)}else e._darkness=e.darkness;if(a<0){e._outOfView=!0,e._needsUpdate=!1;return}e._needsUpdate=!0,e._outOfView=!1}else if(e._isPointLight)o.center=i.positionWC,o.radius=e._pointLightRadius,e._outOfView=t.cullingVolume.computeVisibility(o)===qt.OUTSIDE,e._needsUpdate=!e._outOfView&&!e._boundingSphere.equals(o),me.clone(o,e._boundingSphere);else{let r=i.frustum.far/2,s=h.add(i.positionWC,h.multiplyByScalar(i.directionWC,r,hFe),hFe);o.center=s,o.radius=r,e._outOfView=t.cullingVolume.computeVisibility(o)===qt.OUTSIDE,e._needsUpdate=!e._outOfView&&!e._boundingSphere.equals(o),me.clone(o,e._boundingSphere)}}function v2t(e,t){let n=t.camera,i=e._lightCamera,o=e._sceneCamera,r=e._shadowMapCamera;e._cascadesEnabled?h.clone(i.directionWC,r.directionWC):e._isPointLight?h.clone(i.positionWC,r.positionWC):r.clone(i);let s=e._lightDirectionEC;P.multiplyByPointAsVector(n.viewMatrix,r.directionWC,s),h.normalize(s,s),h.negate(s,s),P.multiplyByPoint(n.viewMatrix,r.positionWC,e._lightPositionEC),e._lightPositionEC.w=e._pointLightRadius;let a,c;e._fitNearFar?(a=Math.min(t.shadowState.nearPlane,e.maximumDistance),c=Math.min(t.shadowState.farPlane,e.maximumDistance),c=Math.max(c,a+1)):(a=n.frustum.near,c=e.maximumDistance),e._sceneCamera=Io.clone(n,o),n.frustum.clone(e._sceneCamera.frustum),e._sceneCamera.frustum.near=a,e._sceneCamera.frustum.far=c,e._distance=c-a,W2t(e,t),!e._outOfViewPrevious&&e._outOfView&&(e._needsUpdate=!0),e._outOfViewPrevious=e._outOfView}P0.prototype.update=function(e){if(v2t(this,e),this._needsUpdate)if(a2t(this,e.context),this._isPointLight&&A2t(this,e),this._cascadesEnabled&&(R2t(this,e),this._numberOfCascades>1&&T2t(this,e)),this._isPointLight)this._shadowMapCullingVolume=$s.fromBoundingSphere(this._boundingSphere);else{let t=this._shadowMapCamera,n=t.positionWC,i=t.directionWC,o=t.upWC;this._shadowMapCullingVolume=t.frustum.computeCullingVolume(n,i,o),this._passes.length===1&&this._passes[0].camera.clone(t)}if(this._passes.length===1){let t=this._sceneCamera.inverseViewMatrix;P.multiply(this._shadowMapCamera.getViewProjection(),t,this._shadowMapMatrix)}this.debugShow&&p2t(this,e)};P0.prototype.updatePass=function(e,t){pFe(this,e,t)};var F2t=new k;function xFe(e,t,n){let i=e._isPointLight?e._pointBias:n?e._terrainBias:e._primitiveBias,o={shadowMap_texture:function(){return e._shadowMapTexture},shadowMap_textureCube:function(){return e._shadowMapTexture},shadowMap_matrix:function(){return e._shadowMapMatrix},shadowMap_cascadeSplits:function(){return e._cascadeSplits},shadowMap_cascadeMatrices:function(){return e._cascadeMatrices},shadowMap_lightDirectionEC:function(){return e._lightDirectionEC},shadowMap_lightPositionEC:function(){return e._lightPositionEC},shadowMap_cascadeDistances:function(){return e._cascadeDistances},shadowMap_texelSizeDepthBiasAndNormalShadingSmooth:function(){let r=F2t;return r.x=1/e._textureSize.x,r.y=1/e._textureSize.y,ce.fromElements(r.x,r.y,i.depthBias,i.normalShadingSmooth,this.combinedUniforms1)},shadowMap_normalOffsetScaleDistanceMaxDistanceAndDarkness:function(){return ce.fromElements(i.normalOffsetScale,e._distance,e.maximumDistance,e._darkness,this.combinedUniforms2)},combinedUniforms1:new ce,combinedUniforms2:new ce};return It(t,o,!1)}function I2t(e,t,n,i,o,r){let s,a,c;if(l(r)&&(s=r.shaderProgram,a=r.renderState,c=r.uniformMap),r=lt.shallowClone(n,r),r.castShadows=!0,r.receiveShadows=!1,!l(s)||o!==n.shaderProgram.id||t){let d=n.shaderProgram,u=n.pass===Le.GLOBE,m=n.pass!==Le.TRANSLUCENT,p=e._isPointLight,b=e._usesDepthTexture,f=d.vertexShaderSource,y=d.fragmentShaderSource,_=m&&ep.hasClippingForShadowCast(y),S=ep.getShadowCastShaderKeyword(p,u,b,m,_);if(s=i.shaderCache.getDerivedShaderProgram(d,S),!l(s)){let R=ep.createShadowCastVertexShader(f,p,u),C=ep.createShadowCastFragmentShader(y,p,b,m,_);s=i.shaderCache.createDerivedShaderProgram(d,S,{vertexShaderSource:R,fragmentShaderSource:C,attributeLocations:d._attributeLocations})}a=e._primitiveRenderState,p?a=e._pointRenderState:u&&(a=e._terrainRenderState),n.renderState.cull.enabled||(a=$e(a,!1),a.cull=$e(a.cull,!1),a.cull.enabled=!1,a=ze.fromCache(a)),c=xFe(e,n.uniformMap,u)}return r.shaderProgram=s,r.renderState=a,r.uniformMap=c,r}P0.createReceiveDerivedCommand=function(e,t,n,i,o){l(o)||(o={});let r=e.length>0,s=t.shaderProgram,a=s.vertexShaderSource,c=s.fragmentShaderSource,d=t.pass===Le.GLOBE,u=!1;if(d&&(u=t.owner.data.renderedMesh.encoding.hasVertexNormals),t.receiveShadows&&r){let m,p;l(o.receiveCommand)&&(m=o.receiveCommand.shaderProgram,p=o.receiveCommand.uniformMap),o.receiveCommand=lt.shallowClone(t,o.receiveCommand),o.castShadows=!1,o.receiveShadows=!0;let b=o.receiveShaderCastShadows!==t.castShadows,f=o.receiveShaderProgramId!==t.shaderProgram.id;if(!l(m)||f||n||b){let y=ep.getShadowReceiveShaderKeyword(e[0],t.castShadows,d,u);if(m=i.shaderCache.getDerivedShaderProgram(s,y),!l(m)){let _=ep.createShadowReceiveVertexShader(a,d,u),S=ep.createShadowReceiveFragmentShader(c,e[0],t.castShadows,d,u);m=i.shaderCache.createDerivedShaderProgram(s,y,{vertexShaderSource:_,fragmentShaderSource:S,attributeLocations:s._attributeLocations})}p=xFe(e[0],t.uniformMap,d)}o.receiveCommand.shaderProgram=m,o.receiveCommand.uniformMap=p,o.receiveShaderProgramId=t.shaderProgram.id,o.receiveShaderCastShadows=t.castShadows}return o};P0.createCastDerivedCommand=function(e,t,n,i,o){if(l(o)||(o={}),t.castShadows){let r=o.castCommands;l(r)||(r=o.castCommands=[]);let s=o.castShaderProgramId,a=e.length;r.length=a;for(let c=0;c<a;++c)r[c]=I2t(e[c],n,t,i,s,r[c]);o.castShaderProgramId=t.shaderProgram.id}return o};P0.prototype.isDestroyed=function(){return!1};P0.prototype.destroy=function(){dre(this),this._debugLightFrustum=this._debugLightFrustum&&this._debugLightFrustum.destroy(),this._debugCameraFrustum=this._debugCameraFrustum&&this._debugCameraFrustum.destroy(),this._debugShadowViewCommand=this._debugShadowViewCommand&&this._debugShadowViewCommand.shaderProgram&&this._debugShadowViewCommand.shaderProgram.destroy();for(let e=0;e<this._numberOfCascades;++e)this._debugCascadeFrustums[e]=this._debugCascadeFrustums[e]&&this._debugCascadeFrustums[e].destroy();return ue(this)};var ty=P0;var Apo=x(T(),1);var apo=x(T(),1),oR=`uniform sampler2D colorTexture; +`;let i=t.createViewportQuadCommand(n,{uniformMap:{shadowMap_texture:function(){return e._shadowMapTexture},shadowMap_textureCube:function(){return e._shadowMapTexture}}});return i.pass=Le.OVERLAY,i}function WCt(e,t){let n=t.context,i=t.context.drawingBufferWidth,o=t.context.drawingBufferHeight,r=Math.min(i,o)*.3,s=GCt;s.x=i-r,s.y=0,s.width=r,s.height=r;let a=e._debugShadowViewCommand;l(a)||(a=LCt(e,n),e._debugShadowViewCommand=a),(!l(a.renderState)||!nt.equals(a.renderState.viewport,s))&&(a.renderState=ze.fromCache({viewport:nt.clone(s)})),t.commandList.push(e._debugShadowViewCommand)}var S0=new Array(8);S0[0]=new ce(-1,-1,-1,1);S0[1]=new ce(1,-1,-1,1);S0[2]=new ce(1,1,-1,1);S0[3]=new ce(-1,1,-1,1);S0[4]=new ce(-1,-1,1,1);S0[5]=new ce(1,-1,1,1);S0[6]=new ce(1,1,1,1);S0[7]=new ce(-1,1,1,1);var sT=new P,Hte=new Array(8);for(let e=0;e<8;++e)Hte[e]=new ce;function vCt(e,t){let n=new Yt({geometry:new tf({minimum:new h(-.5,-.5,-.5),maximum:new h(.5,.5,.5)}),attributes:{color:$t.fromColor(t)}}),i=new Yt({geometry:new Sg({radius:.5}),attributes:{color:$t.fromColor(t)}});return new In({geometryInstances:[n,i],appearance:new Tn({translucent:!1,flat:!0}),asynchronous:!1,modelMatrix:e})}var FCt=[U.RED,U.GREEN,U.BLUE,U.MAGENTA],ICt=new h;function PCt(e,t){WCt(e,t);let n=e.debugFreezeFrame&&!e._debugFreezeFrame;if(e._debugFreezeFrame=e.debugFreezeFrame,e.debugFreezeFrame&&(n&&(e._debugCameraFrustum=e._debugCameraFrustum&&e._debugCameraFrustum.destroy(),e._debugCameraFrustum=new y0({camera:e._sceneCamera,color:U.CYAN,updateOnChange:!1})),e._debugCameraFrustum.update(t)),e._cascadesEnabled){if(e.debugFreezeFrame){n&&(e._debugLightFrustum=e._debugLightFrustum&&e._debugLightFrustum.destroy(),e._debugLightFrustum=new y0({camera:e._shadowMapCamera,color:U.YELLOW,updateOnChange:!1})),e._debugLightFrustum.update(t);for(let i=0;i<e._numberOfCascades;++i)n&&(e._debugCascadeFrustums[i]=e._debugCascadeFrustums[i]&&e._debugCascadeFrustums[i].destroy(),e._debugCascadeFrustums[i]=new y0({camera:e._passes[i].camera,color:FCt[i],updateOnChange:!1})),e._debugCascadeFrustums[i].update(t)}}else if(e._isPointLight){if(!l(e._debugLightFrustum)||e._needsUpdate){let i=e._shadowMapCamera.positionWC,o=Ne.IDENTITY,r=e._pointLightRadius*2,s=h.fromElements(r,r,r,ICt),a=P.fromTranslationQuaternionRotationScale(i,o,s,sT);e._debugLightFrustum=e._debugLightFrustum&&e._debugLightFrustum.destroy(),e._debugLightFrustum=vCt(a,U.YELLOW)}e._debugLightFrustum.update(t)}else(!l(e._debugLightFrustum)||e._needsUpdate)&&(e._debugLightFrustum=new y0({camera:e._shadowMapCamera,color:U.YELLOW,updateOnChange:!1})),e._debugLightFrustum.update(t)}function _z(){this.viewMatrix=new P,this.inverseViewMatrix=new P,this.frustum=void 0,this.positionCartographic=new pe,this.positionWC=new h,this.directionWC=h.clone(h.UNIT_Z),this.upWC=h.clone(h.UNIT_Y),this.rightWC=h.clone(h.UNIT_X),this.viewProjectionMatrix=new P}_z.prototype.clone=function(e){P.clone(e.viewMatrix,this.viewMatrix),P.clone(e.inverseViewMatrix,this.inverseViewMatrix),this.frustum=e.frustum.clone(this.frustum),pe.clone(e.positionCartographic,this.positionCartographic),h.clone(e.positionWC,this.positionWC),h.clone(e.directionWC,this.directionWC),h.clone(e.upWC,this.upWC),h.clone(e.rightWC,this.rightWC)};var XCt=new P(.5,0,0,.5,0,.5,0,.5,0,0,.5,.5,0,0,0,1);_z.prototype.getViewProjection=function(){let e=this.viewMatrix,t=this.frustum.projectionMatrix;return P.multiply(t,e,this.viewProjectionMatrix),P.multiply(XCt,this.viewProjectionMatrix,this.viewProjectionMatrix),this.viewProjectionMatrix};var NCt=new Array(5),YCt=new Qi,MCt=new Array(4),ZAe=new h,RAe=new h;function wCt(e,t){let n=e._shadowMapCamera,i=e._sceneCamera,o=i.frustum.near,r=i.frustum.far,s=e._numberOfCascades,a,c=r-o,d=r/o,u=.9,m=!1;t.shadowState.closestObjectSize<200&&(m=!0,u=.9);let p=MCt,b=NCt;for(b[0]=o,b[s]=r,a=0;a<s;++a){let N=(a+1)/s,g=o*Math.pow(d,N),V=o+c*N,G=W.lerp(V,g,u);b[a+1]=G,p[a]=G-b[a]}if(m){for(a=0;a<s;++a)p[a]=Math.min(p[a],e._maximumCascadeDistances[a]);let N=b[0];for(a=0;a<s-1;++a)N+=p[a],b[a+1]=N}ce.unpack(b,0,e._cascadeSplits[0]),ce.unpack(b,1,e._cascadeSplits[1]),ce.unpack(p,0,e._cascadeDistances);let f=n.frustum,y=f.left,_=f.right,S=f.bottom,Z=f.top,R=f.near,C=f.far,E=n.positionWC,A=n.directionWC,L=n.upWC,F=i.frustum.clone(YCt),I=n.getViewProjection();for(a=0;a<s;++a){F.near=b[a],F.far=b[a+1];let N=P.multiply(F.projectionMatrix,i.viewMatrix,sT),g=P.inverse(N,sT),V=P.multiply(I,g,sT),G=h.fromElements(Number.MAX_VALUE,Number.MAX_VALUE,Number.MAX_VALUE,ZAe),v=h.fromElements(-Number.MAX_VALUE,-Number.MAX_VALUE,-Number.MAX_VALUE,RAe);for(let O=0;O<8;++O){let w=ce.clone(S0[O],Hte[O]);P.multiplyByVector(V,w,w),h.divideByScalar(w,w.w,w),h.minimumByComponent(w,G,G),h.maximumByComponent(w,v,v)}G.x=Math.max(G.x,0),G.y=Math.max(G.y,0),G.z=0,v.x=Math.min(v.x,1),v.y=Math.min(v.y,1),v.z=Math.min(v.z,1);let X=e._passes[a],Y=X.camera;Y.clone(n);let D=Y.frustum;D.left=y+G.x*(_-y),D.right=y+v.x*(_-y),D.bottom=S+G.y*(Z-S),D.top=S+v.y*(Z-S),D.near=R+G.z*(C-R),D.far=R+v.z*(C-R),X.cullingVolume=Y.frustum.computeCullingVolume(E,A,L);let M=e._cascadeMatrices[a];P.multiply(Y.getViewProjection(),i.inverseViewMatrix,M),P.multiply(X.textureOffsets,M,M)}}var kCt=new P,UCt=new h,DCt=new h,xAe=new h;function OCt(e,t){let n=e._shadowMapCamera,i=e._sceneCamera,o=P.multiply(i.frustum.projectionMatrix,i.viewMatrix,sT),r=P.inverse(o,sT),s=n.directionWC,a=i.directionWC;h.equalsEpsilon(s,a,W.EPSILON10)&&(a=i.upWC);let c=h.cross(s,a,UCt);a=h.cross(c,s,DCt),h.normalize(a,a),h.normalize(c,c);let d=h.fromElements(0,0,0,xAe),u=P.computeView(d,s,a,c,kCt),m=P.multiply(u,r,sT),p=h.fromElements(Number.MAX_VALUE,Number.MAX_VALUE,Number.MAX_VALUE,ZAe),b=h.fromElements(-Number.MAX_VALUE,-Number.MAX_VALUE,-Number.MAX_VALUE,RAe);for(let C=0;C<8;++C){let E=ce.clone(S0[C],Hte[C]);P.multiplyByVector(m,E,E),h.divideByScalar(E,E.w,E),h.minimumByComponent(E,p,p),h.maximumByComponent(E,b,b)}b.z+=1e3,p.z-=10;let f=xAe;f.x=-(.5*(p.x+b.x)),f.y=-(.5*(p.y+b.y)),f.z=-b.z;let y=P.fromTranslation(f,sT);u=P.multiply(y,u,u);let _=.5*(b.x-p.x),S=.5*(b.y-p.y),Z=b.z-p.z,R=n.frustum;R.left=-_,R.right=_,R.bottom=-S,R.top=S,R.near=.01,R.far=Z,P.clone(u,n.viewMatrix),P.inverse(u,n.inverseViewMatrix),P.getTranslation(n.inverseViewMatrix,n.positionWC),t.mapProjection.ellipsoid.cartesianToCartographic(n.positionWC,n.positionCartographic),h.clone(s,n.directionWC),h.clone(a,n.upWC),h.clone(c,n.rightWC)}var BCt=[new h(-1,0,0),new h(0,-1,0),new h(0,0,-1),new h(1,0,0),new h(0,1,0),new h(0,0,1)],zCt=[new h(0,-1,0),new h(0,0,-1),new h(0,-1,0),new h(0,-1,0),new h(0,0,1),new h(0,-1,0)],HCt=[new h(0,0,1),new h(1,0,0),new h(-1,0,0),new h(0,0,-1),new h(1,0,0),new h(1,0,0)];function KCt(e,t){let n=new Qi;n.fov=W.PI_OVER_TWO,n.near=1,n.far=e._pointLightRadius,n.aspectRatio=1;for(let i=0;i<6;++i){let o=e._passes[i].camera;o.positionWC=e._shadowMapCamera.positionWC,o.positionCartographic=t.mapProjection.ellipsoid.cartesianToCartographic(o.positionWC,o.positionCartographic),o.directionWC=BCt[i],o.upWC=zCt[i],o.rightWC=HCt[i],P.computeView(o.positionWC,o.directionWC,o.upWC,o.rightWC,o.viewMatrix),P.inverse(o.viewMatrix,o.inverseViewMatrix),o.frustum=n}}var JCt=new h,jCt=new h,CAe=new me,TAe=CAe.center;function QCt(e,t){let n=e._sceneCamera,i=e._shadowMapCamera,o=CAe;if(e._cascadesEnabled){if(n.frustum.near>=e.maximumDistance){e._outOfView=!0,e._needsUpdate=!1;return}let r=t.mapProjection.ellipsoid.geodeticSurfaceNormal(n.positionWC,JCt),s=h.negate(i.directionWC,jCt),a=h.dot(r,s);if(e.fadingEnabled){let c=W.clamp(a/.1,0,1);e._darkness=W.lerp(1,e.darkness,c)}else e._darkness=e.darkness;if(a<0){e._outOfView=!0,e._needsUpdate=!1;return}e._needsUpdate=!0,e._outOfView=!1}else if(e._isPointLight)o.center=i.positionWC,o.radius=e._pointLightRadius,e._outOfView=t.cullingVolume.computeVisibility(o)===qt.OUTSIDE,e._needsUpdate=!e._outOfView&&!e._boundingSphere.equals(o),me.clone(o,e._boundingSphere);else{let r=i.frustum.far/2,s=h.add(i.positionWC,h.multiplyByScalar(i.directionWC,r,TAe),TAe);o.center=s,o.radius=r,e._outOfView=t.cullingVolume.computeVisibility(o)===qt.OUTSIDE,e._needsUpdate=!e._outOfView&&!e._boundingSphere.equals(o),me.clone(o,e._boundingSphere)}}function qCt(e,t){let n=t.camera,i=e._lightCamera,o=e._sceneCamera,r=e._shadowMapCamera;e._cascadesEnabled?h.clone(i.directionWC,r.directionWC):e._isPointLight?h.clone(i.positionWC,r.positionWC):r.clone(i);let s=e._lightDirectionEC;P.multiplyByPointAsVector(n.viewMatrix,r.directionWC,s),h.normalize(s,s),h.negate(s,s),P.multiplyByPoint(n.viewMatrix,r.positionWC,e._lightPositionEC),e._lightPositionEC.w=e._pointLightRadius;let a,c;e._fitNearFar?(a=Math.min(t.shadowState.nearPlane,e.maximumDistance),c=Math.min(t.shadowState.farPlane,e.maximumDistance),c=Math.max(c,a+1)):(a=n.frustum.near,c=e.maximumDistance),e._sceneCamera=Io.clone(n,o),n.frustum.clone(e._sceneCamera.frustum),e._sceneCamera.frustum.near=a,e._sceneCamera.frustum.far=c,e._distance=c-a,QCt(e,t),!e._outOfViewPrevious&&e._outOfView&&(e._needsUpdate=!0),e._outOfViewPrevious=e._outOfView}_0.prototype.update=function(e){if(qCt(this,e),this._needsUpdate)if(ECt(this,e.context),this._isPointLight&&KCt(this,e),this._cascadesEnabled&&(OCt(this,e),this._numberOfCascades>1&&wCt(this,e)),this._isPointLight)this._shadowMapCullingVolume=$s.fromBoundingSphere(this._boundingSphere);else{let t=this._shadowMapCamera,n=t.positionWC,i=t.directionWC,o=t.upWC;this._shadowMapCullingVolume=t.frustum.computeCullingVolume(n,i,o),this._passes.length===1&&this._passes[0].camera.clone(t)}if(this._passes.length===1){let t=this._sceneCamera.inverseViewMatrix;P.multiply(this._shadowMapCamera.getViewProjection(),t,this._shadowMapMatrix)}this.debugShow&&PCt(this,e)};_0.prototype.updatePass=function(e,t){SAe(this,e,t)};var $Ct=new k;function VAe(e,t,n){let i=e._isPointLight?e._pointBias:n?e._terrainBias:e._primitiveBias,o={shadowMap_texture:function(){return e._shadowMapTexture},shadowMap_textureCube:function(){return e._shadowMapTexture},shadowMap_matrix:function(){return e._shadowMapMatrix},shadowMap_cascadeSplits:function(){return e._cascadeSplits},shadowMap_cascadeMatrices:function(){return e._cascadeMatrices},shadowMap_lightDirectionEC:function(){return e._lightDirectionEC},shadowMap_lightPositionEC:function(){return e._lightPositionEC},shadowMap_cascadeDistances:function(){return e._cascadeDistances},shadowMap_texelSizeDepthBiasAndNormalShadingSmooth:function(){let r=$Ct;return r.x=1/e._textureSize.x,r.y=1/e._textureSize.y,ce.fromElements(r.x,r.y,i.depthBias,i.normalShadingSmooth,this.combinedUniforms1)},shadowMap_normalOffsetScaleDistanceMaxDistanceAndDarkness:function(){return ce.fromElements(i.normalOffsetScale,e._distance,e.maximumDistance,e._darkness,this.combinedUniforms2)},combinedUniforms1:new ce,combinedUniforms2:new ce};return It(t,o,!1)}function eVt(e,t,n,i,o,r){let s,a,c;if(l(r)&&(s=r.shaderProgram,a=r.renderState,c=r.uniformMap),r=lt.shallowClone(n,r),r.castShadows=!0,r.receiveShadows=!1,!l(s)||o!==n.shaderProgram.id||t){let d=n.shaderProgram,u=n.pass===Le.GLOBE,m=n.pass!==Le.TRANSLUCENT,p=e._isPointLight,b=e._usesDepthTexture,f=d.vertexShaderSource,y=d.fragmentShaderSource,_=m&&Df.hasClippingForShadowCast(y),S=Df.getShadowCastShaderKeyword(p,u,b,m,_);if(s=i.shaderCache.getDerivedShaderProgram(d,S),!l(s)){let R=Df.createShadowCastVertexShader(f,p,u),C=Df.createShadowCastFragmentShader(y,p,b,m,_);s=i.shaderCache.createDerivedShaderProgram(d,S,{vertexShaderSource:R,fragmentShaderSource:C,attributeLocations:d._attributeLocations})}a=e._primitiveRenderState,p?a=e._pointRenderState:u&&(a=e._terrainRenderState),n.renderState.cull.enabled||(a=$e(a,!1),a.cull=$e(a.cull,!1),a.cull.enabled=!1,a=ze.fromCache(a)),c=VAe(e,n.uniformMap,u)}return r.shaderProgram=s,r.renderState=a,r.uniformMap=c,r}_0.createReceiveDerivedCommand=function(e,t,n,i,o){l(o)||(o={});let r=e.length>0,s=t.shaderProgram,a=s.vertexShaderSource,c=s.fragmentShaderSource,d=t.pass===Le.GLOBE,u=!1;if(d&&(u=t.owner.data.renderedMesh.encoding.hasVertexNormals),t.receiveShadows&&r){let m,p;l(o.receiveCommand)&&(m=o.receiveCommand.shaderProgram,p=o.receiveCommand.uniformMap),o.receiveCommand=lt.shallowClone(t,o.receiveCommand),o.castShadows=!1,o.receiveShadows=!0;let b=o.receiveShaderCastShadows!==t.castShadows,f=o.receiveShaderProgramId!==t.shaderProgram.id;if(!l(m)||f||n||b){let y=Df.getShadowReceiveShaderKeyword(e[0],t.castShadows,d,u);if(m=i.shaderCache.getDerivedShaderProgram(s,y),!l(m)){let _=Df.createShadowReceiveVertexShader(a,d,u),S=Df.createShadowReceiveFragmentShader(c,e[0],t.castShadows,d,u);m=i.shaderCache.createDerivedShaderProgram(s,y,{vertexShaderSource:_,fragmentShaderSource:S,attributeLocations:s._attributeLocations})}p=VAe(e[0],t.uniformMap,d)}o.receiveCommand.shaderProgram=m,o.receiveCommand.uniformMap=p,o.receiveShaderProgramId=t.shaderProgram.id,o.receiveShaderCastShadows=t.castShadows}return o};_0.createCastDerivedCommand=function(e,t,n,i,o){if(l(o)||(o={}),t.castShadows){let r=o.castCommands;l(r)||(r=o.castCommands=[]);let s=o.castShaderProgramId,a=e.length;r.length=a;for(let c=0;c<a;++c)r[c]=eVt(e[c],n,t,i,s,r[c]);o.castShaderProgramId=t.shaderProgram.id}return o};_0.prototype.isDestroyed=function(){return!1};_0.prototype.destroy=function(){zte(this),this._debugLightFrustum=this._debugLightFrustum&&this._debugLightFrustum.destroy(),this._debugCameraFrustum=this._debugCameraFrustum&&this._debugCameraFrustum.destroy(),this._debugShadowViewCommand=this._debugShadowViewCommand&&this._debugShadowViewCommand.shaderProgram&&this._debugShadowViewCommand.shaderProgram.destroy();for(let e=0;e<this._numberOfCascades;++e)this._debugCascadeFrustums[e]=this._debugCascadeFrustums[e]&&this._debugCascadeFrustums[e].destroy();return ue(this)};var Ng=_0;var Peo=x(T(),1);var feo=x(T(),1),WZ=`uniform sampler2D colorTexture; #ifdef DEBUG_SHOW_DEPTH uniform sampler2D u_packedTranslucentDepth; #endif @@ -10572,7 +10572,7 @@ color.rgb /= color.a; out_FragColor = color; #endif } -`;var P2t=!1;function AT(e){this._drawClassificationFBO=new li({createDepthAttachments:!1}),this._accumulationFBO=new li({createDepthAttachments:!1}),this._packFBO=new li,this._opaqueDepthStencilTexture=void 0,this._textureToComposite=void 0,this._translucentDepthStencilTexture=void 0,this._packDepthCommand=void 0,this._accumulateCommand=void 0,this._compositeCommand=void 0,this._copyCommand=void 0,this._clearColorCommand=new ui({color:new U(0,0,0,0),owner:this}),this._clearDepthStencilCommand=new ui({depth:1,stencil:0,owner:this}),this._supported=e.depthTexture,this._viewport=new nt,this._rsDepth=void 0,this._rsAccumulate=void 0,this._rsComp=void 0,this._useScissorTest=void 0,this._scissorRectangle=void 0,this._hasTranslucentDepth=!1,this._frustumsDrawn=0}Object.defineProperties(AT.prototype,{hasTranslucentDepth:{get:function(){return this._hasTranslucentDepth}}});function TFe(e){e._textureToComposite=void 0,e._translucentDepthStencilTexture=e._translucentDepthStencilTexture&&!e._translucentDepthStencilTexture.isDestroyed()&&e._translucentDepthStencilTexture.destroy()}function _Fe(e){e._drawClassificationFBO.destroy(),e._accumulationFBO.destroy(),e._packFBO.destroy()}function X2t(e,t,n,i){TFe(e),e._translucentDepthStencilTexture=new vt({context:t,width:n,height:i,pixelFormat:Qe.DEPTH_STENCIL,pixelDatatype:Ue.UNSIGNED_INT_24_8,sampler:Ot.NEAREST})}function N2t(e,t,n,i){_Fe(e),e._drawClassificationFBO.setDepthStencilTexture(e._translucentDepthStencilTexture),e._drawClassificationFBO.update(t,n,i),e._accumulationFBO.setDepthStencilTexture(e._translucentDepthStencilTexture),e._accumulationFBO.update(t,n,i),e._packFBO.update(t,n,i)}function Y2t(e,t,n,i){if(!e.isSupported())return;e._opaqueDepthStencilTexture=i;let o=e._opaqueDepthStencilTexture.width,r=e._opaqueDepthStencilTexture.height;e._drawClassificationFBO.isDirty(o,r)&&(X2t(e,t,o,r),N2t(e,t,o,r));let s,a;if(l(e._packDepthCommand)||(s=new Je({sources:[Nv]}),a={u_opaqueDepthTexture:function(){return e._opaqueDepthStencilTexture},u_translucentDepthTexture:function(){return e._translucentDepthStencilTexture}},e._packDepthCommand=t.createViewportQuadCommand(s,{uniformMap:a,owner:e})),!l(e._compositeCommand)){s=new Je({sources:[oR]}),a={colorTexture:function(){return e._textureToComposite}},P2t&&(s.defines=["DEBUG_SHOW_DEPTH"],a.u_packedTranslucentDepth=function(){return e._packFBO.getColorTexture()}),e._compositeCommand=t.createViewportQuadCommand(s,{uniformMap:a,owner:e});let u=e._compositeCommand,m=u.shaderProgram,p=t.shaderCache.createDerivedShaderProgram(m,"pick",{vertexShaderSource:m.vertexShaderSource,fragmentShaderSource:new Je({sources:s.sources,defines:["PICK"]}),attributeLocations:m._attributeLocations}),b=lt.shallowClone(u);b.shaderProgram=p,u.derivedCommands.pick=b}l(e._copyCommand)||(s=new Je({sources:[oR]}),a={colorTexture:function(){return e._drawClassificationFBO.getColorTexture()}},e._copyCommand=t.createViewportQuadCommand(s,{uniformMap:a,owner:e})),l(e._accumulateCommand)||(s=new Je({sources:[oR]}),a={colorTexture:function(){return e._drawClassificationFBO.getColorTexture()}},e._accumulateCommand=t.createViewportQuadCommand(s,{uniformMap:a,owner:e})),e._viewport.width=o,e._viewport.height=r;let c=!nt.equals(e._viewport,n.viewport),d=c!==e._useScissorTest;e._useScissorTest=c,nt.equals(e._scissorRectangle,n.viewport)||(e._scissorRectangle=nt.clone(n.viewport,e._scissorRectangle),d=!0),(!l(e._rsDepth)||!nt.equals(e._viewport,e._rsDepth.viewport)||d)&&(e._rsDepth=ze.fromCache({viewport:e._viewport,scissorTest:{enabled:e._useScissorTest,rectangle:e._scissorRectangle}})),l(e._packDepthCommand)&&(e._packDepthCommand.renderState=e._rsDepth),(!l(e._rsAccumulate)||!nt.equals(e._viewport,e._rsAccumulate.viewport)||d)&&(e._rsAccumulate=ze.fromCache({viewport:e._viewport,scissorTest:{enabled:e._useScissorTest,rectangle:e._scissorRectangle},stencilTest:{enabled:!0,frontFunction:ii.EQUAL,reference:Jt.CESIUM_3D_TILE_MASK}})),l(e._accumulateCommand)&&(e._accumulateCommand.renderState=e._rsAccumulate),(!l(e._rsComp)||!nt.equals(e._viewport,e._rsComp.viewport)||d)&&(e._rsComp=ze.fromCache({viewport:e._viewport,scissorTest:{enabled:e._useScissorTest,rectangle:e._scissorRectangle},blending:on.ALPHA_BLEND})),l(e._compositeCommand)&&(e._compositeCommand.renderState=e._rsComp,e._compositeCommand.derivedCommands.pick.renderState=e._rsComp)}AT.prototype.executeTranslucentCommands=function(e,t,n,i,o){let r=e.frameState.useLogDepth,s=e.context,a=n.framebuffer;for(let c=0;c<i.length;++c){let d=i[c];if(d=r?d.derivedCommands.logDepth.command:d,d.depthForTranslucentClassification){this._hasTranslucentDepth=!0;break}}if(this._hasTranslucentDepth){Y2t(this,s,n,o),n.framebuffer=this._drawClassificationFBO.framebuffer,this._clearDepthStencilCommand.execute(s,n);for(let c=0;c<i.length;++c){let d=i[c];if(d=r?d.derivedCommands.logDepth.command:d,!d.depthForTranslucentClassification)continue;let u=d.derivedCommands.depth.depthOnlyCommand;t(u,e,n)}this._frustumsDrawn+=this._hasTranslucentDepth?1:0,this._hasTranslucentDepth&&(n.framebuffer=this._packFBO.framebuffer,this._packDepthCommand.execute(s,n)),n.framebuffer=a}};AT.prototype.executeClassificationCommands=function(e,t,n,i){if(!this._hasTranslucentDepth)return;let o=e.context,r=o.uniformState,s=n.framebuffer;n.framebuffer=this._accumulationFBO.framebuffer,this._accumulateCommand.execute(o,n),n.framebuffer=this._drawClassificationFBO.framebuffer,this._frustumsDrawn>1&&this._clearColorCommand.execute(o,n),r.updatePass(Le.CESIUM_3D_TILE_CLASSIFICATION);let a=r.globeDepthTexture;r.globeDepthTexture=this._packFBO.getColorTexture();let c=i.commands[Le.CESIUM_3D_TILE_CLASSIFICATION],d=i.indices[Le.CESIUM_3D_TILE_CLASSIFICATION];for(let u=0;u<d;++u)t(c[u],e,n);r.globeDepthTexture=a,n.framebuffer=s,this._frustumsDrawn!==1&&(n.framebuffer=this._accumulationFBO.framebuffer,this._accumulateCommand.execute(o,n),n.framebuffer=s)};AT.prototype.execute=function(e,t){if(!this._hasTranslucentDepth)return;this._frustumsDrawn===1?this._textureToComposite=this._drawClassificationFBO.getColorTexture():this._textureToComposite=this._accumulationFBO.getColorTexture(),(e.frameState.passes.pick?this._compositeCommand.derivedCommands.pick:this._compositeCommand).execute(e.context,t),M2t(this,e,t)};function M2t(e,t,n){if(!e._hasTranslucentDepth)return;let i=n.framebuffer;n.framebuffer=e._drawClassificationFBO.framebuffer,e._clearColorCommand.execute(t._context,n),n.framebuffer=i,e._frustumsDrawn>1&&(n.framebuffer=e._accumulationFBO.framebuffer,e._clearColorCommand.execute(t._context,n)),e._hasTranslucentDepth=!1,e._frustumsDrawn=0}AT.prototype.isSupported=function(){return this._supported};AT.prototype.isDestroyed=function(){return!1};AT.prototype.destroy=function(){return TFe(this),_Fe(this),l(this._compositeCommand)&&(this._compositeCommand.shaderProgram=this._compositeCommand.shaderProgram&&this._compositeCommand.shaderProgram.destroy()),l(this._packDepthCommand)&&(this._packDepthCommand.shaderProgram=this._packDepthCommand.shaderProgram&&this._packDepthCommand.shaderProgram.destroy()),ue(this)};var v9=AT;function w2t(){this.command=void 0,this.near=void 0,this.far=void 0}function CK(e,t,n){let i=e.context,o;i.depthTexture&&(o=new V9);let r;e._useOIT&&i.depthTexture&&(r=new A9(i));let s=new oc(i);s.viewport=nt.clone(n),this.camera=t,this._cameraClone=Io.clone(t),this._cameraStartFired=!1,this._cameraMovedTime=void 0,this.viewport=n,this.passState=s,this.pickFramebuffer=new W9(i),this.snapFramebuffer=void 0,this.pickDepthFramebuffer=new L9,this.sceneFramebuffer=new iR,this.edgeFramebuffer=new Z9,this.planarFillIdFramebuffer=new R9,this.globeDepth=o,this.globeTranslucencyFramebuffer=new E9,this.oit=r,this.translucentTileClassification=new v9(i),this.pickDepths=[],this.frustumCommandsList=[],this.debugFrustumStatistics=void 0,this._commandExtents=[]}var mre=new h,hre=new h;function k2t(e,t,n){let i=Math.max(h.maximumComponent(h.abs(e.position,mre)),h.maximumComponent(h.abs(t.position,hre))),o=1/Math.max(1,i);return h.multiplyByScalar(e.position,o,mre),h.multiplyByScalar(t.position,o,hre),h.equalsEpsilon(mre,hre,n)&&h.equalsEpsilon(e.direction,t.direction,n)&&h.equalsEpsilon(e.up,t.up,n)&&h.equalsEpsilon(e.right,t.right,n)&&P.equalsEpsilon(e.transform,t.transform,n)&&e.frustum.equalsEpsilon(t.frustum,n)}CK.prototype.checkForCameraUpdates=function(e){let t=this.camera,n=this._cameraClone;return k2t(t,n,W.EPSILON15)?(this._cameraStartFired&&Zn()-this._cameraMovedTime>e.cameraEventWaitTime&&(t.moveEnd.raiseEvent(),this._cameraStartFired=!1),!1):(this._cameraStartFired||(t.moveStart.raiseEvent(),this._cameraStartFired=!0),this._cameraMovedTime=Zn(),Io.clone(t,n),!0)};function U2t(e,t,n,i){let{frameState:o}=t,{camera:r,useLogDepth:s}=o,a=s?t.logarithmicDepthFarToNearRatio:t.farToNearRatio,c=t.mode===se.SCENE2D,d=t.nearToFarDistance2D;i*=1+W.EPSILON2,n=Math.min(Math.max(n,r.frustum.near),r.frustum.far),i=Math.max(Math.min(i,r.frustum.far),n);let u;c?(i=Math.min(i,r.position.z+t.nearToFarDistance2D),n=Math.min(n,i),u=Math.ceil(Math.max(1,i-n)/t.nearToFarDistance2D)):u=Math.ceil(Math.log(i/n)/Math.log(a));let{frustumCommandsList:m}=e;m.length=u;for(let p=0;p<u;++p){let b,f;c?(b=Math.min(i-d,n+p*d),f=Math.min(i,b+d)):(b=Math.max(n,Math.pow(a,p)*n),f=Math.min(i,a*b)),l(m[p])?(m[p].near=b,m[p].far=f):m[p]=new C9(b,f)}}function D2t(e,t,n){let{command:i,near:o,far:r}=n;t.debugShowFrustums&&(i.debugOverlappingFrustums=0);let{frustumCommandsList:s}=e;for(let a=0;a<s.length;++a){let c=s[a];if(o>c.far)continue;if(r<c.near)break;let d=i.pass,u=c.indices[d]++;if(c.commands[d][u]=i,t.debugShowFrustums&&(i.debugOverlappingFrustums|=1<<a),i.executeInClosestFrustum)break}if(t.debugShowFrustums){let{debugFrustumStatistics:a}=e,{debugOverlappingFrustums:c}=i,d=a.commandsInFrustums;d[c]=l(d[c])?d[c]+1:1,++a.totalCommands}t.updateDerivedCommands(i)}var SFe=new $s,O2t=new Ns;CK.prototype.createPotentiallyVisibleSet=function(e){let{frameState:t}=e,{camera:n,commandList:i,shadowState:o}=t,{positionWC:r,directionWC:s,frustum:a}=n,c=e._computeCommandList,d=e._overlayCommandList;e.debugShowFrustums&&(this.debugFrustumStatistics={totalCommands:0,commandsInFrustums:{}});let u=this.frustumCommandsList;for(let I=0;I<u.length;++I)for(let N=0;N<Le.NUMBER_OF_PASSES;++N)u[I].indices[N]=0;c.length=0,d.length=0;let m=this._commandExtents,p=m.length,b=0,f=+Number.MAX_VALUE,y=-Number.MAX_VALUE,{shadowsEnabled:_}=o,S=+Number.MAX_VALUE,Z=-Number.MAX_VALUE,R=Number.MAX_VALUE,C=t.mode===se.SCENE3D?t.occluder:void 0,{cullingVolume:E}=t,A=SFe.planes;for(let I=0;I<5;++I)A[I]=E.planes[I];E=SFe;for(let I=0;I<i.length;++I){let N=i[I],{pass:g,boundingVolume:V}=N;if(g===Le.COMPUTE)c.push(N);else if(g===Le.OVERLAY)d.push(N);else{let G,v;if(l(V)){if(!e.isVisible(E,N,C))continue;let Y=V.computePlaneDistances(r,s,O2t);if(G=Y.start,v=Y.stop,f=Math.min(f,G),y=Math.max(y,v),_&&N.receiveShadows&&G<ty.MAXIMUM_DISTANCE&&!(g===Le.GLOBE&&G<-100&&v>100)){let D=v-G;g!==Le.GLOBE&&G<100&&(R=Math.min(R,D)),S=Math.min(S,G),Z=Math.max(Z,v)}}else N instanceof ui?(G=a.near,v=a.far):(G=a.near,v=a.far,f=Math.min(f,G),y=Math.max(y,v));let X=m[b];l(X)||(X=m[b]=new w2t),X.command=N,X.near=G,X.far=v,b++}}_&&(S=Math.min(Math.max(S,a.near),a.far),Z=Math.max(Math.min(Z,a.far),S),o.nearPlane=S,o.farPlane=Z,o.closestObjectSize=R),U2t(this,e,f,y);for(let I=0;I<b;I++)D2t(this,e,m[I]);if(b<p)for(let I=b;I<p;I++){let N=m[I];if(!l(N.command))break;N.command=void 0}for(let I=0;I<u.length;++I){let{commands:N,indices:g}=u[I];for(let V=0;V<N.length;++V){let G=N[V];for(let v=g[V];v<G.length&&l(G[v]);++v)G[v]=void 0}}let L=u.length,{frustumSplits:F}=t;F.length=L+1;for(let I=0;I<L;++I)F[I]=u[I].near,I===L-1&&(F[I+1]=u[I].far)};CK.prototype.destroy=function(){this.pickFramebuffer=this.pickFramebuffer&&this.pickFramebuffer.destroy(),this.snapFramebuffer=this.snapFramebuffer&&this.snapFramebuffer.destroy(),this.pickDepthFramebuffer=this.pickDepthFramebuffer&&this.pickDepthFramebuffer.destroy(),this.sceneFramebuffer=this.sceneFramebuffer&&this.sceneFramebuffer.destroy(),this.edgeFramebuffer=this.edgeFramebuffer&&this.edgeFramebuffer.destroy(),this.planarFillIdFramebuffer=this.planarFillIdFramebuffer&&this.planarFillIdFramebuffer.destroy(),this.globeDepth=this.globeDepth&&this.globeDepth.destroy(),this.oit=this.oit&&this.oit.destroy(),this.translucentTileClassification=this.translucentTileClassification&&this.translucentTileClassification.destroy(),this.globeTranslucencyFramebuffer=this.globeTranslucencyFramebuffer&&this.globeTranslucencyFramebuffer.destroy();let e=this.pickDepths;for(let t=0;t<e.length;++t)e[t].destroy()};var rR=CK;var RFe=.1,B2t=new _h({pass:lr.MOST_DETAILED_PRELOAD}),z2t=new _h({pass:lr.MOST_DETAILED_PICK}),F9=new _h({pass:lr.PICK});function Wa(e){this._mostDetailedRayPicks=[],this.pickRenderStateCache={},this._pickPositionCache={},this._pickPositionCacheDirty=!1;let t=new nt(0,0,1,1),n=new Io(e);n.frustum=new yn({width:RFe,aspectRatio:1,near:.1}),this._pickOffscreenView=new rR(e,n,t)}Wa.prototype.update=function(){this._pickPositionCacheDirty=!0};Wa.prototype.getPickDepth=function(e,t){let n=e.view.pickDepths,i=n[t];return l(i)||(i=new S9,n[t]=i),i};var H2t=new ps,K2t=new h,VK=new h,J2t=new k,j2t=new P;function Q2t(e,t,n,i,o){let r=e.camera,s=r.frustum,a=s.offCenterFrustum;l(a)&&(s=a);let c=2*(t.x-o.x)/o.width-1;c*=(s.right-s.left)*.5;let d=2*(o.height-t.y-o.y)/o.height-1;d*=(s.top-s.bottom)*.5;let u=P.clone(r.transform,j2t);r._setTransform(P.IDENTITY);let m=h.clone(r.position,K2t);h.multiplyByScalar(r.right,c,VK),h.add(VK,m,m),h.multiplyByScalar(r.up,d,VK),h.add(VK,m,m),r._setTransform(u),e.mode===se.SCENE2D&&h.fromElements(m.z,m.x,m.y,m);let p=s.getPixelDimensions(o.width,o.height,1,1,J2t),b=H2t;return b.right=p.x*.5,b.left=-b.right,b.top=p.y*.5,b.bottom=-b.top,b.near=s.near,b.far=s.far,b.computeCullingVolume(m,r.directionWC,r.upWC)}var q2t=new fd,$2t=new k;function eFt(e,t,n,i,o){let r=e.camera,s=r.frustum,a=s.near,c=Math.tan(s.fovy*.5),d=s.aspectRatio*c,u=2*(t.x-o.x)/o.width-1,m=2*(o.height-t.y-o.y)/o.height-1,p=u*a*d,b=m*a*c,f=s.getPixelDimensions(o.width,o.height,1,1,$2t),y=f.x*n*.5,_=f.y*i*.5,S=q2t;return S.top=b+_,S.bottom=b-_,S.right=p+y,S.left=p-y,S.near=a,S.far=s.far,S.computeCullingVolume(r.positionWC,r.directionWC,r.upWC)}function EK(e,t,n,i,o){let r=e.camera.frustum;return r instanceof yn||r instanceof ps?Q2t(e,t,n,i,o):eFt(e,t,n,i,o)}var I9=new nt(0,0,3,3),AK=new k,P9=new U(0,0,0,0);function fre(e,t,n,i,o){return o.width=n??3,o.height=i??o.width,o.x=t.x-(o.width-1)*.5,o.y=e-t.y-(o.height-1)*.5,o}function X9(e,t,n,i,o,r){let{context:s,frameState:a,defaultView:c}=e,{viewport:d,pickFramebuffer:u}=c,m=r?.framebuffer??u;e.view=c,d.x=0,d.y=0,d.width=s.drawingBufferWidth,d.height=s.drawingBufferHeight;let p=c.passState;p.viewport=nt.clone(d,p.viewport);let b=fo.transformWindowToDrawingBuffer(e,t,AK);fre(s.drawingBufferHeight,b,i,o,n),e.jobScheduler.disableThisFrame(),e.updateFrameState(),a.cullingVolume=EK(e,b,n.width,n.height,d),a.invertClassification=!1,a.passes.pick=!0,a.passes.snap=r?.snap??!1,a.tilesetPassState=F9,s.uniformState.update(a),e.updateEnvironment(),p=m.begin(n,d),e.updateAndExecuteCommands(p,P9),e.resolveFramebuffers(p)}function N9(e){let{context:t}=e;t.endFrame()}Wa.prototype.pickAsync=async function(e,t,n,i,o=1){let{context:r,frameState:s,defaultView:a}=e,{pickFramebuffer:c}=a,d=I9;X9(e,t,d,n,i);let u;return r.webgl2?u=c.endAsync(d,s,o):(u=c.end(d,o),u=Promise.resolve(u),xt("picking-async-fallback","Fallback to synchronous picking because async operation requires WebGL2 context.")),N9(e),u};Wa.prototype.pick=function(e,t,n,i,o=1){let{defaultView:r}=e,{pickFramebuffer:s}=r,a=I9;X9(e,t,a,n,i);let c=s.end(a,o);return N9(e),c};Wa.prototype.pickVoxelCoordinate=function(e,t,n,i){let{context:o,frameState:r,defaultView:s}=e,{viewport:a,pickFramebuffer:c}=s;e.view=s,a.x=0,a.y=0,a.width=o.drawingBufferWidth,a.height=o.drawingBufferHeight;let d=s.passState;d.viewport=nt.clone(a,d.viewport);let u=fo.transformWindowToDrawingBuffer(e,t,AK),m=fre(o.drawingBufferHeight,u,n,i,I9);e.jobScheduler.disableThisFrame(),e.updateFrameState(),r.cullingVolume=EK(e,u,m.width,m.height,a),r.invertClassification=!1,r.passes.pickVoxel=!0,r.tilesetPassState=F9,o.uniformState.update(r),e.updateEnvironment(),d=c.begin(m,a),e.updateAndExecuteCommands(d,P9),e.resolveFramebuffers(d);let p=c.readCenterPixel(m);return o.endFrame(),p};Wa.prototype.pickMetadata=function(e,t,n){let{context:i,frameState:o,defaultView:r}=e,{viewport:s,pickFramebuffer:a}=r;e.view=r,s.x=0,s.y=0,s.width=i.drawingBufferWidth,s.height=i.drawingBufferHeight;let c=r.passState;c.viewport=nt.clone(s,c.viewport);let d=fo.transformWindowToDrawingBuffer(e,t,AK),u=fre(i.drawingBufferHeight,d,1,1,I9);e.jobScheduler.disableThisFrame(),e.updateFrameState(),o.cullingVolume=EK(e,d,u.width,u.height,s),o.invertClassification=!1,o.passes.pick=!0,o.tilesetPassState=F9,o.pickingMetadata=!0,o.pickedMetadataInfo=n,i.uniformState.update(o),e.updateEnvironment(),c=a.begin(u,s),e.updateAndExecuteCommands(c,P9);let m=e._environmentState.useOIT;e._environmentState.useOIT=!1,e.resolveFramebuffers(c),e._environmentState.useOIT=m;let p=a.readCenterPixel(u);return i.endFrame(),o.pickingMetadata=!1,_9.decodeMetadataValues(n.classProperty,n.metadataProperty,p)};function tFt(e,t){let{defaultView:n,context:i,frameState:o,environmentState:r}=e,{viewport:s,pickDepthFramebuffer:a}=n;e.view=n,s.x=0,s.y=0,s.width=i.drawingBufferWidth,s.height=i.drawingBufferHeight;let c=n.passState;c.viewport=nt.clone(s,c.viewport),e.clearPasses(o.passes),o.passes.pick=!0,o.passes.depth=!0,o.cullingVolume=EK(e,t,1,1,s),o.tilesetPassState=F9,e.updateEnvironment(),r.renderTranslucentDepthForPick=!0,c=a.update(i,t,s),e.updateAndExecuteCommands(c,P9),e.resolveFramebuffers(c),i.endFrame()}var nFt=new qi,iFt=new fd,oFt=new yn,rFt=new ps;Wa.prototype.pickPositionWorldCoordinates=function(e,t,n){if(!e.useDepthPicking)return;let i=t.toString();if(this._pickPositionCacheDirty)this._pickPositionCache={},this._pickPositionCacheDirty=!1;else if(this._pickPositionCache.hasOwnProperty(i))return h.clone(this._pickPositionCache[i],n);let{context:o,frameState:r,camera:s,defaultView:a}=e,{uniformState:c}=o;e.view=a;let d=fo.transformWindowToDrawingBuffer(e,t,AK);e.pickTranslucentDepth?tFt(e,d):(e.updateFrameState(),c.update(r),e.updateEnvironment()),d.y=e.drawingBufferHeight-d.y;let u;l(s.frustum.fov)?u=s.frustum.clone(nFt):l(s.frustum.infiniteProjectionMatrix)?u=s.frustum.clone(iFt):l(s.frustum.width)?u=s.frustum.clone(oFt):u=s.frustum.clone(rFt);let{frustumCommandsList:m}=a,p=m.length;for(let b=0;b<p;++b){let y=this.getPickDepth(e,b).getDepth(o,d.x,d.y);if(l(y)&&y>0&&y<1){let _=m[b],S;return e.mode===se.SCENE2D?(S=s.position.z,s.position.z=S-_.near+1,u.far=Math.max(1,_.far-_.near),u.near=1,c.update(r),c.updateFrustum(u)):(u.near=_.near*(b!==0?e.opaqueFrustumNearOffset:1),u.far=_.far,c.updateFrustum(u)),n=fo.drawingBufferToWorldCoordinates(e,d,y,n),e.mode===se.SCENE2D&&(s.position.z=S,c.update(r)),this._pickPositionCache[i]=h.clone(n),n}}this._pickPositionCache[i]=void 0};var sFt=new pe;Wa.prototype.pickPosition=function(e,t,n){if(n=this.pickPositionWorldCoordinates(e,t,n),l(n)&&e.mode!==se.SCENE3D){h.fromElements(n.y,n.z,n.x,n);let i=e.mapProjection,o=i.ellipsoid,r=i.unproject(n,sFt);o.cartographicToCartesian(r,n)}return n};function aFt(e,t,n,i,o,r){for(let s of e){let a=s.object,c=s.position,d=s.exclude;if(l(c)&&!l(a))return n.push(s),!0;if(!l(a)||!l(a.primitive)||!d&&(n.push(s),n.length>=t))return!0;let u=a.primitive,m=!1;if(typeof u.getGeometryInstanceAttributes=="function"&&l(a.id)){let p=u.getGeometryInstanceAttributes(a.id);l(p)&&l(p.show)&&(m=!0,p.show=Wn.toValue(!1,p.show),o.push(p))}a instanceof ea&&(m=!0,a.show=!1,r.push(a)),m||(u.show=!1,i.push(u))}}function CFe(e,t){let n=[],i=[],o=[],r=[];l(t)||(t=Number.MAX_VALUE);let s=e(t);for(;l(s)&&s.length>0&&!aFt(s,t,n,i,o,r);)s=e(t-n.length);for(let a=0;a<i.length;++a)i[a].show=!0;for(let a=0;a<o.length;++a){let c=o[a];c.show=Wn.toValue(!0,c.show)}for(let a=0;a<r.length;++a)r[a].show=!0;return n}Wa.prototype.drillPick=function(e,t,n,i,o){return CFe(a=>this.pick(e,t,i,o,a).map(d=>({object:d,position:void 0,exclude:!1})),n).map(a=>a.object)};var ZFe=new h,cFt=new h;function lFt(e,t,n){this.ray=e,this.width=t,this.tilesets=n,this.ready=!1;let i=this;this.promise=new Promise(o=>{i._completePick=()=>{o()}})}function VFe(e,t,n,i){let o=t.direction,r=h.mostOrthogonalAxis(o,ZFe),s=h.cross(o,r,ZFe),a=h.cross(o,s,cFt);return i.position=t.origin,i.direction=o,i.up=a,i.right=s,i.frustum.width=n??RFe,i.frustum.computeCullingVolume(i.positionWC,i.directionWC,i.upWC)}function dFt(e,t,n){let i=t.frameState,{ray:o,width:r,tilesets:s}=n,a=e._pickOffscreenView.camera,c=VFe(e,o,r,a),d=B2t;d.camera=a,d.cullingVolume=c;let u=!0,m=s.length;for(let p=0;p<m;++p){let b=s[p];b.show&&t.primitives.contains(b)&&(b.updateForPass(i,d),u=u&&d.ready)}return u&&n._completePick(),u}Wa.prototype.updateMostDetailedRayPicks=function(e){let t=this._mostDetailedRayPicks;for(let n=0;n<t.length;++n)dFt(this,e,t[n])&&t.splice(n--,1)};function EFe(e,t,n){for(let i=0;i<e.length;++i){let o=e.get(i);o.show&&(l(o.isCesium3DTileset)?(!l(t)||t.indexOf(o)===-1)&&n.push(o):o instanceof xl&&EFe(o,t,n))}}function GK(e,t,n,i,o,r){let s=[];if(EFe(t.primitives,i,s),s.length===0)return Promise.resolve(r());let a=new lFt(n,o,s);return e._mostDetailedRayPicks.push(a),a.promise.then(function(){return r()})}function uFt(e,t){return!l(e)||!l(t)||t.length===0?!1:t.indexOf(e)>-1||t.indexOf(e.primitive)>-1||t.indexOf(e.id)>-1}function mFt(e,t,n,i,o,r,s){let{context:a,frameState:c}=t,d=a.uniformState,u=e._pickOffscreenView;t.view=u,VFe(e,n,o,u.camera);let m=nt.clone(u.viewport,I9),p=u.pickFramebuffer.begin(m,u.viewport);t.jobScheduler.disableThisFrame(),t.updateFrameState(),c.invertClassification=!1,c.passes.pick=!0,c.passes.offscreen=!0,s?c.tilesetPassState=z2t:c.tilesetPassState=F9,d.update(c),t.updateEnvironment(),t.updateAndExecuteCommands(p,P9),t.resolveFramebuffers(p);let b,f=u.pickFramebuffer.end(m,1)[0];if(t.context.depthTexture){let{frustumCommandsList:y}=u,_=y.length;for(let S=0;S<_;++S){let R=e.getPickDepth(t,S).getDepth(a,0,0);if(l(R)&&R>0&&R<1){let C=y[S],E=C.near*(S!==0?t.opaqueFrustumNearOffset:1),A=C.far,L=E+R*(A-E);b=gn.getPoint(n,L);break}}}if(t.view=t.defaultView,a.endFrame(),l(f)||l(b))return{object:f,position:b,exclude:!l(b)&&r||uFt(f,i)}}function pre(e,t,n,i,o,r,s,a){return CFe(function(){let d=mFt(e,t,n,o,r,s,a);return d?[d]:void 0},i)}function cA(e,t,n,i,o,r,s){let a=pre(e,t,n,1,i,o,r,s);if(a.length>0)return a[0]}function LK(e,t){return new Promise((n,i)=>{t.then(function(o){let r=e.postRender.addEventListener(function(){r(),n(o)});e.requestRender()}).catch(function(o){i(o)})})}Wa.prototype.pickFromRay=function(e,t,n,i){return cA(this,e,t,n,i,!1,!1)};Wa.prototype.drillPickFromRay=function(e,t,n,i,o){return pre(this,e,t,n,i,o,!1,!1)};Wa.prototype.pickFromRayMostDetailed=function(e,t,n,i){let o=this;return t=gn.clone(t),n=l(n)?n.slice():n,LK(e,GK(o,e,t,n,i,function(){return cA(o,e,t,n,i,!1,!0)}))};Wa.prototype.drillPickFromRayMostDetailed=function(e,t,n,i,o){let r=this;return t=gn.clone(t),i=l(i)?i.slice():i,LK(e,GK(r,e,t,i,o,function(){return pre(r,e,t,n,i,o,!1,!0)}))};var hFt=new h,fFt=new h,pFt=new gn,AFe=new pe;function bre(e,t){let n=e.ellipsoid,i=Pi._defaultMaxTerrainHeight,o=n.geodeticSurfaceNormalCartographic(t,fFt),r=pe.toCartesian(t,n,hFt),s=pFt;s.origin=r,s.direction=o;let a=new gn;return gn.getPoint(s,i,a.origin),h.negate(o,a.direction),a}function GFe(e,t){let n=e.ellipsoid,i=pe.fromCartesian(t,n,AFe);return bre(e,i)}function LFe(e,t){let n=e.ellipsoid;return pe.fromCartesian(t,n,AFe).height}function bFt(e,t,n,i,o){let r=bre(t,n);return GK(e,t,r,i,o,function(){let s=cA(e,t,r,i,o,!0,!0);if(l(s))return LFe(t,s.position)})}function gFt(e,t,n,i,o,r){let s=GFe(t,n);return GK(e,t,s,i,o,function(){let a=cA(e,t,s,i,o,!0,!0);if(l(a))return h.clone(a.position,r)})}Wa.prototype.sampleHeight=function(e,t,n,i){let o=bre(e,t),r=cA(this,e,o,n,i,!0,!1);if(l(r))return LFe(e,r.position)};Wa.prototype.clampToHeight=function(e,t,n,i,o){let r=GFe(e,t),s=cA(this,e,r,n,i,!0,!1);if(l(s))return h.clone(s.position,o)};Wa.prototype.sampleHeightMostDetailed=function(e,t,n,i){n=l(n)?n.slice():n;let o=t.length,r=new Array(o);for(let s=0;s<o;++s)r[s]=bFt(this,e,t[s],n,i);return LK(e,Promise.all(r).then(function(s){let a=s.length;for(let c=0;c<a;++c)t[c].height=s[c];return t}))};Wa.prototype.clampToHeightMostDetailed=function(e,t,n,i){n=l(n)?n.slice():n;let o=t.length,r=new Array(o);for(let s=0;s<o;++s)r[s]=gFt(this,e,t[s],n,i,t[s]);return LK(e,Promise.all(r).then(function(s){let a=s.length;for(let c=0;c<a;++c)t[c]=s[c];return t}))};Wa.prototype.destroy=function(){this._pickOffscreenView=this._pickOffscreenView&&this._pickOffscreenView.destroy()};var Y9=Wa;var eyo=x(T(),1);var Ago=x(T(),1);var G0o=x(T(),1),M9=`uniform sampler2D colorTexture; +`;var tVt=!1;function aT(e){this._drawClassificationFBO=new li({createDepthAttachments:!1}),this._accumulationFBO=new li({createDepthAttachments:!1}),this._packFBO=new li,this._opaqueDepthStencilTexture=void 0,this._textureToComposite=void 0,this._translucentDepthStencilTexture=void 0,this._packDepthCommand=void 0,this._accumulateCommand=void 0,this._compositeCommand=void 0,this._copyCommand=void 0,this._clearColorCommand=new ui({color:new U(0,0,0,0),owner:this}),this._clearDepthStencilCommand=new ui({depth:1,stencil:0,owner:this}),this._supported=e.depthTexture,this._viewport=new nt,this._rsDepth=void 0,this._rsAccumulate=void 0,this._rsComp=void 0,this._useScissorTest=void 0,this._scissorRectangle=void 0,this._hasTranslucentDepth=!1,this._frustumsDrawn=0}Object.defineProperties(aT.prototype,{hasTranslucentDepth:{get:function(){return this._hasTranslucentDepth}}});function EAe(e){e._textureToComposite=void 0,e._translucentDepthStencilTexture=e._translucentDepthStencilTexture&&!e._translucentDepthStencilTexture.isDestroyed()&&e._translucentDepthStencilTexture.destroy()}function AAe(e){e._drawClassificationFBO.destroy(),e._accumulationFBO.destroy(),e._packFBO.destroy()}function nVt(e,t,n,i){EAe(e),e._translucentDepthStencilTexture=new vt({context:t,width:n,height:i,pixelFormat:Qe.DEPTH_STENCIL,pixelDatatype:Ue.UNSIGNED_INT_24_8,sampler:Ot.NEAREST})}function iVt(e,t,n,i){AAe(e),e._drawClassificationFBO.setDepthStencilTexture(e._translucentDepthStencilTexture),e._drawClassificationFBO.update(t,n,i),e._accumulationFBO.setDepthStencilTexture(e._translucentDepthStencilTexture),e._accumulationFBO.update(t,n,i),e._packFBO.update(t,n,i)}function oVt(e,t,n,i){if(!e.isSupported())return;e._opaqueDepthStencilTexture=i;let o=e._opaqueDepthStencilTexture.width,r=e._opaqueDepthStencilTexture.height;e._drawClassificationFBO.isDirty(o,r)&&(nVt(e,t,o,r),iVt(e,t,o,r));let s,a;if(l(e._packDepthCommand)||(s=new Je({sources:[Nv]}),a={u_opaqueDepthTexture:function(){return e._opaqueDepthStencilTexture},u_translucentDepthTexture:function(){return e._translucentDepthStencilTexture}},e._packDepthCommand=t.createViewportQuadCommand(s,{uniformMap:a,owner:e})),!l(e._compositeCommand)){s=new Je({sources:[WZ]}),a={colorTexture:function(){return e._textureToComposite}},tVt&&(s.defines=["DEBUG_SHOW_DEPTH"],a.u_packedTranslucentDepth=function(){return e._packFBO.getColorTexture()}),e._compositeCommand=t.createViewportQuadCommand(s,{uniformMap:a,owner:e});let u=e._compositeCommand,m=u.shaderProgram,p=t.shaderCache.createDerivedShaderProgram(m,"pick",{vertexShaderSource:m.vertexShaderSource,fragmentShaderSource:new Je({sources:s.sources,defines:["PICK"]}),attributeLocations:m._attributeLocations}),b=lt.shallowClone(u);b.shaderProgram=p,u.derivedCommands.pick=b}l(e._copyCommand)||(s=new Je({sources:[WZ]}),a={colorTexture:function(){return e._drawClassificationFBO.getColorTexture()}},e._copyCommand=t.createViewportQuadCommand(s,{uniformMap:a,owner:e})),l(e._accumulateCommand)||(s=new Je({sources:[WZ]}),a={colorTexture:function(){return e._drawClassificationFBO.getColorTexture()}},e._accumulateCommand=t.createViewportQuadCommand(s,{uniformMap:a,owner:e})),e._viewport.width=o,e._viewport.height=r;let c=!nt.equals(e._viewport,n.viewport),d=c!==e._useScissorTest;e._useScissorTest=c,nt.equals(e._scissorRectangle,n.viewport)||(e._scissorRectangle=nt.clone(n.viewport,e._scissorRectangle),d=!0),(!l(e._rsDepth)||!nt.equals(e._viewport,e._rsDepth.viewport)||d)&&(e._rsDepth=ze.fromCache({viewport:e._viewport,scissorTest:{enabled:e._useScissorTest,rectangle:e._scissorRectangle}})),l(e._packDepthCommand)&&(e._packDepthCommand.renderState=e._rsDepth),(!l(e._rsAccumulate)||!nt.equals(e._viewport,e._rsAccumulate.viewport)||d)&&(e._rsAccumulate=ze.fromCache({viewport:e._viewport,scissorTest:{enabled:e._useScissorTest,rectangle:e._scissorRectangle},stencilTest:{enabled:!0,frontFunction:ni.EQUAL,reference:Jt.CESIUM_3D_TILE_MASK}})),l(e._accumulateCommand)&&(e._accumulateCommand.renderState=e._rsAccumulate),(!l(e._rsComp)||!nt.equals(e._viewport,e._rsComp.viewport)||d)&&(e._rsComp=ze.fromCache({viewport:e._viewport,scissorTest:{enabled:e._useScissorTest,rectangle:e._scissorRectangle},blending:on.ALPHA_BLEND})),l(e._compositeCommand)&&(e._compositeCommand.renderState=e._rsComp,e._compositeCommand.derivedCommands.pick.renderState=e._rsComp)}aT.prototype.executeTranslucentCommands=function(e,t,n,i,o){let r=e.frameState.useLogDepth,s=e.context,a=n.framebuffer;for(let c=0;c<i.length;++c){let d=i[c];if(d=r?d.derivedCommands.logDepth.command:d,d.depthForTranslucentClassification){this._hasTranslucentDepth=!0;break}}if(this._hasTranslucentDepth){oVt(this,s,n,o),n.framebuffer=this._drawClassificationFBO.framebuffer,this._clearDepthStencilCommand.execute(s,n);for(let c=0;c<i.length;++c){let d=i[c];if(d=r?d.derivedCommands.logDepth.command:d,!d.depthForTranslucentClassification)continue;let u=d.derivedCommands.depth.depthOnlyCommand;t(u,e,n)}this._frustumsDrawn+=this._hasTranslucentDepth?1:0,this._hasTranslucentDepth&&(n.framebuffer=this._packFBO.framebuffer,this._packDepthCommand.execute(s,n)),n.framebuffer=a}};aT.prototype.executeClassificationCommands=function(e,t,n,i){if(!this._hasTranslucentDepth)return;let o=e.context,r=o.uniformState,s=n.framebuffer;n.framebuffer=this._accumulationFBO.framebuffer,this._accumulateCommand.execute(o,n),n.framebuffer=this._drawClassificationFBO.framebuffer,this._frustumsDrawn>1&&this._clearColorCommand.execute(o,n),r.updatePass(Le.CESIUM_3D_TILE_CLASSIFICATION);let a=r.globeDepthTexture;r.globeDepthTexture=this._packFBO.getColorTexture();let c=i.commands[Le.CESIUM_3D_TILE_CLASSIFICATION],d=i.indices[Le.CESIUM_3D_TILE_CLASSIFICATION];for(let u=0;u<d;++u)t(c[u],e,n);r.globeDepthTexture=a,n.framebuffer=s,this._frustumsDrawn!==1&&(n.framebuffer=this._accumulationFBO.framebuffer,this._accumulateCommand.execute(o,n),n.framebuffer=s)};aT.prototype.execute=function(e,t){if(!this._hasTranslucentDepth)return;this._frustumsDrawn===1?this._textureToComposite=this._drawClassificationFBO.getColorTexture():this._textureToComposite=this._accumulationFBO.getColorTexture(),(e.frameState.passes.pick?this._compositeCommand.derivedCommands.pick:this._compositeCommand).execute(e.context,t),rVt(this,e,t)};function rVt(e,t,n){if(!e._hasTranslucentDepth)return;let i=n.framebuffer;n.framebuffer=e._drawClassificationFBO.framebuffer,e._clearColorCommand.execute(t._context,n),n.framebuffer=i,e._frustumsDrawn>1&&(n.framebuffer=e._accumulationFBO.framebuffer,e._clearColorCommand.execute(t._context,n)),e._hasTranslucentDepth=!1,e._frustumsDrawn=0}aT.prototype.isSupported=function(){return this._supported};aT.prototype.isDestroyed=function(){return!1};aT.prototype.destroy=function(){return EAe(this),AAe(this),l(this._compositeCommand)&&(this._compositeCommand.shaderProgram=this._compositeCommand.shaderProgram&&this._compositeCommand.shaderProgram.destroy()),l(this._packDepthCommand)&&(this._packDepthCommand.shaderProgram=this._packDepthCommand.shaderProgram&&this._packDepthCommand.shaderProgram.destroy()),ue(this)};var Sw=aT;function sVt(){this.command=void 0,this.near=void 0,this.far=void 0}function Sz(e,t,n){let i=e.context,o;i.depthTexture&&(o=new bw);let r;e._useOIT&&i.depthTexture&&(r=new yw(i));let s=new oc(i);s.viewport=nt.clone(n),this.camera=t,this._cameraClone=Io.clone(t),this._cameraStartFired=!1,this._cameraMovedTime=void 0,this.viewport=n,this.passState=s,this.pickFramebuffer=new _w(i),this.snapFramebuffer=void 0,this.pickDepthFramebuffer=new Tw,this.sceneFramebuffer=new LZ,this.edgeFramebuffer=new hw,this.planarFillIdFramebuffer=new fw,this.globeDepth=o,this.globeTranslucencyFramebuffer=new gw,this.oit=r,this.translucentTileClassification=new Sw(i),this.pickDepths=[],this.frustumCommandsList=[],this.debugFrustumStatistics=void 0,this._commandExtents=[]}var Kte=new h,Jte=new h;function aVt(e,t,n){let i=Math.max(h.maximumComponent(h.abs(e.position,Kte)),h.maximumComponent(h.abs(t.position,Jte))),o=1/Math.max(1,i);return h.multiplyByScalar(e.position,o,Kte),h.multiplyByScalar(t.position,o,Jte),h.equalsEpsilon(Kte,Jte,n)&&h.equalsEpsilon(e.direction,t.direction,n)&&h.equalsEpsilon(e.up,t.up,n)&&h.equalsEpsilon(e.right,t.right,n)&&P.equalsEpsilon(e.transform,t.transform,n)&&e.frustum.equalsEpsilon(t.frustum,n)}Sz.prototype.checkForCameraUpdates=function(e){let t=this.camera,n=this._cameraClone;return aVt(t,n,W.EPSILON15)?(this._cameraStartFired&&Zn()-this._cameraMovedTime>e.cameraEventWaitTime&&(t.moveEnd.raiseEvent(),this._cameraStartFired=!1),!1):(this._cameraStartFired||(t.moveStart.raiseEvent(),this._cameraStartFired=!0),this._cameraMovedTime=Zn(),Io.clone(t,n),!0)};function cVt(e,t,n,i){let{frameState:o}=t,{camera:r,useLogDepth:s}=o,a=s?t.logarithmicDepthFarToNearRatio:t.farToNearRatio,c=t.mode===se.SCENE2D,d=t.nearToFarDistance2D;i*=1+W.EPSILON2,n=Math.min(Math.max(n,r.frustum.near),r.frustum.far),i=Math.max(Math.min(i,r.frustum.far),n);let u;c?(i=Math.min(i,r.position.z+t.nearToFarDistance2D),n=Math.min(n,i),u=Math.ceil(Math.max(1,i-n)/t.nearToFarDistance2D)):u=Math.ceil(Math.log(i/n)/Math.log(a));let{frustumCommandsList:m}=e;m.length=u;for(let p=0;p<u;++p){let b,f;c?(b=Math.min(i-d,n+p*d),f=Math.min(i,b+d)):(b=Math.max(n,Math.pow(a,p)*n),f=Math.min(i,a*b)),l(m[p])?(m[p].near=b,m[p].far=f):m[p]=new pw(b,f)}}function lVt(e,t,n){let{command:i,near:o,far:r}=n;t.debugShowFrustums&&(i.debugOverlappingFrustums=0);let{frustumCommandsList:s}=e;for(let a=0;a<s.length;++a){let c=s[a];if(o>c.far)continue;if(r<c.near)break;let d=i.pass,u=c.indices[d]++;if(c.commands[d][u]=i,t.debugShowFrustums&&(i.debugOverlappingFrustums|=1<<a),i.executeInClosestFrustum)break}if(t.debugShowFrustums){let{debugFrustumStatistics:a}=e,{debugOverlappingFrustums:c}=i,d=a.commandsInFrustums;d[c]=l(d[c])?d[c]+1:1,++a.totalCommands}t.updateDerivedCommands(i)}var GAe=new $s,dVt=new Ns;Sz.prototype.createPotentiallyVisibleSet=function(e){let{frameState:t}=e,{camera:n,commandList:i,shadowState:o}=t,{positionWC:r,directionWC:s,frustum:a}=n,c=e._computeCommandList,d=e._overlayCommandList;e.debugShowFrustums&&(this.debugFrustumStatistics={totalCommands:0,commandsInFrustums:{}});let u=this.frustumCommandsList;for(let I=0;I<u.length;++I)for(let N=0;N<Le.NUMBER_OF_PASSES;++N)u[I].indices[N]=0;c.length=0,d.length=0;let m=this._commandExtents,p=m.length,b=0,f=+Number.MAX_VALUE,y=-Number.MAX_VALUE,{shadowsEnabled:_}=o,S=+Number.MAX_VALUE,Z=-Number.MAX_VALUE,R=Number.MAX_VALUE,C=t.mode===se.SCENE3D?t.occluder:void 0,{cullingVolume:E}=t,A=GAe.planes;for(let I=0;I<5;++I)A[I]=E.planes[I];E=GAe;for(let I=0;I<i.length;++I){let N=i[I],{pass:g,boundingVolume:V}=N;if(g===Le.COMPUTE)c.push(N);else if(g===Le.OVERLAY)d.push(N);else{let G,v;if(l(V)){if(!e.isVisible(E,N,C))continue;let Y=V.computePlaneDistances(r,s,dVt);if(G=Y.start,v=Y.stop,f=Math.min(f,G),y=Math.max(y,v),_&&N.receiveShadows&&G<Ng.MAXIMUM_DISTANCE&&!(g===Le.GLOBE&&G<-100&&v>100)){let D=v-G;g!==Le.GLOBE&&G<100&&(R=Math.min(R,D)),S=Math.min(S,G),Z=Math.max(Z,v)}}else N instanceof ui?(G=a.near,v=a.far):(G=a.near,v=a.far,f=Math.min(f,G),y=Math.max(y,v));let X=m[b];l(X)||(X=m[b]=new sVt),X.command=N,X.near=G,X.far=v,b++}}_&&(S=Math.min(Math.max(S,a.near),a.far),Z=Math.max(Math.min(Z,a.far),S),o.nearPlane=S,o.farPlane=Z,o.closestObjectSize=R),cVt(this,e,f,y);for(let I=0;I<b;I++)lVt(this,e,m[I]);if(b<p)for(let I=b;I<p;I++){let N=m[I];if(!l(N.command))break;N.command=void 0}for(let I=0;I<u.length;++I){let{commands:N,indices:g}=u[I];for(let V=0;V<N.length;++V){let G=N[V];for(let v=g[V];v<G.length&&l(G[v]);++v)G[v]=void 0}}let L=u.length,{frustumSplits:F}=t;F.length=L+1;for(let I=0;I<L;++I)F[I]=u[I].near,I===L-1&&(F[I+1]=u[I].far)};Sz.prototype.destroy=function(){this.pickFramebuffer=this.pickFramebuffer&&this.pickFramebuffer.destroy(),this.snapFramebuffer=this.snapFramebuffer&&this.snapFramebuffer.destroy(),this.pickDepthFramebuffer=this.pickDepthFramebuffer&&this.pickDepthFramebuffer.destroy(),this.sceneFramebuffer=this.sceneFramebuffer&&this.sceneFramebuffer.destroy(),this.edgeFramebuffer=this.edgeFramebuffer&&this.edgeFramebuffer.destroy(),this.planarFillIdFramebuffer=this.planarFillIdFramebuffer&&this.planarFillIdFramebuffer.destroy(),this.globeDepth=this.globeDepth&&this.globeDepth.destroy(),this.oit=this.oit&&this.oit.destroy(),this.translucentTileClassification=this.translucentTileClassification&&this.translucentTileClassification.destroy(),this.globeTranslucencyFramebuffer=this.globeTranslucencyFramebuffer&&this.globeTranslucencyFramebuffer.destroy();let e=this.pickDepths;for(let t=0;t<e.length;++t)e[t].destroy()};var vZ=Sz;var WAe=.1,uVt=new ph({pass:lr.MOST_DETAILED_PRELOAD}),mVt=new ph({pass:lr.MOST_DETAILED_PICK}),Zw=new ph({pass:lr.PICK});function La(e){this._mostDetailedRayPicks=[],this.pickRenderStateCache={},this._pickPositionCache={},this._pickPositionCacheDirty=!1;let t=new nt(0,0,1,1),n=new Io(e);n.frustum=new yn({width:WAe,aspectRatio:1,near:.1}),this._pickOffscreenView=new vZ(e,n,t)}La.prototype.update=function(){this._pickPositionCacheDirty=!0};La.prototype.getPickDepth=function(e,t){let n=e.view.pickDepths,i=n[t];return l(i)||(i=new mw,n[t]=i),i};var hVt=new ps,fVt=new h,Zz=new h,pVt=new k,bVt=new P;function gVt(e,t,n,i,o){let r=e.camera,s=r.frustum,a=s.offCenterFrustum;l(a)&&(s=a);let c=2*(t.x-o.x)/o.width-1;c*=(s.right-s.left)*.5;let d=2*(o.height-t.y-o.y)/o.height-1;d*=(s.top-s.bottom)*.5;let u=P.clone(r.transform,bVt);r._setTransform(P.IDENTITY);let m=h.clone(r.position,fVt);h.multiplyByScalar(r.right,c,Zz),h.add(Zz,m,m),h.multiplyByScalar(r.up,d,Zz),h.add(Zz,m,m),r._setTransform(u),e.mode===se.SCENE2D&&h.fromElements(m.z,m.x,m.y,m);let p=s.getPixelDimensions(o.width,o.height,1,1,pVt),b=hVt;return b.right=p.x*.5,b.left=-b.right,b.top=p.y*.5,b.bottom=-b.top,b.near=s.near,b.far=s.far,b.computeCullingVolume(m,r.directionWC,r.upWC)}var yVt=new ud,xVt=new k;function TVt(e,t,n,i,o){let r=e.camera,s=r.frustum,a=s.near,c=Math.tan(s.fovy*.5),d=s.aspectRatio*c,u=2*(t.x-o.x)/o.width-1,m=2*(o.height-t.y-o.y)/o.height-1,p=u*a*d,b=m*a*c,f=s.getPixelDimensions(o.width,o.height,1,1,xVt),y=f.x*n*.5,_=f.y*i*.5,S=yVt;return S.top=b+_,S.bottom=b-_,S.right=p+y,S.left=p-y,S.near=a,S.far=s.far,S.computeCullingVolume(r.positionWC,r.directionWC,r.upWC)}function Rz(e,t,n,i,o){let r=e.camera.frustum;return r instanceof yn||r instanceof ps?gVt(e,t,n,i,o):TVt(e,t,n,i,o)}var Rw=new nt(0,0,3,3),Cz=new k,Cw=new U(0,0,0,0);function jte(e,t,n,i,o){return o.width=n??3,o.height=i??o.width,o.x=t.x-(o.width-1)*.5,o.y=e-t.y-(o.height-1)*.5,o}function Vw(e,t,n,i,o,r){let{context:s,frameState:a,defaultView:c}=e,{viewport:d,pickFramebuffer:u}=c,m=r?.framebuffer??u;e.view=c,d.x=0,d.y=0,d.width=s.drawingBufferWidth,d.height=s.drawingBufferHeight;let p=c.passState;p.viewport=nt.clone(d,p.viewport);let b=fo.transformWindowToDrawingBuffer(e,t,Cz);jte(s.drawingBufferHeight,b,i,o,n),e.jobScheduler.disableThisFrame(),e.updateFrameState(),a.cullingVolume=Rz(e,b,n.width,n.height,d),a.invertClassification=!1,a.passes.pick=!0,a.passes.snap=r?.snap??!1,a.tilesetPassState=Zw,s.uniformState.update(a),e.updateEnvironment(),p=m.begin(n,d),e.updateAndExecuteCommands(p,Cw),e.resolveFramebuffers(p)}function Ew(e){let{context:t}=e;t.endFrame()}La.prototype.pickAsync=async function(e,t,n,i,o=1){let{context:r,frameState:s,defaultView:a}=e,{pickFramebuffer:c}=a,d=Rw;Vw(e,t,d,n,i);let u;return r.webgl2?u=c.endAsync(d,s,o):(u=c.end(d,o),u=Promise.resolve(u),xt("picking-async-fallback","Fallback to synchronous picking because async operation requires WebGL2 context.")),Ew(e),u};La.prototype.pick=function(e,t,n,i,o=1){let{defaultView:r}=e,{pickFramebuffer:s}=r,a=Rw;Vw(e,t,a,n,i);let c=s.end(a,o);return Ew(e),c};La.prototype.pickVoxelCoordinate=function(e,t,n,i){let{context:o,frameState:r,defaultView:s}=e,{viewport:a,pickFramebuffer:c}=s;e.view=s,a.x=0,a.y=0,a.width=o.drawingBufferWidth,a.height=o.drawingBufferHeight;let d=s.passState;d.viewport=nt.clone(a,d.viewport);let u=fo.transformWindowToDrawingBuffer(e,t,Cz),m=jte(o.drawingBufferHeight,u,n,i,Rw);e.jobScheduler.disableThisFrame(),e.updateFrameState(),r.cullingVolume=Rz(e,u,m.width,m.height,a),r.invertClassification=!1,r.passes.pickVoxel=!0,r.tilesetPassState=Zw,o.uniformState.update(r),e.updateEnvironment(),d=c.begin(m,a),e.updateAndExecuteCommands(d,Cw),e.resolveFramebuffers(d);let p=c.readCenterPixel(m);return o.endFrame(),p};La.prototype.pickMetadata=function(e,t,n){let{context:i,frameState:o,defaultView:r}=e,{viewport:s,pickFramebuffer:a}=r;e.view=r,s.x=0,s.y=0,s.width=i.drawingBufferWidth,s.height=i.drawingBufferHeight;let c=r.passState;c.viewport=nt.clone(s,c.viewport);let d=fo.transformWindowToDrawingBuffer(e,t,Cz),u=jte(i.drawingBufferHeight,d,1,1,Rw);e.jobScheduler.disableThisFrame(),e.updateFrameState(),o.cullingVolume=Rz(e,d,u.width,u.height,s),o.invertClassification=!1,o.passes.pick=!0,o.tilesetPassState=Zw,o.pickingMetadata=!0,o.pickedMetadataInfo=n,i.uniformState.update(o),e.updateEnvironment(),c=a.begin(u,s),e.updateAndExecuteCommands(c,Cw);let m=e._environmentState.useOIT;e._environmentState.useOIT=!1,e.resolveFramebuffers(c),e._environmentState.useOIT=m;let p=a.readCenterPixel(u);return i.endFrame(),o.pickingMetadata=!1,uw.decodeMetadataValues(n.classProperty,n.metadataProperty,p)};function _Vt(e,t){let{defaultView:n,context:i,frameState:o,environmentState:r}=e,{viewport:s,pickDepthFramebuffer:a}=n;e.view=n,s.x=0,s.y=0,s.width=i.drawingBufferWidth,s.height=i.drawingBufferHeight;let c=n.passState;c.viewport=nt.clone(s,c.viewport),e.clearPasses(o.passes),o.passes.pick=!0,o.passes.depth=!0,o.cullingVolume=Rz(e,t,1,1,s),o.tilesetPassState=Zw,e.updateEnvironment(),r.renderTranslucentDepthForPick=!0,c=a.update(i,t,s),e.updateAndExecuteCommands(c,Cw),e.resolveFramebuffers(c),i.endFrame()}var SVt=new Qi,ZVt=new ud,RVt=new yn,CVt=new ps;La.prototype.pickPositionWorldCoordinates=function(e,t,n){if(!e.useDepthPicking)return;let i=t.toString();if(this._pickPositionCacheDirty)this._pickPositionCache={},this._pickPositionCacheDirty=!1;else if(this._pickPositionCache.hasOwnProperty(i))return h.clone(this._pickPositionCache[i],n);let{context:o,frameState:r,camera:s,defaultView:a}=e,{uniformState:c}=o;e.view=a;let d=fo.transformWindowToDrawingBuffer(e,t,Cz);e.pickTranslucentDepth?_Vt(e,d):(e.updateFrameState(),c.update(r),e.updateEnvironment()),d.y=e.drawingBufferHeight-d.y;let u;l(s.frustum.fov)?u=s.frustum.clone(SVt):l(s.frustum.infiniteProjectionMatrix)?u=s.frustum.clone(ZVt):l(s.frustum.width)?u=s.frustum.clone(RVt):u=s.frustum.clone(CVt);let{frustumCommandsList:m}=a,p=m.length;for(let b=0;b<p;++b){let y=this.getPickDepth(e,b).getDepth(o,d.x,d.y);if(l(y)&&y>0&&y<1){let _=m[b],S;return e.mode===se.SCENE2D?(S=s.position.z,s.position.z=S-_.near+1,u.far=Math.max(1,_.far-_.near),u.near=1,c.update(r),c.updateFrustum(u)):(u.near=_.near*(b!==0?e.opaqueFrustumNearOffset:1),u.far=_.far,c.updateFrustum(u)),n=fo.drawingBufferToWorldCoordinates(e,d,y,n),e.mode===se.SCENE2D&&(s.position.z=S,c.update(r)),this._pickPositionCache[i]=h.clone(n),n}}this._pickPositionCache[i]=void 0};var VVt=new pe;La.prototype.pickPosition=function(e,t,n){if(n=this.pickPositionWorldCoordinates(e,t,n),l(n)&&e.mode!==se.SCENE3D){h.fromElements(n.y,n.z,n.x,n);let i=e.mapProjection,o=i.ellipsoid,r=i.unproject(n,VVt);o.cartographicToCartesian(r,n)}return n};function EVt(e,t,n,i,o,r){for(let s of e){let a=s.object,c=s.position,d=s.exclude;if(l(c)&&!l(a))return n.push(s),!0;if(!l(a)||!l(a.primitive)||!d&&(n.push(s),n.length>=t))return!0;let u=a.primitive,m=!1;if(typeof u.getGeometryInstanceAttributes=="function"&&l(a.id)){let p=u.getGeometryInstanceAttributes(a.id);l(p)&&l(p.show)&&(m=!0,p.show=vn.toValue(!1,p.show),o.push(p))}a instanceof ia&&(m=!0,a.show=!1,r.push(a)),m||(u.show=!1,i.push(u))}}function vAe(e,t){let n=[],i=[],o=[],r=[];l(t)||(t=Number.MAX_VALUE);let s=e(t);for(;l(s)&&s.length>0&&!EVt(s,t,n,i,o,r);)s=e(t-n.length);for(let a=0;a<i.length;++a)i[a].show=!0;for(let a=0;a<o.length;++a){let c=o[a];c.show=vn.toValue(!0,c.show)}for(let a=0;a<r.length;++a)r[a].show=!0;return n}La.prototype.drillPick=function(e,t,n,i,o){return vAe(a=>this.pick(e,t,i,o,a).map(d=>({object:d,position:void 0,exclude:!1})),n).map(a=>a.object)};var LAe=new h,AVt=new h;function GVt(e,t,n){this.ray=e,this.width=t,this.tilesets=n,this.ready=!1;let i=this;this.promise=new Promise(o=>{i._completePick=()=>{o()}})}function FAe(e,t,n,i){let o=t.direction,r=h.mostOrthogonalAxis(o,LAe),s=h.cross(o,r,LAe),a=h.cross(o,s,AVt);return i.position=t.origin,i.direction=o,i.up=a,i.right=s,i.frustum.width=n??WAe,i.frustum.computeCullingVolume(i.positionWC,i.directionWC,i.upWC)}function LVt(e,t,n){let i=t.frameState,{ray:o,width:r,tilesets:s}=n,a=e._pickOffscreenView.camera,c=FAe(e,o,r,a),d=uVt;d.camera=a,d.cullingVolume=c;let u=!0,m=s.length;for(let p=0;p<m;++p){let b=s[p];b.show&&t.primitives.contains(b)&&(b.updateForPass(i,d),u=u&&d.ready)}return u&&n._completePick(),u}La.prototype.updateMostDetailedRayPicks=function(e){let t=this._mostDetailedRayPicks;for(let n=0;n<t.length;++n)LVt(this,e,t[n])&&t.splice(n--,1)};function IAe(e,t,n){for(let i=0;i<e.length;++i){let o=e.get(i);o.show&&(l(o.isCesium3DTileset)?(!l(t)||t.indexOf(o)===-1)&&n.push(o):o instanceof Qc&&IAe(o,t,n))}}function Vz(e,t,n,i,o,r){let s=[];if(IAe(t.primitives,i,s),s.length===0)return Promise.resolve(r());let a=new GVt(n,o,s);return e._mostDetailedRayPicks.push(a),a.promise.then(function(){return r()})}function WVt(e,t){return!l(e)||!l(t)||t.length===0?!1:t.indexOf(e)>-1||t.indexOf(e.primitive)>-1||t.indexOf(e.id)>-1}function vVt(e,t,n,i,o,r,s){let{context:a,frameState:c}=t,d=a.uniformState,u=e._pickOffscreenView;t.view=u,FAe(e,n,o,u.camera);let m=nt.clone(u.viewport,Rw),p=u.pickFramebuffer.begin(m,u.viewport);t.jobScheduler.disableThisFrame(),t.updateFrameState(),c.invertClassification=!1,c.passes.pick=!0,c.passes.offscreen=!0,s?c.tilesetPassState=mVt:c.tilesetPassState=Zw,d.update(c),t.updateEnvironment(),t.updateAndExecuteCommands(p,Cw),t.resolveFramebuffers(p);let b,f=u.pickFramebuffer.end(m,1)[0];if(t.context.depthTexture){let{frustumCommandsList:y}=u,_=y.length;for(let S=0;S<_;++S){let R=e.getPickDepth(t,S).getDepth(a,0,0);if(l(R)&&R>0&&R<1){let C=y[S],E=C.near*(S!==0?t.opaqueFrustumNearOffset:1),A=C.far,L=E+R*(A-E);b=gn.getPoint(n,L);break}}}if(t.view=t.defaultView,a.endFrame(),l(f)||l(b))return{object:f,position:b,exclude:!l(b)&&r||WVt(f,i)}}function Qte(e,t,n,i,o,r,s,a){return vAe(function(){let d=vVt(e,t,n,o,r,s,a);return d?[d]:void 0},i)}function cE(e,t,n,i,o,r,s){let a=Qte(e,t,n,1,i,o,r,s);if(a.length>0)return a[0]}function Ez(e,t){return new Promise((n,i)=>{t.then(function(o){let r=e.postRender.addEventListener(function(){r(),n(o)});e.requestRender()}).catch(function(o){i(o)})})}La.prototype.pickFromRay=function(e,t,n,i){return cE(this,e,t,n,i,!1,!1)};La.prototype.drillPickFromRay=function(e,t,n,i,o){return Qte(this,e,t,n,i,o,!1,!1)};La.prototype.pickFromRayMostDetailed=function(e,t,n,i){let o=this;return t=gn.clone(t),n=l(n)?n.slice():n,Ez(e,Vz(o,e,t,n,i,function(){return cE(o,e,t,n,i,!1,!0)}))};La.prototype.drillPickFromRayMostDetailed=function(e,t,n,i,o){let r=this;return t=gn.clone(t),i=l(i)?i.slice():i,Ez(e,Vz(r,e,t,i,o,function(){return Qte(r,e,t,n,i,o,!1,!0)}))};var FVt=new h,IVt=new h,PVt=new gn,PAe=new pe;function qte(e,t){let n=e.ellipsoid,i=Pi._defaultMaxTerrainHeight,o=n.geodeticSurfaceNormalCartographic(t,IVt),r=pe.toCartesian(t,n,FVt),s=PVt;s.origin=r,s.direction=o;let a=new gn;return gn.getPoint(s,i,a.origin),h.negate(o,a.direction),a}function XAe(e,t){let n=e.ellipsoid,i=pe.fromCartesian(t,n,PAe);return qte(e,i)}function NAe(e,t){let n=e.ellipsoid;return pe.fromCartesian(t,n,PAe).height}function XVt(e,t,n,i,o){let r=qte(t,n);return Vz(e,t,r,i,o,function(){let s=cE(e,t,r,i,o,!0,!0);if(l(s))return NAe(t,s.position)})}function NVt(e,t,n,i,o,r){let s=XAe(t,n);return Vz(e,t,s,i,o,function(){let a=cE(e,t,s,i,o,!0,!0);if(l(a))return h.clone(a.position,r)})}La.prototype.sampleHeight=function(e,t,n,i){let o=qte(e,t),r=cE(this,e,o,n,i,!0,!1);if(l(r))return NAe(e,r.position)};La.prototype.clampToHeight=function(e,t,n,i,o){let r=XAe(e,t),s=cE(this,e,r,n,i,!0,!1);if(l(s))return h.clone(s.position,o)};La.prototype.sampleHeightMostDetailed=function(e,t,n,i){n=l(n)?n.slice():n;let o=t.length,r=new Array(o);for(let s=0;s<o;++s)r[s]=XVt(this,e,t[s],n,i);return Ez(e,Promise.all(r).then(function(s){let a=s.length;for(let c=0;c<a;++c)t[c].height=s[c];return t}))};La.prototype.clampToHeightMostDetailed=function(e,t,n,i){n=l(n)?n.slice():n;let o=t.length,r=new Array(o);for(let s=0;s<o;++s)r[s]=NVt(this,e,t[s],n,i,t[s]);return Ez(e,Promise.all(r).then(function(s){let a=s.length;for(let c=0;c<a;++c)t[c]=s[c];return t}))};La.prototype.destroy=function(){this._pickOffscreenView=this._pickOffscreenView&&this._pickOffscreenView.destroy()};var Aw=La;var aoo=x(T(),1);var Pio=x(T(),1);var Xto=x(T(),1),Gw=`uniform sampler2D colorTexture; in vec2 v_textureCoordinates; #ifdef AUTO_EXPOSURE uniform sampler2D autoExposure; @@ -10592,7 +10592,7 @@ color = czm_acesTonemapping(color); color = czm_inverseGamma(color); out_FragColor = vec4(color, fragmentColor.a); } -`;var W0o=x(T(),1),w9=`precision highp float; +`;var Yto=x(T(),1),Lw=`precision highp float; uniform sampler2D randomTexture; uniform sampler2D depthTexture; uniform float intensity; @@ -10700,7 +10700,7 @@ ao = 1.0 - clamp(ao, 0.0, 1.0); ao = pow(ao, intensity); out_FragColor = vec4(vec3(ao), 1.0); } -`;var F0o=x(T(),1),k9=`uniform sampler2D colorTexture; +`;var wto=x(T(),1),Ww=`uniform sampler2D colorTexture; uniform sampler2D ambientOcclusionTexture; uniform bool ambientOcclusionOnly; in vec2 v_textureCoordinates; @@ -10710,7 +10710,7 @@ vec4 color = texture(colorTexture, v_textureCoordinates); vec4 ao = texture(ambientOcclusionTexture, v_textureCoordinates); out_FragColor = ambientOcclusionOnly ? ao : ao * color; } -`;var P0o=x(T(),1),U9=`uniform sampler2D colorTexture; +`;var Uto=x(T(),1),vw=`uniform sampler2D colorTexture; uniform float gradations; in vec2 v_textureCoordinates; void main(void) @@ -10727,7 +10727,7 @@ float darkness = luminance * gradations; darkness = (darkness - fract(darkness)) / gradations; out_FragColor = vec4(vec3(darkness), 1.0); } -`;var N0o=x(T(),1),D9=`uniform sampler2D colorTexture; +`;var Oto=x(T(),1),Fw=`uniform sampler2D colorTexture; uniform sampler2D bloomTexture; uniform bool glowOnly; in vec2 v_textureCoordinates; @@ -10743,7 +10743,7 @@ return; vec4 bloom = texture(bloomTexture, v_textureCoordinates); out_FragColor = glowOnly ? bloom : bloom + color; } -`;var M0o=x(T(),1),O9=`uniform sampler2D colorTexture; +`;var zto=x(T(),1),Iw=`uniform sampler2D colorTexture; uniform float brightness; in vec2 v_textureCoordinates; void main(void) @@ -10752,7 +10752,7 @@ vec3 rgb = texture(colorTexture, v_textureCoordinates).rgb; vec3 target = vec3(0.0); out_FragColor = vec4(mix(target, rgb, brightness), 1.0); } -`;var k0o=x(T(),1),B9=`uniform sampler2D colorTexture; +`;var Kto=x(T(),1),Pw=`uniform sampler2D colorTexture; uniform float contrast; uniform float brightness; in vec2 v_textureCoordinates; @@ -10766,7 +10766,7 @@ float factor = (259.0 * (contrast + 255.0)) / (255.0 * (259.0 - contrast)); sceneColor = factor * (sceneColor - vec3(0.5)) + vec3(0.5); out_FragColor = vec4(sceneColor, 1.0); } -`;var D0o=x(T(),1),z9=`uniform sampler2D colorTexture; +`;var jto=x(T(),1),Xw=`uniform sampler2D colorTexture; uniform sampler2D blurTexture; uniform sampler2D depthTexture; uniform float focalDistance; @@ -10801,14 +10801,14 @@ vec4 posInCamera = toEye(v_textureCoordinates, depth); float d = computeDepthBlur(-posInCamera.z); out_FragColor = mix(texture(colorTexture, v_textureCoordinates), texture(blurTexture, v_textureCoordinates), d); } -`;var B0o=x(T(),1),H9=`uniform sampler2D depthTexture; +`;var qto=x(T(),1),Nw=`uniform sampler2D depthTexture; in vec2 v_textureCoordinates; void main(void) { float depth = czm_readDepth(depthTexture, v_textureCoordinates); out_FragColor = vec4(vec3(depth), 1.0); } -`;var H0o=x(T(),1),K9=`uniform sampler2D depthTexture; +`;var eno=x(T(),1),Yw=`uniform sampler2D depthTexture; uniform float length; uniform vec4 color; in vec2 v_textureCoordinates; @@ -10858,7 +10858,7 @@ vertEdge += texture(depthTexture, v_textureCoordinates + vec2(dir * padx, pady)) float len = sqrt(horizEdge * horizEdge + vertEdge * vertEdge); out_FragColor = vec4(color.rgb, len > length ? color.a : 0.0); } -`;var J0o=x(T(),1),J9=`uniform sampler2D colorTexture; +`;var nno=x(T(),1),Mw=`uniform sampler2D colorTexture; in vec2 v_textureCoordinates; #ifdef AUTO_EXPOSURE uniform sampler2D autoExposure; @@ -10887,7 +10887,7 @@ float w = ((white * (A * white + C * B) + D * E) / (white * ( A * white + B) + D c = czm_inverseGamma(c / w); out_FragColor = vec4(c, fragmentColor.a); } -`;var Q0o=x(T(),1),j9=`uniform sampler2D colorTexture; +`;var ono=x(T(),1),ww=`uniform sampler2D colorTexture; in vec2 v_textureCoordinates; #ifdef AUTO_EXPOSURE uniform sampler2D autoExposure; @@ -10907,7 +10907,7 @@ color = czm_pbrNeutralTonemapping(color); color = czm_inverseGamma(color); out_FragColor = vec4(color, fragmentColor.a); } -`;var $0o=x(T(),1),Q9=`in vec2 v_textureCoordinates; +`;var sno=x(T(),1),kw=`in vec2 v_textureCoordinates; uniform sampler2D colorTexture; const float fxaaQualitySubpix = 0.5; const float fxaaQualityEdgeThreshold = 0.125; @@ -10925,7 +10925,7 @@ fxaaQualityEdgeThresholdMin); float alpha = texture(colorTexture, v_textureCoordinates).a; out_FragColor = vec4(color.rgb, alpha); } -`;var tbo=x(T(),1),GT=`#define SAMPLES 8 +`;var cno=x(T(),1),cT=`#define SAMPLES 8 uniform float delta; uniform float sigma; uniform float direction; @@ -10959,7 +10959,7 @@ result += texture(colorTexture, st + offset) * g.x; } out_FragColor = result; } -`;var ibo=x(T(),1),q9=`uniform sampler2D colorTexture; +`;var dno=x(T(),1),Uw=`uniform sampler2D colorTexture; uniform sampler2D dirtTexture; uniform sampler2D starTexture; uniform vec2 dirtTextureDimensions; @@ -11074,7 +11074,7 @@ result *= texture(starTexture, lensStarTexcoord) * pow(weightForLensFlare, 1.0) result += texture(colorTexture, v_textureCoordinates); out_FragColor = result; } -`;var rbo=x(T(),1),$9=`uniform sampler2D colorTexture; +`;var mno=x(T(),1),Dw=`uniform sampler2D colorTexture; uniform vec3 white; in vec2 v_textureCoordinates; #ifdef AUTO_EXPOSURE @@ -11096,7 +11096,7 @@ color = (color * (1.0 + color / white)) / (1.0 + color); color = czm_inverseGamma(color); out_FragColor = vec4(color, fragmentColor.a); } -`;var abo=x(T(),1),ek=`uniform sampler2D colorTexture; +`;var fno=x(T(),1),Ow=`uniform sampler2D colorTexture; in vec2 v_textureCoordinates; float rand(vec2 co) { @@ -11109,7 +11109,7 @@ vec3 rgb = texture(colorTexture, v_textureCoordinates).rgb; vec3 green = vec3(0.0, 1.0, 0.0); out_FragColor = vec4((noiseValue + rgb) * green, 1.0); } -`;var lbo=x(T(),1),tk=`uniform sampler2D colorTexture; +`;var bno=x(T(),1),Bw=`uniform sampler2D colorTexture; in vec2 v_textureCoordinates; #ifdef AUTO_EXPOSURE uniform sampler2D autoExposure; @@ -11130,7 +11130,7 @@ color = color / (1.0 + color); color = czm_inverseGamma(color); out_FragColor = vec4(color, fragmentColor.a); } -`;var ubo=x(T(),1),nk=`uniform sampler2D colorTexture; +`;var yno=x(T(),1),zw=`uniform sampler2D colorTexture; uniform sampler2D silhouetteTexture; in vec2 v_textureCoordinates; void main(void) @@ -11139,7 +11139,7 @@ vec4 silhouetteColor = texture(silhouetteTexture, v_textureCoordinates); vec4 color = texture(colorTexture, v_textureCoordinates); out_FragColor = mix(color, silhouetteColor, silhouetteColor.a); } -`;var Tbo=x(T(),1);function sR(){this._uniformMap=void 0,this._command=void 0,this._colorTexture=void 0,this._depthTexture=void 0,this._ready=!1,this._name="czm_autoexposure",this._logDepthChanged=void 0,this._useLogDepth=void 0,this._framebuffers=void 0,this._previousLuminance=new li,this._commands=void 0,this._clearCommand=void 0,this._minMaxLuminance=new k,this.enabled=!0,this._enabled=!0,this.minimumLuminance=.1,this.maximumLuminance=10}Object.defineProperties(sR.prototype,{ready:{get:function(){return this._ready}},name:{get:function(){return this._name}},outputTexture:{get:function(){let e=this._framebuffers;if(l(e))return e[e.length-1].getColorTexture(0)}}});function WFe(e){let t=e._framebuffers;if(!l(t))return;let n=t.length;for(let i=0;i<n;++i)t[i].destroy();e._framebuffers=void 0,e._previousLuminance.destroy(),e._previousLuminance=void 0}function yFt(e,t){WFe(e);let n=e._width,i=e._height,o=t.halfFloatingPointTexture?Ue.HALF_FLOAT:Ue.FLOAT,r=Math.ceil(Math.log(Math.max(n,i))/Math.log(3)),s=new Array(r);for(let c=0;c<r;++c)n=Math.max(Math.ceil(n/3),1),i=Math.max(Math.ceil(i/3),1),s[c]=new li,s[c].update(t,n,i,1,o);let a=s[r-1].getColorTexture(0);e._previousLuminance.update(t,a.width,a.height,1,o),e._framebuffers=s}function vFe(e){let t=e._commands;if(!l(t))return;let n=t.length;for(let i=0;i<n;++i)t[i].shaderProgram.destroy();e._commands=void 0}function xFt(e,t){let n;if(t===0)n={colorTexture:function(){return e._colorTexture},colorTextureDimensions:function(){return e._colorTexture.dimensions}};else{let i=e._framebuffers[t-1].getColorTexture(0);n={colorTexture:function(){return i},colorTextureDimensions:function(){return i.dimensions}}}return n.minMaxLuminance=function(){return e._minMaxLuminance},n.previousLuminance=function(){return e._previousLuminance.getColorTexture(0)},n}function TFt(e,t){let n=`uniform sampler2D colorTexture; +`;var Eno=x(T(),1);function FZ(){this._uniformMap=void 0,this._command=void 0,this._colorTexture=void 0,this._depthTexture=void 0,this._ready=!1,this._name="czm_autoexposure",this._logDepthChanged=void 0,this._useLogDepth=void 0,this._framebuffers=void 0,this._previousLuminance=new li,this._commands=void 0,this._clearCommand=void 0,this._minMaxLuminance=new k,this.enabled=!0,this._enabled=!0,this.minimumLuminance=.1,this.maximumLuminance=10}Object.defineProperties(FZ.prototype,{ready:{get:function(){return this._ready}},name:{get:function(){return this._name}},outputTexture:{get:function(){let e=this._framebuffers;if(l(e))return e[e.length-1].getColorTexture(0)}}});function YAe(e){let t=e._framebuffers;if(!l(t))return;let n=t.length;for(let i=0;i<n;++i)t[i].destroy();e._framebuffers=void 0,e._previousLuminance.destroy(),e._previousLuminance=void 0}function YVt(e,t){YAe(e);let n=e._width,i=e._height,o=t.halfFloatingPointTexture?Ue.HALF_FLOAT:Ue.FLOAT,r=Math.ceil(Math.log(Math.max(n,i))/Math.log(3)),s=new Array(r);for(let c=0;c<r;++c)n=Math.max(Math.ceil(n/3),1),i=Math.max(Math.ceil(i/3),1),s[c]=new li,s[c].update(t,n,i,1,o);let a=s[r-1].getColorTexture(0);e._previousLuminance.update(t,a.width,a.height,1,o),e._framebuffers=s}function MAe(e){let t=e._commands;if(!l(t))return;let n=t.length;for(let i=0;i<n;++i)t[i].shaderProgram.destroy();e._commands=void 0}function MVt(e,t){let n;if(t===0)n={colorTexture:function(){return e._colorTexture},colorTextureDimensions:function(){return e._colorTexture.dimensions}};else{let i=e._framebuffers[t-1].getColorTexture(0);n={colorTexture:function(){return i},colorTextureDimensions:function(){return i.dimensions}}}return n.minMaxLuminance=function(){return e._minMaxLuminance},n.previousLuminance=function(){return e._previousLuminance.getColorTexture(0)},n}function wVt(e,t){let n=`uniform sampler2D colorTexture; in vec2 v_textureCoordinates; float sampleTexture(vec2 offset) { `;return e===0?n+=` vec4 color = texture(colorTexture, v_textureCoordinates + offset); @@ -11176,7 +11176,7 @@ void main() { color = clamp(color, minMaxLuminance.x, minMaxLuminance.y); `),n+=` out_FragColor = vec4(color); } -`,n}function _Ft(e,t){vFe(e);let n=e._framebuffers,i=n.length,o=new Array(i);for(let r=0;r<i;++r)o[r]=t.createViewportQuadCommand(TFt(r,i),{framebuffer:n[r].framebuffer,uniformMap:xFt(e,r)});e._commands=o}sR.prototype.clear=function(e){let t=this._framebuffers;if(!l(t))return;let n=this._clearCommand;l(n)||(n=this._clearCommand=new ui({color:new U(0,0,0,0),framebuffer:void 0}));let i=t.length;for(let o=0;o<i;++o)t[o].clear(e,n)};sR.prototype.update=function(e){let t=e.drawingBufferWidth,n=e.drawingBufferHeight;(t!==this._width||n!==this._height)&&(this._width=t,this._height=n,yFt(this,e),_Ft(this,e),this._ready||(this._ready=!0)),this._minMaxLuminance.x=this.minimumLuminance,this._minMaxLuminance.y=this.maximumLuminance;let i=this._framebuffers,o=i[i.length-1];i[i.length-1]=this._previousLuminance,this._commands[this._commands.length-1].framebuffer=this._previousLuminance.framebuffer,this._previousLuminance=o};sR.prototype.execute=function(e,t){this._colorTexture=t;let n=this._commands;if(!l(n))return;let i=n.length;for(let o=0;o<i;++o)n[o].execute(e)};sR.prototype.isDestroyed=function(){return!1};sR.prototype.destroy=function(){return WFe(this),vFe(this),ue(this)};var ik=sR;var Bbo=x(T(),1);var Sbo=x(T(),1),SFt={NEAREST:0,LINEAR:1},sm=SFt;function ny(e){e=e??B.EMPTY_OBJECT;let{name:t=Qn(),fragmentShader:n,uniforms:i,textureScale:o=1,forcePowerOfTwo:r=!1,sampleMode:s=sm.NEAREST,pixelFormat:a=Qe.RGBA,pixelDatatype:c=Ue.UNSIGNED_BYTE,clearColor:d=U.BLACK,scissorRectangle:u}=e;this._fragmentShader=n,this._uniforms=i,this._textureScale=o,this._forcePowerOfTwo=r,this._sampleMode=s,this._pixelFormat=a,this._pixelDatatype=c,this._clearColor=d,this._uniformMap=void 0,this._command=void 0,this._colorTexture=void 0,this._depthTexture=void 0,this._idTexture=void 0,this._actualUniforms={},this._dirtyUniforms=[],this._texturesToRelease=[],this._texturesToCreate=[],this._texturePromise=void 0;let m=new oc;m.scissorTest={enabled:!0,rectangle:l(u)?nt.clone(u):new nt},this._passState=m,this._ready=!1,this._name=t,this._logDepthChanged=void 0,this._useLogDepth=void 0,this._selectedIdTexture=void 0,this._selected=void 0,this._selectedShadow=void 0,this._parentSelected=void 0,this._parentSelectedShadow=void 0,this._combinedSelected=void 0,this._combinedSelectedShadow=void 0,this._selectedLength=0,this._parentSelectedLength=0,this._selectedDirty=!0,this._textureCache=void 0,this._index=void 0,this.enabled=!0,this._enabled=!0}Object.defineProperties(ny.prototype,{ready:{get:function(){return this._ready}},name:{get:function(){return this._name}},fragmentShader:{get:function(){return this._fragmentShader}},uniforms:{get:function(){return this._uniforms}},textureScale:{get:function(){return this._textureScale}},forcePowerOfTwo:{get:function(){return this._forcePowerOfTwo}},sampleMode:{get:function(){return this._sampleMode}},pixelFormat:{get:function(){return this._pixelFormat}},pixelDatatype:{get:function(){return this._pixelDatatype}},clearColor:{get:function(){return this._clearColor}},scissorRectangle:{get:function(){return this._passState.scissorTest.rectangle}},outputTexture:{get:function(){if(l(this._textureCache)){let e=this._textureCache.getFramebuffer(this._name);if(l(e))return e.getColorTexture(0)}}},selected:{get:function(){return this._selected},set:function(e){this._selected=e}},parentSelected:{get:function(){return this._parentSelected},set:function(e){this._parentSelected=e}}});var ZFt=/uniform\s+sampler2D\s+depthTexture/g;ny.prototype._isSupported=function(e){return!ZFt.test(this._fragmentShader)||e.depthTexture};function RFt(e,t,n){let i=t[n];return(typeof i=="string"||i instanceof HTMLCanvasElement||i instanceof HTMLImageElement||i instanceof HTMLVideoElement||i instanceof ImageData)&&e._dirtyUniforms.push(n),{get:function(){return t[n]},set:function(o){let r=t[n];t[n]=o;let s=e._actualUniforms,a=s[n];l(a)&&a!==r&&a instanceof vt&&!l(e._textureCache.getStageByName(n))&&(e._texturesToRelease.push(a),delete s[n],delete s[`${n}Dimensions`]),r instanceof vt&&e._texturesToRelease.push(r),typeof o=="string"||o instanceof HTMLCanvasElement||o instanceof HTMLImageElement||o instanceof HTMLVideoElement||o instanceof ImageData?e._dirtyUniforms.push(n):s[n]=o}}}function CFt(e,t){return function(){let n=e._actualUniforms[t];return typeof n=="function"?n():n}}function VFt(e,t){return function(){let n=e[t]();if(l(n))return n.dimensions}}function EFt(e){if(l(e._uniformMap))return;let t={},n={},i=e._uniforms,o=e._actualUniforms;for(let r in i){if(!i.hasOwnProperty(r))continue;typeof i[r]!="function"?(t[r]=CFt(e,r),n[r]=RFt(e,i,r)):(t[r]=i[r],n[r]=i[r]),o[r]=i[r];let s=t[r]();(typeof s=="string"||s instanceof vt||s instanceof HTMLImageElement||s instanceof HTMLCanvasElement||s instanceof HTMLVideoElement)&&(t[`${r}Dimensions`]=VFt(t,r))}e._uniforms={},Object.defineProperties(e._uniforms,n),e._uniformMap=It(t,{colorTexture:function(){return e._colorTexture},colorTextureDimensions:function(){return e._colorTexture.dimensions},depthTexture:function(){return e._depthTexture},depthTextureDimensions:function(){return e._depthTexture.dimensions},czm_idTexture:function(){return e._idTexture},czm_selectedIdTexture:function(){return e._selectedIdTexture},czm_selectedIdTextureStep:function(){return 1/e._selectedIdTexture.width}})}function AFt(e,t){return e=e.replace(/in\s+vec2\s+v_textureCoordinates;/g,""),`#define CZM_SELECTED_FEATURE +`,n}function kVt(e,t){MAe(e);let n=e._framebuffers,i=n.length,o=new Array(i);for(let r=0;r<i;++r)o[r]=t.createViewportQuadCommand(wVt(r,i),{framebuffer:n[r].framebuffer,uniformMap:MVt(e,r)});e._commands=o}FZ.prototype.clear=function(e){let t=this._framebuffers;if(!l(t))return;let n=this._clearCommand;l(n)||(n=this._clearCommand=new ui({color:new U(0,0,0,0),framebuffer:void 0}));let i=t.length;for(let o=0;o<i;++o)t[o].clear(e,n)};FZ.prototype.update=function(e){let t=e.drawingBufferWidth,n=e.drawingBufferHeight;(t!==this._width||n!==this._height)&&(this._width=t,this._height=n,YVt(this,e),kVt(this,e),this._ready||(this._ready=!0)),this._minMaxLuminance.x=this.minimumLuminance,this._minMaxLuminance.y=this.maximumLuminance;let i=this._framebuffers,o=i[i.length-1];i[i.length-1]=this._previousLuminance,this._commands[this._commands.length-1].framebuffer=this._previousLuminance.framebuffer,this._previousLuminance=o};FZ.prototype.execute=function(e,t){this._colorTexture=t;let n=this._commands;if(!l(n))return;let i=n.length;for(let o=0;o<i;++o)n[o].execute(e)};FZ.prototype.isDestroyed=function(){return!1};FZ.prototype.destroy=function(){return YAe(this),MAe(this),ue(this)};var Hw=FZ;var qno=x(T(),1);var Gno=x(T(),1),UVt={NEAREST:0,LINEAR:1},qu=UVt;function Yg(e){e=e??B.EMPTY_OBJECT;let{name:t=Qn(),fragmentShader:n,uniforms:i,textureScale:o=1,forcePowerOfTwo:r=!1,sampleMode:s=qu.NEAREST,pixelFormat:a=Qe.RGBA,pixelDatatype:c=Ue.UNSIGNED_BYTE,clearColor:d=U.BLACK,scissorRectangle:u}=e;this._fragmentShader=n,this._uniforms=i,this._textureScale=o,this._forcePowerOfTwo=r,this._sampleMode=s,this._pixelFormat=a,this._pixelDatatype=c,this._clearColor=d,this._uniformMap=void 0,this._command=void 0,this._colorTexture=void 0,this._depthTexture=void 0,this._idTexture=void 0,this._actualUniforms={},this._dirtyUniforms=[],this._texturesToRelease=[],this._texturesToCreate=[],this._texturePromise=void 0;let m=new oc;m.scissorTest={enabled:!0,rectangle:l(u)?nt.clone(u):new nt},this._passState=m,this._ready=!1,this._name=t,this._logDepthChanged=void 0,this._useLogDepth=void 0,this._selectedIdTexture=void 0,this._selected=void 0,this._selectedShadow=void 0,this._parentSelected=void 0,this._parentSelectedShadow=void 0,this._combinedSelected=void 0,this._combinedSelectedShadow=void 0,this._selectedLength=0,this._parentSelectedLength=0,this._selectedDirty=!0,this._textureCache=void 0,this._index=void 0,this.enabled=!0,this._enabled=!0}Object.defineProperties(Yg.prototype,{ready:{get:function(){return this._ready}},name:{get:function(){return this._name}},fragmentShader:{get:function(){return this._fragmentShader}},uniforms:{get:function(){return this._uniforms}},textureScale:{get:function(){return this._textureScale}},forcePowerOfTwo:{get:function(){return this._forcePowerOfTwo}},sampleMode:{get:function(){return this._sampleMode}},pixelFormat:{get:function(){return this._pixelFormat}},pixelDatatype:{get:function(){return this._pixelDatatype}},clearColor:{get:function(){return this._clearColor}},scissorRectangle:{get:function(){return this._passState.scissorTest.rectangle}},outputTexture:{get:function(){if(l(this._textureCache)){let e=this._textureCache.getFramebuffer(this._name);if(l(e))return e.getColorTexture(0)}}},selected:{get:function(){return this._selected},set:function(e){this._selected=e}},parentSelected:{get:function(){return this._parentSelected},set:function(e){this._parentSelected=e}}});var DVt=/uniform\s+sampler2D\s+depthTexture/g;Yg.prototype._isSupported=function(e){return!DVt.test(this._fragmentShader)||e.depthTexture};function OVt(e,t,n){let i=t[n];return(typeof i=="string"||i instanceof HTMLCanvasElement||i instanceof HTMLImageElement||i instanceof HTMLVideoElement||i instanceof ImageData)&&e._dirtyUniforms.push(n),{get:function(){return t[n]},set:function(o){let r=t[n];t[n]=o;let s=e._actualUniforms,a=s[n];l(a)&&a!==r&&a instanceof vt&&!l(e._textureCache.getStageByName(n))&&(e._texturesToRelease.push(a),delete s[n],delete s[`${n}Dimensions`]),r instanceof vt&&e._texturesToRelease.push(r),typeof o=="string"||o instanceof HTMLCanvasElement||o instanceof HTMLImageElement||o instanceof HTMLVideoElement||o instanceof ImageData?e._dirtyUniforms.push(n):s[n]=o}}}function BVt(e,t){return function(){let n=e._actualUniforms[t];return typeof n=="function"?n():n}}function zVt(e,t){return function(){let n=e[t]();if(l(n))return n.dimensions}}function HVt(e){if(l(e._uniformMap))return;let t={},n={},i=e._uniforms,o=e._actualUniforms;for(let r in i){if(!i.hasOwnProperty(r))continue;typeof i[r]!="function"?(t[r]=BVt(e,r),n[r]=OVt(e,i,r)):(t[r]=i[r],n[r]=i[r]),o[r]=i[r];let s=t[r]();(typeof s=="string"||s instanceof vt||s instanceof HTMLImageElement||s instanceof HTMLCanvasElement||s instanceof HTMLVideoElement)&&(t[`${r}Dimensions`]=zVt(t,r))}e._uniforms={},Object.defineProperties(e._uniforms,n),e._uniformMap=It(t,{colorTexture:function(){return e._colorTexture},colorTextureDimensions:function(){return e._colorTexture.dimensions},depthTexture:function(){return e._depthTexture},depthTextureDimensions:function(){return e._depthTexture.dimensions},czm_idTexture:function(){return e._idTexture},czm_selectedIdTexture:function(){return e._selectedIdTexture},czm_selectedIdTextureStep:function(){return 1/e._selectedIdTexture.width}})}function KVt(e,t){return e=e.replace(/in\s+vec2\s+v_textureCoordinates;/g,""),`#define CZM_SELECTED_FEATURE uniform sampler2D czm_idTexture; uniform sampler2D czm_selectedIdTexture; uniform float czm_selectedIdTextureStep; @@ -11200,8 +11200,8 @@ bool czm_selected() return czm_selected(vec2(0.0)); } -${e}`}function GFt(e,t){if(l(e._command)&&!e._logDepthChanged&&!e._selectedDirty)return;let n=e._fragmentShader;if(l(e._selectedIdTexture)){let o=e._selectedIdTexture.width;n=AFt(n,o)}let i=new Je({defines:[e._useLogDepth?"LOG_DEPTH":""],sources:[n]});e._command=t.createViewportQuadCommand(i,{uniformMap:e._uniformMap,owner:e})}function LFt(e){let t=e._sampleMode,n,i;t===sm.LINEAR?(n=Ht.LINEAR,i=$n.LINEAR):(n=Ht.NEAREST,i=$n.NEAREST);let o=e._sampler;(!l(o)||o.minificationFilter!==n||o.magnificationFilter!==i)&&(e._sampler=new Ot({wrapS:pn.CLAMP_TO_EDGE,wrapT:pn.CLAMP_TO_EDGE,minificationFilter:n,magnificationFilter:i}))}function WFt(e,t){return function(n){e._texturesToCreate.push({name:t,source:n})}}function vFt(e,t){return function(){return e._textureCache.getOutputTexture(t)}}function FFt(e,t){let n=e._texturesToRelease;for(let a=0;a<n.length;++a){let c=n[a];l(c)&&c.destroy()}n.length=0;let i=e._texturesToCreate;for(let a=0;a<i.length;++a){let{name:c,source:d}=i[a];e._actualUniforms[c]=new vt({context:t,source:d})}i.length=0;let o=e._dirtyUniforms;if(o.length===0&&!l(e._texturePromise)){e._ready=!0;return}if(o.length===0||l(e._texturePromise))return;let r=e._uniforms,s=[];for(let a=0;a<o.length;++a){let c=o[a],d=r[c],u=e._textureCache.getStageByName(d);if(l(u))e._actualUniforms[c]=vFt(e,d);else if(typeof d=="string"){let m=new ve({url:d});s.push(m.fetchImage().then(WFt(e,c)))}else e._texturesToCreate.push({name:c,source:d})}o.length=0,s.length>0?(e._ready=!1,e._texturePromise=Promise.all(s).then(function(){e._ready=!0,e._texturePromise=void 0})):e._ready=!0}function FFe(e){l(e._command)&&(e._command.shaderProgram=e._command.shaderProgram&&e._command.shaderProgram.destroy(),e._command=void 0),e._selectedIdTexture=e._selectedIdTexture&&e._selectedIdTexture.destroy();let t=e._textureCache;if(!l(t))return;let n=e._uniforms,i=e._actualUniforms;for(let o in i){if(!i.hasOwnProperty(o))continue;let r=i[o];r instanceof vt&&(l(t.getStageByName(n[o]))||r.destroy(),e._dirtyUniforms.push(o))}}function IFt(e){let t=l(e._selected)?e._selected.length:0,n=l(e._parentSelected)?e._parentSelected:0,i=e._selected!==e._selectedShadow||t!==e._selectedLength||e._parentSelected!==e._parentSelectedShadow||n!==e._parentSelectedLength;if(l(e._selected)&&l(e._parentSelected)?e._combinedSelected=e._selected.concat(e._parentSelected):l(e._parentSelected)?e._combinedSelected=e._parentSelected:e._combinedSelected=e._selected,!i&&l(e._combinedSelected)){if(!l(e._combinedSelectedShadow))return!0;for(let o=0;o<e._combinedSelected.length;++o)if(e._combinedSelected[o]!==e._combinedSelectedShadow[o])return!0}return i}function PFt(e,t){if(!e._selectedDirty)return;e._selectedIdTexture=e._selectedIdTexture&&e._selectedIdTexture.destroy(),e._selectedIdTexture=void 0;let n=e._combinedSelected;if(!l(n))return;let i=0;for(let c=0;c<n.length;++c){let d=n[c];l(d.pickIds)?i+=d.pickIds.length:l(d.pickId)&&++i}let o=wt.maximumTextureSize;if(i>o&&(ny._oneTimeWarning("postProcessStageSelectedTextureSize",`The number of selected feature ids (${i}) exceeds the maximum texture size (${o}). Features beyond the limit will not have the post-process effect applied.`),i=o),n.length===0||i===0){let c=new Uint8Array([255,255,255,255]);e._selectedIdTexture=new vt({context:t,pixelFormat:Qe.RGBA,pixelDatatype:Ue.UNSIGNED_BYTE,source:{arrayBufferView:c,width:1,height:1},sampler:Ot.NEAREST});return}let r=0,s=i*4,a=new Uint8Array(s);for(let c=0;c<n.length&&r<s;++c){let d=n[c];if(l(d.pickIds)){let u=d.pickIds,m=u.length;for(let p=0;p<m&&r<s;++p){let b=u[p].color;a[r]=U.floatToByte(b.red),a[r+1]=U.floatToByte(b.green),a[r+2]=U.floatToByte(b.blue),a[r+3]=U.floatToByte(b.alpha),r+=4}}else if(l(d.pickId)){let u=d.pickId.color;a[r]=U.floatToByte(u.red),a[r+1]=U.floatToByte(u.green),a[r+2]=U.floatToByte(u.blue),a[r+3]=U.floatToByte(u.alpha),r+=4}}e._selectedIdTexture=new vt({context:t,pixelFormat:Qe.RGBA,pixelDatatype:Ue.UNSIGNED_BYTE,source:{arrayBufferView:a,width:i,height:1},sampler:Ot.NEAREST})}ny.prototype.update=function(e,t){if(this.enabled!==this._enabled&&!this.enabled&&FFe(this),this._enabled=this.enabled,!this._enabled||(this._logDepthChanged=t!==this._useLogDepth,this._useLogDepth=t,this._selectedDirty=IFt(this),this._selectedShadow=this._selected,this._parentSelectedShadow=this._parentSelected,this._combinedSelectedShadow=this._combinedSelected,this._selectedLength=l(this._selected)?this._selected.length:0,this._parentSelectedLength=l(this._parentSelected)?this._parentSelected.length:0,PFt(this,e),EFt(this),FFt(this,e),GFt(this,e),LFt(this),this._selectedDirty=!1,!this._ready))return;let n=this._textureCache.getFramebuffer(this._name);if(this._command.framebuffer=n,!l(n))return;let i=n.getColorTexture(0),o;(i.width!==e.drawingBufferWidth||i.height!==e.drawingBufferHeight)&&(o=this._renderState,(!l(o)||i.width!==o.viewport.width||i.height!==o.viewport.height)&&(this._renderState=ze.fromCache({viewport:new nt(0,0,i.width,i.height)}))),this._command.renderState=o};ny.prototype.execute=function(e,t,n,i){if(!l(this._command)||!l(this._command.framebuffer)||!this._ready||!this._enabled)return;this._colorTexture=t,this._depthTexture=n,this._idTexture=i,Ot.equals(this._colorTexture.sampler,this._sampler)||(this._colorTexture.sampler=this._sampler);let o=this.scissorRectangle.width>0&&this.scissorRectangle.height>0?this._passState:void 0;l(o)&&(o.context=e),this._command.execute(e,o)};ny.prototype.isDestroyed=function(){return!1};ny.prototype.destroy=function(){return FFe(this),ue(this)};ny._oneTimeWarning=xt;var Uo=ny;var Qbo=x(T(),1);function aR(e){e=e??B.EMPTY_OBJECT,this._stages=e.stages,this._inputPreviousStageTexture=e.inputPreviousStageTexture??!0;let t=e.name;l(t)||(t=Qn()),this._name=t,this._uniforms=e.uniforms,this._textureCache=void 0,this._index=void 0,this._selected=void 0,this._selectedShadow=void 0,this._parentSelected=void 0,this._parentSelectedShadow=void 0,this._combinedSelected=void 0,this._combinedSelectedShadow=void 0,this._selectedLength=0,this._parentSelectedLength=0,this._selectedDirty=!0}Object.defineProperties(aR.prototype,{ready:{get:function(){let e=this._stages,t=e.length;for(let n=0;n<t;++n)if(!e[n].ready)return!1;return!0}},name:{get:function(){return this._name}},enabled:{get:function(){return this._stages[0].enabled},set:function(e){let t=this._stages,n=t.length;for(let i=0;i<n;++i)t[i].enabled=e}},uniforms:{get:function(){return this._uniforms}},inputPreviousStageTexture:{get:function(){return this._inputPreviousStageTexture}},length:{get:function(){return this._stages.length}},selected:{get:function(){return this._selected},set:function(e){this._selected=e}},parentSelected:{get:function(){return this._parentSelected},set:function(e){this._parentSelected=e}}});aR.prototype._isSupported=function(e){let t=this._stages,n=t.length;for(let i=0;i<n;++i)if(!t[i]._isSupported(e))return!1;return!0};aR.prototype.get=function(e){return this._stages[e]};function XFt(e){let t=l(e._selected)?e._selected.length:0,n=l(e._parentSelected)?e._parentSelected:0,i=e._selected!==e._selectedShadow||t!==e._selectedLength;if(i=i||e._parentSelected!==e._parentSelectedShadow||n!==e._parentSelectedLength,l(e._selected)&&l(e._parentSelected)?e._combinedSelected=e._selected.concat(e._parentSelected):l(e._parentSelected)?e._combinedSelected=e._parentSelected:e._combinedSelected=e._selected,!i&&l(e._combinedSelected)){if(!l(e._combinedSelectedShadow))return!0;t=e._combinedSelected.length;for(let o=0;o<t;++o)if(e._combinedSelected[o]!==e._combinedSelectedShadow[o])return!0}return i}aR.prototype.update=function(e,t){this._selectedDirty=XFt(this),this._selectedShadow=this._selected,this._parentSelectedShadow=this._parentSelected,this._combinedSelectedShadow=this._combinedSelected,this._selectedLength=l(this._selected)?this._selected.length:0,this._parentSelectedLength=l(this._parentSelected)?this._parentSelected.length:0;let n=this._stages,i=n.length;for(let o=0;o<i;++o){let r=n[o];this._selectedDirty&&(r.parentSelected=this._combinedSelected),r.update(e,t)}};aR.prototype.isDestroyed=function(){return!1};aR.prototype.destroy=function(){let e=this._stages,t=e.length;for(let n=0;n<t;++n)e[n].destroy();return ue(this)};var cu=aR;var ls={};function gre(e){let o=`#define USE_STEP_SIZE -${GT}`,r=new Uo({name:`${e}_x_direction`,fragmentShader:o,uniforms:{delta:1,sigma:2,stepSize:1,direction:0},sampleMode:sm.LINEAR}),s=new Uo({name:`${e}_y_direction`,fragmentShader:o,uniforms:{delta:1,sigma:2,stepSize:1,direction:1},sampleMode:sm.LINEAR}),a={};return Object.defineProperties(a,{delta:{get:function(){return r.uniforms.delta},set:function(c){let d=r.uniforms,u=s.uniforms;d.delta=u.delta=c}},sigma:{get:function(){return r.uniforms.sigma},set:function(c){let d=r.uniforms,u=s.uniforms;d.sigma=u.sigma=c}},stepSize:{get:function(){return r.uniforms.stepSize},set:function(c){let d=r.uniforms,u=s.uniforms;d.stepSize=u.stepSize=c}}}),new cu({name:e,stages:[r,s],uniforms:a})}ls.createBlurStage=function(){return gre("czm_blur")};ls.createDepthOfFieldStage=function(){let e=gre("czm_depth_of_field_blur"),t=new Uo({name:"czm_depth_of_field_composite",fragmentShader:z9,uniforms:{focalDistance:5,blurTexture:e.name}}),n={};return Object.defineProperties(n,{focalDistance:{get:function(){return t.uniforms.focalDistance},set:function(i){t.uniforms.focalDistance=i}},delta:{get:function(){return e.uniforms.delta},set:function(i){e.uniforms.delta=i}},sigma:{get:function(){return e.uniforms.sigma},set:function(i){e.uniforms.sigma=i}},stepSize:{get:function(){return e.uniforms.stepSize},set:function(i){e.uniforms.stepSize=i}}}),new cu({name:"czm_depth_of_field",stages:[e,t],inputPreviousStageTexture:!1,uniforms:n})};ls.isDepthOfFieldSupported=function(e){return e.context.depthTexture};ls.createEdgeDetectionStage=function(){let e=Qn();return new Uo({name:`czm_edge_detection_${e}`,fragmentShader:K9,uniforms:{length:.25,color:U.clone(U.BLACK)}})};ls.isEdgeDetectionSupported=function(e){return e.context.depthTexture};function NFt(e){if(!l(e))return ls.createEdgeDetectionStage();let t=new cu({name:"czm_edge_detection_multiple",stages:e,inputPreviousStageTexture:!1}),n={},i="",o="";for(let a=0;a<e.length;++a)i+=`uniform sampler2D edgeTexture${a}; +${e}`}function JVt(e,t){if(l(e._command)&&!e._logDepthChanged&&!e._selectedDirty)return;let n=e._fragmentShader;if(l(e._selectedIdTexture)){let o=e._selectedIdTexture.width;n=KVt(n,o)}let i=new Je({defines:[e._useLogDepth?"LOG_DEPTH":""],sources:[n]});e._command=t.createViewportQuadCommand(i,{uniformMap:e._uniformMap,owner:e})}function jVt(e){let t=e._sampleMode,n,i;t===qu.LINEAR?(n=Ht.LINEAR,i=$n.LINEAR):(n=Ht.NEAREST,i=$n.NEAREST);let o=e._sampler;(!l(o)||o.minificationFilter!==n||o.magnificationFilter!==i)&&(e._sampler=new Ot({wrapS:pn.CLAMP_TO_EDGE,wrapT:pn.CLAMP_TO_EDGE,minificationFilter:n,magnificationFilter:i}))}function QVt(e,t){return function(n){e._texturesToCreate.push({name:t,source:n})}}function qVt(e,t){return function(){return e._textureCache.getOutputTexture(t)}}function $Vt(e,t){let n=e._texturesToRelease;for(let a=0;a<n.length;++a){let c=n[a];l(c)&&c.destroy()}n.length=0;let i=e._texturesToCreate;for(let a=0;a<i.length;++a){let{name:c,source:d}=i[a];e._actualUniforms[c]=new vt({context:t,source:d})}i.length=0;let o=e._dirtyUniforms;if(o.length===0&&!l(e._texturePromise)){e._ready=!0;return}if(o.length===0||l(e._texturePromise))return;let r=e._uniforms,s=[];for(let a=0;a<o.length;++a){let c=o[a],d=r[c],u=e._textureCache.getStageByName(d);if(l(u))e._actualUniforms[c]=qVt(e,d);else if(typeof d=="string"){let m=new ve({url:d});s.push(m.fetchImage().then(QVt(e,c)))}else e._texturesToCreate.push({name:c,source:d})}o.length=0,s.length>0?(e._ready=!1,e._texturePromise=Promise.all(s).then(function(){e._ready=!0,e._texturePromise=void 0})):e._ready=!0}function wAe(e){l(e._command)&&(e._command.shaderProgram=e._command.shaderProgram&&e._command.shaderProgram.destroy(),e._command=void 0),e._selectedIdTexture=e._selectedIdTexture&&e._selectedIdTexture.destroy();let t=e._textureCache;if(!l(t))return;let n=e._uniforms,i=e._actualUniforms;for(let o in i){if(!i.hasOwnProperty(o))continue;let r=i[o];r instanceof vt&&(l(t.getStageByName(n[o]))||r.destroy(),e._dirtyUniforms.push(o))}}function eEt(e){let t=l(e._selected)?e._selected.length:0,n=l(e._parentSelected)?e._parentSelected:0,i=e._selected!==e._selectedShadow||t!==e._selectedLength||e._parentSelected!==e._parentSelectedShadow||n!==e._parentSelectedLength;if(l(e._selected)&&l(e._parentSelected)?e._combinedSelected=e._selected.concat(e._parentSelected):l(e._parentSelected)?e._combinedSelected=e._parentSelected:e._combinedSelected=e._selected,!i&&l(e._combinedSelected)){if(!l(e._combinedSelectedShadow))return!0;for(let o=0;o<e._combinedSelected.length;++o)if(e._combinedSelected[o]!==e._combinedSelectedShadow[o])return!0}return i}function tEt(e,t){if(!e._selectedDirty)return;e._selectedIdTexture=e._selectedIdTexture&&e._selectedIdTexture.destroy(),e._selectedIdTexture=void 0;let n=e._combinedSelected;if(!l(n))return;let i=0;for(let c=0;c<n.length;++c){let d=n[c];l(d.pickIds)?i+=d.pickIds.length:l(d.pickId)&&++i}let o=wt.maximumTextureSize;if(i>o&&(Yg._oneTimeWarning("postProcessStageSelectedTextureSize",`The number of selected feature ids (${i}) exceeds the maximum texture size (${o}). Features beyond the limit will not have the post-process effect applied.`),i=o),n.length===0||i===0){let c=new Uint8Array([255,255,255,255]);e._selectedIdTexture=new vt({context:t,pixelFormat:Qe.RGBA,pixelDatatype:Ue.UNSIGNED_BYTE,source:{arrayBufferView:c,width:1,height:1},sampler:Ot.NEAREST});return}let r=0,s=i*4,a=new Uint8Array(s);for(let c=0;c<n.length&&r<s;++c){let d=n[c];if(l(d.pickIds)){let u=d.pickIds,m=u.length;for(let p=0;p<m&&r<s;++p){let b=u[p].color;a[r]=U.floatToByte(b.red),a[r+1]=U.floatToByte(b.green),a[r+2]=U.floatToByte(b.blue),a[r+3]=U.floatToByte(b.alpha),r+=4}}else if(l(d.pickId)){let u=d.pickId.color;a[r]=U.floatToByte(u.red),a[r+1]=U.floatToByte(u.green),a[r+2]=U.floatToByte(u.blue),a[r+3]=U.floatToByte(u.alpha),r+=4}}e._selectedIdTexture=new vt({context:t,pixelFormat:Qe.RGBA,pixelDatatype:Ue.UNSIGNED_BYTE,source:{arrayBufferView:a,width:i,height:1},sampler:Ot.NEAREST})}Yg.prototype.update=function(e,t){if(this.enabled!==this._enabled&&!this.enabled&&wAe(this),this._enabled=this.enabled,!this._enabled||(this._logDepthChanged=t!==this._useLogDepth,this._useLogDepth=t,this._selectedDirty=eEt(this),this._selectedShadow=this._selected,this._parentSelectedShadow=this._parentSelected,this._combinedSelectedShadow=this._combinedSelected,this._selectedLength=l(this._selected)?this._selected.length:0,this._parentSelectedLength=l(this._parentSelected)?this._parentSelected.length:0,tEt(this,e),HVt(this),$Vt(this,e),JVt(this,e),jVt(this),this._selectedDirty=!1,!this._ready))return;let n=this._textureCache.getFramebuffer(this._name);if(this._command.framebuffer=n,!l(n))return;let i=n.getColorTexture(0),o;(i.width!==e.drawingBufferWidth||i.height!==e.drawingBufferHeight)&&(o=this._renderState,(!l(o)||i.width!==o.viewport.width||i.height!==o.viewport.height)&&(this._renderState=ze.fromCache({viewport:new nt(0,0,i.width,i.height)}))),this._command.renderState=o};Yg.prototype.execute=function(e,t,n,i){if(!l(this._command)||!l(this._command.framebuffer)||!this._ready||!this._enabled)return;this._colorTexture=t,this._depthTexture=n,this._idTexture=i,Ot.equals(this._colorTexture.sampler,this._sampler)||(this._colorTexture.sampler=this._sampler);let o=this.scissorRectangle.width>0&&this.scissorRectangle.height>0?this._passState:void 0;l(o)&&(o.context=e),this._command.execute(e,o)};Yg.prototype.isDestroyed=function(){return!1};Yg.prototype.destroy=function(){return wAe(this),ue(this)};Yg._oneTimeWarning=xt;var Uo=Yg;var oio=x(T(),1);function IZ(e){e=e??B.EMPTY_OBJECT,this._stages=e.stages,this._inputPreviousStageTexture=e.inputPreviousStageTexture??!0;let t=e.name;l(t)||(t=Qn()),this._name=t,this._uniforms=e.uniforms,this._textureCache=void 0,this._index=void 0,this._selected=void 0,this._selectedShadow=void 0,this._parentSelected=void 0,this._parentSelectedShadow=void 0,this._combinedSelected=void 0,this._combinedSelectedShadow=void 0,this._selectedLength=0,this._parentSelectedLength=0,this._selectedDirty=!0}Object.defineProperties(IZ.prototype,{ready:{get:function(){let e=this._stages,t=e.length;for(let n=0;n<t;++n)if(!e[n].ready)return!1;return!0}},name:{get:function(){return this._name}},enabled:{get:function(){return this._stages[0].enabled},set:function(e){let t=this._stages,n=t.length;for(let i=0;i<n;++i)t[i].enabled=e}},uniforms:{get:function(){return this._uniforms}},inputPreviousStageTexture:{get:function(){return this._inputPreviousStageTexture}},length:{get:function(){return this._stages.length}},selected:{get:function(){return this._selected},set:function(e){this._selected=e}},parentSelected:{get:function(){return this._parentSelected},set:function(e){this._parentSelected=e}}});IZ.prototype._isSupported=function(e){let t=this._stages,n=t.length;for(let i=0;i<n;++i)if(!t[i]._isSupported(e))return!1;return!0};IZ.prototype.get=function(e){return this._stages[e]};function nEt(e){let t=l(e._selected)?e._selected.length:0,n=l(e._parentSelected)?e._parentSelected:0,i=e._selected!==e._selectedShadow||t!==e._selectedLength;if(i=i||e._parentSelected!==e._parentSelectedShadow||n!==e._parentSelectedLength,l(e._selected)&&l(e._parentSelected)?e._combinedSelected=e._selected.concat(e._parentSelected):l(e._parentSelected)?e._combinedSelected=e._parentSelected:e._combinedSelected=e._selected,!i&&l(e._combinedSelected)){if(!l(e._combinedSelectedShadow))return!0;t=e._combinedSelected.length;for(let o=0;o<t;++o)if(e._combinedSelected[o]!==e._combinedSelectedShadow[o])return!0}return i}IZ.prototype.update=function(e,t){this._selectedDirty=nEt(this),this._selectedShadow=this._selected,this._parentSelectedShadow=this._parentSelected,this._combinedSelectedShadow=this._combinedSelected,this._selectedLength=l(this._selected)?this._selected.length:0,this._parentSelectedLength=l(this._parentSelected)?this._parentSelected.length:0;let n=this._stages,i=n.length;for(let o=0;o<i;++o){let r=n[o];this._selectedDirty&&(r.parentSelected=this._combinedSelected),r.update(e,t)}};IZ.prototype.isDestroyed=function(){return!1};IZ.prototype.destroy=function(){let e=this._stages,t=e.length;for(let n=0;n<t;++n)e[n].destroy();return ue(this)};var nu=IZ;var ls={};function $te(e){let o=`#define USE_STEP_SIZE +${cT}`,r=new Uo({name:`${e}_x_direction`,fragmentShader:o,uniforms:{delta:1,sigma:2,stepSize:1,direction:0},sampleMode:qu.LINEAR}),s=new Uo({name:`${e}_y_direction`,fragmentShader:o,uniforms:{delta:1,sigma:2,stepSize:1,direction:1},sampleMode:qu.LINEAR}),a={};return Object.defineProperties(a,{delta:{get:function(){return r.uniforms.delta},set:function(c){let d=r.uniforms,u=s.uniforms;d.delta=u.delta=c}},sigma:{get:function(){return r.uniforms.sigma},set:function(c){let d=r.uniforms,u=s.uniforms;d.sigma=u.sigma=c}},stepSize:{get:function(){return r.uniforms.stepSize},set:function(c){let d=r.uniforms,u=s.uniforms;d.stepSize=u.stepSize=c}}}),new nu({name:e,stages:[r,s],uniforms:a})}ls.createBlurStage=function(){return $te("czm_blur")};ls.createDepthOfFieldStage=function(){let e=$te("czm_depth_of_field_blur"),t=new Uo({name:"czm_depth_of_field_composite",fragmentShader:Xw,uniforms:{focalDistance:5,blurTexture:e.name}}),n={};return Object.defineProperties(n,{focalDistance:{get:function(){return t.uniforms.focalDistance},set:function(i){t.uniforms.focalDistance=i}},delta:{get:function(){return e.uniforms.delta},set:function(i){e.uniforms.delta=i}},sigma:{get:function(){return e.uniforms.sigma},set:function(i){e.uniforms.sigma=i}},stepSize:{get:function(){return e.uniforms.stepSize},set:function(i){e.uniforms.stepSize=i}}}),new nu({name:"czm_depth_of_field",stages:[e,t],inputPreviousStageTexture:!1,uniforms:n})};ls.isDepthOfFieldSupported=function(e){return e.context.depthTexture};ls.createEdgeDetectionStage=function(){let e=Qn();return new Uo({name:`czm_edge_detection_${e}`,fragmentShader:Yw,uniforms:{length:.25,color:U.clone(U.BLACK)}})};ls.isEdgeDetectionSupported=function(e){return e.context.depthTexture};function iEt(e){if(!l(e))return ls.createEdgeDetectionStage();let t=new nu({name:"czm_edge_detection_multiple",stages:e,inputPreviousStageTexture:!1}),n={},i="",o="";for(let a=0;a<e.length;++a)i+=`uniform sampler2D edgeTexture${a}; `,o+=` vec4 edge${a} = texture(edgeTexture${a}, v_textureCoordinates); if (edge${a}.a > 0.0) { @@ -11216,14 +11216,14 @@ void main() { ${o} } out_FragColor = color; } -`,s=new Uo({name:"czm_edge_detection_combine",fragmentShader:r,uniforms:n});return new cu({name:"czm_edge_detection_composite",stages:[t,s]})}ls.createSilhouetteStage=function(e){let t=NFt(e),n=new Uo({name:"czm_silhouette_color_edges",fragmentShader:nk,uniforms:{silhouetteTexture:t.name}});return new cu({name:"czm_silhouette",stages:[t,n],inputPreviousStageTexture:!1,uniforms:t.uniforms})};ls.isSilhouetteSupported=function(e){return e.context.depthTexture};ls.createBloomStage=function(){let e=new Uo({name:"czm_bloom_contrast_bias",fragmentShader:B9,uniforms:{contrast:128,brightness:-.3}}),t=gre("czm_bloom_blur"),n=new cu({name:"czm_bloom_contrast_bias_blur",stages:[e,t]}),i=new Uo({name:"czm_bloom_generate_composite",fragmentShader:D9,uniforms:{glowOnly:!1,bloomTexture:n.name}}),o={};return Object.defineProperties(o,{glowOnly:{get:function(){return i.uniforms.glowOnly},set:function(r){i.uniforms.glowOnly=r}},contrast:{get:function(){return e.uniforms.contrast},set:function(r){e.uniforms.contrast=r}},brightness:{get:function(){return e.uniforms.brightness},set:function(r){e.uniforms.brightness=r}},delta:{get:function(){return t.uniforms.delta},set:function(r){t.uniforms.delta=r}},sigma:{get:function(){return t.uniforms.sigma},set:function(r){t.uniforms.sigma=r}},stepSize:{get:function(){return t.uniforms.stepSize},set:function(r){t.uniforms.stepSize=r}}}),new cu({name:"czm_bloom",stages:[n,i],inputPreviousStageTexture:!1,uniforms:o})};ls.createAmbientOcclusionStage=function(){let e=new Uo({name:"czm_ambient_occlusion_generate",fragmentShader:w9,uniforms:{intensity:3,bias:.1,lengthCap:.26,directionCount:8,stepCount:32,randomTexture:void 0}}),t=new Uo({name:"czm_ambient_occlusion_composite",fragmentShader:k9,uniforms:{ambientOcclusionOnly:!1,ambientOcclusionTexture:e.name}}),n={};return Object.defineProperties(n,{intensity:{get:function(){return e.uniforms.intensity},set:function(i){e.uniforms.intensity=i}},bias:{get:function(){return e.uniforms.bias},set:function(i){e.uniforms.bias=i}},lengthCap:{get:function(){return e.uniforms.lengthCap},set:function(i){e.uniforms.lengthCap=i}},directionCount:{get:function(){return e.uniforms.directionCount},set:function(i){e.uniforms.directionCount=i}},stepCount:{get:function(){return e.uniforms.stepCount},set:function(i){e.uniforms.stepCount=i}},randomTexture:{get:function(){return e.uniforms.randomTexture},set:function(i){e.uniforms.randomTexture=i}},ambientOcclusionOnly:{get:function(){return t.uniforms.ambientOcclusionOnly},set:function(i){t.uniforms.ambientOcclusionOnly=i}}}),new cu({name:"czm_ambient_occlusion",stages:[e,t],inputPreviousStageTexture:!1,uniforms:n})};ls.isAmbientOcclusionSupported=function(e){return e.context.depthTexture};var YFt=`#define FXAA_QUALITY_PRESET 39 +`,s=new Uo({name:"czm_edge_detection_combine",fragmentShader:r,uniforms:n});return new nu({name:"czm_edge_detection_composite",stages:[t,s]})}ls.createSilhouetteStage=function(e){let t=iEt(e),n=new Uo({name:"czm_silhouette_color_edges",fragmentShader:zw,uniforms:{silhouetteTexture:t.name}});return new nu({name:"czm_silhouette",stages:[t,n],inputPreviousStageTexture:!1,uniforms:t.uniforms})};ls.isSilhouetteSupported=function(e){return e.context.depthTexture};ls.createBloomStage=function(){let e=new Uo({name:"czm_bloom_contrast_bias",fragmentShader:Pw,uniforms:{contrast:128,brightness:-.3}}),t=$te("czm_bloom_blur"),n=new nu({name:"czm_bloom_contrast_bias_blur",stages:[e,t]}),i=new Uo({name:"czm_bloom_generate_composite",fragmentShader:Fw,uniforms:{glowOnly:!1,bloomTexture:n.name}}),o={};return Object.defineProperties(o,{glowOnly:{get:function(){return i.uniforms.glowOnly},set:function(r){i.uniforms.glowOnly=r}},contrast:{get:function(){return e.uniforms.contrast},set:function(r){e.uniforms.contrast=r}},brightness:{get:function(){return e.uniforms.brightness},set:function(r){e.uniforms.brightness=r}},delta:{get:function(){return t.uniforms.delta},set:function(r){t.uniforms.delta=r}},sigma:{get:function(){return t.uniforms.sigma},set:function(r){t.uniforms.sigma=r}},stepSize:{get:function(){return t.uniforms.stepSize},set:function(r){t.uniforms.stepSize=r}}}),new nu({name:"czm_bloom",stages:[n,i],inputPreviousStageTexture:!1,uniforms:o})};ls.createAmbientOcclusionStage=function(){let e=new Uo({name:"czm_ambient_occlusion_generate",fragmentShader:Lw,uniforms:{intensity:3,bias:.1,lengthCap:.26,directionCount:8,stepCount:32,randomTexture:void 0}}),t=new Uo({name:"czm_ambient_occlusion_composite",fragmentShader:Ww,uniforms:{ambientOcclusionOnly:!1,ambientOcclusionTexture:e.name}}),n={};return Object.defineProperties(n,{intensity:{get:function(){return e.uniforms.intensity},set:function(i){e.uniforms.intensity=i}},bias:{get:function(){return e.uniforms.bias},set:function(i){e.uniforms.bias=i}},lengthCap:{get:function(){return e.uniforms.lengthCap},set:function(i){e.uniforms.lengthCap=i}},directionCount:{get:function(){return e.uniforms.directionCount},set:function(i){e.uniforms.directionCount=i}},stepCount:{get:function(){return e.uniforms.stepCount},set:function(i){e.uniforms.stepCount=i}},randomTexture:{get:function(){return e.uniforms.randomTexture},set:function(i){e.uniforms.randomTexture=i}},ambientOcclusionOnly:{get:function(){return t.uniforms.ambientOcclusionOnly},set:function(i){t.uniforms.ambientOcclusionOnly=i}}}),new nu({name:"czm_ambient_occlusion",stages:[e,t],inputPreviousStageTexture:!1,uniforms:n})};ls.isAmbientOcclusionSupported=function(e){return e.context.depthTexture};var oEt=`#define FXAA_QUALITY_PRESET 39 ${zv} -${Q9}`;ls.createFXAAStage=function(){return new Uo({name:"czm_FXAA",fragmentShader:YFt,sampleMode:sm.LINEAR})};ls.createAcesTonemappingStage=function(e){let t=e?`#define AUTO_EXPOSURE -`:"";return t+=M9,new Uo({name:"czm_aces",fragmentShader:t,uniforms:{autoExposure:void 0,exposure:1}})};ls.createFilmicTonemappingStage=function(e){let t=e?`#define AUTO_EXPOSURE -`:"";return t+=J9,new Uo({name:"czm_filmic",fragmentShader:t,uniforms:{autoExposure:void 0,exposure:1}})};ls.createPbrNeutralTonemappingStage=function(e){let t=e?`#define AUTO_EXPOSURE -`:"";return t+=j9,new Uo({name:"czm_pbr_neutral",fragmentShader:t,uniforms:{autoExposure:void 0,exposure:1}})};ls.createReinhardTonemappingStage=function(e){let t=e?`#define AUTO_EXPOSURE -`:"";return t+=tk,new Uo({name:"czm_reinhard",fragmentShader:t,uniforms:{autoExposure:void 0,exposure:1}})};ls.createModifiedReinhardTonemappingStage=function(e){let t=e?`#define AUTO_EXPOSURE -`:"";return t+=$9,new Uo({name:"czm_modified_reinhard",fragmentShader:t,uniforms:{white:U.WHITE,autoExposure:void 0,exposure:1}})};ls.createAutoExposureStage=function(){return new ik};ls.createBlackAndWhiteStage=function(){return new Uo({name:"czm_black_and_white",fragmentShader:U9,uniforms:{gradations:5}})};ls.createBrightnessStage=function(){return new Uo({name:"czm_brightness",fragmentShader:O9,uniforms:{brightness:.5}})};ls.createNightVisionStage=function(){return new Uo({name:"czm_night_vision",fragmentShader:ek})};ls.createDepthViewStage=function(){return new Uo({name:"czm_depth_view",fragmentShader:H9})};ls.createLensFlareStage=function(){return new Uo({name:"czm_lens_flare",fragmentShader:q9,uniforms:{dirtTexture:en("Assets/Textures/LensFlare/DirtMask.jpg"),starTexture:en("Assets/Textures/LensFlare/StarBurst.jpg"),intensity:2,distortion:10,ghostDispersal:.4,haloWidth:.4,dirtAmount:.4,earthRadius:ne.WGS84.maximumRadius}})};var am=ls;var Xgo=x(T(),1);function iy(e){this._collection=e,this._framebuffers=[],this._stageNameToFramebuffer={},this._width=void 0,this._height=void 0,this._updateDependencies=!1}function rk(e){for(;l(e.length);)e=e.get(e.length-1);return e.name}function yre(e,t,n,i,o){if(!i.enabled||!i._isSupported(t))return o;let r=n[i.name]={};if(l(o)){let a=e.getStageByName(o);r[rk(a)]=!0}let s=i.uniforms;if(l(s)){let a=Object.getOwnPropertyNames(s),c=a.length;for(let d=0;d<c;++d){let u=s[a[d]];if(typeof u=="string"){let m=e.getStageByName(u);l(m)&&(r[rk(m)]=!0)}}}return i.name}function ok(e,t,n,i,o){if(l(i.enabled)&&!i.enabled||l(i._isSupported)&&!i._isSupported(t))return o;let r=o,s=!l(i.inputPreviousStageTexture)||i.inputPreviousStageTexture,a=o,c=i.length;for(let m=0;m<c;++m){let p=i.get(m);l(p.length)?a=ok(e,t,n,p,o):a=yre(e,t,n,p,o),s&&(o=a)}let d,u;if(s)for(d=1;d<c;++d)u=rk(i.get(d)),l(n[u])||(n[u]={}),n[u][r]=!0;else for(d=1;d<c;++d){u=rk(i.get(d));let m=n[u];for(let p=0;p<d;++p)m[rk(i.get(p))]=!0}return a}function MFt(e,t){let n={};if(l(e.ambientOcclusion)){let i=e.ambientOcclusion,o=e.bloom,r=e._tonemapping,s=e.fxaa,a=ok(e,t,n,i,void 0);a=ok(e,t,n,o,a),a=yre(e,t,n,r,a),a=ok(e,t,n,e,a),yre(e,t,n,s,a)}else ok(e,t,n,e,void 0);return n}function wFt(e,t,n){let o=e._collection.getStageByName(t),r=o._textureScale,s=o._forcePowerOfTwo,a=o._pixelFormat,c=o._pixelDatatype,d=o._clearColor,u,m,p=e._framebuffers,b=p.length;for(u=0;u<b;++u){if(m=p[u],r!==m.textureScale||s!==m.forcePowerOfTwo||a!==m.pixelFormat||c!==m.pixelDatatype||!U.equals(d,m.clearColor))continue;let f=m.stages,y=f.length,_=!1;for(let S=0;S<y;++S)if(n[f[S]]){_=!0;break}if(!_)break}return l(m)&&u<b?(m.stages.push(t),m):(m={textureScale:r,forcePowerOfTwo:s,pixelFormat:a,pixelDatatype:c,clearColor:d,stages:[t],buffer:new li({pixelFormat:a,pixelDatatype:c}),clear:void 0},p.push(m),m)}function kFt(e,t){let n=MFt(e._collection,t);for(let i in n)n.hasOwnProperty(i)&&(e._stageNameToFramebuffer[i]=wFt(e,i,n[i]))}function xre(e){let t=e._framebuffers,n=t.length;for(let i=0;i<n;++i)t[i].buffer.destroy()}function UFt(e,t){let n=e._width,i=e._height,o=e._framebuffers,r=o.length;for(let s=0;s<r;++s){let a=o[s],c=a.textureScale,d=Math.ceil(n*c),u=Math.ceil(i*c),m=Math.min(d,u);a.forcePowerOfTwo&&(W.isPowerOfTwo(m)||(m=W.nextPowerOfTwo(m)),d=m,u=m),a.buffer.update(t,d,u),a.clear=new ui({color:a.clearColor,framebuffer:a.buffer.framebuffer})}}iy.prototype.updateDependencies=function(){this._updateDependencies=!0};iy.prototype.update=function(e){let t=this._collection,n=this._updateDependencies,i=l(t.ambientOcclusion)&&t.ambientOcclusion.enabled&&t.ambientOcclusion._isSupported(e),o=l(t.bloom)&&t.bloom.enabled&&t.bloom._isSupported(e),r=l(t._tonemapping)&&t._tonemapping.enabled&&t._tonemapping._isSupported(e),s=l(t.fxaa)&&t.fxaa.enabled&&t.fxaa._isSupported(e),a=!l(t._activeStages)||t._activeStages.length>0||i||o||r||s;if((n||!a&&this._framebuffers.length>0)&&(xre(this),this._framebuffers.length=0,this._stageNameToFramebuffer={},this._width=void 0,this._height=void 0),!n&&!a)return;this._framebuffers.length===0&&kFt(this,e);let c=e.drawingBufferWidth,d=e.drawingBufferHeight,u=this._width!==c||this._height!==d;!n&&!u||(this._width=c,this._height=d,this._updateDependencies=!1,xre(this),UFt(this,e))};iy.prototype.clear=function(e){let t=this._framebuffers;for(let n=0;n<t.length;++n)t[n].clear.execute(e)};iy.prototype.getStageByName=function(e){return this._collection.getStageByName(e)};iy.prototype.getOutputTexture=function(e){return this._collection.getOutputTexture(e)};iy.prototype.getFramebuffer=function(e){let t=this._stageNameToFramebuffer[e];if(l(t))return t.buffer.framebuffer};iy.prototype.isDestroyed=function(){return!1};iy.prototype.destroy=function(){return xre(this),ue(this)};var cR=iy;var Ygo=x(T(),1),IFe={REINHARD:"REINHARD",MODIFIED_REINHARD:"MODIFIED_REINHARD",FILMIC:"FILMIC",ACES:"ACES",PBR_NEUTRAL:"PBR_NEUTRAL"};Object.freeze(IFe);var oy=IFe;var Tre=[];function bd(){let e=am.createFXAAStage(),t=am.createAmbientOcclusionStage(),n=am.createBloomStage();this._autoExposureEnabled=!1,this._autoExposure=am.createAutoExposureStage(),this._exposure=1,this._tonemapping=void 0,this._tonemapper=void 0,this.tonemapper=oy.PBR_NEUTRAL;let i=this._tonemapping;e.enabled=!1,t.enabled=!1,n.enabled=!1,i.enabled=!1;let o=new cR(this),r={},s=Tre;for(s.push(e,t,n,i);s.length>0;){let c=s.pop();r[c.name]=c,c._textureCache=o;let d=c.length;if(l(d))for(let u=0;u<d;++u)s.push(c.get(u))}this._stages=[],this._activeStages=[],this._previousActiveStages=[],this._randomTexture=void 0;let a=this;t.uniforms.randomTexture=function(){return a._randomTexture},this._ao=t,this._bloom=n,this._fxaa=e,this._aoEnabled=void 0,this._bloomEnabled=void 0,this._tonemappingEnabled=void 0,this._fxaaEnabled=void 0,this._activeStagesChanged=!1,this._stagesRemoved=!1,this._textureCacheDirty=!1,this._stageNames=r,this._textureCache=o}Object.defineProperties(bd.prototype,{ready:{get:function(){let e=!1,t=this._stages,n=t.length;for(let a=n-1;a>=0;--a){let c=t[a];e=e||c.ready&&c.enabled}let i=this._fxaa,o=this._ao,r=this._bloom,s=this._tonemapping;return e=e||i.ready&&i.enabled,e=e||o.ready&&o.enabled,e=e||r.ready&&r.enabled,e=e||s.ready&&s.enabled,e}},fxaa:{get:function(){return this._fxaa}},ambientOcclusion:{get:function(){return this._ao}},bloom:{get:function(){return this._bloom}},length:{get:function(){return _re(this),this._stages.length}},outputTexture:{get:function(){let e=this._fxaa;if(e.enabled&&e.ready)return this.getOutputTexture(e.name);let t=this._stages,n=t.length;for(let s=n-1;s>=0;--s){let a=t[s];if(l(a)&&a.ready&&a.enabled)return this.getOutputTexture(a.name)}let i=this._tonemapping;if(i.enabled&&i.ready)return this.getOutputTexture(i.name);let o=this._bloom;if(o.enabled&&o.ready)return this.getOutputTexture(o.name);let r=this._ao;if(r.enabled&&r.ready)return this.getOutputTexture(r.name)}},hasSelected:{get:function(){let e=this._stages.slice();for(;e.length>0;){let t=e.pop();if(!l(t))continue;if(l(t.selected))return!0;let n=t.length;if(l(n))for(let i=0;i<n;++i)e.push(t.get(i))}return!1}},tonemapper:{get:function(){return this._tonemapper},set:function(e){if(this._tonemapper===e)return;l(this._tonemapping)&&(delete this._stageNames[this._tonemapping.name],this._tonemapping.destroy());let t=this._autoExposureEnabled,n;switch(e){case oy.REINHARD:n=am.createReinhardTonemappingStage(t);break;case oy.MODIFIED_REINHARD:n=am.createModifiedReinhardTonemappingStage(t);break;case oy.FILMIC:n=am.createFilmicTonemappingStage(t);break;case oy.PBR_NEUTRAL:n=am.createPbrNeutralTonemappingStage(t);break;default:n=am.createAcesTonemappingStage(t);break}if(t){let i=this._autoExposure;n.uniforms.autoExposure=function(){return i.outputTexture}}else n.uniforms.exposure=this._exposure;this._tonemapper=e,this._tonemapping=n,l(this._stageNames)&&(this._stageNames[n.name]=n,n._textureCache=this._textureCache),this._textureCacheDirty=!0}},exposure:{get:function(){return this._exposure},set:function(e){this._tonemapping.uniforms.exposure=e,this._exposure=e}}});function _re(e){if(!e._stagesRemoved)return;e._stagesRemoved=!1;let t=[],n=e._stages;for(let i=0,o=0;i<n.length;++i){let r=n[i];r&&(r._index=o++,t.push(r))}e._stages=t}bd.prototype.add=function(e){let t=this._stageNames,n=Tre;for(n.push(e);n.length>0;){let o=n.pop();t[o.name]=o,o._textureCache=this._textureCache;let r=o.length;if(l(r))for(let s=0;s<r;++s)n.push(o.get(s))}let i=this._stages;return e._index=i.length,i.push(e),this._textureCacheDirty=!0,e};bd.prototype.remove=function(e){if(!this.contains(e))return!1;let t=this._stageNames,n=Tre;for(n.push(e);n.length>0;){let i=n.pop();delete t[i.name];let o=i.length;if(l(o))for(let r=0;r<o;++r)n.push(i.get(r))}return this._stages[e._index]=void 0,this._stagesRemoved=!0,this._textureCacheDirty=!0,e._index=void 0,e._textureCache=void 0,e.destroy(),!0};bd.prototype.contains=function(e){return l(e)&&l(e._index)&&e._textureCache===this._textureCache};bd.prototype.get=function(e){return _re(this),this._stages[e]};bd.prototype.removeAll=function(){let e=this._stages,t=e.length;for(let n=0;n<t;++n)this.remove(e[n]);e.length=0};bd.prototype.getStageByName=function(e){return this._stageNames[e]};bd.prototype.update=function(e,t,n){_re(this);let i=this._activeStages,o=this._activeStages=this._previousActiveStages;this._previousActiveStages=i;let r=this._stages;o.length=r.length;let s=0;for(let S=0;S<r.length;++S){let Z=r[S];Z.ready&&Z.enabled&&Z._isSupported(e)&&(o[s++]=Z)}o.length=s;let a=s!==i.length;if(!a){for(let S=0;S<s;++S)if(o[S]!==i[S]){a=!0;break}}let c=this._ao,d=this._bloom,u=this._autoExposure,m=this._tonemapping,p=this._fxaa;m.enabled=n;let b=c.enabled&&c._isSupported(e),f=d.enabled&&d._isSupported(e),y=m.enabled&&m._isSupported(e),_=p.enabled&&p._isSupported(e);if((a||this._textureCacheDirty||b!==this._aoEnabled||f!==this._bloomEnabled||y!==this._tonemappingEnabled||_!==this._fxaaEnabled)&&(this._textureCache.updateDependencies(),this._aoEnabled=b,this._bloomEnabled=f,this._tonemappingEnabled=y,this._fxaaEnabled=_,this._textureCacheDirty=!1),l(this._randomTexture)&&!b&&(this._randomTexture.destroy(),this._randomTexture=void 0),!l(this._randomTexture)&&b){let Z=new Uint8Array(196608);for(let R=0;R<196608;R+=3)Z[R]=Math.floor(Math.random()*255);this._randomTexture=new vt({context:e,pixelFormat:Qe.RGB,pixelDatatype:Ue.UNSIGNED_BYTE,source:{arrayBufferView:Z,width:256,height:256},sampler:new Ot({wrapS:pn.REPEAT,wrapT:pn.REPEAT,minificationFilter:Ht.NEAREST,magnificationFilter:$n.NEAREST})})}this._textureCache.update(e),p.update(e,t),c.update(e,t),d.update(e,t),m.update(e,t),this._autoExposureEnabled&&u.update(e,t);for(let S=0;S<r.length;++S)r[S].update(e,t);s=0;for(let S=0;S<r.length;++S){let Z=r[S];Z.ready&&Z.enabled&&Z._isSupported(e)&&s++}a=s!==o.length,a&&this.update(e,t,n)};bd.prototype.clear=function(e){this._textureCache.clear(e),this._autoExposureEnabled&&this._autoExposure.clear(e)};function lR(e){for(;l(e.length);)e=e.get(e.length-1);return e.outputTexture}bd.prototype.getOutputTexture=function(e){let t=this.getStageByName(e);if(l(t))return lR(t)};function N0(e,t,n,i,o){if(l(e.execute)){e.execute(t,n,i,o);return}if(e.inputPreviousStageTexture){N0(e.get(0),t,n,i,o);for(let r=1;r<e.length;++r)N0(e.get(r),t,lR(e.get(r-1)),i,o)}else for(let r=0;r<e.length;++r)N0(e.get(r),t,n,i,o)}bd.prototype.execute=function(e,t,n,i){let o=this._activeStages,r=o.length,s=this._fxaa,a=this._ao,c=this._bloom,d=this._autoExposure,u=this._tonemapping,m=a.enabled&&a._isSupported(e),p=c.enabled&&c._isSupported(e),b=this._autoExposureEnabled,f=u.enabled&&u._isSupported(e),y=s.enabled&&s._isSupported(e);if(!y&&!m&&!p&&!f&&r===0)return;let _=t;m&&a.ready&&(N0(a,e,_,n,i),_=lR(a)),p&&c.ready&&(N0(c,e,_,n,i),_=lR(c)),b&&d.ready&&N0(d,e,_,n,i),f&&u.ready&&(N0(u,e,_,n,i),_=lR(u));let S=_;if(r>0){N0(o[0],e,_,n,i);for(let Z=1;Z<r;++Z)N0(o[Z],e,lR(o[Z-1]),n,i);S=lR(o[r-1])}y&&s.ready&&N0(s,e,S,n,i)};bd.prototype.copy=function(e,t){if(!l(this._copyColorCommand)){let n=this;this._copyColorCommand=e.createViewportQuadCommand(au,{uniformMap:{colorTexture:function(){return n.outputTexture}},owner:this})}this._copyColorCommand.framebuffer=t,this._copyColorCommand.execute(e)};bd.prototype.isDestroyed=function(){return!1};bd.prototype.destroy=function(){return this._fxaa.destroy(),this._ao.destroy(),this._bloom.destroy(),this._autoExposure.destroy(),this._tonemapping.destroy(),this.removeAll(),this._textureCache=this._textureCache&&this._textureCache.destroy(),ue(this)};var sk=bd;var vyo=x(T(),1);var fyo=x(T(),1);var nyo=x(T(),1),PFe={SHIFT:0,CTRL:1,ALT:2};Object.freeze(PFe);var ir=PFe;var oyo=x(T(),1),XFe={LEFT_DOWN:0,LEFT_UP:1,LEFT_CLICK:2,LEFT_DOUBLE_CLICK:3,RIGHT_DOWN:5,RIGHT_UP:6,RIGHT_CLICK:7,MIDDLE_DOWN:10,MIDDLE_UP:11,MIDDLE_CLICK:12,MOUSE_MOVE:15,WHEEL:16,PINCH_START:17,PINCH_END:18,PINCH_MOVE:19};Object.freeze(XFe);var mn=XFe;function LT(e,t,n){let i=e._element;if(i===document)return n.x=t.clientX,n.y=t.clientY,n;let o=i.getBoundingClientRect();return n.x=t.clientX-o.left,n.y=t.clientY-o.top,n}function Ere(e,t){if(!l(t))return`${e}`;let n=Array.isArray(t)?t.toSorted():[t];return`${e}+${n.join("+")}`}function dR(e){let t=[];if(e.shiftKey&&t.push(ir.SHIFT),e.ctrlKey&&t.push(ir.CTRL),e.altKey&&t.push(ir.ALT),t.length)return t}var Fs={LEFT:0,MIDDLE:1,RIGHT:2};function cm(e,t,n,i){function o(r){i(e,r)}n.addEventListener(t,o,{capture:!1,passive:!1}),e._removalFunctions.push(function(){n.removeEventListener(t,o,!1)})}function DFt(e){let t=e._element,n=l(t.disableRootEvents)?t:document;fn.supportsPointerEvents()?(cm(e,"pointerdown",t,JFt),cm(e,"pointerup",t,zFe),cm(e,"pointermove",t,jFt),cm(e,"pointercancel",t,zFe)):(cm(e,"mousedown",t,HFe),cm(e,"mouseup",n,KFe),cm(e,"mousemove",n,JFe),cm(e,"touchstart",t,HFt),cm(e,"touchend",n,kFe),cm(e,"touchmove",n,KFt),cm(e,"touchcancel",n,kFe)),cm(e,"dblclick",t,BFt);let i;"onwheel"in t?i="wheel":document.onmousewheel!==void 0?i="mousewheel":i="DOMMouseScroll",cm(e,i,t,zFt)}function OFt(e){let t=e._removalFunctions;for(let n=0;n<t.length;++n)t[n]()}var NFe={position:new k};function Are(e){e._lastSeenTouchEvent=Zn()}function Gre(e){return Zn()-e._lastSeenTouchEvent>tp.mouseEmulationIgnoreMilliseconds}function Vre(e,t,n){let i=e.x-t.x,o=e.y-t.y;return Math.sqrt(i*i+o*o)<n}function HFe(e,t){if(!Gre(e))return;let n=t.button;e._buttonDown[n]=!0;let i;if(n===Fs.LEFT)i=mn.LEFT_DOWN;else if(n===Fs.MIDDLE)i=mn.MIDDLE_DOWN;else if(n===Fs.RIGHT)i=mn.RIGHT_DOWN;else return;let o=LT(e,t,e._primaryPosition);k.clone(o,e._primaryStartPosition),k.clone(o,e._primaryPreviousPosition);let r=dR(t),s=e.getInputAction(i,r);l(s)&&(k.clone(o,NFe.position),s(NFe),t.preventDefault())}var YFe={position:new k},MFe={position:new k};function Sre(e,t,n,i){let o=dR(i),r=e.getInputAction(t,o),s=e.getInputAction(n,o);if(l(r)||l(s)){let a=LT(e,i,e._primaryPosition);if(l(r)&&(k.clone(a,YFe.position),r(YFe)),l(s)){let c=e._primaryStartPosition;Vre(c,a,e._clickPixelTolerance)&&(k.clone(a,MFe.position),s(MFe))}}}function KFe(e,t){if(!Gre(e))return;let n=t.button;n!==Fs.LEFT&&n!==Fs.MIDDLE&&n!==Fs.RIGHT||(e._buttonDown[Fs.LEFT]&&(Sre(e,mn.LEFT_UP,mn.LEFT_CLICK,t),e._buttonDown[Fs.LEFT]=!1),e._buttonDown[Fs.MIDDLE]&&(Sre(e,mn.MIDDLE_UP,mn.MIDDLE_CLICK,t),e._buttonDown[Fs.MIDDLE]=!1),e._buttonDown[Fs.RIGHT]&&(Sre(e,mn.RIGHT_UP,mn.RIGHT_CLICK,t),e._buttonDown[Fs.RIGHT]=!1))}var Zre={startPosition:new k,endPosition:new k};function JFe(e,t){if(!Gre(e))return;let n=dR(t),i=LT(e,t,e._primaryPosition),o=e._primaryPreviousPosition,r=e.getInputAction(mn.MOUSE_MOVE,n);l(r)&&(k.clone(o,Zre.startPosition),k.clone(i,Zre.endPosition),r(Zre)),k.clone(i,o),(e._buttonDown[Fs.LEFT]||e._buttonDown[Fs.MIDDLE]||e._buttonDown[Fs.RIGHT])&&t.preventDefault()}var wFe={position:new k};function BFt(e,t){let n=t.button,i;if(n===Fs.LEFT)i=mn.LEFT_DOUBLE_CLICK;else return;let o=dR(t),r=e.getInputAction(i,o);l(r)&&(LT(e,t,wFe.position),r(wFe))}function zFt(e,t){let n;if(l(t.deltaY)){let r=t.deltaMode;r===t.DOM_DELTA_PIXEL?n=-t.deltaY:r===t.DOM_DELTA_LINE?n=-t.deltaY*40:n=-t.deltaY*120}else t.detail>0?n=t.detail*-120:n=t.wheelDelta;if(!l(n))return;let i=dR(t),o=e.getInputAction(mn.WHEEL,i);l(o)&&(o(n),t.preventDefault())}function HFt(e,t){Are(e);let n=t.changedTouches,i,o=n.length,r,s,a=e._positions;for(i=0;i<o;++i)r=n[i],s=r.identifier,a.set(s,LT(e,r,new k));WK(e,t);let c=e._previousPositions;for(i=0;i<o;++i)r=n[i],s=r.identifier,c.set(s,k.clone(a.get(s)))}function kFe(e,t){Are(e);let n=t.changedTouches,i,o=n.length,r,s,a=e._positions;for(i=0;i<o;++i)r=n[i],s=r.identifier,a.remove(s);WK(e,t);let c=e._previousPositions;for(i=0;i<o;++i)r=n[i],s=r.identifier,c.remove(s)}var UFe={position:new k},Rre={position1:new k,position2:new k},DFe={position:new k},OFe={position:new k},BFe={position:new k};function WK(e,t){let n=dR(t),i=e._positions,o=i.length,r,s,a=e._isPinching;if(o!==1&&e._buttonDown[Fs.LEFT]){if(e._buttonDown[Fs.LEFT]=!1,l(e._touchHoldTimer)&&(clearTimeout(e._touchHoldTimer),e._touchHoldTimer=void 0),r=e.getInputAction(mn.LEFT_UP,n),l(r)&&(k.clone(e._primaryPosition,DFe.position),r(DFe)),o===0&&!e._isTouchHolding&&(s=e.getInputAction(mn.LEFT_CLICK,n),l(s))){let c=e._primaryStartPosition,d=e._previousPositions.values[0];Vre(c,d,e._clickPixelTolerance)&&(k.clone(e._primaryPosition,OFe.position),s(OFe))}e._isTouchHolding=!1}if(o===0&&a&&(e._isPinching=!1,r=e.getInputAction(mn.PINCH_END,n),l(r)&&r()),o===1&&!a){let c=i.values[0];k.clone(c,e._primaryPosition),k.clone(c,e._primaryStartPosition),k.clone(c,e._primaryPreviousPosition),e._buttonDown[Fs.LEFT]=!0,r=e.getInputAction(mn.LEFT_DOWN,n),l(r)&&(k.clone(c,UFe.position),r(UFe)),e._touchHoldTimer=setTimeout(function(){if(!e.isDestroyed()&&(e._touchHoldTimer=void 0,e._isTouchHolding=!0,s=e.getInputAction(mn.RIGHT_CLICK,n),l(s))){let d=e._primaryStartPosition,u=e._previousPositions.values[0];Vre(d,u,e._holdPixelTolerance)&&(k.clone(e._primaryPosition,BFe.position),s(BFe))}},tp.touchHoldDelayMilliseconds),t.preventDefault()}o===2&&!a&&(e._isPinching=!0,r=e.getInputAction(mn.PINCH_START,n),l(r)&&(k.clone(i.values[0],Rre.position1),k.clone(i.values[1],Rre.position2),r(Rre),t.preventDefault()))}function KFt(e,t){Are(e);let n=t.changedTouches,i,o=n.length,r,s,a=e._positions;for(i=0;i<o;++i){r=n[i],s=r.identifier;let d=a.get(s);l(d)&<(e,r,d)}jFe(e,t);let c=e._previousPositions;for(i=0;i<o;++i)r=n[i],s=r.identifier,k.clone(a.get(s),c.get(s))}var Cre={startPosition:new k,endPosition:new k},ak={distance:{startPosition:new k,endPosition:new k},angleAndHeight:{startPosition:new k,endPosition:new k}};function jFe(e,t){let n=dR(t),i=e._positions,o=e._previousPositions,r=i.length,s;if(r===1&&e._buttonDown[Fs.LEFT]){let a=i.values[0];k.clone(a,e._primaryPosition);let c=e._primaryPreviousPosition;s=e.getInputAction(mn.MOUSE_MOVE,n),l(s)&&(k.clone(c,Cre.startPosition),k.clone(a,Cre.endPosition),s(Cre)),k.clone(a,c),t.preventDefault()}else if(r===2&&e._isPinching&&(s=e.getInputAction(mn.PINCH_MOVE,n),l(s))){let a=i.values[0],c=i.values[1],d=o.values[0],u=o.values[1],m=c.x-a.x,p=c.y-a.y,b=Math.sqrt(m*m+p*p)*.25,f=u.x-d.x,y=u.y-d.y,_=Math.sqrt(f*f+y*y)*.25,S=(c.y+a.y)*.125,Z=(u.y+d.y)*.125,R=Math.atan2(p,m),C=Math.atan2(y,f);k.fromElements(0,_,ak.distance.startPosition),k.fromElements(0,b,ak.distance.endPosition),k.fromElements(C,Z,ak.angleAndHeight.startPosition),k.fromElements(R,S,ak.angleAndHeight.endPosition),s(ak)}}function JFt(e,t){if(t.target.setPointerCapture(t.pointerId),t.pointerType==="touch"){let n=e._positions,i=t.pointerId;n.set(i,LT(e,t,new k)),WK(e,t),e._previousPositions.set(i,k.clone(n.get(i)))}else HFe(e,t)}function zFe(e,t){if(t.pointerType==="touch"){let n=e._positions,i=t.pointerId;n.remove(i),WK(e,t),e._previousPositions.remove(i)}else KFe(e,t)}function jFt(e,t){if(t.pointerType==="touch"){let n=e._positions,i=t.pointerId,o=n.get(i);if(!l(o))return;LT(e,t,o),jFe(e,t);let r=e._previousPositions;k.clone(n.get(i),r.get(i))}else JFe(e,t)}function tp(e){this._inputEvents={},this._buttonDown={[Fs.LEFT]:!1,[Fs.MIDDLE]:!1,[Fs.RIGHT]:!1},this._isPinching=!1,this._isTouchHolding=!1,this._lastSeenTouchEvent=-tp.mouseEmulationIgnoreMilliseconds,this._primaryStartPosition=new k,this._primaryPosition=new k,this._primaryPreviousPosition=new k,this._positions=new kt,this._previousPositions=new kt,this._removalFunctions=[],this._touchHoldTimer=void 0,this._clickPixelTolerance=5,this._holdPixelTolerance=25,this._element=e??document,DFt(this)}tp.prototype.setInputAction=function(e,t,n){let i=Ere(t,n);this._inputEvents[i]=e};tp.prototype.getInputAction=function(e,t){let n=Ere(e,t);return this._inputEvents[n]};tp.prototype.removeInputAction=function(e,t){let n=Ere(e,t);delete this._inputEvents[n]};tp.prototype.isDestroyed=function(){return!1};tp.prototype.destroy=function(){return OFt(this),ue(this)};tp.mouseEmulationIgnoreMilliseconds=800;tp.touchHoldDelayMilliseconds=1500;var aa=tp;function uR(e){this._scene=e,this._currentTweens=[],this._morphHandler=void 0,this._morphCancelled=!1,this._completeMorph=void 0,this._morphToOrthographic=!1}uR.prototype.completeMorph=function(){l(this._completeMorph)&&this._completeMorph()};uR.prototype.morphTo2D=function(e,t){l(this._completeMorph)&&this._completeMorph();let n=this._scene;this._previousMode=n.mode,this._morphToOrthographic=n.camera.frustum instanceof yn,!(this._previousMode===se.SCENE2D||this._previousMode===se.MORPHING)&&(this._scene.morphStart.raiseEvent(this,this._previousMode,se.SCENE2D,!0),n._mode=se.MORPHING,n.camera._setTransform(P.IDENTITY),this._previousMode===se.COLUMBUS_VIEW?GIt(this,e):XIt(this,e,t),e===0&&l(this._completeMorph)&&this._completeMorph())};var QFt=new h,qFt=new h,$Ft=new h,eIt=new h,tIt=new h,nIt=new h,iIt=new h,oIt=new pe,rIt=new P,sIt=new qi,aIt=new yn,cIt={position:void 0,direction:void 0,up:void 0,position2D:void 0,direction2D:void 0,up2D:void 0,frustum:void 0};uR.prototype.morphToColumbusView=function(e,t){l(this._completeMorph)&&this._completeMorph();let n=this._scene;if(this._previousMode=n.mode,this._previousMode===se.COLUMBUS_VIEW||this._previousMode===se.MORPHING)return;this._scene.morphStart.raiseEvent(this,this._previousMode,se.COLUMBUS_VIEW,!0),n.camera._setTransform(P.IDENTITY);let i=QFt,o=qFt,r=$Ft;if(e>0)i.x=0,i.y=-1,i.z=1,i=h.multiplyByScalar(h.normalize(i,i),5*t.maximumRadius,i),h.negate(h.normalize(i,o),o),h.cross(h.UNIT_X,o,r);else{let d=n.camera;if(this._previousMode===se.SCENE2D)h.clone(d.position,i),i.z=d.frustum.right-d.frustum.left,h.negate(h.UNIT_Z,o),h.clone(h.UNIT_Y,r);else{h.clone(d.positionWC,i),h.clone(d.directionWC,o),h.clone(d.upWC,r);let u=t.scaleToGeodeticSurface(i,iIt),m=_t.eastNorthUpToFixedFrame(u,t,rIt);P.inverseTransformation(m,m),n.mapProjection.project(t.cartesianToCartographic(i,oIt),i),P.multiplyByPointAsVector(m,o,o),P.multiplyByPointAsVector(m,r,r)}}let s;this._morphToOrthographic?(s=aIt,s.width=n.camera.frustum.right-n.camera.frustum.left,s.aspectRatio=n.drawingBufferWidth/n.drawingBufferHeight):(s=sIt,s.aspectRatio=n.drawingBufferWidth/n.drawingBufferHeight,s.fov=W.toRadians(60));let a=cIt;a.position=i,a.direction=o,a.up=r,a.frustum=s;let c=YIt(a);ck(this,c),this._previousMode===se.SCENE2D?NIt(this,e,a,c):(a.position2D=P.multiplyByPoint(Io.TRANSFORM_2D,i,eIt),a.direction2D=P.multiplyByPointAsVector(Io.TRANSFORM_2D,o,tIt),a.up2D=P.multiplyByPointAsVector(Io.TRANSFORM_2D,r,nIt),n._mode=se.MORPHING,aIe(this,e,a,c)),e===0&&l(this._completeMorph)&&this._completeMorph()};var vre={position:new h,direction:new h,up:new h,frustum:void 0},qFe=new qi;uR.prototype.morphTo3D=function(e,t){l(this._completeMorph)&&this._completeMorph();let n=this._scene;if(this._previousMode=n.mode,!(this._previousMode===se.SCENE3D||this._previousMode===se.MORPHING)){if(this._scene.morphStart.raiseEvent(this,this._previousMode,se.SCENE3D,!0),n._mode=se.MORPHING,n.camera._setTransform(P.IDENTITY),this._previousMode===se.SCENE2D)xIt(this,e,t);else{let i;e>0?(i=vre,h.fromDegrees(0,0,5*t.maximumRadius,t,i.position),h.negate(i.position,i.direction),h.normalize(i.direction,i.direction),h.clone(h.UNIT_Z,i.up)):i=$Fe(this,t);let o,r=n.camera;r.frustum instanceof yn?o=r.frustum.clone():(o=qFe,o.aspectRatio=n.drawingBufferWidth/n.drawingBufferHeight,o.fov=W.toRadians(60)),i.frustum=o;let s=lIe(i);ck(this,s),Wre(this,e,i,s)}e===0&&l(this._completeMorph)&&this._completeMorph()}};uR.prototype.isDestroyed=function(){return!1};uR.prototype.destroy=function(){return vK(this),ue(this)};function ck(e,t){if(e._scene.completeMorphOnUserInput){e._morphHandler=new aa(e._scene.canvas);let n=function(){e._morphCancelled=!0,e._scene.camera.cancelFlight(),t(e)};e._completeMorph=n,e._morphHandler.setInputAction(n,mn.LEFT_DOWN),e._morphHandler.setInputAction(n,mn.MIDDLE_DOWN),e._morphHandler.setInputAction(n,mn.RIGHT_DOWN),e._morphHandler.setInputAction(n,mn.WHEEL)}}function vK(e){let t=e._currentTweens;for(let n=0;n<t.length;++n)t[n].cancelTween();e._currentTweens.length=0,e._morphHandler=e._morphHandler&&e._morphHandler.destroy()}var lIt=new pe,dIt=new h,uIt=new P;function $Fe(e,t){let n=e._scene,i=n.camera,o=vre,r=o.position,s=o.direction,a=o.up,c=n.mapProjection.unproject(i.position,lIt);t.cartographicToCartesian(c,r);let d=t.scaleToGeodeticSurface(r,dIt),u=_t.eastNorthUpToFixedFrame(d,t,uIt);return P.multiplyByPointAsVector(u,i.direction,s),P.multiplyByPointAsVector(u,i.up,a),o}var mIt=new h,hIt=new h,fIt=new h,pIt=new h,bIt=new h,gIt=new h;function Wre(e,t,n,i){t*=.5;let o=e._scene,r=o.camera,s=h.clone(r.position,mIt),a=h.clone(r.direction,hIt),c=h.clone(r.up,fIt),d=P.multiplyByPoint(Io.TRANSFORM_2D_INVERSE,n.position,pIt),u=P.multiplyByPointAsVector(Io.TRANSFORM_2D_INVERSE,n.direction,bIt),m=P.multiplyByPointAsVector(Io.TRANSFORM_2D_INVERSE,n.up,gIt);function p(f){Zh(s,d,f.time,r.position),Zh(a,u,f.time,r.direction),Zh(c,m,f.time,r.up),h.cross(r.direction,r.up,r.right),h.normalize(r.right,r.right)}let b=o.tweens.add({duration:t,easingFunction:vs.QUARTIC_OUT,startObject:{time:0},stopObject:{time:1},update:p,complete:function(){cIe(e,o,0,1,t,i)}});e._currentTweens.push(b)}var yIt=new yn,eIe=new h,tIe=new h,nIe=new h,Fre=new h,iIe=new h,oIe=new h;function xIt(e,t,n){t/=3;let i=e._scene,o=i.camera,r;t>0?(r=vre,h.fromDegrees(0,0,5*n.maximumRadius,n,r.position),h.negate(r.position,r.direction),h.normalize(r.direction,r.direction),h.clone(h.UNIT_Z,r.up)):(o.position.z=o.frustum.right-o.frustum.left,r=$Fe(e,n));let s;e._morphToOrthographic?(s=yIt,s.aspectRatio=i.drawingBufferWidth/i.drawingBufferHeight,s.width=o.frustum.right-o.frustum.left):(s=qFe,s.aspectRatio=i.drawingBufferWidth/i.drawingBufferHeight,s.fov=W.toRadians(60)),r.frustum=s;let a=lIe(r);ck(e,a);let c;e._morphToOrthographic?c=function(){Wre(e,t,r,a)}:c=function(){sIe(e,t,r,function(){Wre(e,t,r,a)})},t>0?(i._mode=se.SCENE2D,o.flyTo({duration:t,destination:h.fromDegrees(0,0,5*n.maximumRadius,n,Fre),complete:function(){i._mode=se.MORPHING,c()}})):c()}function Zh(e,t,n,i){return h.lerp(e,t,n,i)}function rIe(e,t,n,i,o){let r=e._scene,s=r.camera;if(s.frustum instanceof yn)return;let a=s.frustum.fov,c=W.RADIANS_PER_DEGREE*.5,d=n.position.z*Math.tan(a*.5);s.frustum.far=d/Math.tan(c*.5)+1e7;function u(p){s.frustum.fov=W.lerp(a,c,p.time);let b=d/Math.tan(s.frustum.fov*.5);i(s,b)}let m=r.tweens.add({duration:t,easingFunction:vs.QUARTIC_OUT,startObject:{time:0},stopObject:{time:1},update:u,complete:function(){s.frustum=n.frustum.clone(),o(e)}});e._currentTweens.push(m)}var TIt=new h,_It=new h,SIt=new h,Lre=new h,ZIt=new h,RIt=new h,CIt=new ps,VIt=new gn,EIt=new h,AIt={position:void 0,direction:void 0,up:void 0,frustum:void 0};function GIt(e,t){t*=.5;let n=e._scene,i=n.camera,o=h.clone(i.position,TIt),r=h.clone(i.direction,_It),s=h.clone(i.up,SIt),a=h.negate(h.UNIT_Z,ZIt),c=h.clone(h.UNIT_Y,RIt),d=Lre;if(t>0)h.clone(h.ZERO,Lre),d.z=5*n.ellipsoid.maximumRadius;else{h.clone(o,Lre);let _=VIt;P.multiplyByPoint(Io.TRANSFORM_2D,o,_.origin),P.multiplyByPointAsVector(Io.TRANSFORM_2D,r,_.direction);let S=n.globe;if(l(S)){let Z=S.pickWorldCoordinates(_,n,!0,EIt);l(Z)&&(P.multiplyByPoint(Io.TRANSFORM_2D_INVERSE,Z,d),d.z+=h.distance(o,d))}}let u=CIt;u.right=d.z*.5,u.left=-u.right,u.top=u.right*(n.drawingBufferHeight/n.drawingBufferWidth),u.bottom=-u.top;let m=AIt;m.position=d,m.direction=a,m.up=c,m.frustum=u;let p=dIe(m);ck(e,p);function b(_){Zh(o,d,_.time,i.position),Zh(r,a,_.time,i.direction),Zh(s,c,_.time,i.up),h.cross(i.direction,i.up,i.right),h.normalize(i.right,i.right),i._adjustOrthographicFrustum(!0)}function f(_,S){_.position.z=S}let y=n.tweens.add({duration:t,easingFunction:vs.QUARTIC_OUT,startObject:{time:0},stopObject:{time:1},update:b,complete:function(){rIe(e,t,m,f,p)}});e._currentTweens.push(y)}var QFe=new pe,LIt={position:new h,direction:new h,up:new h,position2D:new h,direction2D:new h,up2D:new h,frustum:new ps},WIt={position:new h,direction:new h,up:new h,frustum:void 0},vIt=new h,FIt=new gn,IIt=new P,PIt=new h;function XIt(e,t,n){t*=.5;let i=e._scene,o=i.camera,r=LIt;if(t>0)h.clone(h.ZERO,r.position),r.position.z=5*n.maximumRadius,h.negate(h.UNIT_Z,r.direction),h.clone(h.UNIT_Y,r.up);else{n.cartesianToCartographic(o.positionWC,QFe),i.mapProjection.project(QFe,r.position),h.negate(h.UNIT_Z,r.direction),h.clone(h.UNIT_Y,r.up);let m=FIt;h.clone(r.position2D,m.origin);let p=h.clone(o.directionWC,m.direction),b=n.scaleToGeodeticSurface(o.positionWC,PIt),f=_t.eastNorthUpToFixedFrame(b,n,IIt);P.inverseTransformation(f,f),P.multiplyByPointAsVector(f,p,p),P.multiplyByPointAsVector(Io.TRANSFORM_2D,p,p);let y=i.globe;if(l(y)){let _=y.pickWorldCoordinates(m,i,!0,vIt);if(l(_)){let S=h.distance(r.position2D,_);_.x+=S,h.clone(_,r.position2D)}}}function s(m,p){m.position.x=p}P.multiplyByPoint(Io.TRANSFORM_2D,r.position,r.position2D),P.multiplyByPointAsVector(Io.TRANSFORM_2D,r.direction,r.direction2D),P.multiplyByPointAsVector(Io.TRANSFORM_2D,r.up,r.up2D);let a=r.frustum;a.right=r.position.z*.5,a.left=-a.right,a.top=a.right*(i.drawingBufferHeight/i.drawingBufferWidth),a.bottom=-a.top;let c=WIt;P.multiplyByPoint(Io.TRANSFORM_2D_INVERSE,r.position2D,c.position),h.clone(r.direction,c.direction),h.clone(r.up,c.up),c.frustum=a;let d=dIe(c);ck(e,d);function u(){rIe(e,t,r,s,d)}aIe(e,t,r,u)}function sIe(e,t,n,i){let o=e._scene,r=o.camera,s=r.frustum.right-r.frustum.left;r.frustum=n.frustum.clone();let a=r.frustum.fov,c=W.RADIANS_PER_DEGREE*.5,d=s*Math.tan(a*.5);r.frustum.far=d/Math.tan(c*.5)+1e7,r.frustum.fov=c;function u(p){r.frustum.fov=W.lerp(c,a,p.time),r.position.z=d/Math.tan(r.frustum.fov*.5)}let m=o.tweens.add({duration:t,easingFunction:vs.QUARTIC_OUT,startObject:{time:0},stopObject:{time:1},update:u,complete:function(){i(e)}});e._currentTweens.push(m)}function NIt(e,t,n,i){t*=.5;let o=e._scene,r=o.camera,s=h.clone(n.position,Fre),a=h.clone(n.direction,iIe),c=h.clone(n.up,oIe);o._mode=se.MORPHING;function d(){r.frustum=n.frustum.clone();let u=h.clone(r.position,eIe),m=h.clone(r.direction,tIe),p=h.clone(r.up,nIe);u.z=s.z;function b(y){Zh(u,s,y.time,r.position),Zh(m,a,y.time,r.direction),Zh(p,c,y.time,r.up),h.cross(r.direction,r.up,r.right),h.normalize(r.right,r.right)}let f=o.tweens.add({duration:t,easingFunction:vs.QUARTIC_OUT,startObject:{time:0},stopObject:{time:1},update:b,complete:function(){i(e)}});e._currentTweens.push(f)}e._morphToOrthographic?d():sIe(e,0,n,d)}function aIe(e,t,n,i){let o=e._scene,r=o.camera,s=h.clone(r.position,eIe),a=h.clone(r.direction,tIe),c=h.clone(r.up,nIe),d=h.clone(n.position2D,Fre),u=h.clone(n.direction2D,iIe),m=h.clone(n.up2D,oIe);function p(f){Zh(s,d,f.time,r.position),Zh(a,u,f.time,r.direction),Zh(c,m,f.time,r.up),h.cross(r.direction,r.up,r.right),h.normalize(r.right,r.right),r._adjustOrthographicFrustum(!0)}let b=o.tweens.add({duration:t,easingFunction:vs.QUARTIC_OUT,startObject:{time:0},stopObject:{time:1},update:p,complete:function(){cIe(e,o,1,0,t,i)}});e._currentTweens.push(b)}function cIe(e,t,n,i,o,r){let s={object:t,property:"morphTime",startValue:n,stopValue:i,duration:o,easingFunction:vs.QUARTIC_OUT};l(r)&&(s.complete=function(){r(e)});let a=t.tweens.addProperty(s);e._currentTweens.push(a)}function lIe(e){return function(t){let n=t._scene;n._mode=se.SCENE3D,n.morphTime=se.getMorphTime(se.SCENE3D),vK(t);let i=n.camera;(t._previousMode!==se.MORPHING||t._morphCancelled)&&(t._morphCancelled=!1,h.clone(e.position,i.position),h.clone(e.direction,i.direction),h.clone(e.up,i.up),h.cross(i.direction,i.up,i.right),h.normalize(i.right,i.right),i.frustum=e.frustum.clone());let o=i.frustum;n.frameState.useLogDepth&&(o.near=.1,o.far=1e10);let r=l(t._completeMorph);t._completeMorph=void 0,n.camera.update(n.mode),t._scene.morphComplete.raiseEvent(t,t._previousMode,se.SCENE3D,r)}}function dIe(e){return function(t){let n=t._scene;n._mode=se.SCENE2D,n.morphTime=se.getMorphTime(se.SCENE2D),vK(t);let i=n.camera;h.clone(e.position,i.position),i.position.z=n.ellipsoid.maximumRadius*2,h.clone(e.direction,i.direction),h.clone(e.up,i.up),h.cross(i.direction,i.up,i.right),h.normalize(i.right,i.right),i.frustum=e.frustum.clone();let o=l(t._completeMorph);t._completeMorph=void 0,n.camera.update(n.mode),t._scene.morphComplete.raiseEvent(t,t._previousMode,se.SCENE2D,o)}}function YIt(e){return function(t){let n=t._scene;n._mode=se.COLUMBUS_VIEW,n.morphTime=se.getMorphTime(se.COLUMBUS_VIEW),vK(t);let i=n.camera;(t._previousModeMode!==se.MORPHING||t._morphCancelled)&&(t._morphCancelled=!1,h.clone(e.position,i.position),h.clone(e.direction,i.direction),h.clone(e.up,i.up),h.cross(i.direction,i.up,i.right),h.normalize(i.right,i.right));let o=i.frustum;n.frameState.useLogDepth&&(o.near=.1,o.far=1e10);let r=l(t._completeMorph);t._completeMorph=void 0,n.camera.update(n.mode),t._scene.morphComplete.raiseEvent(t,t._previousMode,se.COLUMBUS_VIEW,r)}}var lk=uR;var Vxo=x(T(),1);var Oyo=x(T(),1);var Iyo=x(T(),1),uIe={LEFT_DRAG:0,RIGHT_DRAG:1,MIDDLE_DRAG:2,WHEEL:3,PINCH:4};Object.freeze(uIe);var lo=uIe;var bIe=[ir.SHIFT,ir.CTRL,ir.ALT,[ir.SHIFT,ir.CTRL],[ir.SHIFT,ir.ALT],[ir.CTRL,ir.ALT],[ir.SHIFT,ir.CTRL,ir.ALT]];function Qa(e,t){if(!l(t))return`${e}`;let n=Array.isArray(t)?t.toSorted():[t];return`${e}+${n.join("+")}`}function MIt(e,t){k.clone(e.distance.startPosition,t.distance.startPosition),k.clone(e.distance.endPosition,t.distance.endPosition),k.clone(e.angleAndHeight.startPosition,t.angleAndHeight.startPosition),k.clone(e.angleAndHeight.endPosition,t.angleAndHeight.endPosition)}function mIe(e,t,n){let i=Qa(lo.PINCH,t),o=e._update,r=e._isDown,s=e._eventStartPosition,a=e._pressTime,c=e._releaseTime;o[i]=!0,r[i]=!1,s[i]=new k;let d=e._movement[i];l(d)||(d=e._movement[i]={}),d.distance={startPosition:new k,endPosition:new k},d.angleAndHeight={startPosition:new k,endPosition:new k},d.prevAngle=0,e._eventHandler.setInputAction(function(u){e._buttonsDown++,r[i]=!0,a[i]=new Date,k.lerp(u.position1,u.position2,.5,s[i])},mn.PINCH_START,t),e._eventHandler.setInputAction(function(){e._buttonsDown=Math.max(e._buttonsDown-1,0),r[i]=!1,c[i]=new Date},mn.PINCH_END,t),e._eventHandler.setInputAction(function(u){if(r[i]){o[i]?(MIt(u,d),o[i]=!1,d.prevAngle=d.angleAndHeight.startPosition.x):(k.clone(u.distance.endPosition,d.distance.endPosition),k.clone(u.angleAndHeight.endPosition,d.angleAndHeight.endPosition));let m=d.angleAndHeight.endPosition.x,p=d.prevAngle,b=Math.PI*2;for(;m>=p+Math.PI;)m-=b;for(;m<p-Math.PI;)m+=b;d.angleAndHeight.endPosition.x=-m*n.clientWidth/12,d.angleAndHeight.startPosition.x=-p*n.clientWidth/12}},mn.PINCH_MOVE,t)}function hIe(e,t){let n=Qa(lo.WHEEL,t),i=e._pressTime,o=e._releaseTime,r=e._update;r[n]=!0;let s=e._movement[n];l(s)||(s=e._movement[n]={});let a=e._lastMovement[n];l(a)||(a=e._lastMovement[n]={startPosition:new k,endPosition:new k,valid:!1}),s.startPosition=new k,k.clone(k.ZERO,s.startPosition),s.endPosition=new k,e._eventHandler.setInputAction(function(c){let d=7.5*W.toRadians(c);i[n]=o[n]=new Date,s.endPosition.x=0,s.endPosition.y=d,k.clone(s.endPosition,a.endPosition),a.valid=!0,r[n]=!1},mn.WHEEL,t)}function lA(e,t,n){let i=Qa(n,t),o=e._isDown,r=e._eventStartPosition,s=e._pressTime;o[i]=!1,r[i]=new k;let a=e._lastMovement[i];l(a)||(a=e._lastMovement[i]={startPosition:new k,endPosition:new k,valid:!1});let c,d;n===lo.LEFT_DRAG?(c=mn.LEFT_DOWN,d=mn.LEFT_UP):n===lo.RIGHT_DRAG?(c=mn.RIGHT_DOWN,d=mn.RIGHT_UP):n===lo.MIDDLE_DRAG&&(c=mn.MIDDLE_DOWN,d=mn.MIDDLE_UP),e._eventHandler.setInputAction(function(u){e._buttonsDown++,a.valid=!1,o[i]=!0,s[i]=new Date,k.clone(u.position,r[i])},c,t),e._eventHandler.setInputAction(function(){Ire(Qa(n,void 0),e);for(let u of bIe){let m=Qa(n,u);Ire(m,e)}},d,t)}function Ire(e,t){let n=t._releaseTime,i=t._isDown;i[e]&&(t._buttonsDown=Math.max(t._buttonsDown-1,0)),i[e]=!1,n[e]=new Date}function fIe(e,t){k.clone(e.startPosition,t.startPosition),k.clone(e.endPosition,t.endPosition)}function wIt(e,t,n){let i=n._isDown,o=!1,r=Qa(e,t);for(let[c,d]of Object.entries(i))c.startsWith(e)&&d&&c!==r&&(o=!0,Ire(c,n));if(!o)return;let s=n._pressTime,a=n._lastMovement[r];l(a)||(a=n._lastMovement[r]={startPosition:new k,endPosition:new k,valid:!1}),n._buttonsDown++,a.valid=!1,i[r]=!0,s[r]=new Date}function pIe(e,t){let n=e._update,i=e._movement,o=e._lastMovement,r=e._isDown;for(let s in lo)if(lo.hasOwnProperty(s)){let a=lo[s];if(l(a)){let c=Qa(a,t);n[c]=!0,l(e._lastMovement[c])||(e._lastMovement[c]={startPosition:new k,endPosition:new k,valid:!1}),l(e._movement[c])||(e._movement[c]={startPosition:new k,endPosition:new k})}}e._eventHandler.setInputAction(function(s){for(let a in lo)if(lo.hasOwnProperty(a)){let c=lo[a];if(l(c)){let d=Qa(c,t);wIt(c,t,e),r[d]&&(n[d]?(fIe(i[d],o[d]),o[d].valid=!0,fIe(s,i[d]),n[d]=!1):k.clone(s.endPosition,i[d].endPosition))}}k.clone(s.endPosition,e._currentMousePosition)},mn.MOUSE_MOVE,t)}function Rh(e){this._eventHandler=new aa(e),this._update={},this._movement={},this._lastMovement={},this._isDown={},this._eventStartPosition={},this._pressTime={},this._releaseTime={},this._buttonsDown=0,this._currentMousePosition=new k,hIe(this,void 0),mIe(this,void 0,e),lA(this,void 0,lo.LEFT_DRAG),lA(this,void 0,lo.RIGHT_DRAG),lA(this,void 0,lo.MIDDLE_DRAG),pIe(this,void 0);for(let t of bIe)hIe(this,t),mIe(this,t,e),lA(this,t,lo.LEFT_DRAG),lA(this,t,lo.RIGHT_DRAG),lA(this,t,lo.MIDDLE_DRAG),pIe(this,t)}Object.defineProperties(Rh.prototype,{currentMousePosition:{get:function(){return this._currentMousePosition}},anyButtonDown:{get:function(){let e=!this._update[Qa(lo.WHEEL)]||!this._update[Qa(lo.WHEEL,ir.SHIFT)]||!this._update[Qa(lo.WHEEL,ir.CTRL)]||!this._update[Qa(lo.WHEEL,ir.ALT)];return this._buttonsDown>0||e}}});Rh.prototype.isMoving=function(e,t){let n=Qa(e,t);return!this._update[n]};Rh.prototype.getMovement=function(e,t){let n=Qa(e,t);return this._movement[n]};Rh.prototype.getLastMovement=function(e,t){let n=Qa(e,t),i=this._lastMovement[n];if(i.valid)return i};Rh.prototype.isButtonDown=function(e,t){let n=Qa(e,t);return this._isDown[n]};Rh.prototype.getStartMousePosition=function(e,t){if(e===lo.WHEEL)return this._currentMousePosition;let n=Qa(e,t);return this._eventStartPosition[n]};Rh.prototype.getButtonPressTime=function(e,t){let n=Qa(e,t);return this._pressTime[n]};Rh.prototype.getButtonReleaseTime=function(e,t){let n=Qa(e,t);return this._releaseTime[n]};Rh.prototype.reset=function(){for(let e in this._update)this._update.hasOwnProperty(e)&&(this._update[e]=!0)};Rh.prototype.isDestroyed=function(){return!1};Rh.prototype.destroy=function(){return this._eventHandler=this._eventHandler&&this._eventHandler.destroy(),ue(this)};var dk=Rh;var $yo=x(T(),1);function FK(e,t,n,i,o,r,s,a,c,d){this._tweens=e,this._tweenjs=t,this._startObject=$e(n),this._stopObject=$e(i),this._duration=o,this._delay=r,this._easingFunction=s,this._update=a,this._complete=c,this.cancel=d,this.needsStart=!0}Object.defineProperties(FK.prototype,{startObject:{get:function(){return this._startObject}},stopObject:{get:function(){return this._stopObject}},duration:{get:function(){return this._duration}},delay:{get:function(){return this._delay}},easingFunction:{get:function(){return this._easingFunction}},update:{get:function(){return this._update}},complete:{get:function(){return this._complete}},tweenjs:{get:function(){return this._tweenjs}}});FK.prototype.cancelTween=function(){this._tweens.remove(this)};function np(){this._tweens=[]}Object.defineProperties(np.prototype,{length:{get:function(){return this._tweens.length}}});np.prototype.add=function(e){if(e=e??B.EMPTY_OBJECT,e.duration===0)return l(e.complete)&&e.complete(),new FK(this);let t=e.duration/wn.SECONDS_PER_MILLISECOND,n=e.delay??0,i=n/wn.SECONDS_PER_MILLISECOND,o=e.easingFunction??vs.LINEAR_NONE,r=e.startObject,s=new VWe(r);s.to($e(e.stopObject),t),s.delay(i),s.easing(o),l(e.update)&&s.onUpdate(function(){e.update(r)}),s.onComplete(e.complete??null),s.repeat(e._repeat??0);let a=new FK(this,s,e.startObject,e.stopObject,e.duration,n,o,e.update,e.complete,e.cancel);return this._tweens.push(a),a};np.prototype.addProperty=function(e){e=e??B.EMPTY_OBJECT;let t=e.object,n=e.property,i=e.startValue,o=e.stopValue;function r(s){t[n]=s.value}return this.add({startObject:{value:i},stopObject:{value:o},duration:e.duration??3,delay:e.delay,easingFunction:e.easingFunction,update:r,complete:e.complete,cancel:e.cancel,_repeat:e._repeat})};np.prototype.addAlpha=function(e){e=e??B.EMPTY_OBJECT;let t=e.material,n=[];for(let o in t.uniforms)t.uniforms.hasOwnProperty(o)&&l(t.uniforms[o])&&l(t.uniforms[o].alpha)&&n.push(o);function i(o){let r=n.length;for(let s=0;s<r;++s)t.uniforms[n[s]].alpha=o.alpha}return this.add({startObject:{alpha:e.startValue??0},stopObject:{alpha:e.stopValue??1},duration:e.duration??3,delay:e.delay,easingFunction:e.easingFunction,update:i,complete:e.complete,cancel:e.cancel})};np.prototype.addOffsetIncrement=function(e){e=e??B.EMPTY_OBJECT;let n=e.material.uniforms;return this.addProperty({object:n,property:"offset",startValue:n.offset,stopValue:n.offset+1,duration:e.duration,delay:e.delay,easingFunction:e.easingFunction,update:e.update,cancel:e.cancel,_repeat:1/0})};np.prototype.remove=function(e){if(!l(e))return!1;let t=this._tweens.indexOf(e);return t!==-1?(e.tweenjs.stop(),l(e.cancel)&&e.cancel(),this._tweens.splice(t,1),!0):!1};np.prototype.removeAll=function(){let e=this._tweens;for(let t=0;t<e.length;++t){let n=e[t];n.tweenjs.stop(),l(n.cancel)&&n.cancel()}e.length=0};np.prototype.contains=function(e){return l(e)&&this._tweens.indexOf(e)!==-1};np.prototype.get=function(e){return this._tweens[e]};np.prototype.update=function(e){let t=this._tweens,n=0;for(e=l(e)?e/wn.SECONDS_PER_MILLISECOND:Zn();n<t.length;){let i=t[n],o=i.tweenjs;if(i.needsStart)i.needsStart=!1,o.start(e);else if(o.update(e))n++;else{if(t[n]?.needsStart)continue;o.stop(),t.splice(n,1)}}};var mR=np;function mk(e){this.enableInputs=!0,this.enableTranslate=!0,this.enableZoom=!0,this.enableRotate=!0,this.enableTilt=!0,this.enableLook=!0,this.inertiaSpin=.9,this.inertiaTranslate=.9,this.inertiaZoom=.8,this.maximumMovementRatio=.1,this.bounceAnimationTime=3,this.minimumZoomDistance=1,this.maximumZoomDistance=Number.POSITIVE_INFINITY,this.zoomFactor=5,this.translateEventTypes=lo.LEFT_DRAG,this.zoomEventTypes=[lo.RIGHT_DRAG,lo.WHEEL,lo.PINCH],this.rotateEventTypes=lo.LEFT_DRAG,this.tiltEventTypes=[lo.MIDDLE_DRAG,lo.PINCH,{eventType:lo.LEFT_DRAG,modifier:ir.CTRL},{eventType:lo.RIGHT_DRAG,modifier:ir.CTRL}],this.lookEventTypes={eventType:lo.LEFT_DRAG,modifier:ir.SHIFT};let t=e.ellipsoid??ne.default;this.minimumPickingTerrainHeight=ne.WGS84.equals(t)?15e4:t.minimumRadius*.025,this._minimumPickingTerrainHeight=this.minimumPickingTerrainHeight,this.minimumPickingTerrainDistanceWithInertia=ne.WGS84.equals(t)?4e3:t.minimumRadius*63e-5,this.minimumCollisionTerrainHeight=ne.WGS84.equals(t)?15e3:t.minimumRadius*.0025,this._minimumCollisionTerrainHeight=this.minimumCollisionTerrainHeight,this.minimumTrackBallHeight=ne.WGS84.equals(t)?75e5:t.minimumRadius*1.175,this._minimumTrackBallHeight=this.minimumTrackBallHeight,this.enableCollisionDetection=!0,this.maximumTiltAngle=void 0,this._scene=e,this._globe=void 0,this._ellipsoid=t,this._lastGlobeHeight=0,this._aggregator=new dk(e.canvas),this._lastInertiaSpinMovement=void 0,this._lastInertiaZoomMovement=void 0,this._lastInertiaTranslateMovement=void 0,this._lastInertiaTiltMovement=void 0,this._inertiaDisablers={_lastInertiaZoomMovement:["_lastInertiaSpinMovement","_lastInertiaTranslateMovement","_lastInertiaTiltMovement"],_lastInertiaTiltMovement:["_lastInertiaSpinMovement","_lastInertiaTranslateMovement"]},this._tweens=new mR,this._tween=void 0,this._horizontalRotationAxis=void 0,this._tiltCenterMousePosition=new k(-1,-1),this._tiltCenter=new h,this._rotateMousePosition=new k(-1,-1),this._rotateStartPosition=new h,this._strafeStartPosition=new h,this._strafeMousePosition=new k,this._strafeEndMousePosition=new k,this._zoomMouseStart=new k(-1,-1),this._zoomWorldPosition=new h,this._useZoomWorldPosition=!1,this._panLastMousePosition=new k,this._panLastWorldPosition=new h,this._tiltCVOffMap=!1,this._looking=!1,this._rotating=!1,this._strafing=!1,this._zoomingOnVector=!1,this._zoomingUnderground=!1,this._rotatingZoom=!1,this._adjustedHeightForTerrain=!1,this._cameraUnderground=!1;let n=e.mapProjection;this._maxCoord=n.project(new pe(Math.PI,W.PI_OVER_TWO)),this._rotateFactor=void 0,this._rotateRateRangeAdjustment=void 0,this._maximumRotateRate=1.77,this._minimumRotateRate=1/5e3,this._minimumZoomRate=20,this._maximumZoomRate=5906376272e3,this._minimumUndergroundPickDistance=2e3,this._maximumUndergroundPickDistance=1e4}function kIt(e,t){if(e<0)return 0;let n=(1-t)*25;return Math.exp(-n*e)}function UIt(e){return k.equalsEpsilon(e.startPosition,e.endPosition,W.EPSILON14)}var DIt=.4;function OIt(e,t,n,i,o,r,s){let a=r[s];l(a)||(a=r[s]={startPosition:new k,endPosition:new k,motion:new k,inertiaEnabled:!0});let c=e.getButtonPressTime(t,n),d=e.getButtonReleaseTime(t,n),u=c&&d&&(d.getTime()-c.getTime())/1e3,p=d&&(new Date().getTime()-d.getTime())/1e3;if(c&&d&&u<DIt){let b=kIt(p,i),f=e.getLastMovement(t,n);if(!l(f)||UIt(f)||!a.inertiaEnabled||(a.motion.x=(f.endPosition.x-f.startPosition.x)*.5,a.motion.y=(f.endPosition.y-f.startPosition.y)*.5,a.startPosition=k.clone(f.startPosition,a.startPosition),a.endPosition=k.multiplyByScalar(a.motion,b,a.endPosition),a.endPosition=k.add(a.startPosition,a.endPosition,a.endPosition),isNaN(a.endPosition.x)||isNaN(a.endPosition.y)||k.distance(a.startPosition,a.endPosition)<.5))return;if(!e.isButtonDown(t,n)){let y=e.getStartMousePosition(t,n);o(r,y,a)}}}function BIt(e,t){if(l(t)){let n=e[t];l(n)&&(n.inertiaEnabled=!0);let i=e._inertiaDisablers[t];if(l(i)){let o=i.length;for(let r=0;r<o;++r)n=e[i[r]],l(n)&&(n.inertiaEnabled=!1)}}}var gIe=[];function gd(e,t,n,i,o,r){if(!l(n))return;let s=e._aggregator;Array.isArray(n)||(gIe[0]=n,n=gIe);let a=n.length;for(let c=0;c<a;++c){let d=n[c],u=l(d.eventType)?d.eventType:d,m=d.modifier,p=s.isMoving(u,m)&&s.getMovement(u,m),b=s.getStartMousePosition(u,m);e.enableInputs&&t&&(p?(i(e,b,p),BIt(e,r)):o<1&&OIt(s,u,m,o,i,e,r))}}var IK=new gn,zIt=new h,HIt=new k,KIt=new h,JIt=new k,jIt=new h,QIt=new h,qIt=new h,$It=new h,GIe=new h,ePt=new h,tPt=new h,nPt=new h,iPt=new h,oPt=new h,rPt=new h,sPt=new h,aPt=new h,cPt=new h,lPt=new h,hR=new h,yIe=new h,xIe=new h,Pre={orientation:new Cc};function Dre(e,t,n,i,o,r){let s=1;l(r)&&(s=W.clamp(Math.abs(r),.25,1));let a=n.endPosition.y-n.startPosition.y,d=a>0?e.minimumZoomDistance*s:0,u=e.maximumZoomDistance,m=o-d,p=i*m;p=W.clamp(p,e._minimumZoomRate,e._maximumZoomRate);let b=a/e._scene.canvas.clientHeight;b=Math.min(b,e.maximumMovementRatio);let f=p*b;if(e.enableCollisionDetection||e.minimumZoomDistance===0||!l(e._globe)){if(f>0&&Math.abs(o-d)<1||f<0&&Math.abs(o-u)<1)return;o-f<d?f=o-d-1:o-f>u&&(f=o-u)}let y=e._scene,_=y.camera,S=y.mode,Z=Pre.orientation;Z.heading=_.heading,Z.pitch=_.pitch,Z.roll=_.roll;let R=n.inertiaEnabled??k.equals(t,e._zoomMouseStart),C=e._zoomingOnVector,E=e._rotatingZoom,A;if(R||(e._zoomMouseStart=k.clone(t,e._zoomMouseStart),l(e._globe)&&S===se.SCENE2D?(A=_.getPickRay(t,IK).origin,A=h.fromElements(A.y,A.z,A.x)):l(e._globe)&&(A=ry(e,t,zIt)),l(A)?(e._useZoomWorldPosition=!0,e._zoomWorldPosition=h.clone(A,e._zoomWorldPosition)):e._useZoomWorldPosition=!1,C=e._zoomingOnVector=!1,E=e._rotatingZoom=!1,e._zoomingUnderground=e._cameraUnderground),!e._useZoomWorldPosition){_.zoomIn(f);return}let L=S===se.COLUMBUS_VIEW;if(_.positionCartographic.height<2e6&&(E=!0),!R||E){if(S===se.SCENE2D){let F=e._zoomWorldPosition,I=_.position;if(!h.equals(F,I)&&_.positionCartographic.height<e._maxCoord.x*2){let N=_.position.x,g=h.subtract(F,I,KIt);h.normalize(g,g);let V=h.distance(F,I)*f/(_.getMagnitude()*.5);_.move(g,V*.5),(_.position.x<0&&N>0||_.position.x>0&&N<0)&&(A=_.getPickRay(t,IK).origin,A=h.fromElements(A.y,A.z,A.x),e._zoomWorldPosition=h.clone(A,e._zoomWorldPosition))}}else if(S===se.SCENE3D){let F=h.normalize(_.position,GIe);if(e._cameraUnderground||e._zoomingUnderground||_.positionCartographic.height<3e3&&Math.abs(h.dot(_.direction,F))<.6)L=!0;else{let I=y.canvas,N=JIt;N.x=I.clientWidth/2,N.y=I.clientHeight/2;let g=ry(e,N,jIt);if(!l(g))L=!0;else if(_.positionCartographic.height<1e6)if(h.dot(_.direction,F)>=-.5)L=!0;else{let V=tPt;h.clone(_.position,V);let G=e._zoomWorldPosition,v=ePt;if(v=h.normalize(G,v),h.dot(v,F)<0)return;let X=lPt,Y=oPt;h.clone(_.direction,Y),h.add(V,h.multiplyByScalar(Y,1e3,hR),X);let D=rPt,M=sPt;h.subtract(G,V,D),h.normalize(D,M);let O=h.dot(F,M);if(O>=0){e._zoomMouseStart.x=-1;return}let w=Math.acos(-O),z=h.magnitude(V),K=h.magnitude(G),te=z-f,H=h.magnitude(D),$=Math.asin(W.clamp(H/K*Math.sin(w),-1,1)),ee=Math.asin(W.clamp(te/K*Math.sin(w),-1,1)),le=$-ee+w,_e=nPt;h.normalize(V,_e);let he=iPt;he=h.cross(M,_e,he),he=h.normalize(he,he),h.normalize(h.cross(_e,he,hR),Y),h.multiplyByScalar(h.normalize(X,hR),h.magnitude(X)-f,X),h.normalize(V,V),h.multiplyByScalar(V,te,V);let Ze=aPt;h.multiplyByScalar(h.add(h.multiplyByScalar(_e,Math.cos(le)-1,yIe),h.multiplyByScalar(Y,Math.sin(le),xIe),hR),te,Ze),h.add(V,Ze,V),h.normalize(X,_e),h.normalize(h.cross(_e,he,hR),Y);let ye=cPt;h.multiplyByScalar(h.add(h.multiplyByScalar(_e,Math.cos(le)-1,yIe),h.multiplyByScalar(Y,Math.sin(le),xIe),hR),h.magnitude(X),ye),h.add(X,ye,X),h.clone(V,_.position),h.normalize(h.subtract(X,V,hR),_.direction),h.clone(_.direction,_.direction),h.cross(_.direction,_.up,_.right),h.cross(_.right,_.direction,_.up),_.setView(Pre);return}else{let V=h.normalize(g,QIt),G=h.normalize(e._zoomWorldPosition,qIt),v=h.dot(G,V);if(v>0&&v<1){let X=W.acosClamped(v),Y=h.cross(G,V,$It),D=Math.abs(X)>W.toRadians(20)?_.positionCartographic.height*.75:_.positionCartographic.height-f,M=f/D;_.rotate(Y,X*M)}}}}e._rotatingZoom=!L}if(!R&&L||C){let F,I=fo.worldToWindowCoordinates(y,e._zoomWorldPosition,HIt);S!==se.COLUMBUS_VIEW&&k.equals(t,e._zoomMouseStart)&&l(I)?F=_.getPickRay(I,IK):F=_.getPickRay(t,IK);let N=F.direction;(S===se.COLUMBUS_VIEW||S===se.SCENE2D)&&h.fromElements(N.y,N.z,N.x,N),_.move(N,f),e._zoomingOnVector=!0}else _.zoomIn(f);e._cameraUnderground||_.setView(Pre)}var dPt=new gn,uPt=new gn,mPt=new h;function hPt(e,t,n){let o=e._scene.camera,r=o.getPickRay(n.startPosition,dPt).origin,s=o.getPickRay(n.endPosition,uPt).origin;r=h.fromElements(r.y,r.z,r.x,r),s=h.fromElements(s.y,s.z,s.x,s);let a=h.subtract(r,s,mPt),c=h.magnitude(a);c>0&&(h.normalize(a,a),o.move(a,c))}function TIe(e,t,n){l(n.distance)&&(n=n.distance);let o=e._scene.camera;Dre(e,t,n,e.zoomFactor,o.getMagnitude())}var fPt=new k,pPt=new k;function _Ie(e,t,n){if(l(n.angleAndHeight)){bPt(e,t,n.angleAndHeight);return}let i=e._scene,o=i.camera,r=i.canvas,s=r.clientWidth,a=r.clientHeight,c=fPt;c.x=2/s*n.startPosition.x-1,c.y=2/a*(a-n.startPosition.y)-1,c=k.normalize(c,c);let d=pPt;d.x=2/s*n.endPosition.x-1,d.y=2/a*(a-n.endPosition.y)-1,d=k.normalize(d,d);let u=W.acosClamped(c.x);c.y<0&&(u=W.TWO_PI-u);let m=W.acosClamped(d.x);d.y<0&&(m=W.TWO_PI-m);let p=m-u;o.twistRight(p)}function bPt(e,t,n){let i=e._rotateFactor*e._rotateRateRangeAdjustment;i>e._maximumRotateRate&&(i=e._maximumRotateRate),i<e._minimumRotateRate&&(i=e._minimumRotateRate);let o=e._scene,r=o.camera,s=o.canvas,a=(n.endPosition.x-n.startPosition.x)/s.clientWidth;a=Math.min(a,e.maximumMovementRatio);let c=i*a*Math.PI*4;r.twistRight(c)}function gPt(e){let t=e._scene.mapMode2D===pd.ROTATE;P.equals(P.IDENTITY,e._scene.camera.transform)?(gd(e,e.enableTranslate,e.translateEventTypes,hPt,e.inertiaTranslate,"_lastInertiaTranslateMovement"),gd(e,e.enableZoom,e.zoomEventTypes,TIe,e.inertiaZoom,"_lastInertiaZoomMovement"),t&&gd(e,e.enableRotate,e.tiltEventTypes,_Ie,e.inertiaSpin,"_lastInertiaTiltMovement")):(gd(e,e.enableZoom,e.zoomEventTypes,TIe,e.inertiaZoom,"_lastInertiaZoomMovement"),t&&gd(e,e.enableRotate,e.translateEventTypes,_Ie,e.inertiaSpin,"_lastInertiaSpinMovement"))}var LIe=new gn,yPt=new h,xPt=new h;function ry(e,t,n){let i=e._scene,o=e._globe,r=i.camera,s;if(i.pickPositionSupported&&(s=i.pickPositionWorldCoordinates(t,yPt)),!l(o))return h.clone(s,n);let a=!e._cameraUnderground,c=r.getPickRay(t,LIe),d=o.pickWorldCoordinates(c,i,a,xPt),u=l(s)?h.distance(s,r.positionWC):Number.POSITIVE_INFINITY,m=l(d)?h.distance(d,r.positionWC):Number.POSITIVE_INFINITY;return u<m?h.clone(s,n):h.clone(d,n)}var TPt=new pe;function kK(e){let t=e._ellipsoid,n=e._scene,i=n.camera,o=n.mode,r=0;if(o===se.SCENE3D){let c=t.cartesianToCartographic(i.position,TPt);l(c)&&(r=c.height)}else r=i.position.z;let s=e._scene.globeHeight??0;return Math.abs(s-r)}var _Pt=new h;function WIe(e,t){let n=t.origin,i=t.direction,o=kK(e),r=h.normalize(n,_Pt),s=Math.abs(h.dot(r,i));return s=Math.max(s,.5)*2,o*s}function vIe(e,t,n,i){let o=h.distance(t.origin,n),r=kK(e),s=W.clamp(r*5,e._minimumUndergroundPickDistance,e._maximumUndergroundPickDistance);return o>s&&(o=Math.min(o,r/5),o=Math.max(o,100)),gn.getPoint(t,o,i)}function FIe(e,t,n,i){let o;return l(n)?(o=h.distance(t.origin,n),o>e._maximumUndergroundPickDistance&&(o=kK(e))):o=kK(e),gn.getPoint(t,o,i)}var SPt=new k;function IIe(e,t){let n=t.endPosition,i=k.subtract(t.endPosition,t.startPosition,SPt),o=e._strafeEndMousePosition;k.add(o,i,o),t.endPosition=o,Ore(e,t,e._strafeStartPosition),t.endPosition=n}var SIe=new gn,ZPt=new gn,Xre=new h,RPt=new h,CPt=new h,VPt=new h,EPt=new cn(h.UNIT_X,0),APt=new k,GPt=new k;function LPt(e,t,n){if(h.equals(t,e._translateMousePosition)||(e._looking=!1),h.equals(t,e._strafeMousePosition)||(e._strafing=!1),e._looking){dm(e,t,n);return}if(e._strafing){IIe(e,n);return}let o=e._scene.camera,r=e._cameraUnderground,s=k.clone(n.startPosition,APt),a=k.clone(n.endPosition,GPt),c=o.getPickRay(s,SIe),d=h.clone(h.ZERO,VPt),u=h.UNIT_X,m;if(o.position.z<e._minimumPickingTerrainHeight&&(m=ry(e,s,Xre),l(m)&&(d.x=m.x)),r||d.x>o.position.z&&l(m)){let R=m;r&&(R=FIe(e,c,m,Xre)),k.clone(t,e._strafeMousePosition),k.clone(t,e._strafeEndMousePosition),h.clone(R,e._strafeStartPosition),e._strafing=!0,Ore(e,n,e._strafeStartPosition);return}let p=cn.fromPointNormal(d,u,EPt);c=o.getPickRay(s,SIe);let b=xi.rayPlane(c,p,Xre),f=o.getPickRay(a,ZPt),y=xi.rayPlane(f,p,RPt);if(!l(b)||!l(y)){e._looking=!0,dm(e,t,n),k.clone(t,e._translateMousePosition);return}let _=h.subtract(b,y,CPt),S=_.x;_.x=_.y,_.y=_.z,_.z=S;let Z=h.magnitude(_);Z>W.EPSILON6&&(h.normalize(_,_),o.move(_,Z))}var PIe=new k,NK=new gn,YK=new h,WPt=new h,XIe=new P,vPt=new P,FPt=new h,IPt=new cn(h.UNIT_X,0),Nre=new h,wre=new pe,NIe=new P,PPt=new Ne,XPt=new q,MK=new h;function NPt(e,t,n){if(l(n.angleAndHeight)&&(n=n.angleAndHeight),k.equals(t,e._tiltCenterMousePosition)||(e._tiltCVOffMap=!1,e._looking=!1),e._looking){dm(e,t,n);return}let o=e._scene.camera;e._tiltCVOffMap||!e.onMap()||Math.abs(o.position.z)>e._minimumPickingTerrainHeight?(e._tiltCVOffMap=!0,YPt(e,t,n)):MPt(e,t,n)}function YPt(e,t,n){let i=e._scene,o=i.camera,r=i.canvas,s=PIe;s.x=r.clientWidth/2,s.y=r.clientHeight/2;let a=o.getPickRay(s,NK),c=h.UNIT_X,d=a.origin,u=a.direction,m,p=h.dot(c,u);if(Math.abs(p)>W.EPSILON6&&(m=-h.dot(c,d)/p),!l(m)||m<=0){e._looking=!0,dm(e,t,n),k.clone(t,e._tiltCenterMousePosition);return}let b=h.multiplyByScalar(u,m,YK);h.add(d,b,b);let f=i.mapProjection,y=f.ellipsoid;h.fromElements(b.y,b.z,b.x,b);let _=f.unproject(b,wre);y.cartographicToCartesian(_,b);let S=_t.eastNorthUpToFixedFrame(b,y,XIe),Z=e._globe,R=e._ellipsoid;e._globe=void 0,e._ellipsoid=ne.UNIT_SPHERE,e._rotateFactor=1,e._rotateRateRangeAdjustment=1;let C=P.clone(o.transform,NIe);o._setTransform(S),lm(e,t,n,h.UNIT_Z),o._setTransform(C),e._globe=Z,e._ellipsoid=R;let E=R.maximumRadius;e._rotateFactor=1/E,e._rotateRateRangeAdjustment=E}function MPt(e,t,n){let i=e._scene,o=i.camera,r=e._cameraUnderground,s,a,c=h.UNIT_X;if(k.equals(t,e._tiltCenterMousePosition))s=h.clone(e._tiltCenter,YK);else{if(o.position.z<e._minimumPickingTerrainHeight&&(s=ry(e,t,YK)),!l(s)){a=o.getPickRay(t,NK);let g=a.origin,V=a.direction,G,v=h.dot(c,V);if(Math.abs(v)>W.EPSILON6&&(G=-h.dot(c,g)/v),!l(G)||G<=0){e._looking=!0,dm(e,t,n),k.clone(t,e._tiltCenterMousePosition);return}s=h.multiplyByScalar(V,G,YK),h.add(g,s,s)}r&&(l(a)||(a=o.getPickRay(t,NK)),vIe(e,a,s,s)),k.clone(t,e._tiltCenterMousePosition),h.clone(s,e._tiltCenter)}let d=i.canvas,u=PIe;u.x=d.clientWidth/2,u.y=e._tiltCenterMousePosition.y,a=o.getPickRay(u,NK);let m=h.clone(h.ZERO,FPt);m.x=s.x;let p=cn.fromPointNormal(m,c,IPt),b=xi.rayPlane(a,p,WPt),f=o._projection,y=f.ellipsoid;h.fromElements(s.y,s.z,s.x,s);let _=f.unproject(s,wre);y.cartographicToCartesian(_,s);let S=_t.eastNorthUpToFixedFrame(s,y,XIe),Z;l(b)?(h.fromElements(b.y,b.z,b.x,b),_=f.unproject(b,wre),y.cartographicToCartesian(_,b),Z=_t.eastNorthUpToFixedFrame(b,y,vPt)):Z=S;let R=e._globe,C=e._ellipsoid;e._globe=void 0,e._ellipsoid=ne.UNIT_SPHERE,e._rotateFactor=1,e._rotateRateRangeAdjustment=1;let E=h.UNIT_Z,A=P.clone(o.transform,NIe);o._setTransform(S);let L=h.cross(h.UNIT_Z,h.normalize(o.position,Nre),Nre),F=h.dot(o.right,L);if(lm(e,t,n,E,!1,!0),o._setTransform(Z),F<0){let g=n.startPosition.y-n.endPosition.y;(r&&g<0||!r&&g>0)&&(E=void 0);let V=o.constrainedAxis;o.constrainedAxis=void 0,lm(e,t,n,E,!0,!1),o.constrainedAxis=V}else lm(e,t,n,E,!0,!1);if(l(o.constrainedAxis)){let g=h.cross(o.direction,o.constrainedAxis,MK);h.equalsEpsilon(g,h.ZERO,W.EPSILON6)||(h.dot(g,o.right)<0&&h.negate(g,g),h.cross(g,o.direction,o.up),h.cross(o.direction,o.up,o.right),h.normalize(o.up,o.up),h.normalize(o.right,o.right))}o._setTransform(A),e._globe=R,e._ellipsoid=C;let I=C.maximumRadius;e._rotateFactor=1/I,e._rotateRateRangeAdjustment=I;let N=h.clone(o.positionWC,Nre);if(e.enableCollisionDetection&&Hre(e,!0),!h.equals(o.positionWC,N)){o._setTransform(Z),o.worldToCameraCoordinatesPoint(N,N);let g=h.magnitudeSquared(N);h.magnitudeSquared(o.position)>g&&(h.normalize(o.position,o.position),h.multiplyByScalar(o.position,Math.sqrt(g),o.position));let V=h.angleBetween(N,o.position),G=h.cross(N,o.position,N);h.normalize(G,G);let v=Ne.fromAxisAngle(G,V,PPt),X=q.fromQuaternion(v,XPt);q.multiplyByVector(X,o.direction,o.direction),q.multiplyByVector(X,o.up,o.up),h.cross(o.direction,o.up,o.right),h.cross(o.right,o.direction,o.up),o._setTransform(A)}}var YIe=new k,MIe=new gn,wIe=new h;function wPt(e,t,n){l(n.distance)&&(n=n.distance);let i=e._scene,o=i.camera,r=i.canvas,s=e._cameraUnderground,a;s?a=t:(a=YIe,a.x=r.clientWidth/2,a.y=r.clientHeight/2);let c=o.getPickRay(a,MIe),d=c.origin,u=c.direction,m=o.position.z,p;m<e._minimumPickingTerrainHeight&&(p=ry(e,a,wIe));let b;if(l(p)&&(b=h.distance(d,p)),s){let f=WIe(e,c,m);l(b)?b=Math.min(b,f):b=f}if(!l(b)){let f=h.UNIT_X;b=-h.dot(f,d)/h.dot(f,u)}Dre(e,t,n,e.zoomFactor,b)}function kPt(e){let n=e._scene.camera;if(!P.equals(P.IDENTITY,n.transform))gd(e,e.enableRotate,e.rotateEventTypes,lm,e.inertiaSpin,"_lastInertiaSpinMovement"),gd(e,e.enableZoom,e.zoomEventTypes,UIe,e.inertiaZoom,"_lastInertiaZoomMovement");else{let i=e._tweens;if(e._aggregator.anyButtonDown&&i.removeAll(),gd(e,e.enableTilt,e.tiltEventTypes,NPt,e.inertiaSpin,"_lastInertiaTiltMovement"),gd(e,e.enableTranslate,e.translateEventTypes,LPt,e.inertiaTranslate,"_lastInertiaTranslateMovement"),gd(e,e.enableZoom,e.zoomEventTypes,wPt,e.inertiaZoom,"_lastInertiaZoomMovement"),gd(e,e.enableLook,e.lookEventTypes,dm),!e._aggregator.anyButtonDown&&!i.contains(e._tween)){let o=n.createCorrectPositionTween(e.bounceAnimationTime);l(o)&&(e._tween=i.add(o))}i.update()}}var UPt=new gn,DPt=new cn(h.UNIT_X,0),OPt=new h,BPt=new h;function Ore(e,t,n){let i=e._scene,o=i.camera,r=o.getPickRay(t.endPosition,UPt),s=h.clone(o.direction,BPt);i.mode===se.COLUMBUS_VIEW&&h.fromElements(s.z,s.x,s.y,s);let a=cn.fromPointNormal(n,s,DPt),c=xi.rayPlane(r,a,OPt);l(c)&&(s=h.subtract(n,c,s),i.mode===se.COLUMBUS_VIEW&&h.fromElements(s.y,s.z,s.x,s),h.add(o.position,s,o.position))}var ZIe=new h,kIe=new pe,kre=new h,Ure=new ne,zPt=new h,HPt=new h,KPt=new h;function JPt(e,t,n){let o=e._scene.camera,r=e._cameraUnderground,s=e._ellipsoid;if(!P.equals(o.transform,P.IDENTITY)){lm(e,t,n);return}let a,c,d=s.geodeticSurfaceNormal(o.position,zPt);if(k.equals(t,e._rotateMousePosition)){if(e._looking)dm(e,t,n,d);else if(e._rotating)lm(e,t,n);else if(e._strafing)IIe(e,n);else{if(h.magnitude(o.position)<h.magnitude(e._rotateStartPosition))return;a=h.magnitude(e._rotateStartPosition),c=kre,c.x=c.y=c.z=a,s=ne.fromCartesian3(c,Ure),Mre(e,t,n,s)}return}e._looking=!1,e._rotating=!1,e._strafing=!1;let u=s.cartesianToCartographic(o.positionWC,kIe).height,m=e._globe;if(l(m)&&u<e._minimumPickingTerrainHeight){let p=ry(e,n.startPosition,KPt);if(l(p)){let b,f=o.getPickRay(n.startPosition,LIe);if(r)b=!0,FIe(e,f,p,p);else{let y=s.geodeticSurfaceNormal(p,HPt);Math.abs(h.dot(f.direction,y))<.05?b=!0:b=h.magnitude(o.position)<h.magnitude(p)}b?(k.clone(t,e._strafeEndMousePosition),h.clone(p,e._strafeStartPosition),e._strafing=!0,Ore(e,n,e._strafeStartPosition)):(a=h.magnitude(p),c=kre,c.x=c.y=c.z=a,s=ne.fromCartesian3(c,Ure),Mre(e,t,n,s),h.clone(p,e._rotateStartPosition))}else e._looking=!0,dm(e,t,n,d)}else l(o.pickEllipsoid(n.startPosition,e._ellipsoid,ZIe))?(Mre(e,t,n,e._ellipsoid),h.clone(ZIe,e._rotateStartPosition)):u>e._minimumTrackBallHeight?(e._rotating=!0,lm(e,t,n)):(e._looking=!0,dm(e,t,n,d));k.clone(t,e._rotateMousePosition)}function lm(e,t,n,i,o,r){o=o??!1,r=r??!1;let s=e._scene,a=s.camera,c=s.canvas,d=a.constrainedAxis;l(i)&&(a.constrainedAxis=i);let u=h.magnitude(a.position),m=e._rotateFactor*(u-e._rotateRateRangeAdjustment);m>e._maximumRotateRate&&(m=e._maximumRotateRate),m<e._minimumRotateRate&&(m=e._minimumRotateRate);let p=(n.startPosition.x-n.endPosition.x)/c.clientWidth,b=(n.startPosition.y-n.endPosition.y)/c.clientHeight;p=Math.min(p,e.maximumMovementRatio),b=Math.min(b,e.maximumMovementRatio);let f=m*p*Math.PI*2,y=m*b*Math.PI;if(l(i)&&l(e.maximumTiltAngle)){let _=e.maximumTiltAngle,S=h.dot(a.direction,i),Z=Math.PI-Math.acos(S)+y;Z>_&&(y-=Z-_)}o||a.rotateRight(f),r||a.rotateUp(y),a.constrainedAxis=d}var Yre=ce.clone(ce.UNIT_W),RIe=ce.clone(ce.UNIT_W),PK=new h,dA=new h,XK=new h,CIe=new h,jPt=new k,QPt=new k,qPt=new k,$Pt=new k,eXt=new gn;function Mre(e,t,n,i){let o=e._scene,r=o.camera,s=k.clone(n.startPosition,jPt),a=k.clone(n.endPosition,QPt),c=i.cartesianToCartographic(r.positionWC,kIe).height,d,u;if(!n.inertiaEnabled&&c<e._minimumPickingTerrainHeight&&(d=h.clone(e._panLastWorldPosition,Yre),!l(e._globe)&&!k.equalsEpsilon(s,e._panLastMousePosition)&&(d=ry(e,s,Yre)),!l(e._globe)&&l(d))){let m=h.subtract(d,r.positionWC,dA),p=h.multiplyByScalar(r.directionWC,h.dot(r.directionWC,m),dA),b=h.magnitude(p),f=r.frustum.getPixelDimensions(o.drawingBufferWidth,o.drawingBufferHeight,b,o.pixelRatio,$Pt),y=k.subtract(a,s,qPt),_=h.multiplyByScalar(r.rightWC,y.x*f.x,dA),S=h.normalize(r.positionWC,GIe),Z=r.getPickRay(a,eXt).direction,R=h.subtract(Z,h.projectVector(Z,r.rightWC,XK),XK),C=h.angleBetween(R,r.directionWC),E=1;l(r.frustum.fov)&&(E=Math.max(Math.tan(C),.1));let A=Math.abs(h.dot(r.directionWC,S)),L=-y.y*f.y*2/Math.sqrt(E)*(1-A),F=h.multiplyByScalar(Z,L,XK);A=Math.abs(h.dot(r.upWC,S));let I=h.multiplyByScalar(r.upWC,-y.y*(1-A)*f.y,CIe);u=h.add(d,_,RIe),u=h.add(u,F,u),u=h.add(u,I,u),h.clone(u,e._panLastWorldPosition),k.clone(a,e._panLastMousePosition)}if((!l(d)||!l(u))&&(d=r.pickEllipsoid(s,i,Yre),u=r.pickEllipsoid(a,i,RIe)),!l(d)||!l(u)){e._rotating=!0,lm(e,t,n);return}if(d=r.worldToCameraCoordinates(d,d),u=r.worldToCameraCoordinates(u,u),l(r.constrainedAxis)){let m=r.constrainedAxis,p=h.mostOrthogonalAxis(m,PK);h.cross(p,m,p),h.normalize(p,p);let b=h.cross(m,p,dA),f=h.magnitude(d),y=h.dot(m,d),_=Math.acos(y/f),S=h.multiplyByScalar(m,y,XK);h.subtract(d,S,S),h.normalize(S,S);let Z=h.magnitude(u),R=h.dot(m,u),C=Math.acos(R/Z),E=h.multiplyByScalar(m,R,CIe);h.subtract(u,E,E),h.normalize(E,E);let A=Math.acos(h.dot(S,p));h.dot(S,b)<0&&(A=W.TWO_PI-A);let L=Math.acos(h.dot(E,p));h.dot(E,b)<0&&(L=W.TWO_PI-L);let F=A-L,I;h.equalsEpsilon(m,r.position,W.EPSILON2)?I=r.right:I=h.cross(m,r.position,PK);let N=h.cross(m,I,PK),g=h.dot(N,h.subtract(d,m,dA)),V=h.dot(N,h.subtract(u,m,dA)),G;g>0&&V>0?G=C-_:g>0&&V<=0?h.dot(r.position,m)>0?G=-_-C:G=_+C:G=_-C,r.rotateRight(F),r.rotateUp(G)}else{h.normalize(d,d),h.normalize(u,u);let m=h.dot(d,u),p=h.cross(d,u,PK);if(m<1&&!h.equalsEpsilon(p,h.ZERO,W.EPSILON14)){let b=Math.acos(m);r.rotate(p,b)}}}var tXt=new h,nXt=new pe,VIe=0;function UIe(e,t,n){l(n.distance)&&(n=n.distance);let i=n.inertiaEnabled,o=e._ellipsoid,r=e._scene,s=r.camera,a=r.canvas,c=e._cameraUnderground,d;c?d=t:(d=YIe,d.x=a.clientWidth/2,d.y=a.clientHeight/2);let u=s.getPickRay(d,MIe),m,p=o.cartesianToCartographic(s.position,nXt).height,b=Math.abs(VIe)<e.minimumPickingTerrainDistanceWithInertia;(i?b:p<e._minimumPickingTerrainHeight)&&(m=ry(e,d,wIe));let y;if(l(m)&&(y=h.distance(u.origin,m)),!l(e._globe)&&l(y)&&s.getMagnitude()<y&&(y=void 0),l(y)&&(VIe=y),c){let S=WIe(e,u,p);l(y)?y=Math.min(y,S):y=S}l(y)||(y=p);let _=h.normalize(s.position,tXt);Dre(e,t,n,e.zoomFactor,y,h.dot(_,s.direction))}var DIe=new k,wK=new gn,uk=new h,iXt=new h,OIe=new P,oXt=new P,BIe=new P,rXt=new Ne,sXt=new q,Bre=new pe,zre=new h;function aXt(e,t,n){let o=e._scene.camera;if(!P.equals(o.transform,P.IDENTITY))return;if(l(n.angleAndHeight)&&(n=n.angleAndHeight),k.equals(t,e._tiltCenterMousePosition)||(e._tiltOnEllipsoid=!1,e._looking=!1),e._looking){let a=e._ellipsoid.geodeticSurfaceNormal(o.position,zre);dm(e,t,n,a);return}let s=e._ellipsoid.cartesianToCartographic(o.position,Bre);e._tiltOnEllipsoid||s.height>e._minimumCollisionTerrainHeight?(e._tiltOnEllipsoid=!0,lXt(e,t,n)):dXt(e,t,n)}var cXt=new pe;function lXt(e,t,n){let i=e._ellipsoid,o=e._scene,r=o.camera,s=e.minimumZoomDistance*.25,a=i.cartesianToCartographic(r.positionWC,cXt).height;if(a-s-1<W.EPSILON3&&n.endPosition.y-n.startPosition.y<0)return;let c=o.canvas,d=DIe;d.x=c.clientWidth/2,d.y=c.clientHeight/2;let u=r.getPickRay(d,wK),m,p=xi.rayEllipsoid(u,i);if(l(p))m=gn.getPoint(u,p.start,uk);else if(a>e._minimumTrackBallHeight){let Z=xi.grazingAltitudeLocation(u,i);if(!l(Z))return;let R=i.cartesianToCartographic(Z,Bre);R.height=0,m=i.cartographicToCartesian(R,uk)}else{e._looking=!0;let Z=e._ellipsoid.geodeticSurfaceNormal(r.position,zre);dm(e,t,n,Z),k.clone(t,e._tiltCenterMousePosition);return}let b=_t.eastNorthUpToFixedFrame(m,i,OIe),f=e._globe,y=e._ellipsoid;e._globe=void 0,e._ellipsoid=ne.UNIT_SPHERE,e._rotateFactor=1,e._rotateRateRangeAdjustment=1;let _=P.clone(r.transform,BIe);r._setTransform(b),lm(e,t,n,h.UNIT_Z),r._setTransform(_),e._globe=f,e._ellipsoid=y;let S=y.maximumRadius;e._rotateFactor=1/S,e._rotateRateRangeAdjustment=S}function dXt(e,t,n){let i=e._ellipsoid,o=e._scene,r=o.camera,s=e._cameraUnderground,a,c,d;if(k.equals(t,e._tiltCenterMousePosition))a=h.clone(e._tiltCenter,uk);else{if(a=ry(e,t,uk),!l(a)){if(c=r.getPickRay(t,wK),d=xi.rayEllipsoid(c,i),!l(d)){if(i.cartesianToCartographic(r.position,Bre).height<=e._minimumTrackBallHeight){e._looking=!0;let V=e._ellipsoid.geodeticSurfaceNormal(r.position,zre);dm(e,t,n,V),k.clone(t,e._tiltCenterMousePosition)}return}a=gn.getPoint(c,d.start,uk)}s&&(l(c)||(c=r.getPickRay(t,wK)),vIe(e,c,a,a)),k.clone(t,e._tiltCenterMousePosition),h.clone(a,e._tiltCenter)}let u=o.canvas,m=DIe;m.x=u.clientWidth/2,m.y=e._tiltCenterMousePosition.y,c=r.getPickRay(m,wK);let p=h.magnitude(a),b=h.fromElements(p,p,p,kre),f=ne.fromCartesian3(b,Ure);if(d=xi.rayEllipsoid(c,f),!l(d))return;let y=h.magnitude(c.origin)>p?d.start:d.stop,_=gn.getPoint(c,y,iXt),S=_t.eastNorthUpToFixedFrame(a,i,OIe),Z=_t.eastNorthUpToFixedFrame(_,f,oXt),R=e._globe,C=e._ellipsoid;e._globe=void 0,e._ellipsoid=ne.UNIT_SPHERE,e._rotateFactor=1,e._rotateRateRangeAdjustment=1;let E=h.UNIT_Z,A=P.clone(r.transform,BIe);r._setTransform(Z);let L=h.cross(_,r.positionWC,MK);if(h.dot(r.rightWC,L)<0){let g=n.startPosition.y-n.endPosition.y;(s&&g<0||!s&&g>0)&&(E=void 0);let V=r.constrainedAxis;r.constrainedAxis=void 0,lm(e,t,n,E,!0,!1),r.constrainedAxis=V}else lm(e,t,n,E,!0,!1);if(r._setTransform(S),lm(e,t,n,E,!1,!0),l(r.constrainedAxis)){let g=h.cross(r.direction,r.constrainedAxis,MK);h.equalsEpsilon(g,h.ZERO,W.EPSILON6)||(h.dot(g,r.right)<0&&h.negate(g,g),h.cross(g,r.direction,r.up),h.cross(r.direction,r.up,r.right),h.normalize(r.up,r.up),h.normalize(r.right,r.right))}r._setTransform(A),e._globe=R,e._ellipsoid=C;let I=C.maximumRadius;e._rotateFactor=1/I,e._rotateRateRangeAdjustment=I;let N=h.clone(r.positionWC,MK);if(e.enableCollisionDetection&&Hre(e,!0),!h.equals(r.positionWC,N)){r._setTransform(Z),r.worldToCameraCoordinatesPoint(N,N);let g=h.magnitudeSquared(N);h.magnitudeSquared(r.position)>g&&(h.normalize(r.position,r.position),h.multiplyByScalar(r.position,Math.sqrt(g),r.position));let V=h.angleBetween(N,r.position),G=h.cross(N,r.position,N);h.normalize(G,G);let v=Ne.fromAxisAngle(G,V,rXt),X=q.fromQuaternion(v,sXt);q.multiplyByVector(X,r.direction,r.direction),q.multiplyByVector(X,r.up,r.up),h.cross(r.direction,r.up,r.right),h.cross(r.right,r.direction,r.up),r._setTransform(A)}}var uXt=new k,mXt=new k,EIe=new gn,AIe=new gn,hXt=new h,fXt=new h;function dm(e,t,n,i){let r=e._scene.camera,s=uXt;s.x=n.startPosition.x,s.y=0;let a=mXt;a.x=n.endPosition.x,a.y=0;let c=r.getPickRay(s,EIe),d=r.getPickRay(a,AIe),u=0,m,p;r.frustum instanceof yn?(m=c.origin,p=d.origin,h.add(r.direction,m,m),h.add(r.direction,p,p),h.subtract(m,r.position,m),h.subtract(p,r.position,p),h.normalize(m,m),h.normalize(p,p)):(m=c.direction,p=d.direction);let b=h.dot(m,p);b<1&&(u=Math.acos(b)),u=n.startPosition.x>n.endPosition.x?-u:u;let f=e._horizontalRotationAxis;if(l(i)?r.look(i,-u):l(f)?r.look(f,-u):r.lookLeft(u),s.x=0,s.y=n.startPosition.y,a.x=0,a.y=n.endPosition.y,c=r.getPickRay(s,EIe),d=r.getPickRay(a,AIe),u=0,r.frustum instanceof yn?(m=c.origin,p=d.origin,h.add(r.direction,m,m),h.add(r.direction,p,p),h.subtract(m,r.position,m),h.subtract(p,r.position,p),h.normalize(m,m),h.normalize(p,p)):(m=c.direction,p=d.direction),b=h.dot(m,p),b<1&&(u=Math.acos(b)),u=n.startPosition.y>n.endPosition.y?-u:u,i=i??f,l(i)){let y=r.direction,_=h.negate(i,hXt),S=h.equalsEpsilon(y,i,W.EPSILON2),Z=h.equalsEpsilon(y,_,W.EPSILON2);if(!S&&!Z){b=h.dot(y,i);let R=W.acosClamped(b);u>0&&u>R&&(u=R-W.EPSILON4),b=h.dot(y,_),R=W.acosClamped(b),u<0&&-u>R&&(u=-R+W.EPSILON4);let C=h.cross(i,y,fXt);r.look(C,u)}else(S&&u<0||Z&&u>0)&&r.look(r.right,-u)}else r.lookUp(u)}function pXt(e){gd(e,e.enableRotate,e.rotateEventTypes,JPt,e.inertiaSpin,"_lastInertiaSpinMovement"),gd(e,e.enableZoom,e.zoomEventTypes,UIe,e.inertiaZoom,"_lastInertiaZoomMovement"),gd(e,e.enableTilt,e.tiltEventTypes,aXt,e.inertiaSpin,"_lastInertiaTiltMovement"),gd(e,e.enableLook,e.lookEventTypes,dm)}var bXt=new P,gXt=new pe;function Hre(e,t){e._adjustedHeightForTerrain=!0;let n=e._scene,i=n.mode;if(i===se.SCENE2D||i===se.MORPHING)return;let o=n.camera,r=n.ellipsoid??ne.WGS84,s=n.mapProjection,a,c;P.equals(o.transform,P.IDENTITY)||(a=P.clone(o.transform,bXt),c=h.magnitude(o.position),o._setTransform(P.IDENTITY));let d=gXt;i===se.SCENE3D?r.cartesianToCartographic(o.position,d):s.unproject(o.position,d);let u=!1;if(d.height<e._minimumCollisionTerrainHeight){let m=e._scene.globeHeight;if(l(m)){let p=m+e.minimumZoomDistance,b=m-e._lastGlobeHeight,f=b/e._lastGlobeHeight;d.height<p&&(t||Math.abs(f)<=.1)&&(d.height=p,i===se.SCENE3D?r.cartographicToCartesian(d,o.position):s.project(d,o.position),u=!0),t||Math.abs(f)<=.1?e._lastGlobeHeight=m:e._lastGlobeHeight+=b*.1}}l(a)&&(o._setTransform(a),u&&(h.normalize(o.position,o.position),h.negate(o.position,o.direction),h.multiplyByScalar(o.position,Math.max(c,e.minimumZoomDistance),o.position),h.normalize(o.direction,o.direction),h.cross(o.direction,o.up,o.right),h.cross(o.right,o.direction,o.up)))}mk.prototype.onMap=function(){let e=this._scene,t=e.mode,n=e.camera;return t===se.COLUMBUS_VIEW?Math.abs(n.position.x)-this._maxCoord.x<0&&Math.abs(n.position.y)-this._maxCoord.y<0:!0};var yXt=new h,xXt=new h;mk.prototype.update=function(){let e=this._scene,{camera:t,globe:n,mode:i}=e;P.equals(t.transform,P.IDENTITY)?(this._globe=n,this._ellipsoid=e.ellipsoid??ne.default):(this._globe=void 0,this._ellipsoid=ne.UNIT_SPHERE);let{verticalExaggeration:o,verticalExaggerationRelativeHeight:r}=e;this._minimumCollisionTerrainHeight=_o.getHeight(this.minimumCollisionTerrainHeight,o,r),this._minimumPickingTerrainHeight=_o.getHeight(this.minimumPickingTerrainHeight,o,r),this._minimumTrackBallHeight=_o.getHeight(this.minimumTrackBallHeight,o,r),this._cameraUnderground=e.cameraUnderground&&l(this._globe);let s=this._ellipsoid.maximumRadius;this._rotateFactor=1/s,this._rotateRateRangeAdjustment=s,this._adjustedHeightForTerrain=!1;let a=h.clone(t.positionWC,yXt),c=h.clone(t.directionWC,xXt);if(i===se.SCENE2D?gPt(this):i===se.COLUMBUS_VIEW?(this._horizontalRotationAxis=h.UNIT_Z,kPt(this)):i===se.SCENE3D&&(this._horizontalRotationAxis=void 0,pXt(this)),this.enableCollisionDetection&&!this._adjustedHeightForTerrain){let d=!h.equals(a,t.positionWC)||!h.equals(c,t.directionWC);Hre(this,d)}this._aggregator.reset()};mk.prototype.isDestroyed=function(){return!1};mk.prototype.destroy=function(){return this._tweens.removeAll(),this._aggregator=this._aggregator&&this._aggregator.destroy(),ue(this)};var hk=mk;var Bxo=x(T(),1);var Pxo=x(T(),1);function fk(e){let t=new oc(e);t.blendingEnabled=!1,t.scissorTest={enabled:!0,rectangle:new nt},t.viewport=new nt,this._context=e,this._fb=new li({depthStencil:!0,pixelDatatype:Ue.FLOAT,pixelFormat:Qe.RGBA}),this._passState=t}function TXt(e,t,n,i){let o=Math.max(n,i),r=o*o,s=Math.floor(n*.5),a=Math.floor(i*.5),c=0,d=0,u=0,m=-1,p=[];for(let b=0;b<r;++b){if(-s<=c&&c<=s&&-a<=d&&d<=a){let f=4*((a-d)*n+c+s),y=t[f],_=e.getObjectByPickColor(y);l(_)&&p.push({object:_,isEdge:t[f+1]>0,depth:t[f+2],x:c,y:d})}if(c===d||c<0&&-c===d||c>0&&c===1-d){let f=u;u=-m,m=f}c+=u,d+=m}return p}fk.prototype.begin=function(e,t){let n=this._context,{width:i,height:o}=t;return nt.clone(e,this._passState.scissorTest.rectangle),this._fb.update(n,i,o),this._passState.framebuffer=this._fb.framebuffer,this._passState.viewport.width=i,this._passState.viewport.height=o,this._passState};fk.prototype.end=function(e){let t=e.width??1,n=e.height??1,i=this._context,o=i.readPixels({x:e.x,y:e.y,width:t,height:n,pixelDatatype:Ue.FLOAT,framebuffer:this._fb.framebuffer});return TXt(i,o,t,n)};fk.prototype.isDestroyed=function(){return!1};fk.prototype.destroy=function(){return this._fb.destroy(),ue(this)};var pk=fk;var bk={},_Xt=new nt(0,0,3,3),SXt=new k,ZXt=new k,RXt=new gn,CXt=new h,VXt=3,EXt=.1,zIe=9;function Kre(e){return Math.sqrt(e.x*e.x+e.y*e.y)}function HIe(e){let t=Number.POSITIVE_INFINITY;for(let s of e)!s.isEdge&&Kre(s)<=VXt&&(t=Math.min(t,s.depth));let n=t*(1+EXt),i=e.filter(s=>!s.isEdge||s.depth<=n),o=i.some(s=>s.isEdge);return i.filter(s=>s.isEdge===o).reduce((s,a)=>Kre(a)<Kre(s)?a:s)}function KIe(e,t){let n,i=Number.POSITIVE_INFINITY;for(let o of e){if(o.isEdge||o.object!==t)continue;let r=o.x*o.x+o.y*o.y;r<i&&(n=o,i=r)}return n}function Jre(e,t,n){let i=SXt;i.x=t.x+n.x,i.y=t.y+n.y;let o=e.camera.getPickRay(i,RXt);if(!l(o))return;let r=h.dot(o.direction,e.camera.directionWC);if(r<=0)return;let s=n.depth/r,a=h.multiplyByScalar(o.direction,s,CXt);return h.add(o.origin,a,new h)}bk.snap=function(e,t,n){let i=n?.width??25,o=n?.height??i,{context:r,defaultView:s}=e;if(!r.colorBufferFloat){xt("snap-color-buffer-float","Scene.snap requires the EXT_color_buffer_float extension, which is not supported on this platform.");return}l(s.snapFramebuffer)||(s.snapFramebuffer=new pk(r));let a=s.snapFramebuffer,c=_Xt;X9(e,t,c,i,o,{framebuffer:a,snap:!0});let d=a.end(c);if(N9(e),d.length===0)return;let u=HIe(d);if(!l(u))return;let m=Jre(e,t,u);if(!l(m))return;let p=m;if(u.isEdge){let b=ZXt;b.x=t.x+u.x,b.y=t.y+u.y,X9(e,b,c,zIe,zIe,{framebuffer:a,snap:!0});let f=a.end(c);N9(e);let y=KIe(f,u.object);p=l(y)?Jre(e,b,y):void 0}return{object:u.object,isEdge:u.isEdge,position:m,surfacePosition:p,screenPosition:new k(t.x+u.x,t.y+u.y)}};bk._selectBestHit=HIe;bk._nearestSurfaceHit=KIe;bk._snapHitToWorld=Jre;var gk=bk;var fTo=x(T(),1);var Hxo=x(T(),1),yk=`uniform sampler2D colorTexture; +${kw}`;ls.createFXAAStage=function(){return new Uo({name:"czm_FXAA",fragmentShader:oEt,sampleMode:qu.LINEAR})};ls.createAcesTonemappingStage=function(e){let t=e?`#define AUTO_EXPOSURE +`:"";return t+=Gw,new Uo({name:"czm_aces",fragmentShader:t,uniforms:{autoExposure:void 0,exposure:1}})};ls.createFilmicTonemappingStage=function(e){let t=e?`#define AUTO_EXPOSURE +`:"";return t+=Mw,new Uo({name:"czm_filmic",fragmentShader:t,uniforms:{autoExposure:void 0,exposure:1}})};ls.createPbrNeutralTonemappingStage=function(e){let t=e?`#define AUTO_EXPOSURE +`:"";return t+=ww,new Uo({name:"czm_pbr_neutral",fragmentShader:t,uniforms:{autoExposure:void 0,exposure:1}})};ls.createReinhardTonemappingStage=function(e){let t=e?`#define AUTO_EXPOSURE +`:"";return t+=Bw,new Uo({name:"czm_reinhard",fragmentShader:t,uniforms:{autoExposure:void 0,exposure:1}})};ls.createModifiedReinhardTonemappingStage=function(e){let t=e?`#define AUTO_EXPOSURE +`:"";return t+=Dw,new Uo({name:"czm_modified_reinhard",fragmentShader:t,uniforms:{white:U.WHITE,autoExposure:void 0,exposure:1}})};ls.createAutoExposureStage=function(){return new Hw};ls.createBlackAndWhiteStage=function(){return new Uo({name:"czm_black_and_white",fragmentShader:vw,uniforms:{gradations:5}})};ls.createBrightnessStage=function(){return new Uo({name:"czm_brightness",fragmentShader:Iw,uniforms:{brightness:.5}})};ls.createNightVisionStage=function(){return new Uo({name:"czm_night_vision",fragmentShader:Ow})};ls.createDepthViewStage=function(){return new Uo({name:"czm_depth_view",fragmentShader:Nw})};ls.createLensFlareStage=function(){return new Uo({name:"czm_lens_flare",fragmentShader:Uw,uniforms:{dirtTexture:en("Assets/Textures/LensFlare/DirtMask.jpg"),starTexture:en("Assets/Textures/LensFlare/StarBurst.jpg"),intensity:2,distortion:10,ghostDispersal:.4,haloWidth:.4,dirtAmount:.4,earthRadius:ne.WGS84.maximumRadius}})};var $u=ls;var Dio=x(T(),1);function Mg(e){this._collection=e,this._framebuffers=[],this._stageNameToFramebuffer={},this._width=void 0,this._height=void 0,this._updateDependencies=!1}function Jw(e){for(;l(e.length);)e=e.get(e.length-1);return e.name}function ene(e,t,n,i,o){if(!i.enabled||!i._isSupported(t))return o;let r=n[i.name]={};if(l(o)){let a=e.getStageByName(o);r[Jw(a)]=!0}let s=i.uniforms;if(l(s)){let a=Object.getOwnPropertyNames(s),c=a.length;for(let d=0;d<c;++d){let u=s[a[d]];if(typeof u=="string"){let m=e.getStageByName(u);l(m)&&(r[Jw(m)]=!0)}}}return i.name}function Kw(e,t,n,i,o){if(l(i.enabled)&&!i.enabled||l(i._isSupported)&&!i._isSupported(t))return o;let r=o,s=!l(i.inputPreviousStageTexture)||i.inputPreviousStageTexture,a=o,c=i.length;for(let m=0;m<c;++m){let p=i.get(m);l(p.length)?a=Kw(e,t,n,p,o):a=ene(e,t,n,p,o),s&&(o=a)}let d,u;if(s)for(d=1;d<c;++d)u=Jw(i.get(d)),l(n[u])||(n[u]={}),n[u][r]=!0;else for(d=1;d<c;++d){u=Jw(i.get(d));let m=n[u];for(let p=0;p<d;++p)m[Jw(i.get(p))]=!0}return a}function rEt(e,t){let n={};if(l(e.ambientOcclusion)){let i=e.ambientOcclusion,o=e.bloom,r=e._tonemapping,s=e.fxaa,a=Kw(e,t,n,i,void 0);a=Kw(e,t,n,o,a),a=ene(e,t,n,r,a),a=Kw(e,t,n,e,a),ene(e,t,n,s,a)}else Kw(e,t,n,e,void 0);return n}function sEt(e,t,n){let o=e._collection.getStageByName(t),r=o._textureScale,s=o._forcePowerOfTwo,a=o._pixelFormat,c=o._pixelDatatype,d=o._clearColor,u,m,p=e._framebuffers,b=p.length;for(u=0;u<b;++u){if(m=p[u],r!==m.textureScale||s!==m.forcePowerOfTwo||a!==m.pixelFormat||c!==m.pixelDatatype||!U.equals(d,m.clearColor))continue;let f=m.stages,y=f.length,_=!1;for(let S=0;S<y;++S)if(n[f[S]]){_=!0;break}if(!_)break}return l(m)&&u<b?(m.stages.push(t),m):(m={textureScale:r,forcePowerOfTwo:s,pixelFormat:a,pixelDatatype:c,clearColor:d,stages:[t],buffer:new li({pixelFormat:a,pixelDatatype:c}),clear:void 0},p.push(m),m)}function aEt(e,t){let n=rEt(e._collection,t);for(let i in n)n.hasOwnProperty(i)&&(e._stageNameToFramebuffer[i]=sEt(e,i,n[i]))}function tne(e){let t=e._framebuffers,n=t.length;for(let i=0;i<n;++i)t[i].buffer.destroy()}function cEt(e,t){let n=e._width,i=e._height,o=e._framebuffers,r=o.length;for(let s=0;s<r;++s){let a=o[s],c=a.textureScale,d=Math.ceil(n*c),u=Math.ceil(i*c),m=Math.min(d,u);a.forcePowerOfTwo&&(W.isPowerOfTwo(m)||(m=W.nextPowerOfTwo(m)),d=m,u=m),a.buffer.update(t,d,u),a.clear=new ui({color:a.clearColor,framebuffer:a.buffer.framebuffer})}}Mg.prototype.updateDependencies=function(){this._updateDependencies=!0};Mg.prototype.update=function(e){let t=this._collection,n=this._updateDependencies,i=l(t.ambientOcclusion)&&t.ambientOcclusion.enabled&&t.ambientOcclusion._isSupported(e),o=l(t.bloom)&&t.bloom.enabled&&t.bloom._isSupported(e),r=l(t._tonemapping)&&t._tonemapping.enabled&&t._tonemapping._isSupported(e),s=l(t.fxaa)&&t.fxaa.enabled&&t.fxaa._isSupported(e),a=!l(t._activeStages)||t._activeStages.length>0||i||o||r||s;if((n||!a&&this._framebuffers.length>0)&&(tne(this),this._framebuffers.length=0,this._stageNameToFramebuffer={},this._width=void 0,this._height=void 0),!n&&!a)return;this._framebuffers.length===0&&aEt(this,e);let c=e.drawingBufferWidth,d=e.drawingBufferHeight,u=this._width!==c||this._height!==d;!n&&!u||(this._width=c,this._height=d,this._updateDependencies=!1,tne(this),cEt(this,e))};Mg.prototype.clear=function(e){let t=this._framebuffers;for(let n=0;n<t.length;++n)t[n].clear.execute(e)};Mg.prototype.getStageByName=function(e){return this._collection.getStageByName(e)};Mg.prototype.getOutputTexture=function(e){return this._collection.getOutputTexture(e)};Mg.prototype.getFramebuffer=function(e){let t=this._stageNameToFramebuffer[e];if(l(t))return t.buffer.framebuffer};Mg.prototype.isDestroyed=function(){return!1};Mg.prototype.destroy=function(){return tne(this),ue(this)};var PZ=Mg;var Bio=x(T(),1),kAe={REINHARD:"REINHARD",MODIFIED_REINHARD:"MODIFIED_REINHARD",FILMIC:"FILMIC",ACES:"ACES",PBR_NEUTRAL:"PBR_NEUTRAL"};Object.freeze(kAe);var wg=kAe;var nne=[];function hd(){let e=$u.createFXAAStage(),t=$u.createAmbientOcclusionStage(),n=$u.createBloomStage();this._autoExposureEnabled=!1,this._autoExposure=$u.createAutoExposureStage(),this._exposure=1,this._tonemapping=void 0,this._tonemapper=void 0,this.tonemapper=wg.PBR_NEUTRAL;let i=this._tonemapping;e.enabled=!1,t.enabled=!1,n.enabled=!1,i.enabled=!1;let o=new PZ(this),r={},s=nne;for(s.push(e,t,n,i);s.length>0;){let c=s.pop();r[c.name]=c,c._textureCache=o;let d=c.length;if(l(d))for(let u=0;u<d;++u)s.push(c.get(u))}this._stages=[],this._activeStages=[],this._previousActiveStages=[],this._randomTexture=void 0;let a=this;t.uniforms.randomTexture=function(){return a._randomTexture},this._ao=t,this._bloom=n,this._fxaa=e,this._aoEnabled=void 0,this._bloomEnabled=void 0,this._tonemappingEnabled=void 0,this._fxaaEnabled=void 0,this._activeStagesChanged=!1,this._stagesRemoved=!1,this._textureCacheDirty=!1,this._stageNames=r,this._textureCache=o}Object.defineProperties(hd.prototype,{ready:{get:function(){let e=!1,t=this._stages,n=t.length;for(let a=n-1;a>=0;--a){let c=t[a];e=e||c.ready&&c.enabled}let i=this._fxaa,o=this._ao,r=this._bloom,s=this._tonemapping;return e=e||i.ready&&i.enabled,e=e||o.ready&&o.enabled,e=e||r.ready&&r.enabled,e=e||s.ready&&s.enabled,e}},fxaa:{get:function(){return this._fxaa}},ambientOcclusion:{get:function(){return this._ao}},bloom:{get:function(){return this._bloom}},length:{get:function(){return ine(this),this._stages.length}},outputTexture:{get:function(){let e=this._fxaa;if(e.enabled&&e.ready)return this.getOutputTexture(e.name);let t=this._stages,n=t.length;for(let s=n-1;s>=0;--s){let a=t[s];if(l(a)&&a.ready&&a.enabled)return this.getOutputTexture(a.name)}let i=this._tonemapping;if(i.enabled&&i.ready)return this.getOutputTexture(i.name);let o=this._bloom;if(o.enabled&&o.ready)return this.getOutputTexture(o.name);let r=this._ao;if(r.enabled&&r.ready)return this.getOutputTexture(r.name)}},hasSelected:{get:function(){let e=this._stages.slice();for(;e.length>0;){let t=e.pop();if(!l(t))continue;if(l(t.selected))return!0;let n=t.length;if(l(n))for(let i=0;i<n;++i)e.push(t.get(i))}return!1}},tonemapper:{get:function(){return this._tonemapper},set:function(e){if(this._tonemapper===e)return;l(this._tonemapping)&&(delete this._stageNames[this._tonemapping.name],this._tonemapping.destroy());let t=this._autoExposureEnabled,n;switch(e){case wg.REINHARD:n=$u.createReinhardTonemappingStage(t);break;case wg.MODIFIED_REINHARD:n=$u.createModifiedReinhardTonemappingStage(t);break;case wg.FILMIC:n=$u.createFilmicTonemappingStage(t);break;case wg.PBR_NEUTRAL:n=$u.createPbrNeutralTonemappingStage(t);break;default:n=$u.createAcesTonemappingStage(t);break}if(t){let i=this._autoExposure;n.uniforms.autoExposure=function(){return i.outputTexture}}else n.uniforms.exposure=this._exposure;this._tonemapper=e,this._tonemapping=n,l(this._stageNames)&&(this._stageNames[n.name]=n,n._textureCache=this._textureCache),this._textureCacheDirty=!0}},exposure:{get:function(){return this._exposure},set:function(e){this._tonemapping.uniforms.exposure=e,this._exposure=e}}});function ine(e){if(!e._stagesRemoved)return;e._stagesRemoved=!1;let t=[],n=e._stages;for(let i=0,o=0;i<n.length;++i){let r=n[i];r&&(r._index=o++,t.push(r))}e._stages=t}hd.prototype.add=function(e){let t=this._stageNames,n=nne;for(n.push(e);n.length>0;){let o=n.pop();t[o.name]=o,o._textureCache=this._textureCache;let r=o.length;if(l(r))for(let s=0;s<r;++s)n.push(o.get(s))}let i=this._stages;return e._index=i.length,i.push(e),this._textureCacheDirty=!0,e};hd.prototype.remove=function(e){if(!this.contains(e))return!1;let t=this._stageNames,n=nne;for(n.push(e);n.length>0;){let i=n.pop();delete t[i.name];let o=i.length;if(l(o))for(let r=0;r<o;++r)n.push(i.get(r))}return this._stages[e._index]=void 0,this._stagesRemoved=!0,this._textureCacheDirty=!0,e._index=void 0,e._textureCache=void 0,e.destroy(),!0};hd.prototype.contains=function(e){return l(e)&&l(e._index)&&e._textureCache===this._textureCache};hd.prototype.get=function(e){return ine(this),this._stages[e]};hd.prototype.removeAll=function(){let e=this._stages,t=e.length;for(let n=0;n<t;++n)this.remove(e[n]);e.length=0};hd.prototype.getStageByName=function(e){return this._stageNames[e]};hd.prototype.update=function(e,t,n){ine(this);let i=this._activeStages,o=this._activeStages=this._previousActiveStages;this._previousActiveStages=i;let r=this._stages;o.length=r.length;let s=0;for(let S=0;S<r.length;++S){let Z=r[S];Z.ready&&Z.enabled&&Z._isSupported(e)&&(o[s++]=Z)}o.length=s;let a=s!==i.length;if(!a){for(let S=0;S<s;++S)if(o[S]!==i[S]){a=!0;break}}let c=this._ao,d=this._bloom,u=this._autoExposure,m=this._tonemapping,p=this._fxaa;m.enabled=n;let b=c.enabled&&c._isSupported(e),f=d.enabled&&d._isSupported(e),y=m.enabled&&m._isSupported(e),_=p.enabled&&p._isSupported(e);if((a||this._textureCacheDirty||b!==this._aoEnabled||f!==this._bloomEnabled||y!==this._tonemappingEnabled||_!==this._fxaaEnabled)&&(this._textureCache.updateDependencies(),this._aoEnabled=b,this._bloomEnabled=f,this._tonemappingEnabled=y,this._fxaaEnabled=_,this._textureCacheDirty=!1),l(this._randomTexture)&&!b&&(this._randomTexture.destroy(),this._randomTexture=void 0),!l(this._randomTexture)&&b){let Z=new Uint8Array(196608);for(let R=0;R<196608;R+=3)Z[R]=Math.floor(Math.random()*255);this._randomTexture=new vt({context:e,pixelFormat:Qe.RGB,pixelDatatype:Ue.UNSIGNED_BYTE,source:{arrayBufferView:Z,width:256,height:256},sampler:new Ot({wrapS:pn.REPEAT,wrapT:pn.REPEAT,minificationFilter:Ht.NEAREST,magnificationFilter:$n.NEAREST})})}this._textureCache.update(e),p.update(e,t),c.update(e,t),d.update(e,t),m.update(e,t),this._autoExposureEnabled&&u.update(e,t);for(let S=0;S<r.length;++S)r[S].update(e,t);s=0;for(let S=0;S<r.length;++S){let Z=r[S];Z.ready&&Z.enabled&&Z._isSupported(e)&&s++}a=s!==o.length,a&&this.update(e,t,n)};hd.prototype.clear=function(e){this._textureCache.clear(e),this._autoExposureEnabled&&this._autoExposure.clear(e)};function XZ(e){for(;l(e.length);)e=e.get(e.length-1);return e.outputTexture}hd.prototype.getOutputTexture=function(e){let t=this.getStageByName(e);if(l(t))return XZ(t)};function Z0(e,t,n,i,o){if(l(e.execute)){e.execute(t,n,i,o);return}if(e.inputPreviousStageTexture){Z0(e.get(0),t,n,i,o);for(let r=1;r<e.length;++r)Z0(e.get(r),t,XZ(e.get(r-1)),i,o)}else for(let r=0;r<e.length;++r)Z0(e.get(r),t,n,i,o)}hd.prototype.execute=function(e,t,n,i){let o=this._activeStages,r=o.length,s=this._fxaa,a=this._ao,c=this._bloom,d=this._autoExposure,u=this._tonemapping,m=a.enabled&&a._isSupported(e),p=c.enabled&&c._isSupported(e),b=this._autoExposureEnabled,f=u.enabled&&u._isSupported(e),y=s.enabled&&s._isSupported(e);if(!y&&!m&&!p&&!f&&r===0)return;let _=t;m&&a.ready&&(Z0(a,e,_,n,i),_=XZ(a)),p&&c.ready&&(Z0(c,e,_,n,i),_=XZ(c)),b&&d.ready&&Z0(d,e,_,n,i),f&&u.ready&&(Z0(u,e,_,n,i),_=XZ(u));let S=_;if(r>0){Z0(o[0],e,_,n,i);for(let Z=1;Z<r;++Z)Z0(o[Z],e,XZ(o[Z-1]),n,i);S=XZ(o[r-1])}y&&s.ready&&Z0(s,e,S,n,i)};hd.prototype.copy=function(e,t){if(!l(this._copyColorCommand)){let n=this;this._copyColorCommand=e.createViewportQuadCommand(tu,{uniformMap:{colorTexture:function(){return n.outputTexture}},owner:this})}this._copyColorCommand.framebuffer=t,this._copyColorCommand.execute(e)};hd.prototype.isDestroyed=function(){return!1};hd.prototype.destroy=function(){return this._fxaa.destroy(),this._ao.destroy(),this._bloom.destroy(),this._autoExposure.destroy(),this._tonemapping.destroy(),this.removeAll(),this._textureCache=this._textureCache&&this._textureCache.destroy(),ue(this)};var jw=hd;var Moo=x(T(),1);var _oo=x(T(),1);var loo=x(T(),1),UAe={SHIFT:0,CTRL:1,ALT:2};Object.freeze(UAe);var nr=UAe;var uoo=x(T(),1),DAe={LEFT_DOWN:0,LEFT_UP:1,LEFT_CLICK:2,LEFT_DOUBLE_CLICK:3,RIGHT_DOWN:5,RIGHT_UP:6,RIGHT_CLICK:7,MIDDLE_DOWN:10,MIDDLE_UP:11,MIDDLE_CLICK:12,MOUSE_MOVE:15,WHEEL:16,PINCH_START:17,PINCH_END:18,PINCH_MOVE:19};Object.freeze(DAe);var mn=DAe;function lT(e,t,n){let i=e._element;if(i===document)return n.x=t.clientX,n.y=t.clientY,n;let o=i.getBoundingClientRect();return n.x=t.clientX-o.left,n.y=t.clientY-o.top,n}function lne(e,t){if(!l(t))return`${e}`;let n=Array.isArray(t)?t.toSorted():[t];return`${e}+${n.join("+")}`}function NZ(e){let t=[];if(e.shiftKey&&t.push(nr.SHIFT),e.ctrlKey&&t.push(nr.CTRL),e.altKey&&t.push(nr.ALT),t.length)return t}var Gs={LEFT:0,MIDDLE:1,RIGHT:2};function em(e,t,n,i){function o(r){i(e,r)}n.addEventListener(t,o,{capture:!1,passive:!1}),e._removalFunctions.push(function(){n.removeEventListener(t,o,!1)})}function lEt(e){let t=e._element,n=l(t.disableRootEvents)?t:document;fn.supportsPointerEvents()?(em(e,"pointerdown",t,pEt),em(e,"pointerup",t,$Ae),em(e,"pointermove",t,bEt),em(e,"pointercancel",t,$Ae)):(em(e,"mousedown",t,eGe),em(e,"mouseup",n,tGe),em(e,"mousemove",n,nGe),em(e,"touchstart",t,hEt),em(e,"touchend",n,KAe),em(e,"touchmove",n,fEt),em(e,"touchcancel",n,KAe)),em(e,"dblclick",t,uEt);let i;"onwheel"in t?i="wheel":document.onmousewheel!==void 0?i="mousewheel":i="DOMMouseScroll",em(e,i,t,mEt)}function dEt(e){let t=e._removalFunctions;for(let n=0;n<t.length;++n)t[n]()}var OAe={position:new k};function dne(e){e._lastSeenTouchEvent=Zn()}function une(e){return Zn()-e._lastSeenTouchEvent>Of.mouseEmulationIgnoreMilliseconds}function cne(e,t,n){let i=e.x-t.x,o=e.y-t.y;return Math.sqrt(i*i+o*o)<n}function eGe(e,t){if(!une(e))return;let n=t.button;e._buttonDown[n]=!0;let i;if(n===Gs.LEFT)i=mn.LEFT_DOWN;else if(n===Gs.MIDDLE)i=mn.MIDDLE_DOWN;else if(n===Gs.RIGHT)i=mn.RIGHT_DOWN;else return;let o=lT(e,t,e._primaryPosition);k.clone(o,e._primaryStartPosition),k.clone(o,e._primaryPreviousPosition);let r=NZ(t),s=e.getInputAction(i,r);l(s)&&(k.clone(o,OAe.position),s(OAe),t.preventDefault())}var BAe={position:new k},zAe={position:new k};function one(e,t,n,i){let o=NZ(i),r=e.getInputAction(t,o),s=e.getInputAction(n,o);if(l(r)||l(s)){let a=lT(e,i,e._primaryPosition);if(l(r)&&(k.clone(a,BAe.position),r(BAe)),l(s)){let c=e._primaryStartPosition;cne(c,a,e._clickPixelTolerance)&&(k.clone(a,zAe.position),s(zAe))}}}function tGe(e,t){if(!une(e))return;let n=t.button;n!==Gs.LEFT&&n!==Gs.MIDDLE&&n!==Gs.RIGHT||(e._buttonDown[Gs.LEFT]&&(one(e,mn.LEFT_UP,mn.LEFT_CLICK,t),e._buttonDown[Gs.LEFT]=!1),e._buttonDown[Gs.MIDDLE]&&(one(e,mn.MIDDLE_UP,mn.MIDDLE_CLICK,t),e._buttonDown[Gs.MIDDLE]=!1),e._buttonDown[Gs.RIGHT]&&(one(e,mn.RIGHT_UP,mn.RIGHT_CLICK,t),e._buttonDown[Gs.RIGHT]=!1))}var rne={startPosition:new k,endPosition:new k};function nGe(e,t){if(!une(e))return;let n=NZ(t),i=lT(e,t,e._primaryPosition),o=e._primaryPreviousPosition,r=e.getInputAction(mn.MOUSE_MOVE,n);l(r)&&(k.clone(o,rne.startPosition),k.clone(i,rne.endPosition),r(rne)),k.clone(i,o),(e._buttonDown[Gs.LEFT]||e._buttonDown[Gs.MIDDLE]||e._buttonDown[Gs.RIGHT])&&t.preventDefault()}var HAe={position:new k};function uEt(e,t){let n=t.button,i;if(n===Gs.LEFT)i=mn.LEFT_DOUBLE_CLICK;else return;let o=NZ(t),r=e.getInputAction(i,o);l(r)&&(lT(e,t,HAe.position),r(HAe))}function mEt(e,t){let n;if(l(t.deltaY)){let r=t.deltaMode;r===t.DOM_DELTA_PIXEL?n=-t.deltaY:r===t.DOM_DELTA_LINE?n=-t.deltaY*40:n=-t.deltaY*120}else t.detail>0?n=t.detail*-120:n=t.wheelDelta;if(!l(n))return;let i=NZ(t),o=e.getInputAction(mn.WHEEL,i);l(o)&&(o(n),t.preventDefault())}function hEt(e,t){dne(e);let n=t.changedTouches,i,o=n.length,r,s,a=e._positions;for(i=0;i<o;++i)r=n[i],s=r.identifier,a.set(s,lT(e,r,new k));Az(e,t);let c=e._previousPositions;for(i=0;i<o;++i)r=n[i],s=r.identifier,c.set(s,k.clone(a.get(s)))}function KAe(e,t){dne(e);let n=t.changedTouches,i,o=n.length,r,s,a=e._positions;for(i=0;i<o;++i)r=n[i],s=r.identifier,a.remove(s);Az(e,t);let c=e._previousPositions;for(i=0;i<o;++i)r=n[i],s=r.identifier,c.remove(s)}var JAe={position:new k},sne={position1:new k,position2:new k},jAe={position:new k},QAe={position:new k},qAe={position:new k};function Az(e,t){let n=NZ(t),i=e._positions,o=i.length,r,s,a=e._isPinching;if(o!==1&&e._buttonDown[Gs.LEFT]){if(e._buttonDown[Gs.LEFT]=!1,l(e._touchHoldTimer)&&(clearTimeout(e._touchHoldTimer),e._touchHoldTimer=void 0),r=e.getInputAction(mn.LEFT_UP,n),l(r)&&(k.clone(e._primaryPosition,jAe.position),r(jAe)),o===0&&!e._isTouchHolding&&(s=e.getInputAction(mn.LEFT_CLICK,n),l(s))){let c=e._primaryStartPosition,d=e._previousPositions.values[0];cne(c,d,e._clickPixelTolerance)&&(k.clone(e._primaryPosition,QAe.position),s(QAe))}e._isTouchHolding=!1}if(o===0&&a&&(e._isPinching=!1,r=e.getInputAction(mn.PINCH_END,n),l(r)&&r()),o===1&&!a){let c=i.values[0];k.clone(c,e._primaryPosition),k.clone(c,e._primaryStartPosition),k.clone(c,e._primaryPreviousPosition),e._buttonDown[Gs.LEFT]=!0,r=e.getInputAction(mn.LEFT_DOWN,n),l(r)&&(k.clone(c,JAe.position),r(JAe)),e._touchHoldTimer=setTimeout(function(){if(!e.isDestroyed()&&(e._touchHoldTimer=void 0,e._isTouchHolding=!0,s=e.getInputAction(mn.RIGHT_CLICK,n),l(s))){let d=e._primaryStartPosition,u=e._previousPositions.values[0];cne(d,u,e._holdPixelTolerance)&&(k.clone(e._primaryPosition,qAe.position),s(qAe))}},Of.touchHoldDelayMilliseconds),t.preventDefault()}o===2&&!a&&(e._isPinching=!0,r=e.getInputAction(mn.PINCH_START,n),l(r)&&(k.clone(i.values[0],sne.position1),k.clone(i.values[1],sne.position2),r(sne),t.preventDefault()))}function fEt(e,t){dne(e);let n=t.changedTouches,i,o=n.length,r,s,a=e._positions;for(i=0;i<o;++i){r=n[i],s=r.identifier;let d=a.get(s);l(d)&&lT(e,r,d)}iGe(e,t);let c=e._previousPositions;for(i=0;i<o;++i)r=n[i],s=r.identifier,k.clone(a.get(s),c.get(s))}var ane={startPosition:new k,endPosition:new k},Qw={distance:{startPosition:new k,endPosition:new k},angleAndHeight:{startPosition:new k,endPosition:new k}};function iGe(e,t){let n=NZ(t),i=e._positions,o=e._previousPositions,r=i.length,s;if(r===1&&e._buttonDown[Gs.LEFT]){let a=i.values[0];k.clone(a,e._primaryPosition);let c=e._primaryPreviousPosition;s=e.getInputAction(mn.MOUSE_MOVE,n),l(s)&&(k.clone(c,ane.startPosition),k.clone(a,ane.endPosition),s(ane)),k.clone(a,c),t.preventDefault()}else if(r===2&&e._isPinching&&(s=e.getInputAction(mn.PINCH_MOVE,n),l(s))){let a=i.values[0],c=i.values[1],d=o.values[0],u=o.values[1],m=c.x-a.x,p=c.y-a.y,b=Math.sqrt(m*m+p*p)*.25,f=u.x-d.x,y=u.y-d.y,_=Math.sqrt(f*f+y*y)*.25,S=(c.y+a.y)*.125,Z=(u.y+d.y)*.125,R=Math.atan2(p,m),C=Math.atan2(y,f);k.fromElements(0,_,Qw.distance.startPosition),k.fromElements(0,b,Qw.distance.endPosition),k.fromElements(C,Z,Qw.angleAndHeight.startPosition),k.fromElements(R,S,Qw.angleAndHeight.endPosition),s(Qw)}}function pEt(e,t){if(t.target.setPointerCapture(t.pointerId),t.pointerType==="touch"){let n=e._positions,i=t.pointerId;n.set(i,lT(e,t,new k)),Az(e,t),e._previousPositions.set(i,k.clone(n.get(i)))}else eGe(e,t)}function $Ae(e,t){if(t.pointerType==="touch"){let n=e._positions,i=t.pointerId;n.remove(i),Az(e,t),e._previousPositions.remove(i)}else tGe(e,t)}function bEt(e,t){if(t.pointerType==="touch"){let n=e._positions,i=t.pointerId,o=n.get(i);if(!l(o))return;lT(e,t,o),iGe(e,t);let r=e._previousPositions;k.clone(n.get(i),r.get(i))}else nGe(e,t)}function Of(e){this._inputEvents={},this._buttonDown={[Gs.LEFT]:!1,[Gs.MIDDLE]:!1,[Gs.RIGHT]:!1},this._isPinching=!1,this._isTouchHolding=!1,this._lastSeenTouchEvent=-Of.mouseEmulationIgnoreMilliseconds,this._primaryStartPosition=new k,this._primaryPosition=new k,this._primaryPreviousPosition=new k,this._positions=new kt,this._previousPositions=new kt,this._removalFunctions=[],this._touchHoldTimer=void 0,this._clickPixelTolerance=5,this._holdPixelTolerance=25,this._element=e??document,lEt(this)}Of.prototype.setInputAction=function(e,t,n){let i=lne(t,n);this._inputEvents[i]=e};Of.prototype.getInputAction=function(e,t){let n=lne(e,t);return this._inputEvents[n]};Of.prototype.removeInputAction=function(e,t){let n=lne(e,t);delete this._inputEvents[n]};Of.prototype.isDestroyed=function(){return!1};Of.prototype.destroy=function(){return dEt(this),ue(this)};Of.mouseEmulationIgnoreMilliseconds=800;Of.touchHoldDelayMilliseconds=1500;var oa=Of;function YZ(e){this._scene=e,this._currentTweens=[],this._morphHandler=void 0,this._morphCancelled=!1,this._completeMorph=void 0,this._morphToOrthographic=!1}YZ.prototype.completeMorph=function(){l(this._completeMorph)&&this._completeMorph()};YZ.prototype.morphTo2D=function(e,t){l(this._completeMorph)&&this._completeMorph();let n=this._scene;this._previousMode=n.mode,this._morphToOrthographic=n.camera.frustum instanceof yn,!(this._previousMode===se.SCENE2D||this._previousMode===se.MORPHING)&&(this._scene.morphStart.raiseEvent(this,this._previousMode,se.SCENE2D,!0),n._mode=se.MORPHING,n.camera._setTransform(P.IDENTITY),this._previousMode===se.COLUMBUS_VIEW?JEt(this,e):nAt(this,e,t),e===0&&l(this._completeMorph)&&this._completeMorph())};var gEt=new h,yEt=new h,xEt=new h,TEt=new h,_Et=new h,SEt=new h,ZEt=new h,REt=new pe,CEt=new P,VEt=new Qi,EEt=new yn,AEt={position:void 0,direction:void 0,up:void 0,position2D:void 0,direction2D:void 0,up2D:void 0,frustum:void 0};YZ.prototype.morphToColumbusView=function(e,t){l(this._completeMorph)&&this._completeMorph();let n=this._scene;if(this._previousMode=n.mode,this._previousMode===se.COLUMBUS_VIEW||this._previousMode===se.MORPHING)return;this._scene.morphStart.raiseEvent(this,this._previousMode,se.COLUMBUS_VIEW,!0),n.camera._setTransform(P.IDENTITY);let i=gEt,o=yEt,r=xEt;if(e>0)i.x=0,i.y=-1,i.z=1,i=h.multiplyByScalar(h.normalize(i,i),5*t.maximumRadius,i),h.negate(h.normalize(i,o),o),h.cross(h.UNIT_X,o,r);else{let d=n.camera;if(this._previousMode===se.SCENE2D)h.clone(d.position,i),i.z=d.frustum.right-d.frustum.left,h.negate(h.UNIT_Z,o),h.clone(h.UNIT_Y,r);else{h.clone(d.positionWC,i),h.clone(d.directionWC,o),h.clone(d.upWC,r);let u=t.scaleToGeodeticSurface(i,ZEt),m=_t.eastNorthUpToFixedFrame(u,t,CEt);P.inverseTransformation(m,m),n.mapProjection.project(t.cartesianToCartographic(i,REt),i),P.multiplyByPointAsVector(m,o,o),P.multiplyByPointAsVector(m,r,r)}}let s;this._morphToOrthographic?(s=EEt,s.width=n.camera.frustum.right-n.camera.frustum.left,s.aspectRatio=n.drawingBufferWidth/n.drawingBufferHeight):(s=VEt,s.aspectRatio=n.drawingBufferWidth/n.drawingBufferHeight,s.fov=W.toRadians(60));let a=AEt;a.position=i,a.direction=o,a.up=r,a.frustum=s;let c=oAt(a);qw(this,c),this._previousMode===se.SCENE2D?iAt(this,e,a,c):(a.position2D=P.multiplyByPoint(Io.TRANSFORM_2D,i,TEt),a.direction2D=P.multiplyByPointAsVector(Io.TRANSFORM_2D,o,_Et),a.up2D=P.multiplyByPointAsVector(Io.TRANSFORM_2D,r,SEt),n._mode=se.MORPHING,fGe(this,e,a,c)),e===0&&l(this._completeMorph)&&this._completeMorph()};var fne={position:new h,direction:new h,up:new h,frustum:void 0},rGe=new Qi;YZ.prototype.morphTo3D=function(e,t){l(this._completeMorph)&&this._completeMorph();let n=this._scene;if(this._previousMode=n.mode,!(this._previousMode===se.SCENE3D||this._previousMode===se.MORPHING)){if(this._scene.morphStart.raiseEvent(this,this._previousMode,se.SCENE3D,!0),n._mode=se.MORPHING,n.camera._setTransform(P.IDENTITY),this._previousMode===se.SCENE2D)MEt(this,e,t);else{let i;e>0?(i=fne,h.fromDegrees(0,0,5*t.maximumRadius,t,i.position),h.negate(i.position,i.direction),h.normalize(i.direction,i.direction),h.clone(h.UNIT_Z,i.up)):i=sGe(this,t);let o,r=n.camera;r.frustum instanceof yn?o=r.frustum.clone():(o=rGe,o.aspectRatio=n.drawingBufferWidth/n.drawingBufferHeight,o.fov=W.toRadians(60)),i.frustum=o;let s=bGe(i);qw(this,s),hne(this,e,i,s)}e===0&&l(this._completeMorph)&&this._completeMorph()}};YZ.prototype.isDestroyed=function(){return!1};YZ.prototype.destroy=function(){return Gz(this),ue(this)};function qw(e,t){if(e._scene.completeMorphOnUserInput){e._morphHandler=new oa(e._scene.canvas);let n=function(){e._morphCancelled=!0,e._scene.camera.cancelFlight(),t(e)};e._completeMorph=n,e._morphHandler.setInputAction(n,mn.LEFT_DOWN),e._morphHandler.setInputAction(n,mn.MIDDLE_DOWN),e._morphHandler.setInputAction(n,mn.RIGHT_DOWN),e._morphHandler.setInputAction(n,mn.WHEEL)}}function Gz(e){let t=e._currentTweens;for(let n=0;n<t.length;++n)t[n].cancelTween();e._currentTweens.length=0,e._morphHandler=e._morphHandler&&e._morphHandler.destroy()}var GEt=new pe,LEt=new h,WEt=new P;function sGe(e,t){let n=e._scene,i=n.camera,o=fne,r=o.position,s=o.direction,a=o.up,c=n.mapProjection.unproject(i.position,GEt);t.cartographicToCartesian(c,r);let d=t.scaleToGeodeticSurface(r,LEt),u=_t.eastNorthUpToFixedFrame(d,t,WEt);return P.multiplyByPointAsVector(u,i.direction,s),P.multiplyByPointAsVector(u,i.up,a),o}var vEt=new h,FEt=new h,IEt=new h,PEt=new h,XEt=new h,NEt=new h;function hne(e,t,n,i){t*=.5;let o=e._scene,r=o.camera,s=h.clone(r.position,vEt),a=h.clone(r.direction,FEt),c=h.clone(r.up,IEt),d=P.multiplyByPoint(Io.TRANSFORM_2D_INVERSE,n.position,PEt),u=P.multiplyByPointAsVector(Io.TRANSFORM_2D_INVERSE,n.direction,XEt),m=P.multiplyByPointAsVector(Io.TRANSFORM_2D_INVERSE,n.up,NEt);function p(f){gh(s,d,f.time,r.position),gh(a,u,f.time,r.direction),gh(c,m,f.time,r.up),h.cross(r.direction,r.up,r.right),h.normalize(r.right,r.right)}let b=o.tweens.add({duration:t,easingFunction:As.QUARTIC_OUT,startObject:{time:0},stopObject:{time:1},update:p,complete:function(){pGe(e,o,0,1,t,i)}});e._currentTweens.push(b)}var YEt=new yn,aGe=new h,cGe=new h,lGe=new h,pne=new h,dGe=new h,uGe=new h;function MEt(e,t,n){t/=3;let i=e._scene,o=i.camera,r;t>0?(r=fne,h.fromDegrees(0,0,5*n.maximumRadius,n,r.position),h.negate(r.position,r.direction),h.normalize(r.direction,r.direction),h.clone(h.UNIT_Z,r.up)):(o.position.z=o.frustum.right-o.frustum.left,r=sGe(e,n));let s;e._morphToOrthographic?(s=YEt,s.aspectRatio=i.drawingBufferWidth/i.drawingBufferHeight,s.width=o.frustum.right-o.frustum.left):(s=rGe,s.aspectRatio=i.drawingBufferWidth/i.drawingBufferHeight,s.fov=W.toRadians(60)),r.frustum=s;let a=bGe(r);qw(e,a);let c;e._morphToOrthographic?c=function(){hne(e,t,r,a)}:c=function(){hGe(e,t,r,function(){hne(e,t,r,a)})},t>0?(i._mode=se.SCENE2D,o.flyTo({duration:t,destination:h.fromDegrees(0,0,5*n.maximumRadius,n,pne),complete:function(){i._mode=se.MORPHING,c()}})):c()}function gh(e,t,n,i){return h.lerp(e,t,n,i)}function mGe(e,t,n,i,o){let r=e._scene,s=r.camera;if(s.frustum instanceof yn)return;let a=s.frustum.fov,c=W.RADIANS_PER_DEGREE*.5,d=n.position.z*Math.tan(a*.5);s.frustum.far=d/Math.tan(c*.5)+1e7;function u(p){s.frustum.fov=W.lerp(a,c,p.time);let b=d/Math.tan(s.frustum.fov*.5);i(s,b)}let m=r.tweens.add({duration:t,easingFunction:As.QUARTIC_OUT,startObject:{time:0},stopObject:{time:1},update:u,complete:function(){s.frustum=n.frustum.clone(),o(e)}});e._currentTweens.push(m)}var wEt=new h,kEt=new h,UEt=new h,mne=new h,DEt=new h,OEt=new h,BEt=new ps,zEt=new gn,HEt=new h,KEt={position:void 0,direction:void 0,up:void 0,frustum:void 0};function JEt(e,t){t*=.5;let n=e._scene,i=n.camera,o=h.clone(i.position,wEt),r=h.clone(i.direction,kEt),s=h.clone(i.up,UEt),a=h.negate(h.UNIT_Z,DEt),c=h.clone(h.UNIT_Y,OEt),d=mne;if(t>0)h.clone(h.ZERO,mne),d.z=5*n.ellipsoid.maximumRadius;else{h.clone(o,mne);let _=zEt;P.multiplyByPoint(Io.TRANSFORM_2D,o,_.origin),P.multiplyByPointAsVector(Io.TRANSFORM_2D,r,_.direction);let S=n.globe;if(l(S)){let Z=S.pickWorldCoordinates(_,n,!0,HEt);l(Z)&&(P.multiplyByPoint(Io.TRANSFORM_2D_INVERSE,Z,d),d.z+=h.distance(o,d))}}let u=BEt;u.right=d.z*.5,u.left=-u.right,u.top=u.right*(n.drawingBufferHeight/n.drawingBufferWidth),u.bottom=-u.top;let m=KEt;m.position=d,m.direction=a,m.up=c,m.frustum=u;let p=gGe(m);qw(e,p);function b(_){gh(o,d,_.time,i.position),gh(r,a,_.time,i.direction),gh(s,c,_.time,i.up),h.cross(i.direction,i.up,i.right),h.normalize(i.right,i.right),i._adjustOrthographicFrustum(!0)}function f(_,S){_.position.z=S}let y=n.tweens.add({duration:t,easingFunction:As.QUARTIC_OUT,startObject:{time:0},stopObject:{time:1},update:b,complete:function(){mGe(e,t,m,f,p)}});e._currentTweens.push(y)}var oGe=new pe,jEt={position:new h,direction:new h,up:new h,position2D:new h,direction2D:new h,up2D:new h,frustum:new ps},QEt={position:new h,direction:new h,up:new h,frustum:void 0},qEt=new h,$Et=new gn,eAt=new P,tAt=new h;function nAt(e,t,n){t*=.5;let i=e._scene,o=i.camera,r=jEt;if(t>0)h.clone(h.ZERO,r.position),r.position.z=5*n.maximumRadius,h.negate(h.UNIT_Z,r.direction),h.clone(h.UNIT_Y,r.up);else{n.cartesianToCartographic(o.positionWC,oGe),i.mapProjection.project(oGe,r.position),h.negate(h.UNIT_Z,r.direction),h.clone(h.UNIT_Y,r.up);let m=$Et;h.clone(r.position2D,m.origin);let p=h.clone(o.directionWC,m.direction),b=n.scaleToGeodeticSurface(o.positionWC,tAt),f=_t.eastNorthUpToFixedFrame(b,n,eAt);P.inverseTransformation(f,f),P.multiplyByPointAsVector(f,p,p),P.multiplyByPointAsVector(Io.TRANSFORM_2D,p,p);let y=i.globe;if(l(y)){let _=y.pickWorldCoordinates(m,i,!0,qEt);if(l(_)){let S=h.distance(r.position2D,_);_.x+=S,h.clone(_,r.position2D)}}}function s(m,p){m.position.x=p}P.multiplyByPoint(Io.TRANSFORM_2D,r.position,r.position2D),P.multiplyByPointAsVector(Io.TRANSFORM_2D,r.direction,r.direction2D),P.multiplyByPointAsVector(Io.TRANSFORM_2D,r.up,r.up2D);let a=r.frustum;a.right=r.position.z*.5,a.left=-a.right,a.top=a.right*(i.drawingBufferHeight/i.drawingBufferWidth),a.bottom=-a.top;let c=QEt;P.multiplyByPoint(Io.TRANSFORM_2D_INVERSE,r.position2D,c.position),h.clone(r.direction,c.direction),h.clone(r.up,c.up),c.frustum=a;let d=gGe(c);qw(e,d);function u(){mGe(e,t,r,s,d)}fGe(e,t,r,u)}function hGe(e,t,n,i){let o=e._scene,r=o.camera,s=r.frustum.right-r.frustum.left;r.frustum=n.frustum.clone();let a=r.frustum.fov,c=W.RADIANS_PER_DEGREE*.5,d=s*Math.tan(a*.5);r.frustum.far=d/Math.tan(c*.5)+1e7,r.frustum.fov=c;function u(p){r.frustum.fov=W.lerp(c,a,p.time),r.position.z=d/Math.tan(r.frustum.fov*.5)}let m=o.tweens.add({duration:t,easingFunction:As.QUARTIC_OUT,startObject:{time:0},stopObject:{time:1},update:u,complete:function(){i(e)}});e._currentTweens.push(m)}function iAt(e,t,n,i){t*=.5;let o=e._scene,r=o.camera,s=h.clone(n.position,pne),a=h.clone(n.direction,dGe),c=h.clone(n.up,uGe);o._mode=se.MORPHING;function d(){r.frustum=n.frustum.clone();let u=h.clone(r.position,aGe),m=h.clone(r.direction,cGe),p=h.clone(r.up,lGe);u.z=s.z;function b(y){gh(u,s,y.time,r.position),gh(m,a,y.time,r.direction),gh(p,c,y.time,r.up),h.cross(r.direction,r.up,r.right),h.normalize(r.right,r.right)}let f=o.tweens.add({duration:t,easingFunction:As.QUARTIC_OUT,startObject:{time:0},stopObject:{time:1},update:b,complete:function(){i(e)}});e._currentTweens.push(f)}e._morphToOrthographic?d():hGe(e,0,n,d)}function fGe(e,t,n,i){let o=e._scene,r=o.camera,s=h.clone(r.position,aGe),a=h.clone(r.direction,cGe),c=h.clone(r.up,lGe),d=h.clone(n.position2D,pne),u=h.clone(n.direction2D,dGe),m=h.clone(n.up2D,uGe);function p(f){gh(s,d,f.time,r.position),gh(a,u,f.time,r.direction),gh(c,m,f.time,r.up),h.cross(r.direction,r.up,r.right),h.normalize(r.right,r.right),r._adjustOrthographicFrustum(!0)}let b=o.tweens.add({duration:t,easingFunction:As.QUARTIC_OUT,startObject:{time:0},stopObject:{time:1},update:p,complete:function(){pGe(e,o,1,0,t,i)}});e._currentTweens.push(b)}function pGe(e,t,n,i,o,r){let s={object:t,property:"morphTime",startValue:n,stopValue:i,duration:o,easingFunction:As.QUARTIC_OUT};l(r)&&(s.complete=function(){r(e)});let a=t.tweens.addProperty(s);e._currentTweens.push(a)}function bGe(e){return function(t){let n=t._scene;n._mode=se.SCENE3D,n.morphTime=se.getMorphTime(se.SCENE3D),Gz(t);let i=n.camera;(t._previousMode!==se.MORPHING||t._morphCancelled)&&(t._morphCancelled=!1,h.clone(e.position,i.position),h.clone(e.direction,i.direction),h.clone(e.up,i.up),h.cross(i.direction,i.up,i.right),h.normalize(i.right,i.right),i.frustum=e.frustum.clone());let o=i.frustum;n.frameState.useLogDepth&&(o.near=.1,o.far=1e10);let r=l(t._completeMorph);t._completeMorph=void 0,n.camera.update(n.mode),t._scene.morphComplete.raiseEvent(t,t._previousMode,se.SCENE3D,r)}}function gGe(e){return function(t){let n=t._scene;n._mode=se.SCENE2D,n.morphTime=se.getMorphTime(se.SCENE2D),Gz(t);let i=n.camera;h.clone(e.position,i.position),i.position.z=n.ellipsoid.maximumRadius*2,h.clone(e.direction,i.direction),h.clone(e.up,i.up),h.cross(i.direction,i.up,i.right),h.normalize(i.right,i.right),i.frustum=e.frustum.clone();let o=l(t._completeMorph);t._completeMorph=void 0,n.camera.update(n.mode),t._scene.morphComplete.raiseEvent(t,t._previousMode,se.SCENE2D,o)}}function oAt(e){return function(t){let n=t._scene;n._mode=se.COLUMBUS_VIEW,n.morphTime=se.getMorphTime(se.COLUMBUS_VIEW),Gz(t);let i=n.camera;(t._previousModeMode!==se.MORPHING||t._morphCancelled)&&(t._morphCancelled=!1,h.clone(e.position,i.position),h.clone(e.direction,i.direction),h.clone(e.up,i.up),h.cross(i.direction,i.up,i.right),h.normalize(i.right,i.right));let o=i.frustum;n.frameState.useLogDepth&&(o.near=.1,o.far=1e10);let r=l(t._completeMorph);t._completeMorph=void 0,n.camera.update(n.mode),t._scene.morphComplete.raiseEvent(t,t._previousMode,se.COLUMBUS_VIEW,r)}}var $w=YZ;var Fro=x(T(),1);var Qoo=x(T(),1);var koo=x(T(),1),yGe={LEFT_DRAG:0,RIGHT_DRAG:1,MIDDLE_DRAG:2,WHEEL:3,PINCH:4};Object.freeze(yGe);var ao=yGe;var ZGe=[nr.SHIFT,nr.CTRL,nr.ALT,[nr.SHIFT,nr.CTRL],[nr.SHIFT,nr.ALT],[nr.CTRL,nr.ALT],[nr.SHIFT,nr.CTRL,nr.ALT]];function Qa(e,t){if(!l(t))return`${e}`;let n=Array.isArray(t)?t.toSorted():[t];return`${e}+${n.join("+")}`}function rAt(e,t){k.clone(e.distance.startPosition,t.distance.startPosition),k.clone(e.distance.endPosition,t.distance.endPosition),k.clone(e.angleAndHeight.startPosition,t.angleAndHeight.startPosition),k.clone(e.angleAndHeight.endPosition,t.angleAndHeight.endPosition)}function xGe(e,t,n){let i=Qa(ao.PINCH,t),o=e._update,r=e._isDown,s=e._eventStartPosition,a=e._pressTime,c=e._releaseTime;o[i]=!0,r[i]=!1,s[i]=new k;let d=e._movement[i];l(d)||(d=e._movement[i]={}),d.distance={startPosition:new k,endPosition:new k},d.angleAndHeight={startPosition:new k,endPosition:new k},d.prevAngle=0,e._eventHandler.setInputAction(function(u){e._buttonsDown++,r[i]=!0,a[i]=new Date,k.lerp(u.position1,u.position2,.5,s[i])},mn.PINCH_START,t),e._eventHandler.setInputAction(function(){e._buttonsDown=Math.max(e._buttonsDown-1,0),r[i]=!1,c[i]=new Date},mn.PINCH_END,t),e._eventHandler.setInputAction(function(u){if(r[i]){o[i]?(rAt(u,d),o[i]=!1,d.prevAngle=d.angleAndHeight.startPosition.x):(k.clone(u.distance.endPosition,d.distance.endPosition),k.clone(u.angleAndHeight.endPosition,d.angleAndHeight.endPosition));let m=d.angleAndHeight.endPosition.x,p=d.prevAngle,b=Math.PI*2;for(;m>=p+Math.PI;)m-=b;for(;m<p-Math.PI;)m+=b;d.angleAndHeight.endPosition.x=-m*n.clientWidth/12,d.angleAndHeight.startPosition.x=-p*n.clientWidth/12}},mn.PINCH_MOVE,t)}function TGe(e,t){let n=Qa(ao.WHEEL,t),i=e._pressTime,o=e._releaseTime,r=e._update;r[n]=!0;let s=e._movement[n];l(s)||(s=e._movement[n]={});let a=e._lastMovement[n];l(a)||(a=e._lastMovement[n]={startPosition:new k,endPosition:new k,valid:!1}),s.startPosition=new k,k.clone(k.ZERO,s.startPosition),s.endPosition=new k,e._eventHandler.setInputAction(function(c){let d=7.5*W.toRadians(c);i[n]=o[n]=new Date,s.endPosition.x=0,s.endPosition.y=d,k.clone(s.endPosition,a.endPosition),a.valid=!0,r[n]=!1},mn.WHEEL,t)}function lE(e,t,n){let i=Qa(n,t),o=e._isDown,r=e._eventStartPosition,s=e._pressTime;o[i]=!1,r[i]=new k;let a=e._lastMovement[i];l(a)||(a=e._lastMovement[i]={startPosition:new k,endPosition:new k,valid:!1});let c,d;n===ao.LEFT_DRAG?(c=mn.LEFT_DOWN,d=mn.LEFT_UP):n===ao.RIGHT_DRAG?(c=mn.RIGHT_DOWN,d=mn.RIGHT_UP):n===ao.MIDDLE_DRAG&&(c=mn.MIDDLE_DOWN,d=mn.MIDDLE_UP),e._eventHandler.setInputAction(function(u){e._buttonsDown++,a.valid=!1,o[i]=!0,s[i]=new Date,k.clone(u.position,r[i])},c,t),e._eventHandler.setInputAction(function(){bne(Qa(n,void 0),e);for(let u of ZGe){let m=Qa(n,u);bne(m,e)}},d,t)}function bne(e,t){let n=t._releaseTime,i=t._isDown;i[e]&&(t._buttonsDown=Math.max(t._buttonsDown-1,0)),i[e]=!1,n[e]=new Date}function _Ge(e,t){k.clone(e.startPosition,t.startPosition),k.clone(e.endPosition,t.endPosition)}function sAt(e,t,n){let i=n._isDown,o=!1,r=Qa(e,t);for(let[c,d]of Object.entries(i))c.startsWith(e)&&d&&c!==r&&(o=!0,bne(c,n));if(!o)return;let s=n._pressTime,a=n._lastMovement[r];l(a)||(a=n._lastMovement[r]={startPosition:new k,endPosition:new k,valid:!1}),n._buttonsDown++,a.valid=!1,i[r]=!0,s[r]=new Date}function SGe(e,t){let n=e._update,i=e._movement,o=e._lastMovement,r=e._isDown;for(let s in ao)if(ao.hasOwnProperty(s)){let a=ao[s];if(l(a)){let c=Qa(a,t);n[c]=!0,l(e._lastMovement[c])||(e._lastMovement[c]={startPosition:new k,endPosition:new k,valid:!1}),l(e._movement[c])||(e._movement[c]={startPosition:new k,endPosition:new k})}}e._eventHandler.setInputAction(function(s){for(let a in ao)if(ao.hasOwnProperty(a)){let c=ao[a];if(l(c)){let d=Qa(c,t);sAt(c,t,e),r[d]&&(n[d]?(_Ge(i[d],o[d]),o[d].valid=!0,_Ge(s,i[d]),n[d]=!1):k.clone(s.endPosition,i[d].endPosition))}}k.clone(s.endPosition,e._currentMousePosition)},mn.MOUSE_MOVE,t)}function yh(e){this._eventHandler=new oa(e),this._update={},this._movement={},this._lastMovement={},this._isDown={},this._eventStartPosition={},this._pressTime={},this._releaseTime={},this._buttonsDown=0,this._currentMousePosition=new k,TGe(this,void 0),xGe(this,void 0,e),lE(this,void 0,ao.LEFT_DRAG),lE(this,void 0,ao.RIGHT_DRAG),lE(this,void 0,ao.MIDDLE_DRAG),SGe(this,void 0);for(let t of ZGe)TGe(this,t),xGe(this,t,e),lE(this,t,ao.LEFT_DRAG),lE(this,t,ao.RIGHT_DRAG),lE(this,t,ao.MIDDLE_DRAG),SGe(this,t)}Object.defineProperties(yh.prototype,{currentMousePosition:{get:function(){return this._currentMousePosition}},anyButtonDown:{get:function(){let e=!this._update[Qa(ao.WHEEL)]||!this._update[Qa(ao.WHEEL,nr.SHIFT)]||!this._update[Qa(ao.WHEEL,nr.CTRL)]||!this._update[Qa(ao.WHEEL,nr.ALT)];return this._buttonsDown>0||e}}});yh.prototype.isMoving=function(e,t){let n=Qa(e,t);return!this._update[n]};yh.prototype.getMovement=function(e,t){let n=Qa(e,t);return this._movement[n]};yh.prototype.getLastMovement=function(e,t){let n=Qa(e,t),i=this._lastMovement[n];if(i.valid)return i};yh.prototype.isButtonDown=function(e,t){let n=Qa(e,t);return this._isDown[n]};yh.prototype.getStartMousePosition=function(e,t){if(e===ao.WHEEL)return this._currentMousePosition;let n=Qa(e,t);return this._eventStartPosition[n]};yh.prototype.getButtonPressTime=function(e,t){let n=Qa(e,t);return this._pressTime[n]};yh.prototype.getButtonReleaseTime=function(e,t){let n=Qa(e,t);return this._releaseTime[n]};yh.prototype.reset=function(){for(let e in this._update)this._update.hasOwnProperty(e)&&(this._update[e]=!0)};yh.prototype.isDestroyed=function(){return!1};yh.prototype.destroy=function(){return this._eventHandler=this._eventHandler&&this._eventHandler.destroy(),ue(this)};var e9=yh;var sro=x(T(),1);function Lz(e,t,n,i,o,r,s,a,c,d){this._tweens=e,this._tweenjs=t,this._startObject=$e(n),this._stopObject=$e(i),this._duration=o,this._delay=r,this._easingFunction=s,this._update=a,this._complete=c,this.cancel=d,this.needsStart=!0}Object.defineProperties(Lz.prototype,{startObject:{get:function(){return this._startObject}},stopObject:{get:function(){return this._stopObject}},duration:{get:function(){return this._duration}},delay:{get:function(){return this._delay}},easingFunction:{get:function(){return this._easingFunction}},update:{get:function(){return this._update}},complete:{get:function(){return this._complete}},tweenjs:{get:function(){return this._tweenjs}}});Lz.prototype.cancelTween=function(){this._tweens.remove(this)};function Bf(){this._tweens=[]}Object.defineProperties(Bf.prototype,{length:{get:function(){return this._tweens.length}}});Bf.prototype.add=function(e){if(e=e??B.EMPTY_OBJECT,e.duration===0)return l(e.complete)&&e.complete(),new Lz(this);let t=e.duration/wn.SECONDS_PER_MILLISECOND,n=e.delay??0,i=n/wn.SECONDS_PER_MILLISECOND,o=e.easingFunction??As.LINEAR_NONE,r=e.startObject,s=new rEe(r);s.to($e(e.stopObject),t),s.delay(i),s.easing(o),l(e.update)&&s.onUpdate(function(){e.update(r)}),s.onComplete(e.complete??null),s.repeat(e._repeat??0);let a=new Lz(this,s,e.startObject,e.stopObject,e.duration,n,o,e.update,e.complete,e.cancel);return this._tweens.push(a),a};Bf.prototype.addProperty=function(e){e=e??B.EMPTY_OBJECT;let t=e.object,n=e.property,i=e.startValue,o=e.stopValue;function r(s){t[n]=s.value}return this.add({startObject:{value:i},stopObject:{value:o},duration:e.duration??3,delay:e.delay,easingFunction:e.easingFunction,update:r,complete:e.complete,cancel:e.cancel,_repeat:e._repeat})};Bf.prototype.addAlpha=function(e){e=e??B.EMPTY_OBJECT;let t=e.material,n=[];for(let o in t.uniforms)t.uniforms.hasOwnProperty(o)&&l(t.uniforms[o])&&l(t.uniforms[o].alpha)&&n.push(o);function i(o){let r=n.length;for(let s=0;s<r;++s)t.uniforms[n[s]].alpha=o.alpha}return this.add({startObject:{alpha:e.startValue??0},stopObject:{alpha:e.stopValue??1},duration:e.duration??3,delay:e.delay,easingFunction:e.easingFunction,update:i,complete:e.complete,cancel:e.cancel})};Bf.prototype.addOffsetIncrement=function(e){e=e??B.EMPTY_OBJECT;let n=e.material.uniforms;return this.addProperty({object:n,property:"offset",startValue:n.offset,stopValue:n.offset+1,duration:e.duration,delay:e.delay,easingFunction:e.easingFunction,update:e.update,cancel:e.cancel,_repeat:1/0})};Bf.prototype.remove=function(e){if(!l(e))return!1;let t=this._tweens.indexOf(e);return t!==-1?(e.tweenjs.stop(),l(e.cancel)&&e.cancel(),this._tweens.splice(t,1),!0):!1};Bf.prototype.removeAll=function(){let e=this._tweens;for(let t=0;t<e.length;++t){let n=e[t];n.tweenjs.stop(),l(n.cancel)&&n.cancel()}e.length=0};Bf.prototype.contains=function(e){return l(e)&&this._tweens.indexOf(e)!==-1};Bf.prototype.get=function(e){return this._tweens[e]};Bf.prototype.update=function(e){let t=this._tweens,n=0;for(e=l(e)?e/wn.SECONDS_PER_MILLISECOND:Zn();n<t.length;){let i=t[n],o=i.tweenjs;if(i.needsStart)i.needsStart=!1,o.start(e);else if(o.update(e))n++;else{if(t[n]?.needsStart)continue;o.stop(),t.splice(n,1)}}};var MZ=Bf;function n9(e){this.enableInputs=!0,this.enableTranslate=!0,this.enableZoom=!0,this.enableRotate=!0,this.enableTilt=!0,this.enableLook=!0,this.inertiaSpin=.9,this.inertiaTranslate=.9,this.inertiaZoom=.8,this.maximumMovementRatio=.1,this.bounceAnimationTime=3,this.minimumZoomDistance=1,this.maximumZoomDistance=Number.POSITIVE_INFINITY,this.zoomFactor=5,this.translateEventTypes=ao.LEFT_DRAG,this.zoomEventTypes=[ao.RIGHT_DRAG,ao.WHEEL,ao.PINCH],this.rotateEventTypes=ao.LEFT_DRAG,this.tiltEventTypes=[ao.MIDDLE_DRAG,ao.PINCH,{eventType:ao.LEFT_DRAG,modifier:nr.CTRL},{eventType:ao.RIGHT_DRAG,modifier:nr.CTRL}],this.lookEventTypes={eventType:ao.LEFT_DRAG,modifier:nr.SHIFT};let t=e.ellipsoid??ne.default;this.minimumPickingTerrainHeight=ne.WGS84.equals(t)?15e4:t.minimumRadius*.025,this._minimumPickingTerrainHeight=this.minimumPickingTerrainHeight,this.minimumPickingTerrainDistanceWithInertia=ne.WGS84.equals(t)?4e3:t.minimumRadius*63e-5,this.minimumCollisionTerrainHeight=ne.WGS84.equals(t)?15e3:t.minimumRadius*.0025,this._minimumCollisionTerrainHeight=this.minimumCollisionTerrainHeight,this.minimumTrackBallHeight=ne.WGS84.equals(t)?75e5:t.minimumRadius*1.175,this._minimumTrackBallHeight=this.minimumTrackBallHeight,this.enableCollisionDetection=!0,this.maximumTiltAngle=void 0,this._scene=e,this._globe=void 0,this._ellipsoid=t,this._lastGlobeHeight=0,this._aggregator=new e9(e.canvas),this._lastInertiaSpinMovement=void 0,this._lastInertiaZoomMovement=void 0,this._lastInertiaTranslateMovement=void 0,this._lastInertiaTiltMovement=void 0,this._inertiaDisablers={_lastInertiaZoomMovement:["_lastInertiaSpinMovement","_lastInertiaTranslateMovement","_lastInertiaTiltMovement"],_lastInertiaTiltMovement:["_lastInertiaSpinMovement","_lastInertiaTranslateMovement"]},this._tweens=new MZ,this._tween=void 0,this._horizontalRotationAxis=void 0,this._tiltCenterMousePosition=new k(-1,-1),this._tiltCenter=new h,this._rotateMousePosition=new k(-1,-1),this._rotateStartPosition=new h,this._strafeStartPosition=new h,this._strafeMousePosition=new k,this._strafeEndMousePosition=new k,this._zoomMouseStart=new k(-1,-1),this._zoomWorldPosition=new h,this._useZoomWorldPosition=!1,this._panLastMousePosition=new k,this._panLastWorldPosition=new h,this._tiltCVOffMap=!1,this._looking=!1,this._rotating=!1,this._strafing=!1,this._zoomingOnVector=!1,this._zoomingUnderground=!1,this._rotatingZoom=!1,this._adjustedHeightForTerrain=!1,this._cameraUnderground=!1;let n=e.mapProjection;this._maxCoord=n.project(new pe(Math.PI,W.PI_OVER_TWO)),this._rotateFactor=void 0,this._rotateRateRangeAdjustment=void 0,this._maximumRotateRate=1.77,this._minimumRotateRate=1/5e3,this._minimumZoomRate=20,this._maximumZoomRate=5906376272e3,this._minimumUndergroundPickDistance=2e3,this._maximumUndergroundPickDistance=1e4}function aAt(e,t){if(e<0)return 0;let n=(1-t)*25;return Math.exp(-n*e)}function cAt(e){return k.equalsEpsilon(e.startPosition,e.endPosition,W.EPSILON14)}var lAt=.4;function dAt(e,t,n,i,o,r,s){let a=r[s];l(a)||(a=r[s]={startPosition:new k,endPosition:new k,motion:new k,inertiaEnabled:!0});let c=e.getButtonPressTime(t,n),d=e.getButtonReleaseTime(t,n),u=c&&d&&(d.getTime()-c.getTime())/1e3,p=d&&(new Date().getTime()-d.getTime())/1e3;if(c&&d&&u<lAt){let b=aAt(p,i),f=e.getLastMovement(t,n);if(!l(f)||cAt(f)||!a.inertiaEnabled||(a.motion.x=(f.endPosition.x-f.startPosition.x)*.5,a.motion.y=(f.endPosition.y-f.startPosition.y)*.5,a.startPosition=k.clone(f.startPosition,a.startPosition),a.endPosition=k.multiplyByScalar(a.motion,b,a.endPosition),a.endPosition=k.add(a.startPosition,a.endPosition,a.endPosition),isNaN(a.endPosition.x)||isNaN(a.endPosition.y)||k.distance(a.startPosition,a.endPosition)<.5))return;if(!e.isButtonDown(t,n)){let y=e.getStartMousePosition(t,n);o(r,y,a)}}}function uAt(e,t){if(l(t)){let n=e[t];l(n)&&(n.inertiaEnabled=!0);let i=e._inertiaDisablers[t];if(l(i)){let o=i.length;for(let r=0;r<o;++r)n=e[i[r]],l(n)&&(n.inertiaEnabled=!1)}}}var RGe=[];function fd(e,t,n,i,o,r){if(!l(n))return;let s=e._aggregator;Array.isArray(n)||(RGe[0]=n,n=RGe);let a=n.length;for(let c=0;c<a;++c){let d=n[c],u=l(d.eventType)?d.eventType:d,m=d.modifier,p=s.isMoving(u,m)&&s.getMovement(u,m),b=s.getStartMousePosition(u,m);e.enableInputs&&t&&(p?(i(e,b,p),uAt(e,r)):o<1&&dAt(s,u,m,o,i,e,r))}}var Wz=new gn,mAt=new h,hAt=new k,fAt=new h,pAt=new k,bAt=new h,gAt=new h,yAt=new h,xAt=new h,XGe=new h,TAt=new h,_At=new h,SAt=new h,ZAt=new h,RAt=new h,CAt=new h,VAt=new h,EAt=new h,AAt=new h,GAt=new h,wZ=new h,CGe=new h,VGe=new h,gne={orientation:new Cc};function Cne(e,t,n,i,o,r){let s=1;l(r)&&(s=W.clamp(Math.abs(r),.25,1));let a=n.endPosition.y-n.startPosition.y,d=a>0?e.minimumZoomDistance*s:0,u=e.maximumZoomDistance,m=o-d,p=i*m;p=W.clamp(p,e._minimumZoomRate,e._maximumZoomRate);let b=a/e._scene.canvas.clientHeight;b=Math.min(b,e.maximumMovementRatio);let f=p*b;if(e.enableCollisionDetection||e.minimumZoomDistance===0||!l(e._globe)){if(f>0&&Math.abs(o-d)<1||f<0&&Math.abs(o-u)<1)return;o-f<d?f=o-d-1:o-f>u&&(f=o-u)}let y=e._scene,_=y.camera,S=y.mode,Z=gne.orientation;Z.heading=_.heading,Z.pitch=_.pitch,Z.roll=_.roll;let R=n.inertiaEnabled??k.equals(t,e._zoomMouseStart),C=e._zoomingOnVector,E=e._rotatingZoom,A;if(R||(e._zoomMouseStart=k.clone(t,e._zoomMouseStart),l(e._globe)&&S===se.SCENE2D?(A=_.getPickRay(t,Wz).origin,A=h.fromElements(A.y,A.z,A.x)):l(e._globe)&&(A=kg(e,t,mAt)),l(A)?(e._useZoomWorldPosition=!0,e._zoomWorldPosition=h.clone(A,e._zoomWorldPosition)):e._useZoomWorldPosition=!1,C=e._zoomingOnVector=!1,E=e._rotatingZoom=!1,e._zoomingUnderground=e._cameraUnderground),!e._useZoomWorldPosition){_.zoomIn(f);return}let L=S===se.COLUMBUS_VIEW;if(_.positionCartographic.height<2e6&&(E=!0),!R||E){if(S===se.SCENE2D){let F=e._zoomWorldPosition,I=_.position;if(!h.equals(F,I)&&_.positionCartographic.height<e._maxCoord.x*2){let N=_.position.x,g=h.subtract(F,I,fAt);h.normalize(g,g);let V=h.distance(F,I)*f/(_.getMagnitude()*.5);_.move(g,V*.5),(_.position.x<0&&N>0||_.position.x>0&&N<0)&&(A=_.getPickRay(t,Wz).origin,A=h.fromElements(A.y,A.z,A.x),e._zoomWorldPosition=h.clone(A,e._zoomWorldPosition))}}else if(S===se.SCENE3D){let F=h.normalize(_.position,XGe);if(e._cameraUnderground||e._zoomingUnderground||_.positionCartographic.height<3e3&&Math.abs(h.dot(_.direction,F))<.6)L=!0;else{let I=y.canvas,N=pAt;N.x=I.clientWidth/2,N.y=I.clientHeight/2;let g=kg(e,N,bAt);if(!l(g))L=!0;else if(_.positionCartographic.height<1e6)if(h.dot(_.direction,F)>=-.5)L=!0;else{let V=_At;h.clone(_.position,V);let G=e._zoomWorldPosition,v=TAt;if(v=h.normalize(G,v),h.dot(v,F)<0)return;let X=GAt,Y=RAt;h.clone(_.direction,Y),h.add(V,h.multiplyByScalar(Y,1e3,wZ),X);let D=CAt,M=VAt;h.subtract(G,V,D),h.normalize(D,M);let O=h.dot(F,M);if(O>=0){e._zoomMouseStart.x=-1;return}let w=Math.acos(-O),z=h.magnitude(V),K=h.magnitude(G),te=z-f,H=h.magnitude(D),$=Math.asin(W.clamp(H/K*Math.sin(w),-1,1)),ee=Math.asin(W.clamp(te/K*Math.sin(w),-1,1)),le=$-ee+w,_e=SAt;h.normalize(V,_e);let he=ZAt;he=h.cross(M,_e,he),he=h.normalize(he,he),h.normalize(h.cross(_e,he,wZ),Y),h.multiplyByScalar(h.normalize(X,wZ),h.magnitude(X)-f,X),h.normalize(V,V),h.multiplyByScalar(V,te,V);let Ze=EAt;h.multiplyByScalar(h.add(h.multiplyByScalar(_e,Math.cos(le)-1,CGe),h.multiplyByScalar(Y,Math.sin(le),VGe),wZ),te,Ze),h.add(V,Ze,V),h.normalize(X,_e),h.normalize(h.cross(_e,he,wZ),Y);let ye=AAt;h.multiplyByScalar(h.add(h.multiplyByScalar(_e,Math.cos(le)-1,CGe),h.multiplyByScalar(Y,Math.sin(le),VGe),wZ),h.magnitude(X),ye),h.add(X,ye,X),h.clone(V,_.position),h.normalize(h.subtract(X,V,wZ),_.direction),h.clone(_.direction,_.direction),h.cross(_.direction,_.up,_.right),h.cross(_.right,_.direction,_.up),_.setView(gne);return}else{let V=h.normalize(g,gAt),G=h.normalize(e._zoomWorldPosition,yAt),v=h.dot(G,V);if(v>0&&v<1){let X=W.acosClamped(v),Y=h.cross(G,V,xAt),D=Math.abs(X)>W.toRadians(20)?_.positionCartographic.height*.75:_.positionCartographic.height-f,M=f/D;_.rotate(Y,X*M)}}}}e._rotatingZoom=!L}if(!R&&L||C){let F,I=fo.worldToWindowCoordinates(y,e._zoomWorldPosition,hAt);S!==se.COLUMBUS_VIEW&&k.equals(t,e._zoomMouseStart)&&l(I)?F=_.getPickRay(I,Wz):F=_.getPickRay(t,Wz);let N=F.direction;(S===se.COLUMBUS_VIEW||S===se.SCENE2D)&&h.fromElements(N.y,N.z,N.x,N),_.move(N,f),e._zoomingOnVector=!0}else _.zoomIn(f);e._cameraUnderground||_.setView(gne)}var LAt=new gn,WAt=new gn,vAt=new h;function FAt(e,t,n){let o=e._scene.camera,r=o.getPickRay(n.startPosition,LAt).origin,s=o.getPickRay(n.endPosition,WAt).origin;r=h.fromElements(r.y,r.z,r.x,r),s=h.fromElements(s.y,s.z,s.x,s);let a=h.subtract(r,s,vAt),c=h.magnitude(a);c>0&&(h.normalize(a,a),o.move(a,c))}function EGe(e,t,n){l(n.distance)&&(n=n.distance);let o=e._scene.camera;Cne(e,t,n,e.zoomFactor,o.getMagnitude())}var IAt=new k,PAt=new k;function AGe(e,t,n){if(l(n.angleAndHeight)){XAt(e,t,n.angleAndHeight);return}let i=e._scene,o=i.camera,r=i.canvas,s=r.clientWidth,a=r.clientHeight,c=IAt;c.x=2/s*n.startPosition.x-1,c.y=2/a*(a-n.startPosition.y)-1,c=k.normalize(c,c);let d=PAt;d.x=2/s*n.endPosition.x-1,d.y=2/a*(a-n.endPosition.y)-1,d=k.normalize(d,d);let u=W.acosClamped(c.x);c.y<0&&(u=W.TWO_PI-u);let m=W.acosClamped(d.x);d.y<0&&(m=W.TWO_PI-m);let p=m-u;o.twistRight(p)}function XAt(e,t,n){let i=e._rotateFactor*e._rotateRateRangeAdjustment;i>e._maximumRotateRate&&(i=e._maximumRotateRate),i<e._minimumRotateRate&&(i=e._minimumRotateRate);let o=e._scene,r=o.camera,s=o.canvas,a=(n.endPosition.x-n.startPosition.x)/s.clientWidth;a=Math.min(a,e.maximumMovementRatio);let c=i*a*Math.PI*4;r.twistRight(c)}function NAt(e){let t=e._scene.mapMode2D===md.ROTATE;P.equals(P.IDENTITY,e._scene.camera.transform)?(fd(e,e.enableTranslate,e.translateEventTypes,FAt,e.inertiaTranslate,"_lastInertiaTranslateMovement"),fd(e,e.enableZoom,e.zoomEventTypes,EGe,e.inertiaZoom,"_lastInertiaZoomMovement"),t&&fd(e,e.enableRotate,e.tiltEventTypes,AGe,e.inertiaSpin,"_lastInertiaTiltMovement")):(fd(e,e.enableZoom,e.zoomEventTypes,EGe,e.inertiaZoom,"_lastInertiaZoomMovement"),t&&fd(e,e.enableRotate,e.translateEventTypes,AGe,e.inertiaSpin,"_lastInertiaSpinMovement"))}var NGe=new gn,YAt=new h,MAt=new h;function kg(e,t,n){let i=e._scene,o=e._globe,r=i.camera,s;if(i.pickPositionSupported&&(s=i.pickPositionWorldCoordinates(t,YAt)),!l(o))return h.clone(s,n);let a=!e._cameraUnderground,c=r.getPickRay(t,NGe),d=o.pickWorldCoordinates(c,i,a,MAt),u=l(s)?h.distance(s,r.positionWC):Number.POSITIVE_INFINITY,m=l(d)?h.distance(d,r.positionWC):Number.POSITIVE_INFINITY;return u<m?h.clone(s,n):h.clone(d,n)}var wAt=new pe;function Yz(e){let t=e._ellipsoid,n=e._scene,i=n.camera,o=n.mode,r=0;if(o===se.SCENE3D){let c=t.cartesianToCartographic(i.position,wAt);l(c)&&(r=c.height)}else r=i.position.z;let s=e._scene.globeHeight??0;return Math.abs(s-r)}var kAt=new h;function YGe(e,t){let n=t.origin,i=t.direction,o=Yz(e),r=h.normalize(n,kAt),s=Math.abs(h.dot(r,i));return s=Math.max(s,.5)*2,o*s}function MGe(e,t,n,i){let o=h.distance(t.origin,n),r=Yz(e),s=W.clamp(r*5,e._minimumUndergroundPickDistance,e._maximumUndergroundPickDistance);return o>s&&(o=Math.min(o,r/5),o=Math.max(o,100)),gn.getPoint(t,o,i)}function wGe(e,t,n,i){let o;return l(n)?(o=h.distance(t.origin,n),o>e._maximumUndergroundPickDistance&&(o=Yz(e))):o=Yz(e),gn.getPoint(t,o,i)}var UAt=new k;function kGe(e,t){let n=t.endPosition,i=k.subtract(t.endPosition,t.startPosition,UAt),o=e._strafeEndMousePosition;k.add(o,i,o),t.endPosition=o,Vne(e,t,e._strafeStartPosition),t.endPosition=n}var GGe=new gn,DAt=new gn,yne=new h,OAt=new h,BAt=new h,zAt=new h,HAt=new cn(h.UNIT_X,0),KAt=new k,JAt=new k;function jAt(e,t,n){if(h.equals(t,e._translateMousePosition)||(e._looking=!1),h.equals(t,e._strafeMousePosition)||(e._strafing=!1),e._looking){nm(e,t,n);return}if(e._strafing){kGe(e,n);return}let o=e._scene.camera,r=e._cameraUnderground,s=k.clone(n.startPosition,KAt),a=k.clone(n.endPosition,JAt),c=o.getPickRay(s,GGe),d=h.clone(h.ZERO,zAt),u=h.UNIT_X,m;if(o.position.z<e._minimumPickingTerrainHeight&&(m=kg(e,s,yne),l(m)&&(d.x=m.x)),r||d.x>o.position.z&&l(m)){let R=m;r&&(R=wGe(e,c,m,yne)),k.clone(t,e._strafeMousePosition),k.clone(t,e._strafeEndMousePosition),h.clone(R,e._strafeStartPosition),e._strafing=!0,Vne(e,n,e._strafeStartPosition);return}let p=cn.fromPointNormal(d,u,HAt);c=o.getPickRay(s,GGe);let b=xi.rayPlane(c,p,yne),f=o.getPickRay(a,DAt),y=xi.rayPlane(f,p,OAt);if(!l(b)||!l(y)){e._looking=!0,nm(e,t,n),k.clone(t,e._translateMousePosition);return}let _=h.subtract(b,y,BAt),S=_.x;_.x=_.y,_.y=_.z,_.z=S;let Z=h.magnitude(_);Z>W.EPSILON6&&(h.normalize(_,_),o.move(_,Z))}var UGe=new k,Iz=new gn,Pz=new h,QAt=new h,DGe=new P,qAt=new P,$At=new h,eGt=new cn(h.UNIT_X,0),xne=new h,Sne=new pe,OGe=new P,tGt=new Ne,nGt=new q,Xz=new h;function iGt(e,t,n){if(l(n.angleAndHeight)&&(n=n.angleAndHeight),k.equals(t,e._tiltCenterMousePosition)||(e._tiltCVOffMap=!1,e._looking=!1),e._looking){nm(e,t,n);return}let o=e._scene.camera;e._tiltCVOffMap||!e.onMap()||Math.abs(o.position.z)>e._minimumPickingTerrainHeight?(e._tiltCVOffMap=!0,oGt(e,t,n)):rGt(e,t,n)}function oGt(e,t,n){let i=e._scene,o=i.camera,r=i.canvas,s=UGe;s.x=r.clientWidth/2,s.y=r.clientHeight/2;let a=o.getPickRay(s,Iz),c=h.UNIT_X,d=a.origin,u=a.direction,m,p=h.dot(c,u);if(Math.abs(p)>W.EPSILON6&&(m=-h.dot(c,d)/p),!l(m)||m<=0){e._looking=!0,nm(e,t,n),k.clone(t,e._tiltCenterMousePosition);return}let b=h.multiplyByScalar(u,m,Pz);h.add(d,b,b);let f=i.mapProjection,y=f.ellipsoid;h.fromElements(b.y,b.z,b.x,b);let _=f.unproject(b,Sne);y.cartographicToCartesian(_,b);let S=_t.eastNorthUpToFixedFrame(b,y,DGe),Z=e._globe,R=e._ellipsoid;e._globe=void 0,e._ellipsoid=ne.UNIT_SPHERE,e._rotateFactor=1,e._rotateRateRangeAdjustment=1;let C=P.clone(o.transform,OGe);o._setTransform(S),tm(e,t,n,h.UNIT_Z),o._setTransform(C),e._globe=Z,e._ellipsoid=R;let E=R.maximumRadius;e._rotateFactor=1/E,e._rotateRateRangeAdjustment=E}function rGt(e,t,n){let i=e._scene,o=i.camera,r=e._cameraUnderground,s,a,c=h.UNIT_X;if(k.equals(t,e._tiltCenterMousePosition))s=h.clone(e._tiltCenter,Pz);else{if(o.position.z<e._minimumPickingTerrainHeight&&(s=kg(e,t,Pz)),!l(s)){a=o.getPickRay(t,Iz);let g=a.origin,V=a.direction,G,v=h.dot(c,V);if(Math.abs(v)>W.EPSILON6&&(G=-h.dot(c,g)/v),!l(G)||G<=0){e._looking=!0,nm(e,t,n),k.clone(t,e._tiltCenterMousePosition);return}s=h.multiplyByScalar(V,G,Pz),h.add(g,s,s)}r&&(l(a)||(a=o.getPickRay(t,Iz)),MGe(e,a,s,s)),k.clone(t,e._tiltCenterMousePosition),h.clone(s,e._tiltCenter)}let d=i.canvas,u=UGe;u.x=d.clientWidth/2,u.y=e._tiltCenterMousePosition.y,a=o.getPickRay(u,Iz);let m=h.clone(h.ZERO,$At);m.x=s.x;let p=cn.fromPointNormal(m,c,eGt),b=xi.rayPlane(a,p,QAt),f=o._projection,y=f.ellipsoid;h.fromElements(s.y,s.z,s.x,s);let _=f.unproject(s,Sne);y.cartographicToCartesian(_,s);let S=_t.eastNorthUpToFixedFrame(s,y,DGe),Z;l(b)?(h.fromElements(b.y,b.z,b.x,b),_=f.unproject(b,Sne),y.cartographicToCartesian(_,b),Z=_t.eastNorthUpToFixedFrame(b,y,qAt)):Z=S;let R=e._globe,C=e._ellipsoid;e._globe=void 0,e._ellipsoid=ne.UNIT_SPHERE,e._rotateFactor=1,e._rotateRateRangeAdjustment=1;let E=h.UNIT_Z,A=P.clone(o.transform,OGe);o._setTransform(S);let L=h.cross(h.UNIT_Z,h.normalize(o.position,xne),xne),F=h.dot(o.right,L);if(tm(e,t,n,E,!1,!0),o._setTransform(Z),F<0){let g=n.startPosition.y-n.endPosition.y;(r&&g<0||!r&&g>0)&&(E=void 0);let V=o.constrainedAxis;o.constrainedAxis=void 0,tm(e,t,n,E,!0,!1),o.constrainedAxis=V}else tm(e,t,n,E,!0,!1);if(l(o.constrainedAxis)){let g=h.cross(o.direction,o.constrainedAxis,Xz);h.equalsEpsilon(g,h.ZERO,W.EPSILON6)||(h.dot(g,o.right)<0&&h.negate(g,g),h.cross(g,o.direction,o.up),h.cross(o.direction,o.up,o.right),h.normalize(o.up,o.up),h.normalize(o.right,o.right))}o._setTransform(A),e._globe=R,e._ellipsoid=C;let I=C.maximumRadius;e._rotateFactor=1/I,e._rotateRateRangeAdjustment=I;let N=h.clone(o.positionWC,xne);if(e.enableCollisionDetection&&Gne(e,!0),!h.equals(o.positionWC,N)){o._setTransform(Z),o.worldToCameraCoordinatesPoint(N,N);let g=h.magnitudeSquared(N);h.magnitudeSquared(o.position)>g&&(h.normalize(o.position,o.position),h.multiplyByScalar(o.position,Math.sqrt(g),o.position));let V=h.angleBetween(N,o.position),G=h.cross(N,o.position,N);h.normalize(G,G);let v=Ne.fromAxisAngle(G,V,tGt),X=q.fromQuaternion(v,nGt);q.multiplyByVector(X,o.direction,o.direction),q.multiplyByVector(X,o.up,o.up),h.cross(o.direction,o.up,o.right),h.cross(o.right,o.direction,o.up),o._setTransform(A)}}var BGe=new k,zGe=new gn,HGe=new h;function sGt(e,t,n){l(n.distance)&&(n=n.distance);let i=e._scene,o=i.camera,r=i.canvas,s=e._cameraUnderground,a;s?a=t:(a=BGe,a.x=r.clientWidth/2,a.y=r.clientHeight/2);let c=o.getPickRay(a,zGe),d=c.origin,u=c.direction,m=o.position.z,p;m<e._minimumPickingTerrainHeight&&(p=kg(e,a,HGe));let b;if(l(p)&&(b=h.distance(d,p)),s){let f=YGe(e,c,m);l(b)?b=Math.min(b,f):b=f}if(!l(b)){let f=h.UNIT_X;b=-h.dot(f,d)/h.dot(f,u)}Cne(e,t,n,e.zoomFactor,b)}function aGt(e){let n=e._scene.camera;if(!P.equals(P.IDENTITY,n.transform))fd(e,e.enableRotate,e.rotateEventTypes,tm,e.inertiaSpin,"_lastInertiaSpinMovement"),fd(e,e.enableZoom,e.zoomEventTypes,JGe,e.inertiaZoom,"_lastInertiaZoomMovement");else{let i=e._tweens;if(e._aggregator.anyButtonDown&&i.removeAll(),fd(e,e.enableTilt,e.tiltEventTypes,iGt,e.inertiaSpin,"_lastInertiaTiltMovement"),fd(e,e.enableTranslate,e.translateEventTypes,jAt,e.inertiaTranslate,"_lastInertiaTranslateMovement"),fd(e,e.enableZoom,e.zoomEventTypes,sGt,e.inertiaZoom,"_lastInertiaZoomMovement"),fd(e,e.enableLook,e.lookEventTypes,nm),!e._aggregator.anyButtonDown&&!i.contains(e._tween)){let o=n.createCorrectPositionTween(e.bounceAnimationTime);l(o)&&(e._tween=i.add(o))}i.update()}}var cGt=new gn,lGt=new cn(h.UNIT_X,0),dGt=new h,uGt=new h;function Vne(e,t,n){let i=e._scene,o=i.camera,r=o.getPickRay(t.endPosition,cGt),s=h.clone(o.direction,uGt);i.mode===se.COLUMBUS_VIEW&&h.fromElements(s.z,s.x,s.y,s);let a=cn.fromPointNormal(n,s,lGt),c=xi.rayPlane(r,a,dGt);l(c)&&(s=h.subtract(n,c,s),i.mode===se.COLUMBUS_VIEW&&h.fromElements(s.y,s.z,s.x,s),h.add(o.position,s,o.position))}var LGe=new h,KGe=new pe,Zne=new h,Rne=new ne,mGt=new h,hGt=new h,fGt=new h;function pGt(e,t,n){let o=e._scene.camera,r=e._cameraUnderground,s=e._ellipsoid;if(!P.equals(o.transform,P.IDENTITY)){tm(e,t,n);return}let a,c,d=s.geodeticSurfaceNormal(o.position,mGt);if(k.equals(t,e._rotateMousePosition)){if(e._looking)nm(e,t,n,d);else if(e._rotating)tm(e,t,n);else if(e._strafing)kGe(e,n);else{if(h.magnitude(o.position)<h.magnitude(e._rotateStartPosition))return;a=h.magnitude(e._rotateStartPosition),c=Zne,c.x=c.y=c.z=a,s=ne.fromCartesian3(c,Rne),_ne(e,t,n,s)}return}e._looking=!1,e._rotating=!1,e._strafing=!1;let u=s.cartesianToCartographic(o.positionWC,KGe).height,m=e._globe;if(l(m)&&u<e._minimumPickingTerrainHeight){let p=kg(e,n.startPosition,fGt);if(l(p)){let b,f=o.getPickRay(n.startPosition,NGe);if(r)b=!0,wGe(e,f,p,p);else{let y=s.geodeticSurfaceNormal(p,hGt);Math.abs(h.dot(f.direction,y))<.05?b=!0:b=h.magnitude(o.position)<h.magnitude(p)}b?(k.clone(t,e._strafeEndMousePosition),h.clone(p,e._strafeStartPosition),e._strafing=!0,Vne(e,n,e._strafeStartPosition)):(a=h.magnitude(p),c=Zne,c.x=c.y=c.z=a,s=ne.fromCartesian3(c,Rne),_ne(e,t,n,s),h.clone(p,e._rotateStartPosition))}else e._looking=!0,nm(e,t,n,d)}else l(o.pickEllipsoid(n.startPosition,e._ellipsoid,LGe))?(_ne(e,t,n,e._ellipsoid),h.clone(LGe,e._rotateStartPosition)):u>e._minimumTrackBallHeight?(e._rotating=!0,tm(e,t,n)):(e._looking=!0,nm(e,t,n,d));k.clone(t,e._rotateMousePosition)}function tm(e,t,n,i,o,r){o=o??!1,r=r??!1;let s=e._scene,a=s.camera,c=s.canvas,d=a.constrainedAxis;l(i)&&(a.constrainedAxis=i);let u=h.magnitude(a.position),m=e._rotateFactor*(u-e._rotateRateRangeAdjustment);m>e._maximumRotateRate&&(m=e._maximumRotateRate),m<e._minimumRotateRate&&(m=e._minimumRotateRate);let p=(n.startPosition.x-n.endPosition.x)/c.clientWidth,b=(n.startPosition.y-n.endPosition.y)/c.clientHeight;p=Math.min(p,e.maximumMovementRatio),b=Math.min(b,e.maximumMovementRatio);let f=m*p*Math.PI*2,y=m*b*Math.PI;if(l(i)&&l(e.maximumTiltAngle)){let _=e.maximumTiltAngle,S=h.dot(a.direction,i),Z=Math.PI-Math.acos(S)+y;Z>_&&(y-=Z-_)}o||a.rotateRight(f),r||a.rotateUp(y),a.constrainedAxis=d}var Tne=ce.clone(ce.UNIT_W),WGe=ce.clone(ce.UNIT_W),vz=new h,dE=new h,Fz=new h,vGe=new h,bGt=new k,gGt=new k,yGt=new k,xGt=new k,TGt=new gn;function _ne(e,t,n,i){let o=e._scene,r=o.camera,s=k.clone(n.startPosition,bGt),a=k.clone(n.endPosition,gGt),c=i.cartesianToCartographic(r.positionWC,KGe).height,d,u;if(!n.inertiaEnabled&&c<e._minimumPickingTerrainHeight&&(d=h.clone(e._panLastWorldPosition,Tne),!l(e._globe)&&!k.equalsEpsilon(s,e._panLastMousePosition)&&(d=kg(e,s,Tne)),!l(e._globe)&&l(d))){let m=h.subtract(d,r.positionWC,dE),p=h.multiplyByScalar(r.directionWC,h.dot(r.directionWC,m),dE),b=h.magnitude(p),f=r.frustum.getPixelDimensions(o.drawingBufferWidth,o.drawingBufferHeight,b,o.pixelRatio,xGt),y=k.subtract(a,s,yGt),_=h.multiplyByScalar(r.rightWC,y.x*f.x,dE),S=h.normalize(r.positionWC,XGe),Z=r.getPickRay(a,TGt).direction,R=h.subtract(Z,h.projectVector(Z,r.rightWC,Fz),Fz),C=h.angleBetween(R,r.directionWC),E=1;l(r.frustum.fov)&&(E=Math.max(Math.tan(C),.1));let A=Math.abs(h.dot(r.directionWC,S)),L=-y.y*f.y*2/Math.sqrt(E)*(1-A),F=h.multiplyByScalar(Z,L,Fz);A=Math.abs(h.dot(r.upWC,S));let I=h.multiplyByScalar(r.upWC,-y.y*(1-A)*f.y,vGe);u=h.add(d,_,WGe),u=h.add(u,F,u),u=h.add(u,I,u),h.clone(u,e._panLastWorldPosition),k.clone(a,e._panLastMousePosition)}if((!l(d)||!l(u))&&(d=r.pickEllipsoid(s,i,Tne),u=r.pickEllipsoid(a,i,WGe)),!l(d)||!l(u)){e._rotating=!0,tm(e,t,n);return}if(d=r.worldToCameraCoordinates(d,d),u=r.worldToCameraCoordinates(u,u),l(r.constrainedAxis)){let m=r.constrainedAxis,p=h.mostOrthogonalAxis(m,vz);h.cross(p,m,p),h.normalize(p,p);let b=h.cross(m,p,dE),f=h.magnitude(d),y=h.dot(m,d),_=Math.acos(y/f),S=h.multiplyByScalar(m,y,Fz);h.subtract(d,S,S),h.normalize(S,S);let Z=h.magnitude(u),R=h.dot(m,u),C=Math.acos(R/Z),E=h.multiplyByScalar(m,R,vGe);h.subtract(u,E,E),h.normalize(E,E);let A=Math.acos(h.dot(S,p));h.dot(S,b)<0&&(A=W.TWO_PI-A);let L=Math.acos(h.dot(E,p));h.dot(E,b)<0&&(L=W.TWO_PI-L);let F=A-L,I;h.equalsEpsilon(m,r.position,W.EPSILON2)?I=r.right:I=h.cross(m,r.position,vz);let N=h.cross(m,I,vz),g=h.dot(N,h.subtract(d,m,dE)),V=h.dot(N,h.subtract(u,m,dE)),G;g>0&&V>0?G=C-_:g>0&&V<=0?h.dot(r.position,m)>0?G=-_-C:G=_+C:G=_-C,r.rotateRight(F),r.rotateUp(G)}else{h.normalize(d,d),h.normalize(u,u);let m=h.dot(d,u),p=h.cross(d,u,vz);if(m<1&&!h.equalsEpsilon(p,h.ZERO,W.EPSILON14)){let b=Math.acos(m);r.rotate(p,b)}}}var _Gt=new h,SGt=new pe,FGe=0;function JGe(e,t,n){l(n.distance)&&(n=n.distance);let i=n.inertiaEnabled,o=e._ellipsoid,r=e._scene,s=r.camera,a=r.canvas,c=e._cameraUnderground,d;c?d=t:(d=BGe,d.x=a.clientWidth/2,d.y=a.clientHeight/2);let u=s.getPickRay(d,zGe),m,p=o.cartesianToCartographic(s.position,SGt).height,b=Math.abs(FGe)<e.minimumPickingTerrainDistanceWithInertia;(i?b:p<e._minimumPickingTerrainHeight)&&(m=kg(e,d,HGe));let y;if(l(m)&&(y=h.distance(u.origin,m)),!l(e._globe)&&l(y)&&s.getMagnitude()<y&&(y=void 0),l(y)&&(FGe=y),c){let S=YGe(e,u,p);l(y)?y=Math.min(y,S):y=S}l(y)||(y=p);let _=h.normalize(s.position,_Gt);Cne(e,t,n,e.zoomFactor,y,h.dot(_,s.direction))}var jGe=new k,Nz=new gn,t9=new h,ZGt=new h,QGe=new P,RGt=new P,qGe=new P,CGt=new Ne,VGt=new q,Ene=new pe,Ane=new h;function EGt(e,t,n){let o=e._scene.camera;if(!P.equals(o.transform,P.IDENTITY))return;if(l(n.angleAndHeight)&&(n=n.angleAndHeight),k.equals(t,e._tiltCenterMousePosition)||(e._tiltOnEllipsoid=!1,e._looking=!1),e._looking){let a=e._ellipsoid.geodeticSurfaceNormal(o.position,Ane);nm(e,t,n,a);return}let s=e._ellipsoid.cartesianToCartographic(o.position,Ene);e._tiltOnEllipsoid||s.height>e._minimumCollisionTerrainHeight?(e._tiltOnEllipsoid=!0,GGt(e,t,n)):LGt(e,t,n)}var AGt=new pe;function GGt(e,t,n){let i=e._ellipsoid,o=e._scene,r=o.camera,s=e.minimumZoomDistance*.25,a=i.cartesianToCartographic(r.positionWC,AGt).height;if(a-s-1<W.EPSILON3&&n.endPosition.y-n.startPosition.y<0)return;let c=o.canvas,d=jGe;d.x=c.clientWidth/2,d.y=c.clientHeight/2;let u=r.getPickRay(d,Nz),m,p=xi.rayEllipsoid(u,i);if(l(p))m=gn.getPoint(u,p.start,t9);else if(a>e._minimumTrackBallHeight){let Z=xi.grazingAltitudeLocation(u,i);if(!l(Z))return;let R=i.cartesianToCartographic(Z,Ene);R.height=0,m=i.cartographicToCartesian(R,t9)}else{e._looking=!0;let Z=e._ellipsoid.geodeticSurfaceNormal(r.position,Ane);nm(e,t,n,Z),k.clone(t,e._tiltCenterMousePosition);return}let b=_t.eastNorthUpToFixedFrame(m,i,QGe),f=e._globe,y=e._ellipsoid;e._globe=void 0,e._ellipsoid=ne.UNIT_SPHERE,e._rotateFactor=1,e._rotateRateRangeAdjustment=1;let _=P.clone(r.transform,qGe);r._setTransform(b),tm(e,t,n,h.UNIT_Z),r._setTransform(_),e._globe=f,e._ellipsoid=y;let S=y.maximumRadius;e._rotateFactor=1/S,e._rotateRateRangeAdjustment=S}function LGt(e,t,n){let i=e._ellipsoid,o=e._scene,r=o.camera,s=e._cameraUnderground,a,c,d;if(k.equals(t,e._tiltCenterMousePosition))a=h.clone(e._tiltCenter,t9);else{if(a=kg(e,t,t9),!l(a)){if(c=r.getPickRay(t,Nz),d=xi.rayEllipsoid(c,i),!l(d)){if(i.cartesianToCartographic(r.position,Ene).height<=e._minimumTrackBallHeight){e._looking=!0;let V=e._ellipsoid.geodeticSurfaceNormal(r.position,Ane);nm(e,t,n,V),k.clone(t,e._tiltCenterMousePosition)}return}a=gn.getPoint(c,d.start,t9)}s&&(l(c)||(c=r.getPickRay(t,Nz)),MGe(e,c,a,a)),k.clone(t,e._tiltCenterMousePosition),h.clone(a,e._tiltCenter)}let u=o.canvas,m=jGe;m.x=u.clientWidth/2,m.y=e._tiltCenterMousePosition.y,c=r.getPickRay(m,Nz);let p=h.magnitude(a),b=h.fromElements(p,p,p,Zne),f=ne.fromCartesian3(b,Rne);if(d=xi.rayEllipsoid(c,f),!l(d))return;let y=h.magnitude(c.origin)>p?d.start:d.stop,_=gn.getPoint(c,y,ZGt),S=_t.eastNorthUpToFixedFrame(a,i,QGe),Z=_t.eastNorthUpToFixedFrame(_,f,RGt),R=e._globe,C=e._ellipsoid;e._globe=void 0,e._ellipsoid=ne.UNIT_SPHERE,e._rotateFactor=1,e._rotateRateRangeAdjustment=1;let E=h.UNIT_Z,A=P.clone(r.transform,qGe);r._setTransform(Z);let L=h.cross(_,r.positionWC,Xz);if(h.dot(r.rightWC,L)<0){let g=n.startPosition.y-n.endPosition.y;(s&&g<0||!s&&g>0)&&(E=void 0);let V=r.constrainedAxis;r.constrainedAxis=void 0,tm(e,t,n,E,!0,!1),r.constrainedAxis=V}else tm(e,t,n,E,!0,!1);if(r._setTransform(S),tm(e,t,n,E,!1,!0),l(r.constrainedAxis)){let g=h.cross(r.direction,r.constrainedAxis,Xz);h.equalsEpsilon(g,h.ZERO,W.EPSILON6)||(h.dot(g,r.right)<0&&h.negate(g,g),h.cross(g,r.direction,r.up),h.cross(r.direction,r.up,r.right),h.normalize(r.up,r.up),h.normalize(r.right,r.right))}r._setTransform(A),e._globe=R,e._ellipsoid=C;let I=C.maximumRadius;e._rotateFactor=1/I,e._rotateRateRangeAdjustment=I;let N=h.clone(r.positionWC,Xz);if(e.enableCollisionDetection&&Gne(e,!0),!h.equals(r.positionWC,N)){r._setTransform(Z),r.worldToCameraCoordinatesPoint(N,N);let g=h.magnitudeSquared(N);h.magnitudeSquared(r.position)>g&&(h.normalize(r.position,r.position),h.multiplyByScalar(r.position,Math.sqrt(g),r.position));let V=h.angleBetween(N,r.position),G=h.cross(N,r.position,N);h.normalize(G,G);let v=Ne.fromAxisAngle(G,V,CGt),X=q.fromQuaternion(v,VGt);q.multiplyByVector(X,r.direction,r.direction),q.multiplyByVector(X,r.up,r.up),h.cross(r.direction,r.up,r.right),h.cross(r.right,r.direction,r.up),r._setTransform(A)}}var WGt=new k,vGt=new k,IGe=new gn,PGe=new gn,FGt=new h,IGt=new h;function nm(e,t,n,i){let r=e._scene.camera,s=WGt;s.x=n.startPosition.x,s.y=0;let a=vGt;a.x=n.endPosition.x,a.y=0;let c=r.getPickRay(s,IGe),d=r.getPickRay(a,PGe),u=0,m,p;r.frustum instanceof yn?(m=c.origin,p=d.origin,h.add(r.direction,m,m),h.add(r.direction,p,p),h.subtract(m,r.position,m),h.subtract(p,r.position,p),h.normalize(m,m),h.normalize(p,p)):(m=c.direction,p=d.direction);let b=h.dot(m,p);b<1&&(u=Math.acos(b)),u=n.startPosition.x>n.endPosition.x?-u:u;let f=e._horizontalRotationAxis;if(l(i)?r.look(i,-u):l(f)?r.look(f,-u):r.lookLeft(u),s.x=0,s.y=n.startPosition.y,a.x=0,a.y=n.endPosition.y,c=r.getPickRay(s,IGe),d=r.getPickRay(a,PGe),u=0,r.frustum instanceof yn?(m=c.origin,p=d.origin,h.add(r.direction,m,m),h.add(r.direction,p,p),h.subtract(m,r.position,m),h.subtract(p,r.position,p),h.normalize(m,m),h.normalize(p,p)):(m=c.direction,p=d.direction),b=h.dot(m,p),b<1&&(u=Math.acos(b)),u=n.startPosition.y>n.endPosition.y?-u:u,i=i??f,l(i)){let y=r.direction,_=h.negate(i,FGt),S=h.equalsEpsilon(y,i,W.EPSILON2),Z=h.equalsEpsilon(y,_,W.EPSILON2);if(!S&&!Z){b=h.dot(y,i);let R=W.acosClamped(b);u>0&&u>R&&(u=R-W.EPSILON4),b=h.dot(y,_),R=W.acosClamped(b),u<0&&-u>R&&(u=-R+W.EPSILON4);let C=h.cross(i,y,IGt);r.look(C,u)}else(S&&u<0||Z&&u>0)&&r.look(r.right,-u)}else r.lookUp(u)}function PGt(e){fd(e,e.enableRotate,e.rotateEventTypes,pGt,e.inertiaSpin,"_lastInertiaSpinMovement"),fd(e,e.enableZoom,e.zoomEventTypes,JGe,e.inertiaZoom,"_lastInertiaZoomMovement"),fd(e,e.enableTilt,e.tiltEventTypes,EGt,e.inertiaSpin,"_lastInertiaTiltMovement"),fd(e,e.enableLook,e.lookEventTypes,nm)}var XGt=new P,NGt=new pe;function Gne(e,t){e._adjustedHeightForTerrain=!0;let n=e._scene,i=n.mode;if(i===se.SCENE2D||i===se.MORPHING)return;let o=n.camera,r=n.ellipsoid??ne.WGS84,s=n.mapProjection,a,c;P.equals(o.transform,P.IDENTITY)||(a=P.clone(o.transform,XGt),c=h.magnitude(o.position),o._setTransform(P.IDENTITY));let d=NGt;i===se.SCENE3D?r.cartesianToCartographic(o.position,d):s.unproject(o.position,d);let u=!1;if(d.height<e._minimumCollisionTerrainHeight){let m=e._scene.globeHeight;if(l(m)){let p=m+e.minimumZoomDistance,b=m-e._lastGlobeHeight,f=b/e._lastGlobeHeight;d.height<p&&(t||Math.abs(f)<=.1)&&(d.height=p,i===se.SCENE3D?r.cartographicToCartesian(d,o.position):s.project(d,o.position),u=!0),t||Math.abs(f)<=.1?e._lastGlobeHeight=m:e._lastGlobeHeight+=b*.1}}l(a)&&(o._setTransform(a),u&&(h.normalize(o.position,o.position),h.negate(o.position,o.direction),h.multiplyByScalar(o.position,Math.max(c,e.minimumZoomDistance),o.position),h.normalize(o.direction,o.direction),h.cross(o.direction,o.up,o.right),h.cross(o.right,o.direction,o.up)))}n9.prototype.onMap=function(){let e=this._scene,t=e.mode,n=e.camera;return t===se.COLUMBUS_VIEW?Math.abs(n.position.x)-this._maxCoord.x<0&&Math.abs(n.position.y)-this._maxCoord.y<0:!0};var YGt=new h,MGt=new h;n9.prototype.update=function(){let e=this._scene,{camera:t,globe:n,mode:i}=e;P.equals(t.transform,P.IDENTITY)?(this._globe=n,this._ellipsoid=e.ellipsoid??ne.default):(this._globe=void 0,this._ellipsoid=ne.UNIT_SPHERE);let{verticalExaggeration:o,verticalExaggerationRelativeHeight:r}=e;this._minimumCollisionTerrainHeight=_o.getHeight(this.minimumCollisionTerrainHeight,o,r),this._minimumPickingTerrainHeight=_o.getHeight(this.minimumPickingTerrainHeight,o,r),this._minimumTrackBallHeight=_o.getHeight(this.minimumTrackBallHeight,o,r),this._cameraUnderground=e.cameraUnderground&&l(this._globe);let s=this._ellipsoid.maximumRadius;this._rotateFactor=1/s,this._rotateRateRangeAdjustment=s,this._adjustedHeightForTerrain=!1;let a=h.clone(t.positionWC,YGt),c=h.clone(t.directionWC,MGt);if(i===se.SCENE2D?NAt(this):i===se.COLUMBUS_VIEW?(this._horizontalRotationAxis=h.UNIT_Z,aGt(this)):i===se.SCENE3D&&(this._horizontalRotationAxis=void 0,PGt(this)),this.enableCollisionDetection&&!this._adjustedHeightForTerrain){let d=!h.equals(a,t.positionWC)||!h.equals(c,t.directionWC);Gne(this,d)}this._aggregator.reset()};n9.prototype.isDestroyed=function(){return!1};n9.prototype.destroy=function(){return this._tweens.removeAll(),this._aggregator=this._aggregator&&this._aggregator.destroy(),ue(this)};var i9=n9;var qro=x(T(),1);var Uro=x(T(),1);function o9(e){let t=new oc(e);t.blendingEnabled=!1,t.scissorTest={enabled:!0,rectangle:new nt},t.viewport=new nt,this._context=e,this._fb=new li({depthStencil:!0,pixelDatatype:Ue.FLOAT,pixelFormat:Qe.RGBA}),this._passState=t}function wGt(e,t,n,i){let o=Math.max(n,i),r=o*o,s=Math.floor(n*.5),a=Math.floor(i*.5),c=0,d=0,u=0,m=-1,p=[];for(let b=0;b<r;++b){if(-s<=c&&c<=s&&-a<=d&&d<=a){let f=4*((a-d)*n+c+s),y=t[f],_=e.getObjectByPickColor(y);l(_)&&p.push({object:_,isEdge:t[f+1]>0,depth:t[f+2],x:c,y:d})}if(c===d||c<0&&-c===d||c>0&&c===1-d){let f=u;u=-m,m=f}c+=u,d+=m}return p}o9.prototype.begin=function(e,t){let n=this._context,{width:i,height:o}=t;return nt.clone(e,this._passState.scissorTest.rectangle),this._fb.update(n,i,o),this._passState.framebuffer=this._fb.framebuffer,this._passState.viewport.width=i,this._passState.viewport.height=o,this._passState};o9.prototype.end=function(e){let t=e.width??1,n=e.height??1,i=this._context,o=i.readPixels({x:e.x,y:e.y,width:t,height:n,pixelDatatype:Ue.FLOAT,framebuffer:this._fb.framebuffer});return wGt(i,o,t,n)};o9.prototype.isDestroyed=function(){return!1};o9.prototype.destroy=function(){return this._fb.destroy(),ue(this)};var r9=o9;var s9={},kGt=new nt(0,0,3,3),UGt=new k,DGt=new k,OGt=new gn,BGt=new h,zGt=3,HGt=.1,$Ge=9;function Lne(e){return Math.sqrt(e.x*e.x+e.y*e.y)}function eLe(e){let t=Number.POSITIVE_INFINITY;for(let s of e)!s.isEdge&&Lne(s)<=zGt&&(t=Math.min(t,s.depth));let n=t*(1+HGt),i=e.filter(s=>!s.isEdge||s.depth<=n),o=i.some(s=>s.isEdge);return i.filter(s=>s.isEdge===o).reduce((s,a)=>Lne(a)<Lne(s)?a:s)}function tLe(e,t){let n,i=Number.POSITIVE_INFINITY;for(let o of e){if(o.isEdge||o.object!==t)continue;let r=o.x*o.x+o.y*o.y;r<i&&(n=o,i=r)}return n}function Wne(e,t,n){let i=UGt;i.x=t.x+n.x,i.y=t.y+n.y;let o=e.camera.getPickRay(i,OGt);if(!l(o))return;let r=h.dot(o.direction,e.camera.directionWC);if(r<=0)return;let s=n.depth/r,a=h.multiplyByScalar(o.direction,s,BGt);return h.add(o.origin,a,new h)}s9.snap=function(e,t,n){let i=n?.width??25,o=n?.height??i,{context:r,defaultView:s}=e;if(!r.colorBufferFloat){xt("snap-color-buffer-float","Scene.snap requires the EXT_color_buffer_float extension, which is not supported on this platform.");return}l(s.snapFramebuffer)||(s.snapFramebuffer=new r9(r));let a=s.snapFramebuffer,c=kGt;Vw(e,t,c,i,o,{framebuffer:a,snap:!0});let d=a.end(c);if(Ew(e),d.length===0)return;let u=eLe(d);if(!l(u))return;let m=Wne(e,t,u);if(!l(m))return;let p=m;if(u.isEdge){let b=DGt;b.x=t.x+u.x,b.y=t.y+u.y,Vw(e,b,c,$Ge,$Ge,{framebuffer:a,snap:!0});let f=a.end(c);Ew(e);let y=tLe(f,u.object);p=l(y)?Wne(e,b,y):void 0}return{object:u.object,isEdge:u.isEdge,position:m,surfacePosition:p,screenPosition:new k(t.x+u.x,t.y+u.y)}};s9._selectBestHit=eLe;s9._nearestSurfaceHit=tLe;s9._snapHitToWorld=Wne;var a9=s9;var _so=x(T(),1);var eso=x(T(),1),c9=`uniform sampler2D colorTexture; uniform sampler2D colorTexture2; uniform vec2 center; uniform float radius; @@ -11236,7 +11236,7 @@ float x = length(gl_FragCoord.xy - center) / radius; float t = smoothstep(0.5, 0.8, x); out_FragColor = mix(color0 + color1, color1, t); } -`;var Jxo=x(T(),1),xk=`uniform sampler2D colorTexture; +`;var nso=x(T(),1),l9=`uniform sampler2D colorTexture; uniform float avgLuminance; uniform float threshold; uniform float offset; @@ -11257,7 +11257,7 @@ float brightness = brightLum / (offset + brightLum); xyz.r = brightness; out_FragColor = vec4(czm_XYZToRGB(xyz), 1.0); } -`;function sy(){this._sceneFramebuffer=new iR;let e=.125,t=new Array(6);t[0]=new Uo({fragmentShader:au,textureScale:e,forcePowerOfTwo:!0,sampleMode:sm.LINEAR});let n=t[1]=new Uo({fragmentShader:xk,uniforms:{avgLuminance:.5,threshold:.25,offset:.1},textureScale:e,forcePowerOfTwo:!0}),i=this;this._delta=1,this._sigma=2,this._blurStep=new k,t[2]=new Uo({fragmentShader:GT,uniforms:{step:function(){return i._blurStep.x=i._blurStep.y=1/n.outputTexture.width,i._blurStep},delta:function(){return i._delta},sigma:function(){return i._sigma},direction:0},textureScale:e,forcePowerOfTwo:!0}),t[3]=new Uo({fragmentShader:GT,uniforms:{step:function(){return i._blurStep.x=i._blurStep.y=1/n.outputTexture.width,i._blurStep},delta:function(){return i._delta},sigma:function(){return i._sigma},direction:1},textureScale:e,forcePowerOfTwo:!0}),t[4]=new Uo({fragmentShader:au,sampleMode:sm.LINEAR}),this._uCenter=new k,this._uRadius=void 0,t[5]=new Uo({fragmentShader:yk,uniforms:{center:function(){return i._uCenter},radius:function(){return i._uRadius},colorTexture2:function(){return i._sceneFramebuffer.framebuffer.getColorTexture(0)}}}),this._stages=new cu({stages:t});let o=new cR(this),r=t.length;for(let s=0;s<r;++s)t[s]._textureCache=o;this._textureCache=o,this.length=t.length}sy.prototype.get=function(e){return this._stages.get(e)};sy.prototype.getStageByName=function(e){let t=this._stages.length;for(let n=0;n<t;++n){let i=this._stages.get(n);if(i.name===e)return i}};var AXt=new ce,JIe=new k,GXt=new k,jIe=new P;function LXt(e,t,n){let i=t.uniformState,o=i.sunPositionWC,r=i.view,s=i.viewProjection,a=i.projection,c=P.computeViewportTransformation(n,0,1,jIe),d=P.multiplyByPoint(r,o,AXt),u=_t.pointToGLWindowCoordinates(s,c,o,JIe);d.x+=W.SOLAR_RADIUS;let m=_t.pointToGLWindowCoordinates(a,c,d,d),p=k.magnitude(k.subtract(m,u,m))*30*2,b=GXt;b.x=p,b.y=p,e._uCenter=k.clone(u,e._uCenter),e._uRadius=Math.max(b.x,b.y)*.15;let f=t.drawingBufferWidth,y=t.drawingBufferHeight,_=e._stages,S=_.get(0),Z=S.outputTexture.width,R=S.outputTexture.height,C=new nt;C.width=Z,C.height=R,c=P.computeViewportTransformation(C,0,1,jIe),u=_t.pointToGLWindowCoordinates(s,c,o,JIe),b.x*=Z/f,b.y*=R/y;let E=S.scissorRectangle;E.x=Math.max(u.x-b.x*.5,0),E.y=Math.max(u.y-b.y*.5,0),E.width=Math.min(b.x,f),E.height=Math.min(b.y,y);for(let A=1;A<4;++A)nt.clone(E,_.get(A).scissorRectangle)}sy.prototype.clear=function(e,t,n){this._sceneFramebuffer.clear(e,t,n),this._textureCache.clear(e)};sy.prototype.update=function(e){let t=e.context,n=e.viewport,i=this._sceneFramebuffer;i.update(t,n);let o=i.framebuffer;return this._textureCache.update(t),this._stages.update(t,!1),LXt(this,t,n),o};sy.prototype.execute=function(e){let t=this._sceneFramebuffer.framebuffer.getColorTexture(0),n=this._stages,i=n.length;n.get(0).execute(e,t);for(let o=1;o<i;++o)n.get(o).execute(e,n.get(o-1).outputTexture)};sy.prototype.copy=function(e,t){if(!l(this._copyColorCommand)){let n=this;this._copyColorCommand=e.createViewportQuadCommand(au,{uniformMap:{colorTexture:function(){return n._stages.get(n._stages.length-1).outputTexture}},owner:this})}this._copyColorCommand.framebuffer=t,this._copyColorCommand.execute(e)};sy.prototype.isDestroyed=function(){return!1};sy.prototype.destroy=function(){return this._textureCache.destroy(),this._stages.destroy(),ue(this)};var Tk=sy;var _To=x(T(),1);function QIe(){this._cachedShowFrustumsShaders={}}function WXt(e){let t={},n=e.vertexAttributes;for(let i in n)n.hasOwnProperty(i)&&(t[i]=n[i].index);return t}function vXt(e,t){let n=e.context,i=t,o=i.fragmentShaderSource.clone(),r=[];o.sources=o.sources.map(function(u){u=Je.replaceMain(u,"czm_Debug_main");let m=/out_FragData_(\d+)/g,p;for(;(p=m.exec(u))!==null;)r.indexOf(p[1])===-1&&r.push(p[1]);return u});let s=r.length,a="";a+=`uniform vec3 debugShowCommandsColor; +`;function Ug(){this._sceneFramebuffer=new LZ;let e=.125,t=new Array(6);t[0]=new Uo({fragmentShader:tu,textureScale:e,forcePowerOfTwo:!0,sampleMode:qu.LINEAR});let n=t[1]=new Uo({fragmentShader:l9,uniforms:{avgLuminance:.5,threshold:.25,offset:.1},textureScale:e,forcePowerOfTwo:!0}),i=this;this._delta=1,this._sigma=2,this._blurStep=new k,t[2]=new Uo({fragmentShader:cT,uniforms:{step:function(){return i._blurStep.x=i._blurStep.y=1/n.outputTexture.width,i._blurStep},delta:function(){return i._delta},sigma:function(){return i._sigma},direction:0},textureScale:e,forcePowerOfTwo:!0}),t[3]=new Uo({fragmentShader:cT,uniforms:{step:function(){return i._blurStep.x=i._blurStep.y=1/n.outputTexture.width,i._blurStep},delta:function(){return i._delta},sigma:function(){return i._sigma},direction:1},textureScale:e,forcePowerOfTwo:!0}),t[4]=new Uo({fragmentShader:tu,sampleMode:qu.LINEAR}),this._uCenter=new k,this._uRadius=void 0,t[5]=new Uo({fragmentShader:c9,uniforms:{center:function(){return i._uCenter},radius:function(){return i._uRadius},colorTexture2:function(){return i._sceneFramebuffer.framebuffer.getColorTexture(0)}}}),this._stages=new nu({stages:t});let o=new PZ(this),r=t.length;for(let s=0;s<r;++s)t[s]._textureCache=o;this._textureCache=o,this.length=t.length}Ug.prototype.get=function(e){return this._stages.get(e)};Ug.prototype.getStageByName=function(e){let t=this._stages.length;for(let n=0;n<t;++n){let i=this._stages.get(n);if(i.name===e)return i}};var KGt=new ce,nLe=new k,JGt=new k,iLe=new P;function jGt(e,t,n){let i=t.uniformState,o=i.sunPositionWC,r=i.view,s=i.viewProjection,a=i.projection,c=P.computeViewportTransformation(n,0,1,iLe),d=P.multiplyByPoint(r,o,KGt),u=_t.pointToGLWindowCoordinates(s,c,o,nLe);d.x+=W.SOLAR_RADIUS;let m=_t.pointToGLWindowCoordinates(a,c,d,d),p=k.magnitude(k.subtract(m,u,m))*30*2,b=JGt;b.x=p,b.y=p,e._uCenter=k.clone(u,e._uCenter),e._uRadius=Math.max(b.x,b.y)*.15;let f=t.drawingBufferWidth,y=t.drawingBufferHeight,_=e._stages,S=_.get(0),Z=S.outputTexture.width,R=S.outputTexture.height,C=new nt;C.width=Z,C.height=R,c=P.computeViewportTransformation(C,0,1,iLe),u=_t.pointToGLWindowCoordinates(s,c,o,nLe),b.x*=Z/f,b.y*=R/y;let E=S.scissorRectangle;E.x=Math.max(u.x-b.x*.5,0),E.y=Math.max(u.y-b.y*.5,0),E.width=Math.min(b.x,f),E.height=Math.min(b.y,y);for(let A=1;A<4;++A)nt.clone(E,_.get(A).scissorRectangle)}Ug.prototype.clear=function(e,t,n){this._sceneFramebuffer.clear(e,t,n),this._textureCache.clear(e)};Ug.prototype.update=function(e){let t=e.context,n=e.viewport,i=this._sceneFramebuffer;i.update(t,n);let o=i.framebuffer;return this._textureCache.update(t),this._stages.update(t,!1),jGt(this,t,n),o};Ug.prototype.execute=function(e){let t=this._sceneFramebuffer.framebuffer.getColorTexture(0),n=this._stages,i=n.length;n.get(0).execute(e,t);for(let o=1;o<i;++o)n.get(o).execute(e,n.get(o-1).outputTexture)};Ug.prototype.copy=function(e,t){if(!l(this._copyColorCommand)){let n=this;this._copyColorCommand=e.createViewportQuadCommand(tu,{uniformMap:{colorTexture:function(){return n._stages.get(n._stages.length-1).outputTexture}},owner:this})}this._copyColorCommand.framebuffer=t,this._copyColorCommand.execute(e)};Ug.prototype.isDestroyed=function(){return!1};Ug.prototype.destroy=function(){return this._textureCache.destroy(),this._stages.destroy(),ue(this)};var d9=Ug;var Aso=x(T(),1);function oLe(){this._cachedShowFrustumsShaders={}}function QGt(e){let t={},n=e.vertexAttributes;for(let i in n)n.hasOwnProperty(i)&&(t[i]=n[i].index);return t}function qGt(e,t){let n=e.context,i=t,o=i.fragmentShaderSource.clone(),r=[];o.sources=o.sources.map(function(u){u=Je.replaceMain(u,"czm_Debug_main");let m=/out_FragData_(\d+)/g,p;for(;(p=m.exec(u))!==null;)r.indexOf(p[1])===-1&&r.push(p[1]);return u});let s=r.length,a="";a+=`uniform vec3 debugShowCommandsColor; `,a+=`uniform vec3 debugShowFrustumsColor; `,a+=`void main() { @@ -11266,11 +11266,11 @@ out_FragColor = vec4(czm_XYZToRGB(xyz), 1.0); `,a+=` out_FragData_${r[c]}.rgb *= debugShowFrustumsColor; `;else a+=` out_FragColor.rgb *= debugShowCommandsColor; `,a+=` out_FragColor.rgb *= debugShowFrustumsColor; -`;a+="}",o.sources.push(a);let d=WXt(i);return tn.fromCache({context:n,vertexShaderSource:i.vertexShaderSource,fragmentShaderSource:o,attributeLocations:d})}var _k=new U;function FXt(e,t){let n;return l(t.uniformMap)?n=t.uniformMap:n={},l(n.debugShowCommandsColor)||l(n.debugShowFrustumsColor)||(n.debugShowCommandsColor=function(){return e.debugShowCommands?(l(t._debugColor)||(t._debugColor=U.fromRandom()),t._debugColor):U.WHITE},n.debugShowFrustumsColor=function(){return e.debugShowFrustums?(_k.red=t.debugOverlappingFrustums&1?1:0,_k.green=t.debugOverlappingFrustums&2?1:0,_k.blue=t.debugOverlappingFrustums&4?1:0,_k.alpha=1,_k):U.WHITE}),n}var IXt=new lt;QIe.prototype.executeDebugShowFrustumsCommand=function(e,t,n){let i=t.shaderProgram.id,o=this._cachedShowFrustumsShaders[i];l(o)||(o=vXt(e,t.shaderProgram),this._cachedShowFrustumsShaders[i]=o);let r=lt.shallowClone(t,IXt);r.shaderProgram=o,r.uniformMap=FXt(e,t),r.execute(e.context,n)};var Sk=QIe;var ETo=x(T(),1);function fR(e,t,n){this._primitive=e,this._tileIndex=t,this._sampleIndex=n,this._metadata={},this._orientedBoundingBox=new nn}fR.fromKeyframeNode=function(e,t,n,i){let o=new fR(e,t,n),{spatialNode:r,content:s}=i;return o._metadata=PXt(e,s,n),o._orientedBoundingBox=NXt(e,r,n,o._orientedBoundingBox),o};function PXt(e,t,n){if(!l(t)||!l(t.metadata))return;let{names:i,types:o}=e.provider,{metadata:r}=t,s={};for(let a=0;a<i.length;a++){let c=i[a],d=St.getComponentCount(o[a]),u=r[a].slice(n*d,(n+1)*d);s[c]=u}return s}var qIe=new h,XXt=new h;function NXt(e,t,n,i){let o=t.dimensions,r=o.x*o.y,s=Math.floor(n/r),a=n-s*r,c=Math.floor(a/o.x),d=a-c*o.x,u=h.fromElements(d,c,s,qIe),m=h.divideComponents(h.subtract(u,e._paddingBefore,qIe),e.dimensions,XXt);return e._shape.computeOrientedBoundingBoxForSample(t,e.dimensions,m,i)}Object.defineProperties(fR.prototype,{metadata:{get:function(){return this._metadata}},primitive:{get:function(){return this._primitive}},sampleIndex:{get:function(){return this._sampleIndex}},tileIndex:{get:function(){return this._tileIndex}},orientedBoundingBox:{get:function(){return this._orientedBoundingBox.clone()}}});fR.prototype.hasProperty=function(e){return l(this._metadata[e])};fR.prototype.getNames=function(){return Object.keys(this._metadata)};fR.prototype.getProperty=function(e){return this._metadata[e]};var Zk=fR;var G1o=x(T(),1);var y_o=x(T(),1);var GTo=x(T(),1);function YXt(e,t){let n=document.createElement("canvas");n.width=t,n.height=1;let i=n.getContext("2d"),o=i.createLinearGradient(0,0,n.width,0),r=1/(e.length-1);for(let c=0;c<e.length;c++){let d=e[c],u=c*r,m=d.toCssColorString();o.addColorStop(u,m)}i.fillStyle=o,i.fillRect(0,0,n.width,n.height);let s=i.getImageData(0,0,n.width,n.height);return new Uint8Array(s.data.buffer)}var Rk=YXt;var e_o=x(T(),1);var WTo=x(T(),1),$Ie={FLOAT:"float",VEC2:"vec2",VEC3:"vec3",VEC4:"vec4",INT:"int",INT_VEC2:"ivec2",INT_VEC3:"ivec3",INT_VEC4:"ivec4",BOOL:"bool",BOOL_VEC2:"bvec2",BOOL_VEC3:"bvec3",BOOL_VEC4:"bvec4",MAT2:"mat2",MAT3:"mat3",MAT4:"mat4",SAMPLER_2D:"sampler2D",SAMPLER_CUBE:"samplerCube"};Object.freeze($Ie);var Y0=$Ie;var OTo=x(T(),1);var FTo=x(T(),1);function MXt(e,t,n){let i=new Uint8ClampedArray(e.buffer),o=new ImageData(i,t,n),r=document.createElement("canvas");return r.width=t,r.height=n,r.getContext("2d").putImageData(o,0,0),r}var Ck=MXt;function uA(){this._defaultTexture=void 0,this._textures={},this._loadedImages=[],this._lastUpdatedFrame=-1}uA.prototype.getTexture=function(e){return this._textures[e]};function wXt(e,t,n){n.resource.fetchImage().then(function(i){e._loadedImages.push({id:t,image:i,textureUniform:n})}).catch(function(){let i=e._textures[t];l(i)&&i!==e._defaultTexture&&i.destroy(),e._textures[t]=e._defaultTexture})}uA.prototype.loadTexture2D=function(e,t){l(t.typedArray)?this._loadedImages.push({id:e,textureUniform:t}):wXt(this,e,t)};function kXt(e,t,n){let{id:i,textureUniform:o,image:r}=t,s=n.webgl2?UK(o,r,n):UXt(o,r,n),a=e._textures[i];l(a)&&a!==n.defaultTexture&&a.destroy(),e._textures[i]=s}function UK(e,t,n){let{typedArray:i,sampler:o}=e,r=l(i)?tPe(e,n):new vt({context:n,source:t,sampler:o});return ePe(o)&&r.generateMipmap(),r}function UXt(e,t,n){let{typedArray:i,sampler:o}=e,r=ePe(o),s=o.wrapS===pn.REPEAT||o.wrapS===pn.MIRRORED_REPEAT||o.wrapT===pn.REPEAT||o.wrapT===pn.MIRRORED_REPEAT,{width:a,height:c}=l(i)?e:t,d=[a,c].every(W.isPowerOfTwo);if((r||s)&&!d)if(l(i)){if(e.pixelDatatype===Ue.UNSIGNED_BYTE){let m=Ck(i,a,c),p=sx(m);return UK({sampler:o},p,n)}}else{let m=sx(t);return UK(e,m,n)}else return UK(e,t,n);return r?console.warn("Texture requires resizing for mipmaps but pixelDataType cannot be resized. The texture may be rendered incorrectly."):s&&console.warn("Texture requires resizing for wrapping but pixelDataType cannot be resized. The texture may be rendered incorrectly."),tPe(e,n)}function ePe(e){return[Ht.NEAREST_MIPMAP_NEAREST,Ht.NEAREST_MIPMAP_LINEAR,Ht.LINEAR_MIPMAP_NEAREST,Ht.LINEAR_MIPMAP_LINEAR].includes(e.minificationFilter)}function tPe(e,t){let{pixelFormat:n,pixelDatatype:i,width:o,height:r,typedArray:s,sampler:a}=e;return new vt({context:t,pixelFormat:n,pixelDatatype:i,source:{arrayBufferView:s,width:o,height:r},sampler:a,flipY:!1})}uA.prototype.update=function(e){if(e.frameNumber===this._lastUpdatedFrame)return;this._lastUpdatedFrame=e.frameNumber;let t=e.context;this._defaultTexture=t.defaultTexture;let n=this._loadedImages;for(let i=0;i<n.length;i++){let o=n[i];kXt(this,o,t)}n.length=0};uA.prototype.isDestroyed=function(){return!1};uA.prototype.destroy=function(){let e=this._textures;for(let t in e)if(e.hasOwnProperty(t)){let n=e[t];n!==this._defaultTexture&&n.destroy()}return ue(this)};var Vk=uA;function Ek(e){e=e??B.EMPTY_OBJECT,this.mode=e.mode??Kb.MODIFY_MATERIAL,this.lightingModel=e.lightingModel,this.uniforms=e.uniforms??B.EMPTY_OBJECT,this.varyings=e.varyings??B.EMPTY_OBJECT,this.vertexShaderText=e.vertexShaderText,this.fragmentShaderText=e.fragmentShaderText,this.translucencyMode=e.translucencyMode??_x.INHERIT,this._textureManager=new Vk,this._defaultTexture=void 0,this.uniformMap=DXt(this),this.usedVariablesVertex={attributeSet:{},featureIdSet:{},metadataSet:{}},this.usedVariablesFragment={attributeSet:{},featureIdSet:{},metadataSet:{},materialSet:{}},zXt(this),HXt(this)}function DXt(e){let t=e.uniforms,n={};for(let i in t)if(t.hasOwnProperty(i)){let o=t[i];o.type===Y0.SAMPLER_2D?(e._textureManager.loadTexture2D(i,o.value),n[i]=OXt(e,i)):n[i]=BXt(e,i)}return n}function OXt(e,t){return function(){return e._textureManager.getTexture(t)??e._defaultTexture}}function BXt(e,t){return function(){return e.uniforms[t].value}}function pR(e,t,n){let i;for(;(i=t.exec(e))!==null;){let o=i[1];n[o]=!0}}function zXt(e){let t=/[vf]sInput\.attributes\.(\w+)/g,n=/[vf]sInput\.featureIds\.(\w+)/g,i=/[vf]sInput\.(?:metadata|metadataClass|metadataStatistics)\.(\w+)/g,o,r=e.vertexShaderText;l(r)&&(o=e.usedVariablesVertex.attributeSet,pR(r,t,o),o=e.usedVariablesVertex.featureIdSet,pR(r,n,o),o=e.usedVariablesVertex.metadataSet,pR(r,i,o));let s=e.fragmentShaderText;if(l(s)){o=e.usedVariablesFragment.attributeSet,pR(s,t,o),o=e.usedVariablesFragment.featureIdSet,pR(s,n,o),o=e.usedVariablesFragment.metadataSet,pR(s,i,o);let a=/material\.(\w+)/g,c=e.usedVariablesFragment.materialSet;pR(s,a,c)}}function nPe(e){let t=/^.*MC$/,n=/^.*WC$/,i=/^.*EC$/;return t.test(e)?`${e} (model coordinates)`:n.test(e)?`${e} (Cartesian world coordinates)`:i.test(e)?`${e} (eye coordinates)`:e}function Rl(e,t,n,i){if(e.hasOwnProperty(t)){let o=`${nPe(t)} is not available in the ${i} shader. Did you mean ${nPe(n)} instead?`;throw new ge(o)}}function HXt(e){let t=e.usedVariablesVertex.attributeSet;Rl(t,"position","positionMC","vertex"),Rl(t,"normal","normalMC","vertex"),Rl(t,"tangent","tangentMC","vertex"),Rl(t,"bitangent","bitangentMC","vertex"),Rl(t,"positionWC","positionMC","vertex"),Rl(t,"positionEC","positionMC","vertex"),Rl(t,"normalEC","normalMC","vertex"),Rl(t,"tangentEC","tangentMC","vertex"),Rl(t,"bitangentEC","bitangentMC","vertex");let n=e.usedVariablesFragment.attributeSet;Rl(n,"position","positionEC","fragment"),Rl(n,"normal","normalEC","fragment"),Rl(n,"tangent","tangentEC","fragment"),Rl(n,"bitangent","bitangentEC","fragment"),Rl(n,"normalMC","normalEC","fragment"),Rl(n,"tangentMC","tangentEC","fragment"),Rl(n,"bitangentMC","bitangentEC","fragment")}Ek.prototype.setUniform=function(e,t){let n=this.uniforms[e];n.type===Y0.SAMPLER_2D?this._textureManager.loadTexture2D(e,t):l(t.clone)?n.value=t.clone(n.value):n.value=t};Ek.prototype.update=function(e){this._defaultTexture=e.context.defaultTexture,this._textureManager.update(e)};Ek.prototype.isDestroyed=function(){return!1};Ek.prototype.destroy=function(){this._textureManager=this._textureManager&&this._textureManager.destroy(),ue(this)};var M0=Ek;var c_o=x(T(),1);function KXt(e){e=e??B.EMPTY_OBJECT,this.typedArray=e.typedArray,this.width=e.width,this.height=e.height,this.pixelFormat=e.pixelFormat??Qe.RGBA,this.pixelDatatype=e.pixelDatatype??Ue.UNSIGNED_BYTE;let t=e.url;typeof t=="string"&&(t=ve.createIfNeeded(t)),this.resource=t;let i=e.repeat??!0?pn.REPEAT:pn.CLAMP_TO_EDGE;this.sampler=new Ot({wrapS:i,wrapT:i,minificationFilter:e.minificationFilter,magnificationFilter:e.magnificationFilter,maximumAnisotropy:e.maximumAnisotropy})}var Ak=KXt;function JXt(e){let{names:t,types:n,componentTypes:i,minimumValues:o,maximumValues:r}=e;for(let s=0;s<t.length;s++){if(!jXt(o?.[s],r?.[s]))continue;let a=QXt(t[s],n[s],i[s],o[s],r[s]);if(l(a))return a}}function jXt(e,t){if(!Array.isArray(e)||!Array.isArray(t))return!1;let n=Math.min(...e),i=Math.max(...t);return n<i}function QXt(e,t,n,i,o){if(t===St.VEC4&&n===Nt.FLOAT32)return qXt(e,i,o);if(t===St.SCALAR&&n===Nt.FLOAT32)return $Xt(e,i,o)}function qXt(e,t,n){let i=Math.min(...t),o=Math.max(...n);if(!(i<0||o>1))return new M0({fragmentShaderText:`void fragmentMain(FragmentInput fsInput, inout czm_modelMaterial material) +`;a+="}",o.sources.push(a);let d=QGt(i);return tn.fromCache({context:n,vertexShaderSource:i.vertexShaderSource,fragmentShaderSource:o,attributeLocations:d})}var u9=new U;function $Gt(e,t){let n;return l(t.uniformMap)?n=t.uniformMap:n={},l(n.debugShowCommandsColor)||l(n.debugShowFrustumsColor)||(n.debugShowCommandsColor=function(){return e.debugShowCommands?(l(t._debugColor)||(t._debugColor=U.fromRandom()),t._debugColor):U.WHITE},n.debugShowFrustumsColor=function(){return e.debugShowFrustums?(u9.red=t.debugOverlappingFrustums&1?1:0,u9.green=t.debugOverlappingFrustums&2?1:0,u9.blue=t.debugOverlappingFrustums&4?1:0,u9.alpha=1,u9):U.WHITE}),n}var eLt=new lt;oLe.prototype.executeDebugShowFrustumsCommand=function(e,t,n){let i=t.shaderProgram.id,o=this._cachedShowFrustumsShaders[i];l(o)||(o=qGt(e,t.shaderProgram),this._cachedShowFrustumsShaders[i]=o);let r=lt.shallowClone(t,eLt);r.shaderProgram=o,r.uniformMap=$Gt(e,t),r.execute(e.context,n)};var m9=oLe;var Iso=x(T(),1);function kZ(e,t,n){this._primitive=e,this._tileIndex=t,this._sampleIndex=n,this._metadata={},this._orientedBoundingBox=new nn}kZ.fromKeyframeNode=function(e,t,n,i){let o=new kZ(e,t,n),{spatialNode:r,content:s}=i;return o._metadata=tLt(e,s,n),o._orientedBoundingBox=iLt(e,r,n,o._orientedBoundingBox),o};function tLt(e,t,n){if(!l(t)||!l(t.metadata))return;let{names:i,types:o}=e.provider,{metadata:r}=t,s={};for(let a=0;a<i.length;a++){let c=i[a],d=St.getComponentCount(o[a]),u=r[a].slice(n*d,(n+1)*d);s[c]=u}return s}var rLe=new h,nLt=new h;function iLt(e,t,n,i){let o=t.dimensions,r=o.x*o.y,s=Math.floor(n/r),a=n-s*r,c=Math.floor(a/o.x),d=a-c*o.x,u=h.fromElements(d,c,s,rLe),m=h.divideComponents(h.subtract(u,e._paddingBefore,rLe),e.dimensions,nLt);return e._shape.computeOrientedBoundingBoxForSample(t,e.dimensions,m,i)}Object.defineProperties(kZ.prototype,{metadata:{get:function(){return this._metadata}},primitive:{get:function(){return this._primitive}},sampleIndex:{get:function(){return this._sampleIndex}},tileIndex:{get:function(){return this._tileIndex}},orientedBoundingBox:{get:function(){return this._orientedBoundingBox.clone()}}});kZ.prototype.hasProperty=function(e){return l(this._metadata[e])};kZ.prototype.getNames=function(){return Object.keys(this._metadata)};kZ.prototype.getProperty=function(e){return this._metadata[e]};var h9=kZ;var Xuo=x(T(),1);var Cao=x(T(),1);var Xso=x(T(),1);function oLt(e,t){let n=document.createElement("canvas");n.width=t,n.height=1;let i=n.getContext("2d"),o=i.createLinearGradient(0,0,n.width,0),r=1/(e.length-1);for(let c=0;c<e.length;c++){let d=e[c],u=c*r,m=d.toCssColorString();o.addColorStop(u,m)}i.fillStyle=o,i.fillRect(0,0,n.width,n.height);let s=i.getImageData(0,0,n.width,n.height);return new Uint8Array(s.data.buffer)}var f9=oLt;var aao=x(T(),1);var Yso=x(T(),1),sLe={FLOAT:"float",VEC2:"vec2",VEC3:"vec3",VEC4:"vec4",INT:"int",INT_VEC2:"ivec2",INT_VEC3:"ivec3",INT_VEC4:"ivec4",BOOL:"bool",BOOL_VEC2:"bvec2",BOOL_VEC3:"bvec3",BOOL_VEC4:"bvec4",MAT2:"mat2",MAT3:"mat3",MAT4:"mat4",SAMPLER_2D:"sampler2D",SAMPLER_CUBE:"samplerCube"};Object.freeze(sLe);var R0=sLe;var Qso=x(T(),1);var wso=x(T(),1);function rLt(e,t,n){let i=new Uint8ClampedArray(e.buffer),o=new ImageData(i,t,n),r=document.createElement("canvas");return r.width=t,r.height=n,r.getContext("2d").putImageData(o,0,0),r}var p9=rLt;function uE(){this._defaultTexture=void 0,this._textures={},this._loadedImages=[],this._lastUpdatedFrame=-1}uE.prototype.getTexture=function(e){return this._textures[e]};function sLt(e,t,n){n.resource.fetchImage().then(function(i){e._loadedImages.push({id:t,image:i,textureUniform:n})}).catch(function(){let i=e._textures[t];l(i)&&i!==e._defaultTexture&&i.destroy(),e._textures[t]=e._defaultTexture})}uE.prototype.loadTexture2D=function(e,t){l(t.typedArray)?this._loadedImages.push({id:e,textureUniform:t}):sLt(this,e,t)};function aLt(e,t,n){let{id:i,textureUniform:o,image:r}=t,s=n.webgl2?Mz(o,r,n):cLt(o,r,n),a=e._textures[i];l(a)&&a!==n.defaultTexture&&a.destroy(),e._textures[i]=s}function Mz(e,t,n){let{typedArray:i,sampler:o}=e,r=l(i)?cLe(e,n):new vt({context:n,source:t,sampler:o});return aLe(o)&&r.generateMipmap(),r}function cLt(e,t,n){let{typedArray:i,sampler:o}=e,r=aLe(o),s=o.wrapS===pn.REPEAT||o.wrapS===pn.MIRRORED_REPEAT||o.wrapT===pn.REPEAT||o.wrapT===pn.MIRRORED_REPEAT,{width:a,height:c}=l(i)?e:t,d=[a,c].every(W.isPowerOfTwo);if((r||s)&&!d)if(l(i)){if(e.pixelDatatype===Ue.UNSIGNED_BYTE){let m=p9(i,a,c),p=fx(m);return Mz({sampler:o},p,n)}}else{let m=fx(t);return Mz(e,m,n)}else return Mz(e,t,n);return r?console.warn("Texture requires resizing for mipmaps but pixelDataType cannot be resized. The texture may be rendered incorrectly."):s&&console.warn("Texture requires resizing for wrapping but pixelDataType cannot be resized. The texture may be rendered incorrectly."),cLe(e,n)}function aLe(e){return[Ht.NEAREST_MIPMAP_NEAREST,Ht.NEAREST_MIPMAP_LINEAR,Ht.LINEAR_MIPMAP_NEAREST,Ht.LINEAR_MIPMAP_LINEAR].includes(e.minificationFilter)}function cLe(e,t){let{pixelFormat:n,pixelDatatype:i,width:o,height:r,typedArray:s,sampler:a}=e;return new vt({context:t,pixelFormat:n,pixelDatatype:i,source:{arrayBufferView:s,width:o,height:r},sampler:a,flipY:!1})}uE.prototype.update=function(e){if(e.frameNumber===this._lastUpdatedFrame)return;this._lastUpdatedFrame=e.frameNumber;let t=e.context;this._defaultTexture=t.defaultTexture;let n=this._loadedImages;for(let i=0;i<n.length;i++){let o=n[i];aLt(this,o,t)}n.length=0};uE.prototype.isDestroyed=function(){return!1};uE.prototype.destroy=function(){let e=this._textures;for(let t in e)if(e.hasOwnProperty(t)){let n=e[t];n!==this._defaultTexture&&n.destroy()}return ue(this)};var b9=uE;function g9(e){e=e??B.EMPTY_OBJECT,this.mode=e.mode??eg.MODIFY_MATERIAL,this.lightingModel=e.lightingModel,this.uniforms=e.uniforms??B.EMPTY_OBJECT,this.varyings=e.varyings??B.EMPTY_OBJECT,this.vertexShaderText=e.vertexShaderText,this.fragmentShaderText=e.fragmentShaderText,this.translucencyMode=e.translucencyMode??Zx.INHERIT,this._textureManager=new b9,this._defaultTexture=void 0,this.uniformMap=lLt(this),this.usedVariablesVertex={attributeSet:{},featureIdSet:{},metadataSet:{}},this.usedVariablesFragment={attributeSet:{},featureIdSet:{},metadataSet:{},materialSet:{}},mLt(this),hLt(this)}function lLt(e){let t=e.uniforms,n={};for(let i in t)if(t.hasOwnProperty(i)){let o=t[i];o.type===R0.SAMPLER_2D?(e._textureManager.loadTexture2D(i,o.value),n[i]=dLt(e,i)):n[i]=uLt(e,i)}return n}function dLt(e,t){return function(){return e._textureManager.getTexture(t)??e._defaultTexture}}function uLt(e,t){return function(){return e.uniforms[t].value}}function UZ(e,t,n){let i;for(;(i=t.exec(e))!==null;){let o=i[1];n[o]=!0}}function mLt(e){let t=/[vf]sInput\.attributes\.(\w+)/g,n=/[vf]sInput\.featureIds\.(\w+)/g,i=/[vf]sInput\.(?:metadata|metadataClass|metadataStatistics)\.(\w+)/g,o,r=e.vertexShaderText;l(r)&&(o=e.usedVariablesVertex.attributeSet,UZ(r,t,o),o=e.usedVariablesVertex.featureIdSet,UZ(r,n,o),o=e.usedVariablesVertex.metadataSet,UZ(r,i,o));let s=e.fragmentShaderText;if(l(s)){o=e.usedVariablesFragment.attributeSet,UZ(s,t,o),o=e.usedVariablesFragment.featureIdSet,UZ(s,n,o),o=e.usedVariablesFragment.metadataSet,UZ(s,i,o);let a=/material\.(\w+)/g,c=e.usedVariablesFragment.materialSet;UZ(s,a,c)}}function lLe(e){let t=/^.*MC$/,n=/^.*WC$/,i=/^.*EC$/;return t.test(e)?`${e} (model coordinates)`:n.test(e)?`${e} (Cartesian world coordinates)`:i.test(e)?`${e} (eye coordinates)`:e}function _l(e,t,n,i){if(e.hasOwnProperty(t)){let o=`${lLe(t)} is not available in the ${i} shader. Did you mean ${lLe(n)} instead?`;throw new ge(o)}}function hLt(e){let t=e.usedVariablesVertex.attributeSet;_l(t,"position","positionMC","vertex"),_l(t,"normal","normalMC","vertex"),_l(t,"tangent","tangentMC","vertex"),_l(t,"bitangent","bitangentMC","vertex"),_l(t,"positionWC","positionMC","vertex"),_l(t,"positionEC","positionMC","vertex"),_l(t,"normalEC","normalMC","vertex"),_l(t,"tangentEC","tangentMC","vertex"),_l(t,"bitangentEC","bitangentMC","vertex");let n=e.usedVariablesFragment.attributeSet;_l(n,"position","positionEC","fragment"),_l(n,"normal","normalEC","fragment"),_l(n,"tangent","tangentEC","fragment"),_l(n,"bitangent","bitangentEC","fragment"),_l(n,"normalMC","normalEC","fragment"),_l(n,"tangentMC","tangentEC","fragment"),_l(n,"bitangentMC","bitangentEC","fragment")}g9.prototype.setUniform=function(e,t){let n=this.uniforms[e];n.type===R0.SAMPLER_2D?this._textureManager.loadTexture2D(e,t):l(t.clone)?n.value=t.clone(n.value):n.value=t};g9.prototype.update=function(e){this._defaultTexture=e.context.defaultTexture,this._textureManager.update(e)};g9.prototype.isDestroyed=function(){return!1};g9.prototype.destroy=function(){this._textureManager=this._textureManager&&this._textureManager.destroy(),ue(this)};var C0=g9;var pao=x(T(),1);function fLt(e){e=e??B.EMPTY_OBJECT,this.typedArray=e.typedArray,this.width=e.width,this.height=e.height,this.pixelFormat=e.pixelFormat??Qe.RGBA,this.pixelDatatype=e.pixelDatatype??Ue.UNSIGNED_BYTE;let t=e.url;typeof t=="string"&&(t=ve.createIfNeeded(t)),this.resource=t;let i=e.repeat??!0?pn.REPEAT:pn.CLAMP_TO_EDGE;this.sampler=new Ot({wrapS:i,wrapT:i,minificationFilter:e.minificationFilter,magnificationFilter:e.magnificationFilter,maximumAnisotropy:e.maximumAnisotropy})}var y9=fLt;function pLt(e){let{names:t,types:n,componentTypes:i,minimumValues:o,maximumValues:r}=e;for(let s=0;s<t.length;s++){if(!bLt(o?.[s],r?.[s]))continue;let a=gLt(t[s],n[s],i[s],o[s],r[s]);if(l(a))return a}}function bLt(e,t){if(!Array.isArray(e)||!Array.isArray(t))return!1;let n=Math.min(...e),i=Math.max(...t);return n<i}function gLt(e,t,n,i,o){if(t===St.VEC4&&n===Nt.FLOAT32)return yLt(e,i,o);if(t===St.SCALAR&&n===Nt.FLOAT32)return xLt(e,i,o)}function yLt(e,t,n){let i=Math.min(...t),o=Math.max(...n);if(!(i<0||o>1))return new C0({fragmentShaderText:`void fragmentMain(FragmentInput fsInput, inout czm_modelMaterial material) { material.diffuse = fsInput.metadata.${e}.rgb; material.alpha = fsInput.metadata.${e}.a; -}`})}function $Xt(e,t,n){let o=Rk([new U(.267,.004,.329),new U(.282,.14,.457),new U(.254,.265,.53),new U(.207,.372,.553),new U(.164,.471,.558),new U(.128,.567,.551),new U(.135,.659,.518),new U(.194,.741,.443),new U(.282,.819,.369),new U(.396,.898,.301),new U(.538,.965,.236),new U(.741,.998,.149),new U(.993,1,.144)],128),r=new Ak({typedArray:o,width:128,height:1});return new M0({uniforms:{u_colorMap:{type:Y0.SAMPLER_2D,value:r},u_minimumValue:{type:Y0.FLOAT,value:t[0]},u_maximumValue:{type:Y0.FLOAT,value:n[0]}},fragmentShaderText:`void fragmentMain(FragmentInput fsInput, inout czm_modelMaterial material) +}`})}function xLt(e,t,n){let o=f9([new U(.267,.004,.329),new U(.282,.14,.457),new U(.254,.265,.53),new U(.207,.372,.553),new U(.164,.471,.558),new U(.128,.567,.551),new U(.135,.659,.518),new U(.194,.741,.443),new U(.282,.819,.369),new U(.396,.898,.301),new U(.538,.965,.236),new U(.741,.998,.149),new U(.993,1,.144)],128),r=new y9({typedArray:o,width:128,height:1});return new C0({uniforms:{u_colorMap:{type:R0.SAMPLER_2D,value:r},u_minimumValue:{type:R0.FLOAT,value:t[0]},u_maximumValue:{type:R0.FLOAT,value:n[0]}},fragmentShaderText:`void fragmentMain(FragmentInput fsInput, inout czm_modelMaterial material) { float value = fsInput.metadata.${e}; vec3 voxelNormal = fsInput.attributes.normalEC; @@ -11282,7 +11282,7 @@ out_FragColor = vec4(czm_XYZToRGB(xyz), 1.0); material.diffuse = texture(u_colorMap, vec2(lerp, 0.5)).rgb * lighting; material.alpha = 1.0; } - }`})}var mA=JXt;var sZo=x(T(),1);var Z_o=x(T(),1);function eNt(e,t){let{shaderBuilder:n}=e,{names:i,types:o,componentTypes:r,minimumValues:s,maximumValues:a}=t._provider,c=o.length,d=l(s)&&l(a);n.addDefine("METADATA_COUNT",c,fe.FRAGMENT),d&&n.addDefine("STATISTICS",void 0,fe.FRAGMENT);for(let g=0;g<c;g++){let V=i[g],G=DK(o[g]),v=`PropertyStatistics_${V}`,X=`PropertyStatistics_${V}`;n.addStruct(v,X,fe.FRAGMENT),n.addStructField(v,G,"min"),n.addStructField(v,G,"max")}let u="MetadataStatistics",m="MetadataStatistics",p="metadataStatistics";n.addStruct(u,m,fe.FRAGMENT);for(let g=0;g<c;g++){let V=i[g],G=`PropertyStatistics_${V}`,v=V;n.addStructField(u,G,v)}let b="Metadata",f="Metadata",y="metadata";n.addStruct(b,f,fe.FRAGMENT);for(let g=0;g<c;g++){let V=DK(o[g]);n.addStructField(b,V,i[g])}let _="Attributes",S="Attributes",Z="attributes";n.addStruct(_,S,fe.FRAGMENT),n.addStructField(_,"vec3","positionEC"),n.addStructField(_,"vec3","normalEC");let R="Voxel",C="Voxel",E="voxel";n.addStruct(R,C,fe.FRAGMENT),n.addStructField(R,"vec3","viewDirUv"),n.addStructField(R,"float","travelDistance"),n.addStructField(R,"int","stepCount"),n.addStructField(R,"int","tileIndex"),n.addStructField(R,"int","sampleIndex"),n.addStructField(R,"float","distanceToDepthBuffer");let A="FragmentInput";n.addStruct(A,"FragmentInput",fe.FRAGMENT),n.addStructField(A,m,p),n.addStructField(A,f,y),n.addStructField(A,S,Z),n.addStructField(A,C,E);let F="Properties",I="Properties",N="properties";n.addStruct(F,I,fe.FRAGMENT);for(let g=0;g<c;g++){let V=DK(o[g]);n.addStructField(F,V,i[g])}{let g="clearProperties";n.addFunction(g,`${I} clearProperties()`,fe.FRAGMENT),n.addFunctionLines(g,[`${I} ${N};`]);for(let V=0;V<c;V++){let G=DK(o[V],r[V]);n.addFunctionLines(g,[`${N}.${i[V]} = ${G}(0.0);`])}n.addFunctionLines(g,[`return ${N};`])}{let g="sumProperties";n.addFunction(g,`${I} sumProperties(${I} propertiesA, ${I} propertiesB)`,fe.FRAGMENT),n.addFunctionLines(g,[`${I} ${N};`]);for(let V=0;V<c;V++){let G=i[V];n.addFunctionLines(g,[`${N}.${G} = propertiesA.${G} + propertiesB.${G};`])}n.addFunctionLines(g,[`return ${N};`])}{let g="scaleProperties";n.addFunction(g,`${I} scaleProperties(${I} ${N}, float scale)`,fe.FRAGMENT),n.addFunctionLines(g,[`${I} scaledProperties = ${N};`]);for(let V=0;V<c;V++)n.addFunctionLines(g,[`scaledProperties.${i[V]} *= scale;`]);n.addFunctionLines(g,["return scaledProperties;"])}{let g="mixProperties";n.addFunction(g,`${I} mixProperties(${I} propertiesA, ${I} propertiesB, float mixFactor)`,fe.FRAGMENT),n.addFunctionLines(g,[`${I} ${N};`]);for(let V=0;V<c;V++){let G=i[V];n.addFunctionLines(g,[`${N}.${G} = mix(propertiesA.${G}, propertiesB.${G}, mixFactor);`])}n.addFunctionLines(g,[`return ${N};`])}{let g="copyPropertiesToMetadata";n.addFunction(g,`void copyPropertiesToMetadata(in ${I} ${N}, inout ${f} ${y})`,fe.FRAGMENT);for(let V=0;V<c;V++){let G=i[V];n.addFunctionLines(g,[`${y}.${G} = ${N}.${G};`])}}if(d){let g="setStatistics";n.addFunction(g,`void setStatistics(inout ${m} ${p})`,fe.FRAGMENT);for(let V=0;V<c;V++){let G=i[V],v=o[V],X=St.getComponentCount(v);for(let Y=0;Y<X;Y++){let D=nNt(v,Y),M=s[V][Y],O=a[V][Y];!l(M)||!l(O)||n.addFunctionLines(g,[`${p}.${G}.min${D} = ${iPe(M)};`,`${p}.${G}.max${D} = ${iPe(O)};`])}}}{let g="getPropertiesFromMegatextureAtUv";n.addFunction(g,`${I} getPropertiesFromMegatextureAtUv(vec3 texcoord)`,fe.FRAGMENT),n.addFunctionLines(g,[`${I} ${N};`]);for(let V=0;V<c;V++){let G=o[V],v=r[V],X=tNt(G,v);n.addFunctionLines(g,[`properties.${i[V]} = texture(u_megatextureTextures[${V}], texcoord)${X};`])}n.addFunctionLines(g,[`return ${N};`])}}function DK(e){if(e===St.SCALAR)return"float";if(e===St.VEC2)return"vec2";if(e===St.VEC3)return"vec3";if(e===St.VEC4)return"vec4"}function tNt(e){if(e===St.SCALAR)return".r";if(e===St.VEC2)return".ra";if(e===St.VEC3)return".rgb";if(e===St.VEC4)return""}function iPe(e){let t=e.toString();return t.indexOf(".")===-1&&(t=`${e}.0`),t}function nNt(e,t){return e===St.SCALAR?"":`[${t}]`}var Gk=eNt;var k_o=x(T(),1);function ip(e){let{planes:t,modelMatrix:n=P.IDENTITY,unionClippingRegions:i=!1}=e??B.EMPTY_OBJECT;if(this._planes=[],this.modelMatrix=P.clone(n),this.planeAdded=new Se,this.planeRemoved=new Se,this._unionClippingRegions=i,this._testIntersection=i?oPe:rPe,this._float32View=void 0,this._clippingPlanesTexture=void 0,l(t))for(let o=0;o<t.length;++o)this.add(t[o])}function oPe(e){return e===qt.OUTSIDE}function rPe(e){return e===qt.INSIDE}Object.defineProperties(ip.prototype,{length:{get:function(){return this._planes.length}},unionClippingRegions:{get:function(){return this._unionClippingRegions},set:function(e){this._unionClippingRegions!==e&&(this._unionClippingRegions=e,this._testIntersection=e?oPe:rPe)}},texture:{get:function(){return this._clippingPlanesTexture}},clippingPlanesState:{get:function(){return this._unionClippingRegions?this._planes.length:-this._planes.length}}});ip.prototype.add=function(e){let t=this._planes.length;e.index=t,this._planes.push(e),this.planeAdded.raiseEvent(e,t)};ip.prototype.get=function(e){return this._planes[e]};function sPe(e,t){for(let n=0;n<e.length;++n)if(cn.equals(e[n],t))return n;return-1}ip.prototype.contains=function(e){return sPe(this._planes,e)!==-1};ip.prototype.remove=function(e){let t=this._planes,n=sPe(t,e);if(n===-1)return!1;e instanceof ta&&(e.onChangeCallback=void 0,e.index=-1);let i=t.length-1;for(let o=n;o<i;++o){let r=t[o+1];t[o]=r,r instanceof ta&&(r.index=o)}return t.length=i,this.planeRemoved.raiseEvent(e,n),!0};ip.prototype.removeAll=function(){let e=this._planes;for(let t=0;t<e.length;++t){let n=e[t];n instanceof ta&&(n.onChangeCallback=void 0,n.index=-1),this.planeRemoved.raiseEvent(n,t)}this._planes=[]};var iNt=new cn(h.fromElements(1,0,0),0);function oNt(e,t){let n=e._float32View,i=e._planes,o=0;for(let r=0;r<i.length;++r){let{normal:s,distance:a}=sNt(i[r],t,iNt);n[o]=s.x,n[o+1]=s.y,n[o+2]=s.z,n[o+3]=a,o+=4}}var jre=new ce,rNt=new h;function sNt(e,t,n){let{normal:i,distance:o}=e,r=ce.fromElements(i.x,i.y,i.z,o,jre),s=P.multiplyByVector(t,r,jre),a=h.fromCartesian4(s,rNt);return s=ce.divideByScalar(s,h.magnitude(a),jre),cn.fromCartesian4(s,n)}function aPe(e,t){return t.x=Math.min(e,wt.maximumTextureSize),t.y=Math.ceil(e/t.x),t}var aNt=new k;ip.prototype.update=function(e,t){let n=this._clippingPlanesTexture,i=this.length;if(l(n)){let s=n.width*n.height;(s<i||i<.25*s)&&(n.destroy(),n=void 0,this._clippingPlanesTexture=void 0)}if(this.length===0)return;if(!l(n)){let s=aPe(i,aNt);s.y*=2,n=new vt({context:e.context,width:s.x,height:s.y,pixelFormat:Qe.RGBA,pixelDatatype:Ue.FLOAT,sampler:Ot.NEAREST,flipY:!1}),this._float32View=new Float32Array(s.x*s.y*4),this._clippingPlanesTexture=n}let{width:o,height:r}=n;oNt(this,t),n.copyFrom({source:{width:o,height:r,arrayBufferView:this._float32View}})};ip.getTextureResolution=function(e,t,n){let i=e.texture;if(l(i))return n.x=i.width,n.y=i.height,n;let o=e.length,r=aPe(o,n);return r.y*=2,r};ip.prototype.isDestroyed=function(){return!1};ip.prototype.destroy=function(){return this._clippingPlanesTexture=this._clippingPlanesTexture&&this._clippingPlanesTexture.destroy(),ue(this)};var ay=ip;var BSo=x(T(),1);var D_o=x(T(),1),Lk=`struct Ray { + }`})}var mE=pLt;var hlo=x(T(),1);var Lao=x(T(),1);function TLt(e,t){let{shaderBuilder:n}=e,{names:i,types:o,componentTypes:r,minimumValues:s,maximumValues:a}=t._provider,c=o.length,d=l(s)&&l(a);n.addDefine("METADATA_COUNT",c,fe.FRAGMENT),d&&n.addDefine("STATISTICS",void 0,fe.FRAGMENT);for(let g=0;g<c;g++){let V=i[g],G=wz(o[g]),v=`PropertyStatistics_${V}`,X=`PropertyStatistics_${V}`;n.addStruct(v,X,fe.FRAGMENT),n.addStructField(v,G,"min"),n.addStructField(v,G,"max")}let u="MetadataStatistics",m="MetadataStatistics",p="metadataStatistics";n.addStruct(u,m,fe.FRAGMENT);for(let g=0;g<c;g++){let V=i[g],G=`PropertyStatistics_${V}`,v=V;n.addStructField(u,G,v)}let b="Metadata",f="Metadata",y="metadata";n.addStruct(b,f,fe.FRAGMENT);for(let g=0;g<c;g++){let V=wz(o[g]);n.addStructField(b,V,i[g])}let _="Attributes",S="Attributes",Z="attributes";n.addStruct(_,S,fe.FRAGMENT),n.addStructField(_,"vec3","positionEC"),n.addStructField(_,"vec3","normalEC");let R="Voxel",C="Voxel",E="voxel";n.addStruct(R,C,fe.FRAGMENT),n.addStructField(R,"vec3","viewDirUv"),n.addStructField(R,"float","travelDistance"),n.addStructField(R,"int","stepCount"),n.addStructField(R,"int","tileIndex"),n.addStructField(R,"int","sampleIndex"),n.addStructField(R,"float","distanceToDepthBuffer");let A="FragmentInput";n.addStruct(A,"FragmentInput",fe.FRAGMENT),n.addStructField(A,m,p),n.addStructField(A,f,y),n.addStructField(A,S,Z),n.addStructField(A,C,E);let F="Properties",I="Properties",N="properties";n.addStruct(F,I,fe.FRAGMENT);for(let g=0;g<c;g++){let V=wz(o[g]);n.addStructField(F,V,i[g])}{let g="clearProperties";n.addFunction(g,`${I} clearProperties()`,fe.FRAGMENT),n.addFunctionLines(g,[`${I} ${N};`]);for(let V=0;V<c;V++){let G=wz(o[V],r[V]);n.addFunctionLines(g,[`${N}.${i[V]} = ${G}(0.0);`])}n.addFunctionLines(g,[`return ${N};`])}{let g="sumProperties";n.addFunction(g,`${I} sumProperties(${I} propertiesA, ${I} propertiesB)`,fe.FRAGMENT),n.addFunctionLines(g,[`${I} ${N};`]);for(let V=0;V<c;V++){let G=i[V];n.addFunctionLines(g,[`${N}.${G} = propertiesA.${G} + propertiesB.${G};`])}n.addFunctionLines(g,[`return ${N};`])}{let g="scaleProperties";n.addFunction(g,`${I} scaleProperties(${I} ${N}, float scale)`,fe.FRAGMENT),n.addFunctionLines(g,[`${I} scaledProperties = ${N};`]);for(let V=0;V<c;V++)n.addFunctionLines(g,[`scaledProperties.${i[V]} *= scale;`]);n.addFunctionLines(g,["return scaledProperties;"])}{let g="mixProperties";n.addFunction(g,`${I} mixProperties(${I} propertiesA, ${I} propertiesB, float mixFactor)`,fe.FRAGMENT),n.addFunctionLines(g,[`${I} ${N};`]);for(let V=0;V<c;V++){let G=i[V];n.addFunctionLines(g,[`${N}.${G} = mix(propertiesA.${G}, propertiesB.${G}, mixFactor);`])}n.addFunctionLines(g,[`return ${N};`])}{let g="copyPropertiesToMetadata";n.addFunction(g,`void copyPropertiesToMetadata(in ${I} ${N}, inout ${f} ${y})`,fe.FRAGMENT);for(let V=0;V<c;V++){let G=i[V];n.addFunctionLines(g,[`${y}.${G} = ${N}.${G};`])}}if(d){let g="setStatistics";n.addFunction(g,`void setStatistics(inout ${m} ${p})`,fe.FRAGMENT);for(let V=0;V<c;V++){let G=i[V],v=o[V],X=St.getComponentCount(v);for(let Y=0;Y<X;Y++){let D=SLt(v,Y),M=s[V][Y],O=a[V][Y];!l(M)||!l(O)||n.addFunctionLines(g,[`${p}.${G}.min${D} = ${dLe(M)};`,`${p}.${G}.max${D} = ${dLe(O)};`])}}}{let g="getPropertiesFromMegatextureAtUv";n.addFunction(g,`${I} getPropertiesFromMegatextureAtUv(vec3 texcoord)`,fe.FRAGMENT),n.addFunctionLines(g,[`${I} ${N};`]);for(let V=0;V<c;V++){let G=o[V],v=r[V],X=_Lt(G,v);n.addFunctionLines(g,[`properties.${i[V]} = texture(u_megatextureTextures[${V}], texcoord)${X};`])}n.addFunctionLines(g,[`return ${N};`])}}function wz(e){if(e===St.SCALAR)return"float";if(e===St.VEC2)return"vec2";if(e===St.VEC3)return"vec3";if(e===St.VEC4)return"vec4"}function _Lt(e){if(e===St.SCALAR)return".r";if(e===St.VEC2)return".ra";if(e===St.VEC3)return".rgb";if(e===St.VEC4)return""}function dLe(e){let t=e.toString();return t.indexOf(".")===-1&&(t=`${e}.0`),t}function SLt(e,t){return e===St.SCALAR?"":`[${t}]`}var x9=TLt;var Kao=x(T(),1);function zf(e){let{planes:t,modelMatrix:n=P.IDENTITY,unionClippingRegions:i=!1}=e??B.EMPTY_OBJECT;if(this._planes=[],this.modelMatrix=P.clone(n),this.planeAdded=new Se,this.planeRemoved=new Se,this._unionClippingRegions=i,this._testIntersection=i?uLe:mLe,this._float32View=void 0,this._clippingPlanesTexture=void 0,l(t))for(let o=0;o<t.length;++o)this.add(t[o])}function uLe(e){return e===qt.OUTSIDE}function mLe(e){return e===qt.INSIDE}Object.defineProperties(zf.prototype,{length:{get:function(){return this._planes.length}},unionClippingRegions:{get:function(){return this._unionClippingRegions},set:function(e){this._unionClippingRegions!==e&&(this._unionClippingRegions=e,this._testIntersection=e?uLe:mLe)}},texture:{get:function(){return this._clippingPlanesTexture}},clippingPlanesState:{get:function(){return this._unionClippingRegions?this._planes.length:-this._planes.length}}});zf.prototype.add=function(e){let t=this._planes.length;e.index=t,this._planes.push(e),this.planeAdded.raiseEvent(e,t)};zf.prototype.get=function(e){return this._planes[e]};function hLe(e,t){for(let n=0;n<e.length;++n)if(cn.equals(e[n],t))return n;return-1}zf.prototype.contains=function(e){return hLe(this._planes,e)!==-1};zf.prototype.remove=function(e){let t=this._planes,n=hLe(t,e);if(n===-1)return!1;e instanceof ta&&(e.onChangeCallback=void 0,e.index=-1);let i=t.length-1;for(let o=n;o<i;++o){let r=t[o+1];t[o]=r,r instanceof ta&&(r.index=o)}return t.length=i,this.planeRemoved.raiseEvent(e,n),!0};zf.prototype.removeAll=function(){let e=this._planes;for(let t=0;t<e.length;++t){let n=e[t];n instanceof ta&&(n.onChangeCallback=void 0,n.index=-1),this.planeRemoved.raiseEvent(n,t)}this._planes=[]};var ZLt=new cn(h.fromElements(1,0,0),0);function RLt(e,t){let n=e._float32View,i=e._planes,o=0;for(let r=0;r<i.length;++r){let{normal:s,distance:a}=VLt(i[r],t,ZLt);n[o]=s.x,n[o+1]=s.y,n[o+2]=s.z,n[o+3]=a,o+=4}}var vne=new ce,CLt=new h;function VLt(e,t,n){let{normal:i,distance:o}=e,r=ce.fromElements(i.x,i.y,i.z,o,vne),s=P.multiplyByVector(t,r,vne),a=h.fromCartesian4(s,CLt);return s=ce.divideByScalar(s,h.magnitude(a),vne),cn.fromCartesian4(s,n)}function fLe(e,t){return t.x=Math.min(e,wt.maximumTextureSize),t.y=Math.ceil(e/t.x),t}var ELt=new k;zf.prototype.update=function(e,t){let n=this._clippingPlanesTexture,i=this.length;if(l(n)){let s=n.width*n.height;(s<i||i<.25*s)&&(n.destroy(),n=void 0,this._clippingPlanesTexture=void 0)}if(this.length===0)return;if(!l(n)){let s=fLe(i,ELt);s.y*=2,n=new vt({context:e.context,width:s.x,height:s.y,pixelFormat:Qe.RGBA,pixelDatatype:Ue.FLOAT,sampler:Ot.NEAREST,flipY:!1}),this._float32View=new Float32Array(s.x*s.y*4),this._clippingPlanesTexture=n}let{width:o,height:r}=n;RLt(this,t),n.copyFrom({source:{width:o,height:r,arrayBufferView:this._float32View}})};zf.getTextureResolution=function(e,t,n){let i=e.texture;if(l(i))return n.x=i.width,n.y=i.height,n;let o=e.length,r=fLe(o,n);return r.y*=2,r};zf.prototype.isDestroyed=function(){return!1};zf.prototype.destroy=function(){return this._clippingPlanesTexture=this._clippingPlanesTexture&&this._clippingPlanesTexture.destroy(),ue(this)};var Dg=zf;var qco=x(T(),1);var jao=x(T(),1),T9=`struct Ray { vec3 pos; vec3 dir; }; @@ -11292,7 +11292,7 @@ return min(min(v.x, v.y), v.z); float maxComponent(in vec3 v) { return max(max(v.x, v.y), v.z); } -`;var B_o=x(T(),1),Wk=`#define STEP_COUNT_MAX 1000 // Harcoded value because GLSL doesn't like variable length loops +`;var qao=x(T(),1),_9=`#define STEP_COUNT_MAX 1000 // Harcoded value because GLSL doesn't like variable length loops #if defined(PICKING_VOXEL) #define ALPHA_ACCUM_MAX 0.1 #else @@ -11474,7 +11474,7 @@ out_FragColor = vec4(megatextureId, sampleIndex); out_FragColor = colorAccum; #endif } -`;var H_o=x(T(),1),vk=`in vec2 position; +`;var eco=x(T(),1),S9=`in vec2 position; uniform vec4 u_ndcSpaceAxisAlignedBoundingBox; void main() { vec2 aabbMin = u_ndcSpaceAxisAlignedBoundingBox.xy; @@ -11483,7 +11483,7 @@ vec2 translation = 0.5 * (aabbMax + aabbMin); vec2 scale = 0.5 * (aabbMax - aabbMin); gl_Position = vec4(position * scale + translation, 0.0, 1.0); } -`;var J_o=x(T(),1),Fk=`#define NO_HIT (-czm_infinity) +`;var nco=x(T(),1),Z9=`#define NO_HIT (-czm_infinity) #define INF_HIT (czm_infinity * 0.5) struct RayShapeIntersection { vec4 entry; @@ -11591,7 +11591,7 @@ break; return shapeIntersection; } #endif -`;var Q_o=x(T(),1),Ik=`void intersectDepth(in vec2 screenCoord, in Ray ray, inout Intersections ix) { +`;var oco=x(T(),1),R9=`void intersectDepth(in vec2 screenCoord, in Ray ray, inout Intersections ix) { float logDepthOrDepth = czm_unpackDepth(texture(czm_globeDepthTexture, screenCoord)); float entry; float exit; @@ -11609,7 +11609,7 @@ ix.distanceToDepthBuffer = entry; setIntersectionPair(ix, DEPTH_INTERSECTION_INDEX, vec2(entry, exit)); #endif } -`;var $_o=x(T(),1),Pk=`uniform sampler2D u_clippingPlanesTexture; +`;var sco=x(T(),1),C9=`uniform sampler2D u_clippingPlanesTexture; uniform mat4 u_clippingPlanesMatrix; vec4 intersectPlane(in Ray ray, in vec4 plane) { vec3 n = plane.xyz; @@ -11672,7 +11672,7 @@ setShapeIntersection(ix, CLIPPING_PLANES_INTERSECTION_INDEX, clippingVolume); #endif } #endif -`;var tSo=x(T(),1),hA=`vec4 transformNormalToEC(in vec4 intersection) { +`;var cco=x(T(),1),hE=`vec4 transformNormalToEC(in vec4 intersection) { return vec4(normalize(czm_normal * intersection.xyz), intersection.w); } RayShapeIntersection transformNormalsToEC(in RayShapeIntersection ix) { @@ -11756,7 +11756,7 @@ return transformNormalsToEC(RayShapeIntersection(last, farSide)); return transformNormalsToEC(RayShapeIntersection(miss, miss)); } } -`;var iSo=x(T(),1),Xk=`uniform sampler2D u_renderBoundPlanesTexture; +`;var dco=x(T(),1),V9=`uniform sampler2D u_renderBoundPlanesTexture; RayShapeIntersection intersectBoundPlanes(in Ray ray) { vec4 lastEntry = vec4(ray.dir, -INF_HIT); vec4 firstExit = vec4(-ray.dir, +INF_HIT); @@ -11780,7 +11780,7 @@ void intersectShape(in Ray rayUV, in Ray rayEC, inout Intersections ix) RayShapeIntersection intersection = intersectBoundPlanes(rayEC); setShapeIntersection(ix, BOX_INTERSECTION_INDEX, intersection); } -`;var rSo=x(T(),1),Nk=`uniform vec2 u_cylinderRenderRadiusMinMax; +`;var mco=x(T(),1),E9=`uniform vec2 u_cylinderRenderRadiusMinMax; #if defined(CYLINDER_HAS_RENDER_BOUNDS_ANGLE) uniform vec2 u_cylinderRenderAngleMinMax; #endif @@ -11863,7 +11863,7 @@ setShapeIntersection(ix, CYLINDER_INTERSECTION_INDEX_ANGLE + 0, wedgeIntersects[ setShapeIntersection(ix, CYLINDER_INTERSECTION_INDEX_ANGLE + 1, wedgeIntersects[1]); #endif } -`;var aSo=x(T(),1),Yk=`#if defined(ELLIPSOID_HAS_RENDER_BOUNDS_LONGITUDE) +`;var fco=x(T(),1),A9=`#if defined(ELLIPSOID_HAS_RENDER_BOUNDS_LONGITUDE) uniform vec2 u_ellipsoidRenderLongitudeMinMax; #endif uniform float u_eccentricitySquared; @@ -12064,7 +12064,7 @@ setShapeIntersection(ix, ELLIPSOID_INTERSECTION_INDEX_LONGITUDE + 0, wedgeInters setShapeIntersection(ix, ELLIPSOID_INTERSECTION_INDEX_LONGITUDE + 1, wedgeIntersects[1]); #endif } -`;var lSo=x(T(),1),bR=`RayShapeIntersection intersectScene(in vec2 screenCoord, in Ray ray, in Ray rayEC, out Intersections ix) { +`;var bco=x(T(),1),DZ=`RayShapeIntersection intersectScene(in vec2 screenCoord, in Ray ray, in Ray rayEC, out Intersections ix) { intersectShape(ray, rayEC, ix); RayShapeIntersection intersection = getFirstIntersection(ix); if (intersection.entry.w == NO_HIT) { @@ -12088,7 +12088,7 @@ intersection.entry.w = max(intersection.entry.w, 0.0); #endif return intersection; } -`;var uSo=x(T(),1),Mk=`uniform vec3 u_boxLocalToShapeUvScale; +`;var yco=x(T(),1),G9=`uniform vec3 u_boxLocalToShapeUvScale; uniform ivec4 u_cameraTileCoordinates; uniform vec3 u_cameraTileUv; uniform mat3 u_boxEcToXyz; @@ -12111,7 +12111,7 @@ ivec3 tileCoordinateChange = tileCoordinate - u_cameraTileCoordinates.xyz; vec3 tileUv = clamp(tileUvSum - vec3(tileCoordinateChange), 0.0, 1.0); return TileAndUvCoordinate(ivec4(tileCoordinate, u_cameraTileCoordinates.w), tileUv); } -`;var hSo=x(T(),1),wk=`uniform vec3 u_cylinderLocalToShapeUvScale; +`;var Tco=x(T(),1),L9=`uniform vec3 u_cylinderLocalToShapeUvScale; uniform float u_cylinderShapeUvAngleRangeOrigin; uniform mat3 u_cylinderEcToRadialTangentUp; uniform ivec4 u_cameraTileCoordinates; @@ -12185,7 +12185,7 @@ tileUv.y = clamp(tileUv.y, 0.0, 1.0); tileUv.z = clamp(tileUv.z, 0.0, 1.0); return TileAndUvCoordinate(ivec4(tileCoordinate, u_cameraTileCoordinates.w), tileUv); } -`;var pSo=x(T(),1),kk=`uniform vec3 u_cameraPositionCartographic; +`;var Sco=x(T(),1),W9=`uniform vec3 u_cameraPositionCartographic; uniform vec2 u_ellipsoidCurvatureAtLatitude; uniform mat3 u_ellipsoidEcToEastNorthUp; uniform vec3 u_ellipsoidRadii; @@ -12304,7 +12304,7 @@ tileUv.y = clamp(tileUv.y, 0.0, 1.0); tileUv.z = clamp(tileUv.z, 0.0, 1.0); return TileAndUvCoordinate(ivec4(tileCoordinate, u_cameraTileCoordinates.w), tileUv); } -`;var gSo=x(T(),1),Uk=`#define OCTREE_FLAG_INTERNAL 0 +`;var Rco=x(T(),1),v9=`#define OCTREE_FLAG_INTERNAL 0 #define OCTREE_FLAG_LEAF 1 #define OCTREE_FLAG_PACKED_LEAF_FROM_PARENT 2 #define OCTREE_MAX_LEVELS 32 // Harcoded value because GLSL doesn't like variable length loops @@ -12505,7 +12505,7 @@ addSampleCoordinates(tileAndUv, sampleDatas[0]); addSampleCoordinates(tileAndUv, sampleDatas[1]); #endif } -`;var xSo=x(T(),1),Dk=`uniform ivec3 u_megatextureTileCounts; +`;var Vco=x(T(),1),F9=`uniform ivec3 u_megatextureTileCounts; vec3 index1DTo3DTexCoord(int index) { int tilesPerZ = u_megatextureTileCounts.x * u_megatextureTileCounts.y; @@ -12540,19 +12540,19 @@ properties = sumProperties(properties, tempProperties); return properties; #endif } -`;var _So=x(T(),1),cPe={Z_UP:0,Y_UP:1};Object.freeze(cPe);var w0=cPe;function cNt(e){let t=new lb;this.shaderBuilder=t;let n=e._customShader,i=It(e._uniformMap,n.uniformMap);e._uniformMap=i;let o=n.uniforms;for(let f in o)if(o.hasOwnProperty(f)){let y=o[f];t.addUniform(y.type,f,fe.FRAGMENT)}t.addUniform("sampler3D","u_megatextureTextures[METADATA_COUNT]",fe.FRAGMENT),this.uniformMap=i;let r=e._clippingPlanes,s=l(r)&&r.enabled?r.length:0;this.clippingPlanes=r,this.clippingPlanesLength=s;let a=e._shape.renderBoundPlanes,c=a?.length??0;this.renderBoundPlanes=a,this.renderBoundPlanesLength=c,t.addVertexLines([vk]),e.provider.metadataOrder===w0.Y_UP&&t.addDefine("Y_UP_METADATA_ORDER",void 0,fe.FRAGMENT);let d=e._provider.shape;d==="BOX"?t.addDefine("SHAPE_BOX",void 0,fe.FRAGMENT):d==="CYLINDER"?t.addDefine("SHAPE_CYLINDER",void 0,fe.FRAGMENT):d==="ELLIPSOID"&&t.addDefine("SHAPE_ELLIPSOID",void 0,fe.FRAGMENT),t.addFragmentLines([n.fragmentShaderText,"#line 0",Uk,Lk,Dk,Fk,Pk,Ik]),s>0&&(t.addDefine("CLIPPING_PLANES",void 0,fe.FRAGMENT),t.addDefine("CLIPPING_PLANES_COUNT",s,fe.FRAGMENT),r.unionClippingRegions&&t.addDefine("CLIPPING_PLANES_UNION",void 0,fe.FRAGMENT)),e._depthTest&&t.addDefine("DEPTH_TEST",void 0,fe.FRAGMENT),d==="BOX"?t.addFragmentLines([Mk,Xk,bR]):d==="CYLINDER"?t.addFragmentLines([wk,hA,Nk,bR]):d==="ELLIPSOID"&&t.addFragmentLines([kk,hA,Yk,bR]),t.addFragmentLines([Wk]);let u=e._shape,m=u.shaderDefines;for(let f in m)if(m.hasOwnProperty(f)){let y=m[f];l(y)&&(y=y===!0?void 0:y,t.addDefine(f,y,fe.FRAGMENT))}let p=u.shaderMaximumIntersectionsLength;s>0&&(t.addDefine("CLIPPING_PLANES_INTERSECTION_INDEX",p,fe.FRAGMENT),s===1?p+=1:r.unionClippingRegions?p+=2:p+=1),e._depthTest&&(t.addDefine("DEPTH_INTERSECTION_INDEX",p,fe.FRAGMENT),p+=1),t.addDefine("INTERSECTION_COUNT",p,fe.FRAGMENT),(!h.equals(e.paddingBefore,h.ZERO)||!h.equals(e.paddingAfter,h.ZERO))&&t.addDefine("PADDING",void 0,fe.FRAGMENT),e._useLogDepth&&t.addDefine("LOG_DEPTH_READ_ONLY",void 0,fe.FRAGMENT);let b=e._traversal;t.addDefine("SAMPLE_COUNT",`${b._sampleCount}`,fe.FRAGMENT)}var Ok=cNt;var lPe=new k;function lNt(e,t){let n=new Ok(e);Gk(n,e);let{shaderBuilder:i,clippingPlanes:o,clippingPlanesLength:r,renderBoundPlanes:s,renderBoundPlanesLength:a}=n;if(r>0){let R="getClippingPlane",C=`vec4 ${R}(highp sampler2D packedPlanes, int planeNumber)`,E=gs.getTextureResolution(o,t,lPe),A=dPe(E);i.addFunction(R,C,fe.FRAGMENT),i.addFunctionLines(R,[A])}if(a>0){let R="getBoundPlane",C=`vec4 ${R}(highp sampler2D packedPlanes, int planeNumber)`,E=ay.getTextureResolution(s,t,lPe),A=dPe(E);i.addFunction(R,C,fe.FRAGMENT),i.addFunctionLines(R,[A])}let c=i.clone();c.addDefine("PICKING",void 0,fe.FRAGMENT);let d=i.clone();d.addDefine("PICKING_VOXEL",void 0,fe.FRAGMENT);let u=i.buildShaderProgram(t),m=c.buildShaderProgram(t),p=d.buildShaderProgram(t),b=ze.fromCache({cull:{enabled:!0,face:Di.BACK},depthTest:{enabled:!1},depthMask:!1,blending:on.PRE_MULTIPLIED_ALPHA_BLEND}),f=t.getViewportQuadVertexArray(),y=e._depthTest,_=new lt({vertexArray:f,primitiveType:Ie.TRIANGLES,renderState:b,shaderProgram:u,uniformMap:n.uniformMap,modelMatrix:e._compoundModelMatrix,pass:Le.VOXELS,executeInClosestFrustum:!0,owner:this,cull:y,occlude:y}),S=lt.shallowClone(_,new lt);S.shaderProgram=m,S.pickOnly=!0;let Z=lt.shallowClone(_,new lt);if(Z.shaderProgram=p,Z.pickOnly=!0,l(e._drawCommand)){let R=e._drawCommand;R.shaderProgram=R.shaderProgram&&R.shaderProgram.destroy()}if(l(e._drawCommandPick)){let R=e._drawCommandPick;R.shaderProgram=R.shaderProgram&&R.shaderProgram.destroy()}if(l(e._drawCommandPickVoxel)){let R=e._drawCommandPickVoxel;R.shaderProgram=R.shaderProgram&&R.shaderProgram.destroy()}e._drawCommand=_,e._drawCommandPick=S,e._drawCommandPickVoxel=Z}function dPe(e){let t=e.x,n=e.y,i=1/t,o=1/n,r=`${i}`;r.indexOf(".")===-1&&(r+=".0");let s=`${o}`;return s.indexOf(".")===-1&&(s+=".0"),`int pixY = planeNumber / ${t}; +`;var Aco=x(T(),1),pLe={Z_UP:0,Y_UP:1};Object.freeze(pLe);var V0=pLe;function ALt(e){let t=new lb;this.shaderBuilder=t;let n=e._customShader,i=It(e._uniformMap,n.uniformMap);e._uniformMap=i;let o=n.uniforms;for(let f in o)if(o.hasOwnProperty(f)){let y=o[f];t.addUniform(y.type,f,fe.FRAGMENT)}t.addUniform("sampler3D","u_megatextureTextures[METADATA_COUNT]",fe.FRAGMENT),this.uniformMap=i;let r=e._clippingPlanes,s=l(r)&&r.enabled?r.length:0;this.clippingPlanes=r,this.clippingPlanesLength=s;let a=e._shape.renderBoundPlanes,c=a?.length??0;this.renderBoundPlanes=a,this.renderBoundPlanesLength=c,t.addVertexLines([S9]),e.provider.metadataOrder===V0.Y_UP&&t.addDefine("Y_UP_METADATA_ORDER",void 0,fe.FRAGMENT);let d=e._provider.shape;d==="BOX"?t.addDefine("SHAPE_BOX",void 0,fe.FRAGMENT):d==="CYLINDER"?t.addDefine("SHAPE_CYLINDER",void 0,fe.FRAGMENT):d==="ELLIPSOID"&&t.addDefine("SHAPE_ELLIPSOID",void 0,fe.FRAGMENT),t.addFragmentLines([n.fragmentShaderText,"#line 0",v9,T9,F9,Z9,C9,R9]),s>0&&(t.addDefine("CLIPPING_PLANES",void 0,fe.FRAGMENT),t.addDefine("CLIPPING_PLANES_COUNT",s,fe.FRAGMENT),r.unionClippingRegions&&t.addDefine("CLIPPING_PLANES_UNION",void 0,fe.FRAGMENT)),e._depthTest&&t.addDefine("DEPTH_TEST",void 0,fe.FRAGMENT),d==="BOX"?t.addFragmentLines([G9,V9,DZ]):d==="CYLINDER"?t.addFragmentLines([L9,hE,E9,DZ]):d==="ELLIPSOID"&&t.addFragmentLines([W9,hE,A9,DZ]),t.addFragmentLines([_9]);let u=e._shape,m=u.shaderDefines;for(let f in m)if(m.hasOwnProperty(f)){let y=m[f];l(y)&&(y=y===!0?void 0:y,t.addDefine(f,y,fe.FRAGMENT))}let p=u.shaderMaximumIntersectionsLength;s>0&&(t.addDefine("CLIPPING_PLANES_INTERSECTION_INDEX",p,fe.FRAGMENT),s===1?p+=1:r.unionClippingRegions?p+=2:p+=1),e._depthTest&&(t.addDefine("DEPTH_INTERSECTION_INDEX",p,fe.FRAGMENT),p+=1),t.addDefine("INTERSECTION_COUNT",p,fe.FRAGMENT),(!h.equals(e.paddingBefore,h.ZERO)||!h.equals(e.paddingAfter,h.ZERO))&&t.addDefine("PADDING",void 0,fe.FRAGMENT),e._useLogDepth&&t.addDefine("LOG_DEPTH_READ_ONLY",void 0,fe.FRAGMENT);let b=e._traversal;t.addDefine("SAMPLE_COUNT",`${b._sampleCount}`,fe.FRAGMENT)}var I9=ALt;var bLe=new k;function GLt(e,t){let n=new I9(e);x9(n,e);let{shaderBuilder:i,clippingPlanes:o,clippingPlanesLength:r,renderBoundPlanes:s,renderBoundPlanesLength:a}=n;if(r>0){let R="getClippingPlane",C=`vec4 ${R}(highp sampler2D packedPlanes, int planeNumber)`,E=_s.getTextureResolution(o,t,bLe),A=gLe(E);i.addFunction(R,C,fe.FRAGMENT),i.addFunctionLines(R,[A])}if(a>0){let R="getBoundPlane",C=`vec4 ${R}(highp sampler2D packedPlanes, int planeNumber)`,E=Dg.getTextureResolution(s,t,bLe),A=gLe(E);i.addFunction(R,C,fe.FRAGMENT),i.addFunctionLines(R,[A])}let c=i.clone();c.addDefine("PICKING",void 0,fe.FRAGMENT);let d=i.clone();d.addDefine("PICKING_VOXEL",void 0,fe.FRAGMENT);let u=i.buildShaderProgram(t),m=c.buildShaderProgram(t),p=d.buildShaderProgram(t),b=ze.fromCache({cull:{enabled:!0,face:Ui.BACK},depthTest:{enabled:!1},depthMask:!1,blending:on.PRE_MULTIPLIED_ALPHA_BLEND}),f=t.getViewportQuadVertexArray(),y=e._depthTest,_=new lt({vertexArray:f,primitiveType:Ie.TRIANGLES,renderState:b,shaderProgram:u,uniformMap:n.uniformMap,modelMatrix:e._compoundModelMatrix,pass:Le.VOXELS,executeInClosestFrustum:!0,owner:this,cull:y,occlude:y}),S=lt.shallowClone(_,new lt);S.shaderProgram=m,S.pickOnly=!0;let Z=lt.shallowClone(_,new lt);if(Z.shaderProgram=p,Z.pickOnly=!0,l(e._drawCommand)){let R=e._drawCommand;R.shaderProgram=R.shaderProgram&&R.shaderProgram.destroy()}if(l(e._drawCommandPick)){let R=e._drawCommandPick;R.shaderProgram=R.shaderProgram&&R.shaderProgram.destroy()}if(l(e._drawCommandPickVoxel)){let R=e._drawCommandPickVoxel;R.shaderProgram=R.shaderProgram&&R.shaderProgram.destroy()}e._drawCommand=_,e._drawCommandPick=S,e._drawCommandPickVoxel=Z}function gLe(e){let t=e.x,n=e.y,i=1/t,o=1/n,r=`${i}`;r.indexOf(".")===-1&&(r+=".0");let s=`${o}`;return s.indexOf(".")===-1&&(s+=".0"),`int pixY = planeNumber / ${t}; int pixX = planeNumber - (pixY * ${t}); // Sample from center of pixel float u = (float(pixX) + 0.5) * ${r}; float v = (float(pixY) + 0.5) * ${s}; - return texture(packedPlanes, vec2(u, v));`}var Bk=lNt;var fZo=x(T(),1);function cy(e){let{loader:t,metadata:n}=e;this._loader=t,this._metadata=n,this._resourcesLoaded=!1,this._ready=!1}Object.defineProperties(cy.prototype,{ready:{get:function(){return this._ready}},metadata:{get:function(){return this._metadata}}});cy.fromMetadataArray=function(e){return new cy({metadata:e})};cy.fromGltf=async function(e){let t=new vu({gltfResource:e,releaseGltfJson:!1,loadAttributesAsTypedArray:!0});try{await t.load()}catch(n){throw t.destroy(),n}return new cy({loader:t})};cy.prototype.update=function(e,t){let n=this._loader;if(!this._ready){if(t.afterRender.push(()=>!0),!l(n)){this._ready=!0;return}if(this._resourcesLoaded){let{structuralMetadata:i,scene:o}=n.components,{attributes:r}=o.nodes[0].primitives[0];this._metadata=dNt(r,i,e),this._ready=!0;return}this._resourcesLoaded=n.process(t)}};function dNt(e,t,n){let{className:i,names:o,types:r,componentTypes:s}=n.provider,a=t.propertyAttributes.find(u=>u.class.id===i),{properties:c}=a,d=new Array(o.length);for(let u=0;u<e.length;u++){let m=c[o[u]].attribute,p=e.find(_=>_.name===m);if(!l(p))continue;let b=Nt.toComponentDatatype(s[u]),f=St.getComponentCount(r[u]),y=p.count*f;d[u]=J.createArrayBufferView(b,p.typedArray.buffer,p.typedArray.byteOffset+p.byteOffset,y)}return d}cy.prototype.isDestroyed=function(){return!1};cy.prototype.destroy=function(){return this._loader=this._loader&&this._loader.destroy(),ue(this)};var gR=cy;var tRo=x(T(),1);var RZo=x(T(),1);function Cl(){this._orientedBoundingBox=new nn,this._boundingSphere=new me,this._boundTransform=new P,this._shapeTransform=new P,this._minBounds=Cl.DefaultMinBounds.clone(),this._maxBounds=Cl.DefaultMaxBounds.clone(),this._renderMinBounds=Cl.DefaultMinBounds.clone(),this._renderMaxBounds=Cl.DefaultMaxBounds.clone();let{DefaultMinBounds:e,DefaultMaxBounds:t}=Cl,n=[new ta(h.negate(h.UNIT_X,new h),e.x),new ta(h.negate(h.UNIT_Y,new h),e.y),new ta(h.negate(h.UNIT_Z,new h),e.z),new ta(h.UNIT_X,-t.x),new ta(h.UNIT_Y,-t.y),new ta(h.UNIT_Z,-t.z)];this._renderBoundPlanes=new ay({planes:n}),this._localToShapeUvTranslate=new h,this._shaderUniforms={boxEcToXyz:new q,boxLocalToShapeUvScale:new h},this._shaderDefines={BOX_INTERSECTION_INDEX:void 0},this._shaderMaximumIntersectionsLength=0}Object.defineProperties(Cl.prototype,{orientedBoundingBox:{get:function(){return this._orientedBoundingBox}},renderBoundPlanes:{get:function(){return this._renderBoundPlanes}},boundingSphere:{get:function(){return this._boundingSphere}},boundTransform:{get:function(){return this._boundTransform}},shapeTransform:{get:function(){return this._shapeTransform}},shaderUniforms:{get:function(){return this._shaderUniforms}},shaderDefines:{get:function(){return this._shaderDefines}},shaderMaximumIntersectionsLength:{get:function(){return this._shaderMaximumIntersectionsLength}}});var uNt=new h,mNt=new h,hNt=new q,fNt=new h,pNt=new h;Cl.prototype.update=function(e,t,n,i,o){i=i??t.clone(fNt),o=o??n.clone(pNt),t=h.clone(t,this._minBounds),n=h.clone(n,this._maxBounds);let r=h.clamp(t,i,o,this._renderMinBounds),s=h.clamp(n,i,o,this._renderMaxBounds),a=P.getScale(e,mNt);if(r.x>s.x||r.y>s.y||r.z>s.z||(r.x===s.x)+(r.y===s.y)+(r.z===s.z)>=2||a.x===0||a.y===0||a.z===0)return!1;let c=this._renderBoundPlanes;c.get(0).distance=r.x,c.get(1).distance=r.y,c.get(2).distance=r.z,c.get(3).distance=-s.x,c.get(4).distance=-s.y,c.get(5).distance=-s.z,this._shapeTransform=P.clone(e,this._shapeTransform),this._orientedBoundingBox=$re(r,s,this._shapeTransform,this._orientedBoundingBox),this._boundTransform=P.fromRotationTranslation(this._orientedBoundingBox.halfAxes,this._orientedBoundingBox.center,this._boundTransform),this._boundingSphere=me.fromOrientedBoundingBox(this._orientedBoundingBox,this._boundingSphere);let d=this._shaderUniforms,u=this._shaderDefines;for(let y in u)u.hasOwnProperty(y)&&(u[y]=void 0);let m=0;u.BOX_INTERSECTION_INDEX=m,m+=1;let p=t,b=n,f=h.fromElements(Qre(p.x,b.x),Qre(p.y,b.y),Qre(p.z,b.z),d.boxLocalToShapeUvScale);return this._localToShapeUvTranslate=h.negate(h.multiplyComponents(f,p,this._localToShapeUvTranslate),this._localToShapeUvTranslate),this._shaderMaximumIntersectionsLength=m,!0};function Qre(e,t){return W.equalsEpsilon(e,t,W.EPSILON7)?1:1/(t-e)}var bNt=new P;Cl.prototype.updateViewTransforms=function(e){let t=this._shaderUniforms,n=P.inverse(this._shapeTransform,bNt),i=P.getMatrix3(n,t.boxEcToXyz),o=e.context.uniformState.inverseViewRotation;q.multiply(i,o,t.boxEcToXyz)};Cl.prototype.convertLocalToShapeUvSpace=function(e,t){let{boxLocalToShapeUvScale:n}=this._shaderUniforms,i=this._localToShapeUvTranslate;return h.add(h.multiplyComponents(e,n,t),i,t)};var OK=new h,qre=new h;Cl.prototype.computeOrientedBoundingBoxForTile=function(e,t,n,i,o){let r=this._minBounds,s=this._maxBounds,a=1/Math.pow(2,e),c=h.fromElements(W.lerp(r.x,s.x,a*t),W.lerp(r.y,s.y,a*n),W.lerp(r.z,s.z,a*i),OK),d=h.fromElements(W.lerp(r.x,s.x,a*(t+1)),W.lerp(r.y,s.y,a*(n+1)),W.lerp(r.z,s.z,a*(i+1)),qre);return $re(c,d,this._shapeTransform,o)};var uPe=new h;Cl.prototype.computeOrientedBoundingBoxForSample=function(e,t,n,i){let o=1/Math.pow(2,e.level),r=h.divideComponents(h.ONE,t,uPe),s=h.multiplyByScalar(r,o,uPe),a=h.multiplyByScalar(h.fromElements(e.x+n.x,e.y+n.y,e.z+n.z,OK),o,OK),c=h.add(a,s,qre),d=this._minBounds,u=this._maxBounds,m=h.fromElements(W.lerp(d.x,u.x,a.x),W.lerp(d.y,u.y,a.y),W.lerp(d.z,u.z,a.z),OK),p=h.fromElements(W.lerp(d.x,u.x,c.x),W.lerp(d.y,u.y,c.y),W.lerp(d.z,u.z,c.z),qre);return $re(m,p,this._shapeTransform,i)};Cl.DefaultMinBounds=Object.freeze(new h(-1,-1,-1));Cl.DefaultMaxBounds=Object.freeze(new h(1,1,1));var mPe=new h;function $re(e,t,n,i){let o=Cl.DefaultMinBounds,r=Cl.DefaultMaxBounds;if(h.equals(e,o)&&h.equals(t,r))i.center=P.getTranslation(n,i.center),i.halfAxes=P.getMatrix3(n,i.halfAxes);else{let a=P.getScale(n,mPe),c=h.midpoint(e,t,uNt);i.center=P.multiplyByPoint(n,c,i.center),a=h.fromElements(a.x*.5*(t.x-e.x),a.y*.5*(t.y-e.y),a.z*.5*(t.z-e.z),mPe);let d=P.getRotation(n,hNt);i.halfAxes=q.setScale(d,a,i.halfAxes)}return i}var yR=Cl;var XZo=x(T(),1);function um(){this._orientedBoundingBox=new nn,this._boundingSphere=new me,this._boundTransform=new P,this._shapeTransform=new P,this._minBounds=um.DefaultMinBounds.clone(),this._maxBounds=um.DefaultMaxBounds.clone();let{DefaultMinBounds:e,DefaultMaxBounds:t}=um,n=[new ta(h.negate(h.UNIT_Z,new h),e.z),new ta(h.UNIT_Z,-t.z)];this._renderBoundPlanes=new ay({planes:n}),this._localToShapeUvTranslate=new h,this._shaderUniforms={cameraShapePosition:new h,cylinderEcToRadialTangentUp:new q,cylinderRenderRadiusMinMax:new k,cylinderRenderAngleMinMax:new k,cylinderLocalToShapeUvScale:new h,cylinderShapeUvAngleRangeOrigin:0},this._shaderDefines={CYLINDER_HAS_SHAPE_BOUNDS_ANGLE:void 0,CYLINDER_HAS_RENDER_BOUNDS_RADIUS_MIN:void 0,CYLINDER_HAS_RENDER_BOUNDS_RADIUS_FLAT:void 0,CYLINDER_HAS_RENDER_BOUNDS_ANGLE:void 0,CYLINDER_HAS_RENDER_BOUNDS_ANGLE_RANGE_EQUAL_ZERO:void 0,CYLINDER_HAS_RENDER_BOUNDS_ANGLE_RANGE_UNDER_HALF:void 0,CYLINDER_HAS_RENDER_BOUNDS_ANGLE_RANGE_OVER_HALF:void 0,CYLINDER_INTERSECTION_INDEX_RADIUS_MAX:void 0,CYLINDER_INTERSECTION_INDEX_RADIUS_MIN:void 0,CYLINDER_INTERSECTION_INDEX_ANGLE:void 0},this._shaderMaximumIntersectionsLength=0}Object.defineProperties(um.prototype,{orientedBoundingBox:{get:function(){return this._orientedBoundingBox}},renderBoundPlanes:{get:function(){return this._renderBoundPlanes}},boundingSphere:{get:function(){return this._boundingSphere}},boundTransform:{get:function(){return this._boundTransform}},shapeTransform:{get:function(){return this._shapeTransform}},shaderUniforms:{get:function(){return this._shaderUniforms}},shaderDefines:{get:function(){return this._shaderDefines}},shaderMaximumIntersectionsLength:{get:function(){return this._shaderMaximumIntersectionsLength}}});var gNt=new h,yNt=new h,xNt=new h,TNt=new h,_Nt=new h,SNt=new P,ZNt=new h,hPe=new k;um.prototype.update=function(e,t,n,i,o){i=i??t.clone(yNt),o=o??n.clone(xNt),t=h.clone(t,this._minBounds),n=h.clone(n,this._maxBounds);let{DefaultMinBounds:r,DefaultMaxBounds:s}=um,a=s.y-r.y,c=.5*a,d=W.EPSILON10,u=W.EPSILON10;t.x=Math.max(0,t.x),n.x=Math.max(0,n.x),t.y=W.negativePiToPi(t.y),n.y=W.negativePiToPi(n.y),i.y=W.negativePiToPi(i.y),o.y=W.negativePiToPi(o.y);let m=h.maximumByComponent(t,i,TNt),p=h.minimumByComponent(n,o,_Nt),b=P.getScale(e,gNt);if(p.x===0||m.x>p.x||m.z>p.z||W.equalsEpsilon(b.x,0,void 0,d)||W.equalsEpsilon(b.y,0,void 0,d)||W.equalsEpsilon(b.z,0,void 0,d))return!1;let f=this._renderBoundPlanes;f.get(0).distance=m.z,f.get(1).distance=-p.z,this._shapeTransform=P.clone(e,this._shapeTransform),this._orientedBoundingBox=nse(m,p,this._shapeTransform,this._orientedBoundingBox),this._boundTransform=P.fromRotationTranslation(this._orientedBoundingBox.halfAxes,this._orientedBoundingBox.center,this._boundTransform),this._boundingSphere=me.fromOrientedBoundingBox(this._orientedBoundingBox,this._boundingSphere);let y=n.y<t.y,_=n.y-t.y+y*a,S=p.y<m.y,Z=p.y-m.y+S*a,R=Z>=c-u&&Z<a-u,C=Z>u&&Z<c-u,E=Z<=u,A=R||C||E,L=this._shaderUniforms,F=this._shaderDefines;for(let K in F)F.hasOwnProperty(K)&&(F[K]=void 0);let I=0;F.CYLINDER_INTERSECTION_INDEX_RADIUS_MAX=I,I+=1,_<a-u&&(F.CYLINDER_HAS_SHAPE_BOUNDS_ANGLE=!0),m.x!==r.x&&(F.CYLINDER_HAS_RENDER_BOUNDS_RADIUS_MIN=!0,F.CYLINDER_INTERSECTION_INDEX_RADIUS_MIN=I,I+=1),L.cylinderRenderRadiusMinMax=k.fromElements(m.x,p.x,L.cylinderRenderRadiusMinMax),m.x===p.x&&(F.CYLINDER_HAS_RENDER_BOUNDS_RADIUS_FLAT=!0);let N=n.x-t.x,g=0,V=1;N!==0&&(g=1/N,V=-t.x*g);let G=n.z-t.z,v=0,X=1;G!==0&&(v=1/G,X=-t.z*v),A&&(F.CYLINDER_HAS_RENDER_BOUNDS_ANGLE=!0,F.CYLINDER_INTERSECTION_INDEX_ANGLE=I,R?(F.CYLINDER_HAS_RENDER_BOUNDS_ANGLE_RANGE_UNDER_HALF=!0,I+=1):C?(F.CYLINDER_HAS_RENDER_BOUNDS_ANGLE_RANGE_OVER_HALF=!0,I+=2):E&&(F.CYLINDER_HAS_RENDER_BOUNDS_ANGLE_RANGE_EQUAL_ZERO=!0,I+=2),L.cylinderRenderAngleMinMax=k.fromElements(m.y,p.y,L.cylinderRenderAngleMinMax));let Y=(t.y-r.y)/a,D=(n.y-r.y)/a,M=1-_/a,O=(D+.5*M)%1;L.cylinderShapeUvAngleRangeOrigin=O;let w=0,z=1;if(_>u){w=a/_;let K=Y-O;z=-w*(K-Math.floor(K))}return L.cylinderLocalToShapeUvScale=h.fromElements(g,w,v,L.cylinderLocalToShapeUvScale),this._localToShapeUvTranslate=h.fromElements(V,z,X,this._localToShapeUvTranslate),this._shaderMaximumIntersectionsLength=I,!0};var RNt=new q,CNt=new q,VNt=new P;um.prototype.updateViewTransforms=function(e){let t=this._shaderUniforms,n=P.inverse(this._shapeTransform,SNt),i=P.multiplyByPoint(n,e.camera.positionWC,ZNt);t.cameraShapePosition=h.fromElements(k.magnitude(i),Math.atan2(i.y,i.x),i.z,t.cameraShapePosition);let o=k.normalize(k.fromCartesian3(i,hPe),hPe),r=q.fromRowMajorArray([o.x,o.y,0,-o.y,o.x,0,0,0,1],RNt),s=e.context.uniformState.inverseView,a=P.multiplyTransformation(n,s,VNt),c=P.getMatrix3(a,CNt);t.cylinderEcToRadialTangentUp=q.multiply(r,c,t.cylinderEcToRadialTangentUp)};um.prototype.convertLocalToShapeUvSpace=function(e,t){let n=Math.hypot(e.x,e.y),i=Math.atan2(e.y,e.x),o=e.z,{cylinderLocalToShapeUvScale:r,cylinderShapeUvAngleRangeOrigin:s}=this._shaderUniforms,a=this._localToShapeUvTranslate;return n=n*r.x+a.x,i=(i+Math.PI)/(2*Math.PI),i-=s,i=i-Math.floor(i),i=i*r.y+a.y,o=o*r.z+a.z,h.fromElements(n,i,o,t)};var BK=new h,tse=new h;um.prototype.computeOrientedBoundingBoxForTile=function(e,t,n,i,o){let r=this._minBounds,s=this._maxBounds,a=1/Math.pow(2,e),c=h.fromElements(W.lerp(r.x,s.x,t*a),W.lerp(r.y,s.y,n*a),W.lerp(r.z,s.z,i*a),BK),d=h.fromElements(W.lerp(r.x,s.x,(t+1)*a),W.lerp(r.y,s.y,(n+1)*a),W.lerp(r.z,s.z,(i+1)*a),tse);return nse(c,d,this._shapeTransform,o)};var fPe=new h;um.prototype.computeOrientedBoundingBoxForSample=function(e,t,n,i){let o=1/Math.pow(2,e.level),r=h.divideComponents(h.ONE,t,fPe),s=h.multiplyByScalar(r,o,fPe),a=h.multiplyByScalar(h.fromElements(e.x+n.x,e.y+n.y,e.z+n.z,BK),o,BK),c=h.add(a,s,tse),d=this._minBounds,u=this._maxBounds,m=h.fromElements(W.lerp(d.x,u.x,a.x),W.lerp(d.y,u.y,a.y),W.lerp(d.z,u.z,a.z),BK),p=h.fromElements(W.lerp(d.x,u.x,c.x),W.lerp(d.y,u.y,c.y),W.lerp(d.z,u.z,c.z),tse);return nse(m,p,this._shapeTransform,i)};um.DefaultMinBounds=Object.freeze(new h(0,-W.PI,-1));um.DefaultMaxBounds=Object.freeze(new h(1,+W.PI,1));var ENt=5,ANt=new Array(ENt),GNt=new h,LNt=new q,WNt=new P,vNt=new P,FNt=new P,ese=new P,INt=new h,PNt=new h,XNt=new h,bPe=new Array(8);for(let e=0;e<8;e++)bPe[e]=new h;function pPe(e,t,n){return Math.abs(ce.dot(e,t))<n}function NNt(e){let t=P.getColumn(e,0,INt),n=P.getColumn(e,1,PNt),i=P.getColumn(e,2,XNt),o=W.EPSILON4;return pPe(t,n,o)&&pPe(n,i,o)}function YNt(e,t){let n=bPe;h.fromElements(-.5,-.5,-.5,n[0]),h.fromElements(-.5,-.5,.5,n[1]),h.fromElements(-.5,.5,-.5,n[2]),h.fromElements(-.5,.5,.5,n[3]),h.fromElements(.5,-.5,-.5,n[4]),h.fromElements(.5,-.5,.5,n[5]),h.fromElements(.5,.5,-.5,n[6]),h.fromElements(.5,.5,.5,n[7]);for(let i=0;i<8;++i)P.multiplyByPoint(e,n[i],n[i]);return nn.fromPoints(n,t)}var MNt=new h;function nse(e,t,n,i){let o=e.x,r=t.x,s=e.y,a=t.y<s?t.y+W.TWO_PI:t.y,c=e.z,d=t.z,u=a-s,m=s+u*.5,p=ANt,b=0;p[b++]=s,p[b++]=a,p[b++]=m,u>W.PI&&(p[b++]=m-W.PI_OVER_TWO,p[b++]=m+W.PI_OVER_TWO);let f=Number.POSITIVE_INFINITY,y=Number.POSITIVE_INFINITY,_=Number.NEGATIVE_INFINITY,S=Number.NEGATIVE_INFINITY;for(let Y=0;Y<b;++Y){let D=p[Y]-m,M=Math.cos(D),O=Math.sin(D),w=M*o,z=O*o,K=M*r,te=O*r;f=Math.min(f,w,K),y=Math.min(y,z,te),_=Math.max(_,w,K),S=Math.max(S,z,te)}let Z=_-f,R=S-y,C=d-c,E=(f+_)*.5,A=(y+S)*.5,L=(c+d)*.5,F=h.fromElements(E,A,L,GNt),I=q.fromRotationZ(m,LNt),N=h.fromElements(Z,R,C,MNt),g=P.fromScale(N,FNt),V=P.fromRotation(I,vNt),G=P.fromTranslation(F,WNt),v=P.multiplyTransformation(V,P.multiplyTransformation(G,g,ese),ese),X=P.multiplyTransformation(n,v,ese);return NNt(X)?nn.fromTransformation(X,i):YNt(X,i)}var xR=um;var jZo=x(T(),1);function Ch(){this._orientedBoundingBox=new nn,this._boundingSphere=new me,this._boundTransform=new P,this._shapeTransform=new P,this._rectangle=new re,this._minimumHeight=Ch.DefaultMinBounds.z,this._maximumHeight=Ch.DefaultMaxBounds.z,this._ellipsoid=new ne,this._translation=new h,this._rotation=new q,this._localToShapeUvTranslate=new h,this._shaderUniforms={cameraPositionCartographic:new h,ellipsoidEcToEastNorthUp:new q,ellipsoidRadii:new h,eccentricitySquared:0,evoluteScale:new k,ellipsoidCurvatureAtLatitude:new k,ellipsoidInverseRadiiSquared:new h,ellipsoidRenderLongitudeMinMax:new k,ellipsoidShapeUvLongitudeRangeOrigin:0,ellipsoidShapeUvLongitudeMinMaxMid:new h,ellipsoidLocalToShapeUvScale:new h,ellipsoidRenderLatitudeSinMinMax:new k,clipMinMaxHeight:new k},this._shaderDefines={ELLIPSOID_HAS_RENDER_BOUNDS_LONGITUDE:void 0,ELLIPSOID_HAS_RENDER_BOUNDS_LONGITUDE_RANGE_EQUAL_ZERO:void 0,ELLIPSOID_HAS_RENDER_BOUNDS_LONGITUDE_RANGE_UNDER_HALF:void 0,ELLIPSOID_HAS_RENDER_BOUNDS_LONGITUDE_RANGE_OVER_HALF:void 0,ELLIPSOID_HAS_SHAPE_BOUNDS_LONGITUDE:void 0,ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MAX_UNDER_HALF:void 0,ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MAX_EQUAL_HALF:void 0,ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MAX_OVER_HALF:void 0,ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MIN_UNDER_HALF:void 0,ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MIN_EQUAL_HALF:void 0,ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MIN_OVER_HALF:void 0,ELLIPSOID_HAS_SHAPE_BOUNDS_LATITUDE:void 0,ELLIPSOID_INTERSECTION_INDEX_LONGITUDE:void 0,ELLIPSOID_INTERSECTION_INDEX_LATITUDE_MAX:void 0,ELLIPSOID_INTERSECTION_INDEX_LATITUDE_MIN:void 0,ELLIPSOID_INTERSECTION_INDEX_HEIGHT_MAX:void 0,ELLIPSOID_INTERSECTION_INDEX_HEIGHT_MIN:void 0},this._shaderMaximumIntersectionsLength=0}Object.defineProperties(Ch.prototype,{orientedBoundingBox:{get:function(){return this._orientedBoundingBox}},boundingSphere:{get:function(){return this._boundingSphere}},boundTransform:{get:function(){return this._boundTransform}},shapeTransform:{get:function(){return this._shapeTransform}},shaderUniforms:{get:function(){return this._shaderUniforms}},shaderDefines:{get:function(){return this._shaderDefines}},shaderMaximumIntersectionsLength:{get:function(){return this._shaderMaximumIntersectionsLength}}});var wNt=new h,kNt=new h,UNt=new h,DNt=new h,ONt=new h,BNt=new h,zNt=new h,HNt=new h,gPe=new h,yPe=new h,KNt=new re;Ch.prototype.update=function(e,t,n,i,o){let{DefaultMinBounds:r,DefaultMaxBounds:s}=Ch;i=i??r,o=o??s;let a=W.EPSILON10,c=W.EPSILON10,d=W.EPSILON10,u=W.EPSILON3,m=P.getScale(e,HNt),p=h.clone(r,wNt);p.z=-h.minimumComponent(m);let b=h.clamp(t,p,s,kNt),f=h.clamp(n,p,s,UNt),y=h.clamp(i,p,s,DNt),_=h.clamp(o,p,s,ONt),S=h.maximumByComponent(b,y,BNt),Z=h.minimumByComponent(f,_,zNt),R=h.add(m,h.fromElements(f.z,f.z,f.z,gPe),gPe),C=h.add(m,h.fromElements(Z.z,Z.z,Z.z,yPe),yPe);if(S.y>Z.y||S.y===s.y||Z.y===r.y||S.z>Z.z||W.equalsEpsilon(C,h.ZERO,void 0,a))return!1;this._rectangle=re.fromRadians(b.x,b.y,f.x,f.y),this._translation=P.getTranslation(e,this._translation),this._rotation=P.getRotation(e,this._rotation),this._ellipsoid=ne.fromCartesian3(m,this._ellipsoid),this._minimumHeight=b.z,this._maximumHeight=f.z;let E=re.fromRadians(S.x,S.y,Z.x,Z.y,KNt);this._orientedBoundingBox=ise(E,S.z,Z.z,this._ellipsoid,this._translation,this._rotation,this._orientedBoundingBox),this._shapeTransform=P.fromRotationTranslation(this._rotation,this._translation,this._shapeTransform),this._boundTransform=P.fromRotationTranslation(this._orientedBoundingBox.halfAxes,this._orientedBoundingBox.center,this._boundTransform),this._boundingSphere=me.fromOrientedBoundingBox(this._orientedBoundingBox,this._boundingSphere);let A=s.x-r.x,L=.5*A,F=Z.x<S.x,I=Z.x-S.x+F*A,N=I<=c,g=I>=L-c&&I<A-c,V=I>c&&I<L-c,G=N||g||V,v=f.x<b.x,X=f.x-b.x+v*A,Y=X>L+c&&X<A-c,D=X>=L-c&&X<=L+c,M=X<L-c,O=Y||D||M,w=Z.y<-u,z=Z.y>=-u&&Z.y<=+u,K=Z.y>+u&&Z.y<s.y-d,te=w||z||K,H=S.y>r.y+d&&S.y<-u,$=S.y>=-u&&S.y<=+u,ee=S.y>+u,le=H||$||ee,_e=te||le,he=f.y-b.y,Ze=f.y<-u,ye=f.y>=-u&&f.y<=+u,Ge=f.y>+u&&f.y<s.y-d,Ae=Ze||ye||Ge,Fe=b.y>r.y+d&&b.y<-u,tt=b.y>=-u&&b.y<=+u,Be=b.y>+u,qe=Ae||(Fe||tt||Be),We=this._shaderUniforms,Ke=this._shaderDefines;for(let jn in Ke)Ke.hasOwnProperty(jn)&&(Ke[jn]=void 0);We.ellipsoidRadii=h.clone(R,We.ellipsoidRadii);let{x:ct,z:Et}=We.ellipsoidRadii,zt=Et/ct;We.eccentricitySquared=1-zt*zt,We.evoluteScale=k.fromElements((ct*ct-Et*Et)/ct,(Et*Et-ct*ct)/Et,We.evoluteScale),We.ellipsoidInverseRadiiSquared=h.divideComponents(h.ONE,h.multiplyComponents(We.ellipsoidRadii,We.ellipsoidRadii,We.ellipsoidInverseRadiiSquared),We.ellipsoidInverseRadiiSquared);let ut=0;Ke.ELLIPSOID_INTERSECTION_INDEX_HEIGHT_MAX=ut,ut+=1,Ke.ELLIPSOID_INTERSECTION_INDEX_HEIGHT_MIN=ut,ut+=1,We.clipMinMaxHeight=k.fromElements(S.z-f.z,Z.z-f.z,We.clipMinMaxHeight);let bt=f.z-b.z,ht=bt===0?0:1/bt;G&&(Ke.ELLIPSOID_HAS_RENDER_BOUNDS_LONGITUDE=!0,Ke.ELLIPSOID_INTERSECTION_INDEX_LONGITUDE=ut,g?(Ke.ELLIPSOID_HAS_RENDER_BOUNDS_LONGITUDE_RANGE_UNDER_HALF=!0,ut+=1):V?(Ke.ELLIPSOID_HAS_RENDER_BOUNDS_LONGITUDE_RANGE_OVER_HALF=!0,ut+=2):N&&(Ke.ELLIPSOID_HAS_RENDER_BOUNDS_LONGITUDE_RANGE_EQUAL_ZERO=!0,ut+=2),We.ellipsoidRenderLongitudeMinMax=k.fromElements(S.x,Z.x,We.ellipsoidRenderLongitudeMinMax));let jt=0,st=1;if(O){Ke.ELLIPSOID_HAS_SHAPE_BOUNDS_LONGITUDE=!0;let jn=(b.x-r.x)/A,Si=(f.x-r.x)/A,Hi=1-X/A,Gi=(Si+.5*Hi)%1;if(We.ellipsoidShapeUvLongitudeRangeOrigin=Gi,X>c){jt=A/X;let pi=jn-Gi;st=-jt*(pi-Math.floor(pi))}}_e&&(le&&(Ke.ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MIN=!0,Ke.ELLIPSOID_INTERSECTION_INDEX_LATITUDE_MIN=ut,H?(Ke.ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MIN_UNDER_HALF=!0,ut+=1):$?(Ke.ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MIN_EQUAL_HALF=!0,ut+=1):ee&&(Ke.ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MIN_OVER_HALF=!0,ut+=2)),te&&(Ke.ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MAX=!0,Ke.ELLIPSOID_INTERSECTION_INDEX_LATITUDE_MAX=ut,w?(Ke.ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MAX_UNDER_HALF=!0,ut+=2):z?(Ke.ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MAX_EQUAL_HALF=!0,ut+=1):K&&(Ke.ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MAX_OVER_HALF=!0,ut+=1)),We.ellipsoidRenderLatitudeSinMinMax=k.fromElements(Math.sin(S.y),Math.sin(Z.y),We.ellipsoidRenderLatitudeSinMinMax));let pt=0,Mi=1;return qe&&(Ke.ELLIPSOID_HAS_SHAPE_BOUNDS_LATITUDE=!0,he>d&&(pt=(s.y-r.y)/he,Mi=(r.y-b.y)/he)),We.ellipsoidLocalToShapeUvScale=h.fromElements(jt,pt,ht,We.ellipsoidLocalToShapeUvScale),this._localToShapeUvTranslate=h.fromElements(st,Mi,0,this._localToShapeUvTranslate),this._shaderMaximumIntersectionsLength=ut,!0};var JNt=new pe,jNt=new h,QNt=new P,xPe=new q;Ch.prototype.updateViewTransforms=function(e){let t=this._shaderUniforms,n=this._ellipsoid,i=e.camera.positionWC,o=n.cartesianToCartographic(i,JNt);h.fromElements(o.longitude,o.latitude,o.height,t.cameraPositionCartographic);let r=h.fromRadians(o.longitude,o.latitude,0,n,jNt);t.ellipsoidCurvatureAtLatitude=n.getLocalCurvature(r,t.ellipsoidCurvatureAtLatitude);let s=_t.eastNorthUpToFixedFrame(r,n,QNt),a=P.getRotation(s,xPe),c=e.context.uniformState.viewRotation,d=q.multiply(c,a,xPe);t.ellipsoidEcToEastNorthUp=q.transpose(d,t.ellipsoidEcToEastNorthUp)};var VPe=new re;Ch.prototype.computeOrientedBoundingBoxForTile=function(e,t,n,i,o){let r=1/Math.pow(2,e),s=t*r,a=(t+1)*r,c=n*r,d=(n+1)*r,u=i*r,m=(i+1)*r,p=re.subsection(this._rectangle,s,c,a,d,VPe),b=W.lerp(this._minimumHeight,this._maximumHeight,u),f=W.lerp(this._minimumHeight,this._maximumHeight,m);return ise(p,b,f,this._ellipsoid,this._translation,this._rotation,o)};var qNt=new k,$Nt=new k,zk=new k,TPe=new k,_Pe=new k,Hk=new k;function eYt(e,t,n,i){let o=k.abs(e,qNt),r=k.fromElements(1/t.x,1/t.y,$Nt),s=k.fromElements(Math.SQRT1_2,Math.SQRT1_2,zk),a=k.multiplyComponents(t,s,TPe),c=k.fromElements(n.x*s.x*s.x*s.x,n.y*s.y*s.y*s.y,_Pe);for(let d=0;d<3;++d){let u=k.magnitude(k.subtract(a,c,Hk)),m=k.normalize(k.subtract(o,c,Hk),Hk),p=k.multiplyByScalar(m,u,Hk);s=k.multiplyComponents(k.add(p,c,zk),r,zk),s=k.normalize(k.clamp(s,k.ZERO,k.ONE,zk),zk),a=k.multiplyComponents(t,s,TPe),c=k.fromElements(n.x*s.x*s.x*s.x,n.y*s.y*s.y*s.y,_Pe)}return h.fromElements(Math.sign(e.x)*a.x,Math.sign(e.y)*a.y,k.magnitude(k.subtract(a,c,Hk)),i)}var tYt=new k,SPe=new k,nYt=new h,ZPe=new k;Ch.prototype.convertLocalToShapeUvSpace=function(e,t){let n=Math.atan2(e.y,e.x),{ellipsoidRadii:i,evoluteScale:o,ellipsoidInverseRadiiSquared:r,ellipsoidShapeUvLongitudeRangeOrigin:s,ellipsoidLocalToShapeUvScale:a}=this._shaderUniforms,c=this._localToShapeUvTranslate,d=Math.hypot(e.x,e.y),u=k.fromElements(d,e.z,SPe),m=eYt(u,k.fromElements(i.x,i.z,tYt),o,nYt),p=k.normalize(k.fromElements(m.x*r.x,m.y*r.z,ZPe),ZPe),b=Math.atan2(p.y,p.x),f=k.magnitude(u)<k.magnitude(m)?-1:1,y=k.subtract(u,m,SPe),_=f*k.magnitude(y),{ELLIPSOID_HAS_SHAPE_BOUNDS_LONGITUDE:S,ELLIPSOID_HAS_SHAPE_BOUNDS_LATITUDE:Z}=this._shaderDefines;return n=(n+Math.PI)/(2*Math.PI),l(S)&&(n-=s,n=n-Math.floor(n),n=n*a.x+c.x),b=(b+Math.PI/2)/Math.PI,l(Z)&&(b=b*a.y+c.y),_=1+_*a.z,h.fromElements(n,b,_,t)};var RPe=new h,CPe=new h,iYt=new h;Ch.prototype.computeOrientedBoundingBoxForSample=function(e,t,n,i){let o=1/Math.pow(2,e.level),r=h.divideComponents(h.ONE,t,RPe),s=h.multiplyByScalar(r,o,RPe),a=h.multiplyByScalar(h.fromElements(e.x+n.x,e.y+n.y,e.z+n.z,CPe),o,CPe),c=h.add(a,s,iYt),d=re.subsection(this._rectangle,a.x,a.y,c.x,c.y,VPe),u=W.lerp(this._minimumHeight,this._maximumHeight,a.z),m=W.lerp(this._minimumHeight,this._maximumHeight,c.z);return ise(d,u,m,this._ellipsoid,this._translation,this._rotation,i)};function ise(e,t,n,i,o,r,s){return s=nn.fromRectangle(e,t,n,i,s),s.center=h.add(s.center,o,s.center),s.halfAxes=q.multiply(s.halfAxes,r,s.halfAxes),s}Ch.DefaultMinBounds=Object.freeze(new h(-W.PI,-W.PI_OVER_TWO,-ne.WGS84.minimumRadius));Ch.DefaultMaxBounds=Object.freeze(new h(W.PI,W.PI_OVER_TWO,10*ne.WGS84.maximumRadius));var TR=Ch;var lu={BOX:"BOX",ELLIPSOID:"ELLIPSOID",CYLINDER:"CYLINDER"};lu.getMinBounds=function(e){switch(e){case lu.BOX:return yR.DefaultMinBounds;case lu.ELLIPSOID:return TR.DefaultMinBounds;case lu.CYLINDER:return xR.DefaultMinBounds}};lu.getMaxBounds=function(e){switch(e){case lu.BOX:return yR.DefaultMaxBounds;case lu.ELLIPSOID:return TR.DefaultMaxBounds;case lu.CYLINDER:return xR.DefaultMaxBounds}};lu.getShapeConstructor=function(e){switch(e){case lu.BOX:return yR;case lu.ELLIPSOID:return TR;case lu.CYLINDER:return xR}};Object.freeze(lu);var _c=lu;var qRo=x(T(),1);var rRo=x(T(),1);function op(e){this._comparator=e.comparator,this._maximumLength=e.maximumLength,this._array=l(e.maximumLength)?new Array(e.maximumLength):[],this._length=0}Object.defineProperties(op.prototype,{length:{get:function(){return this._length}},maximumLength:{get:function(){return this._maximumLength},set:function(e){if(l(e)){for(;this._length>e;)this.removeMinimum();this._array.length=e}this._maximumLength=e}},internalArray:{get:function(){return this._array}},comparator:{get:function(){return this._comparator}}});op.prototype.clone=function(){let e=this._maximumLength,t=this._comparator,n=this._array,i=this._length,o=new op({comparator:t,maximumLength:e});o._length=i;for(let r=0;r<i;r++)o._array[r]=n[r];return o};op.prototype.reset=function(){this._length=0;let e=this._maximumLength;if(l(e))for(let t=0;t<e;t++)this._array[t]=void 0;else this._array.length=0};op.prototype.resort=function(){let e=this._length;for(let t=0;t<e;t++)EPe(this,t)};op.prototype.insert=function(e){let t,n=this._maximumLength;if(l(n)){if(n===0)return;if(this._length===n){let o=this._array[0];if(this._comparator(e,o)<=0)return e;t=this.removeMinimum()}}let i=this._length;return this._array[i]=e,this._length++,EPe(this,i),t};op.prototype.removeMinimum=function(){let e=this._length;if(e===0)return;this._length--;let t=this._array[0];return e>=2&&(this._array[0]=this._array[e-1],APe(this,0)),this._array[e-1]=void 0,t};op.prototype.removeMaximum=function(){let e=this._length;if(e===0)return;this._length--;let t;if(e<=2)t=this._array[e-1];else{let n=ose(this,1,2)?1:2;t=this._array[n],this._array[n]=this._array[e-1],e>=4&&APe(this,n)}return this._array[e-1]=void 0,t};op.prototype.getMinimum=function(){if(this._length!==0)return this._array[0]};op.prototype.getMaximum=function(){let e=this._length;if(e!==0)return e<=2?this._array[e-1]:this._array[ose(this,1,2)?1:2]};function zK(e,t,n){let i=e._array,o=i[t];i[t]=i[n],i[n]=o}function Kk(e,t,n){return e._comparator(e._array[t],e._array[n])<0}function ose(e,t,n){return e._comparator(e._array[t],e._array[n])>0}function EPe(e,t){if(t===0)return;let n=Math.floor(W.log2(t+1))%2===0,i=Math.floor((t-1)/2),o=Kk(e,t,i);for(o!==n&&(zK(e,t,i),t=i);t>=3;){let r=Math.floor((t-3)/4);if(Kk(e,t,r)!==o)break;zK(e,t,r),t=r}}function APe(e,t){let n=e._length,i=Math.floor(W.log2(t+1))%2===0,o;for(;(o=2*t+1)<n;){let r=o,s=o+1;if(s<n){Kk(e,s,r)===i&&(r=s);let a=2*o+1,c=Math.max(Math.min(n-a,4),0);for(let d=0;d<c;d++){let u=a+d;Kk(e,u,r)===i&&(r=u)}}if(Kk(e,r,t)===i&&(zK(e,r,t),r!==o&&r!==s)){let a=Math.floor((r-1)/2);ose(e,r,a)===i&&zK(e,r,a)}t=r}}var ly=op;var aRo=x(T(),1),rse=Object.freeze({UNLOADED:0,RECEIVING:1,PROCESSING:2,LOADED:3,FAILED:4,UNAVAILABLE:5});function Jk(e,t){this.spatialNode=e,this.keyframe=t,this.state=rse.UNLOADED,this.content=void 0,this.megatextureIndex=-1,this.priority=-Number.MAX_VALUE,this.highPriorityFrameNumber=-1}Jk.prototype.unload=function(){this.content=this.content&&this.content.destroy(),this.spatialNode=void 0,this.state=rse.UNLOADED,this.megatextureIndex=-1,this.priority=-Number.MAX_VALUE,this.highPriorityFrameNumber=-1};Jk.priorityComparator=function(e,t){return e.priority-t.priority};Jk.searchComparator=function(e,t){return e.keyframe-t.keyframe};Jk.LoadState=rse;var zo=Jk;var ZRo=x(T(),1);function k0(e,t,n,i,o=134217728,r){let s=oYt(i),a=rYt(n),c=n*Nt.getSizeInBytes(i),d=k0.get3DTextureDimension(t,c,o,r),u=h.divideComponents(d,t,new h);this.channelCount=n,this.componentType=i,this.textureMemoryByteLength=c*d.x*d.y*d.z,this.tileCounts=h.clone(u,new h),this.voxelCountPerTile=h.clone(t,new h),this.maximumTileCount=u.x*u.y*u.z,this.texture=new Sv({context:e,pixelFormat:a,pixelDatatype:s,flipY:!1,width:d.x,height:d.y,depth:d.z,sampler:new Ot({wrapR:pn.CLAMP_TO_EDGE,wrapS:pn.CLAMP_TO_EDGE,wrapT:pn.CLAMP_TO_EDGE,minificationFilter:Ht.LINEAR,magnificationFilter:$n.LINEAR})}),this.nodes=new Array(this.maximumTileCount);for(let m=0;m<this.maximumTileCount;m++)this.nodes[m]=new sYt(m);for(let m=0;m<this.maximumTileCount;m++){let p=this.nodes[m];p.previousNode=m>0?this.nodes[m-1]:void 0,p.nextNode=m<this.maximumTileCount-1?this.nodes[m+1]:void 0}this.occupiedList=void 0,this.emptyList=this.nodes[0],this.occupiedCount=0,this._nearestSampling=!1}Object.defineProperties(k0.prototype,{nearestSampling:{get:function(){return this._nearestSampling},set:function(e){this._nearestSampling!==e&&(e?this.texture.sampler=Ot.NEAREST:this.texture.sampler=new Ot({wrapR:pn.CLAMP_TO_EDGE,wrapS:pn.CLAMP_TO_EDGE,wrapT:pn.CLAMP_TO_EDGE,minificationFilter:Ht.LINEAR,magnificationFilter:$n.LINEAR}),this._nearestSampling=e)}}});function oYt(e){if(e===Nt.FLOAT32||e===Nt.FLOAT64)return Ue.FLOAT;if(e===Nt.UINT8)return Ue.UNSIGNED_BYTE}function rYt(e){switch(e){case 1:return Qe.RED;case 2:return Qe.RG;case 3:return Qe.RGB;case 4:return Qe.RGBA}}function sYt(e){this.index=e,this.nextNode=void 0,this.previousNode=void 0}k0.prototype.add=function(e){if(this.isFull())throw new ge("Trying to add when there are no empty spots");let t=this.emptyList;this.emptyList=this.emptyList.nextNode,l(this.emptyList)&&(this.emptyList.previousNode=void 0),t.nextNode=this.occupiedList,l(t.nextNode)&&(t.nextNode.previousNode=t),this.occupiedList=t;let n=t.index;return this.writeDataToTexture(n,e),this.occupiedCount++,n};k0.prototype.remove=function(e){if(e<0||e>=this.maximumTileCount)throw new ge("Megatexture index out of bounds");let t=this.nodes[e];l(t.previousNode)&&(t.previousNode.nextNode=t.nextNode),l(t.nextNode)&&(t.nextNode.previousNode=t.previousNode),t.nextNode=this.emptyList,l(t.nextNode)&&(t.nextNode.previousNode=t),t.previousNode=void 0,this.emptyList=t,this.occupiedCount--};k0.prototype.isFull=function(){return this.emptyList===void 0};k0.get3DTextureDimension=function(e,t,n,i){let{maximum3DTextureSize:o}=wt;if(h.maximumComponent(e)>o)throw new ae("The GL context does not support a 3D texture large enough to contain a tile with the given dimensions.");let r=t*e.x*e.y*e.z,s=Math.floor(n/r);if(s<1)throw new ae("Not enough texture memory available to create a megatexture with the given tile dimensions.");l(i)?i=Math.min(i,s):i=s;let a=Object.entries(e).sort((u,m)=>m[1]-u[1]),c=a.map(([u,m])=>Math.floor(o/m));for(let u=0;u<3;u++){let m=GPe(c);if(m<i)break;let p=c.slice();p.splice(u,1);let b=p[0]*p[1],f=m-i,y=Math.floor(f/b);c[u]-=y}GPe(c)>s&&(c[2]=Math.floor(s/(c[0]*c[1])));let d=new h;for(let u=0;u<3;u++){let[m,p]=a[u];d[m]=c[u]*p}return d};function GPe(e){return e.reduce((t,n)=>t*n)}k0.prototype.writeDataToTexture=function(e,t){let{tileCounts:n,voxelCountPerTile:i}=this,o={arrayBufferView:t,width:i.x,height:i.y,depth:i.z},r=n.x*n.y,s=Math.floor(e/r),a=e-s*r,c=Math.floor(a/n.x),d=a-c*n.x,u={source:o,xOffset:d*i.x,yOffset:c*i.y,zOffset:s*i.z};this.texture.copyFrom(u)};k0.prototype.isDestroyed=function(){return!1};k0.prototype.destroy=function(){return this.texture=this.texture&&this.texture.destroy(),ue(this)};var jk=k0;var FRo=x(T(),1);function Vh(e,t,n,i,o,r,s){this.children=void 0,this.parent=o,this.level=e,this.x=t,this.y=n,this.z=i,this.dimensions=h.clone(s),this.keyframeNodes=[],this.renderableKeyframeNodes=[],this.renderableKeyframeNodeLerp=0,this.renderableKeyframeNodePrevious=void 0,this.renderableKeyframeNodeNext=void 0,this.orientedBoundingBox=new nn,this.approximateVoxelSize=0,this.screenSpaceError=0,this.visitedFrameNumber=-1,this.computeBoundingVolumes(r)}var aYt=new h;Vh.prototype.computeBoundingVolumes=function(e){this.orientedBoundingBox=e.computeOrientedBoundingBoxForTile(this.level,this.x,this.y,this.z,this.orientedBoundingBox);let t=q.getScale(this.orientedBoundingBox.halfAxes,aYt),n=2*h.maximumComponent(t);this.approximateVoxelSize=n/h.minimumComponent(this.dimensions)};Vh.prototype.constructChildNodes=function(e){let{level:t,x:n,y:i,z:o}=this,r=n*2,s=i*2,a=o*2,c=s+1,d=r+1,u=a+1,m=t+1,p=[[m,r,s,a],[m,d,s,a],[m,r,c,a],[m,d,c,a],[m,r,s,u],[m,d,s,u],[m,r,c,u],[m,d,c,u]];this.children=p.map(([b,f,y,_])=>new Vh(b,f,y,_,this,e,this.dimensions))};Vh.prototype.visibility=function(e,t){let n=this.orientedBoundingBox;return e.cullingVolume.computeVisibilityWithPlaneMask(n,t)};Vh.prototype.computeScreenSpaceError=function(e,t){let n=this.orientedBoundingBox,i=Math.sqrt(n.distanceSquaredTo(e));i=Math.max(i,W.EPSILON7);let o=this.approximateVoxelSize,r=t*(o/i);this.screenSpaceError=r};var LPe={keyframe:0};function Qk(e,t){return LPe.keyframe=e,Eo(t,LPe,zo.searchComparator)}Vh.prototype.computeSurroundingRenderableKeyframeNodes=function(e){let t=this,n=t.level,i=Math.floor(e),o=Math.ceil(e),r,s,a=+Number.MAX_VALUE,c=+Number.MAX_VALUE;for(;l(t);){let{renderableKeyframeNodes:m}=t;if(m.length>=1){let p=cYt(i,m),b=m[p],f=o===i||i<b.keyframe?p:Math.min(p+1,m.length-1),y=m[f],_=i-b.keyframe,S=WPe(n-t.level,_);S<a&&(a=S,r=b);let Z=y.keyframe-o,R=WPe(n-t.level,Z);if(R<c&&(c=R,s=y),_===0&&Z===0)break}t=t.parent}if(this.renderableKeyframeNodePrevious=r,this.renderableKeyframeNodeNext=s,!l(r)||!l(s))return;let d=r.keyframe,u=s.keyframe;this.renderableKeyframeNodeLerp=d===u?0:W.clamp((e-d)/(u-d),0,1)};function cYt(e,t){let n=Qk(e,t);return n<0?W.clamp(~n-1,0,t.length-1):n}function WPe(e,t){let n=Math.exp(e*4),i=t>=0?1:-200;return e*n+t*i}Vh.prototype.isVisited=function(e){return this.visitedFrameNumber===e};Vh.prototype.createKeyframeNode=function(e){let t=Qk(e,this.keyframeNodes);if(t<0){t=~t;let n=new zo(this,e);this.keyframeNodes.splice(t,0,n)}};Vh.prototype.destroyKeyframeNode=function(e,t){let n=e.keyframe,i=Qk(n,this.keyframeNodes);if(i<0)throw new ge("Keyframe node does not exist.");if(this.keyframeNodes.splice(i,1),e.megatextureIndex!==-1){for(let r=0;r<t.length;r++)t[r].remove(e.megatextureIndex);let o=Qk(n,this.renderableKeyframeNodes);if(o<0)throw new ge("Renderable keyframe node does not exist.");this.renderableKeyframeNodes.splice(o,1)}e.unload()};Vh.prototype.addKeyframeNodeToMegatextures=function(e,t){if(e.megatextureIndex!==-1||e.content.metadata.length!==t.length)throw new ge("Keyframe node cannot be added to megatexture");let{metadata:n}=e.content;for(let r=0;r<t.length;r++){let s=t[r];e.megatextureIndex=s.add(n[r])}let i=this.renderableKeyframeNodes,o=Qk(e.keyframe,i);if(o>=0)throw new ge("Keyframe already renderable");o=~o,i.splice(o,0,e)};Vh.prototype.isRenderable=function(e){let t=this.renderableKeyframeNodePrevious,n=this.renderableKeyframeNodeNext,i=this.level;return l(t)&&l(n)&&(t.spatialNode.level===i||n.spatialNode.level===i)&&this.visitedFrameNumber===e};var qk=Vh;function WT(e,t,n,i){let{provider:o,dimensions:r,inputDimensions:s}=e,{types:a,componentTypes:c}=o;l(i)?i=Math.min(Math.max(0,i),512*1024*1024):i=128*1024*1024,this._primitive=e,this.textureMemoryByteLength=0,this.megatextures=new Array(a.length);let d=l(o.maximumTileCount)?o.maximumTileCount:l(o.availableLevels)?(8**o.availableLevels-1)/7:void 0;for(let S=0;S<a.length;S++){let Z=a[S],R=St.getComponentCount(Z),C=c[S];this.megatextures[S]=new jk(t,s,R,C,i,d),this.textureMemoryByteLength+=this.megatextures[S].textureMemoryByteLength}let u=this.megatextures[0].maximumTileCount;this._simultaneousRequestCount=0,this._debugPrint=!1,this._calculateStatistics=this._primitive._calculateStatistics??!1,this._frameNumber=0;let m=e._shape;this.rootNode=new qk(0,0,0,0,void 0,m,r),this._priorityQueue=new ly({maximumLength:u,comparator:zo.priorityComparator}),this._highPriorityKeyframeNodes=new Array(u),this._highPriorityKeyframeNodeCount=0,this._keyframeNodesInMegatexture=new Array(u),this._keyframeCount=n,this._sampleCount=void 0,this._keyframeLocation=0,this._binaryTreeKeyframeWeighting=new Array(n),this._initialTilesLoaded=!1;let p=this._binaryTreeKeyframeWeighting;p[0]=0,p[n-1]=0,sse(p,1,n-2,0);let b=9,f=2048,y=Math.floor(f/b),_=Math.ceil(u/y);this.internalNodeTexture=new vt({context:t,pixelFormat:Qe.RGBA,pixelDatatype:Ue.UNSIGNED_BYTE,flipY:!1,width:f,height:_,sampler:new Ot({minificationFilter:Ht.NEAREST,magnificationFilter:$n.NEAREST})}),this.internalNodeTilesPerRow=y,this.internalNodeTexelSizeUv=new k(1/f,1/_),this.leafNodeTexture=void 0,this.leafNodeTilesPerRow=void 0,this.leafNodeTexelSizeUv=new k}WT.prototype.findKeyframeNode=function(e){return this._keyframeNodesInMegatexture.find(function(t){return t.megatextureIndex===e})};function sse(e,t,n,i){if(t>n)return;let o=Math.floor((t+n)/2);e[o]=i,sse(e,t,o-1,i+1),sse(e,o+1,n,i+1)}WT.simultaneousRequestCountMaximum=50;WT.prototype.update=function(e,t,n,i){let o=this._primitive,r=e.context,s=this.megatextures[0].maximumTileCount,a=this._keyframeCount,c=o._levelBlendFactor,d=c>0,u=a>1,m=(d?2:1)*(u?2:1);this._sampleCount=m;let p=m>=2;if(p&&!l(this.leafNodeTexture)){let R=Math.floor(512),C=Math.ceil(s/R);this.leafNodeTexture=new vt({context:r,pixelFormat:Qe.RGBA,pixelDatatype:Ue.UNSIGNED_BYTE,flipY:!1,width:1024,height:C,sampler:new Ot({minificationFilter:Ht.NEAREST,magnificationFilter:$n.NEAREST})}),this.leafNodeTexelSizeUv=k.fromElements(1/1024,1/C,this.leafNodeTexelSizeUv),this.leafNodeTilesPerRow=R}else!p&&l(this.leafNodeTexture)&&(this.leafNodeTexture=this.leafNodeTexture.destroy());if(this._keyframeLocation=W.clamp(t,0,a-1),n&&vPe(this,this.rootNode),i)return;this._frameNumber=e.frameNumber;let b=Zn();uYt(this,e),mYt(this,e);let f=Zn();gYt(this,m,c);let y=Zn(),_=o.loadProgress.numberOfListeners>0||o.allTilesLoaded.numberOfListeners>0||o.initialTilesLoaded.numberOfListeners>0;if(this._debugPrint||this._calculateStatistics||_){let S=f-b,Z=y-f,R=y-b;bYt(this,e,S,Z,R)}};WT.prototype.isRenderable=function(e){return e.isRenderable(this._frameNumber)};WT.prototype.isDestroyed=function(){return!1};WT.prototype.destroy=function(){let e=this.megatextures,t=e.length;for(let n=0;n<t;n++)e[n]=e[n]&&e[n].destroy();return this.textureMemoryByteLength=0,this.internalNodeTexture=this.internalNodeTexture&&this.internalNodeTexture.destroy(),this.leafNodeTexture=this.leafNodeTexture&&this.leafNodeTexture.destroy(),ue(this)};function vPe(e,t){if(t.computeBoundingVolumes(e._primitive._shape),l(t.children))for(let n=0;n<8;n++){let i=t.children[n];vPe(e,i)}}function lYt(e,t){if(e._simultaneousRequestCount>=WT.simultaneousRequestCountMaximum)return;let i=e._primitive.provider,{keyframe:o,spatialNode:r}=t;if(l(i.availableLevels)&&r.level>=i.availableLevels)return;function s(u){e._simultaneousRequestCount--,t.content=u,t.state=l(u)?zo.LoadState.PROCESSING:zo.LoadState.UNAVAILABLE}function a(u){e._simultaneousRequestCount--,t.state=zo.LoadState.FAILED,e._primitive.tileFailed.raiseEvent()}let c={tileLevel:r.level,tileX:r.x,tileY:r.y,tileZ:r.z,keyframe:o},d=i.requestData(c);l(d)&&(e._simultaneousRequestCount++,t.state=zo.LoadState.RECEIVING,d.then(s).catch(a))}function dYt(e){return e/(1+e)}function uYt(e,t){let n=e._frameNumber,i=e._priorityQueue;i.reset(),FPe(e.rootNode,$s.MASK_INDETERMINATE,e,t);let o=e._highPriorityKeyframeNodes,r=0,s;for(;i.length>0;)s=i.removeMaximum(),s.highPriorityFrameNumber=n,o[r]=s,r++;e._highPriorityKeyframeNodeCount=r}function mYt(e,t){let n=e.megatextures[0],i=n.occupiedCount,o=e._keyframeNodesInMegatexture;o.length=i,o.sort(hYt);let r=e._highPriorityKeyframeNodes,s=e._highPriorityKeyframeNodeCount,a=0,c=0;for(let d=0;d<s;d++){let u=r[d];if(!(u.state===zo.LoadState.LOADED||u.spatialNode===void 0)&&(u.state===zo.LoadState.UNLOADED&&lYt(e,u),u.state===zo.LoadState.PROCESSING)){let{content:m}=u;if(m.update(e._primitive,t),!m.ready)continue;if(!fYt(m.metadata,e)){u.content=void 0,u.state=zo.LoadState.FAILED,e._primitive.tileFailed.raiseEvent();continue}let p;if(n.isFull()){p=i-1-a,a++;let b=o[p];e._primitive.tileUnload.raiseEvent(),b.spatialNode.destroyKeyframeNode(b,e.megatextures)}else p=i+c,c++;u.spatialNode.addKeyframeNodeToMegatextures(u,e.megatextures),u.state=zo.LoadState.LOADED,o[p]=u,e._primitive.tileLoad.raiseEvent()}}}function hYt(e,t){return e.highPriorityFrameNumber===t.highPriorityFrameNumber?t.priority-e.priority:t.highPriorityFrameNumber-e.highPriorityFrameNumber}function fYt(e,t){let n=t._primitive.provider.types.length;if(!Array.isArray(e)||e.length!==n)return!1;let{megatextures:i}=t;for(let o=0;o<n;o++){let{voxelCountPerTile:r,channelCount:s}=i[o],{x:a,y:c,z:d}=r,u=a*c*d,m=e[o],p=u*s;if(m.length!==p)return!1}return!0}function FPe(e,t,n,i){let{camera:o,context:r,pixelRatio:s,frameNumber:a}=i,{positionWC:c,frustum:d}=o,m=r.drawingBufferHeight/s/d.sseDenominator;if(e.computeScreenSpaceError(c,m),t=e.visibility(i,t),t===$s.MASK_OUTSIDE)return;e.visitedFrameNumber=a;let p=n._primitive,b=p._shape,f=p.screenSpaceError,y=n._priorityQueue,_=n._keyframeCount,S=W.clamp(Math.floor(n._keyframeLocation),0,_-2),Z=S+1;if(_===1)e.createKeyframeNode(0);else if(e.keyframeNodes.length!==_)for(let L=0;L<_;L++)e.createKeyframeNode(L);let{screenSpaceError:R,keyframeNodes:C}=e,E=dYt(R),A=!1;for(let L=0;L<C.length;L++){let F=C[L];F.priority=10*E+pYt(S,F.keyframe,Z,n),F.state!==zo.LoadState.UNAVAILABLE&&F.state!==zo.LoadState.FAILED&&F.priority!==-Number.MAX_VALUE&&y.insert(F),F.state===zo.LoadState.LOADED&&(A=!0)}if(R<f||!A){e.children=void 0;return}l(e.children)||e.constructChildNodes(b);for(let L=0;L<8;L++){let F=e.children[L];FPe(F,t,n,i)}}function pYt(e,t,n,i){let o=Math.min(Math.abs(t-e),Math.abs(t-n)),r=Math.max(e,i._keyframeCount-n-1,1),s=Math.pow(1-o/r,4),a=Math.exp(-i._binaryTreeKeyframeWeighting[t]);return W.lerp(a,s,.15+.85*s)}function bYt(e,t,n,i,o){let r=e._keyframeCount,s=e.rootNode,a=Object.keys(zo.LoadState).length,c=new Array(a),d=new Array(a),u=0;for(let A=0;A<a;A++){let L=new Array(r).fill(0);c[A]=L,d[A]=0}function m(A){let L=A.keyframeNodes;for(let F=0;F<L.length;F++){let I=L[F],N=I.keyframe,g=I.state;c[g][N]+=1,d[g]+=1,u++}if(l(A.children))for(let F=0;F<8;F++){let I=A.children[F];m(I)}}m(s),e._primitive.statistics.numberOfTilesWithContentReady=d[zo.LoadState.LOADED],e._primitive.statistics.visited=u;let p=d[zo.LoadState.RECEIVING],b=d[zo.LoadState.PROCESSING],f=p!==e._primitive.statistics.numberOfPendingRequests||b!==e._primitive.statistics.numberOfTilesProcessing;if(f&&t.afterRender.push(function(){return e._primitive.loadProgress.raiseEvent(p,b),!0}),e._primitive.statistics.numberOfPendingRequests=p,e._primitive.statistics.numberOfTilesProcessing=b,f&&(p===0&&b===0)&&(t.afterRender.push(function(){return e._primitive.allTilesLoaded.raiseEvent(),!0}),e._initialTilesLoaded||(e._initialTilesLoaded=!0,t.afterRender.push(function(){return e._primitive.initialTilesLoaded.raiseEvent(),!0}))),!e._debugPrint)return;let _=`KEYFRAMES: ${c[zo.LoadState.LOADED]}`,S=`UNLOADED: ${d[zo.LoadState.UNLOADED]} | RECEIVING: ${d[zo.LoadState.RECEIVING]} | PROCESSING: ${d[zo.LoadState.PROCESSING]} | LOADED: ${d[zo.LoadState.LOADED]} | FAILED: ${d[zo.LoadState.FAILED]} | UNAVAILABLE: ${d[zo.LoadState.UNAVAILABLE]} | TOTAL: ${u}`,Z=Math.round(n*100)/100,R=Math.round(i*100)/100,C=Math.round(o*100)/100,E=`LOAD: ${Z} | OCT: ${R} | ALL: ${C}`;console.log(`${_} || ${S} || ${E}`)}var HK={INTERNAL:0,LEAF:1,PACKED_LEAF_FROM_PARENT:2};function gYt(e,t,n){let i=e._primitive._screenSpaceError,o=e._keyframeLocation,r=e._frameNumber,s=t>=2,a=0,c=0,d=[],u=[];function m(b,f,y,_,S){let Z=!1;if(l(b.children))for(let R=0;R<8;R++){let C=b.children[R];C.computeSurroundingRenderableKeyframeNodes(o),C.isRenderable(r)&&(Z=!0)}if(Z){d[S]=HK.INTERNAL<<16|f,d[y]=_,a++,_=f,S=_*9+1;for(let R=0;R<8;R++){let C=b.children[R];f=a,y=f*9+0,m(C,f,y,_,S+R)}}else{if(e._primitive.tileVisible.raiseEvent(),s){let R=c*5,C=b.renderableKeyframeNodePrevious,E=b.level-C.spatialNode.level,A=C.spatialNode.parent,L=l(A)?A.renderableKeyframeNodePrevious:C,F=yYt(b,i,n),I=E,N=1,g=C.megatextureIndex,V=L.megatextureIndex;u[R+0]=F,u[R+1]=I,u[R+2]=N,u[R+3]=g,u[R+4]=V,d[S]=HK.LEAF<<16|c}else{let R=b.renderableKeyframeNodePrevious,E=b.level-R.spatialNode.level===0?HK.LEAF:HK.PACKED_LEAF_FROM_PARENT;d[S]=E<<16|R.megatextureIndex}c++}}let p=e.rootNode;p.computeSurroundingRenderableKeyframeNodes(o),p.isRenderable(r)&&m(p,0,0,0,0),xYt(d,9,e.internalNodeTilesPerRow,e.internalNodeTexture),s&&TYt(u,2,e.leafNodeTilesPerRow,e.leafNodeTexture)}function yYt(e,t,n){if(e.parent===void 0)return 0;let i=e.screenSpaceError,o=e.parent.screenSpaceError,s=((t-i)/(o-i)+n-1)/n;return W.clamp(s,0,1)}function xYt(e,t,n,i){let o=Qe.componentsLength(i.pixelFormat),r=Math.ceil(e.length/t),s=Math.max(1,t*Math.min(r,n)),a=Math.max(1,Math.ceil(r/n)),c=new Uint8Array(s*a*o);for(let m=0;m<e.length;m++){let p=e[m],b=m*o;for(let f=0;f<o;f++)c[b+f]=p>>>f*8&255}let u={source:{arrayBufferView:c,width:s,height:a},xOffset:0,yOffset:0};i.copyFrom(u)}function TYt(e,t,n,i){let o=Qe.componentsLength(i.pixelFormat),r=5,s=Math.ceil(e.length/r),a=Math.max(1,t*Math.min(s,n)),c=Math.max(1,Math.ceil(s/n)),d=new Uint8Array(a*c*o);for(let p=0;p<s;p++){let b=e[p*r+0],f=e[p*r+1],y=e[p*r+2],_=e[p*r+3],S=e[p*r+4],Z=W.clamp(Math.floor(65536*b),0,65535);d[p*8+0]=Z>>>0&255,d[p*8+1]=Z>>>8&255,d[p*8+2]=f&255,d[p*8+3]=y&255,d[p*8+4]=_>>>0&255,d[p*8+5]=_>>>8&255,d[p*8+6]=S>>>0&255,d[p*8+7]=S>>>8&255}let m={source:{arrayBufferView:d,width:a,height:c},xOffset:0,yOffset:0};i.copyFrom(m)}var $k=WT;function U0(e){e=e??B.EMPTY_OBJECT;let{provider:t=U0.DefaultProvider,modelMatrix:n=P.IDENTITY,customShader:i=mA(t),clock:o,calculateStatistics:r=!1}=e;this._ready=!1,this._provider=t,this._traversal=void 0,this._statistics=new Cf,this._calculateStatistics=r;let{shape:s,minBounds:a=_c.getMinBounds(s),maxBounds:c=_c.getMaxBounds(s),dimensions:d,paddingBefore:u=h.ZERO,paddingAfter:m=h.ZERO,metadataOrder:p,availableLevels:b=1}=t;this._dimensions=h.clone(d),this._paddingBefore=h.clone(u),this._paddingAfter=h.clone(m),this._inputDimensions=_Yt(d,u,m,p),this._availableLevels=b,this._minBounds=a.clone(),this._minBoundsOld=new h,this._maxBounds=c.clone(),this._maxBoundsOld=new h,this._minClippingBounds=a.clone(),this._minClippingBoundsOld=new h,this._maxClippingBounds=c.clone(),this._maxClippingBoundsOld=new h,this._verticalExaggeration=1,this._verticalExaggerationRelativeHeight=0,this._clippingPlanes=void 0,this._clippingPlanesState=0,this._clippingPlanesEnabled=!1,this._modelMatrix=P.clone(n),this._modelMatrixOld=P.clone(this._modelMatrix),this._customShader=i??U0.DefaultCustomShader,this._customShaderCompilationEvent=new Se,this._shaderDirty=!0,this._drawCommand=void 0,this._drawCommandPick=void 0,this._pickId=void 0,this._clock=o,this._transformPositionLocalToWorld=new P,this._transformPositionWorldToLocal=new P,this._transformPlaneLocalToView=new P,this._transformDirectionWorldToLocal=new q,this._nearestSampling=!1,this._levelBlendFactor=0,this._stepSizeMultiplier=1,this._depthTest=!0,this._useLogDepth=void 0,this._screenSpaceError=4,this._debugPolylines=new Tf,this._debugDraw=!1,this._disableRender=!1,this._disableUpdate=!1;let f=_c.getShapeConstructor(s);this._shape=new f,PPe(this),this._shapeVisible=XPe(this),this._uniforms={octreeInternalNodeTexture:void 0,octreeInternalNodeTilesPerRow:0,octreeInternalNodeTexelSizeUv:new k,octreeLeafNodeTexture:void 0,octreeLeafNodeTilesPerRow:0,octreeLeafNodeTexelSizeUv:new k,megatextureTextures:[],megatextureTileCounts:new h,dimensions:this._dimensions,inputDimensions:this._inputDimensions,paddingBefore:this._paddingBefore,paddingAfter:this._paddingAfter,transformPositionViewToLocal:new P,transformDirectionViewToLocal:new q,cameraPositionLocal:new h,cameraDirectionLocal:new h,cameraTileCoordinates:new ce,cameraTileUv:new h,ndcSpaceAxisAlignedBoundingBox:new ce,clippingPlanesTexture:void 0,clippingPlanesMatrix:new P,renderBoundPlanesTexture:void 0,stepSize:this._stepSizeMultiplier,pickColor:new U},this._shapeDefinesOld={},this._uniformMap={};let y=this._uniforms,_=this._uniformMap;for(let S in y)if(y.hasOwnProperty(S)){let Z=`u_${S}`;_[Z]=function(){return y[S]}}SYt(this,this._shape),this.tileLoad=new Se,this.tileVisible=new Se,this.tileFailed=new Se,this.tileUnload=new Se,this.loadProgress=new Se,this.allTilesLoaded=new Se,this.initialTilesLoaded=new Se}function _Yt(e,t,n,i){let o=h.add(e,t,new h);if(h.add(o,n,o),i===w0.Y_UP){let r=o.y;o.y=o.z,o.z=r}return o}function SYt(e,t){let n=e._uniformMap,{shaderUniforms:i,shaderDefines:o}=t;for(let r in i)if(i.hasOwnProperty(r)){let s=`u_${r}`;n[s]=function(){return i[r]}}e._shapeDefinesOld=$e(o,!0)}Object.defineProperties(U0.prototype,{ready:{get:function(){return this._ready}},provider:{get:function(){return this._provider}},boundingSphere:{get:function(){return this._shape.boundingSphere}},orientedBoundingBox:{get:function(){return this._shape.orientedBoundingBox}},modelMatrix:{get:function(){return this._modelMatrix},set:function(e){this._modelMatrix=P.clone(e,this._modelMatrix)}},shape:{get:function(){return this._provider.shape}},dimensions:{get:function(){return this._dimensions}},inputDimensions:{get:function(){return this._inputDimensions}},paddingBefore:{get:function(){return this._paddingBefore}},paddingAfter:{get:function(){return this._paddingAfter}},minimumValues:{get:function(){return this._provider.minimumValues}},maximumValues:{get:function(){return this._provider.maximumValues}},show:{get:function(){return!this._disableRender},set:function(e){this._disableRender=!e}},disableUpdate:{get:function(){return this._disableUpdate},set:function(e){this._disableUpdate=e}},debugDraw:{get:function(){return this._debugDraw},set:function(e){this._debugDraw=e}},depthTest:{get:function(){return this._depthTest},set:function(e){this._depthTest!==e&&(this._depthTest=e,this._shaderDirty=!0)}},nearestSampling:{get:function(){return this._nearestSampling},set:function(e){this._nearestSampling=e}},levelBlendFactor:{get:function(){return this._levelBlendFactor},set:function(e){this._levelBlendFactor=W.clamp(e,0,1)}},screenSpaceError:{get:function(){return this._screenSpaceError},set:function(e){this._screenSpaceError=e}},stepSize:{get:function(){return this._stepSizeMultiplier},set:function(e){this._stepSizeMultiplier=e}},minBounds:{get:function(){return this._minBounds},set:function(e){this._minBounds=h.clone(e,this._minBounds)}},maxBounds:{get:function(){return this._maxBounds},set:function(e){this._maxBounds=h.clone(e,this._maxBounds)}},minClippingBounds:{get:function(){return this._minClippingBounds},set:function(e){this._minClippingBounds=h.clone(e,this._minClippingBounds)}},maxClippingBounds:{get:function(){return this._maxClippingBounds},set:function(e){this._maxClippingBounds=h.clone(e,this._maxClippingBounds)}},clippingPlanes:{get:function(){return this._clippingPlanes},set:function(e){gs.setOwner(e,this,"_clippingPlanes")}},customShader:{get:function(){return this._customShader},set:function(e){if(e===this._customShader)return;let t=this._uniformMap,i=this._customShader.uniformMap;for(let o in i)i.hasOwnProperty(o)&&delete t[o];if(l(e))this._customShader=e;else{let o=mA(this._provider);this._customShader=o??U0.DefaultCustomShader}this._shaderDirty=!0}},customShaderCompilationEvent:{get:function(){return this._customShaderCompilationEvent}},statistics:{get:function(){return this._statistics}}});var ZYt=new ce,RYt=new ce,CYt=new P,VYt=new P,EYt=new h,AYt=new ce;U0.prototype.update=function(e){let t=this._provider,n=this._uniforms;this._customShader.update(e);let i=e.context;if(!this._ready){PYt(this,t,i),e.afterRender.push(()=>(this._ready=!0,!0));return}let o=PPe(this),r=IYt(this,e);if((o||r)&&(this._shapeVisible=XPe(this),BYt(this)&&(this._shaderDirty=!0)),!this._shapeVisible)return;this._shape.updateViewTransforms(e);let s=zYt(t.timeIntervalCollection,this._clock),a=this._traversal,c=a._sampleCount;if(a.update(e,s,o,this._disableUpdate),c!==a._sampleCount&&(this._shaderDirty=!0),!a.isRenderable(a.rootNode)||(this._debugDraw&&eMt(this,e),this._disableRender))return;this._useLogDepth!==e.useLogDepth&&(this._useLogDepth=e.useLogDepth,this._shaderDirty=!0),HYt(this,e)&&(this._shaderDirty=!0);let u=a.leafNodeTexture;l(u)&&(n.octreeLeafNodeTexture=a.leafNodeTexture,n.octreeLeafNodeTexelSizeUv=k.clone(a.leafNodeTexelSizeUv,n.octreeLeafNodeTexelSizeUv),n.octreeLeafNodeTilesPerRow=a.leafNodeTilesPerRow),this._shaderDirty&&(Bk(this,i),this._shaderDirty=!1);let m=i.uniformState.viewProjection,{orientedBoundingBox:p}=this._shape,b=jYt(p,m,RYt);if(b.x===1||b.y===1||b.z===-1||b.w===-1)return;n.ndcSpaceAxisAlignedBoundingBox=ce.clone(b,n.ndcSpaceAxisAlignedBoundingBox);let y=i.uniformState.inverseView,_=P.multiplyTransformation(this._transformPositionWorldToLocal,y,n.transformPositionViewToLocal);this._transformPlaneLocalToView=P.transpose(_,this._transformPlaneLocalToView);let S=i.uniformState.inverseViewRotation;n.transformDirectionViewToLocal=q.multiply(this._transformDirectionWorldToLocal,S,n.transformDirectionViewToLocal),n.cameraPositionLocal=P.multiplyByPoint(this._transformPositionWorldToLocal,e.camera.positionWC,n.cameraPositionLocal),n.cameraDirectionLocal=q.multiplyByVector(this._transformDirectionWorldToLocal,e.camera.directionWC,n.cameraDirectionLocal);let Z=WYt(this,n.cameraPositionLocal,AYt);n.cameraTileCoordinates=ce.fromElements(Math.floor(Z.x),Math.floor(Z.y),Math.floor(Z.z),Z.w,n.cameraTileCoordinates),n.cameraTileUv=h.fromElements(Z.x-Math.floor(Z.x),Z.y-Math.floor(Z.y),Z.z-Math.floor(Z.z),n.cameraTileUv),n.stepSize=this._stepSizeMultiplier,GYt(this),LYt(this,e);let R=e.passes.pick?this._drawCommandPick:e.passes.pickVoxel?this._drawCommandPickVoxel:this._drawCommand;R.boundingVolume=this._shape.boundingSphere,e.commandList.push(R)};function GYt(e){let{megatextures:t}=e._traversal;for(let n=0;n<t.length;++n)t[n].nearestSampling=e._nearestSampling}function LYt(e,t){let n=e._uniforms,{renderBoundPlanes:i}=e._shape;l(i)&&(i.update(t,e._transformPlaneLocalToView),n.renderBoundPlanesTexture=i.texture)}function WYt(e,t,n){let i=e._shape.convertLocalToShapeUvSpace(t,EYt),o=e._availableLevels,r=2**(o-1);return ce.fromElements(i.x*r,i.y*r,i.z*r,o-1,n)}var vYt=new h,ase=new h,FYt=new pe;function IYt(e,t){let{verticalExaggeration:n,verticalExaggerationRelativeHeight:i}=t;return e._verticalExaggeration===n&&e._verticalExaggerationRelativeHeight===i?!1:(e._verticalExaggeration=n,e._verticalExaggerationRelativeHeight=i,!0)}function PYt(e,t,n){let i=e._uniforms;e._pickId=n.createPickId({primitive:e}),i.pickColor=U.clone(e._pickId.color,i.pickColor);let o=t.keyframeCount??1;e._traversal=new $k(e,n,o),e.statistics.texturesByteLength=e._traversal.textureMemoryByteLength,OYt(e._traversal,i)}function PPe(e){return eU(e,"_modelMatrix","_modelMatrixOld")+eU(e,"_minBounds","_minBoundsOld")+eU(e,"_maxBounds","_maxBoundsOld")+eU(e,"_minClippingBounds","_minClippingBoundsOld")+eU(e,"_maxClippingBounds","_maxClippingBoundsOld")>0}function eU(e,t,n){let i=e[t],o=e[n],r=!i.equals(o);return r&&i.clone(o),r?1:0}var XYt=new h,NYt=new h,YYt=new h,MYt=new h,wYt=new P,kYt=new P;function XPe(e){let t=e._verticalExaggeration,n=e._verticalExaggerationRelativeHeight,i=h.clone(e._minBounds,XYt),o=h.clone(e._maxBounds,NYt),r=h.clone(e._minClippingBounds,YYt),s=h.clone(e._maxClippingBounds,MYt),a=P.clone(e._modelMatrix,wYt);if(e.shape===_c.ELLIPSOID)i.z=_o.getHeight(e._minBounds.z,t,n),o.z=_o.getHeight(e._maxBounds.z,t,n),r.z=_o.getHeight(e._minClippingBounds.z,t,n),s.z=_o.getHeight(e._maxClippingBounds.z,t,n);else{let f=h.fromElements(1,1,t,vYt);P.multiplyByScale(a,f,a),P.multiplyByTranslation(a,DYt(e),a)}let c=e._provider,d=c.shapeTransform??P.IDENTITY,u=c.globalTransform??P.IDENTITY,m=P.multiplyTransformation(u,a,kYt);P.multiplyTransformation(m,d,m);let p=e._shape;return p.update(m,i,o,r,s)?(e._transformPositionLocalToWorld=P.clone(p.shapeTransform,e._transformPositionLocalToWorld),e._transformPositionWorldToLocal=P.inverse(e._transformPositionLocalToWorld,e._transformPositionWorldToLocal),e._transformDirectionWorldToLocal=P.getMatrix3(e._transformPositionWorldToLocal,e._transformDirectionWorldToLocal),!0):!1}var UYt=new h;function DYt(e){let t=e._verticalExaggeration,n=e._verticalExaggerationRelativeHeight,{shapeTransform:i=P.IDENTITY,globalTransform:o=P.IDENTITY}=e._provider,r=P.getTranslation(i,ase),s=P.multiplyByPoint(e._modelMatrix,r,ase),a=P.multiplyByPoint(o,s,ase),d=ne.WGS84.cartesianToCartographic(a,FYt),u=0;l(d)&&(u=d.height);let m=_o.getHeight(u,t,n);return h.fromElements(0,0,(m-u)/t,UYt)}function OYt(e,t){t.octreeInternalNodeTexture=e.internalNodeTexture,t.octreeInternalNodeTexelSizeUv=k.clone(e.internalNodeTexelSizeUv,t.octreeInternalNodeTexelSizeUv),t.octreeInternalNodeTilesPerRow=e.internalNodeTilesPerRow;let{megatextures:n}=e,i=n[0];t.megatextureTextures=new Array(n.length);for(let o=0;o<n.length;o++)t.megatextureTextures[o]=n[o].texture;t.megatextureTileCounts=h.clone(i.tileCounts,t.megatextureTileCounts)}function BYt(e){let{shaderDefines:t}=e._shape,n=Object.keys(t).some(i=>t[i]!==e._shapeDefinesOld[i]);return n&&(e._shapeDefinesOld=$e(t,!0)),n}function zYt(e,t){if(!l(e)||!l(t))return 0;let n=t.currentTime,i,o=e.indexOf(n);o>=0?i=e.get(o):(o=~o,o===e.length?(o=e.length-1,i=e.get(o),n=i.stop):(i=e.get(o),n=i.start));let r=Q.secondsDifference(i.stop,i.start),a=Q.secondsDifference(n,i.start)/r;return o+a}function HYt(e,t){let n=e.clippingPlanes;if(!l(n))return!1;n.update(t);let{clippingPlanesState:i,enabled:o}=n;if(o){let r=e._uniforms;r.clippingPlanesTexture=n.texture,r.clippingPlanesMatrix=P.transpose(P.multiplyTransformation(P.inverse(n.modelMatrix,r.clippingPlanesMatrix),e._transformPositionLocalToWorld,r.clippingPlanesMatrix),r.clippingPlanesMatrix)}return e._clippingPlanesState===i&&e._clippingPlanesEnabled===o?!1:(e._clippingPlanesState=i,e._clippingPlanesEnabled=o,!0)}U0.prototype.isDestroyed=function(){return!1};U0.prototype.destroy=function(){let e=this._drawCommand;l(e)&&(e.shaderProgram=e.shaderProgram&&e.shaderProgram.destroy());let t=this._drawCommandPick;return l(t)&&(t.shaderProgram=t.shaderProgram&&t.shaderProgram.destroy()),this._pickId=this._pickId&&this._pickId.destroy(),this._traversal=this._traversal&&this._traversal.destroy(),this.statistics.texturesByteLength=0,this._clippingPlanes=this._clippingPlanes&&this._clippingPlanes.destroy(),ue(this)};var IPe=new Array(new ce(-1,-1,-1,1),new ce(1,-1,-1,1),new ce(-1,1,-1,1),new ce(1,1,-1,1),new ce(-1,-1,1,1),new ce(1,-1,1,1),new ce(-1,1,1,1),new ce(1,1,1,1)),KYt=new Array(1,2,4,0,3,5,0,3,6,1,2,7,0,5,6,1,4,7,2,4,7,3,5,6),JYt=new Array(new ce,new ce,new ce,new ce,new ce,new ce,new ce,new ce);function jYt(e,t,n){let i=P.fromRotationTranslation(e.halfAxes,e.center,CYt),o=P.multiply(t,i,VYt),r=+Number.MAX_VALUE,s=-Number.MAX_VALUE,a=+Number.MAX_VALUE,c=-Number.MAX_VALUE,d,u=JYt,m=IPe.length;for(d=0;d<m;d++)P.multiplyByVector(o,IPe[d],u[d]);for(d=0;d<m;d++){let p=u[d];if(p.z>=-p.w){let b=p.x/p.w,f=p.y/p.w;r=Math.min(r,b),s=Math.max(s,b),a=Math.min(a,f),c=Math.max(c,f)}else for(let b=0;b<3;b++){let f=KYt[d*3+b],y=u[f];if(y.z>=-y.w){let _=p.z+p.w,S=y.z+y.w,Z=_/(_-S),R=ce.lerp(p,y,Z,ZYt),C=R.x/R.w,E=R.y/R.w;r=Math.min(r,C),s=Math.max(s,C),a=Math.min(a,E),c=Math.max(c,E)}}}return r=W.clamp(r,-1,1),a=W.clamp(a,-1,1),s=W.clamp(s,-1,1),c=W.clamp(c,-1,1),n=ce.fromElements(r,a,s,c,n),n}var cse=3e7,QYt=new h(cse,0,0),qYt=new h(0,cse,0),$Yt=new h(0,0,cse);function eMt(e,t){let n=e._traversal,i=e._debugPolylines;i.removeAll();function o(c,d,u,m){i.add({positions:[c,d],width:m,material:eo.fromType("Color",{color:u})})}function r(c,d,u){let m=c.computeCorners();o(m[0],m[1],d,u),o(m[2],m[3],d,u),o(m[4],m[5],d,u),o(m[6],m[7],d,u),o(m[0],m[2],d,u),o(m[4],m[6],d,u),o(m[1],m[3],d,u),o(m[5],m[7],d,u),o(m[0],m[4],d,u),o(m[2],m[6],d,u),o(m[1],m[5],d,u),o(m[3],m[7],d,u)}function s(c){if(!n.isRenderable(c))return;let d=c.level,m=Math.max(1,5/Math.pow(2,d)),b=[U.RED,U.LIME,U.BLUE][d%3];if(r(c.orientedBoundingBox,b,m),l(c.children))for(let f=0;f<8;f++)s(c.children[f])}r(e._shape.orientedBoundingBox,U.WHITE,5),s(n.rootNode);let a=10;o(h.ZERO,QYt,U.RED,a),o(h.ZERO,qYt,U.LIME,a),o(h.ZERO,$Yt,U.BLUE,a),i.update(t)}U0.DefaultCustomShader=new M0({fragmentShaderText:`void fragmentMain(FragmentInput fsInput, inout czm_modelMaterial material) + return texture(packedPlanes, vec2(u, v));`}var P9=GLt;var _lo=x(T(),1);function Og(e){let{loader:t,metadata:n}=e;this._loader=t,this._metadata=n,this._resourcesLoaded=!1,this._ready=!1}Object.defineProperties(Og.prototype,{ready:{get:function(){return this._ready}},metadata:{get:function(){return this._metadata}}});Og.fromMetadataArray=function(e){return new Og({metadata:e})};Og.fromGltf=async function(e){let t=new Mu({gltfResource:e,releaseGltfJson:!1,loadAttributesAsTypedArray:!0});try{await t.load()}catch(n){throw t.destroy(),n}return new Og({loader:t})};Og.prototype.update=function(e,t){let n=this._loader;if(!this._ready){if(t.afterRender.push(()=>!0),!l(n)){this._ready=!0;return}if(this._resourcesLoaded){let{structuralMetadata:i,scene:o}=n.components,{attributes:r}=o.nodes[0].primitives[0];this._metadata=LLt(r,i,e),this._ready=!0;return}this._resourcesLoaded=n.process(t)}};function LLt(e,t,n){let{className:i,names:o,types:r,componentTypes:s}=n.provider,a=t.propertyAttributes.find(u=>u.class.id===i),{properties:c}=a,d=new Array(o.length);for(let u=0;u<e.length;u++){let m=c[o[u]].attribute,p=e.find(_=>_.name===m);if(!l(p))continue;let b=Nt.toComponentDatatype(s[u]),f=St.getComponentCount(r[u]),y=p.count*f;d[u]=J.createArrayBufferView(b,p.typedArray.buffer,p.typedArray.byteOffset+p.byteOffset,y)}return d}Og.prototype.isDestroyed=function(){return!1};Og.prototype.destroy=function(){return this._loader=this._loader&&this._loader.destroy(),ue(this)};var OZ=Og;var cdo=x(T(),1);var Wlo=x(T(),1);function Sl(){this._orientedBoundingBox=new nn,this._boundingSphere=new me,this._boundTransform=new P,this._shapeTransform=new P,this._minBounds=Sl.DefaultMinBounds.clone(),this._maxBounds=Sl.DefaultMaxBounds.clone(),this._renderMinBounds=Sl.DefaultMinBounds.clone(),this._renderMaxBounds=Sl.DefaultMaxBounds.clone();let{DefaultMinBounds:e,DefaultMaxBounds:t}=Sl,n=[new ta(h.negate(h.UNIT_X,new h),e.x),new ta(h.negate(h.UNIT_Y,new h),e.y),new ta(h.negate(h.UNIT_Z,new h),e.z),new ta(h.UNIT_X,-t.x),new ta(h.UNIT_Y,-t.y),new ta(h.UNIT_Z,-t.z)];this._renderBoundPlanes=new Dg({planes:n}),this._localToShapeUvTranslate=new h,this._shaderUniforms={boxEcToXyz:new q,boxLocalToShapeUvScale:new h},this._shaderDefines={BOX_INTERSECTION_INDEX:void 0},this._shaderMaximumIntersectionsLength=0}Object.defineProperties(Sl.prototype,{orientedBoundingBox:{get:function(){return this._orientedBoundingBox}},renderBoundPlanes:{get:function(){return this._renderBoundPlanes}},boundingSphere:{get:function(){return this._boundingSphere}},boundTransform:{get:function(){return this._boundTransform}},shapeTransform:{get:function(){return this._shapeTransform}},shaderUniforms:{get:function(){return this._shaderUniforms}},shaderDefines:{get:function(){return this._shaderDefines}},shaderMaximumIntersectionsLength:{get:function(){return this._shaderMaximumIntersectionsLength}}});var WLt=new h,vLt=new h,FLt=new q,ILt=new h,PLt=new h;Sl.prototype.update=function(e,t,n,i,o){i=i??t.clone(ILt),o=o??n.clone(PLt),t=h.clone(t,this._minBounds),n=h.clone(n,this._maxBounds);let r=h.clamp(t,i,o,this._renderMinBounds),s=h.clamp(n,i,o,this._renderMaxBounds),a=P.getScale(e,vLt);if(r.x>s.x||r.y>s.y||r.z>s.z||(r.x===s.x)+(r.y===s.y)+(r.z===s.z)>=2||a.x===0||a.y===0||a.z===0)return!1;let c=this._renderBoundPlanes;c.get(0).distance=r.x,c.get(1).distance=r.y,c.get(2).distance=r.z,c.get(3).distance=-s.x,c.get(4).distance=-s.y,c.get(5).distance=-s.z,this._shapeTransform=P.clone(e,this._shapeTransform),this._orientedBoundingBox=Pne(r,s,this._shapeTransform,this._orientedBoundingBox),this._boundTransform=P.fromRotationTranslation(this._orientedBoundingBox.halfAxes,this._orientedBoundingBox.center,this._boundTransform),this._boundingSphere=me.fromOrientedBoundingBox(this._orientedBoundingBox,this._boundingSphere);let d=this._shaderUniforms,u=this._shaderDefines;for(let y in u)u.hasOwnProperty(y)&&(u[y]=void 0);let m=0;u.BOX_INTERSECTION_INDEX=m,m+=1;let p=t,b=n,f=h.fromElements(Fne(p.x,b.x),Fne(p.y,b.y),Fne(p.z,b.z),d.boxLocalToShapeUvScale);return this._localToShapeUvTranslate=h.negate(h.multiplyComponents(f,p,this._localToShapeUvTranslate),this._localToShapeUvTranslate),this._shaderMaximumIntersectionsLength=m,!0};function Fne(e,t){return W.equalsEpsilon(e,t,W.EPSILON7)?1:1/(t-e)}var XLt=new P;Sl.prototype.updateViewTransforms=function(e){let t=this._shaderUniforms,n=P.inverse(this._shapeTransform,XLt),i=P.getMatrix3(n,t.boxEcToXyz),o=e.context.uniformState.inverseViewRotation;q.multiply(i,o,t.boxEcToXyz)};Sl.prototype.convertLocalToShapeUvSpace=function(e,t){let{boxLocalToShapeUvScale:n}=this._shaderUniforms,i=this._localToShapeUvTranslate;return h.add(h.multiplyComponents(e,n,t),i,t)};var kz=new h,Ine=new h;Sl.prototype.computeOrientedBoundingBoxForTile=function(e,t,n,i,o){let r=this._minBounds,s=this._maxBounds,a=1/Math.pow(2,e),c=h.fromElements(W.lerp(r.x,s.x,a*t),W.lerp(r.y,s.y,a*n),W.lerp(r.z,s.z,a*i),kz),d=h.fromElements(W.lerp(r.x,s.x,a*(t+1)),W.lerp(r.y,s.y,a*(n+1)),W.lerp(r.z,s.z,a*(i+1)),Ine);return Pne(c,d,this._shapeTransform,o)};var yLe=new h;Sl.prototype.computeOrientedBoundingBoxForSample=function(e,t,n,i){let o=1/Math.pow(2,e.level),r=h.divideComponents(h.ONE,t,yLe),s=h.multiplyByScalar(r,o,yLe),a=h.multiplyByScalar(h.fromElements(e.x+n.x,e.y+n.y,e.z+n.z,kz),o,kz),c=h.add(a,s,Ine),d=this._minBounds,u=this._maxBounds,m=h.fromElements(W.lerp(d.x,u.x,a.x),W.lerp(d.y,u.y,a.y),W.lerp(d.z,u.z,a.z),kz),p=h.fromElements(W.lerp(d.x,u.x,c.x),W.lerp(d.y,u.y,c.y),W.lerp(d.z,u.z,c.z),Ine);return Pne(m,p,this._shapeTransform,i)};Sl.DefaultMinBounds=Object.freeze(new h(-1,-1,-1));Sl.DefaultMaxBounds=Object.freeze(new h(1,1,1));var xLe=new h;function Pne(e,t,n,i){let o=Sl.DefaultMinBounds,r=Sl.DefaultMaxBounds;if(h.equals(e,o)&&h.equals(t,r))i.center=P.getTranslation(n,i.center),i.halfAxes=P.getMatrix3(n,i.halfAxes);else{let a=P.getScale(n,xLe),c=h.midpoint(e,t,WLt);i.center=P.multiplyByPoint(n,c,i.center),a=h.fromElements(a.x*.5*(t.x-e.x),a.y*.5*(t.y-e.y),a.z*.5*(t.z-e.z),xLe);let d=P.getRotation(n,FLt);i.halfAxes=q.setScale(d,a,i.halfAxes)}return i}var BZ=Sl;var Dlo=x(T(),1);function im(){this._orientedBoundingBox=new nn,this._boundingSphere=new me,this._boundTransform=new P,this._shapeTransform=new P,this._minBounds=im.DefaultMinBounds.clone(),this._maxBounds=im.DefaultMaxBounds.clone();let{DefaultMinBounds:e,DefaultMaxBounds:t}=im,n=[new ta(h.negate(h.UNIT_Z,new h),e.z),new ta(h.UNIT_Z,-t.z)];this._renderBoundPlanes=new Dg({planes:n}),this._localToShapeUvTranslate=new h,this._shaderUniforms={cameraShapePosition:new h,cylinderEcToRadialTangentUp:new q,cylinderRenderRadiusMinMax:new k,cylinderRenderAngleMinMax:new k,cylinderLocalToShapeUvScale:new h,cylinderShapeUvAngleRangeOrigin:0},this._shaderDefines={CYLINDER_HAS_SHAPE_BOUNDS_ANGLE:void 0,CYLINDER_HAS_RENDER_BOUNDS_RADIUS_MIN:void 0,CYLINDER_HAS_RENDER_BOUNDS_RADIUS_FLAT:void 0,CYLINDER_HAS_RENDER_BOUNDS_ANGLE:void 0,CYLINDER_HAS_RENDER_BOUNDS_ANGLE_RANGE_EQUAL_ZERO:void 0,CYLINDER_HAS_RENDER_BOUNDS_ANGLE_RANGE_UNDER_HALF:void 0,CYLINDER_HAS_RENDER_BOUNDS_ANGLE_RANGE_OVER_HALF:void 0,CYLINDER_INTERSECTION_INDEX_RADIUS_MAX:void 0,CYLINDER_INTERSECTION_INDEX_RADIUS_MIN:void 0,CYLINDER_INTERSECTION_INDEX_ANGLE:void 0},this._shaderMaximumIntersectionsLength=0}Object.defineProperties(im.prototype,{orientedBoundingBox:{get:function(){return this._orientedBoundingBox}},renderBoundPlanes:{get:function(){return this._renderBoundPlanes}},boundingSphere:{get:function(){return this._boundingSphere}},boundTransform:{get:function(){return this._boundTransform}},shapeTransform:{get:function(){return this._shapeTransform}},shaderUniforms:{get:function(){return this._shaderUniforms}},shaderDefines:{get:function(){return this._shaderDefines}},shaderMaximumIntersectionsLength:{get:function(){return this._shaderMaximumIntersectionsLength}}});var NLt=new h,YLt=new h,MLt=new h,wLt=new h,kLt=new h,ULt=new P,DLt=new h,TLe=new k;im.prototype.update=function(e,t,n,i,o){i=i??t.clone(YLt),o=o??n.clone(MLt),t=h.clone(t,this._minBounds),n=h.clone(n,this._maxBounds);let{DefaultMinBounds:r,DefaultMaxBounds:s}=im,a=s.y-r.y,c=.5*a,d=W.EPSILON10,u=W.EPSILON10;t.x=Math.max(0,t.x),n.x=Math.max(0,n.x),t.y=W.negativePiToPi(t.y),n.y=W.negativePiToPi(n.y),i.y=W.negativePiToPi(i.y),o.y=W.negativePiToPi(o.y);let m=h.maximumByComponent(t,i,wLt),p=h.minimumByComponent(n,o,kLt),b=P.getScale(e,NLt);if(p.x===0||m.x>p.x||m.z>p.z||W.equalsEpsilon(b.x,0,void 0,d)||W.equalsEpsilon(b.y,0,void 0,d)||W.equalsEpsilon(b.z,0,void 0,d))return!1;let f=this._renderBoundPlanes;f.get(0).distance=m.z,f.get(1).distance=-p.z,this._shapeTransform=P.clone(e,this._shapeTransform),this._orientedBoundingBox=Yne(m,p,this._shapeTransform,this._orientedBoundingBox),this._boundTransform=P.fromRotationTranslation(this._orientedBoundingBox.halfAxes,this._orientedBoundingBox.center,this._boundTransform),this._boundingSphere=me.fromOrientedBoundingBox(this._orientedBoundingBox,this._boundingSphere);let y=n.y<t.y,_=n.y-t.y+y*a,S=p.y<m.y,Z=p.y-m.y+S*a,R=Z>=c-u&&Z<a-u,C=Z>u&&Z<c-u,E=Z<=u,A=R||C||E,L=this._shaderUniforms,F=this._shaderDefines;for(let K in F)F.hasOwnProperty(K)&&(F[K]=void 0);let I=0;F.CYLINDER_INTERSECTION_INDEX_RADIUS_MAX=I,I+=1,_<a-u&&(F.CYLINDER_HAS_SHAPE_BOUNDS_ANGLE=!0),m.x!==r.x&&(F.CYLINDER_HAS_RENDER_BOUNDS_RADIUS_MIN=!0,F.CYLINDER_INTERSECTION_INDEX_RADIUS_MIN=I,I+=1),L.cylinderRenderRadiusMinMax=k.fromElements(m.x,p.x,L.cylinderRenderRadiusMinMax),m.x===p.x&&(F.CYLINDER_HAS_RENDER_BOUNDS_RADIUS_FLAT=!0);let N=n.x-t.x,g=0,V=1;N!==0&&(g=1/N,V=-t.x*g);let G=n.z-t.z,v=0,X=1;G!==0&&(v=1/G,X=-t.z*v),A&&(F.CYLINDER_HAS_RENDER_BOUNDS_ANGLE=!0,F.CYLINDER_INTERSECTION_INDEX_ANGLE=I,R?(F.CYLINDER_HAS_RENDER_BOUNDS_ANGLE_RANGE_UNDER_HALF=!0,I+=1):C?(F.CYLINDER_HAS_RENDER_BOUNDS_ANGLE_RANGE_OVER_HALF=!0,I+=2):E&&(F.CYLINDER_HAS_RENDER_BOUNDS_ANGLE_RANGE_EQUAL_ZERO=!0,I+=2),L.cylinderRenderAngleMinMax=k.fromElements(m.y,p.y,L.cylinderRenderAngleMinMax));let Y=(t.y-r.y)/a,D=(n.y-r.y)/a,M=1-_/a,O=(D+.5*M)%1;L.cylinderShapeUvAngleRangeOrigin=O;let w=0,z=1;if(_>u){w=a/_;let K=Y-O;z=-w*(K-Math.floor(K))}return L.cylinderLocalToShapeUvScale=h.fromElements(g,w,v,L.cylinderLocalToShapeUvScale),this._localToShapeUvTranslate=h.fromElements(V,z,X,this._localToShapeUvTranslate),this._shaderMaximumIntersectionsLength=I,!0};var OLt=new q,BLt=new q,zLt=new P;im.prototype.updateViewTransforms=function(e){let t=this._shaderUniforms,n=P.inverse(this._shapeTransform,ULt),i=P.multiplyByPoint(n,e.camera.positionWC,DLt);t.cameraShapePosition=h.fromElements(k.magnitude(i),Math.atan2(i.y,i.x),i.z,t.cameraShapePosition);let o=k.normalize(k.fromCartesian3(i,TLe),TLe),r=q.fromRowMajorArray([o.x,o.y,0,-o.y,o.x,0,0,0,1],OLt),s=e.context.uniformState.inverseView,a=P.multiplyTransformation(n,s,zLt),c=P.getMatrix3(a,BLt);t.cylinderEcToRadialTangentUp=q.multiply(r,c,t.cylinderEcToRadialTangentUp)};im.prototype.convertLocalToShapeUvSpace=function(e,t){let n=Math.hypot(e.x,e.y),i=Math.atan2(e.y,e.x),o=e.z,{cylinderLocalToShapeUvScale:r,cylinderShapeUvAngleRangeOrigin:s}=this._shaderUniforms,a=this._localToShapeUvTranslate;return n=n*r.x+a.x,i=(i+Math.PI)/(2*Math.PI),i-=s,i=i-Math.floor(i),i=i*r.y+a.y,o=o*r.z+a.z,h.fromElements(n,i,o,t)};var Uz=new h,Nne=new h;im.prototype.computeOrientedBoundingBoxForTile=function(e,t,n,i,o){let r=this._minBounds,s=this._maxBounds,a=1/Math.pow(2,e),c=h.fromElements(W.lerp(r.x,s.x,t*a),W.lerp(r.y,s.y,n*a),W.lerp(r.z,s.z,i*a),Uz),d=h.fromElements(W.lerp(r.x,s.x,(t+1)*a),W.lerp(r.y,s.y,(n+1)*a),W.lerp(r.z,s.z,(i+1)*a),Nne);return Yne(c,d,this._shapeTransform,o)};var _Le=new h;im.prototype.computeOrientedBoundingBoxForSample=function(e,t,n,i){let o=1/Math.pow(2,e.level),r=h.divideComponents(h.ONE,t,_Le),s=h.multiplyByScalar(r,o,_Le),a=h.multiplyByScalar(h.fromElements(e.x+n.x,e.y+n.y,e.z+n.z,Uz),o,Uz),c=h.add(a,s,Nne),d=this._minBounds,u=this._maxBounds,m=h.fromElements(W.lerp(d.x,u.x,a.x),W.lerp(d.y,u.y,a.y),W.lerp(d.z,u.z,a.z),Uz),p=h.fromElements(W.lerp(d.x,u.x,c.x),W.lerp(d.y,u.y,c.y),W.lerp(d.z,u.z,c.z),Nne);return Yne(m,p,this._shapeTransform,i)};im.DefaultMinBounds=Object.freeze(new h(0,-W.PI,-1));im.DefaultMaxBounds=Object.freeze(new h(1,+W.PI,1));var HLt=5,KLt=new Array(HLt),JLt=new h,jLt=new q,QLt=new P,qLt=new P,$Lt=new P,Xne=new P,eWt=new h,tWt=new h,nWt=new h,ZLe=new Array(8);for(let e=0;e<8;e++)ZLe[e]=new h;function SLe(e,t,n){return Math.abs(ce.dot(e,t))<n}function iWt(e){let t=P.getColumn(e,0,eWt),n=P.getColumn(e,1,tWt),i=P.getColumn(e,2,nWt),o=W.EPSILON4;return SLe(t,n,o)&&SLe(n,i,o)}function oWt(e,t){let n=ZLe;h.fromElements(-.5,-.5,-.5,n[0]),h.fromElements(-.5,-.5,.5,n[1]),h.fromElements(-.5,.5,-.5,n[2]),h.fromElements(-.5,.5,.5,n[3]),h.fromElements(.5,-.5,-.5,n[4]),h.fromElements(.5,-.5,.5,n[5]),h.fromElements(.5,.5,-.5,n[6]),h.fromElements(.5,.5,.5,n[7]);for(let i=0;i<8;++i)P.multiplyByPoint(e,n[i],n[i]);return nn.fromPoints(n,t)}var rWt=new h;function Yne(e,t,n,i){let o=e.x,r=t.x,s=e.y,a=t.y<s?t.y+W.TWO_PI:t.y,c=e.z,d=t.z,u=a-s,m=s+u*.5,p=KLt,b=0;p[b++]=s,p[b++]=a,p[b++]=m,u>W.PI&&(p[b++]=m-W.PI_OVER_TWO,p[b++]=m+W.PI_OVER_TWO);let f=Number.POSITIVE_INFINITY,y=Number.POSITIVE_INFINITY,_=Number.NEGATIVE_INFINITY,S=Number.NEGATIVE_INFINITY;for(let Y=0;Y<b;++Y){let D=p[Y]-m,M=Math.cos(D),O=Math.sin(D),w=M*o,z=O*o,K=M*r,te=O*r;f=Math.min(f,w,K),y=Math.min(y,z,te),_=Math.max(_,w,K),S=Math.max(S,z,te)}let Z=_-f,R=S-y,C=d-c,E=(f+_)*.5,A=(y+S)*.5,L=(c+d)*.5,F=h.fromElements(E,A,L,JLt),I=q.fromRotationZ(m,jLt),N=h.fromElements(Z,R,C,rWt),g=P.fromScale(N,$Lt),V=P.fromRotation(I,qLt),G=P.fromTranslation(F,QLt),v=P.multiplyTransformation(V,P.multiplyTransformation(G,g,Xne),Xne),X=P.multiplyTransformation(n,v,Xne);return iWt(X)?nn.fromTransformation(X,i):oWt(X,i)}var zZ=im;var ido=x(T(),1);function xh(){this._orientedBoundingBox=new nn,this._boundingSphere=new me,this._boundTransform=new P,this._shapeTransform=new P,this._rectangle=new re,this._minimumHeight=xh.DefaultMinBounds.z,this._maximumHeight=xh.DefaultMaxBounds.z,this._ellipsoid=new ne,this._translation=new h,this._rotation=new q,this._localToShapeUvTranslate=new h,this._shaderUniforms={cameraPositionCartographic:new h,ellipsoidEcToEastNorthUp:new q,ellipsoidRadii:new h,eccentricitySquared:0,evoluteScale:new k,ellipsoidCurvatureAtLatitude:new k,ellipsoidInverseRadiiSquared:new h,ellipsoidRenderLongitudeMinMax:new k,ellipsoidShapeUvLongitudeRangeOrigin:0,ellipsoidShapeUvLongitudeMinMaxMid:new h,ellipsoidLocalToShapeUvScale:new h,ellipsoidRenderLatitudeSinMinMax:new k,clipMinMaxHeight:new k},this._shaderDefines={ELLIPSOID_HAS_RENDER_BOUNDS_LONGITUDE:void 0,ELLIPSOID_HAS_RENDER_BOUNDS_LONGITUDE_RANGE_EQUAL_ZERO:void 0,ELLIPSOID_HAS_RENDER_BOUNDS_LONGITUDE_RANGE_UNDER_HALF:void 0,ELLIPSOID_HAS_RENDER_BOUNDS_LONGITUDE_RANGE_OVER_HALF:void 0,ELLIPSOID_HAS_SHAPE_BOUNDS_LONGITUDE:void 0,ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MAX_UNDER_HALF:void 0,ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MAX_EQUAL_HALF:void 0,ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MAX_OVER_HALF:void 0,ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MIN_UNDER_HALF:void 0,ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MIN_EQUAL_HALF:void 0,ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MIN_OVER_HALF:void 0,ELLIPSOID_HAS_SHAPE_BOUNDS_LATITUDE:void 0,ELLIPSOID_INTERSECTION_INDEX_LONGITUDE:void 0,ELLIPSOID_INTERSECTION_INDEX_LATITUDE_MAX:void 0,ELLIPSOID_INTERSECTION_INDEX_LATITUDE_MIN:void 0,ELLIPSOID_INTERSECTION_INDEX_HEIGHT_MAX:void 0,ELLIPSOID_INTERSECTION_INDEX_HEIGHT_MIN:void 0},this._shaderMaximumIntersectionsLength=0}Object.defineProperties(xh.prototype,{orientedBoundingBox:{get:function(){return this._orientedBoundingBox}},boundingSphere:{get:function(){return this._boundingSphere}},boundTransform:{get:function(){return this._boundTransform}},shapeTransform:{get:function(){return this._shapeTransform}},shaderUniforms:{get:function(){return this._shaderUniforms}},shaderDefines:{get:function(){return this._shaderDefines}},shaderMaximumIntersectionsLength:{get:function(){return this._shaderMaximumIntersectionsLength}}});var sWt=new h,aWt=new h,cWt=new h,lWt=new h,dWt=new h,uWt=new h,mWt=new h,hWt=new h,RLe=new h,CLe=new h,fWt=new re;xh.prototype.update=function(e,t,n,i,o){let{DefaultMinBounds:r,DefaultMaxBounds:s}=xh;i=i??r,o=o??s;let a=W.EPSILON10,c=W.EPSILON10,d=W.EPSILON10,u=W.EPSILON3,m=P.getScale(e,hWt),p=h.clone(r,sWt);p.z=-h.minimumComponent(m);let b=h.clamp(t,p,s,aWt),f=h.clamp(n,p,s,cWt),y=h.clamp(i,p,s,lWt),_=h.clamp(o,p,s,dWt),S=h.maximumByComponent(b,y,uWt),Z=h.minimumByComponent(f,_,mWt),R=h.add(m,h.fromElements(f.z,f.z,f.z,RLe),RLe),C=h.add(m,h.fromElements(Z.z,Z.z,Z.z,CLe),CLe);if(S.y>Z.y||S.y===s.y||Z.y===r.y||S.z>Z.z||W.equalsEpsilon(C,h.ZERO,void 0,a))return!1;this._rectangle=re.fromRadians(b.x,b.y,f.x,f.y),this._translation=P.getTranslation(e,this._translation),this._rotation=P.getRotation(e,this._rotation),this._ellipsoid=ne.fromCartesian3(m,this._ellipsoid),this._minimumHeight=b.z,this._maximumHeight=f.z;let E=re.fromRadians(S.x,S.y,Z.x,Z.y,fWt);this._orientedBoundingBox=Mne(E,S.z,Z.z,this._ellipsoid,this._translation,this._rotation,this._orientedBoundingBox),this._shapeTransform=P.fromRotationTranslation(this._rotation,this._translation,this._shapeTransform),this._boundTransform=P.fromRotationTranslation(this._orientedBoundingBox.halfAxes,this._orientedBoundingBox.center,this._boundTransform),this._boundingSphere=me.fromOrientedBoundingBox(this._orientedBoundingBox,this._boundingSphere);let A=s.x-r.x,L=.5*A,F=Z.x<S.x,I=Z.x-S.x+F*A,N=I<=c,g=I>=L-c&&I<A-c,V=I>c&&I<L-c,G=N||g||V,v=f.x<b.x,X=f.x-b.x+v*A,Y=X>L+c&&X<A-c,D=X>=L-c&&X<=L+c,M=X<L-c,O=Y||D||M,w=Z.y<-u,z=Z.y>=-u&&Z.y<=+u,K=Z.y>+u&&Z.y<s.y-d,te=w||z||K,H=S.y>r.y+d&&S.y<-u,$=S.y>=-u&&S.y<=+u,ee=S.y>+u,le=H||$||ee,_e=te||le,he=f.y-b.y,Ze=f.y<-u,ye=f.y>=-u&&f.y<=+u,Ge=f.y>+u&&f.y<s.y-d,Ae=Ze||ye||Ge,Fe=b.y>r.y+d&&b.y<-u,tt=b.y>=-u&&b.y<=+u,Be=b.y>+u,qe=Ae||(Fe||tt||Be),We=this._shaderUniforms,Ke=this._shaderDefines;for(let jn in Ke)Ke.hasOwnProperty(jn)&&(Ke[jn]=void 0);We.ellipsoidRadii=h.clone(R,We.ellipsoidRadii);let{x:ct,z:Et}=We.ellipsoidRadii,zt=Et/ct;We.eccentricitySquared=1-zt*zt,We.evoluteScale=k.fromElements((ct*ct-Et*Et)/ct,(Et*Et-ct*ct)/Et,We.evoluteScale),We.ellipsoidInverseRadiiSquared=h.divideComponents(h.ONE,h.multiplyComponents(We.ellipsoidRadii,We.ellipsoidRadii,We.ellipsoidInverseRadiiSquared),We.ellipsoidInverseRadiiSquared);let ut=0;Ke.ELLIPSOID_INTERSECTION_INDEX_HEIGHT_MAX=ut,ut+=1,Ke.ELLIPSOID_INTERSECTION_INDEX_HEIGHT_MIN=ut,ut+=1,We.clipMinMaxHeight=k.fromElements(S.z-f.z,Z.z-f.z,We.clipMinMaxHeight);let bt=f.z-b.z,ht=bt===0?0:1/bt;G&&(Ke.ELLIPSOID_HAS_RENDER_BOUNDS_LONGITUDE=!0,Ke.ELLIPSOID_INTERSECTION_INDEX_LONGITUDE=ut,g?(Ke.ELLIPSOID_HAS_RENDER_BOUNDS_LONGITUDE_RANGE_UNDER_HALF=!0,ut+=1):V?(Ke.ELLIPSOID_HAS_RENDER_BOUNDS_LONGITUDE_RANGE_OVER_HALF=!0,ut+=2):N&&(Ke.ELLIPSOID_HAS_RENDER_BOUNDS_LONGITUDE_RANGE_EQUAL_ZERO=!0,ut+=2),We.ellipsoidRenderLongitudeMinMax=k.fromElements(S.x,Z.x,We.ellipsoidRenderLongitudeMinMax));let jt=0,st=1;if(O){Ke.ELLIPSOID_HAS_SHAPE_BOUNDS_LONGITUDE=!0;let jn=(b.x-r.x)/A,Si=(f.x-r.x)/A,Hi=1-X/A,Gi=(Si+.5*Hi)%1;if(We.ellipsoidShapeUvLongitudeRangeOrigin=Gi,X>c){jt=A/X;let pi=jn-Gi;st=-jt*(pi-Math.floor(pi))}}_e&&(le&&(Ke.ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MIN=!0,Ke.ELLIPSOID_INTERSECTION_INDEX_LATITUDE_MIN=ut,H?(Ke.ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MIN_UNDER_HALF=!0,ut+=1):$?(Ke.ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MIN_EQUAL_HALF=!0,ut+=1):ee&&(Ke.ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MIN_OVER_HALF=!0,ut+=2)),te&&(Ke.ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MAX=!0,Ke.ELLIPSOID_INTERSECTION_INDEX_LATITUDE_MAX=ut,w?(Ke.ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MAX_UNDER_HALF=!0,ut+=2):z?(Ke.ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MAX_EQUAL_HALF=!0,ut+=1):K&&(Ke.ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MAX_OVER_HALF=!0,ut+=1)),We.ellipsoidRenderLatitudeSinMinMax=k.fromElements(Math.sin(S.y),Math.sin(Z.y),We.ellipsoidRenderLatitudeSinMinMax));let pt=0,Mi=1;return qe&&(Ke.ELLIPSOID_HAS_SHAPE_BOUNDS_LATITUDE=!0,he>d&&(pt=(s.y-r.y)/he,Mi=(r.y-b.y)/he)),We.ellipsoidLocalToShapeUvScale=h.fromElements(jt,pt,ht,We.ellipsoidLocalToShapeUvScale),this._localToShapeUvTranslate=h.fromElements(st,Mi,0,this._localToShapeUvTranslate),this._shaderMaximumIntersectionsLength=ut,!0};var pWt=new pe,bWt=new h,gWt=new P,VLe=new q;xh.prototype.updateViewTransforms=function(e){let t=this._shaderUniforms,n=this._ellipsoid,i=e.camera.positionWC,o=n.cartesianToCartographic(i,pWt);h.fromElements(o.longitude,o.latitude,o.height,t.cameraPositionCartographic);let r=h.fromRadians(o.longitude,o.latitude,0,n,bWt);t.ellipsoidCurvatureAtLatitude=n.getLocalCurvature(r,t.ellipsoidCurvatureAtLatitude);let s=_t.eastNorthUpToFixedFrame(r,n,gWt),a=P.getRotation(s,VLe),c=e.context.uniformState.viewRotation,d=q.multiply(c,a,VLe);t.ellipsoidEcToEastNorthUp=q.transpose(d,t.ellipsoidEcToEastNorthUp)};var FLe=new re;xh.prototype.computeOrientedBoundingBoxForTile=function(e,t,n,i,o){let r=1/Math.pow(2,e),s=t*r,a=(t+1)*r,c=n*r,d=(n+1)*r,u=i*r,m=(i+1)*r,p=re.subsection(this._rectangle,s,c,a,d,FLe),b=W.lerp(this._minimumHeight,this._maximumHeight,u),f=W.lerp(this._minimumHeight,this._maximumHeight,m);return Mne(p,b,f,this._ellipsoid,this._translation,this._rotation,o)};var yWt=new k,xWt=new k,X9=new k,ELe=new k,ALe=new k,N9=new k;function TWt(e,t,n,i){let o=k.abs(e,yWt),r=k.fromElements(1/t.x,1/t.y,xWt),s=k.fromElements(Math.SQRT1_2,Math.SQRT1_2,X9),a=k.multiplyComponents(t,s,ELe),c=k.fromElements(n.x*s.x*s.x*s.x,n.y*s.y*s.y*s.y,ALe);for(let d=0;d<3;++d){let u=k.magnitude(k.subtract(a,c,N9)),m=k.normalize(k.subtract(o,c,N9),N9),p=k.multiplyByScalar(m,u,N9);s=k.multiplyComponents(k.add(p,c,X9),r,X9),s=k.normalize(k.clamp(s,k.ZERO,k.ONE,X9),X9),a=k.multiplyComponents(t,s,ELe),c=k.fromElements(n.x*s.x*s.x*s.x,n.y*s.y*s.y*s.y,ALe)}return h.fromElements(Math.sign(e.x)*a.x,Math.sign(e.y)*a.y,k.magnitude(k.subtract(a,c,N9)),i)}var _Wt=new k,GLe=new k,SWt=new h,LLe=new k;xh.prototype.convertLocalToShapeUvSpace=function(e,t){let n=Math.atan2(e.y,e.x),{ellipsoidRadii:i,evoluteScale:o,ellipsoidInverseRadiiSquared:r,ellipsoidShapeUvLongitudeRangeOrigin:s,ellipsoidLocalToShapeUvScale:a}=this._shaderUniforms,c=this._localToShapeUvTranslate,d=Math.hypot(e.x,e.y),u=k.fromElements(d,e.z,GLe),m=TWt(u,k.fromElements(i.x,i.z,_Wt),o,SWt),p=k.normalize(k.fromElements(m.x*r.x,m.y*r.z,LLe),LLe),b=Math.atan2(p.y,p.x),f=k.magnitude(u)<k.magnitude(m)?-1:1,y=k.subtract(u,m,GLe),_=f*k.magnitude(y),{ELLIPSOID_HAS_SHAPE_BOUNDS_LONGITUDE:S,ELLIPSOID_HAS_SHAPE_BOUNDS_LATITUDE:Z}=this._shaderDefines;return n=(n+Math.PI)/(2*Math.PI),l(S)&&(n-=s,n=n-Math.floor(n),n=n*a.x+c.x),b=(b+Math.PI/2)/Math.PI,l(Z)&&(b=b*a.y+c.y),_=1+_*a.z,h.fromElements(n,b,_,t)};var WLe=new h,vLe=new h,ZWt=new h;xh.prototype.computeOrientedBoundingBoxForSample=function(e,t,n,i){let o=1/Math.pow(2,e.level),r=h.divideComponents(h.ONE,t,WLe),s=h.multiplyByScalar(r,o,WLe),a=h.multiplyByScalar(h.fromElements(e.x+n.x,e.y+n.y,e.z+n.z,vLe),o,vLe),c=h.add(a,s,ZWt),d=re.subsection(this._rectangle,a.x,a.y,c.x,c.y,FLe),u=W.lerp(this._minimumHeight,this._maximumHeight,a.z),m=W.lerp(this._minimumHeight,this._maximumHeight,c.z);return Mne(d,u,m,this._ellipsoid,this._translation,this._rotation,i)};function Mne(e,t,n,i,o,r,s){return s=nn.fromRectangle(e,t,n,i,s),s.center=h.add(s.center,o,s.center),s.halfAxes=q.multiply(s.halfAxes,r,s.halfAxes),s}xh.DefaultMinBounds=Object.freeze(new h(-W.PI,-W.PI_OVER_TWO,-ne.WGS84.minimumRadius));xh.DefaultMaxBounds=Object.freeze(new h(W.PI,W.PI_OVER_TWO,10*ne.WGS84.maximumRadius));var HZ=xh;var iu={BOX:"BOX",ELLIPSOID:"ELLIPSOID",CYLINDER:"CYLINDER"};iu.getMinBounds=function(e){switch(e){case iu.BOX:return BZ.DefaultMinBounds;case iu.ELLIPSOID:return HZ.DefaultMinBounds;case iu.CYLINDER:return zZ.DefaultMinBounds}};iu.getMaxBounds=function(e){switch(e){case iu.BOX:return BZ.DefaultMaxBounds;case iu.ELLIPSOID:return HZ.DefaultMaxBounds;case iu.CYLINDER:return zZ.DefaultMaxBounds}};iu.getShapeConstructor=function(e){switch(e){case iu.BOX:return BZ;case iu.ELLIPSOID:return HZ;case iu.CYLINDER:return zZ}};Object.freeze(iu);var Tc=iu;var ruo=x(T(),1);var mdo=x(T(),1);function Hf(e){this._comparator=e.comparator,this._maximumLength=e.maximumLength,this._array=l(e.maximumLength)?new Array(e.maximumLength):[],this._length=0}Object.defineProperties(Hf.prototype,{length:{get:function(){return this._length}},maximumLength:{get:function(){return this._maximumLength},set:function(e){if(l(e)){for(;this._length>e;)this.removeMinimum();this._array.length=e}this._maximumLength=e}},internalArray:{get:function(){return this._array}},comparator:{get:function(){return this._comparator}}});Hf.prototype.clone=function(){let e=this._maximumLength,t=this._comparator,n=this._array,i=this._length,o=new Hf({comparator:t,maximumLength:e});o._length=i;for(let r=0;r<i;r++)o._array[r]=n[r];return o};Hf.prototype.reset=function(){this._length=0;let e=this._maximumLength;if(l(e))for(let t=0;t<e;t++)this._array[t]=void 0;else this._array.length=0};Hf.prototype.resort=function(){let e=this._length;for(let t=0;t<e;t++)ILe(this,t)};Hf.prototype.insert=function(e){let t,n=this._maximumLength;if(l(n)){if(n===0)return;if(this._length===n){let o=this._array[0];if(this._comparator(e,o)<=0)return e;t=this.removeMinimum()}}let i=this._length;return this._array[i]=e,this._length++,ILe(this,i),t};Hf.prototype.removeMinimum=function(){let e=this._length;if(e===0)return;this._length--;let t=this._array[0];return e>=2&&(this._array[0]=this._array[e-1],PLe(this,0)),this._array[e-1]=void 0,t};Hf.prototype.removeMaximum=function(){let e=this._length;if(e===0)return;this._length--;let t;if(e<=2)t=this._array[e-1];else{let n=wne(this,1,2)?1:2;t=this._array[n],this._array[n]=this._array[e-1],e>=4&&PLe(this,n)}return this._array[e-1]=void 0,t};Hf.prototype.getMinimum=function(){if(this._length!==0)return this._array[0]};Hf.prototype.getMaximum=function(){let e=this._length;if(e!==0)return e<=2?this._array[e-1]:this._array[wne(this,1,2)?1:2]};function Dz(e,t,n){let i=e._array,o=i[t];i[t]=i[n],i[n]=o}function Y9(e,t,n){return e._comparator(e._array[t],e._array[n])<0}function wne(e,t,n){return e._comparator(e._array[t],e._array[n])>0}function ILe(e,t){if(t===0)return;let n=Math.floor(W.log2(t+1))%2===0,i=Math.floor((t-1)/2),o=Y9(e,t,i);for(o!==n&&(Dz(e,t,i),t=i);t>=3;){let r=Math.floor((t-3)/4);if(Y9(e,t,r)!==o)break;Dz(e,t,r),t=r}}function PLe(e,t){let n=e._length,i=Math.floor(W.log2(t+1))%2===0,o;for(;(o=2*t+1)<n;){let r=o,s=o+1;if(s<n){Y9(e,s,r)===i&&(r=s);let a=2*o+1,c=Math.max(Math.min(n-a,4),0);for(let d=0;d<c;d++){let u=a+d;Y9(e,u,r)===i&&(r=u)}}if(Y9(e,r,t)===i&&(Dz(e,r,t),r!==o&&r!==s)){let a=Math.floor((r-1)/2);wne(e,r,a)===i&&Dz(e,r,a)}t=r}}var Bg=Hf;var fdo=x(T(),1),kne=Object.freeze({UNLOADED:0,RECEIVING:1,PROCESSING:2,LOADED:3,FAILED:4,UNAVAILABLE:5});function M9(e,t){this.spatialNode=e,this.keyframe=t,this.state=kne.UNLOADED,this.content=void 0,this.megatextureIndex=-1,this.priority=-Number.MAX_VALUE,this.highPriorityFrameNumber=-1}M9.prototype.unload=function(){this.content=this.content&&this.content.destroy(),this.spatialNode=void 0,this.state=kne.UNLOADED,this.megatextureIndex=-1,this.priority=-Number.MAX_VALUE,this.highPriorityFrameNumber=-1};M9.priorityComparator=function(e,t){return e.priority-t.priority};M9.searchComparator=function(e,t){return e.keyframe-t.keyframe};M9.LoadState=kne;var Bo=M9;var Ldo=x(T(),1);function E0(e,t,n,i,o=134217728,r){let s=RWt(i),a=CWt(n),c=n*Nt.getSizeInBytes(i),d=E0.get3DTextureDimension(t,c,o,r),u=h.divideComponents(d,t,new h);this.channelCount=n,this.componentType=i,this.textureMemoryByteLength=c*d.x*d.y*d.z,this.tileCounts=h.clone(u,new h),this.voxelCountPerTile=h.clone(t,new h),this.maximumTileCount=u.x*u.y*u.z,this.texture=new Sv({context:e,pixelFormat:a,pixelDatatype:s,flipY:!1,width:d.x,height:d.y,depth:d.z,sampler:new Ot({wrapR:pn.CLAMP_TO_EDGE,wrapS:pn.CLAMP_TO_EDGE,wrapT:pn.CLAMP_TO_EDGE,minificationFilter:Ht.LINEAR,magnificationFilter:$n.LINEAR})}),this.nodes=new Array(this.maximumTileCount);for(let m=0;m<this.maximumTileCount;m++)this.nodes[m]=new VWt(m);for(let m=0;m<this.maximumTileCount;m++){let p=this.nodes[m];p.previousNode=m>0?this.nodes[m-1]:void 0,p.nextNode=m<this.maximumTileCount-1?this.nodes[m+1]:void 0}this.occupiedList=void 0,this.emptyList=this.nodes[0],this.occupiedCount=0,this._nearestSampling=!1}Object.defineProperties(E0.prototype,{nearestSampling:{get:function(){return this._nearestSampling},set:function(e){this._nearestSampling!==e&&(e?this.texture.sampler=Ot.NEAREST:this.texture.sampler=new Ot({wrapR:pn.CLAMP_TO_EDGE,wrapS:pn.CLAMP_TO_EDGE,wrapT:pn.CLAMP_TO_EDGE,minificationFilter:Ht.LINEAR,magnificationFilter:$n.LINEAR}),this._nearestSampling=e)}}});function RWt(e){if(e===Nt.FLOAT32||e===Nt.FLOAT64)return Ue.FLOAT;if(e===Nt.UINT8)return Ue.UNSIGNED_BYTE}function CWt(e){switch(e){case 1:return Qe.RED;case 2:return Qe.RG;case 3:return Qe.RGB;case 4:return Qe.RGBA}}function VWt(e){this.index=e,this.nextNode=void 0,this.previousNode=void 0}E0.prototype.add=function(e){if(this.isFull())throw new ge("Trying to add when there are no empty spots");let t=this.emptyList;this.emptyList=this.emptyList.nextNode,l(this.emptyList)&&(this.emptyList.previousNode=void 0),t.nextNode=this.occupiedList,l(t.nextNode)&&(t.nextNode.previousNode=t),this.occupiedList=t;let n=t.index;return this.writeDataToTexture(n,e),this.occupiedCount++,n};E0.prototype.remove=function(e){if(e<0||e>=this.maximumTileCount)throw new ge("Megatexture index out of bounds");let t=this.nodes[e];l(t.previousNode)&&(t.previousNode.nextNode=t.nextNode),l(t.nextNode)&&(t.nextNode.previousNode=t.previousNode),t.nextNode=this.emptyList,l(t.nextNode)&&(t.nextNode.previousNode=t),t.previousNode=void 0,this.emptyList=t,this.occupiedCount--};E0.prototype.isFull=function(){return this.emptyList===void 0};E0.get3DTextureDimension=function(e,t,n,i){let{maximum3DTextureSize:o}=wt;if(h.maximumComponent(e)>o)throw new ae("The GL context does not support a 3D texture large enough to contain a tile with the given dimensions.");let r=t*e.x*e.y*e.z,s=Math.floor(n/r);if(s<1)throw new ae("Not enough texture memory available to create a megatexture with the given tile dimensions.");l(i)?i=Math.min(i,s):i=s;let a=Object.entries(e).sort((u,m)=>m[1]-u[1]),c=a.map(([u,m])=>Math.floor(o/m));for(let u=0;u<3;u++){let m=XLe(c);if(m<i)break;let p=c.slice();p.splice(u,1);let b=p[0]*p[1],f=m-i,y=Math.floor(f/b);c[u]-=y}XLe(c)>s&&(c[2]=Math.floor(s/(c[0]*c[1])));let d=new h;for(let u=0;u<3;u++){let[m,p]=a[u];d[m]=c[u]*p}return d};function XLe(e){return e.reduce((t,n)=>t*n)}E0.prototype.writeDataToTexture=function(e,t){let{tileCounts:n,voxelCountPerTile:i}=this,o={arrayBufferView:t,width:i.x,height:i.y,depth:i.z},r=n.x*n.y,s=Math.floor(e/r),a=e-s*r,c=Math.floor(a/n.x),d=a-c*n.x,u={source:o,xOffset:d*i.x,yOffset:c*i.y,zOffset:s*i.z};this.texture.copyFrom(u)};E0.prototype.isDestroyed=function(){return!1};E0.prototype.destroy=function(){return this.texture=this.texture&&this.texture.destroy(),ue(this)};var w9=E0;var wdo=x(T(),1);function Th(e,t,n,i,o,r,s){this.children=void 0,this.parent=o,this.level=e,this.x=t,this.y=n,this.z=i,this.dimensions=h.clone(s),this.keyframeNodes=[],this.renderableKeyframeNodes=[],this.renderableKeyframeNodeLerp=0,this.renderableKeyframeNodePrevious=void 0,this.renderableKeyframeNodeNext=void 0,this.orientedBoundingBox=new nn,this.approximateVoxelSize=0,this.screenSpaceError=0,this.visitedFrameNumber=-1,this.computeBoundingVolumes(r)}var EWt=new h;Th.prototype.computeBoundingVolumes=function(e){this.orientedBoundingBox=e.computeOrientedBoundingBoxForTile(this.level,this.x,this.y,this.z,this.orientedBoundingBox);let t=q.getScale(this.orientedBoundingBox.halfAxes,EWt),n=2*h.maximumComponent(t);this.approximateVoxelSize=n/h.minimumComponent(this.dimensions)};Th.prototype.constructChildNodes=function(e){let{level:t,x:n,y:i,z:o}=this,r=n*2,s=i*2,a=o*2,c=s+1,d=r+1,u=a+1,m=t+1,p=[[m,r,s,a],[m,d,s,a],[m,r,c,a],[m,d,c,a],[m,r,s,u],[m,d,s,u],[m,r,c,u],[m,d,c,u]];this.children=p.map(([b,f,y,_])=>new Th(b,f,y,_,this,e,this.dimensions))};Th.prototype.visibility=function(e,t){let n=this.orientedBoundingBox;return e.cullingVolume.computeVisibilityWithPlaneMask(n,t)};Th.prototype.computeScreenSpaceError=function(e,t){let n=this.orientedBoundingBox,i=Math.sqrt(n.distanceSquaredTo(e));i=Math.max(i,W.EPSILON7);let o=this.approximateVoxelSize,r=t*(o/i);this.screenSpaceError=r};var NLe={keyframe:0};function k9(e,t){return NLe.keyframe=e,Eo(t,NLe,Bo.searchComparator)}Th.prototype.computeSurroundingRenderableKeyframeNodes=function(e){let t=this,n=t.level,i=Math.floor(e),o=Math.ceil(e),r,s,a=+Number.MAX_VALUE,c=+Number.MAX_VALUE;for(;l(t);){let{renderableKeyframeNodes:m}=t;if(m.length>=1){let p=AWt(i,m),b=m[p],f=o===i||i<b.keyframe?p:Math.min(p+1,m.length-1),y=m[f],_=i-b.keyframe,S=YLe(n-t.level,_);S<a&&(a=S,r=b);let Z=y.keyframe-o,R=YLe(n-t.level,Z);if(R<c&&(c=R,s=y),_===0&&Z===0)break}t=t.parent}if(this.renderableKeyframeNodePrevious=r,this.renderableKeyframeNodeNext=s,!l(r)||!l(s))return;let d=r.keyframe,u=s.keyframe;this.renderableKeyframeNodeLerp=d===u?0:W.clamp((e-d)/(u-d),0,1)};function AWt(e,t){let n=k9(e,t);return n<0?W.clamp(~n-1,0,t.length-1):n}function YLe(e,t){let n=Math.exp(e*4),i=t>=0?1:-200;return e*n+t*i}Th.prototype.isVisited=function(e){return this.visitedFrameNumber===e};Th.prototype.createKeyframeNode=function(e){let t=k9(e,this.keyframeNodes);if(t<0){t=~t;let n=new Bo(this,e);this.keyframeNodes.splice(t,0,n)}};Th.prototype.destroyKeyframeNode=function(e,t){let n=e.keyframe,i=k9(n,this.keyframeNodes);if(i<0)throw new ge("Keyframe node does not exist.");if(this.keyframeNodes.splice(i,1),e.megatextureIndex!==-1){for(let r=0;r<t.length;r++)t[r].remove(e.megatextureIndex);let o=k9(n,this.renderableKeyframeNodes);if(o<0)throw new ge("Renderable keyframe node does not exist.");this.renderableKeyframeNodes.splice(o,1)}e.unload()};Th.prototype.addKeyframeNodeToMegatextures=function(e,t){if(e.megatextureIndex!==-1||e.content.metadata.length!==t.length)throw new ge("Keyframe node cannot be added to megatexture");let{metadata:n}=e.content;for(let r=0;r<t.length;r++){let s=t[r];e.megatextureIndex=s.add(n[r])}let i=this.renderableKeyframeNodes,o=k9(e.keyframe,i);if(o>=0)throw new ge("Keyframe already renderable");o=~o,i.splice(o,0,e)};Th.prototype.isRenderable=function(e){let t=this.renderableKeyframeNodePrevious,n=this.renderableKeyframeNodeNext,i=this.level;return l(t)&&l(n)&&(t.spatialNode.level===i||n.spatialNode.level===i)&&this.visitedFrameNumber===e};var U9=Th;function dT(e,t,n,i){let{provider:o,dimensions:r,inputDimensions:s}=e,{types:a,componentTypes:c}=o;l(i)?i=Math.min(Math.max(0,i),512*1024*1024):i=128*1024*1024,this._primitive=e,this.textureMemoryByteLength=0,this.megatextures=new Array(a.length);let d=l(o.maximumTileCount)?o.maximumTileCount:l(o.availableLevels)?(8**o.availableLevels-1)/7:void 0;for(let S=0;S<a.length;S++){let Z=a[S],R=St.getComponentCount(Z),C=c[S];this.megatextures[S]=new w9(t,s,R,C,i,d),this.textureMemoryByteLength+=this.megatextures[S].textureMemoryByteLength}let u=this.megatextures[0].maximumTileCount;this._simultaneousRequestCount=0,this._debugPrint=!1,this._calculateStatistics=this._primitive._calculateStatistics??!1,this._frameNumber=0;let m=e._shape;this.rootNode=new U9(0,0,0,0,void 0,m,r),this._priorityQueue=new Bg({maximumLength:u,comparator:Bo.priorityComparator}),this._highPriorityKeyframeNodes=new Array(u),this._highPriorityKeyframeNodeCount=0,this._keyframeNodesInMegatexture=new Array(u),this._keyframeCount=n,this._sampleCount=void 0,this._keyframeLocation=0,this._binaryTreeKeyframeWeighting=new Array(n),this._initialTilesLoaded=!1;let p=this._binaryTreeKeyframeWeighting;p[0]=0,p[n-1]=0,Une(p,1,n-2,0);let b=9,f=2048,y=Math.floor(f/b),_=Math.ceil(u/y);this.internalNodeTexture=new vt({context:t,pixelFormat:Qe.RGBA,pixelDatatype:Ue.UNSIGNED_BYTE,flipY:!1,width:f,height:_,sampler:new Ot({minificationFilter:Ht.NEAREST,magnificationFilter:$n.NEAREST})}),this.internalNodeTilesPerRow=y,this.internalNodeTexelSizeUv=new k(1/f,1/_),this.leafNodeTexture=void 0,this.leafNodeTilesPerRow=void 0,this.leafNodeTexelSizeUv=new k}dT.prototype.findKeyframeNode=function(e){return this._keyframeNodesInMegatexture.find(function(t){return t.megatextureIndex===e})};function Une(e,t,n,i){if(t>n)return;let o=Math.floor((t+n)/2);e[o]=i,Une(e,t,o-1,i+1),Une(e,o+1,n,i+1)}dT.simultaneousRequestCountMaximum=50;dT.prototype.update=function(e,t,n,i){let o=this._primitive,r=e.context,s=this.megatextures[0].maximumTileCount,a=this._keyframeCount,c=o._levelBlendFactor,d=c>0,u=a>1,m=(d?2:1)*(u?2:1);this._sampleCount=m;let p=m>=2;if(p&&!l(this.leafNodeTexture)){let R=Math.floor(512),C=Math.ceil(s/R);this.leafNodeTexture=new vt({context:r,pixelFormat:Qe.RGBA,pixelDatatype:Ue.UNSIGNED_BYTE,flipY:!1,width:1024,height:C,sampler:new Ot({minificationFilter:Ht.NEAREST,magnificationFilter:$n.NEAREST})}),this.leafNodeTexelSizeUv=k.fromElements(1/1024,1/C,this.leafNodeTexelSizeUv),this.leafNodeTilesPerRow=R}else!p&&l(this.leafNodeTexture)&&(this.leafNodeTexture=this.leafNodeTexture.destroy());if(this._keyframeLocation=W.clamp(t,0,a-1),n&&MLe(this,this.rootNode),i)return;this._frameNumber=e.frameNumber;let b=Zn();WWt(this,e),vWt(this,e);let f=Zn();NWt(this,m,c);let y=Zn(),_=o.loadProgress.numberOfListeners>0||o.allTilesLoaded.numberOfListeners>0||o.initialTilesLoaded.numberOfListeners>0;if(this._debugPrint||this._calculateStatistics||_){let S=f-b,Z=y-f,R=y-b;XWt(this,e,S,Z,R)}};dT.prototype.isRenderable=function(e){return e.isRenderable(this._frameNumber)};dT.prototype.isDestroyed=function(){return!1};dT.prototype.destroy=function(){let e=this.megatextures,t=e.length;for(let n=0;n<t;n++)e[n]=e[n]&&e[n].destroy();return this.textureMemoryByteLength=0,this.internalNodeTexture=this.internalNodeTexture&&this.internalNodeTexture.destroy(),this.leafNodeTexture=this.leafNodeTexture&&this.leafNodeTexture.destroy(),ue(this)};function MLe(e,t){if(t.computeBoundingVolumes(e._primitive._shape),l(t.children))for(let n=0;n<8;n++){let i=t.children[n];MLe(e,i)}}function GWt(e,t){if(e._simultaneousRequestCount>=dT.simultaneousRequestCountMaximum)return;let i=e._primitive.provider,{keyframe:o,spatialNode:r}=t;if(l(i.availableLevels)&&r.level>=i.availableLevels)return;function s(u){e._simultaneousRequestCount--,t.content=u,t.state=l(u)?Bo.LoadState.PROCESSING:Bo.LoadState.UNAVAILABLE}function a(u){e._simultaneousRequestCount--,t.state=Bo.LoadState.FAILED,e._primitive.tileFailed.raiseEvent()}let c={tileLevel:r.level,tileX:r.x,tileY:r.y,tileZ:r.z,keyframe:o},d=i.requestData(c);l(d)&&(e._simultaneousRequestCount++,t.state=Bo.LoadState.RECEIVING,d.then(s).catch(a))}function LWt(e){return e/(1+e)}function WWt(e,t){let n=e._frameNumber,i=e._priorityQueue;i.reset(),wLe(e.rootNode,$s.MASK_INDETERMINATE,e,t);let o=e._highPriorityKeyframeNodes,r=0,s;for(;i.length>0;)s=i.removeMaximum(),s.highPriorityFrameNumber=n,o[r]=s,r++;e._highPriorityKeyframeNodeCount=r}function vWt(e,t){let n=e.megatextures[0],i=n.occupiedCount,o=e._keyframeNodesInMegatexture;o.length=i,o.sort(FWt);let r=e._highPriorityKeyframeNodes,s=e._highPriorityKeyframeNodeCount,a=0,c=0;for(let d=0;d<s;d++){let u=r[d];if(!(u.state===Bo.LoadState.LOADED||u.spatialNode===void 0)&&(u.state===Bo.LoadState.UNLOADED&&GWt(e,u),u.state===Bo.LoadState.PROCESSING)){let{content:m}=u;if(m.update(e._primitive,t),!m.ready)continue;if(!IWt(m.metadata,e)){u.content=void 0,u.state=Bo.LoadState.FAILED,e._primitive.tileFailed.raiseEvent();continue}let p;if(n.isFull()){p=i-1-a,a++;let b=o[p];e._primitive.tileUnload.raiseEvent(),b.spatialNode.destroyKeyframeNode(b,e.megatextures)}else p=i+c,c++;u.spatialNode.addKeyframeNodeToMegatextures(u,e.megatextures),u.state=Bo.LoadState.LOADED,o[p]=u,e._primitive.tileLoad.raiseEvent()}}}function FWt(e,t){return e.highPriorityFrameNumber===t.highPriorityFrameNumber?t.priority-e.priority:t.highPriorityFrameNumber-e.highPriorityFrameNumber}function IWt(e,t){let n=t._primitive.provider.types.length;if(!Array.isArray(e)||e.length!==n)return!1;let{megatextures:i}=t;for(let o=0;o<n;o++){let{voxelCountPerTile:r,channelCount:s}=i[o],{x:a,y:c,z:d}=r,u=a*c*d,m=e[o],p=u*s;if(m.length!==p)return!1}return!0}function wLe(e,t,n,i){let{camera:o,context:r,pixelRatio:s,frameNumber:a}=i,{positionWC:c,frustum:d}=o,m=r.drawingBufferHeight/s/d.sseDenominator;if(e.computeScreenSpaceError(c,m),t=e.visibility(i,t),t===$s.MASK_OUTSIDE)return;e.visitedFrameNumber=a;let p=n._primitive,b=p._shape,f=p.screenSpaceError,y=n._priorityQueue,_=n._keyframeCount,S=W.clamp(Math.floor(n._keyframeLocation),0,_-2),Z=S+1;if(_===1)e.createKeyframeNode(0);else if(e.keyframeNodes.length!==_)for(let L=0;L<_;L++)e.createKeyframeNode(L);let{screenSpaceError:R,keyframeNodes:C}=e,E=LWt(R),A=!1;for(let L=0;L<C.length;L++){let F=C[L];F.priority=10*E+PWt(S,F.keyframe,Z,n),F.state!==Bo.LoadState.UNAVAILABLE&&F.state!==Bo.LoadState.FAILED&&F.priority!==-Number.MAX_VALUE&&y.insert(F),F.state===Bo.LoadState.LOADED&&(A=!0)}if(R<f||!A){e.children=void 0;return}l(e.children)||e.constructChildNodes(b);for(let L=0;L<8;L++){let F=e.children[L];wLe(F,t,n,i)}}function PWt(e,t,n,i){let o=Math.min(Math.abs(t-e),Math.abs(t-n)),r=Math.max(e,i._keyframeCount-n-1,1),s=Math.pow(1-o/r,4),a=Math.exp(-i._binaryTreeKeyframeWeighting[t]);return W.lerp(a,s,.15+.85*s)}function XWt(e,t,n,i,o){let r=e._keyframeCount,s=e.rootNode,a=Object.keys(Bo.LoadState).length,c=new Array(a),d=new Array(a),u=0;for(let A=0;A<a;A++){let L=new Array(r).fill(0);c[A]=L,d[A]=0}function m(A){let L=A.keyframeNodes;for(let F=0;F<L.length;F++){let I=L[F],N=I.keyframe,g=I.state;c[g][N]+=1,d[g]+=1,u++}if(l(A.children))for(let F=0;F<8;F++){let I=A.children[F];m(I)}}m(s),e._primitive.statistics.numberOfTilesWithContentReady=d[Bo.LoadState.LOADED],e._primitive.statistics.visited=u;let p=d[Bo.LoadState.RECEIVING],b=d[Bo.LoadState.PROCESSING],f=p!==e._primitive.statistics.numberOfPendingRequests||b!==e._primitive.statistics.numberOfTilesProcessing;if(f&&t.afterRender.push(function(){return e._primitive.loadProgress.raiseEvent(p,b),!0}),e._primitive.statistics.numberOfPendingRequests=p,e._primitive.statistics.numberOfTilesProcessing=b,f&&(p===0&&b===0)&&(t.afterRender.push(function(){return e._primitive.allTilesLoaded.raiseEvent(),!0}),e._initialTilesLoaded||(e._initialTilesLoaded=!0,t.afterRender.push(function(){return e._primitive.initialTilesLoaded.raiseEvent(),!0}))),!e._debugPrint)return;let _=`KEYFRAMES: ${c[Bo.LoadState.LOADED]}`,S=`UNLOADED: ${d[Bo.LoadState.UNLOADED]} | RECEIVING: ${d[Bo.LoadState.RECEIVING]} | PROCESSING: ${d[Bo.LoadState.PROCESSING]} | LOADED: ${d[Bo.LoadState.LOADED]} | FAILED: ${d[Bo.LoadState.FAILED]} | UNAVAILABLE: ${d[Bo.LoadState.UNAVAILABLE]} | TOTAL: ${u}`,Z=Math.round(n*100)/100,R=Math.round(i*100)/100,C=Math.round(o*100)/100,E=`LOAD: ${Z} | OCT: ${R} | ALL: ${C}`;console.log(`${_} || ${S} || ${E}`)}var Oz={INTERNAL:0,LEAF:1,PACKED_LEAF_FROM_PARENT:2};function NWt(e,t,n){let i=e._primitive._screenSpaceError,o=e._keyframeLocation,r=e._frameNumber,s=t>=2,a=0,c=0,d=[],u=[];function m(b,f,y,_,S){let Z=!1;if(l(b.children))for(let R=0;R<8;R++){let C=b.children[R];C.computeSurroundingRenderableKeyframeNodes(o),C.isRenderable(r)&&(Z=!0)}if(Z){d[S]=Oz.INTERNAL<<16|f,d[y]=_,a++,_=f,S=_*9+1;for(let R=0;R<8;R++){let C=b.children[R];f=a,y=f*9+0,m(C,f,y,_,S+R)}}else{if(e._primitive.tileVisible.raiseEvent(),s){let R=c*5,C=b.renderableKeyframeNodePrevious,E=b.level-C.spatialNode.level,A=C.spatialNode.parent,L=l(A)?A.renderableKeyframeNodePrevious:C,F=YWt(b,i,n),I=E,N=1,g=C.megatextureIndex,V=L.megatextureIndex;u[R+0]=F,u[R+1]=I,u[R+2]=N,u[R+3]=g,u[R+4]=V,d[S]=Oz.LEAF<<16|c}else{let R=b.renderableKeyframeNodePrevious,E=b.level-R.spatialNode.level===0?Oz.LEAF:Oz.PACKED_LEAF_FROM_PARENT;d[S]=E<<16|R.megatextureIndex}c++}}let p=e.rootNode;p.computeSurroundingRenderableKeyframeNodes(o),p.isRenderable(r)&&m(p,0,0,0,0),MWt(d,9,e.internalNodeTilesPerRow,e.internalNodeTexture),s&&wWt(u,2,e.leafNodeTilesPerRow,e.leafNodeTexture)}function YWt(e,t,n){if(e.parent===void 0)return 0;let i=e.screenSpaceError,o=e.parent.screenSpaceError,s=((t-i)/(o-i)+n-1)/n;return W.clamp(s,0,1)}function MWt(e,t,n,i){let o=Qe.componentsLength(i.pixelFormat),r=Math.ceil(e.length/t),s=Math.max(1,t*Math.min(r,n)),a=Math.max(1,Math.ceil(r/n)),c=new Uint8Array(s*a*o);for(let m=0;m<e.length;m++){let p=e[m],b=m*o;for(let f=0;f<o;f++)c[b+f]=p>>>f*8&255}let u={source:{arrayBufferView:c,width:s,height:a},xOffset:0,yOffset:0};i.copyFrom(u)}function wWt(e,t,n,i){let o=Qe.componentsLength(i.pixelFormat),r=5,s=Math.ceil(e.length/r),a=Math.max(1,t*Math.min(s,n)),c=Math.max(1,Math.ceil(s/n)),d=new Uint8Array(a*c*o);for(let p=0;p<s;p++){let b=e[p*r+0],f=e[p*r+1],y=e[p*r+2],_=e[p*r+3],S=e[p*r+4],Z=W.clamp(Math.floor(65536*b),0,65535);d[p*8+0]=Z>>>0&255,d[p*8+1]=Z>>>8&255,d[p*8+2]=f&255,d[p*8+3]=y&255,d[p*8+4]=_>>>0&255,d[p*8+5]=_>>>8&255,d[p*8+6]=S>>>0&255,d[p*8+7]=S>>>8&255}let m={source:{arrayBufferView:d,width:a,height:c},xOffset:0,yOffset:0};i.copyFrom(m)}var D9=dT;function A0(e){e=e??B.EMPTY_OBJECT;let{provider:t=A0.DefaultProvider,modelMatrix:n=P.IDENTITY,customShader:i=mE(t),clock:o,calculateStatistics:r=!1}=e;this._ready=!1,this._provider=t,this._traversal=void 0,this._statistics=new Xf,this._calculateStatistics=r;let{shape:s,minBounds:a=Tc.getMinBounds(s),maxBounds:c=Tc.getMaxBounds(s),dimensions:d,paddingBefore:u=h.ZERO,paddingAfter:m=h.ZERO,metadataOrder:p,availableLevels:b=1}=t;this._dimensions=h.clone(d),this._paddingBefore=h.clone(u),this._paddingAfter=h.clone(m),this._inputDimensions=kWt(d,u,m,p),this._availableLevels=b,this._minBounds=a.clone(),this._minBoundsOld=new h,this._maxBounds=c.clone(),this._maxBoundsOld=new h,this._minClippingBounds=a.clone(),this._minClippingBoundsOld=new h,this._maxClippingBounds=c.clone(),this._maxClippingBoundsOld=new h,this._verticalExaggeration=1,this._verticalExaggerationRelativeHeight=0,this._clippingPlanes=void 0,this._clippingPlanesState=0,this._clippingPlanesEnabled=!1,this._modelMatrix=P.clone(n),this._modelMatrixOld=P.clone(this._modelMatrix),this._customShader=i??A0.DefaultCustomShader,this._customShaderCompilationEvent=new Se,this._shaderDirty=!0,this._drawCommand=void 0,this._drawCommandPick=void 0,this._pickId=void 0,this._clock=o,this._transformPositionLocalToWorld=new P,this._transformPositionWorldToLocal=new P,this._transformPlaneLocalToView=new P,this._transformDirectionWorldToLocal=new q,this._nearestSampling=!1,this._levelBlendFactor=0,this._stepSizeMultiplier=1,this._depthTest=!0,this._useLogDepth=void 0,this._screenSpaceError=4,this._debugPolylines=new Wf,this._debugDraw=!1,this._disableRender=!1,this._disableUpdate=!1;let f=Tc.getShapeConstructor(s);this._shape=new f,ULe(this),this._shapeVisible=DLe(this),this._uniforms={octreeInternalNodeTexture:void 0,octreeInternalNodeTilesPerRow:0,octreeInternalNodeTexelSizeUv:new k,octreeLeafNodeTexture:void 0,octreeLeafNodeTilesPerRow:0,octreeLeafNodeTexelSizeUv:new k,megatextureTextures:[],megatextureTileCounts:new h,dimensions:this._dimensions,inputDimensions:this._inputDimensions,paddingBefore:this._paddingBefore,paddingAfter:this._paddingAfter,transformPositionViewToLocal:new P,transformDirectionViewToLocal:new q,cameraPositionLocal:new h,cameraDirectionLocal:new h,cameraTileCoordinates:new ce,cameraTileUv:new h,ndcSpaceAxisAlignedBoundingBox:new ce,clippingPlanesTexture:void 0,clippingPlanesMatrix:new P,renderBoundPlanesTexture:void 0,stepSize:this._stepSizeMultiplier,pickColor:new U},this._shapeDefinesOld={},this._uniformMap={};let y=this._uniforms,_=this._uniformMap;for(let S in y)if(y.hasOwnProperty(S)){let Z=`u_${S}`;_[Z]=function(){return y[S]}}UWt(this,this._shape),this.tileLoad=new Se,this.tileVisible=new Se,this.tileFailed=new Se,this.tileUnload=new Se,this.loadProgress=new Se,this.allTilesLoaded=new Se,this.initialTilesLoaded=new Se}function kWt(e,t,n,i){let o=h.add(e,t,new h);if(h.add(o,n,o),i===V0.Y_UP){let r=o.y;o.y=o.z,o.z=r}return o}function UWt(e,t){let n=e._uniformMap,{shaderUniforms:i,shaderDefines:o}=t;for(let r in i)if(i.hasOwnProperty(r)){let s=`u_${r}`;n[s]=function(){return i[r]}}e._shapeDefinesOld=$e(o,!0)}Object.defineProperties(A0.prototype,{ready:{get:function(){return this._ready}},provider:{get:function(){return this._provider}},boundingSphere:{get:function(){return this._shape.boundingSphere}},orientedBoundingBox:{get:function(){return this._shape.orientedBoundingBox}},modelMatrix:{get:function(){return this._modelMatrix},set:function(e){this._modelMatrix=P.clone(e,this._modelMatrix)}},shape:{get:function(){return this._provider.shape}},dimensions:{get:function(){return this._dimensions}},inputDimensions:{get:function(){return this._inputDimensions}},paddingBefore:{get:function(){return this._paddingBefore}},paddingAfter:{get:function(){return this._paddingAfter}},minimumValues:{get:function(){return this._provider.minimumValues}},maximumValues:{get:function(){return this._provider.maximumValues}},show:{get:function(){return!this._disableRender},set:function(e){this._disableRender=!e}},disableUpdate:{get:function(){return this._disableUpdate},set:function(e){this._disableUpdate=e}},debugDraw:{get:function(){return this._debugDraw},set:function(e){this._debugDraw=e}},depthTest:{get:function(){return this._depthTest},set:function(e){this._depthTest!==e&&(this._depthTest=e,this._shaderDirty=!0)}},nearestSampling:{get:function(){return this._nearestSampling},set:function(e){this._nearestSampling=e}},levelBlendFactor:{get:function(){return this._levelBlendFactor},set:function(e){this._levelBlendFactor=W.clamp(e,0,1)}},screenSpaceError:{get:function(){return this._screenSpaceError},set:function(e){this._screenSpaceError=e}},stepSize:{get:function(){return this._stepSizeMultiplier},set:function(e){this._stepSizeMultiplier=e}},minBounds:{get:function(){return this._minBounds},set:function(e){this._minBounds=h.clone(e,this._minBounds)}},maxBounds:{get:function(){return this._maxBounds},set:function(e){this._maxBounds=h.clone(e,this._maxBounds)}},minClippingBounds:{get:function(){return this._minClippingBounds},set:function(e){this._minClippingBounds=h.clone(e,this._minClippingBounds)}},maxClippingBounds:{get:function(){return this._maxClippingBounds},set:function(e){this._maxClippingBounds=h.clone(e,this._maxClippingBounds)}},clippingPlanes:{get:function(){return this._clippingPlanes},set:function(e){_s.setOwner(e,this,"_clippingPlanes")}},customShader:{get:function(){return this._customShader},set:function(e){if(e===this._customShader)return;let t=this._uniformMap,i=this._customShader.uniformMap;for(let o in i)i.hasOwnProperty(o)&&delete t[o];if(l(e))this._customShader=e;else{let o=mE(this._provider);this._customShader=o??A0.DefaultCustomShader}this._shaderDirty=!0}},customShaderCompilationEvent:{get:function(){return this._customShaderCompilationEvent}},statistics:{get:function(){return this._statistics}}});var DWt=new ce,OWt=new ce,BWt=new P,zWt=new P,HWt=new h,KWt=new ce;A0.prototype.update=function(e){let t=this._provider,n=this._uniforms;this._customShader.update(e);let i=e.context;if(!this._ready){tvt(this,t,i),e.afterRender.push(()=>(this._ready=!0,!0));return}let o=ULe(this),r=evt(this,e);if((o||r)&&(this._shapeVisible=DLe(this),uvt(this)&&(this._shaderDirty=!0)),!this._shapeVisible)return;this._shape.updateViewTransforms(e);let s=mvt(t.timeIntervalCollection,this._clock),a=this._traversal,c=a._sampleCount;if(a.update(e,s,o,this._disableUpdate),c!==a._sampleCount&&(this._shaderDirty=!0),!a.isRenderable(a.rootNode)||(this._debugDraw&&Tvt(this,e),this._disableRender))return;this._useLogDepth!==e.useLogDepth&&(this._useLogDepth=e.useLogDepth,this._shaderDirty=!0),hvt(this,e)&&(this._shaderDirty=!0);let u=a.leafNodeTexture;l(u)&&(n.octreeLeafNodeTexture=a.leafNodeTexture,n.octreeLeafNodeTexelSizeUv=k.clone(a.leafNodeTexelSizeUv,n.octreeLeafNodeTexelSizeUv),n.octreeLeafNodeTilesPerRow=a.leafNodeTilesPerRow),this._shaderDirty&&(P9(this,i),this._shaderDirty=!1);let m=i.uniformState.viewProjection,{orientedBoundingBox:p}=this._shape,b=bvt(p,m,OWt);if(b.x===1||b.y===1||b.z===-1||b.w===-1)return;n.ndcSpaceAxisAlignedBoundingBox=ce.clone(b,n.ndcSpaceAxisAlignedBoundingBox);let y=i.uniformState.inverseView,_=P.multiplyTransformation(this._transformPositionWorldToLocal,y,n.transformPositionViewToLocal);this._transformPlaneLocalToView=P.transpose(_,this._transformPlaneLocalToView);let S=i.uniformState.inverseViewRotation;n.transformDirectionViewToLocal=q.multiply(this._transformDirectionWorldToLocal,S,n.transformDirectionViewToLocal),n.cameraPositionLocal=P.multiplyByPoint(this._transformPositionWorldToLocal,e.camera.positionWC,n.cameraPositionLocal),n.cameraDirectionLocal=q.multiplyByVector(this._transformDirectionWorldToLocal,e.camera.directionWC,n.cameraDirectionLocal);let Z=QWt(this,n.cameraPositionLocal,KWt);n.cameraTileCoordinates=ce.fromElements(Math.floor(Z.x),Math.floor(Z.y),Math.floor(Z.z),Z.w,n.cameraTileCoordinates),n.cameraTileUv=h.fromElements(Z.x-Math.floor(Z.x),Z.y-Math.floor(Z.y),Z.z-Math.floor(Z.z),n.cameraTileUv),n.stepSize=this._stepSizeMultiplier,JWt(this),jWt(this,e);let R=e.passes.pick?this._drawCommandPick:e.passes.pickVoxel?this._drawCommandPickVoxel:this._drawCommand;R.boundingVolume=this._shape.boundingSphere,e.commandList.push(R)};function JWt(e){let{megatextures:t}=e._traversal;for(let n=0;n<t.length;++n)t[n].nearestSampling=e._nearestSampling}function jWt(e,t){let n=e._uniforms,{renderBoundPlanes:i}=e._shape;l(i)&&(i.update(t,e._transformPlaneLocalToView),n.renderBoundPlanesTexture=i.texture)}function QWt(e,t,n){let i=e._shape.convertLocalToShapeUvSpace(t,HWt),o=e._availableLevels,r=2**(o-1);return ce.fromElements(i.x*r,i.y*r,i.z*r,o-1,n)}var qWt=new h,Dne=new h,$Wt=new pe;function evt(e,t){let{verticalExaggeration:n,verticalExaggerationRelativeHeight:i}=t;return e._verticalExaggeration===n&&e._verticalExaggerationRelativeHeight===i?!1:(e._verticalExaggeration=n,e._verticalExaggerationRelativeHeight=i,!0)}function tvt(e,t,n){let i=e._uniforms;e._pickId=n.createPickId({primitive:e}),i.pickColor=U.clone(e._pickId.color,i.pickColor);let o=t.keyframeCount??1;e._traversal=new D9(e,n,o),e.statistics.texturesByteLength=e._traversal.textureMemoryByteLength,dvt(e._traversal,i)}function ULe(e){return O9(e,"_modelMatrix","_modelMatrixOld")+O9(e,"_minBounds","_minBoundsOld")+O9(e,"_maxBounds","_maxBoundsOld")+O9(e,"_minClippingBounds","_minClippingBoundsOld")+O9(e,"_maxClippingBounds","_maxClippingBoundsOld")>0}function O9(e,t,n){let i=e[t],o=e[n],r=!i.equals(o);return r&&i.clone(o),r?1:0}var nvt=new h,ivt=new h,ovt=new h,rvt=new h,svt=new P,avt=new P;function DLe(e){let t=e._verticalExaggeration,n=e._verticalExaggerationRelativeHeight,i=h.clone(e._minBounds,nvt),o=h.clone(e._maxBounds,ivt),r=h.clone(e._minClippingBounds,ovt),s=h.clone(e._maxClippingBounds,rvt),a=P.clone(e._modelMatrix,svt);if(e.shape===Tc.ELLIPSOID)i.z=_o.getHeight(e._minBounds.z,t,n),o.z=_o.getHeight(e._maxBounds.z,t,n),r.z=_o.getHeight(e._minClippingBounds.z,t,n),s.z=_o.getHeight(e._maxClippingBounds.z,t,n);else{let f=h.fromElements(1,1,t,qWt);P.multiplyByScale(a,f,a),P.multiplyByTranslation(a,lvt(e),a)}let c=e._provider,d=c.shapeTransform??P.IDENTITY,u=c.globalTransform??P.IDENTITY,m=P.multiplyTransformation(u,a,avt);P.multiplyTransformation(m,d,m);let p=e._shape;return p.update(m,i,o,r,s)?(e._transformPositionLocalToWorld=P.clone(p.shapeTransform,e._transformPositionLocalToWorld),e._transformPositionWorldToLocal=P.inverse(e._transformPositionLocalToWorld,e._transformPositionWorldToLocal),e._transformDirectionWorldToLocal=P.getMatrix3(e._transformPositionWorldToLocal,e._transformDirectionWorldToLocal),!0):!1}var cvt=new h;function lvt(e){let t=e._verticalExaggeration,n=e._verticalExaggerationRelativeHeight,{shapeTransform:i=P.IDENTITY,globalTransform:o=P.IDENTITY}=e._provider,r=P.getTranslation(i,Dne),s=P.multiplyByPoint(e._modelMatrix,r,Dne),a=P.multiplyByPoint(o,s,Dne),d=ne.WGS84.cartesianToCartographic(a,$Wt),u=0;l(d)&&(u=d.height);let m=_o.getHeight(u,t,n);return h.fromElements(0,0,(m-u)/t,cvt)}function dvt(e,t){t.octreeInternalNodeTexture=e.internalNodeTexture,t.octreeInternalNodeTexelSizeUv=k.clone(e.internalNodeTexelSizeUv,t.octreeInternalNodeTexelSizeUv),t.octreeInternalNodeTilesPerRow=e.internalNodeTilesPerRow;let{megatextures:n}=e,i=n[0];t.megatextureTextures=new Array(n.length);for(let o=0;o<n.length;o++)t.megatextureTextures[o]=n[o].texture;t.megatextureTileCounts=h.clone(i.tileCounts,t.megatextureTileCounts)}function uvt(e){let{shaderDefines:t}=e._shape,n=Object.keys(t).some(i=>t[i]!==e._shapeDefinesOld[i]);return n&&(e._shapeDefinesOld=$e(t,!0)),n}function mvt(e,t){if(!l(e)||!l(t))return 0;let n=t.currentTime,i,o=e.indexOf(n);o>=0?i=e.get(o):(o=~o,o===e.length?(o=e.length-1,i=e.get(o),n=i.stop):(i=e.get(o),n=i.start));let r=Q.secondsDifference(i.stop,i.start),a=Q.secondsDifference(n,i.start)/r;return o+a}function hvt(e,t){let n=e.clippingPlanes;if(!l(n))return!1;n.update(t);let{clippingPlanesState:i,enabled:o}=n;if(o){let r=e._uniforms;r.clippingPlanesTexture=n.texture,r.clippingPlanesMatrix=P.transpose(P.multiplyTransformation(P.inverse(n.modelMatrix,r.clippingPlanesMatrix),e._transformPositionLocalToWorld,r.clippingPlanesMatrix),r.clippingPlanesMatrix)}return e._clippingPlanesState===i&&e._clippingPlanesEnabled===o?!1:(e._clippingPlanesState=i,e._clippingPlanesEnabled=o,!0)}A0.prototype.isDestroyed=function(){return!1};A0.prototype.destroy=function(){let e=this._drawCommand;l(e)&&(e.shaderProgram=e.shaderProgram&&e.shaderProgram.destroy());let t=this._drawCommandPick;return l(t)&&(t.shaderProgram=t.shaderProgram&&t.shaderProgram.destroy()),this._pickId=this._pickId&&this._pickId.destroy(),this._traversal=this._traversal&&this._traversal.destroy(),this.statistics.texturesByteLength=0,this._clippingPlanes=this._clippingPlanes&&this._clippingPlanes.destroy(),ue(this)};var kLe=new Array(new ce(-1,-1,-1,1),new ce(1,-1,-1,1),new ce(-1,1,-1,1),new ce(1,1,-1,1),new ce(-1,-1,1,1),new ce(1,-1,1,1),new ce(-1,1,1,1),new ce(1,1,1,1)),fvt=new Array(1,2,4,0,3,5,0,3,6,1,2,7,0,5,6,1,4,7,2,4,7,3,5,6),pvt=new Array(new ce,new ce,new ce,new ce,new ce,new ce,new ce,new ce);function bvt(e,t,n){let i=P.fromRotationTranslation(e.halfAxes,e.center,BWt),o=P.multiply(t,i,zWt),r=+Number.MAX_VALUE,s=-Number.MAX_VALUE,a=+Number.MAX_VALUE,c=-Number.MAX_VALUE,d,u=pvt,m=kLe.length;for(d=0;d<m;d++)P.multiplyByVector(o,kLe[d],u[d]);for(d=0;d<m;d++){let p=u[d];if(p.z>=-p.w){let b=p.x/p.w,f=p.y/p.w;r=Math.min(r,b),s=Math.max(s,b),a=Math.min(a,f),c=Math.max(c,f)}else for(let b=0;b<3;b++){let f=fvt[d*3+b],y=u[f];if(y.z>=-y.w){let _=p.z+p.w,S=y.z+y.w,Z=_/(_-S),R=ce.lerp(p,y,Z,DWt),C=R.x/R.w,E=R.y/R.w;r=Math.min(r,C),s=Math.max(s,C),a=Math.min(a,E),c=Math.max(c,E)}}}return r=W.clamp(r,-1,1),a=W.clamp(a,-1,1),s=W.clamp(s,-1,1),c=W.clamp(c,-1,1),n=ce.fromElements(r,a,s,c,n),n}var One=3e7,gvt=new h(One,0,0),yvt=new h(0,One,0),xvt=new h(0,0,One);function Tvt(e,t){let n=e._traversal,i=e._debugPolylines;i.removeAll();function o(c,d,u,m){i.add({positions:[c,d],width:m,material:to.fromType("Color",{color:u})})}function r(c,d,u){let m=c.computeCorners();o(m[0],m[1],d,u),o(m[2],m[3],d,u),o(m[4],m[5],d,u),o(m[6],m[7],d,u),o(m[0],m[2],d,u),o(m[4],m[6],d,u),o(m[1],m[3],d,u),o(m[5],m[7],d,u),o(m[0],m[4],d,u),o(m[2],m[6],d,u),o(m[1],m[5],d,u),o(m[3],m[7],d,u)}function s(c){if(!n.isRenderable(c))return;let d=c.level,m=Math.max(1,5/Math.pow(2,d)),b=[U.RED,U.LIME,U.BLUE][d%3];if(r(c.orientedBoundingBox,b,m),l(c.children))for(let f=0;f<8;f++)s(c.children[f])}r(e._shape.orientedBoundingBox,U.WHITE,5),s(n.rootNode);let a=10;o(h.ZERO,gvt,U.RED,a),o(h.ZERO,yvt,U.LIME,a),o(h.ZERO,xvt,U.BLUE,a),i.update(t)}A0.DefaultCustomShader=new C0({fragmentShaderText:`void fragmentMain(FragmentInput fsInput, inout czm_modelMaterial material) { vec3 voxelNormal = fsInput.attributes.normalEC; float diffuse = max(0.0, dot(voxelNormal, czm_lightDirectionEC)); float lighting = 0.5 + 0.5 * diffuse; material.diffuse = vec3(lighting); material.alpha = 1.0; -}`});function NPe(){this.shape=_c.BOX,this.dimensions=new h(1,1,1),this.names=["data"],this.types=[St.SCALAR],this.componentTypes=[Nt.FLOAT32],this.maximumTileCount=1}NPe.prototype.requestData=function(e){if((l(e)?e.tileLevel??0:0)>=1)return;let n=new gR({metadata:[new Float32Array(1)]});return Promise.resolve(n)};U0.DefaultProvider=new NPe;var vT=U0;var v1o=x(T(),1);function tMt(e,t,n,i){if(!l(e)||l(t)&&e.id!==t)return;let r=(e.classes||{})[n];if(!l(r))return;let a=(r.properties||{})[i];if(l(a))return a}var tU=tMt;var I1o=x(T(),1);function nMt(e,t,n,i,o){this.schemaId=e,this.className=t,this.propertyName=n,this.classProperty=i,this.metadataProperty=o}var nU=nMt;var N1o=x(T(),1);function iMt(e,t,n){if(!l(e))return;let i=e.propertyTextures;for(let o of i)if(o.class.id===t){let a=o.properties[n];if(l(a))return a}}var iU=iMt;var JK=function(e){return function(){e.frameState.afterRender.push(function(){e.requestRender()})}};function _i(e){e=e??B.EMPTY_OBJECT;let t=e.canvas,n=e.creditContainer,i=e.creditViewport,o=e.contextOptions instanceof Tv;if(o)this._context=e.contextOptions.createSceneContext(t);else{let d=$e(e.contextOptions);this._context=new g_(t,d)}let r=this._context,s=l(n);s||(n=document.createElement("div"),n.style.position="absolute",n.style.bottom="0",n.style["text-shadow"]="0 0 2px #000000",n.style.color="#ffffff",n.style["font-size"]="10px",n.style["padding-right"]="5px",t.parentNode.appendChild(n)),l(i)||(i=t.parentNode),this._id=Qn(),this._jobScheduler=new T9,this._heightQueryCache=new Map,this._heightQueryFrame=-1,this._frameState=new Nx(r,new d9(n,"\u2022",i),this._jobScheduler),this._frameState.scene3DOnly=e.scene3DOnly??!1,this._removeCreditContainer=!s,this._creditContainer=n,this._canvas=t,this._computeEngine=new uG(r),this._ellipsoid=e.ellipsoid??ne.default,this._globe=void 0,this._globeTranslucencyState=new x9,this._primitives=new xl({countReferences:o}),this._groundPrimitives=new xl({countReferences:o}),this._globeHeight=void 0,this._globeHeightDirty=!0,this._cameraUnderground=!1,this._removeUpdateHeightCallback=void 0,this._logDepthBuffer=_i.defaultLogDepthBuffer&&r.fragmentDepth,this._logDepthBufferDirty=!0,this._tweens=new mR,this._shaderFrameCount=0,this._sunPostProcess=void 0,this._computeCommandList=[],this._overlayCommandList=[],this._useOIT=e.orderIndependentTranslucency??!0,this._executeOITFunction=void 0,this._depthPlane=new b9(e.depthPlaneEllipsoidOffset),this._clearColorCommand=new ui({color:new U,stencil:0,owner:this}),this._depthClearCommand=new ui({depth:1,owner:this}),this._stencilClearCommand=new ui({stencil:0}),this._classificationStencilClearCommand=new ui({stencil:0,renderState:ze.fromCache({stencilMask:Jt.CLASSIFICATION_MASK})}),this._depthOnlyRenderStateCache={},this._transitioner=new lk(this),this._preUpdate=new Se,this._postUpdate=new Se,this._renderError=new Se,this._preRender=new Se,this._postRender=new Se,this._controllerHost=new a9,this._minimumDisableDepthTestDistance=0,this._debugInspector=new Sk,this._msaaSamples=e.msaaSamples??4,this.rethrowRenderErrors=!1,this.completeMorphOnUserInput=!0,this.morphStart=new Se,this.morphComplete=new Se,this.skyBox=void 0,this.skyAtmosphere=void 0,this.sun=void 0,this.sunBloom=!0,this._sunBloom=void 0,this.moon=void 0,this.backgroundColor=U.clone(U.BLACK),this._mode=se.SCENE3D,this._mapProjection=l(e.mapProjection)?e.mapProjection:new ki(this._ellipsoid),this.morphTime=1,this.farToNearRatio=1e3,this.logarithmicDepthFarToNearRatio=1e9,this.nearToFarDistance2D=175e4,this.verticalExaggeration=1,this.verticalExaggerationRelativeHeight=0,this.debugCommandFilter=void 0,this.debugShowCommands=!1,this.debugShowFrustums=!1,this.debugShowFramesPerSecond=!1,this.debugShowDepthFrustum=1,this.debugShowFrustumPlanes=!1,this._debugShowFrustumPlanes=!1,this._debugFrustumPlanes=void 0,this.useDepthPicking=!0,this.pickTranslucentDepth=!1,this.cameraEventWaitTime=500,this.atmosphere=new lS,this.fog=new y9,this.fog.enabled=ne.WGS84.equals(this._ellipsoid),ne.WGS84.equals(this._ellipsoid)||(Io.DEFAULT_VIEW_RECTANGLE=re.fromDegrees(-45,-45,45,45)),this._shadowMapCamera=new Io(this),this.shadowMap=new ty({context:r,lightCamera:this._shadowMapCamera,enabled:e.shadows??!1}),this.invertClassification=!1,this.invertClassificationColor=U.clone(U.WHITE),this._actualInvertClassificationColor=U.clone(this._invertClassificationColor),this._invertClassification=new aA,this.focalLength=void 0,this.eyeSeparation=void 0,this.postProcessStages=new sk,this._brdfLutGenerator=new n9,this._performanceDisplay=void 0,this._debugVolume=void 0,this._screenSpaceCameraController=new hk(this),this._cameraUnderground=!1,this._mapMode2D=e.mapMode2D??pd.INFINITE_SCROLL,this._environmentState={skyBoxCommand:void 0,skyAtmosphereCommand:void 0,sunDrawCommand:void 0,sunComputeCommand:void 0,moonCommand:void 0,isSunVisible:!1,isMoonVisible:!1,isReadyForAtmosphere:!1,isSkyAtmosphereVisible:!1,clearGlobeDepth:!1,useDepthPlane:!1,renderTranslucentDepthForPick:!1,originalFramebuffer:void 0,useGlobeDepthFramebuffer:!1,useOIT:!1,useInvertClassification:!1,usePostProcess:!1,usePostProcessSelected:!1,useWebVR:!1},this._useWebVR=!1,this._cameraVR=void 0,this._aspectRatioVR=void 0,this.requestRenderMode=e.requestRenderMode??!1,this._renderRequested=!0,this.maximumRenderTimeChange=e.maximumRenderTimeChange??0,this._lastRenderTime=void 0,this._frameRateMonitor=void 0,this._removeRequestListenerCallback=Hc.requestCompletedEvent.addEventListener(JK(this)),this._removeTaskProcessorListenerCallback=qn.taskCompletedEvent.addEventListener(JK(this)),this._removeGlobeCallbacks=[],this._removeTerrainProviderReadyListener=void 0;let a=new nt(0,0,r.drawingBufferWidth,r.drawingBufferHeight),c=new Io(this);this._logDepthBuffer&&(c.frustum.near=.1,c.frustum.far=1e10),this.preloadFlightCamera=new Io(this),this.preloadFlightCullingVolume=void 0,this._picking=new Y9(this),this._defaultView=new rR(this,c,a),this._view=this._defaultView,this._hdr=void 0,this._hdrDirty=void 0,this.highDynamicRange=!1,this.gamma=2.2,this.sphericalHarmonicCoefficients=void 0,this.specularEnvironmentMaps=void 0,this._specularEnvironmentCubeMap=void 0,this.light=new cb,this._enableEdgeVisibility=!1,this._enablePlanarFillId=!1,DPe(this,0,Q.now()),this.updateFrameState(),this.initializeFrame()}_i.defaultLogDepthBuffer=!0;function oMt(e,t){for(let i=0;i<e._removeGlobeCallbacks.length;++i)e._removeGlobeCallbacks[i]();e._removeGlobeCallbacks.length=0;let n=[];l(t)&&(n.push(t.imageryLayersUpdatedEvent.addEventListener(JK(e))),n.push(t.terrainProviderChanged.addEventListener(JK(e)))),e._removeGlobeCallbacks=n}Object.defineProperties(_i.prototype,{canvas:{get:function(){return this._canvas}},drawingBufferHeight:{get:function(){return this._context.drawingBufferHeight}},drawingBufferWidth:{get:function(){return this._context.drawingBufferWidth}},maximumAliasedLineWidth:{get:function(){return wt.maximumAliasedLineWidth}},maximumCubeMapSize:{get:function(){return wt.maximumCubeMapSize}},pickPositionSupported:{get:function(){return this._context.depthTexture}},sampleHeightSupported:{get:function(){return this._context.depthTexture}},clampToHeightSupported:{get:function(){return this._context.depthTexture}},invertClassificationSupported:{get:function(){return this._context.depthTexture}},specularEnvironmentMapsSupported:{get:function(){return $h.isSupported(this._context)}},ellipsoid:{get:function(){return this._ellipsoid}},globe:{get:function(){return this._globe},set:function(e){this._globe=this._globe&&this._globe.destroy(),this._globe=e,oMt(this,e)}},primitives:{get:function(){return this._primitives}},groundPrimitives:{get:function(){return this._groundPrimitives}},camera:{get:function(){return this._view.camera},set:function(e){this._view.camera=e}},view:{get:function(){return this._view},set:function(e){this._view=e}},defaultView:{get:function(){return this._defaultView}},picking:{get:function(){return this._picking}},controllerHost:{get:function(){return this._controllerHost}},screenSpaceCameraController:{get:function(){return this._screenSpaceCameraController}},mapProjection:{get:function(){return this._mapProjection}},jobScheduler:{get:function(){return this._jobScheduler}},frameState:{get:function(){return this._frameState}},environmentState:{get:function(){return this._environmentState}},tweens:{get:function(){return this._tweens}},imageryLayers:{get:function(){if(l(this.globe))return this.globe.imageryLayers}},terrainProvider:{get:function(){if(l(this.globe))return this.globe.terrainProvider},set:function(e){this._removeTerrainProviderReadyListener=this._removeTerrainProviderReadyListener&&this._removeTerrainProviderReadyListener(),l(this.globe)&&(this.globe.terrainProvider=e)}},terrainProviderChanged:{get:function(){if(l(this.globe))return this.globe.terrainProviderChanged}},vectorProvider:{get:function(){return this.globe?.vectorProvider}},preUpdate:{get:function(){return this._preUpdate}},postUpdate:{get:function(){return this._postUpdate}},renderError:{get:function(){return this._renderError}},preRender:{get:function(){return this._preRender}},postRender:{get:function(){return this._postRender}},lastRenderTime:{get:function(){return this._lastRenderTime}},context:{get:function(){return this._context}},debugFrustumStatistics:{get:function(){return this._view.debugFrustumStatistics}},scene3DOnly:{get:function(){return this._frameState.scene3DOnly}},orderIndependentTranslucency:{get:function(){return this._useOIT}},id:{get:function(){return this._id}},mode:{get:function(){return this._mode},set:function(e){e===se.SCENE2D?this.morphTo2D(0):e===se.SCENE3D?this.morphTo3D(0):e===se.COLUMBUS_VIEW&&this.morphToColumbusView(0),this._mode=e}},frustumCommandsList:{get:function(){return this._view.frustumCommandsList}},numberOfFrustums:{get:function(){return this._view.frustumCommandsList.length}},useWebVR:{get:function(){return this._useWebVR},set:function(e){this._useWebVR=e,this._useWebVR?(this._frameState.creditDisplay.container.style.visibility="hidden",this._cameraVR=new Io(this),l(this._deviceOrientationCameraController)||(this._deviceOrientationCameraController=new g9(this)),this._aspectRatioVR=this.camera.frustum.aspectRatio):(this._frameState.creditDisplay.container.style.visibility="visible",this._cameraVR=void 0,this._deviceOrientationCameraController=this._deviceOrientationCameraController&&!this._deviceOrientationCameraController.isDestroyed()&&this._deviceOrientationCameraController.destroy(),this.camera.frustum.aspectRatio=this._aspectRatioVR,this.camera.frustum.xOffset=0)}},mapMode2D:{get:function(){return this._mapMode2D}},splitPosition:{get:function(){return this._frameState.splitPosition},set:function(e){this._frameState.splitPosition=e}},minimumDisableDepthTestDistance:{get:function(){return this._minimumDisableDepthTestDistance},set:function(e){this._minimumDisableDepthTestDistance=e}},logarithmicDepthBuffer:{get:function(){return this._logDepthBuffer},set:function(e){e=this._context.fragmentDepth&&e,this._logDepthBuffer!==e&&(this._logDepthBuffer=e,this._logDepthBufferDirty=!0)}},gamma:{get:function(){return this._context.uniformState.gamma},set:function(e){this._context.uniformState.gamma=e}},highDynamicRange:{get:function(){return this._hdr},set:function(e){let t=this._context,n=e&&t.depthTexture&&(t.colorBufferFloat||t.colorBufferHalfFloat);this._hdrDirty=n!==this._hdr,this._hdr=n}},highDynamicRangeSupported:{get:function(){let e=this._context;return e.depthTexture&&(e.colorBufferFloat||e.colorBufferHalfFloat)}},cameraUnderground:{get:function(){return this._cameraUnderground}},msaaSamples:{get:function(){return this._msaaSamples},set:function(e){e=Math.min(e,wt.maximumSamples),this._msaaSamples=e}},msaaSupported:{get:function(){return this._context.msaa}},pixelRatio:{get:function(){return this._frameState.pixelRatio},set:function(e){this._frameState.pixelRatio=e}},opaqueFrustumNearOffset:{get:function(){return .9999}},globeHeight:{get:function(){return this._globeHeight}}});_i.prototype.getCompressedTextureFormatSupported=function(e){let t=this.context;return(e==="WEBGL_compressed_texture_s3tc"||e==="s3tc")&&t.s3tc||(e==="WEBGL_compressed_texture_pvrtc"||e==="pvrtc")&&t.pvrtc||(e==="WEBGL_compressed_texture_etc"||e==="etc")&&t.etc||(e==="WEBGL_compressed_texture_etc1"||e==="etc1")&&t.etc1||(e==="WEBGL_compressed_texture_astc"||e==="astc")&&t.astc||(e==="EXT_texture_compression_bptc"||e==="bc7")&&t.bc7};function rMt(e,t){let n=e.pickedMetadataInfo,i=t.pickedMetadataInfo;return n?.schemaId!==i?.schemaId||n?.className!==i?.className||n?.propertyName!==i?.propertyName}function YPe(e,t,n){let i=e._frameState,o=e._context,r=e._view.oit,{lightShadowMaps:s,lightShadowsEnabled:a}=i.shadowState,c=t.derivedCommands;l(t.pickId)&&(c.picking=qf.createPickDerivedCommand(e,t,o,c.picking)),l(t.snapId)&&i.passes.snap&&(c.snapping=qf.createSnapDerivedCommand(e,t,o,c.snapping)),i.pickingMetadata&&t.pickMetadataAllowed&&(t.pickedMetadataInfo=i.pickedMetadataInfo,l(t.pickedMetadataInfo)&&(c.pickingMetadata=qf.createPickMetadataDerivedCommand(e,t,o,c.pickingMetadata))),t.pickOnly||(c.depth=qf.createDepthOnlyDerivedCommand(e,t,o,c.depth)),c.originalCommand=t,e._hdr&&(c.hdr=qf.createHdrCommand(t,o,c.hdr),t=c.hdr.command,c=t.derivedCommands),a&&t.receiveShadows&&(c.shadows=ty.createReceiveDerivedCommand(s,t,n,o,c.shadows)),t.pass===Le.TRANSLUCENT&&l(r)&&r.isSupported()&&(a&&t.receiveShadows?(c.oit=l(c.oit)?c.oit:{},c.oit.shadows=r.createDerivedCommands(c.shadows.receiveCommand,o,c.oit.shadows)):c.oit=r.createDerivedCommands(t,o,c.oit))}_i.prototype.updateDerivedCommands=function(e){let{derivedCommands:t}=e;if(!l(t))return;let n=this._frameState,{shadowState:i,useLogDepth:o}=this._frameState,r=this._context,s=!1,a=i.lastDirtyTime;e.lastDirtyTime!==a&&(e.lastDirtyTime=a,e.dirty=!0,s=!0);let c=this._hdr,d=l(t.logDepth),u=l(t.hdr),m=l(t.originalCommand),p=o&&!d,b=c&&!u,f=(!o||!c)&&!m,y=n.pickingMetadata&&rMt(e,n),_=n.passes.snap&&l(e.snapId)&&!l(t.snapping);if(e.dirty=e.dirty||p||b||f||y||_,!e.dirty)return;e.dirty=!1;let{shadowsEnabled:S,shadowMaps:Z}=i;S&&e.castShadows&&(t.shadows=ty.createCastDerivedCommand(Z,e,s,r,t.shadows)),(d||p)&&(t.logDepth=qf.createLogDepthCommand(e,r,t.logDepth),YPe(this,t.logDepth.command,s)),(m||f)&&YPe(this,e,s)};var sMt=new _h({pass:lr.RENDER}),lse=new _h({pass:lr.PRELOAD}),dse=new _h({pass:lr.PRELOAD_FLIGHT}),aMt=new _h({pass:lr.REQUEST_RENDER_MODE_DEFER_CHECK}),MPe=new me,use;function cMt(e){if(!(e._mode!==se.SCENE3D||!e.globe?.show||e._cameraUnderground||e._globeTranslucencyState.translucent))return MPe.radius=e.ellipsoid.minimumRadius+e.frameState.minimumTerrainHeight,use=e9.fromBoundingSphere(MPe,e.camera.positionWC,use),use}_i.prototype.clearPasses=function(e){e.render=!1,e.pick=!1,e.pickVoxel=!1,e.snap=!1,e.depth=!1,e.postProcess=!1,e.offscreen=!1};function DPe(e,t,n){let i=e._frameState;i.frameNumber=t,i.time=Q.clone(n,i.time)}_i.prototype.updateFrameState=function(){let e=this.camera,t=this._frameState;t.commandList.length=0,t.shadowMaps.length=0,t.brdfLutGenerator=this._brdfLutGenerator,t.environmentMap=this.skyBox&&this.skyBox._cubeMap,t.mode=this._mode,t.morphTime=this.morphTime,t.mapProjection=this.mapProjection,t.camera=e,t.cullingVolume=e.frustum.computeCullingVolume(e.positionWC,e.directionWC,e.upWC),t.occluder=cMt(this),t.minimumTerrainHeight=0,t.minimumDisableDepthTestDistance=this._minimumDisableDepthTestDistance,t.invertClassification=this.invertClassification,t.useLogDepth=this._logDepthBuffer&&!(this.camera.frustum instanceof yn||this.camera.frustum instanceof ps),t.light=this.light,t.cameraUnderground=this._cameraUnderground,t.globeTranslucencyState=this._globeTranslucencyState;let{globe:n}=this;l(n)&&n._terrainExaggerationChanged&&(this.verticalExaggeration=n._terrainExaggeration,this.verticalExaggerationRelativeHeight=n._terrainExaggerationRelativeHeight,n._terrainExaggerationChanged=!1),t.verticalExaggeration=this.verticalExaggeration,t.verticalExaggerationRelativeHeight=this.verticalExaggerationRelativeHeight,l(this._specularEnvironmentCubeMap)&&this._specularEnvironmentCubeMap.ready?(t.specularEnvironmentMaps=this._specularEnvironmentCubeMap.texture,t.specularEnvironmentMapsMaximumLOD=this._specularEnvironmentCubeMap.maximumMipmapLevel):(t.specularEnvironmentMaps=void 0,t.specularEnvironmentMapsMaximumLOD=void 0),t.sphericalHarmonicCoefficients=this.sphericalHarmonicCoefficients,this._actualInvertClassificationColor=U.clone(this.invertClassificationColor,this._actualInvertClassificationColor),aA.isTranslucencySupported(this._context)||(this._actualInvertClassificationColor.alpha=1),t.invertClassificationColor=this._actualInvertClassificationColor,l(this.globe)?t.maximumScreenSpaceError=this.globe.maximumScreenSpaceError:t.maximumScreenSpaceError=2,this.clearPasses(t.passes),t.tilesetPassState=void 0};_i.prototype.isVisible=function(e,t,n){if(!l(t))return!1;let{boundingVolume:i}=t;return!l(i)||!t.cull?!0:e.computeVisibility(i)===qt.OUTSIDE?!1:!l(n)||!t.occlude||!i.isOccluded(n)};var KK=new P(0,0,1,0,1,0,0,0,0,1,0,0,0,0,0,1);KK=P.inverseTransformation(KK,KK);function lMt(e,t,n,i){let o=t._frameState,r=o.context,s=e.boundingVolume;l(t._debugVolume)&&t._debugVolume.destroy();let a=h.clone(s.center);if(o.mode!==se.SCENE3D){a=P.multiplyByPoint(KK,a,a);let f=o.mapProjection,y=f.unproject(a);a=f.ellipsoid.cartographicToCartesian(y)}let c,d,{radius:u}=s;l(u)?(c=Ha.createGeometry(new Ha({radii:new h(u,u,u),vertexFormat:Tn.FLAT_VERTEX_FORMAT})),d=P.fromTranslation(a)):(c=Vc.createGeometry(Vc.fromDimensions({dimensions:new h(2,2,2),vertexFormat:Tn.FLAT_VERTEX_FORMAT})),d=P.fromRotationTranslation(s.halfAxes,a,new P)),t._debugVolume=new In({geometryInstances:new Yt({geometry:Bn.toWireframe(c),modelMatrix:d,attributes:{color:new $t(1,0,0,1)}}),appearance:new Tn({flat:!0,translucent:!1}),asynchronous:!1});let m=o.commandList,p=o.commandList=[];t._debugVolume.update(o),e=p[0],o.useLogDepth&&(e=qf.createLogDepthCommand(e,r).command);let b;l(i)&&(b=n.framebuffer,n.framebuffer=i),e.execute(r,n),l(b)&&(n.framebuffer=b),o.commandList=m}function yd(e,t,n,i){let o=t._frameState,r=t._context;if(l(t.debugCommandFilter)&&!t.debugCommandFilter(e))return;if(e instanceof ui){e.execute(r,n);return}e.debugShowBoundingVolume&&l(e.boundingVolume)&&lMt(e,t,n,i),o.useLogDepth&&l(e.derivedCommands.logDepth)&&(e=e.derivedCommands.logDepth.command);let s=o.passes;if(!s.pick&&!s.pickVoxel&&!s.depth&&t._hdr&&l(e.derivedCommands)&&l(e.derivedCommands.hdr)&&(e=e.derivedCommands.hdr.command),s.pick||s.depth){if(s.pick&&!s.depth){if(o.passes.snap){l(e.derivedCommands.snapping)?(e=e.derivedCommands.snapping.snapCommand,e.execute(r,n)):l(e.derivedCommands.depth)&&(e=e.derivedCommands.depth.depthOnlyCommand,e.execute(r,n));return}if(o.pickingMetadata&&l(e.derivedCommands.pickingMetadata)){e=e.derivedCommands.pickingMetadata.pickMetadataCommand,e.execute(r,n);return}if(!o.pickingMetadata&&l(e.derivedCommands.picking)){e=e.derivedCommands.picking.pickCommand,e.execute(r,n);return}}else if(l(e.derivedCommands.depth)){e=e.derivedCommands.depth.depthOnlyCommand,e.execute(r,n);return}}if(t.debugShowCommands||t.debugShowFrustums){t._debugInspector.executeDebugShowFrustumsCommand(t,e,n);return}o.shadowState.lightShadowsEnabled&&e.receiveShadows&&l(e.derivedCommands.shadows)?e.derivedCommands.shadows.receiveCommand.execute(r,n):e.execute(r,n)}function wPe(e,t,n){let{derivedCommands:i}=e;if(!l(i))return;let o=t._frameState,r=t._context;o.useLogDepth&&l(i.logDepth)&&(e=i.logDepth.command);let{picking:s,pickingMetadata:a,depth:c}=e.derivedCommands;l(a)&&(e=i.pickingMetadata.pickMetadataCommand,e.execute(r,n)),l(s)?(e=s.pickCommand,e.execute(r,n)):l(c)&&(e=c.depthOnlyCommand,e.execute(r,n))}function OPe(e,t,n){return t.boundingVolume.distanceSquaredTo(n)-e.boundingVolume.distanceSquaredTo(n)}var dMt=new h;function kPe(e,t){let n=h.subtract(e,t,dMt),i=Math.max(0,h.magnitude(n));return i*i}function uMt(e,t,n){let i=e.boundingVolume,o=t.boundingVolume;return kPe(o.center,n)-kPe(i.center,n)}function mMt(e,t,n){return e.boundingVolume.distanceSquaredTo(n)-t.boundingVolume.distanceSquaredTo(n)+W.EPSILON12}function hMt(e,t,n,i,o){L0(i,OPe,e.camera.positionWC),l(o)&&t(o.unclassifiedCommand,e,n);for(let r=0;r<i.length;++r)t(i[r],e,n)}function fMt(e,t,n,i,o){L0(i,mMt,e.camera.positionWC),l(o)&&t(o.unclassifiedCommand,e,n);for(let r=0;r<i.length;++r)t(i[r],e,n)}function pMt(e,t,n){e.context.uniformState.updatePass(Le.VOXELS);let i=n.commands[Le.VOXELS];i.length=n.indices[Le.VOXELS],L0(i,OPe,e.camera.positionWC);for(let o=0;o<i.length;++o)yd(i[o],e,t)}function bMt(e,t,n){e.context.uniformState.updatePass(Le.GAUSSIAN_SPLATS);let i=n.commands[Le.GAUSSIAN_SPLATS];i.length=n.indices[Le.GAUSSIAN_SPLATS],L0(i,uMt,e.camera.positionWC);for(let o=0;o<i.length;++o)yd(i[o],e,t)}var gMt=new qi,yMt=new fd,xMt=new yn,TMt=new ps;function _Mt(e){let{frustum:t}=e;return l(t.fov)?t.clone(gMt):l(t.infiniteProjectionMatrix)?t.clone(yMt):l(t.width)?t.clone(xMt):t.clone(TMt)}function SMt(e){if(e._environmentState.useOIT){if(!l(e._executeOITFunction)){let{view:t,context:n}=e;e._executeOITFunction=function(i,o,r,s,a){t.globeDepth.prepareColorTextures(n),t.oit.executeCommands(i,o,r,s,a)}}return e._executeOITFunction}return e.frameState.passes.render?hMt:fMt}function ZMt(e,t,n){let{frameState:i,context:o}=e,{pick:r,pickVoxel:s}=i.passes,a=r||s,c;!a&&e._environmentState.useInvertClassification&&i.invertClassificationColor.alpha<1&&(c=e._invertClassification);let d=SMt(e);o.uniformState.updatePass(Le.TRANSLUCENT);let u=n.commands[Le.TRANSLUCENT];u.length=n.indices[Le.TRANSLUCENT],d(e,yd,t,u,c)}function RMt(e,t,n){let{translucentTileClassification:i,globeDepth:o}=e._view;if(!(n.indices[Le.CESIUM_3D_TILE_CLASSIFICATION]>0)||!i.isSupported())return;let s=n.commands[Le.TRANSLUCENT];i.executeTranslucentCommands(e,yd,t,s,o.depthStencilTexture),i.executeClassificationCommands(e,yd,t,n)}function CMt(e,t,n){e.context.uniformState.updatePass(Le.CESIUM_3D_TILE_EDGES);let i=t.framebuffer;e.context.uniformState.edgeColorTexture=e.context.defaultTexture,e.context.uniformState.edgeIdTexture=e.context.defaultTexture,e.context.uniformState.edgeDepthTexture=e.context.defaultTexture,e._enableEdgeVisibility&&l(e._view)&&l(e._view.edgeFramebuffer)&&(t.framebuffer=e._view.edgeFramebuffer.framebuffer);let o=n.commands[Le.CESIUM_3D_TILE_EDGES],r=n.indices[Le.CESIUM_3D_TILE_EDGES];e._enableEdgeVisibility&&l(e._view)&&l(e._view.edgeFramebuffer)&&e._view.edgeFramebuffer.getClearCommand(new U(0,0,0,0)).execute(e.context,t);for(let s=0;s<r;++s)yd(o[s],e,t);t.framebuffer=i}function VMt(e,t,n){let{context:i}=e,{uniformState:o}=i;o.updatePass(Le.CESIUM_3D_TILE_PLANAR_FILL_ID),o.planarFillIdTexture=i.defaultTexture;let r=e._view,s=r&&r.planarFillIdFramebuffer,a=n.commands[Le.CESIUM_3D_TILE_PLANAR_FILL_ID],c=n.indices[Le.CESIUM_3D_TILE_PLANAR_FILL_ID];if(c!==0&&e._enablePlanarFillId&&l(s)&&l(s.framebuffer)){let d=t.framebuffer;t.framebuffer=s.framebuffer,s.getClearCommand(new U(0,0,0,0)).execute(i,t);for(let m=0;m<c;++m)yd(a[m],e,t);t.framebuffer=d}}function EMt(e,t,n){e.context.uniformState.updatePass(Le.CESIUM_3D_TILE_EDGES_DIRECT);let i=n.commands[Le.CESIUM_3D_TILE_EDGES_DIRECT],o=n.indices[Le.CESIUM_3D_TILE_EDGES_DIRECT];for(let r=0;r<o;++r)yd(i[r],e,t)}function hse(e,t){let{camera:n,context:i,frameState:o}=e,{uniformState:r}=i;r.updateCamera(n),r.planarFillIdTexture=i.defaultTexture;let s=_Mt(n);s.near=n.frustum.near,s.far=n.frustum.far;let a=o.passes,c=a.pick||a.pickVoxel;c||AMt(e,t);let{clearGlobeDepth:d,renderTranslucentDepthForPick:u,useDepthPlane:m,useGlobeDepthFramebuffer:p,useInvertClassification:b,usePostProcessSelected:f}=e._environmentState,{globeDepth:y,globeTranslucencyFramebuffer:_,sceneFramebuffer:S,frustumCommandsList:Z}=e._view,R=Z.length,C=e._globeTranslucencyState,E=e._depthClearCommand,A=e._stencilClearCommand,L=e._classificationStencilClearCommand,F=e._depthPlane,I=n.position.z;function N(V,G){r.updatePass(G);let v=V.commands[G],X=V.indices[G];for(let Y=0;Y<X;++Y)yd(v[Y],e,t);return X}function g(V,G){r.updatePass(G);let v=V.commands[G],X=V.indices[G];for(let Y=0;Y<X;++Y)wPe(v[Y],e,t)}for(let V=0;V<R;++V){let G=R-V-1,v=Z[G];e.mode===se.SCENE2D?(n.position.z=I-v.near+1,s.far=Math.max(1,v.far-v.near),s.near=1,r.update(o),r.updateFrustum(s)):(s.near=G!==0?v.near*e.opaqueFrustumNearOffset:v.near,s.far=v.far,r.updateFrustum(s)),E.execute(i,t),i.stencilBuffer&&A.execute(i,t),C.translucent?(r.updatePass(Le.GLOBE),C.executeGlobeCommands(v,yd,_,e,t)):N(v,Le.GLOBE),p&&y.executeCopyDepth(i,t),u||(C.translucent?(r.updatePass(Le.TERRAIN_CLASSIFICATION),C.executeGlobeClassificationCommands(v,yd,_,e,t)):N(v,Le.TERRAIN_CLASSIFICATION)),d&&(E.execute(i,t),m&&F.execute(i,t));let X;if(CMt(e,t,v),e._enableEdgeVisibility&&l(e._view)&&l(e._view.edgeFramebuffer)){let D=e._view.edgeFramebuffer.colorTexture;l(D)?e.context.uniformState.edgeColorTexture=D:e.context.uniformState.edgeColorTexture=e.context.defaultTexture;let M=e._view.edgeFramebuffer.idTexture;l(M)?e.context.uniformState.edgeIdTexture=M:e.context.uniformState.edgeIdTexture=e.context.defaultTexture;let O=e._view.edgeFramebuffer.depthTexture;l(O)?e.context.uniformState.edgeDepthTexture=O:e.context.uniformState.edgeDepthTexture=e.context.defaultTexture}else e.context.uniformState.edgeColorTexture=e.context.defaultTexture,e.context.uniformState.edgeIdTexture=e.context.defaultTexture,e.context.uniformState.edgeDepthTexture=e.context.defaultTexture;if(VMt(e,t,v),e._enablePlanarFillId&&l(e._view)&&l(e._view.planarFillIdFramebuffer)){let D=e._view.planarFillIdFramebuffer.idTexture;r.planarFillIdTexture=l(D)?D:i.defaultTexture}else r.planarFillIdTexture=i.defaultTexture;if(!b||c||u)X=N(v,Le.CESIUM_3D_TILE),X>0&&(p&&(y.prepareColorTextures(i,d),y.executeUpdateDepth(i,t,y.depthStencilTexture)),u||(X=N(v,Le.CESIUM_3D_TILE_CLASSIFICATION)));else{e._invertClassification.clear(i,t);let D=t.framebuffer;t.framebuffer=e._invertClassification._fbo.framebuffer,N(v,Le.CESIUM_3D_TILE),p&&(e._invertClassification.prepareTextures(i),y.executeUpdateDepth(i,t,e._invertClassification._fbo.getDepthStencilTexture())),X=N(v,Le.CESIUM_3D_TILE_CLASSIFICATION_IGNORE_SHOW),t.framebuffer=D,e._invertClassification.executeClassified(i,t),o.invertClassificationColor.alpha===1&&e._invertClassification.executeUnclassified(i,t),X>0&&i.stencilBuffer&&L.execute(i,t),X=N(v,Le.CESIUM_3D_TILE_CLASSIFICATION)}if(X>0&&i.stencilBuffer&&A.execute(i,t),pMt(e,t,v),N(v,Le.OPAQUE),EMt(e,t,v),bMt(e,t,v),G!==0&&e.mode!==se.SCENE2D&&(s.near=v.near,r.updateFrustum(s)),ZMt(e,t,v),RMt(e,t,v),i.depthTexture&&e.useDepthPicking&&(p||u)){let D=e._picking.getPickDepth(e,G);D.update(i,y.depthStencilTexture),D.executeCopyDepth(i,t)}if(c||!f)continue;let Y=t.framebuffer;t.framebuffer=S.getIdFramebuffer(),s.near=G!==0?v.near*e.opaqueFrustumNearOffset:v.near,s.far=v.far,r.updateFrustum(s),C.translucent?(r.updatePass(Le.GLOBE),C.executeGlobeCommands(v,wPe,_,e,t)):g(v,Le.GLOBE),d&&(E.framebuffer=t.framebuffer,E.execute(i,t),E.framebuffer=void 0),d&&m&&F.execute(i,t),g(v,Le.CESIUM_3D_TILE),g(v,Le.OPAQUE),g(v,Le.TRANSLUCENT),t.framebuffer=Y}}function AMt(e,t){let{context:n,environmentState:i,view:o}=e;if(n.uniformState.updatePass(Le.ENVIRONMENT),l(i.skyBoxCommand)&&yd(i.skyBoxCommand,e,t),i.isSkyAtmosphereVisible&&yd(i.skyAtmosphereCommand,e,t),i.isSunVisible&&(i.sunDrawCommand.execute(n,t),e.sunBloom&&!i.useWebVR)){let s;i.useGlobeDepthFramebuffer?s=o.globeDepth.framebuffer:i.usePostProcess?s=o.sceneFramebuffer.framebuffer:s=i.originalFramebuffer,e._sunPostProcess.execute(n),e._sunPostProcess.copy(n,s),t.framebuffer=s}i.isMoonVisible&&i.moonCommand.execute(n,t);let r=e.frameState.panoramaCommandList;for(let s=r.length-1;s>=0;s--){let a=r[s];l(a.shaderProgram)?yd(r[s],e,t):r.splice(s,1)}}function BPe(e){e.context.uniformState.updatePass(Le.COMPUTE);let t=e._environmentState.sunComputeCommand;l(t)&&t.execute(e._computeEngine);let n=e._computeCommandList;for(let i=0;i<n.length;++i)n[i].execute(e._computeEngine)}function GMt(e,t){e.context.uniformState.updatePass(Le.OVERLAY);let n=e.context,i=e._overlayCommandList;for(let o=0;o<i.length;++o)i[o].execute(n,t)}function LMt(e,t,n){let{shadowMapCullingVolume:i,isPointLight:o,passes:r}=n,s=r.length,a=[Le.GLOBE,Le.CESIUM_3D_TILE,Le.OPAQUE,Le.TRANSLUCENT];for(let c=0;c<t.length;++c){let d=t[c];if(e.updateDerivedCommands(d),!(!d.castShadows||a.indexOf(d.pass)<0||!e.isVisible(i,d)))if(o)for(let u=0;u<s;++u)r[u].commandList.push(d);else if(s===1)r[0].commandList.push(d);else{let u=!1;for(let m=s-1;m>=0;--m){let p=r[m].cullingVolume;if(e.isVisible(p,d))r[m].commandList.push(d),u=!0;else if(u)break}}}}function zPe(e){let{shadowState:t,commandList:n}=e.frameState,{shadowsEnabled:i,shadowMaps:o}=t;if(!i)return;let{context:r}=e,{uniformState:s}=r;for(let a=0;a<o.length;++a){let c=o[a];if(c.outOfView)continue;let{passes:d}=c;for(let u=0;u<d.length;++u)d[u].commandList.length=0;LMt(e,n,c);for(let u=0;u<d.length;++u){let m=c.passes[u],{camera:p,commandList:b}=m;s.updateCamera(p),c.updatePass(r,u);for(let f=0;f<b.length;++f){let y=b[f];s.updatePass(y.pass);let _=y.derivedCommands.shadows.castCommands[a];yd(_,e,m.passState)}}}}var WMt=new h;_i.prototype.updateAndExecuteCommands=function(e,t){BMt(this,e,t),this._environmentState.useWebVR?vMt(this,e,t):this._frameState.mode!==se.SCENE2D||this._mapMode2D===pd.ROTATE?FT(!0,this,e):kMt(this,e)};function vMt(e,t){let n=e._view,i=n.camera,r=e._environmentState.renderTranslucentDepthForPick;KPe(e),n.createPotentiallyVisibleSet(e),BPe(e),r||zPe(e);let s=t.viewport;s.x=0,s.y=0,s.width=s.width*.5;let a=Io.clone(i,e._cameraVR);a.frustum=i.frustum;let c=i.frustum.near,d=c*(e.focalLength??5),u=e.eyeSeparation??d/30,m=h.multiplyByScalar(a.right,u*.5,WMt);i.frustum.aspectRatio=s.width/s.height;let p=.5*u*c/d;h.add(a.position,m,i.position),i.frustum.xOffset=p,hse(e,t),s.x=s.width,h.subtract(a.position,m,i.position),i.frustum.xOffset=-p,hse(e,t),Io.clone(a,i)}var FMt=new pe(Math.PI,W.PI_OVER_TWO),IMt=new h,PMt=new h,XMt=new P,NMt=new P,YMt=new h,MMt=new h,wMt=new nt;function kMt(e,t){let{frameState:n,camera:i}=e,{uniformState:o}=e.context,r=t.viewport,s=nt.clone(r,wMt);t.viewport=s;let a=FMt,c=IMt;e.mapProjection.project(a,c);let u=h.clone(i.position,PMt),m=P.clone(i.transform,NMt),p=i.frustum.clone();i._setTransform(P.IDENTITY);let b=P.computeViewportTransformation(s,0,1,XMt),f=i.frustum.projectionMatrix,y=i.positionWC.y,_=h.fromElements(W.sign(y)*c.x-y,0,-i.positionWC.x,YMt),S=_t.pointToGLWindowCoordinates(f,b,_,MMt);S.x=Math.floor(S.x);let Z=s.x,R=s.width;if(y===0||S.x<=Z||S.x>=Z+R)FT(!0,e,t);else if(Math.abs(Z+R*.5-S.x)<1)s.width=S.x-s.x,i.position.x*=W.sign(i.position.x),i.frustum.right=0,n.cullingVolume=i.frustum.computeCullingVolume(i.positionWC,i.directionWC,i.upWC),o.update(n),FT(!0,e,t),s.x=S.x,i.position.x=-i.position.x,i.frustum.right=-i.frustum.left,i.frustum.left=0,n.cullingVolume=i.frustum.computeCullingVolume(i.positionWC,i.directionWC,i.upWC),o.update(n),FT(!1,e,t);else if(S.x>Z+R*.5){s.width=S.x-Z;let C=i.frustum.right;i.frustum.right=c.x-y,n.cullingVolume=i.frustum.computeCullingVolume(i.positionWC,i.directionWC,i.upWC),o.update(n),FT(!0,e,t),s.x=S.x,s.width=Z+R-S.x,i.position.x=-i.position.x,i.frustum.left=-i.frustum.right,i.frustum.right=C-i.frustum.right*2,n.cullingVolume=i.frustum.computeCullingVolume(i.positionWC,i.directionWC,i.upWC),o.update(n),FT(!1,e,t)}else{s.x=S.x,s.width=Z+R-S.x;let C=i.frustum.left;i.frustum.left=-c.x-y,n.cullingVolume=i.frustum.computeCullingVolume(i.positionWC,i.directionWC,i.upWC),o.update(n),FT(!0,e,t),s.x=Z,s.width=S.x-Z,i.position.x=-i.position.x,i.frustum.right=-i.frustum.left,i.frustum.left=C-i.frustum.left*2,n.cullingVolume=i.frustum.computeCullingVolume(i.positionWC,i.directionWC,i.upWC),o.update(n),FT(!1,e,t)}i._setTransform(m),h.clone(u,i.position),i.frustum=p.clone(),t.viewport=r}function FT(e,t,n){let i=t._view,{renderTranslucentDepthForPick:o}=t._environmentState;e||(t.frameState.commandList.length=0),KPe(t),i.createPotentiallyVisibleSet(t),e&&(BPe(t),o||zPe(t)),hse(t,n)}var UPe=new $s;function HPe(e,t,n){if(!e.show)return;let i=e.length;for(let o=0;o<i;++o){let r=e.get(o);if(r instanceof xl){HPe(r,t,n);continue}r.show&&ag.isSupported(r)&&bs(r.heightReference)&&t.markForFrame(r,n,r.heightReference)}}function UMt(e,t){let n=e.vectorProvider;if(!l(n))return;let i=t.frameNumber;HPe(e._primitives,n,i)}_i.prototype.updateEnvironment=function(){let e=this._frameState,t=this._view,n=this._environmentState,i=e.passes.render,o=e.passes.offscreen,r=this.atmosphere,s=this.skyAtmosphere,a=this.globe,c=this._globeTranslucencyState;if(!i||this._mode!==se.SCENE2D&&t.camera.frustum instanceof yn||!c.environmentVisible)n.skyAtmosphereCommand=void 0,n.skyBoxCommand=void 0,n.sunDrawCommand=void 0,n.sunComputeCommand=void 0,n.moonCommand=void 0;else{if(l(s)){if(l(a))s.setDynamicLighting(Nb.fromGlobeFlags(a)),n.isReadyForAtmosphere=n.isReadyForAtmosphere||!a.show||a._surface._tilesToRender.length>0;else{let S=r.dynamicLighting;s.setDynamicLighting(S),n.isReadyForAtmosphere=!0}n.skyAtmosphereCommand=s.update(e,a),l(n.skyAtmosphereCommand)&&this.updateDerivedCommands(n.skyAtmosphereCommand)}else n.skyAtmosphereCommand=void 0;n.skyBoxCommand=l(this.skyBox)?this.skyBox.update(e,this._hdr):void 0;let _=l(this.sun)?this.sun.update(e,t.passState,this._hdr):void 0;n.sunDrawCommand=l(_)?_.drawCommand:void 0,n.sunComputeCommand=l(_)?_.computeCommand:void 0,n.moonCommand=l(this.moon)?this.moon.update(e):void 0}let d=n.clearGlobeDepth=l(a)&&a.show&&(!a.depthTestAgainstTerrain||this.mode===se.SCENE2D);(n.useDepthPlane=d&&this.mode===se.SCENE3D&&c.useDepthPlane)&&this._depthPlane.update(e),n.renderTranslucentDepthForPick=!1,n.useWebVR=this._useWebVR&&this.mode!==se.SCENE2D&&!o;let m=e.mode===se.SCENE3D&&!c.sunVisibleThroughGlobe?e.occluder:void 0,p=e.cullingVolume,b=UPe.planes;for(let _=0;_<5;++_)b[_]=p.planes[_];p=UPe,n.isSkyAtmosphereVisible=l(n.skyAtmosphereCommand)&&n.isReadyForAtmosphere,n.isSunVisible=this.isVisible(p,n.sunDrawCommand,m),n.isMoonVisible=this.isVisible(p,n.moonCommand,m);let f=this.specularEnvironmentMaps,y=this._specularEnvironmentCubeMap;l(f)&&y?.url!==f?(l(y)&&y.destroy(),this._specularEnvironmentCubeMap=new $h(f)):!l(f)&&l(y)&&(y.destroy(),this._specularEnvironmentCubeMap=void 0),l(this._specularEnvironmentCubeMap)&&this._specularEnvironmentCubeMap.update(e),UMt(this,e)};function DMt(e){let t=e._frameState;e.debugShowFrustumPlanes!==e._debugShowFrustumPlanes&&(e.debugShowFrustumPlanes?e._debugFrustumPlanes=new v0({camera:e.camera,updateOnChange:!1,frustumSplits:t.frustumSplits}):e._debugFrustumPlanes=e._debugFrustumPlanes&&e._debugFrustumPlanes.destroy(),e._debugShowFrustumPlanes=e.debugShowFrustumPlanes),l(e._debugFrustumPlanes)&&e._debugFrustumPlanes.update(t)}function OMt(e){let t=e._frameState,{passes:n,shadowState:i,shadowMaps:o}=t,r=o.length,s=r>0&&!n.pick&&!n.pickVoxel&&e.mode===se.SCENE3D;if(s!==i.shadowsEnabled&&(++i.lastDirtyTime,i.shadowsEnabled=s),i.lightShadowsEnabled=!1,!!s){for(let a=0;a<r;++a)if(o[a]!==i.shadowMaps[a]){++i.lastDirtyTime;break}i.shadowMaps.length=0,i.lightShadowMaps.length=0;for(let a=0;a<r;++a){let c=o[a];c.update(t),i.shadowMaps.push(c),c.fromLightSource&&(i.lightShadowMaps.push(c),i.lightShadowsEnabled=!0),c.dirty&&(++i.lastDirtyTime,c.dirty=!1)}}}function KPe(e){let t=e._frameState;t.edgeVisibilityRequested=!1,t.planarFillRequested=!1,e._groundPrimitives.update(t),e._primitives.update(t),t.edgeVisibilityRequested&&e._enableEdgeVisibility===!1&&(e._enableEdgeVisibility=!0),e._enablePlanarFillId=t.planarFillRequested,DMt(e),OMt(e),e._globe&&e._globe.render(t)}function BMt(e,t,n){let i=e._context,o=e._frameState,r=e._environmentState,s=e._view,a=o.passes,c=a.pick||a.pickVoxel;l(s.globeDepth)&&(s.globeDepth.picking=c,s.globeDepth.snapping=a.snap);let d=r.useWebVR;r.originalFramebuffer=t.framebuffer,l(e.sun)&&e.sunBloom!==e._sunBloom?(e.sunBloom&&!d?e._sunPostProcess=new Tk:l(e._sunPostProcess)&&(e._sunPostProcess=e._sunPostProcess.destroy()),e._sunBloom=e.sunBloom):!l(e.sun)&&l(e._sunPostProcess)&&(e._sunPostProcess=e._sunPostProcess.destroy(),e._sunBloom=!1);let u=e._clearColorCommand;U.clone(n,u.color),u.execute(i,t);let m=r.useGlobeDepthFramebuffer=l(s.globeDepth);m&&(s.globeDepth.update(i,t,s.viewport,e.msaaSamples,e._hdr,r.clearGlobeDepth),s.globeDepth.clear(i,t,n));let p=s.oit,b=r.useOIT=!c&&l(p)&&p.isSupported();b&&(p.update(i,t,s.globeDepth.colorFramebufferManager,e._hdr,e.msaaSamples),p.clear(i,t,n),r.useOIT=p.isSupported());let f=e.postProcessStages,y=r.usePostProcess=!c&&(e._hdr||f.length>0||f.ambientOcclusion.enabled||f.fxaa.enabled||f.bloom.enabled);r.usePostProcessSelected=!1,y&&(s.sceneFramebuffer.update(i,s.viewport,e._hdr,e.msaaSamples),s.sceneFramebuffer.clear(i,t,n),f.update(i,o.useLogDepth,e._hdr),f.clear(i),y=r.usePostProcess=f.ready,r.usePostProcessSelected=y&&f.hasSelected),r.isSunVisible&&e.sunBloom&&!d?(t.framebuffer=e._sunPostProcess.update(t),e._sunPostProcess.clear(i,t,n)):m?t.framebuffer=s.globeDepth.framebuffer:y&&(t.framebuffer=s.sceneFramebuffer.framebuffer),l(t.framebuffer)&&u.execute(i,t);let _=r.useInvertClassification=!c&&l(t.framebuffer)&&e.invertClassification;if(!c&&e._enableEdgeVisibility&&s.edgeFramebuffer.update(i,s.viewport,e._hdr),!c&&e._enablePlanarFillId?s.planarFillIdFramebuffer.update(i,s.viewport,e._hdr):c||s.planarFillIdFramebuffer.releaseResources(),_){let R;if(o.invertClassificationColor.alpha===1&&m&&(R=s.globeDepth.framebuffer),l(R)||i.depthTexture){if(e._invertClassification.previousFramebuffer=R,e._invertClassification.update(i,e.msaaSamples,s.globeDepth.colorFramebufferManager),e._invertClassification.clear(i,t),o.invertClassificationColor.alpha<1&&b){let C=e._invertClassification.unclassifiedCommand,E=C.derivedCommands;E.oit=p.createDerivedCommands(C,i,E.oit)}}else r.useInvertClassification=!1}e._globeTranslucencyState.translucent&&s.globeTranslucencyFramebuffer.updateAndClear(e._hdr,s.viewport,i,t)}_i.prototype.resolveFramebuffers=function(e){let t=this._context,n=this._environmentState,i=this._view,{globeDepth:o,translucentTileClassification:r}=i;l(o)&&o.prepareColorTextures(t);let{useOIT:s,useGlobeDepthFramebuffer:a,usePostProcess:c,originalFramebuffer:d}=n,u=a?o.colorFramebufferManager:void 0,m=i.sceneFramebuffer._colorFramebuffer,p=i.sceneFramebuffer.idFramebuffer;if(s&&(e.framebuffer=c?m.framebuffer:d,i.oit.execute(t,e)),r.hasTranslucentDepth&&r.isSupported()&&r.execute(this,e),c){i.sceneFramebuffer.prepareColorTextures(t);let b=m;a&&!s&&(b=u);let f=this.postProcessStages,y=b.getColorTexture(0),_=p.getColorTexture(0),S=(u??m).getDepthStencilTexture();f.execute(t,y,S,_),f.copy(t,d)}!s&&!c&&a&&(e.framebuffer=d,o.executeCopyColor(t,e))};function zMt(e){let t=e._frameState.afterRender,n=t.slice();t.length=0;for(let i=0;i<n.length;++i)n[i]()&&e.requestRender()}function HMt(e){if(e.mode===se.MORPHING)return;let t=e.camera.positionCartographic;return e.getHeight(t)}function JPe(e,t,n){let i=Number.NEGATIVE_INFINITY;if(e instanceof xl){let o=e.length;for(let r=0;r<o;++r){let s=e.get(r),a=JPe(s,t,n);l(a)&&a>i&&(i=a)}}else if(e.isCesium3DTileset&&e.show&&e.enableCollision){let o=e.getHeight(t,n);if(l(o)&&o>i)return o}return i}_i.prototype.getHeight=function(e,t){if(!l(e))return;let n=this._frameState.frameNumber;this._heightQueryFrame!==n&&(this._heightQueryFrame=n,this._heightQueryCache.clear());let i=`${t}:${e.longitude.toFixed(8)}:${e.latitude.toFixed(8)}`,o=this._heightQueryCache.get(i);if(o!==void 0)return o===null?void 0:o;let r=KMt(this,e,t);return this._heightQueryCache.set(i,r===void 0?null:r),r};function KMt(e,t,n){let i=n===He.CLAMP_TO_TERRAIN||n===He.RELATIVE_TO_TERRAIN,o=n===He.CLAMP_TO_3D_TILE||n===He.RELATIVE_TO_3D_TILE;if(!l(t))return;let r=Number.NEGATIVE_INFINITY;if(!i){let a=JPe(e.primitives,t,e);l(a)&&a>r&&(r=a)}let s=e._globe;if(!o&&l(s)&&s.show){let a=s.getHeight(t);a>r&&(r=a)}if(r>Number.NEGATIVE_INFINITY)return r}var mse=new pe;_i.prototype.updateHeight=function(e,t,n){let i=this._ellipsoid,o=b=>{pe.clone(e,mse);let f;l(b)&&(f=b.height),l(f)||(f=this.getHeight(e,n)),l(f)&&(mse.height=f,t(mse))},r=n===He.CLAMP_TO_TERRAIN||n===He.RELATIVE_TO_TERRAIN,s=n===He.CLAMP_TO_3D_TILE||n===He.RELATIVE_TO_3D_TILE,a;!s&&l(this.globe)&&(a=this.globe._surface.updateHeight(e,o));let c={},d=b=>{if(r||b.isDestroyed()||!b.isCesium3DTileset)return;let f=b.updateHeight(e,o,i);c[b.id]=f};if(!r){let b=this.primitives.length;for(let f=0;f<b;++f){let y=this.primitives.get(f);d(y)}}let u=this.primitives.primitiveAdded.addEventListener(d),m=this.primitives.primitiveRemoved.addEventListener(b=>{b.isDestroyed()||!b.isCesium3DTileset||(l(c[b.id])&&c[b.id](),delete c[b.id])});return()=>{a=a&&a(),Object.values(c).forEach(b=>b()),c={},u(),m()}};function JMt(e){let t=e.camera,n=e._mode,i=e._screenSpaceCameraController,o=t.positionCartographic;if(!l(o))return!1;if(!i.onMap()&&o.height<0)return!0;if(n===se.SCENE2D||n===se.MORPHING)return!1;let r=e._globeHeight;return l(r)&&o.height<r}_i.prototype.initializeFrame=function(){if(this._shaderFrameCount++===120&&(this._shaderFrameCount=0,this._context.shaderCache.destroyReleasedShaderPrograms(),this._context.textureCache.destroyReleasedTextures()),this._tweens.update(),this._globeHeightDirty){l(this._removeUpdateHeightCallback)&&(this._removeUpdateHeightCallback(),this._removeUpdateHeightCallback=void 0),this._globeHeight=HMt(this),this._globeHeightDirty=!1;let e=this.camera.positionCartographic;this._removeUpdateHeightCallback=this.updateHeight(e,t=>{this.isDestroyed()||(this._globeHeight=t.height)})}this._cameraUnderground=JMt(this),this._globeTranslucencyState.update(this),this._screenSpaceCameraController.update(),l(this._deviceOrientationCameraController)&&this._deviceOrientationCameraController.update(),this.camera.update(this._mode),this.camera._updateCameraChanged()};function jMt(e,t){if(e.debugShowFramesPerSecond){if(!l(e._performanceDisplay)){let n=document.createElement("div");n.className="cesium-performanceDisplay-defaultContainer",e._canvas.parentNode.appendChild(n);let o=new qg({container:n});e._performanceDisplay=o,e._performanceContainer=n}e._performanceDisplay.throttled=e.requestRenderMode,e._performanceDisplay.update(t)}else l(e._performanceDisplay)&&(e._performanceDisplay=e._performanceDisplay&&e._performanceDisplay.destroy(),e._performanceContainer.parentNode.removeChild(e._performanceContainer))}function QMt(e){e._jobScheduler.resetBudgets();let t=e._frameState;e.primitives.prePassesUpdate(t),l(e.globe)&&e.globe.update(t),e._picking.update(),t.creditDisplay.update()}function qMt(e){e.primitives.postPassesUpdate(e._frameState),Hc.update()}var $Mt=new U;function ewt(e){let t=e._frameState,n=e.context,{uniformState:i}=n,o=e._defaultView;e._view=o,e.updateFrameState(),t.passes.render=!0,t.passes.postProcess=e.postProcessStages.hasSelected,t.tilesetPassState=sMt;let r=e.backgroundColor??U.BLACK;e._hdr&&(r=U.clone(r,$Mt),r.red=Math.pow(r.red,e.gamma),r.green=Math.pow(r.green,e.gamma),r.blue=Math.pow(r.blue,e.gamma)),t.backgroundColor=r,t.atmosphere=e.atmosphere,e.fog.update(t),i.update(t);let s=e.shadowMap;l(s)&&s.enabled&&(!l(e.light)||e.light instanceof cb?h.negate(i.sunDirectionWC,e._shadowMapCamera.direction):h.clone(e.light.direction,e._shadowMapCamera.direction),t.shadowMaps.push(s)),e._computeCommandList.length=0,e._overlayCommandList.length=0;let a=o.viewport;a.x=0,a.y=0,a.width=n.drawingBufferWidth,a.height=n.drawingBufferHeight;let c=o.passState;c.framebuffer=void 0,c.blendingEnabled=void 0,c.scissorTest=void 0,c.viewport=nt.clone(a,c.viewport),n.beginFrame(),l(e.globe)&&e.globe.beginFrame(t),e.updateEnvironment(),e.updateAndExecuteCommands(c,r),e.resolveFramebuffers(c),c.framebuffer=void 0,GMt(e,c),l(e.globe)&&(e.globe.endFrame(t),e.globe.tilesLoaded||(e._renderRequested=!0)),n.endFrame()}function _R(e,t){try{t(e)}catch(n){if(e._renderError.raiseEvent(e,n),e.rethrowRenderErrors)throw n}}function twt(e){return e._picking.updateMostDetailedRayPicks(e)}_i.prototype.render=function(e){this._preUpdate.raiseEvent(this,e);let t=this._frameState;t.newFrame=!1,l(e)||(e=Q.now()),this._controllerHost.update(this,e);let n=this._view.checkForCameraUpdates(this);n&&(this._globeHeightDirty=!0);let i=!this.requestRenderMode||this._renderRequested||n||this._logDepthBufferDirty||this._hdrDirty||this.mode===se.MORPHING;if(!i&&l(this.maximumRenderTimeChange)&&l(this._lastRenderTime)){let o=Math.abs(Q.secondsDifference(this._lastRenderTime,e));i=i||o>this.maximumRenderTimeChange}if(i){this._lastRenderTime=Q.clone(e,this._lastRenderTime),this._renderRequested=!1,this._logDepthBufferDirty=!1,this._hdrDirty=!1;let o=W.incrementWrap(t.frameNumber,Nx.maximumFrameNumber,1);DPe(this,o,e),t.newFrame=!0}_R(this,QMt),this.primitives.show&&(_R(this,twt),_R(this,nwt),_R(this,iwt),i||_R(this,owt)),this._postUpdate.raiseEvent(this,e),i&&(this._preRender.raiseEvent(this,e),t.creditDisplay.beginFrame(),_R(this,ewt)),jMt(this,i),_R(this,qMt),zMt(this),i&&(this._postRender.raiseEvent(this,e),t.creditDisplay.endFrame())};_i.prototype.forceRender=function(e){this._renderRequested=!0,this.render(e)};_i.prototype.requestRender=function(){this._renderRequested=!0};_i.prototype.clampLineWidth=function(e){return Math.max(wt.minimumAliasedLineWidth,Math.min(e,wt.maximumAliasedLineWidth))};_i.prototype.pick=function(e,t,n){return this._picking.pick(this,e,t,n,1)[0]};_i.prototype.snap=function(e,t){return gk.snap(this,e,t)};_i.prototype.pickAsync=async function(e,t,n){return(await this._picking.pickAsync(this,e,t,n,1))[0]};_i.prototype.pickVoxel=function(e,t,n){let i=this.pick(e,t,n);if(!l(i))return;let o=i.primitive;if(!(o instanceof vT))return;let r=this._picking.pickVoxelCoordinate(this,e,t,n),s=255*r[0]+r[1],a=o._traversal.findKeyframeNode(s);if(!l(a))return;let c=255*r[2]+r[3];return Zk.fromKeyframeNode(o,s,c,a)};_i.prototype.pickMetadata=function(e,t,n,i){let o=this.pick(e);if(!l(o))return;let r=o.detail?.model?.structuralMetadata;if(!l(r))return;let s=r.schema,a=tU(s,t,n,i);if(!l(a))return;let c=iU(r,n,i);if(!l(c))return;let d=new nU(t,n,i,a,c);return this._picking.pickMetadata(this,e,d)};_i.prototype.pickMetadataSchema=function(e){let t=this.pick(e);return l(t)?t.detail?.model?.structuralMetadata?.schema:void 0};_i.prototype.pickPositionWorldCoordinates=function(e,t){return this._picking.pickPositionWorldCoordinates(this,e,t)};_i.prototype.pickPosition=function(e,t){return this._picking.pickPosition(this,e,t)};_i.prototype.drillPick=function(e,t,n,i){return this._picking.drillPick(this,e,t,n,i)};function nwt(e){let t=e._frameState;lse.camera=t.camera,lse.cullingVolume=t.cullingVolume,e.primitives.updateForPass(t,lse)}function iwt(e){let t=e._frameState;if(!t.camera.canPreloadFlight())return;dse.camera=e.preloadFlightCamera,dse.cullingVolume=e.preloadFlightCullingVolume,e.primitives.updateForPass(t,dse)}function owt(e){e.primitives.updateForPass(e._frameState,aMt)}_i.prototype.pickFromRay=function(e,t,n){return this._picking.pickFromRay(this,e,t,n)};_i.prototype.drillPickFromRay=function(e,t,n,i){return this._picking.drillPickFromRay(this,e,t,n,i)};_i.prototype.pickFromRayMostDetailed=function(e,t,n){return this._picking.pickFromRayMostDetailed(this,e,t,n)};_i.prototype.drillPickFromRayMostDetailed=function(e,t,n,i){return this._picking.drillPickFromRayMostDetailed(this,e,t,n,i)};_i.prototype.sampleHeight=function(e,t,n){return this._picking.sampleHeight(this,e,t,n)};_i.prototype.clampToHeight=function(e,t,n,i){return this._picking.clampToHeight(this,e,t,n,i)};_i.prototype.sampleHeightMostDetailed=function(e,t,n){return this._picking.sampleHeightMostDetailed(this,e,t,n)};_i.prototype.clampToHeightMostDetailed=function(e,t,n){return this._picking.clampToHeightMostDetailed(this,e,t,n)};_i.prototype.cartesianToCanvasCoordinates=function(e,t){return fo.worldToWindowCoordinates(this,e,t)};_i.prototype.completeMorph=function(){this._transitioner.completeMorph()};_i.prototype.morphTo2D=function(e){e=e??2,this._transitioner.morphTo2D(e,this._ellipsoid)};_i.prototype.morphToColumbusView=function(e){e=e??2,this._transitioner.morphToColumbusView(e,this._ellipsoid)};_i.prototype.morphTo3D=function(e){e=e??2,this._transitioner.morphTo3D(e,this._ellipsoid)};function rwt(e,t){if(e._removeTerrainProviderReadyListener=e._removeTerrainProviderReadyListener&&e._removeTerrainProviderReadyListener(),t.ready){l(e.globe)&&(e.globe.terrainProvider=t.provider);return}e.globe.terrainProvider=void 0,e._removeTerrainProviderReadyListener=t.readyEvent.addEventListener(n=>{l(e)&&l(e.globe)&&(e.globe.terrainProvider=n),e._removeTerrainProviderReadyListener()})}_i.prototype.setTerrain=function(e){return rwt(this,e),e};_i.prototype.isDestroyed=function(){return!1};_i.prototype.destroy=function(){this._tweens.removeAll(),this._computeEngine=this._computeEngine&&this._computeEngine.destroy(),this._screenSpaceCameraController=this._screenSpaceCameraController&&this._screenSpaceCameraController.destroy(),this._deviceOrientationCameraController=this._deviceOrientationCameraController&&!this._deviceOrientationCameraController.isDestroyed()&&this._deviceOrientationCameraController.destroy(),this._primitives=this._primitives&&this._primitives.destroy(),this._groundPrimitives=this._groundPrimitives&&this._groundPrimitives.destroy(),this._globe=this._globe&&this._globe.destroy(),this._removeTerrainProviderReadyListener=this._removeTerrainProviderReadyListener&&this._removeTerrainProviderReadyListener(),this.skyBox=this.skyBox&&this.skyBox.destroy(),this.skyAtmosphere=this.skyAtmosphere&&this.skyAtmosphere.destroy(),this._debugSphere=this._debugSphere&&this._debugSphere.destroy(),this.sun=this.sun&&this.sun.destroy(),this._sunPostProcess=this._sunPostProcess&&this._sunPostProcess.destroy(),this._depthPlane=this._depthPlane&&this._depthPlane.destroy(),this._transitioner=this._transitioner&&this._transitioner.destroy(),this._debugFrustumPlanes=this._debugFrustumPlanes&&this._debugFrustumPlanes.destroy(),this._brdfLutGenerator=this._brdfLutGenerator&&this._brdfLutGenerator.destroy(),this._picking=this._picking&&this._picking.destroy(),this._defaultView=this._defaultView&&this._defaultView.destroy(),this._view=void 0,this._removeCreditContainer&&this._canvas.parentNode.removeChild(this._creditContainer),this.postProcessStages=this.postProcessStages&&this.postProcessStages.destroy(),this._context=this._context&&this._context.destroy(),this._frameState.creditDisplay=this._frameState.creditDisplay&&this._frameState.creditDisplay.destroy(),l(this._performanceDisplay)&&(this._performanceDisplay=this._performanceDisplay&&this._performanceDisplay.destroy(),this._performanceContainer.parentNode.removeChild(this._performanceContainer)),this._removeRequestListenerCallback(),this._removeTaskProcessorListenerCallback();for(let e=0;e<this._removeGlobeCallbacks.length;++e)this._removeGlobeCallbacks[e]();return this._removeGlobeCallbacks.length=0,l(this._removeUpdateHeightCallback)&&(this._removeUpdateHeightCallback(),this._removeUpdateHeightCallback=void 0),ue(this)};var oU=_i;var wVo=x(T(),1);function fA(e){e=e??ne.WGS84,this.show=!0,this.perFragmentAtmosphere=!1,this._ellipsoid=e;let t=1.025,n=h.multiplyByScalar(e.radii,t,new h);this._scaleMatrix=P.fromScale(n),this._modelMatrix=new P,this._command=new lt({owner:this,modelMatrix:this._modelMatrix}),this._spSkyFromSpace=void 0,this._spSkyFromAtmosphere=void 0,this._flags=void 0,this.atmosphereLightIntensity=50,this.atmosphereRayleighCoefficient=new h(55e-7,13e-6,284e-7),this.atmosphereMieCoefficient=new h(21e-6,21e-6,21e-6),this.atmosphereRayleighScaleHeight=1e4,this.atmosphereMieScaleHeight=3200,this.atmosphereMieAnisotropy=.9,this.hueShift=0,this.saturationShift=0,this.brightnessShift=0,this._hueSaturationBrightness=new h;let i=new h;i.x=e.maximumRadius*t,i.y=e.maximumRadius,i.z=0,this._radiiAndDynamicAtmosphereColor=i;let o=this;this._command.uniformMap={u_radiiAndDynamicAtmosphereColor:function(){return o._radiiAndDynamicAtmosphereColor},u_hsbShift:function(){return o._hueSaturationBrightness.x=o.hueShift,o._hueSaturationBrightness.y=o.saturationShift,o._hueSaturationBrightness.z=o.brightnessShift,o._hueSaturationBrightness},u_atmosphereLightIntensity:function(){return o.atmosphereLightIntensity},u_atmosphereRayleighCoefficient:function(){return o.atmosphereRayleighCoefficient},u_atmosphereMieCoefficient:function(){return o.atmosphereMieCoefficient},u_atmosphereRayleighScaleHeight:function(){return o.atmosphereRayleighScaleHeight},u_atmosphereMieScaleHeight:function(){return o.atmosphereMieScaleHeight},u_atmosphereMieAnisotropy:function(){return o.atmosphereMieAnisotropy}}}Object.defineProperties(fA.prototype,{ellipsoid:{get:function(){return this._ellipsoid}}});fA.prototype.setDynamicLighting=function(e){this._radiiAndDynamicAtmosphereColor.z=e};var fse=new P;fA.prototype.update=function(e,t){if(!this.show)return;let n=e.mode;if(n!==se.SCENE3D&&n!==se.MORPHING||!e.passes.render)return;let i=P.fromRotationTranslation(e.context.uniformState.inverseViewRotation,h.ZERO,fse),o=P.multiplyTransformation(i,Bi.Y_UP_TO_Z_UP,fse),r=P.multiply(this._scaleMatrix,o,fse);P.clone(r,this._modelMatrix);let s=e.context,a=swt(this),c=e.globeTranslucencyState.translucent,d=this.perFragmentAtmosphere||c||!l(t)||!t.show,u=this._command;if(!l(u.vertexArray)){let p=Ha.createGeometry(new Ha({radii:new h(1,1,1),slicePartitions:256,stackPartitions:256,vertexFormat:Me.POSITION_ONLY}));u.vertexArray=Un.fromGeometry({context:s,geometry:p,attributeLocations:Bn.createAttributeLocations(p),bufferUsage:Pe.STATIC_DRAW}),u.renderState=ze.fromCache({cull:{enabled:!0,face:Di.FRONT},blending:on.ALPHA_BLEND,depthMask:!1})}let m=a|d<<2|c<<3;if(m!==this._flags){this._flags=m;let p=[];a&&p.push("COLOR_CORRECT"),d&&p.push("PER_FRAGMENT_ATMOSPHERE"),c&&p.push("GLOBE_TRANSLUCENT");let b=new Je({defines:p,sources:[Uh,Z1,a2]}),f=new Je({defines:p,sources:[Uh,Z1,s2]});this._spSkyAtmosphere=tn.fromCache({context:s,vertexShaderSource:b,fragmentShaderSource:f}),u.shaderProgram=this._spSkyAtmosphere}return u};function swt(e){return!(W.equalsEpsilon(e.hueShift,0,W.EPSILON7)&&W.equalsEpsilon(e.saturationShift,0,W.EPSILON7)&&W.equalsEpsilon(e.brightnessShift,0,W.EPSILON7))}fA.prototype.isDestroyed=function(){return!1};fA.prototype.destroy=function(){let e=this._command;return e.vertexArray=e.vertexArray&&e.vertexArray.destroy(),this._spSkyAtmosphere=this._spSkyAtmosphere&&this._spSkyAtmosphere.destroy(),ue(this)};var rU=fA;var bEo=x(T(),1);var dEo=x(T(),1);function sU(e){this.sources=e.sources,this._sources=void 0,this._transform=e.transform,this.show=e.show??!0,this._returnCommand=e.returnCommand??!1,this._addToPanoramaCommandList=!this._returnCommand,this._command=new lt({modelMatrix:P.clone(P.IDENTITY),owner:this,pass:Le.ENVIRONMENT}),this._cubeMap=void 0,this._attributeLocations=void 0,this._useHdr=void 0,this._hasError=!1,this._error=void 0;let t=e.credit;typeof t=="string"&&(t=new Lt(t)),this._credit=t}Object.defineProperties(sU.prototype,{transform:{get:function(){return this._transform}},credit:{get:function(){return l(this._credit)?this._credit:void 0}}});sU.prototype.update=function(e,t){let n=this,{mode:i,passes:o,context:r,panoramaCommandList:s}=e;if(!this.show||i!==se.SCENE3D&&i!==se.MORPHING||!o.render)return;if(this._hasError){let c=this._error;throw this._hasError=!1,this._error=void 0,c}if(this._sources!==this.sources){this._sources=this.sources;let c=this.sources;typeof c.positiveX=="string"?gv(r,this._sources).then(function(d){n._cubeMap=n._cubeMap&&n._cubeMap.destroy(),n._cubeMap=d}).catch(d=>{this._hasError=!0,this._error=d}):(this._cubeMap=this._cubeMap&&this._cubeMap.destroy(),this._cubeMap=new es({context:r,source:c})),this._addToPanoramaCommandList=!0}let a=this._command;if(!l(a.vertexArray)){a.uniformMap={u_cubeMap:function(){return n._cubeMap},u_cubeMapPanoramaTransform:function(){return n._transform}};let c=Vc.createGeometry(Vc.fromDimensions({dimensions:new h(2,2,2),vertexFormat:Me.POSITION_ONLY})),d=this._attributeLocations=Bn.createAttributeLocations(c);a.vertexArray=Un.fromGeometry({context:r,geometry:c,attributeLocations:d,bufferUsage:Pe.STATIC_DRAW}),a.renderState=ze.fromCache({depthTest:{enabled:!1},depthMask:!1,blending:on.ALPHA_BLEND}),this._addToPanoramaCommandList=!0}if(!l(a.shaderProgram)||this._useHdr!==t){let c=new Je({defines:[t?"HDR":""],sources:[c2]});a.shaderProgram=tn.fromCache({context:r,vertexShaderSource:l(this._transform)?Dv:l2,fragmentShaderSource:c,attributeLocations:this._attributeLocations}),this._useHdr=t,this._addToPanoramaCommandList=!0}if(l(this._cubeMap)){if(this.show&&l(this._credit)&&!this._returnCommand&&e.creditDisplay.addCreditToNextFrame(this._credit),this._returnCommand)return a;this._addToPanoramaCommandList&&(s.push(a),this._addToPanoramaCommandList=!1)}};sU.prototype.isDestroyed=function(){return!1};sU.prototype.destroy=function(){let e=this._command;return e.vertexArray=e.vertexArray&&e.vertexArray.destroy(),e.shaderProgram=e.shaderProgram&&e.shaderProgram.destroy(),this._cubeMap=this._cubeMap&&this._cubeMap.destroy(),ue(this)};var SR=sU;function ZR(e){this._sources=e.sources,this._show=e.show??!0,this._panorama=new SR({sources:this._sources,show:this._show,returnCommand:!0})}Object.defineProperties(ZR.prototype,{sources:{get:function(){return this._panorama.sources},set:function(e){this._panorama.sources=e}},show:{get:function(){return this._panorama.show},set:function(e){this._panorama.show=e}}});ZR.prototype.update=function(e,t){let{mode:n,passes:i}=e;if(!(n!==se.SCENE3D&&n!==se.MORPHING)&&i.render)return this._panorama.update(e,t)};ZR.prototype.isDestroyed=function(){return!1};ZR.prototype.destroy=function(){return this._panorama=this._panorama&&this._panorama.destroy(),ue(this)};function pA(e){return en(`Assets/Textures/SkyBox/tycho2t3_80_${e}.jpg`)}ZR.createEarthSkyBox=function(){return new ZR({sources:{positiveX:pA("px"),negativeX:pA("mx"),positiveY:pA("py"),negativeY:pA("my"),positiveZ:pA("pz"),negativeZ:pA("mz")}})};var aU=ZR;var BEo=x(T(),1);function lU(){this.show=!0,this._drawCommand=new lt({primitiveType:Ie.TRIANGLES,boundingVolume:new me,owner:this}),this._commands={drawCommand:this._drawCommand,computeCommand:void 0},this._boundingVolume=new me,this._boundingVolume2D=new me,this._texture=void 0,this._drawingBufferWidth=void 0,this._drawingBufferHeight=void 0,this._radiusTS=void 0,this._size=void 0,this.glowFactor=1,this._glowFactorDirty=!1,this._useHdr=void 0;let e=this;this._uniformMap={u_texture:function(){return e._texture},u_size:function(){return e._size}}}Object.defineProperties(lU.prototype,{glowFactor:{get:function(){return this._glowFactor},set:function(e){e=Math.max(e,0),this._glowFactor=e,this._glowFactorDirty=!0}}});var awt=new k,cwt=new k,lwt=new ce,cU=new ce;lU.prototype.update=function(e,t,n){if(!this.show)return;let i=e.mode;if(i===se.SCENE2D||i===se.MORPHING||!e.passes.render)return;let o=e.context,r=t.viewport.width,s=t.viewport.height;if(!l(this._texture)||r!==this._drawingBufferWidth||s!==this._drawingBufferHeight||this._glowFactorDirty||n!==this._useHdr){this._texture=this._texture&&this._texture.destroy(),this._drawingBufferWidth=r,this._drawingBufferHeight=s,this._glowFactorDirty=!1,this._useHdr=n;let C=Math.max(r,s);C=Math.pow(2,Math.ceil(Math.log(C)/Math.log(2))-2),C=Math.max(1,C);let E=n?o.halfFloatingPointTexture?Ue.HALF_FLOAT:Ue.FLOAT:Ue.UNSIGNED_BYTE;this._texture=new vt({context:o,width:C,height:C,pixelFormat:Qe.RGBA,pixelDatatype:E}),this._glowLengthTS=this._glowFactor*5,this._radiusTS=1/(1+2*this._glowLengthTS)*.5;let A=this,L={u_radiusTS:function(){return A._radiusTS}};this._commands.computeCommand=new bu({fragmentShaderSource:u2,outputTexture:this._texture,uniformMap:L,persists:!1,owner:this,postExecute:function(){A._commands.computeCommand=void 0}})}let a=this._drawCommand;if(!l(a.vertexArray)){let C={direction:0},E=new Uint8Array(8);E[0]=0,E[1]=0,E[2]=255,E[3]=0,E[4]=255,E[5]=255,E[6]=0,E[7]=255;let A=it.createVertexBuffer({context:o,typedArray:E,usage:Pe.STATIC_DRAW}),L=[{index:C.direction,vertexBuffer:A,componentsPerAttribute:2,normalize:!0,componentDatatype:J.UNSIGNED_BYTE}],F=it.createIndexBuffer({context:o,typedArray:new Uint16Array([0,1,2,0,2,3]),usage:Pe.STATIC_DRAW,indexDatatype:Oe.UNSIGNED_SHORT});a.vertexArray=new Un({context:o,attributes:L,indexBuffer:F}),a.shaderProgram=tn.fromCache({context:o,vertexShaderSource:m2,fragmentShaderSource:d2,attributeLocations:C}),a.renderState=ze.fromCache({blending:on.ALPHA_BLEND}),a.uniformMap=this._uniformMap}let c=o.uniformState.sunPositionWC,d=o.uniformState.sunPositionColumbusView,u=this._boundingVolume,m=this._boundingVolume2D;h.clone(c,u.center),m.center.x=d.z,m.center.y=d.x,m.center.z=d.y,u.radius=W.SOLAR_RADIUS+W.SOLAR_RADIUS*this._glowLengthTS,m.radius=u.radius,i===se.SCENE3D?me.clone(u,a.boundingVolume):i===se.COLUMBUS_VIEW&&me.clone(m,a.boundingVolume);let p=fo.computeActualEllipsoidPosition(e,c,cU),b=h.magnitude(h.subtract(p,e.camera.position,cU)),f=o.uniformState.projection,y=lwt;y.x=0,y.y=0,y.z=-b,y.w=1;let _=P.multiplyByVector(f,y,cU),S=fo.clipToGLWindowCoordinates(t.viewport,_,awt);y.x=W.SOLAR_RADIUS;let Z=P.multiplyByVector(f,y,cU),R=fo.clipToGLWindowCoordinates(t.viewport,Z,cwt);return this._size=k.magnitude(k.subtract(R,S,cU)),this._size=2*this._size*(1+2*this._glowLengthTS),this._size=Math.ceil(this._size),this._commands};lU.prototype.isDestroyed=function(){return!1};lU.prototype.destroy=function(){let e=this._drawCommand;return e.vertexArray=e.vertexArray&&e.vertexArray.destroy(),e.shaderProgram=e.shaderProgram&&e.shaderProgram.destroy(),this._texture=this._texture&&this._texture.destroy(),ue(this)};var dU=lU;var jAo=x(T(),1);var vAo=x(T(),1);var qPe=x(eD(),1);var HEo=x(T(),1);function dwt(e,t,n){return` float clipDistance = clip(gl_FragCoord, ${e}, ${t}); +}`});function OLe(){this.shape=Tc.BOX,this.dimensions=new h(1,1,1),this.names=["data"],this.types=[St.SCALAR],this.componentTypes=[Nt.FLOAT32],this.maximumTileCount=1}OLe.prototype.requestData=function(e){if((l(e)?e.tileLevel??0:0)>=1)return;let n=new OZ({metadata:[new Float32Array(1)]});return Promise.resolve(n)};A0.DefaultProvider=new OLe;var uT=A0;var Muo=x(T(),1);function _vt(e,t,n,i){if(!l(e)||l(t)&&e.id!==t)return;let r=(e.classes||{})[n];if(!l(r))return;let a=(r.properties||{})[i];if(l(a))return a}var B9=_vt;var kuo=x(T(),1);function Svt(e,t,n,i,o){this.schemaId=e,this.className=t,this.propertyName=n,this.classProperty=i,this.metadataProperty=o}var z9=Svt;var Ouo=x(T(),1);function Zvt(e,t,n){if(!l(e))return;let i=e.propertyTextures;for(let o of i)if(o.class.id===t){let a=o.properties[n];if(l(a))return a}}var H9=Zvt;var zz=function(e){return function(){e.frameState.afterRender.push(function(){e.requestRender()})}};function _i(e){e=e??B.EMPTY_OBJECT;let t=e.canvas,n=e.creditContainer,i=e.creditViewport,o=e.contextOptions instanceof Tv;if(o)this._context=e.contextOptions.createSceneContext(t);else{let d=$e(e.contextOptions);this._context=new g_(t,d)}let r=this._context,s=l(n);s||(n=document.createElement("div"),n.style.position="absolute",n.style.bottom="0",n.style["text-shadow"]="0 0 2px #000000",n.style.color="#ffffff",n.style["font-size"]="10px",n.style["padding-right"]="5px",t.parentNode.appendChild(n)),l(i)||(i=t.parentNode),this._id=Qn(),this._jobScheduler=new dw,this._heightQueryCache=new Map,this._heightQueryFrame=-1,this._frameState=new Ox(r,new ew(n,"\u2022",i),this._jobScheduler),this._frameState.scene3DOnly=e.scene3DOnly??!1,this._removeCreditContainer=!s,this._creditContainer=n,this._canvas=t,this._computeEngine=new uG(r),this._ellipsoid=e.ellipsoid??ne.default,this._globe=void 0,this._globeTranslucencyState=new lw,this._primitives=new Qc({countReferences:o}),this._groundPrimitives=new Qc({countReferences:o}),this._globeHeight=void 0,this._globeHeightDirty=!0,this._cameraUnderground=!1,this._removeUpdateHeightCallback=void 0,this._logDepthBuffer=_i.defaultLogDepthBuffer&&r.fragmentDepth,this._logDepthBufferDirty=!0,this._tweens=new MZ,this._shaderFrameCount=0,this._sunPostProcess=void 0,this._computeCommandList=[],this._overlayCommandList=[],this._useOIT=e.orderIndependentTranslucency??!0,this._executeOITFunction=void 0,this._depthPlane=new sw(e.depthPlaneEllipsoidOffset),this._clearColorCommand=new ui({color:new U,stencil:0,owner:this}),this._depthClearCommand=new ui({depth:1,owner:this}),this._stencilClearCommand=new ui({stencil:0}),this._classificationStencilClearCommand=new ui({stencil:0,renderState:ze.fromCache({stencilMask:Jt.CLASSIFICATION_MASK})}),this._depthOnlyRenderStateCache={},this._transitioner=new $w(this),this._preUpdate=new Se,this._postUpdate=new Se,this._renderError=new Se,this._preRender=new Se,this._postRender=new Se,this._controllerHost=new QM,this._minimumDisableDepthTestDistance=0,this._debugInspector=new m9,this._msaaSamples=e.msaaSamples??4,this.rethrowRenderErrors=!1,this.completeMorphOnUserInput=!0,this.morphStart=new Se,this.morphComplete=new Se,this.skyBox=void 0,this.skyAtmosphere=void 0,this.sun=void 0,this.sunBloom=!0,this._sunBloom=void 0,this.moon=void 0,this.backgroundColor=U.clone(U.BLACK),this._mode=se.SCENE3D,this._mapProjection=l(e.mapProjection)?e.mapProjection:new ki(this._ellipsoid),this.morphTime=1,this.farToNearRatio=1e3,this.logarithmicDepthFarToNearRatio=1e9,this.nearToFarDistance2D=175e4,this.verticalExaggeration=1,this.verticalExaggerationRelativeHeight=0,this.debugCommandFilter=void 0,this.debugShowCommands=!1,this.debugShowFrustums=!1,this.debugShowFramesPerSecond=!1,this.debugShowDepthFrustum=1,this.debugShowFrustumPlanes=!1,this._debugShowFrustumPlanes=!1,this._debugFrustumPlanes=void 0,this.useDepthPicking=!0,this.pickTranslucentDepth=!1,this.cameraEventWaitTime=500,this.atmosphere=new gS,this.fog=new cw,this.fog.enabled=ne.WGS84.equals(this._ellipsoid),ne.WGS84.equals(this._ellipsoid)||(Io.DEFAULT_VIEW_RECTANGLE=re.fromDegrees(-45,-45,45,45)),this._shadowMapCamera=new Io(this),this.shadowMap=new Ng({context:r,lightCamera:this._shadowMapCamera,enabled:e.shadows??!1}),this.invertClassification=!1,this.invertClassificationColor=U.clone(U.WHITE),this._actualInvertClassificationColor=U.clone(this._invertClassificationColor),this._invertClassification=new aE,this.focalLength=void 0,this.eyeSeparation=void 0,this.postProcessStages=new jw,this._brdfLutGenerator=new BM,this._performanceDisplay=void 0,this._debugVolume=void 0,this._screenSpaceCameraController=new i9(this),this._cameraUnderground=!1,this._mapMode2D=e.mapMode2D??md.INFINITE_SCROLL,this._environmentState={skyBoxCommand:void 0,skyAtmosphereCommand:void 0,sunDrawCommand:void 0,sunComputeCommand:void 0,moonCommand:void 0,isSunVisible:!1,isMoonVisible:!1,isReadyForAtmosphere:!1,isSkyAtmosphereVisible:!1,clearGlobeDepth:!1,useDepthPlane:!1,renderTranslucentDepthForPick:!1,originalFramebuffer:void 0,useGlobeDepthFramebuffer:!1,useOIT:!1,useInvertClassification:!1,usePostProcess:!1,usePostProcessSelected:!1,useWebVR:!1},this._useWebVR=!1,this._cameraVR=void 0,this._aspectRatioVR=void 0,this.requestRenderMode=e.requestRenderMode??!1,this._renderRequested=!0,this.maximumRenderTimeChange=e.maximumRenderTimeChange??0,this._lastRenderTime=void 0,this._frameRateMonitor=void 0,this._removeRequestListenerCallback=Hc.requestCompletedEvent.addEventListener(zz(this)),this._removeTaskProcessorListenerCallback=qn.taskCompletedEvent.addEventListener(zz(this)),this._removeGlobeCallbacks=[],this._removeTerrainProviderReadyListener=void 0;let a=new nt(0,0,r.drawingBufferWidth,r.drawingBufferHeight),c=new Io(this);this._logDepthBuffer&&(c.frustum.near=.1,c.frustum.far=1e10),this.preloadFlightCamera=new Io(this),this.preloadFlightCullingVolume=void 0,this._picking=new Aw(this),this._defaultView=new vZ(this,c,a),this._view=this._defaultView,this._hdr=void 0,this._hdrDirty=void 0,this.highDynamicRange=!1,this.gamma=2.2,this.sphericalHarmonicCoefficients=void 0,this.specularEnvironmentMaps=void 0,this._specularEnvironmentCubeMap=void 0,this.light=new cb,this._enableEdgeVisibility=!1,this._enablePlanarFillId=!1,jLe(this,0,Q.now()),this.updateFrameState(),this.initializeFrame()}_i.defaultLogDepthBuffer=!0;function Rvt(e,t){for(let i=0;i<e._removeGlobeCallbacks.length;++i)e._removeGlobeCallbacks[i]();e._removeGlobeCallbacks.length=0;let n=[];l(t)&&(n.push(t.imageryLayersUpdatedEvent.addEventListener(zz(e))),n.push(t.terrainProviderChanged.addEventListener(zz(e)))),e._removeGlobeCallbacks=n}Object.defineProperties(_i.prototype,{canvas:{get:function(){return this._canvas}},drawingBufferHeight:{get:function(){return this._context.drawingBufferHeight}},drawingBufferWidth:{get:function(){return this._context.drawingBufferWidth}},maximumAliasedLineWidth:{get:function(){return wt.maximumAliasedLineWidth}},maximumCubeMapSize:{get:function(){return wt.maximumCubeMapSize}},pickPositionSupported:{get:function(){return this._context.depthTexture}},sampleHeightSupported:{get:function(){return this._context.depthTexture}},clampToHeightSupported:{get:function(){return this._context.depthTexture}},invertClassificationSupported:{get:function(){return this._context.depthTexture}},specularEnvironmentMapsSupported:{get:function(){return xf.isSupported(this._context)}},ellipsoid:{get:function(){return this._ellipsoid}},globe:{get:function(){return this._globe},set:function(e){this._globe=this._globe&&this._globe.destroy(),this._globe=e,Rvt(this,e)}},primitives:{get:function(){return this._primitives}},groundPrimitives:{get:function(){return this._groundPrimitives}},camera:{get:function(){return this._view.camera},set:function(e){this._view.camera=e}},view:{get:function(){return this._view},set:function(e){this._view=e}},defaultView:{get:function(){return this._defaultView}},picking:{get:function(){return this._picking}},controllerHost:{get:function(){return this._controllerHost}},screenSpaceCameraController:{get:function(){return this._screenSpaceCameraController}},mapProjection:{get:function(){return this._mapProjection}},jobScheduler:{get:function(){return this._jobScheduler}},frameState:{get:function(){return this._frameState}},environmentState:{get:function(){return this._environmentState}},tweens:{get:function(){return this._tweens}},imageryLayers:{get:function(){if(l(this.globe))return this.globe.imageryLayers}},terrainProvider:{get:function(){if(l(this.globe))return this.globe.terrainProvider},set:function(e){this._removeTerrainProviderReadyListener=this._removeTerrainProviderReadyListener&&this._removeTerrainProviderReadyListener(),l(this.globe)&&(this.globe.terrainProvider=e)}},terrainProviderChanged:{get:function(){if(l(this.globe))return this.globe.terrainProviderChanged}},vectorProvider:{get:function(){return this.globe?.vectorProvider}},preUpdate:{get:function(){return this._preUpdate}},postUpdate:{get:function(){return this._postUpdate}},renderError:{get:function(){return this._renderError}},preRender:{get:function(){return this._preRender}},postRender:{get:function(){return this._postRender}},lastRenderTime:{get:function(){return this._lastRenderTime}},context:{get:function(){return this._context}},debugFrustumStatistics:{get:function(){return this._view.debugFrustumStatistics}},scene3DOnly:{get:function(){return this._frameState.scene3DOnly}},orderIndependentTranslucency:{get:function(){return this._useOIT}},id:{get:function(){return this._id}},mode:{get:function(){return this._mode},set:function(e){e===se.SCENE2D?this.morphTo2D(0):e===se.SCENE3D?this.morphTo3D(0):e===se.COLUMBUS_VIEW&&this.morphToColumbusView(0),this._mode=e}},frustumCommandsList:{get:function(){return this._view.frustumCommandsList}},numberOfFrustums:{get:function(){return this._view.frustumCommandsList.length}},useWebVR:{get:function(){return this._useWebVR},set:function(e){this._useWebVR=e,this._useWebVR?(this._frameState.creditDisplay.container.style.visibility="hidden",this._cameraVR=new Io(this),l(this._deviceOrientationCameraController)||(this._deviceOrientationCameraController=new aw(this)),this._aspectRatioVR=this.camera.frustum.aspectRatio):(this._frameState.creditDisplay.container.style.visibility="visible",this._cameraVR=void 0,this._deviceOrientationCameraController=this._deviceOrientationCameraController&&!this._deviceOrientationCameraController.isDestroyed()&&this._deviceOrientationCameraController.destroy(),this.camera.frustum.aspectRatio=this._aspectRatioVR,this.camera.frustum.xOffset=0)}},mapMode2D:{get:function(){return this._mapMode2D}},splitPosition:{get:function(){return this._frameState.splitPosition},set:function(e){this._frameState.splitPosition=e}},minimumDisableDepthTestDistance:{get:function(){return this._minimumDisableDepthTestDistance},set:function(e){this._minimumDisableDepthTestDistance=e}},logarithmicDepthBuffer:{get:function(){return this._logDepthBuffer},set:function(e){e=this._context.fragmentDepth&&e,this._logDepthBuffer!==e&&(this._logDepthBuffer=e,this._logDepthBufferDirty=!0)}},gamma:{get:function(){return this._context.uniformState.gamma},set:function(e){this._context.uniformState.gamma=e}},highDynamicRange:{get:function(){return this._hdr},set:function(e){let t=this._context,n=e&&t.depthTexture&&(t.colorBufferFloat||t.colorBufferHalfFloat);this._hdrDirty=n!==this._hdr,this._hdr=n}},highDynamicRangeSupported:{get:function(){let e=this._context;return e.depthTexture&&(e.colorBufferFloat||e.colorBufferHalfFloat)}},cameraUnderground:{get:function(){return this._cameraUnderground}},msaaSamples:{get:function(){return this._msaaSamples},set:function(e){e=Math.min(e,wt.maximumSamples),this._msaaSamples=e}},msaaSupported:{get:function(){return this._context.msaa}},pixelRatio:{get:function(){return this._frameState.pixelRatio},set:function(e){this._frameState.pixelRatio=e}},opaqueFrustumNearOffset:{get:function(){return .9999}},globeHeight:{get:function(){return this._globeHeight}}});_i.prototype.getCompressedTextureFormatSupported=function(e){let t=this.context;return(e==="WEBGL_compressed_texture_s3tc"||e==="s3tc")&&t.s3tc||(e==="WEBGL_compressed_texture_pvrtc"||e==="pvrtc")&&t.pvrtc||(e==="WEBGL_compressed_texture_etc"||e==="etc")&&t.etc||(e==="WEBGL_compressed_texture_etc1"||e==="etc1")&&t.etc1||(e==="WEBGL_compressed_texture_astc"||e==="astc")&&t.astc||(e==="EXT_texture_compression_bptc"||e==="bc7")&&t.bc7};function Cvt(e,t){let n=e.pickedMetadataInfo,i=t.pickedMetadataInfo;return n?.schemaId!==i?.schemaId||n?.className!==i?.className||n?.propertyName!==i?.propertyName}function BLe(e,t,n){let i=e._frameState,o=e._context,r=e._view.oit,{lightShadowMaps:s,lightShadowsEnabled:a}=i.shadowState,c=t.derivedCommands;l(t.pickId)&&(c.picking=kf.createPickDerivedCommand(e,t,o,c.picking)),l(t.snapId)&&i.passes.snap&&(c.snapping=kf.createSnapDerivedCommand(e,t,o,c.snapping)),i.pickingMetadata&&t.pickMetadataAllowed&&(t.pickedMetadataInfo=i.pickedMetadataInfo,l(t.pickedMetadataInfo)&&(c.pickingMetadata=kf.createPickMetadataDerivedCommand(e,t,o,c.pickingMetadata))),t.pickOnly||(c.depth=kf.createDepthOnlyDerivedCommand(e,t,o,c.depth)),c.originalCommand=t,e._hdr&&(c.hdr=kf.createHdrCommand(t,o,c.hdr),t=c.hdr.command,c=t.derivedCommands),a&&t.receiveShadows&&(c.shadows=Ng.createReceiveDerivedCommand(s,t,n,o,c.shadows)),t.pass===Le.TRANSLUCENT&&l(r)&&r.isSupported()&&(a&&t.receiveShadows?(c.oit=l(c.oit)?c.oit:{},c.oit.shadows=r.createDerivedCommands(c.shadows.receiveCommand,o,c.oit.shadows)):c.oit=r.createDerivedCommands(t,o,c.oit))}_i.prototype.updateDerivedCommands=function(e){let{derivedCommands:t}=e;if(!l(t))return;let n=this._frameState,{shadowState:i,useLogDepth:o}=this._frameState,r=this._context,s=!1,a=i.lastDirtyTime;e.lastDirtyTime!==a&&(e.lastDirtyTime=a,e.dirty=!0,s=!0);let c=this._hdr,d=l(t.logDepth),u=l(t.hdr),m=l(t.originalCommand),p=o&&!d,b=c&&!u,f=(!o||!c)&&!m,y=n.pickingMetadata&&Cvt(e,n),_=n.passes.snap&&l(e.snapId)&&!l(t.snapping);if(e.dirty=e.dirty||p||b||f||y||_,!e.dirty)return;e.dirty=!1;let{shadowsEnabled:S,shadowMaps:Z}=i;S&&e.castShadows&&(t.shadows=Ng.createCastDerivedCommand(Z,e,s,r,t.shadows)),(d||p)&&(t.logDepth=kf.createLogDepthCommand(e,r,t.logDepth),BLe(this,t.logDepth.command,s)),(m||f)&&BLe(this,e,s)};var Vvt=new ph({pass:lr.RENDER}),Bne=new ph({pass:lr.PRELOAD}),zne=new ph({pass:lr.PRELOAD_FLIGHT}),Evt=new ph({pass:lr.REQUEST_RENDER_MODE_DEFER_CHECK}),zLe=new me,Hne;function Avt(e){if(!(e._mode!==se.SCENE3D||!e.globe?.show||e._cameraUnderground||e._globeTranslucencyState.translucent))return zLe.radius=e.ellipsoid.minimumRadius+e.frameState.minimumTerrainHeight,Hne=DM.fromBoundingSphere(zLe,e.camera.positionWC,Hne),Hne}_i.prototype.clearPasses=function(e){e.render=!1,e.pick=!1,e.pickVoxel=!1,e.snap=!1,e.depth=!1,e.postProcess=!1,e.offscreen=!1};function jLe(e,t,n){let i=e._frameState;i.frameNumber=t,i.time=Q.clone(n,i.time)}_i.prototype.updateFrameState=function(){let e=this.camera,t=this._frameState;t.commandList.length=0,t.shadowMaps.length=0,t.brdfLutGenerator=this._brdfLutGenerator,t.environmentMap=this.skyBox&&this.skyBox._cubeMap,t.mode=this._mode,t.morphTime=this.morphTime,t.mapProjection=this.mapProjection,t.camera=e,t.cullingVolume=e.frustum.computeCullingVolume(e.positionWC,e.directionWC,e.upWC),t.occluder=Avt(this),t.minimumTerrainHeight=0,t.minimumDisableDepthTestDistance=this._minimumDisableDepthTestDistance,t.invertClassification=this.invertClassification,t.useLogDepth=this._logDepthBuffer&&!(this.camera.frustum instanceof yn||this.camera.frustum instanceof ps),t.light=this.light,t.cameraUnderground=this._cameraUnderground,t.globeTranslucencyState=this._globeTranslucencyState;let{globe:n}=this;l(n)&&n._terrainExaggerationChanged&&(this.verticalExaggeration=n._terrainExaggeration,this.verticalExaggerationRelativeHeight=n._terrainExaggerationRelativeHeight,n._terrainExaggerationChanged=!1),t.verticalExaggeration=this.verticalExaggeration,t.verticalExaggerationRelativeHeight=this.verticalExaggerationRelativeHeight,l(this._specularEnvironmentCubeMap)&&this._specularEnvironmentCubeMap.ready?(t.specularEnvironmentMaps=this._specularEnvironmentCubeMap.texture,t.specularEnvironmentMapsMaximumLOD=this._specularEnvironmentCubeMap.maximumMipmapLevel):(t.specularEnvironmentMaps=void 0,t.specularEnvironmentMapsMaximumLOD=void 0),t.sphericalHarmonicCoefficients=this.sphericalHarmonicCoefficients,this._actualInvertClassificationColor=U.clone(this.invertClassificationColor,this._actualInvertClassificationColor),aE.isTranslucencySupported(this._context)||(this._actualInvertClassificationColor.alpha=1),t.invertClassificationColor=this._actualInvertClassificationColor,l(this.globe)?t.maximumScreenSpaceError=this.globe.maximumScreenSpaceError:t.maximumScreenSpaceError=2,this.clearPasses(t.passes),t.tilesetPassState=void 0};_i.prototype.isVisible=function(e,t,n){if(!l(t))return!1;let{boundingVolume:i}=t;return!l(i)||!t.cull?!0:e.computeVisibility(i)===qt.OUTSIDE?!1:!l(n)||!t.occlude||!i.isOccluded(n)};var Bz=new P(0,0,1,0,1,0,0,0,0,1,0,0,0,0,0,1);Bz=P.inverseTransformation(Bz,Bz);function Gvt(e,t,n,i){let o=t._frameState,r=o.context,s=e.boundingVolume;l(t._debugVolume)&&t._debugVolume.destroy();let a=h.clone(s.center);if(o.mode!==se.SCENE3D){a=P.multiplyByPoint(Bz,a,a);let f=o.mapProjection,y=f.unproject(a);a=f.ellipsoid.cartographicToCartesian(y)}let c,d,{radius:u}=s;l(u)?(c=Ma.createGeometry(new Ma({radii:new h(u,u,u),vertexFormat:Tn.FLAT_VERTEX_FORMAT})),d=P.fromTranslation(a)):(c=Vc.createGeometry(Vc.fromDimensions({dimensions:new h(2,2,2),vertexFormat:Tn.FLAT_VERTEX_FORMAT})),d=P.fromRotationTranslation(s.halfAxes,a,new P)),t._debugVolume=new In({geometryInstances:new Yt({geometry:Bn.toWireframe(c),modelMatrix:d,attributes:{color:new $t(1,0,0,1)}}),appearance:new Tn({flat:!0,translucent:!1}),asynchronous:!1});let m=o.commandList,p=o.commandList=[];t._debugVolume.update(o),e=p[0],o.useLogDepth&&(e=kf.createLogDepthCommand(e,r).command);let b;l(i)&&(b=n.framebuffer,n.framebuffer=i),e.execute(r,n),l(b)&&(n.framebuffer=b),o.commandList=m}function pd(e,t,n,i){let o=t._frameState,r=t._context;if(l(t.debugCommandFilter)&&!t.debugCommandFilter(e))return;if(e instanceof ui){e.execute(r,n);return}e.debugShowBoundingVolume&&l(e.boundingVolume)&&Gvt(e,t,n,i),o.useLogDepth&&l(e.derivedCommands.logDepth)&&(e=e.derivedCommands.logDepth.command);let s=o.passes;if(!s.pick&&!s.pickVoxel&&!s.depth&&t._hdr&&l(e.derivedCommands)&&l(e.derivedCommands.hdr)&&(e=e.derivedCommands.hdr.command),s.pick||s.depth){if(s.pick&&!s.depth){if(o.passes.snap){l(e.derivedCommands.snapping)?(e=e.derivedCommands.snapping.snapCommand,e.execute(r,n)):l(e.derivedCommands.depth)&&(e=e.derivedCommands.depth.depthOnlyCommand,e.execute(r,n));return}if(o.pickingMetadata&&l(e.derivedCommands.pickingMetadata)){e=e.derivedCommands.pickingMetadata.pickMetadataCommand,e.execute(r,n);return}if(!o.pickingMetadata&&l(e.derivedCommands.picking)){e=e.derivedCommands.picking.pickCommand,e.execute(r,n);return}}else if(l(e.derivedCommands.depth)){e=e.derivedCommands.depth.depthOnlyCommand,e.execute(r,n);return}}if(t.debugShowCommands||t.debugShowFrustums){t._debugInspector.executeDebugShowFrustumsCommand(t,e,n);return}o.shadowState.lightShadowsEnabled&&e.receiveShadows&&l(e.derivedCommands.shadows)?e.derivedCommands.shadows.receiveCommand.execute(r,n):e.execute(r,n)}function HLe(e,t,n){let{derivedCommands:i}=e;if(!l(i))return;let o=t._frameState,r=t._context;o.useLogDepth&&l(i.logDepth)&&(e=i.logDepth.command);let{picking:s,pickingMetadata:a,depth:c}=e.derivedCommands;l(a)&&(e=i.pickingMetadata.pickMetadataCommand,e.execute(r,n)),l(s)?(e=s.pickCommand,e.execute(r,n)):l(c)&&(e=c.depthOnlyCommand,e.execute(r,n))}function QLe(e,t,n){return t.boundingVolume.distanceSquaredTo(n)-e.boundingVolume.distanceSquaredTo(n)}var Lvt=new h;function KLe(e,t){let n=h.subtract(e,t,Lvt),i=Math.max(0,h.magnitude(n));return i*i}function Wvt(e,t,n){let i=e.boundingVolume,o=t.boundingVolume;return KLe(o.center,n)-KLe(i.center,n)}function vvt(e,t,n){return e.boundingVolume.distanceSquaredTo(n)-t.boundingVolume.distanceSquaredTo(n)+W.EPSILON12}function Fvt(e,t,n,i,o){p0(i,QLe,e.camera.positionWC),l(o)&&t(o.unclassifiedCommand,e,n);for(let r=0;r<i.length;++r)t(i[r],e,n)}function Ivt(e,t,n,i,o){p0(i,vvt,e.camera.positionWC),l(o)&&t(o.unclassifiedCommand,e,n);for(let r=0;r<i.length;++r)t(i[r],e,n)}function Pvt(e,t,n){e.context.uniformState.updatePass(Le.VOXELS);let i=n.commands[Le.VOXELS];i.length=n.indices[Le.VOXELS],p0(i,QLe,e.camera.positionWC);for(let o=0;o<i.length;++o)pd(i[o],e,t)}function Xvt(e,t,n){e.context.uniformState.updatePass(Le.GAUSSIAN_SPLATS);let i=n.commands[Le.GAUSSIAN_SPLATS];i.length=n.indices[Le.GAUSSIAN_SPLATS],p0(i,Wvt,e.camera.positionWC);for(let o=0;o<i.length;++o)pd(i[o],e,t)}var Nvt=new Qi,Yvt=new ud,Mvt=new yn,wvt=new ps;function kvt(e){let{frustum:t}=e;return l(t.fov)?t.clone(Nvt):l(t.infiniteProjectionMatrix)?t.clone(Yvt):l(t.width)?t.clone(Mvt):t.clone(wvt)}function Uvt(e){if(e._environmentState.useOIT){if(!l(e._executeOITFunction)){let{view:t,context:n}=e;e._executeOITFunction=function(i,o,r,s,a){t.globeDepth.prepareColorTextures(n),t.oit.executeCommands(i,o,r,s,a)}}return e._executeOITFunction}return e.frameState.passes.render?Fvt:Ivt}function Dvt(e,t,n){let{frameState:i,context:o}=e,{pick:r,pickVoxel:s}=i.passes,a=r||s,c;!a&&e._environmentState.useInvertClassification&&i.invertClassificationColor.alpha<1&&(c=e._invertClassification);let d=Uvt(e);o.uniformState.updatePass(Le.TRANSLUCENT);let u=n.commands[Le.TRANSLUCENT];u.length=n.indices[Le.TRANSLUCENT],d(e,pd,t,u,c)}function Ovt(e,t,n){let{translucentTileClassification:i,globeDepth:o}=e._view;if(!(n.indices[Le.CESIUM_3D_TILE_CLASSIFICATION]>0)||!i.isSupported())return;let s=n.commands[Le.TRANSLUCENT];i.executeTranslucentCommands(e,pd,t,s,o.depthStencilTexture),i.executeClassificationCommands(e,pd,t,n)}function Bvt(e,t,n){e.context.uniformState.updatePass(Le.CESIUM_3D_TILE_EDGES);let i=t.framebuffer;e.context.uniformState.edgeColorTexture=e.context.defaultTexture,e.context.uniformState.edgeIdTexture=e.context.defaultTexture,e.context.uniformState.edgeDepthTexture=e.context.defaultTexture,e._enableEdgeVisibility&&l(e._view)&&l(e._view.edgeFramebuffer)&&(t.framebuffer=e._view.edgeFramebuffer.framebuffer);let o=n.commands[Le.CESIUM_3D_TILE_EDGES],r=n.indices[Le.CESIUM_3D_TILE_EDGES];e._enableEdgeVisibility&&l(e._view)&&l(e._view.edgeFramebuffer)&&e._view.edgeFramebuffer.getClearCommand(new U(0,0,0,0)).execute(e.context,t);for(let s=0;s<r;++s)pd(o[s],e,t);t.framebuffer=i}function zvt(e,t,n){let{context:i}=e,{uniformState:o}=i;o.updatePass(Le.CESIUM_3D_TILE_PLANAR_FILL_ID),o.planarFillIdTexture=i.defaultTexture;let r=e._view,s=r&&r.planarFillIdFramebuffer,a=n.commands[Le.CESIUM_3D_TILE_PLANAR_FILL_ID],c=n.indices[Le.CESIUM_3D_TILE_PLANAR_FILL_ID];if(c!==0&&e._enablePlanarFillId&&l(s)&&l(s.framebuffer)){let d=t.framebuffer;t.framebuffer=s.framebuffer,s.getClearCommand(new U(0,0,0,0)).execute(i,t);for(let m=0;m<c;++m)pd(a[m],e,t);t.framebuffer=d}}function Hvt(e,t,n){e.context.uniformState.updatePass(Le.CESIUM_3D_TILE_EDGES_DIRECT);let i=n.commands[Le.CESIUM_3D_TILE_EDGES_DIRECT],o=n.indices[Le.CESIUM_3D_TILE_EDGES_DIRECT];for(let r=0;r<o;++r)pd(i[r],e,t)}function Jne(e,t){let{camera:n,context:i,frameState:o}=e,{uniformState:r}=i;r.updateCamera(n),r.planarFillIdTexture=i.defaultTexture;let s=kvt(n);s.near=n.frustum.near,s.far=n.frustum.far;let a=o.passes,c=a.pick||a.pickVoxel;c||Kvt(e,t);let{clearGlobeDepth:d,renderTranslucentDepthForPick:u,useDepthPlane:m,useGlobeDepthFramebuffer:p,useInvertClassification:b,usePostProcessSelected:f}=e._environmentState,{globeDepth:y,globeTranslucencyFramebuffer:_,sceneFramebuffer:S,frustumCommandsList:Z}=e._view,R=Z.length,C=e._globeTranslucencyState,E=e._depthClearCommand,A=e._stencilClearCommand,L=e._classificationStencilClearCommand,F=e._depthPlane,I=n.position.z;function N(V,G){r.updatePass(G);let v=V.commands[G],X=V.indices[G];for(let Y=0;Y<X;++Y)pd(v[Y],e,t);return X}function g(V,G){r.updatePass(G);let v=V.commands[G],X=V.indices[G];for(let Y=0;Y<X;++Y)HLe(v[Y],e,t)}for(let V=0;V<R;++V){let G=R-V-1,v=Z[G];e.mode===se.SCENE2D?(n.position.z=I-v.near+1,s.far=Math.max(1,v.far-v.near),s.near=1,r.update(o),r.updateFrustum(s)):(s.near=G!==0?v.near*e.opaqueFrustumNearOffset:v.near,s.far=v.far,r.updateFrustum(s)),E.execute(i,t),i.stencilBuffer&&A.execute(i,t),C.translucent?(r.updatePass(Le.GLOBE),C.executeGlobeCommands(v,pd,_,e,t)):N(v,Le.GLOBE),p&&y.executeCopyDepth(i,t),u||(C.translucent?(r.updatePass(Le.TERRAIN_CLASSIFICATION),C.executeGlobeClassificationCommands(v,pd,_,e,t)):N(v,Le.TERRAIN_CLASSIFICATION)),d&&(E.execute(i,t),m&&F.execute(i,t));let X;if(Bvt(e,t,v),e._enableEdgeVisibility&&l(e._view)&&l(e._view.edgeFramebuffer)){let D=e._view.edgeFramebuffer.colorTexture;l(D)?e.context.uniformState.edgeColorTexture=D:e.context.uniformState.edgeColorTexture=e.context.defaultTexture;let M=e._view.edgeFramebuffer.idTexture;l(M)?e.context.uniformState.edgeIdTexture=M:e.context.uniformState.edgeIdTexture=e.context.defaultTexture;let O=e._view.edgeFramebuffer.depthTexture;l(O)?e.context.uniformState.edgeDepthTexture=O:e.context.uniformState.edgeDepthTexture=e.context.defaultTexture}else e.context.uniformState.edgeColorTexture=e.context.defaultTexture,e.context.uniformState.edgeIdTexture=e.context.defaultTexture,e.context.uniformState.edgeDepthTexture=e.context.defaultTexture;if(zvt(e,t,v),e._enablePlanarFillId&&l(e._view)&&l(e._view.planarFillIdFramebuffer)){let D=e._view.planarFillIdFramebuffer.idTexture;r.planarFillIdTexture=l(D)?D:i.defaultTexture}else r.planarFillIdTexture=i.defaultTexture;if(!b||c||u)X=N(v,Le.CESIUM_3D_TILE),X>0&&(p&&(y.prepareColorTextures(i,d),y.executeUpdateDepth(i,t,y.depthStencilTexture)),u||(X=N(v,Le.CESIUM_3D_TILE_CLASSIFICATION)));else{e._invertClassification.clear(i,t);let D=t.framebuffer;t.framebuffer=e._invertClassification._fbo.framebuffer,N(v,Le.CESIUM_3D_TILE),p&&(e._invertClassification.prepareTextures(i),y.executeUpdateDepth(i,t,e._invertClassification._fbo.getDepthStencilTexture())),X=N(v,Le.CESIUM_3D_TILE_CLASSIFICATION_IGNORE_SHOW),t.framebuffer=D,e._invertClassification.executeClassified(i,t),o.invertClassificationColor.alpha===1&&e._invertClassification.executeUnclassified(i,t),X>0&&i.stencilBuffer&&L.execute(i,t),X=N(v,Le.CESIUM_3D_TILE_CLASSIFICATION)}if(X>0&&i.stencilBuffer&&A.execute(i,t),Pvt(e,t,v),N(v,Le.OPAQUE),Hvt(e,t,v),Xvt(e,t,v),G!==0&&e.mode!==se.SCENE2D&&(s.near=v.near,r.updateFrustum(s)),Dvt(e,t,v),Ovt(e,t,v),i.depthTexture&&e.useDepthPicking&&(p||u)){let D=e._picking.getPickDepth(e,G);D.update(i,y.depthStencilTexture),D.executeCopyDepth(i,t)}if(c||!f)continue;let Y=t.framebuffer;t.framebuffer=S.getIdFramebuffer(),s.near=G!==0?v.near*e.opaqueFrustumNearOffset:v.near,s.far=v.far,r.updateFrustum(s),C.translucent?(r.updatePass(Le.GLOBE),C.executeGlobeCommands(v,HLe,_,e,t)):g(v,Le.GLOBE),d&&(E.framebuffer=t.framebuffer,E.execute(i,t),E.framebuffer=void 0),d&&m&&F.execute(i,t),g(v,Le.CESIUM_3D_TILE),g(v,Le.OPAQUE),g(v,Le.TRANSLUCENT),t.framebuffer=Y}}function Kvt(e,t){let{context:n,environmentState:i,view:o}=e;if(n.uniformState.updatePass(Le.ENVIRONMENT),l(i.skyBoxCommand)&&pd(i.skyBoxCommand,e,t),i.isSkyAtmosphereVisible&&pd(i.skyAtmosphereCommand,e,t),i.isSunVisible&&(i.sunDrawCommand.execute(n,t),e.sunBloom&&!i.useWebVR)){let s;i.useGlobeDepthFramebuffer?s=o.globeDepth.framebuffer:i.usePostProcess?s=o.sceneFramebuffer.framebuffer:s=i.originalFramebuffer,e._sunPostProcess.execute(n),e._sunPostProcess.copy(n,s),t.framebuffer=s}i.isMoonVisible&&i.moonCommand.execute(n,t);let r=e.frameState.panoramaCommandList;for(let s=r.length-1;s>=0;s--){let a=r[s];l(a.shaderProgram)?pd(r[s],e,t):r.splice(s,1)}}function qLe(e){e.context.uniformState.updatePass(Le.COMPUTE);let t=e._environmentState.sunComputeCommand;l(t)&&t.execute(e._computeEngine);let n=e._computeCommandList;for(let i=0;i<n.length;++i)n[i].execute(e._computeEngine)}function Jvt(e,t){e.context.uniformState.updatePass(Le.OVERLAY);let n=e.context,i=e._overlayCommandList;for(let o=0;o<i.length;++o)i[o].execute(n,t)}function jvt(e,t,n){let{shadowMapCullingVolume:i,isPointLight:o,passes:r}=n,s=r.length,a=[Le.GLOBE,Le.CESIUM_3D_TILE,Le.OPAQUE,Le.TRANSLUCENT];for(let c=0;c<t.length;++c){let d=t[c];if(e.updateDerivedCommands(d),!(!d.castShadows||a.indexOf(d.pass)<0||!e.isVisible(i,d)))if(o)for(let u=0;u<s;++u)r[u].commandList.push(d);else if(s===1)r[0].commandList.push(d);else{let u=!1;for(let m=s-1;m>=0;--m){let p=r[m].cullingVolume;if(e.isVisible(p,d))r[m].commandList.push(d),u=!0;else if(u)break}}}}function $Le(e){let{shadowState:t,commandList:n}=e.frameState,{shadowsEnabled:i,shadowMaps:o}=t;if(!i)return;let{context:r}=e,{uniformState:s}=r;for(let a=0;a<o.length;++a){let c=o[a];if(c.outOfView)continue;let{passes:d}=c;for(let u=0;u<d.length;++u)d[u].commandList.length=0;jvt(e,n,c);for(let u=0;u<d.length;++u){let m=c.passes[u],{camera:p,commandList:b}=m;s.updateCamera(p),c.updatePass(r,u);for(let f=0;f<b.length;++f){let y=b[f];s.updatePass(y.pass);let _=y.derivedCommands.shadows.castCommands[a];pd(_,e,m.passState)}}}}var Qvt=new h;_i.prototype.updateAndExecuteCommands=function(e,t){u2t(this,e,t),this._environmentState.useWebVR?qvt(this,e,t):this._frameState.mode!==se.SCENE2D||this._mapMode2D===md.ROTATE?mT(!0,this,e):a2t(this,e)};function qvt(e,t){let n=e._view,i=n.camera,r=e._environmentState.renderTranslucentDepthForPick;tWe(e),n.createPotentiallyVisibleSet(e),qLe(e),r||$Le(e);let s=t.viewport;s.x=0,s.y=0,s.width=s.width*.5;let a=Io.clone(i,e._cameraVR);a.frustum=i.frustum;let c=i.frustum.near,d=c*(e.focalLength??5),u=e.eyeSeparation??d/30,m=h.multiplyByScalar(a.right,u*.5,Qvt);i.frustum.aspectRatio=s.width/s.height;let p=.5*u*c/d;h.add(a.position,m,i.position),i.frustum.xOffset=p,Jne(e,t),s.x=s.width,h.subtract(a.position,m,i.position),i.frustum.xOffset=-p,Jne(e,t),Io.clone(a,i)}var $vt=new pe(Math.PI,W.PI_OVER_TWO),e2t=new h,t2t=new h,n2t=new P,i2t=new P,o2t=new h,r2t=new h,s2t=new nt;function a2t(e,t){let{frameState:n,camera:i}=e,{uniformState:o}=e.context,r=t.viewport,s=nt.clone(r,s2t);t.viewport=s;let a=$vt,c=e2t;e.mapProjection.project(a,c);let u=h.clone(i.position,t2t),m=P.clone(i.transform,i2t),p=i.frustum.clone();i._setTransform(P.IDENTITY);let b=P.computeViewportTransformation(s,0,1,n2t),f=i.frustum.projectionMatrix,y=i.positionWC.y,_=h.fromElements(W.sign(y)*c.x-y,0,-i.positionWC.x,o2t),S=_t.pointToGLWindowCoordinates(f,b,_,r2t);S.x=Math.floor(S.x);let Z=s.x,R=s.width;if(y===0||S.x<=Z||S.x>=Z+R)mT(!0,e,t);else if(Math.abs(Z+R*.5-S.x)<1)s.width=S.x-s.x,i.position.x*=W.sign(i.position.x),i.frustum.right=0,n.cullingVolume=i.frustum.computeCullingVolume(i.positionWC,i.directionWC,i.upWC),o.update(n),mT(!0,e,t),s.x=S.x,i.position.x=-i.position.x,i.frustum.right=-i.frustum.left,i.frustum.left=0,n.cullingVolume=i.frustum.computeCullingVolume(i.positionWC,i.directionWC,i.upWC),o.update(n),mT(!1,e,t);else if(S.x>Z+R*.5){s.width=S.x-Z;let C=i.frustum.right;i.frustum.right=c.x-y,n.cullingVolume=i.frustum.computeCullingVolume(i.positionWC,i.directionWC,i.upWC),o.update(n),mT(!0,e,t),s.x=S.x,s.width=Z+R-S.x,i.position.x=-i.position.x,i.frustum.left=-i.frustum.right,i.frustum.right=C-i.frustum.right*2,n.cullingVolume=i.frustum.computeCullingVolume(i.positionWC,i.directionWC,i.upWC),o.update(n),mT(!1,e,t)}else{s.x=S.x,s.width=Z+R-S.x;let C=i.frustum.left;i.frustum.left=-c.x-y,n.cullingVolume=i.frustum.computeCullingVolume(i.positionWC,i.directionWC,i.upWC),o.update(n),mT(!0,e,t),s.x=Z,s.width=S.x-Z,i.position.x=-i.position.x,i.frustum.right=-i.frustum.left,i.frustum.left=C-i.frustum.left*2,n.cullingVolume=i.frustum.computeCullingVolume(i.positionWC,i.directionWC,i.upWC),o.update(n),mT(!1,e,t)}i._setTransform(m),h.clone(u,i.position),i.frustum=p.clone(),t.viewport=r}function mT(e,t,n){let i=t._view,{renderTranslucentDepthForPick:o}=t._environmentState;e||(t.frameState.commandList.length=0),tWe(t),i.createPotentiallyVisibleSet(t),e&&(qLe(t),o||$Le(t)),Jne(t,n)}var JLe=new $s;function eWe(e,t,n){if(!e.show)return;let i=e.length;for(let o=0;o<i;++o){let r=e.get(o);if(r instanceof Qc){eWe(r,t,n);continue}r.show&&gg.isSupported(r)&&gs(r.heightReference)&&t.markForFrame(r,n,r.heightReference)}}function c2t(e,t){let n=e.vectorProvider;if(!l(n))return;let i=t.frameNumber;eWe(e._primitives,n,i)}_i.prototype.updateEnvironment=function(){let e=this._frameState,t=this._view,n=this._environmentState,i=e.passes.render,o=e.passes.offscreen,r=this.atmosphere,s=this.skyAtmosphere,a=this.globe,c=this._globeTranslucencyState;if(!i||this._mode!==se.SCENE2D&&t.camera.frustum instanceof yn||!c.environmentVisible)n.skyAtmosphereCommand=void 0,n.skyBoxCommand=void 0,n.sunDrawCommand=void 0,n.sunComputeCommand=void 0,n.moonCommand=void 0;else{if(l(s)){if(l(a))s.setDynamicLighting(wb.fromGlobeFlags(a)),n.isReadyForAtmosphere=n.isReadyForAtmosphere||!a.show||a._surface._tilesToRender.length>0;else{let S=r.dynamicLighting;s.setDynamicLighting(S),n.isReadyForAtmosphere=!0}n.skyAtmosphereCommand=s.update(e,a),l(n.skyAtmosphereCommand)&&this.updateDerivedCommands(n.skyAtmosphereCommand)}else n.skyAtmosphereCommand=void 0;n.skyBoxCommand=l(this.skyBox)?this.skyBox.update(e,this._hdr):void 0;let _=l(this.sun)?this.sun.update(e,t.passState,this._hdr):void 0;n.sunDrawCommand=l(_)?_.drawCommand:void 0,n.sunComputeCommand=l(_)?_.computeCommand:void 0,n.moonCommand=l(this.moon)?this.moon.update(e):void 0}let d=n.clearGlobeDepth=l(a)&&a.show&&(!a.depthTestAgainstTerrain||this.mode===se.SCENE2D);(n.useDepthPlane=d&&this.mode===se.SCENE3D&&c.useDepthPlane)&&this._depthPlane.update(e),n.renderTranslucentDepthForPick=!1,n.useWebVR=this._useWebVR&&this.mode!==se.SCENE2D&&!o;let m=e.mode===se.SCENE3D&&!c.sunVisibleThroughGlobe?e.occluder:void 0,p=e.cullingVolume,b=JLe.planes;for(let _=0;_<5;++_)b[_]=p.planes[_];p=JLe,n.isSkyAtmosphereVisible=l(n.skyAtmosphereCommand)&&n.isReadyForAtmosphere,n.isSunVisible=this.isVisible(p,n.sunDrawCommand,m),n.isMoonVisible=this.isVisible(p,n.moonCommand,m);let f=this.specularEnvironmentMaps,y=this._specularEnvironmentCubeMap;l(f)&&y?.url!==f?(l(y)&&y.destroy(),this._specularEnvironmentCubeMap=new xf(f)):!l(f)&&l(y)&&(y.destroy(),this._specularEnvironmentCubeMap=void 0),l(this._specularEnvironmentCubeMap)&&this._specularEnvironmentCubeMap.update(e),c2t(this,e)};function l2t(e){let t=e._frameState;e.debugShowFrustumPlanes!==e._debugShowFrustumPlanes&&(e.debugShowFrustumPlanes?e._debugFrustumPlanes=new y0({camera:e.camera,updateOnChange:!1,frustumSplits:t.frustumSplits}):e._debugFrustumPlanes=e._debugFrustumPlanes&&e._debugFrustumPlanes.destroy(),e._debugShowFrustumPlanes=e.debugShowFrustumPlanes),l(e._debugFrustumPlanes)&&e._debugFrustumPlanes.update(t)}function d2t(e){let t=e._frameState,{passes:n,shadowState:i,shadowMaps:o}=t,r=o.length,s=r>0&&!n.pick&&!n.pickVoxel&&e.mode===se.SCENE3D;if(s!==i.shadowsEnabled&&(++i.lastDirtyTime,i.shadowsEnabled=s),i.lightShadowsEnabled=!1,!!s){for(let a=0;a<r;++a)if(o[a]!==i.shadowMaps[a]){++i.lastDirtyTime;break}i.shadowMaps.length=0,i.lightShadowMaps.length=0;for(let a=0;a<r;++a){let c=o[a];c.update(t),i.shadowMaps.push(c),c.fromLightSource&&(i.lightShadowMaps.push(c),i.lightShadowsEnabled=!0),c.dirty&&(++i.lastDirtyTime,c.dirty=!1)}}}function tWe(e){let t=e._frameState;t.edgeVisibilityRequested=!1,t.planarFillRequested=!1,e._groundPrimitives.update(t),e._primitives.update(t),t.edgeVisibilityRequested&&e._enableEdgeVisibility===!1&&(e._enableEdgeVisibility=!0),e._enablePlanarFillId=t.planarFillRequested,l2t(e),d2t(e),e._globe&&e._globe.render(t)}function u2t(e,t,n){let i=e._context,o=e._frameState,r=e._environmentState,s=e._view,a=o.passes,c=a.pick||a.pickVoxel;l(s.globeDepth)&&(s.globeDepth.picking=c,s.globeDepth.snapping=a.snap);let d=r.useWebVR;r.originalFramebuffer=t.framebuffer,l(e.sun)&&e.sunBloom!==e._sunBloom?(e.sunBloom&&!d?e._sunPostProcess=new d9:l(e._sunPostProcess)&&(e._sunPostProcess=e._sunPostProcess.destroy()),e._sunBloom=e.sunBloom):!l(e.sun)&&l(e._sunPostProcess)&&(e._sunPostProcess=e._sunPostProcess.destroy(),e._sunBloom=!1);let u=e._clearColorCommand;U.clone(n,u.color),u.execute(i,t);let m=r.useGlobeDepthFramebuffer=l(s.globeDepth);m&&(s.globeDepth.update(i,t,s.viewport,e.msaaSamples,e._hdr,r.clearGlobeDepth),s.globeDepth.clear(i,t,n));let p=s.oit,b=r.useOIT=!c&&l(p)&&p.isSupported();b&&(p.update(i,t,s.globeDepth.colorFramebufferManager,e._hdr,e.msaaSamples),p.clear(i,t,n),r.useOIT=p.isSupported());let f=e.postProcessStages,y=r.usePostProcess=!c&&(e._hdr||f.length>0||f.ambientOcclusion.enabled||f.fxaa.enabled||f.bloom.enabled);r.usePostProcessSelected=!1,y&&(s.sceneFramebuffer.update(i,s.viewport,e._hdr,e.msaaSamples),s.sceneFramebuffer.clear(i,t,n),f.update(i,o.useLogDepth,e._hdr),f.clear(i),y=r.usePostProcess=f.ready,r.usePostProcessSelected=y&&f.hasSelected),r.isSunVisible&&e.sunBloom&&!d?(t.framebuffer=e._sunPostProcess.update(t),e._sunPostProcess.clear(i,t,n)):m?t.framebuffer=s.globeDepth.framebuffer:y&&(t.framebuffer=s.sceneFramebuffer.framebuffer),l(t.framebuffer)&&u.execute(i,t);let _=r.useInvertClassification=!c&&l(t.framebuffer)&&e.invertClassification;if(!c&&e._enableEdgeVisibility&&s.edgeFramebuffer.update(i,s.viewport,e._hdr),!c&&e._enablePlanarFillId?s.planarFillIdFramebuffer.update(i,s.viewport,e._hdr):c||s.planarFillIdFramebuffer.releaseResources(),_){let R;if(o.invertClassificationColor.alpha===1&&m&&(R=s.globeDepth.framebuffer),l(R)||i.depthTexture){if(e._invertClassification.previousFramebuffer=R,e._invertClassification.update(i,e.msaaSamples,s.globeDepth.colorFramebufferManager),e._invertClassification.clear(i,t),o.invertClassificationColor.alpha<1&&b){let C=e._invertClassification.unclassifiedCommand,E=C.derivedCommands;E.oit=p.createDerivedCommands(C,i,E.oit)}}else r.useInvertClassification=!1}e._globeTranslucencyState.translucent&&s.globeTranslucencyFramebuffer.updateAndClear(e._hdr,s.viewport,i,t)}_i.prototype.resolveFramebuffers=function(e){let t=this._context,n=this._environmentState,i=this._view,{globeDepth:o,translucentTileClassification:r}=i;l(o)&&o.prepareColorTextures(t);let{useOIT:s,useGlobeDepthFramebuffer:a,usePostProcess:c,originalFramebuffer:d}=n,u=a?o.colorFramebufferManager:void 0,m=i.sceneFramebuffer._colorFramebuffer,p=i.sceneFramebuffer.idFramebuffer;if(s&&(e.framebuffer=c?m.framebuffer:d,i.oit.execute(t,e)),r.hasTranslucentDepth&&r.isSupported()&&r.execute(this,e),c){i.sceneFramebuffer.prepareColorTextures(t);let b=m;a&&!s&&(b=u);let f=this.postProcessStages,y=b.getColorTexture(0),_=p.getColorTexture(0),S=(u??m).getDepthStencilTexture();f.execute(t,y,S,_),f.copy(t,d)}!s&&!c&&a&&(e.framebuffer=d,o.executeCopyColor(t,e))};function m2t(e){let t=e._frameState.afterRender,n=t.slice();t.length=0;for(let i=0;i<n.length;++i)n[i]()&&e.requestRender()}function h2t(e){if(e.mode===se.MORPHING)return;let t=e.camera.positionCartographic;return e.getHeight(t)}function nWe(e,t,n){let i=Number.NEGATIVE_INFINITY;if(e instanceof Qc){let o=e.length;for(let r=0;r<o;++r){let s=e.get(r),a=nWe(s,t,n);l(a)&&a>i&&(i=a)}}else if(e.isCesium3DTileset&&e.show&&e.enableCollision){let o=e.getHeight(t,n);if(l(o)&&o>i)return o}return i}_i.prototype.getHeight=function(e,t){if(!l(e))return;let n=this._frameState.frameNumber;this._heightQueryFrame!==n&&(this._heightQueryFrame=n,this._heightQueryCache.clear());let i=`${t}:${e.longitude.toFixed(8)}:${e.latitude.toFixed(8)}`,o=this._heightQueryCache.get(i);if(o!==void 0)return o===null?void 0:o;let r=f2t(this,e,t);return this._heightQueryCache.set(i,r===void 0?null:r),r};function f2t(e,t,n){let i=n===He.CLAMP_TO_TERRAIN||n===He.RELATIVE_TO_TERRAIN,o=n===He.CLAMP_TO_3D_TILE||n===He.RELATIVE_TO_3D_TILE;if(!l(t))return;let r=Number.NEGATIVE_INFINITY;if(!i){let a=nWe(e.primitives,t,e);l(a)&&a>r&&(r=a)}let s=e._globe;if(!o&&l(s)&&s.show){let a=s.getHeight(t);a>r&&(r=a)}if(r>Number.NEGATIVE_INFINITY)return r}var Kne=new pe;_i.prototype.updateHeight=function(e,t,n){let i=this._ellipsoid,o=b=>{pe.clone(e,Kne);let f;l(b)&&(f=b.height),l(f)||(f=this.getHeight(e,n)),l(f)&&(Kne.height=f,t(Kne))},r=n===He.CLAMP_TO_TERRAIN||n===He.RELATIVE_TO_TERRAIN,s=n===He.CLAMP_TO_3D_TILE||n===He.RELATIVE_TO_3D_TILE,a;!s&&l(this.globe)&&(a=this.globe._surface.updateHeight(e,o));let c={},d=b=>{if(r||b.isDestroyed()||!b.isCesium3DTileset)return;let f=b.updateHeight(e,o,i);c[b.id]=f};if(!r){let b=this.primitives.length;for(let f=0;f<b;++f){let y=this.primitives.get(f);d(y)}}let u=this.primitives.primitiveAdded.addEventListener(d),m=this.primitives.primitiveRemoved.addEventListener(b=>{b.isDestroyed()||!b.isCesium3DTileset||(l(c[b.id])&&c[b.id](),delete c[b.id])});return()=>{a=a&&a(),Object.values(c).forEach(b=>b()),c={},u(),m()}};function p2t(e){let t=e.camera,n=e._mode,i=e._screenSpaceCameraController,o=t.positionCartographic;if(!l(o))return!1;if(!i.onMap()&&o.height<0)return!0;if(n===se.SCENE2D||n===se.MORPHING)return!1;let r=e._globeHeight;return l(r)&&o.height<r}_i.prototype.initializeFrame=function(){if(this._shaderFrameCount++===120&&(this._shaderFrameCount=0,this._context.shaderCache.destroyReleasedShaderPrograms(),this._context.textureCache.destroyReleasedTextures()),this._tweens.update(),this._globeHeightDirty){l(this._removeUpdateHeightCallback)&&(this._removeUpdateHeightCallback(),this._removeUpdateHeightCallback=void 0),this._globeHeight=h2t(this),this._globeHeightDirty=!1;let e=this.camera.positionCartographic;this._removeUpdateHeightCallback=this.updateHeight(e,t=>{this.isDestroyed()||(this._globeHeight=t.height)})}this._cameraUnderground=p2t(this),this._globeTranslucencyState.update(this),this._screenSpaceCameraController.update(),l(this._deviceOrientationCameraController)&&this._deviceOrientationCameraController.update(),this.camera.update(this._mode),this.camera._updateCameraChanged()};function b2t(e,t){if(e.debugShowFramesPerSecond){if(!l(e._performanceDisplay)){let n=document.createElement("div");n.className="cesium-performanceDisplay-defaultContainer",e._canvas.parentNode.appendChild(n);let o=new Ig({container:n});e._performanceDisplay=o,e._performanceContainer=n}e._performanceDisplay.throttled=e.requestRenderMode,e._performanceDisplay.update(t)}else l(e._performanceDisplay)&&(e._performanceDisplay=e._performanceDisplay&&e._performanceDisplay.destroy(),e._performanceContainer.parentNode.removeChild(e._performanceContainer))}function g2t(e){e._jobScheduler.resetBudgets();let t=e._frameState;e.primitives.prePassesUpdate(t),l(e.globe)&&e.globe.update(t),e._picking.update(),t.creditDisplay.update()}function y2t(e){e.primitives.postPassesUpdate(e._frameState),Hc.update()}var x2t=new U;function T2t(e){let t=e._frameState,n=e.context,{uniformState:i}=n,o=e._defaultView;e._view=o,e.updateFrameState(),t.passes.render=!0,t.passes.postProcess=e.postProcessStages.hasSelected,t.tilesetPassState=Vvt;let r=e.backgroundColor??U.BLACK;e._hdr&&(r=U.clone(r,x2t),r.red=Math.pow(r.red,e.gamma),r.green=Math.pow(r.green,e.gamma),r.blue=Math.pow(r.blue,e.gamma)),t.backgroundColor=r,t.atmosphere=e.atmosphere,e.fog.update(t),i.update(t);let s=e.shadowMap;l(s)&&s.enabled&&(!l(e.light)||e.light instanceof cb?h.negate(i.sunDirectionWC,e._shadowMapCamera.direction):h.clone(e.light.direction,e._shadowMapCamera.direction),t.shadowMaps.push(s)),e._computeCommandList.length=0,e._overlayCommandList.length=0;let a=o.viewport;a.x=0,a.y=0,a.width=n.drawingBufferWidth,a.height=n.drawingBufferHeight;let c=o.passState;c.framebuffer=void 0,c.blendingEnabled=void 0,c.scissorTest=void 0,c.viewport=nt.clone(a,c.viewport),n.beginFrame(),l(e.globe)&&e.globe.beginFrame(t),e.updateEnvironment(),e.updateAndExecuteCommands(c,r),e.resolveFramebuffers(c),c.framebuffer=void 0,Jvt(e,c),l(e.globe)&&(e.globe.endFrame(t),e.globe.tilesLoaded||(e._renderRequested=!0)),n.endFrame()}function KZ(e,t){try{t(e)}catch(n){if(e._renderError.raiseEvent(e,n),e.rethrowRenderErrors)throw n}}function _2t(e){return e._picking.updateMostDetailedRayPicks(e)}_i.prototype.render=function(e){this._preUpdate.raiseEvent(this,e);let t=this._frameState;t.newFrame=!1,l(e)||(e=Q.now()),this._controllerHost.update(this,e);let n=this._view.checkForCameraUpdates(this);n&&(this._globeHeightDirty=!0);let i=!this.requestRenderMode||this._renderRequested||n||this._logDepthBufferDirty||this._hdrDirty||this.mode===se.MORPHING;if(!i&&l(this.maximumRenderTimeChange)&&l(this._lastRenderTime)){let o=Math.abs(Q.secondsDifference(this._lastRenderTime,e));i=i||o>this.maximumRenderTimeChange}if(i){this._lastRenderTime=Q.clone(e,this._lastRenderTime),this._renderRequested=!1,this._logDepthBufferDirty=!1,this._hdrDirty=!1;let o=W.incrementWrap(t.frameNumber,Ox.maximumFrameNumber,1);jLe(this,o,e),t.newFrame=!0}KZ(this,g2t),this.primitives.show&&(KZ(this,_2t),KZ(this,S2t),KZ(this,Z2t),i||KZ(this,R2t)),this._postUpdate.raiseEvent(this,e),i&&(this._preRender.raiseEvent(this,e),t.creditDisplay.beginFrame(),KZ(this,T2t)),b2t(this,i),KZ(this,y2t),m2t(this),i&&(this._postRender.raiseEvent(this,e),t.creditDisplay.endFrame())};_i.prototype.forceRender=function(e){this._renderRequested=!0,this.render(e)};_i.prototype.requestRender=function(){this._renderRequested=!0};_i.prototype.clampLineWidth=function(e){return Math.max(wt.minimumAliasedLineWidth,Math.min(e,wt.maximumAliasedLineWidth))};_i.prototype.pick=function(e,t,n){return this._picking.pick(this,e,t,n,1)[0]};_i.prototype.snap=function(e,t){return a9.snap(this,e,t)};_i.prototype.pickAsync=async function(e,t,n){return(await this._picking.pickAsync(this,e,t,n,1))[0]};_i.prototype.pickVoxel=function(e,t,n){let i=this.pick(e,t,n);if(!l(i))return;let o=i.primitive;if(!(o instanceof uT))return;let r=this._picking.pickVoxelCoordinate(this,e,t,n),s=255*r[0]+r[1],a=o._traversal.findKeyframeNode(s);if(!l(a))return;let c=255*r[2]+r[3];return h9.fromKeyframeNode(o,s,c,a)};_i.prototype.pickMetadata=function(e,t,n,i){let o=this.pick(e);if(!l(o))return;let r=o.detail?.model?.structuralMetadata;if(!l(r))return;let s=r.schema,a=B9(s,t,n,i);if(!l(a))return;let c=H9(r,n,i);if(!l(c))return;let d=new z9(t,n,i,a,c);return this._picking.pickMetadata(this,e,d)};_i.prototype.pickMetadataSchema=function(e){let t=this.pick(e);return l(t)?t.detail?.model?.structuralMetadata?.schema:void 0};_i.prototype.pickPositionWorldCoordinates=function(e,t){return this._picking.pickPositionWorldCoordinates(this,e,t)};_i.prototype.pickPosition=function(e,t){return this._picking.pickPosition(this,e,t)};_i.prototype.drillPick=function(e,t,n,i){return this._picking.drillPick(this,e,t,n,i)};function S2t(e){let t=e._frameState;Bne.camera=t.camera,Bne.cullingVolume=t.cullingVolume,e.primitives.updateForPass(t,Bne)}function Z2t(e){let t=e._frameState;if(!t.camera.canPreloadFlight())return;zne.camera=e.preloadFlightCamera,zne.cullingVolume=e.preloadFlightCullingVolume,e.primitives.updateForPass(t,zne)}function R2t(e){e.primitives.updateForPass(e._frameState,Evt)}_i.prototype.pickFromRay=function(e,t,n){return this._picking.pickFromRay(this,e,t,n)};_i.prototype.drillPickFromRay=function(e,t,n,i){return this._picking.drillPickFromRay(this,e,t,n,i)};_i.prototype.pickFromRayMostDetailed=function(e,t,n){return this._picking.pickFromRayMostDetailed(this,e,t,n)};_i.prototype.drillPickFromRayMostDetailed=function(e,t,n,i){return this._picking.drillPickFromRayMostDetailed(this,e,t,n,i)};_i.prototype.sampleHeight=function(e,t,n){return this._picking.sampleHeight(this,e,t,n)};_i.prototype.clampToHeight=function(e,t,n,i){return this._picking.clampToHeight(this,e,t,n,i)};_i.prototype.sampleHeightMostDetailed=function(e,t,n){return this._picking.sampleHeightMostDetailed(this,e,t,n)};_i.prototype.clampToHeightMostDetailed=function(e,t,n){return this._picking.clampToHeightMostDetailed(this,e,t,n)};_i.prototype.cartesianToCanvasCoordinates=function(e,t){return fo.worldToWindowCoordinates(this,e,t)};_i.prototype.completeMorph=function(){this._transitioner.completeMorph()};_i.prototype.morphTo2D=function(e){e=e??2,this._transitioner.morphTo2D(e,this._ellipsoid)};_i.prototype.morphToColumbusView=function(e){e=e??2,this._transitioner.morphToColumbusView(e,this._ellipsoid)};_i.prototype.morphTo3D=function(e){e=e??2,this._transitioner.morphTo3D(e,this._ellipsoid)};function C2t(e,t){if(e._removeTerrainProviderReadyListener=e._removeTerrainProviderReadyListener&&e._removeTerrainProviderReadyListener(),t.ready){l(e.globe)&&(e.globe.terrainProvider=t.provider);return}e.globe.terrainProvider=void 0,e._removeTerrainProviderReadyListener=t.readyEvent.addEventListener(n=>{l(e)&&l(e.globe)&&(e.globe.terrainProvider=n),e._removeTerrainProviderReadyListener()})}_i.prototype.setTerrain=function(e){return C2t(this,e),e};_i.prototype.isDestroyed=function(){return!1};_i.prototype.destroy=function(){this._tweens.removeAll(),this._computeEngine=this._computeEngine&&this._computeEngine.destroy(),this._screenSpaceCameraController=this._screenSpaceCameraController&&this._screenSpaceCameraController.destroy(),this._deviceOrientationCameraController=this._deviceOrientationCameraController&&!this._deviceOrientationCameraController.isDestroyed()&&this._deviceOrientationCameraController.destroy(),this._primitives=this._primitives&&this._primitives.destroy(),this._groundPrimitives=this._groundPrimitives&&this._groundPrimitives.destroy(),this._globe=this._globe&&this._globe.destroy(),this._removeTerrainProviderReadyListener=this._removeTerrainProviderReadyListener&&this._removeTerrainProviderReadyListener(),this.skyBox=this.skyBox&&this.skyBox.destroy(),this.skyAtmosphere=this.skyAtmosphere&&this.skyAtmosphere.destroy(),this._debugSphere=this._debugSphere&&this._debugSphere.destroy(),this.sun=this.sun&&this.sun.destroy(),this._sunPostProcess=this._sunPostProcess&&this._sunPostProcess.destroy(),this._depthPlane=this._depthPlane&&this._depthPlane.destroy(),this._transitioner=this._transitioner&&this._transitioner.destroy(),this._debugFrustumPlanes=this._debugFrustumPlanes&&this._debugFrustumPlanes.destroy(),this._brdfLutGenerator=this._brdfLutGenerator&&this._brdfLutGenerator.destroy(),this._picking=this._picking&&this._picking.destroy(),this._defaultView=this._defaultView&&this._defaultView.destroy(),this._view=void 0,this._removeCreditContainer&&this._canvas.parentNode.removeChild(this._creditContainer),this.postProcessStages=this.postProcessStages&&this.postProcessStages.destroy(),this._context=this._context&&this._context.destroy(),this._frameState.creditDisplay=this._frameState.creditDisplay&&this._frameState.creditDisplay.destroy(),l(this._performanceDisplay)&&(this._performanceDisplay=this._performanceDisplay&&this._performanceDisplay.destroy(),this._performanceContainer.parentNode.removeChild(this._performanceContainer)),this._removeRequestListenerCallback(),this._removeTaskProcessorListenerCallback();for(let e=0;e<this._removeGlobeCallbacks.length;++e)this._removeGlobeCallbacks[e]();return this._removeGlobeCallbacks.length=0,l(this._removeUpdateHeightCallback)&&(this._removeUpdateHeightCallback(),this._removeUpdateHeightCallback=void 0),ue(this)};var K9=_i;var Hho=x(T(),1);function fE(e){e=e??ne.WGS84,this.show=!0,this.perFragmentAtmosphere=!1,this._ellipsoid=e;let t=1.025,n=h.multiplyByScalar(e.radii,t,new h);this._scaleMatrix=P.fromScale(n),this._modelMatrix=new P,this._command=new lt({owner:this,modelMatrix:this._modelMatrix}),this._spSkyFromSpace=void 0,this._spSkyFromAtmosphere=void 0,this._flags=void 0,this.atmosphereLightIntensity=50,this.atmosphereRayleighCoefficient=new h(55e-7,13e-6,284e-7),this.atmosphereMieCoefficient=new h(21e-6,21e-6,21e-6),this.atmosphereRayleighScaleHeight=1e4,this.atmosphereMieScaleHeight=3200,this.atmosphereMieAnisotropy=.9,this.hueShift=0,this.saturationShift=0,this.brightnessShift=0,this._hueSaturationBrightness=new h;let i=new h;i.x=e.maximumRadius*t,i.y=e.maximumRadius,i.z=0,this._radiiAndDynamicAtmosphereColor=i;let o=this;this._command.uniformMap={u_radiiAndDynamicAtmosphereColor:function(){return o._radiiAndDynamicAtmosphereColor},u_hsbShift:function(){return o._hueSaturationBrightness.x=o.hueShift,o._hueSaturationBrightness.y=o.saturationShift,o._hueSaturationBrightness.z=o.brightnessShift,o._hueSaturationBrightness},u_atmosphereLightIntensity:function(){return o.atmosphereLightIntensity},u_atmosphereRayleighCoefficient:function(){return o.atmosphereRayleighCoefficient},u_atmosphereMieCoefficient:function(){return o.atmosphereMieCoefficient},u_atmosphereRayleighScaleHeight:function(){return o.atmosphereRayleighScaleHeight},u_atmosphereMieScaleHeight:function(){return o.atmosphereMieScaleHeight},u_atmosphereMieAnisotropy:function(){return o.atmosphereMieAnisotropy}}}Object.defineProperties(fE.prototype,{ellipsoid:{get:function(){return this._ellipsoid}}});fE.prototype.setDynamicLighting=function(e){this._radiiAndDynamicAtmosphereColor.z=e};var jne=new P;fE.prototype.update=function(e,t){if(!this.show)return;let n=e.mode;if(n!==se.SCENE3D&&n!==se.MORPHING||!e.passes.render)return;let i=P.fromRotationTranslation(e.context.uniformState.inverseViewRotation,h.ZERO,jne),o=P.multiplyTransformation(i,Bi.Y_UP_TO_Z_UP,jne),r=P.multiply(this._scaleMatrix,o,jne);P.clone(r,this._modelMatrix);let s=e.context,a=V2t(this),c=e.globeTranslucencyState.translucent,d=this.perFragmentAtmosphere||c||!l(t)||!t.show,u=this._command;if(!l(u.vertexArray)){let p=Ma.createGeometry(new Ma({radii:new h(1,1,1),slicePartitions:256,stackPartitions:256,vertexFormat:Me.POSITION_ONLY}));u.vertexArray=Un.fromGeometry({context:s,geometry:p,attributeLocations:Bn.createAttributeLocations(p),bufferUsage:Pe.STATIC_DRAW}),u.renderState=ze.fromCache({cull:{enabled:!0,face:Ui.FRONT},blending:on.ALPHA_BLEND,depthMask:!1})}let m=a|d<<2|c<<3;if(m!==this._flags){this._flags=m;let p=[];a&&p.push("COLOR_CORRECT"),d&&p.push("PER_FRAGMENT_ATMOSPHERE"),c&&p.push("GLOBE_TRANSLUCENT");let b=new Je({defines:p,sources:[Uh,Z1,a2]}),f=new Je({defines:p,sources:[Uh,Z1,s2]});this._spSkyAtmosphere=tn.fromCache({context:s,vertexShaderSource:b,fragmentShaderSource:f}),u.shaderProgram=this._spSkyAtmosphere}return u};function V2t(e){return!(W.equalsEpsilon(e.hueShift,0,W.EPSILON7)&&W.equalsEpsilon(e.saturationShift,0,W.EPSILON7)&&W.equalsEpsilon(e.brightnessShift,0,W.EPSILON7))}fE.prototype.isDestroyed=function(){return!1};fE.prototype.destroy=function(){let e=this._command;return e.vertexArray=e.vertexArray&&e.vertexArray.destroy(),this._spSkyAtmosphere=this._spSkyAtmosphere&&this._spSkyAtmosphere.destroy(),ue(this)};var J9=fE;var Zfo=x(T(),1);var gfo=x(T(),1);function j9(e){this.sources=e.sources,this._sources=void 0,this._transform=e.transform,this.show=e.show??!0,this._returnCommand=e.returnCommand??!1,this._addToPanoramaCommandList=!this._returnCommand,this._command=new lt({modelMatrix:P.clone(P.IDENTITY),owner:this,pass:Le.ENVIRONMENT}),this._cubeMap=void 0,this._attributeLocations=void 0,this._useHdr=void 0,this._hasError=!1,this._error=void 0;let t=e.credit;typeof t=="string"&&(t=new Lt(t)),this._credit=t}Object.defineProperties(j9.prototype,{transform:{get:function(){return this._transform}},credit:{get:function(){return l(this._credit)?this._credit:void 0}}});j9.prototype.update=function(e,t){let n=this,{mode:i,passes:o,context:r,panoramaCommandList:s}=e;if(!this.show||i!==se.SCENE3D&&i!==se.MORPHING||!o.render)return;if(this._hasError){let c=this._error;throw this._hasError=!1,this._error=void 0,c}if(this._sources!==this.sources){this._sources=this.sources;let c=this.sources;typeof c.positiveX=="string"?gv(r,this._sources).then(function(d){n._cubeMap=n._cubeMap&&n._cubeMap.destroy(),n._cubeMap=d}).catch(d=>{this._hasError=!0,this._error=d}):(this._cubeMap=this._cubeMap&&this._cubeMap.destroy(),this._cubeMap=new es({context:r,source:c})),this._addToPanoramaCommandList=!0}let a=this._command;if(!l(a.vertexArray)){a.uniformMap={u_cubeMap:function(){return n._cubeMap},u_cubeMapPanoramaTransform:function(){return n._transform}};let c=Vc.createGeometry(Vc.fromDimensions({dimensions:new h(2,2,2),vertexFormat:Me.POSITION_ONLY})),d=this._attributeLocations=Bn.createAttributeLocations(c);a.vertexArray=Un.fromGeometry({context:r,geometry:c,attributeLocations:d,bufferUsage:Pe.STATIC_DRAW}),a.renderState=ze.fromCache({depthTest:{enabled:!1},depthMask:!1,blending:on.ALPHA_BLEND}),this._addToPanoramaCommandList=!0}if(!l(a.shaderProgram)||this._useHdr!==t){let c=new Je({defines:[t?"HDR":""],sources:[c2]});a.shaderProgram=tn.fromCache({context:r,vertexShaderSource:l(this._transform)?Dv:l2,fragmentShaderSource:c,attributeLocations:this._attributeLocations}),this._useHdr=t,this._addToPanoramaCommandList=!0}if(l(this._cubeMap)){if(this.show&&l(this._credit)&&!this._returnCommand&&e.creditDisplay.addCreditToNextFrame(this._credit),this._returnCommand)return a;this._addToPanoramaCommandList&&(s.push(a),this._addToPanoramaCommandList=!1)}};j9.prototype.isDestroyed=function(){return!1};j9.prototype.destroy=function(){let e=this._command;return e.vertexArray=e.vertexArray&&e.vertexArray.destroy(),e.shaderProgram=e.shaderProgram&&e.shaderProgram.destroy(),this._cubeMap=this._cubeMap&&this._cubeMap.destroy(),ue(this)};var JZ=j9;function jZ(e){this._sources=e.sources,this._show=e.show??!0,this._panorama=new JZ({sources:this._sources,show:this._show,returnCommand:!0})}Object.defineProperties(jZ.prototype,{sources:{get:function(){return this._panorama.sources},set:function(e){this._panorama.sources=e}},show:{get:function(){return this._panorama.show},set:function(e){this._panorama.show=e}}});jZ.prototype.update=function(e,t){let{mode:n,passes:i}=e;if(!(n!==se.SCENE3D&&n!==se.MORPHING)&&i.render)return this._panorama.update(e,t)};jZ.prototype.isDestroyed=function(){return!1};jZ.prototype.destroy=function(){return this._panorama=this._panorama&&this._panorama.destroy(),ue(this)};function pE(e){return en(`Assets/Textures/SkyBox/tycho2t3_80_${e}.jpg`)}jZ.createEarthSkyBox=function(){return new jZ({sources:{positiveX:pE("px"),negativeX:pE("mx"),positiveY:pE("py"),negativeY:pE("my"),positiveZ:pE("pz"),negativeZ:pE("mz")}})};var Q9=jZ;var qfo=x(T(),1);function $9(){this.show=!0,this._drawCommand=new lt({primitiveType:Ie.TRIANGLES,boundingVolume:new me,owner:this}),this._commands={drawCommand:this._drawCommand,computeCommand:void 0},this._boundingVolume=new me,this._boundingVolume2D=new me,this._texture=void 0,this._drawingBufferWidth=void 0,this._drawingBufferHeight=void 0,this._radiusTS=void 0,this._size=void 0,this.glowFactor=1,this._glowFactorDirty=!1,this._useHdr=void 0;let e=this;this._uniformMap={u_texture:function(){return e._texture},u_size:function(){return e._size}}}Object.defineProperties($9.prototype,{glowFactor:{get:function(){return this._glowFactor},set:function(e){e=Math.max(e,0),this._glowFactor=e,this._glowFactorDirty=!0}}});var E2t=new k,A2t=new k,G2t=new ce,q9=new ce;$9.prototype.update=function(e,t,n){if(!this.show)return;let i=e.mode;if(i===se.SCENE2D||i===se.MORPHING||!e.passes.render)return;let o=e.context,r=t.viewport.width,s=t.viewport.height;if(!l(this._texture)||r!==this._drawingBufferWidth||s!==this._drawingBufferHeight||this._glowFactorDirty||n!==this._useHdr){this._texture=this._texture&&this._texture.destroy(),this._drawingBufferWidth=r,this._drawingBufferHeight=s,this._glowFactorDirty=!1,this._useHdr=n;let C=Math.max(r,s);C=Math.pow(2,Math.ceil(Math.log(C)/Math.log(2))-2),C=Math.max(1,C);let E=n?o.halfFloatingPointTexture?Ue.HALF_FLOAT:Ue.FLOAT:Ue.UNSIGNED_BYTE;this._texture=new vt({context:o,width:C,height:C,pixelFormat:Qe.RGBA,pixelDatatype:E}),this._glowLengthTS=this._glowFactor*5,this._radiusTS=1/(1+2*this._glowLengthTS)*.5;let A=this,L={u_radiusTS:function(){return A._radiusTS}};this._commands.computeCommand=new bu({fragmentShaderSource:u2,outputTexture:this._texture,uniformMap:L,persists:!1,owner:this,postExecute:function(){A._commands.computeCommand=void 0}})}let a=this._drawCommand;if(!l(a.vertexArray)){let C={direction:0},E=new Uint8Array(8);E[0]=0,E[1]=0,E[2]=255,E[3]=0,E[4]=255,E[5]=255,E[6]=0,E[7]=255;let A=it.createVertexBuffer({context:o,typedArray:E,usage:Pe.STATIC_DRAW}),L=[{index:C.direction,vertexBuffer:A,componentsPerAttribute:2,normalize:!0,componentDatatype:J.UNSIGNED_BYTE}],F=it.createIndexBuffer({context:o,typedArray:new Uint16Array([0,1,2,0,2,3]),usage:Pe.STATIC_DRAW,indexDatatype:Oe.UNSIGNED_SHORT});a.vertexArray=new Un({context:o,attributes:L,indexBuffer:F}),a.shaderProgram=tn.fromCache({context:o,vertexShaderSource:m2,fragmentShaderSource:d2,attributeLocations:C}),a.renderState=ze.fromCache({blending:on.ALPHA_BLEND}),a.uniformMap=this._uniformMap}let c=o.uniformState.sunPositionWC,d=o.uniformState.sunPositionColumbusView,u=this._boundingVolume,m=this._boundingVolume2D;h.clone(c,u.center),m.center.x=d.z,m.center.y=d.x,m.center.z=d.y,u.radius=W.SOLAR_RADIUS+W.SOLAR_RADIUS*this._glowLengthTS,m.radius=u.radius,i===se.SCENE3D?me.clone(u,a.boundingVolume):i===se.COLUMBUS_VIEW&&me.clone(m,a.boundingVolume);let p=fo.computeActualEllipsoidPosition(e,c,q9),b=h.magnitude(h.subtract(p,e.camera.position,q9)),f=o.uniformState.projection,y=G2t;y.x=0,y.y=0,y.z=-b,y.w=1;let _=P.multiplyByVector(f,y,q9),S=fo.clipToGLWindowCoordinates(t.viewport,_,E2t);y.x=W.SOLAR_RADIUS;let Z=P.multiplyByVector(f,y,q9),R=fo.clipToGLWindowCoordinates(t.viewport,Z,A2t);return this._size=k.magnitude(k.subtract(R,S,q9)),this._size=2*this._size*(1+2*this._glowLengthTS),this._size=Math.ceil(this._size),this._commands};$9.prototype.isDestroyed=function(){return!1};$9.prototype.destroy=function(){let e=this._drawCommand;return e.vertexArray=e.vertexArray&&e.vertexArray.destroy(),e.shaderProgram=e.shaderProgram&&e.shaderProgram.destroy(),this._texture=this._texture&&this._texture.destroy(),ue(this)};var ek=$9;var i0o=x(T(),1);var Mpo=x(T(),1);var rWe=x(eD(),1);var epo=x(T(),1);function L2t(e,t,n){return` float clipDistance = clip(gl_FragCoord, ${e}, ${t}); vec4 clippingPlanesEdgeColor = vec4(1.0); clippingPlanesEdgeColor.rgb = ${n}.rgb; float clippingPlanesEdgeWidth = ${n}.a; @@ -12560,7 +12560,7 @@ return properties; { out_FragColor = clippingPlanesEdgeColor; } -`}var uU=dwt;var jEo=x(T(),1);var uwt={modifyFragmentShader:function(t){return t=Je.replaceMain(t,"czm_splitter_main"),t+=`uniform float czm_splitDirection; +`}var tk=L2t;var ipo=x(T(),1);var W2t={modifyFragmentShader:function(t){return t=Je.replaceMain(t,"czm_splitter_main"),t+=`uniform float czm_splitDirection; void main() { #ifndef SHADOW_MAP @@ -12569,9 +12569,9 @@ void main() #endif czm_splitter_main(); } -`,t},addUniforms:function(t,n){n.czm_splitDirection=function(){return t.splitDirection}}},bA=uwt;var RR={NEEDS_DECODE:0,DECODING:1,READY:2,FAILED:3};function mU(e){this._parsedContent=void 0,this._drawCommand=void 0,this._isTranslucent=!1,this._styleTranslucent=!1,this._constantColor=U.clone(U.DARKGRAY),this._highlightColor=U.clone(U.WHITE),this._pointSize=1,this._rtcCenter=void 0,this._quantizedVolumeScale=void 0,this._quantizedVolumeOffset=void 0,this._styleableShaderAttributes=void 0,this._isQuantized=!1,this._isOctEncoded16P=!1,this._isRGB565=!1,this._hasColors=!1,this._hasNormals=!1,this._hasBatchIds=!1,this._decodingState=RR.READY,this._dequantizeInShader=!0,this._isQuantizedDraco=!1,this._isOctEncodedDraco=!1,this._quantizedRange=0,this._octEncodedRange=0,this.backFaceCulling=!1,this._backFaceCulling=!1,this.normalShading=!0,this._normalShading=!0,this._opaqueRenderState=void 0,this._translucentRenderState=void 0,this._mode=void 0,this._ready=!1,this._pointsLength=0,this._geometryByteLength=0,this._vertexShaderLoaded=e.vertexShaderLoaded,this._fragmentShaderLoaded=e.fragmentShaderLoaded,this._uniformMapLoaded=e.uniformMapLoaded,this._batchTableLoaded=e.batchTableLoaded,this._pickIdLoaded=e.pickIdLoaded,this._opaquePass=e.opaquePass??Le.OPAQUE,this._cull=e.cull??!0,this.style=void 0,this._style=void 0,this.styleDirty=!1,this.modelMatrix=P.clone(P.IDENTITY),this._modelMatrix=P.clone(P.IDENTITY),this.time=0,this.shadows=vn.ENABLED,this._boundingSphere=void 0,this.clippingPlanes=void 0,this.isClipped=!1,this.clippingPlanesDirty=!1,this.clippingPlanesOriginMatrix=void 0,this.attenuation=!1,this._attenuation=!1,this.geometricError=0,this.geometricErrorScale=1,this.maximumAttenuation=this._pointSize,this.splitDirection=e.splitDirection??kr.NONE,this._splittingEnabled=!1,this._error=void 0,mwt(this,e)}Object.defineProperties(mU.prototype,{pointsLength:{get:function(){return this._pointsLength}},geometryByteLength:{get:function(){return this._geometryByteLength}},ready:{get:function(){return this._ready}},color:{get:function(){return U.clone(this._highlightColor)},set:function(e){this._highlightColor=U.clone(e,this._highlightColor)}},boundingSphere:{get:function(){if(l(this._drawCommand))return this._drawCommand.boundingVolume},set:function(e){this._boundingSphere=me.clone(e,this._boundingSphere)}}});function mwt(e,t){let n=ZS.parse(t.arrayBuffer,t.byteOffset);if(e._parsedContent=n,e._rtcCenter=n.rtcCenter,e._hasNormals=n.hasNormals,e._hasColors=n.hasColors,e._hasBatchIds=n.hasBatchIds,e._isTranslucent=n.isTranslucent,!n.hasBatchIds&&l(n.batchTableBinary)&&(n.styleableProperties=tf.getBinaryProperties(n.pointsLength,n.batchTableJson,n.batchTableBinary)),l(n.draco)){let a=n.draco;e._decodingState=RR.NEEDS_DECODE,a.dequantizeInShader=e._dequantizeInShader}let i=n.positions;l(i)&&(e._isQuantized=i.isQuantized,e._quantizedVolumeScale=i.quantizedVolumeScale,e._quantizedVolumeOffset=i.quantizedVolumeOffset,e._quantizedRange=i.quantizedRange);let o=n.normals;l(o)&&(e._isOctEncoded16P=o.octEncoded);let r=n.colors;l(r)&&(l(r.constantColor)&&(e._constantColor=U.clone(r.constantColor,e._constantColor),e._hasColors=!1),e._isRGB565=r.isRGB565);let s=n.batchIds;l(n.batchIds)&&(s.name="BATCH_ID",s.semantic="BATCH_ID",s.setIndex=void 0),n.hasBatchIds&&e._batchTableLoaded(n.batchLength,n.batchTableJson,n.batchTableBinary),e._pointsLength=n.pointsLength}var hwt=new h,fwt=new h,pwt=new h,jPe,jK;function bwt(e){if(!l(jK)){jPe=new qPe.default(0),jK=new Array(e);for(let t=0;t<e;++t)jK[t]=jPe.random()}return jK}function gwt(e){let n=e.length/3,i=Math.min(n,20),o=bwt(20),r=Number.MAX_VALUE,s=-Number.MAX_VALUE,a=h.fromElements(r,r,r,hwt),c=h.fromElements(s,s,s,fwt);for(let u=0;u<i;++u){let m=Math.floor(o[u]*n),p=h.unpack(e,m*3,pwt);h.minimumByComponent(a,p,a),h.maximumByComponent(c,p,c)}let d=me.fromCornerPoints(a,c);return d.radius+=W.EPSILON2,d}function QPe(e,t){let n=J.fromTypedArray(e);return n===J.INT||n===J.UNSIGNED_INT||n===J.DOUBLE?(xt("Cast pnts property to floats",`Point cloud property "${t}" will be cast to a float array because INT, UNSIGNED_INT, and DOUBLE are not valid WebGL vertex attribute types. Some precision may be lost.`),new Float32Array(e)):e}var ywt=new ce,xwt=new ce,Twt=new U,$Pe=0,QK=1,xse=2,eXe=3,_wt=4,pse=new P,Swt=new P;function Zwt(e,t){let n=t.context,i=e._parsedContent,o=e._pointsLength,r=i.positions,s=i.colors,a=i.normals,c=i.batchIds,d=i.styleableProperties,u=l(d),m=e._isQuantized,p=e._isQuantizedDraco,b=e._isOctEncoded16P,f=e._isOctEncodedDraco,y=e._quantizedRange,_=e._octEncodedRange,S=e._isRGB565,Z=e._isTranslucent,R=e._hasColors,C=e._hasNormals,E=e._hasBatchIds,A,L,F=[],I={};if(e._styleableShaderAttributes=I,u){let M=_wt;for(let O in d)if(d.hasOwnProperty(O)){let w=d[O],z=QPe(w.typedArray,O);A=w.componentCount,L=J.fromTypedArray(z);let K=it.createVertexBuffer({context:n,typedArray:z,usage:Pe.STATIC_DRAW});e._geometryByteLength+=K.sizeInBytes;let te={index:M,vertexBuffer:K,componentsPerAttribute:A,componentDatatype:L,normalize:!1,offsetInBytes:0,strideInBytes:0};F.push(te),I[O]={location:M,componentCount:A},++M}}let N=it.createVertexBuffer({context:n,typedArray:r.typedArray,usage:Pe.STATIC_DRAW});e._geometryByteLength+=N.sizeInBytes;let g;R&&(g=it.createVertexBuffer({context:n,typedArray:s.typedArray,usage:Pe.STATIC_DRAW}),e._geometryByteLength+=g.sizeInBytes);let V;C&&(V=it.createVertexBuffer({context:n,typedArray:a.typedArray,usage:Pe.STATIC_DRAW}),e._geometryByteLength+=V.sizeInBytes);let G;E&&(c.typedArray=QPe(c.typedArray,"batchIds"),G=it.createVertexBuffer({context:n,typedArray:c.typedArray,usage:Pe.STATIC_DRAW}),e._geometryByteLength+=G.sizeInBytes);let v=[];if(m?L=J.UNSIGNED_SHORT:p?L=y<=255?J.UNSIGNED_BYTE:J.UNSIGNED_SHORT:L=J.FLOAT,v.push({index:$Pe,vertexBuffer:N,componentsPerAttribute:3,componentDatatype:L,normalize:!1,offsetInBytes:0,strideInBytes:0}),e._cull&&(m||p?e._boundingSphere=me.fromCornerPoints(h.ZERO,e._quantizedVolumeScale):e._boundingSphere=gwt(r.typedArray)),R)if(S)v.push({index:QK,vertexBuffer:g,componentsPerAttribute:1,componentDatatype:J.UNSIGNED_SHORT,normalize:!1,offsetInBytes:0,strideInBytes:0});else{let M=Z?4:3;v.push({index:QK,vertexBuffer:g,componentsPerAttribute:M,componentDatatype:J.UNSIGNED_BYTE,normalize:!0,offsetInBytes:0,strideInBytes:0})}C&&(b?(A=2,L=J.UNSIGNED_BYTE):f?(A=2,L=_<=255?J.UNSIGNED_BYTE:J.UNSIGNED_SHORT):(A=3,L=J.FLOAT),v.push({index:xse,vertexBuffer:V,componentsPerAttribute:A,componentDatatype:L,normalize:!1,offsetInBytes:0,strideInBytes:0})),E&&v.push({index:eXe,vertexBuffer:G,componentsPerAttribute:1,componentDatatype:J.fromTypedArray(c.typedArray),normalize:!1,offsetInBytes:0,strideInBytes:0}),u&&(v=v.concat(F));let X=new Un({context:n,attributes:v}),Y={depthTest:{enabled:!0}},D={depthTest:{enabled:!0},depthMask:!1,blending:on.ALPHA_BLEND};e._opaquePass===Le.CESIUM_3D_TILE&&(Y.stencilTest=Jt.setCesium3DTileBit(),Y.stencilMask=Jt.CESIUM_3D_TILE_MASK,D.stencilTest=Jt.setCesium3DTileBit(),D.stencilMask=Jt.CESIUM_3D_TILE_MASK),e._opaqueRenderState=ze.fromCache(Y),e._translucentRenderState=ze.fromCache(D),e._drawCommand=new lt({boundingVolume:new me,cull:e._cull,modelMatrix:new P,primitiveType:Ie.POINTS,vertexArray:X,count:o,shaderProgram:void 0,uniformMap:void 0,renderState:Z?e._translucentRenderState:e._opaqueRenderState,pass:Z?Le.TRANSLUCENT:e._opaquePass,owner:e,castShadows:!1,receiveShadows:!1,pickId:e._pickIdLoaded()})}function Rwt(e,t){let n=t.context,i=e._isQuantized,o=e._isQuantizedDraco,r=e._isOctEncodedDraco,s={u_pointSizeAndTimeAndGeometricErrorAndDepthMultiplier:function(){let a=ywt;if(a.x=e._attenuation?e.maximumAttenuation:e._pointSize,a.x*=t.pixelRatio,a.y=e.time,e._attenuation){let c=t.camera.frustum,d;t.mode===se.SCENE2D||c instanceof yn?d=Number.POSITIVE_INFINITY:d=n.drawingBufferHeight/t.camera.frustum.sseDenominator,a.z=e.geometricError*e.geometricErrorScale,a.w=d}return a},u_highlightColor:function(){return e._highlightColor},u_constantColor:function(){return e._constantColor},u_clippingPlanes:function(){let a=e.clippingPlanes;return e.isClipped?a.texture:n.defaultTexture},u_clippingPlanesEdgeStyle:function(){let a=e.clippingPlanes;if(!l(a))return U.TRANSPARENT;let c=U.clone(a.edgeColor,Twt);return c.alpha=a.edgeWidth,c},u_clippingPlanesMatrix:function(){let a=e.clippingPlanes;if(!l(a))return P.IDENTITY;let c=e.clippingPlanesOriginMatrix??e._modelMatrix;P.multiply(n.uniformState.view3D,c,pse);let d=P.multiply(pse,a.modelMatrix,pse);return P.inverseTranspose(d,Swt)}};bA.addUniforms(e,s),(i||o||r)&&(s=It(s,{u_quantizedVolumeScaleAndOctEncodedRange:function(){let a=xwt;if(l(e._quantizedVolumeScale)){let c=h.clone(e._quantizedVolumeScale,a);h.divideByScalar(c,e._quantizedRange,a)}return a.w=e._octEncodedRange,a}})),l(e._uniformMapLoaded)&&(s=e._uniformMapLoaded(s)),e._drawCommand.uniformMap=s}function bse(e,t){let n=/czm_3dtiles_property_(\d+)/g,i=n.exec(e);for(;i!==null;){let o=parseInt(i[1]);t.indexOf(o)===-1&&t.push(o),i=n.exec(e)}}function gse(e,t){e=e.slice(e.indexOf(` -`));let n=/czm_3dtiles_builtin_property_(\w+)/g,i=n.exec(e);for(;i!==null;){let o=i[1];t.indexOf(o)===-1&&t.push(o),i=n.exec(e)}}function yse(e,t){let n=e.numberOfAttributes;for(let i=0;i<n;++i){let o=e.getAttribute(i);if(o.index===t)return o}}var Cwt={POSITION:"czm_3dtiles_builtin_property_POSITION",POSITION_ABSOLUTE:"czm_3dtiles_builtin_property_POSITION_ABSOLUTE",COLOR:"czm_3dtiles_builtin_property_COLOR",NORMAL:"czm_3dtiles_builtin_property_NORMAL"};function Vwt(e,t,n){let i,o,r,s=t.context,a=l(n),c=e._isQuantized,d=e._isQuantizedDraco,u=e._isOctEncoded16P,m=e._isOctEncodedDraco,p=e._isRGB565,b=e._isTranslucent,f=e._hasColors,y=e._hasNormals,_=e._hasBatchIds,S=e._backFaceCulling,Z=e._normalShading,R=e._drawCommand.vertexArray,C=e.clippingPlanes,E=e._attenuation,A,L,F,I=b,N=$e(Cwt),g={},V=e._styleableShaderAttributes;for(o in V)V.hasOwnProperty(o)&&(r=V[o],N[o]=`czm_3dtiles_property_${r.location}`,g[r.location]=r);if(a){let he={translucent:!1},Ze="(vec3 czm_3dtiles_builtin_property_POSITION, vec3 czm_3dtiles_builtin_property_POSITION_ABSOLUTE, vec4 czm_3dtiles_builtin_property_COLOR, vec3 czm_3dtiles_builtin_property_NORMAL)";A=n.getColorShaderFunction(`getColorFromStyle${Ze}`,N,he),L=n.getShowShaderFunction(`getShowFromStyle${Ze}`,N,he),F=n.getPointSizeShaderFunction(`getPointSizeFromStyle${Ze}`,N,he),l(A)&&he.translucent&&(I=!0)}e._styleTranslucent=I;let G=l(A),v=l(L),X=l(F),Y=e.isClipped,D=[],M=[];G&&(bse(A,D),gse(A,M)),v&&(bse(L,D),gse(L,M)),X&&(bse(F,D),gse(F,M));let O=M.indexOf("COLOR")>=0,w=M.indexOf("NORMAL")>=0;if(w&&!y)throw new ae("Style references the NORMAL semantic but the point cloud does not have normals");for(o in V)if(V.hasOwnProperty(o)){r=V[o];let he=D.indexOf(r.location)>=0,Ze=yse(R,r.location);Ze.enabled=he}let z=f&&(!G||O);if(f){let he=yse(R,QK);he.enabled=z}let K=y&&(Z||S||w);if(y){let he=yse(R,xse);he.enabled=K}let te={a_position:$Pe};z&&(te.a_color=QK),K&&(te.a_normal=xse),_&&(te.a_batchId=eXe);let H="",$=D.length;for(i=0;i<$;++i){let he=D[i];r=g[he];let Ze=r.componentCount,ye=`czm_3dtiles_property_${he}`,Ge;Ze===1?Ge="float":Ge=`vec${Ze}`,H+=`in ${Ge} ${ye}; -`,te[ye]=r.location}Rwt(e,t);let ee=`in vec3 a_position; +`,t},addUniforms:function(t,n){n.czm_splitDirection=function(){return t.splitDirection}}},bE=W2t;var QZ={NEEDS_DECODE:0,DECODING:1,READY:2,FAILED:3};function nk(e){this._parsedContent=void 0,this._drawCommand=void 0,this._isTranslucent=!1,this._styleTranslucent=!1,this._constantColor=U.clone(U.DARKGRAY),this._highlightColor=U.clone(U.WHITE),this._pointSize=1,this._rtcCenter=void 0,this._quantizedVolumeScale=void 0,this._quantizedVolumeOffset=void 0,this._styleableShaderAttributes=void 0,this._isQuantized=!1,this._isOctEncoded16P=!1,this._isRGB565=!1,this._hasColors=!1,this._hasNormals=!1,this._hasBatchIds=!1,this._decodingState=QZ.READY,this._dequantizeInShader=!0,this._isQuantizedDraco=!1,this._isOctEncodedDraco=!1,this._quantizedRange=0,this._octEncodedRange=0,this.backFaceCulling=!1,this._backFaceCulling=!1,this.normalShading=!0,this._normalShading=!0,this._opaqueRenderState=void 0,this._translucentRenderState=void 0,this._mode=void 0,this._ready=!1,this._pointsLength=0,this._geometryByteLength=0,this._vertexShaderLoaded=e.vertexShaderLoaded,this._fragmentShaderLoaded=e.fragmentShaderLoaded,this._uniformMapLoaded=e.uniformMapLoaded,this._batchTableLoaded=e.batchTableLoaded,this._pickIdLoaded=e.pickIdLoaded,this._opaquePass=e.opaquePass??Le.OPAQUE,this._cull=e.cull??!0,this.style=void 0,this._style=void 0,this.styleDirty=!1,this.modelMatrix=P.clone(P.IDENTITY),this._modelMatrix=P.clone(P.IDENTITY),this.time=0,this.shadows=Wn.ENABLED,this._boundingSphere=void 0,this.clippingPlanes=void 0,this.isClipped=!1,this.clippingPlanesDirty=!1,this.clippingPlanesOriginMatrix=void 0,this.attenuation=!1,this._attenuation=!1,this.geometricError=0,this.geometricErrorScale=1,this.maximumAttenuation=this._pointSize,this.splitDirection=e.splitDirection??Ur.NONE,this._splittingEnabled=!1,this._error=void 0,v2t(this,e)}Object.defineProperties(nk.prototype,{pointsLength:{get:function(){return this._pointsLength}},geometryByteLength:{get:function(){return this._geometryByteLength}},ready:{get:function(){return this._ready}},color:{get:function(){return U.clone(this._highlightColor)},set:function(e){this._highlightColor=U.clone(e,this._highlightColor)}},boundingSphere:{get:function(){if(l(this._drawCommand))return this._drawCommand.boundingVolume},set:function(e){this._boundingSphere=me.clone(e,this._boundingSphere)}}});function v2t(e,t){let n=US.parse(t.arrayBuffer,t.byteOffset);if(e._parsedContent=n,e._rtcCenter=n.rtcCenter,e._hasNormals=n.hasNormals,e._hasColors=n.hasColors,e._hasBatchIds=n.hasBatchIds,e._isTranslucent=n.isTranslucent,!n.hasBatchIds&&l(n.batchTableBinary)&&(n.styleableProperties=_f.getBinaryProperties(n.pointsLength,n.batchTableJson,n.batchTableBinary)),l(n.draco)){let a=n.draco;e._decodingState=QZ.NEEDS_DECODE,a.dequantizeInShader=e._dequantizeInShader}let i=n.positions;l(i)&&(e._isQuantized=i.isQuantized,e._quantizedVolumeScale=i.quantizedVolumeScale,e._quantizedVolumeOffset=i.quantizedVolumeOffset,e._quantizedRange=i.quantizedRange);let o=n.normals;l(o)&&(e._isOctEncoded16P=o.octEncoded);let r=n.colors;l(r)&&(l(r.constantColor)&&(e._constantColor=U.clone(r.constantColor,e._constantColor),e._hasColors=!1),e._isRGB565=r.isRGB565);let s=n.batchIds;l(n.batchIds)&&(s.name="BATCH_ID",s.semantic="BATCH_ID",s.setIndex=void 0),n.hasBatchIds&&e._batchTableLoaded(n.batchLength,n.batchTableJson,n.batchTableBinary),e._pointsLength=n.pointsLength}var F2t=new h,I2t=new h,P2t=new h,iWe,Hz;function X2t(e){if(!l(Hz)){iWe=new rWe.default(0),Hz=new Array(e);for(let t=0;t<e;++t)Hz[t]=iWe.random()}return Hz}function N2t(e){let n=e.length/3,i=Math.min(n,20),o=X2t(20),r=Number.MAX_VALUE,s=-Number.MAX_VALUE,a=h.fromElements(r,r,r,F2t),c=h.fromElements(s,s,s,I2t);for(let u=0;u<i;++u){let m=Math.floor(o[u]*n),p=h.unpack(e,m*3,P2t);h.minimumByComponent(a,p,a),h.maximumByComponent(c,p,c)}let d=me.fromCornerPoints(a,c);return d.radius+=W.EPSILON2,d}function oWe(e,t){let n=J.fromTypedArray(e);return n===J.INT||n===J.UNSIGNED_INT||n===J.DOUBLE?(xt("Cast pnts property to floats",`Point cloud property "${t}" will be cast to a float array because INT, UNSIGNED_INT, and DOUBLE are not valid WebGL vertex attribute types. Some precision may be lost.`),new Float32Array(e)):e}var Y2t=new ce,M2t=new ce,w2t=new U,sWe=0,Kz=1,tie=2,aWe=3,k2t=4,Qne=new P,U2t=new P;function D2t(e,t){let n=t.context,i=e._parsedContent,o=e._pointsLength,r=i.positions,s=i.colors,a=i.normals,c=i.batchIds,d=i.styleableProperties,u=l(d),m=e._isQuantized,p=e._isQuantizedDraco,b=e._isOctEncoded16P,f=e._isOctEncodedDraco,y=e._quantizedRange,_=e._octEncodedRange,S=e._isRGB565,Z=e._isTranslucent,R=e._hasColors,C=e._hasNormals,E=e._hasBatchIds,A,L,F=[],I={};if(e._styleableShaderAttributes=I,u){let M=k2t;for(let O in d)if(d.hasOwnProperty(O)){let w=d[O],z=oWe(w.typedArray,O);A=w.componentCount,L=J.fromTypedArray(z);let K=it.createVertexBuffer({context:n,typedArray:z,usage:Pe.STATIC_DRAW});e._geometryByteLength+=K.sizeInBytes;let te={index:M,vertexBuffer:K,componentsPerAttribute:A,componentDatatype:L,normalize:!1,offsetInBytes:0,strideInBytes:0};F.push(te),I[O]={location:M,componentCount:A},++M}}let N=it.createVertexBuffer({context:n,typedArray:r.typedArray,usage:Pe.STATIC_DRAW});e._geometryByteLength+=N.sizeInBytes;let g;R&&(g=it.createVertexBuffer({context:n,typedArray:s.typedArray,usage:Pe.STATIC_DRAW}),e._geometryByteLength+=g.sizeInBytes);let V;C&&(V=it.createVertexBuffer({context:n,typedArray:a.typedArray,usage:Pe.STATIC_DRAW}),e._geometryByteLength+=V.sizeInBytes);let G;E&&(c.typedArray=oWe(c.typedArray,"batchIds"),G=it.createVertexBuffer({context:n,typedArray:c.typedArray,usage:Pe.STATIC_DRAW}),e._geometryByteLength+=G.sizeInBytes);let v=[];if(m?L=J.UNSIGNED_SHORT:p?L=y<=255?J.UNSIGNED_BYTE:J.UNSIGNED_SHORT:L=J.FLOAT,v.push({index:sWe,vertexBuffer:N,componentsPerAttribute:3,componentDatatype:L,normalize:!1,offsetInBytes:0,strideInBytes:0}),e._cull&&(m||p?e._boundingSphere=me.fromCornerPoints(h.ZERO,e._quantizedVolumeScale):e._boundingSphere=N2t(r.typedArray)),R)if(S)v.push({index:Kz,vertexBuffer:g,componentsPerAttribute:1,componentDatatype:J.UNSIGNED_SHORT,normalize:!1,offsetInBytes:0,strideInBytes:0});else{let M=Z?4:3;v.push({index:Kz,vertexBuffer:g,componentsPerAttribute:M,componentDatatype:J.UNSIGNED_BYTE,normalize:!0,offsetInBytes:0,strideInBytes:0})}C&&(b?(A=2,L=J.UNSIGNED_BYTE):f?(A=2,L=_<=255?J.UNSIGNED_BYTE:J.UNSIGNED_SHORT):(A=3,L=J.FLOAT),v.push({index:tie,vertexBuffer:V,componentsPerAttribute:A,componentDatatype:L,normalize:!1,offsetInBytes:0,strideInBytes:0})),E&&v.push({index:aWe,vertexBuffer:G,componentsPerAttribute:1,componentDatatype:J.fromTypedArray(c.typedArray),normalize:!1,offsetInBytes:0,strideInBytes:0}),u&&(v=v.concat(F));let X=new Un({context:n,attributes:v}),Y={depthTest:{enabled:!0}},D={depthTest:{enabled:!0},depthMask:!1,blending:on.ALPHA_BLEND};e._opaquePass===Le.CESIUM_3D_TILE&&(Y.stencilTest=Jt.setCesium3DTileBit(),Y.stencilMask=Jt.CESIUM_3D_TILE_MASK,D.stencilTest=Jt.setCesium3DTileBit(),D.stencilMask=Jt.CESIUM_3D_TILE_MASK),e._opaqueRenderState=ze.fromCache(Y),e._translucentRenderState=ze.fromCache(D),e._drawCommand=new lt({boundingVolume:new me,cull:e._cull,modelMatrix:new P,primitiveType:Ie.POINTS,vertexArray:X,count:o,shaderProgram:void 0,uniformMap:void 0,renderState:Z?e._translucentRenderState:e._opaqueRenderState,pass:Z?Le.TRANSLUCENT:e._opaquePass,owner:e,castShadows:!1,receiveShadows:!1,pickId:e._pickIdLoaded()})}function O2t(e,t){let n=t.context,i=e._isQuantized,o=e._isQuantizedDraco,r=e._isOctEncodedDraco,s={u_pointSizeAndTimeAndGeometricErrorAndDepthMultiplier:function(){let a=Y2t;if(a.x=e._attenuation?e.maximumAttenuation:e._pointSize,a.x*=t.pixelRatio,a.y=e.time,e._attenuation){let c=t.camera.frustum,d;t.mode===se.SCENE2D||c instanceof yn?d=Number.POSITIVE_INFINITY:d=n.drawingBufferHeight/t.camera.frustum.sseDenominator,a.z=e.geometricError*e.geometricErrorScale,a.w=d}return a},u_highlightColor:function(){return e._highlightColor},u_constantColor:function(){return e._constantColor},u_clippingPlanes:function(){let a=e.clippingPlanes;return e.isClipped?a.texture:n.defaultTexture},u_clippingPlanesEdgeStyle:function(){let a=e.clippingPlanes;if(!l(a))return U.TRANSPARENT;let c=U.clone(a.edgeColor,w2t);return c.alpha=a.edgeWidth,c},u_clippingPlanesMatrix:function(){let a=e.clippingPlanes;if(!l(a))return P.IDENTITY;let c=e.clippingPlanesOriginMatrix??e._modelMatrix;P.multiply(n.uniformState.view3D,c,Qne);let d=P.multiply(Qne,a.modelMatrix,Qne);return P.inverseTranspose(d,U2t)}};bE.addUniforms(e,s),(i||o||r)&&(s=It(s,{u_quantizedVolumeScaleAndOctEncodedRange:function(){let a=M2t;if(l(e._quantizedVolumeScale)){let c=h.clone(e._quantizedVolumeScale,a);h.divideByScalar(c,e._quantizedRange,a)}return a.w=e._octEncodedRange,a}})),l(e._uniformMapLoaded)&&(s=e._uniformMapLoaded(s)),e._drawCommand.uniformMap=s}function qne(e,t){let n=/czm_3dtiles_property_(\d+)/g,i=n.exec(e);for(;i!==null;){let o=parseInt(i[1]);t.indexOf(o)===-1&&t.push(o),i=n.exec(e)}}function $ne(e,t){e=e.slice(e.indexOf(` +`));let n=/czm_3dtiles_builtin_property_(\w+)/g,i=n.exec(e);for(;i!==null;){let o=i[1];t.indexOf(o)===-1&&t.push(o),i=n.exec(e)}}function eie(e,t){let n=e.numberOfAttributes;for(let i=0;i<n;++i){let o=e.getAttribute(i);if(o.index===t)return o}}var B2t={POSITION:"czm_3dtiles_builtin_property_POSITION",POSITION_ABSOLUTE:"czm_3dtiles_builtin_property_POSITION_ABSOLUTE",COLOR:"czm_3dtiles_builtin_property_COLOR",NORMAL:"czm_3dtiles_builtin_property_NORMAL"};function z2t(e,t,n){let i,o,r,s=t.context,a=l(n),c=e._isQuantized,d=e._isQuantizedDraco,u=e._isOctEncoded16P,m=e._isOctEncodedDraco,p=e._isRGB565,b=e._isTranslucent,f=e._hasColors,y=e._hasNormals,_=e._hasBatchIds,S=e._backFaceCulling,Z=e._normalShading,R=e._drawCommand.vertexArray,C=e.clippingPlanes,E=e._attenuation,A,L,F,I=b,N=$e(B2t),g={},V=e._styleableShaderAttributes;for(o in V)V.hasOwnProperty(o)&&(r=V[o],N[o]=`czm_3dtiles_property_${r.location}`,g[r.location]=r);if(a){let he={translucent:!1},Ze="(vec3 czm_3dtiles_builtin_property_POSITION, vec3 czm_3dtiles_builtin_property_POSITION_ABSOLUTE, vec4 czm_3dtiles_builtin_property_COLOR, vec3 czm_3dtiles_builtin_property_NORMAL)";A=n.getColorShaderFunction(`getColorFromStyle${Ze}`,N,he),L=n.getShowShaderFunction(`getShowFromStyle${Ze}`,N,he),F=n.getPointSizeShaderFunction(`getPointSizeFromStyle${Ze}`,N,he),l(A)&&he.translucent&&(I=!0)}e._styleTranslucent=I;let G=l(A),v=l(L),X=l(F),Y=e.isClipped,D=[],M=[];G&&(qne(A,D),$ne(A,M)),v&&(qne(L,D),$ne(L,M)),X&&(qne(F,D),$ne(F,M));let O=M.indexOf("COLOR")>=0,w=M.indexOf("NORMAL")>=0;if(w&&!y)throw new ae("Style references the NORMAL semantic but the point cloud does not have normals");for(o in V)if(V.hasOwnProperty(o)){r=V[o];let he=D.indexOf(r.location)>=0,Ze=eie(R,r.location);Ze.enabled=he}let z=f&&(!G||O);if(f){let he=eie(R,Kz);he.enabled=z}let K=y&&(Z||S||w);if(y){let he=eie(R,tie);he.enabled=K}let te={a_position:sWe};z&&(te.a_color=Kz),K&&(te.a_normal=tie),_&&(te.a_batchId=aWe);let H="",$=D.length;for(i=0;i<$;++i){let he=D[i];r=g[he];let Ze=r.componentCount,ye=`czm_3dtiles_property_${he}`,Ge;Ze===1?Ge="float":Ge=`vec${Ze}`,H+=`in ${Ge} ${ye}; +`,te[ye]=r.location}O2t(e,t);let ee=`in vec3 a_position; out vec4 v_color; uniform vec4 u_pointSizeAndTimeAndGeometricErrorAndDepthMultiplier; uniform vec4 u_constantColor; @@ -12642,43 +12642,15 @@ const float NORMALIZE_5 = 1.0 / 32.0; uniform mat4 u_clippingPlanesMatrix; uniform vec4 u_clippingPlanesEdgeStyle; `,le+=` -`,le+=zZ(C,s),le+=` +`,le+=xZ(C,s),le+=` `),le+=`void main() { out_FragColor = czm_gammaCorrect(v_color); -`,Y&&(le+=uU("u_clippingPlanes","u_clippingPlanesMatrix","u_clippingPlanesEdgeStyle")),le+=`} -`,e.splitDirection!==kr.NONE&&(le=bA.modifyFragmentShader(le)),l(e._vertexShaderLoaded)&&(ee=e._vertexShaderLoaded(ee)),l(e._fragmentShaderLoaded)&&(le=e._fragmentShaderLoaded(le));let _e=e._drawCommand;l(_e.shaderProgram)&&_e.shaderProgram.destroy(),_e.shaderProgram=tn.fromCache({context:s,vertexShaderSource:ee,fragmentShaderSource:le,attributeLocations:te});try{_e.shaderProgram._bind()}catch{throw new ae("Error generating style shader: this may be caused by a type mismatch, index out-of-bounds, or other syntax error.")}}function Ewt(e,t){if(e._decodingState===RR.READY)return!1;if(e._decodingState===RR.NEEDS_DECODE){let n=e._parsedContent,i=n.draco,o=vb.decodePointCloud(i,t);l(o)&&(e._decodingState=RR.DECODING,o.then(function(r){e._decodingState=RR.READY;let s=l(r.POSITION)?r.POSITION.array:void 0,a=l(r.RGB)?r.RGB.array:void 0,c=l(r.RGBA)?r.RGBA.array:void 0,d=l(r.NORMAL)?r.NORMAL.array:void 0,u=l(r.BATCH_ID)?r.BATCH_ID.array:void 0,m=l(s)&&l(r.POSITION.data.quantization),p=l(d)&&l(r.NORMAL.data.quantization);if(m){let _=r.POSITION.data.quantization,S=_.range;e._quantizedVolumeScale=h.fromElements(S,S,S),e._quantizedVolumeOffset=h.unpack(_.minValues),e._quantizedRange=(1<<_.quantizationBits)-1,e._isQuantizedDraco=!0}p&&(e._octEncodedRange=(1<<r.NORMAL.data.quantization.quantizationBits)-1,e._isOctEncodedDraco=!0);let b=n.styleableProperties,f=i.batchTableProperties;for(let _ in f)if(f.hasOwnProperty(_)){let S=r[_];l(b)||(b={}),b[_]={typedArray:S.array,componentCount:S.data.componentsPerAttribute}}l(s)&&(n.positions={typedArray:s});let y=c??a;l(y)&&(n.colors={typedArray:y}),l(d)&&(n.normals={typedArray:d}),l(u)&&(n.batchIds={typedArray:u}),n.styleableProperties=b}).catch(function(r){e._decodingState=RR.FAILED,e._error=r}))}return!0}var Awt=new ce,Gwt=new h;mU.prototype.update=function(e){let t=e.context;if(l(this._error)){let d=this._error;throw this._error=void 0,d}if(Ewt(this,t))return;let i=!1,o=!P.equals(this._modelMatrix,this.modelMatrix);if(this._mode!==e.mode&&(this._mode=e.mode,o=!0),l(this._drawCommand)||(Zwt(this,e),o=!0,i=!0,this._ready=!0,this._parsedContent=void 0),o){P.clone(this.modelMatrix,this._modelMatrix);let d=this._drawCommand.modelMatrix;if(P.clone(this._modelMatrix,d),l(this._rtcCenter)&&P.multiplyByTranslation(d,this._rtcCenter,d),l(this._quantizedVolumeOffset)&&P.multiplyByTranslation(d,this._quantizedVolumeOffset,d),e.mode!==se.SCENE3D){let m=e.mapProjection,p=P.getColumn(d,3,Awt);ce.equals(p,ce.UNIT_W)||_t.basisTo2D(m,d,d)}let u=this._drawCommand.boundingVolume;if(me.clone(this._boundingSphere,u),this._cull){let m=u.center;P.multiplyByPoint(d,m,m);let p=P.getScale(d,Gwt);u.radius*=h.maximumComponent(p)}}this.clippingPlanesDirty&&(this.clippingPlanesDirty=!1,i=!0),this._attenuation!==this.attenuation&&(this._attenuation=this.attenuation,i=!0),this.backFaceCulling!==this._backFaceCulling&&(this._backFaceCulling=this.backFaceCulling,i=!0),this.normalShading!==this._normalShading&&(this._normalShading=this.normalShading,i=!0),(this._style!==this.style||this.styleDirty)&&(this._style=this.style,this.styleDirty=!1,i=!0);let r=this.splitDirection!==kr.NONE;this._splittingEnabled!==r&&(this._splittingEnabled=r,i=!0),i&&Vwt(this,e,this._style),this._drawCommand.castShadows=vn.castShadows(this.shadows),this._drawCommand.receiveShadows=vn.receiveShadows(this.shadows);let s=this._highlightColor.alpha<1||this._constantColor.alpha<1||this._styleTranslucent;this._drawCommand.renderState=s?this._translucentRenderState:this._opaqueRenderState,this._drawCommand.pass=s?Le.TRANSLUCENT:this._opaquePass;let a=e.commandList,c=e.passes;(c.render||c.pick)&&a.push(this._drawCommand)};mU.prototype.isDestroyed=function(){return!1};mU.prototype.destroy=function(){let e=this._drawCommand;return l(e)&&(e.vertexArray=e.vertexArray&&e.vertexArray.destroy(),e.shaderProgram=e.shaderProgram&&e.shaderProgram.destroy()),ue(this)};var hU=mU;function VR(e){e=e??B.EMPTY_OBJECT,this.show=e.show??!0,this.modelMatrix=P.clone(e.modelMatrix??P.IDENTITY),this.shadows=e.shadows??vn.ENABLED,this.maximumMemoryUsage=e.maximumMemoryUsage??256,this.shading=new Up(e.shading),this.style=e.style,this.frameFailed=new Se,this.frameChanged=new Se,this._clock=e.clock,this._intervals=e.intervals,this._clippingPlanes=void 0,this.clippingPlanes=e.clippingPlanes,this._pointCloudEyeDomeLighting=new kb,this._loadTimestamp=void 0,this._clippingPlanesState=0,this._styleDirty=!1,this._pickId=void 0,this._totalMemoryUsageInBytes=0,this._frames=[],this._previousInterval=void 0,this._nextInterval=void 0,this._lastRenderedFrame=void 0,this._clockMultiplier=0,this._runningSum=0,this._runningLength=0,this._runningIndex=0,this._runningSamples=new Array(5).fill(0),this._runningAverage=0}Object.defineProperties(VR.prototype,{clippingPlanes:{get:function(){return this._clippingPlanes},set:function(e){gs.setOwner(e,this,"_clippingPlanes")}},totalMemoryUsageInBytes:{get:function(){return this._totalMemoryUsageInBytes}},boundingSphere:{get:function(){if(l(this._lastRenderedFrame))return this._lastRenderedFrame.pointCloud.boundingSphere}}});function Lwt(e){return`uniform vec4 czm_pickColor; -${e}`}function Wwt(e){return function(t){return It(t,{czm_pickColor:function(){return e._pickId.color}})}}function vwt(){return"czm_pickColor"}VR.prototype.makeStyleDirty=function(){this._styleDirty=!0};VR.prototype._getAverageLoadTime=function(){return this._runningLength===0?.05:this._runningAverage};var Fwt=new Q;function _se(e){let t=e._clock,n=t.canAnimate&&t.shouldAnimate,i=t.multiplier;return n?i:0}function CR(e,t){return e._intervals.indexOf(t.start)}function Iwt(e,t){let n=e._intervals,i=e._clock,o=_se(e);if(o===0)return;let r=e._getAverageLoadTime(),s=Q.addSeconds(i.currentTime,r*o,Fwt),a=n.indexOf(s),c=CR(e,t);return a===c&&(o>=0?++a:--a),n.get(a)}function Pwt(e){let t=e._intervals,i=e._clock.currentTime,o=t.indexOf(i);return t.get(o)}function Xwt(e,t,n){let i=_se(e),o=CR(e,t),r=CR(e,n);return i>=0?o>=r:o<=r}function nXe(e,t){return function(n){let i=l(n.message)?n.message:n.toString();e.frameFailed.numberOfListeners>0?e.frameFailed.raiseEvent({uri:t,message:i}):(console.log(`A frame failed to load: ${t}`),console.log(`Error: ${i}`))}}function Nwt(e,t,n){let i=CR(e,t),o=e._frames,r=o[i];if(!l(r)){let s=t.data.transform,a=l(s)?P.fromArray(s):void 0,c=t.data.uri;r={pointCloud:void 0,transform:a,timestamp:Zn(),sequential:!0,ready:!1,touchedFrameNumber:n.frameNumber,uri:c},o[i]=r,ve.fetchArrayBuffer({url:c}).then(function(d){r.pointCloud=new hU({arrayBuffer:d,cull:!0,fragmentShaderLoaded:Lwt,uniformMapLoaded:Wwt(e),pickIdLoaded:vwt})}).catch(nXe(e,c))}return r}function Ywt(e,t){e._runningSum+=t,e._runningSum-=e._runningSamples[e._runningIndex],e._runningSamples[e._runningIndex]=t,e._runningLength=Math.min(e._runningLength+1,e._runningSamples.length),e._runningIndex=(e._runningIndex+1)%e._runningSamples.length,e._runningAverage=e._runningSum/e._runningLength}function Mwt(e,t,n,i){t.touchedFrameNumber<i.frameNumber-1&&(t.sequential=!1);let o=t.pointCloud;if(l(o)&&!t.ready){let r=i.commandList,s=r.length;if(iXe(e,t,n,i),o.ready&&(t.ready=!0,e._totalMemoryUsageInBytes+=o.geometryByteLength,r.length=s,t.sequential)){let a=(Zn()-t.timestamp)/1e3;Ywt(e,a)}}t.touchedFrameNumber=i.frameNumber}var wwt=new P;function kwt(e,t){let n=e.shading;return l(n)&&l(n.baseResolution)?n.baseResolution:l(t.boundingSphere)?W.cbrt(t.boundingSphere.volume()/t.pointsLength):0}function Uwt(e){let t=e.shading;return l(t)&&l(t.maximumAttenuation)?t.maximumAttenuation:10}var Dwt=new Up;function iXe(e,t,n,i){let o=e.shading??Dwt,r=t.pointCloud,s=t.transform??P.IDENTITY;r.modelMatrix=P.multiplyTransformation(e.modelMatrix,s,wwt),r.style=e.style,r.time=n.timeSinceLoad,r.shadows=e.shadows,r.clippingPlanes=e._clippingPlanes,r.isClipped=n.isClipped,r.attenuation=o.attenuation,r.backFaceCulling=o.backFaceCulling,r.normalShading=o.normalShading,r.geometricError=kwt(e,r),r.geometricErrorScale=o.geometricErrorScale,r.maximumAttenuation=Uwt(e);try{r.update(i)}catch(a){nXe(e,t.uri)(a)}t.touchedFrameNumber=i.frameNumber}function Tse(e,t,n,i){let o=Nwt(e,t,i);Mwt(e,o,n,i)}function Owt(e){return function(t){return t.touchedFrameNumber<e.frameNumber}}function oXe(e,t){let n=e._frames,i=n.length;for(let o=0;o<i;++o){let r=n[o];if(l(r)&&(!l(t)||t(r))){let s=r.pointCloud;r.ready&&(e._totalMemoryUsageInBytes-=s.geometryByteLength),l(s)&&s.destroy(),r===e._lastRenderedFrame&&(e._lastRenderedFrame=void 0),n[o]=void 0}}}function Bwt(e,t){let n=CR(e,t),i=e._frames[n];if(l(i)&&i.ready)return i}function tXe(e,t,n,i,o){return l(n)?n.ready?!0:(Tse(e,t,i,o),n.ready):!1}function zwt(e,t,n,i,o){let r,s,a,c=e._intervals,d=e._frames,u=CR(e,n),m=CR(e,t);if(u>=m){for(r=u;r>=m;--r)if(s=c.get(r),a=d[r],tXe(e,s,a,i,o))return s}else for(r=u;r<=m;++r)if(s=c.get(r),a=d[r],tXe(e,s,a,i,o))return s;return t}function Hwt(e,t,n){let i=e._frames,o=i.length;for(let r=0;r<o;++r){let s=i[r];l(s)&&l(s.pointCloud)&&(s.pointCloud.clippingPlanesDirty=t,s.pointCloud.styleDirty=n)}}var gA={timeSinceLoad:0,isClipped:!1,clippingPlanesDirty:!1};VR.prototype.update=function(e){if(e.mode===se.MORPHING||!this.show)return;l(this._pickId)||(this._pickId=e.context.createPickId({primitive:this})),l(this._loadTimestamp)||(this._loadTimestamp=Q.clone(e.time));let t=Math.max(Q.secondsDifference(e.time,this._loadTimestamp)*1e3,0),n=this._clippingPlanes,i=0,o=!1,r=l(n)&&n.enabled;r&&(n.update(e),i=n.clippingPlanesState),this._clippingPlanesState!==i&&(this._clippingPlanesState=i,o=!0);let s=this._styleDirty;this._styleDirty=!1,(o||s)&&Hwt(this,o,s),gA.timeSinceLoad=t,gA.isClipped=r;let a=this.shading,c=this._pointCloudEyeDomeLighting,d=e.commandList,u=d.length,m=this._previousInterval,p=this._nextInterval,b=Pwt(this);if(!l(b))return;let f=!1,y=_se(this),_=y===0;y!==this._clockMultiplier&&(f=!0,this._clockMultiplier=y),(!l(m)||_)&&(m=b),(!l(p)||f||Xwt(this,b,p))&&(p=Iwt(this,b)),m=zwt(this,m,b,gA,e);let S=Bwt(this,m);l(S)||(Tse(this,m,gA,e),S=this._lastRenderedFrame),l(S)&&iXe(this,S,gA,e),l(p)&&Tse(this,p,gA,e);let Z=this;l(S)&&!l(this._lastRenderedFrame)&&e.afterRender.push(function(){return!0}),l(S)&&S!==this._lastRenderedFrame&&Z.frameChanged.numberOfListeners>0&&e.afterRender.push(function(){return Z.frameChanged.raiseEvent(Z),!0}),this._previousInterval=m,this._nextInterval=p,this._lastRenderedFrame=S;let R=this._totalMemoryUsageInBytes,C=this.maximumMemoryUsage*1024*1024;R>C&&oXe(this,Owt(e));let A=d.length-u;l(a)&&a.attenuation&&a.eyeDomeLighting&&A>0&&c.update(e,u,a,this.boundingSphere)};VR.prototype.isDestroyed=function(){return!1};VR.prototype.destroy=function(){return oXe(this),this._clippingPlanes=this._clippingPlanes&&this._clippingPlanes.destroy(),this._pickId=this._pickId&&this._pickId.destroy(),ue(this)};var yA=VR;function aXe(e,t){if(l(t)){let n=t.clock;l(n)&&n.getValue(e)}}function Kwt(e){e._renderLoopRunning=!0;let t=0;function n(i){if(!e.isDestroyed())if(e._useDefaultRenderLoop)try{let o=e._targetFrameRate;if(!l(o))e.resize(),e.render(),requestAnimationFrame(n);else{let r=1e3/o,s=i-t;s>r&&(e.resize(),e.render(),t=i-s%r),requestAnimationFrame(n)}}catch(o){e._useDefaultRenderLoop=!1,e._renderLoopRunning=!1,e._showRenderLoopErrors&&e.showErrorPanel("An error occurred while rendering. Rendering has stopped.",void 0,o)}else e._renderLoopRunning=!1}requestAnimationFrame(n)}function cXe(e){let t=e._useBrowserRecommendedResolution?1:window.devicePixelRatio;return t*=e._resolutionScale,l(e._scene)&&(e._scene.pixelRatio=t),t}function lXe(e){let t=e._canvas,n=t.clientWidth,i=t.clientHeight,o=cXe(e);e._canvasClientWidth=n,e._canvasClientHeight=i,n*=o,i*=o,t.width=n,t.height=i,e._canRender=n!==0&&i!==0,e._lastDevicePixelRatio=window.devicePixelRatio}function dXe(e){let t=e._canvas,n=t.width,i=t.height;if(n!==0&&i!==0){let o=e._scene.camera.frustum;l(o.aspectRatio)?o.aspectRatio=n/i:(o.top=o.right*(i/n),o.bottom=-o.top)}}function Ho(e,t){e=Nn(e),t=t??B.EMPTY_OBJECT;let n=document.createElement("div");n.className="cesium-widget",e.appendChild(n);let i=document.createElement("canvas"),o=fn.supportsImageRenderingPixelated();this._supportsImageRenderingPixelated=o,o&&(i.style.imageRendering=fn.imageRenderingValue()),i.oncontextmenu=function(){return!1},i.onselectstart=function(){return!1};function r(){i!==i.ownerDocument.activeElement&&i.ownerDocument.activeElement.blur()}(t.blurActiveElementOnCanvasFocus??!0)&&(i.addEventListener("mousedown",r),i.addEventListener("pointerdown",r)),n.appendChild(i);let a=document.createElement("div");a.className="cesium-widget-credits";let c=l(t.creditContainer)?Nn(t.creditContainer):n;c.appendChild(a);let d=l(t.creditViewport)?Nn(t.creditViewport):n,u=t.showRenderLoopErrors??!0,m=t.useBrowserRecommendedResolution??!0;this._element=n,this._container=e,this._canvas=i,this._canvasClientWidth=0,this._canvasClientHeight=0,this._lastDevicePixelRatio=0,this._creditViewport=d,this._creditContainer=c,this._innerCreditContainer=a,this._canRender=!1,this._renderLoopRunning=!1,this._showRenderLoopErrors=u,this._resolutionScale=1,this._useBrowserRecommendedResolution=m,this._forceResize=!1,this._entityView=void 0,this._clockTrackedDataSource=void 0,this._trackedEntity=void 0,this._needTrackedEntityUpdate=!1,this._zoomIsFlight=!1,this._zoomTarget=void 0,this._zoomPromise=void 0,this._zoomOptions=void 0,this._trackedEntityChanged=new Se,this._allowDataSourcesToSuspendAnimation=!0,this._clock=l(t.clock)?t.clock:new Wf,l(t.shouldAnimate)&&(this._clock.shouldAnimate=t.shouldAnimate),lXe(this);try{let p=t.ellipsoid??ne.default,b=new oU({canvas:i,contextOptions:t.contextOptions,creditContainer:a,creditViewport:d,ellipsoid:p,mapProjection:t.mapProjection,orderIndependentTranslucency:t.orderIndependentTranslucency,scene3DOnly:t.scene3DOnly??!1,shadows:t.shadows,mapMode2D:t.mapMode2D,requestRenderMode:t.requestRenderMode,maximumRenderTimeChange:t.maximumRenderTimeChange,depthPlaneEllipsoidOffset:t.depthPlaneEllipsoidOffset,msaaSamples:t.msaaSamples});this._scene=b,b.camera.constrainedAxis=h.UNIT_Z,cXe(this),dXe(this);let f=t.globe;l(f)||(f=new Hw(p)),f!==!1&&(b.globe=f,b.globe.shadows=t.terrainShadows??vn.RECEIVE_ONLY);let y=t.skyBox;!l(y)&&ne.WGS84.equals(p)&&(y=aU.createEarthSkyBox()),y!==!1&&(b.skyBox=y,b.sun=new dU,ne.WGS84.equals(p)&&(b.moon=new $w));let _=t.skyAtmosphere;!l(_)&&ne.WGS84.equals(p)&&(_=new rU(p),_.show=t.globe!==!1&&f.show),_!==!1&&(b.skyAtmosphere=_);let S=t.baseLayer;t.globe!==!1&&S!==!1&&(l(S)||(S=Zs.fromWorldImagery()),b.imageryLayers.add(S)),l(t.terrainProvider)&&t.globe!==!1&&(b.terrainProvider=t.terrainProvider),l(t.terrain)&&t.globe!==!1&&b.setTerrain(t.terrain),this._screenSpaceEventHandler=new aa(i),l(t.sceneMode)&&(t.sceneMode===se.SCENE2D&&this._scene.morphTo2D(0),t.sceneMode===se.COLUMBUS_VIEW&&this._scene.morphToColumbusView(0)),this._useDefaultRenderLoop=void 0,this.useDefaultRenderLoop=t.useDefaultRenderLoop??!0,this._targetFrameRate=void 0,this.targetFrameRate=t.targetFrameRate;let Z=this;this._onRenderError=function(F,I){Z._useDefaultRenderLoop=!1,Z._renderLoopRunning=!1,Z._showRenderLoopErrors&&Z.showErrorPanel("An error occurred while rendering. Rendering has stopped.",void 0,I)},b.renderError.addEventListener(this._onRenderError);let R=t.dataSources,C=!1;l(R)||(R=new NY,C=!0);let E=new AM({scene:b,dataSourceCollection:R}),A=new Hr;this._dataSourceChangedListeners={},this._automaticallyTrackDataSourceClocks=t.automaticallyTrackDataSourceClocks??!0,this._dataSourceCollection=R,this._destroyDataSourceCollection=C,this._dataSourceDisplay=E,this._eventHelper=A,this._canAnimateUpdateCallback=this._updateCanAnimate,A.add(this._clock.onTick,Ho.prototype._onTick,this),A.add(b.morphStart,Ho.prototype._clearTrackedObject,this),A.add(R.dataSourceAdded,Ho.prototype._onDataSourceAdded,this),A.add(R.dataSourceRemoved,Ho.prototype._onDataSourceRemoved,this),A.add(b.postRender,Ho.prototype._postRender,this);let L=R.length;for(let F=0;F<L;F++)this._dataSourceAdded(R,R.get(F));this._dataSourceAdded(void 0,E.defaultDataSource),A.add(R.dataSourceAdded,Ho.prototype._dataSourceAdded,this),A.add(R.dataSourceRemoved,Ho.prototype._dataSourceRemoved,this)}catch(p){throw u&&this.showErrorPanel("Error constructing CesiumWidget.",'Visit <a href="http://get.webgl.org">http://get.webgl.org</a> to verify that your web browser and hardware support WebGL. Consider trying a different web browser or updating your video drivers. Detailed error information is below:',p),p}}Object.defineProperties(Ho.prototype,{container:{get:function(){return this._container}},canvas:{get:function(){return this._canvas}},creditContainer:{get:function(){return this._creditContainer}},creditViewport:{get:function(){return this._creditViewport}},scene:{get:function(){return this._scene}},imageryLayers:{get:function(){return this._scene.imageryLayers}},terrainProvider:{get:function(){return this._scene.terrainProvider},set:function(e){this._scene.terrainProvider=e}},creditDisplay:{get:function(){return this._scene.frameState.creditDisplay}},dataSourceDisplay:{get:function(){return this._dataSourceDisplay}},entities:{get:function(){return this._dataSourceDisplay.defaultDataSource.entities}},dataSources:{get:function(){return this._dataSourceCollection}},camera:{get:function(){return this._scene.camera}},ellipsoid:{get:function(){return this._scene.ellipsoid}},clock:{get:function(){return this._clock}},screenSpaceEventHandler:{get:function(){return this._screenSpaceEventHandler}},targetFrameRate:{get:function(){return this._targetFrameRate},set:function(e){this._targetFrameRate=e}},useDefaultRenderLoop:{get:function(){return this._useDefaultRenderLoop},set:function(e){this._useDefaultRenderLoop!==e&&(this._useDefaultRenderLoop=e,e&&!this._renderLoopRunning&&Kwt(this))}},resolutionScale:{get:function(){return this._resolutionScale},set:function(e){this._resolutionScale!==e&&(this._resolutionScale=e,this._forceResize=!0)}},useBrowserRecommendedResolution:{get:function(){return this._useBrowserRecommendedResolution},set:function(e){this._useBrowserRecommendedResolution!==e&&(this._useBrowserRecommendedResolution=e,this._forceResize=!0)}},allowDataSourcesToSuspendAnimation:{get:function(){return this._allowDataSourcesToSuspendAnimation},set:function(e){this._allowDataSourcesToSuspendAnimation=e}},trackedEntity:{get:function(){return this._trackedEntity},set:function(e){if(this._trackedEntity!==e){this._trackedEntity=e,Sse(this);let t=this.scene,n=t.mode;!l(e)||!l(e.position)?(this._needTrackedEntityUpdate=!1,(n===se.COLUMBUS_VIEW||n===se.SCENE2D)&&(t.screenSpaceCameraController.enableTranslate=!0),(n===se.COLUMBUS_VIEW||n===se.SCENE3D)&&(t.screenSpaceCameraController.enableTilt=!0),this._entityView=void 0,this.camera.lookAtTransform(P.IDENTITY)):this._needTrackedEntityUpdate=!0,this._trackedEntityChanged.raiseEvent(e),this.scene.requestRender()}}},trackedEntityChanged:{get:function(){return this._trackedEntityChanged}},clockTrackedDataSource:{get:function(){return this._clockTrackedDataSource},set:function(e){this._clockTrackedDataSource!==e&&(this._clockTrackedDataSource=e,aXe(this.clock,e))}}});Ho.prototype.showErrorPanel=function(e,t,n){let i=this._element,o=document.createElement("div");o.className="cesium-widget-errorPanel";let r=document.createElement("div");r.className="cesium-widget-errorPanel-content",o.appendChild(r);let s=document.createElement("div");s.className="cesium-widget-errorPanel-header",s.appendChild(document.createTextNode(e)),r.appendChild(s);let a=document.createElement("div");a.className="cesium-widget-errorPanel-scroll",r.appendChild(a);function c(){a.style.maxHeight=`${Math.max(Math.round(i.clientHeight*.9-100),30)}px`}c(),l(window.addEventListener)&&window.addEventListener("resize",c,!1);let d=l(t),u=l(n);if(d||u){let b=document.createElement("div");if(b.className="cesium-widget-errorPanel-message",a.appendChild(b),u){let f=Op(n);d||(typeof n=="string"&&(n=new Error(n)),t=Op({name:n.name,message:n.message}),f=n.stack),typeof console<"u"&&console.error(`${e} +`,Y&&(le+=tk("u_clippingPlanes","u_clippingPlanesMatrix","u_clippingPlanesEdgeStyle")),le+=`} +`,e.splitDirection!==Ur.NONE&&(le=bE.modifyFragmentShader(le)),l(e._vertexShaderLoaded)&&(ee=e._vertexShaderLoaded(ee)),l(e._fragmentShaderLoaded)&&(le=e._fragmentShaderLoaded(le));let _e=e._drawCommand;l(_e.shaderProgram)&&_e.shaderProgram.destroy(),_e.shaderProgram=tn.fromCache({context:s,vertexShaderSource:ee,fragmentShaderSource:le,attributeLocations:te});try{_e.shaderProgram._bind()}catch{throw new ae("Error generating style shader: this may be caused by a type mismatch, index out-of-bounds, or other syntax error.")}}function H2t(e,t){if(e._decodingState===QZ.READY)return!1;if(e._decodingState===QZ.NEEDS_DECODE){let n=e._parsedContent,i=n.draco,o=Bb.decodePointCloud(i,t);l(o)&&(e._decodingState=QZ.DECODING,o.then(function(r){e._decodingState=QZ.READY;let s=l(r.POSITION)?r.POSITION.array:void 0,a=l(r.RGB)?r.RGB.array:void 0,c=l(r.RGBA)?r.RGBA.array:void 0,d=l(r.NORMAL)?r.NORMAL.array:void 0,u=l(r.BATCH_ID)?r.BATCH_ID.array:void 0,m=l(s)&&l(r.POSITION.data.quantization),p=l(d)&&l(r.NORMAL.data.quantization);if(m){let _=r.POSITION.data.quantization,S=_.range;e._quantizedVolumeScale=h.fromElements(S,S,S),e._quantizedVolumeOffset=h.unpack(_.minValues),e._quantizedRange=(1<<_.quantizationBits)-1,e._isQuantizedDraco=!0}p&&(e._octEncodedRange=(1<<r.NORMAL.data.quantization.quantizationBits)-1,e._isOctEncodedDraco=!0);let b=n.styleableProperties,f=i.batchTableProperties;for(let _ in f)if(f.hasOwnProperty(_)){let S=r[_];l(b)||(b={}),b[_]={typedArray:S.array,componentCount:S.data.componentsPerAttribute}}l(s)&&(n.positions={typedArray:s});let y=c??a;l(y)&&(n.colors={typedArray:y}),l(d)&&(n.normals={typedArray:d}),l(u)&&(n.batchIds={typedArray:u}),n.styleableProperties=b}).catch(function(r){e._decodingState=QZ.FAILED,e._error=r}))}return!0}var K2t=new ce,J2t=new h;nk.prototype.update=function(e){let t=e.context;if(l(this._error)){let d=this._error;throw this._error=void 0,d}if(H2t(this,t))return;let i=!1,o=!P.equals(this._modelMatrix,this.modelMatrix);if(this._mode!==e.mode&&(this._mode=e.mode,o=!0),l(this._drawCommand)||(D2t(this,e),o=!0,i=!0,this._ready=!0,this._parsedContent=void 0),o){P.clone(this.modelMatrix,this._modelMatrix);let d=this._drawCommand.modelMatrix;if(P.clone(this._modelMatrix,d),l(this._rtcCenter)&&P.multiplyByTranslation(d,this._rtcCenter,d),l(this._quantizedVolumeOffset)&&P.multiplyByTranslation(d,this._quantizedVolumeOffset,d),e.mode!==se.SCENE3D){let m=e.mapProjection,p=P.getColumn(d,3,K2t);ce.equals(p,ce.UNIT_W)||_t.basisTo2D(m,d,d)}let u=this._drawCommand.boundingVolume;if(me.clone(this._boundingSphere,u),this._cull){let m=u.center;P.multiplyByPoint(d,m,m);let p=P.getScale(d,J2t);u.radius*=h.maximumComponent(p)}}this.clippingPlanesDirty&&(this.clippingPlanesDirty=!1,i=!0),this._attenuation!==this.attenuation&&(this._attenuation=this.attenuation,i=!0),this.backFaceCulling!==this._backFaceCulling&&(this._backFaceCulling=this.backFaceCulling,i=!0),this.normalShading!==this._normalShading&&(this._normalShading=this.normalShading,i=!0),(this._style!==this.style||this.styleDirty)&&(this._style=this.style,this.styleDirty=!1,i=!0);let r=this.splitDirection!==Ur.NONE;this._splittingEnabled!==r&&(this._splittingEnabled=r,i=!0),i&&z2t(this,e,this._style),this._drawCommand.castShadows=Wn.castShadows(this.shadows),this._drawCommand.receiveShadows=Wn.receiveShadows(this.shadows);let s=this._highlightColor.alpha<1||this._constantColor.alpha<1||this._styleTranslucent;this._drawCommand.renderState=s?this._translucentRenderState:this._opaqueRenderState,this._drawCommand.pass=s?Le.TRANSLUCENT:this._opaquePass;let a=e.commandList,c=e.passes;(c.render||c.pick)&&a.push(this._drawCommand)};nk.prototype.isDestroyed=function(){return!1};nk.prototype.destroy=function(){let e=this._drawCommand;return l(e)&&(e.vertexArray=e.vertexArray&&e.vertexArray.destroy(),e.shaderProgram=e.shaderProgram&&e.shaderProgram.destroy()),ue(this)};var ik=nk;function $Z(e){e=e??B.EMPTY_OBJECT,this.show=e.show??!0,this.modelMatrix=P.clone(e.modelMatrix??P.IDENTITY),this.shadows=e.shadows??Wn.ENABLED,this.maximumMemoryUsage=e.maximumMemoryUsage??256,this.shading=new jp(e.shading),this.style=e.style,this.frameFailed=new Se,this.frameChanged=new Se,this._clock=e.clock,this._intervals=e.intervals,this._clippingPlanes=void 0,this.clippingPlanes=e.clippingPlanes,this._pointCloudEyeDomeLighting=new Hb,this._loadTimestamp=void 0,this._clippingPlanesState=0,this._styleDirty=!1,this._pickId=void 0,this._totalMemoryUsageInBytes=0,this._frames=[],this._previousInterval=void 0,this._nextInterval=void 0,this._lastRenderedFrame=void 0,this._clockMultiplier=0,this._runningSum=0,this._runningLength=0,this._runningIndex=0,this._runningSamples=new Array(5).fill(0),this._runningAverage=0}Object.defineProperties($Z.prototype,{clippingPlanes:{get:function(){return this._clippingPlanes},set:function(e){_s.setOwner(e,this,"_clippingPlanes")}},totalMemoryUsageInBytes:{get:function(){return this._totalMemoryUsageInBytes}},boundingSphere:{get:function(){if(l(this._lastRenderedFrame))return this._lastRenderedFrame.pointCloud.boundingSphere}}});function j2t(e){return`uniform vec4 czm_pickColor; +${e}`}function Q2t(e){return function(t){return It(t,{czm_pickColor:function(){return e._pickId.color}})}}function q2t(){return"czm_pickColor"}$Z.prototype.makeStyleDirty=function(){this._styleDirty=!0};$Z.prototype._getAverageLoadTime=function(){return this._runningLength===0?.05:this._runningAverage};var $2t=new Q;function iie(e){let t=e._clock,n=t.canAnimate&&t.shouldAnimate,i=t.multiplier;return n?i:0}function qZ(e,t){return e._intervals.indexOf(t.start)}function eFt(e,t){let n=e._intervals,i=e._clock,o=iie(e);if(o===0)return;let r=e._getAverageLoadTime(),s=Q.addSeconds(i.currentTime,r*o,$2t),a=n.indexOf(s),c=qZ(e,t);return a===c&&(o>=0?++a:--a),n.get(a)}function tFt(e){let t=e._intervals,i=e._clock.currentTime,o=t.indexOf(i);return t.get(o)}function nFt(e,t,n){let i=iie(e),o=qZ(e,t),r=qZ(e,n);return i>=0?o>=r:o<=r}function lWe(e,t){return function(n){let i=l(n.message)?n.message:n.toString();e.frameFailed.numberOfListeners>0?e.frameFailed.raiseEvent({uri:t,message:i}):(console.log(`A frame failed to load: ${t}`),console.log(`Error: ${i}`))}}function iFt(e,t,n){let i=qZ(e,t),o=e._frames,r=o[i];if(!l(r)){let s=t.data.transform,a=l(s)?P.fromArray(s):void 0,c=t.data.uri;r={pointCloud:void 0,transform:a,timestamp:Zn(),sequential:!0,ready:!1,touchedFrameNumber:n.frameNumber,uri:c},o[i]=r,ve.fetchArrayBuffer({url:c}).then(function(d){r.pointCloud=new ik({arrayBuffer:d,cull:!0,fragmentShaderLoaded:j2t,uniformMapLoaded:Q2t(e),pickIdLoaded:q2t})}).catch(lWe(e,c))}return r}function oFt(e,t){e._runningSum+=t,e._runningSum-=e._runningSamples[e._runningIndex],e._runningSamples[e._runningIndex]=t,e._runningLength=Math.min(e._runningLength+1,e._runningSamples.length),e._runningIndex=(e._runningIndex+1)%e._runningSamples.length,e._runningAverage=e._runningSum/e._runningLength}function rFt(e,t,n,i){t.touchedFrameNumber<i.frameNumber-1&&(t.sequential=!1);let o=t.pointCloud;if(l(o)&&!t.ready){let r=i.commandList,s=r.length;if(dWe(e,t,n,i),o.ready&&(t.ready=!0,e._totalMemoryUsageInBytes+=o.geometryByteLength,r.length=s,t.sequential)){let a=(Zn()-t.timestamp)/1e3;oFt(e,a)}}t.touchedFrameNumber=i.frameNumber}var sFt=new P;function aFt(e,t){let n=e.shading;return l(n)&&l(n.baseResolution)?n.baseResolution:l(t.boundingSphere)?W.cbrt(t.boundingSphere.volume()/t.pointsLength):0}function cFt(e){let t=e.shading;return l(t)&&l(t.maximumAttenuation)?t.maximumAttenuation:10}var lFt=new jp;function dWe(e,t,n,i){let o=e.shading??lFt,r=t.pointCloud,s=t.transform??P.IDENTITY;r.modelMatrix=P.multiplyTransformation(e.modelMatrix,s,sFt),r.style=e.style,r.time=n.timeSinceLoad,r.shadows=e.shadows,r.clippingPlanes=e._clippingPlanes,r.isClipped=n.isClipped,r.attenuation=o.attenuation,r.backFaceCulling=o.backFaceCulling,r.normalShading=o.normalShading,r.geometricError=aFt(e,r),r.geometricErrorScale=o.geometricErrorScale,r.maximumAttenuation=cFt(e);try{r.update(i)}catch(a){lWe(e,t.uri)(a)}t.touchedFrameNumber=i.frameNumber}function nie(e,t,n,i){let o=iFt(e,t,i);rFt(e,o,n,i)}function dFt(e){return function(t){return t.touchedFrameNumber<e.frameNumber}}function uWe(e,t){let n=e._frames,i=n.length;for(let o=0;o<i;++o){let r=n[o];if(l(r)&&(!l(t)||t(r))){let s=r.pointCloud;r.ready&&(e._totalMemoryUsageInBytes-=s.geometryByteLength),l(s)&&s.destroy(),r===e._lastRenderedFrame&&(e._lastRenderedFrame=void 0),n[o]=void 0}}}function uFt(e,t){let n=qZ(e,t),i=e._frames[n];if(l(i)&&i.ready)return i}function cWe(e,t,n,i,o){return l(n)?n.ready?!0:(nie(e,t,i,o),n.ready):!1}function mFt(e,t,n,i,o){let r,s,a,c=e._intervals,d=e._frames,u=qZ(e,n),m=qZ(e,t);if(u>=m){for(r=u;r>=m;--r)if(s=c.get(r),a=d[r],cWe(e,s,a,i,o))return s}else for(r=u;r<=m;++r)if(s=c.get(r),a=d[r],cWe(e,s,a,i,o))return s;return t}function hFt(e,t,n){let i=e._frames,o=i.length;for(let r=0;r<o;++r){let s=i[r];l(s)&&l(s.pointCloud)&&(s.pointCloud.clippingPlanesDirty=t,s.pointCloud.styleDirty=n)}}var gE={timeSinceLoad:0,isClipped:!1,clippingPlanesDirty:!1};$Z.prototype.update=function(e){if(e.mode===se.MORPHING||!this.show)return;l(this._pickId)||(this._pickId=e.context.createPickId({primitive:this})),l(this._loadTimestamp)||(this._loadTimestamp=Q.clone(e.time));let t=Math.max(Q.secondsDifference(e.time,this._loadTimestamp)*1e3,0),n=this._clippingPlanes,i=0,o=!1,r=l(n)&&n.enabled;r&&(n.update(e),i=n.clippingPlanesState),this._clippingPlanesState!==i&&(this._clippingPlanesState=i,o=!0);let s=this._styleDirty;this._styleDirty=!1,(o||s)&&hFt(this,o,s),gE.timeSinceLoad=t,gE.isClipped=r;let a=this.shading,c=this._pointCloudEyeDomeLighting,d=e.commandList,u=d.length,m=this._previousInterval,p=this._nextInterval,b=tFt(this);if(!l(b))return;let f=!1,y=iie(this),_=y===0;y!==this._clockMultiplier&&(f=!0,this._clockMultiplier=y),(!l(m)||_)&&(m=b),(!l(p)||f||nFt(this,b,p))&&(p=eFt(this,b)),m=mFt(this,m,b,gE,e);let S=uFt(this,m);l(S)||(nie(this,m,gE,e),S=this._lastRenderedFrame),l(S)&&dWe(this,S,gE,e),l(p)&&nie(this,p,gE,e);let Z=this;l(S)&&!l(this._lastRenderedFrame)&&e.afterRender.push(function(){return!0}),l(S)&&S!==this._lastRenderedFrame&&Z.frameChanged.numberOfListeners>0&&e.afterRender.push(function(){return Z.frameChanged.raiseEvent(Z),!0}),this._previousInterval=m,this._nextInterval=p,this._lastRenderedFrame=S;let R=this._totalMemoryUsageInBytes,C=this.maximumMemoryUsage*1024*1024;R>C&&uWe(this,dFt(e));let A=d.length-u;l(a)&&a.attenuation&&a.eyeDomeLighting&&A>0&&c.update(e,u,a,this.boundingSphere)};$Z.prototype.isDestroyed=function(){return!1};$Z.prototype.destroy=function(){return uWe(this),this._clippingPlanes=this._clippingPlanes&&this._clippingPlanes.destroy(),this._pickId=this._pickId&&this._pickId.destroy(),ue(this)};var yE=$Z;function fWe(e,t){if(l(t)){let n=t.clock;l(n)&&n.getValue(e)}}function fFt(e){e._renderLoopRunning=!0;let t=0;function n(i){if(!e.isDestroyed())if(e._useDefaultRenderLoop)try{let o=e._targetFrameRate;if(!l(o))e.resize(),e.render(),requestAnimationFrame(n);else{let r=1e3/o,s=i-t;s>r&&(e.resize(),e.render(),t=i-s%r),requestAnimationFrame(n)}}catch(o){e._useDefaultRenderLoop=!1,e._renderLoopRunning=!1,e._showRenderLoopErrors&&e.showErrorPanel("An error occurred while rendering. Rendering has stopped.",void 0,o)}else e._renderLoopRunning=!1}requestAnimationFrame(n)}function pWe(e){let t=e._useBrowserRecommendedResolution?1:window.devicePixelRatio;return t*=e._resolutionScale,l(e._scene)&&(e._scene.pixelRatio=t),t}function bWe(e){let t=e._canvas,n=t.clientWidth,i=t.clientHeight,o=pWe(e);e._canvasClientWidth=n,e._canvasClientHeight=i,n*=o,i*=o,t.width=n,t.height=i,e._canRender=n!==0&&i!==0,e._lastDevicePixelRatio=window.devicePixelRatio}function gWe(e){let t=e._canvas,n=t.width,i=t.height;if(n!==0&&i!==0){let o=e._scene.camera.frustum;l(o.aspectRatio)?o.aspectRatio=n/i:(o.top=o.right*(i/n),o.bottom=-o.top)}}function zo(e,t){e=Nn(e),t=t??B.EMPTY_OBJECT;let n=document.createElement("div");n.className="cesium-widget",e.appendChild(n);let i=document.createElement("canvas"),o=fn.supportsImageRenderingPixelated();this._supportsImageRenderingPixelated=o,o&&(i.style.imageRendering=fn.imageRenderingValue()),i.oncontextmenu=function(){return!1},i.onselectstart=function(){return!1};function r(){i!==i.ownerDocument.activeElement&&i.ownerDocument.activeElement.blur()}(t.blurActiveElementOnCanvasFocus??!0)&&(i.addEventListener("mousedown",r),i.addEventListener("pointerdown",r)),n.appendChild(i);let a=document.createElement("div");a.className="cesium-widget-credits";let c=l(t.creditContainer)?Nn(t.creditContainer):n;c.appendChild(a);let d=l(t.creditViewport)?Nn(t.creditViewport):n,u=t.showRenderLoopErrors??!0,m=t.useBrowserRecommendedResolution??!0;this._element=n,this._container=e,this._canvas=i,this._canvasClientWidth=0,this._canvasClientHeight=0,this._lastDevicePixelRatio=0,this._creditViewport=d,this._creditContainer=c,this._innerCreditContainer=a,this._canRender=!1,this._renderLoopRunning=!1,this._showRenderLoopErrors=u,this._resolutionScale=1,this._useBrowserRecommendedResolution=m,this._forceResize=!1,this._entityView=void 0,this._clockTrackedDataSource=void 0,this._trackedEntity=void 0,this._needTrackedEntityUpdate=!1,this._zoomIsFlight=!1,this._zoomTarget=void 0,this._zoomPromise=void 0,this._zoomOptions=void 0,this._trackedEntityChanged=new Se,this._allowDataSourcesToSuspendAnimation=!0,this._clock=l(t.clock)?t.clock:new Dh,l(t.shouldAnimate)&&(this._clock.shouldAnimate=t.shouldAnimate),bWe(this);try{let p=t.ellipsoid??ne.default,b=new K9({canvas:i,contextOptions:t.contextOptions,creditContainer:a,creditViewport:d,ellipsoid:p,mapProjection:t.mapProjection,orderIndependentTranslucency:t.orderIndependentTranslucency,scene3DOnly:t.scene3DOnly??!1,shadows:t.shadows,mapMode2D:t.mapMode2D,requestRenderMode:t.requestRenderMode,maximumRenderTimeChange:t.maximumRenderTimeChange,depthPlaneEllipsoidOffset:t.depthPlaneEllipsoidOffset,msaaSamples:t.msaaSamples});this._scene=b,b.camera.constrainedAxis=h.UNIT_Z,pWe(this),gWe(this);let f=t.globe;l(f)||(f=new XM(p)),f!==!1&&(b.globe=f,b.globe.shadows=t.terrainShadows??Wn.RECEIVE_ONLY);let y=t.skyBox;!l(y)&&ne.WGS84.equals(p)&&(y=Q9.createEarthSkyBox()),y!==!1&&(b.skyBox=y,b.sun=new ek,ne.WGS84.equals(p)&&(b.moon=new UM));let _=t.skyAtmosphere;!l(_)&&ne.WGS84.equals(p)&&(_=new J9(p),_.show=t.globe!==!1&&f.show),_!==!1&&(b.skyAtmosphere=_);let S=t.baseLayer;t.globe!==!1&&S!==!1&&(l(S)||(S=Cs.fromWorldImagery()),b.imageryLayers.add(S)),l(t.terrainProvider)&&t.globe!==!1&&(b.terrainProvider=t.terrainProvider),l(t.terrain)&&t.globe!==!1&&b.setTerrain(t.terrain),this._screenSpaceEventHandler=new oa(i),l(t.sceneMode)&&(t.sceneMode===se.SCENE2D&&this._scene.morphTo2D(0),t.sceneMode===se.COLUMBUS_VIEW&&this._scene.morphToColumbusView(0)),this._useDefaultRenderLoop=void 0,this.useDefaultRenderLoop=t.useDefaultRenderLoop??!0,this._targetFrameRate=void 0,this.targetFrameRate=t.targetFrameRate;let Z=this;this._onRenderError=function(F,I){Z._useDefaultRenderLoop=!1,Z._renderLoopRunning=!1,Z._showRenderLoopErrors&&Z.showErrorPanel("An error occurred while rendering. Rendering has stopped.",void 0,I)},b.renderError.addEventListener(this._onRenderError);let R=t.dataSources,C=!1;l(R)||(R=new g2,C=!0);let E=new yM({scene:b,dataSourceCollection:R}),A=new kr;this._dataSourceChangedListeners={},this._automaticallyTrackDataSourceClocks=t.automaticallyTrackDataSourceClocks??!0,this._dataSourceCollection=R,this._destroyDataSourceCollection=C,this._dataSourceDisplay=E,this._eventHelper=A,this._canAnimateUpdateCallback=this._updateCanAnimate,A.add(this._clock.onTick,zo.prototype._onTick,this),A.add(b.morphStart,zo.prototype._clearTrackedObject,this),A.add(R.dataSourceAdded,zo.prototype._onDataSourceAdded,this),A.add(R.dataSourceRemoved,zo.prototype._onDataSourceRemoved,this),A.add(b.postRender,zo.prototype._postRender,this);let L=R.length;for(let F=0;F<L;F++)this._dataSourceAdded(R,R.get(F));this._dataSourceAdded(void 0,E.defaultDataSource),A.add(R.dataSourceAdded,zo.prototype._dataSourceAdded,this),A.add(R.dataSourceRemoved,zo.prototype._dataSourceRemoved,this)}catch(p){throw u&&this.showErrorPanel("Error constructing CesiumWidget.",'Visit <a href="http://get.webgl.org">http://get.webgl.org</a> to verify that your web browser and hardware support WebGL. Consider trying a different web browser or updating your video drivers. Detailed error information is below:',p),p}}Object.defineProperties(zo.prototype,{container:{get:function(){return this._container}},canvas:{get:function(){return this._canvas}},creditContainer:{get:function(){return this._creditContainer}},creditViewport:{get:function(){return this._creditViewport}},scene:{get:function(){return this._scene}},imageryLayers:{get:function(){return this._scene.imageryLayers}},terrainProvider:{get:function(){return this._scene.terrainProvider},set:function(e){this._scene.terrainProvider=e}},creditDisplay:{get:function(){return this._scene.frameState.creditDisplay}},dataSourceDisplay:{get:function(){return this._dataSourceDisplay}},entities:{get:function(){return this._dataSourceDisplay.defaultDataSource.entities}},dataSources:{get:function(){return this._dataSourceCollection}},camera:{get:function(){return this._scene.camera}},ellipsoid:{get:function(){return this._scene.ellipsoid}},clock:{get:function(){return this._clock}},screenSpaceEventHandler:{get:function(){return this._screenSpaceEventHandler}},targetFrameRate:{get:function(){return this._targetFrameRate},set:function(e){this._targetFrameRate=e}},useDefaultRenderLoop:{get:function(){return this._useDefaultRenderLoop},set:function(e){this._useDefaultRenderLoop!==e&&(this._useDefaultRenderLoop=e,e&&!this._renderLoopRunning&&fFt(this))}},resolutionScale:{get:function(){return this._resolutionScale},set:function(e){this._resolutionScale!==e&&(this._resolutionScale=e,this._forceResize=!0)}},useBrowserRecommendedResolution:{get:function(){return this._useBrowserRecommendedResolution},set:function(e){this._useBrowserRecommendedResolution!==e&&(this._useBrowserRecommendedResolution=e,this._forceResize=!0)}},allowDataSourcesToSuspendAnimation:{get:function(){return this._allowDataSourcesToSuspendAnimation},set:function(e){this._allowDataSourcesToSuspendAnimation=e}},trackedEntity:{get:function(){return this._trackedEntity},set:function(e){if(this._trackedEntity!==e){this._trackedEntity=e,oie(this);let t=this.scene,n=t.mode;!l(e)||!l(e.position)?(this._needTrackedEntityUpdate=!1,(n===se.COLUMBUS_VIEW||n===se.SCENE2D)&&(t.screenSpaceCameraController.enableTranslate=!0),(n===se.COLUMBUS_VIEW||n===se.SCENE3D)&&(t.screenSpaceCameraController.enableTilt=!0),this._entityView=void 0,this.camera.lookAtTransform(P.IDENTITY)):this._needTrackedEntityUpdate=!0,this._trackedEntityChanged.raiseEvent(e),this.scene.requestRender()}}},trackedEntityChanged:{get:function(){return this._trackedEntityChanged}},clockTrackedDataSource:{get:function(){return this._clockTrackedDataSource},set:function(e){this._clockTrackedDataSource!==e&&(this._clockTrackedDataSource=e,fWe(this.clock,e))}}});zo.prototype.showErrorPanel=function(e,t,n){let i=this._element,o=document.createElement("div");o.className="cesium-widget-errorPanel";let r=document.createElement("div");r.className="cesium-widget-errorPanel-content",o.appendChild(r);let s=document.createElement("div");s.className="cesium-widget-errorPanel-header",s.appendChild(document.createTextNode(e)),r.appendChild(s);let a=document.createElement("div");a.className="cesium-widget-errorPanel-scroll",r.appendChild(a);function c(){a.style.maxHeight=`${Math.max(Math.round(i.clientHeight*.9-100),30)}px`}c(),l(window.addEventListener)&&window.addEventListener("resize",c,!1);let d=l(t),u=l(n);if(d||u){let b=document.createElement("div");if(b.className="cesium-widget-errorPanel-message",a.appendChild(b),u){let f=Wp(n);d||(typeof n=="string"&&(n=new Error(n)),t=Wp({name:n.name,message:n.message}),f=n.stack),typeof console<"u"&&console.error(`${e} ${t} -${f}`);let y=document.createElement("div");y.className="cesium-widget-errorPanel-message-details collapsed";let _=document.createElement("span");_.className="cesium-widget-errorPanel-more-details",_.appendChild(document.createTextNode("See more...")),y.appendChild(_),y.onclick=function(S){y.removeChild(_),y.appendChild(document.createTextNode(f)),y.className="cesium-widget-errorPanel-message-details",r.className="cesium-widget-errorPanel-content expanded",y.onclick=void 0},a.appendChild(y)}b.innerHTML=`<p>${t}</p>`}let m=document.createElement("div");m.className="cesium-widget-errorPanel-buttonPanel",r.appendChild(m);let p=document.createElement("button");p.setAttribute("type","button"),p.className="cesium-button",p.appendChild(document.createTextNode("OK")),p.onclick=function(){l(c)&&l(window.removeEventListener)&&window.removeEventListener("resize",c,!1),i.removeChild(o)},m.appendChild(p),i.appendChild(o)};Ho.prototype.isDestroyed=function(){return!1};Ho.prototype.destroy=function(){let e=this.dataSources,t=e.length;for(let n=0;n<t;n++)this._dataSourceRemoved(e,e.get(n));this._dataSourceRemoved(void 0,this._dataSourceDisplay.defaultDataSource),this._dataSourceDisplay=this._dataSourceDisplay.destroy(),l(this._scene)&&(this._scene.renderError.removeEventListener(this._onRenderError),this._scene=this._scene.destroy()),this._container.removeChild(this._element),this._creditContainer.removeChild(this._innerCreditContainer),this._eventHelper.removeAll(),this._destroyDataSourceCollection&&(this._dataSourceCollection=this._dataSourceCollection.destroy()),ue(this)};Ho.prototype.resize=function(){let e=this._canvas;!this._forceResize&&this._canvasClientWidth===e.clientWidth&&this._canvasClientHeight===e.clientHeight&&this._lastDevicePixelRatio===window.devicePixelRatio||(this._forceResize=!1,lXe(this),dXe(this),this._scene.requestRender())};Ho.prototype.render=function(){if(this._canRender){this._scene.initializeFrame();let e=this._clock.tick();this._scene.render(e)}else this._clock.tick()};Ho.prototype._dataSourceAdded=function(e,t){t.entities.collectionChanged.addEventListener(Ho.prototype._onEntityCollectionChanged,this)};Ho.prototype._dataSourceRemoved=function(e,t){let n=t.entities;n.collectionChanged.removeEventListener(Ho.prototype._onEntityCollectionChanged,this),l(this.trackedEntity)&&n.getById(this.trackedEntity.id)===this.trackedEntity&&(this.trackedEntity=void 0)};Ho.prototype._updateCanAnimate=function(e){this._clock.canAnimate=e};var Jwt=new me;Ho.prototype._onTick=function(e){let t=e.currentTime,n=this._dataSourceDisplay.update(t);this._allowDataSourcesToSuspendAnimation&&this._canAnimateUpdateCallback(n);let i=this._entityView;if(l(i)){let o=this._trackedEntity;this._dataSourceDisplay.getBoundingSphere(o,!1,i.boundingSphere??Jwt)===Wt.DONE&&i.update(t)}};Ho.prototype._onEntityCollectionChanged=function(e,t,n){let i=n.length;for(let o=0;o<i;o++){let r=n[o];this.trackedEntity===r&&(this.trackedEntity=void 0)}};Ho.prototype._clearTrackedObject=function(){this.trackedEntity=void 0};Ho.prototype._onDataSourceChanged=function(e){this.clockTrackedDataSource===e&&aXe(this.clock,e)};Ho.prototype._onDataSourceAdded=function(e,t){this._automaticallyTrackDataSourceClocks&&(this.clockTrackedDataSource=t);let n=t.entities.id,i=this._eventHelper.add(t.changedEvent,Ho.prototype._onDataSourceChanged,this);this._dataSourceChangedListeners[n]=i};Ho.prototype._onDataSourceRemoved=function(e,t){let n=this.clockTrackedDataSource===t,i=t.entities.id;if(this._dataSourceChangedListeners[i](),this._dataSourceChangedListeners[i]=void 0,n){let o=e.length;this._automaticallyTrackDataSourceClocks&&o>0?this.clockTrackedDataSource=e.get(o-1):this.clockTrackedDataSource=void 0}};Ho.prototype.addController=function(e){return this.scene.controllerHost.registerController(e,this.container)};Ho.prototype.removeController=function(e){return this.scene.controllerHost.unregisterController(e,this.container)};Ho.prototype.zoomTo=function(e,t){return uXe(this,e,{offset:t},!1)};Ho.prototype.flyTo=function(e,t){return uXe(this,e,t,!0)};function uXe(e,t,n,i){Sse(e);let o=new Promise(r=>{e._completeZoom=function(s){r(s)}});return e._zoomPromise=o,e._zoomIsFlight=i,e._zoomOptions=n,Promise.resolve(t).then(function(r){if(e._zoomPromise===o){if(r instanceof Zs){let s;l(r.imageryProvider)?s=Promise.resolve(r.getImageryRectangle()):s=new Promise(a=>{let c=r.readyEvent.addEventListener(()=>{c(),a(r.getImageryRectangle())})}),s.then(function(a){return BZ(a,e.scene)}).then(function(a){e._zoomPromise===o&&(e._zoomTarget=a)});return}if(r instanceof zr||r instanceof yA||r instanceof vT||r instanceof na){e._zoomTarget=r;return}if(r.isLoading&&l(r.loadingEvent)){let s=r.loadingEvent.addEventListener(function(){s(),e._zoomPromise===o&&(e._zoomTarget=r.entities.values.slice(0))});return}if(Array.isArray(r)){e._zoomTarget=r.slice(0);return}r=r.values??r,l(r.entities)&&(r=r.entities.values),Array.isArray(r)?e._zoomTarget=r.slice(0):e._zoomTarget=[r]}}),e.scene.requestRender(),o}function fU(e){e._zoomPromise=void 0,e._zoomTarget=void 0,e._zoomOptions=void 0}function Sse(e){let t=e._zoomPromise;l(t)&&(fU(e),e._completeZoom(!1))}Ho.prototype._postRender=function(){jwt(this),Qwt(this)};var rXe=new me;function jwt(e){let t=e._zoomTarget;if(!l(t)||e.scene.mode===se.MORPHING)return;let n=e.scene,i=n.camera,o=e._zoomOptions??{},r;function s(u){l(o.offset)||(o.offset=new uh(0,-.5,u.radius)),r={offset:o.offset,duration:o.duration,maximumHeight:o.maximumHeight,complete:function(){e._completeZoom(!0)},cancel:function(){e._completeZoom(!1)}},e._zoomIsFlight?i.flyToBoundingSphere(u,r):(i.viewBoundingSphere(u,o.offset),i.lookAtTransform(P.IDENTITY),e._completeZoom(!0)),fU(e)}if(t instanceof yA){if(l(t.boundingSphere)){s(t.boundingSphere);return}let u=t.frameChanged.addEventListener(function(m){s(m.boundingSphere),u()});return}if(t instanceof zr||t instanceof vT){s(t.boundingSphere);return}if(t instanceof na){s(t.boundingVolume);return}if(t instanceof pe){r={destination:n.ellipsoid.cartographicToCartesian(t),duration:o.duration,maximumHeight:o.maximumHeight,complete:function(){e._completeZoom(!0)},cancel:function(){e._completeZoom(!1)}},e._zoomIsFlight?i.flyTo(r):(i.setView(r),e._completeZoom(!0)),fU(e);return}let a=t,c=[];for(let u=0,m=a.length;u<m;u++){let p=e._dataSourceDisplay.getBoundingSphere(a[u],!1,rXe);if(p===Wt.PENDING)return;p!==Wt.FAILED&&c.push(me.clone(rXe))}if(c.length===0){Sse(e);return}e.trackedEntity=void 0;let d=me.fromBoundingSpheres(c);e._zoomIsFlight?(fU(e),i.flyToBoundingSphere(d,{duration:o.duration,maximumHeight:o.maximumHeight,complete:function(){e._completeZoom(!0)},cancel:function(){e._completeZoom(!1)},offset:o.offset})):(i.viewBoundingSphere(d,o.offset),i.lookAtTransform(P.IDENTITY),fU(e),e._completeZoom(!0))}var sXe=new me;function Qwt(e){if(!e._needTrackedEntityUpdate)return;let t=e._trackedEntity,n=e.clock.currentTime,i=j.getValueOrUndefined(t.position,n);if(!l(i))return;let o=e.scene,r=e._dataSourceDisplay.getBoundingSphere(t,!1,sXe);if(r===Wt.PENDING)return;let s=o.mode;(s===se.COLUMBUS_VIEW||s===se.SCENE2D)&&(o.screenSpaceCameraController.enableTranslate=!1),(s===se.COLUMBUS_VIEW||s===se.SCENE3D)&&(o.screenSpaceCameraController.enableTilt=!1);let a=r!==Wt.FAILED?sXe:void 0;e._entityView=new LM(t,o,o.ellipsoid),e._entityView.update(n,a),e._needTrackedEntityUpdate=!1}var pU=Ho;var sLo=x(T(),1);var MGo=x(T(),1);function _A(e,t){this._tilingScheme=e,this._maximumLevel=t,this._rootNodes=[]}var ER=new re;function qwt(e,t,n,i){let o=i.length;for(let r=0;r<o;++r){let s=i[r];if(s.x===t&&s.y===n&&s.level===e)return!0}return!1}_A.prototype.addAvailableTileRange=function(e,t,n,i,o){let r=this._tilingScheme,s=this._rootNodes;if(e===0)for(let p=n;p<=o;++p)for(let b=t;b<=i;++b)qwt(e,b,p,s)||s.push(new xA(r,void 0,0,b,p));r.tileXYToRectangle(t,n,e,ER);let a=ER.west,c=ER.north;r.tileXYToRectangle(i,o,e,ER);let d=ER.east,u=ER.south,m=new i9t(e,a,u,d,c);for(let p=0;p<s.length;++p){let b=s[p];Zse(b.extent,m)&&o9t(this._maximumLevel,b,m)}};_A.prototype.computeMaximumLevelAtPosition=function(e){let t;for(let n=0;n<this._rootNodes.length;++n){let i=this._rootNodes[n];if(TA(i.extent,e)){t=i;break}}return l(t)?bU(void 0,t,e):-1};var $wt=[],e9t=[],t9t=new re,n9t=new re;_A.prototype.computeBestAvailableLevelOverRectangle=function(e){let t=$wt;t.length=0,e.east<e.west?(t.push(re.fromRadians(-Math.PI,e.south,e.east,e.north,t9t)),t.push(re.fromRadians(e.west,e.south,Math.PI,e.north,n9t))):t.push(e);let n=e9t;n.length=0;let i;for(i=0;i<this._rootNodes.length;++i)gU(n,this._rootNodes[i],t);for(i=n.length-1;i>=0;--i)if(l(n[i])&&n[i].length===0)return i;return 0};var mXe=new pe;_A.prototype.isTileAvailable=function(e,t,n){let i=this._tilingScheme.tileXYToRectangle(t,n,e,ER);return re.center(i,mXe),this.computeMaximumLevelAtPosition(mXe)>=e};_A.prototype.computeChildMaskForTile=function(e,t,n){let i=e+1;if(i>=this._maximumLevel)return 0;let o=0;return o|=this.isTileAvailable(i,2*t,2*n+1)?1:0,o|=this.isTileAvailable(i,2*t+1,2*n+1)?2:0,o|=this.isTileAvailable(i,2*t,2*n)?4:0,o|=this.isTileAvailable(i,2*t+1,2*n)?8:0,o};function xA(e,t,n,i,o){this.tilingScheme=e,this.parent=t,this.level=n,this.x=i,this.y=o,this.extent=e.tileXYToRectangle(i,o,n),this.rectangles=[],this._sw=void 0,this._se=void 0,this._nw=void 0,this._ne=void 0}Object.defineProperties(xA.prototype,{nw:{get:function(){return this._nw||(this._nw=new xA(this.tilingScheme,this,this.level+1,this.x*2,this.y*2)),this._nw}},ne:{get:function(){return this._ne||(this._ne=new xA(this.tilingScheme,this,this.level+1,this.x*2+1,this.y*2)),this._ne}},sw:{get:function(){return this._sw||(this._sw=new xA(this.tilingScheme,this,this.level+1,this.x*2,this.y*2+1)),this._sw}},se:{get:function(){return this._se||(this._se=new xA(this.tilingScheme,this,this.level+1,this.x*2+1,this.y*2+1)),this._se}}});function i9t(e,t,n,i,o){this.level=e,this.west=t,this.south=n,this.east=i,this.north=o}function Zse(e,t){let n=Math.max(e.west,t.west),i=Math.max(e.south,t.south),o=Math.min(e.east,t.east),r=Math.min(e.north,t.north);return i<r&&n<o}function o9t(e,t,n){for(;t.level<e;)if(qK(t.nw.extent,n))t=t.nw;else if(qK(t.ne.extent,n))t=t.ne;else if(qK(t.sw.extent,n))t=t.sw;else if(qK(t.se.extent,n))t=t.se;else break;if(t.rectangles.length===0||t.rectangles[t.rectangles.length-1].level<=n.level)t.rectangles.push(n);else{let i=Eo(t.rectangles,n.level,r9t);i<0&&(i=~i),t.rectangles.splice(i,0,n)}}function r9t(e,t){return e.level-t}function qK(e,t){return t.west>=e.west&&t.east<=e.east&&t.south>=e.south&&t.north<=e.north}function TA(e,t){return t.longitude>=e.west&&t.longitude<=e.east&&t.latitude>=e.south&&t.latitude<=e.north}function bU(e,t,n){let i=0,o=!1;for(;!o;){let r=t._nw&&TA(t._nw.extent,n),s=t._ne&&TA(t._ne.extent,n),a=t._sw&&TA(t._sw.extent,n),c=t._se&&TA(t._se.extent,n);if(r+s+a+c>1){r&&(i=Math.max(i,bU(t,t._nw,n))),s&&(i=Math.max(i,bU(t,t._ne,n))),a&&(i=Math.max(i,bU(t,t._sw,n))),c&&(i=Math.max(i,bU(t,t._se,n)));break}else r?t=t._nw:s?t=t._ne:a?t=t._sw:c?t=t._se:o=!0}for(;t!==e;){let r=t.rectangles;for(let s=r.length-1;s>=0&&r[s].level>i;--s){let a=r[s];TA(a,n)&&(i=a.level)}t=t.parent}return i}function gU(e,t,n){if(!t)return;let i,o=!1;for(i=0;i<n.length;++i)o=o||Zse(t.extent,n[i]);if(!o)return;let r=t.rectangles;for(i=0;i<r.length;++i){let s=r[i];e[s.level]||(e[s.level]=n),e[s.level]=s9t(e[s.level],s)}gU(e,t._nw,n),gU(e,t._ne,n),gU(e,t._sw,n),gU(e,t._se,n)}function s9t(e,t){let n=[];for(let i=0;i<e.length;++i){let o=e[i];Zse(o,t)?(o.west<t.west&&n.push(new re(o.west,o.south,t.west,o.north)),o.east>t.east&&n.push(new re(t.east,o.south,o.east,o.north)),o.south<t.south&&n.push(new re(Math.max(t.west,o.west),o.south,Math.min(t.east,o.east),t.south)),o.north>t.north&&n.push(new re(Math.max(t.west,o.west),t.north,Math.min(t.east,o.east),o.north))):n.push(o)}return n}var rp=_A;var a9t=15;function hXe(e){this.ellipsoid=e.ellipsoid??ne.default,this.credit=void 0,this.tilingScheme=void 0,this.height=void 0,this.width=void 0,this.encoding=void 0,this.lodCount=void 0,this.hasAvailability=!1,this.tilesAvailable=void 0,this.tilesAvailabilityLoaded=void 0,this.levelZeroMaximumGeometricError=void 0,this.terrainDataStructure=void 0}hXe.prototype.build=function(e){e._credit=this.credit,e._tilingScheme=this.tilingScheme,e._height=this.height,e._width=this.width,e._encoding=this.encoding,e._lodCount=this.lodCount,e._hasAvailability=this.hasAvailability,e._tilesAvailable=this.tilesAvailable,e._tilesAvailabilityLoaded=this.tilesAvailabilityLoaded,e._levelZeroMaximumGeometricError=this.levelZeroMaximumGeometricError,e._terrainDataStructure=this.terrainDataStructure};function c9t(e,t){let n=t.copyrightText;l(n)&&(e.credit=new Lt(n));let i=t.spatialReference,o=i.latestWkid??i.wkid,r=t.extent,s={ellipsoid:e.ellipsoid};if(o===4326)s.rectangle=re.fromDegrees(r.xmin,r.ymin,r.xmax,r.ymax),e.tilingScheme=new to(s);else if(o===3857){let d=Math.PI*e.ellipsoid.maximumRadius;t.extent.xmax>d&&(t.extent.xmax=d),t.extent.ymax>d&&(t.extent.ymax=d),t.extent.xmin<-d&&(t.extent.xmin=-d),t.extent.ymin<-d&&(t.extent.ymin=-d),s.rectangleSouthwestInMeters=new k(r.xmin,r.ymin),s.rectangleNortheastInMeters=new k(r.xmax,r.ymax),e.tilingScheme=new Xr(s)}else throw new ae("Invalid spatial reference");let a=t.tileInfo;if(!l(a))throw new ae("tileInfo is required");e.width=a.rows+1,e.height=a.cols+1,e.encoding=a.format==="LERC"?gh.LERC:gh.NONE,e.lodCount=a.lods.length-1,(e.hasAvailability=t.capabilities.indexOf("Tilemap")!==-1)&&(e.tilesAvailable=new rp(e.tilingScheme,e.lodCount),e.tilesAvailable.addAvailableTileRange(0,0,0,e.tilingScheme.getNumberOfXTilesAtLevel(0),e.tilingScheme.getNumberOfYTilesAtLevel(0)),e.tilesAvailabilityLoaded=new rp(e.tilingScheme,e.lodCount)),e.levelZeroMaximumGeometricError=Qo.getEstimatedLevelZeroGeometricErrorForAHeightmap(e.tilingScheme.ellipsoid,e.width,e.tilingScheme.getNumberOfXTilesAtLevel(0)),t.bandCount>1&&console.log("ArcGISTiledElevationTerrainProvider: Terrain data has more than 1 band. Using the first one."),l(t.minValues)&&l(t.maxValues)?e.terrainDataStructure={elementMultiplier:1,lowestEncodedHeight:t.minValues[0],highestEncodedHeight:t.maxValues[0]}:e.terrainDataStructure={elementMultiplier:1}}async function l9t(e,t,n){try{let i=await t.fetchJson();c9t(e,i)}catch(i){let o=`An error occurred while accessing ${t}.`;throw tr.reportError(void 0,n,l(n)?n._errorEvent:void 0,o),i}}function IT(){this._resource=void 0,this._credit=void 0,this._tilingScheme=void 0,this._levelZeroMaximumGeometricError=void 0,this._maxLevel=void 0,this._terrainDataStructure=void 0,this._width=void 0,this._height=void 0,this._encoding=void 0,this._lodCount=void 0,this._hasAvailability=!1,this._tilesAvailable=void 0,this._tilesAvailabilityLoaded=void 0,this._availableCache={},this._errorEvent=new Se}Object.defineProperties(IT.prototype,{errorEvent:{get:function(){return this._errorEvent}},credit:{get:function(){return this._credit}},tilingScheme:{get:function(){return this._tilingScheme}},hasWaterMask:{get:function(){return!1}},hasVertexNormals:{get:function(){return!1}},availability:{get:function(){return this._tilesAvailable}}});IT.fromUrl=async function(e,t){t=t??B.EMPTY_OBJECT,e=await Promise.resolve(e);let n=ve.createIfNeeded(e);n.appendForwardSlash(),l(t.token)&&(n=n.getDerivedResource({queryParameters:{token:t.token}}));let i=n.getDerivedResource({queryParameters:{f:"pjson"}}),o=new hXe(t);await l9t(o,i);let r=new IT(t);return o.build(r),r._resource=n,r};IT.prototype.requestTileGeometry=function(e,t,n,i){let o=this._resource.getDerivedResource({url:`tile/${n}/${t}/${e}`,request:i}),r=this._hasAvailability,s=Promise.resolve(!0),a;if(r&&!l(Rse(this,n+1,e*2,t*2))){let m=fXe(this,n+1,e*2,t*2);s=m.promise,a=m.request}let c=o.fetchArrayBuffer();if(!l(c)||!l(s))return;let d=this,u=this._tilesAvailable;return Promise.all([c,s]).then(function(m){return new wc({buffer:m[0],width:d._width,height:d._height,childTileMask:r?u.computeChildMaskForTile(n,e,t):a9t,structure:d._terrainDataStructure,encoding:d._encoding})}).catch(async function(m){if(l(a)&&a.state===Ri.CANCELLED){i.cancel();try{await i.deferred?.promise}catch{}return i.state=Ri.CANCELLED,Promise.reject(m)}return Promise.reject(m)})};function Rse(e,t,n,i){if(!e._hasAvailability)return;let o=e._tilesAvailabilityLoaded,r=e._tilesAvailable;if(t>e._lodCount)return!1;if(r.isTileAvailable(t,n,i))return!0;if(o.isTileAvailable(t,n,i))return!1}IT.prototype.getLevelMaximumGeometricError=function(e){return this._levelZeroMaximumGeometricError/(1<<e)};IT.prototype.getTileDataAvailable=function(e,t,n){if(!this._hasAvailability)return;let i=Rse(this,n,e,t);if(l(i))return i;fXe(this,n,e,t)};IT.prototype.loadTileDataAvailability=function(e,t,n){};function d9t(e,t,n,i){let o=t-1,r=n-1,s=i[e.y*t+e.x],a=[],c={startX:e.x,startY:e.y,endX:0,endY:0},d=new k(e.x+1,e.y+1),u=!1,m=!1;for(;!(u&&m);){let p=d.x,b=m?d.y+1:d.y;if(!u){for(let f=e.y;f<b;++f)if(i[f*t+d.x]!==s){u=!0;break}u?(a.push(new k(d.x,e.y)),--d.x,--p,c.endX=d.x):d.x===o?(c.endX=d.x,u=!0):++d.x}if(!m){let f=d.y*t;for(let y=e.x;y<=p;++y)if(i[f+y]!==s){m=!0;break}m?(a.push(new k(e.x,d.y)),--d.y,c.endY=d.y):d.y===r?(c.endY=d.y,m=!0):++d.y}}return{endingIndices:a,range:c,value:s}}function u9t(e,t,n,i,o){let r=[];if(o.every(function(c){return c===o[0]}))return o[0]===1&&r.push({startX:e,startY:t,endX:e+n-1,endY:t+i-1}),r;let a=[new k(0,0)];for(;a.length>0;){let c=a.pop(),d=d9t(c,n,i,o);if(d.value===1){let m=d.range;m.startX+=e,m.endX+=e,m.startY+=t,m.endY+=t,r.push(m)}let u=d.endingIndices;u.length>0&&(a=a.concat(u))}return r}function fXe(e,t,n,i){if(!e._hasAvailability)return{};let o=Math.floor(n/128)*128,r=Math.floor(i/128)*128,s=Math.min(1<<t,128),a=`tilemap/${t}/${r}/${o}/${s}/${s}`,c=e._availableCache;if(l(c[a]))return c[a];let d=new Ar({throttle:!1,throttleByServer:!0,type:js.TERRAIN}),m=e._resource.getDerivedResource({url:a,request:d}).fetchJson();return l(m)?(m=m.then(function(p){let b=u9t(o,r,s,s,p.data);e._tilesAvailabilityLoaded.addAvailableTileRange(t,o,r,o+s,r+s);let f=e._tilesAvailable;for(let y=0;y<b.length;++y){let _=b[y];f.addAvailableTileRange(t,_.startX,_.startY,_.endX,_.endY)}return Rse(e,t,n,i)}),c[a]={promise:m,request:d},m=m.finally(function(p){return delete c[a],p}),{promise:m,request:d}):{}}var Cse=IT;var hLo=x(T(),1);var pXe="https://dev.virtualearth.net/REST/v1/Locations";function Vse(e){e=e??B.EMPTY_OBJECT;let t=e.key;this._key=t;let n={key:t};l(e.culture)&&(n.culture=e.culture),this._resource=new ve({url:pXe,queryParameters:n}),this._credit=new Lt('<img src="http://dev.virtualearth.net/Branding/logo_powered_by.png"/>',!1)}Object.defineProperties(Vse.prototype,{url:{get:function(){return pXe}},key:{get:function(){return this._key}},credit:{get:function(){return this._credit}}});Vse.prototype.geocode=async function(e){return this._resource.getDerivedResource({queryParameters:{query:e}}).fetchJsonp("jsonp").then(function(n){return n.resourceSets.length===0?[]:n.resourceSets[0].resources.map(function(o){let r=o.bbox,s=r[0],a=r[1],c=r[2],d=r[3];return{displayName:o.name,destination:re.fromDegrees(a,s,d,c)}})})};var Ese=Vse;var bLo=x(T(),1);function Ase(){}Object.defineProperties(Ase.prototype,{credit:{get:function(){}}});Ase.prototype.geocode=function(e){let t=e.match(/[^\s,\n]+/g);if(t.length===2||t.length===3){let n=+t[0],i=+t[1],o=t.length===3?+t[2]:300;if(isNaN(n)&&isNaN(i)){let r=/^(\d+.?\d*)([nsew])/i;for(let s=0;s<t.length;++s){let a=t[s].match(r);r.test(t[s])&&a.length===3&&(/^[ns]/i.test(a[2])?i=/^[n]/i.test(a[2])?+a[1]:-a[1]:/^[ew]/i.test(a[2])&&(n=/^[e]/i.test(a[2])?+a[1]:-a[1]))}}if(!isNaN(n)&&!isNaN(i)&&!isNaN(o)){let r={displayName:e,destination:h.fromDegrees(n,i,o)};return Promise.resolve([r])}}return Promise.resolve([])};var Gse=Ase;var CLo=x(T(),1);var m9t=new ce,bXe=new h,SA=new h;function h9t(e){let t=e.points,n=e.times;if(t.length<3){let i=n[0],o=1/(n[1]-i),r=t[0],s=t[1];return function(a,c){l(c)||(c=new h);let d=(a-i)*o;return h.lerp(r,s,d,c)}}return function(i,o){l(o)||(o=new h);let r=e._lastTimeIndex=e.findTimeInterval(i,e._lastTimeIndex),s=(i-n[r])/(n[r+1]-n[r]),a=m9t;a.z=s,a.y=s*s,a.x=a.y*s,a.w=1;let c,d,u,m,p;return r===0?(c=t[0],d=t[1],u=e.firstTangent,m=h.subtract(t[2],c,bXe),h.multiplyByScalar(m,.5,m),p=P.multiplyByVector(yx.hermiteCoefficientMatrix,a,a)):r===t.length-2?(c=t[r],d=t[r+1],m=e.lastTangent,u=h.subtract(d,t[r-1],bXe),h.multiplyByScalar(u,.5,u),p=P.multiplyByVector(yx.hermiteCoefficientMatrix,a,a)):(c=t[r-1],d=t[r],u=t[r+1],m=t[r+2],p=P.multiplyByVector(PT.catmullRomCoefficientMatrix,a,a)),o=h.multiplyByScalar(c,p.x,o),h.multiplyByScalar(d,p.y,SA),h.add(o,SA,o),h.multiplyByScalar(u,p.z,SA),h.add(o,SA,o),h.multiplyByScalar(m,p.w,SA),h.add(o,SA,o)}}var f9t=new h,p9t=new h;function PT(e){e=e??B.EMPTY_OBJECT;let t=e.points,n=e.times,i=e.firstTangent,o=e.lastTangent;if(t.length>2&&(l(i)||(i=f9t,h.multiplyByScalar(t[1],2,i),h.subtract(i,t[2],i),h.subtract(i,t[0],i),h.multiplyByScalar(i,.5,i)),!l(o))){let r=t.length-1;o=p9t,h.multiplyByScalar(t[r-1],2,o),h.subtract(t[r],o,o),h.add(o,t[r-2],o),h.multiplyByScalar(o,.5,o)}this._times=n,this._points=t,this._firstTangent=h.clone(i),this._lastTangent=h.clone(o),this._evaluateFunction=h9t(this),this._lastTimeIndex=0}Object.defineProperties(PT.prototype,{times:{get:function(){return this._times}},points:{get:function(){return this._points}},firstTangent:{get:function(){return this._firstTangent}},lastTangent:{get:function(){return this._lastTangent}}});PT.catmullRomCoefficientMatrix=new P(-.5,1,-.5,0,1.5,-2.5,0,1,-1.5,2,.5,0,.5,-.5,0,0);PT.prototype.findTimeInterval=vo.prototype.findTimeInterval;PT.prototype.wrapTime=vo.prototype.wrapTime;PT.prototype.clampTime=vo.prototype.clampTime;PT.prototype.evaluate=function(e,t){return this._evaluateFunction(e,t)};var Lse=PT;var gWo=x(T(),1);var JLo=x(T(),1);var Wse={},b9t={positions:void 0,normals:void 0,indices:void 0,edgeIndicesWest:void 0,edgeIndicesSouth:void 0,edgeIndicesEast:void 0,edgeIndicesNorth:void 0},g9t=new pe,y9t=new h,x9t=new P,T9t=new P,_9t=new P,S9t=new h,Z9t=new h,R9t=new h,C9t=new h,V9t=new pe,E9t=new k,yU=new h,A9t=new k,G9t=new h,L9t=new h,$K=function(e,t){return e-t};Wse.createMesh=async function(e){e=e??B.EMPTY_OBJECT;let{exaggeration:t=1,exaggerationRelativeHeight:n=0,hasVertexNormals:i,hasWebMercatorT:o,gltf:r,minimumHeight:s,maximumHeight:a,skirtHeight:c}=e,u=t!==1,m=me.clone(e.boundingSphere,new me),p=nn.clone(e.orientedBoundingBox,new nn),b=h.clone(e.horizonOcclusionPoint,new h),f=ne.clone(e.ellipsoid,new ne),y=re.clone(e.rectangle,new re);await(r.extensionsRequired!==void 0&&r.extensionsRequired.indexOf("EXT_meshopt_compression")!==-1?nx.ready:Promise.resolve(void 0));let Z=y.west,R=y.south,C=y.north,E=y.width,A=y.height,L=re.center(y,g9t);L.height=.5*(s+a);let F=pe.toCartesian(L,f,y9t),I=_t.eastNorthUpToFixedFrame(F,f,x9t),N=P.inverseTransformation(I,T9t),g=P.unpack(r.nodes[0].matrix,0,_9t);g=P.multiply(Bi.Y_UP_TO_Z_UP,g,g);let V=lkt(r,i,b9t),G=Qo.getSkirtVertexCount(V.edgeIndicesWest,V.edgeIndicesSouth,V.edgeIndicesEast,V.edgeIndicesNorth),v=V.positions,X=V.normals,Y=V.indices,D=v.length/3,M=D+G,O=Y.length,w=Qo.getSkirtIndexCountWithFilledCorners(G),z=M<=65535?Uint16Array:Uint32Array,K=new z(O+w);K.set(Y);let te=new z(V.edgeIndicesWest),H=new z(V.edgeIndicesSouth),$=new z(V.edgeIndicesEast),ee=new z(V.edgeIndicesNorth),le=new z(te).sort(),_e=new z(H).sort(),he=new z($).sort(),Ze=new z(ee).sort(),ye=Ti.geodeticLatitudeToMercatorAngle(R),Ae=1/(Ti.geodeticLatitudeToMercatorAngle(C)-ye),Fe=h.fromElements(Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY,S9t),tt=h.fromElements(Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY,Z9t),Be=new Cr(m.center,void 0,void 0,void 0,void 0,i,o,u,t,n),je=Be.stride,qe=new Float32Array(M*je),We=0;for(let ct=0;ct<D;ct++){let Et=h.unpack(v,ct*3,R9t),zt=P.multiplyByPoint(g,Et,C9t),ut=pe.fromCartesian(zt,f,V9t),{longitude:bt,latitude:ht,height:jt}=ut,st=(bt-Z)/E,pt=(ht-R)/A;st=W.clamp(st,0,1),pt=W.clamp(pt,0,1),Eo(le,ct,$K)>=0?st=0:Eo(he,ct,$K)>=0&&(st=1),Eo(_e,ct,$K)>=0?pt=0:Eo(Ze,ct,$K)>=0&&(pt=1);let Mi=k.fromElements(st,pt,E9t),jn;if(i){let pi=h.unpack(X,ct*3,yU);pi=P.multiplyByPointAsVector(g,pi,yU),pi=h.normalize(pi,yU),jn=dn.octEncode(pi,A9t)}let Si;o&&(Si=(Ti.geodeticLatitudeToMercatorAngle(ht)-ye)*Ae);let Hi;u&&(Hi=f.geodeticSurfaceNormal(zt,G9t)),We=Be.encode(qe,We,zt,Mi,jt,jn,Si,Hi);let Gi=P.multiplyByPoint(N,zt,L9t);Fe=h.minimumByComponent(Gi,Fe,Fe),tt=h.maximumByComponent(Gi,tt,tt)}let Ke=new yc(h.clone(Be.center,new h),qe,K,O,D,s,a,y,me.clone(m,new me),h.clone(b,new h),je,nn.clone(p,new nn),Be,te,H,$,ee);return ZXe(Ke,y,f,Fe,tt,I,N,c),Promise.resolve(Ke)};var W9t=new k,v9t=new k,F9t=new Array(6),I9t=new k,P9t=new k,X9t=new k,N9t=new h,Y9t=new h,M9t=new h,w9t=new pe,k9t=new h,U9t=new pe,D9t=new pe,gXe=new h,O9t=new h,B9t=new h,z9t=new h,H9t=new h,K9t=new h,J9t=new h,j9t=new h,Q9t=new P,q9t=new P,yXe=new k,$9t=new k,ekt=new h,tkt=new me,nkt=new nn,ikt=new Zu,xXe=new h,TXe=new k,okt=new k,_Xe=new h,rkt=new h;function skt(e){let t=e.meshes[0].primitives[0],n=e.accessors[t.attributes.POSITION],i=e.bufferViews[n.bufferView],o=n.count,r=i.extensions?i.extensions.EXT_meshopt_compression:void 0;if(r===void 0){let b=e.buffers[i.buffer].extras._pipeline.source;return new Float32Array(b.buffer,b.byteOffset+(i.byteOffset??0)+(n.byteOffset??0),o*3)}let s=e.buffers[r.buffer].extras._pipeline.source,a=new Uint8Array(s.buffer,s.byteOffset+(r.byteOffset??0)+(n.byteOffset??0),r.byteLength),c=r.byteStride,d=c===4?Uint8Array:Uint16Array,u=new d(o*4);nx.decodeVertexBuffer(new Uint8Array(u.buffer),o,c,a);let m=(1<<u.BYTES_PER_ELEMENT*8)-1,p=new Float32Array(o*3);for(let b=0;b<o;b++)p[b*3+0]=u[b*4+0]/m,p[b*3+1]=u[b*4+1]/m,p[b*3+2]=u[b*4+2]/m;return p}function akt(e){let t=e.meshes[0].primitives[0],n=e.accessors[t.attributes.NORMAL],i=e.bufferViews[n.bufferView],o=n.count,r=i.extensions?i.extensions.EXT_meshopt_compression:void 0;if(r===void 0){let m=e.buffers[i.buffer].extras._pipeline.source;return new Float32Array(m.buffer,m.byteOffset+(i.byteOffset??0)+(n.byteOffset??0),o*3)}let s=e.buffers[r.buffer].extras._pipeline.source,a=new Uint8Array(s.buffer,s.byteOffset+(r.byteOffset??0)+(n.byteOffset??0),r.byteLength),c=r.byteStride,d=new Int8Array(o*c);nx.decodeVertexBuffer(new Uint8Array(d.buffer),o,c,a);let u=new Float32Array(o*3);for(let m=0;m<o;m++){let p=Math.max(d[m*4+0]/127,-1),b=Math.max(d[m*4+1]/127,-1),f=1-(Math.abs(p)+Math.abs(b));if(f<0){let _=p,S=b;p=(1-Math.abs(S))*W.signNotZero(_),b=(1-Math.abs(_))*W.signNotZero(S)}let y=yU;y.x=p,y.y=b,y.z=f,y=h.normalize(y,yU),u[m*3+0]=y.x,u[m*3+1]=y.y,u[m*3+2]=y.z}return u}function ckt(e){let t=e.meshes[0].primitives[0],n=e.accessors[t.indices],i=e.bufferViews[n.bufferView],o=n.count,r=n.componentType===J.UNSIGNED_SHORT?Uint16Array:Uint32Array,s=i.extensions?i.extensions.EXT_meshopt_compression:void 0;if(s===void 0){let u=e.buffers[i.buffer].extras._pipeline.source;return new r(u.buffer,u.byteOffset+(i.byteOffset??0)+(n.byteOffset??0),o)}let a=e.buffers[s.buffer].extras._pipeline.source,c=new Uint8Array(a.buffer,a.byteOffset+(s.byteOffset??0)+(n.byteOffset??0),s.byteLength),d=new r(o);return nx.decodeIndexBuffer(new Uint8Array(d.buffer),o,s.byteStride,c),d}function eJ(e,t){let n=e.meshes[0].primitives[0],i=e.accessors[n.extensions.CESIUM_tile_edges[t]],o=e.bufferViews[i.bufferView],r=i.count,s=i.componentType===J.UNSIGNED_SHORT?Uint16Array:Uint32Array,a=o.extensions?o.extensions.EXT_meshopt_compression:void 0;if(a===void 0){let p=e.buffers[o.buffer].extras._pipeline.source;return new s(p.buffer,p.byteOffset+(o.byteOffset??0)+(i.byteOffset??0),r)}let c=e.buffers[a.buffer].extras._pipeline.source,d=new Uint8Array(c.buffer,c.byteOffset+(a.byteOffset??0)+(i.byteOffset??0),a.byteLength),u=new s(r),m=a.byteStride;return nx.decodeIndexSequence(new Uint8Array(u.buffer),r,m,d),u}function lkt(e,t,n){return n.positions=skt(e),n.normals=t?akt(e):void 0,n.indices=ckt(e),n.edgeIndicesWest=eJ(e,"left"),n.edgeIndicesSouth=eJ(e,"bottom"),n.edgeIndicesEast=eJ(e,"right"),n.edgeIndicesNorth=eJ(e,"top"),n}Wse.upsampleMesh=function(e){e=e??B.EMPTY_OBJECT;let{isEastChild:t,isNorthChild:n,parentMinimumHeight:i,parentMaximumHeight:o,skirtHeight:r}=e,s=e.parentIndexCountWithoutSkirts,a=e.parentIndices,c=e.parentVertexCountWithoutSkirts,d=e.parentVertices,u=Cr.clone(e.parentEncoding,new Cr),m=u.hasVertexNormals,p=u.hasWebMercatorT,b=u.exaggeration,f=u.exaggerationRelativeHeight,_=b!==1,S=re.clone(e.rectangle,new re),Z=ne.clone(e.ellipsoid),R=[],C=[],E=[],A=[],L=[],F=[],I=[],N=[];Skt(t,n,s,a,c,d,u,A,L,F,I,N,R,E,C);let g=re.center(S,w9t);g.height=.5*(i+o);let V=pe.toCartesian(g,Z,k9t),G=R.length,v=new Cr(V,void 0,void 0,void 0,void 0,m,p,_,b,f),X=v.stride,Y=Qo.getSkirtVertexCount(L,F,I,N),D=G+Y,M=A.length,O=Qo.getSkirtIndexCountWithFilledCorners(Y),w=M+O,z=D<=65535?Uint16Array:Uint32Array,K=new z(w);K.set(A);let te=new z(L),H=new z(F),$=new z(I),ee=new z(N),le=new Float32Array(D*X),_e=0,he=_t.eastNorthUpToFixedFrame(V,Z,Q9t),Ze=P.inverseTransformation(he,q9t),ye=S.west,Ge=S.east,Ae=S.south,Fe=S.north,tt=Ti.geodeticLatitudeToMercatorAngle(Ae),je=1/(Ti.geodeticLatitudeToMercatorAngle(Fe)-tt),qe=Number.POSITIVE_INFINITY,We=Number.NEGATIVE_INFINITY,Ke=h.fromElements(Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY,J9t),ct=h.fromElements(Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY,j9t);for(let jt=0;jt<G;jt++){let st=R[jt],pt=a[st*3+0],Mi=a[st*3+1],jn=a[st*3+2],Si=$9t;Si.x=C[jt*2+0],Si.y=C[jt*2+1];let Hi=Si.x,Gi=Si.y,pi=E[jt*2+0],Zi=E[jt*2+1],On=1-pi-Zi,rn=u.decodeHeight(d,pt),Hn=u.decodeHeight(d,Mi),$i=u.decodeHeight(d,jn),Po=rn*pi+Hn*Zi+$i*On;qe=Math.min(Po,qe),We=Math.max(Po,We);let hr=W.lerp(ye,Ge,Hi),Is=W.lerp(Ae,Fe,Gi),Hs=pe.fromRadians(hr,Is,Po,D9t),or=pe.toCartesian(Hs,Z,O9t),yi=P.multiplyByPoint(Ze,or,z9t);Ke=h.minimumByComponent(yi,Ke,Ke),ct=h.maximumByComponent(yi,ct,ct);let fr;if(m){let Mn=u.decodeNormal(d,pt,N9t),Ki=u.decodeNormal(d,Mi,Y9t),wi=u.decodeNormal(d,jn,M9t),Xo=h.fromElements(Mn.x*pi+Ki.x*Zi+wi.x*On,Mn.y*pi+Ki.y*Zi+wi.y*On,Mn.z*pi+Ki.z*Zi+wi.z*On,xXe);Xo=h.normalize(Xo,xXe),fr=dn.octEncode(Xo,okt)}let mo;p&&(mo=(Ti.geodeticLatitudeToMercatorAngle(Is)-tt)*je);let Qr;_&&(Qr=Z.geodeticSurfaceNormal(or,rkt)),_e=v.encode(le,_e,or,Si,Po,fr,mo,Qr)}let Et=nn.fromRectangle(S,qe,We,Z,nkt),zt=me.fromVertices(le,v.center,X,tkt),bt=new Gf(Z).computeHorizonCullingPointFromVerticesPossiblyUnderEllipsoid(v.center,le,X,v.center,qe,ekt),ht=new yc(h.clone(v.center,new h),le,K,M,G,qe,We,S,me.clone(zt),h.clone(bt),X,nn.clone(Et),v,te,H,$,ee);return ZXe(ht,S,Z,Ke,ct,he,Ze,r),ht};function ZXe(e,t,n,i,o,r,s,a){let{encoding:c}=e,d=c.stride,u=e.vertices,{hasVertexNormals:m,hasWebMercatorT:p,exaggeration:b,exaggerationRelativeHeight:f}=c,_=b!==1,S=e.vertexCountWithoutSkirts,Z=S*d,R=u.length/d,C=R-S,E=e.indices,A=e.indexCountWithoutSkirts,L=e.westIndicesSouthToNorth,F=e.southIndicesEastToWest,I=e.eastIndicesNorthToSouth,N=e.northIndicesWestToEast;Qo.addSkirtIndicesWithFilledCorners(L,F,I,N,S,E,A);let g=0,V=g+L.length,G=V+F.length,v=G+I.length,X=[L,F,I,N],Y=[g,V,G,v],D=[-1,0,1,0],M=[0,-1,0,1],O=h.clone(i,H9t),w=h.clone(o,K9t),z=e.maximumHeight,K=e.minimumHeight-a;for(let $=0;$<C;$++){let ee;for(ee=0;ee<3&&!($<Y[ee+1]);ee++);let le=X[ee][$-Y[ee]],_e=c.decodeTextureCoordinates(u,le,yXe),he=1e-4,Ze=_e.x+D[ee]*he,ye=_e.y+M[ee]*he,Ge=W.lerp(t.west,t.east,Ze),Ae=W.clamp(W.lerp(t.south,t.north,ye),-W.PI_OVER_TWO,+W.PI_OVER_TWO),tt=c.decodeHeight(u,le)-a,Be=pe.fromRadians(Ge,Ae,tt,U9t),je=pe.toCartesian(Be,n,gXe),qe;m&&(qe=c.getOctEncodedNormal(u,le,TXe));let We;p&&(We=c.decodeWebMercatorT(u,le));let Ke;_&&(Ke=n.geodeticSurfaceNormal(je,_Xe)),Z=c.encode(u,Z,je,_e,tt,qe,We,Ke);let ct=P.multiplyByPoint(s,je,B9t);h.minimumByComponent(ct,O,O),h.maximumByComponent(ct,w,w)}let te=Zu.fromCorners(O,w,ikt),H=new Cr(c.center,te,K,z,r,c.hasVertexNormals,c.hasWebMercatorT,_,b,f);if(c.quantization!==H.quantization){let $=H,ee=$.stride,le=new Float32Array(R*ee),_e=0;for(let he=0;he<R;he++)_e=$.encode(le,_e,c.decodePosition(u,he,gXe),c.decodeTextureCoordinates(u,he,yXe),c.decodeHeight(u,he),c.hasVertexNormals?c.getOctEncodedNormal(u,he,TXe):void 0,c.hasWebMercatorT?c.decodeWebMercatorT(u,he):void 0,c.hasGeodeticSurfaceNormals?c.decodeGeodeticSurfaceNormal(u,he,_Xe):void 0);e.vertices=le,e.stride=ee,e.encoding=$}return e}var vse=0,dkt=1,Fse=2,Ise=3,ukt=4,mkt=new h,hkt=[new h,new h,new h,new h,new h,new h],fkt=[new k,new k,new k,new k,new k,new k],pkt=[new h,new h,new h,new h,new h,new h],bkt=[new k,new k,new k,new k,new k,new k];function SXe(e,t,n,i){switch(n){case vse:return W.sign(i.x-e.x);case Fse:return W.sign(t.x-i.x);case Ise:return W.sign(i.y-e.y);default:return W.sign(t.y-i.y)}}function gkt(e,t,n,i,o,r){let s,a,c;switch(n){case vse:s=(e.x-i.x)/(o.x-i.x),a=e.x,c=i.y+(o.y-i.y)*s;break;case Fse:s=(t.x-i.x)/(o.x-i.x),a=t.x,c=i.y+(o.y-i.y)*s;break;case Ise:s=(e.y-i.y)/(o.y-i.y),a=i.x+(o.x-i.x)*s,c=e.y;break;default:s=(t.y-i.y)/(o.y-i.y),a=i.x+(o.x-i.x)*s,c=t.y;break}return h.fromElements(a,c,s,r)}var ykt={length:0,coordinates:[new k,new k,new k,new k,new k,new k],barycentricCoordinates:[new h,new h,new h,new h,new h,new h]};function xkt(e,t,n,i,o,r,s,a){let c,d=fkt,u=hkt,m=3,p=bkt;k.clone(o,p[0]),k.clone(r,p[1]),k.clone(s,p[2]);let b=pkt;h.fromElements(1,0,0,b[0]),h.fromElements(0,1,0,b[1]),h.fromElements(0,0,1,b[2]);for(let f=0;f<t;f++){let y=(e+f)%ukt,_=d,S=u;d=p,u=b,c=m,p=_,b=S,m=0;let Z=c-1,R=d[Z],C=u[Z],E=SXe(n,i,y,R);for(let A=0;A<c;A++){let L=d[A],F=u[A],I=SXe(n,i,y,L);if(E*I===-1){let N=gkt(n,i,y,R,L,mkt),{x:g,y:V,z:G}=N,v=1-G,X=C.x*v+F.x*G,Y=C.y*v+F.y*G,D=C.z*v+F.z*G;k.fromElements(g,V,p[m]),h.fromElements(X,Y,D,b[m]),m++}I>=0&&(k.clone(L,p[m]),h.clone(F,b[m]),m++),R=L,C=F,E=I}if(m===0)break}a.length=m;for(let f=0;f<m;f++)k.clone(p[f],a.coordinates[f]),h.clone(b[f],a.barycentricCoordinates[f]);return a}function Tkt(e,t,n,i,o,r,s,a){return xkt(e?t?Ise:vse:t?Fse:dkt,2,n,i,o,r,s,a)}var _kt=[[],[0],[1],[0,1],[2],[0,2],[1,2],[0,1,2]];function Skt(e,t,n,i,o,r,s,a,c,d,u,m,p,b,f){let y={},_=e?.5:0,S=e?1:.5,Z=t?.5:0,R=t?1:.5,C=W9t;C.x=_,C.y=Z;let E=v9t;E.x=S,E.y=R;let A=0;for(let L=0;L<n;L+=3){let F=i[L+0],I=i[L+1],N=i[L+2],g=s.decodeTextureCoordinates(r,F,I9t),V=s.decodeTextureCoordinates(r,I,P9t),G=s.decodeTextureCoordinates(r,N,X9t),v=Tkt(e,t,C,E,g,V,G,ykt),X=v.length;if(X<3)continue;let Y=F9t;for(let w=0;w<X;w++){let z=v.barycentricCoordinates[w],K=z.x,te=z.y,H=z.z,$=Math.ceil(K)|Math.ceil(te)<<1|Math.ceil(H)<<2,ee=_kt[$],le,_e=!1;if(ee.length===1){let he=ee[0],ye=i[L+he];le=y[ye],le===void 0&&(_e=!0,le=A++,y[ye]=le)}else if(ee.length===2){let he=ee[0],Ze=ee[1],ye=i[L+he],Ge=i[L+Ze],Ae=v.barycentricCoordinates[(w+X-1)%X],Fe=Math.ceil(Ae.x)|Math.ceil(Ae.y)<<1|Math.ceil(Ae.z)<<2,tt=$===Fe,Be=Math.min(ye,Ge),je=Math.max(ye,Ge),qe=o+2*(Be*o+je),We=qe+0,Ke=qe+1,ct=y[We],Et=y[Ke],zt=!tt==(ct===void 0||Et===void 0);if(le=zt?ct:Et,le===void 0){_e=!0,le=A++;let ut=zt?We:Ke;y[ut]=le}}else _e=!0,le=A++;if(Y[w]=le,_e){let he=L/3;p.push(he);let Ze=v.coordinates[w],ye=(Ze.x-_)/(S-_),Ge=(Ze.y-Z)/(R-Z);f.push(ye,Ge),b.push(K,te),ye===0?c.push(le):ye===1&&u.push(le),Ge===0?d.push(le):Ge===1&&m.push(le)}}let D=Y[0],M=Y[1],O=Y[2];a.push(D,M,O);for(let w=3;w<X;w++)M=O,O=Y[w],a.push(D,M,O)}c.sort(function(L,F){return f[L*2+1]-f[F*2+1]}),d.sort(function(L,F){return f[F*2+0]-f[L*2+0]}),u.sort(function(L,F){return f[F*2+1]-f[L*2+1]}),m.sort(function(L,F){return f[L*2+0]-f[F*2+0]})}var ZA=Wse;var eWo=x(T(),1);var tJ={};tJ.clipTriangleAtAxisAlignedThreshold=function(e,t,n,i,o,r){l(r)?r.length=0:r=[];let s,a,c;t?(s=n<e,a=i<e,c=o<e):(s=n>e,a=i>e,c=o>e);let d=s+a+c,u,m,p,b,f,y;return d===1?s?(u=(e-n)/(i-n),m=(e-n)/(o-n),r.push(1),r.push(2),m!==1&&(r.push(-1),r.push(0),r.push(2),r.push(m)),u!==1&&(r.push(-1),r.push(0),r.push(1),r.push(u))):a?(p=(e-i)/(o-i),b=(e-i)/(n-i),r.push(2),r.push(0),b!==1&&(r.push(-1),r.push(1),r.push(0),r.push(b)),p!==1&&(r.push(-1),r.push(1),r.push(2),r.push(p))):c&&(f=(e-o)/(n-o),y=(e-o)/(i-o),r.push(0),r.push(1),y!==1&&(r.push(-1),r.push(2),r.push(1),r.push(y)),f!==1&&(r.push(-1),r.push(2),r.push(0),r.push(f))):d===2?!s&&n!==e?(b=(e-i)/(n-i),f=(e-o)/(n-o),r.push(0),r.push(-1),r.push(1),r.push(0),r.push(b),r.push(-1),r.push(2),r.push(0),r.push(f)):!a&&i!==e?(y=(e-o)/(i-o),u=(e-n)/(i-n),r.push(1),r.push(-1),r.push(2),r.push(1),r.push(y),r.push(-1),r.push(0),r.push(1),r.push(u)):!c&&o!==e&&(m=(e-n)/(o-n),p=(e-i)/(o-i),r.push(2),r.push(-1),r.push(0),r.push(2),r.push(m),r.push(-1),r.push(1),r.push(2),r.push(p)):d!==3&&(r.push(0),r.push(1),r.push(2)),r};tJ.computeBarycentricCoordinates=function(e,t,n,i,o,r,s,a,c){let d=n-s,u=s-o,m=r-a,p=i-a,b=1/(m*d+u*p),f=t-a,y=e-s,_=(m*y+u*f)*b,S=(-p*y+d*f)*b,Z=1-_-S;return l(c)?(c.x=_,c.y=S,c.z=Z,c):new h(_,S,Z)};tJ.computeLineSegmentLineSegmentIntersection=function(e,t,n,i,o,r,s,a,c){let d=(s-o)*(t-r)-(a-r)*(e-o),u=(n-e)*(t-r)-(i-t)*(e-o),m=(a-r)*(n-e)-(s-o)*(i-t);if(m===0)return;let p=d/m,b=u/m;if(p>=0&&p<=1&&b>=0&&b<=1)return l(c)||(c=new k),c.x=e+p*(n-e),c.y=t+p*(i-t),c};var sp=tJ;function uy(e){e=e??B.EMPTY_OBJECT,this._minimumHeight=e.minimumHeight,this._maximumHeight=e.maximumHeight,this._skirtHeight=e.skirtHeight,this._boundingSphere=me.clone(e.boundingSphere,new me),this._orientedBoundingBox=nn.clone(e.orientedBoundingBox,new nn),this._horizonOcclusionPoint=h.clone(e.horizonOcclusionPoint,new h),this._hasVertexNormals=e.requestVertexNormals??!1,this._hasWaterMask=e.requestWaterMask??!1,this._hasWebMercatorT=!0,this._credits=e.credits,this._childTileMask=e.childTileMask??15,this._gltf=e.gltf,this._mesh=void 0,this._waterMask=e.waterMask}Object.defineProperties(uy.prototype,{credits:{get:function(){return this._credits}},waterMask:{get:function(){return this._waterMask}}});uy.prototype.interpolateHeight=function(e,t,n){let i=this._mesh;return i===void 0?void 0:CXe(i,e,t,n)};uy.prototype.isChildAvailable=function(e,t,n,i){let o=2;return n!==e*2&&++o,i!==t*2&&(o-=2),(this._childTileMask&1<<o)!==0};var RXe="createVerticesFromCesium3DTilesTerrain",Zkt=new qn(RXe),Rkt=new qn(RXe,ru.maximumAsynchronousTasks);uy.prototype.createMesh=function(e){e=e??B.EMPTY_OBJECT;let n=e.throttle??!0?Rkt:Zkt,i=e.tilingScheme,o=i.ellipsoid,r=e.x,s=e.y,a=e.level,c=i.tileXYToRectangle(r,s,a,new re),d=this._gltf,u=n.scheduleTask({ellipsoid:o,rectangle:c,hasVertexNormals:this._hasVertexNormals,hasWaterMask:this._hasWaterMask,hasWebMercatorT:this._hasWebMercatorT,gltf:d,minimumHeight:this._minimumHeight,maximumHeight:this._maximumHeight,boundingSphere:this._boundingSphere,orientedBoundingBox:this._orientedBoundingBox,horizonOcclusionPoint:this._horizonOcclusionPoint,skirtHeight:this._skirtHeight,exaggeration:e.exaggeration,exaggerationRelativeHeight:e.exaggerationRelativeHeight});if(!l(u))return;let m=this;return Promise.resolve(u).then(function(p){let b=p,f=Cr.clone(b.encoding,new Cr),y=new Float32Array(b.verticesBuffer),_=y.length/f.stride,S=b.vertexCountWithoutSkirts,Z=_<=65535?Uint16Array:Uint32Array,R=new Z(b.indicesBuffer),C=new Z(b.westIndicesBuffer),E=new Z(b.eastIndicesBuffer),A=new Z(b.southIndicesBuffer),L=new Z(b.northIndicesBuffer),F=b.indexCountWithoutSkirts,I=m._minimumHeight,N=m._maximumHeight,g=h.clone(f.center,new h),V=me.clone(m._boundingSphere,new me),G=h.clone(m._horizonOcclusionPoint,new h),v=nn.clone(m._orientedBoundingBox,new nn),X=new yc(g,y,R,F,S,I,N,c,V,G,f.stride,v,f,C,A,E,L);return m._mesh=X,Promise.resolve(X)})};uy.prototype._createMeshSync=function(e){e=e??B.EMPTY_OBJECT;let t=e.tilingScheme,n=t.ellipsoid,i=e.x,o=e.y,r=e.level,s=t.tileXYToRectangle(i,o,r,new re),a=ZA.createMesh({ellipsoid:n,rectangle:s,hasVertexNormals:this._hasVertexNormals,hasWebMercatorT:this._hasWebMercatorT,gltf:this._gltf,minimumHeight:this._minimumHeight,maximumHeight:this._maximumHeight,boundingSphere:this._boundingSphere,orientedBoundingBox:this._orientedBoundingBox,horizonOcclusionPoint:this._horizonOcclusionPoint,skirtHeight:this._skirtHeight,exaggeration:e.exaggeration,exaggerationRelativeHeight:e.exaggerationRelativeHeight}),c=this;return Promise.resolve(a).then(function(d){return c._mesh=d,Promise.resolve(d)})};uy.prototype.upsample=function(e,t,n,i,o,r,s){let a=this._mesh;return a===void 0?void 0:nJ(!1,a,this._skirtHeight,this._credits,e,t,n,i,o,r,s)};uy.prototype._upsampleSync=function(e,t,n,i,o,r,s){let a=this._mesh;return a===void 0?void 0:nJ(!0,a,this._skirtHeight,this._credits,e,t,n,i,o,r,s)};uy.prototype.wasCreatedByUpsampling=function(){return!1};function dy(e){e=e??B.EMPTY_OBJECT,this._mesh=e.terrainMesh,this._skirtHeight=e.skirtHeight,this._credits=e.credits}dy.prototype.createMesh=function(e){return e=e??B.EMPTY_OBJECT,Promise.resolve(this._mesh)};dy.prototype.upsample=function(e,t,n,i,o,r,s){return nJ(!1,this._mesh,this._skirtHeight,this._credits,e,t,n,i,o,r,s)};dy.prototype._upsampleSync=function(e,t,n,i,o,r,s){return nJ(!0,this._mesh,this._skirtHeight,this._credits,e,t,n,i,o,r,s)};dy.prototype.interpolateHeight=function(e,t,n){let i=this._mesh;return CXe(i,e,t,n)};dy.prototype.wasCreatedByUpsampling=function(){return!0};dy.prototype.isChildAvailable=function(e,t,n,i){return!1};Object.defineProperties(dy.prototype,{credits:{get:function(){return this._credits}},waterMask:{get:function(){}}});var Ckt=new qn("upsampleVerticesFromCesium3DTilesTerrain",ru.maximumAsynchronousTasks);function nJ(e,t,n,i,o,r,s,a,c,d,u){if(u-a>1)throw new ge("Upsampling through more than one level at a time is not currently supported.");let p=n*.5,b=r*2!==c,f=s*2===d,y=o.tileXYToRectangle(c,d,u,new re),_=o.ellipsoid,S={isEastChild:b,isNorthChild:f,rectangle:y,ellipsoid:_,skirtHeight:p,parentVertices:t.vertices,parentIndices:t.indices,parentVertexCountWithoutSkirts:t.vertexCountWithoutSkirts,parentIndexCountWithoutSkirts:t.indexCountWithoutSkirts,parentMinimumHeight:t.minimumHeight,parentMaximumHeight:t.maximumHeight,parentEncoding:t.encoding};if(e){let R=ZA.upsampleMesh(S),C=new dy({terrainMesh:R,skirtHeight:p,credits:i});return Promise.resolve(C)}let Z=Ckt.scheduleTask(S);if(Z!==void 0)return Z.then(function(R){let C=Cr.clone(R.encoding,new Cr),E=C.stride,A=new Float32Array(R.verticesBuffer),L=A.length/E,F=R.vertexCountWithoutSkirts,I=L<=65535?Uint16Array:Uint32Array,N=new I(R.indicesBuffer),g=new I(R.westIndicesBuffer),V=new I(R.eastIndicesBuffer),G=new I(R.southIndicesBuffer),v=new I(R.northIndicesBuffer),X=R.indexCountWithoutSkirts,Y=R.minimumHeight,D=R.maximumHeight,M=h.clone(C.center,new h),O=me.clone(R.boundingSphere,new me),w=h.clone(R.horizonOcclusionPoint,new h),z=nn.clone(R.orientedBoundingBox,new nn),K=new yc(M,A,N,X,F,Y,D,y,O,w,E,z,C,g,G,V,v),te=new dy({terrainMesh:K,skirtHeight:p,credits:i});return Promise.resolve(te)})}var Vkt=new k,Ekt=new k,Akt=new k,Gkt=new h;function CXe(e,t,n,i){let o=W.clamp((n-t.west)/t.width,0,1),r=W.clamp((i-t.south)/t.height,0,1),{vertices:s,encoding:a,indices:c}=e;for(let d=0;d<e.indexCountWithoutSkirts;d+=3){let u=c[d],m=c[d+1],p=c[d+2],b=a.decodeTextureCoordinates(s,u,Vkt),f=a.decodeTextureCoordinates(s,m,Ekt),y=a.decodeTextureCoordinates(s,p,Akt),_=Math.min(b.x,f.x,y.x),S=Math.max(b.x,f.x,y.x),Z=Math.min(b.y,f.y,y.y),R=Math.max(b.y,f.y,y.y);if(o>=_&&o<=S&&r>=Z&&r<=R){let C=sp.computeBarycentricCoordinates(o,r,b.x,b.y,f.x,f.y,y.x,y.y,Gkt);if(C.x>=0&&C.y>=0&&C.z>=0){let E=a.decodeHeight(s,u),A=a.decodeHeight(s,m),L=a.decodeHeight(s,p);return C.x*E+C.y*A+C.z*L}}}return 0}var xU=uy;var BWo=x(T(),1);function D0(e){e=e??B.EMPTY_OBJECT;let t=e.credit;typeof t=="string"&&(t=new Lt(t)),this._credit=t,this._tileCredits=void 0,this._errorEvent=new Se,this._ellipsoid=e.ellipsoid??ne.WGS84,this._tilingScheme=new to({ellipsoid:this._ellipsoid}),this._subtreeCache=new AR({provider:this}),this._tileset0=void 0,this._tileset1=void 0,this._resource=void 0,this._requestVertexNormals=e.requestVertexNormals??!1,this._requestWaterMask=e.requestWaterMask??!1}D0.fromUrl=async function(e,t){t=t??B.EMPTY_OBJECT,e=await Promise.resolve(e);let n=ve.createIfNeeded(e),i;try{i=await n.fetchJson()}catch(u){throw new ae("Could not load tileset JSON",u)}let o=new D0(t);o._tileCredits=n.credits,o._resource=n;let r=i.root.children,s=r[0],a=r[1],c=i.schema,d=Ql.fromJson(c);return o._tileset0=new $p(n,s,d),o._tileset1=new $p(n,a,d),o};D0.fromIonAssetId=async function(e,t){let n=await Ur.fromAssetId(e);return D0.fromUrl(n,t)};var Lkt=new Array(3);D0.prototype.requestTileGeometry=async function(e,t,n,i){let o=EXe(n,e),r=o===0?this._tileset0:this._tileset1,s=AXe(r,n,e,t),a=s.getSubtreeCoordinates(),c=this._subtreeCache,d=c.find(o,a),u=this._requestWaterMask,m=this,p;if(d===void 0){let Z=r.subtreeUriTemplate.getDerivedResource({templateValues:a.getTemplateValues()});p=r.baseResource.getDerivedResource({url:Z.url}).fetchArrayBuffer().then(async function(C){if(d=c.find(o,a),d===void 0){let E=new Uint8Array(C);d=await Pb.fromSubtreeJson(m._resource,void 0,E,r,a),c.addSubtree(o,d)}return d})}else p=Promise.resolve(d);let b=r.contentUriTemplates[0].getDerivedResource({templateValues:s.getTemplateValues()}),f=r.baseResource.getDerivedResource({url:b.url}),y=f.fetchArrayBuffer();if(y===void 0)return;let _=y.then(Z=>oS(new Uint8Array(Z))),S=Lkt;S[0]=p,S[1]=_,S[2]=u?_.then(Z=>Wkt(Z,f)):void 0;try{let Z=await Promise.all(S),R=Z[0],C=Z[1],E=Z[2],A=R.getTileMetadataView(s),L=A.getPropertyBySemantic(Nm.TILE_MINIMUM_HEIGHT),F=A.getPropertyBySemantic(Nm.TILE_MAXIMUM_HEIGHT),I=A.getPropertyBySemantic(Nm.TILE_BOUNDING_SPHERE),N=me.unpack(I,0,new me),g=A.getPropertyBySemantic(Nm.TILE_HORIZON_OCCLUSION_POINT),G=m._tilingScheme.tileXYToRectangle(e,t,n,new re),v=m._ellipsoid,X=nn.fromRectangle(G,L,F,v,new nn),Y=m.getLevelMaximumGeometricError(n)*5,D=iJ(r,R,s,0,0),M=iJ(r,R,s,1,0),O=iJ(r,R,s,0,1),w=iJ(r,R,s,1,1),z=(D?1:0)|(M?2:0)|(O?4:0)|(w?8:0),K=new xU({gltf:C,minimumHeight:L,maximumHeight:F,boundingSphere:N,orientedBoundingBox:X,horizonOcclusionPoint:g,skirtHeight:Y,requestVertexNormals:m._requestVertexNormals,childTileMask:z,credits:m._tileCredits,waterMask:E});return Promise.resolve(K)}catch(Z){console.log(`Could not load subtree: ${o} ${a.level} ${a.x} ${a.y}: ${Z}`),console.log(`Could not load tile: ${o} ${s.level} ${s.x} ${s.y}: ${Z}`);return}};D0.prototype.getTileDataAvailable=function(e,t,n){let i=this._subtreeCache,o=EXe(n,e),r=o===0?this._tileset0:this._tileset1,s=AXe(r,n,e,t),a=s.getSubtreeCoordinates(),c=i.find(o,a);if(c!==void 0)return c.tileIsAvailableAtCoordinates(s);if(a.isImplicitTilesetRoot())return s.isSubtreeRoot()?!0:void 0;let d=a.getParentSubtreeCoordinates(),u=i.find(o,d);if(u!==void 0)return u.childSubtreeIsAvailableAtCoordinates(a)?s.isSubtreeRoot()?!0:void 0:!1};function EXe(e,t){let n=1<<e;return t/n|0}function AXe(e,t,n,i){let o=1<<t,r=t,s=n%o,a=o-i-1,{subdivisionScheme:c,subtreeLevels:d}=e;return new e0({subdivisionScheme:c,subtreeLevels:d,level:r,x:s,y:a})}async function Wkt(e,t){let n=e.extensions?.EXT_structural_metadata;if(!l(n)||!l(n.propertyTextures))return;let i=new ax({schema:n.schema});await i.load();let o=i.schema,r,s;if(l(o.classes)){for(let b in o.classes)if(o.classes.hasOwnProperty(b)&&(r=o.classes[b],s=r.propertiesBySemantic.WATERMASK,l(s)))break}if(!l(s))return;let a=n.propertyTextures.find(b=>b.class===r.id);if(!l(a))throw new ge(`Expected a propertyTexture with a class ${r.id}`);let c=a.properties[s.id],d=e.textures[c.index],u=e.images[d.source]?.bufferView,m=Ni.getBufferViewLoader({gltf:e,bufferViewId:u,gltfResource:t,baseResource:t});return await m.load(),await Fb({uint8Array:new Uint8Array(m.typedArray),format:"image/png",flipY:!1,skipColorSpaceConversion:!0})}function iJ(e,t,n,i,o){let r=n.isBottomOfSubtree(),a=Pse(e,1,i,o),c=n.getDescendantCoordinates(a);return r?t.childSubtreeIsAvailableAtCoordinates(c):t.tileIsAvailableAtCoordinates(c)}function Pse(e,t,n,i){let{subdivisionScheme:o,subtreeLevels:r}=e;return new e0({subdivisionScheme:o,subtreeLevels:r,level:t,x:n,y:i})}D0.prototype.loadTileDataAvailability=function(e,t,n){};D0.prototype.getLevelMaximumGeometricError=function(e){let t=this._ellipsoid;return Qo.getEstimatedLevelZeroGeometricErrorForAHeightmap(t,64,2)/(1<<e)};Object.defineProperties(D0.prototype,{errorEvent:{get:function(){return this._errorEvent}},credit:{get:function(){return this._credit}},tilingScheme:{get:function(){return this._tilingScheme}},hasWaterMask:{get:function(){return this._requestWaterMask}},hasVertexNormals:{get:function(){return this._requestVertexNormals}},availability:{get:function(){return this._subtreeCache}}});function vkt(e,t,n){this.rootId=e,this.subtree=t,this.stamp=n}function AR(e){this._maximumSubtreeCount=e.maximumSubtreeCount??0,this._subtreeRequestCounter=0,this._queue=new ly({comparator:AR.comparator}),this._provider=e.provider}AR.comparator=function(e,t){let n=e.subtree.implicitCoordinates,i=t.subtree.implicitCoordinates;return n.isAncestor(i)?1:i.isAncestor(n)?-1:e.stamp-t.stamp};AR.prototype.addSubtree=function(e,t){let n=new vkt(e,t,this._subtreeRequestCounter);this._queue.insert(n),this._subtreeRequestCounter++;let i=t.implicitCoordinates;if(i.level>0){let o=i.getParentSubtreeCoordinates(),r=this.find(e,o)}if(this._maximumSubtreeCount>0)for(;this._queue.length>this._maximumSubtreeCount&&this._queue.getMinimum()!==n;)this._queue.removeMinimum()};AR.prototype.find=function(e,t){let n=this._queue,i=n.internalArray,{level:o,x:r,y:s}=t;for(let a=0;a<n.length;a++){let c=i[a],d=c.rootId,u=c.subtree.implicitCoordinates;if(d===e&&u.level===o&&u.x===r&&u.y===s)return c.subtree}};AR.prototype._computeMaximumImplicitTileCoordinatesAtPosition=function(e){let{longitude:t,latitude:n}=e,i=this._provider,o=t<0?0:1,r=o===0?i._tileset0:i._tileset1,s=r.subtreeLevels,a=Pse(r,0,0,0),c=this.find(o,a);if(c===void 0)return;let d=c.implicitCoordinates,u=d.x,m=d.y,p=d.level,b=-W.PI,f=+W.PI,y=W.lerp(b,f,o/2),_=W.lerp(b,f,(o+1)/2),S=-W.PI*.5,Z=+W.PI*.5,R=0,C=0,E=!0;for(;E;){let L=1/(1<<p),F=(_-y)*L,I=y+u*F,N=(Z-S)*L,g=S+m*N;R=(t-I)/F,C=(n-g)/N;let V=VXe(r,d,R,C,s);if(c.childSubtreeIsAvailableAtCoordinates(V)){let G=this.find(o,V);if(G!==void 0)c=G,d=c.implicitCoordinates,u=d.x,m=d.y,p=d.level;else return V}else E=!1}let A;for(let L=0;L<s;L++){let F=VXe(r,d,R,C,L);if(c.tileIsAvailableAtCoordinates(F))A=F;else break}return A};function VXe(e,t,n,i,o){let r=1<<o,s=W.clamp(n*r|0,0,r-1),a=W.clamp(i*r|0,0,r-1),c=Pse(e,o,s,a);return t.getDescendantCoordinates(c)}AR.prototype.computeMaximumLevelAtPosition=function(e){let t=this._computeMaximumImplicitTileCoordinatesAtPosition(e);return t===void 0?0:t.level};var Xse=D0;var Wvo=x(T(),1);var svo=x(T(),1);function XT(e){e=e??B.EMPTY_OBJECT,this._quantizedVertices=e.quantizedVertices,this._encodedNormals=e.encodedNormals,this._indices=e.indices,this._minimumHeight=e.minimumHeight,this._maximumHeight=e.maximumHeight,this._boundingSphere=e.boundingSphere,this._orientedBoundingBox=e.orientedBoundingBox,this._horizonOcclusionPoint=e.horizonOcclusionPoint,this._credits=e.credits;let t=this._quantizedVertices.length/3,n=this._uValues=this._quantizedVertices.subarray(0,t),i=this._vValues=this._quantizedVertices.subarray(t,2*t);this._heightValues=this._quantizedVertices.subarray(2*t,3*t);function o(s,a){return i[s]-i[a]}function r(s,a){return n[s]-n[a]}this._westIndices=rJ(e.westIndices,o,t),this._southIndices=rJ(e.southIndices,r,t),this._eastIndices=rJ(e.eastIndices,o,t),this._northIndices=rJ(e.northIndices,r,t),this._westSkirtHeight=e.westSkirtHeight,this._southSkirtHeight=e.southSkirtHeight,this._eastSkirtHeight=e.eastSkirtHeight,this._northSkirtHeight=e.northSkirtHeight,this._childTileMask=e.childTileMask??15,this._createdByUpsampling=e.createdByUpsampling??!1,this._waterMask=e.waterMask,this._mesh=void 0}Object.defineProperties(XT.prototype,{credits:{get:function(){return this._credits}},waterMask:{get:function(){return this._waterMask}},childTileMask:{get:function(){return this._childTileMask}},canUpsample:{get:function(){return l(this._mesh)}}});var oJ=[];function rJ(e,t,n){oJ.length=e.length;let i=!1;for(let o=0,r=e.length;o<r;++o)oJ[o]=e[o],i=i||o>0&&t(e[o-1],e[o])>0;return i?(oJ.sort(t),Oe.createTypedArray(n,oJ)):e}var GXe="createVerticesFromQuantizedTerrainMesh",Fkt=new qn(GXe),Ikt=new qn(GXe,ru.maximumAsynchronousTasks);XT.prototype.createMesh=function(e){e=e??B.EMPTY_OBJECT;let t=e.tilingScheme,n=e.x,i=e.y,o=e.level,r=e.exaggeration??1,s=e.exaggerationRelativeHeight??0,a=e.throttle??!0,c=t.ellipsoid,d=t.tileXYToRectangle(n,i,o),m=(a?Ikt:Fkt).scheduleTask({minimumHeight:this._minimumHeight,maximumHeight:this._maximumHeight,quantizedVertices:this._quantizedVertices,octEncodedNormals:this._encodedNormals,includeWebMercatorT:!0,indices:this._indices,westIndices:this._westIndices,southIndices:this._southIndices,eastIndices:this._eastIndices,northIndices:this._northIndices,westSkirtHeight:this._westSkirtHeight,southSkirtHeight:this._southSkirtHeight,eastSkirtHeight:this._eastSkirtHeight,northSkirtHeight:this._northSkirtHeight,rectangle:d,relativeToCenter:this._boundingSphere.center,ellipsoid:c,exaggeration:r,exaggerationRelativeHeight:s});if(!l(m))return;let p=this;return Promise.resolve(m).then(function(b){let f=p._quantizedVertices.length/3,y=f+p._westIndices.length+p._southIndices.length+p._eastIndices.length+p._northIndices.length,_=Oe.createTypedArray(y,b.indices),S=new Float32Array(b.vertices),Z=b.center,R=b.minimumHeight,C=b.maximumHeight,E=p._boundingSphere,A=p._orientedBoundingBox,L=h.clone(b.occludeePointInScaledSpace)??p._horizonOcclusionPoint,F=b.vertexStride,I=Cr.clone(b.encoding);return p._mesh=new yc(Z,S,_,b.indexCountWithoutSkirts,f,R,C,d,E,L,F,A,I,b.westIndicesSouthToNorth,b.southIndicesEastToWest,b.eastIndicesNorthToSouth,b.northIndicesWestToEast),p._quantizedVertices=void 0,p._encodedNormals=void 0,p._indices=void 0,p._uValues=void 0,p._vValues=void 0,p._heightValues=void 0,p._westIndices=void 0,p._southIndices=void 0,p._eastIndices=void 0,p._northIndices=void 0,p._mesh})};var Pkt=new qn("upsampleQuantizedTerrainMesh",ru.maximumAsynchronousTasks);XT.prototype.upsample=function(e,t,n,i,o,r,s){let a=this._mesh;if(!l(this._mesh))return;let c=t*2!==o,d=n*2===r,u=e.ellipsoid,m=e.tileXYToRectangle(o,r,s),p=Pkt.scheduleTask({vertices:a.vertices,vertexCountWithoutSkirts:a.vertexCountWithoutSkirts,indices:a.indices,indexCountWithoutSkirts:a.indexCountWithoutSkirts,encoding:a.encoding,minimumHeight:this._minimumHeight,maximumHeight:this._maximumHeight,isEastChild:c,isNorthChild:d,childRectangle:m,ellipsoid:u});if(!l(p))return;let b=Math.min(this._westSkirtHeight,this._eastSkirtHeight);b=Math.min(b,this._southSkirtHeight),b=Math.min(b,this._northSkirtHeight);let f=c?b*.5:this._westSkirtHeight,y=d?b*.5:this._southSkirtHeight,_=c?this._eastSkirtHeight:b*.5,S=d?this._northSkirtHeight:b*.5,Z=this._credits;return Promise.resolve(p).then(function(R){let C=new Uint16Array(R.vertices),E=Oe.createTypedArray(C.length/3,R.indices),A;return l(R.encodedNormals)&&(A=new Uint8Array(R.encodedNormals)),new XT({quantizedVertices:C,indices:E,encodedNormals:A,minimumHeight:R.minimumHeight,maximumHeight:R.maximumHeight,boundingSphere:me.clone(R.boundingSphere),orientedBoundingBox:nn.clone(R.orientedBoundingBox),horizonOcclusionPoint:h.clone(R.horizonOcclusionPoint),westIndices:R.westIndices,southIndices:R.southIndices,eastIndices:R.eastIndices,northIndices:R.northIndices,westSkirtHeight:f,southSkirtHeight:y,eastSkirtHeight:_,northSkirtHeight:S,childTileMask:0,credits:Z,createdByUpsampling:!0})})};var Nse=32767,LXe=new h;XT.prototype.interpolateHeight=function(e,t,n){let i=W.clamp((t-e.west)/e.width,0,1);i*=Nse;let o=W.clamp((n-e.south)/e.height,0,1);return o*=Nse,l(this._mesh)?Mkt(this,i,o):wkt(this,i,o)};function WXe(e,t,n,i,o,r,s,a){let c=Math.min(n,o,s),d=Math.max(n,o,s),u=Math.min(i,r,a),m=Math.max(i,r,a);return e>=c&&e<=d&&t>=u&&t<=m}var Xkt=new k,Nkt=new k,Ykt=new k;function Mkt(e,t,n){let i=e._mesh,o=i.vertices,r=i.encoding,s=i.indices;for(let a=0,c=s.length;a<c;a+=3){let d=s[a],u=s[a+1],m=s[a+2],p=r.decodeTextureCoordinates(o,d,Xkt),b=r.decodeTextureCoordinates(o,u,Nkt),f=r.decodeTextureCoordinates(o,m,Ykt);if(WXe(t,n,p.x,p.y,b.x,b.y,f.x,f.y)){let y=sp.computeBarycentricCoordinates(t,n,p.x,p.y,b.x,b.y,f.x,f.y,LXe);if(y.x>=-1e-15&&y.y>=-1e-15&&y.z>=-1e-15){let _=r.decodeHeight(o,d),S=r.decodeHeight(o,u),Z=r.decodeHeight(o,m);return y.x*_+y.y*S+y.z*Z}}}}function wkt(e,t,n){let i=e._uValues,o=e._vValues,r=e._heightValues,s=e._indices;for(let a=0,c=s.length;a<c;a+=3){let d=s[a],u=s[a+1],m=s[a+2],p=i[d],b=i[u],f=i[m],y=o[d],_=o[u],S=o[m];if(WXe(t,n,p,y,b,_,f,S)){let Z=sp.computeBarycentricCoordinates(t,n,p,y,b,_,f,S,LXe);if(Z.x>=-1e-15&&Z.y>=-1e-15&&Z.z>=-1e-15){let R=Z.x*r[d]+Z.y*r[u]+Z.z*r[m];return W.lerp(e._minimumHeight,e._maximumHeight,R/Nse)}}}}XT.prototype.isChildAvailable=function(e,t,n,i){let o=2;return n!==e*2&&++o,i!==t*2&&(o-=2),(this._childTileMask&1<<o)!==0};XT.prototype.wasCreatedByUpsampling=function(){return this._createdByUpsampling};var GR=XT;function kkt(e){this.resource=e.resource,this.version=e.version,this.isHeightmap=e.isHeightmap,this.tileUrlTemplates=e.tileUrlTemplates,this.availability=e.availability,this.hasVertexNormals=e.hasVertexNormals,this.hasWaterMask=e.hasWaterMask,this.hasMetadata=e.hasMetadata,this.availabilityLevels=e.availabilityLevels,this.availabilityTilesLoaded=e.availabilityTilesLoaded,this.littleEndianExtensionSize=e.littleEndianExtensionSize,this.availabilityPromiseCache={}}function FXe(e){this.requestVertexNormals=e.requestVertexNormals??!1,this.requestWaterMask=e.requestWaterMask??!1,this.requestMetadata=e.requestMetadata??!0,this.ellipsoid=e.ellipsoid??ne.default,this.heightmapWidth=65,this.heightmapStructure=void 0,this.hasWaterMask=!1,this.hasMetadata=!1,this.hasVertexNormals=!1,this.scheme=void 0,this.lastResource=void 0,this.layerJsonResource=void 0,this.previousError=void 0,this.availability=void 0,this.tilingScheme=void 0,this.levelZeroMaximumGeometricError=void 0,this.heightmapStructure=void 0,this.layers=[],this.attribution="",this.overallAvailability=[],this.overallMaxZoom=0,this.tileCredits=[]}FXe.prototype.build=function(e){e._heightmapWidth=this.heightmapWidth,e._scheme=this.scheme;let t=l(this.lastResource.credits)?this.lastResource.credits:[];e._tileCredits=t.concat(this.tileCredits),e._availability=this.availability,e._tilingScheme=this.tilingScheme,e._requestWaterMask=this.requestWaterMask,e._levelZeroMaximumGeometricError=this.levelZeroMaximumGeometricError,e._heightmapStructure=this.heightmapStructure,e._layers=this.layers,e._hasWaterMask=this.hasWaterMask,e._hasVertexNormals=this.hasVertexNormals,e._hasMetadata=this.hasMetadata};async function IXe(e,t,n){if(!t.format){let y="The tile format is not specified in the layer.json file.";throw e.previousError=tr.reportError(e.previousError,n,l(n)?n._errorEvent:void 0,y),new ae(y)}if(!t.tiles||t.tiles.length===0){let y="The layer.json file does not specify any tile URL templates.";throw e.previousError=tr.reportError(e.previousError,n,l(n)?n._errorEvent:void 0,y),new ae(y)}let i=!1,o=!1,r=!1,s=!0,a=!1;if(t.format==="heightmap-1.0")a=!0,l(e.heightmapStructure)||(e.heightmapStructure={heightScale:1/5,heightOffset:-1e3,elementsPerHeight:1,stride:1,elementMultiplier:256,isBigEndian:!1,lowestEncodedHeight:0,highestEncodedHeight:256*256-1}),o=!0,e.requestWaterMask=!0;else if(t.format.indexOf("quantized-mesh-1.")!==0){let y=`The tile format "${t.format}" is invalid or not supported.`;throw e.previousError=tr.reportError(e.previousError,n,l(n)?n._errorEvent:void 0,y),new ae(y)}let c=t.tiles,d=t.maxzoom;if(e.overallMaxZoom=Math.max(e.overallMaxZoom,d),!t.projection||t.projection==="EPSG:4326")e.tilingScheme=new to({numberOfLevelZeroTilesX:2,numberOfLevelZeroTilesY:1,ellipsoid:e.ellipsoid});else if(t.projection==="EPSG:3857")e.tilingScheme=new Xr({numberOfLevelZeroTilesX:1,numberOfLevelZeroTilesY:1,ellipsoid:e.ellipsoid});else{let y=`The projection "${t.projection}" is invalid or not supported.`;throw e.previousError=tr.reportError(e.previousError,n,l(n)?n._errorEvent:void 0,y),new ae(y)}if(e.levelZeroMaximumGeometricError=Qo.getEstimatedLevelZeroGeometricErrorForAHeightmap(e.tilingScheme.ellipsoid,e.heightmapWidth,e.tilingScheme.getNumberOfXTilesAtLevel(0)),!t.scheme||t.scheme==="tms"||t.scheme==="slippyMap")e.scheme=t.scheme;else{let y=`The scheme "${t.scheme}" is invalid or not supported.`;throw e.previousError=tr.reportError(e.previousError,n,l(n)?n._errorEvent:void 0,y),new ae(y)}let u;l(t.extensions)&&t.extensions.indexOf("octvertexnormals")!==-1?i=!0:l(t.extensions)&&t.extensions.indexOf("vertexnormals")!==-1&&(i=!0,s=!1),l(t.extensions)&&t.extensions.indexOf("watermask")!==-1&&(o=!0),l(t.extensions)&&t.extensions.indexOf("metadata")!==-1&&(r=!0);let m=t.metadataAvailability,p=t.available,b;if(l(p)&&!l(m)){b=new rp(e.tilingScheme,p.length);for(let y=0;y<p.length;++y){let _=p[y],S=e.tilingScheme.getNumberOfYTilesAtLevel(y);l(e.overallAvailability[y])||(e.overallAvailability[y]=[]);for(let Z=0;Z<_.length;++Z){let R=_[Z],C=S-R.endY-1,E=S-R.startY-1;e.overallAvailability[y].push([R.startX,C,R.endX,E]),b.addAvailableTileRange(y,R.startX,C,R.endX,E)}}}else l(m)&&(u=new rp(e.tilingScheme,d),b=new rp(e.tilingScheme,d),e.overallAvailability[0]=[[0,0,1,0]],b.addAvailableTileRange(0,0,0,1,0));e.hasWaterMask=e.hasWaterMask||o,e.hasVertexNormals=e.hasVertexNormals||i,e.hasMetadata=e.hasMetadata||r,l(t.attribution)&&(e.attribution.length>0&&(e.attribution+=" "),e.attribution+=t.attribution),e.layers.push(new kkt({resource:e.lastResource,version:t.version,isHeightmap:a,tileUrlTemplates:c,availability:b,hasVertexNormals:i,hasWaterMask:o,hasMetadata:r,availabilityLevels:m,availabilityTilesLoaded:u,littleEndianExtensionSize:s}));let f=t.parentUrl;return l(f)?l(b)?(e.lastResource=e.lastResource.getDerivedResource({url:f}),e.lastResource.appendForwardSlash(),e.layerJsonResource=e.lastResource.getDerivedResource({url:"layer.json"}),await wse(e),!0):(console.log("A layer.json can't have a parentUrl if it does't have an available array."),!0):!0}function Ukt(e,t,n){let i=`An error occurred while accessing ${e.layerJsonResource.url}.`;if(l(t)&&(i+=` -${t.message}`),e.previousError=tr.reportError(e.previousError,n,l(n)?n._errorEvent:void 0,i),e.previousError.retry)return wse(e,n);throw new ae(i)}async function Dkt(e,t,n){await IXe(e,t,n);let i=e.overallAvailability.length;if(i>0){let o=e.availability=new rp(e.tilingScheme,e.overallMaxZoom);for(let r=0;r<i;++r){let s=e.overallAvailability[r];for(let a=0;a<s.length;++a){let c=s[a];o.addAvailableTileRange(r,c[0],c[1],c[2],c[3])}}}if(e.attribution.length>0){let o=new Lt(e.attribution);e.tileCredits.push(o)}return!0}async function wse(e,t){try{let n=await e.layerJsonResource.fetchJson();return Dkt(e,n,t)}catch(n){return l(n)&&n.statusCode===404?(await IXe(e,{tilejson:"2.1.0",format:"heightmap-1.0",version:"1.0.0",scheme:"tms",tiles:["{z}/{x}/{y}.terrain?v={version}"]},t),!0):Ukt(e,n,t)}}function ap(e){e=e??B.EMPTY_OBJECT,this._heightmapWidth=void 0,this._heightmapStructure=void 0,this._hasWaterMask=!1,this._hasVertexNormals=!1,this._hasMetadata=!1,this._scheme=void 0,this._ellipsoid=e.ellipsoid,this._requestVertexNormals=e.requestVertexNormals??!1,this._requestWaterMask=e.requestWaterMask??!1,this._requestMetadata=e.requestMetadata??!0,this._errorEvent=new Se;let t=e.credit;typeof t=="string"&&(t=new Lt(t)),this._credit=t,this._availability=void 0,this._tilingScheme=void 0,this._levelZeroMaximumGeometricError=void 0,this._layers=void 0,this._tileCredits=void 0}var Yse={OCT_VERTEX_NORMALS:1,WATER_MASK:2,METADATA:4};function vXe(e){return!l(e)||e.length===0?{Accept:"application/vnd.quantized-mesh,application/octet-stream;q=0.9,*/*;q=0.01"}:{Accept:`application/vnd.quantized-mesh;extensions=${e.join("-")},application/octet-stream;q=0.9,*/*;q=0.01`}}function Okt(e,t,n,i,o){let r=new Uint16Array(t,0,e._heightmapWidth*e._heightmapWidth);return new wc({buffer:r,childTileMask:new Uint8Array(t,r.byteLength,1)[0],waterMask:new Uint8Array(t,r.byteLength+1,t.byteLength-r.byteLength-1),width:e._heightmapWidth,height:e._heightmapWidth,structure:e._heightmapStructure,credits:e._tileCredits})}function Bkt(e,t,n,i,o,r){let s=r.littleEndianExtensionSize,a=0,c=3,d=c+1,u=Float64Array.BYTES_PER_ELEMENT*c,m=Float64Array.BYTES_PER_ELEMENT*d,b=Uint16Array.BYTES_PER_ELEMENT*3,f=3,y=Uint16Array.BYTES_PER_ELEMENT,_=y*f,S=new DataView(t),Z=new h(S.getFloat64(a,!0),S.getFloat64(a+8,!0),S.getFloat64(a+16,!0));a+=u;let R=S.getFloat32(a,!0);a+=Float32Array.BYTES_PER_ELEMENT;let C=S.getFloat32(a,!0);a+=Float32Array.BYTES_PER_ELEMENT;let E=new me(new h(S.getFloat64(a,!0),S.getFloat64(a+8,!0),S.getFloat64(a+16,!0)),S.getFloat64(a+u,!0));a+=m;let A=new h(S.getFloat64(a,!0),S.getFloat64(a+8,!0),S.getFloat64(a+16,!0));a+=u;let L=S.getUint32(a,!0);a+=Uint32Array.BYTES_PER_ELEMENT;let F=new Uint16Array(t,a,L*3);a+=L*b,L>64*1024&&(y=Uint32Array.BYTES_PER_ELEMENT,_=y*f);let I=F.subarray(0,L),N=F.subarray(L,2*L),g=F.subarray(L*2,3*L);dn.zigZagDeltaDecode(I,N,g),a%y!==0&&(a+=y-a%y);let V=S.getUint32(a,!0);a+=Uint32Array.BYTES_PER_ELEMENT;let G=Oe.createTypedArrayFromArrayBuffer(L,t,a,V*f);a+=V*_;let v=0,X=G.length;for(let he=0;he<X;++he){let Ze=G[he];G[he]=v-Ze,Ze===0&&++v}let Y=S.getUint32(a,!0);a+=Uint32Array.BYTES_PER_ELEMENT;let D=Oe.createTypedArrayFromArrayBuffer(L,t,a,Y);a+=Y*y;let M=S.getUint32(a,!0);a+=Uint32Array.BYTES_PER_ELEMENT;let O=Oe.createTypedArrayFromArrayBuffer(L,t,a,M);a+=M*y;let w=S.getUint32(a,!0);a+=Uint32Array.BYTES_PER_ELEMENT;let z=Oe.createTypedArrayFromArrayBuffer(L,t,a,w);a+=w*y;let K=S.getUint32(a,!0);a+=Uint32Array.BYTES_PER_ELEMENT;let te=Oe.createTypedArrayFromArrayBuffer(L,t,a,K);a+=K*y;let H,$;for(;a<S.byteLength;){let he=S.getUint8(a,!0);a+=Uint8Array.BYTES_PER_ELEMENT;let Ze=S.getUint32(a,s);if(a+=Uint32Array.BYTES_PER_ELEMENT,he===Yse.OCT_VERTEX_NORMALS&&e._requestVertexNormals)H=new Uint8Array(t,a,L*2);else if(he===Yse.WATER_MASK&&e._requestWaterMask)$=new Uint8Array(t,a,Ze);else if(he===Yse.METADATA&&e._requestMetadata){let ye=S.getUint32(a,!0);if(ye>0){let Ae=vr(new Uint8Array(t),a+Uint32Array.BYTES_PER_ELEMENT,ye).available;if(l(Ae))for(let Fe=0;Fe<Ae.length;++Fe){let tt=n+Fe+1,Be=Ae[Fe],je=e._tilingScheme.getNumberOfYTilesAtLevel(tt);for(let qe=0;qe<Be.length;++qe){let We=Be[qe],Ke=je-We.endY-1,ct=je-We.startY-1;e.availability.addAvailableTileRange(tt,We.startX,Ke,We.endX,ct),r.availability.addAvailableTileRange(tt,We.startX,Ke,We.endX,ct)}}}r.availabilityTilesLoaded.addAvailableTileRange(n,i,o,i,o)}a+=Ze}let ee=e.getLevelMaximumGeometricError(n)*5,le=e._tilingScheme.tileXYToRectangle(i,o,n),_e=nn.fromRectangle(le,R,C,e._tilingScheme.ellipsoid);return new GR({center:Z,minimumHeight:R,maximumHeight:C,boundingSphere:E,orientedBoundingBox:_e,horizonOcclusionPoint:A,quantizedVertices:F,encodedNormals:H,indices:G,westIndices:D,southIndices:O,eastIndices:z,northIndices:te,westSkirtHeight:ee,southSkirtHeight:ee,eastSkirtHeight:ee,northSkirtHeight:ee,childTileMask:e.availability.computeChildMaskForTile(n,i,o),waterMask:$,credits:e._tileCredits})}ap.prototype.requestTileGeometry=function(e,t,n,i){let o=this._layers,r,s=o.length,a=!1,c=Promise.resolve();if(s===1)r=o[0];else for(let d=0;d<s;++d){let u=o[d];if(!l(u.availability)||u.availability.isTileAvailable(n,e,t)){r=u;break}let m=kse(this,e,t,n,u,d===0);m.result&&(a=!0,c=c.then(()=>m.promise))}return!l(r)&&a?c.then(()=>new Promise(d=>{setTimeout(()=>{let u=this.requestTileGeometry(e,t,n,i);d(u)},0)})):PXe(this,e,t,n,r,i)};function PXe(e,t,n,i,o,r){if(!l(o))return Promise.reject(new ae("Terrain tile doesn't exist"));let s=o.tileUrlTemplates;if(s.length===0)return;let a;!e._scheme||e._scheme==="tms"?a=e._tilingScheme.getNumberOfYTilesAtLevel(i)-n-1:a=n;let c=[];e._requestVertexNormals&&o.hasVertexNormals&&c.push(o.littleEndianExtensionSize?"octvertexnormals":"vertexnormals"),e._requestWaterMask&&o.hasWaterMask&&c.push("watermask"),e._requestMetadata&&o.hasMetadata&&c.push("metadata");let d,u,m=s[(t+a+i)%s.length],p=o.resource;l(p._ionEndpoint)&&!l(p._ionEndpoint.externalType)?(c.length!==0&&(u={extensions:c.join("-")}),d=vXe(void 0)):d=vXe(c);let b=p.getDerivedResource({url:m,templateValues:{version:o.version,z:i,x:t,y:a},queryParameters:u,headers:d,request:r}).fetchArrayBuffer();if(l(b))return b.then(function(f){return l(f)?l(e._heightmapStructure)?Okt(e,f,i,t,n):Bkt(e,f,i,t,n,o):Promise.reject(new ae("Mesh buffer doesn't exist."))})}Object.defineProperties(ap.prototype,{errorEvent:{get:function(){return this._errorEvent}},credit:{get:function(){return this._credit}},tilingScheme:{get:function(){return this._tilingScheme}},hasWaterMask:{get:function(){return this._hasWaterMask&&this._requestWaterMask}},hasVertexNormals:{get:function(){return this._hasVertexNormals&&this._requestVertexNormals}},hasMetadata:{get:function(){return this._hasMetadata&&this._requestMetadata}},requestVertexNormals:{get:function(){return this._requestVertexNormals}},requestWaterMask:{get:function(){return this._requestWaterMask}},requestMetadata:{get:function(){return this._requestMetadata}},availability:{get:function(){return this._availability}}});ap.prototype.getLevelMaximumGeometricError=function(e){return this._levelZeroMaximumGeometricError/(1<<e)};ap.fromIonAssetId=async function(e,t){let n=await Ur.fromAssetId(e);return ap.fromUrl(n,t)};ap.fromUrl=async function(e,t){t=t??B.EMPTY_OBJECT,e=await Promise.resolve(e);let n=ve.createIfNeeded(e);n.appendForwardSlash();let i=new FXe(t);i.lastResource=n,i.layerJsonResource=i.lastResource.getDerivedResource({url:"layer.json"}),await wse(i);let o=new ap(t);return i.build(o),o};ap.prototype.getTileDataAvailable=function(e,t,n){if(!l(this._availability))return;if(n>this._availability._maximumLevel)return!1;if(this._availability.isTileAvailable(n,e,t))return!0;if(!this._hasMetadata)return!1;let i=this._layers,o=i.length;for(let r=0;r<o;++r)if(kse(this,e,t,n,i[r],r===0).result)return;return!1};ap.prototype.loadTileDataAvailability=function(e,t,n){if(!l(this._availability)||n>this._availability._maximumLevel||this._availability.isTileAvailable(n,e,t)||!this._hasMetadata)return;let i=this._layers,o=i.length;for(let r=0;r<o;++r){let s=kse(this,e,t,n,i[r],r===0);if(l(s.promise))return s.promise}};function Mse(e,t,n,i){if(i===0)return;let o=e.availabilityLevels,r=i%o===0?i-o:(i/o|0)*o,s=1<<i-r,a=t/s|0,c=n/s|0;return{level:r,x:a,y:c}}function kse(e,t,n,i,o,r){if(!l(o.availabilityLevels))return{result:!1};let s,a=function(){delete o.availabilityPromiseCache[s]},c=o.availabilityTilesLoaded,d=o.availability,u=Mse(o,t,n,i);for(;l(u);){if(d.isTileAvailable(u.level,u.x,u.y)&&!c.isTileAvailable(u.level,u.x,u.y)){let m;if(!r&&(s=`${u.level}-${u.x}-${u.y}`,m=o.availabilityPromiseCache[s],!l(m))){let p=new Ar({throttle:!1,throttleByServer:!0,type:js.TERRAIN});m=PXe(e,u.x,u.y,u.level,o,p),l(m)&&(o.availabilityPromiseCache[s]=m,m.then(a))}return{result:!0,promise:m}}u=Mse(o,u.x,u.y,u.level)}return{result:!1}}ap._getAvailabilityTile=Mse;var LR=ap;var Mvo=x(T(),1);function my(e){e=e??B.EMPTY_OBJECT;let t=e.radius,n={center:e.center,semiMajorAxis:t,semiMinorAxis:t,ellipsoid:e.ellipsoid,height:e.height,extrudedHeight:e.extrudedHeight,granularity:e.granularity,vertexFormat:e.vertexFormat,stRotation:e.stRotation,shadowVolume:e.shadowVolume};this._ellipseGeometry=new ud(n),this._workerName="createCircleGeometry"}my.packedLength=ud.packedLength;my.pack=function(e,t,n){return ud.pack(e._ellipseGeometry,t,n)};var XXe=new ud({center:new h,semiMajorAxis:1,semiMinorAxis:1}),Uc={center:new h,radius:void 0,ellipsoid:ne.clone(ne.default),height:void 0,extrudedHeight:void 0,granularity:void 0,vertexFormat:new Me,stRotation:void 0,semiMajorAxis:void 0,semiMinorAxis:void 0,shadowVolume:void 0};my.unpack=function(e,t,n){let i=ud.unpack(e,t,XXe);return Uc.center=h.clone(i._center,Uc.center),Uc.ellipsoid=ne.clone(i._ellipsoid,Uc.ellipsoid),Uc.ellipsoid=ne.clone(i._ellipsoid,XXe._ellipsoid),Uc.height=i._height,Uc.extrudedHeight=i._extrudedHeight,Uc.granularity=i._granularity,Uc.vertexFormat=Me.clone(i._vertexFormat,Uc.vertexFormat),Uc.stRotation=i._stRotation,Uc.shadowVolume=i._shadowVolume,l(n)?(Uc.semiMajorAxis=i._semiMajorAxis,Uc.semiMinorAxis=i._semiMinorAxis,n._ellipseGeometry=new ud(Uc),n):(Uc.radius=i._semiMajorAxis,new my(Uc))};my.createGeometry=function(e){return ud.createGeometry(e._ellipseGeometry)};my.createShadowVolume=function(e,t,n){let i=e._ellipseGeometry._granularity,o=e._ellipseGeometry._ellipsoid,r=t(i,o),s=n(i,o);return new my({center:e._ellipseGeometry._center,radius:e._ellipseGeometry._semiMajorAxis,ellipsoid:o,stRotation:e._ellipseGeometry._stRotation,granularity:i,extrudedHeight:r,height:s,vertexFormat:Me.POSITION_ONLY,shadowVolume:!0})};Object.defineProperties(my.prototype,{rectangle:{get:function(){return this._ellipseGeometry.rectangle}},textureCoordinateRotationPoints:{get:function(){return this._ellipseGeometry.textureCoordinateRotationPoints}}});var Use=my;var zvo=x(T(),1);function RA(e){e=e??B.EMPTY_OBJECT;let t=e.radius,n={center:e.center,semiMajorAxis:t,semiMinorAxis:t,ellipsoid:e.ellipsoid,height:e.height,extrudedHeight:e.extrudedHeight,granularity:e.granularity,numberOfVerticalLines:e.numberOfVerticalLines};this._ellipseGeometry=new ju(n),this._workerName="createCircleOutlineGeometry"}RA.packedLength=ju.packedLength;RA.pack=function(e,t,n){return ju.pack(e._ellipseGeometry,t,n)};var zkt=new ju({center:new h,semiMajorAxis:1,semiMinorAxis:1}),mm={center:new h,radius:void 0,ellipsoid:ne.clone(ne.UNIT_SPHERE),height:void 0,extrudedHeight:void 0,granularity:void 0,numberOfVerticalLines:void 0,semiMajorAxis:void 0,semiMinorAxis:void 0};RA.unpack=function(e,t,n){let i=ju.unpack(e,t,zkt);return mm.center=h.clone(i._center,mm.center),mm.ellipsoid=ne.clone(i._ellipsoid,mm.ellipsoid),mm.height=i._height,mm.extrudedHeight=i._extrudedHeight,mm.granularity=i._granularity,mm.numberOfVerticalLines=i._numberOfVerticalLines,l(n)?(mm.semiMajorAxis=i._semiMajorAxis,mm.semiMinorAxis=i._semiMinorAxis,n._ellipseGeometry=new ju(mm),n):(mm.radius=i._semiMajorAxis,new RA(mm))};RA.createGeometry=function(e){return ju.createGeometry(e._ellipseGeometry)};var Dse=RA;var jvo=x(T(),1);function Hkt(e){return e=e??B.EMPTY_OBJECT,LR.fromIonAssetId(2426648,{requestVertexNormals:e.requestVertexNormals??!1})}var TU=Hkt;var t2o=x(T(),1);function Kkt(e){return e=e??B.EMPTY_OBJECT,LR.fromIonAssetId(1,{requestVertexNormals:e.requestVertexNormals??!1,requestWaterMask:e.requestWaterMask??!1,ellipsoid:ne.WGS84})}var WR=Kkt;var u2o=x(T(),1);function CA(e){e=e??B.EMPTY_OBJECT,this._callback=e.callback,this._tilingScheme=e.tilingScheme,l(this._tilingScheme)||(this._tilingScheme=new to({ellipsoid:e.ellipsoid??ne.default})),this._width=e.width,this._height=e.height;let t=Math.max(this._width,this._height);this._levelZeroMaximumGeometricError=Qo.getEstimatedLevelZeroGeometricErrorForAHeightmap(this._tilingScheme.ellipsoid,t,this._tilingScheme.getNumberOfXTilesAtLevel(0)),this._errorEvent=new Se;let n=e.credit;typeof n=="string"&&(n=new Lt(n)),this._credit=n}Object.defineProperties(CA.prototype,{errorEvent:{get:function(){return this._errorEvent}},credit:{get:function(){return this._credit}},tilingScheme:{get:function(){return this._tilingScheme}},hasWaterMask:{get:function(){return!1}},hasVertexNormals:{get:function(){return!1}},availability:{get:function(){}},width:{get:function(){return this._width}},height:{get:function(){return this._height}}});CA.prototype.requestTileGeometry=function(e,t,n,i){let o=this._callback(e,t,n);if(!l(o))return;let r=this._width,s=this._height;return Promise.resolve(o).then(function(a){let c=a;return Array.isArray(c)&&(c=new Float64Array(c)),new wc({buffer:c,width:r,height:s})})};CA.prototype.getLevelMaximumGeometricError=function(e){return this._levelZeroMaximumGeometricError/(1<<e)};CA.prototype.getTileDataAvailable=function(e,t,n){};CA.prototype.loadTileDataAvailability=function(e,t,n){};var Ose=CA;var f2o=x(T(),1);var Jkt=1953029805,jkt=2917034100;function Bse(e,t){if(Bse.passThroughDataForTesting)return t;let n=e.byteLength;if(n===0||n%4!==0)throw new ae("The length of key must be greater than 0 and a multiple of 4.");let i=new DataView(t),o=i.getUint32(0,!0);if(o===Jkt||o===jkt)return t;let r=new DataView(e),s=0,a=t.byteLength,c=a-a%8,d=n,u,m=8;for(;s<c;)for(m=(m+8)%24,u=m;s<c&&u<d;)i.setUint32(s,i.getUint32(s,!0)^r.getUint32(u,!0),!0),i.setUint32(s+4,i.getUint32(s+4,!0)^r.getUint32(u+4,!0),!0),s+=8,u+=24;if(s<a)for(u>=d&&(m=(m+8)%24,u=m);s<a;)i.setUint8(s,i.getUint8(s)^r.getUint8(u)),s++,u++}Bse.passThroughDataForTesting=!1;var _U=Bse;var b2o=x(T(),1);function NXe(e){this.proxy=e}NXe.prototype.getURL=function(e){let t=this.proxy.indexOf("?")===-1?"?":"";return this.proxy+t+encodeURIComponent(e)};var zse=NXe;var _2o=x(T(),1);function sJ(){ge.throwInstantiationError()}Object.defineProperties(sJ.prototype,{credit:{get:ge.throwInstantiationError}});sJ.getCreditsFromResult=function(e){if(l(e.attributions))return e.attributions.map(Lt.getIonCredit)};sJ.prototype.geocode=ge.throwInstantiationError;var VA=sJ;var Z2o=x(T(),1),YXe={SEARCH:0,AUTOCOMPLETE:1};Object.freeze(YXe);var NT=YXe;var V2o=x(T(),1);function MXe(){ge.throwInstantiationError()}MXe.createGeometry=function(e){ge.throwInstantiationError()};var Hse=MXe;var H2o=x(T(),1),nUt=x(Kse(),1);var I2o=x(T(),1);var L2o=x(T(),1);function Qkt(e,t){return(e&t)!==0}var Vl=Qkt;var qkt=[1,2,4,8],wXe=15,$kt=16,eUt=64,tUt=128;function O0(e,t,n,i,o,r){this._bits=e,this.cnodeVersion=t,this.imageryVersion=n,this.terrainVersion=i,this.imageryProvider=o,this.terrainProvider=r,this.ancestorHasTerrain=!1,this.terrainState=void 0}O0.clone=function(e,t){return l(t)?(t._bits=e._bits,t.cnodeVersion=e.cnodeVersion,t.imageryVersion=e.imageryVersion,t.terrainVersion=e.terrainVersion,t.imageryProvider=e.imageryProvider,t.terrainProvider=e.terrainProvider):t=new O0(e._bits,e.cnodeVersion,e.imageryVersion,e.terrainVersion,e.imageryProvider,e.terrainProvider),t.ancestorHasTerrain=e.ancestorHasTerrain,t.terrainState=e.terrainState,t};O0.prototype.setParent=function(e){this.ancestorHasTerrain=e.ancestorHasTerrain||this.hasTerrain()};O0.prototype.hasSubtree=function(){return Vl(this._bits,$kt)};O0.prototype.hasImagery=function(){return Vl(this._bits,eUt)};O0.prototype.hasTerrain=function(){return Vl(this._bits,tUt)};O0.prototype.hasChildren=function(){return Vl(this._bits,wXe)};O0.prototype.hasChild=function(e){return Vl(this._bits,qkt[e])};O0.prototype.getChildBitmask=function(){return this._bits&wXe};var ZU=O0;function iUt(e){let t=e.length,n=new ArrayBuffer(t),i=new Uint8Array(n);for(let o=0;o<t;++o)i[o]=e.charCodeAt(o);return n}var oUt=iUt(`E\xF4\xBD\vy\xE2jE"\x92,\xCDq\xF8IFgQ\0B%\xC6\xE8a,f)\b\xC64\xDCjb%y -wmi\xD6\xF0\x9Ck\x93\xA1\xBDNu\xE0A[\xDF@V\f\xD9\xBBr\x9B\x81|3S\xEEOl\xD4q\x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xC0)=R\xD3aX\xA9}e\xB4\xDC\xCF\r\xF4=\xF1\b\xA9B\xDA# \xD8\xBF^PI\xF8M\xC0\xCBGLO\xF7{+\xD8\xC51\x92;\xB5o\xDCl\r\x92\x88\xD1\x9E\xDB?\xE2\xE9\xDA_\xD4\x84\xE2FaZ\xDEU\xCF\xA4\0\xBE\xFD\xCEg\xF1Ji\x97\xE6 H\xD8]\x7F~\xAEq N\xAE\xC0V\xA9\x91<\x82r\xE7v\xEC)I\xD6]-\x83\xE3\xDB6\xA9;f\x97\x87j\xD5\xB6=P^R\xB9K\xC7sWx\xC9\xF4.Y\x07\x95\x93o\xD0KW>''\xC7\`\xDB;\xED\x9ASD>?\x8D\x92mw\xA2 -\xEB?R\xA8\xC6U^1I7\x85\xF4\xC5&-\xA9\xBF\x8B'T\xDA\xC3j \xE5*x\xB0\xD6\x90pr\xAA\x8Bh\xBD\x88\xF7_H\xB1~\xC0XL?f\xF9>\xE1e\xC0p\xA7\xCF8i\xAF\xF0VldI\x9C'\xADxtO\xC2\x87\xDEV9\0\xDAw\v\xCB-\x1B\x89\xFB5O\xF5\bQ\`\xC1 -ZGM&30x\xDA\xC0\x9CFG\xE2[y\`In7gS ->\xE9\xECF9\xB2\xF14\r\xC6\x84Sun\xE1\fY\xD9\xDE)\x85{II\xA5wy\xBEIV.6\xE7\v:\xBBOb{\xD2M1\x95/\xBD8{\xA8O!\xE1\xECFpv\x95})"x\x88 -\x90\xDD\x9D\\\xDA\xDEQ\xCF\xF0\xFCYRe|3\xDF\xF3H\xDA\xBB*u\xDB\`\xB2\xD4\xFC\xED\x1B\xEC\x7F5\xA8\xFF(1\x07-\xC8\xDC\x88F|\x8A["`);function hm(e){this.imageryPresent=!0,this.protoImagery=void 0,this.terrainPresent=!0,this.negativeAltitudeExponentBias=32,this.negativeAltitudeThreshold=W.EPSILON12,this.providers={},this.key=void 0,this._resource=void 0,this._quadPacketVersion=1,this._tileInfo={},this._subtreePromises={}}Object.defineProperties(hm.prototype,{url:{get:function(){return this._resource.url}},proxy:{get:function(){return this._resource.proxy}},resource:{get:function(){return this._resource}}});hm.fromUrl=async function(e){let t=e;typeof t!="string"&&!(t instanceof ve)&&(t=e.url);let n=ve.createIfNeeded(t);n.appendForwardSlash();let i=new hm;i._resource=n;try{await rUt(i),await i.getQuadTreePacket("",i._quadPacketVersion)}catch(o){let r=`An error occurred while accessing ${UXe(i,"",1).url}: ${o}`;throw new ae(r)}return i};hm.tileXYToQuadKey=function(e,t,n){let i="";for(let o=n;o>=0;--o){let r=1<<o,s=0;Vl(t,r)?Vl(e,r)&&(s|=1):(s|=2,Vl(e,r)||(s|=1)),i+=s}return i};hm.quadKeyToTileXY=function(e){let t=0,n=0,i=e.length-1;for(let o=i;o>=0;--o){let r=1<<o,s=+e[i-o];Vl(s,2)?Vl(s,1)||(t|=r):(n|=r,Vl(s,1)&&(t|=r))}return{x:t,y:n,level:i}};hm.prototype.isValid=function(e){let t=this.getTileInformationFromQuadKey(e);if(l(t))return t!==null;let n=!0,i=e,o;for(;i.length>1;)if(o=i.substring(i.length-1),i=i.substring(0,i.length-1),t=this.getTileInformationFromQuadKey(i),l(t)){!t.hasSubtree()&&!t.hasChild(parseInt(o))&&(n=!1);break}else if(t===null){n=!1;break}return n};var kXe=new qn("decodeGoogleEarthEnterprisePacket");hm.prototype.getQuadTreePacket=function(e,t,n){t=t??1,e=e??"";let o=UXe(this,e,t,n).fetchArrayBuffer();if(!l(o))return;let r=this._tileInfo,s=this.key;return o.then(function(a){return kXe.scheduleTask({buffer:a,quadKey:e,type:"Metadata",key:s},[a]).then(function(d){let u,m=-1;if(e!==""){m=e.length+1;let f=d[e];u=r[e],u._bits|=f._bits,delete d[e]}let p=Object.keys(d);p.sort(function(f,y){return f.length-y.length});let b=p.length;for(let f=0;f<b;++f){let y=p[f];if(d[y]!==null){let S=ZU.clone(d[y]),Z=y.length;if(Z===m)S.setParent(u);else if(Z>1){let R=r[y.substring(0,y.length-1)];S.setParent(R)}r[y]=S}else r[y]=null}})})};hm.prototype.populateSubtree=function(e,t,n,i){let o=hm.tileXYToQuadKey(e,t,n);return Qse(this,o,i)};function Qse(e,t,n){let i=e._tileInfo,o=t,r=i[o];if(l(r)&&(!r.hasSubtree()||r.hasChildren()))return r;for(;r===void 0&&o.length>1;)o=o.substring(0,o.length-1),r=i[o];let s,a=e._subtreePromises,c=a[o];if(l(c))return c.then(function(){return s=new Ar({throttle:n.throttle,throttleByServer:n.throttleByServer,type:n.type,priorityFunction:n.priorityFunction}),Qse(e,t,s)});if(!l(r)||!r.hasSubtree())return Promise.reject(new ae(`Couldn't load metadata for tile ${t}`));if(c=e.getQuadTreePacket(o,r.cnodeVersion,n),!!l(c))return a[o]=c,c.then(function(){return s=new Ar({throttle:n.throttle,throttleByServer:n.throttleByServer,type:n.type,priorityFunction:n.priorityFunction}),Qse(e,t,s)}).finally(function(){delete a[o]})}hm.prototype.getTileInformation=function(e,t,n){let i=hm.tileXYToQuadKey(e,t,n);return this._tileInfo[i]};hm.prototype.getTileInformationFromQuadKey=function(e){return this._tileInfo[e]};function UXe(e,t,n,i){return e._resource.getDerivedResource({url:`flatfile?q2-0${t}-q.${n.toString()}`,request:i})}var Jse,jse;function rUt(e){let t=e._resource.getDerivedResource({url:"dbRoot.v5",queryParameters:{output:"proto"}});if(!l(jse)){let n=en("ThirdParty/google-earth-dbroot-parser.js"),i=window.cesiumGoogleEarthDbRootParser;jse=$T(n).then(function(){Jse=window.cesiumGoogleEarthDbRootParser(nUt),l(i)?window.cesiumGoogleEarthDbRootParser=i:delete window.cesiumGoogleEarthDbRootParser})}return jse.then(function(){return t.fetchArrayBuffer()}).then(function(n){let i=Jse.EncryptedDbRootProto.decode(new Uint8Array(n)),o=i.encryptionData,r=o.byteOffset,s=r+o.byteLength,a=e.key=o.buffer.slice(r,s);o=i.dbrootData,r=o.byteOffset,s=r+o.byteLength;let c=o.buffer.slice(r,s);return kXe.scheduleTask({buffer:c,type:"DbRoot",key:a},[c])}).then(function(n){let i=Jse.DbRootProto.decode(new Uint8Array(n.buffer));if(e.imageryPresent=i.imageryPresent??e.imageryPresent,e.protoImagery=i.protoImagery,e.terrainPresent=i.terrainPresent??e.terrainPresent,l(i.endSnippet)&&l(i.endSnippet.model)){let a=i.endSnippet.model;e.negativeAltitudeExponentBias=a.negativeAltitudeExponentBias??e.negativeAltitudeExponentBias,e.negativeAltitudeThreshold=a.compressedNegativeAltitudeThreshold??e.negativeAltitudeThreshold}l(i.databaseVersion)&&(e._quadPacketVersion=i.databaseVersion.quadtreeVersion??e._quadPacketVersion);let o=e.providers,r=i.providerInfo??[],s=r.length;for(let a=0;a<s;++a){let c=r[a],d=c.copyrightString;l(d)&&(o[c.providerId]=new Lt(d.value))}}).catch(function(){console.log(`Failed to retrieve ${t.url}. Using defaults.`),e.key=oUt})}var hy=hm;var dFo=x(T(),1);function vR(e){e=e??B.EMPTY_OBJECT,this._buffer=e.buffer,this._credits=e.credits,this._negativeAltitudeExponentBias=e.negativeAltitudeExponentBias,this._negativeElevationThreshold=e.negativeElevationThreshold;let t=e.childTileMask??15,n=t&3;n|=t&4?8:0,n|=t&8?4:0,this._childTileMask=n,this._createdByUpsampling=e.createdByUpsampling??!1,this._skirtHeight=void 0,this._bufferType=this._buffer.constructor,this._mesh=void 0,this._minimumHeight=void 0,this._maximumHeight=void 0}Object.defineProperties(vR.prototype,{credits:{get:function(){return this._credits}},waterMask:{get:function(){}}});var BXe="createVerticesFromGoogleEarthEnterpriseBuffer",sUt=new qn(BXe),aUt=new qn(BXe,ru.maximumAsynchronousTasks),DXe=new re,aJ=new re;vR.prototype.createMesh=function(e){e=e??B.EMPTY_OBJECT;let t=e.tilingScheme,n=e.x,i=e.y,o=e.level,r=e.exaggeration??1,s=e.exaggerationRelativeHeight??0,a=e.throttle??!0,c=t.ellipsoid;t.tileXYToNativeRectangle(n,i,o,DXe),t.tileXYToRectangle(n,i,o,aJ);let d=c.cartographicToCartesian(re.center(aJ)),m=40075.16/(1<<o);this._skirtHeight=Math.min(m*8,1e3);let b=(a?aUt:sUt).scheduleTask({buffer:this._buffer,nativeRectangle:DXe,rectangle:aJ,relativeToCenter:d,ellipsoid:c,skirtHeight:this._skirtHeight,exaggeration:r,exaggerationRelativeHeight:s,includeWebMercatorT:!0,negativeAltitudeExponentBias:this._negativeAltitudeExponentBias,negativeElevationThreshold:this._negativeElevationThreshold});if(!l(b))return;let f=this;return b.then(function(y){return f._mesh=new yc(d,new Float32Array(y.vertices),new Uint16Array(y.indices),y.indexCountWithoutSkirts,y.vertexCountWithoutSkirts,y.minimumHeight,y.maximumHeight,aJ,me.clone(y.boundingSphere3D),h.clone(y.occludeePointInScaledSpace),y.numberOfAttributes,nn.clone(y.orientedBoundingBox),Cr.clone(y.encoding),y.westIndicesSouthToNorth,y.southIndicesEastToWest,y.eastIndicesNorthToSouth,y.northIndicesWestToEast),f._minimumHeight=y.minimumHeight,f._maximumHeight=y.maximumHeight,f._buffer=void 0,f._mesh})};vR.prototype.interpolateHeight=function(e,t,n){let i=W.clamp((t-e.west)/e.width,0,1),o=W.clamp((n-e.south)/e.height,0,1);return l(this._mesh)?mUt(this,i,o):pUt(this,i,o,e)};var cUt=new qn("upsampleQuantizedTerrainMesh",ru.maximumAsynchronousTasks);vR.prototype.upsample=function(e,t,n,i,o,r,s){let a=this._mesh;if(!l(this._mesh))return;let c=t*2!==o,d=n*2===r,u=e.ellipsoid,m=e.tileXYToRectangle(o,r,s),p=cUt.scheduleTask({vertices:a.vertices,indices:a.indices,indexCountWithoutSkirts:a.indexCountWithoutSkirts,vertexCountWithoutSkirts:a.vertexCountWithoutSkirts,encoding:a.encoding,minimumHeight:this._minimumHeight,maximumHeight:this._maximumHeight,isEastChild:c,isNorthChild:d,childRectangle:m,ellipsoid:u});if(!l(p))return;let b=this;return p.then(function(f){let y=new Uint16Array(f.vertices),_=Oe.createTypedArray(y.length/3,f.indices),S=b._skirtHeight;return new GR({quantizedVertices:y,indices:_,minimumHeight:f.minimumHeight,maximumHeight:f.maximumHeight,boundingSphere:me.clone(f.boundingSphere),orientedBoundingBox:nn.clone(f.orientedBoundingBox),horizonOcclusionPoint:h.clone(f.horizonOcclusionPoint),westIndices:f.westIndices,southIndices:f.southIndices,eastIndices:f.eastIndices,northIndices:f.northIndices,westSkirtHeight:S,southSkirtHeight:S,eastSkirtHeight:S,northSkirtHeight:S,childTileMask:0,createdByUpsampling:!0,credits:b._credits})})};vR.prototype.isChildAvailable=function(e,t,n,i){let o=2;return n!==e*2&&++o,i!==t*2&&(o-=2),(this._childTileMask&1<<o)!==0};vR.prototype.wasCreatedByUpsampling=function(){return this._createdByUpsampling};var lUt=new k,dUt=new k,uUt=new k,zXe=new h;function mUt(e,t,n){let i=e._mesh,o=i.vertices,r=i.encoding,s=i.indices;for(let a=0,c=s.length;a<c;a+=3){let d=s[a],u=s[a+1],m=s[a+2],p=r.decodeTextureCoordinates(o,d,lUt),b=r.decodeTextureCoordinates(o,u,dUt),f=r.decodeTextureCoordinates(o,m,uUt),y=sp.computeBarycentricCoordinates(t,n,p.x,p.y,b.x,b.y,f.x,f.y,zXe);if(y.x>=-1e-15&&y.y>=-1e-15&&y.z>=-1e-15){let _=r.decodeHeight(o,d),S=r.decodeHeight(o,u),Z=r.decodeHeight(o,m);return y.x*_+y.y*S+y.z*Z}}}var hUt=Uint16Array.BYTES_PER_ELEMENT,OXe=Uint32Array.BYTES_PER_ELEMENT,qse=Int32Array.BYTES_PER_ELEMENT,fUt=Float32Array.BYTES_PER_ELEMENT,$se=Float64Array.BYTES_PER_ELEMENT;function pUt(e,t,n,i){let o=e._buffer,r=0,s=0,a=0;n>.5?(t>.5?(r=2,s=.5):r=3,a=.5):t>.5&&(r=1,s=.5);let c=new DataView(o),d=0;for(let E=0;E<r;++E)d+=c.getUint32(d,!0),d+=OXe;d+=OXe,d+=2*$se;let u=W.toRadians(c.getFloat64(d,!0)*180);d+=$se;let m=W.toRadians(c.getFloat64(d,!0)*180);d+=$se;let p=i.width/u/2,b=i.height/m/2,f=c.getInt32(d,!0);d+=qse;let y=c.getInt32(d,!0)*3;d+=qse,d+=qse;let _=new Array(f),S=new Array(f),Z=new Array(f),R;for(R=0;R<f;++R)_[R]=s+c.getUint8(d++)*p,S[R]=a+c.getUint8(d++)*b,Z[R]=c.getFloat32(d,!0)*6371010,d+=fUt;let C=new Array(y);for(R=0;R<y;++R)C[R]=c.getUint16(d,!0),d+=hUt;for(R=0;R<y;R+=3){let E=C[R],A=C[R+1],L=C[R+2],F=_[E],I=_[A],N=_[L],g=S[E],V=S[A],G=S[L],v=sp.computeBarycentricCoordinates(t,n,F,g,I,V,N,G,zXe);if(v.x>=-1e-15&&v.y>=-1e-15&&v.z>=-1e-15)return v.x*Z[E]+v.y*Z[A]+v.z*Z[L]}}var EA=vR;var AFo=x(T(),1);var Eh={UNKNOWN:0,NONE:1,SELF:2,PARENT:3},cJ=new Q;function lJ(){this._terrainCache={},this._lastTidy=Q.now()}lJ.prototype.add=function(e,t){this._terrainCache[e]={buffer:t,timestamp:Q.now()}};lJ.prototype.get=function(e){let n=this._terrainCache[e];if(l(n))return delete this._terrainCache[e],n.buffer};lJ.prototype.tidy=function(){if(Q.now(cJ),Q.secondsDifference(cJ,this._lastTidy)>10){let e=this._terrainCache,t=Object.keys(e),n=t.length;for(let i=0;i<n;++i){let o=t[i],r=e[o];Q.secondsDifference(cJ,r.timestamp)>10&&delete e[o]}Q.clone(cJ,this._lastTidy)}};function YT(e){e=e??B.EMPTY_OBJECT,this._tilingScheme=new to({numberOfLevelZeroTilesX:2,numberOfLevelZeroTilesY:2,rectangle:new re(-W.PI,-W.PI,W.PI,W.PI),ellipsoid:e.ellipsoid});let t=e.credit;typeof t=="string"&&(t=new Lt(t)),this._credit=t,this._levelZeroMaximumGeometricError=40075.16,this._terrainCache=new lJ,this._terrainPromises={},this._terrainRequests={},this._errorEvent=new Se}Object.defineProperties(YT.prototype,{url:{get:function(){return this._metadata.url}},proxy:{get:function(){return this._metadata.proxy}},tilingScheme:{get:function(){return this._tilingScheme}},errorEvent:{get:function(){return this._errorEvent}},credit:{get:function(){return this._credit}},hasWaterMask:{get:function(){return!1}},hasVertexNormals:{get:function(){return!1}},availability:{get:function(){}}});YT.fromMetadata=function(e,t){if(!e.terrainPresent)throw new ae(`The server ${e.url} doesn't have terrain`);let n=new YT(t);return n._metadata=e,n};var bUt=new qn("decodeGoogleEarthEnterprisePacket");function HXe(e,t,n){let i=t.getChildBitmask();if(t.terrainState===Eh.PARENT){i=0;for(let o=0;o<4;++o){let r=n.getTileInformationFromQuadKey(e+o.toString());l(r)&&r.hasTerrain()&&(i|=1<<o)}}return i}YT.prototype.requestTileGeometry=function(e,t,n,i){let o=hy.tileXYToQuadKey(e,t,n),r=this._terrainCache,s=this._metadata,a=s.getTileInformationFromQuadKey(o);if(!l(a))return Promise.reject(new ae("Terrain tile doesn't exist"));let c=a.terrainState;l(c)||(c=a.terrainState=Eh.UNKNOWN);let d=r.get(o);if(l(d)){let S=s.providers[a.terrainProvider];return Promise.resolve(new EA({buffer:d,childTileMask:HXe(o,a,s),credits:l(S)?[S]:void 0,negativeAltitudeExponentBias:s.negativeAltitudeExponentBias,negativeElevationThreshold:s.negativeAltitudeThreshold}))}if(r.tidy(),a.ancestorHasTerrain){if(c===Eh.NONE)return Promise.reject(new ae("Terrain tile doesn't exist"))}else return Promise.resolve(new wc({buffer:new Uint8Array(256),width:16,height:16}));let u,m=o,p=-1;switch(c){case Eh.SELF:p=a.terrainVersion;break;case Eh.PARENT:m=m.substring(0,m.length-1),u=s.getTileInformationFromQuadKey(m),p=u.terrainVersion;break;case Eh.UNKNOWN:a.hasTerrain()?p=a.terrainVersion:(m=m.substring(0,m.length-1),u=s.getTileInformationFromQuadKey(m),l(u)&&u.hasTerrain()&&(p=u.terrainVersion));break}if(p<0)return Promise.reject(new ae("Terrain tile doesn't exist"));let b=this._terrainPromises,f=this._terrainRequests,y,_;if(l(b[m]))y=b[m],_=f[m];else{_=i;let S=gUt(this,m,p,_).fetchArrayBuffer();if(!l(S))return;y=S.then(function(Z){return l(Z)?bUt.scheduleTask({buffer:Z,type:"Terrain",key:s.key},[Z]).then(function(R){let C=s.getTileInformationFromQuadKey(m);C.terrainState=Eh.SELF,r.add(m,R[0]);let E=C.terrainProvider,A=R.length-1;for(let L=0;L<A;++L){let F=m+L.toString(),I=s.getTileInformationFromQuadKey(F);l(I)&&(r.add(F,R[L+1]),I.terrainState=Eh.PARENT,I.terrainProvider===0&&(I.terrainProvider=E))}}):Promise.reject(new ae("Failed to load terrain."))}),b[m]=y,f[m]=_,y=y.finally(function(){delete b[m],delete f[m]})}return y.then(function(){let S=r.get(o);if(l(S)){let Z=s.providers[a.terrainProvider];return new EA({buffer:S,childTileMask:HXe(o,a,s),credits:l(Z)?[Z]:void 0,negativeAltitudeExponentBias:s.negativeAltitudeExponentBias,negativeElevationThreshold:s.negativeAltitudeThreshold})}return Promise.reject(new ae("Failed to load terrain."))}).catch(function(S){return _.state===Ri.CANCELLED?(i.state=_.state,Promise.reject(S)):(a.terrainState=Eh.NONE,Promise.reject(S))})};YT.prototype.getLevelMaximumGeometricError=function(e){return this._levelZeroMaximumGeometricError/(1<<e)};YT.prototype.getTileDataAvailable=function(e,t,n){let i=this._metadata,o=hy.tileXYToQuadKey(e,t,n),r=i.getTileInformation(e,t,n);if(r===null)return!1;if(l(r)){if(!r.ancestorHasTerrain)return!0;let s=r.terrainState;if(s===Eh.NONE)return!1;if((!l(s)||s===Eh.UNKNOWN)&&(r.terrainState=Eh.UNKNOWN,!r.hasTerrain())){o=o.substring(0,o.length-1);let a=i.getTileInformationFromQuadKey(o);if(!l(a)||!a.hasTerrain())return!1}return!0}if(i.isValid(o)){let s=new Ar({throttle:!1,throttleByServer:!0,type:js.TERRAIN});i.populateSubtree(e,t,n,s)}return!1};YT.prototype.loadTileDataAvailability=function(e,t,n){};function gUt(e,t,n,i){return n=l(n)&&n>0?n:1,e._metadata.resource.getDerivedResource({url:`flatfile?f1c-0${t}-t.${n.toString()}`,request:i})}var eae=YT;var PFo=x(T(),1);var yUt="https://maps.googleapis.com/maps/api/geocode/json",KXe='<img alt="Google" src="https://assets.ion.cesium.com/google-credit.png" style="vertical-align:-5px">';function tae(e){e=e??B.EMPTY_OBJECT;let t=e.key;this._resource=new ve({url:yUt,queryParameters:{key:t}}),this._credit=new Lt(KXe,!0)}Object.defineProperties(tae.prototype,{credit:{get:function(){return this._credit}}});tae.prototype.geocode=async function(e){let n=await this._resource.getDerivedResource({queryParameters:{address:e}}).fetchJson();if(n.status==="ZERO_RESULTS")return[];if(n.status!=="OK")throw new ae(`GoogleGeocoderService got a bad response ${n.status}: ${n.error_message}`);return n.results.map(o=>{let r=o.geometry.viewport.southwest,s=o.geometry.viewport.northeast;return{displayName:o.formatted_address,destination:re.fromDegrees(r.lng,r.lat,s.lng,s.lat),attribution:{html:KXe,collapsible:!1}}})};var nae=tae;var YFo=x(T(),1);var iae=class{constructor(){mt(this,"type")}getRequiredDataPoints(t){ge.throwInstantiationError()}interpolateOrderZero(t,n,i,o,r){ge.throwInstantiationError()}interpolate(t,n,i,o,r,s,a){ge.throwInstantiationError()}},oae=iae;var kFo=x(T(),1),JXe={GOOGLE:"GOOGLE",BING:"BING",DEFAULT:"DEFAULT"};Object.freeze(JXe);var fy=JXe;var oIo=x(T(),1);var KFo=x(T(),1);function rae(e){this._url=ve.createIfNeeded(e),this._url.appendForwardSlash()}Object.defineProperties(rae.prototype,{url:{get:function(){return this._url}},credit:{get:function(){}}});rae.prototype.geocode=async function(e,t){return this._url.getDerivedResource({url:t===NT.AUTOCOMPLETE?"autocomplete":"search",queryParameters:{text:e}}).fetchJson().then(function(i){return i.features.map(function(o){let r,s=o.bbox;if(l(s))r=re.fromDegrees(s[0],s[1],s[2],s[3]);else{let a=o.geometry.coordinates[0],c=o.geometry.coordinates[1];r=h.fromDegrees(a,c)}return{displayName:o.properties.label,destination:r,attributions:i.attributions}})})};var RU=rae;function xUt(e){if(!Object.values(fy).some(t=>t===e))throw new ge(`Invalid geocodeProviderType: "${e}"`)}var jXe=Object.freeze({[fy.GOOGLE]:"google",[fy.BING]:"bing",[fy.DEFAULT]:void 0});function TUt(e){return jXe[e]}function _Ut(e){return Object.entries(jXe).find(t=>t[1]===e)[0]}function sae(e){e=e??B.EMPTY_OBJECT;let t=e.geocodeProviderType??fy.DEFAULT,n=e.accessToken??Id.defaultAccessToken,i=ve.createIfNeeded(e.server??Id.defaultServer);i.appendForwardSlash();let o=Id.getDefaultTokenCredit(n);l(o)&&e.scene.frameState.creditDisplay.addStaticCredit(Lt.clone(o));let r=i.getDerivedResource({url:"v1/geocode"});l(n)&&r.appendQueryParameters({access_token:n}),this._accessToken=n,this._server=i,this._pelias=new RU(r),this.geocodeProviderType=t}Object.defineProperties(sae.prototype,{credit:{get:function(){}},geocodeProviderType:{get:function(){return _Ut(this._pelias.url.queryParameters.geocoder)},set:function(e){xUt(e);let t={...this._pelias.url.queryParameters,geocoder:TUt(e)};l(t.geocoder)||delete t.geocoder,this._pelias.url.setQueryParameters(t)}}});sae.prototype.geocode=async function(e,t){return this._pelias.geocode(e,t)};var FR=sae;var sIo=x(T(),1),QXe={NONE:0,POINT:1,SEGMENT:2,CURVE:3,ARC:4,SURFACE:5};Object.freeze(QXe);var aae=QXe;var cIo=x(T(),1),qXe={NONE:0,NOT_IN_RANGE:1,IN_RANGE:2};Object.freeze(qXe);var cae=qXe;var dIo=x(T(),1),$Xe={NEAREST:1,NEAREST_KEYPOINT:2,CENTER:8};Object.freeze($Xe);var CU=$Xe;var mIo=x(T(),1),eNe={NONE:0,WIRE:1,SHEET:2,SOLID:3,MESH:4,TEXT:5};Object.freeze(eNe);var lae=eNe;var VIo=x(T(),1);function tNe(e){if(!(!l(e)||!l(e.longitude)||!l(e.latitude)))return h.fromDegrees(e.longitude,e.latitude,e.height??0)}function nNe(e){let t=pe.fromCartesian(e);return{longitude:W.toDegrees(t.longitude),latitude:W.toDegrees(t.latitude),height:t.height}}function SUt(e){let t=[],n=new ce;for(let i=0;i<4;i++)P.getRow(e,i,n),t.push([n.x,n.y,n.z,n.w]);return t}function ZUt(e,t,n){return P.fromRowMajorArray([e/2,0,0,e/2,0,-t/2,0,t/2,0,0,.5,.5,0,0,0,1],n)}var RUt=new P,CUt=new P,dJ=class e{constructor(t){this._assetId=t.assetId,this._resource=t.resource,this.ecefTransform=t.ecefTransform}get assetId(){return this._assetId}static async fromAssetId(t,n){n=n??B.EMPTY_OBJECT;let i=n.accessToken??Id.defaultAccessToken,o=ve.createIfNeeded(n.server??Id.defaultServer);o.appendForwardSlash();let r={url:`assets/${t}/`,headers:Ur._addClientHeaders()};l(i)&&(r.queryParameters={access_token:i});let s=o.getDerivedResource(r),a=await s.getDerivedResource({url:"ecef"}).fetchJson();if(!l(a?.ecefTransform))throw new ae(`Cesium ion asset ${t} is not geolocated; snapping requires geolocation`);let c=P.fromRowMajorArray(a.ecefTransform.flat());return new e({assetId:t,resource:s,ecefTransform:c})}_computeWorldToView(t,n,i,o){o=o??new P;let r=ZUt(n,i,RUt);return P.multiply(t.viewMatrix,this.ecefTransform,o),P.multiply(t.frustum.projectionMatrix,o,o),P.multiply(r,o,o)}async snap(t){let n=this._computeWorldToView(t.camera,t.canvasWidth,t.canvasHeight,CUt),i={testPoint:nNe(t.testPoint),closePoint:nNe(t.closePoint??t.testPoint),snapAperture:t.snapAperture??e.DEFAULT_SNAP_APERTURE,snapMode:t.snapMode??CU.NEAREST,worldToView:SUt(n)},o;try{o=await this._resource.getDerivedResource({url:`elements/${t.elementId}/snap`}).post(JSON.stringify(i),{headers:{"Content-Type":"application/json"},responseType:"json"})}catch(s){if(s?.statusCode===404||s?.statusCode===400&&typeof s.response?.message=="string"&&s.response.message.includes("No snap possible"))return;throw s}if(!l(o))return;let r={heat:o.heat,geometryType:o.geomType,parentGeometryType:o.parentGeomType,normal:o.normal,curve:o.curve};return r.snapPoint=tNe(o.snapPoint),r.hitPoint=tNe(o.hitPoint),r}};dJ.DEFAULT_SNAP_APERTURE=12;var dae=dJ;var WIo=x(T(),1);var ca={};ca.ExportStatus=Object.freeze({NotStarted:"NotStarted",InProgress:"InProgress",Complete:"Complete",Invalid:"Invalid"});ca.ExportType=Object.freeze({IMODEL:"IMODEL",CESIUM:"CESIUM","3DTILES":"3DTILES"});ca.RealityDataType=Object.freeze({Cesium3DTiles:"Cesium3DTiles",PNTS:"PNTS",RealityMesh3DTiles:"RealityMesh3DTiles",Terrain3DTiles:"Terrain3DTiles",GaussianSplat3DTiles:"GS_3DT",KML:"KML",GeoJSON:"GeoJSON",Unstructured:"Unstructured"});ca.defaultAccessToken=void 0;ca.defaultShareKey=void 0;ca._getAuthorizationHeader=function(){return l(ca.defaultShareKey)?`Basic ${ca.defaultShareKey}`:`Bearer ${ca.defaultAccessToken}`};ca.apiEndpoint=new ve({url:"https://api.bentley.com"});ca.getExports=async function(e,t){let n=new ve({url:`${ca.apiEndpoint}mesh-export`,headers:{Authorization:ca._getAuthorizationHeader(),Accept:"application/vnd.bentley.itwin-platform.v1+json",Prefer:"return=representation"},queryParameters:{iModelId:e,exportType:ca.ExportType["3DTILES"],$top:"5",client:"CesiumJS"}});typeof CESIUM_VERSION<"u"&&n.appendQueryParameters({clientVersion:CESIUM_VERSION}),l(t)&&t!==""&&n.appendQueryParameters({changesetId:t});try{return await n.fetchJson()}catch(i){let o=JSON.parse(i.response);if(i.statusCode===401){let r=o.error.details?.[0].code??"";throw new ae(`Unauthorized, bad token, wrong scopes or headers bad. ${r}`)}else{if(i.statusCode===403)throw console.error(o.error.code,o.error.message),new ae("Not allowed, forbidden");if(i.statusCode===422)throw new ae(`Unprocessable Entity:${o.error.code} ${o.error.message}`);if(i.statusCode===429)throw new ae("Too many requests")}throw new ae(`Unknown request failure ${i.statusCode}`)}};ca.getRealityDataMetadata=async function(e,t){let n=new ve({url:`${ca.apiEndpoint}reality-management/reality-data/${t}`,headers:{Authorization:ca._getAuthorizationHeader(),Accept:"application/vnd.bentley.itwin-platform.v1+json"},queryParameters:{iTwinId:e}});try{return(await n.fetchJson()).realityData}catch(i){let o=JSON.parse(i.response);if(i.statusCode===401){let r=o.error.details?.[0].code??"";throw new ae(`Unauthorized, bad token, wrong scopes or headers bad. ${r}`)}else{if(i.statusCode===403)throw console.error(o.error.code,o.error.message),new ae("Not allowed, forbidden");if(i.statusCode===404)throw new ae(`Reality data not found: ${e}, ${t}`);if(i.statusCode===422)throw new ae(`Unprocessable Entity:${o.error.code} ${o.error.message}`);if(i.statusCode===429)throw new ae("Too many requests")}throw new ae(`Unknown request failure ${i.statusCode}`)}};ca.getRealityDataURL=async function(e,t,n){let i=new ve({url:`${ca.apiEndpoint}reality-management/reality-data/${t}/readaccess`,headers:{Authorization:ca._getAuthorizationHeader(),Accept:"application/vnd.bentley.itwin-platform.v1+json"},queryParameters:{iTwinId:e}});try{let r=(await i.fetchJson())._links.containerUrl.href,s=new URL(r);return s.pathname=`${s.pathname}/${n}`,s.toString()}catch(o){let r=JSON.parse(o.response);if(o.statusCode===401){let s=r.error.details?.[0].code??"";throw new ae(`Unauthorized, bad token, wrong scopes or headers bad. ${s}`)}else{if(o.statusCode===403)throw console.error(r.error.code,r.error.message),new ae("Not allowed, forbidden");if(o.statusCode===404)throw new ae(`Reality data not found: ${e}, ${t}`);if(o.statusCode===422)throw new ae(`Unprocessable Entity:${r.error.code} ${r.error.message}`);if(o.statusCode===429)throw new ae("Too many requests")}throw new ae(`Unknown request failure ${o.statusCode}`)}};var la=ca;var IIo=x(T(),1);var uae=class{constructor(){mt(this,"ellipsoid")}project(t,n){ge.throwInstantiationError()}unproject(t,n){ge.throwInstantiationError()}},mae=uae;var wIo=x(T(),1);function AA(e){e=e??B.EMPTY_OBJECT;let t=e.weights,n=e.times;this._times=n,this._weights=t,this._count=t.length/n.length,this._lastTimeIndex=0}Object.defineProperties(AA.prototype,{times:{get:function(){return this._times}},weights:{get:function(){return this._weights}}});AA.prototype.findTimeInterval=vo.prototype.findTimeInterval;AA.prototype.wrapTime=vo.prototype.wrapTime;AA.prototype.clampTime=vo.prototype.clampTime;AA.prototype.evaluate=function(e,t){let n=this.weights,i=this.times,o=this._lastTimeIndex=this.findTimeInterval(e,this._lastTimeIndex),r=(e-i[o])/(i[o+1]-i[o]);l(t)||(t=new Array(this._count));for(let s=0;s<this._count;s++){let a=o*this._count+s;t[s]=n[a]*(1-r)+n[a+this._count]*r}return t};var hae=AA;var KIo=x(T(),1);function fae(e,t,n){e=ve.createIfNeeded(e),e.appendForwardSlash(),e.setQueryParameters({key:t}),this._url=e,this._params=n??{},this._credit=new Lt('Geodata copyright <a href="https://www.openstreetmap.org/">OpenStreetMap</a> contributors',!1)}Object.defineProperties(fae.prototype,{url:{get:function(){return this._url}},params:{get:function(){return this._params}},credit:{get:function(){return this._credit}}});fae.prototype.geocode=async function(e){return this._url.getDerivedResource({url:"json",queryParameters:It(this._params,{q:e})}).fetchJson().then(function(n){return n.results.map(function(i){let o,r=i.bounds;if(l(r))o=re.fromDegrees(r.southwest.lng,r.southwest.lat,r.northeast.lng,r.northeast.lat);else{let{lng:s,lat:a}=i.geometry;o=h.fromDegrees(s,a)}return{displayName:i.formatted,destination:o}})})};var pae=fae;var QIo=x(T(),1);var VUt={packedLength:void 0,pack:ge.throwInstantiationError,unpack:ge.throwInstantiationError},bae=VUt;var ePo=x(T(),1);var EUt={packedInterpolationLength:void 0,convertPackedArrayForInterpolation:ge.throwInstantiationError,unpackInterpolationResult:ge.throwInstantiationError},gae=EUt;var rPo=x(T(),1);var AUt=new h;function GUt(e,t,n,i){let o=c_(e,t,n,i,AUt);return l(o)?o.x>0&&o.y>0&&o.z>0:!1}var yae=GUt;var cPo=x(T(),1);function iNe(){ge.throwInstantiationError()}iNe.prototype.getURL=ge.throwInstantiationError;var xae=iNe;var CPo=x(T(),1);function LUt(e,t,n,i,o,r,s){let a=oo.numberOfPoints(e,t,o),c,d=n.red,u=n.green,m=n.blue,p=n.alpha,b=i.red,f=i.green,y=i.blue,_=i.alpha;if(U.equals(n,i)){for(c=0;c<a;c++)r[s++]=U.floatToByte(d),r[s++]=U.floatToByte(u),r[s++]=U.floatToByte(m),r[s++]=U.floatToByte(p);return s}let S=(b-d)/a,Z=(f-u)/a,R=(y-m)/a,C=(_-p)/a,E=s;for(c=0;c<a;c++)r[E++]=U.floatToByte(d+c*S),r[E++]=U.floatToByte(u+c*Z),r[E++]=U.floatToByte(m+c*R),r[E++]=U.floatToByte(p+c*C);return E}function VU(e){e=e??B.EMPTY_OBJECT;let t=e.positions,n=e.colors,i=e.colorsPerVertex??!1;this._positions=t,this._colors=n,this._colorsPerVertex=i,this._arcType=e.arcType??un.GEODESIC,this._granularity=e.granularity??W.RADIANS_PER_DEGREE,this._ellipsoid=e.ellipsoid??ne.default,this._workerName="createSimplePolylineGeometry";let o=1+t.length*h.packedLength;o+=l(n)?1+n.length*U.packedLength:1,this.packedLength=o+ne.packedLength+3}VU.pack=function(e,t,n){n=n??0;let i,o=e._positions,r=o.length;for(t[n++]=r,i=0;i<r;++i,n+=h.packedLength)h.pack(o[i],t,n);let s=e._colors;for(r=l(s)?s.length:0,t[n++]=r,i=0;i<r;++i,n+=U.packedLength)U.pack(s[i],t,n);return ne.pack(e._ellipsoid,t,n),n+=ne.packedLength,t[n++]=e._colorsPerVertex?1:0,t[n++]=e._arcType,t[n]=e._granularity,t};VU.unpack=function(e,t,n){t=t??0;let i,o=e[t++],r=new Array(o);for(i=0;i<o;++i,t+=h.packedLength)r[i]=h.unpack(e,t);o=e[t++];let s=o>0?new Array(o):void 0;for(i=0;i<o;++i,t+=U.packedLength)s[i]=U.unpack(e,t);let a=ne.unpack(e,t);t+=ne.packedLength;let c=e[t++]===1,d=e[t++],u=e[t];return l(n)?(n._positions=r,n._colors=s,n._ellipsoid=a,n._colorsPerVertex=c,n._arcType=d,n._granularity=u,n):new VU({positions:r,colors:s,ellipsoid:a,colorsPerVertex:c,arcType:d,granularity:u})};var uJ=new Array(2),mJ=new Array(2),WUt={positions:uJ,height:mJ,ellipsoid:void 0,minDistance:void 0,granularity:void 0};VU.createGeometry=function(e){let t=e._positions,n=e._colors,i=e._colorsPerVertex,o=e._arcType,r=e._granularity,s=e._ellipsoid,a=W.chordLength(r,s.maximumRadius),c=l(n)&&!i,d,u=t.length,m,p,b,f,y=0;if(o===un.GEODESIC||o===un.RHUMB){let C,E,A;o===un.GEODESIC?(C=W.chordLength(r,s.maximumRadius),E=oo.numberOfPoints,A=oo.generateArc):(C=r,E=oo.numberOfPointsRhumbLine,A=oo.generateRhumbArc);let L=oo.extractHeights(t,s),F=WUt;if(o===un.GEODESIC?F.minDistance=a:F.granularity=r,F.ellipsoid=s,c){let I=0;for(d=0;d<u-1;d++)I+=E(t[d],t[d+1],C)+1;m=new Float64Array(I*3),b=new Uint8Array(I*4),F.positions=uJ,F.height=mJ;let N=0;for(d=0;d<u-1;++d){uJ[0]=t[d],uJ[1]=t[d+1],mJ[0]=L[d],mJ[1]=L[d+1];let g=A(F);if(l(n)){let V=g.length/3;f=n[d];for(let G=0;G<V;++G)b[N++]=U.floatToByte(f.red),b[N++]=U.floatToByte(f.green),b[N++]=U.floatToByte(f.blue),b[N++]=U.floatToByte(f.alpha)}m.set(g,y),y+=g.length}}else if(F.positions=t,F.height=L,m=new Float64Array(A(F)),l(n)){for(b=new Uint8Array(m.length/3*4),d=0;d<u-1;++d){let N=t[d],g=t[d+1],V=n[d],G=n[d+1];y=LUt(N,g,V,G,a,b,y)}let I=n[u-1];b[y++]=U.floatToByte(I.red),b[y++]=U.floatToByte(I.green),b[y++]=U.floatToByte(I.blue),b[y]=U.floatToByte(I.alpha)}}else{p=c?u*2-2:u,m=new Float64Array(p*3),b=l(n)?new Uint8Array(p*4):void 0;let C=0,E=0;for(d=0;d<u;++d){let A=t[d];if(c&&d>0&&(h.pack(A,m,C),C+=3,f=n[d-1],b[E++]=U.floatToByte(f.red),b[E++]=U.floatToByte(f.green),b[E++]=U.floatToByte(f.blue),b[E++]=U.floatToByte(f.alpha)),c&&d===u-1)break;h.pack(A,m,C),C+=3,l(n)&&(f=n[d],b[E++]=U.floatToByte(f.red),b[E++]=U.floatToByte(f.green),b[E++]=U.floatToByte(f.blue),b[E++]=U.floatToByte(f.alpha))}}let _=new Rn;_.position=new Xe({componentDatatype:J.DOUBLE,componentsPerAttribute:3,values:m}),l(n)&&(_.color=new Xe({componentDatatype:J.UNSIGNED_BYTE,componentsPerAttribute:4,values:b,normalize:!0})),p=m.length/3;let S=(p-1)*2,Z=Oe.createTypedArray(p,S),R=0;for(d=0;d<p-1;++d)Z[R++]=d,Z[R++]=d+1;return new At({attributes:_,indices:Z,primitiveType:Ie.LINES,boundingSphere:me.fromPoints(t)})};var Tae=VU;var APo=x(T(),1);var hJ=class{constructor(){ge.throwInstantiationError()}async snap(t){ge.throwInstantiationError()}};hJ.DEFAULT_SNAP_APERTURE=void 0;var _ae=hJ;var IPo=x(T(),1);function GA(e){let t=e.radius??1,i={radii:new h(t,t,t),stackPartitions:e.stackPartitions,slicePartitions:e.slicePartitions,vertexFormat:e.vertexFormat};this._ellipsoidGeometry=new Ha(i),this._workerName="createSphereGeometry"}GA.packedLength=Ha.packedLength;GA.pack=function(e,t,n){return Ha.pack(e._ellipsoidGeometry,t,n)};var vUt=new Ha,MT={radius:void 0,radii:new h,vertexFormat:new Me,stackPartitions:void 0,slicePartitions:void 0};GA.unpack=function(e,t,n){let i=Ha.unpack(e,t,vUt);return MT.vertexFormat=Me.clone(i._vertexFormat,MT.vertexFormat),MT.stackPartitions=i._stackPartitions,MT.slicePartitions=i._slicePartitions,l(n)?(h.clone(i._radii,MT.radii),n._ellipsoidGeometry=new Ha(MT),n):(MT.radius=i._radii.x,new GA(MT))};GA.createGeometry=function(e){return Ha.createGeometry(e._ellipsoidGeometry)};var EU=GA;var XPo=x(T(),1);function FUt(e){return e<=.04045?e*.07739938080495357:Math.pow((e+.055)*.9478672985781991,2.4)}var IR=FUt;var MPo=x(T(),1);var Sae=class{constructor(t){mt(this,"ellipsoid");mt(this,"rectangle");mt(this,"projection")}getNumberOfXTilesAtLevel(t){ge.throwInstantiationError()}getNumberOfYTilesAtLevel(t){ge.throwInstantiationError()}rectangleToNativeRectangle(t,n){ge.throwInstantiationError()}tileXYToNativeRectangle(t,n,i,o){ge.throwInstantiationError()}tileXYToRectangle(t,n,i,o){ge.throwInstantiationError()}positionToTileXY(t,n,i){ge.throwInstantiationError()}},Zae=Sae;var HPo=x(T(),1);function PR(e){e=e??B.EMPTY_OBJECT,this._clock=void 0,this._element=void 0,this._clockSubscription=void 0,this._seekFunction=void 0,this._lastPlaybackRate=void 0,this.clock=e.clock,this.element=e.element,this.epoch=e.epoch??ot.MINIMUM_VALUE,this.tolerance=e.tolerance??1,this._seeking=!1,this._seekFunction=void 0,this._firstTickAfterSeek=!1}Object.defineProperties(PR.prototype,{clock:{get:function(){return this._clock},set:function(e){let t=this._clock;t!==e&&(l(t)&&(this._clockSubscription(),this._clockSubscription=void 0),l(e)&&(this._clockSubscription=e.onTick.addEventListener(PR.prototype._onTick,this)),this._clock=e)}},element:{get:function(){return this._element},set:function(e){let t=this._element;t!==e&&(l(t)&&t.removeEventListener("seeked",this._seekFunction,!1),l(e)&&(this._seeking=!1,this._seekFunction=IUt(this),e.addEventListener("seeked",this._seekFunction,!1)),this._element=e,this._seeking=!1,this._firstTickAfterSeek=!1)}}});PR.prototype.destroy=function(){return this.element=void 0,this.clock=void 0,ue(this)};PR.prototype.isDestroyed=function(){return!1};PR.prototype._trySetPlaybackRate=function(e){if(this._lastPlaybackRate===e.multiplier)return;let t=this._element;try{t.playbackRate=e.multiplier}catch{t.playbackRate=0}this._lastPlaybackRate=e.multiplier};PR.prototype._onTick=function(e){let t=this._element;if(!l(t)||t.readyState<2)return;let n=t.paused,i=e.shouldAnimate;if(i===n&&(i?t.play():t.pause()),this._seeking||this._firstTickAfterSeek){this._firstTickAfterSeek=!1;return}this._trySetPlaybackRate(e);let o=e.currentTime,r=this.epoch??ot.MINIMUM_VALUE,s=Q.secondsDifference(o,r),a=t.duration,c,d=t.currentTime;t.loop?(s=s%a,s<0&&(s=a-s),c=s):s>a?c=a:s<0?c=0:c=s;let u=i?this.tolerance??1:.001;Math.abs(c-d)>u&&(this._seeking=!0,t.currentTime=c)};function IUt(e){return function(){e._seeking=!1,e._firstTickAfterSeek=!0}}var Rae=PR;var lXo=x(T(),1);function PUt(e,t){this.rectangle=e,this.maxLevel=t}function oNe(e){this.ellipsoid=e.ellipsoid??ne.default,this.tilingScheme=void 0,this.heightmapWidth=void 0,this.heightmapHeight=void 0,this.levelZeroMaximumGeometricError=void 0,this.rectangles=[]}oNe.prototype.build=function(e){e._tilingScheme=this.tilingScheme,e._heightmapWidth=this.heightmapWidth,e._heightmapHeight=this.heightmapHeight,e._levelZeroMaximumGeometricError=this.levelZeroMaximumGeometricError,e._rectangles=this.rectangles};function XUt(e,t){let n=t.getElementsByTagName("SRS")[0].textContent;if(n==="EPSG:4326")e.tilingScheme=new to({ellipsoid:e.ellipsoid});else throw new ae(`SRS ${n} is not supported`);let i=t.getElementsByTagName("TileFormat")[0];e.heightmapWidth=parseInt(i.getAttribute("width"),10),e.heightmapHeight=parseInt(i.getAttribute("height"),10),e.levelZeroMaximumGeometricError=Qo.getEstimatedLevelZeroGeometricErrorForAHeightmap(e.ellipsoid,Math.min(e.heightmapWidth,e.heightmapHeight),e.tilingScheme.getNumberOfXTilesAtLevel(0));let o=t.getElementsByTagName("DataExtent");for(let r=0;r<o.length;++r){let s=o[r],a=W.toRadians(parseFloat(s.getAttribute("minx"))),c=W.toRadians(parseFloat(s.getAttribute("miny"))),d=W.toRadians(parseFloat(s.getAttribute("maxx"))),u=W.toRadians(parseFloat(s.getAttribute("maxy"))),m=parseInt(s.getAttribute("maxlevel"),10);e.rectangles.push(new PUt(new re(a,c,d,u),m))}}function NUt(e,t,n){let i=`An error occurred while accessing ${e.url}`;throw l(t)&&l(t.message)&&(i=`${i}: ${t.message}`),tr.reportError(void 0,n,l(n)?n._errorEvent:void 0,i),new ae(i)}async function YUt(e,t,n){try{let i=await t.fetchXML();XUt(e,i)}catch(i){NUt(t,i,n)}}function wT(e){e=e??B.EMPTY_OBJECT,this._errorEvent=new Se,this._terrainDataStructure={heightScale:1/1e3,heightOffset:-1e3,elementsPerHeight:3,stride:4,elementMultiplier:256,isBigEndian:!0,lowestEncodedHeight:0,highestEncodedHeight:256*256*256-1};let t=e.credit;typeof t=="string"&&(t=new Lt(t)),this._credit=t,this._tilingScheme=void 0,this._rectangles=[]}Object.defineProperties(wT.prototype,{errorEvent:{get:function(){return this._errorEvent}},credit:{get:function(){return this._credit}},tilingScheme:{get:function(){return this._tilingScheme}},hasWaterMask:{get:function(){return!1}},hasVertexNormals:{get:function(){return!1}},availability:{get:function(){}}});wT.fromUrl=async function(e,t){t=t??B.EMPTY_OBJECT;let n=new oNe(t),i=ve.createIfNeeded(e);await YUt(n,i);let o=new wT(t);return n.build(o),o._resource=i,o};wT.prototype.requestTileGeometry=function(e,t,n,i){let o=this._tilingScheme.getNumberOfYTilesAtLevel(n),s=this._resource.getDerivedResource({url:`${n}/${e}/${o-t-1}.tif`,queryParameters:{cesium:!0},request:i}).fetchImage({preferImageBitmap:!0});if(!l(s))return;let a=this;return Promise.resolve(s).then(function(c){return new wc({buffer:Fh(c),width:a._heightmapWidth,height:a._heightmapHeight,childTileMask:MUt(a,e,t,n),structure:a._terrainDataStructure})})};wT.prototype.getLevelMaximumGeometricError=function(e){return this._levelZeroMaximumGeometricError/(1<<e)};var rNe=new re;function MUt(e,t,n,i){let o=e._tilingScheme,r=e._rectangles,s=o.tileXYToRectangle(t,n,i),a=0;for(let c=0;c<r.length&&a!==15;++c){let d=r[c];if(d.maxLevel<=i)continue;let u=d.rectangle,m=re.intersection(u,s,rNe);l(m)&&(fJ(o,u,t*2,n*2,i+1)&&(a|=4),fJ(o,u,t*2+1,n*2,i+1)&&(a|=8),fJ(o,u,t*2,n*2+1,i+1)&&(a|=1),fJ(o,u,t*2+1,n*2+1,i+1)&&(a|=2))}return a}function fJ(e,t,n,i,o){let r=e.tileXYToRectangle(n,i,o);return l(re.intersection(r,t,rNe))}wT.prototype.getTileDataAvailable=function(e,t,n){};wT.prototype.loadTileDataAvailability=function(e,t,n){};var Cae=wT;var uXo=x(T(),1),sNe={VK_FORMAT_UNDEFINED:0,VK_FORMAT_R4G4_UNORM_PACK8:1,VK_FORMAT_R4G4B4A4_UNORM_PACK16:2,VK_FORMAT_B4G4R4A4_UNORM_PACK16:3,VK_FORMAT_R5G6B5_UNORM_PACK16:4,VK_FORMAT_B5G6R5_UNORM_PACK16:5,VK_FORMAT_R5G5B5A1_UNORM_PACK16:6,VK_FORMAT_B5G5R5A1_UNORM_PACK16:7,VK_FORMAT_A1R5G5B5_UNORM_PACK16:8,VK_FORMAT_R8_UNORM:9,VK_FORMAT_R8_SNORM:10,VK_FORMAT_R8_USCALED:11,VK_FORMAT_R8_SSCALED:12,VK_FORMAT_R8_UINT:13,VK_FORMAT_R8_SINT:14,VK_FORMAT_R8_SRGB:15,VK_FORMAT_R8G8_UNORM:16,VK_FORMAT_R8G8_SNORM:17,VK_FORMAT_R8G8_USCALED:18,VK_FORMAT_R8G8_SSCALED:19,VK_FORMAT_R8G8_UINT:20,VK_FORMAT_R8G8_SINT:21,VK_FORMAT_R8G8_SRGB:22,VK_FORMAT_R8G8B8_UNORM:23,VK_FORMAT_R8G8B8_SNORM:24,VK_FORMAT_R8G8B8_USCALED:25,VK_FORMAT_R8G8B8_SSCALED:26,VK_FORMAT_R8G8B8_UINT:27,VK_FORMAT_R8G8B8_SINT:28,VK_FORMAT_R8G8B8_SRGB:29,VK_FORMAT_B8G8R8_UNORM:30,VK_FORMAT_B8G8R8_SNORM:31,VK_FORMAT_B8G8R8_USCALED:32,VK_FORMAT_B8G8R8_SSCALED:33,VK_FORMAT_B8G8R8_UINT:34,VK_FORMAT_B8G8R8_SINT:35,VK_FORMAT_B8G8R8_SRGB:36,VK_FORMAT_R8G8B8A8_UNORM:37,VK_FORMAT_R8G8B8A8_SNORM:38,VK_FORMAT_R8G8B8A8_USCALED:39,VK_FORMAT_R8G8B8A8_SSCALED:40,VK_FORMAT_R8G8B8A8_UINT:41,VK_FORMAT_R8G8B8A8_SINT:42,VK_FORMAT_R8G8B8A8_SRGB:43,VK_FORMAT_B8G8R8A8_UNORM:44,VK_FORMAT_B8G8R8A8_SNORM:45,VK_FORMAT_B8G8R8A8_USCALED:46,VK_FORMAT_B8G8R8A8_SSCALED:47,VK_FORMAT_B8G8R8A8_UINT:48,VK_FORMAT_B8G8R8A8_SINT:49,VK_FORMAT_B8G8R8A8_SRGB:50,VK_FORMAT_A8B8G8R8_UNORM_PACK32:51,VK_FORMAT_A8B8G8R8_SNORM_PACK32:52,VK_FORMAT_A8B8G8R8_USCALED_PACK32:53,VK_FORMAT_A8B8G8R8_SSCALED_PACK32:54,VK_FORMAT_A8B8G8R8_UINT_PACK32:55,VK_FORMAT_A8B8G8R8_SINT_PACK32:56,VK_FORMAT_A8B8G8R8_SRGB_PACK32:57,VK_FORMAT_A2R10G10B10_UNORM_PACK32:58,VK_FORMAT_A2R10G10B10_SNORM_PACK32:59,VK_FORMAT_A2R10G10B10_USCALED_PACK32:60,VK_FORMAT_A2R10G10B10_SSCALED_PACK32:61,VK_FORMAT_A2R10G10B10_UINT_PACK32:62,VK_FORMAT_A2R10G10B10_SINT_PACK32:63,VK_FORMAT_A2B10G10R10_UNORM_PACK32:64,VK_FORMAT_A2B10G10R10_SNORM_PACK32:65,VK_FORMAT_A2B10G10R10_USCALED_PACK32:66,VK_FORMAT_A2B10G10R10_SSCALED_PACK32:67,VK_FORMAT_A2B10G10R10_UINT_PACK32:68,VK_FORMAT_A2B10G10R10_SINT_PACK32:69,VK_FORMAT_R16_UNORM:70,VK_FORMAT_R16_SNORM:71,VK_FORMAT_R16_USCALED:72,VK_FORMAT_R16_SSCALED:73,VK_FORMAT_R16_UINT:74,VK_FORMAT_R16_SINT:75,VK_FORMAT_R16_SFLOAT:76,VK_FORMAT_R16G16_UNORM:77,VK_FORMAT_R16G16_SNORM:78,VK_FORMAT_R16G16_USCALED:79,VK_FORMAT_R16G16_SSCALED:80,VK_FORMAT_R16G16_UINT:81,VK_FORMAT_R16G16_SINT:82,VK_FORMAT_R16G16_SFLOAT:83,VK_FORMAT_R16G16B16_UNORM:84,VK_FORMAT_R16G16B16_SNORM:85,VK_FORMAT_R16G16B16_USCALED:86,VK_FORMAT_R16G16B16_SSCALED:87,VK_FORMAT_R16G16B16_UINT:88,VK_FORMAT_R16G16B16_SINT:89,VK_FORMAT_R16G16B16_SFLOAT:90,VK_FORMAT_R16G16B16A16_UNORM:91,VK_FORMAT_R16G16B16A16_SNORM:92,VK_FORMAT_R16G16B16A16_USCALED:93,VK_FORMAT_R16G16B16A16_SSCALED:94,VK_FORMAT_R16G16B16A16_UINT:95,VK_FORMAT_R16G16B16A16_SINT:96,VK_FORMAT_R16G16B16A16_SFLOAT:97,VK_FORMAT_R32_UINT:98,VK_FORMAT_R32_SINT:99,VK_FORMAT_R32_SFLOAT:100,VK_FORMAT_R32G32_UINT:101,VK_FORMAT_R32G32_SINT:102,VK_FORMAT_R32G32_SFLOAT:103,VK_FORMAT_R32G32B32_UINT:104,VK_FORMAT_R32G32B32_SINT:105,VK_FORMAT_R32G32B32_SFLOAT:106,VK_FORMAT_R32G32B32A32_UINT:107,VK_FORMAT_R32G32B32A32_SINT:108,VK_FORMAT_R32G32B32A32_SFLOAT:109,VK_FORMAT_R64_UINT:110,VK_FORMAT_R64_SINT:111,VK_FORMAT_R64_SFLOAT:112,VK_FORMAT_R64G64_UINT:113,VK_FORMAT_R64G64_SINT:114,VK_FORMAT_R64G64_SFLOAT:115,VK_FORMAT_R64G64B64_UINT:116,VK_FORMAT_R64G64B64_SINT:117,VK_FORMAT_R64G64B64_SFLOAT:118,VK_FORMAT_R64G64B64A64_UINT:119,VK_FORMAT_R64G64B64A64_SINT:120,VK_FORMAT_R64G64B64A64_SFLOAT:121,VK_FORMAT_B10G11R11_UFLOAT_PACK32:122,VK_FORMAT_E5B9G9R9_UFLOAT_PACK32:123,VK_FORMAT_D16_UNORM:124,VK_FORMAT_X8_D24_UNORM_PACK32:125,VK_FORMAT_D32_SFLOAT:126,VK_FORMAT_S8_UINT:127,VK_FORMAT_D16_UNORM_S8_UINT:128,VK_FORMAT_D24_UNORM_S8_UINT:129,VK_FORMAT_D32_SFLOAT_S8_UINT:130,VK_FORMAT_BC1_RGB_UNORM_BLOCK:131,VK_FORMAT_BC1_RGB_SRGB_BLOCK:132,VK_FORMAT_BC1_RGBA_UNORM_BLOCK:133,VK_FORMAT_BC1_RGBA_SRGB_BLOCK:134,VK_FORMAT_BC2_UNORM_BLOCK:135,VK_FORMAT_BC2_SRGB_BLOCK:136,VK_FORMAT_BC3_UNORM_BLOCK:137,VK_FORMAT_BC3_SRGB_BLOCK:138,VK_FORMAT_BC4_UNORM_BLOCK:139,VK_FORMAT_BC4_SNORM_BLOCK:140,VK_FORMAT_BC5_UNORM_BLOCK:141,VK_FORMAT_BC5_SNORM_BLOCK:142,VK_FORMAT_BC6H_UFLOAT_BLOCK:143,VK_FORMAT_BC6H_SFLOAT_BLOCK:144,VK_FORMAT_BC7_UNORM_BLOCK:145,VK_FORMAT_BC7_SRGB_BLOCK:146,VK_FORMAT_ETC2_R8G8B8_UNORM_BLOCK:147,VK_FORMAT_ETC2_R8G8B8_SRGB_BLOCK:148,VK_FORMAT_ETC2_R8G8B8A1_UNORM_BLOCK:149,VK_FORMAT_ETC2_R8G8B8A1_SRGB_BLOCK:150,VK_FORMAT_ETC2_R8G8B8A8_UNORM_BLOCK:151,VK_FORMAT_ETC2_R8G8B8A8_SRGB_BLOCK:152,VK_FORMAT_EAC_R11_UNORM_BLOCK:153,VK_FORMAT_EAC_R11_SNORM_BLOCK:154,VK_FORMAT_EAC_R11G11_UNORM_BLOCK:155,VK_FORMAT_EAC_R11G11_SNORM_BLOCK:156,VK_FORMAT_ASTC_4x4_UNORM_BLOCK:157,VK_FORMAT_ASTC_4x4_SRGB_BLOCK:158,VK_FORMAT_ASTC_5x4_UNORM_BLOCK:159,VK_FORMAT_ASTC_5x4_SRGB_BLOCK:160,VK_FORMAT_ASTC_5x5_UNORM_BLOCK:161,VK_FORMAT_ASTC_5x5_SRGB_BLOCK:162,VK_FORMAT_ASTC_6x5_UNORM_BLOCK:163,VK_FORMAT_ASTC_6x5_SRGB_BLOCK:164,VK_FORMAT_ASTC_6x6_UNORM_BLOCK:165,VK_FORMAT_ASTC_6x6_SRGB_BLOCK:166,VK_FORMAT_ASTC_8x5_UNORM_BLOCK:167,VK_FORMAT_ASTC_8x5_SRGB_BLOCK:168,VK_FORMAT_ASTC_8x6_UNORM_BLOCK:169,VK_FORMAT_ASTC_8x6_SRGB_BLOCK:170,VK_FORMAT_ASTC_8x8_UNORM_BLOCK:171,VK_FORMAT_ASTC_8x8_SRGB_BLOCK:172,VK_FORMAT_ASTC_10x5_UNORM_BLOCK:173,VK_FORMAT_ASTC_10x5_SRGB_BLOCK:174,VK_FORMAT_ASTC_10x6_UNORM_BLOCK:175,VK_FORMAT_ASTC_10x6_SRGB_BLOCK:176,VK_FORMAT_ASTC_10x8_UNORM_BLOCK:177,VK_FORMAT_ASTC_10x8_SRGB_BLOCK:178,VK_FORMAT_ASTC_10x10_UNORM_BLOCK:179,VK_FORMAT_ASTC_10x10_SRGB_BLOCK:180,VK_FORMAT_ASTC_12x10_UNORM_BLOCK:181,VK_FORMAT_ASTC_12x10_SRGB_BLOCK:182,VK_FORMAT_ASTC_12x12_UNORM_BLOCK:183,VK_FORMAT_ASTC_12x12_SRGB_BLOCK:184,VK_FORMAT_G8B8G8R8_422_UNORM:1000156e3,VK_FORMAT_B8G8R8G8_422_UNORM:1000156001,VK_FORMAT_G8_B8_R8_3PLANE_420_UNORM:1000156002,VK_FORMAT_G8_B8R8_2PLANE_420_UNORM:1000156003,VK_FORMAT_G8_B8_R8_3PLANE_422_UNORM:1000156004,VK_FORMAT_G8_B8R8_2PLANE_422_UNORM:1000156005,VK_FORMAT_G8_B8_R8_3PLANE_444_UNORM:1000156006,VK_FORMAT_R10X6_UNORM_PACK16:1000156007,VK_FORMAT_R10X6G10X6_UNORM_2PACK16:1000156008,VK_FORMAT_R10X6G10X6B10X6A10X6_UNORM_4PACK16:1000156009,VK_FORMAT_G10X6B10X6G10X6R10X6_422_UNORM_4PACK16:1000156010,VK_FORMAT_B10X6G10X6R10X6G10X6_422_UNORM_4PACK16:1000156011,VK_FORMAT_G10X6_B10X6_R10X6_3PLANE_420_UNORM_3PACK16:1000156012,VK_FORMAT_G10X6_B10X6R10X6_2PLANE_420_UNORM_3PACK16:1000156013,VK_FORMAT_G10X6_B10X6_R10X6_3PLANE_422_UNORM_3PACK16:1000156014,VK_FORMAT_G10X6_B10X6R10X6_2PLANE_422_UNORM_3PACK16:1000156015,VK_FORMAT_G10X6_B10X6_R10X6_3PLANE_444_UNORM_3PACK16:1000156016,VK_FORMAT_R12X4_UNORM_PACK16:1000156017,VK_FORMAT_R12X4G12X4_UNORM_2PACK16:1000156018,VK_FORMAT_R12X4G12X4B12X4A12X4_UNORM_4PACK16:1000156019,VK_FORMAT_G12X4B12X4G12X4R12X4_422_UNORM_4PACK16:1000156020,VK_FORMAT_B12X4G12X4R12X4G12X4_422_UNORM_4PACK16:1000156021,VK_FORMAT_G12X4_B12X4_R12X4_3PLANE_420_UNORM_3PACK16:1000156022,VK_FORMAT_G12X4_B12X4R12X4_2PLANE_420_UNORM_3PACK16:1000156023,VK_FORMAT_G12X4_B12X4_R12X4_3PLANE_422_UNORM_3PACK16:1000156024,VK_FORMAT_G12X4_B12X4R12X4_2PLANE_422_UNORM_3PACK16:1000156025,VK_FORMAT_G12X4_B12X4_R12X4_3PLANE_444_UNORM_3PACK16:1000156026,VK_FORMAT_G16B16G16R16_422_UNORM:1000156027,VK_FORMAT_B16G16R16G16_422_UNORM:1000156028,VK_FORMAT_G16_B16_R16_3PLANE_420_UNORM:1000156029,VK_FORMAT_G16_B16R16_2PLANE_420_UNORM:1000156030,VK_FORMAT_G16_B16_R16_3PLANE_422_UNORM:1000156031,VK_FORMAT_G16_B16R16_2PLANE_422_UNORM:1000156032,VK_FORMAT_G16_B16_R16_3PLANE_444_UNORM:1000156033,VK_FORMAT_PVRTC1_2BPP_UNORM_BLOCK_IMG:1000054e3,VK_FORMAT_PVRTC1_4BPP_UNORM_BLOCK_IMG:1000054001,VK_FORMAT_PVRTC2_2BPP_UNORM_BLOCK_IMG:1000054002,VK_FORMAT_PVRTC2_4BPP_UNORM_BLOCK_IMG:1000054003,VK_FORMAT_PVRTC1_2BPP_SRGB_BLOCK_IMG:1000054004,VK_FORMAT_PVRTC1_4BPP_SRGB_BLOCK_IMG:1000054005,VK_FORMAT_PVRTC2_2BPP_SRGB_BLOCK_IMG:1000054006,VK_FORMAT_PVRTC2_4BPP_SRGB_BLOCK_IMG:1000054007,VK_FORMAT_ASTC_4x4_SFLOAT_BLOCK_EXT:1000066e3,VK_FORMAT_ASTC_5x4_SFLOAT_BLOCK_EXT:1000066001,VK_FORMAT_ASTC_5x5_SFLOAT_BLOCK_EXT:1000066002,VK_FORMAT_ASTC_6x5_SFLOAT_BLOCK_EXT:1000066003,VK_FORMAT_ASTC_6x6_SFLOAT_BLOCK_EXT:1000066004,VK_FORMAT_ASTC_8x5_SFLOAT_BLOCK_EXT:1000066005,VK_FORMAT_ASTC_8x6_SFLOAT_BLOCK_EXT:1000066006,VK_FORMAT_ASTC_8x8_SFLOAT_BLOCK_EXT:1000066007,VK_FORMAT_ASTC_10x5_SFLOAT_BLOCK_EXT:1000066008,VK_FORMAT_ASTC_10x6_SFLOAT_BLOCK_EXT:1000066009,VK_FORMAT_ASTC_10x8_SFLOAT_BLOCK_EXT:1000066010,VK_FORMAT_ASTC_10x10_SFLOAT_BLOCK_EXT:1000066011,VK_FORMAT_ASTC_12x10_SFLOAT_BLOCK_EXT:1000066012,VK_FORMAT_ASTC_12x12_SFLOAT_BLOCK_EXT:1000066013,VK_FORMAT_G8B8G8R8_422_UNORM_KHR:1000156e3,VK_FORMAT_B8G8R8G8_422_UNORM_KHR:1000156001,VK_FORMAT_G8_B8_R8_3PLANE_420_UNORM_KHR:1000156002,VK_FORMAT_G8_B8R8_2PLANE_420_UNORM_KHR:1000156003,VK_FORMAT_G8_B8_R8_3PLANE_422_UNORM_KHR:1000156004,VK_FORMAT_G8_B8R8_2PLANE_422_UNORM_KHR:1000156005,VK_FORMAT_G8_B8_R8_3PLANE_444_UNORM_KHR:1000156006,VK_FORMAT_R10X6_UNORM_PACK16_KHR:1000156007,VK_FORMAT_R10X6G10X6_UNORM_2PACK16_KHR:1000156008,VK_FORMAT_R10X6G10X6B10X6A10X6_UNORM_4PACK16_KHR:1000156009,VK_FORMAT_G10X6B10X6G10X6R10X6_422_UNORM_4PACK16_KHR:1000156010,VK_FORMAT_B10X6G10X6R10X6G10X6_422_UNORM_4PACK16_KHR:1000156011,VK_FORMAT_G10X6_B10X6_R10X6_3PLANE_420_UNORM_3PACK16_KHR:1000156012,VK_FORMAT_G10X6_B10X6R10X6_2PLANE_420_UNORM_3PACK16_KHR:1000156013,VK_FORMAT_G10X6_B10X6_R10X6_3PLANE_422_UNORM_3PACK16_KHR:1000156014,VK_FORMAT_G10X6_B10X6R10X6_2PLANE_422_UNORM_3PACK16_KHR:1000156015,VK_FORMAT_G10X6_B10X6_R10X6_3PLANE_444_UNORM_3PACK16_KHR:1000156016,VK_FORMAT_R12X4_UNORM_PACK16_KHR:1000156017,VK_FORMAT_R12X4G12X4_UNORM_2PACK16_KHR:1000156018,VK_FORMAT_R12X4G12X4B12X4A12X4_UNORM_4PACK16_KHR:1000156019,VK_FORMAT_G12X4B12X4G12X4R12X4_422_UNORM_4PACK16_KHR:1000156020,VK_FORMAT_B12X4G12X4R12X4G12X4_422_UNORM_4PACK16_KHR:1000156021,VK_FORMAT_G12X4_B12X4_R12X4_3PLANE_420_UNORM_3PACK16_KHR:1000156022,VK_FORMAT_G12X4_B12X4R12X4_2PLANE_420_UNORM_3PACK16_KHR:1000156023,VK_FORMAT_G12X4_B12X4_R12X4_3PLANE_422_UNORM_3PACK16_KHR:1000156024,VK_FORMAT_G12X4_B12X4R12X4_2PLANE_422_UNORM_3PACK16_KHR:1000156025,VK_FORMAT_G12X4_B12X4_R12X4_3PLANE_444_UNORM_3PACK16_KHR:1000156026,VK_FORMAT_G16B16G16R16_422_UNORM_KHR:1000156027,VK_FORMAT_B16G16R16G16_422_UNORM_KHR:1000156028,VK_FORMAT_G16_B16_R16_3PLANE_420_UNORM_KHR:1000156029,VK_FORMAT_G16_B16R16_2PLANE_420_UNORM_KHR:1000156030,VK_FORMAT_G16_B16_R16_3PLANE_422_UNORM_KHR:1000156031,VK_FORMAT_G16_B16R16_2PLANE_422_UNORM_KHR:1000156032,VK_FORMAT_G16_B16_R16_3PLANE_444_UNORM_KHR:1000156033};Object.freeze(sNe);var Vae=sNe;var fXo=x(T(),1);function wUt(e){switch(e){case ie.FLOAT:return"float";case ie.FLOAT_VEC2:return"vec2";case ie.FLOAT_VEC3:return"vec3";case ie.FLOAT_VEC4:return"vec4";case ie.FLOAT_MAT2:return"mat2";case ie.FLOAT_MAT3:return"mat3";case ie.FLOAT_MAT4:return"mat4";case ie.SAMPLER_2D:return"sampler2D";case ie.BOOL:return"bool"}}var Eae=wUt;var bXo=x(T(),1);function kUt(e,t,n){return function(){n.apply(e,arguments),t.apply(e,arguments)}}var AU=kUt;var TXo=x(T(),1);var UUt=new h(1,1,1);function Aae(e){e=e??UUt,this._dimensions=h.clone(e)}Object.defineProperties(Aae.prototype,{dimensions:{get:function(){return this._dimensions},set:function(e){h.clone(e,this._dimensions)}}});var DUt=new h;Aae.prototype.emit=function(e){let t=this._dimensions,n=h.multiplyByScalar(t,.5,DUt),i=W.randomBetween(-n.x,n.x),o=W.randomBetween(-n.y,n.y),r=W.randomBetween(-n.z,n.z);e.position=h.fromElements(i,o,r,e.position),e.velocity=h.normalize(e.position,e.velocity)};var Gae=Aae;var FXo=x(T(),1);var Lae=0,aNe=new h,pJ=new h,OUt=new Xr;function BUt(e,t,n){let i=t.tileX,o=t.tileY,r=t.tileZ,s=n?.featureIdProperty,a=OUt.tileXYToRectangle(i,o,r),c=re.center(a),d=h.fromRadians(c.longitude,c.latitude,0),u=4294967295,m=u,p=u,b=new Map,f=new Map,y=[],_=[],S=[],Z=0;function R(){let M=(4-Z%4)%4;M>0&&(S.push(new Uint8Array(M)),Z+=M)}function C(M,O){R();let w=Z;S.push(new Uint8Array(M.buffer,M.byteOffset,M.byteLength)),Z+=M.byteLength;let z=y.length;return y.push({buffer:0,byteOffset:w,byteLength:M.byteLength,target:O}),z}function E(M,O){let w=C(M,O.target),z=St.getComponentCount(O.type),K={bufferView:w,byteOffset:0,componentType:O.componentType,count:M.length/z,type:O.type};l(O.min)&&(K.min=O.min),l(O.max)&&(K.max=O.max);let te=_.length;return _.push(K),te}function A(M){let O=Number.POSITIVE_INFINITY,w=Number.POSITIVE_INFINITY,z=Number.POSITIVE_INFINITY,K=Number.NEGATIVE_INFINITY,te=Number.NEGATIVE_INFINITY,H=Number.NEGATIVE_INFINITY;for(let $=0;$<M.length;$+=3){let ee=M[$],le=M[$+1],_e=M[$+2];ee<O&&(O=ee),le<w&&(w=le),_e<z&&(z=_e),ee>K&&(K=ee),le>te&&(te=le),_e>H&&(H=_e)}return{min:[O,w,z],max:[K,te,H]}}function L(M,O,w){if(w.length===0)return;let z=new Uint32Array(w),K=E(z,{type:"SCALAR",componentType:J.UNSIGNED_INT,target:ie.ARRAY_BUFFER});M._FEATURE_ID_0=K;let te={featureCount:b.size,nullFeatureId:m,attribute:0};f.size>0&&(te.propertyTable=0),O.EXT_mesh_features={featureIds:[te]}}function F(M,O){O=O??4;let w=(O-Z%O)%O;w>0&&(S.push(new Uint8Array(w)),Z+=w);let z=Z;S.push(M),Z+=M.byteLength;let K=y.length;return y.push({buffer:0,byteOffset:z,byteLength:M.byteLength}),K}function I(){if(f.size===0)return;let M=new Map;for(let K of f.values())for(let[te,H]of Object.entries(K)){if(!l(H))continue;let $=typeof H,ee;$==="string"?ee="STRING":$==="number"?ee="SCALAR":$==="boolean"?ee="BOOLEAN":ee="STRING";let le=M.get(te);l(le)?le!==ee&&M.set(te,"STRING"):M.set(te,ee)}if(M.size===0)return;let O={};for(let[K,te]of M)te==="SCALAR"?O[K]={type:"SCALAR",componentType:"FLOAT64"}:te==="BOOLEAN"?O[K]={type:"BOOLEAN"}:O[K]={type:"STRING"};let w={},z=b.size;for(let[K,te]of M)if(te==="SCALAR"){let H=new Float64Array(z);for(let ee=0;ee<z;ee++){let _e=f.get(ee)?.[K];H[ee]=typeof _e=="number"&&Number.isFinite(_e)?_e:NaN}let $=F(new Uint8Array(H.buffer,H.byteOffset,H.byteLength),8);w[K]={values:$}}else if(te==="BOOLEAN"){let H=Math.ceil(z/8),$=new Uint8Array(H);for(let le=0;le<z;le++)f.get(le)?.[K]&&($[le>>3]|=1<<(le&7));let ee=F($);w[K]={values:ee}}else{let H=new TextEncoder,$=[],ee=new Uint32Array(z+1),le=0;for(let Ge=0;Ge<z;Ge++){ee[Ge]=le;let Fe=f.get(Ge)?.[K],tt;Fe==null?tt="":typeof Fe=="string"?tt=Fe:tt=String(Fe);let Be=H.encode(tt);$.push(Be),le+=Be.byteLength}ee[z]=le;let _e=new Uint8Array(le),he=0;for(let Ge of $)_e.set(Ge,he),he+=Ge.byteLength;let Ze=F(_e),ye=F(new Uint8Array(ee.buffer,ee.byteOffset,ee.byteLength));w[K]={values:Ze,stringOffsets:ye,stringOffsetType:"UINT32"}}return{schema:{classes:{mvt_feature:{properties:O}}},propertyTables:[{class:"mvt_feature",count:z,properties:w}]}}let N=[],g=[],V=[d.x,d.y,d.z];for(let M of e.layers){let O=M.extent,w=[],z=[],K=[],te=[],H=[],$=0,ee=[],le=[],_e=[],he=[],Ze=[],ye=[],Ge=[],Ae=0;for(let Be of M.features){let je=l(s)?HUt(Be,s,b)??m:zUt(Be,b);if(je!==m&&!f.has(je)){let qe=Object.assign({},Be.properties);qe._layer=M.name??"",f.set(je,qe)}if(Be.type==="Point"){let qe=Be.geometry;for(let We of qe)Wae(We,i,o,r,O,Lae,d,w),z.push(je);continue}if(Be.type==="LineString"){let qe=Be.geometry;for(let We of qe){let Ke=K.length/3;for(let ct of We)Wae(ct,i,o,r,O,Lae,d,K),te.push(je);for(let ct=0;ct<We.length;ct++)H.push(Ke+ct);H.push(p),$++}continue}if(Be.type==="Polygon"){let qe=Be.geometry,We=KUt(qe);for(let Ke of We){let ct=[Ke.outerRing,...Ke.holes],Et=[],zt=[],ut=[],bt=0;for(let pt=0;pt<ct.length;pt++){let Mi=ct[pt];pt>0&&ut.push(bt);for(let jn of Mi)Et.push(new k(jn.x,jn.y)),Wae(jn,i,o,r,O,Lae,d,zt),bt++}if(Et.length<3)continue;let ht=hi.triangulate(Et,ut.length>0?ut:void 0);if(!l(ht)||ht.length===0){xt("buildVectorGltfFromMVT-triangulation-failed","Polygon triangulation failed; skipping polygon.");continue}let jt=ee.length/3,st=_e.length;he.push(jt),Ze.push(st),ye.push(ut.length);for(let pt=0;pt<ut.length;pt++)Ge.push(jt+ut[pt]);for(let pt=0;pt<zt.length;pt++)ee.push(zt[pt]);for(let pt=0;pt<zt.length/3;pt++)le.push(je);for(let pt=0;pt<ht.length;pt++)_e.push(ht[pt]+jt);Ae++}}}if(w.length===0&&K.length===0&&ee.length===0)continue;H.length>0&&H[H.length-1]===p&&H.pop();let Fe=[];if(w.length>0){let Be=new Float32Array(w),je=A(Be),We={POSITION:E(Be,{type:"VEC3",componentType:J.FLOAT,target:ie.ARRAY_BUFFER,min:je.min,max:je.max})},Ke={CESIUM_mesh_vector:{vector:!0,count:Be.length/3}};L(We,Ke,z),Fe.push({mode:Ie.POINTS,attributes:We,extensions:Ke})}if(K.length>0&&H.length>1){let Be=new Float32Array(K),je=new Uint32Array(H),qe=A(Be),We=E(Be,{type:"VEC3",componentType:J.FLOAT,target:ie.ARRAY_BUFFER,min:qe.min,max:qe.max}),Ke=E(je,{type:"SCALAR",componentType:J.UNSIGNED_INT,target:ie.ELEMENT_ARRAY_BUFFER}),ct={POSITION:We},Et={CESIUM_mesh_vector:{vector:!0,count:$}};L(ct,Et,te),Fe.push({mode:Ie.LINE_STRIP,indices:Ke,attributes:ct,extensions:Et})}if(ee.length>0&&_e.length>=3){let Be=new Float32Array(ee),je=new Uint32Array(_e),qe=new Uint32Array(he),We=new Uint32Array(Ze),Ke=Ge.length>0,ct=Ke?new Uint32Array(ye):void 0,Et=Ke?new Uint32Array(Ge):void 0,zt=A(Be),ut=E(Be,{type:"VEC3",componentType:J.FLOAT,target:ie.ARRAY_BUFFER,min:zt.min,max:zt.max}),bt=E(je,{type:"SCALAR",componentType:J.UNSIGNED_INT,target:ie.ELEMENT_ARRAY_BUFFER}),ht=E(qe,{type:"SCALAR",componentType:J.UNSIGNED_INT,target:ie.ARRAY_BUFFER}),jt=E(We,{type:"SCALAR",componentType:J.UNSIGNED_INT,target:ie.ARRAY_BUFFER}),st=l(ct)?E(ct,{type:"SCALAR",componentType:J.UNSIGNED_INT,target:ie.ARRAY_BUFFER}):void 0,pt=l(Et)?E(Et,{type:"SCALAR",componentType:J.UNSIGNED_INT,target:ie.ARRAY_BUFFER}):void 0,Mi={POSITION:ut},jn={CESIUM_mesh_vector:{vector:!0,count:Ae,polygonAttributeOffsets:ht,polygonIndicesOffsets:jt}};Ke&&(jn.CESIUM_mesh_vector.polygonHoleCounts=st,jn.CESIUM_mesh_vector.polygonHoleOffsets=pt),L(Mi,jn,le),Fe.push({mode:Ie.TRIANGLES,indices:bt,attributes:Mi,extensions:jn})}if(Fe.length===0)continue;let tt=N.length;N.push({primitives:Fe}),g.push({name:M.name,mesh:tt,translation:V})}if(g.length===0)return;let G=I(),v=qUt(S,Z),X=["CESIUM_mesh_vector"];b.size>0&&X.push("EXT_mesh_features"),l(G)&&X.push("EXT_structural_metadata");let Y=g.map((M,O)=>O),D={asset:{version:"2.0"},extensionsUsed:X,scene:0,scenes:[{nodes:Y}],nodes:g,meshes:N,accessors:_,bufferViews:y,buffers:[{byteLength:v.byteLength}],extensions:void 0};return l(G)&&(D.extensions={EXT_structural_metadata:G}),QUt(D,v)}function zUt(e,t){let n=t.get(e);return l(n)||(n=t.size,t.set(e,n)),n}function HUt(e,t,n){let i=e.properties;if(!l(i))return;let o=i[t];if(!l(o)||typeof o!="string"&&typeof o!="number"&&typeof o!="boolean"||typeof o=="number"&&!Number.isFinite(o))return;let r=`${typeof o}:${o}`,s=n.get(r);return l(s)||(s=n.size,n.set(r,s)),s}function KUt(e){let t=[];for(let n of e){let i=jUt(n);if(i.length<3)continue;JUt(i)<=0?t.push({outerRing:i,holes:[]}):t.length>0&&t[t.length-1].holes.push(i)}return t}function JUt(e){let t=0;for(let n=0,i=e.length-1;n<e.length;i=n++)t+=(e[i].x+e[n].x)*(e[i].y-e[n].y);return t/2}function jUt(e){return e.length>1&&e[0].x===e[e.length-1].x&&e[0].y===e[e.length-1].y?e.slice(0,e.length-1):e}function Wae(e,t,n,i,o,r,s,a){let c=1<<i,d=(t+e.x/o)/c,u=(n+e.y/o)/c,m=d*2*Math.PI-Math.PI,p=Math.atan(Math.sinh(Math.PI*(1-2*u)));h.fromRadians(m,p,r,void 0,aNe),h.subtract(aNe,s,pJ),a.push(pJ.x,pJ.y,pJ.z)}function QUt(e,t){let s=new TextEncoder().encode(JSON.stringify(e)),a=Math.ceil(s.length/4)*4,c=new Uint8Array(a);c.fill(32),c.set(s);let d=Math.ceil(t.byteLength/4)*4,u=new Uint8Array(d);u.set(t);let m=20+a+8+d,p=new Uint8Array(m),b=new DataView(p.buffer),f=0;return b.setUint32(f,1179937895,!0),f+=4,b.setUint32(f,2,!0),f+=4,b.setUint32(f,m,!0),f+=4,b.setUint32(f,a,!0),f+=4,b.setUint32(f,1313821514,!0),f+=4,p.set(c,f),f+=a,b.setUint32(f,d,!0),f+=4,b.setUint32(f,5130562,!0),f+=4,p.set(u,f),p}function qUt(e,t){let n=new Uint8Array(t),i=0;for(let o of e)n.set(o,i),i+=o.byteLength;return n}var GU=BUt;var XXo=x(T(),1);var vae=class{constructor(){mt(this,"featuresLength");mt(this,"pointsLength");mt(this,"trianglesLength");mt(this,"geometryByteLength");mt(this,"texturesByteLength");mt(this,"batchTableByteLength");mt(this,"innerContents");mt(this,"ready");mt(this,"tileset");mt(this,"tile");mt(this,"url");mt(this,"batchTable");mt(this,"metadata");mt(this,"group");this.featurePropertiesDirty=!1}hasProperty(t,n){ge.throwInstantiationError()}getFeature(t){ge.throwInstantiationError()}applyDebugSettings(t,n){ge.throwInstantiationError()}applyStyle(t){ge.throwInstantiationError()}update(t,n){ge.throwInstantiationError()}pick(t,n,i){ge.throwInstantiationError()}isDestroyed(){ge.throwInstantiationError()}destroy(){ge.throwInstantiationError()}},Fae=vae;var hNo=x(T(),1);var kXo=x(T(),1);function LU(e){e=e??B.EMPTY_OBJECT,this._maximumSubtreeCount=e.maximumSubtreeCount??0,this._subtreeRequestCounter=0,this._queue=new ly({comparator:LU.comparator})}LU.prototype.addSubtree=function(e){let t=new $Ut(e,this._subtreeRequestCounter);this._subtreeRequestCounter++,this._queue.insert(t);let n=e.implicitCoordinates;if(n.level>0){let i=n.getParentSubtreeCoordinates(),o=this.find(i)}if(this._maximumSubtreeCount>0)for(;this._queue.length>this._maximumSubtreeCount&&this._queue.getMinimum()!==t;)this._queue.removeMinimum()};LU.prototype.find=function(e){let t=this._queue,n=t.internalArray,i=t.length;for(let o=0;o<i;o++){let r=n[o],a=r.subtree.implicitCoordinates;if(e.isEqual(a))return r.subtree}};LU.comparator=function(e,t){let n=e.subtree.implicitCoordinates,i=t.subtree.implicitCoordinates;return n.isAncestor(i)?1:i.isAncestor(n)?-1:e.stamp-t.stamp};function $Ut(e,t){this.subtree=e,this.stamp=t}var WU=LU;function vU(e){e=e??B.EMPTY_OBJECT;let{className:t,names:n,types:i,componentTypes:o,shape:r,dimensions:s,paddingBefore:a=h.ZERO.clone(),paddingAfter:c=h.ZERO.clone(),globalTransform:d=P.IDENTITY.clone(),shapeTransform:u=P.IDENTITY.clone(),minBounds:m,maxBounds:p,minimumValues:b,maximumValues:f,maximumTileCount:y}=e;this._shapeTransform=u,this._globalTransform=d,this._shape=r,this._minBounds=m,this._maxBounds=p,this._dimensions=s,this._paddingBefore=a,this._paddingAfter=c,this._className=t,this._names=n,this._types=i,this._componentTypes=o,this._metadataOrder=r===_c.ELLIPSOID?w0.Z_UP:w0.Y_UP,this._minimumValues=b,this._maximumValues=f,this._maximumTileCount=y,this._availableLevels=void 0,this._implicitTileset=void 0,this._subtreeCache=new WU}Object.defineProperties(vU.prototype,{globalTransform:{get:function(){return this._globalTransform}},shapeTransform:{get:function(){return this._shapeTransform}},shape:{get:function(){return this._shape}},minBounds:{get:function(){return this._minBounds}},maxBounds:{get:function(){return this._maxBounds}},dimensions:{get:function(){return this._dimensions}},paddingBefore:{get:function(){return this._paddingBefore}},paddingAfter:{get:function(){return this._paddingAfter}},className:{get:function(){return this._className}},names:{get:function(){return this._names}},types:{get:function(){return this._types}},componentTypes:{get:function(){return this._componentTypes}},metadataOrder:{get:function(){return this._metadataOrder}},minimumValues:{get:function(){return this._minimumValues}},maximumValues:{get:function(){return this._maximumValues}},maximumTileCount:{get:function(){return this._maximumTileCount}},availableLevels:{get:function(){return this._availableLevels}}});vU.fromUrl=async function(e){let t=ve.createIfNeeded(e),n=await t.fetchJson();t5t(n);let i=c5t(n,t);await i.load();let{root:o}=n,r=no(n,"3DTILES_metadata")?n.extensions["3DTILES_metadata"]:n,s=new HS({metadataJson:r,schema:i.schema}),a=o.content.extensions["3DTILES_content_voxels"],c=a.class,d=l5t(s,c);Object.assign(d,n5t(o)),l(o.transform)?d.globalTransform=P.unpack(o.transform):d.globalTransform=P.clone(P.IDENTITY),d.dimensions=h.unpack(a.dimensions),d.maximumTileCount=e5t(s),l(a.padding)&&(d.paddingBefore=h.unpack(a.padding.before),d.paddingAfter=h.unpack(a.padding.after));let u=new vU(d),m=new $p(t,o,i.schema);return u._implicitTileset=m,u._availableLevels=m.availableLevels,Ni.unload(i),u};function e5t(e){if(l(e.tileset))return e.tileset.getPropertyBySemantic(Nm.TILESET_TILE_COUNT)}function t5t(e){let t=e.root;if(!l(t.content))throw new ae("Root must have content");if(!no(t.content,"3DTILES_content_voxels"))throw new ae("Root tile content must have 3DTILES_content_voxels extension");if(!no(t,"3DTILES_implicit_tiling")&&!l(t.implicitTiling))throw new ae("Root tile must have implicit tiling");if(!l(e.schema)&&!l(e.schemaUri)&&!no(e,"3DTILES_metadata"))throw new ae("Tileset must have a metadata schema")}function n5t(e){let t=e.boundingVolume;if(l(t.box))return s5t(t.box);if(l(t.region))return i5t(t.region);if(no(t,"3DTILES_bounding_volume_cylinder"))return a5t(t.extensions["3DTILES_bounding_volume_cylinder"]);throw new ae("Only box, region and 3DTILES_bounding_volume_cylinder are supported in Cesium3DTilesVoxelProvider")}function i5t(e){let t=e[0],n=e[1],i=e[2],o=e[3],r=e[4],s=e[5],a=P.fromScale(ne.WGS84.radii),c=new h(t,n,r),d=new h(i,o,s);return{shape:_c.ELLIPSOID,minBounds:c,maxBounds:d,shapeTransform:a}}var o5t=new h,r5t=new q;function s5t(e){let t=nn.unpack(e),n=q.getScale(t.halfAxes,o5t),i=q.getRotation(t.halfAxes,r5t);return{shape:_c.BOX,minBounds:h.negate(n,new h),maxBounds:h.clone(n),shapeTransform:P.fromRotationTranslation(i,t.center)}}function a5t(e){let{minRadius:t,maxRadius:n,height:i,minAngle:o=-W.PI,maxAngle:r=W.PI,translation:s=[0,0,0],rotation:a=[0,0,0,1]}=e,c=-.5*i+s[2],d=.5*i+s[2],u=P.fromTranslationQuaternionRotationScale(h.unpack(s),Ne.unpack(a),h.ONE);return{shape:_c.CYLINDER,minBounds:h.fromElements(t,o,c),maxBounds:h.fromElements(n,r,d),shapeTransform:u}}function c5t(e,t){let{schemaUri:n,schema:i}=e;return l(n)?Ni.getSchemaLoader({resource:t.getDerivedResource({url:n})}):Ni.getSchemaLoader({schema:i})}function l5t(e,t){let{schema:n,statistics:i}=e,o=i?.classes[t],r=n.classes[t].properties,s=Object.entries(r).map(([b,f])=>{let{type:y,componentType:_}=f,S=o?.properties[b].min,Z=o?.properties[b].max,R=St.getComponentCount(y),C=cNe(S,R),E=cNe(Z,R);return{id:b,type:y,componentType:_,minValue:C,maxValue:E}}),a=s.map(b=>b.id),c=s.map(b=>b.type),d=s.map(b=>b.componentType),u=s.map(b=>b.minValue),m=s.map(b=>b.maxValue),p=u.some(l);return{className:t,names:a,types:c,componentTypes:d,minimumValues:p?u:void 0,maximumValues:p?m:void 0}}function cNe(e,t){if(!l(e))return;let n=Array.isArray(e)?e:[e];return Array.from({length:t},(i,o)=>n[o])}async function d5t(e,t){let n=e._implicitTileset,i=e._subtreeCache,o=i.find(t);if(l(o))return o;let r=n.subtreeUriTemplate.getDerivedResource({templateValues:t.getTemplateValues()}),s=n.baseResource.getDerivedResource({url:r.url}),a=await s.fetchArrayBuffer();if(o=i.find(t),l(o))return o;let c=ug(a);return o=await Pb.fromSubtreeJson(s,c.jsonPayload,c.binaryPayload,n,t),i.addSubtree(o),o}vU.prototype.requestData=async function(e){e=e??B.EMPTY_OBJECT;let{tileLevel:t=0,tileX:n=0,tileY:i=0,tileZ:o=0,keyframe:r=0}=e;if(r!==0)return Promise.reject("3D Tiles currently doesn't support time-dynamic data.");let s=this._implicitTileset,a=new e0({subdivisionScheme:s.subdivisionScheme,subtreeLevels:s.subtreeLevels,level:t,x:n,y:i,z:o}),c=a.isSubtreeRoot()&&a.level>0,d=c?a.getParentSubtreeCoordinates():a.getSubtreeCoordinates(),m=await d5t(this,d);if(!(c?m.childSubtreeIsAvailableAtCoordinates:m.tileIsAvailableAtCoordinates).call(m,a))return Promise.reject(`Tile is not available at level ${t}, x ${n}, y ${i}, z ${o}.`);let{contentUriTemplates:f,baseResource:y}=s,_=f[0].getDerivedResource({templateValues:a.getTemplateValues()}),S=y.getDerivedResource({url:_.url});return gR.fromGltf(S)};var Iae=vU;var gNo=x(T(),1);function Pae(e){e=e??1,this._radius=e??1}Object.defineProperties(Pae.prototype,{radius:{get:function(){return this._radius},set:function(e){this._radius=e}}});Pae.prototype.emit=function(e){let t=W.randomBetween(0,W.TWO_PI),n=W.randomBetween(0,this._radius),i=n*Math.cos(t),o=n*Math.sin(t),r=0;e.position=h.fromElements(i,o,r,e.position),e.velocity=h.clone(h.UNIT_Z,e.velocity)};var FU=Pae;var aYo=x(T(),1);var xNo=x(T(),1),bJ={CUMULUS:0};bJ.validate=function(e){return e===bJ.CUMULUS};Object.freeze(bJ);var LA=bJ;var VNo=x(T(),1);function cp(e,t){if(e=e??B.EMPTY_OBJECT,this._show=e.show??!0,this._position=h.clone(e.position??h.ZERO),!l(e.scale)&&l(e.maximumSize))this._maximumSize=h.clone(e.maximumSize),this._scale=new k(this._maximumSize.x,this._maximumSize.y);else{this._scale=k.clone(e.scale??new k(20,12));let n=new h(this._scale.x,this._scale.y,Math.min(this._scale.x,this._scale.y)/1.5);this._maximumSize=h.clone(e.maximumSize??n)}this._slice=e.slice??-1,this._color=U.clone(e.color??U.WHITE),this._brightness=e.brightness??1,this._cloudCollection=t,this._index=-1}var u5t=cp.SHOW_INDEX=0,m5t=cp.POSITION_INDEX=1,h5t=cp.SCALE_INDEX=2,f5t=cp.MAXIMUM_SIZE_INDEX=3,p5t=cp.SLICE_INDEX=4,b5t=cp.BRIGHTNESS_INDEX=5,g5t=cp.COLOR_INDEX=6;cp.NUMBER_OF_PROPERTIES=7;function XR(e,t){let n=e._cloudCollection;l(n)&&(n._updateCloud(e,t),e._dirty=!0)}Object.defineProperties(cp.prototype,{show:{get:function(){return this._show},set:function(e){this._show!==e&&(this._show=e,XR(this,u5t))}},position:{get:function(){return this._position},set:function(e){let t=this._position;h.equals(t,e)||(h.clone(e,t),XR(this,m5t))}},scale:{get:function(){return this._scale},set:function(e){let t=this._scale;k.equals(t,e)||(k.clone(e,t),XR(this,h5t))}},maximumSize:{get:function(){return this._maximumSize},set:function(e){let t=this._maximumSize;h.equals(t,e)||(h.clone(e,t),XR(this,f5t))}},color:{get:function(){return this._color},set:function(e){let t=this._color;U.equals(t,e)||(U.clone(e,t),XR(this,g5t))}},slice:{get:function(){return this._slice},set:function(e){this._slice!==e&&(this._slice=e,XR(this,p5t))}},brightness:{get:function(){return this._brightness},set:function(e){this._brightness!==e&&(this._brightness=e,XR(this,b5t))}}});cp.prototype._destroy=function(){this._cloudCollection=void 0};var fm=cp;var pm,gJ=new h,y5t={positionHighAndScaleX:0,positionLowAndScaleY:1,packedAttribute0:2,packedAttribute1:3,color:4},x5t={direction:0,positionHighAndScaleX:1,positionLowAndScaleY:2,packedAttribute0:3,packedAttribute1:4,color:5},T5t=fm.SHOW_INDEX,_5t=fm.POSITION_INDEX,S5t=fm.SCALE_INDEX,Z5t=fm.MAXIMUM_SIZE_INDEX,R5t=fm.SLICE_INDEX,C5t=fm.BRIGHTNESS_INDEX,V5t=fm.NUMBER_OF_PROPERTIES,E5t=fm.COLOR_INDEX;function lp(e){e=e??B.EMPTY_OBJECT,this._clouds=[],this._cloudsToUpdate=[],this._cloudsToUpdateIndex=0,this._cloudsRemoved=!1,this._createVertexArray=!1,this._propertiesChanged=new Uint32Array(V5t),this._noiseTexture=void 0,this._textureSliceWidth=128,this._noiseTextureRows=4,this.noiseDetail=e.noiseDetail??16,this.noiseOffset=h.clone(e.noiseOffset??h.ZERO),this._loading=!1,this._ready=!1;let t=this;this._uniforms={u_noiseTexture:function(){return t._noiseTexture},u_noiseTextureDimensions:lNe(t),u_noiseDetail:function(){return t.noiseDetail}},this._vaNoise=void 0,this._spNoise=void 0,this._spCreated=!1,this._sp=void 0,this._rs=void 0,this.show=e.show??!0,this._colorCommands=[],this.debugBillboards=e.debugBillboards??!1,this._compiledDebugBillboards=!1,this.debugEllipsoids=e.debugEllipsoids??!1,this._compiledDebugEllipsoids=!1}function lNe(e){return function(){return gJ.x=e._textureSliceWidth,gJ.y=e._noiseTextureRows,gJ.z=1/e._noiseTextureRows,gJ}}Object.defineProperties(lp.prototype,{length:{get:function(){return Nae(this),this._clouds.length}}});function dNe(e){let t=e.length;for(let n=0;n<t;++n)e[n]&&e[n]._destroy()}lp.prototype.add=function(e){e=e??B.EMPTY_OBJECT;let t=e.cloudType??LA.CUMULUS,n;return t===LA.CUMULUS&&(n=new fm(e,this),n._index=this._clouds.length,this._clouds.push(n),this._createVertexArray=!0),n};lp.prototype.remove=function(e){return this.contains(e)?(this._clouds[e._index]=void 0,this._cloudsRemoved=!0,this._createVertexArray=!0,e._destroy(),!0):!1};lp.prototype.removeAll=function(){dNe(this._clouds),this._clouds=[],this._cloudsToUpdate=[],this._cloudsToUpdateIndex=0,this._cloudsRemoved=!1,this._createVertexArray=!0};function Nae(e){if(e._cloudsRemoved){e._cloudsRemoved=!1;let t=[],n=e._clouds,i=n.length;for(let o=0,r=0;o<i;++o){let s=n[o];l(s)&&(n._index=r++,t.push(s))}e._clouds=t}}lp.prototype._updateCloud=function(e,t){e._dirty||(this._cloudsToUpdate[this._cloudsToUpdateIndex++]=e),++this._propertiesChanged[t]};lp.prototype.contains=function(e){return l(e)&&e._cloudCollection===this};lp.prototype.get=function(e){return Nae(this),this._clouds[e]};var A5t=new Float32Array([-1,-1,1,-1,1,1,-1,1]),G5t=new Uint16Array([0,1,2,0,2,3]);function L5t(e){let t=it.createVertexBuffer({context:e,typedArray:A5t,usage:Pe.STATIC_DRAW}),n=it.createIndexBuffer({context:e,typedArray:G5t,usage:Pe.STATIC_DRAW,indexDatatype:Oe.UNSIGNED_SHORT}),i=[{index:0,vertexBuffer:t,componentsPerAttribute:2,componentDatatype:J.FLOAT}];return new Un({context:e,attributes:i,indexBuffer:n})}var Yae;function W5t(e){let n=e.cache.cloudCollection_indexBufferBatched;if(l(n))return n;let i=16384*6-6,o=new Uint16Array(i);for(let r=0,s=0;r<i;r+=6,s+=4)o[r]=s,o[r+1]=s+1,o[r+2]=s+2,o[r+3]=s,o[r+4]=s+2,o[r+5]=s+3;return n=it.createIndexBuffer({context:e,typedArray:o,usage:Pe.STATIC_DRAW,indexDatatype:Oe.UNSIGNED_SHORT}),n.vertexArrayDestroyable=!1,e.cache.cloudCollection_indexBufferBatched=n,n}function v5t(e){let t=e.cache.cloudCollection_indexBufferInstanced;return l(t)||(t=it.createIndexBuffer({context:e,typedArray:new Uint16Array([0,1,2,0,2,3]),usage:Pe.STATIC_DRAW,indexDatatype:Oe.UNSIGNED_SHORT}),t.vertexArrayDestroyable=!1,e.cache.cloudCollection_indexBufferInstanced=t),t}function F5t(e){let t=e.cache.cloudCollection_vertexBufferInstanced;return l(t)||(t=it.createVertexBuffer({context:e,typedArray:new Float32Array([0,0,1,0,1,1,0,1]),usage:Pe.STATIC_DRAW}),t.vertexArrayDestroyable=!1,e.cache.cloudCollection_vertexBufferInstanced=t),t}function I5t(e,t,n){let i=[{index:pm.positionHighAndScaleX,componentsPerAttribute:4,componentDatatype:J.FLOAT,usage:Pe.STATIC_DRAW},{index:pm.positionLowAndScaleY,componentsPerAttribute:4,componentDatatype:J.FLOAT,usage:Pe.STATIC_DRAW},{index:pm.packedAttribute0,componentsPerAttribute:4,componentDatatype:J.FLOAT,usage:Pe.STATIC_DRAW},{index:pm.packedAttribute1,componentsPerAttribute:4,componentDatatype:J.FLOAT,usage:Pe.STATIC_DRAW},{index:pm.color,componentsPerAttribute:4,componentDatatype:J.UNSIGNED_BYTE,normalize:!0,usage:Pe.STATIC_DRAW}];n&&i.push({index:pm.direction,componentsPerAttribute:2,componentDatatype:J.FLOAT,vertexBuffer:F5t(e)});let o=n?t:4*t;return new db(e,i,o,n)}var Xae=new An;function uNe(e,t,n,i){let o,r=n[pm.positionHighAndScaleX],s=n[pm.positionLowAndScaleY],a=i.position;An.fromCartesian(a,Xae);let c=i.scale,d=Xae.high,u=Xae.low;e._instanced?(o=i._index,r(o,d.x,d.y,d.z,c.x),s(o,u.x,u.y,u.z,c.y)):(o=i._index*4,r(o+0,d.x,d.y,d.z,c.x),r(o+1,d.x,d.y,d.z,c.x),r(o+2,d.x,d.y,d.z,c.x),r(o+3,d.x,d.y,d.z,c.x),s(o+0,u.x,u.y,u.z,c.y),s(o+1,u.x,u.y,u.z,c.y),s(o+2,u.x,u.y,u.z,c.y),s(o+3,u.x,u.y,u.z,c.y))}function mNe(e,t,n,i){let o,r=n[pm.packedAttribute0],s=i.show,a=i.brightness;e._instanced?(o=i._index,r(o,s,a,0,0)):(o=i._index*4,r(o+0,s,a,0,0),r(o+1,s,a,1,0),r(o+2,s,a,1,1),r(o+3,s,a,0,1))}function hNe(e,t,n,i){let o,r=n[pm.packedAttribute1],s=i.maximumSize,a=i.slice;e._instanced?(o=i._index,r(o,s.x,s.y,s.z,a)):(o=i._index*4,r(o+0,s.x,s.y,s.z,a),r(o+1,s.x,s.y,s.z,a),r(o+2,s.x,s.y,s.z,a),r(o+3,s.x,s.y,s.z,a))}function fNe(e,t,n,i){let o,r=n[pm.color],s=i.color,a=U.floatToByte(s.red),c=U.floatToByte(s.green),d=U.floatToByte(s.blue),u=U.floatToByte(s.alpha);e._instanced?(o=i._index,r(o,a,c,d,u)):(o=i._index*4,r(o+0,a,c,d,u),r(o+1,a,c,d,u),r(o+2,a,c,d,u),r(o+3,a,c,d,u))}function P5t(e,t,n,i){uNe(e,t,n,i),mNe(e,t,n,i),hNe(e,t,n,i),fNe(e,t,n,i)}function X5t(e,t,n,i){let o=e,r=o._textureSliceWidth,s=o._noiseTextureRows,a=t.context;o._vaNoise=L5t(a),o._spNoise=tn.fromCache({context:a,vertexShaderSource:n,fragmentShaderSource:i,attributeLocations:{position:0}});let c=o.noiseDetail,d=o.noiseOffset;o._noiseTexture=new vt({context:a,width:r*r/s,height:r*s,pixelDatatype:Ue.UNSIGNED_BYTE,pixelFormat:Qe.RGBA,sampler:new Ot({wrapS:pn.REPEAT,wrapT:pn.REPEAT,minificationFilter:Ht.NEAREST,magnificationFilter:$n.NEAREST})});let u=new bu({vertexArray:o._vaNoise,shaderProgram:o._spNoise,outputTexture:o._noiseTexture,uniformMap:{u_noiseTextureDimensions:lNe(o),u_noiseDetail:function(){return c},u_noiseOffset:function(){return d}},persists:!1,owner:e,postExecute:function(m){o._ready=!0,o._loading=!1}});t.commandList.push(u),o._loading=!0}function N5t(e,t){let n=e,i=t.context;n._createVertexArray=!1,n._vaf=n._vaf&&n._vaf.destroy();let o=e._clouds,r=o.length;if(r>0){n._vaf=I5t(i,r,n._instanced);let s=n._vaf.writers,a;for(a=0;a<r;++a){let c=o[a];P5t(e,t,s,c)}n._vaf.commit(Yae(i))}}var Y5t=[];function M5t(e,t){let n=t.context,i=e,r=i._clouds.length,s=i._cloudsToUpdate,a=i._cloudsToUpdateIndex,c=i._propertiesChanged,d=Y5t;d.length=0,(c[_5t]||c[S5t])&&d.push(uNe),(c[T5t]||c[C5t])&&d.push(mNe),(c[Z5t]||c[R5t])&&d.push(hNe),c[E5t]&&d.push(fNe);let u=d.length,m=i._vaf.writers,p,b,f;if(a/r>.1){for(p=0;p<a;++p)for(b=s[p],b._dirty=!1,f=0;f<u;++f)d[f](e,t,m,b);i._vaf.commit(Yae(n))}else{for(p=0;p<a;++p){for(b=s[p],b._dirty=!1,f=0;f<u;++f)d[f](e,t,m,b);i._instanced?i._vaf.subCommit(b._index,1):i._vaf.subCommit(b._index*4,4)}i._vaf.endSubCommits()}i._cloudsToUpdateIndex=0}function w5t(e,t,n,i){let o=t.context,r=e,s=new Je({defines:[],sources:[n]});r._instanced&&s.defines.push("INSTANCED");let a=new Je({defines:[],sources:[i]});r.debugBillboards&&a.defines.push("DEBUG_BILLBOARDS"),r.debugEllipsoids&&a.defines.push("DEBUG_ELLIPSOIDS"),r._sp=tn.replaceCache({context:o,shaderProgram:r._sp,vertexShaderSource:s,fragmentShaderSource:a,attributeLocations:pm}),r._rs=ze.fromCache({depthTest:{enabled:!0,func:ie.LESS},depthMask:!1,blending:on.ALPHA_BLEND}),r._spCreated=!0,r._compiledDebugBillboards=r.debugBillboards,r._compiledDebugEllipsoids=r.debugEllipsoids}function k5t(e,t){let n=e,i=t.passes,o=n._uniforms,r=t.commandList;if(i.render){let s=n._colorCommands,a=n._vaf.va,c=a.length;s.length=c;for(let d=0;d<c;d++){let u=s[d];l(u)||(u=s[d]=new lt),u.pass=Le.TRANSLUCENT,u.owner=e,u.uniformMap=o,u.count=a[d].indicesCount,u.vertexArray=a[d].va,u.shaderProgram=n._sp,u.renderState=n._rs,n._instanced&&(u.count=6,u.instanceCount=n._clouds.length),r.push(u)}}}lp.prototype.update=function(e){if(Nae(this),!this.show)return;let t=this.debugBillboards||this.debugEllipsoids;this._ready=t?!0:l(this._noiseTexture),!this._ready&&!this._loading&&!t&&X5t(this,e,Xv,Pv),this._instanced=e.context.instancedArrays,pm=this._instanced?x5t:y5t,Yae=this._instanced?v5t:W5t;let i=this._clouds.length,o=this._cloudsToUpdate,r=this._cloudsToUpdateIndex;this._createVertexArray?N5t(this,e):r>0&&M5t(this,e),r>i*1.5&&(o.length=i),!(!l(this._vaf)||!l(this._vaf.va)||!this._ready&!t)&&((!this._spCreated||this.debugBillboards!==this._compiledDebugBillboards||this.debugEllipsoids!==this._compiledDebugEllipsoids)&&w5t(this,e,Iv,Fv),k5t(this,e))};lp.prototype.isDestroyed=function(){return!1};lp.prototype.destroy=function(){return this._noiseTexture=this._noiseTexture&&this._noiseTexture.destroy(),this._sp=this._sp&&this._sp.destroy(),this._vaf=this._vaf&&this._vaf.destroy(),dNe(this._clouds),ue(this)};var Mae=lp;var uYo=x(T(),1);var U5t=W.toRadians(30);function wae(e){this._angle=e??U5t}Object.defineProperties(wae.prototype,{angle:{get:function(){return this._angle},set:function(e){this._angle=e}}});wae.prototype.emit=function(e){let t=Math.tan(this._angle),n=W.randomBetween(0,W.TWO_PI),i=W.randomBetween(0,t),o=i*Math.cos(n),r=i*Math.sin(n),s=1;e.velocity=h.fromElements(o,r,s,e.velocity),h.normalize(e.velocity,e.velocity),e.position=h.clone(h.ZERO,e.position)};var kae=wae;var EYo=x(T(),1);var D5t=new U,O5t=new U,B5t=new U,z5t=new U,pNe=new ce,IU=new Uint8Array(4);function bNe(e,t,n,i){let o=t.height===n.height?0:(e-t.height)/(n.height-t.height);return U.lerp(t.color,n.color,o,i)}function yJ(e,t){return{height:e,color:U.clone(t)}}function gNe(e){return e=e.filter(function(t,n,i){let o=n>0,r=n<i.length-1,s=o?t.height===i[n-1].height:!0,a=r?t.height===i[n+1].height:!0;return!s||!a}),e=e.filter(function(t,n,i){let o=n>0,r=n<i.length-1,s=o?U.equals(t.color,i[n-1].color):!1,a=r?U.equals(t.color,i[n+1].color):!1;return!s||!a}),e=e.filter(function(t,n,i){let o=n>0,r=o?U.equals(t.color,i[n-1].color):!1,s=o?t.height===i[n-1].height:!0;return!r||!s}),e}function H5t(e){let t,n,i=[],o=e.length;for(t=0;t<o;t++){let r=e[t],s=r.entries,a=s.length,c=[];for(n=0;n<a;n++){let b=s[n],f=W.clamp(b.height,du._minimumHeight,du._maximumHeight),y=U.clone(b.color,D5t);y.red*=y.alpha,y.green*=y.alpha,y.blue*=y.alpha,c.push(yJ(f,y))}let d=!0,u=!0;for(n=0;n<a-1;n++){let b=c[n+0],f=c[n+1];d=d&&b.height<=f.height,u=u&&b.height>=f.height}u?c=c.reverse():d||L0(c,function(b,f){return W.sign(b.height-f.height)});let m=r.extendDownwards??!1,p=r.extendUpwards??!1;c.length===1&&!m&&!p&&(m=!0,p=!0),m&&c.splice(0,0,yJ(du._minimumHeight,c[0].color)),p&&c.splice(c.length,0,yJ(du._maximumHeight,c[c.length-1].color)),c=gNe(c),i.push(c)}return i}function K5t(e){let t=H5t(e),n=[],i,o;function r(d,u){n.push(yJ(d,u))}function s(d,u,m){let p=U.multiplyByScalar(m,1-u.alpha,z5t);p=U.add(p,u,p),r(d,p)}let a=t.length;for(o=0;o<a;o++){let d=t[o],u=0,m=0;i=n,n=[];let p=d.length,b=i.length;for(;u<p||m<b;){let f=u<p?d[u]:void 0,y=u>0?d[u-1]:void 0,_=u<p-1?d[u+1]:void 0,S=m<b?i[m]:void 0,Z=m>0?i[m-1]:void 0,R=m<b-1?i[m+1]:void 0;if(l(f)&&l(S)&&f.height===S.height){let C=l(R)&&S.height===R.height,E=!l(Z),A=!l(R),L=l(_)&&f.height===_.height,F=!l(y),I=!l(_);C?L?(s(f.height,f.color,S.color),s(f.height,_.color,R.color)):F?(r(f.height,S.color),s(f.height,f.color,R.color)):I?(s(f.height,f.color,S.color),r(f.height,R.color)):(s(f.height,f.color,S.color),s(f.height,f.color,R.color)):E?L?(r(f.height,f.color),s(f.height,_.color,S.color)):I?(r(f.height,f.color),r(f.height,S.color)):(F||r(f.height,f.color),s(f.height,f.color,S.color)):A?L?(s(f.height,f.color,S.color),r(f.height,_.color)):F?(r(f.height,S.color),r(f.height,f.color)):I?s(f.height,f.color,S.color):(s(f.height,f.color,S.color),r(f.height,f.color)):L?(s(f.height,f.color,S.color),s(f.height,_.color,S.color)):F?(r(f.height,S.color),s(f.height,f.color,S.color)):I?(s(f.height,f.color,S.color),r(f.height,S.color)):s(f.height,f.color,S.color),u+=L?2:1,m+=C?2:1}else if(l(f)&&l(S)&&l(Z)&&f.height<S.height){let C=bNe(f.height,Z,S,B5t);l(y)?l(_)?s(f.height,f.color,C):(s(f.height,f.color,C),r(f.height,C)):(r(f.height,C),s(f.height,f.color,C)),u++}else if(l(S)&&l(f)&&l(y)&&S.height<f.height){let C=bNe(S.height,y,f,O5t);l(Z)?l(R)?s(S.height,C,S.color):(s(S.height,C,S.color),r(S.height,C)):(r(S.height,C),s(S.height,C,S.color)),m++}else l(f)&&(!l(S)||f.height<S.height)?(l(S)&&!l(Z)&&!l(_)?(r(f.height,f.color),r(f.height,du._emptyColor),r(S.height,du._emptyColor)):(!l(S)&&l(Z)&&!l(y)&&(r(Z.height,du._emptyColor),r(f.height,du._emptyColor)),r(f.height,f.color)),u++):l(S)&&(!l(f)||S.height<f.height)&&(r(S.height,S.color),m++)}}return gNe(n)}function du(e){let{scene:t,layers:n}=e??B.EMPTY_OBJECT,{context:i}=t,o=K5t(n),r=o.length,s,a,c;if(!du._useFloatTexture(i)){a=Ue.UNSIGNED_BYTE,c=Qe.RGBA,s=new Uint8Array(r*4);for(let b=0;b<r;b++)ce.packFloat(o[b].height,pNe),ce.pack(pNe,s,b*4)}else{a=Ue.FLOAT,c=i.webgl2?Qe.RED:Qe.LUMINANCE,s=new Float32Array(r);for(let b=0;b<r;b++)s[b]=o[b].height}let u=vt.create({context:i,pixelFormat:c,pixelDatatype:a,source:{arrayBufferView:s,width:r,height:1},sampler:new Ot({wrapS:pn.CLAMP_TO_EDGE,wrapT:pn.CLAMP_TO_EDGE,minificationFilter:Ht.NEAREST,magnificationFilter:$n.NEAREST})}),m=new Uint8Array(r*4);for(let b=0;b<r;b++)o[b].color.toBytes(IU),m[b*4+0]=IU[0],m[b*4+1]=IU[1],m[b*4+2]=IU[2],m[b*4+3]=IU[3];let p=vt.create({context:i,pixelFormat:Qe.RGBA,pixelDatatype:Ue.UNSIGNED_BYTE,source:{arrayBufferView:m,width:r,height:1},sampler:new Ot({wrapS:pn.CLAMP_TO_EDGE,wrapT:pn.CLAMP_TO_EDGE,minificationFilter:Ht.LINEAR,magnificationFilter:$n.LINEAR})});return eo.fromType("ElevationBand",{heights:u,colors:p})}du._useFloatTexture=function(e){return e.floatingPointTexture};du._maximumHeight=5906376425472;du._minimumHeight=-5906376425472;du._emptyColor=new U(0,0,0,0);var Uae=du;var XYo=x(T(),1);async function J5t(e,t){t=t??{},t.cacheBytes=t.cacheBytes??1536*1024*1024,t.maximumCacheOverflowBytes=t.maximumCacheOverflowBytes??1024*1024*1024,t.enableCollision=t.enableCollision??!0,e=e??B.EMPTY_OBJECT,e.onlyUsingWithGoogleGeocoder||xt("google-tiles-with-google-geocoder","Only the Google geocoder can be used with Google Photorealistic 3D Tiles. Set the `geocode` property of Viewer constructor options. You can set additionalOptions.onlyUsingWithGoogleGeocoder to hide this warning once you have configured the geocoder.");let n=e.key??_a.defaultApiKey;if(!l(n))return j5t(t);let i,o=_a.getDefaultCredit();l(o)&&(i=[o]);let r=new ve({url:`${_a.mapTilesApiEndpoint}v1/3dtiles/root.json`,queryParameters:{key:n},credits:i});return zr.fromUrl(r,t)}var yNe={};async function j5t(e){let i=yNe[2275207];l(i)||(i=Ur.fromAssetId(2275207),yNe[2275207]=i);let o=await i;return zr.fromUrl(o,e)}var Dae=J5t;var DYo=x(T(),1);async function Q5t(e){let t=await zr.fromIonAssetId(96188,e);e=e??B.EMPTY_OBJECT;let n=e.style;if(!l(n)){let i=(e.defaultColor??U.WHITE).toCssColorString();n=new sg({color:`Boolean(\${feature['cesium#color']}) ? color(\${feature['cesium#color']}) : ${i}`})}return t.style=n,t}var Oae=Q5t;var $Yo=x(T(),1);function q5t(e){e=e??B.EMPTY_OBJECT;let t=[],n=e.geometry;(!l(n.attributes)||!l(n.primitiveType))&&(n=n.constructor.createGeometry(n));let i=n.attributes,o=P.clone(e.modelMatrix??P.IDENTITY),r=e.length??1e4;if(l(i.normal)&&t.push(new Yt({geometry:Bn.createLineSegmentsForVectors(n,"normal",r),attributes:{color:new $t(1,0,0,1)},modelMatrix:o})),l(i.tangent)&&t.push(new Yt({geometry:Bn.createLineSegmentsForVectors(n,"tangent",r),attributes:{color:new $t(0,1,0,1)},modelMatrix:o})),l(i.bitangent)&&t.push(new Yt({geometry:Bn.createLineSegmentsForVectors(n,"bitangent",r),attributes:{color:new $t(0,0,1,1)},modelMatrix:o})),t.length>0)return new In({asynchronous:!1,geometryInstances:t,appearance:new Tn({flat:!0,translucent:!1})})}var Bae=q5t;var oMo=x(T(),1);function PU(e){e=e??B.EMPTY_OBJECT;let t=e.attributeName,n=e.perInstanceAttribute;l(n)||(n=!1);let i=e.glslDatatype??"vec3",o=`v_${t}`,r;if(t==="normal"||t==="tangent"||t==="bitangent")r=`vec4 getColor() { return vec4((${o} + vec3(1.0)) * 0.5, 1.0); } -`;else switch(t==="st"&&(i="vec2"),i){case"float":r=`vec4 getColor() { return vec4(vec3(${o}), 1.0); } -`;break;case"vec2":r=`vec4 getColor() { return vec4(${o}, 0.0, 1.0); } -`;break;case"vec3":r=`vec4 getColor() { return vec4(${o}, 1.0); } -`;break;case"vec4":r=`vec4 getColor() { return ${o}; } -`;break}let s=`in vec3 position3DHigh; -in vec3 position3DLow; -in float batchId; -${n?"":`in ${i} ${t}; -`}out ${i} ${o}; -void main() -{ -vec4 p = czm_translateRelativeToEye(position3DHigh, position3DLow); -${n?`${o} = czm_batchTable_${t}(batchId); -`:`${o} = ${t}; -`}gl_Position = czm_modelViewProjectionRelativeToEye * p; -}`,a=`in ${i} ${o}; -${r} -void main() -{ -out_FragColor = getColor(); -}`;this.material=void 0,this.translucent=e.translucent??!1,this._vertexShaderSource=e.vertexShaderSource??s,this._fragmentShaderSource=e.fragmentShaderSource??a,this._renderState=Go.getDefaultRenderState(!1,!1,e.renderState),this._closed=e.closed??!1,this._attributeName=t,this._glslDatatype=i}Object.defineProperties(PU.prototype,{vertexShaderSource:{get:function(){return this._vertexShaderSource}},fragmentShaderSource:{get:function(){return this._fragmentShaderSource}},renderState:{get:function(){return this._renderState}},closed:{get:function(){return this._closed}},attributeName:{get:function(){return this._attributeName}},glslDatatype:{get:function(){return this._glslDatatype}}});PU.prototype.getFragmentShaderSource=Go.prototype.getFragmentShaderSource;PU.prototype.isTranslucent=Go.prototype.isTranslucent;PU.prototype.getRenderState=Go.prototype.getRenderState;var zae=PU;var gMo=x(T(),1);function xJ(e){e=e??B.EMPTY_OBJECT,this.length=e.length??1e7,this._length=void 0,this.width=e.width??2,this._width=void 0,this.show=e.show??!0,this.modelMatrix=P.clone(e.modelMatrix??P.IDENTITY),this._modelMatrix=new P,this.id=e.id,this._id=void 0,this._primitive=void 0}xJ.prototype.update=function(e){if(this.show){if(!l(this._primitive)||!P.equals(this._modelMatrix,this.modelMatrix)||this._length!==this.length||this._width!==this.width||this._id!==this.id){this._modelMatrix=P.clone(this.modelMatrix,this._modelMatrix),this._length=this.length,this._width=this.width,this._id=this.id,l(this._primitive)&&this._primitive.destroy(),this.modelMatrix[12]===0&&this.modelMatrix[13]===0&&this.modelMatrix[14]===0&&(this.modelMatrix[14]=.01);let t=new Yt({geometry:new Xg({positions:[h.ZERO,h.UNIT_X],width:this.width,vertexFormat:ws.VERTEX_FORMAT,colors:[U.RED,U.RED],arcType:un.NONE}),modelMatrix:P.multiplyByUniformScale(this.modelMatrix,this.length,new P),id:this.id,pickPrimitive:this}),n=new Yt({geometry:new Xg({positions:[h.ZERO,h.UNIT_Y],width:this.width,vertexFormat:ws.VERTEX_FORMAT,colors:[U.GREEN,U.GREEN],arcType:un.NONE}),modelMatrix:P.multiplyByUniformScale(this.modelMatrix,this.length,new P),id:this.id,pickPrimitive:this}),i=new Yt({geometry:new Xg({positions:[h.ZERO,h.UNIT_Z],width:this.width,vertexFormat:ws.VERTEX_FORMAT,colors:[U.BLUE,U.BLUE],arcType:un.NONE}),modelMatrix:P.multiplyByUniformScale(this.modelMatrix,this.length,new P),id:this.id,pickPrimitive:this});this._primitive=new In({geometryInstances:[t,n,i],appearance:new ws,asynchronous:!1})}this._primitive.update(e)}};xJ.prototype.isDestroyed=function(){return!1};xJ.prototype.destroy=function(){return this._primitive=this._primitive&&this._primitive.destroy(),ue(this)};var XU=xJ;var TMo=x(T(),1);var $5t=new TextDecoder,TJ={UNKNOWN:0,POINT:1,LINESTRING:2,POLYGON:3},eDt={LAYERS:3},NU={NAME:1,FEATURES:2,KEYS:3,VALUES:4,EXTENT:5},Hae={TAGS:2,TYPE:3,GEOMETRY:4},NR={STRING:1,FLOAT:2,DOUBLE:3,INT64:4,UINT64:5,SINT64:6,BOOL:7},tDt=["Unknown","Point","LineString","Polygon"];function nDt(e){let t=new Uint8Array(e),n=[],i=0;for(;i<t.length;){let o=_J(t,i,t.length),r=o.fieldNumber,s=o.wireType;if(i=o.newPos,r===eDt.LAYERS&&s===2){let a=py(t,i,t.length);i=a.newPos;let c=uu(i,a.value,t.length,"layer");n.push(iDt(t,i,c)),i=c}else i=SJ(t,i,s,t.length)}return{layers:n}}function iDt(e,t,n){let i=t,o="",r=4096,s=[],a=[],c=[];for(;i<n;){let u=_J(e,i,n),m=u.fieldNumber,p=u.wireType;if(i=u.newPos,m===NU.NAME&&p===2){let b=py(e,i,n);i=b.newPos;let f=uu(i,b.value,n,"layer name");o=Jae(e,i,b.value),i=f}else if(m===NU.FEATURES&&p===2){let b=py(e,i,n);i=b.newPos;let f=uu(i,b.value,n,"feature");c.push({start:i,end:f}),i=f}else if(m===NU.KEYS&&p===2){let b=py(e,i,n);i=b.newPos;let f=uu(i,b.value,n,"key");s.push(Jae(e,i,b.value)),i=f}else if(m===NU.VALUES&&p===2){let b=py(e,i,n);i=b.newPos;let f=uu(i,b.value,n,"value"),y=sDt(e,i,f);a.push(y),i=f}else if(m===NU.EXTENT&&p===0){let b=WA(e,i,n);r=b.value,i=b.newPos}else i=SJ(e,i,p,n)}let d=c.map(({start:u,end:m})=>oDt(e,u,m,s,a));return{name:o,extent:r,features:d}}function oDt(e,t,n,i,o){let r=t,s=TJ.UNKNOWN,a=[],c=[];for(;r<n;){let m=_J(e,r,n),p=m.fieldNumber,b=m.wireType;if(r=m.newPos,p===Hae.TYPE&&b===0){let f=WA(e,r,n);s=f.value,r=f.newPos}else if(p===Hae.TAGS&&b===2){let f=py(e,r,n);r=f.newPos;let y=uu(r,f.value,n,"feature tags");for(;r<y;){let _=WA(e,r,y);a.push(_.value),r=_.newPos}}else if(p===Hae.GEOMETRY&&b===2){let f=py(e,r,n);r=f.newPos;let y=uu(r,f.value,n,"feature geometry");for(;r<y;){let _=WA(e,r,y);c.push(_.value),r=_.newPos}}else r=SJ(e,r,b,n)}let d={};for(let m=0;m<a.length-1;m+=2){let p=i[a[m]],b=o[a[m+1]];typeof p!="string"||b===void 0||(d[p]=b)}let u=rDt(s,c);return{type:tDt[s]??"Unknown",geometry:u,properties:d}}function rDt(e,t){let n=0,i=0,o=0;if(e===TJ.POINT){let r=[];for(;n<t.length;){let s=t[n++],a=s&7,c=s>>3;if(a===1)for(let d=0;d<c;d++)i+=B0(t[n++]),o+=B0(t[n++]),r.push({x:i,y:o})}return r}if(e===TJ.LINESTRING){let r=[],s=null;for(;n<t.length;){let a=t[n++],c=a&7,d=a>>3;if(c===1)s!==null&&r.push(s),s=[],i+=B0(t[n++]),o+=B0(t[n++]),s.push({x:i,y:o});else if(c===2)for(let u=0;u<d;u++)i+=B0(t[n++]),o+=B0(t[n++]),s.push({x:i,y:o})}return s!==null&&r.push(s),r}if(e===TJ.POLYGON){let r=[],s=null;for(;n<t.length;){let a=t[n++],c=a&7,d=a>>3;if(c===1)s!==null&&r.push(s),s=[],i+=B0(t[n++]),o+=B0(t[n++]),s.push({x:i,y:o});else if(c===2)for(let u=0;u<d;u++)i+=B0(t[n++]),o+=B0(t[n++]),s.push({x:i,y:o});else c===7&&s!==null&&s.length>0&&(s.push({x:s[0].x,y:s[0].y}),r.push(s),s=null)}return s!==null&&r.push(s),r}return[]}function sDt(e,t,n){let i=t;for(;i<n;){let o=_J(e,i,n),r=o.fieldNumber,s=o.wireType;if(i=o.newPos,r===NR.STRING&&s===2){let a=py(e,i,n);i=a.newPos;let c=uu(i,a.value,n,"string value");return Jae(e,i,c-i)}else{if(r===NR.FLOAT&&s===5)return uu(i,4,n,"float value"),new DataView(e.buffer,e.byteOffset+i,4).getFloat32(0,!0);if(r===NR.DOUBLE&&s===1)return uu(i,8,n,"double value"),new DataView(e.buffer,e.byteOffset+i,8).getFloat64(0,!0);if(r===NR.INT64&&s===0){let a=vA(e,i,n);return Kae(a.value)}else if(r===NR.UINT64&&s===0){let a=vA(e,i,n);return Kae(a.value)}else if(r===NR.SINT64&&s===0){let a=vA(e,i,n);return Kae(aDt(a.value))}else if(r===NR.BOOL&&s===0)return WA(e,i,n).value!==0}i=SJ(e,i,s,n)}}function _J(e,t,n){let i=WA(e,t,n);return{fieldNumber:i.value>>>3,wireType:i.value&7,newPos:i.newPos}}function WA(e,t,n){let i=vA(e,t,n,5);if(i.value>0xffffffffn)throw new ae("Invalid MVT uint32 varint.");return{value:Number(i.value),newPos:i.newPos}}function py(e,t,n){let i=vA(e,t,n);if(i.value>BigInt(Number.MAX_SAFE_INTEGER))throw new ae("Invalid MVT length varint.");return{value:Number(i.value),newPos:i.newPos}}function vA(e,t,n,i){let o=0n,r=0n,s=0,a=i??10;for(;;){if(t>=n||t>=e.length)throw new ae("Invalid MVT: truncated varint.");let c=e[t++];if(o|=BigInt(c&127)<<r,s++,(c&128)===0)break;if(s>=a)throw new ae("Invalid MVT: varint is too long.");r+=7n}return{value:o,newPos:t}}function Jae(e,t,n){let i=uu(t,n,e.length,"string");return $5t.decode(e.subarray(t,i))}function uu(e,t,n,i){if(!Number.isFinite(t)||t<0)throw new ae(`Invalid MVT ${i}: invalid length.`);let o=e+t;if(!Number.isFinite(o)||o<e||o>n)throw new ae(`Invalid MVT ${i}: length exceeds available bytes.`);return o}function SJ(e,t,n,i){if(n===0)return vA(e,t,i).newPos;if(n===1)return uu(t,8,i,"fixed64 field");if(n===2){let o=py(e,t,i);return uu(o.newPos,o.value,i,"length-delimited field")}else if(n===5)return uu(t,4,i,"fixed32 field");throw new ae(`Unsupported protobuf wire type: ${n}`)}function B0(e){return e>>>1^-(e&1)}function aDt(e){return e>>1n^-(e&1n)}function Kae(e){return e<=BigInt(Number.MAX_SAFE_INTEGER)&&e>=BigInt(Number.MIN_SAFE_INTEGER)?Number(e):e}var YU=nDt;var RMo=x(T(),1);function cDt(e){this.direction=h.clone(e.direction),this.color=U.clone(e.color??U.WHITE),this.intensity=e.intensity??1}var jae=cDt;var NMo=x(T(),1);var VMo=x(T(),1),MU=`in vec3 v_positionMC; +${f}`);let y=document.createElement("div");y.className="cesium-widget-errorPanel-message-details collapsed";let _=document.createElement("span");_.className="cesium-widget-errorPanel-more-details",_.appendChild(document.createTextNode("See more...")),y.appendChild(_),y.onclick=function(S){y.removeChild(_),y.appendChild(document.createTextNode(f)),y.className="cesium-widget-errorPanel-message-details",r.className="cesium-widget-errorPanel-content expanded",y.onclick=void 0},a.appendChild(y)}b.innerHTML=`<p>${t}</p>`}let m=document.createElement("div");m.className="cesium-widget-errorPanel-buttonPanel",r.appendChild(m);let p=document.createElement("button");p.setAttribute("type","button"),p.className="cesium-button",p.appendChild(document.createTextNode("OK")),p.onclick=function(){l(c)&&l(window.removeEventListener)&&window.removeEventListener("resize",c,!1),i.removeChild(o)},m.appendChild(p),i.appendChild(o)};zo.prototype.isDestroyed=function(){return!1};zo.prototype.destroy=function(){let e=this.dataSources,t=e.length;for(let n=0;n<t;n++)this._dataSourceRemoved(e,e.get(n));this._dataSourceRemoved(void 0,this._dataSourceDisplay.defaultDataSource),this._dataSourceDisplay=this._dataSourceDisplay.destroy(),l(this._scene)&&(this._scene.renderError.removeEventListener(this._onRenderError),this._scene=this._scene.destroy()),this._container.removeChild(this._element),this._creditContainer.removeChild(this._innerCreditContainer),this._eventHelper.removeAll(),this._destroyDataSourceCollection&&(this._dataSourceCollection=this._dataSourceCollection.destroy()),ue(this)};zo.prototype.resize=function(){let e=this._canvas;!this._forceResize&&this._canvasClientWidth===e.clientWidth&&this._canvasClientHeight===e.clientHeight&&this._lastDevicePixelRatio===window.devicePixelRatio||(this._forceResize=!1,bWe(this),gWe(this),this._scene.requestRender())};zo.prototype.render=function(){if(this._canRender){this._scene.initializeFrame();let e=this._clock.tick();this._scene.render(e)}else this._clock.tick()};zo.prototype._dataSourceAdded=function(e,t){t.entities.collectionChanged.addEventListener(zo.prototype._onEntityCollectionChanged,this)};zo.prototype._dataSourceRemoved=function(e,t){let n=t.entities;n.collectionChanged.removeEventListener(zo.prototype._onEntityCollectionChanged,this),l(this.trackedEntity)&&n.getById(this.trackedEntity.id)===this.trackedEntity&&(this.trackedEntity=void 0)};zo.prototype._updateCanAnimate=function(e){this._clock.canAnimate=e};var pFt=new me;zo.prototype._onTick=function(e){let t=e.currentTime,n=this._dataSourceDisplay.update(t);this._allowDataSourcesToSuspendAnimation&&this._canAnimateUpdateCallback(n);let i=this._entityView;if(l(i)){let o=this._trackedEntity;this._dataSourceDisplay.getBoundingSphere(o,!1,i.boundingSphere??pFt)===Wt.DONE&&i.update(t)}};zo.prototype._onEntityCollectionChanged=function(e,t,n){let i=n.length;for(let o=0;o<i;o++){let r=n[o];this.trackedEntity===r&&(this.trackedEntity=void 0)}};zo.prototype._clearTrackedObject=function(){this.trackedEntity=void 0};zo.prototype._onDataSourceChanged=function(e){this.clockTrackedDataSource===e&&fWe(this.clock,e)};zo.prototype._onDataSourceAdded=function(e,t){this._automaticallyTrackDataSourceClocks&&(this.clockTrackedDataSource=t);let n=t.entities.id,i=this._eventHelper.add(t.changedEvent,zo.prototype._onDataSourceChanged,this);this._dataSourceChangedListeners[n]=i};zo.prototype._onDataSourceRemoved=function(e,t){let n=this.clockTrackedDataSource===t,i=t.entities.id;if(this._dataSourceChangedListeners[i](),this._dataSourceChangedListeners[i]=void 0,n){let o=e.length;this._automaticallyTrackDataSourceClocks&&o>0?this.clockTrackedDataSource=e.get(o-1):this.clockTrackedDataSource=void 0}};zo.prototype.addController=function(e){return this.scene.controllerHost.registerController(e,this.container)};zo.prototype.removeController=function(e){return this.scene.controllerHost.unregisterController(e,this.container)};zo.prototype.zoomTo=function(e,t){return yWe(this,e,{offset:t},!1)};zo.prototype.flyTo=function(e,t){return yWe(this,e,t,!0)};function yWe(e,t,n,i){oie(e);let o=new Promise(r=>{e._completeZoom=function(s){r(s)}});return e._zoomPromise=o,e._zoomIsFlight=i,e._zoomOptions=n,Promise.resolve(t).then(function(r){if(e._zoomPromise===o){if(r instanceof Cs){let s;l(r.imageryProvider)?s=Promise.resolve(r.getImageryRectangle()):s=new Promise(a=>{let c=r.readyEvent.addEventListener(()=>{c(),a(r.getImageryRectangle())})}),s.then(function(a){return yZ(a,e.scene)}).then(function(a){e._zoomPromise===o&&(e._zoomTarget=a)});return}if(r instanceof Hr||r instanceof yE||r instanceof uT||r instanceof na){e._zoomTarget=r;return}if(r.isLoading&&l(r.loadingEvent)){let s=r.loadingEvent.addEventListener(function(){s(),e._zoomPromise===o&&(e._zoomTarget=r.entities.values.slice(0))});return}if(Array.isArray(r)){e._zoomTarget=r.slice(0);return}r=r.values??r,l(r.entities)&&(r=r.entities.values),Array.isArray(r)?e._zoomTarget=r.slice(0):e._zoomTarget=[r]}}),e.scene.requestRender(),o}function ok(e){e._zoomPromise=void 0,e._zoomTarget=void 0,e._zoomOptions=void 0}function oie(e){let t=e._zoomPromise;l(t)&&(ok(e),e._completeZoom(!1))}zo.prototype._postRender=function(){bFt(this),gFt(this)};var mWe=new me;function bFt(e){let t=e._zoomTarget;if(!l(t)||e.scene.mode===se.MORPHING)return;let n=e.scene,i=n.camera,o=e._zoomOptions??{},r;function s(u){l(o.offset)||(o.offset=new Am(0,-.5,u.radius)),r={offset:o.offset,duration:o.duration,maximumHeight:o.maximumHeight,complete:function(){e._completeZoom(!0)},cancel:function(){e._completeZoom(!1)}},e._zoomIsFlight?i.flyToBoundingSphere(u,r):(i.viewBoundingSphere(u,o.offset),i.lookAtTransform(P.IDENTITY),e._completeZoom(!0)),ok(e)}if(t instanceof yE){if(l(t.boundingSphere)){s(t.boundingSphere);return}let u=t.frameChanged.addEventListener(function(m){s(m.boundingSphere),u()});return}if(t instanceof Hr||t instanceof uT){s(t.boundingSphere);return}if(t instanceof na){s(t.boundingVolume);return}if(t instanceof pe){r={destination:n.ellipsoid.cartographicToCartesian(t),duration:o.duration,maximumHeight:o.maximumHeight,complete:function(){e._completeZoom(!0)},cancel:function(){e._completeZoom(!1)}},e._zoomIsFlight?i.flyTo(r):(i.setView(r),e._completeZoom(!0)),ok(e);return}let a=t,c=[];for(let u=0,m=a.length;u<m;u++){let p=e._dataSourceDisplay.getBoundingSphere(a[u],!1,mWe);if(p===Wt.PENDING)return;p!==Wt.FAILED&&c.push(me.clone(mWe))}if(c.length===0){oie(e);return}e.trackedEntity=void 0;let d=me.fromBoundingSpheres(c);e._zoomIsFlight?(ok(e),i.flyToBoundingSphere(d,{duration:o.duration,maximumHeight:o.maximumHeight,complete:function(){e._completeZoom(!0)},cancel:function(){e._completeZoom(!1)},offset:o.offset})):(i.viewBoundingSphere(d,o.offset),i.lookAtTransform(P.IDENTITY),ok(e),e._completeZoom(!0))}var hWe=new me;function gFt(e){if(!e._needTrackedEntityUpdate)return;let t=e._trackedEntity,n=e.clock.currentTime,i=j.getValueOrUndefined(t.position,n);if(!l(i))return;let o=e.scene,r=e._dataSourceDisplay.getBoundingSphere(t,!1,hWe);if(r===Wt.PENDING)return;let s=o.mode;(s===se.COLUMBUS_VIEW||s===se.SCENE2D)&&(o.screenSpaceCameraController.enableTranslate=!1),(s===se.COLUMBUS_VIEW||s===se.SCENE3D)&&(o.screenSpaceCameraController.enableTilt=!1);let a=r!==Wt.FAILED?hWe:void 0;e._entityView=new TM(t,o,o.ellipsoid),e._entityView.update(n,a),e._needTrackedEntityUpdate=!1}var rk=zo;var j0o=x(T(),1);var yFt=U.WHITE,xFt=U.BLACK,TFt=new k(2,2);function xE(e){e=e??B.EMPTY_OBJECT,this._definitionChanged=new Se,this._evenColor=void 0,this._evenColorSubscription=void 0,this._oddColor=void 0,this._oddColorSubscription=void 0,this._repeat=void 0,this._repeatSubscription=void 0,this.evenColor=e.evenColor,this.oddColor=e.oddColor,this.repeat=e.repeat}Object.defineProperties(xE.prototype,{isConstant:{get:function(){return j.isConstant(this._evenColor)&&j.isConstant(this._oddColor)&&j.isConstant(this._repeat)}},definitionChanged:{get:function(){return this._definitionChanged}},evenColor:be("evenColor"),oddColor:be("oddColor"),repeat:be("repeat")});xE.prototype.getType=function(e){return"Checkerboard"};var _Ft=new Q;xE.prototype.getValue=function(e,t){return l(e)||(e=Q.now(_Ft)),l(t)||(t={}),t.lightColor=j.getValueOrClonedDefault(this._evenColor,e,yFt,t.lightColor),t.darkColor=j.getValueOrClonedDefault(this._oddColor,e,xFt,t.darkColor),t.repeat=j.getValueOrDefault(this._repeat,e,TFt),t};xE.prototype.equals=function(e){return this===e||e instanceof xE&&j.equals(this._evenColor,e._evenColor)&&j.equals(this._oddColor,e._oddColor)&&j.equals(this._repeat,e._repeat)};var TE=xE;var ibo=x(T(),1);var Jz={id:void 0},_E=new Array(2);function rie(e){let t=e.propertyNames,n=t.length;for(let i=0;i<n;i++)e[t[i]]=void 0;e._name=void 0,e._availability=void 0}function xWe(e,t,n,i){_E[0]=n,_E[1]=i.id,t[JSON.stringify(_E)]=i.definitionChanged.addEventListener(Ls.prototype._onDefinitionChanged,e)}function TWe(e,t,n,i){_E[0]=n,_E[1]=i.id;let o=JSON.stringify(_E);t[o](),t[o]=void 0}function hT(e){if(e._shouldRecomposite=!0,e._suspendCount!==0)return;let t=e._collections,n=t.length,i=e._collectionsCopy,o=i.length,r,s,a,c,d,u=e._composite,m=new Ya(e),p=e._eventHash,b;for(r=0;r<o;r++)for(d=i[r],d.collectionChanged.removeEventListener(Ls.prototype._onCollectionChanged,e),a=d.values,b=d.id,c=a.length-1;c>-1;c--)s=a[c],TWe(e,p,b,s);for(r=n-1;r>=0;r--)for(d=t[r],d.collectionChanged.addEventListener(Ls.prototype._onCollectionChanged,e),a=d.values,b=d.id,c=a.length-1;c>-1;c--){s=a[c],xWe(e,p,b,s);let y=m.getById(s.id);l(y)||(y=u.getById(s.id),l(y)?rie(y):(Jz.id=s.id,y=new er(Jz)),m.add(y)),y.merge(s)}e._collectionsCopy=t.slice(0),u.suspendEvents(),u.removeAll();let f=m.values;for(r=0;r<f.length;r++)u.add(f[r]);u.resumeEvents()}function Ls(e,t){this._owner=t,this._composite=new Ya(this),this._suspendCount=0,this._collections=l(e)?e.slice():[],this._collectionsCopy=[],this._id=Qn(),this._eventHash={},hT(this),this._shouldRecomposite=!1}Object.defineProperties(Ls.prototype,{collectionChanged:{get:function(){return this._composite._collectionChanged}},id:{get:function(){return this._id}},values:{get:function(){return this._composite.values}},owner:{get:function(){return this._owner}}});Ls.prototype.addCollection=function(e,t){l(t)?this._collections.splice(t,0,e):this._collections.push(e),hT(this)};Ls.prototype.removeCollection=function(e){let t=this._collections.indexOf(e);return t!==-1?(this._collections.splice(t,1),hT(this),!0):!1};Ls.prototype.removeAllCollections=function(){this._collections.length=0,hT(this)};Ls.prototype.containsCollection=function(e){return this._collections.indexOf(e)!==-1};Ls.prototype.contains=function(e){return this._composite.contains(e)};Ls.prototype.indexOfCollection=function(e){return this._collections.indexOf(e)};Ls.prototype.getCollection=function(e){return this._collections[e]};Ls.prototype.getCollectionsLength=function(){return this._collections.length};function jz(e,t){return e.indexOf(t)}function _We(e,t,n){let i=e._collections;if(t=W.clamp(t,0,i.length-1),n=W.clamp(n,0,i.length-1),t===n)return;let o=i[t];i[t]=i[n],i[n]=o,hT(e)}Ls.prototype.raiseCollection=function(e){let t=jz(this._collections,e);_We(this,t,t+1)};Ls.prototype.lowerCollection=function(e){let t=jz(this._collections,e);_We(this,t,t-1)};Ls.prototype.raiseCollectionToTop=function(e){let t=jz(this._collections,e);t!==this._collections.length-1&&(this._collections.splice(t,1),this._collections.push(e),hT(this))};Ls.prototype.lowerCollectionToBottom=function(e){let t=jz(this._collections,e);t!==0&&(this._collections.splice(t,1),this._collections.splice(0,0,e),hT(this))};Ls.prototype.suspendEvents=function(){this._suspendCount++,this._composite.suspendEvents()};Ls.prototype.resumeEvents=function(){this._suspendCount--,this._shouldRecomposite&&this._suspendCount===0&&(hT(this),this._shouldRecomposite=!1),this._composite.resumeEvents()};Ls.prototype.computeAvailability=function(){return this._composite.computeAvailability()};Ls.prototype.getById=function(e){return this._composite.getById(e)};Ls.prototype._onCollectionChanged=function(e,t,n){let i=this._collectionsCopy,o=i.length,r=this._composite;r.suspendEvents();let s,a,c,d,u=n.length,m=this._eventHash,p=e.id;for(s=0;s<u;s++){let f=n[s];TWe(this,m,p,f);let y=f.id;for(a=o-1;a>=0;a--)c=i[a].getById(y),l(c)&&(l(d)||(d=r.getById(y),rie(d)),d.merge(c));l(d)||r.removeById(y),d=void 0}let b=t.length;for(s=0;s<b;s++){let f=t[s];xWe(this,m,p,f);let y=f.id;for(a=o-1;a>=0;a--)c=i[a].getById(y),l(c)&&(l(d)||(d=r.getById(y),l(d)?rie(d):(Jz.id=y,d=new er(Jz),r.add(d))),d.merge(c));d=void 0}r.resumeEvents()};Ls.prototype._onDefinitionChanged=function(e,t,n,i){let o=this._collections,r=this._composite,s=o.length,a=e.id,c=r.getById(a),d=c[t],u=!l(d),m=!0;for(let p=s-1;p>=0;p--){let b=o[p].getById(e.id);if(l(b)){let f=b[t];if(l(f)){if(m)if(m=!1,l(f.merge)&&l(f.clone))d=f.clone(d);else{d=f;break}d.merge(f)}}}u&&c.propertyNames.indexOf(t)===-1&&c.addProperty(t),c[t]=d};var sie=Ls;var dbo=x(T(),1);function fT(){this._definitionChanged=new Se,this._composite=new gl,this._composite.definitionChanged.addEventListener(fT.prototype._raiseDefinitionChanged,this)}Object.defineProperties(fT.prototype,{isConstant:{get:function(){return this._composite.isConstant}},definitionChanged:{get:function(){return this._definitionChanged}},intervals:{get:function(){return this._composite._intervals}}});fT.prototype.getType=function(e){let t=this._composite._intervals.findDataForIntervalContainingDate(e);if(l(t))return t.getType(e)};var SFt=new Q;fT.prototype.getValue=function(e,t){l(e)||(e=Q.now(SFt));let n=this._composite._intervals.findDataForIntervalContainingDate(e);if(l(n))return n.getValue(e,t)};fT.prototype.equals=function(e){return this===e||e instanceof fT&&this._composite.equals(e._composite,j.equals)};fT.prototype._raiseDefinitionChanged=function(){this._definitionChanged.raiseEvent(this)};var SE=fT;var rTo=x(T(),1);var mbo=x(T(),1),SWe=x(gu(),1);function ZFt(e){let t=new SWe.default(e);t.normalize();let n=t.path(),i=n.lastIndexOf("/");return i!==-1&&(n=n.substr(i+1)),n}var zg=ZFt;var bbo=x(T(),1);var RFt=W.factorial;function aie(e,t,n,i,o,r){let s=0,a,c,d;if(i>0){for(c=0;c<o;c++){for(a=!1,d=0;d<r.length&&!a;d++)c===r[d]&&(a=!0);a||(r.push(c),s+=aie(e,t,n,i-1,o,r),r.splice(r.length-1,1))}return s}for(s=1,c=0;c<o;c++){for(a=!1,d=0;d<r.length&&!a;d++)c===r[d]&&(a=!0);a||(s*=e-n[t[c]])}return s}var CFt=[],cie=class{static get type(){return"Hermite"}static getRequiredDataPoints(t,n){return n=n??0,Math.max(Math.floor((t+1)/(n+1)),2)}static interpolateOrderZero(t,n,i,o,r){l(r)||(r=new Array(o));let s,a,c,d,u,m,p=n.length,b=new Array(o);for(s=0;s<o;s++){r[s]=0;let S=new Array(p);for(b[s]=S,a=0;a<p;a++)S[a]=[]}let f=p,y=new Array(f);for(s=0;s<f;s++)y[s]=s;let _=p-1;for(d=0;d<o;d++){for(a=0;a<f;a++)m=y[a]*o+d,b[d][0].push(i[m]);for(s=1;s<f;s++){let S=!1;for(a=0;a<f-s;a++){let Z=n[y[a]],R=n[y[a+s]],C;R-Z<=0?(m=y[a]*o+o*s+d,C=i[m],b[d][s].push(C/RFt(s))):(C=b[d][s-1][a+1]-b[d][s-1][a],b[d][s].push(C/(R-Z))),S=S||C!==0}S||(_=s-1)}}for(c=0,u=0;c<=u;c++)for(s=c;s<=_;s++){let S=aie(t,y,n,c,s,[]);for(d=0;d<o;d++){let Z=b[d][s][0];r[d+c*o]+=Z*S}}return r}static interpolate(t,n,i,o,r,s,a){let c=o*(s+1);l(a)||(a=new Array(c));for(let Z=0;Z<c;Z++)a[Z]=0;let d=n.length,u=new Array(d*(r+1)),m;for(m=0;m<d;m++)for(let Z=0;Z<r+1;Z++)u[m*(r+1)+Z]=m;let p=u.length,b=CFt,f=VFt(b,u,n,i,o,r),y=[],_=p*(p+1)/2,S=Math.min(f,s);for(let Z=0;Z<=S;Z++)for(m=Z;m<=f;m++){y.length=0;let R=aie(t,u,n,Z,m,y),C=Math.floor(m*(1-m)/2)+p*m;for(let E=0;E<o;E++){let A=Math.floor(E*_),L=b[A+C];a[E+Z*o]+=L*R}}return a}};function VFt(e,t,n,i,o,r){let s,a,c=-1,d=t.length,u=d*(d+1)/2;for(let m=0;m<o;m++){let p=Math.floor(m*u);for(s=0;s<d;s++)a=t[s]*o*(r+1)+m,e[p+s]=i[a];for(let b=1;b<d;b++){let f=0,y=Math.floor(b*(1-b)/2)+d*b,_=!1;for(s=0;s<d-b;s++){let S=n[t[s]],Z=n[t[s+b]],R,C;if(Z-S<=0)a=t[s]*o*(r+1)+o*b+m,R=i[a],C=R/W.factorial(b),e[p+y+f]=C,f++;else{let E=Math.floor((b-1)*(2-b)/2)+d*(b-1);R=e[p+E+s+1]-e[p+E+s],C=R/(Z-S),e[p+y+f]=C,f++}_=_||R!==0}_&&(c=Math.max(c,b))}}return c}var sk=cie;var xbo=x(T(),1);var lie=class{static get type(){return"Lagrange"}static getRequiredDataPoints(t){return Math.max(t+1,2)}static interpolateOrderZero(t,n,i,o,r){l(r)||(r=new Array(o));let s,a,c=n.length;for(s=0;s<o;s++)r[s]=0;for(s=0;s<c;s++){let d=1;for(a=0;a<c;a++)if(a!==s){let u=n[s]-n[a];d*=(t-n[a])/u}for(a=0;a<o;a++)r[a]+=d*i[s*o+a]}return r}},ak=lie;var Sbo=x(T(),1);function Zl(e,t,n){this.clock=e??0,this.cone=t??0,this.magnitude=n??1}Zl.fromCartesian3=function(e,t){let n=e.x,i=e.y,o=e.z,r=n*n+i*i;return l(t)||(t=new Zl),t.clock=Math.atan2(i,n),t.cone=Math.atan2(Math.sqrt(r),o),t.magnitude=Math.sqrt(r+o*o),t};Zl.clone=function(e,t){if(l(e))return l(t)?(t.clock=e.clock,t.cone=e.cone,t.magnitude=e.magnitude,t):new Zl(e.clock,e.cone,e.magnitude)};Zl.normalize=function(e,t){return l(t)?(t.clock=e.clock,t.cone=e.cone,t.magnitude=1,t):new Zl(e.clock,e.cone,1)};Zl.equals=function(e,t){return e===t||l(e)&&l(t)&&e.clock===t.clock&&e.cone===t.cone&&e.magnitude===t.magnitude};Zl.equalsEpsilon=function(e,t,n){return n=n??0,e===t||l(e)&&l(t)&&Math.abs(e.clock-t.clock)<=n&&Math.abs(e.cone-t.cone)<=n&&Math.abs(e.magnitude-t.magnitude)<=n};Zl.prototype.equals=function(e){return Zl.equals(this,e)};Zl.prototype.clone=function(e){return Zl.clone(this,e)};Zl.prototype.equalsEpsilon=function(e,t){return Zl.equalsEpsilon(this,e,t)};Zl.prototype.toString=function(){return`(${this.clock}, ${this.cone}, ${this.magnitude})`};var ck=Zl;var hk=x(gu(),1);var Gbo=x(T(),1);function eR(){this._definitionChanged=new Se,this._startTime=void 0,this._stopTime=void 0,this._currentTime=void 0,this._clockRange=void 0,this._clockStep=void 0,this._multiplier=void 0}Object.defineProperties(eR.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},startTime:Hl("startTime"),stopTime:Hl("stopTime"),currentTime:Hl("currentTime"),clockRange:Hl("clockRange"),clockStep:Hl("clockStep"),multiplier:Hl("multiplier")});eR.prototype.clone=function(e){return l(e)||(e=new eR),e.startTime=this.startTime,e.stopTime=this.stopTime,e.currentTime=this.currentTime,e.clockRange=this.clockRange,e.clockStep=this.clockStep,e.multiplier=this.multiplier,e};eR.prototype.equals=function(e){return this===e||l(e)&&Q.equals(this.startTime,e.startTime)&&Q.equals(this.stopTime,e.stopTime)&&Q.equals(this.currentTime,e.currentTime)&&this.clockRange===e.clockRange&&this.clockStep===e.clockStep&&this.multiplier===e.multiplier};eR.prototype.merge=function(e){this.startTime=this.startTime??e.startTime,this.stopTime=this.stopTime??e.stopTime,this.currentTime=this.currentTime??e.currentTime,this.clockRange=this.clockRange??e.clockRange,this.clockStep=this.clockStep??e.clockStep,this.multiplier=this.multiplier??e.multiplier};eR.prototype.getValue=function(e){return l(e)||(e=new Dh),e.startTime=this.startTime??e.startTime,e.stopTime=this.stopTime??e.stopTime,e.currentTime=this.currentTime??e.currentTime,e.clockRange=this.clockRange??e.clockRange,e.multiplier=this.multiplier??e.multiplier,e.clockStep=this.clockStep??e.clockStep,e};var Kf=eR;var Mbo=x(T(),1);var EFt=U.WHITE,AFt=.1,GFt=new k(8,8),LFt=new k(0,0),WFt=new k(1,1);function ZE(e){e=e??B.EMPTY_OBJECT,this._definitionChanged=new Se,this._color=void 0,this._colorSubscription=void 0,this._cellAlpha=void 0,this._cellAlphaSubscription=void 0,this._lineCount=void 0,this._lineCountSubscription=void 0,this._lineThickness=void 0,this._lineThicknessSubscription=void 0,this._lineOffset=void 0,this._lineOffsetSubscription=void 0,this.color=e.color,this.cellAlpha=e.cellAlpha,this.lineCount=e.lineCount,this.lineThickness=e.lineThickness,this.lineOffset=e.lineOffset}Object.defineProperties(ZE.prototype,{isConstant:{get:function(){return j.isConstant(this._color)&&j.isConstant(this._cellAlpha)&&j.isConstant(this._lineCount)&&j.isConstant(this._lineThickness)&&j.isConstant(this._lineOffset)}},definitionChanged:{get:function(){return this._definitionChanged}},color:be("color"),cellAlpha:be("cellAlpha"),lineCount:be("lineCount"),lineThickness:be("lineThickness"),lineOffset:be("lineOffset")});ZE.prototype.getType=function(e){return"Grid"};var vFt=new Q;ZE.prototype.getValue=function(e,t){return l(e)||(e=Q.now(vFt)),l(t)||(t={}),t.color=j.getValueOrClonedDefault(this._color,e,EFt,t.color),t.cellAlpha=j.getValueOrDefault(this._cellAlpha,e,AFt),t.lineCount=j.getValueOrClonedDefault(this._lineCount,e,GFt,t.lineCount),t.lineThickness=j.getValueOrClonedDefault(this._lineThickness,e,WFt,t.lineThickness),t.lineOffset=j.getValueOrClonedDefault(this._lineOffset,e,LFt,t.lineOffset),t};ZE.prototype.equals=function(e){return this===e||e instanceof ZE&&j.equals(this._color,e._color)&&j.equals(this._cellAlpha,e._cellAlpha)&&j.equals(this._lineCount,e._lineCount)&&j.equals(this._lineThickness,e._lineThickness)&&j.equals(this._lineOffset,e._lineOffset)};var RE=ZE;var Hbo=x(T(),1);function CE(e){this._definitionChanged=new Se,this._color=void 0,this._colorSubscription=void 0,this.color=e}Object.defineProperties(CE.prototype,{isConstant:{get:function(){return j.isConstant(this._color)}},definitionChanged:{get:function(){return this._definitionChanged}},color:be("color")});CE.prototype.getType=function(e){return"PolylineArrow"};var FFt=new Q;CE.prototype.getValue=function(e,t){return l(e)||(e=Q.now(FFt)),l(t)||(t={}),t.color=j.getValueOrClonedDefault(this._color,e,U.WHITE,t.color),t};CE.prototype.equals=function(e){return this===e||e instanceof CE&&j.equals(this._color,e._color)};var VE=CE;var ngo=x(T(),1);var IFt=U.WHITE,PFt=U.TRANSPARENT,XFt=16,NFt=255;function EE(e){e=e??B.EMPTY_OBJECT,this._definitionChanged=new Se,this._color=void 0,this._colorSubscription=void 0,this._gapColor=void 0,this._gapColorSubscription=void 0,this._dashLength=void 0,this._dashLengthSubscription=void 0,this._dashPattern=void 0,this._dashPatternSubscription=void 0,this.color=e.color,this.gapColor=e.gapColor,this.dashLength=e.dashLength,this.dashPattern=e.dashPattern}Object.defineProperties(EE.prototype,{isConstant:{get:function(){return j.isConstant(this._color)&&j.isConstant(this._gapColor)&&j.isConstant(this._dashLength)&&j.isConstant(this._dashPattern)}},definitionChanged:{get:function(){return this._definitionChanged}},color:be("color"),gapColor:be("gapColor"),dashLength:be("dashLength"),dashPattern:be("dashPattern")});EE.prototype.getType=function(e){return"PolylineDash"};var YFt=new Q;EE.prototype.getValue=function(e,t){return l(e)||(e=Q.now(YFt)),l(t)||(t={}),t.color=j.getValueOrClonedDefault(this._color,e,IFt,t.color),t.gapColor=j.getValueOrClonedDefault(this._gapColor,e,PFt,t.gapColor),t.dashLength=j.getValueOrDefault(this._dashLength,e,XFt,t.dashLength),t.dashPattern=j.getValueOrDefault(this._dashPattern,e,NFt,t.dashPattern),t};EE.prototype.equals=function(e){return this===e||e instanceof EE&&j.equals(this._color,e._color)&&j.equals(this._gapColor,e._gapColor)&&j.equals(this._dashLength,e._dashLength)&&j.equals(this._dashPattern,e._dashPattern)};var AE=EE;var ugo=x(T(),1);var MFt=U.WHITE,wFt=.25,kFt=1;function GE(e){e=e??B.EMPTY_OBJECT,this._definitionChanged=new Se,this._color=void 0,this._colorSubscription=void 0,this._glowPower=void 0,this._glowPowerSubscription=void 0,this._taperPower=void 0,this._taperPowerSubscription=void 0,this.color=e.color,this.glowPower=e.glowPower,this.taperPower=e.taperPower}Object.defineProperties(GE.prototype,{isConstant:{get:function(){return j.isConstant(this._color)&&j.isConstant(this._glow)}},definitionChanged:{get:function(){return this._definitionChanged}},color:be("color"),glowPower:be("glowPower"),taperPower:be("taperPower")});GE.prototype.getType=function(e){return"PolylineGlow"};var UFt=new Q;GE.prototype.getValue=function(e,t){return l(e)||(e=Q.now(UFt)),l(t)||(t={}),t.color=j.getValueOrClonedDefault(this._color,e,MFt,t.color),t.glowPower=j.getValueOrDefault(this._glowPower,e,wFt,t.glowPower),t.taperPower=j.getValueOrDefault(this._taperPower,e,kFt,t.taperPower),t};GE.prototype.equals=function(e){return this===e||e instanceof GE&&j.equals(this._color,e._color)&&j.equals(this._glowPower,e._glowPower)&&j.equals(this._taperPower,e._taperPower)};var LE=GE;var Tgo=x(T(),1);var DFt=U.WHITE,OFt=U.BLACK,BFt=1;function WE(e){e=e??B.EMPTY_OBJECT,this._definitionChanged=new Se,this._color=void 0,this._colorSubscription=void 0,this._outlineColor=void 0,this._outlineColorSubscription=void 0,this._outlineWidth=void 0,this._outlineWidthSubscription=void 0,this.color=e.color,this.outlineColor=e.outlineColor,this.outlineWidth=e.outlineWidth}Object.defineProperties(WE.prototype,{isConstant:{get:function(){return j.isConstant(this._color)&&j.isConstant(this._outlineColor)&&j.isConstant(this._outlineWidth)}},definitionChanged:{get:function(){return this._definitionChanged}},color:be("color"),outlineColor:be("outlineColor"),outlineWidth:be("outlineWidth")});WE.prototype.getType=function(e){return"PolylineOutline"};var zFt=new Q;WE.prototype.getValue=function(e,t){return l(e)||(e=Q.now(zFt)),l(t)||(t={}),t.color=j.getValueOrClonedDefault(this._color,e,DFt,t.color),t.outlineColor=j.getValueOrClonedDefault(this._outlineColor,e,OFt,t.outlineColor),t.outlineWidth=j.getValueOrDefault(this._outlineWidth,e,BFt),t};WE.prototype.equals=function(e){return this===e||e instanceof WE&&j.equals(this._color,e._color)&&j.equals(this._outlineColor,e._outlineColor)&&j.equals(this._outlineWidth,e._outlineWidth)};var pT=WE;var Ago=x(T(),1);function Hg(e,t){this._value=void 0,this._definitionChanged=new Se,this._eventHelper=new kr,this._referenceFrame=t??Oi.FIXED,this.setValue(e)}Object.defineProperties(Hg.prototype,{isConstant:{get:function(){let e=this._value;if(!l(e))return!0;let t=e.length;for(let n=0;n<t;n++)if(!j.isConstant(e[n]))return!1;return!0}},definitionChanged:{get:function(){return this._definitionChanged}},referenceFrame:{get:function(){return this._referenceFrame}}});var HFt=new Q;Hg.prototype.getValue=function(e,t){return l(e)||(e=Q.now(HFt)),this.getValueInReferenceFrame(e,Oi.FIXED,t)};Hg.prototype.getValueInReferenceFrame=function(e,t,n){let i=this._value;if(!l(i))return;let o=i.length;l(n)||(n=new Array(o));let r=0,s=0;for(;r<o;){let c=i[r].getValueInReferenceFrame(e,t,n[r]);l(c)&&(n[s]=c,s++),r++}return n.length=s,n};Hg.prototype.setValue=function(e){let t=this._eventHelper;if(t.removeAll(),l(e)){this._value=e.slice();let n=e.length;for(let i=0;i<n;i++){let o=e[i];l(o)&&t.add(o.definitionChanged,Hg.prototype._raiseDefinitionChanged,this)}}else this._value=void 0;this._definitionChanged.raiseEvent(this)};Hg.prototype.equals=function(e){return this===e||e instanceof Hg&&this._referenceFrame===e._referenceFrame&&j.arrayEquals(this._value,e._value)};Hg.prototype._raiseDefinitionChanged=function(){this._definitionChanged.raiseEvent(this)};var Kg=Hg;var Pgo=x(T(),1);function bT(e){this._value=void 0,this._definitionChanged=new Se,this._eventHelper=new kr,this.setValue(e)}Object.defineProperties(bT.prototype,{isConstant:{get:function(){let e=this._value;if(!l(e))return!0;let t=e.length;for(let n=0;n<t;n++)if(!j.isConstant(e[n]))return!1;return!0}},definitionChanged:{get:function(){return this._definitionChanged}}});var KFt=new Q;bT.prototype.getValue=function(e,t){l(e)||(e=Q.now(KFt));let n=this._value;if(!l(n))return;let i=n.length;l(t)||(t=new Array(i));let o=0,r=0;for(;o<i;){let a=this._value[o].getValue(e,t[o]);l(a)&&(t[r]=a,r++),o++}return t.length=r,t};bT.prototype.setValue=function(e){let t=this._eventHelper;if(t.removeAll(),l(e)){this._value=e.slice();let n=e.length;for(let i=0;i<n;i++){let o=e[i];l(o)&&t.add(o.definitionChanged,bT.prototype._raiseDefinitionChanged,this)}}else this._value=void 0;this._definitionChanged.raiseEvent(this)};bT.prototype.equals=function(e){return this===e||e instanceof bT&&j.arrayEquals(this._value,e._value)};bT.prototype._raiseDefinitionChanged=function(){this._definitionChanged.raiseEvent(this)};var vE=bT;var Mgo=x(T(),1);var JFt={packedLength:1,pack:function(e,t,n){return n=n??0,t[n]=e,t},unpack:function(e,t,n){return t=t??0,e[t]},convertPackedArrayForInterpolation:function(e,t,n,i){l(i)||(i=[]),t=t??0,n=n??e.length;let o;for(let r=0,s=n-t+1;r<s;r++){let a=e[t+r];r===0||Math.abs(o-a)<Math.PI?i[r]=a:i[r]=a-W.TWO_PI,o=a}},unpackInterpolationResult:function(e,t,n,i,o){return o=e[0],o<0?o+W.TWO_PI:o}},_h=JFt;var Qgo=x(T(),1);var kgo=x(T(),1),ZWe={HORIZONTAL:0,VERTICAL:1};Object.freeze(ZWe);var Jf=ZWe;var jFt=Jf.HORIZONTAL,QFt=U.WHITE,qFt=U.BLACK,$Ft=0,eIt=1;function FE(e){e=e??B.EMPTY_OBJECT,this._definitionChanged=new Se,this._orientation=void 0,this._orientationSubscription=void 0,this._evenColor=void 0,this._evenColorSubscription=void 0,this._oddColor=void 0,this._oddColorSubscription=void 0,this._offset=void 0,this._offsetSubscription=void 0,this._repeat=void 0,this._repeatSubscription=void 0,this.orientation=e.orientation,this.evenColor=e.evenColor,this.oddColor=e.oddColor,this.offset=e.offset,this.repeat=e.repeat}Object.defineProperties(FE.prototype,{isConstant:{get:function(){return j.isConstant(this._orientation)&&j.isConstant(this._evenColor)&&j.isConstant(this._oddColor)&&j.isConstant(this._offset)&&j.isConstant(this._repeat)}},definitionChanged:{get:function(){return this._definitionChanged}},orientation:be("orientation"),evenColor:be("evenColor"),oddColor:be("oddColor"),offset:be("offset"),repeat:be("repeat")});FE.prototype.getType=function(e){return"Stripe"};var tIt=new Q;FE.prototype.getValue=function(e,t){return l(e)||(e=Q.now(tIt)),l(t)||(t={}),t.horizontal=j.getValueOrDefault(this._orientation,e,jFt)===Jf.HORIZONTAL,t.evenColor=j.getValueOrClonedDefault(this._evenColor,e,QFt,t.evenColor),t.oddColor=j.getValueOrClonedDefault(this._oddColor,e,qFt,t.oddColor),t.offset=j.getValueOrDefault(this._offset,e,$Ft),t.repeat=j.getValueOrDefault(this._repeat,e,eIt),t};FE.prototype.equals=function(e){return this===e||e instanceof FE&&j.equals(this._orientation,e._orientation)&&j.equals(this._evenColor,e._evenColor)&&j.equals(this._oddColor,e._oddColor)&&j.equals(this._offset,e._offset)&&j.equals(this._repeat,e._repeat)};var IE=FE;var oyo=x(T(),1);function tR(){this._definitionChanged=new Se,this._intervals=new Es,this._intervals.changedEvent.addEventListener(tR.prototype._intervalsChanged,this)}Object.defineProperties(tR.prototype,{isConstant:{get:function(){return this._intervals.isEmpty}},definitionChanged:{get:function(){return this._definitionChanged}},intervals:{get:function(){return this._intervals}}});var nIt=new Q;tR.prototype.getValue=function(e,t){l(e)||(e=Q.now(nIt));let n=this._intervals.findDataForIntervalContainingDate(e);return l(n)&&typeof n.clone=="function"?n.clone(t):n};tR.prototype.equals=function(e){return this===e||e instanceof tR&&this._intervals.equals(e._intervals,j.equals)};tR.prototype._intervalsChanged=function(){this._definitionChanged.raiseEvent(this)};var Jg=tR;var byo=x(T(),1);function lk(e,t){this._velocityVectorProperty=new Wg(e,!0),this._subscription=void 0,this._ellipsoid=void 0,this._definitionChanged=new Se,this.ellipsoid=t??ne.default;let n=this;this._velocityVectorProperty.definitionChanged.addEventListener(function(){n._definitionChanged.raiseEvent(n)})}Object.defineProperties(lk.prototype,{isConstant:{get:function(){return j.isConstant(this._velocityVectorProperty)}},definitionChanged:{get:function(){return this._definitionChanged}},position:{get:function(){return this._velocityVectorProperty.position},set:function(e){this._velocityVectorProperty.position=e}},ellipsoid:{get:function(){return this._ellipsoid},set:function(e){this._ellipsoid!==e&&(this._ellipsoid=e,this._definitionChanged.raiseEvent(this))}}});var RWe=new h,iIt=new h,CWe=new q,oIt=new Q;lk.prototype.getValue=function(e,t){l(e)||(e=Q.now(oIt));let n=this._velocityVectorProperty._getValue(e,iIt,RWe);if(l(n))return _t.rotationMatrixFromPositionVelocity(RWe,n,this._ellipsoid,CWe),Ne.fromRotationMatrix(CWe,t)};lk.prototype.equals=function(e){return this===e||e instanceof lk&&j.equals(this._velocityVectorProperty,e._velocityVectorProperty)&&(this._ellipsoid===e._ellipsoid||this._ellipsoid.equals(e._ellipsoid))};var dk=lk;var xyo=x(T(),1);var jg={COMPLETE:0,BELOW_ELLIPSOID_HORIZON:1,ABOVE_ELLIPSOID_HORIZON:2};jg.validate=function(e){return e===jg.COMPLETE||e===jg.BELOW_ELLIPSOID_HORIZON||e===jg.ABOVE_ELLIPSOID_HORIZON};jg.toString=function(e){switch(e){case jg.COMPLETE:return"COMPLETE";case jg.BELOW_ELLIPSOID_HORIZON:return"BELOW_ELLIPSOID_HORIZON";case jg.ABOVE_ELLIPSOID_HORIZON:return"ABOVE_ELLIPSOID_HORIZON";default:throw new ge("SensorVolumePortionToDisplay value is not valid and cannot be converted to a String.")}};var PE=jg;function gT(){}gT.packedLength=h.packedLength;gT.unpack=h.unpack;gT.pack=h.pack;var die;function uk(e,t){return t[0]==="#"&&(t=die+t),Ag.fromString(e,t)}function VWe(e,t,n){if(l(n.reference))return uk(t,n.reference);if(l(n.velocityReference)){let i=uk(t,n.velocityReference);switch(e){case h:case gT:return new Wg(i,e===gT);case Ne:return new dk(i)}}throw new ae(`${JSON.stringify(n)} is not valid CZML.`)}function rIt(e,t){return new nf(function(n,i){return t(e.getValue(n,i))},e.isConstant)}var go=new h,bd=new ck,Rl=new pe,nR=new Cn,Qz=new Ne;function sIt(e){let t=e.rgbaf;if(l(t))return t;let n=e.rgba;if(!l(n))return;let i=n.length;if(i===U.packedLength)return[U.byteToFloat(n[0]),U.byteToFloat(n[1]),U.byteToFloat(n[2]),U.byteToFloat(n[3])];t=new Array(i);for(let o=0;o<i;o+=5)t[o]=n[o],t[o+1]=U.byteToFloat(n[o+1]),t[o+2]=U.byteToFloat(n[o+2]),t[o+3]=U.byteToFloat(n[o+3]),t[o+4]=U.byteToFloat(n[o+4]);return t}function EWe(e,t){let n=e.uri??e;return l(t)?t.getDerivedResource({url:n}):ve.createIfNeeded(n)}function aIt(e){let t=e.wsen;if(l(t))return t;let n=e.wsenDegrees;if(!l(n))return;let i=n.length;if(i===re.packedLength)return[W.toRadians(n[0]),W.toRadians(n[1]),W.toRadians(n[2]),W.toRadians(n[3])];t=new Array(i);for(let o=0;o<i;o+=5)t[o]=n[o],t[o+1]=W.toRadians(n[o+1]),t[o+2]=W.toRadians(n[o+2]),t[o+3]=W.toRadians(n[o+3]),t[o+4]=W.toRadians(n[o+4]);return t}function cIt(e){let t=e.length;if(bd.magnitude=1,t===2)return bd.clock=e[0],bd.cone=e[1],h.fromSpherical(bd,go),[go.x,go.y,go.z];let n=new Array(t/3*4);for(let i=0,o=0;i<t;i+=3,o+=4)n[o]=e[i],bd.clock=e[i+1],bd.cone=e[i+2],h.fromSpherical(bd,go),n[o+1]=go.x,n[o+2]=go.y,n[o+3]=go.z;return n}function lIt(e){let t=e.length;if(t===3)return bd.clock=e[0],bd.cone=e[1],bd.magnitude=e[2],h.fromSpherical(bd,go),[go.x,go.y,go.z];let n=new Array(t);for(let i=0;i<t;i+=4)n[i]=e[i],bd.clock=e[i+1],bd.cone=e[i+2],bd.magnitude=e[i+3],h.fromSpherical(bd,go),n[i+1]=go.x,n[i+2]=go.y,n[i+3]=go.z;return n}function dIt(e){let t=e.length;if(t===3)return Rl.longitude=e[0],Rl.latitude=e[1],Rl.height=e[2],ne.default.cartographicToCartesian(Rl,go),[go.x,go.y,go.z];let n=new Array(t);for(let i=0;i<t;i+=4)n[i]=e[i],Rl.longitude=e[i+1],Rl.latitude=e[i+2],Rl.height=e[i+3],ne.default.cartographicToCartesian(Rl,go),n[i+1]=go.x,n[i+2]=go.y,n[i+3]=go.z;return n}function uIt(e){let t=e.length;if(t===3)return Rl.longitude=W.toRadians(e[0]),Rl.latitude=W.toRadians(e[1]),Rl.height=e[2],ne.default.cartographicToCartesian(Rl,go),[go.x,go.y,go.z];let n=new Array(t);for(let i=0;i<t;i+=4)n[i]=e[i],Rl.longitude=W.toRadians(e[i+1]),Rl.latitude=W.toRadians(e[i+2]),Rl.height=e[i+3],ne.default.cartographicToCartesian(Rl,go),n[i+1]=go.x,n[i+2]=go.y,n[i+3]=go.z;return n}function uie(e){let t=e.cartesian;if(l(t))return t;let n=e.cartesianVelocity;if(l(n))return n;let i=e.unitCartesian;if(l(i))return i;let o=e.unitSpherical;if(l(o))return cIt(o);let r=e.spherical;if(l(r))return lIt(r);let s=e.cartographicRadians;if(l(s))return dIt(s);let a=e.cartographicDegrees;if(l(a))return uIt(a);throw new ae(`${JSON.stringify(e)} is not a valid CZML interval.`)}function AWe(e,t){h.unpack(e,t,go),h.normalize(go,go),h.pack(go,e,t)}function mIt(e){let t=uie(e);if(t.length===3)return AWe(t,0),t;for(let n=1;n<t.length;n+=4)AWe(t,n);return t}function GWe(e,t){Ne.unpack(e,t,Qz),Ne.normalize(Qz,Qz),Ne.pack(Qz,e,t)}function hIt(e){let t=e.unitQuaternion;if(l(t)){if(t.length===4)return GWe(t,0),t;for(let n=1;n<t.length;n+=5)GWe(t,n)}return t}function LWe(e){return typeof e=="boolean"?Boolean:typeof e=="number"?Number:typeof e=="string"?String:e.hasOwnProperty("array")?Array:e.hasOwnProperty("boolean")?Boolean:e.hasOwnProperty("boundingRectangle")?nt:e.hasOwnProperty("cartesian2")?k:e.hasOwnProperty("cartesian")||e.hasOwnProperty("spherical")||e.hasOwnProperty("cartographicRadians")||e.hasOwnProperty("cartographicDegrees")?h:e.hasOwnProperty("unitCartesian")||e.hasOwnProperty("unitSpherical")?gT:e.hasOwnProperty("rgba")||e.hasOwnProperty("rgbaf")?U:e.hasOwnProperty("arcType")?un:e.hasOwnProperty("classificationType")?ti:e.hasOwnProperty("colorBlendMode")?ol:e.hasOwnProperty("cornerType")?no:e.hasOwnProperty("heightReference")?He:e.hasOwnProperty("horizontalOrigin")?Di:e.hasOwnProperty("date")?Q:e.hasOwnProperty("labelStyle")?yr:e.hasOwnProperty("number")?Number:e.hasOwnProperty("nearFarScalar")?Kt:e.hasOwnProperty("distanceDisplayCondition")?Bt:e.hasOwnProperty("object")||e.hasOwnProperty("value")?Object:e.hasOwnProperty("unitQuaternion")?Ne:e.hasOwnProperty("pathMode")?c0:e.hasOwnProperty("shadowMode")?Wn:e.hasOwnProperty("string")?String:e.hasOwnProperty("stripeOrientation")?Jf:e.hasOwnProperty("wsen")||e.hasOwnProperty("wsenDegrees")?re:e.hasOwnProperty("uri")?hk.default:e.hasOwnProperty("verticalOrigin")?zn:Object}function fIt(e,t,n){switch(e){case un:return un[t.arcType??t];case Array:return t.array;case Boolean:return t.boolean??t;case nt:return t.boundingRectangle;case k:return t.cartesian2;case h:return uie(t);case gT:return mIt(t);case U:return sIt(t);case ti:return ti[t.classificationType??t];case ol:return ol[t.colorBlendMode??t];case no:return no[t.cornerType??t];case He:return He[t.heightReference??t];case Di:return Di[t.horizontalOrigin??t];case Image:return EWe(t,n);case Q:return Q.fromIso8601(t.date??t);case yr:return yr[t.labelStyle??t];case Number:return t.number??t;case Kt:return t.nearFarScalar;case Bt:return t.distanceDisplayCondition;case Object:return t.object??t.value??t;case c0:return c0[t.pathMode??t];case Ne:return hIt(t);case _h:return t.number??t;case PE:return PE[t.portionToDisplay??t];case Wn:return Wn[t.shadowMode??t.shadows??t];case String:return t.string??t;case Jf:return Jf[t.stripeOrientation??t];case re:return aIt(t);case hk.default:return EWe(t,n);case zn:return zn[t.verticalOrigin??t];default:throw new ae(`Unknown CzmlDataSource interval type: ${e}`)}}var pIt={HERMITE:sk,LAGRANGE:ak,LINEAR:Kx};function qz(e,t){let n=e.interpolationAlgorithm,i=e.interpolationDegree;(l(n)||l(i))&&t.setInterpolationOptions({interpolationAlgorithm:pIt[n],interpolationDegree:i});let o=e.forwardExtrapolationType;l(o)&&(t.forwardExtrapolationType=dd[o]);let r=e.forwardExtrapolationDuration;l(r)&&(t.forwardExtrapolationDuration=r);let s=e.backwardExtrapolationType;l(s)&&(t.backwardExtrapolationType=dd[s]);let a=e.backwardExtrapolationDuration;l(a)&&(t.backwardExtrapolationDuration=a)}var WWe={iso8601:void 0};function jr(e){if(l(e))return WWe.iso8601=e,Cn.fromIso8601(WWe)}function mie(e){let t=ot.MAXIMUM_INTERVAL.clone();return t.data=e,t}function vWe(e){let t=new gl;return t.intervals.addInterval(mie(e)),t}function FWe(e){let t=new pc(e.referenceFrame);return t.intervals.addInterval(mie(e)),t}function $z(e,t,n,i,o,r,s){let a=jr(i.interval);l(o)&&(l(a)?a=Cn.intersect(a,o,nR):a=o);let c,d,u,m=!l(i.reference)&&!l(i.velocityReference),p=l(a)&&!a.equals(ot.MAXIMUM_INTERVAL);if(i.delete===!0){if(!p){t[n]=void 0;return}return OWe(t[n],a)}let b=!1;if(m){if(d=fIt(e,i,r),!l(d))return;c=e.packedLength??1,u=d.length??1,b=!l(i.array)&&typeof d!="string"&&u>c&&e!==Object}let f=typeof e.unpack=="function"&&e!==_h;if(!b&&!p){m?t[n]=new mi(f?e.unpack(d,0):d):t[n]=VWe(e,s,i);return}let y=t[n],_,S=i.epoch;if(l(S)&&(_=Q.fromIso8601(S)),b&&!p){y instanceof ju||(t[n]=y=new ju(e)),y.addSamplesPackedArray(d,_),qz(i,y);return}let Z;if(!b&&p){a=a.clone(),m?a.data=f?e.unpack(d,0):d:a.data=VWe(e,s,i),l(y)||(t[n]=y=m?new Jg:new gl),m&&y instanceof Jg?y.intervals.addInterval(a):y instanceof gl?(m&&(a.data=new mi(a.data)),y.intervals.addInterval(a)):(t[n]=y=vWe(y),m&&(a.data=new mi(a.data)),y.intervals.addInterval(a));return}l(y)||(t[n]=y=new gl),y instanceof gl||(t[n]=y=vWe(y));let R=y.intervals;Z=R.findInterval(a),(!l(Z)||!(Z.data instanceof ju))&&(Z=a.clone(),Z.data=new ju(e),R.addInterval(Z)),Z.data.addSamplesPackedArray(d,_),qz(i,Z.data)}function OWe(e,t){if(e instanceof ju){e.removeSamples(t);return}else if(e instanceof Jg){e.intervals.removeInterval(t);return}else if(e instanceof gl){let n=e.intervals;for(let i=0;i<n.length;++i){let o=Cn.intersect(n.get(i),t,nR);o.isEmpty||OWe(o.data,t)}n.removeInterval(t);return}}function Ce(e,t,n,i,o,r,s){if(l(i))if(Array.isArray(i))for(let a=0,c=i.length;a<c;++a)$z(e,t,n,i[a],o,r,s);else $z(e,t,n,i,o,r,s)}function IWe(e,t,n,i,o,r){let s=jr(n.interval);l(i)&&(l(s)?s=Cn.intersect(s,i,nR):s=i);let a=l(n.cartesianVelocity)?1:0,c=h.packedLength*(a+1),d,u,m=!l(n.reference),p=l(s)&&!s.equals(ot.MAXIMUM_INTERVAL);if(n.delete===!0){if(!p){e[t]=void 0;return}return BWe(e[t],s)}let b,f=!1;if(m&&(l(n.referenceFrame)&&(b=Oi[n.referenceFrame]),b=b??Oi.FIXED,d=uie(n),u=d.length??1,f=u>c),!f&&!p){m?e[t]=new zl(h.unpack(d),b):e[t]=uk(r,n.reference);return}let y=e[t],_,S=n.epoch;if(l(S)&&(_=Q.fromIso8601(S)),f&&!p){(!(y instanceof bc)||l(b)&&y.referenceFrame!==b)&&(e[t]=y=new bc(b,a)),y.addSamplesPackedArray(d,_),qz(n,y);return}let Z;if(!f&&p){s=s.clone(),m?s.data=h.unpack(d):s.data=uk(r,n.reference),l(y)||(m?y=new Gg(b):y=new pc(b),e[t]=y),m&&y instanceof Gg&&l(b)&&y.referenceFrame===b?y.intervals.addInterval(s):y instanceof pc?(m&&(s.data=new zl(s.data,b)),y.intervals.addInterval(s)):(e[t]=y=FWe(y),m&&(s.data=new zl(s.data,b)),y.intervals.addInterval(s));return}l(y)?y instanceof pc||(e[t]=y=FWe(y)):e[t]=y=new pc(b);let R=y.intervals;Z=R.findInterval(s),(!l(Z)||!(Z.data instanceof bc)||l(b)&&Z.data.referenceFrame!==b)&&(Z=s.clone(),Z.data=new bc(b,a),R.addInterval(Z)),Z.data.addSamplesPackedArray(d,_),qz(n,Z.data)}function BWe(e,t){if(e instanceof bc){e.removeSamples(t);return}else if(e instanceof Gg){e.intervals.removeInterval(t);return}else if(e instanceof pc){let n=e.intervals;for(let i=0;i<n.length;++i){let o=Cn.intersect(n.get(i),t,nR);o.isEmpty||BWe(o.data,t)}n.removeInterval(t);return}}function zWe(e,t,n,i,o,r){if(l(n))if(Array.isArray(n))for(let s=0,a=n.length;s<a;++s)IWe(e,t,n[s],i,o,r);else IWe(e,t,n,i,o,r)}function PWe(e,t,n,i){l(n.references)?eH(e,t,n.references,n.interval,i,vE,gl):(l(n.cartesian2)?n.array=k.unpackArray(n.cartesian2):l(n.cartesian)&&(n.array=k.unpackArray(n.cartesian)),l(n.array)&&Ce(Array,e,t,n,void 0,void 0,i))}function XWe(e,t,n,i,o,r){let s=jr(n.interval);l(i)&&(l(s)?s=Cn.intersect(s,i,nR):s=i);let a=e[t],c,d;if(l(s)){a instanceof SE||(a=new SE,e[t]=a);let m=a.intervals;d=m.findInterval({start:s.start,stop:s.stop}),l(d)?c=d.data:(d=s.clone(),m.addInterval(d))}else c=a;let u;l(n.solidColor)?(c instanceof Qt||(c=new Qt),u=n.solidColor,Ce(U,c,"color",u.color,void 0,void 0,r)):l(n.grid)?(c instanceof RE||(c=new RE),u=n.grid,Ce(U,c,"color",u.color,void 0,o,r),Ce(Number,c,"cellAlpha",u.cellAlpha,void 0,o,r),Ce(k,c,"lineCount",u.lineCount,void 0,o,r),Ce(k,c,"lineThickness",u.lineThickness,void 0,o,r),Ce(k,c,"lineOffset",u.lineOffset,void 0,o,r)):l(n.image)?(c instanceof Hy||(c=new Hy),u=n.image,Ce(Image,c,"image",u.image,void 0,o,r),Ce(k,c,"repeat",u.repeat,void 0,o,r),Ce(U,c,"color",u.color,void 0,o,r),Ce(Boolean,c,"transparent",u.transparent,void 0,o,r)):l(n.stripe)?(c instanceof IE||(c=new IE),u=n.stripe,Ce(Jf,c,"orientation",u.orientation,void 0,o,r),Ce(U,c,"evenColor",u.evenColor,void 0,o,r),Ce(U,c,"oddColor",u.oddColor,void 0,o,r),Ce(Number,c,"offset",u.offset,void 0,o,r),Ce(Number,c,"repeat",u.repeat,void 0,o,r)):l(n.polylineOutline)?(c instanceof pT||(c=new pT),u=n.polylineOutline,Ce(U,c,"color",u.color,void 0,o,r),Ce(U,c,"outlineColor",u.outlineColor,void 0,o,r),Ce(Number,c,"outlineWidth",u.outlineWidth,void 0,o,r)):l(n.polylineGlow)?(c instanceof LE||(c=new LE),u=n.polylineGlow,Ce(U,c,"color",u.color,void 0,o,r),Ce(Number,c,"glowPower",u.glowPower,void 0,o,r),Ce(Number,c,"taperPower",u.taperPower,void 0,o,r)):l(n.polylineArrow)?(c instanceof VE||(c=new VE),u=n.polylineArrow,Ce(U,c,"color",u.color,void 0,void 0,r)):l(n.polylineDash)?(c instanceof AE||(c=new AE),u=n.polylineDash,Ce(U,c,"color",u.color,void 0,void 0,r),Ce(U,c,"gapColor",u.gapColor,void 0,void 0,r),Ce(Number,c,"dashLength",u.dashLength,void 0,o,r),Ce(Number,c,"dashPattern",u.dashPattern,void 0,o,r)):l(n.checkerboard)&&(c instanceof TE||(c=new TE),u=n.checkerboard,Ce(U,c,"evenColor",u.evenColor,void 0,o,r),Ce(U,c,"oddColor",u.oddColor,void 0,o,r),Ce(k,c,"repeat",u.repeat,void 0,o,r)),l(d)?d.data=c:e[t]=c}function om(e,t,n,i,o,r){if(l(n))if(Array.isArray(n))for(let s=0,a=n.length;s<a;++s)XWe(e,t,n[s],i,o,r);else XWe(e,t,n,i,o,r)}function bIt(e,t,n,i){let o=t.name;l(o)&&(e.name=t.name)}function gIt(e,t,n,i){let o=t.description;l(o)&&Ce(String,e,"description",o,void 0,i,n)}function yIt(e,t,n,i){let o=t.position;l(o)&&zWe(e,"position",o,void 0,i,n)}function xIt(e,t,n,i){let o=t.viewFrom;l(o)&&Ce(h,e,"viewFrom",o,void 0,i,n)}function TIt(e,t,n,i){let o=t.orientation;l(o)&&Ce(Ne,e,"orientation",o,void 0,i,n)}function _It(e,t,n,i){let o=t.properties;if(l(o)){l(e.properties)||(e.properties=new Kl);for(let r in o)if(o.hasOwnProperty(r)){e.properties.hasProperty(r)||e.properties.addProperty(r);let s=o[r];if(Array.isArray(s))for(let a=0,c=s.length;a<c;++a)$z(LWe(s[a]),e.properties,r,s[a],void 0,i,n);else $z(LWe(s),e.properties,r,s,void 0,i,n)}}}function eH(e,t,n,i,o,r,s){let a=n.map(function(c){return uk(o,c)});if(l(i)){i=jr(i);let c=e[t];if(!(c instanceof s)){let d=new s;d.intervals.addInterval(mie(c)),e[t]=c=d}i.data=new r(a),c.intervals.addInterval(i)}else e[t]=new r(a)}function NWe(e,t,n,i){let o=n.references;l(o)?eH(e,t,o,n.interval,i,vE,gl):Ce(Array,e,t,n,void 0,void 0,i)}function YWe(e,t,n,i){if(l(n))if(Array.isArray(n))for(let o=0,r=n.length;o<r;++o)NWe(e,t,n[o],i);else NWe(e,t,n,i)}function MWe(e,t,n,i){let o=n.references;l(o)?eH(e,t,o,n.interval,i,Kg,pc):(l(n.cartesian)?n.array=h.unpackArray(n.cartesian):l(n.cartographicRadians)?n.array=h.fromRadiansArrayHeights(n.cartographicRadians,ne.default):l(n.cartographicDegrees)&&(n.array=h.fromDegreesArrayHeights(n.cartographicDegrees,ne.default)),l(n.array)&&Ce(Array,e,t,n,void 0,void 0,i))}function fk(e,t,n,i){if(l(n))if(Array.isArray(n))for(let o=0,r=n.length;o<r;++o)MWe(e,t,n[o],i);else MWe(e,t,n,i)}function SIt(e){return h.unpackArray(e)}function ZIt(e){return h.fromRadiansArrayHeights(e,ne.default)}function RIt(e){return h.fromDegreesArrayHeights(e,ne.default)}function wWe(e,t,n,i){let o=n.references;if(l(o)){let r=o.map(function(s){let a={};return eH(a,"positions",s,n.interval,i,Kg,pc),a.positions});e[t]=new Kg(r)}else l(n.cartesian)?n.array=n.cartesian.map(SIt):l(n.cartographicRadians)?n.array=n.cartographicRadians.map(ZIt):l(n.cartographicDegrees)&&(n.array=n.cartographicDegrees.map(RIt)),l(n.array)&&Ce(Array,e,t,n,void 0,void 0,i)}function CIt(e,t,n,i){if(l(n))if(Array.isArray(n))for(let o=0,r=n.length;o<r;++o)wWe(e,t,n[o],i);else wWe(e,t,n,i)}function VIt(e,t,n,i){if(l(n))if(Array.isArray(n))for(let o=0,r=n.length;o<r;o++)PWe(e,t,n[o],i);else PWe(e,t,n,i)}function EIt(e,t,n,i){let o=t.availability;if(!l(o))return;let r;if(Array.isArray(o))for(let s=0,a=o.length;s<a;++s)l(r)||(r=new Es),r.addInterval(jr(o[s]));else r=new Es,r.addInterval(jr(o));e.availability=r}function AIt(e,t,n,i,o){l(t)&&Ce(gT,e,"alignedAxis",t,n,i,o)}function GIt(e,t,n,i){let o=t.billboard;if(!l(o))return;let r=jr(o.interval),s=e.billboard;l(s)||(e.billboard=s=new el),Ce(Boolean,s,"show",o.show,r,i,n),Ce(Image,s,"image",o.image,r,i,n),Ce(Number,s,"scale",o.scale,r,i,n),Ce(k,s,"pixelOffset",o.pixelOffset,r,i,n),Ce(h,s,"eyeOffset",o.eyeOffset,r,i,n),Ce(Di,s,"horizontalOrigin",o.horizontalOrigin,r,i,n),Ce(zn,s,"verticalOrigin",o.verticalOrigin,r,i,n),Ce(He,s,"heightReference",o.heightReference,r,i,n),Ce(U,s,"color",o.color,r,i,n),Ce(_h,s,"rotation",o.rotation,r,i,n),AIt(s,o.alignedAxis,r,i,n),Ce(Boolean,s,"sizeInMeters",o.sizeInMeters,r,i,n),Ce(Number,s,"width",o.width,r,i,n),Ce(Number,s,"height",o.height,r,i,n),Ce(Kt,s,"scaleByDistance",o.scaleByDistance,r,i,n),Ce(Kt,s,"translucencyByDistance",o.translucencyByDistance,r,i,n),Ce(Kt,s,"pixelOffsetScaleByDistance",o.pixelOffsetScaleByDistance,r,i,n),Ce(nt,s,"imageSubRegion",o.imageSubRegion,r,i,n),Ce(Bt,s,"distanceDisplayCondition",o.distanceDisplayCondition,r,i,n),Ce(Number,s,"disableDepthTestDistance",o.disableDepthTestDistance,r,i,n)}function LIt(e,t,n,i){let o=t.box;if(!l(o))return;let r=jr(o.interval),s=e.box;l(s)||(e.box=s=new I_),Ce(Boolean,s,"show",o.show,r,i,n),Ce(h,s,"dimensions",o.dimensions,r,i,n),Ce(He,s,"heightReference",o.heightReference,r,i,n),Ce(Boolean,s,"fill",o.fill,r,i,n),om(s,"material",o.material,r,i,n),Ce(Boolean,s,"outline",o.outline,r,i,n),Ce(U,s,"outlineColor",o.outlineColor,r,i,n),Ce(Number,s,"outlineWidth",o.outlineWidth,r,i,n),Ce(Wn,s,"shadows",o.shadows,r,i,n),Ce(Bt,s,"distanceDisplayCondition",o.distanceDisplayCondition,r,i,n)}function WIt(e,t,n,i){let o=t.corridor;if(!l(o))return;let r=jr(o.interval),s=e.corridor;l(s)||(e.corridor=s=new X_),Ce(Boolean,s,"show",o.show,r,i,n),fk(s,"positions",o.positions,n),Ce(Number,s,"width",o.width,r,i,n),Ce(Number,s,"height",o.height,r,i,n),Ce(He,s,"heightReference",o.heightReference,r,i,n),Ce(Number,s,"extrudedHeight",o.extrudedHeight,r,i,n),Ce(He,s,"extrudedHeightReference",o.extrudedHeightReference,r,i,n),Ce(no,s,"cornerType",o.cornerType,r,i,n),Ce(Number,s,"granularity",o.granularity,r,i,n),Ce(Boolean,s,"fill",o.fill,r,i,n),om(s,"material",o.material,r,i,n),Ce(Boolean,s,"outline",o.outline,r,i,n),Ce(U,s,"outlineColor",o.outlineColor,r,i,n),Ce(Number,s,"outlineWidth",o.outlineWidth,r,i,n),Ce(Wn,s,"shadows",o.shadows,r,i,n),Ce(Bt,s,"distanceDisplayCondition",o.distanceDisplayCondition,r,i,n),Ce(ti,s,"classificationType",o.classificationType,r,i,n),Ce(Number,s,"zIndex",o.zIndex,r,i,n)}function vIt(e,t,n,i){let o=t.cylinder;if(!l(o))return;let r=jr(o.interval),s=e.cylinder;l(s)||(e.cylinder=s=new N_),Ce(Boolean,s,"show",o.show,r,i,n),Ce(Number,s,"length",o.length,r,i,n),Ce(Number,s,"topRadius",o.topRadius,r,i,n),Ce(Number,s,"bottomRadius",o.bottomRadius,r,i,n),Ce(He,s,"heightReference",o.heightReference,r,i,n),Ce(Boolean,s,"fill",o.fill,r,i,n),om(s,"material",o.material,r,i,n),Ce(Boolean,s,"outline",o.outline,r,i,n),Ce(U,s,"outlineColor",o.outlineColor,r,i,n),Ce(Number,s,"outlineWidth",o.outlineWidth,r,i,n),Ce(Number,s,"numberOfVerticalLines",o.numberOfVerticalLines,r,i,n),Ce(Number,s,"slices",o.slices,r,i,n),Ce(Wn,s,"shadows",o.shadows,r,i,n),Ce(Bt,s,"distanceDisplayCondition",o.distanceDisplayCondition,r,i,n)}function FIt(e,t){let n=e.version;if(l(n)&&typeof n=="string"){let r=n.split(".");if(r.length===2){if(r[0]!=="1")throw new ae("Cesium only supports CZML version 1.");t._version=n}}if(!l(t._version))throw new ae("CZML version information invalid. It is expected to be a property on the document object in the <Major>.<Minor> version format.");let i=t._documentPacket;l(e.name)&&(i.name=e.name);let o=e.clock;if(l(o)){let r=i.clock;l(r)?(r.interval=o.interval??r.interval,r.currentTime=o.currentTime??r.currentTime,r.range=o.range??r.range,r.step=o.step??r.step,r.multiplier=o.multiplier??r.multiplier):i.clock={interval:o.interval,currentTime:o.currentTime,range:o.range,step:o.step,multiplier:o.multiplier}}}function IIt(e,t,n,i){let o=t.ellipse;if(!l(o))return;let r=jr(o.interval),s=e.ellipse;l(s)||(e.ellipse=s=new Y_),Ce(Boolean,s,"show",o.show,r,i,n),Ce(Number,s,"semiMajorAxis",o.semiMajorAxis,r,i,n),Ce(Number,s,"semiMinorAxis",o.semiMinorAxis,r,i,n),Ce(Number,s,"height",o.height,r,i,n),Ce(He,s,"heightReference",o.heightReference,r,i,n),Ce(Number,s,"extrudedHeight",o.extrudedHeight,r,i,n),Ce(He,s,"extrudedHeightReference",o.extrudedHeightReference,r,i,n),Ce(_h,s,"rotation",o.rotation,r,i,n),Ce(_h,s,"stRotation",o.stRotation,r,i,n),Ce(Number,s,"granularity",o.granularity,r,i,n),Ce(Boolean,s,"fill",o.fill,r,i,n),om(s,"material",o.material,r,i,n),Ce(Boolean,s,"outline",o.outline,r,i,n),Ce(U,s,"outlineColor",o.outlineColor,r,i,n),Ce(Number,s,"outlineWidth",o.outlineWidth,r,i,n),Ce(Number,s,"numberOfVerticalLines",o.numberOfVerticalLines,r,i,n),Ce(Wn,s,"shadows",o.shadows,r,i,n),Ce(Bt,s,"distanceDisplayCondition",o.distanceDisplayCondition,r,i,n),Ce(ti,s,"classificationType",o.classificationType,r,i,n),Ce(Number,s,"zIndex",o.zIndex,r,i,n)}function PIt(e,t,n,i){let o=t.ellipsoid;if(!l(o))return;let r=jr(o.interval),s=e.ellipsoid;l(s)||(e.ellipsoid=s=new M_),Ce(Boolean,s,"show",o.show,r,i,n),Ce(h,s,"radii",o.radii,r,i,n),Ce(h,s,"innerRadii",o.innerRadii,r,i,n),Ce(Number,s,"minimumClock",o.minimumClock,r,i,n),Ce(Number,s,"maximumClock",o.maximumClock,r,i,n),Ce(Number,s,"minimumCone",o.minimumCone,r,i,n),Ce(Number,s,"maximumCone",o.maximumCone,r,i,n),Ce(He,s,"heightReference",o.heightReference,r,i,n),Ce(Boolean,s,"fill",o.fill,r,i,n),om(s,"material",o.material,r,i,n),Ce(Boolean,s,"outline",o.outline,r,i,n),Ce(U,s,"outlineColor",o.outlineColor,r,i,n),Ce(Number,s,"outlineWidth",o.outlineWidth,r,i,n),Ce(Number,s,"stackPartitions",o.stackPartitions,r,i,n),Ce(Number,s,"slicePartitions",o.slicePartitions,r,i,n),Ce(Number,s,"subdivisions",o.subdivisions,r,i,n),Ce(Wn,s,"shadows",o.shadows,r,i,n),Ce(Bt,s,"distanceDisplayCondition",o.distanceDisplayCondition,r,i,n)}function XIt(e,t,n,i){let o=t.label;if(!l(o))return;let r=jr(o.interval),s=e.label;l(s)||(e.label=s=new qh),Ce(Boolean,s,"show",o.show,r,i,n),Ce(String,s,"text",o.text,r,i,n),Ce(String,s,"font",o.font,r,i,n),Ce(yr,s,"style",o.style,r,i,n),Ce(Number,s,"scale",o.scale,r,i,n),Ce(Boolean,s,"showBackground",o.showBackground,r,i,n),Ce(U,s,"backgroundColor",o.backgroundColor,r,i,n),Ce(k,s,"backgroundPadding",o.backgroundPadding,r,i,n),Ce(k,s,"pixelOffset",o.pixelOffset,r,i,n),Ce(h,s,"eyeOffset",o.eyeOffset,r,i,n),Ce(Di,s,"horizontalOrigin",o.horizontalOrigin,r,i,n),Ce(zn,s,"verticalOrigin",o.verticalOrigin,r,i,n),Ce(He,s,"heightReference",o.heightReference,r,i,n),Ce(U,s,"fillColor",o.fillColor,r,i,n),Ce(U,s,"outlineColor",o.outlineColor,r,i,n),Ce(Number,s,"outlineWidth",o.outlineWidth,r,i,n),Ce(Kt,s,"translucencyByDistance",o.translucencyByDistance,r,i,n),Ce(Kt,s,"pixelOffsetScaleByDistance",o.pixelOffsetScaleByDistance,r,i,n),Ce(Kt,s,"scaleByDistance",o.scaleByDistance,r,i,n),Ce(Bt,s,"distanceDisplayCondition",o.distanceDisplayCondition,r,i,n),Ce(Number,s,"disableDepthTestDistance",o.disableDepthTestDistance,r,i,n)}function NIt(e,t,n,i){let o=t.model;if(!l(o))return;let r=jr(o.interval),s=e.model;l(s)||(e.model=s=new Cb),Ce(Boolean,s,"show",o.show,r,i,n),Ce(hk.default,s,"uri",o.gltf,r,i,n),Ce(Number,s,"scale",o.scale,r,i,n),Ce(Number,s,"minimumPixelSize",o.minimumPixelSize,r,i,n),Ce(Number,s,"maximumScale",o.maximumScale,r,i,n),Ce(Boolean,s,"incrementallyLoadTextures",o.incrementallyLoadTextures,r,i,n),Ce(Boolean,s,"runAnimations",o.runAnimations,r,i,n),Ce(Boolean,s,"clampAnimations",o.clampAnimations,r,i,n),Ce(Wn,s,"shadows",o.shadows,r,i,n),Ce(He,s,"heightReference",o.heightReference,r,i,n),Ce(U,s,"silhouetteColor",o.silhouetteColor,r,i,n),Ce(Number,s,"silhouetteSize",o.silhouetteSize,r,i,n),Ce(U,s,"color",o.color,r,i,n),Ce(ol,s,"colorBlendMode",o.colorBlendMode,r,i,n),Ce(Number,s,"colorBlendAmount",o.colorBlendAmount,r,i,n),Ce(Bt,s,"distanceDisplayCondition",o.distanceDisplayCondition,r,i,n);let a,c,d=o.nodeTransformations;if(l(d))if(Array.isArray(d))for(a=0,c=d.length;a<c;++a)kWe(s,d[a],r,i,n);else kWe(s,d,r,i,n);let u=o.articulations;if(l(u))if(Array.isArray(u))for(a=0,c=u.length;a<c;++a)UWe(s,u[a],r,i,n);else UWe(s,u,r,i,n)}function kWe(e,t,n,i,o){let r=jr(t.interval);l(n)&&(l(r)?r=Cn.intersect(r,n,nR):r=n);let s=e.nodeTransformations,a=Object.keys(t);for(let c=0,d=a.length;c<d;++c){let u=a[c];if(u==="interval")continue;let m=t[u];if(!l(m))continue;l(s)||(e.nodeTransformations=s=new Kl),s.hasProperty(u)||s.addProperty(u);let p=s[u];l(p)||(s[u]=p=new w_),Ce(h,p,"translation",m.translation,r,i,o),Ce(Ne,p,"rotation",m.rotation,r,i,o),Ce(h,p,"scale",m.scale,r,i,o)}}function UWe(e,t,n,i,o){let r=jr(t.interval);l(n)&&(l(r)?r=Cn.intersect(r,n,nR):r=n);let s=e.articulations,a=Object.keys(t);for(let c=0,d=a.length;c<d;++c){let u=a[c];if(u==="interval")continue;let m=t[u];l(m)&&(l(s)||(e.articulations=s=new Kl),s.hasProperty(u)||s.addProperty(u),Ce(Number,s,u,m,r,i,o))}}function YIt(e,t,n,i){let o=t.path;if(!l(o))return;let r=jr(o.interval),s=e.path;l(s)||(e.path=s=new Vb),Ce(Boolean,s,"show",o.show,r,i,n),Ce(Number,s,"leadTime",o.leadTime,r,i,n),Ce(Number,s,"trailTime",o.trailTime,r,i,n),Ce(Number,s,"width",o.width,r,i,n),Ce(Number,s,"resolution",o.resolution,r,i,n),om(s,"material",o.material,r,i,n),Ce(Bt,s,"distanceDisplayCondition",o.distanceDisplayCondition,r,i,n),Ce(String,s,"relativeTo",o.relativeTo,r,i,n),Ce(c0,s,"materialMode",o.materialMode,r,i,n)}function MIt(e,t,n,i){let o=t.point;if(!l(o))return;let r=jr(o.interval),s=e.point;l(s)||(e.point=s=new U_),Ce(Boolean,s,"show",o.show,r,i,n),Ce(Number,s,"pixelSize",o.pixelSize,r,i,n),Ce(He,s,"heightReference",o.heightReference,r,i,n),Ce(U,s,"color",o.color,r,i,n),Ce(U,s,"outlineColor",o.outlineColor,r,i,n),Ce(Number,s,"outlineWidth",o.outlineWidth,r,i,n),Ce(Kt,s,"scaleByDistance",o.scaleByDistance,r,i,n),Ce(Kt,s,"translucencyByDistance",o.translucencyByDistance,r,i,n),Ce(Bt,s,"distanceDisplayCondition",o.distanceDisplayCondition,r,i,n),Ce(Number,s,"disableDepthTestDistance",o.disableDepthTestDistance,r,i,n)}function mk(e){this.polygon=e,this._definitionChanged=new Se}Object.defineProperties(mk.prototype,{isConstant:{get:function(){let e=this.polygon._positions,t=this.polygon._holes;return(!l(e)||e.isConstant)&&(!l(t)||t.isConstant)}},definitionChanged:{get:function(){return this._definitionChanged}}});mk.prototype.getValue=function(e,t){let n;l(this.polygon._positions)&&(n=this.polygon._positions.getValue(e));let i;return l(this.polygon._holes)&&(i=this.polygon._holes.getValue(e),l(i)&&(i=i.map(function(o){return new Wc(o)}))),l(t)?(t.positions=n,t.holes=i,t):new Wc(n,i)};mk.prototype.equals=function(e){return this===e||e instanceof mk&&j.equals(this.polygon._positions,e.polygon._positions)&&j.equals(this.polygon._holes,e.polygon._holes)};function wIt(e,t,n,i){let o=t.polygon;if(!l(o))return;let r=jr(o.interval),s=e.polygon;l(s)||(e.polygon=s=new $h),Ce(Boolean,s,"show",o.show,r,i,n),fk(s,"_positions",o.positions,n),CIt(s,"_holes",o.holes,n),(l(s._positions)||l(s._holes))&&(s.hierarchy=new mk(s)),Ce(Number,s,"height",o.height,r,i,n),Ce(He,s,"heightReference",o.heightReference,r,i,n),Ce(Number,s,"extrudedHeight",o.extrudedHeight,r,i,n),Ce(He,s,"extrudedHeightReference",o.extrudedHeightReference,r,i,n),Ce(_h,s,"stRotation",o.stRotation,r,i,n),Ce(Number,s,"granularity",o.granularity,r,i,n),Ce(Boolean,s,"fill",o.fill,r,i,n),om(s,"material",o.material,r,i,n),Ce(Boolean,s,"outline",o.outline,r,i,n),Ce(U,s,"outlineColor",o.outlineColor,r,i,n),Ce(Number,s,"outlineWidth",o.outlineWidth,r,i,n),Ce(Boolean,s,"perPositionHeight",o.perPositionHeight,r,i,n),Ce(Boolean,s,"closeTop",o.closeTop,r,i,n),Ce(Boolean,s,"closeBottom",o.closeBottom,r,i,n),Ce(un,s,"arcType",o.arcType,r,i,n),Ce(Wn,s,"shadows",o.shadows,r,i,n),Ce(Bt,s,"distanceDisplayCondition",o.distanceDisplayCondition,r,i,n),Ce(ti,s,"classificationType",o.classificationType,r,i,n),Ce(Number,s,"zIndex",o.zIndex,r,i,n)}function kIt(e){return e?un.GEODESIC:un.NONE}function UIt(e,t,n,i){let o=t.polyline;if(!l(o))return;let r=jr(o.interval),s=e.polyline;if(l(s)||(e.polyline=s=new tl),Ce(Boolean,s,"show",o.show,r,i,n),fk(s,"positions",o.positions,n),Ce(Number,s,"width",o.width,r,i,n),Ce(Number,s,"granularity",o.granularity,r,i,n),om(s,"material",o.material,r,i,n),om(s,"depthFailMaterial",o.depthFailMaterial,r,i,n),Ce(un,s,"arcType",o.arcType,r,i,n),Ce(Boolean,s,"clampToGround",o.clampToGround,r,i,n),Ce(Wn,s,"shadows",o.shadows,r,i,n),Ce(Bt,s,"distanceDisplayCondition",o.distanceDisplayCondition,r,i,n),Ce(ti,s,"classificationType",o.classificationType,r,i,n),Ce(Number,s,"zIndex",o.zIndex,r,i,n),l(o.followSurface)&&!l(o.arcType)){let a={};Ce(Boolean,a,"followSurface",o.followSurface,r,i,n),s.arcType=rIt(a.followSurface,kIt)}}function DIt(e,t,n,i){let o=t.polylineVolume;if(!l(o))return;let r=jr(o.interval),s=e.polylineVolume;l(s)||(e.polylineVolume=s=new D_),fk(s,"positions",o.positions,n),VIt(s,"shape",o.shape,n),Ce(Boolean,s,"show",o.show,r,i,n),Ce(no,s,"cornerType",o.cornerType,r,i,n),Ce(Boolean,s,"fill",o.fill,r,i,n),om(s,"material",o.material,r,i,n),Ce(Boolean,s,"outline",o.outline,r,i,n),Ce(U,s,"outlineColor",o.outlineColor,r,i,n),Ce(Number,s,"outlineWidth",o.outlineWidth,r,i,n),Ce(Number,s,"granularity",o.granularity,r,i,n),Ce(Wn,s,"shadows",o.shadows,r,i,n),Ce(Bt,s,"distanceDisplayCondition",o.distanceDisplayCondition,r,i,n)}function OIt(e,t,n,i){let o=t.rectangle;if(!l(o))return;let r=jr(o.interval),s=e.rectangle;l(s)||(e.rectangle=s=new ef),Ce(Boolean,s,"show",o.show,r,i,n),Ce(re,s,"coordinates",o.coordinates,r,i,n),Ce(Number,s,"height",o.height,r,i,n),Ce(He,s,"heightReference",o.heightReference,r,i,n),Ce(Number,s,"extrudedHeight",o.extrudedHeight,r,i,n),Ce(He,s,"extrudedHeightReference",o.extrudedHeightReference,r,i,n),Ce(_h,s,"rotation",o.rotation,r,i,n),Ce(_h,s,"stRotation",o.stRotation,r,i,n),Ce(Number,s,"granularity",o.granularity,r,i,n),Ce(Boolean,s,"fill",o.fill,r,i,n),om(s,"material",o.material,r,i,n),Ce(Boolean,s,"outline",o.outline,r,i,n),Ce(U,s,"outlineColor",o.outlineColor,r,i,n),Ce(Number,s,"outlineWidth",o.outlineWidth,r,i,n),Ce(Wn,s,"shadows",o.shadows,r,i,n),Ce(Bt,s,"distanceDisplayCondition",o.distanceDisplayCondition,r,i,n),Ce(ti,s,"classificationType",o.classificationType,r,i,n),Ce(Number,s,"zIndex",o.zIndex,r,i,n)}function BIt(e,t,n,i){let o=t.tileset;if(!l(o))return;let r=jr(o.interval),s=e.tileset;l(s)||(e.tileset=s=new k_),Ce(Boolean,s,"show",o.show,r,i,n),Ce(hk.default,s,"uri",o.uri,r,i,n),Ce(Number,s,"maximumScreenSpaceError",o.maximumScreenSpaceError,r,i,n)}function zIt(e,t,n,i){let o=t.wall;if(!l(o))return;let r=jr(o.interval),s=e.wall;l(s)||(e.wall=s=new Eb),Ce(Boolean,s,"show",o.show,r,i,n),fk(s,"positions",o.positions,n),YWe(s,"minimumHeights",o.minimumHeights,n),YWe(s,"maximumHeights",o.maximumHeights,n),Ce(Number,s,"granularity",o.granularity,r,i,n),Ce(Boolean,s,"fill",o.fill,r,i,n),om(s,"material",o.material,r,i,n),Ce(Boolean,s,"outline",o.outline,r,i,n),Ce(U,s,"outlineColor",o.outlineColor,r,i,n),Ce(Number,s,"outlineWidth",o.outlineWidth,r,i,n),Ce(Wn,s,"shadows",o.shadows,r,i,n),Ce(Bt,s,"distanceDisplayCondition",o.distanceDisplayCondition,r,i,n)}function DWe(e,t,n,i,o){let r=e.id;if(l(r)||(r=Qn()),die=r,!l(o._version)&&r!=="document")throw new ae("The first CZML packet is required to be the document object.");if(e.delete===!0)t.removeById(r);else if(r==="document")FIt(e,o);else{let s=t.getOrCreateEntity(r),a=e.parent;l(a)&&(s.parent=t.getOrCreateEntity(a));for(let c=n.length-1;c>-1;c--)n[c](s,e,t,i)}die=void 0}function HIt(e){let t,n=e._documentPacket.clock;if(!l(n)){if(!l(e._clock)){let o=e._entityCollection.computeAvailability();if(!o.start.equals(ot.MINIMUM_VALUE)){let r=o.start,s=o.stop,a=Q.secondsDifference(s,r),c=Math.round(a/120);return t=new Kf,t.startTime=Q.clone(r),t.stopTime=Q.clone(s),t.clockRange=bs.LOOP_STOP,t.multiplier=c,t.currentTime=Q.clone(r),t.clockStep=Do.SYSTEM_CLOCK_MULTIPLIER,e._clock=t,!0}}return!1}l(e._clock)?t=e._clock.clone():(t=new Kf,t.startTime=ot.MINIMUM_VALUE.clone(),t.stopTime=ot.MAXIMUM_VALUE.clone(),t.currentTime=ot.MINIMUM_VALUE.clone(),t.clockRange=bs.LOOP_STOP,t.clockStep=Do.SYSTEM_CLOCK_MULTIPLIER,t.multiplier=1);let i=jr(n.interval);return l(i)&&(t.startTime=i.start,t.stopTime=i.stop),l(n.currentTime)&&(t.currentTime=Q.fromIso8601(n.currentTime)),l(n.range)&&(t.clockRange=bs[n.range]??bs.LOOP_STOP),l(n.step)&&(t.clockStep=Do[n.step]??Do.SYSTEM_CLOCK_MULTIPLIER),l(n.multiplier)&&(t.multiplier=n.multiplier),t.equals(e._clock)?!1:(e._clock=t.clone(e._clock),!0)}function HWe(e,t,n,i){n=n??B.EMPTY_OBJECT;let o=t,r=n.sourceUri,s=n.credit;if(typeof s=="string"&&(s=new Lt(s)),e._credit=s,typeof t=="string"||t instanceof ve){t=ve.createIfNeeded(t),o=t.fetchJson(),r=r??t.clone();let a=e._resourceCredits,c=t.credits;if(l(c)){let d=c.length;for(let u=0;u<d;u++)a.push(c[u])}}return r=ve.createIfNeeded(r),ys.setLoading(e,!0),Promise.resolve(o).then(function(a){return KIt(e,a,r,i)}).catch(function(a){return ys.setLoading(e,!1),e._error.raiseEvent(e,a),console.log(a),Promise.reject(a)})}function KIt(e,t,n,i){ys.setLoading(e,!0);let o=e._entityCollection;i&&(e._version=void 0,e._documentPacket=new KWe,o.removeAll()),ra._processCzml(t,o,n,void 0,e);let r=HIt(e),s=e._documentPacket;return l(s.name)&&e._name!==s.name?(e._name=s.name,r=!0):!l(e._name)&&l(n)&&(e._name=zg(n.getUrlComponent()),r=!0),ys.setLoading(e,!1),r&&e._changed.raiseEvent(e),e}function KWe(){this.name=void 0,this.clock=void 0}function ra(e){this._name=e,this._changed=new Se,this._error=new Se,this._isLoading=!1,this._loading=new Se,this._clock=void 0,this._documentPacket=new KWe,this._version=void 0,this._entityCollection=new Ya(this),this._entityCluster=new Eu,this._credit=void 0,this._resourceCredits=[]}ra.load=function(e,t){return new ra().load(e,t)};Object.defineProperties(ra.prototype,{name:{get:function(){return this._name}},clock:{get:function(){return this._clock}},entities:{get:function(){return this._entityCollection}},isLoading:{get:function(){return this._isLoading}},changedEvent:{get:function(){return this._changed}},errorEvent:{get:function(){return this._error}},loadingEvent:{get:function(){return this._loading}},show:{get:function(){return this._entityCollection.show},set:function(e){this._entityCollection.show=e}},clustering:{get:function(){return this._entityCluster},set:function(e){this._entityCluster=e}},credit:{get:function(){return this._credit}}});ra.updaters=[GIt,LIt,WIt,vIt,IIt,PIt,XIt,NIt,bIt,gIt,YIt,MIt,wIt,UIt,DIt,_It,OIt,yIt,BIt,xIt,zIt,TIt,EIt];ra.registerUpdater=function(e){ra.updaters.includes(e)||ra.updaters.push(e)};ra.unregisterUpdater=function(e){if(ra.updaters.includes(e)){let t=ra.updaters.indexOf(e);ra.updaters.splice(t,1)}};ra.prototype.process=function(e,t){return HWe(this,e,t,!1)};ra.prototype.load=function(e,t){return HWe(this,e,t,!0)};ra.prototype.update=function(e){return!0};ra.processPacketData=Ce;ra.processPositionPacketData=zWe;ra.processMaterialPacketData=om;ra._processCzml=function(e,t,n,i,o){if(i=i??ra.updaters,Array.isArray(e))for(let r=0,s=e.length;r<s;++r)DWe(e[r],t,i,n,o);else DWe(e,t,i,n,o)};var pk=ra;var LRo=x(T(),1);var QZo=x(T(),1);var fZo=x(T(),1);G0();var rSo=x(T(),1);var __o=x(T(),1);_c();sR();WH();vk();var C2e={type:"module"},Nie="error",PPt="messageerror",V2e,Xie,E2e,Yie=!0;try{Yie=typeof structuredClone==Yr&&structuredClone(new DOMException("","AbortError")).code!==ke}catch{}Z2e(XPt);function XPt(e,t){let{baseURI:n,chunkSize:i,workerStartupTimeout:o}=t,{wasmURI:r}=t;if(!e.interface){typeof r==Yr&&(r=r());let s;try{s=PH(e.workerURI,n,e)}catch{return Iie(e),Pie(e,t)}Object.assign(e,{worker:s,workerAlive:!1,terminated:!1,startupError:null,interface:{run:async()=>{try{return await NPt(e,{chunkSize:i,wasmURI:r,baseURI:n,workerStartupTimeout:o})}catch(a){if(a&&a.workerStartupFailed)return Iie(e),A2e(e),IH(e,t);if(a&&a.codecImportFailed){if(e.reader)return A2e(e),IH(e,t);e.onTaskFinished()}throw a}}}})}return e.interface}async function NPt(e,t){if(!e.worker){let{startupError:b}=e;e.startupError=null;let f=b||new Error(dR);throw f.workerStartupFailed=!0,f}let n,i,o=new Promise((b,f)=>{n=b,i=f});Object.assign(e,{reader:null,writer:null,resolveResult:n,rejectResult:i,result:o});let{readable:r,options:s}=e,{writable:a,closed:c,abortPipe:d}=YPt(e.writable),u;try{u=Mie({type:g2e,options:s,config:t,readable:r,writable:a},e)}catch(b){d();try{await c}catch{}throw e.onTaskFinished(),b}u||Object.assign(e,{reader:r.getReader(),writer:a.getWriter()});let{workerStartupTimeout:m}=t;!e.workerAlive&&Number.isFinite(m)&&m>=0&&(e.startupTimeout=setTimeout(()=>MPt(e),m));try{let b=await o;return await p(),await c,b}catch(b){await p(),d();try{await c}catch{}throw b}async function p(){if(!u&&!a.locked)try{await a.getWriter().close()}catch{}}}function YPt(e){let t=new AbortController,{writable:n,readable:i}=new TransformStream,o=i.pipeTo(e,{preventClose:!0,preventAbort:!0,signal:t.signal});return o.catch(()=>{}),{writable:n,closed:o,abortPipe:()=>t.abort()}}function A2e(e){let{reader:t}=e;t&&t.releaseLock(),e.reader=null,e.writer=null}function wie(e){let{worker:t}=e;if(t)try{t.terminate()}catch{}e.interface=null}function PH(e,t,n,i,o=!0){let{createWorker:r}=n,s,a,c;if(r)s=r();else if(Xie===ke||V2e!==e){let d=typeof e==Yr;d?a=e(o):a=e;let u=a.startsWith("data:"),m=a.startsWith("blob:");if(u||m){i===ke&&(i=!1),i&&(c=C2e);try{s=new Worker(a,c)}catch(p){if(m)try{URL.revokeObjectURL(a)}catch{}if(d&&m)return PH(e,t,n,i,!1);if(i)throw p;return PH(e,t,n,!0,!1)}}else{i===ke&&(i=!0),i&&(c=C2e);try{a=new URL(a,t)}catch{}try{s=new Worker(a,c)}catch(p){if(i)return PH(e,t,n,!1,o);throw p}}V2e=e,Xie=a,E2e=c}else s=new Worker(Xie,E2e);return s.addEventListener(b2e,d=>{n.workerAlive=!0,L2e(n),wPt(d,n)}),s.addEventListener(Nie,d=>G2e(d,n)),s.addEventListener(PPt,d=>G2e(d,n)),s}function MPt(e){if(e.startupTimeout=null,e.workerAlive)return;let{rejectResult:t,writer:n}=e;if(wie(e),e.worker=null,t){let i=new Error(dR);i.workerStartupFailed=!0,t(i),n&&n.releaseLock()}}function L2e(e){let{startupTimeout:t}=e;t&&(clearTimeout(t),e.startupTimeout=null)}function G2e(e,t){e.preventDefault&&e.preventDefault(),L2e(t);let{workerAlive:n,rejectResult:i,writer:o,onTaskFinished:r}=t;wie(t),n||(t.worker=null);let s=e.error||new Error(e.message||Nie);n||(s=Object.assign(new Error(s.message||Nie),{workerStartupFailed:!0}),t.startupError=s),i&&(i(s),o&&o.releaseLock(),n&&r())}function Mie(e,{worker:t,writer:n,transferStreams:i,workerAlive:o}){try{let{value:r,readable:s,writable:a}=e,c=[];if(r&&(e.value=fH(r),c.push(e.value.buffer)),i&&Yie&&o?(s&&c.push(s),a&&c.push(a)):e.readable=e.writable=null,c.length)try{return t.postMessage(e,c),!0}catch{Yie=!1,e.readable=e.writable=null,t.postMessage(e)}else t.postMessage(e)}catch(r){throw n&&n.releaseLock(),r}}async function wPt({data:e},t){let{type:n,value:i,messageId:o,result:r,error:s}=e,{reader:a,writer:c,resolveResult:d,rejectResult:u,onTaskFinished:m,generation:p}=t,b=()=>t.generation!=p;try{if(s){let{message:y,stack:_,code:S,name:Z,outputSize:R,cause:C,codecImportFailed:E}=s,A=new Error(y);Object.assign(A,{stack:_,code:S,name:Z,outputSize:R}),C&&(A.cause=Object.assign(new Error(C.message),{name:C.name})),E&&(A.codecImportFailed=!0),f(A)}else{if(n==y2e){let{value:y,done:_}=await a.read();b()||Mie({type:Lie,value:y,done:_,messageId:o},t)}n==Lie&&(await c.ready,await c.write(new Uint8Array(i)),b()||Mie({type:x2e,messageId:o},t)),n==T2e&&f(null,r)}}catch(y){b()||(wie(t),f(y))}function f(y,_){b()||(y?u(y):d(_),c&&c.releaseLock(),y&&y.codecImportFailed||m())}}are();var RSo=x(T(),1);var xSo=x(T(),1);_c();G0();cR();vk();MH();OH();Tie();sR();BE();foe();gk();var xre="File already exists",Tre="Zip file comment exceeds 64KB",LFe="Invalid zip file comment (must be a Uint8Array)",WFe="File entry comment exceeds 64KB",vFe="Invalid file entry comment (must be a string)",FFe="Invalid date (must be a valid Date instance)",IFe="File entry name exceeds 64KB",_re="Version exceeds 65535",PFe="The strength must equal 1, 2, or 3",XFe="Encryption is not supported in USDZ files",NFe="Encryption is not supported when the 'passThrough' option is set",YFe="Invalid extra field (must be a Map)",MFe="Invalid extra field type (must be integer 0..65535)",wFe="Invalid extra field data (must be a Uint8Array)",TK="Extra field data exceeds 64KB",rNt="Compression method not supported",kFe=-2147483648,UFe=2147483647,TFe=BigInt(0),_Fe=BigInt("0x7fffffffffffffff"),_K="Zip64 is not supported (set the 'zip64' option to 'true')",DFe="Undefined uncompressed size",OFe="Undefined compression method";var BFe="Undefined reader",zFe="Zip file not empty",HFe="Invalid uid (must be integer 0..2^32-1)",KFe="Invalid gid (must be integer 0..2^32-1)",JFe="Invalid UNIX mode (must be integer 0..65535)",jFe="Invalid unixExtraFieldType (must be 'infozip' or 'unix')",QFe="uid/gid must be 0..65535 for unixExtraFieldType 'unix' (use 'infozip' for larger ids)",qFe="Invalid msdosAttributesRaw (must be integer 0..255)",$Fe="Invalid msdosAttributes (must be an object with boolean flags)",eIe="Invalid level (must be integer 0..9)",tIe="Signature data exceeds 64KB",SFe=new Uint8Array([7,0,2,0,65,69,3,0,0]),sNt=4,aNt=9,cNt=67,lNt=1,fre="infozip",pre="unix",dNt=9,cre=0,ZFe=[],Kk=class{constructor(t,n={}){t=new nA(t);let{availableSize:i=iR,maxSize:o=iR}=t,r=i>0&&i!==iR&&o>0&&o!==iR;Object.assign(this,{writer:t,addSplitZipSignature:r,options:n,fileEntries:new Map,filenames:new Set,offset:n[bk]===ke?t.size||t.writable.size||0:n[bk],initialOffset:n[bk]===ke?0:n[bk]-(t.size||t.writable.size||0),pendingAddFileCalls:new Set,pendingErrors:[],bufferedWrites:0,lastFileEntry:ke})}prependZip(t){return lre(this,uNt(this,t))}appendZip(t){return lre(this,this.appendZipEntries(t))}async appendZipEntries(t){let n=this,{pendingAddFileCalls:i,filenames:o,fileEntries:r}=n;for(;i.size;)await Promise.allSettled(Array.from(i));let s,a=new Promise(u=>s=u);i.add(a);let c=[],d;try{t=new ty(t),await wc(t),(t.size===ke||!t.readUint8Array)&&(t=new ru(await v0(t.readable)),await wc(t));let{ZipReader:u}=await Promise.resolve().then(()=>(are(),bFe)),m=new u(t),p=await m.getEntries();await m.close(),await wc(n.writer);let{directoryOffset:b}=m;p.forEach(({filename:_})=>{if(o.has(_))throw new Error(xre);o.add(_),c.push(_)}),n.writerLocked=!0;let{lockWriter:f}=n;n.lockWriter=new Promise(_=>d=()=>{n.writerLocked=!1,_()}),await f,n.addSplitZipSignature&&(delete n.addSplitZipSignature,await LNt(t)||(await N0(n.writer,iIe()),n.offset+=4));let y=await WNt(n,t,p,b);p.forEach(_=>{let{version:S,rawLastModDate:Z,rawFilename:R,bitFlag:C,encrypted:E,uncompressedSize:A,compressedSize:L,extraFieldZip64:F}=_,{compressionMethod:I,rawExtraField:N}=_,{level:g,languageEncodingFlag:V,dataDescriptor:G}=C;N=nIe(N||yo),_.extraFieldAES&&(I=99);let v=co(N),X=!!F&&F.uncompressedSize!==ke,Y=!!F&&F.compressedSize!==ke,D=cIe(g,V,G,E,I)&-7|g<<1,{headerArray:M,headerView:O}=aIe({version:S,bitFlag:D,compressionMethod:I,uncompressedSize:A,compressedSize:L,rawLastModDate:Z,rawFilename:R,zip64CompressedSize:Y,zip64UncompressedSize:X,extraFieldLength:v}),{crc32:w}=_;w!==ke&&kc(O,10,w);let{offset:z,diskNumberStart:K}=y.get(_);Object.assign(_,{zip64UncompressedSize:X,zip64CompressedSize:Y,offset:z,diskNumberStart:K,zip64DiskNumberStart:!1,rawExtraFieldZip64:yo,rawExtraFieldAES:yo,rawExtraFieldExtendedTimestamp:yo,rawExtraFieldNTFS:yo,rawExtraFieldUnix:yo,rawExtraField:N,rawCentralExtraField:yo,extendedTimestamp:!1,headerArray:M,headerView:O}),r.set(_.filename,_)})}catch(u){throw c.forEach(m=>o.delete(m)),u}finally{s(),i.delete(a),d&&d()}}add(t="",n,i={}){let o=this,{pendingAddFileCalls:r}=o,s=mNt(o,t,n,i);r.add(s);let a=()=>r.delete(s);return Promise.prototype.then.call(s,a,a),lre(o,s)}remove(t){let{filenames:n,fileEntries:i}=this;if(typeof t==oR&&(t=i.get(t)),t&&t.filename!==ke){let{filename:o}=t;if(n.has(o)&&i.has(o))return n.delete(o),i.delete(o),!0}return!1}async close(t=yo,n={}){let i=this,{pendingAddFileCalls:o,writer:r}=this,{writable:s}=r;if(!(t instanceof Uint8Array))throw new Error(LFe);if(co(t)>65535)throw new Error(Tre);for(;o.size;)await Promise.allSettled(Array.from(o));await Promise.allSettled(i.pendingErrors.map(d=>d.recorded));let a=i.pendingErrors.filter(d=>d.error&&!d.observed);if(a.length){let d=a.map(m=>m.error);a.forEach(m=>m.observed=!0);let[u]=d;try{u.entryErrors=d}catch{}throw u}return await CNt(i,t,n),!DH(r)&&qi(i,n,cH)||await s.getWriter().close(),r.getData?r.getData():s}};var bre=class extends Promise{then(t,n){let{watcher:i}=this;return i&&(i.observed=!0),super.then(t,n)}};function lre(e,t){let n=new bre((o,r)=>Promise.prototype.then.call(t,o,r)),i={};return n.watcher=i,i.recorded=Promise.prototype.then.call(n,ke,o=>i.error=o),e.pendingErrors.push(i),n}async function uNt(e,t){if(e.filenames.size)throw new Error(zFe);await e.appendZipEntries(t)}async function mNt(e,t,n,i){if(i=Object.assign({},i),qi(e,i,mR)&&!t.endsWith("/")&&(t+="/"),e.filenames.has(t))throw new Error(xre);e.filenames.add(t),cre<qg().maxWorkers?cre++:await new Promise(o=>ZFe.push(o));try{return await hNt(e,t,n,i)}catch(o){throw e.filenames.delete(t),o}finally{let o=ZFe.shift();o?o():cre--}}async function hNt(e,t,n,i){let o=fNt(e,t,i);({name:t}=o);let r=pNt(e,t,i),{comment:s}=r,a=i[JH];e.fileEntries.set(t,ke);let c=e.lastFileEntry,d={},u;r.resolvedOptions.keepOrder&&(d.lockFileEntry=new Promise(p=>u=p)),e.lastFileEntry=d;let m;try{let{resolvedOptions:p}=r;p.level!=0&&p.compressionMethod===ke&&!p.passThrough&&!await R2e(qg())&&(p.level=0);let b=await bNt(e,n,r,i);({reader:n}=b);let f=Jk(e.writer),y=oy(e.writer);i=Object.assign({},i,o.resolvedOptions,r.resolvedOptions,b.resolvedOptions,{signature:i[KH],crc32:i.crc32===ke?i[KH]:i.crc32,offset:e.offset-f,diskNumberStart:y,[NE]:e.options[NE]});let _=TNt(i),S=SNt(i),Z=co(_.localHeaderArray,S.dataDescriptorArray);m=await yNt(e,t,n,{headerInfo:_,dataDescriptorInfo:S,metadataSize:Z,fileEntry:d,previousFileEntry:c,releaseLockFileEntry:u},i)}catch(p){throw e.fileEntries.delete(t),p}finally{u&&u(c&&c.lockFileEntry)}return Object.assign(m,{name:t,comment:s,extraField:a,[BH]:m.internalFileAttributes,[zH]:m.externalFileAttributes}),new ZT(m)}function fNt(e,t,n){let i=qi(e,n,ioe),o=qi(e,n,soe,i?20:768),r=qi(e,n,coe),s=hA(e,n,"uid"),a=hA(e,n,"gid"),c=hA(e,n,doe),d=qi(e,n,Sve),u=qi(e,n,uoe),m=qi(e,n,moe),p=qi(e,n,hoe);if(ME(s,4294967295,HFe),ME(a,4294967295,KFe),ME(c,65535,JFe),d!==ke&&d!==fre&&d!==pre)throw new Error(jFe);if(d===pre&&(s!==ke&&s>65535||a!==ke&&a>65535))throw new Error(QFe);d===ke&&(s!==ke||a!==ke)&&(d=fre);let b=hA(e,n,toe),f=qi(e,n,noe),y=s!==ke||a!==ke||c!==ke||d||r,_=b!==ke||f!==ke;if(y?(i=!1,o=o&255|768):_&&(i=!0,o=o&255),ME(b,255,qFe),f&&(typeof f!==JWe||Array.isArray(f)))throw new Error($Fe);if(o>65535)throw new Error(_re);let S=sIe(e,n,eoe,zH),Z=S!==ke;Z||(S=0),!n[mR]&&t.endsWith("/")&&(n[mR]=!0);let R=qi(e,n,mR);if(R?(t.endsWith("/")||(t+="/"),Z||(S=16,i||(S|=16877<<16))):!i&&!Z&&(r?S=493<<16:S=420<<16),!i){let A=c!==ke||!!(u||m||p),L=S>>16&65535;c=c===ke?L:c&65535,u?c|=2048:u=!!(c&2048),m?c|=1024:m=!!(c&1024),p?c|=512:p=!!(c&512),(!Z||A)&&(R?c=c&-61441|16384:c&61440||(c|=32768),S=(c&65535)<<16|S&65535)}({msdosAttributesRaw:b,msdosAttributes:f}=_Nt(b,f)),_&&(S=S&4294967295|b&255);let C=S>>16&65535,E=c!==ke&&(c&61440)==40960;return{name:t,resolvedOptions:{versionMadeBy:o,msDosCompatible:!!i,externalFileAttributes:S,unixExternalUpper:C,uid:s,gid:a,unixMode:c,unixExtraFieldType:d,symlink:E,setuid:u,setgid:m,sticky:p,msdosAttributesRaw:b,msdosAttributes:f}}}function pNt(e,t,n){let i=gre(e,n,_ve)||kE,o=i(t,lH);if(o===ke&&(o=kE(t)),co(o)>65535)throw new Error(IFe);let r=n[Nk]||"";if(typeof r!=oR)throw new Error(vFe);let s=i(r,dH);if(s===ke&&(s=kE(r)),co(s)>65535)throw new Error(WFe);let a=qi(e,n,roe);if(a!==ke&&a>65535)throw new Error(_re);let c=hre(e,n,iA,new Date),d=qi(e,n,oA),u=hre(e,n,Mk),m=hre(e,n,wk),p=sIe(e,n,$ie,BH,0),b=qi(e,n,iH),f=qi(e,n,tH),y=qi(e,n,nH);hH(f,y);let _=hA(e,n,uve,3),S=qi(e,n,aoe),Z=qi(e,n,mve,!0),R=qi(e,n,hve),C=qi(e,n,fve,!0),E=qi(e,n,rH),A=qi(e,n,aH),L=qi(e,n,bve),F=gre(e,n,gve),I=qi(e,n,yve,!0),N=mH(qi(e,n,oH)),g=qi(e,n,xve,!0),V=qi(e,n,loe),G=b||V===ke?ke:ZH(V);if(!b&&V!==ke&&V!==0&&V!==8&&!G)throw new Error(rNt);let v=hA(e,n,pve);if(ME(v,dNt,eIe),e.options[NE]){if(f!==ke||y!==ke)throw new Error(XFe);v===ke&&V===ke&&(v=0)}b&&(v=ke);let X=qi(e,n,sH),Y=qi(e,n,fie);L&&Y===ke&&(Y=!1),(Y===ke||S&&!b)&&(Y=!0),v!==ke&&v!=6&&(X=!1);let D=qi(e,n,HH);if(!S&&(f!==ke||y!==ke)&&!(Number.isInteger(_)&&_>=1&&_<=3))throw new Error(PFe);let M=dre(n[JH]),O=dre(n[Zve]),w=dre(n[Rve]);return{comment:r,resolvedOptions:{rawFilename:o,rawComment:s,version:a,lastModDate:c,rawLastModDate:d,lastAccessDate:u,creationDate:m,internalFileAttributes:p,passThrough:b,password:f,rawPassword:y,encryptionStrength:_,zipCrypto:S,extendedTimestamp:Z,ntfsTimestamp:R,keepOrder:C,useWebWorkers:E,transferStreams:A,bufferedWrite:L,createTempStream:F,dataDescriptorSignature:I,signal:N,useUnicodeFileNames:g,compressionMethod:V,format:G?G.format:ke,codecURI:G?G.codecURI:ke,codecVersionNeeded:G?G.versionNeeded:ke,level:v,useCompressionStream:X,dataDescriptor:Y,zip64:D,rawExtraField:M,rawLocalExtraField:O,rawCentralExtraField:w}}}function dre(e){if(!e)return yo;if(!(e instanceof Map))throw new Error(YFe);let t=0,n=0;e.forEach((r,s)=>{if(gie(s,65535,MFe),!(r instanceof Uint8Array))throw new Error(wFe);if(co(r)>65535)throw new Error(TK);t+=4+co(r)});let i=new Uint8Array(t),o=fi(i);return e.forEach((r,s)=>{X0(o,n,s),X0(o,n+2,co(r)),qk(i,r,n+4),n+=4+co(r)}),i}async function bNt(e,t,{resolvedOptions:n},i){if(n.passThrough&&!t&&!qi(e,i,mR))throw new Error(BFe);let o;return t&&(t=new ty(t),await wc(t),{size:o}=t),Object.assign({reader:t},gNt(e,!!t,o,n,i))}function gNt(e,t,n,i,o){let{passThrough:r,zipCrypto:s,password:a,rawPassword:c,encryptionStrength:d}=i,{dataDescriptor:u,zip64:m,level:p,compressionMethod:b}=i,f=0,y=0;if(r&&t){if(y=o[Yk],y===ke)throw new Error(DFe);if(b===ke)throw new Error(OFe)}let _=m===!0,S=qi(e,o,ooe);if(t&&r&&!S&&co(a,c))throw new Error(NFe);let Z=t&&(!!(a&&co(a)||c&&co(c))||r&&S);t||(p=0,b=0);let R=Z?s?12:16+d*4:0;t&&(r?(o.uncompressedSize=y,f=n===ke?GFe(y)+R:n):n===ke?(u=!0,(m||m===ke)&&(m=!0,y=f=4294967296)):(o.uncompressedSize=y=n,f=(yre(b,p)?GFe(y):y)+R));let C=!Z&&(!t||n===0&&!r)&&!yre(b,p);C&&!s&&qi(e,o,fie)===ke&&(u=!1);let E=_||y>=4294967295,A=_||f>=4294967295;if(E||A){if(m===!1)throw new Error(_K);m=!0}return m=m||!1,{maximumCompressedSize:f,resolvedOptions:{dataDescriptor:u,emptyEntry:C,zip64:m,zip64UncompressedSize:E,zip64CompressedSize:A,uncompressedSize:y,level:p,compressionMethod:b,encrypted:Z}}}async function yNt(e,t,n,i,o){let{fileEntries:r,writer:s}=e,{keepOrder:a,dataDescriptor:c,emptyEntry:d,signal:u}=o,{headerInfo:m,fileEntry:p,previousFileEntry:b,releaseLockFileEntry:f}=i,y=e.options[NE],_=p,S,Z,R,C,E,A=0,L,F=a&&b?b.lockFileEntry:ke;r.set(t,_);try{o.bufferedWrite||!a||e.writerLocked||e.bufferedWrites||!c&&!d?(S=!0,e.bufferedWrites++,o.createTempStream?L=await o.createTempStream():L=new TransformStream(ke,ke,{highWaterMark:iR}),L.size=0,await wc(s)):(L=s,await F,await I()),await wc(L);let g=Jk(s);e.addSplitZipSignature&&!S&&await VFe(e,s),y&&!S&&RFe(i,e.offset-g);let{localHeaderArray:V}=m;S||await N();let G=oy(s),v=jk(e,s);if(_.diskNumberStart=G,S||(C=!0,E=s.size,await N0(L,V)),_=await xNt(n,L,_,i,qg(),o),S||(C=!1),r.set(t,_),_.filename=t,S){if(await Promise.all([L.writable.getWriter().close(),F]),await I(),e.addSplitZipSignature&&await VFe(e,s),R=!0,E=s.size,await N(),_.diskNumberStart=oy(s),_.offset=jk(e,s),y){let X=i.metadataSize;RFe(i,e.offset-Jk(s)),_.size+=i.metadataSize-X}RNt(_,m.localHeaderView,o),await N0(s,m.localHeaderArray),await oIe(L.readable,s,u,X=>A+=X),s.size+=L.size,R=!1}else _.diskNumberStart=G,_.offset=v;return e.offset+=_.size,_}catch(g){if(R||C){if(e.hasCorruptedEntries=!0,g)try{g.corruptedEntry=!0}catch{}e.offset+=s.size-E,S&&(e.offset+=A)}throw r.delete(t),g}finally{if(S&&e.bufferedWrites--,f&&f(F),Z&&Z(),S&&L&&L.dispose)try{await L.dispose()}catch{}}async function I(){e.writerLocked=!0;let{lockWriter:g}=e;e.lockWriter=new Promise(V=>Z=()=>{e.writerLocked=!1,V()}),await g}async function N(){fA(s,co(m.localHeaderArray))&&await s.closeDisk()}}async function xNt(e,t,{diskNumberStart:n,lockFileEntry:i},o,r,s){let{headerInfo:a,dataDescriptorInfo:c,metadataSize:d}=o,{headerArray:u,headerView:m,lastModDate:p,rawLastModDate:b,encrypted:f,compressed:y,version:_,compressionMethod:S,rawExtraFieldZip64:Z,localExtraFieldZip64Length:R,rawExtraFieldExtendedTimestamp:C,extraFieldExtendedTimestampFlag:E,rawExtraFieldNTFS:A,rawExtraFieldUnix:L,rawExtraFieldAES:F}=a,{dataDescriptorArray:I}=c,{rawFilename:N,lastAccessDate:g,creationDate:V,password:G,rawPassword:v,level:X,zip64:Y,zip64UncompressedSize:D,zip64CompressedSize:M,zipCrypto:O,dataDescriptor:w,directory:z,executable:K,versionMadeBy:te,rawComment:H,rawExtraField:$,rawCentralExtraField:ee,useWebWorkers:le,transferStreams:_e,onstart:he,onprogress:Ze,onend:ye,signal:Ge,encryptionStrength:Ae,extendedTimestamp:Fe,msDosCompatible:tt,internalFileAttributes:Be,externalFileAttributes:je,uid:qe,gid:We,unixMode:Ke,symlink:ct,setuid:Et,setgid:zt,sticky:ut,unixExternalUpper:bt,msdosAttributesRaw:ht,msdosAttributes:jt,useCompressionStream:st,passThrough:pt,format:Mi,codecURI:jn}=s,Si={lockFileEntry:i,versionMadeBy:te,zip64:Y,directory:!!z,executable:!!K,filenameUTF8:!0,rawFilename:N,commentUTF8:!0,rawComment:H,rawExtraFieldZip64:Z,localExtraFieldZip64Length:R,rawExtraFieldExtendedTimestamp:C,rawExtraFieldNTFS:A,rawExtraFieldUnix:L,rawExtraFieldAES:F,rawExtraField:$,rawCentralExtraField:ee,extendedTimestamp:Fe,msDosCompatible:tt,internalFileAttributes:Be,externalFileAttributes:je,diskNumberStart:n,uid:qe,gid:We,unixMode:Ke,symlink:!!ct,setuid:Et,setgid:zt,sticky:ut,unixExternalUpper:bt,msdosAttributesRaw:ht,msdosAttributes:jt},{crc32:Hi,uncompressedSize:Gi}=s,pi=0;pt||(Gi=0);let{writable:Zi}=t;if(e){let On=Qf(Oie(e)),rn=e.size,Hn={options:{codecType:jE,inputSize:rn,level:X,rawPassword:v,password:G,encryptionStrength:Ae,zipCrypto:f&&O,passwordVerification:f&&O&&b>>8&255,computeCrc32:!pt,compressed:y&&!pt,encrypted:f&&!pt,useWebWorkers:le,useCompressionStream:st,transferStreams:_e,format:Mi,codecURI:jn,compressionMethod:S},config:r,streamOptions:{signal:Ge,size:rn,onstart:he,onprogress:Ze,onend:ye}};try{let $i=await YH({readable:On,writable:Zi},Hn);if(pi=$i.outputSize,t.size+=pi,pt||(Gi=$i.inputSize,(!f||O)&&(Hi=$i.crc32)),!M&&pi>=4294967295||!D&&Gi>=4294967295)throw new Error(_K)}catch($i){throw $i.outputSize!==ke&&(t.size+=$i.outputSize),$i}}return ZNt({crc32:Hi,compressedSize:pi,uncompressedSize:Gi,headerInfo:a,dataDescriptorInfo:c},s),w&&await N0(t,I),Object.assign(Si,{uncompressedSize:Gi,compressedSize:pi,lastModDate:p,rawLastModDate:b,creationDate:V,lastAccessDate:g,encrypted:!!f,zipCrypto:!!O,size:d+pi,compressionMethod:S,version:_,headerArray:u,headerView:m,signature:Hi,crc32:f&&!O&&!pt?ke:Hi,extraFieldExtendedTimestampFlag:E,zip64UncompressedSize:D,zip64CompressedSize:M}),Si}function TNt(e){let{rawFilename:t,lastModDate:n,rawLastModDate:i,lastAccessDate:o,creationDate:r,level:s,zip64:a,zipCrypto:c,useUnicodeFileNames:d,dataDescriptor:u,directory:m,rawExtraField:p,rawLocalExtraField:b,encryptionStrength:f,extendedTimestamp:y,ntfsTimestamp:_,passThrough:S,encrypted:Z,zip64UncompressedSize:R,zip64CompressedSize:C,uncompressedSize:E,crc32:A}=e,{version:L,compressionMethod:F}=e,I=!m&&yre(F,s),N,g=S||!I,V=a&&(e.bufferedWrite||!u||!R&&!C||g),G=V||a&&u&&(R||C);if(a&&(R||C)){let ye=sm(20);if(ye.writeUint16(1),ye.writeUint16(16),N=ye.array,V&&(ye.writeUint64(E),g)){let Ge=Z?c?12:16+f*4:0;ye.writeUint64(S?0:E+Ge)}}else N=yo;let v;if(Z&&!c){let Ze=sm(co(SFe)+2);Ze.writeUint16(39169),Ze.writeBytes(SFe),v=Ze.array,v[8]=f}else v=yo;let X,Y,D;if(y){let Ze=gK(n),ye=rIe(Ze);if(ye){let Ae=9+(o?4:0)+(r?4:0),Fe=sm(Ae);D=1+(o?2:0)+(r?4:0),Fe.writeUint16(21589),Fe.writeUint16(Ae-4),Fe.writeUint8(D),Fe.writeUint32(Ze),o&&Fe.writeUint32(EFe(gK(o))),r&&Fe.writeUint32(EFe(gK(r))),Y=Fe.array}else Y=yo;if(_===ke?!ye||!!(o||r):_)try{let Ae=mre(n),Fe=sm(36);Fe.writeUint16(10),Fe.writeUint16(32),Fe.skip(4),Fe.writeUint16(1),Fe.writeUint16(24),Fe.writeUint64(Ae),Fe.writeUint64(o?mre(o):Ae),Fe.writeUint64(r?mre(r):Ae),X=Fe.array}catch{X=yo}else X=yo}else X=Y=yo;let M;try{let{uid:Ze,gid:ye,unixExtraFieldType:Ge}=e;if(Ge==fre&&(Ze!==ke||ye!==ke)){let Ae=CFe(Ze===ke?0:Ze),Fe=CFe(ye===ke?0:ye),tt=3+Ae.length+Fe.length,Be=sm(4+tt);Be.writeUint16(30837),Be.writeUint16(tt),Be.writeUint8(1),Be.writeUint8(Ae.length),Be.writeBytes(Ae),Be.writeUint8(Fe.length),Be.writeBytes(Fe),M=Be.array}else if(Ge==pre&&(Ze!==ke||ye!==ke)){let Ae=sm(8);Ae.writeUint16(30805),Ae.writeUint16(4),Ae.writeUint16((Ze===ke?0:Ze)&65535),Ae.writeUint16((ye===ke?0:ye)&65535),M=Ae.array}else M=yo}catch{M=yo}F===ke&&(F=I?8:0),L===ke&&(L=F==0&&!m&&!Z?10:20);let{codecVersionNeeded:O}=e;I&&O!==ke&&(L=L>O?L:O),a&&(L=L>45?L:45),Z&&!c&&(L=L>51?L:51,S&&A!==ke&&(v[sNt]=lNt),X0(fi(v),aNt,F),F=99);let w=G?co(N):0,z=w+co(v,Y,X,M,p,b),K=e[NE]?cNt:0;if(z+K>65535)throw new Error(TK);let te=new Date(Math.ceil(Math.floor(n.getTime()/1e3)/2)*2e3),{headerArray:H,headerView:$,rawLastModDate:ee}=aIe({version:L,bitFlag:cIe(s,d,u,Z,F),compressionMethod:F,uncompressedSize:E,lastModDate:te<XE?XE:te>hie?hie:te,rawLastModDate:i,rawFilename:t,zip64CompressedSize:C,zip64UncompressedSize:R,extraFieldLength:z}),le=sm(30+co(t)+z),_e=le.array,he=fi(_e);return le.writeUint32(67324752),le.writeBytes(H),le.writeBytes(t),G&&le.writeBytes(N),le.writeBytes(v),le.writeBytes(Y),le.writeBytes(X),le.writeBytes(M),le.writeBytes(p),le.writeBytes(b),u&&(C||kc(he,18,0),R||kc(he,22,0)),{localHeaderArray:_e,localHeaderView:he,headerArray:H,headerView:$,lastModDate:n,rawLastModDate:ee,encrypted:Z,compressed:I,version:L,compressionMethod:F,extraFieldExtendedTimestampFlag:D,rawExtraFieldZip64:yo,localExtraFieldZip64Length:w,rawExtraFieldExtendedTimestamp:Y,rawExtraFieldNTFS:X,rawExtraFieldUnix:M,rawExtraFieldAES:v,extraFieldLength:z}}function RFe(e,t){let{headerInfo:n}=e,{localHeaderArray:i,extraFieldLength:o}=n,r=64-(t+co(i))%64;r<4&&(r+=64);let s=new Uint8Array(r),a=fi(s);X0(a,0,6534),X0(a,2,r-4);let c=i;n.localHeaderArray=i=new Uint8Array(co(c)+r),qk(i,c),qk(i,s,co(c));let d=fi(i);X0(d,28,o+r),n.localHeaderView=d,e.metadataSize+=r}function CFe(e){let t=new Uint8Array(4);fi(t).setUint32(0,e,!0);let i=4;for(;i>1&&t[i-1]===0;)i--;return t.subarray(0,i)}function _Nt(e,t){if(e!==ke)e=e&255;else if(t!==ke){let{readOnly:n,hidden:i,system:o,directory:r,archive:s}=t,a=0;n&&(a|=1),i&&(a|=2),o&&(a|=4),r&&(a|=16),s&&(a|=32),e=a&255}return t===ke&&(t={readOnly:!!(e&1),hidden:!!(e&2),system:!!(e&4),directory:!!(e&16),archive:!!(e&32)}),{msdosAttributesRaw:e,msdosAttributes:t}}function SNt({zip64:e,dataDescriptor:t,dataDescriptorSignature:n}){let i=yo,o,r=0,s=e?20:12;return n&&(s+=4),t&&(i=new Uint8Array(s),o=fi(i),n&&(r=4,kc(o,0,134695760))),{dataDescriptorArray:i,dataDescriptorView:o,dataDescriptorOffset:r}}function ZNt({crc32:e,compressedSize:t,uncompressedSize:n,headerInfo:i,dataDescriptorInfo:o},{zip64:r,zipCrypto:s,passThrough:a,dataDescriptor:c}){let{headerView:d,encrypted:u}=i,{dataDescriptorView:m,dataDescriptorOffset:p}=o;(!u||s||a)&&e!==ke&&(kc(d,10,e),c&&kc(m,p,e)),r?c&&(Qk(m,p+4,BigInt(t)),Qk(m,p+12,BigInt(n))):(kc(d,14,t),kc(d,18,n),c&&(kc(m,p+4,t),kc(m,p+8,n)))}function RNt({rawFilename:e,encrypted:t,zip64:n,localExtraFieldZip64Length:i,crc32:o,compressedSize:r,uncompressedSize:s,zip64UncompressedSize:a,zip64CompressedSize:c},d,{dataDescriptor:u,passThrough:m}){if(u||((!t||m&&o!==ke)&&kc(d,14,o),c||kc(d,18,r),a||kc(d,22,s)),n&&i){let p=30+co(e)+4;Qk(d,p,BigInt(s)),Qk(d,p+8,BigInt(r))}}async function CNt(e,t,n){let i=VNt(e.fileEntries),{directoryStart:o,directoryEnd:r,directoryArray:s}=await ENt(e,i,n),a=await ANt(e,s,n);await GNt(e,t,n,{directoryStart:o,directoryEnd:r,directoryDataLength:i,signatureLength:a})}function VNt(e){let t=0;for(let[,n]of e){let{rawFilename:i,rawExtraFieldAES:o,rawComment:r,rawExtraFieldNTFS:s,rawExtraFieldUnix:a,rawExtraField:c,rawCentralExtraField:d,extendedTimestamp:u,extraFieldExtendedTimestampFlag:m,lastModDate:p,zip64UncompressedSize:b,zip64CompressedSize:f,uncompressedSize:y,compressedSize:_}=n,S=n.offset>=4294967295,Z=n.diskNumberStart>=65535,R;if(S||Z||b||f){let L=4+(b?8:0)+(f?8:0)+(S?8:0)+(Z?4:0),F=sm(L);F.writeUint16(1),F.writeUint16(L-4),b&&F.writeUint64(y),f&&F.writeUint64(_),S&&F.writeUint64(n.offset),Z&&F.writeUint32(n.diskNumberStart),R=F.array}else R=yo;n.rawExtraFieldZip64=R,n.zip64Offset=S,n.zip64DiskNumberStart=Z;let C,E=gK(p);if(u&&rIe(E)){let L=sm(9);L.writeUint16(21589),L.writeUint16(5),L.writeUint8(m),L.writeUint32(E),C=L.array}else C=yo;n.rawExtraFieldExtendedTimestamp=C;let A=co(R,o,s,a,C,c,d);if(A>65535)throw new Error(TK);t+=46+co(i,r)+A}return t}async function ENt(e,t,n){let{fileEntries:i,writer:o}=e,r=new Uint8Array(t);await wc(o);let s=0,a=0,c=oy(o),d=Jk(o),u=0;for(let[m,p]of Array.from(i.values()).entries()){let{offset:b,rawFilename:f,rawExtraFieldZip64:y,rawExtraFieldAES:_,rawExtraFieldExtendedTimestamp:S,rawExtraFieldNTFS:Z,rawExtraFieldUnix:R,rawExtraField:C,rawCentralExtraField:E,rawComment:A,versionMadeBy:L,headerArray:F,headerView:I,zip64UncompressedSize:N,zip64CompressedSize:g,zip64DiskNumberStart:V,zip64Offset:G,internalFileAttributes:v,externalFileAttributes:X,diskNumberStart:Y,uncompressedSize:D,compressedSize:M}=p,O=co(y,_,S,Z,R,C,E),w=46+co(f,A)+O;fA(o,s+w-a)&&(await N0(o,r.slice(a,s)),a=s,u=0,await o.closeDisk()),m==0&&(c=oy(o),d=Jk(o)),N||kc(I,18,D),g||kc(I,14,M),(G||V)&&p.version<45&&X0(I,0,45);let z=sm(w);if(z.writeUint32(33639248),z.writeUint16(L),z.writeBytes(F.subarray(0,24)),z.writeUint16(O),z.writeUint16(co(A)),z.writeUint16(V?65535:Y),z.writeUint16(v),z.writeUint32(X),z.writeUint32(G?4294967295:b),z.writeBytes(f),z.writeBytes(y),z.writeBytes(_),z.writeBytes(S),z.writeBytes(Z),z.writeBytes(R),z.writeBytes(C),z.writeBytes(E),z.writeBytes(A),qk(r,z.array,s),s+=w,u++,n.onprogress)try{await n.onprogress(m+1,i.size,new ZT(p))}catch{}}return await N0(o,a?r.slice(a):r),{directoryStart:{diskNumber:c,diskOffset:d},directoryEnd:{diskNumber:oy(o),entriesLength:u},directoryArray:r}}async function ANt(e,t,n){let i=gre(e,n,Gve);if(i){let o=await i(t),r=co(o);if(r>65535)throw new Error(tIe);let s=sm(6+r);s.writeUint32(84233040),s.writeUint16(r),s.writeBytes(o);let{writer:a}=e;return fA(a,co(s.array))&&await a.closeDisk(),await N0(a,s.array),6+r}return 0}async function GNt(e,t,n,i){let{writer:o}=e,{directoryStart:r,directoryEnd:s,signatureLength:a}=i,{directoryDataLength:c}=i,d=e.fileEntries.size,u=r.diskNumber,m=jk(e,r),p=co(t);if(p>65535)throw new Error(Tre);let b=qi(e,n,HH),f=oy(o);if(fA(o,(b?98:22)+p)&&f++,m>=4294967295||c>=4294967295||d>=65535||f>=65535){if(b===!1)throw new Error(_K);b=!0}let y=sm(b?98:22);fA(o,co(y.array)+p)&&await o.closeDisk(),f=oy(o);let _=f==s.diskNumber?s.entriesLength:0;b&&(y.writeUint32(101075792),y.writeUint64(44),y.writeUint16(45),y.writeUint16(45),y.writeUint32(f),y.writeUint32(u),y.writeUint64(_),y.writeUint64(d),y.writeUint64(c),y.writeUint64(m),y.writeUint32(117853008),y.writeUint32(f),y.writeUint64(BigInt(jk(e,o))+BigInt(c)+BigInt(a)),y.writeUint32(f+1),qi(e,n,Tve,!0)&&(f=65535,u=65535),_=65535,d=65535,m=4294967295,c=4294967295),y.writeUint32(101010256),y.writeUint16(f),y.writeUint16(u),y.writeUint16(_),y.writeUint16(d),y.writeUint32(c),y.writeUint32(m),y.writeUint16(p),await N0(o,y.array),p&&await N0(o,t)}function sm(e){let t=new Uint8Array(e),n=fi(t),i=0;return{array:t,writeUint8:o=>{INt(n,i,o),i+=1},writeUint16:o=>{X0(n,i,o),i+=2},writeUint32:o=>{kc(n,i,o),i+=4},writeUint64:o=>{Qk(n,i,BigInt(o)),i+=8},writeBytes:o=>{qk(t,o,i),i+=co(o)},skip:o=>i+=o}}function oy(e){let{diskNumber:t=0}=e;return t}function Jk(e){let{diskOffset:t=0}=e;return t}function fA(e,t){let{availableSize:n=iR}=e;return t>n}function jk(e,{diskNumber:t=0,diskOffset:n=0}){return e.offset-n-(t?e.initialOffset:0)}async function LNt(e){let t=await Mr(e,0,4);return FNt(fi(t),0)==134695760}function nIe(e){let t=fi(e),n=0;for(;n+4<=co(e);){let i=4+xK(t,n+2);if(xK(t,n)==1)return nIe(Sh(e.subarray(0,n),e.subarray(Math.min(n+i,co(e)))));n+=i}return e}async function WNt(e,t,n,i){let{writer:o}=e,r=new Map;if(o.closeDisk){let s=Array.from(n).sort((c,d)=>bK(t,c)-bK(t,d)),a=0;for(let c of s){let d=bK(t,c);await ure(e,t,a,d-a),fA(o,await vNt(t,d))&&await o.closeDisk(),r.set(c,{offset:jk(e,o),diskNumberStart:oy(o)}),a=d}await ure(e,t,a,i-a)}else{let s=e.offset;await ure(e,t,0,i),n.forEach(a=>r.set(a,{offset:s+bK(t,a),diskNumberStart:0}))}return r}async function ure(e,t,n,i){if(i>0){let{writer:o}=e,r=0;try{await oIe(Oie(t,{offset:n,size:i}),o,ke,s=>r+=s)}catch(s){e.hasCorruptedEntries=!0;try{s.corruptedEntry=!0}catch{}throw s}finally{o.size+=r,e.offset+=r}}}async function vNt(e,t){let n=await Mr(e,t,30);if(co(n)<30)return 30;let i=fi(n);return 30+xK(i,26)+xK(i,28)}function bK(e,{offset:t,diskNumberStart:n}){return t+(e.getDiskOffset?e.getDiskOffset(n):0)}function iIe(){let e=new Uint8Array(4);return kc(fi(e),0,134695760),e}async function VFe(e,t){delete e.addSplitZipSignature,await N0(t,iIe()),e.offset+=4}async function N0(e,t){let{writable:n}=e,i=n.getWriter();try{await i.ready,e.size+=co(t),await i.write(t)}finally{i.releaseLock()}}async function oIe(e,t,n,i){let o=t.writable.getWriter();try{await e.pipeTo(new WritableStream({async write(r){await o.ready,await o.write(r),i(co(r))}}),{preventClose:!0,preventAbort:!0,signal:n})}finally{o.releaseLock()}}function mre(e){if(e){let t=(BigInt(e.getTime())+BigInt(116444736e5))*BigInt(1e4);return t<TFe?TFe:t>_Fe?_Fe:t}}function gK(e){return Math.floor(e.getTime()/1e3)}function rIe(e){return e>=kFe&&e<=UFe}function EFe(e){return Math.min(UFe,Math.max(kFe,e))}function qi(e,t,n,i){let o=t[n]===ke?e.options[n]:t[n];return o===ke?i:o}function hre(e,t,n,i){let o=qi(e,t,n,i);if(o===null)return i;if(o!==ke&&(typeof o.getTime!=Yr||Number.isNaN(o.getTime())))throw new Error(FFe);return o}function gre(e,t,n){return YE(qi(e,t,n))}function sIe(e,t,n,i,o){let r=AFe(t,n,i),s=r===ke?AFe(e.options,n,i):r;return s===ke?o:s}function AFe(e,t,n){return e[t]===ke?e[n]:e[t]}function hA(e,t,n,i){return rR(qi(e,t,n,i))}function GFe(e){return e+5*(Math.floor(e/16383)+1)}function yre(e,t){return e===ke?t===ke||t>0:e!==0}function xK(e,t){return e.getUint16(t,!0)}function FNt(e,t){return e.getUint32(t,!0)}function INt(e,t,n){e.setUint8(t,n)}function X0(e,t,n){e.setUint16(t,n,!0)}function kc(e,t,n){e.setUint32(t,n,!0)}function Qk(e,t,n){e.setBigUint64(t,n,!0)}function qk(e,t,n){e.set(t,n)}function co(...e){let t=0;return e.forEach(n=>n&&(t+=n.length)),t}function aIe({version:e,bitFlag:t,compressionMethod:n,uncompressedSize:i,compressedSize:o,lastModDate:r,rawLastModDate:s,rawFilename:a,zip64CompressedSize:c,zip64UncompressedSize:d,extraFieldLength:u}){let m=sm(26),p=m.array,b=fi(p);if(m.writeUint16(e),m.writeUint16(t),m.writeUint16(n),s===ke){let f=new Uint32Array(1),y=fi(f);X0(y,0,(r.getHours()<<6|r.getMinutes())<<5|r.getSeconds()/2),X0(y,2,(r.getFullYear()-1980<<4|r.getMonth()+1)<<5|r.getDate()),s=f[0]}return m.writeUint32(s),m.skip(4),c||o!==ke?m.writeUint32(c?4294967295:o):m.skip(4),d||i!==ke?m.writeUint32(d?4294967295:i):m.skip(4),m.writeUint16(co(a)),m.writeUint16(u),{headerArray:p,headerView:b,rawLastModDate:s}}function cIe(e,t,n,i,o){let r=0;return t&&(r=r|2048),n&&(r=r|8),(o==8||o==9)&&(e>=0&&e<=3&&(r=r|6),e>3&&e<=5&&(r=r|4),e==9&&(r=r|2)),i&&(r=r|1),r}OH();gk();var ESo=x(T(),1);G0();cR();var FSo=x(T(),1);_c();G0();cR();Gie();var PSo=x(T(),1);var YSo=x(T(),1);var XSo=1024*1024;var USo=x(T(),1);BE();var wSo=1024*1024;var zSo=x(T(),1);var DSo=1024*1024;var OSo=512*1024;var XNt={};try{wE({baseURI:XNt.url})}catch{}var KZo=x(T(),1);G0();var AZo=x(T(),1),NNt=[3,4,5,6,7,8,9,10,11,13,15,17,19,23,27,31,35,43,51,59,67,83,99,115,131,163,195,227,258],YNt=[0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0],MNt=[1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577],wNt=[0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13],kNt=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15],eU=new Uint8Array(288);eU.fill(8,0,144),eU.fill(9,144,256),eU.fill(7,256,280),eU.fill(8,280,288);var UNt=new Uint8Array(30).fill(5);function $k(e){let t=new Uint16Array(16);for(let o of e)t[o]++;t[0]=0;let n=new Uint16Array(17);for(let o=1;o<=15;o++)n[o+1]=n[o]+t[o];let i=new Uint16Array(e.length);for(let o=0;o<e.length;o++)e[o]&&(i[n[e[o]]++]=o);return{l:t,symbols:i}}var am="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";function lIe(e){let t;e({wasmURI:()=>(t||(t="data:application/wasm;base64,"+(function(n){let i="",o=n.length,r=0;for(;r+2<o;r+=3){let a=n[r]<<16|n[r+1]<<8|n[r+2];i+=am[a>>18&63]+am[a>>12&63]+am[a>>6&63]+am[63&a]}let s=o-r;if(s===1){let a=n[r]<<16;i+=am[a>>18&63]+am[a>>12&63]+"=="}else if(s===2){let a=n[r]<<16|n[r+1]<<8;i+=am[a>>18&63]+am[a>>12&63]+am[a>>6&63]+"="}return i})((function(n){let i=0,o=0,r=0,s=new Uint8Array(1024),a=0,c=0;for(;!c;){c=u(1);let _=u(2);if(_==0)m();else if(_==1)p($k(eU),$k(UNt));else{if(_!=2)throw new Error("invalid deflate block type");p(...b())}}return s.subarray(0,a);function d(){if(i>=n.length)throw new Error("unexpected end of deflate data");return n[i++]}function u(_){for(;r<_;)o|=d()<<r,r+=8;let S=o&(1<<_)-1;return o>>>=_,r-=_,S}function m(){o=0,r=0;let _=d()|d()<<8;i+=2,y(a+_);for(let S=0;S<_;S++)s[a++]=d()}function p(_,S){let Z=f(_);for(;Z!=256;){if(Z<256)y(a+1),s[a++]=Z;else{let R=Z-257,C=NNt[R]+u(YNt[R]),E=f(S),A=MNt[E]+u(wNt[E]);y(a+C);let L=a-A;for(let F=0;F<C;F++)s[a++]=s[L+F]}Z=f(_)}}function b(){let _=u(5)+257,S=u(5)+1,Z=u(4)+4,R=new Uint8Array(19);for(let L=0;L<Z;L++)R[kNt[L]]=u(3);let C=$k(R),E=new Uint8Array(_+S),A=0;for(;A<E.length;){let L=f(C);if(L<16)E[A++]=L;else if(L==16){let F=E[A-1],I=u(2)+3;for(;I--;)E[A++]=F}else A+=L==17?u(3)+3:u(7)+11}return[$k(E.subarray(0,_)),$k(E.subarray(_))]}function f(_){let{l:S,symbols:Z}=_,R=0,C=0,E=0;for(let A=1;A<=15;A++){R|=u(1);let L=S[A];if(R-C<L)return Z[E+(R-C)];E+=L,C=C+L<<1,R<<=1}throw new Error("invalid huffman code")}function y(_){if(s.length<_){let S=2*s.length;for(;S<_;)S*=2;let Z=new Uint8Array(S);Z.set(s.subarray(0,a)),s=Z}}})((function(n){let i=(n=String(n).replace(/[^A-Za-z0-9+/=]/g,"")).length,o=[];for(let r=0;r<i;r+=4){let s=am.indexOf(n[r])<<18|am.indexOf(n[r+1])<<12|(63&am.indexOf(n[r+2]))<<6|63&am.indexOf(n[r+3]);o.push(s>>16&255),n[r+2]!=="="&&o.push(s>>8&255),n[r+3]!=="="&&o.push(255&s)}return new Uint8Array(o)})("zb19kF3XcSd2vu7He/fdmTvAABz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ZNV848sjl1O8C1+/ZDpwenRzenu0zo08Ont+gzp8/0VFPt1hkA8OjpwZlHRl98/uz5hy58nrbP/srmGEXcu8EXHtu8yshwf65slO82w3LmwqOPbW1ub5+9cJ4e3Rw8cuEhJf8Vak7tU0qlKlEtFau2ilSmnOooq3Jl1IzSalb5VzvZHzqrnIpUrBKVqpZqq0zlalbNqf3qBtVVR9R71AfVR9Wd6pfUf6HOqG31tPqH6s/U/6GMbtqa/psLf/vC3/7wNx/+DoS/Qm2o7/LOmVECA2DN1Zy6UZXqw8qr0+pJ9SdK6yeRpspqp2Od6o4u9IImfYte0Q9Ott+02bSFNg6qg+oGdYNaUAvqRnWjOqQOqa7qqsPqsLpJ3aRW1Ip6p/23Adc7u/6eDH9Phb+nw98z4e/Z8PfCz6H/eke/Otlu017TznPqOfVr6tfU8+p59evq19VvqN9Qv6l+U31JfUl9WX1ZfUV9RdFdSu2kSmmt1M1aqVml1KU1pVRL+nezknvc13Bvv1IqUf7SXHZSNj/H/8yuf3bXP7frXzT1z7+wL9vcXdXuT5vX4/AvCf/S8K8V/rXDvyz864R/Of/zr+7P3tNUnzQTZ26fSpNW3I4y17G5mdGzyv/1/uzRhNt2KuV/iserUGkox6zVp+EdUGOLYSn4flPGKEmZ3iwrjTJKRisnZaONVkVL+R/PZy06oQWr/x8=")))),t)})}var OZo=x(T(),1);_c();G0();vk();MH();var IZo=x(T(),1);var LZo=x(T(),1),RK="deflate",SK="deflate-raw",dIe="deflate64-raw",ZK="gzip",vs,pA,ry,tU,uIe;function mIe(e){if(vs=e,{malloc:pA,free:ry,memory:tU}=vs,typeof pA!="function"||typeof ry!="function"||!tU)throw vs=pA=ry=tU=null,new Error("Invalid WASM module")}function hIe(e){uIe=e}function fIe(e,t,n={}){if(!vs){let a=new Error("WASM module not loaded");throw a.cause=uIe,a}let i=typeof n.level=="number"?n.level:-1,o=typeof n.outBuffer=="number"?n.outBuffer:64*1024,r=typeof n.inBufferSize=="number"?n.inBufferSize:64*1024;return new TransformStream({start(){try{let a;if(this.out=pA(o),this.in=pA(r),this.inBufferSize=r,!this.out||!this.in)throw new Error("allocation failed");if(this._scratch=new Uint8Array(o),e?(this._process=vs.deflate_process,this._last_consumed=vs.deflate_last_consumed,this._end=vs.deflate_end,this.streamHandle=vs.deflate_new(),t===ZK?a=vs.deflate_init_gzip(this.streamHandle,i):t===SK?a=vs.deflate_init_raw(this.streamHandle,i):a=vs.deflate_init(this.streamHandle,i)):t===dIe?(this._process=vs.inflate9_process,this._last_consumed=vs.inflate9_last_consumed,this._end=vs.inflate9_end,this.streamHandle=vs.inflate9_new(),a=vs.inflate9_init_raw(this.streamHandle)):(this._process=vs.inflate_process,this._last_consumed=vs.inflate_last_consumed,this._end=vs.inflate_end,this.streamHandle=vs.inflate_new(),t===SK?a=vs.inflate_init_raw(this.streamHandle):t===ZK?a=vs.inflate_init_gzip(this.streamHandle):a=vs.inflate_init(this.streamHandle)),a!==0)throw new Error("init failed:"+a)}catch(a){throw s(this),a}},transform(a,c){try{let d=a,u=new Uint8Array(tU.buffer),m=this._process,p=this._last_consumed,b=this.out,f=this._scratch,y=0;for(;y<d.length;){let _=Math.min(d.length-y,32768);if((!this.in||this.inBufferSize<_)&&(this.in&&ry&&(ry(this.in),this.in=0),this.in=pA(_),this.inBufferSize=_,!this.in))throw new Error("allocation failed");u.set(d.subarray(y,y+_),this.in);let S=m(this.streamHandle,this.in,_,b,o,0),Z=S&16777215;if(Z&&(f.set(u.subarray(b,b+Z),0),c.enqueue(f.slice(0,Z))),!e){let C=S>>24&255,E=C&128?C-256:C;if(E<0)throw new Error("process error:"+E)}let R=p(this.streamHandle);if(R===0)break;y+=R}}catch(d){s(this),c.error(d)}},flush(a){try{let c=new Uint8Array(tU.buffer),d=this._process,u=this.out,m=this._scratch;for(;;){let p=d(this.streamHandle,0,0,u,o,4),b=p&16777215,f=p>>24&255;if(!e){let y=f&128?f-256:f;if(y<0)throw new Error("process error:"+y)}if(b&&(m.set(c.subarray(u,u+b),0),a.enqueue(m.slice(0,b))),f===1||b===0)break}}catch(c){a.error(c)}finally{let c=s(this);c!==0&&a.error(new Error("end error:"+c))}},cancel(){s(this)}});function s(a){let c=0;return a.streamHandle&&a._end&&(c=a._end(a.streamHandle)),a.streamHandle=0,a.in&&ry&&ry(a.in),a.in=0,a.out&&ry&&ry(a.out),a.out=0,c}}var xR=class{constructor(t=RK,n){return fIe(!0,t,n)}},TR=class{constructor(t=RK,n){return fIe(!1,t,n)}};xR.requiresModule=!0;TR.requiresModule=!0;xR.supportedFormats=[RK,SK,ZK];TR.supportedFormats=[RK,SK,ZK,dIe];var pIe=!1;async function bIe(e,{baseURI:t}){if(!pIe)try{await DNt(e,t),pIe=!0}catch(n){throw hIe(n),n}}async function DNt(e,t){let n,i;try{try{i=new URL(e,t)}catch{}n=await(await fetch(i)).arrayBuffer()}catch(r){if(e.startsWith("data:application/wasm;base64,"))n=ONt(e);else throw r}let o=await WebAssembly.instantiate(n);mIe(o.instance.exports)}function ONt(e){let t=e.split(",")[1],n=atob(t),i=n.length,o=new Uint8Array(i);for(let r=0;r<i;++r)o[r]=n.charCodeAt(r);return o.buffer}var CK;S2e({initModule:e=>{if(!CK){let{wasmURI:t}=e;typeof t==Yr&&(t=t()),CK=bIe(t,e).catch(n=>{throw CK=null,n})}return CK}});wE({CompressionStreamFallback:xR,DecompressionStreamFallback:TR});lIe(wE);var Sre=32,BNt="http://www.opengis.net/kml/2.2",ep="http://www.google.com/kml/ext/2.2",zNt="http://www.w3.org/2000/xmlns/";function VK(e){this._files={},this._promises=[],this._count=0,this._modelCallback=e}var HNt=/^data:image\/([^,;]+)/;VK.prototype.texture=function(e){let t=this,n;if(typeof e=="string"||e instanceof ve){if(e=ve.createIfNeeded(e),!e.isDataUri)return e.url;let i=e.url.match(HNt);n=`texture_${++this._count}`,l(i)&&(n+=`.${i[1]}`);let o=e.fetchBlob().then(function(r){t._files[n]=r});return this._promises.push(o),n}if(e instanceof HTMLCanvasElement){n=`texture_${++this._count}.png`;let i=new Promise(o=>{e.toBlob(function(r){t._files[n]=r,o()})});return this._promises.push(i),n}return""};function KNt(e,t){return function(n){e._files[t]=n}}VK.prototype.model=function(e,t){let n=this._modelCallback;if(!l(n))throw new ae("Encountered a model entity while exporting to KML, but no model callback was supplied.");let i={},o=n(e,t,i);for(let r in i)if(i.hasOwnProperty(r)){let s=Promise.resolve(i[r]);this._promises.push(s),s.then(KNt(this,r))}return o};Object.defineProperties(VK.prototype,{promise:{get:function(){return Promise.all(this._promises)}},files:{get:function(){return this._files}}});function EK(e){this._time=e}EK.prototype.get=function(e,t,n){let i;return l(e)&&(i=l(e.getValue)?e.getValue(this._time,n):e),i??t};EK.prototype.getColor=function(e,t){let n=this.get(e,t);if(l(n))return SR(n)};EK.prototype.getMaterialType=function(e){if(l(e))return e.getType(this._time)};function Zre(){this._ids={},this._styles={},this._count=0}Zre.prototype.get=function(e){let t=this._ids,n=e.innerHTML;if(l(t[n]))return t[n];let i=`style-${++this._count}`;return e.setAttribute("id",i),i=`#${i}`,t[n]=i,this._styles[n]=e,i};Zre.prototype.save=function(e){let t=this._styles,n=e.childNodes[0];for(let i in t)t.hasOwnProperty(i)&&e.insertBefore(t[i],n)};function xIe(){this._ids={}}xIe.prototype.get=function(e){if(!l(e))return this.get(Qn());let t=this._ids;return l(t[e])?`${e.toString()}-${++t[e]}`:(t[e]=0,e)};function Rre(e){e=e??B.EMPTY_OBJECT;let t=e.entities,n=e.kmz??!1,i=Rre._createState(e),o=t.values.filter(function(d){return!l(d.parent)}),r=i.kmlDoc,s=r.documentElement;s.setAttributeNS(zNt,"xmlns:gx",ep);let a=r.createElement("Document");s.appendChild(a),_Ie(i,a,o),i.styleCache.save(a);let c=i.externalFileHandler;return c.promise.then(function(){let u=new XMLSerializer().serializeToString(i.kmlDoc);return n?JNt(u,c.files):{kml:u,externalFiles:c.files}})}async function JNt(e,t){let n=en("ThirdParty/Workers/zip-web-worker.js"),i=en("ThirdParty/zip-module.wasm");xk({workerURI:n,wasmURI:i});let o=new tA("application/vnd.google-earth.kmz"),r=new Kk(o);await r.add("doc.kml",new Pk(e));let s=Object.keys(t);return await TIe(r,s,t,0),await r.close(),{kmz:await o.getData()}}async function TIe(e,t,n,i){if(t.length===i)return;let o=t[i];return await e.add(o,new ru(n[o])),TIe(e,t,n,i+1)}Rre._createState=function(e){let t=e.entities,n=new Zre,i=t.computeAvailability(),o=l(e.time)?e.time:i.start,r=e.defaultAvailability??i,s=e.sampleDuration??60;r.start===ot.MINIMUM_VALUE?r.stop===ot.MAXIMUM_VALUE?r=new Cn:Q.addSeconds(r.stop,-10*s,r.start):r.stop===ot.MAXIMUM_VALUE&&Q.addSeconds(r.start,10*s,r.stop);let a=new VK(e.modelCallback);return{kmlDoc:document.implementation.createDocument(BNt,"kml"),ellipsoid:e.ellipsoid??ne.default,idManager:new xIe,styleCache:n,externalFileHandler:a,time:o,valueGetter:new EK(o),sampleDuration:s,defaultAvailability:new Es([r])}};function _Ie(e,t,n){let i=e.kmlDoc,o=e.styleCache,r=e.valueGetter,s=e.idManager,a=n.length,c,d,u;for(let m=0;m<a;++m){let p=n[m];c=[],d=[],u=[],jNt(e,p,d,u),QNt(e,p.polyline,d,u),yIe(e,p.rectangle,d,u,c),yIe(e,p.polygon,d,u,c),tYt(e,p,p.model,d,u);let b,f=p.availability;l(f)&&(b=i.createElement("TimeSpan"),Q.equals(f.start,ot.MINIMUM_VALUE)||b.appendChild(En(i,"begin",Q.toIso8601(f.start))),Q.equals(f.stop,ot.MAXIMUM_VALUE)||b.appendChild(En(i,"end",Q.toIso8601(f.stop))));for(let S=0;S<c.length;++S){let Z=c[S];Z.setAttribute("id",s.get(p.id)),Z.appendChild(En(i,"name",p.name)),Z.appendChild(En(i,"visibility",p.show)),Z.appendChild(En(i,"description",p.description)),l(b)&&Z.appendChild(b),t.appendChild(Z)}let y=d.length;if(y>0){let S=i.createElement("Placemark");S.setAttribute("id",s.get(p.id));let Z=p.name,R=p.label;if(l(R)){let E=i.createElement("LabelStyle"),A=r.get(R.text);Z=l(A)&&A.length>0?A:Z;let L=r.getColor(R.fillColor);l(L)&&(E.appendChild(En(i,"color",L)),E.appendChild(En(i,"colorMode","normal")));let F=r.get(R.scale);l(F)&&E.appendChild(En(i,"scale",F)),u.push(E)}S.appendChild(En(i,"name",Z)),S.appendChild(En(i,"visibility",p.show)),S.appendChild(En(i,"description",p.description)),l(b)&&S.appendChild(b),t.appendChild(S);let C=u.length;if(C>0){let E=i.createElement("Style");for(let A=0;A<C;++A)E.appendChild(u[A]);S.appendChild(En(i,"styleUrl",o.get(E)))}if(d.length===1)S.appendChild(d[0]);else if(d.length>1){let E=i.createElement("MultiGeometry");for(let A=0;A<y;++A)E.appendChild(d[A]);S.appendChild(E)}}let _=p._children;if(_.length>0){let S=i.createElement("Folder");S.setAttribute("id",s.get(p.id)),S.appendChild(En(i,"name",p.name)),S.appendChild(En(i,"visibility",p.show)),S.appendChild(En(i,"description",p.description)),t.appendChild(S),_Ie(e,S,_)}}}var au=new h,yd=new pe,$f=new Q;function jNt(e,t,n,i){let o=e.kmlDoc,r=e.ellipsoid,s=e.valueGetter,a=t.billboard??t.point;if(!l(a)&&!l(t.path))return;let c=t.position;if(!c.isConstant){SIe(e,t,a,n,i);return}s.get(c,void 0,au);let d=En(o,"coordinates",_R(au,r)),u=o.createElement("Point"),m=o.createElement("altitudeMode");m.appendChild(ZR(e,a.heightReference)),u.appendChild(m),u.appendChild(d),n.push(u);let p=a instanceof el?RIe(e,a):ZIe(e,a);i.push(p)}function SIe(e,t,n,i,o){let r=e.kmlDoc,s=e.ellipsoid,a=e.valueGetter,c,d=t.position,u=!0;d instanceof pc?(c=d.intervals,u=!1):c=t.availability??e.defaultAvailability;let m=n instanceof Cb,p,b,f,y=[];for(p=0;p<c.length;++p){let S=c.get(p),Z=u?d:S.data,R=r.createElement("altitudeMode");Z instanceof l0?(Z=Z._value,R.appendChild(ZR(e,He.CLAMP_TO_GROUND))):l(n)?R.appendChild(ZR(e,n.heightReference)):R.appendChild(ZR(e,He.NONE));let C=[],E=[];if(Z.isConstant){a.get(Z,void 0,au);let L=En(r,"coordinates",_R(au,s));C.push(Q.toIso8601(S.start)),E.push(L),C.push(Q.toIso8601(S.stop)),E.push(L)}else if(Z instanceof bc)for(f=Z._property._times,b=0;b<f.length;++b)C.push(Q.toIso8601(f[b])),Z.getValueInReferenceFrame(f[b],Oi.FIXED,au),E.push(_R(au,s));else if(Z instanceof ju){f=Z._times;let L=Z._values;for(b=0;b<f.length;++b)C.push(Q.toIso8601(f[b])),h.fromArray(L,b*3,au),E.push(_R(au,s))}else{let L=e.sampleDuration;S.start.clone($f),S.isStartIncluded||Q.addSeconds($f,L,$f);let F=S.stop;for(;Q.lessThan($f,F);)Z.getValue($f,au),C.push(Q.toIso8601($f)),E.push(_R(au,s)),Q.addSeconds($f,L,$f);S.isStopIncluded&&Q.equals($f,F)&&(Z.getValue($f,au),C.push(Q.toIso8601($f)),E.push(_R(au,s)))}let A=r.createElementNS(ep,"Track");A.appendChild(R);for(let L=0;L<C.length;++L){let F=En(r,"when",C[L]),I=En(r,"coord",E[L],ep);A.appendChild(F),A.appendChild(I)}m&&A.appendChild(CIe(e,n)),y.push(A)}if(y.length===1)i.push(y[0]);else if(y.length>1){let S=r.createElementNS(ep,"MultiTrack");for(p=0;p<y.length;++p)S.appendChild(y[p]);i.push(S)}if(l(n)&&!m){let S=n instanceof el?RIe(e,n):ZIe(e,n);o.push(S)}let _=t.path;if(l(_)){let S=a.get(_.width),Z=_.material;if(l(Z)||l(S)){let R=r.createElement("LineStyle");l(S)&&R.appendChild(En(r,"width",S)),Cre(e,Z,R),o.push(R)}}}function ZIe(e,t){let n=e.kmlDoc,i=e.valueGetter,o=n.createElement("IconStyle"),r=i.getColor(t.color);l(r)&&(o.appendChild(En(n,"color",r)),o.appendChild(En(n,"colorMode","normal")));let s=i.get(t.pixelSize);return l(s)&&o.appendChild(En(n,"scale",s/Sre)),o}function RIe(e,t){let n=e.kmlDoc,i=e.valueGetter,o=e.externalFileHandler,r=n.createElement("IconStyle"),s=i.get(t.image);if(l(s)){s=o.texture(s);let p=n.createElement("Icon");p.appendChild(En(n,"href",s));let b=i.get(t.imageSubRegion);l(b)&&(p.appendChild(En(n,"x",b.x,ep)),p.appendChild(En(n,"y",b.y,ep)),p.appendChild(En(n,"w",b.width,ep)),p.appendChild(En(n,"h",b.height,ep))),r.appendChild(p)}let a=i.getColor(t.color);l(a)&&(r.appendChild(En(n,"color",a)),r.appendChild(En(n,"colorMode","normal")));let c=i.get(t.scale);l(c)&&r.appendChild(En(n,"scale",c));let d=i.get(t.pixelOffset);if(l(d)){c=c??1,k.divideByScalar(d,c,d);let p=i.get(t.width,Sre),b=i.get(t.height,Sre),f=i.get(t.horizontalOrigin,Di.CENTER);f===Di.CENTER?d.x-=p*.5:f===Di.RIGHT&&(d.x-=p);let y=i.get(t.verticalOrigin,zn.CENTER);y===zn.TOP?d.y+=b:y===zn.CENTER&&(d.y+=b*.5);let _=n.createElement("hotSpot");_.setAttribute("x",-d.x),_.setAttribute("y",d.y),_.setAttribute("xunits","pixels"),_.setAttribute("yunits","pixels"),r.appendChild(_)}let u=i.get(t.rotation),m=i.get(t.alignedAxis);return l(u)&&h.equals(h.UNIT_Z,m)&&(u=W.toDegrees(-u),u===0&&(u=360),r.appendChild(En(n,"heading",u))),r}function QNt(e,t,n,i){let o=e.kmlDoc,r=e.ellipsoid,s=e.valueGetter;if(!l(t))return;let a=o.createElement("LineString"),c=o.createElement("altitudeMode"),d=s.get(t.clampToGround,!1),u;d?(a.appendChild(En(o,"tessellate",!0)),u=o.createTextNode("clampToGround")):u=o.createTextNode("absolute"),c.appendChild(u),a.appendChild(c);let m=t.positions,p=s.get(m),b=En(o,"coordinates",_R(p,r));a.appendChild(b);let f=s.get(t.zIndex);d&&l(f)&&a.appendChild(En(o,"drawOrder",f,ep)),n.push(a);let y=o.createElement("LineStyle"),_=s.get(t.width);l(_)&&y.appendChild(En(o,"width",_)),Cre(e,t.material,y),i.push(y)}function qNt(e,t,n){let i=e.kmlDoc,o=e.valueGetter,r=o.get(t.height,0);n>0&&(r=n);let s=t.coordinates,a=o.get(s),c=[],d=[re.northeast,re.southeast,re.southwest,re.northwest];for(let b=0;b<4;++b)d[b](a,yd),c.push(`${W.toDegrees(yd.longitude)},${W.toDegrees(yd.latitude)},${r}`);let u=En(i,"coordinates",c.join(" ")),m=i.createElement("outerBoundaryIs"),p=i.createElement("LinearRing");return p.appendChild(u),m.appendChild(p),[m]}function gIe(e,t,n,i){let o=e.kmlDoc,r=e.ellipsoid,s=[],a=t.length;for(let u=0;u<a;++u)pe.fromCartesian(t[u],r,yd),s.push(`${W.toDegrees(yd.longitude)},${W.toDegrees(yd.latitude)},${i?yd.height:n}`);let c=En(o,"coordinates",s.join(" ")),d=o.createElement("LinearRing");return d.appendChild(c),d}function $Nt(e,t,n){let i=e.kmlDoc,o=e.valueGetter,r=o.get(t.height,0),s=o.get(t.perPositionHeight,!1);!s&&n>0&&(r=n);let a=[],c=t.hierarchy,d=o.get(c),u=Array.isArray(d)?d:d.positions,m=i.createElement("outerBoundaryIs");m.appendChild(gIe(e,u,r,s)),a.push(m);let p=d.holes;if(l(p)){let b=p.length;for(let f=0;f<b;++f){let y=i.createElement("innerBoundaryIs");y.appendChild(gIe(e,p[f].positions,r,s)),a.push(y)}}return a}function yIe(e,t,n,i,o){let r=e.kmlDoc,s=e.valueGetter;if(!l(t))return;let a=t instanceof ef;if(a&&s.getMaterialType(t.material)==="Image"){eYt(e,t,o);return}let c=r.createElement("Polygon"),d=s.get(t.extrudedHeight,0);d>0&&c.appendChild(En(r,"extrude",!0));let u=a?qNt(e,t,d):$Nt(e,t,d),m=u.length;for(let _=0;_<m;++_)c.appendChild(u[_]);let p=r.createElement("altitudeMode");p.appendChild(ZR(e,t.heightReference)),c.appendChild(p),n.push(c);let b=r.createElement("PolyStyle"),f=s.get(t.fill,!1);f&&b.appendChild(En(r,"fill",f)),Cre(e,t.material,b);let y=s.get(t.outline,!1);if(y){b.appendChild(En(r,"outline",y));let _=r.createElement("LineStyle"),S=s.get(t.outlineWidth,1);_.appendChild(En(r,"width",S));let Z=s.getColor(t.outlineColor,U.BLACK);_.appendChild(En(r,"color",Z)),_.appendChild(En(r,"colorMode","normal")),i.push(_)}i.push(b)}function eYt(e,t,n){let i=e.kmlDoc,o=e.valueGetter,r=e.externalFileHandler,s=i.createElement("GroundOverlay"),a=i.createElement("altitudeMode");a.appendChild(ZR(e,t.heightReference)),s.appendChild(a);let c=o.get(t.height);l(c)&&s.appendChild(En(i,"altitude",c));let d=o.get(t.coordinates),u=i.createElement("LatLonBox");u.appendChild(En(i,"north",W.toDegrees(d.north))),u.appendChild(En(i,"south",W.toDegrees(d.south))),u.appendChild(En(i,"east",W.toDegrees(d.east))),u.appendChild(En(i,"west",W.toDegrees(d.west))),s.appendChild(u);let m=o.get(t.material),p=r.texture(m.image),b=i.createElement("Icon");b.appendChild(En(i,"href",p)),s.appendChild(b);let f=m.color;l(f)&&s.appendChild(En(i,"color",SR(m.color))),n.push(s)}function CIe(e,t){let n=e.kmlDoc,i=e.valueGetter,o=e.externalFileHandler,r=n.createElement("Model"),s=i.get(t.scale);if(l(s)){let d=n.createElement("scale");d.appendChild(En(n,"x",s)),d.appendChild(En(n,"y",s)),d.appendChild(En(n,"z",s)),r.appendChild(d)}let a=n.createElement("Link"),c=o.model(t,e.time);return a.appendChild(En(n,"href",c)),r.appendChild(a),r}function tYt(e,t,n,i,o){let r=e.kmlDoc,s=e.ellipsoid,a=e.valueGetter;if(!l(n))return;let c=t.position;if(!c.isConstant){SIe(e,t,n,i,o);return}let d=CIe(e,n),u=r.createElement("altitudeMode");u.appendChild(ZR(e,n.heightReference)),d.appendChild(u),a.get(c,void 0,au),pe.fromCartesian(au,s,yd);let m=r.createElement("Location");m.appendChild(En(r,"longitude",W.toDegrees(yd.longitude))),m.appendChild(En(r,"latitude",W.toDegrees(yd.latitude))),m.appendChild(En(r,"altitude",yd.height)),d.appendChild(m),i.push(d)}function Cre(e,t,n){let i=e.kmlDoc,o=e.valueGetter;if(!l(t))return;let r=o.get(t);if(!l(r))return;let s,a=o.getMaterialType(t),c,d;switch(a){case"Image":s=SR(U.WHITE);break;case"Color":case"Grid":case"PolylineGlow":case"PolylineArrow":case"PolylineDash":s=SR(r.color);break;case"PolylineOutline":s=SR(r.color),c=SR(r.outlineColor),d=r.outlineWidth,n.appendChild(En(i,"outerColor",c,ep)),n.appendChild(En(i,"outerWidth",d,ep));break;case"Stripe":s=SR(r.oddColor);break}l(s)&&(n.appendChild(En(i,"color",s)),n.appendChild(En(i,"colorMode","normal")))}function ZR(e,t){let n=e.kmlDoc,o=e.valueGetter.get(t,He.NONE),r;switch(o){case He.NONE:r=n.createTextNode("absolute");break;case He.CLAMP_TO_GROUND:r=n.createTextNode("clampToGround");break;case He.RELATIVE_TO_GROUND:r=n.createTextNode("relativeToGround");break}return r}function _R(e,t){Array.isArray(e)||(e=[e]);let n=e.length,i=[];for(let o=0;o<n;++o)pe.fromCartesian(e[o],t,yd),i.push(`${W.toDegrees(yd.longitude)},${W.toDegrees(yd.latitude)},${yd.height}`);return i.join(" ")}function En(e,t,n,i){n=n??"",typeof n=="boolean"&&(n=n?"1":"0");let o=l(i)?e.createElementNS(i,t):e.createElement(t),r=n==="string"&&n.indexOf("<")!==-1?e.createCDATASection(n):e.createTextNode(n);return o.appendChild(r),o}function SR(e){let t="",n=e.toBytes();for(let i=3;i>=0;--i)t+=n[i]<16?`0${n[i].toString(16)}`:n[i].toString(16);return t}var Vre=Rre;var cCo=x(T(),1);var NRo=x(T(),1);function iU(){this._cache={}}iU.prototype.fromColor=function(e,t){return AK(void 0,void 0,e,t,this._cache)};iU.prototype.fromUrl=function(e,t,n){return AK(e,void 0,t,n,this._cache)};iU.prototype.fromMakiIconId=function(e,t,n){return AK(en(`Assets/Textures/maki/${encodeURIComponent(e)}.png`),void 0,t,n,this._cache)};iU.prototype.fromText=function(e,t,n){return AK(void 0,e,t,n,this._cache)};var nYt=new U;function iYt(e,t,n){e.save(),e.scale(n/24,n/24),e.fillStyle=t.toCssColorString(),e.strokeStyle=t.brighten(.6,nYt).toCssColorString(),e.lineWidth=.846,e.beginPath(),e.moveTo(6.72,.422),e.lineTo(17.28,.422),e.bezierCurveTo(18.553,.422,19.577,1.758,19.577,3.415),e.lineTo(19.577,10.973),e.bezierCurveTo(19.577,12.63,18.553,13.966,17.282,13.966),e.lineTo(14.386,14.008),e.lineTo(11.826,23.578),e.lineTo(9.614,14.008),e.lineTo(6.719,13.965),e.bezierCurveTo(5.446,13.983,4.422,12.629,4.422,10.972),e.lineTo(4.422,3.416),e.bezierCurveTo(4.423,1.76,5.447,.423,6.718,.423),e.closePath(),e.fill(),e.stroke(),e.restore()}function VIe(e,t,n){let i=n/2.5,o=i,r=i;t.width>t.height?r=i*(t.height/t.width):t.width<t.height&&(o=i*(t.width/t.height));let s=Math.round((n-o)/2),a=Math.round(7/24*n-r/2);e.globalCompositeOperation="destination-out",e.drawImage(t,s-1,a,o,r),e.drawImage(t,s,a-1,o,r),e.drawImage(t,s+1,a,o,r),e.drawImage(t,s,a+1,o,r),e.globalCompositeOperation="destination-over",e.fillStyle=U.BLACK.toCssColorString(),e.fillRect(s-1,a-1,o+2,r+2),e.globalCompositeOperation="destination-out",e.drawImage(t,s,a,o,r),e.globalCompositeOperation="destination-over",e.fillStyle=U.WHITE.toCssColorString(),e.fillRect(s-1,a-2,o+2,r+2)}var nU=new Array(4);function AK(e,t,n,i,o){nU[0]=e,nU[1]=t,nU[2]=n,nU[3]=i;let r=JSON.stringify(nU),s=o[r];if(l(s))return s;let a=document.createElement("canvas");a.width=i,a.height=i;let c=a.getContext("2d");if(iYt(c,n,i),l(e)){let u=ve.createIfNeeded(e).fetchImage().then(function(m){return VIe(c,m,i),o[r]=a,a});return o[r]=u,u}else if(l(t)){let d=F_(t,{font:`bold ${i}px sans-serif`});VIe(c,d,i)}return o[r]=a,a}var sy=iU;var E1o=x(T());var BRo=x(T());var URo=x(T());var MRo=x(T());function Ere(e){return e}function GK(e){if(e==null)return Ere;var t,n,i=e.scale[0],o=e.scale[1],r=e.translate[0],s=e.translate[1];return function(a,c){c||(t=n=0);var d=2,u=a.length,m=new Array(u);for(m[0]=(t+=a[0])*i+r,m[1]=(n+=a[1])*o+s;d<u;)m[d]=a[d],++d;return m}}var QRo=x(T());var HRo=x(T());function EIe(e,t){for(var n,i=e.length,o=i-t;o<--i;)n=e[o],e[o++]=e[i],e[i]=n}function Are(e,t){return typeof t=="string"&&(t=e.objects[t]),t.type==="GeometryCollection"?{type:"FeatureCollection",features:t.geometries.map(function(n){return AIe(e,n)})}:AIe(e,t)}function AIe(e,t){var n=t.id,i=t.bbox,o=t.properties==null?{}:t.properties,r=Gre(e,t);return n==null&&i==null?{type:"Feature",properties:o,geometry:r}:i==null?{type:"Feature",id:n,properties:o,geometry:r}:{type:"Feature",id:n,bbox:i,properties:o,geometry:r}}function Gre(e,t){var n=GK(e.transform),i=e.arcs;function o(u,m){m.length&&m.pop();for(var p=i[u<0?~u:u],b=0,f=p.length;b<f;++b)m.push(n(p[b],b));u<0&&EIe(m,f)}function r(u){return n(u)}function s(u){for(var m=[],p=0,b=u.length;p<b;++p)o(u[p],m);return m.length<2&&m.push(m[0]),m}function a(u){for(var m=s(u);m.length<4;)m.push(m[0]);return m}function c(u){return u.map(a)}function d(u){var m=u.type,p;switch(m){case"GeometryCollection":return{type:m,geometries:u.geometries.map(d)};case"Point":p=r(u.coordinates);break;case"MultiPoint":p=u.coordinates.map(r);break;case"LineString":p=s(u.arcs);break;case"MultiLineString":p=u.arcs.map(s);break;case"Polygon":p=c(u.arcs);break;case"MultiPolygon":p=u.arcs.map(c);break;default:return null}return{type:m,coordinates:p}}return d(t)}var i1o=x(T());var $Ro=x(T());var a1o=x(T());var h1o=x(T());var l1o=x(T());var T1o=x(T());var b1o=x(T());function LK(e){return h.fromDegrees(e[0],e[1],e[2])}var Lre={"urn:ogc:def:crs:OGC:1.3:CRS84":LK,"EPSG:4326":LK,"urn:ogc:def:crs:EPSG::4326":LK},GIe={},LIe={},Wre=48,vre,Fre=U.ROYALBLUE,Ire=U.YELLOW,Pre=2,Xre=U.fromBytes(255,255,0,100),Nre=!1,cYt={small:24,medium:48,large:64},lYt=["title","description","marker-size","marker-symbol","marker-color","stroke","stroke-opacity","stroke-width","fill","fill-opacity"];function WIe(e,t){let n="";for(let i in e)if(e.hasOwnProperty(i)){if(i===t||lYt.indexOf(i)!==-1)continue;let o=e[i];l(o)&&(typeof o=="object"?n+=`<tr><th>${i}</th><td>${WIe(o)}</td></tr>`:n+=`<tr><th>${i}</th><td>${o}</td></tr>`)}return n.length>0&&(n=`<table class="cesium-infoBox-defaultTable"><tbody>${n}</tbody></table>`),n}function dYt(e,t,n){let i;return function(o,r){return l(i)||(i=e(t,n)),i}}function uYt(e,t){return new nf(dYt(WIe,e,t),!0)}function WK(e,t,n){let i=e.id;if(!l(i)||e.type!=="Feature")i=Qn();else{let s=2,a=i;for(;l(t.getById(a));)a=`${i}_${s}`,s++;i=a}let o=t.getOrCreateEntity(i),r=e.properties;if(l(r)){o.properties=r;let s,a=r.title;if(l(a))o.name=a,s="title";else{let d=Number.MAX_VALUE;for(let u in r)if(r.hasOwnProperty(u)&&r[u]){let m=u.toLowerCase();if(d>1&&m==="title"){s=u;break}else d>2&&m==="name"?(d=2,s=u):d>3&&/title/i.test(u)?(d=3,s=u):d>4&&/name/i.test(u)&&(d=4,s=u)}l(s)&&(o.name=r[s])}let c=r.description;c!==null&&(o.description=l(c)?new mi(c):n(r,s))}return o}function Yre(e,t){let n=new Array(e.length);for(let i=0;i<e.length;i++)n[i]=t(e[i]);return n}var vIe={Feature:IIe,FeatureCollection:mYt,GeometryCollection:PIe,LineString:wIe,MultiLineString:kIe,MultiPoint:YIe,MultiPolygon:OIe,Point:NIe,Polygon:DIe,Topology:BIe},FIe={GeometryCollection:PIe,LineString:wIe,MultiLineString:kIe,MultiPoint:YIe,MultiPolygon:OIe,Point:NIe,Polygon:DIe,Topology:BIe};function IIe(e,t,n,i,o){if(t.geometry===null){WK(t,e._entityCollection,o.describe);return}if(!l(t.geometry))throw new ae("feature.geometry is required.");let r=t.geometry.type,s=FIe[r];if(!l(s))throw new ae(`Unknown geometry type: ${r}`);s(e,t,t.geometry,i,o)}function mYt(e,t,n,i,o){let r=t.features;for(let s=0,a=r.length;s<a;s++)IIe(e,r[s],void 0,i,o)}function PIe(e,t,n,i,o){let r=n.geometries;for(let s=0,a=r.length;s<a;s++){let c=r[s],d=c.type,u=FIe[d];if(!l(u))throw new ae(`Unknown geometry type: ${d}`);u(e,t,c,i,o)}}function XIe(e,t,n,i,o){let r=o.markerSymbol,s=o.markerColor,a=o.markerSize,c=t.properties;if(l(c)){let b=c["marker-color"];l(b)&&(s=U.fromCssColorString(b)),a=cYt[c["marker-size"]]??a;let f=c["marker-symbol"];l(f)&&(r=f)}let d;l(r)?r.length===1?d=e._pinBuilder.fromText(r.toUpperCase(),s,a):d=e._pinBuilder.fromMakiIconId(r,s,a):d=e._pinBuilder.fromColor(s,a);let u=new el;u.verticalOrigin=new mi(zn.BOTTOM),i.length===2&&o.clampToGround&&(u.heightReference=He.CLAMP_TO_GROUND);let m=WK(t,e._entityCollection,o.describe);m.billboard=u,m.position=new zl(n(i));let p=Promise.resolve(d).then(function(b){u.image=new mi(b)}).catch(function(){u.image=new mi(e._pinBuilder.fromColor(s,a))});e._promises.push(p)}function NIe(e,t,n,i,o){XIe(e,t,i,n.coordinates,o)}function YIe(e,t,n,i,o){let r=n.coordinates;for(let s=0;s<r.length;s++)XIe(e,t,i,r[s],o)}function MIe(e,t,n,i,o){let r=o.strokeMaterialProperty,s=o.strokeWidthProperty,a=t.properties;if(l(a)){let u=a["stroke-width"];l(u)&&(s=new mi(u));let m,p=a.stroke;l(p)&&(m=U.fromCssColorString(p));let b=a["stroke-opacity"];l(b)&&b!==1&&(l(m)||(m=r.color.getValue().clone()),m.alpha=b),l(m)&&(r=new Qt(m))}let c=WK(t,e._entityCollection,o.describe),d=new tl;c.polyline=d,d.clampToGround=o.clampToGround,d.material=r,d.width=s,d.positions=new mi(Yre(i,n)),d.arcType=un.RHUMB}function wIe(e,t,n,i,o){MIe(e,t,i,n.coordinates,o)}function kIe(e,t,n,i,o){let r=n.coordinates;for(let s=0;s<r.length;s++)MIe(e,t,i,r[s],o)}function UIe(e,t,n,i,o){if(i.length===0||i[0].length===0)return;let r=o.strokeMaterialProperty.color,s=o.fillMaterialProperty,a=o.strokeWidthProperty,c=t.properties;if(l(c)){let b=c["stroke-width"];l(b)&&(a=new mi(b));let f,y=c.stroke;l(y)&&(f=U.fromCssColorString(y));let _=c["stroke-opacity"];l(_)&&_!==1&&(l(f)||(f=r.getValue().clone()),f.alpha=_),l(f)&&(r=new mi(f));let S,Z=c.fill,R=s.color.getValue();l(Z)&&(S=U.fromCssColorString(Z),S.alpha=R.alpha),_=c["fill-opacity"],l(_)&&_!==R.alpha&&(l(S)||(S=R.clone()),S.alpha=_),l(S)&&(s=new Qt(S))}let d=new $h;d.outline=new mi(!0),d.outlineColor=r,d.outlineWidth=a,d.material=s,d.arcType=un.RHUMB;let u=[];for(let b=1,f=i.length;b<f;b++)u.push(new Wc(Yre(i[b],n)));let m=i[0];d.hierarchy=new mi(new Wc(Yre(m,n),u)),m[0].length>2?d.perPositionHeight=new mi(!0):o.clampToGround||(d.height=0);let p=WK(t,e._entityCollection,o.describe);p.polygon=d}function DIe(e,t,n,i,o){UIe(e,t,i,n.coordinates,o)}function OIe(e,t,n,i,o){let r=n.coordinates;for(let s=0;s<r.length;s++)UIe(e,t,i,r[s],o)}function BIe(e,t,n,i,o){for(let r in n.objects)if(n.objects.hasOwnProperty(r)){let s=Are(n,n.objects[r]),a=vIe[s.type];a(e,s,s,i,o)}}function VT(e){this._name=e,this._changed=new Se,this._error=new Se,this._isLoading=!1,this._loading=new Se,this._entityCollection=new Ya(this),this._promises=[],this._pinBuilder=new sy,this._entityCluster=new Eu,this._credit=void 0,this._resourceCredits=[]}VT.load=function(e,t){return new VT().load(e,t)};Object.defineProperties(VT,{markerSize:{get:function(){return Wre},set:function(e){Wre=e}},markerSymbol:{get:function(){return vre},set:function(e){vre=e}},markerColor:{get:function(){return Fre},set:function(e){Fre=e}},stroke:{get:function(){return Ire},set:function(e){Ire=e}},strokeWidth:{get:function(){return Pre},set:function(e){Pre=e}},fill:{get:function(){return Xre},set:function(e){Xre=e}},clampToGround:{get:function(){return Nre},set:function(e){Nre=e}},crsNames:{get:function(){return Lre}},crsLinkHrefs:{get:function(){return GIe}},crsLinkTypes:{get:function(){return LIe}}});Object.defineProperties(VT.prototype,{name:{get:function(){return this._name},set:function(e){this._name!==e&&(this._name=e,this._changed.raiseEvent(this))}},clock:{value:void 0,writable:!1},entities:{get:function(){return this._entityCollection}},isLoading:{get:function(){return this._isLoading}},changedEvent:{get:function(){return this._changed}},errorEvent:{get:function(){return this._error}},loadingEvent:{get:function(){return this._loading}},show:{get:function(){return this._entityCollection.show},set:function(e){this._entityCollection.show=e}},clustering:{get:function(){return this._entityCluster},set:function(e){this._entityCluster=e}},credit:{get:function(){return this._credit}}});VT.prototype.load=function(e,t){return zIe(this,e,t,!0)};VT.prototype.process=function(e,t){return zIe(this,e,t,!1)};function zIe(e,t,n,i){ys.setLoading(e,!0),n=n??B.EMPTY_OBJECT;let o=n.credit;typeof o=="string"&&(o=new Lt(o)),e._credit=o;let r=t,s=n.sourceUri;if(typeof t=="string"||t instanceof ve){t=ve.createIfNeeded(t),r=t.fetchJson(),s=s??t.getUrlComponent();let a=e._resourceCredits,c=t.credits;if(l(c)){let d=c.length;for(let u=0;u<d;u++)a.push(c[u])}}return n={describe:n.describe??uYt,markerSize:n.markerSize??Wre,markerSymbol:n.markerSymbol??vre,markerColor:n.markerColor??Fre,strokeWidthProperty:new mi(n.strokeWidth??Pre),strokeMaterialProperty:new Qt(n.stroke??Ire),fillMaterialProperty:new Qt(n.fill??Xre),clampToGround:n.clampToGround??Nre},Promise.resolve(r).then(function(a){return hYt(e,a,n,s,i)}).catch(function(a){throw ys.setLoading(e,!1),e._error.raiseEvent(e,a),a})}VT.prototype.update=function(e){return!0};function hYt(e,t,n,i,o){let r;l(i)&&(r=zg(i)),l(r)&&e._name!==r&&(e._name=r,e._changed.raiseEvent(e));let s=vIe[t.type];if(!l(s))throw new ae(`Unsupported GeoJSON object type: ${t.type}`);let a=t.crs,c=a!==null?LK:null;if(l(a)){if(!l(a.properties))throw new ae("crs.properties is undefined.");let d=a.properties;if(a.type==="name"){if(c=Lre[d.name],!l(c))throw new ae(`Unknown crs name: ${d.name}`)}else if(a.type==="link"){let u=GIe[d.href];if(l(u)||(u=LIe[d.type]),!l(u))throw new ae(`Unable to resolve crs link: ${JSON.stringify(d)}`);c=u(d)}else if(a.type==="EPSG"){if(c=Lre[`EPSG:${d.code}`],!l(c))throw new ae(`Unknown crs EPSG code: ${d.code}`)}else throw new ae(`Unknown crs type: ${a.type}`)}return Promise.resolve(c).then(function(d){return o&&e._entityCollection.removeAll(),d!==null&&s(e,t,t,d,n),Promise.all(e._promises).then(function(){return e._promises.length=0,ys.setLoading(e,!1),e})})}var ET=VT;var $Eo=x(T(),1);var hEo=x(T());var QVo=x(T());var dCo=x(T(),1),Mre=function(e,t){return Mre=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(n[o]=i[o])},Mre(e,t)};function Y0(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");Mre(e,t);function n(){this.constructor=e}e.prototype=t===null?Object.create(t):(n.prototype=t.prototype,new n)}var sa=function(){return sa=Object.assign||function(t){for(var n,i=1,o=arguments.length;i<o;i++){n=arguments[i];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t},sa.apply(this,arguments)};function HIe(e,t){var n=typeof Symbol=="function"&&e[Symbol.iterator];if(!n)return e;var i=n.call(e),o,r=[],s;try{for(;(t===void 0||t-- >0)&&!(o=i.next()).done;)r.push(o.value)}catch(a){s={error:a}}finally{try{o&&!o.done&&(n=i.return)&&n.call(i)}finally{if(s)throw s.error}}return r}function KIe(e,t,n){if(n||arguments.length===2)for(var i=0,o=t.length,r;i<o;i++)(r||!(i in t))&&(r||(r=Array.prototype.slice.call(t,0,i)),r[i]=t[i]);return e.concat(r||Array.prototype.slice.call(t))}var mCo=x(T()),JIe="4.1.5";var fCo=x(T()),jIe=Object.prototype.hasOwnProperty;function cm(e){return typeof e=="boolean"}function QIe(e,t,n){var i;return e.length>t&&(n==null?(n="…",i=3):i=n.length,e=e.substring(0,t-i)+n),e}function AT(e,t){for(var n=e.length-1;n>=0;n--)t(e[n])===!0&&e.splice(n,1)}function tp(e){throw new Error("Unhandled case for value: '".concat(e,"'"))}var LCo=x(T());var gCo=x(T());var vK=/\s+/,FK=(function(){function e(t){t===void 0&&(t={}),this.tagName="",this.attrs={},this.innerHTML="",this.tagName=t.tagName||"",this.attrs=t.attrs||{},this.innerHTML=t.innerHtml||t.innerHTML||""}return e.prototype.setTagName=function(t){return this.tagName=t,this},e.prototype.getTagName=function(){return this.tagName},e.prototype.setAttr=function(t,n){var i=this.getAttrs();return i[t]=n,this},e.prototype.getAttr=function(t){return this.getAttrs()[t]},e.prototype.setAttrs=function(t){return Object.assign(this.getAttrs(),t),this},e.prototype.getAttrs=function(){return this.attrs},e.prototype.setClass=function(t){return this.setAttr("class",t)},e.prototype.addClass=function(t){for(var n=this.getClass(),i=n?n.split(vK):[],o=t.split(vK),r;r=o.shift();)i.indexOf(r)===-1&&i.push(r);return this.getAttrs().class=i.join(" "),this},e.prototype.removeClass=function(t){for(var n=this.getClass(),i=n?n.split(vK):[],o=t.split(vK),r;i.length&&(r=o.shift());){var s=i.indexOf(r);s!==-1&&i.splice(s,1)}return this.getAttrs().class=i.join(" "),this},e.prototype.getClass=function(){return this.getAttrs().class||""},e.prototype.hasClass=function(t){return(" "+this.getClass()+" ").indexOf(" "+t+" ")!==-1},e.prototype.setInnerHTML=function(t){return this.innerHTML=t,this},e.prototype.setInnerHtml=function(t){return this.setInnerHTML(t)},e.prototype.getInnerHTML=function(){return this.innerHTML||""},e.prototype.getInnerHtml=function(){return this.getInnerHTML()},e.prototype.toAnchorString=function(){var t=this.getTagName(),n=this.buildAttrsStr();return n=n?" "+n:"",["<",t,n,">",this.getInnerHtml(),"</",t,">"].join("")},e.prototype.buildAttrsStr=function(){var t=this.getAttrs(),n=[];for(var i in t)jIe.call(t,i)&&n.push(i+'="'+t[i]+'"');return n.join(" ")},e})();var xCo=x(T());function $Ie(e,t,n){var i,o;if(n==null?(n="…",o=3,i=8):(o=n.length,i=n.length),e.length<=t)return e;var r=t-o,s=fYt(e);if(s.query){var a=s.query.match(/^(.*?)(?=(\?|#))(.*?)$/i);a&&(s.query=s.query.substr(0,a[1].length),e=qIe(s))}if(e.length<=t||(s.host&&(s.host=s.host.replace(/^www\./,""),e=qIe(s)),e.length<=t))return e;var c="";if(s.host&&(c+=s.host),c.length>=r)return s.host.length===t?(s.host.substr(0,t-o)+n).substr(0,r+i):wre(c,r,n).substr(0,r+i);var d="";if(s.path&&(d+="/"+s.path),s.query&&(d+="?"+s.query),d)if((c+d).length>=r){if((c+d).length==t)return(c+d).substr(0,t);var u=r-c.length;return(c+wre(d,u,n)).substr(0,r+i)}else c+=d;if(s.fragment){var m="#"+s.fragment;if((c+m).length>=r){if((c+m).length==t)return(c+m).substr(0,t);var p=r-c.length;return(c+wre(m,p,n)).substr(0,r+i)}else c+=m}if(s.scheme&&s.host){var b=s.scheme+"://";if((c+b).length<r)return(b+c).substr(0,t)}if(c.length<=t)return c;var f="";return r>0&&(f=c.substr(-1*Math.floor(r/2))),(c.substr(0,Math.ceil(r/2))+n+f).substr(0,r+i)}function fYt(e){var t={},n=e,i=n.match(/^([a-z]+):\/\//i);return i&&(t.scheme=i[1],n=n.slice(i[0].length)),i=n.match(/^(.*?)(?=(\?|#|\/|$))/i),i&&(t.host=i[1],n=n.slice(i[0].length)),i=n.match(/^\/(.*?)(?=(\?|#|$))/i),i&&(t.path=i[1],n=n.slice(i[0].length)),i=n.match(/^\?(.*?)(?=(#|$))/i),i&&(t.query=i[1],n=n.slice(i[0].length)),i=n.match(/^#(.*?)$/i),i&&(t.fragment=i[1]),t}function qIe(e){var t="";return e.scheme&&e.host&&(t+=e.scheme+"://"),e.host&&(t+=e.host),e.path&&(t+="/"+e.path),e.query&&(t+="?"+e.query),e.fragment&&(t+="#"+e.fragment),t}function wre(e,t,n){var i=t/2,o=Math.ceil(i),r=-1*Math.floor(i),s="";return r<0&&(s=e.substr(r)),e.substr(0,o)+n+s}var _Co=x(T());function ePe(e,t,n){if(e.length<=t)return e;var i,o;n==null?(n="…",i=8,o=3):(i=n.length,o=n.length);var r=t-o,s="";return r>0&&(s=e.substr(-1*Math.floor(r/2))),(e.substr(0,Math.ceil(r/2))+n+s).substr(0,r+i)}var RCo=x(T());function tPe(e,t,n){return QIe(e,t,n)}var nPe=(function(){function e(t){t===void 0&&(t={}),this.newWindow=!1,this.truncate={},this.className="",this.newWindow=t.newWindow||!1,this.truncate=t.truncate||{},this.className=t.className||""}return e.prototype.build=function(t){return new FK({tagName:"a",attrs:this.createAttrs(t),innerHtml:this.processAnchorText(t.getAnchorText())})},e.prototype.createAttrs=function(t){var n={href:t.getAnchorHref()},i=this.createCssClass(t);return i&&(n.class=i),this.newWindow&&(n.target="_blank",n.rel="noopener noreferrer"),this.truncate.length&&this.truncate.length<t.getAnchorText().length&&(n.title=t.getAnchorHref()),n},e.prototype.createCssClass=function(t){var n=this.className;if(n){for(var i=[n],o=t.getCssClassSuffixes(),r=0,s=o.length;r<s;r++)i.push(n+"-"+o[r]);return i.join(" ")}else return""},e.prototype.processAnchorText=function(t){return t=this.doTruncate(t),t},e.prototype.doTruncate=function(t){var n=this.truncate;if(!n.length)return t;var i=n.length,o=n.location;return o==="smart"?$Ie(t,i):o==="middle"?ePe(t,i):tPe(t,i)},e})();var PVo=x(T());var BCo=x(T());var vCo=x(T()),M0=(function(){function e(t){this._=null,this.matchedText="",this.offset=0,this.tagBuilder=t.tagBuilder,this.matchedText=t.matchedText,this.offset=t.offset}return e.prototype.getMatchedText=function(){return this.matchedText},e.prototype.setOffset=function(t){this.offset=t},e.prototype.getOffset=function(){return this.offset},e.prototype.getCssClassSuffixes=function(){return[this.type]},e.prototype.buildTag=function(){return this.tagBuilder.build(this)},e})();var wCo=x(T());var ICo=x(T());function iPe(e){return e>=0&&e<=31||e==127}function ay(e){return e>=65&&e<=90||e>=97&&e<=122}function aa(e){return e>=48&&e<=57}function IK(e){return e==34||e==39}function GT(e){return e<8232?e<160?e>=9&&e<=13||e==32:e<5760?e==160:e==5760||e>=8192&&e<=8202:e<8287?e>=8232&&e<=8233||e==8239:e<12288?e==8287:e==12288||e==65279}function np(e){return e<4800?e<2949?e<2451?e<1425?e<768?e<192?e<169?e<65?e>=48&&e<=57:e>=65&&e<=90||e>=97&&e<=122:e<181?e>=169&&e<=170||e==174:e==181||e==186:e<710?e<216?e>=192&&e<=214:e>=216&&e<=246||e>=248&&e<=705:e<748?e>=710&&e<=721||e>=736&&e<=740:e==748||e==750:e<910?e<895?e<886?e>=768&&e<=884:e>=886&&e<=887||e>=890&&e<=893:e<904?e==895||e==902:e>=904&&e<=906||e==908:e<1155?e<931?e>=910&&e<=929:e>=931&&e<=1013||e>=1015&&e<=1153:e<1369?e>=1155&&e<=1327||e>=1329&&e<=1366:e==1369||e>=1377&&e<=1415:e<1808?e<1552?e<1476?e<1471?e>=1425&&e<=1469:e==1471||e>=1473&&e<=1474:e<1488?e>=1476&&e<=1477||e==1479:e>=1488&&e<=1514||e>=1520&&e<=1522:e<1749?e<1568?e>=1552&&e<=1562:e>=1568&&e<=1641||e>=1646&&e<=1747:e<1770?e>=1749&&e<=1756||e>=1759&&e<=1768:e>=1770&&e<=1788||e==1791:e<2230?e<2042?e<1869?e>=1808&&e<=1866:e>=1869&&e<=1969||e>=1984&&e<=2037:e<2112?e==2042||e>=2048&&e<=2093:e>=2112&&e<=2139||e>=2208&&e<=2228:e<2406?e<2260?e>=2230&&e<=2237:e>=2260&&e<=2273||e>=2275&&e<=2403:e<2437?e>=2406&&e<=2415||e>=2417&&e<=2435:e>=2437&&e<=2444||e>=2447&&e<=2448:e<2693?e<2579?e<2519?e<2486?e<2474?e>=2451&&e<=2472:e>=2474&&e<=2480||e==2482:e<2503?e>=2486&&e<=2489||e>=2492&&e<=2500:e>=2503&&e<=2504||e>=2507&&e<=2510:e<2534?e<2524?e==2519:e>=2524&&e<=2525||e>=2527&&e<=2531:e<2565?e>=2534&&e<=2545||e>=2561&&e<=2563:e>=2565&&e<=2570||e>=2575&&e<=2576:e<2631?e<2613?e<2602?e>=2579&&e<=2600:e>=2602&&e<=2608||e>=2610&&e<=2611:e<2620?e>=2613&&e<=2614||e>=2616&&e<=2617:e==2620||e>=2622&&e<=2626:e<2649?e<2635?e>=2631&&e<=2632:e>=2635&&e<=2637||e==2641:e<2662?e>=2649&&e<=2652||e==2654:e>=2662&&e<=2677||e>=2689&&e<=2691:e<2821?e<2759?e<2730?e<2703?e>=2693&&e<=2701:e>=2703&&e<=2705||e>=2707&&e<=2728:e<2741?e>=2730&&e<=2736||e>=2738&&e<=2739:e>=2741&&e<=2745||e>=2748&&e<=2757:e<2784?e<2763?e>=2759&&e<=2761:e>=2763&&e<=2765||e==2768:e<2809?e>=2784&&e<=2787||e>=2790&&e<=2799:e==2809||e>=2817&&e<=2819:e<2887?e<2858?e<2831?e>=2821&&e<=2828:e>=2831&&e<=2832||e>=2835&&e<=2856:e<2869?e>=2858&&e<=2864||e>=2866&&e<=2867:e>=2869&&e<=2873||e>=2876&&e<=2884:e<2911?e<2902?e>=2887&&e<=2888||e>=2891&&e<=2893:e>=2902&&e<=2903||e>=2908&&e<=2909:e<2929?e>=2911&&e<=2915||e>=2918&&e<=2927:e==2929||e>=2946&&e<=2947:e<3517?e<3205?e<3046?e<2984?e<2969?e<2958?e>=2949&&e<=2954:e>=2958&&e<=2960||e>=2962&&e<=2965:e<2974?e>=2969&&e<=2970||e==2972:e>=2974&&e<=2975||e>=2979&&e<=2980:e<3014?e<2990?e>=2984&&e<=2986:e>=2990&&e<=3001||e>=3006&&e<=3010:e<3024?e>=3014&&e<=3016||e>=3018&&e<=3021:e==3024||e==3031:e<3142?e<3086?e<3072?e>=3046&&e<=3055:e>=3072&&e<=3075||e>=3077&&e<=3084:e<3114?e>=3086&&e<=3088||e>=3090&&e<=3112:e>=3114&&e<=3129||e>=3133&&e<=3140:e<3160?e<3146?e>=3142&&e<=3144:e>=3146&&e<=3149||e>=3157&&e<=3158:e<3174?e>=3160&&e<=3162||e>=3168&&e<=3171:e>=3174&&e<=3183||e>=3200&&e<=3203:e<3333?e<3274?e<3242?e<3214?e>=3205&&e<=3212:e>=3214&&e<=3216||e>=3218&&e<=3240:e<3260?e>=3242&&e<=3251||e>=3253&&e<=3257:e>=3260&&e<=3268||e>=3270&&e<=3272:e<3296?e<3285?e>=3274&&e<=3277:e>=3285&&e<=3286||e==3294:e<3313?e>=3296&&e<=3299||e>=3302&&e<=3311:e>=3313&&e<=3314||e>=3329&&e<=3331:e<3423?e<3389?e<3342?e>=3333&&e<=3340:e>=3342&&e<=3344||e>=3346&&e<=3386:e<3402?e>=3389&&e<=3396||e>=3398&&e<=3400:e>=3402&&e<=3406||e>=3412&&e<=3415:e<3458?e<3430?e>=3423&&e<=3427:e>=3430&&e<=3439||e>=3450&&e<=3455:e<3482?e>=3458&&e<=3459||e>=3461&&e<=3478:e>=3482&&e<=3505||e>=3507&&e<=3515:e<3804?e<3722?e<3570?e<3535?e<3520?e==3517:e>=3520&&e<=3526||e==3530:e<3544?e>=3535&&e<=3540||e==3542:e>=3544&&e<=3551||e>=3558&&e<=3567:e<3664?e<3585?e>=3570&&e<=3571:e>=3585&&e<=3642||e>=3648&&e<=3662:e<3716?e>=3664&&e<=3673||e>=3713&&e<=3714:e==3716||e>=3719&&e<=3720:e<3754?e<3737?e<3725?e==3722:e==3725||e>=3732&&e<=3735:e<3749?e>=3737&&e<=3743||e>=3745&&e<=3747:e==3749||e==3751:e<3776?e<3757?e>=3754&&e<=3755:e>=3757&&e<=3769||e>=3771&&e<=3773:e<3784?e>=3776&&e<=3780||e==3782:e>=3784&&e<=3789||e>=3792&&e<=3801:e<4176?e<3902?e<3872?e<3840?e>=3804&&e<=3807:e==3840||e>=3864&&e<=3865:e<3895?e>=3872&&e<=3881||e==3893:e==3895||e==3897:e<3974?e<3913?e>=3902&&e<=3911:e>=3913&&e<=3948||e>=3953&&e<=3972:e<4038?e>=3974&&e<=3991||e>=3993&&e<=4028:e==4038||e>=4096&&e<=4169:e<4688?e<4301?e<4256?e>=4176&&e<=4253:e>=4256&&e<=4293||e==4295:e<4348?e==4301||e>=4304&&e<=4346:e>=4348&&e<=4680||e>=4682&&e<=4685:e<4746?e<4698?e>=4688&&e<=4694||e==4696:e>=4698&&e<=4701||e>=4704&&e<=4744:e<4786?e>=4746&&e<=4749||e>=4752&&e<=4784:e>=4786&&e<=4789||e>=4792&&e<=4798:e<11035?e<7416?e<6176?e<5873?e<4992?e<4824?e<4802?e==4800:e>=4802&&e<=4805||e>=4808&&e<=4822:e<4888?e>=4824&&e<=4880||e>=4882&&e<=4885:e>=4888&&e<=4954||e>=4957&&e<=4959:e<5121?e<5024?e>=4992&&e<=5007:e>=5024&&e<=5109||e>=5112&&e<=5117:e<5761?e>=5121&&e<=5740||e>=5743&&e<=5759:e>=5761&&e<=5786||e>=5792&&e<=5866:e<6002?e<5920?e<5888?e>=5873&&e<=5880:e>=5888&&e<=5900||e>=5902&&e<=5908:e<5984?e>=5920&&e<=5940||e>=5952&&e<=5971:e>=5984&&e<=5996||e>=5998&&e<=6e3:e<6108?e<6016?e>=6002&&e<=6003:e>=6016&&e<=6099||e==6103:e<6155?e>=6108&&e<=6109||e>=6112&&e<=6121:e>=6155&&e<=6157||e>=6160&&e<=6169:e<6783?e<6512?e<6400?e<6272?e>=6176&&e<=6263:e>=6272&&e<=6314||e>=6320&&e<=6389:e<6448?e>=6400&&e<=6430||e>=6432&&e<=6443:e>=6448&&e<=6459||e>=6470&&e<=6509:e<6608?e<6528?e>=6512&&e<=6516:e>=6528&&e<=6571||e>=6576&&e<=6601:e<6688?e>=6608&&e<=6617||e>=6656&&e<=6683:e>=6688&&e<=6750||e>=6752&&e<=6780:e<7040?e<6832?e<6800?e>=6783&&e<=6793:e>=6800&&e<=6809||e==6823:e<6992?e>=6832&&e<=6846||e>=6912&&e<=6987:e>=6992&&e<=7001||e>=7019&&e<=7027:e<7245?e<7168?e>=7040&&e<=7155:e>=7168&&e<=7223||e>=7232&&e<=7241:e<7376?e>=7245&&e<=7293||e>=7296&&e<=7304:e>=7376&&e<=7378||e>=7380&&e<=7414:e<8450?e<8130?e<8025?e<7960?e<7424?e>=7416&&e<=7417:e>=7424&&e<=7669||e>=7675&&e<=7957:e<8008?e>=7960&&e<=7965||e>=7968&&e<=8005:e>=8008&&e<=8013||e>=8016&&e<=8023:e<8031?e<8027?e==8025:e==8027||e==8029:e<8118?e>=8031&&e<=8061||e>=8064&&e<=8116:e>=8118&&e<=8124||e==8126:e<8205?e<8150?e<8134?e>=8130&&e<=8132:e>=8134&&e<=8140||e>=8144&&e<=8147:e<8178?e>=8150&&e<=8155||e>=8160&&e<=8172:e>=8178&&e<=8180||e>=8182&&e<=8188:e<8305?e<8252?e==8205:e==8252||e==8265:e<8336?e==8305||e==8319:e>=8336&&e<=8348||e>=8400&&e<=8432:e<8579?e<8486?e<8469?e<8455?e==8450:e==8455||e>=8458&&e<=8467:e<8482?e==8469||e>=8473&&e<=8477:e==8482||e==8484:e<8495?e<8488?e==8486:e==8488||e>=8490&&e<=8493:e<8517?e>=8495&&e<=8505||e>=8508&&e<=8511:e>=8517&&e<=8521||e==8526:e<9410?e<9e3?e<8592?e>=8579&&e<=8580:e>=8592&&e<=8703||e>=8986&&e<=8987:e<9193?e==9e3||e==9167:e>=9193&&e<=9203||e>=9208&&e<=9210:e<9723?e<9654?e==9410||e>=9642&&e<=9643:e==9654||e==9664:e<10548?e>=9723&&e<=9726||e>=9728&&e<=10175:e>=10548&&e<=10549||e>=11013&&e<=11015:e<43259?e<12445?e<11688?e<11520?e<11264?e<11088?e>=11035&&e<=11036:e==11088||e==11093:e<11360?e>=11264&&e<=11310||e>=11312&&e<=11358:e>=11360&&e<=11492||e>=11499&&e<=11507:e<11568?e<11559?e>=11520&&e<=11557:e==11559||e==11565:e<11647?e>=11568&&e<=11623||e==11631:e>=11647&&e<=11670||e>=11680&&e<=11686:e<11744?e<11712?e<11696?e>=11688&&e<=11694:e>=11696&&e<=11702||e>=11704&&e<=11710:e<11728?e>=11712&&e<=11718||e>=11720&&e<=11726:e>=11728&&e<=11734||e>=11736&&e<=11742:e<12330?e<11823?e>=11744&&e<=11775:e==11823||e>=12293&&e<=12294:e<12353?e>=12330&&e<=12341||e>=12347&&e<=12349:e>=12353&&e<=12438||e>=12441&&e<=12442:e<42512?e<12951?e<12549?e<12449?e>=12445&&e<=12447:e>=12449&&e<=12538||e>=12540&&e<=12543:e<12704?e>=12549&&e<=12589||e>=12593&&e<=12686:e>=12704&&e<=12730||e>=12784&&e<=12799:e<19968?e<12953?e==12951:e==12953||e>=13312&&e<=19893:e<42192?e>=19968&&e<=40917||e>=40960&&e<=42124:e>=42192&&e<=42237||e>=42240&&e<=42508:e<42891?e<42623?e<42560?e>=42512&&e<=42539:e>=42560&&e<=42610||e>=42612&&e<=42621:e<42775?e>=42623&&e<=42725||e>=42736&&e<=42737:e>=42775&&e<=42783||e>=42786&&e<=42888:e<43072?e<42928?e>=42891&&e<=42926:e>=42928&&e<=42935||e>=42999&&e<=43047:e<43216?e>=43072&&e<=43123||e>=43136&&e<=43205:e>=43216&&e<=43225||e>=43232&&e<=43255:e<55243?e<43744?e<43488?e<43312?e<43261?e==43259:e==43261||e>=43264&&e<=43309:e<43392?e>=43312&&e<=43347||e>=43360&&e<=43388:e>=43392&&e<=43456||e>=43471&&e<=43481:e<43600?e<43520?e>=43488&&e<=43518:e>=43520&&e<=43574||e>=43584&&e<=43597:e<43642?e>=43600&&e<=43609||e>=43616&&e<=43638:e>=43642&&e<=43714||e>=43739&&e<=43741:e<43824?e<43785?e<43762?e>=43744&&e<=43759:e>=43762&&e<=43766||e>=43777&&e<=43782:e<43808?e>=43785&&e<=43790||e>=43793&&e<=43798:e>=43808&&e<=43814||e>=43816&&e<=43822:e<44012?e<43868?e>=43824&&e<=43866:e>=43868&&e<=43877||e>=43888&&e<=44010:e<44032?e>=44012&&e<=44013||e>=44016&&e<=44025:e>=44032&&e<=55203||e>=55216&&e<=55238:e<64848?e<64298?e<64112?e<55296?e>=55243&&e<=55291:e>=55296&&e<=57343||e>=63744&&e<=64109:e<64275?e>=64112&&e<=64217||e>=64256&&e<=64262:e>=64275&&e<=64279||e>=64285&&e<=64296:e<64320?e<64312?e>=64298&&e<=64310:e>=64312&&e<=64316||e==64318:e<64326?e>=64320&&e<=64321||e>=64323&&e<=64324:e>=64326&&e<=64433||e>=64467&&e<=64829:e<65296?e<65024?e<64914?e>=64848&&e<=64911:e>=64914&&e<=64967||e>=65008&&e<=65019:e<65136?e>=65024&&e<=65039||e>=65056&&e<=65071:e>=65136&&e<=65140||e>=65142&&e<=65276:e<65474?e<65345?e>=65296&&e<=65305||e>=65313&&e<=65338:e>=65345&&e<=65370||e>=65382&&e<=65470:e<65490?e>=65474&&e<=65479||e>=65482&&e<=65487:e>=65490&&e<=65495||e>=65498&&e<=65500}function oPe(e){return e<47?e<42?e==33||e>=35&&e<=39:e>=42&&e<=43||e==45:e<63?e==47||e==61:e<94?e==63:e>=94&&e<=96||e>=123&&e<=126}function rPe(e){return e<91?e<47?e>=35&&e<=43||e==45:e<61?e==47:e==61||e==64:e<95?e==91||e==93:e<123?e==95:e>=123&&e<=126||e==10003}function PK(e){return e<58?e<44?e==33:e==44||e==46:e<63?e>=58&&e<=59:e==63||e==94}function sPe(e){return e<91?e==40:e==91||e==123}function kre(e){return e<93?e==41:e==93||e==125}var XCo=x(T()),aPe=/^(?:xn--vermgensberatung-pwb|xn--vermgensberater-ctb|xn--clchc0ea0b2g2a9gcd|xn--w4r85el8fhu5dnra|travelersinsurance|vermögensberatung|xn--5su34j936bgsg|xn--bck1b9a5dre4c|xn--mgbah1a3hjkrd|xn--mgbai9azgqp6j|xn--mgberp4a5d4ar|xn--xkc2dl3a5ee0h|vermögensberater|xn--fzys8d69uvgm|xn--mgba7c0bbn0a|xn--mgbcpq6gpa1a|xn--xkc2al3hye2a|americanexpress|kerryproperties|sandvikcoromant|xn--i1b6b1a6a2e|xn--kcrx77d1x4a|xn--lgbbat1ad8j|xn--mgba3a4f16a|xn--mgbc0a9azcg|xn--nqv7fs00ema|americanfamily|weatherchannel|xn--54b7fta0cc|xn--6qq986b3xl|xn--80aqecdr1a|xn--b4w605ferd|xn--fiq228c5hs|xn--h2breg3eve|xn--jlq480n2rg|xn--mgba3a3ejt|xn--mgbaam7a8h|xn--mgbayh7gpa|xn--mgbbh1a71e|xn--mgbca7dzdo|xn--mgbi4ecexp|xn--mgbx4cd0ab|xn--rvc1e0am3e|international|lifeinsurance|wolterskluwer|xn--cckwcxetd|xn--eckvdtc9d|xn--fpcrj9c3d|xn--fzc2c9e2c|xn--h2brj9c8c|xn--tiq49xqyj|xn--yfro4i67o|xn--ygbi2ammx|construction|lplfinancial|scholarships|versicherung|xn--3e0b707e|xn--45br5cyl|xn--4dbrk0ce|xn--80adxhks|xn--80asehdb|xn--8y0a063a|xn--gckr3f0f|xn--mgb9awbf|xn--mgbab2bd|xn--mgbgu82a|xn--mgbpl2fh|xn--mgbt3dhd|xn--mk1bu44c|xn--ngbc5azd|xn--ngbe9e0a|xn--ogbpf8fl|xn--qcka1pmc|accountants|barclaycard|blackfriday|blockbuster|bridgestone|calvinklein|contractors|creditunion|engineering|enterprises|investments|kerryhotels|lamborghini|motorcycles|olayangroup|photography|playstation|productions|progressive|redumbrella|williamhill|xn--11b4c3d|xn--1ck2e1b|xn--1qqw23a|xn--2scrj9c|xn--3bst00m|xn--3ds443g|xn--3hcrj9c|xn--42c2d9a|xn--45brj9c|xn--55qw42g|xn--6frz82g|xn--80ao21a|xn--9krt00a|xn--cck2b3b|xn--czr694b|xn--d1acj3b|xn--efvy88h|xn--fct429k|xn--fjq720a|xn--flw351e|xn--g2xx48c|xn--gecrj9c|xn--gk3at1e|xn--h2brj9c|xn--hxt814e|xn--imr513n|xn--j6w193g|xn--jvr189m|xn--kprw13d|xn--kpry57d|xn--mgbbh1a|xn--mgbtx2b|xn--mix891f|xn--nyqy26a|xn--otu796d|xn--pgbs0dh|xn--q9jyb4c|xn--rhqv96g|xn--rovu88b|xn--s9brj9c|xn--ses554g|xn--t60b56a|xn--vuq861b|xn--w4rs40l|xn--xhq521b|xn--zfr164b|சிங்கப்பூர்|accountant|apartments|associates|basketball|bnpparibas|boehringer|capitalone|consulting|creditcard|cuisinella|eurovision|extraspace|foundation|healthcare|immobilien|industries|management|mitsubishi|nextdirect|properties|protection|prudential|realestate|republican|restaurant|schaeffler|tatamotors|technology|university|vlaanderen|xn--30rr7y|xn--3pxu8k|xn--45q11c|xn--4gbrim|xn--55qx5d|xn--5tzm5g|xn--80aswg|xn--90a3ac|xn--9dbq2a|xn--9et52u|xn--c2br7g|xn--cg4bki|xn--czrs0t|xn--czru2d|xn--fiq64b|xn--fiqs8s|xn--fiqz9s|xn--io0a7i|xn--kput3i|xn--mxtq1m|xn--o3cw4h|xn--pssy2u|xn--q7ce6a|xn--unup4y|xn--wgbh1c|xn--wgbl6a|xn--y9a3aq|accenture|allfinanz|amsterdam|analytics|aquarelle|barcelona|bloomberg|christmas|community|directory|education|equipment|fairwinds|financial|firestone|fresenius|furniture|goldpoint|hisamitsu|homedepot|homegoods|homesense|institute|insurance|kuokgroup|landrover|lifestyle|marketing|marshalls|melbourne|microsoft|panasonic|pramerica|richardli|shangrila|solutions|statebank|statefarm|stockholm|travelers|vacations|xn--90ais|xn--c1avg|xn--d1alf|xn--e1a4c|xn--fhbei|xn--j1aef|xn--j1amh|xn--l1acc|xn--ngbrx|xn--nqv7f|xn--p1acf|xn--qxa6a|xn--tckwe|xn--vhquv|yodobashi|موريتانيا|abudhabi|airforce|allstate|attorney|barclays|barefoot|bargains|baseball|boutique|bradesco|broadway|brussels|builders|business|capetown|catering|catholic|cipriani|cleaning|clinique|clothing|commbank|computer|delivery|deloitte|democrat|diamonds|discount|discover|download|engineer|ericsson|exchange|feedback|fidelity|firmdale|football|frontier|goodyear|grainger|graphics|hdfcbank|helsinki|holdings|hospital|infiniti|ipiranga|istanbul|jpmorgan|lighting|lundbeck|marriott|mckinsey|memorial|merckmsd|mortgage|observer|partners|pharmacy|pictures|plumbing|property|redstone|reliance|saarland|samsclub|security|services|shopping|softbank|software|stcgroup|supplies|training|vanguard|ventures|verisign|woodside|xn--90ae|xn--node|xn--p1ai|xn--qxam|yokohama|السعودية|abogado|academy|agakhan|alibaba|android|athleta|auction|audible|auspost|banamex|bauhaus|bestbuy|booking|brother|capital|caravan|careers|channel|charity|chintai|citadel|clubmed|college|cologne|company|compare|contact|cooking|corsica|country|coupons|courses|cricket|cruises|dentist|digital|domains|exposed|express|farmers|fashion|ferrari|ferrero|finance|fishing|fitness|flights|florist|flowers|forsale|frogans|fujitsu|gallery|genting|godaddy|grocery|guitars|hamburg|hangout|hitachi|holiday|hosting|hotmail|hyundai|ismaili|jewelry|juniper|kitchen|komatsu|lacaixa|lanxess|lasalle|latrobe|leclerc|limited|lincoln|markets|monster|netbank|netflix|network|neustar|okinawa|organic|origins|philips|pioneer|politie|realtor|recipes|rentals|reviews|rexroth|samsung|sandvik|schmidt|schwarz|science|shiksha|singles|staples|storage|support|surgery|systems|temasek|theater|theatre|tickets|toshiba|trading|walmart|wanggou|watches|weather|website|wedding|whoswho|windows|winners|yamaxun|youtube|zuerich|католик|البحرين|الجزائر|العليان|پاکستان|كاثوليك|இந்தியா|abbott|abbvie|africa|agency|airbus|airtel|alipay|alsace|alstom|amazon|anquan|aramco|author|bayern|beauty|berlin|bharti|bostik|boston|broker|camera|career|casino|center|chanel|chrome|church|circle|claims|clinic|coffee|comsec|condos|coupon|credit|cruise|dating|datsun|dealer|degree|dental|design|direct|doctor|dunlop|dupont|durban|emerck|energy|estate|events|expert|family|flickr|futbol|gallup|garden|george|giving|global|google|gratis|health|hermes|hiphop|hockey|hotels|hughes|imamat|insure|intuit|jaguar|joburg|juegos|kaufen|kindle|kosher|latino|lawyer|lefrak|living|locker|london|luxury|madrid|maison|makeup|market|mattel|mobile|monash|mormon|moscow|museum|nagoya|nissan|nissay|norton|nowruz|office|olayan|online|oracle|orange|otsuka|pfizer|photos|physio|pictet|quebec|racing|realty|reisen|repair|report|review|rogers|ryukyu|safety|sakura|sanofi|school|schule|search|secure|select|shouji|soccer|social|stream|studio|supply|suzuki|swatch|sydney|taipei|taobao|target|tattoo|tennis|tienda|tjmaxx|tkmaxx|toyota|travel|unicom|viajes|viking|villas|virgin|vision|voting|voyage|walter|webcam|xihuan|yachts|yandex|zappos|москва|онлайн|ابوظبي|ارامكو|الاردن|المغرب|امارات|فلسطين|مليسيا|भारतम्|இலங்கை|ファッション|actor|adult|aetna|amfam|amica|apple|archi|audio|autos|azure|baidu|beats|bible|bingo|black|boats|bosch|build|canon|cards|chase|cheap|cisco|citic|click|cloud|coach|codes|crown|cymru|dance|deals|delta|drive|dubai|earth|edeka|email|epson|faith|fedex|final|forex|forum|gallo|games|gifts|gives|glass|globo|gmail|green|gripe|group|gucci|guide|homes|honda|horse|house|hyatt|ikano|irish|jetzt|koeln|kyoto|lamer|lease|legal|lexus|lilly|loans|locus|lotte|lotto|mango|media|miami|money|movie|music|nexus|nikon|ninja|nokia|nowtv|omega|osaka|paris|parts|party|phone|photo|pizza|place|poker|praxi|press|prime|promo|quest|radio|rehab|reise|ricoh|rocks|rodeo|rugby|salon|sener|seven|sharp|shell|shoes|skype|sling|smart|smile|solar|space|sport|stada|store|study|style|sucks|swiss|tatar|tires|tirol|tmall|today|tokyo|tools|toray|total|tours|trade|trust|tunes|tushu|ubank|vegas|video|vodka|volvo|wales|watch|weber|weibo|works|world|xerox|yahoo|ישראל|ایران|بازار|بھارت|سودان|سورية|همراه|भारोत|संगठन|বাংলা|భారత్|ഭാരതം|嘉里大酒店|aarp|able|aero|akdn|ally|amex|arab|army|arpa|arte|asda|asia|audi|auto|baby|band|bank|bbva|beer|best|bike|bing|blog|blue|bofa|bond|book|buzz|cafe|call|camp|care|cars|casa|case|cash|cbre|cern|chat|citi|city|club|cool|coop|cyou|data|date|dclk|deal|dell|desi|diet|dish|docs|dvag|erni|fage|fail|fans|farm|fast|fido|film|fire|fish|flir|food|ford|free|fund|game|gbiz|gent|ggee|gift|gmbh|gold|golf|goog|guge|guru|hair|haus|hdfc|help|here|host|hsbc|icbc|ieee|imdb|immo|info|itau|java|jeep|jobs|jprs|kddi|kids|kiwi|kpmg|kred|land|lego|lgbt|lidl|life|like|limo|link|live|loan|love|ltda|luxe|maif|meet|meme|menu|mini|mint|mobi|moda|moto|name|navy|news|next|nico|nike|ollo|open|page|pars|pccw|pics|ping|pink|play|plus|pohl|porn|post|prod|prof|qpon|read|reit|rent|rest|rich|room|rsvp|ruhr|safe|sale|sarl|save|saxo|scot|seat|seek|sexy|shia|shop|show|silk|sina|site|skin|sncf|sohu|song|sony|spot|star|surf|talk|taxi|team|tech|teva|tiaa|tips|town|toys|tube|vana|visa|viva|vivo|vote|voto|wang|weir|wien|wiki|wine|work|xbox|yoga|zara|zero|zone|дети|сайт|بارت|بيتك|ڀارت|تونس|شبكة|عراق|عمان|موقع|भारत|ভারত|ভাৰত|ਭਾਰਤ|ભારત|ଭାରତ|ಭಾರತ|ලංකා|アマゾン|グーグル|クラウド|ポイント|组织机构|電訊盈科|香格里拉|aaa|abb|abc|aco|ads|aeg|afl|aig|anz|aol|app|art|aws|axa|bar|bbc|bbt|bcg|bcn|bet|bid|bio|biz|bms|bmw|bom|boo|bot|box|buy|bzh|cab|cal|cam|car|cat|cba|cbn|ceo|cfa|cfd|com|cpa|crs|dad|day|dds|dev|dhl|diy|dnp|dog|dot|dtv|dvr|eat|eco|edu|esq|eus|fan|fit|fly|foo|fox|frl|ftr|fun|fyi|gal|gap|gay|gdn|gea|gle|gmo|gmx|goo|gop|got|gov|hbo|hiv|hkt|hot|how|ibm|ice|icu|ifm|inc|ing|ink|int|ist|itv|jcb|jio|jll|jmp|jnj|jot|joy|kfh|kia|kim|kpn|krd|lat|law|lds|llc|llp|lol|lpl|ltd|man|map|mba|med|men|mil|mit|mlb|mls|mma|moe|moi|mom|mov|msd|mtn|mtr|nab|nba|nec|net|new|nfl|ngo|nhk|now|nra|nrw|ntt|nyc|obi|one|ong|onl|ooo|org|ott|ovh|pay|pet|phd|pid|pin|pnc|pro|pru|pub|pwc|red|ren|ril|rio|rip|run|rwe|sap|sas|sbi|sbs|scb|sew|sex|sfr|ski|sky|soy|spa|srl|stc|tab|tax|tci|tdk|tel|thd|tjx|top|trv|tui|tvs|ubs|uno|uol|ups|vet|vig|vin|vip|wed|win|wme|wow|wtc|wtf|xin|xxx|xyz|you|yun|zip|бел|ком|қаз|мкд|мон|орг|рус|срб|укр|հայ|קום|عرب|قطر|كوم|مصر|कॉम|नेट|คอม|ไทย|ລາວ|ストア|セール|みんな|中文网|亚马逊|天主教|我爱你|新加坡|淡马锡|飞利浦|ac|ad|ae|af|ag|ai|al|am|ao|aq|ar|as|at|au|aw|ax|az|ba|bb|bd|be|bf|bg|bh|bi|bj|bm|bn|bo|br|bs|bt|bv|bw|by|bz|ca|cc|cd|cf|cg|ch|ci|ck|cl|cm|cn|co|cr|cu|cv|cw|cx|cy|cz|de|dj|dk|dm|do|dz|ec|ee|eg|er|es|et|eu|fi|fj|fk|fm|fo|fr|ga|gb|gd|ge|gf|gg|gh|gi|gl|gm|gn|gp|gq|gr|gs|gt|gu|gw|gy|hk|hm|hn|hr|ht|hu|id|ie|il|im|in|io|iq|ir|is|it|je|jm|jo|jp|ke|kg|kh|ki|km|kn|kp|kr|kw|ky|kz|la|lb|lc|li|lk|lr|ls|lt|lu|lv|ly|ma|mc|md|me|mg|mh|mk|ml|mm|mn|mo|mp|mq|mr|ms|mt|mu|mv|mw|mx|my|mz|na|nc|ne|nf|ng|ni|nl|no|np|nr|nu|nz|om|pa|pe|pf|pg|ph|pk|pl|pm|pn|pr|ps|pt|pw|py|qa|re|ro|rs|ru|rw|sa|sb|sc|sd|se|sg|sh|si|sj|sk|sl|sm|sn|so|sr|ss|st|su|sv|sx|sy|sz|tc|td|tf|tg|th|tj|tk|tl|tm|tn|to|tr|tt|tv|tw|tz|ua|ug|uk|us|uy|uz|va|vc|ve|vg|vi|vn|vu|wf|ws|ye|yt|za|zm|zw|ελ|ευ|бг|ею|рф|გე|닷넷|닷컴|삼성|한국|コム|世界|中信|中国|中國|企业|佛山|信息|健康|八卦|公司|公益|台湾|台灣|商城|商店|商标|嘉里|在线|大拿|娱乐|家電|广东|微博|慈善|手机|招聘|政务|政府|新闻|时尚|書籍|机构|游戏|澳門|点看|移动|网址|网店|网站|网络|联通|谷歌|购物|通販|集团|食品|餐厅|香港)$/;var Ure=/https?:\/\//i,cPe=new RegExp("^"+Ure.source,"i"),pYt=/^(javascript|vbscript):/i,bYt=/^[A-Za-z][-.+A-Za-z0-9]*:(\/\/)?([^:/]*)/,gYt=/^(?:\/\/)?([^/#?:]+)/,bA=ay;function Dre(e){return ay(e)||aa(e)||e===43||e===45||e===46}var cy=np;function XK(e){return e===95||cy(e)}function Ore(e){return np(e)||rPe(e)||PK(e)}function NK(e){return e===47||e===63||e===35}function Bre(e){return aPe.test(e.toLowerCase())}function lPe(e){if(pYt.test(e))return!1;var t=e.match(bYt);if(!t)return!1;var n=!!t[1],i=t[2];return n?!0:!(i.indexOf(".")===-1||!/[A-Za-z]/.test(i))}function dPe(e){var t=e.match(gYt);if(!t)return!1;var n=t[0],i=n.split(".");if(i.length<2)return!1;var o=i[i.length-1];return!!Bre(o)}var yYt=/^(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$/,xYt=/[:/?#]/;function uPe(e){var t=e.split(xYt,1)[0];return yYt.test(t)}var TYt=/^(https?:\/\/)?(?:www\.)?/i,_Yt=/^\/\//,mPe=(function(e){Y0(t,e);function t(n){var i=e.call(this,n)||this;return i.type="url",i.url="",i.urlMatchType="scheme",i.protocolRelativeMatch=!1,i.stripPrefix={scheme:!0,www:!0},i.stripTrailingSlash=!0,i.decodePercentEncoding=!0,i.protocolPrepended=!1,i.urlMatchType=n.urlMatchType,i.url=n.url,i.protocolRelativeMatch=n.protocolRelativeMatch,i.stripPrefix=n.stripPrefix,i.stripTrailingSlash=n.stripTrailingSlash,i.decodePercentEncoding=n.decodePercentEncoding,i}return t.prototype.getType=function(){return"url"},t.prototype.getUrlMatchType=function(){return this.urlMatchType},t.prototype.getUrl=function(){var n=this.url;return!this.protocolRelativeMatch&&this.urlMatchType!=="scheme"&&!this.protocolPrepended&&(n=this.url="http://"+n,this.protocolPrepended=!0),n},t.prototype.getAnchorHref=function(){var n=this.getUrl();return n.replace(/&/g,"&")},t.prototype.getAnchorText=function(){var n=this.getMatchedText();return this.protocolRelativeMatch&&(n=RYt(n)),this.stripPrefix.scheme&&(n=SYt(n)),this.stripPrefix.www&&(n=ZYt(n)),this.stripTrailingSlash&&(n=CYt(n)),this.decodePercentEncoding&&(n=VYt(n)),n},t})(M0);function SYt(e){return e.replace(cPe,"")}function ZYt(e){return e.includes("www.")?e.replace(TYt,"$1"):e}function RYt(e){return e.replace(_Yt,"")}function CYt(e){return e.charAt(e.length-1)==="/"&&(e=e.slice(0,-1)),e}function VYt(e){var t=e.replace(/%(?:22|26|27|3C|3E)/gi,function(n){return n==="%22"?""":n==="%26"?"&":n==="%27"?"'":n==="%3C"||n==="%3c"?"<":">"});if(t.includes("%"))try{return decodeURIComponent(t)}catch{}return t}var JCo=x(T());var hPe=/^mailto:/i,zre=np;function YK(e){return zre(e)||oPe(e)}function fPe(e){var t=e.split(".").pop();return Bre(t)}var $Co=x(T());var pPe=(function(e){Y0(t,e);function t(n){var i=e.call(this,n)||this;return i.type="email",i.email="",i.email=n.email,i}return t.prototype.getType=function(){return"email"},t.prototype.getEmail=function(){return this.email},t.prototype.getAnchorHref=function(){return"mailto:"+this.email},t.prototype.getAnchorText=function(){return this.email},t})(M0);var nVo=x(T());function Hre(e){return e===95||np(e)}function bPe(e){return e.length<=140}var gPe=["twitter","facebook","instagram","tiktok","youtube"];var aVo=x(T());var yPe=(function(e){Y0(t,e);function t(n){var i=e.call(this,n)||this;return i.type="hashtag",i.serviceName="twitter",i.hashtag="",i.serviceName=n.serviceName,i.hashtag=n.hashtag,i}return t.prototype.getType=function(){return"hashtag"},t.prototype.getServiceName=function(){return this.serviceName},t.prototype.getHashtag=function(){return this.hashtag},t.prototype.getAnchorHref=function(){var n=this.serviceName,i=this.hashtag;switch(n){case"twitter":return"https://twitter.com/hashtag/"+i;case"facebook":return"https://www.facebook.com/hashtag/"+i;case"instagram":return"https://instagram.com/explore/tags/"+i;case"tiktok":return"https://www.tiktok.com/tag/"+i;case"youtube":return"https://youtube.com/hashtag/"+i;default:tp(n)}},t.prototype.getAnchorText=function(){return"#"+this.hashtag},t.prototype.getCssClassSuffixes=function(){var n=e.prototype.getCssClassSuffixes.call(this),i=this.getServiceName();return i&&n.push(i),n},t})(M0);var dVo=x(T());var EYt={twitter:/^@\w{1,15}$/,instagram:/^@[_\w]{1,30}$/,soundcloud:/^@[-a-z0-9_]{3,25}$/,tiktok:/^@[.\w]{1,23}[\w]$/,youtube:/^@[-.·\w]{3,30}$/};function Kre(e){return e===45||e===46||e===95||ay(e)||aa(e)}function xPe(e,t){var n=EYt[t];return n.test(e)}var TPe=["twitter","instagram","soundcloud","tiktok","youtube"];var pVo=x(T());var _Pe=(function(e){Y0(t,e);function t(n){var i=e.call(this,n)||this;return i.type="mention",i.serviceName="twitter",i.mention="",i.mention=n.mention,i.serviceName=n.serviceName,i}return t.prototype.getType=function(){return"mention"},t.prototype.getMention=function(){return this.mention},t.prototype.getServiceName=function(){return this.serviceName},t.prototype.getAnchorHref=function(){switch(this.serviceName){case"twitter":return"https://twitter.com/"+this.mention;case"instagram":return"https://instagram.com/"+this.mention;case"soundcloud":return"https://soundcloud.com/"+this.mention;case"tiktok":return"https://www.tiktok.com/@"+this.mention;case"youtube":return"https://youtube.com/@"+this.mention;default:tp(this.serviceName)}},t.prototype.getAnchorText=function(){return"@"+this.mention},t.prototype.getCssClassSuffixes=function(){var n=e.prototype.getCssClassSuffixes.call(this),i=this.getServiceName();return i&&n.push(i),n},t})(M0);var gVo=x(T()),AYt=/[-. ()]/,GYt=/(?:(?:(?:(\+)?\d{1,3}[-. ]?)?\(?\d{3}\)?[-. ]?\d{3}[-. ]?\d{4})|(?:(\+)(?:9[976]\d|8[987530]\d|6[987]\d|5[90]\d|42\d|3[875]\d|2[98654321]\d|9[8543210]|8[6421]|6[6543210]|5[87654321]|4[987654310]|3[9643210]|2[70]|7|1)[-. ]?(?:\d[-. ]?){6,12}\d+))([,;]+[0-9]+#?)*/,LYt=/(0([1-9]-?[1-9]\d{3}|[1-9]{2}-?\d{3}|[1-9]{2}\d{1}-?\d{2}|[1-9]{2}\d{2}-?\d{1})-?\d{4}|0[789]0-?\d{4}-?\d{4}|050-?\d{4}-?\d{4})/,WYt=new RegExp("^".concat(GYt.source,"|").concat(LYt.source,"$"));function Jre(e){return e===45||e===46||e===32}function MK(e){return e===44||e===59}function SPe(e){var t=e.charAt(0)==="+"||AYt.test(e);return t&&WYt.test(e)}var _Vo=x(T());var ZPe=(function(e){Y0(t,e);function t(n){var i=e.call(this,n)||this;return i.type="phone",i.number="",i.plusSign=!1,i.number=n.number,i.plusSign=n.plusSign,i}return t.prototype.getType=function(){return"phone"},t.prototype.getPhoneNumber=function(){return this.number},t.prototype.getNumber=function(){return this.getPhoneNumber()},t.prototype.getAnchorHref=function(){return"tel:"+(this.plusSign?"+":"")+this.number},t.prototype.getAnchorText=function(){return this.matchedText},t})(M0);var vYt=(function(){function e(t,n){this.charIdx=0,this.matches=[],this._stateMachines=[],this.schemeUrlMachinesCount=0,this.text=t,this.tagBuilder=n.tagBuilder,this.stripPrefix=n.stripPrefix,this.stripTrailingSlash=n.stripTrailingSlash,this.decodePercentEncoding=n.decodePercentEncoding,this.hashtagServiceName=n.hashtagServiceName,this.mentionServiceName=n.mentionServiceName}return Object.defineProperty(e.prototype,"stateMachines",{get:function(){return this._stateMachines},enumerable:!1,configurable:!0}),e.prototype.addMachine=function(t){this._stateMachines.push(t),CPe(t)&&this.schemeUrlMachinesCount++},e.prototype.removeMachine=function(t){this._stateMachines=this._stateMachines.filter(function(n){return n!==t}),CPe(t)&&this.schemeUrlMachinesCount--},e.prototype.hasSchemeUrlMachine=function(){return this.schemeUrlMachinesCount>0},e})();function VPe(e,t){for(var n=new vYt(e,t);n.charIdx<n.text.length;n.charIdx++){var i=e.charAt(n.charIdx),o=e.charCodeAt(n.charIdx);if(n.stateMachines.length===0)wK(n,i,o);else{for(var r=n.stateMachines.length-1;r>=0;r--){var s=n.stateMachines[r];switch(s.state){case 11:YYt(n,s,o);break;case 12:MYt(n,s,o);break;case 0:FYt(n,s,o);break;case 1:IYt(n,s,o);break;case 2:PYt(n,s,o);break;case 3:XYt(n,s,o);break;case 4:NYt(n,s,i,o);break;case 5:wYt(n,s,o);break;case 6:kYt(n,s,i,o);break;case 7:UYt(n,s,i,o);break;case 13:DYt(n,s,o);break;case 14:OYt(n,s,o);break;case 8:BYt(n,s,o);break;case 9:zYt(n,s,o);break;case 10:HYt(n,s,o);break;case 15:KYt(n,s,i,o);break;case 16:JYt(n,s,i,o);break;case 17:jYt(n,s,i,o);break;case 18:QYt(n,s,i,o);break;case 19:qYt(n,s,i,o);break;case 20:$Yt(n,s,o);break;case 21:eMt(n,s,o);break;case 22:RR(n,s,o);break;case 23:tMt(n,s,o);break;case 24:nMt(n,s,o);break;case 25:iMt(n,s,o);break;case 26:oMt(n,s,o);break;case 27:rMt(n,s,o);break;case 28:sMt(n,s,o);break;case 29:aMt(n,s,o);break;case 30:cMt(n,s,o);break;case 31:lMt(n,s,o);break;case 32:uMt(n,s,i,o);break;case 33:mMt(n,s,o);break;case 34:hMt(n,s,o);break;case 35:fMt(n,s,o);break;case 36:pMt(n,s,i,o);break;case 37:dMt(n,s,i,o);break;case 38:bMt(n,s,i,o);break;case 39:gMt(n,s,i,o);break;case 40:yMt(n,s,o);break;case 41:xMt(n,s,o);break;default:tp(s.state)}}if(!n.hasSchemeUrlMachine()&&n.charIdx>0&&bA(o)){var a=n.text.charCodeAt(n.charIdx-1);bA(a)||n.addMachine(kK(n.charIdx,0))}}}for(var c=n.stateMachines.length-1;c>=0;c--)n.stateMachines.forEach(function(d){return Fs(n,d)});return n.matches}function wK(e,t,n){var i=e.charIdx;if(n===35)e.addMachine(RMt(i,28));else if(n===64)e.addMachine(CMt(i,30));else if(n===47)e.addMachine(Qre(i,11));else if(n===43)e.addMachine(jre(i,37));else if(n===40)e.addMachine(jre(i,32));else{if(aa(n)&&(e.addMachine(jre(i,38)),e.addMachine(SMt(i,13))),zre(n)){var o=t.toLowerCase()==="m"?15:22;e.addMachine(ZMt(i,o))}bA(n)&&e.addMachine(kK(i,0)),np(n)&&e.addMachine(Qre(i,5))}}function FYt(e,t,n){n===58?t.state=2:n===45?t.state=1:Dre(n)||e.removeMachine(t)}function IYt(e,t,n){var i=e.charIdx;n===45||(n===47?(e.removeMachine(t),e.addMachine(Qre(i,11))):Dre(n)?t.state=0:e.removeMachine(t))}function PYt(e,t,n){var i=e.charIdx;n===47?t.state=3:n===46?e.removeMachine(t):cy(n)?(t.state=5,bA(n)&&e.addMachine(kK(i,0))):e.removeMachine(t)}function XYt(e,t,n){n===47?t.state=4:Ore(n)?(t.state=10,t.acceptStateReached=!0):Fs(e,t)}function NYt(e,t,n,i){i===47?(t.state=10,t.acceptStateReached=!0):cy(i)?(t.state=5,t.acceptStateReached=!0):e.removeMachine(t)}function YYt(e,t,n){n===47?t.state=12:e.removeMachine(t)}function MYt(e,t,n){cy(n)?t.state=5:e.removeMachine(t)}function wYt(e,t,n){n===46?t.state=7:n===45?t.state=6:n===58?t.state=8:NK(n)?t.state=10:XK(n)||Fs(e,t)}function kYt(e,t,n,i){i===45||(i===46?Fs(e,t):cy(i)?t.state=5:Fs(e,t))}function UYt(e,t,n,i){i===46?Fs(e,t):cy(i)?(t.state=5,t.acceptStateReached=!0):Fs(e,t)}function DYt(e,t,n){n===46?t.state=14:n===58?t.state=8:aa(n)||(NK(n)?t.state=10:np(n)?e.removeMachine(t):Fs(e,t))}function OYt(e,t,n){aa(n)?(t.octetsEncountered++,t.octetsEncountered===4&&(t.acceptStateReached=!0),t.state=13):Fs(e,t)}function BYt(e,t,n){aa(n)?t.state=9:Fs(e,t)}function zYt(e,t,n){aa(n)||(NK(n)?t.state=10:Fs(e,t))}function HYt(e,t,n){Ore(n)||Fs(e,t)}function KYt(e,t,n,i){n.toLowerCase()==="a"?t.state=16:RR(e,t,i)}function JYt(e,t,n,i){n.toLowerCase()==="i"?t.state=17:RR(e,t,i)}function jYt(e,t,n,i){n.toLowerCase()==="l"?t.state=18:RR(e,t,i)}function QYt(e,t,n,i){n.toLowerCase()==="t"?t.state=19:RR(e,t,i)}function qYt(e,t,n,i){n.toLowerCase()==="o"?t.state=20:RR(e,t,i)}function $Yt(e,t,n){n===58?t.state=21:RR(e,t,n)}function eMt(e,t,n){YK(n)?t.state=22:e.removeMachine(t)}function RR(e,t,n){n===46?t.state=23:n===64?t.state=24:YK(n)?t.state=22:e.removeMachine(t)}function tMt(e,t,n){n===46||n===64?e.removeMachine(t):YK(n)?t.state=22:e.removeMachine(t)}function nMt(e,t,n){cy(n)?t.state=25:e.removeMachine(t)}function iMt(e,t,n){n===46?t.state=27:n===45?t.state=26:XK(n)||Fs(e,t)}function oMt(e,t,n){n===45||n===46?Fs(e,t):XK(n)?t.state=25:Fs(e,t)}function rMt(e,t,n){n===46||n===45?Fs(e,t):cy(n)?(t.state=25,t.acceptStateReached=!0):Fs(e,t)}function sMt(e,t,n){Hre(n)?(t.state=29,t.acceptStateReached=!0):e.removeMachine(t)}function aMt(e,t,n){Hre(n)||Fs(e,t)}function cMt(e,t,n){Kre(n)?(t.state=31,t.acceptStateReached=!0):e.removeMachine(t)}function lMt(e,t,n){Kre(n)||(np(n)?e.removeMachine(t):Fs(e,t))}function dMt(e,t,n,i){aa(i)?t.state=38:(e.removeMachine(t),wK(e,n,i))}function uMt(e,t,n,i){aa(i)?t.state=33:e.removeMachine(t),wK(e,n,i)}function mMt(e,t,n){aa(n)?t.state=34:e.removeMachine(t)}function hMt(e,t,n){aa(n)?t.state=35:e.removeMachine(t)}function fMt(e,t,n){n===41?t.state=36:e.removeMachine(t)}function pMt(e,t,n,i){aa(i)?t.state=38:Jre(i)?t.state=39:e.removeMachine(t)}function bMt(e,t,n,i){var o=e.charIdx;t.acceptStateReached=!0,MK(i)?t.state=40:i===35?t.state=41:aa(i)||(i===40?t.state=32:Jre(i)?t.state=39:(Fs(e,t),bA(i)&&e.addMachine(kK(o,0))))}function gMt(e,t,n,i){aa(i)?t.state=38:i===40?t.state=32:(Fs(e,t),wK(e,n,i))}function yMt(e,t,n){MK(n)||(n===35?t.state=41:aa(n)?t.state=38:Fs(e,t))}function xMt(e,t,n){MK(n)?t.state=40:aa(n)?e.removeMachine(t):Fs(e,t)}function Fs(e,t){var n=e.matches,i=e.text,o=e.charIdx,r=e.tagBuilder,s=e.stripPrefix,a=e.stripTrailingSlash,c=e.decodePercentEncoding,d=e.hashtagServiceName,u=e.mentionServiceName;if(e.removeMachine(t),!!t.acceptStateReached){var m=t.startIdx,p=i.slice(t.startIdx,o);switch(p=_Mt(p),t.type){case 0:{var b=i.charCodeAt(t.startIdx-1);if(b===64)return;switch(t.matchType){case 0:{var f=Ure.exec(p);if(f&&(m=m+f.index,p=p.slice(f.index)),!lPe(p))return;break}case 1:{if(!dPe(p))return;break}case 2:{if(!uPe(p))return;break}default:tp(t)}n.push(new mPe({tagBuilder:r,matchedText:p,offset:m,urlMatchType:TMt(t.matchType),url:p,protocolRelativeMatch:p.slice(0,2)==="//",stripPrefix:s,stripTrailingSlash:a,decodePercentEncoding:c}));break}case 1:{fPe(p)&&n.push(new pPe({tagBuilder:r,matchedText:p,offset:m,email:p.replace(hPe,"")}));break}case 2:{bPe(p)&&n.push(new yPe({tagBuilder:r,matchedText:p,offset:m,serviceName:d,hashtag:p.slice(1)}));break}case 3:{xPe(p,u)&&n.push(new _Pe({tagBuilder:r,matchedText:p,offset:m,serviceName:u,mention:p.slice(1)}));break}case 4:{if(p=p.replace(/ +$/g,""),SPe(p)){var y=p.replace(/[^0-9,;#]/g,"");n.push(new ZPe({tagBuilder:r,matchedText:p,offset:m,number:y,plusSign:p.charAt(0)==="+"}))}break}default:tp(t)}}}function TMt(e){switch(e){case 0:return"scheme";case 1:return"tld";case 2:return"ipV4";default:tp(e)}}var RPe={")":"(","}":"{","]":"["};function _Mt(e){for(var t={"(":0,"{":0,"[":0},n=0;n<e.length;n++){var i=e.charAt(n),o=e.charCodeAt(n);sPe(o)?t[i]++:kre(o)&&t[RPe[i]]--}for(var r=e.length-1;r>=0;){var i=e.charAt(r),o=e.charCodeAt(r);if(kre(o)){var s=RPe[i];if(t[s]<0)t[s]++,r--;else break}else if(PK(o))r--;else break}return e.slice(0,r+1)}function kK(e,t){return{type:0,startIdx:e,state:t,acceptStateReached:!1,matchType:0}}function Qre(e,t){return{type:0,startIdx:e,state:t,acceptStateReached:!1,matchType:1}}function SMt(e,t){return{type:0,startIdx:e,state:t,acceptStateReached:!1,matchType:2,octetsEncountered:1}}function ZMt(e,t){return{type:1,startIdx:e,state:t,acceptStateReached:!1}}function RMt(e,t){return{type:2,startIdx:e,state:t,acceptStateReached:!1}}function CMt(e,t){return{type:3,startIdx:e,state:t,acceptStateReached:!1}}function jre(e,t){return{type:4,startIdx:e,state:t,acceptStateReached:!1}}function CPe(e){return e.type===0&&e.matchType===0}var wVo=x(T());var w0=(function(){function e(t){t===void 0&&(t={}),this.idx=t.idx!==void 0?t.idx:-1,this.type=t.type||"tag",this.name=t.name||"",this.isOpening=!!t.isOpening,this.isClosing=!!t.isClosing}return e})(),$re=new w0,VMt=(function(){function e(t,n){this.charIdx=0,this.state=0,this.currentDataIdx=0,this.currentTag=$re,this.html=t,this.callbacks=n}return e})();function EPe(e,t){for(var n=new VMt(e,t),i=e.length;n.charIdx<i;){var o=e.charAt(n.charIdx),r=e.charCodeAt(n.charIdx);switch(n.state){case 0:EMt(n,o);break;case 1:AMt(n,o,r);break;case 2:LMt(n,o,r);break;case 3:GMt(n,o,r);break;case 4:WMt(n,o,r);break;case 5:vMt(n,o,r);break;case 6:FMt(n,o,r);break;case 7:IMt(n,o,r);break;case 8:PMt(n,o);break;case 9:XMt(n,o);break;case 10:NMt(n,o,r);break;case 11:YMt(n,o,r);break;case 12:MMt(n,o);break;case 13:wMt(n);break;case 14:kMt(n,o);break;case 15:UMt(n,o);break;case 16:DMt(n,o);break;case 17:OMt(n,o);break;case 18:BMt(n,o);break;case 19:zMt(n,o);break;case 20:HMt(n,o);break;default:tp(n.state)}n.charIdx++}n.currentDataIdx<n.charIdx&&KMt(n)}function EMt(e,t){t==="<"&&k0(e)}function AMt(e,t,n){t==="!"?e.state=13:t==="/"?(e.state=2,e.currentTag=new w0(sa(sa({},e.currentTag),{isClosing:!0}))):t==="<"?k0(e):ay(n)?(e.state=3,e.currentTag=new w0(sa(sa({},e.currentTag),{isOpening:!0}))):(e.state=0,e.currentTag=$re)}function GMt(e,t,n){GT(n)?(e.currentTag=new w0(sa(sa({},e.currentTag),{name:qre(e)})),e.state=4):t==="<"?k0(e):t==="/"?(e.currentTag=new w0(sa(sa({},e.currentTag),{name:qre(e)})),e.state=12):t===">"?(e.currentTag=new w0(sa(sa({},e.currentTag),{name:qre(e)})),U0(e)):!ay(n)&&!aa(n)&&t!==":"&&Vh(e)}function LMt(e,t,n){t===">"?Vh(e):ay(n)?e.state=3:Vh(e)}function WMt(e,t,n){GT(n)||(t==="/"?e.state=12:t===">"?U0(e):t==="<"?k0(e):t==="="||IK(n)||iPe(n)?Vh(e):e.state=5)}function vMt(e,t,n){GT(n)?e.state=6:t==="/"?e.state=12:t==="="?e.state=7:t===">"?U0(e):t==="<"?k0(e):IK(n)&&Vh(e)}function FMt(e,t,n){GT(n)||(t==="/"?e.state=12:t==="="?e.state=7:t===">"?U0(e):t==="<"?k0(e):IK(n)?Vh(e):e.state=5)}function IMt(e,t,n){GT(n)||(t==='"'?e.state=8:t==="'"?e.state=9:/[>=`]/.test(t)?Vh(e):t==="<"?k0(e):e.state=10)}function PMt(e,t){t==='"'&&(e.state=11)}function XMt(e,t){t==="'"&&(e.state=11)}function NMt(e,t,n){GT(n)?e.state=4:t===">"?U0(e):t==="<"&&k0(e)}function YMt(e,t,n){GT(n)?e.state=4:t==="/"?e.state=12:t===">"?U0(e):t==="<"?k0(e):(e.state=4,JMt(e))}function MMt(e,t){t===">"?(e.currentTag=new w0(sa(sa({},e.currentTag),{isClosing:!0})),U0(e)):Vh(e)}function wMt(e){var t=e.html,n=e.charIdx;t.slice(n,n+2)==="--"?(e.charIdx++,e.currentTag=new w0(sa(sa({},e.currentTag),{type:"comment"})),e.state=14):t.slice(n,n+7).toUpperCase()==="DOCTYPE"?(e.charIdx+=6,e.currentTag=new w0(sa(sa({},e.currentTag),{type:"doctype"})),e.state=20):Vh(e)}function kMt(e,t){t==="-"?e.state=15:t===">"?Vh(e):e.state=16}function UMt(e,t){t==="-"?e.state=18:t===">"?Vh(e):e.state=16}function DMt(e,t){t==="-"&&(e.state=17)}function OMt(e,t){t==="-"?e.state=18:e.state=16}function BMt(e,t){t===">"?U0(e):t==="!"?e.state=19:t==="-"||(e.state=16)}function zMt(e,t){t==="-"?e.state=17:t===">"?U0(e):e.state=16}function HMt(e,t){t===">"?U0(e):t==="<"&&k0(e)}function Vh(e){e.state=0,e.currentTag=$re}function k0(e){e.state=1,e.currentTag=new w0({idx:e.charIdx})}function U0(e){var t=e.html.slice(e.currentDataIdx,e.currentTag.idx);t&&e.callbacks.onText(t,e.currentDataIdx);var n=e.currentTag;n.type==="comment"?e.callbacks.onComment(n.idx):n.type==="doctype"?e.callbacks.onDoctype(n.idx):(n.isOpening&&e.callbacks.onOpenTag(n.name,n.idx),n.isClosing&&e.callbacks.onCloseTag(n.name,n.idx)),Vh(e),e.currentDataIdx=e.charIdx+1}function KMt(e){var t=e.html.slice(e.currentDataIdx,e.charIdx);e.callbacks.onText(t,e.currentDataIdx),e.currentDataIdx=e.charIdx+1}function qre(e){var t=e.currentTag.idx+(e.currentTag.isClosing?2:1);return e.html.slice(t,e.charIdx).toLowerCase()}function JMt(e){e.charIdx--}var jMt=(function(){function e(t){t===void 0&&(t={}),this.version=e.version,this.urls={},this.email=!0,this.phone=!0,this.hashtag=!1,this.mention=!1,this.newWindow=!0,this.stripPrefix={scheme:!0,www:!0},this.stripTrailingSlash=!0,this.decodePercentEncoding=!0,this.truncate={length:0,location:"end"},this.className="",this.replaceFn=null,this.context=void 0,this.sanitizeHtml=!1,this.tagBuilder=null,this.urls=QMt(t.urls),this.email=cm(t.email)?t.email:this.email,this.phone=cm(t.phone)?t.phone:this.phone,this.hashtag=t.hashtag||this.hashtag,this.mention=t.mention||this.mention,this.newWindow=cm(t.newWindow)?t.newWindow:this.newWindow,this.stripPrefix=qMt(t.stripPrefix),this.stripTrailingSlash=cm(t.stripTrailingSlash)?t.stripTrailingSlash:this.stripTrailingSlash,this.decodePercentEncoding=cm(t.decodePercentEncoding)?t.decodePercentEncoding:this.decodePercentEncoding,this.sanitizeHtml=t.sanitizeHtml||!1;var n=this.mention;if(n!==!1&&TPe.indexOf(n)===-1)throw new Error("invalid `mention` cfg '".concat(n,"' - see docs"));var i=this.hashtag;if(i!==!1&&gPe.indexOf(i)===-1)throw new Error("invalid `hashtag` cfg '".concat(i,"' - see docs"));this.truncate=$Mt(t.truncate),this.className=t.className||this.className,this.replaceFn=t.replaceFn||this.replaceFn,this.context=t.context||this}return e.link=function(t,n){var i=new e(n);return i.link(t)},e.parse=function(t,n){var i=new e(n);return i.parse(t)},e.prototype.parse=function(t){var n=this,i=["a","style","script"],o=0,r=[];return EPe(t,{onOpenTag:function(s){i.indexOf(s)>=0&&o++},onText:function(s,a){if(o===0){var c=/( | |<|<|>|>|"|"|')/gi,d=s.split(c),u=a;d.forEach(function(m,p){if(p%2===0){var b=n.parseText(m,u);r.push.apply(r,KIe([],HIe(b),!1))}u+=m.length})}},onCloseTag:function(s){i.indexOf(s)>=0&&(o=Math.max(o-1,0))},onComment:function(){},onDoctype:function(){}}),r=this.compactMatches(r),r=this.removeUnwantedMatches(r),r},e.prototype.compactMatches=function(t){t.sort(ewt);for(var n=0;n<t.length-1;){var i=t[n],o=i.getOffset(),r=i.getMatchedText().length;if(n+1<t.length&&t[n+1].getOffset()===o){var s=t[n+1].getMatchedText().length>r?n:n+1;t.splice(s,1);continue}n++}return t},e.prototype.removeUnwantedMatches=function(t){return this.hashtag||AT(t,function(n){return n.getType()==="hashtag"}),this.email||AT(t,function(n){return n.getType()==="email"}),this.phone||AT(t,function(n){return n.getType()==="phone"}),this.mention||AT(t,function(n){return n.getType()==="mention"}),this.urls.schemeMatches||AT(t,function(n){return n.getType()==="url"&&n.getUrlMatchType()==="scheme"}),this.urls.tldMatches||AT(t,function(n){return n.getType()==="url"&&n.getUrlMatchType()==="tld"}),this.urls.ipV4Matches||AT(t,function(n){return n.getType()==="url"&&n.getUrlMatchType()==="ipV4"}),t},e.prototype.parseText=function(t,n){n=n||0;for(var i=VPe(t,{tagBuilder:this.getTagBuilder(),stripPrefix:this.stripPrefix,stripTrailingSlash:this.stripTrailingSlash,decodePercentEncoding:this.decodePercentEncoding,hashtagServiceName:this.hashtag,mentionServiceName:this.mention||"twitter"}),o=0,r=i.length;o<r;o++)i[o].setOffset(n+i[o].getOffset());return i},e.prototype.link=function(t){if(!t)return"";this.sanitizeHtml&&(t=t.replace(/</g,"<").replace(/>/g,">"));for(var n=this.parse(t),i=new Array(n.length*2+1),o=0,r=0,s=n.length;r<s;r++){var a=n[r];i.push(t.substring(o,a.getOffset())),i.push(this.createMatchReturnVal(a)),o=a.getOffset()+a.getMatchedText().length}return i.push(t.substring(o)),i.join("")},e.prototype.createMatchReturnVal=function(t){var n;if(this.replaceFn&&(n=this.replaceFn.call(this.context,t)),typeof n=="string")return n;if(n===!1)return t.getMatchedText();if(n instanceof FK)return n.toAnchorString();var i=t.buildTag();return i.toAnchorString()},e.prototype.getTagBuilder=function(){var t=this.tagBuilder;return t||(t=this.tagBuilder=new nPe({newWindow:this.newWindow,truncate:this.truncate,className:this.className})),t},e.version=JIe,e})(),APe=jMt;function QMt(e){return e==null&&(e=!0),cm(e)?{schemeMatches:e,tldMatches:e,ipV4Matches:e}:{schemeMatches:cm(e.schemeMatches)?e.schemeMatches:!0,tldMatches:cm(e.tldMatches)?e.tldMatches:!0,ipV4Matches:cm(e.ipV4Matches)?e.ipV4Matches:!0}}function qMt(e){return e==null&&(e=!0),cm(e)?{scheme:e,www:e}:{scheme:cm(e.scheme)?e.scheme:!0,www:cm(e.www)?e.www:!0}}function $Mt(e){return typeof e=="number"?{length:e,location:"end"}:sa({length:Number.POSITIVE_INFINITY,location:"end"},e)}function ewt(e,t){return e.getOffset()-t.getOffset()}var eEo=x(T());var qVo=x(T());var lEo=x(T());var UK=APe;var NPe;typeof DOMParser<"u"&&(NPe=new DOMParser);var twt=new UK({stripPrefix:!1,email:!1,replaceFn:function(e,t){return t.urlMatchType==="scheme"||t.urlMatchType==="www"}}),DK=32,GPe=2414016,LPe=1,WPe=16093e3,vPe=.1,nwt=[null,void 0,"http://www.topografix.com/GPX/1/1"],ir={gpx:nwt};function iwt(e){return new Promise((t,n)=>{let i=new FileReader;i.addEventListener("load",function(){t(i.result)}),i.addEventListener("error",function(){n(i.error)}),i.readAsText(e)})}function ese(e,t){let n=sU(e,"id");return n=l(n)?n:Qn(),t.getOrCreateEntity(n)}function tse(e){let t=FPe(e,"lon"),n=FPe(e,"lat"),i=oU(e,"ele",ir.gpx);return h.fromDegrees(t,n,i)}function FPe(e,t){if(!l(e))return;let n=e.getAttribute(t);if(n!==null){let i=parseFloat(n);return isNaN(i)?void 0:i}}function sU(e,t){if(!l(e))return;let n=e.getAttribute(t);return n!==null?n:void 0}function LT(e,t,n){if(!l(e))return;let i=e.childNodes,o=i.length;for(let r=0;r<o;r++){let s=i[r];if(s.localName===t&&n.indexOf(s.namespaceURI)!==-1)return s}}function nse(e,t,n){if(!l(e))return;let i=[],o=e.getElementsByTagName(t),r=o.length;for(let s=0;s<r;s++){let a=o[s];a.localName===t&&n.indexOf(a.namespaceURI)!==-1&&i.push(a)}return i}function oU(e,t,n){let i=LT(e,t,n);if(l(i)){let o=parseFloat(i.textContent);return isNaN(o)?void 0:o}}function cu(e,t,n){let i=LT(e,t,n);if(l(i))return i.textContent.trim()}function YPe(e){let t=new el;return t.width=DK,t.height=DK,t.scaleByDistance=new Kt(GPe,LPe,WPe,vPe),t.pixelOffsetScaleByDistance=new Kt(GPe,LPe,WPe,vPe),t.verticalOrigin=new mi(zn.BOTTOM),t.image=e,t}function owt(){let e=new qh;return e.translucencyByDistance=new Kt(3e6,1,5e6,0),e.pixelOffset=new k(17,0),e.horizontalOrigin=Di.LEFT,e.font="16px sans-serif",e.style=yr.FILL_AND_OUTLINE,e}function MPe(e){let t=new tl;return t.width=4,t.material=new pT,t.material.color=l(e)?e:U.RED,t.material.outlineWidth=2,t.material.outlineColor=U.BLACK,t}var IPe={time:{text:"Time",tag:"time"},comment:{text:"Comment",tag:"cmt"},description:{text:"Description",tag:"desc"},source:{text:"Source",tag:"src"},number:{text:"GPS track/route number",tag:"number"},type:{text:"Type",tag:"type"}},rU;typeof document<"u"&&(rU=document.createElement("div"));function ise(e,t){let n,i="",o=Object.keys(IPe),r=o.length;for(n=0;n<r;n++){let u=o[n],m=IPe[u];m.value=cu(e,m.tag,ir.gpx)??"",l(m.value)&&m.value!==""&&(i=`${i}<p>${m.text}: ${m.value}</p>`)}if(!l(i)||i==="")return;i=twt.link(i),rU.innerHTML=i;let s=rU.querySelectorAll("a");for(n=0;n<s.length;n++)s[n].setAttribute("target","_blank");let a=U.WHITE,c=U.BLACK,d='<div class="cesium-infoBox-description-lighter" style="';return d+="overflow:auto;",d+="word-wrap:break-word;",d+=`background-color:${a.toCssColorString()};`,d+=`color:${c.toCssColorString()};`,d+='">',d+=`${rU.innerHTML}</div>`,rU.innerHTML="",d}function wPe(e,t,n,i){let o=tse(t),r=ese(t,n);r.position=o;let s=l(i.waypointImage)?i.waypointImage:e._pinBuilder.fromMakiIconId("marker",U.RED,DK);r.billboard=YPe(s);let a=cu(t,"name",ir.gpx);r.name=a,r.label=owt(),r.label.text=a,r.description=ise(t,r),i.clampToGround&&(r.billboard.heightReference=He.CLAMP_TO_GROUND,r.label.heightReference=He.CLAMP_TO_GROUND)}function rwt(e,t,n,i){let o=ese(t,n);o.description=ise(t,o);let r=nse(t,"rtept",ir.gpx),s=new Array(r.length);for(let a=0;a<r.length;a++)wPe(e,r[a],n,i),s[a]=tse(r[a]);o.polyline=MPe(i.routeColor),i.clampToGround&&(o.polyline.clampToGround=!0),o.polyline.positions=s}function swt(e,t,n,i){let o=ese(t,n);o.description=ise(t,o);let r=nse(t,"trkseg",ir.gpx),s=[],a=[],c,d=!0,u=new bc;for(let m=0;m<r.length;m++)c=awt(r[m]),s=s.concat(c.positions),c.times.length>0?(a=a.concat(c.times),u.addSamples(a,s),d=d&&!0):d=!1;if(d){let m=l(i.waypointImage)?i.waypointImage:e._pinBuilder.fromMakiIconId("marker",U.RED,DK);o.billboard=YPe(m),o.position=u,i.clampToGround&&(o.billboard.heightReference=He.CLAMP_TO_GROUND),o.availability=new Es,o.availability.addInterval(new Cn({start:a[0],stop:a[a.length-1]}))}o.polyline=MPe(i.trackColor),o.polyline.positions=s,i.clampToGround&&(o.polyline.clampToGround=!0)}function awt(e){let t={positions:[],times:[]},n=nse(e,"trkpt",ir.gpx),i;for(let o=0;o<n.length;o++){let r=tse(n[o]);t.positions.push(r),i=cu(n[o],"time",ir.gpx),l(i)&&t.times.push(Q.fromIso8601(i))}return t}function cwt(e){let t=LT(e,"metadata",ir.gpx);if(l(t)){let n={name:cu(t,"name",ir.gpx),desc:cu(t,"desc",ir.gpx),author:lwt(t),copyright:uwt(t),link:kPe(t),time:cu(t,"time",ir.gpx),keywords:cu(t,"keywords",ir.gpx),bounds:mwt(t)};if(l(n.name)||l(n.desc)||l(n.author)||l(n.copyright)||l(n.link)||l(n.time)||l(n.keywords)||l(n.bounds))return n}}function lwt(e){let t=LT(e,"author",ir.gpx);if(l(t)){let n={name:cu(t,"name",ir.gpx),email:dwt(t),link:kPe(t)};if(l(n.name)||l(n.email)||l(n.link))return n}}function dwt(e){let t=LT(e,"email",ir.gpx);if(l(t)){let n=cu(t,"id",ir.gpx),i=cu(t,"domain",ir.gpx);return`${n}@${i}`}}function kPe(e){let t=LT(e,"link",ir.gpx);if(l(t)){let n={href:sU(t,"href"),text:cu(t,"text",ir.gpx),mimeType:cu(t,"type",ir.gpx)};if(l(n.href)||l(n.text)||l(n.mimeType))return n}}function uwt(e){let t=LT(e,"copyright",ir.gpx);if(l(t)){let n={author:sU(t,"author"),year:cu(t,"year",ir.gpx),license:cu(t,"license",ir.gpx)};if(l(n.author)||l(n.year)||l(n.license))return n}}function mwt(e){let t=LT(e,"bounds",ir.gpx);if(l(t)){let n={minLat:oU(t,"minlat",ir.gpx),maxLat:oU(t,"maxlat",ir.gpx),minLon:oU(t,"minlon",ir.gpx),maxLon:oU(t,"maxlon",ir.gpx)};if(l(n.minLat)||l(n.maxLat)||l(n.minLon)||l(n.maxLon))return n}}var PPe={wpt:wPe,rte:rwt,trk:swt};function hwt(e,t,n,i){let o=Object.keys(PPe),r=o.length;for(let s=0;s<r;s++){let a=o[s],c=PPe[a],d=t.childNodes,u=d.length;for(let m=0;m<u;m++){let p=d[m];p.localName===a&&ir.gpx.indexOf(p.namespaceURI)!==-1&&c(e,p,n,i)}}}function XPe(e,t,n){let i=e._entityCollection;i.removeAll();let o=t.documentElement,r=sU(o,"version"),s=sU(o,"creator"),a,c=cwt(o);l(c)&&(a=c.name),o.localName==="gpx"?hwt(e,o,i,n):console.log(`GPX - Unsupported node: ${o.localName}`);let d,u=i.computeAvailability(),m=u.start,p=u.stop,b=Q.equals(m,ot.MINIMUM_VALUE),f=Q.equals(p,ot.MAXIMUM_VALUE);if(!b||!f){let _;b&&(_=new Date,_.setHours(0,0,0,0),m=Q.fromDate(_)),f&&(_=new Date,_.setHours(24,0,0,0),p=Q.fromDate(_)),d=new Kf,d.startTime=m,d.stopTime=p,d.currentTime=Q.clone(m),d.clockRange=bs.LOOP_STOP,d.clockStep=Do.SYSTEM_CLOCK_MULTIPLIER,d.multiplier=Math.round(Math.min(Math.max(Q.secondsDifference(p,m)/60,1),31556900))}let y=!1;return e._name!==a&&(e._name=a,y=!0),e._creator!==s&&(e._creator=s,y=!0),fwt(e._metadata,c)&&(e._metadata=c,y=!0),e._version!==r&&(e._version=r,y=!0),d!==e._clock&&(y=!0,e._clock=d),y&&e._changed.raiseEvent(e),ys.setLoading(e,!1),e}function fwt(e,t){return!l(e)&&!l(t)?!1:l(e)&&l(t)?e.name!==t.name||e.dec!==t.desc||e.src!==t.src||e.author!==t.author||e.copyright!==t.copyright||e.link!==t.link||e.time!==t.time||e.bounds!==t.bounds:!0}function pwt(e,t,n,i){i=i??B.EMPTY_OBJECT;let o=n;if(typeof n=="string"||n instanceof ve){n=ve.createIfNeeded(n),o=n.fetchBlob();let r=e._resourceCredits,s=n.credits;if(l(s)){let a=s.length;for(let c=0;c<a;c++)r.push(s[c])}}return Promise.resolve(o).then(function(r){return r instanceof Blob?iwt(r).then(function(s){let a,c;try{a=NPe.parseFromString(s,"application/xml")}catch(d){c=d.toString()}if(l(c)||a.body||a.documentElement.tagName==="parsererror"){let d=l(c)?c:a.documentElement.firstChild.nodeValue;throw d||(d=a.body.innerText),new ae(d)}return XPe(e,a,i)}):XPe(e,r,i)}).catch(function(r){return e._error.raiseEvent(e,r),console.log(r),Promise.reject(r)})}function gA(){this._changed=new Se,this._error=new Se,this._loading=new Se,this._clock=void 0,this._entityCollection=new Ya(this),this._entityCluster=new Eu,this._name=void 0,this._version=void 0,this._creator=void 0,this._metadata=void 0,this._isLoading=!1,this._pinBuilder=new sy}gA.load=function(e,t){return new gA().load(e,t)};Object.defineProperties(gA.prototype,{name:{get:function(){return this._name}},version:{get:function(){return this._version}},creator:{get:function(){return this._creator}},metadata:{get:function(){return this._metadata}},clock:{get:function(){return this._clock}},entities:{get:function(){return this._entityCollection}},isLoading:{get:function(){return this._isLoading}},changedEvent:{get:function(){return this._changed}},errorEvent:{get:function(){return this._error}},loadingEvent:{get:function(){return this._loading}},show:{get:function(){return this._entityCollection.show},set:function(e){this._entityCollection.show=e}},clustering:{get:function(){return this._entityCluster},set:function(e){this._entityCluster=e}}});gA.prototype.update=function(e){return!0};gA.prototype.load=function(e,t){if(!l(e))throw new ge("data is required.");t=t??B.EMPTY_OBJECT,ys.setLoading(this,!0);let n=this._name,i=this;return pwt(this,this._entityCollection,e,t).then(function(){let o,r=i._entityCollection.computeAvailability(),s=r.start,a=r.stop,c=Q.equals(s,ot.MINIMUM_VALUE),d=Q.equals(a,ot.MAXIMUM_VALUE);if(!c||!d){let m;c&&(m=new Date,m.setHours(0,0,0,0),s=Q.fromDate(m)),d&&(m=new Date,m.setHours(24,0,0,0),a=Q.fromDate(m)),o=new Kf,o.startTime=s,o.stopTime=a,o.currentTime=Q.clone(s),o.clockRange=bs.LOOP_STOP,o.clockStep=Do.SYSTEM_CLOCK_MULTIPLIER,o.multiplier=Math.round(Math.min(Math.max(Q.secondsDifference(a,s)/60,1),31556900))}let u=!1;return o!==i._clock&&(i._clock=o,u=!0),n!==i._name&&(u=!0),u&&i._changed.raiseEvent(i),ys.setLoading(i,!1),i}).catch(function(o){return ys.setLoading(i,!1),i._error.raiseEvent(i,o),console.log(o),Promise.reject(o)})};var aU=gA;var tAo=x(T(),1);function bwt(e,t){this.position=e,this.headingPitchRoll=t}var cU=bwt;var WGo=x(T(),1);var hU=x(gu(),1);var iAo=x(T(),1);function gwt(e,t){this.position=e,this.headingPitchRange=t}var lU=gwt;var aAo=x(T(),1);function OK(e,t){this.id=t,this.name=e,this.playlistIndex=0,this.playlist=[],this.tourStart=new Se,this.tourEnd=new Se,this.entryStart=new Se,this.entryEnd=new Se,this._activeEntries=[]}OK.prototype.addPlaylistEntry=function(e){this.playlist.push(e)};OK.prototype.play=function(e,t){this.tourStart.raiseEvent();let n=this;DPe.call(this,e,t,function(i){n.playlistIndex=0,i||UPe(n._activeEntries),n.tourEnd.raiseEvent(i)})};OK.prototype.stop=function(){UPe(this._activeEntries)};function UPe(e){for(let t=e.pop();t!==void 0;t=e.pop())t.stop()}function DPe(e,t,n){let i=this.playlist[this.playlistIndex];if(i){let o=ywt.bind(this,e,t,n);if(this._activeEntries.push(i),this.entryStart.raiseEvent(i),i.blocking)i.play(o,e.scene.camera,t);else{let r=this;i.play(function(){r.entryEnd.raiseEvent(i);let s=r._activeEntries.indexOf(i);s>=0&&r._activeEntries.splice(s,1)}),o(e,t,n)}}else l(n)&&n(!1)}function ywt(e,t,n,i){let o=this.playlist[this.playlistIndex];if(this.entryEnd.raiseEvent(o,i),i)n(i);else{let r=this._activeEntries.indexOf(o);r>=0&&this._activeEntries.splice(r,1),this.playlistIndex++,DPe.call(this,e,t,n)}}var dU=OK;var hAo=x(T(),1);function BK(e,t,n){this.type="KmlTourFlyTo",this.blocking=!0,this.activeCamera=null,this.activeCallback=null,this.duration=e,this.view=n,this.flyToMode=t}BK.prototype.play=function(e,t,n){if(this.activeCamera=t,l(e)&&e!==null){let o=this;this.activeCallback=function(r){delete o.activeCallback,delete o.activeCamera,e(l(r)?!1:r)}}let i=this.getCameraOptions(n);if(this.view.headingPitchRoll)t.flyTo(i);else if(this.view.headingPitchRange){let o=new me(this.view.position);t.flyToBoundingSphere(o,i)}};BK.prototype.stop=function(){l(this.activeCamera)&&this.activeCamera.cancelFlight(),l(this.activeCallback)&&this.activeCallback(!0)};BK.prototype.getCameraOptions=function(e){let t={duration:this.duration};return l(this.activeCallback)&&(t.complete=this.activeCallback),this.flyToMode==="smooth"&&(t.easingFunction=As.LINEAR_NONE),this.view.headingPitchRoll?(t.destination=this.view.position,t.orientation=this.view.headingPitchRoll):this.view.headingPitchRange&&(t.offset=this.view.headingPitchRange),l(e)&&(t=It(t,e)),t};var uU=BK;var bAo=x(T(),1);function ose(e){this.type="KmlTourWait",this.blocking=!0,this.duration=e,this.timeout=null}ose.prototype.play=function(e){let t=this;this.activeCallback=e,this.timeout=setTimeout(function(){delete t.activeCallback,e(!1)},this.duration*1e3)};ose.prototype.stop=function(){clearTimeout(this.timeout),l(this.activeCallback)&&this.activeCallback(!0)};var mU=ose;var $Pe={avi:"video/x-msvideo",bmp:"image/bmp",bz2:"application/x-bzip2",chm:"application/vnd.ms-htmlhelp",css:"text/css",csv:"text/csv",doc:"application/msword",dvi:"application/x-dvi",eps:"application/postscript",flv:"video/x-flv",gif:"image/gif",gz:"application/x-gzip",htm:"text/html",html:"text/html",ico:"image/vnd.microsoft.icon",jnlp:"application/x-java-jnlp-file",jpeg:"image/jpeg",jpg:"image/jpeg",m3u:"audio/x-mpegurl",m4v:"video/mp4",mathml:"application/mathml+xml",mid:"audio/midi",midi:"audio/midi",mov:"video/quicktime",mp3:"audio/mpeg",mp4:"video/mp4",mp4v:"video/mp4",mpeg:"video/mpeg",mpg:"video/mpeg",odp:"application/vnd.oasis.opendocument.presentation",ods:"application/vnd.oasis.opendocument.spreadsheet",odt:"application/vnd.oasis.opendocument.text",ogg:"application/ogg",pdf:"application/pdf",png:"image/png",pps:"application/vnd.ms-powerpoint",ppt:"application/vnd.ms-powerpoint",ps:"application/postscript",qt:"video/quicktime",rdf:"application/rdf+xml",rss:"application/rss+xml",rtf:"application/rtf",svg:"image/svg+xml",swf:"application/x-shockwave-flash",text:"text/plain",tif:"image/tiff",tiff:"image/tiff",txt:"text/plain",wav:"audio/x-wav",wma:"audio/x-ms-wma",wmv:"video/x-ms-wmv",xml:"application/xml",zip:"application/zip",detectFromFilename:function(e){let t=e.toLowerCase();return t=eb(t),$Pe[t]}},fse;typeof DOMParser<"u"&&(fse=new DOMParser);var xwt=new UK({stripPrefix:!1,email:!1,replaceFn:function(e){return e.urlMatchType==="scheme"||e.urlMatchType==="www"}}),WT=32,OPe=2414016,BPe=1,zPe=16093e3,HPe=.1,KPe=[null,void 0,"http://www.opengis.net/kml/2.2","http://earth.google.com/kml/2.2","http://earth.google.com/kml/2.1","http://earth.google.com/kml/2.0"],JPe=["http://www.google.com/kml/ext/2.2"],Twt=["http://www.w3.org/2005/Atom"],De={kml:KPe,gx:JPe,atom:Twt,kmlgx:KPe.concat(JPe)},pse={Document:lXe,Folder:Mwt,Placemark:wwt,NetworkLink:Jwt,GroundOverlay:zwt,PhotoOverlay:mXe,ScreenOverlay:Bwt,Tour:Uwt},lse=class{constructor(t){this._dataSource=t,this._deferred=Cd(),this._stack=[],this._promises=[],this._timeoutSet=!1,this._used=!1,this._started=0,this._timeThreshold=1e3}get dataSource(){return this._dataSource}addNodes(t,n){this._stack.push({nodes:t,index:0,processingData:n}),this._used=!0}addPromise(t){this._promises.push(t)}wait(){let t=this._deferred;return this._used||t.resolve(),Promise.all([t.promise,Promise.all(this._promises)])}process(){let t=this._stack.length===1;return t&&(this._started=ly._getTimestamp()),this._process(t)}_giveUpTime(){if(this._timeoutSet)return;this._timeoutSet=!0,this._timeThreshold=50;let t=this;setTimeout(function(){t._timeoutSet=!1,t._started=ly._getTimestamp(),t._process(!0)},0)}_nextNode(){let t=this._stack,n=t[t.length-1],i=n.index,o=n.nodes;if(i!==o.length)return++n.index,o[i]}_pop(){let t=this._stack;return t.pop(),t.length===0?(this._deferred.resolve(),!1):!0}_process(t){let n=this.dataSource,i=this._stack[this._stack.length-1].processingData,o=this._nextNode();for(;l(o);){let r=pse[o.localName];if(l(r)&&(De.kml.indexOf(o.namespaceURI)!==-1||De.gx.indexOf(o.namespaceURI)!==-1)&&(r(n,o,i,this),this._timeoutSet||ly._getTimestamp()>this._started+this._timeThreshold)){this._giveUpTime();return}o=this._nextNode()}this._pop()&&t&&this._process(!0)}};function _wt(e){let t=e.slice(0,Math.min(4,e.size)),n=Cd(),i=new FileReader;return i.addEventListener("load",function(){n.resolve(new DataView(i.result).getUint32(0,!1)===1347093252)}),i.addEventListener("error",function(){n.reject(i.error)}),i.readAsArrayBuffer(t),n.promise}function Swt(e){let t=Cd(),n=new FileReader;return n.addEventListener("load",function(){t.resolve(n.result)}),n.addEventListener("error",function(){t.reject(n.error)}),n.readAsText(e),t.promise}function eXe(e){let t={xsi:"http://www.w3.org/2001/XMLSchema-instance"},n,i,o,r;for(let s in t)t.hasOwnProperty(s)&&(o=RegExp(`[< ]${s}:`),r=`xmlns:${s}=`,o.test(e)&&e.indexOf(r)===-1&&(l(n)||(n=e.substr(0,e.indexOf("<kml")+4),i=e.substr(n.length)),n+=` ${r}"${t[s]}"`));return l(n)&&(e=n+i),e}function tXe(e){let t=e.indexOf("xmlns:"),n=e.indexOf(">",t),i,o,r;for(;t!==-1&&t<n;)i=e.slice(t,e.indexOf('"',t)),o=t,t=e.indexOf(i,t+1),t!==-1?(r=e.indexOf('"',e.indexOf('"',t)+1),e=e.slice(0,t-1)+e.slice(r+1,e.length),t=e.indexOf("xmlns:",o-1)):t=e.indexOf("xmlns:",o+1);return e}async function Zwt(e,t){let n=await e.getData(new Xk);n=eXe(n),n=tXe(n),t.kml=fse.parseFromString(n,"application/xml")}async function rse(e,t){let n=$Pe.detectFromFilename(e.filename)??"application/octet-stream",i=await e.getData(new Ik(n));t[e.filename]=i}function lm(e,t,n,i){let o=i.keys,r=new hU.default("."),s=e.querySelectorAll(t);for(let a=0;a<s.length;a++){let c=s[a],d=c.getAttribute(n);if(l(d)){let m=new hU.default(d).absoluteTo(r).toString(),p=o.indexOf(m);if(p!==-1){let b=o[p];c.setAttribute(n,i[b]),t==="a"&&c.getAttribute("download")===null&&c.setAttribute("download",b)}}}}function dm(e,t,n,i){let o=e.querySelectorAll(t);for(let r=0;r<o.length;r++){let s=o[r],a=s.getAttribute(n),c=bse(a,i);l(c)&&s.setAttribute(n,c.url)}}function nXe(e,t,n){let i=Wa(e,"id");i=l(i)&&i.length!==0?i:Qn(),l(n)&&(i=n+i);let o=t.getById(i);return l(o)&&(i=Qn(),l(n)&&(i=n+i)),o=t.add(new er({id:i})),l(o.kml)||(o.addProperty("kml"),o.kml=new hse),o}function fU(e,t){return e==="absolute"||e==="relativeToGround"||t==="relativeToSeaFloor"}function JK(e,t){if(!l(e))return h.fromDegrees(0,0,0,t);let n=e.match(/[^\s,\n]+/g);if(!l(n))return h.fromDegrees(0,0,0,t);let i=parseFloat(n[0]),o=parseFloat(n[1]),r=parseFloat(n[2]);return i=isNaN(i)?0:i,o=isNaN(o)?0:o,r=isNaN(r)?0:r,h.fromDegrees(i,o,r,t)}function zK(e,t){if(!l(e))return;let n=e.textContent.match(/[^\s\n]+/g);if(!l(n))return;let i=n.length,o=new Array(i),r=0;for(let s=0;s<i;s++)o[r++]=JK(n[s],t);return o}function vT(e,t){if(!l(e))return;let n=e.getAttribute(t);if(n!==null){let i=parseFloat(n);return isNaN(i)?void 0:i}}function Wa(e,t){if(!l(e))return;let n=e.getAttribute(t);return n!==null?n:void 0}function lo(e,t,n){if(!l(e))return;let i=e.childNodes,o=i.length;for(let r=0;r<o;r++){let s=i[r];if(s.localName===t&&n.indexOf(s.namespaceURI)!==-1)return s}}function jPe(e,t,n){if(!l(e))return;let i=[],o=e.getElementsByTagNameNS("*",t),r=o.length;for(let s=0;s<r;s++){let a=o[s];a.localName===t&&n.indexOf(a.namespaceURI)!==-1&&i.push(a)}return i}function ip(e,t,n){if(!l(e))return[];let i=[],o=e.childNodes,r=o.length;for(let s=0;s<r;s++){let a=o[s];a.localName===t&&n.indexOf(a.namespaceURI)!==-1&&i.push(a)}return i}function Ai(e,t,n){let i=lo(e,t,n);if(l(i)){let o=parseFloat(i.textContent);return isNaN(o)?void 0:o}}function Yn(e,t,n){let i=lo(e,t,n);if(l(i))return i.textContent.trim()}function op(e,t,n){let i=lo(e,t,n);if(l(i)){let o=i.textContent.trim();return o==="1"||/^true$/i.test(o)}}function bse(e,t,n){if(!l(e))return;let i;if(l(n)){e=e.replace(/\\/g,"/");let o=n[e];if(l(o))i=new ve({url:o});else{let r=new hU.default(t.getUrlComponent()),s=new hU.default(e);o=n[s.absoluteTo(r)],l(o)&&(i=new ve({url:o}))}}return l(i)||(i=t.getDerivedResource({url:e})),i}var lu={maximumRed:void 0,red:void 0,maximumGreen:void 0,green:void 0,maximumBlue:void 0,blue:void 0};function dse(e,t){if(!l(e)||/^\s*$/gm.test(e))return;e[0]==="#"&&(e=e.substring(1));let n=parseInt(e.substring(0,2),16)/255,i=parseInt(e.substring(2,4),16)/255,o=parseInt(e.substring(4,6),16)/255,r=parseInt(e.substring(6,8),16)/255;return t?(r>0?(lu.maximumRed=r,lu.red=void 0):(lu.maximumRed=void 0,lu.red=0),o>0?(lu.maximumGreen=o,lu.green=void 0):(lu.maximumGreen=void 0,lu.green=0),i>0?(lu.maximumBlue=i,lu.blue=void 0):(lu.maximumBlue=void 0,lu.blue=0),lu.alpha=n,U.fromRandom(lu)):new U(r,o,i,n)}function CR(e,t,n){let i=Yn(e,t,n);if(l(i))return dse(i,Yn(e,"colorMode",n)==="random")}function Rwt(e){let t=lo(e,"TimeStamp",De.kmlgx),n=Yn(t,"when",De.kmlgx);if(!l(t)||!l(n)||n.length===0)return;let i=Q.fromIso8601(n),o=new Es;return o.addInterval(new Cn({start:i,stop:ot.MAXIMUM_VALUE})),o}function Cwt(e){let t=lo(e,"TimeSpan",De.kmlgx);if(!l(t))return;let n,i=lo(t,"begin",De.kmlgx),o=l(i)?Q.fromIso8601(i.textContent):void 0,r=lo(t,"end",De.kmlgx),s=l(r)?Q.fromIso8601(r.textContent):void 0;if(l(o)&&l(s)){if(Q.lessThan(s,o)){let a=o;o=s,s=a}n=new Es,n.addInterval(new Cn({start:o,stop:s}))}else l(o)?(n=new Es,n.addInterval(new Cn({start:o,stop:ot.MAXIMUM_VALUE}))):l(s)&&(n=new Es,n.addInterval(new Cn({start:ot.MINIMUM_VALUE,stop:s})));return n}function iXe(){let e=new el;return e.width=WT,e.height=WT,e.scaleByDistance=new Kt(OPe,BPe,zPe,HPe),e.pixelOffsetScaleByDistance=new Kt(OPe,BPe,zPe,HPe),e}function gse(){let e=new $h;return e.outline=!0,e.outlineColor=U.WHITE,e}function oXe(){let e=new qh;return e.translucencyByDistance=new Kt(3e6,1,5e6,0),e.pixelOffset=new k(17,0),e.horizontalOrigin=Di.LEFT,e.font="16px sans-serif",e.style=yr.FILL_AND_OUTLINE,e}function yse(e,t,n,i,o){let r=Yn(e,"href",De.kml);if(!l(r)||r.length===0)return;if(r.indexOf("root://icons/palette-")===0){let a=r.charAt(21),c=Ai(e,"x",De.gx)??0,d=Ai(e,"y",De.gx)??0;c=Math.min(c/32,7),d=7-Math.min(d/32,7);let u=8*d+c;r=`https://maps.google.com/mapfiles/kml/pal${a}/icon${u}.png`}let s=bse(r,n,i);if(o){let a=Yn(e,"refreshMode",De.kml),c=Yn(e,"viewRefreshMode",De.kml);a==="onInterval"||a==="onExpire"?xt(`kml-refreshMode-${a}`,`KML - Unsupported Icon refreshMode: ${a}`):(c==="onStop"||c==="onRegion")&&xt(`kml-refreshMode-${c}`,`KML - Unsupported Icon viewRefreshMode: ${c}`);let d=Yn(e,"viewBoundScale",De.kml)??1,u=c==="onStop"?"BBOX=[bboxWest],[bboxSouth],[bboxEast],[bboxNorth]":"",m=Yn(e,"viewFormat",De.kml)??u,p=Yn(e,"httpQuery",De.kml);l(m)&&s.setQueryParameters(yu(KK(m))),l(p)&&s.setQueryParameters(yu(KK(p)));let b=t._ellipsoid;return Tse(s,t.camera,t.canvas,d,t._lastCameraView.bbox,b),s}return s}function Vwt(e,t,n,i,o){let r=Ai(t,"scale",De.kml),s=Ai(t,"heading",De.kml),a=CR(t,"color",De.kml),c=lo(t,"Icon",De.kml),d=yse(c,e,i,o,!1);l(c)&&!l(d)&&(d=!1);let u=Ai(c,"x",De.gx),m=Ai(c,"y",De.gx),p=Ai(c,"w",De.gx),b=Ai(c,"h",De.gx),f=lo(t,"hotSpot",De.kml),y=vT(f,"x"),_=vT(f,"y"),S=Wa(f,"xunits"),Z=Wa(f,"yunits"),R=n.billboard;l(R)||(R=iXe(),n.billboard=R),R.image=d,R.scale=r,R.color=a,(l(u)||l(m)||l(p)||l(b))&&(R.imageSubRegion=new nt(u,m,p,b)),l(s)&&s!==0&&(R.rotation=W.toRadians(-s),R.alignedAxis=h.UNIT_Z),r=r??1;let C,E;l(y)&&(S==="pixels"?C=-y*r:S==="insetPixels"?C=(y-WT)*r:S==="fraction"&&(C=-y*WT*r),C+=WT*.5*r),l(_)&&(Z==="pixels"?E=_*r:Z==="insetPixels"?E=(-_+WT)*r:Z==="fraction"&&(E=_*WT*r),E-=WT*.5*r),(l(C)||l(E))&&(R.pixelOffset=new k(C,E))}function HK(e,t,n,i,o){for(let r=0,s=t.childNodes.length;r<s;r++){let a=t.childNodes.item(r);if(a.localName==="IconStyle")Vwt(e,a,n,i,o);else if(a.localName==="LabelStyle"){let c=n.label;l(c)||(c=oXe(),n.label=c),c.scale=Ai(a,"scale",De.kml)??c.scale,c.fillColor=CR(a,"color",De.kml)??c.fillColor,c.text=n.name}else if(a.localName==="LineStyle"){let c=n.polyline;l(c)||(c=new tl,n.polyline=c),c.width=Ai(a,"width",De.kml),c.material=CR(a,"color",De.kml),l(CR(a,"outerColor",De.gx))&&xt("kml-gx:outerColor","KML - gx:outerColor is not supported in a LineStyle"),l(Ai(a,"outerWidth",De.gx))&&xt("kml-gx:outerWidth","KML - gx:outerWidth is not supported in a LineStyle"),l(Ai(a,"physicalWidth",De.gx))&&xt("kml-gx:physicalWidth","KML - gx:physicalWidth is not supported in a LineStyle"),l(op(a,"labelVisibility",De.gx))&&xt("kml-gx:labelVisibility","KML - gx:labelVisibility is not supported in a LineStyle")}else if(a.localName==="PolyStyle"){let c=n.polygon;l(c)||(c=gse(),n.polygon=c),c.material=CR(a,"color",De.kml)??c.material,c.fill=op(a,"fill",De.kml)??c.fill,c.outline=op(a,"outline",De.kml)??c.outline}else if(a.localName==="BalloonStyle"){let c=dse(Yn(a,"bgColor",De.kml))??U.WHITE,d=dse(Yn(a,"textColor",De.kml))??U.BLACK,u=Yn(a,"text",De.kml);n.addProperty("balloonStyle"),n.balloonStyle={bgColor:c,textColor:d,text:u}}else if(a.localName==="ListStyle"){let c=Yn(a,"listItemType",De.kml);(c==="radioFolder"||c==="checkOffOnly")&&xt(`kml-listStyle-${c}`,`KML - Unsupported ListStyle with listItemType: ${c}`)}}}function Ewt(e,t,n,i,o){let r=new er,s,a=-1,c=t.childNodes,d=c.length;for(let m=0;m<d;m++){let p=c[m];(p.localName==="Style"||p.localName==="StyleMap")&&(a=m)}if(a!==-1){let m=c[a];if(m.localName==="Style")HK(e,m,r,i,o);else{let p=ip(m,"Pair",De.kml);for(let b=0;b<p.length;b++){let f=p[b],y=Yn(f,"key",De.kml);if(y==="normal"){let _=Yn(f,"styleUrl",De.kml);if(l(_))s=n.getById(_),l(s)||(s=n.getById(`#${_}`)),l(s)&&r.merge(s);else{let S=lo(f,"Style",De.kml);HK(e,S,r,i,o)}}else xt(`kml-styleMap-${y}`,`KML - Unsupported StyleMap key: ${y}`)}}}let u=Yn(t,"styleUrl",De.kml);if(l(u)){let m=u;if(u[0]!=="#"&&u.indexOf("#")!==-1){let p=u.split("#"),b=p[0];m=`${i.getDerivedResource({url:b}).getUrlComponent()}#${p[1]}`}s=n.getById(m),l(s)||(s=n.getById(`#${m}`)),l(s)&&r.merge(s)}return r}function Awt(e,t,n){return t.fetchXML().then(function(i){return rXe(e,i,n,t,!0)})}function rXe(e,t,n,i,o,r){let s,a,c,d,u=jPe(t,"Style",De.kml);if(l(u)){let y=u.length;for(s=0;s<y;s++)d=u[s],a=Wa(d,"id"),l(a)&&(a=`#${a}`,o&&l(i)&&(a=i.getUrlComponent()+a),l(n.getById(a))||(c=new er({id:a}),n.add(c),HK(e,d,c,i,r)))}let m=jPe(t,"StyleMap",De.kml);if(l(m)){let y=m.length;for(s=0;s<y;s++){let _=m[s];if(a=Wa(_,"id"),l(a)){let S=ip(_,"Pair",De.kml);for(let Z=0;Z<S.length;Z++){let R=S[Z],C=Yn(R,"key",De.kml);if(C==="normal"){if(a=`#${a}`,o&&l(i)&&(a=i.getUrlComponent()+a),!l(n.getById(a))){c=n.getOrCreateEntity(a);let E=Yn(R,"styleUrl",De.kml);if(l(E)){E[0]!=="#"&&(E=`#${E}`),o&&l(i)&&(E=i.getUrlComponent()+E);let A=n.getById(E);l(A)&&c.merge(A)}else d=lo(R,"Style",De.kml),HK(e,d,c,i,r)}}else xt(`kml-styleMap-${C}`,`KML - Unsupported StyleMap key: ${C}`)}}}}let p=[],b=t.getElementsByTagName("styleUrl"),f=b.length;for(s=0;s<f;s++){let y=b[s].textContent;if(y[0]!=="#"){let _=y.split("#");if(_.length===2){let S=_[0],Z=i.getDerivedResource({url:S});p.push(Awt(e,Z,n))}}}return p}function xse(e,t,n){let i=new Ag(e,t.id,["position"]),o=new l0(t.position);t.polyline=l(n.polyline)?n.polyline.clone():new tl,t.polyline.positions=new Kg([i,o])}function sXe(e,t){return!l(e)&&!l(t)||e==="clampToGround"?He.CLAMP_TO_GROUND:e==="relativeToGround"?He.RELATIVE_TO_GROUND:e==="absolute"?He.NONE:t==="clampToSeaFloor"?(xt("kml-gx:altitudeMode-clampToSeaFloor","KML - <gx:altitudeMode>:clampToSeaFloor is currently not supported, using <kml:altitudeMode>:clampToGround."),He.CLAMP_TO_GROUND):t==="relativeToSeaFloor"?(xt("kml-gx:altitudeMode-relativeToSeaFloor","KML - <gx:altitudeMode>:relativeToSeaFloor is currently not supported, using <kml:altitudeMode>:relativeToGround."),He.RELATIVE_TO_GROUND):(l(e)?xt("kml-altitudeMode-unknown",`KML - Unknown <kml:altitudeMode>:${e}, using <kml:altitudeMode>:CLAMP_TO_GROUND.`):xt("kml-gx:altitudeMode-unknown",`KML - Unknown <gx:altitudeMode>:${t}, using <kml:altitudeMode>:CLAMP_TO_GROUND.`),He.CLAMP_TO_GROUND)}function Gwt(e,t,n){return n==="relativeToSeaFloor"||t==="absolute"||t==="relativeToGround"?e:((l(t)&&t!=="clampToGround"||l(n)&&n!=="clampToSeaFloor")&&xt("kml-altitudeMode-unknown",`KML - Unknown altitudeMode: ${t??n}`),new l0(e))}function Lwt(e,t,n,i){if(!l(e))return;if(n==="relativeToSeaFloor"||t==="absolute"||t==="relativeToGround")return e;(l(t)&&t!=="clampToGround"||l(n)&&n!=="clampToSeaFloor")&&xt("kml-altitudeMode-unknown",`KML - Unknown altitudeMode: ${t??n}`);let o=e.length;for(let r=0;r<o;r++){let s=e[r];i.scaleToGeodeticSurface(s,s)}return e}function jK(e,t,n,i){let o=t.label;l(o)||(o=l(n.label)?n.label.clone():oXe(),t.label=o),o.text=t.name;let r=t.billboard;if(l(r)||(r=l(n.billboard)?n.billboard.clone():iXe(),t.billboard=r),l(r.image)?r.image.getValue()||(r.image=void 0):r.image=e._pinBuilder.fromColor(U.YELLOW,64),l(r.scale)){let s=r.scale.getValue();s!==0?o.pixelOffset=new k(s*16+1,0):(o.pixelOffset=void 0,o.horizontalOrigin=void 0)}l(i)&&e._clampToGround&&(r.heightReference=i,o.heightReference=i)}function aXe(e,t){let n=e.path;l(n)||(n=new Vb,n.leadTime=0,e.path=n);let i=t.polyline;l(i)&&(n.material=i.material,n.width=i.width)}function Wwt(e,t,n,i,o){let r=Yn(n,"coordinates",De.kml),s=Yn(n,"altitudeMode",De.kml),a=Yn(n,"altitudeMode",De.gx),c=op(n,"extrude",De.kml),d=e._ellipsoid,u=JK(r,d);return i.position=u,jK(e,i,o,sXe(s,a)),c&&fU(s,a)&&xse(t,i,o),!0}function QPe(e,t,n,i,o){let r=lo(n,"coordinates",De.kml),s=Yn(n,"altitudeMode",De.kml),a=Yn(n,"altitudeMode",De.gx),c=op(n,"extrude",De.kml),d=op(n,"tessellate",De.kml),u=fU(s,a),m=Ai(n,"drawOrder",De.gx),p=e._ellipsoid,b=zK(r,p),f=o.polyline;if(u&&c){let y=new Eb;i.wall=y,y.positions=b;let _=o.polygon;l(_)&&(y.fill=_.fill,y.material=_.material),y.outline=!0,l(f)?(y.outlineColor=l(f.material)?f.material.color:U.WHITE,y.outlineWidth=f.width):l(_)&&(y.outlineColor=l(_.material)?_.material.color:U.WHITE)}else if(e._clampToGround&&!u&&d){let y=new tl;y.clampToGround=!0,i.polyline=y,y.positions=b,l(f)?(y.material=l(f.material)?f.material.color.getValue(ot.MINIMUM_VALUE):U.WHITE,y.width=f.width??1):(y.material=U.WHITE,y.width=1),y.zIndex=m}else l(m)&&xt("kml-gx:drawOrder","KML - gx:drawOrder is not supported in LineStrings when clampToGround is false"),e._clampToGround&&!d&&xt("kml-line-tesselate","Ignoring clampToGround for KML lines without the tessellate flag."),f=l(f)?f.clone():new tl,i.polyline=f,f.positions=Lwt(b,s,a,p),(!d||u)&&(f.arcType=un.NONE);return!0}function vwt(e,t,n,i,o){let r=lo(n,"outerBoundaryIs",De.kml),s=lo(r,"LinearRing",De.kml),a=lo(s,"coordinates",De.kml),c=e._ellipsoid,d=zK(a,c),u=op(n,"extrude",De.kml),m=Yn(n,"altitudeMode",De.kml),p=Yn(n,"altitudeMode",De.gx),b=fU(m,p),f=l(o.polygon)?o.polygon.clone():gse(),y=o.polyline;if(l(y)&&(f.outlineColor=l(y.material)?y.material.color:U.WHITE,f.outlineWidth=y.width),i.polygon=f,b?(f.perPositionHeight=!0,f.extrudedHeight=u?0:void 0):e._clampToGround||(f.height=0),l(d)){let _=new Wc(d),S=ip(n,"innerBoundaryIs",De.kml);for(let Z=0;Z<S.length;Z++){s=ip(S[Z],"LinearRing",De.kml);for(let R=0;R<s.length;R++)a=lo(s[R],"coordinates",De.kml),d=zK(a,c),l(d)&&_.holes.push(new Wc(d))}f.hierarchy=_}return!0}function Fwt(e,t,n,i,o){let r=Yn(n,"altitudeMode",De.kml),s=Yn(n,"altitudeMode",De.gx),a=ip(n,"coord",De.gx),c=ip(n,"angles",De.gx),d=ip(n,"when",De.kml),u=op(n,"extrude",De.kml),m=fU(r,s),p=e._ellipsoid;c.length>0&&xt("kml-gx:angles","KML - gx:angles are not supported in gx:Tracks");let b=Math.min(a.length,d.length),f=[],y=[];for(let S=0;S<b;S++){let Z=JK(a[S].textContent,p);f.push(Z),y.push(Q.fromIso8601(d[S].textContent))}let _=new bc;return _.addSamples(y,f),i.position=_,jK(e,i,o,sXe(r,s)),aXe(i,o),i.availability=new Es,d.length>0&&i.availability.addInterval(new Cn({start:y[0],stop:y[y.length-1]})),m&&u&&xse(t,i,o),!0}function qPe(e,t,n,i,o,r,s,a,c){let d=e[0],u=e[e.length-1],m=new bc;m.addSamples(e,t),n.intervals.addInterval(new Cn({start:d,stop:u,isStartIncluded:c,isStopIncluded:c,data:Gwt(m,s,a)})),i.addInterval(new Cn({start:d,stop:u,isStartIncluded:c,isStopIncluded:c})),o.intervals.addInterval(new Cn({start:d,stop:u,isStartIncluded:c,isStopIncluded:c,data:r}))}function Iwt(e,t,n,i,o){let r=op(n,"interpolate",De.gx),s=ip(n,"Track",De.gx),a,c,d,u=!1,m=new Jg,p=new Es,b=new pc,f=e._ellipsoid;for(let y=0,_=s.length;y<_;y++){let S=s[y],Z=ip(S,"when",De.kml),R=ip(S,"coord",De.gx),C=Yn(S,"altitudeMode",De.kml),E=Yn(S,"altitudeMode",De.gx),A=fU(C,E),L=op(S,"extrude",De.kml),F=Math.min(R.length,Z.length),I=[];a=[];for(let N=0;N<F;N++){let g=JK(R[N].textContent,f);I.push(g),a.push(Q.fromIso8601(Z[N].textContent))}r&&(l(c)&&qPe([c,a[0]],[d,I[0]],b,p,m,!1,"absolute",void 0,!1),c=a[F-1],d=I[I.length-1]),qPe(a,I,b,p,m,A&&L,C,E,!0),u=u||A&&L}return i.availability=p,i.position=b,jK(e,i,o),aXe(i,o),u&&(xse(t,i,o),i.polyline.show=m),!0}var cXe={Point:Wwt,LineString:QPe,LinearRing:QPe,Polygon:vwt,Track:Fwt,MultiTrack:Iwt,MultiGeometry:Pwt,Model:Xwt};function Pwt(e,t,n,i,o,r){let s=n.childNodes,a=!1;for(let c=0,d=s.length;c<d;c++){let u=s.item(c),m=cXe[u.localName];if(l(m)){let p=nXe(u,t,r);p.parent=i,p.name=i.name,p.availability=i.availability,p.description=i.description,p.kml=i.kml,m(e,t,u,p,o)&&(a=!0)}}return a}function Xwt(e,t,n,i,o){return xt("kml-unsupportedGeometry",`KML - Unsupported geometry: ${n.localName}`),!1}function Nwt(e,t){let n=lo(e,"ExtendedData",De.kml);if(!l(n))return;l(lo(n,"SchemaData",De.kml))&&xt("kml-schemaData","KML - SchemaData is unsupported"),l(Wa(n,"xmlns:prefix"))&&xt("kml-extendedData","KML - ExtendedData with xmlns:prefix is unsupported");let i={},o=ip(n,"Data",De.kml);if(l(o)){let r=o.length;for(let s=0;s<r;s++){let a=o[s],c=Wa(a,"name");l(c)&&(i[c]={displayName:Yn(a,"displayName",De.kml),value:Yn(a,"value",De.kml)})}}t.kml.extendedData=i}var Ho;typeof document<"u"&&(Ho=document.createElement("div"));function Ywt(e,t,n,i,o){let r,s,a,c=t.kml,d=c.extendedData,u=Yn(e,"description",De.kml),m=t.balloonStyle??n.balloonStyle,p=U.WHITE,b=U.BLACK,f=u;l(m)&&(p=m.bgColor??U.WHITE,b=m.textColor??U.BLACK,f=m.text??u);let y;if(l(f)){if(f=f.replace("$[name]",t.name??""),f=f.replace("$[description]",u??""),f=f.replace("$[address]",c.address??""),f=f.replace("$[Snippet]",c.snippet??""),f=f.replace("$[id]",t.id),f=f.replace("$[geDirections]",""),l(d)){let Z=f.match(/\$\[.+?\]/g);if(Z!==null)for(r=0;r<Z.length;r++){let R=Z[r],C=R.substr(2,R.length-3),E=/\/displayName$/.test(C);C=C.replace(/\/displayName$/,""),y=d[C],l(y)&&(y=E?y.displayName:y.value),l(y)&&(f=f.replace(R,y??""))}}}else if(l(d)&&(a=Object.keys(d),a.length>0)){for(f='<table class="cesium-infoBox-defaultTable cesium-infoBox-defaultTable-lighter"><tbody>',r=0;r<a.length;r++)s=a[r],y=d[s],f+=`<tr><th>${y.displayName??s}</th><td>${y.value??""}</td></tr>`;f+="</tbody></table>"}if(!l(f))return;f=xwt.link(f),Ho.innerHTML=f;let _=Ho.querySelectorAll("a");for(r=0;r<_.length;r++)_[r].setAttribute("target","_blank");l(i)&&i.keys.length>1&&(lm(Ho,"a","href",i),lm(Ho,"link","href",i),lm(Ho,"area","href",i),lm(Ho,"img","src",i),lm(Ho,"iframe","src",i),lm(Ho,"video","src",i),lm(Ho,"audio","src",i),lm(Ho,"source","src",i),lm(Ho,"track","src",i),lm(Ho,"input","src",i),lm(Ho,"embed","src",i),lm(Ho,"script","src",i),lm(Ho,"video","poster",i)),dm(Ho,"a","href",o),dm(Ho,"link","href",o),dm(Ho,"area","href",o),dm(Ho,"img","src",o),dm(Ho,"iframe","src",o),dm(Ho,"video","src",o),dm(Ho,"audio","src",o),dm(Ho,"source","src",o),dm(Ho,"track","src",o),dm(Ho,"input","src",o),dm(Ho,"embed","src",o),dm(Ho,"script","src",o),dm(Ho,"video","poster",o);let S='<div class="cesium-infoBox-description-lighter" style="';S+="overflow:auto;",S+="word-wrap:break-word;",S+=`background-color:${p.toCssColorString()};`,S+=`color:${b.toCssColorString()};`,S+='">',S+=`${Ho.innerHTML}</div>`,Ho.innerHTML="",t.description=S}function QK(e,t,n){let i=n.entityCollection,o=n.parentEntity,r=n.sourceResource,s=n.uriResolver,a=nXe(t,i,n.context),c=a.kml,d=Ewt(e,t,n.styleCollection,r,s),u=Yn(t,"name",De.kml);a.name=u,a.parent=o;let m=Cwt(t);l(m)||(m=Rwt(t)),a.availability=m,_se(a);function p(R){return R?R.show&&p(R.parent):!0}let b=op(t,"visibility",De.kml);a.show=p(o)&&(b??!0);let f=lo(t,"author",De.atom),y=c.author;y.name=Yn(f,"name",De.atom),y.uri=Yn(f,"uri",De.atom),y.email=Yn(f,"email",De.atom);let _=lo(t,"link",De.atom),S=c.link;S.href=Wa(_,"href"),S.hreflang=Wa(_,"hreflang"),S.rel=Wa(_,"rel"),S.type=Wa(_,"type"),S.title=Wa(_,"title"),S.length=Wa(_,"length"),c.address=Yn(t,"address",De.kml),c.phoneNumber=Yn(t,"phoneNumber",De.kml),c.snippet=Yn(t,"Snippet",De.kml),Nwt(t,a),Ywt(t,a,d,s,r);let Z=e._ellipsoid;return uXe(t,a,Z),dXe(t,a,Z),l(lo(t,"Region",De.kml))&&xt("kml-region","KML - Placemark Regions are unsupported"),{entity:a,styleEntity:d}}function lXe(e,t,n,i){i.addNodes(t.childNodes,n),i.process()}function Mwt(e,t,n,i){let o=QK(e,t,n),r=$e(n);r.parentEntity=o.entity,lXe(e,t,r,i)}function wwt(e,t,n,i){let o=QK(e,t,n),r=o.entity,s=o.styleEntity,a=!1,c=t.childNodes;for(let d=0,u=c.length;d<u&&!a;d++){let m=c.item(d),p=cXe[m.localName];l(p)&&(p(e,n.entityCollection,m,r,s,r.id),a=!0)}a||(r.merge(s),jK(e,r,s))}var kwt={FlyTo:Owt,Wait:Dwt,SoundCue:sse,AnimatedUpdate:sse,TourControl:sse};function Uwt(e,t,n,i){let o=Yn(t,"name",De.kml),r=Wa(t,"id"),s=new dU(o,r),a=lo(t,"Playlist",De.gx);if(a){let c=e._ellipsoid,d=a.childNodes;for(let u=0;u<d.length;u++){let m=d[u];if(m.localName){let p=kwt[m.localName];p?p(s,m,c):console.log(`Unknown KML Tour playlist entry type ${m.localName}`)}}}e._kmlTours.push(s)}function sse(e,t){xt(`KML Tour unsupported node ${t.localName}`)}function Dwt(e,t){let n=Ai(t,"duration",De.gx);e.addPlaylistEntry(new mU(n))}function Owt(e,t,n){let i=Ai(t,"duration",De.gx),o=Yn(t,"flyToMode",De.gx),r={kml:{}};uXe(t,r,n),dXe(t,r,n);let s=r.kml.lookAt||r.kml.camera,a=new uU(i,o,s);e.addPlaylistEntry(a)}function dXe(e,t,n){let i=lo(e,"Camera",De.kml);if(l(i)){let o=Ai(i,"longitude",De.kml)??0,r=Ai(i,"latitude",De.kml)??0,s=Ai(i,"altitude",De.kml)??0,a=Ai(i,"heading",De.kml)??0,c=Ai(i,"tilt",De.kml)??0,d=Ai(i,"roll",De.kml)??0,u=h.fromDegrees(o,r,s,n),m=Cc.fromDegrees(a,c-90,d);t.kml.camera=new cU(u,m)}}function uXe(e,t,n){let i=lo(e,"LookAt",De.kml);if(l(i)){let o=Ai(i,"longitude",De.kml)??0,r=Ai(i,"latitude",De.kml)??0,s=Ai(i,"altitude",De.kml)??0,a=Ai(i,"heading",De.kml),c=Ai(i,"tilt",De.kml),d=Ai(i,"range",De.kml)??0;c=W.toRadians(c??0),a=W.toRadians(a??0);let u=new Am(a,c-W.PI_OVER_TWO,d),m=h.fromDegrees(o,r,s,n);t.kml.lookAt=new lU(m,u)}}function Bwt(e,t,n,i){let o=n.screenOverlayContainer;if(!l(o))return;let r=n.sourceResource,s=n.uriResolver,a=lo(t,"Icon",De.kml),c=yse(a,e,r,s,!1);if(!l(c))return;let d=document.createElement("img");e._screenOverlays.push(d),d.src=c.url,d.onload=function(){let u=["position: absolute"],m=lo(t,"screenXY",De.kml),p=lo(t,"overlayXY",De.kml),b=lo(t,"size",De.kml),f,y,_,S,Z,R;l(b)&&(f=vT(b,"x"),y=vT(b,"y"),_=Wa(b,"xunits"),S=Wa(b,"yunits"),l(f)&&f!==-1&&f!==0&&(_==="fraction"?Z=`width: ${Math.floor(f*100)}%`:_==="pixels"&&(Z=`width: ${f}px`),u.push(Z)),l(y)&&y!==-1&&y!==0&&(S==="fraction"?R=`height: ${Math.floor(y*100)}%`:S==="pixels"&&(R=`height: ${y}px`),u.push(R))),d.style=u.join(";");let C=0,E=d.height;l(p)&&(f=vT(p,"x"),y=vT(p,"y"),_=Wa(p,"xunits"),S=Wa(p,"yunits"),l(f)&&(_==="fraction"?C=f*d.width:(_==="pixels"||_==="insetPixels")&&(C=f)),l(y)&&(S==="fraction"?E=y*d.height:(S==="pixels"||S==="insetPixels")&&(E=y))),l(m)&&(f=vT(m,"x"),y=vT(m,"y"),_=Wa(m,"xunits"),S=Wa(m,"yunits"),l(f)&&(_==="fraction"?Z=`left: calc(${Math.floor(f*100)}% - ${C}px)`:_==="pixels"?Z=`left: ${f-C}px`:_==="insetPixels"&&(Z=`right: ${f-C}px`),u.push(Z)),l(y)&&(S==="fraction"?R=`bottom: calc(${Math.floor(y*100)}% - ${E}px)`:S==="pixels"?R=`bottom: ${y-E}px`:S==="insetPixels"&&(R=`top: ${y-E}px`),u.push(R))),d.style=u.join(";")},o.appendChild(d)}function zwt(e,t,n,i){let r=QK(e,t,n).entity,s,a=!1,c=e._ellipsoid,d=zK(lo(t,"LatLonQuad",De.gx),c),u=Ai(t,"drawOrder",De.kml);if(l(d))s=gse(),s.hierarchy=new Wc(d),s.zIndex=u,r.polygon=s,a=!0;else{s=new ef,s.zIndex=u,r.rectangle=s;let f=lo(t,"LatLonBox",De.kml);if(l(f)){let y=Ai(f,"west",De.kml),_=Ai(f,"south",De.kml),S=Ai(f,"east",De.kml),Z=Ai(f,"north",De.kml);l(y)&&(y=W.negativePiToPi(W.toRadians(y))),l(_)&&(_=W.clampToLatitudeRange(W.toRadians(_))),l(S)&&(S=W.negativePiToPi(W.toRadians(S))),l(Z)&&(Z=W.clampToLatitudeRange(W.toRadians(Z))),s.coordinates=new re(y,_,S,Z);let R=Ai(f,"rotation",De.kml);if(l(R)){let C=W.toRadians(R);s.rotation=C,s.stRotation=C}}}let m=lo(t,"Icon",De.kml),p=yse(m,e,n.sourceResource,n.uriResolver,!0);if(l(p)){a&&xt("kml-gx:LatLonQuad","KML - gx:LatLonQuad Icon does not support texture projection.");let f=Ai(m,"x",De.gx),y=Ai(m,"y",De.gx),_=Ai(m,"w",De.gx),S=Ai(m,"h",De.gx);(l(f)||l(y)||l(_)||l(S))&&xt("kml-groundOverlay-xywh","KML - gx:x, gx:y, gx:w, gx:h aren't supported for GroundOverlays"),s.material=p,s.material.color=CR(t,"color",De.kml),s.material.transparent=!0}else s.material=CR(t,"color",De.kml);let b=Yn(t,"altitudeMode",De.kml);l(b)?b==="absolute"?(s.height=Ai(t,"altitude",De.kml),s.zIndex=void 0):b!=="clampToGround"&&xt("kml-altitudeMode-unknown",`KML - Unknown altitudeMode: ${b}`):(b=Yn(t,"altitudeMode",De.gx),b==="relativeToSeaFloor"?(xt("kml-altitudeMode-relativeToSeaFloor","KML - altitudeMode relativeToSeaFloor is currently not supported, treating as absolute."),s.height=Ai(t,"altitude",De.kml),s.zIndex=void 0):b==="clampToSeaFloor"?xt("kml-altitudeMode-clampToSeaFloor","KML - altitudeMode clampToSeaFloor is currently not supported, treating as clampToGround."):l(b)&&xt("kml-altitudeMode-unknown",`KML - Unknown altitudeMode: ${b}`))}function mXe(e,t,n,i){e._unsupportedNode.raiseEvent(e,n.parentEntity,t,n.entityCollection,n.styleCollection,n.sourceResource,n.uriResolver),xt(`kml-unsupportedFeature-${t.nodeName}`,`KML - Unsupported feature: ${t.nodeName}`)}var FT={INTERVAL:0,EXPIRE:1,STOP:2};function KK(e){if(!l(e)||e.length===0)return"";let t=e[0];return(t==="&"||t==="?")&&(e=e.substring(1)),e}var Hwt=new re,yA=new pe,ase=new k,Kwt=new h;function Tse(e,t,n,i,o,r){function s(d){return d<-W.PI_OVER_TWO?-W.PI_OVER_TWO:d>W.PI_OVER_TWO?W.PI_OVER_TWO:d}function a(d){return d>W.PI?d-W.TWO_PI:d<-W.PI?d+W.TWO_PI:d}let c=e_(e.queryParameters);if(c=c.replace(/%5B/g,"[").replace(/%5D/g,"]"),l(t)&&t._mode!==se.MORPHING){let d,u;if(o=o??Hwt,l(n)&&(ase.x=n.clientWidth*.5,ase.y=n.clientHeight*.5,d=t.pickEllipsoid(ase,r,Kwt)),l(d)?u=r.cartesianToCartographic(d,yA):(u=re.center(o,yA),d=r.cartographicToCartesian(u)),l(i)&&!W.equalsEpsilon(i,1,W.EPSILON9)){let S=o.width*i*.5,Z=o.height*i*.5;o=new re(a(u.longitude-S),s(u.latitude-Z),a(u.longitude+S),s(u.latitude+Z))}c=c.replace("[bboxWest]",W.toDegrees(o.west).toString()),c=c.replace("[bboxSouth]",W.toDegrees(o.south).toString()),c=c.replace("[bboxEast]",W.toDegrees(o.east).toString()),c=c.replace("[bboxNorth]",W.toDegrees(o.north).toString());let m=W.toDegrees(u.longitude).toString(),p=W.toDegrees(u.latitude).toString();c=c.replace("[lookatLon]",m),c=c.replace("[lookatLat]",p),c=c.replace("[lookatTilt]",W.toDegrees(t.pitch).toString()),c=c.replace("[lookatHeading]",W.toDegrees(t.heading).toString()),c=c.replace("[lookatRange]",h.distance(t.positionWC,d)),c=c.replace("[lookatTerrainLon]",m),c=c.replace("[lookatTerrainLat]",p),c=c.replace("[lookatTerrainAlt]",u.height.toString()),r.cartesianToCartographic(t.positionWC,yA),c=c.replace("[cameraLon]",W.toDegrees(yA.longitude).toString()),c=c.replace("[cameraLat]",W.toDegrees(yA.latitude).toString()),c=c.replace("[cameraAlt]",W.toDegrees(yA.height).toString());let b=t.frustum,f=b.aspectRatio,y="",_="";if(l(f)){let S=W.toDegrees(b.fov);f>1?(y=S,_=S/f):(_=S,y=S*f)}c=c.replace("[horizFov]",y.toString()),c=c.replace("[vertFov]",_.toString())}else c=c.replace("[bboxWest]","-180"),c=c.replace("[bboxSouth]","-90"),c=c.replace("[bboxEast]","180"),c=c.replace("[bboxNorth]","90"),c=c.replace("[lookatLon]",""),c=c.replace("[lookatLat]",""),c=c.replace("[lookatRange]",""),c=c.replace("[lookatTilt]",""),c=c.replace("[lookatHeading]",""),c=c.replace("[lookatTerrainLon]",""),c=c.replace("[lookatTerrainLat]",""),c=c.replace("[lookatTerrainAlt]",""),c=c.replace("[cameraLon]",""),c=c.replace("[cameraLat]",""),c=c.replace("[cameraAlt]",""),c=c.replace("[horizFov]",""),c=c.replace("[vertFov]","");l(n)?(c=c.replace("[horizPixels]",n.clientWidth),c=c.replace("[vertPixels]",n.clientHeight)):(c=c.replace("[horizPixels]",""),c=c.replace("[vertPixels]","")),c=c.replace("[terrainEnabled]","1"),c=c.replace("[clientVersion]","1"),c=c.replace("[kmlVersion]","2.2"),c=c.replace("[clientName]","Cesium"),c=c.replace("[language]","English"),e.setQueryParameters(yu(c))}function Jwt(e,t,n,i){let r=QK(e,t,n).entity,s=n.sourceResource,a=n.uriResolver,c=lo(t,"Link",De.kml);if(l(c)||(c=lo(t,"Url",De.kml)),l(c)){let d=Yn(c,"href",De.kml),u,m;if(l(d)){let p=d;if(d=bse(d,s,n.uriResolver),/^data:/.test(d.getUrlComponent()))/\.kmz/i.test(s.getUrlComponent())||(p=s.getDerivedResource({url:p}));else{if(p=d.clone(),u=Yn(c,"viewRefreshMode",De.kml),u==="onRegion"){xt("kml-refrehMode-onRegion","KML - Unsupported viewRefreshMode: onRegion");return}m=Yn(c,"viewBoundScale",De.kml)??1;let _=u==="onStop"?"BBOX=[bboxWest],[bboxSouth],[bboxEast],[bboxNorth]":"",S=Yn(c,"viewFormat",De.kml)??_,Z=Yn(c,"httpQuery",De.kml);l(S)&&d.setQueryParameters(yu(KK(S))),l(Z)&&d.setQueryParameters(yu(KK(Z)));let R=e._ellipsoid;Tse(d,e.camera,e.canvas,m,e._lastCameraView.bbox,R)}let b={sourceUri:p,uriResolver:a,context:r.id,screenOverlayContainer:n.screenOverlayContainer},f=new Ya,y=mse(e,f,d,b).then(function(_){let S=e._entityCollection,Z=f.values;S.suspendEvents();for(let E=0;E<Z.length;E++){let A=Z[E];l(A.parent)||(A.parent=r,_se(A)),S.add(A)}S.resumeEvents();let R=Yn(c,"refreshMode",De.kml),C=Ai(c,"refreshInterval",De.kml)??0;if(R==="onInterval"&&C>0||R==="onExpire"||u==="onStop"){let E=lo(_,"NetworkLinkControl",De.kml),A=l(E),L=Q.now(),F={id:Qn(),href:d,cookie:{},lastUpdated:L,updating:!1,entity:r,viewBoundScale:m,needsUpdate:!1,cameraUpdateTime:L},I=0;if(A&&(F.cookie=yu(Yn(E,"cookie",De.kml)??""),I=Ai(E,"minRefreshPeriod",De.kml)??0),R==="onInterval")A&&(C=Math.max(I,C)),F.refreshMode=FT.INTERVAL,F.time=C;else if(R==="onExpire"){let N;if(A&&(N=Yn(E,"expires",De.kml)),l(N))try{let g=Q.fromIso8601(N),V=Q.secondsDifference(g,L);V>0&&V<I&&Q.addSeconds(L,I,g),F.refreshMode=FT.EXPIRE,F.time=g}catch{xt("kml-refreshMode-onInterval-onExpire","KML - NetworkLinkControl expires is not a valid date")}else xt("kml-refreshMode-onExpire","KML - refreshMode of onExpire requires the NetworkLinkControl to have an expires element")}else l(e.camera)?(F.refreshMode=FT.STOP,F.time=Ai(c,"viewRefreshTime",De.kml)??0):xt("kml-refrehMode-onStop-noCamera","A NetworkLink with viewRefreshMode=onStop requires the `camera` property to be defined.");l(F.refreshMode)&&e._networkLinks.set(F.id,F)}}).catch(function(_){xt(`An error occured during loading ${d.url}`),e._error.raiseEvent(e,_)});i.addPromise(y)}}}function jwt(e,t,n,i){let o=pse[t.localName];return l(o)?o(e,t,n,i):mXe(e,t,n,i)}function use(e,t,n,i,o,r,s){t.removeAll();let a=n.documentElement,c=a.localName==="Document"?a:lo(a,"Document",De.kml),d=Yn(c,"name",De.kml);l(d)||(d=zg(i.getUrlComponent())),l(e._name)||(e._name=d);let u=new ly._DeferredLoading(e),m=new Ya(e);return Promise.all(rXe(e,n,m,i,!1,o)).then(function(){let p=n.documentElement;if(p.localName==="kml"){let f=p.childNodes;for(let y=0;y<f.length;y++){let _=f[y];if(l(pse[_.localName])){p=_;break}}}let b={parentEntity:void 0,entityCollection:t,styleCollection:m,sourceResource:i,uriResolver:o,context:s,screenOverlayContainer:r};return t.suspendEvents(),jwt(e,p,b,u),t.resumeEvents(),u.wait().then(function(){return n.documentElement})})}async function Qwt(e,t,n,i,o){let r=en("ThirdParty/Workers/zip-web-worker.js"),s=en("ThirdParty/zip-module.wasm");xk({workerURI:r,wasmURI:s});let a=new bR(new ru(n)),c=await a.getEntries(),d=[],u={},m;for(let p=0;p<c.length;p++){let b=c[p];b.directory||(/\.kml$/i.test(b.filename)&&(!l(m)||!/\//i.test(b.filename))?(l(m)&&d.push(rse(m,u)),m=b):d.push(rse(b,u)))}if(l(m)&&d.push(Zwt(m,u)),await Promise.all(d),a.close(),!l(u.kml))throw new ae("KMZ file does not contain a KML document.");return u.keys=Object.keys(u),use(e,t,u.kml,i,u,o)}function mse(e,t,n,i){i=i??B.EMPTY_OBJECT;let o=i.sourceUri,r=i.uriResolver,s=i.context,a=i.screenOverlayContainer,c=n;if(typeof n=="string"||n instanceof ve){n=ve.createIfNeeded(n),c=n.fetchBlob(),o=o??n.clone();let d=e._resourceCredits,u=n.credits;if(l(u)){let m=u.length;for(let p=0;p<m;p++)d.push(u[p])}}else o=o??ve.DEFAULT.clone();return o=ve.createIfNeeded(o),l(a)&&(a=Nn(a)),Promise.resolve(c).then(function(d){return d instanceof Blob?_wt(d).then(function(u){return u?Qwt(e,t,d,o,a):Swt(d).then(function(m){m=eXe(m),m=tXe(m);let p,b;try{p=fse.parseFromString(m,"application/xml")}catch(f){b=f.toString()}if(l(b)||p.body||p.documentElement.tagName==="parsererror"){let f=l(b)?b:p.documentElement.firstChild.nodeValue;throw f||(f=p.body.innerText),new ae(f)}return use(e,t,p,o,r,a,s)})}):use(e,t,d,o,r,a,s)}).catch(function(d){return e._error.raiseEvent(e,d),console.log(d),Promise.reject(d)})}var ly=class e{constructor(t){t=t??B.EMPTY_OBJECT;let n=t.camera,i=t.canvas;this._changed=new Se,this._error=new Se,this._loading=new Se,this._refresh=new Se,this._unsupportedNode=new Se,this._clock=void 0,this._entityCollection=new Ya(this),this._name=void 0,this._isLoading=!1,this._pinBuilder=new sy,this._networkLinks=new kt,this._entityCluster=new Eu,this.canvas=i,this.camera=n,this._lastCameraView={position:l(n)?h.clone(n.positionWC):void 0,direction:l(n)?h.clone(n.directionWC):void 0,up:l(n)?h.clone(n.upWC):void 0,bbox:l(n)?n.computeViewRectangle():re.clone(re.MAX_VALUE)},this._ellipsoid=t.ellipsoid??ne.default;let o=t.credit;typeof o=="string"&&(o=new Lt(o)),this._credit=o,this._resourceCredits=[],this._kmlTours=[],this._screenOverlays=[]}static load(t,n){return n=n??B.EMPTY_OBJECT,new e(n).load(t,n)}get name(){return this._name}set name(t){this._name!==t&&(this._name=t,this._changed.raiseEvent(this))}get clock(){return this._clock}get entities(){return this._entityCollection}get isLoading(){return this._isLoading}get changedEvent(){return this._changed}get errorEvent(){return this._error}get loadingEvent(){return this._loading}get refreshEvent(){return this._refresh}get unsupportedNodeEvent(){return this._unsupportedNode}get show(){return this._entityCollection.show}set show(t){this._entityCollection.show=t}get clustering(){return this._entityCluster}set clustering(t){this._entityCluster=t}get credit(){return this._credit}get kmlTours(){return this._kmlTours}load(t,n){n=n??B.EMPTY_OBJECT,ys.setLoading(this,!0);let i=this._name;this._name=void 0,this._clampToGround=n.clampToGround??!1;let o=this;return mse(this,this._entityCollection,t,n).then(function(){let r,s=o._entityCollection.computeAvailability(),a=s.start,c=s.stop,d=Q.equals(a,ot.MINIMUM_VALUE),u=Q.equals(c,ot.MAXIMUM_VALUE);if(!d||!u){let p;d&&(p=new Date,p.setHours(0,0,0,0),a=Q.fromDate(p)),u&&(p=new Date,p.setHours(24,0,0,0),c=Q.fromDate(p)),r=new Kf,r.startTime=a,r.stopTime=c,r.currentTime=Q.clone(a),r.clockRange=bs.LOOP_STOP,r.clockStep=Do.SYSTEM_CLOCK_MULTIPLIER,r.multiplier=Math.round(Math.min(Math.max(Q.secondsDifference(c,a)/60,1),31556900))}let m=!1;return r!==o._clock&&(o._clock=r,m=!0),i!==o._name&&(m=!0),m&&o._changed.raiseEvent(o),ys.setLoading(o,!1),o}).catch(function(r){return ys.setLoading(o,!1),o._error.raiseEvent(o,r),console.log(r),Promise.reject(r)})}destroy(){for(;this._screenOverlays.length>0;)this._screenOverlays.pop().remove()}update(t){let n=this._networkLinks;if(n.length===0)return!0;let i=Q.now(),o=this;cse.removeAll();function r(m){let p=m._children,b=p.length;for(let f=0;f<b;++f){let y=p[f];cse.set(y.id,y),r(y)}}let s=!1,a=this._lastCameraView,c=this.camera;l(c)&&!(c.positionWC.equalsEpsilon(a.position,W.EPSILON7)&&c.directionWC.equalsEpsilon(a.direction,W.EPSILON7)&&c.upWC.equalsEpsilon(a.up,W.EPSILON7))&&(a.position=h.clone(c.positionWC),a.direction=h.clone(c.directionWC),a.up=h.clone(c.upWC),a.bbox=c.computeViewRectangle(),s=!0);let d=new kt,u=!1;return n.values.forEach(function(m){let p=m.entity;if(!cse.contains(p.id)){if(!m.updating){let b=!1;if(m.refreshMode===FT.INTERVAL?Q.secondsDifference(i,m.lastUpdated)>m.time&&(b=!0):m.refreshMode===FT.EXPIRE?Q.greaterThan(i,m.time)&&(b=!0):m.refreshMode===FT.STOP&&(s&&(m.needsUpdate=!0,m.cameraUpdateTime=i),m.needsUpdate&&Q.secondsDifference(i,m.cameraUpdateTime)>=m.time&&(b=!0)),b){r(p),m.updating=!0;let f=new Ya,y=m.href.clone();y.setQueryParameters(m.cookie);let _=o._ellipsoid??ne.default;Tse(y,o.camera,o.canvas,m.viewBoundScale,a.bbox,_),mse(o,f,y,{context:p.id}).then(qwt(o,m,f,d,y)).catch(function(S){let Z=`NetworkLink ${m.href} refresh failed: ${S}`;console.log(Z),o._error.raiseEvent(o,Z)}),u=!0}}d.set(m.id,m)}}),u&&(this._networkLinks=d,this._changed.raiseEvent(this)),!0}};function _se(e){let t=e.parent;if(l(t)){let n=t.availability;if(l(n)){let i=e.availability;l(i)?i.intersect(n):e.availability=n}}}function qwt(e,t,n,i,o){return function(r){if(!i.contains(t.id))return;let s=!1,a=lo(r,"NetworkLinkControl",De.kml),c=l(a),d=0;if(c){if(l(lo(a,"Update",De.kml))){xt("kml-networkLinkControl-update","KML - NetworkLinkControl updates aren't supported."),t.updating=!1,i.remove(t.id);return}t.cookie=yu(Yn(a,"cookie",De.kml)??""),d=Ai(a,"minRefreshPeriod",De.kml)??0}let u=Q.now(),m=t.refreshMode;if(m===FT.INTERVAL)l(a)&&(t.time=Math.max(d,t.time));else if(m===FT.EXPIRE){let L;if(l(a)&&(L=Yn(a,"expires",De.kml)),l(L))try{let F=Q.fromIso8601(L),I=Q.secondsDifference(F,u);I>0&&I<d&&Q.addSeconds(u,d,F),t.time=F}catch{xt("kml-networkLinkControl-expires","KML - NetworkLinkControl expires is not a valid date"),s=!0}else xt("kml-refreshMode-onExpire","KML - refreshMode of onExpire requires the NetworkLinkControl to have an expires element"),s=!0}let p=t.entity,b=e._entityCollection,f=n.values;function y(L){b.remove(L);let F=L._children,I=F.length;for(let N=0;N<I;++N)y(F[N])}b.suspendEvents();let _=b.values.slice(),S;for(S=0;S<_.length;++S){let L=_[S];L.parent===p&&(L.parent=void 0,y(L))}for(b.resumeEvents(),b.suspendEvents(),S=0;S<f.length;S++){let L=f[S];l(L.parent)||(L.parent=p,_se(L)),b.add(L)}b.resumeEvents(),s?i.remove(t.id):t.lastUpdated=u;let Z=b.computeAvailability(),R=Z.start,C=Z.stop,E=Q.equals(R,ot.MINIMUM_VALUE),A=Q.equals(C,ot.MAXIMUM_VALUE);if(!E||!A){let L=e._clock;(L.startTime!==R||L.stopTime!==C)&&(L.startTime=R,L.stopTime=C,e._changed.raiseEvent(e))}t.updating=!1,t.needsUpdate=!1,e._refresh.raiseEvent(e,o.getUrlComponent(!0))}}var cse=new kt,hse=class{constructor(){this.author={name:void 0,uri:void 0,email:void 0},this.link={href:void 0,hreflang:void 0,rel:void 0,type:void 0,title:void 0,length:void 0},this.address=void 0,this.phoneNumber=void 0,this.snippet=void 0,this.extendedData=void 0}};ly._DeferredLoading=lse;ly._getTimestamp=Zn;var VR=ly;var IGo=x(T(),1);function pU(){ge.throwInstantiationError()}pU.prototype.update=ge.throwInstantiationError;pU.prototype.getBoundingSphere=ge.throwInstantiationError;pU.prototype.isDestroyed=ge.throwInstantiationError;pU.prototype.destroy=ge.throwInstantiationError;var Sse=pU;var XGo=x(T(),1),bU=`in vec3 v_positionMC; in vec3 v_positionEC; in vec2 v_st; void main() @@ -12702,7 +12674,7 @@ out_FragColor = vec4(material.diffuse + material.emission, material.alpha); out_FragColor = czm_phong(normalize(positionToEyeEC), material, czm_lightDirectionEC); #endif } -`;var AMo=x(T(),1),wU=`in vec3 position3DHigh; +`;var YGo=x(T(),1),gU=`in vec3 position3DHigh; in vec3 position3DLow; in vec2 st; in float batchId; @@ -12717,7 +12689,7 @@ v_positionEC = (czm_modelViewRelativeToEye * p).xyz; v_st = st; gl_Position = czm_modelViewProjectionRelativeToEye * p; } -`;function YR(e){e=e??B.EMPTY_OBJECT;let t=e.translucent??!0,n=e.aboveGround??!1;this.material=l(e.material)?e.material:eo.fromType(eo.ColorType),this.translucent=e.translucent??!0,this._vertexShaderSource=e.vertexShaderSource??wU,this._fragmentShaderSource=e.fragmentShaderSource??MU,this._renderState=Go.getDefaultRenderState(t,!n,e.renderState),this._closed=!1,this._flat=e.flat??!1,this._faceForward=e.faceForward??n,this._aboveGround=n}Object.defineProperties(YR.prototype,{vertexShaderSource:{get:function(){return this._vertexShaderSource}},fragmentShaderSource:{get:function(){return this._fragmentShaderSource}},renderState:{get:function(){return this._renderState}},closed:{get:function(){return this._closed}},vertexFormat:{get:function(){return YR.VERTEX_FORMAT}},flat:{get:function(){return this._flat}},faceForward:{get:function(){return this._faceForward}},aboveGround:{get:function(){return this._aboveGround}}});YR.VERTEX_FORMAT=Me.POSITION_AND_ST;YR.prototype.getFragmentShaderSource=Go.prototype.getFragmentShaderSource;YR.prototype.isTranslucent=Go.prototype.isTranslucent;YR.prototype.getRenderState=Go.prototype.getRenderState;var Qae=YR;var QMo=x(T(),1);var lDt=1e5;function kU(e){e=e??B.EMPTY_OBJECT;let t=e.credit;typeof t=="string"&&(t=new Lt(t)),this._credit=t,this._radius=l(e.radius)?e.radius:lDt,this._image=e.image,this._transform=l(e.transform)?e.transform:P.IDENTITY,this._repeatHorizontal=l(e.repeatHorizontal)?e.repeatHorizontal:1,this._repeatVertical=l(e.repeatVertical)?e.repeatVertical:1;let n=new EU({radius:this._radius,vertexFormat:Me.ALL}),i=new Yt({geometry:n,modelMatrix:this._transform}),o=new eo({fabric:{type:"Image",uniforms:{image:this._image,repeat:new k(-this._repeatHorizontal,this._repeatVertical)}}});return this._primitive=new In({geometryInstances:i,appearance:new Co({material:o,closed:!0,faceForward:!1,flat:!0,translucent:!1,renderState:{cull:{enabled:!1}}}),credit:this._credit}),this}Object.defineProperties(kU.prototype,{radius:{get:function(){return this._radius}},image:{get:function(){return this._image}},transform:{get:function(){return this._transform}},credit:{get:function(){return l(this._credit)?this._credit:void 0}},show:{get:function(){return l(this._primitive)?this._primitive.show:void 0},set:function(e){l(this._primitive)&&(this._primitive.show=e)}}});kU.prototype.update=function(e){return l(this._credit)&&e.creditDisplay.addCreditToNextFrame(this._credit),this._primitive.update(e)};kU.prototype.destroy=function(){return this._primitive=this._primitive&&this._primitive.destroy(),ue(this)};kU.prototype.isDestroyed=function(){return this._primitive.isDestroyed()};var qae=kU;var owo=x(T(),1);function mu(e){this._scene=e.scene,this.samplingWindow=e.samplingWindow??mu.defaultSettings.samplingWindow,this.quietPeriod=e.quietPeriod??mu.defaultSettings.quietPeriod,this.warmupPeriod=e.warmupPeriod??mu.defaultSettings.warmupPeriod,this.minimumFrameRateDuringWarmup=e.minimumFrameRateDuringWarmup??mu.defaultSettings.minimumFrameRateDuringWarmup,this.minimumFrameRateAfterWarmup=e.minimumFrameRateAfterWarmup??mu.defaultSettings.minimumFrameRateAfterWarmup,this._lowFrameRate=new Se,this._nominalFrameRate=new Se,this._frameTimes=[],this._needsQuietPeriod=!0,this._quietPeriodEndTime=0,this._warmupPeriodEndTime=0,this._frameRateIsLow=!1,this._lastFramesPerSecond=void 0,this._pauseCount=0;let t=this;this._preUpdateRemoveListener=this._scene.preUpdate.addEventListener(function(o,r){dDt(t,r)}),this._hiddenPropertyName=document.hidden!==void 0?"hidden":document.mozHidden!==void 0?"mozHidden":document.msHidden!==void 0?"msHidden":document.webkitHidden!==void 0?"webkitHidden":void 0;let n=document.hidden!==void 0?"visibilitychange":document.mozHidden!==void 0?"mozvisibilitychange":document.msHidden!==void 0?"msvisibilitychange":document.webkitHidden!==void 0?"webkitvisibilitychange":void 0;function i(){uDt(t)}this._visibilityChangeRemoveListener=void 0,l(n)&&(document.addEventListener(n,i,!1),this._visibilityChangeRemoveListener=function(){document.removeEventListener(n,i,!1)})}mu.defaultSettings={samplingWindow:5,quietPeriod:2,warmupPeriod:5,minimumFrameRateDuringWarmup:4,minimumFrameRateAfterWarmup:8};mu.fromScene=function(e){return(!l(e._frameRateMonitor)||e._frameRateMonitor.isDestroyed())&&(e._frameRateMonitor=new mu({scene:e})),e._frameRateMonitor};Object.defineProperties(mu.prototype,{scene:{get:function(){return this._scene}},lowFrameRate:{get:function(){return this._lowFrameRate}},nominalFrameRate:{get:function(){return this._nominalFrameRate}},lastFramesPerSecond:{get:function(){return this._lastFramesPerSecond}}});mu.prototype.pause=function(){++this._pauseCount,this._pauseCount===1&&(this._frameTimes.length=0,this._lastFramesPerSecond=void 0)};mu.prototype.unpause=function(){--this._pauseCount,this._pauseCount<=0&&(this._pauseCount=0,this._needsQuietPeriod=!0)};mu.prototype.isDestroyed=function(){return!1};mu.prototype.destroy=function(){return this._preUpdateRemoveListener(),l(this._visibilityChangeRemoveListener)&&this._visibilityChangeRemoveListener(),ue(this)};function dDt(e,t){if(e._pauseCount>0)return;let n=Zn();if(e._needsQuietPeriod)e._needsQuietPeriod=!1,e._frameTimes.length=0,e._quietPeriodEndTime=n+e.quietPeriod/wn.SECONDS_PER_MILLISECOND,e._warmupPeriodEndTime=e._quietPeriodEndTime+(e.warmupPeriod+e.samplingWindow)/wn.SECONDS_PER_MILLISECOND;else if(n>=e._quietPeriodEndTime){e._frameTimes.push(n);let i=n-e.samplingWindow/wn.SECONDS_PER_MILLISECOND;if(e._frameTimes.length>=2&&e._frameTimes[0]<=i){for(;e._frameTimes.length>=2&&e._frameTimes[1]<i;)e._frameTimes.shift();let o=(n-e._frameTimes[0])/(e._frameTimes.length-1);e._lastFramesPerSecond=1e3/o;let r=1e3/(n>e._warmupPeriodEndTime?e.minimumFrameRateAfterWarmup:e.minimumFrameRateDuringWarmup);o>r?e._frameRateIsLow||(e._frameRateIsLow=!0,e._needsQuietPeriod=!0,e.lowFrameRate.raiseEvent(e.scene,e._lastFramesPerSecond)):e._frameRateIsLow&&(e._frameRateIsLow=!1,e._needsQuietPeriod=!0,e.nominalFrameRate.raiseEvent(e.scene,e._lastFramesPerSecond))}}}function uDt(e){document[e._hiddenPropertyName]?e.pause():e.unpause()}var UU=mu;var Swo=x(T(),1);var ece=class e{constructor(t){t=t??B.EMPTY_OBJECT;let n=mDt(t.geoJson),i=t.allowPicking??!0,o=t.ellipsoid??ne.default,r=new Float64Array(0);function s(b){return r.length<b&&(r=new Float64Array(b)),r}this.show=t.show??!0,this._url=t.url,this._ids=n.ids,this._properties=n.properties,this._featureCount=n.ids.length,this._pickObjectFactory=t.pickObjectFactory,this._points=void 0,this._polylines=void 0,this._polygons=void 0,this._heightReference=t.heightReference??He.NONE,this._scene=t.scene;let a=this._heightReference,c=this._scene;n.pointCount>0&&(this._points=new zd({primitiveCountMax:n.pointCount,allowPicking:i})),n.polylineCount>0&&(this._polylines=new ml({primitiveCountMax:n.polylineCount,vertexCountMax:n.polylineVertexCount,allowPicking:i,heightReference:a})),n.polygonCount>0&&(this._polygons=new Ma({primitiveCountMax:n.polygonCount,vertexCountMax:n.polygonVertexCount,holeCountMax:n.polygonHoleCount,triangleCountMax:n.polygonTriangleCount,allowPicking:i,heightReference:a}));let d=new h,u=0,m=0,p=0;for(let b=0;b<n.features.length;b++){let f=n.features[b],y=f.featureId,_=this._properties[y];for(let S=0;S<f.points.length;S++){let Z=u++;this._points.add({featureId:y,position:RNe(f.points[S],o,d),pickObject:i?$ae(this,Z,this._points,Xc,_):void 0})}for(let S=0;S<f.polylines.length;S++){let Z=m++;this._polylines.add({featureId:y,positions:xNe(f.polylines[S],o,s),pickObject:i?$ae(this,Z,this._polylines,ya,_):void 0})}for(let S=0;S<f.polygons.length;S++){let Z=f.polygons[S],R=p++;this._polygons.add({featureId:y,positions:xNe(Z.positions,o,s),holes:Z.holes,triangles:Z.triangles,pickObject:i?$ae(this,R,this._polygons,Ir,_):void 0})}}}get url(){let t=this._url;if(l(t))return t instanceof ve?t.getUrlComponent(!0):t}get featureCount(){return this._featureCount}get ids(){return this._ids}get properties(){return this._properties}get points(){return this._points}get polylines(){return this._polylines}get polygons(){return this._polygons}static async fromUrl(t,n){let i=ve.createIfNeeded(t),o=await i.fetchJson();if(!l(o))throw new ae(`Failed to load GeoJSON from ${i.getUrlComponent(!0)}.`);return e.fromGeoJson(o,{...n,url:i})}static fromGeoJson(t,n){return new e({...n,geoJson:t})}getId(t){return this._ids[t]}getProperties(t){return this._properties[t]}update(t){if(!this.show)return;let n=this._points,i=this._polylines,o=this._polygons,r=t.frameNumber,s=this._heightReference,a=bs(s)?this._scene.vectorProvider:null;l(n)&&n.update(t),l(i)&&(l(a)?a.markForFrame(i,r,s):i.update(t)),l(o)&&(l(a)?a.markForFrame(o,r,s):o.update(t))}destroy(){let t=bs(this._heightReference)?this._scene.vectorProvider:null;return this._points&&(this._points.destroy(),this._points=void 0),this._polylines&&(l(t)&&t.remove(this._polylines),this._polylines.destroy(),this._polylines=void 0),this._polygons&&(l(t)&&t.remove(this._polygons),this._polygons.destroy(),this._polygons=void 0),ue(this)}isDestroyed(){return!1}};function $ae(e,t,n,i,o){return l(e._pickObjectFactory)?e._pickObjectFactory(t,n,o):{index:t,collection:n,get primitive(){return n.get(t,new i)},parentPrimitive:e,properties:o}}function mDt(e){let t=hDt(e),n=[],i=[],o=[],r=0,s=0,a=0,c=0,d=0,u=0,m=0;for(let p=0;p<t.length;p++){let b=t[p],f={points:[],polylines:[],polygons:[]};if(TNe(b.geometry,f),f.points.length===0&&f.polylines.length===0&&f.polygons.length===0)continue;let y=i.length;i.push(b.id),o.push(RDt(b.properties)?b.properties:B.EMPTY_OBJECT);for(let _=0;_<f.polygons.length;_++){let S=f.polygons[_];u+=S.holes.length,m+=S.triangles.length/3,d+=S.positions.length}for(let _=0;_<f.polylines.length;_++)a+=f.polylines[_].length;r+=f.points.length,s+=f.polylines.length,c+=f.polygons.length,n.push({featureId:y,points:f.points,polylines:f.polylines,polygons:f.polygons})}return{features:n,ids:i,properties:o,pointCount:r,polylineCount:s,polylineVertexCount:a,polygonCount:c,polygonVertexCount:d,polygonHoleCount:u,polygonTriangleCount:m}}function hDt(e){if(!l(e)||!l(e.type))throw new ae("GeoJSON object must define 'type'.");switch(e.type){case"FeatureCollection":return e.features;case"Feature":return[e];default:if(SDt(e.type))return[{type:"Feature",geometry:e,properties:B.EMPTY_OBJECT,id:void 0}];throw new ae(`Unsupported GeoJSON type: ${e.type}`)}}function TNe(e,t){if(!(!l(e)||!l(e.type)))switch(e.type){case"Point":_Ne(e.coordinates,t.points);return;case"MultiPoint":pDt(e.coordinates,t.points);return;case"LineString":SNe(e.coordinates,t.polylines);return;case"MultiLineString":bDt(e.coordinates,t.polylines);return;case"Polygon":ZNe(e.coordinates,t.polygons);return;case"MultiPolygon":gDt(e.coordinates,t.polygons);return;case"GeometryCollection":fDt(e.geometries,t);return;default:return}}function fDt(e,t){if(Array.isArray(e))for(let n=0;n<e.length;n++)TNe(e[n],t)}function _Ne(e,t){let n=tce(e);l(n)&&t.push(n)}function pDt(e,t){for(let n=0;n<e.length;n++)_Ne(e[n],t)}function SNe(e,t){let n=yDt(e);l(n)&&n.length>=2&&t.push(n)}function bDt(e,t){for(let n=0;n<e.length;n++)SNe(e[n],t)}function ZNe(e,t){let n=xDt(e);l(n)&&t.push(n)}function gDt(e,t){for(let n=0;n<e.length;n++)ZNe(e[n],t)}function yDt(e){if(!Array.isArray(e))return;let t=[];for(let n=0;n<e.length;n++){let i=tce(e[n]);l(i)&&t.push(i)}return t.length>=2?t:void 0}function xDt(e){if(!Array.isArray(e)||e.length===0)return;let t=[];for(let a=0;a<e.length;a++){let c=TDt(e[a]);l(c)&&t.push(c)}if(t.length===0||t[0].length<3)return;let i=[],o=[],r=[];for(let a=0;a<t.length;a++){let c=t[a];if(!(c.length<3)){a>0&&r.push(o.length);for(let d=0;d<c.length;d++){let u=c[d];o.push(u),i.push(new k(u[0],u[1]))}}}if(o.length<3)return;let s=hi.triangulate(i,r);if(!(!l(s)||s.length<3))return{positions:o,holes:new Uint32Array(r),triangles:new Uint32Array(s)}}function TDt(e){if(!Array.isArray(e))return;let t=[];for(let n=0;n<e.length;n++){let i=tce(e[n]);l(i)&&t.push(i)}if(!(t.length<3))return t.length>1&&_Dt(t[0],t[t.length-1])&&t.pop(),t.length>=3?t:void 0}function tce(e){if(!Array.isArray(e)||e.length<2)return;let t=e[0],n=e[1],i=e[2]??0;if(!(!Number.isFinite(t)||!Number.isFinite(n)||!Number.isFinite(i)))return[t,n,i]}function _Dt(e,t){return e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]}function SDt(e){return e==="Point"||e==="MultiPoint"||e==="LineString"||e==="MultiLineString"||e==="Polygon"||e==="MultiPolygon"||e==="GeometryCollection"}function RNe(e,t,n){return h.fromDegrees(e[0],e[1],e[2]??0,t,n)}var ZDt=new h;function xNe(e,t,n){let i=e.length*3,o=n(i);for(let r=0;r<e.length;r++){let s=RNe(e[r],t,ZDt);o[r*3]=s.x,o[r*3+1]=s.y,o[r*3+2]=s.z}return o.subarray(0,i)}function RDt(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}var nce=ece;var Xwo=x(T(),1);var CNe=x(Kse(),1);function ice(){this._image=new Image}ice.prototype.isReady=function(){return!0};ice.prototype.shouldDiscardImage=function(e){return e===this._image};function MR(e){e=e??B.EMPTY_OBJECT,this._defaultAlpha=void 0,this._defaultNightAlpha=void 0,this._defaultDayAlpha=void 0,this._defaultBrightness=void 0,this._defaultContrast=void 0,this._defaultHue=void 0,this._defaultSaturation=void 0,this._defaultGamma=void 0,this._defaultMinificationFilter=void 0,this._defaultMagnificationFilter=void 0,this._tileDiscardPolicy=e.tileDiscardPolicy,this._tilingScheme=new to({numberOfLevelZeroTilesX:2,numberOfLevelZeroTilesY:2,rectangle:new re(-W.PI,-W.PI,W.PI,W.PI),ellipsoid:e.ellipsoid});let t=e.credit;typeof t=="string"&&(t=new Lt(t)),this._credit=t,this._tileWidth=256,this._tileHeight=256,this._maximumLevel=23,l(this._tileDiscardPolicy)||(this._tileDiscardPolicy=new ice),this._errorEvent=new Se}Object.defineProperties(MR.prototype,{url:{get:function(){return this._metadata.url}},proxy:{get:function(){return this._metadata.proxy}},tileWidth:{get:function(){return this._tileWidth}},tileHeight:{get:function(){return this._tileHeight}},maximumLevel:{get:function(){return this._maximumLevel}},minimumLevel:{get:function(){return 0}},tilingScheme:{get:function(){return this._tilingScheme}},rectangle:{get:function(){return this._tilingScheme.rectangle}},tileDiscardPolicy:{get:function(){return this._tileDiscardPolicy}},errorEvent:{get:function(){return this._errorEvent}},credit:{get:function(){return this._credit}},hasAlphaChannel:{get:function(){return!1}}});MR.fromMetadata=function(e,t){if(!e.imageryPresent)throw new ae(`The server ${e.url} doesn't have imagery`);let n=new MR(t);return n._metadata=e,n};MR.prototype.getTileCredits=function(e,t,n){let i=this._metadata,o=i.getTileInformation(e,t,n);if(l(o)){let r=i.providers[o.imageryProvider];if(l(r))return[r]}};MR.prototype.requestImage=function(e,t,n,i){let o=this._tileDiscardPolicy._image,r=this._metadata,s=hy.tileXYToQuadKey(e,t,n),a=r.getTileInformation(e,t,n);if(!l(a)){if(r.isValid(s)){let d=new Ar({throttle:i.throttle,throttleByServer:i.throttleByServer,type:i.type,priorityFunction:i.priorityFunction});r.populateSubtree(e,t,n,d);return}return Promise.resolve(o)}if(!a.hasImagery())return Promise.resolve(o);let c=CDt(this,a,e,t,n,i).fetchArrayBuffer();if(l(c))return c.then(function(d){_U(r.key,d);let u=new Uint8Array(d),m,p=r.protoImagery;if((!l(p)||!p)&&(m=VDt(u)),!l(m)&&(!l(p)||p)){let b=EDt(u);m=b.imageType,u=b.imageData}return!l(m)||!l(u)?o:Fb({uint8Array:u,format:m,flipY:!0})})};MR.prototype.pickFeatures=function(e,t,n,i,o){};function CDt(e,t,n,i,o,r){let s=hy.tileXYToQuadKey(n,i,o),a=t.imageryVersion;return a=l(a)&&a>0?a:1,e._metadata.resource.getDerivedResource({url:`flatfile?f1-0${s}-i.${a.toString()}`,request:r})}function VDt(e){let t="JFIF";if(e[6]===t.charCodeAt(0)&&e[7]===t.charCodeAt(1)&&e[8]===t.charCodeAt(2)&&e[9]===t.charCodeAt(3))return"image/jpeg";let n="PNG";if(e[1]===n.charCodeAt(0)&&e[2]===n.charCodeAt(1)&&e[3]===n.charCodeAt(2))return"image/png"}function EDt(e){let t=CNe.Reader.create(e),n=t.len,i={};for(;t.pos<n;){let s=t.uint32(),a;switch(s>>>3){case 1:i.imageType=t.uint32();break;case 2:i.imageData=t.bytes();break;case 3:i.alphaType=t.uint32();break;case 4:i.imageAlpha=t.bytes();break;case 5:if(a=i.copyrightIds,l(a)||(a=i.copyrightIds=[]),(s&7)===2){let c=t.uint32()+t.pos;for(;t.pos<c;)a.push(t.uint32())}else a.push(t.uint32());break;default:t.skipType(s&7);break}}let o=i.imageType;if(l(o))switch(o){case 0:i.imageType="image/jpeg";break;case 4:i.imageType="image/png";break;default:throw new ae("GoogleEarthEnterpriseImageryProvider: Unsupported image type.")}let r=i.alphaType;return l(r)&&r!==0&&(console.log("GoogleEarthEnterpriseImageryProvider: External alpha not supported."),delete i.alphaType,delete i.imageAlpha),i}var oce=MR;var Qwo=x(T(),1);var ADt=600;function z0(e){e=e??B.EMPTY_OBJECT,this._key=l(e.key)?e.key:_a.defaultApiKey,this._baseResource=ve.createIfNeeded(e.url??_a.streetViewStaticApiEndpoint),this._metadataResource=this._baseResource.getDerivedResource({url:"streetview/metadata"}),this._tileSize=e.tileSize??ADt}Object.defineProperties(z0.prototype,{});z0.prototype.loadPanorama=async function(e){let t=e.cartographic,n=e.tileSize??this._tileSize,i=`${n}x${n}`,o=e.signature,{panoId:r}=e;l(r)||(r=(await this.getNearestPanoId(t)).panoId);let s=_a.getDefaultCredit(),a=h.fromDegrees(W.toDegrees(t.longitude),W.toDegrees(t.latitude),0),c=[this._loadFaceImage({heading:0,pitch:0,tileSizeString:i,panoId:r,signature:o}),this._loadFaceImage({heading:180,pitch:0,tileSizeString:i,panoId:r,signature:o}),this._loadFaceImage({heading:-90,pitch:-90,tileSizeString:i,panoId:r,signature:o}),this._loadFaceImage({heading:-90,pitch:90,tileSizeString:i,panoId:r,signature:o}),this._loadFaceImage({heading:270,pitch:0,tileSizeString:i,panoId:r,signature:o}),this._loadFaceImage({heading:90,pitch:0,tileSizeString:i,panoId:r,signature:o})],[d,u,m,p,b,f]=await Promise.all(c),y=_t.localFrameToFixedFrameGenerator("north","down"),_=P.getMatrix3(y(a,ne.default),new q);return new SR({sources:{positiveX:d,negativeX:u,positiveY:m,negativeY:p,positiveZ:b,negativeZ:f},transform:_,credit:s})};z0.prototype.getNearestPanoId=async function(e,t){let i=[W.toDegrees(e.latitude),W.toDegrees(e.longitude)].join(","),r=await this._metadataResource.getDerivedResource({queryParameters:{key:this._key,location:i,radius:t??50}}).fetchJson();if(r.status!=="OK")throw new ge(`GoogleStreetViewCubeMapPanoramaProvider metadata error: ${r.status}`);return{panoId:r.pano_id,latitude:r.location.lat,longitude:r.location.lng}};z0.prototype.getPanoIdMetadata=async function(e){let n=await this._metadataResource.getDerivedResource({queryParameters:{key:this._key,pano:e}}).fetchJson();if(n.status!=="OK")throw new ge(`GoogleStreetViewCubeMapPanoramaProvider metadata error: ${n.status}`);return n};z0.prototype._loadFaceImage=async function(e){let t=this._buildFaceUrl(e);try{return await ve.fetchImage({url:t,preferImageBitmap:!0,flipY:!0})}catch{throw new ge(`Failed to load Street View face image: ${t}`)}};z0.prototype._buildFaceUrl=function(e){let{heading:t,pitch:n,tileSizeString:i,panoId:o,signature:r}=e;return this._baseResource.getDerivedResource({queryParameters:{size:i,pano:o,heading:t,pitch:n,key:this._key,...l(r)&&{signature:r}}}).url};z0.fromUrl=async function(e){if(e=e??{},e.key=e.key??_a.defaultStreetViewStaticApiKey??_a.defaultApiKey,!l(e.key)&&!l(_a.defaultStreetViewStaticApiKey)&&!l(_a.defaultApiKey))throw new ge("options.key, GoogleMaps.defaultStreetViewStaticApiKey or GoogleMaps.defaultApiKey is required.");return new z0({...e})};z0._parseMetadata=function(e){return{cartographic:pe.fromDegrees(e.location.lng,e.location.lat,0)}};var rce=z0;var o9o=x(T(),1);var GDt=new U(1,1,1,.4),LDt=new U(0,1,0,.05),WDt=new U(0,.5,0,.2);function wR(e){e=e??B.EMPTY_OBJECT,this._defaultAlpha=void 0,this._defaultNightAlpha=void 0,this._defaultDayAlpha=void 0,this._defaultBrightness=void 0,this._defaultContrast=void 0,this._defaultHue=void 0,this._defaultSaturation=void 0,this._defaultGamma=void 0,this._defaultMinificationFilter=void 0,this._defaultMagnificationFilter=void 0,this._tilingScheme=l(e.tilingScheme)?e.tilingScheme:new to({ellipsoid:e.ellipsoid}),this._cells=e.cells??8,this._color=e.color??GDt,this._glowColor=e.glowColor??LDt,this._glowWidth=e.glowWidth??6,this._backgroundColor=e.backgroundColor??WDt,this._errorEvent=new Se,this._tileWidth=e.tileWidth??256,this._tileHeight=e.tileHeight??256,this._canvasSize=e.canvasSize??256,this._canvas=this._createGridCanvas()}Object.defineProperties(wR.prototype,{proxy:{get:function(){}},tileWidth:{get:function(){return this._tileWidth}},tileHeight:{get:function(){return this._tileHeight}},maximumLevel:{get:function(){}},minimumLevel:{get:function(){}},tilingScheme:{get:function(){return this._tilingScheme}},rectangle:{get:function(){return this._tilingScheme.rectangle}},tileDiscardPolicy:{get:function(){}},errorEvent:{get:function(){return this._errorEvent}},credit:{get:function(){}},hasAlphaChannel:{get:function(){return!0}}});wR.prototype._drawGrid=function(e){let n=this._canvasSize;for(let i=0;i<=this._cells;++i){let r=1+i/this._cells*(n-1);e.moveTo(r,0),e.lineTo(r,n),e.moveTo(0,r),e.lineTo(n,r)}e.stroke()};wR.prototype._createGridCanvas=function(){let e=document.createElement("canvas");e.width=this._canvasSize,e.height=this._canvasSize;let t=0,n=this._canvasSize,i=e.getContext("2d"),o=this._backgroundColor.toCssColorString();i.fillStyle=o,i.fillRect(t,t,n,n);let r=this._glowColor.toCssColorString();i.strokeStyle=r,i.lineWidth=this._glowWidth,i.strokeRect(t,t,n,n),this._drawGrid(i),i.lineWidth=this._glowWidth*.5,i.strokeRect(t,t,n,n),this._drawGrid(i);let s=this._color.toCssColorString();return i.strokeStyle=s,i.lineWidth=2,i.strokeRect(t,t,n,n),i.lineWidth=1,this._drawGrid(i),e};wR.prototype.getTileCredits=function(e,t,n){};wR.prototype.requestImage=function(e,t,n,i){return Promise.resolve(this._canvas)};wR.prototype.pickFeatures=function(e,t,n,i,o){};var sce=wR;var Nko=x(T(),1);var lko=x(T(),1);var z9o=x(T(),1);var f9o=x(T(),1);function dp(){}dp._maxDecodingConcurrency=Math.max(fn.hardwareConcurrency-1,1);dp._decodeTaskProcessor=new qn("decodeI3S",dp._maxDecodingConcurrency);dp._promise=void 0;async function vDt(){if(await dp._decodeTaskProcessor.initWebAssemblyModule({wasmBinaryFile:"ThirdParty/draco_decoder.wasm"}))return dp._decodeTaskProcessor;throw new ae("I3S decoder could not be initialized.")}dp.decode=async function(e,t,n,i,o){return l(dp._promise)||(dp._promise=vDt()),dp._promise.then(function(r){let s=n._parent._data,a=n._parent._inverseRotationMatrix,c=0,d=0,u=0;l(s.obb)?(c=s.obb.center[0],d=s.obb.center[1],u=s.obb.center[2]):l(s.mbs)&&(c=s.mbs[0],d=s.mbs[1],u=s.mbs[2]);let m=q.fromRotationX(-W.PI_OVER_TWO),p=new q;q.multiply(m,a,p);let b=pe.fromDegrees(c,d,u),f=ne.WGS84.cartographicToCartesian(b),y={binaryData:n._data,featureData:l(i)&&l(i[0])?i[0].data:void 0,schema:t,bufferInfo:n._geometryBufferInfo,ellipsoidRadiiSquare:ne.WGS84.radiiSquared,url:e,geoidDataList:n._dataProvider._geoidDataList,cartographicCenter:b,cartesianCenter:f,parentRotation:p,enableFeatures:n._dataProvider.showFeatures,splitGeometryByColorTransparency:n._dataProvider.adjustMaterialAlphaMode,symbologyData:o,calculateNormals:n._dataProvider.calculateNormals};return r.scheduleTask(y)})};var DU=dp;var y9o=x(T(),1);function ace(e,t){this._parent=e,this._dataProvider=e._dataProvider,this._layer=e._layer,l(this._parent._nodeIndex)?this._resource=this._parent._layer.resource.getDerivedResource({url:`nodes/${this._parent._data.mesh.attribute.resource}/${t}`}):this._resource=this._parent.resource.getDerivedResource({url:t})}Object.defineProperties(ace.prototype,{resource:{get:function(){return this._resource}},data:{get:function(){return this._data}}});ace.prototype.load=async function(){return this._data=await up.loadJson(this._resource),this._data};var OU=ace;var S9o=x(T(),1);function by(e,t){this._storageInfo=t,this._parent=e,this._dataProvider=e._dataProvider,this._loadPromise=void 0;let n=`attributes/${t.key}/0`;l(this._parent._nodeIndex)?this._resource=this._parent._layer.resource.getDerivedResource({url:`nodes/${this._parent._data.mesh.attribute.resource}/${n}`}):this._resource=this._parent.resource.getDerivedResource({url:n})}Object.defineProperties(by.prototype,{resource:{get:function(){return this._resource}},header:{get:function(){return this._header}},values:{get:function(){if(l(this._values)){if(l(this._values.attributeValues))return this._values.attributeValues;if(l(this._values.objectIds))return this._values.objectIds}return[]}},name:{get:function(){return this._storageInfo.name}}});function ZJ(e){return e==="UInt8"||e==="Int8"?1:e==="UInt16"||e==="Int16"?2:e==="UInt32"||e==="Int32"||e==="Oid32"||e==="Float32"?4:e==="UInt64"||e==="Int64"||e==="Float64"?8:0}function FDt(e){return e==="String"?1:ZJ(e)}async function IDt(e){let t=await e._dataProvider._loadBinary(e._resource),n=new DataView(t);e._data=t,e._validateHeader(n);let i=e._parseHeader(n),o=e._getBodyOffset(i);e._validateBody(n,o),e._parseBody(n,o)}by.prototype.load=function(){return l(this._loadPromise)?this._loadPromise:(this._loadPromise=IDt(this).catch(function(e){console.error(e)}),this._loadPromise)};by.prototype._parseValue=function(e,t,n){let i;if(t==="UInt8")i=e.getUint8(n),n+=1;else if(t==="Int8")i=e.getInt8(n),n+=1;else if(t==="UInt16")i=e.getUint16(n,!0),n+=2;else if(t==="Int16")i=e.getInt16(n,!0),n+=2;else if(t==="UInt32")i=e.getUint32(n,!0),n+=4;else if(t==="Oid32")i=e.getUint32(n,!0),n+=4;else if(t==="Int32")i=e.getInt32(n,!0),n+=4;else if(t==="UInt64"){let o=e.getUint32(n,!0),r=e.getUint32(n+4,!0);i=o+Math.pow(2,32)*r,n+=8}else if(t==="Int64"){let o=e.getUint32(n,!0),r=e.getUint32(n+4,!0);r<Math.pow(2,31)?i=o+Math.pow(2,32)*r:i=o+Math.pow(2,32)*(r-Math.pow(2,32)),n+=8}else t==="Float32"?(i=e.getFloat32(n,!0),n+=4):t==="Float64"?(i=e.getFloat64(n,!0),n+=8):t==="String"&&(i=String.fromCharCode(e.getUint8(n)),n+=1);return{value:i,offset:n}};by.prototype._parseHeader=function(e){let t=0;this._header={};for(let n=0;n<this._storageInfo.header.length;n++){let i=this._storageInfo.header[n],o=this._parseValue(e,i.valueType,t);this._header[i.property]=o.value,t=o.offset}return t};by.prototype._parseBody=function(e,t){this._values={};for(let n=0;n<this._storageInfo.ordering.length;n++){let i=this._storageInfo.ordering[n],o=i==="ObjectIds"?"objectIds":i,r=this._storageInfo[o];if(l(r)){this._values[o]=[];for(let s=0;s<this._header.count;++s)if(r.valueType!=="String"){let a=this._parseValue(e,r.valueType,t);this._values[o].push(a.value),t=a.offset}else{let a=this._values.attributeByteCounts[s],c="";for(let d=0;d<a;++d){let u=this._parseValue(e,r.valueType,t);u.value.charCodeAt(0)!==0&&(c+=u.value),t=u.offset}this._values[o].push(c)}}}};by.prototype._getBodyOffset=function(e){let t=0;return l(this._storageInfo.attributeValues)?t=ZJ(this._storageInfo.attributeValues.valueType):l(this._storageInfo.objectIds)&&(t=ZJ(this._storageInfo.objectIds.valueType)),t>0?Math.ceil(e/t)*t:e};by.prototype._validateHeader=function(e){let t=0;for(let n=0;n<this._storageInfo.header.length;n++){let i=this._storageInfo.header[n];t+=FDt(i.valueType)}if(e.byteLength<t)throw new ae(`Invalid attribute buffer size (field: ${this.name}, header: ${t}, actual: ${e.byteLength})`)};by.prototype._validateBody=function(e,t){if(!l(this._header.count))throw new ae(`Invalid attribute buffer (field: ${this.name}, count is missing)`);let n;for(let i=0;i<this._storageInfo.ordering.length&&t<e.byteLength;i++){let o=this._storageInfo.ordering[i],r=o==="ObjectIds"?"objectIds":o,s=this._storageInfo[r];if(l(s))if(s.valueType!=="String"){r==="attributeByteCounts"&&(n=t);let a=ZJ(s.valueType);t+=a*this._header.count}else{if(!l(n))throw new ae(`Invalid attribute buffer (field: ${this.name}, attributeByteCounts is missing)`);for(let a=0;a<this._header.count&&t<e.byteLength;++a){let c=this._parseValue(e,this._storageInfo.attributeByteCounts.valueType,n);t+=c.value,n=c.offset}}else throw new ae(`Invalid attribute buffer (field: ${this.name}, ${r} is missing)`)}if(e.byteLength<t)throw new ae(`Invalid attribute buffer size (field: ${this.name}, expected: ${t}, actual: ${e.byteLength})`)};var BU=by;var G9o=x(T(),1);function zU(e,t){let n=e._dataProvider,i=e._layer,o;l(e._nodeIndex)?o=i.resource.getDerivedResource({url:`nodes/${e._data.mesh.geometry.resource}/${t}`}):o=e.resource.getDerivedResource({url:t}),this._parent=e,this._dataProvider=n,this._layer=i,this._resource=o,this._customAttributes=void 0}Object.defineProperties(zU.prototype,{resource:{get:function(){return this._resource}},data:{get:function(){return this._data}},customAttributes:{get:function(){return this._customAttributes}}});zU.prototype.load=function(){let e=this;return this._dataProvider._loadBinary(this._resource).then(function(t){return e._data=t,t})};var PDt=new h,XDt=new h,NDt=new h,YDt=new h,MDt=new h;function cce(e,t,n,i){let o=h.subtract(i,n,PDt),r=h.cross(o,h.subtract(e,n,XDt),YDt),s=h.cross(o,h.subtract(t,n,NDt),MDt);return h.dot(r,s)>=0}var wDt=new h,kDt=new h,UDt=new h,DDt=new h,ODt=new h,BDt=new h,zDt=new h,HDt=new h,KDt=new h,JDt=new h;zU.prototype.getClosestPointIndexOnTriangle=function(e,t,n){if(l(this._customAttributes)&&l(this._customAttributes.positions)){let i=new h(e,t,n);i.x-=this._customAttributes.cartesianCenter.x,i.y-=this._customAttributes.cartesianCenter.y,i.z-=this._customAttributes.cartesianCenter.z,q.multiplyByVector(this._customAttributes.parentRotation,i,i);let o=Number.MAX_VALUE,r,s,a,c,d=this._customAttributes.positions,u=this._customAttributes.indices,m;l(u)?m=u.length:m=d.length/3;for(let p=0;p<m;p++){let b,f,y;l(u)?(b=u[p],f=u[p+1],y=u[p+2]):(b=p*3,f=p*3+1,y=p*3+2);let _=h.fromElements(d[b*3],d[b*3+1],d[b*3+2],wDt),S=h.fromElements(d[f*3],d[f*3+1],d[f*3+2],kDt),Z=new h(d[y*3],d[y*3+1],d[y*3+2],UDt);if(!cce(i,_,S,Z)||!cce(i,S,_,Z)||!cce(i,Z,_,S))continue;let R=h.subtract(S,_,DDt),C=h.subtract(Z,_,ODt),E=h.cross(R,C,BDt);if(h.magnitude(E)===0)continue;let A=h.normalize(E,zDt),L=h.subtract(i,_,HDt),F=Math.abs(h.dot(L,A));if(F<o){o=F,r=p;let I=h.magnitudeSquared(h.subtract(i,_,L)),N=h.magnitudeSquared(h.subtract(i,S,KDt)),g=h.magnitudeSquared(h.subtract(i,Z,JDt));I<N&&I<g?(a=b,c=_,s=I):N<g?(a=f,c=S,s=N):(a=y,c=Z,s=g)}}if(l(r))return{index:a,distanceSquared:s,distance:Math.sqrt(s),queriedPosition:i,closestPosition:h.clone(c)}}return{index:-1,distanceSquared:Number.Infinity,distance:Number.Infinity}};function VNe(e){let t=[],n=e.length;for(let i=0;i<n;i++)i<3?t.push(IR(e[i])):t.push(e[i]);return t}zU.prototype._generateGltf=function(e,t,n,i,o,r,s,a){let c={pbrMetallicRoughness:{metallicFactor:0},doubleSided:!0,name:"Material"},d=!1,u,m="";if(l(this._parent._data.mesh)&&l(this._layer._data.materialDefinitions)){let R=this._parent._data.mesh.material.definition;if(R>=0&&R<this._layer._data.materialDefinitions.length){if(u=this._layer._data.materialDefinitions[R],c=u,l(c.pbrMetallicRoughness)&&l(c.pbrMetallicRoughness.baseColorTexture)){d=!0,c.pbrMetallicRoughness.baseColorTexture.index=0;let C="0";if(l(this._layer._data.textureSetDefinitions))for(let E=0;E<this._layer._data.textureSetDefinitions.length;E++){let A=this._layer._data.textureSetDefinitions[E];for(let L=0;L<A.formats.length;L++){let F=A.formats[L];if(F.format==="jpg"){C=F.name;break}}}l(this._parent._data.mesh)&&this._parent._data.mesh.material.resource>=0&&(m=this._layer.resource.getDerivedResource({url:`nodes/${this._parent._data.mesh.material.resource}/textures/${C}`}).url)}l(c.pbrMetallicRoughness)&&l(c.pbrMetallicRoughness.baseColorFactor)&&(c.pbrMetallicRoughness.baseColorFactor=VNe(c.pbrMetallicRoughness.baseColorFactor)),l(c.emissiveFactor)&&(c.emissiveFactor=VNe(c.emissiveFactor))}}else l(this._parent._data.textureData)&&(d=!0,m=this._parent.resource.getDerivedResource({url:`${this._parent._data.textureData[0].href}`}).url,c.pbrMetallicRoughness.baseColorTexture={index:0});l(c.alphaMode)&&(c.alphaMode=c.alphaMode.toUpperCase());let p=[],b=[],f=[];d&&(p=[{sampler:0,source:0}],b=[{uri:m}],f=[{magFilter:9729,minFilter:9986,wrapS:10497,wrapT:10497}]);let y=[],_=n.length;for(let Z=0;Z<_;Z++){let R=n[Z].primitives,C=R.length;for(let E=0;E<C;E++){let A=R[E];if(l(A.material)){for(;A.material>=y.length;){let F=$e(c,!0);y.push(F)}let L=y[A.material];l(A.extra)&&A.extra.isTransparent?l(L.alphaMode)||(L.alphaMode="BLEND"):L.alphaMode==="BLEND"&&(L.alphaMode="OPAQUE")}}}return{scene:0,scenes:[{nodes:e}],nodes:t,meshes:n,buffers:i,bufferViews:o,accessors:r,materials:y,textures:p,images:b,samplers:f,asset:{version:"2.0"},extensions:s,extensionsUsed:a}};var FA=zU;function El(e,t,n){let i,o,r,s;n?(i=0,o=e):(i=e._level+1,o=e._layer),typeof t=="number"?r=t:s=e.resource.getDerivedResource({url:`${t}/`}),this._parent=e,this._dataProvider=e._dataProvider,this._isRoot=n,this._level=i,this._layer=o,this._nodeIndex=r,this._resource=s,this._isLoading=!1,this._tile=void 0,this._data=void 0,this._geometryData=[],this._featureData=[],this._fields={},this._children=[],this._childrenReadyPromise=void 0,this._globalTransform=void 0,this._inverseGlobalTransform=void 0,this._inverseRotationMatrix=void 0,this._symbologyData=void 0}Object.defineProperties(El.prototype,{resource:{get:function(){return this._resource}},layer:{get:function(){return this._layer}},parent:{get:function(){return this._parent}},children:{get:function(){return this._children}},geometryData:{get:function(){return this._geometryData}},featureData:{get:function(){return this._featureData}},fields:{get:function(){return this._fields}},tile:{get:function(){return this._tile}},data:{get:function(){return this._data}}});El.prototype.load=async function(){let e=this;function t(){if(!e._isRoot){let o=e._create3DTileDefinition();e._tile=new th(e._layer._tileset,e._dataProvider.resource,o,e._parent._tile),e._tile._i3sNode=e}}if(!l(this._nodeIndex)){let o=await up.loadJson(this._resource);e._data=o,t();return}let n=await this._layer._getNodeInNodePages(this._nodeIndex);e._data=n;let i;e._isRoot?i="nodes/root/":l(n.mesh)&&(i=`../${n.mesh.geometry.resource}/`),l(i)&&l(e._parent.resource)&&(e._resource=e._parent.resource.getDerivedResource({url:i})),t()};function ENe(e,t){let n=new BU(e,t);return e._fields[t.name]=n,n.load()}El.prototype.loadFields=function(){let e=this._layer._data.attributeStorageInfo,t=[];if(l(e))for(let n=0;n<e.length;n++){let i=e[n],o=this._fields[i.name];l(o)?t.push(o.load()):t.push(ENe(this,i))}return Promise.all(t)};El.prototype.loadField=function(e){let t=this._fields[e];if(l(t))return t.load();let n=this._layer._data.attributeStorageInfo;if(l(n))for(let i=0;i<n.length;i++){let o=n[i];if(o.name===e)return ENe(this,o)}return Promise.resolve()};El.prototype.getFieldsForPickedPosition=function(e){let t=this.geometryData[0];if(!l(t.customAttributes.featureIndex))return{};let n=t.getClosestPointIndexOnTriangle(e.x,e.y,e.z);if(n.index===-1||n.index>t.customAttributes.featureIndex.length)return{};let i=t.customAttributes.featureIndex[n.index];return this.getFieldsForFeature(i)};El.prototype.getFieldsForFeature=function(e){let t={};for(let n in this.fields)if(this.fields.hasOwnProperty(n)){let i=this.fields[n];e>=0&&e<i.values.length&&(t[i.name]=i.values[e])}return t};El.prototype._loadChildren=function(){let e=this;if(l(this._childrenReadyPromise))return this._childrenReadyPromise;let t=[];if(l(e._data.children))for(let n=0;n<e._data.children.length;n++){let i=e._data.children[n],o=new El(e,i.href??i,!1);e._children.push(o),t.push(o.load())}return this._childrenReadyPromise=Promise.all(t).then(function(){for(let n=0;n<e._children.length;n++)e._tile.children.push(e._children[n]._tile)}),this._childrenReadyPromise};El.prototype._loadGeometryData=function(){let e=[];if(l(this._data.geometryData))for(let t=0;t<this._data.geometryData.length;t++){let n=new FA(this,this._data.geometryData[t].href);this._geometryData.push(n),e.push(n.load())}else if(l(this._data.mesh)){let t=this._layer._findBestGeometryBuffers(this._data.mesh.geometry.definition,["position","uv0"]),n=`./geometries/${t.bufferIndex}/`,i=new FA(this,n);i._geometryDefinitions=t.definition,i._geometryBufferInfo=t.geometryBufferInfo,this._geometryData.push(i),e.push(i.load())}return Promise.all(e)};El.prototype._loadFeatureData=function(){let e=[];if(l(this._data.featureData))for(let t=0;t<this._data.featureData.length;t++){let n=new OU(this,this._data.featureData[t].href);this._featureData.push(n),e.push(n.load())}return Promise.all(e)};El.prototype._clearGeometryData=function(){this._geometryData=[]};El.prototype._create3DTileDefinition=function(){let e=this._data.obb,t=this._data.mbs;if(!l(e)&&!l(t)){console.error("Failed to load I3S node. Bounding volume is required.");return}let n;if(l(e)?n=pe.fromDegrees(e.center[0],e.center[1],e.center[2]):n=pe.fromDegrees(t[0],t[1],t[2]),l(this._dataProvider._geoidDataList)&&l(n))for(let S=0;S<this._dataProvider._geoidDataList.length;S++){let Z=this._dataProvider._geoidDataList[S],R=Z.projection.project(n);if(R.x>Z.nativeExtent.west&&R.x<Z.nativeExtent.east&&R.y>Z.nativeExtent.south&&R.y<Z.nativeExtent.north){n.height+=$Dt(R.x,R.y,Z);break}}let i,o,r;l(e)?(i={box:[0,0,0,e.halfSize[0],0,0,0,e.halfSize[1],0,0,0,e.halfSize[2]]},r=Math.max(Math.max(this._data.obb.halfSize[0],this._data.obb.halfSize[1]),this._data.obb.halfSize[2]),o=ne.WGS84.cartographicToCartesian(n)):(i={sphere:[0,0,0,t[3]]},o=ne.WGS84.cartographicToCartesian(n),r=this._data.mbs[3]),r*=2;let s=1/0;if(l(this._data.lodThreshold))if(this._layer._data.nodePages.lodSelectionMetricType==="maxScreenThresholdSQ"){let S=Math.sqrt(this._data.lodThreshold/(Math.PI*.25));s=r/S}else if(this._layer._data.nodePages.lodSelectionMetricType==="maxScreenThreshold"){let S=this._data.lodThreshold;s=r/S}else console.error("Invalid lodSelectionMetricType in Layer");else if(l(this._data.lodSelection))for(let S=0;S<this._data.lodSelection.length;S++)this._data.lodSelection[S].metricType==="maxScreenThreshold"&&(s=r/this._data.lodSelection[S].maxError);s===1/0&&(s=1e5);let a=s*16,c=new Cc(0,0,0),d=_t.headingPitchRollQuaternion(o,c);l(this._data.obb)&&(d=new Ne(this._data.obb.quaternion[0],this._data.obb.quaternion[1],this._data.obb.quaternion[2],this._data.obb.quaternion[3]));let u=q.fromQuaternion(d),m=q.inverse(u,new q),p=new P(u[0],u[1],u[2],0,u[3],u[4],u[5],0,u[6],u[7],u[8],0,o.x,o.y,o.z,1),b=P.inverse(p,new P),f=P.clone(p);l(this._parent._globalTransform)&&P.multiply(p,this._parent._inverseGlobalTransform,f),this._globalTransform=p,this._inverseGlobalTransform=b,this._inverseRotationMatrix=m;let y=[];for(let S=0;S<this._children.length;S++)y.push(this._children[S]._create3DTileDefinition());return{children:y,refine:"REPLACE",boundingVolume:i,transform:[f[0],f[4],f[8],f[12],f[1],f[5],f[9],f[13],f[2],f[6],f[10],f[14],f[3],f[7],f[11],f[15]],content:{uri:l(this._resource)?this._resource.url:void 0},geometricError:a}};El.prototype._loadSymbology=async function(){!l(this._symbologyData)&&l(this._layer._symbology)&&(this._symbologyData=await this._layer._symbology._getSymbology(this))};El.prototype._createContentURL=async function(){let e={scene:0,scenes:[{nodes:[0]}],nodes:[{name:"singleNode"}],meshes:[],buffers:[],bufferViews:[],accessors:[],materials:[],textures:[],images:[],samplers:[],asset:{version:"2.0"}},t=[this._loadGeometryData()];if(this._dataProvider.legacyVersion16&&t.push(this._loadFeatureData()),await Promise.all(t),l(this._geometryData)&&this._geometryData.length>0){this._dataProvider._applySymbology&&await this._loadSymbology();let o=this._geometryData[0].resource.url,r=this._layer._data.store.defaultGeometrySchema,s=this._geometryData[0],a=await DU.decode(o,r,s,this._featureData[0],this._symbologyData);if(!l(a))return;e=s._generateGltf(a.meshData.nodesInScene,a.meshData.nodes,a.meshData.meshes,a.meshData.buffers,a.meshData.bufferViews,a.meshData.accessors,a.meshData.rootExtensions,a.meshData.extensionsUsed),this._geometryData[0]._customAttributes=a.meshData._customAttributes}let n=this._dataProvider._binarizeGltf(e),i=new Blob([n],{type:"application/binary"});return URL.createObjectURL(i)};async function jDt(e){let t=e._layer._filters,n=[];for(let i=0;i<t.length;i++){let o=e.loadField(t[i].name);n.push(o)}return await Promise.all(n),t}function QDt(e,t,n){if(!l(n.values)||n.values.length===0)return!1;let i=l(t)?t.values:[],o;e<i.length&&(o=i[e]);let r=!1;for(let s=0;s<n.values.length;s++)if(n.values[s]===o){r=!0;break}return r}async function ANe(e,t){let n=e._tile.content.batchTable;if(l(n)&&n.featuresLength>0){n.setAllShow(!0);let i=await jDt(e);if(i.length>0)for(let o=0;o<n.featuresLength;o++)for(let r=0;r<i.length;r++){let s=i[r];if(!QDt(o,e._fields[s.name],s)){n.setShow(o,!1);break}}}t.show=!0}El.prototype._filterFeatures=function(){let e=[];for(let n=0;n<this._children.length;n++){let i=this._children[n]._filterFeatures();e.push(i)}let t=this._tile?.content?._model;if(l(this._geometryData)&&this._geometryData.length>0&&l(t)&&t.ready){t.show=!1;let n=ANe(this,t);e.push(n)}return Promise.all(e)};th.prototype._hookedRequestContent=th.prototype.requestContent;th.prototype.requestContent=function(){if(!this.tileset._isI3STileSet)return this._hookedRequestContent();if(!this._isLoading){this._isLoading=!0;let e=this;return this._i3sNode._createContentURL().then(t=>{if(!l(t)){e._isLoading=!1;return}return e._contentResource=new ve({url:t}),e._hookedRequestContent()}).then(t=>{let n=t?._model;return l(e._i3sNode._geometryData)&&e._i3sNode._geometryData.length>0&&l(n)&&(n.show=!1,n.readyEvent.addEventListener(()=>{ANe(e._i3sNode,n)})),e._isLoading=!1,t})}};function qDt(e,t,n,i,o,r){let s=n*(1-e)+i*e,a=o*(1-e)+r*e;return s*(1-t)+a*t}function RJ(e,t,n,i){let o=e+t*n;return i[o]}function $Dt(e,t,n){let i=n.nativeExtent,o=(e-i.west)/(i.east-i.west)*(n.width-1),r=(t-i.south)/(i.north-i.south)*(n.height-1),s=Math.floor(o),a=Math.floor(r);o-=s,r-=a;let c=s<n.width?s+1:s,d=a<n.height?a+1:a;a=n.height-1-a,d=n.height-1-d;let u=RJ(s,a,n.width,n.buffer),m=RJ(c,a,n.width,n.buffer),p=RJ(s,d,n.width,n.buffer),b=RJ(c,d,n.width,n.buffer),f=qDt(o,r,u,m,p,b);return f=f*n.scale+n.offset,f}Object.defineProperties(th.prototype,{i3sNode:{get:function(){return this._i3sNode}}});var IA=El;var Q9o=x(T(),1);function CJ(e){this._layer=e,this._defaultSymbology=void 0,this._valueFields=[],this._uniqueValueHash=void 0,this._classBreaksHash=void 0,this._parseLayerSymbology()}Object.defineProperties(CJ.prototype,{defaultSymbology:{get:function(){return this._defaultSymbology}}});function lce(e,t){let n=[];for(let i=0;i<e.length;i++){let o=U.byteToFloat(e[i]);i<3?n.push(IR(o)):n.push(o)}return n.length===3&&(l(t)?n.push(1-t/100):n.push(1)),n}function PA(e,t){let n={edges:void 0,material:void 0};if(l(e)&&l(e.symbolLayers))for(let i=0;i<e.symbolLayers.length;i++){let o=e.symbolLayers[i];if(o.type==="Fill"){let r=o.edges,s=o.outline;if(l(r)?(n.edges={},l(r.color)&&(n.edges.color=lce(r.color,r.transparency))):l(s)&&(n.edges={},l(s.color)&&(n.edges.color=lce(s.color,s.transparency))),!t){let a=o.material;l(a)&&(n.material={colorMixMode:a.colorMixMode},l(a.color)&&(n.material.color=lce(a.color,a.transparency)))}break}}return n}function eOt(e,t){if(l(e.uniqueValueGroups)){let n={};for(let i=0;i<e.uniqueValueGroups.length;i++){let o=e.uniqueValueGroups[i].classes;if(l(o))for(let r=0;r<o.length;r++){let s=PA(o[r].symbol,t),a=o[r].values;for(let c=0;c<a.length;c++){let d=a[c],u=n;for(let m=0;m<d.length;m++){let p=d[m];m===d.length-1?u[p]=s:(l(u[p])||(u[p]={}),u=u[p])}}}}return n}if(l(e.uniqueValueInfos)){let n={};for(let i=0;i<e.uniqueValueInfos.length;i++){let o=e.uniqueValueInfos[i];n[o.value]=PA(o.symbol,t)}return n}}function tOt(e,t){if(l(e.classBreakInfos)){let n=[...e.classBreakInfos];n.sort(function(o,r){let s=o.classMaxValue??o.classMinValue,a=r.classMaxValue??r.classMinValue;return s-a});let i={ranges:[],symbols:[]};l(e.minValue)&&(i.ranges.push(e.minValue),i.symbols.push(void 0));for(let o=0;o<n.length;o++){let r=n[o];l(r.classMinValue)&&(i.ranges.length===0||r.classMinValue>i.ranges[i.ranges.length-1])&&(i.ranges.push(r.classMinValue),i.symbols.push(void 0)),l(r.classMaxValue)&&(i.ranges.length===0||r.classMaxValue>i.ranges[i.ranges.length-1])&&(i.ranges.push(r.classMaxValue),i.symbols.push(PA(r.symbol,t)))}return i.symbols.push(void 0),i}}CJ.prototype._parseLayerSymbology=function(){let e=this._layer.data.drawingInfo;if(l(e)&&l(e.renderer)){let t=this._layer.data.cachedDrawingInfo,n=l(t)&&t.color===!0,i=e.renderer;i.type==="simple"?this._defaultSymbology=PA(i.symbol,n):i.type==="uniqueValue"?(this._defaultSymbology=PA(i.defaultSymbol,n),this._valueFields.push(i.field1),l(i.field2)&&this._valueFields.push(i.field2),l(i.field3)&&this._valueFields.push(i.field3),this._uniqueValueHash=eOt(i,n)):i.type==="classBreaks"&&(this._defaultSymbology=PA(i.defaultSymbol,n),this._valueFields.push(i.field),this._classBreaksHash=tOt(i,n))}};function GNe(e,t,n,i){let o=t[n];if(i<o.length){let r=o[i],s=e[r];return l(s)&&++n<t.length?GNe(s,t,n,i):s}}function nOt(e,t){let n=0,i=e.length;if(n<i)do{let o=n+i>>>1;e[o]<t?n=o+1:i=o}while(n<i);return n}function iOt(e,t,n){let i=t[n],o=nOt(e.ranges,i);return e.symbols[o]}CJ.prototype._getSymbology=async function(e){let t={default:this._defaultSymbology};if(this._valueFields.length>0){let n=[];for(let r=0;r<this._valueFields.length;r++)n.push(e.loadField(this._valueFields[r]));await Promise.all(n);let i=[];for(let r=0;r<this._valueFields.length;r++)i.push(e.fields[this._valueFields[r]].values);let o;if(l(this._uniqueValueHash)?o=r=>GNe(this._uniqueValueHash,i,0,r):l(this._classBreaksHash)&&(o=r=>iOt(this._classBreaksHash,i[0],r)),l(o)){let r=i[0];for(let s=0;s<r.length;s++){let a=o(s);l(a)&&(t[s]=a)}}}return t};var HU=CJ;function hu(e,t,n){this._dataProvider=e,this._parent=n,!l(t.href)&&l(t.id)&&(t.href=`layers/${t.id}`);let i=this._parent.resource.getUrlComponent(),o;i.match(/layers\/\d/)?o=`${i}`.replace(/\/+$/,""):o=`${i}`.replace(/\/?$/,"/").concat(`${t.href}`),this._version=t.store.version;let r=this._version.split(".");this._majorVersion=parseInt(r[0]),this._minorVersion=r.length>1?parseInt(r[1]):0,this._resource=new ve({url:o}),this._resource.setQueryParameters(this._dataProvider.resource.queryParameters),this._resource.appendForwardSlash(),this._data=t,this._rootNode=void 0,this._nodePages={},this._nodePageFetches={},this._extent=void 0,this._tileset=void 0,this._geometryDefinitions=void 0,this._filters=[],this._symbology=void 0,this._computeGeometryDefinitions(!0),this._computeExtent()}Object.defineProperties(hu.prototype,{resource:{get:function(){return this._resource}},rootNode:{get:function(){return this._rootNode}},tileset:{get:function(){return this._tileset}},data:{get:function(){return this._data}},version:{get:function(){return this._version}},majorVersion:{get:function(){return this._majorVersion}},minorVersion:{get:function(){return this._minorVersion}},legacyVersion16:{get:function(){if(l(this.version))return this.majorVersion<1||this.majorVersion===1&&this.minorVersion<=6}}});hu.prototype.load=async function(e){if(this._data.spatialReference.wkid!==4326)throw new ae(`Unsupported spatial reference: ${this._data.spatialReference.wkid}`);if(this._dataProvider.applySymbology&&(this._symbology=new HU(this)),await this._dataProvider.loadGeoidData(),await this._loadRootNode(e),await this._create3DTileset(e),this._rootNode._tile=this._tileset._root,this._tileset._root._i3sNode=this._rootNode,this.legacyVersion16)return this._rootNode._loadChildren()};hu.prototype._computeGeometryDefinitions=function(e){if(this._geometryDefinitions=[],l(this._data.geometryDefinitions))for(let t=0;t<this._data.geometryDefinitions.length;t++){let n=[],i=this._data.geometryDefinitions[t].geometryBuffers;for(let o=0;o<i.length;o++){let r=i[o],s=[],a=!1;if(l(r.compressedAttributes)&&e){a=!0;let c=r.compressedAttributes.attributes;for(let d=0;d<c.length;d++)s.push(c[d])}else for(let c in r)c!=="offset"&&s.push(c);n.push({compressed:a,attributes:s,index:i.indexOf(r)})}n.sort(function(o,r){return o.compressed&&!r.compressed?-1:!o.compressed&&r.compressed?1:o.attributes.length-r.attributes.length}),this._geometryDefinitions.push(n)}};hu.prototype._findBestGeometryBuffers=function(e,t){let n=this._geometryDefinitions[e];if(l(n)){for(let i=0;i<n.length;++i){let o=n[i],r=!1,s=o.attributes;for(let a=0;a<t.length;a++)if(!s.includes(t[a])){r=!0;break}if(!r)return{bufferIndex:o.index,definition:n,geometryBufferInfo:o}}if(l(n[0]))return{bufferIndex:0,definition:n,geometryBufferInfo:n[0]}}};hu.prototype._loadRootNode=function(e){if(l(this._data.nodePages)){let t=0;l(this._data.nodePages.rootIndex)&&(t=this._data.nodePages.rootIndex),this._rootNode=new IA(this,t,!0)}else this._rootNode=new IA(this,this._data.store.rootNode,!0);return this._rootNode.load(e)};hu.prototype._getNodeInNodePages=function(e){let t=Math.floor(e/this._data.nodePages.nodesPerPage),n=e%this._data.nodePages.nodesPerPage;return this._loadNodePage(t).then(function(i){return i.nodes[n]})};hu._fetchJson=function(e){return e.fetchJson()};hu.prototype._loadNodePage=function(e){let t=this;if(!l(this._nodePageFetches[e])){let n=this.resource.getDerivedResource({url:`nodepages/${e}/`}),i=hu._fetchJson(n).then(function(o){return l(o.error)&&o.error.code!==200?Promise.reject(o.error):(t._nodePages[e]=o.nodes,o)});this._nodePageFetches[e]=i}return this._nodePageFetches[e]};hu.prototype._computeExtent=function(){l(this._data.fullExtent)?this._extent=re.fromDegrees(this._data.fullExtent.xmin,this._data.fullExtent.ymin,this._data.fullExtent.xmax,this._data.fullExtent.ymax):l(this._data.store.extent)&&(this._extent=re.fromDegrees(this._data.store.extent[0],this._data.store.extent[1],this._data.store.extent[2],this._data.store.extent[3]))};hu.prototype._create3DTileset=async function(e){let t={asset:{version:"1.0"},geometricError:Number.MAX_VALUE,root:this._rootNode._create3DTileDefinition()},n=new Blob([JSON.stringify(t)],{type:"application/json"}),i=URL.createObjectURL(n),o=this._symbology?.defaultSymbology?.edges?.color;l(o)&&!l(e?.outlineColor)&&(e=l(e)?$e(e):{},e.outlineColor=U.fromCartesian4(ce.fromArray(o))),this._tileset=await zr.fromUrl(i,e),this._tileset.show=this._parent.show,this._tileset._isI3STileSet=!0,this._tileset.tileUnload.addEventListener(function(r){r._i3sNode._clearGeometryData(),URL.revokeObjectURL(r._contentResource._url),r._contentResource=r._i3sNode.resource}),this._tileset.tileVisible.addEventListener(function(r){l(r._i3sNode)&&r._i3sNode._loadChildren()})};hu.prototype._updateVisibility=function(){l(this._tileset)&&(this._tileset.show=this._parent.show)};hu.prototype.filterByAttributes=function(e){this._filters=l(e)?$e(e,!0):[];let t=this._rootNode;return l(t)?t._filterFeatures():Promise.resolve()};var kR=hu;var fko=x(T(),1);function VJ(e,t){this._dataProvider=e,this._resource=new ve({url:t}),this._resource.setQueryParameters(e.resource.queryParameters),this._resource.appendForwardSlash()}Object.defineProperties(VJ.prototype,{resource:{get:function(){return this._resource}},data:{get:function(){return this._data}},names:{get:function(){let e=[],t=this._data.summary;if(l(t))for(let n=0;n<t.length;++n)e.push(t[n].fieldName);return e}}});VJ.prototype.load=async function(){return this._data=await up.loadJson(this._resource),this._data};VJ.prototype._getValues=function(e){let t=this._data.summary;if(l(t))for(let n=0;n<t.length;++n){let i=t[n];if(i.fieldName===e)return l(i.mostFrequentValues)?[...i.mostFrequentValues]:[]}};var KU=VJ;var Tko=x(T(),1);function JU(e,t,n){this._dataProvider=e,this._parent=t,this._data=n,this._name=n.name,this._modelName=n.modelName,this._visibility=n.visibility??!0,this._resource=void 0,this._sublayers=[],this._i3sLayers=[]}Object.defineProperties(JU.prototype,{resource:{get:function(){return this._resource}},data:{get:function(){return this._data}},name:{get:function(){return this._name}},modelName:{get:function(){return this._modelName}},sublayers:{get:function(){return this._sublayers}},visibility:{get:function(){return this._visibility},set:function(e){if(this._visibility!==e){this._visibility=e;for(let t=0;t<this._i3sLayers.length;t++)this._i3sLayers[t]._updateVisibility()}}},show:{get:function(){return this._visibility&&this._parent.show}}});JU._fromData=async function(e,t,n,i){let o=new JU(e,i,n);if(o._data.layerType==="group"){let r=o._data.sublayers;if(l(r)){let s=[];for(let c=0;c<r.length;c++){let d=JU._fromData(e,t,r[c],o);s.push(d)}let a=await Promise.all(s);for(let c=0;c<a.length;c++){let d=a[c];o._sublayers.push(d),o._i3sLayers.push(...d._i3sLayers)}}}else if(o._data.layerType==="3DObject"){let r=t.concat(`/sublayers/${o._data.id}`),s=new ve({url:r});s.setQueryParameters(e.resource.queryParameters),s.appendForwardSlash(),o._resource=s;let a=await up.loadJson(o._resource),c=new kR(e,a,o);o._i3sLayers.push(c)}else console.log(`${o._data.layerType} layer ${o._data.name} is skipped as not supported.`);return o};var jU=JU;var vNe=x(LNe(),1);function da(e){e=e??B.EMPTY_OBJECT,this._name=e.name,this._show=e.show??!0,this._geoidTiledTerrainProvider=e.geoidTiledTerrainProvider,this._showFeatures=e.showFeatures??!1,this._adjustMaterialAlphaMode=e.adjustMaterialAlphaMode??!1,this._applySymbology=e.applySymbology??!1,this._calculateNormals=e.calculateNormals??!1,this._cesium3dTilesetOptions=e.cesium3dTilesetOptions??B.EMPTY_OBJECT,this._layers=[],this._sublayers=[],this._data=void 0,this._extent=void 0,this._geoidDataPromise=void 0,this._geoidDataList=void 0,this._decoderTaskProcessor=void 0,this._taskProcessorReadyPromise=void 0,this._attributeStatistics=[],this._layersExtent=[]}Object.defineProperties(da.prototype,{name:{get:function(){return this._name}},show:{get:function(){return this._show},set:function(e){if(this._show!==e){this._show=e;for(let t=0;t<this._layers.length;t++)this._layers[t]._updateVisibility()}}},geoidTiledTerrainProvider:{get:function(){return this._geoidTiledTerrainProvider}},layers:{get:function(){return this._layers}},sublayers:{get:function(){return this._sublayers}},data:{get:function(){return this._data}},extent:{get:function(){return this._extent}},resource:{get:function(){return this._resource}},showFeatures:{get:function(){return this._showFeatures}},adjustMaterialAlphaMode:{get:function(){return this._adjustMaterialAlphaMode}},applySymbology:{get:function(){return this._applySymbology}},calculateNormals:{get:function(){return this._calculateNormals}}});da.prototype.destroy=function(){for(let e=0;e<this._layers.length;e++)l(this._layers[e]._tileset)&&this._layers[e]._tileset.destroy();return ue(this)};da.prototype.isDestroyed=function(){return!1};da.prototype.update=function(e){for(let t=0;t<this._layers.length;t++)l(this._layers[t]._tileset)&&this._layers[t]._tileset.update(e)};da.prototype.prePassesUpdate=function(e){for(let t=0;t<this._layers.length;t++)l(this._layers[t]._tileset)&&this._layers[t]._tileset.prePassesUpdate(e)};da.prototype.postPassesUpdate=function(e){for(let t=0;t<this._layers.length;t++)l(this._layers[t]._tileset)&&this._layers[t]._tileset.postPassesUpdate(e)};da.prototype.updateForPass=function(e,t){for(let n=0;n<this._layers.length;n++)l(this._layers[n]._tileset)&&this._layers[n]._tileset.updateForPass(e,t)};function oOt(e,t){let n=e.resource.getUrlComponent(),i;return n.match(/layers\/\d/)?i=`${n}`.replace(/\/+$/,""):i=`${n}`.replace(/\/?$/,"/").concat(`layers/${t}`),i}async function WNe(e,t,n){if(t.layerType==="Building"){l(n.showFeatures)||(e._showFeatures=!0),l(n.adjustMaterialAlphaMode)||(e._adjustMaterialAlphaMode=!0),l(n.applySymbology)||(e._applySymbology=!0),l(n.calculateNormals)||(e._calculateNormals=!0);let i=oOt(e,t.id);if(l(t.sublayers)){let o=[];for(let s=0;s<t.sublayers.length;s++){let a=jU._fromData(e,i,t.sublayers[s],e);o.push(a)}let r=await Promise.all(o);for(let s=0;s<r.length;s++){let a=r[s];e._sublayers.push(a),e._layers.push(...a._i3sLayers)}}if(l(t.statisticsHRef)){let o=i.concat(`/${t.statisticsHRef}`),r=new KU(e,o);await r.load(),e._attributeStatistics.push(r)}if(l(t.fullExtent)){let o=re.fromDegrees(t.fullExtent.xmin,t.fullExtent.ymin,t.fullExtent.xmax,t.fullExtent.ymax);e._layersExtent.push(o)}}else if(t.layerType==="3DObject"||t.layerType==="IntegratedMesh"){!l(n.calculateNormals)&&!l(t.textureSetDefinitions)&&(e._calculateNormals=!0);let i=new kR(e,t,e);e._layers.push(i),l(i._extent)&&e._layersExtent.push(i._extent)}else console.log(`${t.layerType} layer ${t.name} is skipped as not supported.`)}da.fromUrl=async function(e,t){t=t??B.EMPTY_OBJECT;let n=ve.createIfNeeded(e);n.setQueryParameters({f:"pjson"},!0);let i=await da.loadJson(n),o=new da(t);if(o._resource=n,o._data=i,l(i.layers)){let s=[];for(let a=0;a<i.layers.length;a++){let c=WNe(o,i.layers[a],t);s.push(c)}await Promise.all(s)}else await WNe(o,i,t);o._computeExtent();let r=[];for(let s=0;s<o._layers.length;s++)r.push(o._layers[s].load(t.cesium3dTilesetOptions));return await Promise.all(r),o};da._fetchJson=function(e){return e.fetchJson()};da.loadJson=async function(e){let t=await da._fetchJson(e);if(l(t.error)){if(console.error("Failed to fetch I3S ",e.url),l(t.error.message)&&console.error(t.error.message),l(t.error.details))for(let n=0;n<t.error.details.length;n++)console.log(t.error.details[n]);throw new ae(t.error)}return t};da.prototype._loadBinary=async function(e){let t=await e.fetchArrayBuffer();if(t.byteLength>0&&new Uint8Array(t)[0]===123&&new TextDecoder().decode(t).includes("404"))throw new ae(`Failed to load binary: ${e.url}`);return t};da.prototype._binarizeGltf=function(e){let n=new TextEncoder().encode(JSON.stringify(e)),i=new Uint8Array(n.byteLength+20),o={magic:new Uint8Array(i.buffer,0,4),version:new Uint32Array(i.buffer,4,1),length:new Uint32Array(i.buffer,8,1),chunkLength:new Uint32Array(i.buffer,12,1),chunkType:new Uint32Array(i.buffer,16,1),chunkData:new Uint8Array(i.buffer,20,n.byteLength)};return o.magic[0]=103,o.magic[1]=108,o.magic[2]=84,o.magic[3]=70,o.version[0]=2,o.length[0]=i.byteLength,o.chunkLength[0]=n.byteLength,o.chunkType[0]=1313821514,o.chunkData.set(n),i};var rOt=new k;function sOt(e,t){let n=e.tilingScheme,i=[],o={},r=e._lodCount,s=pe.fromRadians(t.west,t.north),a=pe.fromRadians(t.east,t.south),c=n.positionToTileXY(s,r),d=n.positionToTileXY(a,r);for(let m=c.x;m<=d.x;m++)for(let p=c.y;p<=d.y;p++){let b=k.fromElements(m,p,rOt),f=b.toString();if(!o.hasOwnProperty(f)){let y={x:b.x,y:b.y,level:r,tilingScheme:n,terrainProvider:e,positions:[]};o[f]=y,i.push(y)}}let u=[];for(let m=0;m<i.length;++m){let p=i[m],b=p.terrainProvider.requestTileGeometry(p.x,p.y,p.level);u.push(b)}return Promise.all(u).then(function(m){let p=[];for(let b=0;b<m.length;b++){let f={tilingScheme:n,x:i[b].x,y:i[b].y,level:i[b].level},y=m[b],_="Geographic";n._projection instanceof Ti&&(_="WebMercator");let S={projectionType:_,projection:n._projection,nativeExtent:n.tileXYToNativeRectangle(f.x,f.y,f.level),height:y._height,width:y._width,scale:y._structure.heightScale,offset:y._structure.heightOffset};if(y._encoding===gh.LERC){let Z=vNe.default.decode(y._buffer);S.buffer=Z.pixels[0]}else S.buffer=y._buffer;p.push(S)}return p})}async function aOt(e){let t=e._geoidTiledTerrainProvider;if(l(t))try{let n=await sOt(t,e._extent);e._geoidDataList=n}catch{console.log("Error retrieving Geoid Terrain tiles - no geoid conversion will be performed.")}}da.prototype.loadGeoidData=async function(){return l(this._geoidDataPromise)?this._geoidDataPromise:(this._geoidDataPromise=aOt(this),this._geoidDataPromise)};da.prototype._computeExtent=function(){let e;for(let t=0;t<this._layersExtent.length;t++){let n=this._layersExtent[t];l(e)?re.union(e,n,e):e=re.clone(n)}this._extent=e};da.prototype.getAttributeNames=function(){let e=[];for(let t=0;t<this._attributeStatistics.length;++t)e.push(...this._attributeStatistics[t].names);return e};da.prototype.getAttributeValues=function(e){for(let t=0;t<this._attributeStatistics.length;++t){let n=this._attributeStatistics[t]._getValues(e);if(l(n))return n}return[]};da.prototype.filterByAttributes=function(e){let t=[];for(let n=0;n<this._layers.length;n++){let i=this._layers[n].filterByAttributes(e);t.push(i)}return Promise.all(t)};var up=da;var zko=x(T(),1);var QU={};QU.createTilesetFromIModelId=async function({iModelId:e,changesetId:t,tilesetOptions:n}){let{exports:i}=await la.getExports(e,t);if(i.length>0&&i.every(c=>c.status===la.ExportStatus.Invalid))throw new ae(`All exports for this iModel are Invalid: ${e}`);let o=i.find(c=>c.status===la.ExportStatus.Complete);if(!l(o))return;let r=new URL(o._links.mesh.href);r.pathname=`${r.pathname}/tileset.json`;let s=r.toString(),a=new ve({url:s});return zr.fromUrl(a,n)};QU.createTilesetForRealityDataId=async function({iTwinId:e,realityDataId:t,type:n,rootDocument:i,tilesetOptions:o}){if(!l(n)||!l(i)){let c=await la.getRealityDataMetadata(e,t);i=c.rootDocument,n=c.type}if(![la.RealityDataType.Cesium3DTiles,la.RealityDataType.PNTS,la.RealityDataType.RealityMesh3DTiles,la.RealityDataType.Terrain3DTiles,la.RealityDataType.GaussianSplat3DTiles].includes(n))throw new ae(`Reality data type is not a mesh type: ${n}`);let s=await la.getRealityDataURL(e,t,i),a={maximumScreenSpaceError:4,...o};return zr.fromUrl(s,a)};QU.createDataSourceForRealityDataId=async function({iTwinId:e,realityDataId:t,type:n,rootDocument:i}){if(!l(n)||!l(i)){let s=await la.getRealityDataMetadata(e,t);i=s.rootDocument,n=s.type}if(![la.RealityDataType.KML,la.RealityDataType.GeoJSON].includes(n))throw new ae(`Reality data type is not a data source type: ${n}`);let r=await la.getRealityDataURL(e,t,i);return n===la.RealityDataType.GeoJSON?mT.load(r):DZ.load(r)};QU.loadGeospatialFeatures=async function({iTwinId:e,collectionId:t,limit:n}){let i=n??1e4,o=`${la.apiEndpoint}geospatial-features/itwins/${e}/ogc/collections/${t}/items`,r=new ve({url:o,headers:{Authorization:la._getAuthorizationHeader(),Accept:"application/vnd.bentley.itwin-platform.v1+json"},queryParameters:{limit:i,client:"CesiumJS"}});return mT.load(r)};var dce=QU;var Jko=x(T(),1);function FNe(){}Object.defineProperties(FNe.prototype,{color:{get:ge.throwInstantiationError},intensity:{get:ge.throwInstantiationError}});var uce=FNe;var nUo=x(T(),1);var cOt=/\/$/,INe=new Lt('© <a href="https://www.mapbox.com/about/maps/">Mapbox</a> © <a href="http://www.openstreetmap.org/copyright">OpenStreetMap</a> <strong><a href="https://www.mapbox.com/map-feedback/">Improve this map</a></strong>');function XA(e){e=e??B.EMPTY_OBJECT;let t=e.styleId,n=e.accessToken;this._defaultAlpha=void 0,this._defaultNightAlpha=void 0,this._defaultDayAlpha=void 0,this._defaultBrightness=void 0,this._defaultContrast=void 0,this._defaultHue=void 0,this._defaultSaturation=void 0,this._defaultGamma=void 0,this._defaultMinificationFilter=void 0,this._defaultMagnificationFilter=void 0;let i=ve.createIfNeeded(e.url??"https://api.mapbox.com/styles/v1/");this._styleId=t,this._accessToken=n;let o=e.tilesize??512;this._tilesize=o;let r=e.username??"mapbox";this._username=r;let s=l(e.scaleFactor)?"@2x":"",a=i.getUrlComponent();cOt.test(a)||(a+="/"),a+=`${this._username}/${t}/tiles/${this._tilesize}/{z}/{x}/{y}${s}`,i.url=a,i.setQueryParameters({access_token:n});let c;l(e.credit)?(c=e.credit,typeof c=="string"&&(c=new Lt(c))):c=INe,this._resource=i,this._imageryProvider=new Ss({url:i,credit:c,ellipsoid:e.ellipsoid,minimumLevel:e.minimumLevel,maximumLevel:e.maximumLevel,rectangle:e.rectangle})}Object.defineProperties(XA.prototype,{url:{get:function(){return this._imageryProvider.url}},rectangle:{get:function(){return this._imageryProvider.rectangle}},tileWidth:{get:function(){return this._imageryProvider.tileWidth}},tileHeight:{get:function(){return this._imageryProvider.tileHeight}},maximumLevel:{get:function(){return this._imageryProvider.maximumLevel}},minimumLevel:{get:function(){return this._imageryProvider.minimumLevel}},tilingScheme:{get:function(){return this._imageryProvider.tilingScheme}},tileDiscardPolicy:{get:function(){return this._imageryProvider.tileDiscardPolicy}},errorEvent:{get:function(){return this._imageryProvider.errorEvent}},credit:{get:function(){return this._imageryProvider.credit}},proxy:{get:function(){return this._imageryProvider.proxy}},hasAlphaChannel:{get:function(){return this._imageryProvider.hasAlphaChannel}}});XA.prototype.getTileCredits=function(e,t,n){};XA.prototype.requestImage=function(e,t,n,i){return this._imageryProvider.requestImage(e,t,n,i)};XA.prototype.pickFeatures=function(e,t,n,i,o){return this._imageryProvider.pickFeatures(e,t,n,i,o)};XA._defaultCredit=INe;var mce=XA;var CUo=x(T(),1);var fUo=x(T(),1);var lOt=0,dOt=14,uOt=-1e3,mOt=1e4,hOt=2*Math.PI*ne.WGS84.maximumRadius,fOt=256,pOt=new re,bOt=new re,hce=class{constructor(t,n){n=n??{},this._resource=ve.createIfNeeded(t),this._urlTemplate=this._resource.url,this._extent=re.clone(n.extent),this._minZoom=n.minZoom??lOt,this._maxZoom=n.maxZoom??dOt,this._featureIdProperty=n.featureIdProperty,this._heightReference=n.heightReference,this._scene=n.scene,this._show=!0,this._tileset=void 0,this._tilesetJsonUrl=void 0}static async fromUrl(t,n){let i=new this(t,n);return await i._initializeTileset(),i}get urlTemplate(){return this._urlTemplate}get resource(){return this._resource}get extent(){return this._extent}get tileset(){return this._tileset}get show(){return this._show}set show(t){this._show=t,l(this._tileset)&&(this._tileset.show=t)}_createRuntimeTilesetOptions(){return{minZoom:this._minZoom,maxZoom:this._maxZoom,extent:this._extent}}_createTilesetLoadOptions(){return{heightReference:this._heightReference,scene:this._scene}}_configureTileset(t){}_createCodec(){}async _initializeTileset(){let t=gOt(this._resource,this._createRuntimeTilesetOptions()),n=new Blob([JSON.stringify(t)],{type:"application/json"}),i=URL.createObjectURL(n);this._tilesetJsonUrl=i;try{this._tileset=await zr.fromUrl(i,this._createTilesetLoadOptions())}catch(o){throw URL.revokeObjectURL(i),this._tilesetJsonUrl=void 0,o}URL.revokeObjectURL(i),this._tilesetJsonUrl=void 0,this._configureTileset(this._tileset),this._tileset._runtimeContentCodec=this._createCodec(),this._tileset.show=this._show}update(t){l(this._tileset)&&this._tileset.update(t)}prePassesUpdate(t){l(this._tileset)&&this._tileset.prePassesUpdate(t)}postPassesUpdate(t){l(this._tileset)&&this._tileset.postPassesUpdate(t)}updateForPass(t,n){l(this._tileset)&&this._tileset.updateForPass(t,n)}isDestroyed(){return!1}destroy(){return l(this._tileset)&&(this._tileset.destroy(),this._tileset=void 0),l(this._tilesetJsonUrl)&&(URL.revokeObjectURL(this._tilesetJsonUrl),this._tilesetJsonUrl=void 0),this._resource=void 0,this._extent=void 0,this._featureIdProperty=void 0,ue(this)}};function gOt(e,t){let n=new Xr,i=l(t.extent)?re.clone(t.extent):re.clone(n.rectangle),o=xOt(n,i,t.minZoom),r={boundingVolume:{region:NNe(i)},geometricError:XNe(0),refine:"REPLACE",children:[]};for(let s=o.minY;s<=o.maxY;s++)for(let a=o.minX;a<=o.maxX;a++){let c=PNe(n,e,i,t.minZoom,t.maxZoom,a,s);l(c)&&r.children.push(c)}return r.children.length===0&&(r.geometricError=0),{asset:{version:"1.1"},geometricError:r.geometricError,root:r}}function PNe(e,t,n,i,o,r,s){if(!TOt(e,i,r,s,n,pOt,bOt))return;let a=e.tileXYToRectangle(r,s,i,new re),c={boundingVolume:{region:NNe(a)},geometricError:i<o?XNe(i):0,refine:"REPLACE",content:{uri:yOt(t,i,r,s)}};if(i>=o)return c;let d=i+1,u=[];for(let m=s*2;m<=s*2+1;m++)for(let p=r*2;p<=r*2+1;p++){let b=PNe(e,t,n,d,o,p,m);l(b)&&u.push(b)}return u.length>0?c.children=u:c.geometricError=0,c}function yOt(e,t,n,i){let r=e.url.replace(/\{z\}/gi,`${t}`).replace(/\{x\}/gi,`${n}`).replace(/\{y\}/gi,`${i}`);return _m(r)}function XNe(e){return hOt/((1<<e)*fOt)}function NNe(e){return[e.west,e.south,e.east,e.north,uOt,mOt]}function xOt(e,t,n){let i=(1<<n)-1,o=pe.fromRadians(t.west,t.north),r=pe.fromRadians(t.east,t.south),s=e.positionToTileXY(o,n),a=e.positionToTileXY(r,n);return!l(s)||!l(a)||t.west>t.east?{minX:0,maxX:i,minY:0,maxY:i}:{minX:W.clamp(Math.min(s.x,a.x),0,i),maxX:W.clamp(Math.max(s.x,a.x),0,i),minY:W.clamp(Math.min(s.y,a.y),0,i),maxY:W.clamp(Math.max(s.y,a.y),0,i)}}function TOt(e,t,n,i,o,r,s){let a=e.tileXYToRectangle(n,i,t,r);return l(re.intersection(a,o,s))}var qU=hce;var AJ=class extends qU{static async fromUrl(t,n){return super.fromUrl(t,n)}_createTilesetLoadOptions(){return{...super._createTilesetLoadOptions(),skipLevelOfDetail:!1,enablePick:!0,featureIdLabel:"featureId_0",instanceFeatureIdLabel:"instanceFeatureId_0"}}_configureTileset(t){t._modelUpAxis=Bi.Z,t._modelForwardAxis=Bi.X}_createCodec(){let t=this._featureIdProperty;return{contentType:"mvt",missingTilePolicy:{statusCodes:[404,204]},createContent:async(n,i,o,r)=>{let s=YU(r),a=YNe(o.getUrlComponent(!0)),c=GU(s,a,{featureIdProperty:t});if(!l(c)){if(!_Ot(s))return new Qp(n,i);throw new ae("Decoded MVT tile did not produce vector glTF content.")}return vx.fromGltf(n,i,o,c)}}}};function YNe(e){let t=e.match(/\/(\d+)\/(\d+)\/(\d+)(?:\.[^/?#]+)?(?:[?#]|$)/i);return t?{tileZ:parseInt(t[1],10),tileX:parseInt(t[2],10),tileY:parseInt(t[3],10)}:(xt("MVTDataProvider.parseTileCoordinates",`MVT tile URL did not match /{z}/{x}/{y} pattern. Falling back to z/x/y = 0/0/0. URL: ${e}`),{tileZ:0,tileX:0,tileY:0})}function _Ot(e){let t=e.layers;for(let n=0;n<t.length;n++)if(t[n].features.length>0)return!0;return!1}AJ._parseTileCoordinates=YNe;var fce=AJ;var EUo=x(T(),1);function pce(e){}pce.prototype.isReady=function(){return!0};pce.prototype.shouldDiscardImage=function(e){return!1};var bce=pce;var XUo=x(T(),1);var SOt=new Lt("MapQuest, Open Street Map and contributors, CC-BY-SA");function GJ(e){e=e??B.EMPTY_OBJECT;let t=ve.createIfNeeded(e.url??"https://tile.openstreetmap.org/");t.appendForwardSlash(),t.url+=`{z}/{x}/{y}${e.retinaTiles?"@2x":""}.${e.fileExtension??"png"}`;let n=new Xr({ellipsoid:e.ellipsoid}),i=256,o=256,r=e.minimumLevel??0,s=e.maximumLevel,a=e.rectangle??n.rectangle,c=n.positionToTileXY(re.southwest(a),r),d=n.positionToTileXY(re.northeast(a),r),u=(Math.abs(d.x-c.x)+1)*(Math.abs(d.y-c.y)+1),m=e.credit??SOt;typeof m=="string"&&(m=new Lt(m)),Ss.call(this,{url:t,credit:m,tilingScheme:n,tileWidth:i,tileHeight:o,minimumLevel:r,maximumLevel:s,rectangle:a})}l(Object.create)&&(GJ.prototype=Object.create(Ss.prototype),GJ.prototype.constructor=GJ);var gy=GJ;var MUo=x(T(),1);function MNe(){ge.throwInstantiationError()}Object.defineProperties(MNe.prototype,{show:{get:ge.throwInstantiationError,set:ge.throwInstantiationError},transform:{get:ge.throwInstantiationError},credit:{get:ge.throwInstantiationError}});var gce=MNe;var UUo=x(T(),1);function LJ(){ge.throwInstantiationError()}Object.defineProperties(LJ.prototype,{});LJ.fromUrl=function(e){ge.throwInstantiationError()};LJ.prototype.loadPanorama=function(e){ge.throwInstantiationError()};var yce=LJ;var JUo=x(T(),1);var ZOt=new k(1,1);function xce(e){e=e??B.EMPTY_OBJECT,this.mass=e.mass??1,this.position=h.clone(e.position??h.ZERO),this.velocity=h.clone(e.velocity??h.ZERO),this.life=e.life??Number.MAX_VALUE,this.image=e.image,this.startColor=U.clone(e.startColor??U.WHITE),this.endColor=U.clone(e.endColor??U.WHITE),this.startScale=e.startScale??1,this.endScale=e.endScale??1,this.imageSize=k.clone(e.imageSize??ZOt),this._age=0,this._normalizedAge=0,this._billboard=void 0}Object.defineProperties(xce.prototype,{age:{get:function(){return this._age}},normalizedAge:{get:function(){return this._normalizedAge}}});var wNe=new h;xce.prototype.update=function(e,t){return h.multiplyByScalar(this.velocity,e,wNe),h.add(this.position,wNe,this.position),l(t)&&t(this,e),this._age+=e,this.life===Number.MAX_VALUE?this._normalizedAge=0:this._normalizedAge=this._age/this.life,this._age<=this.life};var NA=xce;var qUo=x(T(),1);function kNe(e){e=e??B.EMPTY_OBJECT,this.time=e.time??0,this.minimum=e.minimum??0,this.maximum=e.maximum??50,this._complete=!1}Object.defineProperties(kNe.prototype,{complete:{get:function(){return this._complete}}});var Tce=kNe;var t5o=x(T(),1);function UNe(e){}UNe.prototype.emit=function(e){ge.throwInstantiationError()};var _ce=UNe;var b5o=x(T(),1);var DNe=new k(1,1);function $U(e){e=e??B.EMPTY_OBJECT,this.show=e.show??!0,this.updateCallback=e.updateCallback,this.loop=e.loop??!0,this.image=e.image??void 0;let t=e.emitter;l(t)||(t=new FU(.5)),this._emitter=t,this._bursts=e.bursts,this._modelMatrix=P.clone(e.modelMatrix??P.IDENTITY),this._emitterModelMatrix=P.clone(e.emitterModelMatrix??P.IDENTITY),this._matrixDirty=!0,this._combinedMatrix=new P,this._startColor=U.clone(e.color??e.startColor??U.WHITE),this._endColor=U.clone(e.color??e.endColor??U.WHITE),this._startScale=e.scale??e.startScale??1,this._endScale=e.scale??e.endScale??1,this._emissionRate=e.emissionRate??5,this._minimumSpeed=e.speed??e.minimumSpeed??1,this._maximumSpeed=e.speed??e.maximumSpeed??1,this._minimumParticleLife=e.particleLife??e.minimumParticleLife??5,this._maximumParticleLife=e.particleLife??e.maximumParticleLife??5,this._minimumMass=e.mass??e.minimumMass??1,this._maximumMass=e.mass??e.maximumMass??1,this._minimumImageSize=k.clone(e.imageSize??e.minimumImageSize??DNe),this._maximumImageSize=k.clone(e.imageSize??e.maximumImageSize??DNe),this._sizeInMeters=e.sizeInMeters??!1,this._lifetime=e.lifetime??Number.MAX_VALUE,this._billboardCollection=void 0,this._particles=[],this._particlePool=[],this._previousTime=void 0,this._currentTime=0,this._carryOver=0,this._complete=new Se,this._isComplete=!1,this._updateParticlePool=!0,this._particleEstimate=0}Object.defineProperties($U.prototype,{emitter:{get:function(){return this._emitter},set:function(e){this._emitter=e}},bursts:{get:function(){return this._bursts},set:function(e){this._bursts=e,this._updateParticlePool=!0}},modelMatrix:{get:function(){return this._modelMatrix},set:function(e){this._matrixDirty=this._matrixDirty||!P.equals(this._modelMatrix,e),P.clone(e,this._modelMatrix)}},emitterModelMatrix:{get:function(){return this._emitterModelMatrix},set:function(e){this._matrixDirty=this._matrixDirty||!P.equals(this._emitterModelMatrix,e),P.clone(e,this._emitterModelMatrix)}},startColor:{get:function(){return this._startColor},set:function(e){U.clone(e,this._startColor)}},endColor:{get:function(){return this._endColor},set:function(e){U.clone(e,this._endColor)}},startScale:{get:function(){return this._startScale},set:function(e){this._startScale=e}},endScale:{get:function(){return this._endScale},set:function(e){this._endScale=e}},emissionRate:{get:function(){return this._emissionRate},set:function(e){this._emissionRate=e,this._updateParticlePool=!0}},minimumSpeed:{get:function(){return this._minimumSpeed},set:function(e){this._minimumSpeed=e}},maximumSpeed:{get:function(){return this._maximumSpeed},set:function(e){this._maximumSpeed=e}},minimumParticleLife:{get:function(){return this._minimumParticleLife},set:function(e){this._minimumParticleLife=e}},maximumParticleLife:{get:function(){return this._maximumParticleLife},set:function(e){this._maximumParticleLife=e,this._updateParticlePool=!0}},minimumMass:{get:function(){return this._minimumMass},set:function(e){this._minimumMass=e}},maximumMass:{get:function(){return this._maximumMass},set:function(e){this._maximumMass=e}},minimumImageSize:{get:function(){return this._minimumImageSize},set:function(e){this._minimumImageSize=e}},maximumImageSize:{get:function(){return this._maximumImageSize},set:function(e){this._maximumImageSize=e}},sizeInMeters:{get:function(){return this._sizeInMeters},set:function(e){this._sizeInMeters=e}},lifetime:{get:function(){return this._lifetime},set:function(e){this._lifetime=e}},complete:{get:function(){return this._complete}},isComplete:{get:function(){return this._isComplete}}});function ROt(e){let t=e._emissionRate,n=e._maximumParticleLife,i=0,o=e._bursts;if(l(o)){let m=o.length;for(let p=0;p<m;++p)i+=o[p].maximum}let r=e._billboardCollection,s=e.image,a=Math.ceil(t*n+i),c=e._particles,d=e._particlePool,u=Math.max(a-c.length-d.length,0);for(let m=0;m<u;++m){let p=new NA;p._billboard=r.add({image:s,show:!1}),d.push(p)}e._particleEstimate=a}function COt(e){let t=e._particlePool.pop();return l(t)||(t=new NA),t}function VOt(e,t){e._particlePool.push(t)}function EOt(e){let t=e._particles,n=e._particlePool,i=e._billboardCollection,o=t.length,r=n.length,s=e._particleEstimate,a=r-Math.max(s-o-r,0);for(let c=a;c<r;++c){let d=n[c];i.remove(d._billboard)}n.length=a}function AOt(e){l(e._billboard)&&(e._billboard.show=!1)}function ONe(e,t){let n=t._billboard;l(n)||(n=t._billboard=e._billboardCollection.add({image:t.image})),n.width=t.imageSize.x,n.height=t.imageSize.y,n.position=t.position,n.sizeInMeters=e.sizeInMeters,n.show=!0;let i=W.lerp(t.startColor.red,t.endColor.red,t.normalizedAge),o=W.lerp(t.startColor.green,t.endColor.green,t.normalizedAge),r=W.lerp(t.startColor.blue,t.endColor.blue,t.normalizedAge),s=W.lerp(t.startColor.alpha,t.endColor.alpha,t.normalizedAge);n.color=new U(i,o,r,s),n.scale=W.lerp(t.startScale,t.endScale,t.normalizedAge)}function GOt(e,t){t.startColor=U.clone(e._startColor,t.startColor),t.endColor=U.clone(e._endColor,t.endColor),t.startScale=e._startScale,t.endScale=e._endScale,t.image=e.image,t.life=W.randomBetween(e._minimumParticleLife,e._maximumParticleLife),t.mass=W.randomBetween(e._minimumMass,e._maximumMass),t.imageSize.x=W.randomBetween(e._minimumImageSize.x,e._maximumImageSize.x),t.imageSize.y=W.randomBetween(e._minimumImageSize.y,e._maximumImageSize.y),t._normalizedAge=0,t._age=0;let n=W.randomBetween(e._minimumSpeed,e._maximumSpeed);h.multiplyByScalar(t.velocity,n,t.velocity),e._particles.push(t)}function LOt(e,t){if(e._isComplete)return 0;t=W.mod(t,e._lifetime);let n=t*e._emissionRate,i=Math.floor(n);if(e._carryOver+=n-i,e._carryOver>1&&(i++,e._carryOver-=1),l(e.bursts)){let o=e.bursts.length;for(let r=0;r<o;r++){let s=e.bursts[r],a=e._currentTime;l(s)&&!s._complete&&a>s.time&&(i+=W.randomBetween(s.minimum,s.maximum),s._complete=!0)}}return i}var WJ=new h;$U.prototype.update=function(e){if(!this.show)return;l(this._billboardCollection)||(this._billboardCollection=new wu),this._updateParticlePool&&(ROt(this),this._updateParticlePool=!1);let t=0;this._previousTime&&(t=Q.secondsDifference(e.time,this._previousTime)),t<0&&(t=0);let n=this._particles,i=this._emitter,o=this.updateCallback,r,s,a=n.length;for(r=0;r<a;++r)s=n[r],s.update(t,o)?ONe(this,s):(AOt(s),VOt(this,s),n[r]=n[a-1],--r,--a);n.length=a;let c=LOt(this,t);if(c>0&&l(i)){this._matrixDirty&&(this._combinedMatrix=P.multiply(this.modelMatrix,this.emitterModelMatrix,this._combinedMatrix),this._matrixDirty=!1);let d=this._combinedMatrix;for(r=0;r<c;r++)s=COt(this),this._emitter.emit(s),h.add(s.position,s.velocity,WJ),P.multiplyByPoint(d,WJ,WJ),s.position=P.multiplyByPoint(d,s.position,s.position),h.subtract(WJ,s.position,s.velocity),h.normalize(s.velocity,s.velocity),GOt(this,s),ONe(this,s)}if(this._billboardCollection.update(e),this._previousTime=Q.clone(e.time,this._previousTime),this._currentTime+=t,this._lifetime!==Number.MAX_VALUE&&this._currentTime>this._lifetime)if(this.loop){if(this._currentTime=W.mod(this._currentTime,this._lifetime),this.bursts){let d=this.bursts.length;for(r=0;r<d;r++)this.bursts[r]._complete=!1}}else this._isComplete=!0,this._complete.raiseEvent(this);e.frameNumber%120===0&&EOt(this)};$U.prototype.isDestroyed=function(){return!1};$U.prototype.destroy=function(){return this._billboardCollection=this._billboardCollection&&this._billboardCollection.destroy(),ue(this)};var Sce=$U;var x5o=x(T(),1);var Zce=class{constructor(){mt(this,"quadtree");mt(this,"tilingScheme");mt(this,"errorEvent");ge.throwInstantiationError()}static computeDefaultLevelZeroMaximumGeometricError(t){return t.ellipsoid.maximumRadius*2*Math.PI*.25/(65*t.getNumberOfXTilesAtLevel(0))}update(t,n){ge.throwInstantiationError()}beginUpdate(t,n,i){ge.throwInstantiationError()}endUpdate(t,n,i){ge.throwInstantiationError()}getLevelMaximumGeometricError(t){ge.throwInstantiationError()}loadTile(t,n,i){ge.throwInstantiationError()}computeTileVisibility(t,n,i){ge.throwInstantiationError()}showTileThisFrame(t,n,i,o){ge.throwInstantiationError()}computeDistanceToTile(t,n){ge.throwInstantiationError()}isDestroyed(){ge.throwInstantiationError()}destroy(){ge.throwInstantiationError()}},Rce=Zce;var R5o=x(T(),1);function Cce(e){e=e??1,this._radius=e??1}Object.defineProperties(Cce.prototype,{radius:{get:function(){return this._radius},set:function(e){this._radius=e}}});Cce.prototype.emit=function(e){let t=W.randomBetween(0,W.TWO_PI),n=W.randomBetween(0,W.PI),i=W.randomBetween(0,this._radius),o=i*Math.cos(t)*Math.sin(n),r=i*Math.sin(t)*Math.sin(n),s=i*Math.cos(n);e.position=h.fromElements(o,r,s,e.position),e.velocity=h.normalize(e.position,e.velocity)};var Vce=Cce;var E5o=x(T(),1);function e5(){}e5.prototype.evaluate=function(e,t){ge.throwInstantiationError()};e5.prototype.evaluateColor=function(e,t){ge.throwInstantiationError()};e5.prototype.getShaderFunction=function(e,t,n,i){ge.throwInstantiationError()};e5.prototype.getVariables=function(){ge.throwInstantiationError()};var Ece=e5;var v5o=x(T(),1);function YA(e){this._ready=!1,this._provider=void 0,this._errorEvent=new Se,this._readyEvent=new Se,vOt(this,e)}Object.defineProperties(YA.prototype,{errorEvent:{get:function(){return this._errorEvent}},readyEvent:{get:function(){return this._readyEvent}},ready:{get:function(){return this._ready}},provider:{get:function(){return this._provider}}});YA.fromWorldTerrain=function(e){return new YA(WR(e))};YA.fromWorldBathymetry=function(e){return new YA(TU(e))};function WOt(e,t){e.numberOfListeners>0?e.raiseEvent(t):console.error(t)}async function vOt(e,t){let n;try{n=await Promise.resolve(t),e._provider=n,e._ready=!0,e._readyEvent.raiseEvent(n)}catch(i){WOt(e._errorEvent,i)}}var t5=YA;var P5o=x(T(),1);function MA(){}MA.prototype.boundingVolume=void 0;MA.prototype.boundingSphere=void 0;MA.prototype.distanceToCamera=function(e){ge.throwInstantiationError()};MA.prototype.intersectPlane=function(e){ge.throwInstantiationError()};MA.prototype.createDebugVolume=function(e){ge.throwInstantiationError()};var Ace=MA;var U5o=x(T(),1);function n5(e){e=e??B.EMPTY_OBJECT,this._tilingScheme=l(e.tilingScheme)?e.tilingScheme:new to({ellipsoid:e.ellipsoid}),this._color=e.color??U.YELLOW,this._errorEvent=new Se,this._tileWidth=e.tileWidth??256,this._tileHeight=e.tileHeight??256,this._defaultAlpha=void 0,this._defaultNightAlpha=void 0,this._defaultDayAlpha=void 0,this._defaultBrightness=void 0,this._defaultContrast=void 0,this._defaultHue=void 0,this._defaultSaturation=void 0,this._defaultGamma=void 0,this._defaultMinificationFilter=void 0,this._defaultMagnificationFilter=void 0}Object.defineProperties(n5.prototype,{proxy:{get:function(){}},tileWidth:{get:function(){return this._tileWidth}},tileHeight:{get:function(){return this._tileHeight}},maximumLevel:{get:function(){}},minimumLevel:{get:function(){}},tilingScheme:{get:function(){return this._tilingScheme}},rectangle:{get:function(){return this._tilingScheme.rectangle}},tileDiscardPolicy:{get:function(){}},errorEvent:{get:function(){return this._errorEvent}},credit:{get:function(){}},hasAlphaChannel:{get:function(){return!0}}});n5.prototype.getTileCredits=function(e,t,n){};n5.prototype.requestImage=function(e,t,n,i){let o=document.createElement("canvas");o.width=256,o.height=256;let r=o.getContext("2d"),s=this._color.toCssColorString();return r.strokeStyle=s,r.lineWidth=2,r.strokeRect(1,1,255,255),r.font="bold 25px Arial",r.textAlign="center",r.fillStyle=s,r.fillText(`L: ${n}`,124,86),r.fillText(`X: ${e}`,124,136),r.fillText(`Y: ${t}`,124,186),Promise.resolve(o)};n5.prototype.pickFeatures=function(e,t,n,i,o){};var i5=n5;var B5o=x(T(),1);function Gce(e){ge.throwInstantiationError()}Gce.prototype.isReady=ge.throwInstantiationError;Gce.prototype.shouldDiscardImage=ge.throwInstantiationError;var Lce=Gce;var H5o=x(T(),1),BNe={START:0,LOADING:1,READY:2,UPSAMPLED_ONLY:3};Object.freeze(BNe);var Wce=BNe;var rDo=x(T(),1);function vJ(e,t){this.show=!0,l(e)||(e=new nt),this.rectangle=nt.clone(e),l(t)||(t=eo.fromType(eo.ColorType,{color:new U(1,1,1,1)})),this.material=t,this._material=void 0,this._overlayCommand=void 0,this._rs=void 0}vJ.prototype.update=function(e){if(!this.show)return;let t=this._rs;if((!l(t)||!nt.equals(t.viewport,this.rectangle))&&(this._rs=ze.fromCache({blending:on.ALPHA_BLEND,viewport:this.rectangle})),e.passes.render){let i=e.context;if(this._material!==this.material||!l(this._overlayCommand)){this._material=this.material,l(this._overlayCommand)&&this._overlayCommand.shaderProgram.destroy();let o=new Je({sources:[this._material.shaderSource,b2]});this._overlayCommand=i.createViewportQuadCommand(o,{renderState:this._rs,uniformMap:this._material._uniforms,owner:this}),this._overlayCommand.pass=Le.OVERLAY}this._material.update(i),this._overlayCommand.renderState=this._rs,this._overlayCommand.uniformMap=this._material._uniforms,e.commandList.push(this._overlayCommand)}};vJ.prototype.isDestroyed=function(){return!1};vJ.prototype.destroy=function(){return l(this._overlayCommand)&&(this._overlayCommand.shaderProgram=this._overlayCommand.shaderProgram&&this._overlayCommand.shaderProgram.destroy()),ue(this)};var vce=vJ;var cDo=x(T(),1);var Fce=class{constructor(){mt(this,"globalTransform");mt(this,"shapeTransform");mt(this,"shape");mt(this,"minBounds");mt(this,"maxBounds");mt(this,"dimensions");mt(this,"paddingBefore");mt(this,"paddingAfter");mt(this,"names");mt(this,"types");mt(this,"componentTypes");mt(this,"minimumValues");mt(this,"maximumValues");mt(this,"maximumTileCount");mt(this,"availableLevels");mt(this,"keyframeCount");mt(this,"timeIntervalCollection");ge.throwInstantiationError()}requestData(t){ge.throwInstantiationError()}},Ice=Fce;var mDo=x(T(),1);function yy(){ge.throwInstantiationError()}Object.defineProperties(yy.prototype,{orientedBoundingBox:{get:ge.throwInstantiationError},boundingSphere:{get:ge.throwInstantiationError},boundTransform:{get:ge.throwInstantiationError},shapeTransform:{get:ge.throwInstantiationError},shaderUniforms:{get:ge.throwInstantiationError},shaderDefines:{get:ge.throwInstantiationError},shaderMaximumIntersectionsLength:{get:ge.throwInstantiationError}});yy.prototype.update=ge.throwInstantiationError;yy.prototype.updateViewTransforms=ge.throwInstantiationError;yy.prototype.convertLocalToShapeUvSpace=ge.throwInstantiationError;yy.prototype.computeOrientedBoundingBoxForTile=ge.throwInstantiationError;yy.prototype.computeOrientedBoundingBoxForSample=ge.throwInstantiationError;yy.DefaultMinBounds=ge.throwInstantiationError;yy.DefaultMaxBounds=ge.throwInstantiationError;var Pce=yy;var fDo=x(T(),1),Xce=`uniform sampler2D u_depthTexture; +`;var wGo=x(T(),1),Zse=`uniform sampler2D u_depthTexture; in vec2 v_textureCoordinates; void main() { @@ -12729,8 +12701,36 @@ float z_ndc = (2.0 * z_window - n_range - f_range) / (f_range - n_range); float scale = pow(z_ndc * 0.5 + 0.5, 8.0); out_FragColor = vec4(mix(vec3(0.0), vec3(1.0), scale), 1.0); } -`;var gDo=x(T(),1);var Nce=class{get enabled(){return ge.throwInstantiationError()}set enabled(t){ge.throwInstantiationError()}connectedCallback(t){ge.throwInstantiationError()}disconnectedCallback(t){ge.throwInstantiationError()}update(t,n){ge.throwInstantiationError()}firstUpdate(t,n){ge.throwInstantiationError()}},Yce=Nce;var CDo=x(T(),1);var zNe=new h,FOt=new cn(h.UNIT_X,0),IOt=new gn,POt=new k(1,1,1);function mp(e,t,n,i=POt){let{camera:o,ellipsoid:r}=e,s=r.scaleToGeodeticSurface(o.positionWC,zNe);if(!l(s))return;let a=h.magnitude(o.positionWC),c=h.magnitude(s),d=a<=c,u=r.geodeticSurfaceNormal(o.positionWC,zNe),m=h.dot(u,o.directionWC),p=m>0;if(d||p){let b=cn.fromPointNormal(o.positionWC,u,FOt),{clientHeight:f}=e.canvas,y=i.y*f/(2*Math.tan(o.frustum.fovy*.5));b.distance-=m*y;let _=o.getPickRay(t,IOt);return xi.rayPlane(_,b,n)}return o.pickEllipsoid(t,r,n)}var dOo=x(T(),1);var BDo=x(T(),1);var vDo=x(T(),1);var EDo=x(T(),1),HNe={LEFT:0,MIDDLE:1,RIGHT:2};Object.freeze(HNe);var qa=HNe;function XOt(e){if(e===qa.LEFT)return mn.LEFT_DOWN;if(e===qa.MIDDLE)return mn.MIDDLE_DOWN;if(e===qa.RIGHT)return mn.RIGHT_DOWN}function NOt(e){if(e===qa.LEFT)return mn.LEFT_UP;if(e===qa.MIDDLE)return mn.MIDDLE_UP;if(e===qa.RIGHT)return mn.RIGHT_UP}var Mce=class{static registerDragInputBindings(t,n,i){let o=new Set,r={isDragging:!1};for(let s of n){r.isDragging=!1;let a=XOt(s.button),c=NOt(s.button);l(a)&&t.setInputAction((...d)=>{r.isDragging=!0,l(i.start)&&i.start(...d)},a,s.modifier),l(c)&&(t.setInputAction((...d)=>{r.isDragging&&(r.isDragging=!1,l(i.end)&&i.end(...d))},c,s.modifier),t.setInputAction((...d)=>{r.isDragging&&(r.isDragging=!1,l(i.end)&&i.end(...d))},c)),o.add(s.modifier)}for(let s of o)t.setInputAction((...a)=>{r.isDragging&&l(i.change)&&i.change(...a)},mn.MOUSE_MOVE,s);return r}},hp=Mce;var wce=class e{static _getDefaultDragInputs(){return[Object.freeze({button:qa.LEFT})]}constructor(t=B.EMPTY_OBJECT){this._enabled=!0,this._handler=void 0,this._lastUpdateTime=void 0,this.dragInputs=t.dragInputs??e._getDefaultDragInputs(),this._dragInputState=void 0,this._panDelta=new k,this._panPosition=new k,this.pickWorldPosition=mp,this._ellipsoidNormal=new h,this._ellipsoidSurfacePosition=new h,this._panDirectionX=new h,this._panDirectionY=new h,this._pixelSize=new k,this._panVelocity=new k,this.panSpeed=1,this.inertiaEnabled=!0,this.inertialDecay=6,this.maximumMovementRatio=.1}get enabled(){return this._enabled}set enabled(t){this._enabled=t,t?(this._lastUpdateTime=Zn(),this._panDelta.x=0,this._panDelta.y=0):l(this._dragInputState)&&(this._dragInputState.isDragging=!1)}get isDragging(){return l(this._dragInputState)&&this._dragInputState.isDragging}connectedCallback(t){let n=new aa(t);this._handler=n,this._dragInputState=hp.registerDragInputBindings(n,this.dragInputs,{start:this._handleStartPan.bind(this),change:this._handlePan.bind(this)})}disconnectedCallback(t){let n=this._handler;l(n)&&!n.isDestroyed()&&n.destroy()}firstUpdate(){this._lastUpdateTime=Zn(),this._panDelta.x=0,this._panDelta.y=0}update(t){let n=(Zn()-this._lastUpdateTime)*wn.SECONDS_PER_MILLISECOND,{camera:i,ellipsoid:o,canvas:r}=t,s=-this._panDelta.x,a=this._panDelta.y;if(this.inertiaEnabled&&!this.isDragging){let C=Math.exp(-this.inertialDecay*n);this._panVelocity.x*=C,this._panVelocity.y*=C,s=this._panVelocity.x*n,a=this._panVelocity.y*n}let{clientWidth:c,clientHeight:d}=r;if(n===0||c===0||d===0||Math.abs(s)<=W.EPSILON3&&Math.abs(a)<=W.EPSILON3){this._lastUpdateTime=Zn(),this._panDelta.x=0,this._panDelta.y=0;return}let u=this._panPosition,m=this.pickWorldPosition(t,u,this._ellipsoidSurfacePosition);l(m)||(m=o.scaleToGeodeticSurface(i.positionWC,this._ellipsoidSurfacePosition));let p=h.clone(i.rightWC,this._panDirectionX);p=h.normalize(p,this._panDirectionX);let b=h.normalize(m,this._panDirectionY),f=h.distance(i.positionWC,m),{drawingBufferWidth:y,drawingBufferHeight:_,pixelRatio:S}=t,Z=i.frustum.getPixelDimensions(y,_,f,S,this._pixelSize),R=this.maximumMovementRatio*Math.max(c,d);s=W.clamp(s,-R,R),this._panVelocity.x=s/n,s*=this.panSpeed*Z.x,a=W.clamp(a,-R,R),this._panVelocity.y=a/n,a*=this.panSpeed*Z.y,i.move(p,s),i.move(b,a),this._lastUpdateTime=Zn(),this._panDelta.x=0,this._panDelta.y=0}_handleStartPan(){this.enabled&&(this._panDelta.x=0,this._panDelta.y=0)}_handlePan(t){this._panDelta.x+=t.endPosition.x-t.startPosition.x,this._panDelta.y+=t.endPosition.y-t.startPosition.y,this._panPosition.x=t.endPosition.x,this._panPosition.y=t.endPosition.y}},o5=wce;var oOo=x(T(),1);var kce=class e{static _getDefaultDragInputs(){return[Object.freeze({button:qa.LEFT})]}constructor(t=B.EMPTY_OBJECT){this._enabled=!0,this._handler=void 0,this._lastUpdateTime=void 0,this.dragInputs=t.dragInputs??e._getDefaultDragInputs(),this._dragInputState=void 0,this._panDelta=new k,this._panPosition=new k,this.pickWorldPosition=mp,this._ellipsoidNormal=new h,this._ellipsoidSurfacePosition=new h,this._panDirectionX=new h,this._panDirectionY=new h,this._pixelSize=new k,this._panVelocity=new k,this.panSpeed=1,this.inertiaEnabled=!0,this.inertialDecay=6,this.maximumMovementRatio=.1}get enabled(){return this._enabled}set enabled(t){this._enabled=t,t?(this._panDelta.x=0,this._panDelta.y=0):l(this._dragInputState)&&(this._dragInputState.isDragging=!1)}get isDragging(){return l(this._dragInputState)&&this._dragInputState.isDragging}connectedCallback(t){let n=new aa(t);this._handler=n,this._dragInputState=hp.registerDragInputBindings(n,this.dragInputs,{start:this._handleStartPan.bind(this),change:this._handlePan.bind(this)})}disconnectedCallback(t){let n=this._handler;l(n)&&!n.isDestroyed()&&n.destroy()}firstUpdate(){this._lastUpdateTime=Zn(),this._panDelta.x=0,this._panDelta.y=0}update(t){let n=(Zn()-this._lastUpdateTime)*wn.SECONDS_PER_MILLISECOND,i=-this._panDelta.x,o=this._panDelta.y;if(this.inertiaEnabled&&!this.isDragging){let A=Math.exp(-this.inertialDecay*n);this._panVelocity.x*=A,this._panVelocity.y*=A,i=this._panVelocity.x*n,o=this._panVelocity.y*n}let{camera:r,ellipsoid:s,canvas:a}=t,{clientWidth:c,clientHeight:d}=a;if(n===0||c===0||d===0||Math.abs(i)<=W.EPSILON3&&Math.abs(o)<=W.EPSILON3){this._lastUpdateTime=Zn(),this._panDelta.x=0,this._panDelta.y=0;return}let u=this._panPosition,m=this.pickWorldPosition(t,u,this._ellipsoidSurfacePosition);l(m)||(m=s.scaleToGeodeticSurface(r.positionWC,this._ellipsoidSurfacePosition));let p=s.geodeticSurfaceNormal(m,this._ellipsoidNormal),b=h.clone(r.rightWC,this._panDirectionX);b=h.normalize(b,this._panDirectionX);let f=h.clone(r.upWC,this._panDirectionY),y=Math.abs(h.dot(p,r.directionWC));W.lessThan(y,1,W.EPSILON6)&&(f=h.cross(p,b,this._panDirectionY)),f=h.normalize(f,this._panDirectionY);let _=h.distance(r.positionWC,m),{drawingBufferWidth:S,drawingBufferHeight:Z,pixelRatio:R}=t,C=r.frustum.getPixelDimensions(S,Z,_,R,this._pixelSize),E=this.maximumMovementRatio*Math.max(c,d);i=W.clamp(i,-E,E),this._panVelocity.x=i/n,i*=this.panSpeed*C.x,o=W.clamp(o,-E,E),this._panVelocity.y=o/n,o*=this.panSpeed*C.y,r.move(b,i),r.move(f,o),this._lastUpdateTime=Zn(),this._panDelta.x=0,this._panDelta.y=0}_handleStartPan(t){this.enabled&&(this._panDelta.x=0,this._panDelta.y=0)}_handlePan(t){this._panDelta.x+=t.endPosition.x-t.startPosition.x,this._panDelta.y+=t.endPosition.y-t.startPosition.y,this._panPosition.x=t.endPosition.x,this._panPosition.y=t.endPosition.y}},r5=kce;var Uce=class{constructor(){this._elevatorController=new o5,this._mapController=new r5,this._enabled=!0,this._ellipsoidNormal=new h,this.angleThreshold=W.toRadians(125)}get enabled(){return this._enabled}set enabled(t){this._enabled=t}get elevatorController(){return this._elevatorController}get mapController(){return this._mapController}connectedCallback(t){this._elevatorController.connectedCallback(t),this._mapController.connectedCallback(t)}disconnectedCallback(t){this._elevatorController.disconnectedCallback(t),this._mapController.disconnectedCallback(t)}firstUpdate(){this._elevatorController.firstUpdate(),this._mapController.firstUpdate()}update(t){let n=t.camera,i=t.ellipsoid.geodeticSurfaceNormal(n.positionWC,this._ellipsoidNormal),o=Math.abs(h.angleBetween(i,n.directionWC));(o<this.angleThreshold&&o>Math.PI-this.angleThreshold?this._elevatorController:this._mapController).update(t)}},Dce=Uce;var GOo=x(T(),1);var Oce=class e{static _getDefaultDragInputs(){return[Object.freeze({button:qa.LEFT,modifier:ir.CTRL}),Object.freeze({button:qa.RIGHT})]}constructor(t=B.EMPTY_OBJECT){this._enabled=!0,this._handler=void 0,this._lastUpdateTime=void 0,this.tiltEnabled=!0,this.orbitEnabled=!0,this.useDragPosition=!1,this.dragInputs=t.dragInputs??e._getDefaultDragInputs(),this._dragInputState=void 0,this._dragDelta=new k,this._screenSpaceDragPosition=new k,this._screenSpaceOrigin=new k,this.pickWorldPosition=mp,this._hasTarget=!1,this._target=new h,this._axis=new h,this.tiltMagnitude=2,this.dampingEnabled=!0,this.tiltAnimationDuration=.0045,this.maximumTiltVelocity=W.PI,this.minimumTiltVelocity=W.EPSILON20,this.orbitMagnitude=2,this.orbitAnimationDuration=.0045,this.maximumOrbitVelocity=W.TWO_PI,this.minimumOrbitVelocity=W.EPSILON20,this._tiltAxis=new h,this._tiltQuaternion=new Ne,this._tiltOffset=new h,this._tiltOrigin=new h,this._tiltDampenedResults={velocity:0,value:0},this._orbitTargetEnu=new P,this._orbitTargetEast=new h,this._orbitQuaternion=new Ne,this._orbitOffset=new h,this._orbitLookOffset=new h,this._orbitOrigin=new h,this._orbitDampenedResults={velocity:0,value:0},this.maximumMovementRatio=.1}get enabled(){return this._enabled}set enabled(t){this._enabled=t,t?(this._lastUpdateTime=Zn(),this._dragDelta.x=0,this._dragDelta.y=0):l(this._dragInputState)&&(this._dragInputState.isDragging=!1)}get isDragging(){return l(this._dragInputState)&&this._dragInputState.isDragging}connectedCallback(t){let n=new aa(t);this._handler=n,this._dragInputState=hp.registerDragInputBindings(n,this.dragInputs,{start:this._handleStartDrag.bind(this),change:this._handleDrag.bind(this)})}disconnectedCallback(t){let n=this._handler;l(n)&&!n.isDestroyed()&&n.destroy()}firstUpdate(){this._lastUpdateTime=Zn(),this._dragDelta.x=0,this._dragDelta.y=0}_handleStartDrag(t){this.enabled&&(this._hasTarget=!1,this._screenSpaceDragPosition.x=t.position.x,this._screenSpaceDragPosition.y=t.position.y,this._dragDelta.x=0,this._dragDelta.y=0)}_handleDrag(t){this._dragDelta.x+=t.endPosition.x-t.startPosition.x,this._dragDelta.y+=t.endPosition.y-t.startPosition.y}get tiltAngle(){return this._tiltDampenedResults.value}get tiltVelocity(){return this._tiltDampenedResults.velocity}set tiltVelocity(t){this._tiltDampenedResults.velocity=t}get orbitAngle(){return this._orbitDampenedResults.value}get orbitVelocity(){return this._orbitDampenedResults.velocity}set orbitVelocity(t){this._orbitDampenedResults.velocity=t}orbit(t,n,i,o,r,s=ne.default){let a=_t.eastNorthUpToFixedFrame(n,s,this._orbitTargetEnu),c=P.multiplyByPointAsVector(a,h.UNIT_X,this._orbitTargetEast),d=h.angleBetween(t.directionWC,c);if(Math.abs(this.orbitVelocity)<this.minimumOrbitVelocity&&(this.orbitVelocity=0),!this.isDragging&&this.dampingEnabled&&(o+=this.orbitVelocity*r),o===0)return;let u=d+o,m=this.dampingEnabled?this.maximumOrbitVelocity*this.orbitMagnitude:void 0,p=this.dampingEnabled?this.orbitAnimationDuration:void 0;this._orbitDampenedResults=W.smoothDamp(d,u,this.orbitVelocity,r,m,p,this._orbitDampenedResults);let b=this.orbitAngle-d,f=q.fromQuaternion(Ne.fromAxisAngle(i,-b,this._orbitQuaternion)),y=h.subtract(t.positionWC,n,this._orbitOffset),_=h.dot(y,t.directionWC),S=h.multiplyByScalar(t.directionWC,_,this._orbitLookOffset),Z=h.subtract(y,S,this._orbitLookOffset),R=q.multiplyByVector(f,y,this._orbitOffset),C=q.multiplyByVector(f,Z,this._orbitLookOffset);h.add(n,R,t.position);let E=h.add(n,C,this._orbitOrigin);t.lookAtWorldPosition(E,s)}tilt(t,n,i,o,r,s=ne.default){if(Math.abs(this.tiltVelocity)<this.minimumTiltVelocity&&(this.tiltVelocity=0),!this.isDragging&&this.dampingEnabled&&(o+=this.tiltVelocity*r),o===0)return;let a=h.angleBetween(t.direction,i);(a<W.PI_OVER_TWO&&o>0||a>W.PI_OVER_TWO&&o<0)&&(o*=Math.abs(Math.sin(a)));let c=a+o,d=this.dampingEnabled?this.maximumTiltVelocity*this.tiltMagnitude:void 0,u=this.dampingEnabled?this.tiltAnimationDuration:void 0;W.smoothDamp(a,c,this.tiltVelocity,r,d,u,this._tiltDampenedResults);let m=this.tiltAngle-a,p=q.fromQuaternion(Ne.fromAxisAngle(t.rightWC,-m,this._tiltQuaternion)),b=h.subtract(t.position,n,this._tiltOffset),f=h.dot(b,t.directionWC),y=h.multiplyByScalar(t.directionWC,f,this._tiltOffset),_=h.subtract(t.position,y,this._tiltOrigin),S=q.multiplyByVector(p,y,this._tiltOffset);h.add(_,S,t.position),t.lookAtWorldPosition(_,s)}update(t){let n=(Zn()-this._lastUpdateTime)*wn.SECONDS_PER_MILLISECOND,{canvas:i}=t,{clientWidth:o,clientHeight:r}=i;if(n===0||o===0||r===0){this._lastUpdateTime=Zn(),this._dragDelta.x=0,this._dragDelta.y=0;return}let s=this._target;if(this.isDragging&&!this._hasTarget){let a=this._screenSpaceDragPosition;this.useDragPosition||(a=this._screenSpaceOrigin,a.x=o/2,a.y=r/2);let c=this.pickWorldPosition(t,a,this._target),d=l(c);this._hasTarget=d,s=c}if(this._hasTarget){let{camera:a,ellipsoid:c}=t,d=c.geodeticSurfaceNormal(s,this._axis),u=h.negate(d,this._axis);if(this.orbitEnabled){let m=this._dragDelta.x/o;m=W.clamp(m,-this.maximumMovementRatio,this.maximumMovementRatio),m*=this.orbitMagnitude*W.TWO_PI,this.orbit(a,s,u,m,n,c)}if(this.tiltEnabled){let m=this._dragDelta.y/r;m=W.clamp(m,-this.maximumMovementRatio,this.maximumMovementRatio),m*=this.tiltMagnitude*W.PI,this.tilt(a,s,u,m,n,c)}}this._lastUpdateTime=Zn(),this._dragDelta.x=0,this._dragDelta.y=0}},Bce=Oce;var DOo=x(T(),1);var zce=class e{static _getDefaultDragInputs(){return[Object.freeze({button:qa.MIDDLE})]}static _getDefaultScrollInputs(){return[mn.WHEEL]}constructor(t=B.EMPTY_OBJECT){this._enabled=!0,this._handler=void 0,this._lastUpdateTime=void 0,this.usePointerPosition=!1,this.dragInputs=t.dragInputs??e._getDefaultDragInputs(),this.scrollInputs=t.scrollInputs??e._getDefaultScrollInputs(),this._dragInputState=void 0,this._dragDelta=new k,this._scrollDelta=0,this._zoomInputVelocity=0,this._screenSpaceScrollPosition=new k,this._screenSpaceDragPosition=new k,this._screenSpaceOrigin=new k,this.zoomSensitivity=.2,this.pickWorldPosition=mp,this.zoomDistanceRatio=.4,this.inertiaEnabled=!1,this.inertialDecay=6,this.minimumZoomDistance=0,this.maximumZoomDistance=1e5,this.minimumZoomVelocity=W.EPSILON20,this.maximumZoomVelocity=1,this.dampingEnabled=!0,this.zoomAnimationDuration=.45,this._target=new h,this._zoomDirection=new h,this._zoomDampenedResults={velocity:0,value:0}}get enabled(){return this._enabled}set enabled(t){this._enabled=t,t?(this._lastUpdateTime=Zn(),this._scrollDelta=0,this._dragDelta.x=0,this._dragDelta.y=0):l(this._dragInputState)&&(this._dragInputState.isDragging=!1)}get isDragging(){return l(this._dragInputState)&&this._dragInputState.isDragging}connectedCallback(t){let n=new aa(t);this._handler=n;for(let i of this.scrollInputs)n.setInputAction(this._handleZoom.bind(this),i);n.setInputAction(this._handleZoomPosition.bind(this),mn.MOUSE_MOVE),this._dragInputState=hp.registerDragInputBindings(n,this.dragInputs,{start:this._handleStartDrag.bind(this),change:this._handleDrag.bind(this)})}disconnectedCallback(t){let n=this._handler;l(n)&&!n.isDestroyed()&&n.destroy()}firstUpdate(){this._lastUpdateTime=Zn(),this._scrollDelta=0,this._dragDelta.x=0,this._dragDelta.y=0}get zoomDistance(){return this._zoomDampenedResults.value}get zoomVelocity(){return this._zoomDampenedResults.velocity}set zoomVelocity(t){this._zoomDampenedResults.velocity=t}update(t){let i=(Zn()-this._lastUpdateTime)*wn.SECONDS_PER_MILLISECOND,{canvas:o}=t,{clientWidth:r,clientHeight:s}=o;if(i===0||r===0||s===0){this._lastUpdateTime=Zn(),this._scrollDelta=0,this._dragDelta.x=0,this._dragDelta.y=0;return}let a=this._scrollDelta+this._dragDelta.y;if(a===0&&this.inertiaEnabled){let _=Math.exp(-this.inertialDecay*i);this._zoomInputVelocity*=_,a=this._zoomInputVelocity*i}if(Math.abs(this.zoomVelocity)<this.minimumZoomVelocity&&a<=W.EPSILON3&&a>=-W.EPSILON3&&this.zoomVelocity<=W.EPSILON3){this._lastUpdateTime=Zn(),this._scrollDelta=0,this._dragDelta.x=0,this._dragDelta.y=0,this.zoomVelocity=0;return}this._zoomInputVelocity=W.clamp(a/i,-this.maximumZoomVelocity,this.maximumZoomVelocity);let{camera:c,ellipsoid:d}=t,u=c.direction,m=h.magnitude(c.positionWC)-d.maximumRadius,p=this.isDragging?this._screenSpaceDragPosition:this._screenSpaceScrollPosition;this.useDragPosition||(p=this._screenSpaceOrigin,p.x=r/2,p.y=s/2);let b=this.pickWorldPosition(t,p,this._target);l(b)&&(u=h.subtract(b,c.positionWC,this._zoomDirection),u=h.normalize(u,this._zoomDirection),m=h.distance(b,c.positionWC)),m=W.clamp(m,m>0?this.minimumZoomDistance:-this.maximumZoomDistance,m>0?this.maximumZoomDistance:-this.minimumZoomDistance);let f=a*m*this.zoomDistanceRatio,y=this.dampingEnabled?this.zoomAnimationDuration:void 0;this._zoomDampenedResults=W.smoothDamp(0,f,this.zoomVelocity,i,void 0,y,this._zoomDampenedResults),c.move(u,this.zoomDistance),this._lastUpdateTime=Zn(),this._scrollDelta=0,this._dragDelta.x=0,this._dragDelta.y=0}_handleZoom(t){this._scrollDelta+=t*this.zoomSensitivity}_handleZoomPosition(t){this._screenSpaceScrollPosition.x=t.endPosition.x,this._screenSpaceScrollPosition.y=t.endPosition.y}_handleStartDrag(t){this.enabled&&(this._screenSpaceDragPosition.x=t.position.x,this._screenSpaceDragPosition.y=t.position.y,this._dragDelta.x=0,this._dragDelta.y=0)}_handleDrag(t){this._dragDelta.x+=t.endPosition.x-t.startPosition.x,this._dragDelta.y+=t.endPosition.y-t.startPosition.y}},Hce=zce;var BOo=x(T(),1),KNe={FLOAT:"float",VEC2:"vec2",VEC3:"vec3",VEC4:"vec4",MAT2:"mat2",MAT3:"mat3",MAT4:"mat4"};Object.freeze(KNe);var Kce=KNe;var HOo=x(T(),1),JNe={SIGX:"SIGX",SIGY:"SIGY",SIGZ:"SIGZ",VARX:"VARX",VARY:"VARY",VARZ:"VARZ",SIGR:"VARZ"};Object.freeze(JNe);var Jce=JNe;var jOo=x(T(),1);function YOt(e){async function t({data:i}){let o=[],r={id:i.id,result:void 0,error:void 0};self.CESIUM_BASE_URL=i.baseUrl;try{let s=await e(i.parameters,o);r.result=s}catch(s){s instanceof Error?r.error={name:s.name,message:s.message,stack:s.stack}:r.error=s}i.canTransferArrayBuffer||(o.length=0);try{postMessage(r,o)}catch(s){r.result=void 0,r.error=`postMessage failed with error: ${Op(s)} - with responseMessage: ${JSON.stringify(r)}`,postMessage(r)}}function n(i){postMessage({id:i.data?.id,error:`postMessage failed with error: ${JSON.stringify(i)}`})}return self.onmessage=t,self.onmessageerror=n,self}var jce=YOt;globalThis.CESIUM_VERSION="1.145.0";var kpr=x(T(),1);var ydr=x(T(),1);var fdr=x(T(),1);var rdr=x(T(),1),s5;typeof ko<"u"&&(s5=ko);(function(){/*! +`;var hLo=x(T(),1);var zGo=x(T(),1);function _A(e,t){this._tilingScheme=e,this._maximumLevel=t,this._rootNodes=[]}var ER=new re;function $wt(e,t,n,i){let o=i.length;for(let r=0;r<o;++r){let s=i[r];if(s.x===t&&s.y===n&&s.level===e)return!0}return!1}_A.prototype.addAvailableTileRange=function(e,t,n,i,o){let r=this._tilingScheme,s=this._rootNodes;if(e===0)for(let p=n;p<=o;++p)for(let b=t;b<=i;++b)$wt(e,b,p,s)||s.push(new xA(r,void 0,0,b,p));r.tileXYToRectangle(t,n,e,ER);let a=ER.west,c=ER.north;r.tileXYToRectangle(i,o,e,ER);let d=ER.east,u=ER.south,m=new o9t(e,a,u,d,c);for(let p=0;p<s.length;++p){let b=s[p];Rse(b.extent,m)&&r9t(this._maximumLevel,b,m)}};_A.prototype.computeMaximumLevelAtPosition=function(e){let t;for(let n=0;n<this._rootNodes.length;++n){let i=this._rootNodes[n];if(TA(i.extent,e)){t=i;break}}return l(t)?yU(void 0,t,e):-1};var e9t=[],t9t=[],n9t=new re,i9t=new re;_A.prototype.computeBestAvailableLevelOverRectangle=function(e){let t=e9t;t.length=0,e.east<e.west?(t.push(re.fromRadians(-Math.PI,e.south,e.east,e.north,n9t)),t.push(re.fromRadians(e.west,e.south,Math.PI,e.north,i9t))):t.push(e);let n=t9t;n.length=0;let i;for(i=0;i<this._rootNodes.length;++i)xU(n,this._rootNodes[i],t);for(i=n.length-1;i>=0;--i)if(l(n[i])&&n[i].length===0)return i;return 0};var hXe=new pe;_A.prototype.isTileAvailable=function(e,t,n){let i=this._tilingScheme.tileXYToRectangle(t,n,e,ER);return re.center(i,hXe),this.computeMaximumLevelAtPosition(hXe)>=e};_A.prototype.computeChildMaskForTile=function(e,t,n){let i=e+1;if(i>=this._maximumLevel)return 0;let o=0;return o|=this.isTileAvailable(i,2*t,2*n+1)?1:0,o|=this.isTileAvailable(i,2*t+1,2*n+1)?2:0,o|=this.isTileAvailable(i,2*t,2*n)?4:0,o|=this.isTileAvailable(i,2*t+1,2*n)?8:0,o};function xA(e,t,n,i,o){this.tilingScheme=e,this.parent=t,this.level=n,this.x=i,this.y=o,this.extent=e.tileXYToRectangle(i,o,n),this.rectangles=[],this._sw=void 0,this._se=void 0,this._nw=void 0,this._ne=void 0}Object.defineProperties(xA.prototype,{nw:{get:function(){return this._nw||(this._nw=new xA(this.tilingScheme,this,this.level+1,this.x*2,this.y*2)),this._nw}},ne:{get:function(){return this._ne||(this._ne=new xA(this.tilingScheme,this,this.level+1,this.x*2+1,this.y*2)),this._ne}},sw:{get:function(){return this._sw||(this._sw=new xA(this.tilingScheme,this,this.level+1,this.x*2,this.y*2+1)),this._sw}},se:{get:function(){return this._se||(this._se=new xA(this.tilingScheme,this,this.level+1,this.x*2+1,this.y*2+1)),this._se}}});function o9t(e,t,n,i,o){this.level=e,this.west=t,this.south=n,this.east=i,this.north=o}function Rse(e,t){let n=Math.max(e.west,t.west),i=Math.max(e.south,t.south),o=Math.min(e.east,t.east),r=Math.min(e.north,t.north);return i<r&&n<o}function r9t(e,t,n){for(;t.level<e;)if(qK(t.nw.extent,n))t=t.nw;else if(qK(t.ne.extent,n))t=t.ne;else if(qK(t.sw.extent,n))t=t.sw;else if(qK(t.se.extent,n))t=t.se;else break;if(t.rectangles.length===0||t.rectangles[t.rectangles.length-1].level<=n.level)t.rectangles.push(n);else{let i=Eo(t.rectangles,n.level,s9t);i<0&&(i=~i),t.rectangles.splice(i,0,n)}}function s9t(e,t){return e.level-t}function qK(e,t){return t.west>=e.west&&t.east<=e.east&&t.south>=e.south&&t.north<=e.north}function TA(e,t){return t.longitude>=e.west&&t.longitude<=e.east&&t.latitude>=e.south&&t.latitude<=e.north}function yU(e,t,n){let i=0,o=!1;for(;!o;){let r=t._nw&&TA(t._nw.extent,n),s=t._ne&&TA(t._ne.extent,n),a=t._sw&&TA(t._sw.extent,n),c=t._se&&TA(t._se.extent,n);if(r+s+a+c>1){r&&(i=Math.max(i,yU(t,t._nw,n))),s&&(i=Math.max(i,yU(t,t._ne,n))),a&&(i=Math.max(i,yU(t,t._sw,n))),c&&(i=Math.max(i,yU(t,t._se,n)));break}else r?t=t._nw:s?t=t._ne:a?t=t._sw:c?t=t._se:o=!0}for(;t!==e;){let r=t.rectangles;for(let s=r.length-1;s>=0&&r[s].level>i;--s){let a=r[s];TA(a,n)&&(i=a.level)}t=t.parent}return i}function xU(e,t,n){if(!t)return;let i,o=!1;for(i=0;i<n.length;++i)o=o||Rse(t.extent,n[i]);if(!o)return;let r=t.rectangles;for(i=0;i<r.length;++i){let s=r[i];e[s.level]||(e[s.level]=n),e[s.level]=a9t(e[s.level],s)}xU(e,t._nw,n),xU(e,t._ne,n),xU(e,t._sw,n),xU(e,t._se,n)}function a9t(e,t){let n=[];for(let i=0;i<e.length;++i){let o=e[i];Rse(o,t)?(o.west<t.west&&n.push(new re(o.west,o.south,t.west,o.north)),o.east>t.east&&n.push(new re(t.east,o.south,o.east,o.north)),o.south<t.south&&n.push(new re(Math.max(t.west,o.west),o.south,Math.min(t.east,o.east),t.south)),o.north>t.north&&n.push(new re(Math.max(t.west,o.west),t.north,Math.min(t.east,o.east),o.north))):n.push(o)}return n}var rp=_A;var c9t=15;function fXe(e){this.ellipsoid=e.ellipsoid??ne.default,this.credit=void 0,this.tilingScheme=void 0,this.height=void 0,this.width=void 0,this.encoding=void 0,this.lodCount=void 0,this.hasAvailability=!1,this.tilesAvailable=void 0,this.tilesAvailabilityLoaded=void 0,this.levelZeroMaximumGeometricError=void 0,this.terrainDataStructure=void 0}fXe.prototype.build=function(e){e._credit=this.credit,e._tilingScheme=this.tilingScheme,e._height=this.height,e._width=this.width,e._encoding=this.encoding,e._lodCount=this.lodCount,e._hasAvailability=this.hasAvailability,e._tilesAvailable=this.tilesAvailable,e._tilesAvailabilityLoaded=this.tilesAvailabilityLoaded,e._levelZeroMaximumGeometricError=this.levelZeroMaximumGeometricError,e._terrainDataStructure=this.terrainDataStructure};function l9t(e,t){let n=t.copyrightText;l(n)&&(e.credit=new Lt(n));let i=t.spatialReference,o=i.latestWkid??i.wkid,r=t.extent,s={ellipsoid:e.ellipsoid};if(o===4326)s.rectangle=re.fromDegrees(r.xmin,r.ymin,r.xmax,r.ymax),e.tilingScheme=new eo(s);else if(o===3857){let d=Math.PI*e.ellipsoid.maximumRadius;t.extent.xmax>d&&(t.extent.xmax=d),t.extent.ymax>d&&(t.extent.ymax=d),t.extent.xmin<-d&&(t.extent.xmin=-d),t.extent.ymin<-d&&(t.extent.ymin=-d),s.rectangleSouthwestInMeters=new k(r.xmin,r.ymin),s.rectangleNortheastInMeters=new k(r.xmax,r.ymax),e.tilingScheme=new Nr(s)}else throw new ae("Invalid spatial reference");let a=t.tileInfo;if(!l(a))throw new ae("tileInfo is required");e.width=a.rows+1,e.height=a.cols+1,e.encoding=a.format==="LERC"?uh.LERC:uh.NONE,e.lodCount=a.lods.length-1,(e.hasAvailability=t.capabilities.indexOf("Tilemap")!==-1)&&(e.tilesAvailable=new rp(e.tilingScheme,e.lodCount),e.tilesAvailable.addAvailableTileRange(0,0,0,e.tilingScheme.getNumberOfXTilesAtLevel(0),e.tilingScheme.getNumberOfYTilesAtLevel(0)),e.tilesAvailabilityLoaded=new rp(e.tilingScheme,e.lodCount)),e.levelZeroMaximumGeometricError=Qo.getEstimatedLevelZeroGeometricErrorForAHeightmap(e.tilingScheme.ellipsoid,e.width,e.tilingScheme.getNumberOfXTilesAtLevel(0)),t.bandCount>1&&console.log("ArcGISTiledElevationTerrainProvider: Terrain data has more than 1 band. Using the first one."),l(t.minValues)&&l(t.maxValues)?e.terrainDataStructure={elementMultiplier:1,lowestEncodedHeight:t.minValues[0],highestEncodedHeight:t.maxValues[0]}:e.terrainDataStructure={elementMultiplier:1}}async function d9t(e,t,n){try{let i=await t.fetchJson();l9t(e,i)}catch(i){let o=`An error occurred while accessing ${t}.`;throw tr.reportError(void 0,n,l(n)?n._errorEvent:void 0,o),i}}function IT(){this._resource=void 0,this._credit=void 0,this._tilingScheme=void 0,this._levelZeroMaximumGeometricError=void 0,this._maxLevel=void 0,this._terrainDataStructure=void 0,this._width=void 0,this._height=void 0,this._encoding=void 0,this._lodCount=void 0,this._hasAvailability=!1,this._tilesAvailable=void 0,this._tilesAvailabilityLoaded=void 0,this._availableCache={},this._errorEvent=new Se}Object.defineProperties(IT.prototype,{errorEvent:{get:function(){return this._errorEvent}},credit:{get:function(){return this._credit}},tilingScheme:{get:function(){return this._tilingScheme}},hasWaterMask:{get:function(){return!1}},hasVertexNormals:{get:function(){return!1}},availability:{get:function(){return this._tilesAvailable}}});IT.fromUrl=async function(e,t){t=t??B.EMPTY_OBJECT,e=await Promise.resolve(e);let n=ve.createIfNeeded(e);n.appendForwardSlash(),l(t.token)&&(n=n.getDerivedResource({queryParameters:{token:t.token}}));let i=n.getDerivedResource({queryParameters:{f:"pjson"}}),o=new fXe(t);await d9t(o,i);let r=new IT(t);return o.build(r),r._resource=n,r};IT.prototype.requestTileGeometry=function(e,t,n,i){let o=this._resource.getDerivedResource({url:`tile/${n}/${t}/${e}`,request:i}),r=this._hasAvailability,s=Promise.resolve(!0),a;if(r&&!l(Cse(this,n+1,e*2,t*2))){let m=pXe(this,n+1,e*2,t*2);s=m.promise,a=m.request}let c=o.fetchArrayBuffer();if(!l(c)||!l(s))return;let d=this,u=this._tilesAvailable;return Promise.all([c,s]).then(function(m){return new Yc({buffer:m[0],width:d._width,height:d._height,childTileMask:r?u.computeChildMaskForTile(n,e,t):c9t,structure:d._terrainDataStructure,encoding:d._encoding})}).catch(async function(m){if(l(a)&&a.state===Ri.CANCELLED){i.cancel();try{await i.deferred?.promise}catch{}return i.state=Ri.CANCELLED,Promise.reject(m)}return Promise.reject(m)})};function Cse(e,t,n,i){if(!e._hasAvailability)return;let o=e._tilesAvailabilityLoaded,r=e._tilesAvailable;if(t>e._lodCount)return!1;if(r.isTileAvailable(t,n,i))return!0;if(o.isTileAvailable(t,n,i))return!1}IT.prototype.getLevelMaximumGeometricError=function(e){return this._levelZeroMaximumGeometricError/(1<<e)};IT.prototype.getTileDataAvailable=function(e,t,n){if(!this._hasAvailability)return;let i=Cse(this,n,e,t);if(l(i))return i;pXe(this,n,e,t)};IT.prototype.loadTileDataAvailability=function(e,t,n){};function u9t(e,t,n,i){let o=t-1,r=n-1,s=i[e.y*t+e.x],a=[],c={startX:e.x,startY:e.y,endX:0,endY:0},d=new k(e.x+1,e.y+1),u=!1,m=!1;for(;!(u&&m);){let p=d.x,b=m?d.y+1:d.y;if(!u){for(let f=e.y;f<b;++f)if(i[f*t+d.x]!==s){u=!0;break}u?(a.push(new k(d.x,e.y)),--d.x,--p,c.endX=d.x):d.x===o?(c.endX=d.x,u=!0):++d.x}if(!m){let f=d.y*t;for(let y=e.x;y<=p;++y)if(i[f+y]!==s){m=!0;break}m?(a.push(new k(e.x,d.y)),--d.y,c.endY=d.y):d.y===r?(c.endY=d.y,m=!0):++d.y}}return{endingIndices:a,range:c,value:s}}function m9t(e,t,n,i,o){let r=[];if(o.every(function(c){return c===o[0]}))return o[0]===1&&r.push({startX:e,startY:t,endX:e+n-1,endY:t+i-1}),r;let a=[new k(0,0)];for(;a.length>0;){let c=a.pop(),d=u9t(c,n,i,o);if(d.value===1){let m=d.range;m.startX+=e,m.endX+=e,m.startY+=t,m.endY+=t,r.push(m)}let u=d.endingIndices;u.length>0&&(a=a.concat(u))}return r}function pXe(e,t,n,i){if(!e._hasAvailability)return{};let o=Math.floor(n/128)*128,r=Math.floor(i/128)*128,s=Math.min(1<<t,128),a=`tilemap/${t}/${r}/${o}/${s}/${s}`,c=e._availableCache;if(l(c[a]))return c[a];let d=new Ar({throttle:!1,throttleByServer:!0,type:js.TERRAIN}),m=e._resource.getDerivedResource({url:a,request:d}).fetchJson();return l(m)?(m=m.then(function(p){let b=m9t(o,r,s,s,p.data);e._tilesAvailabilityLoaded.addAvailableTileRange(t,o,r,o+s,r+s);let f=e._tilesAvailable;for(let y=0;y<b.length;++y){let _=b[y];f.addAvailableTileRange(t,_.startX,_.startY,_.endX,_.endY)}return Cse(e,t,n,i)}),c[a]={promise:m,request:d},m=m.finally(function(p){return delete c[a],p}),{promise:m,request:d}):{}}var Vse=IT;var TLo=x(T(),1);var bXe="https://dev.virtualearth.net/REST/v1/Locations";function Ese(e){e=e??B.EMPTY_OBJECT;let t=e.key;this._key=t;let n={key:t};l(e.culture)&&(n.culture=e.culture),this._resource=new ve({url:bXe,queryParameters:n}),this._credit=new Lt('<img src="http://dev.virtualearth.net/Branding/logo_powered_by.png"/>',!1)}Object.defineProperties(Ese.prototype,{url:{get:function(){return bXe}},key:{get:function(){return this._key}},credit:{get:function(){return this._credit}}});Ese.prototype.geocode=async function(e){return this._resource.getDerivedResource({queryParameters:{query:e}}).fetchJsonp("jsonp").then(function(n){return n.resourceSets.length===0?[]:n.resourceSets[0].resources.map(function(o){let r=o.bbox,s=r[0],a=r[1],c=r[2],d=r[3];return{displayName:o.name,destination:re.fromDegrees(a,s,d,c)}})})};var Ase=Ese;var ZLo=x(T(),1);function Gse(){}Object.defineProperties(Gse.prototype,{credit:{get:function(){}}});Gse.prototype.geocode=function(e){let t=e.match(/[^\s,\n]+/g);if(t.length===2||t.length===3){let n=+t[0],i=+t[1],o=t.length===3?+t[2]:300;if(isNaN(n)&&isNaN(i)){let r=/^(\d+.?\d*)([nsew])/i;for(let s=0;s<t.length;++s){let a=t[s].match(r);r.test(t[s])&&a.length===3&&(/^[ns]/i.test(a[2])?i=/^[n]/i.test(a[2])?+a[1]:-a[1]:/^[ew]/i.test(a[2])&&(n=/^[e]/i.test(a[2])?+a[1]:-a[1]))}}if(!isNaN(n)&&!isNaN(i)&&!isNaN(o)){let r={displayName:e,destination:h.fromDegrees(n,i,o)};return Promise.resolve([r])}}return Promise.resolve([])};var Lse=Gse;var vLo=x(T(),1);var h9t=new ce,gXe=new h,SA=new h;function f9t(e){let t=e.points,n=e.times;if(t.length<3){let i=n[0],o=1/(n[1]-i),r=t[0],s=t[1];return function(a,c){l(c)||(c=new h);let d=(a-i)*o;return h.lerp(r,s,d,c)}}return function(i,o){l(o)||(o=new h);let r=e._lastTimeIndex=e.findTimeInterval(i,e._lastTimeIndex),s=(i-n[r])/(n[r+1]-n[r]),a=h9t;a.z=s,a.y=s*s,a.x=a.y*s,a.w=1;let c,d,u,m,p;return r===0?(c=t[0],d=t[1],u=e.firstTangent,m=h.subtract(t[2],c,gXe),h.multiplyByScalar(m,.5,m),p=P.multiplyByVector(Tx.hermiteCoefficientMatrix,a,a)):r===t.length-2?(c=t[r],d=t[r+1],m=e.lastTangent,u=h.subtract(d,t[r-1],gXe),h.multiplyByScalar(u,.5,u),p=P.multiplyByVector(Tx.hermiteCoefficientMatrix,a,a)):(c=t[r-1],d=t[r],u=t[r+1],m=t[r+2],p=P.multiplyByVector(PT.catmullRomCoefficientMatrix,a,a)),o=h.multiplyByScalar(c,p.x,o),h.multiplyByScalar(d,p.y,SA),h.add(o,SA,o),h.multiplyByScalar(u,p.z,SA),h.add(o,SA,o),h.multiplyByScalar(m,p.w,SA),h.add(o,SA,o)}}var p9t=new h,b9t=new h;function PT(e){e=e??B.EMPTY_OBJECT;let t=e.points,n=e.times,i=e.firstTangent,o=e.lastTangent;if(t.length>2&&(l(i)||(i=p9t,h.multiplyByScalar(t[1],2,i),h.subtract(i,t[2],i),h.subtract(i,t[0],i),h.multiplyByScalar(i,.5,i)),!l(o))){let r=t.length-1;o=b9t,h.multiplyByScalar(t[r-1],2,o),h.subtract(t[r],o,o),h.add(o,t[r-2],o),h.multiplyByScalar(o,.5,o)}this._times=n,this._points=t,this._firstTangent=h.clone(i),this._lastTangent=h.clone(o),this._evaluateFunction=f9t(this),this._lastTimeIndex=0}Object.defineProperties(PT.prototype,{times:{get:function(){return this._times}},points:{get:function(){return this._points}},firstTangent:{get:function(){return this._firstTangent}},lastTangent:{get:function(){return this._lastTangent}}});PT.catmullRomCoefficientMatrix=new P(-.5,1,-.5,0,1.5,-2.5,0,1,-1.5,2,.5,0,.5,-.5,0,0);PT.prototype.findTimeInterval=vo.prototype.findTimeInterval;PT.prototype.wrapTime=vo.prototype.wrapTime;PT.prototype.clampTime=vo.prototype.clampTime;PT.prototype.evaluate=function(e,t){return this._evaluateFunction(e,t)};var Wse=PT;var RWo=x(T(),1);var nWo=x(T(),1);var vse={},g9t={positions:void 0,normals:void 0,indices:void 0,edgeIndicesWest:void 0,edgeIndicesSouth:void 0,edgeIndicesEast:void 0,edgeIndicesNorth:void 0},y9t=new pe,x9t=new h,T9t=new P,_9t=new P,S9t=new P,Z9t=new h,R9t=new h,C9t=new h,V9t=new h,E9t=new pe,A9t=new k,TU=new h,G9t=new k,L9t=new h,W9t=new h,$K=function(e,t){return e-t};vse.createMesh=async function(e){e=e??B.EMPTY_OBJECT;let{exaggeration:t=1,exaggerationRelativeHeight:n=0,hasVertexNormals:i,hasWebMercatorT:o,gltf:r,minimumHeight:s,maximumHeight:a,skirtHeight:c}=e,u=t!==1,m=me.clone(e.boundingSphere,new me),p=nn.clone(e.orientedBoundingBox,new nn),b=h.clone(e.horizonOcclusionPoint,new h),f=ne.clone(e.ellipsoid,new ne),y=re.clone(e.rectangle,new re);await(r.extensionsRequired!==void 0&&r.extensionsRequired.indexOf("EXT_meshopt_compression")!==-1?mx.ready:Promise.resolve(void 0));let Z=y.west,R=y.south,C=y.north,E=y.width,A=y.height,L=re.center(y,y9t);L.height=.5*(s+a);let F=pe.toCartesian(L,f,x9t),I=_t.eastNorthUpToFixedFrame(F,f,T9t),N=P.inverseTransformation(I,_9t),g=P.unpack(r.nodes[0].matrix,0,S9t);g=P.multiply(Bi.Y_UP_TO_Z_UP,g,g);let V=dkt(r,i,g9t),G=Qo.getSkirtVertexCount(V.edgeIndicesWest,V.edgeIndicesSouth,V.edgeIndicesEast,V.edgeIndicesNorth),v=V.positions,X=V.normals,Y=V.indices,D=v.length/3,M=D+G,O=Y.length,w=Qo.getSkirtIndexCountWithFilledCorners(G),z=M<=65535?Uint16Array:Uint32Array,K=new z(O+w);K.set(Y);let te=new z(V.edgeIndicesWest),H=new z(V.edgeIndicesSouth),$=new z(V.edgeIndicesEast),ee=new z(V.edgeIndicesNorth),le=new z(te).sort(),_e=new z(H).sort(),he=new z($).sort(),Ze=new z(ee).sort(),ye=Ti.geodeticLatitudeToMercatorAngle(R),Ae=1/(Ti.geodeticLatitudeToMercatorAngle(C)-ye),Fe=h.fromElements(Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY,Z9t),tt=h.fromElements(Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY,R9t),Be=new Rr(m.center,void 0,void 0,void 0,void 0,i,o,u,t,n),je=Be.stride,qe=new Float32Array(M*je),We=0;for(let ct=0;ct<D;ct++){let Et=h.unpack(v,ct*3,C9t),zt=P.multiplyByPoint(g,Et,V9t),ut=pe.fromCartesian(zt,f,E9t),{longitude:bt,latitude:ht,height:jt}=ut,st=(bt-Z)/E,pt=(ht-R)/A;st=W.clamp(st,0,1),pt=W.clamp(pt,0,1),Eo(le,ct,$K)>=0?st=0:Eo(he,ct,$K)>=0&&(st=1),Eo(_e,ct,$K)>=0?pt=0:Eo(Ze,ct,$K)>=0&&(pt=1);let Mi=k.fromElements(st,pt,A9t),jn;if(i){let pi=h.unpack(X,ct*3,TU);pi=P.multiplyByPointAsVector(g,pi,TU),pi=h.normalize(pi,TU),jn=dn.octEncode(pi,G9t)}let Si;o&&(Si=(Ti.geodeticLatitudeToMercatorAngle(ht)-ye)*Ae);let Hi;u&&(Hi=f.geodeticSurfaceNormal(zt,L9t)),We=Be.encode(qe,We,zt,Mi,jt,jn,Si,Hi);let Gi=P.multiplyByPoint(N,zt,W9t);Fe=h.minimumByComponent(Gi,Fe,Fe),tt=h.maximumByComponent(Gi,tt,tt)}let Ke=new gc(h.clone(Be.center,new h),qe,K,O,D,s,a,y,me.clone(m,new me),h.clone(b,new h),je,nn.clone(p,new nn),Be,te,H,$,ee);return RXe(Ke,y,f,Fe,tt,I,N,c),Promise.resolve(Ke)};var v9t=new k,F9t=new k,I9t=new Array(6),P9t=new k,X9t=new k,N9t=new k,Y9t=new h,M9t=new h,w9t=new h,k9t=new pe,U9t=new h,D9t=new pe,O9t=new pe,yXe=new h,B9t=new h,z9t=new h,H9t=new h,K9t=new h,J9t=new h,j9t=new h,Q9t=new h,q9t=new P,$9t=new P,xXe=new k,ekt=new k,tkt=new h,nkt=new me,ikt=new nn,okt=new Su,TXe=new h,_Xe=new k,rkt=new k,SXe=new h,skt=new h;function akt(e){let t=e.meshes[0].primitives[0],n=e.accessors[t.attributes.POSITION],i=e.bufferViews[n.bufferView],o=n.count,r=i.extensions?i.extensions.EXT_meshopt_compression:void 0;if(r===void 0){let b=e.buffers[i.buffer].extras._pipeline.source;return new Float32Array(b.buffer,b.byteOffset+(i.byteOffset??0)+(n.byteOffset??0),o*3)}let s=e.buffers[r.buffer].extras._pipeline.source,a=new Uint8Array(s.buffer,s.byteOffset+(r.byteOffset??0)+(n.byteOffset??0),r.byteLength),c=r.byteStride,d=c===4?Uint8Array:Uint16Array,u=new d(o*4);mx.decodeVertexBuffer(new Uint8Array(u.buffer),o,c,a);let m=(1<<u.BYTES_PER_ELEMENT*8)-1,p=new Float32Array(o*3);for(let b=0;b<o;b++)p[b*3+0]=u[b*4+0]/m,p[b*3+1]=u[b*4+1]/m,p[b*3+2]=u[b*4+2]/m;return p}function ckt(e){let t=e.meshes[0].primitives[0],n=e.accessors[t.attributes.NORMAL],i=e.bufferViews[n.bufferView],o=n.count,r=i.extensions?i.extensions.EXT_meshopt_compression:void 0;if(r===void 0){let m=e.buffers[i.buffer].extras._pipeline.source;return new Float32Array(m.buffer,m.byteOffset+(i.byteOffset??0)+(n.byteOffset??0),o*3)}let s=e.buffers[r.buffer].extras._pipeline.source,a=new Uint8Array(s.buffer,s.byteOffset+(r.byteOffset??0)+(n.byteOffset??0),r.byteLength),c=r.byteStride,d=new Int8Array(o*c);mx.decodeVertexBuffer(new Uint8Array(d.buffer),o,c,a);let u=new Float32Array(o*3);for(let m=0;m<o;m++){let p=Math.max(d[m*4+0]/127,-1),b=Math.max(d[m*4+1]/127,-1),f=1-(Math.abs(p)+Math.abs(b));if(f<0){let _=p,S=b;p=(1-Math.abs(S))*W.signNotZero(_),b=(1-Math.abs(_))*W.signNotZero(S)}let y=TU;y.x=p,y.y=b,y.z=f,y=h.normalize(y,TU),u[m*3+0]=y.x,u[m*3+1]=y.y,u[m*3+2]=y.z}return u}function lkt(e){let t=e.meshes[0].primitives[0],n=e.accessors[t.indices],i=e.bufferViews[n.bufferView],o=n.count,r=n.componentType===J.UNSIGNED_SHORT?Uint16Array:Uint32Array,s=i.extensions?i.extensions.EXT_meshopt_compression:void 0;if(s===void 0){let u=e.buffers[i.buffer].extras._pipeline.source;return new r(u.buffer,u.byteOffset+(i.byteOffset??0)+(n.byteOffset??0),o)}let a=e.buffers[s.buffer].extras._pipeline.source,c=new Uint8Array(a.buffer,a.byteOffset+(s.byteOffset??0)+(n.byteOffset??0),s.byteLength),d=new r(o);return mx.decodeIndexBuffer(new Uint8Array(d.buffer),o,s.byteStride,c),d}function eJ(e,t){let n=e.meshes[0].primitives[0],i=e.accessors[n.extensions.CESIUM_tile_edges[t]],o=e.bufferViews[i.bufferView],r=i.count,s=i.componentType===J.UNSIGNED_SHORT?Uint16Array:Uint32Array,a=o.extensions?o.extensions.EXT_meshopt_compression:void 0;if(a===void 0){let p=e.buffers[o.buffer].extras._pipeline.source;return new s(p.buffer,p.byteOffset+(o.byteOffset??0)+(i.byteOffset??0),r)}let c=e.buffers[a.buffer].extras._pipeline.source,d=new Uint8Array(c.buffer,c.byteOffset+(a.byteOffset??0)+(i.byteOffset??0),a.byteLength),u=new s(r),m=a.byteStride;return mx.decodeIndexSequence(new Uint8Array(u.buffer),r,m,d),u}function dkt(e,t,n){return n.positions=akt(e),n.normals=t?ckt(e):void 0,n.indices=lkt(e),n.edgeIndicesWest=eJ(e,"left"),n.edgeIndicesSouth=eJ(e,"bottom"),n.edgeIndicesEast=eJ(e,"right"),n.edgeIndicesNorth=eJ(e,"top"),n}vse.upsampleMesh=function(e){e=e??B.EMPTY_OBJECT;let{isEastChild:t,isNorthChild:n,parentMinimumHeight:i,parentMaximumHeight:o,skirtHeight:r}=e,s=e.parentIndexCountWithoutSkirts,a=e.parentIndices,c=e.parentVertexCountWithoutSkirts,d=e.parentVertices,u=Rr.clone(e.parentEncoding,new Rr),m=u.hasVertexNormals,p=u.hasWebMercatorT,b=u.exaggeration,f=u.exaggerationRelativeHeight,_=b!==1,S=re.clone(e.rectangle,new re),Z=ne.clone(e.ellipsoid),R=[],C=[],E=[],A=[],L=[],F=[],I=[],N=[];Zkt(t,n,s,a,c,d,u,A,L,F,I,N,R,E,C);let g=re.center(S,k9t);g.height=.5*(i+o);let V=pe.toCartesian(g,Z,U9t),G=R.length,v=new Rr(V,void 0,void 0,void 0,void 0,m,p,_,b,f),X=v.stride,Y=Qo.getSkirtVertexCount(L,F,I,N),D=G+Y,M=A.length,O=Qo.getSkirtIndexCountWithFilledCorners(Y),w=M+O,z=D<=65535?Uint16Array:Uint32Array,K=new z(w);K.set(A);let te=new z(L),H=new z(F),$=new z(I),ee=new z(N),le=new Float32Array(D*X),_e=0,he=_t.eastNorthUpToFixedFrame(V,Z,q9t),Ze=P.inverseTransformation(he,$9t),ye=S.west,Ge=S.east,Ae=S.south,Fe=S.north,tt=Ti.geodeticLatitudeToMercatorAngle(Ae),je=1/(Ti.geodeticLatitudeToMercatorAngle(Fe)-tt),qe=Number.POSITIVE_INFINITY,We=Number.NEGATIVE_INFINITY,Ke=h.fromElements(Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY,j9t),ct=h.fromElements(Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY,Q9t);for(let jt=0;jt<G;jt++){let st=R[jt],pt=a[st*3+0],Mi=a[st*3+1],jn=a[st*3+2],Si=ekt;Si.x=C[jt*2+0],Si.y=C[jt*2+1];let Hi=Si.x,Gi=Si.y,pi=E[jt*2+0],Zi=E[jt*2+1],On=1-pi-Zi,rn=u.decodeHeight(d,pt),Hn=u.decodeHeight(d,Mi),$i=u.decodeHeight(d,jn),Po=rn*pi+Hn*Zi+$i*On;qe=Math.min(Po,qe),We=Math.max(Po,We);let hr=W.lerp(ye,Ge,Hi),Is=W.lerp(Ae,Fe,Gi),Hs=pe.fromRadians(hr,Is,Po,O9t),or=pe.toCartesian(Hs,Z,B9t),yi=P.multiplyByPoint(Ze,or,H9t);Ke=h.minimumByComponent(yi,Ke,Ke),ct=h.maximumByComponent(yi,ct,ct);let fr;if(m){let Mn=u.decodeNormal(d,pt,Y9t),Ki=u.decodeNormal(d,Mi,M9t),wi=u.decodeNormal(d,jn,w9t),Xo=h.fromElements(Mn.x*pi+Ki.x*Zi+wi.x*On,Mn.y*pi+Ki.y*Zi+wi.y*On,Mn.z*pi+Ki.z*Zi+wi.z*On,TXe);Xo=h.normalize(Xo,TXe),fr=dn.octEncode(Xo,rkt)}let mo;p&&(mo=(Ti.geodeticLatitudeToMercatorAngle(Is)-tt)*je);let Qr;_&&(Qr=Z.geodeticSurfaceNormal(or,skt)),_e=v.encode(le,_e,or,Si,Po,fr,mo,Qr)}let Et=nn.fromRectangle(S,qe,We,Z,ikt),zt=me.fromVertices(le,v.center,X,nkt),bt=new Hh(Z).computeHorizonCullingPointFromVerticesPossiblyUnderEllipsoid(v.center,le,X,v.center,qe,tkt),ht=new gc(h.clone(v.center,new h),le,K,M,G,qe,We,S,me.clone(zt),h.clone(bt),X,nn.clone(Et),v,te,H,$,ee);return RXe(ht,S,Z,Ke,ct,he,Ze,r),ht};function RXe(e,t,n,i,o,r,s,a){let{encoding:c}=e,d=c.stride,u=e.vertices,{hasVertexNormals:m,hasWebMercatorT:p,exaggeration:b,exaggerationRelativeHeight:f}=c,_=b!==1,S=e.vertexCountWithoutSkirts,Z=S*d,R=u.length/d,C=R-S,E=e.indices,A=e.indexCountWithoutSkirts,L=e.westIndicesSouthToNorth,F=e.southIndicesEastToWest,I=e.eastIndicesNorthToSouth,N=e.northIndicesWestToEast;Qo.addSkirtIndicesWithFilledCorners(L,F,I,N,S,E,A);let g=0,V=g+L.length,G=V+F.length,v=G+I.length,X=[L,F,I,N],Y=[g,V,G,v],D=[-1,0,1,0],M=[0,-1,0,1],O=h.clone(i,K9t),w=h.clone(o,J9t),z=e.maximumHeight,K=e.minimumHeight-a;for(let $=0;$<C;$++){let ee;for(ee=0;ee<3&&!($<Y[ee+1]);ee++);let le=X[ee][$-Y[ee]],_e=c.decodeTextureCoordinates(u,le,xXe),he=1e-4,Ze=_e.x+D[ee]*he,ye=_e.y+M[ee]*he,Ge=W.lerp(t.west,t.east,Ze),Ae=W.clamp(W.lerp(t.south,t.north,ye),-W.PI_OVER_TWO,+W.PI_OVER_TWO),tt=c.decodeHeight(u,le)-a,Be=pe.fromRadians(Ge,Ae,tt,D9t),je=pe.toCartesian(Be,n,yXe),qe;m&&(qe=c.getOctEncodedNormal(u,le,_Xe));let We;p&&(We=c.decodeWebMercatorT(u,le));let Ke;_&&(Ke=n.geodeticSurfaceNormal(je,SXe)),Z=c.encode(u,Z,je,_e,tt,qe,We,Ke);let ct=P.multiplyByPoint(s,je,z9t);h.minimumByComponent(ct,O,O),h.maximumByComponent(ct,w,w)}let te=Su.fromCorners(O,w,okt),H=new Rr(c.center,te,K,z,r,c.hasVertexNormals,c.hasWebMercatorT,_,b,f);if(c.quantization!==H.quantization){let $=H,ee=$.stride,le=new Float32Array(R*ee),_e=0;for(let he=0;he<R;he++)_e=$.encode(le,_e,c.decodePosition(u,he,yXe),c.decodeTextureCoordinates(u,he,xXe),c.decodeHeight(u,he),c.hasVertexNormals?c.getOctEncodedNormal(u,he,_Xe):void 0,c.hasWebMercatorT?c.decodeWebMercatorT(u,he):void 0,c.hasGeodeticSurfaceNormals?c.decodeGeodeticSurfaceNormal(u,he,SXe):void 0);e.vertices=le,e.stride=ee,e.encoding=$}return e}var Fse=0,ukt=1,Ise=2,Pse=3,mkt=4,hkt=new h,fkt=[new h,new h,new h,new h,new h,new h],pkt=[new k,new k,new k,new k,new k,new k],bkt=[new h,new h,new h,new h,new h,new h],gkt=[new k,new k,new k,new k,new k,new k];function ZXe(e,t,n,i){switch(n){case Fse:return W.sign(i.x-e.x);case Ise:return W.sign(t.x-i.x);case Pse:return W.sign(i.y-e.y);default:return W.sign(t.y-i.y)}}function ykt(e,t,n,i,o,r){let s,a,c;switch(n){case Fse:s=(e.x-i.x)/(o.x-i.x),a=e.x,c=i.y+(o.y-i.y)*s;break;case Ise:s=(t.x-i.x)/(o.x-i.x),a=t.x,c=i.y+(o.y-i.y)*s;break;case Pse:s=(e.y-i.y)/(o.y-i.y),a=i.x+(o.x-i.x)*s,c=e.y;break;default:s=(t.y-i.y)/(o.y-i.y),a=i.x+(o.x-i.x)*s,c=t.y;break}return h.fromElements(a,c,s,r)}var xkt={length:0,coordinates:[new k,new k,new k,new k,new k,new k],barycentricCoordinates:[new h,new h,new h,new h,new h,new h]};function Tkt(e,t,n,i,o,r,s,a){let c,d=pkt,u=fkt,m=3,p=gkt;k.clone(o,p[0]),k.clone(r,p[1]),k.clone(s,p[2]);let b=bkt;h.fromElements(1,0,0,b[0]),h.fromElements(0,1,0,b[1]),h.fromElements(0,0,1,b[2]);for(let f=0;f<t;f++){let y=(e+f)%mkt,_=d,S=u;d=p,u=b,c=m,p=_,b=S,m=0;let Z=c-1,R=d[Z],C=u[Z],E=ZXe(n,i,y,R);for(let A=0;A<c;A++){let L=d[A],F=u[A],I=ZXe(n,i,y,L);if(E*I===-1){let N=ykt(n,i,y,R,L,hkt),{x:g,y:V,z:G}=N,v=1-G,X=C.x*v+F.x*G,Y=C.y*v+F.y*G,D=C.z*v+F.z*G;k.fromElements(g,V,p[m]),h.fromElements(X,Y,D,b[m]),m++}I>=0&&(k.clone(L,p[m]),h.clone(F,b[m]),m++),R=L,C=F,E=I}if(m===0)break}a.length=m;for(let f=0;f<m;f++)k.clone(p[f],a.coordinates[f]),h.clone(b[f],a.barycentricCoordinates[f]);return a}function _kt(e,t,n,i,o,r,s,a){return Tkt(e?t?Pse:Fse:t?Ise:ukt,2,n,i,o,r,s,a)}var Skt=[[],[0],[1],[0,1],[2],[0,2],[1,2],[0,1,2]];function Zkt(e,t,n,i,o,r,s,a,c,d,u,m,p,b,f){let y={},_=e?.5:0,S=e?1:.5,Z=t?.5:0,R=t?1:.5,C=v9t;C.x=_,C.y=Z;let E=F9t;E.x=S,E.y=R;let A=0;for(let L=0;L<n;L+=3){let F=i[L+0],I=i[L+1],N=i[L+2],g=s.decodeTextureCoordinates(r,F,P9t),V=s.decodeTextureCoordinates(r,I,X9t),G=s.decodeTextureCoordinates(r,N,N9t),v=_kt(e,t,C,E,g,V,G,xkt),X=v.length;if(X<3)continue;let Y=I9t;for(let w=0;w<X;w++){let z=v.barycentricCoordinates[w],K=z.x,te=z.y,H=z.z,$=Math.ceil(K)|Math.ceil(te)<<1|Math.ceil(H)<<2,ee=Skt[$],le,_e=!1;if(ee.length===1){let he=ee[0],ye=i[L+he];le=y[ye],le===void 0&&(_e=!0,le=A++,y[ye]=le)}else if(ee.length===2){let he=ee[0],Ze=ee[1],ye=i[L+he],Ge=i[L+Ze],Ae=v.barycentricCoordinates[(w+X-1)%X],Fe=Math.ceil(Ae.x)|Math.ceil(Ae.y)<<1|Math.ceil(Ae.z)<<2,tt=$===Fe,Be=Math.min(ye,Ge),je=Math.max(ye,Ge),qe=o+2*(Be*o+je),We=qe+0,Ke=qe+1,ct=y[We],Et=y[Ke],zt=!tt==(ct===void 0||Et===void 0);if(le=zt?ct:Et,le===void 0){_e=!0,le=A++;let ut=zt?We:Ke;y[ut]=le}}else _e=!0,le=A++;if(Y[w]=le,_e){let he=L/3;p.push(he);let Ze=v.coordinates[w],ye=(Ze.x-_)/(S-_),Ge=(Ze.y-Z)/(R-Z);f.push(ye,Ge),b.push(K,te),ye===0?c.push(le):ye===1&&u.push(le),Ge===0?d.push(le):Ge===1&&m.push(le)}}let D=Y[0],M=Y[1],O=Y[2];a.push(D,M,O);for(let w=3;w<X;w++)M=O,O=Y[w],a.push(D,M,O)}c.sort(function(L,F){return f[L*2+1]-f[F*2+1]}),d.sort(function(L,F){return f[F*2+0]-f[L*2+0]}),u.sort(function(L,F){return f[F*2+1]-f[L*2+1]}),m.sort(function(L,F){return f[L*2+0]-f[F*2+0]})}var ZA=vse;var aWo=x(T(),1);var tJ={};tJ.clipTriangleAtAxisAlignedThreshold=function(e,t,n,i,o,r){l(r)?r.length=0:r=[];let s,a,c;t?(s=n<e,a=i<e,c=o<e):(s=n>e,a=i>e,c=o>e);let d=s+a+c,u,m,p,b,f,y;return d===1?s?(u=(e-n)/(i-n),m=(e-n)/(o-n),r.push(1),r.push(2),m!==1&&(r.push(-1),r.push(0),r.push(2),r.push(m)),u!==1&&(r.push(-1),r.push(0),r.push(1),r.push(u))):a?(p=(e-i)/(o-i),b=(e-i)/(n-i),r.push(2),r.push(0),b!==1&&(r.push(-1),r.push(1),r.push(0),r.push(b)),p!==1&&(r.push(-1),r.push(1),r.push(2),r.push(p))):c&&(f=(e-o)/(n-o),y=(e-o)/(i-o),r.push(0),r.push(1),y!==1&&(r.push(-1),r.push(2),r.push(1),r.push(y)),f!==1&&(r.push(-1),r.push(2),r.push(0),r.push(f))):d===2?!s&&n!==e?(b=(e-i)/(n-i),f=(e-o)/(n-o),r.push(0),r.push(-1),r.push(1),r.push(0),r.push(b),r.push(-1),r.push(2),r.push(0),r.push(f)):!a&&i!==e?(y=(e-o)/(i-o),u=(e-n)/(i-n),r.push(1),r.push(-1),r.push(2),r.push(1),r.push(y),r.push(-1),r.push(0),r.push(1),r.push(u)):!c&&o!==e&&(m=(e-n)/(o-n),p=(e-i)/(o-i),r.push(2),r.push(-1),r.push(0),r.push(2),r.push(m),r.push(-1),r.push(1),r.push(2),r.push(p)):d!==3&&(r.push(0),r.push(1),r.push(2)),r};tJ.computeBarycentricCoordinates=function(e,t,n,i,o,r,s,a,c){let d=n-s,u=s-o,m=r-a,p=i-a,b=1/(m*d+u*p),f=t-a,y=e-s,_=(m*y+u*f)*b,S=(-p*y+d*f)*b,Z=1-_-S;return l(c)?(c.x=_,c.y=S,c.z=Z,c):new h(_,S,Z)};tJ.computeLineSegmentLineSegmentIntersection=function(e,t,n,i,o,r,s,a,c){let d=(s-o)*(t-r)-(a-r)*(e-o),u=(n-e)*(t-r)-(i-t)*(e-o),m=(a-r)*(n-e)-(s-o)*(i-t);if(m===0)return;let p=d/m,b=u/m;if(p>=0&&p<=1&&b>=0&&b<=1)return l(c)||(c=new k),c.x=e+p*(n-e),c.y=t+p*(i-t),c};var sp=tJ;function uy(e){e=e??B.EMPTY_OBJECT,this._minimumHeight=e.minimumHeight,this._maximumHeight=e.maximumHeight,this._skirtHeight=e.skirtHeight,this._boundingSphere=me.clone(e.boundingSphere,new me),this._orientedBoundingBox=nn.clone(e.orientedBoundingBox,new nn),this._horizonOcclusionPoint=h.clone(e.horizonOcclusionPoint,new h),this._hasVertexNormals=e.requestVertexNormals??!1,this._hasWaterMask=e.requestWaterMask??!1,this._hasWebMercatorT=!0,this._credits=e.credits,this._childTileMask=e.childTileMask??15,this._gltf=e.gltf,this._mesh=void 0,this._waterMask=e.waterMask}Object.defineProperties(uy.prototype,{credits:{get:function(){return this._credits}},waterMask:{get:function(){return this._waterMask}}});uy.prototype.interpolateHeight=function(e,t,n){let i=this._mesh;return i===void 0?void 0:VXe(i,e,t,n)};uy.prototype.isChildAvailable=function(e,t,n,i){let o=2;return n!==e*2&&++o,i!==t*2&&(o-=2),(this._childTileMask&1<<o)!==0};var CXe="createVerticesFromCesium3DTilesTerrain",Rkt=new qn(CXe),Ckt=new qn(CXe,$d.maximumAsynchronousTasks);uy.prototype.createMesh=function(e){e=e??B.EMPTY_OBJECT;let n=e.throttle??!0?Ckt:Rkt,i=e.tilingScheme,o=i.ellipsoid,r=e.x,s=e.y,a=e.level,c=i.tileXYToRectangle(r,s,a,new re),d=this._gltf,u=n.scheduleTask({ellipsoid:o,rectangle:c,hasVertexNormals:this._hasVertexNormals,hasWaterMask:this._hasWaterMask,hasWebMercatorT:this._hasWebMercatorT,gltf:d,minimumHeight:this._minimumHeight,maximumHeight:this._maximumHeight,boundingSphere:this._boundingSphere,orientedBoundingBox:this._orientedBoundingBox,horizonOcclusionPoint:this._horizonOcclusionPoint,skirtHeight:this._skirtHeight,exaggeration:e.exaggeration,exaggerationRelativeHeight:e.exaggerationRelativeHeight});if(!l(u))return;let m=this;return Promise.resolve(u).then(function(p){let b=p,f=Rr.clone(b.encoding,new Rr),y=new Float32Array(b.verticesBuffer),_=y.length/f.stride,S=b.vertexCountWithoutSkirts,Z=_<=65535?Uint16Array:Uint32Array,R=new Z(b.indicesBuffer),C=new Z(b.westIndicesBuffer),E=new Z(b.eastIndicesBuffer),A=new Z(b.southIndicesBuffer),L=new Z(b.northIndicesBuffer),F=b.indexCountWithoutSkirts,I=m._minimumHeight,N=m._maximumHeight,g=h.clone(f.center,new h),V=me.clone(m._boundingSphere,new me),G=h.clone(m._horizonOcclusionPoint,new h),v=nn.clone(m._orientedBoundingBox,new nn),X=new gc(g,y,R,F,S,I,N,c,V,G,f.stride,v,f,C,A,E,L);return m._mesh=X,Promise.resolve(X)})};uy.prototype._createMeshSync=function(e){e=e??B.EMPTY_OBJECT;let t=e.tilingScheme,n=t.ellipsoid,i=e.x,o=e.y,r=e.level,s=t.tileXYToRectangle(i,o,r,new re),a=ZA.createMesh({ellipsoid:n,rectangle:s,hasVertexNormals:this._hasVertexNormals,hasWebMercatorT:this._hasWebMercatorT,gltf:this._gltf,minimumHeight:this._minimumHeight,maximumHeight:this._maximumHeight,boundingSphere:this._boundingSphere,orientedBoundingBox:this._orientedBoundingBox,horizonOcclusionPoint:this._horizonOcclusionPoint,skirtHeight:this._skirtHeight,exaggeration:e.exaggeration,exaggerationRelativeHeight:e.exaggerationRelativeHeight}),c=this;return Promise.resolve(a).then(function(d){return c._mesh=d,Promise.resolve(d)})};uy.prototype.upsample=function(e,t,n,i,o,r,s){let a=this._mesh;return a===void 0?void 0:nJ(!1,a,this._skirtHeight,this._credits,e,t,n,i,o,r,s)};uy.prototype._upsampleSync=function(e,t,n,i,o,r,s){let a=this._mesh;return a===void 0?void 0:nJ(!0,a,this._skirtHeight,this._credits,e,t,n,i,o,r,s)};uy.prototype.wasCreatedByUpsampling=function(){return!1};function dy(e){e=e??B.EMPTY_OBJECT,this._mesh=e.terrainMesh,this._skirtHeight=e.skirtHeight,this._credits=e.credits}dy.prototype.createMesh=function(e){return e=e??B.EMPTY_OBJECT,Promise.resolve(this._mesh)};dy.prototype.upsample=function(e,t,n,i,o,r,s){return nJ(!1,this._mesh,this._skirtHeight,this._credits,e,t,n,i,o,r,s)};dy.prototype._upsampleSync=function(e,t,n,i,o,r,s){return nJ(!0,this._mesh,this._skirtHeight,this._credits,e,t,n,i,o,r,s)};dy.prototype.interpolateHeight=function(e,t,n){let i=this._mesh;return VXe(i,e,t,n)};dy.prototype.wasCreatedByUpsampling=function(){return!0};dy.prototype.isChildAvailable=function(e,t,n,i){return!1};Object.defineProperties(dy.prototype,{credits:{get:function(){return this._credits}},waterMask:{get:function(){}}});var Vkt=new qn("upsampleVerticesFromCesium3DTilesTerrain",$d.maximumAsynchronousTasks);function nJ(e,t,n,i,o,r,s,a,c,d,u){if(u-a>1)throw new ge("Upsampling through more than one level at a time is not currently supported.");let p=n*.5,b=r*2!==c,f=s*2===d,y=o.tileXYToRectangle(c,d,u,new re),_=o.ellipsoid,S={isEastChild:b,isNorthChild:f,rectangle:y,ellipsoid:_,skirtHeight:p,parentVertices:t.vertices,parentIndices:t.indices,parentVertexCountWithoutSkirts:t.vertexCountWithoutSkirts,parentIndexCountWithoutSkirts:t.indexCountWithoutSkirts,parentMinimumHeight:t.minimumHeight,parentMaximumHeight:t.maximumHeight,parentEncoding:t.encoding};if(e){let R=ZA.upsampleMesh(S),C=new dy({terrainMesh:R,skirtHeight:p,credits:i});return Promise.resolve(C)}let Z=Vkt.scheduleTask(S);if(Z!==void 0)return Z.then(function(R){let C=Rr.clone(R.encoding,new Rr),E=C.stride,A=new Float32Array(R.verticesBuffer),L=A.length/E,F=R.vertexCountWithoutSkirts,I=L<=65535?Uint16Array:Uint32Array,N=new I(R.indicesBuffer),g=new I(R.westIndicesBuffer),V=new I(R.eastIndicesBuffer),G=new I(R.southIndicesBuffer),v=new I(R.northIndicesBuffer),X=R.indexCountWithoutSkirts,Y=R.minimumHeight,D=R.maximumHeight,M=h.clone(C.center,new h),O=me.clone(R.boundingSphere,new me),w=h.clone(R.horizonOcclusionPoint,new h),z=nn.clone(R.orientedBoundingBox,new nn),K=new gc(M,A,N,X,F,Y,D,y,O,w,E,z,C,g,G,V,v),te=new dy({terrainMesh:K,skirtHeight:p,credits:i});return Promise.resolve(te)})}var Ekt=new k,Akt=new k,Gkt=new k,Lkt=new h;function VXe(e,t,n,i){let o=W.clamp((n-t.west)/t.width,0,1),r=W.clamp((i-t.south)/t.height,0,1),{vertices:s,encoding:a,indices:c}=e;for(let d=0;d<e.indexCountWithoutSkirts;d+=3){let u=c[d],m=c[d+1],p=c[d+2],b=a.decodeTextureCoordinates(s,u,Ekt),f=a.decodeTextureCoordinates(s,m,Akt),y=a.decodeTextureCoordinates(s,p,Gkt),_=Math.min(b.x,f.x,y.x),S=Math.max(b.x,f.x,y.x),Z=Math.min(b.y,f.y,y.y),R=Math.max(b.y,f.y,y.y);if(o>=_&&o<=S&&r>=Z&&r<=R){let C=sp.computeBarycentricCoordinates(o,r,b.x,b.y,f.x,f.y,y.x,y.y,Lkt);if(C.x>=0&&C.y>=0&&C.z>=0){let E=a.decodeHeight(s,u),A=a.decodeHeight(s,m),L=a.decodeHeight(s,p);return C.x*E+C.y*A+C.z*L}}}return 0}var _U=uy;var qWo=x(T(),1);function D0(e){e=e??B.EMPTY_OBJECT;let t=e.credit;typeof t=="string"&&(t=new Lt(t)),this._credit=t,this._tileCredits=void 0,this._errorEvent=new Se,this._ellipsoid=e.ellipsoid??ne.WGS84,this._tilingScheme=new eo({ellipsoid:this._ellipsoid}),this._subtreeCache=new AR({provider:this}),this._tileset0=void 0,this._tileset1=void 0,this._resource=void 0,this._requestVertexNormals=e.requestVertexNormals??!1,this._requestWaterMask=e.requestWaterMask??!1}D0.fromUrl=async function(e,t){t=t??B.EMPTY_OBJECT,e=await Promise.resolve(e);let n=ve.createIfNeeded(e),i;try{i=await n.fetchJson()}catch(u){throw new ae("Could not load tileset JSON",u)}let o=new D0(t);o._tileCredits=n.credits,o._resource=n;let r=i.root.children,s=r[0],a=r[1],c=i.schema,d=nd.fromJson(c);return o._tileset0=new s0(n,s,d),o._tileset1=new s0(n,a,d),o};D0.fromIonAssetId=async function(e,t){let n=await zr.fromAssetId(e);return D0.fromUrl(n,t)};var Wkt=new Array(3);D0.prototype.requestTileGeometry=async function(e,t,n,i){let o=AXe(n,e),r=o===0?this._tileset0:this._tileset1,s=GXe(r,n,e,t),a=s.getSubtreeCoordinates(),c=this._subtreeCache,d=c.find(o,a),u=this._requestWaterMask,m=this,p;if(d===void 0){let Z=r.subtreeUriTemplate.getDerivedResource({templateValues:a.getTemplateValues()});p=r.baseResource.getDerivedResource({url:Z.url}).fetchArrayBuffer().then(async function(C){if(d=c.find(o,a),d===void 0){let E=new Uint8Array(C);d=await ug.fromSubtreeJson(m._resource,void 0,E,r,a),c.addSubtree(o,d)}return d})}else p=Promise.resolve(d);let b=r.contentUriTemplates[0].getDerivedResource({templateValues:s.getTemplateValues()}),f=r.baseResource.getDerivedResource({url:b.url}),y=f.fetchArrayBuffer();if(y===void 0)return;let _=y.then(Z=>RS(new Uint8Array(Z))),S=Wkt;S[0]=p,S[1]=_,S[2]=u?_.then(Z=>vkt(Z,f)):void 0;try{let Z=await Promise.all(S),R=Z[0],C=Z[1],E=Z[2],A=R.getTileMetadataView(s),L=A.getPropertyBySemantic(eh.TILE_MINIMUM_HEIGHT),F=A.getPropertyBySemantic(eh.TILE_MAXIMUM_HEIGHT),I=A.getPropertyBySemantic(eh.TILE_BOUNDING_SPHERE),N=me.unpack(I,0,new me),g=A.getPropertyBySemantic(eh.TILE_HORIZON_OCCLUSION_POINT),G=m._tilingScheme.tileXYToRectangle(e,t,n,new re),v=m._ellipsoid,X=nn.fromRectangle(G,L,F,v,new nn),Y=m.getLevelMaximumGeometricError(n)*5,D=iJ(r,R,s,0,0),M=iJ(r,R,s,1,0),O=iJ(r,R,s,0,1),w=iJ(r,R,s,1,1),z=(D?1:0)|(M?2:0)|(O?4:0)|(w?8:0),K=new _U({gltf:C,minimumHeight:L,maximumHeight:F,boundingSphere:N,orientedBoundingBox:X,horizonOcclusionPoint:g,skirtHeight:Y,requestVertexNormals:m._requestVertexNormals,childTileMask:z,credits:m._tileCredits,waterMask:E});return Promise.resolve(K)}catch(Z){console.log(`Could not load subtree: ${o} ${a.level} ${a.x} ${a.y}: ${Z}`),console.log(`Could not load tile: ${o} ${s.level} ${s.x} ${s.y}: ${Z}`);return}};D0.prototype.getTileDataAvailable=function(e,t,n){let i=this._subtreeCache,o=AXe(n,e),r=o===0?this._tileset0:this._tileset1,s=GXe(r,n,e,t),a=s.getSubtreeCoordinates(),c=i.find(o,a);if(c!==void 0)return c.tileIsAvailableAtCoordinates(s);if(a.isImplicitTilesetRoot())return s.isSubtreeRoot()?!0:void 0;let d=a.getParentSubtreeCoordinates(),u=i.find(o,d);if(u!==void 0)return u.childSubtreeIsAvailableAtCoordinates(a)?s.isSubtreeRoot()?!0:void 0:!1};function AXe(e,t){let n=1<<e;return t/n|0}function GXe(e,t,n,i){let o=1<<t,r=t,s=n%o,a=o-i-1,{subdivisionScheme:c,subtreeLevels:d}=e;return new a0({subdivisionScheme:c,subtreeLevels:d,level:r,x:s,y:a})}async function vkt(e,t){let n=e.extensions?.EXT_structural_metadata;if(!l(n)||!l(n.propertyTextures))return;let i=new px({schema:n.schema});await i.load();let o=i.schema,r,s;if(l(o.classes)){for(let b in o.classes)if(o.classes.hasOwnProperty(b)&&(r=o.classes[b],s=r.propertiesBySemantic.WATERMASK,l(s)))break}if(!l(s))return;let a=n.propertyTextures.find(b=>b.class===r.id);if(!l(a))throw new ge(`Expected a propertyTexture with a class ${r.id}`);let c=a.properties[s.id],d=e.textures[c.index],u=e.images[d.source]?.bufferView,m=Yi.getBufferViewLoader({gltf:e,bufferViewId:u,gltfResource:t,baseResource:t});return await m.load(),await zb({uint8Array:new Uint8Array(m.typedArray),format:"image/png",flipY:!1,skipColorSpaceConversion:!0})}function iJ(e,t,n,i,o){let r=n.isBottomOfSubtree(),a=Xse(e,1,i,o),c=n.getDescendantCoordinates(a);return r?t.childSubtreeIsAvailableAtCoordinates(c):t.tileIsAvailableAtCoordinates(c)}function Xse(e,t,n,i){let{subdivisionScheme:o,subtreeLevels:r}=e;return new a0({subdivisionScheme:o,subtreeLevels:r,level:t,x:n,y:i})}D0.prototype.loadTileDataAvailability=function(e,t,n){};D0.prototype.getLevelMaximumGeometricError=function(e){let t=this._ellipsoid;return Qo.getEstimatedLevelZeroGeometricErrorForAHeightmap(t,64,2)/(1<<e)};Object.defineProperties(D0.prototype,{errorEvent:{get:function(){return this._errorEvent}},credit:{get:function(){return this._credit}},tilingScheme:{get:function(){return this._tilingScheme}},hasWaterMask:{get:function(){return this._requestWaterMask}},hasVertexNormals:{get:function(){return this._requestVertexNormals}},availability:{get:function(){return this._subtreeCache}}});function Fkt(e,t,n){this.rootId=e,this.subtree=t,this.stamp=n}function AR(e){this._maximumSubtreeCount=e.maximumSubtreeCount??0,this._subtreeRequestCounter=0,this._queue=new Bg({comparator:AR.comparator}),this._provider=e.provider}AR.comparator=function(e,t){let n=e.subtree.implicitCoordinates,i=t.subtree.implicitCoordinates;return n.isAncestor(i)?1:i.isAncestor(n)?-1:e.stamp-t.stamp};AR.prototype.addSubtree=function(e,t){let n=new Fkt(e,t,this._subtreeRequestCounter);this._queue.insert(n),this._subtreeRequestCounter++;let i=t.implicitCoordinates;if(i.level>0){let o=i.getParentSubtreeCoordinates(),r=this.find(e,o)}if(this._maximumSubtreeCount>0)for(;this._queue.length>this._maximumSubtreeCount&&this._queue.getMinimum()!==n;)this._queue.removeMinimum()};AR.prototype.find=function(e,t){let n=this._queue,i=n.internalArray,{level:o,x:r,y:s}=t;for(let a=0;a<n.length;a++){let c=i[a],d=c.rootId,u=c.subtree.implicitCoordinates;if(d===e&&u.level===o&&u.x===r&&u.y===s)return c.subtree}};AR.prototype._computeMaximumImplicitTileCoordinatesAtPosition=function(e){let{longitude:t,latitude:n}=e,i=this._provider,o=t<0?0:1,r=o===0?i._tileset0:i._tileset1,s=r.subtreeLevels,a=Xse(r,0,0,0),c=this.find(o,a);if(c===void 0)return;let d=c.implicitCoordinates,u=d.x,m=d.y,p=d.level,b=-W.PI,f=+W.PI,y=W.lerp(b,f,o/2),_=W.lerp(b,f,(o+1)/2),S=-W.PI*.5,Z=+W.PI*.5,R=0,C=0,E=!0;for(;E;){let L=1/(1<<p),F=(_-y)*L,I=y+u*F,N=(Z-S)*L,g=S+m*N;R=(t-I)/F,C=(n-g)/N;let V=EXe(r,d,R,C,s);if(c.childSubtreeIsAvailableAtCoordinates(V)){let G=this.find(o,V);if(G!==void 0)c=G,d=c.implicitCoordinates,u=d.x,m=d.y,p=d.level;else return V}else E=!1}let A;for(let L=0;L<s;L++){let F=EXe(r,d,R,C,L);if(c.tileIsAvailableAtCoordinates(F))A=F;else break}return A};function EXe(e,t,n,i,o){let r=1<<o,s=W.clamp(n*r|0,0,r-1),a=W.clamp(i*r|0,0,r-1),c=Xse(e,o,s,a);return t.getDescendantCoordinates(c)}AR.prototype.computeMaximumLevelAtPosition=function(e){let t=this._computeMaximumImplicitTileCoordinatesAtPosition(e);return t===void 0?0:t.level};var Nse=D0;var Yvo=x(T(),1);var hvo=x(T(),1);function XT(e){e=e??B.EMPTY_OBJECT,this._quantizedVertices=e.quantizedVertices,this._encodedNormals=e.encodedNormals,this._indices=e.indices,this._minimumHeight=e.minimumHeight,this._maximumHeight=e.maximumHeight,this._boundingSphere=e.boundingSphere,this._orientedBoundingBox=e.orientedBoundingBox,this._horizonOcclusionPoint=e.horizonOcclusionPoint,this._credits=e.credits;let t=this._quantizedVertices.length/3,n=this._uValues=this._quantizedVertices.subarray(0,t),i=this._vValues=this._quantizedVertices.subarray(t,2*t);this._heightValues=this._quantizedVertices.subarray(2*t,3*t);function o(s,a){return i[s]-i[a]}function r(s,a){return n[s]-n[a]}this._westIndices=rJ(e.westIndices,o,t),this._southIndices=rJ(e.southIndices,r,t),this._eastIndices=rJ(e.eastIndices,o,t),this._northIndices=rJ(e.northIndices,r,t),this._westSkirtHeight=e.westSkirtHeight,this._southSkirtHeight=e.southSkirtHeight,this._eastSkirtHeight=e.eastSkirtHeight,this._northSkirtHeight=e.northSkirtHeight,this._childTileMask=e.childTileMask??15,this._createdByUpsampling=e.createdByUpsampling??!1,this._waterMask=e.waterMask,this._mesh=void 0}Object.defineProperties(XT.prototype,{credits:{get:function(){return this._credits}},waterMask:{get:function(){return this._waterMask}},childTileMask:{get:function(){return this._childTileMask}},canUpsample:{get:function(){return l(this._mesh)}}});var oJ=[];function rJ(e,t,n){oJ.length=e.length;let i=!1;for(let o=0,r=e.length;o<r;++o)oJ[o]=e[o],i=i||o>0&&t(e[o-1],e[o])>0;return i?(oJ.sort(t),Oe.createTypedArray(n,oJ)):e}var LXe="createVerticesFromQuantizedTerrainMesh",Ikt=new qn(LXe),Pkt=new qn(LXe,$d.maximumAsynchronousTasks);XT.prototype.createMesh=function(e){e=e??B.EMPTY_OBJECT;let t=e.tilingScheme,n=e.x,i=e.y,o=e.level,r=e.exaggeration??1,s=e.exaggerationRelativeHeight??0,a=e.throttle??!0,c=t.ellipsoid,d=t.tileXYToRectangle(n,i,o),m=(a?Pkt:Ikt).scheduleTask({minimumHeight:this._minimumHeight,maximumHeight:this._maximumHeight,quantizedVertices:this._quantizedVertices,octEncodedNormals:this._encodedNormals,includeWebMercatorT:!0,indices:this._indices,westIndices:this._westIndices,southIndices:this._southIndices,eastIndices:this._eastIndices,northIndices:this._northIndices,westSkirtHeight:this._westSkirtHeight,southSkirtHeight:this._southSkirtHeight,eastSkirtHeight:this._eastSkirtHeight,northSkirtHeight:this._northSkirtHeight,rectangle:d,relativeToCenter:this._boundingSphere.center,ellipsoid:c,exaggeration:r,exaggerationRelativeHeight:s});if(!l(m))return;let p=this;return Promise.resolve(m).then(function(b){let f=p._quantizedVertices.length/3,y=f+p._westIndices.length+p._southIndices.length+p._eastIndices.length+p._northIndices.length,_=Oe.createTypedArray(y,b.indices),S=new Float32Array(b.vertices),Z=b.center,R=b.minimumHeight,C=b.maximumHeight,E=p._boundingSphere,A=p._orientedBoundingBox,L=h.clone(b.occludeePointInScaledSpace)??p._horizonOcclusionPoint,F=b.vertexStride,I=Rr.clone(b.encoding);return p._mesh=new gc(Z,S,_,b.indexCountWithoutSkirts,f,R,C,d,E,L,F,A,I,b.westIndicesSouthToNorth,b.southIndicesEastToWest,b.eastIndicesNorthToSouth,b.northIndicesWestToEast),p._quantizedVertices=void 0,p._encodedNormals=void 0,p._indices=void 0,p._uValues=void 0,p._vValues=void 0,p._heightValues=void 0,p._westIndices=void 0,p._southIndices=void 0,p._eastIndices=void 0,p._northIndices=void 0,p._mesh})};var Xkt=new qn("upsampleQuantizedTerrainMesh",$d.maximumAsynchronousTasks);XT.prototype.upsample=function(e,t,n,i,o,r,s){let a=this._mesh;if(!l(this._mesh))return;let c=t*2!==o,d=n*2===r,u=e.ellipsoid,m=e.tileXYToRectangle(o,r,s),p=Xkt.scheduleTask({vertices:a.vertices,vertexCountWithoutSkirts:a.vertexCountWithoutSkirts,indices:a.indices,indexCountWithoutSkirts:a.indexCountWithoutSkirts,encoding:a.encoding,minimumHeight:this._minimumHeight,maximumHeight:this._maximumHeight,isEastChild:c,isNorthChild:d,childRectangle:m,ellipsoid:u});if(!l(p))return;let b=Math.min(this._westSkirtHeight,this._eastSkirtHeight);b=Math.min(b,this._southSkirtHeight),b=Math.min(b,this._northSkirtHeight);let f=c?b*.5:this._westSkirtHeight,y=d?b*.5:this._southSkirtHeight,_=c?this._eastSkirtHeight:b*.5,S=d?this._northSkirtHeight:b*.5,Z=this._credits;return Promise.resolve(p).then(function(R){let C=new Uint16Array(R.vertices),E=Oe.createTypedArray(C.length/3,R.indices),A;return l(R.encodedNormals)&&(A=new Uint8Array(R.encodedNormals)),new XT({quantizedVertices:C,indices:E,encodedNormals:A,minimumHeight:R.minimumHeight,maximumHeight:R.maximumHeight,boundingSphere:me.clone(R.boundingSphere),orientedBoundingBox:nn.clone(R.orientedBoundingBox),horizonOcclusionPoint:h.clone(R.horizonOcclusionPoint),westIndices:R.westIndices,southIndices:R.southIndices,eastIndices:R.eastIndices,northIndices:R.northIndices,westSkirtHeight:f,southSkirtHeight:y,eastSkirtHeight:_,northSkirtHeight:S,childTileMask:0,credits:Z,createdByUpsampling:!0})})};var Yse=32767,WXe=new h;XT.prototype.interpolateHeight=function(e,t,n){let i=W.clamp((t-e.west)/e.width,0,1);i*=Yse;let o=W.clamp((n-e.south)/e.height,0,1);return o*=Yse,l(this._mesh)?wkt(this,i,o):kkt(this,i,o)};function vXe(e,t,n,i,o,r,s,a){let c=Math.min(n,o,s),d=Math.max(n,o,s),u=Math.min(i,r,a),m=Math.max(i,r,a);return e>=c&&e<=d&&t>=u&&t<=m}var Nkt=new k,Ykt=new k,Mkt=new k;function wkt(e,t,n){let i=e._mesh,o=i.vertices,r=i.encoding,s=i.indices;for(let a=0,c=s.length;a<c;a+=3){let d=s[a],u=s[a+1],m=s[a+2],p=r.decodeTextureCoordinates(o,d,Nkt),b=r.decodeTextureCoordinates(o,u,Ykt),f=r.decodeTextureCoordinates(o,m,Mkt);if(vXe(t,n,p.x,p.y,b.x,b.y,f.x,f.y)){let y=sp.computeBarycentricCoordinates(t,n,p.x,p.y,b.x,b.y,f.x,f.y,WXe);if(y.x>=-1e-15&&y.y>=-1e-15&&y.z>=-1e-15){let _=r.decodeHeight(o,d),S=r.decodeHeight(o,u),Z=r.decodeHeight(o,m);return y.x*_+y.y*S+y.z*Z}}}}function kkt(e,t,n){let i=e._uValues,o=e._vValues,r=e._heightValues,s=e._indices;for(let a=0,c=s.length;a<c;a+=3){let d=s[a],u=s[a+1],m=s[a+2],p=i[d],b=i[u],f=i[m],y=o[d],_=o[u],S=o[m];if(vXe(t,n,p,y,b,_,f,S)){let Z=sp.computeBarycentricCoordinates(t,n,p,y,b,_,f,S,WXe);if(Z.x>=-1e-15&&Z.y>=-1e-15&&Z.z>=-1e-15){let R=Z.x*r[d]+Z.y*r[u]+Z.z*r[m];return W.lerp(e._minimumHeight,e._maximumHeight,R/Yse)}}}}XT.prototype.isChildAvailable=function(e,t,n,i){let o=2;return n!==e*2&&++o,i!==t*2&&(o-=2),(this._childTileMask&1<<o)!==0};XT.prototype.wasCreatedByUpsampling=function(){return this._createdByUpsampling};var GR=XT;function Ukt(e){this.resource=e.resource,this.version=e.version,this.isHeightmap=e.isHeightmap,this.tileUrlTemplates=e.tileUrlTemplates,this.availability=e.availability,this.hasVertexNormals=e.hasVertexNormals,this.hasWaterMask=e.hasWaterMask,this.hasMetadata=e.hasMetadata,this.availabilityLevels=e.availabilityLevels,this.availabilityTilesLoaded=e.availabilityTilesLoaded,this.littleEndianExtensionSize=e.littleEndianExtensionSize,this.availabilityPromiseCache={}}function IXe(e){this.requestVertexNormals=e.requestVertexNormals??!1,this.requestWaterMask=e.requestWaterMask??!1,this.requestMetadata=e.requestMetadata??!0,this.ellipsoid=e.ellipsoid??ne.default,this.heightmapWidth=65,this.heightmapStructure=void 0,this.hasWaterMask=!1,this.hasMetadata=!1,this.hasVertexNormals=!1,this.scheme=void 0,this.lastResource=void 0,this.layerJsonResource=void 0,this.previousError=void 0,this.availability=void 0,this.tilingScheme=void 0,this.levelZeroMaximumGeometricError=void 0,this.heightmapStructure=void 0,this.layers=[],this.attribution="",this.overallAvailability=[],this.overallMaxZoom=0,this.tileCredits=[]}IXe.prototype.build=function(e){e._heightmapWidth=this.heightmapWidth,e._scheme=this.scheme;let t=l(this.lastResource.credits)?this.lastResource.credits:[];e._tileCredits=t.concat(this.tileCredits),e._availability=this.availability,e._tilingScheme=this.tilingScheme,e._requestWaterMask=this.requestWaterMask,e._levelZeroMaximumGeometricError=this.levelZeroMaximumGeometricError,e._heightmapStructure=this.heightmapStructure,e._layers=this.layers,e._hasWaterMask=this.hasWaterMask,e._hasVertexNormals=this.hasVertexNormals,e._hasMetadata=this.hasMetadata};async function PXe(e,t,n){if(!t.format){let y="The tile format is not specified in the layer.json file.";throw e.previousError=tr.reportError(e.previousError,n,l(n)?n._errorEvent:void 0,y),new ae(y)}if(!t.tiles||t.tiles.length===0){let y="The layer.json file does not specify any tile URL templates.";throw e.previousError=tr.reportError(e.previousError,n,l(n)?n._errorEvent:void 0,y),new ae(y)}let i=!1,o=!1,r=!1,s=!0,a=!1;if(t.format==="heightmap-1.0")a=!0,l(e.heightmapStructure)||(e.heightmapStructure={heightScale:1/5,heightOffset:-1e3,elementsPerHeight:1,stride:1,elementMultiplier:256,isBigEndian:!1,lowestEncodedHeight:0,highestEncodedHeight:256*256-1}),o=!0,e.requestWaterMask=!0;else if(t.format.indexOf("quantized-mesh-1.")!==0){let y=`The tile format "${t.format}" is invalid or not supported.`;throw e.previousError=tr.reportError(e.previousError,n,l(n)?n._errorEvent:void 0,y),new ae(y)}let c=t.tiles,d=t.maxzoom;if(e.overallMaxZoom=Math.max(e.overallMaxZoom,d),!t.projection||t.projection==="EPSG:4326")e.tilingScheme=new eo({numberOfLevelZeroTilesX:2,numberOfLevelZeroTilesY:1,ellipsoid:e.ellipsoid});else if(t.projection==="EPSG:3857")e.tilingScheme=new Nr({numberOfLevelZeroTilesX:1,numberOfLevelZeroTilesY:1,ellipsoid:e.ellipsoid});else{let y=`The projection "${t.projection}" is invalid or not supported.`;throw e.previousError=tr.reportError(e.previousError,n,l(n)?n._errorEvent:void 0,y),new ae(y)}if(e.levelZeroMaximumGeometricError=Qo.getEstimatedLevelZeroGeometricErrorForAHeightmap(e.tilingScheme.ellipsoid,e.heightmapWidth,e.tilingScheme.getNumberOfXTilesAtLevel(0)),!t.scheme||t.scheme==="tms"||t.scheme==="slippyMap")e.scheme=t.scheme;else{let y=`The scheme "${t.scheme}" is invalid or not supported.`;throw e.previousError=tr.reportError(e.previousError,n,l(n)?n._errorEvent:void 0,y),new ae(y)}let u;l(t.extensions)&&t.extensions.indexOf("octvertexnormals")!==-1?i=!0:l(t.extensions)&&t.extensions.indexOf("vertexnormals")!==-1&&(i=!0,s=!1),l(t.extensions)&&t.extensions.indexOf("watermask")!==-1&&(o=!0),l(t.extensions)&&t.extensions.indexOf("metadata")!==-1&&(r=!0);let m=t.metadataAvailability,p=t.available,b;if(l(p)&&!l(m)){b=new rp(e.tilingScheme,p.length);for(let y=0;y<p.length;++y){let _=p[y],S=e.tilingScheme.getNumberOfYTilesAtLevel(y);l(e.overallAvailability[y])||(e.overallAvailability[y]=[]);for(let Z=0;Z<_.length;++Z){let R=_[Z],C=S-R.endY-1,E=S-R.startY-1;e.overallAvailability[y].push([R.startX,C,R.endX,E]),b.addAvailableTileRange(y,R.startX,C,R.endX,E)}}}else l(m)&&(u=new rp(e.tilingScheme,d),b=new rp(e.tilingScheme,d),e.overallAvailability[0]=[[0,0,1,0]],b.addAvailableTileRange(0,0,0,1,0));e.hasWaterMask=e.hasWaterMask||o,e.hasVertexNormals=e.hasVertexNormals||i,e.hasMetadata=e.hasMetadata||r,l(t.attribution)&&(e.attribution.length>0&&(e.attribution+=" "),e.attribution+=t.attribution),e.layers.push(new Ukt({resource:e.lastResource,version:t.version,isHeightmap:a,tileUrlTemplates:c,availability:b,hasVertexNormals:i,hasWaterMask:o,hasMetadata:r,availabilityLevels:m,availabilityTilesLoaded:u,littleEndianExtensionSize:s}));let f=t.parentUrl;return l(f)?l(b)?(e.lastResource=e.lastResource.getDerivedResource({url:f}),e.lastResource.appendForwardSlash(),e.layerJsonResource=e.lastResource.getDerivedResource({url:"layer.json"}),await kse(e),!0):(console.log("A layer.json can't have a parentUrl if it does't have an available array."),!0):!0}function Dkt(e,t,n){let i=`An error occurred while accessing ${e.layerJsonResource.url}.`;if(l(t)&&(i+=` +${t.message}`),e.previousError=tr.reportError(e.previousError,n,l(n)?n._errorEvent:void 0,i),e.previousError.retry)return kse(e,n);throw new ae(i)}async function Okt(e,t,n){await PXe(e,t,n);let i=e.overallAvailability.length;if(i>0){let o=e.availability=new rp(e.tilingScheme,e.overallMaxZoom);for(let r=0;r<i;++r){let s=e.overallAvailability[r];for(let a=0;a<s.length;++a){let c=s[a];o.addAvailableTileRange(r,c[0],c[1],c[2],c[3])}}}if(e.attribution.length>0){let o=new Lt(e.attribution);e.tileCredits.push(o)}return!0}async function kse(e,t){try{let n=await e.layerJsonResource.fetchJson();return Okt(e,n,t)}catch(n){return l(n)&&n.statusCode===404?(await PXe(e,{tilejson:"2.1.0",format:"heightmap-1.0",version:"1.0.0",scheme:"tms",tiles:["{z}/{x}/{y}.terrain?v={version}"]},t),!0):Dkt(e,n,t)}}function ap(e){e=e??B.EMPTY_OBJECT,this._heightmapWidth=void 0,this._heightmapStructure=void 0,this._hasWaterMask=!1,this._hasVertexNormals=!1,this._hasMetadata=!1,this._scheme=void 0,this._ellipsoid=e.ellipsoid,this._requestVertexNormals=e.requestVertexNormals??!1,this._requestWaterMask=e.requestWaterMask??!1,this._requestMetadata=e.requestMetadata??!0,this._errorEvent=new Se;let t=e.credit;typeof t=="string"&&(t=new Lt(t)),this._credit=t,this._availability=void 0,this._tilingScheme=void 0,this._levelZeroMaximumGeometricError=void 0,this._layers=void 0,this._tileCredits=void 0}var Mse={OCT_VERTEX_NORMALS:1,WATER_MASK:2,METADATA:4};function FXe(e){return!l(e)||e.length===0?{Accept:"application/vnd.quantized-mesh,application/octet-stream;q=0.9,*/*;q=0.01"}:{Accept:`application/vnd.quantized-mesh;extensions=${e.join("-")},application/octet-stream;q=0.9,*/*;q=0.01`}}function Bkt(e,t,n,i,o){let r=new Uint16Array(t,0,e._heightmapWidth*e._heightmapWidth);return new Yc({buffer:r,childTileMask:new Uint8Array(t,r.byteLength,1)[0],waterMask:new Uint8Array(t,r.byteLength+1,t.byteLength-r.byteLength-1),width:e._heightmapWidth,height:e._heightmapWidth,structure:e._heightmapStructure,credits:e._tileCredits})}function zkt(e,t,n,i,o,r){let s=r.littleEndianExtensionSize,a=0,c=3,d=c+1,u=Float64Array.BYTES_PER_ELEMENT*c,m=Float64Array.BYTES_PER_ELEMENT*d,b=Uint16Array.BYTES_PER_ELEMENT*3,f=3,y=Uint16Array.BYTES_PER_ELEMENT,_=y*f,S=new DataView(t),Z=new h(S.getFloat64(a,!0),S.getFloat64(a+8,!0),S.getFloat64(a+16,!0));a+=u;let R=S.getFloat32(a,!0);a+=Float32Array.BYTES_PER_ELEMENT;let C=S.getFloat32(a,!0);a+=Float32Array.BYTES_PER_ELEMENT;let E=new me(new h(S.getFloat64(a,!0),S.getFloat64(a+8,!0),S.getFloat64(a+16,!0)),S.getFloat64(a+u,!0));a+=m;let A=new h(S.getFloat64(a,!0),S.getFloat64(a+8,!0),S.getFloat64(a+16,!0));a+=u;let L=S.getUint32(a,!0);a+=Uint32Array.BYTES_PER_ELEMENT;let F=new Uint16Array(t,a,L*3);a+=L*b,L>64*1024&&(y=Uint32Array.BYTES_PER_ELEMENT,_=y*f);let I=F.subarray(0,L),N=F.subarray(L,2*L),g=F.subarray(L*2,3*L);dn.zigZagDeltaDecode(I,N,g),a%y!==0&&(a+=y-a%y);let V=S.getUint32(a,!0);a+=Uint32Array.BYTES_PER_ELEMENT;let G=Oe.createTypedArrayFromArrayBuffer(L,t,a,V*f);a+=V*_;let v=0,X=G.length;for(let he=0;he<X;++he){let Ze=G[he];G[he]=v-Ze,Ze===0&&++v}let Y=S.getUint32(a,!0);a+=Uint32Array.BYTES_PER_ELEMENT;let D=Oe.createTypedArrayFromArrayBuffer(L,t,a,Y);a+=Y*y;let M=S.getUint32(a,!0);a+=Uint32Array.BYTES_PER_ELEMENT;let O=Oe.createTypedArrayFromArrayBuffer(L,t,a,M);a+=M*y;let w=S.getUint32(a,!0);a+=Uint32Array.BYTES_PER_ELEMENT;let z=Oe.createTypedArrayFromArrayBuffer(L,t,a,w);a+=w*y;let K=S.getUint32(a,!0);a+=Uint32Array.BYTES_PER_ELEMENT;let te=Oe.createTypedArrayFromArrayBuffer(L,t,a,K);a+=K*y;let H,$;for(;a<S.byteLength;){let he=S.getUint8(a,!0);a+=Uint8Array.BYTES_PER_ELEMENT;let Ze=S.getUint32(a,s);if(a+=Uint32Array.BYTES_PER_ELEMENT,he===Mse.OCT_VERTEX_NORMALS&&e._requestVertexNormals)H=new Uint8Array(t,a,L*2);else if(he===Mse.WATER_MASK&&e._requestWaterMask)$=new Uint8Array(t,a,Ze);else if(he===Mse.METADATA&&e._requestMetadata){let ye=S.getUint32(a,!0);if(ye>0){let Ae=Pr(new Uint8Array(t),a+Uint32Array.BYTES_PER_ELEMENT,ye).available;if(l(Ae))for(let Fe=0;Fe<Ae.length;++Fe){let tt=n+Fe+1,Be=Ae[Fe],je=e._tilingScheme.getNumberOfYTilesAtLevel(tt);for(let qe=0;qe<Be.length;++qe){let We=Be[qe],Ke=je-We.endY-1,ct=je-We.startY-1;e.availability.addAvailableTileRange(tt,We.startX,Ke,We.endX,ct),r.availability.addAvailableTileRange(tt,We.startX,Ke,We.endX,ct)}}}r.availabilityTilesLoaded.addAvailableTileRange(n,i,o,i,o)}a+=Ze}let ee=e.getLevelMaximumGeometricError(n)*5,le=e._tilingScheme.tileXYToRectangle(i,o,n),_e=nn.fromRectangle(le,R,C,e._tilingScheme.ellipsoid);return new GR({center:Z,minimumHeight:R,maximumHeight:C,boundingSphere:E,orientedBoundingBox:_e,horizonOcclusionPoint:A,quantizedVertices:F,encodedNormals:H,indices:G,westIndices:D,southIndices:O,eastIndices:z,northIndices:te,westSkirtHeight:ee,southSkirtHeight:ee,eastSkirtHeight:ee,northSkirtHeight:ee,childTileMask:e.availability.computeChildMaskForTile(n,i,o),waterMask:$,credits:e._tileCredits})}ap.prototype.requestTileGeometry=function(e,t,n,i){let o=this._layers,r,s=o.length,a=!1,c=Promise.resolve();if(s===1)r=o[0];else for(let d=0;d<s;++d){let u=o[d];if(!l(u.availability)||u.availability.isTileAvailable(n,e,t)){r=u;break}let m=Use(this,e,t,n,u,d===0);m.result&&(a=!0,c=c.then(()=>m.promise))}return!l(r)&&a?c.then(()=>new Promise(d=>{setTimeout(()=>{let u=this.requestTileGeometry(e,t,n,i);d(u)},0)})):XXe(this,e,t,n,r,i)};function XXe(e,t,n,i,o,r){if(!l(o))return Promise.reject(new ae("Terrain tile doesn't exist"));let s=o.tileUrlTemplates;if(s.length===0)return;let a;!e._scheme||e._scheme==="tms"?a=e._tilingScheme.getNumberOfYTilesAtLevel(i)-n-1:a=n;let c=[];e._requestVertexNormals&&o.hasVertexNormals&&c.push(o.littleEndianExtensionSize?"octvertexnormals":"vertexnormals"),e._requestWaterMask&&o.hasWaterMask&&c.push("watermask"),e._requestMetadata&&o.hasMetadata&&c.push("metadata");let d,u,m=s[(t+a+i)%s.length],p=o.resource;l(p._ionEndpoint)&&!l(p._ionEndpoint.externalType)?(c.length!==0&&(u={extensions:c.join("-")}),d=FXe(void 0)):d=FXe(c);let b=p.getDerivedResource({url:m,templateValues:{version:o.version,z:i,x:t,y:a},queryParameters:u,headers:d,request:r}).fetchArrayBuffer();if(l(b))return b.then(function(f){return l(f)?l(e._heightmapStructure)?Bkt(e,f,i,t,n):zkt(e,f,i,t,n,o):Promise.reject(new ae("Mesh buffer doesn't exist."))})}Object.defineProperties(ap.prototype,{errorEvent:{get:function(){return this._errorEvent}},credit:{get:function(){return this._credit}},tilingScheme:{get:function(){return this._tilingScheme}},hasWaterMask:{get:function(){return this._hasWaterMask&&this._requestWaterMask}},hasVertexNormals:{get:function(){return this._hasVertexNormals&&this._requestVertexNormals}},hasMetadata:{get:function(){return this._hasMetadata&&this._requestMetadata}},requestVertexNormals:{get:function(){return this._requestVertexNormals}},requestWaterMask:{get:function(){return this._requestWaterMask}},requestMetadata:{get:function(){return this._requestMetadata}},availability:{get:function(){return this._availability}}});ap.prototype.getLevelMaximumGeometricError=function(e){return this._levelZeroMaximumGeometricError/(1<<e)};ap.fromIonAssetId=async function(e,t){let n=await zr.fromAssetId(e);return ap.fromUrl(n,t)};ap.fromUrl=async function(e,t){t=t??B.EMPTY_OBJECT,e=await Promise.resolve(e);let n=ve.createIfNeeded(e);n.appendForwardSlash();let i=new IXe(t);i.lastResource=n,i.layerJsonResource=i.lastResource.getDerivedResource({url:"layer.json"}),await kse(i);let o=new ap(t);return i.build(o),o};ap.prototype.getTileDataAvailable=function(e,t,n){if(!l(this._availability))return;if(n>this._availability._maximumLevel)return!1;if(this._availability.isTileAvailable(n,e,t))return!0;if(!this._hasMetadata)return!1;let i=this._layers,o=i.length;for(let r=0;r<o;++r)if(Use(this,e,t,n,i[r],r===0).result)return;return!1};ap.prototype.loadTileDataAvailability=function(e,t,n){if(!l(this._availability)||n>this._availability._maximumLevel||this._availability.isTileAvailable(n,e,t)||!this._hasMetadata)return;let i=this._layers,o=i.length;for(let r=0;r<o;++r){let s=Use(this,e,t,n,i[r],r===0);if(l(s.promise))return s.promise}};function wse(e,t,n,i){if(i===0)return;let o=e.availabilityLevels,r=i%o===0?i-o:(i/o|0)*o,s=1<<i-r,a=t/s|0,c=n/s|0;return{level:r,x:a,y:c}}function Use(e,t,n,i,o,r){if(!l(o.availabilityLevels))return{result:!1};let s,a=function(){delete o.availabilityPromiseCache[s]},c=o.availabilityTilesLoaded,d=o.availability,u=wse(o,t,n,i);for(;l(u);){if(d.isTileAvailable(u.level,u.x,u.y)&&!c.isTileAvailable(u.level,u.x,u.y)){let m;if(!r&&(s=`${u.level}-${u.x}-${u.y}`,m=o.availabilityPromiseCache[s],!l(m))){let p=new Ar({throttle:!1,throttleByServer:!0,type:js.TERRAIN});m=XXe(e,u.x,u.y,u.level,o,p),l(m)&&(o.availabilityPromiseCache[s]=m,m.then(a))}return{result:!0,promise:m}}u=wse(o,u.x,u.y,u.level)}return{result:!1}}ap._getAvailabilityTile=wse;var LR=ap;var zvo=x(T(),1);function my(e){e=e??B.EMPTY_OBJECT;let t=e.radius,n={center:e.center,semiMajorAxis:t,semiMinorAxis:t,ellipsoid:e.ellipsoid,height:e.height,extrudedHeight:e.extrudedHeight,granularity:e.granularity,vertexFormat:e.vertexFormat,stRotation:e.stRotation,shadowVolume:e.shadowVolume};this._ellipseGeometry=new $l(n),this._workerName="createCircleGeometry"}my.packedLength=$l.packedLength;my.pack=function(e,t,n){return $l.pack(e._ellipseGeometry,t,n)};var NXe=new $l({center:new h,semiMajorAxis:1,semiMinorAxis:1}),Uc={center:new h,radius:void 0,ellipsoid:ne.clone(ne.default),height:void 0,extrudedHeight:void 0,granularity:void 0,vertexFormat:new Me,stRotation:void 0,semiMajorAxis:void 0,semiMinorAxis:void 0,shadowVolume:void 0};my.unpack=function(e,t,n){let i=$l.unpack(e,t,NXe);return Uc.center=h.clone(i._center,Uc.center),Uc.ellipsoid=ne.clone(i._ellipsoid,Uc.ellipsoid),Uc.ellipsoid=ne.clone(i._ellipsoid,NXe._ellipsoid),Uc.height=i._height,Uc.extrudedHeight=i._extrudedHeight,Uc.granularity=i._granularity,Uc.vertexFormat=Me.clone(i._vertexFormat,Uc.vertexFormat),Uc.stRotation=i._stRotation,Uc.shadowVolume=i._shadowVolume,l(n)?(Uc.semiMajorAxis=i._semiMajorAxis,Uc.semiMinorAxis=i._semiMinorAxis,n._ellipseGeometry=new $l(Uc),n):(Uc.radius=i._semiMajorAxis,new my(Uc))};my.createGeometry=function(e){return $l.createGeometry(e._ellipseGeometry)};my.createShadowVolume=function(e,t,n){let i=e._ellipseGeometry._granularity,o=e._ellipseGeometry._ellipsoid,r=t(i,o),s=n(i,o);return new my({center:e._ellipseGeometry._center,radius:e._ellipseGeometry._semiMajorAxis,ellipsoid:o,stRotation:e._ellipseGeometry._stRotation,granularity:i,extrudedHeight:r,height:s,vertexFormat:Me.POSITION_ONLY,shadowVolume:!0})};Object.defineProperties(my.prototype,{rectangle:{get:function(){return this._ellipseGeometry.rectangle}},textureCoordinateRotationPoints:{get:function(){return this._ellipseGeometry.textureCoordinateRotationPoints}}});var Dse=my;var $vo=x(T(),1);function RA(e){e=e??B.EMPTY_OBJECT;let t=e.radius,n={center:e.center,semiMajorAxis:t,semiMinorAxis:t,ellipsoid:e.ellipsoid,height:e.height,extrudedHeight:e.extrudedHeight,granularity:e.granularity,numberOfVerticalLines:e.numberOfVerticalLines};this._ellipseGeometry=new Lu(n),this._workerName="createCircleOutlineGeometry"}RA.packedLength=Lu.packedLength;RA.pack=function(e,t,n){return Lu.pack(e._ellipseGeometry,t,n)};var Hkt=new Lu({center:new h,semiMajorAxis:1,semiMinorAxis:1}),um={center:new h,radius:void 0,ellipsoid:ne.clone(ne.UNIT_SPHERE),height:void 0,extrudedHeight:void 0,granularity:void 0,numberOfVerticalLines:void 0,semiMajorAxis:void 0,semiMinorAxis:void 0};RA.unpack=function(e,t,n){let i=Lu.unpack(e,t,Hkt);return um.center=h.clone(i._center,um.center),um.ellipsoid=ne.clone(i._ellipsoid,um.ellipsoid),um.height=i._height,um.extrudedHeight=i._extrudedHeight,um.granularity=i._granularity,um.numberOfVerticalLines=i._numberOfVerticalLines,l(n)?(um.semiMajorAxis=i._semiMajorAxis,um.semiMinorAxis=i._semiMinorAxis,n._ellipseGeometry=new Lu(um),n):(um.radius=i._semiMajorAxis,new RA(um))};RA.createGeometry=function(e){return Lu.createGeometry(e._ellipseGeometry)};var Ose=RA;var i2o=x(T(),1);function Kkt(e){return e=e??B.EMPTY_OBJECT,LR.fromIonAssetId(2426648,{requestVertexNormals:e.requestVertexNormals??!1})}var SU=Kkt;var c2o=x(T(),1);function Jkt(e){return e=e??B.EMPTY_OBJECT,LR.fromIonAssetId(1,{requestVertexNormals:e.requestVertexNormals??!1,requestWaterMask:e.requestWaterMask??!1,ellipsoid:ne.WGS84})}var WR=Jkt;var y2o=x(T(),1);function CA(e){e=e??B.EMPTY_OBJECT,this._callback=e.callback,this._tilingScheme=e.tilingScheme,l(this._tilingScheme)||(this._tilingScheme=new eo({ellipsoid:e.ellipsoid??ne.default})),this._width=e.width,this._height=e.height;let t=Math.max(this._width,this._height);this._levelZeroMaximumGeometricError=Qo.getEstimatedLevelZeroGeometricErrorForAHeightmap(this._tilingScheme.ellipsoid,t,this._tilingScheme.getNumberOfXTilesAtLevel(0)),this._errorEvent=new Se;let n=e.credit;typeof n=="string"&&(n=new Lt(n)),this._credit=n}Object.defineProperties(CA.prototype,{errorEvent:{get:function(){return this._errorEvent}},credit:{get:function(){return this._credit}},tilingScheme:{get:function(){return this._tilingScheme}},hasWaterMask:{get:function(){return!1}},hasVertexNormals:{get:function(){return!1}},availability:{get:function(){}},width:{get:function(){return this._width}},height:{get:function(){return this._height}}});CA.prototype.requestTileGeometry=function(e,t,n,i){let o=this._callback(e,t,n);if(!l(o))return;let r=this._width,s=this._height;return Promise.resolve(o).then(function(a){let c=a;return Array.isArray(c)&&(c=new Float64Array(c)),new Yc({buffer:c,width:r,height:s})})};CA.prototype.getLevelMaximumGeometricError=function(e){return this._levelZeroMaximumGeometricError/(1<<e)};CA.prototype.getTileDataAvailable=function(e,t,n){};CA.prototype.loadTileDataAvailability=function(e,t,n){};var Bse=CA;var _2o=x(T(),1);var jkt=1953029805,Qkt=2917034100;function zse(e,t){if(zse.passThroughDataForTesting)return t;let n=e.byteLength;if(n===0||n%4!==0)throw new ae("The length of key must be greater than 0 and a multiple of 4.");let i=new DataView(t),o=i.getUint32(0,!0);if(o===jkt||o===Qkt)return t;let r=new DataView(e),s=0,a=t.byteLength,c=a-a%8,d=n,u,m=8;for(;s<c;)for(m=(m+8)%24,u=m;s<c&&u<d;)i.setUint32(s,i.getUint32(s,!0)^r.getUint32(u,!0),!0),i.setUint32(s+4,i.getUint32(s+4,!0)^r.getUint32(u+4,!0),!0),s+=8,u+=24;if(s<a)for(u>=d&&(m=(m+8)%24,u=m);s<a;)i.setUint8(s,i.getUint8(s)^r.getUint8(u)),s++,u++}zse.passThroughDataForTesting=!1;var ZU=zse;var Z2o=x(T(),1);function YXe(e){this.proxy=e}YXe.prototype.getURL=function(e){let t=this.proxy.indexOf("?")===-1?"?":"";return this.proxy+t+encodeURIComponent(e)};var Hse=YXe;var A2o=x(T(),1);function sJ(){ge.throwInstantiationError()}Object.defineProperties(sJ.prototype,{credit:{get:ge.throwInstantiationError}});sJ.getCreditsFromResult=function(e){if(l(e.attributions))return e.attributions.map(Lt.getIonCredit)};sJ.prototype.geocode=ge.throwInstantiationError;var VA=sJ;var L2o=x(T(),1),MXe={SEARCH:0,AUTOCOMPLETE:1};Object.freeze(MXe);var NT=MXe;var F2o=x(T(),1);function wXe(){ge.throwInstantiationError()}wXe.createGeometry=function(e){ge.throwInstantiationError()};var Kse=wXe;var eFo=x(T(),1),iUt=x(Jse(),1);var k2o=x(T(),1);var N2o=x(T(),1);function qkt(e,t){return(e&t)!==0}var Vl=qkt;var $kt=[1,2,4,8],kXe=15,eUt=16,tUt=64,nUt=128;function O0(e,t,n,i,o,r){this._bits=e,this.cnodeVersion=t,this.imageryVersion=n,this.terrainVersion=i,this.imageryProvider=o,this.terrainProvider=r,this.ancestorHasTerrain=!1,this.terrainState=void 0}O0.clone=function(e,t){return l(t)?(t._bits=e._bits,t.cnodeVersion=e.cnodeVersion,t.imageryVersion=e.imageryVersion,t.terrainVersion=e.terrainVersion,t.imageryProvider=e.imageryProvider,t.terrainProvider=e.terrainProvider):t=new O0(e._bits,e.cnodeVersion,e.imageryVersion,e.terrainVersion,e.imageryProvider,e.terrainProvider),t.ancestorHasTerrain=e.ancestorHasTerrain,t.terrainState=e.terrainState,t};O0.prototype.setParent=function(e){this.ancestorHasTerrain=e.ancestorHasTerrain||this.hasTerrain()};O0.prototype.hasSubtree=function(){return Vl(this._bits,eUt)};O0.prototype.hasImagery=function(){return Vl(this._bits,tUt)};O0.prototype.hasTerrain=function(){return Vl(this._bits,nUt)};O0.prototype.hasChildren=function(){return Vl(this._bits,kXe)};O0.prototype.hasChild=function(e){return Vl(this._bits,$kt[e])};O0.prototype.getChildBitmask=function(){return this._bits&kXe};var CU=O0;function oUt(e){let t=e.length,n=new ArrayBuffer(t),i=new Uint8Array(n);for(let o=0;o<t;++o)i[o]=e.charCodeAt(o);return n}var rUt=oUt(`E\xF4\xBD\vy\xE2jE"\x92,\xCDq\xF8IFgQ\0B%\xC6\xE8a,f)\b\xC64\xDCjb%y +wmi\xD6\xF0\x9Ck\x93\xA1\xBDNu\xE0A[\xDF@V\f\xD9\xBBr\x9B\x81|3S\xEEOl\xD4q\xB0{\xC0\x7FEVZ\xADwUe\v3\x92*\xACl5\xC50s\xF83>mF8J\xB4\xDD\xF0.\xDDu\xDA\x8CDt"\xFAa"\f3"So\xAF9D\v\x8C9\xD99L\xB9\xBF\x7F\xAB\\\x8CP_\x9F"ux\xE9\x07q\x91h;\xC1\xC4\x9B\x7F\xF0<VqH\x82'UfYNe\x98u\xA3aF}a?A\0\x9F\xD7\xB44M\xCE\x87F\xB0\xD5\xB8\x8A'{\x8B\xDC+\xBBMg0\xC8\xD1\xF6\\\x8FP\xFA[/F\x9Bn5/'C.\xEB +\f^\xA5s\x1Be4\xE5l.jC'c#U\xA9?q{gC}:\xAF\xCD\xE2TU\x9C\xFDK\xC6\xE2\x9F/(\xED\xCB\\\xC6-f\x07\x88\xA7;/*"N\xB0k.\xDD\r\x95}}G\xBAC\xB2\xB2+>M\xAA>}\xE6\xCE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A\x8Bh\xBD\x88\xF7_H\xB1~\xC0XL?f\xF9>\xE1e\xC0p\xA7\xCF8i\xAF\xF0VldI\x9C'\xADxtO\xC2\x87\xDEV9\0\xDAw\v\xCB-\x1B\x89\xFB5O\xF5\bQ\`\xC1 +ZGM&30x\xDA\xC0\x9CFG\xE2[y\`In7gS +>\xE9\xECF9\xB2\xF14\r\xC6\x84Sun\xE1\fY\xD9\xDE)\x85{II\xA5wy\xBEIV.6\xE7\v:\xBBOb{\xD2M1\x95/\xBD8{\xA8O!\xE1\xECFpv\x95})"x\x88 +\x90\xDD\x9D\\\xDA\xDEQ\xCF\xF0\xFCYRe|3\xDF\xF3H\xDA\xBB*u\xDB\`\xB2\xD4\xFC\xED\x1B\xEC\x7F5\xA8\xFF(1\x07-\xC8\xDC\x88F|\x8A["`);function mm(e){this.imageryPresent=!0,this.protoImagery=void 0,this.terrainPresent=!0,this.negativeAltitudeExponentBias=32,this.negativeAltitudeThreshold=W.EPSILON12,this.providers={},this.key=void 0,this._resource=void 0,this._quadPacketVersion=1,this._tileInfo={},this._subtreePromises={}}Object.defineProperties(mm.prototype,{url:{get:function(){return this._resource.url}},proxy:{get:function(){return this._resource.proxy}},resource:{get:function(){return this._resource}}});mm.fromUrl=async function(e){let t=e;typeof t!="string"&&!(t instanceof ve)&&(t=e.url);let n=ve.createIfNeeded(t);n.appendForwardSlash();let i=new mm;i._resource=n;try{await sUt(i),await i.getQuadTreePacket("",i._quadPacketVersion)}catch(o){let r=`An error occurred while accessing ${DXe(i,"",1).url}: ${o}`;throw new ae(r)}return i};mm.tileXYToQuadKey=function(e,t,n){let i="";for(let o=n;o>=0;--o){let r=1<<o,s=0;Vl(t,r)?Vl(e,r)&&(s|=1):(s|=2,Vl(e,r)||(s|=1)),i+=s}return i};mm.quadKeyToTileXY=function(e){let t=0,n=0,i=e.length-1;for(let o=i;o>=0;--o){let r=1<<o,s=+e[i-o];Vl(s,2)?Vl(s,1)||(t|=r):(n|=r,Vl(s,1)&&(t|=r))}return{x:t,y:n,level:i}};mm.prototype.isValid=function(e){let t=this.getTileInformationFromQuadKey(e);if(l(t))return t!==null;let n=!0,i=e,o;for(;i.length>1;)if(o=i.substring(i.length-1),i=i.substring(0,i.length-1),t=this.getTileInformationFromQuadKey(i),l(t)){!t.hasSubtree()&&!t.hasChild(parseInt(o))&&(n=!1);break}else if(t===null){n=!1;break}return n};var UXe=new qn("decodeGoogleEarthEnterprisePacket");mm.prototype.getQuadTreePacket=function(e,t,n){t=t??1,e=e??"";let o=DXe(this,e,t,n).fetchArrayBuffer();if(!l(o))return;let r=this._tileInfo,s=this.key;return o.then(function(a){return UXe.scheduleTask({buffer:a,quadKey:e,type:"Metadata",key:s},[a]).then(function(d){let u,m=-1;if(e!==""){m=e.length+1;let f=d[e];u=r[e],u._bits|=f._bits,delete d[e]}let p=Object.keys(d);p.sort(function(f,y){return f.length-y.length});let b=p.length;for(let f=0;f<b;++f){let y=p[f];if(d[y]!==null){let S=CU.clone(d[y]),Z=y.length;if(Z===m)S.setParent(u);else if(Z>1){let R=r[y.substring(0,y.length-1)];S.setParent(R)}r[y]=S}else r[y]=null}})})};mm.prototype.populateSubtree=function(e,t,n,i){let o=mm.tileXYToQuadKey(e,t,n);return qse(this,o,i)};function qse(e,t,n){let i=e._tileInfo,o=t,r=i[o];if(l(r)&&(!r.hasSubtree()||r.hasChildren()))return r;for(;r===void 0&&o.length>1;)o=o.substring(0,o.length-1),r=i[o];let s,a=e._subtreePromises,c=a[o];if(l(c))return c.then(function(){return s=new Ar({throttle:n.throttle,throttleByServer:n.throttleByServer,type:n.type,priorityFunction:n.priorityFunction}),qse(e,t,s)});if(!l(r)||!r.hasSubtree())return Promise.reject(new ae(`Couldn't load metadata for tile ${t}`));if(c=e.getQuadTreePacket(o,r.cnodeVersion,n),!!l(c))return a[o]=c,c.then(function(){return s=new Ar({throttle:n.throttle,throttleByServer:n.throttleByServer,type:n.type,priorityFunction:n.priorityFunction}),qse(e,t,s)}).finally(function(){delete a[o]})}mm.prototype.getTileInformation=function(e,t,n){let i=mm.tileXYToQuadKey(e,t,n);return this._tileInfo[i]};mm.prototype.getTileInformationFromQuadKey=function(e){return this._tileInfo[e]};function DXe(e,t,n,i){return e._resource.getDerivedResource({url:`flatfile?q2-0${t}-q.${n.toString()}`,request:i})}var jse,Qse;function sUt(e){let t=e._resource.getDerivedResource({url:"dbRoot.v5",queryParameters:{output:"proto"}});if(!l(Qse)){let n=en("ThirdParty/google-earth-dbroot-parser.js"),i=window.cesiumGoogleEarthDbRootParser;Qse=$T(n).then(function(){jse=window.cesiumGoogleEarthDbRootParser(iUt),l(i)?window.cesiumGoogleEarthDbRootParser=i:delete window.cesiumGoogleEarthDbRootParser})}return Qse.then(function(){return t.fetchArrayBuffer()}).then(function(n){let i=jse.EncryptedDbRootProto.decode(new Uint8Array(n)),o=i.encryptionData,r=o.byteOffset,s=r+o.byteLength,a=e.key=o.buffer.slice(r,s);o=i.dbrootData,r=o.byteOffset,s=r+o.byteLength;let c=o.buffer.slice(r,s);return UXe.scheduleTask({buffer:c,type:"DbRoot",key:a},[c])}).then(function(n){let i=jse.DbRootProto.decode(new Uint8Array(n.buffer));if(e.imageryPresent=i.imageryPresent??e.imageryPresent,e.protoImagery=i.protoImagery,e.terrainPresent=i.terrainPresent??e.terrainPresent,l(i.endSnippet)&&l(i.endSnippet.model)){let a=i.endSnippet.model;e.negativeAltitudeExponentBias=a.negativeAltitudeExponentBias??e.negativeAltitudeExponentBias,e.negativeAltitudeThreshold=a.compressedNegativeAltitudeThreshold??e.negativeAltitudeThreshold}l(i.databaseVersion)&&(e._quadPacketVersion=i.databaseVersion.quadtreeVersion??e._quadPacketVersion);let o=e.providers,r=i.providerInfo??[],s=r.length;for(let a=0;a<s;++a){let c=r[a],d=c.copyrightString;l(d)&&(o[c.providerId]=new Lt(d.value))}}).catch(function(){console.log(`Failed to retrieve ${t.url}. Using defaults.`),e.key=rUt})}var hy=mm;var gFo=x(T(),1);function vR(e){e=e??B.EMPTY_OBJECT,this._buffer=e.buffer,this._credits=e.credits,this._negativeAltitudeExponentBias=e.negativeAltitudeExponentBias,this._negativeElevationThreshold=e.negativeElevationThreshold;let t=e.childTileMask??15,n=t&3;n|=t&4?8:0,n|=t&8?4:0,this._childTileMask=n,this._createdByUpsampling=e.createdByUpsampling??!1,this._skirtHeight=void 0,this._bufferType=this._buffer.constructor,this._mesh=void 0,this._minimumHeight=void 0,this._maximumHeight=void 0}Object.defineProperties(vR.prototype,{credits:{get:function(){return this._credits}},waterMask:{get:function(){}}});var zXe="createVerticesFromGoogleEarthEnterpriseBuffer",aUt=new qn(zXe),cUt=new qn(zXe,$d.maximumAsynchronousTasks),OXe=new re,aJ=new re;vR.prototype.createMesh=function(e){e=e??B.EMPTY_OBJECT;let t=e.tilingScheme,n=e.x,i=e.y,o=e.level,r=e.exaggeration??1,s=e.exaggerationRelativeHeight??0,a=e.throttle??!0,c=t.ellipsoid;t.tileXYToNativeRectangle(n,i,o,OXe),t.tileXYToRectangle(n,i,o,aJ);let d=c.cartographicToCartesian(re.center(aJ)),m=40075.16/(1<<o);this._skirtHeight=Math.min(m*8,1e3);let b=(a?cUt:aUt).scheduleTask({buffer:this._buffer,nativeRectangle:OXe,rectangle:aJ,relativeToCenter:d,ellipsoid:c,skirtHeight:this._skirtHeight,exaggeration:r,exaggerationRelativeHeight:s,includeWebMercatorT:!0,negativeAltitudeExponentBias:this._negativeAltitudeExponentBias,negativeElevationThreshold:this._negativeElevationThreshold});if(!l(b))return;let f=this;return b.then(function(y){return f._mesh=new gc(d,new Float32Array(y.vertices),new Uint16Array(y.indices),y.indexCountWithoutSkirts,y.vertexCountWithoutSkirts,y.minimumHeight,y.maximumHeight,aJ,me.clone(y.boundingSphere3D),h.clone(y.occludeePointInScaledSpace),y.numberOfAttributes,nn.clone(y.orientedBoundingBox),Rr.clone(y.encoding),y.westIndicesSouthToNorth,y.southIndicesEastToWest,y.eastIndicesNorthToSouth,y.northIndicesWestToEast),f._minimumHeight=y.minimumHeight,f._maximumHeight=y.maximumHeight,f._buffer=void 0,f._mesh})};vR.prototype.interpolateHeight=function(e,t,n){let i=W.clamp((t-e.west)/e.width,0,1),o=W.clamp((n-e.south)/e.height,0,1);return l(this._mesh)?hUt(this,i,o):bUt(this,i,o,e)};var lUt=new qn("upsampleQuantizedTerrainMesh",$d.maximumAsynchronousTasks);vR.prototype.upsample=function(e,t,n,i,o,r,s){let a=this._mesh;if(!l(this._mesh))return;let c=t*2!==o,d=n*2===r,u=e.ellipsoid,m=e.tileXYToRectangle(o,r,s),p=lUt.scheduleTask({vertices:a.vertices,indices:a.indices,indexCountWithoutSkirts:a.indexCountWithoutSkirts,vertexCountWithoutSkirts:a.vertexCountWithoutSkirts,encoding:a.encoding,minimumHeight:this._minimumHeight,maximumHeight:this._maximumHeight,isEastChild:c,isNorthChild:d,childRectangle:m,ellipsoid:u});if(!l(p))return;let b=this;return p.then(function(f){let y=new Uint16Array(f.vertices),_=Oe.createTypedArray(y.length/3,f.indices),S=b._skirtHeight;return new GR({quantizedVertices:y,indices:_,minimumHeight:f.minimumHeight,maximumHeight:f.maximumHeight,boundingSphere:me.clone(f.boundingSphere),orientedBoundingBox:nn.clone(f.orientedBoundingBox),horizonOcclusionPoint:h.clone(f.horizonOcclusionPoint),westIndices:f.westIndices,southIndices:f.southIndices,eastIndices:f.eastIndices,northIndices:f.northIndices,westSkirtHeight:S,southSkirtHeight:S,eastSkirtHeight:S,northSkirtHeight:S,childTileMask:0,createdByUpsampling:!0,credits:b._credits})})};vR.prototype.isChildAvailable=function(e,t,n,i){let o=2;return n!==e*2&&++o,i!==t*2&&(o-=2),(this._childTileMask&1<<o)!==0};vR.prototype.wasCreatedByUpsampling=function(){return this._createdByUpsampling};var dUt=new k,uUt=new k,mUt=new k,HXe=new h;function hUt(e,t,n){let i=e._mesh,o=i.vertices,r=i.encoding,s=i.indices;for(let a=0,c=s.length;a<c;a+=3){let d=s[a],u=s[a+1],m=s[a+2],p=r.decodeTextureCoordinates(o,d,dUt),b=r.decodeTextureCoordinates(o,u,uUt),f=r.decodeTextureCoordinates(o,m,mUt),y=sp.computeBarycentricCoordinates(t,n,p.x,p.y,b.x,b.y,f.x,f.y,HXe);if(y.x>=-1e-15&&y.y>=-1e-15&&y.z>=-1e-15){let _=r.decodeHeight(o,d),S=r.decodeHeight(o,u),Z=r.decodeHeight(o,m);return y.x*_+y.y*S+y.z*Z}}}var fUt=Uint16Array.BYTES_PER_ELEMENT,BXe=Uint32Array.BYTES_PER_ELEMENT,$se=Int32Array.BYTES_PER_ELEMENT,pUt=Float32Array.BYTES_PER_ELEMENT,eae=Float64Array.BYTES_PER_ELEMENT;function bUt(e,t,n,i){let o=e._buffer,r=0,s=0,a=0;n>.5?(t>.5?(r=2,s=.5):r=3,a=.5):t>.5&&(r=1,s=.5);let c=new DataView(o),d=0;for(let E=0;E<r;++E)d+=c.getUint32(d,!0),d+=BXe;d+=BXe,d+=2*eae;let u=W.toRadians(c.getFloat64(d,!0)*180);d+=eae;let m=W.toRadians(c.getFloat64(d,!0)*180);d+=eae;let p=i.width/u/2,b=i.height/m/2,f=c.getInt32(d,!0);d+=$se;let y=c.getInt32(d,!0)*3;d+=$se,d+=$se;let _=new Array(f),S=new Array(f),Z=new Array(f),R;for(R=0;R<f;++R)_[R]=s+c.getUint8(d++)*p,S[R]=a+c.getUint8(d++)*b,Z[R]=c.getFloat32(d,!0)*6371010,d+=pUt;let C=new Array(y);for(R=0;R<y;++R)C[R]=c.getUint16(d,!0),d+=fUt;for(R=0;R<y;R+=3){let E=C[R],A=C[R+1],L=C[R+2],F=_[E],I=_[A],N=_[L],g=S[E],V=S[A],G=S[L],v=sp.computeBarycentricCoordinates(t,n,F,g,I,V,N,G,HXe);if(v.x>=-1e-15&&v.y>=-1e-15&&v.z>=-1e-15)return v.x*Z[E]+v.y*Z[A]+v.z*Z[L]}}var EA=vR;var PFo=x(T(),1);var Eh={UNKNOWN:0,NONE:1,SELF:2,PARENT:3},cJ=new Q;function lJ(){this._terrainCache={},this._lastTidy=Q.now()}lJ.prototype.add=function(e,t){this._terrainCache[e]={buffer:t,timestamp:Q.now()}};lJ.prototype.get=function(e){let n=this._terrainCache[e];if(l(n))return delete this._terrainCache[e],n.buffer};lJ.prototype.tidy=function(){if(Q.now(cJ),Q.secondsDifference(cJ,this._lastTidy)>10){let e=this._terrainCache,t=Object.keys(e),n=t.length;for(let i=0;i<n;++i){let o=t[i],r=e[o];Q.secondsDifference(cJ,r.timestamp)>10&&delete e[o]}Q.clone(cJ,this._lastTidy)}};function YT(e){e=e??B.EMPTY_OBJECT,this._tilingScheme=new eo({numberOfLevelZeroTilesX:2,numberOfLevelZeroTilesY:2,rectangle:new re(-W.PI,-W.PI,W.PI,W.PI),ellipsoid:e.ellipsoid});let t=e.credit;typeof t=="string"&&(t=new Lt(t)),this._credit=t,this._levelZeroMaximumGeometricError=40075.16,this._terrainCache=new lJ,this._terrainPromises={},this._terrainRequests={},this._errorEvent=new Se}Object.defineProperties(YT.prototype,{url:{get:function(){return this._metadata.url}},proxy:{get:function(){return this._metadata.proxy}},tilingScheme:{get:function(){return this._tilingScheme}},errorEvent:{get:function(){return this._errorEvent}},credit:{get:function(){return this._credit}},hasWaterMask:{get:function(){return!1}},hasVertexNormals:{get:function(){return!1}},availability:{get:function(){}}});YT.fromMetadata=function(e,t){if(!e.terrainPresent)throw new ae(`The server ${e.url} doesn't have terrain`);let n=new YT(t);return n._metadata=e,n};var gUt=new qn("decodeGoogleEarthEnterprisePacket");function KXe(e,t,n){let i=t.getChildBitmask();if(t.terrainState===Eh.PARENT){i=0;for(let o=0;o<4;++o){let r=n.getTileInformationFromQuadKey(e+o.toString());l(r)&&r.hasTerrain()&&(i|=1<<o)}}return i}YT.prototype.requestTileGeometry=function(e,t,n,i){let o=hy.tileXYToQuadKey(e,t,n),r=this._terrainCache,s=this._metadata,a=s.getTileInformationFromQuadKey(o);if(!l(a))return Promise.reject(new ae("Terrain tile doesn't exist"));let c=a.terrainState;l(c)||(c=a.terrainState=Eh.UNKNOWN);let d=r.get(o);if(l(d)){let S=s.providers[a.terrainProvider];return Promise.resolve(new EA({buffer:d,childTileMask:KXe(o,a,s),credits:l(S)?[S]:void 0,negativeAltitudeExponentBias:s.negativeAltitudeExponentBias,negativeElevationThreshold:s.negativeAltitudeThreshold}))}if(r.tidy(),a.ancestorHasTerrain){if(c===Eh.NONE)return Promise.reject(new ae("Terrain tile doesn't exist"))}else return Promise.resolve(new Yc({buffer:new Uint8Array(256),width:16,height:16}));let u,m=o,p=-1;switch(c){case Eh.SELF:p=a.terrainVersion;break;case Eh.PARENT:m=m.substring(0,m.length-1),u=s.getTileInformationFromQuadKey(m),p=u.terrainVersion;break;case Eh.UNKNOWN:a.hasTerrain()?p=a.terrainVersion:(m=m.substring(0,m.length-1),u=s.getTileInformationFromQuadKey(m),l(u)&&u.hasTerrain()&&(p=u.terrainVersion));break}if(p<0)return Promise.reject(new ae("Terrain tile doesn't exist"));let b=this._terrainPromises,f=this._terrainRequests,y,_;if(l(b[m]))y=b[m],_=f[m];else{_=i;let S=yUt(this,m,p,_).fetchArrayBuffer();if(!l(S))return;y=S.then(function(Z){return l(Z)?gUt.scheduleTask({buffer:Z,type:"Terrain",key:s.key},[Z]).then(function(R){let C=s.getTileInformationFromQuadKey(m);C.terrainState=Eh.SELF,r.add(m,R[0]);let E=C.terrainProvider,A=R.length-1;for(let L=0;L<A;++L){let F=m+L.toString(),I=s.getTileInformationFromQuadKey(F);l(I)&&(r.add(F,R[L+1]),I.terrainState=Eh.PARENT,I.terrainProvider===0&&(I.terrainProvider=E))}}):Promise.reject(new ae("Failed to load terrain."))}),b[m]=y,f[m]=_,y=y.finally(function(){delete b[m],delete f[m]})}return y.then(function(){let S=r.get(o);if(l(S)){let Z=s.providers[a.terrainProvider];return new EA({buffer:S,childTileMask:KXe(o,a,s),credits:l(Z)?[Z]:void 0,negativeAltitudeExponentBias:s.negativeAltitudeExponentBias,negativeElevationThreshold:s.negativeAltitudeThreshold})}return Promise.reject(new ae("Failed to load terrain."))}).catch(function(S){return _.state===Ri.CANCELLED?(i.state=_.state,Promise.reject(S)):(a.terrainState=Eh.NONE,Promise.reject(S))})};YT.prototype.getLevelMaximumGeometricError=function(e){return this._levelZeroMaximumGeometricError/(1<<e)};YT.prototype.getTileDataAvailable=function(e,t,n){let i=this._metadata,o=hy.tileXYToQuadKey(e,t,n),r=i.getTileInformation(e,t,n);if(r===null)return!1;if(l(r)){if(!r.ancestorHasTerrain)return!0;let s=r.terrainState;if(s===Eh.NONE)return!1;if((!l(s)||s===Eh.UNKNOWN)&&(r.terrainState=Eh.UNKNOWN,!r.hasTerrain())){o=o.substring(0,o.length-1);let a=i.getTileInformationFromQuadKey(o);if(!l(a)||!a.hasTerrain())return!1}return!0}if(i.isValid(o)){let s=new Ar({throttle:!1,throttleByServer:!0,type:js.TERRAIN});i.populateSubtree(e,t,n,s)}return!1};YT.prototype.loadTileDataAvailability=function(e,t,n){};function yUt(e,t,n,i){return n=l(n)&&n>0?n:1,e._metadata.resource.getDerivedResource({url:`flatfile?f1c-0${t}-t.${n.toString()}`,request:i})}var tae=YT;var UFo=x(T(),1);var xUt="https://maps.googleapis.com/maps/api/geocode/json",JXe='<img alt="Google" src="https://assets.ion.cesium.com/google-credit.png" style="vertical-align:-5px">';function nae(e){e=e??B.EMPTY_OBJECT;let t=e.key;this._resource=new ve({url:xUt,queryParameters:{key:t}}),this._credit=new Lt(JXe,!0)}Object.defineProperties(nae.prototype,{credit:{get:function(){return this._credit}}});nae.prototype.geocode=async function(e){let n=await this._resource.getDerivedResource({queryParameters:{address:e}}).fetchJson();if(n.status==="ZERO_RESULTS")return[];if(n.status!=="OK")throw new ae(`GoogleGeocoderService got a bad response ${n.status}: ${n.error_message}`);return n.results.map(o=>{let r=o.geometry.viewport.southwest,s=o.geometry.viewport.northeast;return{displayName:o.formatted_address,destination:re.fromDegrees(r.lng,r.lat,s.lng,s.lat),attribution:{html:JXe,collapsible:!1}}})};var iae=nae;var BFo=x(T(),1);var oae=class{constructor(){mt(this,"type")}getRequiredDataPoints(t){ge.throwInstantiationError()}interpolateOrderZero(t,n,i,o,r){ge.throwInstantiationError()}interpolate(t,n,i,o,r,s,a){ge.throwInstantiationError()}},rae=oae;var KFo=x(T(),1),jXe={GOOGLE:"GOOGLE",BING:"BING",DEFAULT:"DEFAULT"};Object.freeze(jXe);var fy=jXe;var uIo=x(T(),1);var tIo=x(T(),1);function sae(e){this._url=ve.createIfNeeded(e),this._url.appendForwardSlash()}Object.defineProperties(sae.prototype,{url:{get:function(){return this._url}},credit:{get:function(){}}});sae.prototype.geocode=async function(e,t){return this._url.getDerivedResource({url:t===NT.AUTOCOMPLETE?"autocomplete":"search",queryParameters:{text:e}}).fetchJson().then(function(i){return i.features.map(function(o){let r,s=o.bbox;if(l(s))r=re.fromDegrees(s[0],s[1],s[2],s[3]);else{let a=o.geometry.coordinates[0],c=o.geometry.coordinates[1];r=h.fromDegrees(a,c)}return{displayName:o.properties.label,destination:r,attributions:i.attributions}})})};var VU=sae;function TUt(e){if(!Object.values(fy).some(t=>t===e))throw new ge(`Invalid geocodeProviderType: "${e}"`)}var QXe=Object.freeze({[fy.GOOGLE]:"google",[fy.BING]:"bing",[fy.DEFAULT]:void 0});function _Ut(e){return QXe[e]}function SUt(e){return Object.entries(QXe).find(t=>t[1]===e)[0]}function aae(e){e=e??B.EMPTY_OBJECT;let t=e.geocodeProviderType??fy.DEFAULT,n=e.accessToken??Bd.defaultAccessToken,i=ve.createIfNeeded(e.server??Bd.defaultServer);i.appendForwardSlash();let o=Bd.getDefaultTokenCredit(n);l(o)&&e.scene.frameState.creditDisplay.addStaticCredit(Lt.clone(o));let r=i.getDerivedResource({url:"v1/geocode"});l(n)&&r.appendQueryParameters({access_token:n}),this._accessToken=n,this._server=i,this._pelias=new VU(r),this.geocodeProviderType=t}Object.defineProperties(aae.prototype,{credit:{get:function(){}},geocodeProviderType:{get:function(){return SUt(this._pelias.url.queryParameters.geocoder)},set:function(e){TUt(e);let t={...this._pelias.url.queryParameters,geocoder:_Ut(e)};l(t.geocoder)||delete t.geocoder,this._pelias.url.setQueryParameters(t)}}});aae.prototype.geocode=async function(e,t){return this._pelias.geocode(e,t)};var FR=aae;var hIo=x(T(),1),qXe={NONE:0,POINT:1,SEGMENT:2,CURVE:3,ARC:4,SURFACE:5};Object.freeze(qXe);var cae=qXe;var pIo=x(T(),1),$Xe={NONE:0,NOT_IN_RANGE:1,IN_RANGE:2};Object.freeze($Xe);var lae=$Xe;var gIo=x(T(),1),eNe={NEAREST:1,NEAREST_KEYPOINT:2,CENTER:8};Object.freeze(eNe);var EU=eNe;var xIo=x(T(),1),tNe={NONE:0,WIRE:1,SHEET:2,SOLID:3,MESH:4,TEXT:5};Object.freeze(tNe);var dae=tNe;var FIo=x(T(),1);function nNe(e){if(!(!l(e)||!l(e.longitude)||!l(e.latitude)))return h.fromDegrees(e.longitude,e.latitude,e.height??0)}function iNe(e){let t=pe.fromCartesian(e);return{longitude:W.toDegrees(t.longitude),latitude:W.toDegrees(t.latitude),height:t.height}}function ZUt(e){let t=[],n=new ce;for(let i=0;i<4;i++)P.getRow(e,i,n),t.push([n.x,n.y,n.z,n.w]);return t}function RUt(e,t,n){return P.fromRowMajorArray([e/2,0,0,e/2,0,-t/2,0,t/2,0,0,.5,.5,0,0,0,1],n)}var CUt=new P,VUt=new P,dJ=class e{constructor(t){this._assetId=t.assetId,this._resource=t.resource,this.ecefTransform=t.ecefTransform}get assetId(){return this._assetId}static async fromAssetId(t,n){n=n??B.EMPTY_OBJECT;let i=n.accessToken??Bd.defaultAccessToken,o=ve.createIfNeeded(n.server??Bd.defaultServer);o.appendForwardSlash();let r={url:`assets/${t}/`,headers:zr._addClientHeaders()};l(i)&&(r.queryParameters={access_token:i});let s=o.getDerivedResource(r),a=await s.getDerivedResource({url:"ecef"}).fetchJson();if(!l(a?.ecefTransform))throw new ae(`Cesium ion asset ${t} is not geolocated; snapping requires geolocation`);let c=P.fromRowMajorArray(a.ecefTransform.flat());return new e({assetId:t,resource:s,ecefTransform:c})}_computeWorldToView(t,n,i,o){o=o??new P;let r=RUt(n,i,CUt);return P.multiply(t.viewMatrix,this.ecefTransform,o),P.multiply(t.frustum.projectionMatrix,o,o),P.multiply(r,o,o)}async snap(t){let n=this._computeWorldToView(t.camera,t.canvasWidth,t.canvasHeight,VUt),i={testPoint:iNe(t.testPoint),closePoint:iNe(t.closePoint??t.testPoint),snapAperture:t.snapAperture??e.DEFAULT_SNAP_APERTURE,snapMode:t.snapMode??EU.NEAREST,worldToView:ZUt(n)},o;try{o=await this._resource.getDerivedResource({url:`elements/${t.elementId}/snap`}).post(JSON.stringify(i),{headers:{"Content-Type":"application/json"},responseType:"json"})}catch(s){if(s?.statusCode===404||s?.statusCode===400&&typeof s.response?.message=="string"&&s.response.message.includes("No snap possible"))return;throw s}if(!l(o))return;let r={heat:o.heat,geometryType:o.geomType,parentGeometryType:o.parentGeomType,normal:o.normal,curve:o.curve};return r.snapPoint=nNe(o.snapPoint),r.hitPoint=nNe(o.hitPoint),r}};dJ.DEFAULT_SNAP_APERTURE=12;var uae=dJ;var YIo=x(T(),1);var ca={};ca.ExportStatus=Object.freeze({NotStarted:"NotStarted",InProgress:"InProgress",Complete:"Complete",Invalid:"Invalid"});ca.ExportType=Object.freeze({IMODEL:"IMODEL",CESIUM:"CESIUM","3DTILES":"3DTILES"});ca.RealityDataType=Object.freeze({Cesium3DTiles:"Cesium3DTiles",PNTS:"PNTS",RealityMesh3DTiles:"RealityMesh3DTiles",Terrain3DTiles:"Terrain3DTiles",GaussianSplat3DTiles:"GS_3DT",KML:"KML",GeoJSON:"GeoJSON",Unstructured:"Unstructured"});ca.defaultAccessToken=void 0;ca.defaultShareKey=void 0;ca._getAuthorizationHeader=function(){return l(ca.defaultShareKey)?`Basic ${ca.defaultShareKey}`:`Bearer ${ca.defaultAccessToken}`};ca.apiEndpoint=new ve({url:"https://api.bentley.com"});ca.getExports=async function(e,t){let n=new ve({url:`${ca.apiEndpoint}mesh-export`,headers:{Authorization:ca._getAuthorizationHeader(),Accept:"application/vnd.bentley.itwin-platform.v1+json",Prefer:"return=representation"},queryParameters:{iModelId:e,exportType:ca.ExportType["3DTILES"],$top:"5",client:"CesiumJS"}});typeof CESIUM_VERSION<"u"&&n.appendQueryParameters({clientVersion:CESIUM_VERSION}),l(t)&&t!==""&&n.appendQueryParameters({changesetId:t});try{return await n.fetchJson()}catch(i){let o=JSON.parse(i.response);if(i.statusCode===401){let r=o.error.details?.[0].code??"";throw new ae(`Unauthorized, bad token, wrong scopes or headers bad. ${r}`)}else{if(i.statusCode===403)throw console.error(o.error.code,o.error.message),new ae("Not allowed, forbidden");if(i.statusCode===422)throw new ae(`Unprocessable Entity:${o.error.code} ${o.error.message}`);if(i.statusCode===429)throw new ae("Too many requests")}throw new ae(`Unknown request failure ${i.statusCode}`)}};ca.getRealityDataMetadata=async function(e,t){let n=new ve({url:`${ca.apiEndpoint}reality-management/reality-data/${t}`,headers:{Authorization:ca._getAuthorizationHeader(),Accept:"application/vnd.bentley.itwin-platform.v1+json"},queryParameters:{iTwinId:e}});try{return(await n.fetchJson()).realityData}catch(i){let o=JSON.parse(i.response);if(i.statusCode===401){let r=o.error.details?.[0].code??"";throw new ae(`Unauthorized, bad token, wrong scopes or headers bad. ${r}`)}else{if(i.statusCode===403)throw console.error(o.error.code,o.error.message),new ae("Not allowed, forbidden");if(i.statusCode===404)throw new ae(`Reality data not found: ${e}, ${t}`);if(i.statusCode===422)throw new ae(`Unprocessable Entity:${o.error.code} ${o.error.message}`);if(i.statusCode===429)throw new ae("Too many requests")}throw new ae(`Unknown request failure ${i.statusCode}`)}};ca.getRealityDataURL=async function(e,t,n){let i=new ve({url:`${ca.apiEndpoint}reality-management/reality-data/${t}/readaccess`,headers:{Authorization:ca._getAuthorizationHeader(),Accept:"application/vnd.bentley.itwin-platform.v1+json"},queryParameters:{iTwinId:e}});try{let r=(await i.fetchJson())._links.containerUrl.href,s=new URL(r);return s.pathname=`${s.pathname}/${n}`,s.toString()}catch(o){let r=JSON.parse(o.response);if(o.statusCode===401){let s=r.error.details?.[0].code??"";throw new ae(`Unauthorized, bad token, wrong scopes or headers bad. ${s}`)}else{if(o.statusCode===403)throw console.error(r.error.code,r.error.message),new ae("Not allowed, forbidden");if(o.statusCode===404)throw new ae(`Reality data not found: ${e}, ${t}`);if(o.statusCode===422)throw new ae(`Unprocessable Entity:${r.error.code} ${r.error.message}`);if(o.statusCode===429)throw new ae("Too many requests")}throw new ae(`Unknown request failure ${o.statusCode}`)}};var la=ca;var kIo=x(T(),1);var mae=class{constructor(){mt(this,"ellipsoid")}project(t,n){ge.throwInstantiationError()}unproject(t,n){ge.throwInstantiationError()}},hae=mae;var HIo=x(T(),1);function AA(e){e=e??B.EMPTY_OBJECT;let t=e.weights,n=e.times;this._times=n,this._weights=t,this._count=t.length/n.length,this._lastTimeIndex=0}Object.defineProperties(AA.prototype,{times:{get:function(){return this._times}},weights:{get:function(){return this._weights}}});AA.prototype.findTimeInterval=vo.prototype.findTimeInterval;AA.prototype.wrapTime=vo.prototype.wrapTime;AA.prototype.clampTime=vo.prototype.clampTime;AA.prototype.evaluate=function(e,t){let n=this.weights,i=this.times,o=this._lastTimeIndex=this.findTimeInterval(e,this._lastTimeIndex),r=(e-i[o])/(i[o+1]-i[o]);l(t)||(t=new Array(this._count));for(let s=0;s<this._count;s++){let a=o*this._count+s;t[s]=n[a]*(1-r)+n[a+this._count]*r}return t};var fae=AA;var tPo=x(T(),1);function pae(e,t,n){e=ve.createIfNeeded(e),e.appendForwardSlash(),e.setQueryParameters({key:t}),this._url=e,this._params=n??{},this._credit=new Lt('Geodata copyright <a href="https://www.openstreetmap.org/">OpenStreetMap</a> contributors',!1)}Object.defineProperties(pae.prototype,{url:{get:function(){return this._url}},params:{get:function(){return this._params}},credit:{get:function(){return this._credit}}});pae.prototype.geocode=async function(e){return this._url.getDerivedResource({url:"json",queryParameters:It(this._params,{q:e})}).fetchJson().then(function(n){return n.results.map(function(i){let o,r=i.bounds;if(l(r))o=re.fromDegrees(r.southwest.lng,r.southwest.lat,r.northeast.lng,r.northeast.lat);else{let{lng:s,lat:a}=i.geometry;o=h.fromDegrees(s,a)}return{displayName:i.formatted,destination:o}})})};var bae=pae;var oPo=x(T(),1);var EUt={packedLength:void 0,pack:ge.throwInstantiationError,unpack:ge.throwInstantiationError},gae=EUt;var aPo=x(T(),1);var AUt={packedInterpolationLength:void 0,convertPackedArrayForInterpolation:ge.throwInstantiationError,unpackInterpolationResult:ge.throwInstantiationError},yae=AUt;var mPo=x(T(),1);var GUt=new h;function LUt(e,t,n,i){let o=c_(e,t,n,i,GUt);return l(o)?o.x>0&&o.y>0&&o.z>0:!1}var xae=LUt;var pPo=x(T(),1);function oNe(){ge.throwInstantiationError()}oNe.prototype.getURL=ge.throwInstantiationError;var Tae=oNe;var vPo=x(T(),1);function WUt(e,t,n,i,o,r,s){let a=io.numberOfPoints(e,t,o),c,d=n.red,u=n.green,m=n.blue,p=n.alpha,b=i.red,f=i.green,y=i.blue,_=i.alpha;if(U.equals(n,i)){for(c=0;c<a;c++)r[s++]=U.floatToByte(d),r[s++]=U.floatToByte(u),r[s++]=U.floatToByte(m),r[s++]=U.floatToByte(p);return s}let S=(b-d)/a,Z=(f-u)/a,R=(y-m)/a,C=(_-p)/a,E=s;for(c=0;c<a;c++)r[E++]=U.floatToByte(d+c*S),r[E++]=U.floatToByte(u+c*Z),r[E++]=U.floatToByte(m+c*R),r[E++]=U.floatToByte(p+c*C);return E}function AU(e){e=e??B.EMPTY_OBJECT;let t=e.positions,n=e.colors,i=e.colorsPerVertex??!1;this._positions=t,this._colors=n,this._colorsPerVertex=i,this._arcType=e.arcType??un.GEODESIC,this._granularity=e.granularity??W.RADIANS_PER_DEGREE,this._ellipsoid=e.ellipsoid??ne.default,this._workerName="createSimplePolylineGeometry";let o=1+t.length*h.packedLength;o+=l(n)?1+n.length*U.packedLength:1,this.packedLength=o+ne.packedLength+3}AU.pack=function(e,t,n){n=n??0;let i,o=e._positions,r=o.length;for(t[n++]=r,i=0;i<r;++i,n+=h.packedLength)h.pack(o[i],t,n);let s=e._colors;for(r=l(s)?s.length:0,t[n++]=r,i=0;i<r;++i,n+=U.packedLength)U.pack(s[i],t,n);return ne.pack(e._ellipsoid,t,n),n+=ne.packedLength,t[n++]=e._colorsPerVertex?1:0,t[n++]=e._arcType,t[n]=e._granularity,t};AU.unpack=function(e,t,n){t=t??0;let i,o=e[t++],r=new Array(o);for(i=0;i<o;++i,t+=h.packedLength)r[i]=h.unpack(e,t);o=e[t++];let s=o>0?new Array(o):void 0;for(i=0;i<o;++i,t+=U.packedLength)s[i]=U.unpack(e,t);let a=ne.unpack(e,t);t+=ne.packedLength;let c=e[t++]===1,d=e[t++],u=e[t];return l(n)?(n._positions=r,n._colors=s,n._ellipsoid=a,n._colorsPerVertex=c,n._arcType=d,n._granularity=u,n):new AU({positions:r,colors:s,ellipsoid:a,colorsPerVertex:c,arcType:d,granularity:u})};var uJ=new Array(2),mJ=new Array(2),vUt={positions:uJ,height:mJ,ellipsoid:void 0,minDistance:void 0,granularity:void 0};AU.createGeometry=function(e){let t=e._positions,n=e._colors,i=e._colorsPerVertex,o=e._arcType,r=e._granularity,s=e._ellipsoid,a=W.chordLength(r,s.maximumRadius),c=l(n)&&!i,d,u=t.length,m,p,b,f,y=0;if(o===un.GEODESIC||o===un.RHUMB){let C,E,A;o===un.GEODESIC?(C=W.chordLength(r,s.maximumRadius),E=io.numberOfPoints,A=io.generateArc):(C=r,E=io.numberOfPointsRhumbLine,A=io.generateRhumbArc);let L=io.extractHeights(t,s),F=vUt;if(o===un.GEODESIC?F.minDistance=a:F.granularity=r,F.ellipsoid=s,c){let I=0;for(d=0;d<u-1;d++)I+=E(t[d],t[d+1],C)+1;m=new Float64Array(I*3),b=new Uint8Array(I*4),F.positions=uJ,F.height=mJ;let N=0;for(d=0;d<u-1;++d){uJ[0]=t[d],uJ[1]=t[d+1],mJ[0]=L[d],mJ[1]=L[d+1];let g=A(F);if(l(n)){let V=g.length/3;f=n[d];for(let G=0;G<V;++G)b[N++]=U.floatToByte(f.red),b[N++]=U.floatToByte(f.green),b[N++]=U.floatToByte(f.blue),b[N++]=U.floatToByte(f.alpha)}m.set(g,y),y+=g.length}}else if(F.positions=t,F.height=L,m=new Float64Array(A(F)),l(n)){for(b=new Uint8Array(m.length/3*4),d=0;d<u-1;++d){let N=t[d],g=t[d+1],V=n[d],G=n[d+1];y=WUt(N,g,V,G,a,b,y)}let I=n[u-1];b[y++]=U.floatToByte(I.red),b[y++]=U.floatToByte(I.green),b[y++]=U.floatToByte(I.blue),b[y]=U.floatToByte(I.alpha)}}else{p=c?u*2-2:u,m=new Float64Array(p*3),b=l(n)?new Uint8Array(p*4):void 0;let C=0,E=0;for(d=0;d<u;++d){let A=t[d];if(c&&d>0&&(h.pack(A,m,C),C+=3,f=n[d-1],b[E++]=U.floatToByte(f.red),b[E++]=U.floatToByte(f.green),b[E++]=U.floatToByte(f.blue),b[E++]=U.floatToByte(f.alpha)),c&&d===u-1)break;h.pack(A,m,C),C+=3,l(n)&&(f=n[d],b[E++]=U.floatToByte(f.red),b[E++]=U.floatToByte(f.green),b[E++]=U.floatToByte(f.blue),b[E++]=U.floatToByte(f.alpha))}}let _=new Rn;_.position=new Xe({componentDatatype:J.DOUBLE,componentsPerAttribute:3,values:m}),l(n)&&(_.color=new Xe({componentDatatype:J.UNSIGNED_BYTE,componentsPerAttribute:4,values:b,normalize:!0})),p=m.length/3;let S=(p-1)*2,Z=Oe.createTypedArray(p,S),R=0;for(d=0;d<p-1;++d)Z[R++]=d,Z[R++]=d+1;return new At({attributes:_,indices:Z,primitiveType:Ie.LINES,boundingSphere:me.fromPoints(t)})};var _ae=AU;var PPo=x(T(),1);var hJ=class{constructor(){ge.throwInstantiationError()}async snap(t){ge.throwInstantiationError()}};hJ.DEFAULT_SNAP_APERTURE=void 0;var Sae=hJ;var kPo=x(T(),1);function GA(e){let t=e.radius??1,i={radii:new h(t,t,t),stackPartitions:e.stackPartitions,slicePartitions:e.slicePartitions,vertexFormat:e.vertexFormat};this._ellipsoidGeometry=new Ma(i),this._workerName="createSphereGeometry"}GA.packedLength=Ma.packedLength;GA.pack=function(e,t,n){return Ma.pack(e._ellipsoidGeometry,t,n)};var FUt=new Ma,MT={radius:void 0,radii:new h,vertexFormat:new Me,stackPartitions:void 0,slicePartitions:void 0};GA.unpack=function(e,t,n){let i=Ma.unpack(e,t,FUt);return MT.vertexFormat=Me.clone(i._vertexFormat,MT.vertexFormat),MT.stackPartitions=i._stackPartitions,MT.slicePartitions=i._slicePartitions,l(n)?(h.clone(i._radii,MT.radii),n._ellipsoidGeometry=new Ma(MT),n):(MT.radius=i._radii.x,new GA(MT))};GA.createGeometry=function(e){return Ma.createGeometry(e._ellipsoidGeometry)};var GU=GA;var DPo=x(T(),1);function IUt(e){return e<=.04045?e*.07739938080495357:Math.pow((e+.055)*.9478672985781991,2.4)}var IR=IUt;var zPo=x(T(),1);var Zae=class{constructor(t){mt(this,"ellipsoid");mt(this,"rectangle");mt(this,"projection")}getNumberOfXTilesAtLevel(t){ge.throwInstantiationError()}getNumberOfYTilesAtLevel(t){ge.throwInstantiationError()}rectangleToNativeRectangle(t,n){ge.throwInstantiationError()}tileXYToNativeRectangle(t,n,i,o){ge.throwInstantiationError()}tileXYToRectangle(t,n,i,o){ge.throwInstantiationError()}positionToTileXY(t,n,i){ge.throwInstantiationError()}},Rae=Zae;var eXo=x(T(),1);function PR(e){e=e??B.EMPTY_OBJECT,this._clock=void 0,this._element=void 0,this._clockSubscription=void 0,this._seekFunction=void 0,this._lastPlaybackRate=void 0,this.clock=e.clock,this.element=e.element,this.epoch=e.epoch??ot.MINIMUM_VALUE,this.tolerance=e.tolerance??1,this._seeking=!1,this._seekFunction=void 0,this._firstTickAfterSeek=!1}Object.defineProperties(PR.prototype,{clock:{get:function(){return this._clock},set:function(e){let t=this._clock;t!==e&&(l(t)&&(this._clockSubscription(),this._clockSubscription=void 0),l(e)&&(this._clockSubscription=e.onTick.addEventListener(PR.prototype._onTick,this)),this._clock=e)}},element:{get:function(){return this._element},set:function(e){let t=this._element;t!==e&&(l(t)&&t.removeEventListener("seeked",this._seekFunction,!1),l(e)&&(this._seeking=!1,this._seekFunction=PUt(this),e.addEventListener("seeked",this._seekFunction,!1)),this._element=e,this._seeking=!1,this._firstTickAfterSeek=!1)}}});PR.prototype.destroy=function(){return this.element=void 0,this.clock=void 0,ue(this)};PR.prototype.isDestroyed=function(){return!1};PR.prototype._trySetPlaybackRate=function(e){if(this._lastPlaybackRate===e.multiplier)return;let t=this._element;try{t.playbackRate=e.multiplier}catch{t.playbackRate=0}this._lastPlaybackRate=e.multiplier};PR.prototype._onTick=function(e){let t=this._element;if(!l(t)||t.readyState<2)return;let n=t.paused,i=e.shouldAnimate;if(i===n&&(i?t.play():t.pause()),this._seeking||this._firstTickAfterSeek){this._firstTickAfterSeek=!1;return}this._trySetPlaybackRate(e);let o=e.currentTime,r=this.epoch??ot.MINIMUM_VALUE,s=Q.secondsDifference(o,r),a=t.duration,c,d=t.currentTime;t.loop?(s=s%a,s<0&&(s=a-s),c=s):s>a?c=a:s<0?c=0:c=s;let u=i?this.tolerance??1:.001;Math.abs(c-d)>u&&(this._seeking=!0,t.currentTime=c)};function PUt(e){return function(){e._seeking=!1,e._firstTickAfterSeek=!0}}var Cae=PR;var bXo=x(T(),1);function XUt(e,t){this.rectangle=e,this.maxLevel=t}function rNe(e){this.ellipsoid=e.ellipsoid??ne.default,this.tilingScheme=void 0,this.heightmapWidth=void 0,this.heightmapHeight=void 0,this.levelZeroMaximumGeometricError=void 0,this.rectangles=[]}rNe.prototype.build=function(e){e._tilingScheme=this.tilingScheme,e._heightmapWidth=this.heightmapWidth,e._heightmapHeight=this.heightmapHeight,e._levelZeroMaximumGeometricError=this.levelZeroMaximumGeometricError,e._rectangles=this.rectangles};function NUt(e,t){let n=t.getElementsByTagName("SRS")[0].textContent;if(n==="EPSG:4326")e.tilingScheme=new eo({ellipsoid:e.ellipsoid});else throw new ae(`SRS ${n} is not supported`);let i=t.getElementsByTagName("TileFormat")[0];e.heightmapWidth=parseInt(i.getAttribute("width"),10),e.heightmapHeight=parseInt(i.getAttribute("height"),10),e.levelZeroMaximumGeometricError=Qo.getEstimatedLevelZeroGeometricErrorForAHeightmap(e.ellipsoid,Math.min(e.heightmapWidth,e.heightmapHeight),e.tilingScheme.getNumberOfXTilesAtLevel(0));let o=t.getElementsByTagName("DataExtent");for(let r=0;r<o.length;++r){let s=o[r],a=W.toRadians(parseFloat(s.getAttribute("minx"))),c=W.toRadians(parseFloat(s.getAttribute("miny"))),d=W.toRadians(parseFloat(s.getAttribute("maxx"))),u=W.toRadians(parseFloat(s.getAttribute("maxy"))),m=parseInt(s.getAttribute("maxlevel"),10);e.rectangles.push(new XUt(new re(a,c,d,u),m))}}function YUt(e,t,n){let i=`An error occurred while accessing ${e.url}`;throw l(t)&&l(t.message)&&(i=`${i}: ${t.message}`),tr.reportError(void 0,n,l(n)?n._errorEvent:void 0,i),new ae(i)}async function MUt(e,t,n){try{let i=await t.fetchXML();NUt(e,i)}catch(i){YUt(t,i,n)}}function wT(e){e=e??B.EMPTY_OBJECT,this._errorEvent=new Se,this._terrainDataStructure={heightScale:1/1e3,heightOffset:-1e3,elementsPerHeight:3,stride:4,elementMultiplier:256,isBigEndian:!0,lowestEncodedHeight:0,highestEncodedHeight:256*256*256-1};let t=e.credit;typeof t=="string"&&(t=new Lt(t)),this._credit=t,this._tilingScheme=void 0,this._rectangles=[]}Object.defineProperties(wT.prototype,{errorEvent:{get:function(){return this._errorEvent}},credit:{get:function(){return this._credit}},tilingScheme:{get:function(){return this._tilingScheme}},hasWaterMask:{get:function(){return!1}},hasVertexNormals:{get:function(){return!1}},availability:{get:function(){}}});wT.fromUrl=async function(e,t){t=t??B.EMPTY_OBJECT;let n=new rNe(t),i=ve.createIfNeeded(e);await MUt(n,i);let o=new wT(t);return n.build(o),o._resource=i,o};wT.prototype.requestTileGeometry=function(e,t,n,i){let o=this._tilingScheme.getNumberOfYTilesAtLevel(n),s=this._resource.getDerivedResource({url:`${n}/${e}/${o-t-1}.tif`,queryParameters:{cesium:!0},request:i}).fetchImage({preferImageBitmap:!0});if(!l(s))return;let a=this;return Promise.resolve(s).then(function(c){return new Yc({buffer:Fh(c),width:a._heightmapWidth,height:a._heightmapHeight,childTileMask:wUt(a,e,t,n),structure:a._terrainDataStructure})})};wT.prototype.getLevelMaximumGeometricError=function(e){return this._levelZeroMaximumGeometricError/(1<<e)};var sNe=new re;function wUt(e,t,n,i){let o=e._tilingScheme,r=e._rectangles,s=o.tileXYToRectangle(t,n,i),a=0;for(let c=0;c<r.length&&a!==15;++c){let d=r[c];if(d.maxLevel<=i)continue;let u=d.rectangle,m=re.intersection(u,s,sNe);l(m)&&(fJ(o,u,t*2,n*2,i+1)&&(a|=4),fJ(o,u,t*2+1,n*2,i+1)&&(a|=8),fJ(o,u,t*2,n*2+1,i+1)&&(a|=1),fJ(o,u,t*2+1,n*2+1,i+1)&&(a|=2))}return a}function fJ(e,t,n,i,o){let r=e.tileXYToRectangle(n,i,o);return l(re.intersection(r,t,sNe))}wT.prototype.getTileDataAvailable=function(e,t,n){};wT.prototype.loadTileDataAvailability=function(e,t,n){};var Vae=wT;var yXo=x(T(),1),aNe={VK_FORMAT_UNDEFINED:0,VK_FORMAT_R4G4_UNORM_PACK8:1,VK_FORMAT_R4G4B4A4_UNORM_PACK16:2,VK_FORMAT_B4G4R4A4_UNORM_PACK16:3,VK_FORMAT_R5G6B5_UNORM_PACK16:4,VK_FORMAT_B5G6R5_UNORM_PACK16:5,VK_FORMAT_R5G5B5A1_UNORM_PACK16:6,VK_FORMAT_B5G5R5A1_UNORM_PACK16:7,VK_FORMAT_A1R5G5B5_UNORM_PACK16:8,VK_FORMAT_R8_UNORM:9,VK_FORMAT_R8_SNORM:10,VK_FORMAT_R8_USCALED:11,VK_FORMAT_R8_SSCALED:12,VK_FORMAT_R8_UINT:13,VK_FORMAT_R8_SINT:14,VK_FORMAT_R8_SRGB:15,VK_FORMAT_R8G8_UNORM:16,VK_FORMAT_R8G8_SNORM:17,VK_FORMAT_R8G8_USCALED:18,VK_FORMAT_R8G8_SSCALED:19,VK_FORMAT_R8G8_UINT:20,VK_FORMAT_R8G8_SINT:21,VK_FORMAT_R8G8_SRGB:22,VK_FORMAT_R8G8B8_UNORM:23,VK_FORMAT_R8G8B8_SNORM:24,VK_FORMAT_R8G8B8_USCALED:25,VK_FORMAT_R8G8B8_SSCALED:26,VK_FORMAT_R8G8B8_UINT:27,VK_FORMAT_R8G8B8_SINT:28,VK_FORMAT_R8G8B8_SRGB:29,VK_FORMAT_B8G8R8_UNORM:30,VK_FORMAT_B8G8R8_SNORM:31,VK_FORMAT_B8G8R8_USCALED:32,VK_FORMAT_B8G8R8_SSCALED:33,VK_FORMAT_B8G8R8_UINT:34,VK_FORMAT_B8G8R8_SINT:35,VK_FORMAT_B8G8R8_SRGB:36,VK_FORMAT_R8G8B8A8_UNORM:37,VK_FORMAT_R8G8B8A8_SNORM:38,VK_FORMAT_R8G8B8A8_USCALED:39,VK_FORMAT_R8G8B8A8_SSCALED:40,VK_FORMAT_R8G8B8A8_UINT:41,VK_FORMAT_R8G8B8A8_SINT:42,VK_FORMAT_R8G8B8A8_SRGB:43,VK_FORMAT_B8G8R8A8_UNORM:44,VK_FORMAT_B8G8R8A8_SNORM:45,VK_FORMAT_B8G8R8A8_USCALED:46,VK_FORMAT_B8G8R8A8_SSCALED:47,VK_FORMAT_B8G8R8A8_UINT:48,VK_FORMAT_B8G8R8A8_SINT:49,VK_FORMAT_B8G8R8A8_SRGB:50,VK_FORMAT_A8B8G8R8_UNORM_PACK32:51,VK_FORMAT_A8B8G8R8_SNORM_PACK32:52,VK_FORMAT_A8B8G8R8_USCALED_PACK32:53,VK_FORMAT_A8B8G8R8_SSCALED_PACK32:54,VK_FORMAT_A8B8G8R8_UINT_PACK32:55,VK_FORMAT_A8B8G8R8_SINT_PACK32:56,VK_FORMAT_A8B8G8R8_SRGB_PACK32:57,VK_FORMAT_A2R10G10B10_UNORM_PACK32:58,VK_FORMAT_A2R10G10B10_SNORM_PACK32:59,VK_FORMAT_A2R10G10B10_USCALED_PACK32:60,VK_FORMAT_A2R10G10B10_SSCALED_PACK32:61,VK_FORMAT_A2R10G10B10_UINT_PACK32:62,VK_FORMAT_A2R10G10B10_SINT_PACK32:63,VK_FORMAT_A2B10G10R10_UNORM_PACK32:64,VK_FORMAT_A2B10G10R10_SNORM_PACK32:65,VK_FORMAT_A2B10G10R10_USCALED_PACK32:66,VK_FORMAT_A2B10G10R10_SSCALED_PACK32:67,VK_FORMAT_A2B10G10R10_UINT_PACK32:68,VK_FORMAT_A2B10G10R10_SINT_PACK32:69,VK_FORMAT_R16_UNORM:70,VK_FORMAT_R16_SNORM:71,VK_FORMAT_R16_USCALED:72,VK_FORMAT_R16_SSCALED:73,VK_FORMAT_R16_UINT:74,VK_FORMAT_R16_SINT:75,VK_FORMAT_R16_SFLOAT:76,VK_FORMAT_R16G16_UNORM:77,VK_FORMAT_R16G16_SNORM:78,VK_FORMAT_R16G16_USCALED:79,VK_FORMAT_R16G16_SSCALED:80,VK_FORMAT_R16G16_UINT:81,VK_FORMAT_R16G16_SINT:82,VK_FORMAT_R16G16_SFLOAT:83,VK_FORMAT_R16G16B16_UNORM:84,VK_FORMAT_R16G16B16_SNORM:85,VK_FORMAT_R16G16B16_USCALED:86,VK_FORMAT_R16G16B16_SSCALED:87,VK_FORMAT_R16G16B16_UINT:88,VK_FORMAT_R16G16B16_SINT:89,VK_FORMAT_R16G16B16_SFLOAT:90,VK_FORMAT_R16G16B16A16_UNORM:91,VK_FORMAT_R16G16B16A16_SNORM:92,VK_FORMAT_R16G16B16A16_USCALED:93,VK_FORMAT_R16G16B16A16_SSCALED:94,VK_FORMAT_R16G16B16A16_UINT:95,VK_FORMAT_R16G16B16A16_SINT:96,VK_FORMAT_R16G16B16A16_SFLOAT:97,VK_FORMAT_R32_UINT:98,VK_FORMAT_R32_SINT:99,VK_FORMAT_R32_SFLOAT:100,VK_FORMAT_R32G32_UINT:101,VK_FORMAT_R32G32_SINT:102,VK_FORMAT_R32G32_SFLOAT:103,VK_FORMAT_R32G32B32_UINT:104,VK_FORMAT_R32G32B32_SINT:105,VK_FORMAT_R32G32B32_SFLOAT:106,VK_FORMAT_R32G32B32A32_UINT:107,VK_FORMAT_R32G32B32A32_SINT:108,VK_FORMAT_R32G32B32A32_SFLOAT:109,VK_FORMAT_R64_UINT:110,VK_FORMAT_R64_SINT:111,VK_FORMAT_R64_SFLOAT:112,VK_FORMAT_R64G64_UINT:113,VK_FORMAT_R64G64_SINT:114,VK_FORMAT_R64G64_SFLOAT:115,VK_FORMAT_R64G64B64_UINT:116,VK_FORMAT_R64G64B64_SINT:117,VK_FORMAT_R64G64B64_SFLOAT:118,VK_FORMAT_R64G64B64A64_UINT:119,VK_FORMAT_R64G64B64A64_SINT:120,VK_FORMAT_R64G64B64A64_SFLOAT:121,VK_FORMAT_B10G11R11_UFLOAT_PACK32:122,VK_FORMAT_E5B9G9R9_UFLOAT_PACK32:123,VK_FORMAT_D16_UNORM:124,VK_FORMAT_X8_D24_UNORM_PACK32:125,VK_FORMAT_D32_SFLOAT:126,VK_FORMAT_S8_UINT:127,VK_FORMAT_D16_UNORM_S8_UINT:128,VK_FORMAT_D24_UNORM_S8_UINT:129,VK_FORMAT_D32_SFLOAT_S8_UINT:130,VK_FORMAT_BC1_RGB_UNORM_BLOCK:131,VK_FORMAT_BC1_RGB_SRGB_BLOCK:132,VK_FORMAT_BC1_RGBA_UNORM_BLOCK:133,VK_FORMAT_BC1_RGBA_SRGB_BLOCK:134,VK_FORMAT_BC2_UNORM_BLOCK:135,VK_FORMAT_BC2_SRGB_BLOCK:136,VK_FORMAT_BC3_UNORM_BLOCK:137,VK_FORMAT_BC3_SRGB_BLOCK:138,VK_FORMAT_BC4_UNORM_BLOCK:139,VK_FORMAT_BC4_SNORM_BLOCK:140,VK_FORMAT_BC5_UNORM_BLOCK:141,VK_FORMAT_BC5_SNORM_BLOCK:142,VK_FORMAT_BC6H_UFLOAT_BLOCK:143,VK_FORMAT_BC6H_SFLOAT_BLOCK:144,VK_FORMAT_BC7_UNORM_BLOCK:145,VK_FORMAT_BC7_SRGB_BLOCK:146,VK_FORMAT_ETC2_R8G8B8_UNORM_BLOCK:147,VK_FORMAT_ETC2_R8G8B8_SRGB_BLOCK:148,VK_FORMAT_ETC2_R8G8B8A1_UNORM_BLOCK:149,VK_FORMAT_ETC2_R8G8B8A1_SRGB_BLOCK:150,VK_FORMAT_ETC2_R8G8B8A8_UNORM_BLOCK:151,VK_FORMAT_ETC2_R8G8B8A8_SRGB_BLOCK:152,VK_FORMAT_EAC_R11_UNORM_BLOCK:153,VK_FORMAT_EAC_R11_SNORM_BLOCK:154,VK_FORMAT_EAC_R11G11_UNORM_BLOCK:155,VK_FORMAT_EAC_R11G11_SNORM_BLOCK:156,VK_FORMAT_ASTC_4x4_UNORM_BLOCK:157,VK_FORMAT_ASTC_4x4_SRGB_BLOCK:158,VK_FORMAT_ASTC_5x4_UNORM_BLOCK:159,VK_FORMAT_ASTC_5x4_SRGB_BLOCK:160,VK_FORMAT_ASTC_5x5_UNORM_BLOCK:161,VK_FORMAT_ASTC_5x5_SRGB_BLOCK:162,VK_FORMAT_ASTC_6x5_UNORM_BLOCK:163,VK_FORMAT_ASTC_6x5_SRGB_BLOCK:164,VK_FORMAT_ASTC_6x6_UNORM_BLOCK:165,VK_FORMAT_ASTC_6x6_SRGB_BLOCK:166,VK_FORMAT_ASTC_8x5_UNORM_BLOCK:167,VK_FORMAT_ASTC_8x5_SRGB_BLOCK:168,VK_FORMAT_ASTC_8x6_UNORM_BLOCK:169,VK_FORMAT_ASTC_8x6_SRGB_BLOCK:170,VK_FORMAT_ASTC_8x8_UNORM_BLOCK:171,VK_FORMAT_ASTC_8x8_SRGB_BLOCK:172,VK_FORMAT_ASTC_10x5_UNORM_BLOCK:173,VK_FORMAT_ASTC_10x5_SRGB_BLOCK:174,VK_FORMAT_ASTC_10x6_UNORM_BLOCK:175,VK_FORMAT_ASTC_10x6_SRGB_BLOCK:176,VK_FORMAT_ASTC_10x8_UNORM_BLOCK:177,VK_FORMAT_ASTC_10x8_SRGB_BLOCK:178,VK_FORMAT_ASTC_10x10_UNORM_BLOCK:179,VK_FORMAT_ASTC_10x10_SRGB_BLOCK:180,VK_FORMAT_ASTC_12x10_UNORM_BLOCK:181,VK_FORMAT_ASTC_12x10_SRGB_BLOCK:182,VK_FORMAT_ASTC_12x12_UNORM_BLOCK:183,VK_FORMAT_ASTC_12x12_SRGB_BLOCK:184,VK_FORMAT_G8B8G8R8_422_UNORM:1000156e3,VK_FORMAT_B8G8R8G8_422_UNORM:1000156001,VK_FORMAT_G8_B8_R8_3PLANE_420_UNORM:1000156002,VK_FORMAT_G8_B8R8_2PLANE_420_UNORM:1000156003,VK_FORMAT_G8_B8_R8_3PLANE_422_UNORM:1000156004,VK_FORMAT_G8_B8R8_2PLANE_422_UNORM:1000156005,VK_FORMAT_G8_B8_R8_3PLANE_444_UNORM:1000156006,VK_FORMAT_R10X6_UNORM_PACK16:1000156007,VK_FORMAT_R10X6G10X6_UNORM_2PACK16:1000156008,VK_FORMAT_R10X6G10X6B10X6A10X6_UNORM_4PACK16:1000156009,VK_FORMAT_G10X6B10X6G10X6R10X6_422_UNORM_4PACK16:1000156010,VK_FORMAT_B10X6G10X6R10X6G10X6_422_UNORM_4PACK16:1000156011,VK_FORMAT_G10X6_B10X6_R10X6_3PLANE_420_UNORM_3PACK16:1000156012,VK_FORMAT_G10X6_B10X6R10X6_2PLANE_420_UNORM_3PACK16:1000156013,VK_FORMAT_G10X6_B10X6_R10X6_3PLANE_422_UNORM_3PACK16:1000156014,VK_FORMAT_G10X6_B10X6R10X6_2PLANE_422_UNORM_3PACK16:1000156015,VK_FORMAT_G10X6_B10X6_R10X6_3PLANE_444_UNORM_3PACK16:1000156016,VK_FORMAT_R12X4_UNORM_PACK16:1000156017,VK_FORMAT_R12X4G12X4_UNORM_2PACK16:1000156018,VK_FORMAT_R12X4G12X4B12X4A12X4_UNORM_4PACK16:1000156019,VK_FORMAT_G12X4B12X4G12X4R12X4_422_UNORM_4PACK16:1000156020,VK_FORMAT_B12X4G12X4R12X4G12X4_422_UNORM_4PACK16:1000156021,VK_FORMAT_G12X4_B12X4_R12X4_3PLANE_420_UNORM_3PACK16:1000156022,VK_FORMAT_G12X4_B12X4R12X4_2PLANE_420_UNORM_3PACK16:1000156023,VK_FORMAT_G12X4_B12X4_R12X4_3PLANE_422_UNORM_3PACK16:1000156024,VK_FORMAT_G12X4_B12X4R12X4_2PLANE_422_UNORM_3PACK16:1000156025,VK_FORMAT_G12X4_B12X4_R12X4_3PLANE_444_UNORM_3PACK16:1000156026,VK_FORMAT_G16B16G16R16_422_UNORM:1000156027,VK_FORMAT_B16G16R16G16_422_UNORM:1000156028,VK_FORMAT_G16_B16_R16_3PLANE_420_UNORM:1000156029,VK_FORMAT_G16_B16R16_2PLANE_420_UNORM:1000156030,VK_FORMAT_G16_B16_R16_3PLANE_422_UNORM:1000156031,VK_FORMAT_G16_B16R16_2PLANE_422_UNORM:1000156032,VK_FORMAT_G16_B16_R16_3PLANE_444_UNORM:1000156033,VK_FORMAT_PVRTC1_2BPP_UNORM_BLOCK_IMG:1000054e3,VK_FORMAT_PVRTC1_4BPP_UNORM_BLOCK_IMG:1000054001,VK_FORMAT_PVRTC2_2BPP_UNORM_BLOCK_IMG:1000054002,VK_FORMAT_PVRTC2_4BPP_UNORM_BLOCK_IMG:1000054003,VK_FORMAT_PVRTC1_2BPP_SRGB_BLOCK_IMG:1000054004,VK_FORMAT_PVRTC1_4BPP_SRGB_BLOCK_IMG:1000054005,VK_FORMAT_PVRTC2_2BPP_SRGB_BLOCK_IMG:1000054006,VK_FORMAT_PVRTC2_4BPP_SRGB_BLOCK_IMG:1000054007,VK_FORMAT_ASTC_4x4_SFLOAT_BLOCK_EXT:1000066e3,VK_FORMAT_ASTC_5x4_SFLOAT_BLOCK_EXT:1000066001,VK_FORMAT_ASTC_5x5_SFLOAT_BLOCK_EXT:1000066002,VK_FORMAT_ASTC_6x5_SFLOAT_BLOCK_EXT:1000066003,VK_FORMAT_ASTC_6x6_SFLOAT_BLOCK_EXT:1000066004,VK_FORMAT_ASTC_8x5_SFLOAT_BLOCK_EXT:1000066005,VK_FORMAT_ASTC_8x6_SFLOAT_BLOCK_EXT:1000066006,VK_FORMAT_ASTC_8x8_SFLOAT_BLOCK_EXT:1000066007,VK_FORMAT_ASTC_10x5_SFLOAT_BLOCK_EXT:1000066008,VK_FORMAT_ASTC_10x6_SFLOAT_BLOCK_EXT:1000066009,VK_FORMAT_ASTC_10x8_SFLOAT_BLOCK_EXT:1000066010,VK_FORMAT_ASTC_10x10_SFLOAT_BLOCK_EXT:1000066011,VK_FORMAT_ASTC_12x10_SFLOAT_BLOCK_EXT:1000066012,VK_FORMAT_ASTC_12x12_SFLOAT_BLOCK_EXT:1000066013,VK_FORMAT_G8B8G8R8_422_UNORM_KHR:1000156e3,VK_FORMAT_B8G8R8G8_422_UNORM_KHR:1000156001,VK_FORMAT_G8_B8_R8_3PLANE_420_UNORM_KHR:1000156002,VK_FORMAT_G8_B8R8_2PLANE_420_UNORM_KHR:1000156003,VK_FORMAT_G8_B8_R8_3PLANE_422_UNORM_KHR:1000156004,VK_FORMAT_G8_B8R8_2PLANE_422_UNORM_KHR:1000156005,VK_FORMAT_G8_B8_R8_3PLANE_444_UNORM_KHR:1000156006,VK_FORMAT_R10X6_UNORM_PACK16_KHR:1000156007,VK_FORMAT_R10X6G10X6_UNORM_2PACK16_KHR:1000156008,VK_FORMAT_R10X6G10X6B10X6A10X6_UNORM_4PACK16_KHR:1000156009,VK_FORMAT_G10X6B10X6G10X6R10X6_422_UNORM_4PACK16_KHR:1000156010,VK_FORMAT_B10X6G10X6R10X6G10X6_422_UNORM_4PACK16_KHR:1000156011,VK_FORMAT_G10X6_B10X6_R10X6_3PLANE_420_UNORM_3PACK16_KHR:1000156012,VK_FORMAT_G10X6_B10X6R10X6_2PLANE_420_UNORM_3PACK16_KHR:1000156013,VK_FORMAT_G10X6_B10X6_R10X6_3PLANE_422_UNORM_3PACK16_KHR:1000156014,VK_FORMAT_G10X6_B10X6R10X6_2PLANE_422_UNORM_3PACK16_KHR:1000156015,VK_FORMAT_G10X6_B10X6_R10X6_3PLANE_444_UNORM_3PACK16_KHR:1000156016,VK_FORMAT_R12X4_UNORM_PACK16_KHR:1000156017,VK_FORMAT_R12X4G12X4_UNORM_2PACK16_KHR:1000156018,VK_FORMAT_R12X4G12X4B12X4A12X4_UNORM_4PACK16_KHR:1000156019,VK_FORMAT_G12X4B12X4G12X4R12X4_422_UNORM_4PACK16_KHR:1000156020,VK_FORMAT_B12X4G12X4R12X4G12X4_422_UNORM_4PACK16_KHR:1000156021,VK_FORMAT_G12X4_B12X4_R12X4_3PLANE_420_UNORM_3PACK16_KHR:1000156022,VK_FORMAT_G12X4_B12X4R12X4_2PLANE_420_UNORM_3PACK16_KHR:1000156023,VK_FORMAT_G12X4_B12X4_R12X4_3PLANE_422_UNORM_3PACK16_KHR:1000156024,VK_FORMAT_G12X4_B12X4R12X4_2PLANE_422_UNORM_3PACK16_KHR:1000156025,VK_FORMAT_G12X4_B12X4_R12X4_3PLANE_444_UNORM_3PACK16_KHR:1000156026,VK_FORMAT_G16B16G16R16_422_UNORM_KHR:1000156027,VK_FORMAT_B16G16R16G16_422_UNORM_KHR:1000156028,VK_FORMAT_G16_B16_R16_3PLANE_420_UNORM_KHR:1000156029,VK_FORMAT_G16_B16R16_2PLANE_420_UNORM_KHR:1000156030,VK_FORMAT_G16_B16_R16_3PLANE_422_UNORM_KHR:1000156031,VK_FORMAT_G16_B16R16_2PLANE_422_UNORM_KHR:1000156032,VK_FORMAT_G16_B16_R16_3PLANE_444_UNORM_KHR:1000156033};Object.freeze(aNe);var Eae=aNe;var _Xo=x(T(),1);function kUt(e){switch(e){case ie.FLOAT:return"float";case ie.FLOAT_VEC2:return"vec2";case ie.FLOAT_VEC3:return"vec3";case ie.FLOAT_VEC4:return"vec4";case ie.FLOAT_MAT2:return"mat2";case ie.FLOAT_MAT3:return"mat3";case ie.FLOAT_MAT4:return"mat4";case ie.SAMPLER_2D:return"sampler2D";case ie.BOOL:return"bool"}}var Aae=kUt;var ZXo=x(T(),1);function UUt(e,t,n){return function(){n.apply(e,arguments),t.apply(e,arguments)}}var LU=UUt;var EXo=x(T(),1);var DUt=new h(1,1,1);function Gae(e){e=e??DUt,this._dimensions=h.clone(e)}Object.defineProperties(Gae.prototype,{dimensions:{get:function(){return this._dimensions},set:function(e){h.clone(e,this._dimensions)}}});var OUt=new h;Gae.prototype.emit=function(e){let t=this._dimensions,n=h.multiplyByScalar(t,.5,OUt),i=W.randomBetween(-n.x,n.x),o=W.randomBetween(-n.y,n.y),r=W.randomBetween(-n.z,n.z);e.position=h.fromElements(i,o,r,e.position),e.velocity=h.normalize(e.position,e.velocity)};var Lae=Gae;var wXo=x(T(),1);var Wae=0,cNe=new h,pJ=new h,BUt=new Nr;function zUt(e,t,n){let i=t.tileX,o=t.tileY,r=t.tileZ,s=n?.featureIdProperty,a=BUt.tileXYToRectangle(i,o,r),c=re.center(a),d=h.fromRadians(c.longitude,c.latitude,0),u=4294967295,m=u,p=u,b=new Map,f=new Map,y=[],_=[],S=[],Z=0;function R(){let M=(4-Z%4)%4;M>0&&(S.push(new Uint8Array(M)),Z+=M)}function C(M,O){R();let w=Z;S.push(new Uint8Array(M.buffer,M.byteOffset,M.byteLength)),Z+=M.byteLength;let z=y.length;return y.push({buffer:0,byteOffset:w,byteLength:M.byteLength,target:O}),z}function E(M,O){let w=C(M,O.target),z=St.getComponentCount(O.type),K={bufferView:w,byteOffset:0,componentType:O.componentType,count:M.length/z,type:O.type};l(O.min)&&(K.min=O.min),l(O.max)&&(K.max=O.max);let te=_.length;return _.push(K),te}function A(M){let O=Number.POSITIVE_INFINITY,w=Number.POSITIVE_INFINITY,z=Number.POSITIVE_INFINITY,K=Number.NEGATIVE_INFINITY,te=Number.NEGATIVE_INFINITY,H=Number.NEGATIVE_INFINITY;for(let $=0;$<M.length;$+=3){let ee=M[$],le=M[$+1],_e=M[$+2];ee<O&&(O=ee),le<w&&(w=le),_e<z&&(z=_e),ee>K&&(K=ee),le>te&&(te=le),_e>H&&(H=_e)}return{min:[O,w,z],max:[K,te,H]}}function L(M,O,w){if(w.length===0)return;let z=new Uint32Array(w),K=E(z,{type:"SCALAR",componentType:J.UNSIGNED_INT,target:ie.ARRAY_BUFFER});M._FEATURE_ID_0=K;let te={featureCount:b.size,nullFeatureId:m,attribute:0};f.size>0&&(te.propertyTable=0),O.EXT_mesh_features={featureIds:[te]}}function F(M,O){O=O??4;let w=(O-Z%O)%O;w>0&&(S.push(new Uint8Array(w)),Z+=w);let z=Z;S.push(M),Z+=M.byteLength;let K=y.length;return y.push({buffer:0,byteOffset:z,byteLength:M.byteLength}),K}function I(){if(f.size===0)return;let M=new Map;for(let K of f.values())for(let[te,H]of Object.entries(K)){if(!l(H))continue;let $=typeof H,ee;$==="string"?ee="STRING":$==="number"?ee="SCALAR":$==="boolean"?ee="BOOLEAN":ee="STRING";let le=M.get(te);l(le)?le!==ee&&M.set(te,"STRING"):M.set(te,ee)}if(M.size===0)return;let O={};for(let[K,te]of M)te==="SCALAR"?O[K]={type:"SCALAR",componentType:"FLOAT64"}:te==="BOOLEAN"?O[K]={type:"BOOLEAN"}:O[K]={type:"STRING"};let w={},z=b.size;for(let[K,te]of M)if(te==="SCALAR"){let H=new Float64Array(z);for(let ee=0;ee<z;ee++){let _e=f.get(ee)?.[K];H[ee]=typeof _e=="number"&&Number.isFinite(_e)?_e:NaN}let $=F(new Uint8Array(H.buffer,H.byteOffset,H.byteLength),8);w[K]={values:$}}else if(te==="BOOLEAN"){let H=Math.ceil(z/8),$=new Uint8Array(H);for(let le=0;le<z;le++)f.get(le)?.[K]&&($[le>>3]|=1<<(le&7));let ee=F($);w[K]={values:ee}}else{let H=new TextEncoder,$=[],ee=new Uint32Array(z+1),le=0;for(let Ge=0;Ge<z;Ge++){ee[Ge]=le;let Fe=f.get(Ge)?.[K],tt;Fe==null?tt="":typeof Fe=="string"?tt=Fe:tt=String(Fe);let Be=H.encode(tt);$.push(Be),le+=Be.byteLength}ee[z]=le;let _e=new Uint8Array(le),he=0;for(let Ge of $)_e.set(Ge,he),he+=Ge.byteLength;let Ze=F(_e),ye=F(new Uint8Array(ee.buffer,ee.byteOffset,ee.byteLength));w[K]={values:Ze,stringOffsets:ye,stringOffsetType:"UINT32"}}return{schema:{classes:{mvt_feature:{properties:O}}},propertyTables:[{class:"mvt_feature",count:z,properties:w}]}}let N=[],g=[],V=[d.x,d.y,d.z];for(let M of e.layers){let O=M.extent,w=[],z=[],K=[],te=[],H=[],$=0,ee=[],le=[],_e=[],he=[],Ze=[],ye=[],Ge=[],Ae=0;for(let Be of M.features){let je=l(s)?KUt(Be,s,b)??m:HUt(Be,b);if(je!==m&&!f.has(je)){let qe=Object.assign({},Be.properties);qe._layer=M.name??"",f.set(je,qe)}if(Be.type==="Point"){let qe=Be.geometry;for(let We of qe)vae(We,i,o,r,O,Wae,d,w),z.push(je);continue}if(Be.type==="LineString"){let qe=Be.geometry;for(let We of qe){let Ke=K.length/3;for(let ct of We)vae(ct,i,o,r,O,Wae,d,K),te.push(je);for(let ct=0;ct<We.length;ct++)H.push(Ke+ct);H.push(p),$++}continue}if(Be.type==="Polygon"){let qe=Be.geometry,We=JUt(qe);for(let Ke of We){let ct=[Ke.outerRing,...Ke.holes],Et=[],zt=[],ut=[],bt=0;for(let pt=0;pt<ct.length;pt++){let Mi=ct[pt];pt>0&&ut.push(bt);for(let jn of Mi)Et.push(new k(jn.x,jn.y)),vae(jn,i,o,r,O,Wae,d,zt),bt++}if(Et.length<3)continue;let ht=hi.triangulate(Et,ut.length>0?ut:void 0);if(!l(ht)||ht.length===0){xt("buildVectorGltfFromMVT-triangulation-failed","Polygon triangulation failed; skipping polygon.");continue}let jt=ee.length/3,st=_e.length;he.push(jt),Ze.push(st),ye.push(ut.length);for(let pt=0;pt<ut.length;pt++)Ge.push(jt+ut[pt]);for(let pt=0;pt<zt.length;pt++)ee.push(zt[pt]);for(let pt=0;pt<zt.length/3;pt++)le.push(je);for(let pt=0;pt<ht.length;pt++)_e.push(ht[pt]+jt);Ae++}}}if(w.length===0&&K.length===0&&ee.length===0)continue;H.length>0&&H[H.length-1]===p&&H.pop();let Fe=[];if(w.length>0){let Be=new Float32Array(w),je=A(Be),We={POSITION:E(Be,{type:"VEC3",componentType:J.FLOAT,target:ie.ARRAY_BUFFER,min:je.min,max:je.max})},Ke={CESIUM_mesh_vector:{vector:!0,count:Be.length/3}};L(We,Ke,z),Fe.push({mode:Ie.POINTS,attributes:We,extensions:Ke})}if(K.length>0&&H.length>1){let Be=new Float32Array(K),je=new Uint32Array(H),qe=A(Be),We=E(Be,{type:"VEC3",componentType:J.FLOAT,target:ie.ARRAY_BUFFER,min:qe.min,max:qe.max}),Ke=E(je,{type:"SCALAR",componentType:J.UNSIGNED_INT,target:ie.ELEMENT_ARRAY_BUFFER}),ct={POSITION:We},Et={CESIUM_mesh_vector:{vector:!0,count:$}};L(ct,Et,te),Fe.push({mode:Ie.LINE_STRIP,indices:Ke,attributes:ct,extensions:Et})}if(ee.length>0&&_e.length>=3){let Be=new Float32Array(ee),je=new Uint32Array(_e),qe=new Uint32Array(he),We=new Uint32Array(Ze),Ke=Ge.length>0,ct=Ke?new Uint32Array(ye):void 0,Et=Ke?new Uint32Array(Ge):void 0,zt=A(Be),ut=E(Be,{type:"VEC3",componentType:J.FLOAT,target:ie.ARRAY_BUFFER,min:zt.min,max:zt.max}),bt=E(je,{type:"SCALAR",componentType:J.UNSIGNED_INT,target:ie.ELEMENT_ARRAY_BUFFER}),ht=E(qe,{type:"SCALAR",componentType:J.UNSIGNED_INT,target:ie.ARRAY_BUFFER}),jt=E(We,{type:"SCALAR",componentType:J.UNSIGNED_INT,target:ie.ARRAY_BUFFER}),st=l(ct)?E(ct,{type:"SCALAR",componentType:J.UNSIGNED_INT,target:ie.ARRAY_BUFFER}):void 0,pt=l(Et)?E(Et,{type:"SCALAR",componentType:J.UNSIGNED_INT,target:ie.ARRAY_BUFFER}):void 0,Mi={POSITION:ut},jn={CESIUM_mesh_vector:{vector:!0,count:Ae,polygonAttributeOffsets:ht,polygonIndicesOffsets:jt}};Ke&&(jn.CESIUM_mesh_vector.polygonHoleCounts=st,jn.CESIUM_mesh_vector.polygonHoleOffsets=pt),L(Mi,jn,le),Fe.push({mode:Ie.TRIANGLES,indices:bt,attributes:Mi,extensions:jn})}if(Fe.length===0)continue;let tt=N.length;N.push({primitives:Fe}),g.push({name:M.name,mesh:tt,translation:V})}if(g.length===0)return;let G=I(),v=$Ut(S,Z),X=["CESIUM_mesh_vector"];b.size>0&&X.push("EXT_mesh_features"),l(G)&&X.push("EXT_structural_metadata");let Y=g.map((M,O)=>O),D={asset:{version:"2.0"},extensionsUsed:X,scene:0,scenes:[{nodes:Y}],nodes:g,meshes:N,accessors:_,bufferViews:y,buffers:[{byteLength:v.byteLength}],extensions:void 0};return l(G)&&(D.extensions={EXT_structural_metadata:G}),qUt(D,v)}function HUt(e,t){let n=t.get(e);return l(n)||(n=t.size,t.set(e,n)),n}function KUt(e,t,n){let i=e.properties;if(!l(i))return;let o=i[t];if(!l(o)||typeof o!="string"&&typeof o!="number"&&typeof o!="boolean"||typeof o=="number"&&!Number.isFinite(o))return;let r=`${typeof o}:${o}`,s=n.get(r);return l(s)||(s=n.size,n.set(r,s)),s}function JUt(e){let t=[];for(let n of e){let i=QUt(n);if(i.length<3)continue;jUt(i)<=0?t.push({outerRing:i,holes:[]}):t.length>0&&t[t.length-1].holes.push(i)}return t}function jUt(e){let t=0;for(let n=0,i=e.length-1;n<e.length;i=n++)t+=(e[i].x+e[n].x)*(e[i].y-e[n].y);return t/2}function QUt(e){return e.length>1&&e[0].x===e[e.length-1].x&&e[0].y===e[e.length-1].y?e.slice(0,e.length-1):e}function vae(e,t,n,i,o,r,s,a){let c=1<<i,d=(t+e.x/o)/c,u=(n+e.y/o)/c,m=d*2*Math.PI-Math.PI,p=Math.atan(Math.sinh(Math.PI*(1-2*u)));h.fromRadians(m,p,r,void 0,cNe),h.subtract(cNe,s,pJ),a.push(pJ.x,pJ.y,pJ.z)}function qUt(e,t){let s=new TextEncoder().encode(JSON.stringify(e)),a=Math.ceil(s.length/4)*4,c=new Uint8Array(a);c.fill(32),c.set(s);let d=Math.ceil(t.byteLength/4)*4,u=new Uint8Array(d);u.set(t);let m=20+a+8+d,p=new Uint8Array(m),b=new DataView(p.buffer),f=0;return b.setUint32(f,1179937895,!0),f+=4,b.setUint32(f,2,!0),f+=4,b.setUint32(f,m,!0),f+=4,b.setUint32(f,a,!0),f+=4,b.setUint32(f,1313821514,!0),f+=4,p.set(c,f),f+=a,b.setUint32(f,d,!0),f+=4,b.setUint32(f,5130562,!0),f+=4,p.set(u,f),p}function $Ut(e,t){let n=new Uint8Array(t),i=0;for(let o of e)n.set(o,i),i+=o.byteLength;return n}var WU=zUt;var DXo=x(T(),1);var Fae=class{constructor(){mt(this,"featuresLength");mt(this,"pointsLength");mt(this,"trianglesLength");mt(this,"geometryByteLength");mt(this,"texturesByteLength");mt(this,"batchTableByteLength");mt(this,"innerContents");mt(this,"ready");mt(this,"tileset");mt(this,"tile");mt(this,"url");mt(this,"batchTable");mt(this,"metadata");mt(this,"group");this.featurePropertiesDirty=!1}hasProperty(t,n){ge.throwInstantiationError()}getFeature(t){ge.throwInstantiationError()}applyDebugSettings(t,n){ge.throwInstantiationError()}applyStyle(t){ge.throwInstantiationError()}update(t,n){ge.throwInstantiationError()}pick(t,n,i){ge.throwInstantiationError()}isDestroyed(){ge.throwInstantiationError()}destroy(){ge.throwInstantiationError()}},Iae=Fae;var TNo=x(T(),1);var KXo=x(T(),1);function vU(e){e=e??B.EMPTY_OBJECT,this._maximumSubtreeCount=e.maximumSubtreeCount??0,this._subtreeRequestCounter=0,this._queue=new Bg({comparator:vU.comparator})}vU.prototype.addSubtree=function(e){let t=new e5t(e,this._subtreeRequestCounter);this._subtreeRequestCounter++,this._queue.insert(t);let n=e.implicitCoordinates;if(n.level>0){let i=n.getParentSubtreeCoordinates(),o=this.find(i)}if(this._maximumSubtreeCount>0)for(;this._queue.length>this._maximumSubtreeCount&&this._queue.getMinimum()!==t;)this._queue.removeMinimum()};vU.prototype.find=function(e){let t=this._queue,n=t.internalArray,i=t.length;for(let o=0;o<i;o++){let r=n[o],a=r.subtree.implicitCoordinates;if(e.isEqual(a))return r.subtree}};vU.comparator=function(e,t){let n=e.subtree.implicitCoordinates,i=t.subtree.implicitCoordinates;return n.isAncestor(i)?1:i.isAncestor(n)?-1:e.stamp-t.stamp};function e5t(e,t){this.subtree=e,this.stamp=t}var FU=vU;function IU(e){e=e??B.EMPTY_OBJECT;let{className:t,names:n,types:i,componentTypes:o,shape:r,dimensions:s,paddingBefore:a=h.ZERO.clone(),paddingAfter:c=h.ZERO.clone(),globalTransform:d=P.IDENTITY.clone(),shapeTransform:u=P.IDENTITY.clone(),minBounds:m,maxBounds:p,minimumValues:b,maximumValues:f,maximumTileCount:y}=e;this._shapeTransform=u,this._globalTransform=d,this._shape=r,this._minBounds=m,this._maxBounds=p,this._dimensions=s,this._paddingBefore=a,this._paddingAfter=c,this._className=t,this._names=n,this._types=i,this._componentTypes=o,this._metadataOrder=r===Tc.ELLIPSOID?V0.Z_UP:V0.Y_UP,this._minimumValues=b,this._maximumValues=f,this._maximumTileCount=y,this._availableLevels=void 0,this._implicitTileset=void 0,this._subtreeCache=new FU}Object.defineProperties(IU.prototype,{globalTransform:{get:function(){return this._globalTransform}},shapeTransform:{get:function(){return this._shapeTransform}},shape:{get:function(){return this._shape}},minBounds:{get:function(){return this._minBounds}},maxBounds:{get:function(){return this._maxBounds}},dimensions:{get:function(){return this._dimensions}},paddingBefore:{get:function(){return this._paddingBefore}},paddingAfter:{get:function(){return this._paddingAfter}},className:{get:function(){return this._className}},names:{get:function(){return this._names}},types:{get:function(){return this._types}},componentTypes:{get:function(){return this._componentTypes}},metadataOrder:{get:function(){return this._metadataOrder}},minimumValues:{get:function(){return this._minimumValues}},maximumValues:{get:function(){return this._maximumValues}},maximumTileCount:{get:function(){return this._maximumTileCount}},availableLevels:{get:function(){return this._availableLevels}}});IU.fromUrl=async function(e){let t=ve.createIfNeeded(e),n=await t.fetchJson();n5t(n);let i=l5t(n,t);await i.load();let{root:o}=n,r=ro(n,"3DTILES_metadata")?n.extensions["3DTILES_metadata"]:n,s=new dZ({metadataJson:r,schema:i.schema}),a=o.content.extensions["3DTILES_content_voxels"],c=a.class,d=d5t(s,c);Object.assign(d,i5t(o)),l(o.transform)?d.globalTransform=P.unpack(o.transform):d.globalTransform=P.clone(P.IDENTITY),d.dimensions=h.unpack(a.dimensions),d.maximumTileCount=t5t(s),l(a.padding)&&(d.paddingBefore=h.unpack(a.padding.before),d.paddingAfter=h.unpack(a.padding.after));let u=new IU(d),m=new s0(t,o,i.schema);return u._implicitTileset=m,u._availableLevels=m.availableLevels,Yi.unload(i),u};function t5t(e){if(l(e.tileset))return e.tileset.getPropertyBySemantic(eh.TILESET_TILE_COUNT)}function n5t(e){let t=e.root;if(!l(t.content))throw new ae("Root must have content");if(!ro(t.content,"3DTILES_content_voxels"))throw new ae("Root tile content must have 3DTILES_content_voxels extension");if(!ro(t,"3DTILES_implicit_tiling")&&!l(t.implicitTiling))throw new ae("Root tile must have implicit tiling");if(!l(e.schema)&&!l(e.schemaUri)&&!ro(e,"3DTILES_metadata"))throw new ae("Tileset must have a metadata schema")}function i5t(e){let t=e.boundingVolume;if(l(t.box))return a5t(t.box);if(l(t.region))return o5t(t.region);if(ro(t,"3DTILES_bounding_volume_cylinder"))return c5t(t.extensions["3DTILES_bounding_volume_cylinder"]);throw new ae("Only box, region and 3DTILES_bounding_volume_cylinder are supported in Cesium3DTilesVoxelProvider")}function o5t(e){let t=e[0],n=e[1],i=e[2],o=e[3],r=e[4],s=e[5],a=P.fromScale(ne.WGS84.radii),c=new h(t,n,r),d=new h(i,o,s);return{shape:Tc.ELLIPSOID,minBounds:c,maxBounds:d,shapeTransform:a}}var r5t=new h,s5t=new q;function a5t(e){let t=nn.unpack(e),n=q.getScale(t.halfAxes,r5t),i=q.getRotation(t.halfAxes,s5t);return{shape:Tc.BOX,minBounds:h.negate(n,new h),maxBounds:h.clone(n),shapeTransform:P.fromRotationTranslation(i,t.center)}}function c5t(e){let{minRadius:t,maxRadius:n,height:i,minAngle:o=-W.PI,maxAngle:r=W.PI,translation:s=[0,0,0],rotation:a=[0,0,0,1]}=e,c=-.5*i+s[2],d=.5*i+s[2],u=P.fromTranslationQuaternionRotationScale(h.unpack(s),Ne.unpack(a),h.ONE);return{shape:Tc.CYLINDER,minBounds:h.fromElements(t,o,c),maxBounds:h.fromElements(n,r,d),shapeTransform:u}}function l5t(e,t){let{schemaUri:n,schema:i}=e;return l(n)?Yi.getSchemaLoader({resource:t.getDerivedResource({url:n})}):Yi.getSchemaLoader({schema:i})}function d5t(e,t){let{schema:n,statistics:i}=e,o=i?.classes[t],r=n.classes[t].properties,s=Object.entries(r).map(([b,f])=>{let{type:y,componentType:_}=f,S=o?.properties[b].min,Z=o?.properties[b].max,R=St.getComponentCount(y),C=lNe(S,R),E=lNe(Z,R);return{id:b,type:y,componentType:_,minValue:C,maxValue:E}}),a=s.map(b=>b.id),c=s.map(b=>b.type),d=s.map(b=>b.componentType),u=s.map(b=>b.minValue),m=s.map(b=>b.maxValue),p=u.some(l);return{className:t,names:a,types:c,componentTypes:d,minimumValues:p?u:void 0,maximumValues:p?m:void 0}}function lNe(e,t){if(!l(e))return;let n=Array.isArray(e)?e:[e];return Array.from({length:t},(i,o)=>n[o])}async function u5t(e,t){let n=e._implicitTileset,i=e._subtreeCache,o=i.find(t);if(l(o))return o;let r=n.subtreeUriTemplate.getDerivedResource({templateValues:t.getTemplateValues()}),s=n.baseResource.getDerivedResource({url:r.url}),a=await s.fetchArrayBuffer();if(o=i.find(t),l(o))return o;let c=_g(a);return o=await ug.fromSubtreeJson(s,c.jsonPayload,c.binaryPayload,n,t),i.addSubtree(o),o}IU.prototype.requestData=async function(e){e=e??B.EMPTY_OBJECT;let{tileLevel:t=0,tileX:n=0,tileY:i=0,tileZ:o=0,keyframe:r=0}=e;if(r!==0)return Promise.reject("3D Tiles currently doesn't support time-dynamic data.");let s=this._implicitTileset,a=new a0({subdivisionScheme:s.subdivisionScheme,subtreeLevels:s.subtreeLevels,level:t,x:n,y:i,z:o}),c=a.isSubtreeRoot()&&a.level>0,d=c?a.getParentSubtreeCoordinates():a.getSubtreeCoordinates(),m=await u5t(this,d);if(!(c?m.childSubtreeIsAvailableAtCoordinates:m.tileIsAvailableAtCoordinates).call(m,a))return Promise.reject(`Tile is not available at level ${t}, x ${n}, y ${i}, z ${o}.`);let{contentUriTemplates:f,baseResource:y}=s,_=f[0].getDerivedResource({templateValues:a.getTemplateValues()}),S=y.getDerivedResource({url:_.url});return OZ.fromGltf(S)};var Pae=IU;var RNo=x(T(),1);function Xae(e){e=e??1,this._radius=e??1}Object.defineProperties(Xae.prototype,{radius:{get:function(){return this._radius},set:function(e){this._radius=e}}});Xae.prototype.emit=function(e){let t=W.randomBetween(0,W.TWO_PI),n=W.randomBetween(0,this._radius),i=n*Math.cos(t),o=n*Math.sin(t),r=0;e.position=h.fromElements(i,o,r,e.position),e.velocity=h.clone(h.UNIT_Z,e.velocity)};var PU=Xae;var fYo=x(T(),1);var VNo=x(T(),1),bJ={CUMULUS:0};bJ.validate=function(e){return e===bJ.CUMULUS};Object.freeze(bJ);var LA=bJ;var FNo=x(T(),1);function cp(e,t){if(e=e??B.EMPTY_OBJECT,this._show=e.show??!0,this._position=h.clone(e.position??h.ZERO),!l(e.scale)&&l(e.maximumSize))this._maximumSize=h.clone(e.maximumSize),this._scale=new k(this._maximumSize.x,this._maximumSize.y);else{this._scale=k.clone(e.scale??new k(20,12));let n=new h(this._scale.x,this._scale.y,Math.min(this._scale.x,this._scale.y)/1.5);this._maximumSize=h.clone(e.maximumSize??n)}this._slice=e.slice??-1,this._color=U.clone(e.color??U.WHITE),this._brightness=e.brightness??1,this._cloudCollection=t,this._index=-1}var m5t=cp.SHOW_INDEX=0,h5t=cp.POSITION_INDEX=1,f5t=cp.SCALE_INDEX=2,p5t=cp.MAXIMUM_SIZE_INDEX=3,b5t=cp.SLICE_INDEX=4,g5t=cp.BRIGHTNESS_INDEX=5,y5t=cp.COLOR_INDEX=6;cp.NUMBER_OF_PROPERTIES=7;function XR(e,t){let n=e._cloudCollection;l(n)&&(n._updateCloud(e,t),e._dirty=!0)}Object.defineProperties(cp.prototype,{show:{get:function(){return this._show},set:function(e){this._show!==e&&(this._show=e,XR(this,m5t))}},position:{get:function(){return this._position},set:function(e){let t=this._position;h.equals(t,e)||(h.clone(e,t),XR(this,h5t))}},scale:{get:function(){return this._scale},set:function(e){let t=this._scale;k.equals(t,e)||(k.clone(e,t),XR(this,f5t))}},maximumSize:{get:function(){return this._maximumSize},set:function(e){let t=this._maximumSize;h.equals(t,e)||(h.clone(e,t),XR(this,p5t))}},color:{get:function(){return this._color},set:function(e){let t=this._color;U.equals(t,e)||(U.clone(e,t),XR(this,y5t))}},slice:{get:function(){return this._slice},set:function(e){this._slice!==e&&(this._slice=e,XR(this,b5t))}},brightness:{get:function(){return this._brightness},set:function(e){this._brightness!==e&&(this._brightness=e,XR(this,g5t))}}});cp.prototype._destroy=function(){this._cloudCollection=void 0};var hm=cp;var fm,gJ=new h,x5t={positionHighAndScaleX:0,positionLowAndScaleY:1,packedAttribute0:2,packedAttribute1:3,color:4},T5t={direction:0,positionHighAndScaleX:1,positionLowAndScaleY:2,packedAttribute0:3,packedAttribute1:4,color:5},_5t=hm.SHOW_INDEX,S5t=hm.POSITION_INDEX,Z5t=hm.SCALE_INDEX,R5t=hm.MAXIMUM_SIZE_INDEX,C5t=hm.SLICE_INDEX,V5t=hm.BRIGHTNESS_INDEX,E5t=hm.NUMBER_OF_PROPERTIES,A5t=hm.COLOR_INDEX;function lp(e){e=e??B.EMPTY_OBJECT,this._clouds=[],this._cloudsToUpdate=[],this._cloudsToUpdateIndex=0,this._cloudsRemoved=!1,this._createVertexArray=!1,this._propertiesChanged=new Uint32Array(E5t),this._noiseTexture=void 0,this._textureSliceWidth=128,this._noiseTextureRows=4,this.noiseDetail=e.noiseDetail??16,this.noiseOffset=h.clone(e.noiseOffset??h.ZERO),this._loading=!1,this._ready=!1;let t=this;this._uniforms={u_noiseTexture:function(){return t._noiseTexture},u_noiseTextureDimensions:dNe(t),u_noiseDetail:function(){return t.noiseDetail}},this._vaNoise=void 0,this._spNoise=void 0,this._spCreated=!1,this._sp=void 0,this._rs=void 0,this.show=e.show??!0,this._colorCommands=[],this.debugBillboards=e.debugBillboards??!1,this._compiledDebugBillboards=!1,this.debugEllipsoids=e.debugEllipsoids??!1,this._compiledDebugEllipsoids=!1}function dNe(e){return function(){return gJ.x=e._textureSliceWidth,gJ.y=e._noiseTextureRows,gJ.z=1/e._noiseTextureRows,gJ}}Object.defineProperties(lp.prototype,{length:{get:function(){return Yae(this),this._clouds.length}}});function uNe(e){let t=e.length;for(let n=0;n<t;++n)e[n]&&e[n]._destroy()}lp.prototype.add=function(e){e=e??B.EMPTY_OBJECT;let t=e.cloudType??LA.CUMULUS,n;return t===LA.CUMULUS&&(n=new hm(e,this),n._index=this._clouds.length,this._clouds.push(n),this._createVertexArray=!0),n};lp.prototype.remove=function(e){return this.contains(e)?(this._clouds[e._index]=void 0,this._cloudsRemoved=!0,this._createVertexArray=!0,e._destroy(),!0):!1};lp.prototype.removeAll=function(){uNe(this._clouds),this._clouds=[],this._cloudsToUpdate=[],this._cloudsToUpdateIndex=0,this._cloudsRemoved=!1,this._createVertexArray=!0};function Yae(e){if(e._cloudsRemoved){e._cloudsRemoved=!1;let t=[],n=e._clouds,i=n.length;for(let o=0,r=0;o<i;++o){let s=n[o];l(s)&&(n._index=r++,t.push(s))}e._clouds=t}}lp.prototype._updateCloud=function(e,t){e._dirty||(this._cloudsToUpdate[this._cloudsToUpdateIndex++]=e),++this._propertiesChanged[t]};lp.prototype.contains=function(e){return l(e)&&e._cloudCollection===this};lp.prototype.get=function(e){return Yae(this),this._clouds[e]};var G5t=new Float32Array([-1,-1,1,-1,1,1,-1,1]),L5t=new Uint16Array([0,1,2,0,2,3]);function W5t(e){let t=it.createVertexBuffer({context:e,typedArray:G5t,usage:Pe.STATIC_DRAW}),n=it.createIndexBuffer({context:e,typedArray:L5t,usage:Pe.STATIC_DRAW,indexDatatype:Oe.UNSIGNED_SHORT}),i=[{index:0,vertexBuffer:t,componentsPerAttribute:2,componentDatatype:J.FLOAT}];return new Un({context:e,attributes:i,indexBuffer:n})}var Mae;function v5t(e){let n=e.cache.cloudCollection_indexBufferBatched;if(l(n))return n;let i=16384*6-6,o=new Uint16Array(i);for(let r=0,s=0;r<i;r+=6,s+=4)o[r]=s,o[r+1]=s+1,o[r+2]=s+2,o[r+3]=s,o[r+4]=s+2,o[r+5]=s+3;return n=it.createIndexBuffer({context:e,typedArray:o,usage:Pe.STATIC_DRAW,indexDatatype:Oe.UNSIGNED_SHORT}),n.vertexArrayDestroyable=!1,e.cache.cloudCollection_indexBufferBatched=n,n}function F5t(e){let t=e.cache.cloudCollection_indexBufferInstanced;return l(t)||(t=it.createIndexBuffer({context:e,typedArray:new Uint16Array([0,1,2,0,2,3]),usage:Pe.STATIC_DRAW,indexDatatype:Oe.UNSIGNED_SHORT}),t.vertexArrayDestroyable=!1,e.cache.cloudCollection_indexBufferInstanced=t),t}function I5t(e){let t=e.cache.cloudCollection_vertexBufferInstanced;return l(t)||(t=it.createVertexBuffer({context:e,typedArray:new Float32Array([0,0,1,0,1,1,0,1]),usage:Pe.STATIC_DRAW}),t.vertexArrayDestroyable=!1,e.cache.cloudCollection_vertexBufferInstanced=t),t}function P5t(e,t,n){let i=[{index:fm.positionHighAndScaleX,componentsPerAttribute:4,componentDatatype:J.FLOAT,usage:Pe.STATIC_DRAW},{index:fm.positionLowAndScaleY,componentsPerAttribute:4,componentDatatype:J.FLOAT,usage:Pe.STATIC_DRAW},{index:fm.packedAttribute0,componentsPerAttribute:4,componentDatatype:J.FLOAT,usage:Pe.STATIC_DRAW},{index:fm.packedAttribute1,componentsPerAttribute:4,componentDatatype:J.FLOAT,usage:Pe.STATIC_DRAW},{index:fm.color,componentsPerAttribute:4,componentDatatype:J.UNSIGNED_BYTE,normalize:!0,usage:Pe.STATIC_DRAW}];n&&i.push({index:fm.direction,componentsPerAttribute:2,componentDatatype:J.FLOAT,vertexBuffer:I5t(e)});let o=n?t:4*t;return new db(e,i,o,n)}var Nae=new An;function mNe(e,t,n,i){let o,r=n[fm.positionHighAndScaleX],s=n[fm.positionLowAndScaleY],a=i.position;An.fromCartesian(a,Nae);let c=i.scale,d=Nae.high,u=Nae.low;e._instanced?(o=i._index,r(o,d.x,d.y,d.z,c.x),s(o,u.x,u.y,u.z,c.y)):(o=i._index*4,r(o+0,d.x,d.y,d.z,c.x),r(o+1,d.x,d.y,d.z,c.x),r(o+2,d.x,d.y,d.z,c.x),r(o+3,d.x,d.y,d.z,c.x),s(o+0,u.x,u.y,u.z,c.y),s(o+1,u.x,u.y,u.z,c.y),s(o+2,u.x,u.y,u.z,c.y),s(o+3,u.x,u.y,u.z,c.y))}function hNe(e,t,n,i){let o,r=n[fm.packedAttribute0],s=i.show,a=i.brightness;e._instanced?(o=i._index,r(o,s,a,0,0)):(o=i._index*4,r(o+0,s,a,0,0),r(o+1,s,a,1,0),r(o+2,s,a,1,1),r(o+3,s,a,0,1))}function fNe(e,t,n,i){let o,r=n[fm.packedAttribute1],s=i.maximumSize,a=i.slice;e._instanced?(o=i._index,r(o,s.x,s.y,s.z,a)):(o=i._index*4,r(o+0,s.x,s.y,s.z,a),r(o+1,s.x,s.y,s.z,a),r(o+2,s.x,s.y,s.z,a),r(o+3,s.x,s.y,s.z,a))}function pNe(e,t,n,i){let o,r=n[fm.color],s=i.color,a=U.floatToByte(s.red),c=U.floatToByte(s.green),d=U.floatToByte(s.blue),u=U.floatToByte(s.alpha);e._instanced?(o=i._index,r(o,a,c,d,u)):(o=i._index*4,r(o+0,a,c,d,u),r(o+1,a,c,d,u),r(o+2,a,c,d,u),r(o+3,a,c,d,u))}function X5t(e,t,n,i){mNe(e,t,n,i),hNe(e,t,n,i),fNe(e,t,n,i),pNe(e,t,n,i)}function N5t(e,t,n,i){let o=e,r=o._textureSliceWidth,s=o._noiseTextureRows,a=t.context;o._vaNoise=W5t(a),o._spNoise=tn.fromCache({context:a,vertexShaderSource:n,fragmentShaderSource:i,attributeLocations:{position:0}});let c=o.noiseDetail,d=o.noiseOffset;o._noiseTexture=new vt({context:a,width:r*r/s,height:r*s,pixelDatatype:Ue.UNSIGNED_BYTE,pixelFormat:Qe.RGBA,sampler:new Ot({wrapS:pn.REPEAT,wrapT:pn.REPEAT,minificationFilter:Ht.NEAREST,magnificationFilter:$n.NEAREST})});let u=new bu({vertexArray:o._vaNoise,shaderProgram:o._spNoise,outputTexture:o._noiseTexture,uniformMap:{u_noiseTextureDimensions:dNe(o),u_noiseDetail:function(){return c},u_noiseOffset:function(){return d}},persists:!1,owner:e,postExecute:function(m){o._ready=!0,o._loading=!1}});t.commandList.push(u),o._loading=!0}function Y5t(e,t){let n=e,i=t.context;n._createVertexArray=!1,n._vaf=n._vaf&&n._vaf.destroy();let o=e._clouds,r=o.length;if(r>0){n._vaf=P5t(i,r,n._instanced);let s=n._vaf.writers,a;for(a=0;a<r;++a){let c=o[a];X5t(e,t,s,c)}n._vaf.commit(Mae(i))}}var M5t=[];function w5t(e,t){let n=t.context,i=e,r=i._clouds.length,s=i._cloudsToUpdate,a=i._cloudsToUpdateIndex,c=i._propertiesChanged,d=M5t;d.length=0,(c[S5t]||c[Z5t])&&d.push(mNe),(c[_5t]||c[V5t])&&d.push(hNe),(c[R5t]||c[C5t])&&d.push(fNe),c[A5t]&&d.push(pNe);let u=d.length,m=i._vaf.writers,p,b,f;if(a/r>.1){for(p=0;p<a;++p)for(b=s[p],b._dirty=!1,f=0;f<u;++f)d[f](e,t,m,b);i._vaf.commit(Mae(n))}else{for(p=0;p<a;++p){for(b=s[p],b._dirty=!1,f=0;f<u;++f)d[f](e,t,m,b);i._instanced?i._vaf.subCommit(b._index,1):i._vaf.subCommit(b._index*4,4)}i._vaf.endSubCommits()}i._cloudsToUpdateIndex=0}function k5t(e,t,n,i){let o=t.context,r=e,s=new Je({defines:[],sources:[n]});r._instanced&&s.defines.push("INSTANCED");let a=new Je({defines:[],sources:[i]});r.debugBillboards&&a.defines.push("DEBUG_BILLBOARDS"),r.debugEllipsoids&&a.defines.push("DEBUG_ELLIPSOIDS"),r._sp=tn.replaceCache({context:o,shaderProgram:r._sp,vertexShaderSource:s,fragmentShaderSource:a,attributeLocations:fm}),r._rs=ze.fromCache({depthTest:{enabled:!0,func:ie.LESS},depthMask:!1,blending:on.ALPHA_BLEND}),r._spCreated=!0,r._compiledDebugBillboards=r.debugBillboards,r._compiledDebugEllipsoids=r.debugEllipsoids}function U5t(e,t){let n=e,i=t.passes,o=n._uniforms,r=t.commandList;if(i.render){let s=n._colorCommands,a=n._vaf.va,c=a.length;s.length=c;for(let d=0;d<c;d++){let u=s[d];l(u)||(u=s[d]=new lt),u.pass=Le.TRANSLUCENT,u.owner=e,u.uniformMap=o,u.count=a[d].indicesCount,u.vertexArray=a[d].va,u.shaderProgram=n._sp,u.renderState=n._rs,n._instanced&&(u.count=6,u.instanceCount=n._clouds.length),r.push(u)}}}lp.prototype.update=function(e){if(Yae(this),!this.show)return;let t=this.debugBillboards||this.debugEllipsoids;this._ready=t?!0:l(this._noiseTexture),!this._ready&&!this._loading&&!t&&N5t(this,e,Xv,Pv),this._instanced=e.context.instancedArrays,fm=this._instanced?T5t:x5t,Mae=this._instanced?F5t:v5t;let i=this._clouds.length,o=this._cloudsToUpdate,r=this._cloudsToUpdateIndex;this._createVertexArray?Y5t(this,e):r>0&&w5t(this,e),r>i*1.5&&(o.length=i),!(!l(this._vaf)||!l(this._vaf.va)||!this._ready&!t)&&((!this._spCreated||this.debugBillboards!==this._compiledDebugBillboards||this.debugEllipsoids!==this._compiledDebugEllipsoids)&&k5t(this,e,Iv,Fv),U5t(this,e))};lp.prototype.isDestroyed=function(){return!1};lp.prototype.destroy=function(){return this._noiseTexture=this._noiseTexture&&this._noiseTexture.destroy(),this._sp=this._sp&&this._sp.destroy(),this._vaf=this._vaf&&this._vaf.destroy(),uNe(this._clouds),ue(this)};var wae=lp;var yYo=x(T(),1);var D5t=W.toRadians(30);function kae(e){this._angle=e??D5t}Object.defineProperties(kae.prototype,{angle:{get:function(){return this._angle},set:function(e){this._angle=e}}});kae.prototype.emit=function(e){let t=Math.tan(this._angle),n=W.randomBetween(0,W.TWO_PI),i=W.randomBetween(0,t),o=i*Math.cos(n),r=i*Math.sin(n),s=1;e.velocity=h.fromElements(o,r,s,e.velocity),h.normalize(e.velocity,e.velocity),e.position=h.clone(h.ZERO,e.position)};var Uae=kae;var IYo=x(T(),1);var O5t=new U,B5t=new U,z5t=new U,H5t=new U,bNe=new ce,XU=new Uint8Array(4);function gNe(e,t,n,i){let o=t.height===n.height?0:(e-t.height)/(n.height-t.height);return U.lerp(t.color,n.color,o,i)}function yJ(e,t){return{height:e,color:U.clone(t)}}function yNe(e){return e=e.filter(function(t,n,i){let o=n>0,r=n<i.length-1,s=o?t.height===i[n-1].height:!0,a=r?t.height===i[n+1].height:!0;return!s||!a}),e=e.filter(function(t,n,i){let o=n>0,r=n<i.length-1,s=o?U.equals(t.color,i[n-1].color):!1,a=r?U.equals(t.color,i[n+1].color):!1;return!s||!a}),e=e.filter(function(t,n,i){let o=n>0,r=o?U.equals(t.color,i[n-1].color):!1,s=o?t.height===i[n-1].height:!0;return!r||!s}),e}function K5t(e){let t,n,i=[],o=e.length;for(t=0;t<o;t++){let r=e[t],s=r.entries,a=s.length,c=[];for(n=0;n<a;n++){let b=s[n],f=W.clamp(b.height,du._minimumHeight,du._maximumHeight),y=U.clone(b.color,O5t);y.red*=y.alpha,y.green*=y.alpha,y.blue*=y.alpha,c.push(yJ(f,y))}let d=!0,u=!0;for(n=0;n<a-1;n++){let b=c[n+0],f=c[n+1];d=d&&b.height<=f.height,u=u&&b.height>=f.height}u?c=c.reverse():d||p0(c,function(b,f){return W.sign(b.height-f.height)});let m=r.extendDownwards??!1,p=r.extendUpwards??!1;c.length===1&&!m&&!p&&(m=!0,p=!0),m&&c.splice(0,0,yJ(du._minimumHeight,c[0].color)),p&&c.splice(c.length,0,yJ(du._maximumHeight,c[c.length-1].color)),c=yNe(c),i.push(c)}return i}function J5t(e){let t=K5t(e),n=[],i,o;function r(d,u){n.push(yJ(d,u))}function s(d,u,m){let p=U.multiplyByScalar(m,1-u.alpha,H5t);p=U.add(p,u,p),r(d,p)}let a=t.length;for(o=0;o<a;o++){let d=t[o],u=0,m=0;i=n,n=[];let p=d.length,b=i.length;for(;u<p||m<b;){let f=u<p?d[u]:void 0,y=u>0?d[u-1]:void 0,_=u<p-1?d[u+1]:void 0,S=m<b?i[m]:void 0,Z=m>0?i[m-1]:void 0,R=m<b-1?i[m+1]:void 0;if(l(f)&&l(S)&&f.height===S.height){let C=l(R)&&S.height===R.height,E=!l(Z),A=!l(R),L=l(_)&&f.height===_.height,F=!l(y),I=!l(_);C?L?(s(f.height,f.color,S.color),s(f.height,_.color,R.color)):F?(r(f.height,S.color),s(f.height,f.color,R.color)):I?(s(f.height,f.color,S.color),r(f.height,R.color)):(s(f.height,f.color,S.color),s(f.height,f.color,R.color)):E?L?(r(f.height,f.color),s(f.height,_.color,S.color)):I?(r(f.height,f.color),r(f.height,S.color)):(F||r(f.height,f.color),s(f.height,f.color,S.color)):A?L?(s(f.height,f.color,S.color),r(f.height,_.color)):F?(r(f.height,S.color),r(f.height,f.color)):I?s(f.height,f.color,S.color):(s(f.height,f.color,S.color),r(f.height,f.color)):L?(s(f.height,f.color,S.color),s(f.height,_.color,S.color)):F?(r(f.height,S.color),s(f.height,f.color,S.color)):I?(s(f.height,f.color,S.color),r(f.height,S.color)):s(f.height,f.color,S.color),u+=L?2:1,m+=C?2:1}else if(l(f)&&l(S)&&l(Z)&&f.height<S.height){let C=gNe(f.height,Z,S,z5t);l(y)?l(_)?s(f.height,f.color,C):(s(f.height,f.color,C),r(f.height,C)):(r(f.height,C),s(f.height,f.color,C)),u++}else if(l(S)&&l(f)&&l(y)&&S.height<f.height){let C=gNe(S.height,y,f,B5t);l(Z)?l(R)?s(S.height,C,S.color):(s(S.height,C,S.color),r(S.height,C)):(r(S.height,C),s(S.height,C,S.color)),m++}else l(f)&&(!l(S)||f.height<S.height)?(l(S)&&!l(Z)&&!l(_)?(r(f.height,f.color),r(f.height,du._emptyColor),r(S.height,du._emptyColor)):(!l(S)&&l(Z)&&!l(y)&&(r(Z.height,du._emptyColor),r(f.height,du._emptyColor)),r(f.height,f.color)),u++):l(S)&&(!l(f)||S.height<f.height)&&(r(S.height,S.color),m++)}}return yNe(n)}function du(e){let{scene:t,layers:n}=e??B.EMPTY_OBJECT,{context:i}=t,o=J5t(n),r=o.length,s,a,c;if(!du._useFloatTexture(i)){a=Ue.UNSIGNED_BYTE,c=Qe.RGBA,s=new Uint8Array(r*4);for(let b=0;b<r;b++)ce.packFloat(o[b].height,bNe),ce.pack(bNe,s,b*4)}else{a=Ue.FLOAT,c=i.webgl2?Qe.RED:Qe.LUMINANCE,s=new Float32Array(r);for(let b=0;b<r;b++)s[b]=o[b].height}let u=vt.create({context:i,pixelFormat:c,pixelDatatype:a,source:{arrayBufferView:s,width:r,height:1},sampler:new Ot({wrapS:pn.CLAMP_TO_EDGE,wrapT:pn.CLAMP_TO_EDGE,minificationFilter:Ht.NEAREST,magnificationFilter:$n.NEAREST})}),m=new Uint8Array(r*4);for(let b=0;b<r;b++)o[b].color.toBytes(XU),m[b*4+0]=XU[0],m[b*4+1]=XU[1],m[b*4+2]=XU[2],m[b*4+3]=XU[3];let p=vt.create({context:i,pixelFormat:Qe.RGBA,pixelDatatype:Ue.UNSIGNED_BYTE,source:{arrayBufferView:m,width:r,height:1},sampler:new Ot({wrapS:pn.CLAMP_TO_EDGE,wrapT:pn.CLAMP_TO_EDGE,minificationFilter:Ht.LINEAR,magnificationFilter:$n.LINEAR})});return to.fromType("ElevationBand",{heights:u,colors:p})}du._useFloatTexture=function(e){return e.floatingPointTexture};du._maximumHeight=5906376425472;du._minimumHeight=-5906376425472;du._emptyColor=new U(0,0,0,0);var Dae=du;var DYo=x(T(),1);async function j5t(e,t){t=t??{},t.cacheBytes=t.cacheBytes??1536*1024*1024,t.maximumCacheOverflowBytes=t.maximumCacheOverflowBytes??1024*1024*1024,t.enableCollision=t.enableCollision??!0,e=e??B.EMPTY_OBJECT,e.onlyUsingWithGoogleGeocoder||xt("google-tiles-with-google-geocoder","Only the Google geocoder can be used with Google Photorealistic 3D Tiles. Set the `geocode` property of Viewer constructor options. You can set additionalOptions.onlyUsingWithGoogleGeocoder to hide this warning once you have configured the geocoder.");let n=e.key??Ra.defaultApiKey;if(!l(n))return Q5t(t);let i,o=Ra.getDefaultCredit();l(o)&&(i=[o]);let r=new ve({url:`${Ra.mapTilesApiEndpoint}v1/3dtiles/root.json`,queryParameters:{key:n},credits:i});return Hr.fromUrl(r,t)}var xNe={};async function Q5t(e){let i=xNe[2275207];l(i)||(i=zr.fromAssetId(2275207),xNe[2275207]=i);let o=await i;return Hr.fromUrl(o,e)}var Oae=j5t;var jYo=x(T(),1);async function q5t(e){let t=await Hr.fromIonAssetId(96188,e);e=e??B.EMPTY_OBJECT;let n=e.style;if(!l(n)){let i=(e.defaultColor??U.WHITE).toCssColorString();n=new bg({color:`Boolean(\${feature['cesium#color']}) ? color(\${feature['cesium#color']}) : ${i}`})}return t.style=n,t}var Bae=q5t;var sMo=x(T(),1);function $5t(e){e=e??B.EMPTY_OBJECT;let t=[],n=e.geometry;(!l(n.attributes)||!l(n.primitiveType))&&(n=n.constructor.createGeometry(n));let i=n.attributes,o=P.clone(e.modelMatrix??P.IDENTITY),r=e.length??1e4;if(l(i.normal)&&t.push(new Yt({geometry:Bn.createLineSegmentsForVectors(n,"normal",r),attributes:{color:new $t(1,0,0,1)},modelMatrix:o})),l(i.tangent)&&t.push(new Yt({geometry:Bn.createLineSegmentsForVectors(n,"tangent",r),attributes:{color:new $t(0,1,0,1)},modelMatrix:o})),l(i.bitangent)&&t.push(new Yt({geometry:Bn.createLineSegmentsForVectors(n,"bitangent",r),attributes:{color:new $t(0,0,1,1)},modelMatrix:o})),t.length>0)return new In({asynchronous:!1,geometryInstances:t,appearance:new Tn({flat:!0,translucent:!1})})}var zae=$5t;var uMo=x(T(),1);function NU(e){e=e??B.EMPTY_OBJECT;let t=e.attributeName,n=e.perInstanceAttribute;l(n)||(n=!1);let i=e.glslDatatype??"vec3",o=`v_${t}`,r;if(t==="normal"||t==="tangent"||t==="bitangent")r=`vec4 getColor() { return vec4((${o} + vec3(1.0)) * 0.5, 1.0); } +`;else switch(t==="st"&&(i="vec2"),i){case"float":r=`vec4 getColor() { return vec4(vec3(${o}), 1.0); } +`;break;case"vec2":r=`vec4 getColor() { return vec4(${o}, 0.0, 1.0); } +`;break;case"vec3":r=`vec4 getColor() { return vec4(${o}, 1.0); } +`;break;case"vec4":r=`vec4 getColor() { return ${o}; } +`;break}let s=`in vec3 position3DHigh; +in vec3 position3DLow; +in float batchId; +${n?"":`in ${i} ${t}; +`}out ${i} ${o}; +void main() +{ +vec4 p = czm_translateRelativeToEye(position3DHigh, position3DLow); +${n?`${o} = czm_batchTable_${t}(batchId); +`:`${o} = ${t}; +`}gl_Position = czm_modelViewProjectionRelativeToEye * p; +}`,a=`in ${i} ${o}; +${r} +void main() +{ +out_FragColor = getColor(); +}`;this.material=void 0,this.translucent=e.translucent??!1,this._vertexShaderSource=e.vertexShaderSource??s,this._fragmentShaderSource=e.fragmentShaderSource??a,this._renderState=Go.getDefaultRenderState(!1,!1,e.renderState),this._closed=e.closed??!1,this._attributeName=t,this._glslDatatype=i}Object.defineProperties(NU.prototype,{vertexShaderSource:{get:function(){return this._vertexShaderSource}},fragmentShaderSource:{get:function(){return this._fragmentShaderSource}},renderState:{get:function(){return this._renderState}},closed:{get:function(){return this._closed}},attributeName:{get:function(){return this._attributeName}},glslDatatype:{get:function(){return this._glslDatatype}}});NU.prototype.getFragmentShaderSource=Go.prototype.getFragmentShaderSource;NU.prototype.isTranslucent=Go.prototype.isTranslucent;NU.prototype.getRenderState=Go.prototype.getRenderState;var Hae=NU;var RMo=x(T(),1);function xJ(e){e=e??B.EMPTY_OBJECT,this.length=e.length??1e7,this._length=void 0,this.width=e.width??2,this._width=void 0,this.show=e.show??!0,this.modelMatrix=P.clone(e.modelMatrix??P.IDENTITY),this._modelMatrix=new P,this.id=e.id,this._id=void 0,this._primitive=void 0}xJ.prototype.update=function(e){if(this.show){if(!l(this._primitive)||!P.equals(this._modelMatrix,this.modelMatrix)||this._length!==this.length||this._width!==this.width||this._id!==this.id){this._modelMatrix=P.clone(this.modelMatrix,this._modelMatrix),this._length=this.length,this._width=this.width,this._id=this.id,l(this._primitive)&&this._primitive.destroy(),this.modelMatrix[12]===0&&this.modelMatrix[13]===0&&this.modelMatrix[14]===0&&(this.modelMatrix[14]=.01);let t=new Yt({geometry:new Lg({positions:[h.ZERO,h.UNIT_X],width:this.width,vertexFormat:Ms.VERTEX_FORMAT,colors:[U.RED,U.RED],arcType:un.NONE}),modelMatrix:P.multiplyByUniformScale(this.modelMatrix,this.length,new P),id:this.id,pickPrimitive:this}),n=new Yt({geometry:new Lg({positions:[h.ZERO,h.UNIT_Y],width:this.width,vertexFormat:Ms.VERTEX_FORMAT,colors:[U.GREEN,U.GREEN],arcType:un.NONE}),modelMatrix:P.multiplyByUniformScale(this.modelMatrix,this.length,new P),id:this.id,pickPrimitive:this}),i=new Yt({geometry:new Lg({positions:[h.ZERO,h.UNIT_Z],width:this.width,vertexFormat:Ms.VERTEX_FORMAT,colors:[U.BLUE,U.BLUE],arcType:un.NONE}),modelMatrix:P.multiplyByUniformScale(this.modelMatrix,this.length,new P),id:this.id,pickPrimitive:this});this._primitive=new In({geometryInstances:[t,n,i],appearance:new Ms,asynchronous:!1})}this._primitive.update(e)}};xJ.prototype.isDestroyed=function(){return!1};xJ.prototype.destroy=function(){return this._primitive=this._primitive&&this._primitive.destroy(),ue(this)};var YU=xJ;var EMo=x(T(),1);var eDt=new TextDecoder,TJ={UNKNOWN:0,POINT:1,LINESTRING:2,POLYGON:3},tDt={LAYERS:3},MU={NAME:1,FEATURES:2,KEYS:3,VALUES:4,EXTENT:5},Kae={TAGS:2,TYPE:3,GEOMETRY:4},NR={STRING:1,FLOAT:2,DOUBLE:3,INT64:4,UINT64:5,SINT64:6,BOOL:7},nDt=["Unknown","Point","LineString","Polygon"];function iDt(e){let t=new Uint8Array(e),n=[],i=0;for(;i<t.length;){let o=_J(t,i,t.length),r=o.fieldNumber,s=o.wireType;if(i=o.newPos,r===tDt.LAYERS&&s===2){let a=py(t,i,t.length);i=a.newPos;let c=uu(i,a.value,t.length,"layer");n.push(oDt(t,i,c)),i=c}else i=SJ(t,i,s,t.length)}return{layers:n}}function oDt(e,t,n){let i=t,o="",r=4096,s=[],a=[],c=[];for(;i<n;){let u=_J(e,i,n),m=u.fieldNumber,p=u.wireType;if(i=u.newPos,m===MU.NAME&&p===2){let b=py(e,i,n);i=b.newPos;let f=uu(i,b.value,n,"layer name");o=jae(e,i,b.value),i=f}else if(m===MU.FEATURES&&p===2){let b=py(e,i,n);i=b.newPos;let f=uu(i,b.value,n,"feature");c.push({start:i,end:f}),i=f}else if(m===MU.KEYS&&p===2){let b=py(e,i,n);i=b.newPos;let f=uu(i,b.value,n,"key");s.push(jae(e,i,b.value)),i=f}else if(m===MU.VALUES&&p===2){let b=py(e,i,n);i=b.newPos;let f=uu(i,b.value,n,"value"),y=aDt(e,i,f);a.push(y),i=f}else if(m===MU.EXTENT&&p===0){let b=WA(e,i,n);r=b.value,i=b.newPos}else i=SJ(e,i,p,n)}let d=c.map(({start:u,end:m})=>rDt(e,u,m,s,a));return{name:o,extent:r,features:d}}function rDt(e,t,n,i,o){let r=t,s=TJ.UNKNOWN,a=[],c=[];for(;r<n;){let m=_J(e,r,n),p=m.fieldNumber,b=m.wireType;if(r=m.newPos,p===Kae.TYPE&&b===0){let f=WA(e,r,n);s=f.value,r=f.newPos}else if(p===Kae.TAGS&&b===2){let f=py(e,r,n);r=f.newPos;let y=uu(r,f.value,n,"feature tags");for(;r<y;){let _=WA(e,r,y);a.push(_.value),r=_.newPos}}else if(p===Kae.GEOMETRY&&b===2){let f=py(e,r,n);r=f.newPos;let y=uu(r,f.value,n,"feature geometry");for(;r<y;){let _=WA(e,r,y);c.push(_.value),r=_.newPos}}else r=SJ(e,r,b,n)}let d={};for(let m=0;m<a.length-1;m+=2){let p=i[a[m]],b=o[a[m+1]];typeof p!="string"||b===void 0||(d[p]=b)}let u=sDt(s,c);return{type:nDt[s]??"Unknown",geometry:u,properties:d}}function sDt(e,t){let n=0,i=0,o=0;if(e===TJ.POINT){let r=[];for(;n<t.length;){let s=t[n++],a=s&7,c=s>>3;if(a===1)for(let d=0;d<c;d++)i+=B0(t[n++]),o+=B0(t[n++]),r.push({x:i,y:o})}return r}if(e===TJ.LINESTRING){let r=[],s=null;for(;n<t.length;){let a=t[n++],c=a&7,d=a>>3;if(c===1)s!==null&&r.push(s),s=[],i+=B0(t[n++]),o+=B0(t[n++]),s.push({x:i,y:o});else if(c===2)for(let u=0;u<d;u++)i+=B0(t[n++]),o+=B0(t[n++]),s.push({x:i,y:o})}return s!==null&&r.push(s),r}if(e===TJ.POLYGON){let r=[],s=null;for(;n<t.length;){let a=t[n++],c=a&7,d=a>>3;if(c===1)s!==null&&r.push(s),s=[],i+=B0(t[n++]),o+=B0(t[n++]),s.push({x:i,y:o});else if(c===2)for(let u=0;u<d;u++)i+=B0(t[n++]),o+=B0(t[n++]),s.push({x:i,y:o});else c===7&&s!==null&&s.length>0&&(s.push({x:s[0].x,y:s[0].y}),r.push(s),s=null)}return s!==null&&r.push(s),r}return[]}function aDt(e,t,n){let i=t;for(;i<n;){let o=_J(e,i,n),r=o.fieldNumber,s=o.wireType;if(i=o.newPos,r===NR.STRING&&s===2){let a=py(e,i,n);i=a.newPos;let c=uu(i,a.value,n,"string value");return jae(e,i,c-i)}else{if(r===NR.FLOAT&&s===5)return uu(i,4,n,"float value"),new DataView(e.buffer,e.byteOffset+i,4).getFloat32(0,!0);if(r===NR.DOUBLE&&s===1)return uu(i,8,n,"double value"),new DataView(e.buffer,e.byteOffset+i,8).getFloat64(0,!0);if(r===NR.INT64&&s===0){let a=vA(e,i,n);return Jae(a.value)}else if(r===NR.UINT64&&s===0){let a=vA(e,i,n);return Jae(a.value)}else if(r===NR.SINT64&&s===0){let a=vA(e,i,n);return Jae(cDt(a.value))}else if(r===NR.BOOL&&s===0)return WA(e,i,n).value!==0}i=SJ(e,i,s,n)}}function _J(e,t,n){let i=WA(e,t,n);return{fieldNumber:i.value>>>3,wireType:i.value&7,newPos:i.newPos}}function WA(e,t,n){let i=vA(e,t,n,5);if(i.value>0xffffffffn)throw new ae("Invalid MVT uint32 varint.");return{value:Number(i.value),newPos:i.newPos}}function py(e,t,n){let i=vA(e,t,n);if(i.value>BigInt(Number.MAX_SAFE_INTEGER))throw new ae("Invalid MVT length varint.");return{value:Number(i.value),newPos:i.newPos}}function vA(e,t,n,i){let o=0n,r=0n,s=0,a=i??10;for(;;){if(t>=n||t>=e.length)throw new ae("Invalid MVT: truncated varint.");let c=e[t++];if(o|=BigInt(c&127)<<r,s++,(c&128)===0)break;if(s>=a)throw new ae("Invalid MVT: varint is too long.");r+=7n}return{value:o,newPos:t}}function jae(e,t,n){let i=uu(t,n,e.length,"string");return eDt.decode(e.subarray(t,i))}function uu(e,t,n,i){if(!Number.isFinite(t)||t<0)throw new ae(`Invalid MVT ${i}: invalid length.`);let o=e+t;if(!Number.isFinite(o)||o<e||o>n)throw new ae(`Invalid MVT ${i}: length exceeds available bytes.`);return o}function SJ(e,t,n,i){if(n===0)return vA(e,t,i).newPos;if(n===1)return uu(t,8,i,"fixed64 field");if(n===2){let o=py(e,t,i);return uu(o.newPos,o.value,i,"length-delimited field")}else if(n===5)return uu(t,4,i,"fixed32 field");throw new ae(`Unsupported protobuf wire type: ${n}`)}function B0(e){return e>>>1^-(e&1)}function cDt(e){return e>>1n^-(e&1n)}function Jae(e){return e<=BigInt(Number.MAX_SAFE_INTEGER)&&e>=BigInt(Number.MIN_SAFE_INTEGER)?Number(e):e}var wU=iDt;var WMo=x(T(),1);function lDt(e){this.direction=h.clone(e.direction),this.color=U.clone(e.color??U.WHITE),this.intensity=e.intensity??1}var Qae=lDt;var wMo=x(T(),1);function YR(e){e=e??B.EMPTY_OBJECT;let t=e.translucent??!0,n=e.aboveGround??!1;this.material=l(e.material)?e.material:to.fromType(to.ColorType),this.translucent=e.translucent??!0,this._vertexShaderSource=e.vertexShaderSource??gU,this._fragmentShaderSource=e.fragmentShaderSource??bU,this._renderState=Go.getDefaultRenderState(t,!n,e.renderState),this._closed=!1,this._flat=e.flat??!1,this._faceForward=e.faceForward??n,this._aboveGround=n}Object.defineProperties(YR.prototype,{vertexShaderSource:{get:function(){return this._vertexShaderSource}},fragmentShaderSource:{get:function(){return this._fragmentShaderSource}},renderState:{get:function(){return this._renderState}},closed:{get:function(){return this._closed}},vertexFormat:{get:function(){return YR.VERTEX_FORMAT}},flat:{get:function(){return this._flat}},faceForward:{get:function(){return this._faceForward}},aboveGround:{get:function(){return this._aboveGround}}});YR.VERTEX_FORMAT=Me.POSITION_AND_ST;YR.prototype.getFragmentShaderSource=Go.prototype.getFragmentShaderSource;YR.prototype.isTranslucent=Go.prototype.isTranslucent;YR.prototype.getRenderState=Go.prototype.getRenderState;var qae=YR;var ewo=x(T(),1);var dDt=1e5;function kU(e){e=e??B.EMPTY_OBJECT;let t=e.credit;typeof t=="string"&&(t=new Lt(t)),this._credit=t,this._radius=l(e.radius)?e.radius:dDt,this._image=e.image,this._transform=l(e.transform)?e.transform:P.IDENTITY,this._repeatHorizontal=l(e.repeatHorizontal)?e.repeatHorizontal:1,this._repeatVertical=l(e.repeatVertical)?e.repeatVertical:1;let n=new GU({radius:this._radius,vertexFormat:Me.ALL}),i=new Yt({geometry:n,modelMatrix:this._transform}),o=new to({fabric:{type:"Image",uniforms:{image:this._image,repeat:new k(-this._repeatHorizontal,this._repeatVertical)}}});return this._primitive=new In({geometryInstances:i,appearance:new Co({material:o,closed:!0,faceForward:!1,flat:!0,translucent:!1,renderState:{cull:{enabled:!1}}}),credit:this._credit}),this}Object.defineProperties(kU.prototype,{radius:{get:function(){return this._radius}},image:{get:function(){return this._image}},transform:{get:function(){return this._transform}},credit:{get:function(){return l(this._credit)?this._credit:void 0}},show:{get:function(){return l(this._primitive)?this._primitive.show:void 0},set:function(e){l(this._primitive)&&(this._primitive.show=e)}}});kU.prototype.update=function(e){return l(this._credit)&&e.creditDisplay.addCreditToNextFrame(this._credit),this._primitive.update(e)};kU.prototype.destroy=function(){return this._primitive=this._primitive&&this._primitive.destroy(),ue(this)};kU.prototype.isDestroyed=function(){return this._primitive.isDestroyed()};var $ae=kU;var awo=x(T(),1);function mu(e){this._scene=e.scene,this.samplingWindow=e.samplingWindow??mu.defaultSettings.samplingWindow,this.quietPeriod=e.quietPeriod??mu.defaultSettings.quietPeriod,this.warmupPeriod=e.warmupPeriod??mu.defaultSettings.warmupPeriod,this.minimumFrameRateDuringWarmup=e.minimumFrameRateDuringWarmup??mu.defaultSettings.minimumFrameRateDuringWarmup,this.minimumFrameRateAfterWarmup=e.minimumFrameRateAfterWarmup??mu.defaultSettings.minimumFrameRateAfterWarmup,this._lowFrameRate=new Se,this._nominalFrameRate=new Se,this._frameTimes=[],this._needsQuietPeriod=!0,this._quietPeriodEndTime=0,this._warmupPeriodEndTime=0,this._frameRateIsLow=!1,this._lastFramesPerSecond=void 0,this._pauseCount=0;let t=this;this._preUpdateRemoveListener=this._scene.preUpdate.addEventListener(function(o,r){uDt(t,r)}),this._hiddenPropertyName=document.hidden!==void 0?"hidden":document.mozHidden!==void 0?"mozHidden":document.msHidden!==void 0?"msHidden":document.webkitHidden!==void 0?"webkitHidden":void 0;let n=document.hidden!==void 0?"visibilitychange":document.mozHidden!==void 0?"mozvisibilitychange":document.msHidden!==void 0?"msvisibilitychange":document.webkitHidden!==void 0?"webkitvisibilitychange":void 0;function i(){mDt(t)}this._visibilityChangeRemoveListener=void 0,l(n)&&(document.addEventListener(n,i,!1),this._visibilityChangeRemoveListener=function(){document.removeEventListener(n,i,!1)})}mu.defaultSettings={samplingWindow:5,quietPeriod:2,warmupPeriod:5,minimumFrameRateDuringWarmup:4,minimumFrameRateAfterWarmup:8};mu.fromScene=function(e){return(!l(e._frameRateMonitor)||e._frameRateMonitor.isDestroyed())&&(e._frameRateMonitor=new mu({scene:e})),e._frameRateMonitor};Object.defineProperties(mu.prototype,{scene:{get:function(){return this._scene}},lowFrameRate:{get:function(){return this._lowFrameRate}},nominalFrameRate:{get:function(){return this._nominalFrameRate}},lastFramesPerSecond:{get:function(){return this._lastFramesPerSecond}}});mu.prototype.pause=function(){++this._pauseCount,this._pauseCount===1&&(this._frameTimes.length=0,this._lastFramesPerSecond=void 0)};mu.prototype.unpause=function(){--this._pauseCount,this._pauseCount<=0&&(this._pauseCount=0,this._needsQuietPeriod=!0)};mu.prototype.isDestroyed=function(){return!1};mu.prototype.destroy=function(){return this._preUpdateRemoveListener(),l(this._visibilityChangeRemoveListener)&&this._visibilityChangeRemoveListener(),ue(this)};function uDt(e,t){if(e._pauseCount>0)return;let n=Zn();if(e._needsQuietPeriod)e._needsQuietPeriod=!1,e._frameTimes.length=0,e._quietPeriodEndTime=n+e.quietPeriod/wn.SECONDS_PER_MILLISECOND,e._warmupPeriodEndTime=e._quietPeriodEndTime+(e.warmupPeriod+e.samplingWindow)/wn.SECONDS_PER_MILLISECOND;else if(n>=e._quietPeriodEndTime){e._frameTimes.push(n);let i=n-e.samplingWindow/wn.SECONDS_PER_MILLISECOND;if(e._frameTimes.length>=2&&e._frameTimes[0]<=i){for(;e._frameTimes.length>=2&&e._frameTimes[1]<i;)e._frameTimes.shift();let o=(n-e._frameTimes[0])/(e._frameTimes.length-1);e._lastFramesPerSecond=1e3/o;let r=1e3/(n>e._warmupPeriodEndTime?e.minimumFrameRateAfterWarmup:e.minimumFrameRateDuringWarmup);o>r?e._frameRateIsLow||(e._frameRateIsLow=!0,e._needsQuietPeriod=!0,e.lowFrameRate.raiseEvent(e.scene,e._lastFramesPerSecond)):e._frameRateIsLow&&(e._frameRateIsLow=!1,e._needsQuietPeriod=!0,e.nominalFrameRate.raiseEvent(e.scene,e._lastFramesPerSecond))}}}function mDt(e){document[e._hiddenPropertyName]?e.pause():e.unpause()}var UU=mu;var Cwo=x(T(),1);var tce=class e{constructor(t){t=t??B.EMPTY_OBJECT;let n=hDt(t.geoJson),i=t.allowPicking??!0,o=t.ellipsoid??ne.default,r=new Float64Array(0);function s(b){return r.length<b&&(r=new Float64Array(b)),r}this.show=t.show??!0,this._url=t.url,this._ids=n.ids,this._properties=n.properties,this._featureCount=n.ids.length,this._pickObjectFactory=t.pickObjectFactory,this._points=void 0,this._polylines=void 0,this._polygons=void 0,this._heightReference=t.heightReference??He.NONE,this._scene=t.scene;let a=this._heightReference,c=this._scene;n.pointCount>0&&(this._points=new jd({primitiveCountMax:n.pointCount,allowPicking:i})),n.polylineCount>0&&(this._polylines=new pl({primitiveCountMax:n.polylineCount,vertexCountMax:n.polylineVertexCount,allowPicking:i,heightReference:a})),n.polygonCount>0&&(this._polygons=new ka({primitiveCountMax:n.polygonCount,vertexCountMax:n.polygonVertexCount,holeCountMax:n.polygonHoleCount,triangleCountMax:n.polygonTriangleCount,allowPicking:i,heightReference:a}));let d=new h,u=0,m=0,p=0;for(let b=0;b<n.features.length;b++){let f=n.features[b],y=f.featureId,_=this._properties[y];for(let S=0;S<f.points.length;S++){let Z=u++;this._points.add({featureId:y,position:CNe(f.points[S],o,d),pickObject:i?ece(this,Z,this._points,Xc,_):void 0})}for(let S=0;S<f.polylines.length;S++){let Z=m++;this._polylines.add({featureId:y,positions:TNe(f.polylines[S],o,s),pickObject:i?ece(this,Z,this._polylines,Ta,_):void 0})}for(let S=0;S<f.polygons.length;S++){let Z=f.polygons[S],R=p++;this._polygons.add({featureId:y,positions:TNe(Z.positions,o,s),holes:Z.holes,triangles:Z.triangles,pickObject:i?ece(this,R,this._polygons,Ir,_):void 0})}}}get url(){let t=this._url;if(l(t))return t instanceof ve?t.getUrlComponent(!0):t}get featureCount(){return this._featureCount}get ids(){return this._ids}get properties(){return this._properties}get points(){return this._points}get polylines(){return this._polylines}get polygons(){return this._polygons}static async fromUrl(t,n){let i=ve.createIfNeeded(t),o=await i.fetchJson();if(!l(o))throw new ae(`Failed to load GeoJSON from ${i.getUrlComponent(!0)}.`);return e.fromGeoJson(o,{...n,url:i})}static fromGeoJson(t,n){return new e({...n,geoJson:t})}getId(t){return this._ids[t]}getProperties(t){return this._properties[t]}update(t){if(!this.show)return;let n=this._points,i=this._polylines,o=this._polygons,r=t.frameNumber,s=this._heightReference,a=gs(s)?this._scene.vectorProvider:null;l(n)&&n.update(t),l(i)&&(l(a)?a.markForFrame(i,r,s):i.update(t)),l(o)&&(l(a)?a.markForFrame(o,r,s):o.update(t))}destroy(){let t=gs(this._heightReference)?this._scene.vectorProvider:null;return this._points&&(this._points.destroy(),this._points=void 0),this._polylines&&(l(t)&&t.remove(this._polylines),this._polylines.destroy(),this._polylines=void 0),this._polygons&&(l(t)&&t.remove(this._polygons),this._polygons.destroy(),this._polygons=void 0),ue(this)}isDestroyed(){return!1}};function ece(e,t,n,i,o){return l(e._pickObjectFactory)?e._pickObjectFactory(t,n,o):{index:t,collection:n,get primitive(){return n.get(t,new i)},parentPrimitive:e,properties:o}}function hDt(e){let t=fDt(e),n=[],i=[],o=[],r=0,s=0,a=0,c=0,d=0,u=0,m=0;for(let p=0;p<t.length;p++){let b=t[p],f={points:[],polylines:[],polygons:[]};if(_Ne(b.geometry,f),f.points.length===0&&f.polylines.length===0&&f.polygons.length===0)continue;let y=i.length;i.push(b.id),o.push(CDt(b.properties)?b.properties:B.EMPTY_OBJECT);for(let _=0;_<f.polygons.length;_++){let S=f.polygons[_];u+=S.holes.length,m+=S.triangles.length/3,d+=S.positions.length}for(let _=0;_<f.polylines.length;_++)a+=f.polylines[_].length;r+=f.points.length,s+=f.polylines.length,c+=f.polygons.length,n.push({featureId:y,points:f.points,polylines:f.polylines,polygons:f.polygons})}return{features:n,ids:i,properties:o,pointCount:r,polylineCount:s,polylineVertexCount:a,polygonCount:c,polygonVertexCount:d,polygonHoleCount:u,polygonTriangleCount:m}}function fDt(e){if(!l(e)||!l(e.type))throw new ae("GeoJSON object must define 'type'.");switch(e.type){case"FeatureCollection":return e.features;case"Feature":return[e];default:if(ZDt(e.type))return[{type:"Feature",geometry:e,properties:B.EMPTY_OBJECT,id:void 0}];throw new ae(`Unsupported GeoJSON type: ${e.type}`)}}function _Ne(e,t){if(!(!l(e)||!l(e.type)))switch(e.type){case"Point":SNe(e.coordinates,t.points);return;case"MultiPoint":bDt(e.coordinates,t.points);return;case"LineString":ZNe(e.coordinates,t.polylines);return;case"MultiLineString":gDt(e.coordinates,t.polylines);return;case"Polygon":RNe(e.coordinates,t.polygons);return;case"MultiPolygon":yDt(e.coordinates,t.polygons);return;case"GeometryCollection":pDt(e.geometries,t);return;default:return}}function pDt(e,t){if(Array.isArray(e))for(let n=0;n<e.length;n++)_Ne(e[n],t)}function SNe(e,t){let n=nce(e);l(n)&&t.push(n)}function bDt(e,t){for(let n=0;n<e.length;n++)SNe(e[n],t)}function ZNe(e,t){let n=xDt(e);l(n)&&n.length>=2&&t.push(n)}function gDt(e,t){for(let n=0;n<e.length;n++)ZNe(e[n],t)}function RNe(e,t){let n=TDt(e);l(n)&&t.push(n)}function yDt(e,t){for(let n=0;n<e.length;n++)RNe(e[n],t)}function xDt(e){if(!Array.isArray(e))return;let t=[];for(let n=0;n<e.length;n++){let i=nce(e[n]);l(i)&&t.push(i)}return t.length>=2?t:void 0}function TDt(e){if(!Array.isArray(e)||e.length===0)return;let t=[];for(let a=0;a<e.length;a++){let c=_Dt(e[a]);l(c)&&t.push(c)}if(t.length===0||t[0].length<3)return;let i=[],o=[],r=[];for(let a=0;a<t.length;a++){let c=t[a];if(!(c.length<3)){a>0&&r.push(o.length);for(let d=0;d<c.length;d++){let u=c[d];o.push(u),i.push(new k(u[0],u[1]))}}}if(o.length<3)return;let s=hi.triangulate(i,r);if(!(!l(s)||s.length<3))return{positions:o,holes:new Uint32Array(r),triangles:new Uint32Array(s)}}function _Dt(e){if(!Array.isArray(e))return;let t=[];for(let n=0;n<e.length;n++){let i=nce(e[n]);l(i)&&t.push(i)}if(!(t.length<3))return t.length>1&&SDt(t[0],t[t.length-1])&&t.pop(),t.length>=3?t:void 0}function nce(e){if(!Array.isArray(e)||e.length<2)return;let t=e[0],n=e[1],i=e[2]??0;if(!(!Number.isFinite(t)||!Number.isFinite(n)||!Number.isFinite(i)))return[t,n,i]}function SDt(e,t){return e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]}function ZDt(e){return e==="Point"||e==="MultiPoint"||e==="LineString"||e==="MultiLineString"||e==="Polygon"||e==="MultiPolygon"||e==="GeometryCollection"}function CNe(e,t,n){return h.fromDegrees(e[0],e[1],e[2]??0,t,n)}var RDt=new h;function TNe(e,t,n){let i=e.length*3,o=n(i);for(let r=0;r<e.length;r++){let s=CNe(e[r],t,RDt);o[r*3]=s.x,o[r*3+1]=s.y,o[r*3+2]=s.z}return o.subarray(0,i)}function CDt(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}var ice=tce;var Mwo=x(T(),1);var VNe=x(Jse(),1);function oce(){this._image=new Image}oce.prototype.isReady=function(){return!0};oce.prototype.shouldDiscardImage=function(e){return e===this._image};function MR(e){e=e??B.EMPTY_OBJECT,this._defaultAlpha=void 0,this._defaultNightAlpha=void 0,this._defaultDayAlpha=void 0,this._defaultBrightness=void 0,this._defaultContrast=void 0,this._defaultHue=void 0,this._defaultSaturation=void 0,this._defaultGamma=void 0,this._defaultMinificationFilter=void 0,this._defaultMagnificationFilter=void 0,this._tileDiscardPolicy=e.tileDiscardPolicy,this._tilingScheme=new eo({numberOfLevelZeroTilesX:2,numberOfLevelZeroTilesY:2,rectangle:new re(-W.PI,-W.PI,W.PI,W.PI),ellipsoid:e.ellipsoid});let t=e.credit;typeof t=="string"&&(t=new Lt(t)),this._credit=t,this._tileWidth=256,this._tileHeight=256,this._maximumLevel=23,l(this._tileDiscardPolicy)||(this._tileDiscardPolicy=new oce),this._errorEvent=new Se}Object.defineProperties(MR.prototype,{url:{get:function(){return this._metadata.url}},proxy:{get:function(){return this._metadata.proxy}},tileWidth:{get:function(){return this._tileWidth}},tileHeight:{get:function(){return this._tileHeight}},maximumLevel:{get:function(){return this._maximumLevel}},minimumLevel:{get:function(){return 0}},tilingScheme:{get:function(){return this._tilingScheme}},rectangle:{get:function(){return this._tilingScheme.rectangle}},tileDiscardPolicy:{get:function(){return this._tileDiscardPolicy}},errorEvent:{get:function(){return this._errorEvent}},credit:{get:function(){return this._credit}},hasAlphaChannel:{get:function(){return!1}}});MR.fromMetadata=function(e,t){if(!e.imageryPresent)throw new ae(`The server ${e.url} doesn't have imagery`);let n=new MR(t);return n._metadata=e,n};MR.prototype.getTileCredits=function(e,t,n){let i=this._metadata,o=i.getTileInformation(e,t,n);if(l(o)){let r=i.providers[o.imageryProvider];if(l(r))return[r]}};MR.prototype.requestImage=function(e,t,n,i){let o=this._tileDiscardPolicy._image,r=this._metadata,s=hy.tileXYToQuadKey(e,t,n),a=r.getTileInformation(e,t,n);if(!l(a)){if(r.isValid(s)){let d=new Ar({throttle:i.throttle,throttleByServer:i.throttleByServer,type:i.type,priorityFunction:i.priorityFunction});r.populateSubtree(e,t,n,d);return}return Promise.resolve(o)}if(!a.hasImagery())return Promise.resolve(o);let c=VDt(this,a,e,t,n,i).fetchArrayBuffer();if(l(c))return c.then(function(d){ZU(r.key,d);let u=new Uint8Array(d),m,p=r.protoImagery;if((!l(p)||!p)&&(m=EDt(u)),!l(m)&&(!l(p)||p)){let b=ADt(u);m=b.imageType,u=b.imageData}return!l(m)||!l(u)?o:zb({uint8Array:u,format:m,flipY:!0})})};MR.prototype.pickFeatures=function(e,t,n,i,o){};function VDt(e,t,n,i,o,r){let s=hy.tileXYToQuadKey(n,i,o),a=t.imageryVersion;return a=l(a)&&a>0?a:1,e._metadata.resource.getDerivedResource({url:`flatfile?f1-0${s}-i.${a.toString()}`,request:r})}function EDt(e){let t="JFIF";if(e[6]===t.charCodeAt(0)&&e[7]===t.charCodeAt(1)&&e[8]===t.charCodeAt(2)&&e[9]===t.charCodeAt(3))return"image/jpeg";let n="PNG";if(e[1]===n.charCodeAt(0)&&e[2]===n.charCodeAt(1)&&e[3]===n.charCodeAt(2))return"image/png"}function ADt(e){let t=VNe.Reader.create(e),n=t.len,i={};for(;t.pos<n;){let s=t.uint32(),a;switch(s>>>3){case 1:i.imageType=t.uint32();break;case 2:i.imageData=t.bytes();break;case 3:i.alphaType=t.uint32();break;case 4:i.imageAlpha=t.bytes();break;case 5:if(a=i.copyrightIds,l(a)||(a=i.copyrightIds=[]),(s&7)===2){let c=t.uint32()+t.pos;for(;t.pos<c;)a.push(t.uint32())}else a.push(t.uint32());break;default:t.skipType(s&7);break}}let o=i.imageType;if(l(o))switch(o){case 0:i.imageType="image/jpeg";break;case 4:i.imageType="image/png";break;default:throw new ae("GoogleEarthEnterpriseImageryProvider: Unsupported image type.")}let r=i.alphaType;return l(r)&&r!==0&&(console.log("GoogleEarthEnterpriseImageryProvider: External alpha not supported."),delete i.alphaType,delete i.imageAlpha),i}var rce=MR;var e9o=x(T(),1);var GDt=600;function z0(e){e=e??B.EMPTY_OBJECT,this._key=l(e.key)?e.key:Ra.defaultApiKey,this._baseResource=ve.createIfNeeded(e.url??Ra.streetViewStaticApiEndpoint),this._metadataResource=this._baseResource.getDerivedResource({url:"streetview/metadata"}),this._tileSize=e.tileSize??GDt}Object.defineProperties(z0.prototype,{});z0.prototype.loadPanorama=async function(e){let t=e.cartographic,n=e.tileSize??this._tileSize,i=`${n}x${n}`,o=e.signature,{panoId:r}=e;l(r)||(r=(await this.getNearestPanoId(t)).panoId);let s=Ra.getDefaultCredit(),a=h.fromDegrees(W.toDegrees(t.longitude),W.toDegrees(t.latitude),0),c=[this._loadFaceImage({heading:0,pitch:0,tileSizeString:i,panoId:r,signature:o}),this._loadFaceImage({heading:180,pitch:0,tileSizeString:i,panoId:r,signature:o}),this._loadFaceImage({heading:-90,pitch:-90,tileSizeString:i,panoId:r,signature:o}),this._loadFaceImage({heading:-90,pitch:90,tileSizeString:i,panoId:r,signature:o}),this._loadFaceImage({heading:270,pitch:0,tileSizeString:i,panoId:r,signature:o}),this._loadFaceImage({heading:90,pitch:0,tileSizeString:i,panoId:r,signature:o})],[d,u,m,p,b,f]=await Promise.all(c),y=_t.localFrameToFixedFrameGenerator("north","down"),_=P.getMatrix3(y(a,ne.default),new q);return new JZ({sources:{positiveX:d,negativeX:u,positiveY:m,negativeY:p,positiveZ:b,negativeZ:f},transform:_,credit:s})};z0.prototype.getNearestPanoId=async function(e,t){let i=[W.toDegrees(e.latitude),W.toDegrees(e.longitude)].join(","),r=await this._metadataResource.getDerivedResource({queryParameters:{key:this._key,location:i,radius:t??50}}).fetchJson();if(r.status!=="OK")throw new ge(`GoogleStreetViewCubeMapPanoramaProvider metadata error: ${r.status}`);return{panoId:r.pano_id,latitude:r.location.lat,longitude:r.location.lng}};z0.prototype.getPanoIdMetadata=async function(e){let n=await this._metadataResource.getDerivedResource({queryParameters:{key:this._key,pano:e}}).fetchJson();if(n.status!=="OK")throw new ge(`GoogleStreetViewCubeMapPanoramaProvider metadata error: ${n.status}`);return n};z0.prototype._loadFaceImage=async function(e){let t=this._buildFaceUrl(e);try{return await ve.fetchImage({url:t,preferImageBitmap:!0,flipY:!0})}catch{throw new ge(`Failed to load Street View face image: ${t}`)}};z0.prototype._buildFaceUrl=function(e){let{heading:t,pitch:n,tileSizeString:i,panoId:o,signature:r}=e;return this._baseResource.getDerivedResource({queryParameters:{size:i,pano:o,heading:t,pitch:n,key:this._key,...l(r)&&{signature:r}}}).url};z0.fromUrl=async function(e){if(e=e??{},e.key=e.key??Ra.defaultStreetViewStaticApiKey??Ra.defaultApiKey,!l(e.key)&&!l(Ra.defaultStreetViewStaticApiKey)&&!l(Ra.defaultApiKey))throw new ge("options.key, GoogleMaps.defaultStreetViewStaticApiKey or GoogleMaps.defaultApiKey is required.");return new z0({...e})};z0._parseMetadata=function(e){return{cartographic:pe.fromDegrees(e.location.lng,e.location.lat,0)}};var sce=z0;var a9o=x(T(),1);var LDt=new U(1,1,1,.4),WDt=new U(0,1,0,.05),vDt=new U(0,.5,0,.2);function wR(e){e=e??B.EMPTY_OBJECT,this._defaultAlpha=void 0,this._defaultNightAlpha=void 0,this._defaultDayAlpha=void 0,this._defaultBrightness=void 0,this._defaultContrast=void 0,this._defaultHue=void 0,this._defaultSaturation=void 0,this._defaultGamma=void 0,this._defaultMinificationFilter=void 0,this._defaultMagnificationFilter=void 0,this._tilingScheme=l(e.tilingScheme)?e.tilingScheme:new eo({ellipsoid:e.ellipsoid}),this._cells=e.cells??8,this._color=e.color??LDt,this._glowColor=e.glowColor??WDt,this._glowWidth=e.glowWidth??6,this._backgroundColor=e.backgroundColor??vDt,this._errorEvent=new Se,this._tileWidth=e.tileWidth??256,this._tileHeight=e.tileHeight??256,this._canvasSize=e.canvasSize??256,this._canvas=this._createGridCanvas()}Object.defineProperties(wR.prototype,{proxy:{get:function(){}},tileWidth:{get:function(){return this._tileWidth}},tileHeight:{get:function(){return this._tileHeight}},maximumLevel:{get:function(){}},minimumLevel:{get:function(){}},tilingScheme:{get:function(){return this._tilingScheme}},rectangle:{get:function(){return this._tilingScheme.rectangle}},tileDiscardPolicy:{get:function(){}},errorEvent:{get:function(){return this._errorEvent}},credit:{get:function(){}},hasAlphaChannel:{get:function(){return!0}}});wR.prototype._drawGrid=function(e){let n=this._canvasSize;for(let i=0;i<=this._cells;++i){let r=1+i/this._cells*(n-1);e.moveTo(r,0),e.lineTo(r,n),e.moveTo(0,r),e.lineTo(n,r)}e.stroke()};wR.prototype._createGridCanvas=function(){let e=document.createElement("canvas");e.width=this._canvasSize,e.height=this._canvasSize;let t=0,n=this._canvasSize,i=e.getContext("2d"),o=this._backgroundColor.toCssColorString();i.fillStyle=o,i.fillRect(t,t,n,n);let r=this._glowColor.toCssColorString();i.strokeStyle=r,i.lineWidth=this._glowWidth,i.strokeRect(t,t,n,n),this._drawGrid(i),i.lineWidth=this._glowWidth*.5,i.strokeRect(t,t,n,n),this._drawGrid(i);let s=this._color.toCssColorString();return i.strokeStyle=s,i.lineWidth=2,i.strokeRect(t,t,n,n),i.lineWidth=1,this._drawGrid(i),e};wR.prototype.getTileCredits=function(e,t,n){};wR.prototype.requestImage=function(e,t,n,i){return Promise.resolve(this._canvas)};wR.prototype.pickFeatures=function(e,t,n,i,o){};var ace=wR;var wko=x(T(),1);var mko=x(T(),1);var J9o=x(T(),1);var g9o=x(T(),1);function dp(){}dp._maxDecodingConcurrency=Math.max(fn.hardwareConcurrency-1,1);dp._decodeTaskProcessor=new qn("decodeI3S",dp._maxDecodingConcurrency);dp._promise=void 0;async function FDt(){if(await dp._decodeTaskProcessor.initWebAssemblyModule({wasmBinaryFile:"ThirdParty/draco_decoder.wasm"}))return dp._decodeTaskProcessor;throw new ae("I3S decoder could not be initialized.")}dp.decode=async function(e,t,n,i,o){return l(dp._promise)||(dp._promise=FDt()),dp._promise.then(function(r){let s=n._parent._data,a=n._parent._inverseRotationMatrix,c=0,d=0,u=0;l(s.obb)?(c=s.obb.center[0],d=s.obb.center[1],u=s.obb.center[2]):l(s.mbs)&&(c=s.mbs[0],d=s.mbs[1],u=s.mbs[2]);let m=q.fromRotationX(-W.PI_OVER_TWO),p=new q;q.multiply(m,a,p);let b=pe.fromDegrees(c,d,u),f=ne.WGS84.cartographicToCartesian(b),y={binaryData:n._data,featureData:l(i)&&l(i[0])?i[0].data:void 0,schema:t,bufferInfo:n._geometryBufferInfo,ellipsoidRadiiSquare:ne.WGS84.radiiSquared,url:e,geoidDataList:n._dataProvider._geoidDataList,cartographicCenter:b,cartesianCenter:f,parentRotation:p,enableFeatures:n._dataProvider.showFeatures,splitGeometryByColorTransparency:n._dataProvider.adjustMaterialAlphaMode,symbologyData:o,calculateNormals:n._dataProvider.calculateNormals};return r.scheduleTask(y)})};var DU=dp;var _9o=x(T(),1);function cce(e,t){this._parent=e,this._dataProvider=e._dataProvider,this._layer=e._layer,l(this._parent._nodeIndex)?this._resource=this._parent._layer.resource.getDerivedResource({url:`nodes/${this._parent._data.mesh.attribute.resource}/${t}`}):this._resource=this._parent.resource.getDerivedResource({url:t})}Object.defineProperties(cce.prototype,{resource:{get:function(){return this._resource}},data:{get:function(){return this._data}}});cce.prototype.load=async function(){return this._data=await up.loadJson(this._resource),this._data};var OU=cce;var C9o=x(T(),1);function by(e,t){this._storageInfo=t,this._parent=e,this._dataProvider=e._dataProvider,this._loadPromise=void 0;let n=`attributes/${t.key}/0`;l(this._parent._nodeIndex)?this._resource=this._parent._layer.resource.getDerivedResource({url:`nodes/${this._parent._data.mesh.attribute.resource}/${n}`}):this._resource=this._parent.resource.getDerivedResource({url:n})}Object.defineProperties(by.prototype,{resource:{get:function(){return this._resource}},header:{get:function(){return this._header}},values:{get:function(){if(l(this._values)){if(l(this._values.attributeValues))return this._values.attributeValues;if(l(this._values.objectIds))return this._values.objectIds}return[]}},name:{get:function(){return this._storageInfo.name}}});function ZJ(e){return e==="UInt8"||e==="Int8"?1:e==="UInt16"||e==="Int16"?2:e==="UInt32"||e==="Int32"||e==="Oid32"||e==="Float32"?4:e==="UInt64"||e==="Int64"||e==="Float64"?8:0}function IDt(e){return e==="String"?1:ZJ(e)}async function PDt(e){let t=await e._dataProvider._loadBinary(e._resource),n=new DataView(t);e._data=t,e._validateHeader(n);let i=e._parseHeader(n),o=e._getBodyOffset(i);e._validateBody(n,o),e._parseBody(n,o)}by.prototype.load=function(){return l(this._loadPromise)?this._loadPromise:(this._loadPromise=PDt(this).catch(function(e){console.error(e)}),this._loadPromise)};by.prototype._parseValue=function(e,t,n){let i;if(t==="UInt8")i=e.getUint8(n),n+=1;else if(t==="Int8")i=e.getInt8(n),n+=1;else if(t==="UInt16")i=e.getUint16(n,!0),n+=2;else if(t==="Int16")i=e.getInt16(n,!0),n+=2;else if(t==="UInt32")i=e.getUint32(n,!0),n+=4;else if(t==="Oid32")i=e.getUint32(n,!0),n+=4;else if(t==="Int32")i=e.getInt32(n,!0),n+=4;else if(t==="UInt64"){let o=e.getUint32(n,!0),r=e.getUint32(n+4,!0);i=o+Math.pow(2,32)*r,n+=8}else if(t==="Int64"){let o=e.getUint32(n,!0),r=e.getUint32(n+4,!0);r<Math.pow(2,31)?i=o+Math.pow(2,32)*r:i=o+Math.pow(2,32)*(r-Math.pow(2,32)),n+=8}else t==="Float32"?(i=e.getFloat32(n,!0),n+=4):t==="Float64"?(i=e.getFloat64(n,!0),n+=8):t==="String"&&(i=String.fromCharCode(e.getUint8(n)),n+=1);return{value:i,offset:n}};by.prototype._parseHeader=function(e){let t=0;this._header={};for(let n=0;n<this._storageInfo.header.length;n++){let i=this._storageInfo.header[n],o=this._parseValue(e,i.valueType,t);this._header[i.property]=o.value,t=o.offset}return t};by.prototype._parseBody=function(e,t){this._values={};for(let n=0;n<this._storageInfo.ordering.length;n++){let i=this._storageInfo.ordering[n],o=i==="ObjectIds"?"objectIds":i,r=this._storageInfo[o];if(l(r)){this._values[o]=[];for(let s=0;s<this._header.count;++s)if(r.valueType!=="String"){let a=this._parseValue(e,r.valueType,t);this._values[o].push(a.value),t=a.offset}else{let a=this._values.attributeByteCounts[s],c="";for(let d=0;d<a;++d){let u=this._parseValue(e,r.valueType,t);u.value.charCodeAt(0)!==0&&(c+=u.value),t=u.offset}this._values[o].push(c)}}}};by.prototype._getBodyOffset=function(e){let t=0;return l(this._storageInfo.attributeValues)?t=ZJ(this._storageInfo.attributeValues.valueType):l(this._storageInfo.objectIds)&&(t=ZJ(this._storageInfo.objectIds.valueType)),t>0?Math.ceil(e/t)*t:e};by.prototype._validateHeader=function(e){let t=0;for(let n=0;n<this._storageInfo.header.length;n++){let i=this._storageInfo.header[n];t+=IDt(i.valueType)}if(e.byteLength<t)throw new ae(`Invalid attribute buffer size (field: ${this.name}, header: ${t}, actual: ${e.byteLength})`)};by.prototype._validateBody=function(e,t){if(!l(this._header.count))throw new ae(`Invalid attribute buffer (field: ${this.name}, count is missing)`);let n;for(let i=0;i<this._storageInfo.ordering.length&&t<e.byteLength;i++){let o=this._storageInfo.ordering[i],r=o==="ObjectIds"?"objectIds":o,s=this._storageInfo[r];if(l(s))if(s.valueType!=="String"){r==="attributeByteCounts"&&(n=t);let a=ZJ(s.valueType);t+=a*this._header.count}else{if(!l(n))throw new ae(`Invalid attribute buffer (field: ${this.name}, attributeByteCounts is missing)`);for(let a=0;a<this._header.count&&t<e.byteLength;++a){let c=this._parseValue(e,this._storageInfo.attributeByteCounts.valueType,n);t+=c.value,n=c.offset}}else throw new ae(`Invalid attribute buffer (field: ${this.name}, ${r} is missing)`)}if(e.byteLength<t)throw new ae(`Invalid attribute buffer size (field: ${this.name}, expected: ${t}, actual: ${e.byteLength})`)};var BU=by;var v9o=x(T(),1);function zU(e,t){let n=e._dataProvider,i=e._layer,o;l(e._nodeIndex)?o=i.resource.getDerivedResource({url:`nodes/${e._data.mesh.geometry.resource}/${t}`}):o=e.resource.getDerivedResource({url:t}),this._parent=e,this._dataProvider=n,this._layer=i,this._resource=o,this._customAttributes=void 0}Object.defineProperties(zU.prototype,{resource:{get:function(){return this._resource}},data:{get:function(){return this._data}},customAttributes:{get:function(){return this._customAttributes}}});zU.prototype.load=function(){let e=this;return this._dataProvider._loadBinary(this._resource).then(function(t){return e._data=t,t})};var XDt=new h,NDt=new h,YDt=new h,MDt=new h,wDt=new h;function lce(e,t,n,i){let o=h.subtract(i,n,XDt),r=h.cross(o,h.subtract(e,n,NDt),MDt),s=h.cross(o,h.subtract(t,n,YDt),wDt);return h.dot(r,s)>=0}var kDt=new h,UDt=new h,DDt=new h,ODt=new h,BDt=new h,zDt=new h,HDt=new h,KDt=new h,JDt=new h,jDt=new h;zU.prototype.getClosestPointIndexOnTriangle=function(e,t,n){if(l(this._customAttributes)&&l(this._customAttributes.positions)){let i=new h(e,t,n);i.x-=this._customAttributes.cartesianCenter.x,i.y-=this._customAttributes.cartesianCenter.y,i.z-=this._customAttributes.cartesianCenter.z,q.multiplyByVector(this._customAttributes.parentRotation,i,i);let o=Number.MAX_VALUE,r,s,a,c,d=this._customAttributes.positions,u=this._customAttributes.indices,m;l(u)?m=u.length:m=d.length/3;for(let p=0;p<m;p++){let b,f,y;l(u)?(b=u[p],f=u[p+1],y=u[p+2]):(b=p*3,f=p*3+1,y=p*3+2);let _=h.fromElements(d[b*3],d[b*3+1],d[b*3+2],kDt),S=h.fromElements(d[f*3],d[f*3+1],d[f*3+2],UDt),Z=new h(d[y*3],d[y*3+1],d[y*3+2],DDt);if(!lce(i,_,S,Z)||!lce(i,S,_,Z)||!lce(i,Z,_,S))continue;let R=h.subtract(S,_,ODt),C=h.subtract(Z,_,BDt),E=h.cross(R,C,zDt);if(h.magnitude(E)===0)continue;let A=h.normalize(E,HDt),L=h.subtract(i,_,KDt),F=Math.abs(h.dot(L,A));if(F<o){o=F,r=p;let I=h.magnitudeSquared(h.subtract(i,_,L)),N=h.magnitudeSquared(h.subtract(i,S,JDt)),g=h.magnitudeSquared(h.subtract(i,Z,jDt));I<N&&I<g?(a=b,c=_,s=I):N<g?(a=f,c=S,s=N):(a=y,c=Z,s=g)}}if(l(r))return{index:a,distanceSquared:s,distance:Math.sqrt(s),queriedPosition:i,closestPosition:h.clone(c)}}return{index:-1,distanceSquared:Number.Infinity,distance:Number.Infinity}};function ENe(e){let t=[],n=e.length;for(let i=0;i<n;i++)i<3?t.push(IR(e[i])):t.push(e[i]);return t}zU.prototype._generateGltf=function(e,t,n,i,o,r,s,a){let c={pbrMetallicRoughness:{metallicFactor:0},doubleSided:!0,name:"Material"},d=!1,u,m="";if(l(this._parent._data.mesh)&&l(this._layer._data.materialDefinitions)){let R=this._parent._data.mesh.material.definition;if(R>=0&&R<this._layer._data.materialDefinitions.length){if(u=this._layer._data.materialDefinitions[R],c=u,l(c.pbrMetallicRoughness)&&l(c.pbrMetallicRoughness.baseColorTexture)){d=!0,c.pbrMetallicRoughness.baseColorTexture.index=0;let C="0";if(l(this._layer._data.textureSetDefinitions))for(let E=0;E<this._layer._data.textureSetDefinitions.length;E++){let A=this._layer._data.textureSetDefinitions[E];for(let L=0;L<A.formats.length;L++){let F=A.formats[L];if(F.format==="jpg"){C=F.name;break}}}l(this._parent._data.mesh)&&this._parent._data.mesh.material.resource>=0&&(m=this._layer.resource.getDerivedResource({url:`nodes/${this._parent._data.mesh.material.resource}/textures/${C}`}).url)}l(c.pbrMetallicRoughness)&&l(c.pbrMetallicRoughness.baseColorFactor)&&(c.pbrMetallicRoughness.baseColorFactor=ENe(c.pbrMetallicRoughness.baseColorFactor)),l(c.emissiveFactor)&&(c.emissiveFactor=ENe(c.emissiveFactor))}}else l(this._parent._data.textureData)&&(d=!0,m=this._parent.resource.getDerivedResource({url:`${this._parent._data.textureData[0].href}`}).url,c.pbrMetallicRoughness.baseColorTexture={index:0});l(c.alphaMode)&&(c.alphaMode=c.alphaMode.toUpperCase());let p=[],b=[],f=[];d&&(p=[{sampler:0,source:0}],b=[{uri:m}],f=[{magFilter:9729,minFilter:9986,wrapS:10497,wrapT:10497}]);let y=[],_=n.length;for(let Z=0;Z<_;Z++){let R=n[Z].primitives,C=R.length;for(let E=0;E<C;E++){let A=R[E];if(l(A.material)){for(;A.material>=y.length;){let F=$e(c,!0);y.push(F)}let L=y[A.material];l(A.extra)&&A.extra.isTransparent?l(L.alphaMode)||(L.alphaMode="BLEND"):L.alphaMode==="BLEND"&&(L.alphaMode="OPAQUE")}}}return{scene:0,scenes:[{nodes:e}],nodes:t,meshes:n,buffers:i,bufferViews:o,accessors:r,materials:y,textures:p,images:b,samplers:f,asset:{version:"2.0"},extensions:s,extensionsUsed:a}};var FA=zU;function El(e,t,n){let i,o,r,s;n?(i=0,o=e):(i=e._level+1,o=e._layer),typeof t=="number"?r=t:s=e.resource.getDerivedResource({url:`${t}/`}),this._parent=e,this._dataProvider=e._dataProvider,this._isRoot=n,this._level=i,this._layer=o,this._nodeIndex=r,this._resource=s,this._isLoading=!1,this._tile=void 0,this._data=void 0,this._geometryData=[],this._featureData=[],this._fields={},this._children=[],this._childrenReadyPromise=void 0,this._globalTransform=void 0,this._inverseGlobalTransform=void 0,this._inverseRotationMatrix=void 0,this._symbologyData=void 0}Object.defineProperties(El.prototype,{resource:{get:function(){return this._resource}},layer:{get:function(){return this._layer}},parent:{get:function(){return this._parent}},children:{get:function(){return this._children}},geometryData:{get:function(){return this._geometryData}},featureData:{get:function(){return this._featureData}},fields:{get:function(){return this._fields}},tile:{get:function(){return this._tile}},data:{get:function(){return this._data}}});El.prototype.load=async function(){let e=this;function t(){if(!e._isRoot){let o=e._create3DTileDefinition();e._tile=new ah(e._layer._tileset,e._dataProvider.resource,o,e._parent._tile),e._tile._i3sNode=e}}if(!l(this._nodeIndex)){let o=await up.loadJson(this._resource);e._data=o,t();return}let n=await this._layer._getNodeInNodePages(this._nodeIndex);e._data=n;let i;e._isRoot?i="nodes/root/":l(n.mesh)&&(i=`../${n.mesh.geometry.resource}/`),l(i)&&l(e._parent.resource)&&(e._resource=e._parent.resource.getDerivedResource({url:i})),t()};function ANe(e,t){let n=new BU(e,t);return e._fields[t.name]=n,n.load()}El.prototype.loadFields=function(){let e=this._layer._data.attributeStorageInfo,t=[];if(l(e))for(let n=0;n<e.length;n++){let i=e[n],o=this._fields[i.name];l(o)?t.push(o.load()):t.push(ANe(this,i))}return Promise.all(t)};El.prototype.loadField=function(e){let t=this._fields[e];if(l(t))return t.load();let n=this._layer._data.attributeStorageInfo;if(l(n))for(let i=0;i<n.length;i++){let o=n[i];if(o.name===e)return ANe(this,o)}return Promise.resolve()};El.prototype.getFieldsForPickedPosition=function(e){let t=this.geometryData[0];if(!l(t.customAttributes.featureIndex))return{};let n=t.getClosestPointIndexOnTriangle(e.x,e.y,e.z);if(n.index===-1||n.index>t.customAttributes.featureIndex.length)return{};let i=t.customAttributes.featureIndex[n.index];return this.getFieldsForFeature(i)};El.prototype.getFieldsForFeature=function(e){let t={};for(let n in this.fields)if(this.fields.hasOwnProperty(n)){let i=this.fields[n];e>=0&&e<i.values.length&&(t[i.name]=i.values[e])}return t};El.prototype._loadChildren=function(){let e=this;if(l(this._childrenReadyPromise))return this._childrenReadyPromise;let t=[];if(l(e._data.children))for(let n=0;n<e._data.children.length;n++){let i=e._data.children[n],o=new El(e,i.href??i,!1);e._children.push(o),t.push(o.load())}return this._childrenReadyPromise=Promise.all(t).then(function(){for(let n=0;n<e._children.length;n++)e._tile.children.push(e._children[n]._tile)}),this._childrenReadyPromise};El.prototype._loadGeometryData=function(){let e=[];if(l(this._data.geometryData))for(let t=0;t<this._data.geometryData.length;t++){let n=new FA(this,this._data.geometryData[t].href);this._geometryData.push(n),e.push(n.load())}else if(l(this._data.mesh)){let t=this._layer._findBestGeometryBuffers(this._data.mesh.geometry.definition,["position","uv0"]),n=`./geometries/${t.bufferIndex}/`,i=new FA(this,n);i._geometryDefinitions=t.definition,i._geometryBufferInfo=t.geometryBufferInfo,this._geometryData.push(i),e.push(i.load())}return Promise.all(e)};El.prototype._loadFeatureData=function(){let e=[];if(l(this._data.featureData))for(let t=0;t<this._data.featureData.length;t++){let n=new OU(this,this._data.featureData[t].href);this._featureData.push(n),e.push(n.load())}return Promise.all(e)};El.prototype._clearGeometryData=function(){this._geometryData=[]};El.prototype._create3DTileDefinition=function(){let e=this._data.obb,t=this._data.mbs;if(!l(e)&&!l(t)){console.error("Failed to load I3S node. Bounding volume is required.");return}let n;if(l(e)?n=pe.fromDegrees(e.center[0],e.center[1],e.center[2]):n=pe.fromDegrees(t[0],t[1],t[2]),l(this._dataProvider._geoidDataList)&&l(n))for(let S=0;S<this._dataProvider._geoidDataList.length;S++){let Z=this._dataProvider._geoidDataList[S],R=Z.projection.project(n);if(R.x>Z.nativeExtent.west&&R.x<Z.nativeExtent.east&&R.y>Z.nativeExtent.south&&R.y<Z.nativeExtent.north){n.height+=eOt(R.x,R.y,Z);break}}let i,o,r;l(e)?(i={box:[0,0,0,e.halfSize[0],0,0,0,e.halfSize[1],0,0,0,e.halfSize[2]]},r=Math.max(Math.max(this._data.obb.halfSize[0],this._data.obb.halfSize[1]),this._data.obb.halfSize[2]),o=ne.WGS84.cartographicToCartesian(n)):(i={sphere:[0,0,0,t[3]]},o=ne.WGS84.cartographicToCartesian(n),r=this._data.mbs[3]),r*=2;let s=1/0;if(l(this._data.lodThreshold))if(this._layer._data.nodePages.lodSelectionMetricType==="maxScreenThresholdSQ"){let S=Math.sqrt(this._data.lodThreshold/(Math.PI*.25));s=r/S}else if(this._layer._data.nodePages.lodSelectionMetricType==="maxScreenThreshold"){let S=this._data.lodThreshold;s=r/S}else console.error("Invalid lodSelectionMetricType in Layer");else if(l(this._data.lodSelection))for(let S=0;S<this._data.lodSelection.length;S++)this._data.lodSelection[S].metricType==="maxScreenThreshold"&&(s=r/this._data.lodSelection[S].maxError);s===1/0&&(s=1e5);let a=s*16,c=new Cc(0,0,0),d=_t.headingPitchRollQuaternion(o,c);l(this._data.obb)&&(d=new Ne(this._data.obb.quaternion[0],this._data.obb.quaternion[1],this._data.obb.quaternion[2],this._data.obb.quaternion[3]));let u=q.fromQuaternion(d),m=q.inverse(u,new q),p=new P(u[0],u[1],u[2],0,u[3],u[4],u[5],0,u[6],u[7],u[8],0,o.x,o.y,o.z,1),b=P.inverse(p,new P),f=P.clone(p);l(this._parent._globalTransform)&&P.multiply(p,this._parent._inverseGlobalTransform,f),this._globalTransform=p,this._inverseGlobalTransform=b,this._inverseRotationMatrix=m;let y=[];for(let S=0;S<this._children.length;S++)y.push(this._children[S]._create3DTileDefinition());return{children:y,refine:"REPLACE",boundingVolume:i,transform:[f[0],f[4],f[8],f[12],f[1],f[5],f[9],f[13],f[2],f[6],f[10],f[14],f[3],f[7],f[11],f[15]],content:{uri:l(this._resource)?this._resource.url:void 0},geometricError:a}};El.prototype._loadSymbology=async function(){!l(this._symbologyData)&&l(this._layer._symbology)&&(this._symbologyData=await this._layer._symbology._getSymbology(this))};El.prototype._createContentURL=async function(){let e={scene:0,scenes:[{nodes:[0]}],nodes:[{name:"singleNode"}],meshes:[],buffers:[],bufferViews:[],accessors:[],materials:[],textures:[],images:[],samplers:[],asset:{version:"2.0"}},t=[this._loadGeometryData()];if(this._dataProvider.legacyVersion16&&t.push(this._loadFeatureData()),await Promise.all(t),l(this._geometryData)&&this._geometryData.length>0){this._dataProvider._applySymbology&&await this._loadSymbology();let o=this._geometryData[0].resource.url,r=this._layer._data.store.defaultGeometrySchema,s=this._geometryData[0],a=await DU.decode(o,r,s,this._featureData[0],this._symbologyData);if(!l(a))return;e=s._generateGltf(a.meshData.nodesInScene,a.meshData.nodes,a.meshData.meshes,a.meshData.buffers,a.meshData.bufferViews,a.meshData.accessors,a.meshData.rootExtensions,a.meshData.extensionsUsed),this._geometryData[0]._customAttributes=a.meshData._customAttributes}let n=this._dataProvider._binarizeGltf(e),i=new Blob([n],{type:"application/binary"});return URL.createObjectURL(i)};async function QDt(e){let t=e._layer._filters,n=[];for(let i=0;i<t.length;i++){let o=e.loadField(t[i].name);n.push(o)}return await Promise.all(n),t}function qDt(e,t,n){if(!l(n.values)||n.values.length===0)return!1;let i=l(t)?t.values:[],o;e<i.length&&(o=i[e]);let r=!1;for(let s=0;s<n.values.length;s++)if(n.values[s]===o){r=!0;break}return r}async function GNe(e,t){let n=e._tile.content.batchTable;if(l(n)&&n.featuresLength>0){n.setAllShow(!0);let i=await QDt(e);if(i.length>0)for(let o=0;o<n.featuresLength;o++)for(let r=0;r<i.length;r++){let s=i[r];if(!qDt(o,e._fields[s.name],s)){n.setShow(o,!1);break}}}t.show=!0}El.prototype._filterFeatures=function(){let e=[];for(let n=0;n<this._children.length;n++){let i=this._children[n]._filterFeatures();e.push(i)}let t=this._tile?.content?._model;if(l(this._geometryData)&&this._geometryData.length>0&&l(t)&&t.ready){t.show=!1;let n=GNe(this,t);e.push(n)}return Promise.all(e)};ah.prototype._hookedRequestContent=ah.prototype.requestContent;ah.prototype.requestContent=function(){if(!this.tileset._isI3STileSet)return this._hookedRequestContent();if(!this._isLoading){this._isLoading=!0;let e=this;return this._i3sNode._createContentURL().then(t=>{if(!l(t)){e._isLoading=!1;return}return e._contentResource=new ve({url:t}),e._hookedRequestContent()}).then(t=>{let n=t?._model;return l(e._i3sNode._geometryData)&&e._i3sNode._geometryData.length>0&&l(n)&&(n.show=!1,n.readyEvent.addEventListener(()=>{GNe(e._i3sNode,n)})),e._isLoading=!1,t})}};function $Dt(e,t,n,i,o,r){let s=n*(1-e)+i*e,a=o*(1-e)+r*e;return s*(1-t)+a*t}function RJ(e,t,n,i){let o=e+t*n;return i[o]}function eOt(e,t,n){let i=n.nativeExtent,o=(e-i.west)/(i.east-i.west)*(n.width-1),r=(t-i.south)/(i.north-i.south)*(n.height-1),s=Math.floor(o),a=Math.floor(r);o-=s,r-=a;let c=s<n.width?s+1:s,d=a<n.height?a+1:a;a=n.height-1-a,d=n.height-1-d;let u=RJ(s,a,n.width,n.buffer),m=RJ(c,a,n.width,n.buffer),p=RJ(s,d,n.width,n.buffer),b=RJ(c,d,n.width,n.buffer),f=$Dt(o,r,u,m,p,b);return f=f*n.scale+n.offset,f}Object.defineProperties(ah.prototype,{i3sNode:{get:function(){return this._i3sNode}}});var IA=El;var eko=x(T(),1);function CJ(e){this._layer=e,this._defaultSymbology=void 0,this._valueFields=[],this._uniqueValueHash=void 0,this._classBreaksHash=void 0,this._parseLayerSymbology()}Object.defineProperties(CJ.prototype,{defaultSymbology:{get:function(){return this._defaultSymbology}}});function dce(e,t){let n=[];for(let i=0;i<e.length;i++){let o=U.byteToFloat(e[i]);i<3?n.push(IR(o)):n.push(o)}return n.length===3&&(l(t)?n.push(1-t/100):n.push(1)),n}function PA(e,t){let n={edges:void 0,material:void 0};if(l(e)&&l(e.symbolLayers))for(let i=0;i<e.symbolLayers.length;i++){let o=e.symbolLayers[i];if(o.type==="Fill"){let r=o.edges,s=o.outline;if(l(r)?(n.edges={},l(r.color)&&(n.edges.color=dce(r.color,r.transparency))):l(s)&&(n.edges={},l(s.color)&&(n.edges.color=dce(s.color,s.transparency))),!t){let a=o.material;l(a)&&(n.material={colorMixMode:a.colorMixMode},l(a.color)&&(n.material.color=dce(a.color,a.transparency)))}break}}return n}function tOt(e,t){if(l(e.uniqueValueGroups)){let n={};for(let i=0;i<e.uniqueValueGroups.length;i++){let o=e.uniqueValueGroups[i].classes;if(l(o))for(let r=0;r<o.length;r++){let s=PA(o[r].symbol,t),a=o[r].values;for(let c=0;c<a.length;c++){let d=a[c],u=n;for(let m=0;m<d.length;m++){let p=d[m];m===d.length-1?u[p]=s:(l(u[p])||(u[p]={}),u=u[p])}}}}return n}if(l(e.uniqueValueInfos)){let n={};for(let i=0;i<e.uniqueValueInfos.length;i++){let o=e.uniqueValueInfos[i];n[o.value]=PA(o.symbol,t)}return n}}function nOt(e,t){if(l(e.classBreakInfos)){let n=[...e.classBreakInfos];n.sort(function(o,r){let s=o.classMaxValue??o.classMinValue,a=r.classMaxValue??r.classMinValue;return s-a});let i={ranges:[],symbols:[]};l(e.minValue)&&(i.ranges.push(e.minValue),i.symbols.push(void 0));for(let o=0;o<n.length;o++){let r=n[o];l(r.classMinValue)&&(i.ranges.length===0||r.classMinValue>i.ranges[i.ranges.length-1])&&(i.ranges.push(r.classMinValue),i.symbols.push(void 0)),l(r.classMaxValue)&&(i.ranges.length===0||r.classMaxValue>i.ranges[i.ranges.length-1])&&(i.ranges.push(r.classMaxValue),i.symbols.push(PA(r.symbol,t)))}return i.symbols.push(void 0),i}}CJ.prototype._parseLayerSymbology=function(){let e=this._layer.data.drawingInfo;if(l(e)&&l(e.renderer)){let t=this._layer.data.cachedDrawingInfo,n=l(t)&&t.color===!0,i=e.renderer;i.type==="simple"?this._defaultSymbology=PA(i.symbol,n):i.type==="uniqueValue"?(this._defaultSymbology=PA(i.defaultSymbol,n),this._valueFields.push(i.field1),l(i.field2)&&this._valueFields.push(i.field2),l(i.field3)&&this._valueFields.push(i.field3),this._uniqueValueHash=tOt(i,n)):i.type==="classBreaks"&&(this._defaultSymbology=PA(i.defaultSymbol,n),this._valueFields.push(i.field),this._classBreaksHash=nOt(i,n))}};function LNe(e,t,n,i){let o=t[n];if(i<o.length){let r=o[i],s=e[r];return l(s)&&++n<t.length?LNe(s,t,n,i):s}}function iOt(e,t){let n=0,i=e.length;if(n<i)do{let o=n+i>>>1;e[o]<t?n=o+1:i=o}while(n<i);return n}function oOt(e,t,n){let i=t[n],o=iOt(e.ranges,i);return e.symbols[o]}CJ.prototype._getSymbology=async function(e){let t={default:this._defaultSymbology};if(this._valueFields.length>0){let n=[];for(let r=0;r<this._valueFields.length;r++)n.push(e.loadField(this._valueFields[r]));await Promise.all(n);let i=[];for(let r=0;r<this._valueFields.length;r++)i.push(e.fields[this._valueFields[r]].values);let o;if(l(this._uniqueValueHash)?o=r=>LNe(this._uniqueValueHash,i,0,r):l(this._classBreaksHash)&&(o=r=>oOt(this._classBreaksHash,i[0],r)),l(o)){let r=i[0];for(let s=0;s<r.length;s++){let a=o(s);l(a)&&(t[s]=a)}}}return t};var HU=CJ;function hu(e,t,n){this._dataProvider=e,this._parent=n,!l(t.href)&&l(t.id)&&(t.href=`layers/${t.id}`);let i=this._parent.resource.getUrlComponent(),o;i.match(/layers\/\d/)?o=`${i}`.replace(/\/+$/,""):o=`${i}`.replace(/\/?$/,"/").concat(`${t.href}`),this._version=t.store.version;let r=this._version.split(".");this._majorVersion=parseInt(r[0]),this._minorVersion=r.length>1?parseInt(r[1]):0,this._resource=new ve({url:o}),this._resource.setQueryParameters(this._dataProvider.resource.queryParameters),this._resource.appendForwardSlash(),this._data=t,this._rootNode=void 0,this._nodePages={},this._nodePageFetches={},this._extent=void 0,this._tileset=void 0,this._geometryDefinitions=void 0,this._filters=[],this._symbology=void 0,this._computeGeometryDefinitions(!0),this._computeExtent()}Object.defineProperties(hu.prototype,{resource:{get:function(){return this._resource}},rootNode:{get:function(){return this._rootNode}},tileset:{get:function(){return this._tileset}},data:{get:function(){return this._data}},version:{get:function(){return this._version}},majorVersion:{get:function(){return this._majorVersion}},minorVersion:{get:function(){return this._minorVersion}},legacyVersion16:{get:function(){if(l(this.version))return this.majorVersion<1||this.majorVersion===1&&this.minorVersion<=6}}});hu.prototype.load=async function(e){if(this._data.spatialReference.wkid!==4326)throw new ae(`Unsupported spatial reference: ${this._data.spatialReference.wkid}`);if(this._dataProvider.applySymbology&&(this._symbology=new HU(this)),await this._dataProvider.loadGeoidData(),await this._loadRootNode(e),await this._create3DTileset(e),this._rootNode._tile=this._tileset._root,this._tileset._root._i3sNode=this._rootNode,this.legacyVersion16)return this._rootNode._loadChildren()};hu.prototype._computeGeometryDefinitions=function(e){if(this._geometryDefinitions=[],l(this._data.geometryDefinitions))for(let t=0;t<this._data.geometryDefinitions.length;t++){let n=[],i=this._data.geometryDefinitions[t].geometryBuffers;for(let o=0;o<i.length;o++){let r=i[o],s=[],a=!1;if(l(r.compressedAttributes)&&e){a=!0;let c=r.compressedAttributes.attributes;for(let d=0;d<c.length;d++)s.push(c[d])}else for(let c in r)c!=="offset"&&s.push(c);n.push({compressed:a,attributes:s,index:i.indexOf(r)})}n.sort(function(o,r){return o.compressed&&!r.compressed?-1:!o.compressed&&r.compressed?1:o.attributes.length-r.attributes.length}),this._geometryDefinitions.push(n)}};hu.prototype._findBestGeometryBuffers=function(e,t){let n=this._geometryDefinitions[e];if(l(n)){for(let i=0;i<n.length;++i){let o=n[i],r=!1,s=o.attributes;for(let a=0;a<t.length;a++)if(!s.includes(t[a])){r=!0;break}if(!r)return{bufferIndex:o.index,definition:n,geometryBufferInfo:o}}if(l(n[0]))return{bufferIndex:0,definition:n,geometryBufferInfo:n[0]}}};hu.prototype._loadRootNode=function(e){if(l(this._data.nodePages)){let t=0;l(this._data.nodePages.rootIndex)&&(t=this._data.nodePages.rootIndex),this._rootNode=new IA(this,t,!0)}else this._rootNode=new IA(this,this._data.store.rootNode,!0);return this._rootNode.load(e)};hu.prototype._getNodeInNodePages=function(e){let t=Math.floor(e/this._data.nodePages.nodesPerPage),n=e%this._data.nodePages.nodesPerPage;return this._loadNodePage(t).then(function(i){return i.nodes[n]})};hu._fetchJson=function(e){return e.fetchJson()};hu.prototype._loadNodePage=function(e){let t=this;if(!l(this._nodePageFetches[e])){let n=this.resource.getDerivedResource({url:`nodepages/${e}/`}),i=hu._fetchJson(n).then(function(o){return l(o.error)&&o.error.code!==200?Promise.reject(o.error):(t._nodePages[e]=o.nodes,o)});this._nodePageFetches[e]=i}return this._nodePageFetches[e]};hu.prototype._computeExtent=function(){l(this._data.fullExtent)?this._extent=re.fromDegrees(this._data.fullExtent.xmin,this._data.fullExtent.ymin,this._data.fullExtent.xmax,this._data.fullExtent.ymax):l(this._data.store.extent)&&(this._extent=re.fromDegrees(this._data.store.extent[0],this._data.store.extent[1],this._data.store.extent[2],this._data.store.extent[3]))};hu.prototype._create3DTileset=async function(e){let t={asset:{version:"1.0"},geometricError:Number.MAX_VALUE,root:this._rootNode._create3DTileDefinition()},n=new Blob([JSON.stringify(t)],{type:"application/json"}),i=URL.createObjectURL(n),o=this._symbology?.defaultSymbology?.edges?.color;l(o)&&!l(e?.outlineColor)&&(e=l(e)?$e(e):{},e.outlineColor=U.fromCartesian4(ce.fromArray(o))),this._tileset=await Hr.fromUrl(i,e),this._tileset.show=this._parent.show,this._tileset._isI3STileSet=!0,this._tileset.tileUnload.addEventListener(function(r){r._i3sNode._clearGeometryData(),URL.revokeObjectURL(r._contentResource._url),r._contentResource=r._i3sNode.resource}),this._tileset.tileVisible.addEventListener(function(r){l(r._i3sNode)&&r._i3sNode._loadChildren()})};hu.prototype._updateVisibility=function(){l(this._tileset)&&(this._tileset.show=this._parent.show)};hu.prototype.filterByAttributes=function(e){this._filters=l(e)?$e(e,!0):[];let t=this._rootNode;return l(t)?t._filterFeatures():Promise.resolve()};var kR=hu;var gko=x(T(),1);function VJ(e,t){this._dataProvider=e,this._resource=new ve({url:t}),this._resource.setQueryParameters(e.resource.queryParameters),this._resource.appendForwardSlash()}Object.defineProperties(VJ.prototype,{resource:{get:function(){return this._resource}},data:{get:function(){return this._data}},names:{get:function(){let e=[],t=this._data.summary;if(l(t))for(let n=0;n<t.length;++n)e.push(t[n].fieldName);return e}}});VJ.prototype.load=async function(){return this._data=await up.loadJson(this._resource),this._data};VJ.prototype._getValues=function(e){let t=this._data.summary;if(l(t))for(let n=0;n<t.length;++n){let i=t[n];if(i.fieldName===e)return l(i.mostFrequentValues)?[...i.mostFrequentValues]:[]}};var KU=VJ;var Zko=x(T(),1);function JU(e,t,n){this._dataProvider=e,this._parent=t,this._data=n,this._name=n.name,this._modelName=n.modelName,this._visibility=n.visibility??!0,this._resource=void 0,this._sublayers=[],this._i3sLayers=[]}Object.defineProperties(JU.prototype,{resource:{get:function(){return this._resource}},data:{get:function(){return this._data}},name:{get:function(){return this._name}},modelName:{get:function(){return this._modelName}},sublayers:{get:function(){return this._sublayers}},visibility:{get:function(){return this._visibility},set:function(e){if(this._visibility!==e){this._visibility=e;for(let t=0;t<this._i3sLayers.length;t++)this._i3sLayers[t]._updateVisibility()}}},show:{get:function(){return this._visibility&&this._parent.show}}});JU._fromData=async function(e,t,n,i){let o=new JU(e,i,n);if(o._data.layerType==="group"){let r=o._data.sublayers;if(l(r)){let s=[];for(let c=0;c<r.length;c++){let d=JU._fromData(e,t,r[c],o);s.push(d)}let a=await Promise.all(s);for(let c=0;c<a.length;c++){let d=a[c];o._sublayers.push(d),o._i3sLayers.push(...d._i3sLayers)}}}else if(o._data.layerType==="3DObject"){let r=t.concat(`/sublayers/${o._data.id}`),s=new ve({url:r});s.setQueryParameters(e.resource.queryParameters),s.appendForwardSlash(),o._resource=s;let a=await up.loadJson(o._resource),c=new kR(e,a,o);o._i3sLayers.push(c)}else console.log(`${o._data.layerType} layer ${o._data.name} is skipped as not supported.`);return o};var jU=JU;var FNe=x(WNe(),1);function da(e){e=e??B.EMPTY_OBJECT,this._name=e.name,this._show=e.show??!0,this._geoidTiledTerrainProvider=e.geoidTiledTerrainProvider,this._showFeatures=e.showFeatures??!1,this._adjustMaterialAlphaMode=e.adjustMaterialAlphaMode??!1,this._applySymbology=e.applySymbology??!1,this._calculateNormals=e.calculateNormals??!1,this._cesium3dTilesetOptions=e.cesium3dTilesetOptions??B.EMPTY_OBJECT,this._layers=[],this._sublayers=[],this._data=void 0,this._extent=void 0,this._geoidDataPromise=void 0,this._geoidDataList=void 0,this._decoderTaskProcessor=void 0,this._taskProcessorReadyPromise=void 0,this._attributeStatistics=[],this._layersExtent=[]}Object.defineProperties(da.prototype,{name:{get:function(){return this._name}},show:{get:function(){return this._show},set:function(e){if(this._show!==e){this._show=e;for(let t=0;t<this._layers.length;t++)this._layers[t]._updateVisibility()}}},geoidTiledTerrainProvider:{get:function(){return this._geoidTiledTerrainProvider}},layers:{get:function(){return this._layers}},sublayers:{get:function(){return this._sublayers}},data:{get:function(){return this._data}},extent:{get:function(){return this._extent}},resource:{get:function(){return this._resource}},showFeatures:{get:function(){return this._showFeatures}},adjustMaterialAlphaMode:{get:function(){return this._adjustMaterialAlphaMode}},applySymbology:{get:function(){return this._applySymbology}},calculateNormals:{get:function(){return this._calculateNormals}}});da.prototype.destroy=function(){for(let e=0;e<this._layers.length;e++)l(this._layers[e]._tileset)&&this._layers[e]._tileset.destroy();return ue(this)};da.prototype.isDestroyed=function(){return!1};da.prototype.update=function(e){for(let t=0;t<this._layers.length;t++)l(this._layers[t]._tileset)&&this._layers[t]._tileset.update(e)};da.prototype.prePassesUpdate=function(e){for(let t=0;t<this._layers.length;t++)l(this._layers[t]._tileset)&&this._layers[t]._tileset.prePassesUpdate(e)};da.prototype.postPassesUpdate=function(e){for(let t=0;t<this._layers.length;t++)l(this._layers[t]._tileset)&&this._layers[t]._tileset.postPassesUpdate(e)};da.prototype.updateForPass=function(e,t){for(let n=0;n<this._layers.length;n++)l(this._layers[n]._tileset)&&this._layers[n]._tileset.updateForPass(e,t)};function rOt(e,t){let n=e.resource.getUrlComponent(),i;return n.match(/layers\/\d/)?i=`${n}`.replace(/\/+$/,""):i=`${n}`.replace(/\/?$/,"/").concat(`layers/${t}`),i}async function vNe(e,t,n){if(t.layerType==="Building"){l(n.showFeatures)||(e._showFeatures=!0),l(n.adjustMaterialAlphaMode)||(e._adjustMaterialAlphaMode=!0),l(n.applySymbology)||(e._applySymbology=!0),l(n.calculateNormals)||(e._calculateNormals=!0);let i=rOt(e,t.id);if(l(t.sublayers)){let o=[];for(let s=0;s<t.sublayers.length;s++){let a=jU._fromData(e,i,t.sublayers[s],e);o.push(a)}let r=await Promise.all(o);for(let s=0;s<r.length;s++){let a=r[s];e._sublayers.push(a),e._layers.push(...a._i3sLayers)}}if(l(t.statisticsHRef)){let o=i.concat(`/${t.statisticsHRef}`),r=new KU(e,o);await r.load(),e._attributeStatistics.push(r)}if(l(t.fullExtent)){let o=re.fromDegrees(t.fullExtent.xmin,t.fullExtent.ymin,t.fullExtent.xmax,t.fullExtent.ymax);e._layersExtent.push(o)}}else if(t.layerType==="3DObject"||t.layerType==="IntegratedMesh"){!l(n.calculateNormals)&&!l(t.textureSetDefinitions)&&(e._calculateNormals=!0);let i=new kR(e,t,e);e._layers.push(i),l(i._extent)&&e._layersExtent.push(i._extent)}else console.log(`${t.layerType} layer ${t.name} is skipped as not supported.`)}da.fromUrl=async function(e,t){t=t??B.EMPTY_OBJECT;let n=ve.createIfNeeded(e);n.setQueryParameters({f:"pjson"},!0);let i=await da.loadJson(n),o=new da(t);if(o._resource=n,o._data=i,l(i.layers)){let s=[];for(let a=0;a<i.layers.length;a++){let c=vNe(o,i.layers[a],t);s.push(c)}await Promise.all(s)}else await vNe(o,i,t);o._computeExtent();let r=[];for(let s=0;s<o._layers.length;s++)r.push(o._layers[s].load(t.cesium3dTilesetOptions));return await Promise.all(r),o};da._fetchJson=function(e){return e.fetchJson()};da.loadJson=async function(e){let t=await da._fetchJson(e);if(l(t.error)){if(console.error("Failed to fetch I3S ",e.url),l(t.error.message)&&console.error(t.error.message),l(t.error.details))for(let n=0;n<t.error.details.length;n++)console.log(t.error.details[n]);throw new ae(t.error)}return t};da.prototype._loadBinary=async function(e){let t=await e.fetchArrayBuffer();if(t.byteLength>0&&new Uint8Array(t)[0]===123&&new TextDecoder().decode(t).includes("404"))throw new ae(`Failed to load binary: ${e.url}`);return t};da.prototype._binarizeGltf=function(e){let n=new TextEncoder().encode(JSON.stringify(e)),i=new Uint8Array(n.byteLength+20),o={magic:new Uint8Array(i.buffer,0,4),version:new Uint32Array(i.buffer,4,1),length:new Uint32Array(i.buffer,8,1),chunkLength:new Uint32Array(i.buffer,12,1),chunkType:new Uint32Array(i.buffer,16,1),chunkData:new Uint8Array(i.buffer,20,n.byteLength)};return o.magic[0]=103,o.magic[1]=108,o.magic[2]=84,o.magic[3]=70,o.version[0]=2,o.length[0]=i.byteLength,o.chunkLength[0]=n.byteLength,o.chunkType[0]=1313821514,o.chunkData.set(n),i};var sOt=new k;function aOt(e,t){let n=e.tilingScheme,i=[],o={},r=e._lodCount,s=pe.fromRadians(t.west,t.north),a=pe.fromRadians(t.east,t.south),c=n.positionToTileXY(s,r),d=n.positionToTileXY(a,r);for(let m=c.x;m<=d.x;m++)for(let p=c.y;p<=d.y;p++){let b=k.fromElements(m,p,sOt),f=b.toString();if(!o.hasOwnProperty(f)){let y={x:b.x,y:b.y,level:r,tilingScheme:n,terrainProvider:e,positions:[]};o[f]=y,i.push(y)}}let u=[];for(let m=0;m<i.length;++m){let p=i[m],b=p.terrainProvider.requestTileGeometry(p.x,p.y,p.level);u.push(b)}return Promise.all(u).then(function(m){let p=[];for(let b=0;b<m.length;b++){let f={tilingScheme:n,x:i[b].x,y:i[b].y,level:i[b].level},y=m[b],_="Geographic";n._projection instanceof Ti&&(_="WebMercator");let S={projectionType:_,projection:n._projection,nativeExtent:n.tileXYToNativeRectangle(f.x,f.y,f.level),height:y._height,width:y._width,scale:y._structure.heightScale,offset:y._structure.heightOffset};if(y._encoding===uh.LERC){let Z=FNe.default.decode(y._buffer);S.buffer=Z.pixels[0]}else S.buffer=y._buffer;p.push(S)}return p})}async function cOt(e){let t=e._geoidTiledTerrainProvider;if(l(t))try{let n=await aOt(t,e._extent);e._geoidDataList=n}catch{console.log("Error retrieving Geoid Terrain tiles - no geoid conversion will be performed.")}}da.prototype.loadGeoidData=async function(){return l(this._geoidDataPromise)?this._geoidDataPromise:(this._geoidDataPromise=cOt(this),this._geoidDataPromise)};da.prototype._computeExtent=function(){let e;for(let t=0;t<this._layersExtent.length;t++){let n=this._layersExtent[t];l(e)?re.union(e,n,e):e=re.clone(n)}this._extent=e};da.prototype.getAttributeNames=function(){let e=[];for(let t=0;t<this._attributeStatistics.length;++t)e.push(...this._attributeStatistics[t].names);return e};da.prototype.getAttributeValues=function(e){for(let t=0;t<this._attributeStatistics.length;++t){let n=this._attributeStatistics[t]._getValues(e);if(l(n))return n}return[]};da.prototype.filterByAttributes=function(e){let t=[];for(let n=0;n<this._layers.length;n++){let i=this._layers[n].filterByAttributes(e);t.push(i)}return Promise.all(t)};var up=da;var Jko=x(T(),1);var QU={};QU.createTilesetFromIModelId=async function({iModelId:e,changesetId:t,tilesetOptions:n}){let{exports:i}=await la.getExports(e,t);if(i.length>0&&i.every(c=>c.status===la.ExportStatus.Invalid))throw new ae(`All exports for this iModel are Invalid: ${e}`);let o=i.find(c=>c.status===la.ExportStatus.Complete);if(!l(o))return;let r=new URL(o._links.mesh.href);r.pathname=`${r.pathname}/tileset.json`;let s=r.toString(),a=new ve({url:s});return Hr.fromUrl(a,n)};QU.createTilesetForRealityDataId=async function({iTwinId:e,realityDataId:t,type:n,rootDocument:i,tilesetOptions:o}){if(!l(n)||!l(i)){let c=await la.getRealityDataMetadata(e,t);i=c.rootDocument,n=c.type}if(![la.RealityDataType.Cesium3DTiles,la.RealityDataType.PNTS,la.RealityDataType.RealityMesh3DTiles,la.RealityDataType.Terrain3DTiles,la.RealityDataType.GaussianSplat3DTiles].includes(n))throw new ae(`Reality data type is not a mesh type: ${n}`);let s=await la.getRealityDataURL(e,t,i),a={maximumScreenSpaceError:4,...o};return Hr.fromUrl(s,a)};QU.createDataSourceForRealityDataId=async function({iTwinId:e,realityDataId:t,type:n,rootDocument:i}){if(!l(n)||!l(i)){let s=await la.getRealityDataMetadata(e,t);i=s.rootDocument,n=s.type}if(![la.RealityDataType.KML,la.RealityDataType.GeoJSON].includes(n))throw new ae(`Reality data type is not a data source type: ${n}`);let r=await la.getRealityDataURL(e,t,i);return n===la.RealityDataType.GeoJSON?ET.load(r):VR.load(r)};QU.loadGeospatialFeatures=async function({iTwinId:e,collectionId:t,limit:n}){let i=n??1e4,o=`${la.apiEndpoint}geospatial-features/itwins/${e}/ogc/collections/${t}/items`,r=new ve({url:o,headers:{Authorization:la._getAuthorizationHeader(),Accept:"application/vnd.bentley.itwin-platform.v1+json"},queryParameters:{limit:i,client:"CesiumJS"}});return ET.load(r)};var uce=QU;var qko=x(T(),1);function INe(){}Object.defineProperties(INe.prototype,{color:{get:ge.throwInstantiationError},intensity:{get:ge.throwInstantiationError}});var mce=INe;var rUo=x(T(),1);var lOt=/\/$/,PNe=new Lt('© <a href="https://www.mapbox.com/about/maps/">Mapbox</a> © <a href="http://www.openstreetmap.org/copyright">OpenStreetMap</a> <strong><a href="https://www.mapbox.com/map-feedback/">Improve this map</a></strong>');function XA(e){e=e??B.EMPTY_OBJECT;let t=e.styleId,n=e.accessToken;this._defaultAlpha=void 0,this._defaultNightAlpha=void 0,this._defaultDayAlpha=void 0,this._defaultBrightness=void 0,this._defaultContrast=void 0,this._defaultHue=void 0,this._defaultSaturation=void 0,this._defaultGamma=void 0,this._defaultMinificationFilter=void 0,this._defaultMagnificationFilter=void 0;let i=ve.createIfNeeded(e.url??"https://api.mapbox.com/styles/v1/");this._styleId=t,this._accessToken=n;let o=e.tilesize??512;this._tilesize=o;let r=e.username??"mapbox";this._username=r;let s=l(e.scaleFactor)?"@2x":"",a=i.getUrlComponent();lOt.test(a)||(a+="/"),a+=`${this._username}/${t}/tiles/${this._tilesize}/{z}/{x}/{y}${s}`,i.url=a,i.setQueryParameters({access_token:n});let c;l(e.credit)?(c=e.credit,typeof c=="string"&&(c=new Lt(c))):c=PNe,this._resource=i,this._imageryProvider=new Rs({url:i,credit:c,ellipsoid:e.ellipsoid,minimumLevel:e.minimumLevel,maximumLevel:e.maximumLevel,rectangle:e.rectangle})}Object.defineProperties(XA.prototype,{url:{get:function(){return this._imageryProvider.url}},rectangle:{get:function(){return this._imageryProvider.rectangle}},tileWidth:{get:function(){return this._imageryProvider.tileWidth}},tileHeight:{get:function(){return this._imageryProvider.tileHeight}},maximumLevel:{get:function(){return this._imageryProvider.maximumLevel}},minimumLevel:{get:function(){return this._imageryProvider.minimumLevel}},tilingScheme:{get:function(){return this._imageryProvider.tilingScheme}},tileDiscardPolicy:{get:function(){return this._imageryProvider.tileDiscardPolicy}},errorEvent:{get:function(){return this._imageryProvider.errorEvent}},credit:{get:function(){return this._imageryProvider.credit}},proxy:{get:function(){return this._imageryProvider.proxy}},hasAlphaChannel:{get:function(){return this._imageryProvider.hasAlphaChannel}}});XA.prototype.getTileCredits=function(e,t,n){};XA.prototype.requestImage=function(e,t,n,i){return this._imageryProvider.requestImage(e,t,n,i)};XA.prototype.pickFeatures=function(e,t,n,i,o){return this._imageryProvider.pickFeatures(e,t,n,i,o)};XA._defaultCredit=PNe;var hce=XA;var AUo=x(T(),1);var gUo=x(T(),1);var dOt=0,uOt=14,mOt=-1e3,hOt=1e4,fOt=2*Math.PI*ne.WGS84.maximumRadius,pOt=256,bOt=new re,gOt=new re,fce=class{constructor(t,n){n=n??{},this._resource=ve.createIfNeeded(t),this._urlTemplate=this._resource.url,this._extent=re.clone(n.extent),this._minZoom=n.minZoom??dOt,this._maxZoom=n.maxZoom??uOt,this._featureIdProperty=n.featureIdProperty,this._heightReference=n.heightReference,this._scene=n.scene,this._show=!0,this._tileset=void 0,this._tilesetJsonUrl=void 0}static async fromUrl(t,n){let i=new this(t,n);return await i._initializeTileset(),i}get urlTemplate(){return this._urlTemplate}get resource(){return this._resource}get extent(){return this._extent}get tileset(){return this._tileset}get show(){return this._show}set show(t){this._show=t,l(this._tileset)&&(this._tileset.show=t)}_createRuntimeTilesetOptions(){return{minZoom:this._minZoom,maxZoom:this._maxZoom,extent:this._extent}}_createTilesetLoadOptions(){return{heightReference:this._heightReference,scene:this._scene}}_configureTileset(t){}_createCodec(){}async _initializeTileset(){let t=yOt(this._resource,this._createRuntimeTilesetOptions()),n=new Blob([JSON.stringify(t)],{type:"application/json"}),i=URL.createObjectURL(n);this._tilesetJsonUrl=i;try{this._tileset=await Hr.fromUrl(i,this._createTilesetLoadOptions())}catch(o){throw URL.revokeObjectURL(i),this._tilesetJsonUrl=void 0,o}URL.revokeObjectURL(i),this._tilesetJsonUrl=void 0,this._configureTileset(this._tileset),this._tileset._runtimeContentCodec=this._createCodec(),this._tileset.show=this._show}update(t){l(this._tileset)&&this._tileset.update(t)}prePassesUpdate(t){l(this._tileset)&&this._tileset.prePassesUpdate(t)}postPassesUpdate(t){l(this._tileset)&&this._tileset.postPassesUpdate(t)}updateForPass(t,n){l(this._tileset)&&this._tileset.updateForPass(t,n)}isDestroyed(){return!1}destroy(){return l(this._tileset)&&(this._tileset.destroy(),this._tileset=void 0),l(this._tilesetJsonUrl)&&(URL.revokeObjectURL(this._tilesetJsonUrl),this._tilesetJsonUrl=void 0),this._resource=void 0,this._extent=void 0,this._featureIdProperty=void 0,ue(this)}};function yOt(e,t){let n=new Nr,i=l(t.extent)?re.clone(t.extent):re.clone(n.rectangle),o=TOt(n,i,t.minZoom),r={boundingVolume:{region:YNe(i)},geometricError:NNe(0),refine:"REPLACE",children:[]};for(let s=o.minY;s<=o.maxY;s++)for(let a=o.minX;a<=o.maxX;a++){let c=XNe(n,e,i,t.minZoom,t.maxZoom,a,s);l(c)&&r.children.push(c)}return r.children.length===0&&(r.geometricError=0),{asset:{version:"1.1"},geometricError:r.geometricError,root:r}}function XNe(e,t,n,i,o,r,s){if(!_Ot(e,i,r,s,n,bOt,gOt))return;let a=e.tileXYToRectangle(r,s,i,new re),c={boundingVolume:{region:YNe(a)},geometricError:i<o?NNe(i):0,refine:"REPLACE",content:{uri:xOt(t,i,r,s)}};if(i>=o)return c;let d=i+1,u=[];for(let m=s*2;m<=s*2+1;m++)for(let p=r*2;p<=r*2+1;p++){let b=XNe(e,t,n,d,o,p,m);l(b)&&u.push(b)}return u.length>0?c.children=u:c.geometricError=0,c}function xOt(e,t,n,i){let r=e.url.replace(/\{z\}/gi,`${t}`).replace(/\{x\}/gi,`${n}`).replace(/\{y\}/gi,`${i}`);return Tm(r)}function NNe(e){return fOt/((1<<e)*pOt)}function YNe(e){return[e.west,e.south,e.east,e.north,mOt,hOt]}function TOt(e,t,n){let i=(1<<n)-1,o=pe.fromRadians(t.west,t.north),r=pe.fromRadians(t.east,t.south),s=e.positionToTileXY(o,n),a=e.positionToTileXY(r,n);return!l(s)||!l(a)||t.west>t.east?{minX:0,maxX:i,minY:0,maxY:i}:{minX:W.clamp(Math.min(s.x,a.x),0,i),maxX:W.clamp(Math.max(s.x,a.x),0,i),minY:W.clamp(Math.min(s.y,a.y),0,i),maxY:W.clamp(Math.max(s.y,a.y),0,i)}}function _Ot(e,t,n,i,o,r,s){let a=e.tileXYToRectangle(n,i,t,r);return l(re.intersection(a,o,s))}var qU=fce;var AJ=class extends qU{static async fromUrl(t,n){return super.fromUrl(t,n)}_createTilesetLoadOptions(){return{...super._createTilesetLoadOptions(),skipLevelOfDetail:!1,enablePick:!0,featureIdLabel:"featureId_0",instanceFeatureIdLabel:"instanceFeatureId_0"}}_configureTileset(t){t._modelUpAxis=Bi.Z,t._modelForwardAxis=Bi.X}_createCodec(){let t=this._featureIdProperty;return{contentType:"mvt",missingTilePolicy:{statusCodes:[404,204]},createContent:async(n,i,o,r)=>{let s=wU(r),a=MNe(o.getUrlComponent(!0)),c=WU(s,a,{featureIdProperty:t});if(!l(c)){if(!SOt(s))return new o0(n,i);throw new ae("Decoded MVT tile did not produce vector glTF content.")}return Mx.fromGltf(n,i,o,c)}}}};function MNe(e){let t=e.match(/\/(\d+)\/(\d+)\/(\d+)(?:\.[^/?#]+)?(?:[?#]|$)/i);return t?{tileZ:parseInt(t[1],10),tileX:parseInt(t[2],10),tileY:parseInt(t[3],10)}:(xt("MVTDataProvider.parseTileCoordinates",`MVT tile URL did not match /{z}/{x}/{y} pattern. Falling back to z/x/y = 0/0/0. URL: ${e}`),{tileZ:0,tileX:0,tileY:0})}function SOt(e){let t=e.layers;for(let n=0;n<t.length;n++)if(t[n].features.length>0)return!0;return!1}AJ._parseTileCoordinates=MNe;var pce=AJ;var LUo=x(T(),1);function bce(e){}bce.prototype.isReady=function(){return!0};bce.prototype.shouldDiscardImage=function(e){return!1};var gce=bce;var MUo=x(T(),1);var ZOt=new Lt("MapQuest, Open Street Map and contributors, CC-BY-SA");function GJ(e){e=e??B.EMPTY_OBJECT;let t=ve.createIfNeeded(e.url??"https://tile.openstreetmap.org/");t.appendForwardSlash(),t.url+=`{z}/{x}/{y}${e.retinaTiles?"@2x":""}.${e.fileExtension??"png"}`;let n=new Nr({ellipsoid:e.ellipsoid}),i=256,o=256,r=e.minimumLevel??0,s=e.maximumLevel,a=e.rectangle??n.rectangle,c=n.positionToTileXY(re.southwest(a),r),d=n.positionToTileXY(re.northeast(a),r),u=(Math.abs(d.x-c.x)+1)*(Math.abs(d.y-c.y)+1),m=e.credit??ZOt;typeof m=="string"&&(m=new Lt(m)),Rs.call(this,{url:t,credit:m,tilingScheme:n,tileWidth:i,tileHeight:o,minimumLevel:r,maximumLevel:s,rectangle:a})}l(Object.create)&&(GJ.prototype=Object.create(Rs.prototype),GJ.prototype.constructor=GJ);var gy=GJ;var UUo=x(T(),1);function wNe(){ge.throwInstantiationError()}Object.defineProperties(wNe.prototype,{show:{get:ge.throwInstantiationError,set:ge.throwInstantiationError},transform:{get:ge.throwInstantiationError},credit:{get:ge.throwInstantiationError}});var yce=wNe;var BUo=x(T(),1);function LJ(){ge.throwInstantiationError()}Object.defineProperties(LJ.prototype,{});LJ.fromUrl=function(e){ge.throwInstantiationError()};LJ.prototype.loadPanorama=function(e){ge.throwInstantiationError()};var xce=LJ;var qUo=x(T(),1);var ROt=new k(1,1);function Tce(e){e=e??B.EMPTY_OBJECT,this.mass=e.mass??1,this.position=h.clone(e.position??h.ZERO),this.velocity=h.clone(e.velocity??h.ZERO),this.life=e.life??Number.MAX_VALUE,this.image=e.image,this.startColor=U.clone(e.startColor??U.WHITE),this.endColor=U.clone(e.endColor??U.WHITE),this.startScale=e.startScale??1,this.endScale=e.endScale??1,this.imageSize=k.clone(e.imageSize??ROt),this._age=0,this._normalizedAge=0,this._billboard=void 0}Object.defineProperties(Tce.prototype,{age:{get:function(){return this._age}},normalizedAge:{get:function(){return this._normalizedAge}}});var kNe=new h;Tce.prototype.update=function(e,t){return h.multiplyByScalar(this.velocity,e,kNe),h.add(this.position,kNe,this.position),l(t)&&t(this,e),this._age+=e,this.life===Number.MAX_VALUE?this._normalizedAge=0:this._normalizedAge=this._age/this.life,this._age<=this.life};var NA=Tce;var t5o=x(T(),1);function UNe(e){e=e??B.EMPTY_OBJECT,this.time=e.time??0,this.minimum=e.minimum??0,this.maximum=e.maximum??50,this._complete=!1}Object.defineProperties(UNe.prototype,{complete:{get:function(){return this._complete}}});var _ce=UNe;var o5o=x(T(),1);function DNe(e){}DNe.prototype.emit=function(e){ge.throwInstantiationError()};var Sce=DNe;var x5o=x(T(),1);var ONe=new k(1,1);function $U(e){e=e??B.EMPTY_OBJECT,this.show=e.show??!0,this.updateCallback=e.updateCallback,this.loop=e.loop??!0,this.image=e.image??void 0;let t=e.emitter;l(t)||(t=new PU(.5)),this._emitter=t,this._bursts=e.bursts,this._modelMatrix=P.clone(e.modelMatrix??P.IDENTITY),this._emitterModelMatrix=P.clone(e.emitterModelMatrix??P.IDENTITY),this._matrixDirty=!0,this._combinedMatrix=new P,this._startColor=U.clone(e.color??e.startColor??U.WHITE),this._endColor=U.clone(e.color??e.endColor??U.WHITE),this._startScale=e.scale??e.startScale??1,this._endScale=e.scale??e.endScale??1,this._emissionRate=e.emissionRate??5,this._minimumSpeed=e.speed??e.minimumSpeed??1,this._maximumSpeed=e.speed??e.maximumSpeed??1,this._minimumParticleLife=e.particleLife??e.minimumParticleLife??5,this._maximumParticleLife=e.particleLife??e.maximumParticleLife??5,this._minimumMass=e.mass??e.minimumMass??1,this._maximumMass=e.mass??e.maximumMass??1,this._minimumImageSize=k.clone(e.imageSize??e.minimumImageSize??ONe),this._maximumImageSize=k.clone(e.imageSize??e.maximumImageSize??ONe),this._sizeInMeters=e.sizeInMeters??!1,this._lifetime=e.lifetime??Number.MAX_VALUE,this._billboardCollection=void 0,this._particles=[],this._particlePool=[],this._previousTime=void 0,this._currentTime=0,this._carryOver=0,this._complete=new Se,this._isComplete=!1,this._updateParticlePool=!0,this._particleEstimate=0}Object.defineProperties($U.prototype,{emitter:{get:function(){return this._emitter},set:function(e){this._emitter=e}},bursts:{get:function(){return this._bursts},set:function(e){this._bursts=e,this._updateParticlePool=!0}},modelMatrix:{get:function(){return this._modelMatrix},set:function(e){this._matrixDirty=this._matrixDirty||!P.equals(this._modelMatrix,e),P.clone(e,this._modelMatrix)}},emitterModelMatrix:{get:function(){return this._emitterModelMatrix},set:function(e){this._matrixDirty=this._matrixDirty||!P.equals(this._emitterModelMatrix,e),P.clone(e,this._emitterModelMatrix)}},startColor:{get:function(){return this._startColor},set:function(e){U.clone(e,this._startColor)}},endColor:{get:function(){return this._endColor},set:function(e){U.clone(e,this._endColor)}},startScale:{get:function(){return this._startScale},set:function(e){this._startScale=e}},endScale:{get:function(){return this._endScale},set:function(e){this._endScale=e}},emissionRate:{get:function(){return this._emissionRate},set:function(e){this._emissionRate=e,this._updateParticlePool=!0}},minimumSpeed:{get:function(){return this._minimumSpeed},set:function(e){this._minimumSpeed=e}},maximumSpeed:{get:function(){return this._maximumSpeed},set:function(e){this._maximumSpeed=e}},minimumParticleLife:{get:function(){return this._minimumParticleLife},set:function(e){this._minimumParticleLife=e}},maximumParticleLife:{get:function(){return this._maximumParticleLife},set:function(e){this._maximumParticleLife=e,this._updateParticlePool=!0}},minimumMass:{get:function(){return this._minimumMass},set:function(e){this._minimumMass=e}},maximumMass:{get:function(){return this._maximumMass},set:function(e){this._maximumMass=e}},minimumImageSize:{get:function(){return this._minimumImageSize},set:function(e){this._minimumImageSize=e}},maximumImageSize:{get:function(){return this._maximumImageSize},set:function(e){this._maximumImageSize=e}},sizeInMeters:{get:function(){return this._sizeInMeters},set:function(e){this._sizeInMeters=e}},lifetime:{get:function(){return this._lifetime},set:function(e){this._lifetime=e}},complete:{get:function(){return this._complete}},isComplete:{get:function(){return this._isComplete}}});function COt(e){let t=e._emissionRate,n=e._maximumParticleLife,i=0,o=e._bursts;if(l(o)){let m=o.length;for(let p=0;p<m;++p)i+=o[p].maximum}let r=e._billboardCollection,s=e.image,a=Math.ceil(t*n+i),c=e._particles,d=e._particlePool,u=Math.max(a-c.length-d.length,0);for(let m=0;m<u;++m){let p=new NA;p._billboard=r.add({image:s,show:!1}),d.push(p)}e._particleEstimate=a}function VOt(e){let t=e._particlePool.pop();return l(t)||(t=new NA),t}function EOt(e,t){e._particlePool.push(t)}function AOt(e){let t=e._particles,n=e._particlePool,i=e._billboardCollection,o=t.length,r=n.length,s=e._particleEstimate,a=r-Math.max(s-o-r,0);for(let c=a;c<r;++c){let d=n[c];i.remove(d._billboard)}n.length=a}function GOt(e){l(e._billboard)&&(e._billboard.show=!1)}function BNe(e,t){let n=t._billboard;l(n)||(n=t._billboard=e._billboardCollection.add({image:t.image})),n.width=t.imageSize.x,n.height=t.imageSize.y,n.position=t.position,n.sizeInMeters=e.sizeInMeters,n.show=!0;let i=W.lerp(t.startColor.red,t.endColor.red,t.normalizedAge),o=W.lerp(t.startColor.green,t.endColor.green,t.normalizedAge),r=W.lerp(t.startColor.blue,t.endColor.blue,t.normalizedAge),s=W.lerp(t.startColor.alpha,t.endColor.alpha,t.normalizedAge);n.color=new U(i,o,r,s),n.scale=W.lerp(t.startScale,t.endScale,t.normalizedAge)}function LOt(e,t){t.startColor=U.clone(e._startColor,t.startColor),t.endColor=U.clone(e._endColor,t.endColor),t.startScale=e._startScale,t.endScale=e._endScale,t.image=e.image,t.life=W.randomBetween(e._minimumParticleLife,e._maximumParticleLife),t.mass=W.randomBetween(e._minimumMass,e._maximumMass),t.imageSize.x=W.randomBetween(e._minimumImageSize.x,e._maximumImageSize.x),t.imageSize.y=W.randomBetween(e._minimumImageSize.y,e._maximumImageSize.y),t._normalizedAge=0,t._age=0;let n=W.randomBetween(e._minimumSpeed,e._maximumSpeed);h.multiplyByScalar(t.velocity,n,t.velocity),e._particles.push(t)}function WOt(e,t){if(e._isComplete)return 0;t=W.mod(t,e._lifetime);let n=t*e._emissionRate,i=Math.floor(n);if(e._carryOver+=n-i,e._carryOver>1&&(i++,e._carryOver-=1),l(e.bursts)){let o=e.bursts.length;for(let r=0;r<o;r++){let s=e.bursts[r],a=e._currentTime;l(s)&&!s._complete&&a>s.time&&(i+=W.randomBetween(s.minimum,s.maximum),s._complete=!0)}}return i}var WJ=new h;$U.prototype.update=function(e){if(!this.show)return;l(this._billboardCollection)||(this._billboardCollection=new Cu),this._updateParticlePool&&(COt(this),this._updateParticlePool=!1);let t=0;this._previousTime&&(t=Q.secondsDifference(e.time,this._previousTime)),t<0&&(t=0);let n=this._particles,i=this._emitter,o=this.updateCallback,r,s,a=n.length;for(r=0;r<a;++r)s=n[r],s.update(t,o)?BNe(this,s):(GOt(s),EOt(this,s),n[r]=n[a-1],--r,--a);n.length=a;let c=WOt(this,t);if(c>0&&l(i)){this._matrixDirty&&(this._combinedMatrix=P.multiply(this.modelMatrix,this.emitterModelMatrix,this._combinedMatrix),this._matrixDirty=!1);let d=this._combinedMatrix;for(r=0;r<c;r++)s=VOt(this),this._emitter.emit(s),h.add(s.position,s.velocity,WJ),P.multiplyByPoint(d,WJ,WJ),s.position=P.multiplyByPoint(d,s.position,s.position),h.subtract(WJ,s.position,s.velocity),h.normalize(s.velocity,s.velocity),LOt(this,s),BNe(this,s)}if(this._billboardCollection.update(e),this._previousTime=Q.clone(e.time,this._previousTime),this._currentTime+=t,this._lifetime!==Number.MAX_VALUE&&this._currentTime>this._lifetime)if(this.loop){if(this._currentTime=W.mod(this._currentTime,this._lifetime),this.bursts){let d=this.bursts.length;for(r=0;r<d;r++)this.bursts[r]._complete=!1}}else this._isComplete=!0,this._complete.raiseEvent(this);e.frameNumber%120===0&&AOt(this)};$U.prototype.isDestroyed=function(){return!1};$U.prototype.destroy=function(){return this._billboardCollection=this._billboardCollection&&this._billboardCollection.destroy(),ue(this)};var Zce=$U;var S5o=x(T(),1);var Rce=class{constructor(){mt(this,"quadtree");mt(this,"tilingScheme");mt(this,"errorEvent");ge.throwInstantiationError()}static computeDefaultLevelZeroMaximumGeometricError(t){return t.ellipsoid.maximumRadius*2*Math.PI*.25/(65*t.getNumberOfXTilesAtLevel(0))}update(t,n){ge.throwInstantiationError()}beginUpdate(t,n,i){ge.throwInstantiationError()}endUpdate(t,n,i){ge.throwInstantiationError()}getLevelMaximumGeometricError(t){ge.throwInstantiationError()}loadTile(t,n,i){ge.throwInstantiationError()}computeTileVisibility(t,n,i){ge.throwInstantiationError()}showTileThisFrame(t,n,i,o){ge.throwInstantiationError()}computeDistanceToTile(t,n){ge.throwInstantiationError()}isDestroyed(){ge.throwInstantiationError()}destroy(){ge.throwInstantiationError()}},Cce=Rce;var E5o=x(T(),1);function Vce(e){e=e??1,this._radius=e??1}Object.defineProperties(Vce.prototype,{radius:{get:function(){return this._radius},set:function(e){this._radius=e}}});Vce.prototype.emit=function(e){let t=W.randomBetween(0,W.TWO_PI),n=W.randomBetween(0,W.PI),i=W.randomBetween(0,this._radius),o=i*Math.cos(t)*Math.sin(n),r=i*Math.sin(t)*Math.sin(n),s=i*Math.cos(n);e.position=h.fromElements(o,r,s,e.position),e.velocity=h.normalize(e.position,e.velocity)};var Ece=Vce;var L5o=x(T(),1);function e5(){}e5.prototype.evaluate=function(e,t){ge.throwInstantiationError()};e5.prototype.evaluateColor=function(e,t){ge.throwInstantiationError()};e5.prototype.getShaderFunction=function(e,t,n,i){ge.throwInstantiationError()};e5.prototype.getVariables=function(){ge.throwInstantiationError()};var Ace=e5;var P5o=x(T(),1);function YA(e){this._ready=!1,this._provider=void 0,this._errorEvent=new Se,this._readyEvent=new Se,FOt(this,e)}Object.defineProperties(YA.prototype,{errorEvent:{get:function(){return this._errorEvent}},readyEvent:{get:function(){return this._readyEvent}},ready:{get:function(){return this._ready}},provider:{get:function(){return this._provider}}});YA.fromWorldTerrain=function(e){return new YA(WR(e))};YA.fromWorldBathymetry=function(e){return new YA(SU(e))};function vOt(e,t){e.numberOfListeners>0?e.raiseEvent(t):console.error(t)}async function FOt(e,t){let n;try{n=await Promise.resolve(t),e._provider=n,e._ready=!0,e._readyEvent.raiseEvent(n)}catch(i){vOt(e._errorEvent,i)}}var t5=YA;var Y5o=x(T(),1);function MA(){}MA.prototype.boundingVolume=void 0;MA.prototype.boundingSphere=void 0;MA.prototype.distanceToCamera=function(e){ge.throwInstantiationError()};MA.prototype.intersectPlane=function(e){ge.throwInstantiationError()};MA.prototype.createDebugVolume=function(e){ge.throwInstantiationError()};var Gce=MA;var B5o=x(T(),1);function n5(e){e=e??B.EMPTY_OBJECT,this._tilingScheme=l(e.tilingScheme)?e.tilingScheme:new eo({ellipsoid:e.ellipsoid}),this._color=e.color??U.YELLOW,this._errorEvent=new Se,this._tileWidth=e.tileWidth??256,this._tileHeight=e.tileHeight??256,this._defaultAlpha=void 0,this._defaultNightAlpha=void 0,this._defaultDayAlpha=void 0,this._defaultBrightness=void 0,this._defaultContrast=void 0,this._defaultHue=void 0,this._defaultSaturation=void 0,this._defaultGamma=void 0,this._defaultMinificationFilter=void 0,this._defaultMagnificationFilter=void 0}Object.defineProperties(n5.prototype,{proxy:{get:function(){}},tileWidth:{get:function(){return this._tileWidth}},tileHeight:{get:function(){return this._tileHeight}},maximumLevel:{get:function(){}},minimumLevel:{get:function(){}},tilingScheme:{get:function(){return this._tilingScheme}},rectangle:{get:function(){return this._tilingScheme.rectangle}},tileDiscardPolicy:{get:function(){}},errorEvent:{get:function(){return this._errorEvent}},credit:{get:function(){}},hasAlphaChannel:{get:function(){return!0}}});n5.prototype.getTileCredits=function(e,t,n){};n5.prototype.requestImage=function(e,t,n,i){let o=document.createElement("canvas");o.width=256,o.height=256;let r=o.getContext("2d"),s=this._color.toCssColorString();return r.strokeStyle=s,r.lineWidth=2,r.strokeRect(1,1,255,255),r.font="bold 25px Arial",r.textAlign="center",r.fillStyle=s,r.fillText(`L: ${n}`,124,86),r.fillText(`X: ${e}`,124,136),r.fillText(`Y: ${t}`,124,186),Promise.resolve(o)};n5.prototype.pickFeatures=function(e,t,n,i,o){};var i5=n5;var K5o=x(T(),1);function Lce(e){ge.throwInstantiationError()}Lce.prototype.isReady=ge.throwInstantiationError;Lce.prototype.shouldDiscardImage=ge.throwInstantiationError;var Wce=Lce;var j5o=x(T(),1),zNe={START:0,LOADING:1,READY:2,UPSAMPLED_ONLY:3};Object.freeze(zNe);var vce=zNe;var cDo=x(T(),1);function vJ(e,t){this.show=!0,l(e)||(e=new nt),this.rectangle=nt.clone(e),l(t)||(t=to.fromType(to.ColorType,{color:new U(1,1,1,1)})),this.material=t,this._material=void 0,this._overlayCommand=void 0,this._rs=void 0}vJ.prototype.update=function(e){if(!this.show)return;let t=this._rs;if((!l(t)||!nt.equals(t.viewport,this.rectangle))&&(this._rs=ze.fromCache({blending:on.ALPHA_BLEND,viewport:this.rectangle})),e.passes.render){let i=e.context;if(this._material!==this.material||!l(this._overlayCommand)){this._material=this.material,l(this._overlayCommand)&&this._overlayCommand.shaderProgram.destroy();let o=new Je({sources:[this._material.shaderSource,b2]});this._overlayCommand=i.createViewportQuadCommand(o,{renderState:this._rs,uniformMap:this._material._uniforms,owner:this}),this._overlayCommand.pass=Le.OVERLAY}this._material.update(i),this._overlayCommand.renderState=this._rs,this._overlayCommand.uniformMap=this._material._uniforms,e.commandList.push(this._overlayCommand)}};vJ.prototype.isDestroyed=function(){return!1};vJ.prototype.destroy=function(){return l(this._overlayCommand)&&(this._overlayCommand.shaderProgram=this._overlayCommand.shaderProgram&&this._overlayCommand.shaderProgram.destroy()),ue(this)};var Fce=vJ;var uDo=x(T(),1);var Ice=class{constructor(){mt(this,"globalTransform");mt(this,"shapeTransform");mt(this,"shape");mt(this,"minBounds");mt(this,"maxBounds");mt(this,"dimensions");mt(this,"paddingBefore");mt(this,"paddingAfter");mt(this,"names");mt(this,"types");mt(this,"componentTypes");mt(this,"minimumValues");mt(this,"maximumValues");mt(this,"maximumTileCount");mt(this,"availableLevels");mt(this,"keyframeCount");mt(this,"timeIntervalCollection");ge.throwInstantiationError()}requestData(t){ge.throwInstantiationError()}},Pce=Ice;var pDo=x(T(),1);function yy(){ge.throwInstantiationError()}Object.defineProperties(yy.prototype,{orientedBoundingBox:{get:ge.throwInstantiationError},boundingSphere:{get:ge.throwInstantiationError},boundTransform:{get:ge.throwInstantiationError},shapeTransform:{get:ge.throwInstantiationError},shaderUniforms:{get:ge.throwInstantiationError},shaderDefines:{get:ge.throwInstantiationError},shaderMaximumIntersectionsLength:{get:ge.throwInstantiationError}});yy.prototype.update=ge.throwInstantiationError;yy.prototype.updateViewTransforms=ge.throwInstantiationError;yy.prototype.convertLocalToShapeUvSpace=ge.throwInstantiationError;yy.prototype.computeOrientedBoundingBoxForTile=ge.throwInstantiationError;yy.prototype.computeOrientedBoundingBoxForSample=ge.throwInstantiationError;yy.DefaultMinBounds=ge.throwInstantiationError;yy.DefaultMaxBounds=ge.throwInstantiationError;var Xce=yy;var yDo=x(T(),1);var Nce=class{get enabled(){return ge.throwInstantiationError()}set enabled(t){ge.throwInstantiationError()}connectedCallback(t){ge.throwInstantiationError()}disconnectedCallback(t){ge.throwInstantiationError()}update(t,n){ge.throwInstantiationError()}firstUpdate(t,n){ge.throwInstantiationError()}},Yce=Nce;var VDo=x(T(),1);var HNe=new h,IOt=new cn(h.UNIT_X,0),POt=new gn,XOt=new k(1,1,1);function mp(e,t,n,i=XOt){let{camera:o,ellipsoid:r}=e,s=r.scaleToGeodeticSurface(o.positionWC,HNe);if(!l(s))return;let a=h.magnitude(o.positionWC),c=h.magnitude(s),d=a<=c,u=r.geodeticSurfaceNormal(o.positionWC,HNe),m=h.dot(u,o.directionWC),p=m>0;if(d||p){let b=cn.fromPointNormal(o.positionWC,u,IOt),{clientHeight:f}=e.canvas,y=i.y*f/(2*Math.tan(o.frustum.fovy*.5));b.distance-=m*y;let _=o.getPickRay(t,POt);return xi.rayPlane(_,b,n)}return o.pickEllipsoid(t,r,n)}var uOo=x(T(),1);var zDo=x(T(),1);var FDo=x(T(),1);var ADo=x(T(),1),KNe={LEFT:0,MIDDLE:1,RIGHT:2};Object.freeze(KNe);var qa=KNe;function NOt(e){if(e===qa.LEFT)return mn.LEFT_DOWN;if(e===qa.MIDDLE)return mn.MIDDLE_DOWN;if(e===qa.RIGHT)return mn.RIGHT_DOWN}function YOt(e){if(e===qa.LEFT)return mn.LEFT_UP;if(e===qa.MIDDLE)return mn.MIDDLE_UP;if(e===qa.RIGHT)return mn.RIGHT_UP}var Mce=class{static registerDragInputBindings(t,n,i){let o=new Set,r={isDragging:!1};for(let s of n){r.isDragging=!1;let a=NOt(s.button),c=YOt(s.button);l(a)&&t.setInputAction((...d)=>{r.isDragging=!0,l(i.start)&&i.start(...d)},a,s.modifier),l(c)&&(t.setInputAction((...d)=>{r.isDragging&&(r.isDragging=!1,l(i.end)&&i.end(...d))},c,s.modifier),t.setInputAction((...d)=>{r.isDragging&&(r.isDragging=!1,l(i.end)&&i.end(...d))},c)),o.add(s.modifier)}for(let s of o)t.setInputAction((...a)=>{r.isDragging&&l(i.change)&&i.change(...a)},mn.MOUSE_MOVE,s);return r}},hp=Mce;var wce=class e{static _getDefaultDragInputs(){return[Object.freeze({button:qa.LEFT})]}constructor(t=B.EMPTY_OBJECT){this._enabled=!0,this._handler=void 0,this._lastUpdateTime=void 0,this.dragInputs=t.dragInputs??e._getDefaultDragInputs(),this._dragInputState=void 0,this._panDelta=new k,this._panPosition=new k,this.pickWorldPosition=mp,this._ellipsoidNormal=new h,this._ellipsoidSurfacePosition=new h,this._panDirectionX=new h,this._panDirectionY=new h,this._pixelSize=new k,this._panVelocity=new k,this.panSpeed=1,this.inertiaEnabled=!0,this.inertialDecay=6,this.maximumMovementRatio=.1}get enabled(){return this._enabled}set enabled(t){this._enabled=t,t?(this._lastUpdateTime=Zn(),this._panDelta.x=0,this._panDelta.y=0):l(this._dragInputState)&&(this._dragInputState.isDragging=!1)}get isDragging(){return l(this._dragInputState)&&this._dragInputState.isDragging}connectedCallback(t){let n=new oa(t);this._handler=n,this._dragInputState=hp.registerDragInputBindings(n,this.dragInputs,{start:this._handleStartPan.bind(this),change:this._handlePan.bind(this)})}disconnectedCallback(t){let n=this._handler;l(n)&&!n.isDestroyed()&&n.destroy()}firstUpdate(){this._lastUpdateTime=Zn(),this._panDelta.x=0,this._panDelta.y=0}update(t){let n=(Zn()-this._lastUpdateTime)*wn.SECONDS_PER_MILLISECOND,{camera:i,ellipsoid:o,canvas:r}=t,s=-this._panDelta.x,a=this._panDelta.y;if(this.inertiaEnabled&&!this.isDragging){let C=Math.exp(-this.inertialDecay*n);this._panVelocity.x*=C,this._panVelocity.y*=C,s=this._panVelocity.x*n,a=this._panVelocity.y*n}let{clientWidth:c,clientHeight:d}=r;if(n===0||c===0||d===0||Math.abs(s)<=W.EPSILON3&&Math.abs(a)<=W.EPSILON3){this._lastUpdateTime=Zn(),this._panDelta.x=0,this._panDelta.y=0;return}let u=this._panPosition,m=this.pickWorldPosition(t,u,this._ellipsoidSurfacePosition);l(m)||(m=o.scaleToGeodeticSurface(i.positionWC,this._ellipsoidSurfacePosition));let p=h.clone(i.rightWC,this._panDirectionX);p=h.normalize(p,this._panDirectionX);let b=h.normalize(m,this._panDirectionY),f=h.distance(i.positionWC,m),{drawingBufferWidth:y,drawingBufferHeight:_,pixelRatio:S}=t,Z=i.frustum.getPixelDimensions(y,_,f,S,this._pixelSize),R=this.maximumMovementRatio*Math.max(c,d);s=W.clamp(s,-R,R),this._panVelocity.x=s/n,s*=this.panSpeed*Z.x,a=W.clamp(a,-R,R),this._panVelocity.y=a/n,a*=this.panSpeed*Z.y,i.move(p,s),i.move(b,a),this._lastUpdateTime=Zn(),this._panDelta.x=0,this._panDelta.y=0}_handleStartPan(){this.enabled&&(this._panDelta.x=0,this._panDelta.y=0)}_handlePan(t){this._panDelta.x+=t.endPosition.x-t.startPosition.x,this._panDelta.y+=t.endPosition.y-t.startPosition.y,this._panPosition.x=t.endPosition.x,this._panPosition.y=t.endPosition.y}},o5=wce;var rOo=x(T(),1);var kce=class e{static _getDefaultDragInputs(){return[Object.freeze({button:qa.LEFT})]}constructor(t=B.EMPTY_OBJECT){this._enabled=!0,this._handler=void 0,this._lastUpdateTime=void 0,this.dragInputs=t.dragInputs??e._getDefaultDragInputs(),this._dragInputState=void 0,this._panDelta=new k,this._panPosition=new k,this.pickWorldPosition=mp,this._ellipsoidNormal=new h,this._ellipsoidSurfacePosition=new h,this._panDirectionX=new h,this._panDirectionY=new h,this._pixelSize=new k,this._panVelocity=new k,this.panSpeed=1,this.inertiaEnabled=!0,this.inertialDecay=6,this.maximumMovementRatio=.1}get enabled(){return this._enabled}set enabled(t){this._enabled=t,t?(this._panDelta.x=0,this._panDelta.y=0):l(this._dragInputState)&&(this._dragInputState.isDragging=!1)}get isDragging(){return l(this._dragInputState)&&this._dragInputState.isDragging}connectedCallback(t){let n=new oa(t);this._handler=n,this._dragInputState=hp.registerDragInputBindings(n,this.dragInputs,{start:this._handleStartPan.bind(this),change:this._handlePan.bind(this)})}disconnectedCallback(t){let n=this._handler;l(n)&&!n.isDestroyed()&&n.destroy()}firstUpdate(){this._lastUpdateTime=Zn(),this._panDelta.x=0,this._panDelta.y=0}update(t){let n=(Zn()-this._lastUpdateTime)*wn.SECONDS_PER_MILLISECOND,i=-this._panDelta.x,o=this._panDelta.y;if(this.inertiaEnabled&&!this.isDragging){let A=Math.exp(-this.inertialDecay*n);this._panVelocity.x*=A,this._panVelocity.y*=A,i=this._panVelocity.x*n,o=this._panVelocity.y*n}let{camera:r,ellipsoid:s,canvas:a}=t,{clientWidth:c,clientHeight:d}=a;if(n===0||c===0||d===0||Math.abs(i)<=W.EPSILON3&&Math.abs(o)<=W.EPSILON3){this._lastUpdateTime=Zn(),this._panDelta.x=0,this._panDelta.y=0;return}let u=this._panPosition,m=this.pickWorldPosition(t,u,this._ellipsoidSurfacePosition);l(m)||(m=s.scaleToGeodeticSurface(r.positionWC,this._ellipsoidSurfacePosition));let p=s.geodeticSurfaceNormal(m,this._ellipsoidNormal),b=h.clone(r.rightWC,this._panDirectionX);b=h.normalize(b,this._panDirectionX);let f=h.clone(r.upWC,this._panDirectionY),y=Math.abs(h.dot(p,r.directionWC));W.lessThan(y,1,W.EPSILON6)&&(f=h.cross(p,b,this._panDirectionY)),f=h.normalize(f,this._panDirectionY);let _=h.distance(r.positionWC,m),{drawingBufferWidth:S,drawingBufferHeight:Z,pixelRatio:R}=t,C=r.frustum.getPixelDimensions(S,Z,_,R,this._pixelSize),E=this.maximumMovementRatio*Math.max(c,d);i=W.clamp(i,-E,E),this._panVelocity.x=i/n,i*=this.panSpeed*C.x,o=W.clamp(o,-E,E),this._panVelocity.y=o/n,o*=this.panSpeed*C.y,r.move(b,i),r.move(f,o),this._lastUpdateTime=Zn(),this._panDelta.x=0,this._panDelta.y=0}_handleStartPan(t){this.enabled&&(this._panDelta.x=0,this._panDelta.y=0)}_handlePan(t){this._panDelta.x+=t.endPosition.x-t.startPosition.x,this._panDelta.y+=t.endPosition.y-t.startPosition.y,this._panPosition.x=t.endPosition.x,this._panPosition.y=t.endPosition.y}},r5=kce;var Uce=class{constructor(){this._elevatorController=new o5,this._mapController=new r5,this._enabled=!0,this._ellipsoidNormal=new h,this.angleThreshold=W.toRadians(125)}get enabled(){return this._enabled}set enabled(t){this._enabled=t}get elevatorController(){return this._elevatorController}get mapController(){return this._mapController}connectedCallback(t){this._elevatorController.connectedCallback(t),this._mapController.connectedCallback(t)}disconnectedCallback(t){this._elevatorController.disconnectedCallback(t),this._mapController.disconnectedCallback(t)}firstUpdate(){this._elevatorController.firstUpdate(),this._mapController.firstUpdate()}update(t){let n=t.camera,i=t.ellipsoid.geodeticSurfaceNormal(n.positionWC,this._ellipsoidNormal),o=Math.abs(h.angleBetween(i,n.directionWC));(o<this.angleThreshold&&o>Math.PI-this.angleThreshold?this._elevatorController:this._mapController).update(t)}},Dce=Uce;var LOo=x(T(),1);var Oce=class e{static _getDefaultDragInputs(){return[Object.freeze({button:qa.LEFT,modifier:nr.CTRL}),Object.freeze({button:qa.RIGHT})]}constructor(t=B.EMPTY_OBJECT){this._enabled=!0,this._handler=void 0,this._lastUpdateTime=void 0,this.tiltEnabled=!0,this.orbitEnabled=!0,this.useDragPosition=!1,this.dragInputs=t.dragInputs??e._getDefaultDragInputs(),this._dragInputState=void 0,this._dragDelta=new k,this._screenSpaceDragPosition=new k,this._screenSpaceOrigin=new k,this.pickWorldPosition=mp,this._hasTarget=!1,this._target=new h,this._axis=new h,this.tiltMagnitude=2,this.dampingEnabled=!0,this.tiltAnimationDuration=.0045,this.maximumTiltVelocity=W.PI,this.minimumTiltVelocity=W.EPSILON20,this.orbitMagnitude=2,this.orbitAnimationDuration=.0045,this.maximumOrbitVelocity=W.TWO_PI,this.minimumOrbitVelocity=W.EPSILON20,this._tiltAxis=new h,this._tiltQuaternion=new Ne,this._tiltOffset=new h,this._tiltOrigin=new h,this._tiltDampenedResults={velocity:0,value:0},this._orbitTargetEnu=new P,this._orbitTargetEast=new h,this._orbitQuaternion=new Ne,this._orbitOffset=new h,this._orbitLookOffset=new h,this._orbitOrigin=new h,this._orbitDampenedResults={velocity:0,value:0},this.maximumMovementRatio=.1}get enabled(){return this._enabled}set enabled(t){this._enabled=t,t?(this._lastUpdateTime=Zn(),this._dragDelta.x=0,this._dragDelta.y=0):l(this._dragInputState)&&(this._dragInputState.isDragging=!1)}get isDragging(){return l(this._dragInputState)&&this._dragInputState.isDragging}connectedCallback(t){let n=new oa(t);this._handler=n,this._dragInputState=hp.registerDragInputBindings(n,this.dragInputs,{start:this._handleStartDrag.bind(this),change:this._handleDrag.bind(this)})}disconnectedCallback(t){let n=this._handler;l(n)&&!n.isDestroyed()&&n.destroy()}firstUpdate(){this._lastUpdateTime=Zn(),this._dragDelta.x=0,this._dragDelta.y=0}_handleStartDrag(t){this.enabled&&(this._hasTarget=!1,this._screenSpaceDragPosition.x=t.position.x,this._screenSpaceDragPosition.y=t.position.y,this._dragDelta.x=0,this._dragDelta.y=0)}_handleDrag(t){this._dragDelta.x+=t.endPosition.x-t.startPosition.x,this._dragDelta.y+=t.endPosition.y-t.startPosition.y}get tiltAngle(){return this._tiltDampenedResults.value}get tiltVelocity(){return this._tiltDampenedResults.velocity}set tiltVelocity(t){this._tiltDampenedResults.velocity=t}get orbitAngle(){return this._orbitDampenedResults.value}get orbitVelocity(){return this._orbitDampenedResults.velocity}set orbitVelocity(t){this._orbitDampenedResults.velocity=t}orbit(t,n,i,o,r,s=ne.default){let a=_t.eastNorthUpToFixedFrame(n,s,this._orbitTargetEnu),c=P.multiplyByPointAsVector(a,h.UNIT_X,this._orbitTargetEast),d=h.angleBetween(t.directionWC,c);if(Math.abs(this.orbitVelocity)<this.minimumOrbitVelocity&&(this.orbitVelocity=0),!this.isDragging&&this.dampingEnabled&&(o+=this.orbitVelocity*r),o===0)return;let u=d+o,m=this.dampingEnabled?this.maximumOrbitVelocity*this.orbitMagnitude:void 0,p=this.dampingEnabled?this.orbitAnimationDuration:void 0;this._orbitDampenedResults=W.smoothDamp(d,u,this.orbitVelocity,r,m,p,this._orbitDampenedResults);let b=this.orbitAngle-d,f=q.fromQuaternion(Ne.fromAxisAngle(i,-b,this._orbitQuaternion)),y=h.subtract(t.positionWC,n,this._orbitOffset),_=h.dot(y,t.directionWC),S=h.multiplyByScalar(t.directionWC,_,this._orbitLookOffset),Z=h.subtract(y,S,this._orbitLookOffset),R=q.multiplyByVector(f,y,this._orbitOffset),C=q.multiplyByVector(f,Z,this._orbitLookOffset);h.add(n,R,t.position);let E=h.add(n,C,this._orbitOrigin);t.lookAtWorldPosition(E,s)}tilt(t,n,i,o,r,s=ne.default){if(Math.abs(this.tiltVelocity)<this.minimumTiltVelocity&&(this.tiltVelocity=0),!this.isDragging&&this.dampingEnabled&&(o+=this.tiltVelocity*r),o===0)return;let a=h.angleBetween(t.direction,i);(a<W.PI_OVER_TWO&&o>0||a>W.PI_OVER_TWO&&o<0)&&(o*=Math.abs(Math.sin(a)));let c=a+o,d=this.dampingEnabled?this.maximumTiltVelocity*this.tiltMagnitude:void 0,u=this.dampingEnabled?this.tiltAnimationDuration:void 0;W.smoothDamp(a,c,this.tiltVelocity,r,d,u,this._tiltDampenedResults);let m=this.tiltAngle-a,p=q.fromQuaternion(Ne.fromAxisAngle(t.rightWC,-m,this._tiltQuaternion)),b=h.subtract(t.position,n,this._tiltOffset),f=h.dot(b,t.directionWC),y=h.multiplyByScalar(t.directionWC,f,this._tiltOffset),_=h.subtract(t.position,y,this._tiltOrigin),S=q.multiplyByVector(p,y,this._tiltOffset);h.add(_,S,t.position),t.lookAtWorldPosition(_,s)}update(t){let n=(Zn()-this._lastUpdateTime)*wn.SECONDS_PER_MILLISECOND,{canvas:i}=t,{clientWidth:o,clientHeight:r}=i;if(n===0||o===0||r===0){this._lastUpdateTime=Zn(),this._dragDelta.x=0,this._dragDelta.y=0;return}let s=this._target;if(this.isDragging&&!this._hasTarget){let a=this._screenSpaceDragPosition;this.useDragPosition||(a=this._screenSpaceOrigin,a.x=o/2,a.y=r/2);let c=this.pickWorldPosition(t,a,this._target),d=l(c);this._hasTarget=d,s=c}if(this._hasTarget){let{camera:a,ellipsoid:c}=t,d=c.geodeticSurfaceNormal(s,this._axis),u=h.negate(d,this._axis);if(this.orbitEnabled){let m=this._dragDelta.x/o;m=W.clamp(m,-this.maximumMovementRatio,this.maximumMovementRatio),m*=this.orbitMagnitude*W.TWO_PI,this.orbit(a,s,u,m,n,c)}if(this.tiltEnabled){let m=this._dragDelta.y/r;m=W.clamp(m,-this.maximumMovementRatio,this.maximumMovementRatio),m*=this.tiltMagnitude*W.PI,this.tilt(a,s,u,m,n,c)}}this._lastUpdateTime=Zn(),this._dragDelta.x=0,this._dragDelta.y=0}},Bce=Oce;var OOo=x(T(),1);var zce=class e{static _getDefaultDragInputs(){return[Object.freeze({button:qa.MIDDLE})]}static _getDefaultScrollInputs(){return[mn.WHEEL]}constructor(t=B.EMPTY_OBJECT){this._enabled=!0,this._handler=void 0,this._lastUpdateTime=void 0,this.usePointerPosition=!1,this.dragInputs=t.dragInputs??e._getDefaultDragInputs(),this.scrollInputs=t.scrollInputs??e._getDefaultScrollInputs(),this._dragInputState=void 0,this._dragDelta=new k,this._scrollDelta=0,this._zoomInputVelocity=0,this._screenSpaceScrollPosition=new k,this._screenSpaceDragPosition=new k,this._screenSpaceOrigin=new k,this.zoomSensitivity=.2,this.pickWorldPosition=mp,this.zoomDistanceRatio=.4,this.inertiaEnabled=!1,this.inertialDecay=6,this.minimumZoomDistance=0,this.maximumZoomDistance=1e5,this.minimumZoomVelocity=W.EPSILON20,this.maximumZoomVelocity=1,this.dampingEnabled=!0,this.zoomAnimationDuration=.45,this._target=new h,this._zoomDirection=new h,this._zoomDampenedResults={velocity:0,value:0}}get enabled(){return this._enabled}set enabled(t){this._enabled=t,t?(this._lastUpdateTime=Zn(),this._scrollDelta=0,this._dragDelta.x=0,this._dragDelta.y=0):l(this._dragInputState)&&(this._dragInputState.isDragging=!1)}get isDragging(){return l(this._dragInputState)&&this._dragInputState.isDragging}connectedCallback(t){let n=new oa(t);this._handler=n;for(let i of this.scrollInputs)n.setInputAction(this._handleZoom.bind(this),i);n.setInputAction(this._handleZoomPosition.bind(this),mn.MOUSE_MOVE),this._dragInputState=hp.registerDragInputBindings(n,this.dragInputs,{start:this._handleStartDrag.bind(this),change:this._handleDrag.bind(this)})}disconnectedCallback(t){let n=this._handler;l(n)&&!n.isDestroyed()&&n.destroy()}firstUpdate(){this._lastUpdateTime=Zn(),this._scrollDelta=0,this._dragDelta.x=0,this._dragDelta.y=0}get zoomDistance(){return this._zoomDampenedResults.value}get zoomVelocity(){return this._zoomDampenedResults.velocity}set zoomVelocity(t){this._zoomDampenedResults.velocity=t}update(t){let i=(Zn()-this._lastUpdateTime)*wn.SECONDS_PER_MILLISECOND,{canvas:o}=t,{clientWidth:r,clientHeight:s}=o;if(i===0||r===0||s===0){this._lastUpdateTime=Zn(),this._scrollDelta=0,this._dragDelta.x=0,this._dragDelta.y=0;return}let a=this._scrollDelta+this._dragDelta.y;if(a===0&&this.inertiaEnabled){let _=Math.exp(-this.inertialDecay*i);this._zoomInputVelocity*=_,a=this._zoomInputVelocity*i}if(Math.abs(this.zoomVelocity)<this.minimumZoomVelocity&&a<=W.EPSILON3&&a>=-W.EPSILON3&&this.zoomVelocity<=W.EPSILON3){this._lastUpdateTime=Zn(),this._scrollDelta=0,this._dragDelta.x=0,this._dragDelta.y=0,this.zoomVelocity=0;return}this._zoomInputVelocity=W.clamp(a/i,-this.maximumZoomVelocity,this.maximumZoomVelocity);let{camera:c,ellipsoid:d}=t,u=c.direction,m=h.magnitude(c.positionWC)-d.maximumRadius,p=this.isDragging?this._screenSpaceDragPosition:this._screenSpaceScrollPosition;this.useDragPosition||(p=this._screenSpaceOrigin,p.x=r/2,p.y=s/2);let b=this.pickWorldPosition(t,p,this._target);l(b)&&(u=h.subtract(b,c.positionWC,this._zoomDirection),u=h.normalize(u,this._zoomDirection),m=h.distance(b,c.positionWC)),m=W.clamp(m,m>0?this.minimumZoomDistance:-this.maximumZoomDistance,m>0?this.maximumZoomDistance:-this.minimumZoomDistance);let f=a*m*this.zoomDistanceRatio,y=this.dampingEnabled?this.zoomAnimationDuration:void 0;this._zoomDampenedResults=W.smoothDamp(0,f,this.zoomVelocity,i,void 0,y,this._zoomDampenedResults),c.move(u,this.zoomDistance),this._lastUpdateTime=Zn(),this._scrollDelta=0,this._dragDelta.x=0,this._dragDelta.y=0}_handleZoom(t){this._scrollDelta+=t*this.zoomSensitivity}_handleZoomPosition(t){this._screenSpaceScrollPosition.x=t.endPosition.x,this._screenSpaceScrollPosition.y=t.endPosition.y}_handleStartDrag(t){this.enabled&&(this._screenSpaceDragPosition.x=t.position.x,this._screenSpaceDragPosition.y=t.position.y,this._dragDelta.x=0,this._dragDelta.y=0)}_handleDrag(t){this._dragDelta.x+=t.endPosition.x-t.startPosition.x,this._dragDelta.y+=t.endPosition.y-t.startPosition.y}},Hce=zce;var zOo=x(T(),1),JNe={FLOAT:"float",VEC2:"vec2",VEC3:"vec3",VEC4:"vec4",MAT2:"mat2",MAT3:"mat3",MAT4:"mat4"};Object.freeze(JNe);var Kce=JNe;var KOo=x(T(),1),jNe={SIGX:"SIGX",SIGY:"SIGY",SIGZ:"SIGZ",VARX:"VARX",VARY:"VARY",VARZ:"VARZ",SIGR:"VARZ"};Object.freeze(jNe);var Jce=jNe;var QOo=x(T(),1);function MOt(e){async function t({data:i}){let o=[],r={id:i.id,result:void 0,error:void 0};self.CESIUM_BASE_URL=i.baseUrl;try{let s=await e(i.parameters,o);r.result=s}catch(s){s instanceof Error?r.error={name:s.name,message:s.message,stack:s.stack}:r.error=s}i.canTransferArrayBuffer||(o.length=0);try{postMessage(r,o)}catch(s){r.result=void 0,r.error=`postMessage failed with error: ${Wp(s)} + with responseMessage: ${JSON.stringify(r)}`,postMessage(r)}}function n(i){postMessage({id:i.data?.id,error:`postMessage failed with error: ${JSON.stringify(i)}`})}return self.onmessage=t,self.onmessageerror=n,self}var jce=MOt;globalThis.CESIUM_VERSION="1.145.0";var Upr=x(T(),1);var xdr=x(T(),1);var pdr=x(T(),1);var sdr=x(T(),1),s5;typeof ko<"u"&&(s5=ko);(function(){/*! * Knockout JavaScript library v3.5.1 * (c) The Knockout.js team - http://knockoutjs.com/ * License: MIT (http://www.opensource.org/licenses/mit-license.php) @@ -12739,16 +12739,23 @@ out_FragColor = vec4(mix(vec3(0.0), vec3(1.0), scale), 1.0); |/(?:\\\\.|[^/])+/w*|[^\\s:,/][^,"'\`{}()/:[\\]]*[^\\s,"'\`{}()/:[\\]]|[^\\s]`,"g"),X=/[\])"'A-Za-z0-9_$]+$/,Y={in:1,return:1,typeof:1},D={};return{Ra:[],wa:D,ac:g,vb:function(M,O){function w(ee,le){var _e;if(!H){var he=f.getBindingHandler(ee);if(he&&he.preprocess&&!(le=he.preprocess(le,ee,w)))return;(he=D[ee])&&(_e=le,0<=f.a.A(V,_e)?_e=!1:(he=_e.match(G),_e=he===null?!1:he[1]?"Object("+he[1]+")"+he[2]:_e),he=_e),he&&K.push("'"+(typeof D[ee]=="string"?D[ee]:ee)+"':function(_z){"+_e+"=_z}")}te&&(le="function(){return "+le+" }"),z.push("'"+ee+"':"+le)}O=O||{};var z=[],K=[],te=O.valueAccessors,H=O.bindingParams,$=typeof M=="string"?g(M):M;return f.a.D($,function(ee){w(ee.key||ee.unknown,ee.value)}),K.length&&w("_ko_property_writers","{"+K.join(",")+" }"),z.join(",")},Id:function(M,O){for(var w=0;w<M.length;w++)if(M[w].key==O)return!0;return!1},eb:function(M,O,w,z,K){M&&f.O(M)?!f.Za(M)||K&&M.v()===z||M(z):(M=O.get("_ko_property_writers"))&&M[w]&&M[w](z)}}})(),f.b("expressionRewriting",f.m),f.b("expressionRewriting.bindingRewriteValidators",f.m.Ra),f.b("expressionRewriting.parseObjectLiteral",f.m.ac),f.b("expressionRewriting.preProcessBindings",f.m.vb),f.b("expressionRewriting._twoWayBindings",f.m.wa),f.b("jsonExpressionRewriting",f.m),f.b("jsonExpressionRewriting.insertPropertyAccessorsIntoJson",f.m.vb),(function(){function g(w){return w.nodeType==8&&Y.test(X?w.text:w.nodeValue)}function V(w){return w.nodeType==8&&D.test(X?w.text:w.nodeValue)}function G(w,z){for(var K=w,te=1,H=[];K=K.nextSibling;){if(V(K)&&(f.a.g.set(K,O,!0),te--,te===0))return H;H.push(K),g(K)&&te++}if(!z)throw Error("Cannot find closing comment tag to match: "+w.nodeValue);return null}function v(w,z){var K=G(w,z);return K?0<K.length?K[K.length-1].nextSibling:w.nextSibling:null}var X=n&&n.createComment("test").text==="<!--test-->",Y=X?/^\x3c!--\s*ko(?:\s+([\s\S]+))?\s*--\x3e$/:/^\s*ko(?:\s+([\s\S]+))?\s*$/,D=X?/^\x3c!--\s*\/ko\s*--\x3e$/:/^\s*\/ko\s*$/,M={ul:!0,ol:!0},O="__ko_matchedEndComment__";f.h={ea:{},childNodes:function(w){return g(w)?G(w):w.childNodes},Ea:function(w){if(g(w)){w=f.h.childNodes(w);for(var z=0,K=w.length;z<K;z++)f.removeNode(w[z])}else f.a.Tb(w)},va:function(w,z){if(g(w)){f.h.Ea(w);for(var K=w.nextSibling,te=0,H=z.length;te<H;te++)K.parentNode.insertBefore(z[te],K)}else f.a.va(w,z)},Vc:function(w,z){var K;g(w)?(K=w.nextSibling,w=w.parentNode):K=w.firstChild,K?z!==K&&w.insertBefore(z,K):w.appendChild(z)},Wb:function(w,z,K){K?(K=K.nextSibling,g(w)&&(w=w.parentNode),K?z!==K&&w.insertBefore(z,K):w.appendChild(z)):f.h.Vc(w,z)},firstChild:function(w){if(g(w))return!w.nextSibling||V(w.nextSibling)?null:w.nextSibling;if(w.firstChild&&V(w.firstChild))throw Error("Found invalid end comment, as the first child of "+w);return w.firstChild},nextSibling:function(w){if(g(w)&&(w=v(w)),w.nextSibling&&V(w.nextSibling)){var z=w.nextSibling;if(V(z)&&!f.a.g.get(z,O))throw Error("Found end comment without a matching opening comment, as child of "+w);return null}return w.nextSibling},Cd:g,Vd:function(w){return(w=(X?w.text:w.nodeValue).match(Y))?w[1]:null},Sc:function(w){if(M[f.a.R(w)]){var z=w.firstChild;if(z)do if(z.nodeType===1){var K;K=z.firstChild;var te=null;if(K)do if(te)te.push(K);else if(g(K)){var H=v(K,!0);H?K=H:te=[K]}else V(K)&&(te=[K]);while(K=K.nextSibling);if(K=te)for(te=z.nextSibling,H=0;H<K.length;H++)te?w.insertBefore(K[H],te):w.appendChild(K[H])}while(z=z.nextSibling)}}}})(),f.b("virtualElements",f.h),f.b("virtualElements.allowedBindings",f.h.ea),f.b("virtualElements.emptyNode",f.h.Ea),f.b("virtualElements.insertAfter",f.h.Wb),f.b("virtualElements.prepend",f.h.Vc),f.b("virtualElements.setDomNodeChildren",f.h.va),(function(){f.ga=function(){this.nd={}},f.a.extend(f.ga.prototype,{nodeHasBindings:function(g){switch(g.nodeType){case 1:return g.getAttribute("data-bind")!=null||f.j.getComponentNameForNode(g);case 8:return f.h.Cd(g);default:return!1}},getBindings:function(g,V){var G=this.getBindingsString(g,V),G=G?this.parseBindingsString(G,V,g):null;return f.j.tc(G,g,V,!1)},getBindingAccessors:function(g,V){var G=this.getBindingsString(g,V),G=G?this.parseBindingsString(G,V,g,{valueAccessors:!0}):null;return f.j.tc(G,g,V,!0)},getBindingsString:function(g){switch(g.nodeType){case 1:return g.getAttribute("data-bind");case 8:return f.h.Vd(g);default:return null}},parseBindingsString:function(g,V,G,v){try{var X=this.nd,Y=g+(v&&v.valueAccessors||""),D;if(!(D=X[Y])){var M,O="with($context){with($data||{}){return{"+f.m.vb(g,v)+"}}}";M=new Function("$context","$element",O),D=X[Y]=M}return D(V,G)}catch(w){throw w.message=`Unable to parse bindings. Bindings value: `+g+` Message: `+w.message,w}}}),f.ga.instance=new f.ga})(),f.b("bindingProvider",f.ga),(function(){function g(he){var Ze=(he=f.a.g.get(he,_e))&&he.N;Ze&&(he.N=null,Ze.Tc())}function V(he,Ze,ye){this.node=he,this.yc=Ze,this.kb=[],this.H=!1,Ze.N||f.a.K.za(he,g),ye&&ye.N&&(ye.N.kb.push(he),this.Kb=ye)}function G(he){return function(){return he}}function v(he){return he()}function X(he){return f.a.Ga(f.u.G(he),function(Ze,ye){return function(){return he()[ye]}})}function Y(he,Ze,ye){return typeof he=="function"?X(he.bind(null,Ze,ye)):f.a.Ga(he,G)}function D(he,Ze){return X(this.getBindings.bind(this,he,Ze))}function M(he,Ze){var ye=f.h.firstChild(Ze);if(ye){var Ge,Ae=f.ga.instance,Fe=Ae.preprocessNode;if(Fe){for(;Ge=ye;)ye=f.h.nextSibling(Ge),Fe.call(Ae,Ge);ye=f.h.firstChild(Ze)}for(;Ge=ye;)ye=f.h.nextSibling(Ge),O(he,Ge)}f.i.ma(Ze,f.i.H)}function O(he,Ze){var ye=he,Ge=Ze.nodeType===1;Ge&&f.h.Sc(Ze),(Ge||f.ga.instance.nodeHasBindings(Ze))&&(ye=z(Ze,null,he).bindingContextForDescendants),ye&&!ee[f.a.R(Ze)]&&M(ye,Ze)}function w(he){var Ze=[],ye={},Ge=[];return f.a.P(he,function Ae(Fe){if(!ye[Fe]){var tt=f.getBindingHandler(Fe);tt&&(tt.after&&(Ge.push(Fe),f.a.D(tt.after,function(Be){if(he[Be]){if(f.a.A(Ge,Be)!==-1)throw Error("Cannot combine the following bindings, because they have a cyclic dependency: "+Ge.join(", "));Ae(Be)}}),Ge.length--),Ze.push({key:Fe,Mc:tt})),ye[Fe]=!0}}),Ze}function z(he,Ze,ye){var Ge=f.a.g.Ub(he,_e,{}),Ae=Ge.hd;if(!Ze){if(Ae)throw Error("You cannot apply bindings multiple times to the same element.");Ge.hd=!0}Ae||(Ge.context=ye),Ge.Zb||(Ge.Zb={});var Fe;if(Ze&&typeof Ze!="function")Fe=Ze;else{var tt=f.ga.instance,Be=tt.getBindingAccessors||D,je=f.$(function(){return(Fe=Ze?Ze(ye,he):Be.call(tt,he,ye))&&(ye[te]&&ye[te](),ye[$]&&ye[$]()),Fe},null,{l:he});Fe&&je.ja()||(je=null)}var qe=ye,We;if(Fe){var Ke=function(){return f.a.Ga(je?je():Fe,v)},ct=je?function(Et){return function(){return v(je()[Et])}}:function(Et){return Fe[Et]};Ke.get=function(Et){return Fe[Et]&&v(ct(Et))},Ke.has=function(Et){return Et in Fe},f.i.H in Fe&&f.i.subscribe(he,f.i.H,function(){var Et=(0,Fe[f.i.H])();if(Et){var zt=f.h.childNodes(he);zt.length&&Et(zt,f.Ec(zt[0]))}}),f.i.pa in Fe&&(qe=f.i.Cb(he,ye),f.i.subscribe(he,f.i.pa,function(){var Et=(0,Fe[f.i.pa])();Et&&f.h.firstChild(he)&&Et(he)})),Ge=w(Fe),f.a.D(Ge,function(Et){var zt=Et.Mc.init,ut=Et.Mc.update,bt=Et.key;if(he.nodeType===8&&!f.h.ea[bt])throw Error("The binding '"+bt+"' cannot be used with virtual elements");try{typeof zt=="function"&&f.u.G(function(){var ht=zt(he,ct(bt),Ke,qe.$data,qe);if(ht&&ht.controlsDescendantBindings){if(We!==e)throw Error("Multiple bindings ("+We+" and "+bt+") are trying to control descendant bindings of the same element. You cannot use these bindings together on the same element.");We=bt}}),typeof ut=="function"&&f.$(function(){ut(he,ct(bt),Ke,qe.$data,qe)},null,{l:he})}catch(ht){throw ht.message='Unable to process binding "'+bt+": "+Fe[bt]+`" -Message: `+ht.message,ht}})}return Ge=We===e,{shouldBindDescendants:Ge,bindingContextForDescendants:Ge&&qe}}function K(he,Ze){return he&&he instanceof f.fa?he:new f.fa(he,e,e,Ze)}var te=f.a.Da("_subscribable"),H=f.a.Da("_ancestorBindingInfo"),$=f.a.Da("_dataDependency");f.c={};var ee={script:!0,textarea:!0,template:!0};f.getBindingHandler=function(he){return f.c[he]};var le={};f.fa=function(he,Ze,ye,Ge,Ae){function Fe(){var ct=qe?je():je,Et=f.a.f(ct);return Ze?(f.a.extend(tt,Ze),H in Ze&&(tt[H]=Ze[H])):(tt.$parents=[],tt.$root=Et,tt.ko=f),tt[te]=We,Be?Et=tt.$data:(tt.$rawData=ct,tt.$data=Et),ye&&(tt[ye]=Et),Ge&&Ge(tt,Ze,Et),Ze&&Ze[te]&&!f.S.o().Vb(Ze[te])&&Ze[te](),Ke&&(tt[$]=Ke),tt.$data}var tt=this,Be=he===le,je=Be?e:he,qe=typeof je=="function"&&!f.O(je),We,Ke=Ae&&Ae.dataDependency;Ae&&Ae.exportDependencies?Fe():(We=f.xb(Fe),We.v(),We.ja()?We.equalityComparer=null:tt[te]=e)},f.fa.prototype.createChildContext=function(he,Ze,ye,Ge){if(!Ge&&Ze&&typeof Ze=="object"&&(Ge=Ze,Ze=Ge.as,ye=Ge.extend),Ze&&Ge&&Ge.noChildContext){var Ae=typeof he=="function"&&!f.O(he);return new f.fa(le,this,null,function(Fe){ye&&ye(Fe),Fe[Ze]=Ae?he():he},Ge)}return new f.fa(he,this,Ze,function(Fe,tt){Fe.$parentContext=tt,Fe.$parent=tt.$data,Fe.$parents=(tt.$parents||[]).slice(0),Fe.$parents.unshift(Fe.$parent),ye&&ye(Fe)},Ge)},f.fa.prototype.extend=function(he,Ze){return new f.fa(le,this,null,function(ye){f.a.extend(ye,typeof he=="function"?he(ye):he)},Ze)};var _e=f.a.g.Z();V.prototype.Tc=function(){this.Kb&&this.Kb.N&&this.Kb.N.sd(this.node)},V.prototype.sd=function(he){f.a.Pa(this.kb,he),!this.kb.length&&this.H&&this.Cc()},V.prototype.Cc=function(){this.H=!0,this.yc.N&&!this.kb.length&&(this.yc.N=null,f.a.K.yb(this.node,g),f.i.ma(this.node,f.i.pa),this.Tc())},f.i={H:"childrenComplete",pa:"descendantsComplete",subscribe:function(he,Ze,ye,Ge,Ae){var Fe=f.a.g.Ub(he,_e,{});return Fe.Fa||(Fe.Fa=new f.T),Ae&&Ae.notifyImmediately&&Fe.Zb[Ze]&&f.u.G(ye,Ge,[he]),Fe.Fa.subscribe(ye,Ge,Ze)},ma:function(he,Ze){var ye=f.a.g.get(he,_e);if(ye&&(ye.Zb[Ze]=!0,ye.Fa&&ye.Fa.notifySubscribers(he,Ze),Ze==f.i.H)){if(ye.N)ye.N.Cc();else if(ye.N===e&&ye.Fa&&ye.Fa.Wa(f.i.pa))throw Error("descendantsComplete event not supported for bindings on this node")}},Cb:function(he,Ze){var ye=f.a.g.Ub(he,_e,{});return ye.N||(ye.N=new V(he,ye,Ze[H])),Ze[H]==ye?Ze:Ze.extend(function(Ge){Ge[H]=ye})}},f.Td=function(he){return(he=f.a.g.get(he,_e))&&he.context},f.ib=function(he,Ze,ye){return he.nodeType===1&&f.h.Sc(he),z(he,Ze,K(ye))},f.ld=function(he,Ze,ye){return ye=K(ye),f.ib(he,Y(Ze,ye,he),ye)},f.Oa=function(he,Ze){Ze.nodeType!==1&&Ze.nodeType!==8||M(K(he),Ze)},f.vc=function(he,Ze,ye){if(!o&&t.jQuery&&(o=t.jQuery),2>arguments.length){if(Ze=n.body,!Ze)throw Error("ko.applyBindings: could not find document.body; has the document been loaded?")}else if(!Ze||Ze.nodeType!==1&&Ze.nodeType!==8)throw Error("ko.applyBindings: first parameter should be your view model; second parameter should be a DOM node");O(K(he,ye),Ze)},f.Dc=function(he){return!he||he.nodeType!==1&&he.nodeType!==8?e:f.Td(he)},f.Ec=function(he){return(he=f.Dc(he))?he.$data:e},f.b("bindingHandlers",f.c),f.b("bindingEvent",f.i),f.b("bindingEvent.subscribe",f.i.subscribe),f.b("bindingEvent.startPossiblyAsyncContentBinding",f.i.Cb),f.b("applyBindings",f.vc),f.b("applyBindingsToDescendants",f.Oa),f.b("applyBindingAccessorsToNode",f.ib),f.b("applyBindingsToNode",f.ld),f.b("contextFor",f.Dc),f.b("dataFor",f.Ec)})(),(function(g){function V(D,M){var O=Object.prototype.hasOwnProperty.call(X,D)?X[D]:g,w;O?O.subscribe(M):(O=X[D]=new f.T,O.subscribe(M),G(D,function(z,K){var te=!(!K||!K.synchronous);Y[D]={definition:z,Gd:te},delete X[D],w||te?O.notifySubscribers(z):f.na.zb(function(){O.notifySubscribers(z)})}),w=!0)}function G(D,M){v("getConfig",[D],function(O){O?v("loadComponent",[D,O],function(w){M(w,O)}):M(null,null)})}function v(D,M,O,w){w||(w=f.j.loaders.slice(0));var z=w.shift();if(z){var K=z[D];if(K){var te=!1;if(K.apply(z,M.concat(function(H){te?O(null):H!==null?O(H):v(D,M,O,w)}))!==g&&(te=!0,!z.suppressLoaderExceptions))throw Error("Component loaders must supply values by invoking the callback, not by returning values synchronously.")}else v(D,M,O,w)}else O(null)}var X={},Y={};f.j={get:function(D,M){var O=Object.prototype.hasOwnProperty.call(Y,D)?Y[D]:g;O?O.Gd?f.u.G(function(){M(O.definition)}):f.na.zb(function(){M(O.definition)}):V(D,M)},Bc:function(D){delete Y[D]},oc:v},f.j.loaders=[],f.b("components",f.j),f.b("components.get",f.j.get),f.b("components.clearCachedDefinition",f.j.Bc)})(),(function(){function g(O,w,z,K){function te(){--$===0&&K(H)}var H={},$=2,ee=z.template;z=z.viewModel,ee?X(w,ee,function(le){f.j.oc("loadTemplate",[O,le],function(_e){H.template=_e,te()})}):te(),z?X(w,z,function(le){f.j.oc("loadViewModel",[O,le],function(_e){H[M]=_e,te()})}):te()}function V(O,w,z){if(typeof w=="function")z(function(te){return new w(te)});else if(typeof w[M]=="function")z(w[M]);else if("instance"in w){var K=w.instance;z(function(){return K})}else"viewModel"in w?V(O,w.viewModel,z):O("Unknown viewModel value: "+w)}function G(O){switch(f.a.R(O)){case"script":return f.a.ua(O.text);case"textarea":return f.a.ua(O.value);case"template":if(v(O.content))return f.a.Ca(O.content.childNodes)}return f.a.Ca(O.childNodes)}function v(O){return t.DocumentFragment?O instanceof DocumentFragment:O&&O.nodeType===11}function X(O,w,z){typeof w.require=="string"?a||t.require?(a||t.require)([w.require],function(K){K&&typeof K=="object"&&K.Xd&&K.default&&(K=K.default),z(K)}):O("Uses require, but no AMD loader is present"):z(w)}function Y(O){return function(w){throw Error("Component '"+O+"': "+w)}}var D={};f.j.register=function(O,w){if(!w)throw Error("Invalid configuration for "+O);if(f.j.tb(O))throw Error("Component "+O+" is already registered");D[O]=w},f.j.tb=function(O){return Object.prototype.hasOwnProperty.call(D,O)},f.j.unregister=function(O){delete D[O],f.j.Bc(O)},f.j.Fc={getConfig:function(O,w){w(f.j.tb(O)?D[O]:null)},loadComponent:function(O,w,z){var K=Y(O);X(K,w,function(te){g(O,K,te,z)})},loadTemplate:function(O,w,z){if(O=Y(O),typeof w=="string")z(f.a.ua(w));else if(w instanceof Array)z(w);else if(v(w))z(f.a.la(w.childNodes));else if(w.element)if(w=w.element,t.HTMLElement?w instanceof HTMLElement:w&&w.tagName&&w.nodeType===1)z(G(w));else if(typeof w=="string"){var K=n.getElementById(w);K?z(G(K)):O("Cannot find element with ID "+w)}else O("Unknown element type: "+w);else O("Unknown template value: "+w)},loadViewModel:function(O,w,z){V(Y(O),w,z)}};var M="createViewModel";f.b("components.register",f.j.register),f.b("components.isRegistered",f.j.tb),f.b("components.unregister",f.j.unregister),f.b("components.defaultLoader",f.j.Fc),f.j.loaders.push(f.j.Fc),f.j.dd=D})(),(function(){function g(G,v){var X=G.getAttribute("params");if(X){var X=V.parseBindingsString(X,v,G,{valueAccessors:!0,bindingParams:!0}),X=f.a.Ga(X,function(M){return f.o(M,null,{l:G})}),Y=f.a.Ga(X,function(M){var O=M.v();return M.ja()?f.o({read:function(){return f.a.f(M())},write:f.Za(O)&&function(w){M()(w)},l:G}):O});return Object.prototype.hasOwnProperty.call(Y,"$raw")||(Y.$raw=X),Y}return{$raw:{}}}f.j.getComponentNameForNode=function(G){var v=f.a.R(G);if(f.j.tb(v)&&(v.indexOf("-")!=-1||""+G=="[object HTMLUnknownElement]"||8>=f.a.W&&G.tagName===v))return v},f.j.tc=function(G,v,X,Y){if(v.nodeType===1){var D=f.j.getComponentNameForNode(v);if(D){if(G=G||{},G.component)throw Error('Cannot use the "component" binding on a custom element matching a component');var M={name:D,params:g(v,X)};G.component=Y?function(){return M}:M}}return G};var V=new f.ga;9>f.a.W&&(f.j.register=(function(G){return function(v){return G.apply(this,arguments)}})(f.j.register),n.createDocumentFragment=(function(G){return function(){var v=G(),X=f.j.dd,Y;for(Y in X);return v}})(n.createDocumentFragment))})(),(function(){function g(v,X,Y){if(X=X.template,!X)throw Error("Component '"+v+"' has no template");v=f.a.Ca(X),f.h.va(Y,v)}function V(v,X,Y){var D=v.createViewModel;return D?D.call(v,X,Y):X}var G=0;f.c.component={init:function(v,X,Y,D,M){function O(){var H=w&&w.dispose;typeof H=="function"&&H.call(w),K&&K.s(),z=w=K=null}var w,z,K,te=f.a.la(f.h.childNodes(v));return f.h.Ea(v),f.a.K.za(v,O),f.o(function(){var H=f.a.f(X()),$,ee;if(typeof H=="string"?$=H:($=f.a.f(H.name),ee=f.a.f(H.params)),!$)throw Error("No component name specified");var le=f.i.Cb(v,M),_e=z=++G;f.j.get($,function(he){if(z===_e){if(O(),!he)throw Error("Unknown component '"+$+"'");g($,he,v);var Ze=V(he,ee,{element:v,templateNodes:te});he=le.createChildContext(Ze,{extend:function(ye){ye.$component=Ze,ye.$componentTemplateNodes=te}}),Ze&&Ze.koDescendantsComplete&&(K=f.i.subscribe(v,f.i.pa,Ze.koDescendantsComplete,Ze)),w=Ze,f.Oa(he,v)}})},null,{l:v}),{controlsDescendantBindings:!0}}},f.h.ea.component=!0})();var I={class:"className",for:"htmlFor"};f.c.attr={update:function(g,V){var G=f.a.f(V())||{};f.a.P(G,function(v,X){X=f.a.f(X);var Y=v.indexOf(":"),Y="lookupNamespaceURI"in g&&0<Y&&g.lookupNamespaceURI(v.substr(0,Y)),D=X===!1||X===null||X===e;D?Y?g.removeAttributeNS(Y,v):g.removeAttribute(v):X=X.toString(),8>=f.a.W&&v in I?(v=I[v],D?g.removeAttribute(v):g[v]=X):D||(Y?g.setAttributeNS(Y,v,X):g.setAttribute(v,X)),v==="name"&&f.a.Yc(g,D?"":X)})}},(function(){f.c.checked={after:["value","attr"],init:function(g,V,G){function v(){var H=g.checked,$=Y();if(!f.S.Ya()&&(H||!M&&!f.S.qa())){var ee=f.u.G(V);if(w){var le=z?ee.v():ee,_e=te;te=$,_e!==$?H&&(f.a.Na(le,$,!0),f.a.Na(le,_e,!1)):f.a.Na(le,$,H),z&&f.Za(ee)&&ee(le)}else D&&($===e?$=H:H||($=e)),f.m.eb(ee,G,"checked",$,!0)}}function X(){var H=f.a.f(V()),$=Y();w?(g.checked=0<=f.a.A(H,$),te=$):g.checked=D&&$===e?!!H:Y()===H}var Y=f.xb(function(){if(G.has("checkedValue"))return f.a.f(G.get("checkedValue"));if(K)return G.has("value")?f.a.f(G.get("value")):g.value}),D=g.type=="checkbox",M=g.type=="radio";if(D||M){var O=V(),w=D&&f.a.f(O)instanceof Array,z=!(w&&O.push&&O.splice),K=M||w,te=w?Y():e;M&&!g.name&&f.c.uniqueName.init(g,function(){return!0}),f.o(v,null,{l:g}),f.a.B(g,"click",v),f.o(X,null,{l:g}),O=e}}},f.m.wa.checked=!0,f.c.checkedValue={update:function(g,V){g.value=f.a.f(V())}}})(),f.c.class={update:function(g,V){var G=f.a.Db(f.a.f(V()));f.a.Eb(g,g.__ko__cssValue,!1),g.__ko__cssValue=G,f.a.Eb(g,G,!0)}},f.c.css={update:function(g,V){var G=f.a.f(V());G!==null&&typeof G=="object"?f.a.P(G,function(v,X){X=f.a.f(X),f.a.Eb(g,v,X)}):f.c.class.update(g,V)}},f.c.enable={update:function(g,V){var G=f.a.f(V());G&&g.disabled?g.removeAttribute("disabled"):G||g.disabled||(g.disabled=!0)}},f.c.disable={update:function(g,V){f.c.enable.update(g,function(){return!f.a.f(V())})}},f.c.event={init:function(g,V,G,v,X){var Y=V()||{};f.a.P(Y,function(D){typeof D=="string"&&f.a.B(g,D,function(M){var O,w=V()[D];if(w){try{var z=f.a.la(arguments);v=X.$data,z.unshift(v),O=w.apply(v,z)}finally{O!==!0&&(M.preventDefault?M.preventDefault():M.returnValue=!1)}G.get(D+"Bubble")===!1&&(M.cancelBubble=!0,M.stopPropagation&&M.stopPropagation())}})})}},f.c.foreach={Rc:function(g){return function(){var V=g(),G=f.a.bc(V);return!G||typeof G.length=="number"?{foreach:V,templateEngine:f.ba.Ma}:(f.a.f(V),{foreach:G.data,as:G.as,noChildContext:G.noChildContext,includeDestroyed:G.includeDestroyed,afterAdd:G.afterAdd,beforeRemove:G.beforeRemove,afterRender:G.afterRender,beforeMove:G.beforeMove,afterMove:G.afterMove,templateEngine:f.ba.Ma})}},init:function(g,V){return f.c.template.init(g,f.c.foreach.Rc(V))},update:function(g,V,G,v,X){return f.c.template.update(g,f.c.foreach.Rc(V),G,v,X)}},f.m.Ra.foreach=!1,f.h.ea.foreach=!0,f.c.hasfocus={init:function(g,V,G){function v(D){g.__ko_hasfocusUpdating=!0;var M=g.ownerDocument;if("activeElement"in M){var O;try{O=M.activeElement}catch{O=M.body}D=O===g}M=V(),f.m.eb(M,G,"hasfocus",D,!0),g.__ko_hasfocusLastValue=D,g.__ko_hasfocusUpdating=!1}var X=v.bind(null,!0),Y=v.bind(null,!1);f.a.B(g,"focus",X),f.a.B(g,"focusin",X),f.a.B(g,"blur",Y),f.a.B(g,"focusout",Y),g.__ko_hasfocusLastValue=!1},update:function(g,V){var G=!!f.a.f(V());g.__ko_hasfocusUpdating||g.__ko_hasfocusLastValue===G||(G?g.focus():g.blur(),!G&&g.__ko_hasfocusLastValue&&g.ownerDocument.body.focus(),f.u.G(f.a.Fb,null,[g,G?"focusin":"focusout"]))}},f.m.wa.hasfocus=!0,f.c.hasFocus=f.c.hasfocus,f.m.wa.hasFocus="hasfocus",f.c.html={init:function(){return{controlsDescendantBindings:!0}},update:function(g,V){f.a.fc(g,V())}},(function(){function g(V,G,v){f.c[V]={init:function(X,Y,D,M,O){var w,z,K={},te,H,$;if(G){M=D.get("as");var ee=D.get("noChildContext");$=!(M&&ee),K={as:M,noChildContext:ee,exportDependencies:$}}return H=(te=D.get("completeOn")=="render")||D.has(f.i.pa),f.o(function(){var le=f.a.f(Y()),_e=!v!=!le,he=!z,Ze;($||_e!==w)&&(H&&(O=f.i.Cb(X,O)),_e&&((!G||$)&&(K.dataDependency=f.S.o()),Ze=G?O.createChildContext(typeof le=="function"?le:Y,K):f.S.qa()?O.extend(null,K):O),he&&f.S.qa()&&(z=f.a.Ca(f.h.childNodes(X),!0)),_e?(he||f.h.va(X,f.a.Ca(z)),f.Oa(Ze,X)):(f.h.Ea(X),te||f.i.ma(X,f.i.H)),w=_e)},null,{l:X}),{controlsDescendantBindings:!0}}},f.m.Ra[V]=!1,f.h.ea[V]=!0}g("if"),g("ifnot",!1,!0),g("with",!0)})(),f.c.let={init:function(g,V,G,v,X){return V=X.extend(V),f.Oa(V,g),{controlsDescendantBindings:!0}}},f.h.ea.let=!0;var N={};f.c.options={init:function(g){if(f.a.R(g)!=="select")throw Error("options binding applies only to SELECT elements");for(;0<g.length;)g.remove(0);return{controlsDescendantBindings:!0}},update:function(g,V,G){function v(){return f.a.jb(g.options,function(ee){return ee.selected})}function X(ee,le,_e){var he=typeof le;return he=="function"?le(ee):he=="string"?ee[le]:_e}function Y(ee,le){if(H&&w)f.i.ma(g,f.i.H);else if(te.length){var _e=0<=f.a.A(te,f.w.M(le[0]));f.a.Zc(le[0],_e),H&&!_e&&f.u.G(f.a.Fb,null,[g,"change"])}}var D=g.multiple,M=g.length!=0&&D?g.scrollTop:null,O=f.a.f(V()),w=G.get("valueAllowUnset")&&G.has("value"),z=G.get("optionsIncludeDestroyed");V={};var K,te=[];w||(D?te=f.a.Mb(v(),f.w.M):0<=g.selectedIndex&&te.push(f.w.M(g.options[g.selectedIndex]))),O&&(typeof O.length>"u"&&(O=[O]),K=f.a.jb(O,function(ee){return z||ee===e||ee===null||!f.a.f(ee._destroy)}),G.has("optionsCaption")&&(O=f.a.f(G.get("optionsCaption")),O!==null&&O!==e&&K.unshift(N)));var H=!1;if(V.beforeRemove=function(ee){g.removeChild(ee)},O=Y,G.has("optionsAfterRender")&&typeof G.get("optionsAfterRender")=="function"&&(O=function(ee,le){Y(0,le),f.u.G(G.get("optionsAfterRender"),null,[le[0],ee!==N?ee:e])}),f.a.ec(g,K,function(ee,le,_e){return _e.length&&(te=!w&&_e[0].selected?[f.w.M(_e[0])]:[],H=!0),le=g.ownerDocument.createElement("option"),ee===N?(f.a.Bb(le,G.get("optionsCaption")),f.w.cb(le,e)):(_e=X(ee,G.get("optionsValue"),ee),f.w.cb(le,f.a.f(_e)),ee=X(ee,G.get("optionsText"),_e),f.a.Bb(le,ee)),[le]},V,O),!w){var $;D?$=te.length&&v().length<te.length:$=te.length&&0<=g.selectedIndex?f.w.M(g.options[g.selectedIndex])!==te[0]:te.length||0<=g.selectedIndex,$&&f.u.G(f.a.Fb,null,[g,"change"])}(w||f.S.Ya())&&f.i.ma(g,f.i.H),f.a.wd(g),M&&20<Math.abs(M-g.scrollTop)&&(g.scrollTop=M)}},f.c.options.$b=f.a.g.Z(),f.c.selectedOptions={init:function(g,V,G){function v(){var D=V(),M=[];f.a.D(g.getElementsByTagName("option"),function(O){O.selected&&M.push(f.w.M(O))}),f.m.eb(D,G,"selectedOptions",M)}function X(){var D=f.a.f(V()),M=g.scrollTop;D&&typeof D.length=="number"&&f.a.D(g.getElementsByTagName("option"),function(O){var w=0<=f.a.A(D,f.w.M(O));O.selected!=w&&f.a.Zc(O,w)}),g.scrollTop=M}if(f.a.R(g)!="select")throw Error("selectedOptions binding applies only to SELECT elements");var Y;f.i.subscribe(g,f.i.H,function(){Y?v():(f.a.B(g,"change",v),Y=f.o(X,null,{l:g}))},null,{notifyImmediately:!0})},update:function(){}},f.m.wa.selectedOptions=!0,f.c.style={update:function(g,V){var G=f.a.f(V()||{});f.a.P(G,function(v,X){if(X=f.a.f(X),(X===null||X===e||X===!1)&&(X=""),o)o(g).css(v,X);else if(/^--/.test(v))g.style.setProperty(v,X);else{v=v.replace(/-(\w)/g,function(D,M){return M.toUpperCase()});var Y=g.style[v];g.style[v]=X,X===Y||g.style[v]!=Y||isNaN(X)||(g.style[v]=X+"px")}})}},f.c.submit={init:function(g,V,G,v,X){if(typeof V()!="function")throw Error("The value for a submit binding must be a function");f.a.B(g,"submit",function(Y){var D,M=V();try{D=M.call(X.$data,g)}finally{D!==!0&&(Y.preventDefault?Y.preventDefault():Y.returnValue=!1)}})}},f.c.text={init:function(){return{controlsDescendantBindings:!0}},update:function(g,V){f.a.Bb(g,V())}},f.h.ea.text=!0,(function(){if(t&&t.navigator){var g=function(K){if(K)return parseFloat(K[1])},V=t.navigator.userAgent,G,v,X,Y,D;(G=t.opera&&t.opera.version&&parseInt(t.opera.version()))||(D=g(V.match(/Edge\/([^ ]+)$/)))||g(V.match(/Chrome\/([^ ]+)/))||(v=g(V.match(/Version\/([^ ]+) Safari/)))||(X=g(V.match(/Firefox\/([^ ]+)/)))||(Y=f.a.W||g(V.match(/MSIE ([^ ]+)/)))||(Y=g(V.match(/rv:([^ )]+)/)))}if(8<=Y&&10>Y)var M=f.a.g.Z(),O=f.a.g.Z(),w=function(K){var te=this.activeElement;(te=te&&f.a.g.get(te,O))&&te(K)},z=function(K,te){var H=K.ownerDocument;f.a.g.get(H,M)||(f.a.g.set(H,M,!0),f.a.B(H,"selectionchange",w)),f.a.g.set(K,O,te)};f.c.textInput={init:function(K,te,H){function $(Fe,tt){f.a.B(K,Fe,tt)}function ee(){var Fe=f.a.f(te());(Fe===null||Fe===e)&&(Fe=""),ye!==e&&Fe===ye?f.a.setTimeout(ee,4):K.value!==Fe&&(Ae=!0,K.value=Fe,Ae=!1,he=K.value)}function le(){Ze||(ye=K.value,Ze=f.a.setTimeout(_e,4))}function _e(){clearTimeout(Ze),ye=Ze=e;var Fe=K.value;he!==Fe&&(he=Fe,f.m.eb(te(),H,"textInput",Fe))}var he=K.value,Ze,ye,Ge=f.a.W==9?le:_e,Ae=!1;Y&&$("keypress",_e),11>Y&&$("propertychange",function(Fe){Ae||Fe.propertyName!=="value"||Ge(Fe)}),Y==8&&($("keyup",_e),$("keydown",_e)),z&&(z(K,Ge),$("dragend",le)),(!Y||9<=Y)&&$("input",Ge),5>v&&f.a.R(K)==="textarea"?($("keydown",le),$("paste",le),$("cut",le)):11>G?$("keydown",le):4>X?($("DOMAutoComplete",_e),$("dragdrop",_e),$("drop",_e)):D&&K.type==="number"&&$("keydown",le),$("change",_e),$("blur",_e),f.o(ee,null,{l:K})}},f.m.wa.textInput=!0,f.c.textinput={preprocess:function(K,te,H){H("textInput",K)}}})(),f.c.uniqueName={init:function(g,V){if(V()){var G="ko_unique_"+ ++f.c.uniqueName.rd;f.a.Yc(g,G)}}},f.c.uniqueName.rd=0,f.c.using={init:function(g,V,G,v,X){var Y;return G.has("as")&&(Y={as:G.get("as"),noChildContext:G.get("noChildContext")}),V=X.createChildContext(V,Y),f.Oa(V,g),{controlsDescendantBindings:!0}}},f.h.ea.using=!0,f.c.value={init:function(g,V,G){var v=f.a.R(g),X=v=="input";if(!X||g.type!="checkbox"&&g.type!="radio"){var Y=[],D=G.get("valueUpdate"),M=!1,O=null;D&&(typeof D=="string"?Y=[D]:Y=f.a.wc(D),f.a.Pa(Y,"change"));var w=function(){O=null,M=!1;var te=V(),H=f.w.M(g);f.m.eb(te,G,"value",H)};!f.a.W||!X||g.type!="text"||g.autocomplete=="off"||g.form&&g.form.autocomplete=="off"||f.a.A(Y,"propertychange")!=-1||(f.a.B(g,"propertychange",function(){M=!0}),f.a.B(g,"focus",function(){M=!1}),f.a.B(g,"blur",function(){M&&w()})),f.a.D(Y,function(te){var H=w;f.a.Ud(te,"after")&&(H=function(){O=f.w.M(g),f.a.setTimeout(w,0)},te=te.substring(5)),f.a.B(g,te,H)});var z;if(z=X&&g.type=="file"?function(){var te=f.a.f(V());te===null||te===e||te===""?g.value="":f.u.G(w)}:function(){var te=f.a.f(V()),H=f.w.M(g);O!==null&&te===O?f.a.setTimeout(z,0):(te!==H||H===e)&&(v==="select"?(H=G.get("valueAllowUnset"),f.w.cb(g,te,H),H||te===f.w.M(g)||f.u.G(w)):f.w.cb(g,te))},v==="select"){var K;f.i.subscribe(g,f.i.H,function(){K?G.get("valueAllowUnset")?z():w():(f.a.B(g,"change",w),K=f.o(z,null,{l:g}))},null,{notifyImmediately:!0})}else f.a.B(g,"change",w),f.o(z,null,{l:g})}else f.ib(g,{checkedValue:V})},update:function(){}},f.m.wa.value=!0,f.c.visible={update:function(g,V){var G=f.a.f(V()),v=g.style.display!="none";G&&!v?g.style.display="":!G&&v&&(g.style.display="none")}},f.c.hidden={update:function(g,V){f.c.visible.update(g,function(){return!f.a.f(V())})}},(function(g){f.c[g]={init:function(V,G,v,X,Y){return f.c.event.init.call(this,V,function(){var D={};return D[g]=G(),D},v,X,Y)}}})("click"),f.ca=function(){},f.ca.prototype.renderTemplateSource=function(){throw Error("Override renderTemplateSource")},f.ca.prototype.createJavaScriptEvaluatorBlock=function(){throw Error("Override createJavaScriptEvaluatorBlock")},f.ca.prototype.makeTemplateSource=function(g,V){if(typeof g=="string"){V=V||n;var G=V.getElementById(g);if(!G)throw Error("Cannot find template with ID "+g);return new f.C.F(G)}if(g.nodeType==1||g.nodeType==8)return new f.C.ia(g);throw Error("Unknown template type: "+g)},f.ca.prototype.renderTemplate=function(g,V,G,v){return g=this.makeTemplateSource(g,v),this.renderTemplateSource(g,V,G,v)},f.ca.prototype.isTemplateRewritten=function(g,V){return this.allowTemplateRewriting===!1?!0:this.makeTemplateSource(g,V).data("isRewritten")},f.ca.prototype.rewriteTemplate=function(g,V,G){g=this.makeTemplateSource(g,G),V=V(g.text()),g.text(V),g.data("isRewritten",!0)},f.b("templateEngine",f.ca),f.kc=(function(){function g(v,X,Y,D){v=f.m.ac(v);for(var M=f.m.Ra,O=0;O<v.length;O++){var w=v[O].key;if(Object.prototype.hasOwnProperty.call(M,w)){var z=M[w];if(typeof z=="function"){if(w=z(v[O].value))throw Error(w)}else if(!z)throw Error("This template engine does not support the '"+w+"' binding within its templates")}}return Y="ko.__tr_ambtns(function($context,$element){return(function(){return{ "+f.m.vb(v,{valueAccessors:!0})+" } })()},'"+Y.toLowerCase()+"')",D.createJavaScriptEvaluatorBlock(Y)+X}var V=/(<([a-z]+\d*)(?:\s+(?!data-bind\s*=\s*)[a-z0-9\-]+(?:=(?:\"[^\"]*\"|\'[^\']*\'|[^>]*))?)*\s+)data-bind\s*=\s*(["'])([\s\S]*?)\3/gi,G=/\x3c!--\s*ko\b\s*([\s\S]*?)\s*--\x3e/g;return{xd:function(v,X,Y){X.isTemplateRewritten(v,Y)||X.rewriteTemplate(v,function(D){return f.kc.Ld(D,X)},Y)},Ld:function(v,X){return v.replace(V,function(Y,D,M,O,w){return g(w,D,M,X)}).replace(G,function(Y,D){return g(D,"<!-- ko -->","#comment",X)})},md:function(v,X){return f.aa.Xb(function(Y,D){var M=Y.nextSibling;M&&M.nodeName.toLowerCase()===X&&f.ib(M,v,D)})}}})(),f.b("__tr_ambtns",f.kc.md),(function(){f.C={},f.C.F=function(G){if(this.F=G){var v=f.a.R(G);this.ab=v==="script"?1:v==="textarea"?2:v=="template"&&G.content&&G.content.nodeType===11?3:4}},f.C.F.prototype.text=function(){var G=this.ab===1?"text":this.ab===2?"value":"innerHTML";if(arguments.length==0)return this.F[G];var v=arguments[0];G==="innerHTML"?f.a.fc(this.F,v):this.F[G]=v};var g=f.a.g.Z()+"_";f.C.F.prototype.data=function(G){if(arguments.length===1)return f.a.g.get(this.F,g+G);f.a.g.set(this.F,g+G,arguments[1])};var V=f.a.g.Z();f.C.F.prototype.nodes=function(){var G=this.F;if(arguments.length==0){var v=f.a.g.get(G,V)||{},X=v.lb||(this.ab===3?G.content:this.ab===4?G:e);if(!X||v.jd){var Y=this.text();Y&&Y!==v.bb&&(X=f.a.Md(Y,G.ownerDocument),f.a.g.set(G,V,{lb:X,bb:Y,jd:!0}))}return X}v=arguments[0],this.ab!==e&&this.text(""),f.a.g.set(G,V,{lb:v})},f.C.ia=function(G){this.F=G},f.C.ia.prototype=new f.C.F,f.C.ia.prototype.constructor=f.C.ia,f.C.ia.prototype.text=function(){if(arguments.length==0){var G=f.a.g.get(this.F,V)||{};return G.bb===e&&G.lb&&(G.bb=G.lb.innerHTML),G.bb}f.a.g.set(this.F,V,{bb:arguments[0]})},f.b("templateSources",f.C),f.b("templateSources.domElement",f.C.F),f.b("templateSources.anonymousTemplate",f.C.ia)})(),(function(){function g(O,w,z){var K;for(w=f.h.nextSibling(w);O&&(K=O)!==w;)O=f.h.nextSibling(K),z(K,O)}function V(O,w){if(O.length){var z=O[0],K=O[O.length-1],te=z.parentNode,H=f.ga.instance,$=H.preprocessNode;if($){if(g(z,K,function(ee,le){var _e=ee.previousSibling,he=$.call(H,ee);he&&(ee===z&&(z=he[0]||le),ee===K&&(K=he[he.length-1]||_e))}),O.length=0,!z)return;z===K?O.push(z):(O.push(z,K),f.a.Ua(O,te))}g(z,K,function(ee){ee.nodeType!==1&&ee.nodeType!==8||f.vc(w,ee)}),g(z,K,function(ee){ee.nodeType!==1&&ee.nodeType!==8||f.aa.cd(ee,[w])}),f.a.Ua(O,te)}}function G(O){return O.nodeType?O:0<O.length?O[0]:null}function v(O,w,z,K,te){te=te||{};var H=(O&&G(O)||z||{}).ownerDocument,$=te.templateEngine||Y;if(f.kc.xd(z,$,H),z=$.renderTemplate(z,K,te,H),typeof z.length!="number"||0<z.length&&typeof z[0].nodeType!="number")throw Error("Template engine must return an array of DOM nodes");switch(H=!1,w){case"replaceChildren":f.h.va(O,z),H=!0;break;case"replaceNode":f.a.Xc(O,z),H=!0;break;case"ignoreTargetNode":break;default:throw Error("Unknown renderMode: "+w)}return H&&(V(z,K),te.afterRender&&f.u.G(te.afterRender,null,[z,K[te.as||"$data"]]),w=="replaceChildren"&&f.i.ma(O,f.i.H)),z}function X(O,w,z){return f.O(O)?O():typeof O=="function"?O(w,z):O}var Y;f.gc=function(O){if(O!=e&&!(O instanceof f.ca))throw Error("templateEngine must inherit from ko.templateEngine");Y=O},f.dc=function(O,w,z,K,te){if(z=z||{},(z.templateEngine||Y)==e)throw Error("Set a template engine before calling renderTemplate");if(te=te||"replaceChildren",K){var H=G(K);return f.$(function(){var ee=w&&w instanceof f.fa?w:new f.fa(w,null,null,null,{exportDependencies:!0}),$=X(O,ee.$data,ee),ee=v(K,te,$,ee,z);te=="replaceNode"&&(K=ee,H=G(K))},null,{Sa:function(){return!H||!f.a.Sb(H)},l:H&&te=="replaceNode"?H.parentNode:H})}return f.aa.Xb(function($){f.dc(O,w,z,$,"replaceNode")})},f.Qd=function(O,w,z,K,te){function H(ye,Ge){f.u.G(f.a.ec,null,[K,ye,ee,z,$,Ge]),f.i.ma(K,f.i.H)}function $(ye,Ge){V(Ge,le),z.afterRender&&z.afterRender(Ge,ye),le=null}function ee(ye,Ge){le=te.createChildContext(ye,{as:_e,noChildContext:z.noChildContext,extend:function(Fe){Fe.$index=Ge,_e&&(Fe[_e+"Index"]=Ge)}});var Ae=X(O,ye,le);return v(K,"ignoreTargetNode",Ae,le,z)}var le,_e=z.as,he=z.includeDestroyed===!1||f.options.foreachHidesDestroyed&&!z.includeDestroyed;if(he||z.beforeRemove||!f.Pc(w))return f.$(function(){var ye=f.a.f(w)||[];typeof ye.length>"u"&&(ye=[ye]),he&&(ye=f.a.jb(ye,function(Ge){return Ge===e||Ge===null||!f.a.f(Ge._destroy)})),H(ye)},null,{l:K});H(w.v());var Ze=w.subscribe(function(ye){H(w(),ye)},null,"arrayChange");return Ze.l(K),Ze};var D=f.a.g.Z(),M=f.a.g.Z();f.c.template={init:function(O,w){var z=f.a.f(w());if(typeof z=="string"||"name"in z)f.h.Ea(O);else if("nodes"in z){if(z=z.nodes||[],f.O(z))throw Error('The "nodes" option must be a plain, non-observable array.');var K=z[0]&&z[0].parentNode;K&&f.a.g.get(K,M)||(K=f.a.Yb(z),f.a.g.set(K,M,!0)),new f.C.ia(O).nodes(K)}else if(z=f.h.childNodes(O),0<z.length)K=f.a.Yb(z),new f.C.ia(O).nodes(K);else throw Error("Anonymous template defined, but no template content was provided");return{controlsDescendantBindings:!0}},update:function(O,w,z,K,te){var H=w();w=f.a.f(H),z=!0,K=null,typeof w=="string"?w={}:(H="name"in w?w.name:O,"if"in w&&(z=f.a.f(w.if)),z&&"ifnot"in w&&(z=!f.a.f(w.ifnot)),z&&!H&&(z=!1)),"foreach"in w?K=f.Qd(H,z&&w.foreach||[],w,O,te):z?(z=te,"data"in w&&(z=te.createChildContext(w.data,{as:w.as,noChildContext:w.noChildContext,exportDependencies:!0})),K=f.dc(H,z,w,O)):f.h.Ea(O),te=K,(w=f.a.g.get(O,D))&&typeof w.s=="function"&&w.s(),f.a.g.set(O,D,!te||te.ja&&!te.ja()?e:te)}},f.m.Ra.template=function(O){return O=f.m.ac(O),O.length==1&&O[0].unknown||f.m.Id(O,"name")?null:"This template engine does not support anonymous templates nested within its templates"},f.h.ea.template=!0})(),f.b("setTemplateEngine",f.gc),f.b("renderTemplate",f.dc),f.a.Kc=function(g,V,G){if(g.length&&V.length){var v,X,Y,D,M;for(v=X=0;(!G||v<G)&&(D=g[X]);++X){for(Y=0;M=V[Y];++Y)if(D.value===M.value){D.moved=M.index,M.moved=D.index,V.splice(Y,1),v=Y=0;break}v+=Y}}},f.a.Pb=(function(){function g(V,G,v,X,Y){var D=Math.min,M=Math.max,O=[],w,z=V.length,K,te=G.length,H=te-z||1,$=z+te+1,ee,le,_e;for(w=0;w<=z;w++)for(le=ee,O.push(ee=[]),_e=D(te,w+H),K=M(0,w-1);K<=_e;K++)ee[K]=K?w?V[w-1]===G[K-1]?le[K-1]:D(le[K]||$,ee[K-1]||$)+1:K+1:w+1;for(D=[],M=[],H=[],w=z,K=te;w||K;)te=O[w][K]-1,K&&te===O[w][K-1]?M.push(D[D.length]={status:v,value:G[--K],index:K}):w&&te===O[w-1][K]?H.push(D[D.length]={status:X,value:V[--w],index:w}):(--K,--w,Y.sparse||D.push({status:"retained",value:G[K]}));return f.a.Kc(H,M,!Y.dontLimitMoves&&10*z),D.reverse()}return function(V,G,v){return v=typeof v=="boolean"?{dontLimitMoves:v}:v||{},V=V||[],G=G||[],V.length<G.length?g(V,G,"added","deleted",v):g(G,V,"deleted","added",v)}})(),f.b("utils.compareArrays",f.a.Pb),(function(){function g(v,X,Y,D,M){var O=[],w=f.$(function(){var z=X(Y,M,f.a.Ua(O,v))||[];0<O.length&&(f.a.Xc(O,z),D&&f.u.G(D,null,[Y,z,M])),O.length=0,f.a.Nb(O,z)},null,{l:v,Sa:function(){return!f.a.kd(O)}});return{Y:O,$:w.ja()?w:e}}var V=f.a.g.Z(),G=f.a.g.Z();f.a.ec=function(v,X,Y,D,M,O){function w(Et){Ae={Aa:Et,pb:f.ta(le++)},$.push(Ae),H||Ge.push(Ae)}function z(Et){Ae=te[Et],le!==Ae.pb.v()&&ye.push(Ae),Ae.pb(le++),f.a.Ua(Ae.Y,v),$.push(Ae)}function K(Et,zt){if(Et)for(var ut=0,bt=zt.length;ut<bt;ut++)f.a.D(zt[ut].Y,function(ht){Et(ht,ut,zt[ut].Aa)})}X=X||[],typeof X.length>"u"&&(X=[X]),D=D||{};var te=f.a.g.get(v,V),H=!te,$=[],ee=0,le=0,_e=[],he=[],Ze=[],ye=[],Ge=[],Ae,Fe=0;if(H)f.a.D(X,w);else{if(!O||te&&te._countWaitingForRemove){var tt=f.a.Mb(te,function(Et){return Et.Aa});O=f.a.Pb(tt,X,{dontLimitMoves:D.dontLimitMoves,sparse:!0})}for(var tt=0,Be,je,qe;Be=O[tt];tt++)switch(je=Be.moved,qe=Be.index,Be.status){case"deleted":for(;ee<qe;)z(ee++);je===e&&(Ae=te[ee],Ae.$&&(Ae.$.s(),Ae.$=e),f.a.Ua(Ae.Y,v).length&&(D.beforeRemove&&($.push(Ae),Fe++,Ae.Aa===G?Ae=null:Ze.push(Ae)),Ae&&_e.push.apply(_e,Ae.Y))),ee++;break;case"added":for(;le<qe;)z(ee++);je!==e?(he.push($.length),z(je)):w(Be.value)}for(;le<X.length;)z(ee++);$._countWaitingForRemove=Fe}f.a.g.set(v,V,$),K(D.beforeMove,ye),f.a.D(_e,D.beforeRemove?f.oa:f.removeNode);var We,Ke,ct;try{ct=v.ownerDocument.activeElement}catch{}if(he.length)for(;(tt=he.shift())!=e;){for(Ae=$[tt],We=e;tt;)if((Ke=$[--tt].Y)&&Ke.length){We=Ke[Ke.length-1];break}for(X=0;ee=Ae.Y[X];We=ee,X++)f.h.Wb(v,ee,We)}for(tt=0;Ae=$[tt];tt++){for(Ae.Y||f.a.extend(Ae,g(v,Y,Ae.Aa,M,Ae.pb)),X=0;ee=Ae.Y[X];We=ee,X++)f.h.Wb(v,ee,We);!Ae.Ed&&M&&(M(Ae.Aa,Ae.Y,Ae.pb),Ae.Ed=!0,We=Ae.Y[Ae.Y.length-1])}for(ct&&v.ownerDocument.activeElement!=ct&&ct.focus(),K(D.beforeRemove,Ze),tt=0;tt<Ze.length;++tt)Ze[tt].Aa=G;K(D.afterMove,ye),K(D.afterAdd,Ge)}})(),f.b("utils.setDomNodeChildrenFromArrayMapping",f.a.ec),f.ba=function(){this.allowTemplateRewriting=!1},f.ba.prototype=new f.ca,f.ba.prototype.constructor=f.ba,f.ba.prototype.renderTemplateSource=function(g,V,G,v){return(V=!(9>f.a.W)&&g.nodes?g.nodes():null)?f.a.la(V.cloneNode(!0).childNodes):(g=g.text(),f.a.ua(g,v))},f.ba.Ma=new f.ba,f.gc(f.ba.Ma),f.b("nativeTemplateEngine",f.ba),(function(){f.$a=function(){var V=this.Hd=(function(){if(!o||!o.tmpl)return 0;try{if(0<=o.tmpl.tag.tmpl.open.toString().indexOf("__"))return 2}catch{}return 1})();this.renderTemplateSource=function(G,v,X,Y){if(Y=Y||n,X=X||{},2>V)throw Error("Your version of jQuery.tmpl is too old. Please upgrade to jQuery.tmpl 1.0.0pre or later.");var D=G.data("precompiled");return D||(D=G.text()||"",D=o.template(null,"{{ko_with $item.koBindingContext}}"+D+"{{/ko_with}}"),G.data("precompiled",D)),G=[v.$data],v=o.extend({koBindingContext:v},X.templateOptions),v=o.tmpl(D,G,v),v.appendTo(Y.createElement("div")),o.fragments={},v},this.createJavaScriptEvaluatorBlock=function(G){return"{{ko_code ((function() { return "+G+" })()) }}"},this.addTemplate=function(G,v){n.write("<script type='text/html' id='"+G+"'>"+v+"<\/script>")},0<V&&(o.tmpl.tag.ko_code={open:"__.push($1 || '');"},o.tmpl.tag.ko_with={open:"with($1) {",close:"} "})},f.$a.prototype=new f.ca,f.$a.prototype.constructor=f.$a;var g=new f.$a;0<g.Hd&&f.gc(g),f.b("jqueryTmplTemplateEngine",f.$a)})()})})()})()})();var MOt=ko;typeof window<"u"?(ko=window.ko,typeof s5<"u"?window.ko=s5:delete window.ko):(ko=global.ko,typeof s5<"u"?global.ko=s5:delete global.ko);var UR=MOt;var adr=x(T(),1);/** +Message: `+ht.message,ht}})}return Ge=We===e,{shouldBindDescendants:Ge,bindingContextForDescendants:Ge&&qe}}function K(he,Ze){return he&&he instanceof f.fa?he:new f.fa(he,e,e,Ze)}var te=f.a.Da("_subscribable"),H=f.a.Da("_ancestorBindingInfo"),$=f.a.Da("_dataDependency");f.c={};var ee={script:!0,textarea:!0,template:!0};f.getBindingHandler=function(he){return f.c[he]};var le={};f.fa=function(he,Ze,ye,Ge,Ae){function Fe(){var ct=qe?je():je,Et=f.a.f(ct);return Ze?(f.a.extend(tt,Ze),H in Ze&&(tt[H]=Ze[H])):(tt.$parents=[],tt.$root=Et,tt.ko=f),tt[te]=We,Be?Et=tt.$data:(tt.$rawData=ct,tt.$data=Et),ye&&(tt[ye]=Et),Ge&&Ge(tt,Ze,Et),Ze&&Ze[te]&&!f.S.o().Vb(Ze[te])&&Ze[te](),Ke&&(tt[$]=Ke),tt.$data}var tt=this,Be=he===le,je=Be?e:he,qe=typeof je=="function"&&!f.O(je),We,Ke=Ae&&Ae.dataDependency;Ae&&Ae.exportDependencies?Fe():(We=f.xb(Fe),We.v(),We.ja()?We.equalityComparer=null:tt[te]=e)},f.fa.prototype.createChildContext=function(he,Ze,ye,Ge){if(!Ge&&Ze&&typeof Ze=="object"&&(Ge=Ze,Ze=Ge.as,ye=Ge.extend),Ze&&Ge&&Ge.noChildContext){var Ae=typeof he=="function"&&!f.O(he);return new f.fa(le,this,null,function(Fe){ye&&ye(Fe),Fe[Ze]=Ae?he():he},Ge)}return new f.fa(he,this,Ze,function(Fe,tt){Fe.$parentContext=tt,Fe.$parent=tt.$data,Fe.$parents=(tt.$parents||[]).slice(0),Fe.$parents.unshift(Fe.$parent),ye&&ye(Fe)},Ge)},f.fa.prototype.extend=function(he,Ze){return new f.fa(le,this,null,function(ye){f.a.extend(ye,typeof he=="function"?he(ye):he)},Ze)};var _e=f.a.g.Z();V.prototype.Tc=function(){this.Kb&&this.Kb.N&&this.Kb.N.sd(this.node)},V.prototype.sd=function(he){f.a.Pa(this.kb,he),!this.kb.length&&this.H&&this.Cc()},V.prototype.Cc=function(){this.H=!0,this.yc.N&&!this.kb.length&&(this.yc.N=null,f.a.K.yb(this.node,g),f.i.ma(this.node,f.i.pa),this.Tc())},f.i={H:"childrenComplete",pa:"descendantsComplete",subscribe:function(he,Ze,ye,Ge,Ae){var Fe=f.a.g.Ub(he,_e,{});return Fe.Fa||(Fe.Fa=new f.T),Ae&&Ae.notifyImmediately&&Fe.Zb[Ze]&&f.u.G(ye,Ge,[he]),Fe.Fa.subscribe(ye,Ge,Ze)},ma:function(he,Ze){var ye=f.a.g.get(he,_e);if(ye&&(ye.Zb[Ze]=!0,ye.Fa&&ye.Fa.notifySubscribers(he,Ze),Ze==f.i.H)){if(ye.N)ye.N.Cc();else if(ye.N===e&&ye.Fa&&ye.Fa.Wa(f.i.pa))throw Error("descendantsComplete event not supported for bindings on this node")}},Cb:function(he,Ze){var ye=f.a.g.Ub(he,_e,{});return ye.N||(ye.N=new V(he,ye,Ze[H])),Ze[H]==ye?Ze:Ze.extend(function(Ge){Ge[H]=ye})}},f.Td=function(he){return(he=f.a.g.get(he,_e))&&he.context},f.ib=function(he,Ze,ye){return he.nodeType===1&&f.h.Sc(he),z(he,Ze,K(ye))},f.ld=function(he,Ze,ye){return ye=K(ye),f.ib(he,Y(Ze,ye,he),ye)},f.Oa=function(he,Ze){Ze.nodeType!==1&&Ze.nodeType!==8||M(K(he),Ze)},f.vc=function(he,Ze,ye){if(!o&&t.jQuery&&(o=t.jQuery),2>arguments.length){if(Ze=n.body,!Ze)throw Error("ko.applyBindings: could not find document.body; has the document been loaded?")}else if(!Ze||Ze.nodeType!==1&&Ze.nodeType!==8)throw Error("ko.applyBindings: first parameter should be your view model; second parameter should be a DOM node");O(K(he,ye),Ze)},f.Dc=function(he){return!he||he.nodeType!==1&&he.nodeType!==8?e:f.Td(he)},f.Ec=function(he){return(he=f.Dc(he))?he.$data:e},f.b("bindingHandlers",f.c),f.b("bindingEvent",f.i),f.b("bindingEvent.subscribe",f.i.subscribe),f.b("bindingEvent.startPossiblyAsyncContentBinding",f.i.Cb),f.b("applyBindings",f.vc),f.b("applyBindingsToDescendants",f.Oa),f.b("applyBindingAccessorsToNode",f.ib),f.b("applyBindingsToNode",f.ld),f.b("contextFor",f.Dc),f.b("dataFor",f.Ec)})(),(function(g){function V(D,M){var O=Object.prototype.hasOwnProperty.call(X,D)?X[D]:g,w;O?O.subscribe(M):(O=X[D]=new f.T,O.subscribe(M),G(D,function(z,K){var te=!(!K||!K.synchronous);Y[D]={definition:z,Gd:te},delete X[D],w||te?O.notifySubscribers(z):f.na.zb(function(){O.notifySubscribers(z)})}),w=!0)}function G(D,M){v("getConfig",[D],function(O){O?v("loadComponent",[D,O],function(w){M(w,O)}):M(null,null)})}function v(D,M,O,w){w||(w=f.j.loaders.slice(0));var z=w.shift();if(z){var K=z[D];if(K){var te=!1;if(K.apply(z,M.concat(function(H){te?O(null):H!==null?O(H):v(D,M,O,w)}))!==g&&(te=!0,!z.suppressLoaderExceptions))throw Error("Component loaders must supply values by invoking the callback, not by returning values synchronously.")}else v(D,M,O,w)}else O(null)}var X={},Y={};f.j={get:function(D,M){var O=Object.prototype.hasOwnProperty.call(Y,D)?Y[D]:g;O?O.Gd?f.u.G(function(){M(O.definition)}):f.na.zb(function(){M(O.definition)}):V(D,M)},Bc:function(D){delete Y[D]},oc:v},f.j.loaders=[],f.b("components",f.j),f.b("components.get",f.j.get),f.b("components.clearCachedDefinition",f.j.Bc)})(),(function(){function g(O,w,z,K){function te(){--$===0&&K(H)}var H={},$=2,ee=z.template;z=z.viewModel,ee?X(w,ee,function(le){f.j.oc("loadTemplate",[O,le],function(_e){H.template=_e,te()})}):te(),z?X(w,z,function(le){f.j.oc("loadViewModel",[O,le],function(_e){H[M]=_e,te()})}):te()}function V(O,w,z){if(typeof w=="function")z(function(te){return new w(te)});else if(typeof w[M]=="function")z(w[M]);else if("instance"in w){var K=w.instance;z(function(){return K})}else"viewModel"in w?V(O,w.viewModel,z):O("Unknown viewModel value: "+w)}function G(O){switch(f.a.R(O)){case"script":return f.a.ua(O.text);case"textarea":return f.a.ua(O.value);case"template":if(v(O.content))return f.a.Ca(O.content.childNodes)}return f.a.Ca(O.childNodes)}function v(O){return t.DocumentFragment?O instanceof DocumentFragment:O&&O.nodeType===11}function X(O,w,z){typeof w.require=="string"?a||t.require?(a||t.require)([w.require],function(K){K&&typeof K=="object"&&K.Xd&&K.default&&(K=K.default),z(K)}):O("Uses require, but no AMD loader is present"):z(w)}function Y(O){return function(w){throw Error("Component '"+O+"': "+w)}}var D={};f.j.register=function(O,w){if(!w)throw Error("Invalid configuration for "+O);if(f.j.tb(O))throw Error("Component "+O+" is already registered");D[O]=w},f.j.tb=function(O){return Object.prototype.hasOwnProperty.call(D,O)},f.j.unregister=function(O){delete D[O],f.j.Bc(O)},f.j.Fc={getConfig:function(O,w){w(f.j.tb(O)?D[O]:null)},loadComponent:function(O,w,z){var K=Y(O);X(K,w,function(te){g(O,K,te,z)})},loadTemplate:function(O,w,z){if(O=Y(O),typeof w=="string")z(f.a.ua(w));else if(w instanceof Array)z(w);else if(v(w))z(f.a.la(w.childNodes));else if(w.element)if(w=w.element,t.HTMLElement?w instanceof HTMLElement:w&&w.tagName&&w.nodeType===1)z(G(w));else if(typeof w=="string"){var K=n.getElementById(w);K?z(G(K)):O("Cannot find element with ID "+w)}else O("Unknown element type: "+w);else O("Unknown template value: "+w)},loadViewModel:function(O,w,z){V(Y(O),w,z)}};var M="createViewModel";f.b("components.register",f.j.register),f.b("components.isRegistered",f.j.tb),f.b("components.unregister",f.j.unregister),f.b("components.defaultLoader",f.j.Fc),f.j.loaders.push(f.j.Fc),f.j.dd=D})(),(function(){function g(G,v){var X=G.getAttribute("params");if(X){var X=V.parseBindingsString(X,v,G,{valueAccessors:!0,bindingParams:!0}),X=f.a.Ga(X,function(M){return f.o(M,null,{l:G})}),Y=f.a.Ga(X,function(M){var O=M.v();return M.ja()?f.o({read:function(){return f.a.f(M())},write:f.Za(O)&&function(w){M()(w)},l:G}):O});return Object.prototype.hasOwnProperty.call(Y,"$raw")||(Y.$raw=X),Y}return{$raw:{}}}f.j.getComponentNameForNode=function(G){var v=f.a.R(G);if(f.j.tb(v)&&(v.indexOf("-")!=-1||""+G=="[object HTMLUnknownElement]"||8>=f.a.W&&G.tagName===v))return v},f.j.tc=function(G,v,X,Y){if(v.nodeType===1){var D=f.j.getComponentNameForNode(v);if(D){if(G=G||{},G.component)throw Error('Cannot use the "component" binding on a custom element matching a component');var M={name:D,params:g(v,X)};G.component=Y?function(){return M}:M}}return G};var V=new f.ga;9>f.a.W&&(f.j.register=(function(G){return function(v){return G.apply(this,arguments)}})(f.j.register),n.createDocumentFragment=(function(G){return function(){var v=G(),X=f.j.dd,Y;for(Y in X);return v}})(n.createDocumentFragment))})(),(function(){function g(v,X,Y){if(X=X.template,!X)throw Error("Component '"+v+"' has no template");v=f.a.Ca(X),f.h.va(Y,v)}function V(v,X,Y){var D=v.createViewModel;return D?D.call(v,X,Y):X}var G=0;f.c.component={init:function(v,X,Y,D,M){function O(){var H=w&&w.dispose;typeof H=="function"&&H.call(w),K&&K.s(),z=w=K=null}var w,z,K,te=f.a.la(f.h.childNodes(v));return f.h.Ea(v),f.a.K.za(v,O),f.o(function(){var H=f.a.f(X()),$,ee;if(typeof H=="string"?$=H:($=f.a.f(H.name),ee=f.a.f(H.params)),!$)throw Error("No component name specified");var le=f.i.Cb(v,M),_e=z=++G;f.j.get($,function(he){if(z===_e){if(O(),!he)throw Error("Unknown component '"+$+"'");g($,he,v);var Ze=V(he,ee,{element:v,templateNodes:te});he=le.createChildContext(Ze,{extend:function(ye){ye.$component=Ze,ye.$componentTemplateNodes=te}}),Ze&&Ze.koDescendantsComplete&&(K=f.i.subscribe(v,f.i.pa,Ze.koDescendantsComplete,Ze)),w=Ze,f.Oa(he,v)}})},null,{l:v}),{controlsDescendantBindings:!0}}},f.h.ea.component=!0})();var I={class:"className",for:"htmlFor"};f.c.attr={update:function(g,V){var G=f.a.f(V())||{};f.a.P(G,function(v,X){X=f.a.f(X);var Y=v.indexOf(":"),Y="lookupNamespaceURI"in g&&0<Y&&g.lookupNamespaceURI(v.substr(0,Y)),D=X===!1||X===null||X===e;D?Y?g.removeAttributeNS(Y,v):g.removeAttribute(v):X=X.toString(),8>=f.a.W&&v in I?(v=I[v],D?g.removeAttribute(v):g[v]=X):D||(Y?g.setAttributeNS(Y,v,X):g.setAttribute(v,X)),v==="name"&&f.a.Yc(g,D?"":X)})}},(function(){f.c.checked={after:["value","attr"],init:function(g,V,G){function v(){var H=g.checked,$=Y();if(!f.S.Ya()&&(H||!M&&!f.S.qa())){var ee=f.u.G(V);if(w){var le=z?ee.v():ee,_e=te;te=$,_e!==$?H&&(f.a.Na(le,$,!0),f.a.Na(le,_e,!1)):f.a.Na(le,$,H),z&&f.Za(ee)&&ee(le)}else D&&($===e?$=H:H||($=e)),f.m.eb(ee,G,"checked",$,!0)}}function X(){var H=f.a.f(V()),$=Y();w?(g.checked=0<=f.a.A(H,$),te=$):g.checked=D&&$===e?!!H:Y()===H}var Y=f.xb(function(){if(G.has("checkedValue"))return f.a.f(G.get("checkedValue"));if(K)return G.has("value")?f.a.f(G.get("value")):g.value}),D=g.type=="checkbox",M=g.type=="radio";if(D||M){var O=V(),w=D&&f.a.f(O)instanceof Array,z=!(w&&O.push&&O.splice),K=M||w,te=w?Y():e;M&&!g.name&&f.c.uniqueName.init(g,function(){return!0}),f.o(v,null,{l:g}),f.a.B(g,"click",v),f.o(X,null,{l:g}),O=e}}},f.m.wa.checked=!0,f.c.checkedValue={update:function(g,V){g.value=f.a.f(V())}}})(),f.c.class={update:function(g,V){var G=f.a.Db(f.a.f(V()));f.a.Eb(g,g.__ko__cssValue,!1),g.__ko__cssValue=G,f.a.Eb(g,G,!0)}},f.c.css={update:function(g,V){var G=f.a.f(V());G!==null&&typeof G=="object"?f.a.P(G,function(v,X){X=f.a.f(X),f.a.Eb(g,v,X)}):f.c.class.update(g,V)}},f.c.enable={update:function(g,V){var G=f.a.f(V());G&&g.disabled?g.removeAttribute("disabled"):G||g.disabled||(g.disabled=!0)}},f.c.disable={update:function(g,V){f.c.enable.update(g,function(){return!f.a.f(V())})}},f.c.event={init:function(g,V,G,v,X){var Y=V()||{};f.a.P(Y,function(D){typeof D=="string"&&f.a.B(g,D,function(M){var O,w=V()[D];if(w){try{var z=f.a.la(arguments);v=X.$data,z.unshift(v),O=w.apply(v,z)}finally{O!==!0&&(M.preventDefault?M.preventDefault():M.returnValue=!1)}G.get(D+"Bubble")===!1&&(M.cancelBubble=!0,M.stopPropagation&&M.stopPropagation())}})})}},f.c.foreach={Rc:function(g){return function(){var V=g(),G=f.a.bc(V);return!G||typeof G.length=="number"?{foreach:V,templateEngine:f.ba.Ma}:(f.a.f(V),{foreach:G.data,as:G.as,noChildContext:G.noChildContext,includeDestroyed:G.includeDestroyed,afterAdd:G.afterAdd,beforeRemove:G.beforeRemove,afterRender:G.afterRender,beforeMove:G.beforeMove,afterMove:G.afterMove,templateEngine:f.ba.Ma})}},init:function(g,V){return f.c.template.init(g,f.c.foreach.Rc(V))},update:function(g,V,G,v,X){return f.c.template.update(g,f.c.foreach.Rc(V),G,v,X)}},f.m.Ra.foreach=!1,f.h.ea.foreach=!0,f.c.hasfocus={init:function(g,V,G){function v(D){g.__ko_hasfocusUpdating=!0;var M=g.ownerDocument;if("activeElement"in M){var O;try{O=M.activeElement}catch{O=M.body}D=O===g}M=V(),f.m.eb(M,G,"hasfocus",D,!0),g.__ko_hasfocusLastValue=D,g.__ko_hasfocusUpdating=!1}var X=v.bind(null,!0),Y=v.bind(null,!1);f.a.B(g,"focus",X),f.a.B(g,"focusin",X),f.a.B(g,"blur",Y),f.a.B(g,"focusout",Y),g.__ko_hasfocusLastValue=!1},update:function(g,V){var G=!!f.a.f(V());g.__ko_hasfocusUpdating||g.__ko_hasfocusLastValue===G||(G?g.focus():g.blur(),!G&&g.__ko_hasfocusLastValue&&g.ownerDocument.body.focus(),f.u.G(f.a.Fb,null,[g,G?"focusin":"focusout"]))}},f.m.wa.hasfocus=!0,f.c.hasFocus=f.c.hasfocus,f.m.wa.hasFocus="hasfocus",f.c.html={init:function(){return{controlsDescendantBindings:!0}},update:function(g,V){f.a.fc(g,V())}},(function(){function g(V,G,v){f.c[V]={init:function(X,Y,D,M,O){var w,z,K={},te,H,$;if(G){M=D.get("as");var ee=D.get("noChildContext");$=!(M&&ee),K={as:M,noChildContext:ee,exportDependencies:$}}return H=(te=D.get("completeOn")=="render")||D.has(f.i.pa),f.o(function(){var le=f.a.f(Y()),_e=!v!=!le,he=!z,Ze;($||_e!==w)&&(H&&(O=f.i.Cb(X,O)),_e&&((!G||$)&&(K.dataDependency=f.S.o()),Ze=G?O.createChildContext(typeof le=="function"?le:Y,K):f.S.qa()?O.extend(null,K):O),he&&f.S.qa()&&(z=f.a.Ca(f.h.childNodes(X),!0)),_e?(he||f.h.va(X,f.a.Ca(z)),f.Oa(Ze,X)):(f.h.Ea(X),te||f.i.ma(X,f.i.H)),w=_e)},null,{l:X}),{controlsDescendantBindings:!0}}},f.m.Ra[V]=!1,f.h.ea[V]=!0}g("if"),g("ifnot",!1,!0),g("with",!0)})(),f.c.let={init:function(g,V,G,v,X){return V=X.extend(V),f.Oa(V,g),{controlsDescendantBindings:!0}}},f.h.ea.let=!0;var N={};f.c.options={init:function(g){if(f.a.R(g)!=="select")throw Error("options binding applies only to SELECT elements");for(;0<g.length;)g.remove(0);return{controlsDescendantBindings:!0}},update:function(g,V,G){function v(){return f.a.jb(g.options,function(ee){return ee.selected})}function X(ee,le,_e){var he=typeof le;return he=="function"?le(ee):he=="string"?ee[le]:_e}function Y(ee,le){if(H&&w)f.i.ma(g,f.i.H);else if(te.length){var _e=0<=f.a.A(te,f.w.M(le[0]));f.a.Zc(le[0],_e),H&&!_e&&f.u.G(f.a.Fb,null,[g,"change"])}}var D=g.multiple,M=g.length!=0&&D?g.scrollTop:null,O=f.a.f(V()),w=G.get("valueAllowUnset")&&G.has("value"),z=G.get("optionsIncludeDestroyed");V={};var K,te=[];w||(D?te=f.a.Mb(v(),f.w.M):0<=g.selectedIndex&&te.push(f.w.M(g.options[g.selectedIndex]))),O&&(typeof O.length>"u"&&(O=[O]),K=f.a.jb(O,function(ee){return z||ee===e||ee===null||!f.a.f(ee._destroy)}),G.has("optionsCaption")&&(O=f.a.f(G.get("optionsCaption")),O!==null&&O!==e&&K.unshift(N)));var H=!1;if(V.beforeRemove=function(ee){g.removeChild(ee)},O=Y,G.has("optionsAfterRender")&&typeof G.get("optionsAfterRender")=="function"&&(O=function(ee,le){Y(0,le),f.u.G(G.get("optionsAfterRender"),null,[le[0],ee!==N?ee:e])}),f.a.ec(g,K,function(ee,le,_e){return _e.length&&(te=!w&&_e[0].selected?[f.w.M(_e[0])]:[],H=!0),le=g.ownerDocument.createElement("option"),ee===N?(f.a.Bb(le,G.get("optionsCaption")),f.w.cb(le,e)):(_e=X(ee,G.get("optionsValue"),ee),f.w.cb(le,f.a.f(_e)),ee=X(ee,G.get("optionsText"),_e),f.a.Bb(le,ee)),[le]},V,O),!w){var $;D?$=te.length&&v().length<te.length:$=te.length&&0<=g.selectedIndex?f.w.M(g.options[g.selectedIndex])!==te[0]:te.length||0<=g.selectedIndex,$&&f.u.G(f.a.Fb,null,[g,"change"])}(w||f.S.Ya())&&f.i.ma(g,f.i.H),f.a.wd(g),M&&20<Math.abs(M-g.scrollTop)&&(g.scrollTop=M)}},f.c.options.$b=f.a.g.Z(),f.c.selectedOptions={init:function(g,V,G){function v(){var D=V(),M=[];f.a.D(g.getElementsByTagName("option"),function(O){O.selected&&M.push(f.w.M(O))}),f.m.eb(D,G,"selectedOptions",M)}function X(){var D=f.a.f(V()),M=g.scrollTop;D&&typeof D.length=="number"&&f.a.D(g.getElementsByTagName("option"),function(O){var w=0<=f.a.A(D,f.w.M(O));O.selected!=w&&f.a.Zc(O,w)}),g.scrollTop=M}if(f.a.R(g)!="select")throw Error("selectedOptions binding applies only to SELECT elements");var Y;f.i.subscribe(g,f.i.H,function(){Y?v():(f.a.B(g,"change",v),Y=f.o(X,null,{l:g}))},null,{notifyImmediately:!0})},update:function(){}},f.m.wa.selectedOptions=!0,f.c.style={update:function(g,V){var G=f.a.f(V()||{});f.a.P(G,function(v,X){if(X=f.a.f(X),(X===null||X===e||X===!1)&&(X=""),o)o(g).css(v,X);else if(/^--/.test(v))g.style.setProperty(v,X);else{v=v.replace(/-(\w)/g,function(D,M){return M.toUpperCase()});var Y=g.style[v];g.style[v]=X,X===Y||g.style[v]!=Y||isNaN(X)||(g.style[v]=X+"px")}})}},f.c.submit={init:function(g,V,G,v,X){if(typeof V()!="function")throw Error("The value for a submit binding must be a function");f.a.B(g,"submit",function(Y){var D,M=V();try{D=M.call(X.$data,g)}finally{D!==!0&&(Y.preventDefault?Y.preventDefault():Y.returnValue=!1)}})}},f.c.text={init:function(){return{controlsDescendantBindings:!0}},update:function(g,V){f.a.Bb(g,V())}},f.h.ea.text=!0,(function(){if(t&&t.navigator){var g=function(K){if(K)return parseFloat(K[1])},V=t.navigator.userAgent,G,v,X,Y,D;(G=t.opera&&t.opera.version&&parseInt(t.opera.version()))||(D=g(V.match(/Edge\/([^ ]+)$/)))||g(V.match(/Chrome\/([^ ]+)/))||(v=g(V.match(/Version\/([^ ]+) Safari/)))||(X=g(V.match(/Firefox\/([^ ]+)/)))||(Y=f.a.W||g(V.match(/MSIE ([^ ]+)/)))||(Y=g(V.match(/rv:([^ )]+)/)))}if(8<=Y&&10>Y)var M=f.a.g.Z(),O=f.a.g.Z(),w=function(K){var te=this.activeElement;(te=te&&f.a.g.get(te,O))&&te(K)},z=function(K,te){var H=K.ownerDocument;f.a.g.get(H,M)||(f.a.g.set(H,M,!0),f.a.B(H,"selectionchange",w)),f.a.g.set(K,O,te)};f.c.textInput={init:function(K,te,H){function $(Fe,tt){f.a.B(K,Fe,tt)}function ee(){var Fe=f.a.f(te());(Fe===null||Fe===e)&&(Fe=""),ye!==e&&Fe===ye?f.a.setTimeout(ee,4):K.value!==Fe&&(Ae=!0,K.value=Fe,Ae=!1,he=K.value)}function le(){Ze||(ye=K.value,Ze=f.a.setTimeout(_e,4))}function _e(){clearTimeout(Ze),ye=Ze=e;var Fe=K.value;he!==Fe&&(he=Fe,f.m.eb(te(),H,"textInput",Fe))}var he=K.value,Ze,ye,Ge=f.a.W==9?le:_e,Ae=!1;Y&&$("keypress",_e),11>Y&&$("propertychange",function(Fe){Ae||Fe.propertyName!=="value"||Ge(Fe)}),Y==8&&($("keyup",_e),$("keydown",_e)),z&&(z(K,Ge),$("dragend",le)),(!Y||9<=Y)&&$("input",Ge),5>v&&f.a.R(K)==="textarea"?($("keydown",le),$("paste",le),$("cut",le)):11>G?$("keydown",le):4>X?($("DOMAutoComplete",_e),$("dragdrop",_e),$("drop",_e)):D&&K.type==="number"&&$("keydown",le),$("change",_e),$("blur",_e),f.o(ee,null,{l:K})}},f.m.wa.textInput=!0,f.c.textinput={preprocess:function(K,te,H){H("textInput",K)}}})(),f.c.uniqueName={init:function(g,V){if(V()){var G="ko_unique_"+ ++f.c.uniqueName.rd;f.a.Yc(g,G)}}},f.c.uniqueName.rd=0,f.c.using={init:function(g,V,G,v,X){var Y;return G.has("as")&&(Y={as:G.get("as"),noChildContext:G.get("noChildContext")}),V=X.createChildContext(V,Y),f.Oa(V,g),{controlsDescendantBindings:!0}}},f.h.ea.using=!0,f.c.value={init:function(g,V,G){var v=f.a.R(g),X=v=="input";if(!X||g.type!="checkbox"&&g.type!="radio"){var Y=[],D=G.get("valueUpdate"),M=!1,O=null;D&&(typeof D=="string"?Y=[D]:Y=f.a.wc(D),f.a.Pa(Y,"change"));var w=function(){O=null,M=!1;var te=V(),H=f.w.M(g);f.m.eb(te,G,"value",H)};!f.a.W||!X||g.type!="text"||g.autocomplete=="off"||g.form&&g.form.autocomplete=="off"||f.a.A(Y,"propertychange")!=-1||(f.a.B(g,"propertychange",function(){M=!0}),f.a.B(g,"focus",function(){M=!1}),f.a.B(g,"blur",function(){M&&w()})),f.a.D(Y,function(te){var H=w;f.a.Ud(te,"after")&&(H=function(){O=f.w.M(g),f.a.setTimeout(w,0)},te=te.substring(5)),f.a.B(g,te,H)});var z;if(z=X&&g.type=="file"?function(){var te=f.a.f(V());te===null||te===e||te===""?g.value="":f.u.G(w)}:function(){var te=f.a.f(V()),H=f.w.M(g);O!==null&&te===O?f.a.setTimeout(z,0):(te!==H||H===e)&&(v==="select"?(H=G.get("valueAllowUnset"),f.w.cb(g,te,H),H||te===f.w.M(g)||f.u.G(w)):f.w.cb(g,te))},v==="select"){var K;f.i.subscribe(g,f.i.H,function(){K?G.get("valueAllowUnset")?z():w():(f.a.B(g,"change",w),K=f.o(z,null,{l:g}))},null,{notifyImmediately:!0})}else f.a.B(g,"change",w),f.o(z,null,{l:g})}else f.ib(g,{checkedValue:V})},update:function(){}},f.m.wa.value=!0,f.c.visible={update:function(g,V){var G=f.a.f(V()),v=g.style.display!="none";G&&!v?g.style.display="":!G&&v&&(g.style.display="none")}},f.c.hidden={update:function(g,V){f.c.visible.update(g,function(){return!f.a.f(V())})}},(function(g){f.c[g]={init:function(V,G,v,X,Y){return f.c.event.init.call(this,V,function(){var D={};return D[g]=G(),D},v,X,Y)}}})("click"),f.ca=function(){},f.ca.prototype.renderTemplateSource=function(){throw Error("Override renderTemplateSource")},f.ca.prototype.createJavaScriptEvaluatorBlock=function(){throw Error("Override createJavaScriptEvaluatorBlock")},f.ca.prototype.makeTemplateSource=function(g,V){if(typeof g=="string"){V=V||n;var G=V.getElementById(g);if(!G)throw Error("Cannot find template with ID "+g);return new f.C.F(G)}if(g.nodeType==1||g.nodeType==8)return new f.C.ia(g);throw Error("Unknown template type: "+g)},f.ca.prototype.renderTemplate=function(g,V,G,v){return g=this.makeTemplateSource(g,v),this.renderTemplateSource(g,V,G,v)},f.ca.prototype.isTemplateRewritten=function(g,V){return this.allowTemplateRewriting===!1?!0:this.makeTemplateSource(g,V).data("isRewritten")},f.ca.prototype.rewriteTemplate=function(g,V,G){g=this.makeTemplateSource(g,G),V=V(g.text()),g.text(V),g.data("isRewritten",!0)},f.b("templateEngine",f.ca),f.kc=(function(){function g(v,X,Y,D){v=f.m.ac(v);for(var M=f.m.Ra,O=0;O<v.length;O++){var w=v[O].key;if(Object.prototype.hasOwnProperty.call(M,w)){var z=M[w];if(typeof z=="function"){if(w=z(v[O].value))throw Error(w)}else if(!z)throw Error("This template engine does not support the '"+w+"' binding within its templates")}}return Y="ko.__tr_ambtns(function($context,$element){return(function(){return{ "+f.m.vb(v,{valueAccessors:!0})+" } })()},'"+Y.toLowerCase()+"')",D.createJavaScriptEvaluatorBlock(Y)+X}var V=/(<([a-z]+\d*)(?:\s+(?!data-bind\s*=\s*)[a-z0-9\-]+(?:=(?:\"[^\"]*\"|\'[^\']*\'|[^>]*))?)*\s+)data-bind\s*=\s*(["'])([\s\S]*?)\3/gi,G=/\x3c!--\s*ko\b\s*([\s\S]*?)\s*--\x3e/g;return{xd:function(v,X,Y){X.isTemplateRewritten(v,Y)||X.rewriteTemplate(v,function(D){return f.kc.Ld(D,X)},Y)},Ld:function(v,X){return v.replace(V,function(Y,D,M,O,w){return g(w,D,M,X)}).replace(G,function(Y,D){return g(D,"<!-- ko -->","#comment",X)})},md:function(v,X){return f.aa.Xb(function(Y,D){var M=Y.nextSibling;M&&M.nodeName.toLowerCase()===X&&f.ib(M,v,D)})}}})(),f.b("__tr_ambtns",f.kc.md),(function(){f.C={},f.C.F=function(G){if(this.F=G){var v=f.a.R(G);this.ab=v==="script"?1:v==="textarea"?2:v=="template"&&G.content&&G.content.nodeType===11?3:4}},f.C.F.prototype.text=function(){var G=this.ab===1?"text":this.ab===2?"value":"innerHTML";if(arguments.length==0)return this.F[G];var v=arguments[0];G==="innerHTML"?f.a.fc(this.F,v):this.F[G]=v};var g=f.a.g.Z()+"_";f.C.F.prototype.data=function(G){if(arguments.length===1)return f.a.g.get(this.F,g+G);f.a.g.set(this.F,g+G,arguments[1])};var V=f.a.g.Z();f.C.F.prototype.nodes=function(){var G=this.F;if(arguments.length==0){var v=f.a.g.get(G,V)||{},X=v.lb||(this.ab===3?G.content:this.ab===4?G:e);if(!X||v.jd){var Y=this.text();Y&&Y!==v.bb&&(X=f.a.Md(Y,G.ownerDocument),f.a.g.set(G,V,{lb:X,bb:Y,jd:!0}))}return X}v=arguments[0],this.ab!==e&&this.text(""),f.a.g.set(G,V,{lb:v})},f.C.ia=function(G){this.F=G},f.C.ia.prototype=new f.C.F,f.C.ia.prototype.constructor=f.C.ia,f.C.ia.prototype.text=function(){if(arguments.length==0){var G=f.a.g.get(this.F,V)||{};return G.bb===e&&G.lb&&(G.bb=G.lb.innerHTML),G.bb}f.a.g.set(this.F,V,{bb:arguments[0]})},f.b("templateSources",f.C),f.b("templateSources.domElement",f.C.F),f.b("templateSources.anonymousTemplate",f.C.ia)})(),(function(){function g(O,w,z){var K;for(w=f.h.nextSibling(w);O&&(K=O)!==w;)O=f.h.nextSibling(K),z(K,O)}function V(O,w){if(O.length){var z=O[0],K=O[O.length-1],te=z.parentNode,H=f.ga.instance,$=H.preprocessNode;if($){if(g(z,K,function(ee,le){var _e=ee.previousSibling,he=$.call(H,ee);he&&(ee===z&&(z=he[0]||le),ee===K&&(K=he[he.length-1]||_e))}),O.length=0,!z)return;z===K?O.push(z):(O.push(z,K),f.a.Ua(O,te))}g(z,K,function(ee){ee.nodeType!==1&&ee.nodeType!==8||f.vc(w,ee)}),g(z,K,function(ee){ee.nodeType!==1&&ee.nodeType!==8||f.aa.cd(ee,[w])}),f.a.Ua(O,te)}}function G(O){return O.nodeType?O:0<O.length?O[0]:null}function v(O,w,z,K,te){te=te||{};var H=(O&&G(O)||z||{}).ownerDocument,$=te.templateEngine||Y;if(f.kc.xd(z,$,H),z=$.renderTemplate(z,K,te,H),typeof z.length!="number"||0<z.length&&typeof z[0].nodeType!="number")throw Error("Template engine must return an array of DOM nodes");switch(H=!1,w){case"replaceChildren":f.h.va(O,z),H=!0;break;case"replaceNode":f.a.Xc(O,z),H=!0;break;case"ignoreTargetNode":break;default:throw Error("Unknown renderMode: "+w)}return H&&(V(z,K),te.afterRender&&f.u.G(te.afterRender,null,[z,K[te.as||"$data"]]),w=="replaceChildren"&&f.i.ma(O,f.i.H)),z}function X(O,w,z){return f.O(O)?O():typeof O=="function"?O(w,z):O}var Y;f.gc=function(O){if(O!=e&&!(O instanceof f.ca))throw Error("templateEngine must inherit from ko.templateEngine");Y=O},f.dc=function(O,w,z,K,te){if(z=z||{},(z.templateEngine||Y)==e)throw Error("Set a template engine before calling renderTemplate");if(te=te||"replaceChildren",K){var H=G(K);return f.$(function(){var ee=w&&w instanceof f.fa?w:new f.fa(w,null,null,null,{exportDependencies:!0}),$=X(O,ee.$data,ee),ee=v(K,te,$,ee,z);te=="replaceNode"&&(K=ee,H=G(K))},null,{Sa:function(){return!H||!f.a.Sb(H)},l:H&&te=="replaceNode"?H.parentNode:H})}return f.aa.Xb(function($){f.dc(O,w,z,$,"replaceNode")})},f.Qd=function(O,w,z,K,te){function H(ye,Ge){f.u.G(f.a.ec,null,[K,ye,ee,z,$,Ge]),f.i.ma(K,f.i.H)}function $(ye,Ge){V(Ge,le),z.afterRender&&z.afterRender(Ge,ye),le=null}function ee(ye,Ge){le=te.createChildContext(ye,{as:_e,noChildContext:z.noChildContext,extend:function(Fe){Fe.$index=Ge,_e&&(Fe[_e+"Index"]=Ge)}});var Ae=X(O,ye,le);return v(K,"ignoreTargetNode",Ae,le,z)}var le,_e=z.as,he=z.includeDestroyed===!1||f.options.foreachHidesDestroyed&&!z.includeDestroyed;if(he||z.beforeRemove||!f.Pc(w))return f.$(function(){var ye=f.a.f(w)||[];typeof ye.length>"u"&&(ye=[ye]),he&&(ye=f.a.jb(ye,function(Ge){return Ge===e||Ge===null||!f.a.f(Ge._destroy)})),H(ye)},null,{l:K});H(w.v());var Ze=w.subscribe(function(ye){H(w(),ye)},null,"arrayChange");return Ze.l(K),Ze};var D=f.a.g.Z(),M=f.a.g.Z();f.c.template={init:function(O,w){var z=f.a.f(w());if(typeof z=="string"||"name"in z)f.h.Ea(O);else if("nodes"in z){if(z=z.nodes||[],f.O(z))throw Error('The "nodes" option must be a plain, non-observable array.');var K=z[0]&&z[0].parentNode;K&&f.a.g.get(K,M)||(K=f.a.Yb(z),f.a.g.set(K,M,!0)),new f.C.ia(O).nodes(K)}else if(z=f.h.childNodes(O),0<z.length)K=f.a.Yb(z),new f.C.ia(O).nodes(K);else throw Error("Anonymous template defined, but no template content was provided");return{controlsDescendantBindings:!0}},update:function(O,w,z,K,te){var H=w();w=f.a.f(H),z=!0,K=null,typeof w=="string"?w={}:(H="name"in w?w.name:O,"if"in w&&(z=f.a.f(w.if)),z&&"ifnot"in w&&(z=!f.a.f(w.ifnot)),z&&!H&&(z=!1)),"foreach"in w?K=f.Qd(H,z&&w.foreach||[],w,O,te):z?(z=te,"data"in w&&(z=te.createChildContext(w.data,{as:w.as,noChildContext:w.noChildContext,exportDependencies:!0})),K=f.dc(H,z,w,O)):f.h.Ea(O),te=K,(w=f.a.g.get(O,D))&&typeof w.s=="function"&&w.s(),f.a.g.set(O,D,!te||te.ja&&!te.ja()?e:te)}},f.m.Ra.template=function(O){return O=f.m.ac(O),O.length==1&&O[0].unknown||f.m.Id(O,"name")?null:"This template engine does not support anonymous templates nested within its templates"},f.h.ea.template=!0})(),f.b("setTemplateEngine",f.gc),f.b("renderTemplate",f.dc),f.a.Kc=function(g,V,G){if(g.length&&V.length){var v,X,Y,D,M;for(v=X=0;(!G||v<G)&&(D=g[X]);++X){for(Y=0;M=V[Y];++Y)if(D.value===M.value){D.moved=M.index,M.moved=D.index,V.splice(Y,1),v=Y=0;break}v+=Y}}},f.a.Pb=(function(){function g(V,G,v,X,Y){var D=Math.min,M=Math.max,O=[],w,z=V.length,K,te=G.length,H=te-z||1,$=z+te+1,ee,le,_e;for(w=0;w<=z;w++)for(le=ee,O.push(ee=[]),_e=D(te,w+H),K=M(0,w-1);K<=_e;K++)ee[K]=K?w?V[w-1]===G[K-1]?le[K-1]:D(le[K]||$,ee[K-1]||$)+1:K+1:w+1;for(D=[],M=[],H=[],w=z,K=te;w||K;)te=O[w][K]-1,K&&te===O[w][K-1]?M.push(D[D.length]={status:v,value:G[--K],index:K}):w&&te===O[w-1][K]?H.push(D[D.length]={status:X,value:V[--w],index:w}):(--K,--w,Y.sparse||D.push({status:"retained",value:G[K]}));return f.a.Kc(H,M,!Y.dontLimitMoves&&10*z),D.reverse()}return function(V,G,v){return v=typeof v=="boolean"?{dontLimitMoves:v}:v||{},V=V||[],G=G||[],V.length<G.length?g(V,G,"added","deleted",v):g(G,V,"deleted","added",v)}})(),f.b("utils.compareArrays",f.a.Pb),(function(){function g(v,X,Y,D,M){var O=[],w=f.$(function(){var z=X(Y,M,f.a.Ua(O,v))||[];0<O.length&&(f.a.Xc(O,z),D&&f.u.G(D,null,[Y,z,M])),O.length=0,f.a.Nb(O,z)},null,{l:v,Sa:function(){return!f.a.kd(O)}});return{Y:O,$:w.ja()?w:e}}var V=f.a.g.Z(),G=f.a.g.Z();f.a.ec=function(v,X,Y,D,M,O){function w(Et){Ae={Aa:Et,pb:f.ta(le++)},$.push(Ae),H||Ge.push(Ae)}function z(Et){Ae=te[Et],le!==Ae.pb.v()&&ye.push(Ae),Ae.pb(le++),f.a.Ua(Ae.Y,v),$.push(Ae)}function K(Et,zt){if(Et)for(var ut=0,bt=zt.length;ut<bt;ut++)f.a.D(zt[ut].Y,function(ht){Et(ht,ut,zt[ut].Aa)})}X=X||[],typeof X.length>"u"&&(X=[X]),D=D||{};var te=f.a.g.get(v,V),H=!te,$=[],ee=0,le=0,_e=[],he=[],Ze=[],ye=[],Ge=[],Ae,Fe=0;if(H)f.a.D(X,w);else{if(!O||te&&te._countWaitingForRemove){var tt=f.a.Mb(te,function(Et){return Et.Aa});O=f.a.Pb(tt,X,{dontLimitMoves:D.dontLimitMoves,sparse:!0})}for(var tt=0,Be,je,qe;Be=O[tt];tt++)switch(je=Be.moved,qe=Be.index,Be.status){case"deleted":for(;ee<qe;)z(ee++);je===e&&(Ae=te[ee],Ae.$&&(Ae.$.s(),Ae.$=e),f.a.Ua(Ae.Y,v).length&&(D.beforeRemove&&($.push(Ae),Fe++,Ae.Aa===G?Ae=null:Ze.push(Ae)),Ae&&_e.push.apply(_e,Ae.Y))),ee++;break;case"added":for(;le<qe;)z(ee++);je!==e?(he.push($.length),z(je)):w(Be.value)}for(;le<X.length;)z(ee++);$._countWaitingForRemove=Fe}f.a.g.set(v,V,$),K(D.beforeMove,ye),f.a.D(_e,D.beforeRemove?f.oa:f.removeNode);var We,Ke,ct;try{ct=v.ownerDocument.activeElement}catch{}if(he.length)for(;(tt=he.shift())!=e;){for(Ae=$[tt],We=e;tt;)if((Ke=$[--tt].Y)&&Ke.length){We=Ke[Ke.length-1];break}for(X=0;ee=Ae.Y[X];We=ee,X++)f.h.Wb(v,ee,We)}for(tt=0;Ae=$[tt];tt++){for(Ae.Y||f.a.extend(Ae,g(v,Y,Ae.Aa,M,Ae.pb)),X=0;ee=Ae.Y[X];We=ee,X++)f.h.Wb(v,ee,We);!Ae.Ed&&M&&(M(Ae.Aa,Ae.Y,Ae.pb),Ae.Ed=!0,We=Ae.Y[Ae.Y.length-1])}for(ct&&v.ownerDocument.activeElement!=ct&&ct.focus(),K(D.beforeRemove,Ze),tt=0;tt<Ze.length;++tt)Ze[tt].Aa=G;K(D.afterMove,ye),K(D.afterAdd,Ge)}})(),f.b("utils.setDomNodeChildrenFromArrayMapping",f.a.ec),f.ba=function(){this.allowTemplateRewriting=!1},f.ba.prototype=new f.ca,f.ba.prototype.constructor=f.ba,f.ba.prototype.renderTemplateSource=function(g,V,G,v){return(V=!(9>f.a.W)&&g.nodes?g.nodes():null)?f.a.la(V.cloneNode(!0).childNodes):(g=g.text(),f.a.ua(g,v))},f.ba.Ma=new f.ba,f.gc(f.ba.Ma),f.b("nativeTemplateEngine",f.ba),(function(){f.$a=function(){var V=this.Hd=(function(){if(!o||!o.tmpl)return 0;try{if(0<=o.tmpl.tag.tmpl.open.toString().indexOf("__"))return 2}catch{}return 1})();this.renderTemplateSource=function(G,v,X,Y){if(Y=Y||n,X=X||{},2>V)throw Error("Your version of jQuery.tmpl is too old. Please upgrade to jQuery.tmpl 1.0.0pre or later.");var D=G.data("precompiled");return D||(D=G.text()||"",D=o.template(null,"{{ko_with $item.koBindingContext}}"+D+"{{/ko_with}}"),G.data("precompiled",D)),G=[v.$data],v=o.extend({koBindingContext:v},X.templateOptions),v=o.tmpl(D,G,v),v.appendTo(Y.createElement("div")),o.fragments={},v},this.createJavaScriptEvaluatorBlock=function(G){return"{{ko_code ((function() { return "+G+" })()) }}"},this.addTemplate=function(G,v){n.write("<script type='text/html' id='"+G+"'>"+v+"<\/script>")},0<V&&(o.tmpl.tag.ko_code={open:"__.push($1 || '');"},o.tmpl.tag.ko_with={open:"with($1) {",close:"} "})},f.$a.prototype=new f.ca,f.$a.prototype.constructor=f.$a;var g=new f.$a;0<g.Hd&&f.gc(g),f.b("jqueryTmplTemplateEngine",f.$a)})()})})()})()})();var wOt=ko;typeof window<"u"?(ko=window.ko,typeof s5<"u"?window.ko=s5:delete window.ko):(ko=global.ko,typeof s5<"u"?global.ko=s5:delete global.ko);var UR=wOt;var cdr=x(T(),1);/** * @license * Knockout ES5 plugin - https://github.com/SteveSanderson/knockout-es5 * Copyright (c) Steve Sanderson * MIT license - */var Qce="__knockoutObservables",qce="__knockoutSubscribable";function jNe(e,t){if(!e)throw new Error("When calling ko.track, you must pass an object as the first parameter.");var n=this,i=QNe(e,!0);return t=t||Object.getOwnPropertyNames(e),t.forEach(function(o){if(!(o===Qce||o===qce)&&!(o in i)){var r=e[o],s=r instanceof Array,a=n.isObservable(r)?r:s?n.observableArray(r):n.observable(r);Object.defineProperty(e,o,{configurable:!0,enumerable:!0,get:a,set:n.isWriteableObservable(a)?a:void 0}),i[o]=a,s&&kOt(n,a)}}),e}function QNe(e,t){var n=e[Qce];return!n&&t&&(n={},Object.defineProperty(e,Qce,{value:n})),n}function wOt(e,t,n){var i=this,o={owner:e,deferEvaluation:!0};if(typeof n=="function")o.read=n;else{if("value"in n)throw new Error('For ko.defineProperty, you must not specify a "value" for the property. You must provide a "get" function.');if(typeof n.get!="function")throw new Error('For ko.defineProperty, the third parameter must be either an evaluator function, or an options object containing a function called "get".');o.read=n.get,o.write=n.set}return e[t]=i.computed(o),jNe.call(i,e,[t]),e}function kOt(e,t){var n=null;e.computed(function(){n&&(n.dispose(),n=null);var i=t();i instanceof Array&&(n=UOt(e,t,i))})}function UOt(e,t,n){var i=DOt(e,n);return i.subscribe(t)}function DOt(e,t){var n=t[qce];if(!n){n=new e.subscribable,Object.defineProperty(t,qce,{value:n});var i={};OOt(t,n,i),BOt(e,t,n,i)}return n}function OOt(e,t,n){["pop","push","reverse","shift","sort","splice","unshift"].forEach(function(i){var o=e[i];e[i]=function(){var r=o.apply(this,arguments);return n.pause!==!0&&t.notifySubscribers(this),r}})}function BOt(e,t,n,i){["remove","removeAll","destroy","destroyAll","replace"].forEach(function(o){Object.defineProperty(t,o,{enumerable:!1,value:function(){var r;i.pause=!0;try{r=e.observableArray.fn[o].apply(e.observableArray(t),arguments)}finally{i.pause=!1}return n.notifySubscribers(t),r}})})}function qNe(e,t){if(!e)return null;var n=QNe(e,!1);return n&&n[t]||null}function zOt(e,t){var n=qNe(e,t);n&&n.valueHasMutated()}function HOt(e){e.track=jNe,e.getObservable=qNe,e.valueHasMutated=zOt,e.defineProperty=wOt}var a5={attachToKo:HOt};var ldr=x(T(),1),$Ne="http://www.w3.org/2000/svg",eYe="cesium-svgPath-svg",KOt={register:function(e){e.bindingHandlers.cesiumSvgPath={init:function(t,n){let i=document.createElementNS($Ne,"svg:svg");i.setAttribute("class",eYe);let o=document.createElementNS($Ne,"path");return i.appendChild(o),e.virtualElements.setDomNodeChildren(t,[i]),e.computed({read:function(){let r=e.unwrap(n());o.setAttribute("d",e.unwrap(r.path));let s=e.unwrap(r.width),a=e.unwrap(r.height);i.setAttribute("width",s),i.setAttribute("height",a),i.setAttribute("viewBox",`0 0 ${s} ${a}`),r.css&&i.setAttribute("class",`${eYe} ${e.unwrap(r.css)}`)},disposeWhenNodeIsRemoved:t}),{controlsDescendantBindings:!0}}},e.virtualElements.allowedBindings.cesiumSvgPath=!0}},c5=KOt;a5.attachToKo(UR);c5.register(UR);var Ee=UR;function l5(e){l(e)||(e=new Wf),this._clock=e,this._eventHelper=new Hr,this._eventHelper.add(e.onTick,this.synchronize,this),this.systemTime=Ee.observable(Q.now()),this.systemTime.equalityComparer=Q.equals,this.startTime=Ee.observable(e.startTime),this.startTime.equalityComparer=Q.equals,this.startTime.subscribe(function(t){e.startTime=t,this.synchronize()},this),this.stopTime=Ee.observable(e.stopTime),this.stopTime.equalityComparer=Q.equals,this.stopTime.subscribe(function(t){e.stopTime=t,this.synchronize()},this),this.currentTime=Ee.observable(e.currentTime),this.currentTime.equalityComparer=Q.equals,this.currentTime.subscribe(function(t){e.currentTime=t,this.synchronize()},this),this.multiplier=Ee.observable(e.multiplier),this.multiplier.subscribe(function(t){e.multiplier=t,this.synchronize()},this),this.clockStep=Ee.observable(e.clockStep),this.clockStep.subscribe(function(t){e.clockStep=t,this.synchronize()},this),this.clockRange=Ee.observable(e.clockRange),this.clockRange.subscribe(function(t){e.clockRange=t,this.synchronize()},this),this.canAnimate=Ee.observable(e.canAnimate),this.canAnimate.subscribe(function(t){e.canAnimate=t,this.synchronize()},this),this.shouldAnimate=Ee.observable(e.shouldAnimate),this.shouldAnimate.subscribe(function(t){e.shouldAnimate=t,this.synchronize()},this),Ee.track(this,["systemTime","startTime","stopTime","currentTime","multiplier","clockStep","clockRange","canAnimate","shouldAnimate"])}Object.defineProperties(l5.prototype,{clock:{get:function(){return this._clock}}});l5.prototype.synchronize=function(){let e=this._clock;this.systemTime=Q.now(),this.startTime=e.startTime,this.stopTime=e.stopTime,this.currentTime=e.currentTime,this.multiplier=e.multiplier,this.clockStep=e.clockStep,this.clockRange=e.clockRange,this.canAnimate=e.canAnimate,this.shouldAnimate=e.shouldAnimate};l5.prototype.isDestroyed=function(){return!1};l5.prototype.destroy=function(){this._eventHelper.removeAll(),ue(this)};var d5=l5;var _dr=x(T(),1);function JOt(){this.canExecute=void 0,this.beforeExecute=void 0,this.afterExecute=void 0,ge.throwInstantiationError()}var $ce=JOt;var Edr=x(T(),1);function jOt(e,t){t=t??!0;let n=new Se,i=new Se;function o(){let r={args:arguments,cancel:!1},s;return n.raiseEvent(r),r.cancel||(s=e.apply(null,arguments),i.raiseEvent(s)),s}return o.canExecute=t,Ee.track(o,["canExecute"]),Object.defineProperties(o,{beforeExecute:{value:n},afterExecute:{value:i}}),o}var Fn=jOt;var Wdr=x(T(),1);var wA={};wA.createCheckbox=function(e,t,n){let i=document.createElement("div"),o=document.createElement("label"),r=document.createElement("input");r.type="checkbox";let s=`checked: ${t}`;return l(n)&&(s+=`, enable: ${n}`),r.setAttribute("data-bind",s),o.appendChild(r),o.appendChild(document.createTextNode(e)),i.appendChild(o),i};wA.createSection=function(e,t,n,i){let o=document.createElement("div");o.className="cesium-cesiumInspector-section",o.setAttribute("data-bind",`css: { "cesium-cesiumInspector-section-collapsed": !${n} }`),e.appendChild(o);let r=document.createElement("h3");r.className="cesium-cesiumInspector-sectionHeader",r.appendChild(document.createTextNode(t)),r.setAttribute("data-bind",`click: ${i}`),o.appendChild(r);let s=document.createElement("div");return s.className="cesium-cesiumInspector-sectionContent",o.appendChild(s),s};wA.createRangeInput=function(e,t,n,i,o,r){r=r??t;let s=document.createElement("input");s.setAttribute("data-bind",`value: ${r}`),s.type="number";let a=document.createElement("input");a.type="range",a.min=n,a.max=i,a.step=o??"any",a.setAttribute("data-bind",`valueUpdate: "input", value: ${t}`);let c=document.createElement("div");c.appendChild(a);let d=document.createElement("div");return d.className="cesium-cesiumInspector-slider",d.appendChild(document.createTextNode(e)),d.appendChild(s),d.appendChild(c),d};wA.createRangeInputWithDynamicMinMax=function(e,t,n,i){i=i??t;let o=document.createElement("input");o.setAttribute("data-bind",`value: ${i}`),o.type="number";let r=document.createElement("input");r.type="range",r.step=n??"any",r.setAttribute("data-bind",`valueUpdate: "input", value: ${t}, attr: { min: ${t}Min, max: ${t}Max }`);let s=document.createElement("div");s.appendChild(r);let a=document.createElement("div");return a.className="cesium-cesiumInspector-slider",a.appendChild(document.createTextNode(e)),a.appendChild(o),a.appendChild(s),a};wA.createButton=function(e,t,n){let i=document.createElement("button");i.type="button",i.textContent=e,i.className="cesium-cesiumInspector-pickButton";let o=`click: ${t}`;return l(n)&&(o+=`, css: {"cesium-cesiumInspector-pickButtonHighlight" : ${n}}`),i.setAttribute("data-bind",o),i};var fu=wA;var Idr=x(T(),1);function QOt(e,t,n,i,o){return n.call(i,e[t]),Ee.getObservable(e,t).subscribe(n,i,o)}var Sc=QOt;var wdr=x(T(),1);function tYe(e,t){this._command=e,t=t??B.EMPTY_OBJECT,this.toggled=t.toggled??!1,this.tooltip=t.tooltip??"",Ee.track(this,["toggled","tooltip"])}Object.defineProperties(tYe.prototype,{command:{get:function(){return this._command}}});var kT=tYe;var Bdr=x(T(),1);var Al="http://www.w3.org/2000/svg",rYe="http://www.w3.org/1999/xlink",FJ,u5=U.fromCssColorString("rgba(247,250,255,0.384)"),IJ=U.fromCssColorString("rgba(143,191,255,0.216)"),ele=U.fromCssColorString("rgba(153,197,255,0.098)"),PJ=U.fromCssColorString("rgba(255,255,255,0.086)"),qOt=U.fromCssColorString("rgba(255,255,255,0.267)"),$Ot=U.fromCssColorString("rgba(255,255,255,0)"),nYe=U.fromCssColorString("rgba(66,67,68,0.3)"),iYe=U.fromCssColorString("rgba(0,0,0,0.5)");function UT(e){return U.fromCssColorString(window.getComputedStyle(e).getPropertyValue("color"))}var m5={animation_pathReset:{tagName:"path",transform:"translate(16,16) scale(0.85) translate(-16,-16)",d:"M24.316,5.318,9.833,13.682,9.833,5.5,5.5,5.5,5.5,25.5,9.833,25.5,9.833,17.318,24.316,25.682z"},animation_pathPause:{tagName:"path",transform:"translate(16,16) scale(0.85) translate(-16,-16)",d:"M13,5.5,7.5,5.5,7.5,25.5,13,25.5zM24.5,5.5,19,5.5,19,25.5,24.5,25.5z"},animation_pathPlay:{tagName:"path",transform:"translate(16,16) scale(0.85) translate(-16,-16)",d:"M6.684,25.682L24.316,15.5L6.684,5.318V25.682z"},animation_pathPlayReverse:{tagName:"path",transform:"translate(16,16) scale(-0.85,0.85) translate(-16,-16)",d:"M6.684,25.682L24.316,15.5L6.684,5.318V25.682z"},animation_pathLoop:{tagName:"path",transform:"translate(16,16) scale(0.85) translate(-16,-16)",d:"M24.249,15.499c-0.009,4.832-3.918,8.741-8.75,8.75c-2.515,0-4.768-1.064-6.365-2.763l2.068-1.442l-7.901-3.703l0.744,8.694l2.193-1.529c2.244,2.594,5.562,4.242,9.26,4.242c6.767,0,12.249-5.482,12.249-12.249H24.249zM15.499,6.75c2.516,0,4.769,1.065,6.367,2.764l-2.068,1.443l7.901,3.701l-0.746-8.693l-2.192,1.529c-2.245-2.594-5.562-4.245-9.262-4.245C8.734,3.25,3.25,8.734,3.249,15.499H6.75C6.758,10.668,10.668,6.758,15.499,6.75z"},animation_pathClock:{tagName:"path",transform:"translate(16,16) scale(0.85) translate(-16,-15.5)",d:"M15.5,2.374C8.251,2.375,2.376,8.251,2.374,15.5C2.376,22.748,8.251,28.623,15.5,28.627c7.249-0.004,13.124-5.879,13.125-13.127C28.624,8.251,22.749,2.375,15.5,2.374zM15.5,25.623C9.909,25.615,5.385,21.09,5.375,15.5C5.385,9.909,9.909,5.384,15.5,5.374c5.59,0.01,10.115,4.535,10.124,10.125C25.615,21.09,21.091,25.615,15.5,25.623zM8.625,15.5c-0.001-0.552-0.448-0.999-1.001-1c-0.553,0-1,0.448-1,1c0,0.553,0.449,1,1,1C8.176,16.5,8.624,16.053,8.625,15.5zM8.179,18.572c-0.478,0.277-0.642,0.889-0.365,1.367c0.275,0.479,0.889,0.641,1.365,0.365c0.479-0.275,0.643-0.887,0.367-1.367C9.27,18.461,8.658,18.297,8.179,18.572zM9.18,10.696c-0.479-0.276-1.09-0.112-1.366,0.366s-0.111,1.09,0.365,1.366c0.479,0.276,1.09,0.113,1.367-0.366C9.821,11.584,9.657,10.973,9.18,10.696zM22.822,12.428c0.478-0.275,0.643-0.888,0.366-1.366c-0.275-0.478-0.89-0.642-1.366-0.366c-0.479,0.278-0.642,0.89-0.366,1.367C21.732,12.54,22.344,12.705,22.822,12.428zM12.062,21.455c-0.478-0.275-1.089-0.111-1.366,0.367c-0.275,0.479-0.111,1.09,0.366,1.365c0.478,0.277,1.091,0.111,1.365-0.365C12.704,22.344,12.54,21.732,12.062,21.455zM12.062,9.545c0.479-0.276,0.642-0.888,0.366-1.366c-0.276-0.478-0.888-0.642-1.366-0.366s-0.642,0.888-0.366,1.366C10.973,9.658,11.584,9.822,12.062,9.545zM22.823,18.572c-0.48-0.275-1.092-0.111-1.367,0.365c-0.275,0.479-0.112,1.092,0.367,1.367c0.477,0.275,1.089,0.113,1.365-0.365C23.464,19.461,23.3,18.848,22.823,18.572zM19.938,7.813c-0.477-0.276-1.091-0.111-1.365,0.366c-0.275,0.48-0.111,1.091,0.366,1.367s1.089,0.112,1.366-0.366C20.581,8.702,20.418,8.089,19.938,7.813zM23.378,14.5c-0.554,0.002-1.001,0.45-1.001,1c0.001,0.552,0.448,1,1.001,1c0.551,0,1-0.447,1-1C24.378,14.949,23.929,14.5,23.378,14.5zM15.501,6.624c-0.552,0-1,0.448-1,1l-0.466,7.343l-3.004,1.96c-0.478,0.277-0.642,0.889-0.365,1.365c0.275,0.479,0.889,0.643,1.365,0.367l3.305-1.676C15.39,16.99,15.444,17,15.501,17c0.828,0,1.5-0.671,1.5-1.5l-0.5-7.876C16.501,7.072,16.053,6.624,15.501,6.624zM15.501,22.377c-0.552,0-1,0.447-1,1s0.448,1,1,1s1-0.447,1-1S16.053,22.377,15.501,22.377zM18.939,21.455c-0.479,0.277-0.643,0.889-0.366,1.367c0.275,0.477,0.888,0.643,1.366,0.365c0.478-0.275,0.642-0.889,0.366-1.365C20.028,21.344,19.417,21.18,18.939,21.455z"},animation_pathWingButton:{tagName:"path",d:"m 4.5,0.5 c -2.216,0 -4,1.784 -4,4 l 0,24 c 0,2.216 1.784,4 4,4 l 13.71875,0 C 22.478584,27.272785 27.273681,22.511272 32.5,18.25 l 0,-13.75 c 0,-2.216 -1.784,-4 -4,-4 l -24,0 z"},animation_pathPointer:{tagName:"path",d:"M-15,-65,-15,-55,15,-55,15,-65,0,-95z"},animation_pathSwooshFX:{tagName:"path",d:"m 85,0 c 0,16.617 -4.813944,35.356 -13.131081,48.4508 h 6.099803 c 8.317138,-13.0948 13.13322,-28.5955 13.13322,-45.2124 0,-46.94483 -38.402714,-85.00262 -85.7743869,-85.00262 -1.0218522,0 -2.0373001,0.0241 -3.0506131,0.0589 45.958443,1.59437 82.723058,35.77285 82.723058,81.70532 z"}};function fp(e){let t=document.createElementNS(Al,e.tagName);for(let n in e)if(e.hasOwnProperty(n)&&n!=="tagName")if(n==="children"){let i=e.children.length;for(let o=0;o<i;++o)t.appendChild(fp(e.children[o]))}else n.indexOf("xlink:")===0?t.setAttributeNS(rYe,n.substring(6),e[n]):n==="textContent"?t.textContent=e[n]:t.setAttribute(n,e[n]);return t}function nle(e,t,n){let i=document.createElementNS(Al,"text");i.setAttribute("x",e),i.setAttribute("y",t),i.setAttribute("class","cesium-animation-svgText");let o=document.createElementNS(Al,"tspan");return o.textContent=n,i.appendChild(o),i}function eBt(e,t){let n=nle(e,t,"");n.removeChild(n.firstChild);let i={},o=[],r=["month","day","year"];for(let a=0;a<r.length;++a){if(a>0){let u=document.createElementNS(Al,"tspan");u.textContent=" ",o.push(u),n.appendChild(u)}let c=r[a],d=document.createElementNS(Al,"tspan");d.setAttribute("class",`cesium-animation-dateField cesium-animation-dateField-${c}`),d.setAttribute("aria-label",`Adjust ${c} with mouse wheel`),i[c]=d,n.appendChild(d)}let s=document.createElementNS(Al,"tspan");return n.appendChild(s),{element:n,fallback:s,parts:i,separators:o}}function tBt(e,t){let n=/^(\S+)\s+(\d{1,2})\s+(\d{1,4})$/.exec(t),i=e.parts,o=e.separators;if(n===null){i.month.textContent="",i.day.textContent="",i.year.textContent="",o[0].textContent="",o[1].textContent="",e.fallback.textContent=t;return}i.month.textContent=n[1],i.day.textContent=n[2],i.year.textContent=n[3],o[0].textContent=" ",o[1].textContent=" ",e.fallback.textContent=""}function nBt(e,t){let n=nle(e,t,"");n.removeChild(n.firstChild);let i={},o=[],r=["hour","minute","second"];for(let u=0;u<r.length;++u){if(u>0){let b=document.createElementNS(Al,"tspan");b.textContent=":",o.push(b),n.appendChild(b)}let m=r[u],p=document.createElementNS(Al,"tspan");p.setAttribute("class",`cesium-animation-timeField cesium-animation-timeField-${m}`),p.setAttribute("aria-label",`Adjust ${m} with mouse wheel`),i[m]=p,n.appendChild(p)}let s=document.createElementNS(Al,"tspan");n.appendChild(s);let a=document.createElementNS(Al,"tspan");a.setAttribute("class","cesium-animation-timeField cesium-animation-timeField-millisecond"),a.setAttribute("aria-label","Adjust millisecond with mouse wheel"),i.millisecond=a,n.appendChild(a);let c=document.createElementNS(Al,"tspan");n.appendChild(c);let d=document.createElementNS(Al,"tspan");return n.appendChild(d),{decimalPoint:s,element:n,fallback:d,parts:i,separators:o,suffix:c}}function iBt(e,t){let n=/^(\d{2}):(\d{2}):(\d{2})(?:\.(\d{3})| UTC)$/.exec(t),i=e.parts,o=e.separators;if(n===null){i.hour.textContent="",i.minute.textContent="",i.second.textContent="",i.millisecond.textContent="",o[0].textContent="",o[1].textContent="",e.decimalPoint.textContent="",e.suffix.textContent="",e.fallback.textContent=t;return}i.hour.textContent=n[1],i.minute.textContent=n[2],i.second.textContent=n[3],o[0].textContent=":",o[1].textContent=":",e.decimalPoint.textContent=l(n[4])?".":"",i.millisecond.textContent=n[4]??"",e.suffix.textContent=l(n[4])?"":" UTC",e.fallback.textContent=""}function oYe(e,t,n){let i=Object.keys(t);for(let o=0;o<i.length;++o){let r=i[o],s=t[r],a=function(c){c.deltaY!==0&&(n(r,c.deltaY<0?1:-1),c.preventDefault(),c.stopPropagation())};s.addEventListener("wheel",a,!1),e._fieldWheelListeners.push({element:s,listener:a})}}function oBt(e,t,n){e.setAttribute("transform",`translate(100,100) rotate(${n})`),t.setAttribute("transform",`rotate(${n})`)}var XJ=new U;function zs(e,t){let n=t.alpha,i=1-n;return XJ.red=e.red*i+t.red*n,XJ.green=e.green*i+t.green*n,XJ.blue=e.blue*i+t.blue*n,XJ.toCssColorString()}function tle(e,t,n){let i=m5[n],o={tagName:"g",class:"cesium-animation-rectButton",transform:`translate(${e},${t})`,children:[{tagName:"rect",class:"cesium-animation-buttonGlow",width:32,height:32,rx:2,ry:2},{tagName:"rect",class:"cesium-animation-buttonMain",width:32,height:32,rx:4,ry:4},{class:"cesium-animation-buttonPath",id:n,tagName:i.tagName,transform:i.transform,d:i.d},{tagName:"title",textContent:""}]};return fp(o)}function rBt(e,t,n){let i=m5[n],o=m5.animation_pathWingButton,r={tagName:"g",class:"cesium-animation-rectButton",transform:`translate(${e},${t})`,children:[{class:"cesium-animation-buttonGlow",id:"animation_pathWingButton",tagName:o.tagName,d:o.d},{class:"cesium-animation-buttonMain",id:"animation_pathWingButton",tagName:o.tagName,d:o.d},{class:"cesium-animation-buttonPath",id:n,tagName:i.tagName,transform:i.transform,d:i.d},{tagName:"title",textContent:""}]};return fp(r)}function sBt(e,t){let n=e._viewModel,i=n.shuttleRingDragging;if(!(i&&FJ!==e))if(t.type==="mousedown"||i&&t.type==="mousemove"||t.type==="touchstart"&&t.touches.length===1||i&&t.type==="touchmove"&&t.touches.length===1){let o=e._centerX,r=e._centerY,a=e._svgNode.getBoundingClientRect(),c,d;if(t.type==="touchstart"||t.type==="touchmove"?(c=t.touches[0].clientX,d=t.touches[0].clientY):(c=t.clientX,d=t.clientY),!i&&(c>a.right||c<a.left||d<a.top||d>a.bottom))return;let u=e._shuttleRingPointer.getBoundingClientRect(),m=c-o-a.left,p=d-r-a.top,b=Math.atan2(p,m)*180/Math.PI+90;b>180&&(b-=360);let f=n.shuttleRingAngle;i||c<u.right&&c>u.left&&d>u.top&&d<u.bottom?(FJ=e,n.shuttleRingDragging=!0,n.shuttleRingAngle=b):b<f?n.slower():b>f&&n.faster(),t.preventDefault()}else e===FJ&&(FJ=void 0),n.shuttleRingDragging=!1}function xy(e,t){this._viewModel=t,this.svgElement=e,this._enabled=void 0,this._toggled=void 0;let n=this;this._clickFunction=function(){let i=n._viewModel.command;i.canExecute&&i()},e.addEventListener("click",this._clickFunction,!0),this._subscriptions=[Sc(t,"toggled",this.setToggled,this),Sc(t,"tooltip",this.setTooltip,this),Sc(t.command,"canExecute",this.setEnabled,this)]}xy.prototype.destroy=function(){this.svgElement.removeEventListener("click",this._clickFunction,!0);let e=this._subscriptions;for(let t=0,n=e.length;t<n;t++)e[t].dispose();ue(this)};xy.prototype.isDestroyed=function(){return!1};xy.prototype.setEnabled=function(e){if(this._enabled!==e){if(this._enabled=e,!e){this.svgElement.setAttribute("class","cesium-animation-buttonDisabled");return}if(this._toggled){this.svgElement.setAttribute("class","cesium-animation-rectButton cesium-animation-buttonToggled");return}this.svgElement.setAttribute("class","cesium-animation-rectButton")}};xy.prototype.setToggled=function(e){this._toggled!==e&&(this._toggled=e,this._enabled&&(e?this.svgElement.setAttribute("class","cesium-animation-rectButton cesium-animation-buttonToggled"):this.svgElement.setAttribute("class","cesium-animation-rectButton")))};xy.prototype.setTooltip=function(e){this.svgElement.getElementsByTagName("title")[0].textContent=e};function kA(e,t){e=Nn(e),this._viewModel=t,this._container=e,this._centerX=0,this._centerY=0,this._defsElement=void 0,this._svgNode=void 0,this._topG=void 0,this._lastHeight=void 0,this._lastWidth=void 0;let n=e.ownerDocument,i=document.createElement("style");i.textContent=".cesium-animation-rectButton .cesium-animation-buttonGlow { filter: url(#animation_blurred); }.cesium-animation-rectButton .cesium-animation-buttonMain { fill: url(#animation_buttonNormal); }.cesium-animation-buttonToggled .cesium-animation-buttonMain { fill: url(#animation_buttonToggled); }.cesium-animation-rectButton:hover .cesium-animation-buttonMain { fill: url(#animation_buttonHovered); }.cesium-animation-buttonDisabled .cesium-animation-buttonMain { fill: url(#animation_buttonDisabled); }.cesium-animation-shuttleRingG .cesium-animation-shuttleRingSwoosh { fill: url(#animation_shuttleRingSwooshGradient); }.cesium-animation-shuttleRingG:hover .cesium-animation-shuttleRingSwoosh { fill: url(#animation_shuttleRingSwooshHovered); }.cesium-animation-shuttleRingPointer { fill: url(#animation_shuttleRingPointerGradient); }.cesium-animation-shuttleRingPausePointer { fill: url(#animation_shuttleRingPointerPaused); }.cesium-animation-knobOuter { fill: url(#animation_knobOuter); }.cesium-animation-knobInner { fill: url(#animation_knobInner); }",n.head.insertBefore(i,n.head.childNodes[0]);let o=document.createElement("div");o.className="cesium-animation-theme",o.innerHTML='<div class="cesium-animation-themeNormal"></div><div class="cesium-animation-themeHover"></div><div class="cesium-animation-themeSelect"></div><div class="cesium-animation-themeDisabled"></div><div class="cesium-animation-themeKnob"></div><div class="cesium-animation-themePointer"></div><div class="cesium-animation-themeSwoosh"></div><div class="cesium-animation-themeSwooshHover"></div>',this._theme=o,this._themeNormal=o.childNodes[0],this._themeHover=o.childNodes[1],this._themeSelect=o.childNodes[2],this._themeDisabled=o.childNodes[3],this._themeKnob=o.childNodes[4],this._themePointer=o.childNodes[5],this._themeSwoosh=o.childNodes[6],this._themeSwooshHover=o.childNodes[7];let r=document.createElementNS(Al,"svg:svg");this._svgNode=r,r.setAttributeNS("http://www.w3.org/2000/xmlns/","xmlns:xlink",rYe);let s=document.createElementNS(Al,"g");this._topG=s,this._realtimeSVG=new xy(rBt(3,4,"animation_pathClock"),t.playRealtimeViewModel),this._playReverseSVG=new xy(tle(44,99,"animation_pathPlayReverse"),t.playReverseViewModel),this._playForwardSVG=new xy(tle(124,99,"animation_pathPlay"),t.playForwardViewModel),this._pauseSVG=new xy(tle(84,99,"animation_pathPause"),t.pauseViewModel);let a=document.createElementNS(Al,"g");a.appendChild(this._realtimeSVG.svgElement),a.appendChild(this._playReverseSVG.svgElement),a.appendChild(this._playForwardSVG.svgElement),a.appendChild(this._pauseSVG.svgElement);let c=fp({tagName:"circle",class:"cesium-animation-shuttleRingBack",cx:100,cy:100,r:99});this._shuttleRingBackPanel=c;let d=m5.animation_pathSwooshFX,u=m5.animation_pathPointer,m=fp({tagName:"g",class:"cesium-animation-shuttleRingSwoosh",children:[{tagName:d.tagName,transform:"translate(100,97) scale(-1,1)",id:"animation_pathSwooshFX",d:d.d},{tagName:d.tagName,transform:"translate(100,97)",id:"animation_pathSwooshFX",d:d.d},{tagName:"line",x1:100,y1:8,x2:100,y2:22}]});this._shuttleRingSwooshG=m,this._shuttleRingPointer=fp({class:"cesium-animation-shuttleRingPointer",id:"animation_pathPointer",tagName:u.tagName,d:u.d});let p=fp({tagName:"g",transform:"translate(100,100)"});this._knobOuter=fp({tagName:"circle",class:"cesium-animation-knobOuter",cx:0,cy:0,r:71});let b=61,f=fp({tagName:"circle",class:"cesium-animation-knobInner",cx:0,cy:0,r:b}),y=eBt(0,-24);this._knobDate=y.element;let _=nBt(0,-7);this._knobTime=_.element,this._knobStatus=nle(0,-41,"");let S=fp({tagName:"circle",class:"cesium-animation-blank",cx:0,cy:0,r:b}),Z=document.createElementNS(Al,"g");Z.setAttribute("class","cesium-animation-shuttleRingG"),e.appendChild(o),s.appendChild(Z),s.appendChild(p),s.appendChild(a),Z.appendChild(c),Z.appendChild(m),Z.appendChild(this._shuttleRingPointer),p.appendChild(this._knobOuter),p.appendChild(f),p.appendChild(this._knobStatus),p.appendChild(S),p.appendChild(this._knobDate),p.appendChild(this._knobTime),r.appendChild(s),e.appendChild(r);let R=this;function C(L){sBt(R,L)}this._mouseCallback=C,c.addEventListener("mousedown",C,!0),c.addEventListener("touchstart",C,!0),m.addEventListener("mousedown",C,!0),m.addEventListener("touchstart",C,!0),n.addEventListener("mousemove",C,!0),n.addEventListener("touchmove",C,!0),n.addEventListener("mouseup",C,!0),n.addEventListener("touchend",C,!0),n.addEventListener("touchcancel",C,!0),this._shuttleRingPointer.addEventListener("mousedown",C,!0),this._shuttleRingPointer.addEventListener("touchstart",C,!0),this._knobOuter.addEventListener("mousedown",C,!0),this._knobOuter.addEventListener("touchstart",C,!0);let E=this._knobStatus.childNodes[0];this._fieldWheelListeners=[],oYe(this,y.parts,function(L,F){t.adjustDate(L,F)}),oYe(this,_.parts,function(L,F){t.adjustTime(L,F)});let A;this._subscriptions=[Sc(t.pauseViewModel,"toggled",function(L){A!==L&&(A=L,A?R._shuttleRingPointer.setAttribute("class","cesium-animation-shuttleRingPausePointer"):R._shuttleRingPointer.setAttribute("class","cesium-animation-shuttleRingPointer"))}),Sc(t,"shuttleRingAngle",function(L){oBt(R._shuttleRingPointer,R._knobOuter,L)}),Sc(t,"dateLabel",function(L){R._knobDate.textContent!==L&&tBt(y,L)}),Sc(t,"timeLabel",function(L){R._knobTime.textContent!==L&&iBt(_,L)}),Sc(t,"multiplierLabel",function(L){E.textContent!==L&&(E.textContent=L)})],this.applyThemeChanges(),this.resize()}Object.defineProperties(kA.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}}});kA.prototype.isDestroyed=function(){return!1};kA.prototype.destroy=function(){l(this._observer)&&(this._observer.disconnect(),this._observer=void 0);let e=this._container.ownerDocument,t=this._mouseCallback;this._shuttleRingBackPanel.removeEventListener("mousedown",t,!0),this._shuttleRingBackPanel.removeEventListener("touchstart",t,!0),this._shuttleRingSwooshG.removeEventListener("mousedown",t,!0),this._shuttleRingSwooshG.removeEventListener("touchstart",t,!0),e.removeEventListener("mousemove",t,!0),e.removeEventListener("touchmove",t,!0),e.removeEventListener("mouseup",t,!0),e.removeEventListener("touchend",t,!0),e.removeEventListener("touchcancel",t,!0),this._shuttleRingPointer.removeEventListener("mousedown",t,!0),this._shuttleRingPointer.removeEventListener("touchstart",t,!0),this._knobOuter.removeEventListener("mousedown",t,!0),this._knobOuter.removeEventListener("touchstart",t,!0);let n=this._fieldWheelListeners;for(let o=0;o<n.length;++o){let r=n[o];r.element.removeEventListener("wheel",r.listener,!1)}this._container.removeChild(this._svgNode),this._container.removeChild(this._theme),this._realtimeSVG.destroy(),this._playReverseSVG.destroy(),this._playForwardSVG.destroy(),this._pauseSVG.destroy();let i=this._subscriptions;for(let o=0,r=i.length;o<r;o++)i[o].dispose();return ue(this)};kA.prototype.resize=function(){let e=this._container.clientWidth,t=this._container.clientHeight;if(e===this._lastWidth&&t===this._lastHeight)return;let n=this._svgNode,i=200,o=132,r=e,s=t;e===0&&t===0?(r=i,s=o):e===0?(s=t,r=i*(t/o)):t===0&&(r=e,s=o*(e/i));let a=r/i,c=s/o;n.style.cssText=`width: ${r}px; height: ${s}px; position: absolute; bottom: 0; left: 0; overflow: hidden;`,n.setAttribute("width",r),n.setAttribute("height",s),n.setAttribute("viewBox",`0 0 ${r} ${s}`),this._topG.setAttribute("transform",`scale(${a},${c})`),this._centerX=Math.max(1,100*a),this._centerY=Math.max(1,100*c),this._lastHeight=e,this._lastWidth=t};kA.prototype.applyThemeChanges=function(){let e=this._container.ownerDocument;if(!e.body.contains(this._container)){if(l(this._observer))return;let u=this;u._observer=new MutationObserver(function(){e.body.contains(u._container)&&(u._observer.disconnect(),u._observer=void 0,u.applyThemeChanges())}),u._observer.observe(e,{childList:!0,subtree:!0});return}let t=UT(this._themeNormal),n=UT(this._themeHover),i=UT(this._themeSelect),o=UT(this._themeDisabled),r=UT(this._themeKnob),s=UT(this._themePointer),a=UT(this._themeSwoosh),c=UT(this._themeSwooshHover),d=fp({tagName:"defs",children:[{id:"animation_buttonNormal",tagName:"linearGradient",x1:"50%",y1:"0%",x2:"50%",y2:"100%",children:[{tagName:"stop",offset:"0%","stop-color":zs(t,u5)},{tagName:"stop",offset:"12%","stop-color":zs(t,IJ)},{tagName:"stop",offset:"46%","stop-color":zs(t,ele)},{tagName:"stop",offset:"81%","stop-color":zs(t,PJ)}]},{id:"animation_buttonHovered",tagName:"linearGradient",x1:"50%",y1:"0%",x2:"50%",y2:"100%",children:[{tagName:"stop",offset:"0%","stop-color":zs(n,u5)},{tagName:"stop",offset:"12%","stop-color":zs(n,IJ)},{tagName:"stop",offset:"46%","stop-color":zs(n,ele)},{tagName:"stop",offset:"81%","stop-color":zs(n,PJ)}]},{id:"animation_buttonToggled",tagName:"linearGradient",x1:"50%",y1:"0%",x2:"50%",y2:"100%",children:[{tagName:"stop",offset:"0%","stop-color":zs(i,u5)},{tagName:"stop",offset:"12%","stop-color":zs(i,IJ)},{tagName:"stop",offset:"46%","stop-color":zs(i,ele)},{tagName:"stop",offset:"81%","stop-color":zs(i,PJ)}]},{id:"animation_buttonDisabled",tagName:"linearGradient",x1:"50%",y1:"0%",x2:"50%",y2:"100%",children:[{tagName:"stop",offset:"0%","stop-color":zs(o,qOt)},{tagName:"stop",offset:"75%","stop-color":zs(o,$Ot)}]},{id:"animation_blurred",tagName:"filter",width:"200%",height:"200%",x:"-50%",y:"-50%",children:[{tagName:"feGaussianBlur",stdDeviation:4,in:"SourceGraphic"}]},{id:"animation_shuttleRingSwooshGradient",tagName:"linearGradient",x1:"50%",y1:"0%",x2:"50%",y2:"100%",children:[{tagName:"stop",offset:"0%","stop-opacity":.2,"stop-color":a.toCssColorString()},{tagName:"stop",offset:"85%","stop-opacity":.85,"stop-color":a.toCssColorString()},{tagName:"stop",offset:"95%","stop-opacity":.05,"stop-color":a.toCssColorString()}]},{id:"animation_shuttleRingSwooshHovered",tagName:"linearGradient",x1:"50%",y1:"0%",x2:"50%",y2:"100%",children:[{tagName:"stop",offset:"0%","stop-opacity":.2,"stop-color":c.toCssColorString()},{tagName:"stop",offset:"85%","stop-opacity":.85,"stop-color":c.toCssColorString()},{tagName:"stop",offset:"95%","stop-opacity":.05,"stop-color":c.toCssColorString()}]},{id:"animation_shuttleRingPointerGradient",tagName:"linearGradient",x1:"0%",y1:"50%",x2:"100%",y2:"50%",children:[{tagName:"stop",offset:"0%","stop-color":s.toCssColorString()},{tagName:"stop",offset:"40%","stop-color":s.toCssColorString()},{tagName:"stop",offset:"60%","stop-color":zs(s,iYe)},{tagName:"stop",offset:"100%","stop-color":zs(s,iYe)}]},{id:"animation_shuttleRingPointerPaused",tagName:"linearGradient",x1:"0%",y1:"50%",x2:"100%",y2:"50%",children:[{tagName:"stop",offset:"0%","stop-color":"#CCC"},{tagName:"stop",offset:"40%","stop-color":"#CCC"},{tagName:"stop",offset:"60%","stop-color":"#555"},{tagName:"stop",offset:"100%","stop-color":"#555"}]},{id:"animation_knobOuter",tagName:"linearGradient",x1:"20%",y1:"0%",x2:"90%",y2:"100%",children:[{tagName:"stop",offset:"5%","stop-color":zs(r,u5)},{tagName:"stop",offset:"60%","stop-color":zs(r,nYe)},{tagName:"stop",offset:"85%","stop-color":zs(r,IJ)}]},{id:"animation_knobInner",tagName:"linearGradient",x1:"20%",y1:"0%",x2:"90%",y2:"100%",children:[{tagName:"stop",offset:"5%","stop-color":zs(r,nYe)},{tagName:"stop",offset:"60%","stop-color":zs(r,u5)},{tagName:"stop",offset:"85%","stop-color":zs(r,PJ)}]}]});l(this._defsElement)?this._svgNode.replaceChild(d,this._defsElement):this._svgNode.appendChild(d),this._defsElement=d};var h5=kA;var $dr=x(T(),1);var aBt=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],DT=15,UA=105,cBt=[31,28,31,30,31,30,31,31,30,31,30,31];function lBt(e,t){return t===2&&Pl(e)?29:cBt[t-1]}function sYe(e,t,n){return Q.fromGregorianDate(new vh(t,n,Math.min(e.day,lBt(t,n)),e.hour,e.minute,e.second,e.millisecond,e.isLeapSecond))}function aYe(e,t){return e-t}function ile(e,t){let n=Eo(t,e,aYe);return n<0?~n:n}function dBt(e,t){if(Math.abs(e)<=DT)return e/DT;let n=DT,i=UA,o,r=0,s;return e>0?(o=Math.log(t[t.length-1]),s=(o-r)/(i-n),Math.exp(r+s*(e-n))):(o=Math.log(-t[0]),s=(o-r)/(i-n),-Math.exp(r+s*(Math.abs(e)-n)))}function uBt(e,t,n){if(n.clockStep===Oo.SYSTEM_CLOCK)return DT;if(Math.abs(e)<=1)return e*DT;let i=t[t.length-1];e>i?e=i:e<-i&&(e=-i);let o=DT,r=UA,s,a=0,c;return e>0?(s=Math.log(i),c=(s-a)/(r-o),(Math.log(e)-a)/c+o):(s=Math.log(-t[0]),c=(s-a)/(r-o),-((Math.log(Math.abs(e))-a)/c+o))}function pu(e){let t=this;this._clockViewModel=e,this._allShuttleRingTicks=[],this._dateFormatter=pu.defaultDateFormatter,this._timeFormatter=pu.defaultTimeFormatter,this.shuttleRingDragging=!1,this.snapToTicks=!1,Ee.track(this,["_allShuttleRingTicks","_dateFormatter","_timeFormatter","shuttleRingDragging","snapToTicks"]),this._sortedFilteredPositiveTicks=[],this.setShuttleRingTicks(pu.defaultTicks),this.timeLabel=void 0,Ee.defineProperty(this,"timeLabel",function(){return t._timeFormatter(t._clockViewModel.currentTime,t)}),this.dateLabel=void 0,Ee.defineProperty(this,"dateLabel",function(){return t._dateFormatter(t._clockViewModel.currentTime,t)}),this.multiplierLabel=void 0,Ee.defineProperty(this,"multiplierLabel",function(){let s=t._clockViewModel;if(s.clockStep===Oo.SYSTEM_CLOCK)return"Today";let a=s.multiplier;return a%1===0?`${a.toFixed(0)}x`:`${a.toFixed(3).replace(/0{0,3}$/,"")}x`}),this.shuttleRingAngle=void 0,Ee.defineProperty(this,"shuttleRingAngle",{get:function(){return uBt(e.multiplier,t._allShuttleRingTicks,e)},set:function(s){s=Math.max(Math.min(s,UA),-UA);let a=t._allShuttleRingTicks,c=t._clockViewModel;if(c.clockStep=Oo.SYSTEM_CLOCK_MULTIPLIER,Math.abs(s)===UA){c.multiplier=s>0?a[a.length-1]:a[0];return}let d=dBt(s,a);if(t.snapToTicks)d=a[ile(d,a)];else if(d!==0){let u=Math.abs(d);if(u>100){let m=u.toFixed(0).length-2,p=Math.pow(10,m);d=Math.round(d/p)*p|0}else u>DT?d=Math.round(d):u>1?d=+d.toFixed(1):u>0&&(d=+d.toFixed(2))}c.multiplier=d}}),this._canAnimate=void 0,Ee.defineProperty(this,"_canAnimate",function(){let s=t._clockViewModel,a=s.clockRange;if(t.shuttleRingDragging||a===As.UNBOUNDED)return!0;let c=s.multiplier,d=s.currentTime,u=s.startTime,m;if(a===As.LOOP_STOP)m=Q.greaterThan(d,u)||d.equals(u)&&c>0;else{let p=s.stopTime;m=Q.greaterThan(d,u)&&Q.lessThan(d,p)||d.equals(u)&&c>0||d.equals(p)&&c<0}return m||(s.shouldAnimate=!1),m}),this._isSystemTimeAvailable=void 0,Ee.defineProperty(this,"_isSystemTimeAvailable",function(){let s=t._clockViewModel;if(s.clockRange===As.UNBOUNDED)return!0;let c=s.systemTime;return Q.greaterThanOrEquals(c,s.startTime)&&Q.lessThanOrEquals(c,s.stopTime)}),this._isAnimating=void 0,Ee.defineProperty(this,"_isAnimating",function(){return t._clockViewModel.shouldAnimate&&(t._canAnimate||t.shuttleRingDragging)});let n=Fn(function(){let s=t._clockViewModel;s.shouldAnimate?s.shouldAnimate=!1:t._canAnimate&&(s.shouldAnimate=!0)});this._pauseViewModel=new kT(n,{toggled:Ee.computed(function(){return!t._isAnimating}),tooltip:"Pause"});let i=Fn(function(){let s=t._clockViewModel,a=s.multiplier;a>0&&(s.multiplier=-a),s.shouldAnimate=!0});this._playReverseViewModel=new kT(i,{toggled:Ee.computed(function(){return t._isAnimating&&e.multiplier<0}),tooltip:"Play Reverse"});let o=Fn(function(){let s=t._clockViewModel,a=s.multiplier;a<0&&(s.multiplier=-a),s.shouldAnimate=!0});this._playForwardViewModel=new kT(o,{toggled:Ee.computed(function(){return t._isAnimating&&e.multiplier>0&&e.clockStep!==Oo.SYSTEM_CLOCK}),tooltip:"Play Forward"});let r=Fn(function(){t._clockViewModel.clockStep=Oo.SYSTEM_CLOCK},Ee.getObservable(this,"_isSystemTimeAvailable"));this._playRealtimeViewModel=new kT(r,{toggled:Ee.computed(function(){return e.clockStep===Oo.SYSTEM_CLOCK}),tooltip:Ee.computed(function(){return t._isSystemTimeAvailable?"Today (real-time)":"Current time not in range"})}),this._slower=Fn(function(){let s=t._clockViewModel,a=t._allShuttleRingTicks,c=s.multiplier,d=ile(c,a)-1;d>=0&&(s.multiplier=a[d])}),this._faster=Fn(function(){let s=t._clockViewModel,a=t._allShuttleRingTicks,c=s.multiplier,d=ile(c,a)+1;d<a.length&&(s.multiplier=a[d])})}pu.defaultDateFormatter=function(e,t){let n=Q.toGregorianDate(e);return`${aBt[n.month-1]} ${n.day} ${n.year}`};pu.defaultTicks=[.001,.002,.005,.01,.02,.05,.1,.25,.5,1,2,5,10,15,30,60,120,300,600,900,1800,3600,7200,14400,21600,43200,86400,172800,345600,604800];pu.defaultTimeFormatter=function(e,t){let n=Q.toGregorianDate(e),i=Math.round(n.millisecond);return Math.abs(t._clockViewModel.multiplier)<1?`${n.hour.toString().padStart(2,"0")}:${n.minute.toString().padStart(2,"0")}:${n.second.toString().padStart(2,"0")}.${i.toString().padStart(3,"0")}`:`${n.hour.toString().padStart(2,"0")}:${n.minute.toString().padStart(2,"0")}:${n.second.toString().padStart(2,"0")} UTC`};pu.prototype.getShuttleRingTicks=function(){return this._sortedFilteredPositiveTicks.slice(0)};pu.prototype.setShuttleRingTicks=function(e){let t,n,i,o={},r=this._sortedFilteredPositiveTicks;for(r.length=0,t=0,n=e.length;t<n;++t)i=e[t],o.hasOwnProperty(i)||(o[i]=!0,r.push(i));r.sort(aYe);let s=[];for(n=r.length,t=n-1;t>=0;--t)i=r[t],i!==0&&s.push(-i);ei(s,r),this._allShuttleRingTicks=s};pu.prototype.adjustDate=function(e,t){if(t===0)return;let n=this._clockViewModel,i=n.currentTime,o=Q.toGregorianDate(i),r;if(e==="day"){r=Q.addDays(i,t,new Q);let s=Q.toGregorianDate(r);if(s.year<1||s.year>9999)return}else if(e==="month"){let a=Math.min(Math.max((o.year-1)*12+o.month-1+t,0),119987),c=Math.floor(a/12)+1,d=a%12+1;r=sYe(o,c,d)}else{let s=Math.min(Math.max(o.year+t,1),9999);r=sYe(o,s,o.month)}Q.equals(i,r)||(n.shouldAnimate=!1,n.currentTime=r)};pu.prototype.adjustTime=function(e,t){if(t===0)return;let n=this._clockViewModel,i=n.currentTime,o;if(e==="hour")o=Q.addHours(i,t,new Q);else if(e==="minute")o=Q.addMinutes(i,t,new Q);else{let s=e==="second"?t:t/1e3;o=Q.addSeconds(i,s,new Q)}let r=Q.toGregorianDate(o);r.year<1||r.year>9999||(n.shouldAnimate=!1,n.currentTime=o)};Object.defineProperties(pu.prototype,{slower:{get:function(){return this._slower}},faster:{get:function(){return this._faster}},clockViewModel:{get:function(){return this._clockViewModel}},pauseViewModel:{get:function(){return this._pauseViewModel}},playReverseViewModel:{get:function(){return this._playReverseViewModel}},playForwardViewModel:{get:function(){return this._playForwardViewModel}},playRealtimeViewModel:{get:function(){return this._playRealtimeViewModel}},dateFormatter:{get:function(){return this._dateFormatter},set:function(e){this._dateFormatter=e}},timeFormatter:{get:function(){return this._timeFormatter},set:function(e){this._timeFormatter=e}}});pu._maxShuttleRingAngle=UA;pu._realtimeShuttleRingAngle=DT;var f5=pu;var mur=x(T(),1);var rur=x(T(),1);function cYe(e){e=e??B.EMPTY_OBJECT;let t=e.globe,n=e.imageryProviderViewModels??B.EMPTY_ARRAY,i=e.terrainProviderViewModels??B.EMPTY_ARRAY;this._globe=t,this.imageryProviderViewModels=n.slice(0),this.terrainProviderViewModels=i.slice(0),this.dropDownVisible=!1,Ee.track(this,["imageryProviderViewModels","terrainProviderViewModels","dropDownVisible"]);let o=Ee.getObservable(this,"imageryProviderViewModels"),r=Ee.pureComputed(function(){let m=o(),p={},b;for(b=0;b<m.length;b++){let _=m[b],S=_.category;l(p[S])?p[S].push(_):p[S]=[_]}let f=Object.keys(p),y=[];for(b=0;b<f.length;b++){let _=f[b];y.push({name:_,providers:p[_]})}return y});this._imageryProviders=r;let s=Ee.getObservable(this,"terrainProviderViewModels"),a=Ee.pureComputed(function(){let m=s(),p={},b;for(b=0;b<m.length;b++){let _=m[b],S=_.category;l(p[S])?p[S].push(_):p[S]=[_]}let f=Object.keys(p),y=[];for(b=0;b<f.length;b++){let _=f[b];y.push({name:_,providers:p[_]})}return y});this._terrainProviders=a,this.buttonTooltip=void 0,Ee.defineProperty(this,"buttonTooltip",function(){let m=this.selectedImagery,p=this.selectedTerrain,b=l(m)?m.name:void 0,f=l(p)?p.name:void 0;return l(b)&&l(f)?`${b} -${f}`:l(b)?b:f}),this.buttonImageUrl=void 0,Ee.defineProperty(this,"buttonImageUrl",function(){let m=this.selectedImagery;if(l(m))return m.iconUrl}),this.selectedImagery=void 0;let c=Ee.observable();this._currentImageryLayers=[],Ee.defineProperty(this,"selectedImagery",{get:function(){return c()},set:function(m){if(c()===m){this.dropDownVisible=!1;return}let p,b=this._currentImageryLayers,f=b.length,y=this._globe.imageryLayers,_=!1;for(p=0;p<f;p++){let S=y.length;for(let Z=0;Z<S;Z++){let R=y.get(Z);if(R===b[p]){y.remove(R),_=!0;break}}}if(l(m)){let S=m.creationCommand();if(Array.isArray(S)){let Z=S.length;for(this._currentImageryLayers=[],p=Z-1;p>=0;p--){let R=Zs.fromProviderAsync(S[p]);y.add(R,0),this._currentImageryLayers.push(R)}}else{this._currentImageryLayers=[];let Z=Zs.fromProviderAsync(S);if(Z.name=m.name,_)y.add(Z,0);else{let R=y.get(0);l(R)&&y.remove(R),y.add(Z,0)}this._currentImageryLayers.push(Z)}}c(m),this.dropDownVisible=!1}}),this.selectedTerrain=void 0;let d=Ee.observable();Ee.defineProperty(this,"selectedTerrain",{get:function(){return d()},set:function(m){if(d()===m){this.dropDownVisible=!1;return}let p;if(l(m)&&(p=m.creationCommand()),l(p)&&!l(p.then))this._globe.depthTestAgainstTerrain=!(p instanceof A0),this._globe.terrainProvider=p;else if(l(p)){let b=!1,f=this._globe.terrainProviderChanged.addEventListener(()=>{b=!0,f()}),_=new t5(p).readyEvent.addEventListener(S=>{b||(this._globe.depthTestAgainstTerrain=!(S instanceof A0),this._globe.terrainProvider=S,_())})}d(m),this.dropDownVisible=!1}});let u=this;this._toggleDropDown=Fn(function(){u.dropDownVisible=!u.dropDownVisible}),this.selectedImagery=e.selectedImageryProviderViewModel??n[0],this.selectedTerrain=e.selectedTerrainProviderViewModel}Object.defineProperties(cYe.prototype,{toggleDropDown:{get:function(){return this._toggleDropDown}},globe:{get:function(){return this._globe}}});var p5=cYe;function NJ(e,t){e=Nn(e);let n=new p5(t),i=document.createElement("button");i.type="button",i.className="cesium-button cesium-toolbar-button",i.setAttribute("data-bind","attr: { title: buttonTooltip },click: toggleDropDown"),e.appendChild(i);let o=document.createElement("img");o.setAttribute("draggable","false"),o.className="cesium-baseLayerPicker-selected",o.setAttribute("data-bind","attr: { src: buttonImageUrl }, visible: !!buttonImageUrl"),i.appendChild(o);let r=document.createElement("div");r.className="cesium-baseLayerPicker-dropDown",r.setAttribute("data-bind",'css: { "cesium-baseLayerPicker-dropDown-visible" : dropDownVisible }'),e.appendChild(r);let s=document.createElement("div");s.className="cesium-baseLayerPicker-sectionTitle",s.setAttribute("data-bind","visible: imageryProviderViewModels.length > 0"),s.innerHTML="Imagery",r.appendChild(s);let a=document.createElement("div");a.className="cesium-baseLayerPicker-section",a.setAttribute("data-bind","foreach: _imageryProviders"),r.appendChild(a);let c=document.createElement("div");c.className="cesium-baseLayerPicker-category",a.appendChild(c);let d=document.createElement("div");d.className="cesium-baseLayerPicker-categoryTitle",d.setAttribute("data-bind","text: name"),c.appendChild(d);let u=document.createElement("div");u.className="cesium-baseLayerPicker-choices",u.setAttribute("data-bind","foreach: providers"),c.appendChild(u);let m=document.createElement("div");m.className="cesium-baseLayerPicker-item",m.setAttribute("data-bind",'css: { "cesium-baseLayerPicker-selectedItem" : $data === $parents[1].selectedImagery },attr: { title: tooltip },visible: creationCommand.canExecute,click: function($data) { $parents[1].selectedImagery = $data; }'),u.appendChild(m);let p=document.createElement("img");p.className="cesium-baseLayerPicker-itemIcon",p.setAttribute("data-bind","attr: { src: iconUrl }"),p.setAttribute("draggable","false"),m.appendChild(p);let b=document.createElement("div");b.className="cesium-baseLayerPicker-itemLabel",b.setAttribute("data-bind","text: name"),m.appendChild(b);let f=document.createElement("div");f.className="cesium-baseLayerPicker-sectionTitle",f.setAttribute("data-bind","visible: terrainProviderViewModels.length > 0"),f.innerHTML="Terrain",r.appendChild(f);let y=document.createElement("div");y.className="cesium-baseLayerPicker-section",y.setAttribute("data-bind","foreach: _terrainProviders"),r.appendChild(y);let _=document.createElement("div");_.className="cesium-baseLayerPicker-category",y.appendChild(_);let S=document.createElement("div");S.className="cesium-baseLayerPicker-categoryTitle",S.setAttribute("data-bind","text: name"),_.appendChild(S);let Z=document.createElement("div");Z.className="cesium-baseLayerPicker-choices",Z.setAttribute("data-bind","foreach: providers"),_.appendChild(Z);let R=document.createElement("div");R.className="cesium-baseLayerPicker-item",R.setAttribute("data-bind",'css: { "cesium-baseLayerPicker-selectedItem" : $data === $parents[1].selectedTerrain },attr: { title: tooltip },visible: creationCommand.canExecute,click: function($data) { $parents[1].selectedTerrain = $data; }'),Z.appendChild(R);let C=document.createElement("img");C.className="cesium-baseLayerPicker-itemIcon",C.setAttribute("data-bind","attr: { src: iconUrl }"),C.setAttribute("draggable","false"),R.appendChild(C);let E=document.createElement("div");E.className="cesium-baseLayerPicker-itemLabel",E.setAttribute("data-bind","text: name"),R.appendChild(E),Ee.applyBindings(n,i),Ee.applyBindings(n,r),this._viewModel=n,this._container=e,this._element=i,this._dropPanel=r,this._closeDropDown=function(A){i.contains(A.target)||r.contains(A.target)||(n.dropDownVisible=!1)},fn.supportsPointerEvents()?document.addEventListener("pointerdown",this._closeDropDown,!0):(document.addEventListener("mousedown",this._closeDropDown,!0),document.addEventListener("touchstart",this._closeDropDown,!0))}Object.defineProperties(NJ.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}}});NJ.prototype.isDestroyed=function(){return!1};NJ.prototype.destroy=function(){return fn.supportsPointerEvents()?document.removeEventListener("pointerdown",this._closeDropDown,!0):(document.removeEventListener("mousedown",this._closeDropDown,!0),document.removeEventListener("touchstart",this._closeDropDown,!0)),Ee.cleanNode(this._element),Ee.cleanNode(this._dropPanel),this._container.removeChild(this._element),this._container.removeChild(this._dropPanel),ue(this)};var b5=NJ;var Sur=x(T(),1);var yur=x(T(),1);function lYe(e){let t=e.creationFunction;l(t.canExecute)||(t=Fn(t)),this._creationCommand=t,this.name=e.name,this.tooltip=e.tooltip,this.iconUrl=e.iconUrl,this._category=e.category??"",Ee.track(this,["name","tooltip","iconUrl"])}Object.defineProperties(lYe.prototype,{creationCommand:{get:function(){return this._creationCommand}},category:{get:function(){return this._category}}});var mr=lYe;function mBt(){let e=[],t=devicePixelRatio>=2;return e.push(new mr({name:"Bing Maps Aerial",iconUrl:en("Widgets/Images/ImageryProviders/bingAerial.png"),tooltip:"Bing Maps aerial imagery, provided by Cesium ion",category:"Cesium ion",creationFunction:function(){return qb({style:Qb.AERIAL})}})),e.push(new mr({name:"Bing Maps Aerial with Labels",iconUrl:en("Widgets/Images/ImageryProviders/bingAerialLabels.png"),tooltip:"Bing Maps aerial imagery with labels, provided by Cesium ion",category:"Cesium ion",creationFunction:function(){return qb({style:Qb.AERIAL_WITH_LABELS})}})),e.push(new mr({name:"Bing Maps Roads",iconUrl:en("Widgets/Images/ImageryProviders/bingRoads.png"),tooltip:"Bing Maps standard road maps, provided by Cesium ion",category:"Cesium ion",creationFunction:function(){return qb({style:Qb.ROAD})}})),e.push(new mr({name:"ArcGIS World Imagery",iconUrl:en("Widgets/Images/ImageryProviders/ArcGisMapServiceWorldImagery.png"),tooltip:`ArcGIS World Imagery provides one meter or better satellite and aerial imagery in many parts of the world and lower resolution satellite imagery worldwide. The map includes 15m TerraColor imagery at small and mid-scales (~1:591M down to ~1:288k) for the world. The map features Maxar imagery at 0.3m resolution for select metropolitan areas around the world, 0.5m resolution across the United States and parts of Western Europe, and 1m resolution imagery across the rest of the world. In addition to commercial sources, the World Imagery map features high-resolution aerial photography contributed by the GIS User Community. This imagery ranges from 0.3m to 0.03m resolution (down to ~1:280 nin select communities). For more information on this map, including the terms of use, visit us online at -https://www.arcgis.com/home/item.html?id=10df2279f9684e4a9f6a7f08febac2a9`,category:"Other",creationFunction:function(){return Jb.fromBasemapType(hf.SATELLITE,{enablePickFeatures:!1})}})),e.push(new mr({name:"ArcGIS World Hillshade",iconUrl:en("Widgets/Images/ImageryProviders/ArcGisMapServiceWorldHillshade.png"),tooltip:`ArcGIS World Hillshade map portrays elevation as an artistic hillshade. This map is designed to be used as a backdrop for topographical, soil, hydro, landcover or other outdoor recreational maps. The map was compiled from a variety of sources from several data providers. The basemap has global coverage down to a scale of ~1:72k. In select areas of the United States and Europe, coverage is available down to ~1:9k. For more information on this map, including the terms of use, visit us online at -https://www.arcgis.com/home/item.html?id=1b243539f4514b6ba35e7d995890db1d`,category:"Other",creationFunction:function(){return Jb.fromBasemapType(hf.HILLSHADE,{enablePickFeatures:!1})}})),e.push(new mr({name:"Esri World Ocean",iconUrl:en("Widgets/Images/ImageryProviders/ArcGisMapServiceWorldOcean.png"),tooltip:`ArcGIS World Ocean map is designed to be used as a base map by marine GIS professionals and as a reference map by anyone interested in ocean data. The base map features marine bathymetry. Land features include inland waters and roads overlaid on land cover and shaded relief imagery. The map was compiled from a variety of best available sources from several data providers, including General Bathymetric Chart of the Oceans GEBCO_08 Grid, National Oceanic and Atmospheric Administration (NOAA), and National Geographic, Garmin, HERE, Geonames.org, and Esri, and various other contributors. The base map currently provides coverage for the world down to a scale of ~1:577k, and coverage down to 1:72k in US coastal areas, and various other areas. Coverage down to ~ 1:9k is available limited areas based on regional hydrographic survey data. The base map was designed and developed by Esri. For more information on this map, including our terms of use, visit us online at -https://www.arcgis.com/home/item.html?id=1e126e7520f9466c9ca28b8f28b5e500`,category:"Other",creationFunction:function(){return Jb.fromBasemapType(hf.OCEANS,{enablePickFeatures:!1})}})),e.push(new mr({name:"Open\xADStreet\xADMap",iconUrl:en("Widgets/Images/ImageryProviders/openStreetMap.png"),tooltip:`OpenStreetMap (OSM) is a collaborative project to create a free editable map of the world. + */var Qce="__knockoutObservables",qce="__knockoutSubscribable";function QNe(e,t){if(!e)throw new Error("When calling ko.track, you must pass an object as the first parameter.");var n=this,i=qNe(e,!0);return t=t||Object.getOwnPropertyNames(e),t.forEach(function(o){if(!(o===Qce||o===qce)&&!(o in i)){var r=e[o],s=r instanceof Array,a=n.isObservable(r)?r:s?n.observableArray(r):n.observable(r);Object.defineProperty(e,o,{configurable:!0,enumerable:!0,get:a,set:n.isWriteableObservable(a)?a:void 0}),i[o]=a,s&&UOt(n,a)}}),e}function qNe(e,t){var n=e[Qce];return!n&&t&&(n={},Object.defineProperty(e,Qce,{value:n})),n}function kOt(e,t,n){var i=this,o={owner:e,deferEvaluation:!0};if(typeof n=="function")o.read=n;else{if("value"in n)throw new Error('For ko.defineProperty, you must not specify a "value" for the property. You must provide a "get" function.');if(typeof n.get!="function")throw new Error('For ko.defineProperty, the third parameter must be either an evaluator function, or an options object containing a function called "get".');o.read=n.get,o.write=n.set}return e[t]=i.computed(o),QNe.call(i,e,[t]),e}function UOt(e,t){var n=null;e.computed(function(){n&&(n.dispose(),n=null);var i=t();i instanceof Array&&(n=DOt(e,t,i))})}function DOt(e,t,n){var i=OOt(e,n);return i.subscribe(t)}function OOt(e,t){var n=t[qce];if(!n){n=new e.subscribable,Object.defineProperty(t,qce,{value:n});var i={};BOt(t,n,i),zOt(e,t,n,i)}return n}function BOt(e,t,n){["pop","push","reverse","shift","sort","splice","unshift"].forEach(function(i){var o=e[i];e[i]=function(){var r=o.apply(this,arguments);return n.pause!==!0&&t.notifySubscribers(this),r}})}function zOt(e,t,n,i){["remove","removeAll","destroy","destroyAll","replace"].forEach(function(o){Object.defineProperty(t,o,{enumerable:!1,value:function(){var r;i.pause=!0;try{r=e.observableArray.fn[o].apply(e.observableArray(t),arguments)}finally{i.pause=!1}return n.notifySubscribers(t),r}})})}function $Ne(e,t){if(!e)return null;var n=qNe(e,!1);return n&&n[t]||null}function HOt(e,t){var n=$Ne(e,t);n&&n.valueHasMutated()}function KOt(e){e.track=QNe,e.getObservable=$Ne,e.valueHasMutated=HOt,e.defineProperty=kOt}var a5={attachToKo:KOt};var ddr=x(T(),1),eYe="http://www.w3.org/2000/svg",tYe="cesium-svgPath-svg",JOt={register:function(e){e.bindingHandlers.cesiumSvgPath={init:function(t,n){let i=document.createElementNS(eYe,"svg:svg");i.setAttribute("class",tYe);let o=document.createElementNS(eYe,"path");return i.appendChild(o),e.virtualElements.setDomNodeChildren(t,[i]),e.computed({read:function(){let r=e.unwrap(n());o.setAttribute("d",e.unwrap(r.path));let s=e.unwrap(r.width),a=e.unwrap(r.height);i.setAttribute("width",s),i.setAttribute("height",a),i.setAttribute("viewBox",`0 0 ${s} ${a}`),r.css&&i.setAttribute("class",`${tYe} ${e.unwrap(r.css)}`)},disposeWhenNodeIsRemoved:t}),{controlsDescendantBindings:!0}}},e.virtualElements.allowedBindings.cesiumSvgPath=!0}},c5=JOt;a5.attachToKo(UR);c5.register(UR);var Ee=UR;function l5(e){l(e)||(e=new Dh),this._clock=e,this._eventHelper=new kr,this._eventHelper.add(e.onTick,this.synchronize,this),this.systemTime=Ee.observable(Q.now()),this.systemTime.equalityComparer=Q.equals,this.startTime=Ee.observable(e.startTime),this.startTime.equalityComparer=Q.equals,this.startTime.subscribe(function(t){e.startTime=t,this.synchronize()},this),this.stopTime=Ee.observable(e.stopTime),this.stopTime.equalityComparer=Q.equals,this.stopTime.subscribe(function(t){e.stopTime=t,this.synchronize()},this),this.currentTime=Ee.observable(e.currentTime),this.currentTime.equalityComparer=Q.equals,this.currentTime.subscribe(function(t){e.currentTime=t,this.synchronize()},this),this.multiplier=Ee.observable(e.multiplier),this.multiplier.subscribe(function(t){e.multiplier=t,this.synchronize()},this),this.clockStep=Ee.observable(e.clockStep),this.clockStep.subscribe(function(t){e.clockStep=t,this.synchronize()},this),this.clockRange=Ee.observable(e.clockRange),this.clockRange.subscribe(function(t){e.clockRange=t,this.synchronize()},this),this.canAnimate=Ee.observable(e.canAnimate),this.canAnimate.subscribe(function(t){e.canAnimate=t,this.synchronize()},this),this.shouldAnimate=Ee.observable(e.shouldAnimate),this.shouldAnimate.subscribe(function(t){e.shouldAnimate=t,this.synchronize()},this),Ee.track(this,["systemTime","startTime","stopTime","currentTime","multiplier","clockStep","clockRange","canAnimate","shouldAnimate"])}Object.defineProperties(l5.prototype,{clock:{get:function(){return this._clock}}});l5.prototype.synchronize=function(){let e=this._clock;this.systemTime=Q.now(),this.startTime=e.startTime,this.stopTime=e.stopTime,this.currentTime=e.currentTime,this.multiplier=e.multiplier,this.clockStep=e.clockStep,this.clockRange=e.clockRange,this.canAnimate=e.canAnimate,this.shouldAnimate=e.shouldAnimate};l5.prototype.isDestroyed=function(){return!1};l5.prototype.destroy=function(){this._eventHelper.removeAll(),ue(this)};var d5=l5;var Sdr=x(T(),1);function jOt(){this.canExecute=void 0,this.beforeExecute=void 0,this.afterExecute=void 0,ge.throwInstantiationError()}var $ce=jOt;var Adr=x(T(),1);function QOt(e,t){t=t??!0;let n=new Se,i=new Se;function o(){let r={args:arguments,cancel:!1},s;return n.raiseEvent(r),r.cancel||(s=e.apply(null,arguments),i.raiseEvent(s)),s}return o.canExecute=t,Ee.track(o,["canExecute"]),Object.defineProperties(o,{beforeExecute:{value:n},afterExecute:{value:i}}),o}var Fn=QOt;var vdr=x(T(),1);var wA={};wA.createCheckbox=function(e,t,n){let i=document.createElement("div"),o=document.createElement("label"),r=document.createElement("input");r.type="checkbox";let s=`checked: ${t}`;return l(n)&&(s+=`, enable: ${n}`),r.setAttribute("data-bind",s),o.appendChild(r),o.appendChild(document.createTextNode(e)),i.appendChild(o),i};wA.createSection=function(e,t,n,i){let o=document.createElement("div");o.className="cesium-cesiumInspector-section",o.setAttribute("data-bind",`css: { "cesium-cesiumInspector-section-collapsed": !${n} }`),e.appendChild(o);let r=document.createElement("h3");r.className="cesium-cesiumInspector-sectionHeader",r.appendChild(document.createTextNode(t)),r.setAttribute("data-bind",`click: ${i}`),o.appendChild(r);let s=document.createElement("div");return s.className="cesium-cesiumInspector-sectionContent",o.appendChild(s),s};wA.createRangeInput=function(e,t,n,i,o,r){r=r??t;let s=document.createElement("input");s.setAttribute("data-bind",`value: ${r}`),s.type="number";let a=document.createElement("input");a.type="range",a.min=n,a.max=i,a.step=o??"any",a.setAttribute("data-bind",`valueUpdate: "input", value: ${t}`);let c=document.createElement("div");c.appendChild(a);let d=document.createElement("div");return d.className="cesium-cesiumInspector-slider",d.appendChild(document.createTextNode(e)),d.appendChild(s),d.appendChild(c),d};wA.createRangeInputWithDynamicMinMax=function(e,t,n,i){i=i??t;let o=document.createElement("input");o.setAttribute("data-bind",`value: ${i}`),o.type="number";let r=document.createElement("input");r.type="range",r.step=n??"any",r.setAttribute("data-bind",`valueUpdate: "input", value: ${t}, attr: { min: ${t}Min, max: ${t}Max }`);let s=document.createElement("div");s.appendChild(r);let a=document.createElement("div");return a.className="cesium-cesiumInspector-slider",a.appendChild(document.createTextNode(e)),a.appendChild(o),a.appendChild(s),a};wA.createButton=function(e,t,n){let i=document.createElement("button");i.type="button",i.textContent=e,i.className="cesium-cesiumInspector-pickButton";let o=`click: ${t}`;return l(n)&&(o+=`, css: {"cesium-cesiumInspector-pickButtonHighlight" : ${n}}`),i.setAttribute("data-bind",o),i};var fu=wA;var Pdr=x(T(),1);function qOt(e,t,n,i,o){return n.call(i,e[t]),Ee.getObservable(e,t).subscribe(n,i,o)}var Sc=qOt;var kdr=x(T(),1);function nYe(e,t){this._command=e,t=t??B.EMPTY_OBJECT,this.toggled=t.toggled??!1,this.tooltip=t.tooltip??"",Ee.track(this,["toggled","tooltip"])}Object.defineProperties(nYe.prototype,{command:{get:function(){return this._command}}});var kT=nYe;var zdr=x(T(),1);var Al="http://www.w3.org/2000/svg",sYe="http://www.w3.org/1999/xlink",FJ,u5=U.fromCssColorString("rgba(247,250,255,0.384)"),IJ=U.fromCssColorString("rgba(143,191,255,0.216)"),ele=U.fromCssColorString("rgba(153,197,255,0.098)"),PJ=U.fromCssColorString("rgba(255,255,255,0.086)"),$Ot=U.fromCssColorString("rgba(255,255,255,0.267)"),eBt=U.fromCssColorString("rgba(255,255,255,0)"),iYe=U.fromCssColorString("rgba(66,67,68,0.3)"),oYe=U.fromCssColorString("rgba(0,0,0,0.5)");function UT(e){return U.fromCssColorString(window.getComputedStyle(e).getPropertyValue("color"))}var m5={animation_pathReset:{tagName:"path",transform:"translate(16,16) scale(0.85) translate(-16,-16)",d:"M24.316,5.318,9.833,13.682,9.833,5.5,5.5,5.5,5.5,25.5,9.833,25.5,9.833,17.318,24.316,25.682z"},animation_pathPause:{tagName:"path",transform:"translate(16,16) scale(0.85) translate(-16,-16)",d:"M13,5.5,7.5,5.5,7.5,25.5,13,25.5zM24.5,5.5,19,5.5,19,25.5,24.5,25.5z"},animation_pathPlay:{tagName:"path",transform:"translate(16,16) scale(0.85) translate(-16,-16)",d:"M6.684,25.682L24.316,15.5L6.684,5.318V25.682z"},animation_pathPlayReverse:{tagName:"path",transform:"translate(16,16) scale(-0.85,0.85) translate(-16,-16)",d:"M6.684,25.682L24.316,15.5L6.684,5.318V25.682z"},animation_pathLoop:{tagName:"path",transform:"translate(16,16) scale(0.85) translate(-16,-16)",d:"M24.249,15.499c-0.009,4.832-3.918,8.741-8.75,8.75c-2.515,0-4.768-1.064-6.365-2.763l2.068-1.442l-7.901-3.703l0.744,8.694l2.193-1.529c2.244,2.594,5.562,4.242,9.26,4.242c6.767,0,12.249-5.482,12.249-12.249H24.249zM15.499,6.75c2.516,0,4.769,1.065,6.367,2.764l-2.068,1.443l7.901,3.701l-0.746-8.693l-2.192,1.529c-2.245-2.594-5.562-4.245-9.262-4.245C8.734,3.25,3.25,8.734,3.249,15.499H6.75C6.758,10.668,10.668,6.758,15.499,6.75z"},animation_pathClock:{tagName:"path",transform:"translate(16,16) scale(0.85) translate(-16,-15.5)",d:"M15.5,2.374C8.251,2.375,2.376,8.251,2.374,15.5C2.376,22.748,8.251,28.623,15.5,28.627c7.249-0.004,13.124-5.879,13.125-13.127C28.624,8.251,22.749,2.375,15.5,2.374zM15.5,25.623C9.909,25.615,5.385,21.09,5.375,15.5C5.385,9.909,9.909,5.384,15.5,5.374c5.59,0.01,10.115,4.535,10.124,10.125C25.615,21.09,21.091,25.615,15.5,25.623zM8.625,15.5c-0.001-0.552-0.448-0.999-1.001-1c-0.553,0-1,0.448-1,1c0,0.553,0.449,1,1,1C8.176,16.5,8.624,16.053,8.625,15.5zM8.179,18.572c-0.478,0.277-0.642,0.889-0.365,1.367c0.275,0.479,0.889,0.641,1.365,0.365c0.479-0.275,0.643-0.887,0.367-1.367C9.27,18.461,8.658,18.297,8.179,18.572zM9.18,10.696c-0.479-0.276-1.09-0.112-1.366,0.366s-0.111,1.09,0.365,1.366c0.479,0.276,1.09,0.113,1.367-0.366C9.821,11.584,9.657,10.973,9.18,10.696zM22.822,12.428c0.478-0.275,0.643-0.888,0.366-1.366c-0.275-0.478-0.89-0.642-1.366-0.366c-0.479,0.278-0.642,0.89-0.366,1.367C21.732,12.54,22.344,12.705,22.822,12.428zM12.062,21.455c-0.478-0.275-1.089-0.111-1.366,0.367c-0.275,0.479-0.111,1.09,0.366,1.365c0.478,0.277,1.091,0.111,1.365-0.365C12.704,22.344,12.54,21.732,12.062,21.455zM12.062,9.545c0.479-0.276,0.642-0.888,0.366-1.366c-0.276-0.478-0.888-0.642-1.366-0.366s-0.642,0.888-0.366,1.366C10.973,9.658,11.584,9.822,12.062,9.545zM22.823,18.572c-0.48-0.275-1.092-0.111-1.367,0.365c-0.275,0.479-0.112,1.092,0.367,1.367c0.477,0.275,1.089,0.113,1.365-0.365C23.464,19.461,23.3,18.848,22.823,18.572zM19.938,7.813c-0.477-0.276-1.091-0.111-1.365,0.366c-0.275,0.48-0.111,1.091,0.366,1.367s1.089,0.112,1.366-0.366C20.581,8.702,20.418,8.089,19.938,7.813zM23.378,14.5c-0.554,0.002-1.001,0.45-1.001,1c0.001,0.552,0.448,1,1.001,1c0.551,0,1-0.447,1-1C24.378,14.949,23.929,14.5,23.378,14.5zM15.501,6.624c-0.552,0-1,0.448-1,1l-0.466,7.343l-3.004,1.96c-0.478,0.277-0.642,0.889-0.365,1.365c0.275,0.479,0.889,0.643,1.365,0.367l3.305-1.676C15.39,16.99,15.444,17,15.501,17c0.828,0,1.5-0.671,1.5-1.5l-0.5-7.876C16.501,7.072,16.053,6.624,15.501,6.624zM15.501,22.377c-0.552,0-1,0.447-1,1s0.448,1,1,1s1-0.447,1-1S16.053,22.377,15.501,22.377zM18.939,21.455c-0.479,0.277-0.643,0.889-0.366,1.367c0.275,0.477,0.888,0.643,1.366,0.365c0.478-0.275,0.642-0.889,0.366-1.365C20.028,21.344,19.417,21.18,18.939,21.455z"},animation_pathWingButton:{tagName:"path",d:"m 4.5,0.5 c -2.216,0 -4,1.784 -4,4 l 0,24 c 0,2.216 1.784,4 4,4 l 13.71875,0 C 22.478584,27.272785 27.273681,22.511272 32.5,18.25 l 0,-13.75 c 0,-2.216 -1.784,-4 -4,-4 l -24,0 z"},animation_pathPointer:{tagName:"path",d:"M-15,-65,-15,-55,15,-55,15,-65,0,-95z"},animation_pathSwooshFX:{tagName:"path",d:"m 85,0 c 0,16.617 -4.813944,35.356 -13.131081,48.4508 h 6.099803 c 8.317138,-13.0948 13.13322,-28.5955 13.13322,-45.2124 0,-46.94483 -38.402714,-85.00262 -85.7743869,-85.00262 -1.0218522,0 -2.0373001,0.0241 -3.0506131,0.0589 45.958443,1.59437 82.723058,35.77285 82.723058,81.70532 z"}};function fp(e){let t=document.createElementNS(Al,e.tagName);for(let n in e)if(e.hasOwnProperty(n)&&n!=="tagName")if(n==="children"){let i=e.children.length;for(let o=0;o<i;++o)t.appendChild(fp(e.children[o]))}else n.indexOf("xlink:")===0?t.setAttributeNS(sYe,n.substring(6),e[n]):n==="textContent"?t.textContent=e[n]:t.setAttribute(n,e[n]);return t}function nle(e,t,n){let i=document.createElementNS(Al,"text");i.setAttribute("x",e),i.setAttribute("y",t),i.setAttribute("class","cesium-animation-svgText");let o=document.createElementNS(Al,"tspan");return o.textContent=n,i.appendChild(o),i}function tBt(e,t){let n=nle(e,t,"");n.removeChild(n.firstChild);let i={},o=[],r=["month","day","year"];for(let a=0;a<r.length;++a){if(a>0){let u=document.createElementNS(Al,"tspan");u.textContent=" ",o.push(u),n.appendChild(u)}let c=r[a],d=document.createElementNS(Al,"tspan");d.setAttribute("class",`cesium-animation-dateField cesium-animation-dateField-${c}`),d.setAttribute("aria-label",`Adjust ${c} with mouse wheel`),i[c]=d,n.appendChild(d)}let s=document.createElementNS(Al,"tspan");return n.appendChild(s),{element:n,fallback:s,parts:i,separators:o}}function nBt(e,t){let n=/^(\S+)\s+(\d{1,2})\s+(\d{1,4})$/.exec(t),i=e.parts,o=e.separators;if(n===null){i.month.textContent="",i.day.textContent="",i.year.textContent="",o[0].textContent="",o[1].textContent="",e.fallback.textContent=t;return}i.month.textContent=n[1],i.day.textContent=n[2],i.year.textContent=n[3],o[0].textContent=" ",o[1].textContent=" ",e.fallback.textContent=""}function iBt(e,t){let n=nle(e,t,"");n.removeChild(n.firstChild);let i={},o=[],r=["hour","minute","second"];for(let u=0;u<r.length;++u){if(u>0){let b=document.createElementNS(Al,"tspan");b.textContent=":",o.push(b),n.appendChild(b)}let m=r[u],p=document.createElementNS(Al,"tspan");p.setAttribute("class",`cesium-animation-timeField cesium-animation-timeField-${m}`),p.setAttribute("aria-label",`Adjust ${m} with mouse wheel`),i[m]=p,n.appendChild(p)}let s=document.createElementNS(Al,"tspan");n.appendChild(s);let a=document.createElementNS(Al,"tspan");a.setAttribute("class","cesium-animation-timeField cesium-animation-timeField-millisecond"),a.setAttribute("aria-label","Adjust millisecond with mouse wheel"),i.millisecond=a,n.appendChild(a);let c=document.createElementNS(Al,"tspan");n.appendChild(c);let d=document.createElementNS(Al,"tspan");return n.appendChild(d),{decimalPoint:s,element:n,fallback:d,parts:i,separators:o,suffix:c}}function oBt(e,t){let n=/^(\d{2}):(\d{2}):(\d{2})(?:\.(\d{3})| UTC)$/.exec(t),i=e.parts,o=e.separators;if(n===null){i.hour.textContent="",i.minute.textContent="",i.second.textContent="",i.millisecond.textContent="",o[0].textContent="",o[1].textContent="",e.decimalPoint.textContent="",e.suffix.textContent="",e.fallback.textContent=t;return}i.hour.textContent=n[1],i.minute.textContent=n[2],i.second.textContent=n[3],o[0].textContent=":",o[1].textContent=":",e.decimalPoint.textContent=l(n[4])?".":"",i.millisecond.textContent=n[4]??"",e.suffix.textContent=l(n[4])?"":" UTC",e.fallback.textContent=""}function rYe(e,t,n){let i=Object.keys(t);for(let o=0;o<i.length;++o){let r=i[o],s=t[r],a=function(c){c.deltaY!==0&&(n(r,c.deltaY<0?1:-1),c.preventDefault(),c.stopPropagation())};s.addEventListener("wheel",a,!1),e._fieldWheelListeners.push({element:s,listener:a})}}function rBt(e,t,n){e.setAttribute("transform",`translate(100,100) rotate(${n})`),t.setAttribute("transform",`rotate(${n})`)}var XJ=new U;function zs(e,t){let n=t.alpha,i=1-n;return XJ.red=e.red*i+t.red*n,XJ.green=e.green*i+t.green*n,XJ.blue=e.blue*i+t.blue*n,XJ.toCssColorString()}function tle(e,t,n){let i=m5[n],o={tagName:"g",class:"cesium-animation-rectButton",transform:`translate(${e},${t})`,children:[{tagName:"rect",class:"cesium-animation-buttonGlow",width:32,height:32,rx:2,ry:2},{tagName:"rect",class:"cesium-animation-buttonMain",width:32,height:32,rx:4,ry:4},{class:"cesium-animation-buttonPath",id:n,tagName:i.tagName,transform:i.transform,d:i.d},{tagName:"title",textContent:""}]};return fp(o)}function sBt(e,t,n){let i=m5[n],o=m5.animation_pathWingButton,r={tagName:"g",class:"cesium-animation-rectButton",transform:`translate(${e},${t})`,children:[{class:"cesium-animation-buttonGlow",id:"animation_pathWingButton",tagName:o.tagName,d:o.d},{class:"cesium-animation-buttonMain",id:"animation_pathWingButton",tagName:o.tagName,d:o.d},{class:"cesium-animation-buttonPath",id:n,tagName:i.tagName,transform:i.transform,d:i.d},{tagName:"title",textContent:""}]};return fp(r)}function aBt(e,t){let n=e._viewModel,i=n.shuttleRingDragging;if(!(i&&FJ!==e))if(t.type==="mousedown"||i&&t.type==="mousemove"||t.type==="touchstart"&&t.touches.length===1||i&&t.type==="touchmove"&&t.touches.length===1){let o=e._centerX,r=e._centerY,a=e._svgNode.getBoundingClientRect(),c,d;if(t.type==="touchstart"||t.type==="touchmove"?(c=t.touches[0].clientX,d=t.touches[0].clientY):(c=t.clientX,d=t.clientY),!i&&(c>a.right||c<a.left||d<a.top||d>a.bottom))return;let u=e._shuttleRingPointer.getBoundingClientRect(),m=c-o-a.left,p=d-r-a.top,b=Math.atan2(p,m)*180/Math.PI+90;b>180&&(b-=360);let f=n.shuttleRingAngle;i||c<u.right&&c>u.left&&d>u.top&&d<u.bottom?(FJ=e,n.shuttleRingDragging=!0,n.shuttleRingAngle=b):b<f?n.slower():b>f&&n.faster(),t.preventDefault()}else e===FJ&&(FJ=void 0),n.shuttleRingDragging=!1}function xy(e,t){this._viewModel=t,this.svgElement=e,this._enabled=void 0,this._toggled=void 0;let n=this;this._clickFunction=function(){let i=n._viewModel.command;i.canExecute&&i()},e.addEventListener("click",this._clickFunction,!0),this._subscriptions=[Sc(t,"toggled",this.setToggled,this),Sc(t,"tooltip",this.setTooltip,this),Sc(t.command,"canExecute",this.setEnabled,this)]}xy.prototype.destroy=function(){this.svgElement.removeEventListener("click",this._clickFunction,!0);let e=this._subscriptions;for(let t=0,n=e.length;t<n;t++)e[t].dispose();ue(this)};xy.prototype.isDestroyed=function(){return!1};xy.prototype.setEnabled=function(e){if(this._enabled!==e){if(this._enabled=e,!e){this.svgElement.setAttribute("class","cesium-animation-buttonDisabled");return}if(this._toggled){this.svgElement.setAttribute("class","cesium-animation-rectButton cesium-animation-buttonToggled");return}this.svgElement.setAttribute("class","cesium-animation-rectButton")}};xy.prototype.setToggled=function(e){this._toggled!==e&&(this._toggled=e,this._enabled&&(e?this.svgElement.setAttribute("class","cesium-animation-rectButton cesium-animation-buttonToggled"):this.svgElement.setAttribute("class","cesium-animation-rectButton")))};xy.prototype.setTooltip=function(e){this.svgElement.getElementsByTagName("title")[0].textContent=e};function kA(e,t){e=Nn(e),this._viewModel=t,this._container=e,this._centerX=0,this._centerY=0,this._defsElement=void 0,this._svgNode=void 0,this._topG=void 0,this._lastHeight=void 0,this._lastWidth=void 0;let n=e.ownerDocument,i=document.createElement("style");i.textContent=".cesium-animation-rectButton .cesium-animation-buttonGlow { filter: url(#animation_blurred); }.cesium-animation-rectButton .cesium-animation-buttonMain { fill: url(#animation_buttonNormal); }.cesium-animation-buttonToggled .cesium-animation-buttonMain { fill: url(#animation_buttonToggled); }.cesium-animation-rectButton:hover .cesium-animation-buttonMain { fill: url(#animation_buttonHovered); }.cesium-animation-buttonDisabled .cesium-animation-buttonMain { fill: url(#animation_buttonDisabled); }.cesium-animation-shuttleRingG .cesium-animation-shuttleRingSwoosh { fill: url(#animation_shuttleRingSwooshGradient); }.cesium-animation-shuttleRingG:hover .cesium-animation-shuttleRingSwoosh { fill: url(#animation_shuttleRingSwooshHovered); }.cesium-animation-shuttleRingPointer { fill: url(#animation_shuttleRingPointerGradient); }.cesium-animation-shuttleRingPausePointer { fill: url(#animation_shuttleRingPointerPaused); }.cesium-animation-knobOuter { fill: url(#animation_knobOuter); }.cesium-animation-knobInner { fill: url(#animation_knobInner); }",n.head.insertBefore(i,n.head.childNodes[0]);let o=document.createElement("div");o.className="cesium-animation-theme",o.innerHTML='<div class="cesium-animation-themeNormal"></div><div class="cesium-animation-themeHover"></div><div class="cesium-animation-themeSelect"></div><div class="cesium-animation-themeDisabled"></div><div class="cesium-animation-themeKnob"></div><div class="cesium-animation-themePointer"></div><div class="cesium-animation-themeSwoosh"></div><div class="cesium-animation-themeSwooshHover"></div>',this._theme=o,this._themeNormal=o.childNodes[0],this._themeHover=o.childNodes[1],this._themeSelect=o.childNodes[2],this._themeDisabled=o.childNodes[3],this._themeKnob=o.childNodes[4],this._themePointer=o.childNodes[5],this._themeSwoosh=o.childNodes[6],this._themeSwooshHover=o.childNodes[7];let r=document.createElementNS(Al,"svg:svg");this._svgNode=r,r.setAttributeNS("http://www.w3.org/2000/xmlns/","xmlns:xlink",sYe);let s=document.createElementNS(Al,"g");this._topG=s,this._realtimeSVG=new xy(sBt(3,4,"animation_pathClock"),t.playRealtimeViewModel),this._playReverseSVG=new xy(tle(44,99,"animation_pathPlayReverse"),t.playReverseViewModel),this._playForwardSVG=new xy(tle(124,99,"animation_pathPlay"),t.playForwardViewModel),this._pauseSVG=new xy(tle(84,99,"animation_pathPause"),t.pauseViewModel);let a=document.createElementNS(Al,"g");a.appendChild(this._realtimeSVG.svgElement),a.appendChild(this._playReverseSVG.svgElement),a.appendChild(this._playForwardSVG.svgElement),a.appendChild(this._pauseSVG.svgElement);let c=fp({tagName:"circle",class:"cesium-animation-shuttleRingBack",cx:100,cy:100,r:99});this._shuttleRingBackPanel=c;let d=m5.animation_pathSwooshFX,u=m5.animation_pathPointer,m=fp({tagName:"g",class:"cesium-animation-shuttleRingSwoosh",children:[{tagName:d.tagName,transform:"translate(100,97) scale(-1,1)",id:"animation_pathSwooshFX",d:d.d},{tagName:d.tagName,transform:"translate(100,97)",id:"animation_pathSwooshFX",d:d.d},{tagName:"line",x1:100,y1:8,x2:100,y2:22}]});this._shuttleRingSwooshG=m,this._shuttleRingPointer=fp({class:"cesium-animation-shuttleRingPointer",id:"animation_pathPointer",tagName:u.tagName,d:u.d});let p=fp({tagName:"g",transform:"translate(100,100)"});this._knobOuter=fp({tagName:"circle",class:"cesium-animation-knobOuter",cx:0,cy:0,r:71});let b=61,f=fp({tagName:"circle",class:"cesium-animation-knobInner",cx:0,cy:0,r:b}),y=tBt(0,-24);this._knobDate=y.element;let _=iBt(0,-7);this._knobTime=_.element,this._knobStatus=nle(0,-41,"");let S=fp({tagName:"circle",class:"cesium-animation-blank",cx:0,cy:0,r:b}),Z=document.createElementNS(Al,"g");Z.setAttribute("class","cesium-animation-shuttleRingG"),e.appendChild(o),s.appendChild(Z),s.appendChild(p),s.appendChild(a),Z.appendChild(c),Z.appendChild(m),Z.appendChild(this._shuttleRingPointer),p.appendChild(this._knobOuter),p.appendChild(f),p.appendChild(this._knobStatus),p.appendChild(S),p.appendChild(this._knobDate),p.appendChild(this._knobTime),r.appendChild(s),e.appendChild(r);let R=this;function C(L){aBt(R,L)}this._mouseCallback=C,c.addEventListener("mousedown",C,!0),c.addEventListener("touchstart",C,!0),m.addEventListener("mousedown",C,!0),m.addEventListener("touchstart",C,!0),n.addEventListener("mousemove",C,!0),n.addEventListener("touchmove",C,!0),n.addEventListener("mouseup",C,!0),n.addEventListener("touchend",C,!0),n.addEventListener("touchcancel",C,!0),this._shuttleRingPointer.addEventListener("mousedown",C,!0),this._shuttleRingPointer.addEventListener("touchstart",C,!0),this._knobOuter.addEventListener("mousedown",C,!0),this._knobOuter.addEventListener("touchstart",C,!0);let E=this._knobStatus.childNodes[0];this._fieldWheelListeners=[],rYe(this,y.parts,function(L,F){t.adjustDate(L,F)}),rYe(this,_.parts,function(L,F){t.adjustTime(L,F)});let A;this._subscriptions=[Sc(t.pauseViewModel,"toggled",function(L){A!==L&&(A=L,A?R._shuttleRingPointer.setAttribute("class","cesium-animation-shuttleRingPausePointer"):R._shuttleRingPointer.setAttribute("class","cesium-animation-shuttleRingPointer"))}),Sc(t,"shuttleRingAngle",function(L){rBt(R._shuttleRingPointer,R._knobOuter,L)}),Sc(t,"dateLabel",function(L){R._knobDate.textContent!==L&&nBt(y,L)}),Sc(t,"timeLabel",function(L){R._knobTime.textContent!==L&&oBt(_,L)}),Sc(t,"multiplierLabel",function(L){E.textContent!==L&&(E.textContent=L)})],this.applyThemeChanges(),this.resize()}Object.defineProperties(kA.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}}});kA.prototype.isDestroyed=function(){return!1};kA.prototype.destroy=function(){l(this._observer)&&(this._observer.disconnect(),this._observer=void 0);let e=this._container.ownerDocument,t=this._mouseCallback;this._shuttleRingBackPanel.removeEventListener("mousedown",t,!0),this._shuttleRingBackPanel.removeEventListener("touchstart",t,!0),this._shuttleRingSwooshG.removeEventListener("mousedown",t,!0),this._shuttleRingSwooshG.removeEventListener("touchstart",t,!0),e.removeEventListener("mousemove",t,!0),e.removeEventListener("touchmove",t,!0),e.removeEventListener("mouseup",t,!0),e.removeEventListener("touchend",t,!0),e.removeEventListener("touchcancel",t,!0),this._shuttleRingPointer.removeEventListener("mousedown",t,!0),this._shuttleRingPointer.removeEventListener("touchstart",t,!0),this._knobOuter.removeEventListener("mousedown",t,!0),this._knobOuter.removeEventListener("touchstart",t,!0);let n=this._fieldWheelListeners;for(let o=0;o<n.length;++o){let r=n[o];r.element.removeEventListener("wheel",r.listener,!1)}this._container.removeChild(this._svgNode),this._container.removeChild(this._theme),this._realtimeSVG.destroy(),this._playReverseSVG.destroy(),this._playForwardSVG.destroy(),this._pauseSVG.destroy();let i=this._subscriptions;for(let o=0,r=i.length;o<r;o++)i[o].dispose();return ue(this)};kA.prototype.resize=function(){let e=this._container.clientWidth,t=this._container.clientHeight;if(e===this._lastWidth&&t===this._lastHeight)return;let n=this._svgNode,i=200,o=132,r=e,s=t;e===0&&t===0?(r=i,s=o):e===0?(s=t,r=i*(t/o)):t===0&&(r=e,s=o*(e/i));let a=r/i,c=s/o;n.style.cssText=`width: ${r}px; height: ${s}px; position: absolute; bottom: 0; left: 0; overflow: hidden;`,n.setAttribute("width",r),n.setAttribute("height",s),n.setAttribute("viewBox",`0 0 ${r} ${s}`),this._topG.setAttribute("transform",`scale(${a},${c})`),this._centerX=Math.max(1,100*a),this._centerY=Math.max(1,100*c),this._lastHeight=e,this._lastWidth=t};kA.prototype.applyThemeChanges=function(){let e=this._container.ownerDocument;if(!e.body.contains(this._container)){if(l(this._observer))return;let u=this;u._observer=new MutationObserver(function(){e.body.contains(u._container)&&(u._observer.disconnect(),u._observer=void 0,u.applyThemeChanges())}),u._observer.observe(e,{childList:!0,subtree:!0});return}let t=UT(this._themeNormal),n=UT(this._themeHover),i=UT(this._themeSelect),o=UT(this._themeDisabled),r=UT(this._themeKnob),s=UT(this._themePointer),a=UT(this._themeSwoosh),c=UT(this._themeSwooshHover),d=fp({tagName:"defs",children:[{id:"animation_buttonNormal",tagName:"linearGradient",x1:"50%",y1:"0%",x2:"50%",y2:"100%",children:[{tagName:"stop",offset:"0%","stop-color":zs(t,u5)},{tagName:"stop",offset:"12%","stop-color":zs(t,IJ)},{tagName:"stop",offset:"46%","stop-color":zs(t,ele)},{tagName:"stop",offset:"81%","stop-color":zs(t,PJ)}]},{id:"animation_buttonHovered",tagName:"linearGradient",x1:"50%",y1:"0%",x2:"50%",y2:"100%",children:[{tagName:"stop",offset:"0%","stop-color":zs(n,u5)},{tagName:"stop",offset:"12%","stop-color":zs(n,IJ)},{tagName:"stop",offset:"46%","stop-color":zs(n,ele)},{tagName:"stop",offset:"81%","stop-color":zs(n,PJ)}]},{id:"animation_buttonToggled",tagName:"linearGradient",x1:"50%",y1:"0%",x2:"50%",y2:"100%",children:[{tagName:"stop",offset:"0%","stop-color":zs(i,u5)},{tagName:"stop",offset:"12%","stop-color":zs(i,IJ)},{tagName:"stop",offset:"46%","stop-color":zs(i,ele)},{tagName:"stop",offset:"81%","stop-color":zs(i,PJ)}]},{id:"animation_buttonDisabled",tagName:"linearGradient",x1:"50%",y1:"0%",x2:"50%",y2:"100%",children:[{tagName:"stop",offset:"0%","stop-color":zs(o,$Ot)},{tagName:"stop",offset:"75%","stop-color":zs(o,eBt)}]},{id:"animation_blurred",tagName:"filter",width:"200%",height:"200%",x:"-50%",y:"-50%",children:[{tagName:"feGaussianBlur",stdDeviation:4,in:"SourceGraphic"}]},{id:"animation_shuttleRingSwooshGradient",tagName:"linearGradient",x1:"50%",y1:"0%",x2:"50%",y2:"100%",children:[{tagName:"stop",offset:"0%","stop-opacity":.2,"stop-color":a.toCssColorString()},{tagName:"stop",offset:"85%","stop-opacity":.85,"stop-color":a.toCssColorString()},{tagName:"stop",offset:"95%","stop-opacity":.05,"stop-color":a.toCssColorString()}]},{id:"animation_shuttleRingSwooshHovered",tagName:"linearGradient",x1:"50%",y1:"0%",x2:"50%",y2:"100%",children:[{tagName:"stop",offset:"0%","stop-opacity":.2,"stop-color":c.toCssColorString()},{tagName:"stop",offset:"85%","stop-opacity":.85,"stop-color":c.toCssColorString()},{tagName:"stop",offset:"95%","stop-opacity":.05,"stop-color":c.toCssColorString()}]},{id:"animation_shuttleRingPointerGradient",tagName:"linearGradient",x1:"0%",y1:"50%",x2:"100%",y2:"50%",children:[{tagName:"stop",offset:"0%","stop-color":s.toCssColorString()},{tagName:"stop",offset:"40%","stop-color":s.toCssColorString()},{tagName:"stop",offset:"60%","stop-color":zs(s,oYe)},{tagName:"stop",offset:"100%","stop-color":zs(s,oYe)}]},{id:"animation_shuttleRingPointerPaused",tagName:"linearGradient",x1:"0%",y1:"50%",x2:"100%",y2:"50%",children:[{tagName:"stop",offset:"0%","stop-color":"#CCC"},{tagName:"stop",offset:"40%","stop-color":"#CCC"},{tagName:"stop",offset:"60%","stop-color":"#555"},{tagName:"stop",offset:"100%","stop-color":"#555"}]},{id:"animation_knobOuter",tagName:"linearGradient",x1:"20%",y1:"0%",x2:"90%",y2:"100%",children:[{tagName:"stop",offset:"5%","stop-color":zs(r,u5)},{tagName:"stop",offset:"60%","stop-color":zs(r,iYe)},{tagName:"stop",offset:"85%","stop-color":zs(r,IJ)}]},{id:"animation_knobInner",tagName:"linearGradient",x1:"20%",y1:"0%",x2:"90%",y2:"100%",children:[{tagName:"stop",offset:"5%","stop-color":zs(r,iYe)},{tagName:"stop",offset:"60%","stop-color":zs(r,u5)},{tagName:"stop",offset:"85%","stop-color":zs(r,PJ)}]}]});l(this._defsElement)?this._svgNode.replaceChild(d,this._defsElement):this._svgNode.appendChild(d),this._defsElement=d};var h5=kA;var eur=x(T(),1);var cBt=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],DT=15,UA=105,lBt=[31,28,31,30,31,30,31,31,30,31,30,31];function dBt(e,t){return t===2&&Pl(e)?29:lBt[t-1]}function aYe(e,t,n){return Q.fromGregorianDate(new vh(t,n,Math.min(e.day,dBt(t,n)),e.hour,e.minute,e.second,e.millisecond,e.isLeapSecond))}function cYe(e,t){return e-t}function ile(e,t){let n=Eo(t,e,cYe);return n<0?~n:n}function uBt(e,t){if(Math.abs(e)<=DT)return e/DT;let n=DT,i=UA,o,r=0,s;return e>0?(o=Math.log(t[t.length-1]),s=(o-r)/(i-n),Math.exp(r+s*(e-n))):(o=Math.log(-t[0]),s=(o-r)/(i-n),-Math.exp(r+s*(Math.abs(e)-n)))}function mBt(e,t,n){if(n.clockStep===Do.SYSTEM_CLOCK)return DT;if(Math.abs(e)<=1)return e*DT;let i=t[t.length-1];e>i?e=i:e<-i&&(e=-i);let o=DT,r=UA,s,a=0,c;return e>0?(s=Math.log(i),c=(s-a)/(r-o),(Math.log(e)-a)/c+o):(s=Math.log(-t[0]),c=(s-a)/(r-o),-((Math.log(Math.abs(e))-a)/c+o))}function pu(e){let t=this;this._clockViewModel=e,this._allShuttleRingTicks=[],this._dateFormatter=pu.defaultDateFormatter,this._timeFormatter=pu.defaultTimeFormatter,this.shuttleRingDragging=!1,this.snapToTicks=!1,Ee.track(this,["_allShuttleRingTicks","_dateFormatter","_timeFormatter","shuttleRingDragging","snapToTicks"]),this._sortedFilteredPositiveTicks=[],this.setShuttleRingTicks(pu.defaultTicks),this.timeLabel=void 0,Ee.defineProperty(this,"timeLabel",function(){return t._timeFormatter(t._clockViewModel.currentTime,t)}),this.dateLabel=void 0,Ee.defineProperty(this,"dateLabel",function(){return t._dateFormatter(t._clockViewModel.currentTime,t)}),this.multiplierLabel=void 0,Ee.defineProperty(this,"multiplierLabel",function(){let s=t._clockViewModel;if(s.clockStep===Do.SYSTEM_CLOCK)return"Today";let a=s.multiplier;return a%1===0?`${a.toFixed(0)}x`:`${a.toFixed(3).replace(/0{0,3}$/,"")}x`}),this.shuttleRingAngle=void 0,Ee.defineProperty(this,"shuttleRingAngle",{get:function(){return mBt(e.multiplier,t._allShuttleRingTicks,e)},set:function(s){s=Math.max(Math.min(s,UA),-UA);let a=t._allShuttleRingTicks,c=t._clockViewModel;if(c.clockStep=Do.SYSTEM_CLOCK_MULTIPLIER,Math.abs(s)===UA){c.multiplier=s>0?a[a.length-1]:a[0];return}let d=uBt(s,a);if(t.snapToTicks)d=a[ile(d,a)];else if(d!==0){let u=Math.abs(d);if(u>100){let m=u.toFixed(0).length-2,p=Math.pow(10,m);d=Math.round(d/p)*p|0}else u>DT?d=Math.round(d):u>1?d=+d.toFixed(1):u>0&&(d=+d.toFixed(2))}c.multiplier=d}}),this._canAnimate=void 0,Ee.defineProperty(this,"_canAnimate",function(){let s=t._clockViewModel,a=s.clockRange;if(t.shuttleRingDragging||a===bs.UNBOUNDED)return!0;let c=s.multiplier,d=s.currentTime,u=s.startTime,m;if(a===bs.LOOP_STOP)m=Q.greaterThan(d,u)||d.equals(u)&&c>0;else{let p=s.stopTime;m=Q.greaterThan(d,u)&&Q.lessThan(d,p)||d.equals(u)&&c>0||d.equals(p)&&c<0}return m||(s.shouldAnimate=!1),m}),this._isSystemTimeAvailable=void 0,Ee.defineProperty(this,"_isSystemTimeAvailable",function(){let s=t._clockViewModel;if(s.clockRange===bs.UNBOUNDED)return!0;let c=s.systemTime;return Q.greaterThanOrEquals(c,s.startTime)&&Q.lessThanOrEquals(c,s.stopTime)}),this._isAnimating=void 0,Ee.defineProperty(this,"_isAnimating",function(){return t._clockViewModel.shouldAnimate&&(t._canAnimate||t.shuttleRingDragging)});let n=Fn(function(){let s=t._clockViewModel;s.shouldAnimate?s.shouldAnimate=!1:t._canAnimate&&(s.shouldAnimate=!0)});this._pauseViewModel=new kT(n,{toggled:Ee.computed(function(){return!t._isAnimating}),tooltip:"Pause"});let i=Fn(function(){let s=t._clockViewModel,a=s.multiplier;a>0&&(s.multiplier=-a),s.shouldAnimate=!0});this._playReverseViewModel=new kT(i,{toggled:Ee.computed(function(){return t._isAnimating&&e.multiplier<0}),tooltip:"Play Reverse"});let o=Fn(function(){let s=t._clockViewModel,a=s.multiplier;a<0&&(s.multiplier=-a),s.shouldAnimate=!0});this._playForwardViewModel=new kT(o,{toggled:Ee.computed(function(){return t._isAnimating&&e.multiplier>0&&e.clockStep!==Do.SYSTEM_CLOCK}),tooltip:"Play Forward"});let r=Fn(function(){t._clockViewModel.clockStep=Do.SYSTEM_CLOCK},Ee.getObservable(this,"_isSystemTimeAvailable"));this._playRealtimeViewModel=new kT(r,{toggled:Ee.computed(function(){return e.clockStep===Do.SYSTEM_CLOCK}),tooltip:Ee.computed(function(){return t._isSystemTimeAvailable?"Today (real-time)":"Current time not in range"})}),this._slower=Fn(function(){let s=t._clockViewModel,a=t._allShuttleRingTicks,c=s.multiplier,d=ile(c,a)-1;d>=0&&(s.multiplier=a[d])}),this._faster=Fn(function(){let s=t._clockViewModel,a=t._allShuttleRingTicks,c=s.multiplier,d=ile(c,a)+1;d<a.length&&(s.multiplier=a[d])})}pu.defaultDateFormatter=function(e,t){let n=Q.toGregorianDate(e);return`${cBt[n.month-1]} ${n.day} ${n.year}`};pu.defaultTicks=[.001,.002,.005,.01,.02,.05,.1,.25,.5,1,2,5,10,15,30,60,120,300,600,900,1800,3600,7200,14400,21600,43200,86400,172800,345600,604800];pu.defaultTimeFormatter=function(e,t){let n=Q.toGregorianDate(e),i=Math.round(n.millisecond);return Math.abs(t._clockViewModel.multiplier)<1?`${n.hour.toString().padStart(2,"0")}:${n.minute.toString().padStart(2,"0")}:${n.second.toString().padStart(2,"0")}.${i.toString().padStart(3,"0")}`:`${n.hour.toString().padStart(2,"0")}:${n.minute.toString().padStart(2,"0")}:${n.second.toString().padStart(2,"0")} UTC`};pu.prototype.getShuttleRingTicks=function(){return this._sortedFilteredPositiveTicks.slice(0)};pu.prototype.setShuttleRingTicks=function(e){let t,n,i,o={},r=this._sortedFilteredPositiveTicks;for(r.length=0,t=0,n=e.length;t<n;++t)i=e[t],o.hasOwnProperty(i)||(o[i]=!0,r.push(i));r.sort(cYe);let s=[];for(n=r.length,t=n-1;t>=0;--t)i=r[t],i!==0&&s.push(-i);ei(s,r),this._allShuttleRingTicks=s};pu.prototype.adjustDate=function(e,t){if(t===0)return;let n=this._clockViewModel,i=n.currentTime,o=Q.toGregorianDate(i),r;if(e==="day"){r=Q.addDays(i,t,new Q);let s=Q.toGregorianDate(r);if(s.year<1||s.year>9999)return}else if(e==="month"){let a=Math.min(Math.max((o.year-1)*12+o.month-1+t,0),119987),c=Math.floor(a/12)+1,d=a%12+1;r=aYe(o,c,d)}else{let s=Math.min(Math.max(o.year+t,1),9999);r=aYe(o,s,o.month)}Q.equals(i,r)||(n.shouldAnimate=!1,n.currentTime=r)};pu.prototype.adjustTime=function(e,t){if(t===0)return;let n=this._clockViewModel,i=n.currentTime,o;if(e==="hour")o=Q.addHours(i,t,new Q);else if(e==="minute")o=Q.addMinutes(i,t,new Q);else{let s=e==="second"?t:t/1e3;o=Q.addSeconds(i,s,new Q)}let r=Q.toGregorianDate(o);r.year<1||r.year>9999||(n.shouldAnimate=!1,n.currentTime=o)};Object.defineProperties(pu.prototype,{slower:{get:function(){return this._slower}},faster:{get:function(){return this._faster}},clockViewModel:{get:function(){return this._clockViewModel}},pauseViewModel:{get:function(){return this._pauseViewModel}},playReverseViewModel:{get:function(){return this._playReverseViewModel}},playForwardViewModel:{get:function(){return this._playForwardViewModel}},playRealtimeViewModel:{get:function(){return this._playRealtimeViewModel}},dateFormatter:{get:function(){return this._dateFormatter},set:function(e){this._dateFormatter=e}},timeFormatter:{get:function(){return this._timeFormatter},set:function(e){this._timeFormatter=e}}});pu._maxShuttleRingAngle=UA;pu._realtimeShuttleRingAngle=DT;var f5=pu;var mur=x(T(),1);var rur=x(T(),1);function hBt(e){return function(t){let n=e._scene.pick(t.position);l(n)&&n.primitive instanceof Hr&&(e.tileset=n.primitive),e.pickActive=!1}}function dYe(e,t){t?e._eventHandler.setInputAction(function(n){let i=e._scene.pick(n.endPosition);l(i)&&i.primitive instanceof Hr&&(e.tileset=i.primitive)},mn.MOUSE_MOVE):(e._eventHandler.removeInputAction(mn.MOUSE_MOVE),e.picking=e.picking)}var fBt={maximumFractionDigits:3};function p5(e){let t=e/1048576;return t<1?t.toLocaleString(void 0,fBt):Math.round(t).toLocaleString()}function b5(e,t){if(!l(e))return"";let n=t?e._statisticsPerPass[lr.PICK]:e._statisticsPerPass[lr.RENDER],i='<ul class="cesium-cesiumInspector-statistics">';return i+=`<li><strong>Visited: </strong>${n.visited.toLocaleString()}</li><li><strong>Selected: </strong>${n.selected.toLocaleString()}</li><li><strong>Commands: </strong>${n.numberOfCommands.toLocaleString()}</li>`,i+="</ul>",t||(i+='<ul class="cesium-cesiumInspector-statistics">',i+=`<li><strong>Requests: </strong>${n.numberOfPendingRequests.toLocaleString()}</li><li><strong>Attempted: </strong>${n.numberOfAttemptedRequests.toLocaleString()}</li><li><strong>Processing: </strong>${n.numberOfTilesProcessing.toLocaleString()}</li><li><strong>Content Ready: </strong>${n.numberOfTilesWithContentReady.toLocaleString()}</li><li><strong>Total: </strong>${n.numberOfTilesTotal.toLocaleString()}</li>`,i+="</ul>",i+='<ul class="cesium-cesiumInspector-statistics">',i+=`<li><strong>Features Selected: </strong>${n.numberOfFeaturesSelected.toLocaleString()}</li><li><strong>Features Loaded: </strong>${n.numberOfFeaturesLoaded.toLocaleString()}</li><li><strong>Points Selected: </strong>${n.numberOfPointsSelected.toLocaleString()}</li><li><strong>Points Loaded: </strong>${n.numberOfPointsLoaded.toLocaleString()}</li><li><strong>Triangles Selected: </strong>${n.numberOfTrianglesSelected.toLocaleString()}</li>`,i+="</ul>",i+='<ul class="cesium-cesiumInspector-statistics">',i+=`<li><strong>Tiles styled: </strong>${n.numberOfTilesStyled.toLocaleString()}</li><li><strong>Features styled: </strong>${n.numberOfFeaturesStyled.toLocaleString()}</li>`,i+="</ul>",i+='<ul class="cesium-cesiumInspector-statistics">',i+=`<li><strong>Children Union Culled: </strong>${n.numberOfTilesCulledWithChildrenUnion.toLocaleString()}</li>`,i+="</ul>",i+='<ul class="cesium-cesiumInspector-statistics">',i+=`<li><strong>Geometry Memory (MB): </strong>${p5(n.geometryByteLength)}</li><li><strong>Texture Memory (MB): </strong>${p5(n.texturesByteLength)}</li><li><strong>Batch Table Memory (MB): </strong>${p5(n.batchTableByteLength)}</li>`,i+="</ul>"),i}function uYe(){let e=Yi.statistics;return` + <ul class="cesium-cesiumInspector-statistics"> + <li><strong>Geometry Memory (MB): </strong>${p5(e.geometryByteLength)}</li> + <li><strong>Texture Memory (MB): </strong>${p5(e.texturesByteLength)}</li> + </ul> + `}var pBt=[{text:"Highlight",value:Ud.HIGHLIGHT},{text:"Replace",value:Ud.REPLACE},{text:"Mix",value:Ud.MIX}],lYe=new U(1,1,0,.4),bBt=new U,NJ=new U;function Zc(e,t){let n=this,i=e.canvas;this._eventHandler=new oa(i),this._scene=e,this._performanceContainer=t,this._canvas=i,this._performanceDisplay=new Ig({container:t}),this._statisticsText="",this._pickStatisticsText="",this._resourceCacheStatisticsText="",this._editorError="",this.performance=!1,this.showStatistics=!0,this.showPickStatistics=!0,this.showResourceCacheStatistics=!1,this.inspectorVisible=!0,this.tilesetVisible=!1,this.displayVisible=!1,this.updateVisible=!1,this.loggingVisible=!1,this.styleVisible=!1,this.tileDebugLabelsVisible=!1,this.optimizationVisible=!1,this.styleString="{}",this.hasEnabledWireframe=!1,this._tileset=void 0,this._feature=void 0,this._tile=void 0,Ee.track(this,["performance","inspectorVisible","_statisticsText","_pickStatisticsText","_resourceCacheStatisticsText","_editorError","showPickStatistics","showStatistics","showResourceCacheStatistics","tilesetVisible","displayVisible","updateVisible","loggingVisible","styleVisible","optimizationVisible","tileDebugLabelsVisible","styleString","_feature","_tile","_tileset","hasEnabledWireframe"]),this._properties=Ee.observable({}),this.properties=[],Ee.defineProperty(this,"properties",function(){let w=[],z=n._properties();for(let K in z)z.hasOwnProperty(K)&&w.push(K);return w});let o=Ee.observable();Ee.defineProperty(this,"dynamicScreenSpaceError",{get:function(){return o()},set:function(w){o(w),l(n._tileset)&&(n._tileset.dynamicScreenSpaceError=w)}}),this.dynamicScreenSpaceError=!1;let r=Ee.observable();Ee.defineProperty(this,"colorBlendMode",{get:function(){return r()},set:function(w){r(w),l(n._tileset)&&(n._tileset.colorBlendMode=w,n._scene.requestRender())}}),this.colorBlendMode=Ud.HIGHLIGHT;let s=Ee.observable(),a=Ee.observable();Ee.defineProperty(this,"picking",{get:function(){return a()},set:function(w){a(w),w?n._eventHandler.setInputAction(function(z){let K=e.pick(z.endPosition);if(K instanceof ia?(n.feature=K,n.tile=K.content.tile):l(K)&&l(K.content)?(n.feature=void 0,n.tile=K.content.tile):(n.feature=void 0,n.tile=void 0),!!l(n._tileset)){if(s&&l(K)&&l(K.content)){let te;e.pickPositionSupported&&(te=e.pickPosition(z.endPosition),l(te)&&(n._tileset.debugPickPosition=te)),n._tileset.debugPickedTile=K.content.tile}else n._tileset.debugPickedTile=void 0;n._scene.requestRender()}},mn.MOUSE_MOVE):(n.feature=void 0,n.tile=void 0,n._eventHandler.removeInputAction(mn.MOUSE_MOVE))}}),this.picking=!0;let c=Ee.observable();Ee.defineProperty(this,"colorize",{get:function(){return c()},set:function(w){c(w),l(n._tileset)&&(n._tileset.debugColorizeTiles=w,n._scene.requestRender())}}),this.colorize=!1;let d=Ee.observable();Ee.defineProperty(this,"wireframe",{get:function(){return d()},set:function(w){d(w),l(n._tileset)&&(n._tileset.debugWireframe=w,n._scene.requestRender())}}),this.wireframe=!1;let u=Ee.observable();Ee.defineProperty(this,"showBoundingVolumes",{get:function(){return u()},set:function(w){u(w),l(n._tileset)&&(n._tileset.debugShowBoundingVolume=w,n._scene.requestRender())}}),this.showBoundingVolumes=!1;let m=Ee.observable();Ee.defineProperty(this,"showContentBoundingVolumes",{get:function(){return m()},set:function(w){m(w),l(n._tileset)&&(n._tileset.debugShowContentBoundingVolume=w,n._scene.requestRender())}}),this.showContentBoundingVolumes=!1;let p=Ee.observable();Ee.defineProperty(this,"showRequestVolumes",{get:function(){return p()},set:function(w){p(w),l(n._tileset)&&(n._tileset.debugShowViewerRequestVolume=w,n._scene.requestRender())}}),this.showRequestVolumes=!1;let b=Ee.observable();Ee.defineProperty(this,"freezeFrame",{get:function(){return b()},set:function(w){b(w),l(n._tileset)&&(n._tileset.debugFreezeFrame=w,n._scene.debugShowFrustumPlanes=w,n._scene.requestRender())}}),this.freezeFrame=!1,Ee.defineProperty(this,"showOnlyPickedTileDebugLabel",{get:function(){return s()},set:function(w){s(w),l(n._tileset)&&(n._tileset.debugPickedTileLabelOnly=w,n._scene.requestRender())}}),this.showOnlyPickedTileDebugLabel=!1;let f=Ee.observable();Ee.defineProperty(this,"showGeometricError",{get:function(){return f()},set:function(w){f(w),l(n._tileset)&&(n._tileset.debugShowGeometricError=w,n._scene.requestRender())}}),this.showGeometricError=!1;let y=Ee.observable();Ee.defineProperty(this,"showRenderingStatistics",{get:function(){return y()},set:function(w){y(w),l(n._tileset)&&(n._tileset.debugShowRenderingStatistics=w,n._scene.requestRender())}}),this.showRenderingStatistics=!1;let _=Ee.observable();Ee.defineProperty(this,"showMemoryUsage",{get:function(){return _()},set:function(w){_(w),l(n._tileset)&&(n._tileset.debugShowMemoryUsage=w,n._scene.requestRender())}}),this.showMemoryUsage=!1;let S=Ee.observable();Ee.defineProperty(this,"showUrl",{get:function(){return S()},set:function(w){S(w),l(n._tileset)&&(n._tileset.debugShowUrl=w,n._scene.requestRender())}}),this.showUrl=!1;let Z=Ee.observable();Ee.defineProperty(this,"maximumScreenSpaceError",{get:function(){return Z()},set:function(w){w=Number(w),isNaN(w)||(Z(w),l(n._tileset)&&(n._tileset.maximumScreenSpaceError=w))}}),this.maximumScreenSpaceError=16;let R=Ee.observable();Ee.defineProperty(this,"dynamicScreenSpaceErrorDensity",{get:function(){return R()},set:function(w){w=Number(w),isNaN(w)||(R(w),l(n._tileset)&&(n._tileset.dynamicScreenSpaceErrorDensity=w))}}),this.dynamicScreenSpaceErrorDensity=2e-4,this.dynamicScreenSpaceErrorDensitySliderValue=void 0,Ee.defineProperty(this,"dynamicScreenSpaceErrorDensitySliderValue",{get:function(){return Math.pow(R(),1/6)},set:function(w){let z=Math.pow(w,6);R(z),l(n._tileset)&&(n._tileset.dynamicScreenSpaceErrorDensity=z)}});let C=Ee.observable();Ee.defineProperty(this,"dynamicScreenSpaceErrorFactor",{get:function(){return C()},set:function(w){w=Number(w),isNaN(w)||(C(w),l(n._tileset)&&(n._tileset.dynamicScreenSpaceErrorFactor=w))}}),this.dynamicScreenSpaceErrorFactor=24;let E=hBt(this),A=Ee.observable();Ee.defineProperty(this,"pickActive",{get:function(){return A()},set:function(w){A(w),w?n._eventHandler.setInputAction(E,mn.LEFT_CLICK):n._eventHandler.removeInputAction(mn.LEFT_CLICK)}});let L=Ee.observable();Ee.defineProperty(this,"pointCloudShading",{get:function(){return L()},set:function(w){L(w),l(n._tileset)&&(n._tileset.pointCloudShading.attenuation=w)}}),this.pointCloudShading=!1;let F=Ee.observable();Ee.defineProperty(this,"geometricErrorScale",{get:function(){return F()},set:function(w){w=Number(w),isNaN(w)||(F(w),l(n._tileset)&&(n._tileset.pointCloudShading.geometricErrorScale=w))}}),this.geometricErrorScale=1;let I=Ee.observable();Ee.defineProperty(this,"maximumAttenuation",{get:function(){return I()},set:function(w){w=Number(w),isNaN(w)||(I(w),l(n._tileset)&&(n._tileset.pointCloudShading.maximumAttenuation=w===0?void 0:w))}}),this.maximumAttenuation=0;let N=Ee.observable();Ee.defineProperty(this,"baseResolution",{get:function(){return N()},set:function(w){w=Number(w),isNaN(w)||(N(w),l(n._tileset)&&(n._tileset.pointCloudShading.baseResolution=w===0?void 0:w))}}),this.baseResolution=0;let g=Ee.observable();Ee.defineProperty(this,"eyeDomeLighting",{get:function(){return g()},set:function(w){g(w),l(n._tileset)&&(n._tileset.pointCloudShading.eyeDomeLighting=w)}}),this.eyeDomeLighting=!1;let V=Ee.observable();Ee.defineProperty(this,"eyeDomeLightingStrength",{get:function(){return V()},set:function(w){w=Number(w),isNaN(w)||(V(w),l(n._tileset)&&(n._tileset.pointCloudShading.eyeDomeLightingStrength=w))}}),this.eyeDomeLightingStrength=1;let G=Ee.observable();Ee.defineProperty(this,"eyeDomeLightingRadius",{get:function(){return G()},set:function(w){w=Number(w),isNaN(w)||(G(w),l(n._tileset)&&(n._tileset.pointCloudShading.eyeDomeLightingRadius=w))}}),this.eyeDomeLightingRadius=1,this.pickActive=!1;let v=Ee.observable();Ee.defineProperty(this,"skipLevelOfDetail",{get:function(){return v()},set:function(w){v(w),l(n._tileset)&&(n._tileset.skipLevelOfDetail=w)}}),this.skipLevelOfDetail=!0;let X=Ee.observable();Ee.defineProperty(this,"skipScreenSpaceErrorFactor",{get:function(){return X()},set:function(w){w=Number(w),isNaN(w)||(X(w),l(n._tileset)&&(n._tileset.skipScreenSpaceErrorFactor=w))}}),this.skipScreenSpaceErrorFactor=16;let Y=Ee.observable();Ee.defineProperty(this,"baseScreenSpaceError",{get:function(){return Y()},set:function(w){w=Number(w),isNaN(w)||(Y(w),l(n._tileset)&&(n._tileset.baseScreenSpaceError=w))}}),this.baseScreenSpaceError=1024;let D=Ee.observable();Ee.defineProperty(this,"skipLevels",{get:function(){return D()},set:function(w){w=Number(w),isNaN(w)||(D(w),l(n._tileset)&&(n._tileset.skipLevels=w))}}),this.skipLevels=1;let M=Ee.observable();Ee.defineProperty(this,"immediatelyLoadDesiredLevelOfDetail",{get:function(){return M()},set:function(w){M(w),l(n._tileset)&&(n._tileset.immediatelyLoadDesiredLevelOfDetail=w)}}),this.immediatelyLoadDesiredLevelOfDetail=!1;let O=Ee.observable();Ee.defineProperty(this,"loadSiblings",{get:function(){return O()},set:function(w){O(w),l(n._tileset)&&(n._tileset.loadSiblings=w)}}),this.loadSiblings=!1,this._style=void 0,this._shouldStyle=!1,this._definedProperties=["properties","dynamicScreenSpaceError","colorBlendMode","picking","colorize","wireframe","showBoundingVolumes","showContentBoundingVolumes","showRequestVolumes","freezeFrame","maximumScreenSpaceError","dynamicScreenSpaceErrorDensity","baseScreenSpaceError","skipScreenSpaceErrorFactor","skipLevelOfDetail","skipLevels","immediatelyLoadDesiredLevelOfDetail","loadSiblings","dynamicScreenSpaceErrorDensitySliderValue","dynamicScreenSpaceErrorFactor","pickActive","showOnlyPickedTileDebugLabel","showGeometricError","showRenderingStatistics","showMemoryUsage","showUrl","pointCloudShading","geometricErrorScale","maximumAttenuation","baseResolution","eyeDomeLighting","eyeDomeLightingStrength","eyeDomeLightingRadius"],this._removePostRenderEvent=e.postRender.addEventListener(function(){n._update()}),l(this._tileset)||dYe(this,!0)}Object.defineProperties(Zc.prototype,{scene:{get:function(){return this._scene}},performanceContainer:{get:function(){return this._performanceContainer}},statisticsText:{get:function(){return this._statisticsText}},pickStatisticsText:{get:function(){return this._pickStatisticsText}},resourceCacheStatisticsText:{get:function(){return this._resourceCacheStatisticsText}},colorBlendModes:{get:function(){return pBt}},editorError:{get:function(){return this._editorError}},tileset:{get:function(){return this._tileset},set:function(e){if(this._tileset=e,this._style=void 0,this.styleString="{}",this.feature=void 0,this.tile=void 0,l(e)){this._properties(e.properties);let t=["colorize","wireframe","showBoundingVolumes","showContentBoundingVolumes","showRequestVolumes","freezeFrame","showOnlyPickedTileDebugLabel","showGeometricError","showRenderingStatistics","showMemoryUsage","showUrl"],n=t.length;for(let o=0;o<n;++o){let r=t[o];this[r]=this[r]}this.maximumScreenSpaceError=e.maximumScreenSpaceError,this.dynamicScreenSpaceError=e.dynamicScreenSpaceError,this.dynamicScreenSpaceErrorDensity=e.dynamicScreenSpaceErrorDensity,this.dynamicScreenSpaceErrorFactor=e.dynamicScreenSpaceErrorFactor,this.colorBlendMode=e.colorBlendMode,this.skipLevelOfDetail=e.skipLevelOfDetail,this.skipScreenSpaceErrorFactor=e.skipScreenSpaceErrorFactor,this.baseScreenSpaceError=e.baseScreenSpaceError,this.skipLevels=e.skipLevels,this.immediatelyLoadDesiredLevelOfDetail=e.immediatelyLoadDesiredLevelOfDetail,this.loadSiblings=e.loadSiblings,this.hasEnabledWireframe=e._enableDebugWireframe;let i=e.pointCloudShading;this.pointCloudShading=i.attenuation,this.geometricErrorScale=i.geometricErrorScale,this.maximumAttenuation=i.maximumAttenuation?i.maximumAttenuation:0,this.baseResolution=i.baseResolution?i.baseResolution:0,this.eyeDomeLighting=i.eyeDomeLighting,this.eyeDomeLightingStrength=i.eyeDomeLightingStrength,this.eyeDomeLightingRadius=i.eyeDomeLightingRadius,this._scene.requestRender()}else this._properties({});this._statisticsText=b5(e,!1),this._pickStatisticsText=b5(e,!0),this._resourceCacheStatisticsText=uYe(),dYe(this,!1)}},feature:{get:function(){return this._feature},set:function(e){if(this._feature===e)return;let t=this._feature;l(t)&&!t.content.isDestroyed()&&(!this.colorize&&l(this._style)?t.color=l(this._style.color)?this._style.color.evaluateColor(t,bBt):U.WHITE:t.color=NJ,this._scene.requestRender()),l(e)&&(U.clone(e.color,NJ),e.color=lYe,this._scene.requestRender()),this._feature=e}},tile:{get:function(){return this._tile},set:function(e){if(this._tile===e)return;let t=this._tile;l(t)&&!t.isDestroyed()&&!ole(t.content)&&(t.color=NJ,this._scene.requestRender()),l(e)&&!ole(e.content)&&(U.clone(e.color,NJ),e.color=lYe,this._scene.requestRender()),this._tile=e}}});function ole(e){if(!l(e))return!1;if(e.featuresLength>0)return!0;let t=e.innerContents;if(l(t)){let n=t.length;for(let i=0;i<n;++i)if(!ole(t[i]))return!1;return!0}return!1}Zc.prototype.togglePickTileset=function(){this.pickActive=!this.pickActive};Zc.prototype.toggleInspector=function(){this.inspectorVisible=!this.inspectorVisible};Zc.prototype.toggleTileset=function(){this.tilesetVisible=!this.tilesetVisible};Zc.prototype.toggleDisplay=function(){this.displayVisible=!this.displayVisible};Zc.prototype.toggleUpdate=function(){this.updateVisible=!this.updateVisible};Zc.prototype.toggleLogging=function(){this.loggingVisible=!this.loggingVisible};Zc.prototype.toggleStyle=function(){this.styleVisible=!this.styleVisible};Zc.prototype.toggleTileDebugLabels=function(){this.tileDebugLabelsVisible=!this.tileDebugLabelsVisible};Zc.prototype.toggleOptimization=function(){this.optimizationVisible=!this.optimizationVisible};Zc.prototype.trimTilesCache=function(){l(this._tileset)&&this._tileset.trimLoadedTiles()};Zc.prototype.compileStyle=function(){let e=this._tileset;if(!(!l(e)||this.styleString===JSON.stringify(e.style))){this._editorError="";try{this.styleString.length===0&&(this.styleString="{}"),this._style=new bg(JSON.parse(this.styleString)),this._shouldStyle=!0,this._scene.requestRender()}catch(t){this._editorError=t.toString()}this.feature=this._feature,this.tile=this._tile}};Zc.prototype.styleEditorKeyPress=function(e,t){if(t.keyCode===9){t.preventDefault();let n=t.target,i=n.selectionStart,o=n.selectionEnd,r=o,a=n.value.slice(i,o).split(` +`),c=a.length,d;if(t.shiftKey)for(d=0;d<c;++d)a[d][0]===" "&&(a[d][1]===" "?(a[d]=a[d].substr(2),r-=2):(a[d]=a[d].substr(1),r-=1));else for(d=0;d<c;++d)a[d]=` ${a[d]}`,r+=2;let u=a.join(` +`);n.value=n.value.slice(0,i)+u+n.value.slice(o),n.selectionStart=i!==o?i:r,n.selectionEnd=r}else t.ctrlKey&&(t.keyCode===10||t.keyCode===13)&&this.compileStyle();return!0};Zc.prototype._update=function(){let e=this._tileset;if(this.performance&&this._performanceDisplay.update(),l(e)){if(e.isDestroyed()){this.tile=void 0,this.feature=void 0,this.tileset=void 0;return}let t=e.style;this._style!==e.style&&(this._shouldStyle?(e.style=this._style,this._shouldStyle=!1):(this._style=t,this.styleString=JSON.stringify(t.style,null," ")))}this.showStatistics&&(this._statisticsText=b5(e,!1),this._pickStatisticsText=b5(e,!0),this._resourceCacheStatisticsText=uYe())};Zc.prototype.isDestroyed=function(){return!1};Zc.prototype.destroy=function(){this._eventHandler.destroy(),this._removePostRenderEvent();let e=this;return this._definedProperties.forEach(function(t){Ee.getObservable(e,t).dispose()}),ue(this)};Zc.getStatistics=b5;var g5=Zc;function YJ(e,t){e=Nn(e);let n=document.createElement("div"),i=document.createElement("div");i.setAttribute("data-bind","visible: performance");let o=new g5(t,i);this._viewModel=o,this._container=e,this._element=n;let r=document.createElement("div");r.textContent="3D Tiles Inspector",r.className="cesium-cesiumInspector-button",r.setAttribute("data-bind","click: toggleInspector"),n.appendChild(r),n.className="cesium-cesiumInspector cesium-3DTilesInspector",n.setAttribute("data-bind",'css: { "cesium-cesiumInspector-visible" : inspectorVisible, "cesium-cesiumInspector-hidden" : !inspectorVisible}'),e.appendChild(n);let s=document.createElement("div");s.className="cesium-cesiumInspector-dropDown",n.appendChild(s);let a=fu.createSection,c=fu.createCheckbox,d=fu.createRangeInput,u=fu.createButton,m=a(s,"Tileset","tilesetVisible","toggleTileset"),p=a(s,"Display","displayVisible","toggleDisplay"),b=a(s,"Update","updateVisible","toggleUpdate"),f=a(s,"Logging","loggingVisible","toggleLogging"),y=a(s,"Tile Debug Labels","tileDebugLabelsVisible","toggleTileDebugLabels"),_=a(s,"Style","styleVisible","toggleStyle"),S=a(s,"Optimization","optimizationVisible","toggleOptimization"),Z=document.createElement("div");Z.className="field-group";let R=document.createElement("label");R.className="field-label",R.appendChild(document.createTextNode("Properties: "));let C=document.createElement("div");C.setAttribute("data-bind","text: properties"),Z.appendChild(R),Z.appendChild(C),m.appendChild(Z),m.appendChild(u("Pick Tileset","togglePickTileset","pickActive")),m.appendChild(u("Trim Tiles Cache","trimTilesCache")),m.appendChild(c("Enable Picking","picking")),p.appendChild(c("Colorize","colorize"));let E=p.appendChild(c("Wireframe","wireframe","_tileset === undefined || hasEnabledWireframe")),A=document.createElement("p");A.setAttribute("data-bind","visible: _tileset !== undefined && !hasEnabledWireframe"),A.setAttribute("class","cesium-3DTilesInspector-disabledElementsInfo"),A.innerText="Set enableDebugWireframe to true in the tileset constructor to enable this option.",E.appendChild(A),p.appendChild(c("Bounding Volumes","showBoundingVolumes")),p.appendChild(c("Content Volumes","showContentBoundingVolumes")),p.appendChild(c("Request Volumes","showRequestVolumes")),p.appendChild(c("Point Cloud Shading","pointCloudShading"));let L=document.createElement("div");L.setAttribute("data-bind","visible: pointCloudShading"),L.appendChild(d("Geometric Error Scale","geometricErrorScale",0,2,.01)),L.appendChild(d("Maximum Attenuation","maximumAttenuation",0,32,1)),L.appendChild(d("Base Resolution","baseResolution",0,1,.01)),L.appendChild(c("Eye Dome Lighting (EDL)","eyeDomeLighting")),p.appendChild(L);let F=document.createElement("div");F.setAttribute("data-bind","visible: eyeDomeLighting"),F.appendChild(d("EDL Strength","eyeDomeLightingStrength",0,2,.1)),F.appendChild(d("EDL Radius","eyeDomeLightingRadius",0,4,.1)),L.appendChild(F),b.appendChild(c("Freeze Frame","freezeFrame")),b.appendChild(c("Dynamic Screen Space Error","dynamicScreenSpaceError"));let I=document.createElement("div");I.appendChild(d("Maximum Screen Space Error","maximumScreenSpaceError",0,128,1)),b.appendChild(I);let N=document.createElement("div");N.setAttribute("data-bind","visible: dynamicScreenSpaceError"),N.appendChild(d("Screen Space Error Density","dynamicScreenSpaceErrorDensitySliderValue",0,1,.005,"dynamicScreenSpaceErrorDensity")),N.appendChild(d("Screen Space Error Factor","dynamicScreenSpaceErrorFactor",1,32,.1)),b.appendChild(N),f.appendChild(c("Performance","performance")),f.appendChild(i),f.appendChild(c("Statistics","showStatistics"));let g=document.createElement("div");g.className="cesium-3dTilesInspector-statistics",g.setAttribute("data-bind","html: statisticsText, visible: showStatistics"),f.appendChild(g),f.appendChild(c("Pick Statistics","showPickStatistics"));let V=document.createElement("div");V.className="cesium-3dTilesInspector-statistics",V.setAttribute("data-bind","html: pickStatisticsText, visible: showPickStatistics"),f.appendChild(V),f.appendChild(c("Resource Cache Statistics","showResourceCacheStatistics"));let G=document.createElement("div");G.className="cesium-3dTilesInspector-statistics",G.setAttribute("data-bind","html: resourceCacheStatisticsText, visible: showResourceCacheStatistics"),f.appendChild(G);let v=document.createElement("div");_.appendChild(v),v.appendChild(document.createTextNode("Color Blend Mode: "));let X=document.createElement("select");X.setAttribute("data-bind",'options: colorBlendModes, optionsText: "text", optionsValue: "value", value: colorBlendMode'),v.appendChild(X);let Y=document.createElement("textarea");Y.setAttribute("data-bind","textInput: styleString, event: { keydown: styleEditorKeyPress }"),v.className="cesium-cesiumInspector-styleEditor",v.appendChild(Y);let D=u("Compile (Ctrl+Enter)","compileStyle");v.appendChild(D);let M=document.createElement("div");M.className="cesium-cesiumInspector-error",M.setAttribute("data-bind","text: editorError"),v.appendChild(M),y.appendChild(c("Show Picked Only","showOnlyPickedTileDebugLabel")),y.appendChild(c("Geometric Error","showGeometricError")),y.appendChild(c("Rendering Statistics","showRenderingStatistics")),y.appendChild(c("Memory Usage (MB)","showMemoryUsage")),y.appendChild(c("Url","showUrl")),S.appendChild(c("Skip Tile LODs","skipLevelOfDetail"));let O=document.createElement("div");O.appendChild(d("Skip SSE Factor","skipScreenSpaceErrorFactor",1,50,1)),S.appendChild(O);let w=document.createElement("div");w.appendChild(d("SSE before skipping LOD","baseScreenSpaceError",0,4096,1)),S.appendChild(w);let z=document.createElement("div");z.appendChild(d("Min. levels to skip","skipLevels",0,10,1)),S.appendChild(z),S.appendChild(c("Load only tiles that meet the max SSE.","immediatelyLoadDesiredLevelOfDetail")),S.appendChild(c("Load siblings of visible tiles","loadSiblings")),Ee.applyBindings(o,n)}Object.defineProperties(YJ.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}}});YJ.prototype.isDestroyed=function(){return!1};YJ.prototype.destroy=function(){return Ee.cleanNode(this._element),this._container.removeChild(this._element),this.viewModel.destroy(),ue(this)};var y5=YJ;var Vur=x(T(),1);var yur=x(T(),1);function gBt(e){let t;if(l(e)){t="Command Statistics";let n=e.commandsInFrustums;for(let i in n)if(n.hasOwnProperty(i)){let o=parseInt(i,10),r;if(o===7)r="1, 2 and 3";else{let s=[];for(let a=2;a>=0;a--){let c=Math.pow(2,a);o>=c&&(s.push(a+1),o-=c)}r=s.reverse().join(" and ")}t+=`<br>    ${n[i]} in frustum ${r}`}t+=`<br>Total: ${e.totalCommands}`}return t}function rle(e,t,n){let i=Math.min(n,t);return i=Math.max(i,e),i}var yBt=new gn,xBt=new h;function x5(e,t){let n=this,i=e.canvas,o=new oa(i);this._eventHandler=o,this._scene=e,this._canvas=i,this._primitive=void 0,this._tile=void 0,this._modelMatrixPrimitive=void 0,this._performanceDisplay=void 0,this._performanceContainer=t;let r=this._scene.globe;r.depthTestAgainstTerrain=!0,this.frustums=!1,this.frustumPlanes=!1,this.performance=!1,this.shaderCacheText="",this.primitiveBoundingSphere=!1,this.primitiveReferenceFrame=!1,this.filterPrimitive=!1,this.tileBoundingSphere=!1,this.filterTile=!1,this.wireframe=!1,this.depthFrustum=1,this._numberOfFrustums=1,this.suspendUpdates=!1,this.tileCoordinates=!1,this.frustumStatisticText=!1,this.tileText="",this.hasPickedPrimitive=!1,this.hasPickedTile=!1,this.pickPrimitiveActive=!1,this.pickTileActive=!1,this.dropDownVisible=!0,this.generalVisible=!0,this.primitivesVisible=!1,this.terrainVisible=!1,this.depthFrustumText="",Ee.track(this,["frustums","frustumPlanes","performance","shaderCacheText","primitiveBoundingSphere","primitiveReferenceFrame","filterPrimitive","tileBoundingSphere","filterTile","wireframe","depthFrustum","suspendUpdates","tileCoordinates","frustumStatisticText","tileText","hasPickedPrimitive","hasPickedTile","pickPrimitiveActive","pickTileActive","dropDownVisible","generalVisible","primitivesVisible","terrainVisible","depthFrustumText"]),this._toggleDropDown=Fn(function(){n.dropDownVisible=!n.dropDownVisible}),this._toggleGeneral=Fn(function(){n.generalVisible=!n.generalVisible}),this._togglePrimitives=Fn(function(){n.primitivesVisible=!n.primitivesVisible}),this._toggleTerrain=Fn(function(){n.terrainVisible=!n.terrainVisible}),this._frustumsSubscription=Ee.getObservable(this,"frustums").subscribe(function(d){n._scene.debugShowFrustums=d,n._scene.requestRender()}),this._frustumPlanesSubscription=Ee.getObservable(this,"frustumPlanes").subscribe(function(d){n._scene.debugShowFrustumPlanes=d,n._scene.requestRender()}),this._performanceSubscription=Ee.getObservable(this,"performance").subscribe(function(d){d?n._performanceDisplay=new Ig({container:n._performanceContainer}):n._performanceContainer.innerHTML=""}),this._showPrimitiveBoundingSphere=Fn(function(){return n._primitive.debugShowBoundingVolume=n.primitiveBoundingSphere,n._scene.requestRender(),!0}),this._primitiveBoundingSphereSubscription=Ee.getObservable(this,"primitiveBoundingSphere").subscribe(function(){n._showPrimitiveBoundingSphere()}),this._showPrimitiveReferenceFrame=Fn(function(){if(n.primitiveReferenceFrame){let d=n._primitive.modelMatrix;n._modelMatrixPrimitive=new YU({modelMatrix:d}),n._scene.primitives.add(n._modelMatrixPrimitive)}else l(n._modelMatrixPrimitive)&&(n._scene.primitives.remove(n._modelMatrixPrimitive),n._modelMatrixPrimitive=void 0);return n._scene.requestRender(),!0}),this._primitiveReferenceFrameSubscription=Ee.getObservable(this,"primitiveReferenceFrame").subscribe(function(){n._showPrimitiveReferenceFrame()}),this._doFilterPrimitive=Fn(function(){return n.filterPrimitive?n._scene.debugCommandFilter=function(d){return l(n._modelMatrixPrimitive)&&d.owner===n._modelMatrixPrimitive._primitive?!0:l(n._primitive)?d.owner===n._primitive||d.owner===n._primitive._billboardCollection||d.owner.primitive===n._primitive:!1}:n._scene.debugCommandFilter=void 0,!0}),this._filterPrimitiveSubscription=Ee.getObservable(this,"filterPrimitive").subscribe(function(){n._doFilterPrimitive(),n._scene.requestRender()}),this._wireframeSubscription=Ee.getObservable(this,"wireframe").subscribe(function(d){r._surface.tileProvider._debug.wireframe=d,n._scene.requestRender()}),this._depthFrustumSubscription=Ee.getObservable(this,"depthFrustum").subscribe(function(d){n._scene.debugShowDepthFrustum=d,n._scene.requestRender()}),this._incrementDepthFrustum=Fn(function(){let d=n.depthFrustum+1;return n.depthFrustum=rle(1,n._numberOfFrustums,d),n._scene.requestRender(),!0}),this._decrementDepthFrustum=Fn(function(){let d=n.depthFrustum-1;return n.depthFrustum=rle(1,n._numberOfFrustums,d),n._scene.requestRender(),!0}),this._suspendUpdatesSubscription=Ee.getObservable(this,"suspendUpdates").subscribe(function(d){r._surface._debug.suspendLodUpdate=d,d||(n.filterTile=!1)});let s;this._showTileCoordinates=Fn(function(){return n.tileCoordinates&&!l(s)?s=e.imageryLayers.addImageryProvider(new i5({tilingScheme:e.terrainProvider.tilingScheme})):!n.tileCoordinates&&l(s)&&(e.imageryLayers.remove(s),s=void 0),!0}),this._tileCoordinatesSubscription=Ee.getObservable(this,"tileCoordinates").subscribe(function(){n._showTileCoordinates(),n._scene.requestRender()}),this._tileBoundingSphereSubscription=Ee.getObservable(this,"tileBoundingSphere").subscribe(function(){n._showTileBoundingSphere(),n._scene.requestRender()}),this._showTileBoundingSphere=Fn(function(){return n.tileBoundingSphere?r._surface.tileProvider._debug.boundingSphereTile=n._tile:r._surface.tileProvider._debug.boundingSphereTile=void 0,n._scene.requestRender(),!0}),this._doFilterTile=Fn(function(){return n.filterTile?(n.suspendUpdates=!0,r._surface._tilesToRender=[],l(n._tile)&&n._tile.renderable&&r._surface._tilesToRender.push(n._tile)):n.suspendUpdates=!1,!0}),this._filterTileSubscription=Ee.getObservable(this,"filterTile").subscribe(function(){n.doFilterTile(),n._scene.requestRender()});function a(d){let u=n._scene.pick({x:d.position.x,y:d.position.y});l(u)&&(n.primitive=l(u.collection)?u.collection:u.primitive),n._scene.requestRender(),n.pickPrimitiveActive=!1}this._pickPrimitive=Fn(function(){n.pickPrimitiveActive=!n.pickPrimitiveActive}),this._pickPrimitiveActiveSubscription=Ee.getObservable(this,"pickPrimitiveActive").subscribe(function(d){d?o.setInputAction(a,mn.LEFT_CLICK):o.removeInputAction(mn.LEFT_CLICK)});function c(d){let u,m=r.ellipsoid,p=n._scene.camera.getPickRay(d.position,yBt),b=r.pick(p,n._scene,xBt);if(l(b)){let f=m.cartesianToCartographic(b),y=r._surface.tileProvider._tilesToRenderByTextureCount;for(let _=0;!u&&_<y.length;++_){let S=y[_];if(l(S))for(let Z=0;!u&&Z<S.length;++Z){let R=S[Z];re.contains(R.rectangle,f)&&(u=R)}}}n.tile=u,n.pickTileActive=!1}this._pickTile=Fn(function(){n.pickTileActive=!n.pickTileActive}),this._pickTileActiveSubscription=Ee.getObservable(this,"pickTileActive").subscribe(function(d){d?o.setInputAction(c,mn.LEFT_CLICK):o.removeInputAction(mn.LEFT_CLICK)}),this._removePostRenderEvent=e.postRender.addEventListener(function(){n._update()})}Object.defineProperties(x5.prototype,{scene:{get:function(){return this._scene}},performanceContainer:{get:function(){return this._performanceContainer}},toggleDropDown:{get:function(){return this._toggleDropDown}},showPrimitiveBoundingSphere:{get:function(){return this._showPrimitiveBoundingSphere}},showPrimitiveReferenceFrame:{get:function(){return this._showPrimitiveReferenceFrame}},doFilterPrimitive:{get:function(){return this._doFilterPrimitive}},incrementDepthFrustum:{get:function(){return this._incrementDepthFrustum}},decrementDepthFrustum:{get:function(){return this._decrementDepthFrustum}},showTileCoordinates:{get:function(){return this._showTileCoordinates}},showTileBoundingSphere:{get:function(){return this._showTileBoundingSphere}},doFilterTile:{get:function(){return this._doFilterTile}},toggleGeneral:{get:function(){return this._toggleGeneral}},togglePrimitives:{get:function(){return this._togglePrimitives}},toggleTerrain:{get:function(){return this._toggleTerrain}},pickPrimitive:{get:function(){return this._pickPrimitive}},pickTile:{get:function(){return this._pickTile}},selectParent:{get:function(){let e=this;return Fn(function(){e.tile=e.tile.parent})}},selectNW:{get:function(){let e=this;return Fn(function(){e.tile=e.tile.northwestChild})}},selectNE:{get:function(){let e=this;return Fn(function(){e.tile=e.tile.northeastChild})}},selectSW:{get:function(){let e=this;return Fn(function(){e.tile=e.tile.southwestChild})}},selectSE:{get:function(){let e=this;return Fn(function(){e.tile=e.tile.southeastChild})}},primitive:{get:function(){return this._primitive},set:function(e){let t=this._primitive;e!==t&&(this.hasPickedPrimitive=!0,l(t)&&(t.debugShowBoundingVolume=!1),this._scene.debugCommandFilter=void 0,l(this._modelMatrixPrimitive)&&(this._scene.primitives.remove(this._modelMatrixPrimitive),this._modelMatrixPrimitive=void 0),this._primitive=e,e.show=!1,setTimeout(function(){e.show=!0},50),this.showPrimitiveBoundingSphere(),this.showPrimitiveReferenceFrame(),this.doFilterPrimitive())}},tile:{get:function(){return this._tile},set:function(e){if(l(e)){this.hasPickedTile=!0;let t=this._tile;if(e!==t){this.tileText=`L: ${e.level} X: ${e.x} Y: ${e.y}`,this.tileText+=`<br>SW corner: ${e.rectangle.west}, ${e.rectangle.south}`,this.tileText+=`<br>NE corner: ${e.rectangle.east}, ${e.rectangle.north}`;let n=e.data;l(n)&&l(n.tileBoundingRegion)?this.tileText+=`<br>Min: ${n.tileBoundingRegion.minimumHeight} Max: ${n.tileBoundingRegion.maximumHeight}`:this.tileText+="<br>(Tile is not loaded)"}this._tile=e,this.showTileBoundingSphere(),this.doFilterTile()}else this.hasPickedTile=!1,this._tile=void 0}}});x5.prototype._update=function(){this.frustums&&(this.frustumStatisticText=gBt(this._scene.debugFrustumStatistics));let e=this._scene.numberOfFrustums;this._numberOfFrustums=e,this.depthFrustum=rle(1,e,this.depthFrustum),this.depthFrustumText=`${this.depthFrustum} of ${e}`,this.performance&&this._performanceDisplay.update(),this.primitiveReferenceFrame&&(this._modelMatrixPrimitive.modelMatrix=this._primitive.modelMatrix),this.shaderCacheText=`Cached shaders: ${this._scene.context.shaderCache.numberOfShaders}`};x5.prototype.isDestroyed=function(){return!1};x5.prototype.destroy=function(){return this._eventHandler.destroy(),this._removePostRenderEvent(),this._frustumsSubscription.dispose(),this._frustumPlanesSubscription.dispose(),this._performanceSubscription.dispose(),this._primitiveBoundingSphereSubscription.dispose(),this._primitiveReferenceFrameSubscription.dispose(),this._filterPrimitiveSubscription.dispose(),this._wireframeSubscription.dispose(),this._depthFrustumSubscription.dispose(),this._suspendUpdatesSubscription.dispose(),this._tileCoordinatesSubscription.dispose(),this._tileBoundingSphereSubscription.dispose(),this._filterTileSubscription.dispose(),this._pickPrimitiveActiveSubscription.dispose(),this._pickTileActiveSubscription.dispose(),ue(this)};var T5=x5;function MJ(e,t){e=Nn(e);let n=document.createElement("div"),i=new T5(t,n);this._viewModel=i,this._container=e;let o=document.createElement("div");this._element=o;let r=document.createElement("div");r.textContent="Cesium Inspector",r.className="cesium-cesiumInspector-button",r.setAttribute("data-bind","click: toggleDropDown"),o.appendChild(r),o.className="cesium-cesiumInspector",o.setAttribute("data-bind",'css: { "cesium-cesiumInspector-visible" : dropDownVisible, "cesium-cesiumInspector-hidden" : !dropDownVisible }'),e.appendChild(this._element);let s=document.createElement("div");s.className="cesium-cesiumInspector-dropDown",o.appendChild(s);let a=fu.createSection,c=fu.createCheckbox,d=a(s,"General","generalVisible","toggleGeneral"),u=c("Show Frustums","frustums"),m=document.createElement("div");m.className="cesium-cesiumInspector-frustumStatistics",m.setAttribute("data-bind","visible: frustums, html: frustumStatisticText"),u.appendChild(m),d.appendChild(u),d.appendChild(c("Show Frustum Planes","frustumPlanes")),d.appendChild(c("Performance Display","performance")),n.className="cesium-cesiumInspector-performanceDisplay",d.appendChild(n);let p=document.createElement("div");p.className="cesium-cesiumInspector-shaderCache",p.setAttribute("data-bind","html: shaderCacheText"),d.appendChild(p);let b=document.createElement("div");d.appendChild(b);let f=document.createElement("span");f.setAttribute("data-bind",'html: "     Frustum:"'),b.appendChild(f);let y=document.createElement("span");y.setAttribute("data-bind","text: depthFrustumText"),b.appendChild(y);let _=document.createElement("input");_.type="button",_.value="-",_.className="cesium-cesiumInspector-pickButton",_.setAttribute("data-bind","click: decrementDepthFrustum"),b.appendChild(_);let S=document.createElement("input");S.type="button",S.value="+",S.className="cesium-cesiumInspector-pickButton",S.setAttribute("data-bind","click: incrementDepthFrustum"),b.appendChild(S);let Z=a(s,"Primitives","primitivesVisible","togglePrimitives"),R=document.createElement("div");R.className="cesium-cesiumInspector-pickSection",Z.appendChild(R);let C=document.createElement("input");C.type="button",C.value="Pick a primitive",C.className="cesium-cesiumInspector-pickButton",C.setAttribute("data-bind",'css: {"cesium-cesiumInspector-pickButtonHighlight" : pickPrimitiveActive}, click: pickPrimitive');let E=document.createElement("div");E.className="cesium-cesiumInspector-center",E.appendChild(C),R.appendChild(E),R.appendChild(c("Show bounding sphere","primitiveBoundingSphere","hasPickedPrimitive")),R.appendChild(c("Show reference frame","primitiveReferenceFrame","hasPickedPrimitive")),this._primitiveOnly=c("Show only selected","filterPrimitive","hasPickedPrimitive"),R.appendChild(this._primitiveOnly);let A=a(s,"Terrain","terrainVisible","toggleTerrain"),L=document.createElement("div");L.className="cesium-cesiumInspector-pickSection",A.appendChild(L);let F=document.createElement("input");F.type="button",F.value="Pick a tile",F.className="cesium-cesiumInspector-pickButton",F.setAttribute("data-bind",'css: {"cesium-cesiumInspector-pickButtonHighlight" : pickTileActive}, click: pickTile'),E=document.createElement("div"),E.appendChild(F),E.className="cesium-cesiumInspector-center",L.appendChild(E);let I=document.createElement("div");L.appendChild(I);let N=document.createElement("input");N.type="button",N.value="Parent",N.className="cesium-cesiumInspector-pickButton",N.setAttribute("data-bind","click: selectParent");let g=document.createElement("input");g.type="button",g.value="NW",g.className="cesium-cesiumInspector-pickButton",g.setAttribute("data-bind","click: selectNW");let V=document.createElement("input");V.type="button",V.value="NE",V.className="cesium-cesiumInspector-pickButton",V.setAttribute("data-bind","click: selectNE");let G=document.createElement("input");G.type="button",G.value="SW",G.className="cesium-cesiumInspector-pickButton",G.setAttribute("data-bind","click: selectSW");let v=document.createElement("input");v.type="button",v.value="SE",v.className="cesium-cesiumInspector-pickButton",v.setAttribute("data-bind","click: selectSE");let X=document.createElement("div");X.className="cesium-cesiumInspector-tileText",I.className="cesium-cesiumInspector-frustumStatistics",I.appendChild(X),I.setAttribute("data-bind","visible: hasPickedTile"),X.setAttribute("data-bind","html: tileText");let Y=document.createElement("div");Y.className="cesium-cesiumInspector-relativeText",Y.textContent="Select relative:",I.appendChild(Y);let D=document.createElement("table"),M=document.createElement("tr"),O=document.createElement("tr"),w=document.createElement("td");w.appendChild(N);let z=document.createElement("td");z.appendChild(g);let K=document.createElement("td");K.appendChild(V),M.appendChild(w),M.appendChild(z),M.appendChild(K);let te=document.createElement("td"),H=document.createElement("td");H.appendChild(G);let $=document.createElement("td");$.appendChild(v),O.appendChild(te),O.appendChild(H),O.appendChild($),D.appendChild(M),D.appendChild(O),I.appendChild(D),L.appendChild(c("Show bounding volume","tileBoundingSphere","hasPickedTile")),L.appendChild(c("Show only selected","filterTile","hasPickedTile")),A.appendChild(c("Wireframe","wireframe")),A.appendChild(c("Suspend LOD update","suspendUpdates")),A.appendChild(c("Show tile coordinates","tileCoordinates")),Ee.applyBindings(i,this._element)}Object.defineProperties(MJ.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}}});MJ.prototype.isDestroyed=function(){return!1};MJ.prototype.destroy=function(){return Ee.cleanNode(this._element),this._container.removeChild(this._element),this.viewModel.destroy(),ue(this)};var _5=MJ;var Mur=x(T(),1);var vur=x(T(),1);function mYe(e){e=e??B.EMPTY_OBJECT;let t=e.globe,n=e.imageryProviderViewModels??B.EMPTY_ARRAY,i=e.terrainProviderViewModels??B.EMPTY_ARRAY;this._globe=t,this.imageryProviderViewModels=n.slice(0),this.terrainProviderViewModels=i.slice(0),this.dropDownVisible=!1,Ee.track(this,["imageryProviderViewModels","terrainProviderViewModels","dropDownVisible"]);let o=Ee.getObservable(this,"imageryProviderViewModels"),r=Ee.pureComputed(function(){let m=o(),p={},b;for(b=0;b<m.length;b++){let _=m[b],S=_.category;l(p[S])?p[S].push(_):p[S]=[_]}let f=Object.keys(p),y=[];for(b=0;b<f.length;b++){let _=f[b];y.push({name:_,providers:p[_]})}return y});this._imageryProviders=r;let s=Ee.getObservable(this,"terrainProviderViewModels"),a=Ee.pureComputed(function(){let m=s(),p={},b;for(b=0;b<m.length;b++){let _=m[b],S=_.category;l(p[S])?p[S].push(_):p[S]=[_]}let f=Object.keys(p),y=[];for(b=0;b<f.length;b++){let _=f[b];y.push({name:_,providers:p[_]})}return y});this._terrainProviders=a,this.buttonTooltip=void 0,Ee.defineProperty(this,"buttonTooltip",function(){let m=this.selectedImagery,p=this.selectedTerrain,b=l(m)?m.name:void 0,f=l(p)?p.name:void 0;return l(b)&&l(f)?`${b} +${f}`:l(b)?b:f}),this.buttonImageUrl=void 0,Ee.defineProperty(this,"buttonImageUrl",function(){let m=this.selectedImagery;if(l(m))return m.iconUrl}),this.selectedImagery=void 0;let c=Ee.observable();this._currentImageryLayers=[],Ee.defineProperty(this,"selectedImagery",{get:function(){return c()},set:function(m){if(c()===m){this.dropDownVisible=!1;return}let p,b=this._currentImageryLayers,f=b.length,y=this._globe.imageryLayers,_=!1;for(p=0;p<f;p++){let S=y.length;for(let Z=0;Z<S;Z++){let R=y.get(Z);if(R===b[p]){y.remove(R),_=!0;break}}}if(l(m)){let S=m.creationCommand();if(Array.isArray(S)){let Z=S.length;for(this._currentImageryLayers=[],p=Z-1;p>=0;p--){let R=Cs.fromProviderAsync(S[p]);y.add(R,0),this._currentImageryLayers.push(R)}}else{this._currentImageryLayers=[];let Z=Cs.fromProviderAsync(S);if(Z.name=m.name,_)y.add(Z,0);else{let R=y.get(0);l(R)&&y.remove(R),y.add(Z,0)}this._currentImageryLayers.push(Z)}}c(m),this.dropDownVisible=!1}}),this.selectedTerrain=void 0;let d=Ee.observable();Ee.defineProperty(this,"selectedTerrain",{get:function(){return d()},set:function(m){if(d()===m){this.dropDownVisible=!1;return}let p;if(l(m)&&(p=m.creationCommand()),l(p)&&!l(p.then))this._globe.depthTestAgainstTerrain=!(p instanceof h0),this._globe.terrainProvider=p;else if(l(p)){let b=!1,f=this._globe.terrainProviderChanged.addEventListener(()=>{b=!0,f()}),_=new t5(p).readyEvent.addEventListener(S=>{b||(this._globe.depthTestAgainstTerrain=!(S instanceof h0),this._globe.terrainProvider=S,_())})}d(m),this.dropDownVisible=!1}});let u=this;this._toggleDropDown=Fn(function(){u.dropDownVisible=!u.dropDownVisible}),this.selectedImagery=e.selectedImageryProviderViewModel??n[0],this.selectedTerrain=e.selectedTerrainProviderViewModel}Object.defineProperties(mYe.prototype,{toggleDropDown:{get:function(){return this._toggleDropDown}},globe:{get:function(){return this._globe}}});var S5=mYe;function wJ(e,t){e=Nn(e);let n=new S5(t),i=document.createElement("button");i.type="button",i.className="cesium-button cesium-toolbar-button",i.setAttribute("data-bind","attr: { title: buttonTooltip },click: toggleDropDown"),e.appendChild(i);let o=document.createElement("img");o.setAttribute("draggable","false"),o.className="cesium-baseLayerPicker-selected",o.setAttribute("data-bind","attr: { src: buttonImageUrl }, visible: !!buttonImageUrl"),i.appendChild(o);let r=document.createElement("div");r.className="cesium-baseLayerPicker-dropDown",r.setAttribute("data-bind",'css: { "cesium-baseLayerPicker-dropDown-visible" : dropDownVisible }'),e.appendChild(r);let s=document.createElement("div");s.className="cesium-baseLayerPicker-sectionTitle",s.setAttribute("data-bind","visible: imageryProviderViewModels.length > 0"),s.innerHTML="Imagery",r.appendChild(s);let a=document.createElement("div");a.className="cesium-baseLayerPicker-section",a.setAttribute("data-bind","foreach: _imageryProviders"),r.appendChild(a);let c=document.createElement("div");c.className="cesium-baseLayerPicker-category",a.appendChild(c);let d=document.createElement("div");d.className="cesium-baseLayerPicker-categoryTitle",d.setAttribute("data-bind","text: name"),c.appendChild(d);let u=document.createElement("div");u.className="cesium-baseLayerPicker-choices",u.setAttribute("data-bind","foreach: providers"),c.appendChild(u);let m=document.createElement("div");m.className="cesium-baseLayerPicker-item",m.setAttribute("data-bind",'css: { "cesium-baseLayerPicker-selectedItem" : $data === $parents[1].selectedImagery },attr: { title: tooltip },visible: creationCommand.canExecute,click: function($data) { $parents[1].selectedImagery = $data; }'),u.appendChild(m);let p=document.createElement("img");p.className="cesium-baseLayerPicker-itemIcon",p.setAttribute("data-bind","attr: { src: iconUrl }"),p.setAttribute("draggable","false"),m.appendChild(p);let b=document.createElement("div");b.className="cesium-baseLayerPicker-itemLabel",b.setAttribute("data-bind","text: name"),m.appendChild(b);let f=document.createElement("div");f.className="cesium-baseLayerPicker-sectionTitle",f.setAttribute("data-bind","visible: terrainProviderViewModels.length > 0"),f.innerHTML="Terrain",r.appendChild(f);let y=document.createElement("div");y.className="cesium-baseLayerPicker-section",y.setAttribute("data-bind","foreach: _terrainProviders"),r.appendChild(y);let _=document.createElement("div");_.className="cesium-baseLayerPicker-category",y.appendChild(_);let S=document.createElement("div");S.className="cesium-baseLayerPicker-categoryTitle",S.setAttribute("data-bind","text: name"),_.appendChild(S);let Z=document.createElement("div");Z.className="cesium-baseLayerPicker-choices",Z.setAttribute("data-bind","foreach: providers"),_.appendChild(Z);let R=document.createElement("div");R.className="cesium-baseLayerPicker-item",R.setAttribute("data-bind",'css: { "cesium-baseLayerPicker-selectedItem" : $data === $parents[1].selectedTerrain },attr: { title: tooltip },visible: creationCommand.canExecute,click: function($data) { $parents[1].selectedTerrain = $data; }'),Z.appendChild(R);let C=document.createElement("img");C.className="cesium-baseLayerPicker-itemIcon",C.setAttribute("data-bind","attr: { src: iconUrl }"),C.setAttribute("draggable","false"),R.appendChild(C);let E=document.createElement("div");E.className="cesium-baseLayerPicker-itemLabel",E.setAttribute("data-bind","text: name"),R.appendChild(E),Ee.applyBindings(n,i),Ee.applyBindings(n,r),this._viewModel=n,this._container=e,this._element=i,this._dropPanel=r,this._closeDropDown=function(A){i.contains(A.target)||r.contains(A.target)||(n.dropDownVisible=!1)},fn.supportsPointerEvents()?document.addEventListener("pointerdown",this._closeDropDown,!0):(document.addEventListener("mousedown",this._closeDropDown,!0),document.addEventListener("touchstart",this._closeDropDown,!0))}Object.defineProperties(wJ.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}}});wJ.prototype.isDestroyed=function(){return!1};wJ.prototype.destroy=function(){return fn.supportsPointerEvents()?document.removeEventListener("pointerdown",this._closeDropDown,!0):(document.removeEventListener("mousedown",this._closeDropDown,!0),document.removeEventListener("touchstart",this._closeDropDown,!0)),Ee.cleanNode(this._element),Ee.cleanNode(this._dropPanel),this._container.removeChild(this._element),this._container.removeChild(this._dropPanel),ue(this)};var Z5=wJ;var Jur=x(T(),1);var Bur=x(T(),1);function hYe(e){let t=e.creationFunction;l(t.canExecute)||(t=Fn(t)),this._creationCommand=t,this.name=e.name,this.tooltip=e.tooltip,this.iconUrl=e.iconUrl,this._category=e.category??"",Ee.track(this,["name","tooltip","iconUrl"])}Object.defineProperties(hYe.prototype,{creationCommand:{get:function(){return this._creationCommand}},category:{get:function(){return this._category}}});var mr=hYe;function TBt(){let e=[],t=devicePixelRatio>=2;return e.push(new mr({name:"Bing Maps Aerial",iconUrl:en("Widgets/Images/ImageryProviders/bingAerial.png"),tooltip:"Bing Maps aerial imagery, provided by Cesium ion",category:"Cesium ion",creationFunction:function(){return og({style:ig.AERIAL})}})),e.push(new mr({name:"Bing Maps Aerial with Labels",iconUrl:en("Widgets/Images/ImageryProviders/bingAerialLabels.png"),tooltip:"Bing Maps aerial imagery with labels, provided by Cesium ion",category:"Cesium ion",creationFunction:function(){return og({style:ig.AERIAL_WITH_LABELS})}})),e.push(new mr({name:"Bing Maps Roads",iconUrl:en("Widgets/Images/ImageryProviders/bingRoads.png"),tooltip:"Bing Maps standard road maps, provided by Cesium ion",category:"Cesium ion",creationFunction:function(){return og({style:ig.ROAD})}})),e.push(new mr({name:"ArcGIS World Imagery",iconUrl:en("Widgets/Images/ImageryProviders/ArcGisMapServiceWorldImagery.png"),tooltip:`ArcGIS World Imagery provides one meter or better satellite and aerial imagery in many parts of the world and lower resolution satellite imagery worldwide. The map includes 15m TerraColor imagery at small and mid-scales (~1:591M down to ~1:288k) for the world. The map features Maxar imagery at 0.3m resolution for select metropolitan areas around the world, 0.5m resolution across the United States and parts of Western Europe, and 1m resolution imagery across the rest of the world. In addition to commercial sources, the World Imagery map features high-resolution aerial photography contributed by the GIS User Community. This imagery ranges from 0.3m to 0.03m resolution (down to ~1:280 nin select communities). For more information on this map, including the terms of use, visit us online at +https://www.arcgis.com/home/item.html?id=10df2279f9684e4a9f6a7f08febac2a9`,category:"Other",creationFunction:function(){return tg.fromBasemapType(Cf.SATELLITE,{enablePickFeatures:!1})}})),e.push(new mr({name:"ArcGIS World Hillshade",iconUrl:en("Widgets/Images/ImageryProviders/ArcGisMapServiceWorldHillshade.png"),tooltip:`ArcGIS World Hillshade map portrays elevation as an artistic hillshade. This map is designed to be used as a backdrop for topographical, soil, hydro, landcover or other outdoor recreational maps. The map was compiled from a variety of sources from several data providers. The basemap has global coverage down to a scale of ~1:72k. In select areas of the United States and Europe, coverage is available down to ~1:9k. For more information on this map, including the terms of use, visit us online at +https://www.arcgis.com/home/item.html?id=1b243539f4514b6ba35e7d995890db1d`,category:"Other",creationFunction:function(){return tg.fromBasemapType(Cf.HILLSHADE,{enablePickFeatures:!1})}})),e.push(new mr({name:"Esri World Ocean",iconUrl:en("Widgets/Images/ImageryProviders/ArcGisMapServiceWorldOcean.png"),tooltip:`ArcGIS World Ocean map is designed to be used as a base map by marine GIS professionals and as a reference map by anyone interested in ocean data. The base map features marine bathymetry. Land features include inland waters and roads overlaid on land cover and shaded relief imagery. The map was compiled from a variety of best available sources from several data providers, including General Bathymetric Chart of the Oceans GEBCO_08 Grid, National Oceanic and Atmospheric Administration (NOAA), and National Geographic, Garmin, HERE, Geonames.org, and Esri, and various other contributors. The base map currently provides coverage for the world down to a scale of ~1:577k, and coverage down to 1:72k in US coastal areas, and various other areas. Coverage down to ~ 1:9k is available limited areas based on regional hydrographic survey data. The base map was designed and developed by Esri. For more information on this map, including our terms of use, visit us online at +https://www.arcgis.com/home/item.html?id=1e126e7520f9466c9ca28b8f28b5e500`,category:"Other",creationFunction:function(){return tg.fromBasemapType(Cf.OCEANS,{enablePickFeatures:!1})}})),e.push(new mr({name:"Open\xADStreet\xADMap",iconUrl:en("Widgets/Images/ImageryProviders/openStreetMap.png"),tooltip:`OpenStreetMap (OSM) is a collaborative project to create a free editable map of the world. http://www.openstreetmap.org`,category:"Other",creationFunction:function(){return new gy({url:"https://tile.openstreetmap.org/"})}})),e.push(new mr({name:"Stadia x Stamen Watercolor",iconUrl:en("Widgets/Images/ImageryProviders/stamenWatercolor.png"),tooltip:`Based on the original basemaps created for the Knight Foundation and reminiscent of hand drawn maps, the watercolor maps from Stamen Design apply raster effect area washes and organic edges over a paper texture to add warm pop to any map. https://docs.stadiamaps.com/map-styles/stamen-watercolor/`,category:"Other",creationFunction:function(){return new gy({url:"https://tiles.stadiamaps.com/tiles/stamen_watercolor/",fileExtension:"jpg",credit:`© <a href="https://stamen.com/" target="_blank">Stamen Design</a> © <a href="https://www.stadiamaps.com/" target="_blank">Stadia Maps</a> @@ -12763,15 +12770,8 @@ https://docs.stadiamaps.com/map-styles/alidade-smooth/`,category:"Other",creatio © <a href="https://www.openstreetmap.org/about/" target="_blank">OpenStreetMap contributors</a>`})}})),e.push(new mr({name:"Stadia Alidade Smooth Dark",iconUrl:en("Widgets/Images/ImageryProviders/stadiaAlidadeSmoothDark.png"),tooltip:`Stadia Alidade Smooth Dark, like its lighter cousin, is also designed to stay out of the way. It just flips the dark mode switch on the color scheme. With the lights out, your data can now literally shine. https://docs.stadiamaps.com/map-styles/alidade-smooth-dark/`,category:"Other",creationFunction:function(){return new gy({url:"https://tiles.stadiamaps.com/tiles/alidade_smooth_dark/",retinaTiles:t,credit:`© <a href="https://www.stadiamaps.com/" target="_blank">Stadia Maps</a> © <a href="https://openmaptiles.org/" target="_blank">OpenMapTiles</a> - © <a href="https://www.openstreetmap.org/about/" target="_blank">OpenStreetMap contributors</a>`})}})),e.push(new mr({name:"Sentinel-2",iconUrl:en("Widgets/Images/ImageryProviders/sentinel-2.png"),tooltip:"Sentinel-2 cloudless by EOX IT Services GmbH (Contains modified Copernicus Sentinel data 2016 and 2017).",category:"Cesium ion",creationFunction:function(){return nd.fromAssetId(3954)}})),e.push(new mr({name:"Blue Marble",iconUrl:en("Widgets/Images/ImageryProviders/blueMarble.png"),tooltip:"Blue Marble Next Generation July, 2004 imagery from NASA.",category:"Cesium ion",creationFunction:function(){return nd.fromAssetId(3845)}})),e.push(new mr({name:"Earth at night",iconUrl:en("Widgets/Images/ImageryProviders/earthAtNight.png"),tooltip:"The Earth at night, also known as The Black Marble, is a 500 meter resolution global composite imagery layer released by NASA.",category:"Cesium ion",creationFunction:function(){return nd.fromAssetId(3812)}})),e.push(new mr({name:"Natural Earth\xA0II",iconUrl:en("Widgets/Images/ImageryProviders/naturalEarthII.png"),tooltip:`Natural Earth II, darkened for contrast. -http://www.naturalearthdata.com/`,category:"Cesium ion",creationFunction:function(){return Zx.fromUrl(en("Assets/Textures/NaturalEarthII"))}})),e.push(new mr({name:"Google Maps Satellite",iconUrl:en("Widgets/Images/ImageryProviders/googleSatellite.png"),tooltip:"Imagery from Google Maps",category:"Cesium ion",creationFunction:function(){return nd.fromAssetId(3830182)}})),e.push(new mr({name:"Google Maps Satellite with Labels",iconUrl:en("Widgets/Images/ImageryProviders/googleSatelliteLabels.png"),tooltip:"Imagery with place labels from Google Maps",category:"Cesium ion",creationFunction:function(){return nd.fromAssetId(3830183)}})),e.push(new mr({name:"Google Maps Roadmap",iconUrl:en("Widgets/Images/ImageryProviders/googleRoadmap.png"),tooltip:"Labeled roads and other features on a base landscape from Google Maps",category:"Cesium ion",creationFunction:function(){return nd.fromAssetId(3830184)}})),e.push(new mr({name:"Google Maps Contour",iconUrl:en("Widgets/Images/ImageryProviders/googleContour.png"),tooltip:"Hillshade mapping, contour lines, natural features (roadmap features hidden) from Google Maps",category:"Cesium ion",creationFunction:function(){return nd.fromAssetId(3830186)}})),e.push(new mr({name:"Azure Maps Aerial",iconUrl:en("Widgets/Images/ImageryProviders/azureAerial.png"),tooltip:"Imagery from Azure Maps",category:"Cesium ion",creationFunction:function(){return nd.fromAssetId(3891168)}})),e.push(new mr({name:"Azure Maps Roads",iconUrl:en("Widgets/Images/ImageryProviders/azureRoads.png"),tooltip:"Labeled roads and other features on a base landscape from Azure Maps",category:"Cesium ion",creationFunction:function(){return nd.fromAssetId(3891169)}})),e}var g5=mBt;var Vur=x(T(),1);function hBt(){let e=[];return e.push(new mr({name:"WGS84 Ellipsoid",iconUrl:en("Widgets/Images/TerrainProviders/Ellipsoid.png"),tooltip:"WGS84 standard ellipsoid, also known as EPSG:4326",category:"Cesium ion",creationFunction:function(){return new A0({ellipsoid:ne.WGS84})}})),e.push(new mr({name:"Cesium World Terrain",iconUrl:en("Widgets/Images/TerrainProviders/CesiumWorldTerrain.png"),tooltip:"High-resolution global terrain tileset curated from several datasources and hosted by Cesium ion",category:"Cesium ion",creationFunction:function(){return WR({requestWaterMask:!0,requestVertexNormals:!0})}})),e}var y5=hBt;var wur=x(T(),1);var vur=x(T(),1);function fBt(e){let t;if(l(e)){t="Command Statistics";let n=e.commandsInFrustums;for(let i in n)if(n.hasOwnProperty(i)){let o=parseInt(i,10),r;if(o===7)r="1, 2 and 3";else{let s=[];for(let a=2;a>=0;a--){let c=Math.pow(2,a);o>=c&&(s.push(a+1),o-=c)}r=s.reverse().join(" and ")}t+=`<br>    ${n[i]} in frustum ${r}`}t+=`<br>Total: ${e.totalCommands}`}return t}function ole(e,t,n){let i=Math.min(n,t);return i=Math.max(i,e),i}var pBt=new gn,bBt=new h;function x5(e,t){let n=this,i=e.canvas,o=new aa(i);this._eventHandler=o,this._scene=e,this._canvas=i,this._primitive=void 0,this._tile=void 0,this._modelMatrixPrimitive=void 0,this._performanceDisplay=void 0,this._performanceContainer=t;let r=this._scene.globe;r.depthTestAgainstTerrain=!0,this.frustums=!1,this.frustumPlanes=!1,this.performance=!1,this.shaderCacheText="",this.primitiveBoundingSphere=!1,this.primitiveReferenceFrame=!1,this.filterPrimitive=!1,this.tileBoundingSphere=!1,this.filterTile=!1,this.wireframe=!1,this.depthFrustum=1,this._numberOfFrustums=1,this.suspendUpdates=!1,this.tileCoordinates=!1,this.frustumStatisticText=!1,this.tileText="",this.hasPickedPrimitive=!1,this.hasPickedTile=!1,this.pickPrimitiveActive=!1,this.pickTileActive=!1,this.dropDownVisible=!0,this.generalVisible=!0,this.primitivesVisible=!1,this.terrainVisible=!1,this.depthFrustumText="",Ee.track(this,["frustums","frustumPlanes","performance","shaderCacheText","primitiveBoundingSphere","primitiveReferenceFrame","filterPrimitive","tileBoundingSphere","filterTile","wireframe","depthFrustum","suspendUpdates","tileCoordinates","frustumStatisticText","tileText","hasPickedPrimitive","hasPickedTile","pickPrimitiveActive","pickTileActive","dropDownVisible","generalVisible","primitivesVisible","terrainVisible","depthFrustumText"]),this._toggleDropDown=Fn(function(){n.dropDownVisible=!n.dropDownVisible}),this._toggleGeneral=Fn(function(){n.generalVisible=!n.generalVisible}),this._togglePrimitives=Fn(function(){n.primitivesVisible=!n.primitivesVisible}),this._toggleTerrain=Fn(function(){n.terrainVisible=!n.terrainVisible}),this._frustumsSubscription=Ee.getObservable(this,"frustums").subscribe(function(d){n._scene.debugShowFrustums=d,n._scene.requestRender()}),this._frustumPlanesSubscription=Ee.getObservable(this,"frustumPlanes").subscribe(function(d){n._scene.debugShowFrustumPlanes=d,n._scene.requestRender()}),this._performanceSubscription=Ee.getObservable(this,"performance").subscribe(function(d){d?n._performanceDisplay=new qg({container:n._performanceContainer}):n._performanceContainer.innerHTML=""}),this._showPrimitiveBoundingSphere=Fn(function(){return n._primitive.debugShowBoundingVolume=n.primitiveBoundingSphere,n._scene.requestRender(),!0}),this._primitiveBoundingSphereSubscription=Ee.getObservable(this,"primitiveBoundingSphere").subscribe(function(){n._showPrimitiveBoundingSphere()}),this._showPrimitiveReferenceFrame=Fn(function(){if(n.primitiveReferenceFrame){let d=n._primitive.modelMatrix;n._modelMatrixPrimitive=new XU({modelMatrix:d}),n._scene.primitives.add(n._modelMatrixPrimitive)}else l(n._modelMatrixPrimitive)&&(n._scene.primitives.remove(n._modelMatrixPrimitive),n._modelMatrixPrimitive=void 0);return n._scene.requestRender(),!0}),this._primitiveReferenceFrameSubscription=Ee.getObservable(this,"primitiveReferenceFrame").subscribe(function(){n._showPrimitiveReferenceFrame()}),this._doFilterPrimitive=Fn(function(){return n.filterPrimitive?n._scene.debugCommandFilter=function(d){return l(n._modelMatrixPrimitive)&&d.owner===n._modelMatrixPrimitive._primitive?!0:l(n._primitive)?d.owner===n._primitive||d.owner===n._primitive._billboardCollection||d.owner.primitive===n._primitive:!1}:n._scene.debugCommandFilter=void 0,!0}),this._filterPrimitiveSubscription=Ee.getObservable(this,"filterPrimitive").subscribe(function(){n._doFilterPrimitive(),n._scene.requestRender()}),this._wireframeSubscription=Ee.getObservable(this,"wireframe").subscribe(function(d){r._surface.tileProvider._debug.wireframe=d,n._scene.requestRender()}),this._depthFrustumSubscription=Ee.getObservable(this,"depthFrustum").subscribe(function(d){n._scene.debugShowDepthFrustum=d,n._scene.requestRender()}),this._incrementDepthFrustum=Fn(function(){let d=n.depthFrustum+1;return n.depthFrustum=ole(1,n._numberOfFrustums,d),n._scene.requestRender(),!0}),this._decrementDepthFrustum=Fn(function(){let d=n.depthFrustum-1;return n.depthFrustum=ole(1,n._numberOfFrustums,d),n._scene.requestRender(),!0}),this._suspendUpdatesSubscription=Ee.getObservable(this,"suspendUpdates").subscribe(function(d){r._surface._debug.suspendLodUpdate=d,d||(n.filterTile=!1)});let s;this._showTileCoordinates=Fn(function(){return n.tileCoordinates&&!l(s)?s=e.imageryLayers.addImageryProvider(new i5({tilingScheme:e.terrainProvider.tilingScheme})):!n.tileCoordinates&&l(s)&&(e.imageryLayers.remove(s),s=void 0),!0}),this._tileCoordinatesSubscription=Ee.getObservable(this,"tileCoordinates").subscribe(function(){n._showTileCoordinates(),n._scene.requestRender()}),this._tileBoundingSphereSubscription=Ee.getObservable(this,"tileBoundingSphere").subscribe(function(){n._showTileBoundingSphere(),n._scene.requestRender()}),this._showTileBoundingSphere=Fn(function(){return n.tileBoundingSphere?r._surface.tileProvider._debug.boundingSphereTile=n._tile:r._surface.tileProvider._debug.boundingSphereTile=void 0,n._scene.requestRender(),!0}),this._doFilterTile=Fn(function(){return n.filterTile?(n.suspendUpdates=!0,r._surface._tilesToRender=[],l(n._tile)&&n._tile.renderable&&r._surface._tilesToRender.push(n._tile)):n.suspendUpdates=!1,!0}),this._filterTileSubscription=Ee.getObservable(this,"filterTile").subscribe(function(){n.doFilterTile(),n._scene.requestRender()});function a(d){let u=n._scene.pick({x:d.position.x,y:d.position.y});l(u)&&(n.primitive=l(u.collection)?u.collection:u.primitive),n._scene.requestRender(),n.pickPrimitiveActive=!1}this._pickPrimitive=Fn(function(){n.pickPrimitiveActive=!n.pickPrimitiveActive}),this._pickPrimitiveActiveSubscription=Ee.getObservable(this,"pickPrimitiveActive").subscribe(function(d){d?o.setInputAction(a,mn.LEFT_CLICK):o.removeInputAction(mn.LEFT_CLICK)});function c(d){let u,m=r.ellipsoid,p=n._scene.camera.getPickRay(d.position,pBt),b=r.pick(p,n._scene,bBt);if(l(b)){let f=m.cartesianToCartographic(b),y=r._surface.tileProvider._tilesToRenderByTextureCount;for(let _=0;!u&&_<y.length;++_){let S=y[_];if(l(S))for(let Z=0;!u&&Z<S.length;++Z){let R=S[Z];re.contains(R.rectangle,f)&&(u=R)}}}n.tile=u,n.pickTileActive=!1}this._pickTile=Fn(function(){n.pickTileActive=!n.pickTileActive}),this._pickTileActiveSubscription=Ee.getObservable(this,"pickTileActive").subscribe(function(d){d?o.setInputAction(c,mn.LEFT_CLICK):o.removeInputAction(mn.LEFT_CLICK)}),this._removePostRenderEvent=e.postRender.addEventListener(function(){n._update()})}Object.defineProperties(x5.prototype,{scene:{get:function(){return this._scene}},performanceContainer:{get:function(){return this._performanceContainer}},toggleDropDown:{get:function(){return this._toggleDropDown}},showPrimitiveBoundingSphere:{get:function(){return this._showPrimitiveBoundingSphere}},showPrimitiveReferenceFrame:{get:function(){return this._showPrimitiveReferenceFrame}},doFilterPrimitive:{get:function(){return this._doFilterPrimitive}},incrementDepthFrustum:{get:function(){return this._incrementDepthFrustum}},decrementDepthFrustum:{get:function(){return this._decrementDepthFrustum}},showTileCoordinates:{get:function(){return this._showTileCoordinates}},showTileBoundingSphere:{get:function(){return this._showTileBoundingSphere}},doFilterTile:{get:function(){return this._doFilterTile}},toggleGeneral:{get:function(){return this._toggleGeneral}},togglePrimitives:{get:function(){return this._togglePrimitives}},toggleTerrain:{get:function(){return this._toggleTerrain}},pickPrimitive:{get:function(){return this._pickPrimitive}},pickTile:{get:function(){return this._pickTile}},selectParent:{get:function(){let e=this;return Fn(function(){e.tile=e.tile.parent})}},selectNW:{get:function(){let e=this;return Fn(function(){e.tile=e.tile.northwestChild})}},selectNE:{get:function(){let e=this;return Fn(function(){e.tile=e.tile.northeastChild})}},selectSW:{get:function(){let e=this;return Fn(function(){e.tile=e.tile.southwestChild})}},selectSE:{get:function(){let e=this;return Fn(function(){e.tile=e.tile.southeastChild})}},primitive:{get:function(){return this._primitive},set:function(e){let t=this._primitive;e!==t&&(this.hasPickedPrimitive=!0,l(t)&&(t.debugShowBoundingVolume=!1),this._scene.debugCommandFilter=void 0,l(this._modelMatrixPrimitive)&&(this._scene.primitives.remove(this._modelMatrixPrimitive),this._modelMatrixPrimitive=void 0),this._primitive=e,e.show=!1,setTimeout(function(){e.show=!0},50),this.showPrimitiveBoundingSphere(),this.showPrimitiveReferenceFrame(),this.doFilterPrimitive())}},tile:{get:function(){return this._tile},set:function(e){if(l(e)){this.hasPickedTile=!0;let t=this._tile;if(e!==t){this.tileText=`L: ${e.level} X: ${e.x} Y: ${e.y}`,this.tileText+=`<br>SW corner: ${e.rectangle.west}, ${e.rectangle.south}`,this.tileText+=`<br>NE corner: ${e.rectangle.east}, ${e.rectangle.north}`;let n=e.data;l(n)&&l(n.tileBoundingRegion)?this.tileText+=`<br>Min: ${n.tileBoundingRegion.minimumHeight} Max: ${n.tileBoundingRegion.maximumHeight}`:this.tileText+="<br>(Tile is not loaded)"}this._tile=e,this.showTileBoundingSphere(),this.doFilterTile()}else this.hasPickedTile=!1,this._tile=void 0}}});x5.prototype._update=function(){this.frustums&&(this.frustumStatisticText=fBt(this._scene.debugFrustumStatistics));let e=this._scene.numberOfFrustums;this._numberOfFrustums=e,this.depthFrustum=ole(1,e,this.depthFrustum),this.depthFrustumText=`${this.depthFrustum} of ${e}`,this.performance&&this._performanceDisplay.update(),this.primitiveReferenceFrame&&(this._modelMatrixPrimitive.modelMatrix=this._primitive.modelMatrix),this.shaderCacheText=`Cached shaders: ${this._scene.context.shaderCache.numberOfShaders}`};x5.prototype.isDestroyed=function(){return!1};x5.prototype.destroy=function(){return this._eventHandler.destroy(),this._removePostRenderEvent(),this._frustumsSubscription.dispose(),this._frustumPlanesSubscription.dispose(),this._performanceSubscription.dispose(),this._primitiveBoundingSphereSubscription.dispose(),this._primitiveReferenceFrameSubscription.dispose(),this._filterPrimitiveSubscription.dispose(),this._wireframeSubscription.dispose(),this._depthFrustumSubscription.dispose(),this._suspendUpdatesSubscription.dispose(),this._tileCoordinatesSubscription.dispose(),this._tileBoundingSphereSubscription.dispose(),this._filterTileSubscription.dispose(),this._pickPrimitiveActiveSubscription.dispose(),this._pickTileActiveSubscription.dispose(),ue(this)};var T5=x5;function YJ(e,t){e=Nn(e);let n=document.createElement("div"),i=new T5(t,n);this._viewModel=i,this._container=e;let o=document.createElement("div");this._element=o;let r=document.createElement("div");r.textContent="Cesium Inspector",r.className="cesium-cesiumInspector-button",r.setAttribute("data-bind","click: toggleDropDown"),o.appendChild(r),o.className="cesium-cesiumInspector",o.setAttribute("data-bind",'css: { "cesium-cesiumInspector-visible" : dropDownVisible, "cesium-cesiumInspector-hidden" : !dropDownVisible }'),e.appendChild(this._element);let s=document.createElement("div");s.className="cesium-cesiumInspector-dropDown",o.appendChild(s);let a=fu.createSection,c=fu.createCheckbox,d=a(s,"General","generalVisible","toggleGeneral"),u=c("Show Frustums","frustums"),m=document.createElement("div");m.className="cesium-cesiumInspector-frustumStatistics",m.setAttribute("data-bind","visible: frustums, html: frustumStatisticText"),u.appendChild(m),d.appendChild(u),d.appendChild(c("Show Frustum Planes","frustumPlanes")),d.appendChild(c("Performance Display","performance")),n.className="cesium-cesiumInspector-performanceDisplay",d.appendChild(n);let p=document.createElement("div");p.className="cesium-cesiumInspector-shaderCache",p.setAttribute("data-bind","html: shaderCacheText"),d.appendChild(p);let b=document.createElement("div");d.appendChild(b);let f=document.createElement("span");f.setAttribute("data-bind",'html: "     Frustum:"'),b.appendChild(f);let y=document.createElement("span");y.setAttribute("data-bind","text: depthFrustumText"),b.appendChild(y);let _=document.createElement("input");_.type="button",_.value="-",_.className="cesium-cesiumInspector-pickButton",_.setAttribute("data-bind","click: decrementDepthFrustum"),b.appendChild(_);let S=document.createElement("input");S.type="button",S.value="+",S.className="cesium-cesiumInspector-pickButton",S.setAttribute("data-bind","click: incrementDepthFrustum"),b.appendChild(S);let Z=a(s,"Primitives","primitivesVisible","togglePrimitives"),R=document.createElement("div");R.className="cesium-cesiumInspector-pickSection",Z.appendChild(R);let C=document.createElement("input");C.type="button",C.value="Pick a primitive",C.className="cesium-cesiumInspector-pickButton",C.setAttribute("data-bind",'css: {"cesium-cesiumInspector-pickButtonHighlight" : pickPrimitiveActive}, click: pickPrimitive');let E=document.createElement("div");E.className="cesium-cesiumInspector-center",E.appendChild(C),R.appendChild(E),R.appendChild(c("Show bounding sphere","primitiveBoundingSphere","hasPickedPrimitive")),R.appendChild(c("Show reference frame","primitiveReferenceFrame","hasPickedPrimitive")),this._primitiveOnly=c("Show only selected","filterPrimitive","hasPickedPrimitive"),R.appendChild(this._primitiveOnly);let A=a(s,"Terrain","terrainVisible","toggleTerrain"),L=document.createElement("div");L.className="cesium-cesiumInspector-pickSection",A.appendChild(L);let F=document.createElement("input");F.type="button",F.value="Pick a tile",F.className="cesium-cesiumInspector-pickButton",F.setAttribute("data-bind",'css: {"cesium-cesiumInspector-pickButtonHighlight" : pickTileActive}, click: pickTile'),E=document.createElement("div"),E.appendChild(F),E.className="cesium-cesiumInspector-center",L.appendChild(E);let I=document.createElement("div");L.appendChild(I);let N=document.createElement("input");N.type="button",N.value="Parent",N.className="cesium-cesiumInspector-pickButton",N.setAttribute("data-bind","click: selectParent");let g=document.createElement("input");g.type="button",g.value="NW",g.className="cesium-cesiumInspector-pickButton",g.setAttribute("data-bind","click: selectNW");let V=document.createElement("input");V.type="button",V.value="NE",V.className="cesium-cesiumInspector-pickButton",V.setAttribute("data-bind","click: selectNE");let G=document.createElement("input");G.type="button",G.value="SW",G.className="cesium-cesiumInspector-pickButton",G.setAttribute("data-bind","click: selectSW");let v=document.createElement("input");v.type="button",v.value="SE",v.className="cesium-cesiumInspector-pickButton",v.setAttribute("data-bind","click: selectSE");let X=document.createElement("div");X.className="cesium-cesiumInspector-tileText",I.className="cesium-cesiumInspector-frustumStatistics",I.appendChild(X),I.setAttribute("data-bind","visible: hasPickedTile"),X.setAttribute("data-bind","html: tileText");let Y=document.createElement("div");Y.className="cesium-cesiumInspector-relativeText",Y.textContent="Select relative:",I.appendChild(Y);let D=document.createElement("table"),M=document.createElement("tr"),O=document.createElement("tr"),w=document.createElement("td");w.appendChild(N);let z=document.createElement("td");z.appendChild(g);let K=document.createElement("td");K.appendChild(V),M.appendChild(w),M.appendChild(z),M.appendChild(K);let te=document.createElement("td"),H=document.createElement("td");H.appendChild(G);let $=document.createElement("td");$.appendChild(v),O.appendChild(te),O.appendChild(H),O.appendChild($),D.appendChild(M),D.appendChild(O),I.appendChild(D),L.appendChild(c("Show bounding volume","tileBoundingSphere","hasPickedTile")),L.appendChild(c("Show only selected","filterTile","hasPickedTile")),A.appendChild(c("Wireframe","wireframe")),A.appendChild(c("Suspend LOD update","suspendUpdates")),A.appendChild(c("Show tile coordinates","tileCoordinates")),Ee.applyBindings(i,this._element)}Object.defineProperties(YJ.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}}});YJ.prototype.isDestroyed=function(){return!1};YJ.prototype.destroy=function(){return Ee.cleanNode(this._element),this._container.removeChild(this._element),this.viewModel.destroy(),ue(this)};var _5=YJ;var $ur=x(T(),1);var zur=x(T(),1);function MJ(e,t){l(t)||(t=document.body),t=Nn(t);let n=this,i=Ee.observable(qr.fullscreen),o=Ee.observable(qr.enabled),r=t.ownerDocument;this.isFullscreen=void 0,Ee.defineProperty(this,"isFullscreen",{get:function(){return i()}}),this.isFullscreenEnabled=void 0,Ee.defineProperty(this,"isFullscreenEnabled",{get:function(){return o()},set:function(s){o(s&&qr.enabled)}}),this.tooltip=void 0,Ee.defineProperty(this,"tooltip",function(){return this.isFullscreenEnabled?i()?"Exit full screen":"Full screen":"Full screen unavailable"}),this._command=Fn(function(){qr.fullscreen?qr.exitFullscreen():qr.requestFullscreen(n._fullscreenElement)},Ee.getObservable(this,"isFullscreenEnabled")),this._fullscreenElement=Nn(e)??r.body,this._callback=function(){i(qr.fullscreen)},r.addEventListener(qr.changeEventName,this._callback)}Object.defineProperties(MJ.prototype,{fullscreenElement:{get:function(){return this._fullscreenElement},set:function(e){this._fullscreenElement=e}},command:{get:function(){return this._command}}});MJ.prototype.isDestroyed=function(){return!1};MJ.prototype.destroy=function(){document.removeEventListener(qr.changeEventName,this._callback),ue(this)};var S5=MJ;var gBt="M 83.96875 17.5625 L 83.96875 17.59375 L 76.65625 24.875 L 97.09375 24.96875 L 76.09375 45.96875 L 81.9375 51.8125 L 102.78125 30.9375 L 102.875 51.15625 L 110.15625 43.875 L 110.1875 17.59375 L 83.96875 17.5625 z M 44.125 17.59375 L 17.90625 17.625 L 17.9375 43.90625 L 25.21875 51.1875 L 25.3125 30.96875 L 46.15625 51.8125 L 52 45.96875 L 31 25 L 51.4375 24.90625 L 44.125 17.59375 z M 46.0625 76.03125 L 25.1875 96.875 L 25.09375 76.65625 L 17.8125 83.9375 L 17.8125 110.21875 L 44 110.25 L 51.3125 102.9375 L 30.90625 102.84375 L 51.875 81.875 L 46.0625 76.03125 z M 82 76.15625 L 76.15625 82 L 97.15625 103 L 76.71875 103.0625 L 84.03125 110.375 L 110.25 110.34375 L 110.21875 84.0625 L 102.9375 76.8125 L 102.84375 97 L 82 76.15625 z",yBt="M 104.34375 17.5625 L 83.5 38.4375 L 83.40625 18.21875 L 76.125 25.5 L 76.09375 51.78125 L 102.3125 51.8125 L 102.3125 51.78125 L 109.625 44.5 L 89.1875 44.40625 L 110.1875 23.40625 L 104.34375 17.5625 z M 23.75 17.59375 L 17.90625 23.4375 L 38.90625 44.4375 L 18.5 44.53125 L 25.78125 51.8125 L 52 51.78125 L 51.96875 25.53125 L 44.6875 18.25 L 44.625 38.46875 L 23.75 17.59375 z M 25.6875 76.03125 L 18.375 83.3125 L 38.78125 83.40625 L 17.8125 104.40625 L 23.625 110.25 L 44.5 89.375 L 44.59375 109.59375 L 51.875 102.3125 L 51.875 76.0625 L 25.6875 76.03125 z M 102.375 76.15625 L 76.15625 76.1875 L 76.1875 102.4375 L 83.46875 109.71875 L 83.5625 89.53125 L 104.40625 110.375 L 110.25 104.53125 L 89.25 83.53125 L 109.6875 83.46875 L 102.375 76.15625 z";function wJ(e,t){e=Nn(e);let n=new S5(t,e);n._exitFullScreenPath=yBt,n._enterFullScreenPath=gBt;let i=document.createElement("button");i.type="button",i.className="cesium-button cesium-fullscreenButton",i.setAttribute("data-bind","attr: { title: tooltip },click: command,enable: isFullscreenEnabled,cesiumSvgPath: { path: isFullscreen ? _exitFullScreenPath : _enterFullScreenPath, width: 128, height: 128 }"),e.appendChild(i),Ee.applyBindings(n,i),this._container=e,this._viewModel=n,this._element=i}Object.defineProperties(wJ.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}}});wJ.prototype.isDestroyed=function(){return!1};wJ.prototype.destroy=function(){return this._viewModel.destroy(),Ee.cleanNode(this._element),this._container.removeChild(this._element),ue(this)};var Z5=wJ;var dmr=x(T(),1);var imr=x(T(),1);function dYe(e,t){this._scene=e,this._duration=t;let n=this;this._command=Fn(function(){n._scene.camera.flyHome(n._duration)}),this.tooltip="View Home",Ee.track(this,["tooltip"])}Object.defineProperties(dYe.prototype,{scene:{get:function(){return this._scene}},command:{get:function(){return this._command}},duration:{get:function(){return this._duration},set:function(e){this._duration=e}}});var R5=dYe;function kJ(e,t,n){e=Nn(e);let i=new R5(t,n);i._svgPath="M14,4l-10,8.75h20l-4.25-3.7188v-4.6562h-2.812v2.1875l-2.938-2.5625zm-7.0938,9.906v10.094h14.094v-10.094h-14.094zm2.1876,2.313h3.3122v4.25h-3.3122v-4.25zm5.8442,1.281h3.406v6.438h-3.406v-6.438z";let o=document.createElement("button");o.type="button",o.className="cesium-button cesium-toolbar-button cesium-home-button",o.setAttribute("data-bind","attr: { title: tooltip },click: command,cesiumSvgPath: { path: _svgPath, width: 28, height: 28 }"),e.appendChild(o),Ee.applyBindings(i,o),this._container=e,this._viewModel=i,this._element=o}Object.defineProperties(kJ.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}}});kJ.prototype.isDestroyed=function(){return!1};kJ.prototype.destroy=function(){return Ee.cleanNode(this._element),this._container.removeChild(this._element),ue(this)};var C5=kJ;var Smr=x(T(),1);var pmr=x(T(),1);function xBt(e){return function(t){let n=e._scene.pick(t.position);l(n)&&n.primitive instanceof zr&&(e.tileset=n.primitive),e.pickActive=!1}}function mYe(e,t){t?e._eventHandler.setInputAction(function(n){let i=e._scene.pick(n.endPosition);l(i)&&i.primitive instanceof zr&&(e.tileset=i.primitive)},mn.MOUSE_MOVE):(e._eventHandler.removeInputAction(mn.MOUSE_MOVE),e.picking=e.picking)}var TBt={maximumFractionDigits:3};function V5(e){let t=e/1048576;return t<1?t.toLocaleString(void 0,TBt):Math.round(t).toLocaleString()}function E5(e,t){if(!l(e))return"";let n=t?e._statisticsPerPass[lr.PICK]:e._statisticsPerPass[lr.RENDER],i='<ul class="cesium-cesiumInspector-statistics">';return i+=`<li><strong>Visited: </strong>${n.visited.toLocaleString()}</li><li><strong>Selected: </strong>${n.selected.toLocaleString()}</li><li><strong>Commands: </strong>${n.numberOfCommands.toLocaleString()}</li>`,i+="</ul>",t||(i+='<ul class="cesium-cesiumInspector-statistics">',i+=`<li><strong>Requests: </strong>${n.numberOfPendingRequests.toLocaleString()}</li><li><strong>Attempted: </strong>${n.numberOfAttemptedRequests.toLocaleString()}</li><li><strong>Processing: </strong>${n.numberOfTilesProcessing.toLocaleString()}</li><li><strong>Content Ready: </strong>${n.numberOfTilesWithContentReady.toLocaleString()}</li><li><strong>Total: </strong>${n.numberOfTilesTotal.toLocaleString()}</li>`,i+="</ul>",i+='<ul class="cesium-cesiumInspector-statistics">',i+=`<li><strong>Features Selected: </strong>${n.numberOfFeaturesSelected.toLocaleString()}</li><li><strong>Features Loaded: </strong>${n.numberOfFeaturesLoaded.toLocaleString()}</li><li><strong>Points Selected: </strong>${n.numberOfPointsSelected.toLocaleString()}</li><li><strong>Points Loaded: </strong>${n.numberOfPointsLoaded.toLocaleString()}</li><li><strong>Triangles Selected: </strong>${n.numberOfTrianglesSelected.toLocaleString()}</li>`,i+="</ul>",i+='<ul class="cesium-cesiumInspector-statistics">',i+=`<li><strong>Tiles styled: </strong>${n.numberOfTilesStyled.toLocaleString()}</li><li><strong>Features styled: </strong>${n.numberOfFeaturesStyled.toLocaleString()}</li>`,i+="</ul>",i+='<ul class="cesium-cesiumInspector-statistics">',i+=`<li><strong>Children Union Culled: </strong>${n.numberOfTilesCulledWithChildrenUnion.toLocaleString()}</li>`,i+="</ul>",i+='<ul class="cesium-cesiumInspector-statistics">',i+=`<li><strong>Geometry Memory (MB): </strong>${V5(n.geometryByteLength)}</li><li><strong>Texture Memory (MB): </strong>${V5(n.texturesByteLength)}</li><li><strong>Batch Table Memory (MB): </strong>${V5(n.batchTableByteLength)}</li>`,i+="</ul>"),i}function hYe(){let e=Ni.statistics;return` - <ul class="cesium-cesiumInspector-statistics"> - <li><strong>Geometry Memory (MB): </strong>${V5(e.geometryByteLength)}</li> - <li><strong>Texture Memory (MB): </strong>${V5(e.texturesByteLength)}</li> - </ul> - `}var _Bt=[{text:"Highlight",value:Xd.HIGHLIGHT},{text:"Replace",value:Xd.REPLACE},{text:"Mix",value:Xd.MIX}],uYe=new U(1,1,0,.4),SBt=new U,UJ=new U;function Zc(e,t){let n=this,i=e.canvas;this._eventHandler=new aa(i),this._scene=e,this._performanceContainer=t,this._canvas=i,this._performanceDisplay=new qg({container:t}),this._statisticsText="",this._pickStatisticsText="",this._resourceCacheStatisticsText="",this._editorError="",this.performance=!1,this.showStatistics=!0,this.showPickStatistics=!0,this.showResourceCacheStatistics=!1,this.inspectorVisible=!0,this.tilesetVisible=!1,this.displayVisible=!1,this.updateVisible=!1,this.loggingVisible=!1,this.styleVisible=!1,this.tileDebugLabelsVisible=!1,this.optimizationVisible=!1,this.styleString="{}",this.hasEnabledWireframe=!1,this._tileset=void 0,this._feature=void 0,this._tile=void 0,Ee.track(this,["performance","inspectorVisible","_statisticsText","_pickStatisticsText","_resourceCacheStatisticsText","_editorError","showPickStatistics","showStatistics","showResourceCacheStatistics","tilesetVisible","displayVisible","updateVisible","loggingVisible","styleVisible","optimizationVisible","tileDebugLabelsVisible","styleString","_feature","_tile","_tileset","hasEnabledWireframe"]),this._properties=Ee.observable({}),this.properties=[],Ee.defineProperty(this,"properties",function(){let w=[],z=n._properties();for(let K in z)z.hasOwnProperty(K)&&w.push(K);return w});let o=Ee.observable();Ee.defineProperty(this,"dynamicScreenSpaceError",{get:function(){return o()},set:function(w){o(w),l(n._tileset)&&(n._tileset.dynamicScreenSpaceError=w)}}),this.dynamicScreenSpaceError=!1;let r=Ee.observable();Ee.defineProperty(this,"colorBlendMode",{get:function(){return r()},set:function(w){r(w),l(n._tileset)&&(n._tileset.colorBlendMode=w,n._scene.requestRender())}}),this.colorBlendMode=Xd.HIGHLIGHT;let s=Ee.observable(),a=Ee.observable();Ee.defineProperty(this,"picking",{get:function(){return a()},set:function(w){a(w),w?n._eventHandler.setInputAction(function(z){let K=e.pick(z.endPosition);if(K instanceof ea?(n.feature=K,n.tile=K.content.tile):l(K)&&l(K.content)?(n.feature=void 0,n.tile=K.content.tile):(n.feature=void 0,n.tile=void 0),!!l(n._tileset)){if(s&&l(K)&&l(K.content)){let te;e.pickPositionSupported&&(te=e.pickPosition(z.endPosition),l(te)&&(n._tileset.debugPickPosition=te)),n._tileset.debugPickedTile=K.content.tile}else n._tileset.debugPickedTile=void 0;n._scene.requestRender()}},mn.MOUSE_MOVE):(n.feature=void 0,n.tile=void 0,n._eventHandler.removeInputAction(mn.MOUSE_MOVE))}}),this.picking=!0;let c=Ee.observable();Ee.defineProperty(this,"colorize",{get:function(){return c()},set:function(w){c(w),l(n._tileset)&&(n._tileset.debugColorizeTiles=w,n._scene.requestRender())}}),this.colorize=!1;let d=Ee.observable();Ee.defineProperty(this,"wireframe",{get:function(){return d()},set:function(w){d(w),l(n._tileset)&&(n._tileset.debugWireframe=w,n._scene.requestRender())}}),this.wireframe=!1;let u=Ee.observable();Ee.defineProperty(this,"showBoundingVolumes",{get:function(){return u()},set:function(w){u(w),l(n._tileset)&&(n._tileset.debugShowBoundingVolume=w,n._scene.requestRender())}}),this.showBoundingVolumes=!1;let m=Ee.observable();Ee.defineProperty(this,"showContentBoundingVolumes",{get:function(){return m()},set:function(w){m(w),l(n._tileset)&&(n._tileset.debugShowContentBoundingVolume=w,n._scene.requestRender())}}),this.showContentBoundingVolumes=!1;let p=Ee.observable();Ee.defineProperty(this,"showRequestVolumes",{get:function(){return p()},set:function(w){p(w),l(n._tileset)&&(n._tileset.debugShowViewerRequestVolume=w,n._scene.requestRender())}}),this.showRequestVolumes=!1;let b=Ee.observable();Ee.defineProperty(this,"freezeFrame",{get:function(){return b()},set:function(w){b(w),l(n._tileset)&&(n._tileset.debugFreezeFrame=w,n._scene.debugShowFrustumPlanes=w,n._scene.requestRender())}}),this.freezeFrame=!1,Ee.defineProperty(this,"showOnlyPickedTileDebugLabel",{get:function(){return s()},set:function(w){s(w),l(n._tileset)&&(n._tileset.debugPickedTileLabelOnly=w,n._scene.requestRender())}}),this.showOnlyPickedTileDebugLabel=!1;let f=Ee.observable();Ee.defineProperty(this,"showGeometricError",{get:function(){return f()},set:function(w){f(w),l(n._tileset)&&(n._tileset.debugShowGeometricError=w,n._scene.requestRender())}}),this.showGeometricError=!1;let y=Ee.observable();Ee.defineProperty(this,"showRenderingStatistics",{get:function(){return y()},set:function(w){y(w),l(n._tileset)&&(n._tileset.debugShowRenderingStatistics=w,n._scene.requestRender())}}),this.showRenderingStatistics=!1;let _=Ee.observable();Ee.defineProperty(this,"showMemoryUsage",{get:function(){return _()},set:function(w){_(w),l(n._tileset)&&(n._tileset.debugShowMemoryUsage=w,n._scene.requestRender())}}),this.showMemoryUsage=!1;let S=Ee.observable();Ee.defineProperty(this,"showUrl",{get:function(){return S()},set:function(w){S(w),l(n._tileset)&&(n._tileset.debugShowUrl=w,n._scene.requestRender())}}),this.showUrl=!1;let Z=Ee.observable();Ee.defineProperty(this,"maximumScreenSpaceError",{get:function(){return Z()},set:function(w){w=Number(w),isNaN(w)||(Z(w),l(n._tileset)&&(n._tileset.maximumScreenSpaceError=w))}}),this.maximumScreenSpaceError=16;let R=Ee.observable();Ee.defineProperty(this,"dynamicScreenSpaceErrorDensity",{get:function(){return R()},set:function(w){w=Number(w),isNaN(w)||(R(w),l(n._tileset)&&(n._tileset.dynamicScreenSpaceErrorDensity=w))}}),this.dynamicScreenSpaceErrorDensity=2e-4,this.dynamicScreenSpaceErrorDensitySliderValue=void 0,Ee.defineProperty(this,"dynamicScreenSpaceErrorDensitySliderValue",{get:function(){return Math.pow(R(),1/6)},set:function(w){let z=Math.pow(w,6);R(z),l(n._tileset)&&(n._tileset.dynamicScreenSpaceErrorDensity=z)}});let C=Ee.observable();Ee.defineProperty(this,"dynamicScreenSpaceErrorFactor",{get:function(){return C()},set:function(w){w=Number(w),isNaN(w)||(C(w),l(n._tileset)&&(n._tileset.dynamicScreenSpaceErrorFactor=w))}}),this.dynamicScreenSpaceErrorFactor=24;let E=xBt(this),A=Ee.observable();Ee.defineProperty(this,"pickActive",{get:function(){return A()},set:function(w){A(w),w?n._eventHandler.setInputAction(E,mn.LEFT_CLICK):n._eventHandler.removeInputAction(mn.LEFT_CLICK)}});let L=Ee.observable();Ee.defineProperty(this,"pointCloudShading",{get:function(){return L()},set:function(w){L(w),l(n._tileset)&&(n._tileset.pointCloudShading.attenuation=w)}}),this.pointCloudShading=!1;let F=Ee.observable();Ee.defineProperty(this,"geometricErrorScale",{get:function(){return F()},set:function(w){w=Number(w),isNaN(w)||(F(w),l(n._tileset)&&(n._tileset.pointCloudShading.geometricErrorScale=w))}}),this.geometricErrorScale=1;let I=Ee.observable();Ee.defineProperty(this,"maximumAttenuation",{get:function(){return I()},set:function(w){w=Number(w),isNaN(w)||(I(w),l(n._tileset)&&(n._tileset.pointCloudShading.maximumAttenuation=w===0?void 0:w))}}),this.maximumAttenuation=0;let N=Ee.observable();Ee.defineProperty(this,"baseResolution",{get:function(){return N()},set:function(w){w=Number(w),isNaN(w)||(N(w),l(n._tileset)&&(n._tileset.pointCloudShading.baseResolution=w===0?void 0:w))}}),this.baseResolution=0;let g=Ee.observable();Ee.defineProperty(this,"eyeDomeLighting",{get:function(){return g()},set:function(w){g(w),l(n._tileset)&&(n._tileset.pointCloudShading.eyeDomeLighting=w)}}),this.eyeDomeLighting=!1;let V=Ee.observable();Ee.defineProperty(this,"eyeDomeLightingStrength",{get:function(){return V()},set:function(w){w=Number(w),isNaN(w)||(V(w),l(n._tileset)&&(n._tileset.pointCloudShading.eyeDomeLightingStrength=w))}}),this.eyeDomeLightingStrength=1;let G=Ee.observable();Ee.defineProperty(this,"eyeDomeLightingRadius",{get:function(){return G()},set:function(w){w=Number(w),isNaN(w)||(G(w),l(n._tileset)&&(n._tileset.pointCloudShading.eyeDomeLightingRadius=w))}}),this.eyeDomeLightingRadius=1,this.pickActive=!1;let v=Ee.observable();Ee.defineProperty(this,"skipLevelOfDetail",{get:function(){return v()},set:function(w){v(w),l(n._tileset)&&(n._tileset.skipLevelOfDetail=w)}}),this.skipLevelOfDetail=!0;let X=Ee.observable();Ee.defineProperty(this,"skipScreenSpaceErrorFactor",{get:function(){return X()},set:function(w){w=Number(w),isNaN(w)||(X(w),l(n._tileset)&&(n._tileset.skipScreenSpaceErrorFactor=w))}}),this.skipScreenSpaceErrorFactor=16;let Y=Ee.observable();Ee.defineProperty(this,"baseScreenSpaceError",{get:function(){return Y()},set:function(w){w=Number(w),isNaN(w)||(Y(w),l(n._tileset)&&(n._tileset.baseScreenSpaceError=w))}}),this.baseScreenSpaceError=1024;let D=Ee.observable();Ee.defineProperty(this,"skipLevels",{get:function(){return D()},set:function(w){w=Number(w),isNaN(w)||(D(w),l(n._tileset)&&(n._tileset.skipLevels=w))}}),this.skipLevels=1;let M=Ee.observable();Ee.defineProperty(this,"immediatelyLoadDesiredLevelOfDetail",{get:function(){return M()},set:function(w){M(w),l(n._tileset)&&(n._tileset.immediatelyLoadDesiredLevelOfDetail=w)}}),this.immediatelyLoadDesiredLevelOfDetail=!1;let O=Ee.observable();Ee.defineProperty(this,"loadSiblings",{get:function(){return O()},set:function(w){O(w),l(n._tileset)&&(n._tileset.loadSiblings=w)}}),this.loadSiblings=!1,this._style=void 0,this._shouldStyle=!1,this._definedProperties=["properties","dynamicScreenSpaceError","colorBlendMode","picking","colorize","wireframe","showBoundingVolumes","showContentBoundingVolumes","showRequestVolumes","freezeFrame","maximumScreenSpaceError","dynamicScreenSpaceErrorDensity","baseScreenSpaceError","skipScreenSpaceErrorFactor","skipLevelOfDetail","skipLevels","immediatelyLoadDesiredLevelOfDetail","loadSiblings","dynamicScreenSpaceErrorDensitySliderValue","dynamicScreenSpaceErrorFactor","pickActive","showOnlyPickedTileDebugLabel","showGeometricError","showRenderingStatistics","showMemoryUsage","showUrl","pointCloudShading","geometricErrorScale","maximumAttenuation","baseResolution","eyeDomeLighting","eyeDomeLightingStrength","eyeDomeLightingRadius"],this._removePostRenderEvent=e.postRender.addEventListener(function(){n._update()}),l(this._tileset)||mYe(this,!0)}Object.defineProperties(Zc.prototype,{scene:{get:function(){return this._scene}},performanceContainer:{get:function(){return this._performanceContainer}},statisticsText:{get:function(){return this._statisticsText}},pickStatisticsText:{get:function(){return this._pickStatisticsText}},resourceCacheStatisticsText:{get:function(){return this._resourceCacheStatisticsText}},colorBlendModes:{get:function(){return _Bt}},editorError:{get:function(){return this._editorError}},tileset:{get:function(){return this._tileset},set:function(e){if(this._tileset=e,this._style=void 0,this.styleString="{}",this.feature=void 0,this.tile=void 0,l(e)){this._properties(e.properties);let t=["colorize","wireframe","showBoundingVolumes","showContentBoundingVolumes","showRequestVolumes","freezeFrame","showOnlyPickedTileDebugLabel","showGeometricError","showRenderingStatistics","showMemoryUsage","showUrl"],n=t.length;for(let o=0;o<n;++o){let r=t[o];this[r]=this[r]}this.maximumScreenSpaceError=e.maximumScreenSpaceError,this.dynamicScreenSpaceError=e.dynamicScreenSpaceError,this.dynamicScreenSpaceErrorDensity=e.dynamicScreenSpaceErrorDensity,this.dynamicScreenSpaceErrorFactor=e.dynamicScreenSpaceErrorFactor,this.colorBlendMode=e.colorBlendMode,this.skipLevelOfDetail=e.skipLevelOfDetail,this.skipScreenSpaceErrorFactor=e.skipScreenSpaceErrorFactor,this.baseScreenSpaceError=e.baseScreenSpaceError,this.skipLevels=e.skipLevels,this.immediatelyLoadDesiredLevelOfDetail=e.immediatelyLoadDesiredLevelOfDetail,this.loadSiblings=e.loadSiblings,this.hasEnabledWireframe=e._enableDebugWireframe;let i=e.pointCloudShading;this.pointCloudShading=i.attenuation,this.geometricErrorScale=i.geometricErrorScale,this.maximumAttenuation=i.maximumAttenuation?i.maximumAttenuation:0,this.baseResolution=i.baseResolution?i.baseResolution:0,this.eyeDomeLighting=i.eyeDomeLighting,this.eyeDomeLightingStrength=i.eyeDomeLightingStrength,this.eyeDomeLightingRadius=i.eyeDomeLightingRadius,this._scene.requestRender()}else this._properties({});this._statisticsText=E5(e,!1),this._pickStatisticsText=E5(e,!0),this._resourceCacheStatisticsText=hYe(),mYe(this,!1)}},feature:{get:function(){return this._feature},set:function(e){if(this._feature===e)return;let t=this._feature;l(t)&&!t.content.isDestroyed()&&(!this.colorize&&l(this._style)?t.color=l(this._style.color)?this._style.color.evaluateColor(t,SBt):U.WHITE:t.color=UJ,this._scene.requestRender()),l(e)&&(U.clone(e.color,UJ),e.color=uYe,this._scene.requestRender()),this._feature=e}},tile:{get:function(){return this._tile},set:function(e){if(this._tile===e)return;let t=this._tile;l(t)&&!t.isDestroyed()&&!rle(t.content)&&(t.color=UJ,this._scene.requestRender()),l(e)&&!rle(e.content)&&(U.clone(e.color,UJ),e.color=uYe,this._scene.requestRender()),this._tile=e}}});function rle(e){if(!l(e))return!1;if(e.featuresLength>0)return!0;let t=e.innerContents;if(l(t)){let n=t.length;for(let i=0;i<n;++i)if(!rle(t[i]))return!1;return!0}return!1}Zc.prototype.togglePickTileset=function(){this.pickActive=!this.pickActive};Zc.prototype.toggleInspector=function(){this.inspectorVisible=!this.inspectorVisible};Zc.prototype.toggleTileset=function(){this.tilesetVisible=!this.tilesetVisible};Zc.prototype.toggleDisplay=function(){this.displayVisible=!this.displayVisible};Zc.prototype.toggleUpdate=function(){this.updateVisible=!this.updateVisible};Zc.prototype.toggleLogging=function(){this.loggingVisible=!this.loggingVisible};Zc.prototype.toggleStyle=function(){this.styleVisible=!this.styleVisible};Zc.prototype.toggleTileDebugLabels=function(){this.tileDebugLabelsVisible=!this.tileDebugLabelsVisible};Zc.prototype.toggleOptimization=function(){this.optimizationVisible=!this.optimizationVisible};Zc.prototype.trimTilesCache=function(){l(this._tileset)&&this._tileset.trimLoadedTiles()};Zc.prototype.compileStyle=function(){let e=this._tileset;if(!(!l(e)||this.styleString===JSON.stringify(e.style))){this._editorError="";try{this.styleString.length===0&&(this.styleString="{}"),this._style=new sg(JSON.parse(this.styleString)),this._shouldStyle=!0,this._scene.requestRender()}catch(t){this._editorError=t.toString()}this.feature=this._feature,this.tile=this._tile}};Zc.prototype.styleEditorKeyPress=function(e,t){if(t.keyCode===9){t.preventDefault();let n=t.target,i=n.selectionStart,o=n.selectionEnd,r=o,a=n.value.slice(i,o).split(` -`),c=a.length,d;if(t.shiftKey)for(d=0;d<c;++d)a[d][0]===" "&&(a[d][1]===" "?(a[d]=a[d].substr(2),r-=2):(a[d]=a[d].substr(1),r-=1));else for(d=0;d<c;++d)a[d]=` ${a[d]}`,r+=2;let u=a.join(` -`);n.value=n.value.slice(0,i)+u+n.value.slice(o),n.selectionStart=i!==o?i:r,n.selectionEnd=r}else t.ctrlKey&&(t.keyCode===10||t.keyCode===13)&&this.compileStyle();return!0};Zc.prototype._update=function(){let e=this._tileset;if(this.performance&&this._performanceDisplay.update(),l(e)){if(e.isDestroyed()){this.tile=void 0,this.feature=void 0,this.tileset=void 0;return}let t=e.style;this._style!==e.style&&(this._shouldStyle?(e.style=this._style,this._shouldStyle=!1):(this._style=t,this.styleString=JSON.stringify(t.style,null," ")))}this.showStatistics&&(this._statisticsText=E5(e,!1),this._pickStatisticsText=E5(e,!0),this._resourceCacheStatisticsText=hYe())};Zc.prototype.isDestroyed=function(){return!1};Zc.prototype.destroy=function(){this._eventHandler.destroy(),this._removePostRenderEvent();let e=this;return this._definedProperties.forEach(function(t){Ee.getObservable(e,t).dispose()}),ue(this)};Zc.getStatistics=E5;var A5=Zc;function DJ(e,t){e=Nn(e);let n=document.createElement("div"),i=document.createElement("div");i.setAttribute("data-bind","visible: performance");let o=new A5(t,i);this._viewModel=o,this._container=e,this._element=n;let r=document.createElement("div");r.textContent="3D Tiles Inspector",r.className="cesium-cesiumInspector-button",r.setAttribute("data-bind","click: toggleInspector"),n.appendChild(r),n.className="cesium-cesiumInspector cesium-3DTilesInspector",n.setAttribute("data-bind",'css: { "cesium-cesiumInspector-visible" : inspectorVisible, "cesium-cesiumInspector-hidden" : !inspectorVisible}'),e.appendChild(n);let s=document.createElement("div");s.className="cesium-cesiumInspector-dropDown",n.appendChild(s);let a=fu.createSection,c=fu.createCheckbox,d=fu.createRangeInput,u=fu.createButton,m=a(s,"Tileset","tilesetVisible","toggleTileset"),p=a(s,"Display","displayVisible","toggleDisplay"),b=a(s,"Update","updateVisible","toggleUpdate"),f=a(s,"Logging","loggingVisible","toggleLogging"),y=a(s,"Tile Debug Labels","tileDebugLabelsVisible","toggleTileDebugLabels"),_=a(s,"Style","styleVisible","toggleStyle"),S=a(s,"Optimization","optimizationVisible","toggleOptimization"),Z=document.createElement("div");Z.className="field-group";let R=document.createElement("label");R.className="field-label",R.appendChild(document.createTextNode("Properties: "));let C=document.createElement("div");C.setAttribute("data-bind","text: properties"),Z.appendChild(R),Z.appendChild(C),m.appendChild(Z),m.appendChild(u("Pick Tileset","togglePickTileset","pickActive")),m.appendChild(u("Trim Tiles Cache","trimTilesCache")),m.appendChild(c("Enable Picking","picking")),p.appendChild(c("Colorize","colorize"));let E=p.appendChild(c("Wireframe","wireframe","_tileset === undefined || hasEnabledWireframe")),A=document.createElement("p");A.setAttribute("data-bind","visible: _tileset !== undefined && !hasEnabledWireframe"),A.setAttribute("class","cesium-3DTilesInspector-disabledElementsInfo"),A.innerText="Set enableDebugWireframe to true in the tileset constructor to enable this option.",E.appendChild(A),p.appendChild(c("Bounding Volumes","showBoundingVolumes")),p.appendChild(c("Content Volumes","showContentBoundingVolumes")),p.appendChild(c("Request Volumes","showRequestVolumes")),p.appendChild(c("Point Cloud Shading","pointCloudShading"));let L=document.createElement("div");L.setAttribute("data-bind","visible: pointCloudShading"),L.appendChild(d("Geometric Error Scale","geometricErrorScale",0,2,.01)),L.appendChild(d("Maximum Attenuation","maximumAttenuation",0,32,1)),L.appendChild(d("Base Resolution","baseResolution",0,1,.01)),L.appendChild(c("Eye Dome Lighting (EDL)","eyeDomeLighting")),p.appendChild(L);let F=document.createElement("div");F.setAttribute("data-bind","visible: eyeDomeLighting"),F.appendChild(d("EDL Strength","eyeDomeLightingStrength",0,2,.1)),F.appendChild(d("EDL Radius","eyeDomeLightingRadius",0,4,.1)),L.appendChild(F),b.appendChild(c("Freeze Frame","freezeFrame")),b.appendChild(c("Dynamic Screen Space Error","dynamicScreenSpaceError"));let I=document.createElement("div");I.appendChild(d("Maximum Screen Space Error","maximumScreenSpaceError",0,128,1)),b.appendChild(I);let N=document.createElement("div");N.setAttribute("data-bind","visible: dynamicScreenSpaceError"),N.appendChild(d("Screen Space Error Density","dynamicScreenSpaceErrorDensitySliderValue",0,1,.005,"dynamicScreenSpaceErrorDensity")),N.appendChild(d("Screen Space Error Factor","dynamicScreenSpaceErrorFactor",1,32,.1)),b.appendChild(N),f.appendChild(c("Performance","performance")),f.appendChild(i),f.appendChild(c("Statistics","showStatistics"));let g=document.createElement("div");g.className="cesium-3dTilesInspector-statistics",g.setAttribute("data-bind","html: statisticsText, visible: showStatistics"),f.appendChild(g),f.appendChild(c("Pick Statistics","showPickStatistics"));let V=document.createElement("div");V.className="cesium-3dTilesInspector-statistics",V.setAttribute("data-bind","html: pickStatisticsText, visible: showPickStatistics"),f.appendChild(V),f.appendChild(c("Resource Cache Statistics","showResourceCacheStatistics"));let G=document.createElement("div");G.className="cesium-3dTilesInspector-statistics",G.setAttribute("data-bind","html: resourceCacheStatisticsText, visible: showResourceCacheStatistics"),f.appendChild(G);let v=document.createElement("div");_.appendChild(v),v.appendChild(document.createTextNode("Color Blend Mode: "));let X=document.createElement("select");X.setAttribute("data-bind",'options: colorBlendModes, optionsText: "text", optionsValue: "value", value: colorBlendMode'),v.appendChild(X);let Y=document.createElement("textarea");Y.setAttribute("data-bind","textInput: styleString, event: { keydown: styleEditorKeyPress }"),v.className="cesium-cesiumInspector-styleEditor",v.appendChild(Y);let D=u("Compile (Ctrl+Enter)","compileStyle");v.appendChild(D);let M=document.createElement("div");M.className="cesium-cesiumInspector-error",M.setAttribute("data-bind","text: editorError"),v.appendChild(M),y.appendChild(c("Show Picked Only","showOnlyPickedTileDebugLabel")),y.appendChild(c("Geometric Error","showGeometricError")),y.appendChild(c("Rendering Statistics","showRenderingStatistics")),y.appendChild(c("Memory Usage (MB)","showMemoryUsage")),y.appendChild(c("Url","showUrl")),S.appendChild(c("Skip Tile LODs","skipLevelOfDetail"));let O=document.createElement("div");O.appendChild(d("Skip SSE Factor","skipScreenSpaceErrorFactor",1,50,1)),S.appendChild(O);let w=document.createElement("div");w.appendChild(d("SSE before skipping LOD","baseScreenSpaceError",0,4096,1)),S.appendChild(w);let z=document.createElement("div");z.appendChild(d("Min. levels to skip","skipLevels",0,10,1)),S.appendChild(z),S.appendChild(c("Load only tiles that meet the max SSE.","immediatelyLoadDesiredLevelOfDetail")),S.appendChild(c("Load siblings of visible tiles","loadSiblings")),Ee.applyBindings(o,n)}Object.defineProperties(DJ.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}}});DJ.prototype.isDestroyed=function(){return!1};DJ.prototype.destroy=function(){return Ee.cleanNode(this._element),this._container.removeChild(this._element),this.viewModel.destroy(),ue(this)};var G5=DJ;var vmr=x(T(),1);var Vmr=x(T(),1);function ZBt(e,t){t.currentTarget.parentElement.parentElement.querySelector(`#${e.name}-expander`).classList.toggle("active"),t.currentTarget.textContent=t.currentTarget.textContent==="+"?"-":"+"}function pYe(e,t){Ee.track(e);for(let n=0;n<e.sublayers.length;n++)pYe(e.sublayers[n],t)}function OJ(e){return e.modelName==="FullModel"}function bYe(e){return e.modelName==="Overview"}function gYe(e){return bYe(e)||OJ(e)}function fYe(e,t){if(gYe(e)){e.visibility=!1;for(let i=0;i<e.sublayers.length;i++)e.sublayers[i].visibility=!0;let n={name:e.name,modelName:e.modelName,disable:Ee.observable(!1),index:t.sublayers.length};return t.topLayers.push(n),t.sublayers.push(e),n}}function RBt(e,t){if(gYe(e)){t.sublayers.forEach(i=>i.visibility=!1),t.sublayers[e.index].visibility=!0;let n=document.getElementById("bsl-wrapper");OJ(e)?(t.currentLevel=t.selectedLevel,n.style.display="block"):(t.selectedLevel=t.currentLevel,t.currentLevel="All",n.style.display="none")}}async function CBt(e,t){try{let n=e.getAttributeNames();for(let i=0;i<n.length;i++)if(n[i]==="BldgLevel"){let o=e.getAttributeValues(n[i]);for(let r=0;r<o.length;r++)t.push(o[r])}t.sort((i,o)=>i-o),t.unshift("All")}catch(n){console.log(`There was an error getting attributes: ${n}`)}}function VBt(e){let t=this;this.levels=[],this.viewModel={sublayers:[],levels:this.levels,currentLevel:Ee.observable(),selectedLevel:"All",topLayers:[{name:"Select a layer to explore...",disable:Ee.observable(!0),index:-1}],currentLayer:Ee.observable(),expandClickHandler:ZBt,setOptionDisable:function(i,o){Ee.applyBindingsToNode(i,{disable:o.disable},o)},defaultLayer:void 0},this.viewModel.currentLayer.subscribe(function(i){RBt(i,t.viewModel)});let n=e.sublayers;for(let i=0;i<n.length;i++){pYe(n[i],this.viewModel);let o=fYe(n[i],this.viewModel);l(o)&&(bYe(o)||!l(this.viewModel.defaultLayer)&&OJ(o))&&(this.viewModel.defaultLayer=o)}if(this.viewModel.topLayers.length===1&&n.length>0){e.show=!1;let i={name:"Full Model",modelName:"FullModel",visibility:e.show,sublayers:e.sublayers};this.viewModel.defaultLayer=fYe(i,this.viewModel),this.viewModel.currentLayer.subscribe(function(o){e.show=OJ(o)})}else this.viewModel.topLayers.length===1&&(this.viewModel.topLayers[0].name="Building layers not found");return CBt(e,this.levels),this.viewModel.currentLevel.subscribe(function(i){i!=="All"?e.filterByAttributes([{name:"BldgLevel",values:[i]}]):e.filterByAttributes()}),this.viewModel}var L5=VBt;function EBt(e,t){let n=document.getElementById(e),i=document.createElement("div");i.classList.add("cesium-viewer-i3s-explorer"),i.innerHTML=` + © <a href="https://www.openstreetmap.org/about/" target="_blank">OpenStreetMap contributors</a>`})}})),e.push(new mr({name:"Sentinel-2",iconUrl:en("Widgets/Images/ImageryProviders/sentinel-2.png"),tooltip:"Sentinel-2 cloudless by EOX IT Services GmbH (Contains modified Copernicus Sentinel data 2016 and 2017).",category:"Cesium ion",creationFunction:function(){return sd.fromAssetId(3954)}})),e.push(new mr({name:"Blue Marble",iconUrl:en("Widgets/Images/ImageryProviders/blueMarble.png"),tooltip:"Blue Marble Next Generation July, 2004 imagery from NASA.",category:"Cesium ion",creationFunction:function(){return sd.fromAssetId(3845)}})),e.push(new mr({name:"Earth at night",iconUrl:en("Widgets/Images/ImageryProviders/earthAtNight.png"),tooltip:"The Earth at night, also known as The Black Marble, is a 500 meter resolution global composite imagery layer released by NASA.",category:"Cesium ion",creationFunction:function(){return sd.fromAssetId(3812)}})),e.push(new mr({name:"Natural Earth\xA0II",iconUrl:en("Widgets/Images/ImageryProviders/naturalEarthII.png"),tooltip:`Natural Earth II, darkened for contrast. +http://www.naturalearthdata.com/`,category:"Cesium ion",creationFunction:function(){return Cx.fromUrl(en("Assets/Textures/NaturalEarthII"))}})),e.push(new mr({name:"Google Maps Satellite",iconUrl:en("Widgets/Images/ImageryProviders/googleSatellite.png"),tooltip:"Imagery from Google Maps",category:"Cesium ion",creationFunction:function(){return sd.fromAssetId(3830182)}})),e.push(new mr({name:"Google Maps Satellite with Labels",iconUrl:en("Widgets/Images/ImageryProviders/googleSatelliteLabels.png"),tooltip:"Imagery with place labels from Google Maps",category:"Cesium ion",creationFunction:function(){return sd.fromAssetId(3830183)}})),e.push(new mr({name:"Google Maps Roadmap",iconUrl:en("Widgets/Images/ImageryProviders/googleRoadmap.png"),tooltip:"Labeled roads and other features on a base landscape from Google Maps",category:"Cesium ion",creationFunction:function(){return sd.fromAssetId(3830184)}})),e.push(new mr({name:"Google Maps Contour",iconUrl:en("Widgets/Images/ImageryProviders/googleContour.png"),tooltip:"Hillshade mapping, contour lines, natural features (roadmap features hidden) from Google Maps",category:"Cesium ion",creationFunction:function(){return sd.fromAssetId(3830186)}})),e.push(new mr({name:"Azure Maps Aerial",iconUrl:en("Widgets/Images/ImageryProviders/azureAerial.png"),tooltip:"Imagery from Azure Maps",category:"Cesium ion",creationFunction:function(){return sd.fromAssetId(3891168)}})),e.push(new mr({name:"Azure Maps Roads",iconUrl:en("Widgets/Images/ImageryProviders/azureRoads.png"),tooltip:"Labeled roads and other features on a base landscape from Azure Maps",category:"Cesium ion",creationFunction:function(){return sd.fromAssetId(3891169)}})),e}var R5=TBt;var $ur=x(T(),1);function _Bt(){let e=[];return e.push(new mr({name:"WGS84 Ellipsoid",iconUrl:en("Widgets/Images/TerrainProviders/Ellipsoid.png"),tooltip:"WGS84 standard ellipsoid, also known as EPSG:4326",category:"Cesium ion",creationFunction:function(){return new h0({ellipsoid:ne.WGS84})}})),e.push(new mr({name:"Cesium World Terrain",iconUrl:en("Widgets/Images/TerrainProviders/CesiumWorldTerrain.png"),tooltip:"High-resolution global terrain tileset curated from several datasources and hosted by Cesium ion",category:"Cesium ion",creationFunction:function(){return WR({requestWaterMask:!0,requestVertexNormals:!0})}})),e}var C5=_Bt;var mmr=x(T(),1);var rmr=x(T(),1);var fYe=1e3;function pp(e){l(e.geocoderServices)?this._geocoderServices=e.geocoderServices:this._geocoderServices=[new FR({scene:e.scene})],this._viewContainer=e.container,this._scene=e.scene,this._flightDuration=e.flightDuration,this._searchText="",this._isSearchInProgress=!1,this._wasGeocodeCancelled=!1,this._previousCredits=[],this._complete=new Se,this._suggestions=[],this._selectedSuggestion=void 0,this._showSuggestions=!0,this._handleArrowDown=bYe,this._handleArrowUp=pYe;let t=this;this._suggestionsVisible=Ee.pureComputed(function(){let o=Ee.getObservable(t,"_suggestions")().length>0,r=Ee.getObservable(t,"_showSuggestions")();return o&&r}),this._searchCommand=Fn(function(i){if(i=i??NT.SEARCH,t._focusTextbox=!1,l(t._selectedSuggestion))return t.activateSuggestion(t._selectedSuggestion),!1;if(t.hideSuggestions(),t.isSearchInProgress)EBt(t);else return CBt(t,t._geocoderServices,i)}),this.deselectSuggestion=function(){t._selectedSuggestion=void 0},this.handleKeyDown=function(i,o){let r=o.key==="ArrowDown"||o.key==="Down"||o.keyCode===40,s=o.key==="ArrowUp"||o.key==="Up"||o.keyCode===38;return(r||s)&&o.preventDefault(),!0},this.handleKeyUp=function(i,o){let r=o.key==="ArrowDown"||o.key==="Down"||o.keyCode===40,s=o.key==="ArrowUp"||o.key==="Up"||o.keyCode===38,a=o.key==="Enter"||o.keyCode===13;return s?pYe(t):r?bYe(t):a&&t._searchCommand(),!0},this.activateSuggestion=function(i){t.hideSuggestions(),t._searchText=i.displayName;let o=i.destination;xYe(t),t.destinationFound(t,o)},this.hideSuggestions=function(){t._showSuggestions=!1,t._selectedSuggestion=void 0},this.showSuggestions=function(){t._showSuggestions=!0},this.handleMouseover=function(i,o){i!==t._selectedSuggestion&&(t._selectedSuggestion=i)},this.keepExpanded=!1,this.autoComplete=e.autocomplete??!0,this.destinationFound=e.destinationFound??pp.flyToDestination,this._focusTextbox=!1,Ee.track(this,["_searchText","_isSearchInProgress","keepExpanded","_suggestions","_selectedSuggestion","_showSuggestions","_focusTextbox"]);let n=Ee.getObservable(this,"_searchText");n.extend({rateLimit:{timeout:500}}),this._suggestionSubscription=n.subscribe(function(){pp._updateSearchSuggestions(t)}),this.isSearchInProgress=void 0,Ee.defineProperty(this,"isSearchInProgress",{get:function(){return this._isSearchInProgress}}),this.searchText=void 0,Ee.defineProperty(this,"searchText",{get:function(){return this.isSearchInProgress?"Searching...":this._searchText},set:function(i){this._searchText=i}}),this.flightDuration=void 0,Ee.defineProperty(this,"flightDuration",{get:function(){return this._flightDuration},set:function(i){this._flightDuration=i}})}Object.defineProperties(pp.prototype,{complete:{get:function(){return this._complete}},scene:{get:function(){return this._scene}},search:{get:function(){return this._searchCommand}},selectedSuggestion:{get:function(){return this._selectedSuggestion}},suggestions:{get:function(){return this._suggestions}}});function pYe(e){if(e._suggestions.length===0)return;let t=e._suggestions.indexOf(e._selectedSuggestion);if(t===-1||t===0){e._selectedSuggestion=void 0;return}let n=t-1;e._selectedSuggestion=e._suggestions[n],pp._adjustSuggestionsScroll(e,n)}function bYe(e){if(e._suggestions.length===0)return;let t=e._suggestions.length,i=(e._suggestions.indexOf(e._selectedSuggestion)+1)%t;e._selectedSuggestion=e._suggestions[i],pp._adjustSuggestionsScroll(e,i)}function SBt(e,t){let n=l(t)?t.availability:void 0;return l(n)?gZ(t,[e]).then(function(i){return e=i[0],e.height+=fYe,e}):(e.height+=fYe,Promise.resolve(e))}function ZBt(e,t){let n=e._scene,i=n.ellipsoid,o=n.camera,r=n.terrainProvider,s=t,a;return t instanceof re?W.equalsEpsilon(t.south,t.north,W.EPSILON7)&&W.equalsEpsilon(t.east,t.west,W.EPSILON7)?t=re.center(t):a=yZ(t,n):t=i.cartesianToCartographic(t),l(a)||(a=SBt(t,r)),a.then(function(c){s=i.cartographicToCartesian(c)}).finally(function(){o.flyTo({destination:s,complete:function(){e._complete.raiseEvent()},duration:e._flightDuration,endTransform:P.IDENTITY})})}async function RBt(e,t,n){try{return{state:"fulfilled",value:await e.geocode(t,n),credits:e.credit}}catch(i){return{state:"rejected",reason:i}}}async function CBt(e,t,n){let i=e._searchText;if(yYe(i)){e.showSuggestions();return}e._isSearchInProgress=!0,e._wasGeocodeCancelled=!1;let o,r;for(o=0;o<t.length;o++){if(e._wasGeocodeCancelled)return;if(r=await RBt(t[o],i,n),l(r)&&r.state==="fulfilled"&&r.value.length>0)break}if(e._wasGeocodeCancelled)return;e._isSearchInProgress=!1,ale(e);let s=r.value;if(r.state==="fulfilled"&&l(s)&&s.length>0){e._searchText=s[0].displayName,e.destinationFound(e,s[0].destination);let a=gYe(e,VA.getCreditsFromResult(s[0]));l(a)||sle(e,t[o].credit);return}e._searchText=`${i} (not found)`}function sle(e,t){l(t)&&!e._scene.isDestroyed()&&!e._scene.frameState.creditDisplay.isDestroyed()&&(e._scene.frameState.creditDisplay.addStaticCredit(t),e._previousCredits.push(t))}function gYe(e,t){return l(t)&&t.forEach(n=>sle(e,n)),t}function ale(e){!e._scene.isDestroyed()&&!e._scene.frameState.creditDisplay.isDestroyed()&&e._previousCredits.forEach(t=>{e._scene.frameState.creditDisplay.removeStaticCredit(t)}),e._previousCredits.length=0}function VBt(e,t){let n=Nn(e._viewContainer),i=n.getElementsByClassName("search-results")[0],r=n.getElementsByTagName("li")[t];if(t===0){i.scrollTop=0;return}let s=r.offsetTop;s+r.clientHeight>i.clientHeight?i.scrollTop=s+r.clientHeight:s<i.scrollTop&&(i.scrollTop=s)}function EBt(e){e._isSearchInProgress&&(e._isSearchInProgress=!1,e._wasGeocodeCancelled=!0)}function yYe(e){return/^\s*$/.test(e)}function xYe(e){Ee.getObservable(e,"_suggestions").removeAll()}async function ABt(e){if(!e.autoComplete)return;let t=e._searchText;if(xYe(e),ale(e),!yYe(t))for(let n of e._geocoderServices){let i=await n.geocode(t,NT.AUTOCOMPLETE);if(e._suggestions=e._suggestions.concat(i),i.length>0){let o=!0;i.forEach(r=>{let s=VA.getCreditsFromResult(r);o=o&&!l(s),gYe(e,s)}),o&&sle(e,n.credit)}if(e._suggestions.length>=5)return}}pp.flyToDestination=ZBt;pp._updateSearchSuggestions=ABt;pp._adjustSuggestionsScroll=VBt;pp.prototype.isDestroyed=function(){return!1};pp.prototype.destroy=function(){return this._suggestionSubscription.dispose(),ale(this),ue(this)};var V5=pp;var GBt="M29.772,26.433l-7.126-7.126c0.96-1.583,1.523-3.435,1.524-5.421C24.169,8.093,19.478,3.401,13.688,3.399C7.897,3.401,3.204,8.093,3.204,13.885c0,5.789,4.693,10.481,10.484,10.481c1.987,0,3.839-0.563,5.422-1.523l7.128,7.127L29.772,26.433zM7.203,13.885c0.006-3.582,2.903-6.478,6.484-6.486c3.579,0.008,6.478,2.904,6.484,6.486c-0.007,3.58-2.905,6.476-6.484,6.484C10.106,20.361,7.209,17.465,7.203,13.885z",LBt="M24.778,21.419 19.276,15.917 24.777,10.415 21.949,7.585 16.447,13.087 10.945,7.585 8.117,10.415 13.618,15.917 8.116,21.419 10.946,24.248 16.447,18.746 21.948,24.248z";function kJ(e){let t=Nn(e.container),n=new V5(e);n._startSearchPath=GBt,n._stopSearchPath=LBt;let i=document.createElement("form");i.setAttribute("data-bind","submit: search");let o=document.createElement("input");o.type="search",o.className="cesium-geocoder-input",o.setAttribute("placeholder","Enter an address or landmark..."),o.setAttribute("data-bind",'textInput: searchText,disable: isSearchInProgress,event: { keyup: handleKeyUp, keydown: handleKeyDown, mouseover: deselectSuggestion },css: { "cesium-geocoder-input-wide" : keepExpanded || searchText.length > 0 },hasFocus: _focusTextbox'),this._onTextBoxFocus=function(){setTimeout(function(){o.select()},0)},o.addEventListener("focus",this._onTextBoxFocus,!1),i.appendChild(o),this._textBox=o;let r=document.createElement("span");r.className="cesium-geocoder-searchButton",r.setAttribute("data-bind","click: search,cesiumSvgPath: { path: isSearchInProgress ? _stopSearchPath : _startSearchPath, width: 32, height: 32 }"),i.appendChild(r),t.appendChild(i);let s=document.createElement("div");s.className="search-results",s.setAttribute("data-bind","visible: _suggestionsVisible");let a=document.createElement("ul");a.setAttribute("data-bind","foreach: _suggestions");let c=document.createElement("li");a.appendChild(c),c.setAttribute("data-bind","text: $data.displayName, click: $parent.activateSuggestion, event: { mouseover: $parent.handleMouseover}, css: { active: $data === $parent._selectedSuggestion }"),s.appendChild(a),t.appendChild(s),Ee.applyBindings(n,i),Ee.applyBindings(n,s),this._container=t,this._searchSuggestionsContainer=s,this._viewModel=n,this._form=i,this._onInputBegin=function(d){let u=d.target;typeof d.composedPath=="function"&&(u=d.composedPath()[0]),t.contains(u)||(n._focusTextbox=!1,n.hideSuggestions())},this._onInputEnd=function(d){n._focusTextbox=!0,n.showSuggestions()},fn.supportsPointerEvents()?(document.addEventListener("pointerdown",this._onInputBegin,!0),t.addEventListener("pointerup",this._onInputEnd,!0),t.addEventListener("pointercancel",this._onInputEnd,!0)):(document.addEventListener("mousedown",this._onInputBegin,!0),t.addEventListener("mouseup",this._onInputEnd,!0),document.addEventListener("touchstart",this._onInputBegin,!0),t.addEventListener("touchend",this._onInputEnd,!0),t.addEventListener("touchcancel",this._onInputEnd,!0))}Object.defineProperties(kJ.prototype,{container:{get:function(){return this._container}},searchSuggestionsContainer:{get:function(){return this._searchSuggestionsContainer}},viewModel:{get:function(){return this._viewModel}}});kJ.prototype.isDestroyed=function(){return!1};kJ.prototype.destroy=function(){let e=this._container;return fn.supportsPointerEvents()?(document.removeEventListener("pointerdown",this._onInputBegin,!0),e.removeEventListener("pointerup",this._onInputEnd,!0)):(document.removeEventListener("mousedown",this._onInputBegin,!0),e.removeEventListener("mouseup",this._onInputEnd,!0),document.removeEventListener("touchstart",this._onInputBegin,!0),e.removeEventListener("touchend",this._onInputEnd,!0)),this._viewModel.destroy(),Ee.cleanNode(this._form),Ee.cleanNode(this._searchSuggestionsContainer),e.removeChild(this._form),e.removeChild(this._searchSuggestionsContainer),this._textBox.removeEventListener("focus",this._onTextBoxFocus,!1),ue(this)};var E5=kJ;var Zmr=x(T(),1);var bmr=x(T(),1);function TYe(e,t){this._scene=e,this._duration=t;let n=this;this._command=Fn(function(){n._scene.camera.flyHome(n._duration)}),this.tooltip="View Home",Ee.track(this,["tooltip"])}Object.defineProperties(TYe.prototype,{scene:{get:function(){return this._scene}},command:{get:function(){return this._command}},duration:{get:function(){return this._duration},set:function(e){this._duration=e}}});var A5=TYe;function UJ(e,t,n){e=Nn(e);let i=new A5(t,n);i._svgPath="M14,4l-10,8.75h20l-4.25-3.7188v-4.6562h-2.812v2.1875l-2.938-2.5625zm-7.0938,9.906v10.094h14.094v-10.094h-14.094zm2.1876,2.313h3.3122v4.25h-3.3122v-4.25zm5.8442,1.281h3.406v6.438h-3.406v-6.438z";let o=document.createElement("button");o.type="button",o.className="cesium-button cesium-toolbar-button cesium-home-button",o.setAttribute("data-bind","attr: { title: tooltip },click: command,cesiumSvgPath: { path: _svgPath, width: 28, height: 28 }"),e.appendChild(o),Ee.applyBindings(i,o),this._container=e,this._viewModel=i,this._element=o}Object.defineProperties(UJ.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}}});UJ.prototype.isDestroyed=function(){return!1};UJ.prototype.destroy=function(){return Ee.cleanNode(this._element),this._container.removeChild(this._element),ue(this)};var G5=UJ;var Xmr=x(T(),1);var Gmr=x(T(),1);function DJ(e,t){l(t)||(t=document.body),t=Nn(t);let n=this,i=Ee.observable(qr.fullscreen),o=Ee.observable(qr.enabled),r=t.ownerDocument;this.isFullscreen=void 0,Ee.defineProperty(this,"isFullscreen",{get:function(){return i()}}),this.isFullscreenEnabled=void 0,Ee.defineProperty(this,"isFullscreenEnabled",{get:function(){return o()},set:function(s){o(s&&qr.enabled)}}),this.tooltip=void 0,Ee.defineProperty(this,"tooltip",function(){return this.isFullscreenEnabled?i()?"Exit full screen":"Full screen":"Full screen unavailable"}),this._command=Fn(function(){qr.fullscreen?qr.exitFullscreen():qr.requestFullscreen(n._fullscreenElement)},Ee.getObservable(this,"isFullscreenEnabled")),this._fullscreenElement=Nn(e)??r.body,this._callback=function(){i(qr.fullscreen)},r.addEventListener(qr.changeEventName,this._callback)}Object.defineProperties(DJ.prototype,{fullscreenElement:{get:function(){return this._fullscreenElement},set:function(e){this._fullscreenElement=e}},command:{get:function(){return this._command}}});DJ.prototype.isDestroyed=function(){return!1};DJ.prototype.destroy=function(){document.removeEventListener(qr.changeEventName,this._callback),ue(this)};var L5=DJ;var WBt="M 83.96875 17.5625 L 83.96875 17.59375 L 76.65625 24.875 L 97.09375 24.96875 L 76.09375 45.96875 L 81.9375 51.8125 L 102.78125 30.9375 L 102.875 51.15625 L 110.15625 43.875 L 110.1875 17.59375 L 83.96875 17.5625 z M 44.125 17.59375 L 17.90625 17.625 L 17.9375 43.90625 L 25.21875 51.1875 L 25.3125 30.96875 L 46.15625 51.8125 L 52 45.96875 L 31 25 L 51.4375 24.90625 L 44.125 17.59375 z M 46.0625 76.03125 L 25.1875 96.875 L 25.09375 76.65625 L 17.8125 83.9375 L 17.8125 110.21875 L 44 110.25 L 51.3125 102.9375 L 30.90625 102.84375 L 51.875 81.875 L 46.0625 76.03125 z M 82 76.15625 L 76.15625 82 L 97.15625 103 L 76.71875 103.0625 L 84.03125 110.375 L 110.25 110.34375 L 110.21875 84.0625 L 102.9375 76.8125 L 102.84375 97 L 82 76.15625 z",vBt="M 104.34375 17.5625 L 83.5 38.4375 L 83.40625 18.21875 L 76.125 25.5 L 76.09375 51.78125 L 102.3125 51.8125 L 102.3125 51.78125 L 109.625 44.5 L 89.1875 44.40625 L 110.1875 23.40625 L 104.34375 17.5625 z M 23.75 17.59375 L 17.90625 23.4375 L 38.90625 44.4375 L 18.5 44.53125 L 25.78125 51.8125 L 52 51.78125 L 51.96875 25.53125 L 44.6875 18.25 L 44.625 38.46875 L 23.75 17.59375 z M 25.6875 76.03125 L 18.375 83.3125 L 38.78125 83.40625 L 17.8125 104.40625 L 23.625 110.25 L 44.5 89.375 L 44.59375 109.59375 L 51.875 102.3125 L 51.875 76.0625 L 25.6875 76.03125 z M 102.375 76.15625 L 76.15625 76.1875 L 76.1875 102.4375 L 83.46875 109.71875 L 83.5625 89.53125 L 104.40625 110.375 L 110.25 104.53125 L 89.25 83.53125 L 109.6875 83.46875 L 102.375 76.15625 z";function OJ(e,t){e=Nn(e);let n=new L5(t,e);n._exitFullScreenPath=vBt,n._enterFullScreenPath=WBt;let i=document.createElement("button");i.type="button",i.className="cesium-button cesium-fullscreenButton",i.setAttribute("data-bind","attr: { title: tooltip },click: command,enable: isFullscreenEnabled,cesiumSvgPath: { path: isFullscreen ? _exitFullScreenPath : _enterFullScreenPath, width: 128, height: 128 }"),e.appendChild(i),Ee.applyBindings(n,i),this._container=e,this._viewModel=n,this._element=i}Object.defineProperties(OJ.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}}});OJ.prototype.isDestroyed=function(){return!1};OJ.prototype.destroy=function(){return this._viewModel.destroy(),Ee.cleanNode(this._element),this._container.removeChild(this._element),ue(this)};var W5=OJ;var zmr=x(T(),1);var wmr=x(T(),1);function FBt(e,t){t.currentTarget.parentElement.parentElement.querySelector(`#${e.name}-expander`).classList.toggle("active"),t.currentTarget.textContent=t.currentTarget.textContent==="+"?"-":"+"}function SYe(e,t){Ee.track(e);for(let n=0;n<e.sublayers.length;n++)SYe(e.sublayers[n],t)}function BJ(e){return e.modelName==="FullModel"}function ZYe(e){return e.modelName==="Overview"}function RYe(e){return ZYe(e)||BJ(e)}function _Ye(e,t){if(RYe(e)){e.visibility=!1;for(let i=0;i<e.sublayers.length;i++)e.sublayers[i].visibility=!0;let n={name:e.name,modelName:e.modelName,disable:Ee.observable(!1),index:t.sublayers.length};return t.topLayers.push(n),t.sublayers.push(e),n}}function IBt(e,t){if(RYe(e)){t.sublayers.forEach(i=>i.visibility=!1),t.sublayers[e.index].visibility=!0;let n=document.getElementById("bsl-wrapper");BJ(e)?(t.currentLevel=t.selectedLevel,n.style.display="block"):(t.selectedLevel=t.currentLevel,t.currentLevel="All",n.style.display="none")}}async function PBt(e,t){try{let n=e.getAttributeNames();for(let i=0;i<n.length;i++)if(n[i]==="BldgLevel"){let o=e.getAttributeValues(n[i]);for(let r=0;r<o.length;r++)t.push(o[r])}t.sort((i,o)=>i-o),t.unshift("All")}catch(n){console.log(`There was an error getting attributes: ${n}`)}}function XBt(e){let t=this;this.levels=[],this.viewModel={sublayers:[],levels:this.levels,currentLevel:Ee.observable(),selectedLevel:"All",topLayers:[{name:"Select a layer to explore...",disable:Ee.observable(!0),index:-1}],currentLayer:Ee.observable(),expandClickHandler:FBt,setOptionDisable:function(i,o){Ee.applyBindingsToNode(i,{disable:o.disable},o)},defaultLayer:void 0},this.viewModel.currentLayer.subscribe(function(i){IBt(i,t.viewModel)});let n=e.sublayers;for(let i=0;i<n.length;i++){SYe(n[i],this.viewModel);let o=_Ye(n[i],this.viewModel);l(o)&&(ZYe(o)||!l(this.viewModel.defaultLayer)&&BJ(o))&&(this.viewModel.defaultLayer=o)}if(this.viewModel.topLayers.length===1&&n.length>0){e.show=!1;let i={name:"Full Model",modelName:"FullModel",visibility:e.show,sublayers:e.sublayers};this.viewModel.defaultLayer=_Ye(i,this.viewModel),this.viewModel.currentLayer.subscribe(function(o){e.show=BJ(o)})}else this.viewModel.topLayers.length===1&&(this.viewModel.topLayers[0].name="Building layers not found");return PBt(e,this.levels),this.viewModel.currentLevel.subscribe(function(i){i!=="All"?e.filterByAttributes([{name:"BldgLevel",values:[i]}]):e.filterByAttributes()}),this.viewModel}var v5=XBt;function NBt(e,t){let n=document.getElementById(e),i=document.createElement("div");i.classList.add("cesium-viewer-i3s-explorer"),i.innerHTML=` <h3>Building explorer</h3> <select data-bind="options: topLayers, optionsText: 'name', optionsAfterRender: setOptionDisable, value: currentLayer" @@ -12813,9 +12813,9 @@ http://www.naturalearthdata.com/`,category:"Cesium ion",creationFunction:functio </li> </ul> </ul> - </div>`,n.appendChild(i);let o=new L5(t);Ee.track(o),Ee.applyBindings(o,n),l(o.defaultLayer)&&(o.currentLayer=o.defaultLayer)}var sle=EBt;var Dmr=x(T(),1);var Xmr=x(T(),1);function yYe(){this.showInstructions=!1;let e=this;this._command=Fn(function(){e.showInstructions=!e.showInstructions}),this._showClick=Fn(function(){e._touch=!1}),this._showTouch=Fn(function(){e._touch=!0}),this._touch=!1,this.tooltip="Navigation Instructions",Ee.track(this,["tooltip","showInstructions","_touch"])}Object.defineProperties(yYe.prototype,{command:{get:function(){return this._command}},showClick:{get:function(){return this._showClick}},showTouch:{get:function(){return this._showTouch}}});var W5=yYe;function BJ(e){let t=Nn(e.container),n=new W5,i=e.instructionsInitiallyVisible??!1;n.showInstructions=i,n._svgPath="M16,1.466C7.973,1.466,1.466,7.973,1.466,16c0,8.027,6.507,14.534,14.534,14.534c8.027,0,14.534-6.507,14.534-14.534C30.534,7.973,24.027,1.466,16,1.466z M17.328,24.371h-2.707v-2.596h2.707V24.371zM17.328,19.003v0.858h-2.707v-1.057c0-3.19,3.63-3.696,3.63-5.963c0-1.034-0.924-1.826-2.134-1.826c-1.254,0-2.354,0.924-2.354,0.924l-1.541-1.915c0,0,1.519-1.584,4.137-1.584c2.487,0,4.796,1.54,4.796,4.136C21.156,16.208,17.328,16.627,17.328,19.003z";let o=document.createElement("span");o.className="cesium-navigationHelpButton-wrapper",t.appendChild(o);let r=document.createElement("button");r.type="button",r.className="cesium-button cesium-toolbar-button cesium-navigation-help-button",r.setAttribute("data-bind","attr: { title: tooltip },click: command,cesiumSvgPath: { path: _svgPath, width: 32, height: 32 }"),o.appendChild(r);let s=document.createElement("div");s.className="cesium-navigation-help",s.setAttribute("data-bind",'css: { "cesium-navigation-help-visible" : showInstructions}'),o.appendChild(s);let a=document.createElement("button");a.type="button",a.className="cesium-navigation-button cesium-navigation-button-left",a.setAttribute("data-bind",'click: showClick, css: {"cesium-navigation-button-selected": !_touch, "cesium-navigation-button-unselected": _touch}');let c=document.createElement("img");c.src=en("Widgets/Images/NavigationHelp/Mouse.svg"),c.className="cesium-navigation-button-icon",c.style.width="25px",c.style.height="25px",a.appendChild(c),a.appendChild(document.createTextNode("Mouse"));let d=document.createElement("button");d.type="button",d.className="cesium-navigation-button cesium-navigation-button-right",d.setAttribute("data-bind",'click: showTouch, css: {"cesium-navigation-button-selected": _touch, "cesium-navigation-button-unselected": !_touch}');let u=document.createElement("img");u.src=en("Widgets/Images/NavigationHelp/Touch.svg"),u.className="cesium-navigation-button-icon",u.style.width="25px",u.style.height="25px",d.appendChild(u),d.appendChild(document.createTextNode("Touch")),s.appendChild(a),s.appendChild(d);let m=document.createElement("div");m.className="cesium-click-navigation-help cesium-navigation-help-instructions",m.setAttribute("data-bind",'css: { "cesium-click-navigation-help-visible" : !_touch}'),m.innerHTML=` <table> <tr> <td><img src="${en("Widgets/Images/NavigationHelp/MouseLeft.svg")}" width="48" height="48" /></td> <td> <div class="cesium-navigation-help-pan">Pan view</div> <div class="cesium-navigation-help-details">Left click + drag</div> </td> </tr> <tr> <td><img src="${en("Widgets/Images/NavigationHelp/MouseRight.svg")}" width="48" height="48" /></td> <td> <div class="cesium-navigation-help-zoom">Zoom view</div> <div class="cesium-navigation-help-details">Right click + drag, or</div> <div class="cesium-navigation-help-details">Mouse wheel scroll</div> </td> </tr> <tr> <td><img src="${en("Widgets/Images/NavigationHelp/MouseMiddle.svg")}" width="48" height="48" /></td> <td> <div class="cesium-navigation-help-rotate">Rotate view</div> <div class="cesium-navigation-help-details">Middle click + drag, or</div> <div class="cesium-navigation-help-details">CTRL + Left/Right click + drag</div> </td> </tr> </table>`,s.appendChild(m);let p=document.createElement("div");p.className="cesium-touch-navigation-help cesium-navigation-help-instructions",p.setAttribute("data-bind",'css: { "cesium-touch-navigation-help-visible" : _touch}'),p.innerHTML=` <table> <tr> <td><img src="${en("Widgets/Images/NavigationHelp/TouchDrag.svg")}" width="70" height="48" /></td> <td> <div class="cesium-navigation-help-pan">Pan view</div> <div class="cesium-navigation-help-details">One finger drag</div> </td> </tr> <tr> <td><img src="${en("Widgets/Images/NavigationHelp/TouchZoom.svg")}" width="70" height="48" /></td> <td> <div class="cesium-navigation-help-zoom">Zoom view</div> <div class="cesium-navigation-help-details">Two finger pinch</div> </td> </tr> <tr> <td><img src="${en("Widgets/Images/NavigationHelp/TouchTilt.svg")}" width="70" height="48" /></td> <td> <div class="cesium-navigation-help-rotate">Tilt view</div> <div class="cesium-navigation-help-details">Two finger drag, same direction</div> </td> </tr> <tr> <td><img src="${en("Widgets/Images/NavigationHelp/TouchRotate.svg")}" width="70" height="48" /></td> <td> <div class="cesium-navigation-help-tilt">Rotate view</div> <div class="cesium-navigation-help-details">Two finger drag, opposite direction</div> </td> </tr> </table>`,s.appendChild(p),Ee.applyBindings(n,o),this._container=t,this._viewModel=n,this._wrapper=o,this._closeInstructions=function(b){o.contains(b.target)||(n.showInstructions=!1)},fn.supportsPointerEvents()?document.addEventListener("pointerdown",this._closeInstructions,!0):(document.addEventListener("mousedown",this._closeInstructions,!0),document.addEventListener("touchstart",this._closeInstructions,!0))}Object.defineProperties(BJ.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}}});BJ.prototype.isDestroyed=function(){return!1};BJ.prototype.destroy=function(){return fn.supportsPointerEvents()?document.removeEventListener("pointerdown",this._closeInstructions,!0):(document.removeEventListener("mousedown",this._closeInstructions,!0),document.removeEventListener("touchstart",this._closeInstructions,!0)),Ee.cleanNode(this._wrapper),this._container.removeChild(this._wrapper),ue(this)};var v5=BJ;var ehr=x(T(),1);var Hmr=x(T(),1);var ABt="M 13.84375 7.03125 C 11.412798 7.03125 9.46875 8.975298 9.46875 11.40625 L 9.46875 11.59375 L 2.53125 7.21875 L 2.53125 24.0625 L 9.46875 19.6875 C 9.4853444 22.104033 11.423165 24.0625 13.84375 24.0625 L 25.875 24.0625 C 28.305952 24.0625 30.28125 22.087202 30.28125 19.65625 L 30.28125 11.40625 C 30.28125 8.975298 28.305952 7.03125 25.875 7.03125 L 13.84375 7.03125 z",GBt="M 27.34375 1.65625 L 5.28125 27.9375 L 8.09375 30.3125 L 30.15625 4.03125 L 27.34375 1.65625 z M 13.84375 7.03125 C 11.412798 7.03125 9.46875 8.975298 9.46875 11.40625 L 9.46875 11.59375 L 2.53125 7.21875 L 2.53125 24.0625 L 9.46875 19.6875 C 9.4724893 20.232036 9.5676108 20.7379 9.75 21.21875 L 21.65625 7.03125 L 13.84375 7.03125 z M 28.21875 7.71875 L 14.53125 24.0625 L 25.875 24.0625 C 28.305952 24.0625 30.28125 22.087202 30.28125 19.65625 L 30.28125 11.40625 C 30.28125 9.8371439 29.456025 8.4902779 28.21875 7.71875 z";function ale(){this._cameraClicked=new Se,this._closeClicked=new Se,this.maxHeight=500,this.enableCamera=!1,this.isCameraTracking=!1,this.showInfo=!1,this.titleText="",this.description="",Ee.track(this,["showInfo","titleText","description","maxHeight","enableCamera","isCameraTracking"]),this._loadingIndicatorHtml='<div class="cesium-infoBox-loadingContainer"><span class="cesium-infoBox-loading"></span></div>',this.cameraIconPath=void 0,Ee.defineProperty(this,"cameraIconPath",{get:function(){return!this.enableCamera||this.isCameraTracking?GBt:ABt}}),Ee.defineProperty(this,"_bodyless",{get:function(){return!l(this.description)||this.description.length===0}})}ale.prototype.maxHeightOffset=function(e){return`${this.maxHeight-e}px`};Object.defineProperties(ale.prototype,{cameraClicked:{get:function(){return this._cameraClicked}},closeClicked:{get:function(){return this._closeClicked}}});var F5=ale;function zJ(e){e=Nn(e);let t=document.createElement("div");t.className="cesium-infoBox",t.setAttribute("data-bind",'css: { "cesium-infoBox-visible" : showInfo, "cesium-infoBox-bodyless" : _bodyless }'),e.appendChild(t);let n=document.createElement("div");n.className="cesium-infoBox-title",n.setAttribute("data-bind","text: titleText"),t.appendChild(n);let i=t.ownerDocument,o,r,s,a,c;function d(S){!l(o)||l(S)&&S.pointerId!==o||(o=void 0,t.classList.remove("cesium-infoBox-dragging"))}function u(S){if(!(S.button!==0||S.isPrimary===!1)){o=S.pointerId,r=S.clientX,s=S.clientY,a=t.offsetLeft,c=t.offsetTop,t.style.left=`${a}px`,t.style.top=`${c}px`,t.style.right="auto",t.classList.add("cesium-infoBox-dragging");try{n.setPointerCapture(S.pointerId)}catch{}S.preventDefault()}}function m(S){!l(o)||S.pointerId!==o||(t.style.left=`${a+S.clientX-r}px`,t.style.top=`${c+S.clientY-s}px`,S.preventDefault())}n.addEventListener("pointerdown",u),i.addEventListener("pointermove",m),i.addEventListener("pointerup",d),i.addEventListener("pointercancel",d);let p=document.createElement("button");p.type="button",p.className="cesium-button cesium-infoBox-camera",p.setAttribute("data-bind",'attr: { title: "Focus camera on object" },click: function () { cameraClicked.raiseEvent(this); },enable: enableCamera,cesiumSvgPath: { path: cameraIconPath, width: 32, height: 32 }'),t.appendChild(p);let b=document.createElement("button");b.type="button",b.className="cesium-infoBox-close",b.setAttribute("data-bind","click: function () { closeClicked.raiseEvent(this); }"),b.innerHTML="×",t.appendChild(b);let f=document.createElement("iframe");f.className="cesium-infoBox-iframe",f.setAttribute("sandbox","allow-same-origin allow-popups allow-forms"),f.setAttribute("data-bind","style : { maxHeight : maxHeightOffset(40) }"),f.setAttribute("allowfullscreen",!0),t.appendChild(f);let y=new F5;Ee.applyBindings(y,t),this._container=e,this._element=t,this._frame=f,this._viewModel=y,this._descriptionSubscription=void 0,this._titleElement=n,this._ownerDocument=i,this._handlePointerDown=u,this._handlePointerMove=m,this._stopDragging=d;let _=this;f.addEventListener("load",function(){let S=f.contentDocument,Z=S.createElement("link");Z.href=en("Widgets/InfoBox/InfoBoxDescription.css"),Z.rel="stylesheet",Z.type="text/css";let R=S.createElement("div");R.className="cesium-infoBox-description",S.head.appendChild(Z),S.body.appendChild(R),_._descriptionSubscription=Sc(y,"description",function(C){f.style.height="5px",R.innerHTML=C;let E=null,A=R.firstElementChild;if(A!==null&&R.childNodes.length===1){let F=window.getComputedStyle(A);if(F!==null){let I=F["background-color"],N=U.fromCssColorString(I);l(N)&&N.alpha!==0&&(E=F["background-color"])}}t.style["background-color"]=E;let L=R.getBoundingClientRect().height;f.style.height=`${L}px`})}),f.setAttribute("src","about:blank")}Object.defineProperties(zJ.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}},frame:{get:function(){return this._frame}}});zJ.prototype.isDestroyed=function(){return!1};zJ.prototype.destroy=function(){let e=this._container,t=this._ownerDocument;return this._titleElement.removeEventListener("pointerdown",this._handlePointerDown),t.removeEventListener("pointermove",this._handlePointerMove),t.removeEventListener("pointerup",this._stopDragging),t.removeEventListener("pointercancel",this._stopDragging),Ee.cleanNode(this._element),e.removeChild(this._element),l(this._descriptionSubscription)&&this._descriptionSubscription.dispose(),ue(this)};var I5=zJ;var fhr=x(T(),1);var ahr=x(T(),1);function cle(e){this._scene=e.scene,this.lowFrameRateMessage=e.lowFrameRateMessage??"This application appears to be performing poorly on your system. Please try using a different web browser or updating your video drivers.",this.lowFrameRateMessageDismissed=!1,this.showingLowFrameRateMessage=!1,Ee.track(this,["lowFrameRateMessage","lowFrameRateMessageDismissed","showingLowFrameRateMessage"]);let t=this;this._dismissMessage=Fn(function(){t.showingLowFrameRateMessage=!1,t.lowFrameRateMessageDismissed=!0});let n=UU.fromScene(e.scene);this._unsubscribeLowFrameRate=n.lowFrameRate.addEventListener(function(){t.lowFrameRateMessageDismissed||(t.showingLowFrameRateMessage=!0)}),this._unsubscribeNominalFrameRate=n.nominalFrameRate.addEventListener(function(){t.showingLowFrameRateMessage=!1})}Object.defineProperties(cle.prototype,{scene:{get:function(){return this._scene}},dismissMessage:{get:function(){return this._dismissMessage}}});cle.prototype.destroy=function(){return this._unsubscribeLowFrameRate(),this._unsubscribeNominalFrameRate(),ue(this)};var P5=cle;function HJ(e){let t=Nn(e.container),n=new P5(e),i=document.createElement("div");i.className="cesium-performance-watchdog-message-area",i.setAttribute("data-bind","visible: showingLowFrameRateMessage");let o=document.createElement("button");o.setAttribute("type","button"),o.className="cesium-performance-watchdog-message-dismiss",o.innerHTML="×",o.setAttribute("data-bind","click: dismissMessage"),i.appendChild(o);let r=document.createElement("div");r.className="cesium-performance-watchdog-message",r.setAttribute("data-bind","html: lowFrameRateMessage"),i.appendChild(r),t.appendChild(i),Ee.applyBindings(n,i),this._container=t,this._viewModel=n,this._element=i}Object.defineProperties(HJ.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}}});HJ.prototype.isDestroyed=function(){return!1};HJ.prototype.destroy=function(){return this._viewModel.destroy(),Ee.cleanNode(this._element),this._container.removeChild(this._element),ue(this)};var X5=HJ;var Ehr=x(T(),1);var Thr=x(T(),1);function KJ(e){this._scene=e,this._orthographic=e.camera.frustum instanceof yn,this._flightInProgress=!1,this.dropDownVisible=!1,this.tooltipPerspective="Perspective Projection",this.tooltipOrthographic="Orthographic Projection",this.selectedTooltip=void 0,this.sceneMode=e.mode,Ee.track(this,["_orthographic","_flightInProgress","sceneMode","dropDownVisible","tooltipPerspective","tooltipOrthographic"]);let t=this;Ee.defineProperty(this,"selectedTooltip",function(){return t._orthographic?t.tooltipOrthographic:t.tooltipPerspective}),this._toggleDropDown=Fn(function(){t.sceneMode===se.SCENE2D||t._flightInProgress||(t.dropDownVisible=!t.dropDownVisible)}),this._eventHelper=new Hr,this._eventHelper.add(e.morphComplete,function(n,i,o,r){t.sceneMode=o,t._orthographic=o===se.SCENE2D||t._scene.camera.frustum instanceof yn}),this._eventHelper.add(e.preRender,function(){t._flightInProgress=l(e.camera._currentFlight)}),this._switchToPerspective=Fn(function(){t.sceneMode!==se.SCENE2D&&(t._scene.camera.switchToPerspectiveFrustum(),t._orthographic=!1,t.dropDownVisible=!1)}),this._switchToOrthographic=Fn(function(){t.sceneMode!==se.SCENE2D&&(t._scene.camera.switchToOrthographicFrustum(),t._orthographic=!0,t.dropDownVisible=!1)}),this._sceneMode=se}Object.defineProperties(KJ.prototype,{scene:{get:function(){return this._scene}},toggleDropDown:{get:function(){return this._toggleDropDown}},switchToPerspective:{get:function(){return this._switchToPerspective}},switchToOrthographic:{get:function(){return this._switchToOrthographic}},isOrthographicProjection:{get:function(){return this._orthographic}}});KJ.prototype.isDestroyed=function(){return!1};KJ.prototype.destroy=function(){this._eventHelper.removeAll(),ue(this)};var N5=KJ;var LBt="M 28.15625,10.4375 9.125,13.21875 13.75,43.25 41.75,55.09375 50.8125,37 54.5,11.9375 z m 0.125,3 19.976451,0.394265 L 43.03125,16.875 22.6875,14.28125 z M 50.971746,15.705477 47.90625,36.03125 42.53125,46 44.84375,19.3125 z M 12.625,16.03125 l 29.15625,3.6875 -2.65625,31 L 16.4375,41.125 z",WBt="m 31.560594,6.5254438 -20.75,12.4687502 0.1875,24.5625 22.28125,11.8125 19.5,-12 0.65625,-0.375 0,-0.75 0.0312,-23.21875 z m 0.0625,3.125 16.65625,9.5000002 -16.125,10.28125 -17.34375,-9.71875 z m 18.96875,11.1875002 0.15625,20.65625 -17.46875,10.59375 0.15625,-20.28125 z m -37.0625,1.25 17.21875,9.625 -0.15625,19.21875 -16.9375,-9 z";function JJ(e,t){e=Nn(e);let n=new N5(t);n._perspectivePath=LBt,n._orthographicPath=WBt;let i=document.createElement("span");i.className="cesium-projectionPicker-wrapper cesium-toolbar-button",e.appendChild(i);let o=document.createElement("button");o.type="button",o.className="cesium-button cesium-toolbar-button",o.setAttribute("data-bind",'css: { "cesium-projectionPicker-buttonPerspective": !_orthographic, "cesium-projectionPicker-buttonOrthographic": _orthographic, "cesium-button-disabled" : sceneMode === _sceneMode.SCENE2D || _flightInProgress, "cesium-projectionPicker-selected": dropDownVisible },attr: { title: selectedTooltip },click: toggleDropDown'),o.innerHTML='<!-- ko cesiumSvgPath: { path: _perspectivePath, width: 64, height: 64, css: "cesium-projectionPicker-iconPerspective" } --><!-- /ko --><!-- ko cesiumSvgPath: { path: _orthographicPath, width: 64, height: 64, css: "cesium-projectionPicker-iconOrthographic" } --><!-- /ko -->',i.appendChild(o);let r=document.createElement("button");r.type="button",r.className="cesium-button cesium-toolbar-button cesium-projectionPicker-dropDown-icon",r.setAttribute("data-bind",'css: { "cesium-projectionPicker-visible" : (dropDownVisible && _orthographic), "cesium-projectionPicker-none" : !_orthographic, "cesium-projectionPicker-hidden" : !dropDownVisible },attr: { title: tooltipPerspective },click: switchToPerspective,cesiumSvgPath: { path: _perspectivePath, width: 64, height: 64 }'),i.appendChild(r);let s=document.createElement("button");s.type="button",s.className="cesium-button cesium-toolbar-button cesium-projectionPicker-dropDown-icon",s.setAttribute("data-bind",'css: { "cesium-projectionPicker-visible" : (dropDownVisible && !_orthographic), "cesium-projectionPicker-none" : _orthographic, "cesium-projectionPicker-hidden" : !dropDownVisible},attr: { title: tooltipOrthographic },click: switchToOrthographic,cesiumSvgPath: { path: _orthographicPath, width: 64, height: 64 }'),i.appendChild(s),Ee.applyBindings(n,i),this._viewModel=n,this._container=e,this._wrapper=i,this._closeDropDown=function(a){i.contains(a.target)||(n.dropDownVisible=!1)},fn.supportsPointerEvents()?document.addEventListener("pointerdown",this._closeDropDown,!0):(document.addEventListener("mousedown",this._closeDropDown,!0),document.addEventListener("touchstart",this._closeDropDown,!0))}Object.defineProperties(JJ.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}}});JJ.prototype.isDestroyed=function(){return!1};JJ.prototype.destroy=function(){return this._viewModel.destroy(),fn.supportsPointerEvents()?document.removeEventListener("pointerdown",this._closeDropDown,!0):(document.removeEventListener("mousedown",this._closeDropDown,!0),document.removeEventListener("touchstart",this._closeDropDown,!0)),Ee.cleanNode(this._wrapper),this._container.removeChild(this._wrapper),ue(this)};var Y5=JJ;var khr=x(T(),1);var Ihr=x(T(),1);function jJ(e,t){this._scene=e;let n=this,i=function(o,r,s,a){n.sceneMode=s,n.dropDownVisible=!1};this._eventHelper=new Hr,this._eventHelper.add(e.morphStart,i),this._duration=t??2,this.sceneMode=e.mode,this.dropDownVisible=!1,this.tooltip2D="2D",this.tooltip3D="3D",this.tooltipColumbusView="Columbus View",Ee.track(this,["sceneMode","dropDownVisible","tooltip2D","tooltip3D","tooltipColumbusView"]),this.selectedTooltip=void 0,Ee.defineProperty(this,"selectedTooltip",function(){let o=n.sceneMode;return o===se.SCENE2D?n.tooltip2D:o===se.SCENE3D?n.tooltip3D:n.tooltipColumbusView}),this._toggleDropDown=Fn(function(){n.dropDownVisible=!n.dropDownVisible}),this._morphTo2D=Fn(function(){e.morphTo2D(n._duration)}),this._morphTo3D=Fn(function(){e.morphTo3D(n._duration)}),this._morphToColumbusView=Fn(function(){e.morphToColumbusView(n._duration)}),this._sceneMode=se}Object.defineProperties(jJ.prototype,{scene:{get:function(){return this._scene}},duration:{get:function(){return this._duration},set:function(e){this._duration=e}},toggleDropDown:{get:function(){return this._toggleDropDown}},morphTo2D:{get:function(){return this._morphTo2D}},morphTo3D:{get:function(){return this._morphTo3D}},morphToColumbusView:{get:function(){return this._morphToColumbusView}}});jJ.prototype.isDestroyed=function(){return!1};jJ.prototype.destroy=function(){this._eventHelper.removeAll(),ue(this)};var M5=jJ;var vBt="m 32.401392,4.9330437 c -7.087603,0 -14.096095,2.884602 -19.10793,7.8946843 -5.0118352,5.010083 -7.9296167,11.987468 -7.9296167,19.072999 0,7.085531 2.9177815,14.097848 7.9296167,19.107931 4.837653,4.835961 11.541408,7.631372 18.374354,7.82482 0.05712,0.01231 0.454119,0.139729 0.454119,0.139729 l 0.03493,-0.104797 c 0.08246,7.84e-4 0.162033,0.03493 0.244525,0.03493 0.08304,0 0.161515,-0.03414 0.244526,-0.03493 l 0.03493,0.104797 c 0,0 0.309474,-0.129487 0.349323,-0.139729 6.867765,-0.168094 13.582903,-2.965206 18.444218,-7.82482 2.558195,-2.5573 4.551081,-5.638134 5.903547,-8.977584 1.297191,-3.202966 2.02607,-6.661489 2.02607,-10.130347 0,-6.237309 -2.366261,-12.31219 -6.322734,-17.116794 -0.0034,-0.02316 0.0049,-0.04488 0,-0.06986 -0.01733,-0.08745 -0.104529,-0.278855 -0.104797,-0.279458 -5.31e-4,-0.0012 -0.522988,-0.628147 -0.523984,-0.62878 -3.47e-4,-2.2e-4 -0.133444,-0.03532 -0.244525,-0.06987 C 51.944299,13.447603 51.751076,13.104317 51.474391,12.827728 46.462556,7.8176457 39.488996,4.9330437 32.401392,4.9330437 z m -2.130866,3.5281554 0.104797,9.6762289 c -4.111695,-0.08361 -7.109829,-0.423664 -9.257041,-0.943171 1.198093,-2.269271 2.524531,-4.124404 3.91241,-5.414496 2.167498,-2.0147811 3.950145,-2.8540169 5.239834,-3.3185619 z m 2.794579,0 c 1.280302,0.4754953 3.022186,1.3285948 5.065173,3.2486979 1.424667,1.338973 2.788862,3.303645 3.982275,5.728886 -2.29082,0.403367 -5.381258,0.621049 -8.942651,0.698645 L 33.065105,8.4611991 z m 5.728886,0.2445256 c 4.004072,1.1230822 7.793098,3.1481363 10.724195,6.0782083 0.03468,0.03466 0.07033,0.06991 0.104797,0.104797 -0.45375,0.313891 -0.923054,0.663002 -1.956205,1.082899 -0.647388,0.263114 -1.906242,0.477396 -2.829511,0.733577 -1.382296,-2.988132 -3.027146,-5.368585 -4.785716,-7.0213781 -0.422866,-0.397432 -0.835818,-0.6453247 -1.25756,-0.9781032 z m -15.33525,0.7685092 c -0.106753,0.09503 -0.207753,0.145402 -0.31439,0.244526 -1.684973,1.5662541 -3.298068,3.8232211 -4.680919,6.5672591 -0.343797,-0.14942 -1.035052,-0.273198 -1.292493,-0.419186 -0.956528,-0.542427 -1.362964,-1.022024 -1.537018,-1.292493 -0.0241,-0.03745 -0.01868,-0.0401 -0.03493,-0.06986 2.250095,-2.163342 4.948824,-3.869984 7.859752,-5.0302421 z m -9.641296,7.0912431 c 0.464973,0.571618 0.937729,1.169056 1.956205,1.746612 0.349907,0.198425 1.107143,0.335404 1.537018,0.523983 -1.20166,3.172984 -1.998037,7.051901 -2.165798,11.772162 C 14.256557,30.361384 12.934823,30.161483 12.280427,29.90959 10.644437,29.279855 9.6888882,28.674891 9.1714586,28.267775 8.6540289,27.860658 8.6474751,27.778724 8.6474751,27.778724 l -0.069864,0.03493 C 9.3100294,23.691285 11.163248,19.798527 13.817445,16.565477 z m 37.552149,0.523984 c 2.548924,3.289983 4.265057,7.202594 4.890513,11.318043 -0.650428,0.410896 -1.756876,1.001936 -3.563088,1.606882 -1.171552,0.392383 -3.163859,0.759153 -4.960377,1.117832 -0.04367,-4.752703 -0.784809,-8.591423 -1.88634,-11.807094 0.917574,-0.263678 2.170552,-0.486495 2.864443,-0.76851 1.274693,-0.518066 2.003942,-1.001558 2.654849,-1.467153 z m -31.439008,2.619917 c 2.487341,0.672766 5.775813,1.137775 10.479669,1.222628 l 0.104797,10.689263 0,0.03493 0,0.733577 c -5.435005,-0.09059 -9.512219,-0.519044 -12.610536,-1.117831 0.106127,-4.776683 0.879334,-8.55791 2.02607,-11.562569 z m 23.264866,0.31439 c 1.073459,3.067541 1.833795,6.821314 1.816476,11.702298 -3.054474,0.423245 -7.062018,0.648559 -11.702298,0.698644 l 0,-0.838373 -0.104796,-10.654331 c 4.082416,-0.0864 7.404468,-0.403886 9.990618,-0.908238 z M 8.2632205,30.922625 c 0.7558676,0.510548 1.5529563,1.013339 3.0041715,1.57195 0.937518,0.360875 2.612202,0.647642 3.91241,0.978102 0.112814,3.85566 0.703989,7.107756 1.606883,9.920754 -1.147172,-0.324262 -2.644553,-0.640648 -3.423359,-0.978102 -1.516688,-0.657177 -2.386627,-1.287332 -2.864443,-1.71168 -0.477816,-0.424347 -0.489051,-0.489051 -0.489051,-0.489051 L 9.8002387,40.319395 C 8.791691,37.621767 8.1584238,34.769583 8.1584238,31.900727 c 0,-0.330153 0.090589,-0.648169 0.1047967,-0.978102 z m 48.2763445,0.419186 c 0.0047,0.188973 0.06986,0.36991 0.06986,0.558916 0,2.938869 -0.620228,5.873558 -1.676747,8.628261 -0.07435,0.07583 -0.06552,0.07411 -0.454119,0.349323 -0.606965,0.429857 -1.631665,1.042044 -3.318562,1.676747 -1.208528,0.454713 -3.204964,0.850894 -5.135038,1.25756 0.84593,-2.765726 1.41808,-6.005357 1.606883,-9.815957 2.232369,-0.413371 4.483758,-0.840201 5.938479,-1.327425 1.410632,-0.472457 2.153108,-0.89469 2.96924,-1.327425 z m -38.530252,2.864443 c 3.208141,0.56697 7.372279,0.898588 12.575603,0.978103 l 0.174662,9.885821 c -4.392517,-0.06139 -8.106722,-0.320566 -10.863925,-0.803441 -1.051954,-2.664695 -1.692909,-6.043794 -1.88634,-10.060483 z m 26.793022,0.31439 c -0.246298,3.923551 -0.877762,7.263679 -1.816476,9.885822 -2.561957,0.361954 -5.766249,0.560708 -9.431703,0.62878 l -0.174661,-9.815957 c 4.491734,-0.04969 8.334769,-0.293032 11.42284,-0.698645 z M 12.035901,44.860585 c 0.09977,0.04523 0.105535,0.09465 0.209594,0.139729 1.337656,0.579602 3.441099,1.058072 5.589157,1.537018 1.545042,3.399208 3.548524,5.969402 5.589157,7.789888 -3.034411,-1.215537 -5.871615,-3.007978 -8.174142,-5.309699 -1.245911,-1.245475 -2.271794,-2.662961 -3.213766,-4.156936 z m 40.69605,0 c -0.941972,1.493975 -1.967855,2.911461 -3.213765,4.156936 -2.74253,2.741571 -6.244106,4.696717 -9.955686,5.868615 0.261347,-0.241079 0.507495,-0.394491 0.768509,-0.663713 1.674841,-1.727516 3.320792,-4.181056 4.645987,-7.265904 2.962447,-0.503021 5.408965,-1.122293 7.161107,-1.781544 0.284034,-0.106865 0.337297,-0.207323 0.593848,-0.31439 z m -31.404076,2.305527 c 2.645807,0.376448 5.701178,0.649995 9.466635,0.698645 l 0.139729,7.789888 c -1.38739,-0.480844 -3.316218,-1.29837 -5.659022,-3.388427 -1.388822,-1.238993 -2.743668,-3.0113 -3.947342,-5.100106 z m 20.365491,0.104797 c -1.04872,2.041937 -2.174337,3.779068 -3.353494,4.995309 -1.853177,1.911459 -3.425515,2.82679 -4.611055,3.353494 l -0.139729,-7.789887 c 3.13091,-0.05714 5.728238,-0.278725 8.104278,-0.558916 z",FBt="m 2.9825053,17.550598 0,1.368113 0,26.267766 0,1.368113 1.36811,0 54.9981397,0 1.36811,0 0,-1.368113 0,-26.267766 0,-1.368113 -1.36811,0 -54.9981397,0 -1.36811,0 z m 2.73623,2.736226 10.3292497,0 0,10.466063 -10.3292497,0 0,-10.466063 z m 13.0654697,0 11.69737,0 0,10.466063 -11.69737,0 0,-10.466063 z m 14.43359,0 11.69737,0 0,10.466063 -11.69737,0 0,-10.466063 z m 14.43359,0 10.32926,0 0,10.466063 -10.32926,0 0,-10.466063 z m -41.9326497,13.202288 10.3292497,0 0,10.329252 -10.3292497,0 0,-10.329252 z m 13.0654697,0 11.69737,0 0,10.329252 -11.69737,0 0,-10.329252 z m 14.43359,0 11.69737,0 0,10.329252 -11.69737,0 0,-10.329252 z m 14.43359,0 10.32926,0 0,10.329252 -10.32926,0 0,-10.329252 z",IBt="m 14.723969,17.675598 -0.340489,0.817175 -11.1680536,26.183638 -0.817175,1.872692 2.076986,0 54.7506996,0 2.07698,0 -0.81717,-1.872692 -11.16805,-26.183638 -0.34049,-0.817175 -0.91933,0 -32.414586,0 -0.919322,0 z m 1.838643,2.723916 6.196908,0 -2.928209,10.418977 -7.729111,0 4.460412,-10.418977 z m 9.02297,0 4.903049,0 0,10.418977 -7.831258,0 2.928209,-10.418977 z m 7.626964,0 5.584031,0 2.62176,10.418977 -8.205791,0 0,-10.418977 z m 8.410081,0 5.51593,0 4.46042,10.418977 -7.38863,0 -2.58772,-10.418977 z m -30.678091,13.142892 8.103649,0 -2.89416,10.282782 -9.6018026,0 4.3923136,-10.282782 z m 10.929711,0 8.614384,0 0,10.282782 -11.508544,0 2.89416,-10.282782 z m 11.338299,0 8.852721,0 2.58772,10.282782 -11.440441,0 0,-10.282782 z m 11.678781,0 7.86531,0 4.39231,10.282782 -9.6699,0 -2.58772,-10.282782 z";function QJ(e,t,n){e=Nn(e);let i=new M5(t,n);i._globePath=vBt,i._flatMapPath=FBt,i._columbusViewPath=IBt;let o=document.createElement("span");o.className="cesium-sceneModePicker-wrapper cesium-toolbar-button",e.appendChild(o);let r=document.createElement("button");r.type="button",r.className="cesium-button cesium-toolbar-button",r.setAttribute("data-bind",'css: { "cesium-sceneModePicker-button2D": sceneMode === _sceneMode.SCENE2D, "cesium-sceneModePicker-button3D": sceneMode === _sceneMode.SCENE3D, "cesium-sceneModePicker-buttonColumbusView": sceneMode === _sceneMode.COLUMBUS_VIEW, "cesium-sceneModePicker-selected": dropDownVisible },attr: { title: selectedTooltip },click: toggleDropDown'),r.innerHTML='<!-- ko cesiumSvgPath: { path: _globePath, width: 64, height: 64, css: "cesium-sceneModePicker-slide-svg cesium-sceneModePicker-icon3D" } --><!-- /ko --><!-- ko cesiumSvgPath: { path: _flatMapPath, width: 64, height: 64, css: "cesium-sceneModePicker-slide-svg cesium-sceneModePicker-icon2D" } --><!-- /ko --><!-- ko cesiumSvgPath: { path: _columbusViewPath, width: 64, height: 64, css: "cesium-sceneModePicker-slide-svg cesium-sceneModePicker-iconColumbusView" } --><!-- /ko -->',o.appendChild(r);let s=document.createElement("button");s.type="button",s.className="cesium-button cesium-toolbar-button cesium-sceneModePicker-dropDown-icon",s.setAttribute("data-bind",'css: { "cesium-sceneModePicker-visible" : (dropDownVisible && (sceneMode !== _sceneMode.SCENE3D)) || (!dropDownVisible && (sceneMode === _sceneMode.SCENE3D)), "cesium-sceneModePicker-none" : sceneMode === _sceneMode.SCENE3D, "cesium-sceneModePicker-hidden" : !dropDownVisible },attr: { title: tooltip3D },click: morphTo3D,cesiumSvgPath: { path: _globePath, width: 64, height: 64 }'),o.appendChild(s);let a=document.createElement("button");a.type="button",a.className="cesium-button cesium-toolbar-button cesium-sceneModePicker-dropDown-icon",a.setAttribute("data-bind",'css: { "cesium-sceneModePicker-visible" : (dropDownVisible && (sceneMode !== _sceneMode.SCENE2D)), "cesium-sceneModePicker-none" : sceneMode === _sceneMode.SCENE2D, "cesium-sceneModePicker-hidden" : !dropDownVisible },attr: { title: tooltip2D },click: morphTo2D,cesiumSvgPath: { path: _flatMapPath, width: 64, height: 64 }'),o.appendChild(a);let c=document.createElement("button");c.type="button",c.className="cesium-button cesium-toolbar-button cesium-sceneModePicker-dropDown-icon",c.setAttribute("data-bind",'css: { "cesium-sceneModePicker-visible" : (dropDownVisible && (sceneMode !== _sceneMode.COLUMBUS_VIEW)) || (!dropDownVisible && (sceneMode === _sceneMode.COLUMBUS_VIEW)), "cesium-sceneModePicker-none" : sceneMode === _sceneMode.COLUMBUS_VIEW, "cesium-sceneModePicker-hidden" : !dropDownVisible},attr: { title: tooltipColumbusView },click: morphToColumbusView,cesiumSvgPath: { path: _columbusViewPath, width: 64, height: 64 }'),o.appendChild(c),Ee.applyBindings(i,o),this._viewModel=i,this._container=e,this._wrapper=o,this._closeDropDown=function(d){o.contains(d.target)||(i.dropDownVisible=!1)},fn.supportsPointerEvents()?document.addEventListener("pointerdown",this._closeDropDown,!0):(document.addEventListener("mousedown",this._closeDropDown,!0),document.addEventListener("touchstart",this._closeDropDown,!0))}Object.defineProperties(QJ.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}}});QJ.prototype.isDestroyed=function(){return!1};QJ.prototype.destroy=function(){return this._viewModel.destroy(),fn.supportsPointerEvents()?document.removeEventListener("pointerdown",this._closeDropDown,!0):(document.removeEventListener("mousedown",this._closeDropDown,!0),document.removeEventListener("touchstart",this._closeDropDown,!0)),Ee.cleanNode(this._wrapper),this._container.removeChild(this._wrapper),ue(this)};var w5=QJ;var $hr=x(T(),1);var zhr=x(T(),1);var PBt=new k,qJ="-1000px";function k5(e,t,n){this._scene=e,this._screenPositionX=qJ,this._screenPositionY=qJ,this._tweens=e.tweens,this._container=n??document.body,this._selectionIndicatorElement=t,this._scale=1,this.position=void 0,this.showSelection=!1,Ee.track(this,["position","_screenPositionX","_screenPositionY","_scale","showSelection"]),this.isVisible=void 0,Ee.defineProperty(this,"isVisible",{get:function(){return this.showSelection&&l(this.position)}}),Ee.defineProperty(this,"_transform",{get:function(){return`scale(${this._scale})`}}),this.computeScreenSpacePosition=function(i,o){return fo.worldToWindowCoordinates(e,i,o)}}k5.prototype.update=function(){if(this.showSelection&&l(this.position)){let e=this.computeScreenSpacePosition(this.position,PBt);if(!l(e))this._screenPositionX=qJ,this._screenPositionY=qJ;else{let t=this._container,n=t.parentNode.clientWidth,i=t.parentNode.clientHeight,o=this._selectionIndicatorElement.clientWidth,r=o*.5;e.x=Math.min(Math.max(e.x,-o),n+o)-r,e.y=Math.min(Math.max(e.y,-o),i+o)-r,this._screenPositionX=`${Math.floor(e.x+.25)}px`,this._screenPositionY=`${Math.floor(e.y+.25)}px`}}};k5.prototype.animateAppear=function(){this._tweens.addProperty({object:this,property:"_scale",startValue:2,stopValue:1,duration:.8,easingFunction:vs.EXPONENTIAL_OUT})};k5.prototype.animateDepart=function(){this._tweens.addProperty({object:this,property:"_scale",startValue:this._scale,stopValue:1.5,duration:.8,easingFunction:vs.EXPONENTIAL_OUT})};Object.defineProperties(k5.prototype,{container:{get:function(){return this._container}},selectionIndicatorElement:{get:function(){return this._selectionIndicatorElement}},scene:{get:function(){return this._scene}}});var U5=k5;function $J(e,t){e=Nn(e),this._container=e;let n=document.createElement("div");n.className="cesium-selection-wrapper",n.setAttribute("data-bind",'style: { "top" : _screenPositionY, "left" : _screenPositionX },css: { "cesium-selection-wrapper-visible" : isVisible }'),e.appendChild(n),this._element=n;let i="http://www.w3.org/2000/svg",o="M -34 -34 L -34 -11.25 L -30 -15.25 L -30 -30 L -15.25 -30 L -11.25 -34 L -34 -34 z M 11.25 -34 L 15.25 -30 L 30 -30 L 30 -15.25 L 34 -11.25 L 34 -34 L 11.25 -34 z M -34 11.25 L -34 34 L -11.25 34 L -15.25 30 L -30 30 L -30 15.25 L -34 11.25 z M 34 11.25 L 30 15.25 L 30 30 L 15.25 30 L 11.25 34 L 34 34 L 34 11.25 z",r=document.createElementNS(i,"svg:svg");r.setAttribute("width",160),r.setAttribute("height",160),r.setAttribute("viewBox","0 0 160 160");let s=document.createElementNS(i,"g");s.setAttribute("transform","translate(80,80)"),r.appendChild(s);let a=document.createElementNS(i,"path");a.setAttribute("data-bind","attr: { transform: _transform }"),a.setAttribute("d",o),s.appendChild(a),n.appendChild(r);let c=new U5(t,this._element,this._container);this._viewModel=c,Ee.applyBindings(this._viewModel,this._element)}Object.defineProperties($J.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}}});$J.prototype.isDestroyed=function(){return!1};$J.prototype.destroy=function(){let e=this._container;return Ee.cleanNode(this._element),e.removeChild(this._element),ue(this)};var D5=$J;var ufr=x(T(),1);var nfr=x(T(),1);function DR(e,t,n){this._color=e,this._height=t,this._base=n??0}DR.prototype.getHeight=function(){return this._height};DR.prototype.getBase=function(){return this._base};DR.prototype.getStartTime=function(){return this._start};DR.prototype.getStopTime=function(){return this._stop};DR.prototype.setRange=function(e,t){this._start=e,this._stop=t};DR.prototype.render=function(e){let t="";if(this._start&&this._stop&&this._color){let n=Q.secondsDifference(this._start,e.epochJulian),i=Math.round(e.timeBarWidth*e.getAlpha(n)),o=Q.secondsDifference(this._stop,e.epochJulian),r=Math.round(e.timeBarWidth*e.getAlpha(o))-i;i<0&&(r+=i,i=0),i+r>e.timeBarWidth&&(r=e.timeBarWidth-i),r>0&&(t=`<span class="cesium-timeline-highlight" style="left: ${i.toString()}px; width: ${r.toString()}px; bottom: ${this._base.toString()}px; height: ${this._height}px; background-color: ${this._color};"></span>`)}return t};var O5=DR;var rfr=x(T(),1);function xYe(e,t,n,i){this.interval=e,this.height=t,this.color=n||new U(.5,.5,.5,1),this.backgroundColor=i||new U(0,0,0,0)}xYe.prototype.render=function(e,t){let n=this.interval.start,i=this.interval.stop,o=t.startJulian,r=Q.addSeconds(t.startJulian,t.duration,new Q);if(Q.lessThan(n,o)&&Q.greaterThan(i,r))e.fillStyle=this.color.toCssColorString(),e.fillRect(0,t.y,t.timeBarWidth,this.height);else if(Q.lessThanOrEquals(n,r)&&Q.greaterThanOrEquals(i,o)){let s,a,c;for(s=0;s<t.timeBarWidth;++s){let d=Q.addSeconds(t.startJulian,s/t.timeBarWidth*t.duration,new Q);!l(a)&&Q.greaterThanOrEquals(d,n)?a=s:!l(c)&&Q.greaterThanOrEquals(d,i)&&(c=s)}e.fillStyle=this.backgroundColor.toCssColorString(),e.fillRect(0,t.y,t.timeBarWidth,this.height),l(a)&&(l(c)||(c=t.timeBarWidth),e.fillStyle=this.color.toCssColorString(),e.fillRect(a,t.y,Math.max(c-a,1),this.height))}};var B5=xYe;var lle=1e12,Ah={none:0,scrub:1,slide:2,zoom:3,touchOnly:4},xd={none:0,scrub:1,slideZoom:2,singleTap:3,ignore:4},OT=[.001,.002,.005,.01,.02,.05,.1,.25,.5,1,2,5,10,15,30,60,120,300,600,900,1800,3600,7200,14400,21600,43200,86400,172800,345600,604800,1296e3,2592e3,5184e3,7776e3,15552e3,31536e3,63072e3,126144e3,15768e4,31536e4,63072e4,126144e4,15768e5,31536e5,63072e5,126144e5,15768e6,31536e6],XBt=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function Td(e,t){e=Nn(e);let n=e.ownerDocument;this.container=e;let i=n.createElement("div");i.className="cesium-timeline-main",e.appendChild(i),this._topDiv=i,this._endJulian=void 0,this._epochJulian=void 0,this._lastXPos=void 0,this._scrubElement=void 0,this._startJulian=void 0,this._timeBarSecondsSpan=void 0,this._clock=t,this._scrubJulian=t.currentTime,this._mainTicSpan=-1,this._mouseMode=Ah.none,this._touchMode=xd.none,this._touchState={centerX:0,spanX:0},this._mouseX=0,this._timelineDrag=0,this._timelineDragLocation=void 0,this._lastHeight=void 0,this._lastWidth=void 0,this._topDiv.innerHTML='<div class="cesium-timeline-bar"></div><div class="cesium-timeline-trackContainer"><canvas class="cesium-timeline-tracks" width="10" height="1"></canvas></div><div class="cesium-timeline-needle"></div><span class="cesium-timeline-ruler"></span>',this._timeBarEle=this._topDiv.childNodes[0],this._trackContainer=this._topDiv.childNodes[1],this._trackListEle=this._topDiv.childNodes[1].childNodes[0],this._needleEle=this._topDiv.childNodes[2],this._rulerEle=this._topDiv.childNodes[3],this._context=this._trackListEle.getContext("2d"),this._trackList=[],this._highlightRanges=[],this.zoomTo(t.startTime,t.stopTime),this._onMouseDown=NBt(this),this._onMouseUp=YBt(this),this._onMouseMove=MBt(this),this._onMouseWheel=wBt(this),this._onTouchStart=kBt(this),this._onTouchMove=DBt(this),this._onTouchEnd=UBt(this);let o=this._timeBarEle;n.addEventListener("mouseup",this._onMouseUp,!1),n.addEventListener("mousemove",this._onMouseMove,!1),o.addEventListener("mousedown",this._onMouseDown,!1),o.addEventListener("DOMMouseScroll",this._onMouseWheel,!1),o.addEventListener("mousewheel",this._onMouseWheel,!1),o.addEventListener("touchstart",this._onTouchStart,!1),o.addEventListener("touchmove",this._onTouchMove,!1),o.addEventListener("touchend",this._onTouchEnd,!1),o.addEventListener("touchcancel",this._onTouchEnd,!1),this._topDiv.oncontextmenu=function(){return!1},t.onTick.addEventListener(this.updateFromClock,this),this.updateFromClock()}Td.prototype.addEventListener=function(e,t,n){this._topDiv.addEventListener(e,t,n)};Td.prototype.removeEventListener=function(e,t,n){this._topDiv.removeEventListener(e,t,n)};Td.prototype.isDestroyed=function(){return!1};Td.prototype.destroy=function(){this._clock.onTick.removeEventListener(this.updateFromClock,this);let e=this.container.ownerDocument;e.removeEventListener("mouseup",this._onMouseUp,!1),e.removeEventListener("mousemove",this._onMouseMove,!1);let t=this._timeBarEle;t.removeEventListener("mousedown",this._onMouseDown,!1),t.removeEventListener("DOMMouseScroll",this._onMouseWheel,!1),t.removeEventListener("mousewheel",this._onMouseWheel,!1),t.removeEventListener("touchstart",this._onTouchStart,!1),t.removeEventListener("touchmove",this._onTouchMove,!1),t.removeEventListener("touchend",this._onTouchEnd,!1),t.removeEventListener("touchcancel",this._onTouchEnd,!1),this.container.removeChild(this._topDiv),ue(this)};Td.prototype.addHighlightRange=function(e,t,n){let i=new O5(e,t,n);return this._highlightRanges.push(i),this.resize(),i};Td.prototype.addTrack=function(e,t,n,i){let o=new B5(e,t,n,i);return this._trackList.push(o),this._lastHeight=void 0,this.resize(),o};Td.prototype.zoomTo=function(e,t){if(this._startJulian=e,this._endJulian=t,this._timeBarSecondsSpan=Q.secondsDifference(t,e),this._clock&&this._clock.clockRange!==As.UNBOUNDED){let i=this._clock.startTime,o=this._clock.stopTime,r=Q.secondsDifference(o,i),s=Q.secondsDifference(i,this._startJulian),a=Q.secondsDifference(o,this._endJulian);this._timeBarSecondsSpan>=r?(this._timeBarSecondsSpan=r,this._startJulian=this._clock.startTime,this._endJulian=this._clock.stopTime):s>0?(this._endJulian=Q.addSeconds(this._endJulian,s,new Q),this._startJulian=i,this._timeBarSecondsSpan=Q.secondsDifference(this._endJulian,this._startJulian)):a<0&&(this._startJulian=Q.addSeconds(this._startJulian,a,new Q),this._endJulian=o,this._timeBarSecondsSpan=Q.secondsDifference(this._endJulian,this._startJulian))}this._makeTics();let n=document.createEvent("Event");n.initEvent("setzoom",!0,!0),n.startJulian=this._startJulian,n.endJulian=this._endJulian,n.epochJulian=this._epochJulian,n.totalSpan=this._timeBarSecondsSpan,n.mainTicSpan=this._mainTicSpan,this._topDiv.dispatchEvent(n)};Td.prototype.zoomFrom=function(e){let t=Q.secondsDifference(this._scrubJulian,this._startJulian);e>1||t<0||t>this._timeBarSecondsSpan?t=this._timeBarSecondsSpan*.5:t+=t-this._timeBarSecondsSpan*.5;let n=this._timeBarSecondsSpan-t;this.zoomTo(Q.addSeconds(this._startJulian,t-t*e,new Q),Q.addSeconds(this._endJulian,n*e-n,new Q))};function dle(e){return e<10?`0${e.toString()}`:e.toString()}Td.prototype.makeLabel=function(e){let t=Q.toGregorianDate(e),n=t.millisecond,i=" UTC";if(n>0&&this._timeBarSecondsSpan<3600){for(i=Math.floor(n).toString();i.length<3;)i=`0${i}`;i=`.${i}`}return`${XBt[t.month-1]} ${t.day} ${t.year} ${dle(t.hour)}:${dle(t.minute)}:${dle(t.second)}${i}`};Td.prototype.smallestTicInPixels=7;Td.prototype._makeTics=function(){let e=this._timeBarEle,t=Q.secondsDifference(this._scrubJulian,this._startJulian),n=Math.round(t*this._topDiv.clientWidth/this._timeBarSecondsSpan),i=n-8,o,r=this;this._needleEle.style.left=`${n.toString()}px`;let s="",a=.01,c=31536e6,d=1e-10,u=0,m=this._timeBarSecondsSpan;m<a?(m=a,this._timeBarSecondsSpan=a,this._endJulian=Q.addSeconds(this._startJulian,a,new Q)):m>c&&(m=c,this._timeBarSecondsSpan=c,this._endJulian=Q.addSeconds(this._startJulian,c,new Q));let p=this._timeBarEle.clientWidth;p<10&&(p=10);let b=this._startJulian,f=Math.min(m/p*1e-5,.4),y,_=Q.toGregorianDate(b);m>31536e4?y=Q.fromDate(new Date(Date.UTC(Math.floor(_.year/100)*100,0))):m>31536e3?y=Q.fromDate(new Date(Date.UTC(Math.floor(_.year/10)*10,0))):m>86400?y=Q.fromDate(new Date(Date.UTC(_.year,0))):y=Q.fromDate(new Date(Date.UTC(_.year,_.month,_.day)));let S=Q.secondsDifference(this._startJulian,Q.addSeconds(y,f,new Q)),Z=S+m;this._epochJulian=y;function R(w){return Math.floor(S/w)*w}function C(w,z){return Math.ceil(w/z+.5)*z}function E(w){return(w-S)/m}function A(w,z){return w-z*Math.round(w/z)}this._rulerEle.innerHTML=this.makeLabel(Q.addSeconds(this._endJulian,-a,new Q));let L=this._rulerEle.offsetWidth+20;L<30&&(L=180);let F=u;u-=d;let I={startTime:S,startJulian:b,epochJulian:y,duration:m,timeBarWidth:p,getAlpha:E};this._highlightRanges.forEach(function(w){s+=w.render(I)});let N=0,g=0,V=0,G=L/p;G>1&&(G=1),G*=this._timeBarSecondsSpan;let v=-1,X=-1,Y=OT.length,D;for(D=0;D<Y;++D){let w=OT[D];if(++v,N=w,w>G&&w>u)break;X<0&&p*(w/this._timeBarSecondsSpan)>=this.smallestTicInPixels&&(X=v)}if(v>0){for(;v>0;)if(--v,Math.abs(A(N,OT[v]))<1e-5){OT[v]>=u&&(g=OT[v]);break}if(X>=0)for(;X<v;){if(Math.abs(A(g,OT[X]))<1e-5&&OT[X]>=u){V=OT[X];break}++X}}u=F,u>d&&V<1e-5&&Math.abs(u-N)>d&&(V=u,u<=N+d&&(g=0));let M=-999999,O;if(p*(V/this._timeBarSecondsSpan)>=3)for(o=R(V);o<=Z;o=C(o,V))s+=`<span class="cesium-timeline-ticTiny" style="left: ${Math.round(p*E(o)).toString()}px;"></span>`;if(p*(g/this._timeBarSecondsSpan)>=3)for(o=R(g);o<=Z;o=C(o,g))s+=`<span class="cesium-timeline-ticSub" style="left: ${Math.round(p*E(o)).toString()}px;"></span>`;if(p*(N/this._timeBarSecondsSpan)>=2){this._mainTicSpan=N,Z+=N,o=R(N);let w=Q.computeTaiMinusUtc(y);for(;o<=Z;){let z=Q.addSeconds(b,o-S,new Q);if(N>2.1){let $=Q.computeTaiMinusUtc(z);Math.abs($-w)>.1&&(o+=$-w,z=Q.addSeconds(b,o-S,new Q))}let K=Math.round(p*E(o)),te=this.makeLabel(z);this._rulerEle.innerHTML=te,O=this._rulerEle.offsetWidth,O<10&&(O=L);let H=K-(O/2-1);H>M?(M=H+O+5,s+=`<span class="cesium-timeline-ticMain" style="left: ${K.toString()}px;"></span><span class="cesium-timeline-ticLabel" style="left: ${H.toString()}px;">${te}</span>`):s+=`<span class="cesium-timeline-ticSub" style="left: ${K.toString()}px;"></span>`,o=C(o,N)}}else this._mainTicSpan=-1;s+=`<span class="cesium-timeline-icon16" style="left:${i}px;bottom:0;background-position: 0 0;"></span>`,e.innerHTML=s,this._scrubElement=e.lastChild,this._context.clearRect(0,0,this._trackListEle.width,this._trackListEle.height),I.y=0,this._trackList.forEach(function(w){w.render(r._context,I),I.y+=w.height})};Td.prototype.updateFromClock=function(){this._scrubJulian=this._clock.currentTime;let e=this._scrubElement;if(l(this._scrubElement)){let t=Q.secondsDifference(this._scrubJulian,this._startJulian),n=Math.round(t*this._topDiv.clientWidth/this._timeBarSecondsSpan);this._lastXPos!==n&&(this._lastXPos=n,e.style.left=`${n-8}px`,this._needleEle.style.left=`${n}px`)}l(this._timelineDragLocation)&&(this._setTimeBarTime(this._timelineDragLocation,this._timelineDragLocation*this._timeBarSecondsSpan/this._topDiv.clientWidth),this.zoomTo(Q.addSeconds(this._startJulian,this._timelineDrag,new Q),Q.addSeconds(this._endJulian,this._timelineDrag,new Q)))};Td.prototype._setTimeBarTime=function(e,t){if(e=Math.round(e),this._scrubJulian=Q.addSeconds(this._startJulian,t,new Q),this._scrubElement){let i=e-8;this._scrubElement.style.left=`${i.toString()}px`,this._needleEle.style.left=`${e.toString()}px`}let n=document.createEvent("Event");n.initEvent("settime",!0,!0),n.clientX=e,n.timeSeconds=t,n.timeJulian=this._scrubJulian,n.clock=this._clock,this._topDiv.dispatchEvent(n)};function NBt(e){return function(t){e._mouseMode!==Ah.touchOnly&&(t.button===0?(e._mouseMode=Ah.scrub,e._scrubElement&&(e._scrubElement.style.backgroundPosition="-16px 0"),e._onMouseMove(t)):(e._mouseX=t.clientX,t.button===2?e._mouseMode=Ah.zoom:e._mouseMode=Ah.slide)),t.preventDefault()}}function YBt(e){return function(t){e._mouseMode=Ah.none,e._scrubElement&&(e._scrubElement.style.backgroundPosition="0 0"),e._timelineDrag=0,e._timelineDragLocation=void 0}}function MBt(e){return function(t){let n;if(e._mouseMode===Ah.scrub){t.preventDefault();let i=t.clientX-e._topDiv.getBoundingClientRect().left;i<0?(e._timelineDragLocation=0,e._timelineDrag=-.01*e._timeBarSecondsSpan):i>e._topDiv.clientWidth?(e._timelineDragLocation=e._topDiv.clientWidth,e._timelineDrag=.01*e._timeBarSecondsSpan):(e._timelineDragLocation=void 0,e._setTimeBarTime(i,i*e._timeBarSecondsSpan/e._topDiv.clientWidth))}else if(e._mouseMode===Ah.slide){if(n=e._mouseX-t.clientX,e._mouseX=t.clientX,n!==0){let i=n*e._timeBarSecondsSpan/e._topDiv.clientWidth;e.zoomTo(Q.addSeconds(e._startJulian,i,new Q),Q.addSeconds(e._endJulian,i,new Q))}}else e._mouseMode===Ah.zoom&&(n=e._mouseX-t.clientX,e._mouseX=t.clientX,n!==0&&e.zoomFrom(Math.pow(1.01,n)))}}function wBt(e){return function(t){let n=t.wheelDeltaY||t.wheelDelta||-t.detail;lle=Math.max(Math.min(Math.abs(n),lle),1),n/=lle,e.zoomFrom(Math.pow(1.05,-n))}}function kBt(e){return function(t){let n=t.touches.length,i,o,r=e._topDiv.getBoundingClientRect().left;t.preventDefault(),e._mouseMode=Ah.touchOnly,n===1?(i=Q.secondsDifference(e._scrubJulian,e._startJulian),o=Math.round(i*e._topDiv.clientWidth/e._timeBarSecondsSpan+r),Math.abs(t.touches[0].clientX-o)<50?(e._touchMode=xd.scrub,e._scrubElement&&(e._scrubElement.style.backgroundPosition=n===1?"-16px 0":"0 0")):(e._touchMode=xd.singleTap,e._touchState.centerX=t.touches[0].clientX-r)):n===2?(e._touchMode=xd.slideZoom,e._touchState.centerX=(t.touches[0].clientX+t.touches[1].clientX)*.5-r,e._touchState.spanX=Math.abs(t.touches[0].clientX-t.touches[1].clientX)):e._touchMode=xd.ignore}}function UBt(e){return function(t){let n=t.touches.length,i=e._topDiv.getBoundingClientRect().left;e._touchMode===xd.singleTap?(e._touchMode=xd.scrub,e._onTouchMove(t)):e._touchMode===xd.scrub&&e._onTouchMove(t),e._mouseMode=Ah.touchOnly,n!==1?e._touchMode=n>0?xd.ignore:xd.none:e._touchMode===xd.slideZoom&&(e._touchState.centerX=t.touches[0].clientX-i),e._scrubElement&&(e._scrubElement.style.backgroundPosition="0 0")}}function DBt(e){return function(t){let n,i,o,r,s,a,c=1,d=e._topDiv.getBoundingClientRect().left;e._touchMode===xd.singleTap&&(e._touchMode=xd.slideZoom),e._mouseMode=Ah.touchOnly,e._touchMode===xd.scrub?(t.preventDefault(),t.changedTouches.length===1&&(i=t.changedTouches[0].clientX-d,i>=0&&i<=e._topDiv.clientWidth&&e._setTimeBarTime(i,i*e._timeBarSecondsSpan/e._topDiv.clientWidth))):e._touchMode===xd.slideZoom&&(o=t.touches.length,o===2?(r=(t.touches[0].clientX+t.touches[1].clientX)*.5-d,s=Math.abs(t.touches[0].clientX-t.touches[1].clientX)):o===1&&(r=t.touches[0].clientX-d,s=0),l(r)&&(s>0&&e._touchState.spanX>0?(c=e._touchState.spanX/s,a=Q.addSeconds(e._startJulian,(e._touchState.centerX*e._timeBarSecondsSpan-r*e._timeBarSecondsSpan*c)/e._topDiv.clientWidth,new Q)):(n=e._touchState.centerX-r,a=Q.addSeconds(e._startJulian,n*e._timeBarSecondsSpan/e._topDiv.clientWidth,new Q)),e.zoomTo(a,Q.addSeconds(a,e._timeBarSecondsSpan*c,new Q)),e._touchState.centerX=r,e._touchState.spanX=s))}}Td.prototype.resize=function(){let e=this.container.clientWidth,t=this.container.clientHeight;if(e===this._lastWidth&&t===this._lastHeight)return;this._trackContainer.style.height=`${t}px`;let n=1;this._trackList.forEach(function(i){n+=i.height}),this._trackListEle.style.height=`${n.toString()}px`,this._trackListEle.width=this._trackListEle.clientWidth,this._trackListEle.height=n,this._makeTics(),this._lastXPos=void 0,this._lastWidth=e,this._lastHeight=t};var z5=Td;var cpr=x(T(),1);var Rfr=x(T(),1);var gfr=x(T(),1);var TYe=1e3;function pp(e){l(e.geocoderServices)?this._geocoderServices=e.geocoderServices:this._geocoderServices=[new FR({scene:e.scene})],this._viewContainer=e.container,this._scene=e.scene,this._flightDuration=e.flightDuration,this._searchText="",this._isSearchInProgress=!1,this._wasGeocodeCancelled=!1,this._previousCredits=[],this._complete=new Se,this._suggestions=[],this._selectedSuggestion=void 0,this._showSuggestions=!0,this._handleArrowDown=SYe,this._handleArrowUp=_Ye;let t=this;this._suggestionsVisible=Ee.pureComputed(function(){let o=Ee.getObservable(t,"_suggestions")().length>0,r=Ee.getObservable(t,"_showSuggestions")();return o&&r}),this._searchCommand=Fn(function(i){if(i=i??NT.SEARCH,t._focusTextbox=!1,l(t._selectedSuggestion))return t.activateSuggestion(t._selectedSuggestion),!1;if(t.hideSuggestions(),t.isSearchInProgress)JBt(t);else return HBt(t,t._geocoderServices,i)}),this.deselectSuggestion=function(){t._selectedSuggestion=void 0},this.handleKeyDown=function(i,o){let r=o.key==="ArrowDown"||o.key==="Down"||o.keyCode===40,s=o.key==="ArrowUp"||o.key==="Up"||o.keyCode===38;return(r||s)&&o.preventDefault(),!0},this.handleKeyUp=function(i,o){let r=o.key==="ArrowDown"||o.key==="Down"||o.keyCode===40,s=o.key==="ArrowUp"||o.key==="Up"||o.keyCode===38,a=o.key==="Enter"||o.keyCode===13;return s?_Ye(t):r?SYe(t):a&&t._searchCommand(),!0},this.activateSuggestion=function(i){t.hideSuggestions(),t._searchText=i.displayName;let o=i.destination;CYe(t),t.destinationFound(t,o)},this.hideSuggestions=function(){t._showSuggestions=!1,t._selectedSuggestion=void 0},this.showSuggestions=function(){t._showSuggestions=!0},this.handleMouseover=function(i,o){i!==t._selectedSuggestion&&(t._selectedSuggestion=i)},this.keepExpanded=!1,this.autoComplete=e.autocomplete??!0,this.destinationFound=e.destinationFound??pp.flyToDestination,this._focusTextbox=!1,Ee.track(this,["_searchText","_isSearchInProgress","keepExpanded","_suggestions","_selectedSuggestion","_showSuggestions","_focusTextbox"]);let n=Ee.getObservable(this,"_searchText");n.extend({rateLimit:{timeout:500}}),this._suggestionSubscription=n.subscribe(function(){pp._updateSearchSuggestions(t)}),this.isSearchInProgress=void 0,Ee.defineProperty(this,"isSearchInProgress",{get:function(){return this._isSearchInProgress}}),this.searchText=void 0,Ee.defineProperty(this,"searchText",{get:function(){return this.isSearchInProgress?"Searching...":this._searchText},set:function(i){this._searchText=i}}),this.flightDuration=void 0,Ee.defineProperty(this,"flightDuration",{get:function(){return this._flightDuration},set:function(i){this._flightDuration=i}})}Object.defineProperties(pp.prototype,{complete:{get:function(){return this._complete}},scene:{get:function(){return this._scene}},search:{get:function(){return this._searchCommand}},selectedSuggestion:{get:function(){return this._selectedSuggestion}},suggestions:{get:function(){return this._suggestions}}});function _Ye(e){if(e._suggestions.length===0)return;let t=e._suggestions.indexOf(e._selectedSuggestion);if(t===-1||t===0){e._selectedSuggestion=void 0;return}let n=t-1;e._selectedSuggestion=e._suggestions[n],pp._adjustSuggestionsScroll(e,n)}function SYe(e){if(e._suggestions.length===0)return;let t=e._suggestions.length,i=(e._suggestions.indexOf(e._selectedSuggestion)+1)%t;e._selectedSuggestion=e._suggestions[i],pp._adjustSuggestionsScroll(e,i)}function OBt(e,t){let n=l(t)?t.availability:void 0;return l(n)?OZ(t,[e]).then(function(i){return e=i[0],e.height+=TYe,e}):(e.height+=TYe,Promise.resolve(e))}function BBt(e,t){let n=e._scene,i=n.ellipsoid,o=n.camera,r=n.terrainProvider,s=t,a;return t instanceof re?W.equalsEpsilon(t.south,t.north,W.EPSILON7)&&W.equalsEpsilon(t.east,t.west,W.EPSILON7)?t=re.center(t):a=BZ(t,n):t=i.cartesianToCartographic(t),l(a)||(a=OBt(t,r)),a.then(function(c){s=i.cartographicToCartesian(c)}).finally(function(){o.flyTo({destination:s,complete:function(){e._complete.raiseEvent()},duration:e._flightDuration,endTransform:P.IDENTITY})})}async function zBt(e,t,n){try{return{state:"fulfilled",value:await e.geocode(t,n),credits:e.credit}}catch(i){return{state:"rejected",reason:i}}}async function HBt(e,t,n){let i=e._searchText;if(RYe(i)){e.showSuggestions();return}e._isSearchInProgress=!0,e._wasGeocodeCancelled=!1;let o,r;for(o=0;o<t.length;o++){if(e._wasGeocodeCancelled)return;if(r=await zBt(t[o],i,n),l(r)&&r.state==="fulfilled"&&r.value.length>0)break}if(e._wasGeocodeCancelled)return;e._isSearchInProgress=!1,mle(e);let s=r.value;if(r.state==="fulfilled"&&l(s)&&s.length>0){e._searchText=s[0].displayName,e.destinationFound(e,s[0].destination);let a=ZYe(e,VA.getCreditsFromResult(s[0]));l(a)||ule(e,t[o].credit);return}e._searchText=`${i} (not found)`}function ule(e,t){l(t)&&!e._scene.isDestroyed()&&!e._scene.frameState.creditDisplay.isDestroyed()&&(e._scene.frameState.creditDisplay.addStaticCredit(t),e._previousCredits.push(t))}function ZYe(e,t){return l(t)&&t.forEach(n=>ule(e,n)),t}function mle(e){!e._scene.isDestroyed()&&!e._scene.frameState.creditDisplay.isDestroyed()&&e._previousCredits.forEach(t=>{e._scene.frameState.creditDisplay.removeStaticCredit(t)}),e._previousCredits.length=0}function KBt(e,t){let n=Nn(e._viewContainer),i=n.getElementsByClassName("search-results")[0],r=n.getElementsByTagName("li")[t];if(t===0){i.scrollTop=0;return}let s=r.offsetTop;s+r.clientHeight>i.clientHeight?i.scrollTop=s+r.clientHeight:s<i.scrollTop&&(i.scrollTop=s)}function JBt(e){e._isSearchInProgress&&(e._isSearchInProgress=!1,e._wasGeocodeCancelled=!0)}function RYe(e){return/^\s*$/.test(e)}function CYe(e){Ee.getObservable(e,"_suggestions").removeAll()}async function jBt(e){if(!e.autoComplete)return;let t=e._searchText;if(CYe(e),mle(e),!RYe(t))for(let n of e._geocoderServices){let i=await n.geocode(t,NT.AUTOCOMPLETE);if(e._suggestions=e._suggestions.concat(i),i.length>0){let o=!0;i.forEach(r=>{let s=VA.getCreditsFromResult(r);o=o&&!l(s),ZYe(e,s)}),o&&ule(e,n.credit)}if(e._suggestions.length>=5)return}}pp.flyToDestination=BBt;pp._updateSearchSuggestions=jBt;pp._adjustSuggestionsScroll=KBt;pp.prototype.isDestroyed=function(){return!1};pp.prototype.destroy=function(){return this._suggestionSubscription.dispose(),mle(this),ue(this)};var H5=pp;var QBt="M29.772,26.433l-7.126-7.126c0.96-1.583,1.523-3.435,1.524-5.421C24.169,8.093,19.478,3.401,13.688,3.399C7.897,3.401,3.204,8.093,3.204,13.885c0,5.789,4.693,10.481,10.484,10.481c1.987,0,3.839-0.563,5.422-1.523l7.128,7.127L29.772,26.433zM7.203,13.885c0.006-3.582,2.903-6.478,6.484-6.486c3.579,0.008,6.478,2.904,6.484,6.486c-0.007,3.58-2.905,6.476-6.484,6.484C10.106,20.361,7.209,17.465,7.203,13.885z",qBt="M24.778,21.419 19.276,15.917 24.777,10.415 21.949,7.585 16.447,13.087 10.945,7.585 8.117,10.415 13.618,15.917 8.116,21.419 10.946,24.248 16.447,18.746 21.948,24.248z";function ej(e){let t=Nn(e.container),n=new H5(e);n._startSearchPath=QBt,n._stopSearchPath=qBt;let i=document.createElement("form");i.setAttribute("data-bind","submit: search");let o=document.createElement("input");o.type="search",o.className="cesium-geocoder-input",o.setAttribute("placeholder","Enter an address or landmark..."),o.setAttribute("data-bind",'textInput: searchText,disable: isSearchInProgress,event: { keyup: handleKeyUp, keydown: handleKeyDown, mouseover: deselectSuggestion },css: { "cesium-geocoder-input-wide" : keepExpanded || searchText.length > 0 },hasFocus: _focusTextbox'),this._onTextBoxFocus=function(){setTimeout(function(){o.select()},0)},o.addEventListener("focus",this._onTextBoxFocus,!1),i.appendChild(o),this._textBox=o;let r=document.createElement("span");r.className="cesium-geocoder-searchButton",r.setAttribute("data-bind","click: search,cesiumSvgPath: { path: isSearchInProgress ? _stopSearchPath : _startSearchPath, width: 32, height: 32 }"),i.appendChild(r),t.appendChild(i);let s=document.createElement("div");s.className="search-results",s.setAttribute("data-bind","visible: _suggestionsVisible");let a=document.createElement("ul");a.setAttribute("data-bind","foreach: _suggestions");let c=document.createElement("li");a.appendChild(c),c.setAttribute("data-bind","text: $data.displayName, click: $parent.activateSuggestion, event: { mouseover: $parent.handleMouseover}, css: { active: $data === $parent._selectedSuggestion }"),s.appendChild(a),t.appendChild(s),Ee.applyBindings(n,i),Ee.applyBindings(n,s),this._container=t,this._searchSuggestionsContainer=s,this._viewModel=n,this._form=i,this._onInputBegin=function(d){let u=d.target;typeof d.composedPath=="function"&&(u=d.composedPath()[0]),t.contains(u)||(n._focusTextbox=!1,n.hideSuggestions())},this._onInputEnd=function(d){n._focusTextbox=!0,n.showSuggestions()},fn.supportsPointerEvents()?(document.addEventListener("pointerdown",this._onInputBegin,!0),t.addEventListener("pointerup",this._onInputEnd,!0),t.addEventListener("pointercancel",this._onInputEnd,!0)):(document.addEventListener("mousedown",this._onInputBegin,!0),t.addEventListener("mouseup",this._onInputEnd,!0),document.addEventListener("touchstart",this._onInputBegin,!0),t.addEventListener("touchend",this._onInputEnd,!0),t.addEventListener("touchcancel",this._onInputEnd,!0))}Object.defineProperties(ej.prototype,{container:{get:function(){return this._container}},searchSuggestionsContainer:{get:function(){return this._searchSuggestionsContainer}},viewModel:{get:function(){return this._viewModel}}});ej.prototype.isDestroyed=function(){return!1};ej.prototype.destroy=function(){let e=this._container;return fn.supportsPointerEvents()?(document.removeEventListener("pointerdown",this._onInputBegin,!0),e.removeEventListener("pointerup",this._onInputEnd,!0)):(document.removeEventListener("mousedown",this._onInputBegin,!0),e.removeEventListener("mouseup",this._onInputEnd,!0),document.removeEventListener("touchstart",this._onInputBegin,!0),e.removeEventListener("touchend",this._onInputEnd,!0)),this._viewModel.destroy(),Ee.cleanNode(this._form),Ee.cleanNode(this._searchSuggestionsContainer),e.removeChild(this._form),e.removeChild(this._searchSuggestionsContainer),this._textBox.removeEventListener("focus",this._onTextBoxFocus,!1),ue(this)};var K5=ej;var kfr=x(T(),1);var Ifr=x(T(),1);var LYe=x(GYe(),1);function t3t(e){let t=!1,n=window.screen;return l(n)&&(l(n.lockOrientation)?t=n.lockOrientation(e):l(n.mozLockOrientation)?t=n.mozLockOrientation(e):l(n.msLockOrientation)?t=n.msLockOrientation(e):l(n.orientation&&n.orientation.lock)&&(t=n.orientation.lock(e))),t}function WYe(){let e=window.screen;l(e)&&(l(e.unlockOrientation)?e.unlockOrientation():l(e.mozUnlockOrientation)?e.mozUnlockOrientation():l(e.msUnlockOrientation)?e.msUnlockOrientation():l(e.orientation&&e.orientation.unlock)&&e.orientation.unlock())}function n3t(e,t,n,i){i()||(n()?(t.useWebVR=!1,e._locked&&(WYe(),e._locked=!1),e._noSleep.disable(),qr.exitFullscreen(),n(!1)):(qr.fullscreen||qr.requestFullscreen(e._vrElement),e._noSleep.enable(),e._locked||(e._locked=t3t("landscape")),t.useWebVR=!0,n(!0)))}function tj(e,t){let n=this,i=Ee.observable(qr.enabled),o=Ee.observable(!1);this.isVRMode=void 0,Ee.defineProperty(this,"isVRMode",{get:function(){return o()}}),this.isVREnabled=void 0,Ee.defineProperty(this,"isVREnabled",{get:function(){return i()},set:function(s){i(s&&qr.enabled)}}),this.tooltip=void 0,Ee.defineProperty(this,"tooltip",function(){return i()?o()?"Exit VR mode":"Enter VR mode":"VR mode is unavailable"});let r=Ee.observable(!1);this._isOrthographic=void 0,Ee.defineProperty(this,"_isOrthographic",{get:function(){return r()}}),this._eventHelper=new Hr,this._eventHelper.add(e.preRender,function(){r(e.camera.frustum instanceof yn)}),this._locked=!1,this._noSleep=new LYe.default,this._command=Fn(function(){n3t(n,e,o,r)},Ee.getObservable(this,"isVREnabled")),this._vrElement=Nn(t)??document.body,this._callback=function(){!qr.fullscreen&&o()&&(e.useWebVR=!1,n._locked&&(WYe(),n._locked=!1),n._noSleep.disable(),o(!1))},document.addEventListener(qr.changeEventName,this._callback)}Object.defineProperties(tj.prototype,{vrElement:{get:function(){return this._vrElement},set:function(e){this._vrElement=e}},command:{get:function(){return this._command}}});tj.prototype.isDestroyed=function(){return!1};tj.prototype.destroy=function(){this._eventHelper.removeAll(),document.removeEventListener(qr.changeEventName,this._callback),ue(this)};var J5=tj;var i3t="M 5.3125 6.375 C 4.008126 6.375 2.96875 7.4141499 2.96875 8.71875 L 2.96875 19.5 C 2.96875 20.8043 4.008126 21.875 5.3125 21.875 L 13.65625 21.875 C 13.71832 20.0547 14.845166 18.59375 16.21875 18.59375 C 17.592088 18.59375 18.71881 20.0552 18.78125 21.875 L 27.09375 21.875 C 28.398125 21.875 29.4375 20.8043 29.4375 19.5 L 29.4375 8.71875 C 29.4375 7.4141499 28.398125 6.375 27.09375 6.375 L 5.3125 6.375 z M 9.625 10.4375 C 11.55989 10.4375 13.125 12.03385 13.125 13.96875 C 13.125 15.90365 11.55989 17.46875 9.625 17.46875 C 7.69011 17.46875 6.125 15.90365 6.125 13.96875 C 6.125 12.03385 7.69011 10.4375 9.625 10.4375 z M 22.46875 10.4375 C 24.40364 10.4375 25.96875 12.03385 25.96875 13.96875 C 25.96875 15.90365 24.40364 17.46875 22.46875 17.46875 C 20.53386 17.46875 18.96875 15.90365 18.96875 13.96875 C 18.96875 12.03385 20.53386 10.4375 22.46875 10.4375 z",o3t="M 25.770585,2.4552065 C 15.72282,13.962707 10.699956,19.704407 8.1768352,22.580207 c -1.261561,1.4379 -1.902282,2.1427 -2.21875,2.5 -0.141624,0.1599 -0.208984,0.2355 -0.25,0.2813 l 0.6875,0.75 c 10e-5,-10e-5 0.679191,0.727 0.6875,0.7187 0.01662,-0.016 0.02451,-0.024 0.03125,-0.031 0.01348,-0.014 0.04013,-0.038 0.0625,-0.062 0.04474,-0.05 0.120921,-0.1315 0.28125,-0.3126 0.320657,-0.3619 0.956139,-1.0921 2.2187499,-2.5312 2.5252219,-2.8781 7.5454589,-8.6169 17.5937499,-20.1250005 l -1.5,-1.3125 z m -20.5624998,3.9063 c -1.304375,0 -2.34375,1.0391 -2.34375,2.3437 l 0,10.8125005 c 0,1.3043 1.039375,2.375 2.34375,2.375 l 2.25,0 c 1.9518039,-2.2246 7.4710958,-8.5584 13.5624998,-15.5312005 l -15.8124998,0 z m 21.1249998,0 c -1.855467,2.1245 -2.114296,2.4005 -3.59375,4.0936995 1.767282,0.1815 3.15625,1.685301 3.15625,3.500001 0,1.9349 -1.56511,3.5 -3.5,3.5 -1.658043,0 -3.043426,-1.1411 -3.40625,-2.6875 -1.089617,1.2461 -2.647139,2.9988 -3.46875,3.9375 0.191501,-0.062 0.388502,-0.094 0.59375,-0.094 1.373338,0 2.50006,1.4614 2.5625,3.2812 l 8.3125,0 c 1.304375,0 2.34375,-1.0707 2.34375,-2.375 l 0,-10.8125005 c 0,-1.3046 -1.039375,-2.3437 -2.34375,-2.3437 l -0.65625,0 z M 9.5518351,10.423906 c 1.9348899,0 3.4999999,1.596401 3.4999999,3.531301 0,1.9349 -1.56511,3.5 -3.4999999,3.5 -1.9348899,0 -3.4999999,-1.5651 -3.4999999,-3.5 0,-1.9349 1.56511,-3.531301 3.4999999,-3.531301 z m 4.2187499,10.312601 c -0.206517,0.2356 -0.844218,0.9428 -1.03125,1.1562 l 0.8125,0 c 0.01392,-0.4081 0.107026,-0.7968 0.21875,-1.1562 z";function nj(e,t,n){e=Nn(e);let i=new J5(t,n);i._exitVRPath=o3t,i._enterVRPath=i3t;let o=document.createElement("button");o.type="button",o.className="cesium-button cesium-vrButton",o.setAttribute("data-bind",'css: { "cesium-button-disabled" : _isOrthographic }, attr: { title: tooltip },click: command,enable: isVREnabled,cesiumSvgPath: { path: isVRMode ? _exitVRPath : _enterVRPath, width: 32, height: 32 }'),e.appendChild(o),Ee.applyBindings(i,o),this._container=e,this._viewModel=i,this._element=o}Object.defineProperties(nj.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}}});nj.prototype.isDestroyed=function(){return!1};nj.prototype.destroy=function(){return this._viewModel.destroy(),Ee.cleanNode(this._element),this._container.removeChild(this._element),ue(this)};var j5=nj;var vYe=new me;function PYe(e){let t=e.clock;t.currentTime=e.timeJulian,t.shouldAnimate=!1}function r3t(e){let t=e.getPropertyIds(),n="";return t.forEach(function(i){let o=e.getProperty(i);l(o)&&(n+=`<tr><th>${i}</th><td>${o}</td></tr>`)}),n.length>0&&(n=`<table class="cesium-infoBox-defaultTable"><tbody>${n}</tbody></table>`),n}function s3t(e){let t,n=[],i=e.getPropertyIds();for(t=0;t<i.length;t++){let r=i[t];/^name$/i.test(r)?n[0]=e.getProperty(r):/name/i.test(r)?n[1]=e.getProperty(r):/^title$/i.test(r)?n[2]=e.getProperty(r):/^(id|identifier)$/i.test(r)?n[3]=e.getProperty(r):/element/i.test(r)?n[4]=e.getProperty(r):/(id|identifier)$/i.test(r)&&(n[5]=e.getProperty(r))}let o=n.length;for(t=0;t<o;t++){let r=n[t];if(l(r)&&r!=="")return r}return"Unnamed Feature"}function FYe(e,t){let n=e.scene.pick(t.position);if(l(n)){let i=n.id??n.primitive.id;if(i instanceof er)return i;if(n instanceof ea||n instanceof IS)return new er({name:s3t(n),description:r3t(n),feature:n})}return d3t(e,t.position)}var a3t=new Q;function ble(e,t){if(l(t)){let n=t.clock;if(l(n)&&l(e)){let i=n.startTime,o=n.stopTime;Q.equals(i,o)&&(o=Q.addSeconds(i,W.EPSILON2,a3t)),e.updateFromClock(),e.zoomTo(i,o)}}}var c3t=new h;function l3t(e){let t=e.length;for(let n=0;n<t;++n){let i=e.get(n);if(i instanceof zr)return i}}function d3t(e,t){let n=e.scene,i=n.camera.getPickRay(t);if(!l(i))return;let o=n.imageryLayers;if(!l(o)){let a=l3t(n.primitives);if(!l(a))return;o=a.imageryLayers}let r=o.pickImageryLayerFeatures(i,n);if(!l(r))return;let s=new er({id:"Loading...",description:"Loading feature information..."});return r.then(function(a){if(e.selectedEntity!==s)return;if(!l(a)||a.length===0){e.selectedEntity=IYe();return}let c=a[0],d=new er({id:c.name,description:c.description});if(l(c.position)){let u=e.scene.ellipsoid.cartographicToCartesian(c.position,c3t);d.position=new Bl(u)}e.selectedEntity=d},function(){e.selectedEntity===s&&(e.selectedEntity=IYe())}),s}function IYe(){return new er({id:"None",description:"No features found."})}function u3t(e,t){let n=e._geocoder,i=e._homeButton,o=e._sceneModePicker,r=e._projectionPicker,s=e._baseLayerPicker,a=e._animation,c=e._timeline,d=e._fullscreenButton,u=e._infoBox,m=e._selectionIndicator,p=t?"hidden":"visible";if(l(n)&&(n.container.style.visibility=p),l(i)&&(i.container.style.visibility=p),l(o)&&(o.container.style.visibility=p),l(r)&&(r.container.style.visibility=p),l(s)&&(s.container.style.visibility=p),l(a)&&(a.container.style.visibility=p),l(c)&&(c.container.style.visibility=p),l(d)&&d.viewModel.isFullscreenEnabled&&(d.container.style.visibility=p),l(u)&&(u.container.style.visibility=p),l(m)&&(m.container.style.visibility=p),e._container){let b=t||!l(d)?0:d.container.clientWidth;e._vrButton.container.style.right=`${b}px`,e.forceResize()}}function uo(e,t){e=Nn(e),t=t??B.EMPTY_OBJECT;let n=(!l(t.globe)||t.globe!==!1)&&(!l(t.baseLayerPicker)||t.baseLayerPicker!==!1),i=this,o=document.createElement("div");o.className="cesium-viewer",e.appendChild(o);let r=document.createElement("div");r.className="cesium-viewer-cesiumWidgetContainer",o.appendChild(r);let s=document.createElement("div");s.className="cesium-viewer-bottom",o.appendChild(s);let a=t.scene3DOnly??!1,c,d,u=!1;l(t.clockViewModel)?(d=t.clockViewModel,c=d.clock):(c=new Wf,d=new d5(c),u=!0);let m=new pU(r,{baseLayer:n&&l(t.selectedImageryProviderViewModel)||l(t.baseLayer)||l(t.imageryProvider)?!1:void 0,clock:c,shouldAnimate:t.shouldAnimate,skyBox:t.skyBox,skyAtmosphere:t.skyAtmosphere,sceneMode:t.sceneMode,ellipsoid:t.ellipsoid,mapProjection:t.mapProjection,globe:t.globe,orderIndependentTranslucency:t.orderIndependentTranslucency,automaticallyTrackDataSourceClocks:t.automaticallyTrackDataSourceClocks,contextOptions:t.contextOptions,useDefaultRenderLoop:t.useDefaultRenderLoop,targetFrameRate:t.targetFrameRate,showRenderLoopErrors:t.showRenderLoopErrors,useBrowserRecommendedResolution:t.useBrowserRecommendedResolution,creditContainer:l(t.creditContainer)?t.creditContainer:s,creditViewport:t.creditViewport,dataSources:t.dataSources,scene3DOnly:a,shadows:t.shadows,terrainShadows:t.terrainShadows,mapMode2D:t.mapMode2D,blurActiveElementOnCanvasFocus:t.blurActiveElementOnCanvasFocus,requestRenderMode:t.requestRenderMode,maximumRenderTimeChange:t.maximumRenderTimeChange,depthPlaneEllipsoidOffset:t.depthPlaneEllipsoidOffset,msaaSamples:t.msaaSamples}),p=m.scene,b=new Hr;b.add(c.onTick,uo.prototype._onTick,this);let f;if(!l(t.selectionIndicator)||t.selectionIndicator!==!1){let z=document.createElement("div");z.className="cesium-viewer-selectionIndicatorContainer",o.appendChild(z),f=new D5(z,p)}let y;if(!l(t.infoBox)||t.infoBox!==!1){let z=document.createElement("div");z.className="cesium-viewer-infoBoxContainer",o.appendChild(z),y=new I5(z);let K=y.viewModel;b.add(K.cameraClicked,uo.prototype._onInfoBoxCameraClicked,this),b.add(K.closeClicked,uo.prototype._onInfoBoxClockClicked,this)}let _=document.createElement("div");_.className="cesium-viewer-toolbar",o.appendChild(_);let S;if(!l(t.geocoder)||t.geocoder!==!1){let z=document.createElement("div");z.className="cesium-viewer-geocoderContainer",_.appendChild(z);let K;typeof t.geocoder=="string"?K=[new FR({scene:p,geocodeProviderType:t.geocoder})]:l(t.geocoder)&&typeof t.geocoder!="boolean"&&(K=Array.isArray(t.geocoder)?t.geocoder:[t.geocoder]),S=new K5({container:z,geocoderServices:K,scene:p}),b.add(S.viewModel.search.beforeExecute,uo.prototype._clearObjects,this)}let Z;(!l(t.homeButton)||t.homeButton!==!1)&&(Z=new C5(_,p),l(S)&&b.add(Z.viewModel.command.afterExecute,function(){let z=S.viewModel;z.searchText="",z.isSearchInProgress&&z.search()}),b.add(Z.viewModel.command.beforeExecute,uo.prototype._clearTrackedObject,this));let R;!a&&(!l(t.sceneModePicker)||t.sceneModePicker!==!1)&&(R=new w5(_,p));let C;t.projectionPicker&&(C=new Y5(_,p));let E,A;if(n){let z=t.imageryProviderViewModels??g5(),K=t.terrainProviderViewModels??y5();E=new b5(_,{globe:p.globe,imageryProviderViewModels:z,selectedImageryProviderViewModel:t.selectedImageryProviderViewModel,terrainProviderViewModels:K,selectedTerrainProviderViewModel:t.selectedTerrainProviderViewModel}),A=_.getElementsByClassName("cesium-baseLayerPicker-dropDown")[0]}l(t.baseLayer)&&t.baseLayer!==!1&&(n&&(E.viewModel.selectedImagery=void 0),p.imageryLayers.removeAll(),p.imageryLayers.add(t.baseLayer)),l(t.terrainProvider)&&(n&&(E.viewModel.selectedTerrain=void 0),p.terrainProvider=t.terrainProvider),l(t.terrain)&&(n&&(p.globe.depthTestAgainstTerrain=!0),p.setTerrain(t.terrain));let L;if(!l(t.navigationHelpButton)||t.navigationHelpButton!==!1){let z=!0;try{if(l(window.localStorage)){let K=window.localStorage.getItem("cesium-hasSeenNavHelp");l(K)&&K?z=!1:window.localStorage.setItem("cesium-hasSeenNavHelp","true")}}catch{}L=new v5({container:_,instructionsInitiallyVisible:t.navigationInstructionsInitiallyVisible??z})}let F;if(!l(t.animation)||t.animation!==!1){let z=document.createElement("div");z.className="cesium-viewer-animationContainer",o.appendChild(z),F=new h5(z,new f5(d))}let I;if(!l(t.timeline)||t.timeline!==!1){let z=document.createElement("div");z.className="cesium-viewer-timelineContainer",o.appendChild(z),I=new z5(z,c),I.addEventListener("settime",PYe,!1),I.zoomTo(c.startTime,c.stopTime)}let N,g,V;(!l(t.fullscreenButton)||t.fullscreenButton!==!1)&&(V=document.createElement("div"),V.className="cesium-viewer-fullscreenContainer",o.appendChild(V),N=new Z5(V,t.fullscreenElement),g=Sc(N.viewModel,"isFullscreenEnabled",function(z){V.style.display=z?"block":"none",l(I)&&(I.container.style.right=`${V.clientWidth}px`,I.resize())}));let G,v,X;if(t.vrButton){let z=document.createElement("div");z.className="cesium-viewer-vrContainer",o.appendChild(z),G=new j5(z,p,t.fullScreenElement),v=Sc(G.viewModel,"isVREnabled",function(K){z.style.display=K?"block":"none",l(N)&&(z.style.right=`${V.clientWidth}px`),l(I)&&(I.container.style.right=`${z.clientWidth}px`,I.resize())}),X=Sc(G.viewModel,"isVRMode",function(K){u3t(i,K)})}this._baseLayerPickerDropDown=A,this._fullscreenSubscription=g,this._vrSubscription=v,this._vrModeSubscription=X,this._dataSourceChangedListeners={},this._container=e,this._bottomContainer=s,this._element=o,this._cesiumWidget=m,this._selectionIndicator=f,this._infoBox=y,this._clockViewModel=d,this._destroyClockViewModel=u,this._toolbar=_,this._homeButton=Z,this._sceneModePicker=R,this._projectionPicker=C,this._baseLayerPicker=E,this._navigationHelpButton=L,this._animation=F,this._timeline=I,this._fullscreenButton=N,this._vrButton=G,this._geocoder=S,this._eventHelper=b,this._lastWidth=0,this._lastHeight=0,this._enableInfoOrSelection=l(y)||l(f),this._selectedEntity=void 0,this._selectedEntityChanged=new Se;let Y=this._cesiumWidget.dataSources,D=this._cesiumWidget.dataSourceDisplay;b.add(Y.dataSourceAdded,uo.prototype._onDataSourceAdded,this),b.add(Y.dataSourceRemoved,uo.prototype._onDataSourceRemoved,this),b.add(p.postUpdate,uo.prototype.resize,this);let M=Y.length;for(let z=0;z<M;z++)this._dataSourceAdded(Y,Y.get(z));this._dataSourceAdded(void 0,D.defaultDataSource),b.add(Y.dataSourceAdded,uo.prototype._dataSourceAdded,this),b.add(Y.dataSourceRemoved,uo.prototype._dataSourceRemoved,this);function O(z){let K=FYe(i,z);l(K)?j.getValueOrUndefined(K.position,i.clock.currentTime)?i.trackedEntity=K:i.zoomTo(K):l(i.trackedEntity)&&(i.trackedEntity=void 0)}function w(z){i.selectedEntity=FYe(i,z)}m.screenSpaceEventHandler.setInputAction(w,mn.LEFT_CLICK),m.screenSpaceEventHandler.setInputAction(O,mn.LEFT_DOUBLE_CLICK),m._canAnimateUpdateCallback=this._updateCanAnimate(this)}Object.defineProperties(uo.prototype,{container:{get:function(){return this._container}},creditDisplay:{get:function(){return this._cesiumWidget.creditDisplay}},bottomContainer:{get:function(){return this._bottomContainer}},cesiumWidget:{get:function(){return this._cesiumWidget}},selectionIndicator:{get:function(){return this._selectionIndicator}},infoBox:{get:function(){return this._infoBox}},geocoder:{get:function(){return this._geocoder}},homeButton:{get:function(){return this._homeButton}},sceneModePicker:{get:function(){return this._sceneModePicker}},projectionPicker:{get:function(){return this._projectionPicker}},baseLayerPicker:{get:function(){return this._baseLayerPicker}},navigationHelpButton:{get:function(){return this._navigationHelpButton}},animation:{get:function(){return this._animation}},timeline:{get:function(){return this._timeline}},fullscreenButton:{get:function(){return this._fullscreenButton}},vrButton:{get:function(){return this._vrButton}},dataSourceDisplay:{get:function(){return this._cesiumWidget.dataSourceDisplay}},entities:{get:function(){return this._cesiumWidget.entities}},dataSources:{get:function(){return this._cesiumWidget.dataSources}},canvas:{get:function(){return this._cesiumWidget.canvas}},scene:{get:function(){return this._cesiumWidget.scene}},shadows:{get:function(){return this.scene.shadowMap.enabled},set:function(e){this.scene.shadowMap.enabled=e}},terrainShadows:{get:function(){return this.scene.globe.shadows},set:function(e){this.scene.globe.shadows=e}},shadowMap:{get:function(){return this.scene.shadowMap}},imageryLayers:{get:function(){return this.scene.imageryLayers}},terrainProvider:{get:function(){return this.scene.terrainProvider},set:function(e){this.scene.terrainProvider=e}},camera:{get:function(){return this.scene.camera}},ellipsoid:{get:function(){return this.scene.ellipsoid}},postProcessStages:{get:function(){return this.scene.postProcessStages}},clock:{get:function(){return this._clockViewModel.clock}},clockViewModel:{get:function(){return this._clockViewModel}},screenSpaceEventHandler:{get:function(){return this._cesiumWidget.screenSpaceEventHandler}},targetFrameRate:{get:function(){return this._cesiumWidget.targetFrameRate},set:function(e){this._cesiumWidget.targetFrameRate=e}},useDefaultRenderLoop:{get:function(){return this._cesiumWidget.useDefaultRenderLoop},set:function(e){this._cesiumWidget.useDefaultRenderLoop=e}},resolutionScale:{get:function(){return this._cesiumWidget.resolutionScale},set:function(e){this._cesiumWidget.resolutionScale=e}},useBrowserRecommendedResolution:{get:function(){return this._cesiumWidget.useBrowserRecommendedResolution},set:function(e){this._cesiumWidget.useBrowserRecommendedResolution=e}},allowDataSourcesToSuspendAnimation:{get:function(){return this._cesiumWidget.allowDataSourcesToSuspendAnimation},set:function(e){this._cesiumWidget.allowDataSourcesToSuspendAnimation=e}},trackedEntity:{get:function(){return this._cesiumWidget.trackedEntity},set:function(e){this._cesiumWidget.trackedEntity=e}},selectedEntity:{get:function(){return this._selectedEntity},set:function(e){if(this._selectedEntity!==e){this._selectedEntity=e;let t=l(this._selectionIndicator)?this._selectionIndicator.viewModel:void 0;l(e)?l(t)&&t.animateAppear():l(t)&&t.animateDepart(),this._selectedEntityChanged.raiseEvent(e)}}},selectedEntityChanged:{get:function(){return this._selectedEntityChanged}},trackedEntityChanged:{get:function(){return this._cesiumWidget.trackedEntityChanged}},clockTrackedDataSource:{get:function(){return this._cesiumWidget.clockTrackedDataSource},set:function(e){this._cesiumWidget.clockTrackedDataSource!==e&&(this._cesiumWidget.clockTrackedDataSource=e,ble(this._timeline,e))}}});uo.prototype.extend=function(e,t){e(this,t)};uo.prototype.resize=function(){let e=this._cesiumWidget,t=this._container,n=t.clientWidth,i=t.clientHeight,o=l(this._animation),r=l(this._timeline);if(e.resize(),n===this._lastWidth&&i===this._lastHeight)return;let s=i-125,a=this._baseLayerPickerDropDown;if(l(a)&&(a.style.maxHeight=`${s}px`),l(this._geocoder)){let f=this._geocoder.searchSuggestionsContainer;f.style.maxHeight=`${s}px`}l(this._infoBox)&&(this._infoBox.viewModel.maxHeight=s);let c=this._timeline,d,u=0,m=5,p=3,b=0;if(o&&window.getComputedStyle(this._animation.container).visibility!=="hidden"){let f=this._lastWidth;d=this._animation.container,n>900?(u=169,f<=900&&(d.style.width="169px",d.style.height="112px",this._animation.resize())):n>=600?(u=136,(f<600||f>900)&&(d.style.width="136px",d.style.height="90px",this._animation.resize())):(u=106,(f>600||f===0)&&(d.style.width="106px",d.style.height="70px",this._animation.resize())),m=u+5}if(r&&window.getComputedStyle(this._timeline.container).visibility!=="hidden"){let f=this._fullscreenButton,y=this._vrButton,_=c.container,S=_.style;p=_.clientHeight+3,S.left=`${u}px`;let Z=0;l(f)&&(Z+=f.container.clientWidth),l(y)&&(Z+=y.container.clientWidth),S.right=`${Z}px`,c.resize()}!r&&l(this._fullscreenButton)&&(b=this._fullscreenButton.container.clientWidth),this._bottomContainer.style.left=`${m}px`,this._bottomContainer.style.bottom=`${p}px`,this._bottomContainer.style.right=`${b}px`,this._lastWidth=n,this._lastHeight=i};uo.prototype.forceResize=function(){this._lastWidth=0,this.resize()};uo.prototype.render=function(){this._cesiumWidget.render()};uo.prototype.isDestroyed=function(){return!1};uo.prototype.destroy=function(){return l(this.screenSpaceEventHandler)&&!this.screenSpaceEventHandler.isDestroyed()&&(this.screenSpaceEventHandler.removeInputAction(mn.LEFT_CLICK),this.screenSpaceEventHandler.removeInputAction(mn.LEFT_DOUBLE_CLICK)),this._container.removeChild(this._element),this._element.removeChild(this._toolbar),this._eventHelper.removeAll(),l(this._geocoder)&&(this._geocoder=this._geocoder.destroy()),l(this._homeButton)&&(this._homeButton=this._homeButton.destroy()),l(this._sceneModePicker)&&(this._sceneModePicker=this._sceneModePicker.destroy()),l(this._projectionPicker)&&(this._projectionPicker=this._projectionPicker.destroy()),l(this._baseLayerPicker)&&(this._baseLayerPicker=this._baseLayerPicker.destroy()),l(this._animation)&&(this._element.removeChild(this._animation.container),this._animation=this._animation.destroy()),l(this._timeline)&&(this._timeline.removeEventListener("settime",PYe,!1),this._element.removeChild(this._timeline.container),this._timeline=this._timeline.destroy()),l(this._fullscreenButton)&&(this._fullscreenSubscription.dispose(),this._element.removeChild(this._fullscreenButton.container),this._fullscreenButton=this._fullscreenButton.destroy()),l(this._vrButton)&&(this._vrSubscription.dispose(),this._vrModeSubscription.dispose(),this._element.removeChild(this._vrButton.container),this._vrButton=this._vrButton.destroy()),l(this._infoBox)&&(this._element.removeChild(this._infoBox.container),this._infoBox=this._infoBox.destroy()),l(this._selectionIndicator)&&(this._element.removeChild(this._selectionIndicator.container),this._selectionIndicator=this._selectionIndicator.destroy()),this._destroyClockViewModel&&(this._clockViewModel=this._clockViewModel.destroy()),this._cesiumWidget=this._cesiumWidget.destroy(),ue(this)};uo.prototype._dataSourceAdded=function(e,t){t.entities.collectionChanged.addEventListener(uo.prototype._onEntityCollectionChanged,this)};uo.prototype._dataSourceRemoved=function(e,t){let n=t.entities;n.collectionChanged.removeEventListener(uo.prototype._onEntityCollectionChanged,this),l(this.selectedEntity)&&n.getById(this.selectedEntity.id)===this.selectedEntity&&(this.selectedEntity=void 0)};uo.prototype._updateCanAnimate=function(e){return function(t){e._clockViewModel.canAnimate=t}};uo.prototype._onTick=function(e){let t=e.currentTime,n,i=!1,o=this.selectedEntity,r=l(o)&&this._enableInfoOrSelection;r&&o.isShowing&&o.isAvailable(t)&&(this._cesiumWidget.dataSourceDisplay.getBoundingSphere(o,!0,vYe)!==Wt.FAILED?n=vYe.center:l(o.position)&&(n=o.position.getValue(t,n)),i=l(n));let s=l(this._selectionIndicator)?this._selectionIndicator.viewModel:void 0;l(s)&&(s.position=h.clone(n,s.position),s.showSelection=r&&i,s.update());let a=l(this._infoBox)?this._infoBox.viewModel:void 0;l(a)&&(a.showInfo=r,a.enableCamera=i,a.isCameraTracking=this.trackedEntity===this.selectedEntity,r?(a.titleText=o.name??o.id,a.description=j.getValueOrDefault(o.description,t,"")):(a.titleText="",a.description=""))};uo.prototype._onEntityCollectionChanged=function(e,t,n){let i=n.length;for(let o=0;o<i;o++){let r=n[o];this.selectedEntity===r&&(this.selectedEntity=void 0)}};uo.prototype._onInfoBoxCameraClicked=function(e){if(e.isCameraTracking&&this.trackedEntity===this.selectedEntity)this.trackedEntity=void 0;else{let n=this.selectedEntity.position;l(n)?this.trackedEntity=this.selectedEntity:this.zoomTo(this.selectedEntity)}};uo.prototype._clearTrackedObject=function(){this.trackedEntity=void 0};uo.prototype._onInfoBoxClockClicked=function(e){this.selectedEntity=void 0};uo.prototype._clearObjects=function(){this.trackedEntity=void 0,this.selectedEntity=void 0};uo.prototype._onDataSourceChanged=function(e){this.clockTrackedDataSource===e&&ble(this.timeline,e)};uo.prototype._onDataSourceAdded=function(e,t){this._cesiumWidget._automaticallyTrackDataSourceClocks&&t===this.clockTrackedDataSource&&ble(this._timeline,t);let n=t.entities.id,i=this._eventHelper.add(t.changedEvent,uo.prototype._onDataSourceChanged,this);this._dataSourceChangedListeners[n]=i};uo.prototype._onDataSourceRemoved=function(e,t){let n=t.entities.id;this._dataSourceChangedListeners[n](),this._dataSourceChangedListeners[n]=void 0};uo.prototype.addController=function(e){return this._cesiumWidget.addController(e)};uo.prototype.removeController=function(e){return this._cesiumWidget.removeController(e)};uo.prototype.zoomTo=function(e,t){return this._cesiumWidget.zoomTo(e,t)};uo.prototype.flyTo=function(e,t){return this._cesiumWidget.flyTo(e,t)};var gle=uo;var upr=x(T(),1);function m3t(e){let t=document.createElement("div");t.className="cesium-viewer-cesium3DTilesInspectorContainer",e.container.appendChild(t);let n=new G5(t,e.scene);Object.defineProperties(e,{cesium3DTilesInspector:{get:function(){return n}}})}var yle=m3t;var fpr=x(T(),1);function h3t(e){let t=document.createElement("div");t.className="cesium-viewer-cesiumInspectorContainer",e.container.appendChild(t);let n=new _5(t,e.scene);Object.defineProperties(e,{cesiumInspector:{get:function(){return n}}})}var xle=h3t;var ypr=x(T(),1);function f3t(e,t){t=t??B.EMPTY_OBJECT;let n=!0,i=t.flyToOnDrop??!0,o=new Se,r=t.clearOnDrop??!0,s=t.dropTarget??e.container,a=t.clampToGround??!0,c=t.proxy;s=Nn(s),Object.defineProperties(e,{dropTarget:{get:function(){return s},set:function(u){XYe(s,d),s=u,Tle(s,d)}},dropEnabled:{get:function(){return n},set:function(u){u!==n&&(u?Tle(s,d):XYe(s,d),n=u)}},dropError:{get:function(){return o}},clearOnDrop:{get:function(){return r},set:function(u){r=u}},flyToOnDrop:{get:function(){return i},set:function(u){i=u}},proxy:{get:function(){return c},set:function(u){c=u}},clampToGround:{get:function(){return a},set:function(u){a=u}}});function d(u){OR(u),r&&(e.entities.removeAll(),e.dataSources.removeAll());let m=u.dataTransfer.files,p=m.length;for(let b=0;b<p;b++){let f=m[b],y=new FileReader;y.onload=p3t(e,f,c,a),y.onerror=b3t(e,f),y.readAsText(f)}}Tle(s,d),e.destroy=AU(e,e.destroy,function(){e.dropEnabled=!1}),e._handleDrop=d}function OR(e){e.stopPropagation(),e.preventDefault()}function XYe(e,t){let n=e;l(n)&&(n.removeEventListener("drop",t,!1),n.removeEventListener("dragenter",OR,!1),n.removeEventListener("dragover",OR,!1),n.removeEventListener("dragexit",OR,!1))}function Tle(e,t){e.addEventListener("drop",t,!1),e.addEventListener("dragenter",OR,!1),e.addEventListener("dragover",OR,!1),e.addEventListener("dragexit",OR,!1)}function p3t(e,t,n,i){let o=e.scene;return function(r){let s=t.name;try{let a;if(/\.czml$/i.test(s))a=XY.load(JSON.parse(r.target.result),{sourceUri:s});else if(/\.geojson$/i.test(s)||/\.json$/i.test(s)||/\.topojson$/i.test(s))a=mT.load(JSON.parse(r.target.result),{sourceUri:s,clampToGround:i});else if(/\.(kml|kmz)$/i.test(s))a=DZ.load(t,{sourceUri:s,proxy:n,camera:o.camera,canvas:o.canvas,clampToGround:i,screenOverlayContainer:e.container});else if(/\.gpx$/i.test(s))a=Sw.load(t,{sourceUri:s,proxy:n});else{e.dropError.raiseEvent(e,s,`Unrecognized file: ${s}`);return}l(a)&&e.dataSources.add(a).then(function(c){e.flyToOnDrop&&e.flyTo(c)}).catch(function(c){e.dropError.raiseEvent(e,s,c)})}catch(a){e.dropError.raiseEvent(e,s,a)}}}function b3t(e,t){return function(n){e.dropError.raiseEvent(e,t.name,n.target.error)}}var _le=f3t;var Rpr=x(T(),1);function g3t(e,t){t=t??B.EMPTY_OBJECT;let n=new X5({scene:e.scene,container:e.bottomContainer,lowFrameRateMessage:t.lowFrameRateMessage});Object.defineProperties(e,{performanceWatchdog:{get:function(){return n}}})}var Sle=g3t;var Mpr=x(T(),1);var Xpr=x(T(),1);var Gpr=x(T(),1);function NYe(e){let t=e.split(` + </div>`,n.appendChild(i);let o=new v5(t);Ee.track(o),Ee.applyBindings(o,n),l(o.defaultLayer)&&(o.currentLayer=o.defaultLayer)}var cle=NBt;var ihr=x(T(),1);var jmr=x(T(),1);var YBt="M 13.84375 7.03125 C 11.412798 7.03125 9.46875 8.975298 9.46875 11.40625 L 9.46875 11.59375 L 2.53125 7.21875 L 2.53125 24.0625 L 9.46875 19.6875 C 9.4853444 22.104033 11.423165 24.0625 13.84375 24.0625 L 25.875 24.0625 C 28.305952 24.0625 30.28125 22.087202 30.28125 19.65625 L 30.28125 11.40625 C 30.28125 8.975298 28.305952 7.03125 25.875 7.03125 L 13.84375 7.03125 z",MBt="M 27.34375 1.65625 L 5.28125 27.9375 L 8.09375 30.3125 L 30.15625 4.03125 L 27.34375 1.65625 z M 13.84375 7.03125 C 11.412798 7.03125 9.46875 8.975298 9.46875 11.40625 L 9.46875 11.59375 L 2.53125 7.21875 L 2.53125 24.0625 L 9.46875 19.6875 C 9.4724893 20.232036 9.5676108 20.7379 9.75 21.21875 L 21.65625 7.03125 L 13.84375 7.03125 z M 28.21875 7.71875 L 14.53125 24.0625 L 25.875 24.0625 C 28.305952 24.0625 30.28125 22.087202 30.28125 19.65625 L 30.28125 11.40625 C 30.28125 9.8371439 29.456025 8.4902779 28.21875 7.71875 z";function lle(){this._cameraClicked=new Se,this._closeClicked=new Se,this.maxHeight=500,this.enableCamera=!1,this.isCameraTracking=!1,this.showInfo=!1,this.titleText="",this.description="",Ee.track(this,["showInfo","titleText","description","maxHeight","enableCamera","isCameraTracking"]),this._loadingIndicatorHtml='<div class="cesium-infoBox-loadingContainer"><span class="cesium-infoBox-loading"></span></div>',this.cameraIconPath=void 0,Ee.defineProperty(this,"cameraIconPath",{get:function(){return!this.enableCamera||this.isCameraTracking?MBt:YBt}}),Ee.defineProperty(this,"_bodyless",{get:function(){return!l(this.description)||this.description.length===0}})}lle.prototype.maxHeightOffset=function(e){return`${this.maxHeight-e}px`};Object.defineProperties(lle.prototype,{cameraClicked:{get:function(){return this._cameraClicked}},closeClicked:{get:function(){return this._closeClicked}}});var F5=lle;function zJ(e){e=Nn(e);let t=document.createElement("div");t.className="cesium-infoBox",t.setAttribute("data-bind",'css: { "cesium-infoBox-visible" : showInfo, "cesium-infoBox-bodyless" : _bodyless }'),e.appendChild(t);let n=document.createElement("div");n.className="cesium-infoBox-title",n.setAttribute("data-bind","text: titleText"),t.appendChild(n);let i=t.ownerDocument,o,r,s,a,c;function d(S){!l(o)||l(S)&&S.pointerId!==o||(o=void 0,t.classList.remove("cesium-infoBox-dragging"))}function u(S){if(!(S.button!==0||S.isPrimary===!1)){o=S.pointerId,r=S.clientX,s=S.clientY,a=t.offsetLeft,c=t.offsetTop,t.style.left=`${a}px`,t.style.top=`${c}px`,t.style.right="auto",t.classList.add("cesium-infoBox-dragging");try{n.setPointerCapture(S.pointerId)}catch{}S.preventDefault()}}function m(S){!l(o)||S.pointerId!==o||(t.style.left=`${a+S.clientX-r}px`,t.style.top=`${c+S.clientY-s}px`,S.preventDefault())}n.addEventListener("pointerdown",u),i.addEventListener("pointermove",m),i.addEventListener("pointerup",d),i.addEventListener("pointercancel",d);let p=document.createElement("button");p.type="button",p.className="cesium-button cesium-infoBox-camera",p.setAttribute("data-bind",'attr: { title: "Focus camera on object" },click: function () { cameraClicked.raiseEvent(this); },enable: enableCamera,cesiumSvgPath: { path: cameraIconPath, width: 32, height: 32 }'),t.appendChild(p);let b=document.createElement("button");b.type="button",b.className="cesium-infoBox-close",b.setAttribute("data-bind","click: function () { closeClicked.raiseEvent(this); }"),b.innerHTML="×",t.appendChild(b);let f=document.createElement("iframe");f.className="cesium-infoBox-iframe",f.setAttribute("sandbox","allow-same-origin allow-popups allow-forms"),f.setAttribute("data-bind","style : { maxHeight : maxHeightOffset(40) }"),f.setAttribute("allowfullscreen",!0),t.appendChild(f);let y=new F5;Ee.applyBindings(y,t),this._container=e,this._element=t,this._frame=f,this._viewModel=y,this._descriptionSubscription=void 0,this._titleElement=n,this._ownerDocument=i,this._handlePointerDown=u,this._handlePointerMove=m,this._stopDragging=d;let _=this;f.addEventListener("load",function(){let S=f.contentDocument,Z=S.createElement("link");Z.href=en("Widgets/InfoBox/InfoBoxDescription.css"),Z.rel="stylesheet",Z.type="text/css";let R=S.createElement("div");R.className="cesium-infoBox-description",S.head.appendChild(Z),S.body.appendChild(R),_._descriptionSubscription=Sc(y,"description",function(C){f.style.height="5px",R.innerHTML=C;let E=null,A=R.firstElementChild;if(A!==null&&R.childNodes.length===1){let F=window.getComputedStyle(A);if(F!==null){let I=F["background-color"],N=U.fromCssColorString(I);l(N)&&N.alpha!==0&&(E=F["background-color"])}}t.style["background-color"]=E;let L=R.getBoundingClientRect().height;f.style.height=`${L}px`})}),f.setAttribute("src","about:blank")}Object.defineProperties(zJ.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}},frame:{get:function(){return this._frame}}});zJ.prototype.isDestroyed=function(){return!1};zJ.prototype.destroy=function(){let e=this._container,t=this._ownerDocument;return this._titleElement.removeEventListener("pointerdown",this._handlePointerDown),t.removeEventListener("pointermove",this._handlePointerMove),t.removeEventListener("pointerup",this._stopDragging),t.removeEventListener("pointercancel",this._stopDragging),Ee.cleanNode(this._element),e.removeChild(this._element),l(this._descriptionSubscription)&&this._descriptionSubscription.dispose(),ue(this)};var I5=zJ;var fhr=x(T(),1);var ahr=x(T(),1);function CYe(){this.showInstructions=!1;let e=this;this._command=Fn(function(){e.showInstructions=!e.showInstructions}),this._showClick=Fn(function(){e._touch=!1}),this._showTouch=Fn(function(){e._touch=!0}),this._touch=!1,this.tooltip="Navigation Instructions",Ee.track(this,["tooltip","showInstructions","_touch"])}Object.defineProperties(CYe.prototype,{command:{get:function(){return this._command}},showClick:{get:function(){return this._showClick}},showTouch:{get:function(){return this._showTouch}}});var P5=CYe;function HJ(e){let t=Nn(e.container),n=new P5,i=e.instructionsInitiallyVisible??!1;n.showInstructions=i,n._svgPath="M16,1.466C7.973,1.466,1.466,7.973,1.466,16c0,8.027,6.507,14.534,14.534,14.534c8.027,0,14.534-6.507,14.534-14.534C30.534,7.973,24.027,1.466,16,1.466z M17.328,24.371h-2.707v-2.596h2.707V24.371zM17.328,19.003v0.858h-2.707v-1.057c0-3.19,3.63-3.696,3.63-5.963c0-1.034-0.924-1.826-2.134-1.826c-1.254,0-2.354,0.924-2.354,0.924l-1.541-1.915c0,0,1.519-1.584,4.137-1.584c2.487,0,4.796,1.54,4.796,4.136C21.156,16.208,17.328,16.627,17.328,19.003z";let o=document.createElement("span");o.className="cesium-navigationHelpButton-wrapper",t.appendChild(o);let r=document.createElement("button");r.type="button",r.className="cesium-button cesium-toolbar-button cesium-navigation-help-button",r.setAttribute("data-bind","attr: { title: tooltip },click: command,cesiumSvgPath: { path: _svgPath, width: 32, height: 32 }"),o.appendChild(r);let s=document.createElement("div");s.className="cesium-navigation-help",s.setAttribute("data-bind",'css: { "cesium-navigation-help-visible" : showInstructions}'),o.appendChild(s);let a=document.createElement("button");a.type="button",a.className="cesium-navigation-button cesium-navigation-button-left",a.setAttribute("data-bind",'click: showClick, css: {"cesium-navigation-button-selected": !_touch, "cesium-navigation-button-unselected": _touch}');let c=document.createElement("img");c.src=en("Widgets/Images/NavigationHelp/Mouse.svg"),c.className="cesium-navigation-button-icon",c.style.width="25px",c.style.height="25px",a.appendChild(c),a.appendChild(document.createTextNode("Mouse"));let d=document.createElement("button");d.type="button",d.className="cesium-navigation-button cesium-navigation-button-right",d.setAttribute("data-bind",'click: showTouch, css: {"cesium-navigation-button-selected": _touch, "cesium-navigation-button-unselected": !_touch}');let u=document.createElement("img");u.src=en("Widgets/Images/NavigationHelp/Touch.svg"),u.className="cesium-navigation-button-icon",u.style.width="25px",u.style.height="25px",d.appendChild(u),d.appendChild(document.createTextNode("Touch")),s.appendChild(a),s.appendChild(d);let m=document.createElement("div");m.className="cesium-click-navigation-help cesium-navigation-help-instructions",m.setAttribute("data-bind",'css: { "cesium-click-navigation-help-visible" : !_touch}'),m.innerHTML=` <table> <tr> <td><img src="${en("Widgets/Images/NavigationHelp/MouseLeft.svg")}" width="48" height="48" /></td> <td> <div class="cesium-navigation-help-pan">Pan view</div> <div class="cesium-navigation-help-details">Left click + drag</div> </td> </tr> <tr> <td><img src="${en("Widgets/Images/NavigationHelp/MouseRight.svg")}" width="48" height="48" /></td> <td> <div class="cesium-navigation-help-zoom">Zoom view</div> <div class="cesium-navigation-help-details">Right click + drag, or</div> <div class="cesium-navigation-help-details">Mouse wheel scroll</div> </td> </tr> <tr> <td><img src="${en("Widgets/Images/NavigationHelp/MouseMiddle.svg")}" width="48" height="48" /></td> <td> <div class="cesium-navigation-help-rotate">Rotate view</div> <div class="cesium-navigation-help-details">Middle click + drag, or</div> <div class="cesium-navigation-help-details">CTRL + Left/Right click + drag</div> </td> </tr> </table>`,s.appendChild(m);let p=document.createElement("div");p.className="cesium-touch-navigation-help cesium-navigation-help-instructions",p.setAttribute("data-bind",'css: { "cesium-touch-navigation-help-visible" : _touch}'),p.innerHTML=` <table> <tr> <td><img src="${en("Widgets/Images/NavigationHelp/TouchDrag.svg")}" width="70" height="48" /></td> <td> <div class="cesium-navigation-help-pan">Pan view</div> <div class="cesium-navigation-help-details">One finger drag</div> </td> </tr> <tr> <td><img src="${en("Widgets/Images/NavigationHelp/TouchZoom.svg")}" width="70" height="48" /></td> <td> <div class="cesium-navigation-help-zoom">Zoom view</div> <div class="cesium-navigation-help-details">Two finger pinch</div> </td> </tr> <tr> <td><img src="${en("Widgets/Images/NavigationHelp/TouchTilt.svg")}" width="70" height="48" /></td> <td> <div class="cesium-navigation-help-rotate">Tilt view</div> <div class="cesium-navigation-help-details">Two finger drag, same direction</div> </td> </tr> <tr> <td><img src="${en("Widgets/Images/NavigationHelp/TouchRotate.svg")}" width="70" height="48" /></td> <td> <div class="cesium-navigation-help-tilt">Rotate view</div> <div class="cesium-navigation-help-details">Two finger drag, opposite direction</div> </td> </tr> </table>`,s.appendChild(p),Ee.applyBindings(n,o),this._container=t,this._viewModel=n,this._wrapper=o,this._closeInstructions=function(b){o.contains(b.target)||(n.showInstructions=!1)},fn.supportsPointerEvents()?document.addEventListener("pointerdown",this._closeInstructions,!0):(document.addEventListener("mousedown",this._closeInstructions,!0),document.addEventListener("touchstart",this._closeInstructions,!0))}Object.defineProperties(HJ.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}}});HJ.prototype.isDestroyed=function(){return!1};HJ.prototype.destroy=function(){return fn.supportsPointerEvents()?document.removeEventListener("pointerdown",this._closeInstructions,!0):(document.removeEventListener("mousedown",this._closeInstructions,!0),document.removeEventListener("touchstart",this._closeInstructions,!0)),Ee.cleanNode(this._wrapper),this._container.removeChild(this._wrapper),ue(this)};var X5=HJ;var Ahr=x(T(),1);var _hr=x(T(),1);function dle(e){this._scene=e.scene,this.lowFrameRateMessage=e.lowFrameRateMessage??"This application appears to be performing poorly on your system. Please try using a different web browser or updating your video drivers.",this.lowFrameRateMessageDismissed=!1,this.showingLowFrameRateMessage=!1,Ee.track(this,["lowFrameRateMessage","lowFrameRateMessageDismissed","showingLowFrameRateMessage"]);let t=this;this._dismissMessage=Fn(function(){t.showingLowFrameRateMessage=!1,t.lowFrameRateMessageDismissed=!0});let n=UU.fromScene(e.scene);this._unsubscribeLowFrameRate=n.lowFrameRate.addEventListener(function(){t.lowFrameRateMessageDismissed||(t.showingLowFrameRateMessage=!0)}),this._unsubscribeNominalFrameRate=n.nominalFrameRate.addEventListener(function(){t.showingLowFrameRateMessage=!1})}Object.defineProperties(dle.prototype,{scene:{get:function(){return this._scene}},dismissMessage:{get:function(){return this._dismissMessage}}});dle.prototype.destroy=function(){return this._unsubscribeLowFrameRate(),this._unsubscribeNominalFrameRate(),ue(this)};var N5=dle;function KJ(e){let t=Nn(e.container),n=new N5(e),i=document.createElement("div");i.className="cesium-performance-watchdog-message-area",i.setAttribute("data-bind","visible: showingLowFrameRateMessage");let o=document.createElement("button");o.setAttribute("type","button"),o.className="cesium-performance-watchdog-message-dismiss",o.innerHTML="×",o.setAttribute("data-bind","click: dismissMessage"),i.appendChild(o);let r=document.createElement("div");r.className="cesium-performance-watchdog-message",r.setAttribute("data-bind","html: lowFrameRateMessage"),i.appendChild(r),t.appendChild(i),Ee.applyBindings(n,i),this._container=t,this._viewModel=n,this._element=i}Object.defineProperties(KJ.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}}});KJ.prototype.isDestroyed=function(){return!1};KJ.prototype.destroy=function(){return this._viewModel.destroy(),Ee.cleanNode(this._element),this._container.removeChild(this._element),ue(this)};var Y5=KJ;var khr=x(T(),1);var Ihr=x(T(),1);function JJ(e){this._scene=e,this._orthographic=e.camera.frustum instanceof yn,this._flightInProgress=!1,this.dropDownVisible=!1,this.tooltipPerspective="Perspective Projection",this.tooltipOrthographic="Orthographic Projection",this.selectedTooltip=void 0,this.sceneMode=e.mode,Ee.track(this,["_orthographic","_flightInProgress","sceneMode","dropDownVisible","tooltipPerspective","tooltipOrthographic"]);let t=this;Ee.defineProperty(this,"selectedTooltip",function(){return t._orthographic?t.tooltipOrthographic:t.tooltipPerspective}),this._toggleDropDown=Fn(function(){t.sceneMode===se.SCENE2D||t._flightInProgress||(t.dropDownVisible=!t.dropDownVisible)}),this._eventHelper=new kr,this._eventHelper.add(e.morphComplete,function(n,i,o,r){t.sceneMode=o,t._orthographic=o===se.SCENE2D||t._scene.camera.frustum instanceof yn}),this._eventHelper.add(e.preRender,function(){t._flightInProgress=l(e.camera._currentFlight)}),this._switchToPerspective=Fn(function(){t.sceneMode!==se.SCENE2D&&(t._scene.camera.switchToPerspectiveFrustum(),t._orthographic=!1,t.dropDownVisible=!1)}),this._switchToOrthographic=Fn(function(){t.sceneMode!==se.SCENE2D&&(t._scene.camera.switchToOrthographicFrustum(),t._orthographic=!0,t.dropDownVisible=!1)}),this._sceneMode=se}Object.defineProperties(JJ.prototype,{scene:{get:function(){return this._scene}},toggleDropDown:{get:function(){return this._toggleDropDown}},switchToPerspective:{get:function(){return this._switchToPerspective}},switchToOrthographic:{get:function(){return this._switchToOrthographic}},isOrthographicProjection:{get:function(){return this._orthographic}}});JJ.prototype.isDestroyed=function(){return!1};JJ.prototype.destroy=function(){this._eventHelper.removeAll(),ue(this)};var M5=JJ;var wBt="M 28.15625,10.4375 9.125,13.21875 13.75,43.25 41.75,55.09375 50.8125,37 54.5,11.9375 z m 0.125,3 19.976451,0.394265 L 43.03125,16.875 22.6875,14.28125 z M 50.971746,15.705477 47.90625,36.03125 42.53125,46 44.84375,19.3125 z M 12.625,16.03125 l 29.15625,3.6875 -2.65625,31 L 16.4375,41.125 z",kBt="m 31.560594,6.5254438 -20.75,12.4687502 0.1875,24.5625 22.28125,11.8125 19.5,-12 0.65625,-0.375 0,-0.75 0.0312,-23.21875 z m 0.0625,3.125 16.65625,9.5000002 -16.125,10.28125 -17.34375,-9.71875 z m 18.96875,11.1875002 0.15625,20.65625 -17.46875,10.59375 0.15625,-20.28125 z m -37.0625,1.25 17.21875,9.625 -0.15625,19.21875 -16.9375,-9 z";function jJ(e,t){e=Nn(e);let n=new M5(t);n._perspectivePath=wBt,n._orthographicPath=kBt;let i=document.createElement("span");i.className="cesium-projectionPicker-wrapper cesium-toolbar-button",e.appendChild(i);let o=document.createElement("button");o.type="button",o.className="cesium-button cesium-toolbar-button",o.setAttribute("data-bind",'css: { "cesium-projectionPicker-buttonPerspective": !_orthographic, "cesium-projectionPicker-buttonOrthographic": _orthographic, "cesium-button-disabled" : sceneMode === _sceneMode.SCENE2D || _flightInProgress, "cesium-projectionPicker-selected": dropDownVisible },attr: { title: selectedTooltip },click: toggleDropDown'),o.innerHTML='<!-- ko cesiumSvgPath: { path: _perspectivePath, width: 64, height: 64, css: "cesium-projectionPicker-iconPerspective" } --><!-- /ko --><!-- ko cesiumSvgPath: { path: _orthographicPath, width: 64, height: 64, css: "cesium-projectionPicker-iconOrthographic" } --><!-- /ko -->',i.appendChild(o);let r=document.createElement("button");r.type="button",r.className="cesium-button cesium-toolbar-button cesium-projectionPicker-dropDown-icon",r.setAttribute("data-bind",'css: { "cesium-projectionPicker-visible" : (dropDownVisible && _orthographic), "cesium-projectionPicker-none" : !_orthographic, "cesium-projectionPicker-hidden" : !dropDownVisible },attr: { title: tooltipPerspective },click: switchToPerspective,cesiumSvgPath: { path: _perspectivePath, width: 64, height: 64 }'),i.appendChild(r);let s=document.createElement("button");s.type="button",s.className="cesium-button cesium-toolbar-button cesium-projectionPicker-dropDown-icon",s.setAttribute("data-bind",'css: { "cesium-projectionPicker-visible" : (dropDownVisible && !_orthographic), "cesium-projectionPicker-none" : _orthographic, "cesium-projectionPicker-hidden" : !dropDownVisible},attr: { title: tooltipOrthographic },click: switchToOrthographic,cesiumSvgPath: { path: _orthographicPath, width: 64, height: 64 }'),i.appendChild(s),Ee.applyBindings(n,i),this._viewModel=n,this._container=e,this._wrapper=i,this._closeDropDown=function(a){i.contains(a.target)||(n.dropDownVisible=!1)},fn.supportsPointerEvents()?document.addEventListener("pointerdown",this._closeDropDown,!0):(document.addEventListener("mousedown",this._closeDropDown,!0),document.addEventListener("touchstart",this._closeDropDown,!0))}Object.defineProperties(jJ.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}}});jJ.prototype.isDestroyed=function(){return!1};jJ.prototype.destroy=function(){return this._viewModel.destroy(),fn.supportsPointerEvents()?document.removeEventListener("pointerdown",this._closeDropDown,!0):(document.removeEventListener("mousedown",this._closeDropDown,!0),document.removeEventListener("touchstart",this._closeDropDown,!0)),Ee.cleanNode(this._wrapper),this._container.removeChild(this._wrapper),ue(this)};var w5=jJ;var tfr=x(T(),1);var Khr=x(T(),1);function QJ(e,t){this._scene=e;let n=this,i=function(o,r,s,a){n.sceneMode=s,n.dropDownVisible=!1};this._eventHelper=new kr,this._eventHelper.add(e.morphStart,i),this._duration=t??2,this.sceneMode=e.mode,this.dropDownVisible=!1,this.tooltip2D="2D",this.tooltip3D="3D",this.tooltipColumbusView="Columbus View",Ee.track(this,["sceneMode","dropDownVisible","tooltip2D","tooltip3D","tooltipColumbusView"]),this.selectedTooltip=void 0,Ee.defineProperty(this,"selectedTooltip",function(){let o=n.sceneMode;return o===se.SCENE2D?n.tooltip2D:o===se.SCENE3D?n.tooltip3D:n.tooltipColumbusView}),this._toggleDropDown=Fn(function(){n.dropDownVisible=!n.dropDownVisible}),this._morphTo2D=Fn(function(){e.morphTo2D(n._duration)}),this._morphTo3D=Fn(function(){e.morphTo3D(n._duration)}),this._morphToColumbusView=Fn(function(){e.morphToColumbusView(n._duration)}),this._sceneMode=se}Object.defineProperties(QJ.prototype,{scene:{get:function(){return this._scene}},duration:{get:function(){return this._duration},set:function(e){this._duration=e}},toggleDropDown:{get:function(){return this._toggleDropDown}},morphTo2D:{get:function(){return this._morphTo2D}},morphTo3D:{get:function(){return this._morphTo3D}},morphToColumbusView:{get:function(){return this._morphToColumbusView}}});QJ.prototype.isDestroyed=function(){return!1};QJ.prototype.destroy=function(){this._eventHelper.removeAll(),ue(this)};var k5=QJ;var UBt="m 32.401392,4.9330437 c -7.087603,0 -14.096095,2.884602 -19.10793,7.8946843 -5.0118352,5.010083 -7.9296167,11.987468 -7.9296167,19.072999 0,7.085531 2.9177815,14.097848 7.9296167,19.107931 4.837653,4.835961 11.541408,7.631372 18.374354,7.82482 0.05712,0.01231 0.454119,0.139729 0.454119,0.139729 l 0.03493,-0.104797 c 0.08246,7.84e-4 0.162033,0.03493 0.244525,0.03493 0.08304,0 0.161515,-0.03414 0.244526,-0.03493 l 0.03493,0.104797 c 0,0 0.309474,-0.129487 0.349323,-0.139729 6.867765,-0.168094 13.582903,-2.965206 18.444218,-7.82482 2.558195,-2.5573 4.551081,-5.638134 5.903547,-8.977584 1.297191,-3.202966 2.02607,-6.661489 2.02607,-10.130347 0,-6.237309 -2.366261,-12.31219 -6.322734,-17.116794 -0.0034,-0.02316 0.0049,-0.04488 0,-0.06986 -0.01733,-0.08745 -0.104529,-0.278855 -0.104797,-0.279458 -5.31e-4,-0.0012 -0.522988,-0.628147 -0.523984,-0.62878 -3.47e-4,-2.2e-4 -0.133444,-0.03532 -0.244525,-0.06987 C 51.944299,13.447603 51.751076,13.104317 51.474391,12.827728 46.462556,7.8176457 39.488996,4.9330437 32.401392,4.9330437 z m -2.130866,3.5281554 0.104797,9.6762289 c -4.111695,-0.08361 -7.109829,-0.423664 -9.257041,-0.943171 1.198093,-2.269271 2.524531,-4.124404 3.91241,-5.414496 2.167498,-2.0147811 3.950145,-2.8540169 5.239834,-3.3185619 z m 2.794579,0 c 1.280302,0.4754953 3.022186,1.3285948 5.065173,3.2486979 1.424667,1.338973 2.788862,3.303645 3.982275,5.728886 -2.29082,0.403367 -5.381258,0.621049 -8.942651,0.698645 L 33.065105,8.4611991 z m 5.728886,0.2445256 c 4.004072,1.1230822 7.793098,3.1481363 10.724195,6.0782083 0.03468,0.03466 0.07033,0.06991 0.104797,0.104797 -0.45375,0.313891 -0.923054,0.663002 -1.956205,1.082899 -0.647388,0.263114 -1.906242,0.477396 -2.829511,0.733577 -1.382296,-2.988132 -3.027146,-5.368585 -4.785716,-7.0213781 -0.422866,-0.397432 -0.835818,-0.6453247 -1.25756,-0.9781032 z m -15.33525,0.7685092 c -0.106753,0.09503 -0.207753,0.145402 -0.31439,0.244526 -1.684973,1.5662541 -3.298068,3.8232211 -4.680919,6.5672591 -0.343797,-0.14942 -1.035052,-0.273198 -1.292493,-0.419186 -0.956528,-0.542427 -1.362964,-1.022024 -1.537018,-1.292493 -0.0241,-0.03745 -0.01868,-0.0401 -0.03493,-0.06986 2.250095,-2.163342 4.948824,-3.869984 7.859752,-5.0302421 z m -9.641296,7.0912431 c 0.464973,0.571618 0.937729,1.169056 1.956205,1.746612 0.349907,0.198425 1.107143,0.335404 1.537018,0.523983 -1.20166,3.172984 -1.998037,7.051901 -2.165798,11.772162 C 14.256557,30.361384 12.934823,30.161483 12.280427,29.90959 10.644437,29.279855 9.6888882,28.674891 9.1714586,28.267775 8.6540289,27.860658 8.6474751,27.778724 8.6474751,27.778724 l -0.069864,0.03493 C 9.3100294,23.691285 11.163248,19.798527 13.817445,16.565477 z m 37.552149,0.523984 c 2.548924,3.289983 4.265057,7.202594 4.890513,11.318043 -0.650428,0.410896 -1.756876,1.001936 -3.563088,1.606882 -1.171552,0.392383 -3.163859,0.759153 -4.960377,1.117832 -0.04367,-4.752703 -0.784809,-8.591423 -1.88634,-11.807094 0.917574,-0.263678 2.170552,-0.486495 2.864443,-0.76851 1.274693,-0.518066 2.003942,-1.001558 2.654849,-1.467153 z m -31.439008,2.619917 c 2.487341,0.672766 5.775813,1.137775 10.479669,1.222628 l 0.104797,10.689263 0,0.03493 0,0.733577 c -5.435005,-0.09059 -9.512219,-0.519044 -12.610536,-1.117831 0.106127,-4.776683 0.879334,-8.55791 2.02607,-11.562569 z m 23.264866,0.31439 c 1.073459,3.067541 1.833795,6.821314 1.816476,11.702298 -3.054474,0.423245 -7.062018,0.648559 -11.702298,0.698644 l 0,-0.838373 -0.104796,-10.654331 c 4.082416,-0.0864 7.404468,-0.403886 9.990618,-0.908238 z M 8.2632205,30.922625 c 0.7558676,0.510548 1.5529563,1.013339 3.0041715,1.57195 0.937518,0.360875 2.612202,0.647642 3.91241,0.978102 0.112814,3.85566 0.703989,7.107756 1.606883,9.920754 -1.147172,-0.324262 -2.644553,-0.640648 -3.423359,-0.978102 -1.516688,-0.657177 -2.386627,-1.287332 -2.864443,-1.71168 -0.477816,-0.424347 -0.489051,-0.489051 -0.489051,-0.489051 L 9.8002387,40.319395 C 8.791691,37.621767 8.1584238,34.769583 8.1584238,31.900727 c 0,-0.330153 0.090589,-0.648169 0.1047967,-0.978102 z m 48.2763445,0.419186 c 0.0047,0.188973 0.06986,0.36991 0.06986,0.558916 0,2.938869 -0.620228,5.873558 -1.676747,8.628261 -0.07435,0.07583 -0.06552,0.07411 -0.454119,0.349323 -0.606965,0.429857 -1.631665,1.042044 -3.318562,1.676747 -1.208528,0.454713 -3.204964,0.850894 -5.135038,1.25756 0.84593,-2.765726 1.41808,-6.005357 1.606883,-9.815957 2.232369,-0.413371 4.483758,-0.840201 5.938479,-1.327425 1.410632,-0.472457 2.153108,-0.89469 2.96924,-1.327425 z m -38.530252,2.864443 c 3.208141,0.56697 7.372279,0.898588 12.575603,0.978103 l 0.174662,9.885821 c -4.392517,-0.06139 -8.106722,-0.320566 -10.863925,-0.803441 -1.051954,-2.664695 -1.692909,-6.043794 -1.88634,-10.060483 z m 26.793022,0.31439 c -0.246298,3.923551 -0.877762,7.263679 -1.816476,9.885822 -2.561957,0.361954 -5.766249,0.560708 -9.431703,0.62878 l -0.174661,-9.815957 c 4.491734,-0.04969 8.334769,-0.293032 11.42284,-0.698645 z M 12.035901,44.860585 c 0.09977,0.04523 0.105535,0.09465 0.209594,0.139729 1.337656,0.579602 3.441099,1.058072 5.589157,1.537018 1.545042,3.399208 3.548524,5.969402 5.589157,7.789888 -3.034411,-1.215537 -5.871615,-3.007978 -8.174142,-5.309699 -1.245911,-1.245475 -2.271794,-2.662961 -3.213766,-4.156936 z m 40.69605,0 c -0.941972,1.493975 -1.967855,2.911461 -3.213765,4.156936 -2.74253,2.741571 -6.244106,4.696717 -9.955686,5.868615 0.261347,-0.241079 0.507495,-0.394491 0.768509,-0.663713 1.674841,-1.727516 3.320792,-4.181056 4.645987,-7.265904 2.962447,-0.503021 5.408965,-1.122293 7.161107,-1.781544 0.284034,-0.106865 0.337297,-0.207323 0.593848,-0.31439 z m -31.404076,2.305527 c 2.645807,0.376448 5.701178,0.649995 9.466635,0.698645 l 0.139729,7.789888 c -1.38739,-0.480844 -3.316218,-1.29837 -5.659022,-3.388427 -1.388822,-1.238993 -2.743668,-3.0113 -3.947342,-5.100106 z m 20.365491,0.104797 c -1.04872,2.041937 -2.174337,3.779068 -3.353494,4.995309 -1.853177,1.911459 -3.425515,2.82679 -4.611055,3.353494 l -0.139729,-7.789887 c 3.13091,-0.05714 5.728238,-0.278725 8.104278,-0.558916 z",DBt="m 2.9825053,17.550598 0,1.368113 0,26.267766 0,1.368113 1.36811,0 54.9981397,0 1.36811,0 0,-1.368113 0,-26.267766 0,-1.368113 -1.36811,0 -54.9981397,0 -1.36811,0 z m 2.73623,2.736226 10.3292497,0 0,10.466063 -10.3292497,0 0,-10.466063 z m 13.0654697,0 11.69737,0 0,10.466063 -11.69737,0 0,-10.466063 z m 14.43359,0 11.69737,0 0,10.466063 -11.69737,0 0,-10.466063 z m 14.43359,0 10.32926,0 0,10.466063 -10.32926,0 0,-10.466063 z m -41.9326497,13.202288 10.3292497,0 0,10.329252 -10.3292497,0 0,-10.329252 z m 13.0654697,0 11.69737,0 0,10.329252 -11.69737,0 0,-10.329252 z m 14.43359,0 11.69737,0 0,10.329252 -11.69737,0 0,-10.329252 z m 14.43359,0 10.32926,0 0,10.329252 -10.32926,0 0,-10.329252 z",OBt="m 14.723969,17.675598 -0.340489,0.817175 -11.1680536,26.183638 -0.817175,1.872692 2.076986,0 54.7506996,0 2.07698,0 -0.81717,-1.872692 -11.16805,-26.183638 -0.34049,-0.817175 -0.91933,0 -32.414586,0 -0.919322,0 z m 1.838643,2.723916 6.196908,0 -2.928209,10.418977 -7.729111,0 4.460412,-10.418977 z m 9.02297,0 4.903049,0 0,10.418977 -7.831258,0 2.928209,-10.418977 z m 7.626964,0 5.584031,0 2.62176,10.418977 -8.205791,0 0,-10.418977 z m 8.410081,0 5.51593,0 4.46042,10.418977 -7.38863,0 -2.58772,-10.418977 z m -30.678091,13.142892 8.103649,0 -2.89416,10.282782 -9.6018026,0 4.3923136,-10.282782 z m 10.929711,0 8.614384,0 0,10.282782 -11.508544,0 2.89416,-10.282782 z m 11.338299,0 8.852721,0 2.58772,10.282782 -11.440441,0 0,-10.282782 z m 11.678781,0 7.86531,0 4.39231,10.282782 -9.6699,0 -2.58772,-10.282782 z";function qJ(e,t,n){e=Nn(e);let i=new k5(t,n);i._globePath=UBt,i._flatMapPath=DBt,i._columbusViewPath=OBt;let o=document.createElement("span");o.className="cesium-sceneModePicker-wrapper cesium-toolbar-button",e.appendChild(o);let r=document.createElement("button");r.type="button",r.className="cesium-button cesium-toolbar-button",r.setAttribute("data-bind",'css: { "cesium-sceneModePicker-button2D": sceneMode === _sceneMode.SCENE2D, "cesium-sceneModePicker-button3D": sceneMode === _sceneMode.SCENE3D, "cesium-sceneModePicker-buttonColumbusView": sceneMode === _sceneMode.COLUMBUS_VIEW, "cesium-sceneModePicker-selected": dropDownVisible },attr: { title: selectedTooltip },click: toggleDropDown'),r.innerHTML='<!-- ko cesiumSvgPath: { path: _globePath, width: 64, height: 64, css: "cesium-sceneModePicker-slide-svg cesium-sceneModePicker-icon3D" } --><!-- /ko --><!-- ko cesiumSvgPath: { path: _flatMapPath, width: 64, height: 64, css: "cesium-sceneModePicker-slide-svg cesium-sceneModePicker-icon2D" } --><!-- /ko --><!-- ko cesiumSvgPath: { path: _columbusViewPath, width: 64, height: 64, css: "cesium-sceneModePicker-slide-svg cesium-sceneModePicker-iconColumbusView" } --><!-- /ko -->',o.appendChild(r);let s=document.createElement("button");s.type="button",s.className="cesium-button cesium-toolbar-button cesium-sceneModePicker-dropDown-icon",s.setAttribute("data-bind",'css: { "cesium-sceneModePicker-visible" : (dropDownVisible && (sceneMode !== _sceneMode.SCENE3D)) || (!dropDownVisible && (sceneMode === _sceneMode.SCENE3D)), "cesium-sceneModePicker-none" : sceneMode === _sceneMode.SCENE3D, "cesium-sceneModePicker-hidden" : !dropDownVisible },attr: { title: tooltip3D },click: morphTo3D,cesiumSvgPath: { path: _globePath, width: 64, height: 64 }'),o.appendChild(s);let a=document.createElement("button");a.type="button",a.className="cesium-button cesium-toolbar-button cesium-sceneModePicker-dropDown-icon",a.setAttribute("data-bind",'css: { "cesium-sceneModePicker-visible" : (dropDownVisible && (sceneMode !== _sceneMode.SCENE2D)), "cesium-sceneModePicker-none" : sceneMode === _sceneMode.SCENE2D, "cesium-sceneModePicker-hidden" : !dropDownVisible },attr: { title: tooltip2D },click: morphTo2D,cesiumSvgPath: { path: _flatMapPath, width: 64, height: 64 }'),o.appendChild(a);let c=document.createElement("button");c.type="button",c.className="cesium-button cesium-toolbar-button cesium-sceneModePicker-dropDown-icon",c.setAttribute("data-bind",'css: { "cesium-sceneModePicker-visible" : (dropDownVisible && (sceneMode !== _sceneMode.COLUMBUS_VIEW)) || (!dropDownVisible && (sceneMode === _sceneMode.COLUMBUS_VIEW)), "cesium-sceneModePicker-none" : sceneMode === _sceneMode.COLUMBUS_VIEW, "cesium-sceneModePicker-hidden" : !dropDownVisible},attr: { title: tooltipColumbusView },click: morphToColumbusView,cesiumSvgPath: { path: _columbusViewPath, width: 64, height: 64 }'),o.appendChild(c),Ee.applyBindings(i,o),this._viewModel=i,this._container=e,this._wrapper=o,this._closeDropDown=function(d){o.contains(d.target)||(i.dropDownVisible=!1)},fn.supportsPointerEvents()?document.addEventListener("pointerdown",this._closeDropDown,!0):(document.addEventListener("mousedown",this._closeDropDown,!0),document.addEventListener("touchstart",this._closeDropDown,!0))}Object.defineProperties(qJ.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}}});qJ.prototype.isDestroyed=function(){return!1};qJ.prototype.destroy=function(){return this._viewModel.destroy(),fn.supportsPointerEvents()?document.removeEventListener("pointerdown",this._closeDropDown,!0):(document.removeEventListener("mousedown",this._closeDropDown,!0),document.removeEventListener("touchstart",this._closeDropDown,!0)),Ee.cleanNode(this._wrapper),this._container.removeChild(this._wrapper),ue(this)};var U5=qJ;var hfr=x(T(),1);var sfr=x(T(),1);var BBt=new k,$J="-1000px";function D5(e,t,n){this._scene=e,this._screenPositionX=$J,this._screenPositionY=$J,this._tweens=e.tweens,this._container=n??document.body,this._selectionIndicatorElement=t,this._scale=1,this.position=void 0,this.showSelection=!1,Ee.track(this,["position","_screenPositionX","_screenPositionY","_scale","showSelection"]),this.isVisible=void 0,Ee.defineProperty(this,"isVisible",{get:function(){return this.showSelection&&l(this.position)}}),Ee.defineProperty(this,"_transform",{get:function(){return`scale(${this._scale})`}}),this.computeScreenSpacePosition=function(i,o){return fo.worldToWindowCoordinates(e,i,o)}}D5.prototype.update=function(){if(this.showSelection&&l(this.position)){let e=this.computeScreenSpacePosition(this.position,BBt);if(!l(e))this._screenPositionX=$J,this._screenPositionY=$J;else{let t=this._container,n=t.parentNode.clientWidth,i=t.parentNode.clientHeight,o=this._selectionIndicatorElement.clientWidth,r=o*.5;e.x=Math.min(Math.max(e.x,-o),n+o)-r,e.y=Math.min(Math.max(e.y,-o),i+o)-r,this._screenPositionX=`${Math.floor(e.x+.25)}px`,this._screenPositionY=`${Math.floor(e.y+.25)}px`}}};D5.prototype.animateAppear=function(){this._tweens.addProperty({object:this,property:"_scale",startValue:2,stopValue:1,duration:.8,easingFunction:As.EXPONENTIAL_OUT})};D5.prototype.animateDepart=function(){this._tweens.addProperty({object:this,property:"_scale",startValue:this._scale,stopValue:1.5,duration:.8,easingFunction:As.EXPONENTIAL_OUT})};Object.defineProperties(D5.prototype,{container:{get:function(){return this._container}},selectionIndicatorElement:{get:function(){return this._selectionIndicatorElement}},scene:{get:function(){return this._scene}}});var O5=D5;function ej(e,t){e=Nn(e),this._container=e;let n=document.createElement("div");n.className="cesium-selection-wrapper",n.setAttribute("data-bind",'style: { "top" : _screenPositionY, "left" : _screenPositionX },css: { "cesium-selection-wrapper-visible" : isVisible }'),e.appendChild(n),this._element=n;let i="http://www.w3.org/2000/svg",o="M -34 -34 L -34 -11.25 L -30 -15.25 L -30 -30 L -15.25 -30 L -11.25 -34 L -34 -34 z M 11.25 -34 L 15.25 -30 L 30 -30 L 30 -15.25 L 34 -11.25 L 34 -34 L 11.25 -34 z M -34 11.25 L -34 34 L -11.25 34 L -15.25 30 L -30 30 L -30 15.25 L -34 11.25 z M 34 11.25 L 30 15.25 L 30 30 L 15.25 30 L 11.25 34 L 34 34 L 34 11.25 z",r=document.createElementNS(i,"svg:svg");r.setAttribute("width",160),r.setAttribute("height",160),r.setAttribute("viewBox","0 0 160 160");let s=document.createElementNS(i,"g");s.setAttribute("transform","translate(80,80)"),r.appendChild(s);let a=document.createElementNS(i,"path");a.setAttribute("data-bind","attr: { transform: _transform }"),a.setAttribute("d",o),s.appendChild(a),n.appendChild(r);let c=new O5(t,this._element,this._container);this._viewModel=c,Ee.applyBindings(this._viewModel,this._element)}Object.defineProperties(ej.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}}});ej.prototype.isDestroyed=function(){return!1};ej.prototype.destroy=function(){let e=this._container;return Ee.cleanNode(this._element),e.removeChild(this._element),ue(this)};var B5=ej;var lpr=x(T(),1);var Cfr=x(T(),1);var bfr=x(T(),1);function DR(e,t,n){this._color=e,this._height=t,this._base=n??0}DR.prototype.getHeight=function(){return this._height};DR.prototype.getBase=function(){return this._base};DR.prototype.getStartTime=function(){return this._start};DR.prototype.getStopTime=function(){return this._stop};DR.prototype.setRange=function(e,t){this._start=e,this._stop=t};DR.prototype.render=function(e){let t="";if(this._start&&this._stop&&this._color){let n=Q.secondsDifference(this._start,e.epochJulian),i=Math.round(e.timeBarWidth*e.getAlpha(n)),o=Q.secondsDifference(this._stop,e.epochJulian),r=Math.round(e.timeBarWidth*e.getAlpha(o))-i;i<0&&(r+=i,i=0),i+r>e.timeBarWidth&&(r=e.timeBarWidth-i),r>0&&(t=`<span class="cesium-timeline-highlight" style="left: ${i.toString()}px; width: ${r.toString()}px; bottom: ${this._base.toString()}px; height: ${this._height}px; background-color: ${this._color};"></span>`)}return t};var z5=DR;var xfr=x(T(),1);function VYe(e,t,n,i){this.interval=e,this.height=t,this.color=n||new U(.5,.5,.5,1),this.backgroundColor=i||new U(0,0,0,0)}VYe.prototype.render=function(e,t){let n=this.interval.start,i=this.interval.stop,o=t.startJulian,r=Q.addSeconds(t.startJulian,t.duration,new Q);if(Q.lessThan(n,o)&&Q.greaterThan(i,r))e.fillStyle=this.color.toCssColorString(),e.fillRect(0,t.y,t.timeBarWidth,this.height);else if(Q.lessThanOrEquals(n,r)&&Q.greaterThanOrEquals(i,o)){let s,a,c;for(s=0;s<t.timeBarWidth;++s){let d=Q.addSeconds(t.startJulian,s/t.timeBarWidth*t.duration,new Q);!l(a)&&Q.greaterThanOrEquals(d,n)?a=s:!l(c)&&Q.greaterThanOrEquals(d,i)&&(c=s)}e.fillStyle=this.backgroundColor.toCssColorString(),e.fillRect(0,t.y,t.timeBarWidth,this.height),l(a)&&(l(c)||(c=t.timeBarWidth),e.fillStyle=this.color.toCssColorString(),e.fillRect(a,t.y,Math.max(c-a,1),this.height))}};var H5=VYe;var ule=1e12,Ah={none:0,scrub:1,slide:2,zoom:3,touchOnly:4},xd={none:0,scrub:1,slideZoom:2,singleTap:3,ignore:4},OT=[.001,.002,.005,.01,.02,.05,.1,.25,.5,1,2,5,10,15,30,60,120,300,600,900,1800,3600,7200,14400,21600,43200,86400,172800,345600,604800,1296e3,2592e3,5184e3,7776e3,15552e3,31536e3,63072e3,126144e3,15768e4,31536e4,63072e4,126144e4,15768e5,31536e5,63072e5,126144e5,15768e6,31536e6],zBt=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function Td(e,t){e=Nn(e);let n=e.ownerDocument;this.container=e;let i=n.createElement("div");i.className="cesium-timeline-main",e.appendChild(i),this._topDiv=i,this._endJulian=void 0,this._epochJulian=void 0,this._lastXPos=void 0,this._scrubElement=void 0,this._startJulian=void 0,this._timeBarSecondsSpan=void 0,this._clock=t,this._scrubJulian=t.currentTime,this._mainTicSpan=-1,this._mouseMode=Ah.none,this._touchMode=xd.none,this._touchState={centerX:0,spanX:0},this._mouseX=0,this._timelineDrag=0,this._timelineDragLocation=void 0,this._lastHeight=void 0,this._lastWidth=void 0,this._topDiv.innerHTML='<div class="cesium-timeline-bar"></div><div class="cesium-timeline-trackContainer"><canvas class="cesium-timeline-tracks" width="10" height="1"></canvas></div><div class="cesium-timeline-needle"></div><span class="cesium-timeline-ruler"></span>',this._timeBarEle=this._topDiv.childNodes[0],this._trackContainer=this._topDiv.childNodes[1],this._trackListEle=this._topDiv.childNodes[1].childNodes[0],this._needleEle=this._topDiv.childNodes[2],this._rulerEle=this._topDiv.childNodes[3],this._context=this._trackListEle.getContext("2d"),this._trackList=[],this._highlightRanges=[],this.zoomTo(t.startTime,t.stopTime),this._onMouseDown=HBt(this),this._onMouseUp=KBt(this),this._onMouseMove=JBt(this),this._onMouseWheel=jBt(this),this._onTouchStart=QBt(this),this._onTouchMove=$Bt(this),this._onTouchEnd=qBt(this);let o=this._timeBarEle;n.addEventListener("mouseup",this._onMouseUp,!1),n.addEventListener("mousemove",this._onMouseMove,!1),o.addEventListener("mousedown",this._onMouseDown,!1),o.addEventListener("DOMMouseScroll",this._onMouseWheel,!1),o.addEventListener("mousewheel",this._onMouseWheel,!1),o.addEventListener("touchstart",this._onTouchStart,!1),o.addEventListener("touchmove",this._onTouchMove,!1),o.addEventListener("touchend",this._onTouchEnd,!1),o.addEventListener("touchcancel",this._onTouchEnd,!1),this._topDiv.oncontextmenu=function(){return!1},t.onTick.addEventListener(this.updateFromClock,this),this.updateFromClock()}Td.prototype.addEventListener=function(e,t,n){this._topDiv.addEventListener(e,t,n)};Td.prototype.removeEventListener=function(e,t,n){this._topDiv.removeEventListener(e,t,n)};Td.prototype.isDestroyed=function(){return!1};Td.prototype.destroy=function(){this._clock.onTick.removeEventListener(this.updateFromClock,this);let e=this.container.ownerDocument;e.removeEventListener("mouseup",this._onMouseUp,!1),e.removeEventListener("mousemove",this._onMouseMove,!1);let t=this._timeBarEle;t.removeEventListener("mousedown",this._onMouseDown,!1),t.removeEventListener("DOMMouseScroll",this._onMouseWheel,!1),t.removeEventListener("mousewheel",this._onMouseWheel,!1),t.removeEventListener("touchstart",this._onTouchStart,!1),t.removeEventListener("touchmove",this._onTouchMove,!1),t.removeEventListener("touchend",this._onTouchEnd,!1),t.removeEventListener("touchcancel",this._onTouchEnd,!1),this.container.removeChild(this._topDiv),ue(this)};Td.prototype.addHighlightRange=function(e,t,n){let i=new z5(e,t,n);return this._highlightRanges.push(i),this.resize(),i};Td.prototype.addTrack=function(e,t,n,i){let o=new H5(e,t,n,i);return this._trackList.push(o),this._lastHeight=void 0,this.resize(),o};Td.prototype.zoomTo=function(e,t){if(this._startJulian=e,this._endJulian=t,this._timeBarSecondsSpan=Q.secondsDifference(t,e),this._clock&&this._clock.clockRange!==bs.UNBOUNDED){let i=this._clock.startTime,o=this._clock.stopTime,r=Q.secondsDifference(o,i),s=Q.secondsDifference(i,this._startJulian),a=Q.secondsDifference(o,this._endJulian);this._timeBarSecondsSpan>=r?(this._timeBarSecondsSpan=r,this._startJulian=this._clock.startTime,this._endJulian=this._clock.stopTime):s>0?(this._endJulian=Q.addSeconds(this._endJulian,s,new Q),this._startJulian=i,this._timeBarSecondsSpan=Q.secondsDifference(this._endJulian,this._startJulian)):a<0&&(this._startJulian=Q.addSeconds(this._startJulian,a,new Q),this._endJulian=o,this._timeBarSecondsSpan=Q.secondsDifference(this._endJulian,this._startJulian))}this._makeTics();let n=document.createEvent("Event");n.initEvent("setzoom",!0,!0),n.startJulian=this._startJulian,n.endJulian=this._endJulian,n.epochJulian=this._epochJulian,n.totalSpan=this._timeBarSecondsSpan,n.mainTicSpan=this._mainTicSpan,this._topDiv.dispatchEvent(n)};Td.prototype.zoomFrom=function(e){let t=Q.secondsDifference(this._scrubJulian,this._startJulian);e>1||t<0||t>this._timeBarSecondsSpan?t=this._timeBarSecondsSpan*.5:t+=t-this._timeBarSecondsSpan*.5;let n=this._timeBarSecondsSpan-t;this.zoomTo(Q.addSeconds(this._startJulian,t-t*e,new Q),Q.addSeconds(this._endJulian,n*e-n,new Q))};function mle(e){return e<10?`0${e.toString()}`:e.toString()}Td.prototype.makeLabel=function(e){let t=Q.toGregorianDate(e),n=t.millisecond,i=" UTC";if(n>0&&this._timeBarSecondsSpan<3600){for(i=Math.floor(n).toString();i.length<3;)i=`0${i}`;i=`.${i}`}return`${zBt[t.month-1]} ${t.day} ${t.year} ${mle(t.hour)}:${mle(t.minute)}:${mle(t.second)}${i}`};Td.prototype.smallestTicInPixels=7;Td.prototype._makeTics=function(){let e=this._timeBarEle,t=Q.secondsDifference(this._scrubJulian,this._startJulian),n=Math.round(t*this._topDiv.clientWidth/this._timeBarSecondsSpan),i=n-8,o,r=this;this._needleEle.style.left=`${n.toString()}px`;let s="",a=.01,c=31536e6,d=1e-10,u=0,m=this._timeBarSecondsSpan;m<a?(m=a,this._timeBarSecondsSpan=a,this._endJulian=Q.addSeconds(this._startJulian,a,new Q)):m>c&&(m=c,this._timeBarSecondsSpan=c,this._endJulian=Q.addSeconds(this._startJulian,c,new Q));let p=this._timeBarEle.clientWidth;p<10&&(p=10);let b=this._startJulian,f=Math.min(m/p*1e-5,.4),y,_=Q.toGregorianDate(b);m>31536e4?y=Q.fromDate(new Date(Date.UTC(Math.floor(_.year/100)*100,0))):m>31536e3?y=Q.fromDate(new Date(Date.UTC(Math.floor(_.year/10)*10,0))):m>86400?y=Q.fromDate(new Date(Date.UTC(_.year,0))):y=Q.fromDate(new Date(Date.UTC(_.year,_.month,_.day)));let S=Q.secondsDifference(this._startJulian,Q.addSeconds(y,f,new Q)),Z=S+m;this._epochJulian=y;function R(w){return Math.floor(S/w)*w}function C(w,z){return Math.ceil(w/z+.5)*z}function E(w){return(w-S)/m}function A(w,z){return w-z*Math.round(w/z)}this._rulerEle.innerHTML=this.makeLabel(Q.addSeconds(this._endJulian,-a,new Q));let L=this._rulerEle.offsetWidth+20;L<30&&(L=180);let F=u;u-=d;let I={startTime:S,startJulian:b,epochJulian:y,duration:m,timeBarWidth:p,getAlpha:E};this._highlightRanges.forEach(function(w){s+=w.render(I)});let N=0,g=0,V=0,G=L/p;G>1&&(G=1),G*=this._timeBarSecondsSpan;let v=-1,X=-1,Y=OT.length,D;for(D=0;D<Y;++D){let w=OT[D];if(++v,N=w,w>G&&w>u)break;X<0&&p*(w/this._timeBarSecondsSpan)>=this.smallestTicInPixels&&(X=v)}if(v>0){for(;v>0;)if(--v,Math.abs(A(N,OT[v]))<1e-5){OT[v]>=u&&(g=OT[v]);break}if(X>=0)for(;X<v;){if(Math.abs(A(g,OT[X]))<1e-5&&OT[X]>=u){V=OT[X];break}++X}}u=F,u>d&&V<1e-5&&Math.abs(u-N)>d&&(V=u,u<=N+d&&(g=0));let M=-999999,O;if(p*(V/this._timeBarSecondsSpan)>=3)for(o=R(V);o<=Z;o=C(o,V))s+=`<span class="cesium-timeline-ticTiny" style="left: ${Math.round(p*E(o)).toString()}px;"></span>`;if(p*(g/this._timeBarSecondsSpan)>=3)for(o=R(g);o<=Z;o=C(o,g))s+=`<span class="cesium-timeline-ticSub" style="left: ${Math.round(p*E(o)).toString()}px;"></span>`;if(p*(N/this._timeBarSecondsSpan)>=2){this._mainTicSpan=N,Z+=N,o=R(N);let w=Q.computeTaiMinusUtc(y);for(;o<=Z;){let z=Q.addSeconds(b,o-S,new Q);if(N>2.1){let $=Q.computeTaiMinusUtc(z);Math.abs($-w)>.1&&(o+=$-w,z=Q.addSeconds(b,o-S,new Q))}let K=Math.round(p*E(o)),te=this.makeLabel(z);this._rulerEle.innerHTML=te,O=this._rulerEle.offsetWidth,O<10&&(O=L);let H=K-(O/2-1);H>M?(M=H+O+5,s+=`<span class="cesium-timeline-ticMain" style="left: ${K.toString()}px;"></span><span class="cesium-timeline-ticLabel" style="left: ${H.toString()}px;">${te}</span>`):s+=`<span class="cesium-timeline-ticSub" style="left: ${K.toString()}px;"></span>`,o=C(o,N)}}else this._mainTicSpan=-1;s+=`<span class="cesium-timeline-icon16" style="left:${i}px;bottom:0;background-position: 0 0;"></span>`,e.innerHTML=s,this._scrubElement=e.lastChild,this._context.clearRect(0,0,this._trackListEle.width,this._trackListEle.height),I.y=0,this._trackList.forEach(function(w){w.render(r._context,I),I.y+=w.height})};Td.prototype.updateFromClock=function(){this._scrubJulian=this._clock.currentTime;let e=this._scrubElement;if(l(this._scrubElement)){let t=Q.secondsDifference(this._scrubJulian,this._startJulian),n=Math.round(t*this._topDiv.clientWidth/this._timeBarSecondsSpan);this._lastXPos!==n&&(this._lastXPos=n,e.style.left=`${n-8}px`,this._needleEle.style.left=`${n}px`)}l(this._timelineDragLocation)&&(this._setTimeBarTime(this._timelineDragLocation,this._timelineDragLocation*this._timeBarSecondsSpan/this._topDiv.clientWidth),this.zoomTo(Q.addSeconds(this._startJulian,this._timelineDrag,new Q),Q.addSeconds(this._endJulian,this._timelineDrag,new Q)))};Td.prototype._setTimeBarTime=function(e,t){if(e=Math.round(e),this._scrubJulian=Q.addSeconds(this._startJulian,t,new Q),this._scrubElement){let i=e-8;this._scrubElement.style.left=`${i.toString()}px`,this._needleEle.style.left=`${e.toString()}px`}let n=document.createEvent("Event");n.initEvent("settime",!0,!0),n.clientX=e,n.timeSeconds=t,n.timeJulian=this._scrubJulian,n.clock=this._clock,this._topDiv.dispatchEvent(n)};function HBt(e){return function(t){e._mouseMode!==Ah.touchOnly&&(t.button===0?(e._mouseMode=Ah.scrub,e._scrubElement&&(e._scrubElement.style.backgroundPosition="-16px 0"),e._onMouseMove(t)):(e._mouseX=t.clientX,t.button===2?e._mouseMode=Ah.zoom:e._mouseMode=Ah.slide)),t.preventDefault()}}function KBt(e){return function(t){e._mouseMode=Ah.none,e._scrubElement&&(e._scrubElement.style.backgroundPosition="0 0"),e._timelineDrag=0,e._timelineDragLocation=void 0}}function JBt(e){return function(t){let n;if(e._mouseMode===Ah.scrub){t.preventDefault();let i=t.clientX-e._topDiv.getBoundingClientRect().left;i<0?(e._timelineDragLocation=0,e._timelineDrag=-.01*e._timeBarSecondsSpan):i>e._topDiv.clientWidth?(e._timelineDragLocation=e._topDiv.clientWidth,e._timelineDrag=.01*e._timeBarSecondsSpan):(e._timelineDragLocation=void 0,e._setTimeBarTime(i,i*e._timeBarSecondsSpan/e._topDiv.clientWidth))}else if(e._mouseMode===Ah.slide){if(n=e._mouseX-t.clientX,e._mouseX=t.clientX,n!==0){let i=n*e._timeBarSecondsSpan/e._topDiv.clientWidth;e.zoomTo(Q.addSeconds(e._startJulian,i,new Q),Q.addSeconds(e._endJulian,i,new Q))}}else e._mouseMode===Ah.zoom&&(n=e._mouseX-t.clientX,e._mouseX=t.clientX,n!==0&&e.zoomFrom(Math.pow(1.01,n)))}}function jBt(e){return function(t){let n=t.wheelDeltaY||t.wheelDelta||-t.detail;ule=Math.max(Math.min(Math.abs(n),ule),1),n/=ule,e.zoomFrom(Math.pow(1.05,-n))}}function QBt(e){return function(t){let n=t.touches.length,i,o,r=e._topDiv.getBoundingClientRect().left;t.preventDefault(),e._mouseMode=Ah.touchOnly,n===1?(i=Q.secondsDifference(e._scrubJulian,e._startJulian),o=Math.round(i*e._topDiv.clientWidth/e._timeBarSecondsSpan+r),Math.abs(t.touches[0].clientX-o)<50?(e._touchMode=xd.scrub,e._scrubElement&&(e._scrubElement.style.backgroundPosition=n===1?"-16px 0":"0 0")):(e._touchMode=xd.singleTap,e._touchState.centerX=t.touches[0].clientX-r)):n===2?(e._touchMode=xd.slideZoom,e._touchState.centerX=(t.touches[0].clientX+t.touches[1].clientX)*.5-r,e._touchState.spanX=Math.abs(t.touches[0].clientX-t.touches[1].clientX)):e._touchMode=xd.ignore}}function qBt(e){return function(t){let n=t.touches.length,i=e._topDiv.getBoundingClientRect().left;e._touchMode===xd.singleTap?(e._touchMode=xd.scrub,e._onTouchMove(t)):e._touchMode===xd.scrub&&e._onTouchMove(t),e._mouseMode=Ah.touchOnly,n!==1?e._touchMode=n>0?xd.ignore:xd.none:e._touchMode===xd.slideZoom&&(e._touchState.centerX=t.touches[0].clientX-i),e._scrubElement&&(e._scrubElement.style.backgroundPosition="0 0")}}function $Bt(e){return function(t){let n,i,o,r,s,a,c=1,d=e._topDiv.getBoundingClientRect().left;e._touchMode===xd.singleTap&&(e._touchMode=xd.slideZoom),e._mouseMode=Ah.touchOnly,e._touchMode===xd.scrub?(t.preventDefault(),t.changedTouches.length===1&&(i=t.changedTouches[0].clientX-d,i>=0&&i<=e._topDiv.clientWidth&&e._setTimeBarTime(i,i*e._timeBarSecondsSpan/e._topDiv.clientWidth))):e._touchMode===xd.slideZoom&&(o=t.touches.length,o===2?(r=(t.touches[0].clientX+t.touches[1].clientX)*.5-d,s=Math.abs(t.touches[0].clientX-t.touches[1].clientX)):o===1&&(r=t.touches[0].clientX-d,s=0),l(r)&&(s>0&&e._touchState.spanX>0?(c=e._touchState.spanX/s,a=Q.addSeconds(e._startJulian,(e._touchState.centerX*e._timeBarSecondsSpan-r*e._timeBarSecondsSpan*c)/e._topDiv.clientWidth,new Q)):(n=e._touchState.centerX-r,a=Q.addSeconds(e._startJulian,n*e._timeBarSecondsSpan/e._topDiv.clientWidth,new Q)),e.zoomTo(a,Q.addSeconds(a,e._timeBarSecondsSpan*c,new Q)),e._touchState.centerX=r,e._touchState.spanX=s))}}Td.prototype.resize=function(){let e=this.container.clientWidth,t=this.container.clientHeight;if(e===this._lastWidth&&t===this._lastHeight)return;this._trackContainer.style.height=`${t}px`;let n=1;this._trackList.forEach(function(i){n+=i.height}),this._trackListEle.style.height=`${n.toString()}px`,this._trackListEle.width=this._trackListEle.clientWidth,this._trackListEle.height=n,this._makeTics(),this._lastXPos=void 0,this._lastWidth=e,this._lastHeight=t};var K5=Td;var Ufr=x(T(),1);var Pfr=x(T(),1);var WYe=x(LYe(),1);function n3t(e){let t=!1,n=window.screen;return l(n)&&(l(n.lockOrientation)?t=n.lockOrientation(e):l(n.mozLockOrientation)?t=n.mozLockOrientation(e):l(n.msLockOrientation)?t=n.msLockOrientation(e):l(n.orientation&&n.orientation.lock)&&(t=n.orientation.lock(e))),t}function vYe(){let e=window.screen;l(e)&&(l(e.unlockOrientation)?e.unlockOrientation():l(e.mozUnlockOrientation)?e.mozUnlockOrientation():l(e.msUnlockOrientation)?e.msUnlockOrientation():l(e.orientation&&e.orientation.unlock)&&e.orientation.unlock())}function i3t(e,t,n,i){i()||(n()?(t.useWebVR=!1,e._locked&&(vYe(),e._locked=!1),e._noSleep.disable(),qr.exitFullscreen(),n(!1)):(qr.fullscreen||qr.requestFullscreen(e._vrElement),e._noSleep.enable(),e._locked||(e._locked=n3t("landscape")),t.useWebVR=!0,n(!0)))}function tj(e,t){let n=this,i=Ee.observable(qr.enabled),o=Ee.observable(!1);this.isVRMode=void 0,Ee.defineProperty(this,"isVRMode",{get:function(){return o()}}),this.isVREnabled=void 0,Ee.defineProperty(this,"isVREnabled",{get:function(){return i()},set:function(s){i(s&&qr.enabled)}}),this.tooltip=void 0,Ee.defineProperty(this,"tooltip",function(){return i()?o()?"Exit VR mode":"Enter VR mode":"VR mode is unavailable"});let r=Ee.observable(!1);this._isOrthographic=void 0,Ee.defineProperty(this,"_isOrthographic",{get:function(){return r()}}),this._eventHelper=new kr,this._eventHelper.add(e.preRender,function(){r(e.camera.frustum instanceof yn)}),this._locked=!1,this._noSleep=new WYe.default,this._command=Fn(function(){i3t(n,e,o,r)},Ee.getObservable(this,"isVREnabled")),this._vrElement=Nn(t)??document.body,this._callback=function(){!qr.fullscreen&&o()&&(e.useWebVR=!1,n._locked&&(vYe(),n._locked=!1),n._noSleep.disable(),o(!1))},document.addEventListener(qr.changeEventName,this._callback)}Object.defineProperties(tj.prototype,{vrElement:{get:function(){return this._vrElement},set:function(e){this._vrElement=e}},command:{get:function(){return this._command}}});tj.prototype.isDestroyed=function(){return!1};tj.prototype.destroy=function(){this._eventHelper.removeAll(),document.removeEventListener(qr.changeEventName,this._callback),ue(this)};var J5=tj;var o3t="M 5.3125 6.375 C 4.008126 6.375 2.96875 7.4141499 2.96875 8.71875 L 2.96875 19.5 C 2.96875 20.8043 4.008126 21.875 5.3125 21.875 L 13.65625 21.875 C 13.71832 20.0547 14.845166 18.59375 16.21875 18.59375 C 17.592088 18.59375 18.71881 20.0552 18.78125 21.875 L 27.09375 21.875 C 28.398125 21.875 29.4375 20.8043 29.4375 19.5 L 29.4375 8.71875 C 29.4375 7.4141499 28.398125 6.375 27.09375 6.375 L 5.3125 6.375 z M 9.625 10.4375 C 11.55989 10.4375 13.125 12.03385 13.125 13.96875 C 13.125 15.90365 11.55989 17.46875 9.625 17.46875 C 7.69011 17.46875 6.125 15.90365 6.125 13.96875 C 6.125 12.03385 7.69011 10.4375 9.625 10.4375 z M 22.46875 10.4375 C 24.40364 10.4375 25.96875 12.03385 25.96875 13.96875 C 25.96875 15.90365 24.40364 17.46875 22.46875 17.46875 C 20.53386 17.46875 18.96875 15.90365 18.96875 13.96875 C 18.96875 12.03385 20.53386 10.4375 22.46875 10.4375 z",r3t="M 25.770585,2.4552065 C 15.72282,13.962707 10.699956,19.704407 8.1768352,22.580207 c -1.261561,1.4379 -1.902282,2.1427 -2.21875,2.5 -0.141624,0.1599 -0.208984,0.2355 -0.25,0.2813 l 0.6875,0.75 c 10e-5,-10e-5 0.679191,0.727 0.6875,0.7187 0.01662,-0.016 0.02451,-0.024 0.03125,-0.031 0.01348,-0.014 0.04013,-0.038 0.0625,-0.062 0.04474,-0.05 0.120921,-0.1315 0.28125,-0.3126 0.320657,-0.3619 0.956139,-1.0921 2.2187499,-2.5312 2.5252219,-2.8781 7.5454589,-8.6169 17.5937499,-20.1250005 l -1.5,-1.3125 z m -20.5624998,3.9063 c -1.304375,0 -2.34375,1.0391 -2.34375,2.3437 l 0,10.8125005 c 0,1.3043 1.039375,2.375 2.34375,2.375 l 2.25,0 c 1.9518039,-2.2246 7.4710958,-8.5584 13.5624998,-15.5312005 l -15.8124998,0 z m 21.1249998,0 c -1.855467,2.1245 -2.114296,2.4005 -3.59375,4.0936995 1.767282,0.1815 3.15625,1.685301 3.15625,3.500001 0,1.9349 -1.56511,3.5 -3.5,3.5 -1.658043,0 -3.043426,-1.1411 -3.40625,-2.6875 -1.089617,1.2461 -2.647139,2.9988 -3.46875,3.9375 0.191501,-0.062 0.388502,-0.094 0.59375,-0.094 1.373338,0 2.50006,1.4614 2.5625,3.2812 l 8.3125,0 c 1.304375,0 2.34375,-1.0707 2.34375,-2.375 l 0,-10.8125005 c 0,-1.3046 -1.039375,-2.3437 -2.34375,-2.3437 l -0.65625,0 z M 9.5518351,10.423906 c 1.9348899,0 3.4999999,1.596401 3.4999999,3.531301 0,1.9349 -1.56511,3.5 -3.4999999,3.5 -1.9348899,0 -3.4999999,-1.5651 -3.4999999,-3.5 0,-1.9349 1.56511,-3.531301 3.4999999,-3.531301 z m 4.2187499,10.312601 c -0.206517,0.2356 -0.844218,0.9428 -1.03125,1.1562 l 0.8125,0 c 0.01392,-0.4081 0.107026,-0.7968 0.21875,-1.1562 z";function nj(e,t,n){e=Nn(e);let i=new J5(t,n);i._exitVRPath=r3t,i._enterVRPath=o3t;let o=document.createElement("button");o.type="button",o.className="cesium-button cesium-vrButton",o.setAttribute("data-bind",'css: { "cesium-button-disabled" : _isOrthographic }, attr: { title: tooltip },click: command,enable: isVREnabled,cesiumSvgPath: { path: isVRMode ? _exitVRPath : _enterVRPath, width: 32, height: 32 }'),e.appendChild(o),Ee.applyBindings(i,o),this._container=e,this._viewModel=i,this._element=o}Object.defineProperties(nj.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}}});nj.prototype.isDestroyed=function(){return!1};nj.prototype.destroy=function(){return this._viewModel.destroy(),Ee.cleanNode(this._element),this._container.removeChild(this._element),ue(this)};var j5=nj;var FYe=new me;function XYe(e){let t=e.clock;t.currentTime=e.timeJulian,t.shouldAnimate=!1}function s3t(e){let t=e.getPropertyIds(),n="";return t.forEach(function(i){let o=e.getProperty(i);l(o)&&(n+=`<tr><th>${i}</th><td>${o}</td></tr>`)}),n.length>0&&(n=`<table class="cesium-infoBox-defaultTable"><tbody>${n}</tbody></table>`),n}function a3t(e){let t,n=[],i=e.getPropertyIds();for(t=0;t<i.length;t++){let r=i[t];/^name$/i.test(r)?n[0]=e.getProperty(r):/name/i.test(r)?n[1]=e.getProperty(r):/^title$/i.test(r)?n[2]=e.getProperty(r):/^(id|identifier)$/i.test(r)?n[3]=e.getProperty(r):/element/i.test(r)?n[4]=e.getProperty(r):/(id|identifier)$/i.test(r)&&(n[5]=e.getProperty(r))}let o=n.length;for(t=0;t<o;t++){let r=n[t];if(l(r)&&r!=="")return r}return"Unnamed Feature"}function IYe(e,t){let n=e.scene.pick(t.position);if(l(n)){let i=n.id??n.primitive.id;if(i instanceof er)return i;if(n instanceof ia||n instanceof $S)return new er({name:a3t(n),description:s3t(n),feature:n})}return u3t(e,t.position)}var c3t=new Q;function ble(e,t){if(l(t)){let n=t.clock;if(l(n)&&l(e)){let i=n.startTime,o=n.stopTime;Q.equals(i,o)&&(o=Q.addSeconds(i,W.EPSILON2,c3t)),e.updateFromClock(),e.zoomTo(i,o)}}}var l3t=new h;function d3t(e){let t=e.length;for(let n=0;n<t;++n){let i=e.get(n);if(i instanceof Hr)return i}}function u3t(e,t){let n=e.scene,i=n.camera.getPickRay(t);if(!l(i))return;let o=n.imageryLayers;if(!l(o)){let a=d3t(n.primitives);if(!l(a))return;o=a.imageryLayers}let r=o.pickImageryLayerFeatures(i,n);if(!l(r))return;let s=new er({id:"Loading...",description:"Loading feature information..."});return r.then(function(a){if(e.selectedEntity!==s)return;if(!l(a)||a.length===0){e.selectedEntity=PYe();return}let c=a[0],d=new er({id:c.name,description:c.description});if(l(c.position)){let u=e.scene.ellipsoid.cartographicToCartesian(c.position,l3t);d.position=new zl(u)}e.selectedEntity=d},function(){e.selectedEntity===s&&(e.selectedEntity=PYe())}),s}function PYe(){return new er({id:"None",description:"No features found."})}function m3t(e,t){let n=e._geocoder,i=e._homeButton,o=e._sceneModePicker,r=e._projectionPicker,s=e._baseLayerPicker,a=e._animation,c=e._timeline,d=e._fullscreenButton,u=e._infoBox,m=e._selectionIndicator,p=t?"hidden":"visible";if(l(n)&&(n.container.style.visibility=p),l(i)&&(i.container.style.visibility=p),l(o)&&(o.container.style.visibility=p),l(r)&&(r.container.style.visibility=p),l(s)&&(s.container.style.visibility=p),l(a)&&(a.container.style.visibility=p),l(c)&&(c.container.style.visibility=p),l(d)&&d.viewModel.isFullscreenEnabled&&(d.container.style.visibility=p),l(u)&&(u.container.style.visibility=p),l(m)&&(m.container.style.visibility=p),e._container){let b=t||!l(d)?0:d.container.clientWidth;e._vrButton.container.style.right=`${b}px`,e.forceResize()}}function uo(e,t){e=Nn(e),t=t??B.EMPTY_OBJECT;let n=(!l(t.globe)||t.globe!==!1)&&(!l(t.baseLayerPicker)||t.baseLayerPicker!==!1),i=this,o=document.createElement("div");o.className="cesium-viewer",e.appendChild(o);let r=document.createElement("div");r.className="cesium-viewer-cesiumWidgetContainer",o.appendChild(r);let s=document.createElement("div");s.className="cesium-viewer-bottom",o.appendChild(s);let a=t.scene3DOnly??!1,c,d,u=!1;l(t.clockViewModel)?(d=t.clockViewModel,c=d.clock):(c=new Dh,d=new d5(c),u=!0);let m=new rk(r,{baseLayer:n&&l(t.selectedImageryProviderViewModel)||l(t.baseLayer)||l(t.imageryProvider)?!1:void 0,clock:c,shouldAnimate:t.shouldAnimate,skyBox:t.skyBox,skyAtmosphere:t.skyAtmosphere,sceneMode:t.sceneMode,ellipsoid:t.ellipsoid,mapProjection:t.mapProjection,globe:t.globe,orderIndependentTranslucency:t.orderIndependentTranslucency,automaticallyTrackDataSourceClocks:t.automaticallyTrackDataSourceClocks,contextOptions:t.contextOptions,useDefaultRenderLoop:t.useDefaultRenderLoop,targetFrameRate:t.targetFrameRate,showRenderLoopErrors:t.showRenderLoopErrors,useBrowserRecommendedResolution:t.useBrowserRecommendedResolution,creditContainer:l(t.creditContainer)?t.creditContainer:s,creditViewport:t.creditViewport,dataSources:t.dataSources,scene3DOnly:a,shadows:t.shadows,terrainShadows:t.terrainShadows,mapMode2D:t.mapMode2D,blurActiveElementOnCanvasFocus:t.blurActiveElementOnCanvasFocus,requestRenderMode:t.requestRenderMode,maximumRenderTimeChange:t.maximumRenderTimeChange,depthPlaneEllipsoidOffset:t.depthPlaneEllipsoidOffset,msaaSamples:t.msaaSamples}),p=m.scene,b=new kr;b.add(c.onTick,uo.prototype._onTick,this);let f;if(!l(t.selectionIndicator)||t.selectionIndicator!==!1){let z=document.createElement("div");z.className="cesium-viewer-selectionIndicatorContainer",o.appendChild(z),f=new B5(z,p)}let y;if(!l(t.infoBox)||t.infoBox!==!1){let z=document.createElement("div");z.className="cesium-viewer-infoBoxContainer",o.appendChild(z),y=new I5(z);let K=y.viewModel;b.add(K.cameraClicked,uo.prototype._onInfoBoxCameraClicked,this),b.add(K.closeClicked,uo.prototype._onInfoBoxClockClicked,this)}let _=document.createElement("div");_.className="cesium-viewer-toolbar",o.appendChild(_);let S;if(!l(t.geocoder)||t.geocoder!==!1){let z=document.createElement("div");z.className="cesium-viewer-geocoderContainer",_.appendChild(z);let K;typeof t.geocoder=="string"?K=[new FR({scene:p,geocodeProviderType:t.geocoder})]:l(t.geocoder)&&typeof t.geocoder!="boolean"&&(K=Array.isArray(t.geocoder)?t.geocoder:[t.geocoder]),S=new E5({container:z,geocoderServices:K,scene:p}),b.add(S.viewModel.search.beforeExecute,uo.prototype._clearObjects,this)}let Z;(!l(t.homeButton)||t.homeButton!==!1)&&(Z=new G5(_,p),l(S)&&b.add(Z.viewModel.command.afterExecute,function(){let z=S.viewModel;z.searchText="",z.isSearchInProgress&&z.search()}),b.add(Z.viewModel.command.beforeExecute,uo.prototype._clearTrackedObject,this));let R;!a&&(!l(t.sceneModePicker)||t.sceneModePicker!==!1)&&(R=new U5(_,p));let C;t.projectionPicker&&(C=new w5(_,p));let E,A;if(n){let z=t.imageryProviderViewModels??R5(),K=t.terrainProviderViewModels??C5();E=new Z5(_,{globe:p.globe,imageryProviderViewModels:z,selectedImageryProviderViewModel:t.selectedImageryProviderViewModel,terrainProviderViewModels:K,selectedTerrainProviderViewModel:t.selectedTerrainProviderViewModel}),A=_.getElementsByClassName("cesium-baseLayerPicker-dropDown")[0]}l(t.baseLayer)&&t.baseLayer!==!1&&(n&&(E.viewModel.selectedImagery=void 0),p.imageryLayers.removeAll(),p.imageryLayers.add(t.baseLayer)),l(t.terrainProvider)&&(n&&(E.viewModel.selectedTerrain=void 0),p.terrainProvider=t.terrainProvider),l(t.terrain)&&(n&&(p.globe.depthTestAgainstTerrain=!0),p.setTerrain(t.terrain));let L;if(!l(t.navigationHelpButton)||t.navigationHelpButton!==!1){let z=!0;try{if(l(window.localStorage)){let K=window.localStorage.getItem("cesium-hasSeenNavHelp");l(K)&&K?z=!1:window.localStorage.setItem("cesium-hasSeenNavHelp","true")}}catch{}L=new X5({container:_,instructionsInitiallyVisible:t.navigationInstructionsInitiallyVisible??z})}let F;if(!l(t.animation)||t.animation!==!1){let z=document.createElement("div");z.className="cesium-viewer-animationContainer",o.appendChild(z),F=new h5(z,new f5(d))}let I;if(!l(t.timeline)||t.timeline!==!1){let z=document.createElement("div");z.className="cesium-viewer-timelineContainer",o.appendChild(z),I=new K5(z,c),I.addEventListener("settime",XYe,!1),I.zoomTo(c.startTime,c.stopTime)}let N,g,V;(!l(t.fullscreenButton)||t.fullscreenButton!==!1)&&(V=document.createElement("div"),V.className="cesium-viewer-fullscreenContainer",o.appendChild(V),N=new W5(V,t.fullscreenElement),g=Sc(N.viewModel,"isFullscreenEnabled",function(z){V.style.display=z?"block":"none",l(I)&&(I.container.style.right=`${V.clientWidth}px`,I.resize())}));let G,v,X;if(t.vrButton){let z=document.createElement("div");z.className="cesium-viewer-vrContainer",o.appendChild(z),G=new j5(z,p,t.fullScreenElement),v=Sc(G.viewModel,"isVREnabled",function(K){z.style.display=K?"block":"none",l(N)&&(z.style.right=`${V.clientWidth}px`),l(I)&&(I.container.style.right=`${z.clientWidth}px`,I.resize())}),X=Sc(G.viewModel,"isVRMode",function(K){m3t(i,K)})}this._baseLayerPickerDropDown=A,this._fullscreenSubscription=g,this._vrSubscription=v,this._vrModeSubscription=X,this._dataSourceChangedListeners={},this._container=e,this._bottomContainer=s,this._element=o,this._cesiumWidget=m,this._selectionIndicator=f,this._infoBox=y,this._clockViewModel=d,this._destroyClockViewModel=u,this._toolbar=_,this._homeButton=Z,this._sceneModePicker=R,this._projectionPicker=C,this._baseLayerPicker=E,this._navigationHelpButton=L,this._animation=F,this._timeline=I,this._fullscreenButton=N,this._vrButton=G,this._geocoder=S,this._eventHelper=b,this._lastWidth=0,this._lastHeight=0,this._enableInfoOrSelection=l(y)||l(f),this._selectedEntity=void 0,this._selectedEntityChanged=new Se;let Y=this._cesiumWidget.dataSources,D=this._cesiumWidget.dataSourceDisplay;b.add(Y.dataSourceAdded,uo.prototype._onDataSourceAdded,this),b.add(Y.dataSourceRemoved,uo.prototype._onDataSourceRemoved,this),b.add(p.postUpdate,uo.prototype.resize,this);let M=Y.length;for(let z=0;z<M;z++)this._dataSourceAdded(Y,Y.get(z));this._dataSourceAdded(void 0,D.defaultDataSource),b.add(Y.dataSourceAdded,uo.prototype._dataSourceAdded,this),b.add(Y.dataSourceRemoved,uo.prototype._dataSourceRemoved,this);function O(z){let K=IYe(i,z);l(K)?j.getValueOrUndefined(K.position,i.clock.currentTime)?i.trackedEntity=K:i.zoomTo(K):l(i.trackedEntity)&&(i.trackedEntity=void 0)}function w(z){i.selectedEntity=IYe(i,z)}m.screenSpaceEventHandler.setInputAction(w,mn.LEFT_CLICK),m.screenSpaceEventHandler.setInputAction(O,mn.LEFT_DOUBLE_CLICK),m._canAnimateUpdateCallback=this._updateCanAnimate(this)}Object.defineProperties(uo.prototype,{container:{get:function(){return this._container}},creditDisplay:{get:function(){return this._cesiumWidget.creditDisplay}},bottomContainer:{get:function(){return this._bottomContainer}},cesiumWidget:{get:function(){return this._cesiumWidget}},selectionIndicator:{get:function(){return this._selectionIndicator}},infoBox:{get:function(){return this._infoBox}},geocoder:{get:function(){return this._geocoder}},homeButton:{get:function(){return this._homeButton}},sceneModePicker:{get:function(){return this._sceneModePicker}},projectionPicker:{get:function(){return this._projectionPicker}},baseLayerPicker:{get:function(){return this._baseLayerPicker}},navigationHelpButton:{get:function(){return this._navigationHelpButton}},animation:{get:function(){return this._animation}},timeline:{get:function(){return this._timeline}},fullscreenButton:{get:function(){return this._fullscreenButton}},vrButton:{get:function(){return this._vrButton}},dataSourceDisplay:{get:function(){return this._cesiumWidget.dataSourceDisplay}},entities:{get:function(){return this._cesiumWidget.entities}},dataSources:{get:function(){return this._cesiumWidget.dataSources}},canvas:{get:function(){return this._cesiumWidget.canvas}},scene:{get:function(){return this._cesiumWidget.scene}},shadows:{get:function(){return this.scene.shadowMap.enabled},set:function(e){this.scene.shadowMap.enabled=e}},terrainShadows:{get:function(){return this.scene.globe.shadows},set:function(e){this.scene.globe.shadows=e}},shadowMap:{get:function(){return this.scene.shadowMap}},imageryLayers:{get:function(){return this.scene.imageryLayers}},terrainProvider:{get:function(){return this.scene.terrainProvider},set:function(e){this.scene.terrainProvider=e}},camera:{get:function(){return this.scene.camera}},ellipsoid:{get:function(){return this.scene.ellipsoid}},postProcessStages:{get:function(){return this.scene.postProcessStages}},clock:{get:function(){return this._clockViewModel.clock}},clockViewModel:{get:function(){return this._clockViewModel}},screenSpaceEventHandler:{get:function(){return this._cesiumWidget.screenSpaceEventHandler}},targetFrameRate:{get:function(){return this._cesiumWidget.targetFrameRate},set:function(e){this._cesiumWidget.targetFrameRate=e}},useDefaultRenderLoop:{get:function(){return this._cesiumWidget.useDefaultRenderLoop},set:function(e){this._cesiumWidget.useDefaultRenderLoop=e}},resolutionScale:{get:function(){return this._cesiumWidget.resolutionScale},set:function(e){this._cesiumWidget.resolutionScale=e}},useBrowserRecommendedResolution:{get:function(){return this._cesiumWidget.useBrowserRecommendedResolution},set:function(e){this._cesiumWidget.useBrowserRecommendedResolution=e}},allowDataSourcesToSuspendAnimation:{get:function(){return this._cesiumWidget.allowDataSourcesToSuspendAnimation},set:function(e){this._cesiumWidget.allowDataSourcesToSuspendAnimation=e}},trackedEntity:{get:function(){return this._cesiumWidget.trackedEntity},set:function(e){this._cesiumWidget.trackedEntity=e}},selectedEntity:{get:function(){return this._selectedEntity},set:function(e){if(this._selectedEntity!==e){this._selectedEntity=e;let t=l(this._selectionIndicator)?this._selectionIndicator.viewModel:void 0;l(e)?l(t)&&t.animateAppear():l(t)&&t.animateDepart(),this._selectedEntityChanged.raiseEvent(e)}}},selectedEntityChanged:{get:function(){return this._selectedEntityChanged}},trackedEntityChanged:{get:function(){return this._cesiumWidget.trackedEntityChanged}},clockTrackedDataSource:{get:function(){return this._cesiumWidget.clockTrackedDataSource},set:function(e){this._cesiumWidget.clockTrackedDataSource!==e&&(this._cesiumWidget.clockTrackedDataSource=e,ble(this._timeline,e))}}});uo.prototype.extend=function(e,t){e(this,t)};uo.prototype.resize=function(){let e=this._cesiumWidget,t=this._container,n=t.clientWidth,i=t.clientHeight,o=l(this._animation),r=l(this._timeline);if(e.resize(),n===this._lastWidth&&i===this._lastHeight)return;let s=i-125,a=this._baseLayerPickerDropDown;if(l(a)&&(a.style.maxHeight=`${s}px`),l(this._geocoder)){let f=this._geocoder.searchSuggestionsContainer;f.style.maxHeight=`${s}px`}l(this._infoBox)&&(this._infoBox.viewModel.maxHeight=s);let c=this._timeline,d,u=0,m=5,p=3,b=0;if(o&&window.getComputedStyle(this._animation.container).visibility!=="hidden"){let f=this._lastWidth;d=this._animation.container,n>900?(u=169,f<=900&&(d.style.width="169px",d.style.height="112px",this._animation.resize())):n>=600?(u=136,(f<600||f>900)&&(d.style.width="136px",d.style.height="90px",this._animation.resize())):(u=106,(f>600||f===0)&&(d.style.width="106px",d.style.height="70px",this._animation.resize())),m=u+5}if(r&&window.getComputedStyle(this._timeline.container).visibility!=="hidden"){let f=this._fullscreenButton,y=this._vrButton,_=c.container,S=_.style;p=_.clientHeight+3,S.left=`${u}px`;let Z=0;l(f)&&(Z+=f.container.clientWidth),l(y)&&(Z+=y.container.clientWidth),S.right=`${Z}px`,c.resize()}!r&&l(this._fullscreenButton)&&(b=this._fullscreenButton.container.clientWidth),this._bottomContainer.style.left=`${m}px`,this._bottomContainer.style.bottom=`${p}px`,this._bottomContainer.style.right=`${b}px`,this._lastWidth=n,this._lastHeight=i};uo.prototype.forceResize=function(){this._lastWidth=0,this.resize()};uo.prototype.render=function(){this._cesiumWidget.render()};uo.prototype.isDestroyed=function(){return!1};uo.prototype.destroy=function(){return l(this.screenSpaceEventHandler)&&!this.screenSpaceEventHandler.isDestroyed()&&(this.screenSpaceEventHandler.removeInputAction(mn.LEFT_CLICK),this.screenSpaceEventHandler.removeInputAction(mn.LEFT_DOUBLE_CLICK)),this._container.removeChild(this._element),this._element.removeChild(this._toolbar),this._eventHelper.removeAll(),l(this._geocoder)&&(this._geocoder=this._geocoder.destroy()),l(this._homeButton)&&(this._homeButton=this._homeButton.destroy()),l(this._sceneModePicker)&&(this._sceneModePicker=this._sceneModePicker.destroy()),l(this._projectionPicker)&&(this._projectionPicker=this._projectionPicker.destroy()),l(this._baseLayerPicker)&&(this._baseLayerPicker=this._baseLayerPicker.destroy()),l(this._animation)&&(this._element.removeChild(this._animation.container),this._animation=this._animation.destroy()),l(this._timeline)&&(this._timeline.removeEventListener("settime",XYe,!1),this._element.removeChild(this._timeline.container),this._timeline=this._timeline.destroy()),l(this._fullscreenButton)&&(this._fullscreenSubscription.dispose(),this._element.removeChild(this._fullscreenButton.container),this._fullscreenButton=this._fullscreenButton.destroy()),l(this._vrButton)&&(this._vrSubscription.dispose(),this._vrModeSubscription.dispose(),this._element.removeChild(this._vrButton.container),this._vrButton=this._vrButton.destroy()),l(this._infoBox)&&(this._element.removeChild(this._infoBox.container),this._infoBox=this._infoBox.destroy()),l(this._selectionIndicator)&&(this._element.removeChild(this._selectionIndicator.container),this._selectionIndicator=this._selectionIndicator.destroy()),this._destroyClockViewModel&&(this._clockViewModel=this._clockViewModel.destroy()),this._cesiumWidget=this._cesiumWidget.destroy(),ue(this)};uo.prototype._dataSourceAdded=function(e,t){t.entities.collectionChanged.addEventListener(uo.prototype._onEntityCollectionChanged,this)};uo.prototype._dataSourceRemoved=function(e,t){let n=t.entities;n.collectionChanged.removeEventListener(uo.prototype._onEntityCollectionChanged,this),l(this.selectedEntity)&&n.getById(this.selectedEntity.id)===this.selectedEntity&&(this.selectedEntity=void 0)};uo.prototype._updateCanAnimate=function(e){return function(t){e._clockViewModel.canAnimate=t}};uo.prototype._onTick=function(e){let t=e.currentTime,n,i=!1,o=this.selectedEntity,r=l(o)&&this._enableInfoOrSelection;r&&o.isShowing&&o.isAvailable(t)&&(this._cesiumWidget.dataSourceDisplay.getBoundingSphere(o,!0,FYe)!==Wt.FAILED?n=FYe.center:l(o.position)&&(n=o.position.getValue(t,n)),i=l(n));let s=l(this._selectionIndicator)?this._selectionIndicator.viewModel:void 0;l(s)&&(s.position=h.clone(n,s.position),s.showSelection=r&&i,s.update());let a=l(this._infoBox)?this._infoBox.viewModel:void 0;l(a)&&(a.showInfo=r,a.enableCamera=i,a.isCameraTracking=this.trackedEntity===this.selectedEntity,r?(a.titleText=o.name??o.id,a.description=j.getValueOrDefault(o.description,t,"")):(a.titleText="",a.description=""))};uo.prototype._onEntityCollectionChanged=function(e,t,n){let i=n.length;for(let o=0;o<i;o++){let r=n[o];this.selectedEntity===r&&(this.selectedEntity=void 0)}};uo.prototype._onInfoBoxCameraClicked=function(e){if(e.isCameraTracking&&this.trackedEntity===this.selectedEntity)this.trackedEntity=void 0;else{let n=this.selectedEntity.position;l(n)?this.trackedEntity=this.selectedEntity:this.zoomTo(this.selectedEntity)}};uo.prototype._clearTrackedObject=function(){this.trackedEntity=void 0};uo.prototype._onInfoBoxClockClicked=function(e){this.selectedEntity=void 0};uo.prototype._clearObjects=function(){this.trackedEntity=void 0,this.selectedEntity=void 0};uo.prototype._onDataSourceChanged=function(e){this.clockTrackedDataSource===e&&ble(this.timeline,e)};uo.prototype._onDataSourceAdded=function(e,t){this._cesiumWidget._automaticallyTrackDataSourceClocks&&t===this.clockTrackedDataSource&&ble(this._timeline,t);let n=t.entities.id,i=this._eventHelper.add(t.changedEvent,uo.prototype._onDataSourceChanged,this);this._dataSourceChangedListeners[n]=i};uo.prototype._onDataSourceRemoved=function(e,t){let n=t.entities.id;this._dataSourceChangedListeners[n](),this._dataSourceChangedListeners[n]=void 0};uo.prototype.addController=function(e){return this._cesiumWidget.addController(e)};uo.prototype.removeController=function(e){return this._cesiumWidget.removeController(e)};uo.prototype.zoomTo=function(e,t){return this._cesiumWidget.zoomTo(e,t)};uo.prototype.flyTo=function(e,t){return this._cesiumWidget.flyTo(e,t)};var gle=uo;var mpr=x(T(),1);function h3t(e){let t=document.createElement("div");t.className="cesium-viewer-cesium3DTilesInspectorContainer",e.container.appendChild(t);let n=new y5(t,e.scene);Object.defineProperties(e,{cesium3DTilesInspector:{get:function(){return n}}})}var yle=h3t;var ppr=x(T(),1);function f3t(e){let t=document.createElement("div");t.className="cesium-viewer-cesiumInspectorContainer",e.container.appendChild(t);let n=new _5(t,e.scene);Object.defineProperties(e,{cesiumInspector:{get:function(){return n}}})}var xle=f3t;var xpr=x(T(),1);function p3t(e,t){t=t??B.EMPTY_OBJECT;let n=!0,i=t.flyToOnDrop??!0,o=new Se,r=t.clearOnDrop??!0,s=t.dropTarget??e.container,a=t.clampToGround??!0,c=t.proxy;s=Nn(s),Object.defineProperties(e,{dropTarget:{get:function(){return s},set:function(u){NYe(s,d),s=u,Tle(s,d)}},dropEnabled:{get:function(){return n},set:function(u){u!==n&&(u?Tle(s,d):NYe(s,d),n=u)}},dropError:{get:function(){return o}},clearOnDrop:{get:function(){return r},set:function(u){r=u}},flyToOnDrop:{get:function(){return i},set:function(u){i=u}},proxy:{get:function(){return c},set:function(u){c=u}},clampToGround:{get:function(){return a},set:function(u){a=u}}});function d(u){OR(u),r&&(e.entities.removeAll(),e.dataSources.removeAll());let m=u.dataTransfer.files,p=m.length;for(let b=0;b<p;b++){let f=m[b],y=new FileReader;y.onload=b3t(e,f,c,a),y.onerror=g3t(e,f),y.readAsText(f)}}Tle(s,d),e.destroy=LU(e,e.destroy,function(){e.dropEnabled=!1}),e._handleDrop=d}function OR(e){e.stopPropagation(),e.preventDefault()}function NYe(e,t){let n=e;l(n)&&(n.removeEventListener("drop",t,!1),n.removeEventListener("dragenter",OR,!1),n.removeEventListener("dragover",OR,!1),n.removeEventListener("dragexit",OR,!1))}function Tle(e,t){e.addEventListener("drop",t,!1),e.addEventListener("dragenter",OR,!1),e.addEventListener("dragover",OR,!1),e.addEventListener("dragexit",OR,!1)}function b3t(e,t,n,i){let o=e.scene;return function(r){let s=t.name;try{let a;if(/\.czml$/i.test(s))a=pk.load(JSON.parse(r.target.result),{sourceUri:s});else if(/\.geojson$/i.test(s)||/\.json$/i.test(s)||/\.topojson$/i.test(s))a=ET.load(JSON.parse(r.target.result),{sourceUri:s,clampToGround:i});else if(/\.(kml|kmz)$/i.test(s))a=VR.load(t,{sourceUri:s,proxy:n,camera:o.camera,canvas:o.canvas,clampToGround:i,screenOverlayContainer:e.container});else if(/\.gpx$/i.test(s))a=aU.load(t,{sourceUri:s,proxy:n});else{e.dropError.raiseEvent(e,s,`Unrecognized file: ${s}`);return}l(a)&&e.dataSources.add(a).then(function(c){e.flyToOnDrop&&e.flyTo(c)}).catch(function(c){e.dropError.raiseEvent(e,s,c)})}catch(a){e.dropError.raiseEvent(e,s,a)}}}function g3t(e,t){return function(n){e.dropError.raiseEvent(e,t.name,n.target.error)}}var _le=p3t;var Cpr=x(T(),1);function y3t(e,t){t=t??B.EMPTY_OBJECT;let n=new Y5({scene:e.scene,container:e.bottomContainer,lowFrameRateMessage:t.lowFrameRateMessage});Object.defineProperties(e,{performanceWatchdog:{get:function(){return n}}})}var Sle=y3t;var wpr=x(T(),1);var Npr=x(T(),1);var Lpr=x(T(),1);function YYe(e){let t=e.split(` `),n;for(n=0;n<t.length&&!t[n].match(/\S/);n++);if(n===t.length)return"";let i="",o=/^\s*/,s=t[n].match(o)[0].length;for(let a=n;a<t.length;a++){let c=t[a];c.match(o)[0].length>=s&&(c=c.slice(s)),i+=`${c} -`}return i}function Gh(e){this._scene=e,this._voxelPrimitive=void 0,this._customShaderCompilationRemoveCallback=void 0,this._definedProperties=[],this._getPrimitiveFunctions=[],this._modelMatrixReady=!1;let t=this;function n(o){let{name:r,initialValue:s}=o;t._definedProperties.push(r);let a=o.setPrimitiveFunction;a===!0&&(a=function(u){t._voxelPrimitive[r]=u});let c=o.getPrimitiveFunction;c===!0&&(c=function(){t[r]=t._voxelPrimitive[r]}),l(c)&&t._getPrimitiveFunctions.push(c);let d=Ee.observable();return Ee.defineProperty(t,r,{get:function(){return d()},set:function(u){typeof s=="number"&&typeof u=="string"&&(u=Number(u),isNaN(u)&&(u=s)),typeof s=="boolean"&&typeof u=="number"&&(u=u===1),d(u),l(a)&&l(t._voxelPrimitive)&&(a(u),e.requestRender())}}),t[r]=s,d}function i(o,r){return function(s){let a=t._voxelPrimitive[o].clone();a[r]=s,t._voxelPrimitive[o]=a}}n({name:"inspectorVisible",initialValue:!0}),n({name:"displayVisible",initialValue:!1}),n({name:"transformVisible",initialValue:!1}),n({name:"boundsVisible",initialValue:!1}),n({name:"clippingVisible",initialValue:!1}),n({name:"shaderVisible",initialValue:!1}),n({name:"shaderString",initialValue:"",getPrimitiveFunction:function(){let o=t._voxelPrimitive.customShader.fragmentShaderText;t.shaderString=NYe(o)}}),n({name:"shaderCompilationMessage",initialValue:""}),n({name:"shaderCompilationSuccess",initialValue:!0}),n({name:"depthTest",initialValue:!1,setPrimitiveFunction:!0,getPrimitiveFunction:!0}),n({name:"show",initialValue:!0,setPrimitiveFunction:!0,getPrimitiveFunction:!0}),n({name:"disableUpdate",initialValue:!1,setPrimitiveFunction:!0,getPrimitiveFunction:!0}),n({name:"debugDraw",initialValue:!1,setPrimitiveFunction:!0,getPrimitiveFunction:!0}),n({name:"jitter",initialValue:!0,setPrimitiveFunction:!0,getPrimitiveFunction:!0}),n({name:"nearestSampling",initialValue:!0,setPrimitiveFunction:!0,getPrimitiveFunction:!0}),n({name:"screenSpaceError",initialValue:4,setPrimitiveFunction:!0,getPrimitiveFunction:!0}),n({name:"stepSize",initialValue:1,setPrimitiveFunction:!0,getPrimitiveFunction:!0}),n({name:"shapeIsBox",getPrimitiveFunction:function(){let o=t._voxelPrimitive.shape;t.shapeIsBox=o===_c.BOX}}),n({name:"shapeIsEllipsoid",getPrimitiveFunction:function(){let o=t._voxelPrimitive.shape;t.shapeIsEllipsoid=o===_c.ELLIPSOID}}),n({name:"shapeIsCylinder",getPrimitiveFunction:function(){let o=t._voxelPrimitive.shape;t.shapeIsCylinder=o===_c.CYLINDER}}),n({name:"clippingBoxMaxXMin",initialValue:0,getPrimitiveFunction:function(){t.clippingBoxMaxXMin=t._voxelPrimitive.minBounds.x}}),n({name:"clippingBoxMaxXMax",initialValue:1,getPrimitiveFunction:function(){t.clippingBoxMaxXMax=t._voxelPrimitive.maxBounds.x}}),n({name:"clippingBoxMaxX",initialValue:0,setPrimitiveFunction:i("maxClippingBounds","x"),getPrimitiveFunction:function(){t.clippingBoxMaxX=t._voxelPrimitive.maxClippingBounds.x}}),n({name:"clippingBoxMinXMin",initialValue:0,getPrimitiveFunction:function(){t.clippingBoxMinXMin=t._voxelPrimitive.minBounds.x}}),n({name:"clippingBoxMinXMax",initialValue:1,getPrimitiveFunction:function(){t.clippingBoxMinXMax=t._voxelPrimitive.maxBounds.x}}),n({name:"clippingBoxMinX",initialValue:0,setPrimitiveFunction:i("minClippingBounds","x"),getPrimitiveFunction:function(){t.clippingBoxMinX=t._voxelPrimitive.minClippingBounds.x}}),n({name:"clippingBoxMaxYMin",initialValue:0,getPrimitiveFunction:function(){t.clippingBoxMaxYMin=t._voxelPrimitive.minBounds.y}}),n({name:"clippingBoxMaxYMax",initialValue:1,getPrimitiveFunction:function(){t.clippingBoxMaxYMax=t._voxelPrimitive.maxBounds.y}}),n({name:"clippingBoxMaxY",initialValue:0,setPrimitiveFunction:i("maxClippingBounds","y"),getPrimitiveFunction:function(){t.clippingBoxMaxY=t._voxelPrimitive.maxClippingBounds.y}}),n({name:"clippingBoxMinYMin",initialValue:0,getPrimitiveFunction:function(){t.clippingBoxMinYMin=t._voxelPrimitive.minBounds.y}}),n({name:"clippingBoxMinYMax",initialValue:1,getPrimitiveFunction:function(){t.clippingBoxMinYMax=t._voxelPrimitive.maxBounds.y}}),n({name:"clippingBoxMinY",initialValue:0,setPrimitiveFunction:i("minClippingBounds","y"),getPrimitiveFunction:function(){t.clippingBoxMinY=t._voxelPrimitive.minClippingBounds.y}}),n({name:"clippingBoxMaxZMin",initialValue:0,getPrimitiveFunction:function(){t.clippingBoxMaxZMin=t._voxelPrimitive.minBounds.z}}),n({name:"clippingBoxMaxZMax",initialValue:1,getPrimitiveFunction:function(){t.clippingBoxMaxZMax=t._voxelPrimitive.maxBounds.z}}),n({name:"clippingBoxMaxZ",initialValue:0,setPrimitiveFunction:i("maxClippingBounds","z"),getPrimitiveFunction:function(){t.clippingBoxMaxZ=t._voxelPrimitive.maxClippingBounds.z}}),n({name:"clippingBoxMinZMin",initialValue:0,getPrimitiveFunction:function(){t.clippingBoxMinZMin=t._voxelPrimitive.minBounds.z}}),n({name:"clippingBoxMinZMax",initialValue:1,getPrimitiveFunction:function(){t.clippingBoxMinZMax=t._voxelPrimitive.maxBounds.z}}),n({name:"clippingBoxMinZ",initialValue:0,setPrimitiveFunction:i("minClippingBounds","z"),getPrimitiveFunction:function(){t.clippingBoxMinZ=t._voxelPrimitive.minClippingBounds.z}}),n({name:"clippingEllipsoidMaxLongitudeMin",initialValue:-W.PI,getPrimitiveFunction:function(){t.clippingEllipsoidMaxLongitudeMin=t._voxelPrimitive.minBounds.x}}),n({name:"clippingEllipsoidMaxLongitudeMax",initialValue:W.PI,getPrimitiveFunction:function(){t.clippingEllipsoidMaxLongitudeMax=t._voxelPrimitive.maxBounds.x}}),n({name:"clippingEllipsoidMaxLongitude",initialValue:0,setPrimitiveFunction:i("maxClippingBounds","x"),getPrimitiveFunction:function(){t.clippingEllipsoidMaxLongitude=t._voxelPrimitive.maxClippingBounds.x}}),n({name:"clippingEllipsoidMinLongitudeMin",initialValue:-W.PI,getPrimitiveFunction:function(){t.clippingEllipsoidMinLongitudeMin=t._voxelPrimitive.minBounds.x}}),n({name:"clippingEllipsoidMinLongitudeMax",initialValue:W.PI,getPrimitiveFunction:function(){t.clippingEllipsoidMinLongitudeMax=t._voxelPrimitive.maxBounds.x}}),n({name:"clippingEllipsoidMinLongitude",initialValue:0,setPrimitiveFunction:i("minClippingBounds","x"),getPrimitiveFunction:function(){t.clippingEllipsoidMinLongitude=t._voxelPrimitive.minClippingBounds.x}}),n({name:"clippingEllipsoidMaxLatitudeMin",initialValue:-W.PI_OVER_TWO,getPrimitiveFunction:function(){t.clippingEllipsoidMaxLatitudeMin=t._voxelPrimitive.minBounds.y}}),n({name:"clippingEllipsoidMaxLatitudeMax",initialValue:W.PI_OVER_TWO,getPrimitiveFunction:function(){t.clippingEllipsoidMaxLatitudeMax=t._voxelPrimitive.maxBounds.y}}),n({name:"clippingEllipsoidMaxLatitude",initialValue:0,setPrimitiveFunction:i("maxClippingBounds","y"),getPrimitiveFunction:function(){t.clippingEllipsoidMaxLatitude=t._voxelPrimitive.maxClippingBounds.y}}),n({name:"clippingEllipsoidMinLatitudeMin",initialValue:-W.PI_OVER_TWO,getPrimitiveFunction:function(){t.clippingEllipsoidMinLatitudeMin=t._voxelPrimitive.minBounds.y}}),n({name:"clippingEllipsoidMinLatitudeMax",initialValue:W.PI_OVER_TWO,getPrimitiveFunction:function(){t.clippingEllipsoidMinLatitudeMax=t._voxelPrimitive.maxBounds.y}}),n({name:"clippingEllipsoidMinLatitude",initialValue:0,setPrimitiveFunction:i("minClippingBounds","y"),getPrimitiveFunction:function(){t.clippingEllipsoidMinLatitude=t._voxelPrimitive.minClippingBounds.y}}),n({name:"clippingEllipsoidMaxHeightMin",initialValue:0,getPrimitiveFunction:function(){t.clippingEllipsoidMaxHeightMin=t._voxelPrimitive.minBounds.z}}),n({name:"clippingEllipsoidMaxHeightMax",initialValue:1e5,getPrimitiveFunction:function(){t.clippingEllipsoidMaxHeightMax=t._voxelPrimitive.maxBounds.z}}),n({name:"clippingEllipsoidMaxHeight",initialValue:0,setPrimitiveFunction:i("maxClippingBounds","z"),getPrimitiveFunction:function(){t.clippingEllipsoidMaxHeight=t._voxelPrimitive.maxClippingBounds.z}}),n({name:"clippingEllipsoidMinHeightMin",initialValue:-1e5,getPrimitiveFunction:function(){t.clippingEllipsoidMinHeightMin=t._voxelPrimitive.minBounds.z}}),n({name:"clippingEllipsoidMinHeightMax",initialValue:0,getPrimitiveFunction:function(){t.clippingEllipsoidMinHeightMax=t._voxelPrimitive.maxBounds.z}}),n({name:"clippingEllipsoidMinHeight",initialValue:0,setPrimitiveFunction:i("minClippingBounds","z"),getPrimitiveFunction:function(){t.clippingEllipsoidMinHeight=t._voxelPrimitive.minClippingBounds.z}}),n({name:"clippingCylinderMaxRadiusMin",initialValue:0,getPrimitiveFunction:function(){t.clippingCylinderMaxRadiusMin=t._voxelPrimitive.minBounds.x}}),n({name:"clippingCylinderMaxRadiusMax",initialValue:1,getPrimitiveFunction:function(){t.clippingCylinderMaxRadiusMax=t._voxelPrimitive.maxBounds.x}}),n({name:"clippingCylinderMaxRadius",initialValue:0,setPrimitiveFunction:i("maxClippingBounds","x"),getPrimitiveFunction:function(){t.clippingCylinderMaxRadius=t._voxelPrimitive.maxClippingBounds.x}}),n({name:"clippingCylinderMinRadiusMin",initialValue:0,getPrimitiveFunction:function(){t.clippingCylinderMinRadiusMin=t._voxelPrimitive.minBounds.x}}),n({name:"clippingCylinderMinRadiusMax",initialValue:1,getPrimitiveFunction:function(){t.clippingCylinderMinRadiusMax=t._voxelPrimitive.maxBounds.x}}),n({name:"clippingCylinderMinRadius",initialValue:0,setPrimitiveFunction:i("minClippingBounds","x"),getPrimitiveFunction:function(){t.clippingCylinderMinRadius=t._voxelPrimitive.minClippingBounds.x}}),n({name:"clippingCylinderMaxAngleMin",initialValue:-W.PI,getPrimitiveFunction:function(){t.clippingCylinderMaxAngleMin=t._voxelPrimitive.minBounds.y}}),n({name:"clippingCylinderMaxAngleMax",initialValue:W.PI,getPrimitiveFunction:function(){t.clippingCylinderMaxAngleMax=t._voxelPrimitive.maxBounds.y}}),n({name:"clippingCylinderMaxAngle",initialValue:0,setPrimitiveFunction:i("maxClippingBounds","y"),getPrimitiveFunction:function(){t.clippingCylinderMaxAngle=t._voxelPrimitive.maxClippingBounds.y}}),n({name:"clippingCylinderMinAngleMin",initialValue:-W.PI}),n({name:"clippingCylinderMinAngleMax",initialValue:W.PI}),n({name:"clippingCylinderMinAngle",initialValue:0,setPrimitiveFunction:i("minClippingBounds","y"),getPrimitiveFunction:function(){t.clippingCylinderMinAngle=t._voxelPrimitive.minClippingBounds.y}}),n({name:"clippingCylinderMaxHeightMin",initialValue:-1,getPrimitiveFunction:function(){t.clippingCylinderMaxHeightMin=t._voxelPrimitive.minBounds.z}}),n({name:"clippingCylinderMaxHeightMax",initialValue:1,getPrimitiveFunction:function(){t.clippingCylinderMaxHeightMax=t._voxelPrimitive.maxBounds.z}}),n({name:"clippingCylinderMaxHeight",initialValue:0,setPrimitiveFunction:i("maxClippingBounds","z"),getPrimitiveFunction:function(){t.clippingCylinderMaxHeight=t._voxelPrimitive.maxClippingBounds.z}}),n({name:"clippingCylinderMinHeightMin",initialValue:-1,getPrimitiveFunction:function(){t.clippingCylinderMinHeightMin=t._voxelPrimitive.minBounds.z}}),n({name:"clippingCylinderMinHeightMax",initialValue:1,getPrimitiveFunction:function(){t.clippingCylinderMinHeightMax=t._voxelPrimitive.maxBounds.z}}),n({name:"clippingCylinderMinHeight",initialValue:0,setPrimitiveFunction:i("minClippingBounds","z"),getPrimitiveFunction:function(){t.clippingCylinderMinHeight=t._voxelPrimitive.minClippingBounds.z}}),n({name:"translationX",initialValue:0,setPrimitiveFunction:function(){t._modelMatrixReady&&H0(t)},getPrimitiveFunction:function(){t.translationX=P.getTranslation(t._voxelPrimitive.modelMatrix,new h).x}}),n({name:"translationY",initialValue:0,setPrimitiveFunction:function(){t._modelMatrixReady&&H0(t)},getPrimitiveFunction:function(){t.translationY=P.getTranslation(t._voxelPrimitive.modelMatrix,new h).y}}),n({name:"translationZ",initialValue:0,setPrimitiveFunction:function(){t._modelMatrixReady&&H0(t)},getPrimitiveFunction:function(){t.translationZ=P.getTranslation(t._voxelPrimitive.modelMatrix,new h).z}}),n({name:"scaleX",initialValue:1,setPrimitiveFunction:function(){t._modelMatrixReady&&H0(t)},getPrimitiveFunction:function(){t.scaleX=P.getScale(t._voxelPrimitive.modelMatrix,new h).x}}),n({name:"scaleY",initialValue:1,setPrimitiveFunction:function(){t._modelMatrixReady&&H0(t)},getPrimitiveFunction:function(){t.scaleY=P.getScale(t._voxelPrimitive.modelMatrix,new h).y}}),n({name:"scaleZ",initialValue:1,setPrimitiveFunction:function(){t._modelMatrixReady&&H0(t)},getPrimitiveFunction:function(){t.scaleZ=P.getScale(t._voxelPrimitive.modelMatrix,new h).z}}),n({name:"angleX",initialValue:0,setPrimitiveFunction:function(){t._modelMatrixReady&&H0(t)}}),n({name:"angleY",initialValue:0,setPrimitiveFunction:function(){t._modelMatrixReady&&H0(t)}}),n({name:"angleZ",initialValue:0,setPrimitiveFunction:function(){t._modelMatrixReady&&H0(t)}})}var y3t=new h,x3t=new h,T3t=new Cc,_3t=new q;function H0(e){let t=h.fromElements(e.translationX,e.translationY,e.translationZ,y3t),n=h.fromElements(e.scaleX,e.scaleY,e.scaleZ,x3t),i=T3t;i.heading=e.angleX,i.pitch=e.angleY,i.roll=e.angleZ;let o=q.fromHeadingPitchRoll(i,_3t),r=q.multiplyByScale(o,n,o);e._voxelPrimitive.modelMatrix=P.fromRotationTranslation(r,t,e._voxelPrimitive.modelMatrix)}Object.defineProperties(Gh.prototype,{scene:{get:function(){return this._scene}},voxelPrimitive:{get:function(){return this._voxelPrimitive},set:function(e){if(l(this._customShaderCompilationRemoveCallback)&&this._customShaderCompilationRemoveCallback(),!l(e))return;this._voxelPrimitive=e;let t=this;t._customShaderCompilationRemoveCallback=t._voxelPrimitive.customShaderCompilationEvent.addEventListener(function(n){let i=t._voxelPrimitive.customShader.fragmentShaderText;t.shaderString=NYe(i),l(n)?(t.shaderCompilationMessage=n.message,t.shaderCompilationSuccess=!1):(t.shaderCompilationMessage="Shader compiled successfully!",t.shaderCompilationSuccess=!0)}),t._modelMatrixReady=!1;for(let n=0;n<t._getPrimitiveFunctions.length;n++)t._getPrimitiveFunctions[n]();t._modelMatrixReady=!0,H0(t)}}});Gh.prototype.toggleInspector=function(){this.inspectorVisible=!this.inspectorVisible};Gh.prototype.toggleDisplay=function(){this.displayVisible=!this.displayVisible};Gh.prototype.toggleTransform=function(){this.transformVisible=!this.transformVisible};Gh.prototype.toggleBounds=function(){this.boundsVisible=!this.boundsVisible};Gh.prototype.toggleClipping=function(){this.clippingVisible=!this.clippingVisible};Gh.prototype.toggleShader=function(){this.shaderVisible=!this.shaderVisible};Gh.prototype.compileShader=function(){l(this._voxelPrimitive)&&(this._voxelPrimitive.customShader=new M0({fragmentShaderText:this.shaderString,uniforms:this._voxelPrimitive.customShader.uniforms}))};Gh.prototype.shaderEditorKeyPress=function(e,t){if(t.keyCode===9){t.preventDefault();let n=t.target,i=n.selectionStart,o=n.selectionEnd,r=o,a=n.value.slice(i,o).split(` +`}return i}function Gh(e){this._scene=e,this._voxelPrimitive=void 0,this._customShaderCompilationRemoveCallback=void 0,this._definedProperties=[],this._getPrimitiveFunctions=[],this._modelMatrixReady=!1;let t=this;function n(o){let{name:r,initialValue:s}=o;t._definedProperties.push(r);let a=o.setPrimitiveFunction;a===!0&&(a=function(u){t._voxelPrimitive[r]=u});let c=o.getPrimitiveFunction;c===!0&&(c=function(){t[r]=t._voxelPrimitive[r]}),l(c)&&t._getPrimitiveFunctions.push(c);let d=Ee.observable();return Ee.defineProperty(t,r,{get:function(){return d()},set:function(u){typeof s=="number"&&typeof u=="string"&&(u=Number(u),isNaN(u)&&(u=s)),typeof s=="boolean"&&typeof u=="number"&&(u=u===1),d(u),l(a)&&l(t._voxelPrimitive)&&(a(u),e.requestRender())}}),t[r]=s,d}function i(o,r){return function(s){let a=t._voxelPrimitive[o].clone();a[r]=s,t._voxelPrimitive[o]=a}}n({name:"inspectorVisible",initialValue:!0}),n({name:"displayVisible",initialValue:!1}),n({name:"transformVisible",initialValue:!1}),n({name:"boundsVisible",initialValue:!1}),n({name:"clippingVisible",initialValue:!1}),n({name:"shaderVisible",initialValue:!1}),n({name:"shaderString",initialValue:"",getPrimitiveFunction:function(){let o=t._voxelPrimitive.customShader.fragmentShaderText;t.shaderString=YYe(o)}}),n({name:"shaderCompilationMessage",initialValue:""}),n({name:"shaderCompilationSuccess",initialValue:!0}),n({name:"depthTest",initialValue:!1,setPrimitiveFunction:!0,getPrimitiveFunction:!0}),n({name:"show",initialValue:!0,setPrimitiveFunction:!0,getPrimitiveFunction:!0}),n({name:"disableUpdate",initialValue:!1,setPrimitiveFunction:!0,getPrimitiveFunction:!0}),n({name:"debugDraw",initialValue:!1,setPrimitiveFunction:!0,getPrimitiveFunction:!0}),n({name:"jitter",initialValue:!0,setPrimitiveFunction:!0,getPrimitiveFunction:!0}),n({name:"nearestSampling",initialValue:!0,setPrimitiveFunction:!0,getPrimitiveFunction:!0}),n({name:"screenSpaceError",initialValue:4,setPrimitiveFunction:!0,getPrimitiveFunction:!0}),n({name:"stepSize",initialValue:1,setPrimitiveFunction:!0,getPrimitiveFunction:!0}),n({name:"shapeIsBox",getPrimitiveFunction:function(){let o=t._voxelPrimitive.shape;t.shapeIsBox=o===Tc.BOX}}),n({name:"shapeIsEllipsoid",getPrimitiveFunction:function(){let o=t._voxelPrimitive.shape;t.shapeIsEllipsoid=o===Tc.ELLIPSOID}}),n({name:"shapeIsCylinder",getPrimitiveFunction:function(){let o=t._voxelPrimitive.shape;t.shapeIsCylinder=o===Tc.CYLINDER}}),n({name:"clippingBoxMaxXMin",initialValue:0,getPrimitiveFunction:function(){t.clippingBoxMaxXMin=t._voxelPrimitive.minBounds.x}}),n({name:"clippingBoxMaxXMax",initialValue:1,getPrimitiveFunction:function(){t.clippingBoxMaxXMax=t._voxelPrimitive.maxBounds.x}}),n({name:"clippingBoxMaxX",initialValue:0,setPrimitiveFunction:i("maxClippingBounds","x"),getPrimitiveFunction:function(){t.clippingBoxMaxX=t._voxelPrimitive.maxClippingBounds.x}}),n({name:"clippingBoxMinXMin",initialValue:0,getPrimitiveFunction:function(){t.clippingBoxMinXMin=t._voxelPrimitive.minBounds.x}}),n({name:"clippingBoxMinXMax",initialValue:1,getPrimitiveFunction:function(){t.clippingBoxMinXMax=t._voxelPrimitive.maxBounds.x}}),n({name:"clippingBoxMinX",initialValue:0,setPrimitiveFunction:i("minClippingBounds","x"),getPrimitiveFunction:function(){t.clippingBoxMinX=t._voxelPrimitive.minClippingBounds.x}}),n({name:"clippingBoxMaxYMin",initialValue:0,getPrimitiveFunction:function(){t.clippingBoxMaxYMin=t._voxelPrimitive.minBounds.y}}),n({name:"clippingBoxMaxYMax",initialValue:1,getPrimitiveFunction:function(){t.clippingBoxMaxYMax=t._voxelPrimitive.maxBounds.y}}),n({name:"clippingBoxMaxY",initialValue:0,setPrimitiveFunction:i("maxClippingBounds","y"),getPrimitiveFunction:function(){t.clippingBoxMaxY=t._voxelPrimitive.maxClippingBounds.y}}),n({name:"clippingBoxMinYMin",initialValue:0,getPrimitiveFunction:function(){t.clippingBoxMinYMin=t._voxelPrimitive.minBounds.y}}),n({name:"clippingBoxMinYMax",initialValue:1,getPrimitiveFunction:function(){t.clippingBoxMinYMax=t._voxelPrimitive.maxBounds.y}}),n({name:"clippingBoxMinY",initialValue:0,setPrimitiveFunction:i("minClippingBounds","y"),getPrimitiveFunction:function(){t.clippingBoxMinY=t._voxelPrimitive.minClippingBounds.y}}),n({name:"clippingBoxMaxZMin",initialValue:0,getPrimitiveFunction:function(){t.clippingBoxMaxZMin=t._voxelPrimitive.minBounds.z}}),n({name:"clippingBoxMaxZMax",initialValue:1,getPrimitiveFunction:function(){t.clippingBoxMaxZMax=t._voxelPrimitive.maxBounds.z}}),n({name:"clippingBoxMaxZ",initialValue:0,setPrimitiveFunction:i("maxClippingBounds","z"),getPrimitiveFunction:function(){t.clippingBoxMaxZ=t._voxelPrimitive.maxClippingBounds.z}}),n({name:"clippingBoxMinZMin",initialValue:0,getPrimitiveFunction:function(){t.clippingBoxMinZMin=t._voxelPrimitive.minBounds.z}}),n({name:"clippingBoxMinZMax",initialValue:1,getPrimitiveFunction:function(){t.clippingBoxMinZMax=t._voxelPrimitive.maxBounds.z}}),n({name:"clippingBoxMinZ",initialValue:0,setPrimitiveFunction:i("minClippingBounds","z"),getPrimitiveFunction:function(){t.clippingBoxMinZ=t._voxelPrimitive.minClippingBounds.z}}),n({name:"clippingEllipsoidMaxLongitudeMin",initialValue:-W.PI,getPrimitiveFunction:function(){t.clippingEllipsoidMaxLongitudeMin=t._voxelPrimitive.minBounds.x}}),n({name:"clippingEllipsoidMaxLongitudeMax",initialValue:W.PI,getPrimitiveFunction:function(){t.clippingEllipsoidMaxLongitudeMax=t._voxelPrimitive.maxBounds.x}}),n({name:"clippingEllipsoidMaxLongitude",initialValue:0,setPrimitiveFunction:i("maxClippingBounds","x"),getPrimitiveFunction:function(){t.clippingEllipsoidMaxLongitude=t._voxelPrimitive.maxClippingBounds.x}}),n({name:"clippingEllipsoidMinLongitudeMin",initialValue:-W.PI,getPrimitiveFunction:function(){t.clippingEllipsoidMinLongitudeMin=t._voxelPrimitive.minBounds.x}}),n({name:"clippingEllipsoidMinLongitudeMax",initialValue:W.PI,getPrimitiveFunction:function(){t.clippingEllipsoidMinLongitudeMax=t._voxelPrimitive.maxBounds.x}}),n({name:"clippingEllipsoidMinLongitude",initialValue:0,setPrimitiveFunction:i("minClippingBounds","x"),getPrimitiveFunction:function(){t.clippingEllipsoidMinLongitude=t._voxelPrimitive.minClippingBounds.x}}),n({name:"clippingEllipsoidMaxLatitudeMin",initialValue:-W.PI_OVER_TWO,getPrimitiveFunction:function(){t.clippingEllipsoidMaxLatitudeMin=t._voxelPrimitive.minBounds.y}}),n({name:"clippingEllipsoidMaxLatitudeMax",initialValue:W.PI_OVER_TWO,getPrimitiveFunction:function(){t.clippingEllipsoidMaxLatitudeMax=t._voxelPrimitive.maxBounds.y}}),n({name:"clippingEllipsoidMaxLatitude",initialValue:0,setPrimitiveFunction:i("maxClippingBounds","y"),getPrimitiveFunction:function(){t.clippingEllipsoidMaxLatitude=t._voxelPrimitive.maxClippingBounds.y}}),n({name:"clippingEllipsoidMinLatitudeMin",initialValue:-W.PI_OVER_TWO,getPrimitiveFunction:function(){t.clippingEllipsoidMinLatitudeMin=t._voxelPrimitive.minBounds.y}}),n({name:"clippingEllipsoidMinLatitudeMax",initialValue:W.PI_OVER_TWO,getPrimitiveFunction:function(){t.clippingEllipsoidMinLatitudeMax=t._voxelPrimitive.maxBounds.y}}),n({name:"clippingEllipsoidMinLatitude",initialValue:0,setPrimitiveFunction:i("minClippingBounds","y"),getPrimitiveFunction:function(){t.clippingEllipsoidMinLatitude=t._voxelPrimitive.minClippingBounds.y}}),n({name:"clippingEllipsoidMaxHeightMin",initialValue:0,getPrimitiveFunction:function(){t.clippingEllipsoidMaxHeightMin=t._voxelPrimitive.minBounds.z}}),n({name:"clippingEllipsoidMaxHeightMax",initialValue:1e5,getPrimitiveFunction:function(){t.clippingEllipsoidMaxHeightMax=t._voxelPrimitive.maxBounds.z}}),n({name:"clippingEllipsoidMaxHeight",initialValue:0,setPrimitiveFunction:i("maxClippingBounds","z"),getPrimitiveFunction:function(){t.clippingEllipsoidMaxHeight=t._voxelPrimitive.maxClippingBounds.z}}),n({name:"clippingEllipsoidMinHeightMin",initialValue:-1e5,getPrimitiveFunction:function(){t.clippingEllipsoidMinHeightMin=t._voxelPrimitive.minBounds.z}}),n({name:"clippingEllipsoidMinHeightMax",initialValue:0,getPrimitiveFunction:function(){t.clippingEllipsoidMinHeightMax=t._voxelPrimitive.maxBounds.z}}),n({name:"clippingEllipsoidMinHeight",initialValue:0,setPrimitiveFunction:i("minClippingBounds","z"),getPrimitiveFunction:function(){t.clippingEllipsoidMinHeight=t._voxelPrimitive.minClippingBounds.z}}),n({name:"clippingCylinderMaxRadiusMin",initialValue:0,getPrimitiveFunction:function(){t.clippingCylinderMaxRadiusMin=t._voxelPrimitive.minBounds.x}}),n({name:"clippingCylinderMaxRadiusMax",initialValue:1,getPrimitiveFunction:function(){t.clippingCylinderMaxRadiusMax=t._voxelPrimitive.maxBounds.x}}),n({name:"clippingCylinderMaxRadius",initialValue:0,setPrimitiveFunction:i("maxClippingBounds","x"),getPrimitiveFunction:function(){t.clippingCylinderMaxRadius=t._voxelPrimitive.maxClippingBounds.x}}),n({name:"clippingCylinderMinRadiusMin",initialValue:0,getPrimitiveFunction:function(){t.clippingCylinderMinRadiusMin=t._voxelPrimitive.minBounds.x}}),n({name:"clippingCylinderMinRadiusMax",initialValue:1,getPrimitiveFunction:function(){t.clippingCylinderMinRadiusMax=t._voxelPrimitive.maxBounds.x}}),n({name:"clippingCylinderMinRadius",initialValue:0,setPrimitiveFunction:i("minClippingBounds","x"),getPrimitiveFunction:function(){t.clippingCylinderMinRadius=t._voxelPrimitive.minClippingBounds.x}}),n({name:"clippingCylinderMaxAngleMin",initialValue:-W.PI,getPrimitiveFunction:function(){t.clippingCylinderMaxAngleMin=t._voxelPrimitive.minBounds.y}}),n({name:"clippingCylinderMaxAngleMax",initialValue:W.PI,getPrimitiveFunction:function(){t.clippingCylinderMaxAngleMax=t._voxelPrimitive.maxBounds.y}}),n({name:"clippingCylinderMaxAngle",initialValue:0,setPrimitiveFunction:i("maxClippingBounds","y"),getPrimitiveFunction:function(){t.clippingCylinderMaxAngle=t._voxelPrimitive.maxClippingBounds.y}}),n({name:"clippingCylinderMinAngleMin",initialValue:-W.PI}),n({name:"clippingCylinderMinAngleMax",initialValue:W.PI}),n({name:"clippingCylinderMinAngle",initialValue:0,setPrimitiveFunction:i("minClippingBounds","y"),getPrimitiveFunction:function(){t.clippingCylinderMinAngle=t._voxelPrimitive.minClippingBounds.y}}),n({name:"clippingCylinderMaxHeightMin",initialValue:-1,getPrimitiveFunction:function(){t.clippingCylinderMaxHeightMin=t._voxelPrimitive.minBounds.z}}),n({name:"clippingCylinderMaxHeightMax",initialValue:1,getPrimitiveFunction:function(){t.clippingCylinderMaxHeightMax=t._voxelPrimitive.maxBounds.z}}),n({name:"clippingCylinderMaxHeight",initialValue:0,setPrimitiveFunction:i("maxClippingBounds","z"),getPrimitiveFunction:function(){t.clippingCylinderMaxHeight=t._voxelPrimitive.maxClippingBounds.z}}),n({name:"clippingCylinderMinHeightMin",initialValue:-1,getPrimitiveFunction:function(){t.clippingCylinderMinHeightMin=t._voxelPrimitive.minBounds.z}}),n({name:"clippingCylinderMinHeightMax",initialValue:1,getPrimitiveFunction:function(){t.clippingCylinderMinHeightMax=t._voxelPrimitive.maxBounds.z}}),n({name:"clippingCylinderMinHeight",initialValue:0,setPrimitiveFunction:i("minClippingBounds","z"),getPrimitiveFunction:function(){t.clippingCylinderMinHeight=t._voxelPrimitive.minClippingBounds.z}}),n({name:"translationX",initialValue:0,setPrimitiveFunction:function(){t._modelMatrixReady&&H0(t)},getPrimitiveFunction:function(){t.translationX=P.getTranslation(t._voxelPrimitive.modelMatrix,new h).x}}),n({name:"translationY",initialValue:0,setPrimitiveFunction:function(){t._modelMatrixReady&&H0(t)},getPrimitiveFunction:function(){t.translationY=P.getTranslation(t._voxelPrimitive.modelMatrix,new h).y}}),n({name:"translationZ",initialValue:0,setPrimitiveFunction:function(){t._modelMatrixReady&&H0(t)},getPrimitiveFunction:function(){t.translationZ=P.getTranslation(t._voxelPrimitive.modelMatrix,new h).z}}),n({name:"scaleX",initialValue:1,setPrimitiveFunction:function(){t._modelMatrixReady&&H0(t)},getPrimitiveFunction:function(){t.scaleX=P.getScale(t._voxelPrimitive.modelMatrix,new h).x}}),n({name:"scaleY",initialValue:1,setPrimitiveFunction:function(){t._modelMatrixReady&&H0(t)},getPrimitiveFunction:function(){t.scaleY=P.getScale(t._voxelPrimitive.modelMatrix,new h).y}}),n({name:"scaleZ",initialValue:1,setPrimitiveFunction:function(){t._modelMatrixReady&&H0(t)},getPrimitiveFunction:function(){t.scaleZ=P.getScale(t._voxelPrimitive.modelMatrix,new h).z}}),n({name:"angleX",initialValue:0,setPrimitiveFunction:function(){t._modelMatrixReady&&H0(t)}}),n({name:"angleY",initialValue:0,setPrimitiveFunction:function(){t._modelMatrixReady&&H0(t)}}),n({name:"angleZ",initialValue:0,setPrimitiveFunction:function(){t._modelMatrixReady&&H0(t)}})}var x3t=new h,T3t=new h,_3t=new Cc,S3t=new q;function H0(e){let t=h.fromElements(e.translationX,e.translationY,e.translationZ,x3t),n=h.fromElements(e.scaleX,e.scaleY,e.scaleZ,T3t),i=_3t;i.heading=e.angleX,i.pitch=e.angleY,i.roll=e.angleZ;let o=q.fromHeadingPitchRoll(i,S3t),r=q.multiplyByScale(o,n,o);e._voxelPrimitive.modelMatrix=P.fromRotationTranslation(r,t,e._voxelPrimitive.modelMatrix)}Object.defineProperties(Gh.prototype,{scene:{get:function(){return this._scene}},voxelPrimitive:{get:function(){return this._voxelPrimitive},set:function(e){if(l(this._customShaderCompilationRemoveCallback)&&this._customShaderCompilationRemoveCallback(),!l(e))return;this._voxelPrimitive=e;let t=this;t._customShaderCompilationRemoveCallback=t._voxelPrimitive.customShaderCompilationEvent.addEventListener(function(n){let i=t._voxelPrimitive.customShader.fragmentShaderText;t.shaderString=YYe(i),l(n)?(t.shaderCompilationMessage=n.message,t.shaderCompilationSuccess=!1):(t.shaderCompilationMessage="Shader compiled successfully!",t.shaderCompilationSuccess=!0)}),t._modelMatrixReady=!1;for(let n=0;n<t._getPrimitiveFunctions.length;n++)t._getPrimitiveFunctions[n]();t._modelMatrixReady=!0,H0(t)}}});Gh.prototype.toggleInspector=function(){this.inspectorVisible=!this.inspectorVisible};Gh.prototype.toggleDisplay=function(){this.displayVisible=!this.displayVisible};Gh.prototype.toggleTransform=function(){this.transformVisible=!this.transformVisible};Gh.prototype.toggleBounds=function(){this.boundsVisible=!this.boundsVisible};Gh.prototype.toggleClipping=function(){this.clippingVisible=!this.clippingVisible};Gh.prototype.toggleShader=function(){this.shaderVisible=!this.shaderVisible};Gh.prototype.compileShader=function(){l(this._voxelPrimitive)&&(this._voxelPrimitive.customShader=new C0({fragmentShaderText:this.shaderString,uniforms:this._voxelPrimitive.customShader.uniforms}))};Gh.prototype.shaderEditorKeyPress=function(e,t){if(t.keyCode===9){t.preventDefault();let n=t.target,i=n.selectionStart,o=n.selectionEnd,r=o,a=n.value.slice(i,o).split(` `),c=a.length,d;if(t.shiftKey)for(d=0;d<c;++d)a[d][0]===" "&&(a[d][1]===" "?(a[d]=a[d].substr(2),r-=2):(a[d]=a[d].substr(1),r-=1));else for(d=0;d<c;++d)a[d]=` ${a[d]}`,r+=2;let u=a.join(` -`);n.value=n.value.slice(0,i)+u+n.value.slice(o),n.selectionStart=i!==o?i:r,n.selectionEnd=r}else t.ctrlKey&&(t.keyCode===10||t.keyCode===13)&&this.compileShader();return!0};Gh.prototype.isDestroyed=function(){return!1};Gh.prototype.destroy=function(){let e=this;return this._definedProperties.forEach(function(t){Ee.getObservable(e,t).dispose()}),ue(this)};var Q5=Gh;function ij(e,t){e=Nn(e);let n=document.createElement("div"),i=new Q5(t);this._viewModel=i,this._container=e,this._element=n;let o=document.createElement("div");o.textContent="Voxel Inspector",o.className="cesium-cesiumInspector-button",o.setAttribute("data-bind","click: toggleInspector"),n.appendChild(o),n.className="cesium-cesiumInspector cesium-VoxelInspector",n.setAttribute("data-bind",'css: { "cesium-cesiumInspector-visible" : inspectorVisible, "cesium-cesiumInspector-hidden" : !inspectorVisible}'),e.appendChild(n);let r=document.createElement("div");r.className="cesium-cesiumInspector-dropDown",n.appendChild(r);let{createSection:s,createCheckbox:a,createRangeInput:c,createButton:d}=fu,u=s(r,"Display","displayVisible","toggleDisplay"),m=s(r,"Transform","transformVisible","toggleTransform"),p=s(r,"Clipping","clippingVisible","toggleClipping"),b=s(r,"Shader","shaderVisible","toggleShader");u.appendChild(a("Depth Test","depthTest")),u.appendChild(a("Show","show")),u.appendChild(a("Disable Update","disableUpdate")),u.appendChild(a("Debug Draw","debugDraw")),u.appendChild(a("Jitter","jitter")),u.appendChild(a("Nearest Sampling","nearestSampling")),u.appendChild(c("Screen Space Error","screenSpaceError",0,128)),u.appendChild(c("Step Size","stepSize",0,2));let f=10,y=10,_=W.PI;m.appendChild(c("Translation X","translationX",-f,+f)),m.appendChild(c("Translation Y","translationY",-f,+f)),m.appendChild(c("Translation Z","translationZ",-f,+f)),m.appendChild(c("Scale X","scaleX",0,+y)),m.appendChild(c("Scale Y","scaleY",0,+y)),m.appendChild(c("Scale Z","scaleZ",0,+y)),m.appendChild(c("Heading","angleX",-_,+_)),m.appendChild(c("Pitch","angleY",-_,+_)),m.appendChild(c("Roll","angleZ",-_,+_)),Zle("Max X","Min X","Max Y","Min Y","Max Z","Min Z","clippingBoxMaxX","clippingBoxMinX","clippingBoxMaxY","clippingBoxMinY","clippingBoxMaxZ","clippingBoxMinZ","shapeIsBox",p),Zle("Max Longitude","Min Longitude","Max Latitude","Min Latitude","Max Height","Min Height","clippingEllipsoidMaxLongitude","clippingEllipsoidMinLongitude","clippingEllipsoidMaxLatitude","clippingEllipsoidMinLatitude","clippingEllipsoidMaxHeight","clippingEllipsoidMinHeight","shapeIsEllipsoid",p),Zle("Max Radius","Min Radius","Max Angle","Min Angle","Max Height","Min Height","clippingCylinderMaxRadius","clippingCylinderMinRadius","clippingCylinderMaxAngle","clippingCylinderMinAngle","clippingCylinderMaxHeight","clippingCylinderMinHeight","shapeIsCylinder",p);let S=document.createElement("div");b.appendChild(S);let Z=document.createElement("textarea");Z.setAttribute("data-bind","textInput: shaderString, event: { keydown: shaderEditorKeyPress }"),S.className="cesium-cesiumInspector-styleEditor",S.appendChild(Z);let R=d("Compile (Ctrl+Enter)","compileShader");S.appendChild(R);let C=document.createElement("label");C.style.display="block",C.setAttribute("data-bind","text: shaderCompilationMessage, style: {color: shaderCompilationSuccess ? 'green' : 'red'}"),S.appendChild(C),Ee.applyBindings(i,n)}Object.defineProperties(ij.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}}});ij.prototype.isDestroyed=function(){return!1};ij.prototype.destroy=function(){return Ee.cleanNode(this._element),this._container.removeChild(this._element),this.viewModel.destroy(),ue(this)};function Zle(e,t,n,i,o,r,s,a,c,d,u,m,p,b){let f=fu.createRangeInputWithDynamicMinMax,y=b.appendChild(document.createElement("div"));y.setAttribute("data-bind",`if: ${p}`),y.appendChild(f(e,s)),y.appendChild(f(t,a)),y.appendChild(f(n,c)),y.appendChild(f(i,d)),y.appendChild(f(o,u)),y.appendChild(f(r,m))}var q5=ij;function S3t(e){let t=document.createElement("div");t.className="cesium-viewer-voxelInspectorContainer",e.container.appendChild(t);let n=new q5(t,e.scene);Object.defineProperties(e,{voxelInspector:{get:function(){return n}}})}var Rle=S3t;globalThis.CESIUM_VERSION="1.145.0";var Z3t="1.145.0";return OYe(R3t);})(); +`);n.value=n.value.slice(0,i)+u+n.value.slice(o),n.selectionStart=i!==o?i:r,n.selectionEnd=r}else t.ctrlKey&&(t.keyCode===10||t.keyCode===13)&&this.compileShader();return!0};Gh.prototype.isDestroyed=function(){return!1};Gh.prototype.destroy=function(){let e=this;return this._definedProperties.forEach(function(t){Ee.getObservable(e,t).dispose()}),ue(this)};var Q5=Gh;function ij(e,t){e=Nn(e);let n=document.createElement("div"),i=new Q5(t);this._viewModel=i,this._container=e,this._element=n;let o=document.createElement("div");o.textContent="Voxel Inspector",o.className="cesium-cesiumInspector-button",o.setAttribute("data-bind","click: toggleInspector"),n.appendChild(o),n.className="cesium-cesiumInspector cesium-VoxelInspector",n.setAttribute("data-bind",'css: { "cesium-cesiumInspector-visible" : inspectorVisible, "cesium-cesiumInspector-hidden" : !inspectorVisible}'),e.appendChild(n);let r=document.createElement("div");r.className="cesium-cesiumInspector-dropDown",n.appendChild(r);let{createSection:s,createCheckbox:a,createRangeInput:c,createButton:d}=fu,u=s(r,"Display","displayVisible","toggleDisplay"),m=s(r,"Transform","transformVisible","toggleTransform"),p=s(r,"Clipping","clippingVisible","toggleClipping"),b=s(r,"Shader","shaderVisible","toggleShader");u.appendChild(a("Depth Test","depthTest")),u.appendChild(a("Show","show")),u.appendChild(a("Disable Update","disableUpdate")),u.appendChild(a("Debug Draw","debugDraw")),u.appendChild(a("Jitter","jitter")),u.appendChild(a("Nearest Sampling","nearestSampling")),u.appendChild(c("Screen Space Error","screenSpaceError",0,128)),u.appendChild(c("Step Size","stepSize",0,2));let f=10,y=10,_=W.PI;m.appendChild(c("Translation X","translationX",-f,+f)),m.appendChild(c("Translation Y","translationY",-f,+f)),m.appendChild(c("Translation Z","translationZ",-f,+f)),m.appendChild(c("Scale X","scaleX",0,+y)),m.appendChild(c("Scale Y","scaleY",0,+y)),m.appendChild(c("Scale Z","scaleZ",0,+y)),m.appendChild(c("Heading","angleX",-_,+_)),m.appendChild(c("Pitch","angleY",-_,+_)),m.appendChild(c("Roll","angleZ",-_,+_)),Zle("Max X","Min X","Max Y","Min Y","Max Z","Min Z","clippingBoxMaxX","clippingBoxMinX","clippingBoxMaxY","clippingBoxMinY","clippingBoxMaxZ","clippingBoxMinZ","shapeIsBox",p),Zle("Max Longitude","Min Longitude","Max Latitude","Min Latitude","Max Height","Min Height","clippingEllipsoidMaxLongitude","clippingEllipsoidMinLongitude","clippingEllipsoidMaxLatitude","clippingEllipsoidMinLatitude","clippingEllipsoidMaxHeight","clippingEllipsoidMinHeight","shapeIsEllipsoid",p),Zle("Max Radius","Min Radius","Max Angle","Min Angle","Max Height","Min Height","clippingCylinderMaxRadius","clippingCylinderMinRadius","clippingCylinderMaxAngle","clippingCylinderMinAngle","clippingCylinderMaxHeight","clippingCylinderMinHeight","shapeIsCylinder",p);let S=document.createElement("div");b.appendChild(S);let Z=document.createElement("textarea");Z.setAttribute("data-bind","textInput: shaderString, event: { keydown: shaderEditorKeyPress }"),S.className="cesium-cesiumInspector-styleEditor",S.appendChild(Z);let R=d("Compile (Ctrl+Enter)","compileShader");S.appendChild(R);let C=document.createElement("label");C.style.display="block",C.setAttribute("data-bind","text: shaderCompilationMessage, style: {color: shaderCompilationSuccess ? 'green' : 'red'}"),S.appendChild(C),Ee.applyBindings(i,n)}Object.defineProperties(ij.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}}});ij.prototype.isDestroyed=function(){return!1};ij.prototype.destroy=function(){return Ee.cleanNode(this._element),this._container.removeChild(this._element),this.viewModel.destroy(),ue(this)};function Zle(e,t,n,i,o,r,s,a,c,d,u,m,p,b){let f=fu.createRangeInputWithDynamicMinMax,y=b.appendChild(document.createElement("div"));y.setAttribute("data-bind",`if: ${p}`),y.appendChild(f(e,s)),y.appendChild(f(t,a)),y.appendChild(f(n,c)),y.appendChild(f(i,d)),y.appendChild(f(o,u)),y.appendChild(f(r,m))}var q5=ij;function Z3t(e){let t=document.createElement("div");t.className="cesium-viewer-voxelInspectorContainer",e.container.appendChild(t);let n=new q5(t,e.scene);Object.defineProperties(e,{voxelInspector:{get:function(){return n}}})}var Rle=Z3t;globalThis.CESIUM_VERSION="1.145.0";var R3t="1.145.0";return BYe(C3t);})(); //# sourceMappingURL=Cesium.js.map diff --git a/plugins/feature/map/Cesium/index.cjs b/plugins/feature/map/Cesium/index.cjs index 9b23abc99..c45da2c2a 100644 --- a/plugins/feature/map/Cesium/index.cjs +++ b/plugins/feature/map/Cesium/index.cjs @@ -23,7 +23,7 @@ * See https://github.com/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details. */ -"use strict";var v3e=Object.create;var iD=Object.defineProperty;var S3e=Object.getOwnPropertyDescriptor;var w3e=Object.getOwnPropertyNames;var I3e=Object.getPrototypeOf,P3e=Object.prototype.hasOwnProperty;var D3e=(e,t,n)=>t in e?iD(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var hs=(e,t,n)=>()=>{if(n)throw n[0];try{return e&&(t=e(e=0)),t}catch(i){throw n=[i],i}};var Yi=(e,t)=>()=>{try{return t||e((t={exports:{}}).exports,t),t.exports}catch(n){throw t=0,n}},Oq=(e,t)=>{for(var n in t)iD(e,n,{get:t[n],enumerable:!0})},tue=(e,t,n,i)=>{if(t&&typeof t=="object"||typeof t=="function")for(let r of w3e(t))!P3e.call(e,r)&&r!==n&&iD(e,r,{get:()=>t[r],enumerable:!(i=S3e(t,r))||i.enumerable});return e};var Qo=(e,t,n)=>(n=e!=null?v3e(I3e(e)):{},tue(t||!e||!e.__esModule?iD(n,"default",{value:e,enumerable:!0}):n,e)),Fh=e=>tue(iD({},"__esModule",{value:!0}),e);var ut=(e,t,n)=>D3e(e,typeof t!="symbol"?t+"":t,n);var mj=Yi((B9t,nue)=>{var eg=function(e){e==null&&(e=new Date().getTime()),this.N=624,this.M=397,this.MATRIX_A=2567483615,this.UPPER_MASK=2147483648,this.LOWER_MASK=2147483647,this.mt=new Array(this.N),this.mti=this.N+1,e.constructor==Array?this.init_by_array(e,e.length):this.init_seed(e)};eg.prototype.init_seed=function(e){for(this.mt[0]=e>>>0,this.mti=1;this.mti<this.N;this.mti++){var e=this.mt[this.mti-1]^this.mt[this.mti-1]>>>30;this.mt[this.mti]=(((e&4294901760)>>>16)*1812433253<<16)+(e&65535)*1812433253+this.mti,this.mt[this.mti]>>>=0}};eg.prototype.init_by_array=function(e,t){var n,i,r;for(this.init_seed(19650218),n=1,i=0,r=this.N>t?this.N:t;r;r--){var o=this.mt[n-1]^this.mt[n-1]>>>30;this.mt[n]=(this.mt[n]^(((o&4294901760)>>>16)*1664525<<16)+(o&65535)*1664525)+e[i]+i,this.mt[n]>>>=0,n++,i++,n>=this.N&&(this.mt[0]=this.mt[this.N-1],n=1),i>=t&&(i=0)}for(r=this.N-1;r;r--){var o=this.mt[n-1]^this.mt[n-1]>>>30;this.mt[n]=(this.mt[n]^(((o&4294901760)>>>16)*1566083941<<16)+(o&65535)*1566083941)-n,this.mt[n]>>>=0,n++,n>=this.N&&(this.mt[0]=this.mt[this.N-1],n=1)}this.mt[0]=2147483648};eg.prototype.random_int=function(){var e,t=new Array(0,this.MATRIX_A);if(this.mti>=this.N){var n;for(this.mti==this.N+1&&this.init_seed(5489),n=0;n<this.N-this.M;n++)e=this.mt[n]&this.UPPER_MASK|this.mt[n+1]&this.LOWER_MASK,this.mt[n]=this.mt[n+this.M]^e>>>1^t[e&1];for(;n<this.N-1;n++)e=this.mt[n]&this.UPPER_MASK|this.mt[n+1]&this.LOWER_MASK,this.mt[n]=this.mt[n+(this.M-this.N)]^e>>>1^t[e&1];e=this.mt[this.N-1]&this.UPPER_MASK|this.mt[0]&this.LOWER_MASK,this.mt[this.N-1]=this.mt[this.M-1]^e>>>1^t[e&1],this.mti=0}return e=this.mt[this.mti++],e^=e>>>11,e^=e<<7&2636928640,e^=e<<15&4022730752,e^=e>>>18,e>>>0};eg.prototype.random_int31=function(){return this.random_int()>>>1};eg.prototype.random_incl=function(){return this.random_int()*(1/4294967295)};eg.prototype.random=function(){return this.random_int()*(1/4294967296)};eg.prototype.random_excl=function(){return(this.random_int()+.5)*(1/4294967296)};eg.prototype.random_long=function(){var e=this.random_int()>>>5,t=this.random_int()>>>6;return(e*67108864+t)*(1/9007199254740992)};nue.exports=eg});var Lue=Yi((cv,lv)=>{/*! https://mths.be/punycode v1.4.0 by @mathias */(function(e){var t=typeof cv=="object"&&cv&&!cv.nodeType&&cv,n=typeof lv=="object"&&lv&&!lv.nodeType&&lv,i=typeof global=="object"&&global;(i.global===i||i.window===i||i.self===i)&&(e=i);var r,o=2147483647,s=36,a=1,c=26,u=38,f=700,d=72,p=128,g="-",m=/^xn--/,y=/[^\x20-\x7E]/,A=/[\x2E\u3002\uFF0E\uFF61]/g,b={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},x=s-a,T=Math.floor,E=String.fromCharCode,v;function S(B){throw new RangeError(b[B])}function I(B,j){for(var k=B.length,G=[];k--;)G[k]=j(B[k]);return G}function R(B,j){var k=B.split("@"),G="";k.length>1&&(G=k[0]+"@",B=k[1]),B=B.replace(A,".");var q=B.split("."),Q=I(q,j).join(".");return G+Q}function O(B){for(var j=[],k=0,G=B.length,q,Q;k<G;)q=B.charCodeAt(k++),q>=55296&&q<=56319&&k<G?(Q=B.charCodeAt(k++),(Q&64512)==56320?j.push(((q&1023)<<10)+(Q&1023)+65536):(j.push(q),k--)):j.push(q);return j}function L(B){return I(B,function(j){var k="";return j>65535&&(j-=65536,k+=E(j>>>10&1023|55296),j=56320|j&1023),k+=E(j),k}).join("")}function _(B){return B-48<10?B-22:B-65<26?B-65:B-97<26?B-97:s}function C(B,j){return B+22+75*(B<26)-((j!=0)<<5)}function w(B,j,k){var G=0;for(B=k?T(B/f):B>>1,B+=T(B/j);B>x*c>>1;G+=s)B=T(B/x);return T(G+(x+1)*B/(B+u))}function P(B){var j=[],k=B.length,G,q=0,Q=p,W=d,J,Z,ae,Ae,fe,xe,ge,we,Se;for(J=B.lastIndexOf(g),J<0&&(J=0),Z=0;Z<J;++Z)B.charCodeAt(Z)>=128&&S("not-basic"),j.push(B.charCodeAt(Z));for(ae=J>0?J+1:0;ae<k;){for(Ae=q,fe=1,xe=s;ae>=k&&S("invalid-input"),ge=_(B.charCodeAt(ae++)),(ge>=s||ge>T((o-q)/fe))&&S("overflow"),q+=ge*fe,we=xe<=W?a:xe>=W+c?c:xe-W,!(ge<we);xe+=s)Se=s-we,fe>T(o/Se)&&S("overflow"),fe*=Se;G=j.length+1,W=w(q-Ae,G,Ae==0),T(q/G)>o-Q&&S("overflow"),Q+=T(q/G),q%=G,j.splice(q++,0,Q)}return L(j)}function M(B){var j,k,G,q,Q,W,J,Z,ae,Ae,fe,xe=[],ge,we,Se,Re;for(B=O(B),ge=B.length,j=p,k=0,Q=d,W=0;W<ge;++W)fe=B[W],fe<128&&xe.push(E(fe));for(G=q=xe.length,q&&xe.push(g);G<ge;){for(J=o,W=0;W<ge;++W)fe=B[W],fe>=j&&fe<J&&(J=fe);for(we=G+1,J-j>T((o-k)/we)&&S("overflow"),k+=(J-j)*we,j=J,W=0;W<ge;++W)if(fe=B[W],fe<j&&++k>o&&S("overflow"),fe==j){for(Z=k,ae=s;Ae=ae<=Q?a:ae>=Q+c?c:ae-Q,!(Z<Ae);ae+=s)Re=Z-Ae,Se=s-Ae,xe.push(E(C(Ae+Re%Se,0))),Z=T(Re/Se);xe.push(E(C(Z,0))),Q=w(k,we,G==q),k=0,++G}++k,++j}return xe.join("")}function F(B){return R(B,function(j){return m.test(j)?P(j.slice(4).toLowerCase()):j})}function V(B){return R(B,function(j){return y.test(j)?"xn--"+M(j):j})}if(r={version:"1.3.2",ucs2:{decode:O,encode:L},decode:P,encode:M,toASCII:V,toUnicode:F},typeof define=="function"&&typeof define.amd=="object"&&define.amd)define("punycode",function(){return r});else if(t&&n)if(lv.exports==t)n.exports=r;else for(v in r)r.hasOwnProperty(v)&&(t[v]=r[v]);else e.punycode=r})(cv)});var Bue=Yi((Fue,Nj)=>{/*! +"use strict";var S3e=Object.create;var iD=Object.defineProperty;var w3e=Object.getOwnPropertyDescriptor;var I3e=Object.getOwnPropertyNames;var P3e=Object.getPrototypeOf,D3e=Object.prototype.hasOwnProperty;var R3e=(e,t,n)=>t in e?iD(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var hs=(e,t,n)=>()=>{if(n)throw n[0];try{return e&&(t=e(e=0)),t}catch(i){throw n=[i],i}};var Yi=(e,t)=>()=>{try{return t||e((t={exports:{}}).exports,t),t.exports}catch(n){throw t=0,n}},Oq=(e,t)=>{for(var n in t)iD(e,n,{get:t[n],enumerable:!0})},tue=(e,t,n,i)=>{if(t&&typeof t=="object"||typeof t=="function")for(let r of I3e(t))!D3e.call(e,r)&&r!==n&&iD(e,r,{get:()=>t[r],enumerable:!(i=w3e(t,r))||i.enumerable});return e};var Qo=(e,t,n)=>(n=e!=null?S3e(P3e(e)):{},tue(t||!e||!e.__esModule?iD(n,"default",{value:e,enumerable:!0}):n,e)),Fh=e=>tue(iD({},"__esModule",{value:!0}),e);var ut=(e,t,n)=>R3e(e,typeof t!="symbol"?t+"":t,n);var mj=Yi((k9t,nue)=>{var eg=function(e){e==null&&(e=new Date().getTime()),this.N=624,this.M=397,this.MATRIX_A=2567483615,this.UPPER_MASK=2147483648,this.LOWER_MASK=2147483647,this.mt=new Array(this.N),this.mti=this.N+1,e.constructor==Array?this.init_by_array(e,e.length):this.init_seed(e)};eg.prototype.init_seed=function(e){for(this.mt[0]=e>>>0,this.mti=1;this.mti<this.N;this.mti++){var e=this.mt[this.mti-1]^this.mt[this.mti-1]>>>30;this.mt[this.mti]=(((e&4294901760)>>>16)*1812433253<<16)+(e&65535)*1812433253+this.mti,this.mt[this.mti]>>>=0}};eg.prototype.init_by_array=function(e,t){var n,i,r;for(this.init_seed(19650218),n=1,i=0,r=this.N>t?this.N:t;r;r--){var o=this.mt[n-1]^this.mt[n-1]>>>30;this.mt[n]=(this.mt[n]^(((o&4294901760)>>>16)*1664525<<16)+(o&65535)*1664525)+e[i]+i,this.mt[n]>>>=0,n++,i++,n>=this.N&&(this.mt[0]=this.mt[this.N-1],n=1),i>=t&&(i=0)}for(r=this.N-1;r;r--){var o=this.mt[n-1]^this.mt[n-1]>>>30;this.mt[n]=(this.mt[n]^(((o&4294901760)>>>16)*1566083941<<16)+(o&65535)*1566083941)-n,this.mt[n]>>>=0,n++,n>=this.N&&(this.mt[0]=this.mt[this.N-1],n=1)}this.mt[0]=2147483648};eg.prototype.random_int=function(){var e,t=new Array(0,this.MATRIX_A);if(this.mti>=this.N){var n;for(this.mti==this.N+1&&this.init_seed(5489),n=0;n<this.N-this.M;n++)e=this.mt[n]&this.UPPER_MASK|this.mt[n+1]&this.LOWER_MASK,this.mt[n]=this.mt[n+this.M]^e>>>1^t[e&1];for(;n<this.N-1;n++)e=this.mt[n]&this.UPPER_MASK|this.mt[n+1]&this.LOWER_MASK,this.mt[n]=this.mt[n+(this.M-this.N)]^e>>>1^t[e&1];e=this.mt[this.N-1]&this.UPPER_MASK|this.mt[0]&this.LOWER_MASK,this.mt[this.N-1]=this.mt[this.M-1]^e>>>1^t[e&1],this.mti=0}return e=this.mt[this.mti++],e^=e>>>11,e^=e<<7&2636928640,e^=e<<15&4022730752,e^=e>>>18,e>>>0};eg.prototype.random_int31=function(){return this.random_int()>>>1};eg.prototype.random_incl=function(){return this.random_int()*(1/4294967295)};eg.prototype.random=function(){return this.random_int()*(1/4294967296)};eg.prototype.random_excl=function(){return(this.random_int()+.5)*(1/4294967296)};eg.prototype.random_long=function(){var e=this.random_int()>>>5,t=this.random_int()>>>6;return(e*67108864+t)*(1/9007199254740992)};nue.exports=eg});var Lue=Yi((cv,lv)=>{/*! https://mths.be/punycode v1.4.0 by @mathias */(function(e){var t=typeof cv=="object"&&cv&&!cv.nodeType&&cv,n=typeof lv=="object"&&lv&&!lv.nodeType&&lv,i=typeof global=="object"&&global;(i.global===i||i.window===i||i.self===i)&&(e=i);var r,o=2147483647,s=36,a=1,c=26,u=38,f=700,d=72,p=128,g="-",m=/^xn--/,y=/[^\x20-\x7E]/,A=/[\x2E\u3002\uFF0E\uFF61]/g,b={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},x=s-a,T=Math.floor,E=String.fromCharCode,v;function S(B){throw new RangeError(b[B])}function I(B,j){for(var k=B.length,G=[];k--;)G[k]=j(B[k]);return G}function R(B,j){var k=B.split("@"),G="";k.length>1&&(G=k[0]+"@",B=k[1]),B=B.replace(A,".");var q=B.split("."),Q=I(q,j).join(".");return G+Q}function O(B){for(var j=[],k=0,G=B.length,q,Q;k<G;)q=B.charCodeAt(k++),q>=55296&&q<=56319&&k<G?(Q=B.charCodeAt(k++),(Q&64512)==56320?j.push(((q&1023)<<10)+(Q&1023)+65536):(j.push(q),k--)):j.push(q);return j}function L(B){return I(B,function(j){var k="";return j>65535&&(j-=65536,k+=E(j>>>10&1023|55296),j=56320|j&1023),k+=E(j),k}).join("")}function _(B){return B-48<10?B-22:B-65<26?B-65:B-97<26?B-97:s}function C(B,j){return B+22+75*(B<26)-((j!=0)<<5)}function w(B,j,k){var G=0;for(B=k?T(B/f):B>>1,B+=T(B/j);B>x*c>>1;G+=s)B=T(B/x);return T(G+(x+1)*B/(B+u))}function P(B){var j=[],k=B.length,G,q=0,Q=p,W=d,J,Z,ae,Ae,fe,xe,ge,we,Se;for(J=B.lastIndexOf(g),J<0&&(J=0),Z=0;Z<J;++Z)B.charCodeAt(Z)>=128&&S("not-basic"),j.push(B.charCodeAt(Z));for(ae=J>0?J+1:0;ae<k;){for(Ae=q,fe=1,xe=s;ae>=k&&S("invalid-input"),ge=_(B.charCodeAt(ae++)),(ge>=s||ge>T((o-q)/fe))&&S("overflow"),q+=ge*fe,we=xe<=W?a:xe>=W+c?c:xe-W,!(ge<we);xe+=s)Se=s-we,fe>T(o/Se)&&S("overflow"),fe*=Se;G=j.length+1,W=w(q-Ae,G,Ae==0),T(q/G)>o-Q&&S("overflow"),Q+=T(q/G),q%=G,j.splice(q++,0,Q)}return L(j)}function M(B){var j,k,G,q,Q,W,J,Z,ae,Ae,fe,xe=[],ge,we,Se,Re;for(B=O(B),ge=B.length,j=p,k=0,Q=d,W=0;W<ge;++W)fe=B[W],fe<128&&xe.push(E(fe));for(G=q=xe.length,q&&xe.push(g);G<ge;){for(J=o,W=0;W<ge;++W)fe=B[W],fe>=j&&fe<J&&(J=fe);for(we=G+1,J-j>T((o-k)/we)&&S("overflow"),k+=(J-j)*we,j=J,W=0;W<ge;++W)if(fe=B[W],fe<j&&++k>o&&S("overflow"),fe==j){for(Z=k,ae=s;Ae=ae<=Q?a:ae>=Q+c?c:ae-Q,!(Z<Ae);ae+=s)Re=Z-Ae,Se=s-Ae,xe.push(E(C(Ae+Re%Se,0))),Z=T(Re/Se);xe.push(E(C(Z,0))),Q=w(k,we,G==q),k=0,++G}++k,++j}return xe.join("")}function F(B){return R(B,function(j){return m.test(j)?P(j.slice(4).toLowerCase()):j})}function V(B){return R(B,function(j){return y.test(j)?"xn--"+M(j):j})}if(r={version:"1.3.2",ucs2:{decode:O,encode:L},decode:P,encode:M,toASCII:V,toUnicode:F},typeof define=="function"&&typeof define.amd=="object"&&define.amd)define("punycode",function(){return r});else if(t&&n)if(lv.exports==t)n.exports=r;else for(v in r)r.hasOwnProperty(v)&&(t[v]=r[v]);else e.punycode=r})(cv)});var Bue=Yi((Fue,Nj)=>{/*! * URI.js - Mutating URLs * IPv6 Support * @@ -58,26 +58,26 @@ * Licensed under * MIT License http://www.opensource.org/licenses/mit-license * - */(function(e,t){"use strict";typeof Fj=="object"&&Fj.exports?Fj.exports=t(Lue(),Bue(),Uue()):typeof define=="function"&&define.amd?define(["./punycode","./IPv6","./SecondLevelDomains"],t):e.URI=t(e.punycode,e.IPv6,e.SecondLevelDomains,e)})(zue,function(e,t,n,i){"use strict";var r=i&&i.URI;function o(C,w){var P=arguments.length>=1,M=arguments.length>=2;if(!(this instanceof o))return P?M?new o(C,w):new o(C):new o;if(C===void 0){if(P)throw new TypeError("undefined is not a valid argument for URI");typeof location<"u"?C=location.href+"":C=""}if(C===null&&P)throw new TypeError("null is not a valid argument for URI");return this.href(C),w!==void 0?this.absoluteTo(w):this}function s(C){return/^[0-9]+$/.test(C)}o.version="1.19.11";var a=o.prototype,c=Object.prototype.hasOwnProperty;function u(C){return C.replace(/([.*+?^=!:${}()|[\]\/\\])/g,"\\$1")}function f(C){return C===void 0?"Undefined":String(Object.prototype.toString.call(C)).slice(8,-1)}function d(C){return f(C)==="Array"}function p(C,w){var P={},M,F;if(f(w)==="RegExp")P=null;else if(d(w))for(M=0,F=w.length;M<F;M++)P[w[M]]=!0;else P[w]=!0;for(M=0,F=C.length;M<F;M++){var V=P&&P[C[M]]!==void 0||!P&&w.test(C[M]);V&&(C.splice(M,1),F--,M--)}return C}function g(C,w){var P,M;if(d(w)){for(P=0,M=w.length;P<M;P++)if(!g(C,w[P]))return!1;return!0}var F=f(w);for(P=0,M=C.length;P<M;P++)if(F==="RegExp"){if(typeof C[P]=="string"&&C[P].match(w))return!0}else if(C[P]===w)return!0;return!1}function m(C,w){if(!d(C)||!d(w)||C.length!==w.length)return!1;C.sort(),w.sort();for(var P=0,M=C.length;P<M;P++)if(C[P]!==w[P])return!1;return!0}function y(C){var w=/^\/+|\/+$/g;return C.replace(w,"")}o._parts=function(){return{protocol:null,username:null,password:null,hostname:null,urn:null,port:null,path:null,query:null,fragment:null,preventInvalidHostname:o.preventInvalidHostname,duplicateQueryParameters:o.duplicateQueryParameters,escapeQuerySpace:o.escapeQuerySpace}},o.preventInvalidHostname=!1,o.duplicateQueryParameters=!1,o.escapeQuerySpace=!0,o.protocol_expression=/^[a-z][a-z0-9.+-]*$/i,o.idn_expression=/[^a-z0-9\._-]/i,o.punycode_expression=/(xn--)/i,o.ip4_expression=/^\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}$/,o.ip6_expression=/^\s*((([0-9A-Fa-f]{1,4}:){7}([0-9A-Fa-f]{1,4}|:))|(([0-9A-Fa-f]{1,4}:){6}(:[0-9A-Fa-f]{1,4}|((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9A-Fa-f]{1,4}:){5}(((:[0-9A-Fa-f]{1,4}){1,2})|:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9A-Fa-f]{1,4}:){4}(((:[0-9A-Fa-f]{1,4}){1,3})|((:[0-9A-Fa-f]{1,4})?:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){3}(((:[0-9A-Fa-f]{1,4}){1,4})|((:[0-9A-Fa-f]{1,4}){0,2}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){2}(((:[0-9A-Fa-f]{1,4}){1,5})|((:[0-9A-Fa-f]{1,4}){0,3}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){1}(((:[0-9A-Fa-f]{1,4}){1,6})|((:[0-9A-Fa-f]{1,4}){0,4}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(:(((:[0-9A-Fa-f]{1,4}){1,7})|((:[0-9A-Fa-f]{1,4}){0,5}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:)))(%.+)?\s*$/,o.find_uri_expression=/\b((?:[a-z][\w-]+:(?:\/{1,3}|[a-z0-9%])|www\d{0,3}[.]|[a-z0-9.\-]+[.][a-z]{2,4}\/)(?:[^\s()<>]+|\(([^\s()<>]+|(\([^\s()<>]+\)))*\))+(?:\(([^\s()<>]+|(\([^\s()<>]+\)))*\)|[^\s`!()\[\]{};:'".,<>?«»“”‘’]))/ig,o.findUri={start:/\b(?:([a-z][a-z0-9.+-]*:\/\/)|www\.)/gi,end:/[\s\r\n]|$/,trim:/[`!()\[\]{};:'".,<>?«»“”„‘’]+$/,parens:/(\([^\)]*\)|\[[^\]]*\]|\{[^}]*\}|<[^>]*>)/g},o.leading_whitespace_expression=/^[\x00-\x20\u00a0\u1680\u2000-\u200a\u2028\u2029\u202f\u205f\u3000\ufeff]+/,o.ascii_tab_whitespace=/[\u0009\u000A\u000D]+/g,o.defaultPorts={http:"80",https:"443",ftp:"21",gopher:"70",ws:"80",wss:"443"},o.hostProtocols=["http","https"],o.invalid_hostname_characters=/[^a-zA-Z0-9\.\-:_]/,o.domAttributes={a:"href",blockquote:"cite",link:"href",base:"href",script:"src",form:"action",img:"src",area:"href",iframe:"src",embed:"src",source:"src",track:"src",input:"src",audio:"src",video:"src"},o.getDomAttribute=function(C){if(!(!C||!C.nodeName)){var w=C.nodeName.toLowerCase();if(!(w==="input"&&C.type!=="image"))return o.domAttributes[w]}};function A(C){return escape(C)}function b(C){return encodeURIComponent(C).replace(/[!'()*]/g,A).replace(/\*/g,"%2A")}o.encode=b,o.decode=decodeURIComponent,o.iso8859=function(){o.encode=escape,o.decode=unescape},o.unicode=function(){o.encode=b,o.decode=decodeURIComponent},o.characters={pathname:{encode:{expression:/%(24|26|2B|2C|3B|3D|3A|40)/ig,map:{"%24":"$","%26":"&","%2B":"+","%2C":",","%3B":";","%3D":"=","%3A":":","%40":"@"}},decode:{expression:/[\/\?#]/g,map:{"/":"%2F","?":"%3F","#":"%23"}}},reserved:{encode:{expression:/%(21|23|24|26|27|28|29|2A|2B|2C|2F|3A|3B|3D|3F|40|5B|5D)/ig,map:{"%3A":":","%2F":"/","%3F":"?","%23":"#","%5B":"[","%5D":"]","%40":"@","%21":"!","%24":"$","%26":"&","%27":"'","%28":"(","%29":")","%2A":"*","%2B":"+","%2C":",","%3B":";","%3D":"="}}},urnpath:{encode:{expression:/%(21|24|27|28|29|2A|2B|2C|3B|3D|40)/ig,map:{"%21":"!","%24":"$","%27":"'","%28":"(","%29":")","%2A":"*","%2B":"+","%2C":",","%3B":";","%3D":"=","%40":"@"}},decode:{expression:/[\/\?#:]/g,map:{"/":"%2F","?":"%3F","#":"%23",":":"%3A"}}}},o.encodeQuery=function(C,w){var P=o.encode(C+"");return w===void 0&&(w=o.escapeQuerySpace),w?P.replace(/%20/g,"+"):P},o.decodeQuery=function(C,w){C+="",w===void 0&&(w=o.escapeQuerySpace);try{return o.decode(w?C.replace(/\+/g,"%20"):C)}catch{return C}};var x={encode:"encode",decode:"decode"},T,E=function(C,w){return function(P){try{return o[w](P+"").replace(o.characters[C][w].expression,function(M){return o.characters[C][w].map[M]})}catch{return P}}};for(T in x)o[T+"PathSegment"]=E("pathname",x[T]),o[T+"UrnPathSegment"]=E("urnpath",x[T]);var v=function(C,w,P){return function(M){var F;P?F=function(k){return o[w](o[P](k))}:F=o[w];for(var V=(M+"").split(C),B=0,j=V.length;B<j;B++)V[B]=F(V[B]);return V.join(C)}};o.decodePath=v("/","decodePathSegment"),o.decodeUrnPath=v(":","decodeUrnPathSegment"),o.recodePath=v("/","encodePathSegment","decode"),o.recodeUrnPath=v(":","encodeUrnPathSegment","decode"),o.encodeReserved=E("reserved","encode"),o.parse=function(C,w){var P;return w||(w={preventInvalidHostname:o.preventInvalidHostname}),C=C.replace(o.leading_whitespace_expression,""),C=C.replace(o.ascii_tab_whitespace,""),P=C.indexOf("#"),P>-1&&(w.fragment=C.substring(P+1)||null,C=C.substring(0,P)),P=C.indexOf("?"),P>-1&&(w.query=C.substring(P+1)||null,C=C.substring(0,P)),C=C.replace(/^(https?|ftp|wss?)?:+[/\\]*/i,"$1://"),C=C.replace(/^[/\\]{2,}/i,"//"),C.substring(0,2)==="//"?(w.protocol=null,C=C.substring(2),C=o.parseAuthority(C,w)):(P=C.indexOf(":"),P>-1&&(w.protocol=C.substring(0,P)||null,w.protocol&&!w.protocol.match(o.protocol_expression)?w.protocol=void 0:C.substring(P+1,P+3).replace(/\\/g,"/")==="//"?(C=C.substring(P+3),C=o.parseAuthority(C,w)):(C=C.substring(P+1),w.urn=!0))),w.path=C,w},o.parseHost=function(C,w){C||(C=""),C=C.replace(/\\/g,"/");var P=C.indexOf("/"),M,F;if(P===-1&&(P=C.length),C.charAt(0)==="[")M=C.indexOf("]"),w.hostname=C.substring(1,M)||null,w.port=C.substring(M+2,P)||null,w.port==="/"&&(w.port=null);else{var V=C.indexOf(":"),B=C.indexOf("/"),j=C.indexOf(":",V+1);j!==-1&&(B===-1||j<B)?(w.hostname=C.substring(0,P)||null,w.port=null):(F=C.substring(0,P).split(":"),w.hostname=F[0]||null,w.port=F[1]||null)}return w.hostname&&C.substring(P).charAt(0)!=="/"&&(P++,C="/"+C),w.preventInvalidHostname&&o.ensureValidHostname(w.hostname,w.protocol),w.port&&o.ensureValidPort(w.port),C.substring(P)||"/"},o.parseAuthority=function(C,w){return C=o.parseUserinfo(C,w),o.parseHost(C,w)},o.parseUserinfo=function(C,w){var P=C,M=C.indexOf("\\");M!==-1&&(C=C.replace(/\\/g,"/"));var F=C.indexOf("/"),V=C.lastIndexOf("@",F>-1?F:C.length-1),B;return V>-1&&(F===-1||V<F)?(B=C.substring(0,V).split(":"),w.username=B[0]?o.decode(B[0]):null,B.shift(),w.password=B[0]?o.decode(B.join(":")):null,C=P.substring(V+1)):(w.username=null,w.password=null),C},o.parseQuery=function(C,w){if(!C)return{};if(C=C.replace(/&+/g,"&").replace(/^\?*&*|&+$/g,""),!C)return{};for(var P={},M=C.split("&"),F=M.length,V,B,j,k=0;k<F;k++)V=M[k].split("="),B=o.decodeQuery(V.shift(),w),j=V.length?o.decodeQuery(V.join("="),w):null,B!=="__proto__"&&(c.call(P,B)?((typeof P[B]=="string"||P[B]===null)&&(P[B]=[P[B]]),P[B].push(j)):P[B]=j);return P},o.build=function(C){var w="",P=!1;return C.protocol&&(w+=C.protocol+":"),!C.urn&&(w||C.hostname)&&(w+="//",P=!0),w+=o.buildAuthority(C)||"",typeof C.path=="string"&&(C.path.charAt(0)!=="/"&&P&&(w+="/"),w+=C.path),typeof C.query=="string"&&C.query&&(w+="?"+C.query),typeof C.fragment=="string"&&C.fragment&&(w+="#"+C.fragment),w},o.buildHost=function(C){var w="";if(C.hostname)o.ip6_expression.test(C.hostname)?w+="["+C.hostname+"]":w+=C.hostname;else return"";return C.port&&(w+=":"+C.port),w},o.buildAuthority=function(C){return o.buildUserinfo(C)+o.buildHost(C)},o.buildUserinfo=function(C){var w="";return C.username&&(w+=o.encode(C.username)),C.password&&(w+=":"+o.encode(C.password)),w&&(w+="@"),w},o.buildQuery=function(C,w,P){var M="",F,V,B,j;for(V in C)if(V!=="__proto__"&&c.call(C,V))if(d(C[V]))for(F={},B=0,j=C[V].length;B<j;B++)C[V][B]!==void 0&&F[C[V][B]+""]===void 0&&(M+="&"+o.buildQueryParameter(V,C[V][B],P),w!==!0&&(F[C[V][B]+""]=!0));else C[V]!==void 0&&(M+="&"+o.buildQueryParameter(V,C[V],P));return M.substring(1)},o.buildQueryParameter=function(C,w,P){return o.encodeQuery(C,P)+(w!==null?"="+o.encodeQuery(w,P):"")},o.addQuery=function(C,w,P){if(typeof w=="object")for(var M in w)c.call(w,M)&&o.addQuery(C,M,w[M]);else if(typeof w=="string"){if(C[w]===void 0){C[w]=P;return}else typeof C[w]=="string"&&(C[w]=[C[w]]);d(P)||(P=[P]),C[w]=(C[w]||[]).concat(P)}else throw new TypeError("URI.addQuery() accepts an object, string as the name parameter")},o.setQuery=function(C,w,P){if(typeof w=="object")for(var M in w)c.call(w,M)&&o.setQuery(C,M,w[M]);else if(typeof w=="string")C[w]=P===void 0?null:P;else throw new TypeError("URI.setQuery() accepts an object, string as the name parameter")},o.removeQuery=function(C,w,P){var M,F,V;if(d(w))for(M=0,F=w.length;M<F;M++)C[w[M]]=void 0;else if(f(w)==="RegExp")for(V in C)w.test(V)&&(C[V]=void 0);else if(typeof w=="object")for(V in w)c.call(w,V)&&o.removeQuery(C,V,w[V]);else if(typeof w=="string")P!==void 0?f(P)==="RegExp"?!d(C[w])&&P.test(C[w])?C[w]=void 0:C[w]=p(C[w],P):C[w]===String(P)&&(!d(P)||P.length===1)?C[w]=void 0:d(C[w])&&(C[w]=p(C[w],P)):C[w]=void 0;else throw new TypeError("URI.removeQuery() accepts an object, string, RegExp as the first parameter")},o.hasQuery=function(C,w,P,M){switch(f(w)){case"String":break;case"RegExp":for(var F in C)if(c.call(C,F)&&w.test(F)&&(P===void 0||o.hasQuery(C,F,P)))return!0;return!1;case"Object":for(var V in w)if(c.call(w,V)&&!o.hasQuery(C,V,w[V]))return!1;return!0;default:throw new TypeError("URI.hasQuery() accepts a string, regular expression or object as the name parameter")}switch(f(P)){case"Undefined":return w in C;case"Boolean":var B=!!(d(C[w])?C[w].length:C[w]);return P===B;case"Function":return!!P(C[w],w,C);case"Array":if(!d(C[w]))return!1;var j=M?g:m;return j(C[w],P);case"RegExp":return d(C[w])?M?g(C[w],P):!1:!!(C[w]&&C[w].match(P));case"Number":P=String(P);case"String":return d(C[w])?M?g(C[w],P):!1:C[w]===P;default:throw new TypeError("URI.hasQuery() accepts undefined, boolean, string, number, RegExp, Function as the value parameter")}},o.joinPaths=function(){for(var C=[],w=[],P=0,M=0;M<arguments.length;M++){var F=new o(arguments[M]);C.push(F);for(var V=F.segment(),B=0;B<V.length;B++)typeof V[B]=="string"&&w.push(V[B]),V[B]&&P++}if(!w.length||!P)return new o("");var j=new o("").segment(w);return(C[0].path()===""||C[0].path().slice(0,1)==="/")&&j.path("/"+j.path()),j.normalize()},o.commonPath=function(C,w){var P=Math.min(C.length,w.length),M;for(M=0;M<P;M++)if(C.charAt(M)!==w.charAt(M)){M--;break}return M<1?C.charAt(0)===w.charAt(0)&&C.charAt(0)==="/"?"/":"":((C.charAt(M)!=="/"||w.charAt(M)!=="/")&&(M=C.substring(0,M).lastIndexOf("/")),C.substring(0,M+1))},o.withinString=function(C,w,P){P||(P={});var M=P.start||o.findUri.start,F=P.end||o.findUri.end,V=P.trim||o.findUri.trim,B=P.parens||o.findUri.parens,j=/[a-z0-9-]=["']?$/i;for(M.lastIndex=0;;){var k=M.exec(C);if(!k)break;var G=k.index;if(P.ignoreHtml){var q=C.slice(Math.max(G-3,0),G);if(q&&j.test(q))continue}for(var Q=G+C.slice(G).search(F),W=C.slice(G,Q),J=-1;;){var Z=B.exec(W);if(!Z)break;var ae=Z.index+Z[0].length;J=Math.max(J,ae)}if(J>-1?W=W.slice(0,J)+W.slice(J).replace(V,""):W=W.replace(V,""),!(W.length<=k[0].length)&&!(P.ignore&&P.ignore.test(W))){Q=G+W.length;var Ae=w(W,G,Q,C);if(Ae===void 0){M.lastIndex=Q;continue}Ae=String(Ae),C=C.slice(0,G)+Ae+C.slice(Q),M.lastIndex=G+Ae.length}}return M.lastIndex=0,C},o.ensureValidHostname=function(C,w){var P=!!C,M=!!w,F=!1;if(M&&(F=g(o.hostProtocols,w)),F&&!P)throw new TypeError("Hostname cannot be empty, if protocol is "+w);if(C&&C.match(o.invalid_hostname_characters)){if(!e)throw new TypeError('Hostname "'+C+'" contains characters other than [A-Z0-9.-:_] and Punycode.js is not available');if(e.toASCII(C).match(o.invalid_hostname_characters))throw new TypeError('Hostname "'+C+'" contains characters other than [A-Z0-9.-:_]')}},o.ensureValidPort=function(C){if(C){var w=Number(C);if(!(s(w)&&w>0&&w<65536))throw new TypeError('Port "'+C+'" is not a valid port')}},o.noConflict=function(C){if(C){var w={URI:this.noConflict()};return i.URITemplate&&typeof i.URITemplate.noConflict=="function"&&(w.URITemplate=i.URITemplate.noConflict()),i.IPv6&&typeof i.IPv6.noConflict=="function"&&(w.IPv6=i.IPv6.noConflict()),i.SecondLevelDomains&&typeof i.SecondLevelDomains.noConflict=="function"&&(w.SecondLevelDomains=i.SecondLevelDomains.noConflict()),w}else i.URI===this&&(i.URI=r);return this},a.build=function(C){return C===!0?this._deferred_build=!0:(C===void 0||this._deferred_build)&&(this._string=o.build(this._parts),this._deferred_build=!1),this},a.clone=function(){return new o(this)},a.valueOf=a.toString=function(){return this.build(!1)._string};function S(C){return function(w,P){return w===void 0?this._parts[C]||"":(this._parts[C]=w||null,this.build(!P),this)}}function I(C,w){return function(P,M){return P===void 0?this._parts[C]||"":(P!==null&&(P=P+"",P.charAt(0)===w&&(P=P.substring(1))),this._parts[C]=P,this.build(!M),this)}}a.protocol=S("protocol"),a.username=S("username"),a.password=S("password"),a.hostname=S("hostname"),a.port=S("port"),a.query=I("query","?"),a.fragment=I("fragment","#"),a.search=function(C,w){var P=this.query(C,w);return typeof P=="string"&&P.length?"?"+P:P},a.hash=function(C,w){var P=this.fragment(C,w);return typeof P=="string"&&P.length?"#"+P:P},a.pathname=function(C,w){if(C===void 0||C===!0){var P=this._parts.path||(this._parts.hostname?"/":"");return C?(this._parts.urn?o.decodeUrnPath:o.decodePath)(P):P}else return this._parts.urn?this._parts.path=C?o.recodeUrnPath(C):"":this._parts.path=C?o.recodePath(C):"/",this.build(!w),this},a.path=a.pathname,a.href=function(C,w){var P;if(C===void 0)return this.toString();this._string="",this._parts=o._parts();var M=C instanceof o,F=typeof C=="object"&&(C.hostname||C.path||C.pathname);if(C.nodeName){var V=o.getDomAttribute(C);C=C[V]||"",F=!1}if(!M&&F&&C.pathname!==void 0&&(C=C.toString()),typeof C=="string"||C instanceof String)this._parts=o.parse(String(C),this._parts);else if(M||F){var B=M?C._parts:C;for(P in B)P!=="query"&&c.call(this._parts,P)&&(this._parts[P]=B[P]);B.query&&this.query(B.query,!1)}else throw new TypeError("invalid input");return this.build(!w),this},a.is=function(C){var w=!1,P=!1,M=!1,F=!1,V=!1,B=!1,j=!1,k=!this._parts.urn;switch(this._parts.hostname&&(k=!1,P=o.ip4_expression.test(this._parts.hostname),M=o.ip6_expression.test(this._parts.hostname),w=P||M,F=!w,V=F&&n&&n.has(this._parts.hostname),B=F&&o.idn_expression.test(this._parts.hostname),j=F&&o.punycode_expression.test(this._parts.hostname)),C.toLowerCase()){case"relative":return k;case"absolute":return!k;case"domain":case"name":return F;case"sld":return V;case"ip":return w;case"ip4":case"ipv4":case"inet4":return P;case"ip6":case"ipv6":case"inet6":return M;case"idn":return B;case"url":return!this._parts.urn;case"urn":return!!this._parts.urn;case"punycode":return j}return null};var R=a.protocol,O=a.port,L=a.hostname;a.protocol=function(C,w){if(C&&(C=C.replace(/:(\/\/)?$/,""),!C.match(o.protocol_expression)))throw new TypeError('Protocol "'+C+`" contains characters other than [A-Z0-9.+-] or doesn't start with [A-Z]`);return R.call(this,C,w)},a.scheme=a.protocol,a.port=function(C,w){return this._parts.urn?C===void 0?"":this:(C!==void 0&&(C===0&&(C=null),C&&(C+="",C.charAt(0)===":"&&(C=C.substring(1)),o.ensureValidPort(C))),O.call(this,C,w))},a.hostname=function(C,w){if(this._parts.urn)return C===void 0?"":this;if(C!==void 0){var P={preventInvalidHostname:this._parts.preventInvalidHostname},M=o.parseHost(C,P);if(M!=="/")throw new TypeError('Hostname "'+C+'" contains characters other than [A-Z0-9.-]');C=P.hostname,this._parts.preventInvalidHostname&&o.ensureValidHostname(C,this._parts.protocol)}return L.call(this,C,w)},a.origin=function(C,w){if(this._parts.urn)return C===void 0?"":this;if(C===void 0){var P=this.protocol(),M=this.authority();return M?(P?P+"://":"")+this.authority():""}else{var F=o(C);return this.protocol(F.protocol()).authority(F.authority()).build(!w),this}},a.host=function(C,w){if(this._parts.urn)return C===void 0?"":this;if(C===void 0)return this._parts.hostname?o.buildHost(this._parts):"";var P=o.parseHost(C,this._parts);if(P!=="/")throw new TypeError('Hostname "'+C+'" contains characters other than [A-Z0-9.-]');return this.build(!w),this},a.authority=function(C,w){if(this._parts.urn)return C===void 0?"":this;if(C===void 0)return this._parts.hostname?o.buildAuthority(this._parts):"";var P=o.parseAuthority(C,this._parts);if(P!=="/")throw new TypeError('Hostname "'+C+'" contains characters other than [A-Z0-9.-]');return this.build(!w),this},a.userinfo=function(C,w){if(this._parts.urn)return C===void 0?"":this;if(C===void 0){var P=o.buildUserinfo(this._parts);return P&&P.substring(0,P.length-1)}else return C[C.length-1]!=="@"&&(C+="@"),o.parseUserinfo(C,this._parts),this.build(!w),this},a.resource=function(C,w){var P;return C===void 0?this.path()+this.search()+this.hash():(P=o.parse(C),this._parts.path=P.path,this._parts.query=P.query,this._parts.fragment=P.fragment,this.build(!w),this)},a.subdomain=function(C,w){if(this._parts.urn)return C===void 0?"":this;if(C===void 0){if(!this._parts.hostname||this.is("IP"))return"";var P=this._parts.hostname.length-this.domain().length-1;return this._parts.hostname.substring(0,P)||""}else{var M=this._parts.hostname.length-this.domain().length,F=this._parts.hostname.substring(0,M),V=new RegExp("^"+u(F));if(C&&C.charAt(C.length-1)!=="."&&(C+="."),C.indexOf(":")!==-1)throw new TypeError("Domains cannot contain colons");return C&&o.ensureValidHostname(C,this._parts.protocol),this._parts.hostname=this._parts.hostname.replace(V,C),this.build(!w),this}},a.domain=function(C,w){if(this._parts.urn)return C===void 0?"":this;if(typeof C=="boolean"&&(w=C,C=void 0),C===void 0){if(!this._parts.hostname||this.is("IP"))return"";var P=this._parts.hostname.match(/\./g);if(P&&P.length<2)return this._parts.hostname;var M=this._parts.hostname.length-this.tld(w).length-1;return M=this._parts.hostname.lastIndexOf(".",M-1)+1,this._parts.hostname.substring(M)||""}else{if(!C)throw new TypeError("cannot set domain empty");if(C.indexOf(":")!==-1)throw new TypeError("Domains cannot contain colons");if(o.ensureValidHostname(C,this._parts.protocol),!this._parts.hostname||this.is("IP"))this._parts.hostname=C;else{var F=new RegExp(u(this.domain())+"$");this._parts.hostname=this._parts.hostname.replace(F,C)}return this.build(!w),this}},a.tld=function(C,w){if(this._parts.urn)return C===void 0?"":this;if(typeof C=="boolean"&&(w=C,C=void 0),C===void 0){if(!this._parts.hostname||this.is("IP"))return"";var P=this._parts.hostname.lastIndexOf("."),M=this._parts.hostname.substring(P+1);return w!==!0&&n&&n.list[M.toLowerCase()]&&n.get(this._parts.hostname)||M}else{var F;if(C)if(C.match(/[^a-zA-Z0-9-]/))if(n&&n.is(C))F=new RegExp(u(this.tld())+"$"),this._parts.hostname=this._parts.hostname.replace(F,C);else throw new TypeError('TLD "'+C+'" contains characters other than [A-Z0-9]');else{if(!this._parts.hostname||this.is("IP"))throw new ReferenceError("cannot set TLD on non-domain host");F=new RegExp(u(this.tld())+"$"),this._parts.hostname=this._parts.hostname.replace(F,C)}else throw new TypeError("cannot set TLD empty");return this.build(!w),this}},a.directory=function(C,w){if(this._parts.urn)return C===void 0?"":this;if(C===void 0||C===!0){if(!this._parts.path&&!this._parts.hostname)return"";if(this._parts.path==="/")return"/";var P=this._parts.path.length-this.filename().length-1,M=this._parts.path.substring(0,P)||(this._parts.hostname?"/":"");return C?o.decodePath(M):M}else{var F=this._parts.path.length-this.filename().length,V=this._parts.path.substring(0,F),B=new RegExp("^"+u(V));return this.is("relative")||(C||(C="/"),C.charAt(0)!=="/"&&(C="/"+C)),C&&C.charAt(C.length-1)!=="/"&&(C+="/"),C=o.recodePath(C),this._parts.path=this._parts.path.replace(B,C),this.build(!w),this}},a.filename=function(C,w){if(this._parts.urn)return C===void 0?"":this;if(typeof C!="string"){if(!this._parts.path||this._parts.path==="/")return"";var P=this._parts.path.lastIndexOf("/"),M=this._parts.path.substring(P+1);return C?o.decodePathSegment(M):M}else{var F=!1;C.charAt(0)==="/"&&(C=C.substring(1)),C.match(/\.?\//)&&(F=!0);var V=new RegExp(u(this.filename())+"$");return C=o.recodePath(C),this._parts.path=this._parts.path.replace(V,C),F?this.normalizePath(w):this.build(!w),this}},a.suffix=function(C,w){if(this._parts.urn)return C===void 0?"":this;if(C===void 0||C===!0){if(!this._parts.path||this._parts.path==="/")return"";var P=this.filename(),M=P.lastIndexOf("."),F,V;return M===-1?"":(F=P.substring(M+1),V=/^[a-z0-9%]+$/i.test(F)?F:"",C?o.decodePathSegment(V):V)}else{C.charAt(0)==="."&&(C=C.substring(1));var B=this.suffix(),j;if(B)C?j=new RegExp(u(B)+"$"):j=new RegExp(u("."+B)+"$");else{if(!C)return this;this._parts.path+="."+o.recodePath(C)}return j&&(C=o.recodePath(C),this._parts.path=this._parts.path.replace(j,C)),this.build(!w),this}},a.segment=function(C,w,P){var M=this._parts.urn?":":"/",F=this.path(),V=F.substring(0,1)==="/",B=F.split(M);if(C!==void 0&&typeof C!="number"&&(P=w,w=C,C=void 0),C!==void 0&&typeof C!="number")throw new Error('Bad segment "'+C+'", must be 0-based integer');if(V&&B.shift(),C<0&&(C=Math.max(B.length+C,0)),w===void 0)return C===void 0?B:B[C];if(C===null||B[C]===void 0)if(d(w)){B=[];for(var j=0,k=w.length;j<k;j++)!w[j].length&&(!B.length||!B[B.length-1].length)||(B.length&&!B[B.length-1].length&&B.pop(),B.push(y(w[j])))}else(w||typeof w=="string")&&(w=y(w),B[B.length-1]===""?B[B.length-1]=w:B.push(w));else w?B[C]=y(w):B.splice(C,1);return V&&B.unshift(""),this.path(B.join(M),P)},a.segmentCoded=function(C,w,P){var M,F,V;if(typeof C!="number"&&(P=w,w=C,C=void 0),w===void 0){if(M=this.segment(C,w,P),!d(M))M=M!==void 0?o.decode(M):void 0;else for(F=0,V=M.length;F<V;F++)M[F]=o.decode(M[F]);return M}if(!d(w))w=typeof w=="string"||w instanceof String?o.encode(w):w;else for(F=0,V=w.length;F<V;F++)w[F]=o.encode(w[F]);return this.segment(C,w,P)};var _=a.query;return a.query=function(C,w){if(C===!0)return o.parseQuery(this._parts.query,this._parts.escapeQuerySpace);if(typeof C=="function"){var P=o.parseQuery(this._parts.query,this._parts.escapeQuerySpace),M=C.call(this,P);return this._parts.query=o.buildQuery(M||P,this._parts.duplicateQueryParameters,this._parts.escapeQuerySpace),this.build(!w),this}else return C!==void 0&&typeof C!="string"?(this._parts.query=o.buildQuery(C,this._parts.duplicateQueryParameters,this._parts.escapeQuerySpace),this.build(!w),this):_.call(this,C,w)},a.setQuery=function(C,w,P){var M=o.parseQuery(this._parts.query,this._parts.escapeQuerySpace);if(typeof C=="string"||C instanceof String)M[C]=w!==void 0?w:null;else if(typeof C=="object")for(var F in C)c.call(C,F)&&(M[F]=C[F]);else throw new TypeError("URI.addQuery() accepts an object, string as the name parameter");return this._parts.query=o.buildQuery(M,this._parts.duplicateQueryParameters,this._parts.escapeQuerySpace),typeof C!="string"&&(P=w),this.build(!P),this},a.addQuery=function(C,w,P){var M=o.parseQuery(this._parts.query,this._parts.escapeQuerySpace);return o.addQuery(M,C,w===void 0?null:w),this._parts.query=o.buildQuery(M,this._parts.duplicateQueryParameters,this._parts.escapeQuerySpace),typeof C!="string"&&(P=w),this.build(!P),this},a.removeQuery=function(C,w,P){var M=o.parseQuery(this._parts.query,this._parts.escapeQuerySpace);return o.removeQuery(M,C,w),this._parts.query=o.buildQuery(M,this._parts.duplicateQueryParameters,this._parts.escapeQuerySpace),typeof C!="string"&&(P=w),this.build(!P),this},a.hasQuery=function(C,w,P){var M=o.parseQuery(this._parts.query,this._parts.escapeQuerySpace);return o.hasQuery(M,C,w,P)},a.setSearch=a.setQuery,a.addSearch=a.addQuery,a.removeSearch=a.removeQuery,a.hasSearch=a.hasQuery,a.normalize=function(){return this._parts.urn?this.normalizeProtocol(!1).normalizePath(!1).normalizeQuery(!1).normalizeFragment(!1).build():this.normalizeProtocol(!1).normalizeHostname(!1).normalizePort(!1).normalizePath(!1).normalizeQuery(!1).normalizeFragment(!1).build()},a.normalizeProtocol=function(C){return typeof this._parts.protocol=="string"&&(this._parts.protocol=this._parts.protocol.toLowerCase(),this.build(!C)),this},a.normalizeHostname=function(C){return this._parts.hostname&&(this.is("IDN")&&e?this._parts.hostname=e.toASCII(this._parts.hostname):this.is("IPv6")&&t&&(this._parts.hostname=t.best(this._parts.hostname)),this._parts.hostname=this._parts.hostname.toLowerCase(),this.build(!C)),this},a.normalizePort=function(C){return typeof this._parts.protocol=="string"&&this._parts.port===o.defaultPorts[this._parts.protocol]&&(this._parts.port=null,this.build(!C)),this},a.normalizePath=function(C){var w=this._parts.path;if(!w)return this;if(this._parts.urn)return this._parts.path=o.recodeUrnPath(this._parts.path),this.build(!C),this;if(this._parts.path==="/")return this;w=o.recodePath(w);var P,M="",F,V;for(w.charAt(0)!=="/"&&(P=!0,w="/"+w),(w.slice(-3)==="/.."||w.slice(-2)==="/.")&&(w+="/"),w=w.replace(/(\/(\.\/)+)|(\/\.$)/g,"/").replace(/\/{2,}/g,"/"),P&&(M=w.substring(1).match(/^(\.\.\/)+/)||"",M&&(M=M[0]));F=w.search(/\/\.\.(\/|$)/),F!==-1;){if(F===0){w=w.substring(3);continue}V=w.substring(0,F).lastIndexOf("/"),V===-1&&(V=F),w=w.substring(0,V)+w.substring(F+3)}return P&&this.is("relative")&&(w=M+w.substring(1)),this._parts.path=w,this.build(!C),this},a.normalizePathname=a.normalizePath,a.normalizeQuery=function(C){return typeof this._parts.query=="string"&&(this._parts.query.length?this.query(o.parseQuery(this._parts.query,this._parts.escapeQuerySpace)):this._parts.query=null,this.build(!C)),this},a.normalizeFragment=function(C){return this._parts.fragment||(this._parts.fragment=null,this.build(!C)),this},a.normalizeSearch=a.normalizeQuery,a.normalizeHash=a.normalizeFragment,a.iso8859=function(){var C=o.encode,w=o.decode;o.encode=escape,o.decode=decodeURIComponent;try{this.normalize()}finally{o.encode=C,o.decode=w}return this},a.unicode=function(){var C=o.encode,w=o.decode;o.encode=b,o.decode=unescape;try{this.normalize()}finally{o.encode=C,o.decode=w}return this},a.readable=function(){var C=this.clone();C.username("").password("").normalize();var w="";if(C._parts.protocol&&(w+=C._parts.protocol+"://"),C._parts.hostname&&(C.is("punycode")&&e?(w+=e.toUnicode(C._parts.hostname),C._parts.port&&(w+=":"+C._parts.port)):w+=C.host()),C._parts.hostname&&C._parts.path&&C._parts.path.charAt(0)!=="/"&&(w+="/"),w+=C.path(!0),C._parts.query){for(var P="",M=0,F=C._parts.query.split("&"),V=F.length;M<V;M++){var B=(F[M]||"").split("=");P+="&"+o.decodeQuery(B[0],this._parts.escapeQuerySpace).replace(/&/g,"%26"),B[1]!==void 0&&(P+="="+o.decodeQuery(B[1],this._parts.escapeQuerySpace).replace(/&/g,"%26"))}w+="?"+P.substring(1)}return w+=o.decodeQuery(C.hash(),!0),w},a.absoluteTo=function(C){var w=this.clone(),P=["protocol","username","password","hostname","port"],M,F,V;if(this._parts.urn)throw new Error("URNs do not have any generally defined hierarchical components");if(C instanceof o||(C=new o(C)),w._parts.protocol||(w._parts.protocol=C._parts.protocol,this._parts.hostname))return w;for(F=0;V=P[F];F++)w._parts[V]=C._parts[V];return w._parts.path?(w._parts.path.substring(-2)===".."&&(w._parts.path+="/"),w.path().charAt(0)!=="/"&&(M=C.directory(),M=M||(C.path().indexOf("/")===0?"/":""),w._parts.path=(M?M+"/":"")+w._parts.path,w.normalizePath())):(w._parts.path=C._parts.path,w._parts.query||(w._parts.query=C._parts.query)),w.build(),w},a.relativeTo=function(C){var w=this.clone().normalize(),P,M,F,V,B;if(w._parts.urn)throw new Error("URNs do not have any generally defined hierarchical components");if(C=new o(C).normalize(),P=w._parts,M=C._parts,V=w.path(),B=C.path(),V.charAt(0)!=="/")throw new Error("URI is already relative");if(B.charAt(0)!=="/")throw new Error("Cannot calculate a URI relative to another relative URI");if(P.protocol===M.protocol&&(P.protocol=null),P.username!==M.username||P.password!==M.password||P.protocol!==null||P.username!==null||P.password!==null)return w.build();if(P.hostname===M.hostname&&P.port===M.port)P.hostname=null,P.port=null;else return w.build();if(V===B)return P.path="",w.build();if(F=o.commonPath(V,B),!F)return w.build();var j=M.path.substring(F.length).replace(/[^\/]*$/,"").replace(/.*?\//g,"../");return P.path=j+P.path.substring(F.length)||"./",w.build()},a.equals=function(C){var w=this.clone(),P=new o(C),M={},F={},V={},B,j,k;if(w.normalize(),P.normalize(),w.toString()===P.toString())return!0;if(B=w.query(),j=P.query(),w.query(""),P.query(""),w.toString()!==P.toString()||B.length!==j.length)return!1;M=o.parseQuery(B,this._parts.escapeQuerySpace),F=o.parseQuery(j,this._parts.escapeQuerySpace);for(k in M)if(c.call(M,k)){if(d(M[k])){if(!m(M[k],F[k]))return!1}else if(M[k]!==F[k])return!1;V[k]=!0}for(k in F)if(c.call(F,k)&&!V[k])return!1;return!0},a.preventInvalidHostname=function(C){return this._parts.preventInvalidHostname=!!C,this},a.duplicateQueryParameters=function(C){return this._parts.duplicateQueryParameters=!!C,this},a.escapeQuerySpace=function(C){return this._parts.escapeQuerySpace=!!C,this},o})});var Dxe=Yi((fei,Pxe)=>{"use strict";Pxe.exports=Tut;var T2=1e20;function Tut(e,t){t||(t={});var n=t.cutoff==null?.25:t.cutoff,i=t.radius==null?8:t.radius,r=t.channel||0,o,s,a,c,u,f,d,p,g,m,y;if(ArrayBuffer.isView(e)||Array.isArray(e)){if(!t.width||!t.height)throw Error("For raw data width and height should be provided by options");o=t.width,s=t.height,c=e,t.stride?f=t.stride:f=Math.floor(e.length/o/s)}else window.HTMLCanvasElement&&e instanceof window.HTMLCanvasElement?(p=e,d=p.getContext("2d"),o=p.width,s=p.height,g=d.getImageData(0,0,o,s),c=g.data,f=4):window.CanvasRenderingContext2D&&e instanceof window.CanvasRenderingContext2D?(p=e.canvas,d=e,o=p.width,s=p.height,g=d.getImageData(0,0,o,s),c=g.data,f=4):window.ImageData&&e instanceof window.ImageData&&(g=e,o=e.width,s=e.height,c=g.data,f=4);if(a=Math.max(o,s),window.Uint8ClampedArray&&c instanceof window.Uint8ClampedArray||window.Uint8Array&&c instanceof window.Uint8Array)for(u=c,c=Array(o*s),m=0,y=Math.floor(u.length/f);m<y;m++)c[m]=u[m*f+r]/255;else if(f!==1)throw Error("Raw data can have only 1 value per pixel");var A=Array(o*s),b=Array(o*s),x=Array(a),T=Array(a),E=Array(a+1),v=Array(a);for(m=0,y=o*s;m<y;m++){var S=c[m];A[m]=S===1?0:S===0?T2:Math.pow(Math.max(0,.5-S),2),b[m]=S===1?T2:S===0?0:Math.pow(Math.max(0,S-.5),2)}wxe(A,o,s,x,T,v,E),wxe(b,o,s,x,T,v,E);var I=window.Float32Array?new Float32Array(o*s):new Array(o*s);for(m=0,y=o*s;m<y;m++)I[m]=Math.min(Math.max(1-((A[m]-b[m])/i+n),0),1);return I}function wxe(e,t,n,i,r,o,s){for(var a=0;a<t;a++){for(var c=0;c<n;c++)i[c]=e[c*t+a];for(Ixe(i,r,o,s,n),c=0;c<n;c++)e[c*t+a]=r[c]}for(c=0;c<n;c++){for(a=0;a<t;a++)i[a]=e[c*t+a];for(Ixe(i,r,o,s,t),a=0;a<t;a++)e[c*t+a]=Math.sqrt(r[a])}}function Ixe(e,t,n,i,r){n[0]=0,i[0]=-T2,i[1]=+T2;for(var o=1,s=0;o<r;o++){for(var a=(e[o]+o*o-(e[n[s]]+n[s]*n[s]))/(2*o-2*n[s]);a<=i[s];)s--,a=(e[o]+o*o-(e[n[s]]+n[s]*n[s]))/(2*o-2*n[s]);s++,n[s]=o,i[s]=a,i[s+1]=+T2}for(o=0,s=0;o<r;o++){for(;i[s+1]<o;)s++;t[o]=(o-n[s])*(o-n[s])+e[n[s]]}}});var Fxe=Yi((Iei,WH)=>{function Out(){var e=0,t=1,n=2,i=3,r=4,o=5,s=6,a=7,c=8,u=9,f=10,d=11,p=12,g=13,m=14,y=15,A=16,b=17,x=0,T=1,E=2,v=3,S=4;function I(_,C){return 55296<=_.charCodeAt(C)&&_.charCodeAt(C)<=56319&&56320<=_.charCodeAt(C+1)&&_.charCodeAt(C+1)<=57343}function R(_,C){C===void 0&&(C=0);var w=_.charCodeAt(C);if(55296<=w&&w<=56319&&C<_.length-1){var P=w,M=_.charCodeAt(C+1);return 56320<=M&&M<=57343?(P-55296)*1024+(M-56320)+65536:P}if(56320<=w&&w<=57343&&C>=1){var P=_.charCodeAt(C-1),M=w;return 55296<=P&&P<=56319?(P-55296)*1024+(M-56320)+65536:M}return w}function O(_,C,w){var P=[_].concat(C).concat([w]),M=P[P.length-2],F=w,V=P.lastIndexOf(m);if(V>1&&P.slice(1,V).every(function(k){return k==i})&&[i,g,b].indexOf(_)==-1)return E;var B=P.lastIndexOf(r);if(B>0&&P.slice(1,B).every(function(k){return k==r})&&[p,r].indexOf(M)==-1)return P.filter(function(k){return k==r}).length%2==1?v:S;if(M==e&&F==t)return x;if(M==n||M==e||M==t)return F==m&&C.every(function(k){return k==i})?E:T;if(F==n||F==e||F==t)return T;if(M==s&&(F==s||F==a||F==u||F==f))return x;if((M==u||M==a)&&(F==a||F==c))return x;if((M==f||M==c)&&F==c)return x;if(F==i||F==y)return x;if(F==o)return x;if(M==p)return x;var j=P.indexOf(i)!=-1?P.lastIndexOf(i)-1:P.length-2;return[g,b].indexOf(P[j])!=-1&&P.slice(j+1,-1).every(function(k){return k==i})&&F==m||M==y&&[A,b].indexOf(F)!=-1?x:C.indexOf(r)!=-1?E:M==r&&F==r?x:T}this.nextBreak=function(_,C){if(C===void 0&&(C=0),C<0)return 0;if(C>=_.length-1)return _.length;for(var w=L(R(_,C)),P=[],M=C+1;M<_.length;M++)if(!I(_,M-1)){var F=L(R(_,M));if(O(w,P,F))return M;P.push(F)}return _.length},this.splitGraphemes=function(_){for(var C=[],w=0,P;(P=this.nextBreak(_,w))<_.length;)C.push(_.slice(w,P)),w=P;return w<_.length&&C.push(_.slice(w)),C},this.iterateGraphemes=function(_){var C=0,w={next:(function(){var P,M;return(M=this.nextBreak(_,C))<_.length?(P=_.slice(C,M),C=M,{value:P,done:!1}):C<_.length?(P=_.slice(C),C=_.length,{value:P,done:!1}):{value:void 0,done:!0}}).bind(this)};return typeof Symbol<"u"&&Symbol.iterator&&(w[Symbol.iterator]=function(){return w}),w},this.countGraphemes=function(_){for(var C=0,w=0,P;(P=this.nextBreak(_,w))<_.length;)w=P,C++;return w<_.length&&C++,C};function L(_){return 1536<=_&&_<=1541||_==1757||_==1807||_==2274||_==3406||_==69821||70082<=_&&_<=70083||_==72250||72326<=_&&_<=72329||_==73030?p:_==13?e:_==10?t:0<=_&&_<=9||11<=_&&_<=12||14<=_&&_<=31||127<=_&&_<=159||_==173||_==1564||_==6158||_==8203||8206<=_&&_<=8207||_==8232||_==8233||8234<=_&&_<=8238||8288<=_&&_<=8292||_==8293||8294<=_&&_<=8303||55296<=_&&_<=57343||_==65279||65520<=_&&_<=65528||65529<=_&&_<=65531||113824<=_&&_<=113827||119155<=_&&_<=119162||_==917504||_==917505||917506<=_&&_<=917535||917632<=_&&_<=917759||918e3<=_&&_<=921599?n:768<=_&&_<=879||1155<=_&&_<=1159||1160<=_&&_<=1161||1425<=_&&_<=1469||_==1471||1473<=_&&_<=1474||1476<=_&&_<=1477||_==1479||1552<=_&&_<=1562||1611<=_&&_<=1631||_==1648||1750<=_&&_<=1756||1759<=_&&_<=1764||1767<=_&&_<=1768||1770<=_&&_<=1773||_==1809||1840<=_&&_<=1866||1958<=_&&_<=1968||2027<=_&&_<=2035||2070<=_&&_<=2073||2075<=_&&_<=2083||2085<=_&&_<=2087||2089<=_&&_<=2093||2137<=_&&_<=2139||2260<=_&&_<=2273||2275<=_&&_<=2306||_==2362||_==2364||2369<=_&&_<=2376||_==2381||2385<=_&&_<=2391||2402<=_&&_<=2403||_==2433||_==2492||_==2494||2497<=_&&_<=2500||_==2509||_==2519||2530<=_&&_<=2531||2561<=_&&_<=2562||_==2620||2625<=_&&_<=2626||2631<=_&&_<=2632||2635<=_&&_<=2637||_==2641||2672<=_&&_<=2673||_==2677||2689<=_&&_<=2690||_==2748||2753<=_&&_<=2757||2759<=_&&_<=2760||_==2765||2786<=_&&_<=2787||2810<=_&&_<=2815||_==2817||_==2876||_==2878||_==2879||2881<=_&&_<=2884||_==2893||_==2902||_==2903||2914<=_&&_<=2915||_==2946||_==3006||_==3008||_==3021||_==3031||_==3072||3134<=_&&_<=3136||3142<=_&&_<=3144||3146<=_&&_<=3149||3157<=_&&_<=3158||3170<=_&&_<=3171||_==3201||_==3260||_==3263||_==3266||_==3270||3276<=_&&_<=3277||3285<=_&&_<=3286||3298<=_&&_<=3299||3328<=_&&_<=3329||3387<=_&&_<=3388||_==3390||3393<=_&&_<=3396||_==3405||_==3415||3426<=_&&_<=3427||_==3530||_==3535||3538<=_&&_<=3540||_==3542||_==3551||_==3633||3636<=_&&_<=3642||3655<=_&&_<=3662||_==3761||3764<=_&&_<=3769||3771<=_&&_<=3772||3784<=_&&_<=3789||3864<=_&&_<=3865||_==3893||_==3895||_==3897||3953<=_&&_<=3966||3968<=_&&_<=3972||3974<=_&&_<=3975||3981<=_&&_<=3991||3993<=_&&_<=4028||_==4038||4141<=_&&_<=4144||4146<=_&&_<=4151||4153<=_&&_<=4154||4157<=_&&_<=4158||4184<=_&&_<=4185||4190<=_&&_<=4192||4209<=_&&_<=4212||_==4226||4229<=_&&_<=4230||_==4237||_==4253||4957<=_&&_<=4959||5906<=_&&_<=5908||5938<=_&&_<=5940||5970<=_&&_<=5971||6002<=_&&_<=6003||6068<=_&&_<=6069||6071<=_&&_<=6077||_==6086||6089<=_&&_<=6099||_==6109||6155<=_&&_<=6157||6277<=_&&_<=6278||_==6313||6432<=_&&_<=6434||6439<=_&&_<=6440||_==6450||6457<=_&&_<=6459||6679<=_&&_<=6680||_==6683||_==6742||6744<=_&&_<=6750||_==6752||_==6754||6757<=_&&_<=6764||6771<=_&&_<=6780||_==6783||6832<=_&&_<=6845||_==6846||6912<=_&&_<=6915||_==6964||6966<=_&&_<=6970||_==6972||_==6978||7019<=_&&_<=7027||7040<=_&&_<=7041||7074<=_&&_<=7077||7080<=_&&_<=7081||7083<=_&&_<=7085||_==7142||7144<=_&&_<=7145||_==7149||7151<=_&&_<=7153||7212<=_&&_<=7219||7222<=_&&_<=7223||7376<=_&&_<=7378||7380<=_&&_<=7392||7394<=_&&_<=7400||_==7405||_==7412||7416<=_&&_<=7417||7616<=_&&_<=7673||7675<=_&&_<=7679||_==8204||8400<=_&&_<=8412||8413<=_&&_<=8416||_==8417||8418<=_&&_<=8420||8421<=_&&_<=8432||11503<=_&&_<=11505||_==11647||11744<=_&&_<=11775||12330<=_&&_<=12333||12334<=_&&_<=12335||12441<=_&&_<=12442||_==42607||42608<=_&&_<=42610||42612<=_&&_<=42621||42654<=_&&_<=42655||42736<=_&&_<=42737||_==43010||_==43014||_==43019||43045<=_&&_<=43046||43204<=_&&_<=43205||43232<=_&&_<=43249||43302<=_&&_<=43309||43335<=_&&_<=43345||43392<=_&&_<=43394||_==43443||43446<=_&&_<=43449||_==43452||_==43493||43561<=_&&_<=43566||43569<=_&&_<=43570||43573<=_&&_<=43574||_==43587||_==43596||_==43644||_==43696||43698<=_&&_<=43700||43703<=_&&_<=43704||43710<=_&&_<=43711||_==43713||43756<=_&&_<=43757||_==43766||_==44005||_==44008||_==44013||_==64286||65024<=_&&_<=65039||65056<=_&&_<=65071||65438<=_&&_<=65439||_==66045||_==66272||66422<=_&&_<=66426||68097<=_&&_<=68099||68101<=_&&_<=68102||68108<=_&&_<=68111||68152<=_&&_<=68154||_==68159||68325<=_&&_<=68326||_==69633||69688<=_&&_<=69702||69759<=_&&_<=69761||69811<=_&&_<=69814||69817<=_&&_<=69818||69888<=_&&_<=69890||69927<=_&&_<=69931||69933<=_&&_<=69940||_==70003||70016<=_&&_<=70017||70070<=_&&_<=70078||70090<=_&&_<=70092||70191<=_&&_<=70193||_==70196||70198<=_&&_<=70199||_==70206||_==70367||70371<=_&&_<=70378||70400<=_&&_<=70401||_==70460||_==70462||_==70464||_==70487||70502<=_&&_<=70508||70512<=_&&_<=70516||70712<=_&&_<=70719||70722<=_&&_<=70724||_==70726||_==70832||70835<=_&&_<=70840||_==70842||_==70845||70847<=_&&_<=70848||70850<=_&&_<=70851||_==71087||71090<=_&&_<=71093||71100<=_&&_<=71101||71103<=_&&_<=71104||71132<=_&&_<=71133||71219<=_&&_<=71226||_==71229||71231<=_&&_<=71232||_==71339||_==71341||71344<=_&&_<=71349||_==71351||71453<=_&&_<=71455||71458<=_&&_<=71461||71463<=_&&_<=71467||72193<=_&&_<=72198||72201<=_&&_<=72202||72243<=_&&_<=72248||72251<=_&&_<=72254||_==72263||72273<=_&&_<=72278||72281<=_&&_<=72283||72330<=_&&_<=72342||72344<=_&&_<=72345||72752<=_&&_<=72758||72760<=_&&_<=72765||_==72767||72850<=_&&_<=72871||72874<=_&&_<=72880||72882<=_&&_<=72883||72885<=_&&_<=72886||73009<=_&&_<=73014||_==73018||73020<=_&&_<=73021||73023<=_&&_<=73029||_==73031||92912<=_&&_<=92916||92976<=_&&_<=92982||94095<=_&&_<=94098||113821<=_&&_<=113822||_==119141||119143<=_&&_<=119145||119150<=_&&_<=119154||119163<=_&&_<=119170||119173<=_&&_<=119179||119210<=_&&_<=119213||119362<=_&&_<=119364||121344<=_&&_<=121398||121403<=_&&_<=121452||_==121461||_==121476||121499<=_&&_<=121503||121505<=_&&_<=121519||122880<=_&&_<=122886||122888<=_&&_<=122904||122907<=_&&_<=122913||122915<=_&&_<=122916||122918<=_&&_<=122922||125136<=_&&_<=125142||125252<=_&&_<=125258||917536<=_&&_<=917631||917760<=_&&_<=917999?i:127462<=_&&_<=127487?r:_==2307||_==2363||2366<=_&&_<=2368||2377<=_&&_<=2380||2382<=_&&_<=2383||2434<=_&&_<=2435||2495<=_&&_<=2496||2503<=_&&_<=2504||2507<=_&&_<=2508||_==2563||2622<=_&&_<=2624||_==2691||2750<=_&&_<=2752||_==2761||2763<=_&&_<=2764||2818<=_&&_<=2819||_==2880||2887<=_&&_<=2888||2891<=_&&_<=2892||_==3007||3009<=_&&_<=3010||3014<=_&&_<=3016||3018<=_&&_<=3020||3073<=_&&_<=3075||3137<=_&&_<=3140||3202<=_&&_<=3203||_==3262||3264<=_&&_<=3265||3267<=_&&_<=3268||3271<=_&&_<=3272||3274<=_&&_<=3275||3330<=_&&_<=3331||3391<=_&&_<=3392||3398<=_&&_<=3400||3402<=_&&_<=3404||3458<=_&&_<=3459||3536<=_&&_<=3537||3544<=_&&_<=3550||3570<=_&&_<=3571||_==3635||_==3763||3902<=_&&_<=3903||_==3967||_==4145||4155<=_&&_<=4156||4182<=_&&_<=4183||_==4228||_==6070||6078<=_&&_<=6085||6087<=_&&_<=6088||6435<=_&&_<=6438||6441<=_&&_<=6443||6448<=_&&_<=6449||6451<=_&&_<=6456||6681<=_&&_<=6682||_==6741||_==6743||6765<=_&&_<=6770||_==6916||_==6965||_==6971||6973<=_&&_<=6977||6979<=_&&_<=6980||_==7042||_==7073||7078<=_&&_<=7079||_==7082||_==7143||7146<=_&&_<=7148||_==7150||7154<=_&&_<=7155||7204<=_&&_<=7211||7220<=_&&_<=7221||_==7393||7410<=_&&_<=7411||_==7415||43043<=_&&_<=43044||_==43047||43136<=_&&_<=43137||43188<=_&&_<=43203||43346<=_&&_<=43347||_==43395||43444<=_&&_<=43445||43450<=_&&_<=43451||43453<=_&&_<=43456||43567<=_&&_<=43568||43571<=_&&_<=43572||_==43597||_==43755||43758<=_&&_<=43759||_==43765||44003<=_&&_<=44004||44006<=_&&_<=44007||44009<=_&&_<=44010||_==44012||_==69632||_==69634||_==69762||69808<=_&&_<=69810||69815<=_&&_<=69816||_==69932||_==70018||70067<=_&&_<=70069||70079<=_&&_<=70080||70188<=_&&_<=70190||70194<=_&&_<=70195||_==70197||70368<=_&&_<=70370||70402<=_&&_<=70403||_==70463||70465<=_&&_<=70468||70471<=_&&_<=70472||70475<=_&&_<=70477||70498<=_&&_<=70499||70709<=_&&_<=70711||70720<=_&&_<=70721||_==70725||70833<=_&&_<=70834||_==70841||70843<=_&&_<=70844||_==70846||_==70849||71088<=_&&_<=71089||71096<=_&&_<=71099||_==71102||71216<=_&&_<=71218||71227<=_&&_<=71228||_==71230||_==71340||71342<=_&&_<=71343||_==71350||71456<=_&&_<=71457||_==71462||72199<=_&&_<=72200||_==72249||72279<=_&&_<=72280||_==72343||_==72751||_==72766||_==72873||_==72881||_==72884||94033<=_&&_<=94078||_==119142||_==119149?o:4352<=_&&_<=4447||43360<=_&&_<=43388?s:4448<=_&&_<=4519||55216<=_&&_<=55238?a:4520<=_&&_<=4607||55243<=_&&_<=55291?c:_==44032||_==44060||_==44088||_==44116||_==44144||_==44172||_==44200||_==44228||_==44256||_==44284||_==44312||_==44340||_==44368||_==44396||_==44424||_==44452||_==44480||_==44508||_==44536||_==44564||_==44592||_==44620||_==44648||_==44676||_==44704||_==44732||_==44760||_==44788||_==44816||_==44844||_==44872||_==44900||_==44928||_==44956||_==44984||_==45012||_==45040||_==45068||_==45096||_==45124||_==45152||_==45180||_==45208||_==45236||_==45264||_==45292||_==45320||_==45348||_==45376||_==45404||_==45432||_==45460||_==45488||_==45516||_==45544||_==45572||_==45600||_==45628||_==45656||_==45684||_==45712||_==45740||_==45768||_==45796||_==45824||_==45852||_==45880||_==45908||_==45936||_==45964||_==45992||_==46020||_==46048||_==46076||_==46104||_==46132||_==46160||_==46188||_==46216||_==46244||_==46272||_==46300||_==46328||_==46356||_==46384||_==46412||_==46440||_==46468||_==46496||_==46524||_==46552||_==46580||_==46608||_==46636||_==46664||_==46692||_==46720||_==46748||_==46776||_==46804||_==46832||_==46860||_==46888||_==46916||_==46944||_==46972||_==47e3||_==47028||_==47056||_==47084||_==47112||_==47140||_==47168||_==47196||_==47224||_==47252||_==47280||_==47308||_==47336||_==47364||_==47392||_==47420||_==47448||_==47476||_==47504||_==47532||_==47560||_==47588||_==47616||_==47644||_==47672||_==47700||_==47728||_==47756||_==47784||_==47812||_==47840||_==47868||_==47896||_==47924||_==47952||_==47980||_==48008||_==48036||_==48064||_==48092||_==48120||_==48148||_==48176||_==48204||_==48232||_==48260||_==48288||_==48316||_==48344||_==48372||_==48400||_==48428||_==48456||_==48484||_==48512||_==48540||_==48568||_==48596||_==48624||_==48652||_==48680||_==48708||_==48736||_==48764||_==48792||_==48820||_==48848||_==48876||_==48904||_==48932||_==48960||_==48988||_==49016||_==49044||_==49072||_==49100||_==49128||_==49156||_==49184||_==49212||_==49240||_==49268||_==49296||_==49324||_==49352||_==49380||_==49408||_==49436||_==49464||_==49492||_==49520||_==49548||_==49576||_==49604||_==49632||_==49660||_==49688||_==49716||_==49744||_==49772||_==49800||_==49828||_==49856||_==49884||_==49912||_==49940||_==49968||_==49996||_==50024||_==50052||_==50080||_==50108||_==50136||_==50164||_==50192||_==50220||_==50248||_==50276||_==50304||_==50332||_==50360||_==50388||_==50416||_==50444||_==50472||_==50500||_==50528||_==50556||_==50584||_==50612||_==50640||_==50668||_==50696||_==50724||_==50752||_==50780||_==50808||_==50836||_==50864||_==50892||_==50920||_==50948||_==50976||_==51004||_==51032||_==51060||_==51088||_==51116||_==51144||_==51172||_==51200||_==51228||_==51256||_==51284||_==51312||_==51340||_==51368||_==51396||_==51424||_==51452||_==51480||_==51508||_==51536||_==51564||_==51592||_==51620||_==51648||_==51676||_==51704||_==51732||_==51760||_==51788||_==51816||_==51844||_==51872||_==51900||_==51928||_==51956||_==51984||_==52012||_==52040||_==52068||_==52096||_==52124||_==52152||_==52180||_==52208||_==52236||_==52264||_==52292||_==52320||_==52348||_==52376||_==52404||_==52432||_==52460||_==52488||_==52516||_==52544||_==52572||_==52600||_==52628||_==52656||_==52684||_==52712||_==52740||_==52768||_==52796||_==52824||_==52852||_==52880||_==52908||_==52936||_==52964||_==52992||_==53020||_==53048||_==53076||_==53104||_==53132||_==53160||_==53188||_==53216||_==53244||_==53272||_==53300||_==53328||_==53356||_==53384||_==53412||_==53440||_==53468||_==53496||_==53524||_==53552||_==53580||_==53608||_==53636||_==53664||_==53692||_==53720||_==53748||_==53776||_==53804||_==53832||_==53860||_==53888||_==53916||_==53944||_==53972||_==54e3||_==54028||_==54056||_==54084||_==54112||_==54140||_==54168||_==54196||_==54224||_==54252||_==54280||_==54308||_==54336||_==54364||_==54392||_==54420||_==54448||_==54476||_==54504||_==54532||_==54560||_==54588||_==54616||_==54644||_==54672||_==54700||_==54728||_==54756||_==54784||_==54812||_==54840||_==54868||_==54896||_==54924||_==54952||_==54980||_==55008||_==55036||_==55064||_==55092||_==55120||_==55148||_==55176?u:44033<=_&&_<=44059||44061<=_&&_<=44087||44089<=_&&_<=44115||44117<=_&&_<=44143||44145<=_&&_<=44171||44173<=_&&_<=44199||44201<=_&&_<=44227||44229<=_&&_<=44255||44257<=_&&_<=44283||44285<=_&&_<=44311||44313<=_&&_<=44339||44341<=_&&_<=44367||44369<=_&&_<=44395||44397<=_&&_<=44423||44425<=_&&_<=44451||44453<=_&&_<=44479||44481<=_&&_<=44507||44509<=_&&_<=44535||44537<=_&&_<=44563||44565<=_&&_<=44591||44593<=_&&_<=44619||44621<=_&&_<=44647||44649<=_&&_<=44675||44677<=_&&_<=44703||44705<=_&&_<=44731||44733<=_&&_<=44759||44761<=_&&_<=44787||44789<=_&&_<=44815||44817<=_&&_<=44843||44845<=_&&_<=44871||44873<=_&&_<=44899||44901<=_&&_<=44927||44929<=_&&_<=44955||44957<=_&&_<=44983||44985<=_&&_<=45011||45013<=_&&_<=45039||45041<=_&&_<=45067||45069<=_&&_<=45095||45097<=_&&_<=45123||45125<=_&&_<=45151||45153<=_&&_<=45179||45181<=_&&_<=45207||45209<=_&&_<=45235||45237<=_&&_<=45263||45265<=_&&_<=45291||45293<=_&&_<=45319||45321<=_&&_<=45347||45349<=_&&_<=45375||45377<=_&&_<=45403||45405<=_&&_<=45431||45433<=_&&_<=45459||45461<=_&&_<=45487||45489<=_&&_<=45515||45517<=_&&_<=45543||45545<=_&&_<=45571||45573<=_&&_<=45599||45601<=_&&_<=45627||45629<=_&&_<=45655||45657<=_&&_<=45683||45685<=_&&_<=45711||45713<=_&&_<=45739||45741<=_&&_<=45767||45769<=_&&_<=45795||45797<=_&&_<=45823||45825<=_&&_<=45851||45853<=_&&_<=45879||45881<=_&&_<=45907||45909<=_&&_<=45935||45937<=_&&_<=45963||45965<=_&&_<=45991||45993<=_&&_<=46019||46021<=_&&_<=46047||46049<=_&&_<=46075||46077<=_&&_<=46103||46105<=_&&_<=46131||46133<=_&&_<=46159||46161<=_&&_<=46187||46189<=_&&_<=46215||46217<=_&&_<=46243||46245<=_&&_<=46271||46273<=_&&_<=46299||46301<=_&&_<=46327||46329<=_&&_<=46355||46357<=_&&_<=46383||46385<=_&&_<=46411||46413<=_&&_<=46439||46441<=_&&_<=46467||46469<=_&&_<=46495||46497<=_&&_<=46523||46525<=_&&_<=46551||46553<=_&&_<=46579||46581<=_&&_<=46607||46609<=_&&_<=46635||46637<=_&&_<=46663||46665<=_&&_<=46691||46693<=_&&_<=46719||46721<=_&&_<=46747||46749<=_&&_<=46775||46777<=_&&_<=46803||46805<=_&&_<=46831||46833<=_&&_<=46859||46861<=_&&_<=46887||46889<=_&&_<=46915||46917<=_&&_<=46943||46945<=_&&_<=46971||46973<=_&&_<=46999||47001<=_&&_<=47027||47029<=_&&_<=47055||47057<=_&&_<=47083||47085<=_&&_<=47111||47113<=_&&_<=47139||47141<=_&&_<=47167||47169<=_&&_<=47195||47197<=_&&_<=47223||47225<=_&&_<=47251||47253<=_&&_<=47279||47281<=_&&_<=47307||47309<=_&&_<=47335||47337<=_&&_<=47363||47365<=_&&_<=47391||47393<=_&&_<=47419||47421<=_&&_<=47447||47449<=_&&_<=47475||47477<=_&&_<=47503||47505<=_&&_<=47531||47533<=_&&_<=47559||47561<=_&&_<=47587||47589<=_&&_<=47615||47617<=_&&_<=47643||47645<=_&&_<=47671||47673<=_&&_<=47699||47701<=_&&_<=47727||47729<=_&&_<=47755||47757<=_&&_<=47783||47785<=_&&_<=47811||47813<=_&&_<=47839||47841<=_&&_<=47867||47869<=_&&_<=47895||47897<=_&&_<=47923||47925<=_&&_<=47951||47953<=_&&_<=47979||47981<=_&&_<=48007||48009<=_&&_<=48035||48037<=_&&_<=48063||48065<=_&&_<=48091||48093<=_&&_<=48119||48121<=_&&_<=48147||48149<=_&&_<=48175||48177<=_&&_<=48203||48205<=_&&_<=48231||48233<=_&&_<=48259||48261<=_&&_<=48287||48289<=_&&_<=48315||48317<=_&&_<=48343||48345<=_&&_<=48371||48373<=_&&_<=48399||48401<=_&&_<=48427||48429<=_&&_<=48455||48457<=_&&_<=48483||48485<=_&&_<=48511||48513<=_&&_<=48539||48541<=_&&_<=48567||48569<=_&&_<=48595||48597<=_&&_<=48623||48625<=_&&_<=48651||48653<=_&&_<=48679||48681<=_&&_<=48707||48709<=_&&_<=48735||48737<=_&&_<=48763||48765<=_&&_<=48791||48793<=_&&_<=48819||48821<=_&&_<=48847||48849<=_&&_<=48875||48877<=_&&_<=48903||48905<=_&&_<=48931||48933<=_&&_<=48959||48961<=_&&_<=48987||48989<=_&&_<=49015||49017<=_&&_<=49043||49045<=_&&_<=49071||49073<=_&&_<=49099||49101<=_&&_<=49127||49129<=_&&_<=49155||49157<=_&&_<=49183||49185<=_&&_<=49211||49213<=_&&_<=49239||49241<=_&&_<=49267||49269<=_&&_<=49295||49297<=_&&_<=49323||49325<=_&&_<=49351||49353<=_&&_<=49379||49381<=_&&_<=49407||49409<=_&&_<=49435||49437<=_&&_<=49463||49465<=_&&_<=49491||49493<=_&&_<=49519||49521<=_&&_<=49547||49549<=_&&_<=49575||49577<=_&&_<=49603||49605<=_&&_<=49631||49633<=_&&_<=49659||49661<=_&&_<=49687||49689<=_&&_<=49715||49717<=_&&_<=49743||49745<=_&&_<=49771||49773<=_&&_<=49799||49801<=_&&_<=49827||49829<=_&&_<=49855||49857<=_&&_<=49883||49885<=_&&_<=49911||49913<=_&&_<=49939||49941<=_&&_<=49967||49969<=_&&_<=49995||49997<=_&&_<=50023||50025<=_&&_<=50051||50053<=_&&_<=50079||50081<=_&&_<=50107||50109<=_&&_<=50135||50137<=_&&_<=50163||50165<=_&&_<=50191||50193<=_&&_<=50219||50221<=_&&_<=50247||50249<=_&&_<=50275||50277<=_&&_<=50303||50305<=_&&_<=50331||50333<=_&&_<=50359||50361<=_&&_<=50387||50389<=_&&_<=50415||50417<=_&&_<=50443||50445<=_&&_<=50471||50473<=_&&_<=50499||50501<=_&&_<=50527||50529<=_&&_<=50555||50557<=_&&_<=50583||50585<=_&&_<=50611||50613<=_&&_<=50639||50641<=_&&_<=50667||50669<=_&&_<=50695||50697<=_&&_<=50723||50725<=_&&_<=50751||50753<=_&&_<=50779||50781<=_&&_<=50807||50809<=_&&_<=50835||50837<=_&&_<=50863||50865<=_&&_<=50891||50893<=_&&_<=50919||50921<=_&&_<=50947||50949<=_&&_<=50975||50977<=_&&_<=51003||51005<=_&&_<=51031||51033<=_&&_<=51059||51061<=_&&_<=51087||51089<=_&&_<=51115||51117<=_&&_<=51143||51145<=_&&_<=51171||51173<=_&&_<=51199||51201<=_&&_<=51227||51229<=_&&_<=51255||51257<=_&&_<=51283||51285<=_&&_<=51311||51313<=_&&_<=51339||51341<=_&&_<=51367||51369<=_&&_<=51395||51397<=_&&_<=51423||51425<=_&&_<=51451||51453<=_&&_<=51479||51481<=_&&_<=51507||51509<=_&&_<=51535||51537<=_&&_<=51563||51565<=_&&_<=51591||51593<=_&&_<=51619||51621<=_&&_<=51647||51649<=_&&_<=51675||51677<=_&&_<=51703||51705<=_&&_<=51731||51733<=_&&_<=51759||51761<=_&&_<=51787||51789<=_&&_<=51815||51817<=_&&_<=51843||51845<=_&&_<=51871||51873<=_&&_<=51899||51901<=_&&_<=51927||51929<=_&&_<=51955||51957<=_&&_<=51983||51985<=_&&_<=52011||52013<=_&&_<=52039||52041<=_&&_<=52067||52069<=_&&_<=52095||52097<=_&&_<=52123||52125<=_&&_<=52151||52153<=_&&_<=52179||52181<=_&&_<=52207||52209<=_&&_<=52235||52237<=_&&_<=52263||52265<=_&&_<=52291||52293<=_&&_<=52319||52321<=_&&_<=52347||52349<=_&&_<=52375||52377<=_&&_<=52403||52405<=_&&_<=52431||52433<=_&&_<=52459||52461<=_&&_<=52487||52489<=_&&_<=52515||52517<=_&&_<=52543||52545<=_&&_<=52571||52573<=_&&_<=52599||52601<=_&&_<=52627||52629<=_&&_<=52655||52657<=_&&_<=52683||52685<=_&&_<=52711||52713<=_&&_<=52739||52741<=_&&_<=52767||52769<=_&&_<=52795||52797<=_&&_<=52823||52825<=_&&_<=52851||52853<=_&&_<=52879||52881<=_&&_<=52907||52909<=_&&_<=52935||52937<=_&&_<=52963||52965<=_&&_<=52991||52993<=_&&_<=53019||53021<=_&&_<=53047||53049<=_&&_<=53075||53077<=_&&_<=53103||53105<=_&&_<=53131||53133<=_&&_<=53159||53161<=_&&_<=53187||53189<=_&&_<=53215||53217<=_&&_<=53243||53245<=_&&_<=53271||53273<=_&&_<=53299||53301<=_&&_<=53327||53329<=_&&_<=53355||53357<=_&&_<=53383||53385<=_&&_<=53411||53413<=_&&_<=53439||53441<=_&&_<=53467||53469<=_&&_<=53495||53497<=_&&_<=53523||53525<=_&&_<=53551||53553<=_&&_<=53579||53581<=_&&_<=53607||53609<=_&&_<=53635||53637<=_&&_<=53663||53665<=_&&_<=53691||53693<=_&&_<=53719||53721<=_&&_<=53747||53749<=_&&_<=53775||53777<=_&&_<=53803||53805<=_&&_<=53831||53833<=_&&_<=53859||53861<=_&&_<=53887||53889<=_&&_<=53915||53917<=_&&_<=53943||53945<=_&&_<=53971||53973<=_&&_<=53999||54001<=_&&_<=54027||54029<=_&&_<=54055||54057<=_&&_<=54083||54085<=_&&_<=54111||54113<=_&&_<=54139||54141<=_&&_<=54167||54169<=_&&_<=54195||54197<=_&&_<=54223||54225<=_&&_<=54251||54253<=_&&_<=54279||54281<=_&&_<=54307||54309<=_&&_<=54335||54337<=_&&_<=54363||54365<=_&&_<=54391||54393<=_&&_<=54419||54421<=_&&_<=54447||54449<=_&&_<=54475||54477<=_&&_<=54503||54505<=_&&_<=54531||54533<=_&&_<=54559||54561<=_&&_<=54587||54589<=_&&_<=54615||54617<=_&&_<=54643||54645<=_&&_<=54671||54673<=_&&_<=54699||54701<=_&&_<=54727||54729<=_&&_<=54755||54757<=_&&_<=54783||54785<=_&&_<=54811||54813<=_&&_<=54839||54841<=_&&_<=54867||54869<=_&&_<=54895||54897<=_&&_<=54923||54925<=_&&_<=54951||54953<=_&&_<=54979||54981<=_&&_<=55007||55009<=_&&_<=55035||55037<=_&&_<=55063||55065<=_&&_<=55091||55093<=_&&_<=55119||55121<=_&&_<=55147||55149<=_&&_<=55175||55177<=_&&_<=55203?f:_==9757||_==9977||9994<=_&&_<=9997||_==127877||127938<=_&&_<=127940||_==127943||127946<=_&&_<=127948||128066<=_&&_<=128067||128070<=_&&_<=128080||_==128110||128112<=_&&_<=128120||_==128124||128129<=_&&_<=128131||128133<=_&&_<=128135||_==128170||128372<=_&&_<=128373||_==128378||_==128400||128405<=_&&_<=128406||128581<=_&&_<=128583||128587<=_&&_<=128591||_==128675||128692<=_&&_<=128694||_==128704||_==128716||129304<=_&&_<=129308||129310<=_&&_<=129311||_==129318||129328<=_&&_<=129337||129341<=_&&_<=129342||129489<=_&&_<=129501?g:127995<=_&&_<=127999?m:_==8205?y:_==9792||_==9794||9877<=_&&_<=9878||_==9992||_==10084||_==127752||_==127806||_==127859||_==127891||_==127908||_==127912||_==127979||_==127981||_==128139||128187<=_&&_<=128188||_==128295||_==128300||_==128488||_==128640||_==128658?A:128102<=_&&_<=128105?b:d}return this}typeof WH<"u"&&WH.exports&&(WH.exports=Out)});var Tte,xI,Ue,CE,rf,Bo,oIe,vE,sIe,aIe,gr,Ac=hs(()=>{Tte=new Date(2107,11,31,23,59,58),xI=new Date(1980,0,1),Ue=void 0,CE=1/0,rf="undefined",Bo="function",oIe="object",vE="string",sIe="number",aIe="boolean",gr=new Uint8Array});function EI(e){if(e&&typeof e!=Bo)throw new Error(zIe);return e}function m5(e){if(e&&(typeof e.addEventListener!=Bo||typeof e.aborted!=aIe))throw new Error(VIe);return e||Ue}function p5(e,t){if(e&&typeof e!=vE||t&&!(t instanceof Uint8Array))throw new Error(vte)}function Ste(e,t,n){if(!Number.isInteger(e)||e<0||e>t)throw new Error(n)}function CI(e,t,n){e!==Ue&&Ste(e,t,n)}function SE(e){return typeof e==vE&&e.trim()?Number(e):e}var cIe,lIe,uIe,fIe,dIe,i5,r5,o5,s5,hIe,mIe,pIe,gIe,_Ie,yIe,AIe,bIe,a5,c5,l5,u5,xIe,TIe,EIe,CIe,vIe,SIe,wIe,IIe,PIe,Ete,DIe,RIe,G3,TI,OIe,MIe,NIe,LIe,FIe,BIe,Cte,kIe,UIe,f5,d5,ab,h5,V_,zIe,VIe,vte,W3=hs(()=>{Ac();cIe="filenameEncoding",lIe="commentEncoding",uIe="decodeText",fIe="extractPrependedData",dIe="extractAppendedData",i5="password",r5="rawPassword",o5="passThrough",s5="signal",hIe="checkPasswordOnly",mIe="checkOverlappingEntryOnly",pIe="checkOverlappingEntry",gIe="checkAmbiguity",_Ie="checkLocalDirectory",yIe="checkSignature",AIe="checkCrc32",bIe="checkAuthenticationCode",a5="useWebWorkers",c5="useCompressionStream",l5="transferStreams",u5="preventClose",xIe="encryptionStrength",TIe="extendedTimestamp",EIe="ntfsTimestamp",CIe="keepOrder",vIe="level",SIe="bufferedWrite",wIe="createTempStream",IIe="dataDescriptorSignature",PIe="useUnicodeFileNames",Ete="dataDescriptor",DIe="supportZip64SplitFile",RIe="encodeText",G3="offset",TI="usdz",OIe="unixExtraFieldType",MIe="localExtraField",NIe="centralExtraField",LIe="strictness",FIe="filenameValidation",BIe="normalizeFilename",Cte="maxAppendedDataSize",kIe="decryptCentralDirectory",UIe="signCentralDirectory",f5="filename",d5="comment",ab="strict",h5="balanced",V_="tolerant",zIe="Invalid option (must be a function)",VIe="Invalid signal (must be an AbortSignal instance)",vte="Invalid password (password must be a string, rawPassword must be a Uint8Array)"});function j_(){return wte}function q3(e){return Ite(e.chunkSize)}function Ite(e){return e=SE(e),Number.isInteger(e)&&e>=HIe?Math.max(e,tTt):jIe}function Y3(e){Object.assign(wte,$Ie(JIe(e)))}function $Ie(e){let t={};for(let n of rTt){let i=e[n];i!==Ue&&(t[n]=oTt(n,i))}return t}function oTt(e,t){if(XIe.includes(e)){if(t=SE(t),e==YIe&&(!Number.isInteger(t)||t<HIe))throw new Error(GIe)}else KIe.includes(e)&&EI(t);return t}function JIe(e){e=e||{};let{CompressionStreamZlib:t,DecompressionStreamZlib:n}=e;if(t===Ue&&n===Ue)return e;let i=Object.assign({},e);return i.CompressionStreamFallback===Ue&&(i.CompressionStreamFallback=t),i.DecompressionStreamFallback===Ue&&(i.DecompressionStreamFallback=n),i}function vI(e){let t=$Ie(JIe(e));Object.assign(qIe,t),Object.assign(wte,t)}var jIe,tTt,HIe,GIe,WIe,qIe,YIe,nTt,iTt,XIe,KIe,rTt,wte,_0=hs(()=>{Ac();W3();jIe=64*1024,tTt=64,HIe=1,GIe="Invalid maxWorkers (must be an integer greater than 0)",WIe=2;try{typeof navigator!=rf&&navigator.hardwareConcurrency&&(WIe=navigator.hardwareConcurrency)}catch{}qIe={workerURI:"./core/web-worker-wasm.js",wasmURI:"./core/streams/zlib-wasm/zlib-streams.wasm",chunkSize:jIe,maxWorkers:WIe,terminateWorkerTimeout:5e3,workerStarvationTimeout:5e3,workerStartupTimeout:5e3,useWebWorkers:!0,useCompressionStream:!0,transferStreams:!0,CompressionStream:typeof CompressionStream!=rf&&CompressionStream,DecompressionStream:typeof DecompressionStream!=rf&&DecompressionStream},YIe="maxWorkers",nTt=["baseURI","wasmURI","workerURI"],iTt=["useCompressionStream","useWebWorkers","transferStreams"],XIe=["chunkSize",YIe,"terminateWorkerTimeout","workerStarvationTimeout","workerStartupTimeout"],KIe=["createWorker","CompressionStream","DecompressionStream","CompressionStreamFallback","DecompressionStreamFallback"],rTt=[...nTt,...iTt,...XIe,...KIe],wte={...qIe}});function gh(e,t){let n=new Uint8Array(e.length+t.length);return n.set(e),n.set(t,e.length),n}function g5(e){return e.byteOffset||e.byteLength!=e.buffer.byteLength?new Uint8Array(e):e}function di(e){return new DataView(e.buffer,e.byteOffset,e.byteLength)}var wE=hs(()=>{});var X3,ZIe,sTt,aTt,cTt,lTt,uTt,fTt,dTt,Wm,K3=hs(()=>{X3=[[],[],[],[],[],[],[],[]];for(let e=0;e<256;e++){let t=e;for(let n=0;n<8;n++)t=t&1?t>>>1^3988292384:t>>>1;X3[0][e]=t}for(let e=0;e<256;e++)for(let t=1;t<8;t++){let n=X3[t-1][e];X3[t][e]=n>>>8^X3[0][n&255]}[ZIe,sTt,aTt,cTt,lTt,uTt,fTt,dTt]=X3,Wm=class{constructor(t){this.crc=t||-1}append(t){let n=this.crc|0,i=t.length|0,r=0;if(i>=8&&t.buffer){let o=new DataView(t.buffer,t.byteOffset,i),s=i-8;for(;r<=s;r+=8){let a=n^o.getInt32(r,!0),c=o.getInt32(r+4,!0);n=dTt[a&255]^fTt[a>>>8&255]^uTt[a>>>16&255]^lTt[a>>>24&255]^cTt[c&255]^aTt[c>>>8&255]^sTt[c>>>16&255]^ZIe[c>>>24&255]}}for(;r<i;r++)n=n>>>8^ZIe[(n^t[r])&255];this.crc=n}get(){return~this.crc}}});var $3,QIe=hs(()=>{K3();$3=class extends null{constructor(){let t,n=new Wm;super({transform(i,r){n.append(i),r.enqueue(i)},flush(){let i=new Uint8Array(4);new DataView(i.buffer).setUint32(0,n.get()),t.value=i}}),t=this}}});function SI(e){if(typeof TextEncoder==rf){e=unescape(encodeURIComponent(e));let t=new Uint8Array(e.length);for(let n=0;n<t.length;n++)t[n]=e.charCodeAt(n);return t}else return new TextEncoder().encode(e)}var Pte=hs(()=>{Ac()});var pu,J3,ePe,Dte,Rte,cb,tPe=hs(()=>{pu={concat(e,t){if(e.length===0||t.length===0)return e.concat(t);let n=e[e.length-1],i=pu.getPartial(n);return i===32?e.concat(t):pu._shiftRight(t,i,n|0,e.slice(0,e.length-1))},bitLength(e){let t=e.length;if(t===0)return 0;let n=e[t-1];return(t-1)*32+pu.getPartial(n)},clamp(e,t){if(e.length*32<t)return e;e=e.slice(0,Math.ceil(t/32));let n=e.length;return t=t&31,n>0&&t&&(e[n-1]=pu.partial(t,e[n-1]&2147483648>>t-1,1)),e},partial(e,t,n){return e===32?t:(n?t|0:t<<32-e)+e*1099511627776},getPartial(e){return Math.round(e/1099511627776)||32},_shiftRight(e,t,n,i){for(i===void 0&&(i=[]);t>=32;t-=32)i.push(n),n=0;if(t===0)return i.concat(e);for(let s=0;s<e.length;s++)i.push(n|e[s]>>>t),n=e[s]<<32-t;let r=e.length?e[e.length-1]:0,o=pu.getPartial(r);return i.push(pu.partial(t+o&31,t+o>32?n:i.pop(),1)),i}},J3={bytes:{fromBits(e){let n=pu.bitLength(e)/8,i=new Uint8Array(n),r;for(let o=0;o<n;o++)(o&3)===0&&(r=e[o/4]),i[o]=r>>>24,r<<=8;return i},toBits(e){let t=[],n,i=0;for(n=0;n<e.length;n++)i=i<<8|e[n],(n&3)===3&&(t.push(i),i=0);return n&3&&t.push(pu.partial(8*(n&3),i)),t}}},ePe={};ePe.sha1=class{constructor(e){let t=this;t.blockSize=512,t._init=[1732584193,4023233417,2562383102,271733878,3285377520],t._key=[1518500249,1859775393,2400959708,3395469782],e?(t._h=e._h.slice(0),t._buffer=e._buffer.slice(0),t._length=e._length):t.reset()}reset(){let e=this;return e._h=e._init.slice(0),e._buffer=[],e._length=0,e}update(e){let t=this;typeof e=="string"&&(e=J3.utf8String.toBits(e));let n=t._buffer=pu.concat(t._buffer,e),i=t._length,r=t._length=i+pu.bitLength(e);if(r>9007199254740991)throw new Error("Cannot hash more than 2^53 - 1 bits");let o=new Uint32Array(n),s=0;for(let a=t.blockSize+i-(t.blockSize+i&t.blockSize-1);a<=r;a+=t.blockSize)t._block(o.subarray(16*s,16*(s+1))),s+=1;return n.splice(0,16*s),t}finalize(){let e=this,t=e._buffer,n=e._h;t=pu.concat(t,[pu.partial(1,1)]);for(let i=t.length+2;i&15;i++)t.push(0);for(t.push(Math.floor(e._length/4294967296)),t.push(e._length|0);t.length;)e._block(t.splice(0,16));return e.reset(),n}_f(e,t,n,i){if(e<=19)return t&n|~t&i;if(e<=39)return t^n^i;if(e<=59)return t&n|t&i|n&i;if(e<=79)return t^n^i}_S(e,t){return t<<e|t>>>32-e}_block(e){let t=this,n=t._h,i=Array(80);for(let u=0;u<16;u++)i[u]=e[u];let r=n[0],o=n[1],s=n[2],a=n[3],c=n[4];for(let u=0;u<=79;u++){u>=16&&(i[u]=t._S(1,i[u-3]^i[u-8]^i[u-14]^i[u-16]));let f=t._S(5,r)+t._f(u,o,s,a)+c+i[u]+t._key[Math.floor(u/20)]|0;c=a,a=s,s=t._S(30,o),o=r,r=f}n[0]=n[0]+r|0,n[1]=n[1]+o|0,n[2]=n[2]+s|0,n[3]=n[3]+a|0,n[4]=n[4]+c|0}};Dte={};Dte.aes=class{constructor(e){let t=this;t._tables=[[[],[],[],[],[]],[[],[],[],[],[]]],t._tables[0][0][0]||t._precompute();let n=t._tables[0][4],i=t._tables[1],r=e.length,o,s,a,c=1;if(r!==4&&r!==6&&r!==8)throw new Error("invalid aes key size");for(t._key=[s=e.slice(0),a=[]],o=r;o<4*r+28;o++){let u=s[o-1];(o%r===0||r===8&&o%r===4)&&(u=n[u>>>24]<<24^n[u>>16&255]<<16^n[u>>8&255]<<8^n[u&255],o%r===0&&(u=u<<8^u>>>24^c<<24,c=c<<1^(c>>7)*283)),s[o]=s[o-r]^u}for(let u=0;o;u++,o--){let f=s[u&3?o:o-4];o<=4||u<4?a[u]=f:a[u]=i[0][n[f>>>24]]^i[1][n[f>>16&255]]^i[2][n[f>>8&255]]^i[3][n[f&255]]}}encrypt(e){return this._crypt(e,0)}decrypt(e){return this._crypt(e,1)}_precompute(){let e=this._tables[0],t=this._tables[1],n=e[4],i=t[4],r=[],o=[],s,a,c,u;for(let f=0;f<256;f++)o[(r[f]=f<<1^(f>>7)*283)^f]=f;for(let f=s=0;!n[f];f^=a||1,s=o[s]||1){let d=s^s<<1^s<<2^s<<3^s<<4;d=d>>8^d&255^99,n[f]=d,i[d]=f,u=r[c=r[a=r[f]]];let p=u*16843009^c*65537^a*257^f*16843008,g=r[d]*257^d*16843008;for(let m=0;m<4;m++)e[m][f]=g=g<<24^g>>>8,t[m][d]=p=p<<24^p>>>8}for(let f=0;f<5;f++)e[f]=e[f].slice(0),t[f]=t[f].slice(0)}_crypt(e,t){if(e.length!==4)throw new Error("invalid aes block size");let n=this._key[t],i=n.length/4-2,r=[0,0,0,0],o=this._tables[t],s=o[0],a=o[1],c=o[2],u=o[3],f=o[4],d=e[0]^n[0],p=e[t?3:1]^n[1],g=e[2]^n[2],m=e[t?1:3]^n[3],y=4,A,b,x;for(let T=0;T<i;T++)A=s[d>>>24]^a[p>>16&255]^c[g>>8&255]^u[m&255]^n[y],b=s[p>>>24]^a[g>>16&255]^c[m>>8&255]^u[d&255]^n[y+1],x=s[g>>>24]^a[m>>16&255]^c[d>>8&255]^u[p&255]^n[y+2],m=s[m>>>24]^a[d>>16&255]^c[p>>8&255]^u[g&255]^n[y+3],y+=4,d=A,p=b,g=x;for(let T=0;T<4;T++)r[t?3&-T:T]=f[d>>>24]<<24^f[p>>16&255]<<16^f[g>>8&255]<<8^f[m&255]^n[y++],A=d,d=p,p=g,g=m,m=A;return r}};Rte={};Rte.ctrGladman=class{constructor(e,t){this._prf=e,this._initIv=t,this._iv=t}reset(){this._iv=this._initIv}update(e){return this.calculate(this._prf,e,this._iv)}incWord(e){if((e>>24&255)===255){let t=e>>16&255,n=e>>8&255,i=e&255;t===255?(t=0,n===255?(n=0,i===255?i=0:++i):++n):++t,e=0,e+=t<<16,e+=n<<8,e+=i}else e+=1<<24;return e}incCounter(e){(e[0]=this.incWord(e[0]))===0&&(e[1]=this.incWord(e[1]))}calculate(e,t,n){let i;if(!(i=t.length))return[];let r=pu.bitLength(t);for(let o=0;o<i;o+=4){this.incCounter(n);let s=e.encrypt(n);t[o]^=s[0],t[o+1]^=s[1],t[o+2]^=s[2],t[o+3]^=s[3]}return pu.clamp(t,r)}};cb={importKey(e){return new cb.hmacSha1(J3.bytes.toBits(e))},pbkdf2(e,t,n,i){if(n=n||1e4,i<0||n<0)throw new Error("invalid params to pbkdf2");let r=(i>>5)+1<<2,o,s,a,c,u,f=new ArrayBuffer(r),d=new DataView(f),p=0,g=pu;for(t=J3.bytes.toBits(t),u=1;p<(r||1);u++){for(o=s=e.encrypt(g.concat(t,[u])),a=1;a<n;a++)for(s=e.encrypt(s),c=0;c<s.length;c++)o[c]^=s[c];for(a=0;p<(r||1)&&a<o.length;a++)d.setInt32(p,o[a]),p+=4}return f.slice(0,i/8)}};cb.hmacSha1=class{constructor(e){let t=this,n=t._hash=ePe.sha1,i=[[],[]];t._baseHash=[new n,new n];let r=t._baseHash[0].blockSize/32;e.length>r&&(e=new n().update(e).finalize());for(let o=0;o<r;o++)i[0][o]=e[o]^909522486,i[1][o]=e[o]^1549556828;t._baseHash[0].update(i[0]),t._baseHash[1].update(i[1]),t._resultHash=new n(t._baseHash[0])}reset(){let e=this;e._resultHash=new e._hash(e._baseHash[0]),e._updated=!1}update(e){let t=this;t._updated=!0,t._resultHash.update(e)}digest(){let e=this,t=e._resultHash.finalize(),n=new e._hash(e._baseHash[1]).update(t).finalize();return e.reset(),n}encrypt(e){if(this._updated)throw new Error("encrypt on already updated hmac called!");return this.update(e),this.digest(e)}}});function _5(e){if(hTt)return crypto.getRandomValues(e);throw new Error(wI)}var hTt,y0,lb,ub,H_,wI,y5=hs(()=>{Ac();hTt=typeof crypto!=rf&&typeof crypto.getRandomValues==Bo,y0="Invalid password",lb="Invalid signature",ub=lb,H_="zipjs-abort-check-password",wI="Crypto API not supported"});function sPe(e,t,n,i){Object.assign(e,{ready:new Promise(r=>e.resolveReady=r),password:wTt(t,n),strength:i-1,pendingInput:gr})}function aPe(e,t,n,i,r,o){let{ctr:s,hmac:a,pendingInput:c}=e;c.length&&(t=gh(c,t));let u=t.length-r;n=ITt(n,i+(u-u%II));let f;for(f=0;f<=u-II;f+=II){let d=tU(A0,_h(t,f,f+II));o&&a.update(d);let p=s.update(d);o||a.update(p),n.set(eU(A0,p),f+i)}return e.pendingInput=_h(t,f),n}async function ETt(e,t,n,i){let r=await cPe(e,t,n,_h(i,0,Q3[t])),o=_h(i,Q3[t]);if(r[0]!=o[0]||r[1]!=o[1])throw new Error(y0)}async function CTt(e,t,n){let i=_5(new Uint8Array(Q3[t])),r=await cPe(e,t,n,i);return gh(i,r)}async function cPe(e,t,n,i){e.password=null;let r=await vTt(mTt,n,_Tt,!1,yTt),o=await STt(Object.assign({salt:i},Ote),r,8*(Z3[t]*2+2)),s=new Uint8Array(o),a=tU(A0,_h(s,0,Z3[t])),c=tU(A0,_h(s,Z3[t],Z3[t]*2)),u=_h(s,Z3[t]*2);return Object.assign(e,{keys:{key:a,authentication:c,passwordVerification:u},ctr:new xTt(new bTt(a),Array.from(ATt)),hmac:new TTt(c)}),u}async function vTt(e,t,n,i,r){if(nPe)try{return await nU.importKey(e,t,n,i,r)}catch{return nPe=!1,cb.importKey(t)}else return cb.importKey(t)}async function STt(e,t,n){if(iPe)try{return await nU.deriveBits(e,t,n)}catch{return iPe=!1,cb.pbkdf2(t,e.salt,Ote.iterations,n)}else return cb.pbkdf2(t,e.salt,Ote.iterations,n)}function wTt(e,t){return t===Ue?SI(e):t}function ITt(e,t){if(t&&t>e.length){let n=e;e=new Uint8Array(t),e.set(n,0)}return e}function _h(e,t,n){return e.subarray(t,n)}function eU(e,t){return e.fromBits(t)}function tU(e,t){return e.toBits(t)}var II,mTt,rPe,pTt,gTt,_Tt,Ote,yTt,Q3,Z3,G_,ATt,x5,nU,oPe,A0,bTt,xTt,TTt,nPe,iPe,A5,b5,lPe=hs(()=>{Ac();Pte();wE();tPe();y5();II=16,mTt="raw",rPe={name:"PBKDF2"},pTt={name:"HMAC"},gTt="SHA-1",_Tt=Object.assign({hash:pTt},rPe),Ote=Object.assign({iterations:1e3,hash:{name:gTt}},rPe),yTt=["deriveBits"],Q3=[8,12,16],Z3=[16,24,32],G_=10,ATt=[0,0,0,0],x5=typeof crypto!=rf,nU=x5&&crypto.subtle,oPe=x5&&typeof nU!=rf,A0=J3.bytes,bTt=Dte.aes,xTt=Rte.ctrGladman,TTt=cb.hmacSha1,nPe=x5&&oPe&&typeof nU.importKey==Bo,iPe=x5&&oPe&&typeof nU.deriveBits==Bo,A5=class extends null{constructor({password:t,rawPassword:n,encryptionStrength:i,checkPasswordOnly:r,checkAuthenticationCode:o=!0}){super({start(){sPe(this,t,n,i)},async transform(s,a){let c=this,{password:u,strength:f,resolveReady:d,ready:p}=c;u?(await ETt(c,f,u,_h(s,0,Q3[f]+2)),s=_h(s,Q3[f]+2),r?a.error(new Error(H_)):d()):await p;let g=new Uint8Array(s.length-G_-(s.length-G_)%II);a.enqueue(aPe(c,s,g,0,G_,!0))},async flush(s){let{ctr:a,hmac:c,pendingInput:u,ready:f}=this;if(c&&a){await f;let d=_h(u,0,u.length-G_),p=_h(u,u.length-G_),g=gr;if(d.length){let A=tU(A0,d);c.update(A);let b=a.update(A);g=eU(A0,b)}let m=_h(eU(A0,c.digest()),0,G_),y=u.length<G_?1:0;for(let A=0;A<G_;A++)y|=m[A]^p[A];if(y&&o)throw new Error(ub);s.enqueue(g)}}})}},b5=class extends null{constructor({password:t,rawPassword:n,encryptionStrength:i}){super({start(){sPe(this,t,n,i)},async transform(r,o){let s=this,{password:a,strength:c,resolveReady:u,ready:f}=s,d=gr;a?(d=await CTt(s,c,a),u()):await f;let p=new Uint8Array(d.length+r.length-r.length%II);p.set(d,0),o.enqueue(aPe(s,r,p,d.length,0))},async flush(r){let{ctr:o,hmac:s,pendingInput:a,ready:c}=this;if(s&&o){await c;let u=gr;if(a.length){let d=o.update(tU(A0,a));s.update(d),u=eU(A0,d)}let f=eU(A0,s.digest()).slice(0,G_);r.enqueue(gh(u,f))}}})}}});function hPe(e,t,n,i){Object.assign(e,{password:t,rawPassword:n,passwordVerification:i}),PTt(e,t,n)}function uPe(e,t){let n=new Uint8Array(t.length);for(let i=0;i<t.length;i++)n[i]=mPe(e)^t[i],C5(e,n[i]);return n}function fPe(e,t){let n=new Uint8Array(t.length);for(let i=0;i<t.length;i++)n[i]=mPe(e)^t[i],C5(e,t[i]);return n}function PTt(e,t,n){let i=[305419896,591751049,878082192];if(Object.assign(e,{keys:i,crcKey0:new Wm(i[0]),crcKey2:new Wm(i[2])}),n)for(let r=0;r<n.length;r++)C5(e,n[r]);else for(let r=0;r<t.length;r++)C5(e,t.charCodeAt(r))}function C5(e,t){let[,n]=e.keys;e.crcKey0.append([t]);let i=~e.crcKey0.get();n=dPe(Math.imul(dPe(n+pPe(i)),134775813)+1),e.crcKey2.append([n>>>24]);let r=~e.crcKey2.get();e.keys=[i,n,r]}function mPe(e){let t=e.keys[2]|2;return pPe(Math.imul(t,t^1)>>>8)}function pPe(e){return e&255}function dPe(e){return e&4294967295}var PI,T5,E5,gPe=hs(()=>{K3();y5();PI=12,T5=class extends null{constructor({password:t,rawPassword:n,passwordVerification:i,checkPasswordOnly:r}){super({start(){hPe(this,t,n,i)},transform(o,s){let a=this;if(a.password||a.rawPassword){let c=uPe(a,o.subarray(0,PI));if(a.password=a.rawPassword=null,(c[PI-1]^a.passwordVerification)!=0)throw new Error(y0);o=o.subarray(PI)}r?s.error(new Error(H_)):s.enqueue(uPe(a,o))}})}},E5=class extends null{constructor({password:t,rawPassword:n,passwordVerification:i}){super({start(){hPe(this,t,n,i)},transform(r,o){let s=this,a,c;if(s.password||s.rawPassword){s.password=s.rawPassword=null;let u=_5(new Uint8Array(PI));u[PI-1]=s.passwordVerification,a=new Uint8Array(r.length+u.length),a.set(fPe(s,u),0),c=PI}else a=new Uint8Array(r.length),c=0;a.set(fPe(s,r),c),o.enqueue(a)}})}}});function qm(e){if(e instanceof ReadableStream)return e;let t=e.getReader();return new ReadableStream({async pull(n){let{value:i,done:r}=await t.read();r?n.close():n.enqueue(i)},cancel(n){return t.cancel(n)}})}function b0(e,t){e=qm(e);let n=t?{type:t}:{};if(DTt())return new Response(e).blob().then(r=>t?new Blob([r],n):r);let i=[];return e.pipeTo(new WritableStream({write(r){i.push(r)}})).then(()=>new Blob(i,n))}function DTt(){return typeof Blob.prototype.stream!=Bo||new Blob([]).stream()instanceof ReadableStream}function _Pe(e){if(e instanceof WritableStream)return e;let t=e.getWriter();return new WritableStream({write(n){return t.write(n)},close(){return t.close()},abort(n){return t.abort(n)}})}var DI=hs(()=>{Ac()});function v5(e){return RTt.get(e)}function S5(e){return Mte.get(e)}function OTt(e,t){let{CompressionStream:n,DecompressionStream:i}=t;if(typeof n!=Bo&&typeof i!=Bo)throw new Error(yPe);Mte.set(e,{CompressionStream:n,DecompressionStream:i})}async function APe(e,t){!Mte.has(e)&&t&&OTt(e,await import(t))}var yPe,RTt,Mte,PE=hs(()=>{Ac();yPe="Invalid codec module",RTt=new Map,Mte=new Map});function FTt(e,t,n){let i=new Wm,r=0,o=!1,s,a,c,u=new Promise((m,y)=>{a=m,c=y});u.catch(()=>{}),n||a();let f=new null({start(m){let y=new Uint8Array(TPe);y.set(NTt),m.enqueue(y)},transform(m,y){y.enqueue(m)},async flush(m){o=!0,p();try{await u}finally{g()}let y=new Uint8Array(Nte),A=di(y);A.setUint32(0,i.get(),!0),A.setUint32(4,n,!0),m.enqueue(y)},cancel(m){c(m)}}),d=new null({transform(m,y){i.append(m),r+=m.length,r>=n?a():o&&p(),y.enqueue(m)},cancel(m){c(m)}});return e=Ym(e,f),e=OI(e,t),Ym(e,d);function p(){g(),s=setTimeout(()=>c(new Error(fb)),LTt)}function g(){clearTimeout(s)}}function Fte(e,t){if(!e)return!1;let n=bPe.get(e);n||(n=new Map,bPe.set(e,n));let i=n.get(t);if(i===Ue){try{new e(t),i=!0}catch{i=!1}n.set(t,i)}return i}function D5(e){return Fte(e,Lte)}function Bte(e){return Fte(e,rU)}function EPe(e,t,n){t=Ym(t,new null({flush:n})),Object.defineProperty(e,"readable",{get(){return t}})}function CPe(e,t,n){if(!e)throw new Error(MTt);return new e(t,n)}function vPe(e,t,n,i,r){let o=t&&i?i:r||i,s=n.deflate64?xPe:Lte,a;try{a=new o(s,n)}catch(c){if(t&&r&&o!=r)a=new r(s,n);else throw c}return OI(e,a)}function Ym(e,t){return qm(e).pipeThrough(t)}function OI(e,t){let n=t.writable.getWriter(),i=e.getReader();return r(),t.readable;async function r(){try{for(;;){await n.ready;let o=await i.read();if(o.done){await n.close();break}await n.write(o.value)}}catch(o){await BTt(n,o),await kTt(i,o)}}}async function BTt(e,t){try{await e.abort(t)}catch{}}async function kTt(e,t){try{await e.cancel(t)}catch{}}function UTt(e){let t=e.getReader();return new ReadableStream({async pull(n){let i;try{i=await t.read()}catch(s){if(s&&s.message)throw s;let a=new Error(MI);throw a.cause=s,a}let{value:r,done:o}=i;o?n.close():n.enqueue(r)},cancel(n){return t.cancel(n)}})}var fb,MI,NI,MTt,Lte,xPe,rU,TPe,Nte,NTt,LTt,w5,I5,P5,bPe,kte=hs(()=>{K3();QIe();lPe();gPe();y5();Ac();wE();DI();PE();fb="Invalid uncompressed size",MI="Invalid compressed data",NI=lb,MTt="Compression method not supported",Lte="deflate-raw",xPe="deflate64-raw",rU="gzip",TPe=10,Nte=8,NTt=[31,139,8],LTt=5e3,w5=class extends null{constructor(t,{chunkSize:n,CompressionStreamFallback:i,CompressionStream:r}){super({});let{compressed:o,encrypted:s,useCompressionStream:a,zipCrypto:c,computeCrc32:u,level:f,deflate64:d,format:p,compressionMethod:g,inputSize:m}=t,y=this,A,b,x,T=super.readable,E=p&&S5(p),v=u&&o&&!d&&!E&&(!s||c)&&!!(a&&r);if((!s||c)&&u&&!v&&(A=new $3,T=Ym(T,A)),o)if(E)T=OI(T,CPe(E.CompressionStream,p,{level:f,chunkSize:n,compressionMethod:g,uncompressedSize:m}));else if(v)x=new I5,T=OI(T,new r(rU)),T=Ym(T,x);else try{T=vPe(T,a,{level:f,chunkSize:n},r,i)}catch(S){let I;try{I=new r(rU)}catch{throw S}T=OI(T,I),T=Ym(T,new I5)}s&&(c?T=Ym(T,new E5(t)):(b=new b5(t),T=Ym(T,b))),EPe(y,T,()=>{(!s||c)&&u&&(y.crc32=v?x.crc32:new DataView(A.value.buffer).getUint32(0))})}},I5=class extends null{constructor(){let t,n=TPe,i=new Uint8Array(0);super({transform(r,o){if(n){let u=Math.min(n,r.length);if(n-=u,r=r.subarray(u),!r.length)return}let s=i.length+r.length;if(s<=Nte){i=gh(i,r);return}let a=s-Nte,c=Math.min(a,i.length);o.enqueue(gh(i.subarray(0,c),r.subarray(0,a-c))),i=gh(i.subarray(c),r.subarray(a-c))},flush(){let r=di(i);t.crc32=r.getUint32(0,!0),t.uncompressedSize=r.getUint32(4,!0)}}),t=this}};P5=class extends null{constructor(t,{chunkSize:n,DecompressionStreamFallback:i,DecompressionStream:r}){super({});let{zipCrypto:o,encrypted:s,checkCrc32:a,crc32:c,compressed:u,useCompressionStream:f,deflate64:d,format:p,compressionMethod:g,rawBitFlag:m,outputSize:y}=t,A,b,x=super.readable;if(s&&(o?x=Ym(x,new T5(t)):(b=new A5(t),x=Ym(x,b))),u){let T=p&&S5(p);if(T)x=OI(x,CPe(T.DecompressionStream,p,{chunkSize:n,compressionMethod:g,rawBitFlag:m,uncompressedSize:y}));else try{x=vPe(x,f,{chunkSize:n,deflate64:d},r,i)}catch(E){if(d||y===Ue)throw E;let v;try{v=new r(rU)}catch{throw E}x=FTt(x,v,y)}x=UTt(x)}a&&(A=new $3,x=Ym(x,A)),EPe(this,x,()=>{if(a){let T=new DataView(A.value.buffer);if(c!=T.getUint32(0,!1))throw new Error(NI)}})}},bPe=new Map});var zTt,SPe,wPe,IPe,Ute,PPe,DPe,LI,O5,R5,oU,M5=hs(()=>{Ac();kte();zTt=64*1024,SPe="message",wPe="start",IPe="pull",Ute="data",PPe="ack",DPe="close",LI="deflate",O5="inflate",R5=class extends null{constructor(t,n){super({});let i=this,{codecType:r}=t,o;r.startsWith(LI)?o=w5:r.startsWith(O5)&&(o=P5),i.outputSize=0;let s=0,a=new o(t,n),c=super.readable,u=new null({transform(d,p){d&&d.length&&(s+=d.length,p.enqueue(d))},flush(){Object.assign(i,{inputSize:s})}}),f=new null({transform(d,p){if(d&&d.length&&(p.enqueue(d),i.outputSize+=d.length,t.outputSize!==Ue&&i.outputSize>t.outputSize))throw new Error(fb)},flush(){let{crc32:d}=a;Object.assign(i,{crc32:d,inputSize:s})}});Object.defineProperty(i,"readable",{get(){return c.pipeThrough(u).pipeThrough(a).pipeThrough(f)}})}},oU=class extends null{constructor(t){let n=[],i=0;(!Number.isFinite(t)||t<1)&&(t=zTt),super({transform(s,a){for(n.push(s),i+=s.length;i>t;)a.enqueue(r())},flush(s){i&&s.enqueue(o(n,i))}});function r(){let s=new Uint8Array(t),a=0;for(;a<t;){let c=n[0],u=t-a;c.length<=u?(s.set(c,a),a+=c.length,n.shift()):(s.set(c.subarray(0,u),a),n[0]=c.subarray(u),a+=u)}return i-=t,s}function o(s,a){let c=new Uint8Array(a),u=0;for(let f of s)c.set(f,u),u+=f.length;return c}}}});function OPe({initModule:e}){L5=e}function MPe(e){Vte=e}async function NPe(e){let{CompressionStream:t,CompressionStreamFallback:n}=e;if(n&&!n.requiresModule||D5(t)||Bte(t))return!0;if(n)try{return await L5(e),!0}catch{return!1}return!1}function Hte(e){e.createWorker?RPe=!0:N5=!1}async function zte(e,...t){try{await e(...t)}catch{}}function Gte(e,t){return{run:()=>F5(e,t)}}async function F5({options:e,readable:t,writable:n,onTaskFinished:i},r){let o;try{if(e.compressed&&!e.format){let u=e.codecType.startsWith(LI),f=u?r.CompressionStreamFallback:r.DecompressionStreamFallback,d=u?r.CompressionStream:r.DecompressionStream;if(e.useCompressionStream){if(f&&f.requiresModule&&!D5(d))try{await L5(r)}catch{}}else try{await L5(r)}catch{(!f||f.requiresModule)&&(e.useCompressionStream=!0)}}o=new R5(e,r),await t.pipeThrough(o).pipeThrough(new oU(q3(r))).pipeTo(n,{preventClose:!0,preventAbort:!0});let{crc32:s,inputSize:a,outputSize:c}=o;return{crc32:s,inputSize:a,outputSize:c}}catch(s){throw o&&(s.outputSize=o.outputSize),s}finally{i()}}var RE,N5,RPe,Vte,L5,DE,jte,sU=hs(()=>{Ac();_0();M5();RE="Worker startup timeout",L5=()=>{};DE=class{constructor(t,{readable:n,writable:i},{options:r,config:o,streamOptions:s,useWebWorkers:a,transferStreams:c,workerURI:u,createWorker:f},d){let{signal:p}=s;return RPe&&(f=Ue),Object.assign(t,{busy:!0,generation:(t.generation||0)+1,readable:n.pipeThrough(new oU(q3(o))).pipeThrough(new jte(s),{signal:p}),writable:i,options:Object.assign({},r),workerURI:u,createWorker:f,transferStreams:c,terminate(){return new Promise(g=>{let{worker:m,busy:y}=t;m?(y?t.resolveTerminated=g:(m.terminate(),g()),t.interface=null):g()})},onTaskFinished(){if(t.busy){let{resolveTerminated:g}=t;g&&(t.resolveTerminated=null,t.terminated=!0,t.worker.terminate(),g()),t.busy=!1,d(t)}}}),N5===Ue&&(N5=typeof Worker!=rf),(a&&Vte&&(N5&&u||f)?Vte:Gte)(t,o)}},jte=class extends null{constructor({onstart:t,onprogress:n,size:i,onend:r}){let o=0;super({async start(){t&&await zte(t,i)},async transform(s,a){o+=s.length,n&&await zte(n,o,i),a.enqueue(s)},async flush(){r&&await zte(r,o)}})}}});async function z5(e,t){let{options:n,config:i}=t,{transferStreams:r,useWebWorkers:o,useCompressionStream:s,compressed:a,checkCrc32:c,computeCrc32:u,encrypted:f,format:d,codecURI:p}=n,{workerURI:g,createWorker:m,maxWorkers:y}=i;d&&(p&&(n.codecURI=YTt(p,i.baseURI)),await APe(d,n.codecURI)),t.transferStreams=!d&&(r||r===Ue&&i.transferStreams);let A=!a&&!c&&!u&&!f,b=d===Ue||!!n.codecURI;return t.useWebWorkers=!A&&b&&(o||o===Ue&&i.useWebWorkers),t.workerURI=t.useWebWorkers&&g?g:Ue,t.createWorker=t.useWebWorkers&&m?m:Ue,n.useCompressionStream=s||s===Ue&&i.useCompressionStream,(await x()).run();async function x(){let E=OE.find(v=>!v.busy);if(E)return jPe(E),new DE(E,e,t,T);if(OE.length<y){let v={indexWorker:VPe};return VPe++,OE.push(v),new DE(v,e,t,T)}else return new Promise(v=>{FI.push({resolve:v,stream:e,workerOptions:t}),k5=i.workerStarvationTimeout,U5()})}function T(E){if(HPe(),FI.length){let[{resolve:v,stream:S,workerOptions:I}]=FI.splice(0,1);v(new DE(E,S,I,T)),U5()}else E.worker?(jPe(E),$Tt(E,t)):OE=OE.filter(v=>v!=E)}}function YTt(e,t){try{return new URL(e,t).toString()}catch{return e}}function U5(){!BI&&FI.length&&Number.isFinite(k5)&&k5>=0&&(BI=setTimeout(XTt,k5))}function HPe(){BI&&(clearTimeout(BI),BI=null)}function XTt(){if(BI=null,FI.length){let[{resolve:e,stream:t,workerOptions:n}]=FI.splice(0,1),i=Object.assign({},n,{useWebWorkers:!1,workerURI:Ue,createWorker:Ue});e(new DE({},t,i,KTt)),U5()}}function KTt(){HPe(),U5()}function $Tt(e,t){let{config:n}=t,{terminateWorkerTimeout:i}=n;Number.isFinite(i)&&i>=0&&(e.terminated?e.terminated=!1:e.terminateTimeout=setTimeout(async()=>{OE=OE.filter(r=>r!=e);try{await e.terminate()}catch{}},i))}function jPe(e){let{terminateTimeout:t}=e;t&&(clearTimeout(t),e.terminateTimeout=null)}var OE,FI,BI,k5,VPe,V5=hs(()=>{Ac();M5();PE();sU();OE=[],FI=[],VPe=0});function WPe(e){if(JTt){let t="";for(let n=0;n<e.length;n++)t+=GPe[e[n]];return t}else return new TextDecoder().decode(e)}var GPe,JTt,qPe=hs(()=>{GPe="\0\u263A\u263B\u2665\u2666\u2663\u2660\u2022\u25D8\u25CB\u25D9\u2642\u2640\u266A\u266B\u263C\u25BA\u25C4\u2195\u203C\xB6\xA7\u25AC\u21A8\u2191\u2193\u2192\u2190\u221F\u2194\u25B2\u25BC !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~\u2302\xC7\xFC\xE9\xE2\xE4\xE0\xE5\xE7\xEA\xEB\xE8\xEF\xEE\xEC\xC4\xC5\xC9\xE6\xC6\xF4\xF6\xF2\xFB\xF9\xFF\xD6\xDC\xA2\xA3\xA5\u20A7\u0192\xE1\xED\xF3\xFA\xF1\xD1\xAA\xBA\xBF\u2310\xAC\xBD\xBC\xA1\xAB\xBB\u2591\u2592\u2593\u2502\u2524\u2561\u2562\u2556\u2555\u2563\u2551\u2557\u255D\u255C\u255B\u2510\u2514\u2534\u252C\u251C\u2500\u253C\u255E\u255F\u255A\u2554\u2569\u2566\u2560\u2550\u256C\u2567\u2568\u2564\u2565\u2559\u2558\u2552\u2553\u256B\u256A\u2518\u250C\u2588\u2584\u258C\u2590\u2580\u03B1\xDF\u0393\u03C0\u03A3\u03C3\xB5\u03C4\u03A6\u0398\u03A9\u03B4\u221E\u03C6\u03B5\u2229\u2261\xB1\u2265\u2264\u2320\u2321\xF7\u2248\xB0\u2219\xB7\u221A\u207F\xB2\u25A0\xA0".split(""),JTt=GPe.length==256});function aU(e,t){return XPe(e,t,!0)}function YPe(e,t){return XPe(e,t,!1)}function XPe(e,t,n){return t&&t.trim().toLowerCase()=="cp437"?WPe(e):new TextDecoder(t,{ignoreBOM:n}).decode(e)}var $te=hs(()=>{qPe()});function QTt(){ZPe=(async()=>{try{let t=new Blob([new Uint8Array(3)]).slice(1,2).stream().getReader(),n=0,i=await t.read();for(;!i.done;)n+=i.value.length,i=await t.read();Jte=n==1}catch{Jte=!1}})()}function W5(e){return!!(e&&e.getData)}async function Uc(e,t){if(e.init&&!e.initialized)await e.init(t);else return Promise.resolve()}async function eEt(e){return e=new W_(e),await Uc(e),(e.size===Ue||!e.readUint8Array)&&(e=new of(await b0(e.readable)),await Uc(e)),e}function Uo(e,t,n){return e.readUint8Array(t,n)}function Qte(e,t){return e.createReadable?e.createReadable(t):e.readUint8Array?UI.prototype.createReadable.call(e,t):e.readable}var $Pe,JPe,ZTt,JFi,ZFi,Zte,KPe,kI,UI,j5,cU,Jte,ZPe,of,zI,lU,uU,H5,G5,W_,VI,q5=hs(()=>{Ac();_0();wE();DI();$te();$Pe="Writer iterator completed too soon",JPe="Writer not initialized",ZTt="text/plain",JFi=256*1024,ZFi=16*1024*1024,Zte="writable",KPe=Symbol(),kI=class{constructor(){this.size=0}init(){this.initialized=!0}},UI=class extends kI{get readable(){return this.createReadable()}createReadable({offset:t=0,size:n,chunkSize:i=q3(j_())}={}){let r=this,o=0;return i=Ite(i),new ReadableStream({async pull(s){let a=n===Ue?i:Math.min(i,n-o),c=await Uo(r,t+o,a);c.length&&s.enqueue(c),o+i>=n||!c.length&&a?s.close():o+=i}})}},j5=class extends kI{constructor(){super();let t=this,n=new WritableStream({write(i){if(!t.initialized)throw new Error(JPe);return t.writeUint8Array(g5(i))}});Object.defineProperty(t,Zte,{get(){return n}})}writeUint8Array(){}},cU=class extends j5{constructor(t){super(),Object.assign(this,{contentType:t,data:"data:"+(t||"")+";base64,",pendingCharacters:""})}writeUint8Array(t){let n=this,i,r=n.pendingCharacters,o=n.pendingCharacters.length;for(n.pendingCharacters="",i=0;i<Math.floor((o+t.length)/3)*3-o;i++)r+=String.fromCharCode(t[i]);for(;i<t.length;i++)n.pendingCharacters+=String.fromCharCode(t[i]);r.length>2?n.data+=btoa(r):n.pendingCharacters=r+n.pendingCharacters}getData(){return this.data+btoa(this.pendingCharacters)}};of=class extends UI{constructor(t){super(),Object.assign(this,{sourceBlob:t,size:t.size}),ZPe||QTt()}createReadable(t){let n=this,{sourceBlob:i,size:r}=n,{offset:o=0,size:s=r-o}=t||{};return!o&&s>=r?qm(i.stream()):Jte?qm(i.slice(o,o+s).stream()):super.createReadable(t)}async readUint8Array(t,n){let i=this,r=t+n,a=await(!t&&r>=i.size?i.sourceBlob:i.sourceBlob.slice(t,r)).arrayBuffer();return a.byteLength>n&&(a=a.slice(t,r)),new Uint8Array(a)}},zI=class extends kI{constructor(t){super();let n=this,i=new null;Object.defineProperty(n,Zte,{get(){return i.writable}}),n.contentType=t,n.blobPromise=b0(i.readable,t),n.blobPromise.catch(()=>{})}getData(){return this.blobPromise}},lU=class extends of{constructor(t){super(new Blob([t],{type:ZTt}))}},uU=class extends zI{constructor(t){super(),Object.assign(this,{encoding:t,utf8:!t||t.toLowerCase()=="utf-8"})}async getData(){let{encoding:t,utf8:n}=this,i=await super.getData();return i.text&&n?i.text():YPe(new Uint8Array(await i.arrayBuffer()),t)}},H5=class extends UI{constructor(t){super(),this.readers=t}async init(){let t=this;t.lastDiskNumber=0;let n=t.readers=await Promise.all(t.readers.map(eEt));t.diskOffsets=n.map(i=>{let r=t.size;return t.size+=i.size,r}),super.init()}getDiskOffset(t){let{diskOffsets:n,size:i}=this,r=n[t];return r===Ue?i:r}async readUint8Array(t,n){let i=this,{readers:r}=this,o,s=0,a=t;for(;r[s]&&a>=r[s].size;)a-=r[s].size,s++;let c=r[s];if(c){let u=c.size;if(a+n<=u)o=await Uo(c,a,n);else{let f=u-a,d=await Uo(c,a,f),p=await i.readUint8Array(t+f,n-f);o=gh(d,p)}}else o=gr;return i.lastDiskNumber=Math.max(s,i.lastDiskNumber),o}},G5=class extends kI{constructor(t,n=4294967295){super();let i=this;Object.assign(i,{diskNumber:0,diskOffset:0,size:0,maxSize:n,availableSize:n});let r,o,s,a=new WritableStream({async write(d){if(d===KPe){s&&await u();return}let{availableSize:p}=i;if(s)d.length>=p?(await c(d.subarray(0,p)),await u(),d.length>p&&await this.write(d.subarray(p))):await c(d);else{let{value:g,done:m}=await t.next();if(m&&!g)throw new Error($Pe);r=g,r.size=0,r.maxSize&&(i.maxSize=r.maxSize),i.availableSize=i.maxSize,await Uc(r),o=g.writable,s=o.getWriter(),await this.write(d)}},async close(){s&&(await s.ready,await f())},async abort(d){s&&await s.abort(d)}});Object.defineProperty(i,Zte,{get(){return a}});async function c(d){let p=d.length;p&&(await s.ready,await s.write(d),r.size+=p,i.availableSize-=p)}async function u(){await f(),i.diskOffset+=r.size,i.diskNumber++,s=null,i.availableSize=i.maxSize}async function f(){await s.close()}}async closeDisk(){let t=this.writable.getWriter();try{await t.ready,await t.write(KPe)}finally{t.releaseLock()}}},W_=class{constructor(t){return Array.isArray(t)&&(t=new H5(t)),(t instanceof ReadableStream||typeof t.getReader==Bo)&&(t={readable:qm(t)}),t}},VI=class{constructor(t){return t.writable===Ue&&typeof t.next==Bo&&(t=new G5(t)),(t instanceof WritableStream||typeof t.getWriter==Bo)&&(t={writable:_Pe(t)}),t.size===Ue&&(t.size=0),t}}});var ene,tne,fU,nne,dU,ine,rne,one,jI,HI,hU,sne,mU,ane,cne,lne,Y5,X5,une,fne,dne,K5,hne,mne,pne,gne,ME,_ne,tEt,yne,$5,nEt,J5,iEt,rEt,oEt,sEt,Ane,bne,xne,Tne,aEt,cEt,lEt,uEt,fEt,dEt,hEt,mEt,pEt,gEt,_Et,yEt,AEt,bEt,xEt,TEt,db,Ene=hs(()=>{ene="filename",tne="rawFilename",fU="comment",nne="rawComment",dU="uncompressedSize",ine="compressedSize",rne="offset",one="diskNumberStart",jI="lastModDate",HI="rawLastModDate",hU="lastAccessDate",sne="rawLastAccessDate",mU="creationDate",ane="rawCreationDate",cne="internalFileAttributes",lne="externalFileAttributes",Y5="internalFileAttribute",X5="externalFileAttribute",une="msdosAttributesRaw",fne="msdosAttributes",dne="msDosCompatible",K5="zip64",hne="encrypted",mne="version",pne="versionMadeBy",gne="zipCrypto",ME="directory",_ne="executable",tEt="symlink",yne="compressionMethod",$5="signature",nEt="crc32",J5="extraField",iEt="extraFieldInfoZip",rEt="extraFieldUnix",oEt="extraFieldUnixType1",sEt="extraFieldPkwareUnix",Ane="unixMode",bne="setuid",xne="setgid",Tne="sticky",aEt="bitFlag",cEt="rawBitFlag",lEt="filenameLength",uEt="extraFieldLength",fEt="unixExternalUpper",dEt="filenameUTF8",hEt="commentUTF8",mEt="rawExtraField",pEt="extraFieldZip64",gEt="extraFieldUnicodePath",_Et="extraFieldUnicodeComment",yEt="extraFieldAES",AEt="extraFieldNTFS",bEt="extraFieldExtendedTimestamp",xEt="extraFieldUSDZ",TEt=[ene,tne,dU,ine,jI,HI,fU,nne,hU,sne,mU,ane,rne,one,cne,lne,Y5,X5,une,fne,dne,K5,hne,mne,pne,gne,ME,_ne,tEt,yne,$5,nEt,J5,rEt,iEt,oEt,sEt,"uid","gid",Ane,fEt,bne,xne,Tne,aEt,cEt,lEt,uEt,dEt,hEt,mEt,pEt,gEt,_Et,yEt,AEt,bEt,xEt],db=class{constructor(t){TEt.forEach(n=>this[n]=t[n])}}});var SDe={};Oq(SDe,{ERR_AMBIGUOUS_ARCHIVE:()=>Jne,ERR_BAD_FORMAT:()=>GI,ERR_CENTRAL_DIRECTORY_NOT_FOUND:()=>Wne,ERR_ENCRYPTED:()=>Xne,ERR_ENCRYPTED_CENTRAL_DIRECTORY:()=>Zne,ERR_ENTRY_DATA_OUT_OF_BOUNDS:()=>$ne,ERR_EOCDR_LOCATOR_ZIP64_NOT_FOUND:()=>Gne,ERR_EOCDR_NOT_FOUND:()=>Hne,ERR_EXTRAFIELD_ZIP64_NOT_FOUND:()=>Yne,ERR_INVALID_AUTHENTICATION_CODE:()=>ub,ERR_INVALID_COMPRESSED_DATA:()=>MI,ERR_INVALID_CRC32:()=>NI,ERR_INVALID_FILENAME_VALIDATION:()=>tie,ERR_INVALID_MAX_APPENDED_DATA_SIZE:()=>nie,ERR_INVALID_PASSWORD:()=>y0,ERR_INVALID_SIGNATURE:()=>lb,ERR_INVALID_STRICTNESS:()=>eie,ERR_INVALID_UNCOMPRESSED_SIZE:()=>fb,ERR_LOCAL_FILE_HEADER_NOT_FOUND:()=>qne,ERR_OVERLAPPING_ENTRY:()=>Kne,ERR_SPLIT_ZIP_FILE:()=>n9,ERR_UNSAFE_FILENAME:()=>Qne,ERR_UNSUPPORTED_COMPRESSION:()=>t9,ERR_UNSUPPORTED_ENCRYPTION:()=>e9,ERR_UNSUPPORTED_UINT64:()=>iie,ERR_WORKER_STARTUP_TIMEOUT:()=>RE,WARNING_APPENDED_DATA:()=>r9,WARNING_COMPRESSED_PATCHED_DATA:()=>sie,WARNING_DUPLICATE_FILENAME:()=>uie,WARNING_MALFORMED_EXTRA_FIELD:()=>_9,WARNING_MISMATCHED_LOCAL_FILE_HEADER_BIT_FLAG:()=>fie,WARNING_MISMATCHED_LOCAL_FILE_HEADER_COMPRESSION_METHOD:()=>die,WARNING_MISMATCHED_LOCAL_FILE_HEADER_CRC32_OR_SIZES:()=>hie,WARNING_MISMATCHED_ZIP64_END_OF_CENTRAL_DIRECTORY:()=>WI,WARNING_PREPENDED_CENTRAL_DIRECTORY:()=>cie,WARNING_PREPENDED_DATA:()=>o9,WARNING_TRAILING_CENTRAL_DIRECTORY_DATA:()=>lie,WARNING_UNKNOWN_VERSION:()=>oie,WARNING_UNKNOWN_ZIP64_EXTENSIBLE_DATA:()=>aie,WARNING_UNSORTED_CENTRAL_DIRECTORY:()=>rie,WARNING_WRAPPED_ENTRIES_COUNT:()=>i9,ZipReader:()=>BE,ZipReaderStream:()=>a9,isZipFile:()=>_De});async function _De(e,t={}){if(e=new W_(e),await Uc(e),(e.size===Ue||!e.readUint8Array)&&(e=new of(await b0(e.readable)),await Uc(e)),e.size<22)return!1;let n=pie(t,{}),i=n!=V_,r=TDe(t[Cte],n),{endOfDirectoryInfo:o,endOfDirectoryReachingEndCount:s}=await EDe(e,i,r);if(!o||n==ab&&s>1)return!1;let a=_r(di(o),20),c=o.offset+22+a;return e.size-c<=r}function Cne(e){let t=Math.min(e.byteLength,1024)-3;for(let n=0;n<t;n++)if(Ri(e,n)==134630224)return!0;return!1}function aDe(e,t,n){let i=0;for(;n+46<=t.length&&Ri(e,n)==33639248;)n+=46+_r(e,n+28)+_r(e,n+30)+_r(e,n+32),i++;return i%65536?0:i}function vne(e){if(e.length>=6){let t=di(e);if(Ri(t,0)==84233040){let n=_r(t,4);if(6+n<=e.length)return e.subarray(6,6+n)}}}function FEt(e,t,n){let i=e&&e.compressedSize?e.compressedSize:t;return i>0&&i<=n?i:n}function BEt(e){let t={rawExtensibleData:e};if(e.length>=28){let n=di(e),i=_r(n,26);Object.assign(t,{compressionMethod:_r(n,0),compressedSize:rd(n,2),uncompressedSize:rd(n,10),encryptionAlgorithm:_r(n,18),bitLength:_r(n,20),flags:_r(n,22),hashAlgorithm:_r(n,24),hashData:e.subarray(28,28+i)})}return t}function yDe(e,t,n){let i=e.rawBitFlag=_r(t,n+2),r=(i&1)==1,o=Ri(t,n+6);Object.assign(e,{encrypted:r,version:_r(t,n),bitFlag:{level:(i&6)>>1,dataDescriptor:(i&8)==8,languageEncodingFlag:(i&2048)==2048},rawLastModDate:o,lastModDate:ZEt(o),filenameLength:_r(t,n+22),extraFieldLength:_r(t,n+24)})}function ADe(e,t,n,i,r){let{rawExtraField:o}=t,s=t.extraField=new Map,a=di(o),c=0,u=!1;try{for(;c<o.length;){let S=_r(a,c),I=_r(a,c+2);s.set(S,{type:S,data:o.slice(c+4,c+4+I)}),c+=4+I}}catch{u=!0}c>o.length&&(u=!0);let f=_r(n,i+4);Object.assign(t,{signature:Ri(n,i+10),crc32:Ri(n,i+10),compressedSize:Ri(n,i+14),uncompressedSize:Ri(n,i+18)});let d=s.get(1);d&&(kEt(d,t),t.extraFieldZip64=d);let p=s.get(28789);p&&(cDe(p,ene,tne,t,e),t.extraFieldUnicodePath=p);let g=s.get(25461);g&&(cDe(g,fU,nne,t,e),t.extraFieldUnicodeComment=g);let m=s.get(39169);m&&m.data.length>=7?(UEt(m,t,f),t.extraFieldAES=m):t.compressionMethod=f;let y=s.get(13);y&&(lDe(y,t),t.extraFieldPkwareUnix=y);let A=s.get(22613);A&&(lDe(A,t),t.extraFieldUnixType1=A);let b=s.get(10);b&&(zEt(b,t),t.extraFieldNTFS=b);let x=s.get(30805),T;if(x&&(T=uDe(x,t,!1),t.extraFieldUnix=x),!T){let S=s.get(30837);S&&(uDe(S,t,!0),t.extraFieldInfoZip=S)}let E=s.get(21589);E&&(VEt(E,t,r),t.extraFieldExtendedTimestamp=E);let v=s.get(6534);return v&&(t.extraFieldUSDZ=v),u}function kEt(e,t){t.zip64=!0;let n=di(e.data),i=OEt.filter(([o,s])=>t[o]==s),r=i.reduce((o,[,s])=>o+oDe[s].bytes,0);if(e.data.length<r)throw new Error(Yne);for(let o=0,s=0;o<i.length;o++){let[a,c]=i[o],u=oDe[c];t[a]=e[a]=u.getValue(n,s),s+=u.bytes}}function cDe(e,t,n,i,r){if(e.data.length<5){e.valid=!1;return}let o=di(e.data),s=new Wm;s.append(r[n]);let a=di(new Uint8Array(4));a.setUint32(0,s.get(),!0);let c=Ri(o,1),u=mb(o,0);Object.assign(e,{version:u,[t]:aU(e.data.subarray(5)),valid:u==1&&!r.bitFlag.languageEncodingFlag&&c==Ri(a,0)}),e.valid&&(i[t]=e[t],i[t+REt]=!0)}function UEt(e,t,n){let i=di(e.data),r=mb(i,4);Object.assign(e,{vendorVersion:mb(i,0),vendorId:mb(i,2),strength:r,originalCompressionMethod:n,compressionMethod:_r(i,5)}),t.compressionMethod=e.compressionMethod,e.vendorVersion!=gDe&&(t.crc32=Ue)}function zEt(e,t){let n=di(e.data),i=4,r;try{for(;i<e.data.length&&!r;){let o=_r(n,i),s=_r(n,i+2);o==1&&(r=e.data.slice(i+4,i+4+s)),i+=4+s}}catch{}if(r&&r.length==24){let o=di(r),s=o.getBigUint64(0,!0),a=o.getBigUint64(8,!0),c=o.getBigUint64(16,!0);Object.assign(e,{rawLastModDate:s,rawLastAccessDate:a,rawCreationDate:c});let u=Sne(s),f=Sne(a),d=Sne(c),p={lastModDate:u,lastAccessDate:f,creationDate:d};Object.assign(e,p),Object.assign(t,p,{rawLastAccessDate:a,rawCreationDate:c})}}function lDe(e,t){if(e.data.length<8)return;let n=di(e.data),i=new Date((Ri(n,0)|0)*1e3),r=new Date((Ri(n,4)|0)*1e3),o={lastAccessDate:i,lastModDate:r};e.data.length>=12&&(o.uid=_r(n,8),o.gid=_r(n,10)),Object.assign(e,o),Object.assign(t,o)}function uDe(e,t,n){try{let i=di(e.data),r,o;if(n){let s=0,a=mb(i,s++),c=mb(i,s++);r=fDe(e.data.subarray(s,s+c)),s+=c;let u=mb(i,s++);o=fDe(e.data.subarray(s,s+u)),Object.assign(e,{version:a,uid:r,gid:o})}else e.data.length>=4&&(r=_r(i,0),o=_r(i,2),Object.assign(e,{uid:r,gid:o}));return r!==Ue&&(t.uid=r),o!==Ue&&(t.gid=o),r!==Ue||o!==Ue}catch{}}function fDe(e){let t=new Uint8Array(4);return t.set(e,0),new DataView(t.buffer,t.byteOffset,4).getUint32(0,!0)}function VEt(e,t,n){if(!e.data.length)return;let i=di(e.data),r=mb(i,0),o=[],s=[];n?((r&1)==1&&(o.push(jI),s.push(HI)),(r&2)==2&&(o.push(hU),s.push(sne)),(r&4)==4&&(o.push(mU),s.push(ane))):e.data.length>=5&&(o.push(jI),s.push(HI));let a=1;o.forEach((c,u)=>{if(e.data.length>=a+4){let f=Ri(i,a);t[c]=e[c]=new Date((f|0)*1e3);let d=s[u];e[d]=f}a+=4})}async function jEt({reader:e,fileEntry:t,index:n,offset:i,crc32:r,compressedSize:o,uncompressedSize:s,dataOffset:a,dataDescriptor:c,extraFieldZip64:u,readRanges:f}){let d=0;if(c&&(u?d=20:d=12),d){let g=await Uo(e,a+o,d+4),m=di(g),y=g.length==d+4&&Ri(m,0)==134695760;if(y){let A=dDe(m,4,u);(t.encrypted&&!t.zipCrypto||A.crc32==r)&&A.compressedSize==o&&A.uncompressedSize==s?d+=4:y=!1}if(g.length>=d){let A=dDe(m,y?4:0,u);A.signature=y,t.localDirectory.dataDescriptor=A}}let p={start:i,end:a+o+d,fileEntry:t};for(let[g,m]of f)if(g!=n&&p.start<m.end&&m.start<p.end){let y=new Error(Kne);throw y.overlappingEntry=m.fileEntry,y}f.set(n,p)}function dDe(e,t,n){let i=Ri(e,t),r,o;return n?(r=rd(e,t+4),o=rd(e,t+12)):(r=Ri(e,t+4),o=Ri(e,t+8)),{crc32:i,compressedSize:r,uncompressedSize:o}}function qI(e,t){return e.getDiskOffset?e.getDiskOffset(t):0}async function HEt(e){return await bDe(e)==134695760}async function GEt(e){let t=await bDe(e);return t==134695760||t==808471376}async function bDe(e){let t=await Uo(e,0,4);return Ri(di(t))}function xDe(e){return e===ab||e===h5||e===V_}function WEt(e,t,n){return Math.min(e,n?t*LEt:t)}function pie(e,t){return hDe(e,hDe(t,h5))}function hDe(e,t){let n=e[LIe];if(n!==Ue){if(!xDe(n))throw new Error(eie);return n}let i=e[gIe];return i===Ue?t:i?ab:t==V_?V_:h5}function qEt(e,t){return e===Ue?t!=V_:!!e}function YEt(e,t){return e===Ue?t==ab:!!e}function XEt(e,t){if(e===Ue)return t;if(!xDe(e))throw new Error(tie);return e}function KEt(e,t){if(t==V_)return!1;let n=e.split("/");return n.length>1&&n[n.length-1]===""&&n.pop(),n.includes("..")||e.startsWith("/")||e.startsWith("\\\\")||DEt.test(e)?!0:t==ab&&(n.includes(".")||n.includes(""))}function TDe(e,t){if(e!==Ue){let n=SE(e);if(typeof n!=sIe||Number.isNaN(n)||n<0)throw new Error(nie);return n}return t==ab?0:t==V_?1/0:65535}async function EDe(e,t,n){let{size:i}=e,r=Math.min(i,65557),o={count:NEt},s,a,c=0;for await(let[u,f,d,p,g]of CDe(e,r)){let m=_r(u,p+20);if(g+22+m==i){let y=await vDe(e,u,f,p,g,i,o);if(y==s9){if(s||(s=Ine(d,p,g)),c++,!t||c>1)break}else y==mie&&!a&&(a=Ine(d,p,g))}}return s||(s=a),s||(s=await $Et(e,n,o)),{endOfDirectoryInfo:s,endOfDirectoryReachingEndCount:c}}async function $Et(e,t,n){let{size:i}=e,r=Math.min(i,t==1/0?i:65557+t),o,s;for await(let[a,c,u,f,d]of CDe(e,r)){let p=Ine(u,f,d);o||(o=p);let g=await vDe(e,a,c,f,d,i,n);if(g==s9)return p;g==mie&&!s&&(s=p)}return s||o}async function*CDe(e,t){let n=e.size-t,i=await Uo(e,n,t),r=di(i);for(let o=i.length-22;o>=0;o--)Ri(r,o)==101010256&&(yield[r,n,i,o,n+o])}function Ine(e,t,n){return{offset:n,buffer:e.slice(t,t+22).buffer}}async function vDe(e,t,n,i,r,o,s){let a=_r(t,i+10),c=Ri(t,i+12),u=Ri(t,i+16);if(a==65535||c==4294967295||u==4294967295)return await mDe(e,t,n,r-20,o,s)==117853008?s9:sDe;if(!a&&!c)return mie;let f=_r(t,i+6);for(let d of[r-c,qI(e,f)+u])if(await mDe(e,t,n,d,o,s)==33639248)return s9;return sDe}async function mDe(e,t,n,i,r,o){if(i<0||i+4>r)return Ue;if(i>=n)return Ri(t,i-n);if(o.count>0){o.count--;let s=await Uo(e,i,4);return Ri(di(s),0)}return Ue}function JEt(e,t,n,i,r){let{rawFilename:o}=e,s=!r,a=e.decryptedDirectory&&(t.rawBitFlag&8192)==8192;i&&!a&&(n.length!=o.length||n.some((c,u)=>c!=o[u]))&&E0(s,r,"mismatched local file header (filename)"),(t.rawBitFlag&rDe)!=(e.rawBitFlag&rDe)&&E0(s,r,fie),t.compressionMethod!=e.compressionMethod&&E0(s,r,die),!t.bitFlag.dataDescriptor&&!a&&(t.crc32||t.compressedSize||t.uncompressedSize)&&(t.crc32!=e.crc32||t.compressedSize!=e.compressedSize||t.uncompressedSize!=e.uncompressedSize)&&E0(s,r,hie)}function E0(e,t,n){e?Z5(n):yh(t,n)}function yh(e,t,n){if(!e.some(i=>i.reason==t)){let i={reason:t};n!==Ue&&(i.filename=n),e.push(i)}}function Z5(e){let t=new Error(Jne);throw t.reason=e,t}function Os(e,t,n){return t[n]===Ue?e.options[n]:t[n]}function pDe(e,t,n){return EI(Os(e,t,n))}function ZEt(e){let t=(e&4294901760)>>16,n=e&65535,i=new Date(1980+((t&65024)>>9),((t&480)>>5)-1,t&31,(n&63488)>>11,(n&2016)>>5,(n&31)*2,0);return i<xI?xI:i}function Sne(e){return new Date(Number(e/BigInt(1e4)-BigInt(116444736e5)))}function mb(e,t){return e.getUint8(t)}function _r(e,t){return e.getUint16(t,!0)}function Ri(e,t){return e.getUint32(t,!0)}function rd(e,t){let n=e.getBigUint64(t,!0);if(n>MEt)throw new Error(iie);return Number(n)}var GI,Hne,Gne,Wne,qne,Yne,Xne,e9,t9,n9,Kne,$ne,Jne,Zne,Qne,eie,tie,nie,iie,rie,oie,sie,_9,aie,i9,r9,o9,cie,lie,uie,WI,fie,die,hie,PEt,DEt,nDe,REt,iDe,rDe,gDe,OEt,oDe,MEt,NEt,LEt,sDe,mie,s9,BE,a9,wne,gie=hs(()=>{Ac();_0();PE();V5();q5();$te();wE();DI();K3();Ene();W3();GI="File format is not recognized",Hne="End of central directory not found",Gne="End of Zip64 central directory locator not found",Wne="Central directory header not found",qne="Local file header not found",Yne="Zip64 extra field not found",Xne="File contains encrypted entry",e9="Encryption method not supported",t9="Compression method not supported",n9="Split zip file",Kne="Overlapping entry found",$ne="Entry data out of bounds",Jne="Ambiguous archive",Zne="Encrypted central directory is not supported",Qne="Unsafe filename",eie="Invalid strictness (must be 'strict', 'balanced' or 'tolerant')",tie="Invalid filenameValidation (must be 'strict', 'balanced' or 'tolerant')",nie="Invalid maxAppendedDataSize (must be a number greater than or equal to 0)",iie="64-bit value exceeds Number.MAX_SAFE_INTEGER",rie="unsorted central directory",oie="unknown version needed to extract",sie="compressed patched data",_9="malformed extra field",aie="unknown zip64 extensible data",i9="wrapped entries count",r9="appended data",o9="prepended data",cie="prepended central directory",lie="trailing central directory data",uie="duplicate filename",WI="mismatched zip64 end of central directory record",fie="mismatched local file header (general purpose bit flag)",die="mismatched local file header (compression method)",hie="mismatched local file header (crc32 or sizes)",PEt=63,DEt=/^[a-zA-Z]:/,nDe="utf-8",REt="UTF8",iDe="cp437",rDe=2057,gDe=1,OEt=[[dU,4294967295],[ine,4294967295],[rne,4294967295],[one,65535]],oDe={65535:{getValue:Ri,bytes:4},4294967295:{getValue:rd,bytes:8}},MEt=BigInt(Number.MAX_SAFE_INTEGER),NEt=64,LEt=1032,sDe=0,mie=1,s9=2,BE=class{constructor(t,n={}){Object.assign(this,{reader:new W_(t),options:n,readRanges:new Map})}async*getEntriesGenerator(t={}){let n=this,{reader:i}=n;if(await Uc(i),(i.size===Ue||!i.readUint8Array)&&(i=new of(await b0(i.readable)),await Uc(i)),i.size<22)throw new Error(GI);let r=n.warnings=[],o=pie(t,n.options),s=o==ab,a=o!=V_,c=TDe(Os(n,t,Cte),o),u=XEt(Os(n,t,FIe),o),f=Os(n,t,BIe),{endOfDirectoryInfo:d,endOfDirectoryReachingEndCount:p}=await EDe(i,a,c);if(!d)throw await HEt(i)?new Error(n9):new Error(Hne);a&&p>1&&Z5("multiple end of central directory records");let g=di(d),m=Ri(g,12),y=Ri(g,16),A=d.offset,b=_r(g,20),x=A+22+b,T=i.size-x;T>c&&Z5(r9),T>0&&yh(r,r9);let E=_r(g,4),v=i.lastDiskNumber||0,S=_r(g,6),I=_r(g,10),R=0,O,L,_,C,w=56,P,M=y==4294967295||m==4294967295||I==65535||S==65535;if(y!=4294967295&&S!=65535&&(y+=qI(i,S)),M){let He=d.offset>=20?await Uo(i,d.offset-20,20):gr,Xe=di(He);if(He.length==20&&Ri(Xe,0)==117853008){y=qI(i,Ri(Xe,4))+rd(Xe,8);let $e=await Uo(i,y,56),Pe=di($e),qe=d.offset-20-56;if(($e.length<56||Ri(Pe,0)!=101075792)&&y!=qe&&qe>=0){let st=y;y=qe,y>st&&(R=y-st),$e=await Uo(i,y,56),Pe=di($e)}if($e.length<56||Ri(Pe,0)!=101075792)throw new Error(Gne);if(_=!0,C=rd(Pe,4)>44,C){let st=Math.min(rd(Pe,4)-44,i.size-y-56);if(st>0){w+=st;let vt=await Uo(i,y+56,st);P=BEt(vt)}}E==65535?E=Ri(Pe,16):E!=Ri(Pe,16)&&E0(s,r,WI),S==65535?S=Ri(Pe,20):S!=Ri(Pe,20)&&E0(s,r,WI),I==65535?I=rd(Pe,32):I!=rd(Pe,32)&&E0(s,r,WI),m==4294967295?m=rd(Pe,40):m!=rd(Pe,40)&&E0(s,r,WI),y=qI(i,S)+rd(Pe,48)+R}}let F=m,V=d.offset-(_?w+20:0);if(y>=i.size&&(R=i.size-y-m-22,y=i.size-m-22),v!=E)throw new Error(n9);if(y<0)throw new Error(GI);let B=0,j=await Uo(i,y,m),k=di(j);if(m){if(j.length<4)throw new Error(GI);let He=V-m;if(y!=He&&S==E){let Xe=Ri(k,B)==33639248||!!(P&&P.compressedSize)||Cne(k),$e=!Xe;if(!$e&&He>=0&&He+4<=i.size){let Pe=await Uo(i,He,4);$e=Ri(di(Pe),0)==33639248}if($e){let Pe=y;y=He,y>Pe&&(R+=y-Pe,O=Xe),j=await Uo(i,y,m),k=di(j)}}}let G=V-y;if(m!=G&&G>=0&&S==E&&(m=G,j=await Uo(i,y,m),k=di(j)),y<0||y>=i.size)throw new Error(GI);n.directoryOffset=y,n.directoryLength=F;let q=pDe(n,t,kIe),Q,W;if(q&&I&&j.length>=4&&Ri(k,0)!=33639248&&(C||Cne(k))){let He=FEt(P,F,j.length);W=j.subarray(He),j=await q(j.subarray(0,He),P),k=di(j),F=j.length,Q=!0}P&&!Q&&(j.length<4||Ri(k,0)==33639248)&&yh(r,aie),L=y;let J=Os(n,t,cIe),Z=Os(n,t,lIe),ae=new Set,Ae,fe=-1,xe=!s&&!_;!I&&xe&&(I=aDe(k,j,B),I&&yh(r,i9));for(let He=0;He<I;He++){let Xe=new wne(i,n.options);if(B+46>j.length||Ri(k,B)!=33639248)throw He==0&&!Q&&(C||Cne(k))?new Error(Zne):new Error(Wne);yDe(Xe,k,B+6);let $e=!!Xe.bitFlag.languageEncodingFlag,Pe=B+46,qe=Pe+Xe.filenameLength,st=qe+Xe.extraFieldLength,vt=_r(k,B+4),Gt=vt>>8==0,lt=vt>>8==3,mt=j.subarray(Pe,qe),ft=_r(k,B+32),Xt=st+ft,rt=j.subarray(st,Xt),ht=$e,Bi=$e,Xn=Ri(k,B+38),bi=Xn&255,Wi={readOnly:!!(bi&1),hidden:!!(bi&2),system:!!(bi&4),directory:!!(bi&16),archive:!!(bi&32)},wi=Ri(k,B+42),hi=pDe(n,t,uIe)||aU,xi=ht?nDe:J||iDe,jn=Bi?nDe:Z||iDe,nn=hi(mt,xi,f5);if(nn===Ue&&(nn=aU(mt,xi)),f){let ki=f(nn);ki!==Ue&&(nn=ki)}if(KEt(nn,u)){let ki=new Error(Qne);throw ki.filename=nn,ki}let Wn=hi(rt,jn,d5);Wn===Ue&&(Wn=aU(rt,jn)),Object.assign(Xe,{index:He,decryptedDirectory:Q,versionMadeBy:vt,msDosCompatible:Gt,zip64:!1,compressedSize:0,uncompressedSize:0,commentLength:ft,offset:wi,diskNumberStart:_r(k,B+34),internalFileAttributes:_r(k,B+36),externalFileAttributes:Xn,msdosAttributesRaw:bi,msdosAttributes:Wi,rawFilename:mt,filenameUTF8:ht,commentUTF8:Bi,rawExtraField:j.subarray(qe,st),rawComment:rt,filename:nn,comment:Wn}),ADe(Xe,Xe,k,B+6)&&yh(r,_9,nn),Xe.offset+=R;let Zi=qI(i,Xe.diskNumberStart)+Xe.offset;L=Math.min(Zi,L),Zi<fe&&yh(r,rie,nn),fe=Zi,(Xe.version&255)>PEt&&yh(r,oie,nn),(Xe.rawBitFlag&32)==32&&yh(r,sie,nn),ae.has(Xe.filename)&&(Ae=!0),ae.add(Xe.filename);let Mr=Xe.externalFileAttributes>>16&65535;Xe.unixMode===Ue&&(Mr&16877)!=0&&(Xe.unixMode=Mr);let fo=!!(Xe.unixMode&2048),Bs=!!(Xe.unixMode&1024),Ks=!!(Xe.unixMode&512),gi=((Xe.unixMode===Ue?Mr:Xe.unixMode)&61440)==40960,ho=!gi&&(Xe.unixMode!==Ue?(Xe.unixMode&73)!=0:lt&&(Mr&73)!=0),ur=Xe.unixMode!==Ue&&(Xe.unixMode&61440)==16384,Zo=(Mr&61440)==16384;Object.assign(Xe,{setuid:fo,setgid:Bs,sticky:Ks,symlink:gi,unixExternalUpper:Mr,internalFileAttribute:Xe.internalFileAttributes,externalFileAttribute:Xe.externalFileAttributes,executable:ho,directory:ur||Zo||Gt&&Wi.directory||Xe.filename.endsWith("/"),zipCrypto:Xe.encrypted&&!Xe.extraFieldAES});let Bn=new db(Xe);if(Bn.getData=(ki,Nr)=>Xe.getData(ki,Bn,n.readRanges,Nr),Bn.arrayBuffer=async ki=>{let Nr=new null,Wc=b0(Nr.readable).then(xd=>xd.arrayBuffer());return Wc.catch(()=>{}),await Xe.getData(Nr,Bn,n.readRanges,ki),Wc},B=Xt,He==I-1&&xe){let ki=aDe(k,j,B);ki&&(I+=ki,yh(r,i9))}let{onprogress:qi}=t;if(qi)try{await qi(He+1,I,new db(Xe))}catch{}yield Bn}let ge=B,we=vne(j.subarray(B))||(Q?vne(W):Ue);if(!we&&!Q){let He=y+B,Xe=Math.min(V-He,65541);Xe>=6&&(we=vne(await Uo(i,He,Xe)))}we&&(n.digitalSignature=we,ge=B+6+we.length),(B!=F&&ge!=F||!Q&&B!=m&&ge!=m)&&E0(s,r,lie),Ae&&E0(s,r,uie);let Se=Os(n,t,fIe),Re=Os(n,t,dIe),Qe=(s||Se)&&I&&L==4&&await GEt(i)?4:0;return s&&(R||I&&L>Qe)&&Z5(o9),(R||I&&L>4)&&yh(r,o9),O&&yh(r,cie),Se&&(n.prependedData=L>Qe?await Uo(i,Qe,L-Qe):gr),n.comment=b?await Uo(i,A+22,b):gr,Re&&(n.appendedData=x<i.size?await Uo(i,x,i.size-x):gr),!0}async getEntries(t={}){let n=[];for await(let i of this.getEntriesGenerator(t))n.push(i);return n}async close(){let{reader:t}=this;!t.readUint8Array&&t.readable&&!t.readable.locked&&await t.readable.cancel()}},a9=class{constructor(t={}){let{readable:n,writable:i}=new null,r=new BE(n,t).getEntriesGenerator();this.readable=new ReadableStream({async pull(o){let{done:s,value:a}=await r.next();if(s)return o.close();let c={...a,readable:(function(){let{readable:u,writable:f}=new null;if(a.getData)return d(),u;async function d(){try{await a.getData(f)}catch(p){try{await f.abort(p)}catch{}}}})()};delete c.getData,o.enqueue(c)}}),this.writable=i}};wne=class{constructor(t,n){Object.assign(this,{reader:t,options:n})}async getData(t,n,i,r={}){let o=this,s=j_(),{reader:a,index:c,offset:u,diskNumberStart:f,extraFieldAES:d,extraFieldZip64:p,compressionMethod:g,bitFlag:m,rawBitFlag:y,crc32:A,rawLastModDate:b,uncompressedSize:x,compressedSize:T}=o,{dataDescriptor:E}=m,v=n.localDirectory={},S=n.warnings=[],I=qI(a,f)+u,R=await Uo(a,I,30),O=di(R),L=Os(o,r,i5),_=Os(o,r,r5),C=Os(o,r,o5);if(p5(L,_),L=L&&L.length&&L,_=_&&_.length&&_,d&&d.originalCompressionMethod!=99)throw new Error(t9);if(R.length<30||Ri(O,0)!=67324752)throw new Error(qne);yDe(v,O,4);let{extraFieldLength:w,filenameLength:P}=v,M=v.dataOffset=I+30+P+w,F=Os(o,r,_Ie),V=pie(r,o.options),B=qEt(F,V),j=YEt(F,V),k=gr;if(j&&(P||w)){let ft=await Uo(a,I+30,P+w);k=ft.subarray(0,P),v.rawExtraField=ft.subarray(P)}else v.rawExtraField=w?await Uo(a,I+30+P,w):gr;j&&(v.rawFilename=k),ADe(o,v,O,4,!0)&&yh(S,_9),JEt(o,v,k,j,B?Ue:S);let{lastAccessDate:G,creationDate:q,uid:Q,gid:W}=v;G&&(n.lastAccessDate=G),q&&(n.creationDate=q),Q!==Ue&&n.uid===Ue&&(n.uid=Q),W!==Ue&&n.gid===Ue&&(n.gid=W);let J=o.encrypted&&v.encrypted&&!C,Z=J&&!d;if(C||(n.zipCrypto=Z),J&&(v.rawBitFlag&64)==64)throw new Error(e9);let ae=C?Ue:v5(g);if(g!=0&&g!=8&&g!=9&&!ae&&!C)throw new Error(t9);if(J){if(!Z&&(d.strength<1||d.strength>3))throw new Error(e9);if(!L&&!_)throw new Error(Xne)}if(M+T>a.size)throw new Error($ne);let Ae=T,fe=qm(a.createReadable({offset:M,size:Ae})),xe=m5(Os(o,r,s5)),ge=Os(o,r,hIe),we=Os(o,r,pIe),Se=Os(o,r,mIe);Se&&(we=!0);let{onstart:Re,onprogress:Qe,onend:He}=r,Xe=g!=0&&!C,$e=C?T:x,Pe=g==9,qe=Os(o,r,c5);Pe&&(qe=!1);let st=Os(o,r,AIe),vt=(st===Ue?Os(o,r,yIe):st)&&!C&&(!J||Z||d&&d.vendorVersion==gDe),Gt={options:{codecType:O5,password:L,rawPassword:_,zipCrypto:Z,encryptionStrength:d&&d.strength,checkCrc32:vt,checkAuthenticationCode:Os(o,r,bIe),passwordVerification:Z&&(E?b>>>8&255:A>>>24&255),outputSize:$e,crc32:A,compressed:Xe,encrypted:J,useWebWorkers:Os(o,r,a5),useCompressionStream:qe,transferStreams:Os(o,r,l5),deflate64:Pe,format:ae?ae.format:Ue,codecURI:ae?ae.codecURI:Ue,compressionMethod:g,rawBitFlag:y,checkPasswordOnly:ge},config:s,streamOptions:{signal:xe,size:Ae,onstart:Re,onprogress:Qe,onend:He}};we&&await jEt({reader:a,fileEntry:n,index:c,offset:I,crc32:A,compressedSize:T,uncompressedSize:x,dataOffset:M,dataDescriptor:E||v.bitFlag.dataDescriptor,extraFieldZip64:p||v.extraFieldZip64,readRanges:i});let lt,mt;try{if(!Se){ge&&(t=new WritableStream),t=new VI(t),await Uc(t,WEt($e,T,Xe)),{writable:lt}=t;let{outputSize:ft}=await z5({readable:fe,writable:lt},Gt);if(t.size+=ft,ft!=$e)throw new Error(fb)}}catch(ft){if(ft.outputSize!==Ue&&(t.size+=ft.outputSize),!ge||ft.message!=H_)throw mt=ft,ft}finally{if(!(!W5(t)&&Os(o,r,u5))&<&&!lt.locked){let Xt=lt.getWriter();if(mt)try{await Xt.abort(mt)}catch{}else await Xt.close()}}return ge||Se?Ue:t.getData?t.getData():lt}}});var k1e=Yi((R9,B1e)=>{(function(e,t){typeof R9=="object"&&typeof B1e<"u"?t(R9):typeof define=="function"&&define.amd?define(["exports"],t):(e=e||self,t(e.topojson=e.topojson||{}))})(R9,function(e){"use strict";function t(T){return T}function n(T){if(T==null)return t;var E,v,S=T.scale[0],I=T.scale[1],R=T.translate[0],O=T.translate[1];return function(L,_){_||(E=v=0);var C=2,w=L.length,P=new Array(w);for(P[0]=(E+=L[0])*S+R,P[1]=(v+=L[1])*I+O;C<w;)P[C]=L[C],++C;return P}}function i(T){var E=n(T.transform),v,S=1/0,I=S,R=-S,O=-S;function L(C){C=E(C),C[0]<S&&(S=C[0]),C[0]>R&&(R=C[0]),C[1]<I&&(I=C[1]),C[1]>O&&(O=C[1])}function _(C){switch(C.type){case"GeometryCollection":C.geometries.forEach(_);break;case"Point":L(C.coordinates);break;case"MultiPoint":C.coordinates.forEach(L);break}}T.arcs.forEach(function(C){for(var w=-1,P=C.length,M;++w<P;)M=E(C[w],w),M[0]<S&&(S=M[0]),M[0]>R&&(R=M[0]),M[1]<I&&(I=M[1]),M[1]>O&&(O=M[1])});for(v in T.objects)_(T.objects[v]);return[S,I,R,O]}function r(T,E){for(var v,S=T.length,I=S-E;I<--S;)v=T[I],T[I++]=T[S],T[S]=v}function o(T,E){return typeof E=="string"&&(E=T.objects[E]),E.type==="GeometryCollection"?{type:"FeatureCollection",features:E.geometries.map(function(v){return s(T,v)})}:s(T,E)}function s(T,E){var v=E.id,S=E.bbox,I=E.properties==null?{}:E.properties,R=a(T,E);return v==null&&S==null?{type:"Feature",properties:I,geometry:R}:S==null?{type:"Feature",id:v,properties:I,geometry:R}:{type:"Feature",id:v,bbox:S,properties:I,geometry:R}}function a(T,E){var v=n(T.transform),S=T.arcs;function I(w,P){P.length&&P.pop();for(var M=S[w<0?~w:w],F=0,V=M.length;F<V;++F)P.push(v(M[F],F));w<0&&r(P,V)}function R(w){return v(w)}function O(w){for(var P=[],M=0,F=w.length;M<F;++M)I(w[M],P);return P.length<2&&P.push(P[0]),P}function L(w){for(var P=O(w);P.length<4;)P.push(P[0]);return P}function _(w){return w.map(L)}function C(w){var P=w.type,M;switch(P){case"GeometryCollection":return{type:P,geometries:w.geometries.map(C)};case"Point":M=R(w.coordinates);break;case"MultiPoint":M=w.coordinates.map(R);break;case"LineString":M=O(w.arcs);break;case"MultiLineString":M=w.arcs.map(O);break;case"Polygon":M=_(w.arcs);break;case"MultiPolygon":M=w.arcs.map(_);break;default:return null}return{type:P,coordinates:M}}return C(E)}function c(T,E){var v={},S={},I={},R=[],O=-1;E.forEach(function(C,w){var P=T.arcs[C<0?~C:C],M;P.length<3&&!P[1][0]&&!P[1][1]&&(M=E[++O],E[O]=C,E[w]=M)}),E.forEach(function(C){var w=L(C),P=w[0],M=w[1],F,V;if(F=I[P])if(delete I[F.end],F.push(C),F.end=M,V=S[M]){delete S[V.start];var B=V===F?F:F.concat(V);S[B.start=F.start]=I[B.end=V.end]=B}else S[F.start]=I[F.end]=F;else if(F=S[M])if(delete S[F.start],F.unshift(C),F.start=P,V=I[P]){delete I[V.end];var j=V===F?F:V.concat(F);S[j.start=V.start]=I[j.end=F.end]=j}else S[F.start]=I[F.end]=F;else F=[C],S[F.start=P]=I[F.end=M]=F});function L(C){var w=T.arcs[C<0?~C:C],P=w[0],M;return T.transform?(M=[0,0],w.forEach(function(F){M[0]+=F[0],M[1]+=F[1]})):M=w[w.length-1],C<0?[M,P]:[P,M]}function _(C,w){for(var P in C){var M=C[P];delete w[M.start],delete M.start,delete M.end,M.forEach(function(F){v[F<0?~F:F]=1}),R.push(M)}}return _(I,S),_(S,I),E.forEach(function(C){v[C<0?~C:C]||R.push([C])}),R}function u(T){return a(T,f.apply(this,arguments))}function f(T,E,v){var S,I,R;if(arguments.length>1)S=d(T,E,v);else for(I=0,S=new Array(R=T.arcs.length);I<R;++I)S[I]=I;return{type:"MultiLineString",arcs:c(T,S)}}function d(T,E,v){var S=[],I=[],R;function O(P){var M=P<0?~P:P;(I[M]||(I[M]=[])).push({i:P,g:R})}function L(P){P.forEach(O)}function _(P){P.forEach(L)}function C(P){P.forEach(_)}function w(P){switch(R=P,P.type){case"GeometryCollection":P.geometries.forEach(w);break;case"LineString":L(P.arcs);break;case"MultiLineString":case"Polygon":_(P.arcs);break;case"MultiPolygon":C(P.arcs);break}}return w(E),I.forEach(v==null?function(P){S.push(P[0].i)}:function(P){v(P[0].g,P[P.length-1].g)&&S.push(P[0].i)}),S}function p(T){for(var E=-1,v=T.length,S,I=T[v-1],R=0;++E<v;)S=I,I=T[E],R+=S[0]*I[1]-S[1]*I[0];return Math.abs(R)}function g(T){return a(T,m.apply(this,arguments))}function m(T,E){var v={},S=[],I=[];E.forEach(R);function R(_){switch(_.type){case"GeometryCollection":_.geometries.forEach(R);break;case"Polygon":O(_.arcs);break;case"MultiPolygon":_.arcs.forEach(O);break}}function O(_){_.forEach(function(C){C.forEach(function(w){(v[w=w<0?~w:w]||(v[w]=[])).push(_)})}),S.push(_)}function L(_){return p(a(T,{type:"Polygon",arcs:[_]}).coordinates[0])}return S.forEach(function(_){if(!_._){var C=[],w=[_];for(_._=1,I.push(C);_=w.pop();)C.push(_),_.forEach(function(P){P.forEach(function(M){v[M<0?~M:M].forEach(function(F){F._||(F._=1,w.push(F))})})})}}),S.forEach(function(_){delete _._}),{type:"MultiPolygon",arcs:I.map(function(_){var C=[],w;if(_.forEach(function(B){B.forEach(function(j){j.forEach(function(k){v[k<0?~k:k].length<2&&C.push(k)})})}),C=c(T,C),(w=C.length)>1)for(var P=1,M=L(C[0]),F,V;P<w;++P)(F=L(C[P]))>M&&(V=C[0],C[0]=C[P],C[P]=V,M=F);return C}).filter(function(_){return _.length>0})}}function y(T,E){for(var v=0,S=T.length;v<S;){var I=v+S>>>1;T[I]<E?v=I+1:S=I}return v}function A(T){var E={},v=T.map(function(){return[]});function S(B,j){B.forEach(function(k){k<0&&(k=~k);var G=E[k];G?G.push(j):E[k]=[j]})}function I(B,j){B.forEach(function(k){S(k,j)})}function R(B,j){B.type==="GeometryCollection"?B.geometries.forEach(function(k){R(k,j)}):B.type in O&&O[B.type](B.arcs,j)}var O={LineString:S,MultiLineString:I,Polygon:I,MultiPolygon:function(B,j){B.forEach(function(k){I(k,j)})}};T.forEach(R);for(var L in E)for(var _=E[L],C=_.length,w=0;w<C;++w)for(var P=w+1;P<C;++P){var M=_[w],F=_[P],V;(V=v[M])[L=y(V,F)]!==F&&V.splice(L,0,F),(V=v[F])[L=y(V,M)]!==M&&V.splice(L,0,M)}return v}function b(T){if(T==null)return t;var E,v,S=T.scale[0],I=T.scale[1],R=T.translate[0],O=T.translate[1];return function(L,_){_||(E=v=0);var C=2,w=L.length,P=new Array(w),M=Math.round((L[0]-R)/S),F=Math.round((L[1]-O)/I);for(P[0]=M-E,E=M,P[1]=F-v,v=F;C<w;)P[C]=L[C],++C;return P}}function x(T,E){if(T.transform)throw new Error("already quantized");if(!E||!E.scale){if(!((O=Math.floor(E))>=2))throw new Error("n must be \u22652");_=T.bbox||i(T);var v=_[0],S=_[1],I=_[2],R=_[3],O;E={scale:[I-v?(I-v)/(O-1):1,R-S?(R-S)/(O-1):1],translate:[v,S]}}else _=T.bbox;var L=b(E),_,C,w=T.objects,P={};function M(B){return L(B)}function F(B){var j;switch(B.type){case"GeometryCollection":j={type:"GeometryCollection",geometries:B.geometries.map(F)};break;case"Point":j={type:"Point",coordinates:M(B.coordinates)};break;case"MultiPoint":j={type:"MultiPoint",coordinates:B.coordinates.map(M)};break;default:return B}return B.id!=null&&(j.id=B.id),B.bbox!=null&&(j.bbox=B.bbox),B.properties!=null&&(j.properties=B.properties),j}function V(B){var j=0,k=1,G=B.length,q,Q=new Array(G);for(Q[0]=L(B[0],0);++j<G;)((q=L(B[j],j))[0]||q[1])&&(Q[k++]=q);return k===1&&(Q[k++]=[0,0]),Q.length=k,Q}for(C in w)P[C]=F(w[C]);return{type:"Topology",bbox:_,transform:E,objects:P,arcs:T.arcs.map(V)}}e.bbox=i,e.feature=o,e.merge=g,e.mergeArcs=m,e.mesh=u,e.meshArcs=f,e.neighbors=A,e.quantize=x,e.transform=n,e.untransform=b,Object.defineProperty(e,"__esModule",{value:!0})})});var $m={};Oq($m,{__addDisposableResource:()=>IRe,__assign:()=>N9,__asyncDelegator:()=>bRe,__asyncGenerator:()=>ARe,__asyncValues:()=>xRe,__await:()=>tP,__awaiter:()=>hRe,__classPrivateFieldGet:()=>vRe,__classPrivateFieldIn:()=>wRe,__classPrivateFieldSet:()=>SRe,__createBinding:()=>F9,__decorate:()=>sRe,__disposeResources:()=>PRe,__esDecorate:()=>cRe,__exportStar:()=>pRe,__extends:()=>rRe,__generator:()=>mRe,__importDefault:()=>CRe,__importStar:()=>ERe,__makeTemplateObject:()=>TRe,__metadata:()=>dRe,__param:()=>aRe,__propKey:()=>uRe,__read:()=>Yie,__rest:()=>oRe,__rewriteRelativeImportExtension:()=>DRe,__runInitializers:()=>lRe,__setFunctionName:()=>fRe,__spread:()=>gRe,__spreadArray:()=>yRe,__spreadArrays:()=>_Re,__values:()=>L9,default:()=>Avt});function rRe(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");Wie(e,t);function n(){this.constructor=e}e.prototype=t===null?Object.create(t):(n.prototype=t.prototype,new n)}function oRe(e,t){var n={};for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&t.indexOf(i)<0&&(n[i]=e[i]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var r=0,i=Object.getOwnPropertySymbols(e);r<i.length;r++)t.indexOf(i[r])<0&&Object.prototype.propertyIsEnumerable.call(e,i[r])&&(n[i[r]]=e[i[r]]);return n}function sRe(e,t,n,i){var r=arguments.length,o=r<3?t:i===null?i=Object.getOwnPropertyDescriptor(t,n):i,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(e,t,n,i);else for(var a=e.length-1;a>=0;a--)(s=e[a])&&(o=(r<3?s(o):r>3?s(t,n,o):s(t,n))||o);return r>3&&o&&Object.defineProperty(t,n,o),o}function aRe(e,t){return function(n,i){t(n,i,e)}}function cRe(e,t,n,i,r,o){function s(b){if(b!==void 0&&typeof b!="function")throw new TypeError("Function expected");return b}for(var a=i.kind,c=a==="getter"?"get":a==="setter"?"set":"value",u=!t&&e?i.static?e:e.prototype:null,f=t||(u?Object.getOwnPropertyDescriptor(u,i.name):{}),d,p=!1,g=n.length-1;g>=0;g--){var m={};for(var y in i)m[y]=y==="access"?{}:i[y];for(var y in i.access)m.access[y]=i.access[y];m.addInitializer=function(b){if(p)throw new TypeError("Cannot add initializers after decoration has completed");o.push(s(b||null))};var A=(0,n[g])(a==="accessor"?{get:f.get,set:f.set}:f[c],m);if(a==="accessor"){if(A===void 0)continue;if(A===null||typeof A!="object")throw new TypeError("Object expected");(d=s(A.get))&&(f.get=d),(d=s(A.set))&&(f.set=d),(d=s(A.init))&&r.unshift(d)}else(d=s(A))&&(a==="field"?r.unshift(d):f[c]=d)}u&&Object.defineProperty(u,i.name,f),p=!0}function lRe(e,t,n){for(var i=arguments.length>2,r=0;r<t.length;r++)n=i?t[r].call(e,n):t[r].call(e);return i?n:void 0}function uRe(e){return typeof e=="symbol"?e:"".concat(e)}function fRe(e,t,n){return typeof t=="symbol"&&(t=t.description?"[".concat(t.description,"]"):""),Object.defineProperty(e,"name",{configurable:!0,value:n?"".concat(n," ",t):t})}function dRe(e,t){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(e,t)}function hRe(e,t,n,i){function r(o){return o instanceof n?o:new n(function(s){s(o)})}return new(n||(n=Promise))(function(o,s){function a(f){try{u(i.next(f))}catch(d){s(d)}}function c(f){try{u(i.throw(f))}catch(d){s(d)}}function u(f){f.done?o(f.value):r(f.value).then(a,c)}u((i=i.apply(e,t||[])).next())})}function mRe(e,t){var n={label:0,sent:function(){if(o[0]&1)throw o[1];return o[1]},trys:[],ops:[]},i,r,o,s=Object.create((typeof Iterator=="function"?Iterator:Object).prototype);return s.next=a(0),s.throw=a(1),s.return=a(2),typeof Symbol=="function"&&(s[Symbol.iterator]=function(){return this}),s;function a(u){return function(f){return c([u,f])}}function c(u){if(i)throw new TypeError("Generator is already executing.");for(;s&&(s=0,u[0]&&(n=0)),n;)try{if(i=1,r&&(o=u[0]&2?r.return:u[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,u[1])).done)return o;switch(r=0,o&&(u=[u[0]&2,o.value]),u[0]){case 0:case 1:o=u;break;case 4:return n.label++,{value:u[1],done:!1};case 5:n.label++,r=u[1],u=[0];continue;case 7:u=n.ops.pop(),n.trys.pop();continue;default:if(o=n.trys,!(o=o.length>0&&o[o.length-1])&&(u[0]===6||u[0]===2)){n=0;continue}if(u[0]===3&&(!o||u[1]>o[0]&&u[1]<o[3])){n.label=u[1];break}if(u[0]===6&&n.label<o[1]){n.label=o[1],o=u;break}if(o&&n.label<o[2]){n.label=o[2],n.ops.push(u);break}o[2]&&n.ops.pop(),n.trys.pop();continue}u=t.call(e,n)}catch(f){u=[6,f],r=0}finally{i=o=0}if(u[0]&5)throw u[1];return{value:u[0]?u[1]:void 0,done:!0}}}function pRe(e,t){for(var n in e)n!=="default"&&!Object.prototype.hasOwnProperty.call(t,n)&&F9(t,e,n)}function L9(e){var t=typeof Symbol=="function"&&Symbol.iterator,n=t&&e[t],i=0;if(n)return n.call(e);if(e&&typeof e.length=="number")return{next:function(){return e&&i>=e.length&&(e=void 0),{value:e&&e[i++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function Yie(e,t){var n=typeof Symbol=="function"&&e[Symbol.iterator];if(!n)return e;var i=n.call(e),r,o=[],s;try{for(;(t===void 0||t-- >0)&&!(r=i.next()).done;)o.push(r.value)}catch(a){s={error:a}}finally{try{r&&!r.done&&(n=i.return)&&n.call(i)}finally{if(s)throw s.error}}return o}function gRe(){for(var e=[],t=0;t<arguments.length;t++)e=e.concat(Yie(arguments[t]));return e}function _Re(){for(var e=0,t=0,n=arguments.length;t<n;t++)e+=arguments[t].length;for(var i=Array(e),r=0,t=0;t<n;t++)for(var o=arguments[t],s=0,a=o.length;s<a;s++,r++)i[r]=o[s];return i}function yRe(e,t,n){if(n||arguments.length===2)for(var i=0,r=t.length,o;i<r;i++)(o||!(i in t))&&(o||(o=Array.prototype.slice.call(t,0,i)),o[i]=t[i]);return e.concat(o||Array.prototype.slice.call(t))}function tP(e){return this instanceof tP?(this.v=e,this):new tP(e)}function ARe(e,t,n){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var i=n.apply(e,t||[]),r,o=[];return r=Object.create((typeof AsyncIterator=="function"?AsyncIterator:Object).prototype),a("next"),a("throw"),a("return",s),r[Symbol.asyncIterator]=function(){return this},r;function s(g){return function(m){return Promise.resolve(m).then(g,d)}}function a(g,m){i[g]&&(r[g]=function(y){return new Promise(function(A,b){o.push([g,y,A,b])>1||c(g,y)})},m&&(r[g]=m(r[g])))}function c(g,m){try{u(i[g](m))}catch(y){p(o[0][3],y)}}function u(g){g.value instanceof tP?Promise.resolve(g.value.v).then(f,d):p(o[0][2],g)}function f(g){c("next",g)}function d(g){c("throw",g)}function p(g,m){g(m),o.shift(),o.length&&c(o[0][0],o[0][1])}}function bRe(e){var t,n;return t={},i("next"),i("throw",function(r){throw r}),i("return"),t[Symbol.iterator]=function(){return this},t;function i(r,o){t[r]=e[r]?function(s){return(n=!n)?{value:tP(e[r](s)),done:!1}:o?o(s):s}:o}}function xRe(e){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var t=e[Symbol.asyncIterator],n;return t?t.call(e):(e=typeof L9=="function"?L9(e):e[Symbol.iterator](),n={},i("next"),i("throw"),i("return"),n[Symbol.asyncIterator]=function(){return this},n);function i(o){n[o]=e[o]&&function(s){return new Promise(function(a,c){s=e[o](s),r(a,c,s.done,s.value)})}}function r(o,s,a,c){Promise.resolve(c).then(function(u){o({value:u,done:a})},s)}}function TRe(e,t){return Object.defineProperty?Object.defineProperty(e,"raw",{value:t}):e.raw=t,e}function ERe(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var n=qie(e),i=0;i<n.length;i++)n[i]!=="default"&&F9(t,e,n[i]);return _vt(t,e),t}function CRe(e){return e&&e.__esModule?e:{default:e}}function vRe(e,t,n,i){if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a getter");if(typeof t=="function"?e!==t||!i:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return n==="m"?i:n==="a"?i.call(e):i?i.value:t.get(e)}function SRe(e,t,n,i,r){if(i==="m")throw new TypeError("Private method is not writable");if(i==="a"&&!r)throw new TypeError("Private accessor was defined without a setter");if(typeof t=="function"?e!==t||!r:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return i==="a"?r.call(e,n):r?r.value=n:t.set(e,n),n}function wRe(e,t){if(t===null||typeof t!="object"&&typeof t!="function")throw new TypeError("Cannot use 'in' operator on non-object");return typeof e=="function"?t===e:e.has(t)}function IRe(e,t,n){if(t!=null){if(typeof t!="object"&&typeof t!="function")throw new TypeError("Object expected.");var i,r;if(n){if(!Symbol.asyncDispose)throw new TypeError("Symbol.asyncDispose is not defined.");i=t[Symbol.asyncDispose]}if(i===void 0){if(!Symbol.dispose)throw new TypeError("Symbol.dispose is not defined.");i=t[Symbol.dispose],n&&(r=i)}if(typeof i!="function")throw new TypeError("Object not disposable.");r&&(i=function(){try{r.call(this)}catch(o){return Promise.reject(o)}}),e.stack.push({value:t,dispose:i,async:n})}else n&&e.stack.push({async:!0});return t}function PRe(e){function t(o){e.error=e.hasError?new yvt(o,e.error,"An error was suppressed during disposal."):o,e.hasError=!0}var n,i=0;function r(){for(;n=e.stack.pop();)try{if(!n.async&&i===1)return i=0,e.stack.push(n),Promise.resolve().then(r);if(n.dispose){var o=n.dispose.call(n.value);if(n.async)return i|=2,Promise.resolve(o).then(r,function(s){return t(s),r()})}else i|=1}catch(s){t(s)}if(i===1)return e.hasError?Promise.reject(e.error):Promise.resolve();if(e.hasError)throw e.error}return r()}function DRe(e,t){return typeof e=="string"&&/^\.\.?\//.test(e)?e.replace(/\.(tsx)$|((?:\.d)?)((?:\.[^./]+?)?)\.([cm]?)ts$/i,function(n,i,r,o,s){return i?t?".jsx":".js":r&&(!o||!s)?n:r+o+"."+s.toLowerCase()+"js"}):e}var Wie,N9,F9,_vt,qie,yvt,Avt,Jm=hs(()=>{Wie=function(e,t){return Wie=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var r in i)Object.prototype.hasOwnProperty.call(i,r)&&(n[r]=i[r])},Wie(e,t)};N9=function(){return N9=Object.assign||function(t){for(var n,i=1,r=arguments.length;i<r;i++){n=arguments[i];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(t[o]=n[o])}return t},N9.apply(this,arguments)};F9=Object.create?(function(e,t,n,i){i===void 0&&(i=n);var r=Object.getOwnPropertyDescriptor(t,n);(!r||("get"in r?!t.__esModule:r.writable||r.configurable))&&(r={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,i,r)}):(function(e,t,n,i){i===void 0&&(i=n),e[i]=t[n]});_vt=Object.create?(function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}):function(e,t){e.default=t},qie=function(e){return qie=Object.getOwnPropertyNames||function(t){var n=[];for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(n[n.length]=i);return n},qie(e)};yvt=typeof SuppressedError=="function"?SuppressedError:function(e,t,n){var i=new Error(n);return i.name="SuppressedError",i.error=e,i.suppressed=t,i};Avt={__extends:rRe,__assign:N9,__rest:oRe,__decorate:sRe,__param:aRe,__esDecorate:cRe,__runInitializers:lRe,__propKey:uRe,__setFunctionName:fRe,__metadata:dRe,__awaiter:hRe,__generator:mRe,__createBinding:F9,__exportStar:pRe,__values:L9,__read:Yie,__spread:gRe,__spreadArrays:_Re,__spreadArray:yRe,__await:tP,__asyncGenerator:ARe,__asyncDelegator:bRe,__asyncValues:xRe,__makeTemplateObject:TRe,__importStar:ERe,__importDefault:CRe,__classPrivateFieldGet:vRe,__classPrivateFieldSet:SRe,__classPrivateFieldIn:wRe,__addDisposableResource:IRe,__disposeResources:PRe,__rewriteRelativeImportExtension:DRe}});var RRe=Yi(B9=>{"use strict";Object.defineProperty(B9,"__esModule",{value:!0});B9.version=void 0;B9.version="4.1.5"});var yb=Yi(_b=>{"use strict";Object.defineProperty(_b,"__esModule",{value:!0});_b.hasOwnProperty=void 0;_b.isBoolean=bvt;_b.ellipsis=xvt;_b.removeWithPredicate=Tvt;_b.assertNever=Evt;_b.hasOwnProperty=Object.prototype.hasOwnProperty;function bvt(e){return typeof e=="boolean"}function xvt(e,t,n){var i;return e.length>t&&(n==null?(n="…",i=3):i=n.length,e=e.substring(0,t-i)+n),e}function Tvt(e,t){for(var n=e.length-1;n>=0;n--)t(e[n])===!0&&e.splice(n,1)}function Evt(e){throw new Error("Unhandled case for value: '".concat(e,"'"))}});var k9=Yi(S0=>{"use strict";Object.defineProperty(S0,"__esModule",{value:!0});S0.HtmlTag=S0.whitespaceRe=void 0;var Cvt=yb();S0.whitespaceRe=/\s+/;var vvt=(function(){function e(t){t===void 0&&(t={}),this.tagName="",this.attrs={},this.innerHTML="",this.tagName=t.tagName||"",this.attrs=t.attrs||{},this.innerHTML=t.innerHtml||t.innerHTML||""}return e.prototype.setTagName=function(t){return this.tagName=t,this},e.prototype.getTagName=function(){return this.tagName},e.prototype.setAttr=function(t,n){var i=this.getAttrs();return i[t]=n,this},e.prototype.getAttr=function(t){return this.getAttrs()[t]},e.prototype.setAttrs=function(t){return Object.assign(this.getAttrs(),t),this},e.prototype.getAttrs=function(){return this.attrs},e.prototype.setClass=function(t){return this.setAttr("class",t)},e.prototype.addClass=function(t){for(var n=this.getClass(),i=n?n.split(S0.whitespaceRe):[],r=t.split(S0.whitespaceRe),o;o=r.shift();)i.indexOf(o)===-1&&i.push(o);return this.getAttrs().class=i.join(" "),this},e.prototype.removeClass=function(t){for(var n=this.getClass(),i=n?n.split(S0.whitespaceRe):[],r=t.split(S0.whitespaceRe),o;i.length&&(o=r.shift());){var s=i.indexOf(o);s!==-1&&i.splice(s,1)}return this.getAttrs().class=i.join(" "),this},e.prototype.getClass=function(){return this.getAttrs().class||""},e.prototype.hasClass=function(t){return(" "+this.getClass()+" ").indexOf(" "+t+" ")!==-1},e.prototype.setInnerHTML=function(t){return this.innerHTML=t,this},e.prototype.setInnerHtml=function(t){return this.setInnerHTML(t)},e.prototype.getInnerHTML=function(){return this.innerHTML||""},e.prototype.getInnerHtml=function(){return this.getInnerHTML()},e.prototype.toAnchorString=function(){var t=this.getTagName(),n=this.buildAttrsStr();return n=n?" "+n:"",["<",t,n,">",this.getInnerHtml(),"</",t,">"].join("")},e.prototype.buildAttrsStr=function(){var t=this.getAttrs(),n=[];for(var i in t)Cvt.hasOwnProperty.call(t,i)&&n.push(i+'="'+t[i]+'"');return n.join(" ")},e})();S0.HtmlTag=vvt});var MRe=Yi(Kie=>{"use strict";Object.defineProperty(Kie,"__esModule",{value:!0});Kie.truncateSmart=Svt;function Svt(e,t,n){var i,r;if(n==null?(n="…",r=3,i=8):(r=n.length,i=n.length),e.length<=t)return e;var o=t-r,s=wvt(e);if(s.query){var a=s.query.match(/^(.*?)(?=(\?|#))(.*?)$/i);a&&(s.query=s.query.substr(0,a[1].length),e=ORe(s))}if(e.length<=t||(s.host&&(s.host=s.host.replace(/^www\./,""),e=ORe(s)),e.length<=t))return e;var c="";if(s.host&&(c+=s.host),c.length>=o)return s.host.length===t?(s.host.substr(0,t-r)+n).substr(0,o+i):Xie(c,o,n).substr(0,o+i);var u="";if(s.path&&(u+="/"+s.path),s.query&&(u+="?"+s.query),u)if((c+u).length>=o){if((c+u).length==t)return(c+u).substr(0,t);var f=o-c.length;return(c+Xie(u,f,n)).substr(0,o+i)}else c+=u;if(s.fragment){var d="#"+s.fragment;if((c+d).length>=o){if((c+d).length==t)return(c+d).substr(0,t);var p=o-c.length;return(c+Xie(d,p,n)).substr(0,o+i)}else c+=d}if(s.scheme&&s.host){var g=s.scheme+"://";if((c+g).length<o)return(g+c).substr(0,t)}if(c.length<=t)return c;var m="";return o>0&&(m=c.substr(-1*Math.floor(o/2))),(c.substr(0,Math.ceil(o/2))+n+m).substr(0,o+i)}function wvt(e){var t={},n=e,i=n.match(/^([a-z]+):\/\//i);return i&&(t.scheme=i[1],n=n.slice(i[0].length)),i=n.match(/^(.*?)(?=(\?|#|\/|$))/i),i&&(t.host=i[1],n=n.slice(i[0].length)),i=n.match(/^\/(.*?)(?=(\?|#|$))/i),i&&(t.path=i[1],n=n.slice(i[0].length)),i=n.match(/^\?(.*?)(?=(#|$))/i),i&&(t.query=i[1],n=n.slice(i[0].length)),i=n.match(/^#(.*?)$/i),i&&(t.fragment=i[1]),t}function ORe(e){var t="";return e.scheme&&e.host&&(t+=e.scheme+"://"),e.host&&(t+=e.host),e.path&&(t+="/"+e.path),e.query&&(t+="?"+e.query),e.fragment&&(t+="#"+e.fragment),t}function Xie(e,t,n){var i=t/2,r=Math.ceil(i),o=-1*Math.floor(i),s="";return o<0&&(s=e.substr(o)),e.substr(0,r)+n+s}});var NRe=Yi($ie=>{"use strict";Object.defineProperty($ie,"__esModule",{value:!0});$ie.truncateMiddle=Ivt;function Ivt(e,t,n){if(e.length<=t)return e;var i,r;n==null?(n="…",i=8,r=3):(i=n.length,r=n.length);var o=t-r,s="";return o>0&&(s=e.substr(-1*Math.floor(o/2))),(e.substr(0,Math.ceil(o/2))+n+s).substr(0,o+i)}});var LRe=Yi(Jie=>{"use strict";Object.defineProperty(Jie,"__esModule",{value:!0});Jie.truncateEnd=Dvt;var Pvt=yb();function Dvt(e,t,n){return(0,Pvt.ellipsis)(e,t,n)}});var Zie=Yi(U9=>{"use strict";Object.defineProperty(U9,"__esModule",{value:!0});U9.AnchorTagBuilder=void 0;var Rvt=k9(),Ovt=MRe(),Mvt=NRe(),Nvt=LRe(),Lvt=(function(){function e(t){t===void 0&&(t={}),this.newWindow=!1,this.truncate={},this.className="",this.newWindow=t.newWindow||!1,this.truncate=t.truncate||{},this.className=t.className||""}return e.prototype.build=function(t){return new Rvt.HtmlTag({tagName:"a",attrs:this.createAttrs(t),innerHtml:this.processAnchorText(t.getAnchorText())})},e.prototype.createAttrs=function(t){var n={href:t.getAnchorHref()},i=this.createCssClass(t);return i&&(n.class=i),this.newWindow&&(n.target="_blank",n.rel="noopener noreferrer"),this.truncate.length&&this.truncate.length<t.getAnchorText().length&&(n.title=t.getAnchorHref()),n},e.prototype.createCssClass=function(t){var n=this.className;if(n){for(var i=[n],r=t.getCssClassSuffixes(),o=0,s=r.length;o<s;o++)i.push(n+"-"+r[o]);return i.join(" ")}else return""},e.prototype.processAnchorText=function(t){return t=this.doTruncate(t),t},e.prototype.doTruncate=function(t){var n=this.truncate;if(!n.length)return t;var i=n.length,r=n.location;return r==="smart"?(0,Ovt.truncateSmart)(t,i):r==="middle"?(0,Mvt.truncateMiddle)(t,i):(0,Nvt.truncateEnd)(t,i)},e})();U9.AnchorTagBuilder=Lvt});var WE=Yi(z9=>{"use strict";Object.defineProperty(z9,"__esModule",{value:!0});z9.AbstractMatch=void 0;var Fvt=(function(){function e(t){this._=null,this.matchedText="",this.offset=0,this.tagBuilder=t.tagBuilder,this.matchedText=t.matchedText,this.offset=t.offset}return e.prototype.getMatchedText=function(){return this.matchedText},e.prototype.setOffset=function(t){this.offset=t},e.prototype.getOffset=function(){return this.offset},e.prototype.getCssClassSuffixes=function(){return[this.type]},e.prototype.buildTag=function(){return this.tagBuilder.build(this)},e})();z9.AbstractMatch=Fvt});var qE=Yi(ad=>{"use strict";Object.defineProperty(ad,"__esModule",{value:!0});ad.isControlChar=Bvt;ad.isAsciiLetterChar=kvt;ad.isDigitChar=Uvt;ad.isQuoteChar=zvt;ad.isWhitespaceChar=Vvt;ad.isAlphaNumericOrMarkChar=jvt;ad.isValidEmailLocalPartSpecialChar=Hvt;ad.isUrlSuffixAllowedSpecialChar=Gvt;ad.isUrlSuffixNotAllowedAsFinalChar=Wvt;ad.isOpenBraceChar=qvt;ad.isCloseBraceChar=Yvt;function Bvt(e){return e>=0&&e<=31||e==127}function kvt(e){return e>=65&&e<=90||e>=97&&e<=122}function Uvt(e){return e>=48&&e<=57}function zvt(e){return e==34||e==39}function Vvt(e){return e<8232?e<160?e>=9&&e<=13||e==32:e<5760?e==160:e==5760||e>=8192&&e<=8202:e<8287?e>=8232&&e<=8233||e==8239:e<12288?e==8287:e==12288||e==65279}function jvt(e){return e<4800?e<2949?e<2451?e<1425?e<768?e<192?e<169?e<65?e>=48&&e<=57:e>=65&&e<=90||e>=97&&e<=122:e<181?e>=169&&e<=170||e==174:e==181||e==186:e<710?e<216?e>=192&&e<=214:e>=216&&e<=246||e>=248&&e<=705:e<748?e>=710&&e<=721||e>=736&&e<=740:e==748||e==750:e<910?e<895?e<886?e>=768&&e<=884:e>=886&&e<=887||e>=890&&e<=893:e<904?e==895||e==902:e>=904&&e<=906||e==908:e<1155?e<931?e>=910&&e<=929:e>=931&&e<=1013||e>=1015&&e<=1153:e<1369?e>=1155&&e<=1327||e>=1329&&e<=1366:e==1369||e>=1377&&e<=1415:e<1808?e<1552?e<1476?e<1471?e>=1425&&e<=1469:e==1471||e>=1473&&e<=1474:e<1488?e>=1476&&e<=1477||e==1479:e>=1488&&e<=1514||e>=1520&&e<=1522:e<1749?e<1568?e>=1552&&e<=1562:e>=1568&&e<=1641||e>=1646&&e<=1747:e<1770?e>=1749&&e<=1756||e>=1759&&e<=1768:e>=1770&&e<=1788||e==1791:e<2230?e<2042?e<1869?e>=1808&&e<=1866:e>=1869&&e<=1969||e>=1984&&e<=2037:e<2112?e==2042||e>=2048&&e<=2093:e>=2112&&e<=2139||e>=2208&&e<=2228:e<2406?e<2260?e>=2230&&e<=2237:e>=2260&&e<=2273||e>=2275&&e<=2403:e<2437?e>=2406&&e<=2415||e>=2417&&e<=2435:e>=2437&&e<=2444||e>=2447&&e<=2448:e<2693?e<2579?e<2519?e<2486?e<2474?e>=2451&&e<=2472:e>=2474&&e<=2480||e==2482:e<2503?e>=2486&&e<=2489||e>=2492&&e<=2500:e>=2503&&e<=2504||e>=2507&&e<=2510:e<2534?e<2524?e==2519:e>=2524&&e<=2525||e>=2527&&e<=2531:e<2565?e>=2534&&e<=2545||e>=2561&&e<=2563:e>=2565&&e<=2570||e>=2575&&e<=2576:e<2631?e<2613?e<2602?e>=2579&&e<=2600:e>=2602&&e<=2608||e>=2610&&e<=2611:e<2620?e>=2613&&e<=2614||e>=2616&&e<=2617:e==2620||e>=2622&&e<=2626:e<2649?e<2635?e>=2631&&e<=2632:e>=2635&&e<=2637||e==2641:e<2662?e>=2649&&e<=2652||e==2654:e>=2662&&e<=2677||e>=2689&&e<=2691:e<2821?e<2759?e<2730?e<2703?e>=2693&&e<=2701:e>=2703&&e<=2705||e>=2707&&e<=2728:e<2741?e>=2730&&e<=2736||e>=2738&&e<=2739:e>=2741&&e<=2745||e>=2748&&e<=2757:e<2784?e<2763?e>=2759&&e<=2761:e>=2763&&e<=2765||e==2768:e<2809?e>=2784&&e<=2787||e>=2790&&e<=2799:e==2809||e>=2817&&e<=2819:e<2887?e<2858?e<2831?e>=2821&&e<=2828:e>=2831&&e<=2832||e>=2835&&e<=2856:e<2869?e>=2858&&e<=2864||e>=2866&&e<=2867:e>=2869&&e<=2873||e>=2876&&e<=2884:e<2911?e<2902?e>=2887&&e<=2888||e>=2891&&e<=2893:e>=2902&&e<=2903||e>=2908&&e<=2909:e<2929?e>=2911&&e<=2915||e>=2918&&e<=2927:e==2929||e>=2946&&e<=2947:e<3517?e<3205?e<3046?e<2984?e<2969?e<2958?e>=2949&&e<=2954:e>=2958&&e<=2960||e>=2962&&e<=2965:e<2974?e>=2969&&e<=2970||e==2972:e>=2974&&e<=2975||e>=2979&&e<=2980:e<3014?e<2990?e>=2984&&e<=2986:e>=2990&&e<=3001||e>=3006&&e<=3010:e<3024?e>=3014&&e<=3016||e>=3018&&e<=3021:e==3024||e==3031:e<3142?e<3086?e<3072?e>=3046&&e<=3055:e>=3072&&e<=3075||e>=3077&&e<=3084:e<3114?e>=3086&&e<=3088||e>=3090&&e<=3112:e>=3114&&e<=3129||e>=3133&&e<=3140:e<3160?e<3146?e>=3142&&e<=3144:e>=3146&&e<=3149||e>=3157&&e<=3158:e<3174?e>=3160&&e<=3162||e>=3168&&e<=3171:e>=3174&&e<=3183||e>=3200&&e<=3203:e<3333?e<3274?e<3242?e<3214?e>=3205&&e<=3212:e>=3214&&e<=3216||e>=3218&&e<=3240:e<3260?e>=3242&&e<=3251||e>=3253&&e<=3257:e>=3260&&e<=3268||e>=3270&&e<=3272:e<3296?e<3285?e>=3274&&e<=3277:e>=3285&&e<=3286||e==3294:e<3313?e>=3296&&e<=3299||e>=3302&&e<=3311:e>=3313&&e<=3314||e>=3329&&e<=3331:e<3423?e<3389?e<3342?e>=3333&&e<=3340:e>=3342&&e<=3344||e>=3346&&e<=3386:e<3402?e>=3389&&e<=3396||e>=3398&&e<=3400:e>=3402&&e<=3406||e>=3412&&e<=3415:e<3458?e<3430?e>=3423&&e<=3427:e>=3430&&e<=3439||e>=3450&&e<=3455:e<3482?e>=3458&&e<=3459||e>=3461&&e<=3478:e>=3482&&e<=3505||e>=3507&&e<=3515:e<3804?e<3722?e<3570?e<3535?e<3520?e==3517:e>=3520&&e<=3526||e==3530:e<3544?e>=3535&&e<=3540||e==3542:e>=3544&&e<=3551||e>=3558&&e<=3567:e<3664?e<3585?e>=3570&&e<=3571:e>=3585&&e<=3642||e>=3648&&e<=3662:e<3716?e>=3664&&e<=3673||e>=3713&&e<=3714:e==3716||e>=3719&&e<=3720:e<3754?e<3737?e<3725?e==3722:e==3725||e>=3732&&e<=3735:e<3749?e>=3737&&e<=3743||e>=3745&&e<=3747:e==3749||e==3751:e<3776?e<3757?e>=3754&&e<=3755:e>=3757&&e<=3769||e>=3771&&e<=3773:e<3784?e>=3776&&e<=3780||e==3782:e>=3784&&e<=3789||e>=3792&&e<=3801:e<4176?e<3902?e<3872?e<3840?e>=3804&&e<=3807:e==3840||e>=3864&&e<=3865:e<3895?e>=3872&&e<=3881||e==3893:e==3895||e==3897:e<3974?e<3913?e>=3902&&e<=3911:e>=3913&&e<=3948||e>=3953&&e<=3972:e<4038?e>=3974&&e<=3991||e>=3993&&e<=4028:e==4038||e>=4096&&e<=4169:e<4688?e<4301?e<4256?e>=4176&&e<=4253:e>=4256&&e<=4293||e==4295:e<4348?e==4301||e>=4304&&e<=4346:e>=4348&&e<=4680||e>=4682&&e<=4685:e<4746?e<4698?e>=4688&&e<=4694||e==4696:e>=4698&&e<=4701||e>=4704&&e<=4744:e<4786?e>=4746&&e<=4749||e>=4752&&e<=4784:e>=4786&&e<=4789||e>=4792&&e<=4798:e<11035?e<7416?e<6176?e<5873?e<4992?e<4824?e<4802?e==4800:e>=4802&&e<=4805||e>=4808&&e<=4822:e<4888?e>=4824&&e<=4880||e>=4882&&e<=4885:e>=4888&&e<=4954||e>=4957&&e<=4959:e<5121?e<5024?e>=4992&&e<=5007:e>=5024&&e<=5109||e>=5112&&e<=5117:e<5761?e>=5121&&e<=5740||e>=5743&&e<=5759:e>=5761&&e<=5786||e>=5792&&e<=5866:e<6002?e<5920?e<5888?e>=5873&&e<=5880:e>=5888&&e<=5900||e>=5902&&e<=5908:e<5984?e>=5920&&e<=5940||e>=5952&&e<=5971:e>=5984&&e<=5996||e>=5998&&e<=6e3:e<6108?e<6016?e>=6002&&e<=6003:e>=6016&&e<=6099||e==6103:e<6155?e>=6108&&e<=6109||e>=6112&&e<=6121:e>=6155&&e<=6157||e>=6160&&e<=6169:e<6783?e<6512?e<6400?e<6272?e>=6176&&e<=6263:e>=6272&&e<=6314||e>=6320&&e<=6389:e<6448?e>=6400&&e<=6430||e>=6432&&e<=6443:e>=6448&&e<=6459||e>=6470&&e<=6509:e<6608?e<6528?e>=6512&&e<=6516:e>=6528&&e<=6571||e>=6576&&e<=6601:e<6688?e>=6608&&e<=6617||e>=6656&&e<=6683:e>=6688&&e<=6750||e>=6752&&e<=6780:e<7040?e<6832?e<6800?e>=6783&&e<=6793:e>=6800&&e<=6809||e==6823:e<6992?e>=6832&&e<=6846||e>=6912&&e<=6987:e>=6992&&e<=7001||e>=7019&&e<=7027:e<7245?e<7168?e>=7040&&e<=7155:e>=7168&&e<=7223||e>=7232&&e<=7241:e<7376?e>=7245&&e<=7293||e>=7296&&e<=7304:e>=7376&&e<=7378||e>=7380&&e<=7414:e<8450?e<8130?e<8025?e<7960?e<7424?e>=7416&&e<=7417:e>=7424&&e<=7669||e>=7675&&e<=7957:e<8008?e>=7960&&e<=7965||e>=7968&&e<=8005:e>=8008&&e<=8013||e>=8016&&e<=8023:e<8031?e<8027?e==8025:e==8027||e==8029:e<8118?e>=8031&&e<=8061||e>=8064&&e<=8116:e>=8118&&e<=8124||e==8126:e<8205?e<8150?e<8134?e>=8130&&e<=8132:e>=8134&&e<=8140||e>=8144&&e<=8147:e<8178?e>=8150&&e<=8155||e>=8160&&e<=8172:e>=8178&&e<=8180||e>=8182&&e<=8188:e<8305?e<8252?e==8205:e==8252||e==8265:e<8336?e==8305||e==8319:e>=8336&&e<=8348||e>=8400&&e<=8432:e<8579?e<8486?e<8469?e<8455?e==8450:e==8455||e>=8458&&e<=8467:e<8482?e==8469||e>=8473&&e<=8477:e==8482||e==8484:e<8495?e<8488?e==8486:e==8488||e>=8490&&e<=8493:e<8517?e>=8495&&e<=8505||e>=8508&&e<=8511:e>=8517&&e<=8521||e==8526:e<9410?e<9e3?e<8592?e>=8579&&e<=8580:e>=8592&&e<=8703||e>=8986&&e<=8987:e<9193?e==9e3||e==9167:e>=9193&&e<=9203||e>=9208&&e<=9210:e<9723?e<9654?e==9410||e>=9642&&e<=9643:e==9654||e==9664:e<10548?e>=9723&&e<=9726||e>=9728&&e<=10175:e>=10548&&e<=10549||e>=11013&&e<=11015:e<43259?e<12445?e<11688?e<11520?e<11264?e<11088?e>=11035&&e<=11036:e==11088||e==11093:e<11360?e>=11264&&e<=11310||e>=11312&&e<=11358:e>=11360&&e<=11492||e>=11499&&e<=11507:e<11568?e<11559?e>=11520&&e<=11557:e==11559||e==11565:e<11647?e>=11568&&e<=11623||e==11631:e>=11647&&e<=11670||e>=11680&&e<=11686:e<11744?e<11712?e<11696?e>=11688&&e<=11694:e>=11696&&e<=11702||e>=11704&&e<=11710:e<11728?e>=11712&&e<=11718||e>=11720&&e<=11726:e>=11728&&e<=11734||e>=11736&&e<=11742:e<12330?e<11823?e>=11744&&e<=11775:e==11823||e>=12293&&e<=12294:e<12353?e>=12330&&e<=12341||e>=12347&&e<=12349:e>=12353&&e<=12438||e>=12441&&e<=12442:e<42512?e<12951?e<12549?e<12449?e>=12445&&e<=12447:e>=12449&&e<=12538||e>=12540&&e<=12543:e<12704?e>=12549&&e<=12589||e>=12593&&e<=12686:e>=12704&&e<=12730||e>=12784&&e<=12799:e<19968?e<12953?e==12951:e==12953||e>=13312&&e<=19893:e<42192?e>=19968&&e<=40917||e>=40960&&e<=42124:e>=42192&&e<=42237||e>=42240&&e<=42508:e<42891?e<42623?e<42560?e>=42512&&e<=42539:e>=42560&&e<=42610||e>=42612&&e<=42621:e<42775?e>=42623&&e<=42725||e>=42736&&e<=42737:e>=42775&&e<=42783||e>=42786&&e<=42888:e<43072?e<42928?e>=42891&&e<=42926:e>=42928&&e<=42935||e>=42999&&e<=43047:e<43216?e>=43072&&e<=43123||e>=43136&&e<=43205:e>=43216&&e<=43225||e>=43232&&e<=43255:e<55243?e<43744?e<43488?e<43312?e<43261?e==43259:e==43261||e>=43264&&e<=43309:e<43392?e>=43312&&e<=43347||e>=43360&&e<=43388:e>=43392&&e<=43456||e>=43471&&e<=43481:e<43600?e<43520?e>=43488&&e<=43518:e>=43520&&e<=43574||e>=43584&&e<=43597:e<43642?e>=43600&&e<=43609||e>=43616&&e<=43638:e>=43642&&e<=43714||e>=43739&&e<=43741:e<43824?e<43785?e<43762?e>=43744&&e<=43759:e>=43762&&e<=43766||e>=43777&&e<=43782:e<43808?e>=43785&&e<=43790||e>=43793&&e<=43798:e>=43808&&e<=43814||e>=43816&&e<=43822:e<44012?e<43868?e>=43824&&e<=43866:e>=43868&&e<=43877||e>=43888&&e<=44010:e<44032?e>=44012&&e<=44013||e>=44016&&e<=44025:e>=44032&&e<=55203||e>=55216&&e<=55238:e<64848?e<64298?e<64112?e<55296?e>=55243&&e<=55291:e>=55296&&e<=57343||e>=63744&&e<=64109:e<64275?e>=64112&&e<=64217||e>=64256&&e<=64262:e>=64275&&e<=64279||e>=64285&&e<=64296:e<64320?e<64312?e>=64298&&e<=64310:e>=64312&&e<=64316||e==64318:e<64326?e>=64320&&e<=64321||e>=64323&&e<=64324:e>=64326&&e<=64433||e>=64467&&e<=64829:e<65296?e<65024?e<64914?e>=64848&&e<=64911:e>=64914&&e<=64967||e>=65008&&e<=65019:e<65136?e>=65024&&e<=65039||e>=65056&&e<=65071:e>=65136&&e<=65140||e>=65142&&e<=65276:e<65474?e<65345?e>=65296&&e<=65305||e>=65313&&e<=65338:e>=65345&&e<=65370||e>=65382&&e<=65470:e<65490?e>=65474&&e<=65479||e>=65482&&e<=65487:e>=65490&&e<=65495||e>=65498&&e<=65500}function Hvt(e){return e<47?e<42?e==33||e>=35&&e<=39:e>=42&&e<=43||e==45:e<63?e==47||e==61:e<94?e==63:e>=94&&e<=96||e>=123&&e<=126}function Gvt(e){return e<91?e<47?e>=35&&e<=43||e==45:e<61?e==47:e==61||e==64:e<95?e==91||e==93:e<123?e==95:e>=123&&e<=126||e==10003}function Wvt(e){return e<58?e<44?e==33:e==44||e==46:e<63?e>=58&&e<=59:e==63||e==94}function qvt(e){return e<91?e==40:e==91||e==123}function Yvt(e){return e<93?e==41:e==93||e==125}});var FRe=Yi(V9=>{"use strict";Object.defineProperty(V9,"__esModule",{value:!0});V9.tldRegex=void 0;V9.tldRegex=/^(?:xn--vermgensberatung-pwb|xn--vermgensberater-ctb|xn--clchc0ea0b2g2a9gcd|xn--w4r85el8fhu5dnra|travelersinsurance|vermögensberatung|xn--5su34j936bgsg|xn--bck1b9a5dre4c|xn--mgbah1a3hjkrd|xn--mgbai9azgqp6j|xn--mgberp4a5d4ar|xn--xkc2dl3a5ee0h|vermögensberater|xn--fzys8d69uvgm|xn--mgba7c0bbn0a|xn--mgbcpq6gpa1a|xn--xkc2al3hye2a|americanexpress|kerryproperties|sandvikcoromant|xn--i1b6b1a6a2e|xn--kcrx77d1x4a|xn--lgbbat1ad8j|xn--mgba3a4f16a|xn--mgbc0a9azcg|xn--nqv7fs00ema|americanfamily|weatherchannel|xn--54b7fta0cc|xn--6qq986b3xl|xn--80aqecdr1a|xn--b4w605ferd|xn--fiq228c5hs|xn--h2breg3eve|xn--jlq480n2rg|xn--mgba3a3ejt|xn--mgbaam7a8h|xn--mgbayh7gpa|xn--mgbbh1a71e|xn--mgbca7dzdo|xn--mgbi4ecexp|xn--mgbx4cd0ab|xn--rvc1e0am3e|international|lifeinsurance|wolterskluwer|xn--cckwcxetd|xn--eckvdtc9d|xn--fpcrj9c3d|xn--fzc2c9e2c|xn--h2brj9c8c|xn--tiq49xqyj|xn--yfro4i67o|xn--ygbi2ammx|construction|lplfinancial|scholarships|versicherung|xn--3e0b707e|xn--45br5cyl|xn--4dbrk0ce|xn--80adxhks|xn--80asehdb|xn--8y0a063a|xn--gckr3f0f|xn--mgb9awbf|xn--mgbab2bd|xn--mgbgu82a|xn--mgbpl2fh|xn--mgbt3dhd|xn--mk1bu44c|xn--ngbc5azd|xn--ngbe9e0a|xn--ogbpf8fl|xn--qcka1pmc|accountants|barclaycard|blackfriday|blockbuster|bridgestone|calvinklein|contractors|creditunion|engineering|enterprises|investments|kerryhotels|lamborghini|motorcycles|olayangroup|photography|playstation|productions|progressive|redumbrella|williamhill|xn--11b4c3d|xn--1ck2e1b|xn--1qqw23a|xn--2scrj9c|xn--3bst00m|xn--3ds443g|xn--3hcrj9c|xn--42c2d9a|xn--45brj9c|xn--55qw42g|xn--6frz82g|xn--80ao21a|xn--9krt00a|xn--cck2b3b|xn--czr694b|xn--d1acj3b|xn--efvy88h|xn--fct429k|xn--fjq720a|xn--flw351e|xn--g2xx48c|xn--gecrj9c|xn--gk3at1e|xn--h2brj9c|xn--hxt814e|xn--imr513n|xn--j6w193g|xn--jvr189m|xn--kprw13d|xn--kpry57d|xn--mgbbh1a|xn--mgbtx2b|xn--mix891f|xn--nyqy26a|xn--otu796d|xn--pgbs0dh|xn--q9jyb4c|xn--rhqv96g|xn--rovu88b|xn--s9brj9c|xn--ses554g|xn--t60b56a|xn--vuq861b|xn--w4rs40l|xn--xhq521b|xn--zfr164b|சிங்கப்பூர்|accountant|apartments|associates|basketball|bnpparibas|boehringer|capitalone|consulting|creditcard|cuisinella|eurovision|extraspace|foundation|healthcare|immobilien|industries|management|mitsubishi|nextdirect|properties|protection|prudential|realestate|republican|restaurant|schaeffler|tatamotors|technology|university|vlaanderen|xn--30rr7y|xn--3pxu8k|xn--45q11c|xn--4gbrim|xn--55qx5d|xn--5tzm5g|xn--80aswg|xn--90a3ac|xn--9dbq2a|xn--9et52u|xn--c2br7g|xn--cg4bki|xn--czrs0t|xn--czru2d|xn--fiq64b|xn--fiqs8s|xn--fiqz9s|xn--io0a7i|xn--kput3i|xn--mxtq1m|xn--o3cw4h|xn--pssy2u|xn--q7ce6a|xn--unup4y|xn--wgbh1c|xn--wgbl6a|xn--y9a3aq|accenture|allfinanz|amsterdam|analytics|aquarelle|barcelona|bloomberg|christmas|community|directory|education|equipment|fairwinds|financial|firestone|fresenius|furniture|goldpoint|hisamitsu|homedepot|homegoods|homesense|institute|insurance|kuokgroup|landrover|lifestyle|marketing|marshalls|melbourne|microsoft|panasonic|pramerica|richardli|shangrila|solutions|statebank|statefarm|stockholm|travelers|vacations|xn--90ais|xn--c1avg|xn--d1alf|xn--e1a4c|xn--fhbei|xn--j1aef|xn--j1amh|xn--l1acc|xn--ngbrx|xn--nqv7f|xn--p1acf|xn--qxa6a|xn--tckwe|xn--vhquv|yodobashi|موريتانيا|abudhabi|airforce|allstate|attorney|barclays|barefoot|bargains|baseball|boutique|bradesco|broadway|brussels|builders|business|capetown|catering|catholic|cipriani|cleaning|clinique|clothing|commbank|computer|delivery|deloitte|democrat|diamonds|discount|discover|download|engineer|ericsson|exchange|feedback|fidelity|firmdale|football|frontier|goodyear|grainger|graphics|hdfcbank|helsinki|holdings|hospital|infiniti|ipiranga|istanbul|jpmorgan|lighting|lundbeck|marriott|mckinsey|memorial|merckmsd|mortgage|observer|partners|pharmacy|pictures|plumbing|property|redstone|reliance|saarland|samsclub|security|services|shopping|softbank|software|stcgroup|supplies|training|vanguard|ventures|verisign|woodside|xn--90ae|xn--node|xn--p1ai|xn--qxam|yokohama|السعودية|abogado|academy|agakhan|alibaba|android|athleta|auction|audible|auspost|banamex|bauhaus|bestbuy|booking|brother|capital|caravan|careers|channel|charity|chintai|citadel|clubmed|college|cologne|company|compare|contact|cooking|corsica|country|coupons|courses|cricket|cruises|dentist|digital|domains|exposed|express|farmers|fashion|ferrari|ferrero|finance|fishing|fitness|flights|florist|flowers|forsale|frogans|fujitsu|gallery|genting|godaddy|grocery|guitars|hamburg|hangout|hitachi|holiday|hosting|hotmail|hyundai|ismaili|jewelry|juniper|kitchen|komatsu|lacaixa|lanxess|lasalle|latrobe|leclerc|limited|lincoln|markets|monster|netbank|netflix|network|neustar|okinawa|organic|origins|philips|pioneer|politie|realtor|recipes|rentals|reviews|rexroth|samsung|sandvik|schmidt|schwarz|science|shiksha|singles|staples|storage|support|surgery|systems|temasek|theater|theatre|tickets|toshiba|trading|walmart|wanggou|watches|weather|website|wedding|whoswho|windows|winners|yamaxun|youtube|zuerich|католик|البحرين|الجزائر|العليان|پاکستان|كاثوليك|இந்தியா|abbott|abbvie|africa|agency|airbus|airtel|alipay|alsace|alstom|amazon|anquan|aramco|author|bayern|beauty|berlin|bharti|bostik|boston|broker|camera|career|casino|center|chanel|chrome|church|circle|claims|clinic|coffee|comsec|condos|coupon|credit|cruise|dating|datsun|dealer|degree|dental|design|direct|doctor|dunlop|dupont|durban|emerck|energy|estate|events|expert|family|flickr|futbol|gallup|garden|george|giving|global|google|gratis|health|hermes|hiphop|hockey|hotels|hughes|imamat|insure|intuit|jaguar|joburg|juegos|kaufen|kindle|kosher|latino|lawyer|lefrak|living|locker|london|luxury|madrid|maison|makeup|market|mattel|mobile|monash|mormon|moscow|museum|nagoya|nissan|nissay|norton|nowruz|office|olayan|online|oracle|orange|otsuka|pfizer|photos|physio|pictet|quebec|racing|realty|reisen|repair|report|review|rogers|ryukyu|safety|sakura|sanofi|school|schule|search|secure|select|shouji|soccer|social|stream|studio|supply|suzuki|swatch|sydney|taipei|taobao|target|tattoo|tennis|tienda|tjmaxx|tkmaxx|toyota|travel|unicom|viajes|viking|villas|virgin|vision|voting|voyage|walter|webcam|xihuan|yachts|yandex|zappos|москва|онлайн|ابوظبي|ارامكو|الاردن|المغرب|امارات|فلسطين|مليسيا|भारतम्|இலங்கை|ファッション|actor|adult|aetna|amfam|amica|apple|archi|audio|autos|azure|baidu|beats|bible|bingo|black|boats|bosch|build|canon|cards|chase|cheap|cisco|citic|click|cloud|coach|codes|crown|cymru|dance|deals|delta|drive|dubai|earth|edeka|email|epson|faith|fedex|final|forex|forum|gallo|games|gifts|gives|glass|globo|gmail|green|gripe|group|gucci|guide|homes|honda|horse|house|hyatt|ikano|irish|jetzt|koeln|kyoto|lamer|lease|legal|lexus|lilly|loans|locus|lotte|lotto|mango|media|miami|money|movie|music|nexus|nikon|ninja|nokia|nowtv|omega|osaka|paris|parts|party|phone|photo|pizza|place|poker|praxi|press|prime|promo|quest|radio|rehab|reise|ricoh|rocks|rodeo|rugby|salon|sener|seven|sharp|shell|shoes|skype|sling|smart|smile|solar|space|sport|stada|store|study|style|sucks|swiss|tatar|tires|tirol|tmall|today|tokyo|tools|toray|total|tours|trade|trust|tunes|tushu|ubank|vegas|video|vodka|volvo|wales|watch|weber|weibo|works|world|xerox|yahoo|ישראל|ایران|بازار|بھارت|سودان|سورية|همراه|भारोत|संगठन|বাংলা|భారత్|ഭാരതം|嘉里大酒店|aarp|able|aero|akdn|ally|amex|arab|army|arpa|arte|asda|asia|audi|auto|baby|band|bank|bbva|beer|best|bike|bing|blog|blue|bofa|bond|book|buzz|cafe|call|camp|care|cars|casa|case|cash|cbre|cern|chat|citi|city|club|cool|coop|cyou|data|date|dclk|deal|dell|desi|diet|dish|docs|dvag|erni|fage|fail|fans|farm|fast|fido|film|fire|fish|flir|food|ford|free|fund|game|gbiz|gent|ggee|gift|gmbh|gold|golf|goog|guge|guru|hair|haus|hdfc|help|here|host|hsbc|icbc|ieee|imdb|immo|info|itau|java|jeep|jobs|jprs|kddi|kids|kiwi|kpmg|kred|land|lego|lgbt|lidl|life|like|limo|link|live|loan|love|ltda|luxe|maif|meet|meme|menu|mini|mint|mobi|moda|moto|name|navy|news|next|nico|nike|ollo|open|page|pars|pccw|pics|ping|pink|play|plus|pohl|porn|post|prod|prof|qpon|read|reit|rent|rest|rich|room|rsvp|ruhr|safe|sale|sarl|save|saxo|scot|seat|seek|sexy|shia|shop|show|silk|sina|site|skin|sncf|sohu|song|sony|spot|star|surf|talk|taxi|team|tech|teva|tiaa|tips|town|toys|tube|vana|visa|viva|vivo|vote|voto|wang|weir|wien|wiki|wine|work|xbox|yoga|zara|zero|zone|дети|сайт|بارت|بيتك|ڀارت|تونس|شبكة|عراق|عمان|موقع|भारत|ভারত|ভাৰত|ਭਾਰਤ|ભારત|ଭାରତ|ಭಾರತ|ලංකා|アマゾン|グーグル|クラウド|ポイント|组织机构|電訊盈科|香格里拉|aaa|abb|abc|aco|ads|aeg|afl|aig|anz|aol|app|art|aws|axa|bar|bbc|bbt|bcg|bcn|bet|bid|bio|biz|bms|bmw|bom|boo|bot|box|buy|bzh|cab|cal|cam|car|cat|cba|cbn|ceo|cfa|cfd|com|cpa|crs|dad|day|dds|dev|dhl|diy|dnp|dog|dot|dtv|dvr|eat|eco|edu|esq|eus|fan|fit|fly|foo|fox|frl|ftr|fun|fyi|gal|gap|gay|gdn|gea|gle|gmo|gmx|goo|gop|got|gov|hbo|hiv|hkt|hot|how|ibm|ice|icu|ifm|inc|ing|ink|int|ist|itv|jcb|jio|jll|jmp|jnj|jot|joy|kfh|kia|kim|kpn|krd|lat|law|lds|llc|llp|lol|lpl|ltd|man|map|mba|med|men|mil|mit|mlb|mls|mma|moe|moi|mom|mov|msd|mtn|mtr|nab|nba|nec|net|new|nfl|ngo|nhk|now|nra|nrw|ntt|nyc|obi|one|ong|onl|ooo|org|ott|ovh|pay|pet|phd|pid|pin|pnc|pro|pru|pub|pwc|red|ren|ril|rio|rip|run|rwe|sap|sas|sbi|sbs|scb|sew|sex|sfr|ski|sky|soy|spa|srl|stc|tab|tax|tci|tdk|tel|thd|tjx|top|trv|tui|tvs|ubs|uno|uol|ups|vet|vig|vin|vip|wed|win|wme|wow|wtc|wtf|xin|xxx|xyz|you|yun|zip|бел|ком|қаз|мкд|мон|орг|рус|срб|укр|հայ|קום|عرب|قطر|كوم|مصر|कॉम|नेट|คอม|ไทย|ລາວ|ストア|セール|みんな|中文网|亚马逊|天主教|我爱你|新加坡|淡马锡|飞利浦|ac|ad|ae|af|ag|ai|al|am|ao|aq|ar|as|at|au|aw|ax|az|ba|bb|bd|be|bf|bg|bh|bi|bj|bm|bn|bo|br|bs|bt|bv|bw|by|bz|ca|cc|cd|cf|cg|ch|ci|ck|cl|cm|cn|co|cr|cu|cv|cw|cx|cy|cz|de|dj|dk|dm|do|dz|ec|ee|eg|er|es|et|eu|fi|fj|fk|fm|fo|fr|ga|gb|gd|ge|gf|gg|gh|gi|gl|gm|gn|gp|gq|gr|gs|gt|gu|gw|gy|hk|hm|hn|hr|ht|hu|id|ie|il|im|in|io|iq|ir|is|it|je|jm|jo|jp|ke|kg|kh|ki|km|kn|kp|kr|kw|ky|kz|la|lb|lc|li|lk|lr|ls|lt|lu|lv|ly|ma|mc|md|me|mg|mh|mk|ml|mm|mn|mo|mp|mq|mr|ms|mt|mu|mv|mw|mx|my|mz|na|nc|ne|nf|ng|ni|nl|no|np|nr|nu|nz|om|pa|pe|pf|pg|ph|pk|pl|pm|pn|pr|ps|pt|pw|py|qa|re|ro|rs|ru|rw|sa|sb|sc|sd|se|sg|sh|si|sj|sk|sl|sm|sn|so|sr|ss|st|su|sv|sx|sy|sz|tc|td|tf|tg|th|tj|tk|tl|tm|tn|to|tr|tt|tv|tw|tz|ua|ug|uk|us|uy|uz|va|vc|ve|vg|vi|vn|vu|wf|ws|ye|yt|za|zm|zw|ελ|ευ|бг|ею|рф|გე|닷넷|닷컴|삼성|한국|コム|世界|中信|中国|中國|企业|佛山|信息|健康|八卦|公司|公益|台湾|台灣|商城|商店|商标|嘉里|在线|大拿|娱乐|家電|广东|微博|慈善|手机|招聘|政务|政府|新闻|时尚|書籍|机构|游戏|澳門|点看|移动|网址|网店|网站|网络|联通|谷歌|购物|通販|集团|食品|餐厅|香港)$/});var j9=Yi(Qr=>{"use strict";Object.defineProperty(Qr,"__esModule",{value:!0});Qr.isDomainLabelStartChar=Qr.isSchemeStartChar=Qr.tldUrlHostRe=Qr.schemeUrlRe=Qr.invalidSchemeRe=Qr.httpSchemePrefixRe=Qr.httpSchemeRe=void 0;Qr.isSchemeChar=Kvt;Qr.isDomainLabelChar=$vt;Qr.isPathChar=Jvt;Qr.isUrlSuffixStartChar=Zvt;Qr.isKnownTld=BRe;Qr.isValidSchemeUrl=Qvt;Qr.isValidTldMatch=eSt;Qr.isValidIpV4Address=iSt;var YE=qE(),Xvt=FRe();Qr.httpSchemeRe=/https?:\/\//i;Qr.httpSchemePrefixRe=new RegExp("^"+Qr.httpSchemeRe.source,"i");Qr.invalidSchemeRe=/^(javascript|vbscript):/i;Qr.schemeUrlRe=/^[A-Za-z][-.+A-Za-z0-9]*:(\/\/)?([^:/]*)/;Qr.tldUrlHostRe=/^(?:\/\/)?([^/#?:]+)/;Qr.isSchemeStartChar=YE.isAsciiLetterChar;function Kvt(e){return(0,YE.isAsciiLetterChar)(e)||(0,YE.isDigitChar)(e)||e===43||e===45||e===46}Qr.isDomainLabelStartChar=YE.isAlphaNumericOrMarkChar;function $vt(e){return e===95||(0,Qr.isDomainLabelStartChar)(e)}function Jvt(e){return(0,YE.isAlphaNumericOrMarkChar)(e)||(0,YE.isUrlSuffixAllowedSpecialChar)(e)||(0,YE.isUrlSuffixNotAllowedAsFinalChar)(e)}function Zvt(e){return e===47||e===63||e===35}function BRe(e){return Xvt.tldRegex.test(e.toLowerCase())}function Qvt(e){if(Qr.invalidSchemeRe.test(e))return!1;var t=e.match(Qr.schemeUrlRe);if(!t)return!1;var n=!!t[1],i=t[2];return n?!0:!(i.indexOf(".")===-1||!/[A-Za-z]/.test(i))}function eSt(e){var t=e.match(Qr.tldUrlHostRe);if(!t)return!1;var n=t[0],i=n.split(".");if(i.length<2)return!1;var r=i[i.length-1];return!!BRe(r)}var tSt=/^(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$/,nSt=/[:/?#]/;function iSt(e){var t=e.split(nSt,1)[0];return tSt.test(t)}});var Qie=Yi(H9=>{"use strict";Object.defineProperty(H9,"__esModule",{value:!0});H9.UrlMatch=void 0;var rSt=(Jm(),Fh($m)),oSt=WE(),sSt=j9(),aSt=/^(https?:\/\/)?(?:www\.)?/i,cSt=/^\/\//,lSt=(function(e){rSt.__extends(t,e);function t(n){var i=e.call(this,n)||this;return i.type="url",i.url="",i.urlMatchType="scheme",i.protocolRelativeMatch=!1,i.stripPrefix={scheme:!0,www:!0},i.stripTrailingSlash=!0,i.decodePercentEncoding=!0,i.protocolPrepended=!1,i.urlMatchType=n.urlMatchType,i.url=n.url,i.protocolRelativeMatch=n.protocolRelativeMatch,i.stripPrefix=n.stripPrefix,i.stripTrailingSlash=n.stripTrailingSlash,i.decodePercentEncoding=n.decodePercentEncoding,i}return t.prototype.getType=function(){return"url"},t.prototype.getUrlMatchType=function(){return this.urlMatchType},t.prototype.getUrl=function(){var n=this.url;return!this.protocolRelativeMatch&&this.urlMatchType!=="scheme"&&!this.protocolPrepended&&(n=this.url="http://"+n,this.protocolPrepended=!0),n},t.prototype.getAnchorHref=function(){var n=this.getUrl();return n.replace(/&/g,"&")},t.prototype.getAnchorText=function(){var n=this.getMatchedText();return this.protocolRelativeMatch&&(n=dSt(n)),this.stripPrefix.scheme&&(n=uSt(n)),this.stripPrefix.www&&(n=fSt(n)),this.stripTrailingSlash&&(n=hSt(n)),this.decodePercentEncoding&&(n=mSt(n)),n},t})(oSt.AbstractMatch);H9.UrlMatch=lSt;function uSt(e){return e.replace(sSt.httpSchemePrefixRe,"")}function fSt(e){return e.includes("www.")?e.replace(aSt,"$1"):e}function dSt(e){return e.replace(cSt,"")}function hSt(e){return e.charAt(e.length-1)==="/"&&(e=e.slice(0,-1)),e}function mSt(e){var t=e.replace(/%(?:22|26|27|3C|3E)/gi,function(n){return n==="%22"?""":n==="%26"?"&":n==="%27"?"'":n==="%3C"||n==="%3c"?"<":">"});if(t.includes("%"))try{return decodeURIComponent(t)}catch{}return t}});var URe=Yi(J_=>{"use strict";Object.defineProperty(J_,"__esModule",{value:!0});J_.isEmailLocalPartStartChar=J_.mailtoSchemePrefixRe=void 0;J_.isEmailLocalPartChar=gSt;J_.isValidEmail=_St;var kRe=qE(),pSt=j9();J_.mailtoSchemePrefixRe=/^mailto:/i;J_.isEmailLocalPartStartChar=kRe.isAlphaNumericOrMarkChar;function gSt(e){return(0,J_.isEmailLocalPartStartChar)(e)||(0,kRe.isValidEmailLocalPartSpecialChar)(e)}function _St(e){var t=e.split(".").pop();return(0,pSt.isKnownTld)(t)}});var ere=Yi(G9=>{"use strict";Object.defineProperty(G9,"__esModule",{value:!0});G9.EmailMatch=void 0;var ySt=(Jm(),Fh($m)),ASt=WE(),bSt=(function(e){ySt.__extends(t,e);function t(n){var i=e.call(this,n)||this;return i.type="email",i.email="",i.email=n.email,i}return t.prototype.getType=function(){return"email"},t.prototype.getEmail=function(){return this.email},t.prototype.getAnchorHref=function(){return"mailto:"+this.email},t.prototype.getAnchorText=function(){return this.email},t})(ASt.AbstractMatch);G9.EmailMatch=bSt});var tre=Yi(nP=>{"use strict";Object.defineProperty(nP,"__esModule",{value:!0});nP.hashtagServices=void 0;nP.isHashtagTextChar=TSt;nP.isValidHashtag=ESt;var xSt=qE();function TSt(e){return e===95||(0,xSt.isAlphaNumericOrMarkChar)(e)}function ESt(e){return e.length<=140}nP.hashtagServices=["twitter","facebook","instagram","tiktok","youtube"]});var nre=Yi(W9=>{"use strict";Object.defineProperty(W9,"__esModule",{value:!0});W9.HashtagMatch=void 0;var CSt=(Jm(),Fh($m)),vSt=yb(),SSt=WE(),wSt=(function(e){CSt.__extends(t,e);function t(n){var i=e.call(this,n)||this;return i.type="hashtag",i.serviceName="twitter",i.hashtag="",i.serviceName=n.serviceName,i.hashtag=n.hashtag,i}return t.prototype.getType=function(){return"hashtag"},t.prototype.getServiceName=function(){return this.serviceName},t.prototype.getHashtag=function(){return this.hashtag},t.prototype.getAnchorHref=function(){var n=this.serviceName,i=this.hashtag;switch(n){case"twitter":return"https://twitter.com/hashtag/"+i;case"facebook":return"https://www.facebook.com/hashtag/"+i;case"instagram":return"https://instagram.com/explore/tags/"+i;case"tiktok":return"https://www.tiktok.com/tag/"+i;case"youtube":return"https://youtube.com/hashtag/"+i;default:(0,vSt.assertNever)(n)}},t.prototype.getAnchorText=function(){return"#"+this.hashtag},t.prototype.getCssClassSuffixes=function(){var n=e.prototype.getCssClassSuffixes.call(this),i=this.getServiceName();return i&&n.push(i),n},t})(SSt.AbstractMatch);W9.HashtagMatch=wSt});var ire=Yi(iP=>{"use strict";Object.defineProperty(iP,"__esModule",{value:!0});iP.mentionServices=void 0;iP.isMentionTextChar=PSt;iP.isValidMention=DSt;var zRe=qE(),ISt={twitter:/^@\w{1,15}$/,instagram:/^@[_\w]{1,30}$/,soundcloud:/^@[-a-z0-9_]{3,25}$/,tiktok:/^@[.\w]{1,23}[\w]$/,youtube:/^@[-.·\w]{3,30}$/};function PSt(e){return e===45||e===46||e===95||(0,zRe.isAsciiLetterChar)(e)||(0,zRe.isDigitChar)(e)}function DSt(e,t){var n=ISt[t];return n.test(e)}iP.mentionServices=["twitter","instagram","soundcloud","tiktok","youtube"]});var rre=Yi(q9=>{"use strict";Object.defineProperty(q9,"__esModule",{value:!0});q9.MentionMatch=void 0;var RSt=(Jm(),Fh($m)),OSt=yb(),MSt=WE(),NSt=(function(e){RSt.__extends(t,e);function t(n){var i=e.call(this,n)||this;return i.type="mention",i.serviceName="twitter",i.mention="",i.mention=n.mention,i.serviceName=n.serviceName,i}return t.prototype.getType=function(){return"mention"},t.prototype.getMention=function(){return this.mention},t.prototype.getServiceName=function(){return this.serviceName},t.prototype.getAnchorHref=function(){switch(this.serviceName){case"twitter":return"https://twitter.com/"+this.mention;case"instagram":return"https://instagram.com/"+this.mention;case"soundcloud":return"https://soundcloud.com/"+this.mention;case"tiktok":return"https://www.tiktok.com/@"+this.mention;case"youtube":return"https://youtube.com/@"+this.mention;default:(0,OSt.assertNever)(this.serviceName)}},t.prototype.getAnchorText=function(){return"@"+this.mention},t.prototype.getCssClassSuffixes=function(){var n=e.prototype.getCssClassSuffixes.call(this),i=this.getServiceName();return i&&n.push(i),n},t})(MSt.AbstractMatch);q9.MentionMatch=NSt});var VRe=Yi(OU=>{"use strict";Object.defineProperty(OU,"__esModule",{value:!0});OU.isPhoneNumberSeparatorChar=USt;OU.isPhoneNumberControlChar=zSt;OU.isValidPhoneNumber=VSt;var LSt=/[-. ()]/,FSt=/(?:(?:(?:(\+)?\d{1,3}[-. ]?)?\(?\d{3}\)?[-. ]?\d{3}[-. ]?\d{4})|(?:(\+)(?:9[976]\d|8[987530]\d|6[987]\d|5[90]\d|42\d|3[875]\d|2[98654321]\d|9[8543210]|8[6421]|6[6543210]|5[87654321]|4[987654310]|3[9643210]|2[70]|7|1)[-. ]?(?:\d[-. ]?){6,12}\d+))([,;]+[0-9]+#?)*/,BSt=/(0([1-9]-?[1-9]\d{3}|[1-9]{2}-?\d{3}|[1-9]{2}\d{1}-?\d{2}|[1-9]{2}\d{2}-?\d{1})-?\d{4}|0[789]0-?\d{4}-?\d{4}|050-?\d{4}-?\d{4})/,kSt=new RegExp("^".concat(FSt.source,"|").concat(BSt.source,"$"));function USt(e){return e===45||e===46||e===32}function zSt(e){return e===44||e===59}function VSt(e){var t=e.charAt(0)==="+"||LSt.test(e);return t&&kSt.test(e)}});var ore=Yi(Y9=>{"use strict";Object.defineProperty(Y9,"__esModule",{value:!0});Y9.PhoneMatch=void 0;var jSt=(Jm(),Fh($m)),HSt=WE(),GSt=(function(e){jSt.__extends(t,e);function t(n){var i=e.call(this,n)||this;return i.type="phone",i.number="",i.plusSign=!1,i.number=n.number,i.plusSign=n.plusSign,i}return t.prototype.getType=function(){return"phone"},t.prototype.getPhoneNumber=function(){return this.number},t.prototype.getNumber=function(){return this.getPhoneNumber()},t.prototype.getAnchorHref=function(){return"tel:"+(this.plusSign?"+":"")+this.number},t.prototype.getAnchorText=function(){return this.matchedText},t})(HSt.AbstractMatch);Y9.PhoneMatch=GSt});var ure=Yi(J9=>{"use strict";Object.defineProperty(J9,"__esModule",{value:!0});J9.parseMatches=JSt;J9.excludeUnbalancedTrailingBracesAndPunctuation=GRe;var WSt=Qie(),X9=yb(),zo=j9(),rP=URe(),qSt=ere(),cre=tre(),YSt=nre(),lre=ire(),XSt=rre(),oP=VRe(),KSt=ore(),aa=qE(),$St=(function(){function e(t,n){this.charIdx=0,this.matches=[],this._stateMachines=[],this.schemeUrlMachinesCount=0,this.text=t,this.tagBuilder=n.tagBuilder,this.stripPrefix=n.stripPrefix,this.stripTrailingSlash=n.stripTrailingSlash,this.decodePercentEncoding=n.decodePercentEncoding,this.hashtagServiceName=n.hashtagServiceName,this.mentionServiceName=n.mentionServiceName}return Object.defineProperty(e.prototype,"stateMachines",{get:function(){return this._stateMachines},enumerable:!1,configurable:!0}),e.prototype.addMachine=function(t){this._stateMachines.push(t),HRe(t)&&this.schemeUrlMachinesCount++},e.prototype.removeMachine=function(t){this._stateMachines=this._stateMachines.filter(function(n){return n!==t}),HRe(t)&&this.schemeUrlMachinesCount--},e.prototype.hasSchemeUrlMachine=function(){return this.schemeUrlMachinesCount>0},e})();function JSt(e,t){for(var n=new $St(e,t);n.charIdx<n.text.length;n.charIdx++){var i=e.charAt(n.charIdx),r=e.charCodeAt(n.charIdx);if(n.stateMachines.length===0)K9(n,i,r);else{for(var o=n.stateMachines.length-1;o>=0;o--){var s=n.stateMachines[o];switch(s.state){case 11:iwt(n,s,r);break;case 12:rwt(n,s,r);break;case 0:ZSt(n,s,r);break;case 1:QSt(n,s,r);break;case 2:ewt(n,s,r);break;case 3:twt(n,s,r);break;case 4:nwt(n,s,i,r);break;case 5:owt(n,s,r);break;case 6:swt(n,s,i,r);break;case 7:awt(n,s,i,r);break;case 13:cwt(n,s,r);break;case 14:lwt(n,s,r);break;case 8:uwt(n,s,r);break;case 9:fwt(n,s,r);break;case 10:dwt(n,s,r);break;case 15:hwt(n,s,i,r);break;case 16:mwt(n,s,i,r);break;case 17:pwt(n,s,i,r);break;case 18:gwt(n,s,i,r);break;case 19:_wt(n,s,i,r);break;case 20:ywt(n,s,r);break;case 21:Awt(n,s,r);break;case 22:XE(n,s,r);break;case 23:bwt(n,s,r);break;case 24:xwt(n,s,r);break;case 25:Twt(n,s,r);break;case 26:Ewt(n,s,r);break;case 27:Cwt(n,s,r);break;case 28:vwt(n,s,r);break;case 29:Swt(n,s,r);break;case 30:wwt(n,s,r);break;case 31:Iwt(n,s,r);break;case 32:Dwt(n,s,i,r);break;case 33:Rwt(n,s,r);break;case 34:Owt(n,s,r);break;case 35:Mwt(n,s,r);break;case 36:Nwt(n,s,i,r);break;case 37:Pwt(n,s,i,r);break;case 38:Lwt(n,s,i,r);break;case 39:Fwt(n,s,i,r);break;case 40:Bwt(n,s,r);break;case 41:kwt(n,s,r);break;default:(0,X9.assertNever)(s.state)}}if(!n.hasSchemeUrlMachine()&&n.charIdx>0&&(0,zo.isSchemeStartChar)(r)){var a=n.text.charCodeAt(n.charIdx-1);(0,zo.isSchemeStartChar)(a)||n.addMachine($9(n.charIdx,0))}}}for(var c=n.stateMachines.length-1;c>=0;c--)n.stateMachines.forEach(function(u){return Ns(n,u)});return n.matches}function K9(e,t,n){var i=e.charIdx;if(n===35)e.addMachine(jwt(i,28));else if(n===64)e.addMachine(Hwt(i,30));else if(n===47)e.addMachine(are(i,11));else if(n===43)e.addMachine(sre(i,37));else if(n===40)e.addMachine(sre(i,32));else{if((0,aa.isDigitChar)(n)&&(e.addMachine(sre(i,38)),e.addMachine(zwt(i,13))),(0,rP.isEmailLocalPartStartChar)(n)){var r=t.toLowerCase()==="m"?15:22;e.addMachine(Vwt(i,r))}(0,zo.isSchemeStartChar)(n)&&e.addMachine($9(i,0)),(0,aa.isAlphaNumericOrMarkChar)(n)&&e.addMachine(are(i,5))}}function ZSt(e,t,n){n===58?t.state=2:n===45?t.state=1:(0,zo.isSchemeChar)(n)||e.removeMachine(t)}function QSt(e,t,n){var i=e.charIdx;n===45||(n===47?(e.removeMachine(t),e.addMachine(are(i,11))):(0,zo.isSchemeChar)(n)?t.state=0:e.removeMachine(t))}function ewt(e,t,n){var i=e.charIdx;n===47?t.state=3:n===46?e.removeMachine(t):(0,zo.isDomainLabelStartChar)(n)?(t.state=5,(0,zo.isSchemeStartChar)(n)&&e.addMachine($9(i,0))):e.removeMachine(t)}function twt(e,t,n){n===47?t.state=4:(0,zo.isPathChar)(n)?(t.state=10,t.acceptStateReached=!0):Ns(e,t)}function nwt(e,t,n,i){i===47?(t.state=10,t.acceptStateReached=!0):(0,zo.isDomainLabelStartChar)(i)?(t.state=5,t.acceptStateReached=!0):e.removeMachine(t)}function iwt(e,t,n){n===47?t.state=12:e.removeMachine(t)}function rwt(e,t,n){(0,zo.isDomainLabelStartChar)(n)?t.state=5:e.removeMachine(t)}function owt(e,t,n){n===46?t.state=7:n===45?t.state=6:n===58?t.state=8:(0,zo.isUrlSuffixStartChar)(n)?t.state=10:(0,zo.isDomainLabelChar)(n)||Ns(e,t)}function swt(e,t,n,i){i===45||(i===46?Ns(e,t):(0,zo.isDomainLabelStartChar)(i)?t.state=5:Ns(e,t))}function awt(e,t,n,i){i===46?Ns(e,t):(0,zo.isDomainLabelStartChar)(i)?(t.state=5,t.acceptStateReached=!0):Ns(e,t)}function cwt(e,t,n){n===46?t.state=14:n===58?t.state=8:(0,aa.isDigitChar)(n)||((0,zo.isUrlSuffixStartChar)(n)?t.state=10:(0,aa.isAlphaNumericOrMarkChar)(n)?e.removeMachine(t):Ns(e,t))}function lwt(e,t,n){(0,aa.isDigitChar)(n)?(t.octetsEncountered++,t.octetsEncountered===4&&(t.acceptStateReached=!0),t.state=13):Ns(e,t)}function uwt(e,t,n){(0,aa.isDigitChar)(n)?t.state=9:Ns(e,t)}function fwt(e,t,n){(0,aa.isDigitChar)(n)||((0,zo.isUrlSuffixStartChar)(n)?t.state=10:Ns(e,t))}function dwt(e,t,n){(0,zo.isPathChar)(n)||Ns(e,t)}function hwt(e,t,n,i){n.toLowerCase()==="a"?t.state=16:XE(e,t,i)}function mwt(e,t,n,i){n.toLowerCase()==="i"?t.state=17:XE(e,t,i)}function pwt(e,t,n,i){n.toLowerCase()==="l"?t.state=18:XE(e,t,i)}function gwt(e,t,n,i){n.toLowerCase()==="t"?t.state=19:XE(e,t,i)}function _wt(e,t,n,i){n.toLowerCase()==="o"?t.state=20:XE(e,t,i)}function ywt(e,t,n){n===58?t.state=21:XE(e,t,n)}function Awt(e,t,n){(0,rP.isEmailLocalPartChar)(n)?t.state=22:e.removeMachine(t)}function XE(e,t,n){n===46?t.state=23:n===64?t.state=24:(0,rP.isEmailLocalPartChar)(n)?t.state=22:e.removeMachine(t)}function bwt(e,t,n){n===46||n===64?e.removeMachine(t):(0,rP.isEmailLocalPartChar)(n)?t.state=22:e.removeMachine(t)}function xwt(e,t,n){(0,zo.isDomainLabelStartChar)(n)?t.state=25:e.removeMachine(t)}function Twt(e,t,n){n===46?t.state=27:n===45?t.state=26:(0,zo.isDomainLabelChar)(n)||Ns(e,t)}function Ewt(e,t,n){n===45||n===46?Ns(e,t):(0,zo.isDomainLabelChar)(n)?t.state=25:Ns(e,t)}function Cwt(e,t,n){n===46||n===45?Ns(e,t):(0,zo.isDomainLabelStartChar)(n)?(t.state=25,t.acceptStateReached=!0):Ns(e,t)}function vwt(e,t,n){(0,cre.isHashtagTextChar)(n)?(t.state=29,t.acceptStateReached=!0):e.removeMachine(t)}function Swt(e,t,n){(0,cre.isHashtagTextChar)(n)||Ns(e,t)}function wwt(e,t,n){(0,lre.isMentionTextChar)(n)?(t.state=31,t.acceptStateReached=!0):e.removeMachine(t)}function Iwt(e,t,n){(0,lre.isMentionTextChar)(n)||((0,aa.isAlphaNumericOrMarkChar)(n)?e.removeMachine(t):Ns(e,t))}function Pwt(e,t,n,i){(0,aa.isDigitChar)(i)?t.state=38:(e.removeMachine(t),K9(e,n,i))}function Dwt(e,t,n,i){(0,aa.isDigitChar)(i)?t.state=33:e.removeMachine(t),K9(e,n,i)}function Rwt(e,t,n){(0,aa.isDigitChar)(n)?t.state=34:e.removeMachine(t)}function Owt(e,t,n){(0,aa.isDigitChar)(n)?t.state=35:e.removeMachine(t)}function Mwt(e,t,n){n===41?t.state=36:e.removeMachine(t)}function Nwt(e,t,n,i){(0,aa.isDigitChar)(i)?t.state=38:(0,oP.isPhoneNumberSeparatorChar)(i)?t.state=39:e.removeMachine(t)}function Lwt(e,t,n,i){var r=e.charIdx;t.acceptStateReached=!0,(0,oP.isPhoneNumberControlChar)(i)?t.state=40:i===35?t.state=41:(0,aa.isDigitChar)(i)||(i===40?t.state=32:(0,oP.isPhoneNumberSeparatorChar)(i)?t.state=39:(Ns(e,t),(0,zo.isSchemeStartChar)(i)&&e.addMachine($9(r,0))))}function Fwt(e,t,n,i){(0,aa.isDigitChar)(i)?t.state=38:i===40?t.state=32:(Ns(e,t),K9(e,n,i))}function Bwt(e,t,n){(0,oP.isPhoneNumberControlChar)(n)||(n===35?t.state=41:(0,aa.isDigitChar)(n)?t.state=38:Ns(e,t))}function kwt(e,t,n){(0,oP.isPhoneNumberControlChar)(n)?t.state=40:(0,aa.isDigitChar)(n)?e.removeMachine(t):Ns(e,t)}function Ns(e,t){var n=e.matches,i=e.text,r=e.charIdx,o=e.tagBuilder,s=e.stripPrefix,a=e.stripTrailingSlash,c=e.decodePercentEncoding,u=e.hashtagServiceName,f=e.mentionServiceName;if(e.removeMachine(t),!!t.acceptStateReached){var d=t.startIdx,p=i.slice(t.startIdx,r);switch(p=GRe(p),t.type){case 0:{var g=i.charCodeAt(t.startIdx-1);if(g===64)return;switch(t.matchType){case 0:{var m=zo.httpSchemeRe.exec(p);if(m&&(d=d+m.index,p=p.slice(m.index)),!(0,zo.isValidSchemeUrl)(p))return;break}case 1:{if(!(0,zo.isValidTldMatch)(p))return;break}case 2:{if(!(0,zo.isValidIpV4Address)(p))return;break}default:(0,X9.assertNever)(t)}n.push(new WSt.UrlMatch({tagBuilder:o,matchedText:p,offset:d,urlMatchType:Uwt(t.matchType),url:p,protocolRelativeMatch:p.slice(0,2)==="//",stripPrefix:s,stripTrailingSlash:a,decodePercentEncoding:c}));break}case 1:{(0,rP.isValidEmail)(p)&&n.push(new qSt.EmailMatch({tagBuilder:o,matchedText:p,offset:d,email:p.replace(rP.mailtoSchemePrefixRe,"")}));break}case 2:{(0,cre.isValidHashtag)(p)&&n.push(new YSt.HashtagMatch({tagBuilder:o,matchedText:p,offset:d,serviceName:u,hashtag:p.slice(1)}));break}case 3:{(0,lre.isValidMention)(p,f)&&n.push(new XSt.MentionMatch({tagBuilder:o,matchedText:p,offset:d,serviceName:f,mention:p.slice(1)}));break}case 4:{if(p=p.replace(/ +$/g,""),(0,oP.isValidPhoneNumber)(p)){var y=p.replace(/[^0-9,;#]/g,"");n.push(new KSt.PhoneMatch({tagBuilder:o,matchedText:p,offset:d,number:y,plusSign:p.charAt(0)==="+"}))}break}default:(0,X9.assertNever)(t)}}}function Uwt(e){switch(e){case 0:return"scheme";case 1:return"tld";case 2:return"ipV4";default:(0,X9.assertNever)(e)}}var jRe={")":"(","}":"{","]":"["};function GRe(e){for(var t={"(":0,"{":0,"[":0},n=0;n<e.length;n++){var i=e.charAt(n),r=e.charCodeAt(n);(0,aa.isOpenBraceChar)(r)?t[i]++:(0,aa.isCloseBraceChar)(r)&&t[jRe[i]]--}for(var o=e.length-1;o>=0;){var i=e.charAt(o),r=e.charCodeAt(o);if((0,aa.isCloseBraceChar)(r)){var s=jRe[i];if(t[s]<0)t[s]++,o--;else break}else if((0,aa.isUrlSuffixNotAllowedAsFinalChar)(r))o--;else break}return e.slice(0,o+1)}function $9(e,t){return{type:0,startIdx:e,state:t,acceptStateReached:!1,matchType:0}}function are(e,t){return{type:0,startIdx:e,state:t,acceptStateReached:!1,matchType:1}}function zwt(e,t){return{type:0,startIdx:e,state:t,acceptStateReached:!1,matchType:2,octetsEncountered:1}}function Vwt(e,t){return{type:1,startIdx:e,state:t,acceptStateReached:!1}}function jwt(e,t){return{type:2,startIdx:e,state:t,acceptStateReached:!1}}function Hwt(e,t){return{type:3,startIdx:e,state:t,acceptStateReached:!1}}function sre(e,t){return{type:4,startIdx:e,state:t,acceptStateReached:!1}}function HRe(e){return e.type===0&&e.matchType===0}});var WRe=Yi(hre=>{"use strict";Object.defineProperty(hre,"__esModule",{value:!0});hre.parseHtml=qwt;var El=(Jm(),Fh($m)),_u=qE(),Gwt=yb(),w0=(function(){function e(t){t===void 0&&(t={}),this.idx=t.idx!==void 0?t.idx:-1,this.type=t.type||"tag",this.name=t.name||"",this.isOpening=!!t.isOpening,this.isClosing=!!t.isClosing}return e})(),dre=new w0,Wwt=(function(){function e(t,n){this.charIdx=0,this.state=0,this.currentDataIdx=0,this.currentTag=dre,this.html=t,this.callbacks=n}return e})();function qwt(e,t){for(var n=new Wwt(e,t),i=e.length;n.charIdx<i;){var r=e.charAt(n.charIdx),o=e.charCodeAt(n.charIdx);switch(n.state){case 0:Ywt(n,r);break;case 1:Xwt(n,r,o);break;case 2:$wt(n,r,o);break;case 3:Kwt(n,r,o);break;case 4:Jwt(n,r,o);break;case 5:Zwt(n,r,o);break;case 6:Qwt(n,r,o);break;case 7:eIt(n,r,o);break;case 8:tIt(n,r);break;case 9:nIt(n,r);break;case 10:iIt(n,r,o);break;case 11:rIt(n,r,o);break;case 12:oIt(n,r);break;case 13:sIt(n);break;case 14:aIt(n,r);break;case 15:cIt(n,r);break;case 16:lIt(n,r);break;case 17:uIt(n,r);break;case 18:fIt(n,r);break;case 19:dIt(n,r);break;case 20:hIt(n,r);break;default:(0,Gwt.assertNever)(n.state)}n.charIdx++}n.currentDataIdx<n.charIdx&&mIt(n)}function Ywt(e,t){t==="<"&&I0(e)}function Xwt(e,t,n){t==="!"?e.state=13:t==="/"?(e.state=2,e.currentTag=new w0(El.__assign(El.__assign({},e.currentTag),{isClosing:!0}))):t==="<"?I0(e):(0,_u.isAsciiLetterChar)(n)?(e.state=3,e.currentTag=new w0(El.__assign(El.__assign({},e.currentTag),{isOpening:!0}))):(e.state=0,e.currentTag=dre)}function Kwt(e,t,n){(0,_u.isWhitespaceChar)(n)?(e.currentTag=new w0(El.__assign(El.__assign({},e.currentTag),{name:fre(e)})),e.state=4):t==="<"?I0(e):t==="/"?(e.currentTag=new w0(El.__assign(El.__assign({},e.currentTag),{name:fre(e)})),e.state=12):t===">"?(e.currentTag=new w0(El.__assign(El.__assign({},e.currentTag),{name:fre(e)})),P0(e)):!(0,_u.isAsciiLetterChar)(n)&&!(0,_u.isDigitChar)(n)&&t!==":"&&bh(e)}function $wt(e,t,n){t===">"?bh(e):(0,_u.isAsciiLetterChar)(n)?e.state=3:bh(e)}function Jwt(e,t,n){(0,_u.isWhitespaceChar)(n)||(t==="/"?e.state=12:t===">"?P0(e):t==="<"?I0(e):t==="="||(0,_u.isQuoteChar)(n)||(0,_u.isControlChar)(n)?bh(e):e.state=5)}function Zwt(e,t,n){(0,_u.isWhitespaceChar)(n)?e.state=6:t==="/"?e.state=12:t==="="?e.state=7:t===">"?P0(e):t==="<"?I0(e):(0,_u.isQuoteChar)(n)&&bh(e)}function Qwt(e,t,n){(0,_u.isWhitespaceChar)(n)||(t==="/"?e.state=12:t==="="?e.state=7:t===">"?P0(e):t==="<"?I0(e):(0,_u.isQuoteChar)(n)?bh(e):e.state=5)}function eIt(e,t,n){(0,_u.isWhitespaceChar)(n)||(t==='"'?e.state=8:t==="'"?e.state=9:/[>=`]/.test(t)?bh(e):t==="<"?I0(e):e.state=10)}function tIt(e,t){t==='"'&&(e.state=11)}function nIt(e,t){t==="'"&&(e.state=11)}function iIt(e,t,n){(0,_u.isWhitespaceChar)(n)?e.state=4:t===">"?P0(e):t==="<"&&I0(e)}function rIt(e,t,n){(0,_u.isWhitespaceChar)(n)?e.state=4:t==="/"?e.state=12:t===">"?P0(e):t==="<"?I0(e):(e.state=4,pIt(e))}function oIt(e,t){t===">"?(e.currentTag=new w0(El.__assign(El.__assign({},e.currentTag),{isClosing:!0})),P0(e)):bh(e)}function sIt(e){var t=e.html,n=e.charIdx;t.slice(n,n+2)==="--"?(e.charIdx++,e.currentTag=new w0(El.__assign(El.__assign({},e.currentTag),{type:"comment"})),e.state=14):t.slice(n,n+7).toUpperCase()==="DOCTYPE"?(e.charIdx+=6,e.currentTag=new w0(El.__assign(El.__assign({},e.currentTag),{type:"doctype"})),e.state=20):bh(e)}function aIt(e,t){t==="-"?e.state=15:t===">"?bh(e):e.state=16}function cIt(e,t){t==="-"?e.state=18:t===">"?bh(e):e.state=16}function lIt(e,t){t==="-"&&(e.state=17)}function uIt(e,t){t==="-"?e.state=18:e.state=16}function fIt(e,t){t===">"?P0(e):t==="!"?e.state=19:t==="-"||(e.state=16)}function dIt(e,t){t==="-"?e.state=17:t===">"?P0(e):e.state=16}function hIt(e,t){t===">"?P0(e):t==="<"&&I0(e)}function bh(e){e.state=0,e.currentTag=dre}function I0(e){e.state=1,e.currentTag=new w0({idx:e.charIdx})}function P0(e){var t=e.html.slice(e.currentDataIdx,e.currentTag.idx);t&&e.callbacks.onText(t,e.currentDataIdx);var n=e.currentTag;n.type==="comment"?e.callbacks.onComment(n.idx):n.type==="doctype"?e.callbacks.onDoctype(n.idx):(n.isOpening&&e.callbacks.onOpenTag(n.name,n.idx),n.isClosing&&e.callbacks.onCloseTag(n.name,n.idx)),bh(e),e.currentDataIdx=e.charIdx+1}function mIt(e){var t=e.html.slice(e.currentDataIdx,e.charIdx);e.callbacks.onText(t,e.currentDataIdx),e.currentDataIdx=e.charIdx+1}function fre(e){var t=e.currentTag.idx+(e.currentTag.isClosing?2:1);return e.html.slice(t,e.charIdx).toLowerCase()}function pIt(e){e.charIdx--}});var Z9=Yi(pre=>{"use strict";Object.defineProperty(pre,"__esModule",{value:!0});var mre=(Jm(),Fh($m)),gIt=RRe(),Ka=yb(),_It=Zie(),yIt=k9(),AIt=ure(),bIt=WRe(),xIt=ire(),TIt=tre(),EIt=(function(){function e(t){t===void 0&&(t={}),this.version=e.version,this.urls={},this.email=!0,this.phone=!0,this.hashtag=!1,this.mention=!1,this.newWindow=!0,this.stripPrefix={scheme:!0,www:!0},this.stripTrailingSlash=!0,this.decodePercentEncoding=!0,this.truncate={length:0,location:"end"},this.className="",this.replaceFn=null,this.context=void 0,this.sanitizeHtml=!1,this.tagBuilder=null,this.urls=CIt(t.urls),this.email=(0,Ka.isBoolean)(t.email)?t.email:this.email,this.phone=(0,Ka.isBoolean)(t.phone)?t.phone:this.phone,this.hashtag=t.hashtag||this.hashtag,this.mention=t.mention||this.mention,this.newWindow=(0,Ka.isBoolean)(t.newWindow)?t.newWindow:this.newWindow,this.stripPrefix=vIt(t.stripPrefix),this.stripTrailingSlash=(0,Ka.isBoolean)(t.stripTrailingSlash)?t.stripTrailingSlash:this.stripTrailingSlash,this.decodePercentEncoding=(0,Ka.isBoolean)(t.decodePercentEncoding)?t.decodePercentEncoding:this.decodePercentEncoding,this.sanitizeHtml=t.sanitizeHtml||!1;var n=this.mention;if(n!==!1&&xIt.mentionServices.indexOf(n)===-1)throw new Error("invalid `mention` cfg '".concat(n,"' - see docs"));var i=this.hashtag;if(i!==!1&&TIt.hashtagServices.indexOf(i)===-1)throw new Error("invalid `hashtag` cfg '".concat(i,"' - see docs"));this.truncate=SIt(t.truncate),this.className=t.className||this.className,this.replaceFn=t.replaceFn||this.replaceFn,this.context=t.context||this}return e.link=function(t,n){var i=new e(n);return i.link(t)},e.parse=function(t,n){var i=new e(n);return i.parse(t)},e.prototype.parse=function(t){var n=this,i=["a","style","script"],r=0,o=[];return(0,bIt.parseHtml)(t,{onOpenTag:function(s){i.indexOf(s)>=0&&r++},onText:function(s,a){if(r===0){var c=/( | |<|<|>|>|"|"|')/gi,u=s.split(c),f=a;u.forEach(function(d,p){if(p%2===0){var g=n.parseText(d,f);o.push.apply(o,mre.__spreadArray([],mre.__read(g),!1))}f+=d.length})}},onCloseTag:function(s){i.indexOf(s)>=0&&(r=Math.max(r-1,0))},onComment:function(){},onDoctype:function(){}}),o=this.compactMatches(o),o=this.removeUnwantedMatches(o),o},e.prototype.compactMatches=function(t){t.sort(wIt);for(var n=0;n<t.length-1;){var i=t[n],r=i.getOffset(),o=i.getMatchedText().length;if(n+1<t.length&&t[n+1].getOffset()===r){var s=t[n+1].getMatchedText().length>o?n:n+1;t.splice(s,1);continue}n++}return t},e.prototype.removeUnwantedMatches=function(t){return this.hashtag||(0,Ka.removeWithPredicate)(t,function(n){return n.getType()==="hashtag"}),this.email||(0,Ka.removeWithPredicate)(t,function(n){return n.getType()==="email"}),this.phone||(0,Ka.removeWithPredicate)(t,function(n){return n.getType()==="phone"}),this.mention||(0,Ka.removeWithPredicate)(t,function(n){return n.getType()==="mention"}),this.urls.schemeMatches||(0,Ka.removeWithPredicate)(t,function(n){return n.getType()==="url"&&n.getUrlMatchType()==="scheme"}),this.urls.tldMatches||(0,Ka.removeWithPredicate)(t,function(n){return n.getType()==="url"&&n.getUrlMatchType()==="tld"}),this.urls.ipV4Matches||(0,Ka.removeWithPredicate)(t,function(n){return n.getType()==="url"&&n.getUrlMatchType()==="ipV4"}),t},e.prototype.parseText=function(t,n){n=n||0;for(var i=(0,AIt.parseMatches)(t,{tagBuilder:this.getTagBuilder(),stripPrefix:this.stripPrefix,stripTrailingSlash:this.stripTrailingSlash,decodePercentEncoding:this.decodePercentEncoding,hashtagServiceName:this.hashtag,mentionServiceName:this.mention||"twitter"}),r=0,o=i.length;r<o;r++)i[r].setOffset(n+i[r].getOffset());return i},e.prototype.link=function(t){if(!t)return"";this.sanitizeHtml&&(t=t.replace(/</g,"<").replace(/>/g,">"));for(var n=this.parse(t),i=new Array(n.length*2+1),r=0,o=0,s=n.length;o<s;o++){var a=n[o];i.push(t.substring(r,a.getOffset())),i.push(this.createMatchReturnVal(a)),r=a.getOffset()+a.getMatchedText().length}return i.push(t.substring(r)),i.join("")},e.prototype.createMatchReturnVal=function(t){var n;if(this.replaceFn&&(n=this.replaceFn.call(this.context,t)),typeof n=="string")return n;if(n===!1)return t.getMatchedText();if(n instanceof yIt.HtmlTag)return n.toAnchorString();var i=t.buildTag();return i.toAnchorString()},e.prototype.getTagBuilder=function(){var t=this.tagBuilder;return t||(t=this.tagBuilder=new _It.AnchorTagBuilder({newWindow:this.newWindow,truncate:this.truncate,className:this.className})),t},e.version=gIt.version,e})();pre.default=EIt;function CIt(e){return e==null&&(e=!0),(0,Ka.isBoolean)(e)?{schemeMatches:e,tldMatches:e,ipV4Matches:e}:{schemeMatches:(0,Ka.isBoolean)(e.schemeMatches)?e.schemeMatches:!0,tldMatches:(0,Ka.isBoolean)(e.tldMatches)?e.tldMatches:!0,ipV4Matches:(0,Ka.isBoolean)(e.ipV4Matches)?e.ipV4Matches:!0}}function vIt(e){return e==null&&(e=!0),(0,Ka.isBoolean)(e)?{scheme:e,www:e}:{scheme:(0,Ka.isBoolean)(e.scheme)?e.scheme:!0,www:(0,Ka.isBoolean)(e.www)?e.www:!0}}function SIt(e){return typeof e=="number"?{length:e,location:"end"}:mre.__assign({length:Number.POSITIVE_INFINITY,location:"end"},e)}function wIt(e,t){return e.getOffset()-t.getOffset()}});var YRe=Yi(qRe=>{"use strict";Object.defineProperty(qRe,"__esModule",{value:!0})});var XRe=Yi(Z_=>{"use strict";Object.defineProperty(Z_,"__esModule",{value:!0});var KE=(Jm(),Fh($m));KE.__exportStar(YRe(),Z_);KE.__exportStar(ere(),Z_);KE.__exportStar(nre(),Z_);KE.__exportStar(WE(),Z_);KE.__exportStar(rre(),Z_);KE.__exportStar(ore(),Z_);KE.__exportStar(Qie(),Z_)});var KRe=Yi(gre=>{"use strict";Object.defineProperty(gre,"__esModule",{value:!0});var IIt=(Jm(),Fh($m));IIt.__exportStar(ure(),gre)});var _re=Yi((Zm,JRe)=>{"use strict";Zm=JRe.exports=Z9().default;Object.defineProperty(Zm,"__esModule",{value:!0});Zm.Autolinker=void 0;var sP=(Jm(),Fh($m)),$Re=sP.__importDefault(Z9());Zm.Autolinker=$Re.default;Zm.default=$Re.default;sP.__exportStar(Z9(),Zm);sP.__exportStar(Zie(),Zm);sP.__exportStar(k9(),Zm);sP.__exportStar(XRe(),Zm);sP.__exportStar(KRe(),Zm)});var Sae=Yi((Bfr,F4)=>{/*! + */(function(e,t){"use strict";typeof Fj=="object"&&Fj.exports?Fj.exports=t(Lue(),Bue(),Uue()):typeof define=="function"&&define.amd?define(["./punycode","./IPv6","./SecondLevelDomains"],t):e.URI=t(e.punycode,e.IPv6,e.SecondLevelDomains,e)})(zue,function(e,t,n,i){"use strict";var r=i&&i.URI;function o(C,w){var P=arguments.length>=1,M=arguments.length>=2;if(!(this instanceof o))return P?M?new o(C,w):new o(C):new o;if(C===void 0){if(P)throw new TypeError("undefined is not a valid argument for URI");typeof location<"u"?C=location.href+"":C=""}if(C===null&&P)throw new TypeError("null is not a valid argument for URI");return this.href(C),w!==void 0?this.absoluteTo(w):this}function s(C){return/^[0-9]+$/.test(C)}o.version="1.19.11";var a=o.prototype,c=Object.prototype.hasOwnProperty;function u(C){return C.replace(/([.*+?^=!:${}()|[\]\/\\])/g,"\\$1")}function f(C){return C===void 0?"Undefined":String(Object.prototype.toString.call(C)).slice(8,-1)}function d(C){return f(C)==="Array"}function p(C,w){var P={},M,F;if(f(w)==="RegExp")P=null;else if(d(w))for(M=0,F=w.length;M<F;M++)P[w[M]]=!0;else P[w]=!0;for(M=0,F=C.length;M<F;M++){var V=P&&P[C[M]]!==void 0||!P&&w.test(C[M]);V&&(C.splice(M,1),F--,M--)}return C}function g(C,w){var P,M;if(d(w)){for(P=0,M=w.length;P<M;P++)if(!g(C,w[P]))return!1;return!0}var F=f(w);for(P=0,M=C.length;P<M;P++)if(F==="RegExp"){if(typeof C[P]=="string"&&C[P].match(w))return!0}else if(C[P]===w)return!0;return!1}function m(C,w){if(!d(C)||!d(w)||C.length!==w.length)return!1;C.sort(),w.sort();for(var P=0,M=C.length;P<M;P++)if(C[P]!==w[P])return!1;return!0}function y(C){var w=/^\/+|\/+$/g;return C.replace(w,"")}o._parts=function(){return{protocol:null,username:null,password:null,hostname:null,urn:null,port:null,path:null,query:null,fragment:null,preventInvalidHostname:o.preventInvalidHostname,duplicateQueryParameters:o.duplicateQueryParameters,escapeQuerySpace:o.escapeQuerySpace}},o.preventInvalidHostname=!1,o.duplicateQueryParameters=!1,o.escapeQuerySpace=!0,o.protocol_expression=/^[a-z][a-z0-9.+-]*$/i,o.idn_expression=/[^a-z0-9\._-]/i,o.punycode_expression=/(xn--)/i,o.ip4_expression=/^\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}$/,o.ip6_expression=/^\s*((([0-9A-Fa-f]{1,4}:){7}([0-9A-Fa-f]{1,4}|:))|(([0-9A-Fa-f]{1,4}:){6}(:[0-9A-Fa-f]{1,4}|((25[0-5]|2[0-4]\d|1\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()<>]+\)))*\))+(?:\(([^\s()<>]+|(\([^\s()<>]+\)))*\)|[^\s`!()\[\]{};:'".,<>?«»“”‘’]))/ig,o.findUri={start:/\b(?:([a-z][a-z0-9.+-]*:\/\/)|www\.)/gi,end:/[\s\r\n]|$/,trim:/[`!()\[\]{};:'".,<>?«»“”„‘’]+$/,parens:/(\([^\)]*\)|\[[^\]]*\]|\{[^}]*\}|<[^>]*>)/g},o.leading_whitespace_expression=/^[\x00-\x20\u00a0\u1680\u2000-\u200a\u2028\u2029\u202f\u205f\u3000\ufeff]+/,o.ascii_tab_whitespace=/[\u0009\u000A\u000D]+/g,o.defaultPorts={http:"80",https:"443",ftp:"21",gopher:"70",ws:"80",wss:"443"},o.hostProtocols=["http","https"],o.invalid_hostname_characters=/[^a-zA-Z0-9\.\-:_]/,o.domAttributes={a:"href",blockquote:"cite",link:"href",base:"href",script:"src",form:"action",img:"src",area:"href",iframe:"src",embed:"src",source:"src",track:"src",input:"src",audio:"src",video:"src"},o.getDomAttribute=function(C){if(!(!C||!C.nodeName)){var w=C.nodeName.toLowerCase();if(!(w==="input"&&C.type!=="image"))return o.domAttributes[w]}};function A(C){return escape(C)}function b(C){return encodeURIComponent(C).replace(/[!'()*]/g,A).replace(/\*/g,"%2A")}o.encode=b,o.decode=decodeURIComponent,o.iso8859=function(){o.encode=escape,o.decode=unescape},o.unicode=function(){o.encode=b,o.decode=decodeURIComponent},o.characters={pathname:{encode:{expression:/%(24|26|2B|2C|3B|3D|3A|40)/ig,map:{"%24":"$","%26":"&","%2B":"+","%2C":",","%3B":";","%3D":"=","%3A":":","%40":"@"}},decode:{expression:/[\/\?#]/g,map:{"/":"%2F","?":"%3F","#":"%23"}}},reserved:{encode:{expression:/%(21|23|24|26|27|28|29|2A|2B|2C|2F|3A|3B|3D|3F|40|5B|5D)/ig,map:{"%3A":":","%2F":"/","%3F":"?","%23":"#","%5B":"[","%5D":"]","%40":"@","%21":"!","%24":"$","%26":"&","%27":"'","%28":"(","%29":")","%2A":"*","%2B":"+","%2C":",","%3B":";","%3D":"="}}},urnpath:{encode:{expression:/%(21|24|27|28|29|2A|2B|2C|3B|3D|40)/ig,map:{"%21":"!","%24":"$","%27":"'","%28":"(","%29":")","%2A":"*","%2B":"+","%2C":",","%3B":";","%3D":"=","%40":"@"}},decode:{expression:/[\/\?#:]/g,map:{"/":"%2F","?":"%3F","#":"%23",":":"%3A"}}}},o.encodeQuery=function(C,w){var P=o.encode(C+"");return w===void 0&&(w=o.escapeQuerySpace),w?P.replace(/%20/g,"+"):P},o.decodeQuery=function(C,w){C+="",w===void 0&&(w=o.escapeQuerySpace);try{return o.decode(w?C.replace(/\+/g,"%20"):C)}catch{return C}};var x={encode:"encode",decode:"decode"},T,E=function(C,w){return function(P){try{return o[w](P+"").replace(o.characters[C][w].expression,function(M){return o.characters[C][w].map[M]})}catch{return P}}};for(T in x)o[T+"PathSegment"]=E("pathname",x[T]),o[T+"UrnPathSegment"]=E("urnpath",x[T]);var v=function(C,w,P){return function(M){var F;P?F=function(k){return o[w](o[P](k))}:F=o[w];for(var V=(M+"").split(C),B=0,j=V.length;B<j;B++)V[B]=F(V[B]);return V.join(C)}};o.decodePath=v("/","decodePathSegment"),o.decodeUrnPath=v(":","decodeUrnPathSegment"),o.recodePath=v("/","encodePathSegment","decode"),o.recodeUrnPath=v(":","encodeUrnPathSegment","decode"),o.encodeReserved=E("reserved","encode"),o.parse=function(C,w){var P;return w||(w={preventInvalidHostname:o.preventInvalidHostname}),C=C.replace(o.leading_whitespace_expression,""),C=C.replace(o.ascii_tab_whitespace,""),P=C.indexOf("#"),P>-1&&(w.fragment=C.substring(P+1)||null,C=C.substring(0,P)),P=C.indexOf("?"),P>-1&&(w.query=C.substring(P+1)||null,C=C.substring(0,P)),C=C.replace(/^(https?|ftp|wss?)?:+[/\\]*/i,"$1://"),C=C.replace(/^[/\\]{2,}/i,"//"),C.substring(0,2)==="//"?(w.protocol=null,C=C.substring(2),C=o.parseAuthority(C,w)):(P=C.indexOf(":"),P>-1&&(w.protocol=C.substring(0,P)||null,w.protocol&&!w.protocol.match(o.protocol_expression)?w.protocol=void 0:C.substring(P+1,P+3).replace(/\\/g,"/")==="//"?(C=C.substring(P+3),C=o.parseAuthority(C,w)):(C=C.substring(P+1),w.urn=!0))),w.path=C,w},o.parseHost=function(C,w){C||(C=""),C=C.replace(/\\/g,"/");var P=C.indexOf("/"),M,F;if(P===-1&&(P=C.length),C.charAt(0)==="[")M=C.indexOf("]"),w.hostname=C.substring(1,M)||null,w.port=C.substring(M+2,P)||null,w.port==="/"&&(w.port=null);else{var V=C.indexOf(":"),B=C.indexOf("/"),j=C.indexOf(":",V+1);j!==-1&&(B===-1||j<B)?(w.hostname=C.substring(0,P)||null,w.port=null):(F=C.substring(0,P).split(":"),w.hostname=F[0]||null,w.port=F[1]||null)}return w.hostname&&C.substring(P).charAt(0)!=="/"&&(P++,C="/"+C),w.preventInvalidHostname&&o.ensureValidHostname(w.hostname,w.protocol),w.port&&o.ensureValidPort(w.port),C.substring(P)||"/"},o.parseAuthority=function(C,w){return C=o.parseUserinfo(C,w),o.parseHost(C,w)},o.parseUserinfo=function(C,w){var P=C,M=C.indexOf("\\");M!==-1&&(C=C.replace(/\\/g,"/"));var F=C.indexOf("/"),V=C.lastIndexOf("@",F>-1?F:C.length-1),B;return V>-1&&(F===-1||V<F)?(B=C.substring(0,V).split(":"),w.username=B[0]?o.decode(B[0]):null,B.shift(),w.password=B[0]?o.decode(B.join(":")):null,C=P.substring(V+1)):(w.username=null,w.password=null),C},o.parseQuery=function(C,w){if(!C)return{};if(C=C.replace(/&+/g,"&").replace(/^\?*&*|&+$/g,""),!C)return{};for(var P={},M=C.split("&"),F=M.length,V,B,j,k=0;k<F;k++)V=M[k].split("="),B=o.decodeQuery(V.shift(),w),j=V.length?o.decodeQuery(V.join("="),w):null,B!=="__proto__"&&(c.call(P,B)?((typeof P[B]=="string"||P[B]===null)&&(P[B]=[P[B]]),P[B].push(j)):P[B]=j);return P},o.build=function(C){var w="",P=!1;return C.protocol&&(w+=C.protocol+":"),!C.urn&&(w||C.hostname)&&(w+="//",P=!0),w+=o.buildAuthority(C)||"",typeof C.path=="string"&&(C.path.charAt(0)!=="/"&&P&&(w+="/"),w+=C.path),typeof C.query=="string"&&C.query&&(w+="?"+C.query),typeof C.fragment=="string"&&C.fragment&&(w+="#"+C.fragment),w},o.buildHost=function(C){var w="";if(C.hostname)o.ip6_expression.test(C.hostname)?w+="["+C.hostname+"]":w+=C.hostname;else return"";return C.port&&(w+=":"+C.port),w},o.buildAuthority=function(C){return o.buildUserinfo(C)+o.buildHost(C)},o.buildUserinfo=function(C){var w="";return C.username&&(w+=o.encode(C.username)),C.password&&(w+=":"+o.encode(C.password)),w&&(w+="@"),w},o.buildQuery=function(C,w,P){var M="",F,V,B,j;for(V in C)if(V!=="__proto__"&&c.call(C,V))if(d(C[V]))for(F={},B=0,j=C[V].length;B<j;B++)C[V][B]!==void 0&&F[C[V][B]+""]===void 0&&(M+="&"+o.buildQueryParameter(V,C[V][B],P),w!==!0&&(F[C[V][B]+""]=!0));else C[V]!==void 0&&(M+="&"+o.buildQueryParameter(V,C[V],P));return M.substring(1)},o.buildQueryParameter=function(C,w,P){return o.encodeQuery(C,P)+(w!==null?"="+o.encodeQuery(w,P):"")},o.addQuery=function(C,w,P){if(typeof w=="object")for(var M in w)c.call(w,M)&&o.addQuery(C,M,w[M]);else if(typeof w=="string"){if(C[w]===void 0){C[w]=P;return}else typeof C[w]=="string"&&(C[w]=[C[w]]);d(P)||(P=[P]),C[w]=(C[w]||[]).concat(P)}else throw new TypeError("URI.addQuery() accepts an object, string as the name parameter")},o.setQuery=function(C,w,P){if(typeof w=="object")for(var M in w)c.call(w,M)&&o.setQuery(C,M,w[M]);else if(typeof w=="string")C[w]=P===void 0?null:P;else throw new TypeError("URI.setQuery() accepts an object, string as the name parameter")},o.removeQuery=function(C,w,P){var M,F,V;if(d(w))for(M=0,F=w.length;M<F;M++)C[w[M]]=void 0;else if(f(w)==="RegExp")for(V in C)w.test(V)&&(C[V]=void 0);else if(typeof w=="object")for(V in w)c.call(w,V)&&o.removeQuery(C,V,w[V]);else if(typeof w=="string")P!==void 0?f(P)==="RegExp"?!d(C[w])&&P.test(C[w])?C[w]=void 0:C[w]=p(C[w],P):C[w]===String(P)&&(!d(P)||P.length===1)?C[w]=void 0:d(C[w])&&(C[w]=p(C[w],P)):C[w]=void 0;else throw new TypeError("URI.removeQuery() accepts an object, string, RegExp as the first parameter")},o.hasQuery=function(C,w,P,M){switch(f(w)){case"String":break;case"RegExp":for(var F in C)if(c.call(C,F)&&w.test(F)&&(P===void 0||o.hasQuery(C,F,P)))return!0;return!1;case"Object":for(var V in w)if(c.call(w,V)&&!o.hasQuery(C,V,w[V]))return!1;return!0;default:throw new TypeError("URI.hasQuery() accepts a string, regular expression or object as the name parameter")}switch(f(P)){case"Undefined":return w in C;case"Boolean":var B=!!(d(C[w])?C[w].length:C[w]);return P===B;case"Function":return!!P(C[w],w,C);case"Array":if(!d(C[w]))return!1;var j=M?g:m;return j(C[w],P);case"RegExp":return d(C[w])?M?g(C[w],P):!1:!!(C[w]&&C[w].match(P));case"Number":P=String(P);case"String":return d(C[w])?M?g(C[w],P):!1:C[w]===P;default:throw new TypeError("URI.hasQuery() accepts undefined, boolean, string, number, RegExp, Function as the value parameter")}},o.joinPaths=function(){for(var C=[],w=[],P=0,M=0;M<arguments.length;M++){var F=new o(arguments[M]);C.push(F);for(var V=F.segment(),B=0;B<V.length;B++)typeof V[B]=="string"&&w.push(V[B]),V[B]&&P++}if(!w.length||!P)return new o("");var j=new o("").segment(w);return(C[0].path()===""||C[0].path().slice(0,1)==="/")&&j.path("/"+j.path()),j.normalize()},o.commonPath=function(C,w){var P=Math.min(C.length,w.length),M;for(M=0;M<P;M++)if(C.charAt(M)!==w.charAt(M)){M--;break}return M<1?C.charAt(0)===w.charAt(0)&&C.charAt(0)==="/"?"/":"":((C.charAt(M)!=="/"||w.charAt(M)!=="/")&&(M=C.substring(0,M).lastIndexOf("/")),C.substring(0,M+1))},o.withinString=function(C,w,P){P||(P={});var M=P.start||o.findUri.start,F=P.end||o.findUri.end,V=P.trim||o.findUri.trim,B=P.parens||o.findUri.parens,j=/[a-z0-9-]=["']?$/i;for(M.lastIndex=0;;){var k=M.exec(C);if(!k)break;var G=k.index;if(P.ignoreHtml){var q=C.slice(Math.max(G-3,0),G);if(q&&j.test(q))continue}for(var Q=G+C.slice(G).search(F),W=C.slice(G,Q),J=-1;;){var Z=B.exec(W);if(!Z)break;var ae=Z.index+Z[0].length;J=Math.max(J,ae)}if(J>-1?W=W.slice(0,J)+W.slice(J).replace(V,""):W=W.replace(V,""),!(W.length<=k[0].length)&&!(P.ignore&&P.ignore.test(W))){Q=G+W.length;var Ae=w(W,G,Q,C);if(Ae===void 0){M.lastIndex=Q;continue}Ae=String(Ae),C=C.slice(0,G)+Ae+C.slice(Q),M.lastIndex=G+Ae.length}}return M.lastIndex=0,C},o.ensureValidHostname=function(C,w){var P=!!C,M=!!w,F=!1;if(M&&(F=g(o.hostProtocols,w)),F&&!P)throw new TypeError("Hostname cannot be empty, if protocol is "+w);if(C&&C.match(o.invalid_hostname_characters)){if(!e)throw new TypeError('Hostname "'+C+'" contains characters other than [A-Z0-9.-:_] and Punycode.js is not available');if(e.toASCII(C).match(o.invalid_hostname_characters))throw new TypeError('Hostname "'+C+'" contains characters other than [A-Z0-9.-:_]')}},o.ensureValidPort=function(C){if(C){var w=Number(C);if(!(s(w)&&w>0&&w<65536))throw new TypeError('Port "'+C+'" is not a valid port')}},o.noConflict=function(C){if(C){var w={URI:this.noConflict()};return i.URITemplate&&typeof i.URITemplate.noConflict=="function"&&(w.URITemplate=i.URITemplate.noConflict()),i.IPv6&&typeof i.IPv6.noConflict=="function"&&(w.IPv6=i.IPv6.noConflict()),i.SecondLevelDomains&&typeof i.SecondLevelDomains.noConflict=="function"&&(w.SecondLevelDomains=i.SecondLevelDomains.noConflict()),w}else i.URI===this&&(i.URI=r);return this},a.build=function(C){return C===!0?this._deferred_build=!0:(C===void 0||this._deferred_build)&&(this._string=o.build(this._parts),this._deferred_build=!1),this},a.clone=function(){return new o(this)},a.valueOf=a.toString=function(){return this.build(!1)._string};function S(C){return function(w,P){return w===void 0?this._parts[C]||"":(this._parts[C]=w||null,this.build(!P),this)}}function I(C,w){return function(P,M){return P===void 0?this._parts[C]||"":(P!==null&&(P=P+"",P.charAt(0)===w&&(P=P.substring(1))),this._parts[C]=P,this.build(!M),this)}}a.protocol=S("protocol"),a.username=S("username"),a.password=S("password"),a.hostname=S("hostname"),a.port=S("port"),a.query=I("query","?"),a.fragment=I("fragment","#"),a.search=function(C,w){var P=this.query(C,w);return typeof P=="string"&&P.length?"?"+P:P},a.hash=function(C,w){var P=this.fragment(C,w);return typeof P=="string"&&P.length?"#"+P:P},a.pathname=function(C,w){if(C===void 0||C===!0){var P=this._parts.path||(this._parts.hostname?"/":"");return C?(this._parts.urn?o.decodeUrnPath:o.decodePath)(P):P}else return this._parts.urn?this._parts.path=C?o.recodeUrnPath(C):"":this._parts.path=C?o.recodePath(C):"/",this.build(!w),this},a.path=a.pathname,a.href=function(C,w){var P;if(C===void 0)return this.toString();this._string="",this._parts=o._parts();var M=C instanceof o,F=typeof C=="object"&&(C.hostname||C.path||C.pathname);if(C.nodeName){var V=o.getDomAttribute(C);C=C[V]||"",F=!1}if(!M&&F&&C.pathname!==void 0&&(C=C.toString()),typeof C=="string"||C instanceof String)this._parts=o.parse(String(C),this._parts);else if(M||F){var B=M?C._parts:C;for(P in B)P!=="query"&&c.call(this._parts,P)&&(this._parts[P]=B[P]);B.query&&this.query(B.query,!1)}else throw new TypeError("invalid input");return this.build(!w),this},a.is=function(C){var w=!1,P=!1,M=!1,F=!1,V=!1,B=!1,j=!1,k=!this._parts.urn;switch(this._parts.hostname&&(k=!1,P=o.ip4_expression.test(this._parts.hostname),M=o.ip6_expression.test(this._parts.hostname),w=P||M,F=!w,V=F&&n&&n.has(this._parts.hostname),B=F&&o.idn_expression.test(this._parts.hostname),j=F&&o.punycode_expression.test(this._parts.hostname)),C.toLowerCase()){case"relative":return k;case"absolute":return!k;case"domain":case"name":return F;case"sld":return V;case"ip":return w;case"ip4":case"ipv4":case"inet4":return P;case"ip6":case"ipv6":case"inet6":return M;case"idn":return B;case"url":return!this._parts.urn;case"urn":return!!this._parts.urn;case"punycode":return j}return null};var R=a.protocol,O=a.port,L=a.hostname;a.protocol=function(C,w){if(C&&(C=C.replace(/:(\/\/)?$/,""),!C.match(o.protocol_expression)))throw new TypeError('Protocol "'+C+`" contains characters other than [A-Z0-9.+-] or doesn't start with [A-Z]`);return R.call(this,C,w)},a.scheme=a.protocol,a.port=function(C,w){return this._parts.urn?C===void 0?"":this:(C!==void 0&&(C===0&&(C=null),C&&(C+="",C.charAt(0)===":"&&(C=C.substring(1)),o.ensureValidPort(C))),O.call(this,C,w))},a.hostname=function(C,w){if(this._parts.urn)return C===void 0?"":this;if(C!==void 0){var P={preventInvalidHostname:this._parts.preventInvalidHostname},M=o.parseHost(C,P);if(M!=="/")throw new TypeError('Hostname "'+C+'" contains characters other than [A-Z0-9.-]');C=P.hostname,this._parts.preventInvalidHostname&&o.ensureValidHostname(C,this._parts.protocol)}return L.call(this,C,w)},a.origin=function(C,w){if(this._parts.urn)return C===void 0?"":this;if(C===void 0){var P=this.protocol(),M=this.authority();return M?(P?P+"://":"")+this.authority():""}else{var F=o(C);return this.protocol(F.protocol()).authority(F.authority()).build(!w),this}},a.host=function(C,w){if(this._parts.urn)return C===void 0?"":this;if(C===void 0)return this._parts.hostname?o.buildHost(this._parts):"";var P=o.parseHost(C,this._parts);if(P!=="/")throw new TypeError('Hostname "'+C+'" contains characters other than [A-Z0-9.-]');return this.build(!w),this},a.authority=function(C,w){if(this._parts.urn)return C===void 0?"":this;if(C===void 0)return this._parts.hostname?o.buildAuthority(this._parts):"";var P=o.parseAuthority(C,this._parts);if(P!=="/")throw new TypeError('Hostname "'+C+'" contains characters other than [A-Z0-9.-]');return this.build(!w),this},a.userinfo=function(C,w){if(this._parts.urn)return C===void 0?"":this;if(C===void 0){var P=o.buildUserinfo(this._parts);return P&&P.substring(0,P.length-1)}else return C[C.length-1]!=="@"&&(C+="@"),o.parseUserinfo(C,this._parts),this.build(!w),this},a.resource=function(C,w){var P;return C===void 0?this.path()+this.search()+this.hash():(P=o.parse(C),this._parts.path=P.path,this._parts.query=P.query,this._parts.fragment=P.fragment,this.build(!w),this)},a.subdomain=function(C,w){if(this._parts.urn)return C===void 0?"":this;if(C===void 0){if(!this._parts.hostname||this.is("IP"))return"";var P=this._parts.hostname.length-this.domain().length-1;return this._parts.hostname.substring(0,P)||""}else{var M=this._parts.hostname.length-this.domain().length,F=this._parts.hostname.substring(0,M),V=new RegExp("^"+u(F));if(C&&C.charAt(C.length-1)!=="."&&(C+="."),C.indexOf(":")!==-1)throw new TypeError("Domains cannot contain colons");return C&&o.ensureValidHostname(C,this._parts.protocol),this._parts.hostname=this._parts.hostname.replace(V,C),this.build(!w),this}},a.domain=function(C,w){if(this._parts.urn)return C===void 0?"":this;if(typeof C=="boolean"&&(w=C,C=void 0),C===void 0){if(!this._parts.hostname||this.is("IP"))return"";var P=this._parts.hostname.match(/\./g);if(P&&P.length<2)return this._parts.hostname;var M=this._parts.hostname.length-this.tld(w).length-1;return M=this._parts.hostname.lastIndexOf(".",M-1)+1,this._parts.hostname.substring(M)||""}else{if(!C)throw new TypeError("cannot set domain empty");if(C.indexOf(":")!==-1)throw new TypeError("Domains cannot contain colons");if(o.ensureValidHostname(C,this._parts.protocol),!this._parts.hostname||this.is("IP"))this._parts.hostname=C;else{var F=new RegExp(u(this.domain())+"$");this._parts.hostname=this._parts.hostname.replace(F,C)}return this.build(!w),this}},a.tld=function(C,w){if(this._parts.urn)return C===void 0?"":this;if(typeof C=="boolean"&&(w=C,C=void 0),C===void 0){if(!this._parts.hostname||this.is("IP"))return"";var P=this._parts.hostname.lastIndexOf("."),M=this._parts.hostname.substring(P+1);return w!==!0&&n&&n.list[M.toLowerCase()]&&n.get(this._parts.hostname)||M}else{var F;if(C)if(C.match(/[^a-zA-Z0-9-]/))if(n&&n.is(C))F=new RegExp(u(this.tld())+"$"),this._parts.hostname=this._parts.hostname.replace(F,C);else throw new TypeError('TLD "'+C+'" contains characters other than [A-Z0-9]');else{if(!this._parts.hostname||this.is("IP"))throw new ReferenceError("cannot set TLD on non-domain host");F=new RegExp(u(this.tld())+"$"),this._parts.hostname=this._parts.hostname.replace(F,C)}else throw new TypeError("cannot set TLD empty");return this.build(!w),this}},a.directory=function(C,w){if(this._parts.urn)return C===void 0?"":this;if(C===void 0||C===!0){if(!this._parts.path&&!this._parts.hostname)return"";if(this._parts.path==="/")return"/";var P=this._parts.path.length-this.filename().length-1,M=this._parts.path.substring(0,P)||(this._parts.hostname?"/":"");return C?o.decodePath(M):M}else{var F=this._parts.path.length-this.filename().length,V=this._parts.path.substring(0,F),B=new RegExp("^"+u(V));return this.is("relative")||(C||(C="/"),C.charAt(0)!=="/"&&(C="/"+C)),C&&C.charAt(C.length-1)!=="/"&&(C+="/"),C=o.recodePath(C),this._parts.path=this._parts.path.replace(B,C),this.build(!w),this}},a.filename=function(C,w){if(this._parts.urn)return C===void 0?"":this;if(typeof C!="string"){if(!this._parts.path||this._parts.path==="/")return"";var P=this._parts.path.lastIndexOf("/"),M=this._parts.path.substring(P+1);return C?o.decodePathSegment(M):M}else{var F=!1;C.charAt(0)==="/"&&(C=C.substring(1)),C.match(/\.?\//)&&(F=!0);var V=new RegExp(u(this.filename())+"$");return C=o.recodePath(C),this._parts.path=this._parts.path.replace(V,C),F?this.normalizePath(w):this.build(!w),this}},a.suffix=function(C,w){if(this._parts.urn)return C===void 0?"":this;if(C===void 0||C===!0){if(!this._parts.path||this._parts.path==="/")return"";var P=this.filename(),M=P.lastIndexOf("."),F,V;return M===-1?"":(F=P.substring(M+1),V=/^[a-z0-9%]+$/i.test(F)?F:"",C?o.decodePathSegment(V):V)}else{C.charAt(0)==="."&&(C=C.substring(1));var B=this.suffix(),j;if(B)C?j=new RegExp(u(B)+"$"):j=new RegExp(u("."+B)+"$");else{if(!C)return this;this._parts.path+="."+o.recodePath(C)}return j&&(C=o.recodePath(C),this._parts.path=this._parts.path.replace(j,C)),this.build(!w),this}},a.segment=function(C,w,P){var M=this._parts.urn?":":"/",F=this.path(),V=F.substring(0,1)==="/",B=F.split(M);if(C!==void 0&&typeof C!="number"&&(P=w,w=C,C=void 0),C!==void 0&&typeof C!="number")throw new Error('Bad segment "'+C+'", must be 0-based integer');if(V&&B.shift(),C<0&&(C=Math.max(B.length+C,0)),w===void 0)return C===void 0?B:B[C];if(C===null||B[C]===void 0)if(d(w)){B=[];for(var j=0,k=w.length;j<k;j++)!w[j].length&&(!B.length||!B[B.length-1].length)||(B.length&&!B[B.length-1].length&&B.pop(),B.push(y(w[j])))}else(w||typeof w=="string")&&(w=y(w),B[B.length-1]===""?B[B.length-1]=w:B.push(w));else w?B[C]=y(w):B.splice(C,1);return V&&B.unshift(""),this.path(B.join(M),P)},a.segmentCoded=function(C,w,P){var M,F,V;if(typeof C!="number"&&(P=w,w=C,C=void 0),w===void 0){if(M=this.segment(C,w,P),!d(M))M=M!==void 0?o.decode(M):void 0;else for(F=0,V=M.length;F<V;F++)M[F]=o.decode(M[F]);return M}if(!d(w))w=typeof w=="string"||w instanceof String?o.encode(w):w;else for(F=0,V=w.length;F<V;F++)w[F]=o.encode(w[F]);return this.segment(C,w,P)};var _=a.query;return a.query=function(C,w){if(C===!0)return o.parseQuery(this._parts.query,this._parts.escapeQuerySpace);if(typeof C=="function"){var P=o.parseQuery(this._parts.query,this._parts.escapeQuerySpace),M=C.call(this,P);return this._parts.query=o.buildQuery(M||P,this._parts.duplicateQueryParameters,this._parts.escapeQuerySpace),this.build(!w),this}else return C!==void 0&&typeof C!="string"?(this._parts.query=o.buildQuery(C,this._parts.duplicateQueryParameters,this._parts.escapeQuerySpace),this.build(!w),this):_.call(this,C,w)},a.setQuery=function(C,w,P){var M=o.parseQuery(this._parts.query,this._parts.escapeQuerySpace);if(typeof C=="string"||C instanceof String)M[C]=w!==void 0?w:null;else if(typeof C=="object")for(var F in C)c.call(C,F)&&(M[F]=C[F]);else throw new TypeError("URI.addQuery() accepts an object, string as the name parameter");return this._parts.query=o.buildQuery(M,this._parts.duplicateQueryParameters,this._parts.escapeQuerySpace),typeof C!="string"&&(P=w),this.build(!P),this},a.addQuery=function(C,w,P){var M=o.parseQuery(this._parts.query,this._parts.escapeQuerySpace);return o.addQuery(M,C,w===void 0?null:w),this._parts.query=o.buildQuery(M,this._parts.duplicateQueryParameters,this._parts.escapeQuerySpace),typeof C!="string"&&(P=w),this.build(!P),this},a.removeQuery=function(C,w,P){var M=o.parseQuery(this._parts.query,this._parts.escapeQuerySpace);return o.removeQuery(M,C,w),this._parts.query=o.buildQuery(M,this._parts.duplicateQueryParameters,this._parts.escapeQuerySpace),typeof C!="string"&&(P=w),this.build(!P),this},a.hasQuery=function(C,w,P){var M=o.parseQuery(this._parts.query,this._parts.escapeQuerySpace);return o.hasQuery(M,C,w,P)},a.setSearch=a.setQuery,a.addSearch=a.addQuery,a.removeSearch=a.removeQuery,a.hasSearch=a.hasQuery,a.normalize=function(){return this._parts.urn?this.normalizeProtocol(!1).normalizePath(!1).normalizeQuery(!1).normalizeFragment(!1).build():this.normalizeProtocol(!1).normalizeHostname(!1).normalizePort(!1).normalizePath(!1).normalizeQuery(!1).normalizeFragment(!1).build()},a.normalizeProtocol=function(C){return typeof this._parts.protocol=="string"&&(this._parts.protocol=this._parts.protocol.toLowerCase(),this.build(!C)),this},a.normalizeHostname=function(C){return this._parts.hostname&&(this.is("IDN")&&e?this._parts.hostname=e.toASCII(this._parts.hostname):this.is("IPv6")&&t&&(this._parts.hostname=t.best(this._parts.hostname)),this._parts.hostname=this._parts.hostname.toLowerCase(),this.build(!C)),this},a.normalizePort=function(C){return typeof this._parts.protocol=="string"&&this._parts.port===o.defaultPorts[this._parts.protocol]&&(this._parts.port=null,this.build(!C)),this},a.normalizePath=function(C){var w=this._parts.path;if(!w)return this;if(this._parts.urn)return this._parts.path=o.recodeUrnPath(this._parts.path),this.build(!C),this;if(this._parts.path==="/")return this;w=o.recodePath(w);var P,M="",F,V;for(w.charAt(0)!=="/"&&(P=!0,w="/"+w),(w.slice(-3)==="/.."||w.slice(-2)==="/.")&&(w+="/"),w=w.replace(/(\/(\.\/)+)|(\/\.$)/g,"/").replace(/\/{2,}/g,"/"),P&&(M=w.substring(1).match(/^(\.\.\/)+/)||"",M&&(M=M[0]));F=w.search(/\/\.\.(\/|$)/),F!==-1;){if(F===0){w=w.substring(3);continue}V=w.substring(0,F).lastIndexOf("/"),V===-1&&(V=F),w=w.substring(0,V)+w.substring(F+3)}return P&&this.is("relative")&&(w=M+w.substring(1)),this._parts.path=w,this.build(!C),this},a.normalizePathname=a.normalizePath,a.normalizeQuery=function(C){return typeof this._parts.query=="string"&&(this._parts.query.length?this.query(o.parseQuery(this._parts.query,this._parts.escapeQuerySpace)):this._parts.query=null,this.build(!C)),this},a.normalizeFragment=function(C){return this._parts.fragment||(this._parts.fragment=null,this.build(!C)),this},a.normalizeSearch=a.normalizeQuery,a.normalizeHash=a.normalizeFragment,a.iso8859=function(){var C=o.encode,w=o.decode;o.encode=escape,o.decode=decodeURIComponent;try{this.normalize()}finally{o.encode=C,o.decode=w}return this},a.unicode=function(){var C=o.encode,w=o.decode;o.encode=b,o.decode=unescape;try{this.normalize()}finally{o.encode=C,o.decode=w}return this},a.readable=function(){var C=this.clone();C.username("").password("").normalize();var w="";if(C._parts.protocol&&(w+=C._parts.protocol+"://"),C._parts.hostname&&(C.is("punycode")&&e?(w+=e.toUnicode(C._parts.hostname),C._parts.port&&(w+=":"+C._parts.port)):w+=C.host()),C._parts.hostname&&C._parts.path&&C._parts.path.charAt(0)!=="/"&&(w+="/"),w+=C.path(!0),C._parts.query){for(var P="",M=0,F=C._parts.query.split("&"),V=F.length;M<V;M++){var B=(F[M]||"").split("=");P+="&"+o.decodeQuery(B[0],this._parts.escapeQuerySpace).replace(/&/g,"%26"),B[1]!==void 0&&(P+="="+o.decodeQuery(B[1],this._parts.escapeQuerySpace).replace(/&/g,"%26"))}w+="?"+P.substring(1)}return w+=o.decodeQuery(C.hash(),!0),w},a.absoluteTo=function(C){var w=this.clone(),P=["protocol","username","password","hostname","port"],M,F,V;if(this._parts.urn)throw new Error("URNs do not have any generally defined hierarchical components");if(C instanceof o||(C=new o(C)),w._parts.protocol||(w._parts.protocol=C._parts.protocol,this._parts.hostname))return w;for(F=0;V=P[F];F++)w._parts[V]=C._parts[V];return w._parts.path?(w._parts.path.substring(-2)===".."&&(w._parts.path+="/"),w.path().charAt(0)!=="/"&&(M=C.directory(),M=M||(C.path().indexOf("/")===0?"/":""),w._parts.path=(M?M+"/":"")+w._parts.path,w.normalizePath())):(w._parts.path=C._parts.path,w._parts.query||(w._parts.query=C._parts.query)),w.build(),w},a.relativeTo=function(C){var w=this.clone().normalize(),P,M,F,V,B;if(w._parts.urn)throw new Error("URNs do not have any generally defined hierarchical components");if(C=new o(C).normalize(),P=w._parts,M=C._parts,V=w.path(),B=C.path(),V.charAt(0)!=="/")throw new Error("URI is already relative");if(B.charAt(0)!=="/")throw new Error("Cannot calculate a URI relative to another relative URI");if(P.protocol===M.protocol&&(P.protocol=null),P.username!==M.username||P.password!==M.password||P.protocol!==null||P.username!==null||P.password!==null)return w.build();if(P.hostname===M.hostname&&P.port===M.port)P.hostname=null,P.port=null;else return w.build();if(V===B)return P.path="",w.build();if(F=o.commonPath(V,B),!F)return w.build();var j=M.path.substring(F.length).replace(/[^\/]*$/,"").replace(/.*?\//g,"../");return P.path=j+P.path.substring(F.length)||"./",w.build()},a.equals=function(C){var w=this.clone(),P=new o(C),M={},F={},V={},B,j,k;if(w.normalize(),P.normalize(),w.toString()===P.toString())return!0;if(B=w.query(),j=P.query(),w.query(""),P.query(""),w.toString()!==P.toString()||B.length!==j.length)return!1;M=o.parseQuery(B,this._parts.escapeQuerySpace),F=o.parseQuery(j,this._parts.escapeQuerySpace);for(k in M)if(c.call(M,k)){if(d(M[k])){if(!m(M[k],F[k]))return!1}else if(M[k]!==F[k])return!1;V[k]=!0}for(k in F)if(c.call(F,k)&&!V[k])return!1;return!0},a.preventInvalidHostname=function(C){return this._parts.preventInvalidHostname=!!C,this},a.duplicateQueryParameters=function(C){return this._parts.duplicateQueryParameters=!!C,this},a.escapeQuerySpace=function(C){return this._parts.escapeQuerySpace=!!C,this},o})});var P0e=Yi((kyn,I0e)=>{"use strict";I0e.exports=gWe;var AN=1e20;function gWe(e,t){t||(t={});var n=t.cutoff==null?.25:t.cutoff,i=t.radius==null?8:t.radius,r=t.channel||0,o,s,a,c,u,f,d,p,g,m,y;if(ArrayBuffer.isView(e)||Array.isArray(e)){if(!t.width||!t.height)throw Error("For raw data width and height should be provided by options");o=t.width,s=t.height,c=e,t.stride?f=t.stride:f=Math.floor(e.length/o/s)}else window.HTMLCanvasElement&&e instanceof window.HTMLCanvasElement?(p=e,d=p.getContext("2d"),o=p.width,s=p.height,g=d.getImageData(0,0,o,s),c=g.data,f=4):window.CanvasRenderingContext2D&&e instanceof window.CanvasRenderingContext2D?(p=e.canvas,d=e,o=p.width,s=p.height,g=d.getImageData(0,0,o,s),c=g.data,f=4):window.ImageData&&e instanceof window.ImageData&&(g=e,o=e.width,s=e.height,c=g.data,f=4);if(a=Math.max(o,s),window.Uint8ClampedArray&&c instanceof window.Uint8ClampedArray||window.Uint8Array&&c instanceof window.Uint8Array)for(u=c,c=Array(o*s),m=0,y=Math.floor(u.length/f);m<y;m++)c[m]=u[m*f+r]/255;else if(f!==1)throw Error("Raw data can have only 1 value per pixel");var A=Array(o*s),b=Array(o*s),x=Array(a),T=Array(a),E=Array(a+1),v=Array(a);for(m=0,y=o*s;m<y;m++){var S=c[m];A[m]=S===1?0:S===0?AN:Math.pow(Math.max(0,.5-S),2),b[m]=S===1?AN:S===0?0:Math.pow(Math.max(0,S-.5),2)}S0e(A,o,s,x,T,v,E),S0e(b,o,s,x,T,v,E);var I=window.Float32Array?new Float32Array(o*s):new Array(o*s);for(m=0,y=o*s;m<y;m++)I[m]=Math.min(Math.max(1-((A[m]-b[m])/i+n),0),1);return I}function S0e(e,t,n,i,r,o,s){for(var a=0;a<t;a++){for(var c=0;c<n;c++)i[c]=e[c*t+a];for(w0e(i,r,o,s,n),c=0;c<n;c++)e[c*t+a]=r[c]}for(c=0;c<n;c++){for(a=0;a<t;a++)i[a]=e[c*t+a];for(w0e(i,r,o,s,t),a=0;a<t;a++)e[c*t+a]=Math.sqrt(r[a])}}function w0e(e,t,n,i,r){n[0]=0,i[0]=-AN,i[1]=+AN;for(var o=1,s=0;o<r;o++){for(var a=(e[o]+o*o-(e[n[s]]+n[s]*n[s]))/(2*o-2*n[s]);a<=i[s];)s--,a=(e[o]+o*o-(e[n[s]]+n[s]*n[s]))/(2*o-2*n[s]);s++,n[s]=o,i[s]=a,i[s+1]=+AN}for(o=0,s=0;o<r;o++){for(;i[s+1]<o;)s++;t[o]=(o-n[s])*(o-n[s])+e[n[s]]}}});var D0e=Yi((Uyn,F6)=>{function _We(){var e=0,t=1,n=2,i=3,r=4,o=5,s=6,a=7,c=8,u=9,f=10,d=11,p=12,g=13,m=14,y=15,A=16,b=17,x=0,T=1,E=2,v=3,S=4;function I(_,C){return 55296<=_.charCodeAt(C)&&_.charCodeAt(C)<=56319&&56320<=_.charCodeAt(C+1)&&_.charCodeAt(C+1)<=57343}function R(_,C){C===void 0&&(C=0);var w=_.charCodeAt(C);if(55296<=w&&w<=56319&&C<_.length-1){var P=w,M=_.charCodeAt(C+1);return 56320<=M&&M<=57343?(P-55296)*1024+(M-56320)+65536:P}if(56320<=w&&w<=57343&&C>=1){var P=_.charCodeAt(C-1),M=w;return 55296<=P&&P<=56319?(P-55296)*1024+(M-56320)+65536:M}return w}function O(_,C,w){var P=[_].concat(C).concat([w]),M=P[P.length-2],F=w,V=P.lastIndexOf(m);if(V>1&&P.slice(1,V).every(function(k){return k==i})&&[i,g,b].indexOf(_)==-1)return E;var B=P.lastIndexOf(r);if(B>0&&P.slice(1,B).every(function(k){return k==r})&&[p,r].indexOf(M)==-1)return P.filter(function(k){return k==r}).length%2==1?v:S;if(M==e&&F==t)return x;if(M==n||M==e||M==t)return F==m&&C.every(function(k){return k==i})?E:T;if(F==n||F==e||F==t)return T;if(M==s&&(F==s||F==a||F==u||F==f))return x;if((M==u||M==a)&&(F==a||F==c))return x;if((M==f||M==c)&&F==c)return x;if(F==i||F==y)return x;if(F==o)return x;if(M==p)return x;var j=P.indexOf(i)!=-1?P.lastIndexOf(i)-1:P.length-2;return[g,b].indexOf(P[j])!=-1&&P.slice(j+1,-1).every(function(k){return k==i})&&F==m||M==y&&[A,b].indexOf(F)!=-1?x:C.indexOf(r)!=-1?E:M==r&&F==r?x:T}this.nextBreak=function(_,C){if(C===void 0&&(C=0),C<0)return 0;if(C>=_.length-1)return _.length;for(var w=L(R(_,C)),P=[],M=C+1;M<_.length;M++)if(!I(_,M-1)){var F=L(R(_,M));if(O(w,P,F))return M;P.push(F)}return _.length},this.splitGraphemes=function(_){for(var C=[],w=0,P;(P=this.nextBreak(_,w))<_.length;)C.push(_.slice(w,P)),w=P;return w<_.length&&C.push(_.slice(w)),C},this.iterateGraphemes=function(_){var C=0,w={next:(function(){var P,M;return(M=this.nextBreak(_,C))<_.length?(P=_.slice(C,M),C=M,{value:P,done:!1}):C<_.length?(P=_.slice(C),C=_.length,{value:P,done:!1}):{value:void 0,done:!0}}).bind(this)};return typeof Symbol<"u"&&Symbol.iterator&&(w[Symbol.iterator]=function(){return w}),w},this.countGraphemes=function(_){for(var C=0,w=0,P;(P=this.nextBreak(_,w))<_.length;)w=P,C++;return w<_.length&&C++,C};function L(_){return 1536<=_&&_<=1541||_==1757||_==1807||_==2274||_==3406||_==69821||70082<=_&&_<=70083||_==72250||72326<=_&&_<=72329||_==73030?p:_==13?e:_==10?t:0<=_&&_<=9||11<=_&&_<=12||14<=_&&_<=31||127<=_&&_<=159||_==173||_==1564||_==6158||_==8203||8206<=_&&_<=8207||_==8232||_==8233||8234<=_&&_<=8238||8288<=_&&_<=8292||_==8293||8294<=_&&_<=8303||55296<=_&&_<=57343||_==65279||65520<=_&&_<=65528||65529<=_&&_<=65531||113824<=_&&_<=113827||119155<=_&&_<=119162||_==917504||_==917505||917506<=_&&_<=917535||917632<=_&&_<=917759||918e3<=_&&_<=921599?n:768<=_&&_<=879||1155<=_&&_<=1159||1160<=_&&_<=1161||1425<=_&&_<=1469||_==1471||1473<=_&&_<=1474||1476<=_&&_<=1477||_==1479||1552<=_&&_<=1562||1611<=_&&_<=1631||_==1648||1750<=_&&_<=1756||1759<=_&&_<=1764||1767<=_&&_<=1768||1770<=_&&_<=1773||_==1809||1840<=_&&_<=1866||1958<=_&&_<=1968||2027<=_&&_<=2035||2070<=_&&_<=2073||2075<=_&&_<=2083||2085<=_&&_<=2087||2089<=_&&_<=2093||2137<=_&&_<=2139||2260<=_&&_<=2273||2275<=_&&_<=2306||_==2362||_==2364||2369<=_&&_<=2376||_==2381||2385<=_&&_<=2391||2402<=_&&_<=2403||_==2433||_==2492||_==2494||2497<=_&&_<=2500||_==2509||_==2519||2530<=_&&_<=2531||2561<=_&&_<=2562||_==2620||2625<=_&&_<=2626||2631<=_&&_<=2632||2635<=_&&_<=2637||_==2641||2672<=_&&_<=2673||_==2677||2689<=_&&_<=2690||_==2748||2753<=_&&_<=2757||2759<=_&&_<=2760||_==2765||2786<=_&&_<=2787||2810<=_&&_<=2815||_==2817||_==2876||_==2878||_==2879||2881<=_&&_<=2884||_==2893||_==2902||_==2903||2914<=_&&_<=2915||_==2946||_==3006||_==3008||_==3021||_==3031||_==3072||3134<=_&&_<=3136||3142<=_&&_<=3144||3146<=_&&_<=3149||3157<=_&&_<=3158||3170<=_&&_<=3171||_==3201||_==3260||_==3263||_==3266||_==3270||3276<=_&&_<=3277||3285<=_&&_<=3286||3298<=_&&_<=3299||3328<=_&&_<=3329||3387<=_&&_<=3388||_==3390||3393<=_&&_<=3396||_==3405||_==3415||3426<=_&&_<=3427||_==3530||_==3535||3538<=_&&_<=3540||_==3542||_==3551||_==3633||3636<=_&&_<=3642||3655<=_&&_<=3662||_==3761||3764<=_&&_<=3769||3771<=_&&_<=3772||3784<=_&&_<=3789||3864<=_&&_<=3865||_==3893||_==3895||_==3897||3953<=_&&_<=3966||3968<=_&&_<=3972||3974<=_&&_<=3975||3981<=_&&_<=3991||3993<=_&&_<=4028||_==4038||4141<=_&&_<=4144||4146<=_&&_<=4151||4153<=_&&_<=4154||4157<=_&&_<=4158||4184<=_&&_<=4185||4190<=_&&_<=4192||4209<=_&&_<=4212||_==4226||4229<=_&&_<=4230||_==4237||_==4253||4957<=_&&_<=4959||5906<=_&&_<=5908||5938<=_&&_<=5940||5970<=_&&_<=5971||6002<=_&&_<=6003||6068<=_&&_<=6069||6071<=_&&_<=6077||_==6086||6089<=_&&_<=6099||_==6109||6155<=_&&_<=6157||6277<=_&&_<=6278||_==6313||6432<=_&&_<=6434||6439<=_&&_<=6440||_==6450||6457<=_&&_<=6459||6679<=_&&_<=6680||_==6683||_==6742||6744<=_&&_<=6750||_==6752||_==6754||6757<=_&&_<=6764||6771<=_&&_<=6780||_==6783||6832<=_&&_<=6845||_==6846||6912<=_&&_<=6915||_==6964||6966<=_&&_<=6970||_==6972||_==6978||7019<=_&&_<=7027||7040<=_&&_<=7041||7074<=_&&_<=7077||7080<=_&&_<=7081||7083<=_&&_<=7085||_==7142||7144<=_&&_<=7145||_==7149||7151<=_&&_<=7153||7212<=_&&_<=7219||7222<=_&&_<=7223||7376<=_&&_<=7378||7380<=_&&_<=7392||7394<=_&&_<=7400||_==7405||_==7412||7416<=_&&_<=7417||7616<=_&&_<=7673||7675<=_&&_<=7679||_==8204||8400<=_&&_<=8412||8413<=_&&_<=8416||_==8417||8418<=_&&_<=8420||8421<=_&&_<=8432||11503<=_&&_<=11505||_==11647||11744<=_&&_<=11775||12330<=_&&_<=12333||12334<=_&&_<=12335||12441<=_&&_<=12442||_==42607||42608<=_&&_<=42610||42612<=_&&_<=42621||42654<=_&&_<=42655||42736<=_&&_<=42737||_==43010||_==43014||_==43019||43045<=_&&_<=43046||43204<=_&&_<=43205||43232<=_&&_<=43249||43302<=_&&_<=43309||43335<=_&&_<=43345||43392<=_&&_<=43394||_==43443||43446<=_&&_<=43449||_==43452||_==43493||43561<=_&&_<=43566||43569<=_&&_<=43570||43573<=_&&_<=43574||_==43587||_==43596||_==43644||_==43696||43698<=_&&_<=43700||43703<=_&&_<=43704||43710<=_&&_<=43711||_==43713||43756<=_&&_<=43757||_==43766||_==44005||_==44008||_==44013||_==64286||65024<=_&&_<=65039||65056<=_&&_<=65071||65438<=_&&_<=65439||_==66045||_==66272||66422<=_&&_<=66426||68097<=_&&_<=68099||68101<=_&&_<=68102||68108<=_&&_<=68111||68152<=_&&_<=68154||_==68159||68325<=_&&_<=68326||_==69633||69688<=_&&_<=69702||69759<=_&&_<=69761||69811<=_&&_<=69814||69817<=_&&_<=69818||69888<=_&&_<=69890||69927<=_&&_<=69931||69933<=_&&_<=69940||_==70003||70016<=_&&_<=70017||70070<=_&&_<=70078||70090<=_&&_<=70092||70191<=_&&_<=70193||_==70196||70198<=_&&_<=70199||_==70206||_==70367||70371<=_&&_<=70378||70400<=_&&_<=70401||_==70460||_==70462||_==70464||_==70487||70502<=_&&_<=70508||70512<=_&&_<=70516||70712<=_&&_<=70719||70722<=_&&_<=70724||_==70726||_==70832||70835<=_&&_<=70840||_==70842||_==70845||70847<=_&&_<=70848||70850<=_&&_<=70851||_==71087||71090<=_&&_<=71093||71100<=_&&_<=71101||71103<=_&&_<=71104||71132<=_&&_<=71133||71219<=_&&_<=71226||_==71229||71231<=_&&_<=71232||_==71339||_==71341||71344<=_&&_<=71349||_==71351||71453<=_&&_<=71455||71458<=_&&_<=71461||71463<=_&&_<=71467||72193<=_&&_<=72198||72201<=_&&_<=72202||72243<=_&&_<=72248||72251<=_&&_<=72254||_==72263||72273<=_&&_<=72278||72281<=_&&_<=72283||72330<=_&&_<=72342||72344<=_&&_<=72345||72752<=_&&_<=72758||72760<=_&&_<=72765||_==72767||72850<=_&&_<=72871||72874<=_&&_<=72880||72882<=_&&_<=72883||72885<=_&&_<=72886||73009<=_&&_<=73014||_==73018||73020<=_&&_<=73021||73023<=_&&_<=73029||_==73031||92912<=_&&_<=92916||92976<=_&&_<=92982||94095<=_&&_<=94098||113821<=_&&_<=113822||_==119141||119143<=_&&_<=119145||119150<=_&&_<=119154||119163<=_&&_<=119170||119173<=_&&_<=119179||119210<=_&&_<=119213||119362<=_&&_<=119364||121344<=_&&_<=121398||121403<=_&&_<=121452||_==121461||_==121476||121499<=_&&_<=121503||121505<=_&&_<=121519||122880<=_&&_<=122886||122888<=_&&_<=122904||122907<=_&&_<=122913||122915<=_&&_<=122916||122918<=_&&_<=122922||125136<=_&&_<=125142||125252<=_&&_<=125258||917536<=_&&_<=917631||917760<=_&&_<=917999?i:127462<=_&&_<=127487?r:_==2307||_==2363||2366<=_&&_<=2368||2377<=_&&_<=2380||2382<=_&&_<=2383||2434<=_&&_<=2435||2495<=_&&_<=2496||2503<=_&&_<=2504||2507<=_&&_<=2508||_==2563||2622<=_&&_<=2624||_==2691||2750<=_&&_<=2752||_==2761||2763<=_&&_<=2764||2818<=_&&_<=2819||_==2880||2887<=_&&_<=2888||2891<=_&&_<=2892||_==3007||3009<=_&&_<=3010||3014<=_&&_<=3016||3018<=_&&_<=3020||3073<=_&&_<=3075||3137<=_&&_<=3140||3202<=_&&_<=3203||_==3262||3264<=_&&_<=3265||3267<=_&&_<=3268||3271<=_&&_<=3272||3274<=_&&_<=3275||3330<=_&&_<=3331||3391<=_&&_<=3392||3398<=_&&_<=3400||3402<=_&&_<=3404||3458<=_&&_<=3459||3536<=_&&_<=3537||3544<=_&&_<=3550||3570<=_&&_<=3571||_==3635||_==3763||3902<=_&&_<=3903||_==3967||_==4145||4155<=_&&_<=4156||4182<=_&&_<=4183||_==4228||_==6070||6078<=_&&_<=6085||6087<=_&&_<=6088||6435<=_&&_<=6438||6441<=_&&_<=6443||6448<=_&&_<=6449||6451<=_&&_<=6456||6681<=_&&_<=6682||_==6741||_==6743||6765<=_&&_<=6770||_==6916||_==6965||_==6971||6973<=_&&_<=6977||6979<=_&&_<=6980||_==7042||_==7073||7078<=_&&_<=7079||_==7082||_==7143||7146<=_&&_<=7148||_==7150||7154<=_&&_<=7155||7204<=_&&_<=7211||7220<=_&&_<=7221||_==7393||7410<=_&&_<=7411||_==7415||43043<=_&&_<=43044||_==43047||43136<=_&&_<=43137||43188<=_&&_<=43203||43346<=_&&_<=43347||_==43395||43444<=_&&_<=43445||43450<=_&&_<=43451||43453<=_&&_<=43456||43567<=_&&_<=43568||43571<=_&&_<=43572||_==43597||_==43755||43758<=_&&_<=43759||_==43765||44003<=_&&_<=44004||44006<=_&&_<=44007||44009<=_&&_<=44010||_==44012||_==69632||_==69634||_==69762||69808<=_&&_<=69810||69815<=_&&_<=69816||_==69932||_==70018||70067<=_&&_<=70069||70079<=_&&_<=70080||70188<=_&&_<=70190||70194<=_&&_<=70195||_==70197||70368<=_&&_<=70370||70402<=_&&_<=70403||_==70463||70465<=_&&_<=70468||70471<=_&&_<=70472||70475<=_&&_<=70477||70498<=_&&_<=70499||70709<=_&&_<=70711||70720<=_&&_<=70721||_==70725||70833<=_&&_<=70834||_==70841||70843<=_&&_<=70844||_==70846||_==70849||71088<=_&&_<=71089||71096<=_&&_<=71099||_==71102||71216<=_&&_<=71218||71227<=_&&_<=71228||_==71230||_==71340||71342<=_&&_<=71343||_==71350||71456<=_&&_<=71457||_==71462||72199<=_&&_<=72200||_==72249||72279<=_&&_<=72280||_==72343||_==72751||_==72766||_==72873||_==72881||_==72884||94033<=_&&_<=94078||_==119142||_==119149?o:4352<=_&&_<=4447||43360<=_&&_<=43388?s:4448<=_&&_<=4519||55216<=_&&_<=55238?a:4520<=_&&_<=4607||55243<=_&&_<=55291?c:_==44032||_==44060||_==44088||_==44116||_==44144||_==44172||_==44200||_==44228||_==44256||_==44284||_==44312||_==44340||_==44368||_==44396||_==44424||_==44452||_==44480||_==44508||_==44536||_==44564||_==44592||_==44620||_==44648||_==44676||_==44704||_==44732||_==44760||_==44788||_==44816||_==44844||_==44872||_==44900||_==44928||_==44956||_==44984||_==45012||_==45040||_==45068||_==45096||_==45124||_==45152||_==45180||_==45208||_==45236||_==45264||_==45292||_==45320||_==45348||_==45376||_==45404||_==45432||_==45460||_==45488||_==45516||_==45544||_==45572||_==45600||_==45628||_==45656||_==45684||_==45712||_==45740||_==45768||_==45796||_==45824||_==45852||_==45880||_==45908||_==45936||_==45964||_==45992||_==46020||_==46048||_==46076||_==46104||_==46132||_==46160||_==46188||_==46216||_==46244||_==46272||_==46300||_==46328||_==46356||_==46384||_==46412||_==46440||_==46468||_==46496||_==46524||_==46552||_==46580||_==46608||_==46636||_==46664||_==46692||_==46720||_==46748||_==46776||_==46804||_==46832||_==46860||_==46888||_==46916||_==46944||_==46972||_==47e3||_==47028||_==47056||_==47084||_==47112||_==47140||_==47168||_==47196||_==47224||_==47252||_==47280||_==47308||_==47336||_==47364||_==47392||_==47420||_==47448||_==47476||_==47504||_==47532||_==47560||_==47588||_==47616||_==47644||_==47672||_==47700||_==47728||_==47756||_==47784||_==47812||_==47840||_==47868||_==47896||_==47924||_==47952||_==47980||_==48008||_==48036||_==48064||_==48092||_==48120||_==48148||_==48176||_==48204||_==48232||_==48260||_==48288||_==48316||_==48344||_==48372||_==48400||_==48428||_==48456||_==48484||_==48512||_==48540||_==48568||_==48596||_==48624||_==48652||_==48680||_==48708||_==48736||_==48764||_==48792||_==48820||_==48848||_==48876||_==48904||_==48932||_==48960||_==48988||_==49016||_==49044||_==49072||_==49100||_==49128||_==49156||_==49184||_==49212||_==49240||_==49268||_==49296||_==49324||_==49352||_==49380||_==49408||_==49436||_==49464||_==49492||_==49520||_==49548||_==49576||_==49604||_==49632||_==49660||_==49688||_==49716||_==49744||_==49772||_==49800||_==49828||_==49856||_==49884||_==49912||_==49940||_==49968||_==49996||_==50024||_==50052||_==50080||_==50108||_==50136||_==50164||_==50192||_==50220||_==50248||_==50276||_==50304||_==50332||_==50360||_==50388||_==50416||_==50444||_==50472||_==50500||_==50528||_==50556||_==50584||_==50612||_==50640||_==50668||_==50696||_==50724||_==50752||_==50780||_==50808||_==50836||_==50864||_==50892||_==50920||_==50948||_==50976||_==51004||_==51032||_==51060||_==51088||_==51116||_==51144||_==51172||_==51200||_==51228||_==51256||_==51284||_==51312||_==51340||_==51368||_==51396||_==51424||_==51452||_==51480||_==51508||_==51536||_==51564||_==51592||_==51620||_==51648||_==51676||_==51704||_==51732||_==51760||_==51788||_==51816||_==51844||_==51872||_==51900||_==51928||_==51956||_==51984||_==52012||_==52040||_==52068||_==52096||_==52124||_==52152||_==52180||_==52208||_==52236||_==52264||_==52292||_==52320||_==52348||_==52376||_==52404||_==52432||_==52460||_==52488||_==52516||_==52544||_==52572||_==52600||_==52628||_==52656||_==52684||_==52712||_==52740||_==52768||_==52796||_==52824||_==52852||_==52880||_==52908||_==52936||_==52964||_==52992||_==53020||_==53048||_==53076||_==53104||_==53132||_==53160||_==53188||_==53216||_==53244||_==53272||_==53300||_==53328||_==53356||_==53384||_==53412||_==53440||_==53468||_==53496||_==53524||_==53552||_==53580||_==53608||_==53636||_==53664||_==53692||_==53720||_==53748||_==53776||_==53804||_==53832||_==53860||_==53888||_==53916||_==53944||_==53972||_==54e3||_==54028||_==54056||_==54084||_==54112||_==54140||_==54168||_==54196||_==54224||_==54252||_==54280||_==54308||_==54336||_==54364||_==54392||_==54420||_==54448||_==54476||_==54504||_==54532||_==54560||_==54588||_==54616||_==54644||_==54672||_==54700||_==54728||_==54756||_==54784||_==54812||_==54840||_==54868||_==54896||_==54924||_==54952||_==54980||_==55008||_==55036||_==55064||_==55092||_==55120||_==55148||_==55176?u:44033<=_&&_<=44059||44061<=_&&_<=44087||44089<=_&&_<=44115||44117<=_&&_<=44143||44145<=_&&_<=44171||44173<=_&&_<=44199||44201<=_&&_<=44227||44229<=_&&_<=44255||44257<=_&&_<=44283||44285<=_&&_<=44311||44313<=_&&_<=44339||44341<=_&&_<=44367||44369<=_&&_<=44395||44397<=_&&_<=44423||44425<=_&&_<=44451||44453<=_&&_<=44479||44481<=_&&_<=44507||44509<=_&&_<=44535||44537<=_&&_<=44563||44565<=_&&_<=44591||44593<=_&&_<=44619||44621<=_&&_<=44647||44649<=_&&_<=44675||44677<=_&&_<=44703||44705<=_&&_<=44731||44733<=_&&_<=44759||44761<=_&&_<=44787||44789<=_&&_<=44815||44817<=_&&_<=44843||44845<=_&&_<=44871||44873<=_&&_<=44899||44901<=_&&_<=44927||44929<=_&&_<=44955||44957<=_&&_<=44983||44985<=_&&_<=45011||45013<=_&&_<=45039||45041<=_&&_<=45067||45069<=_&&_<=45095||45097<=_&&_<=45123||45125<=_&&_<=45151||45153<=_&&_<=45179||45181<=_&&_<=45207||45209<=_&&_<=45235||45237<=_&&_<=45263||45265<=_&&_<=45291||45293<=_&&_<=45319||45321<=_&&_<=45347||45349<=_&&_<=45375||45377<=_&&_<=45403||45405<=_&&_<=45431||45433<=_&&_<=45459||45461<=_&&_<=45487||45489<=_&&_<=45515||45517<=_&&_<=45543||45545<=_&&_<=45571||45573<=_&&_<=45599||45601<=_&&_<=45627||45629<=_&&_<=45655||45657<=_&&_<=45683||45685<=_&&_<=45711||45713<=_&&_<=45739||45741<=_&&_<=45767||45769<=_&&_<=45795||45797<=_&&_<=45823||45825<=_&&_<=45851||45853<=_&&_<=45879||45881<=_&&_<=45907||45909<=_&&_<=45935||45937<=_&&_<=45963||45965<=_&&_<=45991||45993<=_&&_<=46019||46021<=_&&_<=46047||46049<=_&&_<=46075||46077<=_&&_<=46103||46105<=_&&_<=46131||46133<=_&&_<=46159||46161<=_&&_<=46187||46189<=_&&_<=46215||46217<=_&&_<=46243||46245<=_&&_<=46271||46273<=_&&_<=46299||46301<=_&&_<=46327||46329<=_&&_<=46355||46357<=_&&_<=46383||46385<=_&&_<=46411||46413<=_&&_<=46439||46441<=_&&_<=46467||46469<=_&&_<=46495||46497<=_&&_<=46523||46525<=_&&_<=46551||46553<=_&&_<=46579||46581<=_&&_<=46607||46609<=_&&_<=46635||46637<=_&&_<=46663||46665<=_&&_<=46691||46693<=_&&_<=46719||46721<=_&&_<=46747||46749<=_&&_<=46775||46777<=_&&_<=46803||46805<=_&&_<=46831||46833<=_&&_<=46859||46861<=_&&_<=46887||46889<=_&&_<=46915||46917<=_&&_<=46943||46945<=_&&_<=46971||46973<=_&&_<=46999||47001<=_&&_<=47027||47029<=_&&_<=47055||47057<=_&&_<=47083||47085<=_&&_<=47111||47113<=_&&_<=47139||47141<=_&&_<=47167||47169<=_&&_<=47195||47197<=_&&_<=47223||47225<=_&&_<=47251||47253<=_&&_<=47279||47281<=_&&_<=47307||47309<=_&&_<=47335||47337<=_&&_<=47363||47365<=_&&_<=47391||47393<=_&&_<=47419||47421<=_&&_<=47447||47449<=_&&_<=47475||47477<=_&&_<=47503||47505<=_&&_<=47531||47533<=_&&_<=47559||47561<=_&&_<=47587||47589<=_&&_<=47615||47617<=_&&_<=47643||47645<=_&&_<=47671||47673<=_&&_<=47699||47701<=_&&_<=47727||47729<=_&&_<=47755||47757<=_&&_<=47783||47785<=_&&_<=47811||47813<=_&&_<=47839||47841<=_&&_<=47867||47869<=_&&_<=47895||47897<=_&&_<=47923||47925<=_&&_<=47951||47953<=_&&_<=47979||47981<=_&&_<=48007||48009<=_&&_<=48035||48037<=_&&_<=48063||48065<=_&&_<=48091||48093<=_&&_<=48119||48121<=_&&_<=48147||48149<=_&&_<=48175||48177<=_&&_<=48203||48205<=_&&_<=48231||48233<=_&&_<=48259||48261<=_&&_<=48287||48289<=_&&_<=48315||48317<=_&&_<=48343||48345<=_&&_<=48371||48373<=_&&_<=48399||48401<=_&&_<=48427||48429<=_&&_<=48455||48457<=_&&_<=48483||48485<=_&&_<=48511||48513<=_&&_<=48539||48541<=_&&_<=48567||48569<=_&&_<=48595||48597<=_&&_<=48623||48625<=_&&_<=48651||48653<=_&&_<=48679||48681<=_&&_<=48707||48709<=_&&_<=48735||48737<=_&&_<=48763||48765<=_&&_<=48791||48793<=_&&_<=48819||48821<=_&&_<=48847||48849<=_&&_<=48875||48877<=_&&_<=48903||48905<=_&&_<=48931||48933<=_&&_<=48959||48961<=_&&_<=48987||48989<=_&&_<=49015||49017<=_&&_<=49043||49045<=_&&_<=49071||49073<=_&&_<=49099||49101<=_&&_<=49127||49129<=_&&_<=49155||49157<=_&&_<=49183||49185<=_&&_<=49211||49213<=_&&_<=49239||49241<=_&&_<=49267||49269<=_&&_<=49295||49297<=_&&_<=49323||49325<=_&&_<=49351||49353<=_&&_<=49379||49381<=_&&_<=49407||49409<=_&&_<=49435||49437<=_&&_<=49463||49465<=_&&_<=49491||49493<=_&&_<=49519||49521<=_&&_<=49547||49549<=_&&_<=49575||49577<=_&&_<=49603||49605<=_&&_<=49631||49633<=_&&_<=49659||49661<=_&&_<=49687||49689<=_&&_<=49715||49717<=_&&_<=49743||49745<=_&&_<=49771||49773<=_&&_<=49799||49801<=_&&_<=49827||49829<=_&&_<=49855||49857<=_&&_<=49883||49885<=_&&_<=49911||49913<=_&&_<=49939||49941<=_&&_<=49967||49969<=_&&_<=49995||49997<=_&&_<=50023||50025<=_&&_<=50051||50053<=_&&_<=50079||50081<=_&&_<=50107||50109<=_&&_<=50135||50137<=_&&_<=50163||50165<=_&&_<=50191||50193<=_&&_<=50219||50221<=_&&_<=50247||50249<=_&&_<=50275||50277<=_&&_<=50303||50305<=_&&_<=50331||50333<=_&&_<=50359||50361<=_&&_<=50387||50389<=_&&_<=50415||50417<=_&&_<=50443||50445<=_&&_<=50471||50473<=_&&_<=50499||50501<=_&&_<=50527||50529<=_&&_<=50555||50557<=_&&_<=50583||50585<=_&&_<=50611||50613<=_&&_<=50639||50641<=_&&_<=50667||50669<=_&&_<=50695||50697<=_&&_<=50723||50725<=_&&_<=50751||50753<=_&&_<=50779||50781<=_&&_<=50807||50809<=_&&_<=50835||50837<=_&&_<=50863||50865<=_&&_<=50891||50893<=_&&_<=50919||50921<=_&&_<=50947||50949<=_&&_<=50975||50977<=_&&_<=51003||51005<=_&&_<=51031||51033<=_&&_<=51059||51061<=_&&_<=51087||51089<=_&&_<=51115||51117<=_&&_<=51143||51145<=_&&_<=51171||51173<=_&&_<=51199||51201<=_&&_<=51227||51229<=_&&_<=51255||51257<=_&&_<=51283||51285<=_&&_<=51311||51313<=_&&_<=51339||51341<=_&&_<=51367||51369<=_&&_<=51395||51397<=_&&_<=51423||51425<=_&&_<=51451||51453<=_&&_<=51479||51481<=_&&_<=51507||51509<=_&&_<=51535||51537<=_&&_<=51563||51565<=_&&_<=51591||51593<=_&&_<=51619||51621<=_&&_<=51647||51649<=_&&_<=51675||51677<=_&&_<=51703||51705<=_&&_<=51731||51733<=_&&_<=51759||51761<=_&&_<=51787||51789<=_&&_<=51815||51817<=_&&_<=51843||51845<=_&&_<=51871||51873<=_&&_<=51899||51901<=_&&_<=51927||51929<=_&&_<=51955||51957<=_&&_<=51983||51985<=_&&_<=52011||52013<=_&&_<=52039||52041<=_&&_<=52067||52069<=_&&_<=52095||52097<=_&&_<=52123||52125<=_&&_<=52151||52153<=_&&_<=52179||52181<=_&&_<=52207||52209<=_&&_<=52235||52237<=_&&_<=52263||52265<=_&&_<=52291||52293<=_&&_<=52319||52321<=_&&_<=52347||52349<=_&&_<=52375||52377<=_&&_<=52403||52405<=_&&_<=52431||52433<=_&&_<=52459||52461<=_&&_<=52487||52489<=_&&_<=52515||52517<=_&&_<=52543||52545<=_&&_<=52571||52573<=_&&_<=52599||52601<=_&&_<=52627||52629<=_&&_<=52655||52657<=_&&_<=52683||52685<=_&&_<=52711||52713<=_&&_<=52739||52741<=_&&_<=52767||52769<=_&&_<=52795||52797<=_&&_<=52823||52825<=_&&_<=52851||52853<=_&&_<=52879||52881<=_&&_<=52907||52909<=_&&_<=52935||52937<=_&&_<=52963||52965<=_&&_<=52991||52993<=_&&_<=53019||53021<=_&&_<=53047||53049<=_&&_<=53075||53077<=_&&_<=53103||53105<=_&&_<=53131||53133<=_&&_<=53159||53161<=_&&_<=53187||53189<=_&&_<=53215||53217<=_&&_<=53243||53245<=_&&_<=53271||53273<=_&&_<=53299||53301<=_&&_<=53327||53329<=_&&_<=53355||53357<=_&&_<=53383||53385<=_&&_<=53411||53413<=_&&_<=53439||53441<=_&&_<=53467||53469<=_&&_<=53495||53497<=_&&_<=53523||53525<=_&&_<=53551||53553<=_&&_<=53579||53581<=_&&_<=53607||53609<=_&&_<=53635||53637<=_&&_<=53663||53665<=_&&_<=53691||53693<=_&&_<=53719||53721<=_&&_<=53747||53749<=_&&_<=53775||53777<=_&&_<=53803||53805<=_&&_<=53831||53833<=_&&_<=53859||53861<=_&&_<=53887||53889<=_&&_<=53915||53917<=_&&_<=53943||53945<=_&&_<=53971||53973<=_&&_<=53999||54001<=_&&_<=54027||54029<=_&&_<=54055||54057<=_&&_<=54083||54085<=_&&_<=54111||54113<=_&&_<=54139||54141<=_&&_<=54167||54169<=_&&_<=54195||54197<=_&&_<=54223||54225<=_&&_<=54251||54253<=_&&_<=54279||54281<=_&&_<=54307||54309<=_&&_<=54335||54337<=_&&_<=54363||54365<=_&&_<=54391||54393<=_&&_<=54419||54421<=_&&_<=54447||54449<=_&&_<=54475||54477<=_&&_<=54503||54505<=_&&_<=54531||54533<=_&&_<=54559||54561<=_&&_<=54587||54589<=_&&_<=54615||54617<=_&&_<=54643||54645<=_&&_<=54671||54673<=_&&_<=54699||54701<=_&&_<=54727||54729<=_&&_<=54755||54757<=_&&_<=54783||54785<=_&&_<=54811||54813<=_&&_<=54839||54841<=_&&_<=54867||54869<=_&&_<=54895||54897<=_&&_<=54923||54925<=_&&_<=54951||54953<=_&&_<=54979||54981<=_&&_<=55007||55009<=_&&_<=55035||55037<=_&&_<=55063||55065<=_&&_<=55091||55093<=_&&_<=55119||55121<=_&&_<=55147||55149<=_&&_<=55175||55177<=_&&_<=55203?f:_==9757||_==9977||9994<=_&&_<=9997||_==127877||127938<=_&&_<=127940||_==127943||127946<=_&&_<=127948||128066<=_&&_<=128067||128070<=_&&_<=128080||_==128110||128112<=_&&_<=128120||_==128124||128129<=_&&_<=128131||128133<=_&&_<=128135||_==128170||128372<=_&&_<=128373||_==128378||_==128400||128405<=_&&_<=128406||128581<=_&&_<=128583||128587<=_&&_<=128591||_==128675||128692<=_&&_<=128694||_==128704||_==128716||129304<=_&&_<=129308||129310<=_&&_<=129311||_==129318||129328<=_&&_<=129337||129341<=_&&_<=129342||129489<=_&&_<=129501?g:127995<=_&&_<=127999?m:_==8205?y:_==9792||_==9794||9877<=_&&_<=9878||_==9992||_==10084||_==127752||_==127806||_==127859||_==127891||_==127908||_==127912||_==127979||_==127981||_==128139||128187<=_&&_<=128188||_==128295||_==128300||_==128488||_==128640||_==128658?A:128102<=_&&_<=128105?b:d}return this}typeof F6<"u"&&F6.exports&&(F6.exports=_We)});var Fie,GI,Ue,aC,lf,Bo,COe,cC,vOe,SOe,gr,Ec=hs(()=>{Fie=new Date(2107,11,31,23,59,58),GI=new Date(1980,0,1),Ue=void 0,aC=1/0,lf="undefined",Bo="function",COe="object",cC="string",vOe="number",SOe="boolean",gr=new Uint8Array});function qI(e){if(e&&typeof e!=Bo)throw new Error(oMe);return e}function S9(e){if(e&&(typeof e.addEventListener!=Bo||typeof e.aborted!=SOe))throw new Error(sMe);return e||Ue}function w9(e,t){if(e&&typeof e!=cC||t&&!(t instanceof Uint8Array))throw new Error(Uie)}function zie(e,t,n){if(!Number.isInteger(e)||e<0||e>t)throw new Error(n)}function YI(e,t,n){e!==Ue&&zie(e,t,n)}function lC(e){return typeof e==cC&&e.trim()?Number(e):e}var wOe,IOe,POe,DOe,ROe,p9,g9,_9,y9,OOe,MOe,NOe,LOe,FOe,BOe,kOe,UOe,A9,b9,x9,T9,zOe,VOe,jOe,HOe,GOe,WOe,qOe,YOe,XOe,Bie,KOe,$Oe,PV,WI,JOe,ZOe,QOe,eMe,tMe,nMe,kie,iMe,rMe,E9,C9,Tb,v9,ty,oMe,sMe,Uie,DV=hs(()=>{Ec();wOe="filenameEncoding",IOe="commentEncoding",POe="decodeText",DOe="extractPrependedData",ROe="extractAppendedData",p9="password",g9="rawPassword",_9="passThrough",y9="signal",OOe="checkPasswordOnly",MOe="checkOverlappingEntryOnly",NOe="checkOverlappingEntry",LOe="checkAmbiguity",FOe="checkLocalDirectory",BOe="checkSignature",kOe="checkCrc32",UOe="checkAuthenticationCode",A9="useWebWorkers",b9="useCompressionStream",x9="transferStreams",T9="preventClose",zOe="encryptionStrength",VOe="extendedTimestamp",jOe="ntfsTimestamp",HOe="keepOrder",GOe="level",WOe="bufferedWrite",qOe="createTempStream",YOe="dataDescriptorSignature",XOe="useUnicodeFileNames",Bie="dataDescriptor",KOe="supportZip64SplitFile",$Oe="encodeText",PV="offset",WI="usdz",JOe="unixExtraFieldType",ZOe="localExtraField",QOe="centralExtraField",eMe="strictness",tMe="filenameValidation",nMe="normalizeFilename",kie="maxAppendedDataSize",iMe="decryptCentralDirectory",rMe="signCentralDirectory",E9="filename",C9="comment",Tb="strict",v9="balanced",ty="tolerant",oMe="Invalid option (must be a function)",sMe="Invalid signal (must be an AbortSignal instance)",Uie="Invalid password (password must be a string, rawPassword must be a Uint8Array)"});function ny(){return Vie}function RV(e){return jie(e.chunkSize)}function jie(e){return e=lC(e),Number.isInteger(e)&&e>=cMe?Math.max(e,LFt):aMe}function OV(e){Object.assign(Vie,pMe(gMe(e)))}function pMe(e){let t={};for(let n of kFt){let i=e[n];i!==Ue&&(t[n]=UFt(n,i))}return t}function UFt(e,t){if(hMe.includes(e)){if(t=lC(t),e==dMe&&(!Number.isInteger(t)||t<cMe))throw new Error(lMe)}else mMe.includes(e)&&qI(t);return t}function gMe(e){e=e||{};let{CompressionStreamZlib:t,DecompressionStreamZlib:n}=e;if(t===Ue&&n===Ue)return e;let i=Object.assign({},e);return i.CompressionStreamFallback===Ue&&(i.CompressionStreamFallback=t),i.DecompressionStreamFallback===Ue&&(i.DecompressionStreamFallback=n),i}function XI(e){let t=pMe(gMe(e));Object.assign(fMe,t),Object.assign(Vie,t)}var aMe,LFt,cMe,lMe,uMe,fMe,dMe,FFt,BFt,hMe,mMe,kFt,Vie,N0=hs(()=>{Ec();DV();aMe=64*1024,LFt=64,cMe=1,lMe="Invalid maxWorkers (must be an integer greater than 0)",uMe=2;try{typeof navigator!=lf&&navigator.hardwareConcurrency&&(uMe=navigator.hardwareConcurrency)}catch{}fMe={workerURI:"./core/web-worker-wasm.js",wasmURI:"./core/streams/zlib-wasm/zlib-streams.wasm",chunkSize:aMe,maxWorkers:uMe,terminateWorkerTimeout:5e3,workerStarvationTimeout:5e3,workerStartupTimeout:5e3,useWebWorkers:!0,useCompressionStream:!0,transferStreams:!0,CompressionStream:typeof CompressionStream!=lf&&CompressionStream,DecompressionStream:typeof DecompressionStream!=lf&&DecompressionStream},dMe="maxWorkers",FFt=["baseURI","wasmURI","workerURI"],BFt=["useCompressionStream","useWebWorkers","transferStreams"],hMe=["chunkSize",dMe,"terminateWorkerTimeout","workerStarvationTimeout","workerStartupTimeout"],mMe=["createWorker","CompressionStream","DecompressionStream","CompressionStreamFallback","DecompressionStreamFallback"],kFt=[...FFt,...BFt,...hMe,...mMe],Vie={...fMe}});function Sh(e,t){let n=new Uint8Array(e.length+t.length);return n.set(e),n.set(t,e.length),n}function I9(e){return e.byteOffset||e.byteLength!=e.buffer.byteLength?new Uint8Array(e):e}function di(e){return new DataView(e.buffer,e.byteOffset,e.byteLength)}var uC=hs(()=>{});var MV,_Me,zFt,VFt,jFt,HFt,GFt,WFt,qFt,ep,NV=hs(()=>{MV=[[],[],[],[],[],[],[],[]];for(let e=0;e<256;e++){let t=e;for(let n=0;n<8;n++)t=t&1?t>>>1^3988292384:t>>>1;MV[0][e]=t}for(let e=0;e<256;e++)for(let t=1;t<8;t++){let n=MV[t-1][e];MV[t][e]=n>>>8^MV[0][n&255]}[_Me,zFt,VFt,jFt,HFt,GFt,WFt,qFt]=MV,ep=class{constructor(t){this.crc=t||-1}append(t){let n=this.crc|0,i=t.length|0,r=0;if(i>=8&&t.buffer){let o=new DataView(t.buffer,t.byteOffset,i),s=i-8;for(;r<=s;r+=8){let a=n^o.getInt32(r,!0),c=o.getInt32(r+4,!0);n=qFt[a&255]^WFt[a>>>8&255]^GFt[a>>>16&255]^HFt[a>>>24&255]^jFt[c&255]^VFt[c>>>8&255]^zFt[c>>>16&255]^_Me[c>>>24&255]}}for(;r<i;r++)n=n>>>8^_Me[(n^t[r])&255];this.crc=n}get(){return~this.crc}}});var LV,yMe=hs(()=>{NV();LV=class extends null{constructor(){let t,n=new ep;super({transform(i,r){n.append(i),r.enqueue(i)},flush(){let i=new Uint8Array(4);new DataView(i.buffer).setUint32(0,n.get()),t.value=i}}),t=this}}});function KI(e){if(typeof TextEncoder==lf){e=unescape(encodeURIComponent(e));let t=new Uint8Array(e.length);for(let n=0;n<t.length;n++)t[n]=e.charCodeAt(n);return t}else return new TextEncoder().encode(e)}var Hie=hs(()=>{Ec()});var bu,FV,AMe,Gie,Wie,Eb,bMe=hs(()=>{bu={concat(e,t){if(e.length===0||t.length===0)return e.concat(t);let n=e[e.length-1],i=bu.getPartial(n);return i===32?e.concat(t):bu._shiftRight(t,i,n|0,e.slice(0,e.length-1))},bitLength(e){let t=e.length;if(t===0)return 0;let n=e[t-1];return(t-1)*32+bu.getPartial(n)},clamp(e,t){if(e.length*32<t)return e;e=e.slice(0,Math.ceil(t/32));let n=e.length;return t=t&31,n>0&&t&&(e[n-1]=bu.partial(t,e[n-1]&2147483648>>t-1,1)),e},partial(e,t,n){return e===32?t:(n?t|0:t<<32-e)+e*1099511627776},getPartial(e){return Math.round(e/1099511627776)||32},_shiftRight(e,t,n,i){for(i===void 0&&(i=[]);t>=32;t-=32)i.push(n),n=0;if(t===0)return i.concat(e);for(let s=0;s<e.length;s++)i.push(n|e[s]>>>t),n=e[s]<<32-t;let r=e.length?e[e.length-1]:0,o=bu.getPartial(r);return i.push(bu.partial(t+o&31,t+o>32?n:i.pop(),1)),i}},FV={bytes:{fromBits(e){let n=bu.bitLength(e)/8,i=new Uint8Array(n),r;for(let o=0;o<n;o++)(o&3)===0&&(r=e[o/4]),i[o]=r>>>24,r<<=8;return i},toBits(e){let t=[],n,i=0;for(n=0;n<e.length;n++)i=i<<8|e[n],(n&3)===3&&(t.push(i),i=0);return n&3&&t.push(bu.partial(8*(n&3),i)),t}}},AMe={};AMe.sha1=class{constructor(e){let t=this;t.blockSize=512,t._init=[1732584193,4023233417,2562383102,271733878,3285377520],t._key=[1518500249,1859775393,2400959708,3395469782],e?(t._h=e._h.slice(0),t._buffer=e._buffer.slice(0),t._length=e._length):t.reset()}reset(){let e=this;return e._h=e._init.slice(0),e._buffer=[],e._length=0,e}update(e){let t=this;typeof e=="string"&&(e=FV.utf8String.toBits(e));let n=t._buffer=bu.concat(t._buffer,e),i=t._length,r=t._length=i+bu.bitLength(e);if(r>9007199254740991)throw new Error("Cannot hash more than 2^53 - 1 bits");let o=new Uint32Array(n),s=0;for(let a=t.blockSize+i-(t.blockSize+i&t.blockSize-1);a<=r;a+=t.blockSize)t._block(o.subarray(16*s,16*(s+1))),s+=1;return n.splice(0,16*s),t}finalize(){let e=this,t=e._buffer,n=e._h;t=bu.concat(t,[bu.partial(1,1)]);for(let i=t.length+2;i&15;i++)t.push(0);for(t.push(Math.floor(e._length/4294967296)),t.push(e._length|0);t.length;)e._block(t.splice(0,16));return e.reset(),n}_f(e,t,n,i){if(e<=19)return t&n|~t&i;if(e<=39)return t^n^i;if(e<=59)return t&n|t&i|n&i;if(e<=79)return t^n^i}_S(e,t){return t<<e|t>>>32-e}_block(e){let t=this,n=t._h,i=Array(80);for(let u=0;u<16;u++)i[u]=e[u];let r=n[0],o=n[1],s=n[2],a=n[3],c=n[4];for(let u=0;u<=79;u++){u>=16&&(i[u]=t._S(1,i[u-3]^i[u-8]^i[u-14]^i[u-16]));let f=t._S(5,r)+t._f(u,o,s,a)+c+i[u]+t._key[Math.floor(u/20)]|0;c=a,a=s,s=t._S(30,o),o=r,r=f}n[0]=n[0]+r|0,n[1]=n[1]+o|0,n[2]=n[2]+s|0,n[3]=n[3]+a|0,n[4]=n[4]+c|0}};Gie={};Gie.aes=class{constructor(e){let t=this;t._tables=[[[],[],[],[],[]],[[],[],[],[],[]]],t._tables[0][0][0]||t._precompute();let n=t._tables[0][4],i=t._tables[1],r=e.length,o,s,a,c=1;if(r!==4&&r!==6&&r!==8)throw new Error("invalid aes key size");for(t._key=[s=e.slice(0),a=[]],o=r;o<4*r+28;o++){let u=s[o-1];(o%r===0||r===8&&o%r===4)&&(u=n[u>>>24]<<24^n[u>>16&255]<<16^n[u>>8&255]<<8^n[u&255],o%r===0&&(u=u<<8^u>>>24^c<<24,c=c<<1^(c>>7)*283)),s[o]=s[o-r]^u}for(let u=0;o;u++,o--){let f=s[u&3?o:o-4];o<=4||u<4?a[u]=f:a[u]=i[0][n[f>>>24]]^i[1][n[f>>16&255]]^i[2][n[f>>8&255]]^i[3][n[f&255]]}}encrypt(e){return this._crypt(e,0)}decrypt(e){return this._crypt(e,1)}_precompute(){let e=this._tables[0],t=this._tables[1],n=e[4],i=t[4],r=[],o=[],s,a,c,u;for(let f=0;f<256;f++)o[(r[f]=f<<1^(f>>7)*283)^f]=f;for(let f=s=0;!n[f];f^=a||1,s=o[s]||1){let d=s^s<<1^s<<2^s<<3^s<<4;d=d>>8^d&255^99,n[f]=d,i[d]=f,u=r[c=r[a=r[f]]];let p=u*16843009^c*65537^a*257^f*16843008,g=r[d]*257^d*16843008;for(let m=0;m<4;m++)e[m][f]=g=g<<24^g>>>8,t[m][d]=p=p<<24^p>>>8}for(let f=0;f<5;f++)e[f]=e[f].slice(0),t[f]=t[f].slice(0)}_crypt(e,t){if(e.length!==4)throw new Error("invalid aes block size");let n=this._key[t],i=n.length/4-2,r=[0,0,0,0],o=this._tables[t],s=o[0],a=o[1],c=o[2],u=o[3],f=o[4],d=e[0]^n[0],p=e[t?3:1]^n[1],g=e[2]^n[2],m=e[t?1:3]^n[3],y=4,A,b,x;for(let T=0;T<i;T++)A=s[d>>>24]^a[p>>16&255]^c[g>>8&255]^u[m&255]^n[y],b=s[p>>>24]^a[g>>16&255]^c[m>>8&255]^u[d&255]^n[y+1],x=s[g>>>24]^a[m>>16&255]^c[d>>8&255]^u[p&255]^n[y+2],m=s[m>>>24]^a[d>>16&255]^c[p>>8&255]^u[g&255]^n[y+3],y+=4,d=A,p=b,g=x;for(let T=0;T<4;T++)r[t?3&-T:T]=f[d>>>24]<<24^f[p>>16&255]<<16^f[g>>8&255]<<8^f[m&255]^n[y++],A=d,d=p,p=g,g=m,m=A;return r}};Wie={};Wie.ctrGladman=class{constructor(e,t){this._prf=e,this._initIv=t,this._iv=t}reset(){this._iv=this._initIv}update(e){return this.calculate(this._prf,e,this._iv)}incWord(e){if((e>>24&255)===255){let t=e>>16&255,n=e>>8&255,i=e&255;t===255?(t=0,n===255?(n=0,i===255?i=0:++i):++n):++t,e=0,e+=t<<16,e+=n<<8,e+=i}else e+=1<<24;return e}incCounter(e){(e[0]=this.incWord(e[0]))===0&&(e[1]=this.incWord(e[1]))}calculate(e,t,n){let i;if(!(i=t.length))return[];let r=bu.bitLength(t);for(let o=0;o<i;o+=4){this.incCounter(n);let s=e.encrypt(n);t[o]^=s[0],t[o+1]^=s[1],t[o+2]^=s[2],t[o+3]^=s[3]}return bu.clamp(t,r)}};Eb={importKey(e){return new Eb.hmacSha1(FV.bytes.toBits(e))},pbkdf2(e,t,n,i){if(n=n||1e4,i<0||n<0)throw new Error("invalid params to pbkdf2");let r=(i>>5)+1<<2,o,s,a,c,u,f=new ArrayBuffer(r),d=new DataView(f),p=0,g=bu;for(t=FV.bytes.toBits(t),u=1;p<(r||1);u++){for(o=s=e.encrypt(g.concat(t,[u])),a=1;a<n;a++)for(s=e.encrypt(s),c=0;c<s.length;c++)o[c]^=s[c];for(a=0;p<(r||1)&&a<o.length;a++)d.setInt32(p,o[a]),p+=4}return f.slice(0,i/8)}};Eb.hmacSha1=class{constructor(e){let t=this,n=t._hash=AMe.sha1,i=[[],[]];t._baseHash=[new n,new n];let r=t._baseHash[0].blockSize/32;e.length>r&&(e=new n().update(e).finalize());for(let o=0;o<r;o++)i[0][o]=e[o]^909522486,i[1][o]=e[o]^1549556828;t._baseHash[0].update(i[0]),t._baseHash[1].update(i[1]),t._resultHash=new n(t._baseHash[0])}reset(){let e=this;e._resultHash=new e._hash(e._baseHash[0]),e._updated=!1}update(e){let t=this;t._updated=!0,t._resultHash.update(e)}digest(){let e=this,t=e._resultHash.finalize(),n=new e._hash(e._baseHash[1]).update(t).finalize();return e.reset(),n}encrypt(e){if(this._updated)throw new Error("encrypt on already updated hmac called!");return this.update(e),this.digest(e)}}});function P9(e){if(YFt)return crypto.getRandomValues(e);throw new Error($I)}var YFt,L0,Cb,vb,iy,$I,D9=hs(()=>{Ec();YFt=typeof crypto!=lf&&typeof crypto.getRandomValues==Bo,L0="Invalid password",Cb="Invalid signature",vb=Cb,iy="zipjs-abort-check-password",$I="Crypto API not supported"});function vMe(e,t,n,i){Object.assign(e,{ready:new Promise(r=>e.resolveReady=r),password:aBt(t,n),strength:i-1,pendingInput:gr})}function SMe(e,t,n,i,r,o){let{ctr:s,hmac:a,pendingInput:c}=e;c.length&&(t=Sh(c,t));let u=t.length-r;n=cBt(n,i+(u-u%JI));let f;for(f=0;f<=u-JI;f+=JI){let d=zV(F0,wh(t,f,f+JI));o&&a.update(d);let p=s.update(d);o||a.update(p),n.set(UV(F0,p),f+i)}return e.pendingInput=wh(t,f),n}async function iBt(e,t,n,i){let r=await wMe(e,t,n,wh(i,0,kV[t])),o=wh(i,kV[t]);if(r[0]!=o[0]||r[1]!=o[1])throw new Error(L0)}async function rBt(e,t,n){let i=P9(new Uint8Array(kV[t])),r=await wMe(e,t,n,i);return Sh(i,r)}async function wMe(e,t,n,i){e.password=null;let r=await oBt(XFt,n,JFt,!1,ZFt),o=await sBt(Object.assign({salt:i},qie),r,8*(BV[t]*2+2)),s=new Uint8Array(o),a=zV(F0,wh(s,0,BV[t])),c=zV(F0,wh(s,BV[t],BV[t]*2)),u=wh(s,BV[t]*2);return Object.assign(e,{keys:{key:a,authentication:c,passwordVerification:u},ctr:new tBt(new eBt(a),Array.from(QFt)),hmac:new nBt(c)}),u}async function oBt(e,t,n,i,r){if(xMe)try{return await VV.importKey(e,t,n,i,r)}catch{return xMe=!1,Eb.importKey(t)}else return Eb.importKey(t)}async function sBt(e,t,n){if(TMe)try{return await VV.deriveBits(e,t,n)}catch{return TMe=!1,Eb.pbkdf2(t,e.salt,qie.iterations,n)}else return Eb.pbkdf2(t,e.salt,qie.iterations,n)}function aBt(e,t){return t===Ue?KI(e):t}function cBt(e,t){if(t&&t>e.length){let n=e;e=new Uint8Array(t),e.set(n,0)}return e}function wh(e,t,n){return e.subarray(t,n)}function UV(e,t){return e.fromBits(t)}function zV(e,t){return e.toBits(t)}var JI,XFt,EMe,KFt,$Ft,JFt,qie,ZFt,kV,BV,ry,QFt,M9,VV,CMe,F0,eBt,tBt,nBt,xMe,TMe,R9,O9,IMe=hs(()=>{Ec();Hie();uC();bMe();D9();JI=16,XFt="raw",EMe={name:"PBKDF2"},KFt={name:"HMAC"},$Ft="SHA-1",JFt=Object.assign({hash:KFt},EMe),qie=Object.assign({iterations:1e3,hash:{name:$Ft}},EMe),ZFt=["deriveBits"],kV=[8,12,16],BV=[16,24,32],ry=10,QFt=[0,0,0,0],M9=typeof crypto!=lf,VV=M9&&crypto.subtle,CMe=M9&&typeof VV!=lf,F0=FV.bytes,eBt=Gie.aes,tBt=Wie.ctrGladman,nBt=Eb.hmacSha1,xMe=M9&&CMe&&typeof VV.importKey==Bo,TMe=M9&&CMe&&typeof VV.deriveBits==Bo,R9=class extends null{constructor({password:t,rawPassword:n,encryptionStrength:i,checkPasswordOnly:r,checkAuthenticationCode:o=!0}){super({start(){vMe(this,t,n,i)},async transform(s,a){let c=this,{password:u,strength:f,resolveReady:d,ready:p}=c;u?(await iBt(c,f,u,wh(s,0,kV[f]+2)),s=wh(s,kV[f]+2),r?a.error(new Error(iy)):d()):await p;let g=new Uint8Array(s.length-ry-(s.length-ry)%JI);a.enqueue(SMe(c,s,g,0,ry,!0))},async flush(s){let{ctr:a,hmac:c,pendingInput:u,ready:f}=this;if(c&&a){await f;let d=wh(u,0,u.length-ry),p=wh(u,u.length-ry),g=gr;if(d.length){let A=zV(F0,d);c.update(A);let b=a.update(A);g=UV(F0,b)}let m=wh(UV(F0,c.digest()),0,ry),y=u.length<ry?1:0;for(let A=0;A<ry;A++)y|=m[A]^p[A];if(y&&o)throw new Error(vb);s.enqueue(g)}}})}},O9=class extends null{constructor({password:t,rawPassword:n,encryptionStrength:i}){super({start(){vMe(this,t,n,i)},async transform(r,o){let s=this,{password:a,strength:c,resolveReady:u,ready:f}=s,d=gr;a?(d=await rBt(s,c,a),u()):await f;let p=new Uint8Array(d.length+r.length-r.length%JI);p.set(d,0),o.enqueue(SMe(s,r,p,d.length,0))},async flush(r){let{ctr:o,hmac:s,pendingInput:a,ready:c}=this;if(s&&o){await c;let u=gr;if(a.length){let d=o.update(zV(F0,a));s.update(d),u=UV(F0,d)}let f=UV(F0,s.digest()).slice(0,ry);r.enqueue(Sh(u,f))}}})}}});function OMe(e,t,n,i){Object.assign(e,{password:t,rawPassword:n,passwordVerification:i}),lBt(e,t,n)}function PMe(e,t){let n=new Uint8Array(t.length);for(let i=0;i<t.length;i++)n[i]=MMe(e)^t[i],F9(e,n[i]);return n}function DMe(e,t){let n=new Uint8Array(t.length);for(let i=0;i<t.length;i++)n[i]=MMe(e)^t[i],F9(e,t[i]);return n}function lBt(e,t,n){let i=[305419896,591751049,878082192];if(Object.assign(e,{keys:i,crcKey0:new ep(i[0]),crcKey2:new ep(i[2])}),n)for(let r=0;r<n.length;r++)F9(e,n[r]);else for(let r=0;r<t.length;r++)F9(e,t.charCodeAt(r))}function F9(e,t){let[,n]=e.keys;e.crcKey0.append([t]);let i=~e.crcKey0.get();n=RMe(Math.imul(RMe(n+NMe(i)),134775813)+1),e.crcKey2.append([n>>>24]);let r=~e.crcKey2.get();e.keys=[i,n,r]}function MMe(e){let t=e.keys[2]|2;return NMe(Math.imul(t,t^1)>>>8)}function NMe(e){return e&255}function RMe(e){return e&4294967295}var ZI,N9,L9,LMe=hs(()=>{NV();D9();ZI=12,N9=class extends null{constructor({password:t,rawPassword:n,passwordVerification:i,checkPasswordOnly:r}){super({start(){OMe(this,t,n,i)},transform(o,s){let a=this;if(a.password||a.rawPassword){let c=PMe(a,o.subarray(0,ZI));if(a.password=a.rawPassword=null,(c[ZI-1]^a.passwordVerification)!=0)throw new Error(L0);o=o.subarray(ZI)}r?s.error(new Error(iy)):s.enqueue(PMe(a,o))}})}},L9=class extends null{constructor({password:t,rawPassword:n,passwordVerification:i}){super({start(){OMe(this,t,n,i)},transform(r,o){let s=this,a,c;if(s.password||s.rawPassword){s.password=s.rawPassword=null;let u=P9(new Uint8Array(ZI));u[ZI-1]=s.passwordVerification,a=new Uint8Array(r.length+u.length),a.set(DMe(s,u),0),c=ZI}else a=new Uint8Array(r.length),c=0;a.set(DMe(s,r),c),o.enqueue(a)}})}}});function tp(e){if(e instanceof ReadableStream)return e;let t=e.getReader();return new ReadableStream({async pull(n){let{value:i,done:r}=await t.read();r?n.close():n.enqueue(i)},cancel(n){return t.cancel(n)}})}function B0(e,t){e=tp(e);let n=t?{type:t}:{};if(uBt())return new Response(e).blob().then(r=>t?new Blob([r],n):r);let i=[];return e.pipeTo(new WritableStream({write(r){i.push(r)}})).then(()=>new Blob(i,n))}function uBt(){return typeof Blob.prototype.stream!=Bo||new Blob([]).stream()instanceof ReadableStream}function FMe(e){if(e instanceof WritableStream)return e;let t=e.getWriter();return new WritableStream({write(n){return t.write(n)},close(){return t.close()},abort(n){return t.abort(n)}})}var QI=hs(()=>{Ec()});function B9(e){return fBt.get(e)}function k9(e){return Yie.get(e)}function dBt(e,t){let{CompressionStream:n,DecompressionStream:i}=t;if(typeof n!=Bo&&typeof i!=Bo)throw new Error(BMe);Yie.set(e,{CompressionStream:n,DecompressionStream:i})}async function kMe(e,t){!Yie.has(e)&&t&&dBt(e,await import(t))}var BMe,fBt,Yie,dC=hs(()=>{Ec();BMe="Invalid codec module",fBt=new Map,Yie=new Map});function gBt(e,t,n){let i=new ep,r=0,o=!1,s,a,c,u=new Promise((m,y)=>{a=m,c=y});u.catch(()=>{}),n||a();let f=new null({start(m){let y=new Uint8Array(VMe);y.set(mBt),m.enqueue(y)},transform(m,y){y.enqueue(m)},async flush(m){o=!0,p();try{await u}finally{g()}let y=new Uint8Array(Xie),A=di(y);A.setUint32(0,i.get(),!0),A.setUint32(4,n,!0),m.enqueue(y)},cancel(m){c(m)}}),d=new null({transform(m,y){i.append(m),r+=m.length,r>=n?a():o&&p(),y.enqueue(m)},cancel(m){c(m)}});return e=np(e,f),e=tP(e,t),np(e,d);function p(){g(),s=setTimeout(()=>c(new Error(Sb)),pBt)}function g(){clearTimeout(s)}}function $ie(e,t){if(!e)return!1;let n=UMe.get(e);n||(n=new Map,UMe.set(e,n));let i=n.get(t);if(i===Ue){try{new e(t),i=!0}catch{i=!1}n.set(t,i)}return i}function j9(e){return $ie(e,Kie)}function Jie(e){return $ie(e,HV)}function jMe(e,t,n){t=np(t,new null({flush:n})),Object.defineProperty(e,"readable",{get(){return t}})}function HMe(e,t,n){if(!e)throw new Error(hBt);return new e(t,n)}function GMe(e,t,n,i,r){let o=t&&i?i:r||i,s=n.deflate64?zMe:Kie,a;try{a=new o(s,n)}catch(c){if(t&&r&&o!=r)a=new r(s,n);else throw c}return tP(e,a)}function np(e,t){return tp(e).pipeThrough(t)}function tP(e,t){let n=t.writable.getWriter(),i=e.getReader();return r(),t.readable;async function r(){try{for(;;){await n.ready;let o=await i.read();if(o.done){await n.close();break}await n.write(o.value)}}catch(o){await _Bt(n,o),await yBt(i,o)}}}async function _Bt(e,t){try{await e.abort(t)}catch{}}async function yBt(e,t){try{await e.cancel(t)}catch{}}function ABt(e){let t=e.getReader();return new ReadableStream({async pull(n){let i;try{i=await t.read()}catch(s){if(s&&s.message)throw s;let a=new Error(nP);throw a.cause=s,a}let{value:r,done:o}=i;o?n.close():n.enqueue(r)},cancel(n){return t.cancel(n)}})}var Sb,nP,iP,hBt,Kie,zMe,HV,VMe,Xie,mBt,pBt,U9,z9,V9,UMe,Zie=hs(()=>{NV();yMe();IMe();LMe();D9();Ec();uC();QI();dC();Sb="Invalid uncompressed size",nP="Invalid compressed data",iP=Cb,hBt="Compression method not supported",Kie="deflate-raw",zMe="deflate64-raw",HV="gzip",VMe=10,Xie=8,mBt=[31,139,8],pBt=5e3,U9=class extends null{constructor(t,{chunkSize:n,CompressionStreamFallback:i,CompressionStream:r}){super({});let{compressed:o,encrypted:s,useCompressionStream:a,zipCrypto:c,computeCrc32:u,level:f,deflate64:d,format:p,compressionMethod:g,inputSize:m}=t,y=this,A,b,x,T=super.readable,E=p&&k9(p),v=u&&o&&!d&&!E&&(!s||c)&&!!(a&&r);if((!s||c)&&u&&!v&&(A=new LV,T=np(T,A)),o)if(E)T=tP(T,HMe(E.CompressionStream,p,{level:f,chunkSize:n,compressionMethod:g,uncompressedSize:m}));else if(v)x=new z9,T=tP(T,new r(HV)),T=np(T,x);else try{T=GMe(T,a,{level:f,chunkSize:n},r,i)}catch(S){let I;try{I=new r(HV)}catch{throw S}T=tP(T,I),T=np(T,new z9)}s&&(c?T=np(T,new L9(t)):(b=new O9(t),T=np(T,b))),jMe(y,T,()=>{(!s||c)&&u&&(y.crc32=v?x.crc32:new DataView(A.value.buffer).getUint32(0))})}},z9=class extends null{constructor(){let t,n=VMe,i=new Uint8Array(0);super({transform(r,o){if(n){let u=Math.min(n,r.length);if(n-=u,r=r.subarray(u),!r.length)return}let s=i.length+r.length;if(s<=Xie){i=Sh(i,r);return}let a=s-Xie,c=Math.min(a,i.length);o.enqueue(Sh(i.subarray(0,c),r.subarray(0,a-c))),i=Sh(i.subarray(c),r.subarray(a-c))},flush(){let r=di(i);t.crc32=r.getUint32(0,!0),t.uncompressedSize=r.getUint32(4,!0)}}),t=this}};V9=class extends null{constructor(t,{chunkSize:n,DecompressionStreamFallback:i,DecompressionStream:r}){super({});let{zipCrypto:o,encrypted:s,checkCrc32:a,crc32:c,compressed:u,useCompressionStream:f,deflate64:d,format:p,compressionMethod:g,rawBitFlag:m,outputSize:y}=t,A,b,x=super.readable;if(s&&(o?x=np(x,new N9(t)):(b=new R9(t),x=np(x,b))),u){let T=p&&k9(p);if(T)x=tP(x,HMe(T.DecompressionStream,p,{chunkSize:n,compressionMethod:g,rawBitFlag:m,uncompressedSize:y}));else try{x=GMe(x,f,{chunkSize:n,deflate64:d},r,i)}catch(E){if(d||y===Ue)throw E;let v;try{v=new r(HV)}catch{throw E}x=gBt(x,v,y)}x=ABt(x)}a&&(A=new LV,x=np(x,A)),jMe(this,x,()=>{if(a){let T=new DataView(A.value.buffer);if(c!=T.getUint32(0,!1))throw new Error(iP)}})}},UMe=new Map});var bBt,WMe,qMe,YMe,Qie,XMe,KMe,rP,G9,H9,GV,W9=hs(()=>{Ec();Zie();bBt=64*1024,WMe="message",qMe="start",YMe="pull",Qie="data",XMe="ack",KMe="close",rP="deflate",G9="inflate",H9=class extends null{constructor(t,n){super({});let i=this,{codecType:r}=t,o;r.startsWith(rP)?o=U9:r.startsWith(G9)&&(o=V9),i.outputSize=0;let s=0,a=new o(t,n),c=super.readable,u=new null({transform(d,p){d&&d.length&&(s+=d.length,p.enqueue(d))},flush(){Object.assign(i,{inputSize:s})}}),f=new null({transform(d,p){if(d&&d.length&&(p.enqueue(d),i.outputSize+=d.length,t.outputSize!==Ue&&i.outputSize>t.outputSize))throw new Error(Sb)},flush(){let{crc32:d}=a;Object.assign(i,{crc32:d,inputSize:s})}});Object.defineProperty(i,"readable",{get(){return c.pipeThrough(u).pipeThrough(a).pipeThrough(f)}})}},GV=class extends null{constructor(t){let n=[],i=0;(!Number.isFinite(t)||t<1)&&(t=bBt),super({transform(s,a){for(n.push(s),i+=s.length;i>t;)a.enqueue(r())},flush(s){i&&s.enqueue(o(n,i))}});function r(){let s=new Uint8Array(t),a=0;for(;a<t;){let c=n[0],u=t-a;c.length<=u?(s.set(c,a),a+=c.length,n.shift()):(s.set(c.subarray(0,u),a),n[0]=c.subarray(u),a+=u)}return i-=t,s}function o(s,a){let c=new Uint8Array(a),u=0;for(let f of s)c.set(f,u),u+=f.length;return c}}}});function JMe({initModule:e}){Y9=e}function ZMe(e){tre=e}async function QMe(e){let{CompressionStream:t,CompressionStreamFallback:n}=e;if(n&&!n.requiresModule||j9(t)||Jie(t))return!0;if(n)try{return await Y9(e),!0}catch{return!1}return!1}function ire(e){e.createWorker?$Me=!0:q9=!1}async function ere(e,...t){try{await e(...t)}catch{}}function rre(e,t){return{run:()=>X9(e,t)}}async function X9({options:e,readable:t,writable:n,onTaskFinished:i},r){let o;try{if(e.compressed&&!e.format){let u=e.codecType.startsWith(rP),f=u?r.CompressionStreamFallback:r.DecompressionStreamFallback,d=u?r.CompressionStream:r.DecompressionStream;if(e.useCompressionStream){if(f&&f.requiresModule&&!j9(d))try{await Y9(r)}catch{}}else try{await Y9(r)}catch{(!f||f.requiresModule)&&(e.useCompressionStream=!0)}}o=new H9(e,r),await t.pipeThrough(o).pipeThrough(new GV(RV(r))).pipeTo(n,{preventClose:!0,preventAbort:!0});let{crc32:s,inputSize:a,outputSize:c}=o;return{crc32:s,inputSize:a,outputSize:c}}catch(s){throw o&&(s.outputSize=o.outputSize),s}finally{i()}}var mC,q9,$Me,tre,Y9,hC,nre,WV=hs(()=>{Ec();N0();W9();mC="Worker startup timeout",Y9=()=>{};hC=class{constructor(t,{readable:n,writable:i},{options:r,config:o,streamOptions:s,useWebWorkers:a,transferStreams:c,workerURI:u,createWorker:f},d){let{signal:p}=s;return $Me&&(f=Ue),Object.assign(t,{busy:!0,generation:(t.generation||0)+1,readable:n.pipeThrough(new GV(RV(o))).pipeThrough(new nre(s),{signal:p}),writable:i,options:Object.assign({},r),workerURI:u,createWorker:f,transferStreams:c,terminate(){return new Promise(g=>{let{worker:m,busy:y}=t;m?(y?t.resolveTerminated=g:(m.terminate(),g()),t.interface=null):g()})},onTaskFinished(){if(t.busy){let{resolveTerminated:g}=t;g&&(t.resolveTerminated=null,t.terminated=!0,t.worker.terminate(),g()),t.busy=!1,d(t)}}}),q9===Ue&&(q9=typeof Worker!=lf),(a&&tre&&(q9&&u||f)?tre:rre)(t,o)}},nre=class extends null{constructor({onstart:t,onprogress:n,size:i,onend:r}){let o=0;super({async start(){t&&await ere(t,i)},async transform(s,a){o+=s.length,n&&await ere(n,o,i),a.enqueue(s)},async flush(){r&&await ere(r,o)}})}}});async function Z9(e,t){let{options:n,config:i}=t,{transferStreams:r,useWebWorkers:o,useCompressionStream:s,compressed:a,checkCrc32:c,computeCrc32:u,encrypted:f,format:d,codecURI:p}=n,{workerURI:g,createWorker:m,maxWorkers:y}=i;d&&(p&&(n.codecURI=wBt(p,i.baseURI)),await kMe(d,n.codecURI)),t.transferStreams=!d&&(r||r===Ue&&i.transferStreams);let A=!a&&!c&&!u&&!f,b=d===Ue||!!n.codecURI;return t.useWebWorkers=!A&&b&&(o||o===Ue&&i.useWebWorkers),t.workerURI=t.useWebWorkers&&g?g:Ue,t.createWorker=t.useWebWorkers&&m?m:Ue,n.useCompressionStream=s||s===Ue&&i.useCompressionStream,(await x()).run();async function x(){let E=pC.find(v=>!v.busy);if(E)return aNe(E),new hC(E,e,t,T);if(pC.length<y){let v={indexWorker:sNe};return sNe++,pC.push(v),new hC(v,e,t,T)}else return new Promise(v=>{oP.push({resolve:v,stream:e,workerOptions:t}),$9=i.workerStarvationTimeout,J9()})}function T(E){if(cNe(),oP.length){let[{resolve:v,stream:S,workerOptions:I}]=oP.splice(0,1);v(new hC(E,S,I,T)),J9()}else E.worker?(aNe(E),DBt(E,t)):pC=pC.filter(v=>v!=E)}}function wBt(e,t){try{return new URL(e,t).toString()}catch{return e}}function J9(){!sP&&oP.length&&Number.isFinite($9)&&$9>=0&&(sP=setTimeout(IBt,$9))}function cNe(){sP&&(clearTimeout(sP),sP=null)}function IBt(){if(sP=null,oP.length){let[{resolve:e,stream:t,workerOptions:n}]=oP.splice(0,1),i=Object.assign({},n,{useWebWorkers:!1,workerURI:Ue,createWorker:Ue});e(new hC({},t,i,PBt)),J9()}}function PBt(){cNe(),J9()}function DBt(e,t){let{config:n}=t,{terminateWorkerTimeout:i}=n;Number.isFinite(i)&&i>=0&&(e.terminated?e.terminated=!1:e.terminateTimeout=setTimeout(async()=>{pC=pC.filter(r=>r!=e);try{await e.terminate()}catch{}},i))}function aNe(e){let{terminateTimeout:t}=e;t&&(clearTimeout(t),e.terminateTimeout=null)}var pC,oP,sP,$9,sNe,Q9=hs(()=>{Ec();W9();dC();WV();pC=[],oP=[],sNe=0});function uNe(e){if(RBt){let t="";for(let n=0;n<e.length;n++)t+=lNe[e[n]];return t}else return new TextDecoder().decode(e)}var lNe,RBt,fNe=hs(()=>{lNe="\0\u263A\u263B\u2665\u2666\u2663\u2660\u2022\u25D8\u25CB\u25D9\u2642\u2640\u266A\u266B\u263C\u25BA\u25C4\u2195\u203C\xB6\xA7\u25AC\u21A8\u2191\u2193\u2192\u2190\u221F\u2194\u25B2\u25BC !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~\u2302\xC7\xFC\xE9\xE2\xE4\xE0\xE5\xE7\xEA\xEB\xE8\xEF\xEE\xEC\xC4\xC5\xC9\xE6\xC6\xF4\xF6\xF2\xFB\xF9\xFF\xD6\xDC\xA2\xA3\xA5\u20A7\u0192\xE1\xED\xF3\xFA\xF1\xD1\xAA\xBA\xBF\u2310\xAC\xBD\xBC\xA1\xAB\xBB\u2591\u2592\u2593\u2502\u2524\u2561\u2562\u2556\u2555\u2563\u2551\u2557\u255D\u255C\u255B\u2510\u2514\u2534\u252C\u251C\u2500\u253C\u255E\u255F\u255A\u2554\u2569\u2566\u2560\u2550\u256C\u2567\u2568\u2564\u2565\u2559\u2558\u2552\u2553\u256B\u256A\u2518\u250C\u2588\u2584\u258C\u2590\u2580\u03B1\xDF\u0393\u03C0\u03A3\u03C3\xB5\u03C4\u03A6\u0398\u03A9\u03B4\u221E\u03C6\u03B5\u2229\u2261\xB1\u2265\u2264\u2320\u2321\xF7\u2248\xB0\u2219\xB7\u221A\u207F\xB2\u25A0\xA0".split(""),RBt=lNe.length==256});function qV(e,t){return hNe(e,t,!0)}function dNe(e,t){return hNe(e,t,!1)}function hNe(e,t,n){return t&&t.trim().toLowerCase()=="cp437"?uNe(e):new TextDecoder(t,{ignoreBOM:n}).decode(e)}var ure=hs(()=>{fNe()});function MBt(){_Ne=(async()=>{try{let t=new Blob([new Uint8Array(3)]).slice(1,2).stream().getReader(),n=0,i=await t.read();for(;!i.done;)n+=i.value.length,i=await t.read();fre=n==1}catch{fre=!1}})()}function i7(e){return!!(e&&e.getData)}async function jc(e,t){if(e.init&&!e.initialized)await e.init(t);else return Promise.resolve()}async function NBt(e){return e=new oy(e),await jc(e),(e.size===Ue||!e.readUint8Array)&&(e=new uf(await B0(e.readable)),await jc(e)),e}function Uo(e,t,n){return e.readUint8Array(t,n)}function hre(e,t){return e.createReadable?e.createReadable(t):e.readUint8Array?cP.prototype.createReadable.call(e,t):e.readable}var pNe,gNe,OBt,Inr,Pnr,dre,mNe,aP,cP,e7,YV,fre,_Ne,uf,lP,XV,KV,t7,n7,oy,uP,r7=hs(()=>{Ec();N0();uC();QI();ure();pNe="Writer iterator completed too soon",gNe="Writer not initialized",OBt="text/plain",Inr=256*1024,Pnr=16*1024*1024,dre="writable",mNe=Symbol(),aP=class{constructor(){this.size=0}init(){this.initialized=!0}},cP=class extends aP{get readable(){return this.createReadable()}createReadable({offset:t=0,size:n,chunkSize:i=RV(ny())}={}){let r=this,o=0;return i=jie(i),new ReadableStream({async pull(s){let a=n===Ue?i:Math.min(i,n-o),c=await Uo(r,t+o,a);c.length&&s.enqueue(c),o+i>=n||!c.length&&a?s.close():o+=i}})}},e7=class extends aP{constructor(){super();let t=this,n=new WritableStream({write(i){if(!t.initialized)throw new Error(gNe);return t.writeUint8Array(I9(i))}});Object.defineProperty(t,dre,{get(){return n}})}writeUint8Array(){}},YV=class extends e7{constructor(t){super(),Object.assign(this,{contentType:t,data:"data:"+(t||"")+";base64,",pendingCharacters:""})}writeUint8Array(t){let n=this,i,r=n.pendingCharacters,o=n.pendingCharacters.length;for(n.pendingCharacters="",i=0;i<Math.floor((o+t.length)/3)*3-o;i++)r+=String.fromCharCode(t[i]);for(;i<t.length;i++)n.pendingCharacters+=String.fromCharCode(t[i]);r.length>2?n.data+=btoa(r):n.pendingCharacters=r+n.pendingCharacters}getData(){return this.data+btoa(this.pendingCharacters)}};uf=class extends cP{constructor(t){super(),Object.assign(this,{sourceBlob:t,size:t.size}),_Ne||MBt()}createReadable(t){let n=this,{sourceBlob:i,size:r}=n,{offset:o=0,size:s=r-o}=t||{};return!o&&s>=r?tp(i.stream()):fre?tp(i.slice(o,o+s).stream()):super.createReadable(t)}async readUint8Array(t,n){let i=this,r=t+n,a=await(!t&&r>=i.size?i.sourceBlob:i.sourceBlob.slice(t,r)).arrayBuffer();return a.byteLength>n&&(a=a.slice(t,r)),new Uint8Array(a)}},lP=class extends aP{constructor(t){super();let n=this,i=new null;Object.defineProperty(n,dre,{get(){return i.writable}}),n.contentType=t,n.blobPromise=B0(i.readable,t),n.blobPromise.catch(()=>{})}getData(){return this.blobPromise}},XV=class extends uf{constructor(t){super(new Blob([t],{type:OBt}))}},KV=class extends lP{constructor(t){super(),Object.assign(this,{encoding:t,utf8:!t||t.toLowerCase()=="utf-8"})}async getData(){let{encoding:t,utf8:n}=this,i=await super.getData();return i.text&&n?i.text():dNe(new Uint8Array(await i.arrayBuffer()),t)}},t7=class extends cP{constructor(t){super(),this.readers=t}async init(){let t=this;t.lastDiskNumber=0;let n=t.readers=await Promise.all(t.readers.map(NBt));t.diskOffsets=n.map(i=>{let r=t.size;return t.size+=i.size,r}),super.init()}getDiskOffset(t){let{diskOffsets:n,size:i}=this,r=n[t];return r===Ue?i:r}async readUint8Array(t,n){let i=this,{readers:r}=this,o,s=0,a=t;for(;r[s]&&a>=r[s].size;)a-=r[s].size,s++;let c=r[s];if(c){let u=c.size;if(a+n<=u)o=await Uo(c,a,n);else{let f=u-a,d=await Uo(c,a,f),p=await i.readUint8Array(t+f,n-f);o=Sh(d,p)}}else o=gr;return i.lastDiskNumber=Math.max(s,i.lastDiskNumber),o}},n7=class extends aP{constructor(t,n=4294967295){super();let i=this;Object.assign(i,{diskNumber:0,diskOffset:0,size:0,maxSize:n,availableSize:n});let r,o,s,a=new WritableStream({async write(d){if(d===mNe){s&&await u();return}let{availableSize:p}=i;if(s)d.length>=p?(await c(d.subarray(0,p)),await u(),d.length>p&&await this.write(d.subarray(p))):await c(d);else{let{value:g,done:m}=await t.next();if(m&&!g)throw new Error(pNe);r=g,r.size=0,r.maxSize&&(i.maxSize=r.maxSize),i.availableSize=i.maxSize,await jc(r),o=g.writable,s=o.getWriter(),await this.write(d)}},async close(){s&&(await s.ready,await f())},async abort(d){s&&await s.abort(d)}});Object.defineProperty(i,dre,{get(){return a}});async function c(d){let p=d.length;p&&(await s.ready,await s.write(d),r.size+=p,i.availableSize-=p)}async function u(){await f(),i.diskOffset+=r.size,i.diskNumber++,s=null,i.availableSize=i.maxSize}async function f(){await s.close()}}async closeDisk(){let t=this.writable.getWriter();try{await t.ready,await t.write(mNe)}finally{t.releaseLock()}}},oy=class{constructor(t){return Array.isArray(t)&&(t=new t7(t)),(t instanceof ReadableStream||typeof t.getReader==Bo)&&(t={readable:tp(t)}),t}},uP=class{constructor(t){return t.writable===Ue&&typeof t.next==Bo&&(t=new n7(t)),(t instanceof WritableStream||typeof t.getWriter==Bo)&&(t={writable:FMe(t)}),t.size===Ue&&(t.size=0),t}}});var mre,pre,$V,gre,JV,_re,yre,Are,fP,dP,ZV,bre,QV,xre,Tre,Ere,o7,s7,Cre,vre,Sre,a7,wre,Ire,Pre,Dre,gC,Rre,LBt,Ore,c7,FBt,l7,BBt,kBt,UBt,zBt,Mre,Nre,Lre,Fre,VBt,jBt,HBt,GBt,WBt,qBt,YBt,XBt,KBt,$Bt,JBt,ZBt,QBt,e2t,t2t,n2t,wb,Bre=hs(()=>{mre="filename",pre="rawFilename",$V="comment",gre="rawComment",JV="uncompressedSize",_re="compressedSize",yre="offset",Are="diskNumberStart",fP="lastModDate",dP="rawLastModDate",ZV="lastAccessDate",bre="rawLastAccessDate",QV="creationDate",xre="rawCreationDate",Tre="internalFileAttributes",Ere="externalFileAttributes",o7="internalFileAttribute",s7="externalFileAttribute",Cre="msdosAttributesRaw",vre="msdosAttributes",Sre="msDosCompatible",a7="zip64",wre="encrypted",Ire="version",Pre="versionMadeBy",Dre="zipCrypto",gC="directory",Rre="executable",LBt="symlink",Ore="compressionMethod",c7="signature",FBt="crc32",l7="extraField",BBt="extraFieldInfoZip",kBt="extraFieldUnix",UBt="extraFieldUnixType1",zBt="extraFieldPkwareUnix",Mre="unixMode",Nre="setuid",Lre="setgid",Fre="sticky",VBt="bitFlag",jBt="rawBitFlag",HBt="filenameLength",GBt="extraFieldLength",WBt="unixExternalUpper",qBt="filenameUTF8",YBt="commentUTF8",XBt="rawExtraField",KBt="extraFieldZip64",$Bt="extraFieldUnicodePath",JBt="extraFieldUnicodeComment",ZBt="extraFieldAES",QBt="extraFieldNTFS",e2t="extraFieldExtendedTimestamp",t2t="extraFieldUSDZ",n2t=[mre,pre,JV,_re,fP,dP,$V,gre,ZV,bre,QV,xre,yre,Are,Tre,Ere,o7,s7,Cre,vre,Sre,a7,wre,Ire,Pre,Dre,gC,Rre,LBt,Ore,c7,FBt,l7,kBt,BBt,UBt,zBt,"uid","gid",Mre,WBt,Nre,Lre,Fre,VBt,jBt,HBt,GBt,qBt,YBt,XBt,KBt,$Bt,JBt,ZBt,QBt,e2t,t2t],wb=class{constructor(t){n2t.forEach(n=>this[n]=t[n])}}});var WNe={};Oq(WNe,{ERR_AMBIGUOUS_ARCHIVE:()=>foe,ERR_BAD_FORMAT:()=>hP,ERR_CENTRAL_DIRECTORY_NOT_FOUND:()=>ooe,ERR_ENCRYPTED:()=>coe,ERR_ENCRYPTED_CENTRAL_DIRECTORY:()=>doe,ERR_ENTRY_DATA_OUT_OF_BOUNDS:()=>uoe,ERR_EOCDR_LOCATOR_ZIP64_NOT_FOUND:()=>roe,ERR_EOCDR_NOT_FOUND:()=>ioe,ERR_EXTRAFIELD_ZIP64_NOT_FOUND:()=>aoe,ERR_INVALID_AUTHENTICATION_CODE:()=>vb,ERR_INVALID_COMPRESSED_DATA:()=>nP,ERR_INVALID_CRC32:()=>iP,ERR_INVALID_FILENAME_VALIDATION:()=>poe,ERR_INVALID_MAX_APPENDED_DATA_SIZE:()=>goe,ERR_INVALID_PASSWORD:()=>L0,ERR_INVALID_SIGNATURE:()=>Cb,ERR_INVALID_STRICTNESS:()=>moe,ERR_INVALID_UNCOMPRESSED_SIZE:()=>Sb,ERR_LOCAL_FILE_HEADER_NOT_FOUND:()=>soe,ERR_OVERLAPPING_ENTRY:()=>loe,ERR_SPLIT_ZIP_FILE:()=>m7,ERR_UNSAFE_FILENAME:()=>hoe,ERR_UNSUPPORTED_COMPRESSION:()=>h7,ERR_UNSUPPORTED_ENCRYPTION:()=>d7,ERR_UNSUPPORTED_UINT64:()=>_oe,ERR_WORKER_STARTUP_TIMEOUT:()=>mC,WARNING_APPENDED_DATA:()=>g7,WARNING_COMPRESSED_PATCHED_DATA:()=>boe,WARNING_DUPLICATE_FILENAME:()=>Coe,WARNING_MALFORMED_EXTRA_FIELD:()=>P7,WARNING_MISMATCHED_LOCAL_FILE_HEADER_BIT_FLAG:()=>voe,WARNING_MISMATCHED_LOCAL_FILE_HEADER_COMPRESSION_METHOD:()=>Soe,WARNING_MISMATCHED_LOCAL_FILE_HEADER_CRC32_OR_SIZES:()=>woe,WARNING_MISMATCHED_ZIP64_END_OF_CENTRAL_DIRECTORY:()=>mP,WARNING_PREPENDED_CENTRAL_DIRECTORY:()=>Toe,WARNING_PREPENDED_DATA:()=>_7,WARNING_TRAILING_CENTRAL_DIRECTORY_DATA:()=>Eoe,WARNING_UNKNOWN_VERSION:()=>Aoe,WARNING_UNKNOWN_ZIP64_EXTENSIBLE_DATA:()=>xoe,WARNING_UNSORTED_CENTRAL_DIRECTORY:()=>yoe,WARNING_WRAPPED_ENTRIES_COUNT:()=>p7,ZipReader:()=>bC,ZipReaderStream:()=>A7,isZipFile:()=>FNe});async function FNe(e,t={}){if(e=new oy(e),await jc(e),(e.size===Ue||!e.readUint8Array)&&(e=new uf(await B0(e.readable)),await jc(e)),e.size<22)return!1;let n=Poe(t,{}),i=n!=ty,r=VNe(t[kie],n),{endOfDirectoryInfo:o,endOfDirectoryReachingEndCount:s}=await jNe(e,i,r);if(!o||n==Tb&&s>1)return!1;let a=_r(di(o),20),c=o.offset+22+a;return e.size-c<=r}function kre(e){let t=Math.min(e.byteLength,1024)-3;for(let n=0;n<t;n++)if(Ri(e,n)==134630224)return!0;return!1}function SNe(e,t,n){let i=0;for(;n+46<=t.length&&Ri(e,n)==33639248;)n+=46+_r(e,n+28)+_r(e,n+30)+_r(e,n+32),i++;return i%65536?0:i}function Ure(e){if(e.length>=6){let t=di(e);if(Ri(t,0)==84233040){let n=_r(t,4);if(6+n<=e.length)return e.subarray(6,6+n)}}}function g2t(e,t,n){let i=e&&e.compressedSize?e.compressedSize:t;return i>0&&i<=n?i:n}function _2t(e){let t={rawExtensibleData:e};if(e.length>=28){let n=di(e),i=_r(n,26);Object.assign(t,{compressionMethod:_r(n,0),compressedSize:ud(n,2),uncompressedSize:ud(n,10),encryptionAlgorithm:_r(n,18),bitLength:_r(n,20),flags:_r(n,22),hashAlgorithm:_r(n,24),hashData:e.subarray(28,28+i)})}return t}function BNe(e,t,n){let i=e.rawBitFlag=_r(t,n+2),r=(i&1)==1,o=Ri(t,n+6);Object.assign(e,{encrypted:r,version:_r(t,n),bitFlag:{level:(i&6)>>1,dataDescriptor:(i&8)==8,languageEncodingFlag:(i&2048)==2048},rawLastModDate:o,lastModDate:O2t(o),filenameLength:_r(t,n+22),extraFieldLength:_r(t,n+24)})}function kNe(e,t,n,i,r){let{rawExtraField:o}=t,s=t.extraField=new Map,a=di(o),c=0,u=!1;try{for(;c<o.length;){let S=_r(a,c),I=_r(a,c+2);s.set(S,{type:S,data:o.slice(c+4,c+4+I)}),c+=4+I}}catch{u=!0}c>o.length&&(u=!0);let f=_r(n,i+4);Object.assign(t,{signature:Ri(n,i+10),crc32:Ri(n,i+10),compressedSize:Ri(n,i+14),uncompressedSize:Ri(n,i+18)});let d=s.get(1);d&&(y2t(d,t),t.extraFieldZip64=d);let p=s.get(28789);p&&(wNe(p,mre,pre,t,e),t.extraFieldUnicodePath=p);let g=s.get(25461);g&&(wNe(g,$V,gre,t,e),t.extraFieldUnicodeComment=g);let m=s.get(39169);m&&m.data.length>=7?(A2t(m,t,f),t.extraFieldAES=m):t.compressionMethod=f;let y=s.get(13);y&&(INe(y,t),t.extraFieldPkwareUnix=y);let A=s.get(22613);A&&(INe(A,t),t.extraFieldUnixType1=A);let b=s.get(10);b&&(b2t(b,t),t.extraFieldNTFS=b);let x=s.get(30805),T;if(x&&(T=PNe(x,t,!1),t.extraFieldUnix=x),!T){let S=s.get(30837);S&&(PNe(S,t,!0),t.extraFieldInfoZip=S)}let E=s.get(21589);E&&(x2t(E,t,r),t.extraFieldExtendedTimestamp=E);let v=s.get(6534);return v&&(t.extraFieldUSDZ=v),u}function y2t(e,t){t.zip64=!0;let n=di(e.data),i=d2t.filter(([o,s])=>t[o]==s),r=i.reduce((o,[,s])=>o+CNe[s].bytes,0);if(e.data.length<r)throw new Error(aoe);for(let o=0,s=0;o<i.length;o++){let[a,c]=i[o],u=CNe[c];t[a]=e[a]=u.getValue(n,s),s+=u.bytes}}function wNe(e,t,n,i,r){if(e.data.length<5){e.valid=!1;return}let o=di(e.data),s=new ep;s.append(r[n]);let a=di(new Uint8Array(4));a.setUint32(0,s.get(),!0);let c=Ri(o,1),u=Pb(o,0);Object.assign(e,{version:u,[t]:qV(e.data.subarray(5)),valid:u==1&&!r.bitFlag.languageEncodingFlag&&c==Ri(a,0)}),e.valid&&(i[t]=e[t],i[t+f2t]=!0)}function A2t(e,t,n){let i=di(e.data),r=Pb(i,4);Object.assign(e,{vendorVersion:Pb(i,0),vendorId:Pb(i,2),strength:r,originalCompressionMethod:n,compressionMethod:_r(i,5)}),t.compressionMethod=e.compressionMethod,e.vendorVersion!=LNe&&(t.crc32=Ue)}function b2t(e,t){let n=di(e.data),i=4,r;try{for(;i<e.data.length&&!r;){let o=_r(n,i),s=_r(n,i+2);o==1&&(r=e.data.slice(i+4,i+4+s)),i+=4+s}}catch{}if(r&&r.length==24){let o=di(r),s=o.getBigUint64(0,!0),a=o.getBigUint64(8,!0),c=o.getBigUint64(16,!0);Object.assign(e,{rawLastModDate:s,rawLastAccessDate:a,rawCreationDate:c});let u=zre(s),f=zre(a),d=zre(c),p={lastModDate:u,lastAccessDate:f,creationDate:d};Object.assign(e,p),Object.assign(t,p,{rawLastAccessDate:a,rawCreationDate:c})}}function INe(e,t){if(e.data.length<8)return;let n=di(e.data),i=new Date((Ri(n,0)|0)*1e3),r=new Date((Ri(n,4)|0)*1e3),o={lastAccessDate:i,lastModDate:r};e.data.length>=12&&(o.uid=_r(n,8),o.gid=_r(n,10)),Object.assign(e,o),Object.assign(t,o)}function PNe(e,t,n){try{let i=di(e.data),r,o;if(n){let s=0,a=Pb(i,s++),c=Pb(i,s++);r=DNe(e.data.subarray(s,s+c)),s+=c;let u=Pb(i,s++);o=DNe(e.data.subarray(s,s+u)),Object.assign(e,{version:a,uid:r,gid:o})}else e.data.length>=4&&(r=_r(i,0),o=_r(i,2),Object.assign(e,{uid:r,gid:o}));return r!==Ue&&(t.uid=r),o!==Ue&&(t.gid=o),r!==Ue||o!==Ue}catch{}}function DNe(e){let t=new Uint8Array(4);return t.set(e,0),new DataView(t.buffer,t.byteOffset,4).getUint32(0,!0)}function x2t(e,t,n){if(!e.data.length)return;let i=di(e.data),r=Pb(i,0),o=[],s=[];n?((r&1)==1&&(o.push(fP),s.push(dP)),(r&2)==2&&(o.push(ZV),s.push(bre)),(r&4)==4&&(o.push(QV),s.push(xre))):e.data.length>=5&&(o.push(fP),s.push(dP));let a=1;o.forEach((c,u)=>{if(e.data.length>=a+4){let f=Ri(i,a);t[c]=e[c]=new Date((f|0)*1e3);let d=s[u];e[d]=f}a+=4})}async function T2t({reader:e,fileEntry:t,index:n,offset:i,crc32:r,compressedSize:o,uncompressedSize:s,dataOffset:a,dataDescriptor:c,extraFieldZip64:u,readRanges:f}){let d=0;if(c&&(u?d=20:d=12),d){let g=await Uo(e,a+o,d+4),m=di(g),y=g.length==d+4&&Ri(m,0)==134695760;if(y){let A=RNe(m,4,u);(t.encrypted&&!t.zipCrypto||A.crc32==r)&&A.compressedSize==o&&A.uncompressedSize==s?d+=4:y=!1}if(g.length>=d){let A=RNe(m,y?4:0,u);A.signature=y,t.localDirectory.dataDescriptor=A}}let p={start:i,end:a+o+d,fileEntry:t};for(let[g,m]of f)if(g!=n&&p.start<m.end&&m.start<p.end){let y=new Error(loe);throw y.overlappingEntry=m.fileEntry,y}f.set(n,p)}function RNe(e,t,n){let i=Ri(e,t),r,o;return n?(r=ud(e,t+4),o=ud(e,t+12)):(r=Ri(e,t+4),o=Ri(e,t+8)),{crc32:i,compressedSize:r,uncompressedSize:o}}function pP(e,t){return e.getDiskOffset?e.getDiskOffset(t):0}async function E2t(e){return await UNe(e)==134695760}async function C2t(e){let t=await UNe(e);return t==134695760||t==808471376}async function UNe(e){let t=await Uo(e,0,4);return Ri(di(t))}function zNe(e){return e===Tb||e===v9||e===ty}function v2t(e,t,n){return Math.min(e,n?t*p2t:t)}function Poe(e,t){return ONe(e,ONe(t,v9))}function ONe(e,t){let n=e[eMe];if(n!==Ue){if(!zNe(n))throw new Error(moe);return n}let i=e[LOe];return i===Ue?t:i?Tb:t==ty?ty:v9}function S2t(e,t){return e===Ue?t!=ty:!!e}function w2t(e,t){return e===Ue?t==Tb:!!e}function I2t(e,t){if(e===Ue)return t;if(!zNe(e))throw new Error(poe);return e}function P2t(e,t){if(t==ty)return!1;let n=e.split("/");return n.length>1&&n[n.length-1]===""&&n.pop(),n.includes("..")||e.startsWith("/")||e.startsWith("\\\\")||u2t.test(e)?!0:t==Tb&&(n.includes(".")||n.includes(""))}function VNe(e,t){if(e!==Ue){let n=lC(e);if(typeof n!=vOe||Number.isNaN(n)||n<0)throw new Error(goe);return n}return t==Tb?0:t==ty?1/0:65535}async function jNe(e,t,n){let{size:i}=e,r=Math.min(i,65557),o={count:m2t},s,a,c=0;for await(let[u,f,d,p,g]of HNe(e,r)){let m=_r(u,p+20);if(g+22+m==i){let y=await GNe(e,u,f,p,g,i,o);if(y==y7){if(s||(s=jre(d,p,g)),c++,!t||c>1)break}else y==Ioe&&!a&&(a=jre(d,p,g))}}return s||(s=a),s||(s=await D2t(e,n,o)),{endOfDirectoryInfo:s,endOfDirectoryReachingEndCount:c}}async function D2t(e,t,n){let{size:i}=e,r=Math.min(i,t==1/0?i:65557+t),o,s;for await(let[a,c,u,f,d]of HNe(e,r)){let p=jre(u,f,d);o||(o=p);let g=await GNe(e,a,c,f,d,i,n);if(g==y7)return p;g==Ioe&&!s&&(s=p)}return s||o}async function*HNe(e,t){let n=e.size-t,i=await Uo(e,n,t),r=di(i);for(let o=i.length-22;o>=0;o--)Ri(r,o)==101010256&&(yield[r,n,i,o,n+o])}function jre(e,t,n){return{offset:n,buffer:e.slice(t,t+22).buffer}}async function GNe(e,t,n,i,r,o,s){let a=_r(t,i+10),c=Ri(t,i+12),u=Ri(t,i+16);if(a==65535||c==4294967295||u==4294967295)return await MNe(e,t,n,r-20,o,s)==117853008?y7:vNe;if(!a&&!c)return Ioe;let f=_r(t,i+6);for(let d of[r-c,pP(e,f)+u])if(await MNe(e,t,n,d,o,s)==33639248)return y7;return vNe}async function MNe(e,t,n,i,r,o){if(i<0||i+4>r)return Ue;if(i>=n)return Ri(t,i-n);if(o.count>0){o.count--;let s=await Uo(e,i,4);return Ri(di(s),0)}return Ue}function R2t(e,t,n,i,r){let{rawFilename:o}=e,s=!r,a=e.decryptedDirectory&&(t.rawBitFlag&8192)==8192;i&&!a&&(n.length!=o.length||n.some((c,u)=>c!=o[u]))&&z0(s,r,"mismatched local file header (filename)"),(t.rawBitFlag&ENe)!=(e.rawBitFlag&ENe)&&z0(s,r,voe),t.compressionMethod!=e.compressionMethod&&z0(s,r,Soe),!t.bitFlag.dataDescriptor&&!a&&(t.crc32||t.compressedSize||t.uncompressedSize)&&(t.crc32!=e.crc32||t.compressedSize!=e.compressedSize||t.uncompressedSize!=e.uncompressedSize)&&z0(s,r,woe)}function z0(e,t,n){e?u7(n):Ih(t,n)}function Ih(e,t,n){if(!e.some(i=>i.reason==t)){let i={reason:t};n!==Ue&&(i.filename=n),e.push(i)}}function u7(e){let t=new Error(foe);throw t.reason=e,t}function Ns(e,t,n){return t[n]===Ue?e.options[n]:t[n]}function NNe(e,t,n){return qI(Ns(e,t,n))}function O2t(e){let t=(e&4294901760)>>16,n=e&65535,i=new Date(1980+((t&65024)>>9),((t&480)>>5)-1,t&31,(n&63488)>>11,(n&2016)>>5,(n&31)*2,0);return i<GI?GI:i}function zre(e){return new Date(Number(e/BigInt(1e4)-BigInt(116444736e5)))}function Pb(e,t){return e.getUint8(t)}function _r(e,t){return e.getUint16(t,!0)}function Ri(e,t){return e.getUint32(t,!0)}function ud(e,t){let n=e.getBigUint64(t,!0);if(n>h2t)throw new Error(_oe);return Number(n)}var hP,ioe,roe,ooe,soe,aoe,coe,d7,h7,m7,loe,uoe,foe,doe,hoe,moe,poe,goe,_oe,yoe,Aoe,boe,P7,xoe,p7,g7,_7,Toe,Eoe,Coe,mP,voe,Soe,woe,l2t,u2t,xNe,f2t,TNe,ENe,LNe,d2t,CNe,h2t,m2t,p2t,vNe,Ioe,y7,bC,A7,Vre,Doe=hs(()=>{Ec();N0();dC();Q9();r7();ure();uC();QI();NV();Bre();DV();hP="File format is not recognized",ioe="End of central directory not found",roe="End of Zip64 central directory locator not found",ooe="Central directory header not found",soe="Local file header not found",aoe="Zip64 extra field not found",coe="File contains encrypted entry",d7="Encryption method not supported",h7="Compression method not supported",m7="Split zip file",loe="Overlapping entry found",uoe="Entry data out of bounds",foe="Ambiguous archive",doe="Encrypted central directory is not supported",hoe="Unsafe filename",moe="Invalid strictness (must be 'strict', 'balanced' or 'tolerant')",poe="Invalid filenameValidation (must be 'strict', 'balanced' or 'tolerant')",goe="Invalid maxAppendedDataSize (must be a number greater than or equal to 0)",_oe="64-bit value exceeds Number.MAX_SAFE_INTEGER",yoe="unsorted central directory",Aoe="unknown version needed to extract",boe="compressed patched data",P7="malformed extra field",xoe="unknown zip64 extensible data",p7="wrapped entries count",g7="appended data",_7="prepended data",Toe="prepended central directory",Eoe="trailing central directory data",Coe="duplicate filename",mP="mismatched zip64 end of central directory record",voe="mismatched local file header (general purpose bit flag)",Soe="mismatched local file header (compression method)",woe="mismatched local file header (crc32 or sizes)",l2t=63,u2t=/^[a-zA-Z]:/,xNe="utf-8",f2t="UTF8",TNe="cp437",ENe=2057,LNe=1,d2t=[[JV,4294967295],[_re,4294967295],[yre,4294967295],[Are,65535]],CNe={65535:{getValue:Ri,bytes:4},4294967295:{getValue:ud,bytes:8}},h2t=BigInt(Number.MAX_SAFE_INTEGER),m2t=64,p2t=1032,vNe=0,Ioe=1,y7=2,bC=class{constructor(t,n={}){Object.assign(this,{reader:new oy(t),options:n,readRanges:new Map})}async*getEntriesGenerator(t={}){let n=this,{reader:i}=n;if(await jc(i),(i.size===Ue||!i.readUint8Array)&&(i=new uf(await B0(i.readable)),await jc(i)),i.size<22)throw new Error(hP);let r=n.warnings=[],o=Poe(t,n.options),s=o==Tb,a=o!=ty,c=VNe(Ns(n,t,kie),o),u=I2t(Ns(n,t,tMe),o),f=Ns(n,t,nMe),{endOfDirectoryInfo:d,endOfDirectoryReachingEndCount:p}=await jNe(i,a,c);if(!d)throw await E2t(i)?new Error(m7):new Error(ioe);a&&p>1&&u7("multiple end of central directory records");let g=di(d),m=Ri(g,12),y=Ri(g,16),A=d.offset,b=_r(g,20),x=A+22+b,T=i.size-x;T>c&&u7(g7),T>0&&Ih(r,g7);let E=_r(g,4),v=i.lastDiskNumber||0,S=_r(g,6),I=_r(g,10),R=0,O,L,_,C,w=56,P,M=y==4294967295||m==4294967295||I==65535||S==65535;if(y!=4294967295&&S!=65535&&(y+=pP(i,S)),M){let He=d.offset>=20?await Uo(i,d.offset-20,20):gr,Xe=di(He);if(He.length==20&&Ri(Xe,0)==117853008){y=pP(i,Ri(Xe,4))+ud(Xe,8);let $e=await Uo(i,y,56),Pe=di($e),qe=d.offset-20-56;if(($e.length<56||Ri(Pe,0)!=101075792)&&y!=qe&&qe>=0){let st=y;y=qe,y>st&&(R=y-st),$e=await Uo(i,y,56),Pe=di($e)}if($e.length<56||Ri(Pe,0)!=101075792)throw new Error(roe);if(_=!0,C=ud(Pe,4)>44,C){let st=Math.min(ud(Pe,4)-44,i.size-y-56);if(st>0){w+=st;let vt=await Uo(i,y+56,st);P=_2t(vt)}}E==65535?E=Ri(Pe,16):E!=Ri(Pe,16)&&z0(s,r,mP),S==65535?S=Ri(Pe,20):S!=Ri(Pe,20)&&z0(s,r,mP),I==65535?I=ud(Pe,32):I!=ud(Pe,32)&&z0(s,r,mP),m==4294967295?m=ud(Pe,40):m!=ud(Pe,40)&&z0(s,r,mP),y=pP(i,S)+ud(Pe,48)+R}}let F=m,V=d.offset-(_?w+20:0);if(y>=i.size&&(R=i.size-y-m-22,y=i.size-m-22),v!=E)throw new Error(m7);if(y<0)throw new Error(hP);let B=0,j=await Uo(i,y,m),k=di(j);if(m){if(j.length<4)throw new Error(hP);let He=V-m;if(y!=He&&S==E){let Xe=Ri(k,B)==33639248||!!(P&&P.compressedSize)||kre(k),$e=!Xe;if(!$e&&He>=0&&He+4<=i.size){let Pe=await Uo(i,He,4);$e=Ri(di(Pe),0)==33639248}if($e){let Pe=y;y=He,y>Pe&&(R+=y-Pe,O=Xe),j=await Uo(i,y,m),k=di(j)}}}let G=V-y;if(m!=G&&G>=0&&S==E&&(m=G,j=await Uo(i,y,m),k=di(j)),y<0||y>=i.size)throw new Error(hP);n.directoryOffset=y,n.directoryLength=F;let q=NNe(n,t,iMe),Q,W;if(q&&I&&j.length>=4&&Ri(k,0)!=33639248&&(C||kre(k))){let He=g2t(P,F,j.length);W=j.subarray(He),j=await q(j.subarray(0,He),P),k=di(j),F=j.length,Q=!0}P&&!Q&&(j.length<4||Ri(k,0)==33639248)&&Ih(r,xoe),L=y;let J=Ns(n,t,wOe),Z=Ns(n,t,IOe),ae=new Set,Ae,fe=-1,xe=!s&&!_;!I&&xe&&(I=SNe(k,j,B),I&&Ih(r,p7));for(let He=0;He<I;He++){let Xe=new Vre(i,n.options);if(B+46>j.length||Ri(k,B)!=33639248)throw He==0&&!Q&&(C||kre(k))?new Error(doe):new Error(ooe);BNe(Xe,k,B+6);let $e=!!Xe.bitFlag.languageEncodingFlag,Pe=B+46,qe=Pe+Xe.filenameLength,st=qe+Xe.extraFieldLength,vt=_r(k,B+4),Gt=vt>>8==0,lt=vt>>8==3,mt=j.subarray(Pe,qe),ft=_r(k,B+32),Xt=st+ft,rt=j.subarray(st,Xt),ht=$e,Bi=$e,Xn=Ri(k,B+38),bi=Xn&255,Wi={readOnly:!!(bi&1),hidden:!!(bi&2),system:!!(bi&4),directory:!!(bi&16),archive:!!(bi&32)},wi=Ri(k,B+42),hi=NNe(n,t,POe)||qV,xi=ht?xNe:J||TNe,jn=Bi?xNe:Z||TNe,nn=hi(mt,xi,E9);if(nn===Ue&&(nn=qV(mt,xi)),f){let ki=f(nn);ki!==Ue&&(nn=ki)}if(P2t(nn,u)){let ki=new Error(hoe);throw ki.filename=nn,ki}let Wn=hi(rt,jn,C9);Wn===Ue&&(Wn=qV(rt,jn)),Object.assign(Xe,{index:He,decryptedDirectory:Q,versionMadeBy:vt,msDosCompatible:Gt,zip64:!1,compressedSize:0,uncompressedSize:0,commentLength:ft,offset:wi,diskNumberStart:_r(k,B+34),internalFileAttributes:_r(k,B+36),externalFileAttributes:Xn,msdosAttributesRaw:bi,msdosAttributes:Wi,rawFilename:mt,filenameUTF8:ht,commentUTF8:Bi,rawExtraField:j.subarray(qe,st),rawComment:rt,filename:nn,comment:Wn}),kNe(Xe,Xe,k,B+6)&&Ih(r,P7,nn),Xe.offset+=R;let Zi=pP(i,Xe.diskNumberStart)+Xe.offset;L=Math.min(Zi,L),Zi<fe&&Ih(r,yoe,nn),fe=Zi,(Xe.version&255)>l2t&&Ih(r,Aoe,nn),(Xe.rawBitFlag&32)==32&&Ih(r,boe,nn),ae.has(Xe.filename)&&(Ae=!0),ae.add(Xe.filename);let Mr=Xe.externalFileAttributes>>16&65535;Xe.unixMode===Ue&&(Mr&16877)!=0&&(Xe.unixMode=Mr);let fo=!!(Xe.unixMode&2048),Bs=!!(Xe.unixMode&1024),Ks=!!(Xe.unixMode&512),gi=((Xe.unixMode===Ue?Mr:Xe.unixMode)&61440)==40960,ho=!gi&&(Xe.unixMode!==Ue?(Xe.unixMode&73)!=0:lt&&(Mr&73)!=0),ur=Xe.unixMode!==Ue&&(Xe.unixMode&61440)==16384,Zo=(Mr&61440)==16384;Object.assign(Xe,{setuid:fo,setgid:Bs,sticky:Ks,symlink:gi,unixExternalUpper:Mr,internalFileAttribute:Xe.internalFileAttributes,externalFileAttribute:Xe.externalFileAttributes,executable:ho,directory:ur||Zo||Gt&&Wi.directory||Xe.filename.endsWith("/"),zipCrypto:Xe.encrypted&&!Xe.extraFieldAES});let Bn=new wb(Xe);if(Bn.getData=(ki,Nr)=>Xe.getData(ki,Bn,n.readRanges,Nr),Bn.arrayBuffer=async ki=>{let Nr=new null,Wc=B0(Nr.readable).then(bd=>bd.arrayBuffer());return Wc.catch(()=>{}),await Xe.getData(Nr,Bn,n.readRanges,ki),Wc},B=Xt,He==I-1&&xe){let ki=SNe(k,j,B);ki&&(I+=ki,Ih(r,p7))}let{onprogress:qi}=t;if(qi)try{await qi(He+1,I,new wb(Xe))}catch{}yield Bn}let ge=B,we=Ure(j.subarray(B))||(Q?Ure(W):Ue);if(!we&&!Q){let He=y+B,Xe=Math.min(V-He,65541);Xe>=6&&(we=Ure(await Uo(i,He,Xe)))}we&&(n.digitalSignature=we,ge=B+6+we.length),(B!=F&&ge!=F||!Q&&B!=m&&ge!=m)&&z0(s,r,Eoe),Ae&&z0(s,r,Coe);let Se=Ns(n,t,DOe),Re=Ns(n,t,ROe),Qe=(s||Se)&&I&&L==4&&await C2t(i)?4:0;return s&&(R||I&&L>Qe)&&u7(_7),(R||I&&L>4)&&Ih(r,_7),O&&Ih(r,Toe),Se&&(n.prependedData=L>Qe?await Uo(i,Qe,L-Qe):gr),n.comment=b?await Uo(i,A+22,b):gr,Re&&(n.appendedData=x<i.size?await Uo(i,x,i.size-x):gr),!0}async getEntries(t={}){let n=[];for await(let i of this.getEntriesGenerator(t))n.push(i);return n}async close(){let{reader:t}=this;!t.readUint8Array&&t.readable&&!t.readable.locked&&await t.readable.cancel()}},A7=class{constructor(t={}){let{readable:n,writable:i}=new null,r=new bC(n,t).getEntriesGenerator();this.readable=new ReadableStream({async pull(o){let{done:s,value:a}=await r.next();if(s)return o.close();let c={...a,readable:(function(){let{readable:u,writable:f}=new null;if(a.getData)return d(),u;async function d(){try{await a.getData(f)}catch(p){try{await f.abort(p)}catch{}}}})()};delete c.getData,o.enqueue(c)}}),this.writable=i}};Vre=class{constructor(t,n){Object.assign(this,{reader:t,options:n})}async getData(t,n,i,r={}){let o=this,s=ny(),{reader:a,index:c,offset:u,diskNumberStart:f,extraFieldAES:d,extraFieldZip64:p,compressionMethod:g,bitFlag:m,rawBitFlag:y,crc32:A,rawLastModDate:b,uncompressedSize:x,compressedSize:T}=o,{dataDescriptor:E}=m,v=n.localDirectory={},S=n.warnings=[],I=pP(a,f)+u,R=await Uo(a,I,30),O=di(R),L=Ns(o,r,p9),_=Ns(o,r,g9),C=Ns(o,r,_9);if(w9(L,_),L=L&&L.length&&L,_=_&&_.length&&_,d&&d.originalCompressionMethod!=99)throw new Error(h7);if(R.length<30||Ri(O,0)!=67324752)throw new Error(soe);BNe(v,O,4);let{extraFieldLength:w,filenameLength:P}=v,M=v.dataOffset=I+30+P+w,F=Ns(o,r,FOe),V=Poe(r,o.options),B=S2t(F,V),j=w2t(F,V),k=gr;if(j&&(P||w)){let ft=await Uo(a,I+30,P+w);k=ft.subarray(0,P),v.rawExtraField=ft.subarray(P)}else v.rawExtraField=w?await Uo(a,I+30+P,w):gr;j&&(v.rawFilename=k),kNe(o,v,O,4,!0)&&Ih(S,P7),R2t(o,v,k,j,B?Ue:S);let{lastAccessDate:G,creationDate:q,uid:Q,gid:W}=v;G&&(n.lastAccessDate=G),q&&(n.creationDate=q),Q!==Ue&&n.uid===Ue&&(n.uid=Q),W!==Ue&&n.gid===Ue&&(n.gid=W);let J=o.encrypted&&v.encrypted&&!C,Z=J&&!d;if(C||(n.zipCrypto=Z),J&&(v.rawBitFlag&64)==64)throw new Error(d7);let ae=C?Ue:B9(g);if(g!=0&&g!=8&&g!=9&&!ae&&!C)throw new Error(h7);if(J){if(!Z&&(d.strength<1||d.strength>3))throw new Error(d7);if(!L&&!_)throw new Error(coe)}if(M+T>a.size)throw new Error(uoe);let Ae=T,fe=tp(a.createReadable({offset:M,size:Ae})),xe=S9(Ns(o,r,y9)),ge=Ns(o,r,OOe),we=Ns(o,r,NOe),Se=Ns(o,r,MOe);Se&&(we=!0);let{onstart:Re,onprogress:Qe,onend:He}=r,Xe=g!=0&&!C,$e=C?T:x,Pe=g==9,qe=Ns(o,r,b9);Pe&&(qe=!1);let st=Ns(o,r,kOe),vt=(st===Ue?Ns(o,r,BOe):st)&&!C&&(!J||Z||d&&d.vendorVersion==LNe),Gt={options:{codecType:G9,password:L,rawPassword:_,zipCrypto:Z,encryptionStrength:d&&d.strength,checkCrc32:vt,checkAuthenticationCode:Ns(o,r,UOe),passwordVerification:Z&&(E?b>>>8&255:A>>>24&255),outputSize:$e,crc32:A,compressed:Xe,encrypted:J,useWebWorkers:Ns(o,r,A9),useCompressionStream:qe,transferStreams:Ns(o,r,x9),deflate64:Pe,format:ae?ae.format:Ue,codecURI:ae?ae.codecURI:Ue,compressionMethod:g,rawBitFlag:y,checkPasswordOnly:ge},config:s,streamOptions:{signal:xe,size:Ae,onstart:Re,onprogress:Qe,onend:He}};we&&await T2t({reader:a,fileEntry:n,index:c,offset:I,crc32:A,compressedSize:T,uncompressedSize:x,dataOffset:M,dataDescriptor:E||v.bitFlag.dataDescriptor,extraFieldZip64:p||v.extraFieldZip64,readRanges:i});let lt,mt;try{if(!Se){ge&&(t=new WritableStream),t=new uP(t),await jc(t,v2t($e,T,Xe)),{writable:lt}=t;let{outputSize:ft}=await Z9({readable:fe,writable:lt},Gt);if(t.size+=ft,ft!=$e)throw new Error(Sb)}}catch(ft){if(ft.outputSize!==Ue&&(t.size+=ft.outputSize),!ge||ft.message!=iy)throw mt=ft,ft}finally{if(!(!i7(t)&&Ns(o,r,T9))&<&&!lt.locked){let Xt=lt.getWriter();if(mt)try{await Xt.abort(mt)}catch{}else await Xt.close()}}return ge||Se?Ue:t.getData?t.getData():lt}}});var iFe=Yi((H7,nFe)=>{(function(e,t){typeof H7=="object"&&typeof nFe<"u"?t(H7):typeof define=="function"&&define.amd?define(["exports"],t):(e=e||self,t(e.topojson=e.topojson||{}))})(H7,function(e){"use strict";function t(T){return T}function n(T){if(T==null)return t;var E,v,S=T.scale[0],I=T.scale[1],R=T.translate[0],O=T.translate[1];return function(L,_){_||(E=v=0);var C=2,w=L.length,P=new Array(w);for(P[0]=(E+=L[0])*S+R,P[1]=(v+=L[1])*I+O;C<w;)P[C]=L[C],++C;return P}}function i(T){var E=n(T.transform),v,S=1/0,I=S,R=-S,O=-S;function L(C){C=E(C),C[0]<S&&(S=C[0]),C[0]>R&&(R=C[0]),C[1]<I&&(I=C[1]),C[1]>O&&(O=C[1])}function _(C){switch(C.type){case"GeometryCollection":C.geometries.forEach(_);break;case"Point":L(C.coordinates);break;case"MultiPoint":C.coordinates.forEach(L);break}}T.arcs.forEach(function(C){for(var w=-1,P=C.length,M;++w<P;)M=E(C[w],w),M[0]<S&&(S=M[0]),M[0]>R&&(R=M[0]),M[1]<I&&(I=M[1]),M[1]>O&&(O=M[1])});for(v in T.objects)_(T.objects[v]);return[S,I,R,O]}function r(T,E){for(var v,S=T.length,I=S-E;I<--S;)v=T[I],T[I++]=T[S],T[S]=v}function o(T,E){return typeof E=="string"&&(E=T.objects[E]),E.type==="GeometryCollection"?{type:"FeatureCollection",features:E.geometries.map(function(v){return s(T,v)})}:s(T,E)}function s(T,E){var v=E.id,S=E.bbox,I=E.properties==null?{}:E.properties,R=a(T,E);return v==null&&S==null?{type:"Feature",properties:I,geometry:R}:S==null?{type:"Feature",id:v,properties:I,geometry:R}:{type:"Feature",id:v,bbox:S,properties:I,geometry:R}}function a(T,E){var v=n(T.transform),S=T.arcs;function I(w,P){P.length&&P.pop();for(var M=S[w<0?~w:w],F=0,V=M.length;F<V;++F)P.push(v(M[F],F));w<0&&r(P,V)}function R(w){return v(w)}function O(w){for(var P=[],M=0,F=w.length;M<F;++M)I(w[M],P);return P.length<2&&P.push(P[0]),P}function L(w){for(var P=O(w);P.length<4;)P.push(P[0]);return P}function _(w){return w.map(L)}function C(w){var P=w.type,M;switch(P){case"GeometryCollection":return{type:P,geometries:w.geometries.map(C)};case"Point":M=R(w.coordinates);break;case"MultiPoint":M=w.coordinates.map(R);break;case"LineString":M=O(w.arcs);break;case"MultiLineString":M=w.arcs.map(O);break;case"Polygon":M=_(w.arcs);break;case"MultiPolygon":M=w.arcs.map(_);break;default:return null}return{type:P,coordinates:M}}return C(E)}function c(T,E){var v={},S={},I={},R=[],O=-1;E.forEach(function(C,w){var P=T.arcs[C<0?~C:C],M;P.length<3&&!P[1][0]&&!P[1][1]&&(M=E[++O],E[O]=C,E[w]=M)}),E.forEach(function(C){var w=L(C),P=w[0],M=w[1],F,V;if(F=I[P])if(delete I[F.end],F.push(C),F.end=M,V=S[M]){delete S[V.start];var B=V===F?F:F.concat(V);S[B.start=F.start]=I[B.end=V.end]=B}else S[F.start]=I[F.end]=F;else if(F=S[M])if(delete S[F.start],F.unshift(C),F.start=P,V=I[P]){delete I[V.end];var j=V===F?F:V.concat(F);S[j.start=V.start]=I[j.end=F.end]=j}else S[F.start]=I[F.end]=F;else F=[C],S[F.start=P]=I[F.end=M]=F});function L(C){var w=T.arcs[C<0?~C:C],P=w[0],M;return T.transform?(M=[0,0],w.forEach(function(F){M[0]+=F[0],M[1]+=F[1]})):M=w[w.length-1],C<0?[M,P]:[P,M]}function _(C,w){for(var P in C){var M=C[P];delete w[M.start],delete M.start,delete M.end,M.forEach(function(F){v[F<0?~F:F]=1}),R.push(M)}}return _(I,S),_(S,I),E.forEach(function(C){v[C<0?~C:C]||R.push([C])}),R}function u(T){return a(T,f.apply(this,arguments))}function f(T,E,v){var S,I,R;if(arguments.length>1)S=d(T,E,v);else for(I=0,S=new Array(R=T.arcs.length);I<R;++I)S[I]=I;return{type:"MultiLineString",arcs:c(T,S)}}function d(T,E,v){var S=[],I=[],R;function O(P){var M=P<0?~P:P;(I[M]||(I[M]=[])).push({i:P,g:R})}function L(P){P.forEach(O)}function _(P){P.forEach(L)}function C(P){P.forEach(_)}function w(P){switch(R=P,P.type){case"GeometryCollection":P.geometries.forEach(w);break;case"LineString":L(P.arcs);break;case"MultiLineString":case"Polygon":_(P.arcs);break;case"MultiPolygon":C(P.arcs);break}}return w(E),I.forEach(v==null?function(P){S.push(P[0].i)}:function(P){v(P[0].g,P[P.length-1].g)&&S.push(P[0].i)}),S}function p(T){for(var E=-1,v=T.length,S,I=T[v-1],R=0;++E<v;)S=I,I=T[E],R+=S[0]*I[1]-S[1]*I[0];return Math.abs(R)}function g(T){return a(T,m.apply(this,arguments))}function m(T,E){var v={},S=[],I=[];E.forEach(R);function R(_){switch(_.type){case"GeometryCollection":_.geometries.forEach(R);break;case"Polygon":O(_.arcs);break;case"MultiPolygon":_.arcs.forEach(O);break}}function O(_){_.forEach(function(C){C.forEach(function(w){(v[w=w<0?~w:w]||(v[w]=[])).push(_)})}),S.push(_)}function L(_){return p(a(T,{type:"Polygon",arcs:[_]}).coordinates[0])}return S.forEach(function(_){if(!_._){var C=[],w=[_];for(_._=1,I.push(C);_=w.pop();)C.push(_),_.forEach(function(P){P.forEach(function(M){v[M<0?~M:M].forEach(function(F){F._||(F._=1,w.push(F))})})})}}),S.forEach(function(_){delete _._}),{type:"MultiPolygon",arcs:I.map(function(_){var C=[],w;if(_.forEach(function(B){B.forEach(function(j){j.forEach(function(k){v[k<0?~k:k].length<2&&C.push(k)})})}),C=c(T,C),(w=C.length)>1)for(var P=1,M=L(C[0]),F,V;P<w;++P)(F=L(C[P]))>M&&(V=C[0],C[0]=C[P],C[P]=V,M=F);return C}).filter(function(_){return _.length>0})}}function y(T,E){for(var v=0,S=T.length;v<S;){var I=v+S>>>1;T[I]<E?v=I+1:S=I}return v}function A(T){var E={},v=T.map(function(){return[]});function S(B,j){B.forEach(function(k){k<0&&(k=~k);var G=E[k];G?G.push(j):E[k]=[j]})}function I(B,j){B.forEach(function(k){S(k,j)})}function R(B,j){B.type==="GeometryCollection"?B.geometries.forEach(function(k){R(k,j)}):B.type in O&&O[B.type](B.arcs,j)}var O={LineString:S,MultiLineString:I,Polygon:I,MultiPolygon:function(B,j){B.forEach(function(k){I(k,j)})}};T.forEach(R);for(var L in E)for(var _=E[L],C=_.length,w=0;w<C;++w)for(var P=w+1;P<C;++P){var M=_[w],F=_[P],V;(V=v[M])[L=y(V,F)]!==F&&V.splice(L,0,F),(V=v[F])[L=y(V,M)]!==M&&V.splice(L,0,M)}return v}function b(T){if(T==null)return t;var E,v,S=T.scale[0],I=T.scale[1],R=T.translate[0],O=T.translate[1];return function(L,_){_||(E=v=0);var C=2,w=L.length,P=new Array(w),M=Math.round((L[0]-R)/S),F=Math.round((L[1]-O)/I);for(P[0]=M-E,E=M,P[1]=F-v,v=F;C<w;)P[C]=L[C],++C;return P}}function x(T,E){if(T.transform)throw new Error("already quantized");if(!E||!E.scale){if(!((O=Math.floor(E))>=2))throw new Error("n must be \u22652");_=T.bbox||i(T);var v=_[0],S=_[1],I=_[2],R=_[3],O;E={scale:[I-v?(I-v)/(O-1):1,R-S?(R-S)/(O-1):1],translate:[v,S]}}else _=T.bbox;var L=b(E),_,C,w=T.objects,P={};function M(B){return L(B)}function F(B){var j;switch(B.type){case"GeometryCollection":j={type:"GeometryCollection",geometries:B.geometries.map(F)};break;case"Point":j={type:"Point",coordinates:M(B.coordinates)};break;case"MultiPoint":j={type:"MultiPoint",coordinates:B.coordinates.map(M)};break;default:return B}return B.id!=null&&(j.id=B.id),B.bbox!=null&&(j.bbox=B.bbox),B.properties!=null&&(j.properties=B.properties),j}function V(B){var j=0,k=1,G=B.length,q,Q=new Array(G);for(Q[0]=L(B[0],0);++j<G;)((q=L(B[j],j))[0]||q[1])&&(Q[k++]=q);return k===1&&(Q[k++]=[0,0]),Q.length=k,Q}for(C in w)P[C]=F(w[C]);return{type:"Topology",bbox:_,transform:E,objects:P,arcs:T.arcs.map(V)}}e.bbox=i,e.feature=o,e.merge=g,e.mergeArcs=m,e.mesh=u,e.meshArcs=f,e.neighbors=A,e.quantize=x,e.transform=n,e.untransform=b,Object.defineProperty(e,"__esModule",{value:!0})})});var op={};Oq(op,{__addDisposableResource:()=>YFe,__assign:()=>q7,__asyncDelegator:()=>UFe,__asyncGenerator:()=>kFe,__asyncValues:()=>zFe,__await:()=>CP,__awaiter:()=>OFe,__classPrivateFieldGet:()=>GFe,__classPrivateFieldIn:()=>qFe,__classPrivateFieldSet:()=>WFe,__createBinding:()=>X7,__decorate:()=>vFe,__disposeResources:()=>XFe,__esDecorate:()=>wFe,__exportStar:()=>NFe,__extends:()=>EFe,__generator:()=>MFe,__importDefault:()=>HFe,__importStar:()=>jFe,__makeTemplateObject:()=>VFe,__metadata:()=>RFe,__param:()=>SFe,__propKey:()=>PFe,__read:()=>ase,__rest:()=>CFe,__rewriteRelativeImportExtension:()=>KFe,__runInitializers:()=>IFe,__setFunctionName:()=>DFe,__spread:()=>LFe,__spreadArray:()=>BFe,__spreadArrays:()=>FFe,__values:()=>Y7,default:()=>Zkt});function EFe(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");ose(e,t);function n(){this.constructor=e}e.prototype=t===null?Object.create(t):(n.prototype=t.prototype,new n)}function CFe(e,t){var n={};for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&t.indexOf(i)<0&&(n[i]=e[i]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var r=0,i=Object.getOwnPropertySymbols(e);r<i.length;r++)t.indexOf(i[r])<0&&Object.prototype.propertyIsEnumerable.call(e,i[r])&&(n[i[r]]=e[i[r]]);return n}function vFe(e,t,n,i){var r=arguments.length,o=r<3?t:i===null?i=Object.getOwnPropertyDescriptor(t,n):i,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(e,t,n,i);else for(var a=e.length-1;a>=0;a--)(s=e[a])&&(o=(r<3?s(o):r>3?s(t,n,o):s(t,n))||o);return r>3&&o&&Object.defineProperty(t,n,o),o}function SFe(e,t){return function(n,i){t(n,i,e)}}function wFe(e,t,n,i,r,o){function s(b){if(b!==void 0&&typeof b!="function")throw new TypeError("Function expected");return b}for(var a=i.kind,c=a==="getter"?"get":a==="setter"?"set":"value",u=!t&&e?i.static?e:e.prototype:null,f=t||(u?Object.getOwnPropertyDescriptor(u,i.name):{}),d,p=!1,g=n.length-1;g>=0;g--){var m={};for(var y in i)m[y]=y==="access"?{}:i[y];for(var y in i.access)m.access[y]=i.access[y];m.addInitializer=function(b){if(p)throw new TypeError("Cannot add initializers after decoration has completed");o.push(s(b||null))};var A=(0,n[g])(a==="accessor"?{get:f.get,set:f.set}:f[c],m);if(a==="accessor"){if(A===void 0)continue;if(A===null||typeof A!="object")throw new TypeError("Object expected");(d=s(A.get))&&(f.get=d),(d=s(A.set))&&(f.set=d),(d=s(A.init))&&r.unshift(d)}else(d=s(A))&&(a==="field"?r.unshift(d):f[c]=d)}u&&Object.defineProperty(u,i.name,f),p=!0}function IFe(e,t,n){for(var i=arguments.length>2,r=0;r<t.length;r++)n=i?t[r].call(e,n):t[r].call(e);return i?n:void 0}function PFe(e){return typeof e=="symbol"?e:"".concat(e)}function DFe(e,t,n){return typeof t=="symbol"&&(t=t.description?"[".concat(t.description,"]"):""),Object.defineProperty(e,"name",{configurable:!0,value:n?"".concat(n," ",t):t})}function RFe(e,t){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(e,t)}function OFe(e,t,n,i){function r(o){return o instanceof n?o:new n(function(s){s(o)})}return new(n||(n=Promise))(function(o,s){function a(f){try{u(i.next(f))}catch(d){s(d)}}function c(f){try{u(i.throw(f))}catch(d){s(d)}}function u(f){f.done?o(f.value):r(f.value).then(a,c)}u((i=i.apply(e,t||[])).next())})}function MFe(e,t){var n={label:0,sent:function(){if(o[0]&1)throw o[1];return o[1]},trys:[],ops:[]},i,r,o,s=Object.create((typeof Iterator=="function"?Iterator:Object).prototype);return s.next=a(0),s.throw=a(1),s.return=a(2),typeof Symbol=="function"&&(s[Symbol.iterator]=function(){return this}),s;function a(u){return function(f){return c([u,f])}}function c(u){if(i)throw new TypeError("Generator is already executing.");for(;s&&(s=0,u[0]&&(n=0)),n;)try{if(i=1,r&&(o=u[0]&2?r.return:u[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,u[1])).done)return o;switch(r=0,o&&(u=[u[0]&2,o.value]),u[0]){case 0:case 1:o=u;break;case 4:return n.label++,{value:u[1],done:!1};case 5:n.label++,r=u[1],u=[0];continue;case 7:u=n.ops.pop(),n.trys.pop();continue;default:if(o=n.trys,!(o=o.length>0&&o[o.length-1])&&(u[0]===6||u[0]===2)){n=0;continue}if(u[0]===3&&(!o||u[1]>o[0]&&u[1]<o[3])){n.label=u[1];break}if(u[0]===6&&n.label<o[1]){n.label=o[1],o=u;break}if(o&&n.label<o[2]){n.label=o[2],n.ops.push(u);break}o[2]&&n.ops.pop(),n.trys.pop();continue}u=t.call(e,n)}catch(f){u=[6,f],r=0}finally{i=o=0}if(u[0]&5)throw u[1];return{value:u[0]?u[1]:void 0,done:!0}}}function NFe(e,t){for(var n in e)n!=="default"&&!Object.prototype.hasOwnProperty.call(t,n)&&X7(t,e,n)}function Y7(e){var t=typeof Symbol=="function"&&Symbol.iterator,n=t&&e[t],i=0;if(n)return n.call(e);if(e&&typeof e.length=="number")return{next:function(){return e&&i>=e.length&&(e=void 0),{value:e&&e[i++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function ase(e,t){var n=typeof Symbol=="function"&&e[Symbol.iterator];if(!n)return e;var i=n.call(e),r,o=[],s;try{for(;(t===void 0||t-- >0)&&!(r=i.next()).done;)o.push(r.value)}catch(a){s={error:a}}finally{try{r&&!r.done&&(n=i.return)&&n.call(i)}finally{if(s)throw s.error}}return o}function LFe(){for(var e=[],t=0;t<arguments.length;t++)e=e.concat(ase(arguments[t]));return e}function FFe(){for(var e=0,t=0,n=arguments.length;t<n;t++)e+=arguments[t].length;for(var i=Array(e),r=0,t=0;t<n;t++)for(var o=arguments[t],s=0,a=o.length;s<a;s++,r++)i[r]=o[s];return i}function BFe(e,t,n){if(n||arguments.length===2)for(var i=0,r=t.length,o;i<r;i++)(o||!(i in t))&&(o||(o=Array.prototype.slice.call(t,0,i)),o[i]=t[i]);return e.concat(o||Array.prototype.slice.call(t))}function CP(e){return this instanceof CP?(this.v=e,this):new CP(e)}function kFe(e,t,n){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var i=n.apply(e,t||[]),r,o=[];return r=Object.create((typeof AsyncIterator=="function"?AsyncIterator:Object).prototype),a("next"),a("throw"),a("return",s),r[Symbol.asyncIterator]=function(){return this},r;function s(g){return function(m){return Promise.resolve(m).then(g,d)}}function a(g,m){i[g]&&(r[g]=function(y){return new Promise(function(A,b){o.push([g,y,A,b])>1||c(g,y)})},m&&(r[g]=m(r[g])))}function c(g,m){try{u(i[g](m))}catch(y){p(o[0][3],y)}}function u(g){g.value instanceof CP?Promise.resolve(g.value.v).then(f,d):p(o[0][2],g)}function f(g){c("next",g)}function d(g){c("throw",g)}function p(g,m){g(m),o.shift(),o.length&&c(o[0][0],o[0][1])}}function UFe(e){var t,n;return t={},i("next"),i("throw",function(r){throw r}),i("return"),t[Symbol.iterator]=function(){return this},t;function i(r,o){t[r]=e[r]?function(s){return(n=!n)?{value:CP(e[r](s)),done:!1}:o?o(s):s}:o}}function zFe(e){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var t=e[Symbol.asyncIterator],n;return t?t.call(e):(e=typeof Y7=="function"?Y7(e):e[Symbol.iterator](),n={},i("next"),i("throw"),i("return"),n[Symbol.asyncIterator]=function(){return this},n);function i(o){n[o]=e[o]&&function(s){return new Promise(function(a,c){s=e[o](s),r(a,c,s.done,s.value)})}}function r(o,s,a,c){Promise.resolve(c).then(function(u){o({value:u,done:a})},s)}}function VFe(e,t){return Object.defineProperty?Object.defineProperty(e,"raw",{value:t}):e.raw=t,e}function jFe(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var n=sse(e),i=0;i<n.length;i++)n[i]!=="default"&&X7(t,e,n[i]);return $kt(t,e),t}function HFe(e){return e&&e.__esModule?e:{default:e}}function GFe(e,t,n,i){if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a getter");if(typeof t=="function"?e!==t||!i:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return n==="m"?i:n==="a"?i.call(e):i?i.value:t.get(e)}function WFe(e,t,n,i,r){if(i==="m")throw new TypeError("Private method is not writable");if(i==="a"&&!r)throw new TypeError("Private accessor was defined without a setter");if(typeof t=="function"?e!==t||!r:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return i==="a"?r.call(e,n):r?r.value=n:t.set(e,n),n}function qFe(e,t){if(t===null||typeof t!="object"&&typeof t!="function")throw new TypeError("Cannot use 'in' operator on non-object");return typeof e=="function"?t===e:e.has(t)}function YFe(e,t,n){if(t!=null){if(typeof t!="object"&&typeof t!="function")throw new TypeError("Object expected.");var i,r;if(n){if(!Symbol.asyncDispose)throw new TypeError("Symbol.asyncDispose is not defined.");i=t[Symbol.asyncDispose]}if(i===void 0){if(!Symbol.dispose)throw new TypeError("Symbol.dispose is not defined.");i=t[Symbol.dispose],n&&(r=i)}if(typeof i!="function")throw new TypeError("Object not disposable.");r&&(i=function(){try{r.call(this)}catch(o){return Promise.reject(o)}}),e.stack.push({value:t,dispose:i,async:n})}else n&&e.stack.push({async:!0});return t}function XFe(e){function t(o){e.error=e.hasError?new Jkt(o,e.error,"An error was suppressed during disposal."):o,e.hasError=!0}var n,i=0;function r(){for(;n=e.stack.pop();)try{if(!n.async&&i===1)return i=0,e.stack.push(n),Promise.resolve().then(r);if(n.dispose){var o=n.dispose.call(n.value);if(n.async)return i|=2,Promise.resolve(o).then(r,function(s){return t(s),r()})}else i|=1}catch(s){t(s)}if(i===1)return e.hasError?Promise.reject(e.error):Promise.resolve();if(e.hasError)throw e.error}return r()}function KFe(e,t){return typeof e=="string"&&/^\.\.?\//.test(e)?e.replace(/\.(tsx)$|((?:\.d)?)((?:\.[^./]+?)?)\.([cm]?)ts$/i,function(n,i,r,o,s){return i?t?".jsx":".js":r&&(!o||!s)?n:r+o+"."+s.toLowerCase()+"js"}):e}var ose,q7,X7,$kt,sse,Jkt,Zkt,sp=hs(()=>{ose=function(e,t){return ose=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var r in i)Object.prototype.hasOwnProperty.call(i,r)&&(n[r]=i[r])},ose(e,t)};q7=function(){return q7=Object.assign||function(t){for(var n,i=1,r=arguments.length;i<r;i++){n=arguments[i];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(t[o]=n[o])}return t},q7.apply(this,arguments)};X7=Object.create?(function(e,t,n,i){i===void 0&&(i=n);var r=Object.getOwnPropertyDescriptor(t,n);(!r||("get"in r?!t.__esModule:r.writable||r.configurable))&&(r={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,i,r)}):(function(e,t,n,i){i===void 0&&(i=n),e[i]=t[n]});$kt=Object.create?(function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}):function(e,t){e.default=t},sse=function(e){return sse=Object.getOwnPropertyNames||function(t){var n=[];for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(n[n.length]=i);return n},sse(e)};Jkt=typeof SuppressedError=="function"?SuppressedError:function(e,t,n){var i=new Error(n);return i.name="SuppressedError",i.error=e,i.suppressed=t,i};Zkt={__extends:EFe,__assign:q7,__rest:CFe,__decorate:vFe,__param:SFe,__esDecorate:wFe,__runInitializers:IFe,__propKey:PFe,__setFunctionName:DFe,__metadata:RFe,__awaiter:OFe,__generator:MFe,__createBinding:X7,__exportStar:NFe,__values:Y7,__read:ase,__spread:LFe,__spreadArrays:FFe,__spreadArray:BFe,__await:CP,__asyncGenerator:kFe,__asyncDelegator:UFe,__asyncValues:zFe,__makeTemplateObject:VFe,__importStar:jFe,__importDefault:HFe,__classPrivateFieldGet:GFe,__classPrivateFieldSet:WFe,__classPrivateFieldIn:qFe,__addDisposableResource:YFe,__disposeResources:XFe,__rewriteRelativeImportExtension:KFe}});var $Fe=Yi(K7=>{"use strict";Object.defineProperty(K7,"__esModule",{value:!0});K7.version=void 0;K7.version="4.1.5"});var Mb=Yi(Ob=>{"use strict";Object.defineProperty(Ob,"__esModule",{value:!0});Ob.hasOwnProperty=void 0;Ob.isBoolean=Qkt;Ob.ellipsis=e3t;Ob.removeWithPredicate=t3t;Ob.assertNever=n3t;Ob.hasOwnProperty=Object.prototype.hasOwnProperty;function Qkt(e){return typeof e=="boolean"}function e3t(e,t,n){var i;return e.length>t&&(n==null?(n="…",i=3):i=n.length,e=e.substring(0,t-i)+n),e}function t3t(e,t){for(var n=e.length-1;n>=0;n--)t(e[n])===!0&&e.splice(n,1)}function n3t(e){throw new Error("Unhandled case for value: '".concat(e,"'"))}});var $7=Yi(H0=>{"use strict";Object.defineProperty(H0,"__esModule",{value:!0});H0.HtmlTag=H0.whitespaceRe=void 0;var i3t=Mb();H0.whitespaceRe=/\s+/;var r3t=(function(){function e(t){t===void 0&&(t={}),this.tagName="",this.attrs={},this.innerHTML="",this.tagName=t.tagName||"",this.attrs=t.attrs||{},this.innerHTML=t.innerHtml||t.innerHTML||""}return e.prototype.setTagName=function(t){return this.tagName=t,this},e.prototype.getTagName=function(){return this.tagName},e.prototype.setAttr=function(t,n){var i=this.getAttrs();return i[t]=n,this},e.prototype.getAttr=function(t){return this.getAttrs()[t]},e.prototype.setAttrs=function(t){return Object.assign(this.getAttrs(),t),this},e.prototype.getAttrs=function(){return this.attrs},e.prototype.setClass=function(t){return this.setAttr("class",t)},e.prototype.addClass=function(t){for(var n=this.getClass(),i=n?n.split(H0.whitespaceRe):[],r=t.split(H0.whitespaceRe),o;o=r.shift();)i.indexOf(o)===-1&&i.push(o);return this.getAttrs().class=i.join(" "),this},e.prototype.removeClass=function(t){for(var n=this.getClass(),i=n?n.split(H0.whitespaceRe):[],r=t.split(H0.whitespaceRe),o;i.length&&(o=r.shift());){var s=i.indexOf(o);s!==-1&&i.splice(s,1)}return this.getAttrs().class=i.join(" "),this},e.prototype.getClass=function(){return this.getAttrs().class||""},e.prototype.hasClass=function(t){return(" "+this.getClass()+" ").indexOf(" "+t+" ")!==-1},e.prototype.setInnerHTML=function(t){return this.innerHTML=t,this},e.prototype.setInnerHtml=function(t){return this.setInnerHTML(t)},e.prototype.getInnerHTML=function(){return this.innerHTML||""},e.prototype.getInnerHtml=function(){return this.getInnerHTML()},e.prototype.toAnchorString=function(){var t=this.getTagName(),n=this.buildAttrsStr();return n=n?" "+n:"",["<",t,n,">",this.getInnerHtml(),"</",t,">"].join("")},e.prototype.buildAttrsStr=function(){var t=this.getAttrs(),n=[];for(var i in t)i3t.hasOwnProperty.call(t,i)&&n.push(i+'="'+t[i]+'"');return n.join(" ")},e})();H0.HtmlTag=r3t});var ZFe=Yi(lse=>{"use strict";Object.defineProperty(lse,"__esModule",{value:!0});lse.truncateSmart=o3t;function o3t(e,t,n){var i,r;if(n==null?(n="…",r=3,i=8):(r=n.length,i=n.length),e.length<=t)return e;var o=t-r,s=s3t(e);if(s.query){var a=s.query.match(/^(.*?)(?=(\?|#))(.*?)$/i);a&&(s.query=s.query.substr(0,a[1].length),e=JFe(s))}if(e.length<=t||(s.host&&(s.host=s.host.replace(/^www\./,""),e=JFe(s)),e.length<=t))return e;var c="";if(s.host&&(c+=s.host),c.length>=o)return s.host.length===t?(s.host.substr(0,t-r)+n).substr(0,o+i):cse(c,o,n).substr(0,o+i);var u="";if(s.path&&(u+="/"+s.path),s.query&&(u+="?"+s.query),u)if((c+u).length>=o){if((c+u).length==t)return(c+u).substr(0,t);var f=o-c.length;return(c+cse(u,f,n)).substr(0,o+i)}else c+=u;if(s.fragment){var d="#"+s.fragment;if((c+d).length>=o){if((c+d).length==t)return(c+d).substr(0,t);var p=o-c.length;return(c+cse(d,p,n)).substr(0,o+i)}else c+=d}if(s.scheme&&s.host){var g=s.scheme+"://";if((c+g).length<o)return(g+c).substr(0,t)}if(c.length<=t)return c;var m="";return o>0&&(m=c.substr(-1*Math.floor(o/2))),(c.substr(0,Math.ceil(o/2))+n+m).substr(0,o+i)}function s3t(e){var t={},n=e,i=n.match(/^([a-z]+):\/\//i);return i&&(t.scheme=i[1],n=n.slice(i[0].length)),i=n.match(/^(.*?)(?=(\?|#|\/|$))/i),i&&(t.host=i[1],n=n.slice(i[0].length)),i=n.match(/^\/(.*?)(?=(\?|#|$))/i),i&&(t.path=i[1],n=n.slice(i[0].length)),i=n.match(/^\?(.*?)(?=(#|$))/i),i&&(t.query=i[1],n=n.slice(i[0].length)),i=n.match(/^#(.*?)$/i),i&&(t.fragment=i[1]),t}function JFe(e){var t="";return e.scheme&&e.host&&(t+=e.scheme+"://"),e.host&&(t+=e.host),e.path&&(t+="/"+e.path),e.query&&(t+="?"+e.query),e.fragment&&(t+="#"+e.fragment),t}function cse(e,t,n){var i=t/2,r=Math.ceil(i),o=-1*Math.floor(i),s="";return o<0&&(s=e.substr(o)),e.substr(0,r)+n+s}});var QFe=Yi(use=>{"use strict";Object.defineProperty(use,"__esModule",{value:!0});use.truncateMiddle=a3t;function a3t(e,t,n){if(e.length<=t)return e;var i,r;n==null?(n="…",i=8,r=3):(i=n.length,r=n.length);var o=t-r,s="";return o>0&&(s=e.substr(-1*Math.floor(o/2))),(e.substr(0,Math.ceil(o/2))+n+s).substr(0,o+i)}});var eBe=Yi(fse=>{"use strict";Object.defineProperty(fse,"__esModule",{value:!0});fse.truncateEnd=l3t;var c3t=Mb();function l3t(e,t,n){return(0,c3t.ellipsis)(e,t,n)}});var dse=Yi(J7=>{"use strict";Object.defineProperty(J7,"__esModule",{value:!0});J7.AnchorTagBuilder=void 0;var u3t=$7(),f3t=ZFe(),d3t=QFe(),h3t=eBe(),m3t=(function(){function e(t){t===void 0&&(t={}),this.newWindow=!1,this.truncate={},this.className="",this.newWindow=t.newWindow||!1,this.truncate=t.truncate||{},this.className=t.className||""}return e.prototype.build=function(t){return new u3t.HtmlTag({tagName:"a",attrs:this.createAttrs(t),innerHtml:this.processAnchorText(t.getAnchorText())})},e.prototype.createAttrs=function(t){var n={href:t.getAnchorHref()},i=this.createCssClass(t);return i&&(n.class=i),this.newWindow&&(n.target="_blank",n.rel="noopener noreferrer"),this.truncate.length&&this.truncate.length<t.getAnchorText().length&&(n.title=t.getAnchorHref()),n},e.prototype.createCssClass=function(t){var n=this.className;if(n){for(var i=[n],r=t.getCssClassSuffixes(),o=0,s=r.length;o<s;o++)i.push(n+"-"+r[o]);return i.join(" ")}else return""},e.prototype.processAnchorText=function(t){return t=this.doTruncate(t),t},e.prototype.doTruncate=function(t){var n=this.truncate;if(!n.length)return t;var i=n.length,r=n.location;return r==="smart"?(0,f3t.truncateSmart)(t,i):r==="middle"?(0,d3t.truncateMiddle)(t,i):(0,h3t.truncateEnd)(t,i)},e})();J7.AnchorTagBuilder=m3t});var IC=Yi(Z7=>{"use strict";Object.defineProperty(Z7,"__esModule",{value:!0});Z7.AbstractMatch=void 0;var p3t=(function(){function e(t){this._=null,this.matchedText="",this.offset=0,this.tagBuilder=t.tagBuilder,this.matchedText=t.matchedText,this.offset=t.offset}return e.prototype.getMatchedText=function(){return this.matchedText},e.prototype.setOffset=function(t){this.offset=t},e.prototype.getOffset=function(){return this.offset},e.prototype.getCssClassSuffixes=function(){return[this.type]},e.prototype.buildTag=function(){return this.tagBuilder.build(this)},e})();Z7.AbstractMatch=p3t});var PC=Yi(hd=>{"use strict";Object.defineProperty(hd,"__esModule",{value:!0});hd.isControlChar=g3t;hd.isAsciiLetterChar=_3t;hd.isDigitChar=y3t;hd.isQuoteChar=A3t;hd.isWhitespaceChar=b3t;hd.isAlphaNumericOrMarkChar=x3t;hd.isValidEmailLocalPartSpecialChar=T3t;hd.isUrlSuffixAllowedSpecialChar=E3t;hd.isUrlSuffixNotAllowedAsFinalChar=C3t;hd.isOpenBraceChar=v3t;hd.isCloseBraceChar=S3t;function g3t(e){return e>=0&&e<=31||e==127}function _3t(e){return e>=65&&e<=90||e>=97&&e<=122}function y3t(e){return e>=48&&e<=57}function A3t(e){return e==34||e==39}function b3t(e){return e<8232?e<160?e>=9&&e<=13||e==32:e<5760?e==160:e==5760||e>=8192&&e<=8202:e<8287?e>=8232&&e<=8233||e==8239:e<12288?e==8287:e==12288||e==65279}function x3t(e){return e<4800?e<2949?e<2451?e<1425?e<768?e<192?e<169?e<65?e>=48&&e<=57:e>=65&&e<=90||e>=97&&e<=122:e<181?e>=169&&e<=170||e==174:e==181||e==186:e<710?e<216?e>=192&&e<=214:e>=216&&e<=246||e>=248&&e<=705:e<748?e>=710&&e<=721||e>=736&&e<=740:e==748||e==750:e<910?e<895?e<886?e>=768&&e<=884:e>=886&&e<=887||e>=890&&e<=893:e<904?e==895||e==902:e>=904&&e<=906||e==908:e<1155?e<931?e>=910&&e<=929:e>=931&&e<=1013||e>=1015&&e<=1153:e<1369?e>=1155&&e<=1327||e>=1329&&e<=1366:e==1369||e>=1377&&e<=1415:e<1808?e<1552?e<1476?e<1471?e>=1425&&e<=1469:e==1471||e>=1473&&e<=1474:e<1488?e>=1476&&e<=1477||e==1479:e>=1488&&e<=1514||e>=1520&&e<=1522:e<1749?e<1568?e>=1552&&e<=1562:e>=1568&&e<=1641||e>=1646&&e<=1747:e<1770?e>=1749&&e<=1756||e>=1759&&e<=1768:e>=1770&&e<=1788||e==1791:e<2230?e<2042?e<1869?e>=1808&&e<=1866:e>=1869&&e<=1969||e>=1984&&e<=2037:e<2112?e==2042||e>=2048&&e<=2093:e>=2112&&e<=2139||e>=2208&&e<=2228:e<2406?e<2260?e>=2230&&e<=2237:e>=2260&&e<=2273||e>=2275&&e<=2403:e<2437?e>=2406&&e<=2415||e>=2417&&e<=2435:e>=2437&&e<=2444||e>=2447&&e<=2448:e<2693?e<2579?e<2519?e<2486?e<2474?e>=2451&&e<=2472:e>=2474&&e<=2480||e==2482:e<2503?e>=2486&&e<=2489||e>=2492&&e<=2500:e>=2503&&e<=2504||e>=2507&&e<=2510:e<2534?e<2524?e==2519:e>=2524&&e<=2525||e>=2527&&e<=2531:e<2565?e>=2534&&e<=2545||e>=2561&&e<=2563:e>=2565&&e<=2570||e>=2575&&e<=2576:e<2631?e<2613?e<2602?e>=2579&&e<=2600:e>=2602&&e<=2608||e>=2610&&e<=2611:e<2620?e>=2613&&e<=2614||e>=2616&&e<=2617:e==2620||e>=2622&&e<=2626:e<2649?e<2635?e>=2631&&e<=2632:e>=2635&&e<=2637||e==2641:e<2662?e>=2649&&e<=2652||e==2654:e>=2662&&e<=2677||e>=2689&&e<=2691:e<2821?e<2759?e<2730?e<2703?e>=2693&&e<=2701:e>=2703&&e<=2705||e>=2707&&e<=2728:e<2741?e>=2730&&e<=2736||e>=2738&&e<=2739:e>=2741&&e<=2745||e>=2748&&e<=2757:e<2784?e<2763?e>=2759&&e<=2761:e>=2763&&e<=2765||e==2768:e<2809?e>=2784&&e<=2787||e>=2790&&e<=2799:e==2809||e>=2817&&e<=2819:e<2887?e<2858?e<2831?e>=2821&&e<=2828:e>=2831&&e<=2832||e>=2835&&e<=2856:e<2869?e>=2858&&e<=2864||e>=2866&&e<=2867:e>=2869&&e<=2873||e>=2876&&e<=2884:e<2911?e<2902?e>=2887&&e<=2888||e>=2891&&e<=2893:e>=2902&&e<=2903||e>=2908&&e<=2909:e<2929?e>=2911&&e<=2915||e>=2918&&e<=2927:e==2929||e>=2946&&e<=2947:e<3517?e<3205?e<3046?e<2984?e<2969?e<2958?e>=2949&&e<=2954:e>=2958&&e<=2960||e>=2962&&e<=2965:e<2974?e>=2969&&e<=2970||e==2972:e>=2974&&e<=2975||e>=2979&&e<=2980:e<3014?e<2990?e>=2984&&e<=2986:e>=2990&&e<=3001||e>=3006&&e<=3010:e<3024?e>=3014&&e<=3016||e>=3018&&e<=3021:e==3024||e==3031:e<3142?e<3086?e<3072?e>=3046&&e<=3055:e>=3072&&e<=3075||e>=3077&&e<=3084:e<3114?e>=3086&&e<=3088||e>=3090&&e<=3112:e>=3114&&e<=3129||e>=3133&&e<=3140:e<3160?e<3146?e>=3142&&e<=3144:e>=3146&&e<=3149||e>=3157&&e<=3158:e<3174?e>=3160&&e<=3162||e>=3168&&e<=3171:e>=3174&&e<=3183||e>=3200&&e<=3203:e<3333?e<3274?e<3242?e<3214?e>=3205&&e<=3212:e>=3214&&e<=3216||e>=3218&&e<=3240:e<3260?e>=3242&&e<=3251||e>=3253&&e<=3257:e>=3260&&e<=3268||e>=3270&&e<=3272:e<3296?e<3285?e>=3274&&e<=3277:e>=3285&&e<=3286||e==3294:e<3313?e>=3296&&e<=3299||e>=3302&&e<=3311:e>=3313&&e<=3314||e>=3329&&e<=3331:e<3423?e<3389?e<3342?e>=3333&&e<=3340:e>=3342&&e<=3344||e>=3346&&e<=3386:e<3402?e>=3389&&e<=3396||e>=3398&&e<=3400:e>=3402&&e<=3406||e>=3412&&e<=3415:e<3458?e<3430?e>=3423&&e<=3427:e>=3430&&e<=3439||e>=3450&&e<=3455:e<3482?e>=3458&&e<=3459||e>=3461&&e<=3478:e>=3482&&e<=3505||e>=3507&&e<=3515:e<3804?e<3722?e<3570?e<3535?e<3520?e==3517:e>=3520&&e<=3526||e==3530:e<3544?e>=3535&&e<=3540||e==3542:e>=3544&&e<=3551||e>=3558&&e<=3567:e<3664?e<3585?e>=3570&&e<=3571:e>=3585&&e<=3642||e>=3648&&e<=3662:e<3716?e>=3664&&e<=3673||e>=3713&&e<=3714:e==3716||e>=3719&&e<=3720:e<3754?e<3737?e<3725?e==3722:e==3725||e>=3732&&e<=3735:e<3749?e>=3737&&e<=3743||e>=3745&&e<=3747:e==3749||e==3751:e<3776?e<3757?e>=3754&&e<=3755:e>=3757&&e<=3769||e>=3771&&e<=3773:e<3784?e>=3776&&e<=3780||e==3782:e>=3784&&e<=3789||e>=3792&&e<=3801:e<4176?e<3902?e<3872?e<3840?e>=3804&&e<=3807:e==3840||e>=3864&&e<=3865:e<3895?e>=3872&&e<=3881||e==3893:e==3895||e==3897:e<3974?e<3913?e>=3902&&e<=3911:e>=3913&&e<=3948||e>=3953&&e<=3972:e<4038?e>=3974&&e<=3991||e>=3993&&e<=4028:e==4038||e>=4096&&e<=4169:e<4688?e<4301?e<4256?e>=4176&&e<=4253:e>=4256&&e<=4293||e==4295:e<4348?e==4301||e>=4304&&e<=4346:e>=4348&&e<=4680||e>=4682&&e<=4685:e<4746?e<4698?e>=4688&&e<=4694||e==4696:e>=4698&&e<=4701||e>=4704&&e<=4744:e<4786?e>=4746&&e<=4749||e>=4752&&e<=4784:e>=4786&&e<=4789||e>=4792&&e<=4798:e<11035?e<7416?e<6176?e<5873?e<4992?e<4824?e<4802?e==4800:e>=4802&&e<=4805||e>=4808&&e<=4822:e<4888?e>=4824&&e<=4880||e>=4882&&e<=4885:e>=4888&&e<=4954||e>=4957&&e<=4959:e<5121?e<5024?e>=4992&&e<=5007:e>=5024&&e<=5109||e>=5112&&e<=5117:e<5761?e>=5121&&e<=5740||e>=5743&&e<=5759:e>=5761&&e<=5786||e>=5792&&e<=5866:e<6002?e<5920?e<5888?e>=5873&&e<=5880:e>=5888&&e<=5900||e>=5902&&e<=5908:e<5984?e>=5920&&e<=5940||e>=5952&&e<=5971:e>=5984&&e<=5996||e>=5998&&e<=6e3:e<6108?e<6016?e>=6002&&e<=6003:e>=6016&&e<=6099||e==6103:e<6155?e>=6108&&e<=6109||e>=6112&&e<=6121:e>=6155&&e<=6157||e>=6160&&e<=6169:e<6783?e<6512?e<6400?e<6272?e>=6176&&e<=6263:e>=6272&&e<=6314||e>=6320&&e<=6389:e<6448?e>=6400&&e<=6430||e>=6432&&e<=6443:e>=6448&&e<=6459||e>=6470&&e<=6509:e<6608?e<6528?e>=6512&&e<=6516:e>=6528&&e<=6571||e>=6576&&e<=6601:e<6688?e>=6608&&e<=6617||e>=6656&&e<=6683:e>=6688&&e<=6750||e>=6752&&e<=6780:e<7040?e<6832?e<6800?e>=6783&&e<=6793:e>=6800&&e<=6809||e==6823:e<6992?e>=6832&&e<=6846||e>=6912&&e<=6987:e>=6992&&e<=7001||e>=7019&&e<=7027:e<7245?e<7168?e>=7040&&e<=7155:e>=7168&&e<=7223||e>=7232&&e<=7241:e<7376?e>=7245&&e<=7293||e>=7296&&e<=7304:e>=7376&&e<=7378||e>=7380&&e<=7414:e<8450?e<8130?e<8025?e<7960?e<7424?e>=7416&&e<=7417:e>=7424&&e<=7669||e>=7675&&e<=7957:e<8008?e>=7960&&e<=7965||e>=7968&&e<=8005:e>=8008&&e<=8013||e>=8016&&e<=8023:e<8031?e<8027?e==8025:e==8027||e==8029:e<8118?e>=8031&&e<=8061||e>=8064&&e<=8116:e>=8118&&e<=8124||e==8126:e<8205?e<8150?e<8134?e>=8130&&e<=8132:e>=8134&&e<=8140||e>=8144&&e<=8147:e<8178?e>=8150&&e<=8155||e>=8160&&e<=8172:e>=8178&&e<=8180||e>=8182&&e<=8188:e<8305?e<8252?e==8205:e==8252||e==8265:e<8336?e==8305||e==8319:e>=8336&&e<=8348||e>=8400&&e<=8432:e<8579?e<8486?e<8469?e<8455?e==8450:e==8455||e>=8458&&e<=8467:e<8482?e==8469||e>=8473&&e<=8477:e==8482||e==8484:e<8495?e<8488?e==8486:e==8488||e>=8490&&e<=8493:e<8517?e>=8495&&e<=8505||e>=8508&&e<=8511:e>=8517&&e<=8521||e==8526:e<9410?e<9e3?e<8592?e>=8579&&e<=8580:e>=8592&&e<=8703||e>=8986&&e<=8987:e<9193?e==9e3||e==9167:e>=9193&&e<=9203||e>=9208&&e<=9210:e<9723?e<9654?e==9410||e>=9642&&e<=9643:e==9654||e==9664:e<10548?e>=9723&&e<=9726||e>=9728&&e<=10175:e>=10548&&e<=10549||e>=11013&&e<=11015:e<43259?e<12445?e<11688?e<11520?e<11264?e<11088?e>=11035&&e<=11036:e==11088||e==11093:e<11360?e>=11264&&e<=11310||e>=11312&&e<=11358:e>=11360&&e<=11492||e>=11499&&e<=11507:e<11568?e<11559?e>=11520&&e<=11557:e==11559||e==11565:e<11647?e>=11568&&e<=11623||e==11631:e>=11647&&e<=11670||e>=11680&&e<=11686:e<11744?e<11712?e<11696?e>=11688&&e<=11694:e>=11696&&e<=11702||e>=11704&&e<=11710:e<11728?e>=11712&&e<=11718||e>=11720&&e<=11726:e>=11728&&e<=11734||e>=11736&&e<=11742:e<12330?e<11823?e>=11744&&e<=11775:e==11823||e>=12293&&e<=12294:e<12353?e>=12330&&e<=12341||e>=12347&&e<=12349:e>=12353&&e<=12438||e>=12441&&e<=12442:e<42512?e<12951?e<12549?e<12449?e>=12445&&e<=12447:e>=12449&&e<=12538||e>=12540&&e<=12543:e<12704?e>=12549&&e<=12589||e>=12593&&e<=12686:e>=12704&&e<=12730||e>=12784&&e<=12799:e<19968?e<12953?e==12951:e==12953||e>=13312&&e<=19893:e<42192?e>=19968&&e<=40917||e>=40960&&e<=42124:e>=42192&&e<=42237||e>=42240&&e<=42508:e<42891?e<42623?e<42560?e>=42512&&e<=42539:e>=42560&&e<=42610||e>=42612&&e<=42621:e<42775?e>=42623&&e<=42725||e>=42736&&e<=42737:e>=42775&&e<=42783||e>=42786&&e<=42888:e<43072?e<42928?e>=42891&&e<=42926:e>=42928&&e<=42935||e>=42999&&e<=43047:e<43216?e>=43072&&e<=43123||e>=43136&&e<=43205:e>=43216&&e<=43225||e>=43232&&e<=43255:e<55243?e<43744?e<43488?e<43312?e<43261?e==43259:e==43261||e>=43264&&e<=43309:e<43392?e>=43312&&e<=43347||e>=43360&&e<=43388:e>=43392&&e<=43456||e>=43471&&e<=43481:e<43600?e<43520?e>=43488&&e<=43518:e>=43520&&e<=43574||e>=43584&&e<=43597:e<43642?e>=43600&&e<=43609||e>=43616&&e<=43638:e>=43642&&e<=43714||e>=43739&&e<=43741:e<43824?e<43785?e<43762?e>=43744&&e<=43759:e>=43762&&e<=43766||e>=43777&&e<=43782:e<43808?e>=43785&&e<=43790||e>=43793&&e<=43798:e>=43808&&e<=43814||e>=43816&&e<=43822:e<44012?e<43868?e>=43824&&e<=43866:e>=43868&&e<=43877||e>=43888&&e<=44010:e<44032?e>=44012&&e<=44013||e>=44016&&e<=44025:e>=44032&&e<=55203||e>=55216&&e<=55238:e<64848?e<64298?e<64112?e<55296?e>=55243&&e<=55291:e>=55296&&e<=57343||e>=63744&&e<=64109:e<64275?e>=64112&&e<=64217||e>=64256&&e<=64262:e>=64275&&e<=64279||e>=64285&&e<=64296:e<64320?e<64312?e>=64298&&e<=64310:e>=64312&&e<=64316||e==64318:e<64326?e>=64320&&e<=64321||e>=64323&&e<=64324:e>=64326&&e<=64433||e>=64467&&e<=64829:e<65296?e<65024?e<64914?e>=64848&&e<=64911:e>=64914&&e<=64967||e>=65008&&e<=65019:e<65136?e>=65024&&e<=65039||e>=65056&&e<=65071:e>=65136&&e<=65140||e>=65142&&e<=65276:e<65474?e<65345?e>=65296&&e<=65305||e>=65313&&e<=65338:e>=65345&&e<=65370||e>=65382&&e<=65470:e<65490?e>=65474&&e<=65479||e>=65482&&e<=65487:e>=65490&&e<=65495||e>=65498&&e<=65500}function T3t(e){return e<47?e<42?e==33||e>=35&&e<=39:e>=42&&e<=43||e==45:e<63?e==47||e==61:e<94?e==63:e>=94&&e<=96||e>=123&&e<=126}function E3t(e){return e<91?e<47?e>=35&&e<=43||e==45:e<61?e==47:e==61||e==64:e<95?e==91||e==93:e<123?e==95:e>=123&&e<=126||e==10003}function C3t(e){return e<58?e<44?e==33:e==44||e==46:e<63?e>=58&&e<=59:e==63||e==94}function v3t(e){return e<91?e==40:e==91||e==123}function S3t(e){return e<93?e==41:e==93||e==125}});var tBe=Yi(Q7=>{"use strict";Object.defineProperty(Q7,"__esModule",{value:!0});Q7.tldRegex=void 0;Q7.tldRegex=/^(?:xn--vermgensberatung-pwb|xn--vermgensberater-ctb|xn--clchc0ea0b2g2a9gcd|xn--w4r85el8fhu5dnra|travelersinsurance|vermögensberatung|xn--5su34j936bgsg|xn--bck1b9a5dre4c|xn--mgbah1a3hjkrd|xn--mgbai9azgqp6j|xn--mgberp4a5d4ar|xn--xkc2dl3a5ee0h|vermögensberater|xn--fzys8d69uvgm|xn--mgba7c0bbn0a|xn--mgbcpq6gpa1a|xn--xkc2al3hye2a|americanexpress|kerryproperties|sandvikcoromant|xn--i1b6b1a6a2e|xn--kcrx77d1x4a|xn--lgbbat1ad8j|xn--mgba3a4f16a|xn--mgbc0a9azcg|xn--nqv7fs00ema|americanfamily|weatherchannel|xn--54b7fta0cc|xn--6qq986b3xl|xn--80aqecdr1a|xn--b4w605ferd|xn--fiq228c5hs|xn--h2breg3eve|xn--jlq480n2rg|xn--mgba3a3ejt|xn--mgbaam7a8h|xn--mgbayh7gpa|xn--mgbbh1a71e|xn--mgbca7dzdo|xn--mgbi4ecexp|xn--mgbx4cd0ab|xn--rvc1e0am3e|international|lifeinsurance|wolterskluwer|xn--cckwcxetd|xn--eckvdtc9d|xn--fpcrj9c3d|xn--fzc2c9e2c|xn--h2brj9c8c|xn--tiq49xqyj|xn--yfro4i67o|xn--ygbi2ammx|construction|lplfinancial|scholarships|versicherung|xn--3e0b707e|xn--45br5cyl|xn--4dbrk0ce|xn--80adxhks|xn--80asehdb|xn--8y0a063a|xn--gckr3f0f|xn--mgb9awbf|xn--mgbab2bd|xn--mgbgu82a|xn--mgbpl2fh|xn--mgbt3dhd|xn--mk1bu44c|xn--ngbc5azd|xn--ngbe9e0a|xn--ogbpf8fl|xn--qcka1pmc|accountants|barclaycard|blackfriday|blockbuster|bridgestone|calvinklein|contractors|creditunion|engineering|enterprises|investments|kerryhotels|lamborghini|motorcycles|olayangroup|photography|playstation|productions|progressive|redumbrella|williamhill|xn--11b4c3d|xn--1ck2e1b|xn--1qqw23a|xn--2scrj9c|xn--3bst00m|xn--3ds443g|xn--3hcrj9c|xn--42c2d9a|xn--45brj9c|xn--55qw42g|xn--6frz82g|xn--80ao21a|xn--9krt00a|xn--cck2b3b|xn--czr694b|xn--d1acj3b|xn--efvy88h|xn--fct429k|xn--fjq720a|xn--flw351e|xn--g2xx48c|xn--gecrj9c|xn--gk3at1e|xn--h2brj9c|xn--hxt814e|xn--imr513n|xn--j6w193g|xn--jvr189m|xn--kprw13d|xn--kpry57d|xn--mgbbh1a|xn--mgbtx2b|xn--mix891f|xn--nyqy26a|xn--otu796d|xn--pgbs0dh|xn--q9jyb4c|xn--rhqv96g|xn--rovu88b|xn--s9brj9c|xn--ses554g|xn--t60b56a|xn--vuq861b|xn--w4rs40l|xn--xhq521b|xn--zfr164b|சிங்கப்பூர்|accountant|apartments|associates|basketball|bnpparibas|boehringer|capitalone|consulting|creditcard|cuisinella|eurovision|extraspace|foundation|healthcare|immobilien|industries|management|mitsubishi|nextdirect|properties|protection|prudential|realestate|republican|restaurant|schaeffler|tatamotors|technology|university|vlaanderen|xn--30rr7y|xn--3pxu8k|xn--45q11c|xn--4gbrim|xn--55qx5d|xn--5tzm5g|xn--80aswg|xn--90a3ac|xn--9dbq2a|xn--9et52u|xn--c2br7g|xn--cg4bki|xn--czrs0t|xn--czru2d|xn--fiq64b|xn--fiqs8s|xn--fiqz9s|xn--io0a7i|xn--kput3i|xn--mxtq1m|xn--o3cw4h|xn--pssy2u|xn--q7ce6a|xn--unup4y|xn--wgbh1c|xn--wgbl6a|xn--y9a3aq|accenture|allfinanz|amsterdam|analytics|aquarelle|barcelona|bloomberg|christmas|community|directory|education|equipment|fairwinds|financial|firestone|fresenius|furniture|goldpoint|hisamitsu|homedepot|homegoods|homesense|institute|insurance|kuokgroup|landrover|lifestyle|marketing|marshalls|melbourne|microsoft|panasonic|pramerica|richardli|shangrila|solutions|statebank|statefarm|stockholm|travelers|vacations|xn--90ais|xn--c1avg|xn--d1alf|xn--e1a4c|xn--fhbei|xn--j1aef|xn--j1amh|xn--l1acc|xn--ngbrx|xn--nqv7f|xn--p1acf|xn--qxa6a|xn--tckwe|xn--vhquv|yodobashi|موريتانيا|abudhabi|airforce|allstate|attorney|barclays|barefoot|bargains|baseball|boutique|bradesco|broadway|brussels|builders|business|capetown|catering|catholic|cipriani|cleaning|clinique|clothing|commbank|computer|delivery|deloitte|democrat|diamonds|discount|discover|download|engineer|ericsson|exchange|feedback|fidelity|firmdale|football|frontier|goodyear|grainger|graphics|hdfcbank|helsinki|holdings|hospital|infiniti|ipiranga|istanbul|jpmorgan|lighting|lundbeck|marriott|mckinsey|memorial|merckmsd|mortgage|observer|partners|pharmacy|pictures|plumbing|property|redstone|reliance|saarland|samsclub|security|services|shopping|softbank|software|stcgroup|supplies|training|vanguard|ventures|verisign|woodside|xn--90ae|xn--node|xn--p1ai|xn--qxam|yokohama|السعودية|abogado|academy|agakhan|alibaba|android|athleta|auction|audible|auspost|banamex|bauhaus|bestbuy|booking|brother|capital|caravan|careers|channel|charity|chintai|citadel|clubmed|college|cologne|company|compare|contact|cooking|corsica|country|coupons|courses|cricket|cruises|dentist|digital|domains|exposed|express|farmers|fashion|ferrari|ferrero|finance|fishing|fitness|flights|florist|flowers|forsale|frogans|fujitsu|gallery|genting|godaddy|grocery|guitars|hamburg|hangout|hitachi|holiday|hosting|hotmail|hyundai|ismaili|jewelry|juniper|kitchen|komatsu|lacaixa|lanxess|lasalle|latrobe|leclerc|limited|lincoln|markets|monster|netbank|netflix|network|neustar|okinawa|organic|origins|philips|pioneer|politie|realtor|recipes|rentals|reviews|rexroth|samsung|sandvik|schmidt|schwarz|science|shiksha|singles|staples|storage|support|surgery|systems|temasek|theater|theatre|tickets|toshiba|trading|walmart|wanggou|watches|weather|website|wedding|whoswho|windows|winners|yamaxun|youtube|zuerich|католик|البحرين|الجزائر|العليان|پاکستان|كاثوليك|இந்தியா|abbott|abbvie|africa|agency|airbus|airtel|alipay|alsace|alstom|amazon|anquan|aramco|author|bayern|beauty|berlin|bharti|bostik|boston|broker|camera|career|casino|center|chanel|chrome|church|circle|claims|clinic|coffee|comsec|condos|coupon|credit|cruise|dating|datsun|dealer|degree|dental|design|direct|doctor|dunlop|dupont|durban|emerck|energy|estate|events|expert|family|flickr|futbol|gallup|garden|george|giving|global|google|gratis|health|hermes|hiphop|hockey|hotels|hughes|imamat|insure|intuit|jaguar|joburg|juegos|kaufen|kindle|kosher|latino|lawyer|lefrak|living|locker|london|luxury|madrid|maison|makeup|market|mattel|mobile|monash|mormon|moscow|museum|nagoya|nissan|nissay|norton|nowruz|office|olayan|online|oracle|orange|otsuka|pfizer|photos|physio|pictet|quebec|racing|realty|reisen|repair|report|review|rogers|ryukyu|safety|sakura|sanofi|school|schule|search|secure|select|shouji|soccer|social|stream|studio|supply|suzuki|swatch|sydney|taipei|taobao|target|tattoo|tennis|tienda|tjmaxx|tkmaxx|toyota|travel|unicom|viajes|viking|villas|virgin|vision|voting|voyage|walter|webcam|xihuan|yachts|yandex|zappos|москва|онлайн|ابوظبي|ارامكو|الاردن|المغرب|امارات|فلسطين|مليسيا|भारतम्|இலங்கை|ファッション|actor|adult|aetna|amfam|amica|apple|archi|audio|autos|azure|baidu|beats|bible|bingo|black|boats|bosch|build|canon|cards|chase|cheap|cisco|citic|click|cloud|coach|codes|crown|cymru|dance|deals|delta|drive|dubai|earth|edeka|email|epson|faith|fedex|final|forex|forum|gallo|games|gifts|gives|glass|globo|gmail|green|gripe|group|gucci|guide|homes|honda|horse|house|hyatt|ikano|irish|jetzt|koeln|kyoto|lamer|lease|legal|lexus|lilly|loans|locus|lotte|lotto|mango|media|miami|money|movie|music|nexus|nikon|ninja|nokia|nowtv|omega|osaka|paris|parts|party|phone|photo|pizza|place|poker|praxi|press|prime|promo|quest|radio|rehab|reise|ricoh|rocks|rodeo|rugby|salon|sener|seven|sharp|shell|shoes|skype|sling|smart|smile|solar|space|sport|stada|store|study|style|sucks|swiss|tatar|tires|tirol|tmall|today|tokyo|tools|toray|total|tours|trade|trust|tunes|tushu|ubank|vegas|video|vodka|volvo|wales|watch|weber|weibo|works|world|xerox|yahoo|ישראל|ایران|بازار|بھارت|سودان|سورية|همراه|भारोत|संगठन|বাংলা|భారత్|ഭാരതം|嘉里大酒店|aarp|able|aero|akdn|ally|amex|arab|army|arpa|arte|asda|asia|audi|auto|baby|band|bank|bbva|beer|best|bike|bing|blog|blue|bofa|bond|book|buzz|cafe|call|camp|care|cars|casa|case|cash|cbre|cern|chat|citi|city|club|cool|coop|cyou|data|date|dclk|deal|dell|desi|diet|dish|docs|dvag|erni|fage|fail|fans|farm|fast|fido|film|fire|fish|flir|food|ford|free|fund|game|gbiz|gent|ggee|gift|gmbh|gold|golf|goog|guge|guru|hair|haus|hdfc|help|here|host|hsbc|icbc|ieee|imdb|immo|info|itau|java|jeep|jobs|jprs|kddi|kids|kiwi|kpmg|kred|land|lego|lgbt|lidl|life|like|limo|link|live|loan|love|ltda|luxe|maif|meet|meme|menu|mini|mint|mobi|moda|moto|name|navy|news|next|nico|nike|ollo|open|page|pars|pccw|pics|ping|pink|play|plus|pohl|porn|post|prod|prof|qpon|read|reit|rent|rest|rich|room|rsvp|ruhr|safe|sale|sarl|save|saxo|scot|seat|seek|sexy|shia|shop|show|silk|sina|site|skin|sncf|sohu|song|sony|spot|star|surf|talk|taxi|team|tech|teva|tiaa|tips|town|toys|tube|vana|visa|viva|vivo|vote|voto|wang|weir|wien|wiki|wine|work|xbox|yoga|zara|zero|zone|дети|сайт|بارت|بيتك|ڀارت|تونس|شبكة|عراق|عمان|موقع|भारत|ভারত|ভাৰত|ਭਾਰਤ|ભારત|ଭାରତ|ಭಾರತ|ලංකා|アマゾン|グーグル|クラウド|ポイント|组织机构|電訊盈科|香格里拉|aaa|abb|abc|aco|ads|aeg|afl|aig|anz|aol|app|art|aws|axa|bar|bbc|bbt|bcg|bcn|bet|bid|bio|biz|bms|bmw|bom|boo|bot|box|buy|bzh|cab|cal|cam|car|cat|cba|cbn|ceo|cfa|cfd|com|cpa|crs|dad|day|dds|dev|dhl|diy|dnp|dog|dot|dtv|dvr|eat|eco|edu|esq|eus|fan|fit|fly|foo|fox|frl|ftr|fun|fyi|gal|gap|gay|gdn|gea|gle|gmo|gmx|goo|gop|got|gov|hbo|hiv|hkt|hot|how|ibm|ice|icu|ifm|inc|ing|ink|int|ist|itv|jcb|jio|jll|jmp|jnj|jot|joy|kfh|kia|kim|kpn|krd|lat|law|lds|llc|llp|lol|lpl|ltd|man|map|mba|med|men|mil|mit|mlb|mls|mma|moe|moi|mom|mov|msd|mtn|mtr|nab|nba|nec|net|new|nfl|ngo|nhk|now|nra|nrw|ntt|nyc|obi|one|ong|onl|ooo|org|ott|ovh|pay|pet|phd|pid|pin|pnc|pro|pru|pub|pwc|red|ren|ril|rio|rip|run|rwe|sap|sas|sbi|sbs|scb|sew|sex|sfr|ski|sky|soy|spa|srl|stc|tab|tax|tci|tdk|tel|thd|tjx|top|trv|tui|tvs|ubs|uno|uol|ups|vet|vig|vin|vip|wed|win|wme|wow|wtc|wtf|xin|xxx|xyz|you|yun|zip|бел|ком|қаз|мкд|мон|орг|рус|срб|укр|հայ|קום|عرب|قطر|كوم|مصر|कॉम|नेट|คอม|ไทย|ລາວ|ストア|セール|みんな|中文网|亚马逊|天主教|我爱你|新加坡|淡马锡|飞利浦|ac|ad|ae|af|ag|ai|al|am|ao|aq|ar|as|at|au|aw|ax|az|ba|bb|bd|be|bf|bg|bh|bi|bj|bm|bn|bo|br|bs|bt|bv|bw|by|bz|ca|cc|cd|cf|cg|ch|ci|ck|cl|cm|cn|co|cr|cu|cv|cw|cx|cy|cz|de|dj|dk|dm|do|dz|ec|ee|eg|er|es|et|eu|fi|fj|fk|fm|fo|fr|ga|gb|gd|ge|gf|gg|gh|gi|gl|gm|gn|gp|gq|gr|gs|gt|gu|gw|gy|hk|hm|hn|hr|ht|hu|id|ie|il|im|in|io|iq|ir|is|it|je|jm|jo|jp|ke|kg|kh|ki|km|kn|kp|kr|kw|ky|kz|la|lb|lc|li|lk|lr|ls|lt|lu|lv|ly|ma|mc|md|me|mg|mh|mk|ml|mm|mn|mo|mp|mq|mr|ms|mt|mu|mv|mw|mx|my|mz|na|nc|ne|nf|ng|ni|nl|no|np|nr|nu|nz|om|pa|pe|pf|pg|ph|pk|pl|pm|pn|pr|ps|pt|pw|py|qa|re|ro|rs|ru|rw|sa|sb|sc|sd|se|sg|sh|si|sj|sk|sl|sm|sn|so|sr|ss|st|su|sv|sx|sy|sz|tc|td|tf|tg|th|tj|tk|tl|tm|tn|to|tr|tt|tv|tw|tz|ua|ug|uk|us|uy|uz|va|vc|ve|vg|vi|vn|vu|wf|ws|ye|yt|za|zm|zw|ελ|ευ|бг|ею|рф|გე|닷넷|닷컴|삼성|한국|コム|世界|中信|中国|中國|企业|佛山|信息|健康|八卦|公司|公益|台湾|台灣|商城|商店|商标|嘉里|在线|大拿|娱乐|家電|广东|微博|慈善|手机|招聘|政务|政府|新闻|时尚|書籍|机构|游戏|澳門|点看|移动|网址|网店|网站|网络|联通|谷歌|购物|通販|集团|食品|餐厅|香港)$/});var eW=Yi(eo=>{"use strict";Object.defineProperty(eo,"__esModule",{value:!0});eo.isDomainLabelStartChar=eo.isSchemeStartChar=eo.tldUrlHostRe=eo.schemeUrlRe=eo.invalidSchemeRe=eo.httpSchemePrefixRe=eo.httpSchemeRe=void 0;eo.isSchemeChar=I3t;eo.isDomainLabelChar=P3t;eo.isPathChar=D3t;eo.isUrlSuffixStartChar=R3t;eo.isKnownTld=nBe;eo.isValidSchemeUrl=O3t;eo.isValidTldMatch=M3t;eo.isValidIpV4Address=F3t;var DC=PC(),w3t=tBe();eo.httpSchemeRe=/https?:\/\//i;eo.httpSchemePrefixRe=new RegExp("^"+eo.httpSchemeRe.source,"i");eo.invalidSchemeRe=/^(javascript|vbscript):/i;eo.schemeUrlRe=/^[A-Za-z][-.+A-Za-z0-9]*:(\/\/)?([^:/]*)/;eo.tldUrlHostRe=/^(?:\/\/)?([^/#?:]+)/;eo.isSchemeStartChar=DC.isAsciiLetterChar;function I3t(e){return(0,DC.isAsciiLetterChar)(e)||(0,DC.isDigitChar)(e)||e===43||e===45||e===46}eo.isDomainLabelStartChar=DC.isAlphaNumericOrMarkChar;function P3t(e){return e===95||(0,eo.isDomainLabelStartChar)(e)}function D3t(e){return(0,DC.isAlphaNumericOrMarkChar)(e)||(0,DC.isUrlSuffixAllowedSpecialChar)(e)||(0,DC.isUrlSuffixNotAllowedAsFinalChar)(e)}function R3t(e){return e===47||e===63||e===35}function nBe(e){return w3t.tldRegex.test(e.toLowerCase())}function O3t(e){if(eo.invalidSchemeRe.test(e))return!1;var t=e.match(eo.schemeUrlRe);if(!t)return!1;var n=!!t[1],i=t[2];return n?!0:!(i.indexOf(".")===-1||!/[A-Za-z]/.test(i))}function M3t(e){var t=e.match(eo.tldUrlHostRe);if(!t)return!1;var n=t[0],i=n.split(".");if(i.length<2)return!1;var r=i[i.length-1];return!!nBe(r)}var N3t=/^(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$/,L3t=/[:/?#]/;function F3t(e){var t=e.split(L3t,1)[0];return N3t.test(t)}});var hse=Yi(tW=>{"use strict";Object.defineProperty(tW,"__esModule",{value:!0});tW.UrlMatch=void 0;var B3t=(sp(),Fh(op)),k3t=IC(),U3t=eW(),z3t=/^(https?:\/\/)?(?:www\.)?/i,V3t=/^\/\//,j3t=(function(e){B3t.__extends(t,e);function t(n){var i=e.call(this,n)||this;return i.type="url",i.url="",i.urlMatchType="scheme",i.protocolRelativeMatch=!1,i.stripPrefix={scheme:!0,www:!0},i.stripTrailingSlash=!0,i.decodePercentEncoding=!0,i.protocolPrepended=!1,i.urlMatchType=n.urlMatchType,i.url=n.url,i.protocolRelativeMatch=n.protocolRelativeMatch,i.stripPrefix=n.stripPrefix,i.stripTrailingSlash=n.stripTrailingSlash,i.decodePercentEncoding=n.decodePercentEncoding,i}return t.prototype.getType=function(){return"url"},t.prototype.getUrlMatchType=function(){return this.urlMatchType},t.prototype.getUrl=function(){var n=this.url;return!this.protocolRelativeMatch&&this.urlMatchType!=="scheme"&&!this.protocolPrepended&&(n=this.url="http://"+n,this.protocolPrepended=!0),n},t.prototype.getAnchorHref=function(){var n=this.getUrl();return n.replace(/&/g,"&")},t.prototype.getAnchorText=function(){var n=this.getMatchedText();return this.protocolRelativeMatch&&(n=W3t(n)),this.stripPrefix.scheme&&(n=H3t(n)),this.stripPrefix.www&&(n=G3t(n)),this.stripTrailingSlash&&(n=q3t(n)),this.decodePercentEncoding&&(n=Y3t(n)),n},t})(k3t.AbstractMatch);tW.UrlMatch=j3t;function H3t(e){return e.replace(U3t.httpSchemePrefixRe,"")}function G3t(e){return e.includes("www.")?e.replace(z3t,"$1"):e}function W3t(e){return e.replace(V3t,"")}function q3t(e){return e.charAt(e.length-1)==="/"&&(e=e.slice(0,-1)),e}function Y3t(e){var t=e.replace(/%(?:22|26|27|3C|3E)/gi,function(n){return n==="%22"?""":n==="%26"?"&":n==="%27"?"'":n==="%3C"||n==="%3c"?"<":">"});if(t.includes("%"))try{return decodeURIComponent(t)}catch{}return t}});var rBe=Yi(fy=>{"use strict";Object.defineProperty(fy,"__esModule",{value:!0});fy.isEmailLocalPartStartChar=fy.mailtoSchemePrefixRe=void 0;fy.isEmailLocalPartChar=K3t;fy.isValidEmail=$3t;var iBe=PC(),X3t=eW();fy.mailtoSchemePrefixRe=/^mailto:/i;fy.isEmailLocalPartStartChar=iBe.isAlphaNumericOrMarkChar;function K3t(e){return(0,fy.isEmailLocalPartStartChar)(e)||(0,iBe.isValidEmailLocalPartSpecialChar)(e)}function $3t(e){var t=e.split(".").pop();return(0,X3t.isKnownTld)(t)}});var mse=Yi(nW=>{"use strict";Object.defineProperty(nW,"__esModule",{value:!0});nW.EmailMatch=void 0;var J3t=(sp(),Fh(op)),Z3t=IC(),Q3t=(function(e){J3t.__extends(t,e);function t(n){var i=e.call(this,n)||this;return i.type="email",i.email="",i.email=n.email,i}return t.prototype.getType=function(){return"email"},t.prototype.getEmail=function(){return this.email},t.prototype.getAnchorHref=function(){return"mailto:"+this.email},t.prototype.getAnchorText=function(){return this.email},t})(Z3t.AbstractMatch);nW.EmailMatch=Q3t});var pse=Yi(vP=>{"use strict";Object.defineProperty(vP,"__esModule",{value:!0});vP.hashtagServices=void 0;vP.isHashtagTextChar=tUt;vP.isValidHashtag=nUt;var eUt=PC();function tUt(e){return e===95||(0,eUt.isAlphaNumericOrMarkChar)(e)}function nUt(e){return e.length<=140}vP.hashtagServices=["twitter","facebook","instagram","tiktok","youtube"]});var gse=Yi(iW=>{"use strict";Object.defineProperty(iW,"__esModule",{value:!0});iW.HashtagMatch=void 0;var iUt=(sp(),Fh(op)),rUt=Mb(),oUt=IC(),sUt=(function(e){iUt.__extends(t,e);function t(n){var i=e.call(this,n)||this;return i.type="hashtag",i.serviceName="twitter",i.hashtag="",i.serviceName=n.serviceName,i.hashtag=n.hashtag,i}return t.prototype.getType=function(){return"hashtag"},t.prototype.getServiceName=function(){return this.serviceName},t.prototype.getHashtag=function(){return this.hashtag},t.prototype.getAnchorHref=function(){var n=this.serviceName,i=this.hashtag;switch(n){case"twitter":return"https://twitter.com/hashtag/"+i;case"facebook":return"https://www.facebook.com/hashtag/"+i;case"instagram":return"https://instagram.com/explore/tags/"+i;case"tiktok":return"https://www.tiktok.com/tag/"+i;case"youtube":return"https://youtube.com/hashtag/"+i;default:(0,rUt.assertNever)(n)}},t.prototype.getAnchorText=function(){return"#"+this.hashtag},t.prototype.getCssClassSuffixes=function(){var n=e.prototype.getCssClassSuffixes.call(this),i=this.getServiceName();return i&&n.push(i),n},t})(oUt.AbstractMatch);iW.HashtagMatch=sUt});var _se=Yi(SP=>{"use strict";Object.defineProperty(SP,"__esModule",{value:!0});SP.mentionServices=void 0;SP.isMentionTextChar=cUt;SP.isValidMention=lUt;var oBe=PC(),aUt={twitter:/^@\w{1,15}$/,instagram:/^@[_\w]{1,30}$/,soundcloud:/^@[-a-z0-9_]{3,25}$/,tiktok:/^@[.\w]{1,23}[\w]$/,youtube:/^@[-.·\w]{3,30}$/};function cUt(e){return e===45||e===46||e===95||(0,oBe.isAsciiLetterChar)(e)||(0,oBe.isDigitChar)(e)}function lUt(e,t){var n=aUt[t];return n.test(e)}SP.mentionServices=["twitter","instagram","soundcloud","tiktok","youtube"]});var yse=Yi(rW=>{"use strict";Object.defineProperty(rW,"__esModule",{value:!0});rW.MentionMatch=void 0;var uUt=(sp(),Fh(op)),fUt=Mb(),dUt=IC(),hUt=(function(e){uUt.__extends(t,e);function t(n){var i=e.call(this,n)||this;return i.type="mention",i.serviceName="twitter",i.mention="",i.mention=n.mention,i.serviceName=n.serviceName,i}return t.prototype.getType=function(){return"mention"},t.prototype.getMention=function(){return this.mention},t.prototype.getServiceName=function(){return this.serviceName},t.prototype.getAnchorHref=function(){switch(this.serviceName){case"twitter":return"https://twitter.com/"+this.mention;case"instagram":return"https://instagram.com/"+this.mention;case"soundcloud":return"https://soundcloud.com/"+this.mention;case"tiktok":return"https://www.tiktok.com/@"+this.mention;case"youtube":return"https://youtube.com/@"+this.mention;default:(0,fUt.assertNever)(this.serviceName)}},t.prototype.getAnchorText=function(){return"@"+this.mention},t.prototype.getCssClassSuffixes=function(){var n=e.prototype.getCssClassSuffixes.call(this),i=this.getServiceName();return i&&n.push(i),n},t})(dUt.AbstractMatch);rW.MentionMatch=hUt});var sBe=Yi(_4=>{"use strict";Object.defineProperty(_4,"__esModule",{value:!0});_4.isPhoneNumberSeparatorChar=yUt;_4.isPhoneNumberControlChar=AUt;_4.isValidPhoneNumber=bUt;var mUt=/[-. ()]/,pUt=/(?:(?:(?:(\+)?\d{1,3}[-. ]?)?\(?\d{3}\)?[-. ]?\d{3}[-. ]?\d{4})|(?:(\+)(?:9[976]\d|8[987530]\d|6[987]\d|5[90]\d|42\d|3[875]\d|2[98654321]\d|9[8543210]|8[6421]|6[6543210]|5[87654321]|4[987654310]|3[9643210]|2[70]|7|1)[-. ]?(?:\d[-. ]?){6,12}\d+))([,;]+[0-9]+#?)*/,gUt=/(0([1-9]-?[1-9]\d{3}|[1-9]{2}-?\d{3}|[1-9]{2}\d{1}-?\d{2}|[1-9]{2}\d{2}-?\d{1})-?\d{4}|0[789]0-?\d{4}-?\d{4}|050-?\d{4}-?\d{4})/,_Ut=new RegExp("^".concat(pUt.source,"|").concat(gUt.source,"$"));function yUt(e){return e===45||e===46||e===32}function AUt(e){return e===44||e===59}function bUt(e){var t=e.charAt(0)==="+"||mUt.test(e);return t&&_Ut.test(e)}});var Ase=Yi(oW=>{"use strict";Object.defineProperty(oW,"__esModule",{value:!0});oW.PhoneMatch=void 0;var xUt=(sp(),Fh(op)),TUt=IC(),EUt=(function(e){xUt.__extends(t,e);function t(n){var i=e.call(this,n)||this;return i.type="phone",i.number="",i.plusSign=!1,i.number=n.number,i.plusSign=n.plusSign,i}return t.prototype.getType=function(){return"phone"},t.prototype.getPhoneNumber=function(){return this.number},t.prototype.getNumber=function(){return this.getPhoneNumber()},t.prototype.getAnchorHref=function(){return"tel:"+(this.plusSign?"+":"")+this.number},t.prototype.getAnchorText=function(){return this.matchedText},t})(TUt.AbstractMatch);oW.PhoneMatch=EUt});var Cse=Yi(lW=>{"use strict";Object.defineProperty(lW,"__esModule",{value:!0});lW.parseMatches=DUt;lW.excludeUnbalancedTrailingBracesAndPunctuation=lBe;var CUt=hse(),sW=Mb(),zo=eW(),wP=rBe(),vUt=mse(),Tse=pse(),SUt=gse(),Ese=_se(),wUt=yse(),IP=sBe(),IUt=Ase(),ca=PC(),PUt=(function(){function e(t,n){this.charIdx=0,this.matches=[],this._stateMachines=[],this.schemeUrlMachinesCount=0,this.text=t,this.tagBuilder=n.tagBuilder,this.stripPrefix=n.stripPrefix,this.stripTrailingSlash=n.stripTrailingSlash,this.decodePercentEncoding=n.decodePercentEncoding,this.hashtagServiceName=n.hashtagServiceName,this.mentionServiceName=n.mentionServiceName}return Object.defineProperty(e.prototype,"stateMachines",{get:function(){return this._stateMachines},enumerable:!1,configurable:!0}),e.prototype.addMachine=function(t){this._stateMachines.push(t),cBe(t)&&this.schemeUrlMachinesCount++},e.prototype.removeMachine=function(t){this._stateMachines=this._stateMachines.filter(function(n){return n!==t}),cBe(t)&&this.schemeUrlMachinesCount--},e.prototype.hasSchemeUrlMachine=function(){return this.schemeUrlMachinesCount>0},e})();function DUt(e,t){for(var n=new PUt(e,t);n.charIdx<n.text.length;n.charIdx++){var i=e.charAt(n.charIdx),r=e.charCodeAt(n.charIdx);if(n.stateMachines.length===0)aW(n,i,r);else{for(var o=n.stateMachines.length-1;o>=0;o--){var s=n.stateMachines[o];switch(s.state){case 11:FUt(n,s,r);break;case 12:BUt(n,s,r);break;case 0:RUt(n,s,r);break;case 1:OUt(n,s,r);break;case 2:MUt(n,s,r);break;case 3:NUt(n,s,r);break;case 4:LUt(n,s,i,r);break;case 5:kUt(n,s,r);break;case 6:UUt(n,s,i,r);break;case 7:zUt(n,s,i,r);break;case 13:VUt(n,s,r);break;case 14:jUt(n,s,r);break;case 8:HUt(n,s,r);break;case 9:GUt(n,s,r);break;case 10:WUt(n,s,r);break;case 15:qUt(n,s,i,r);break;case 16:YUt(n,s,i,r);break;case 17:XUt(n,s,i,r);break;case 18:KUt(n,s,i,r);break;case 19:$Ut(n,s,i,r);break;case 20:JUt(n,s,r);break;case 21:ZUt(n,s,r);break;case 22:RC(n,s,r);break;case 23:QUt(n,s,r);break;case 24:ezt(n,s,r);break;case 25:tzt(n,s,r);break;case 26:nzt(n,s,r);break;case 27:izt(n,s,r);break;case 28:rzt(n,s,r);break;case 29:ozt(n,s,r);break;case 30:szt(n,s,r);break;case 31:azt(n,s,r);break;case 32:lzt(n,s,i,r);break;case 33:uzt(n,s,r);break;case 34:fzt(n,s,r);break;case 35:dzt(n,s,r);break;case 36:hzt(n,s,i,r);break;case 37:czt(n,s,i,r);break;case 38:mzt(n,s,i,r);break;case 39:pzt(n,s,i,r);break;case 40:gzt(n,s,r);break;case 41:_zt(n,s,r);break;default:(0,sW.assertNever)(s.state)}}if(!n.hasSchemeUrlMachine()&&n.charIdx>0&&(0,zo.isSchemeStartChar)(r)){var a=n.text.charCodeAt(n.charIdx-1);(0,zo.isSchemeStartChar)(a)||n.addMachine(cW(n.charIdx,0))}}}for(var c=n.stateMachines.length-1;c>=0;c--)n.stateMachines.forEach(function(u){return Fs(n,u)});return n.matches}function aW(e,t,n){var i=e.charIdx;if(n===35)e.addMachine(xzt(i,28));else if(n===64)e.addMachine(Tzt(i,30));else if(n===47)e.addMachine(xse(i,11));else if(n===43)e.addMachine(bse(i,37));else if(n===40)e.addMachine(bse(i,32));else{if((0,ca.isDigitChar)(n)&&(e.addMachine(bse(i,38)),e.addMachine(Azt(i,13))),(0,wP.isEmailLocalPartStartChar)(n)){var r=t.toLowerCase()==="m"?15:22;e.addMachine(bzt(i,r))}(0,zo.isSchemeStartChar)(n)&&e.addMachine(cW(i,0)),(0,ca.isAlphaNumericOrMarkChar)(n)&&e.addMachine(xse(i,5))}}function RUt(e,t,n){n===58?t.state=2:n===45?t.state=1:(0,zo.isSchemeChar)(n)||e.removeMachine(t)}function OUt(e,t,n){var i=e.charIdx;n===45||(n===47?(e.removeMachine(t),e.addMachine(xse(i,11))):(0,zo.isSchemeChar)(n)?t.state=0:e.removeMachine(t))}function MUt(e,t,n){var i=e.charIdx;n===47?t.state=3:n===46?e.removeMachine(t):(0,zo.isDomainLabelStartChar)(n)?(t.state=5,(0,zo.isSchemeStartChar)(n)&&e.addMachine(cW(i,0))):e.removeMachine(t)}function NUt(e,t,n){n===47?t.state=4:(0,zo.isPathChar)(n)?(t.state=10,t.acceptStateReached=!0):Fs(e,t)}function LUt(e,t,n,i){i===47?(t.state=10,t.acceptStateReached=!0):(0,zo.isDomainLabelStartChar)(i)?(t.state=5,t.acceptStateReached=!0):e.removeMachine(t)}function FUt(e,t,n){n===47?t.state=12:e.removeMachine(t)}function BUt(e,t,n){(0,zo.isDomainLabelStartChar)(n)?t.state=5:e.removeMachine(t)}function kUt(e,t,n){n===46?t.state=7:n===45?t.state=6:n===58?t.state=8:(0,zo.isUrlSuffixStartChar)(n)?t.state=10:(0,zo.isDomainLabelChar)(n)||Fs(e,t)}function UUt(e,t,n,i){i===45||(i===46?Fs(e,t):(0,zo.isDomainLabelStartChar)(i)?t.state=5:Fs(e,t))}function zUt(e,t,n,i){i===46?Fs(e,t):(0,zo.isDomainLabelStartChar)(i)?(t.state=5,t.acceptStateReached=!0):Fs(e,t)}function VUt(e,t,n){n===46?t.state=14:n===58?t.state=8:(0,ca.isDigitChar)(n)||((0,zo.isUrlSuffixStartChar)(n)?t.state=10:(0,ca.isAlphaNumericOrMarkChar)(n)?e.removeMachine(t):Fs(e,t))}function jUt(e,t,n){(0,ca.isDigitChar)(n)?(t.octetsEncountered++,t.octetsEncountered===4&&(t.acceptStateReached=!0),t.state=13):Fs(e,t)}function HUt(e,t,n){(0,ca.isDigitChar)(n)?t.state=9:Fs(e,t)}function GUt(e,t,n){(0,ca.isDigitChar)(n)||((0,zo.isUrlSuffixStartChar)(n)?t.state=10:Fs(e,t))}function WUt(e,t,n){(0,zo.isPathChar)(n)||Fs(e,t)}function qUt(e,t,n,i){n.toLowerCase()==="a"?t.state=16:RC(e,t,i)}function YUt(e,t,n,i){n.toLowerCase()==="i"?t.state=17:RC(e,t,i)}function XUt(e,t,n,i){n.toLowerCase()==="l"?t.state=18:RC(e,t,i)}function KUt(e,t,n,i){n.toLowerCase()==="t"?t.state=19:RC(e,t,i)}function $Ut(e,t,n,i){n.toLowerCase()==="o"?t.state=20:RC(e,t,i)}function JUt(e,t,n){n===58?t.state=21:RC(e,t,n)}function ZUt(e,t,n){(0,wP.isEmailLocalPartChar)(n)?t.state=22:e.removeMachine(t)}function RC(e,t,n){n===46?t.state=23:n===64?t.state=24:(0,wP.isEmailLocalPartChar)(n)?t.state=22:e.removeMachine(t)}function QUt(e,t,n){n===46||n===64?e.removeMachine(t):(0,wP.isEmailLocalPartChar)(n)?t.state=22:e.removeMachine(t)}function ezt(e,t,n){(0,zo.isDomainLabelStartChar)(n)?t.state=25:e.removeMachine(t)}function tzt(e,t,n){n===46?t.state=27:n===45?t.state=26:(0,zo.isDomainLabelChar)(n)||Fs(e,t)}function nzt(e,t,n){n===45||n===46?Fs(e,t):(0,zo.isDomainLabelChar)(n)?t.state=25:Fs(e,t)}function izt(e,t,n){n===46||n===45?Fs(e,t):(0,zo.isDomainLabelStartChar)(n)?(t.state=25,t.acceptStateReached=!0):Fs(e,t)}function rzt(e,t,n){(0,Tse.isHashtagTextChar)(n)?(t.state=29,t.acceptStateReached=!0):e.removeMachine(t)}function ozt(e,t,n){(0,Tse.isHashtagTextChar)(n)||Fs(e,t)}function szt(e,t,n){(0,Ese.isMentionTextChar)(n)?(t.state=31,t.acceptStateReached=!0):e.removeMachine(t)}function azt(e,t,n){(0,Ese.isMentionTextChar)(n)||((0,ca.isAlphaNumericOrMarkChar)(n)?e.removeMachine(t):Fs(e,t))}function czt(e,t,n,i){(0,ca.isDigitChar)(i)?t.state=38:(e.removeMachine(t),aW(e,n,i))}function lzt(e,t,n,i){(0,ca.isDigitChar)(i)?t.state=33:e.removeMachine(t),aW(e,n,i)}function uzt(e,t,n){(0,ca.isDigitChar)(n)?t.state=34:e.removeMachine(t)}function fzt(e,t,n){(0,ca.isDigitChar)(n)?t.state=35:e.removeMachine(t)}function dzt(e,t,n){n===41?t.state=36:e.removeMachine(t)}function hzt(e,t,n,i){(0,ca.isDigitChar)(i)?t.state=38:(0,IP.isPhoneNumberSeparatorChar)(i)?t.state=39:e.removeMachine(t)}function mzt(e,t,n,i){var r=e.charIdx;t.acceptStateReached=!0,(0,IP.isPhoneNumberControlChar)(i)?t.state=40:i===35?t.state=41:(0,ca.isDigitChar)(i)||(i===40?t.state=32:(0,IP.isPhoneNumberSeparatorChar)(i)?t.state=39:(Fs(e,t),(0,zo.isSchemeStartChar)(i)&&e.addMachine(cW(r,0))))}function pzt(e,t,n,i){(0,ca.isDigitChar)(i)?t.state=38:i===40?t.state=32:(Fs(e,t),aW(e,n,i))}function gzt(e,t,n){(0,IP.isPhoneNumberControlChar)(n)||(n===35?t.state=41:(0,ca.isDigitChar)(n)?t.state=38:Fs(e,t))}function _zt(e,t,n){(0,IP.isPhoneNumberControlChar)(n)?t.state=40:(0,ca.isDigitChar)(n)?e.removeMachine(t):Fs(e,t)}function Fs(e,t){var n=e.matches,i=e.text,r=e.charIdx,o=e.tagBuilder,s=e.stripPrefix,a=e.stripTrailingSlash,c=e.decodePercentEncoding,u=e.hashtagServiceName,f=e.mentionServiceName;if(e.removeMachine(t),!!t.acceptStateReached){var d=t.startIdx,p=i.slice(t.startIdx,r);switch(p=lBe(p),t.type){case 0:{var g=i.charCodeAt(t.startIdx-1);if(g===64)return;switch(t.matchType){case 0:{var m=zo.httpSchemeRe.exec(p);if(m&&(d=d+m.index,p=p.slice(m.index)),!(0,zo.isValidSchemeUrl)(p))return;break}case 1:{if(!(0,zo.isValidTldMatch)(p))return;break}case 2:{if(!(0,zo.isValidIpV4Address)(p))return;break}default:(0,sW.assertNever)(t)}n.push(new CUt.UrlMatch({tagBuilder:o,matchedText:p,offset:d,urlMatchType:yzt(t.matchType),url:p,protocolRelativeMatch:p.slice(0,2)==="//",stripPrefix:s,stripTrailingSlash:a,decodePercentEncoding:c}));break}case 1:{(0,wP.isValidEmail)(p)&&n.push(new vUt.EmailMatch({tagBuilder:o,matchedText:p,offset:d,email:p.replace(wP.mailtoSchemePrefixRe,"")}));break}case 2:{(0,Tse.isValidHashtag)(p)&&n.push(new SUt.HashtagMatch({tagBuilder:o,matchedText:p,offset:d,serviceName:u,hashtag:p.slice(1)}));break}case 3:{(0,Ese.isValidMention)(p,f)&&n.push(new wUt.MentionMatch({tagBuilder:o,matchedText:p,offset:d,serviceName:f,mention:p.slice(1)}));break}case 4:{if(p=p.replace(/ +$/g,""),(0,IP.isValidPhoneNumber)(p)){var y=p.replace(/[^0-9,;#]/g,"");n.push(new IUt.PhoneMatch({tagBuilder:o,matchedText:p,offset:d,number:y,plusSign:p.charAt(0)==="+"}))}break}default:(0,sW.assertNever)(t)}}}function yzt(e){switch(e){case 0:return"scheme";case 1:return"tld";case 2:return"ipV4";default:(0,sW.assertNever)(e)}}var aBe={")":"(","}":"{","]":"["};function lBe(e){for(var t={"(":0,"{":0,"[":0},n=0;n<e.length;n++){var i=e.charAt(n),r=e.charCodeAt(n);(0,ca.isOpenBraceChar)(r)?t[i]++:(0,ca.isCloseBraceChar)(r)&&t[aBe[i]]--}for(var o=e.length-1;o>=0;){var i=e.charAt(o),r=e.charCodeAt(o);if((0,ca.isCloseBraceChar)(r)){var s=aBe[i];if(t[s]<0)t[s]++,o--;else break}else if((0,ca.isUrlSuffixNotAllowedAsFinalChar)(r))o--;else break}return e.slice(0,o+1)}function cW(e,t){return{type:0,startIdx:e,state:t,acceptStateReached:!1,matchType:0}}function xse(e,t){return{type:0,startIdx:e,state:t,acceptStateReached:!1,matchType:1}}function Azt(e,t){return{type:0,startIdx:e,state:t,acceptStateReached:!1,matchType:2,octetsEncountered:1}}function bzt(e,t){return{type:1,startIdx:e,state:t,acceptStateReached:!1}}function xzt(e,t){return{type:2,startIdx:e,state:t,acceptStateReached:!1}}function Tzt(e,t){return{type:3,startIdx:e,state:t,acceptStateReached:!1}}function bse(e,t){return{type:4,startIdx:e,state:t,acceptStateReached:!1}}function cBe(e){return e.type===0&&e.matchType===0}});var uBe=Yi(wse=>{"use strict";Object.defineProperty(wse,"__esModule",{value:!0});wse.parseHtml=vzt;var Il=(sp(),Fh(op)),Tu=PC(),Ezt=Mb(),G0=(function(){function e(t){t===void 0&&(t={}),this.idx=t.idx!==void 0?t.idx:-1,this.type=t.type||"tag",this.name=t.name||"",this.isOpening=!!t.isOpening,this.isClosing=!!t.isClosing}return e})(),Sse=new G0,Czt=(function(){function e(t,n){this.charIdx=0,this.state=0,this.currentDataIdx=0,this.currentTag=Sse,this.html=t,this.callbacks=n}return e})();function vzt(e,t){for(var n=new Czt(e,t),i=e.length;n.charIdx<i;){var r=e.charAt(n.charIdx),o=e.charCodeAt(n.charIdx);switch(n.state){case 0:Szt(n,r);break;case 1:wzt(n,r,o);break;case 2:Pzt(n,r,o);break;case 3:Izt(n,r,o);break;case 4:Dzt(n,r,o);break;case 5:Rzt(n,r,o);break;case 6:Ozt(n,r,o);break;case 7:Mzt(n,r,o);break;case 8:Nzt(n,r);break;case 9:Lzt(n,r);break;case 10:Fzt(n,r,o);break;case 11:Bzt(n,r,o);break;case 12:kzt(n,r);break;case 13:Uzt(n);break;case 14:zzt(n,r);break;case 15:Vzt(n,r);break;case 16:jzt(n,r);break;case 17:Hzt(n,r);break;case 18:Gzt(n,r);break;case 19:Wzt(n,r);break;case 20:qzt(n,r);break;default:(0,Ezt.assertNever)(n.state)}n.charIdx++}n.currentDataIdx<n.charIdx&&Yzt(n)}function Szt(e,t){t==="<"&&W0(e)}function wzt(e,t,n){t==="!"?e.state=13:t==="/"?(e.state=2,e.currentTag=new G0(Il.__assign(Il.__assign({},e.currentTag),{isClosing:!0}))):t==="<"?W0(e):(0,Tu.isAsciiLetterChar)(n)?(e.state=3,e.currentTag=new G0(Il.__assign(Il.__assign({},e.currentTag),{isOpening:!0}))):(e.state=0,e.currentTag=Sse)}function Izt(e,t,n){(0,Tu.isWhitespaceChar)(n)?(e.currentTag=new G0(Il.__assign(Il.__assign({},e.currentTag),{name:vse(e)})),e.state=4):t==="<"?W0(e):t==="/"?(e.currentTag=new G0(Il.__assign(Il.__assign({},e.currentTag),{name:vse(e)})),e.state=12):t===">"?(e.currentTag=new G0(Il.__assign(Il.__assign({},e.currentTag),{name:vse(e)})),q0(e)):!(0,Tu.isAsciiLetterChar)(n)&&!(0,Tu.isDigitChar)(n)&&t!==":"&&Dh(e)}function Pzt(e,t,n){t===">"?Dh(e):(0,Tu.isAsciiLetterChar)(n)?e.state=3:Dh(e)}function Dzt(e,t,n){(0,Tu.isWhitespaceChar)(n)||(t==="/"?e.state=12:t===">"?q0(e):t==="<"?W0(e):t==="="||(0,Tu.isQuoteChar)(n)||(0,Tu.isControlChar)(n)?Dh(e):e.state=5)}function Rzt(e,t,n){(0,Tu.isWhitespaceChar)(n)?e.state=6:t==="/"?e.state=12:t==="="?e.state=7:t===">"?q0(e):t==="<"?W0(e):(0,Tu.isQuoteChar)(n)&&Dh(e)}function Ozt(e,t,n){(0,Tu.isWhitespaceChar)(n)||(t==="/"?e.state=12:t==="="?e.state=7:t===">"?q0(e):t==="<"?W0(e):(0,Tu.isQuoteChar)(n)?Dh(e):e.state=5)}function Mzt(e,t,n){(0,Tu.isWhitespaceChar)(n)||(t==='"'?e.state=8:t==="'"?e.state=9:/[>=`]/.test(t)?Dh(e):t==="<"?W0(e):e.state=10)}function Nzt(e,t){t==='"'&&(e.state=11)}function Lzt(e,t){t==="'"&&(e.state=11)}function Fzt(e,t,n){(0,Tu.isWhitespaceChar)(n)?e.state=4:t===">"?q0(e):t==="<"&&W0(e)}function Bzt(e,t,n){(0,Tu.isWhitespaceChar)(n)?e.state=4:t==="/"?e.state=12:t===">"?q0(e):t==="<"?W0(e):(e.state=4,Xzt(e))}function kzt(e,t){t===">"?(e.currentTag=new G0(Il.__assign(Il.__assign({},e.currentTag),{isClosing:!0})),q0(e)):Dh(e)}function Uzt(e){var t=e.html,n=e.charIdx;t.slice(n,n+2)==="--"?(e.charIdx++,e.currentTag=new G0(Il.__assign(Il.__assign({},e.currentTag),{type:"comment"})),e.state=14):t.slice(n,n+7).toUpperCase()==="DOCTYPE"?(e.charIdx+=6,e.currentTag=new G0(Il.__assign(Il.__assign({},e.currentTag),{type:"doctype"})),e.state=20):Dh(e)}function zzt(e,t){t==="-"?e.state=15:t===">"?Dh(e):e.state=16}function Vzt(e,t){t==="-"?e.state=18:t===">"?Dh(e):e.state=16}function jzt(e,t){t==="-"&&(e.state=17)}function Hzt(e,t){t==="-"?e.state=18:e.state=16}function Gzt(e,t){t===">"?q0(e):t==="!"?e.state=19:t==="-"||(e.state=16)}function Wzt(e,t){t==="-"?e.state=17:t===">"?q0(e):e.state=16}function qzt(e,t){t===">"?q0(e):t==="<"&&W0(e)}function Dh(e){e.state=0,e.currentTag=Sse}function W0(e){e.state=1,e.currentTag=new G0({idx:e.charIdx})}function q0(e){var t=e.html.slice(e.currentDataIdx,e.currentTag.idx);t&&e.callbacks.onText(t,e.currentDataIdx);var n=e.currentTag;n.type==="comment"?e.callbacks.onComment(n.idx):n.type==="doctype"?e.callbacks.onDoctype(n.idx):(n.isOpening&&e.callbacks.onOpenTag(n.name,n.idx),n.isClosing&&e.callbacks.onCloseTag(n.name,n.idx)),Dh(e),e.currentDataIdx=e.charIdx+1}function Yzt(e){var t=e.html.slice(e.currentDataIdx,e.charIdx);e.callbacks.onText(t,e.currentDataIdx),e.currentDataIdx=e.charIdx+1}function vse(e){var t=e.currentTag.idx+(e.currentTag.isClosing?2:1);return e.html.slice(t,e.charIdx).toLowerCase()}function Xzt(e){e.charIdx--}});var uW=Yi(Pse=>{"use strict";Object.defineProperty(Pse,"__esModule",{value:!0});var Ise=(sp(),Fh(op)),Kzt=$Fe(),Qa=Mb(),$zt=dse(),Jzt=$7(),Zzt=Cse(),Qzt=uBe(),eVt=_se(),tVt=pse(),nVt=(function(){function e(t){t===void 0&&(t={}),this.version=e.version,this.urls={},this.email=!0,this.phone=!0,this.hashtag=!1,this.mention=!1,this.newWindow=!0,this.stripPrefix={scheme:!0,www:!0},this.stripTrailingSlash=!0,this.decodePercentEncoding=!0,this.truncate={length:0,location:"end"},this.className="",this.replaceFn=null,this.context=void 0,this.sanitizeHtml=!1,this.tagBuilder=null,this.urls=iVt(t.urls),this.email=(0,Qa.isBoolean)(t.email)?t.email:this.email,this.phone=(0,Qa.isBoolean)(t.phone)?t.phone:this.phone,this.hashtag=t.hashtag||this.hashtag,this.mention=t.mention||this.mention,this.newWindow=(0,Qa.isBoolean)(t.newWindow)?t.newWindow:this.newWindow,this.stripPrefix=rVt(t.stripPrefix),this.stripTrailingSlash=(0,Qa.isBoolean)(t.stripTrailingSlash)?t.stripTrailingSlash:this.stripTrailingSlash,this.decodePercentEncoding=(0,Qa.isBoolean)(t.decodePercentEncoding)?t.decodePercentEncoding:this.decodePercentEncoding,this.sanitizeHtml=t.sanitizeHtml||!1;var n=this.mention;if(n!==!1&&eVt.mentionServices.indexOf(n)===-1)throw new Error("invalid `mention` cfg '".concat(n,"' - see docs"));var i=this.hashtag;if(i!==!1&&tVt.hashtagServices.indexOf(i)===-1)throw new Error("invalid `hashtag` cfg '".concat(i,"' - see docs"));this.truncate=oVt(t.truncate),this.className=t.className||this.className,this.replaceFn=t.replaceFn||this.replaceFn,this.context=t.context||this}return e.link=function(t,n){var i=new e(n);return i.link(t)},e.parse=function(t,n){var i=new e(n);return i.parse(t)},e.prototype.parse=function(t){var n=this,i=["a","style","script"],r=0,o=[];return(0,Qzt.parseHtml)(t,{onOpenTag:function(s){i.indexOf(s)>=0&&r++},onText:function(s,a){if(r===0){var c=/( | |<|<|>|>|"|"|')/gi,u=s.split(c),f=a;u.forEach(function(d,p){if(p%2===0){var g=n.parseText(d,f);o.push.apply(o,Ise.__spreadArray([],Ise.__read(g),!1))}f+=d.length})}},onCloseTag:function(s){i.indexOf(s)>=0&&(r=Math.max(r-1,0))},onComment:function(){},onDoctype:function(){}}),o=this.compactMatches(o),o=this.removeUnwantedMatches(o),o},e.prototype.compactMatches=function(t){t.sort(sVt);for(var n=0;n<t.length-1;){var i=t[n],r=i.getOffset(),o=i.getMatchedText().length;if(n+1<t.length&&t[n+1].getOffset()===r){var s=t[n+1].getMatchedText().length>o?n:n+1;t.splice(s,1);continue}n++}return t},e.prototype.removeUnwantedMatches=function(t){return this.hashtag||(0,Qa.removeWithPredicate)(t,function(n){return n.getType()==="hashtag"}),this.email||(0,Qa.removeWithPredicate)(t,function(n){return n.getType()==="email"}),this.phone||(0,Qa.removeWithPredicate)(t,function(n){return n.getType()==="phone"}),this.mention||(0,Qa.removeWithPredicate)(t,function(n){return n.getType()==="mention"}),this.urls.schemeMatches||(0,Qa.removeWithPredicate)(t,function(n){return n.getType()==="url"&&n.getUrlMatchType()==="scheme"}),this.urls.tldMatches||(0,Qa.removeWithPredicate)(t,function(n){return n.getType()==="url"&&n.getUrlMatchType()==="tld"}),this.urls.ipV4Matches||(0,Qa.removeWithPredicate)(t,function(n){return n.getType()==="url"&&n.getUrlMatchType()==="ipV4"}),t},e.prototype.parseText=function(t,n){n=n||0;for(var i=(0,Zzt.parseMatches)(t,{tagBuilder:this.getTagBuilder(),stripPrefix:this.stripPrefix,stripTrailingSlash:this.stripTrailingSlash,decodePercentEncoding:this.decodePercentEncoding,hashtagServiceName:this.hashtag,mentionServiceName:this.mention||"twitter"}),r=0,o=i.length;r<o;r++)i[r].setOffset(n+i[r].getOffset());return i},e.prototype.link=function(t){if(!t)return"";this.sanitizeHtml&&(t=t.replace(/</g,"<").replace(/>/g,">"));for(var n=this.parse(t),i=new Array(n.length*2+1),r=0,o=0,s=n.length;o<s;o++){var a=n[o];i.push(t.substring(r,a.getOffset())),i.push(this.createMatchReturnVal(a)),r=a.getOffset()+a.getMatchedText().length}return i.push(t.substring(r)),i.join("")},e.prototype.createMatchReturnVal=function(t){var n;if(this.replaceFn&&(n=this.replaceFn.call(this.context,t)),typeof n=="string")return n;if(n===!1)return t.getMatchedText();if(n instanceof Jzt.HtmlTag)return n.toAnchorString();var i=t.buildTag();return i.toAnchorString()},e.prototype.getTagBuilder=function(){var t=this.tagBuilder;return t||(t=this.tagBuilder=new $zt.AnchorTagBuilder({newWindow:this.newWindow,truncate:this.truncate,className:this.className})),t},e.version=Kzt.version,e})();Pse.default=nVt;function iVt(e){return e==null&&(e=!0),(0,Qa.isBoolean)(e)?{schemeMatches:e,tldMatches:e,ipV4Matches:e}:{schemeMatches:(0,Qa.isBoolean)(e.schemeMatches)?e.schemeMatches:!0,tldMatches:(0,Qa.isBoolean)(e.tldMatches)?e.tldMatches:!0,ipV4Matches:(0,Qa.isBoolean)(e.ipV4Matches)?e.ipV4Matches:!0}}function rVt(e){return e==null&&(e=!0),(0,Qa.isBoolean)(e)?{scheme:e,www:e}:{scheme:(0,Qa.isBoolean)(e.scheme)?e.scheme:!0,www:(0,Qa.isBoolean)(e.www)?e.www:!0}}function oVt(e){return typeof e=="number"?{length:e,location:"end"}:Ise.__assign({length:Number.POSITIVE_INFINITY,location:"end"},e)}function sVt(e,t){return e.getOffset()-t.getOffset()}});var dBe=Yi(fBe=>{"use strict";Object.defineProperty(fBe,"__esModule",{value:!0})});var hBe=Yi(dy=>{"use strict";Object.defineProperty(dy,"__esModule",{value:!0});var OC=(sp(),Fh(op));OC.__exportStar(dBe(),dy);OC.__exportStar(mse(),dy);OC.__exportStar(gse(),dy);OC.__exportStar(IC(),dy);OC.__exportStar(yse(),dy);OC.__exportStar(Ase(),dy);OC.__exportStar(hse(),dy)});var mBe=Yi(Dse=>{"use strict";Object.defineProperty(Dse,"__esModule",{value:!0});var aVt=(sp(),Fh(op));aVt.__exportStar(Cse(),Dse)});var Rse=Yi((ap,gBe)=>{"use strict";ap=gBe.exports=uW().default;Object.defineProperty(ap,"__esModule",{value:!0});ap.Autolinker=void 0;var PP=(sp(),Fh(op)),pBe=PP.__importDefault(uW());ap.Autolinker=pBe.default;ap.default=pBe.default;PP.__exportStar(uW(),ap);PP.__exportStar(dse(),ap);PP.__exportStar($7(),ap);PP.__exportStar(hBe(),ap);PP.__exportStar(mBe(),ap)});var wae=Yi((Vfr,k4)=>{/*! * protobuf.js v8.8.0 (c) 2016, daniel wirtz * compiled thu, 27 aug 2026 00:01:05 utc * licensed under the bsd-3-clause license * see: https://github.com/dcodeio/protobuf.js for details - */(function(e){"use strict";(function(n,i,r){function o(a){var c=i[a];return c||n[a][0].call(c=i[a]={exports:{}},o,c,c.exports),c.exports}var s=o(r[0]);s.util.global.protobuf=s,typeof define=="function"&&define.amd&&define(["long"],function(a){return a&&a.isLong&&(s.util.Long=a,s.configure()),s}),typeof F4=="object"&&F4&&F4.exports&&(F4.exports=s)})({1:[function(t,n,i){"use strict";i.build="minimal",i.Writer=t(15),i.BufferWriter=t(16),i.Reader=t(2),i.BufferReader=t(3),i.util=t(12),i.rpc=t(5),i.roots=t(4),i.configure=r;function r(){i.util.LongBits._configure(i.util.Long),i.Writer._configure(i.BufferWriter),i.Reader._configure(i.BufferReader)}r()},{12:12,15:15,16:16,2:2,3:3,4:4,5:5}],2:[function(t,n,i){"use strict";n.exports=u;var r=t(12),o,s=r.LongBits,a=r.utf8;function c(T,E){return RangeError("index out of range: "+T.pos+" + "+(E||1)+" > "+T.len)}function u(T){this.buf=T,this.pos=0,this.len=T.length,this.view=null,this.discardUnknown=u.discardUnknown}function f(T){if(Array.isArray(T)&&(T=new Uint8Array(T)),T instanceof Uint8Array)return new u(T);throw Error("illegal buffer")}var d=function(){return r.Buffer?function(v){return(u.create=function(I){return r.Buffer.isBuffer(I)?new o(I):f(I)})(v)}:f};u.create=d(),u.prototype.raw=function(E,v){return this.buf.subarray(E,v)};function p(T){for(var E=0,v=0;v<4;++v){if(T.pos>=T.len)throw c(T);var S=T.buf[T.pos++];if(E=(E|(S&127)<<v*7)>>>0,S<128)return E}throw c(T)}u.prototype.uint32=function(){if(this.len-this.pos<5){if(this.pos>=this.len)throw c(this);if(this.buf[this.pos]>=128)return p(this)}var E=this.buf,v=this.pos,S=(E[v]&127)>>>0;if(E[v++]<128)return this.pos=v,S;if(S=(S|(E[v]&127)<<7)>>>0,E[v++]<128)return this.pos=v,S;if(S=(S|(E[v]&127)<<14)>>>0,E[v++]<128)return this.pos=v,S;if(S=(S|(E[v]&127)<<21)>>>0,E[v++]<128)return this.pos=v,S;if(S=(S|(E[v]&15)<<28)>>>0,E[v++]<128)return this.pos=v,S;for(var I=0;I<5;++I){if(v>=this.len)throw this.pos=v,c(this);if(E[v++]<128)return this.pos=v,S}throw this.pos=v,Error("invalid varint encoding")},u.prototype.tag=function(){if(this.len-this.pos<5){if(this.pos>=this.len)throw c(this);if(this.buf[this.pos]>=128)return p(this)}var E=this.buf,v=this.pos,S=(E[v]&127)>>>0;if(E[v++]<128)return this.pos=v,S;if(S=(S|(E[v]&127)<<7)>>>0,E[v++]<128)return this.pos=v,S;if(S=(S|(E[v]&127)<<14)>>>0,E[v++]<128)return this.pos=v,S;if(S=(S|(E[v]&127)<<21)>>>0,E[v++]<128)return this.pos=v,S;if(S=(S|(E[v]&15)<<28)>>>0,E[v]<128&&(E[v]&112)===0)return this.pos=v+1,S;throw this.pos=v+1,Error("invalid tag encoding")},u.prototype.int32=function(){return this.uint32()|0},u.prototype.sint32=function(){var E=this.uint32();return E>>>1^-(E&1)|0};function g(){var T=new s(0,0),E=0;if(this.len-this.pos>4){for(;E<4;++E)if(T.lo=(T.lo|(this.buf[this.pos]&127)<<E*7)>>>0,this.buf[this.pos++]<128)return T;if(T.lo=(T.lo|(this.buf[this.pos]&127)<<28)>>>0,T.hi=(T.hi|(this.buf[this.pos]&127)>>4)>>>0,this.buf[this.pos++]<128)return T;E=0}else{for(;E<4;++E){if(this.pos>=this.len)throw c(this);if(T.lo=(T.lo|(this.buf[this.pos]&127)<<E*7)>>>0,this.buf[this.pos++]<128)return T}throw c(this)}if(this.len-this.pos>4){for(;E<5;++E)if(T.hi=(T.hi|(this.buf[this.pos]&127)<<E*7+3)>>>0,this.buf[this.pos++]<128)return T}else for(;E<5;++E){if(this.pos>=this.len)throw c(this);if(T.hi=(T.hi|(this.buf[this.pos]&127)<<E*7+3)>>>0,this.buf[this.pos++]<128)return T}throw Error("invalid varint encoding")}u.prototype.bool=function(){for(var E=!1,v,S=0;S<10;++S){if(this.pos>=this.len)throw c(this);if(v=this.buf[this.pos++],v&127&&(E=!0),v<128)return E}throw Error("invalid varint encoding")};function m(T,E){return(T[E-4]|T[E-3]<<8|T[E-2]<<16|T[E-1]<<24)>>>0}u.prototype.fixed32=function(){if(this.pos+4>this.len)throw c(this,4);return m(this.buf,this.pos+=4)},u.prototype.sfixed32=function(){if(this.pos+4>this.len)throw c(this,4);return m(this.buf,this.pos+=4)|0};function y(){if(this.pos+8>this.len)throw c(this,8);return new s(m(this.buf,this.pos+=4),m(this.buf,this.pos+=4))}u.prototype.float=function(){if(this.pos+4>this.len)throw c(this,4);var E=r.float.readFloatLE(this.buf,this.pos);return this.pos+=4,E},u.prototype.double=function(){if(this.pos+8>this.len)throw c(this,4);var E=r.float.readDoubleLE(this.buf,this.pos);return this.pos+=8,E},u.prototype.uint32s=function(E){E===e&&(E=[]);var v=this.uint32()+this.pos,S=this.len,I=this.buf,R=this.pos,O;if(v>S)throw c(this,v-this.pos);for(this.len=v;R<v;)O=I[R++],O<128?E.push(O):(this.pos=R-1,E.push(this.uint32()),R=this.pos);if(this.pos=R,R!==v)throw RangeError("index out of range");return this.len=S,E},u.prototype.int32s=function(E){E===e&&(E=[]);var v=this.uint32()+this.pos,S=this.len,I=this.buf,R=this.pos,O;if(v>S)throw c(this,v-this.pos);for(this.len=v;R<v;)O=I[R++],O<128?E.push(O):(this.pos=R-1,E.push(this.int32()),R=this.pos);if(this.pos=R,R!==v)throw RangeError("index out of range");return this.len=S,E},u.prototype.sint32s=function(E){E===e&&(E=[]);var v=this.uint32()+this.pos,S=this.len;if(v>S)throw c(this,v-this.pos);for(this.len=v;this.pos<v;)E.push(this.sint32());if(this.pos!==v)throw RangeError("index out of range");return this.len=S,E},u.prototype.bools=function(E){E===e&&(E=[]);var v=this.uint32()+this.pos,S=this.len,I=this.buf,R=this.pos,O;if(v>S)throw c(this,v-this.pos);for(this.len=v;R<v;)O=I[R++],O<128?E.push(O!==0):(this.pos=R-1,E.push(this.bool()),R=this.pos);if(this.pos=R,R!==v)throw RangeError("index out of range");return this.len=S,E};var A=8,b=128;function x(T,E,v){var S=T.view;if(S||E<v)return S;var I=T.buf;return T.view=new DataView(I.buffer,I.byteOffset,I.byteLength)}u.prototype.fixed32s=function(E){E===e&&(E=[]);var v=this.uint32(),S=this.pos+v;if(S>this.len)throw c(this,v);var I=v>>>2,R=E.length,O=this.pos;E.length=R+I;var L=x(this,I,b);if(L)for(var _=0;_<I;++_,O+=4)E[R++]=L.getUint32(O,!0);else for(var C=this.buf,w=0;w<I;++w,O+=4)E[R++]=m(C,O+4);if(this.pos=O,O!==S)throw c(this,4);return E},u.prototype.sfixed32s=function(E){E===e&&(E=[]);var v=this.uint32(),S=this.pos+v;if(S>this.len)throw c(this,v);var I=v>>>2,R=E.length,O=this.pos;E.length=R+I;var L=x(this,I,b);if(L)for(var _=0;_<I;++_,O+=4)E[R++]=L.getInt32(O,!0);else for(var C=this.buf,w=0;w<I;++w,O+=4)E[R++]=m(C,O+4)|0;if(this.pos=O,O!==S)throw c(this,4);return E},u.prototype.floats=function(E){E===e&&(E=[]);var v=this.uint32(),S=this.pos+v;if(S>this.len)throw c(this,v);var I=v>>>2,R=E.length,O=this.pos;E.length=R+I;var L=x(this,I,A);if(L)for(var _=0;_<I;++_,O+=4)E[R++]=L.getFloat32(O,!0);else for(var C=this.buf,w=0;w<I;++w,O+=4)E[R++]=r.float.readFloatLE(C,O);if(this.pos=O,O!==S)throw c(this,4);return E},u.prototype.doubles=function(E){E===e&&(E=[]);var v=this.uint32(),S=this.pos+v;if(S>this.len)throw c(this,v);var I=v>>>3,R=E.length,O=this.pos;E.length=R+I;var L=x(this,I,A);if(L)for(var _=0;_<I;++_,O+=8)E[R++]=L.getFloat64(O,!0);else for(var C=this.buf,w=0;w<I;++w,O+=8)E[R++]=r.float.readDoubleLE(C,O);if(this.pos=O,O!==S)throw c(this,8);return E},u.prototype.uint64s=function(E){E===e&&(E=[]);var v=this.uint32()+this.pos,S=this.len;if(v>S)throw c(this,v-this.pos);for(this.len=v;this.pos<v;)E.push(this.uint64());if(this.pos!==v)throw RangeError("index out of range");return this.len=S,E},u.prototype.int64s=function(E){E===e&&(E=[]);var v=this.uint32()+this.pos,S=this.len;if(v>S)throw c(this,v-this.pos);for(this.len=v;this.pos<v;)E.push(this.int64());if(this.pos!==v)throw RangeError("index out of range");return this.len=S,E},u.prototype.sint64s=function(E){E===e&&(E=[]);var v=this.uint32()+this.pos,S=this.len;if(v>S)throw c(this,v-this.pos);for(this.len=v;this.pos<v;)E.push(this.sint64());if(this.pos!==v)throw RangeError("index out of range");return this.len=S,E},u.prototype.fixed64s=function(E){E===e&&(E=[]);var v=this.uint32(),S=this.pos+v,I=E.length;if(S>this.len)throw c(this,v);var R=v>>>3;E.length=I+R;for(var O=0;O<R;++O)E[I++]=this.fixed64();if(this.pos!==S)throw c(this,8);return E},u.prototype.sfixed64s=function(E){E===e&&(E=[]);var v=this.uint32(),S=this.pos+v,I=E.length;if(S>this.len)throw c(this,v);var R=v>>>3;E.length=I+R;for(var O=0;O<R;++O)E[I++]=this.sfixed64();if(this.pos!==S)throw c(this,8);return E},u.prototype.bytes=function(){var E=this.uint32(),v=this.pos,S=this.pos+E;if(S>this.len)throw c(this,E);return this.pos=S,this.raw(v,S)},u.prototype.string=function(){var E=this.uint32(),v=this.pos,S=this.pos+E;if(S>this.len)throw c(this,E);return this.pos=S,a.read(this.buf,v,S)},u.prototype.stringVerify=function(){var E=this.uint32(),v=this.pos,S=this.pos+E;if(S>this.len)throw c(this,E);return this.pos=S,a.readStrict(this.buf,v,S)},u.prototype.skip=function(E){if(typeof E=="number"){if(this.pos+E>this.len)throw c(this,E);this.pos+=E}else do if(this.pos>=this.len)throw c(this);while(this.buf[this.pos++]&128);return this},u.recursionLimit=r.recursionLimit,u.discardUnknown=!0,u.prototype.skipType=function(T,E,v){if(E===e&&(E=0),E>u.recursionLimit)throw Error("max depth exceeded");if(v===0)throw Error("illegal tag: field number 0");switch(T){case 0:this.skip();break;case 1:this.skip(8);break;case 2:this.skip(this.uint32());break;case 3:for(;;){var S=this.tag(),I=S>>>3;if(T=S&7,!I)throw Error("illegal tag: field number 0");if(T===4){if(v!==e&&I!==v)throw Error("invalid end group tag");break}this.skipType(T,E+1,I)}break;case 5:this.skip(4);break;default:throw Error("invalid wire type "+T+" at offset "+this.pos)}return this},u._configure=function(T){o=T,u.create=d(),o._configure();var E=r.Long?"toLong":"toNumber";r.merge(u.prototype,{int64:function(){return g.call(this)[E](!1)},uint64:function(){return g.call(this)[E](!0)},sint64:function(){return g.call(this).zzDecode()[E](!1)},fixed64:function(){return y.call(this)[E](!0)},sfixed64:function(){return y.call(this)[E](!1)}})}},{12:12}],3:[function(t,n,i){"use strict";n.exports=s;var r=t(2);s.prototype=Object.create(r.prototype,{constructor:{value:s,writable:!0,enumerable:!1,configurable:!0}});var o=t(12);function s(a){r.call(this,a)}s._configure=function(){o.Buffer&&(s.prototype._slice=o.Buffer.prototype.slice)},s.prototype.raw=function(c,u){return this._slice.call(this.buf,c,u)},s.prototype.string=function(){var c=this.uint32(),u=this.pos,f=this.pos+c;if(f>this.len)throw RangeError("index out of range: "+this.pos+" + "+c+" > "+this.len);return this.pos=f,this.buf.utf8Slice?this.buf.utf8Slice(u,f):this.buf.toString("utf-8",u,f)},s._configure()},{12:12,2:2}],4:[function(t,n,i){"use strict";n.exports=Object.create(null)},{}],5:[function(t,n,i){"use strict";var r=i;r.Service=t(6)},{6:6}],6:[function(t,n,i){"use strict";n.exports=o;var r=t(12);o.prototype=Object.create(r.EventEmitter.prototype,{constructor:{value:o,writable:!0,enumerable:!1,configurable:!0}});function o(s,a,c){if(typeof s!="function")throw TypeError("rpcImpl must be a function");r.EventEmitter.call(this),this.rpcImpl=s,this.requestDelimited=!!a,this.responseDelimited=!!c}o.prototype.rpcCall=function s(a,c,u,f,d){if(!f)throw TypeError("request must be specified");var p=this;if(!d)return r.asPromise(s,p,a,c,u,f);if(!p.rpcImpl)return setTimeout(function(){d(Error("already ended"))},0),e;try{return p.rpcImpl(a,c[p.requestDelimited?"encodeDelimited":"encode"](f).finish(),function(m,y){if(m)return p.emit("error",m,a),d(m);if(y===null)return p.end(!0),e;if(!(y instanceof u))try{y=u[p.responseDelimited?"decodeDelimited":"decode"](y)}catch(A){return p.emit("error",A,a),d(A)}return p.emit("data",y,a),d(null,y)})}catch(g){return p.emit("error",g,a),setTimeout(function(){d(g)},0),e}},o.prototype.end=function(a){return this.rpcImpl&&(a||this.rpcImpl(null,null,null),this.rpcImpl=null,this.emit("end").off()),this}},{12:12}],7:[function(t,n,i){"use strict";n.exports=r;function r(o,s){for(var a=new Array(arguments.length-1),c=0,u=2,f=!0;u<arguments.length;)a[c++]=arguments[u++];return new Promise(function(p,g){a[c]=function(y){if(f)if(f=!1,y)g(y);else{for(var A=new Array(arguments.length-1),b=0;b<A.length;)A[b++]=arguments[b];p.apply(null,A)}};try{o.apply(s||null,a)}catch(m){f&&(f=!1,g(m))}})}},{}],8:[function(t,n,i){"use strict";var r=i;r.length=function(g){var m=g.length;if(!m)return 0;for(;m>0&&g.charAt(m-1)==="=";)--m;return Math.floor(m*3/4)};for(var o=new Array(64),s=new Array(123),a=0;a<64;)s[o[a]=a<26?a+65:a<52?a+71:a<62?a-4:a-59|43]=a++;s[45]=62,s[95]=63,r.encode=function(g,m,y){for(var A=null,b=[],x=0,T=0,E;m<y;){var v=g[m++];switch(T){case 0:b[x++]=o[v>>2],E=(v&3)<<4,T=1;break;case 1:b[x++]=o[E|v>>4],E=(v&15)<<2,T=2;break;case 2:b[x++]=o[E|v>>6],b[x++]=o[v&63],T=0;break}x>8191&&((A||(A=[])).push(String.fromCharCode.apply(String,b)),x=0)}return T&&(b[x++]=o[E],b[x++]=61,T===1&&(b[x++]=61)),A?(x&&A.push(String.fromCharCode.apply(String,b.slice(0,x))),A.join("")):String.fromCharCode.apply(String,b.slice(0,x))};var c="invalid encoding";r.decode=function(g,m,y){for(var A=y,b=0,x,T=0;T<g.length;){var E=g.charCodeAt(T++);if(E===61&&b>1)break;if((E=s[E])===e)throw Error(c);switch(b){case 0:x=E,b=1;break;case 1:m[y++]=x<<2|(E&48)>>4,x=E,b=2;break;case 2:m[y++]=(x&15)<<4|(E&60)>>2,x=E,b=3;break;case 3:m[y++]=(x&3)<<6|E,b=0;break}}if(b===1)throw Error(c);return y-A};var u=/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/,f=/[-_]/,d=/^(?:[A-Za-z0-9_-]{4})*(?:[A-Za-z0-9_-]{2}(?:==)?|[A-Za-z0-9_-]{3}=?)?$/;r.test=function(g){return u.test(g)||f.test(g)&&d.test(g)}},{}],9:[function(t,n,i){"use strict";n.exports=r;function r(){this._listeners=Object.create(null)}r.prototype.on=function(s,a,c){return(this._listeners[s]||(this._listeners[s]=[])).push({fn:a,ctx:c||this}),this},r.prototype.off=function(s,a){if(s===e)this._listeners=Object.create(null);else if(a===e)this._listeners[s]=[];else{var c=this._listeners[s];if(!c)return this;for(var u=0;u<c.length;)c[u].fn===a?c.splice(u,1):++u}return this},r.prototype.emit=function(s){var a=this._listeners[s];if(a){for(var c=[],u=1;u<arguments.length;)c.push(arguments[u++]);for(u=0;u<a.length;)a[u].fn.apply(a[u++].ctx,c)}return this}},{}],10:[function(t,n,i){"use strict";n.exports=r(r);function r(u){return typeof Float32Array<"u"?(function(){var f=new Float32Array([-0]),d=new Uint8Array(f.buffer),p=d[3]===128;function g(b,x,T){f[0]=b,x[T]=d[0],x[T+1]=d[1],x[T+2]=d[2],x[T+3]=d[3]}function m(b,x,T){f[0]=b,x[T]=d[3],x[T+1]=d[2],x[T+2]=d[1],x[T+3]=d[0]}u.writeFloatLE=p?g:m,u.writeFloatBE=p?m:g;function y(b,x){return d[0]=b[x],d[1]=b[x+1],d[2]=b[x+2],d[3]=b[x+3],f[0]}function A(b,x){return d[3]=b[x],d[2]=b[x+1],d[1]=b[x+2],d[0]=b[x+3],f[0]}u.readFloatLE=p?y:A,u.readFloatBE=p?A:y})():(function(){function f(p,g,m,y){var A=g<0?1:0;if(A&&(g=-g),g===0)p(1/g>0?0:2147483648,m,y);else if(isNaN(g))p(2143289344,m,y);else if(g>34028234663852886e22)p((A<<31|2139095040)>>>0,m,y);else if(g<11754943508222875e-54)p((A<<31|Math.round(g/1401298464324817e-60))>>>0,m,y);else{var b=Math.floor(Math.log(g)/Math.LN2),x=Math.round(g*Math.pow(2,-b)*8388608)&8388607;p((A<<31|b+127<<23|x)>>>0,m,y)}}u.writeFloatLE=f.bind(null,o),u.writeFloatBE=f.bind(null,s);function d(p,g,m){var y=p(g,m),A=(y>>31)*2+1,b=y>>>23&255,x=y&8388607;return b===255?x?NaN:A*(1/0):b===0?A*1401298464324817e-60*x:A*Math.pow(2,b-150)*(x+8388608)}u.readFloatLE=d.bind(null,a),u.readFloatBE=d.bind(null,c)})(),typeof Float64Array<"u"?(function(){var f=new Float64Array([-0]),d=new Uint8Array(f.buffer),p=d[7]===128;function g(b,x,T){f[0]=b,x[T]=d[0],x[T+1]=d[1],x[T+2]=d[2],x[T+3]=d[3],x[T+4]=d[4],x[T+5]=d[5],x[T+6]=d[6],x[T+7]=d[7]}function m(b,x,T){f[0]=b,x[T]=d[7],x[T+1]=d[6],x[T+2]=d[5],x[T+3]=d[4],x[T+4]=d[3],x[T+5]=d[2],x[T+6]=d[1],x[T+7]=d[0]}u.writeDoubleLE=p?g:m,u.writeDoubleBE=p?m:g;function y(b,x){return d[0]=b[x],d[1]=b[x+1],d[2]=b[x+2],d[3]=b[x+3],d[4]=b[x+4],d[5]=b[x+5],d[6]=b[x+6],d[7]=b[x+7],f[0]}function A(b,x){return d[7]=b[x],d[6]=b[x+1],d[5]=b[x+2],d[4]=b[x+3],d[3]=b[x+4],d[2]=b[x+5],d[1]=b[x+6],d[0]=b[x+7],f[0]}u.readDoubleLE=p?y:A,u.readDoubleBE=p?A:y})():(function(){function f(p,g,m,y,A,b){var x=y<0?1:0;if(x&&(y=-y),y===0)p(0,A,b+g),p(1/y>0?0:2147483648,A,b+m);else if(isNaN(y))p(0,A,b+g),p(2146959360,A,b+m);else if(y>17976931348623157e292)p(0,A,b+g),p((x<<31|2146435072)>>>0,A,b+m);else{var T;if(y<22250738585072014e-324)T=y/5e-324,p(T>>>0,A,b+g),p((x<<31|T/4294967296)>>>0,A,b+m);else{var E=Math.floor(Math.log(y)/Math.LN2);E===1024&&(E=1023),T=y*Math.pow(2,-E),p(T*4503599627370496>>>0,A,b+g),p((x<<31|E+1023<<20|T*1048576&1048575)>>>0,A,b+m)}}}u.writeDoubleLE=f.bind(null,o,0,4),u.writeDoubleBE=f.bind(null,s,4,0);function d(p,g,m,y,A){var b=p(y,A+g),x=p(y,A+m),T=(x>>31)*2+1,E=x>>>20&2047,v=4294967296*(x&1048575)+b;return E===2047?v?NaN:T*(1/0):E===0?T*5e-324*v:T*Math.pow(2,E-1075)*(v+4503599627370496)}u.readDoubleLE=d.bind(null,a,0,4),u.readDoubleBE=d.bind(null,c,4,0)})(),u}function o(u,f,d){f[d]=u&255,f[d+1]=u>>>8&255,f[d+2]=u>>>16&255,f[d+3]=u>>>24}function s(u,f,d){f[d]=u>>>24,f[d+1]=u>>>16&255,f[d+2]=u>>>8&255,f[d+3]=u&255}function a(u,f){return(u[f]|u[f+1]<<8|u[f+2]<<16|u[f+3]<<24)>>>0}function c(u,f){return(u[f]<<24|u[f+1]<<16|u[f+2]<<8|u[f+3])>>>0}},{}],11:[function(t,n,i){"use strict";n.exports=o;var r;function o(u,f){this.lo=u>>>0,this.hi=f>>>0}var s=o.zero=new o(0,0);s.toNumber=function(){return 0},s.zzEncode=s.zzDecode=function(){return this},s.length=function(){return 1};var a=o.zeroHash="\0\0\0\0\0\0\0\0";o.fromNumber=function(f){if(f===0)return s;var d=f<0;d&&(f=-f);var p=f>>>0,g=(f-p)/4294967296>>>0;return d&&(g=~g>>>0,p=~p>>>0,++p>4294967295&&(p=0,++g>4294967295&&(g=0))),new o(p,g)},o.from=function(f){if(typeof f=="number")return o.fromNumber(f);if(typeof f=="string"||f instanceof String)if(r)f=r.fromString(f);else return o.fromNumber(parseInt(f,10));return f.low||f.high?new o(f.low>>>0,f.high>>>0):s},o.prototype.toNumber=function(f){if(!f&&this.hi>>>31){var d=~this.lo+1>>>0,p=~this.hi>>>0;return d||(p=p+1>>>0),-(d+p*4294967296)}return this.lo+this.hi*4294967296},o.prototype.toLong=function(f){return r?new r(this.lo|0,this.hi|0,!!f):{low:this.lo|0,high:this.hi|0,unsigned:!!f}};var c=String.prototype.charCodeAt;o.fromHash=function(f){return f===a?s:new o((c.call(f,0)|c.call(f,1)<<8|c.call(f,2)<<16|c.call(f,3)<<24)>>>0,(c.call(f,4)|c.call(f,5)<<8|c.call(f,6)<<16|c.call(f,7)<<24)>>>0)},o.prototype.toHash=function(){return String.fromCharCode(this.lo&255,this.lo>>>8&255,this.lo>>>16&255,this.lo>>>24,this.hi&255,this.hi>>>8&255,this.hi>>>16&255,this.hi>>>24)},o.prototype.zzEncode=function(){var f=this.hi>>31;return this.hi=((this.hi<<1|this.lo>>>31)^f)>>>0,this.lo=(this.lo<<1^f)>>>0,this},o.prototype.zzDecode=function(){var f=-(this.lo&1);return this.lo=((this.lo>>>1|this.hi<<31)^f)>>>0,this.hi=(this.hi>>>1^f)>>>0,this},o.prototype.length=function(){var f=this.lo,d=(this.lo>>>28|this.hi<<4)>>>0,p=this.hi>>>24;return p===0?d===0?f<16384?f<128?1:2:f<2097152?3:4:d<16384?d<128?5:6:d<2097152?7:8:p<128?9:10},o._configure=function(u){r=u}},{}],12:[function(t,n,i){"use strict";var r=i;r.asPromise=t(7),r.base64=t(8),r.EventEmitter=t(9),r.float=t(10),r.utf8=t(14),r.pool=t(13),r.LongBits=t(11);function o(c){return c==="__proto__"||c==="prototype"||c==="constructor"}r.isUnsafeProperty=o,r.isNode=!!(typeof global<"u"&&global&&global.process&&global.process.versions&&global.process.versions.node),r.global=r.isNode&&global||typeof window<"u"&&window||typeof self<"u"&&self||typeof globalThis<"u"&&globalThis||this,r.emptyArray=Object.freeze?Object.freeze([]):[],r.emptyObject=Object.freeze?Object.freeze({}):{},r.isInteger=Number.isInteger||function(u){return typeof u=="number"&&isFinite(u)&&Math.floor(u)===u},r.isString=function(u){return typeof u=="string"||u instanceof String},r.isObject=function(u){return u&&typeof u=="object"},r.isset=r.isSet=function(u,f){var d=u[f];return d!=null&&Object.hasOwnProperty.call(u,f)?typeof d!="object"||(Array.isArray(d)?d.length:Object.keys(d).length)>0:!1},r.Buffer=(function(){try{var c=r.global.Buffer;return c.prototype.utf8Write||r.isNode?c:null}catch{return null}})(),r.newBuffer=function(u){var f=r.Buffer;return typeof u=="number"?f?f.allocUnsafe(u):new Uint8Array(u):f?f.from(u):new Uint8Array(u)},r.rawField=function(u,f,d){var p=[],g=u<<3|f;for(g>>>=0;g>127;)p.push(g&127|128),g>>>=7;p.push(g);for(var m=0;m<d.length;++m)p.push(d[m]);return r.newBuffer(p)},r.Array=Uint8Array,r.Long=r.global.dcodeIO&&r.global.dcodeIO.Long||r.global.Long||(function(){try{var c=t("long");return c&&c.isLong?c:null}catch{return null}})(),r.key2Re=/^(?:true|false|0|1)$/,r.key32Re=/^-?(?:0|[1-9][0-9]*)$/,r.key64Re=/^(?:[\x00-\xff]{8}|-?(?:0|[1-9][0-9]*))$/,r.longToHash=function(u){return u?r.LongBits.from(u).toHash():r.LongBits.zeroHash},r.longFromHash=function(u,f){var d=r.LongBits.fromHash(u);return r.Long?r.Long.fromBits(d.lo,d.hi,f):d.toNumber(!!f)},r.longFromKey=function(u,f){return r.key64Re.test(u)&&!r.key32Re.test(u)?r.longFromHash(u,f):u},r.boolFromKey=function(u){return u==="true"||u==="1"};function s(c){var u=typeof arguments[arguments.length-1]=="boolean",f=u?arguments.length-1:arguments.length;u=u&&arguments[arguments.length-1];for(var d=1;d<f;++d){var p=arguments[d];if(p)for(var g=Object.keys(p),m=0;m<g.length;++m)!o(g[m])&&(!u||!Object.prototype.hasOwnProperty.call(c,g[m])||c[g[m]]===e)&&(c[g[m]]=p[g[m]])}return c}r.merge=s,r.nestingLimit=32,r.recursionLimit=100,r.makeProp=function(u,f,d){Object.prototype.hasOwnProperty.call(u,f)||Object.defineProperty(u,f,{enumerable:d===e?!0:d,configurable:!0,writable:!0})},r.lcFirst=function(u){return u.charAt(0).toLowerCase()+u.substring(1)};function a(c){function u(f,d){if(!(this instanceof u))return new u(f,d);Object.defineProperty(this,"message",{get:function(){return f}}),Error.captureStackTrace?Error.captureStackTrace(this,u):Object.defineProperty(this,"stack",{value:new Error().stack||""}),d&&s(this,d)}return u.prototype=Object.create(Error.prototype,{constructor:{value:u,writable:!0,enumerable:!1,configurable:!0},name:{get:function(){return c},set:e,enumerable:!1,configurable:!0},toString:{value:function(){return this.name+": "+this.message},writable:!0,enumerable:!1,configurable:!0}}),u}r.newError=a,r.ProtocolError=a("ProtocolError"),r.oneOfGetter=function(u){for(var f={},d=0;d<u.length;++d)f[u[d]]=1;return function(){for(var p=Object.keys(this),g=p.length-1;g>-1;--g)if(f[p[g]]===1&&this[p[g]]!==e&&this[p[g]]!==null)return p[g]}},r.oneOfSetter=function(u){return function(f){for(var d=0;d<u.length;++d)u[d]!==f&&delete this[u[d]]}},r.toJSONOptions={longs:String,enums:String,bytes:String,json:!0}},{10:10,11:11,13:13,14:14,7:7,8:8,9:9,long:"long"}],13:[function(t,n,i){"use strict";n.exports=r;function r(o,s,a){var c=a||8192,u=c>>>1,f=null,d=c;return function(g){if(g<1||g>u)return o(g);d+g>c&&(f=o(c),d=0);var m=s.call(f,d,d+=g);return d&7&&(d=(d|7)+1),m}}},{}],14:[function(t,n,i){"use strict";var r=i,o=new TextDecoder("utf-8",{ignoreBOM:!0}),s,a=64;try{s=new TextDecoder("utf-8",{fatal:!0,ignoreBOM:!0})}catch{s=o}r.length=function(f){for(var d=0,p=0,g=0;g<f.length;++g)p=f.charCodeAt(g),p<128?d+=1:p<2048?d+=2:(p&64512)===55296&&(f.charCodeAt(g+1)&64512)===56320?(++g,d+=4):d+=3;return d};function c(u,f,d,p){var g=d===0&&p===f.length?f:f.subarray(d,p);return u.decode(g)}r.read=function(f,d,p){if(p-d<1)return"";if(p-d>=a)return c(o,f,d,p);for(var g="",m=d,y,A,b,x,T,E,v,S;m+7<p;m+=8){if(y=f[m],A=f[m+1],b=f[m+2],x=f[m+3],T=f[m+4],E=f[m+5],v=f[m+6],S=f[m+7],(y|A|b|x|T|E|v|S)&128)return g+c(o,f,m,p);g+=String.fromCharCode(y,A,b,x,T,E,v,S)}for(;m<p;++m){if(y=f[m],y&128)return g+c(o,f,m,p);g+=String.fromCharCode(y)}return g},r.readStrict=function(f,d,p){if(p-d<1)return"";if(p-d>=a)return c(s,f,d,p);for(var g="",m=d,y,A,b,x,T,E,v,S;m+7<p;m+=8){if(y=f[m],A=f[m+1],b=f[m+2],x=f[m+3],T=f[m+4],E=f[m+5],v=f[m+6],S=f[m+7],(y|A|b|x|T|E|v|S)&128)return g+c(s,f,m,p);g+=String.fromCharCode(y,A,b,x,T,E,v,S)}for(;m<p;++m){if(y=f[m],y&128)return g+c(s,f,m,p);g+=String.fromCharCode(y)}return g},r.write=function(f,d,p){for(var g=p,m,y,A=0;A<f.length;++A)m=f.charCodeAt(A),m<128?d[p++]=m:m<2048?(d[p++]=m>>6|192,d[p++]=m&63|128):(m&64512)===55296&&((y=f.charCodeAt(A+1))&64512)===56320?(m=65536+((m&1023)<<10)+(y&1023),++A,d[p++]=m>>18|240,d[p++]=m>>12&63|128,d[p++]=m>>6&63|128,d[p++]=m&63|128):(d[p++]=m>>12|224,d[p++]=m>>6&63|128,d[p++]=m&63|128);return p-g}},{}],15:[function(t,n,i){"use strict";n.exports=u;var r=t(12),o,s=r.LongBits,a=r.base64,c=r.utf8;function u(){this.pos=0,this.buf=this.constructor.alloc(u.initialBufferSize),this.view=null,this.states=null}u.initialBufferSize=128,Object.defineProperty(u.prototype,"len",{configurable:!0,enumerable:!0,get:function(){return this.pos}});var f=function(){return r.Buffer?function(){return(u.create=function(){return new o})()}:function(){return new u}};u.create=f(),u.alloc=function(E){return new Uint8Array(E)},u.alloc=r.pool(u.alloc,Uint8Array.prototype.subarray);function d(T){return T<128?1:T<16384?2:T<2097152?3:T<268435456?4:5}u.prototype._reserve=function(E){var v=this.pos+E;if(v>this.buf.length){var S=this.buf.length<<1;S<v&&(S=v);var I=this.constructor.alloc(S);I.set(this.buf.subarray(0,this.pos),0),this.buf=I,this.view=null}};function p(T,E,v){for(var S=0;S<T.length;)E[v++]=T.charCodeAt(S++)}function g(T,E,v){for(;T>127;)E[v++]=T&127|128,T>>>=7;return E[v]=T,v+1}u.prototype.uint32=function(E){E=E>>>0,this._reserve(5);var v=this.pos;return this.pos=g(E,this.buf,v),this},u.prototype.int32=function(E){return(E|=0)<0?(this._reserve(10),m(s.fromNumber(E),this.buf,this.pos),this.pos+=10,this):this.uint32(E)},u.prototype.sint32=function(E){return this.uint32((E<<1^E>>31)>>>0)};function m(T,E,v){for(var S=T.lo,I=T.hi;I;)E[v++]=S&127|128,S=(S>>>7|I<<25)>>>0,I>>>=7;for(;S>127;)E[v++]=S&127|128,S=S>>>7;return E[v]=S,v+1}u.prototype.uint64=function(E){var v=s.from(E);this._reserve(10);var S=this.pos;return this.pos=m(v,this.buf,S),this},u.prototype.int64=u.prototype.uint64,u.prototype.sint64=function(E){var v=s.from(E).zzEncode();this._reserve(10);var S=this.pos;return this.pos=m(v,this.buf,S),this},u.prototype.bool=function(E){return this._reserve(1),this.buf[this.pos++]=E?1:0,this};function y(T,E,v){E[v]=T&255,E[v+1]=T>>>8&255,E[v+2]=T>>>16&255,E[v+3]=T>>>24}u.prototype.fixed32=function(E){return this._reserve(4),y(E>>>0,this.buf,this.pos),this.pos+=4,this},u.prototype.sfixed32=u.prototype.fixed32,u.prototype.fixed64=function(E){var v=s.from(E);return this._reserve(8),y(v.lo,this.buf,this.pos),y(v.hi,this.buf,this.pos+4),this.pos+=8,this},u.prototype.sfixed64=u.prototype.fixed64,u.prototype.float=function(E){return this._reserve(4),r.float.writeFloatLE(E,this.buf,this.pos),this.pos+=4,this},u.prototype.double=function(E){return this._reserve(8),r.float.writeDoubleLE(E,this.buf,this.pos),this.pos+=8,this},u.prototype.bytes=function(E){var v=E.length>>>0;if(!v)return this._reserve(1),this.buf[this.pos++]=0,this;if(r.isString(E)){var S=u.alloc(v=a.length(E));a.decode(E,S,0),E=S}return this.uint32(v),this._reserve(v),this.buf.set(E,this.pos),this.pos+=v,this},u.prototype.raw=function(E){var v=E.length>>>0;return v?(this._reserve(v),this.buf.set(E,this.pos),this.pos+=v,this):this},u.prototype._delim=function(E,v){var S=d(v);return S>1&&this.buf.copyWithin(E+S,E+1,E+1+v),g(v,this.buf,E),this.pos=E+S+v,this},u.prototype.string=function(E){var v=E.length;if(!v)return this._reserve(1),this.buf[this.pos++]=0,this;if(v<128){this._reserve(v*3+5);var S=this.pos;return this._delim(S,c.write(E,this.buf,S+1))}var I=c.length(E);return this.uint32(I),this._reserve(I),I===E.length?p(E,this.buf,this.pos):c.write(E,this.buf,this.pos),this.pos+=I,this},u.prototype.uint32s=function(E){var v=E.length;this._reserve(v*5+5);for(var S=this.buf,I=this.pos,R=I+1,O=0;O<v;++O)R=g(E[O]>>>0,S,R);return this._delim(I,R-I-1)},u.prototype.int32s=function(E){var v=E.length;this._reserve(v*10+5);for(var S=this.buf,I=this.pos,R=I+1,O,L=0;L<v;++L)(O=E[L]|0)<0?R=m(s.fromNumber(O),S,R):R=g(O,S,R);return this._delim(I,R-I-1)},u.prototype.sint32s=function(E){var v=E.length;this._reserve(v*5+5);for(var S=this.buf,I=this.pos,R=I+1,O=0;O<v;++O)R=g((E[O]<<1^E[O]>>31)>>>0,S,R);return this._delim(I,R-I-1)},u.prototype.uint64s=function(E){var v=E.length;this._reserve(v*10+5);for(var S=this.buf,I=this.pos,R=I+1,O=0;O<v;++O)R=m(s.from(E[O]),S,R);return this._delim(I,R-I-1)},u.prototype.int64s=u.prototype.uint64s,u.prototype.sint64s=function(E){var v=E.length;this._reserve(v*10+5);for(var S=this.buf,I=this.pos,R=I+1,O=0;O<v;++O)R=m(s.from(E[O]).zzEncode(),S,R);return this._delim(I,R-I-1)},u.prototype.bools=function(E){var v=E.length;this.uint32(v),this._reserve(v);for(var S=this.buf,I=this.pos,R=0;R<v;++R)S[I++]=E[R]?1:0;return this.pos+=v,this};var A=16,b=128;function x(T,E,v){var S=T.view;if(S||E<v)return S;var I=T.buf;return T.view=new DataView(I.buffer,I.byteOffset,I.byteLength)}u.prototype.fixed32s=function(E){var v=E.length,S=v*4;this.uint32(S),this._reserve(S);var I=this.pos,R,O=x(this,v,b);if(O)for(R=0;R<v;++R)O.setUint32(I,E[R]>>>0,!0),I+=4;else{var L=this.buf;for(R=0;R<v;++R)y(E[R]>>>0,L,I),I+=4}return this.pos+=S,this},u.prototype.sfixed32s=u.prototype.fixed32s,u.prototype.fixed64s=function(E){var v=E.length,S=v*8;this.uint32(S),this._reserve(S);var I=this.pos,R,O,L=x(this,v,b);if(L)for(R=0;R<v;++R)O=s.from(E[R]),L.setUint32(I,O.lo,!0),L.setUint32(I+4,O.hi,!0),I+=8;else{var _=this.buf;for(R=0;R<v;++R)O=s.from(E[R]),y(O.lo,_,I),y(O.hi,_,I+4),I+=8}return this.pos+=S,this},u.prototype.sfixed64s=u.prototype.fixed64s,u.prototype.floats=function(E){var v=E.length,S=v*4;this.uint32(S),this._reserve(S);var I=this.pos,R,O=x(this,v,A);if(O)for(R=0;R<v;++R)O.setFloat32(I,E[R],!0),I+=4;else{var L=this.buf;for(R=0;R<v;++R)r.float.writeFloatLE(E[R],L,I),I+=4}return this.pos+=S,this},u.prototype.doubles=function(E){var v=E.length,S=v*8;this.uint32(S),this._reserve(S);var I=this.pos,R,O=x(this,v,A);if(O)for(R=0;R<v;++R)O.setFloat64(I,E[R],!0),I+=8;else{var L=this.buf;for(R=0;R<v;++R)r.float.writeDoubleLE(E[R],L,I),I+=8}return this.pos+=S,this},u.prototype.fork=function(){return this._reserve(1),(this.states||(this.states=[])).push(this.pos),this.pos+=1,this},u.prototype.reset=function(){var E=this.states;return E&&E.length?this.pos=E.pop():this.pos=0,this},u.prototype.ldelim=function(){var E=this.states,v,S;if(E&&E.length){var I=E.pop();v=this.pos-I-1,S=d(v),S>1?(this._reserve(S-1),this.buf.copyWithin(I+S,I+1,I+1+v),this.pos+=S-1,g(v,this.buf,I)):this.buf[I]=v}else v=this.pos,S=d(v),this._reserve(S),this.buf.copyWithin(S,0,v),g(v,this.buf,0),this.pos+=S;return this},u.prototype.finish=function(E){if(E)return this.buf.subarray(0,this.pos);var v=this.constructor.alloc(this.pos);return v.set(this.buf.subarray(0,this.pos),0),v},u.prototype.finishInto=function(E,v){return v===e&&(v=0),E.set(this.buf.subarray(0,this.pos),v),E},u._configure=function(T){o=T,u.create=f(),o._configure()}},{12:12}],16:[function(t,n,i){"use strict";n.exports=s;var r=t(15);s.prototype=Object.create(r.prototype,{constructor:{value:s,writable:!0,enumerable:!1,configurable:!0}});var o=t(12);function s(){r.call(this)}var a;s._configure=function(){s.alloc=o.Buffer&&o.Buffer.allocUnsafe,a=o.Buffer&&o.Buffer.prototype.utf8Write?function(u,f,d){return f.utf8Write(u,d)}:function(u,f,d){return f.write(u,d)}},s.prototype.bytes=function(u){o.isString(u)&&(u=o.Buffer.from(u,"base64"));var f=u.length>>>0;return this.uint32(f),f&&(this._reserve(f),this.buf.set(u,this.pos),this.pos+=f),this},s.prototype.string=function(u){var f=u.length;if(!f)return this._reserve(1),this.buf[this.pos++]=0,this;if(f<128){this._reserve(f*3+5);var d=this.pos,p=this.buf;return this._delim(d,f<40?o.utf8.write(u,p,d+1):a(u,p,d+1))}var g=o.Buffer.byteLength(u);return this.uint32(g),this._reserve(g),a(u,this.buf,this.pos),this.pos+=g,this},s._configure()},{12:12,15:15}]},{},[1])})()});var bke=Yi((pAr,KW)=>{/* Copyright 2015-2018 Esri. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 @preserve */(function(){var e=(function(){var r={};r.defaultNoDataValue=-34027999387901484e22,r.decode=function(f,d){d=d||{};var p=d.encodedMaskData||d.encodedMaskData===null,g=c(f,d.inputOffset||0,p),m=d.noDataValue!==null?d.noDataValue:r.defaultNoDataValue,y=o(g,d.pixelType||Float32Array,d.encodedMaskData,m,d.returnMask),A={width:g.width,height:g.height,pixelData:y.resultPixels,minValue:y.minValue,maxValue:g.pixels.maxValue,noDataValue:m};return y.resultMask&&(A.maskData=y.resultMask),d.returnEncodedMask&&g.mask&&(A.encodedMaskData=g.mask.bitset?g.mask.bitset:null),d.returnFileInfo&&(A.fileInfo=s(g),d.computeUsedBitDepths&&(A.fileInfo.bitDepths=a(g))),A};var o=function(f,d,p,g,m){var y=0,A=f.pixels.numBlocksX,b=f.pixels.numBlocksY,x=Math.floor(f.width/A),T=Math.floor(f.height/b),E=2*f.maxZError,v=Number.MAX_VALUE,S;p=p||(f.mask?f.mask.bitset:null);var I,R;I=new d(f.width*f.height),m&&p&&(R=new Uint8Array(f.width*f.height));for(var O=new Float32Array(x*T),L,_,C=0;C<=b;C++){var w=C!==b?T:f.height%b;if(w!==0)for(var P=0;P<=A;P++){var M=P!==A?x:f.width%A;if(M!==0){var F=C*f.width*T+P*x,V=f.width-M,B=f.pixels.blocks[y],j,k,G;B.encoding<2?(B.encoding===0?j=B.rawData:(u(B.stuffedData,B.bitsPerPixel,B.numValidPixels,B.offset,E,O,f.pixels.maxValue),j=O),k=0):B.encoding===2?G=0:G=B.offset;var q;if(p)for(_=0;_<w;_++){for(F&7&&(q=p[F>>3],q<<=F&7),L=0;L<M;L++)F&7||(q=p[F>>3]),q&128?(R&&(R[F]=1),S=B.encoding<2?j[k++]:G,v=v>S?S:v,I[F++]=S):(R&&(R[F]=0),I[F++]=g),q<<=1;F+=V}else if(B.encoding<2)for(_=0;_<w;_++){for(L=0;L<M;L++)S=j[k++],v=v>S?S:v,I[F++]=S;F+=V}else for(v=v>G?G:v,_=0;_<w;_++){for(L=0;L<M;L++)I[F++]=G;F+=V}if(B.encoding===1&&k!==B.numValidPixels)throw"Block and Mask do not match";y++}}}return{resultPixels:I,resultMask:R,minValue:v}},s=function(f){return{fileIdentifierString:f.fileIdentifierString,fileVersion:f.fileVersion,imageType:f.imageType,height:f.height,width:f.width,maxZError:f.maxZError,eofOffset:f.eofOffset,mask:f.mask?{numBlocksX:f.mask.numBlocksX,numBlocksY:f.mask.numBlocksY,numBytes:f.mask.numBytes,maxValue:f.mask.maxValue}:null,pixels:{numBlocksX:f.pixels.numBlocksX,numBlocksY:f.pixels.numBlocksY,numBytes:f.pixels.numBytes,maxValue:f.pixels.maxValue,noDataValue:f.noDataValue}}},a=function(f){for(var d=f.pixels.numBlocksX*f.pixels.numBlocksY,p={},g=0;g<d;g++){var m=f.pixels.blocks[g];m.encoding===0?p.float32=!0:m.encoding===1?p[m.bitsPerPixel]=!0:p[0]=!0}return Object.keys(p)},c=function(f,d,p){var g={},m=new Uint8Array(f,d,10);if(g.fileIdentifierString=String.fromCharCode.apply(null,m),g.fileIdentifierString.trim()!=="CntZImage")throw"Unexpected file identifier string: "+g.fileIdentifierString;d+=10;var y=new DataView(f,d,24);if(g.fileVersion=y.getInt32(0,!0),g.imageType=y.getInt32(4,!0),g.height=y.getUint32(8,!0),g.width=y.getUint32(12,!0),g.maxZError=y.getFloat64(16,!0),d+=24,!p)if(y=new DataView(f,d,16),g.mask={},g.mask.numBlocksY=y.getUint32(0,!0),g.mask.numBlocksX=y.getUint32(4,!0),g.mask.numBytes=y.getUint32(8,!0),g.mask.maxValue=y.getFloat32(12,!0),d+=16,g.mask.numBytes>0){var A=new Uint8Array(Math.ceil(g.width*g.height/8));y=new DataView(f,d,g.mask.numBytes);var b=y.getInt16(0,!0),x=2,T=0;do{if(b>0)for(;b--;)A[T++]=y.getUint8(x++);else{var E=y.getUint8(x++);for(b=-b;b--;)A[T++]=E}b=y.getInt16(x,!0),x+=2}while(x<g.mask.numBytes);if(b!==-32768||T<A.length)throw"Unexpected end of mask RLE encoding";g.mask.bitset=A,d+=g.mask.numBytes}else(g.mask.numBytes|g.mask.numBlocksY|g.mask.maxValue)===0&&(g.mask.bitset=new Uint8Array(Math.ceil(g.width*g.height/8)));y=new DataView(f,d,16),g.pixels={},g.pixels.numBlocksY=y.getUint32(0,!0),g.pixels.numBlocksX=y.getUint32(4,!0),g.pixels.numBytes=y.getUint32(8,!0),g.pixels.maxValue=y.getFloat32(12,!0),d+=16;var v=g.pixels.numBlocksX,S=g.pixels.numBlocksY,I=v+(g.width%v>0?1:0),R=S+(g.height%S>0?1:0);g.pixels.blocks=new Array(I*R);for(var O=0,L=0;L<R;L++)for(var _=0;_<I;_++){var C=0,w=f.byteLength-d;y=new DataView(f,d,Math.min(10,w));var P={};g.pixels.blocks[O++]=P;var M=y.getUint8(0);if(C++,P.encoding=M&63,P.encoding>3)throw"Invalid block encoding ("+P.encoding+")";if(P.encoding===2){d++;continue}if(M!==0&&M!==2){if(M>>=6,P.offsetType=M,M===2)P.offset=y.getInt8(1),C++;else if(M===1)P.offset=y.getInt16(1,!0),C+=2;else if(M===0)P.offset=y.getFloat32(1,!0),C+=4;else throw"Invalid block offset type";if(P.encoding===1)if(M=y.getUint8(C),C++,P.bitsPerPixel=M&63,M>>=6,P.numValidPixelsType=M,M===2)P.numValidPixels=y.getUint8(C),C++;else if(M===1)P.numValidPixels=y.getUint16(C,!0),C+=2;else if(M===0)P.numValidPixels=y.getUint32(C,!0),C+=4;else throw"Invalid valid pixel count type"}if(d+=C,P.encoding!==3){var F,V;if(P.encoding===0){var B=(g.pixels.numBytes-1)/4;if(B!==Math.floor(B))throw"uncompressed block has invalid length";F=new ArrayBuffer(B*4),V=new Uint8Array(F),V.set(new Uint8Array(f,d,B*4));var j=new Float32Array(F);P.rawData=j,d+=B*4}else if(P.encoding===1){var k=Math.ceil(P.numValidPixels*P.bitsPerPixel/8),G=Math.ceil(k/4);F=new ArrayBuffer(G*4),V=new Uint8Array(F),V.set(new Uint8Array(f,d,k)),P.stuffedData=new Uint32Array(F),d+=k}}}return g.eofOffset=d,g},u=function(f,d,p,g,m,y,A){var b=(1<<d)-1,x=0,T,E=0,v,S,I=Math.ceil((A-g)/m),R=f.length*4-Math.ceil(d*p/8);for(f[f.length-1]<<=8*R,T=0;T<p;T++){if(E===0&&(S=f[x++],E=32),E>=d)v=S>>>E-d&b,E-=d;else{var O=d-E;v=(S&b)<<O&b,S=f[x++],E=32-O,v+=S>>>E}y[T]=v<I?g+v*m:A}return y};return r})(),t=(function(){"use strict";var r={unstuff:function(c,u,f,d,p,g,m,y){var A=(1<<f)-1,b=0,x,T=0,E,v,S,I,R=c.length*4-Math.ceil(f*d/8);if(c[c.length-1]<<=8*R,p)for(x=0;x<d;x++)T===0&&(v=c[b++],T=32),T>=f?(E=v>>>T-f&A,T-=f):(S=f-T,E=(v&A)<<S&A,v=c[b++],T=32-S,E+=v>>>T),u[x]=p[E];else for(I=Math.ceil((y-g)/m),x=0;x<d;x++)T===0&&(v=c[b++],T=32),T>=f?(E=v>>>T-f&A,T-=f):(S=f-T,E=(v&A)<<S&A,v=c[b++],T=32-S,E+=v>>>T),u[x]=E<I?g+E*m:y},unstuffLUT:function(c,u,f,d,p,g){var m=(1<<u)-1,y=0,A=0,b=0,x=0,T=0,E,v=[],S=c.length*4-Math.ceil(u*f/8);c[c.length-1]<<=8*S;var I=Math.ceil((g-d)/p);for(A=0;A<f;A++)x===0&&(E=c[y++],x=32),x>=u?(T=E>>>x-u&m,x-=u):(b=u-x,T=(E&m)<<b&m,E=c[y++],x=32-b,T+=E>>>x),v[A]=T<I?d+T*p:g;return v.unshift(d),v},unstuff2:function(c,u,f,d,p,g,m,y){var A=(1<<f)-1,b=0,x,T=0,E=0,v,S,I;if(p)for(x=0;x<d;x++)T===0&&(S=c[b++],T=32,E=0),T>=f?(v=S>>>E&A,T-=f,E+=f):(I=f-T,v=S>>>E&A,S=c[b++],T=32-I,v|=(S&(1<<I)-1)<<f-I,E=I),u[x]=p[v];else{var R=Math.ceil((y-g)/m);for(x=0;x<d;x++)T===0&&(S=c[b++],T=32,E=0),T>=f?(v=S>>>E&A,T-=f,E+=f):(I=f-T,v=S>>>E&A,S=c[b++],T=32-I,v|=(S&(1<<I)-1)<<f-I,E=I),u[x]=v<R?g+v*m:y}return u},unstuffLUT2:function(c,u,f,d,p,g){var m=(1<<u)-1,y=0,A=0,b=0,x=0,T=0,E=0,v,S=[],I=Math.ceil((g-d)/p);for(A=0;A<f;A++)x===0&&(v=c[y++],x=32,E=0),x>=u?(T=v>>>E&m,x-=u,E+=u):(b=u-x,T=v>>>E&m,v=c[y++],x=32-b,T|=(v&(1<<b)-1)<<u-b,E=b),S[A]=T<I?d+T*p:g;return S.unshift(d),S},originalUnstuff:function(c,u,f,d){var p=(1<<f)-1,g=0,m,y=0,A,b,x,T=c.length*4-Math.ceil(f*d/8);for(c[c.length-1]<<=8*T,m=0;m<d;m++)y===0&&(b=c[g++],y=32),y>=f?(A=b>>>y-f&p,y-=f):(x=f-y,A=(b&p)<<x&p,b=c[g++],y=32-x,A+=b>>>y),u[m]=A;return u},originalUnstuff2:function(c,u,f,d){var p=(1<<f)-1,g=0,m,y=0,A=0,b,x,T;for(m=0;m<d;m++)y===0&&(x=c[g++],y=32,A=0),y>=f?(b=x>>>A&p,y-=f,A+=f):(T=f-y,b=x>>>A&p,x=c[g++],y=32-T,b|=(x&(1<<T)-1)<<f-T,A=T),u[m]=b;return u}},o={HUFFMAN_LUT_BITS_MAX:12,computeChecksumFletcher32:function(c){for(var u=65535,f=65535,d=c.length,p=Math.floor(d/2),g=0;p;){var m=p>=359?359:p;p-=m;do u+=c[g++]<<8,f+=u+=c[g++];while(--m);u=(u&65535)+(u>>>16),f=(f&65535)+(f>>>16)}return d&1&&(f+=u+=c[g]<<8),u=(u&65535)+(u>>>16),f=(f&65535)+(f>>>16),(f<<16|u)>>>0},readHeaderInfo:function(c,u){var f=u.ptr,d=new Uint8Array(c,f,6),p={};if(p.fileIdentifierString=String.fromCharCode.apply(null,d),p.fileIdentifierString.lastIndexOf("Lerc2",0)!==0)throw"Unexpected file identifier string (expect Lerc2 ): "+p.fileIdentifierString;f+=6;var g=new DataView(c,f,8),m=g.getInt32(0,!0);p.fileVersion=m,f+=4,m>=3&&(p.checksum=g.getUint32(4,!0),f+=4),g=new DataView(c,f,12),p.height=g.getUint32(0,!0),p.width=g.getUint32(4,!0),f+=8,m>=4?(p.numDims=g.getUint32(8,!0),f+=4):p.numDims=1,g=new DataView(c,f,40),p.numValidPixel=g.getUint32(0,!0),p.microBlockSize=g.getInt32(4,!0),p.blobSize=g.getInt32(8,!0),p.imageType=g.getInt32(12,!0),p.maxZError=g.getFloat64(16,!0),p.zMin=g.getFloat64(24,!0),p.zMax=g.getFloat64(32,!0),f+=40,u.headerInfo=p,u.ptr=f;var y,A;if(m>=3&&(A=m>=4?52:48,y=this.computeChecksumFletcher32(new Uint8Array(c,f-A,p.blobSize-14)),y!==p.checksum))throw"Checksum failed.";return!0},checkMinMaxRanges:function(c,u){var f=u.headerInfo,d=this.getDataTypeArray(f.imageType),p=f.numDims*this.getDataTypeSize(f.imageType),g=this.readSubArray(c,u.ptr,d,p),m=this.readSubArray(c,u.ptr+p,d,p);u.ptr+=2*p;var y,A=!0;for(y=0;y<f.numDims;y++)if(g[y]!==m[y]){A=!1;break}return f.minValues=g,f.maxValues=m,A},readSubArray:function(c,u,f,d){var p;if(f===Uint8Array)p=new Uint8Array(c,u,d);else{var g=new ArrayBuffer(d),m=new Uint8Array(g);m.set(new Uint8Array(c,u,d)),p=new f(g)}return p},readMask:function(c,u){var f=u.ptr,d=u.headerInfo,p=d.width*d.height,g=d.numValidPixel,m=new DataView(c,f,4),y={};if(y.numBytes=m.getUint32(0,!0),f+=4,(g===0||p===g)&&y.numBytes!==0)throw"invalid mask";var A,b;if(g===0)A=new Uint8Array(Math.ceil(p/8)),y.bitset=A,b=new Uint8Array(p),u.pixels.resultMask=b,f+=y.numBytes;else if(y.numBytes>0){A=new Uint8Array(Math.ceil(p/8)),m=new DataView(c,f,y.numBytes);var x=m.getInt16(0,!0),T=2,E=0,v=0;do{if(x>0)for(;x--;)A[E++]=m.getUint8(T++);else for(v=m.getUint8(T++),x=-x;x--;)A[E++]=v;x=m.getInt16(T,!0),T+=2}while(T<y.numBytes);if(x!==-32768||E<A.length)throw"Unexpected end of mask RLE encoding";b=new Uint8Array(p);var S=0,I=0;for(I=0;I<p;I++)I&7?(S=A[I>>3],S<<=I&7):S=A[I>>3],S&128&&(b[I]=1);u.pixels.resultMask=b,y.bitset=A,f+=y.numBytes}return u.ptr=f,u.mask=y,!0},readDataOneSweep:function(c,u,f){var d=u.ptr,p=u.headerInfo,g=p.numDims,m=p.width*p.height,y=p.imageType,A=p.numValidPixel*o.getDataTypeSize(y)*g,b,x=u.pixels.resultMask;if(f===Uint8Array)b=new Uint8Array(c,d,A);else{var T=new ArrayBuffer(A),E=new Uint8Array(T);E.set(new Uint8Array(c,d,A)),b=new f(T)}if(b.length===m*g)u.pixels.resultPixels=b;else{u.pixels.resultPixels=new f(m*g);var v=0,S=0,I=0,R=0;if(g>1)for(I=0;I<g;I++)for(R=I*m,S=0;S<m;S++)x[S]&&(u.pixels.resultPixels[R+S]=b[v++]);else for(S=0;S<m;S++)x[S]&&(u.pixels.resultPixels[S]=b[v++])}return d+=A,u.ptr=d,!0},readHuffmanTree:function(c,u){var f=this.HUFFMAN_LUT_BITS_MAX,d=new DataView(c,u.ptr,16);u.ptr+=16;var p=d.getInt32(0,!0);if(p<2)throw"unsupported Huffman version";var g=d.getInt32(4,!0),m=d.getInt32(8,!0),y=d.getInt32(12,!0);if(m>=y)return!1;var A=new Uint32Array(y-m);o.decodeBits(c,u,A);var b=[],x,T,E,v;for(x=m;x<y;x++)T=x-(x<g?0:g),b[T]={first:A[x-m],second:null};var S=c.byteLength-u.ptr,I=Math.ceil(S/4),R=new ArrayBuffer(I*4),O=new Uint8Array(R);O.set(new Uint8Array(c,u.ptr,S));var L=new Uint32Array(R),_=0,C,w=0;for(C=L[0],x=m;x<y;x++)T=x-(x<g?0:g),v=b[T].first,v>0&&(b[T].second=C<<_>>>32-v,32-_>=v?(_+=v,_===32&&(_=0,w++,C=L[w])):(_+=v-32,w++,C=L[w],b[T].second|=C>>>32-_));var P=0,M=0,F=new s;for(x=0;x<b.length;x++)b[x]!==void 0&&(P=Math.max(P,b[x].first));P>=f?M=f:M=P,P>=30&&console.log("WARning, large NUM LUT BITS IS "+P);var V=[],B,j,k,G,q,Q;for(x=m;x<y;x++)if(T=x-(x<g?0:g),v=b[T].first,v>0)if(B=[v,T],v<=M)for(j=b[T].second<<M-v,k=1<<M-v,E=0;E<k;E++)V[j|E]=B;else for(j=b[T].second,Q=F,G=v-1;G>=0;G--)q=j>>>G&1,q?(Q.right||(Q.right=new s),Q=Q.right):(Q.left||(Q.left=new s),Q=Q.left),G===0&&!Q.val&&(Q.val=B[1]);return{decodeLut:V,numBitsLUTQick:M,numBitsLUT:P,tree:F,stuffedData:L,srcPtr:w,bitPos:_}},readHuffman:function(c,u,f){var d=u.headerInfo,p=d.numDims,g=u.headerInfo.height,m=u.headerInfo.width,y=m*g,A=this.readHuffmanTree(c,u),b=A.decodeLut,x=A.tree,T=A.stuffedData,E=A.srcPtr,v=A.bitPos,S=A.numBitsLUTQick,I=A.numBitsLUT,R=u.headerInfo.imageType===0?128:0,O,L,_,C=u.pixels.resultMask,w,P,M,F,V,B,j,k=0;v>0&&(E++,v=0);var G=T[E],q=u.encodeMode===1,Q=new f(y*p),W=Q,J;for(J=0;J<d.numDims;J++){if(p>1&&(W=new f(Q.buffer,y*J,y),k=0),u.headerInfo.numValidPixel===m*g)for(B=0,F=0;F<g;F++)for(V=0;V<m;V++,B++){if(L=0,w=G<<v>>>32-S,P=w,32-v<S&&(w|=T[E+1]>>>64-v-S,P=w),b[P])L=b[P][1],v+=b[P][0];else for(w=G<<v>>>32-I,P=w,32-v<I&&(w|=T[E+1]>>>64-v-I,P=w),O=x,j=0;j<I;j++)if(M=w>>>I-j-1&1,O=M?O.right:O.left,!(O.left||O.right)){L=O.val,v=v+j+1;break}v>=32&&(v-=32,E++,G=T[E]),_=L-R,q?(V>0?_+=k:F>0?_+=W[B-m]:_+=k,_&=255,W[B]=_,k=_):W[B]=_}else for(B=0,F=0;F<g;F++)for(V=0;V<m;V++,B++)if(C[B]){if(L=0,w=G<<v>>>32-S,P=w,32-v<S&&(w|=T[E+1]>>>64-v-S,P=w),b[P])L=b[P][1],v+=b[P][0];else for(w=G<<v>>>32-I,P=w,32-v<I&&(w|=T[E+1]>>>64-v-I,P=w),O=x,j=0;j<I;j++)if(M=w>>>I-j-1&1,O=M?O.right:O.left,!(O.left||O.right)){L=O.val,v=v+j+1;break}v>=32&&(v-=32,E++,G=T[E]),_=L-R,q?(V>0&&C[B-1]?_+=k:F>0&&C[B-m]?_+=W[B-m]:_+=k,_&=255,W[B]=_,k=_):W[B]=_}u.ptr=u.ptr+(E+1)*4+(v>0?4:0)}u.pixels.resultPixels=Q},decodeBits:function(c,u,f,d,p){{var g=u.headerInfo,m=g.fileVersion,y=0,A=new DataView(c,u.ptr,5),b=A.getUint8(0);y++;var x=b>>6,T=x===0?4:3-x,E=(b&32)>0,v=b&31,S=0;if(T===1)S=A.getUint8(y),y++;else if(T===2)S=A.getUint16(y,!0),y+=2;else if(T===4)S=A.getUint32(y,!0),y+=4;else throw"Invalid valid pixel count type";var I=2*g.maxZError,R,O,L,_,C,w,P,M,F,V,B=g.numDims>1?g.maxValues[p]:g.zMax;if(E){for(u.counter.lut++,M=A.getUint8(y),F=v,y++,_=Math.ceil((M-1)*v/8),C=Math.ceil(_/4),O=new ArrayBuffer(C*4),L=new Uint8Array(O),u.ptr+=y,L.set(new Uint8Array(c,u.ptr,_)),P=new Uint32Array(O),u.ptr+=_,V=0;M-1>>>V;)V++;_=Math.ceil(S*V/8),C=Math.ceil(_/4),O=new ArrayBuffer(C*4),L=new Uint8Array(O),L.set(new Uint8Array(c,u.ptr,_)),R=new Uint32Array(O),u.ptr+=_,m>=3?w=r.unstuffLUT2(P,v,M-1,d,I,B):w=r.unstuffLUT(P,v,M-1,d,I,B),m>=3?r.unstuff2(R,f,V,S,w):r.unstuff(R,f,V,S,w)}else u.counter.bitstuffer++,V=v,u.ptr+=y,V>0&&(_=Math.ceil(S*V/8),C=Math.ceil(_/4),O=new ArrayBuffer(C*4),L=new Uint8Array(O),L.set(new Uint8Array(c,u.ptr,_)),R=new Uint32Array(O),u.ptr+=_,m>=3?d==null?r.originalUnstuff2(R,f,V,S):r.unstuff2(R,f,V,S,!1,d,I,B):d==null?r.originalUnstuff(R,f,V,S):r.unstuff(R,f,V,S,!1,d,I,B))}},readTiles:function(c,u,f){var d=u.headerInfo,p=d.width,g=d.height,m=d.microBlockSize,y=d.imageType,A=o.getDataTypeSize(y),b=Math.ceil(p/m),x=Math.ceil(g/m);u.pixels.numBlocksY=x,u.pixels.numBlocksX=b,u.pixels.ptr=0;var T=0,E=0,v=0,S=0,I=0,R=0,O=0,L=0,_=0,C=0,w=0,P=0,M=0,F=0,V=0,B=0,j,k,G,q,Q,W,J=new f(m*m),Z=g%m||m,ae=p%m||m,Ae,fe,xe=d.numDims,ge,we=u.pixels.resultMask,Se=u.pixels.resultPixels;for(v=0;v<x;v++)for(I=v!==x-1?m:Z,S=0;S<b;S++)for(R=S!==b-1?m:ae,w=v*p*m+S*m,P=p-R,ge=0;ge<xe;ge++){if(xe>1&&(Se=new f(u.pixels.resultPixels.buffer,p*g*ge*A,p*g)),O=c.byteLength-u.ptr,j=new DataView(c,u.ptr,Math.min(10,O)),k={},B=0,L=j.getUint8(0),B++,_=L>>6&255,C=L>>2&15,C!==(S*m>>3&15))throw"integrity issue";if(W=L&3,W>3)throw u.ptr+=B,"Invalid block encoding ("+W+")";if(W===2){u.counter.constant++,u.ptr+=B;continue}else if(W===0){if(u.counter.uncompressed++,u.ptr+=B,M=I*R*A,F=c.byteLength-u.ptr,M=M<F?M:F,G=new ArrayBuffer(M%A===0?M:M+A-M%A),q=new Uint8Array(G),q.set(new Uint8Array(c,u.ptr,M)),Q=new f(G),V=0,we)for(T=0;T<I;T++){for(E=0;E<R;E++)we[w]&&(Se[w]=Q[V++]),w++;w+=P}else for(T=0;T<I;T++){for(E=0;E<R;E++)Se[w++]=Q[V++];w+=P}u.ptr+=V*A}else if(Ae=o.getDataTypeUsed(y,_),fe=o.getOnePixel(k,B,Ae,j),B+=o.getDataTypeSize(Ae),W===3)if(u.ptr+=B,u.counter.constantoffset++,we)for(T=0;T<I;T++){for(E=0;E<R;E++)we[w]&&(Se[w]=fe),w++;w+=P}else for(T=0;T<I;T++){for(E=0;E<R;E++)Se[w++]=fe;w+=P}else if(u.ptr+=B,o.decodeBits(c,u,J,fe,ge),B=0,we)for(T=0;T<I;T++){for(E=0;E<R;E++)we[w]&&(Se[w]=J[B++]),w++;w+=P}else for(T=0;T<I;T++){for(E=0;E<R;E++)Se[w++]=J[B++];w+=P}}},formatFileInfo:function(c){return{fileIdentifierString:c.headerInfo.fileIdentifierString,fileVersion:c.headerInfo.fileVersion,imageType:c.headerInfo.imageType,height:c.headerInfo.height,width:c.headerInfo.width,numValidPixel:c.headerInfo.numValidPixel,microBlockSize:c.headerInfo.microBlockSize,blobSize:c.headerInfo.blobSize,maxZError:c.headerInfo.maxZError,pixelType:o.getPixelType(c.headerInfo.imageType),eofOffset:c.eofOffset,mask:c.mask?{numBytes:c.mask.numBytes}:null,pixels:{numBlocksX:c.pixels.numBlocksX,numBlocksY:c.pixels.numBlocksY,maxValue:c.headerInfo.zMax,minValue:c.headerInfo.zMin,noDataValue:c.noDataValue}}},constructConstantSurface:function(c){var u=c.headerInfo.zMax,f=c.headerInfo.numDims,d=c.headerInfo.height*c.headerInfo.width,p=d*f,g=0,m=0,y=0,A=c.pixels.resultMask;if(A)if(f>1)for(g=0;g<f;g++)for(y=g*d,m=0;m<d;m++)A[m]&&(c.pixels.resultPixels[y+m]=u);else for(m=0;m<d;m++)A[m]&&(c.pixels.resultPixels[m]=u);else if(c.pixels.resultPixels.fill)c.pixels.resultPixels.fill(u);else for(m=0;m<p;m++)c.pixels.resultPixels[m]=u},getDataTypeArray:function(c){var u;switch(c){case 0:u=Int8Array;break;case 1:u=Uint8Array;break;case 2:u=Int16Array;break;case 3:u=Uint16Array;break;case 4:u=Int32Array;break;case 5:u=Uint32Array;break;case 6:u=Float32Array;break;case 7:u=Float64Array;break;default:u=Float32Array}return u},getPixelType:function(c){var u;switch(c){case 0:u="S8";break;case 1:u="U8";break;case 2:u="S16";break;case 3:u="U16";break;case 4:u="S32";break;case 5:u="U32";break;case 6:u="F32";break;case 7:u="F64";break;default:u="F32"}return u},isValidPixelValue:function(c,u){if(u==null)return!1;var f;switch(c){case 0:f=u>=-128&&u<=127;break;case 1:f=u>=0&&u<=255;break;case 2:f=u>=-32768&&u<=32767;break;case 3:f=u>=0&&u<=65536;break;case 4:f=u>=-2147483648&&u<=2147483647;break;case 5:f=u>=0&&u<=4294967296;break;case 6:f=u>=-34027999387901484e22&&u<=34027999387901484e22;break;case 7:f=u>=5e-324&&u<=17976931348623157e292;break;default:f=!1}return f},getDataTypeSize:function(c){var u=0;switch(c){case 0:case 1:u=1;break;case 2:case 3:u=2;break;case 4:case 5:case 6:u=4;break;case 7:u=8;break;default:u=c}return u},getDataTypeUsed:function(c,u){var f=c;switch(c){case 2:case 4:f=c-u;break;case 3:case 5:f=c-2*u;break;case 6:u===0?f=c:u===1?f=2:f=1;break;case 7:u===0?f=c:f=c-2*u+1;break;default:f=c;break}return f},getOnePixel:function(c,u,f,d){var p=0;switch(f){case 0:p=d.getInt8(u);break;case 1:p=d.getUint8(u);break;case 2:p=d.getInt16(u,!0);break;case 3:p=d.getUint16(u,!0);break;case 4:p=d.getInt32(u,!0);break;case 5:p=d.getUInt32(u,!0);break;case 6:p=d.getFloat32(u,!0);break;case 7:p=d.getFloat64(u,!0);break;default:throw"the decoder does not understand this pixel type"}return p}},s=function(c,u,f){this.val=c,this.left=u,this.right=f},a={decode:function(c,u){u=u||{};var f=u.noDataValue,d=0,p={};if(p.ptr=u.inputOffset||0,p.pixels={},!!o.readHeaderInfo(c,p)){var g=p.headerInfo,m=g.fileVersion,y=o.getDataTypeArray(g.imageType);o.readMask(c,p),g.numValidPixel!==g.width*g.height&&!p.pixels.resultMask&&(p.pixels.resultMask=u.maskData);var A=g.width*g.height;if(p.pixels.resultPixels=new y(A*g.numDims),p.counter={onesweep:0,uncompressed:0,lut:0,bitstuffer:0,constant:0,constantoffset:0},g.numValidPixel!==0)if(g.zMax===g.zMin)o.constructConstantSurface(p);else if(m>=4&&o.checkMinMaxRanges(c,p))o.constructConstantSurface(p);else{var b=new DataView(c,p.ptr,2),x=b.getUint8(0);if(p.ptr++,x)o.readDataOneSweep(c,p,y);else if(m>1&&g.imageType<=1&&Math.abs(g.maxZError-.5)<1e-5){var T=b.getUint8(1);if(p.ptr++,p.encodeMode=T,T>2||m<4&&T>1)throw"Invalid Huffman flag "+T;T?o.readHuffman(c,p,y):o.readTiles(c,p,y)}else o.readTiles(c,p,y)}p.eofOffset=p.ptr;var E;u.inputOffset?(E=p.headerInfo.blobSize+u.inputOffset-p.ptr,Math.abs(E)>=1&&(p.eofOffset=u.inputOffset+p.headerInfo.blobSize)):(E=p.headerInfo.blobSize-p.ptr,Math.abs(E)>=1&&(p.eofOffset=p.headerInfo.blobSize));var v={width:g.width,height:g.height,pixelData:p.pixels.resultPixels,minValue:g.zMin,maxValue:g.zMax,validPixelCount:g.numValidPixel,dimCount:g.numDims,dimStats:{minValues:g.minValues,maxValues:g.maxValues},maskData:p.pixels.resultMask};if(p.pixels.resultMask&&o.isValidPixelValue(g.imageType,f)){var S=p.pixels.resultMask;for(d=0;d<A;d++)S[d]||(v.pixelData[d]=f);v.noDataValue=f}return p.noDataValue=f,u.returnFileInfo&&(v.fileInfo=o.formatFileInfo(p)),v}},getBandCount:function(c){var u=0,f=0,d={};for(d.ptr=0,d.pixels={};f<c.byteLength-58;)o.readHeaderInfo(c,d),f+=d.headerInfo.blobSize,u++,d.ptr=f;return u}};return a})(),n=(function(){var r=new ArrayBuffer(4),o=new Uint8Array(r),s=new Uint32Array(r);return s[0]=1,o[0]===1})(),i={decode:function(r,o){if(!n)throw"Big endian system is not supported.";o=o||{};var s=o.inputOffset||0,a=new Uint8Array(r,s,10),c=String.fromCharCode.apply(null,a),u,f;if(c.trim()==="CntZImage")u=e,f=1;else if(c.substring(0,5)==="Lerc2")u=t,f=2;else throw"Unexpected file identifier string: "+c;for(var d=0,p=r.byteLength-10,g,m=[],y,A,b={width:0,height:0,pixels:[],pixelType:o.pixelType,mask:null,statistics:[]};s<p;){var x=u.decode(r,{inputOffset:s,encodedMaskData:g,maskData:A,returnMask:d===0,returnEncodedMask:d===0,returnFileInfo:!0,pixelType:o.pixelType||null,noDataValue:o.noDataValue||null});s=x.fileInfo.eofOffset,d===0&&(g=x.encodedMaskData,A=x.maskData,b.width=x.width,b.height=x.height,b.dimCount=x.dimCount||1,b.pixelType=x.pixelType||x.fileInfo.pixelType,b.mask=x.maskData),f>1&&x.fileInfo.mask&&x.fileInfo.mask.numBytes>0&&m.push(x.maskData),d++,b.pixels.push(x.pixelData),b.statistics.push({minValue:x.minValue,maxValue:x.maxValue,noDataValue:x.noDataValue,dimStats:x.dimStats})}var T,E,v;if(f>1&&m.length>1){for(v=b.width*b.height,b.bandMasks=m,A=new Uint8Array(v),A.set(m[0]),T=1;T<m.length;T++)for(y=m[T],E=0;E<v;E++)A[E]=A[E]&y[E];b.maskData=A}return b}};typeof define=="function"&&define.amd?define([],function(){return i}):typeof KW<"u"&&KW.exports?KW.exports=i:this.Lerc=i})()});var g3e=Yi((lj,Wle)=>{/*! NoSleep.min.js v0.12.0 - git.io/vfn01 - Rich Tibbett - MIT license */(function(e,t){typeof lj=="object"&&typeof Wle=="object"?Wle.exports=t():typeof define=="function"&&define.amd?define([],t):typeof lj=="object"?lj.NoSleep=t():e.NoSleep=t()})(lj,(function(){return(function(e){var t={};function n(i){if(t[i])return t[i].exports;var r=t[i]={i,l:!1,exports:{}};return e[i].call(r.exports,r,r.exports,n),r.l=!0,r.exports}return n.m=e,n.c=t,n.d=function(i,r,o){n.o(i,r)||Object.defineProperty(i,r,{enumerable:!0,get:o})},n.r=function(i){typeof Symbol<"u"&&Symbol.toStringTag&&Object.defineProperty(i,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(i,"__esModule",{value:!0})},n.t=function(i,r){if(1&r&&(i=n(i)),8&r||4&r&&typeof i=="object"&&i&&i.__esModule)return i;var o=Object.create(null);if(n.r(o),Object.defineProperty(o,"default",{enumerable:!0,value:i}),2&r&&typeof i!="string")for(var s in i)n.d(o,s,function(a){return i[a]}.bind(null,s));return o},n.n=function(i){var r=i&&i.__esModule?function(){return i.default}:function(){return i};return n.d(r,"a",r),r},n.o=function(i,r){return Object.prototype.hasOwnProperty.call(i,r)},n.p="",n(n.s=0)})([function(e,t,n){"use strict";var i=(function(){function f(d,p){for(var g=0;g<p.length;g++){var m=p[g];m.enumerable=m.enumerable||!1,m.configurable=!0,"value"in m&&(m.writable=!0),Object.defineProperty(d,m.key,m)}}return function(d,p,g){return p&&f(d.prototype,p),g&&f(d,g),d}})(),r=n(1),o=r.webm,s=r.mp4,a=function(){return typeof navigator<"u"&&parseFloat((""+(/CPU.*OS ([0-9_]{3,4})[0-9_]{0,1}|(CPU like).*AppleWebKit.*Mobile/i.exec(navigator.userAgent)||[0,""])[1]).replace("undefined","3_2").replace("_",".").replace("_",""))<10&&!window.MSStream},c=function(){return"wakeLock"in navigator},u=(function(){function f(){var d=this;if((function(g,m){if(!(g instanceof m))throw new TypeError("Cannot call a class as a function")})(this,f),this.enabled=!1,c()){this._wakeLock=null;var p=function(){d._wakeLock!==null&&document.visibilityState==="visible"&&d.enable()};document.addEventListener("visibilitychange",p),document.addEventListener("fullscreenchange",p)}else a()?this.noSleepTimer=null:(this.noSleepVideo=document.createElement("video"),this.noSleepVideo.setAttribute("title","No Sleep"),this.noSleepVideo.setAttribute("playsinline",""),this._addSourceToVideo(this.noSleepVideo,"webm",o),this._addSourceToVideo(this.noSleepVideo,"mp4",s),this.noSleepVideo.addEventListener("loadedmetadata",(function(){d.noSleepVideo.duration<=1?d.noSleepVideo.setAttribute("loop",""):d.noSleepVideo.addEventListener("timeupdate",(function(){d.noSleepVideo.currentTime>.5&&(d.noSleepVideo.currentTime=Math.random())}))})))}return i(f,[{key:"_addSourceToVideo",value:function(d,p,g){var m=document.createElement("source");m.src=g,m.type="video/"+p,d.appendChild(m)}},{key:"enable",value:function(){var d=this;return c()?navigator.wakeLock.request("screen").then((function(p){d._wakeLock=p,d.enabled=!0,console.log("Wake Lock active."),d._wakeLock.addEventListener("release",(function(){console.log("Wake Lock released.")}))})).catch((function(p){throw d.enabled=!1,console.error(p.name+", "+p.message),p})):a()?(this.disable(),console.warn(` + */(function(e){"use strict";(function(n,i,r){function o(a){var c=i[a];return c||n[a][0].call(c=i[a]={exports:{}},o,c,c.exports),c.exports}var s=o(r[0]);s.util.global.protobuf=s,typeof define=="function"&&define.amd&&define(["long"],function(a){return a&&a.isLong&&(s.util.Long=a,s.configure()),s}),typeof k4=="object"&&k4&&k4.exports&&(k4.exports=s)})({1:[function(t,n,i){"use strict";i.build="minimal",i.Writer=t(15),i.BufferWriter=t(16),i.Reader=t(2),i.BufferReader=t(3),i.util=t(12),i.rpc=t(5),i.roots=t(4),i.configure=r;function r(){i.util.LongBits._configure(i.util.Long),i.Writer._configure(i.BufferWriter),i.Reader._configure(i.BufferReader)}r()},{12:12,15:15,16:16,2:2,3:3,4:4,5:5}],2:[function(t,n,i){"use strict";n.exports=u;var r=t(12),o,s=r.LongBits,a=r.utf8;function c(T,E){return RangeError("index out of range: "+T.pos+" + "+(E||1)+" > "+T.len)}function u(T){this.buf=T,this.pos=0,this.len=T.length,this.view=null,this.discardUnknown=u.discardUnknown}function f(T){if(Array.isArray(T)&&(T=new Uint8Array(T)),T instanceof Uint8Array)return new u(T);throw Error("illegal buffer")}var d=function(){return r.Buffer?function(v){return(u.create=function(I){return r.Buffer.isBuffer(I)?new o(I):f(I)})(v)}:f};u.create=d(),u.prototype.raw=function(E,v){return this.buf.subarray(E,v)};function p(T){for(var E=0,v=0;v<4;++v){if(T.pos>=T.len)throw c(T);var S=T.buf[T.pos++];if(E=(E|(S&127)<<v*7)>>>0,S<128)return E}throw c(T)}u.prototype.uint32=function(){if(this.len-this.pos<5){if(this.pos>=this.len)throw c(this);if(this.buf[this.pos]>=128)return p(this)}var E=this.buf,v=this.pos,S=(E[v]&127)>>>0;if(E[v++]<128)return this.pos=v,S;if(S=(S|(E[v]&127)<<7)>>>0,E[v++]<128)return this.pos=v,S;if(S=(S|(E[v]&127)<<14)>>>0,E[v++]<128)return this.pos=v,S;if(S=(S|(E[v]&127)<<21)>>>0,E[v++]<128)return this.pos=v,S;if(S=(S|(E[v]&15)<<28)>>>0,E[v++]<128)return this.pos=v,S;for(var I=0;I<5;++I){if(v>=this.len)throw this.pos=v,c(this);if(E[v++]<128)return this.pos=v,S}throw this.pos=v,Error("invalid varint encoding")},u.prototype.tag=function(){if(this.len-this.pos<5){if(this.pos>=this.len)throw c(this);if(this.buf[this.pos]>=128)return p(this)}var E=this.buf,v=this.pos,S=(E[v]&127)>>>0;if(E[v++]<128)return this.pos=v,S;if(S=(S|(E[v]&127)<<7)>>>0,E[v++]<128)return this.pos=v,S;if(S=(S|(E[v]&127)<<14)>>>0,E[v++]<128)return this.pos=v,S;if(S=(S|(E[v]&127)<<21)>>>0,E[v++]<128)return this.pos=v,S;if(S=(S|(E[v]&15)<<28)>>>0,E[v]<128&&(E[v]&112)===0)return this.pos=v+1,S;throw this.pos=v+1,Error("invalid tag encoding")},u.prototype.int32=function(){return this.uint32()|0},u.prototype.sint32=function(){var E=this.uint32();return E>>>1^-(E&1)|0};function g(){var T=new s(0,0),E=0;if(this.len-this.pos>4){for(;E<4;++E)if(T.lo=(T.lo|(this.buf[this.pos]&127)<<E*7)>>>0,this.buf[this.pos++]<128)return T;if(T.lo=(T.lo|(this.buf[this.pos]&127)<<28)>>>0,T.hi=(T.hi|(this.buf[this.pos]&127)>>4)>>>0,this.buf[this.pos++]<128)return T;E=0}else{for(;E<4;++E){if(this.pos>=this.len)throw c(this);if(T.lo=(T.lo|(this.buf[this.pos]&127)<<E*7)>>>0,this.buf[this.pos++]<128)return T}throw c(this)}if(this.len-this.pos>4){for(;E<5;++E)if(T.hi=(T.hi|(this.buf[this.pos]&127)<<E*7+3)>>>0,this.buf[this.pos++]<128)return T}else for(;E<5;++E){if(this.pos>=this.len)throw c(this);if(T.hi=(T.hi|(this.buf[this.pos]&127)<<E*7+3)>>>0,this.buf[this.pos++]<128)return T}throw Error("invalid varint encoding")}u.prototype.bool=function(){for(var E=!1,v,S=0;S<10;++S){if(this.pos>=this.len)throw c(this);if(v=this.buf[this.pos++],v&127&&(E=!0),v<128)return E}throw Error("invalid varint encoding")};function m(T,E){return(T[E-4]|T[E-3]<<8|T[E-2]<<16|T[E-1]<<24)>>>0}u.prototype.fixed32=function(){if(this.pos+4>this.len)throw c(this,4);return m(this.buf,this.pos+=4)},u.prototype.sfixed32=function(){if(this.pos+4>this.len)throw c(this,4);return m(this.buf,this.pos+=4)|0};function y(){if(this.pos+8>this.len)throw c(this,8);return new s(m(this.buf,this.pos+=4),m(this.buf,this.pos+=4))}u.prototype.float=function(){if(this.pos+4>this.len)throw c(this,4);var E=r.float.readFloatLE(this.buf,this.pos);return this.pos+=4,E},u.prototype.double=function(){if(this.pos+8>this.len)throw c(this,4);var E=r.float.readDoubleLE(this.buf,this.pos);return this.pos+=8,E},u.prototype.uint32s=function(E){E===e&&(E=[]);var v=this.uint32()+this.pos,S=this.len,I=this.buf,R=this.pos,O;if(v>S)throw c(this,v-this.pos);for(this.len=v;R<v;)O=I[R++],O<128?E.push(O):(this.pos=R-1,E.push(this.uint32()),R=this.pos);if(this.pos=R,R!==v)throw RangeError("index out of range");return this.len=S,E},u.prototype.int32s=function(E){E===e&&(E=[]);var v=this.uint32()+this.pos,S=this.len,I=this.buf,R=this.pos,O;if(v>S)throw c(this,v-this.pos);for(this.len=v;R<v;)O=I[R++],O<128?E.push(O):(this.pos=R-1,E.push(this.int32()),R=this.pos);if(this.pos=R,R!==v)throw RangeError("index out of range");return this.len=S,E},u.prototype.sint32s=function(E){E===e&&(E=[]);var v=this.uint32()+this.pos,S=this.len;if(v>S)throw c(this,v-this.pos);for(this.len=v;this.pos<v;)E.push(this.sint32());if(this.pos!==v)throw RangeError("index out of range");return this.len=S,E},u.prototype.bools=function(E){E===e&&(E=[]);var v=this.uint32()+this.pos,S=this.len,I=this.buf,R=this.pos,O;if(v>S)throw c(this,v-this.pos);for(this.len=v;R<v;)O=I[R++],O<128?E.push(O!==0):(this.pos=R-1,E.push(this.bool()),R=this.pos);if(this.pos=R,R!==v)throw RangeError("index out of range");return this.len=S,E};var A=8,b=128;function x(T,E,v){var S=T.view;if(S||E<v)return S;var I=T.buf;return T.view=new DataView(I.buffer,I.byteOffset,I.byteLength)}u.prototype.fixed32s=function(E){E===e&&(E=[]);var v=this.uint32(),S=this.pos+v;if(S>this.len)throw c(this,v);var I=v>>>2,R=E.length,O=this.pos;E.length=R+I;var L=x(this,I,b);if(L)for(var _=0;_<I;++_,O+=4)E[R++]=L.getUint32(O,!0);else for(var C=this.buf,w=0;w<I;++w,O+=4)E[R++]=m(C,O+4);if(this.pos=O,O!==S)throw c(this,4);return E},u.prototype.sfixed32s=function(E){E===e&&(E=[]);var v=this.uint32(),S=this.pos+v;if(S>this.len)throw c(this,v);var I=v>>>2,R=E.length,O=this.pos;E.length=R+I;var L=x(this,I,b);if(L)for(var _=0;_<I;++_,O+=4)E[R++]=L.getInt32(O,!0);else for(var C=this.buf,w=0;w<I;++w,O+=4)E[R++]=m(C,O+4)|0;if(this.pos=O,O!==S)throw c(this,4);return E},u.prototype.floats=function(E){E===e&&(E=[]);var v=this.uint32(),S=this.pos+v;if(S>this.len)throw c(this,v);var I=v>>>2,R=E.length,O=this.pos;E.length=R+I;var L=x(this,I,A);if(L)for(var _=0;_<I;++_,O+=4)E[R++]=L.getFloat32(O,!0);else for(var C=this.buf,w=0;w<I;++w,O+=4)E[R++]=r.float.readFloatLE(C,O);if(this.pos=O,O!==S)throw c(this,4);return E},u.prototype.doubles=function(E){E===e&&(E=[]);var v=this.uint32(),S=this.pos+v;if(S>this.len)throw c(this,v);var I=v>>>3,R=E.length,O=this.pos;E.length=R+I;var L=x(this,I,A);if(L)for(var _=0;_<I;++_,O+=8)E[R++]=L.getFloat64(O,!0);else for(var C=this.buf,w=0;w<I;++w,O+=8)E[R++]=r.float.readDoubleLE(C,O);if(this.pos=O,O!==S)throw c(this,8);return E},u.prototype.uint64s=function(E){E===e&&(E=[]);var v=this.uint32()+this.pos,S=this.len;if(v>S)throw c(this,v-this.pos);for(this.len=v;this.pos<v;)E.push(this.uint64());if(this.pos!==v)throw RangeError("index out of range");return this.len=S,E},u.prototype.int64s=function(E){E===e&&(E=[]);var v=this.uint32()+this.pos,S=this.len;if(v>S)throw c(this,v-this.pos);for(this.len=v;this.pos<v;)E.push(this.int64());if(this.pos!==v)throw RangeError("index out of range");return this.len=S,E},u.prototype.sint64s=function(E){E===e&&(E=[]);var v=this.uint32()+this.pos,S=this.len;if(v>S)throw c(this,v-this.pos);for(this.len=v;this.pos<v;)E.push(this.sint64());if(this.pos!==v)throw RangeError("index out of range");return this.len=S,E},u.prototype.fixed64s=function(E){E===e&&(E=[]);var v=this.uint32(),S=this.pos+v,I=E.length;if(S>this.len)throw c(this,v);var R=v>>>3;E.length=I+R;for(var O=0;O<R;++O)E[I++]=this.fixed64();if(this.pos!==S)throw c(this,8);return E},u.prototype.sfixed64s=function(E){E===e&&(E=[]);var v=this.uint32(),S=this.pos+v,I=E.length;if(S>this.len)throw c(this,v);var R=v>>>3;E.length=I+R;for(var O=0;O<R;++O)E[I++]=this.sfixed64();if(this.pos!==S)throw c(this,8);return E},u.prototype.bytes=function(){var E=this.uint32(),v=this.pos,S=this.pos+E;if(S>this.len)throw c(this,E);return this.pos=S,this.raw(v,S)},u.prototype.string=function(){var E=this.uint32(),v=this.pos,S=this.pos+E;if(S>this.len)throw c(this,E);return this.pos=S,a.read(this.buf,v,S)},u.prototype.stringVerify=function(){var E=this.uint32(),v=this.pos,S=this.pos+E;if(S>this.len)throw c(this,E);return this.pos=S,a.readStrict(this.buf,v,S)},u.prototype.skip=function(E){if(typeof E=="number"){if(this.pos+E>this.len)throw c(this,E);this.pos+=E}else do if(this.pos>=this.len)throw c(this);while(this.buf[this.pos++]&128);return this},u.recursionLimit=r.recursionLimit,u.discardUnknown=!0,u.prototype.skipType=function(T,E,v){if(E===e&&(E=0),E>u.recursionLimit)throw Error("max depth exceeded");if(v===0)throw Error("illegal tag: field number 0");switch(T){case 0:this.skip();break;case 1:this.skip(8);break;case 2:this.skip(this.uint32());break;case 3:for(;;){var S=this.tag(),I=S>>>3;if(T=S&7,!I)throw Error("illegal tag: field number 0");if(T===4){if(v!==e&&I!==v)throw Error("invalid end group tag");break}this.skipType(T,E+1,I)}break;case 5:this.skip(4);break;default:throw Error("invalid wire type "+T+" at offset "+this.pos)}return this},u._configure=function(T){o=T,u.create=d(),o._configure();var E=r.Long?"toLong":"toNumber";r.merge(u.prototype,{int64:function(){return g.call(this)[E](!1)},uint64:function(){return g.call(this)[E](!0)},sint64:function(){return g.call(this).zzDecode()[E](!1)},fixed64:function(){return y.call(this)[E](!0)},sfixed64:function(){return y.call(this)[E](!1)}})}},{12:12}],3:[function(t,n,i){"use strict";n.exports=s;var r=t(2);s.prototype=Object.create(r.prototype,{constructor:{value:s,writable:!0,enumerable:!1,configurable:!0}});var o=t(12);function s(a){r.call(this,a)}s._configure=function(){o.Buffer&&(s.prototype._slice=o.Buffer.prototype.slice)},s.prototype.raw=function(c,u){return this._slice.call(this.buf,c,u)},s.prototype.string=function(){var c=this.uint32(),u=this.pos,f=this.pos+c;if(f>this.len)throw RangeError("index out of range: "+this.pos+" + "+c+" > "+this.len);return this.pos=f,this.buf.utf8Slice?this.buf.utf8Slice(u,f):this.buf.toString("utf-8",u,f)},s._configure()},{12:12,2:2}],4:[function(t,n,i){"use strict";n.exports=Object.create(null)},{}],5:[function(t,n,i){"use strict";var r=i;r.Service=t(6)},{6:6}],6:[function(t,n,i){"use strict";n.exports=o;var r=t(12);o.prototype=Object.create(r.EventEmitter.prototype,{constructor:{value:o,writable:!0,enumerable:!1,configurable:!0}});function o(s,a,c){if(typeof s!="function")throw TypeError("rpcImpl must be a function");r.EventEmitter.call(this),this.rpcImpl=s,this.requestDelimited=!!a,this.responseDelimited=!!c}o.prototype.rpcCall=function s(a,c,u,f,d){if(!f)throw TypeError("request must be specified");var p=this;if(!d)return r.asPromise(s,p,a,c,u,f);if(!p.rpcImpl)return setTimeout(function(){d(Error("already ended"))},0),e;try{return p.rpcImpl(a,c[p.requestDelimited?"encodeDelimited":"encode"](f).finish(),function(m,y){if(m)return p.emit("error",m,a),d(m);if(y===null)return p.end(!0),e;if(!(y instanceof u))try{y=u[p.responseDelimited?"decodeDelimited":"decode"](y)}catch(A){return p.emit("error",A,a),d(A)}return p.emit("data",y,a),d(null,y)})}catch(g){return p.emit("error",g,a),setTimeout(function(){d(g)},0),e}},o.prototype.end=function(a){return this.rpcImpl&&(a||this.rpcImpl(null,null,null),this.rpcImpl=null,this.emit("end").off()),this}},{12:12}],7:[function(t,n,i){"use strict";n.exports=r;function r(o,s){for(var a=new Array(arguments.length-1),c=0,u=2,f=!0;u<arguments.length;)a[c++]=arguments[u++];return new Promise(function(p,g){a[c]=function(y){if(f)if(f=!1,y)g(y);else{for(var A=new Array(arguments.length-1),b=0;b<A.length;)A[b++]=arguments[b];p.apply(null,A)}};try{o.apply(s||null,a)}catch(m){f&&(f=!1,g(m))}})}},{}],8:[function(t,n,i){"use strict";var r=i;r.length=function(g){var m=g.length;if(!m)return 0;for(;m>0&&g.charAt(m-1)==="=";)--m;return Math.floor(m*3/4)};for(var o=new Array(64),s=new Array(123),a=0;a<64;)s[o[a]=a<26?a+65:a<52?a+71:a<62?a-4:a-59|43]=a++;s[45]=62,s[95]=63,r.encode=function(g,m,y){for(var A=null,b=[],x=0,T=0,E;m<y;){var v=g[m++];switch(T){case 0:b[x++]=o[v>>2],E=(v&3)<<4,T=1;break;case 1:b[x++]=o[E|v>>4],E=(v&15)<<2,T=2;break;case 2:b[x++]=o[E|v>>6],b[x++]=o[v&63],T=0;break}x>8191&&((A||(A=[])).push(String.fromCharCode.apply(String,b)),x=0)}return T&&(b[x++]=o[E],b[x++]=61,T===1&&(b[x++]=61)),A?(x&&A.push(String.fromCharCode.apply(String,b.slice(0,x))),A.join("")):String.fromCharCode.apply(String,b.slice(0,x))};var c="invalid encoding";r.decode=function(g,m,y){for(var A=y,b=0,x,T=0;T<g.length;){var E=g.charCodeAt(T++);if(E===61&&b>1)break;if((E=s[E])===e)throw Error(c);switch(b){case 0:x=E,b=1;break;case 1:m[y++]=x<<2|(E&48)>>4,x=E,b=2;break;case 2:m[y++]=(x&15)<<4|(E&60)>>2,x=E,b=3;break;case 3:m[y++]=(x&3)<<6|E,b=0;break}}if(b===1)throw Error(c);return y-A};var u=/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/,f=/[-_]/,d=/^(?:[A-Za-z0-9_-]{4})*(?:[A-Za-z0-9_-]{2}(?:==)?|[A-Za-z0-9_-]{3}=?)?$/;r.test=function(g){return u.test(g)||f.test(g)&&d.test(g)}},{}],9:[function(t,n,i){"use strict";n.exports=r;function r(){this._listeners=Object.create(null)}r.prototype.on=function(s,a,c){return(this._listeners[s]||(this._listeners[s]=[])).push({fn:a,ctx:c||this}),this},r.prototype.off=function(s,a){if(s===e)this._listeners=Object.create(null);else if(a===e)this._listeners[s]=[];else{var c=this._listeners[s];if(!c)return this;for(var u=0;u<c.length;)c[u].fn===a?c.splice(u,1):++u}return this},r.prototype.emit=function(s){var a=this._listeners[s];if(a){for(var c=[],u=1;u<arguments.length;)c.push(arguments[u++]);for(u=0;u<a.length;)a[u].fn.apply(a[u++].ctx,c)}return this}},{}],10:[function(t,n,i){"use strict";n.exports=r(r);function r(u){return typeof Float32Array<"u"?(function(){var f=new Float32Array([-0]),d=new Uint8Array(f.buffer),p=d[3]===128;function g(b,x,T){f[0]=b,x[T]=d[0],x[T+1]=d[1],x[T+2]=d[2],x[T+3]=d[3]}function m(b,x,T){f[0]=b,x[T]=d[3],x[T+1]=d[2],x[T+2]=d[1],x[T+3]=d[0]}u.writeFloatLE=p?g:m,u.writeFloatBE=p?m:g;function y(b,x){return d[0]=b[x],d[1]=b[x+1],d[2]=b[x+2],d[3]=b[x+3],f[0]}function A(b,x){return d[3]=b[x],d[2]=b[x+1],d[1]=b[x+2],d[0]=b[x+3],f[0]}u.readFloatLE=p?y:A,u.readFloatBE=p?A:y})():(function(){function f(p,g,m,y){var A=g<0?1:0;if(A&&(g=-g),g===0)p(1/g>0?0:2147483648,m,y);else if(isNaN(g))p(2143289344,m,y);else if(g>34028234663852886e22)p((A<<31|2139095040)>>>0,m,y);else if(g<11754943508222875e-54)p((A<<31|Math.round(g/1401298464324817e-60))>>>0,m,y);else{var b=Math.floor(Math.log(g)/Math.LN2),x=Math.round(g*Math.pow(2,-b)*8388608)&8388607;p((A<<31|b+127<<23|x)>>>0,m,y)}}u.writeFloatLE=f.bind(null,o),u.writeFloatBE=f.bind(null,s);function d(p,g,m){var y=p(g,m),A=(y>>31)*2+1,b=y>>>23&255,x=y&8388607;return b===255?x?NaN:A*(1/0):b===0?A*1401298464324817e-60*x:A*Math.pow(2,b-150)*(x+8388608)}u.readFloatLE=d.bind(null,a),u.readFloatBE=d.bind(null,c)})(),typeof Float64Array<"u"?(function(){var f=new Float64Array([-0]),d=new Uint8Array(f.buffer),p=d[7]===128;function g(b,x,T){f[0]=b,x[T]=d[0],x[T+1]=d[1],x[T+2]=d[2],x[T+3]=d[3],x[T+4]=d[4],x[T+5]=d[5],x[T+6]=d[6],x[T+7]=d[7]}function m(b,x,T){f[0]=b,x[T]=d[7],x[T+1]=d[6],x[T+2]=d[5],x[T+3]=d[4],x[T+4]=d[3],x[T+5]=d[2],x[T+6]=d[1],x[T+7]=d[0]}u.writeDoubleLE=p?g:m,u.writeDoubleBE=p?m:g;function y(b,x){return d[0]=b[x],d[1]=b[x+1],d[2]=b[x+2],d[3]=b[x+3],d[4]=b[x+4],d[5]=b[x+5],d[6]=b[x+6],d[7]=b[x+7],f[0]}function A(b,x){return d[7]=b[x],d[6]=b[x+1],d[5]=b[x+2],d[4]=b[x+3],d[3]=b[x+4],d[2]=b[x+5],d[1]=b[x+6],d[0]=b[x+7],f[0]}u.readDoubleLE=p?y:A,u.readDoubleBE=p?A:y})():(function(){function f(p,g,m,y,A,b){var x=y<0?1:0;if(x&&(y=-y),y===0)p(0,A,b+g),p(1/y>0?0:2147483648,A,b+m);else if(isNaN(y))p(0,A,b+g),p(2146959360,A,b+m);else if(y>17976931348623157e292)p(0,A,b+g),p((x<<31|2146435072)>>>0,A,b+m);else{var T;if(y<22250738585072014e-324)T=y/5e-324,p(T>>>0,A,b+g),p((x<<31|T/4294967296)>>>0,A,b+m);else{var E=Math.floor(Math.log(y)/Math.LN2);E===1024&&(E=1023),T=y*Math.pow(2,-E),p(T*4503599627370496>>>0,A,b+g),p((x<<31|E+1023<<20|T*1048576&1048575)>>>0,A,b+m)}}}u.writeDoubleLE=f.bind(null,o,0,4),u.writeDoubleBE=f.bind(null,s,4,0);function d(p,g,m,y,A){var b=p(y,A+g),x=p(y,A+m),T=(x>>31)*2+1,E=x>>>20&2047,v=4294967296*(x&1048575)+b;return E===2047?v?NaN:T*(1/0):E===0?T*5e-324*v:T*Math.pow(2,E-1075)*(v+4503599627370496)}u.readDoubleLE=d.bind(null,a,0,4),u.readDoubleBE=d.bind(null,c,4,0)})(),u}function o(u,f,d){f[d]=u&255,f[d+1]=u>>>8&255,f[d+2]=u>>>16&255,f[d+3]=u>>>24}function s(u,f,d){f[d]=u>>>24,f[d+1]=u>>>16&255,f[d+2]=u>>>8&255,f[d+3]=u&255}function a(u,f){return(u[f]|u[f+1]<<8|u[f+2]<<16|u[f+3]<<24)>>>0}function c(u,f){return(u[f]<<24|u[f+1]<<16|u[f+2]<<8|u[f+3])>>>0}},{}],11:[function(t,n,i){"use strict";n.exports=o;var r;function o(u,f){this.lo=u>>>0,this.hi=f>>>0}var s=o.zero=new o(0,0);s.toNumber=function(){return 0},s.zzEncode=s.zzDecode=function(){return this},s.length=function(){return 1};var a=o.zeroHash="\0\0\0\0\0\0\0\0";o.fromNumber=function(f){if(f===0)return s;var d=f<0;d&&(f=-f);var p=f>>>0,g=(f-p)/4294967296>>>0;return d&&(g=~g>>>0,p=~p>>>0,++p>4294967295&&(p=0,++g>4294967295&&(g=0))),new o(p,g)},o.from=function(f){if(typeof f=="number")return o.fromNumber(f);if(typeof f=="string"||f instanceof String)if(r)f=r.fromString(f);else return o.fromNumber(parseInt(f,10));return f.low||f.high?new o(f.low>>>0,f.high>>>0):s},o.prototype.toNumber=function(f){if(!f&&this.hi>>>31){var d=~this.lo+1>>>0,p=~this.hi>>>0;return d||(p=p+1>>>0),-(d+p*4294967296)}return this.lo+this.hi*4294967296},o.prototype.toLong=function(f){return r?new r(this.lo|0,this.hi|0,!!f):{low:this.lo|0,high:this.hi|0,unsigned:!!f}};var c=String.prototype.charCodeAt;o.fromHash=function(f){return f===a?s:new o((c.call(f,0)|c.call(f,1)<<8|c.call(f,2)<<16|c.call(f,3)<<24)>>>0,(c.call(f,4)|c.call(f,5)<<8|c.call(f,6)<<16|c.call(f,7)<<24)>>>0)},o.prototype.toHash=function(){return String.fromCharCode(this.lo&255,this.lo>>>8&255,this.lo>>>16&255,this.lo>>>24,this.hi&255,this.hi>>>8&255,this.hi>>>16&255,this.hi>>>24)},o.prototype.zzEncode=function(){var f=this.hi>>31;return this.hi=((this.hi<<1|this.lo>>>31)^f)>>>0,this.lo=(this.lo<<1^f)>>>0,this},o.prototype.zzDecode=function(){var f=-(this.lo&1);return this.lo=((this.lo>>>1|this.hi<<31)^f)>>>0,this.hi=(this.hi>>>1^f)>>>0,this},o.prototype.length=function(){var f=this.lo,d=(this.lo>>>28|this.hi<<4)>>>0,p=this.hi>>>24;return p===0?d===0?f<16384?f<128?1:2:f<2097152?3:4:d<16384?d<128?5:6:d<2097152?7:8:p<128?9:10},o._configure=function(u){r=u}},{}],12:[function(t,n,i){"use strict";var r=i;r.asPromise=t(7),r.base64=t(8),r.EventEmitter=t(9),r.float=t(10),r.utf8=t(14),r.pool=t(13),r.LongBits=t(11);function o(c){return c==="__proto__"||c==="prototype"||c==="constructor"}r.isUnsafeProperty=o,r.isNode=!!(typeof global<"u"&&global&&global.process&&global.process.versions&&global.process.versions.node),r.global=r.isNode&&global||typeof window<"u"&&window||typeof self<"u"&&self||typeof globalThis<"u"&&globalThis||this,r.emptyArray=Object.freeze?Object.freeze([]):[],r.emptyObject=Object.freeze?Object.freeze({}):{},r.isInteger=Number.isInteger||function(u){return typeof u=="number"&&isFinite(u)&&Math.floor(u)===u},r.isString=function(u){return typeof u=="string"||u instanceof String},r.isObject=function(u){return u&&typeof u=="object"},r.isset=r.isSet=function(u,f){var d=u[f];return d!=null&&Object.hasOwnProperty.call(u,f)?typeof d!="object"||(Array.isArray(d)?d.length:Object.keys(d).length)>0:!1},r.Buffer=(function(){try{var c=r.global.Buffer;return c.prototype.utf8Write||r.isNode?c:null}catch{return null}})(),r.newBuffer=function(u){var f=r.Buffer;return typeof u=="number"?f?f.allocUnsafe(u):new Uint8Array(u):f?f.from(u):new Uint8Array(u)},r.rawField=function(u,f,d){var p=[],g=u<<3|f;for(g>>>=0;g>127;)p.push(g&127|128),g>>>=7;p.push(g);for(var m=0;m<d.length;++m)p.push(d[m]);return r.newBuffer(p)},r.Array=Uint8Array,r.Long=r.global.dcodeIO&&r.global.dcodeIO.Long||r.global.Long||(function(){try{var c=t("long");return c&&c.isLong?c:null}catch{return null}})(),r.key2Re=/^(?:true|false|0|1)$/,r.key32Re=/^-?(?:0|[1-9][0-9]*)$/,r.key64Re=/^(?:[\x00-\xff]{8}|-?(?:0|[1-9][0-9]*))$/,r.longToHash=function(u){return u?r.LongBits.from(u).toHash():r.LongBits.zeroHash},r.longFromHash=function(u,f){var d=r.LongBits.fromHash(u);return r.Long?r.Long.fromBits(d.lo,d.hi,f):d.toNumber(!!f)},r.longFromKey=function(u,f){return r.key64Re.test(u)&&!r.key32Re.test(u)?r.longFromHash(u,f):u},r.boolFromKey=function(u){return u==="true"||u==="1"};function s(c){var u=typeof arguments[arguments.length-1]=="boolean",f=u?arguments.length-1:arguments.length;u=u&&arguments[arguments.length-1];for(var d=1;d<f;++d){var p=arguments[d];if(p)for(var g=Object.keys(p),m=0;m<g.length;++m)!o(g[m])&&(!u||!Object.prototype.hasOwnProperty.call(c,g[m])||c[g[m]]===e)&&(c[g[m]]=p[g[m]])}return c}r.merge=s,r.nestingLimit=32,r.recursionLimit=100,r.makeProp=function(u,f,d){Object.prototype.hasOwnProperty.call(u,f)||Object.defineProperty(u,f,{enumerable:d===e?!0:d,configurable:!0,writable:!0})},r.lcFirst=function(u){return u.charAt(0).toLowerCase()+u.substring(1)};function a(c){function u(f,d){if(!(this instanceof u))return new u(f,d);Object.defineProperty(this,"message",{get:function(){return f}}),Error.captureStackTrace?Error.captureStackTrace(this,u):Object.defineProperty(this,"stack",{value:new Error().stack||""}),d&&s(this,d)}return u.prototype=Object.create(Error.prototype,{constructor:{value:u,writable:!0,enumerable:!1,configurable:!0},name:{get:function(){return c},set:e,enumerable:!1,configurable:!0},toString:{value:function(){return this.name+": "+this.message},writable:!0,enumerable:!1,configurable:!0}}),u}r.newError=a,r.ProtocolError=a("ProtocolError"),r.oneOfGetter=function(u){for(var f={},d=0;d<u.length;++d)f[u[d]]=1;return function(){for(var p=Object.keys(this),g=p.length-1;g>-1;--g)if(f[p[g]]===1&&this[p[g]]!==e&&this[p[g]]!==null)return p[g]}},r.oneOfSetter=function(u){return function(f){for(var d=0;d<u.length;++d)u[d]!==f&&delete this[u[d]]}},r.toJSONOptions={longs:String,enums:String,bytes:String,json:!0}},{10:10,11:11,13:13,14:14,7:7,8:8,9:9,long:"long"}],13:[function(t,n,i){"use strict";n.exports=r;function r(o,s,a){var c=a||8192,u=c>>>1,f=null,d=c;return function(g){if(g<1||g>u)return o(g);d+g>c&&(f=o(c),d=0);var m=s.call(f,d,d+=g);return d&7&&(d=(d|7)+1),m}}},{}],14:[function(t,n,i){"use strict";var r=i,o=new TextDecoder("utf-8",{ignoreBOM:!0}),s,a=64;try{s=new TextDecoder("utf-8",{fatal:!0,ignoreBOM:!0})}catch{s=o}r.length=function(f){for(var d=0,p=0,g=0;g<f.length;++g)p=f.charCodeAt(g),p<128?d+=1:p<2048?d+=2:(p&64512)===55296&&(f.charCodeAt(g+1)&64512)===56320?(++g,d+=4):d+=3;return d};function c(u,f,d,p){var g=d===0&&p===f.length?f:f.subarray(d,p);return u.decode(g)}r.read=function(f,d,p){if(p-d<1)return"";if(p-d>=a)return c(o,f,d,p);for(var g="",m=d,y,A,b,x,T,E,v,S;m+7<p;m+=8){if(y=f[m],A=f[m+1],b=f[m+2],x=f[m+3],T=f[m+4],E=f[m+5],v=f[m+6],S=f[m+7],(y|A|b|x|T|E|v|S)&128)return g+c(o,f,m,p);g+=String.fromCharCode(y,A,b,x,T,E,v,S)}for(;m<p;++m){if(y=f[m],y&128)return g+c(o,f,m,p);g+=String.fromCharCode(y)}return g},r.readStrict=function(f,d,p){if(p-d<1)return"";if(p-d>=a)return c(s,f,d,p);for(var g="",m=d,y,A,b,x,T,E,v,S;m+7<p;m+=8){if(y=f[m],A=f[m+1],b=f[m+2],x=f[m+3],T=f[m+4],E=f[m+5],v=f[m+6],S=f[m+7],(y|A|b|x|T|E|v|S)&128)return g+c(s,f,m,p);g+=String.fromCharCode(y,A,b,x,T,E,v,S)}for(;m<p;++m){if(y=f[m],y&128)return g+c(s,f,m,p);g+=String.fromCharCode(y)}return g},r.write=function(f,d,p){for(var g=p,m,y,A=0;A<f.length;++A)m=f.charCodeAt(A),m<128?d[p++]=m:m<2048?(d[p++]=m>>6|192,d[p++]=m&63|128):(m&64512)===55296&&((y=f.charCodeAt(A+1))&64512)===56320?(m=65536+((m&1023)<<10)+(y&1023),++A,d[p++]=m>>18|240,d[p++]=m>>12&63|128,d[p++]=m>>6&63|128,d[p++]=m&63|128):(d[p++]=m>>12|224,d[p++]=m>>6&63|128,d[p++]=m&63|128);return p-g}},{}],15:[function(t,n,i){"use strict";n.exports=u;var r=t(12),o,s=r.LongBits,a=r.base64,c=r.utf8;function u(){this.pos=0,this.buf=this.constructor.alloc(u.initialBufferSize),this.view=null,this.states=null}u.initialBufferSize=128,Object.defineProperty(u.prototype,"len",{configurable:!0,enumerable:!0,get:function(){return this.pos}});var f=function(){return r.Buffer?function(){return(u.create=function(){return new o})()}:function(){return new u}};u.create=f(),u.alloc=function(E){return new Uint8Array(E)},u.alloc=r.pool(u.alloc,Uint8Array.prototype.subarray);function d(T){return T<128?1:T<16384?2:T<2097152?3:T<268435456?4:5}u.prototype._reserve=function(E){var v=this.pos+E;if(v>this.buf.length){var S=this.buf.length<<1;S<v&&(S=v);var I=this.constructor.alloc(S);I.set(this.buf.subarray(0,this.pos),0),this.buf=I,this.view=null}};function p(T,E,v){for(var S=0;S<T.length;)E[v++]=T.charCodeAt(S++)}function g(T,E,v){for(;T>127;)E[v++]=T&127|128,T>>>=7;return E[v]=T,v+1}u.prototype.uint32=function(E){E=E>>>0,this._reserve(5);var v=this.pos;return this.pos=g(E,this.buf,v),this},u.prototype.int32=function(E){return(E|=0)<0?(this._reserve(10),m(s.fromNumber(E),this.buf,this.pos),this.pos+=10,this):this.uint32(E)},u.prototype.sint32=function(E){return this.uint32((E<<1^E>>31)>>>0)};function m(T,E,v){for(var S=T.lo,I=T.hi;I;)E[v++]=S&127|128,S=(S>>>7|I<<25)>>>0,I>>>=7;for(;S>127;)E[v++]=S&127|128,S=S>>>7;return E[v]=S,v+1}u.prototype.uint64=function(E){var v=s.from(E);this._reserve(10);var S=this.pos;return this.pos=m(v,this.buf,S),this},u.prototype.int64=u.prototype.uint64,u.prototype.sint64=function(E){var v=s.from(E).zzEncode();this._reserve(10);var S=this.pos;return this.pos=m(v,this.buf,S),this},u.prototype.bool=function(E){return this._reserve(1),this.buf[this.pos++]=E?1:0,this};function y(T,E,v){E[v]=T&255,E[v+1]=T>>>8&255,E[v+2]=T>>>16&255,E[v+3]=T>>>24}u.prototype.fixed32=function(E){return this._reserve(4),y(E>>>0,this.buf,this.pos),this.pos+=4,this},u.prototype.sfixed32=u.prototype.fixed32,u.prototype.fixed64=function(E){var v=s.from(E);return this._reserve(8),y(v.lo,this.buf,this.pos),y(v.hi,this.buf,this.pos+4),this.pos+=8,this},u.prototype.sfixed64=u.prototype.fixed64,u.prototype.float=function(E){return this._reserve(4),r.float.writeFloatLE(E,this.buf,this.pos),this.pos+=4,this},u.prototype.double=function(E){return this._reserve(8),r.float.writeDoubleLE(E,this.buf,this.pos),this.pos+=8,this},u.prototype.bytes=function(E){var v=E.length>>>0;if(!v)return this._reserve(1),this.buf[this.pos++]=0,this;if(r.isString(E)){var S=u.alloc(v=a.length(E));a.decode(E,S,0),E=S}return this.uint32(v),this._reserve(v),this.buf.set(E,this.pos),this.pos+=v,this},u.prototype.raw=function(E){var v=E.length>>>0;return v?(this._reserve(v),this.buf.set(E,this.pos),this.pos+=v,this):this},u.prototype._delim=function(E,v){var S=d(v);return S>1&&this.buf.copyWithin(E+S,E+1,E+1+v),g(v,this.buf,E),this.pos=E+S+v,this},u.prototype.string=function(E){var v=E.length;if(!v)return this._reserve(1),this.buf[this.pos++]=0,this;if(v<128){this._reserve(v*3+5);var S=this.pos;return this._delim(S,c.write(E,this.buf,S+1))}var I=c.length(E);return this.uint32(I),this._reserve(I),I===E.length?p(E,this.buf,this.pos):c.write(E,this.buf,this.pos),this.pos+=I,this},u.prototype.uint32s=function(E){var v=E.length;this._reserve(v*5+5);for(var S=this.buf,I=this.pos,R=I+1,O=0;O<v;++O)R=g(E[O]>>>0,S,R);return this._delim(I,R-I-1)},u.prototype.int32s=function(E){var v=E.length;this._reserve(v*10+5);for(var S=this.buf,I=this.pos,R=I+1,O,L=0;L<v;++L)(O=E[L]|0)<0?R=m(s.fromNumber(O),S,R):R=g(O,S,R);return this._delim(I,R-I-1)},u.prototype.sint32s=function(E){var v=E.length;this._reserve(v*5+5);for(var S=this.buf,I=this.pos,R=I+1,O=0;O<v;++O)R=g((E[O]<<1^E[O]>>31)>>>0,S,R);return this._delim(I,R-I-1)},u.prototype.uint64s=function(E){var v=E.length;this._reserve(v*10+5);for(var S=this.buf,I=this.pos,R=I+1,O=0;O<v;++O)R=m(s.from(E[O]),S,R);return this._delim(I,R-I-1)},u.prototype.int64s=u.prototype.uint64s,u.prototype.sint64s=function(E){var v=E.length;this._reserve(v*10+5);for(var S=this.buf,I=this.pos,R=I+1,O=0;O<v;++O)R=m(s.from(E[O]).zzEncode(),S,R);return this._delim(I,R-I-1)},u.prototype.bools=function(E){var v=E.length;this.uint32(v),this._reserve(v);for(var S=this.buf,I=this.pos,R=0;R<v;++R)S[I++]=E[R]?1:0;return this.pos+=v,this};var A=16,b=128;function x(T,E,v){var S=T.view;if(S||E<v)return S;var I=T.buf;return T.view=new DataView(I.buffer,I.byteOffset,I.byteLength)}u.prototype.fixed32s=function(E){var v=E.length,S=v*4;this.uint32(S),this._reserve(S);var I=this.pos,R,O=x(this,v,b);if(O)for(R=0;R<v;++R)O.setUint32(I,E[R]>>>0,!0),I+=4;else{var L=this.buf;for(R=0;R<v;++R)y(E[R]>>>0,L,I),I+=4}return this.pos+=S,this},u.prototype.sfixed32s=u.prototype.fixed32s,u.prototype.fixed64s=function(E){var v=E.length,S=v*8;this.uint32(S),this._reserve(S);var I=this.pos,R,O,L=x(this,v,b);if(L)for(R=0;R<v;++R)O=s.from(E[R]),L.setUint32(I,O.lo,!0),L.setUint32(I+4,O.hi,!0),I+=8;else{var _=this.buf;for(R=0;R<v;++R)O=s.from(E[R]),y(O.lo,_,I),y(O.hi,_,I+4),I+=8}return this.pos+=S,this},u.prototype.sfixed64s=u.prototype.fixed64s,u.prototype.floats=function(E){var v=E.length,S=v*4;this.uint32(S),this._reserve(S);var I=this.pos,R,O=x(this,v,A);if(O)for(R=0;R<v;++R)O.setFloat32(I,E[R],!0),I+=4;else{var L=this.buf;for(R=0;R<v;++R)r.float.writeFloatLE(E[R],L,I),I+=4}return this.pos+=S,this},u.prototype.doubles=function(E){var v=E.length,S=v*8;this.uint32(S),this._reserve(S);var I=this.pos,R,O=x(this,v,A);if(O)for(R=0;R<v;++R)O.setFloat64(I,E[R],!0),I+=8;else{var L=this.buf;for(R=0;R<v;++R)r.float.writeDoubleLE(E[R],L,I),I+=8}return this.pos+=S,this},u.prototype.fork=function(){return this._reserve(1),(this.states||(this.states=[])).push(this.pos),this.pos+=1,this},u.prototype.reset=function(){var E=this.states;return E&&E.length?this.pos=E.pop():this.pos=0,this},u.prototype.ldelim=function(){var E=this.states,v,S;if(E&&E.length){var I=E.pop();v=this.pos-I-1,S=d(v),S>1?(this._reserve(S-1),this.buf.copyWithin(I+S,I+1,I+1+v),this.pos+=S-1,g(v,this.buf,I)):this.buf[I]=v}else v=this.pos,S=d(v),this._reserve(S),this.buf.copyWithin(S,0,v),g(v,this.buf,0),this.pos+=S;return this},u.prototype.finish=function(E){if(E)return this.buf.subarray(0,this.pos);var v=this.constructor.alloc(this.pos);return v.set(this.buf.subarray(0,this.pos),0),v},u.prototype.finishInto=function(E,v){return v===e&&(v=0),E.set(this.buf.subarray(0,this.pos),v),E},u._configure=function(T){o=T,u.create=f(),o._configure()}},{12:12}],16:[function(t,n,i){"use strict";n.exports=s;var r=t(15);s.prototype=Object.create(r.prototype,{constructor:{value:s,writable:!0,enumerable:!1,configurable:!0}});var o=t(12);function s(){r.call(this)}var a;s._configure=function(){s.alloc=o.Buffer&&o.Buffer.allocUnsafe,a=o.Buffer&&o.Buffer.prototype.utf8Write?function(u,f,d){return f.utf8Write(u,d)}:function(u,f,d){return f.write(u,d)}},s.prototype.bytes=function(u){o.isString(u)&&(u=o.Buffer.from(u,"base64"));var f=u.length>>>0;return this.uint32(f),f&&(this._reserve(f),this.buf.set(u,this.pos),this.pos+=f),this},s.prototype.string=function(u){var f=u.length;if(!f)return this._reserve(1),this.buf[this.pos++]=0,this;if(f<128){this._reserve(f*3+5);var d=this.pos,p=this.buf;return this._delim(d,f<40?o.utf8.write(u,p,d+1):a(u,p,d+1))}var g=o.Buffer.byteLength(u);return this.uint32(g),this._reserve(g),a(u,this.buf,this.pos),this.pos+=g,this},s._configure()},{12:12,15:15}]},{},[1])})()});var xke=Yi((_Ar,KW)=>{/* Copyright 2015-2018 Esri. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 @preserve */(function(){var e=(function(){var r={};r.defaultNoDataValue=-34027999387901484e22,r.decode=function(f,d){d=d||{};var p=d.encodedMaskData||d.encodedMaskData===null,g=c(f,d.inputOffset||0,p),m=d.noDataValue!==null?d.noDataValue:r.defaultNoDataValue,y=o(g,d.pixelType||Float32Array,d.encodedMaskData,m,d.returnMask),A={width:g.width,height:g.height,pixelData:y.resultPixels,minValue:y.minValue,maxValue:g.pixels.maxValue,noDataValue:m};return y.resultMask&&(A.maskData=y.resultMask),d.returnEncodedMask&&g.mask&&(A.encodedMaskData=g.mask.bitset?g.mask.bitset:null),d.returnFileInfo&&(A.fileInfo=s(g),d.computeUsedBitDepths&&(A.fileInfo.bitDepths=a(g))),A};var o=function(f,d,p,g,m){var y=0,A=f.pixels.numBlocksX,b=f.pixels.numBlocksY,x=Math.floor(f.width/A),T=Math.floor(f.height/b),E=2*f.maxZError,v=Number.MAX_VALUE,S;p=p||(f.mask?f.mask.bitset:null);var I,R;I=new d(f.width*f.height),m&&p&&(R=new Uint8Array(f.width*f.height));for(var O=new Float32Array(x*T),L,_,C=0;C<=b;C++){var w=C!==b?T:f.height%b;if(w!==0)for(var P=0;P<=A;P++){var M=P!==A?x:f.width%A;if(M!==0){var F=C*f.width*T+P*x,V=f.width-M,B=f.pixels.blocks[y],j,k,G;B.encoding<2?(B.encoding===0?j=B.rawData:(u(B.stuffedData,B.bitsPerPixel,B.numValidPixels,B.offset,E,O,f.pixels.maxValue),j=O),k=0):B.encoding===2?G=0:G=B.offset;var q;if(p)for(_=0;_<w;_++){for(F&7&&(q=p[F>>3],q<<=F&7),L=0;L<M;L++)F&7||(q=p[F>>3]),q&128?(R&&(R[F]=1),S=B.encoding<2?j[k++]:G,v=v>S?S:v,I[F++]=S):(R&&(R[F]=0),I[F++]=g),q<<=1;F+=V}else if(B.encoding<2)for(_=0;_<w;_++){for(L=0;L<M;L++)S=j[k++],v=v>S?S:v,I[F++]=S;F+=V}else for(v=v>G?G:v,_=0;_<w;_++){for(L=0;L<M;L++)I[F++]=G;F+=V}if(B.encoding===1&&k!==B.numValidPixels)throw"Block and Mask do not match";y++}}}return{resultPixels:I,resultMask:R,minValue:v}},s=function(f){return{fileIdentifierString:f.fileIdentifierString,fileVersion:f.fileVersion,imageType:f.imageType,height:f.height,width:f.width,maxZError:f.maxZError,eofOffset:f.eofOffset,mask:f.mask?{numBlocksX:f.mask.numBlocksX,numBlocksY:f.mask.numBlocksY,numBytes:f.mask.numBytes,maxValue:f.mask.maxValue}:null,pixels:{numBlocksX:f.pixels.numBlocksX,numBlocksY:f.pixels.numBlocksY,numBytes:f.pixels.numBytes,maxValue:f.pixels.maxValue,noDataValue:f.noDataValue}}},a=function(f){for(var d=f.pixels.numBlocksX*f.pixels.numBlocksY,p={},g=0;g<d;g++){var m=f.pixels.blocks[g];m.encoding===0?p.float32=!0:m.encoding===1?p[m.bitsPerPixel]=!0:p[0]=!0}return Object.keys(p)},c=function(f,d,p){var g={},m=new Uint8Array(f,d,10);if(g.fileIdentifierString=String.fromCharCode.apply(null,m),g.fileIdentifierString.trim()!=="CntZImage")throw"Unexpected file identifier string: "+g.fileIdentifierString;d+=10;var y=new DataView(f,d,24);if(g.fileVersion=y.getInt32(0,!0),g.imageType=y.getInt32(4,!0),g.height=y.getUint32(8,!0),g.width=y.getUint32(12,!0),g.maxZError=y.getFloat64(16,!0),d+=24,!p)if(y=new DataView(f,d,16),g.mask={},g.mask.numBlocksY=y.getUint32(0,!0),g.mask.numBlocksX=y.getUint32(4,!0),g.mask.numBytes=y.getUint32(8,!0),g.mask.maxValue=y.getFloat32(12,!0),d+=16,g.mask.numBytes>0){var A=new Uint8Array(Math.ceil(g.width*g.height/8));y=new DataView(f,d,g.mask.numBytes);var b=y.getInt16(0,!0),x=2,T=0;do{if(b>0)for(;b--;)A[T++]=y.getUint8(x++);else{var E=y.getUint8(x++);for(b=-b;b--;)A[T++]=E}b=y.getInt16(x,!0),x+=2}while(x<g.mask.numBytes);if(b!==-32768||T<A.length)throw"Unexpected end of mask RLE encoding";g.mask.bitset=A,d+=g.mask.numBytes}else(g.mask.numBytes|g.mask.numBlocksY|g.mask.maxValue)===0&&(g.mask.bitset=new Uint8Array(Math.ceil(g.width*g.height/8)));y=new DataView(f,d,16),g.pixels={},g.pixels.numBlocksY=y.getUint32(0,!0),g.pixels.numBlocksX=y.getUint32(4,!0),g.pixels.numBytes=y.getUint32(8,!0),g.pixels.maxValue=y.getFloat32(12,!0),d+=16;var v=g.pixels.numBlocksX,S=g.pixels.numBlocksY,I=v+(g.width%v>0?1:0),R=S+(g.height%S>0?1:0);g.pixels.blocks=new Array(I*R);for(var O=0,L=0;L<R;L++)for(var _=0;_<I;_++){var C=0,w=f.byteLength-d;y=new DataView(f,d,Math.min(10,w));var P={};g.pixels.blocks[O++]=P;var M=y.getUint8(0);if(C++,P.encoding=M&63,P.encoding>3)throw"Invalid block encoding ("+P.encoding+")";if(P.encoding===2){d++;continue}if(M!==0&&M!==2){if(M>>=6,P.offsetType=M,M===2)P.offset=y.getInt8(1),C++;else if(M===1)P.offset=y.getInt16(1,!0),C+=2;else if(M===0)P.offset=y.getFloat32(1,!0),C+=4;else throw"Invalid block offset type";if(P.encoding===1)if(M=y.getUint8(C),C++,P.bitsPerPixel=M&63,M>>=6,P.numValidPixelsType=M,M===2)P.numValidPixels=y.getUint8(C),C++;else if(M===1)P.numValidPixels=y.getUint16(C,!0),C+=2;else if(M===0)P.numValidPixels=y.getUint32(C,!0),C+=4;else throw"Invalid valid pixel count type"}if(d+=C,P.encoding!==3){var F,V;if(P.encoding===0){var B=(g.pixels.numBytes-1)/4;if(B!==Math.floor(B))throw"uncompressed block has invalid length";F=new ArrayBuffer(B*4),V=new Uint8Array(F),V.set(new Uint8Array(f,d,B*4));var j=new Float32Array(F);P.rawData=j,d+=B*4}else if(P.encoding===1){var k=Math.ceil(P.numValidPixels*P.bitsPerPixel/8),G=Math.ceil(k/4);F=new ArrayBuffer(G*4),V=new Uint8Array(F),V.set(new Uint8Array(f,d,k)),P.stuffedData=new Uint32Array(F),d+=k}}}return g.eofOffset=d,g},u=function(f,d,p,g,m,y,A){var b=(1<<d)-1,x=0,T,E=0,v,S,I=Math.ceil((A-g)/m),R=f.length*4-Math.ceil(d*p/8);for(f[f.length-1]<<=8*R,T=0;T<p;T++){if(E===0&&(S=f[x++],E=32),E>=d)v=S>>>E-d&b,E-=d;else{var O=d-E;v=(S&b)<<O&b,S=f[x++],E=32-O,v+=S>>>E}y[T]=v<I?g+v*m:A}return y};return r})(),t=(function(){"use strict";var r={unstuff:function(c,u,f,d,p,g,m,y){var A=(1<<f)-1,b=0,x,T=0,E,v,S,I,R=c.length*4-Math.ceil(f*d/8);if(c[c.length-1]<<=8*R,p)for(x=0;x<d;x++)T===0&&(v=c[b++],T=32),T>=f?(E=v>>>T-f&A,T-=f):(S=f-T,E=(v&A)<<S&A,v=c[b++],T=32-S,E+=v>>>T),u[x]=p[E];else for(I=Math.ceil((y-g)/m),x=0;x<d;x++)T===0&&(v=c[b++],T=32),T>=f?(E=v>>>T-f&A,T-=f):(S=f-T,E=(v&A)<<S&A,v=c[b++],T=32-S,E+=v>>>T),u[x]=E<I?g+E*m:y},unstuffLUT:function(c,u,f,d,p,g){var m=(1<<u)-1,y=0,A=0,b=0,x=0,T=0,E,v=[],S=c.length*4-Math.ceil(u*f/8);c[c.length-1]<<=8*S;var I=Math.ceil((g-d)/p);for(A=0;A<f;A++)x===0&&(E=c[y++],x=32),x>=u?(T=E>>>x-u&m,x-=u):(b=u-x,T=(E&m)<<b&m,E=c[y++],x=32-b,T+=E>>>x),v[A]=T<I?d+T*p:g;return v.unshift(d),v},unstuff2:function(c,u,f,d,p,g,m,y){var A=(1<<f)-1,b=0,x,T=0,E=0,v,S,I;if(p)for(x=0;x<d;x++)T===0&&(S=c[b++],T=32,E=0),T>=f?(v=S>>>E&A,T-=f,E+=f):(I=f-T,v=S>>>E&A,S=c[b++],T=32-I,v|=(S&(1<<I)-1)<<f-I,E=I),u[x]=p[v];else{var R=Math.ceil((y-g)/m);for(x=0;x<d;x++)T===0&&(S=c[b++],T=32,E=0),T>=f?(v=S>>>E&A,T-=f,E+=f):(I=f-T,v=S>>>E&A,S=c[b++],T=32-I,v|=(S&(1<<I)-1)<<f-I,E=I),u[x]=v<R?g+v*m:y}return u},unstuffLUT2:function(c,u,f,d,p,g){var m=(1<<u)-1,y=0,A=0,b=0,x=0,T=0,E=0,v,S=[],I=Math.ceil((g-d)/p);for(A=0;A<f;A++)x===0&&(v=c[y++],x=32,E=0),x>=u?(T=v>>>E&m,x-=u,E+=u):(b=u-x,T=v>>>E&m,v=c[y++],x=32-b,T|=(v&(1<<b)-1)<<u-b,E=b),S[A]=T<I?d+T*p:g;return S.unshift(d),S},originalUnstuff:function(c,u,f,d){var p=(1<<f)-1,g=0,m,y=0,A,b,x,T=c.length*4-Math.ceil(f*d/8);for(c[c.length-1]<<=8*T,m=0;m<d;m++)y===0&&(b=c[g++],y=32),y>=f?(A=b>>>y-f&p,y-=f):(x=f-y,A=(b&p)<<x&p,b=c[g++],y=32-x,A+=b>>>y),u[m]=A;return u},originalUnstuff2:function(c,u,f,d){var p=(1<<f)-1,g=0,m,y=0,A=0,b,x,T;for(m=0;m<d;m++)y===0&&(x=c[g++],y=32,A=0),y>=f?(b=x>>>A&p,y-=f,A+=f):(T=f-y,b=x>>>A&p,x=c[g++],y=32-T,b|=(x&(1<<T)-1)<<f-T,A=T),u[m]=b;return u}},o={HUFFMAN_LUT_BITS_MAX:12,computeChecksumFletcher32:function(c){for(var u=65535,f=65535,d=c.length,p=Math.floor(d/2),g=0;p;){var m=p>=359?359:p;p-=m;do u+=c[g++]<<8,f+=u+=c[g++];while(--m);u=(u&65535)+(u>>>16),f=(f&65535)+(f>>>16)}return d&1&&(f+=u+=c[g]<<8),u=(u&65535)+(u>>>16),f=(f&65535)+(f>>>16),(f<<16|u)>>>0},readHeaderInfo:function(c,u){var f=u.ptr,d=new Uint8Array(c,f,6),p={};if(p.fileIdentifierString=String.fromCharCode.apply(null,d),p.fileIdentifierString.lastIndexOf("Lerc2",0)!==0)throw"Unexpected file identifier string (expect Lerc2 ): "+p.fileIdentifierString;f+=6;var g=new DataView(c,f,8),m=g.getInt32(0,!0);p.fileVersion=m,f+=4,m>=3&&(p.checksum=g.getUint32(4,!0),f+=4),g=new DataView(c,f,12),p.height=g.getUint32(0,!0),p.width=g.getUint32(4,!0),f+=8,m>=4?(p.numDims=g.getUint32(8,!0),f+=4):p.numDims=1,g=new DataView(c,f,40),p.numValidPixel=g.getUint32(0,!0),p.microBlockSize=g.getInt32(4,!0),p.blobSize=g.getInt32(8,!0),p.imageType=g.getInt32(12,!0),p.maxZError=g.getFloat64(16,!0),p.zMin=g.getFloat64(24,!0),p.zMax=g.getFloat64(32,!0),f+=40,u.headerInfo=p,u.ptr=f;var y,A;if(m>=3&&(A=m>=4?52:48,y=this.computeChecksumFletcher32(new Uint8Array(c,f-A,p.blobSize-14)),y!==p.checksum))throw"Checksum failed.";return!0},checkMinMaxRanges:function(c,u){var f=u.headerInfo,d=this.getDataTypeArray(f.imageType),p=f.numDims*this.getDataTypeSize(f.imageType),g=this.readSubArray(c,u.ptr,d,p),m=this.readSubArray(c,u.ptr+p,d,p);u.ptr+=2*p;var y,A=!0;for(y=0;y<f.numDims;y++)if(g[y]!==m[y]){A=!1;break}return f.minValues=g,f.maxValues=m,A},readSubArray:function(c,u,f,d){var p;if(f===Uint8Array)p=new Uint8Array(c,u,d);else{var g=new ArrayBuffer(d),m=new Uint8Array(g);m.set(new Uint8Array(c,u,d)),p=new f(g)}return p},readMask:function(c,u){var f=u.ptr,d=u.headerInfo,p=d.width*d.height,g=d.numValidPixel,m=new DataView(c,f,4),y={};if(y.numBytes=m.getUint32(0,!0),f+=4,(g===0||p===g)&&y.numBytes!==0)throw"invalid mask";var A,b;if(g===0)A=new Uint8Array(Math.ceil(p/8)),y.bitset=A,b=new Uint8Array(p),u.pixels.resultMask=b,f+=y.numBytes;else if(y.numBytes>0){A=new Uint8Array(Math.ceil(p/8)),m=new DataView(c,f,y.numBytes);var x=m.getInt16(0,!0),T=2,E=0,v=0;do{if(x>0)for(;x--;)A[E++]=m.getUint8(T++);else for(v=m.getUint8(T++),x=-x;x--;)A[E++]=v;x=m.getInt16(T,!0),T+=2}while(T<y.numBytes);if(x!==-32768||E<A.length)throw"Unexpected end of mask RLE encoding";b=new Uint8Array(p);var S=0,I=0;for(I=0;I<p;I++)I&7?(S=A[I>>3],S<<=I&7):S=A[I>>3],S&128&&(b[I]=1);u.pixels.resultMask=b,y.bitset=A,f+=y.numBytes}return u.ptr=f,u.mask=y,!0},readDataOneSweep:function(c,u,f){var d=u.ptr,p=u.headerInfo,g=p.numDims,m=p.width*p.height,y=p.imageType,A=p.numValidPixel*o.getDataTypeSize(y)*g,b,x=u.pixels.resultMask;if(f===Uint8Array)b=new Uint8Array(c,d,A);else{var T=new ArrayBuffer(A),E=new Uint8Array(T);E.set(new Uint8Array(c,d,A)),b=new f(T)}if(b.length===m*g)u.pixels.resultPixels=b;else{u.pixels.resultPixels=new f(m*g);var v=0,S=0,I=0,R=0;if(g>1)for(I=0;I<g;I++)for(R=I*m,S=0;S<m;S++)x[S]&&(u.pixels.resultPixels[R+S]=b[v++]);else for(S=0;S<m;S++)x[S]&&(u.pixels.resultPixels[S]=b[v++])}return d+=A,u.ptr=d,!0},readHuffmanTree:function(c,u){var f=this.HUFFMAN_LUT_BITS_MAX,d=new DataView(c,u.ptr,16);u.ptr+=16;var p=d.getInt32(0,!0);if(p<2)throw"unsupported Huffman version";var g=d.getInt32(4,!0),m=d.getInt32(8,!0),y=d.getInt32(12,!0);if(m>=y)return!1;var A=new Uint32Array(y-m);o.decodeBits(c,u,A);var b=[],x,T,E,v;for(x=m;x<y;x++)T=x-(x<g?0:g),b[T]={first:A[x-m],second:null};var S=c.byteLength-u.ptr,I=Math.ceil(S/4),R=new ArrayBuffer(I*4),O=new Uint8Array(R);O.set(new Uint8Array(c,u.ptr,S));var L=new Uint32Array(R),_=0,C,w=0;for(C=L[0],x=m;x<y;x++)T=x-(x<g?0:g),v=b[T].first,v>0&&(b[T].second=C<<_>>>32-v,32-_>=v?(_+=v,_===32&&(_=0,w++,C=L[w])):(_+=v-32,w++,C=L[w],b[T].second|=C>>>32-_));var P=0,M=0,F=new s;for(x=0;x<b.length;x++)b[x]!==void 0&&(P=Math.max(P,b[x].first));P>=f?M=f:M=P,P>=30&&console.log("WARning, large NUM LUT BITS IS "+P);var V=[],B,j,k,G,q,Q;for(x=m;x<y;x++)if(T=x-(x<g?0:g),v=b[T].first,v>0)if(B=[v,T],v<=M)for(j=b[T].second<<M-v,k=1<<M-v,E=0;E<k;E++)V[j|E]=B;else for(j=b[T].second,Q=F,G=v-1;G>=0;G--)q=j>>>G&1,q?(Q.right||(Q.right=new s),Q=Q.right):(Q.left||(Q.left=new s),Q=Q.left),G===0&&!Q.val&&(Q.val=B[1]);return{decodeLut:V,numBitsLUTQick:M,numBitsLUT:P,tree:F,stuffedData:L,srcPtr:w,bitPos:_}},readHuffman:function(c,u,f){var d=u.headerInfo,p=d.numDims,g=u.headerInfo.height,m=u.headerInfo.width,y=m*g,A=this.readHuffmanTree(c,u),b=A.decodeLut,x=A.tree,T=A.stuffedData,E=A.srcPtr,v=A.bitPos,S=A.numBitsLUTQick,I=A.numBitsLUT,R=u.headerInfo.imageType===0?128:0,O,L,_,C=u.pixels.resultMask,w,P,M,F,V,B,j,k=0;v>0&&(E++,v=0);var G=T[E],q=u.encodeMode===1,Q=new f(y*p),W=Q,J;for(J=0;J<d.numDims;J++){if(p>1&&(W=new f(Q.buffer,y*J,y),k=0),u.headerInfo.numValidPixel===m*g)for(B=0,F=0;F<g;F++)for(V=0;V<m;V++,B++){if(L=0,w=G<<v>>>32-S,P=w,32-v<S&&(w|=T[E+1]>>>64-v-S,P=w),b[P])L=b[P][1],v+=b[P][0];else for(w=G<<v>>>32-I,P=w,32-v<I&&(w|=T[E+1]>>>64-v-I,P=w),O=x,j=0;j<I;j++)if(M=w>>>I-j-1&1,O=M?O.right:O.left,!(O.left||O.right)){L=O.val,v=v+j+1;break}v>=32&&(v-=32,E++,G=T[E]),_=L-R,q?(V>0?_+=k:F>0?_+=W[B-m]:_+=k,_&=255,W[B]=_,k=_):W[B]=_}else for(B=0,F=0;F<g;F++)for(V=0;V<m;V++,B++)if(C[B]){if(L=0,w=G<<v>>>32-S,P=w,32-v<S&&(w|=T[E+1]>>>64-v-S,P=w),b[P])L=b[P][1],v+=b[P][0];else for(w=G<<v>>>32-I,P=w,32-v<I&&(w|=T[E+1]>>>64-v-I,P=w),O=x,j=0;j<I;j++)if(M=w>>>I-j-1&1,O=M?O.right:O.left,!(O.left||O.right)){L=O.val,v=v+j+1;break}v>=32&&(v-=32,E++,G=T[E]),_=L-R,q?(V>0&&C[B-1]?_+=k:F>0&&C[B-m]?_+=W[B-m]:_+=k,_&=255,W[B]=_,k=_):W[B]=_}u.ptr=u.ptr+(E+1)*4+(v>0?4:0)}u.pixels.resultPixels=Q},decodeBits:function(c,u,f,d,p){{var g=u.headerInfo,m=g.fileVersion,y=0,A=new DataView(c,u.ptr,5),b=A.getUint8(0);y++;var x=b>>6,T=x===0?4:3-x,E=(b&32)>0,v=b&31,S=0;if(T===1)S=A.getUint8(y),y++;else if(T===2)S=A.getUint16(y,!0),y+=2;else if(T===4)S=A.getUint32(y,!0),y+=4;else throw"Invalid valid pixel count type";var I=2*g.maxZError,R,O,L,_,C,w,P,M,F,V,B=g.numDims>1?g.maxValues[p]:g.zMax;if(E){for(u.counter.lut++,M=A.getUint8(y),F=v,y++,_=Math.ceil((M-1)*v/8),C=Math.ceil(_/4),O=new ArrayBuffer(C*4),L=new Uint8Array(O),u.ptr+=y,L.set(new Uint8Array(c,u.ptr,_)),P=new Uint32Array(O),u.ptr+=_,V=0;M-1>>>V;)V++;_=Math.ceil(S*V/8),C=Math.ceil(_/4),O=new ArrayBuffer(C*4),L=new Uint8Array(O),L.set(new Uint8Array(c,u.ptr,_)),R=new Uint32Array(O),u.ptr+=_,m>=3?w=r.unstuffLUT2(P,v,M-1,d,I,B):w=r.unstuffLUT(P,v,M-1,d,I,B),m>=3?r.unstuff2(R,f,V,S,w):r.unstuff(R,f,V,S,w)}else u.counter.bitstuffer++,V=v,u.ptr+=y,V>0&&(_=Math.ceil(S*V/8),C=Math.ceil(_/4),O=new ArrayBuffer(C*4),L=new Uint8Array(O),L.set(new Uint8Array(c,u.ptr,_)),R=new Uint32Array(O),u.ptr+=_,m>=3?d==null?r.originalUnstuff2(R,f,V,S):r.unstuff2(R,f,V,S,!1,d,I,B):d==null?r.originalUnstuff(R,f,V,S):r.unstuff(R,f,V,S,!1,d,I,B))}},readTiles:function(c,u,f){var d=u.headerInfo,p=d.width,g=d.height,m=d.microBlockSize,y=d.imageType,A=o.getDataTypeSize(y),b=Math.ceil(p/m),x=Math.ceil(g/m);u.pixels.numBlocksY=x,u.pixels.numBlocksX=b,u.pixels.ptr=0;var T=0,E=0,v=0,S=0,I=0,R=0,O=0,L=0,_=0,C=0,w=0,P=0,M=0,F=0,V=0,B=0,j,k,G,q,Q,W,J=new f(m*m),Z=g%m||m,ae=p%m||m,Ae,fe,xe=d.numDims,ge,we=u.pixels.resultMask,Se=u.pixels.resultPixels;for(v=0;v<x;v++)for(I=v!==x-1?m:Z,S=0;S<b;S++)for(R=S!==b-1?m:ae,w=v*p*m+S*m,P=p-R,ge=0;ge<xe;ge++){if(xe>1&&(Se=new f(u.pixels.resultPixels.buffer,p*g*ge*A,p*g)),O=c.byteLength-u.ptr,j=new DataView(c,u.ptr,Math.min(10,O)),k={},B=0,L=j.getUint8(0),B++,_=L>>6&255,C=L>>2&15,C!==(S*m>>3&15))throw"integrity issue";if(W=L&3,W>3)throw u.ptr+=B,"Invalid block encoding ("+W+")";if(W===2){u.counter.constant++,u.ptr+=B;continue}else if(W===0){if(u.counter.uncompressed++,u.ptr+=B,M=I*R*A,F=c.byteLength-u.ptr,M=M<F?M:F,G=new ArrayBuffer(M%A===0?M:M+A-M%A),q=new Uint8Array(G),q.set(new Uint8Array(c,u.ptr,M)),Q=new f(G),V=0,we)for(T=0;T<I;T++){for(E=0;E<R;E++)we[w]&&(Se[w]=Q[V++]),w++;w+=P}else for(T=0;T<I;T++){for(E=0;E<R;E++)Se[w++]=Q[V++];w+=P}u.ptr+=V*A}else if(Ae=o.getDataTypeUsed(y,_),fe=o.getOnePixel(k,B,Ae,j),B+=o.getDataTypeSize(Ae),W===3)if(u.ptr+=B,u.counter.constantoffset++,we)for(T=0;T<I;T++){for(E=0;E<R;E++)we[w]&&(Se[w]=fe),w++;w+=P}else for(T=0;T<I;T++){for(E=0;E<R;E++)Se[w++]=fe;w+=P}else if(u.ptr+=B,o.decodeBits(c,u,J,fe,ge),B=0,we)for(T=0;T<I;T++){for(E=0;E<R;E++)we[w]&&(Se[w]=J[B++]),w++;w+=P}else for(T=0;T<I;T++){for(E=0;E<R;E++)Se[w++]=J[B++];w+=P}}},formatFileInfo:function(c){return{fileIdentifierString:c.headerInfo.fileIdentifierString,fileVersion:c.headerInfo.fileVersion,imageType:c.headerInfo.imageType,height:c.headerInfo.height,width:c.headerInfo.width,numValidPixel:c.headerInfo.numValidPixel,microBlockSize:c.headerInfo.microBlockSize,blobSize:c.headerInfo.blobSize,maxZError:c.headerInfo.maxZError,pixelType:o.getPixelType(c.headerInfo.imageType),eofOffset:c.eofOffset,mask:c.mask?{numBytes:c.mask.numBytes}:null,pixels:{numBlocksX:c.pixels.numBlocksX,numBlocksY:c.pixels.numBlocksY,maxValue:c.headerInfo.zMax,minValue:c.headerInfo.zMin,noDataValue:c.noDataValue}}},constructConstantSurface:function(c){var u=c.headerInfo.zMax,f=c.headerInfo.numDims,d=c.headerInfo.height*c.headerInfo.width,p=d*f,g=0,m=0,y=0,A=c.pixels.resultMask;if(A)if(f>1)for(g=0;g<f;g++)for(y=g*d,m=0;m<d;m++)A[m]&&(c.pixels.resultPixels[y+m]=u);else for(m=0;m<d;m++)A[m]&&(c.pixels.resultPixels[m]=u);else if(c.pixels.resultPixels.fill)c.pixels.resultPixels.fill(u);else for(m=0;m<p;m++)c.pixels.resultPixels[m]=u},getDataTypeArray:function(c){var u;switch(c){case 0:u=Int8Array;break;case 1:u=Uint8Array;break;case 2:u=Int16Array;break;case 3:u=Uint16Array;break;case 4:u=Int32Array;break;case 5:u=Uint32Array;break;case 6:u=Float32Array;break;case 7:u=Float64Array;break;default:u=Float32Array}return u},getPixelType:function(c){var u;switch(c){case 0:u="S8";break;case 1:u="U8";break;case 2:u="S16";break;case 3:u="U16";break;case 4:u="S32";break;case 5:u="U32";break;case 6:u="F32";break;case 7:u="F64";break;default:u="F32"}return u},isValidPixelValue:function(c,u){if(u==null)return!1;var f;switch(c){case 0:f=u>=-128&&u<=127;break;case 1:f=u>=0&&u<=255;break;case 2:f=u>=-32768&&u<=32767;break;case 3:f=u>=0&&u<=65536;break;case 4:f=u>=-2147483648&&u<=2147483647;break;case 5:f=u>=0&&u<=4294967296;break;case 6:f=u>=-34027999387901484e22&&u<=34027999387901484e22;break;case 7:f=u>=5e-324&&u<=17976931348623157e292;break;default:f=!1}return f},getDataTypeSize:function(c){var u=0;switch(c){case 0:case 1:u=1;break;case 2:case 3:u=2;break;case 4:case 5:case 6:u=4;break;case 7:u=8;break;default:u=c}return u},getDataTypeUsed:function(c,u){var f=c;switch(c){case 2:case 4:f=c-u;break;case 3:case 5:f=c-2*u;break;case 6:u===0?f=c:u===1?f=2:f=1;break;case 7:u===0?f=c:f=c-2*u+1;break;default:f=c;break}return f},getOnePixel:function(c,u,f,d){var p=0;switch(f){case 0:p=d.getInt8(u);break;case 1:p=d.getUint8(u);break;case 2:p=d.getInt16(u,!0);break;case 3:p=d.getUint16(u,!0);break;case 4:p=d.getInt32(u,!0);break;case 5:p=d.getUInt32(u,!0);break;case 6:p=d.getFloat32(u,!0);break;case 7:p=d.getFloat64(u,!0);break;default:throw"the decoder does not understand this pixel type"}return p}},s=function(c,u,f){this.val=c,this.left=u,this.right=f},a={decode:function(c,u){u=u||{};var f=u.noDataValue,d=0,p={};if(p.ptr=u.inputOffset||0,p.pixels={},!!o.readHeaderInfo(c,p)){var g=p.headerInfo,m=g.fileVersion,y=o.getDataTypeArray(g.imageType);o.readMask(c,p),g.numValidPixel!==g.width*g.height&&!p.pixels.resultMask&&(p.pixels.resultMask=u.maskData);var A=g.width*g.height;if(p.pixels.resultPixels=new y(A*g.numDims),p.counter={onesweep:0,uncompressed:0,lut:0,bitstuffer:0,constant:0,constantoffset:0},g.numValidPixel!==0)if(g.zMax===g.zMin)o.constructConstantSurface(p);else if(m>=4&&o.checkMinMaxRanges(c,p))o.constructConstantSurface(p);else{var b=new DataView(c,p.ptr,2),x=b.getUint8(0);if(p.ptr++,x)o.readDataOneSweep(c,p,y);else if(m>1&&g.imageType<=1&&Math.abs(g.maxZError-.5)<1e-5){var T=b.getUint8(1);if(p.ptr++,p.encodeMode=T,T>2||m<4&&T>1)throw"Invalid Huffman flag "+T;T?o.readHuffman(c,p,y):o.readTiles(c,p,y)}else o.readTiles(c,p,y)}p.eofOffset=p.ptr;var E;u.inputOffset?(E=p.headerInfo.blobSize+u.inputOffset-p.ptr,Math.abs(E)>=1&&(p.eofOffset=u.inputOffset+p.headerInfo.blobSize)):(E=p.headerInfo.blobSize-p.ptr,Math.abs(E)>=1&&(p.eofOffset=p.headerInfo.blobSize));var v={width:g.width,height:g.height,pixelData:p.pixels.resultPixels,minValue:g.zMin,maxValue:g.zMax,validPixelCount:g.numValidPixel,dimCount:g.numDims,dimStats:{minValues:g.minValues,maxValues:g.maxValues},maskData:p.pixels.resultMask};if(p.pixels.resultMask&&o.isValidPixelValue(g.imageType,f)){var S=p.pixels.resultMask;for(d=0;d<A;d++)S[d]||(v.pixelData[d]=f);v.noDataValue=f}return p.noDataValue=f,u.returnFileInfo&&(v.fileInfo=o.formatFileInfo(p)),v}},getBandCount:function(c){var u=0,f=0,d={};for(d.ptr=0,d.pixels={};f<c.byteLength-58;)o.readHeaderInfo(c,d),f+=d.headerInfo.blobSize,u++,d.ptr=f;return u}};return a})(),n=(function(){var r=new ArrayBuffer(4),o=new Uint8Array(r),s=new Uint32Array(r);return s[0]=1,o[0]===1})(),i={decode:function(r,o){if(!n)throw"Big endian system is not supported.";o=o||{};var s=o.inputOffset||0,a=new Uint8Array(r,s,10),c=String.fromCharCode.apply(null,a),u,f;if(c.trim()==="CntZImage")u=e,f=1;else if(c.substring(0,5)==="Lerc2")u=t,f=2;else throw"Unexpected file identifier string: "+c;for(var d=0,p=r.byteLength-10,g,m=[],y,A,b={width:0,height:0,pixels:[],pixelType:o.pixelType,mask:null,statistics:[]};s<p;){var x=u.decode(r,{inputOffset:s,encodedMaskData:g,maskData:A,returnMask:d===0,returnEncodedMask:d===0,returnFileInfo:!0,pixelType:o.pixelType||null,noDataValue:o.noDataValue||null});s=x.fileInfo.eofOffset,d===0&&(g=x.encodedMaskData,A=x.maskData,b.width=x.width,b.height=x.height,b.dimCount=x.dimCount||1,b.pixelType=x.pixelType||x.fileInfo.pixelType,b.mask=x.maskData),f>1&&x.fileInfo.mask&&x.fileInfo.mask.numBytes>0&&m.push(x.maskData),d++,b.pixels.push(x.pixelData),b.statistics.push({minValue:x.minValue,maxValue:x.maxValue,noDataValue:x.noDataValue,dimStats:x.dimStats})}var T,E,v;if(f>1&&m.length>1){for(v=b.width*b.height,b.bandMasks=m,A=new Uint8Array(v),A.set(m[0]),T=1;T<m.length;T++)for(y=m[T],E=0;E<v;E++)A[E]=A[E]&y[E];b.maskData=A}return b}};typeof define=="function"&&define.amd?define([],function(){return i}):typeof KW<"u"&&KW.exports?KW.exports=i:this.Lerc=i})()});var _3e=Yi((lj,Wle)=>{/*! NoSleep.min.js v0.12.0 - git.io/vfn01 - Rich Tibbett - MIT license */(function(e,t){typeof lj=="object"&&typeof Wle=="object"?Wle.exports=t():typeof define=="function"&&define.amd?define([],t):typeof lj=="object"?lj.NoSleep=t():e.NoSleep=t()})(lj,(function(){return(function(e){var t={};function n(i){if(t[i])return t[i].exports;var r=t[i]={i,l:!1,exports:{}};return e[i].call(r.exports,r,r.exports,n),r.l=!0,r.exports}return n.m=e,n.c=t,n.d=function(i,r,o){n.o(i,r)||Object.defineProperty(i,r,{enumerable:!0,get:o})},n.r=function(i){typeof Symbol<"u"&&Symbol.toStringTag&&Object.defineProperty(i,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(i,"__esModule",{value:!0})},n.t=function(i,r){if(1&r&&(i=n(i)),8&r||4&r&&typeof i=="object"&&i&&i.__esModule)return i;var o=Object.create(null);if(n.r(o),Object.defineProperty(o,"default",{enumerable:!0,value:i}),2&r&&typeof i!="string")for(var s in i)n.d(o,s,function(a){return i[a]}.bind(null,s));return o},n.n=function(i){var r=i&&i.__esModule?function(){return i.default}:function(){return i};return n.d(r,"a",r),r},n.o=function(i,r){return Object.prototype.hasOwnProperty.call(i,r)},n.p="",n(n.s=0)})([function(e,t,n){"use strict";var i=(function(){function f(d,p){for(var g=0;g<p.length;g++){var m=p[g];m.enumerable=m.enumerable||!1,m.configurable=!0,"value"in m&&(m.writable=!0),Object.defineProperty(d,m.key,m)}}return function(d,p,g){return p&&f(d.prototype,p),g&&f(d,g),d}})(),r=n(1),o=r.webm,s=r.mp4,a=function(){return typeof navigator<"u"&&parseFloat((""+(/CPU.*OS ([0-9_]{3,4})[0-9_]{0,1}|(CPU like).*AppleWebKit.*Mobile/i.exec(navigator.userAgent)||[0,""])[1]).replace("undefined","3_2").replace("_",".").replace("_",""))<10&&!window.MSStream},c=function(){return"wakeLock"in navigator},u=(function(){function f(){var d=this;if((function(g,m){if(!(g instanceof m))throw new TypeError("Cannot call a class as a function")})(this,f),this.enabled=!1,c()){this._wakeLock=null;var p=function(){d._wakeLock!==null&&document.visibilityState==="visible"&&d.enable()};document.addEventListener("visibilitychange",p),document.addEventListener("fullscreenchange",p)}else a()?this.noSleepTimer=null:(this.noSleepVideo=document.createElement("video"),this.noSleepVideo.setAttribute("title","No Sleep"),this.noSleepVideo.setAttribute("playsinline",""),this._addSourceToVideo(this.noSleepVideo,"webm",o),this._addSourceToVideo(this.noSleepVideo,"mp4",s),this.noSleepVideo.addEventListener("loadedmetadata",(function(){d.noSleepVideo.duration<=1?d.noSleepVideo.setAttribute("loop",""):d.noSleepVideo.addEventListener("timeupdate",(function(){d.noSleepVideo.currentTime>.5&&(d.noSleepVideo.currentTime=Math.random())}))})))}return i(f,[{key:"_addSourceToVideo",value:function(d,p,g){var m=document.createElement("source");m.src=g,m.type="video/"+p,d.appendChild(m)}},{key:"enable",value:function(){var d=this;return c()?navigator.wakeLock.request("screen").then((function(p){d._wakeLock=p,d.enabled=!0,console.log("Wake Lock active."),d._wakeLock.addEventListener("release",(function(){console.log("Wake Lock released.")}))})).catch((function(p){throw d.enabled=!1,console.error(p.name+", "+p.message),p})):a()?(this.disable(),console.warn(` NoSleep enabled for older iOS devices. This can interrupt active or long-running network requests from completing successfully. See https://github.com/richtr/NoSleep.js/issues/15 for more details. `),this.noSleepTimer=window.setInterval((function(){document.hidden||(window.location.href=window.location.href.split("#")[0],window.setTimeout(window.stop,0))}),15e3),this.enabled=!0,Promise.resolve()):this.noSleepVideo.play().then((function(p){return d.enabled=!0,p})).catch((function(p){throw d.enabled=!1,p}))}},{key:"disable",value:function(){c()?(this._wakeLock&&this._wakeLock.release(),this._wakeLock=null):a()?this.noSleepTimer&&(console.warn(` NoSleep now disabled for older iOS devices. - `),window.clearInterval(this.noSleepTimer),this.noSleepTimer=null):this.noSleepVideo.pause(),this.enabled=!1}},{key:"isEnabled",get:function(){return this.enabled}}]),f})();e.exports=u},function(e,t,n){"use strict";e.exports={webm:"data:video/webm;base64,GkXfowEAAAAAAAAfQoaBAUL3gQFC8oEEQvOBCEKChHdlYm1Ch4EEQoWBAhhTgGcBAAAAAAAVkhFNm3RALE27i1OrhBVJqWZTrIHfTbuMU6uEFlSua1OsggEwTbuMU6uEHFO7a1OsghV17AEAAAAAAACkAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAVSalmAQAAAAAAAEUq17GDD0JATYCNTGF2ZjU1LjMzLjEwMFdBjUxhdmY1NS4zMy4xMDBzpJBlrrXf3DCDVB8KcgbMpcr+RImIQJBgAAAAAAAWVK5rAQAAAAAAD++uAQAAAAAAADLXgQFzxYEBnIEAIrWcg3VuZIaFVl9WUDiDgQEj44OEAmJaAOABAAAAAAAABrCBsLq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zL,AnchorPointIndirect:()=>VL,Animation:()=>w8,AnimationViewModel:()=>I8,Appearance:()=>wr,ApproximateTerrainHeights:()=>Mi,ArcGISTiledElevationTerrainProvider:()=>iae,ArcGisBaseMapType:()=>_m,ArcGisMapServerImageryProvider:()=>Qg,ArcGisMapService:()=>kf,ArcType:()=>ln,ArticulationStageType:()=>ul,AssociativeArray:()=>Ut,Atmosphere:()=>hT,AtmospherePipelineStage:()=>_F,AttributeCompression:()=>cn,AttributeType:()=>Vt,AutoExposure:()=>_V,AutomaticUniforms:()=>tg,Axis:()=>Hi,AxisAlignedBoundingBox:()=>If,Azure2DImageryProvider:()=>TB,B3dmLoader:()=>nF,B3dmParser:()=>QL,BaseLayerPicker:()=>D8,BaseLayerPickerViewModel:()=>P8,BatchTable:()=>wx,BatchTableHierarchy:()=>Jx,BatchTexture:()=>Ql,BatchTexturePipelineStage:()=>VF,Billboard:()=>Br,BillboardCollection:()=>Wf,BillboardGraphics:()=>Zc,BillboardLoadState:()=>qs,BillboardTexture:()=>r_,BillboardVisualizer:()=>RM,BingMapsGeocoderService:()=>oae,BingMapsImageryProvider:()=>dB,BingMapsStyle:()=>GS,BlendEquation:()=>Dc,BlendFunction:()=>$r,BlendOption:()=>Fi,BlendingState:()=>tn,BoundingRectangle:()=>et,BoundingSphere:()=>ue,BoundingSphereState:()=>Pt,BoundingVolumeSemantics:()=>hA,BoxEmitter:()=>ace,BoxGeometry:()=>Ic,BoxGeometryUpdater:()=>UN,BoxGraphics:()=>Nx,BoxOutlineGeometry:()=>$h,BrdfLutGenerator:()=>gz,Buffer:()=>tt,BufferLoader:()=>iT,BufferPoint:()=>kc,BufferPointCollection:()=>$u,BufferPointMaterial:()=>wm,BufferPolygon:()=>Mo,BufferPolygonCollection:()=>za,BufferPolygonMaterial:()=>Lf,BufferPolyline:()=>Aa,BufferPolylineCollection:()=>ml,BufferPolylineMaterial:()=>Ff,BufferPrimitive:()=>as,BufferPrimitiveCollection:()=>ra,BufferPrimitiveMaterial:()=>nu,BufferUsage:()=>Me,CPUStylingPipelineStage:()=>WF,CallbackPositionProperty:()=>zN,CallbackProperty:()=>nm,Camera:()=>Or,CameraEventAggregator:()=>CV,CameraEventType:()=>cr,CameraFlightPath:()=>yz,Cartesian2:()=>U,Cartesian3:()=>h,Cartesian4:()=>se,CartesianRectangle:()=>nw,Cartographic:()=>he,CartographicGeocoderService:()=>aae,CatmullRomSpline:()=>cae,Cesium3DContentGroup:()=>$x,Cesium3DTile:()=>oh,Cesium3DTileBatchTable:()=>sm,Cesium3DTileColorBlendMode:()=>zu,Cesium3DTileContent:()=>fce,Cesium3DTileContentFactory:()=>VT,Cesium3DTileContentState:()=>Rr,Cesium3DTileContentType:()=>Ca,Cesium3DTileFeature:()=>na,Cesium3DTileFeatureTable:()=>hm,Cesium3DTileOptimizationHint:()=>th,Cesium3DTileOptimizations:()=>ak,Cesium3DTilePass:()=>ao,Cesium3DTilePassState:()=>vh,Cesium3DTilePointFeature:()=>o_,Cesium3DTileRefine:()=>yo,Cesium3DTileStyle:()=>u_,Cesium3DTileStyleEngine:()=>hk,Cesium3DTileVectorFeature:()=>kT,Cesium3DTilesInspector:()=>H8,Cesium3DTilesInspectorViewModel:()=>j8,Cesium3DTilesTerrainData:()=>M4,Cesium3DTilesTerrainGeometryProcessor:()=>FP,Cesium3DTilesTerrainProvider:()=>mae,Cesium3DTilesVoxelProvider:()=>dce,Cesium3DTileset:()=>Yo,Cesium3DTilesetBaseTraversal:()=>Ak,Cesium3DTilesetCache:()=>uk,Cesium3DTilesetGraphics:()=>Vx,Cesium3DTilesetHeatmap:()=>fk,Cesium3DTilesetMetadata:()=>JT,Cesium3DTilesetMostDetailedTraversal:()=>gk,Cesium3DTilesetSkipTraversal:()=>Tk,Cesium3DTilesetStatistics:()=>Pm,Cesium3DTilesetTraversal:()=>qa,Cesium3DTilesetVisualizer:()=>Ek,CesiumInspector:()=>L8,CesiumInspectorViewModel:()=>N8,CesiumTerrainProvider:()=>kC,CesiumWidget:()=>P4,Check:()=>Wr,CheckerboardMaterialProperty:()=>Ew,CircleEmitter:()=>Y4,CircleGeometry:()=>bae,CircleOutlineGeometry:()=>xae,ClassificationModelDrawCommand:()=>s2,ClassificationPipelineStage:()=>jF,ClassificationPrimitive:()=>kv,ClassificationType:()=>ei,ClearCommand:()=>li,ClippingPlane:()=>ia,ClippingPlaneCollection:()=>bs,ClippingPolygon:()=>bS,ClippingPolygonCollection:()=>Nc,Clock:()=>Lm,ClockRange:()=>Rs,ClockStep:()=>Vr,ClockViewModel:()=>C8,CloudCollection:()=>_ce,CloudType:()=>HP,Color:()=>z,ColorBlendMode:()=>ll,ColorGeometryInstanceAttribute:()=>Jt,ColorMaterialProperty:()=>Kt,Command:()=>Rle,ComponentDatatype:()=>Y,Composite3DTileContent:()=>XN,CompositeEntityCollection:()=>cee,CompositeMaterialProperty:()=>vw,CompositePositionProperty:()=>pc,CompositeProperty:()=>_l,CompressedTextureBuffer:()=>vD,ComputeCommand:()=>xf,ComputeEngine:()=>CD,ConditionsExpression:()=>G2,ConeEmitter:()=>Ace,ConstantPositionProperty:()=>Xl,ConstantProperty:()=>ui,ConstantSpline:()=>sF,ContentMetadata:()=>Z2,Context:()=>xx,ContextLimits:()=>kt,Controller:()=>gle,ControllerHost:()=>xz,CoplanarPolygonGeometry:()=>o3,CoplanarPolygonGeometryLibrary:()=>g_,CoplanarPolygonOutlineGeometry:()=>rh,CornerType:()=>rr,CorrelationGroup:()=>jL,CorridorGeometry:()=>tE,CorridorGeometryLibrary:()=>mr,CorridorGeometryUpdater:()=>Ok,CorridorGraphics:()=>Fx,CorridorOutlineGeometry:()=>Rk,Credit:()=>It,CreditDisplay:()=>Cz,CubeMap:()=>ns,CubeMapFace:()=>LD,CubeMapPanorama:()=>DC,CubicRealPolynomial:()=>hx,CullFace:()=>Vi,CullingVolume:()=>ta,CumulusCloud:()=>Ad,CustomDataSource:()=>Fk,CustomHeightmapTerrainProvider:()=>Tae,CustomShader:()=>H0,CustomShaderMode:()=>Zg,CustomShaderPipelineStage:()=>ZF,CustomShaderTranslucencyMode:()=>vA,CylinderGeometry:()=>Bk,CylinderGeometryLibrary:()=>nE,CylinderGeometryUpdater:()=>Uk,CylinderGraphics:()=>Bx,CylinderOutlineGeometry:()=>kk,CzmlDataSource:()=>Kk,DataSource:()=>Ds,DataSourceClock:()=>Fm,DataSourceCollection:()=>$k,DataSourceDisplay:()=>V3,DebugAppearance:()=>Cce,DebugCameraPrimitive:()=>F0,DebugInspector:()=>FV,DebugModelMatrixPrimitive:()=>$4,DefaultProxy:()=>Cae,DepthFunction:()=>cc,DepthPlane:()=>Dz,DequantizationPipelineStage:()=>eB,DerivedCommand:()=>ip,DeveloperError:()=>pe,DeviceOrientationCameraController:()=>Rz,DirectionalLight:()=>Ice,DiscardEmptyTileImagePolicy:()=>WS,DiscardMissingTileImagePolicy:()=>uB,DistanceDisplayCondition:()=>Ht,DistanceDisplayConditionGeometryInstanceAttribute:()=>Qn,DoubleEndedPriorityQueue:()=>hy,DoublyLinkedList:()=>lk,DracoLoader:()=>Fg,DrawCommand:()=>at,DynamicAtmosphereLightingType:()=>Vg,DynamicEnvironmentMapManager:()=>jg,DynamicGeometryBatch:()=>cE,DynamicGeometryUpdater:()=>Ii,EarthOrientationParameters:()=>gD,EarthOrientationParametersSample:()=>wy,EasingFunction:()=>Ls,EdgeDetectionPipelineStage:()=>nB,EdgeDisplayMode:()=>Wd,EdgeFramebuffer:()=>Bz,EdgeVisibilityPipelineStage:()=>oB,EllipseGeometry:()=>mu,EllipseGeometryLibrary:()=>ef,EllipseGeometryUpdater:()=>Zk,EllipseGraphics:()=>kx,EllipseOutlineGeometry:()=>td,Ellipsoid:()=>ee,EllipsoidGeodesic:()=>xg,EllipsoidGeometry:()=>Xa,EllipsoidGeometryUpdater:()=>e3,EllipsoidGraphics:()=>Ux,EllipsoidOutlineGeometry:()=>Xf,EllipsoidPrimitive:()=>fz,EllipsoidRhumbLine:()=>Rc,EllipsoidSurfaceAppearance:()=>Pce,EllipsoidTangentPlane:()=>Vs,EllipsoidTerrainProvider:()=>O0,EllipsoidalOccluder:()=>Mm,Empty3DTileContent:()=>n0,EncodedCartesian3:()=>Sn,Entity:()=>Jr,EntityCluster:()=>$f,EntityCollection:()=>Ya,EntityView:()=>H3,EquirectangularPanorama:()=>Dce,Event:()=>be,EventHelper:()=>Xo,Expression:()=>Bd,ExpressionNodeType:()=>Mt,ExtrapolationType:()=>fu,FeatureDetection:()=>dn,FeatureIdPipelineStage:()=>CA,Fog:()=>Oz,ForEach:()=>ke,FrameRateMonitor:()=>n8,FrameState:()=>VA,Framebuffer:()=>_s,FramebufferManager:()=>ai,Frozen:()=>H,FrustumCommands:()=>Uz,FrustumGeometry:()=>iC,FrustumOutlineGeometry:()=>wz,Fullscreen:()=>es,FullscreenButton:()=>B8,FullscreenButtonViewModel:()=>F8,GaussianSplat3DTileContent:()=>BA,GaussianSplatPrimitive:()=>J2,GaussianSplatRenderResources:()=>X2,GaussianSplatSorter:()=>UT,GaussianSplatTextureGenerator:()=>Y2,GeoJsonDataSource:()=>gb,GeoJsonLoader:()=>iF,GeoJsonPrimitive:()=>Nce,GeocodeType:()=>Vb,Geocoder:()=>cj,GeocoderService:()=>UP,GeocoderViewModel:()=>aj,GeographicProjection:()=>Ui,GeographicTilingScheme:()=>er,Geometry:()=>St,Geometry3DTileContent:()=>JN,GeometryAttribute:()=>Ne,GeometryAttributes:()=>Tn,GeometryFactory:()=>vae,GeometryInstance:()=>Ft,GeometryInstanceAttribute:()=>Qc,GeometryOffsetAttribute:()=>mn,GeometryPipeline:()=>Hn,GeometryPipelineStage:()=>lB,GeometryType:()=>Sd,GeometryUpdater:()=>Pi,GeometryUpdaterSet:()=>AE,GeometryVisualizer:()=>S3,GetFeatureInfoFormat:()=>ym,Globe:()=>az,GlobeDepth:()=>zz,GlobeSurfaceShaderSet:()=>$U,GlobeSurfaceTile:()=>Eh,GlobeSurfaceTileProvider:()=>ZU,GlobeTranslucency:()=>QU,GlobeTranslucencyFramebuffer:()=>Vz,GlobeTranslucencyState:()=>Mz,GltfBufferViewLoader:()=>Zv,GltfDracoLoader:()=>Qv,GltfGpmLoader:()=>GL,GltfGpmLocal:()=>vS,GltfImageLoader:()=>eS,GltfIndexBufferLoader:()=>tS,GltfJsonLoader:()=>iS,GltfLoader:()=>Bf,GltfLoaderUtil:()=>Hu,GltfMeshPrimitiveGpmLoader:()=>XL,GltfSpzLoader:()=>pL,GltfStructuralMetadataLoader:()=>kL,GltfTextureLoader:()=>aS,GltfVertexBufferLoader:()=>cS,Google2DImageryProvider:()=>xB,GoogleEarthEnterpriseImageryProvider:()=>Fce,GoogleEarthEnterpriseMapsProvider:()=>pB,GoogleEarthEnterpriseMetadata:()=>_y,GoogleEarthEnterpriseTerrainData:()=>zP,GoogleEarthEnterpriseTerrainProvider:()=>Oae,GoogleEarthEnterpriseTileInformation:()=>B4,GoogleGeocoderService:()=>Nae,GoogleMaps:()=>Ta,GoogleStreetViewCubeMapPanoramaProvider:()=>Bce,GpxDataSource:()=>FU,GregorianDate:()=>Bh,GridImageryProvider:()=>kce,GridMaterialProperty:()=>Lw,GroundGeometryUpdater:()=>ii,GroundPolylineGeometry:()=>Rx,GroundPolylinePrimitive:()=>Jh,GroundPrimitive:()=>ql,GroupMetadata:()=>bw,HeadingPitchRange:()=>ph,HeadingPitchRoll:()=>wc,Heap:()=>dD,HeightReference:()=>We,HeightmapEncoding:()=>xh,HeightmapTerrainData:()=>jc,HeightmapTessellator:()=>uP,HermitePolynomialApproximation:()=>zk,HermiteSpline:()=>TA,HilbertOrder:()=>Xv,HomeButton:()=>U8,HomeButtonViewModel:()=>k8,HorizontalOrigin:()=>zi,HybridScreenSpacePanCameraController:()=>xle,I3SBuildingSceneLayerExplorer:()=>kle,I3SBuildingSceneLayerExplorerViewModel:()=>G8,I3SDataProvider:()=>gp,I3SDecoder:()=>i8,I3SFeature:()=>r8,I3SField:()=>o8,I3SGeometry:()=>qP,I3SLayer:()=>KC,I3SNode:()=>YP,I3SStatistics:()=>c8,I3SSublayer:()=>u8,I3SSymbology:()=>a8,I3dmLoader:()=>oF,I3dmParser:()=>rF,ITwinData:()=>jce,ITwinPlatform:()=>ua,Iau2000Orientation:()=>lz,Iau2006XysData:()=>_D,Iau2006XysSample:()=>lx,IauOrientationAxes:()=>uz,IauOrientationParameters:()=>cz,ImageBasedLighting:()=>Kx,ImageBasedLightingPipelineStage:()=>AF,ImageMaterialProperty:()=>Ky,Imagery:()=>ew,ImageryConfiguration:()=>g2,ImageryCoverage:()=>iw,ImageryFlags:()=>EB,ImageryInput:()=>vB,ImageryLayer:()=>Ss,ImageryLayerCollection:()=>ZT,ImageryLayerFeatureInfo:()=>gm,ImageryPipelineStage:()=>SB,ImageryProvider:()=>Uf,ImageryState:()=>Vn,Implicit3DTileContent:()=>hS,ImplicitAvailabilityBitstream:()=>$v,ImplicitMetadataView:()=>Jv,ImplicitSubdivisionScheme:()=>Gs,ImplicitSubtree:()=>Ug,ImplicitSubtreeCache:()=>W4,ImplicitSubtreeMetadata:()=>QN,ImplicitTileCoordinates:()=>o0,ImplicitTileset:()=>r0,IndexDatatype:()=>je,InfoBox:()=>X8,InfoBoxViewModel:()=>Y8,InspectorShared:()=>Af,InstanceAttributeSemantic:()=>No,InstancingPipelineStage:()=>FF,InterpolationAlgorithm:()=>Fae,InterpolationType:()=>fm,Intersect:()=>$t,IntersectionTests:()=>_i,Intersections2D:()=>fp,Interval:()=>Us,InvertClassification:()=>bP,Ion:()=>ku,IonGeocodeProviderType:()=>yy,IonGeocoderService:()=>VC,IonImageryProvider:()=>ou,IonImageryProviderFactory:()=>ZS,IonResource:()=>Ho,IonSnapGeometryType:()=>Uae,IonSnapHeat:()=>zae,IonSnapMode:()=>U4,IonSnapParentGeometryType:()=>Vae,IonSnapService:()=>jae,IonWorldImageryStyle:()=>t_,Iso8601:()=>nt,JobScheduler:()=>Nz,JobType:()=>Mc,JsonMetadataTable:()=>Hg,JulianDate:()=>K,KTX2Transcoder:()=>SD,KeyboardEventModifier:()=>to,KeyframeNode:()=>Hr,KmlCamera:()=>BU,KmlDataSource:()=>JE,KmlLookAt:()=>kU,KmlTour:()=>UU,KmlTourFlyTo:()=>VU,KmlTourWait:()=>jU,Label:()=>RA,LabelCollection:()=>e0,LabelGraphics:()=>Qh,LabelStyle:()=>Ao,LabelVisualizer:()=>w3,LagrangePolynomialApproximation:()=>Vk,LeapSecond:()=>yr,Light:()=>Hce,LightingModel:()=>Jp,LightingPipelineStage:()=>IB,LinearApproximation:()=>KA,LinearSpline:()=>xA,MVTDataProvider:()=>qce,ManagedArray:()=>Zl,MapMode2D:()=>Au,MapProjection:()=>Gae,MapboxImageryProvider:()=>gB,MapboxStyleImageryProvider:()=>Gce,MappedPositions:()=>CB,Material:()=>Qi,MaterialAppearance:()=>Er,MaterialPipelineStage:()=>OB,MaterialProperty:()=>_o,Math:()=>D,Matrix2:()=>Xi,Matrix3:()=>$,Matrix4:()=>N,Megatexture:()=>u4,MeshPrimitiveGpmLocal:()=>YL,MetadataClass:()=>lm,MetadataClassProperty:()=>Vp,MetadataComponentType:()=>Lt,MetadataEntity:()=>Yn,MetadataEnum:()=>yL,MetadataEnumValue:()=>_L,MetadataPicking:()=>Lz,MetadataPickingPipelineStage:()=>jf,MetadataPipelineStage:()=>qd,MetadataSchema:()=>eu,MetadataSchemaLoader:()=>fA,MetadataSemantic:()=>Vd,MetadataTable:()=>kd,MetadataTableProperty:()=>nL,MetadataType:()=>bt,MipmapHint:()=>Pd,Model:()=>Hf,Model3DTileContent:()=>Gf,ModelAlphaOptions:()=>vT,ModelAnimation:()=>uF,ModelAnimationChannel:()=>lF,ModelAnimationCollection:()=>fF,ModelAnimationLoop:()=>Gu,ModelAnimationState:()=>mm,ModelArticulation:()=>xF,ModelArticulationStage:()=>bF,ModelClippingPlanesPipelineStage:()=>CF,ModelClippingPolygonsPipelineStage:()=>wF,ModelColorPipelineStage:()=>EA,ModelComponents:()=>Cn,ModelDrawCommand:()=>a2,ModelDrawCommands:()=>u2,ModelFeature:()=>dF,ModelFeatureTable:()=>hF,ModelGraphics:()=>Sg,ModelImagery:()=>_2,ModelImageryMapping:()=>TT,ModelLightingOptions:()=>i2,ModelMatrixUpdateStage:()=>BF,ModelNode:()=>RF,ModelPrimitiveImagery:()=>ET,ModelReader:()=>ba,ModelRenderResources:()=>$B,ModelRuntimeNode:()=>UF,ModelRuntimePrimitive:()=>XB,ModelSceneGraph:()=>f2,ModelSilhouettePipelineStage:()=>QB,ModelSkin:()=>KB,ModelSplitterPipelineStage:()=>t2,ModelStatistics:()=>d2,ModelType:()=>Wo,ModelUtility:()=>xt,ModelVectorLookupPipelineStage:()=>DF,ModelVisualizer:()=>P3,Moon:()=>hz,MorphTargetsPipelineStage:()=>NB,MorphWeightSpline:()=>Wae,MortonOrder:()=>jA,MouseButton:()=>ec,Multiple3DTileContent:()=>tk,MultisampleFramebuffer:()=>IO,NavigationHelpButton:()=>q8,NavigationHelpButtonViewModel:()=>W8,NearFarScalar:()=>qt,NeverTileDiscardPolicy:()=>Xce,NodeRenderResources:()=>n2,NodeStatisticsPipelineStage:()=>kF,NodeTransformationProperty:()=>zx,OIT:()=>jz,Occluder:()=>mz,OffsetGeometryInstanceAttribute:()=>Tr,OpenCageGeocoderService:()=>Yae,OpenStreetMapImageryProvider:()=>xy,OrderedGroundPrimitiveCollection:()=>Jk,OrientedBoundingBox:()=>en,OrthographicFrustum:()=>gn,OrthographicOffCenterFrustum:()=>ys,Packable:()=>Xae,PackableForInterpolation:()=>Kae,Panorama:()=>Kce,PanoramaProvider:()=>$ce,Particle:()=>$P,ParticleBurst:()=>Zce,ParticleEmitter:()=>Qce,ParticleSystem:()=>ele,Pass:()=>Ie,PassState:()=>sc,PathGraphics:()=>wg,PathMode:()=>a0,PathVisualizer:()=>M3,PeliasGeocoderService:()=>k4,PerInstanceColorAppearance:()=>yn,PerformanceDisplay:()=>ny,PerformanceWatchdog:()=>$8,PerformanceWatchdogViewModel:()=>K8,PerspectiveFrustum:()=>Ji,PerspectiveOffCenterFrustum:()=>yu,PickDepth:()=>Fz,PickDepthFramebuffer:()=>Gz,PickFramebuffer:()=>Wz,PickId:()=>zD,PickedMetadataInfo:()=>g4,Picking:()=>Zz,PickingPipelineStage:()=>LB,PinBuilder:()=>$_,PixelDatatype:()=>ze,PixelFormat:()=>Ke,PlanarFillIdFramebuffer:()=>kz,Plane:()=>sn,PlaneGeometry:()=>t3,PlaneGeometryUpdater:()=>i3,PlaneGraphics:()=>ON,PlaneOutlineGeometry:()=>n3,PntsLoader:()=>m2,PntsParser:()=>wT,PointCloud:()=>w4,PointCloudEyeDomeLighting:()=>Wg,PointCloudShading:()=>Yp,PointCloudStylingPipelineStage:()=>BB,PointGraphics:()=>jx,PointPrimitive:()=>Ia,PointPrimitiveCollection:()=>Dw,PointVisualizer:()=>L3,PolygonGeometry:()=>qp,PolygonGeometryLibrary:()=>ni,PolygonGeometryUpdater:()=>a3,PolygonGraphics:()=>em,PolygonHierarchy:()=>Oc,PolygonOutlineGeometry:()=>s3,PolygonPipeline:()=>fi,Polyline:()=>Jd,PolylineArrowMaterialProperty:()=>Bw,PolylineCollection:()=>Cm,PolylineColorAppearance:()=>js,PolylineDashMaterialProperty:()=>Uw,PolylineGeometry:()=>z_,PolylineGeometryUpdater:()=>k3,PolylineGlowMaterialProperty:()=>Vw,PolylineGraphics:()=>el,PolylineMaterialAppearance:()=>lc,PolylineOutlineMaterialProperty:()=>$A,PolylinePipeline:()=>ir,PolylineVisualizer:()=>z3,PolylineVolumeGeometry:()=>u3,PolylineVolumeGeometryLibrary:()=>Dm,PolylineVolumeGeometryUpdater:()=>m3,PolylineVolumeGraphics:()=>Hx,PolylineVolumeOutlineGeometry:()=>h3,PositionProperty:()=>Zh,PositionPropertyArray:()=>D_,PostProcessStage:()=>Ur,PostProcessStageCollection:()=>bV,PostProcessStageComposite:()=>hf,PostProcessStageLibrary:()=>dd,PostProcessStageSampleMode:()=>fd,PostProcessStageTextureCache:()=>gC,PpeMetadata:()=>qL,PpeSource:()=>wle,PpeTexture:()=>WL,Primitive:()=>On,PrimitiveCollection:()=>xl,PrimitiveLoadPlan:()=>_T,PrimitiveOutlineGenerator:()=>gT,PrimitiveOutlinePipelineStage:()=>zB,PrimitivePipeline:()=>Ix,PrimitiveRenderResources:()=>r2,PrimitiveState:()=>rs,PrimitiveStatisticsPipelineStage:()=>VB,PrimitiveType:()=>Oe,ProjectionPicker:()=>Z8,ProjectionPickerViewModel:()=>J8,Property:()=>X,PropertyArray:()=>Hw,PropertyAttribute:()=>mT,PropertyAttributeProperty:()=>NL,PropertyBag:()=>$l,PropertyTable:()=>iu,PropertyTexture:()=>Gg,PropertyTextureProperty:()=>ML,ProviderViewModel:()=>uo,Proxy:()=>Jae,QuadraticRealPolynomial:()=>Ul,QuadtreeOccluders:()=>ez,QuadtreePrimitive:()=>sz,QuadtreeTile:()=>tz,QuadtreeTileLoadState:()=>Ja,QuadtreeTileProvider:()=>nle,QuantizedMeshTerrainData:()=>BC,QuarticRealPolynomial:()=>PD,Quaternion:()=>Le,QuaternionSpline:()=>cF,Queue:()=>gA,Ray:()=>pn,Rectangle:()=>ie,RectangleCollisionChecker:()=>xE,RectangleGeometry:()=>hE,RectangleGeometryLibrary:()=>Sa,RectangleGeometryUpdater:()=>p3,RectangleGraphics:()=>tm,RectangleOutlineGeometry:()=>GT,ReferenceFrame:()=>ji,ReferenceProperty:()=>R_,RenderState:()=>Ge,Renderbuffer:()=>Sf,RenderbufferFormat:()=>jl,Request:()=>wo,RequestErrorEvent:()=>wp,RequestScheduler:()=>Kc,RequestState:()=>Ti,RequestType:()=>Zs,Resource:()=>De,ResourceCache:()=>Li,ResourceCacheKey:()=>tu,ResourceCacheStatistics:()=>xL,ResourceLoader:()=>nr,ResourceLoaderState:()=>Tt,Rotation:()=>lh,RuntimeError:()=>oe,S2Cell:()=>Mg,SDFSettings:()=>Ga,SampledPositionProperty:()=>_c,SampledProperty:()=>Qf,Sampler:()=>jt,ScaledPositionProperty:()=>m0,Scene:()=>y4,SceneFramebuffer:()=>fC,SceneMode:()=>re,SceneMode2DPipelineStage:()=>jB,SceneModePicker:()=>ej,SceneModePickerViewModel:()=>Q8,SceneTransforms:()=>dr,SceneTransitioner:()=>EV,ScreenSpaceCameraController:()=>wV,ScreenSpaceElevatorCameraController:()=>y8,ScreenSpaceEventHandler:()=>ca,ScreenSpaceEventType:()=>un,ScreenSpaceInputBindings:()=>yp,ScreenSpaceMapCameraController:()=>A8,ScreenSpaceTiltOrbitCameraController:()=>Ele,ScreenSpaceZoomCameraController:()=>vle,SelectedFeatureIdPipelineStage:()=>SA,SelectionIndicator:()=>ij,SelectionIndicatorViewModel:()=>nj,SensorVolumePortionToDisplay:()=>Yw,ShaderBuilder:()=>hg,ShaderCache:()=>TO,ShaderDestination:()=>de,ShaderFunction:()=>OO,ShaderProgram:()=>Qt,ShaderSource:()=>Ye,ShaderStruct:()=>RO,ShadowMap:()=>oy,ShadowMapShader:()=>op,ShadowMode:()=>Dn,ShadowVolumeAppearance:()=>Pf,SharedContext:()=>MO,ShowGeometryInstanceAttribute:()=>Pn,Simon1994PlanetaryPositions:()=>ky,SimplePolylineGeometry:()=>Zae,SingleTileImageryProvider:()=>_B,SkinningPipelineStage:()=>GB,SkyAtmosphere:()=>A4,SkyBox:()=>x4,SnapFramebuffer:()=>PV,SnapService:()=>Qae,Snapping:()=>RV,SpatialNode:()=>d4,Spdcf:()=>HL,SpecularEnvironmentCubeMap:()=>rm,SphereEmitter:()=>rle,SphereGeometry:()=>V4,SphereOutlineGeometry:()=>y_,Spherical:()=>jk,Spline:()=>Dr,SplitDirection:()=>jo,Splitter:()=>PP,StaticGeometryColorBatch:()=>hh,StaticGeometryPerMaterialBatch:()=>mh,StaticGroundGeometryColorBatch:()=>hI,StaticGroundGeometryPerMaterialBatch:()=>v3,StaticGroundPolylinePerMaterialBatch:()=>U3,StaticOutlineGeometryBatch:()=>gI,StencilConstants:()=>Yt,StencilFunction:()=>ti,StencilOperation:()=>Rt,SteppedSpline:()=>aF,Stereographic:()=>al,StorageType:()=>AA,StripeMaterialProperty:()=>Ww,StripeOrientation:()=>Bm,StructuralMetadata:()=>Va,StyleCommandsNeeded:()=>pm,StyleExpression:()=>ole,Sun:()=>C4,SunLight:()=>dg,SunPostProcess:()=>NV,SupportedImageFormats:()=>UL,SvgPathBindingHandler:()=>T8,Sync:()=>NO,TaskProcessor:()=>$n,Terrain:()=>p8,TerrainData:()=>uf,TerrainEncoding:()=>Co,TerrainFillMesh:()=>mP,TerrainMesh:()=>bc,TerrainOffsetProperty:()=>Gx,TerrainPicker:()=>XU,TerrainProvider:()=>Xr,TerrainQuantization:()=>$a,TerrainState:()=>kr,Texture:()=>Dt,Texture3D:()=>LO,TextureAtlas:()=>Ex,TextureCache:()=>EO,TextureMagnificationFilter:()=>Jn,TextureManager:()=>zV,TextureMinificationFilter:()=>Wt,TexturePacker:()=>vv,TextureUniform:()=>jV,TextureWrap:()=>hn,TileAvailability:()=>up,TileBoundingRegion:()=>Yf,TileBoundingS2Cell:()=>ok,TileBoundingSphere:()=>A_,TileBoundingVolume:()=>sle,TileCoordinatesImageryProvider:()=>_8,TileDiscardPolicy:()=>cle,TileEdge:()=>wn,TileImagery:()=>tw,TileMapServiceImageryProvider:()=>wA,TileMetadata:()=>Q2,TileOrientedBoundingBox:()=>Ju,TileProviderError:()=>Zr,TileReplacementQueue:()=>nz,TileSelectionResult:()=>pi,TileState:()=>lle,Tileset3DTileContent:()=>b2,TilesetMetadata:()=>sk,TilesetPipelineStage:()=>mF,TilingScheme:()=>tce,TimeConstants:()=>kn,TimeDynamicImagery:()=>xT,TimeDynamicPointCloud:()=>RP,TimeInterval:()=>En,TimeIntervalCollection:()=>Ps,TimeIntervalCollectionPositionProperty:()=>O_,TimeIntervalCollectionProperty:()=>M_,TimeStandard:()=>si,Timeline:()=>sj,TimelineHighlightRange:()=>rj,TimelineTrack:()=>oj,Tipsify:()=>DD,ToggleButtonViewModel:()=>Wb,Tonemapper:()=>cy,TrackingReferenceFrame:()=>bg,Transforms:()=>At,TranslationRotationScale:()=>$y,TranslucentTileClassification:()=>qz,TridiagonalSystemSolver:()=>OS,TrustedServers:()=>dv,TweenCollection:()=>bC,UniformState:()=>wO,UniformType:()=>j0,UrlTemplate3DTilesDataProvider:()=>d8,UrlTemplateImageryProvider:()=>vs,VERSION:()=>I9t,VRButton:()=>fj,VRButtonViewModel:()=>uj,VRTheWorldTerrainProvider:()=>ice,VaryingType:()=>Sle,Vector3DTileBatch:()=>zp,Vector3DTileClampedPolylines:()=>L2,Vector3DTileContent:()=>B2,Vector3DTileGeometry:()=>Og,Vector3DTilePoints:()=>R2,Vector3DTilePolygons:()=>O2,Vector3DTilePolylines:()=>LT,Vector3DTilePrimitive:()=>eT,VectorGltf3DTileContent:()=>FA,VectorPipeline:()=>Es,VectorProvider:()=>f_,VelocityOrientationProperty:()=>Gk,VelocityVectorProperty:()=>N_,VertexArray:()=>zn,VertexArrayFacade:()=>mg,VertexAttributeSemantic:()=>ct,VertexFormat:()=>Be,VerticalExaggeration:()=>Ar,VerticalExaggerationPipelineStage:()=>qB,VerticalOrigin:()=>Gn,VideoSynchronizer:()=>nce,View:()=>hC,Viewer:()=>Yle,ViewportQuad:()=>ule,Visibility:()=>$o,Visualizer:()=>Vre,VoxelBoundsCollection:()=>fy,VoxelBoxShape:()=>SC,VoxelCell:()=>BV,VoxelContent:()=>vC,VoxelCylinderShape:()=>wC,VoxelEllipsoidShape:()=>IC,VoxelInspector:()=>hj,VoxelInspectorViewModel:()=>dj,VoxelMetadataOrder:()=>G0,VoxelPrimitive:()=>Fb,VoxelProvider:()=>dle,VoxelRenderResources:()=>r4,VoxelShape:()=>hle,VoxelShapeType:()=>Ec,VoxelTraversal:()=>h4,VulkanConstants:()=>rce,WallGeometry:()=>_3,WallGeometryLibrary:()=>mE,WallGeometryUpdater:()=>b3,WallGraphics:()=>Ig,WallOutlineGeometry:()=>A3,WebGLConstants:()=>te,WebMapServiceImageryProvider:()=>AB,WebMapTileServiceImageryProvider:()=>bB,WebMercatorProjection:()=>yi,WebMercatorTilingScheme:()=>Lo,WindingOrder:()=>Qs,WireframeIndexGenerator:()=>rw,WireframePipelineStage:()=>YB,_shadersAcesTonemappingStage:()=>Qz,_shadersAdditiveBlend:()=>OV,_shadersAdjustTranslucentFS:()=>Sv,_shadersAllMaterialAppearanceFS:()=>NM,_shadersAllMaterialAppearanceVS:()=>LM,_shadersAmbientOcclusionGenerate:()=>eV,_shadersAmbientOcclusionModulate:()=>tV,_shadersAspectRampMaterial:()=>zM,_shadersAtmosphereCommon:()=>Yh,_shadersAtmosphereStageFS:()=>pF,_shadersAtmosphereStageVS:()=>gF,_shadersBasicMaterialAppearanceFS:()=>FM,_shadersBasicMaterialAppearanceVS:()=>BM,_shadersBillboardCollectionFS:()=>BO,_shadersBillboardCollectionVS:()=>kO,_shadersBlackAndWhite:()=>nV,_shadersBloomComposite:()=>iV,_shadersBrdfLutGeneratorFS:()=>UO,_shadersBrightPass:()=>MV,_shadersBrightness:()=>rV,_shadersBufferPointMaterialFS:()=>zO,_shadersBufferPointMaterialVS:()=>VO,_shadersBufferPolygonMaterialFS:()=>jO,_shadersBufferPolygonMaterialVS:()=>HO,_shadersBufferPolylineMaterialFS:()=>GO,_shadersBufferPolylineMaterialVS:()=>WO,_shadersBumpMapMaterial:()=>VM,_shadersCPUStylingStageFS:()=>GF,_shadersCPUStylingStageVS:()=>HF,_shadersCheckerboardMaterial:()=>jM,_shadersCloudCollectionFS:()=>qO,_shadersCloudCollectionVS:()=>YO,_shadersCloudNoiseFS:()=>XO,_shadersCloudNoiseVS:()=>KO,_shadersCompareAndPackTranslucentDepth:()=>$O,_shadersCompositeOITFS:()=>JO,_shadersCompositeTranslucentClassification:()=>dC,_shadersComputeIrradianceFS:()=>ZO,_shadersComputeRadianceMapFS:()=>QO,_shadersConstantLodStageFS:()=>RB,_shadersConstantLodStageVS:()=>DB,_shadersContrastBias:()=>oV,_shadersConvolveSpecularMapFS:()=>eM,_shadersConvolveSpecularMapVS:()=>tM,_shadersCubeMapPanoramaVS:()=>nM,_shadersCustomShaderStageFS:()=>YF,_shadersCustomShaderStageVS:()=>qF,_shadersCzmBuiltins:()=>Ax,_shadersDepthOfField:()=>sV,_shadersDepthPlaneFS:()=>iM,_shadersDepthPlaneVS:()=>rM,_shadersDepthView:()=>aV,_shadersDepthViewPacked:()=>mle,_shadersDotMaterial:()=>HM,_shadersEdgeDetection:()=>cV,_shadersEdgeDetectionStageFS:()=>tB,_shadersEdgeVisibilityStageFS:()=>iB,_shadersEdgeVisibilityStageVS:()=>rB,_shadersElevationBandMaterial:()=>GM,_shadersElevationContourMaterial:()=>WM,_shadersElevationRampMaterial:()=>qM,_shadersEllipsoidFS:()=>wv,_shadersEllipsoidSurfaceAppearanceFS:()=>Q4,_shadersEllipsoidSurfaceAppearanceVS:()=>e8,_shadersEllipsoidVS:()=>Iv,_shadersFXAA:()=>fV,_shadersFXAA3_11:()=>oM,_shadersFadeMaterial:()=>YM,_shadersFeatureIdStageFS:()=>XF,_shadersFeatureIdStageVS:()=>KF,_shadersFilmicTonemapping:()=>lV,_shadersGaussianBlur1D:()=>Mb,_shadersGeometryStageFS:()=>sB,_shadersGeometryStageVS:()=>aB,_shadersGlobeFS:()=>sM,_shadersGlobeVS:()=>aM,_shadersGridMaterial:()=>XM,_shadersGroundAtmosphere:()=>Pv,_shadersHSBToRGB:()=>xR,_shadersHSLToRGB:()=>TR,_shadersImageBasedLightingStageFS:()=>yF,_shadersInstancingStageCommon:()=>OF,_shadersInstancingStageVS:()=>MF,_shadersIntersectBox:()=>$V,_shadersIntersectCylinder:()=>JV,_shadersIntersectDepth:()=>XV,_shadersIntersectEllipsoid:()=>ZV,_shadersIntersectLongitude:()=>SP,_shadersIntersectPlane:()=>KV,_shadersIntersection:()=>CC,_shadersIntersectionUtils:()=>YV,_shadersLegacyInstancingStageVS:()=>NF,_shadersLensFlare:()=>dV,_shadersLightingStageFS:()=>wB,_shadersMaterialStageFS:()=>PB,_shadersMegatexture:()=>i4,_shadersMetadataStageFS:()=>$F,_shadersMetadataStageVS:()=>JF,_shadersModelClippingPlanesStageFS:()=>EF,_shadersModelClippingPolygonsStageFS:()=>vF,_shadersModelClippingPolygonsStageVS:()=>SF,_shadersModelColorStageFS:()=>TF,_shadersModelFS:()=>l2,_shadersModelSilhouetteStageFS:()=>JB,_shadersModelSilhouetteStageVS:()=>ZB,_shadersModelSplitterStageFS:()=>e2,_shadersModelVS:()=>c2,_shadersModelVectorLookupStageFS:()=>PF,_shadersModelVectorLookupStageVS:()=>IF,_shadersModifiedReinhardTonemapping:()=>hV,_shadersMorphTargetsStageVS:()=>MB,_shadersNightVision:()=>mV,_shadersNormalMapMaterial:()=>KM,_shadersOctree:()=>n4,_shadersPassThrough:()=>df,_shadersPassThroughDepth:()=>Pb,_shadersPbrNeutralTonemapping:()=>uV,_shadersPerInstanceColorAppearanceFS:()=>sN,_shadersPerInstanceColorAppearanceVS:()=>aN,_shadersPerInstanceFlatColorAppearanceFS:()=>Sx,_shadersPerInstanceFlatColorAppearanceVS:()=>cN,_shadersPointCloudEyeDomeLighting:()=>JL,_shadersPointCloudStylingStageVS:()=>FB,_shadersPointPrimitiveCollectionFS:()=>Vy,_shadersPointPrimitiveCollectionVS:()=>cM,_shadersPolylineArrowMaterial:()=>$M,_shadersPolylineColorAppearanceVS:()=>AN,_shadersPolylineCommon:()=>Wl,_shadersPolylineDashMaterial:()=>JM,_shadersPolylineFS:()=>Cx,_shadersPolylineGlowMaterial:()=>ZM,_shadersPolylineMaterialAppearanceVS:()=>bN,_shadersPolylineOutlineMaterial:()=>QM,_shadersPolylineShadowVolumeFS:()=>lM,_shadersPolylineShadowVolumeMorphFS:()=>uM,_shadersPolylineShadowVolumeMorphVS:()=>fM,_shadersPolylineShadowVolumeVS:()=>dM,_shadersPolylineVS:()=>hM,_shadersPrimitiveGaussianSplatFS:()=>mM,_shadersPrimitiveGaussianSplatVS:()=>pM,_shadersPrimitiveOutlineStageFS:()=>UB,_shadersPrimitiveOutlineStageVS:()=>kB,_shadersRGBToHSB:()=>XR,_shadersRGBToHSL:()=>KR,_shadersRGBToXYZ:()=>$R,_shadersReinhardTonemapping:()=>pV,_shadersReprojectWebMercatorFS:()=>gM,_shadersReprojectWebMercatorVS:()=>_M,_shadersRimLightingMaterial:()=>eN,_shadersSelectedFeatureIdStageCommon:()=>VS,_shadersShadowVolumeAppearanceFS:()=>Dv,_shadersShadowVolumeAppearanceVS:()=>yM,_shadersShadowVolumeFS:()=>jy,_shadersSilhouette:()=>gV,_shadersSkinningStageVS:()=>HB,_shadersSkyAtmosphereCommon:()=>Rv,_shadersSkyAtmosphereFS:()=>AM,_shadersSkyAtmosphereVS:()=>bM,_shadersSkyBoxFS:()=>xM,_shadersSkyBoxVS:()=>TM,_shadersSlopeRampMaterial:()=>tN,_shadersStripeMaterial:()=>nN,_shadersSunFS:()=>EM,_shadersSunTextureFS:()=>CM,_shadersSunVS:()=>vM,_shadersTexturedMaterialAppearanceFS:()=>kM,_shadersTexturedMaterialAppearanceVS:()=>UM,_shadersVector3DTileClampedPolylinesFS:()=>SM,_shadersVector3DTileClampedPolylinesVS:()=>wM,_shadersVector3DTilePolylinesVS:()=>IM,_shadersVectorCommon:()=>pg,_shadersVectorTileVS:()=>Ov,_shadersVerticalExaggerationStageVS:()=>WB,_shadersViewportQuadFS:()=>PM,_shadersViewportQuadVS:()=>ux,_shadersVoxelFS:()=>WV,_shadersVoxelUtils:()=>GV,_shadersVoxelVS:()=>qV,_shadersWater:()=>rN,_shadersWaterMaskMaterial:()=>iN,_shadersXYZToRGB:()=>bO,_shadersacesTonemapping:()=>B1,_shadersalphaWeight:()=>k1,_shadersantialias:()=>U1,_shadersapplyHSBShift:()=>z1,_shadersapproximateSphericalCoordinates:()=>V1,_shadersapproximateTanh:()=>j1,_shadersbackFacing:()=>H1,_shadersbranchFreeTernary:()=>G1,_shaderscascadeColor:()=>W1,_shaderscascadeDistance:()=>q1,_shaderscascadeMatrix:()=>Y1,_shaderscascadeWeights:()=>X1,_shaderscolumbusViewMorph:()=>K1,_shaderscomputeAtmosphereColor:()=>$1,_shaderscomputeGroundAtmosphereScattering:()=>J1,_shaderscomputePosition:()=>Z1,_shaderscomputeScattering:()=>Q1,_shaderscomputeTextureTransform:()=>eR,_shadersconvertLocalToBoxUv:()=>QV,_shadersconvertLocalToCylinderUv:()=>e4,_shadersconvertLocalToEllipsoidUv:()=>t4,_shaderscosineAndSine:()=>tR,_shadersdecodeRGB8:()=>nR,_shadersdecompressTextureCoordinates:()=>iR,_shadersdegreesPerRadian:()=>VD,_shadersdepthClamp:()=>rR,_shadersdepthRange:()=>jD,_shadersdepthRangeStruct:()=>P1,_shaderseastNorthUpToEyeCoordinates:()=>oR,_shadersellipsoidContainsPoint:()=>sR,_shadersellipsoidTextureCoordinates:()=>aR,_shadersepsilon1:()=>HD,_shadersepsilon2:()=>GD,_shadersepsilon3:()=>WD,_shadersepsilon4:()=>qD,_shadersepsilon5:()=>YD,_shadersepsilon6:()=>XD,_shadersepsilon7:()=>KD,_shadersequalsEpsilon:()=>cR,_shaderseyeOffset:()=>lR,_shaderseyeToCartographicDelta:()=>uR,_shaderseyeToWindowCoordinates:()=>fR,_shadersfastApproximateAtan:()=>dR,_shadersfog:()=>hR,_shadersgammaCorrect:()=>mR,_shadersgeodeticSurfaceNormal:()=>pR,_shadersgetDefaultMaterial:()=>gR,_shadersgetDynamicAtmosphereLightDirection:()=>_R,_shadersgetLambertDiffuse:()=>yR,_shadersgetSpecular:()=>AR,_shadersgetWaterNoise:()=>bR,_shadershue:()=>ER,_shadersinfinity:()=>$D,_shadersinverseGamma:()=>CR,_shadersisEmpty:()=>vR,_shadersisFull:()=>SR,_shaderslatitudeToWebMercatorFraction:()=>wR,_shaderslineDistance:()=>PR,_shaderslinearToSrgb:()=>IR,_shadersluminance:()=>DR,_shadersmaterial:()=>D1,_shadersmaterialInput:()=>R1,_shadersmaximumComponent:()=>RR,_shadersmetersPerPixel:()=>OR,_shadersmodelMaterial:()=>O1,_shadersmodelToWindowCoordinates:()=>MR,_shadersmodelVertexOutput:()=>M1,_shadersmultiplyWithColorBalance:()=>NR,_shadersnearFarScalar:()=>LR,_shadersoctDecode:()=>FR,_shadersoneOverPi:()=>JD,_shadersoneOverTwoPi:()=>ZD,_shaderspackDepth:()=>BR,_shaderspassCesium3DTile:()=>QD,_shaderspassCesium3DTileClassification:()=>e1,_shaderspassCesium3DTileClassificationIgnoreShow:()=>t1,_shaderspassCesium3DTileEdges:()=>n1,_shaderspassCesium3DTileEdgesDirect:()=>i1,_shaderspassCesium3DTilePlanarFillId:()=>r1,_shaderspassClassification:()=>o1,_shaderspassCompute:()=>s1,_shaderspassEnvironment:()=>a1,_shaderspassGaussianSplats:()=>c1,_shaderspassGlobe:()=>l1,_shaderspassOpaque:()=>u1,_shaderspassOverlay:()=>f1,_shaderspassTerrainClassification:()=>d1,_shaderspassTranslucent:()=>h1,_shaderspassVoxels:()=>m1,_shaderspbrLighting:()=>kR,_shaderspbrNeutralTonemapping:()=>UR,_shadersphong:()=>zR,_shaderspi:()=>p1,_shaderspiOverFour:()=>g1,_shaderspiOverSix:()=>_1,_shaderspiOverThree:()=>y1,_shaderspiOverTwo:()=>A1,_shadersplaneDistance:()=>VR,_shaderspointAlongRay:()=>jR,_shadersradiansPerDegree:()=>b1,_shadersray:()=>N1,_shadersrayEllipsoidIntersectionInterval:()=>HR,_shadersraySegment:()=>L1,_shadersraySphereIntersectionInterval:()=>GR,_shadersreadDepth:()=>WR,_shadersreadNonPerspective:()=>qR,_shadersreverseLogDepth:()=>YR,_shadersround:()=>JR,_shaderssaturation:()=>ZR,_shaderssceneMode2D:()=>x1,_shaderssceneMode3D:()=>T1,_shaderssceneModeColumbusView:()=>E1,_shaderssceneModeMorphing:()=>C1,_shadersshadowDepthCompare:()=>QR,_shadersshadowParameters:()=>F1,_shadersshadowVisibility:()=>eO,_shaderssignNotZero:()=>tO,_shaderssolarRadius:()=>v1,_shaderssphericalHarmonics:()=>nO,_shaderssrgbToLinear:()=>iO,_shaderstangentToEyeSpaceMatrix:()=>rO,_shaderstextureCube:()=>oO,_shadersthreePiOver2:()=>S1,_shaderstransformPlane:()=>sO,_shaderstranslateRelativeToEye:()=>aO,_shaderstranslucentPhong:()=>cO,_shaderstranspose:()=>lO,_shaderstwoPi:()=>w1,_shadersunpackDepth:()=>uO,_shadersunpackFloat:()=>fO,_shadersunpackTexture:()=>dO,_shadersunpackUint:()=>hO,_shadersvalueTransform:()=>mO,_shadersvertexLogDepth:()=>pO,_shaderswebMercatorMaxLatitude:()=>I1,_shaderswindowToEyeCoordinates:()=>gO,_shaderswriteDepthClamp:()=>_O,_shaderswriteLogDepth:()=>yO,_shaderswriteNonPerspective:()=>AO,addAllToArray:()=>Zn,addBuffer:()=>fL,addDefaults:()=>rL,addExtensionsRequired:()=>cL,addExtensionsUsed:()=>Ud,addPipelineExtras:()=>aA,addToArray:()=>_a,appendForwardSlash:()=>cD,arrayRemoveDuplicates:()=>Fr,assert:()=>OX,barycentricCoordinates:()=>dx,binarySearch:()=>vr,buildModuleUrl:()=>Zt,buildVectorGltfFromMVT:()=>H4,buildVoxelCustomShader:()=>vP,buildVoxelDrawCommands:()=>o4,clone:()=>Je,combine:()=>Ot,computeFlyToLocationForRectangle:()=>QE,createBillboardPointCallback:()=>RT,createColorRamp:()=>kV,createCommand:()=>Rn,createDefaultImageryProviderViewModels:()=>R8,createDefaultTerrainProviderViewModels:()=>O8,createElevationBandMaterial:()=>bce,createGooglePhotorealistic3DTileset:()=>xce,createGuid:()=>Kn,createMaterialPropertyDescriptor:()=>ro,createOsmBuildingsAsync:()=>Tce,createPropertyDescriptor:()=>me,createRawPropertyDescriptor:()=>Kl,createTangentSpaceDebugPrimitive:()=>Ece,createTaskProcessorWorker:()=>Ile,createUniform:()=>xD,createUniformArray:()=>TD,createVectorTileBuffersFromModelComponents:()=>W2,createWorldBathymetryAsync:()=>N4,createWorldImageryAsync:()=>n_,createWorldTerrainAsync:()=>UC,decodeGoogleEarthEnterpriseData:()=>L4,decodeMVT:()=>Z4,decodeVectorPolylinePositions:()=>F2,defaultPickWorldPosition:()=>_p,defer:()=>Pu,defined:()=>l,demodernizeShader:()=>xO,deprecationWarning:()=>qr,destroyObject:()=>le,exportKml:()=>Lie,findAccessorMinMax:()=>lT,findContentMetadata:()=>jT,findGroupMetadata:()=>HT,findMeshoptExtension:()=>oA,findTileMetadata:()=>ek,forEachTextureInMaterial:()=>nS,formatError:()=>Kp,freezeRenderState:()=>TY,getAbsoluteUri:()=>vd,getAccessorByteStride:()=>ju,getBaseUri:()=>lD,getBinaryAccessor:()=>Fd,getClipAndStyleCode:()=>v4,getClippingFunction:()=>eC,getComponentReader:()=>kg,getElement:()=>Ln,getExtensionFromUri:()=>rg,getFilenameFromUri:()=>I_,getImageFromTypedArray:()=>UV,getImagePixels:()=>kh,getJsonFromTypedArray:()=>Ro,getMagic:()=>om,getMeshPrimitives:()=>KL,getMetadataClassProperty:()=>p4,getMetadataProperty:()=>_4,getStringFromTypedArray:()=>Uu,getTimestamp:()=>xn,hasExtension:()=>tr,heightReferenceOnEntityPropertyChanged:()=>Pg,isBitSet:()=>Pl,isBlobUri:()=>nx,isCrossOriginUrl:()=>Dy,isDataUri:()=>Uh,isLeapYear:()=>kl,knockout:()=>ve,knockout_3_5_1:()=>$C,knockout_es5:()=>x8,loadAndExecuteScript:()=>ix,loadCubeMap:()=>DO,loadImageFromTypedArray:()=>Bg,loadKTX2:()=>Ou,mergeSort:()=>N0,mostDetailedSurfaceHeight:()=>Kh,moveTechniqueRenderStates:()=>aL,moveTechniquesToExtension:()=>lL,numberOfComponentsForType:()=>Nf,objectToQuery:()=>rx,oneTimeWarning:()=>_t,parseBatchTable:()=>Xg,parseFeatureMetadataLegacy:()=>BL,parseGlb:()=>cT,parseResponseHeaders:()=>uD,parseStructuralMetadata:()=>FL,pickModel:()=>sw,pointInsideTriangle:()=>$ae,positionForSurfaceHeight:()=>gg,preprocess3DTileContent:()=>p_,processVoxelProperties:()=>HV,queryToObject:()=>Ef,readAccessorPacked:()=>dL,removeExtension:()=>uT,removeExtensionsRequired:()=>oL,removeExtensionsUsed:()=>aT,removePipelineExtras:()=>sL,removeUnusedElements:()=>uL,renderBufferPointCollection:()=>z2,renderBufferPolygonCollection:()=>PL,renderBufferPolylineCollection:()=>H2,resizeImageToNextPowerOfTwo:()=>uA,sampleTerrain:()=>qU,sampleTerrainMostDetailed:()=>ZE,scaleToGeodeticSurface:()=>tx,srgbToLinear:()=>jC,subdivideArray:()=>fN,subscribeAndEvaluate:()=>Cc,updateAccessorComponentTypes:()=>hL,updateVersion:()=>mL,usesExtension:()=>Go,viewerCesium3DTilesInspectorMixin:()=>Xle,viewerCesiumInspectorMixin:()=>Kle,viewerDragDropMixin:()=>Jle,viewerPerformanceWatchdogMixin:()=>Zle,viewerVoxelInspectorMixin:()=>eue,webGLConstantToGlslType:()=>oce,wrapFunction:()=>j4,writeTextToCanvas:()=>MT});module.exports=Fh(P9t);function R3e(e){return e!=null}var l=R3e;function Qb(e){this.name="DeveloperError",this.message=e;let t;try{throw new Error}catch(n){t=n.stack}this.stack=t}l(Object.create)&&(Qb.prototype=Object.create(Error.prototype),Qb.prototype.constructor=Qb);Qb.prototype.toString=function(){let e=`${this.name}: ${this.message}`;return l(this.stack)&&(e+=` -${this.stack.toString()}`),e};Qb.throwInstantiationError=function(){throw new Qb("This function defines an interface and should not be called directly.")};var pe=Qb;var ha={};ha.typeOf={};function O3e(e){return`${e} is required, actual value was undefined`}function nv(e,t,n){return`Expected ${n} to be typeof ${t}, actual typeof was ${e}`}ha.defined=function(e,t){if(!l(t))throw new pe(O3e(e))};ha.typeOf.func=function(e,t){if(typeof t!="function")throw new pe(nv(typeof t,"function",e))};ha.typeOf.string=function(e,t){if(typeof t!="string")throw new pe(nv(typeof t,"string",e))};ha.typeOf.number=function(e,t){if(typeof t!="number")throw new pe(nv(typeof t,"number",e))};ha.typeOf.number.lessThan=function(e,t,n){if(ha.typeOf.number(e,t),t>=n)throw new pe(`Expected ${e} to be less than ${n}, actual value was ${t}`)};ha.typeOf.number.lessThanOrEquals=function(e,t,n){if(ha.typeOf.number(e,t),t>n)throw new pe(`Expected ${e} to be less than or equal to ${n}, actual value was ${t}`)};ha.typeOf.number.greaterThan=function(e,t,n){if(ha.typeOf.number(e,t),t<=n)throw new pe(`Expected ${e} to be greater than ${n}, actual value was ${t}`)};ha.typeOf.number.greaterThanOrEquals=function(e,t,n){if(ha.typeOf.number(e,t),t<n)throw new pe(`Expected ${e} to be greater than or equal to ${n}, actual value was ${t}`)};ha.typeOf.object=function(e,t){if(typeof t!="object")throw new pe(nv(typeof t,"object",e))};ha.typeOf.bool=function(e,t){if(typeof t!="boolean")throw new pe(nv(typeof t,"boolean",e))};ha.typeOf.bigint=function(e,t){if(typeof t!="bigint")throw new pe(nv(typeof t,"bigint",e))};ha.typeOf.number.equals=function(e,t,n,i){if(ha.typeOf.number(e,n),ha.typeOf.number(t,i),n!==i)throw new pe(`${e} must be equal to ${t}, the actual values are ${n} and ${i}`)};var Wr=ha;var Mq=Qo(mj(),1);var yt={};yt.EPSILON1=.1;yt.EPSILON2=.01;yt.EPSILON3=.001;yt.EPSILON4=1e-4;yt.EPSILON5=1e-5;yt.EPSILON6=1e-6;yt.EPSILON7=1e-7;yt.EPSILON8=1e-8;yt.EPSILON9=1e-9;yt.EPSILON10=1e-10;yt.EPSILON11=1e-11;yt.EPSILON12=1e-12;yt.EPSILON13=1e-13;yt.EPSILON14=1e-14;yt.EPSILON15=1e-15;yt.EPSILON16=1e-16;yt.EPSILON17=1e-17;yt.EPSILON18=1e-18;yt.EPSILON19=1e-19;yt.EPSILON20=1e-20;yt.EPSILON21=1e-21;yt.GRAVITATIONALPARAMETER=3986004418e5;yt.SOLAR_RADIUS=6955e5;yt.LUNAR_RADIUS=1737400;yt.SIXTY_FOUR_KILOBYTES=64*1024;yt.FOUR_GIGABYTES=4*1024*1024*1024;yt.sign=Math.sign??function(t){return t=+t,t===0||t!==t?t:t>0?1:-1};yt.signNotZero=function(e){return e<0?-1:1};yt.toSNorm=function(e,t){return t=t??255,Math.round((yt.clamp(e,-1,1)*.5+.5)*t)};yt.fromSNorm=function(e,t){return t=t??255,yt.clamp(e,0,t)/t*2-1};yt.normalize=function(e,t,n){return n=Math.max(n-t,0),n===0?0:yt.clamp((e-t)/n,0,1)};yt.sinh=Math.sinh??function(t){return(Math.exp(t)-Math.exp(-t))/2};yt.cosh=Math.cosh??function(t){return(Math.exp(t)+Math.exp(-t))/2};yt.lerp=function(e,t,n){return(1-n)*e+n*t};yt.smoothDamp=function(e,t,n,i=0,r=Number.POSITIVE_INFINITY,o=1e-4,s={}){o=Math.max(1e-4,o);let a=2/o,c=a*i,u=1/(1+c+.48*c*c+.235*c*c*c),f=r*o,d=e-t;d=yt.clamp(d,-f,f);let p=e-d,g=(n+a*d)*i;return n=(n-a*g)*u,s.value=p+(d+g)*u,s.velocity=n,s};yt.PI=Math.PI;yt.ONE_OVER_PI=1/Math.PI;yt.PI_OVER_TWO=Math.PI/2;yt.PI_OVER_THREE=Math.PI/3;yt.PI_OVER_FOUR=Math.PI/4;yt.PI_OVER_SIX=Math.PI/6;yt.THREE_PI_OVER_TWO=3*Math.PI/2;yt.TWO_PI=2*Math.PI;yt.ONE_OVER_TWO_PI=1/(2*Math.PI);yt.RADIANS_PER_DEGREE=Math.PI/180;yt.DEGREES_PER_RADIAN=180/Math.PI;yt.RADIANS_PER_ARCSECOND=yt.RADIANS_PER_DEGREE/3600;yt.toRadians=function(e){return e*yt.RADIANS_PER_DEGREE};yt.toDegrees=function(e){return e*yt.DEGREES_PER_RADIAN};yt.convertLongitudeRange=function(e){let t=yt.TWO_PI,n=e-Math.floor(e/t)*t;return n<-Math.PI?n+t:n>=Math.PI?n-t:n};yt.clampToLatitudeRange=function(e){return yt.clamp(e,-1*yt.PI_OVER_TWO,yt.PI_OVER_TWO)};yt.negativePiToPi=function(e){return e>=-yt.PI&&e<=yt.PI?e:yt.zeroToTwoPi(e+yt.PI)-yt.PI};yt.zeroToTwoPi=function(e){if(e>=0&&e<=yt.TWO_PI)return e;let t=yt.mod(e,yt.TWO_PI);return Math.abs(t)<yt.EPSILON14&&Math.abs(e)>yt.EPSILON14?yt.TWO_PI:t};yt.mod=function(e,t){return yt.sign(e)===yt.sign(t)&&Math.abs(e)<Math.abs(t)?e:(e%t+t)%t};yt.equalsEpsilon=function(e,t,n,i){n=n??0,i=i??n;let r=Math.abs(e-t);return r<=i||r<=n*Math.max(Math.abs(e),Math.abs(t))};yt.lessThan=function(e,t,n){return e-t<-n};yt.lessThanOrEquals=function(e,t,n){return e-t<n};yt.greaterThan=function(e,t,n){return e-t>n};yt.greaterThanOrEquals=function(e,t,n){return e-t>-n};var pj=[1];yt.factorial=function(e){let t=pj.length;if(e>=t){let n=pj[t-1];for(let i=t;i<=e;i++){let r=n*i;pj.push(r),n=r}}return pj[e]};yt.incrementWrap=function(e,t,n){return n=n??0,++e,e>t&&(e=n),e};yt.isPowerOfTwo=function(e){return e!==0&&(e&e-1)===0};yt.nextPowerOfTwo=function(e){return--e,e|=e>>1,e|=e>>2,e|=e>>4,e|=e>>8,e|=e>>16,++e,e};yt.previousPowerOfTwo=function(e){return e|=e>>1,e|=e>>2,e|=e>>4,e|=e>>8,e|=e>>16,e|=e>>32,e=(e>>>0)-(e>>>1),e};yt.clamp=function(e,t,n){return e<t?t:e>n?n:e};var iue=new Mq.default;yt.setRandomNumberSeed=function(e){iue=new Mq.default(e)};yt.nextRandomNumber=function(){return iue.random()};yt.randomBetween=function(e,t){return yt.nextRandomNumber()*(t-e)+e};yt.acosClamped=function(e){return Math.acos(yt.clamp(e,-1,1))};yt.asinClamped=function(e){return Math.asin(yt.clamp(e,-1,1))};yt.chordLength=function(e,t){return 2*t*Math.sin(e*.5)};yt.logBase=function(e,t){return Math.log(e)/Math.log(t)};yt.cbrt=Math.cbrt??function(t){let n=Math.pow(Math.abs(t),.3333333333333333);return t<0?-n:n};yt.log2=Math.log2??function(t){return Math.log(t)*Math.LOG2E};yt.fog=function(e,t){let n=e*t;return 1-Math.exp(-(n*n))};yt.fastApproximateAtan=function(e){return e*(-.1784*Math.abs(e)-.0663*e*e+1.0301)};yt.fastApproximateAtan2=function(e,t){let n,i=Math.abs(e);n=Math.abs(t);let r=Math.max(i,n);n=Math.min(i,n);let o=n/r;return i=yt.fastApproximateAtan(o),i=Math.abs(t)>Math.abs(e)?yt.PI_OVER_TWO-i:i,i=e<0?yt.PI-i:i,i=t<0?-i:i,i};var D=yt;var po=class e{constructor(t,n,i){this.x=t??0,this.y=n??0,this.z=i??0}static fromSpherical(t,n){l(n)||(n=new e);let i=t.clock,r=t.cone,o=t.magnitude??1,s=o*Math.sin(r);return n.x=s*Math.cos(i),n.y=s*Math.sin(i),n.z=o*Math.cos(r),n}static fromElements(t,n,i,r){return l(r)?(r.x=t,r.y=n,r.z=i,r):new e(t,n,i)}static clone(t,n){if(l(t))return l(n)?(n.x=t.x,n.y=t.y,n.z=t.z,n):new e(t.x,t.y,t.z)}static pack(t,n,i){return i=i??0,n[i++]=t.x,n[i++]=t.y,n[i]=t.z,n}static unpack(t,n,i){return n=n??0,l(i)||(i=new e),i.x=t[n++],i.y=t[n++],i.z=t[n],i}static packArray(t,n){let i=t.length,r=i*3;l(n)?!Array.isArray(n)&&n.length!==r||n.length!==r&&(n.length=r):n=new Array(r);for(let o=0;o<i;++o)e.pack(t[o],n,o*3);return n}static unpackArray(t,n){let i=t.length;l(n)?n.length=i/3:n=new Array(i/3);for(let r=0;r<i;r+=3){let o=r/3;n[o]=e.unpack(t,r,n[o])}return n}static maximumComponent(t){return Math.max(t.x,t.y,t.z)}static minimumComponent(t){return Math.min(t.x,t.y,t.z)}static minimumByComponent(t,n,i){return i.x=Math.min(t.x,n.x),i.y=Math.min(t.y,n.y),i.z=Math.min(t.z,n.z),i}static maximumByComponent(t,n,i){return i.x=Math.max(t.x,n.x),i.y=Math.max(t.y,n.y),i.z=Math.max(t.z,n.z),i}static clamp(t,n,i,r){let o=D.clamp(t.x,n.x,i.x),s=D.clamp(t.y,n.y,i.y),a=D.clamp(t.z,n.z,i.z);return r.x=o,r.y=s,r.z=a,r}static magnitudeSquared(t){return t.x*t.x+t.y*t.y+t.z*t.z}static magnitude(t){return Math.sqrt(e.magnitudeSquared(t))}static distance(t,n){return e.subtract(t,n,gj),e.magnitude(gj)}static distanceSquared(t,n){return e.subtract(t,n,gj),e.magnitudeSquared(gj)}static normalize(t,n){let i=e.magnitude(t);return n.x=t.x/i,n.y=t.y/i,n.z=t.z/i,n}static dot(t,n){return t.x*n.x+t.y*n.y+t.z*n.z}static multiplyComponents(t,n,i){return i.x=t.x*n.x,i.y=t.y*n.y,i.z=t.z*n.z,i}static divideComponents(t,n,i){return i.x=t.x/n.x,i.y=t.y/n.y,i.z=t.z/n.z,i}static add(t,n,i){return i.x=t.x+n.x,i.y=t.y+n.y,i.z=t.z+n.z,i}static subtract(t,n,i){return i.x=t.x-n.x,i.y=t.y-n.y,i.z=t.z-n.z,i}static multiplyByScalar(t,n,i){return i.x=t.x*n,i.y=t.y*n,i.z=t.z*n,i}static divideByScalar(t,n,i){return i.x=t.x/n,i.y=t.y/n,i.z=t.z/n,i}static negate(t,n){return n.x=-t.x,n.y=-t.y,n.z=-t.z,n}static abs(t,n){return n.x=Math.abs(t.x),n.y=Math.abs(t.y),n.z=Math.abs(t.z),n}static lerp(t,n,i,r){return e.multiplyByScalar(n,i,rue),r=e.multiplyByScalar(t,1-i,r),e.add(rue,r,r)}static angleBetween(t,n){e.normalize(t,_j),e.normalize(n,Nq);let i=e.dot(_j,Nq),r=e.magnitude(e.cross(_j,Nq,_j));return Math.atan2(r,i)}static mostOrthogonalAxis(t,n){let i=e.normalize(t,M3e);return e.abs(i,i),i.x<=i.y?i.x<=i.z?n=e.clone(e.UNIT_X,n):n=e.clone(e.UNIT_Z,n):i.y<=i.z?n=e.clone(e.UNIT_Y,n):n=e.clone(e.UNIT_Z,n),n}static projectVector(t,n,i){let r=e.dot(t,n)/e.dot(n,n);return e.multiplyByScalar(n,r,i)}static equals(t,n){return t===n||l(t)&&l(n)&&t.x===n.x&&t.y===n.y&&t.z===n.z}static equalsArray(t,n,i){return t.x===n[i]&&t.y===n[i+1]&&t.z===n[i+2]}static equalsEpsilon(t,n,i,r){return t===n||l(t)&&l(n)&&D.equalsEpsilon(t.x,n.x,i,r)&&D.equalsEpsilon(t.y,n.y,i,r)&&D.equalsEpsilon(t.z,n.z,i,r)}static cross(t,n,i){let r=t.x,o=t.y,s=t.z,a=n.x,c=n.y,u=n.z,f=o*u-s*c,d=s*a-r*u,p=r*c-o*a;return i.x=f,i.y=d,i.z=p,i}static midpoint(t,n,i){return i.x=(t.x+n.x)*.5,i.y=(t.y+n.y)*.5,i.z=(t.z+n.z)*.5,i}static fromDegrees(t,n,i,r,o){return t=D.toRadians(t),n=D.toRadians(n),e.fromRadians(t,n,i,r,o)}static fromRadians(t,n,i,r,o){i=i??0;let s=l(r)?r.radiiSquared:e._ellipsoidRadiiSquared,a=Math.cos(n);Td.x=a*Math.cos(t),Td.y=a*Math.sin(t),Td.z=Math.sin(n),Td=e.normalize(Td,Td),e.multiplyComponents(s,Td,iv);let c=Math.sqrt(e.dot(Td,iv));return iv=e.divideByScalar(iv,c,iv),Td=e.multiplyByScalar(Td,i,Td),l(o)||(o=new e),e.add(iv,Td,o)}static fromDegreesArray(t,n,i){let r=t.length;l(i)?i.length=r/2:i=new Array(r/2);for(let o=0;o<r;o+=2){let s=t[o],a=t[o+1],c=o/2;i[c]=e.fromDegrees(s,a,0,n,i[c])}return i}static fromRadiansArray(t,n,i){let r=t.length;l(i)?i.length=r/2:i=new Array(r/2);for(let o=0;o<r;o+=2){let s=t[o],a=t[o+1],c=o/2;i[c]=e.fromRadians(s,a,0,n,i[c])}return i}static fromDegreesArrayHeights(t,n,i){let r=t.length;l(i)?i.length=r/3:i=new Array(r/3);for(let o=0;o<r;o+=3){let s=t[o],a=t[o+1],c=t[o+2],u=o/3;i[u]=e.fromDegrees(s,a,c,n,i[u])}return i}static fromRadiansArrayHeights(t,n,i){let r=t.length;l(i)?i.length=r/3:i=new Array(r/3);for(let o=0;o<r;o+=3){let s=t[o],a=t[o+1],c=t[o+2],u=o/3;i[u]=e.fromRadians(s,a,c,n,i[u])}return i}clone(t){return e.clone(this,t)}equals(t){return e.equals(this,t)}equalsEpsilon(t,n,i){return e.equalsEpsilon(this,t,n,i)}toString(){return`(${this.x}, ${this.y}, ${this.z})`}};po.fromCartesian4=po.clone;po.packedLength=3;po.fromArray=po.unpack;var gj=new po,rue=new po,_j=new po,Nq=new po,M3e=new po,Td=new po,iv=new po;po._ellipsoidRadiiSquared=new po(6378137*6378137,6378137*6378137,6356752314245179e-9*6356752314245179e-9);po.ZERO=Object.freeze(new po(0,0,0));po.ONE=Object.freeze(new po(1,1,1));po.UNIT_X=Object.freeze(new po(1,0,0));po.UNIT_Y=Object.freeze(new po(0,1,0));po.UNIT_Z=Object.freeze(new po(0,0,1));var h=po;var Js=class e{constructor(t,n,i,r){this.x=t??0,this.y=n??0,this.z=i??0,this.w=r??0}static fromElements(t,n,i,r,o){return l(o)?(o.x=t,o.y=n,o.z=i,o.w=r,o):new e(t,n,i,r)}static fromColor(t,n){return l(n)?(n.x=t.red,n.y=t.green,n.z=t.blue,n.w=t.alpha,n):new e(t.red,t.green,t.blue,t.alpha)}static clone(t,n){if(l(t))return l(n)?(n.x=t.x,n.y=t.y,n.z=t.z,n.w=t.w,n):new e(t.x,t.y,t.z,t.w)}static pack(t,n,i){return i=i??0,n[i++]=t.x,n[i++]=t.y,n[i++]=t.z,n[i]=t.w,n}static unpack(t,n,i){return n=n??0,l(i)||(i=new e),i.x=t[n++],i.y=t[n++],i.z=t[n++],i.w=t[n],i}static packArray(t,n){let i=t.length,r=i*4;l(n)?!Array.isArray(n)&&n.length!==r||n.length!==r&&(n.length=r):n=new Array(r);for(let o=0;o<i;++o)e.pack(t[o],n,o*4);return n}static unpackArray(t,n){let i=t.length;l(n)?n.length=i/4:n=new Array(i/4);for(let r=0;r<i;r+=4){let o=r/4;n[o]=e.unpack(t,r,n[o])}return n}static maximumComponent(t){return Math.max(t.x,t.y,t.z,t.w)}static minimumComponent(t){return Math.min(t.x,t.y,t.z,t.w)}static minimumByComponent(t,n,i){return i.x=Math.min(t.x,n.x),i.y=Math.min(t.y,n.y),i.z=Math.min(t.z,n.z),i.w=Math.min(t.w,n.w),i}static maximumByComponent(t,n,i){return i.x=Math.max(t.x,n.x),i.y=Math.max(t.y,n.y),i.z=Math.max(t.z,n.z),i.w=Math.max(t.w,n.w),i}static clamp(t,n,i,r){let o=D.clamp(t.x,n.x,i.x),s=D.clamp(t.y,n.y,i.y),a=D.clamp(t.z,n.z,i.z),c=D.clamp(t.w,n.w,i.w);return r.x=o,r.y=s,r.z=a,r.w=c,r}static magnitudeSquared(t){return t.x*t.x+t.y*t.y+t.z*t.z+t.w*t.w}static magnitude(t){return Math.sqrt(e.magnitudeSquared(t))}static distance(t,n){return e.subtract(t,n,yj),e.magnitude(yj)}static distanceSquared(t,n){return e.subtract(t,n,yj),e.magnitudeSquared(yj)}static normalize(t,n){let i=e.magnitude(t);return n.x=t.x/i,n.y=t.y/i,n.z=t.z/i,n.w=t.w/i,n}static dot(t,n){return t.x*n.x+t.y*n.y+t.z*n.z+t.w*n.w}static multiplyComponents(t,n,i){return i.x=t.x*n.x,i.y=t.y*n.y,i.z=t.z*n.z,i.w=t.w*n.w,i}static divideComponents(t,n,i){return i.x=t.x/n.x,i.y=t.y/n.y,i.z=t.z/n.z,i.w=t.w/n.w,i}static add(t,n,i){return i.x=t.x+n.x,i.y=t.y+n.y,i.z=t.z+n.z,i.w=t.w+n.w,i}static subtract(t,n,i){return i.x=t.x-n.x,i.y=t.y-n.y,i.z=t.z-n.z,i.w=t.w-n.w,i}static multiplyByScalar(t,n,i){return i.x=t.x*n,i.y=t.y*n,i.z=t.z*n,i.w=t.w*n,i}static divideByScalar(t,n,i){return i.x=t.x/n,i.y=t.y/n,i.z=t.z/n,i.w=t.w/n,i}static negate(t,n){return n.x=-t.x,n.y=-t.y,n.z=-t.z,n.w=-t.w,n}static abs(t,n){return n.x=Math.abs(t.x),n.y=Math.abs(t.y),n.z=Math.abs(t.z),n.w=Math.abs(t.w),n}static lerp(t,n,i,r){return e.multiplyByScalar(n,i,oue),r=e.multiplyByScalar(t,1-i,r),e.add(oue,r,r)}static mostOrthogonalAxis(t,n){let i=e.normalize(t,N3e);return e.abs(i,i),i.x<=i.y?i.x<=i.z?i.x<=i.w?n=e.clone(e.UNIT_X,n):n=e.clone(e.UNIT_W,n):i.z<=i.w?n=e.clone(e.UNIT_Z,n):n=e.clone(e.UNIT_W,n):i.y<=i.z?i.y<=i.w?n=e.clone(e.UNIT_Y,n):n=e.clone(e.UNIT_W,n):i.z<=i.w?n=e.clone(e.UNIT_Z,n):n=e.clone(e.UNIT_W,n),n}static equals(t,n){return t===n||l(t)&&l(n)&&t.x===n.x&&t.y===n.y&&t.z===n.z&&t.w===n.w}static equalsArray(t,n,i){return t.x===n[i]&&t.y===n[i+1]&&t.z===n[i+2]&&t.w===n[i+3]}static equalsEpsilon(t,n,i,r){return t===n||l(t)&&l(n)&&D.equalsEpsilon(t.x,n.x,i,r)&&D.equalsEpsilon(t.y,n.y,i,r)&&D.equalsEpsilon(t.z,n.z,i,r)&&D.equalsEpsilon(t.w,n.w,i,r)}clone(t){return e.clone(this,t)}equals(t){return e.equals(this,t)}equalsEpsilon(t,n,i){return e.equalsEpsilon(this,t,n,i)}toString(){return`(${this.x}, ${this.y}, ${this.z}, ${this.w})`}static packFloat(t,n){return l(n)||(n=new e),Lq[0]=t,sue?(n.x=qc[0],n.y=qc[1],n.z=qc[2],n.w=qc[3]):(n.x=qc[3],n.y=qc[2],n.z=qc[1],n.w=qc[0]),n}static unpackFloat(t){return sue?(qc[0]=t.x,qc[1]=t.y,qc[2]=t.z,qc[3]=t.w):(qc[0]=t.w,qc[1]=t.z,qc[2]=t.y,qc[3]=t.x),Lq[0]}};Js.packedLength=4;Js.fromArray=Js.unpack;var yj=new Js,oue=new Js,N3e=new Js;Js.ZERO=Object.freeze(new Js(0,0,0,0));Js.ONE=Object.freeze(new Js(1,1,1,1));Js.UNIT_X=Object.freeze(new Js(1,0,0,0));Js.UNIT_Y=Object.freeze(new Js(0,1,0,0));Js.UNIT_Z=Object.freeze(new Js(0,0,1,0));Js.UNIT_W=Object.freeze(new Js(0,0,0,1));var Lq=new Float32Array(1),qc=new Uint8Array(Lq.buffer),L3e=new Uint32Array([287454020]),F3e=new Uint8Array(L3e.buffer),sue=F3e[0]===68,se=Js;var Fq={};Fq.EMPTY_OBJECT=Object.freeze({});Fq.EMPTY_ARRAY=Object.freeze([]);var H=Fq;var B3e=Object.freeze([NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN]),br=class e{constructor(t,n,i,r,o,s,a,c,u){let f=Reflect.construct(Array,B3e,new.target);return f[0]=t??0,f[1]=r??0,f[2]=a??0,f[3]=n??0,f[4]=o??0,f[5]=c??0,f[6]=i??0,f[7]=s??0,f[8]=u??0,f}static pack(t,n,i){return i=i??0,n[i++]=t[0],n[i++]=t[1],n[i++]=t[2],n[i++]=t[3],n[i++]=t[4],n[i++]=t[5],n[i++]=t[6],n[i++]=t[7],n[i]=t[8],n}static unpack(t,n,i){return n=n??0,l(i)||(i=new e),i[0]=t[n++],i[1]=t[n++],i[2]=t[n++],i[3]=t[n++],i[4]=t[n++],i[5]=t[n++],i[6]=t[n++],i[7]=t[n++],i[8]=t[n],i}static packArray(t,n){let i=t.length,r=i*9;l(n)?!Array.isArray(n)&&n.length!==r||n.length!==r&&(n.length=r):n=new Array(r);for(let o=0;o<i;++o)e.pack(t[o],n,o*9);return n}static unpackArray(t,n){let i=t.length;l(n)?n.length=i/9:n=new Array(i/9);for(let r=0;r<i;r+=9){let o=r/9;n[o]=e.unpack(t,r,n[o])}return n}static clone(t,n){if(l(t))return l(n)?(n[0]=t[0],n[1]=t[1],n[2]=t[2],n[3]=t[3],n[4]=t[4],n[5]=t[5],n[6]=t[6],n[7]=t[7],n[8]=t[8],n):new e(t[0],t[3],t[6],t[1],t[4],t[7],t[2],t[5],t[8])}static fromColumnMajorArray(t,n){return e.clone(t,n)}static fromRowMajorArray(t,n){return l(n)?(n[0]=t[0],n[1]=t[3],n[2]=t[6],n[3]=t[1],n[4]=t[4],n[5]=t[7],n[6]=t[2],n[7]=t[5],n[8]=t[8],n):new e(t[0],t[1],t[2],t[3],t[4],t[5],t[6],t[7],t[8])}static fromQuaternion(t,n){let i=t.x*t.x,r=t.x*t.y,o=t.x*t.z,s=t.x*t.w,a=t.y*t.y,c=t.y*t.z,u=t.y*t.w,f=t.z*t.z,d=t.z*t.w,p=t.w*t.w,g=i-a-f+p,m=2*(r-d),y=2*(o+u),A=2*(r+d),b=-i+a-f+p,x=2*(c-s),T=2*(o-u),E=2*(c+s),v=-i-a+f+p;return l(n)?(n[0]=g,n[1]=A,n[2]=T,n[3]=m,n[4]=b,n[5]=E,n[6]=y,n[7]=x,n[8]=v,n):new e(g,m,y,A,b,x,T,E,v)}static fromHeadingPitchRoll(t,n){let i=Math.cos(-t.pitch),r=Math.cos(-t.heading),o=Math.cos(t.roll),s=Math.sin(-t.pitch),a=Math.sin(-t.heading),c=Math.sin(t.roll),u=i*r,f=-o*a+c*s*r,d=c*a+o*s*r,p=i*a,g=o*r+c*s*a,m=-c*r+o*s*a,y=-s,A=c*i,b=o*i;return l(n)?(n[0]=u,n[1]=p,n[2]=y,n[3]=f,n[4]=g,n[5]=A,n[6]=d,n[7]=m,n[8]=b,n):new e(u,f,d,p,g,m,y,A,b)}static fromScale(t,n){return l(n)?(n[0]=t.x,n[1]=0,n[2]=0,n[3]=0,n[4]=t.y,n[5]=0,n[6]=0,n[7]=0,n[8]=t.z,n):new e(t.x,0,0,0,t.y,0,0,0,t.z)}static fromUniformScale(t,n){return l(n)?(n[0]=t,n[1]=0,n[2]=0,n[3]=0,n[4]=t,n[5]=0,n[6]=0,n[7]=0,n[8]=t,n):new e(t,0,0,0,t,0,0,0,t)}static fromCrossProduct(t,n){return l(n)?(n[0]=0,n[1]=t.z,n[2]=-t.y,n[3]=-t.z,n[4]=0,n[5]=t.x,n[6]=t.y,n[7]=-t.x,n[8]=0,n):new e(0,-t.z,t.y,t.z,0,-t.x,-t.y,t.x,0)}static fromRotationX(t,n){let i=Math.cos(t),r=Math.sin(t);return l(n)?(n[0]=1,n[1]=0,n[2]=0,n[3]=0,n[4]=i,n[5]=r,n[6]=0,n[7]=-r,n[8]=i,n):new e(1,0,0,0,i,-r,0,r,i)}static fromRotationY(t,n){let i=Math.cos(t),r=Math.sin(t);return l(n)?(n[0]=i,n[1]=0,n[2]=-r,n[3]=0,n[4]=1,n[5]=0,n[6]=r,n[7]=0,n[8]=i,n):new e(i,0,r,0,1,0,-r,0,i)}static fromRotationZ(t,n){let i=Math.cos(t),r=Math.sin(t);return l(n)?(n[0]=i,n[1]=r,n[2]=0,n[3]=-r,n[4]=i,n[5]=0,n[6]=0,n[7]=0,n[8]=1,n):new e(i,-r,0,r,i,0,0,0,1)}static toArray(t,n){return l(n)?(n[0]=t[0],n[1]=t[1],n[2]=t[2],n[3]=t[3],n[4]=t[4],n[5]=t[5],n[6]=t[6],n[7]=t[7],n[8]=t[8],n):[t[0],t[1],t[2],t[3],t[4],t[5],t[6],t[7],t[8]]}static getElementIndex(t,n){return t*3+n}static getColumn(t,n,i){let r=n*3,o=t[r],s=t[r+1],a=t[r+2];return i.x=o,i.y=s,i.z=a,i}static setColumn(t,n,i,r){r=e.clone(t,r);let o=n*3;return r[o]=i.x,r[o+1]=i.y,r[o+2]=i.z,r}static getRow(t,n,i){let r=t[n],o=t[n+3],s=t[n+6];return i.x=r,i.y=o,i.z=s,i}static setRow(t,n,i,r){return r=e.clone(t,r),r[n]=i.x,r[n+3]=i.y,r[n+6]=i.z,r}static setScale(t,n,i){let r=e.getScale(t,k3e),o=n.x/r.x,s=n.y/r.y,a=n.z/r.z;return i[0]=t[0]*o,i[1]=t[1]*o,i[2]=t[2]*o,i[3]=t[3]*s,i[4]=t[4]*s,i[5]=t[5]*s,i[6]=t[6]*a,i[7]=t[7]*a,i[8]=t[8]*a,i}static setUniformScale(t,n,i){let r=e.getScale(t,U3e),o=n/r.x,s=n/r.y,a=n/r.z;return i[0]=t[0]*o,i[1]=t[1]*o,i[2]=t[2]*o,i[3]=t[3]*s,i[4]=t[4]*s,i[5]=t[5]*s,i[6]=t[6]*a,i[7]=t[7]*a,i[8]=t[8]*a,i}static getScale(t,n){return n.x=h.magnitude(h.fromElements(t[0],t[1],t[2],Bq)),n.y=h.magnitude(h.fromElements(t[3],t[4],t[5],Bq)),n.z=h.magnitude(h.fromElements(t[6],t[7],t[8],Bq)),n}static getMaximumScale(t){return e.getScale(t,aue),h.maximumComponent(aue)}static setRotation(t,n,i){let r=e.getScale(t,z3e);return i[0]=n[0]*r.x,i[1]=n[1]*r.x,i[2]=n[2]*r.x,i[3]=n[3]*r.y,i[4]=n[4]*r.y,i[5]=n[5]*r.y,i[6]=n[6]*r.z,i[7]=n[7]*r.z,i[8]=n[8]*r.z,i}static getRotation(t,n){let i=e.getScale(t,V3e);return n[0]=t[0]/i.x,n[1]=t[1]/i.x,n[2]=t[2]/i.x,n[3]=t[3]/i.y,n[4]=t[4]/i.y,n[5]=t[5]/i.y,n[6]=t[6]/i.z,n[7]=t[7]/i.z,n[8]=t[8]/i.z,n}static multiply(t,n,i){let r=t[0]*n[0]+t[3]*n[1]+t[6]*n[2],o=t[1]*n[0]+t[4]*n[1]+t[7]*n[2],s=t[2]*n[0]+t[5]*n[1]+t[8]*n[2],a=t[0]*n[3]+t[3]*n[4]+t[6]*n[5],c=t[1]*n[3]+t[4]*n[4]+t[7]*n[5],u=t[2]*n[3]+t[5]*n[4]+t[8]*n[5],f=t[0]*n[6]+t[3]*n[7]+t[6]*n[8],d=t[1]*n[6]+t[4]*n[7]+t[7]*n[8],p=t[2]*n[6]+t[5]*n[7]+t[8]*n[8];return i[0]=r,i[1]=o,i[2]=s,i[3]=a,i[4]=c,i[5]=u,i[6]=f,i[7]=d,i[8]=p,i}static add(t,n,i){return i[0]=t[0]+n[0],i[1]=t[1]+n[1],i[2]=t[2]+n[2],i[3]=t[3]+n[3],i[4]=t[4]+n[4],i[5]=t[5]+n[5],i[6]=t[6]+n[6],i[7]=t[7]+n[7],i[8]=t[8]+n[8],i}static subtract(t,n,i){return i[0]=t[0]-n[0],i[1]=t[1]-n[1],i[2]=t[2]-n[2],i[3]=t[3]-n[3],i[4]=t[4]-n[4],i[5]=t[5]-n[5],i[6]=t[6]-n[6],i[7]=t[7]-n[7],i[8]=t[8]-n[8],i}static multiplyByVector(t,n,i){let r=n.x,o=n.y,s=n.z,a=t[0]*r+t[3]*o+t[6]*s,c=t[1]*r+t[4]*o+t[7]*s,u=t[2]*r+t[5]*o+t[8]*s;return i.x=a,i.y=c,i.z=u,i}static multiplyByScalar(t,n,i){return i[0]=t[0]*n,i[1]=t[1]*n,i[2]=t[2]*n,i[3]=t[3]*n,i[4]=t[4]*n,i[5]=t[5]*n,i[6]=t[6]*n,i[7]=t[7]*n,i[8]=t[8]*n,i}static multiplyByScale(t,n,i){return i[0]=t[0]*n.x,i[1]=t[1]*n.x,i[2]=t[2]*n.x,i[3]=t[3]*n.y,i[4]=t[4]*n.y,i[5]=t[5]*n.y,i[6]=t[6]*n.z,i[7]=t[7]*n.z,i[8]=t[8]*n.z,i}static multiplyByUniformScale(t,n,i){return i[0]=t[0]*n,i[1]=t[1]*n,i[2]=t[2]*n,i[3]=t[3]*n,i[4]=t[4]*n,i[5]=t[5]*n,i[6]=t[6]*n,i[7]=t[7]*n,i[8]=t[8]*n,i}static negate(t,n){return n[0]=-t[0],n[1]=-t[1],n[2]=-t[2],n[3]=-t[3],n[4]=-t[4],n[5]=-t[5],n[6]=-t[6],n[7]=-t[7],n[8]=-t[8],n}static transpose(t,n){let i=t[0],r=t[3],o=t[6],s=t[1],a=t[4],c=t[7],u=t[2],f=t[5],d=t[8];return n[0]=i,n[1]=r,n[2]=o,n[3]=s,n[4]=a,n[5]=c,n[6]=u,n[7]=f,n[8]=d,n}static computeEigenDecomposition(t,n){let i=D.EPSILON20,r=10,o=0,s=0;l(n)||(n={});let a=n.unitary=e.clone(e.IDENTITY,n.unitary),c=n.diagonal=e.clone(t,n.diagonal),u=i*H3e(c);for(;s<r&&G3e(c)>u;)W3e(c,Aj),e.transpose(Aj,cue),e.multiply(c,Aj,c),e.multiply(cue,c,c),e.multiply(a,Aj,a),++o>2&&(++s,o=0);return n}static abs(t,n){return n[0]=Math.abs(t[0]),n[1]=Math.abs(t[1]),n[2]=Math.abs(t[2]),n[3]=Math.abs(t[3]),n[4]=Math.abs(t[4]),n[5]=Math.abs(t[5]),n[6]=Math.abs(t[6]),n[7]=Math.abs(t[7]),n[8]=Math.abs(t[8]),n}static determinant(t){let n=t[0],i=t[3],r=t[6],o=t[1],s=t[4],a=t[7],c=t[2],u=t[5],f=t[8];return n*(s*f-u*a)+o*(u*r-i*f)+c*(i*a-s*r)}static inverse(t,n){let i=t[0],r=t[1],o=t[2],s=t[3],a=t[4],c=t[5],u=t[6],f=t[7],d=t[8],p=e.determinant(t);n[0]=a*d-f*c,n[1]=f*o-r*d,n[2]=r*c-a*o,n[3]=u*c-s*d,n[4]=i*d-u*o,n[5]=s*o-i*c,n[6]=s*f-u*a,n[7]=u*r-i*f,n[8]=i*a-s*r;let g=1/p;return e.multiplyByScalar(n,g,n)}static inverseTranspose(t,n){return e.inverse(e.transpose(t,j3e),n)}static equals(t,n){return t===n||l(t)&&l(n)&&t[0]===n[0]&&t[1]===n[1]&&t[2]===n[2]&&t[3]===n[3]&&t[4]===n[4]&&t[5]===n[5]&&t[6]===n[6]&&t[7]===n[7]&&t[8]===n[8]}static equalsEpsilon(t,n,i){return i=i??0,t===n||l(t)&&l(n)&&Math.abs(t[0]-n[0])<=i&&Math.abs(t[1]-n[1])<=i&&Math.abs(t[2]-n[2])<=i&&Math.abs(t[3]-n[3])<=i&&Math.abs(t[4]-n[4])<=i&&Math.abs(t[5]-n[5])<=i&&Math.abs(t[6]-n[6])<=i&&Math.abs(t[7]-n[7])<=i&&Math.abs(t[8]-n[8])<=i}get length(){return e.packedLength}clone(t){return e.clone(this,t)}equals(t){return e.equals(this,t)}static equalsArray(t,n,i){return t[0]===n[i]&&t[1]===n[i+1]&&t[2]===n[i+2]&&t[3]===n[i+3]&&t[4]===n[i+4]&&t[5]===n[i+5]&&t[6]===n[i+6]&&t[7]===n[i+7]&&t[8]===n[i+8]}equalsEpsilon(t,n){return e.equalsEpsilon(this,t,n)}toString(){return`(${this[0]}, ${this[3]}, ${this[6]}) + `),window.clearInterval(this.noSleepTimer),this.noSleepTimer=null):this.noSleepVideo.pause(),this.enabled=!1}},{key:"isEnabled",get:function(){return this.enabled}}]),f})();e.exports=u},function(e,t,n){"use strict";e.exports={webm:"data:video/webm;base64,GkXfowEAAAAAAAAfQoaBAUL3gQFC8oEEQvOBCEKChHdlYm1Ch4EEQoWBAhhTgGcBAAAAAAAVkhFNm3RALE27i1OrhBVJqWZTrIHfTbuMU6uEFlSua1OsggEwTbuMU6uEHFO7a1OsghV17AEAAAAAAACkAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAVSalmAQAAAAAAAEUq17GDD0JATYCNTGF2ZjU1LjMzLjEwMFdBjUxhdmY1NS4zMy4xMDBzpJBlrrXf3DCDVB8KcgbMpcr+RImIQJBgAAAAAAAWVK5rAQAAAAAAD++uAQAAAAAAADLXgQFzxYEBnIEAIrWcg3VuZIaFVl9WUDiDgQEj44OEAmJaAOABAAAAAAAABrCBsLqBkK4BAAAAAAAPq9eB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AAEAAAABAAAABAAAAAIAAAABAAAABgAAAAEAAAABAAAABwAAAAIAAAABAAAACAAAAAEAAAABAAAACQAAAAIAAAABAAAACgAAAAEAAAABAAAACwAAAAIAAAABAAAADQAAAAEAAAABAAAADgAAAAIAAAABAAAADwAAAAEAAAABAAAAEAAAAAIAAAABAAAAEQAAAAEAAAABAAAAEgAAAAIAAAABAAAAFAAAAAEAAAABAAAAFQAAAAIAAAABAAAAFgAAAAEAAAABAAAAFwAAAAIAAAABAAAAGAAAAAEAAAABAAAAGQAAAAIAAAABAAAAGgAAAAEAAAABAAAAGwAAAAIAAAABAAAAHQAAAAEAAAABAAAAHgAAAAIAAAABAAAAHwAAAAQAAAABAAAA4HN0c3oAAAAAAAAAAAAAADMAAAAaAAAACQAAAAkAAAAJAAAACQAAAAkAAAAJAAAACQAAAAkAAAAJAAAACQAAAAkAAAAJAAAACQAAAAkAAAAJAAAACQAAAAkAAAAJAAAACQAAAAkAAAAJAAAACQAAAAkAAAAJAAAACQAAAAkAAAAJAAAACQAAAAkAAAAJAAAACQAAAAkAAAAJAAAACQAAAAkAAAAJAAAACQAAAAkAAAAJAAAACQAAAAkAAAAJAAAACQAAAAkAAAAJAAAACQAAAAkAAAAJAAAACQAAAAkAAACMc3RjbwAAAAAAAAAfAAAALAAAA1UAAANyAAADhgAAA6IAAAO+AAAD0QAAA+0AAAQAAAAEHAAABC8AAARLAAAEZwAABHoAAASWAAAEqQAABMUAAATYAAAE9AAABRAAAAUjAAAFPwAABVIAAAVuAAAFgQAABZ0AAAWwAAAFzAAABegAAAX7AAAGFwAAAGJ1ZHRhAAAAWm1ldGEAAAAAAAAAIWhkbHIAAAAAAAAAAG1kaXJhcHBsAAAAAAAAAAAAAAAALWlsc3QAAAAlqXRvbwAAAB1kYXRhAAAAAQAAAABMYXZmNTUuMzMuMTAw"}}])}))});var D9t={};Oq(D9t,{AlphaMode:()=>$p,AlphaPipelineStage:()=>MB,AnchorPointDirect:()=>OF,AnchorPointIndirect:()=>MF,Animation:()=>w8,AnimationViewModel:()=>I8,Appearance:()=>wr,ApproximateTerrainHeights:()=>Mi,ArcGISTiledElevationTerrainProvider:()=>rae,ArcGisBaseMapType:()=>Pm,ArcGisMapServerImageryProvider:()=>o_,ArcGisMapService:()=>Wf,ArcType:()=>ln,ArticulationStageType:()=>ul,AssociativeArray:()=>Ut,Atmosphere:()=>xT,AtmospherePipelineStage:()=>uB,AttributeCompression:()=>cn,AttributeType:()=>Vt,AutoExposure:()=>sz,AutomaticUniforms:()=>tg,Axis:()=>Hi,AxisAlignedBoundingBox:()=>wf,Azure2DImageryProvider:()=>p2,B3dmLoader:()=>KF,B3dmParser:()=>WF,BaseLayerPicker:()=>B8,BaseLayerPickerViewModel:()=>F8,BatchTable:()=>Px,BatchTableHierarchy:()=>FT,BatchTexture:()=>cu,BatchTexturePipelineStage:()=>NB,Billboard:()=>Br,BillboardCollection:()=>Df,BillboardGraphics:()=>nl,BillboardLoadState:()=>Hs,BillboardTexture:()=>Cg,BillboardVisualizer:()=>hN,BingMapsGeocoderService:()=>sae,BingMapsImageryProvider:()=>o2,BingMapsStyle:()=>yw,BlendEquation:()=>Rc,BlendFunction:()=>$r,BlendOption:()=>Li,BlendingState:()=>tn,BoundingRectangle:()=>et,BoundingSphere:()=>ue,BoundingSphereState:()=>Pt,BoundingVolumeSemantics:()=>UA,BoxEmitter:()=>cce,BoxGeometry:()=>Ic,BoxGeometryUpdater:()=>ZN,BoxGraphics:()=>kx,BoxOutlineGeometry:()=>sm,BrdfLutGenerator:()=>rU,Buffer:()=>tt,BufferLoader:()=>ET,BufferPoint:()=>kc,BufferPointCollection:()=>ef,BufferPointMaterial:()=>km,BufferPolygon:()=>Mo,BufferPolygonCollection:()=>ja,BufferPolygonMaterial:()=>Vf,BufferPolyline:()=>xa,BufferPolylineCollection:()=>_l,BufferPolylineMaterial:()=>jf,BufferPrimitive:()=>cs,BufferPrimitiveCollection:()=>ra,BufferPrimitiveMaterial:()=>iu,BufferUsage:()=>Me,CPUStylingPipelineStage:()=>kB,CallbackPositionProperty:()=>_3,CallbackProperty:()=>am,Camera:()=>Or,CameraEventAggregator:()=>hz,CameraEventType:()=>sr,CameraFlightPath:()=>aU,Cartesian2:()=>U,Cartesian3:()=>h,Cartesian4:()=>se,CartesianRectangle:()=>Dw,Cartographic:()=>he,CartographicGeocoderService:()=>cae,CatmullRomSpline:()=>lae,Cesium3DContentGroup:()=>YT,Cesium3DTile:()=>fh,Cesium3DTileBatchTable:()=>vm,Cesium3DTileColorBlendMode:()=>qu,Cesium3DTileContent:()=>dce,Cesium3DTileContentFactory:()=>sE,Cesium3DTileContentState:()=>Rr,Cesium3DTileContentType:()=>wa,Cesium3DTileFeature:()=>oa,Cesium3DTileFeatureTable:()=>Cm,Cesium3DTileOptimizationHint:()=>lh,Cesium3DTileOptimizations:()=>e3,Cesium3DTilePass:()=>ao,Cesium3DTilePassState:()=>Ah,Cesium3DTilePointFeature:()=>g_,Cesium3DTileRefine:()=>Ao,Cesium3DTileStyle:()=>b_,Cesium3DTileStyleEngine:()=>s3,Cesium3DTileVectorFeature:()=>iE,Cesium3DTilesInspector:()=>O8,Cesium3DTilesInspectorViewModel:()=>R8,Cesium3DTilesTerrainData:()=>L4,Cesium3DTilesTerrainGeometryProcessor:()=>FP,Cesium3DTilesTerrainProvider:()=>pae,Cesium3DTilesVoxelProvider:()=>hce,Cesium3DTileset:()=>Xo,Cesium3DTilesetBaseTraversal:()=>d3,Cesium3DTilesetCache:()=>i3,Cesium3DTilesetGraphics:()=>Wx,Cesium3DTilesetHeatmap:()=>r3,Cesium3DTilesetMetadata:()=>mE,Cesium3DTilesetMostDetailedTraversal:()=>l3,Cesium3DTilesetSkipTraversal:()=>p3,Cesium3DTilesetStatistics:()=>zm,Cesium3DTilesetTraversal:()=>Xa,Cesium3DTilesetVisualizer:()=>g3,CesiumInspector:()=>L8,CesiumInspectorViewModel:()=>N8,CesiumTerrainProvider:()=>kC,CesiumWidget:()=>yV,Check:()=>Wr,CheckerboardMaterialProperty:()=>II,CircleEmitter:()=>K4,CircleGeometry:()=>xae,CircleOutlineGeometry:()=>Tae,ClassificationModelDrawCommand:()=>Q2,ClassificationPipelineStage:()=>LB,ClassificationPrimitive:()=>Bv,ClassificationType:()=>Qn,ClearCommand:()=>li,ClippingPlane:()=>ia,ClippingPlaneCollection:()=>Cs,ClippingPolygon:()=>LS,ClippingPolygonCollection:()=>Nc,Clock:()=>Xh,ClockRange:()=>As,ClockStep:()=>zr,ClockViewModel:()=>C8,CloudCollection:()=>yce,CloudType:()=>HP,Color:()=>z,ColorBlendMode:()=>sl,ColorGeometryInstanceAttribute:()=>Jt,ColorMaterialProperty:()=>Kt,Command:()=>Rle,ComponentDatatype:()=>Y,Composite3DTileContent:()=>pk,CompositeEntityCollection:()=>Pie,CompositeMaterialProperty:()=>DI,CompositePositionProperty:()=>_c,CompositeProperty:()=>Al,CompressedTextureBuffer:()=>vD,ComputeCommand:()=>xf,ComputeEngine:()=>CD,ConditionsExpression:()=>Uk,ConeEmitter:()=>bce,ConstantPositionProperty:()=>Kl,ConstantProperty:()=>ui,ConstantSpline:()=>QF,ContentMetadata:()=>Yk,Context:()=>xx,ContextLimits:()=>kt,Controller:()=>gle,ControllerHost:()=>uU,CoplanarPolygonGeometry:()=>xL,CoplanarPolygonGeometryLibrary:()=>Vg,CoplanarPolygonOutlineGeometry:()=>jd,CornerType:()=>tr,CorrelationGroup:()=>NF,CorridorGeometry:()=>eT,CorridorGeometryLibrary:()=>hr,CorridorGeometryUpdater:()=>lL,CorridorGraphics:()=>zx,CorridorOutlineGeometry:()=>cL,Credit:()=>It,CreditDisplay:()=>hU,CubeMap:()=>ns,CubeMapFace:()=>LD,CubeMapPanorama:()=>QE,CubicRealPolynomial:()=>hx,CullFace:()=>zi,CullingVolume:()=>ta,CumulusCloud:()=>yd,CustomDataSource:()=>HN,CustomHeightmapTerrainProvider:()=>Eae,CustomShader:()=>D0,CustomShaderMode:()=>r_,CustomShaderPipelineStage:()=>WB,CustomShaderTranslucencyMode:()=>wA,CylinderGeometry:()=>uL,CylinderGeometryLibrary:()=>tT,CylinderGeometryUpdater:()=>dL,CylinderGraphics:()=>Vx,CylinderOutlineGeometry:()=>fL,CzmlDataSource:()=>IV,DataSource:()=>xs,DataSourceClock:()=>Zm,DataSourceCollection:()=>DM,DataSourceDisplay:()=>R3,DebugAppearance:()=>vce,DebugCameraPrimitive:()=>E0,DebugInspector:()=>vz,DebugModelMatrixPrimitive:()=>Z4,DefaultProxy:()=>vae,DepthFunction:()=>cc,DepthPlane:()=>AU,DequantizationPipelineStage:()=>YB,DerivedCommand:()=>Wm,DeveloperError:()=>pe,DeviceOrientationCameraController:()=>bU,DirectionalLight:()=>Pce,DiscardEmptyTileImagePolicy:()=>Aw,DiscardMissingTileImagePolicy:()=>i2,DistanceDisplayCondition:()=>Ht,DistanceDisplayConditionGeometryInstanceAttribute:()=>ti,DoubleEndedPriorityQueue:()=>K_,DoublyLinkedList:()=>n3,DracoLoader:()=>Kg,DrawCommand:()=>at,DynamicAtmosphereLightingType:()=>Gg,DynamicEnvironmentMapManager:()=>Wg,DynamicGeometryBatch:()=>Kx,DynamicGeometryUpdater:()=>Ii,EarthOrientationParameters:()=>gD,EarthOrientationParametersSample:()=>wy,EasingFunction:()=>Rs,EdgeDetectionPipelineStage:()=>KB,EdgeDisplayMode:()=>Kd,EdgeFramebuffer:()=>SU,EdgeVisibilityPipelineStage:()=>ZB,EllipseGeometry:()=>nu,EllipseGeometryLibrary:()=>Uu,EllipseGeometryUpdater:()=>hL,EllipseGraphics:()=>jx,EllipseOutlineGeometry:()=>Lf,Ellipsoid:()=>ee,EllipsoidGeodesic:()=>gg,EllipsoidGeometry:()=>za,EllipsoidGeometryUpdater:()=>pL,EllipsoidGraphics:()=>Hx,EllipsoidOutlineGeometry:()=>Ff,EllipsoidPrimitive:()=>Q3,EllipsoidRhumbLine:()=>Dc,EllipsoidSurfaceAppearance:()=>Dce,EllipsoidTangentPlane:()=>js,EllipsoidTerrainProvider:()=>y0,EllipsoidalOccluder:()=>Zh,Empty3DTileContent:()=>l0,EncodedCartesian3:()=>Sn,Entity:()=>Jr,EntityCluster:()=>Of,EntityCollection:()=>Ua,EntityView:()=>M3,EquirectangularPanorama:()=>Rce,Event:()=>be,EventHelper:()=>jo,Expression:()=>ih,ExpressionNodeType:()=>Mt,ExtrapolationType:()=>hu,FeatureDetection:()=>dn,FeatureIdPipelineStage:()=>SA,Fog:()=>xU,ForEach:()=>ke,FrameRateMonitor:()=>n8,FrameState:()=>XA,Framebuffer:()=>_s,FramebufferManager:()=>ai,Frozen:()=>H,FrustumCommands:()=>IU,FrustumGeometry:()=>SE,FrustumOutlineGeometry:()=>gU,Fullscreen:()=>es,FullscreenButton:()=>W8,FullscreenButtonViewModel:()=>G8,GaussianSplat3DTileContent:()=>GA,GaussianSplatPrimitive:()=>qk,GaussianSplatRenderResources:()=>Hk,GaussianSplatSorter:()=>rE,GaussianSplatTextureGenerator:()=>jk,GeoJsonDataSource:()=>Rb,GeoJsonLoader:()=>$F,GeoJsonPrimitive:()=>Lce,GeocodeType:()=>Vb,Geocoder:()=>V8,GeocoderService:()=>UP,GeocoderViewModel:()=>z8,GeographicProjection:()=>Ui,GeographicTilingScheme:()=>Qi,Geometry:()=>St,Geometry3DTileContent:()=>_k,GeometryAttribute:()=>Ne,GeometryAttributes:()=>Tn,GeometryFactory:()=>Sae,GeometryInstance:()=>Ft,GeometryInstanceAttribute:()=>Zc,GeometryOffsetAttribute:()=>mn,GeometryPipeline:()=>Hn,GeometryPipelineStage:()=>n2,GeometryType:()=>vd,GeometryUpdater:()=>Pi,GeometryUpdaterSet:()=>gT,GeometryVisualizer:()=>HL,GetFeatureInfoFormat:()=>Dm,Globe:()=>K3,GlobeDepth:()=>PU,GlobeSurfaceShaderSet:()=>k3,GlobeSurfaceTile:()=>_h,GlobeSurfaceTileProvider:()=>z3,GlobeTranslucency:()=>V3,GlobeTranslucencyFramebuffer:()=>DU,GlobeTranslucencyState:()=>TU,GltfBufferViewLoader:()=>jS,GltfDracoLoader:()=>HS,GltfGpmLoader:()=>FF,GltfGpmLocal:()=>QS,GltfImageLoader:()=>GS,GltfIndexBufferLoader:()=>WS,GltfJsonLoader:()=>YS,GltfLoader:()=>Gf,GltfLoaderUtil:()=>Hu,GltfMeshPrimitiveGpmLoader:()=>zF,GltfSpzLoader:()=>EF,GltfStructuralMetadataLoader:()=>DF,GltfTextureLoader:()=>XS,GltfVertexBufferLoader:()=>KS,Google2DImageryProvider:()=>m2,GoogleEarthEnterpriseImageryProvider:()=>Bce,GoogleEarthEnterpriseMapsProvider:()=>c2,GoogleEarthEnterpriseMetadata:()=>_y,GoogleEarthEnterpriseTerrainData:()=>zP,GoogleEarthEnterpriseTerrainProvider:()=>Mae,GoogleEarthEnterpriseTileInformation:()=>U4,GoogleGeocoderService:()=>Lae,GoogleMaps:()=>va,GoogleStreetViewCubeMapPanoramaProvider:()=>kce,GpxDataSource:()=>x4,GregorianDate:()=>Bh,GridImageryProvider:()=>Uce,GridMaterialProperty:()=>OI,GroundGeometryUpdater:()=>ii,GroundPolylineGeometry:()=>vx,GroundPolylinePrimitive:()=>Kh,GroundPrimitive:()=>Xl,GroupMetadata:()=>Jw,HeadingPitchRange:()=>Od,HeadingPitchRoll:()=>wc,Heap:()=>dD,HeightReference:()=>We,HeightmapEncoding:()=>ph,HeightmapTerrainData:()=>zc,HeightmapTessellator:()=>rI,HermitePolynomialApproximation:()=>AV,HermiteSpline:()=>CA,HilbertOrder:()=>Lw,HomeButton:()=>H8,HomeButtonViewModel:()=>j8,HorizontalOrigin:()=>Vi,HybridScreenSpacePanCameraController:()=>xle,I3SBuildingSceneLayerExplorer:()=>zle,I3SBuildingSceneLayerExplorerViewModel:()=>q8,I3SDataProvider:()=>gp,I3SDecoder:()=>i8,I3SFeature:()=>r8,I3SField:()=>o8,I3SGeometry:()=>qP,I3SLayer:()=>KC,I3SNode:()=>YP,I3SStatistics:()=>c8,I3SSublayer:()=>u8,I3SSymbology:()=>a8,I3dmLoader:()=>ZF,I3dmParser:()=>JF,ITwinData:()=>Hce,ITwinPlatform:()=>ua,Iau2000Orientation:()=>J3,Iau2006XysData:()=>_D,Iau2006XysSample:()=>lx,IauOrientationAxes:()=>Z3,IauOrientationParameters:()=>$3,ImageBasedLighting:()=>LT,ImageBasedLightingPipelineStage:()=>dB,ImageMaterialProperty:()=>Jy,Imagery:()=>Iw,ImageryConfiguration:()=>lk,ImageryCoverage:()=>Rw,ImageryFlags:()=>g2,ImageryInput:()=>y2,ImageryLayer:()=>Is,ImageryLayerCollection:()=>pE,ImageryLayerFeatureInfo:()=>Im,ImageryPipelineStage:()=>A2,ImageryProvider:()=>qf,ImageryState:()=>Vn,Implicit3DTileContent:()=>zw,ImplicitAvailabilityBitstream:()=>Bw,ImplicitMetadataView:()=>kw,ImplicitSubdivisionScheme:()=>qs,ImplicitSubtree:()=>p_,ImplicitSubtreeCache:()=>Y4,ImplicitSubtreeMetadata:()=>Ak,ImplicitTileCoordinates:()=>d0,ImplicitTileset:()=>f0,IndexDatatype:()=>je,InfoBox:()=>X8,InfoBoxViewModel:()=>Y8,InspectorShared:()=>Af,InstanceAttributeSemantic:()=>Lo,InstancingPipelineStage:()=>PB,InterpolationAlgorithm:()=>Bae,InterpolationType:()=>ym,Intersect:()=>$t,IntersectionTests:()=>_i,Intersections2D:()=>fp,Interval:()=>Us,InvertClassification:()=>pI,Ion:()=>Ku,IonGeocodeProviderType:()=>yy,IonGeocoderService:()=>VC,IonImageryProvider:()=>lu,IonImageryProviderFactory:()=>Sw,IonResource:()=>Yo,IonSnapGeometryType:()=>zae,IonSnapHeat:()=>Vae,IonSnapMode:()=>V4,IonSnapParentGeometryType:()=>jae,IonSnapService:()=>Hae,IonWorldImageryStyle:()=>a_,Iso8601:()=>nt,JobScheduler:()=>EU,JobType:()=>Fc,JsonMetadataTable:()=>Yg,JulianDate:()=>K,KTX2Transcoder:()=>SD,KeyboardEventModifier:()=>Qr,KeyframeNode:()=>jr,KmlCamera:()=>T4,KmlDataSource:()=>NC,KmlLookAt:()=>E4,KmlTour:()=>C4,KmlTourFlyTo:()=>v4,KmlTourWait:()=>S4,Label:()=>Ky,LabelCollection:()=>Vp,LabelGraphics:()=>im,LabelStyle:()=>_o,LabelVisualizer:()=>GL,LagrangePolynomialApproximation:()=>bV,LeapSecond:()=>yr,Light:()=>Gce,LightingModel:()=>r0,LightingPipelineStage:()=>x2,LinearApproximation:()=>ZA,LinearSpline:()=>EA,MVTDataProvider:()=>Yce,ManagedArray:()=>fu,MapMode2D:()=>pu,MapProjection:()=>Wae,MapboxImageryProvider:()=>l2,MapboxStyleImageryProvider:()=>Wce,MappedPositions:()=>_2,Material:()=>er,MaterialAppearance:()=>Er,MaterialPipelineStage:()=>v2,MaterialProperty:()=>yo,Math:()=>D,Matrix2:()=>Xi,Matrix3:()=>$,Matrix4:()=>N,Megatexture:()=>Qz,MeshPrimitiveGpmLocal:()=>UF,MetadataClass:()=>xm,MetadataClassProperty:()=>Jp,MetadataComponentType:()=>Lt,MetadataEntity:()=>Yn,MetadataEnum:()=>SF,MetadataEnumValue:()=>vF,MetadataPicking:()=>CU,MetadataPickingPipelineStage:()=>Kf,MetadataPipelineStage:()=>eh,MetadataSchema:()=>ou,MetadataSchemaLoader:()=>AA,MetadataSemantic:()=>rh,MetadataTable:()=>$d,MetadataTableProperty:()=>aF,MetadataType:()=>bt,MipmapHint:()=>Id,Model:()=>$f,Model3DTileContent:()=>Zf,ModelAlphaOptions:()=>GT,ModelAnimation:()=>iB,ModelAnimationChannel:()=>nB,ModelAnimationCollection:()=>rB,ModelAnimationLoop:()=>Yu,ModelAnimationState:()=>Sm,ModelArticulation:()=>mB,ModelArticulationStage:()=>hB,ModelClippingPlanesPipelineStage:()=>_B,ModelClippingPolygonsPipelineStage:()=>bB,ModelColorPipelineStage:()=>vA,ModelComponents:()=>Cn,ModelDrawCommand:()=>ek,ModelDrawCommands:()=>ik,ModelFeature:()=>oB,ModelFeatureTable:()=>sB,ModelGraphics:()=>Pg,ModelImagery:()=>uk,ModelImageryMapping:()=>VT,ModelLightingOptions:()=>$2,ModelMatrixUpdateStage:()=>DB,ModelNode:()=>CB,ModelPrimitiveImagery:()=>jT,ModelReader:()=>Ea,ModelRenderResources:()=>H2,ModelRuntimeNode:()=>OB,ModelRuntimePrimitive:()=>V2,ModelSceneGraph:()=>rk,ModelSilhouettePipelineStage:()=>q2,ModelSkin:()=>j2,ModelSplitterPipelineStage:()=>X2,ModelStatistics:()=>ok,ModelType:()=>qo,ModelUtility:()=>xt,ModelVectorLookupPipelineStage:()=>EB,ModelVisualizer:()=>hk,Moon:()=>tU,MorphTargetsPipelineStage:()=>w2,MorphWeightSpline:()=>qae,MortonOrder:()=>KA,MouseButton:()=>ec,Multiple3DTileContent:()=>$k,MultisampleFramebuffer:()=>IO,NavigationHelpButton:()=>$8,NavigationHelpButtonViewModel:()=>K8,NearFarScalar:()=>qt,NeverTileDiscardPolicy:()=>Kce,NodeRenderResources:()=>K2,NodeStatisticsPipelineStage:()=>RB,NodeTransformationProperty:()=>Gx,OIT:()=>RU,Occluder:()=>nU,OffsetGeometryInstanceAttribute:()=>Tr,OpenCageGeocoderService:()=>Xae,OpenStreetMapImageryProvider:()=>xy,OrderedGroundPrimitiveCollection:()=>dN,OrientedBoundingBox:()=>en,OrthographicFrustum:()=>gn,OrthographicOffCenterFrustum:()=>ys,Packable:()=>Kae,PackableForInterpolation:()=>$ae,Panorama:()=>$ce,PanoramaProvider:()=>Jce,Particle:()=>$P,ParticleBurst:()=>Qce,ParticleEmitter:()=>ele,ParticleSystem:()=>tle,Pass:()=>Ie,PassState:()=>sc,PathGraphics:()=>Dg,PathMode:()=>h0,PathVisualizer:()=>E3,PeliasGeocoderService:()=>z4,PerInstanceColorAppearance:()=>yn,PerformanceDisplay:()=>k_,PerformanceWatchdog:()=>Z8,PerformanceWatchdogViewModel:()=>J8,PerspectiveFrustum:()=>$i,PerspectiveOffCenterFrustum:()=>mu,PickDepth:()=>vU,PickDepthFramebuffer:()=>MU,PickFramebuffer:()=>NU,PickId:()=>zD,PickedMetadataInfo:()=>oV,Picking:()=>VU,PickingPipelineStage:()=>I2,PinBuilder:()=>uy,PixelDatatype:()=>ze,PixelFormat:()=>Ke,PlanarFillIdFramebuffer:()=>wU,Plane:()=>sn,PlaneGeometry:()=>gL,PlaneGeometryUpdater:()=>yL,PlaneGraphics:()=>LN,PlaneOutlineGeometry:()=>_L,PntsLoader:()=>ak,PntsParser:()=>qT,PointCloud:()=>gV,PointCloudEyeDomeLighting:()=>Jg,PointCloudShading:()=>t0,PointCloudStylingPipelineStage:()=>D2,PointGraphics:()=>qx,PointPrimitive:()=>ga,PointPrimitiveCollection:()=>kv,PointVisualizer:()=>v3,PolygonGeometry:()=>qp,PolygonGeometryLibrary:()=>ni,PolygonGeometryUpdater:()=>EL,PolygonGraphics:()=>rm,PolygonHierarchy:()=>Mc,PolygonOutlineGeometry:()=>TL,PolygonPipeline:()=>fi,Polyline:()=>oh,PolylineArrowMaterialProperty:()=>NI,PolylineCollection:()=>Lm,PolylineColorAppearance:()=>Vs,PolylineDashMaterialProperty:()=>FI,PolylineGeometry:()=>N_,PolylineGeometryUpdater:()=>I3,PolylineGlowMaterialProperty:()=>kI,PolylineGraphics:()=>il,PolylineMaterialAppearance:()=>ac,PolylineOutlineMaterialProperty:()=>Ab,PolylinePipeline:()=>nr,PolylineVisualizer:()=>D3,PolylineVolumeGeometry:()=>SL,PolylineVolumeGeometryLibrary:()=>cm,PolylineVolumeGeometryUpdater:()=>DL,PolylineVolumeGraphics:()=>Yx,PolylineVolumeOutlineGeometry:()=>PL,PositionProperty:()=>nm,PositionPropertyArray:()=>Z_,PostProcessStage:()=>Ur,PostProcessStageCollection:()=>lz,PostProcessStageComposite:()=>af,PostProcessStageLibrary:()=>rd,PostProcessStageSampleMode:()=>id,PostProcessStageTextureCache:()=>UE,PpeMetadata:()=>kF,PpeSource:()=>wle,PpeTexture:()=>BF,Primitive:()=>On,PrimitiveCollection:()=>Qc,PrimitiveLoadPlan:()=>MT,PrimitiveOutlineGenerator:()=>OT,PrimitiveOutlinePipelineStage:()=>M2,PrimitivePipeline:()=>Dx,PrimitiveRenderResources:()=>J2,PrimitiveState:()=>rs,PrimitiveStatisticsPipelineStage:()=>N2,PrimitiveType:()=>Oe,ProjectionPicker:()=>ej,ProjectionPickerViewModel:()=>Q8,Property:()=>X,PropertyArray:()=>zI,PropertyAttribute:()=>TT,PropertyAttributeProperty:()=>iF,PropertyBag:()=>Jl,PropertyTable:()=>ru,PropertyTexture:()=>Xg,PropertyTextureProperty:()=>nF,ProviderViewModel:()=>uo,Proxy:()=>Zae,QuadraticRealPolynomial:()=>Ul,QuadtreeOccluders:()=>j3,QuadtreePrimitive:()=>X3,QuadtreeTile:()=>H3,QuadtreeTileLoadState:()=>$a,QuadtreeTileProvider:()=>ile,QuantizedMeshTerrainData:()=>BC,QuarticRealPolynomial:()=>PD,Quaternion:()=>Le,QuaternionSpline:()=>tB,Queue:()=>sA,Ray:()=>pn,Rectangle:()=>ie,RectangleCollisionChecker:()=>yT,RectangleGeometry:()=>lT,RectangleGeometryLibrary:()=>ya,RectangleGeometryUpdater:()=>OL,RectangleGraphics:()=>om,RectangleOutlineGeometry:()=>uT,ReferenceFrame:()=>ji,ReferenceProperty:()=>O_,RenderState:()=>Ge,Renderbuffer:()=>Sf,RenderbufferFormat:()=>jl,Request:()=>wo,RequestErrorEvent:()=>wp,RequestScheduler:()=>Kc,RequestState:()=>Ti,RequestType:()=>Zs,Resource:()=>De,ResourceCache:()=>Fi,ResourceCacheKey:()=>su,ResourceCacheStatistics:()=>PF,ResourceLoader:()=>ir,ResourceLoaderState:()=>Tt,Rotation:()=>vh,RuntimeError:()=>oe,S2Cell:()=>d_,SDFSettings:()=>Ba,SampledPositionProperty:()=>yc,SampledProperty:()=>td,Sampler:()=>jt,ScaledPositionProperty:()=>m0,Scene:()=>aV,SceneFramebuffer:()=>NE,SceneMode:()=>re,SceneMode2DPipelineStage:()=>L2,SceneModePicker:()=>nj,SceneModePickerViewModel:()=>tj,SceneTransforms:()=>dr,SceneTransitioner:()=>dz,ScreenSpaceCameraController:()=>gz,ScreenSpaceElevatorCameraController:()=>y8,ScreenSpaceEventHandler:()=>sa,ScreenSpaceEventType:()=>un,ScreenSpaceInputBindings:()=>yp,ScreenSpaceMapCameraController:()=>A8,ScreenSpaceTiltOrbitCameraController:()=>Ele,ScreenSpaceZoomCameraController:()=>vle,SelectedFeatureIdPipelineStage:()=>IA,SelectionIndicator:()=>oj,SelectionIndicatorViewModel:()=>rj,SensorVolumePortionToDisplay:()=>HI,ShaderBuilder:()=>hg,ShaderCache:()=>TO,ShaderDestination:()=>de,ShaderFunction:()=>OO,ShaderProgram:()=>Qt,ShaderSource:()=>Ye,ShaderStruct:()=>RO,ShadowMap:()=>V_,ShadowMapShader:()=>Ym,ShadowMode:()=>Pn,ShadowVolumeAppearance:()=>If,SharedContext:()=>MO,ShowGeometryInstanceAttribute:()=>Dn,Simon1994PlanetaryPositions:()=>ky,SimplePolylineGeometry:()=>Qae,SingleTileImageryProvider:()=>u2,SkinningPipelineStage:()=>B2,SkyAtmosphere:()=>cV,SkyBox:()=>uV,SnapFramebuffer:()=>yz,SnapService:()=>ece,Snapping:()=>bz,SpatialNode:()=>tV,Spdcf:()=>LF,SpecularEnvironmentCubeMap:()=>Em,SphereEmitter:()=>ole,SphereGeometry:()=>H4,SphereOutlineGeometry:()=>S_,Spherical:()=>xV,Spline:()=>Dr,SplitDirection:()=>Ho,Splitter:()=>CI,StaticGeometryColorBatch:()=>qd,StaticGeometryPerMaterialBatch:()=>Yd,StaticGroundGeometryColorBatch:()=>SS,StaticGroundGeometryPerMaterialBatch:()=>jL,StaticGroundPolylinePerMaterialBatch:()=>P3,StaticOutlineGeometryBatch:()=>PS,StencilConstants:()=>Yt,StencilFunction:()=>ei,StencilOperation:()=>Rt,SteppedSpline:()=>eB,Stereographic:()=>ol,StorageType:()=>bA,StripeMaterialProperty:()=>jI,StripeOrientation:()=>Qm,StructuralMetadata:()=>Ha,StyleCommandsNeeded:()=>wm,StyleExpression:()=>sle,Sun:()=>hV,SunLight:()=>dg,SunPostProcess:()=>Ez,SupportedImageFormats:()=>RF,SvgPathBindingHandler:()=>T8,Sync:()=>NO,TaskProcessor:()=>$n,Terrain:()=>p8,TerrainData:()=>rf,TerrainEncoding:()=>Eo,TerrainFillMesh:()=>cI,TerrainMesh:()=>Ac,TerrainOffsetProperty:()=>Jx,TerrainPicker:()=>F3,TerrainProvider:()=>Xr,TerrainQuantization:()=>Ka,TerrainState:()=>kr,Texture:()=>Dt,Texture3D:()=>LO,TextureAtlas:()=>Ex,TextureCache:()=>EO,TextureMagnificationFilter:()=>Jn,TextureManager:()=>Pz,TextureMinificationFilter:()=>Wt,TexturePacker:()=>vv,TextureUniform:()=>Rz,TextureWrap:()=>hn,TileAvailability:()=>up,TileBoundingRegion:()=>ed,TileBoundingS2Cell:()=>Zk,TileBoundingSphere:()=>w_,TileBoundingVolume:()=>ale,TileCoordinatesImageryProvider:()=>_8,TileDiscardPolicy:()=>lle,TileEdge:()=>wn,TileImagery:()=>Pw,TileMapServiceImageryProvider:()=>PA,TileMetadata:()=>Xk,TileOrientedBoundingBox:()=>tf,TileProviderError:()=>Zr,TileReplacementQueue:()=>G3,TileSelectionResult:()=>pi,TileState:()=>ule,Tileset3DTileContent:()=>xk,TilesetMetadata:()=>Qk,TilesetPipelineStage:()=>aB,TilingScheme:()=>nce,TimeConstants:()=>kn,TimeDynamicImagery:()=>zT,TimeDynamicPointCloud:()=>SI,TimeInterval:()=>En,TimeIntervalCollection:()=>Ds,TimeIntervalCollectionPositionProperty:()=>M_,TimeIntervalCollectionProperty:()=>Q_,TimeStandard:()=>si,Timeline:()=>cj,TimelineHighlightRange:()=>sj,TimelineTrack:()=>aj,Tipsify:()=>DD,ToggleButtonViewModel:()=>Wb,Tonemapper:()=>G_,TrackingReferenceFrame:()=>wg,Transforms:()=>At,TranslationRotationScale:()=>Zy,TranslucentTileClassification:()=>LU,TridiagonalSystemSolver:()=>sw,TrustedServers:()=>dv,TweenCollection:()=>HE,UniformState:()=>wO,UniformType:()=>P0,UrlTemplate3DTilesDataProvider:()=>d8,UrlTemplateImageryProvider:()=>ws,VERSION:()=>P9t,VRButton:()=>fj,VRButtonViewModel:()=>uj,VRTheWorldTerrainProvider:()=>rce,VaryingType:()=>Sle,Vector3DTileBatch:()=>a0,Vector3DTileClampedPolylines:()=>Dk,Vector3DTileContent:()=>Ok,Vector3DTileGeometry:()=>f_,Vector3DTilePoints:()=>Sk,Vector3DTilePolygons:()=>wk,Vector3DTilePolylines:()=>eE,Vector3DTilePrimitive:()=>$T,VectorGltf3DTileContent:()=>HA,VectorPipeline:()=>vs,VectorProvider:()=>x_,VelocityOrientationProperty:()=>EV,VelocityVectorProperty:()=>L_,VertexArray:()=>zn,VertexArrayFacade:()=>mg,VertexAttributeSemantic:()=>ct,VertexFormat:()=>Be,VerticalExaggeration:()=>Ar,VerticalExaggerationPipelineStage:()=>U2,VerticalOrigin:()=>Gn,VideoSynchronizer:()=>ice,View:()=>FE,Viewer:()=>Yle,ViewportQuad:()=>fle,Visibility:()=>Ko,Visualizer:()=>eae,VoxelBoundsCollection:()=>Y_,VoxelBoxShape:()=>KE,VoxelCell:()=>Sz,VoxelContent:()=>XE,VoxelCylinderShape:()=>$E,VoxelEllipsoidShape:()=>JE,VoxelInspector:()=>hj,VoxelInspectorViewModel:()=>dj,VoxelMetadataOrder:()=>R0,VoxelPrimitive:()=>pb,VoxelProvider:()=>hle,VoxelRenderResources:()=>Yz,VoxelShape:()=>mle,VoxelShapeType:()=>Tc,VoxelTraversal:()=>nV,VulkanConstants:()=>oce,WallGeometry:()=>NL,WallGeometryLibrary:()=>fT,WallGeometryUpdater:()=>BL,WallGraphics:()=>Rg,WallOutlineGeometry:()=>FL,WebGLConstants:()=>te,WebMapServiceImageryProvider:()=>d2,WebMapTileServiceImageryProvider:()=>h2,WebMercatorProjection:()=>yi,WebMercatorTilingScheme:()=>Fo,WindingOrder:()=>Qs,WireframeIndexGenerator:()=>Ow,WireframePipelineStage:()=>z2,_shadersAcesTonemappingStage:()=>jU,_shadersAdditiveBlend:()=>xz,_shadersAdjustTranslucentFS:()=>Sv,_shadersAllMaterialAppearanceFS:()=>GN,_shadersAllMaterialAppearanceVS:()=>WN,_shadersAmbientOcclusionGenerate:()=>HU,_shadersAmbientOcclusionModulate:()=>GU,_shadersAspectRampMaterial:()=>kM,_shadersAtmosphereCommon:()=>Yh,_shadersAtmosphereStageFS:()=>cB,_shadersAtmosphereStageVS:()=>lB,_shadersBasicMaterialAppearanceFS:()=>qN,_shadersBasicMaterialAppearanceVS:()=>YN,_shadersBillboardCollectionFS:()=>BO,_shadersBillboardCollectionVS:()=>kO,_shadersBlackAndWhite:()=>WU,_shadersBloomComposite:()=>qU,_shadersBrdfLutGeneratorFS:()=>UO,_shadersBrightPass:()=>Tz,_shadersBrightness:()=>YU,_shadersBufferPointMaterialFS:()=>zO,_shadersBufferPointMaterialVS:()=>VO,_shadersBufferPolygonMaterialFS:()=>jO,_shadersBufferPolygonMaterialVS:()=>HO,_shadersBufferPolylineMaterialFS:()=>GO,_shadersBufferPolylineMaterialVS:()=>WO,_shadersBumpMapMaterial:()=>UM,_shadersCPUStylingStageFS:()=>BB,_shadersCPUStylingStageVS:()=>FB,_shadersCheckerboardMaterial:()=>zM,_shadersCloudCollectionFS:()=>qO,_shadersCloudCollectionVS:()=>YO,_shadersCloudNoiseFS:()=>XO,_shadersCloudNoiseVS:()=>KO,_shadersCompareAndPackTranslucentDepth:()=>$O,_shadersCompositeOITFS:()=>JO,_shadersCompositeTranslucentClassification:()=>LE,_shadersComputeIrradianceFS:()=>ZO,_shadersComputeRadianceMapFS:()=>QO,_shadersConstantLodStageFS:()=>C2,_shadersConstantLodStageVS:()=>E2,_shadersContrastBias:()=>XU,_shadersConvolveSpecularMapFS:()=>eM,_shadersConvolveSpecularMapVS:()=>tM,_shadersCubeMapPanoramaVS:()=>nM,_shadersCustomShaderStageFS:()=>zB,_shadersCustomShaderStageVS:()=>UB,_shadersCzmBuiltins:()=>Ax,_shadersDepthOfField:()=>KU,_shadersDepthPlaneFS:()=>iM,_shadersDepthPlaneVS:()=>rM,_shadersDepthView:()=>$U,_shadersDepthViewPacked:()=>tae,_shadersDotMaterial:()=>VM,_shadersEdgeDetection:()=>JU,_shadersEdgeDetectionStageFS:()=>XB,_shadersEdgeVisibilityStageFS:()=>$B,_shadersEdgeVisibilityStageVS:()=>JB,_shadersElevationBandMaterial:()=>jM,_shadersElevationContourMaterial:()=>HM,_shadersElevationRampMaterial:()=>GM,_shadersEllipsoidFS:()=>wv,_shadersEllipsoidSurfaceAppearanceFS:()=>D4,_shadersEllipsoidSurfaceAppearanceVS:()=>R4,_shadersEllipsoidVS:()=>Iv,_shadersFXAA:()=>ez,_shadersFXAA3_11:()=>oM,_shadersFadeMaterial:()=>WM,_shadersFeatureIdStageFS:()=>VB,_shadersFeatureIdStageVS:()=>jB,_shadersFilmicTonemapping:()=>ZU,_shadersGaussianBlur1D:()=>db,_shadersGeometryStageFS:()=>QB,_shadersGeometryStageVS:()=>e2,_shadersGlobeFS:()=>sM,_shadersGlobeVS:()=>aM,_shadersGridMaterial:()=>qM,_shadersGroundAtmosphere:()=>Pv,_shadersHSBToRGB:()=>xR,_shadersHSLToRGB:()=>TR,_shadersImageBasedLightingStageFS:()=>fB,_shadersInstancingStageCommon:()=>vB,_shadersInstancingStageVS:()=>SB,_shadersIntersectBox:()=>Uz,_shadersIntersectCylinder:()=>zz,_shadersIntersectDepth:()=>Bz,_shadersIntersectEllipsoid:()=>Vz,_shadersIntersectLongitude:()=>xI,_shadersIntersectPlane:()=>kz,_shadersIntersection:()=>YE,_shadersIntersectionUtils:()=>Fz,_shadersLegacyInstancingStageVS:()=>wB,_shadersLensFlare:()=>tz,_shadersLightingStageFS:()=>b2,_shadersMaterialStageFS:()=>T2,_shadersMegatexture:()=>qz,_shadersMetadataStageFS:()=>HB,_shadersMetadataStageVS:()=>GB,_shadersModelClippingPlanesStageFS:()=>gB,_shadersModelClippingPolygonsStageFS:()=>yB,_shadersModelClippingPolygonsStageVS:()=>AB,_shadersModelColorStageFS:()=>pB,_shadersModelFS:()=>nk,_shadersModelSilhouetteStageFS:()=>G2,_shadersModelSilhouetteStageVS:()=>W2,_shadersModelSplitterStageFS:()=>Y2,_shadersModelVS:()=>tk,_shadersModelVectorLookupStageFS:()=>TB,_shadersModelVectorLookupStageVS:()=>xB,_shadersModifiedReinhardTonemapping:()=>nz,_shadersMorphTargetsStageVS:()=>S2,_shadersNightVision:()=>iz,_shadersNormalMapMaterial:()=>YM,_shadersOctree:()=>Wz,_shadersPassThrough:()=>sf,_shadersPassThroughDepth:()=>cb,_shadersPbrNeutralTonemapping:()=>QU,_shadersPerInstanceColorAppearanceFS:()=>lN,_shadersPerInstanceColorAppearanceVS:()=>uN,_shadersPerInstanceFlatColorAppearanceFS:()=>Sx,_shadersPerInstanceFlatColorAppearanceVS:()=>fN,_shadersPointCloudEyeDomeLighting:()=>GF,_shadersPointCloudStylingStageVS:()=>P2,_shadersPointPrimitiveCollectionFS:()=>Vy,_shadersPointPrimitiveCollectionVS:()=>cM,_shadersPolylineArrowMaterial:()=>XM,_shadersPolylineColorAppearanceVS:()=>FM,_shadersPolylineCommon:()=>Wl,_shadersPolylineDashMaterial:()=>KM,_shadersPolylineFS:()=>Cx,_shadersPolylineGlowMaterial:()=>$M,_shadersPolylineMaterialAppearanceVS:()=>BM,_shadersPolylineOutlineMaterial:()=>JM,_shadersPolylineShadowVolumeFS:()=>lM,_shadersPolylineShadowVolumeMorphFS:()=>uM,_shadersPolylineShadowVolumeMorphVS:()=>fM,_shadersPolylineShadowVolumeVS:()=>dM,_shadersPolylineVS:()=>hM,_shadersPrimitiveGaussianSplatFS:()=>mM,_shadersPrimitiveGaussianSplatVS:()=>pM,_shadersPrimitiveOutlineStageFS:()=>O2,_shadersPrimitiveOutlineStageVS:()=>R2,_shadersRGBToHSB:()=>XR,_shadersRGBToHSL:()=>KR,_shadersRGBToXYZ:()=>$R,_shadersReinhardTonemapping:()=>rz,_shadersReprojectWebMercatorFS:()=>gM,_shadersReprojectWebMercatorVS:()=>_M,_shadersRimLightingMaterial:()=>ZM,_shadersSelectedFeatureIdStageCommon:()=>pw,_shadersShadowVolumeAppearanceFS:()=>Dv,_shadersShadowVolumeAppearanceVS:()=>yM,_shadersShadowVolumeFS:()=>jy,_shadersSilhouette:()=>oz,_shadersSkinningStageVS:()=>F2,_shadersSkyAtmosphereCommon:()=>Rv,_shadersSkyAtmosphereFS:()=>AM,_shadersSkyAtmosphereVS:()=>bM,_shadersSkyBoxFS:()=>xM,_shadersSkyBoxVS:()=>TM,_shadersSlopeRampMaterial:()=>QM,_shadersStripeMaterial:()=>eN,_shadersSunFS:()=>EM,_shadersSunTextureFS:()=>CM,_shadersSunVS:()=>vM,_shadersTexturedMaterialAppearanceFS:()=>XN,_shadersTexturedMaterialAppearanceVS:()=>KN,_shadersVector3DTileClampedPolylinesFS:()=>SM,_shadersVector3DTileClampedPolylinesVS:()=>wM,_shadersVector3DTilePolylinesVS:()=>IM,_shadersVectorCommon:()=>pg,_shadersVectorTileVS:()=>Ov,_shadersVerticalExaggerationStageVS:()=>k2,_shadersViewportQuadFS:()=>PM,_shadersViewportQuadVS:()=>ux,_shadersVoxelFS:()=>Nz,_shadersVoxelUtils:()=>Mz,_shadersVoxelVS:()=>Lz,_shadersWater:()=>nN,_shadersWaterMaskMaterial:()=>tN,_shadersXYZToRGB:()=>bO,_shadersacesTonemapping:()=>B1,_shadersalphaWeight:()=>k1,_shadersantialias:()=>U1,_shadersapplyHSBShift:()=>z1,_shadersapproximateSphericalCoordinates:()=>V1,_shadersapproximateTanh:()=>j1,_shadersbackFacing:()=>H1,_shadersbranchFreeTernary:()=>G1,_shaderscascadeColor:()=>W1,_shaderscascadeDistance:()=>q1,_shaderscascadeMatrix:()=>Y1,_shaderscascadeWeights:()=>X1,_shaderscolumbusViewMorph:()=>K1,_shaderscomputeAtmosphereColor:()=>$1,_shaderscomputeGroundAtmosphereScattering:()=>J1,_shaderscomputePosition:()=>Z1,_shaderscomputeScattering:()=>Q1,_shaderscomputeTextureTransform:()=>eR,_shadersconvertLocalToBoxUv:()=>jz,_shadersconvertLocalToCylinderUv:()=>Hz,_shadersconvertLocalToEllipsoidUv:()=>Gz,_shaderscosineAndSine:()=>tR,_shadersdecodeRGB8:()=>nR,_shadersdecompressTextureCoordinates:()=>iR,_shadersdegreesPerRadian:()=>VD,_shadersdepthClamp:()=>rR,_shadersdepthRange:()=>jD,_shadersdepthRangeStruct:()=>P1,_shaderseastNorthUpToEyeCoordinates:()=>oR,_shadersellipsoidContainsPoint:()=>sR,_shadersellipsoidTextureCoordinates:()=>aR,_shadersepsilon1:()=>HD,_shadersepsilon2:()=>GD,_shadersepsilon3:()=>WD,_shadersepsilon4:()=>qD,_shadersepsilon5:()=>YD,_shadersepsilon6:()=>XD,_shadersepsilon7:()=>KD,_shadersequalsEpsilon:()=>cR,_shaderseyeOffset:()=>lR,_shaderseyeToCartographicDelta:()=>uR,_shaderseyeToWindowCoordinates:()=>fR,_shadersfastApproximateAtan:()=>dR,_shadersfog:()=>hR,_shadersgammaCorrect:()=>mR,_shadersgeodeticSurfaceNormal:()=>pR,_shadersgetDefaultMaterial:()=>gR,_shadersgetDynamicAtmosphereLightDirection:()=>_R,_shadersgetLambertDiffuse:()=>yR,_shadersgetSpecular:()=>AR,_shadersgetWaterNoise:()=>bR,_shadershue:()=>ER,_shadersinfinity:()=>$D,_shadersinverseGamma:()=>CR,_shadersisEmpty:()=>vR,_shadersisFull:()=>SR,_shaderslatitudeToWebMercatorFraction:()=>wR,_shaderslineDistance:()=>PR,_shaderslinearToSrgb:()=>IR,_shadersluminance:()=>DR,_shadersmaterial:()=>D1,_shadersmaterialInput:()=>R1,_shadersmaximumComponent:()=>RR,_shadersmetersPerPixel:()=>OR,_shadersmodelMaterial:()=>O1,_shadersmodelToWindowCoordinates:()=>MR,_shadersmodelVertexOutput:()=>M1,_shadersmultiplyWithColorBalance:()=>NR,_shadersnearFarScalar:()=>LR,_shadersoctDecode:()=>FR,_shadersoneOverPi:()=>JD,_shadersoneOverTwoPi:()=>ZD,_shaderspackDepth:()=>BR,_shaderspassCesium3DTile:()=>QD,_shaderspassCesium3DTileClassification:()=>e1,_shaderspassCesium3DTileClassificationIgnoreShow:()=>t1,_shaderspassCesium3DTileEdges:()=>n1,_shaderspassCesium3DTileEdgesDirect:()=>i1,_shaderspassCesium3DTilePlanarFillId:()=>r1,_shaderspassClassification:()=>o1,_shaderspassCompute:()=>s1,_shaderspassEnvironment:()=>a1,_shaderspassGaussianSplats:()=>c1,_shaderspassGlobe:()=>l1,_shaderspassOpaque:()=>u1,_shaderspassOverlay:()=>f1,_shaderspassTerrainClassification:()=>d1,_shaderspassTranslucent:()=>h1,_shaderspassVoxels:()=>m1,_shaderspbrLighting:()=>kR,_shaderspbrNeutralTonemapping:()=>UR,_shadersphong:()=>zR,_shaderspi:()=>p1,_shaderspiOverFour:()=>g1,_shaderspiOverSix:()=>_1,_shaderspiOverThree:()=>y1,_shaderspiOverTwo:()=>A1,_shadersplaneDistance:()=>VR,_shaderspointAlongRay:()=>jR,_shadersradiansPerDegree:()=>b1,_shadersray:()=>N1,_shadersrayEllipsoidIntersectionInterval:()=>HR,_shadersraySegment:()=>L1,_shadersraySphereIntersectionInterval:()=>GR,_shadersreadDepth:()=>WR,_shadersreadNonPerspective:()=>qR,_shadersreverseLogDepth:()=>YR,_shadersround:()=>JR,_shaderssaturation:()=>ZR,_shaderssceneMode2D:()=>x1,_shaderssceneMode3D:()=>T1,_shaderssceneModeColumbusView:()=>E1,_shaderssceneModeMorphing:()=>C1,_shadersshadowDepthCompare:()=>QR,_shadersshadowParameters:()=>F1,_shadersshadowVisibility:()=>eO,_shaderssignNotZero:()=>tO,_shaderssolarRadius:()=>v1,_shaderssphericalHarmonics:()=>nO,_shaderssrgbToLinear:()=>iO,_shaderstangentToEyeSpaceMatrix:()=>rO,_shaderstextureCube:()=>oO,_shadersthreePiOver2:()=>S1,_shaderstransformPlane:()=>sO,_shaderstranslateRelativeToEye:()=>aO,_shaderstranslucentPhong:()=>cO,_shaderstranspose:()=>lO,_shaderstwoPi:()=>w1,_shadersunpackDepth:()=>uO,_shadersunpackFloat:()=>fO,_shadersunpackTexture:()=>dO,_shadersunpackUint:()=>hO,_shadersvalueTransform:()=>mO,_shadersvertexLogDepth:()=>pO,_shaderswebMercatorMaxLatitude:()=>I1,_shaderswindowToEyeCoordinates:()=>gO,_shaderswriteDepthClamp:()=>_O,_shaderswriteLogDepth:()=>yO,_shaderswriteNonPerspective:()=>AO,addAllToArray:()=>Zn,addBuffer:()=>AF,addDefaults:()=>dF,addExtensionsRequired:()=>gF,addExtensionsUsed:()=>Jd,addPipelineExtras:()=>_A,addToArray:()=>Ta,appendForwardSlash:()=>cD,arrayRemoveDuplicates:()=>Fr,assert:()=>OX,barycentricCoordinates:()=>dx,binarySearch:()=>vr,buildModuleUrl:()=>Zt,buildVectorGltfFromMVT:()=>W4,buildVoxelCustomShader:()=>bI,buildVoxelDrawCommands:()=>Xz,clone:()=>Je,combine:()=>Ot,computeFlyToLocationForRectangle:()=>TE,createBillboardPointCallback:()=>QT,createColorRamp:()=>wz,createCommand:()=>Rn,createDefaultImageryProviderViewModels:()=>k8,createDefaultTerrainProviderViewModels:()=>U8,createElevationBandMaterial:()=>xce,createGooglePhotorealistic3DTileset:()=>Tce,createGuid:()=>Kn,createMaterialPropertyDescriptor:()=>ro,createOsmBuildingsAsync:()=>Ece,createPropertyDescriptor:()=>me,createRawPropertyDescriptor:()=>$l,createTangentSpaceDebugPrimitive:()=>Cce,createTaskProcessorWorker:()=>Ile,createUniform:()=>xD,createUniformArray:()=>TD,createVectorTileBuffersFromModelComponents:()=>zk,createWorldBathymetryAsync:()=>F4,createWorldImageryAsync:()=>c_,createWorldTerrainAsync:()=>UC,decodeGoogleEarthEnterpriseData:()=>B4,decodeMVT:()=>e8,decodeVectorPolylinePositions:()=>Rk,defaultPickWorldPosition:()=>_p,defer:()=>Pu,defined:()=>l,demodernizeShader:()=>xO,deprecationWarning:()=>qr,destroyObject:()=>le,exportKml:()=>Koe,findAccessorMinMax:()=>PT,findContentMetadata:()=>aE,findGroupMetadata:()=>cE,findMeshoptExtension:()=>pA,findTileMetadata:()=>Kk,forEachTextureInMaterial:()=>qS,formatError:()=>Fp,freezeRenderState:()=>TY,getAbsoluteUri:()=>Cd,getAccessorByteStride:()=>ju,getBaseUri:()=>lD,getBinaryAccessor:()=>Qd,getClipAndStyleCode:()=>mV,getClippingFunction:()=>EE,getComponentReader:()=>qg,getElement:()=>Ln,getExtensionFromUri:()=>rg,getFilenameFromUri:()=>$_,getImageFromTypedArray:()=>Iz,getImagePixels:()=>kh,getJsonFromTypedArray:()=>No,getMagic:()=>bm,getMeshPrimitives:()=>VF,getMetadataClassProperty:()=>rV,getMetadataProperty:()=>sV,getStringFromTypedArray:()=>Gu,getTimestamp:()=>xn,hasExtension:()=>rr,heightReferenceOnEntityPropertyChanged:()=>Og,isBitSet:()=>Pl,isBlobUri:()=>nx,isCrossOriginUrl:()=>Dy,isDataUri:()=>Uh,isLeapYear:()=>kl,knockout:()=>ve,knockout_3_5_1:()=>$C,knockout_es5:()=>x8,loadAndExecuteScript:()=>ix,loadCubeMap:()=>DO,loadImageFromTypedArray:()=>$g,loadKTX2:()=>Ou,mergeSort:()=>b0,mostDetailedSurfaceHeight:()=>Jh,moveTechniqueRenderStates:()=>pF,moveTechniquesToExtension:()=>_F,numberOfComponentsForType:()=>Hf,objectToQuery:()=>rx,oneTimeWarning:()=>_t,parseBatchTable:()=>e_,parseFeatureMetadataLegacy:()=>uF,parseGlb:()=>IT,parseResponseHeaders:()=>uD,parseStructuralMetadata:()=>lF,pickModel:()=>Nw,pointInsideTriangle:()=>Jae,positionForSurfaceHeight:()=>Eg,preprocess3DTileContent:()=>v_,processVoxelProperties:()=>Oz,queryToObject:()=>Ef,readAccessorPacked:()=>bF,removeExtension:()=>DT,removeExtensionsRequired:()=>hF,removeExtensionsUsed:()=>wT,removePipelineExtras:()=>mF,removeUnusedElements:()=>yF,renderBufferPointCollection:()=>Lk,renderBufferPolygonCollection:()=>ZL,renderBufferPolylineCollection:()=>kk,resizeImageToNextPowerOfTwo:()=>yA,sampleTerrain:()=>N3,sampleTerrainMostDetailed:()=>xE,scaleToGeodeticSurface:()=>tx,srgbToLinear:()=>jC,subdivideArray:()=>rN,subscribeAndEvaluate:()=>Cc,updateAccessorComponentTypes:()=>xF,updateVersion:()=>TF,usesExtension:()=>Wo,viewerCesium3DTilesInspectorMixin:()=>Xle,viewerCesiumInspectorMixin:()=>Kle,viewerDragDropMixin:()=>Jle,viewerPerformanceWatchdogMixin:()=>Zle,viewerVoxelInspectorMixin:()=>eue,webGLConstantToGlslType:()=>sce,wrapFunction:()=>G4,writeTextToCanvas:()=>Bx});module.exports=Fh(D9t);function O3e(e){return e!=null}var l=O3e;function Qb(e){this.name="DeveloperError",this.message=e;let t;try{throw new Error}catch(n){t=n.stack}this.stack=t}l(Object.create)&&(Qb.prototype=Object.create(Error.prototype),Qb.prototype.constructor=Qb);Qb.prototype.toString=function(){let e=`${this.name}: ${this.message}`;return l(this.stack)&&(e+=` +${this.stack.toString()}`),e};Qb.throwInstantiationError=function(){throw new Qb("This function defines an interface and should not be called directly.")};var pe=Qb;var ha={};ha.typeOf={};function M3e(e){return`${e} is required, actual value was undefined`}function nv(e,t,n){return`Expected ${n} to be typeof ${t}, actual typeof was ${e}`}ha.defined=function(e,t){if(!l(t))throw new pe(M3e(e))};ha.typeOf.func=function(e,t){if(typeof t!="function")throw new pe(nv(typeof t,"function",e))};ha.typeOf.string=function(e,t){if(typeof t!="string")throw new pe(nv(typeof t,"string",e))};ha.typeOf.number=function(e,t){if(typeof t!="number")throw new pe(nv(typeof t,"number",e))};ha.typeOf.number.lessThan=function(e,t,n){if(ha.typeOf.number(e,t),t>=n)throw new pe(`Expected ${e} to be less than ${n}, actual value was ${t}`)};ha.typeOf.number.lessThanOrEquals=function(e,t,n){if(ha.typeOf.number(e,t),t>n)throw new pe(`Expected ${e} to be less than or equal to ${n}, actual value was ${t}`)};ha.typeOf.number.greaterThan=function(e,t,n){if(ha.typeOf.number(e,t),t<=n)throw new pe(`Expected ${e} to be greater than ${n}, actual value was ${t}`)};ha.typeOf.number.greaterThanOrEquals=function(e,t,n){if(ha.typeOf.number(e,t),t<n)throw new pe(`Expected ${e} to be greater than or equal to ${n}, actual value was ${t}`)};ha.typeOf.object=function(e,t){if(typeof t!="object")throw new pe(nv(typeof t,"object",e))};ha.typeOf.bool=function(e,t){if(typeof t!="boolean")throw new pe(nv(typeof t,"boolean",e))};ha.typeOf.bigint=function(e,t){if(typeof t!="bigint")throw new pe(nv(typeof t,"bigint",e))};ha.typeOf.number.equals=function(e,t,n,i){if(ha.typeOf.number(e,n),ha.typeOf.number(t,i),n!==i)throw new pe(`${e} must be equal to ${t}, the actual values are ${n} and ${i}`)};var Wr=ha;var Mq=Qo(mj(),1);var yt={};yt.EPSILON1=.1;yt.EPSILON2=.01;yt.EPSILON3=.001;yt.EPSILON4=1e-4;yt.EPSILON5=1e-5;yt.EPSILON6=1e-6;yt.EPSILON7=1e-7;yt.EPSILON8=1e-8;yt.EPSILON9=1e-9;yt.EPSILON10=1e-10;yt.EPSILON11=1e-11;yt.EPSILON12=1e-12;yt.EPSILON13=1e-13;yt.EPSILON14=1e-14;yt.EPSILON15=1e-15;yt.EPSILON16=1e-16;yt.EPSILON17=1e-17;yt.EPSILON18=1e-18;yt.EPSILON19=1e-19;yt.EPSILON20=1e-20;yt.EPSILON21=1e-21;yt.GRAVITATIONALPARAMETER=3986004418e5;yt.SOLAR_RADIUS=6955e5;yt.LUNAR_RADIUS=1737400;yt.SIXTY_FOUR_KILOBYTES=64*1024;yt.FOUR_GIGABYTES=4*1024*1024*1024;yt.sign=Math.sign??function(t){return t=+t,t===0||t!==t?t:t>0?1:-1};yt.signNotZero=function(e){return e<0?-1:1};yt.toSNorm=function(e,t){return t=t??255,Math.round((yt.clamp(e,-1,1)*.5+.5)*t)};yt.fromSNorm=function(e,t){return t=t??255,yt.clamp(e,0,t)/t*2-1};yt.normalize=function(e,t,n){return n=Math.max(n-t,0),n===0?0:yt.clamp((e-t)/n,0,1)};yt.sinh=Math.sinh??function(t){return(Math.exp(t)-Math.exp(-t))/2};yt.cosh=Math.cosh??function(t){return(Math.exp(t)+Math.exp(-t))/2};yt.lerp=function(e,t,n){return(1-n)*e+n*t};yt.smoothDamp=function(e,t,n,i=0,r=Number.POSITIVE_INFINITY,o=1e-4,s={}){o=Math.max(1e-4,o);let a=2/o,c=a*i,u=1/(1+c+.48*c*c+.235*c*c*c),f=r*o,d=e-t;d=yt.clamp(d,-f,f);let p=e-d,g=(n+a*d)*i;return n=(n-a*g)*u,s.value=p+(d+g)*u,s.velocity=n,s};yt.PI=Math.PI;yt.ONE_OVER_PI=1/Math.PI;yt.PI_OVER_TWO=Math.PI/2;yt.PI_OVER_THREE=Math.PI/3;yt.PI_OVER_FOUR=Math.PI/4;yt.PI_OVER_SIX=Math.PI/6;yt.THREE_PI_OVER_TWO=3*Math.PI/2;yt.TWO_PI=2*Math.PI;yt.ONE_OVER_TWO_PI=1/(2*Math.PI);yt.RADIANS_PER_DEGREE=Math.PI/180;yt.DEGREES_PER_RADIAN=180/Math.PI;yt.RADIANS_PER_ARCSECOND=yt.RADIANS_PER_DEGREE/3600;yt.toRadians=function(e){return e*yt.RADIANS_PER_DEGREE};yt.toDegrees=function(e){return e*yt.DEGREES_PER_RADIAN};yt.convertLongitudeRange=function(e){let t=yt.TWO_PI,n=e-Math.floor(e/t)*t;return n<-Math.PI?n+t:n>=Math.PI?n-t:n};yt.clampToLatitudeRange=function(e){return yt.clamp(e,-1*yt.PI_OVER_TWO,yt.PI_OVER_TWO)};yt.negativePiToPi=function(e){return e>=-yt.PI&&e<=yt.PI?e:yt.zeroToTwoPi(e+yt.PI)-yt.PI};yt.zeroToTwoPi=function(e){if(e>=0&&e<=yt.TWO_PI)return e;let t=yt.mod(e,yt.TWO_PI);return Math.abs(t)<yt.EPSILON14&&Math.abs(e)>yt.EPSILON14?yt.TWO_PI:t};yt.mod=function(e,t){return yt.sign(e)===yt.sign(t)&&Math.abs(e)<Math.abs(t)?e:(e%t+t)%t};yt.equalsEpsilon=function(e,t,n,i){n=n??0,i=i??n;let r=Math.abs(e-t);return r<=i||r<=n*Math.max(Math.abs(e),Math.abs(t))};yt.lessThan=function(e,t,n){return e-t<-n};yt.lessThanOrEquals=function(e,t,n){return e-t<n};yt.greaterThan=function(e,t,n){return e-t>n};yt.greaterThanOrEquals=function(e,t,n){return e-t>-n};var pj=[1];yt.factorial=function(e){let t=pj.length;if(e>=t){let n=pj[t-1];for(let i=t;i<=e;i++){let r=n*i;pj.push(r),n=r}}return pj[e]};yt.incrementWrap=function(e,t,n){return n=n??0,++e,e>t&&(e=n),e};yt.isPowerOfTwo=function(e){return e!==0&&(e&e-1)===0};yt.nextPowerOfTwo=function(e){return--e,e|=e>>1,e|=e>>2,e|=e>>4,e|=e>>8,e|=e>>16,++e,e};yt.previousPowerOfTwo=function(e){return e|=e>>1,e|=e>>2,e|=e>>4,e|=e>>8,e|=e>>16,e|=e>>32,e=(e>>>0)-(e>>>1),e};yt.clamp=function(e,t,n){return e<t?t:e>n?n:e};var iue=new Mq.default;yt.setRandomNumberSeed=function(e){iue=new Mq.default(e)};yt.nextRandomNumber=function(){return iue.random()};yt.randomBetween=function(e,t){return yt.nextRandomNumber()*(t-e)+e};yt.acosClamped=function(e){return Math.acos(yt.clamp(e,-1,1))};yt.asinClamped=function(e){return Math.asin(yt.clamp(e,-1,1))};yt.chordLength=function(e,t){return 2*t*Math.sin(e*.5)};yt.logBase=function(e,t){return Math.log(e)/Math.log(t)};yt.cbrt=Math.cbrt??function(t){let n=Math.pow(Math.abs(t),.3333333333333333);return t<0?-n:n};yt.log2=Math.log2??function(t){return Math.log(t)*Math.LOG2E};yt.fog=function(e,t){let n=e*t;return 1-Math.exp(-(n*n))};yt.fastApproximateAtan=function(e){return e*(-.1784*Math.abs(e)-.0663*e*e+1.0301)};yt.fastApproximateAtan2=function(e,t){let n,i=Math.abs(e);n=Math.abs(t);let r=Math.max(i,n);n=Math.min(i,n);let o=n/r;return i=yt.fastApproximateAtan(o),i=Math.abs(t)>Math.abs(e)?yt.PI_OVER_TWO-i:i,i=e<0?yt.PI-i:i,i=t<0?-i:i,i};var D=yt;var po=class e{constructor(t,n,i){this.x=t??0,this.y=n??0,this.z=i??0}static fromSpherical(t,n){l(n)||(n=new e);let i=t.clock,r=t.cone,o=t.magnitude??1,s=o*Math.sin(r);return n.x=s*Math.cos(i),n.y=s*Math.sin(i),n.z=o*Math.cos(r),n}static fromElements(t,n,i,r){return l(r)?(r.x=t,r.y=n,r.z=i,r):new e(t,n,i)}static clone(t,n){if(l(t))return l(n)?(n.x=t.x,n.y=t.y,n.z=t.z,n):new e(t.x,t.y,t.z)}static pack(t,n,i){return i=i??0,n[i++]=t.x,n[i++]=t.y,n[i]=t.z,n}static unpack(t,n,i){return n=n??0,l(i)||(i=new e),i.x=t[n++],i.y=t[n++],i.z=t[n],i}static packArray(t,n){let i=t.length,r=i*3;l(n)?!Array.isArray(n)&&n.length!==r||n.length!==r&&(n.length=r):n=new Array(r);for(let o=0;o<i;++o)e.pack(t[o],n,o*3);return n}static unpackArray(t,n){let i=t.length;l(n)?n.length=i/3:n=new Array(i/3);for(let r=0;r<i;r+=3){let o=r/3;n[o]=e.unpack(t,r,n[o])}return n}static maximumComponent(t){return Math.max(t.x,t.y,t.z)}static minimumComponent(t){return Math.min(t.x,t.y,t.z)}static minimumByComponent(t,n,i){return i.x=Math.min(t.x,n.x),i.y=Math.min(t.y,n.y),i.z=Math.min(t.z,n.z),i}static maximumByComponent(t,n,i){return i.x=Math.max(t.x,n.x),i.y=Math.max(t.y,n.y),i.z=Math.max(t.z,n.z),i}static clamp(t,n,i,r){let o=D.clamp(t.x,n.x,i.x),s=D.clamp(t.y,n.y,i.y),a=D.clamp(t.z,n.z,i.z);return r.x=o,r.y=s,r.z=a,r}static magnitudeSquared(t){return t.x*t.x+t.y*t.y+t.z*t.z}static magnitude(t){return Math.sqrt(e.magnitudeSquared(t))}static distance(t,n){return e.subtract(t,n,gj),e.magnitude(gj)}static distanceSquared(t,n){return e.subtract(t,n,gj),e.magnitudeSquared(gj)}static normalize(t,n){let i=e.magnitude(t);return n.x=t.x/i,n.y=t.y/i,n.z=t.z/i,n}static dot(t,n){return t.x*n.x+t.y*n.y+t.z*n.z}static multiplyComponents(t,n,i){return i.x=t.x*n.x,i.y=t.y*n.y,i.z=t.z*n.z,i}static divideComponents(t,n,i){return i.x=t.x/n.x,i.y=t.y/n.y,i.z=t.z/n.z,i}static add(t,n,i){return i.x=t.x+n.x,i.y=t.y+n.y,i.z=t.z+n.z,i}static subtract(t,n,i){return i.x=t.x-n.x,i.y=t.y-n.y,i.z=t.z-n.z,i}static multiplyByScalar(t,n,i){return i.x=t.x*n,i.y=t.y*n,i.z=t.z*n,i}static divideByScalar(t,n,i){return i.x=t.x/n,i.y=t.y/n,i.z=t.z/n,i}static negate(t,n){return n.x=-t.x,n.y=-t.y,n.z=-t.z,n}static abs(t,n){return n.x=Math.abs(t.x),n.y=Math.abs(t.y),n.z=Math.abs(t.z),n}static lerp(t,n,i,r){return e.multiplyByScalar(n,i,rue),r=e.multiplyByScalar(t,1-i,r),e.add(rue,r,r)}static angleBetween(t,n){e.normalize(t,_j),e.normalize(n,Nq);let i=e.dot(_j,Nq),r=e.magnitude(e.cross(_j,Nq,_j));return Math.atan2(r,i)}static mostOrthogonalAxis(t,n){let i=e.normalize(t,N3e);return e.abs(i,i),i.x<=i.y?i.x<=i.z?n=e.clone(e.UNIT_X,n):n=e.clone(e.UNIT_Z,n):i.y<=i.z?n=e.clone(e.UNIT_Y,n):n=e.clone(e.UNIT_Z,n),n}static projectVector(t,n,i){let r=e.dot(t,n)/e.dot(n,n);return e.multiplyByScalar(n,r,i)}static equals(t,n){return t===n||l(t)&&l(n)&&t.x===n.x&&t.y===n.y&&t.z===n.z}static equalsArray(t,n,i){return t.x===n[i]&&t.y===n[i+1]&&t.z===n[i+2]}static equalsEpsilon(t,n,i,r){return t===n||l(t)&&l(n)&&D.equalsEpsilon(t.x,n.x,i,r)&&D.equalsEpsilon(t.y,n.y,i,r)&&D.equalsEpsilon(t.z,n.z,i,r)}static cross(t,n,i){let r=t.x,o=t.y,s=t.z,a=n.x,c=n.y,u=n.z,f=o*u-s*c,d=s*a-r*u,p=r*c-o*a;return i.x=f,i.y=d,i.z=p,i}static midpoint(t,n,i){return i.x=(t.x+n.x)*.5,i.y=(t.y+n.y)*.5,i.z=(t.z+n.z)*.5,i}static fromDegrees(t,n,i,r,o){return t=D.toRadians(t),n=D.toRadians(n),e.fromRadians(t,n,i,r,o)}static fromRadians(t,n,i,r,o){i=i??0;let s=l(r)?r.radiiSquared:e._ellipsoidRadiiSquared,a=Math.cos(n);xd.x=a*Math.cos(t),xd.y=a*Math.sin(t),xd.z=Math.sin(n),xd=e.normalize(xd,xd),e.multiplyComponents(s,xd,iv);let c=Math.sqrt(e.dot(xd,iv));return iv=e.divideByScalar(iv,c,iv),xd=e.multiplyByScalar(xd,i,xd),l(o)||(o=new e),e.add(iv,xd,o)}static fromDegreesArray(t,n,i){let r=t.length;l(i)?i.length=r/2:i=new Array(r/2);for(let o=0;o<r;o+=2){let s=t[o],a=t[o+1],c=o/2;i[c]=e.fromDegrees(s,a,0,n,i[c])}return i}static fromRadiansArray(t,n,i){let r=t.length;l(i)?i.length=r/2:i=new Array(r/2);for(let o=0;o<r;o+=2){let s=t[o],a=t[o+1],c=o/2;i[c]=e.fromRadians(s,a,0,n,i[c])}return i}static fromDegreesArrayHeights(t,n,i){let r=t.length;l(i)?i.length=r/3:i=new Array(r/3);for(let o=0;o<r;o+=3){let s=t[o],a=t[o+1],c=t[o+2],u=o/3;i[u]=e.fromDegrees(s,a,c,n,i[u])}return i}static fromRadiansArrayHeights(t,n,i){let r=t.length;l(i)?i.length=r/3:i=new Array(r/3);for(let o=0;o<r;o+=3){let s=t[o],a=t[o+1],c=t[o+2],u=o/3;i[u]=e.fromRadians(s,a,c,n,i[u])}return i}clone(t){return e.clone(this,t)}equals(t){return e.equals(this,t)}equalsEpsilon(t,n,i){return e.equalsEpsilon(this,t,n,i)}toString(){return`(${this.x}, ${this.y}, ${this.z})`}};po.fromCartesian4=po.clone;po.packedLength=3;po.fromArray=po.unpack;var gj=new po,rue=new po,_j=new po,Nq=new po,N3e=new po,xd=new po,iv=new po;po._ellipsoidRadiiSquared=new po(6378137*6378137,6378137*6378137,6356752314245179e-9*6356752314245179e-9);po.ZERO=Object.freeze(new po(0,0,0));po.ONE=Object.freeze(new po(1,1,1));po.UNIT_X=Object.freeze(new po(1,0,0));po.UNIT_Y=Object.freeze(new po(0,1,0));po.UNIT_Z=Object.freeze(new po(0,0,1));var h=po;var Js=class e{constructor(t,n,i,r){this.x=t??0,this.y=n??0,this.z=i??0,this.w=r??0}static fromElements(t,n,i,r,o){return l(o)?(o.x=t,o.y=n,o.z=i,o.w=r,o):new e(t,n,i,r)}static fromColor(t,n){return l(n)?(n.x=t.red,n.y=t.green,n.z=t.blue,n.w=t.alpha,n):new e(t.red,t.green,t.blue,t.alpha)}static clone(t,n){if(l(t))return l(n)?(n.x=t.x,n.y=t.y,n.z=t.z,n.w=t.w,n):new e(t.x,t.y,t.z,t.w)}static pack(t,n,i){return i=i??0,n[i++]=t.x,n[i++]=t.y,n[i++]=t.z,n[i]=t.w,n}static unpack(t,n,i){return n=n??0,l(i)||(i=new e),i.x=t[n++],i.y=t[n++],i.z=t[n++],i.w=t[n],i}static packArray(t,n){let i=t.length,r=i*4;l(n)?!Array.isArray(n)&&n.length!==r||n.length!==r&&(n.length=r):n=new Array(r);for(let o=0;o<i;++o)e.pack(t[o],n,o*4);return n}static unpackArray(t,n){let i=t.length;l(n)?n.length=i/4:n=new Array(i/4);for(let r=0;r<i;r+=4){let o=r/4;n[o]=e.unpack(t,r,n[o])}return n}static maximumComponent(t){return Math.max(t.x,t.y,t.z,t.w)}static minimumComponent(t){return Math.min(t.x,t.y,t.z,t.w)}static minimumByComponent(t,n,i){return i.x=Math.min(t.x,n.x),i.y=Math.min(t.y,n.y),i.z=Math.min(t.z,n.z),i.w=Math.min(t.w,n.w),i}static maximumByComponent(t,n,i){return i.x=Math.max(t.x,n.x),i.y=Math.max(t.y,n.y),i.z=Math.max(t.z,n.z),i.w=Math.max(t.w,n.w),i}static clamp(t,n,i,r){let o=D.clamp(t.x,n.x,i.x),s=D.clamp(t.y,n.y,i.y),a=D.clamp(t.z,n.z,i.z),c=D.clamp(t.w,n.w,i.w);return r.x=o,r.y=s,r.z=a,r.w=c,r}static magnitudeSquared(t){return t.x*t.x+t.y*t.y+t.z*t.z+t.w*t.w}static magnitude(t){return Math.sqrt(e.magnitudeSquared(t))}static distance(t,n){return e.subtract(t,n,yj),e.magnitude(yj)}static distanceSquared(t,n){return e.subtract(t,n,yj),e.magnitudeSquared(yj)}static normalize(t,n){let i=e.magnitude(t);return n.x=t.x/i,n.y=t.y/i,n.z=t.z/i,n.w=t.w/i,n}static dot(t,n){return t.x*n.x+t.y*n.y+t.z*n.z+t.w*n.w}static multiplyComponents(t,n,i){return i.x=t.x*n.x,i.y=t.y*n.y,i.z=t.z*n.z,i.w=t.w*n.w,i}static divideComponents(t,n,i){return i.x=t.x/n.x,i.y=t.y/n.y,i.z=t.z/n.z,i.w=t.w/n.w,i}static add(t,n,i){return i.x=t.x+n.x,i.y=t.y+n.y,i.z=t.z+n.z,i.w=t.w+n.w,i}static subtract(t,n,i){return i.x=t.x-n.x,i.y=t.y-n.y,i.z=t.z-n.z,i.w=t.w-n.w,i}static multiplyByScalar(t,n,i){return i.x=t.x*n,i.y=t.y*n,i.z=t.z*n,i.w=t.w*n,i}static divideByScalar(t,n,i){return i.x=t.x/n,i.y=t.y/n,i.z=t.z/n,i.w=t.w/n,i}static negate(t,n){return n.x=-t.x,n.y=-t.y,n.z=-t.z,n.w=-t.w,n}static abs(t,n){return n.x=Math.abs(t.x),n.y=Math.abs(t.y),n.z=Math.abs(t.z),n.w=Math.abs(t.w),n}static lerp(t,n,i,r){return e.multiplyByScalar(n,i,oue),r=e.multiplyByScalar(t,1-i,r),e.add(oue,r,r)}static mostOrthogonalAxis(t,n){let i=e.normalize(t,L3e);return e.abs(i,i),i.x<=i.y?i.x<=i.z?i.x<=i.w?n=e.clone(e.UNIT_X,n):n=e.clone(e.UNIT_W,n):i.z<=i.w?n=e.clone(e.UNIT_Z,n):n=e.clone(e.UNIT_W,n):i.y<=i.z?i.y<=i.w?n=e.clone(e.UNIT_Y,n):n=e.clone(e.UNIT_W,n):i.z<=i.w?n=e.clone(e.UNIT_Z,n):n=e.clone(e.UNIT_W,n),n}static equals(t,n){return t===n||l(t)&&l(n)&&t.x===n.x&&t.y===n.y&&t.z===n.z&&t.w===n.w}static equalsArray(t,n,i){return t.x===n[i]&&t.y===n[i+1]&&t.z===n[i+2]&&t.w===n[i+3]}static equalsEpsilon(t,n,i,r){return t===n||l(t)&&l(n)&&D.equalsEpsilon(t.x,n.x,i,r)&&D.equalsEpsilon(t.y,n.y,i,r)&&D.equalsEpsilon(t.z,n.z,i,r)&&D.equalsEpsilon(t.w,n.w,i,r)}clone(t){return e.clone(this,t)}equals(t){return e.equals(this,t)}equalsEpsilon(t,n,i){return e.equalsEpsilon(this,t,n,i)}toString(){return`(${this.x}, ${this.y}, ${this.z}, ${this.w})`}static packFloat(t,n){return l(n)||(n=new e),Lq[0]=t,sue?(n.x=qc[0],n.y=qc[1],n.z=qc[2],n.w=qc[3]):(n.x=qc[3],n.y=qc[2],n.z=qc[1],n.w=qc[0]),n}static unpackFloat(t){return sue?(qc[0]=t.x,qc[1]=t.y,qc[2]=t.z,qc[3]=t.w):(qc[0]=t.w,qc[1]=t.z,qc[2]=t.y,qc[3]=t.x),Lq[0]}};Js.packedLength=4;Js.fromArray=Js.unpack;var yj=new Js,oue=new Js,L3e=new Js;Js.ZERO=Object.freeze(new Js(0,0,0,0));Js.ONE=Object.freeze(new Js(1,1,1,1));Js.UNIT_X=Object.freeze(new Js(1,0,0,0));Js.UNIT_Y=Object.freeze(new Js(0,1,0,0));Js.UNIT_Z=Object.freeze(new Js(0,0,1,0));Js.UNIT_W=Object.freeze(new Js(0,0,0,1));var Lq=new Float32Array(1),qc=new Uint8Array(Lq.buffer),F3e=new Uint32Array([287454020]),B3e=new Uint8Array(F3e.buffer),sue=B3e[0]===68,se=Js;var Fq={};Fq.EMPTY_OBJECT=Object.freeze({});Fq.EMPTY_ARRAY=Object.freeze([]);var H=Fq;var k3e=Object.freeze([NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN]),br=class e{constructor(t,n,i,r,o,s,a,c,u){let f=Reflect.construct(Array,k3e,new.target);return f[0]=t??0,f[1]=r??0,f[2]=a??0,f[3]=n??0,f[4]=o??0,f[5]=c??0,f[6]=i??0,f[7]=s??0,f[8]=u??0,f}static pack(t,n,i){return i=i??0,n[i++]=t[0],n[i++]=t[1],n[i++]=t[2],n[i++]=t[3],n[i++]=t[4],n[i++]=t[5],n[i++]=t[6],n[i++]=t[7],n[i]=t[8],n}static unpack(t,n,i){return n=n??0,l(i)||(i=new e),i[0]=t[n++],i[1]=t[n++],i[2]=t[n++],i[3]=t[n++],i[4]=t[n++],i[5]=t[n++],i[6]=t[n++],i[7]=t[n++],i[8]=t[n],i}static packArray(t,n){let i=t.length,r=i*9;l(n)?!Array.isArray(n)&&n.length!==r||n.length!==r&&(n.length=r):n=new Array(r);for(let o=0;o<i;++o)e.pack(t[o],n,o*9);return n}static unpackArray(t,n){let i=t.length;l(n)?n.length=i/9:n=new Array(i/9);for(let r=0;r<i;r+=9){let o=r/9;n[o]=e.unpack(t,r,n[o])}return n}static clone(t,n){if(l(t))return l(n)?(n[0]=t[0],n[1]=t[1],n[2]=t[2],n[3]=t[3],n[4]=t[4],n[5]=t[5],n[6]=t[6],n[7]=t[7],n[8]=t[8],n):new e(t[0],t[3],t[6],t[1],t[4],t[7],t[2],t[5],t[8])}static fromColumnMajorArray(t,n){return e.clone(t,n)}static fromRowMajorArray(t,n){return l(n)?(n[0]=t[0],n[1]=t[3],n[2]=t[6],n[3]=t[1],n[4]=t[4],n[5]=t[7],n[6]=t[2],n[7]=t[5],n[8]=t[8],n):new e(t[0],t[1],t[2],t[3],t[4],t[5],t[6],t[7],t[8])}static fromQuaternion(t,n){let i=t.x*t.x,r=t.x*t.y,o=t.x*t.z,s=t.x*t.w,a=t.y*t.y,c=t.y*t.z,u=t.y*t.w,f=t.z*t.z,d=t.z*t.w,p=t.w*t.w,g=i-a-f+p,m=2*(r-d),y=2*(o+u),A=2*(r+d),b=-i+a-f+p,x=2*(c-s),T=2*(o-u),E=2*(c+s),v=-i-a+f+p;return l(n)?(n[0]=g,n[1]=A,n[2]=T,n[3]=m,n[4]=b,n[5]=E,n[6]=y,n[7]=x,n[8]=v,n):new e(g,m,y,A,b,x,T,E,v)}static fromHeadingPitchRoll(t,n){let i=Math.cos(-t.pitch),r=Math.cos(-t.heading),o=Math.cos(t.roll),s=Math.sin(-t.pitch),a=Math.sin(-t.heading),c=Math.sin(t.roll),u=i*r,f=-o*a+c*s*r,d=c*a+o*s*r,p=i*a,g=o*r+c*s*a,m=-c*r+o*s*a,y=-s,A=c*i,b=o*i;return l(n)?(n[0]=u,n[1]=p,n[2]=y,n[3]=f,n[4]=g,n[5]=A,n[6]=d,n[7]=m,n[8]=b,n):new e(u,f,d,p,g,m,y,A,b)}static fromScale(t,n){return l(n)?(n[0]=t.x,n[1]=0,n[2]=0,n[3]=0,n[4]=t.y,n[5]=0,n[6]=0,n[7]=0,n[8]=t.z,n):new e(t.x,0,0,0,t.y,0,0,0,t.z)}static fromUniformScale(t,n){return l(n)?(n[0]=t,n[1]=0,n[2]=0,n[3]=0,n[4]=t,n[5]=0,n[6]=0,n[7]=0,n[8]=t,n):new e(t,0,0,0,t,0,0,0,t)}static fromCrossProduct(t,n){return l(n)?(n[0]=0,n[1]=t.z,n[2]=-t.y,n[3]=-t.z,n[4]=0,n[5]=t.x,n[6]=t.y,n[7]=-t.x,n[8]=0,n):new e(0,-t.z,t.y,t.z,0,-t.x,-t.y,t.x,0)}static fromRotationX(t,n){let i=Math.cos(t),r=Math.sin(t);return l(n)?(n[0]=1,n[1]=0,n[2]=0,n[3]=0,n[4]=i,n[5]=r,n[6]=0,n[7]=-r,n[8]=i,n):new e(1,0,0,0,i,-r,0,r,i)}static fromRotationY(t,n){let i=Math.cos(t),r=Math.sin(t);return l(n)?(n[0]=i,n[1]=0,n[2]=-r,n[3]=0,n[4]=1,n[5]=0,n[6]=r,n[7]=0,n[8]=i,n):new e(i,0,r,0,1,0,-r,0,i)}static fromRotationZ(t,n){let i=Math.cos(t),r=Math.sin(t);return l(n)?(n[0]=i,n[1]=r,n[2]=0,n[3]=-r,n[4]=i,n[5]=0,n[6]=0,n[7]=0,n[8]=1,n):new e(i,-r,0,r,i,0,0,0,1)}static toArray(t,n){return l(n)?(n[0]=t[0],n[1]=t[1],n[2]=t[2],n[3]=t[3],n[4]=t[4],n[5]=t[5],n[6]=t[6],n[7]=t[7],n[8]=t[8],n):[t[0],t[1],t[2],t[3],t[4],t[5],t[6],t[7],t[8]]}static getElementIndex(t,n){return t*3+n}static getColumn(t,n,i){let r=n*3,o=t[r],s=t[r+1],a=t[r+2];return i.x=o,i.y=s,i.z=a,i}static setColumn(t,n,i,r){r=e.clone(t,r);let o=n*3;return r[o]=i.x,r[o+1]=i.y,r[o+2]=i.z,r}static getRow(t,n,i){let r=t[n],o=t[n+3],s=t[n+6];return i.x=r,i.y=o,i.z=s,i}static setRow(t,n,i,r){return r=e.clone(t,r),r[n]=i.x,r[n+3]=i.y,r[n+6]=i.z,r}static setScale(t,n,i){let r=e.getScale(t,U3e),o=n.x/r.x,s=n.y/r.y,a=n.z/r.z;return i[0]=t[0]*o,i[1]=t[1]*o,i[2]=t[2]*o,i[3]=t[3]*s,i[4]=t[4]*s,i[5]=t[5]*s,i[6]=t[6]*a,i[7]=t[7]*a,i[8]=t[8]*a,i}static setUniformScale(t,n,i){let r=e.getScale(t,z3e),o=n/r.x,s=n/r.y,a=n/r.z;return i[0]=t[0]*o,i[1]=t[1]*o,i[2]=t[2]*o,i[3]=t[3]*s,i[4]=t[4]*s,i[5]=t[5]*s,i[6]=t[6]*a,i[7]=t[7]*a,i[8]=t[8]*a,i}static getScale(t,n){return n.x=h.magnitude(h.fromElements(t[0],t[1],t[2],Bq)),n.y=h.magnitude(h.fromElements(t[3],t[4],t[5],Bq)),n.z=h.magnitude(h.fromElements(t[6],t[7],t[8],Bq)),n}static getMaximumScale(t){return e.getScale(t,aue),h.maximumComponent(aue)}static setRotation(t,n,i){let r=e.getScale(t,V3e);return i[0]=n[0]*r.x,i[1]=n[1]*r.x,i[2]=n[2]*r.x,i[3]=n[3]*r.y,i[4]=n[4]*r.y,i[5]=n[5]*r.y,i[6]=n[6]*r.z,i[7]=n[7]*r.z,i[8]=n[8]*r.z,i}static getRotation(t,n){let i=e.getScale(t,j3e);return n[0]=t[0]/i.x,n[1]=t[1]/i.x,n[2]=t[2]/i.x,n[3]=t[3]/i.y,n[4]=t[4]/i.y,n[5]=t[5]/i.y,n[6]=t[6]/i.z,n[7]=t[7]/i.z,n[8]=t[8]/i.z,n}static multiply(t,n,i){let r=t[0]*n[0]+t[3]*n[1]+t[6]*n[2],o=t[1]*n[0]+t[4]*n[1]+t[7]*n[2],s=t[2]*n[0]+t[5]*n[1]+t[8]*n[2],a=t[0]*n[3]+t[3]*n[4]+t[6]*n[5],c=t[1]*n[3]+t[4]*n[4]+t[7]*n[5],u=t[2]*n[3]+t[5]*n[4]+t[8]*n[5],f=t[0]*n[6]+t[3]*n[7]+t[6]*n[8],d=t[1]*n[6]+t[4]*n[7]+t[7]*n[8],p=t[2]*n[6]+t[5]*n[7]+t[8]*n[8];return i[0]=r,i[1]=o,i[2]=s,i[3]=a,i[4]=c,i[5]=u,i[6]=f,i[7]=d,i[8]=p,i}static add(t,n,i){return i[0]=t[0]+n[0],i[1]=t[1]+n[1],i[2]=t[2]+n[2],i[3]=t[3]+n[3],i[4]=t[4]+n[4],i[5]=t[5]+n[5],i[6]=t[6]+n[6],i[7]=t[7]+n[7],i[8]=t[8]+n[8],i}static subtract(t,n,i){return i[0]=t[0]-n[0],i[1]=t[1]-n[1],i[2]=t[2]-n[2],i[3]=t[3]-n[3],i[4]=t[4]-n[4],i[5]=t[5]-n[5],i[6]=t[6]-n[6],i[7]=t[7]-n[7],i[8]=t[8]-n[8],i}static multiplyByVector(t,n,i){let r=n.x,o=n.y,s=n.z,a=t[0]*r+t[3]*o+t[6]*s,c=t[1]*r+t[4]*o+t[7]*s,u=t[2]*r+t[5]*o+t[8]*s;return i.x=a,i.y=c,i.z=u,i}static multiplyByScalar(t,n,i){return i[0]=t[0]*n,i[1]=t[1]*n,i[2]=t[2]*n,i[3]=t[3]*n,i[4]=t[4]*n,i[5]=t[5]*n,i[6]=t[6]*n,i[7]=t[7]*n,i[8]=t[8]*n,i}static multiplyByScale(t,n,i){return i[0]=t[0]*n.x,i[1]=t[1]*n.x,i[2]=t[2]*n.x,i[3]=t[3]*n.y,i[4]=t[4]*n.y,i[5]=t[5]*n.y,i[6]=t[6]*n.z,i[7]=t[7]*n.z,i[8]=t[8]*n.z,i}static multiplyByUniformScale(t,n,i){return i[0]=t[0]*n,i[1]=t[1]*n,i[2]=t[2]*n,i[3]=t[3]*n,i[4]=t[4]*n,i[5]=t[5]*n,i[6]=t[6]*n,i[7]=t[7]*n,i[8]=t[8]*n,i}static negate(t,n){return n[0]=-t[0],n[1]=-t[1],n[2]=-t[2],n[3]=-t[3],n[4]=-t[4],n[5]=-t[5],n[6]=-t[6],n[7]=-t[7],n[8]=-t[8],n}static transpose(t,n){let i=t[0],r=t[3],o=t[6],s=t[1],a=t[4],c=t[7],u=t[2],f=t[5],d=t[8];return n[0]=i,n[1]=r,n[2]=o,n[3]=s,n[4]=a,n[5]=c,n[6]=u,n[7]=f,n[8]=d,n}static computeEigenDecomposition(t,n){let i=D.EPSILON20,r=10,o=0,s=0;l(n)||(n={});let a=n.unitary=e.clone(e.IDENTITY,n.unitary),c=n.diagonal=e.clone(t,n.diagonal),u=i*G3e(c);for(;s<r&&W3e(c)>u;)q3e(c,Aj),e.transpose(Aj,cue),e.multiply(c,Aj,c),e.multiply(cue,c,c),e.multiply(a,Aj,a),++o>2&&(++s,o=0);return n}static abs(t,n){return n[0]=Math.abs(t[0]),n[1]=Math.abs(t[1]),n[2]=Math.abs(t[2]),n[3]=Math.abs(t[3]),n[4]=Math.abs(t[4]),n[5]=Math.abs(t[5]),n[6]=Math.abs(t[6]),n[7]=Math.abs(t[7]),n[8]=Math.abs(t[8]),n}static determinant(t){let n=t[0],i=t[3],r=t[6],o=t[1],s=t[4],a=t[7],c=t[2],u=t[5],f=t[8];return n*(s*f-u*a)+o*(u*r-i*f)+c*(i*a-s*r)}static inverse(t,n){let i=t[0],r=t[1],o=t[2],s=t[3],a=t[4],c=t[5],u=t[6],f=t[7],d=t[8],p=e.determinant(t);n[0]=a*d-f*c,n[1]=f*o-r*d,n[2]=r*c-a*o,n[3]=u*c-s*d,n[4]=i*d-u*o,n[5]=s*o-i*c,n[6]=s*f-u*a,n[7]=u*r-i*f,n[8]=i*a-s*r;let g=1/p;return e.multiplyByScalar(n,g,n)}static inverseTranspose(t,n){return e.inverse(e.transpose(t,H3e),n)}static equals(t,n){return t===n||l(t)&&l(n)&&t[0]===n[0]&&t[1]===n[1]&&t[2]===n[2]&&t[3]===n[3]&&t[4]===n[4]&&t[5]===n[5]&&t[6]===n[6]&&t[7]===n[7]&&t[8]===n[8]}static equalsEpsilon(t,n,i){return i=i??0,t===n||l(t)&&l(n)&&Math.abs(t[0]-n[0])<=i&&Math.abs(t[1]-n[1])<=i&&Math.abs(t[2]-n[2])<=i&&Math.abs(t[3]-n[3])<=i&&Math.abs(t[4]-n[4])<=i&&Math.abs(t[5]-n[5])<=i&&Math.abs(t[6]-n[6])<=i&&Math.abs(t[7]-n[7])<=i&&Math.abs(t[8]-n[8])<=i}get length(){return e.packedLength}clone(t){return e.clone(this,t)}equals(t){return e.equals(this,t)}static equalsArray(t,n,i){return t[0]===n[i]&&t[1]===n[i+1]&&t[2]===n[i+2]&&t[3]===n[i+3]&&t[4]===n[i+4]&&t[5]===n[i+5]&&t[6]===n[i+6]&&t[7]===n[i+7]&&t[8]===n[i+8]}equalsEpsilon(t,n){return e.equalsEpsilon(this,t,n)}toString(){return`(${this[0]}, ${this[3]}, ${this[6]}) (${this[1]}, ${this[4]}, ${this[7]}) -(${this[2]}, ${this[5]}, ${this[8]})`}};br.packedLength=9;br.fromArray=br.unpack;br.IDENTITY=new br(1,0,0,0,1,0,0,0,1);br.ZERO=new br(0,0,0,0,0,0,0,0,0);br.COLUMN0ROW0=0;br.COLUMN0ROW1=1;br.COLUMN0ROW2=2;br.COLUMN1ROW0=3;br.COLUMN1ROW1=4;br.COLUMN1ROW2=5;br.COLUMN2ROW0=6;br.COLUMN2ROW1=7;br.COLUMN2ROW2=8;var k3e=new h,U3e=new h,Bq=new h,aue=new h,z3e=new h,V3e=new h,Aj=new br,cue=new br,j3e=new br;function H3e(e){let t=0;for(let n=0;n<9;++n){let i=e[n];t+=i*i}return Math.sqrt(t)}var kq=[1,0,0],Uq=[2,2,1];function G3e(e){let t=0;for(let n=0;n<3;++n){let i=e[br.getElementIndex(Uq[n],kq[n])];t+=2*i*i}return Math.sqrt(t)}function W3e(e,t){let n=D.EPSILON15,i=0,r=1;for(let u=0;u<3;++u){let f=Math.abs(e[br.getElementIndex(Uq[u],kq[u])]);f>i&&(r=u,i=f)}let o=1,s=0,a=kq[r],c=Uq[r];if(Math.abs(e[br.getElementIndex(c,a)])>n){let u=e[br.getElementIndex(c,c)],f=e[br.getElementIndex(a,a)],d=e[br.getElementIndex(c,a)],p=(u-f)/2/d,g;p<0?g=-1/(-p+Math.sqrt(1+p*p)):g=1/(p+Math.sqrt(1+p*p)),o=1/Math.sqrt(1+g*g),s=g*o}return t=br.clone(br.IDENTITY,t),t[br.getElementIndex(a,a)]=t[br.getElementIndex(c,c)]=o,t[br.getElementIndex(c,a)]=s,t[br.getElementIndex(a,c)]=-s,t}var $=br;function rD(e){this.name="RuntimeError",this.message=e;let t;try{throw new Error}catch(n){t=n.stack}this.stack=t}l(Object.create)&&(rD.prototype=Object.create(Error.prototype),rD.prototype.constructor=rD);rD.prototype.toString=function(){let e=`${this.name}: ${this.message}`;return l(this.stack)&&(e+=` -${this.stack.toString()}`),e};var oe=rD;var q3e=Object.freeze([NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN]),go=class e{constructor(t,n,i,r,o,s,a,c,u,f,d,p,g,m,y,A){let b=Reflect.construct(Array,q3e,new.target);return b[0]=t??0,b[1]=o??0,b[2]=u??0,b[3]=g??0,b[4]=n??0,b[5]=s??0,b[6]=f??0,b[7]=m??0,b[8]=i??0,b[9]=a??0,b[10]=d??0,b[11]=y??0,b[12]=r??0,b[13]=c??0,b[14]=p??0,b[15]=A??0,b}static pack(t,n,i){return i=i??0,n[i++]=t[0],n[i++]=t[1],n[i++]=t[2],n[i++]=t[3],n[i++]=t[4],n[i++]=t[5],n[i++]=t[6],n[i++]=t[7],n[i++]=t[8],n[i++]=t[9],n[i++]=t[10],n[i++]=t[11],n[i++]=t[12],n[i++]=t[13],n[i++]=t[14],n[i]=t[15],n}static unpack(t,n,i){return n=n??0,l(i)||(i=new e),i[0]=t[n++],i[1]=t[n++],i[2]=t[n++],i[3]=t[n++],i[4]=t[n++],i[5]=t[n++],i[6]=t[n++],i[7]=t[n++],i[8]=t[n++],i[9]=t[n++],i[10]=t[n++],i[11]=t[n++],i[12]=t[n++],i[13]=t[n++],i[14]=t[n++],i[15]=t[n],i}static packArray(t,n){let i=t.length,r=i*16;l(n)?!Array.isArray(n)&&n.length!==r||n.length!==r&&(n.length=r):n=new Array(r);for(let o=0;o<i;++o)e.pack(t[o],n,o*16);return n}static unpackArray(t,n){let i=t.length;l(n)?n.length=i/16:n=new Array(i/16);for(let r=0;r<i;r+=16){let o=r/16;n[o]=e.unpack(t,r,n[o])}return n}static clone(t,n){if(l(t))return l(n)?(n[0]=t[0],n[1]=t[1],n[2]=t[2],n[3]=t[3],n[4]=t[4],n[5]=t[5],n[6]=t[6],n[7]=t[7],n[8]=t[8],n[9]=t[9],n[10]=t[10],n[11]=t[11],n[12]=t[12],n[13]=t[13],n[14]=t[14],n[15]=t[15],n):new e(t[0],t[4],t[8],t[12],t[1],t[5],t[9],t[13],t[2],t[6],t[10],t[14],t[3],t[7],t[11],t[15])}static fromColumnMajorArray(t,n){return e.clone(t,n)}static fromRowMajorArray(t,n){return l(n)?(n[0]=t[0],n[1]=t[4],n[2]=t[8],n[3]=t[12],n[4]=t[1],n[5]=t[5],n[6]=t[9],n[7]=t[13],n[8]=t[2],n[9]=t[6],n[10]=t[10],n[11]=t[14],n[12]=t[3],n[13]=t[7],n[14]=t[11],n[15]=t[15],n):new e(t[0],t[1],t[2],t[3],t[4],t[5],t[6],t[7],t[8],t[9],t[10],t[11],t[12],t[13],t[14],t[15])}static fromRotationTranslation(t,n,i){return n=n??h.ZERO,l(i)?(i[0]=t[0],i[1]=t[1],i[2]=t[2],i[3]=0,i[4]=t[3],i[5]=t[4],i[6]=t[5],i[7]=0,i[8]=t[6],i[9]=t[7],i[10]=t[8],i[11]=0,i[12]=n.x,i[13]=n.y,i[14]=n.z,i[15]=1,i):new e(t[0],t[3],t[6],n.x,t[1],t[4],t[7],n.y,t[2],t[5],t[8],n.z,0,0,0,1)}static fromTranslationQuaternionRotationScale(t,n,i,r){l(r)||(r=new e);let o=i.x,s=i.y,a=i.z,c=n.x*n.x,u=n.x*n.y,f=n.x*n.z,d=n.x*n.w,p=n.y*n.y,g=n.y*n.z,m=n.y*n.w,y=n.z*n.z,A=n.z*n.w,b=n.w*n.w,x=c-p-y+b,T=2*(u-A),E=2*(f+m),v=2*(u+A),S=-c+p-y+b,I=2*(g-d),R=2*(f-m),O=2*(g+d),L=-c-p+y+b;return r[0]=x*o,r[1]=v*o,r[2]=R*o,r[3]=0,r[4]=T*s,r[5]=S*s,r[6]=O*s,r[7]=0,r[8]=E*a,r[9]=I*a,r[10]=L*a,r[11]=0,r[12]=t.x,r[13]=t.y,r[14]=t.z,r[15]=1,r}static fromTranslationRotationScale(t,n){return e.fromTranslationQuaternionRotationScale(t.translation,t.rotation,t.scale,n)}static fromTranslation(t,n){return e.fromRotationTranslation($.IDENTITY,t,n)}static fromScale(t,n){return l(n)?(n[0]=t.x,n[1]=0,n[2]=0,n[3]=0,n[4]=0,n[5]=t.y,n[6]=0,n[7]=0,n[8]=0,n[9]=0,n[10]=t.z,n[11]=0,n[12]=0,n[13]=0,n[14]=0,n[15]=1,n):new e(t.x,0,0,0,0,t.y,0,0,0,0,t.z,0,0,0,0,1)}static fromUniformScale(t,n){return l(n)?(n[0]=t,n[1]=0,n[2]=0,n[3]=0,n[4]=0,n[5]=t,n[6]=0,n[7]=0,n[8]=0,n[9]=0,n[10]=t,n[11]=0,n[12]=0,n[13]=0,n[14]=0,n[15]=1,n):new e(t,0,0,0,0,t,0,0,0,0,t,0,0,0,0,1)}static fromRotation(t,n){return l(n)||(n=new e),n[0]=t[0],n[1]=t[1],n[2]=t[2],n[3]=0,n[4]=t[3],n[5]=t[4],n[6]=t[5],n[7]=0,n[8]=t[6],n[9]=t[7],n[10]=t[8],n[11]=0,n[12]=0,n[13]=0,n[14]=0,n[15]=1,n}static fromCamera(t,n){let i=t.position,r=t.direction,o=t.up;h.normalize(r,rv),h.normalize(h.cross(rv,o,ov),ov),h.normalize(h.cross(ov,rv,oD),oD);let s=ov.x,a=ov.y,c=ov.z,u=rv.x,f=rv.y,d=rv.z,p=oD.x,g=oD.y,m=oD.z,y=i.x,A=i.y,b=i.z,x=s*-y+a*-A+c*-b,T=p*-y+g*-A+m*-b,E=u*y+f*A+d*b;return l(n)?(n[0]=s,n[1]=p,n[2]=-u,n[3]=0,n[4]=a,n[5]=g,n[6]=-f,n[7]=0,n[8]=c,n[9]=m,n[10]=-d,n[11]=0,n[12]=x,n[13]=T,n[14]=E,n[15]=1,n):new e(s,a,c,x,p,g,m,T,-u,-f,-d,E,0,0,0,1)}static computePerspectiveFieldOfView(t,n,i,r,o){let a=1/Math.tan(t*.5),c=a/n,u=(r+i)/(i-r),f=2*r*i/(i-r);return o[0]=c,o[1]=0,o[2]=0,o[3]=0,o[4]=0,o[5]=a,o[6]=0,o[7]=0,o[8]=0,o[9]=0,o[10]=u,o[11]=-1,o[12]=0,o[13]=0,o[14]=f,o[15]=0,o}static computeOrthographicOffCenter(t,n,i,r,o,s,a){let c=1/(n-t),u=1/(r-i),f=1/(s-o),d=-(n+t)*c,p=-(r+i)*u,g=-(s+o)*f;return c*=2,u*=2,f*=-2,a[0]=c,a[1]=0,a[2]=0,a[3]=0,a[4]=0,a[5]=u,a[6]=0,a[7]=0,a[8]=0,a[9]=0,a[10]=f,a[11]=0,a[12]=d,a[13]=p,a[14]=g,a[15]=1,a}static computePerspectiveOffCenter(t,n,i,r,o,s,a){let c=2*o/(n-t),u=2*o/(r-i),f=(n+t)/(n-t),d=(r+i)/(r-i),p=-(s+o)/(s-o),g=-1,m=-2*s*o/(s-o);return a[0]=c,a[1]=0,a[2]=0,a[3]=0,a[4]=0,a[5]=u,a[6]=0,a[7]=0,a[8]=f,a[9]=d,a[10]=p,a[11]=g,a[12]=0,a[13]=0,a[14]=m,a[15]=0,a}static computeInfinitePerspectiveOffCenter(t,n,i,r,o,s){let a=2*o/(n-t),c=2*o/(r-i),u=(n+t)/(n-t),f=(r+i)/(r-i),d=-1,p=-1,g=-2*o;return s[0]=a,s[1]=0,s[2]=0,s[3]=0,s[4]=0,s[5]=c,s[6]=0,s[7]=0,s[8]=u,s[9]=f,s[10]=d,s[11]=p,s[12]=0,s[13]=0,s[14]=g,s[15]=0,s}static computeViewportTransformation(t,n,i,r){l(r)||(r=new e),t=t??H.EMPTY_OBJECT;let o=t.x??0,s=t.y??0,a=t.width??0,c=t.height??0;n=n??0,i=i??1;let u=a*.5,f=c*.5,d=(i-n)*.5,p=u,g=f,m=d,y=o+u,A=s+f,b=n+d,x=1;return r[0]=p,r[1]=0,r[2]=0,r[3]=0,r[4]=0,r[5]=g,r[6]=0,r[7]=0,r[8]=0,r[9]=0,r[10]=m,r[11]=0,r[12]=y,r[13]=A,r[14]=b,r[15]=x,r}static computeView(t,n,i,r,o){return o[0]=r.x,o[1]=i.x,o[2]=-n.x,o[3]=0,o[4]=r.y,o[5]=i.y,o[6]=-n.y,o[7]=0,o[8]=r.z,o[9]=i.z,o[10]=-n.z,o[11]=0,o[12]=-h.dot(r,t),o[13]=-h.dot(i,t),o[14]=h.dot(n,t),o[15]=1,o}static toArray(t,n){return l(n)?(n[0]=t[0],n[1]=t[1],n[2]=t[2],n[3]=t[3],n[4]=t[4],n[5]=t[5],n[6]=t[6],n[7]=t[7],n[8]=t[8],n[9]=t[9],n[10]=t[10],n[11]=t[11],n[12]=t[12],n[13]=t[13],n[14]=t[14],n[15]=t[15],n):[t[0],t[1],t[2],t[3],t[4],t[5],t[6],t[7],t[8],t[9],t[10],t[11],t[12],t[13],t[14],t[15]]}static getElementIndex(t,n){return t*4+n}static getColumn(t,n,i){let r=n*4,o=t[r],s=t[r+1],a=t[r+2],c=t[r+3];return i.x=o,i.y=s,i.z=a,i.w=c,i}static setColumn(t,n,i,r){r=e.clone(t,r);let o=n*4;return r[o]=i.x,r[o+1]=i.y,r[o+2]=i.z,r[o+3]=i.w,r}static getRow(t,n,i){let r=t[n],o=t[n+4],s=t[n+8],a=t[n+12];return i.x=r,i.y=o,i.z=s,i.w=a,i}static setRow(t,n,i,r){return r=e.clone(t,r),r[n]=i.x,r[n+4]=i.y,r[n+8]=i.z,r[n+12]=i.w,r}static setTranslation(t,n,i){return i[0]=t[0],i[1]=t[1],i[2]=t[2],i[3]=t[3],i[4]=t[4],i[5]=t[5],i[6]=t[6],i[7]=t[7],i[8]=t[8],i[9]=t[9],i[10]=t[10],i[11]=t[11],i[12]=n.x,i[13]=n.y,i[14]=n.z,i[15]=t[15],i}static setScale(t,n,i){let r=e.getScale(t,Y3e),o=n.x/r.x,s=n.y/r.y,a=n.z/r.z;return i[0]=t[0]*o,i[1]=t[1]*o,i[2]=t[2]*o,i[3]=t[3],i[4]=t[4]*s,i[5]=t[5]*s,i[6]=t[6]*s,i[7]=t[7],i[8]=t[8]*a,i[9]=t[9]*a,i[10]=t[10]*a,i[11]=t[11],i[12]=t[12],i[13]=t[13],i[14]=t[14],i[15]=t[15],i}static setUniformScale(t,n,i){let r=e.getScale(t,X3e),o=n/r.x,s=n/r.y,a=n/r.z;return i[0]=t[0]*o,i[1]=t[1]*o,i[2]=t[2]*o,i[3]=t[3],i[4]=t[4]*s,i[5]=t[5]*s,i[6]=t[6]*s,i[7]=t[7],i[8]=t[8]*a,i[9]=t[9]*a,i[10]=t[10]*a,i[11]=t[11],i[12]=t[12],i[13]=t[13],i[14]=t[14],i[15]=t[15],i}static getScale(t,n){return n.x=h.magnitude(h.fromElements(t[0],t[1],t[2],zq)),n.y=h.magnitude(h.fromElements(t[4],t[5],t[6],zq)),n.z=h.magnitude(h.fromElements(t[8],t[9],t[10],zq)),n}static getMaximumScale(t){return e.getScale(t,lue),h.maximumComponent(lue)}static setRotation(t,n,i){let r=e.getScale(t,K3e);return i[0]=n[0]*r.x,i[1]=n[1]*r.x,i[2]=n[2]*r.x,i[3]=t[3],i[4]=n[3]*r.y,i[5]=n[4]*r.y,i[6]=n[5]*r.y,i[7]=t[7],i[8]=n[6]*r.z,i[9]=n[7]*r.z,i[10]=n[8]*r.z,i[11]=t[11],i[12]=t[12],i[13]=t[13],i[14]=t[14],i[15]=t[15],i}static getRotation(t,n){let i=e.getScale(t,$3e);return n[0]=t[0]/i.x,n[1]=t[1]/i.x,n[2]=t[2]/i.x,n[3]=t[4]/i.y,n[4]=t[5]/i.y,n[5]=t[6]/i.y,n[6]=t[8]/i.z,n[7]=t[9]/i.z,n[8]=t[10]/i.z,n}static multiply(t,n,i){let r=t[0],o=t[1],s=t[2],a=t[3],c=t[4],u=t[5],f=t[6],d=t[7],p=t[8],g=t[9],m=t[10],y=t[11],A=t[12],b=t[13],x=t[14],T=t[15],E=n[0],v=n[1],S=n[2],I=n[3],R=n[4],O=n[5],L=n[6],_=n[7],C=n[8],w=n[9],P=n[10],M=n[11],F=n[12],V=n[13],B=n[14],j=n[15],k=r*E+c*v+p*S+A*I,G=o*E+u*v+g*S+b*I,q=s*E+f*v+m*S+x*I,Q=a*E+d*v+y*S+T*I,W=r*R+c*O+p*L+A*_,J=o*R+u*O+g*L+b*_,Z=s*R+f*O+m*L+x*_,ae=a*R+d*O+y*L+T*_,Ae=r*C+c*w+p*P+A*M,fe=o*C+u*w+g*P+b*M,xe=s*C+f*w+m*P+x*M,ge=a*C+d*w+y*P+T*M,we=r*F+c*V+p*B+A*j,Se=o*F+u*V+g*B+b*j,Re=s*F+f*V+m*B+x*j,Qe=a*F+d*V+y*B+T*j;return i[0]=k,i[1]=G,i[2]=q,i[3]=Q,i[4]=W,i[5]=J,i[6]=Z,i[7]=ae,i[8]=Ae,i[9]=fe,i[10]=xe,i[11]=ge,i[12]=we,i[13]=Se,i[14]=Re,i[15]=Qe,i}static add(t,n,i){return i[0]=t[0]+n[0],i[1]=t[1]+n[1],i[2]=t[2]+n[2],i[3]=t[3]+n[3],i[4]=t[4]+n[4],i[5]=t[5]+n[5],i[6]=t[6]+n[6],i[7]=t[7]+n[7],i[8]=t[8]+n[8],i[9]=t[9]+n[9],i[10]=t[10]+n[10],i[11]=t[11]+n[11],i[12]=t[12]+n[12],i[13]=t[13]+n[13],i[14]=t[14]+n[14],i[15]=t[15]+n[15],i}static subtract(t,n,i){return i[0]=t[0]-n[0],i[1]=t[1]-n[1],i[2]=t[2]-n[2],i[3]=t[3]-n[3],i[4]=t[4]-n[4],i[5]=t[5]-n[5],i[6]=t[6]-n[6],i[7]=t[7]-n[7],i[8]=t[8]-n[8],i[9]=t[9]-n[9],i[10]=t[10]-n[10],i[11]=t[11]-n[11],i[12]=t[12]-n[12],i[13]=t[13]-n[13],i[14]=t[14]-n[14],i[15]=t[15]-n[15],i}static multiplyTransformation(t,n,i){let r=t[0],o=t[1],s=t[2],a=t[4],c=t[5],u=t[6],f=t[8],d=t[9],p=t[10],g=t[12],m=t[13],y=t[14],A=n[0],b=n[1],x=n[2],T=n[4],E=n[5],v=n[6],S=n[8],I=n[9],R=n[10],O=n[12],L=n[13],_=n[14],C=r*A+a*b+f*x,w=o*A+c*b+d*x,P=s*A+u*b+p*x,M=r*T+a*E+f*v,F=o*T+c*E+d*v,V=s*T+u*E+p*v,B=r*S+a*I+f*R,j=o*S+c*I+d*R,k=s*S+u*I+p*R,G=r*O+a*L+f*_+g,q=o*O+c*L+d*_+m,Q=s*O+u*L+p*_+y;return i[0]=C,i[1]=w,i[2]=P,i[3]=0,i[4]=M,i[5]=F,i[6]=V,i[7]=0,i[8]=B,i[9]=j,i[10]=k,i[11]=0,i[12]=G,i[13]=q,i[14]=Q,i[15]=1,i}static multiplyByMatrix3(t,n,i){let r=t[0],o=t[1],s=t[2],a=t[4],c=t[5],u=t[6],f=t[8],d=t[9],p=t[10],g=n[0],m=n[1],y=n[2],A=n[3],b=n[4],x=n[5],T=n[6],E=n[7],v=n[8],S=r*g+a*m+f*y,I=o*g+c*m+d*y,R=s*g+u*m+p*y,O=r*A+a*b+f*x,L=o*A+c*b+d*x,_=s*A+u*b+p*x,C=r*T+a*E+f*v,w=o*T+c*E+d*v,P=s*T+u*E+p*v;return i[0]=S,i[1]=I,i[2]=R,i[3]=0,i[4]=O,i[5]=L,i[6]=_,i[7]=0,i[8]=C,i[9]=w,i[10]=P,i[11]=0,i[12]=t[12],i[13]=t[13],i[14]=t[14],i[15]=t[15],i}static multiplyByTranslation(t,n,i){let r=n.x,o=n.y,s=n.z,a=r*t[0]+o*t[4]+s*t[8]+t[12],c=r*t[1]+o*t[5]+s*t[9]+t[13],u=r*t[2]+o*t[6]+s*t[10]+t[14];return i[0]=t[0],i[1]=t[1],i[2]=t[2],i[3]=t[3],i[4]=t[4],i[5]=t[5],i[6]=t[6],i[7]=t[7],i[8]=t[8],i[9]=t[9],i[10]=t[10],i[11]=t[11],i[12]=a,i[13]=c,i[14]=u,i[15]=t[15],i}static multiplyByScale(t,n,i){let r=n.x,o=n.y,s=n.z;return r===1&&o===1&&s===1?e.clone(t,i):(i[0]=r*t[0],i[1]=r*t[1],i[2]=r*t[2],i[3]=t[3],i[4]=o*t[4],i[5]=o*t[5],i[6]=o*t[6],i[7]=t[7],i[8]=s*t[8],i[9]=s*t[9],i[10]=s*t[10],i[11]=t[11],i[12]=t[12],i[13]=t[13],i[14]=t[14],i[15]=t[15],i)}static multiplyByUniformScale(t,n,i){return i[0]=t[0]*n,i[1]=t[1]*n,i[2]=t[2]*n,i[3]=t[3],i[4]=t[4]*n,i[5]=t[5]*n,i[6]=t[6]*n,i[7]=t[7],i[8]=t[8]*n,i[9]=t[9]*n,i[10]=t[10]*n,i[11]=t[11],i[12]=t[12],i[13]=t[13],i[14]=t[14],i[15]=t[15],i}static multiplyByVector(t,n,i){let r=n.x,o=n.y,s=n.z,a=n.w,c=t[0]*r+t[4]*o+t[8]*s+t[12]*a,u=t[1]*r+t[5]*o+t[9]*s+t[13]*a,f=t[2]*r+t[6]*o+t[10]*s+t[14]*a,d=t[3]*r+t[7]*o+t[11]*s+t[15]*a;return i.x=c,i.y=u,i.z=f,i.w=d,i}static multiplyByPointAsVector(t,n,i){let r=n.x,o=n.y,s=n.z,a=t[0]*r+t[4]*o+t[8]*s,c=t[1]*r+t[5]*o+t[9]*s,u=t[2]*r+t[6]*o+t[10]*s;return i.x=a,i.y=c,i.z=u,i}static multiplyByPoint(t,n,i){let r=n.x,o=n.y,s=n.z,a=t[0]*r+t[4]*o+t[8]*s+t[12],c=t[1]*r+t[5]*o+t[9]*s+t[13],u=t[2]*r+t[6]*o+t[10]*s+t[14];return i.x=a,i.y=c,i.z=u,i}static multiplyByScalar(t,n,i){return i[0]=t[0]*n,i[1]=t[1]*n,i[2]=t[2]*n,i[3]=t[3]*n,i[4]=t[4]*n,i[5]=t[5]*n,i[6]=t[6]*n,i[7]=t[7]*n,i[8]=t[8]*n,i[9]=t[9]*n,i[10]=t[10]*n,i[11]=t[11]*n,i[12]=t[12]*n,i[13]=t[13]*n,i[14]=t[14]*n,i[15]=t[15]*n,i}static negate(t,n){return n[0]=-t[0],n[1]=-t[1],n[2]=-t[2],n[3]=-t[3],n[4]=-t[4],n[5]=-t[5],n[6]=-t[6],n[7]=-t[7],n[8]=-t[8],n[9]=-t[9],n[10]=-t[10],n[11]=-t[11],n[12]=-t[12],n[13]=-t[13],n[14]=-t[14],n[15]=-t[15],n}static transpose(t,n){let i=t[1],r=t[2],o=t[3],s=t[6],a=t[7],c=t[11];return n[0]=t[0],n[1]=t[4],n[2]=t[8],n[3]=t[12],n[4]=i,n[5]=t[5],n[6]=t[9],n[7]=t[13],n[8]=r,n[9]=s,n[10]=t[10],n[11]=t[14],n[12]=o,n[13]=a,n[14]=c,n[15]=t[15],n}static abs(t,n){return n[0]=Math.abs(t[0]),n[1]=Math.abs(t[1]),n[2]=Math.abs(t[2]),n[3]=Math.abs(t[3]),n[4]=Math.abs(t[4]),n[5]=Math.abs(t[5]),n[6]=Math.abs(t[6]),n[7]=Math.abs(t[7]),n[8]=Math.abs(t[8]),n[9]=Math.abs(t[9]),n[10]=Math.abs(t[10]),n[11]=Math.abs(t[11]),n[12]=Math.abs(t[12]),n[13]=Math.abs(t[13]),n[14]=Math.abs(t[14]),n[15]=Math.abs(t[15]),n}static equals(t,n){return t===n||l(t)&&l(n)&&t[12]===n[12]&&t[13]===n[13]&&t[14]===n[14]&&t[0]===n[0]&&t[1]===n[1]&&t[2]===n[2]&&t[4]===n[4]&&t[5]===n[5]&&t[6]===n[6]&&t[8]===n[8]&&t[9]===n[9]&&t[10]===n[10]&&t[3]===n[3]&&t[7]===n[7]&&t[11]===n[11]&&t[15]===n[15]}static equalsEpsilon(t,n,i){return i=i??0,t===n||l(t)&&l(n)&&Math.abs(t[0]-n[0])<=i&&Math.abs(t[1]-n[1])<=i&&Math.abs(t[2]-n[2])<=i&&Math.abs(t[3]-n[3])<=i&&Math.abs(t[4]-n[4])<=i&&Math.abs(t[5]-n[5])<=i&&Math.abs(t[6]-n[6])<=i&&Math.abs(t[7]-n[7])<=i&&Math.abs(t[8]-n[8])<=i&&Math.abs(t[9]-n[9])<=i&&Math.abs(t[10]-n[10])<=i&&Math.abs(t[11]-n[11])<=i&&Math.abs(t[12]-n[12])<=i&&Math.abs(t[13]-n[13])<=i&&Math.abs(t[14]-n[14])<=i&&Math.abs(t[15]-n[15])<=i}static getTranslation(t,n){return n.x=t[12],n.y=t[13],n.z=t[14],n}static getMatrix3(t,n){return n[0]=t[0],n[1]=t[1],n[2]=t[2],n[3]=t[4],n[4]=t[5],n[5]=t[6],n[6]=t[8],n[7]=t[9],n[8]=t[10],n}static inverse(t,n){let i=t[0],r=t[4],o=t[8],s=t[12],a=t[1],c=t[5],u=t[9],f=t[13],d=t[2],p=t[6],g=t[10],m=t[14],y=t[3],A=t[7],b=t[11],x=t[15],T=g*x,E=m*b,v=p*x,S=m*A,I=p*b,R=g*A,O=d*x,L=m*y,_=d*b,C=g*y,w=d*A,P=p*y,M=T*c+S*u+I*f-(E*c+v*u+R*f),F=E*a+O*u+C*f-(T*a+L*u+_*f),V=v*a+L*c+w*f-(S*a+O*c+P*f),B=R*a+_*c+P*u-(I*a+C*c+w*u),j=E*r+v*o+R*s-(T*r+S*o+I*s),k=T*i+L*o+_*s-(E*i+O*o+C*s),G=S*i+O*r+P*s-(v*i+L*r+w*s),q=I*i+C*r+w*o-(R*i+_*r+P*o);T=o*f,E=s*u,v=r*f,S=s*c,I=r*u,R=o*c,O=i*f,L=s*a,_=i*u,C=o*a,w=i*c,P=r*a;let Q=T*A+S*b+I*x-(E*A+v*b+R*x),W=E*y+O*b+C*x-(T*y+L*b+_*x),J=v*y+L*A+w*x-(S*y+O*A+P*x),Z=R*y+_*A+P*b-(I*y+C*A+w*b),ae=v*g+R*m+E*p-(I*m+T*p+S*g),Ae=_*m+T*d+L*g-(O*g+C*m+E*d),fe=O*p+P*m+S*d-(w*m+v*d+L*p),xe=w*g+I*d+C*p-(_*p+P*g+R*d),ge=i*M+r*F+o*V+s*B;if(Math.abs(ge)<D.EPSILON21){if($.equalsEpsilon(e.getMatrix3(t,J3e),Z3e,D.EPSILON7)&&se.equals(e.getRow(t,3,Q3e),eUe))return n[0]=0,n[1]=0,n[2]=0,n[3]=0,n[4]=0,n[5]=0,n[6]=0,n[7]=0,n[8]=0,n[9]=0,n[10]=0,n[11]=0,n[12]=-t[12],n[13]=-t[13],n[14]=-t[14],n[15]=1,n;throw new oe("matrix is not invertible because its determinate is zero.")}return ge=1/ge,n[0]=M*ge,n[1]=F*ge,n[2]=V*ge,n[3]=B*ge,n[4]=j*ge,n[5]=k*ge,n[6]=G*ge,n[7]=q*ge,n[8]=Q*ge,n[9]=W*ge,n[10]=J*ge,n[11]=Z*ge,n[12]=ae*ge,n[13]=Ae*ge,n[14]=fe*ge,n[15]=xe*ge,n}static inverseTransformation(t,n){let i=t[0],r=t[1],o=t[2],s=t[4],a=t[5],c=t[6],u=t[8],f=t[9],d=t[10],p=t[12],g=t[13],m=t[14],y=-i*p-r*g-o*m,A=-s*p-a*g-c*m,b=-u*p-f*g-d*m;return n[0]=i,n[1]=s,n[2]=u,n[3]=0,n[4]=r,n[5]=a,n[6]=f,n[7]=0,n[8]=o,n[9]=c,n[10]=d,n[11]=0,n[12]=y,n[13]=A,n[14]=b,n[15]=1,n}static inverseTranspose(t,n){return e.inverse(e.transpose(t,tUe),n)}get length(){return e.packedLength}clone(t){return e.clone(this,t)}equals(t){return e.equals(this,t)}static equalsArray(t,n,i){return t[0]===n[i]&&t[1]===n[i+1]&&t[2]===n[i+2]&&t[3]===n[i+3]&&t[4]===n[i+4]&&t[5]===n[i+5]&&t[6]===n[i+6]&&t[7]===n[i+7]&&t[8]===n[i+8]&&t[9]===n[i+9]&&t[10]===n[i+10]&&t[11]===n[i+11]&&t[12]===n[i+12]&&t[13]===n[i+13]&&t[14]===n[i+14]&&t[15]===n[i+15]}equalsEpsilon(t,n){return e.equalsEpsilon(this,t,n)}toString(){return`(${this[0]}, ${this[4]}, ${this[8]}, ${this[12]}) +(${this[2]}, ${this[5]}, ${this[8]})`}};br.packedLength=9;br.fromArray=br.unpack;br.IDENTITY=new br(1,0,0,0,1,0,0,0,1);br.ZERO=new br(0,0,0,0,0,0,0,0,0);br.COLUMN0ROW0=0;br.COLUMN0ROW1=1;br.COLUMN0ROW2=2;br.COLUMN1ROW0=3;br.COLUMN1ROW1=4;br.COLUMN1ROW2=5;br.COLUMN2ROW0=6;br.COLUMN2ROW1=7;br.COLUMN2ROW2=8;var U3e=new h,z3e=new h,Bq=new h,aue=new h,V3e=new h,j3e=new h,Aj=new br,cue=new br,H3e=new br;function G3e(e){let t=0;for(let n=0;n<9;++n){let i=e[n];t+=i*i}return Math.sqrt(t)}var kq=[1,0,0],Uq=[2,2,1];function W3e(e){let t=0;for(let n=0;n<3;++n){let i=e[br.getElementIndex(Uq[n],kq[n])];t+=2*i*i}return Math.sqrt(t)}function q3e(e,t){let n=D.EPSILON15,i=0,r=1;for(let u=0;u<3;++u){let f=Math.abs(e[br.getElementIndex(Uq[u],kq[u])]);f>i&&(r=u,i=f)}let o=1,s=0,a=kq[r],c=Uq[r];if(Math.abs(e[br.getElementIndex(c,a)])>n){let u=e[br.getElementIndex(c,c)],f=e[br.getElementIndex(a,a)],d=e[br.getElementIndex(c,a)],p=(u-f)/2/d,g;p<0?g=-1/(-p+Math.sqrt(1+p*p)):g=1/(p+Math.sqrt(1+p*p)),o=1/Math.sqrt(1+g*g),s=g*o}return t=br.clone(br.IDENTITY,t),t[br.getElementIndex(a,a)]=t[br.getElementIndex(c,c)]=o,t[br.getElementIndex(c,a)]=s,t[br.getElementIndex(a,c)]=-s,t}var $=br;function rD(e){this.name="RuntimeError",this.message=e;let t;try{throw new Error}catch(n){t=n.stack}this.stack=t}l(Object.create)&&(rD.prototype=Object.create(Error.prototype),rD.prototype.constructor=rD);rD.prototype.toString=function(){let e=`${this.name}: ${this.message}`;return l(this.stack)&&(e+=` +${this.stack.toString()}`),e};var oe=rD;var Y3e=Object.freeze([NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN]),go=class e{constructor(t,n,i,r,o,s,a,c,u,f,d,p,g,m,y,A){let b=Reflect.construct(Array,Y3e,new.target);return b[0]=t??0,b[1]=o??0,b[2]=u??0,b[3]=g??0,b[4]=n??0,b[5]=s??0,b[6]=f??0,b[7]=m??0,b[8]=i??0,b[9]=a??0,b[10]=d??0,b[11]=y??0,b[12]=r??0,b[13]=c??0,b[14]=p??0,b[15]=A??0,b}static pack(t,n,i){return i=i??0,n[i++]=t[0],n[i++]=t[1],n[i++]=t[2],n[i++]=t[3],n[i++]=t[4],n[i++]=t[5],n[i++]=t[6],n[i++]=t[7],n[i++]=t[8],n[i++]=t[9],n[i++]=t[10],n[i++]=t[11],n[i++]=t[12],n[i++]=t[13],n[i++]=t[14],n[i]=t[15],n}static unpack(t,n,i){return n=n??0,l(i)||(i=new e),i[0]=t[n++],i[1]=t[n++],i[2]=t[n++],i[3]=t[n++],i[4]=t[n++],i[5]=t[n++],i[6]=t[n++],i[7]=t[n++],i[8]=t[n++],i[9]=t[n++],i[10]=t[n++],i[11]=t[n++],i[12]=t[n++],i[13]=t[n++],i[14]=t[n++],i[15]=t[n],i}static packArray(t,n){let i=t.length,r=i*16;l(n)?!Array.isArray(n)&&n.length!==r||n.length!==r&&(n.length=r):n=new Array(r);for(let o=0;o<i;++o)e.pack(t[o],n,o*16);return n}static unpackArray(t,n){let i=t.length;l(n)?n.length=i/16:n=new Array(i/16);for(let r=0;r<i;r+=16){let o=r/16;n[o]=e.unpack(t,r,n[o])}return n}static clone(t,n){if(l(t))return l(n)?(n[0]=t[0],n[1]=t[1],n[2]=t[2],n[3]=t[3],n[4]=t[4],n[5]=t[5],n[6]=t[6],n[7]=t[7],n[8]=t[8],n[9]=t[9],n[10]=t[10],n[11]=t[11],n[12]=t[12],n[13]=t[13],n[14]=t[14],n[15]=t[15],n):new e(t[0],t[4],t[8],t[12],t[1],t[5],t[9],t[13],t[2],t[6],t[10],t[14],t[3],t[7],t[11],t[15])}static fromColumnMajorArray(t,n){return e.clone(t,n)}static fromRowMajorArray(t,n){return l(n)?(n[0]=t[0],n[1]=t[4],n[2]=t[8],n[3]=t[12],n[4]=t[1],n[5]=t[5],n[6]=t[9],n[7]=t[13],n[8]=t[2],n[9]=t[6],n[10]=t[10],n[11]=t[14],n[12]=t[3],n[13]=t[7],n[14]=t[11],n[15]=t[15],n):new e(t[0],t[1],t[2],t[3],t[4],t[5],t[6],t[7],t[8],t[9],t[10],t[11],t[12],t[13],t[14],t[15])}static fromRotationTranslation(t,n,i){return n=n??h.ZERO,l(i)?(i[0]=t[0],i[1]=t[1],i[2]=t[2],i[3]=0,i[4]=t[3],i[5]=t[4],i[6]=t[5],i[7]=0,i[8]=t[6],i[9]=t[7],i[10]=t[8],i[11]=0,i[12]=n.x,i[13]=n.y,i[14]=n.z,i[15]=1,i):new e(t[0],t[3],t[6],n.x,t[1],t[4],t[7],n.y,t[2],t[5],t[8],n.z,0,0,0,1)}static fromTranslationQuaternionRotationScale(t,n,i,r){l(r)||(r=new e);let o=i.x,s=i.y,a=i.z,c=n.x*n.x,u=n.x*n.y,f=n.x*n.z,d=n.x*n.w,p=n.y*n.y,g=n.y*n.z,m=n.y*n.w,y=n.z*n.z,A=n.z*n.w,b=n.w*n.w,x=c-p-y+b,T=2*(u-A),E=2*(f+m),v=2*(u+A),S=-c+p-y+b,I=2*(g-d),R=2*(f-m),O=2*(g+d),L=-c-p+y+b;return r[0]=x*o,r[1]=v*o,r[2]=R*o,r[3]=0,r[4]=T*s,r[5]=S*s,r[6]=O*s,r[7]=0,r[8]=E*a,r[9]=I*a,r[10]=L*a,r[11]=0,r[12]=t.x,r[13]=t.y,r[14]=t.z,r[15]=1,r}static fromTranslationRotationScale(t,n){return e.fromTranslationQuaternionRotationScale(t.translation,t.rotation,t.scale,n)}static fromTranslation(t,n){return e.fromRotationTranslation($.IDENTITY,t,n)}static fromScale(t,n){return l(n)?(n[0]=t.x,n[1]=0,n[2]=0,n[3]=0,n[4]=0,n[5]=t.y,n[6]=0,n[7]=0,n[8]=0,n[9]=0,n[10]=t.z,n[11]=0,n[12]=0,n[13]=0,n[14]=0,n[15]=1,n):new e(t.x,0,0,0,0,t.y,0,0,0,0,t.z,0,0,0,0,1)}static fromUniformScale(t,n){return l(n)?(n[0]=t,n[1]=0,n[2]=0,n[3]=0,n[4]=0,n[5]=t,n[6]=0,n[7]=0,n[8]=0,n[9]=0,n[10]=t,n[11]=0,n[12]=0,n[13]=0,n[14]=0,n[15]=1,n):new e(t,0,0,0,0,t,0,0,0,0,t,0,0,0,0,1)}static fromRotation(t,n){return l(n)||(n=new e),n[0]=t[0],n[1]=t[1],n[2]=t[2],n[3]=0,n[4]=t[3],n[5]=t[4],n[6]=t[5],n[7]=0,n[8]=t[6],n[9]=t[7],n[10]=t[8],n[11]=0,n[12]=0,n[13]=0,n[14]=0,n[15]=1,n}static fromCamera(t,n){let i=t.position,r=t.direction,o=t.up;h.normalize(r,rv),h.normalize(h.cross(rv,o,ov),ov),h.normalize(h.cross(ov,rv,oD),oD);let s=ov.x,a=ov.y,c=ov.z,u=rv.x,f=rv.y,d=rv.z,p=oD.x,g=oD.y,m=oD.z,y=i.x,A=i.y,b=i.z,x=s*-y+a*-A+c*-b,T=p*-y+g*-A+m*-b,E=u*y+f*A+d*b;return l(n)?(n[0]=s,n[1]=p,n[2]=-u,n[3]=0,n[4]=a,n[5]=g,n[6]=-f,n[7]=0,n[8]=c,n[9]=m,n[10]=-d,n[11]=0,n[12]=x,n[13]=T,n[14]=E,n[15]=1,n):new e(s,a,c,x,p,g,m,T,-u,-f,-d,E,0,0,0,1)}static computePerspectiveFieldOfView(t,n,i,r,o){let a=1/Math.tan(t*.5),c=a/n,u=(r+i)/(i-r),f=2*r*i/(i-r);return o[0]=c,o[1]=0,o[2]=0,o[3]=0,o[4]=0,o[5]=a,o[6]=0,o[7]=0,o[8]=0,o[9]=0,o[10]=u,o[11]=-1,o[12]=0,o[13]=0,o[14]=f,o[15]=0,o}static computeOrthographicOffCenter(t,n,i,r,o,s,a){let c=1/(n-t),u=1/(r-i),f=1/(s-o),d=-(n+t)*c,p=-(r+i)*u,g=-(s+o)*f;return c*=2,u*=2,f*=-2,a[0]=c,a[1]=0,a[2]=0,a[3]=0,a[4]=0,a[5]=u,a[6]=0,a[7]=0,a[8]=0,a[9]=0,a[10]=f,a[11]=0,a[12]=d,a[13]=p,a[14]=g,a[15]=1,a}static computePerspectiveOffCenter(t,n,i,r,o,s,a){let c=2*o/(n-t),u=2*o/(r-i),f=(n+t)/(n-t),d=(r+i)/(r-i),p=-(s+o)/(s-o),g=-1,m=-2*s*o/(s-o);return a[0]=c,a[1]=0,a[2]=0,a[3]=0,a[4]=0,a[5]=u,a[6]=0,a[7]=0,a[8]=f,a[9]=d,a[10]=p,a[11]=g,a[12]=0,a[13]=0,a[14]=m,a[15]=0,a}static computeInfinitePerspectiveOffCenter(t,n,i,r,o,s){let a=2*o/(n-t),c=2*o/(r-i),u=(n+t)/(n-t),f=(r+i)/(r-i),d=-1,p=-1,g=-2*o;return s[0]=a,s[1]=0,s[2]=0,s[3]=0,s[4]=0,s[5]=c,s[6]=0,s[7]=0,s[8]=u,s[9]=f,s[10]=d,s[11]=p,s[12]=0,s[13]=0,s[14]=g,s[15]=0,s}static computeViewportTransformation(t,n,i,r){l(r)||(r=new e),t=t??H.EMPTY_OBJECT;let o=t.x??0,s=t.y??0,a=t.width??0,c=t.height??0;n=n??0,i=i??1;let u=a*.5,f=c*.5,d=(i-n)*.5,p=u,g=f,m=d,y=o+u,A=s+f,b=n+d,x=1;return r[0]=p,r[1]=0,r[2]=0,r[3]=0,r[4]=0,r[5]=g,r[6]=0,r[7]=0,r[8]=0,r[9]=0,r[10]=m,r[11]=0,r[12]=y,r[13]=A,r[14]=b,r[15]=x,r}static computeView(t,n,i,r,o){return o[0]=r.x,o[1]=i.x,o[2]=-n.x,o[3]=0,o[4]=r.y,o[5]=i.y,o[6]=-n.y,o[7]=0,o[8]=r.z,o[9]=i.z,o[10]=-n.z,o[11]=0,o[12]=-h.dot(r,t),o[13]=-h.dot(i,t),o[14]=h.dot(n,t),o[15]=1,o}static toArray(t,n){return l(n)?(n[0]=t[0],n[1]=t[1],n[2]=t[2],n[3]=t[3],n[4]=t[4],n[5]=t[5],n[6]=t[6],n[7]=t[7],n[8]=t[8],n[9]=t[9],n[10]=t[10],n[11]=t[11],n[12]=t[12],n[13]=t[13],n[14]=t[14],n[15]=t[15],n):[t[0],t[1],t[2],t[3],t[4],t[5],t[6],t[7],t[8],t[9],t[10],t[11],t[12],t[13],t[14],t[15]]}static getElementIndex(t,n){return t*4+n}static getColumn(t,n,i){let r=n*4,o=t[r],s=t[r+1],a=t[r+2],c=t[r+3];return i.x=o,i.y=s,i.z=a,i.w=c,i}static setColumn(t,n,i,r){r=e.clone(t,r);let o=n*4;return r[o]=i.x,r[o+1]=i.y,r[o+2]=i.z,r[o+3]=i.w,r}static getRow(t,n,i){let r=t[n],o=t[n+4],s=t[n+8],a=t[n+12];return i.x=r,i.y=o,i.z=s,i.w=a,i}static setRow(t,n,i,r){return r=e.clone(t,r),r[n]=i.x,r[n+4]=i.y,r[n+8]=i.z,r[n+12]=i.w,r}static setTranslation(t,n,i){return i[0]=t[0],i[1]=t[1],i[2]=t[2],i[3]=t[3],i[4]=t[4],i[5]=t[5],i[6]=t[6],i[7]=t[7],i[8]=t[8],i[9]=t[9],i[10]=t[10],i[11]=t[11],i[12]=n.x,i[13]=n.y,i[14]=n.z,i[15]=t[15],i}static setScale(t,n,i){let r=e.getScale(t,X3e),o=n.x/r.x,s=n.y/r.y,a=n.z/r.z;return i[0]=t[0]*o,i[1]=t[1]*o,i[2]=t[2]*o,i[3]=t[3],i[4]=t[4]*s,i[5]=t[5]*s,i[6]=t[6]*s,i[7]=t[7],i[8]=t[8]*a,i[9]=t[9]*a,i[10]=t[10]*a,i[11]=t[11],i[12]=t[12],i[13]=t[13],i[14]=t[14],i[15]=t[15],i}static setUniformScale(t,n,i){let r=e.getScale(t,K3e),o=n/r.x,s=n/r.y,a=n/r.z;return i[0]=t[0]*o,i[1]=t[1]*o,i[2]=t[2]*o,i[3]=t[3],i[4]=t[4]*s,i[5]=t[5]*s,i[6]=t[6]*s,i[7]=t[7],i[8]=t[8]*a,i[9]=t[9]*a,i[10]=t[10]*a,i[11]=t[11],i[12]=t[12],i[13]=t[13],i[14]=t[14],i[15]=t[15],i}static getScale(t,n){return n.x=h.magnitude(h.fromElements(t[0],t[1],t[2],zq)),n.y=h.magnitude(h.fromElements(t[4],t[5],t[6],zq)),n.z=h.magnitude(h.fromElements(t[8],t[9],t[10],zq)),n}static getMaximumScale(t){return e.getScale(t,lue),h.maximumComponent(lue)}static setRotation(t,n,i){let r=e.getScale(t,$3e);return i[0]=n[0]*r.x,i[1]=n[1]*r.x,i[2]=n[2]*r.x,i[3]=t[3],i[4]=n[3]*r.y,i[5]=n[4]*r.y,i[6]=n[5]*r.y,i[7]=t[7],i[8]=n[6]*r.z,i[9]=n[7]*r.z,i[10]=n[8]*r.z,i[11]=t[11],i[12]=t[12],i[13]=t[13],i[14]=t[14],i[15]=t[15],i}static getRotation(t,n){let i=e.getScale(t,J3e);return n[0]=t[0]/i.x,n[1]=t[1]/i.x,n[2]=t[2]/i.x,n[3]=t[4]/i.y,n[4]=t[5]/i.y,n[5]=t[6]/i.y,n[6]=t[8]/i.z,n[7]=t[9]/i.z,n[8]=t[10]/i.z,n}static multiply(t,n,i){let r=t[0],o=t[1],s=t[2],a=t[3],c=t[4],u=t[5],f=t[6],d=t[7],p=t[8],g=t[9],m=t[10],y=t[11],A=t[12],b=t[13],x=t[14],T=t[15],E=n[0],v=n[1],S=n[2],I=n[3],R=n[4],O=n[5],L=n[6],_=n[7],C=n[8],w=n[9],P=n[10],M=n[11],F=n[12],V=n[13],B=n[14],j=n[15],k=r*E+c*v+p*S+A*I,G=o*E+u*v+g*S+b*I,q=s*E+f*v+m*S+x*I,Q=a*E+d*v+y*S+T*I,W=r*R+c*O+p*L+A*_,J=o*R+u*O+g*L+b*_,Z=s*R+f*O+m*L+x*_,ae=a*R+d*O+y*L+T*_,Ae=r*C+c*w+p*P+A*M,fe=o*C+u*w+g*P+b*M,xe=s*C+f*w+m*P+x*M,ge=a*C+d*w+y*P+T*M,we=r*F+c*V+p*B+A*j,Se=o*F+u*V+g*B+b*j,Re=s*F+f*V+m*B+x*j,Qe=a*F+d*V+y*B+T*j;return i[0]=k,i[1]=G,i[2]=q,i[3]=Q,i[4]=W,i[5]=J,i[6]=Z,i[7]=ae,i[8]=Ae,i[9]=fe,i[10]=xe,i[11]=ge,i[12]=we,i[13]=Se,i[14]=Re,i[15]=Qe,i}static add(t,n,i){return i[0]=t[0]+n[0],i[1]=t[1]+n[1],i[2]=t[2]+n[2],i[3]=t[3]+n[3],i[4]=t[4]+n[4],i[5]=t[5]+n[5],i[6]=t[6]+n[6],i[7]=t[7]+n[7],i[8]=t[8]+n[8],i[9]=t[9]+n[9],i[10]=t[10]+n[10],i[11]=t[11]+n[11],i[12]=t[12]+n[12],i[13]=t[13]+n[13],i[14]=t[14]+n[14],i[15]=t[15]+n[15],i}static subtract(t,n,i){return i[0]=t[0]-n[0],i[1]=t[1]-n[1],i[2]=t[2]-n[2],i[3]=t[3]-n[3],i[4]=t[4]-n[4],i[5]=t[5]-n[5],i[6]=t[6]-n[6],i[7]=t[7]-n[7],i[8]=t[8]-n[8],i[9]=t[9]-n[9],i[10]=t[10]-n[10],i[11]=t[11]-n[11],i[12]=t[12]-n[12],i[13]=t[13]-n[13],i[14]=t[14]-n[14],i[15]=t[15]-n[15],i}static multiplyTransformation(t,n,i){let r=t[0],o=t[1],s=t[2],a=t[4],c=t[5],u=t[6],f=t[8],d=t[9],p=t[10],g=t[12],m=t[13],y=t[14],A=n[0],b=n[1],x=n[2],T=n[4],E=n[5],v=n[6],S=n[8],I=n[9],R=n[10],O=n[12],L=n[13],_=n[14],C=r*A+a*b+f*x,w=o*A+c*b+d*x,P=s*A+u*b+p*x,M=r*T+a*E+f*v,F=o*T+c*E+d*v,V=s*T+u*E+p*v,B=r*S+a*I+f*R,j=o*S+c*I+d*R,k=s*S+u*I+p*R,G=r*O+a*L+f*_+g,q=o*O+c*L+d*_+m,Q=s*O+u*L+p*_+y;return i[0]=C,i[1]=w,i[2]=P,i[3]=0,i[4]=M,i[5]=F,i[6]=V,i[7]=0,i[8]=B,i[9]=j,i[10]=k,i[11]=0,i[12]=G,i[13]=q,i[14]=Q,i[15]=1,i}static multiplyByMatrix3(t,n,i){let r=t[0],o=t[1],s=t[2],a=t[4],c=t[5],u=t[6],f=t[8],d=t[9],p=t[10],g=n[0],m=n[1],y=n[2],A=n[3],b=n[4],x=n[5],T=n[6],E=n[7],v=n[8],S=r*g+a*m+f*y,I=o*g+c*m+d*y,R=s*g+u*m+p*y,O=r*A+a*b+f*x,L=o*A+c*b+d*x,_=s*A+u*b+p*x,C=r*T+a*E+f*v,w=o*T+c*E+d*v,P=s*T+u*E+p*v;return i[0]=S,i[1]=I,i[2]=R,i[3]=0,i[4]=O,i[5]=L,i[6]=_,i[7]=0,i[8]=C,i[9]=w,i[10]=P,i[11]=0,i[12]=t[12],i[13]=t[13],i[14]=t[14],i[15]=t[15],i}static multiplyByTranslation(t,n,i){let r=n.x,o=n.y,s=n.z,a=r*t[0]+o*t[4]+s*t[8]+t[12],c=r*t[1]+o*t[5]+s*t[9]+t[13],u=r*t[2]+o*t[6]+s*t[10]+t[14];return i[0]=t[0],i[1]=t[1],i[2]=t[2],i[3]=t[3],i[4]=t[4],i[5]=t[5],i[6]=t[6],i[7]=t[7],i[8]=t[8],i[9]=t[9],i[10]=t[10],i[11]=t[11],i[12]=a,i[13]=c,i[14]=u,i[15]=t[15],i}static multiplyByScale(t,n,i){let r=n.x,o=n.y,s=n.z;return r===1&&o===1&&s===1?e.clone(t,i):(i[0]=r*t[0],i[1]=r*t[1],i[2]=r*t[2],i[3]=t[3],i[4]=o*t[4],i[5]=o*t[5],i[6]=o*t[6],i[7]=t[7],i[8]=s*t[8],i[9]=s*t[9],i[10]=s*t[10],i[11]=t[11],i[12]=t[12],i[13]=t[13],i[14]=t[14],i[15]=t[15],i)}static multiplyByUniformScale(t,n,i){return i[0]=t[0]*n,i[1]=t[1]*n,i[2]=t[2]*n,i[3]=t[3],i[4]=t[4]*n,i[5]=t[5]*n,i[6]=t[6]*n,i[7]=t[7],i[8]=t[8]*n,i[9]=t[9]*n,i[10]=t[10]*n,i[11]=t[11],i[12]=t[12],i[13]=t[13],i[14]=t[14],i[15]=t[15],i}static multiplyByVector(t,n,i){let r=n.x,o=n.y,s=n.z,a=n.w,c=t[0]*r+t[4]*o+t[8]*s+t[12]*a,u=t[1]*r+t[5]*o+t[9]*s+t[13]*a,f=t[2]*r+t[6]*o+t[10]*s+t[14]*a,d=t[3]*r+t[7]*o+t[11]*s+t[15]*a;return i.x=c,i.y=u,i.z=f,i.w=d,i}static multiplyByPointAsVector(t,n,i){let r=n.x,o=n.y,s=n.z,a=t[0]*r+t[4]*o+t[8]*s,c=t[1]*r+t[5]*o+t[9]*s,u=t[2]*r+t[6]*o+t[10]*s;return i.x=a,i.y=c,i.z=u,i}static multiplyByPoint(t,n,i){let r=n.x,o=n.y,s=n.z,a=t[0]*r+t[4]*o+t[8]*s+t[12],c=t[1]*r+t[5]*o+t[9]*s+t[13],u=t[2]*r+t[6]*o+t[10]*s+t[14];return i.x=a,i.y=c,i.z=u,i}static multiplyByScalar(t,n,i){return i[0]=t[0]*n,i[1]=t[1]*n,i[2]=t[2]*n,i[3]=t[3]*n,i[4]=t[4]*n,i[5]=t[5]*n,i[6]=t[6]*n,i[7]=t[7]*n,i[8]=t[8]*n,i[9]=t[9]*n,i[10]=t[10]*n,i[11]=t[11]*n,i[12]=t[12]*n,i[13]=t[13]*n,i[14]=t[14]*n,i[15]=t[15]*n,i}static negate(t,n){return n[0]=-t[0],n[1]=-t[1],n[2]=-t[2],n[3]=-t[3],n[4]=-t[4],n[5]=-t[5],n[6]=-t[6],n[7]=-t[7],n[8]=-t[8],n[9]=-t[9],n[10]=-t[10],n[11]=-t[11],n[12]=-t[12],n[13]=-t[13],n[14]=-t[14],n[15]=-t[15],n}static transpose(t,n){let i=t[1],r=t[2],o=t[3],s=t[6],a=t[7],c=t[11];return n[0]=t[0],n[1]=t[4],n[2]=t[8],n[3]=t[12],n[4]=i,n[5]=t[5],n[6]=t[9],n[7]=t[13],n[8]=r,n[9]=s,n[10]=t[10],n[11]=t[14],n[12]=o,n[13]=a,n[14]=c,n[15]=t[15],n}static abs(t,n){return n[0]=Math.abs(t[0]),n[1]=Math.abs(t[1]),n[2]=Math.abs(t[2]),n[3]=Math.abs(t[3]),n[4]=Math.abs(t[4]),n[5]=Math.abs(t[5]),n[6]=Math.abs(t[6]),n[7]=Math.abs(t[7]),n[8]=Math.abs(t[8]),n[9]=Math.abs(t[9]),n[10]=Math.abs(t[10]),n[11]=Math.abs(t[11]),n[12]=Math.abs(t[12]),n[13]=Math.abs(t[13]),n[14]=Math.abs(t[14]),n[15]=Math.abs(t[15]),n}static equals(t,n){return t===n||l(t)&&l(n)&&t[12]===n[12]&&t[13]===n[13]&&t[14]===n[14]&&t[0]===n[0]&&t[1]===n[1]&&t[2]===n[2]&&t[4]===n[4]&&t[5]===n[5]&&t[6]===n[6]&&t[8]===n[8]&&t[9]===n[9]&&t[10]===n[10]&&t[3]===n[3]&&t[7]===n[7]&&t[11]===n[11]&&t[15]===n[15]}static equalsEpsilon(t,n,i){return i=i??0,t===n||l(t)&&l(n)&&Math.abs(t[0]-n[0])<=i&&Math.abs(t[1]-n[1])<=i&&Math.abs(t[2]-n[2])<=i&&Math.abs(t[3]-n[3])<=i&&Math.abs(t[4]-n[4])<=i&&Math.abs(t[5]-n[5])<=i&&Math.abs(t[6]-n[6])<=i&&Math.abs(t[7]-n[7])<=i&&Math.abs(t[8]-n[8])<=i&&Math.abs(t[9]-n[9])<=i&&Math.abs(t[10]-n[10])<=i&&Math.abs(t[11]-n[11])<=i&&Math.abs(t[12]-n[12])<=i&&Math.abs(t[13]-n[13])<=i&&Math.abs(t[14]-n[14])<=i&&Math.abs(t[15]-n[15])<=i}static getTranslation(t,n){return n.x=t[12],n.y=t[13],n.z=t[14],n}static getMatrix3(t,n){return n[0]=t[0],n[1]=t[1],n[2]=t[2],n[3]=t[4],n[4]=t[5],n[5]=t[6],n[6]=t[8],n[7]=t[9],n[8]=t[10],n}static inverse(t,n){let i=t[0],r=t[4],o=t[8],s=t[12],a=t[1],c=t[5],u=t[9],f=t[13],d=t[2],p=t[6],g=t[10],m=t[14],y=t[3],A=t[7],b=t[11],x=t[15],T=g*x,E=m*b,v=p*x,S=m*A,I=p*b,R=g*A,O=d*x,L=m*y,_=d*b,C=g*y,w=d*A,P=p*y,M=T*c+S*u+I*f-(E*c+v*u+R*f),F=E*a+O*u+C*f-(T*a+L*u+_*f),V=v*a+L*c+w*f-(S*a+O*c+P*f),B=R*a+_*c+P*u-(I*a+C*c+w*u),j=E*r+v*o+R*s-(T*r+S*o+I*s),k=T*i+L*o+_*s-(E*i+O*o+C*s),G=S*i+O*r+P*s-(v*i+L*r+w*s),q=I*i+C*r+w*o-(R*i+_*r+P*o);T=o*f,E=s*u,v=r*f,S=s*c,I=r*u,R=o*c,O=i*f,L=s*a,_=i*u,C=o*a,w=i*c,P=r*a;let Q=T*A+S*b+I*x-(E*A+v*b+R*x),W=E*y+O*b+C*x-(T*y+L*b+_*x),J=v*y+L*A+w*x-(S*y+O*A+P*x),Z=R*y+_*A+P*b-(I*y+C*A+w*b),ae=v*g+R*m+E*p-(I*m+T*p+S*g),Ae=_*m+T*d+L*g-(O*g+C*m+E*d),fe=O*p+P*m+S*d-(w*m+v*d+L*p),xe=w*g+I*d+C*p-(_*p+P*g+R*d),ge=i*M+r*F+o*V+s*B;if(Math.abs(ge)<D.EPSILON21){if($.equalsEpsilon(e.getMatrix3(t,Z3e),Q3e,D.EPSILON7)&&se.equals(e.getRow(t,3,eUe),tUe))return n[0]=0,n[1]=0,n[2]=0,n[3]=0,n[4]=0,n[5]=0,n[6]=0,n[7]=0,n[8]=0,n[9]=0,n[10]=0,n[11]=0,n[12]=-t[12],n[13]=-t[13],n[14]=-t[14],n[15]=1,n;throw new oe("matrix is not invertible because its determinate is zero.")}return ge=1/ge,n[0]=M*ge,n[1]=F*ge,n[2]=V*ge,n[3]=B*ge,n[4]=j*ge,n[5]=k*ge,n[6]=G*ge,n[7]=q*ge,n[8]=Q*ge,n[9]=W*ge,n[10]=J*ge,n[11]=Z*ge,n[12]=ae*ge,n[13]=Ae*ge,n[14]=fe*ge,n[15]=xe*ge,n}static inverseTransformation(t,n){let i=t[0],r=t[1],o=t[2],s=t[4],a=t[5],c=t[6],u=t[8],f=t[9],d=t[10],p=t[12],g=t[13],m=t[14],y=-i*p-r*g-o*m,A=-s*p-a*g-c*m,b=-u*p-f*g-d*m;return n[0]=i,n[1]=s,n[2]=u,n[3]=0,n[4]=r,n[5]=a,n[6]=f,n[7]=0,n[8]=o,n[9]=c,n[10]=d,n[11]=0,n[12]=y,n[13]=A,n[14]=b,n[15]=1,n}static inverseTranspose(t,n){return e.inverse(e.transpose(t,nUe),n)}get length(){return e.packedLength}clone(t){return e.clone(this,t)}equals(t){return e.equals(this,t)}static equalsArray(t,n,i){return t[0]===n[i]&&t[1]===n[i+1]&&t[2]===n[i+2]&&t[3]===n[i+3]&&t[4]===n[i+4]&&t[5]===n[i+5]&&t[6]===n[i+6]&&t[7]===n[i+7]&&t[8]===n[i+8]&&t[9]===n[i+9]&&t[10]===n[i+10]&&t[11]===n[i+11]&&t[12]===n[i+12]&&t[13]===n[i+13]&&t[14]===n[i+14]&&t[15]===n[i+15]}equalsEpsilon(t,n){return e.equalsEpsilon(this,t,n)}toString(){return`(${this[0]}, ${this[4]}, ${this[8]}, ${this[12]}) (${this[1]}, ${this[5]}, ${this[9]}, ${this[13]}) (${this[2]}, ${this[6]}, ${this[10]}, ${this[14]}) -(${this[3]}, ${this[7]}, ${this[11]}, ${this[15]})`}};go.packedLength=16;go.fromArray=go.unpack;go.IDENTITY=new go(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1);go.ZERO=new go(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0);go.COLUMN0ROW0=0;go.COLUMN0ROW1=1;go.COLUMN0ROW2=2;go.COLUMN0ROW3=3;go.COLUMN1ROW0=4;go.COLUMN1ROW1=5;go.COLUMN1ROW2=6;go.COLUMN1ROW3=7;go.COLUMN2ROW0=8;go.COLUMN2ROW1=9;go.COLUMN2ROW2=10;go.COLUMN2ROW3=11;go.COLUMN3ROW0=12;go.COLUMN3ROW1=13;go.COLUMN3ROW2=14;go.COLUMN3ROW3=15;var rv=new h,ov=new h,oD=new h,Y3e=new h,X3e=new h,zq=new h,lue=new h,K3e=new h,$3e=new h,J3e=new $,Z3e=new $,Q3e=new se,eUe=new se(0,0,0,1),tUe=new go,N=go;var uue={DEPTH_BUFFER_BIT:256,STENCIL_BUFFER_BIT:1024,COLOR_BUFFER_BIT:16384,POINTS:0,LINES:1,LINE_LOOP:2,LINE_STRIP:3,TRIANGLES:4,TRIANGLE_STRIP:5,TRIANGLE_FAN:6,ZERO:0,ONE:1,SRC_COLOR:768,ONE_MINUS_SRC_COLOR:769,SRC_ALPHA:770,ONE_MINUS_SRC_ALPHA:771,DST_ALPHA:772,ONE_MINUS_DST_ALPHA:773,DST_COLOR:774,ONE_MINUS_DST_COLOR:775,SRC_ALPHA_SATURATE:776,FUNC_ADD:32774,BLEND_EQUATION:32777,BLEND_EQUATION_RGB:32777,BLEND_EQUATION_ALPHA:34877,FUNC_SUBTRACT:32778,FUNC_REVERSE_SUBTRACT:32779,BLEND_DST_RGB:32968,BLEND_SRC_RGB:32969,BLEND_DST_ALPHA:32970,BLEND_SRC_ALPHA:32971,CONSTANT_COLOR:32769,ONE_MINUS_CONSTANT_COLOR:32770,CONSTANT_ALPHA:32771,ONE_MINUS_CONSTANT_ALPHA:32772,BLEND_COLOR:32773,ARRAY_BUFFER:34962,ELEMENT_ARRAY_BUFFER:34963,ARRAY_BUFFER_BINDING:34964,ELEMENT_ARRAY_BUFFER_BINDING:34965,STREAM_DRAW:35040,STATIC_DRAW:35044,DYNAMIC_DRAW:35048,BUFFER_SIZE:34660,BUFFER_USAGE:34661,CURRENT_VERTEX_ATTRIB:34342,FRONT:1028,BACK:1029,FRONT_AND_BACK:1032,CULL_FACE:2884,BLEND:3042,DITHER:3024,STENCIL_TEST:2960,DEPTH_TEST:2929,SCISSOR_TEST:3089,POLYGON_OFFSET_FILL:32823,SAMPLE_ALPHA_TO_COVERAGE:32926,SAMPLE_COVERAGE:32928,NO_ERROR:0,INVALID_ENUM:1280,INVALID_VALUE:1281,INVALID_OPERATION:1282,OUT_OF_MEMORY:1285,CW:2304,CCW:2305,LINE_WIDTH:2849,ALIASED_POINT_SIZE_RANGE:33901,ALIASED_LINE_WIDTH_RANGE:33902,CULL_FACE_MODE:2885,FRONT_FACE:2886,DEPTH_RANGE:2928,DEPTH_WRITEMASK:2930,DEPTH_CLEAR_VALUE:2931,DEPTH_FUNC:2932,STENCIL_CLEAR_VALUE:2961,STENCIL_FUNC:2962,STENCIL_FAIL:2964,STENCIL_PASS_DEPTH_FAIL:2965,STENCIL_PASS_DEPTH_PASS:2966,STENCIL_REF:2967,STENCIL_VALUE_MASK:2963,STENCIL_WRITEMASK:2968,STENCIL_BACK_FUNC:34816,STENCIL_BACK_FAIL:34817,STENCIL_BACK_PASS_DEPTH_FAIL:34818,STENCIL_BACK_PASS_DEPTH_PASS:34819,STENCIL_BACK_REF:36003,STENCIL_BACK_VALUE_MASK:36004,STENCIL_BACK_WRITEMASK:36005,VIEWPORT:2978,SCISSOR_BOX:3088,COLOR_CLEAR_VALUE:3106,COLOR_WRITEMASK:3107,UNPACK_ALIGNMENT:3317,PACK_ALIGNMENT:3333,MAX_TEXTURE_SIZE:3379,MAX_VIEWPORT_DIMS:3386,SUBPIXEL_BITS:3408,RED_BITS:3410,GREEN_BITS:3411,BLUE_BITS:3412,ALPHA_BITS:3413,DEPTH_BITS:3414,STENCIL_BITS:3415,POLYGON_OFFSET_UNITS:10752,POLYGON_OFFSET_FACTOR:32824,TEXTURE_BINDING_2D:32873,SAMPLE_BUFFERS:32936,SAMPLES:32937,SAMPLE_COVERAGE_VALUE:32938,SAMPLE_COVERAGE_INVERT:32939,COMPRESSED_TEXTURE_FORMATS:34467,DONT_CARE:4352,FASTEST:4353,NICEST:4354,GENERATE_MIPMAP_HINT:33170,BYTE:5120,UNSIGNED_BYTE:5121,SHORT:5122,UNSIGNED_SHORT:5123,INT:5124,UNSIGNED_INT:5125,FLOAT:5126,DEPTH_COMPONENT:6402,ALPHA:6406,RGB:6407,RGBA:6408,LUMINANCE:6409,LUMINANCE_ALPHA:6410,UNSIGNED_SHORT_4_4_4_4:32819,UNSIGNED_SHORT_5_5_5_1:32820,UNSIGNED_SHORT_5_6_5:33635,FRAGMENT_SHADER:35632,VERTEX_SHADER:35633,MAX_VERTEX_ATTRIBS:34921,MAX_VERTEX_UNIFORM_VECTORS:36347,MAX_VARYING_VECTORS:36348,MAX_COMBINED_TEXTURE_IMAGE_UNITS:35661,MAX_VERTEX_TEXTURE_IMAGE_UNITS:35660,MAX_TEXTURE_IMAGE_UNITS:34930,MAX_FRAGMENT_UNIFORM_VECTORS:36349,SHADER_TYPE:35663,DELETE_STATUS:35712,LINK_STATUS:35714,VALIDATE_STATUS:35715,ATTACHED_SHADERS:35717,ACTIVE_UNIFORMS:35718,ACTIVE_ATTRIBUTES:35721,SHADING_LANGUAGE_VERSION:35724,CURRENT_PROGRAM:35725,NEVER:512,LESS:513,EQUAL:514,LEQUAL:515,GREATER:516,NOTEQUAL:517,GEQUAL:518,ALWAYS:519,KEEP:7680,REPLACE:7681,INCR:7682,DECR:7683,INVERT:5386,INCR_WRAP:34055,DECR_WRAP:34056,VENDOR:7936,RENDERER:7937,VERSION:7938,NEAREST:9728,LINEAR:9729,NEAREST_MIPMAP_NEAREST:9984,LINEAR_MIPMAP_NEAREST:9985,NEAREST_MIPMAP_LINEAR:9986,LINEAR_MIPMAP_LINEAR:9987,TEXTURE_MAG_FILTER:10240,TEXTURE_MIN_FILTER:10241,TEXTURE_WRAP_S:10242,TEXTURE_WRAP_T:10243,TEXTURE_2D:3553,TEXTURE:5890,TEXTURE_CUBE_MAP:34067,TEXTURE_BINDING_CUBE_MAP:34068,TEXTURE_CUBE_MAP_POSITIVE_X:34069,TEXTURE_CUBE_MAP_NEGATIVE_X:34070,TEXTURE_CUBE_MAP_POSITIVE_Y:34071,TEXTURE_CUBE_MAP_NEGATIVE_Y:34072,TEXTURE_CUBE_MAP_POSITIVE_Z:34073,TEXTURE_CUBE_MAP_NEGATIVE_Z:34074,MAX_CUBE_MAP_TEXTURE_SIZE:34076,TEXTURE0:33984,TEXTURE1:33985,TEXTURE2:33986,TEXTURE3:33987,TEXTURE4:33988,TEXTURE5:33989,TEXTURE6:33990,TEXTURE7:33991,TEXTURE8:33992,TEXTURE9:33993,TEXTURE10:33994,TEXTURE11:33995,TEXTURE12:33996,TEXTURE13:33997,TEXTURE14:33998,TEXTURE15:33999,TEXTURE16:34e3,TEXTURE17:34001,TEXTURE18:34002,TEXTURE19:34003,TEXTURE20:34004,TEXTURE21:34005,TEXTURE22:34006,TEXTURE23:34007,TEXTURE24:34008,TEXTURE25:34009,TEXTURE26:34010,TEXTURE27:34011,TEXTURE28:34012,TEXTURE29:34013,TEXTURE30:34014,TEXTURE31:34015,ACTIVE_TEXTURE:34016,REPEAT:10497,CLAMP_TO_EDGE:33071,MIRRORED_REPEAT:33648,FLOAT_VEC2:35664,FLOAT_VEC3:35665,FLOAT_VEC4:35666,INT_VEC2:35667,INT_VEC3:35668,INT_VEC4:35669,BOOL:35670,BOOL_VEC2:35671,BOOL_VEC3:35672,BOOL_VEC4:35673,FLOAT_MAT2:35674,FLOAT_MAT3:35675,FLOAT_MAT4:35676,SAMPLER_2D:35678,SAMPLER_CUBE:35680,VERTEX_ATTRIB_ARRAY_ENABLED:34338,VERTEX_ATTRIB_ARRAY_SIZE:34339,VERTEX_ATTRIB_ARRAY_STRIDE:34340,VERTEX_ATTRIB_ARRAY_TYPE:34341,VERTEX_ATTRIB_ARRAY_NORMALIZED:34922,VERTEX_ATTRIB_ARRAY_POINTER:34373,VERTEX_ATTRIB_ARRAY_BUFFER_BINDING:34975,IMPLEMENTATION_COLOR_READ_TYPE:35738,IMPLEMENTATION_COLOR_READ_FORMAT:35739,COMPILE_STATUS:35713,LOW_FLOAT:36336,MEDIUM_FLOAT:36337,HIGH_FLOAT:36338,LOW_INT:36339,MEDIUM_INT:36340,HIGH_INT:36341,FRAMEBUFFER:36160,RENDERBUFFER:36161,RGBA4:32854,RGB5_A1:32855,RGB565:36194,DEPTH_COMPONENT16:33189,STENCIL_INDEX:6401,STENCIL_INDEX8:36168,DEPTH_STENCIL:34041,RENDERBUFFER_WIDTH:36162,RENDERBUFFER_HEIGHT:36163,RENDERBUFFER_INTERNAL_FORMAT:36164,RENDERBUFFER_RED_SIZE:36176,RENDERBUFFER_GREEN_SIZE:36177,RENDERBUFFER_BLUE_SIZE:36178,RENDERBUFFER_ALPHA_SIZE:36179,RENDERBUFFER_DEPTH_SIZE:36180,RENDERBUFFER_STENCIL_SIZE:36181,FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE:36048,FRAMEBUFFER_ATTACHMENT_OBJECT_NAME:36049,FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL:36050,FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE:36051,COLOR_ATTACHMENT0:36064,DEPTH_ATTACHMENT:36096,STENCIL_ATTACHMENT:36128,DEPTH_STENCIL_ATTACHMENT:33306,NONE:0,FRAMEBUFFER_COMPLETE:36053,FRAMEBUFFER_INCOMPLETE_ATTACHMENT:36054,FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT:36055,FRAMEBUFFER_INCOMPLETE_DIMENSIONS:36057,FRAMEBUFFER_UNSUPPORTED:36061,FRAMEBUFFER_BINDING:36006,RENDERBUFFER_BINDING:36007,MAX_RENDERBUFFER_SIZE:34024,INVALID_FRAMEBUFFER_OPERATION:1286,UNPACK_FLIP_Y_WEBGL:37440,UNPACK_PREMULTIPLY_ALPHA_WEBGL:37441,CONTEXT_LOST_WEBGL:37442,UNPACK_COLORSPACE_CONVERSION_WEBGL:37443,BROWSER_DEFAULT_WEBGL:37444,COMPRESSED_RGB_S3TC_DXT1_EXT:33776,COMPRESSED_RGBA_S3TC_DXT1_EXT:33777,COMPRESSED_RGBA_S3TC_DXT3_EXT:33778,COMPRESSED_RGBA_S3TC_DXT5_EXT:33779,COMPRESSED_RGB_PVRTC_4BPPV1_IMG:35840,COMPRESSED_RGB_PVRTC_2BPPV1_IMG:35841,COMPRESSED_RGBA_PVRTC_4BPPV1_IMG:35842,COMPRESSED_RGBA_PVRTC_2BPPV1_IMG:35843,COMPRESSED_RGBA_ASTC_4x4_WEBGL:37808,COMPRESSED_RGB_ETC1_WEBGL:36196,COMPRESSED_RGBA_BPTC_UNORM:36492,HALF_FLOAT_OES:36193,DOUBLE:5130,READ_BUFFER:3074,UNPACK_ROW_LENGTH:3314,UNPACK_SKIP_ROWS:3315,UNPACK_SKIP_PIXELS:3316,PACK_ROW_LENGTH:3330,PACK_SKIP_ROWS:3331,PACK_SKIP_PIXELS:3332,COLOR:6144,DEPTH:6145,STENCIL:6146,RED:6403,RGB8:32849,RGBA8:32856,RGB10_A2:32857,TEXTURE_BINDING_3D:32874,UNPACK_SKIP_IMAGES:32877,UNPACK_IMAGE_HEIGHT:32878,TEXTURE_3D:32879,TEXTURE_WRAP_R:32882,MAX_3D_TEXTURE_SIZE:32883,UNSIGNED_INT_2_10_10_10_REV:33640,MAX_ELEMENTS_VERTICES:33e3,MAX_ELEMENTS_INDICES:33001,TEXTURE_MIN_LOD:33082,TEXTURE_MAX_LOD:33083,TEXTURE_BASE_LEVEL:33084,TEXTURE_MAX_LEVEL:33085,MIN:32775,MAX:32776,DEPTH_COMPONENT24:33190,MAX_TEXTURE_LOD_BIAS:34045,TEXTURE_COMPARE_MODE:34892,TEXTURE_COMPARE_FUNC:34893,CURRENT_QUERY:34917,QUERY_RESULT:34918,QUERY_RESULT_AVAILABLE:34919,STREAM_READ:35041,STREAM_COPY:35042,STATIC_READ:35045,STATIC_COPY:35046,DYNAMIC_READ:35049,DYNAMIC_COPY:35050,MAX_DRAW_BUFFERS:34852,DRAW_BUFFER0:34853,DRAW_BUFFER1:34854,DRAW_BUFFER2:34855,DRAW_BUFFER3:34856,DRAW_BUFFER4:34857,DRAW_BUFFER5:34858,DRAW_BUFFER6:34859,DRAW_BUFFER7:34860,DRAW_BUFFER8:34861,DRAW_BUFFER9:34862,DRAW_BUFFER10:34863,DRAW_BUFFER11:34864,DRAW_BUFFER12:34865,DRAW_BUFFER13:34866,DRAW_BUFFER14:34867,DRAW_BUFFER15:34868,MAX_FRAGMENT_UNIFORM_COMPONENTS:35657,MAX_VERTEX_UNIFORM_COMPONENTS:35658,SAMPLER_3D:35679,SAMPLER_2D_SHADOW:35682,FRAGMENT_SHADER_DERIVATIVE_HINT:35723,PIXEL_PACK_BUFFER:35051,PIXEL_UNPACK_BUFFER:35052,PIXEL_PACK_BUFFER_BINDING:35053,PIXEL_UNPACK_BUFFER_BINDING:35055,FLOAT_MAT2x3:35685,FLOAT_MAT2x4:35686,FLOAT_MAT3x2:35687,FLOAT_MAT3x4:35688,FLOAT_MAT4x2:35689,FLOAT_MAT4x3:35690,SRGB:35904,SRGB8:35905,SRGB8_ALPHA8:35907,COMPARE_REF_TO_TEXTURE:34894,RGBA32F:34836,RGB32F:34837,RGBA16F:34842,RGB16F:34843,VERTEX_ATTRIB_ARRAY_INTEGER:35069,MAX_ARRAY_TEXTURE_LAYERS:35071,MIN_PROGRAM_TEXEL_OFFSET:35076,MAX_PROGRAM_TEXEL_OFFSET:35077,MAX_VARYING_COMPONENTS:35659,TEXTURE_2D_ARRAY:35866,TEXTURE_BINDING_2D_ARRAY:35869,R11F_G11F_B10F:35898,UNSIGNED_INT_10F_11F_11F_REV:35899,RGB9_E5:35901,UNSIGNED_INT_5_9_9_9_REV:35902,TRANSFORM_FEEDBACK_BUFFER_MODE:35967,MAX_TRANSFORM_FEEDBACK_SEPARATE_COMPONENTS:35968,TRANSFORM_FEEDBACK_VARYINGS:35971,TRANSFORM_FEEDBACK_BUFFER_START:35972,TRANSFORM_FEEDBACK_BUFFER_SIZE:35973,TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN:35976,RASTERIZER_DISCARD:35977,MAX_TRANSFORM_FEEDBACK_INTERLEAVED_COMPONENTS:35978,MAX_TRANSFORM_FEEDBACK_SEPARATE_ATTRIBS:35979,INTERLEAVED_ATTRIBS:35980,SEPARATE_ATTRIBS:35981,TRANSFORM_FEEDBACK_BUFFER:35982,TRANSFORM_FEEDBACK_BUFFER_BINDING:35983,RGBA32UI:36208,RGB32UI:36209,RGBA16UI:36214,RGB16UI:36215,RGBA8UI:36220,RGB8UI:36221,RGBA32I:36226,RGB32I:36227,RGBA16I:36232,RGB16I:36233,RGBA8I:36238,RGB8I:36239,RED_INTEGER:36244,RGB_INTEGER:36248,RGBA_INTEGER:36249,SAMPLER_2D_ARRAY:36289,SAMPLER_2D_ARRAY_SHADOW:36292,SAMPLER_CUBE_SHADOW:36293,UNSIGNED_INT_VEC2:36294,UNSIGNED_INT_VEC3:36295,UNSIGNED_INT_VEC4:36296,INT_SAMPLER_2D:36298,INT_SAMPLER_3D:36299,INT_SAMPLER_CUBE:36300,INT_SAMPLER_2D_ARRAY:36303,UNSIGNED_INT_SAMPLER_2D:36306,UNSIGNED_INT_SAMPLER_3D:36307,UNSIGNED_INT_SAMPLER_CUBE:36308,UNSIGNED_INT_SAMPLER_2D_ARRAY:36311,DEPTH_COMPONENT32F:36012,DEPTH32F_STENCIL8:36013,FLOAT_32_UNSIGNED_INT_24_8_REV:36269,FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING:33296,FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE:33297,FRAMEBUFFER_ATTACHMENT_RED_SIZE:33298,FRAMEBUFFER_ATTACHMENT_GREEN_SIZE:33299,FRAMEBUFFER_ATTACHMENT_BLUE_SIZE:33300,FRAMEBUFFER_ATTACHMENT_ALPHA_SIZE:33301,FRAMEBUFFER_ATTACHMENT_DEPTH_SIZE:33302,FRAMEBUFFER_ATTACHMENT_STENCIL_SIZE:33303,FRAMEBUFFER_DEFAULT:33304,UNSIGNED_INT_24_8:34042,DEPTH24_STENCIL8:35056,UNSIGNED_NORMALIZED:35863,DRAW_FRAMEBUFFER_BINDING:36006,READ_FRAMEBUFFER:36008,DRAW_FRAMEBUFFER:36009,READ_FRAMEBUFFER_BINDING:36010,RENDERBUFFER_SAMPLES:36011,FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER:36052,MAX_COLOR_ATTACHMENTS:36063,COLOR_ATTACHMENT1:36065,COLOR_ATTACHMENT2:36066,COLOR_ATTACHMENT3:36067,COLOR_ATTACHMENT4:36068,COLOR_ATTACHMENT5:36069,COLOR_ATTACHMENT6:36070,COLOR_ATTACHMENT7:36071,COLOR_ATTACHMENT8:36072,COLOR_ATTACHMENT9:36073,COLOR_ATTACHMENT10:36074,COLOR_ATTACHMENT11:36075,COLOR_ATTACHMENT12:36076,COLOR_ATTACHMENT13:36077,COLOR_ATTACHMENT14:36078,COLOR_ATTACHMENT15:36079,FRAMEBUFFER_INCOMPLETE_MULTISAMPLE:36182,MAX_SAMPLES:36183,HALF_FLOAT:5131,RG:33319,RG_INTEGER:33320,R8:33321,RG8:33323,R16F:33325,R32F:33326,RG16F:33327,RG32F:33328,R8I:33329,R8UI:33330,R16I:33331,R16UI:33332,R32I:33333,R32UI:33334,RG8I:33335,RG8UI:33336,RG16I:33337,RG16UI:33338,RG32I:33339,RG32UI:33340,VERTEX_ARRAY_BINDING:34229,R8_SNORM:36756,RG8_SNORM:36757,RGB8_SNORM:36758,RGBA8_SNORM:36759,SIGNED_NORMALIZED:36764,COPY_READ_BUFFER:36662,COPY_WRITE_BUFFER:36663,COPY_READ_BUFFER_BINDING:36662,COPY_WRITE_BUFFER_BINDING:36663,UNIFORM_BUFFER:35345,UNIFORM_BUFFER_BINDING:35368,UNIFORM_BUFFER_START:35369,UNIFORM_BUFFER_SIZE:35370,MAX_VERTEX_UNIFORM_BLOCKS:35371,MAX_FRAGMENT_UNIFORM_BLOCKS:35373,MAX_COMBINED_UNIFORM_BLOCKS:35374,MAX_UNIFORM_BUFFER_BINDINGS:35375,MAX_UNIFORM_BLOCK_SIZE:35376,MAX_COMBINED_VERTEX_UNIFORM_COMPONENTS:35377,MAX_COMBINED_FRAGMENT_UNIFORM_COMPONENTS:35379,UNIFORM_BUFFER_OFFSET_ALIGNMENT:35380,ACTIVE_UNIFORM_BLOCKS:35382,UNIFORM_TYPE:35383,UNIFORM_SIZE:35384,UNIFORM_BLOCK_INDEX:35386,UNIFORM_OFFSET:35387,UNIFORM_ARRAY_STRIDE:35388,UNIFORM_MATRIX_STRIDE:35389,UNIFORM_IS_ROW_MAJOR:35390,UNIFORM_BLOCK_BINDING:35391,UNIFORM_BLOCK_DATA_SIZE:35392,UNIFORM_BLOCK_ACTIVE_UNIFORMS:35394,UNIFORM_BLOCK_ACTIVE_UNIFORM_INDICES:35395,UNIFORM_BLOCK_REFERENCED_BY_VERTEX_SHADER:35396,UNIFORM_BLOCK_REFERENCED_BY_FRAGMENT_SHADER:35398,INVALID_INDEX:4294967295,MAX_VERTEX_OUTPUT_COMPONENTS:37154,MAX_FRAGMENT_INPUT_COMPONENTS:37157,MAX_SERVER_WAIT_TIMEOUT:37137,OBJECT_TYPE:37138,SYNC_CONDITION:37139,SYNC_STATUS:37140,SYNC_FLAGS:37141,SYNC_FENCE:37142,SYNC_GPU_COMMANDS_COMPLETE:37143,UNSIGNALED:37144,SIGNALED:37145,ALREADY_SIGNALED:37146,TIMEOUT_EXPIRED:37147,CONDITION_SATISFIED:37148,WAIT_FAILED:37149,SYNC_FLUSH_COMMANDS_BIT:1,VERTEX_ATTRIB_ARRAY_DIVISOR:35070,ANY_SAMPLES_PASSED:35887,ANY_SAMPLES_PASSED_CONSERVATIVE:36202,SAMPLER_BINDING:35097,RGB10_A2UI:36975,INT_2_10_10_10_REV:36255,TRANSFORM_FEEDBACK:36386,TRANSFORM_FEEDBACK_PAUSED:36387,TRANSFORM_FEEDBACK_ACTIVE:36388,TRANSFORM_FEEDBACK_BINDING:36389,COMPRESSED_R11_EAC:37488,COMPRESSED_SIGNED_R11_EAC:37489,COMPRESSED_RG11_EAC:37490,COMPRESSED_SIGNED_RG11_EAC:37491,COMPRESSED_RGB8_ETC2:37492,COMPRESSED_SRGB8_ETC2:37493,COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2:37494,COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2:37495,COMPRESSED_RGBA8_ETC2_EAC:37496,COMPRESSED_SRGB8_ALPHA8_ETC2_EAC:37497,TEXTURE_IMMUTABLE_FORMAT:37167,MAX_ELEMENT_INDEX:36203,TEXTURE_IMMUTABLE_LEVELS:33503,MAX_TEXTURE_MAX_ANISOTROPY_EXT:34047};Object.freeze(uue);var te=uue;var nUe=new h;function Nt(e){this._size=e.size,this._datatype=e.datatype,this.getValue=e.getValue}var nc={};nc[te.FLOAT]="float";nc[te.FLOAT_VEC2]="vec2";nc[te.FLOAT_VEC3]="vec3";nc[te.FLOAT_VEC4]="vec4";nc[te.INT]="int";nc[te.INT_VEC2]="ivec2";nc[te.INT_VEC3]="ivec3";nc[te.INT_VEC4]="ivec4";nc[te.BOOL]="bool";nc[te.BOOL_VEC2]="bvec2";nc[te.BOOL_VEC3]="bvec3";nc[te.BOOL_VEC4]="bvec4";nc[te.FLOAT_MAT2]="mat2";nc[te.FLOAT_MAT3]="mat3";nc[te.FLOAT_MAT4]="mat4";nc[te.SAMPLER_2D]="sampler2D";nc[te.SAMPLER_CUBE]="samplerCube";Nt.prototype.getDeclaration=function(e){let t=`uniform ${nc[this._datatype]} ${e}`,n=this._size;return n===1?t+=";":t+=`[${n.toString()}];`,t};var iUe={czm_viewport:new Nt({size:1,datatype:te.FLOAT_VEC4,getValue:function(e){return e.viewportCartesian4}}),czm_viewportOrthographic:new Nt({size:1,datatype:te.FLOAT_MAT4,getValue:function(e){return e.viewportOrthographic}}),czm_viewportTransformation:new Nt({size:1,datatype:te.FLOAT_MAT4,getValue:function(e){return e.viewportTransformation}}),czm_globeDepthTexture:new Nt({size:1,datatype:te.SAMPLER_2D,getValue:function(e){return e.globeDepthTexture}}),czm_edgeIdTexture:new Nt({size:1,datatype:te.SAMPLER_2D,getValue:function(e){return e.edgeIdTexture}}),czm_edgeColorTexture:new Nt({size:1,datatype:te.SAMPLER_2D,getValue:function(e){return e.edgeColorTexture}}),czm_edgeDepthTexture:new Nt({size:1,datatype:te.SAMPLER_2D,getValue:function(e){return e.edgeDepthTexture}}),czm_planarFillIdTexture:new Nt({size:1,datatype:te.SAMPLER_2D,getValue:function(e){return e.planarFillIdTexture}}),czm_model:new Nt({size:1,datatype:te.FLOAT_MAT4,getValue:function(e){return e.model}}),czm_inverseModel:new Nt({size:1,datatype:te.FLOAT_MAT4,getValue:function(e){return e.inverseModel}}),czm_view:new Nt({size:1,datatype:te.FLOAT_MAT4,getValue:function(e){return e.view}}),czm_view3D:new Nt({size:1,datatype:te.FLOAT_MAT4,getValue:function(e){return e.view3D}}),czm_viewRotation:new Nt({size:1,datatype:te.FLOAT_MAT3,getValue:function(e){return e.viewRotation}}),czm_viewRotation3D:new Nt({size:1,datatype:te.FLOAT_MAT3,getValue:function(e){return e.viewRotation3D}}),czm_inverseView:new Nt({size:1,datatype:te.FLOAT_MAT4,getValue:function(e){return e.inverseView}}),czm_inverseView3D:new Nt({size:1,datatype:te.FLOAT_MAT4,getValue:function(e){return e.inverseView3D}}),czm_inverseViewRotation:new Nt({size:1,datatype:te.FLOAT_MAT3,getValue:function(e){return e.inverseViewRotation}}),czm_inverseViewRotation3D:new Nt({size:1,datatype:te.FLOAT_MAT3,getValue:function(e){return e.inverseViewRotation3D}}),czm_projection:new Nt({size:1,datatype:te.FLOAT_MAT4,getValue:function(e){return e.projection}}),czm_inverseProjection:new Nt({size:1,datatype:te.FLOAT_MAT4,getValue:function(e){return e.inverseProjection}}),czm_infiniteProjection:new Nt({size:1,datatype:te.FLOAT_MAT4,getValue:function(e){return e.infiniteProjection}}),czm_modelView:new Nt({size:1,datatype:te.FLOAT_MAT4,getValue:function(e){return e.modelView}}),czm_modelView3D:new Nt({size:1,datatype:te.FLOAT_MAT4,getValue:function(e){return e.modelView3D}}),czm_modelViewRelativeToEye:new Nt({size:1,datatype:te.FLOAT_MAT4,getValue:function(e){return e.modelViewRelativeToEye}}),czm_inverseModelView:new Nt({size:1,datatype:te.FLOAT_MAT4,getValue:function(e){return e.inverseModelView}}),czm_inverseModelView3D:new Nt({size:1,datatype:te.FLOAT_MAT4,getValue:function(e){return e.inverseModelView3D}}),czm_viewProjection:new Nt({size:1,datatype:te.FLOAT_MAT4,getValue:function(e){return e.viewProjection}}),czm_inverseViewProjection:new Nt({size:1,datatype:te.FLOAT_MAT4,getValue:function(e){return e.inverseViewProjection}}),czm_modelViewProjection:new Nt({size:1,datatype:te.FLOAT_MAT4,getValue:function(e){return e.modelViewProjection}}),czm_inverseModelViewProjection:new Nt({size:1,datatype:te.FLOAT_MAT4,getValue:function(e){return e.inverseModelViewProjection}}),czm_modelViewProjectionRelativeToEye:new Nt({size:1,datatype:te.FLOAT_MAT4,getValue:function(e){return e.modelViewProjectionRelativeToEye}}),czm_modelViewInfiniteProjection:new Nt({size:1,datatype:te.FLOAT_MAT4,getValue:function(e){return e.modelViewInfiniteProjection}}),czm_orthographicIn3D:new Nt({size:1,datatype:te.FLOAT,getValue:function(e){return e.orthographicIn3D?1:0}}),czm_normal:new Nt({size:1,datatype:te.FLOAT_MAT3,getValue:function(e){return e.normal}}),czm_normal3D:new Nt({size:1,datatype:te.FLOAT_MAT3,getValue:function(e){return e.normal3D}}),czm_inverseNormal:new Nt({size:1,datatype:te.FLOAT_MAT3,getValue:function(e){return e.inverseNormal}}),czm_inverseNormal3D:new Nt({size:1,datatype:te.FLOAT_MAT3,getValue:function(e){return e.inverseNormal3D}}),czm_eyeHeight:new Nt({size:1,datatype:te.FLOAT,getValue:function(e){return e.eyeHeight}}),czm_eyeCartographic:new Nt({size:1,datatype:te.FLOAT_VEC3,getValue:function(e){return e.eyeCartographic}}),czm_eyeHeight2D:new Nt({size:1,datatype:te.FLOAT_VEC2,getValue:function(e){return e.eyeHeight2D}}),czm_eyeEllipsoidNormalEC:new Nt({size:1,datatype:te.FLOAT_VEC3,getValue:function(e){return e.eyeEllipsoidNormalEC}}),czm_eyeEllipsoidCurvature:new Nt({size:1,datatype:te.FLOAT_VEC2,getValue:function(e){return e.eyeEllipsoidCurvature}}),czm_eyeToEnu:new Nt({size:1,datatype:te.FLOAT_MAT3,getValue:function(e){return e.eyeToEnu}}),czm_modelToEnu:new Nt({size:1,datatype:te.FLOAT_MAT4,getValue:function(e){return e.modelToEnu}}),czm_enuToModel:new Nt({size:1,datatype:te.FLOAT_MAT4,getValue:function(e){return e.enuToModel}}),czm_entireFrustum:new Nt({size:1,datatype:te.FLOAT_VEC2,getValue:function(e){return e.entireFrustum}}),czm_currentFrustum:new Nt({size:1,datatype:te.FLOAT_VEC2,getValue:function(e){return e.currentFrustum}}),czm_frustumPlanes:new Nt({size:1,datatype:te.FLOAT_VEC4,getValue:function(e){return e.frustumPlanes}}),czm_farDepthFromNearPlusOne:new Nt({size:1,datatype:te.FLOAT,getValue:function(e){return e.farDepthFromNearPlusOne}}),czm_log2FarDepthFromNearPlusOne:new Nt({size:1,datatype:te.FLOAT,getValue:function(e){return e.log2FarDepthFromNearPlusOne}}),czm_oneOverLog2FarDepthFromNearPlusOne:new Nt({size:1,datatype:te.FLOAT,getValue:function(e){return e.oneOverLog2FarDepthFromNearPlusOne}}),czm_sunPositionWC:new Nt({size:1,datatype:te.FLOAT_VEC3,getValue:function(e){return e.sunPositionWC}}),czm_sunPositionColumbusView:new Nt({size:1,datatype:te.FLOAT_VEC3,getValue:function(e){return e.sunPositionColumbusView}}),czm_sunDirectionEC:new Nt({size:1,datatype:te.FLOAT_VEC3,getValue:function(e){return e.sunDirectionEC}}),czm_sunDirectionWC:new Nt({size:1,datatype:te.FLOAT_VEC3,getValue:function(e){return e.sunDirectionWC}}),czm_moonDirectionEC:new Nt({size:1,datatype:te.FLOAT_VEC3,getValue:function(e){return e.moonDirectionEC}}),czm_lightDirectionEC:new Nt({size:1,datatype:te.FLOAT_VEC3,getValue:function(e){return e.lightDirectionEC}}),czm_lightDirectionWC:new Nt({size:1,datatype:te.FLOAT_VEC3,getValue:function(e){return e.lightDirectionWC}}),czm_lightColor:new Nt({size:1,datatype:te.FLOAT_VEC3,getValue:function(e){return e.lightColor}}),czm_lightColorHdr:new Nt({size:1,datatype:te.FLOAT_VEC3,getValue:function(e){return e.lightColorHdr}}),czm_encodedCameraPositionMCHigh:new Nt({size:1,datatype:te.FLOAT_VEC3,getValue:function(e){return e.encodedCameraPositionMCHigh}}),czm_encodedCameraPositionMCLow:new Nt({size:1,datatype:te.FLOAT_VEC3,getValue:function(e){return e.encodedCameraPositionMCLow}}),czm_viewerPositionWC:new Nt({size:1,datatype:te.FLOAT_VEC3,getValue:function(e){return N.getTranslation(e.inverseView,nUe)}}),czm_frameNumber:new Nt({size:1,datatype:te.FLOAT,getValue:function(e){return e.frameState.frameNumber}}),czm_morphTime:new Nt({size:1,datatype:te.FLOAT,getValue:function(e){return e.frameState.morphTime}}),czm_sceneMode:new Nt({size:1,datatype:te.FLOAT,getValue:function(e){return e.frameState.mode}}),czm_pass:new Nt({size:1,datatype:te.FLOAT,getValue:function(e){return e.pass}}),czm_backgroundColor:new Nt({size:1,datatype:te.FLOAT_VEC4,getValue:function(e){return e.backgroundColor}}),czm_brdfLut:new Nt({size:1,datatype:te.SAMPLER_2D,getValue:function(e){return e.brdfLut}}),czm_environmentMap:new Nt({size:1,datatype:te.SAMPLER_CUBE,getValue:function(e){return e.environmentMap}}),czm_specularEnvironmentMaps:new Nt({size:1,datatype:te.SAMPLER_CUBE,getValue:function(e){return e.specularEnvironmentMaps}}),czm_specularEnvironmentMapsMaximumLOD:new Nt({size:1,datatype:te.FLOAT,getValue:function(e){return e.specularEnvironmentMapsMaximumLOD}}),czm_sphericalHarmonicCoefficients:new Nt({size:9,datatype:te.FLOAT_VEC3,getValue:function(e){return e.sphericalHarmonicCoefficients}}),czm_temeToPseudoFixed:new Nt({size:1,datatype:te.FLOAT_MAT3,getValue:function(e){return e.temeToPseudoFixedMatrix}}),czm_pixelRatio:new Nt({size:1,datatype:te.FLOAT,getValue:function(e){return e.pixelRatio}}),czm_fogDensity:new Nt({size:1,datatype:te.FLOAT,getValue:function(e){return e.fogDensity}}),czm_fogVisualDensityScalar:new Nt({size:1,datatype:te.FLOAT,getValue:function(e){return e.fogVisualDensityScalar}}),czm_fogMinimumBrightness:new Nt({size:1,datatype:te.FLOAT,getValue:function(e){return e.fogMinimumBrightness}}),czm_atmosphereHsbShift:new Nt({size:1,datatype:te.FLOAT_VEC3,getValue:function(e){return e.atmosphereHsbShift}}),czm_atmosphereLightIntensity:new Nt({size:1,datatype:te.FLOAT,getValue:function(e){return e.atmosphereLightIntensity}}),czm_atmosphereRayleighCoefficient:new Nt({size:1,datatype:te.FLOAT_VEC3,getValue:function(e){return e.atmosphereRayleighCoefficient}}),czm_atmosphereRayleighScaleHeight:new Nt({size:1,datatype:te.FLOAT,getValue:function(e){return e.atmosphereRayleighScaleHeight}}),czm_atmosphereMieCoefficient:new Nt({size:1,datatype:te.FLOAT_VEC3,getValue:function(e){return e.atmosphereMieCoefficient}}),czm_atmosphereMieScaleHeight:new Nt({size:1,datatype:te.FLOAT,getValue:function(e){return e.atmosphereMieScaleHeight}}),czm_atmosphereMieAnisotropy:new Nt({size:1,datatype:te.FLOAT,getValue:function(e){return e.atmosphereMieAnisotropy}}),czm_atmosphereDynamicLighting:new Nt({size:1,datatype:te.FLOAT,getValue:function(e){return e.atmosphereDynamicLighting}}),czm_splitPosition:new Nt({size:1,datatype:te.FLOAT,getValue:function(e){return e.splitPosition}}),czm_geometricToleranceOverMeter:new Nt({size:1,datatype:te.FLOAT,getValue:function(e){return e.geometricToleranceOverMeter}}),czm_minimumDisableDepthTestDistance:new Nt({size:1,datatype:te.FLOAT,getValue:function(e){return e.minimumDisableDepthTestDistance}}),czm_invertClassificationColor:new Nt({size:1,datatype:te.FLOAT_VEC4,getValue:function(e){return e.invertClassificationColor}}),czm_gamma:new Nt({size:1,datatype:te.FLOAT,getValue:function(e){return e.gamma}}),czm_ellipsoidRadii:new Nt({size:1,datatype:te.FLOAT_VEC3,getValue:function(e){return e.ellipsoid.radii}}),czm_ellipsoidInverseRadii:new Nt({size:1,datatype:te.FLOAT_VEC3,getValue:function(e){return e.ellipsoid.oneOverRadii}})},tg=iUe;function rUe(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(e){let t=Math.random()*16|0;return(e==="x"?t:t&3|8).toString(16)})}var Kn=rUe;function oUe(){return!0}function sUe(e,t){t=t??"This object was destroyed, i.e., destroy() was called.";function n(){}for(let i in e)typeof e[i]=="function"&&(e[i]=n);e.isDestroyed=oUe}var le=sUe;var ma={UNSIGNED_BYTE:te.UNSIGNED_BYTE,UNSIGNED_SHORT:te.UNSIGNED_SHORT,UNSIGNED_INT:te.UNSIGNED_INT};ma.getSizeInBytes=function(e){switch(e){case ma.UNSIGNED_BYTE:return Uint8Array.BYTES_PER_ELEMENT;case ma.UNSIGNED_SHORT:return Uint16Array.BYTES_PER_ELEMENT;case ma.UNSIGNED_INT:return Uint32Array.BYTES_PER_ELEMENT}};ma.fromSizeInBytes=function(e){switch(e){case 2:return ma.UNSIGNED_SHORT;case 4:return ma.UNSIGNED_INT;case 1:return ma.UNSIGNED_BYTE}};ma.validate=function(e){return l(e)&&(e===ma.UNSIGNED_BYTE||e===ma.UNSIGNED_SHORT||e===ma.UNSIGNED_INT)};ma.createTypedArray=function(e,t){return e>=D.SIXTY_FOUR_KILOBYTES?new Uint32Array(t):new Uint16Array(t)};ma.createTypedArrayFromArrayBuffer=function(e,t,n,i){return e>=D.SIXTY_FOUR_KILOBYTES?new Uint32Array(t,n,i):new Uint16Array(t,n,i)};ma.fromTypedArray=function(e){if(e instanceof Uint8Array)return ma.UNSIGNED_BYTE;if(e instanceof Uint16Array)return ma.UNSIGNED_SHORT;if(e instanceof Uint32Array)return ma.UNSIGNED_INT};Object.freeze(ma);var je=ma;var ex={STREAM_DRAW:te.STREAM_DRAW,STATIC_DRAW:te.STATIC_DRAW,DYNAMIC_DRAW:te.DYNAMIC_DRAW,DYNAMIC_READ:te.DYNAMIC_READ};ex.validate=function(e){return e===ex.STREAM_DRAW||e===ex.STATIC_DRAW||e===ex.DYNAMIC_DRAW||e===ex.DYNAMIC_READ};Object.freeze(ex);var Me=ex;function Yc(e){e=e??H.EMPTY_OBJECT;let t=e.context._gl,n=e.bufferTarget,i=e.typedArray,r=e.sizeInBytes,o=e.usage,s=l(i);s&&(r=i.byteLength);let a=t.createBuffer();t.bindBuffer(n,a),t.bufferData(n,s?i:r,o),t.bindBuffer(n,null),this._id=Kn(),this._gl=t,this._webgl2=e.context._webgl2,this._bufferTarget=n,this._sizeInBytes=r,this._usage=o,this._buffer=a,this.vertexArrayDestroyable=!0}Yc.createPixelBuffer=function(e){if(!e.context._webgl2)throw new pe("A WebGL 2 context is required to create PixelBuffers.");return new Yc({context:e.context,bufferTarget:te.PIXEL_PACK_BUFFER,typedArray:e.typedArray,sizeInBytes:e.sizeInBytes,usage:e.usage})};Yc.createVertexBuffer=function(e){return new Yc({context:e.context,bufferTarget:te.ARRAY_BUFFER,typedArray:e.typedArray,sizeInBytes:e.sizeInBytes,usage:e.usage})};Yc.createIndexBuffer=function(e){let t=e.context,n=e.indexDatatype,i=je.getSizeInBytes(n),r=new Yc({context:t,bufferTarget:te.ELEMENT_ARRAY_BUFFER,typedArray:e.typedArray,sizeInBytes:e.sizeInBytes,usage:e.usage}),o=r.sizeInBytes/i;return Object.defineProperties(r,{indexDatatype:{get:function(){return n}},bytesPerIndex:{get:function(){return i}},numberOfIndices:{get:function(){return o}}}),r};Object.defineProperties(Yc.prototype,{sizeInBytes:{get:function(){return this._sizeInBytes}},usage:{get:function(){return this._usage}}});Yc.prototype._getBuffer=function(){return this._buffer};Yc.prototype._bind=function(){let e=this._gl,t=this._bufferTarget;e.bindBuffer(t,this._buffer)};Yc.prototype._unBind=function(){let e=this._gl,t=this._bufferTarget;e.bindBuffer(t,null)};Yc.prototype.copyFromArrayView=function(e,t){t=t??0;let n=this._gl,i=this._bufferTarget;n.bindBuffer(i,this._buffer),n.bufferSubData(i,t,e),n.bindBuffer(i,null)};Yc.prototype.copyFromBuffer=function(e,t,n,i){let r=te.COPY_READ_BUFFER,o=te.COPY_WRITE_BUFFER,s=this._gl;s.bindBuffer(o,this._buffer),s.bindBuffer(r,e._buffer),s.copyBufferSubData(r,o,t,n,i),s.bindBuffer(o,null),s.bindBuffer(r,null)};Yc.prototype.getBufferData=function(e,t,n,i){t=t??0,n=n??0;let r=this._gl,o=te.COPY_READ_BUFFER;r.bindBuffer(o,this._buffer),r.getBufferSubData(o,t,e,n,i),r.bindBuffer(o,null)};Yc.prototype.isDestroyed=function(){return!1};Yc.prototype.destroy=function(){return this._gl.deleteBuffer(this._buffer),le(this)};var tt=Yc;var Sy,ms={requestFullscreen:void 0,exitFullscreen:void 0,fullscreenEnabled:void 0,fullscreenElement:void 0,fullscreenchange:void 0,fullscreenerror:void 0},Iu={};Object.defineProperties(Iu,{element:{get:function(){if(Iu.supportsFullscreen())return document[ms.fullscreenElement]}},changeEventName:{get:function(){if(Iu.supportsFullscreen())return ms.fullscreenchange}},errorEventName:{get:function(){if(Iu.supportsFullscreen())return ms.fullscreenerror}},enabled:{get:function(){if(Iu.supportsFullscreen())return document[ms.fullscreenEnabled]}},fullscreen:{get:function(){if(Iu.supportsFullscreen())return Iu.element!==null}}});Iu.supportsFullscreen=function(){if(l(Sy))return Sy;Sy=!1;let e=document.body;if(typeof e.requestFullscreen=="function")return ms.requestFullscreen="requestFullscreen",ms.exitFullscreen="exitFullscreen",ms.fullscreenEnabled="fullscreenEnabled",ms.fullscreenElement="fullscreenElement",ms.fullscreenchange="fullscreenchange",ms.fullscreenerror="fullscreenerror",Sy=!0,Sy;let t=["webkit","moz","o","ms","khtml"],n;for(let i=0,r=t.length;i<r;++i){let o=t[i];n=`${o}RequestFullscreen`,typeof e[n]=="function"?(ms.requestFullscreen=n,Sy=!0):(n=`${o}RequestFullScreen`,typeof e[n]=="function"&&(ms.requestFullscreen=n,Sy=!0)),n=`${o}ExitFullscreen`,typeof document[n]=="function"?ms.exitFullscreen=n:(n=`${o}CancelFullScreen`,typeof document[n]=="function"&&(ms.exitFullscreen=n)),n=`${o}FullscreenEnabled`,document[n]!==void 0?ms.fullscreenEnabled=n:(n=`${o}FullScreenEnabled`,document[n]!==void 0&&(ms.fullscreenEnabled=n)),n=`${o}FullscreenElement`,document[n]!==void 0?ms.fullscreenElement=n:(n=`${o}FullScreenElement`,document[n]!==void 0&&(ms.fullscreenElement=n)),n=`${o}fullscreenchange`,document[`on${n}`]!==void 0&&(o==="ms"&&(n="MSFullscreenChange"),ms.fullscreenchange=n),n=`${o}fullscreenerror`,document[`on${n}`]!==void 0&&(o==="ms"&&(n="MSFullscreenError"),ms.fullscreenerror=n)}return Sy};Iu.requestFullscreen=function(e,t){Iu.supportsFullscreen()&&e[ms.requestFullscreen]({vrDisplay:t})};Iu.exitFullscreen=function(){Iu.supportsFullscreen()&&document[ms.exitFullscreen]()};Iu._names=ms;var es=Iu;var Ed;typeof navigator<"u"?Ed=navigator:Ed={};function sD(e){let t=e.split(".");for(let n=0,i=t.length;n<i;++n)t[n]=parseInt(t[n],10);return t}var bj,fue;function Wq(){if(!l(bj)&&(bj=!1,!Sj())){let e=/ Chrome\/([\.0-9]+)/.exec(Ed.userAgent);e!==null&&(bj=!0,fue=sD(e[1]))}return bj}function aUe(){return Wq()&&fue}var xj,due;function hue(){if(!l(xj)&&(xj=!1,!Wq()&&!Sj()&&/ Safari\/[\.0-9]+/.test(Ed.userAgent))){let e=/ Version\/([\.0-9]+)/.exec(Ed.userAgent);e!==null&&(xj=!0,due=sD(e[1]))}return xj}function cUe(){return hue()&&due}var Tj,Gq;function mue(){if(!l(Tj)){Tj=!1;let e=/ AppleWebKit\/([\.0-9]+)(\+?)/.exec(Ed.userAgent);e!==null&&(Tj=!0,Gq=sD(e[1]),Gq.isNightly=!!e[2])}return Tj}function lUe(){return mue()&&Gq}var Ej,pue;function Sj(){if(!l(Ej)){Ej=!1;let e=/ Edg\/([\.0-9]+)/.exec(Ed.userAgent);e!==null&&(Ej=!0,pue=sD(e[1]))}return Ej}function uUe(){return Sj()&&pue}var Cj,qq;function wj(){if(!l(Cj)){Cj=!1;let e=/Firefox\/([\.0-9]+)/.exec(Ed.userAgent);e!==null&&(Cj=!0,qq=sD(e[1]))}return Cj}var Vq;function fUe(){return l(Vq)||(Vq=/Windows/i.test(Ed.appVersion)),Vq}var jq;function dUe(){return l(jq)||(jq=navigator.platform==="iPhone"||navigator.platform==="iPod"||navigator.platform==="iPad"),jq}function hUe(){return wj()&&qq}var Hq;function mUe(){return l(Hq)||(Hq=!wj()&&typeof PointerEvent<"u"&&(!l(Ed.pointerEnabled)||Ed.pointerEnabled)),Hq}var gue,vj;function _ue(){if(!l(vj)){let e=document.createElement("canvas");e.setAttribute("style","image-rendering: -moz-crisp-edges;image-rendering: pixelated;");let t=e.style.imageRendering;vj=l(t)&&t!=="",vj&&(gue=t)}return vj}function pUe(){return _ue()?gue:void 0}function Ll(){return Ll._result}Ll._promise=void 0;Ll._result=void 0;Ll.initialize=function(){return l(Ll._promise)||(Ll._promise=new Promise(e=>{let t=new Image;t.onload=function(){Ll._result=t.width>0&&t.height>0,e(Ll._result)},t.onerror=function(){Ll._result=!1,e(Ll._result)},t.src="data:image/webp;base64,UklGRiIAAABXRUJQVlA4IBYAAAAwAQCdASoBAAEADsD+JaQAA3AAAAAA"})),Ll._promise};Object.defineProperties(Ll,{initialized:{get:function(){return l(Ll._result)}}});var sv=[];typeof ArrayBuffer<"u"&&(sv.push(Int8Array,Uint8Array,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array),typeof Uint8ClampedArray<"u"&&sv.push(Uint8ClampedArray),typeof Uint8ClampedArray<"u"&&sv.push(Uint8ClampedArray),typeof BigInt64Array<"u"&&sv.push(BigInt64Array),typeof BigUint64Array<"u"&&sv.push(BigUint64Array));var Cd={isChrome:Wq,chromeVersion:aUe,isSafari:hue,safariVersion:cUe,isWebkit:mue,webkitVersion:lUe,isEdge:Sj,edgeVersion:uUe,isFirefox:wj,firefoxVersion:hUe,isWindows:fUe,isIPadOrIOS:dUe,hardwareConcurrency:Ed.hardwareConcurrency??3,supportsPointerEvents:mUe,supportsImageRenderingPixelated:_ue,supportsWebP:Ll,imageRenderingValue:pUe,typedArrayTypes:sv};Cd.supportsBasis=function(e){return Cd.supportsWebAssembly()&&e.context.supportsBasis};Cd.supportsFullscreen=function(){return es.supportsFullscreen()};Cd.supportsTypedArrays=function(){return typeof ArrayBuffer<"u"};Cd.supportsBigInt64Array=function(){return typeof BigInt64Array<"u"};Cd.supportsBigUint64Array=function(){return typeof BigUint64Array<"u"};Cd.supportsBigInt=function(){return typeof BigInt<"u"};Cd.supportsWebWorkers=function(){return typeof Worker<"u"};Cd.supportsWebAssembly=function(){return typeof WebAssembly<"u"};Cd.supportsWebgl2=function(e){return e.context.webgl2};Cd.supportsEsmWebWorkers=function(){return!wj()||parseInt(qq)>=114};var dn=Cd;function Yq(e,t,n){return n<0&&(n+=1),n>1&&(n-=1),n*6<1?e+(t-e)*6*n:n*2<1?t:n*3<2?e+(t-e)*(2/3-n)*6:e}var _e=class e{constructor(t,n,i,r){this.red=t??1,this.green=n??1,this.blue=i??1,this.alpha=r??1}static fromCartesian4(t,n){return l(n)?(n.red=t.x,n.green=t.y,n.blue=t.z,n.alpha=t.w,n):new e(t.x,t.y,t.z,t.w)}static fromBytes(t,n,i,r,o){return t=e.byteToFloat(t??255),n=e.byteToFloat(n??255),i=e.byteToFloat(i??255),r=e.byteToFloat(r??255),l(o)?(o.red=t,o.green=n,o.blue=i,o.alpha=r,o):new e(t,n,i,r)}static fromAlpha(t,n,i){return l(i)?(i.red=t.red,i.green=t.green,i.blue=t.blue,i.alpha=n,i):new e(t.red,t.green,t.blue,n)}static fromRgba(t,n){return Kq[0]=t,e.fromBytes(ng[0],ng[1],ng[2],ng[3],n)}static fromHsl(t,n,i,r,o){t=(t??0)%1,n=n??0,i=i??0,r=r??1;let s=i,a=i,c=i;if(n!==0){let u;i<.5?u=i*(1+n):u=i+n-i*n;let f=2*i-u;s=Yq(f,u,t+1/3),a=Yq(f,u,t),c=Yq(f,u,t-1/3)}return l(o)?(o.red=s,o.green=a,o.blue=c,o.alpha=r,o):new e(s,a,c,r)}static fromRandom(t,n){t=t??H.EMPTY_OBJECT;let i=t.red;if(!l(i)){let a=t.minimumRed??0,c=t.maximumRed??1;i=a+D.nextRandomNumber()*(c-a)}let r=t.green;if(!l(r)){let a=t.minimumGreen??0,c=t.maximumGreen??1;r=a+D.nextRandomNumber()*(c-a)}let o=t.blue;if(!l(o)){let a=t.minimumBlue??0,c=t.maximumBlue??1;o=a+D.nextRandomNumber()*(c-a)}let s=t.alpha;if(!l(s)){let a=t.minimumAlpha??0,c=t.maximumAlpha??1;s=a+D.nextRandomNumber()*(c-a)}return l(n)?(n.red=i,n.green=r,n.blue=o,n.alpha=s,n):new e(i,r,o,s)}static fromCssColorString(t,n){l(n)||(n=new e),t=t.trim();let i=e[t.toUpperCase()];if(l(i))return e.clone(i,n),n;let r=gUe.exec(t);return r!==null?(n.red=parseInt(r[1],16)/15,n.green=parseInt(r[2],16)/15,n.blue=parseInt(r[3],16)/15,n.alpha=parseInt(r[4]??"f",16)/15,n):(r=_Ue.exec(t),r!==null?(n.red=parseInt(r[1],16)/255,n.green=parseInt(r[2],16)/255,n.blue=parseInt(r[3],16)/255,n.alpha=parseInt(r[4]??"ff",16)/255,n):(r=yUe.exec(t),r!==null?(n.red=parseFloat(r[1])/(r[1].substr(-1)==="%"?100:255),n.green=parseFloat(r[2])/(r[2].substr(-1)==="%"?100:255),n.blue=parseFloat(r[3])/(r[3].substr(-1)==="%"?100:255),n.alpha=parseFloat(r[4]??"1.0"),n):(r=AUe.exec(t),r!==null?e.fromHsl(parseFloat(r[1])/360,parseFloat(r[2])/100,parseFloat(r[3])/100,parseFloat(r[4]??"1.0"),n):(n=void 0,n))))}static pack(t,n,i){return i=i??0,n[i++]=t.red,n[i++]=t.green,n[i++]=t.blue,n[i]=t.alpha,n}static unpack(t,n,i){return n=n??0,l(i)||(i=new e),i.red=t[n++],i.green=t[n++],i.blue=t[n++],i.alpha=t[n],i}static byteToFloat(t){return t/255}static floatToByte(t){return t===1?255:t*256|0}static clone(t,n){if(l(t))return l(n)?(n.red=t.red,n.green=t.green,n.blue=t.blue,n.alpha=t.alpha,n):new e(t.red,t.green,t.blue,t.alpha)}static equals(t,n){return t===n||l(t)&&l(n)&&t.red===n.red&&t.green===n.green&&t.blue===n.blue&&t.alpha===n.alpha}static equalsArray(t,n,i){return t.red===n[i]&&t.green===n[i+1]&&t.blue===n[i+2]&&t.alpha===n[i+3]}clone(t){return e.clone(this,t)}equals(t){return e.equals(this,t)}equalsEpsilon(t,n){return this===t||l(t)&&Math.abs(this.red-t.red)<=n&&Math.abs(this.green-t.green)<=n&&Math.abs(this.blue-t.blue)<=n&&Math.abs(this.alpha-t.alpha)<=n}toString(){return`(${this.red}, ${this.green}, ${this.blue}, ${this.alpha})`}toCssColorString(){let t=e.floatToByte(this.red),n=e.floatToByte(this.green),i=e.floatToByte(this.blue);return this.alpha===1?`rgb(${t},${n},${i})`:`rgba(${t},${n},${i},${this.alpha})`}toCssHexString(){let t=e.floatToByte(this.red).toString(16);t.length<2&&(t=`0${t}`);let n=e.floatToByte(this.green).toString(16);n.length<2&&(n=`0${n}`);let i=e.floatToByte(this.blue).toString(16);if(i.length<2&&(i=`0${i}`),this.alpha<1){let r=e.floatToByte(this.alpha).toString(16);return r.length<2&&(r=`0${r}`),`#${t}${n}${i}${r}`}return`#${t}${n}${i}`}toBytes(t){let n=e.floatToByte(this.red),i=e.floatToByte(this.green),r=e.floatToByte(this.blue),o=e.floatToByte(this.alpha);return l(t)?(t[0]=n,t[1]=i,t[2]=r,t[3]=o,t):[n,i,r,o]}static bytesToRgba(t,n,i,r){return ng[0]=t,ng[1]=n,ng[2]=i,ng[3]=r,Kq[0]}toRgba(){return e.bytesToRgba(e.floatToByte(this.red),e.floatToByte(this.green),e.floatToByte(this.blue),e.floatToByte(this.alpha))}brighten(t,n){return t=1-t,n.red=1-(1-this.red)*t,n.green=1-(1-this.green)*t,n.blue=1-(1-this.blue)*t,n.alpha=this.alpha,n}darken(t,n){return t=1-t,n.red=this.red*t,n.green=this.green*t,n.blue=this.blue*t,n.alpha=this.alpha,n}withAlpha(t,n){return e.fromAlpha(this,t,n)}static add(t,n,i){return i.red=t.red+n.red,i.green=t.green+n.green,i.blue=t.blue+n.blue,i.alpha=t.alpha+n.alpha,i}static subtract(t,n,i){return i.red=t.red-n.red,i.green=t.green-n.green,i.blue=t.blue-n.blue,i.alpha=t.alpha-n.alpha,i}static multiply(t,n,i){return i.red=t.red*n.red,i.green=t.green*n.green,i.blue=t.blue*n.blue,i.alpha=t.alpha*n.alpha,i}static divide(t,n,i){return i.red=t.red/n.red,i.green=t.green/n.green,i.blue=t.blue/n.blue,i.alpha=t.alpha/n.alpha,i}static mod(t,n,i){return i.red=t.red%n.red,i.green=t.green%n.green,i.blue=t.blue%n.blue,i.alpha=t.alpha%n.alpha,i}static lerp(t,n,i,r){return r.red=D.lerp(t.red,n.red,i),r.green=D.lerp(t.green,n.green,i),r.blue=D.lerp(t.blue,n.blue,i),r.alpha=D.lerp(t.alpha,n.alpha,i),r}static multiplyByScalar(t,n,i){return i.red=t.red*n,i.green=t.green*n,i.blue=t.blue*n,i.alpha=t.alpha*n,i}static divideByScalar(t,n,i){return i.red=t.red/n,i.green=t.green/n,i.blue=t.blue/n,i.alpha=t.alpha/n,i}},Xq,Kq,ng;dn.supportsTypedArrays()&&(Xq=new ArrayBuffer(4),Kq=new Uint32Array(Xq),ng=new Uint8Array(Xq));var gUe=/^#([0-9a-f])([0-9a-f])([0-9a-f])([0-9a-f])?$/i,_Ue=/^#([0-9a-f]{2})([0-9a-f]{2})([0-9a-f]{2})([0-9a-f]{2})?$/i,yUe=/^rgba?\s*\(\s*([0-9.]+%?)\s*[,\s]+\s*([0-9.]+%?)\s*[,\s]+\s*([0-9.]+%?)(?:\s*[,\s/]+\s*([0-9.]+))?\s*\)$/i,AUe=/^hsla?\s*\(\s*([0-9.]+)\s*[,\s]+\s*([0-9.]+%)\s*[,\s]+\s*([0-9.]+%)(?:\s*[,\s/]+\s*([0-9.]+))?\s*\)$/i;_e.packedLength=4;_e.ALICEBLUE=Object.freeze(_e.fromCssColorString("#F0F8FF"));_e.ANTIQUEWHITE=Object.freeze(_e.fromCssColorString("#FAEBD7"));_e.AQUA=Object.freeze(_e.fromCssColorString("#00FFFF"));_e.AQUAMARINE=Object.freeze(_e.fromCssColorString("#7FFFD4"));_e.AZURE=Object.freeze(_e.fromCssColorString("#F0FFFF"));_e.BEIGE=Object.freeze(_e.fromCssColorString("#F5F5DC"));_e.BISQUE=Object.freeze(_e.fromCssColorString("#FFE4C4"));_e.BLACK=Object.freeze(_e.fromCssColorString("#000000"));_e.BLANCHEDALMOND=Object.freeze(_e.fromCssColorString("#FFEBCD"));_e.BLUE=Object.freeze(_e.fromCssColorString("#0000FF"));_e.BLUEVIOLET=Object.freeze(_e.fromCssColorString("#8A2BE2"));_e.BROWN=Object.freeze(_e.fromCssColorString("#A52A2A"));_e.BURLYWOOD=Object.freeze(_e.fromCssColorString("#DEB887"));_e.CADETBLUE=Object.freeze(_e.fromCssColorString("#5F9EA0"));_e.CHARTREUSE=Object.freeze(_e.fromCssColorString("#7FFF00"));_e.CHOCOLATE=Object.freeze(_e.fromCssColorString("#D2691E"));_e.CORAL=Object.freeze(_e.fromCssColorString("#FF7F50"));_e.CORNFLOWERBLUE=Object.freeze(_e.fromCssColorString("#6495ED"));_e.CORNSILK=Object.freeze(_e.fromCssColorString("#FFF8DC"));_e.CRIMSON=Object.freeze(_e.fromCssColorString("#DC143C"));_e.CYAN=Object.freeze(_e.fromCssColorString("#00FFFF"));_e.DARKBLUE=Object.freeze(_e.fromCssColorString("#00008B"));_e.DARKCYAN=Object.freeze(_e.fromCssColorString("#008B8B"));_e.DARKGOLDENROD=Object.freeze(_e.fromCssColorString("#B8860B"));_e.DARKGRAY=Object.freeze(_e.fromCssColorString("#A9A9A9"));_e.DARKGREEN=Object.freeze(_e.fromCssColorString("#006400"));_e.DARKGREY=_e.DARKGRAY;_e.DARKKHAKI=Object.freeze(_e.fromCssColorString("#BDB76B"));_e.DARKMAGENTA=Object.freeze(_e.fromCssColorString("#8B008B"));_e.DARKOLIVEGREEN=Object.freeze(_e.fromCssColorString("#556B2F"));_e.DARKORANGE=Object.freeze(_e.fromCssColorString("#FF8C00"));_e.DARKORCHID=Object.freeze(_e.fromCssColorString("#9932CC"));_e.DARKRED=Object.freeze(_e.fromCssColorString("#8B0000"));_e.DARKSALMON=Object.freeze(_e.fromCssColorString("#E9967A"));_e.DARKSEAGREEN=Object.freeze(_e.fromCssColorString("#8FBC8F"));_e.DARKSLATEBLUE=Object.freeze(_e.fromCssColorString("#483D8B"));_e.DARKSLATEGRAY=Object.freeze(_e.fromCssColorString("#2F4F4F"));_e.DARKSLATEGREY=_e.DARKSLATEGRAY;_e.DARKTURQUOISE=Object.freeze(_e.fromCssColorString("#00CED1"));_e.DARKVIOLET=Object.freeze(_e.fromCssColorString("#9400D3"));_e.DEEPPINK=Object.freeze(_e.fromCssColorString("#FF1493"));_e.DEEPSKYBLUE=Object.freeze(_e.fromCssColorString("#00BFFF"));_e.DIMGRAY=Object.freeze(_e.fromCssColorString("#696969"));_e.DIMGREY=_e.DIMGRAY;_e.DODGERBLUE=Object.freeze(_e.fromCssColorString("#1E90FF"));_e.FIREBRICK=Object.freeze(_e.fromCssColorString("#B22222"));_e.FLORALWHITE=Object.freeze(_e.fromCssColorString("#FFFAF0"));_e.FORESTGREEN=Object.freeze(_e.fromCssColorString("#228B22"));_e.FUCHSIA=Object.freeze(_e.fromCssColorString("#FF00FF"));_e.GAINSBORO=Object.freeze(_e.fromCssColorString("#DCDCDC"));_e.GHOSTWHITE=Object.freeze(_e.fromCssColorString("#F8F8FF"));_e.GOLD=Object.freeze(_e.fromCssColorString("#FFD700"));_e.GOLDENROD=Object.freeze(_e.fromCssColorString("#DAA520"));_e.GRAY=Object.freeze(_e.fromCssColorString("#808080"));_e.GREEN=Object.freeze(_e.fromCssColorString("#008000"));_e.GREENYELLOW=Object.freeze(_e.fromCssColorString("#ADFF2F"));_e.GREY=_e.GRAY;_e.HONEYDEW=Object.freeze(_e.fromCssColorString("#F0FFF0"));_e.HOTPINK=Object.freeze(_e.fromCssColorString("#FF69B4"));_e.INDIANRED=Object.freeze(_e.fromCssColorString("#CD5C5C"));_e.INDIGO=Object.freeze(_e.fromCssColorString("#4B0082"));_e.IVORY=Object.freeze(_e.fromCssColorString("#FFFFF0"));_e.KHAKI=Object.freeze(_e.fromCssColorString("#F0E68C"));_e.LAVENDER=Object.freeze(_e.fromCssColorString("#E6E6FA"));_e.LAVENDAR_BLUSH=Object.freeze(_e.fromCssColorString("#FFF0F5"));_e.LAWNGREEN=Object.freeze(_e.fromCssColorString("#7CFC00"));_e.LEMONCHIFFON=Object.freeze(_e.fromCssColorString("#FFFACD"));_e.LIGHTBLUE=Object.freeze(_e.fromCssColorString("#ADD8E6"));_e.LIGHTCORAL=Object.freeze(_e.fromCssColorString("#F08080"));_e.LIGHTCYAN=Object.freeze(_e.fromCssColorString("#E0FFFF"));_e.LIGHTGOLDENRODYELLOW=Object.freeze(_e.fromCssColorString("#FAFAD2"));_e.LIGHTGRAY=Object.freeze(_e.fromCssColorString("#D3D3D3"));_e.LIGHTGREEN=Object.freeze(_e.fromCssColorString("#90EE90"));_e.LIGHTGREY=_e.LIGHTGRAY;_e.LIGHTPINK=Object.freeze(_e.fromCssColorString("#FFB6C1"));_e.LIGHTSEAGREEN=Object.freeze(_e.fromCssColorString("#20B2AA"));_e.LIGHTSKYBLUE=Object.freeze(_e.fromCssColorString("#87CEFA"));_e.LIGHTSLATEGRAY=Object.freeze(_e.fromCssColorString("#778899"));_e.LIGHTSLATEGREY=_e.LIGHTSLATEGRAY;_e.LIGHTSTEELBLUE=Object.freeze(_e.fromCssColorString("#B0C4DE"));_e.LIGHTYELLOW=Object.freeze(_e.fromCssColorString("#FFFFE0"));_e.LIME=Object.freeze(_e.fromCssColorString("#00FF00"));_e.LIMEGREEN=Object.freeze(_e.fromCssColorString("#32CD32"));_e.LINEN=Object.freeze(_e.fromCssColorString("#FAF0E6"));_e.MAGENTA=Object.freeze(_e.fromCssColorString("#FF00FF"));_e.MAROON=Object.freeze(_e.fromCssColorString("#800000"));_e.MEDIUMAQUAMARINE=Object.freeze(_e.fromCssColorString("#66CDAA"));_e.MEDIUMBLUE=Object.freeze(_e.fromCssColorString("#0000CD"));_e.MEDIUMORCHID=Object.freeze(_e.fromCssColorString("#BA55D3"));_e.MEDIUMPURPLE=Object.freeze(_e.fromCssColorString("#9370DB"));_e.MEDIUMSEAGREEN=Object.freeze(_e.fromCssColorString("#3CB371"));_e.MEDIUMSLATEBLUE=Object.freeze(_e.fromCssColorString("#7B68EE"));_e.MEDIUMSPRINGGREEN=Object.freeze(_e.fromCssColorString("#00FA9A"));_e.MEDIUMTURQUOISE=Object.freeze(_e.fromCssColorString("#48D1CC"));_e.MEDIUMVIOLETRED=Object.freeze(_e.fromCssColorString("#C71585"));_e.MIDNIGHTBLUE=Object.freeze(_e.fromCssColorString("#191970"));_e.MINTCREAM=Object.freeze(_e.fromCssColorString("#F5FFFA"));_e.MISTYROSE=Object.freeze(_e.fromCssColorString("#FFE4E1"));_e.MOCCASIN=Object.freeze(_e.fromCssColorString("#FFE4B5"));_e.NAVAJOWHITE=Object.freeze(_e.fromCssColorString("#FFDEAD"));_e.NAVY=Object.freeze(_e.fromCssColorString("#000080"));_e.OLDLACE=Object.freeze(_e.fromCssColorString("#FDF5E6"));_e.OLIVE=Object.freeze(_e.fromCssColorString("#808000"));_e.OLIVEDRAB=Object.freeze(_e.fromCssColorString("#6B8E23"));_e.ORANGE=Object.freeze(_e.fromCssColorString("#FFA500"));_e.ORANGERED=Object.freeze(_e.fromCssColorString("#FF4500"));_e.ORCHID=Object.freeze(_e.fromCssColorString("#DA70D6"));_e.PALEGOLDENROD=Object.freeze(_e.fromCssColorString("#EEE8AA"));_e.PALEGREEN=Object.freeze(_e.fromCssColorString("#98FB98"));_e.PALETURQUOISE=Object.freeze(_e.fromCssColorString("#AFEEEE"));_e.PALEVIOLETRED=Object.freeze(_e.fromCssColorString("#DB7093"));_e.PAPAYAWHIP=Object.freeze(_e.fromCssColorString("#FFEFD5"));_e.PEACHPUFF=Object.freeze(_e.fromCssColorString("#FFDAB9"));_e.PERU=Object.freeze(_e.fromCssColorString("#CD853F"));_e.PINK=Object.freeze(_e.fromCssColorString("#FFC0CB"));_e.PLUM=Object.freeze(_e.fromCssColorString("#DDA0DD"));_e.POWDERBLUE=Object.freeze(_e.fromCssColorString("#B0E0E6"));_e.PURPLE=Object.freeze(_e.fromCssColorString("#800080"));_e.RED=Object.freeze(_e.fromCssColorString("#FF0000"));_e.ROSYBROWN=Object.freeze(_e.fromCssColorString("#BC8F8F"));_e.ROYALBLUE=Object.freeze(_e.fromCssColorString("#4169E1"));_e.SADDLEBROWN=Object.freeze(_e.fromCssColorString("#8B4513"));_e.SALMON=Object.freeze(_e.fromCssColorString("#FA8072"));_e.SANDYBROWN=Object.freeze(_e.fromCssColorString("#F4A460"));_e.SEAGREEN=Object.freeze(_e.fromCssColorString("#2E8B57"));_e.SEASHELL=Object.freeze(_e.fromCssColorString("#FFF5EE"));_e.SIENNA=Object.freeze(_e.fromCssColorString("#A0522D"));_e.SILVER=Object.freeze(_e.fromCssColorString("#C0C0C0"));_e.SKYBLUE=Object.freeze(_e.fromCssColorString("#87CEEB"));_e.SLATEBLUE=Object.freeze(_e.fromCssColorString("#6A5ACD"));_e.SLATEGRAY=Object.freeze(_e.fromCssColorString("#708090"));_e.SLATEGREY=_e.SLATEGRAY;_e.SNOW=Object.freeze(_e.fromCssColorString("#FFFAFA"));_e.SPRINGGREEN=Object.freeze(_e.fromCssColorString("#00FF7F"));_e.STEELBLUE=Object.freeze(_e.fromCssColorString("#4682B4"));_e.TAN=Object.freeze(_e.fromCssColorString("#D2B48C"));_e.TEAL=Object.freeze(_e.fromCssColorString("#008080"));_e.THISTLE=Object.freeze(_e.fromCssColorString("#D8BFD8"));_e.TOMATO=Object.freeze(_e.fromCssColorString("#FF6347"));_e.TURQUOISE=Object.freeze(_e.fromCssColorString("#40E0D0"));_e.VIOLET=Object.freeze(_e.fromCssColorString("#EE82EE"));_e.WHEAT=Object.freeze(_e.fromCssColorString("#F5DEB3"));_e.WHITE=Object.freeze(_e.fromCssColorString("#FFFFFF"));_e.WHITESMOKE=Object.freeze(_e.fromCssColorString("#F5F5F5"));_e.YELLOW=Object.freeze(_e.fromCssColorString("#FFFF00"));_e.YELLOWGREEN=Object.freeze(_e.fromCssColorString("#9ACD32"));_e.TRANSPARENT=Object.freeze(new _e(0,0,0,0));var z=_e;function Ij(e){e=e??H.EMPTY_OBJECT,this.color=e.color,this.depth=e.depth,this.stencil=e.stencil,this.renderState=e.renderState,this.framebuffer=e.framebuffer,this.owner=e.owner,this.pass=e.pass}Ij.ALL=Object.freeze(new Ij({color:new z(0,0,0,0),depth:1,stencil:0}));Ij.prototype.execute=function(e,t){e.clear(this,t)};var li=Ij;var yue={ENVIRONMENT:0,COMPUTE:1,GLOBE:2,TERRAIN_CLASSIFICATION:3,CESIUM_3D_TILE_EDGES:4,CESIUM_3D_TILE_PLANAR_FILL_ID:5,CESIUM_3D_TILE:6,CESIUM_3D_TILE_CLASSIFICATION:7,CESIUM_3D_TILE_CLASSIFICATION_IGNORE_SHOW:8,OPAQUE:9,TRANSLUCENT:10,VOXELS:11,GAUSSIAN_SPLATS:12,CESIUM_3D_TILE_EDGES_DIRECT:13,OVERLAY:14,NUMBER_OF_PASSES:15};Object.freeze(yue);var Ie=yue;function Aue(e){e=e??H.EMPTY_OBJECT,this.vertexArray=e.vertexArray,this.fragmentShaderSource=e.fragmentShaderSource,this.shaderProgram=e.shaderProgram,this.uniformMap=e.uniformMap,this.outputTexture=e.outputTexture,this.preExecute=e.preExecute,this.postExecute=e.postExecute,this.canceled=e.canceled,this.persists=e.persists??!1,this.pass=Ie.COMPUTE,this.owner=e.owner}Aue.prototype.execute=function(e){e.execute(this)};var xf=Aue;var ps=class e{constructor(t,n){this.x=t??0,this.y=n??0}static fromElements(t,n,i){return l(i)?(i.x=t,i.y=n,i):new e(t,n)}static clone(t,n){if(l(t))return l(n)?(n.x=t.x,n.y=t.y,n):new e(t.x,t.y)}static pack(t,n,i){return i=i??0,n[i++]=t.x,n[i]=t.y,n}static unpack(t,n,i){return n=n??0,l(i)||(i=new e),i.x=t[n++],i.y=t[n],i}static packArray(t,n){let i=t.length,r=i*2;l(n)?!Array.isArray(n)&&n.length!==r||n.length!==r&&(n.length=r):n=new Array(r);for(let o=0;o<i;++o)e.pack(t[o],n,o*2);return n}static unpackArray(t,n){let i=t.length;l(n)?n.length=i/2:n=new Array(i/2);for(let r=0;r<i;r+=2){let o=r/2;n[o]=e.unpack(t,r,n[o])}return n}static maximumComponent(t){return Math.max(t.x,t.y)}static minimumComponent(t){return Math.min(t.x,t.y)}static minimumByComponent(t,n,i){return i.x=Math.min(t.x,n.x),i.y=Math.min(t.y,n.y),i}static maximumByComponent(t,n,i){return i.x=Math.max(t.x,n.x),i.y=Math.max(t.y,n.y),i}static clamp(t,n,i,r){let o=D.clamp(t.x,n.x,i.x),s=D.clamp(t.y,n.y,i.y);return r.x=o,r.y=s,r}static magnitudeSquared(t){return t.x*t.x+t.y*t.y}static magnitude(t){return Math.sqrt(e.magnitudeSquared(t))}static distance(t,n){return e.subtract(t,n,Pj),e.magnitude(Pj)}static distanceSquared(t,n){return e.subtract(t,n,Pj),e.magnitudeSquared(Pj)}static normalize(t,n){let i=e.magnitude(t);return n.x=t.x/i,n.y=t.y/i,n}static dot(t,n){return t.x*n.x+t.y*n.y}static cross(t,n){return t.x*n.y-t.y*n.x}static multiplyComponents(t,n,i){return i.x=t.x*n.x,i.y=t.y*n.y,i}static divideComponents(t,n,i){return i.x=t.x/n.x,i.y=t.y/n.y,i}static add(t,n,i){return i.x=t.x+n.x,i.y=t.y+n.y,i}static subtract(t,n,i){return i.x=t.x-n.x,i.y=t.y-n.y,i}static multiplyByScalar(t,n,i){return i.x=t.x*n,i.y=t.y*n,i}static divideByScalar(t,n,i){return i.x=t.x/n,i.y=t.y/n,i}static negate(t,n){return n.x=-t.x,n.y=-t.y,n}static abs(t,n){return n.x=Math.abs(t.x),n.y=Math.abs(t.y),n}static lerp(t,n,i,r){return e.multiplyByScalar(n,i,bue),r=e.multiplyByScalar(t,1-i,r),e.add(bue,r,r)}static angleBetween(t,n){return e.normalize(t,xue),e.normalize(n,Tue),D.acosClamped(e.dot(xue,Tue))}static mostOrthogonalAxis(t,n){let i=e.normalize(t,bUe);return e.abs(i,i),i.x<=i.y?n=e.clone(e.UNIT_X,n):n=e.clone(e.UNIT_Y,n),n}static equals(t,n){return t===n||l(t)&&l(n)&&t.x===n.x&&t.y===n.y}static equalsArray(t,n,i){return t.x===n[i]&&t.y===n[i+1]}static equalsEpsilon(t,n,i,r){return t===n||l(t)&&l(n)&&D.equalsEpsilon(t.x,n.x,i,r)&&D.equalsEpsilon(t.y,n.y,i,r)}clone(t){return e.clone(this,t)}equals(t){return e.equals(this,t)}equalsEpsilon(t,n,i){return e.equalsEpsilon(this,t,n,i)}toString(){return`(${this.x}, ${this.y})`}};ps.fromCartesian3=ps.clone;ps.fromCartesian4=ps.clone;ps.packedLength=2;ps.fromArray=ps.unpack;var Pj=new ps,bue=new ps,xue=new ps,Tue=new ps,bUe=new ps;ps.ZERO=Object.freeze(new ps(0,0));ps.ONE=Object.freeze(new ps(1,1));ps.UNIT_X=Object.freeze(new ps(1,0));ps.UNIT_Y=Object.freeze(new ps(0,1));var U=ps;var xUe=new h,TUe=new h;function EUe(e,t,n,i,r){let o=e.x,s=e.y,a=e.z,c=t.x,u=t.y,f=t.z,d=o*o*c*c,p=s*s*u*u,g=a*a*f*f,m=d+p+g,y=Math.sqrt(1/m),A=h.multiplyByScalar(e,y,xUe);if(m<i)return isFinite(y)?h.clone(A,r):void 0;let b=n.x,x=n.y,T=n.z,E=TUe;E.x=A.x*b*2,E.y=A.y*x*2,E.z=A.z*T*2;let v=(1-y)*h.magnitude(e)/(.5*h.magnitude(E)),S=0,I,R,O,L,_,C,w,P,M,F,V;do{v-=S,O=1/(1+v*b),L=1/(1+v*x),_=1/(1+v*T),C=O*O,w=L*L,P=_*_,M=C*O,F=w*L,V=P*_,I=d*C+p*w+g*P-1,R=d*M*b+p*F*x+g*V*T;let B=-2*R;S=I/B}while(Math.abs(I)>D.EPSILON12);return l(r)?(r.x=o*O,r.y=s*L,r.z=a*_,r):new h(o*O,s*L,a*_)}var tx=EUe;var Fl=class Fl{constructor(t,n,i){this.longitude=t??0,this.latitude=n??0,this.height=i??0}static fromRadians(t,n,i,r){return i=i??0,l(r)?(r.longitude=t,r.latitude=n,r.height=i,r):new Fl(t,n,i)}static fromDegrees(t,n,i,r){return t=D.toRadians(t),n=D.toRadians(n),Fl.fromRadians(t,n,i,r)}static fromCartesian(t,n,i){let r=l(n)?n.oneOverRadii:Fl._ellipsoidOneOverRadii,o=l(n)?n.oneOverRadiiSquared:Fl._ellipsoidOneOverRadiiSquared,s=l(n)?n._centerToleranceSquared:Fl._ellipsoidCenterToleranceSquared,a=tx(t,r,o,s,vUe);if(!l(a))return;let c=h.multiplyComponents(a,o,CUe);c=h.normalize(c,c);let u=h.subtract(t,a,SUe),f=Math.atan2(c.y,c.x),d=Math.asin(c.z),p=D.sign(h.dot(u,t))*h.magnitude(u);return l(i)?(i.longitude=f,i.latitude=d,i.height=p,i):new Fl(f,d,p)}static toCartesian(t,n,i){return h.fromRadians(t.longitude,t.latitude,t.height,n,i)}static clone(t,n){if(l(t))return l(n)?(n.longitude=t.longitude,n.latitude=t.latitude,n.height=t.height,n):new Fl(t.longitude,t.latitude,t.height)}static equals(t,n){return t===n||l(t)&&l(n)&&t.longitude===n.longitude&&t.latitude===n.latitude&&t.height===n.height}static equalsEpsilon(t,n,i){return i=i??0,t===n||l(t)&&l(n)&&Math.abs(t.longitude-n.longitude)<=i&&Math.abs(t.latitude-n.latitude)<=i&&Math.abs(t.height-n.height)<=i}clone(t){return Fl.clone(this,t)}equals(t){return Fl.equals(this,t)}equalsEpsilon(t,n){return Fl.equalsEpsilon(this,t,n)}toString(){return`(${this.longitude}, ${this.latitude}, ${this.height})`}};ut(Fl,"_ellipsoidOneOverRadii",new h(1/6378137,1/6378137,1/6356752314245179e-9)),ut(Fl,"_ellipsoidOneOverRadiiSquared",new h(1/(6378137*6378137),1/(6378137*6378137),1/(6356752314245179e-9*6356752314245179e-9))),ut(Fl,"_ellipsoidCenterToleranceSquared",D.EPSILON1);var aD=Fl;aD.ZERO=Object.freeze(new aD(0,0,0));var CUe=new h,vUe=new h,SUe=new h,he=aD;function Eue(e,t,n,i){t=t??0,n=n??0,i=i??0,e._radii=new h(t,n,i),e._radiiSquared=new h(t*t,n*n,i*i),e._radiiToTheFourth=new h(t*t*t*t,n*n*n*n,i*i*i*i),e._oneOverRadii=new h(t===0?0:1/t,n===0?0:1/n,i===0?0:1/i),e._oneOverRadiiSquared=new h(t===0?0:1/(t*t),n===0?0:1/(n*n),i===0?0:1/(i*i)),e._minimumRadius=Math.min(t,n,i),e._maximumRadius=Math.max(t,n,i),e._centerToleranceSquared=D.EPSILON1,e._radiiSquared.z!==0&&(e._squaredXOverSquaredZ=e._radiiSquared.x/e._radiiSquared.z)}var Bl=class e{constructor(t,n,i){this._radii=void 0,this._radiiSquared=void 0,this._radiiToTheFourth=void 0,this._oneOverRadii=void 0,this._oneOverRadiiSquared=void 0,this._minimumRadius=void 0,this._maximumRadius=void 0,this._centerToleranceSquared=void 0,this._squaredXOverSquaredZ=void 0,Eue(this,t,n,i)}get radii(){return this._radii}get radiiSquared(){return this._radiiSquared}get radiiToTheFourth(){return this._radiiToTheFourth}get oneOverRadii(){return this._oneOverRadii}get oneOverRadiiSquared(){return this._oneOverRadiiSquared}get minimumRadius(){return this._minimumRadius}get maximumRadius(){return this._maximumRadius}static clone(t,n){if(!l(t))return;let i=t._radii;return l(n)?(h.clone(i,n._radii),h.clone(t._radiiSquared,n._radiiSquared),h.clone(t._radiiToTheFourth,n._radiiToTheFourth),h.clone(t._oneOverRadii,n._oneOverRadii),h.clone(t._oneOverRadiiSquared,n._oneOverRadiiSquared),n._minimumRadius=t._minimumRadius,n._maximumRadius=t._maximumRadius,n._centerToleranceSquared=t._centerToleranceSquared,n):new e(i.x,i.y,i.z)}static fromCartesian3(t,n){return l(n)||(n=new e),l(t)&&Eue(n,t.x,t.y,t.z),n}static get default(){return e._default}static set default(t){e._default=t,h._ellipsoidRadiiSquared=t.radiiSquared,he._ellipsoidOneOverRadii=t.oneOverRadii,he._ellipsoidOneOverRadiiSquared=t.oneOverRadiiSquared,he._ellipsoidCenterToleranceSquared=t._centerToleranceSquared}clone(t){return e.clone(this,t)}static pack(t,n,i){return i=i??0,h.pack(t._radii,n,i),n}static unpack(t,n,i){n=n??0;let r=h.unpack(t,n);return e.fromCartesian3(r,i)}geodeticSurfaceNormalCartographic(t,n){let i=t.longitude,r=t.latitude,o=Math.cos(r),s=o*Math.cos(i),a=o*Math.sin(i),c=Math.sin(r);return l(n)||(n=new h),n.x=s,n.y=a,n.z=c,h.normalize(n,n)}geodeticSurfaceNormal(t,n){if(!h.equalsEpsilon(t,h.ZERO,D.EPSILON14))return l(n)||(n=new h),n=h.multiplyComponents(t,this._oneOverRadiiSquared,n),h.normalize(n,n)}cartographicToCartesian(t,n){let i=wUe,r=IUe;this.geodeticSurfaceNormalCartographic(t,i),h.multiplyComponents(this._radiiSquared,i,r);let o=Math.sqrt(h.dot(i,r));return h.divideByScalar(r,o,r),h.multiplyByScalar(i,t.height,i),l(n)||(n=new h),h.add(r,i,n)}cartographicArrayToCartesianArray(t,n){let i=t.length;l(n)?n.length=i:n=new Array(i);for(let r=0;r<i;r++)n[r]=this.cartographicToCartesian(t[r],n[r]);return n}cartesianToCartographic(t,n){let i=this.scaleToGeodeticSurface(t,DUe);if(!l(i))return;let r=this.geodeticSurfaceNormal(i,PUe),o=h.subtract(t,i,RUe),s=Math.atan2(r.y,r.x),a=Math.asin(r.z),c=D.sign(h.dot(o,t))*h.magnitude(o);return l(n)?(n.longitude=s,n.latitude=a,n.height=c,n):new he(s,a,c)}cartesianArrayToCartographicArray(t,n){let i=t.length;l(n)?n.length=i:n=new Array(i);for(let r=0;r<i;++r)n[r]=this.cartesianToCartographic(t[r],n[r]);return n}scaleToGeodeticSurface(t,n){return tx(t,this._oneOverRadii,this._oneOverRadiiSquared,this._centerToleranceSquared,n)}scaleToGeocentricSurface(t,n){l(n)||(n=new h);let i=t.x,r=t.y,o=t.z,s=this._oneOverRadiiSquared,a=1/Math.sqrt(i*i*s.x+r*r*s.y+o*o*s.z);return h.multiplyByScalar(t,a,n)}transformPositionToScaledSpace(t,n){return l(n)||(n=new h),h.multiplyComponents(t,this._oneOverRadii,n)}transformPositionFromScaledSpace(t,n){return l(n)||(n=new h),h.multiplyComponents(t,this._radii,n)}equals(t){return this===t||l(t)&&h.equals(this._radii,t._radii)}toString(){return this._radii.toString()}getSurfaceNormalIntersectionWithZAxis(t,n,i){n=n??0;let r=this._squaredXOverSquaredZ;if(l(i)||(i=new h),i.x=0,i.y=0,i.z=t.z*(1-r),!(Math.abs(i.z)>=this._radii.z-n))return i}getLocalCurvature(t,n){l(n)||(n=new U);let i=this.getSurfaceNormalIntersectionWithZAxis(t,0,OUe),r=h.distance(t,i),o=this.minimumRadius*r/this.maximumRadius**2,s=r*o**2;return U.fromElements(1/r,1/s,n)}surfaceArea(t){let n=t.west,i=t.east,r=t.south,o=t.north;for(;i<n;)i+=D.TWO_PI;let s=this._radiiSquared,a=s.x,c=s.y,u=s.z,f=a*c;return Cue(r,o,function(d){let p=Math.cos(d),g=Math.sin(d);return Math.cos(d)*Cue(n,i,function(m){let y=Math.cos(m),A=Math.sin(m);return Math.sqrt(f*g*g+u*(c*y*y+a*A*A)*p*p)})})}};Bl.WGS84=Object.freeze(new Bl(6378137,6378137,6356752314245179e-9));Bl.UNIT_SPHERE=Object.freeze(new Bl(1,1,1));Bl.MOON=Object.freeze(new Bl(D.LUNAR_RADIUS,D.LUNAR_RADIUS,D.LUNAR_RADIUS));Bl.MARS=Object.freeze(new Bl(3396190,3396190,3376200));Bl._default=Bl.WGS84;Bl.packedLength=h.packedLength;Bl.prototype.geocentricSurfaceNormal=h.normalize;var wUe=new h,IUe=new h,PUe=new h,DUe=new h,RUe=new h,OUe=new h,MUe=[.14887433898163,.43339539412925,.67940956829902,.86506336668898,.97390652851717,0],NUe=[.29552422471475,.26926671930999,.21908636251598,.14945134915058,.066671344308684,0];function Cue(e,t,n){let i=.5*(t+e),r=.5*(t-e),o=0;for(let s=0;s<5;s++){let a=r*MUe[s];o+=NUe[s]*(n(i+a)+n(i-a))}return o*=r,o}var ee=Bl;var $q=class{constructor(t){this._ellipsoid=t??ee.default,this._semimajorAxis=this._ellipsoid.maximumRadius,this._oneOverSemimajorAxis=1/this._semimajorAxis}get ellipsoid(){return this._ellipsoid}project(t,n){let i=this._semimajorAxis,r=t.longitude*i,o=t.latitude*i,s=t.height;return l(n)?(n.x=r,n.y=o,n.z=s,n):new h(r,o,s)}unproject(t,n){let i=this._oneOverSemimajorAxis,r=t.x*i,o=t.y*i,s=t.z;return l(n)?(n.longitude=r,n.latitude=o,n.height=s,n):new he(r,o,s)}},Ui=$q;var vue={OUTSIDE:-1,INTERSECTING:0,INSIDE:1};Object.freeze(vue);var $t=vue;function LUe(e,t,n){let i=0,r=e.length-1,o,s;for(;i<=r;){if(o=~~((i+r)/2),s=n(e[o],t),s<0){i=o+1;continue}if(s>0){r=o-1;continue}return o}return~(r+1)}var vr=LUe;function FUe(e,t,n,i,r){this.xPoleWander=e,this.yPoleWander=t,this.xPoleOffset=n,this.yPoleOffset=i,this.ut1MinusUtc=r}var wy=FUe;function BUe(e){return e%4===0&&e%100!==0||e%400===0}var kl=BUe;var Sue=[31,28,31,30,31,30,31,31,30,31,30,31];function kUe(e,t,n,i,r,o,s,a){e=e??1,t=t??1,n=n??1,i=i??0,r=r??0,o=o??0,s=s??0,a=a??!1,this.year=e,this.month=t,this.day=n,this.hour=i,this.minute=r,this.second=o,this.millisecond=s,this.isLeapSecond=a;function y(){Wr.typeOf.number.greaterThanOrEquals("Year",e,1),Wr.typeOf.number.lessThanOrEquals("Year",e,9999),Wr.typeOf.number.greaterThanOrEquals("Month",t,1),Wr.typeOf.number.lessThanOrEquals("Month",t,12),Wr.typeOf.number.greaterThanOrEquals("Day",n,1),Wr.typeOf.number.lessThanOrEquals("Day",n,31),Wr.typeOf.number.greaterThanOrEquals("Hour",i,0),Wr.typeOf.number.lessThanOrEquals("Hour",i,23),Wr.typeOf.number.greaterThanOrEquals("Minute",r,0),Wr.typeOf.number.lessThanOrEquals("Minute",r,59),Wr.typeOf.bool("IsLeapSecond",a),Wr.typeOf.number.greaterThanOrEquals("Second",o,0),Wr.typeOf.number.lessThanOrEquals("Second",o,a?60:59),Wr.typeOf.number.greaterThanOrEquals("Millisecond",s,0),Wr.typeOf.number.lessThan("Millisecond",s,1e3)}function A(){let b=t===2&&kl(e)?Sue[t-1]+1:Sue[t-1];if(n>b)throw new pe("Month and Day represents invalid date")}}var Bh=kUe;function UUe(e,t){this.julianDate=e,this.offset=t}var yr=UUe;var wue={SECONDS_PER_MILLISECOND:.001,SECONDS_PER_MINUTE:60,MINUTES_PER_HOUR:60,HOURS_PER_DAY:24,SECONDS_PER_HOUR:3600,MINUTES_PER_DAY:1440,SECONDS_PER_DAY:86400,DAYS_PER_JULIAN_CENTURY:36525,PICOSECOND:1e-9,MODIFIED_JULIAN_DATE_DIFFERENCE:24000005e-1};Object.freeze(wue);var kn=wue;var Iue={UTC:0,TAI:1};Object.freeze(Iue);var si=Iue;var Pue=new Bh,Rj=[31,28,31,30,31,30,31,31,30,31,30,31],Oj=29;function Zq(e,t){return mi.compare(e.julianDate,t.julianDate)}var av=new yr;function Mj(e){av.julianDate=e;let t=mi.leapSeconds,n=vr(t,av,Zq);n<0&&(n=~n),n>=t.length&&(n=t.length-1);let i=t[n].offset;n>0&&mi.secondsDifference(t[n].julianDate,e)>i&&(n--,i=t[n].offset),mi.addSeconds(e,i,e)}function Due(e,t){av.julianDate=e;let n=mi.leapSeconds,i=vr(n,av,Zq);if(i<0&&(i=~i),i===0)return mi.addSeconds(e,-n[0].offset,t);if(i>=n.length)return mi.addSeconds(e,-n[i-1].offset,t);let r=mi.secondsDifference(n[i].julianDate,e);if(r===0)return mi.addSeconds(e,-n[i].offset,t);if(!(r<=1))return mi.addSeconds(e,-n[i-1].offset,t)}function Iy(e,t,n){let i=t/kn.SECONDS_PER_DAY|0;return e+=i,t-=kn.SECONDS_PER_DAY*i,t<0&&(e--,t+=kn.SECONDS_PER_DAY),n.dayNumber=e,n.secondsOfDay=t,n}function Jq(e,t,n,i,r,o,s){let a=(t-14)/12|0,c=e+4800+a,u=(1461*c/4|0)+(367*(t-2-12*a)/12|0)-(3*((c+100)/100|0)/4|0)+n-32075;i=i-12,i<0&&(i+=24);let f=o+(i*kn.SECONDS_PER_HOUR+r*kn.SECONDS_PER_MINUTE+s*kn.SECONDS_PER_MILLISECOND);return f>=43200&&(u-=1),[u,f]}var zUe=/^(\d{4})$/,VUe=/^(\d{4})-(\d{2})$/,jUe=/^(\d{4})-?(\d{3})$/,HUe=/^(\d{4})-?W(\d{2})-?(\d{1})?$/,GUe=/^(\d{4})-?(\d{2})-?(\d{2})$/,Qq=/([Z+\-])?(\d{2})?:?(\d{2})?$/,WUe=/^(\d{2})(\.\d+)?/.source+Qq.source,qUe=/^(\d{2}):?(\d{2})(\.\d+)?/.source+Qq.source,YUe=/^(\d{2}):?(\d{2}):?(\d{2})(\.\d+)?/.source+Qq.source;var Py={year:0,month:0,day:0,hour:0,minute:0,second:0,millisecond:0},XUe=[1,10,100,1e3,1e4,1e5,1e6,1e7,1e8,1e9,1e10,1e11,1e12,1e13,1e14,1e15];function ig(e,t){let n=e.charCodeAt(t)-48,i=e.charCodeAt(t+1)-48;return n<0||n>9||i<0||i>9?-1:n*10+i}var Rue=NaN,Oue=0;function Mue(e,t,n,i,r,o,s){Py.year=e,Py.month=t,Py.day=n,Py.hour=i,Py.minute=r,Py.second=o,Py.millisecond=s}function KUe(e){let t=e.length;if(t===4){let m=ig(e,0),y=ig(e,2);return m<0||y<0?!1:(Mue(m*100+y,1,1,0,0,0,0),!0)}let n=e.charCodeAt(t-1)===90,i=n?t-1:t;if(i<19||e.charCodeAt(4)!==45||e.charCodeAt(7)!==45||e.charCodeAt(10)!==84||e.charCodeAt(13)!==58||e.charCodeAt(16)!==58)return!1;let r=ig(e,0),o=ig(e,2),s=ig(e,5),a=ig(e,8),c=ig(e,11),u=ig(e,14),f=ig(e,17);if(r<0||o<0||s<1||s>12||a<1||a>31||c<0||c>23||u<0||u>59||f<0||f>60)return!1;let d=0;if(i>19){let m=e.charCodeAt(19),y=i-20;if(m!==46&&m!==44||y<1||y>15)return!1;let A=0;for(let b=20;b<i;b++){let x=e.charCodeAt(b)-48;if(x<0||x>9)return!1;A=A*10+x}d=A/XUe[y]*1e3}let p=r*100+o,g=kl(p);if((s!==2||!g?Rj[s-1]:Oj)<a)return!1;if(!n){let m=Date.UTC(p,s-1,a,c,u);m!==Rue&&(Rue=m,Oue=new Date(m).getTimezoneOffset()),u=u+Oue}return Mue(p,s,a,c,u,f,d),!0}function Nue(e,t,n,i,r,o,s,a,c){let u,f=o===60;for(f&&o--;r>=60;)r-=60,i++;for(;i>=24;)i-=24,n++;for(u=a&&t===2?Oj:Rj[t-1];n>u;)n-=u,t++,t>12&&(t-=12,e++),u=a&&t===2?Oj:Rj[t-1];for(;r<0;)r+=60,i--;for(;i<0;)i+=24,n--;for(;n<1;)t--,t<1&&(t+=12,e--),u=a&&t===2?Oj:Rj[t-1],n+=u;let d=Jq(e,t,n,i,r,o,s);return l(c)?(Iy(d[0],d[1],c),Mj(c)):c=new mi(d[0],d[1],si.UTC),f&&mi.addSeconds(c,1,c),c}var mi=class e{constructor(t,n,i){this.dayNumber=void 0,this.secondsOfDay=void 0,t=t??0,n=n??0,i=i??si.UTC;let r=t|0;n=n+(t-r)*kn.SECONDS_PER_DAY,Iy(r,n,this),i===si.UTC&&Mj(this)}static fromGregorianDate(t,n){let i=Jq(t.year,t.month,t.day,t.hour,t.minute,t.second,t.millisecond);return l(n)?(Iy(i[0],i[1],n),Mj(n),n):new e(i[0],i[1],si.UTC)}static fromDate(t,n){let i=Jq(t.getUTCFullYear(),t.getUTCMonth()+1,t.getUTCDate(),t.getUTCHours(),t.getUTCMinutes(),t.getUTCSeconds(),t.getUTCMilliseconds());return l(n)?(Iy(i[0],i[1],n),Mj(n),n):new e(i[0],i[1],si.UTC)}static fromIso8601(t,n){if(KUe(t)){let A=Py;return Nue(A.year,A.month,A.day,A.hour,A.minute,A.second,A.millisecond,kl(A.year),n)}t=t.replace(",",".");let i=t.split("T"),r,o=1,s=1,a=0,c=0,u=0,f=0,d=i[0],p=i[1],g,m;if(i=d.match(GUe),i!==null)r=+i[1],o=+i[2],s=+i[3];else if(i=d.match(VUe),i!==null)r=+i[1],o=+i[2];else if(i=d.match(zUe),i!==null)r=+i[1];else{let A;if(i=d.match(jUe),i!==null)r=+i[1],A=+i[2],m=kl(r);else if(i=d.match(HUe),i!==null){r=+i[1];let b=+i[2],x=+i[3]||0,T=new Date(Date.UTC(r,0,4));A=b*7+x-T.getUTCDay()-3}g=new Date(Date.UTC(r,0,1)),g.setUTCDate(A),o=g.getUTCMonth()+1,s=g.getUTCDate()}m=kl(r);let y;if(l(p)){i=p.match(YUe),i!==null?(a=+i[1],c=+i[2],u=+i[3],f=+(i[4]||0)*1e3,y=5):(i=p.match(qUe),i!==null?(a=+i[1],c=+i[2],u=+(i[3]||0)*60,y=4):(i=p.match(WUe),i!==null&&(a=+i[1],c=+(i[2]||0)*60,y=3)));let A=i[y],b=+i[y+1],x=+(i[y+2]||0);switch(A){case"+":a=a-b,c=c-x;break;case"-":a=a+b,c=c+x;break;case"Z":break;default:c=c+new Date(Date.UTC(r,o-1,s,a,c)).getTimezoneOffset();break}}return Nue(r,o,s,a,c,u,f,m,n)}static now(t){return e.fromDate(new Date,t)}static toGregorianDate(t,n){let i=!1,r=Due(t,Dj);l(r)||(e.addSeconds(t,-1,Dj),r=Due(Dj,Dj),i=!0);let o=r.dayNumber,s=r.secondsOfDay;s>=43200&&(o+=1);let a=o+68569|0,c=4*a/146097|0;a=a-((146097*c+3)/4|0)|0;let u=4e3*(a+1)/1461001|0;a=a-(1461*u/4|0)+31|0;let f=80*a/2447|0,d=a-(2447*f/80|0)|0;a=f/11|0;let p=f+2-12*a|0,g=100*(c-49)+u+a|0,m=s/kn.SECONDS_PER_HOUR|0,y=s-m*kn.SECONDS_PER_HOUR,A=y/kn.SECONDS_PER_MINUTE|0;y=y-A*kn.SECONDS_PER_MINUTE;let b=y|0,x=(y-b)/kn.SECONDS_PER_MILLISECOND;return m+=12,m>23&&(m-=24),i&&(b+=1),l(n)?(n.year=g,n.month=p,n.day=d,n.hour=m,n.minute=A,n.second=b,n.millisecond=x,n.isLeapSecond=i,n):new Bh(g,p,d,m,A,b,x,i)}static toDate(t){let n=e.toGregorianDate(t,Pue),i=n.second;return n.isLeapSecond&&(i-=1),new Date(Date.UTC(n.year,n.month-1,n.day,n.hour,n.minute,i,n.millisecond))}static toIso8601(t,n){let i=e.toGregorianDate(t,Pue),r=i.year,o=i.month,s=i.day,a=i.hour,c=i.minute,u=i.second,f=i.millisecond;r===1e4&&o===1&&s===1&&a===0&&c===0&&u===0&&f===0&&(r=9999,o=12,s=31,a=24);let d;if(!l(n)&&f!==0){let p=f*.01;return d=p<1e-6?p.toFixed(20).replace(".","").replace(/0+$/,""):p.toString().replace(".",""),`${r.toString().padStart(4,"0")}-${o.toString().padStart(2,"0")}-${s.toString().padStart(2,"0")}T${a.toString().padStart(2,"0")}:${c.toString().padStart(2,"0")}:${u.toString().padStart(2,"0")}.${d}Z`}return!l(n)||n===0?`${r.toString().padStart(4,"0")}-${o.toString().padStart(2,"0")}-${s.toString().padStart(2,"0")}T${a.toString().padStart(2,"0")}:${c.toString().padStart(2,"0")}:${u.toString().padStart(2,"0")}Z`:(d=(f*.01).toFixed(n).replace(".","").slice(0,n),`${r.toString().padStart(4,"0")}-${o.toString().padStart(2,"0")}-${s.toString().padStart(2,"0")}T${a.toString().padStart(2,"0")}:${c.toString().padStart(2,"0")}:${u.toString().padStart(2,"0")}.${d}Z`)}static clone(t,n){if(l(t))return l(n)?(n.dayNumber=t.dayNumber,n.secondsOfDay=t.secondsOfDay,n):new e(t.dayNumber,t.secondsOfDay,si.TAI)}static compare(t,n){let i=t.dayNumber-n.dayNumber;return i!==0?i:t.secondsOfDay-n.secondsOfDay}static equals(t,n){return t===n||l(t)&&l(n)&&t.dayNumber===n.dayNumber&&t.secondsOfDay===n.secondsOfDay}static equalsEpsilon(t,n,i){return i=i??0,t===n||l(t)&&l(n)&&Math.abs(e.secondsDifference(t,n))<=i}static totalDays(t){return t.dayNumber+t.secondsOfDay/kn.SECONDS_PER_DAY}static secondsDifference(t,n){return(t.dayNumber-n.dayNumber)*kn.SECONDS_PER_DAY+(t.secondsOfDay-n.secondsOfDay)}static daysDifference(t,n){let i=t.dayNumber-n.dayNumber,r=(t.secondsOfDay-n.secondsOfDay)/kn.SECONDS_PER_DAY;return i+r}static computeTaiMinusUtc(t){av.julianDate=t;let n=e.leapSeconds,i=vr(n,av,Zq);return i<0&&(i=~i,--i,i<0&&(i=0)),n[i].offset}static addSeconds(t,n,i){return Iy(t.dayNumber,t.secondsOfDay+n,i)}static addMinutes(t,n,i){let r=t.secondsOfDay+n*kn.SECONDS_PER_MINUTE;return Iy(t.dayNumber,r,i)}static addHours(t,n,i){let r=t.secondsOfDay+n*kn.SECONDS_PER_HOUR;return Iy(t.dayNumber,r,i)}static addDays(t,n,i){let r=t.dayNumber+n;return Iy(r,t.secondsOfDay,i)}static lessThan(t,n){return e.compare(t,n)<0}static lessThanOrEquals(t,n){return e.compare(t,n)<=0}static greaterThan(t,n){return e.compare(t,n)>0}static greaterThanOrEquals(t,n){return e.compare(t,n)>=0}clone(t){return e.clone(this,t)}equals(t){return e.equals(this,t)}equalsEpsilon(t,n){return e.equalsEpsilon(this,t,n)}toString(){return e.toIso8601(this)}},Dj=new mi(0,0,si.TAI);mi.leapSeconds=[new yr(new mi(2441317,43210,si.TAI),10),new yr(new mi(2441499,43211,si.TAI),11),new yr(new mi(2441683,43212,si.TAI),12),new yr(new mi(2442048,43213,si.TAI),13),new yr(new mi(2442413,43214,si.TAI),14),new yr(new mi(2442778,43215,si.TAI),15),new yr(new mi(2443144,43216,si.TAI),16),new yr(new mi(2443509,43217,si.TAI),17),new yr(new mi(2443874,43218,si.TAI),18),new yr(new mi(2444239,43219,si.TAI),19),new yr(new mi(2444786,43220,si.TAI),20),new yr(new mi(2445151,43221,si.TAI),21),new yr(new mi(2445516,43222,si.TAI),22),new yr(new mi(2446247,43223,si.TAI),23),new yr(new mi(2447161,43224,si.TAI),24),new yr(new mi(2447892,43225,si.TAI),25),new yr(new mi(2448257,43226,si.TAI),26),new yr(new mi(2448804,43227,si.TAI),27),new yr(new mi(2449169,43228,si.TAI),28),new yr(new mi(2449534,43229,si.TAI),29),new yr(new mi(2450083,43230,si.TAI),30),new yr(new mi(2450630,43231,si.TAI),31),new yr(new mi(2451179,43232,si.TAI),32),new yr(new mi(2453736,43233,si.TAI),33),new yr(new mi(2454832,43234,si.TAI),34),new yr(new mi(2456109,43235,si.TAI),35),new yr(new mi(2457204,43236,si.TAI),36),new yr(new mi(2457754,43237,si.TAI),37)];var K=mi;var tfe=Qo(Tf(),1);function $Ue(e){return(e.length===0||e[e.length-1]!=="/")&&(e=`${e}/`),e}var cD=$Ue;function Vue(e,t){if(e===null||typeof e!="object")return e;t=t??!1;let n=new e.constructor;for(let i in e)if(e.hasOwnProperty(i)){let r=e[i];t&&(r=Vue(r,t)),n[i]=r}return n}var Je=Vue;function jue(e,t,n){n=n??!1;let i={},r=l(e),o=l(t),s,a,c;if(r)for(s in e)e.hasOwnProperty(s)&&(a=e[s],o&&n&&typeof a=="object"&&t.hasOwnProperty(s)?(c=t[s],typeof c=="object"?i[s]=jue(a,c,n):i[s]=a):i[s]=a);if(o)for(s in t)t.hasOwnProperty(s)&&!i.hasOwnProperty(s)&&(c=t[s],i[s]=c);return i}var Ot=jue;function JUe(){let e,t,n=new Promise(function(i,r){e=i,t=r});return{resolve:e,reject:t,promise:n}}var Pu=JUe;var Hue=Qo(Tf(),1);function eY(e,t){let n;return typeof document<"u"&&(n=document),eY._implementation(e,t,n)}eY._implementation=function(e,t,n){if(!l(t)){if(typeof n>"u")return e;t=n.baseURI??n.location.href}let i=new Hue.default(e);return i.scheme()!==""?i.toString():i.absoluteTo(t).toString()};var vd=eY;var Gue=Qo(Tf(),1);function ZUe(e,t){let n="",i=e.lastIndexOf("/");return i!==-1&&(n=e.substring(0,i+1)),t&&(e=new Gue.default(e),e.query().length!==0&&(n+=`?${e.query()}`),e.fragment().length!==0&&(n+=`#${e.fragment()}`)),n}var lD=ZUe;var Wue=Qo(Tf(),1);function QUe(e){let t=new Wue.default(e);t.normalize();let n=t.path(),i=n.lastIndexOf("/");return i!==-1&&(n=n.substr(i+1)),i=n.lastIndexOf("."),i===-1?n="":n=n.substr(i+1),n}var rg=QUe;var que={};function eze(e,t,n){l(t)||(t=e.width),l(n)||(n=e.height);let i=que[t];l(i)||(i={},que[t]=i);let r=i[n];if(!l(r)){let o=document.createElement("canvas");o.width=t,o.height=n,r=o.getContext("2d",{willReadFrequently:!0}),r.globalCompositeOperation="copy",i[n]=r}return r.drawImage(e,0,0,t,n),r.getImageData(0,0,t,n).data}var kh=eze;var tze=/^blob:/i;function nze(e){return tze.test(e)}var nx=nze;var Sp;function ize(e){l(Sp)||(Sp=document.createElement("a")),Sp.href=window.location.href;let t=Sp.host,n=Sp.protocol;return Sp.href=e,Sp.href=Sp.href,n!==Sp.protocol||t!==Sp.host}var Dy=ize;var rze=/^data:/i;function oze(e){return rze.test(e)}var Uh=oze;function sze(e){let t=document.createElement("script");return t.async=!0,t.src=e,new Promise((n,i)=>{window.crossOriginIsolated&&t.setAttribute("crossorigin","anonymous");let r=document.getElementsByTagName("head")[0];t.onload=function(){t.onload=void 0,r.removeChild(t),n()},t.onerror=function(o){i(o)},r.appendChild(t)})}var ix=sze;function aze(e){let t="";for(let n in e)if(e.hasOwnProperty(n)){let i=e[n],r=`${encodeURIComponent(n)}=`;if(Array.isArray(i))for(let o=0,s=i.length;o<s;++o)t+=`${r+encodeURIComponent(i[o])}&`;else t+=`${r+encodeURIComponent(i)}&`}return t=t.slice(0,-1),t}var rx=aze;function cze(e){let t={};if(e==="")return t;let n=e.replace(/\+/g,"%20").split(/[&;]/);for(let i=0,r=n.length;i<r;++i){let o=n[i].split("="),s=decodeURIComponent(o[0]),a=o[1];l(a)?a=decodeURIComponent(a):a="";let c=t[s];typeof c=="string"?t[s]=[c,a]:Array.isArray(c)?c.push(a):t[s]=a}return t}var Ef=cze;var Yue={UNISSUED:0,ISSUED:1,ACTIVE:2,RECEIVED:3,CANCELLED:4,FAILED:5};Object.freeze(Yue);var Ti=Yue;var Xue={TERRAIN:0,IMAGERY:1,TILES3D:2,OTHER:3};Object.freeze(Xue);var Zs=Xue;function Bj(e){e=e??H.EMPTY_OBJECT;let t=e.throttleByServer??!1,n=e.throttle??!1;this.url=e.url,this.requestFunction=e.requestFunction,this.cancelFunction=e.cancelFunction,this.priorityFunction=e.priorityFunction,this.priority=e.priority??0,this.throttle=n,this.throttleByServer=t,this.type=e.type??Zs.OTHER,this.serverKey=e.serverKey,this.state=Ti.UNISSUED,this.deferred=void 0,this.cancelled=!1}Bj.prototype.cancel=function(){this.cancelled=!0};Bj.prototype.clone=function(e){return l(e)?(e.url=this.url,e.requestFunction=this.requestFunction,e.cancelFunction=this.cancelFunction,e.priorityFunction=this.priorityFunction,e.priority=this.priority,e.throttle=this.throttle,e.throttleByServer=this.throttleByServer,e.type=this.type,e.serverKey=this.serverKey,e.state=Ti.UNISSUED,e.deferred=void 0,e.cancelled=!1,e):new Bj(this)};var wo=Bj;function lze(e){let t={};if(!e)return t;let n=e.split(`\r -`);for(let i=0;i<n.length;++i){let r=n[i],o=r.indexOf(": ");if(o>0){let s=r.substring(0,o),a=r.substring(o+2);t[s]=a}}return t}var uD=lze;function Kue(e,t,n){this.statusCode=e,this.response=t,this.responseHeaders=n,typeof this.responseHeaders=="string"&&(this.responseHeaders=uD(this.responseHeaders))}Kue.prototype.toString=function(){let e="Request has failed.";return l(this.statusCode)&&(e+=` Status Code: ${this.statusCode}`),e};var wp=Kue;var zj=Qo(Tf(),1);function fD(){this._listeners=new Map,this._toRemove=new Map,this._toAdd=new Map,this._invokingListeners=!1,this._listenerCount=0}Object.defineProperties(fD.prototype,{numberOfListeners:{get:function(){return this._listenerCount}}});fD.prototype.addEventListener=function(e,t){let n=this,i=n._invokingListeners?n._toAdd:n._listeners;return nY(this,i,e,t)&&n._listenerCount++,function(){n.removeEventListener(e,t)}};function nY(e,t,n,i){t.has(n)||t.set(n,new Set);let r=t.get(n);return r.has(i)?!1:(r.add(i),!0)}fD.prototype.removeEventListener=function(e,t){let n=tY(this,this._listeners,e,t),i=tY(this,this._toAdd,e,t),r=n||i;return r&&this._listenerCount--,r};function tY(e,t,n,i){let r=t.get(n);if(!r||!r.has(i))return!1;if(e._invokingListeners){if(!nY(e,e._toRemove,n,i))return!1}else r.delete(i),r.size===0&&t.delete(n);return!0}var Uj,kj;function uze(e){Uj.apply(e,kj)}function fze(e,t){l(t)&&(Uj=t,e.forEach(uze))}fD.prototype.raiseEvent=function(){this._invokingListeners=!0;let e=Uj,t=kj;kj=arguments;try{this._listeners.forEach(fze)}finally{Uj=e,kj=t}if(this._invokingListeners=!1,this._toAdd.size>0){for(let[n,i]of this._toAdd.entries())for(let r of i)nY(this,this._listeners,n,r);this._toAdd.clear()}if(this._toRemove.size>0){for(let[n,i]of this._toRemove.entries())for(let r of i)tY(this,this._listeners,n,r);this._toRemove.clear()}};var be=fD;function ox(e){this._comparator=e.comparator,this._array=[],this._length=0,this._maximumLength=void 0}Object.defineProperties(ox.prototype,{length:{get:function(){return this._length}},internalArray:{get:function(){return this._array}},maximumLength:{get:function(){return this._maximumLength},set:function(e){let t=this._length;if(e<t){let n=this._array;for(let i=e;i<t;++i)n[i]=void 0;this._length=e,n.length=e}this._maximumLength=e}},comparator:{get:function(){return this._comparator}}});function iY(e,t,n){let i=e[t];e[t]=e[n],e[n]=i}ox.prototype.reserve=function(e){e=e??this._length,this._array.length=e};ox.prototype.heapify=function(e){e=e??0;let t=this._length,n=this._comparator,i=this._array,r,o=!0;for(;o;){let s=2*(e+1),a=s-1;a<t&&n(i[a],i[e])<0?r=a:r=e,s<t&&n(i[s],i[r])<0&&(r=s),r!==e?(iY(i,r,e),e=r):o=!1}};ox.prototype.resort=function(){let e=this._length;for(let t=Math.ceil(e/2);t>=0;--t)this.heapify(t)};ox.prototype.insert=function(e){let t=this._array,n=this._comparator,i=this._maximumLength,r=this._length++;for(r<t.length?t[r]=e:t.push(e);r!==0;){let s=Math.floor((r-1)/2);if(n(t[r],t[s])<0)iY(t,r,s),r=s;else break}let o;return l(i)&&this._length>i&&(o=t[i],this._length=i),o};ox.prototype.pop=function(e){if(e=e??0,this._length===0)return;let t=this._array,n=t[e];return iY(t,e,--this._length),this.heapify(e),t[this._length]=void 0,n};var dD=ox;function dze(e,t){return e.priority-t.priority}var Sr={numberOfAttemptedRequests:0,numberOfActiveRequests:0,numberOfCancelledRequests:0,numberOfCancelledActiveRequests:0,numberOfFailedRequests:0,numberOfActiveRequestsEver:0,lastNumberOfActiveRequests:0},uv=20,Xc=new dD({comparator:dze});Xc.maximumLength=uv;Xc.reserve(uv);var Ip=[],og={},hze=typeof document<"u"?new zj.default(document.location.href):new zj.default,Vj=new be;function Io(){}Io.maximumRequests=50;Io.maximumRequestsPerServer=18;Io.requestsByServer={};Io.throttleRequests=!0;Io.debugShowStatistics=!1;Io.requestCompletedEvent=Vj;Object.defineProperties(Io,{statistics:{get:function(){return Sr}},priorityHeapLength:{get:function(){return uv},set:function(e){if(e<uv)for(;Xc.length>e;){let t=Xc.pop();sx(t)}uv=e,Xc.maximumLength=e,Xc.reserve(e)}}});function $ue(e){l(e.priorityFunction)&&(e.priority=e.priorityFunction())}Io.serverHasOpenSlots=function(e,t){t=t??1;let n=Io.requestsByServer[e]??Io.maximumRequestsPerServer;return og[e]+t<=n};Io.heapHasOpenSlots=function(e){return Xc.length+e<=uv};function Jue(e){return e.state===Ti.UNISSUED&&(e.state=Ti.ISSUED,e.deferred=Pu()),e.deferred.promise}function mze(e){return function(t){if(e.state===Ti.CANCELLED)return;let n=e.deferred;--Sr.numberOfActiveRequests,--og[e.serverKey],Vj.raiseEvent(),e.state=Ti.RECEIVED,e.deferred=void 0,n.resolve(t)}}function pze(e){return function(t){e.state!==Ti.CANCELLED&&(++Sr.numberOfFailedRequests,--Sr.numberOfActiveRequests,--og[e.serverKey],Vj.raiseEvent(t),e.state=Ti.FAILED,e.deferred.reject(t))}}function Zue(e){let t=Jue(e);return e.state=Ti.ACTIVE,Ip.push(e),++Sr.numberOfActiveRequests,++Sr.numberOfActiveRequestsEver,++og[e.serverKey],e.requestFunction().then(mze(e)).catch(pze(e)),t}function sx(e){let t=e.state===Ti.ACTIVE;if(e.state=Ti.CANCELLED,++Sr.numberOfCancelledRequests,l(e.deferred)){let n=e.deferred;n.promise.catch(()=>{}),e.deferred=void 0,n.reject(new oe(`Request cancelled: "${e.url}"`))}t&&(--Sr.numberOfActiveRequests,--og[e.serverKey],++Sr.numberOfCancelledActiveRequests),l(e.cancelFunction)&&e.cancelFunction()}Io.update=function(){let e,t,n=0,i=Ip.length;for(e=0;e<i;++e){if(t=Ip[e],t.cancelled&&sx(t),t.state!==Ti.ACTIVE){++n;continue}n>0&&(Ip[e-n]=t)}Ip.length-=n;let r=Xc.internalArray,o=Xc.length;for(e=0;e<o;++e)$ue(r[e]);Xc.resort();let s=Math.max(Io.maximumRequests-Ip.length,0),a=0;for(;a<s&&Xc.length>0;){if(t=Xc.pop(),t.cancelled){sx(t);continue}if(t.throttleByServer&&!Io.serverHasOpenSlots(t.serverKey)){sx(t);continue}Zue(t),++a}gze()};Io.getServerKey=function(e){let t=new zj.default(e);t.scheme()===""&&(t=t.absoluteTo(hze),t.normalize());let n=t.authority();/:/.test(n)||(n=`${n}:${t.scheme()==="https"?"443":"80"}`);let i=og[n];return l(i)||(og[n]=0),n};Io.request=function(e){if(Uh(e.url)||nx(e.url))return Vj.raiseEvent(),e.state=Ti.RECEIVED,e.requestFunction();if(++Sr.numberOfAttemptedRequests,l(e.serverKey)||(e.serverKey=Io.getServerKey(e.url)),Io.throttleRequests&&e.throttleByServer&&!Io.serverHasOpenSlots(e.serverKey))return;if(!Io.throttleRequests||!e.throttle)return Zue(e);if(Ip.length>=Io.maximumRequests)return;$ue(e);let t=Xc.insert(e);if(l(t)){if(t===e)return;sx(t)}return Jue(e)};function gze(){Io.debugShowStatistics&&(Sr.numberOfActiveRequests===0&&Sr.lastNumberOfActiveRequests>0&&(Sr.numberOfAttemptedRequests>0&&(console.log(`Number of attempted requests: ${Sr.numberOfAttemptedRequests}`),Sr.numberOfAttemptedRequests=0),Sr.numberOfCancelledRequests>0&&(console.log(`Number of cancelled requests: ${Sr.numberOfCancelledRequests}`),Sr.numberOfCancelledRequests=0),Sr.numberOfCancelledActiveRequests>0&&(console.log(`Number of cancelled active requests: ${Sr.numberOfCancelledActiveRequests}`),Sr.numberOfCancelledActiveRequests=0),Sr.numberOfFailedRequests>0&&(console.log(`Number of failed requests: ${Sr.numberOfFailedRequests}`),Sr.numberOfFailedRequests=0)),Sr.lastNumberOfActiveRequests=Sr.numberOfActiveRequests)}Io.clearForSpecs=function(){for(;Xc.length>0;){let t=Xc.pop();sx(t)}let e=Ip.length;for(let t=0;t<e;++t)sx(Ip[t]);Ip.length=0,og={},Sr.numberOfAttemptedRequests=0,Sr.numberOfActiveRequests=0,Sr.numberOfCancelledRequests=0,Sr.numberOfCancelledActiveRequests=0,Sr.numberOfFailedRequests=0,Sr.numberOfActiveRequestsEver=0,Sr.lastNumberOfActiveRequests=0};Io.numberOfActiveRequestsByServer=function(e){return og[e]};Io.requestHeap=Xc;var Kc=Io;var Que=Qo(Tf(),1);var hD={},fv={};hD.add=function(e,t){let n=`${e.toLowerCase()}:${t}`;l(fv[n])||(fv[n]=!0)};hD.remove=function(e,t){let n=`${e.toLowerCase()}:${t}`;l(fv[n])&&delete fv[n]};function _ze(e){let t=new Que.default(e);t.normalize();let n=t.authority();if(n.length!==0){if(t.authority(n),n.indexOf("@")!==-1&&(n=n.split("@")[1]),n.indexOf(":")===-1){let i=t.scheme();if(i.length===0&&(i=window.location.protocol,i=i.substring(0,i.length-1)),i==="http")n+=":80";else if(i==="https")n+=":443";else return}return n}}hD.contains=function(e){let t=_ze(e);return!!(l(t)&&l(fv[t]))};hD.clear=function(){fv={}};var dv=hD;var nfe=(function(){try{let e=new XMLHttpRequest;return e.open("GET","#",!0),e.responseType="blob",e.responseType==="blob"}catch{return!1}})();function zt(e){e=e??H.EMPTY_OBJECT,typeof e=="string"&&(e={url:e}),this._url=void 0,this._templateValues=Pp(e.templateValues,{}),this._queryParameters=Pp(e.queryParameters,{}),this.headers=Pp(e.headers,{}),this.request=e.request??new wo,this.proxy=e.proxy,this.retryCallback=e.retryCallback,this.retryAttempts=e.retryAttempts??0,this._retryCount=0,e.parseUrl??!0?this.parseUrl(e.url,!0,!0):this._url=e.url,this._credits=e.credits}function Pp(e,t){return l(e)?Je(e):t}zt.createIfNeeded=function(e){return e instanceof zt?e.getDerivedResource({request:e.request}):typeof e!="string"?e:new zt({url:e})};var hv;zt.supportsImageBitmapOptions=function(){return l(hv)?hv:typeof createImageBitmap!="function"?(hv=Promise.resolve(!1),hv):(hv=zt.fetchBlob({url:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAIAAACQd1PeAAAABGdBTUEAAE4g3rEiDgAAACBjSFJNAAB6JgAAgIQAAPoAAACA6AAAdTAAAOpgAAA6mAAAF3CculE8AAAADElEQVQI12Ng6GAAAAEUAIngE3ZiAAAAAElFTkSuQmCC"}).then(function(t){let n={imageOrientation:"flipY",premultiplyAlpha:"none",colorSpaceConversion:"none"};return Promise.all([createImageBitmap(t,n),createImageBitmap(t)])}).then(function(t){let n=kh(t[0]),i=kh(t[1]);return n[1]!==i[1]}).catch(function(){return!1}),hv)};Object.defineProperties(zt,{isBlobSupported:{get:function(){return nfe}}});Object.defineProperties(zt.prototype,{queryParameters:{get:function(){return this._queryParameters}},templateValues:{get:function(){return this._templateValues}},url:{get:function(){return this.getUrlComponent(!0,!0)},set:function(e){this.parseUrl(e,!1,!1)}},extension:{get:function(){return rg(this._url)}},isDataUri:{get:function(){return Uh(this._url)}},isBlobUri:{get:function(){return nx(this._url)}},isCrossOriginUrl:{get:function(){return Dy(this._url)}},hasHeaders:{get:function(){return Object.keys(this.headers).length>0}},credits:{get:function(){return this._credits}}});zt.prototype.toString=function(){return this.getUrlComponent(!0,!0)};zt.prototype.parseUrl=function(e,t,n,i){let r=new tfe.default(e),o=yze(r.query());this._queryParameters=t?Hj(o,this.queryParameters,n):o,r.search(""),r.fragment(""),l(i)&&r.scheme()===""&&(r=r.absoluteTo(vd(i))),this._url=r.toString()};function yze(e){return e.length===0?{}:e.indexOf("=")===-1?{[e]:void 0}:Ef(e)}function Hj(e,t,n){if(!n)return Ot(e,t);let i=Je(e,!0);for(let r in t)if(t.hasOwnProperty(r)){let o=i[r],s=t[r];l(o)?(Array.isArray(o)||(o=i[r]=[o]),i[r]=o.concat(s)):i[r]=Array.isArray(s)?s.slice():s}return i}zt.prototype.getUrlComponent=function(e,t){if(this.isDataUri)return this._url;let n=this._url;e&&(n=`${n}${Aze(this.queryParameters)}`),n=n.replace(/%7B/g,"{").replace(/%7D/g,"}");let i=this._templateValues;return Object.keys(i).length>0&&(n=n.replace(/{(.*?)}/g,function(r,o){let s=i[o];return l(s)?encodeURIComponent(s):r})),t&&l(this.proxy)&&(n=this.proxy.getURL(n)),n};function Aze(e){let t=Object.keys(e);return t.length===0?"":t.length===1&&!l(e[t[0]])?`?${t[0]}`:`?${rx(e)}`}zt.prototype.setQueryParameters=function(e,t){t?this._queryParameters=Hj(this._queryParameters,e,!1):this._queryParameters=Hj(e,this._queryParameters,!1)};zt.prototype.appendQueryParameters=function(e){this._queryParameters=Hj(e,this._queryParameters,!0)};zt.prototype.setTemplateValues=function(e,t){t?this._templateValues=Ot(this._templateValues,e):this._templateValues=Ot(e,this._templateValues)};zt.prototype.getDerivedResource=function(e){let t=this.clone();if(t._retryCount=0,l(e.url)){let n=e.preserveQueryParameters??!1;t.parseUrl(e.url,!0,n,this._url)}return l(e.queryParameters)&&(t._queryParameters=Ot(e.queryParameters,t.queryParameters)),l(e.templateValues)&&(t._templateValues=Ot(e.templateValues,t.templateValues)),l(e.headers)&&(t.headers=Ot(e.headers,t.headers)),l(e.proxy)&&(t.proxy=e.proxy),l(e.request)&&(t.request=e.request),l(e.retryCallback)&&(t.retryCallback=e.retryCallback),l(e.retryAttempts)&&(t.retryAttempts=e.retryAttempts),t};zt.prototype.retryOnError=function(e){let t=this.retryCallback;if(typeof t!="function"||this._retryCount>=this.retryAttempts)return Promise.resolve(!1);let n=this;return Promise.resolve(t(this,e)).then(function(i){return++n._retryCount,i})};zt.prototype.clone=function(e){return l(e)?(e._url=this._url,e._queryParameters=Je(this._queryParameters),e._templateValues=Je(this._templateValues),e.headers=Je(this.headers),e.proxy=this.proxy,e.retryCallback=this.retryCallback,e.retryAttempts=this.retryAttempts,e._retryCount=0,e.request=this.request.clone(),e):new zt({url:this._url,queryParameters:this.queryParameters,templateValues:this.templateValues,headers:this.headers,proxy:this.proxy,retryCallback:this.retryCallback,retryAttempts:this.retryAttempts,request:this.request.clone(),parseUrl:!1,credits:l(this.credits)?this.credits.slice():void 0})};zt.prototype.getBaseUri=function(e){return lD(this.getUrlComponent(e),e)};zt.prototype.appendForwardSlash=function(){this._url=cD(this._url)};zt.prototype.fetchArrayBuffer=function(){return this.fetch({responseType:"arraybuffer"})};zt.fetchArrayBuffer=function(e){return new zt(e).fetchArrayBuffer()};zt.prototype.fetchBlob=function(){return this.fetch({responseType:"blob"})};zt.fetchBlob=function(e){return new zt(e).fetchBlob()};zt.prototype.fetchImage=function(e){e=e??H.EMPTY_OBJECT;let t=e.preferImageBitmap??!1,n=e.preferBlob??!1,i=e.flipY??!1,r=e.skipColorSpaceConversion??!1;if(rY(this.request),!nfe||this.isDataUri||this.isBlobUri||!this.hasHeaders&&!n)return this._fetchImage({resource:this,flipY:i,skipColorSpaceConversion:r,preferImageBitmap:t});let o=this.fetchBlob();if(!l(o))return;let s,a,c,u;return zt.supportsImageBitmapOptions().then(function(f){return s=f,a=s&&t,o}).then(function(f){if(!l(f))return;if(u=f,a)return zt.createImageBitmapFromBlob(f,{flipY:i,premultiplyAlpha:!1,skipColorSpaceConversion:r});let d=window.URL.createObjectURL(f);return c=new zt({url:d}),c._fetchImage({flipY:i,skipColorSpaceConversion:r,preferImageBitmap:!1})}).then(function(f){if(l(f))return f.blob=u,a||window.URL.revokeObjectURL(c.url),f}).catch(function(f){return l(c)&&window.URL.revokeObjectURL(c.url),f.blob=u,Promise.reject(f)})};zt.prototype._fetchImage=function(e){let t=this,n=e.flipY,i=e.skipColorSpaceConversion,r=e.preferImageBitmap,o=t.request;o.url=t.url,o.requestFunction=function(){let a=!1;!t.isDataUri&&!t.isBlobUri&&(a=t.isCrossOriginUrl);let c=Pu();return zt._Implementations.createImage(o,a,c,n,i,r),c.promise};let s=Kc.request(o);if(l(s))return s.catch(function(a){return o.state!==Ti.FAILED?Promise.reject(a):t.retryOnError(a).then(function(c){return c?(o.state=Ti.UNISSUED,o.deferred=void 0,t._fetchImage({flipY:n,skipColorSpaceConversion:i,preferImageBitmap:r})):Promise.reject(a)})})};zt.fetchImage=function(e){return new zt(e).fetchImage({flipY:e.flipY,skipColorSpaceConversion:e.skipColorSpaceConversion,preferBlob:e.preferBlob,preferImageBitmap:e.preferImageBitmap})};zt.prototype.fetchText=function(){return this.fetch({responseType:"text"})};zt.fetchText=function(e){return new zt(e).fetchText()};zt.prototype.fetchJson=function(){let e=this.fetch({responseType:"text",headers:{Accept:"application/json,*/*;q=0.01"}});if(l(e))return e.then(function(t){if(l(t))return JSON.parse(t)})};zt.fetchJson=function(e){return new zt(e).fetchJson()};zt.prototype.fetchXML=function(){return this.fetch({responseType:"document",overrideMimeType:"text/xml"})};zt.fetchXML=function(e){return new zt(e).fetchXML()};zt.prototype.fetchJsonp=function(e){e=e??"callback",rY(this.request);let t;do t=`loadJsonp${D.nextRandomNumber().toString().substring(2,8)}`;while(l(window[t]));return ife(this,e,t)};function ife(e,t,n){let i={};i[t]=n,e.setQueryParameters(i);let r=e.request,o=e.url;r.url=o,r.requestFunction=function(){let a=Pu();return window[n]=function(c){a.resolve(c);try{delete window[n]}catch{window[n]=void 0}},zt._Implementations.loadAndExecuteScript(o,n,a),a.promise};let s=Kc.request(r);if(l(s))return s.catch(function(a){return r.state!==Ti.FAILED?Promise.reject(a):e.retryOnError(a).then(function(c){return c?(r.state=Ti.UNISSUED,r.deferred=void 0,ife(e,t,n)):Promise.reject(a)})})}zt.fetchJsonp=function(e){return new zt(e).fetchJsonp(e.callbackParameterName)};zt.prototype._makeRequest=function(e){let t=this;rY(t.request);let n=t.request,i=t.url;n.url=i,n.requestFunction=function(){let o=e.responseType,s=Ot(e.headers,t.headers),a=e.overrideMimeType,c=e.method,u=e.data,f=Pu(),d=zt._Implementations.loadWithXhr(i,o,c,u,s,f,a);return l(d)&&l(d.abort)&&(n.cancelFunction=function(){d.abort()}),f.promise};let r=Kc.request(n);if(l(r))return r.then(function(o){return n.cancelFunction=void 0,o}).catch(function(o){return n.cancelFunction=void 0,n.state!==Ti.FAILED?Promise.reject(o):t.retryOnError(o).then(function(s){return s?(n.state=Ti.UNISSUED,n.deferred=void 0,t.fetch(e)):Promise.reject(o)})})};function rY(e){if(e.state===Ti.ISSUED||e.state===Ti.ACTIVE)throw new oe("The Resource is already being fetched.");e.state=Ti.UNISSUED,e.deferred=void 0}var bze=/^data:(.*?)(;base64)?,(.*)$/;function jj(e,t){let n=decodeURIComponent(t);return e?atob(n):n}function efe(e,t){let n=jj(e,t),i=new ArrayBuffer(n.length),r=new Uint8Array(i);for(let o=0;o<n.length;o++)r[o]=n.charCodeAt(o);return i}function xze(e,t){t=t??"";let n=e[1],i=!!e[2],r=e[3],o,s;switch(t){case"":case"text":return jj(i,r);case"arraybuffer":return efe(i,r);case"blob":return o=efe(i,r),new Blob([o],{type:n});case"document":return s=new DOMParser,s.parseFromString(jj(i,r),n);case"json":return JSON.parse(jj(i,r));default:}}zt.prototype.fetch=function(e){return e=Pp(e,{}),e.method="GET",this._makeRequest(e)};zt.fetch=function(e){return new zt(e).fetch({responseType:e.responseType,overrideMimeType:e.overrideMimeType})};zt.prototype.delete=function(e){return e=Pp(e,{}),e.method="DELETE",this._makeRequest(e)};zt.delete=function(e){return new zt(e).delete({responseType:e.responseType,overrideMimeType:e.overrideMimeType,data:e.data})};zt.prototype.head=function(e){return e=Pp(e,{}),e.method="HEAD",this._makeRequest(e)};zt.head=function(e){return new zt(e).head({responseType:e.responseType,overrideMimeType:e.overrideMimeType})};zt.prototype.options=function(e){return e=Pp(e,{}),e.method="OPTIONS",this._makeRequest(e)};zt.options=function(e){return new zt(e).options({responseType:e.responseType,overrideMimeType:e.overrideMimeType})};zt.prototype.post=function(e,t){return Wr.defined("data",e),t=Pp(t,{}),t.method="POST",t.data=e,this._makeRequest(t)};zt.post=function(e){return new zt(e).post(e.data,{responseType:e.responseType,overrideMimeType:e.overrideMimeType})};zt.prototype.put=function(e,t){return Wr.defined("data",e),t=Pp(t,{}),t.method="PUT",t.data=e,this._makeRequest(t)};zt.put=function(e){return new zt(e).put(e.data,{responseType:e.responseType,overrideMimeType:e.overrideMimeType})};zt.prototype.patch=function(e,t){return Wr.defined("data",e),t=Pp(t,{}),t.method="PATCH",t.data=e,this._makeRequest(t)};zt.patch=function(e){return new zt(e).patch(e.data,{responseType:e.responseType,overrideMimeType:e.overrideMimeType})};zt._Implementations={};zt._Implementations.loadImageElement=function(e,t,n){let i=new Image;i.onload=function(){i.naturalWidth===0&&i.naturalHeight===0&&i.width===0&&i.height===0&&(i.width=300,i.height=150),n.resolve(i)},i.onerror=function(r){n.reject(r)},t&&(dv.contains(e)?i.crossOrigin="use-credentials":i.crossOrigin=""),i.src=e};zt._Implementations.createImage=function(e,t,n,i,r,o,s){let a=e.url;zt.supportsImageBitmapOptions().then(function(c){if(!(c&&o)){zt._Implementations.loadImageElement(a,t,n);return}let u="blob",f="GET",d=Pu(),p=zt._Implementations.loadWithXhr(a,u,f,void 0,s,d,void 0,void 0,void 0);return l(p)&&l(p.abort)&&(e.cancelFunction=function(){p.abort()}),d.promise.then(function(g){if(!l(g)){n.reject(new oe(`Successfully retrieved ${a} but it contained no content.`));return}return zt.createImageBitmapFromBlob(g,{flipY:i,premultiplyAlpha:!1,skipColorSpaceConversion:r})}).then(function(g){n.resolve(g)})}).catch(function(c){n.reject(c)})};zt.createImageBitmapFromBlob=function(e,t){return Wr.defined("options",t),Wr.typeOf.bool("options.flipY",t.flipY),Wr.typeOf.bool("options.premultiplyAlpha",t.premultiplyAlpha),Wr.typeOf.bool("options.skipColorSpaceConversion",t.skipColorSpaceConversion),createImageBitmap(e,{imageOrientation:t.flipY?"flipY":"none",premultiplyAlpha:t.premultiplyAlpha?"premultiply":"none",colorSpaceConversion:t.skipColorSpaceConversion?"none":"default"})};function Tze(e,t,n,i,r,o,s){fetch(e,{method:n,headers:r}).then(async a=>{if(!a.ok){let c={};a.headers.forEach((u,f)=>{c[f]=u}),o.reject(new wp(a.status,a,c));return}switch(t){case"text":o.resolve(a.text());break;case"json":o.resolve(a.json());break;default:o.resolve(new Uint8Array(await a.arrayBuffer()).buffer);break}}).catch(()=>{o.reject(new wp)})}var Eze=typeof XMLHttpRequest>"u";zt._Implementations.loadWithXhr=function(e,t,n,i,r,o,s){let a=bze.exec(e);if(a!==null){o.resolve(xze(a,t));return}if(Eze){Tze(e,t,n,i,r,o,s);return}let c=new XMLHttpRequest;if(dv.contains(e)&&(c.withCredentials=!0),c.open(n,e,!0),l(s)&&l(c.overrideMimeType)&&c.overrideMimeType(s),l(r))for(let f in r)r.hasOwnProperty(f)&&c.setRequestHeader(f,r[f]);l(t)&&(c.responseType=t);let u=!1;return typeof e=="string"&&(u=e.indexOf("file://")===0||typeof window<"u"&&window.location.origin==="file://"),c.onload=function(){if((c.status<200||c.status>=300)&&!(u&&c.status===0)){o.reject(new wp(c.status,c.response,c.getAllResponseHeaders()));return}let f=c.response,d=c.responseType;if(n==="HEAD"||n==="OPTIONS"){let g=c.getAllResponseHeaders().trim().split(/[\r\n]+/),m={};g.forEach(function(y){let A=y.split(": "),b=A.shift();m[b]=A.join(": ")}),o.resolve(m);return}if(c.status===204)o.resolve(void 0);else if(l(f)&&(!l(t)||d===t))o.resolve(f);else if(t==="json"&&typeof f=="string")try{o.resolve(JSON.parse(f))}catch(p){o.reject(p)}else(d===""||d==="document")&&l(c.responseXML)&&c.responseXML.hasChildNodes()?o.resolve(c.responseXML):(d===""||d==="text")&&l(c.responseText)?o.resolve(c.responseText):o.reject(new oe("Invalid XMLHttpRequest response type."))},c.onerror=function(f){o.reject(new wp)},c.send(i),c};zt._Implementations.loadAndExecuteScript=function(e,t,n){return ix(e,t).catch(function(i){n.reject(i)})};zt._DefaultImplementations={};zt._DefaultImplementations.createImage=zt._Implementations.createImage;zt._DefaultImplementations.loadWithXhr=zt._Implementations.loadWithXhr;zt._DefaultImplementations.loadAndExecuteScript=zt._Implementations.loadAndExecuteScript;zt.DEFAULT=Object.freeze(new zt({url:typeof document>"u"?"":document.location.href.split("?")[0]}));var De=zt;function pD(e){e=e??H.EMPTY_OBJECT,this._dates=void 0,this._samples=void 0,this._dateColumn=-1,this._xPoleWanderRadiansColumn=-1,this._yPoleWanderRadiansColumn=-1,this._ut1MinusUtcSecondsColumn=-1,this._xCelestialPoleOffsetRadiansColumn=-1,this._yCelestialPoleOffsetRadiansColumn=-1,this._taiMinusUtcSecondsColumn=-1,this._columnCount=0,this._lastIndex=-1,this._addNewLeapSeconds=e.addNewLeapSeconds??!0,l(e.data)?rfe(this,e.data):rfe(this,{columnNames:["dateIso8601","modifiedJulianDateUtc","xPoleWanderRadians","yPoleWanderRadians","ut1MinusUtcSeconds","lengthOfDayCorrectionSeconds","xCelestialPoleOffsetRadians","yCelestialPoleOffsetRadians","taiMinusUtcSeconds"],samples:[]})}pD.fromUrl=async function(e,t){t=t??H.EMPTY_OBJECT;let n=De.createIfNeeded(e),i;try{i=await n.fetchJson()}catch{throw new oe(`An error occurred while retrieving the EOP data from the URL ${n.url}.`)}return new pD({addNewLeapSeconds:t.addNewLeapSeconds,data:i})};pD.NONE=Object.freeze({compute:function(e,t){return l(t)?(t.xPoleWander=0,t.yPoleWander=0,t.xPoleOffset=0,t.yPoleOffset=0,t.ut1MinusUtc=0):t=new wy(0,0,0,0,0),t}});pD.prototype.compute=function(e,t){if(!l(this._samples))return;if(l(t)||(t=new wy(0,0,0,0,0)),this._samples.length===0)return t.xPoleWander=0,t.yPoleWander=0,t.xPoleOffset=0,t.yPoleOffset=0,t.ut1MinusUtc=0,t;let n=this._dates,i=this._lastIndex,r,o;if(l(i)){let a=n[i],c=n[i+1],u=K.lessThanOrEquals(a,e),f=!l(c),d=f||K.greaterThanOrEquals(c,e);if(u&&d)return r=i,!f&&c.equals(e)&&++r,o=r+1,sfe(this,n,this._samples,e,r,o,t),t}let s=vr(n,e,K.compare,this._dateColumn);return s>=0?(s<n.length-1&&n[s+1].equals(e)&&++s,r=s,o=s):(o=~s,r=o-1,r<0&&(r=0)),this._lastIndex=r,sfe(this,n,this._samples,e,r,o,t),t};function Cze(e,t){return K.compare(e.julianDate,t)}function rfe(e,t){if(!l(t.columnNames))throw new oe("Error in loaded EOP data: The columnNames property is required.");if(!l(t.samples))throw new oe("Error in loaded EOP data: The samples property is required.");let n=t.columnNames.indexOf("modifiedJulianDateUtc"),i=t.columnNames.indexOf("xPoleWanderRadians"),r=t.columnNames.indexOf("yPoleWanderRadians"),o=t.columnNames.indexOf("ut1MinusUtcSeconds"),s=t.columnNames.indexOf("xCelestialPoleOffsetRadians"),a=t.columnNames.indexOf("yCelestialPoleOffsetRadians"),c=t.columnNames.indexOf("taiMinusUtcSeconds");if(n<0||i<0||r<0||o<0||s<0||a<0||c<0)throw new oe("Error in loaded EOP data: The columnNames property must include modifiedJulianDateUtc, xPoleWanderRadians, yPoleWanderRadians, ut1MinusUtcSeconds, xCelestialPoleOffsetRadians, yCelestialPoleOffsetRadians, and taiMinusUtcSeconds columns");let u=e._samples=t.samples,f=e._dates=[];e._dateColumn=n,e._xPoleWanderRadiansColumn=i,e._yPoleWanderRadiansColumn=r,e._ut1MinusUtcSecondsColumn=o,e._xCelestialPoleOffsetRadiansColumn=s,e._yCelestialPoleOffsetRadiansColumn=a,e._taiMinusUtcSecondsColumn=c,e._columnCount=t.columnNames.length,e._lastIndex=void 0;let d,p=e._addNewLeapSeconds;for(let g=0,m=u.length;g<m;g+=e._columnCount){let y=u[g+n],A=u[g+c],b=y+kn.MODIFIED_JULIAN_DATE_DIFFERENCE,x=new K(b,A,si.TAI);if(f.push(x),p){if(A!==d&&l(d)){let T=K.leapSeconds,E=vr(T,x,Cze);if(E<0){let v=new yr(x,A);T.splice(~E,0,v)}}d=A}}}function ofe(e,t,n,i,r){let o=n*i;r.xPoleWander=t[o+e._xPoleWanderRadiansColumn],r.yPoleWander=t[o+e._yPoleWanderRadiansColumn],r.xPoleOffset=t[o+e._xCelestialPoleOffsetRadiansColumn],r.yPoleOffset=t[o+e._yCelestialPoleOffsetRadiansColumn],r.ut1MinusUtc=t[o+e._ut1MinusUtcSecondsColumn]}function mD(e,t,n){return t+e*(n-t)}function sfe(e,t,n,i,r,o,s){let a=e._columnCount;if(o>t.length-1)return s.xPoleWander=0,s.yPoleWander=0,s.xPoleOffset=0,s.yPoleOffset=0,s.ut1MinusUtc=0,s;let c=t[r],u=t[o];if(c.equals(u)||i.equals(c))return ofe(e,n,r,a,s),s;if(i.equals(u))return ofe(e,n,o,a,s),s;let f=K.secondsDifference(i,c)/K.secondsDifference(u,c),d=r*a,p=o*a,g=n[d+e._ut1MinusUtcSecondsColumn],m=n[p+e._ut1MinusUtcSecondsColumn],y=m-g;if(y>.5||y<-.5){let A=n[d+e._taiMinusUtcSecondsColumn],b=n[p+e._taiMinusUtcSecondsColumn];A!==b&&(u.equals(i)?g=m:m-=b-A)}return s.xPoleWander=mD(f,n[d+e._xPoleWanderRadiansColumn],n[p+e._xPoleWanderRadiansColumn]),s.yPoleWander=mD(f,n[d+e._yPoleWanderRadiansColumn],n[p+e._yPoleWanderRadiansColumn]),s.xPoleOffset=mD(f,n[d+e._xCelestialPoleOffsetRadiansColumn],n[p+e._xCelestialPoleOffsetRadiansColumn]),s.yPoleOffset=mD(f,n[d+e._yCelestialPoleOffsetRadiansColumn],n[p+e._yCelestialPoleOffsetRadiansColumn]),s.ut1MinusUtc=mD(f,g,m),s}var gD=pD;function $c(e,t,n){this.heading=e??0,this.pitch=t??0,this.roll=n??0}$c.fromQuaternion=function(e,t){l(t)||(t=new $c);let n=2*(e.w*e.y-e.z*e.x),i=1-2*(e.x*e.x+e.y*e.y),r=2*(e.w*e.x+e.y*e.z),o=1-2*(e.y*e.y+e.z*e.z),s=2*(e.w*e.z+e.x*e.y);return t.heading=-Math.atan2(s,o),t.roll=Math.atan2(r,i),t.pitch=-D.asinClamped(n),t};$c.fromDegrees=function(e,t,n,i){return l(i)||(i=new $c),i.heading=e*D.RADIANS_PER_DEGREE,i.pitch=t*D.RADIANS_PER_DEGREE,i.roll=n*D.RADIANS_PER_DEGREE,i};$c.clone=function(e,t){if(l(e))return l(t)?(t.heading=e.heading,t.pitch=e.pitch,t.roll=e.roll,t):new $c(e.heading,e.pitch,e.roll)};$c.equals=function(e,t){return e===t||l(e)&&l(t)&&e.heading===t.heading&&e.pitch===t.pitch&&e.roll===t.roll};$c.equalsEpsilon=function(e,t,n,i){return e===t||l(e)&&l(t)&&D.equalsEpsilon(e.heading,t.heading,n,i)&&D.equalsEpsilon(e.pitch,t.pitch,n,i)&&D.equalsEpsilon(e.roll,t.roll,n,i)};$c.prototype.clone=function(e){return $c.clone(this,e)};$c.prototype.equals=function(e){return $c.equals(this,e)};$c.prototype.equalsEpsilon=function(e,t,n){return $c.equalsEpsilon(this,e,t,n)};$c.prototype.toString=function(){return`(${this.heading}, ${this.pitch}, ${this.roll})`};var wc=$c;var afe={},cfe=/((?:.*\/)|^)Cesium\.js(?:\?|\#|$)/;function vze(){let e=document.getElementsByTagName("script");for(let t=0,n=e.length;t<n;++t){let i=e[t].getAttribute("src"),r=cfe.exec(i);if(r!==null)return r[1]}}var Gj;function lfe(e){return typeof document>"u"?e:(l(Gj)||(Gj=document.createElement("a")),Gj.href=e,Gj.href)}var ax;function ufe(){if(l(ax))return ax;let e;return typeof CESIUM_BASE_URL<"u"?e=CESIUM_BASE_URL:l(afe?.url)?e=vd(".",afe.url):typeof define=="object"&&l(define.amd)&&!define.amd.toUrlUndefined&&l(require.toUrl)?e=vd("..",cx("Core/buildModuleUrl.js")):e=vze(),ax=new De({url:lfe(e)}),ax.appendForwardSlash(),ax}function Sze(e){return lfe(require.toUrl(`../${e}`))}function ffe(e){return ufe().getDerivedResource({url:e}).url}var Wj;function cx(e){return l(Wj)||(typeof define=="object"&&l(define.amd)&&!define.amd.toUrlUndefined&&l(require.toUrl)?Wj=Sze:Wj=ffe),Wj(e)}cx._cesiumScriptRegex=cfe;cx._buildModuleUrlFromBaseUrl=ffe;cx._clearBaseResource=function(){ax=void 0};cx.setBaseUrl=function(e){ax=De.DEFAULT.getDerivedResource({url:e})};cx.getCesiumBaseUrl=ufe;var Zt=cx;function wze(e,t,n){this.x=e,this.y=t,this.s=n}var lx=wze;function qj(e){e=e??H.EMPTY_OBJECT,this._xysFileUrlTemplate=De.createIfNeeded(e.xysFileUrlTemplate),this._interpolationOrder=e.interpolationOrder??9,this._sampleZeroJulianEphemerisDate=e.sampleZeroJulianEphemerisDate??24423965e-1,this._sampleZeroDateTT=new K(this._sampleZeroJulianEphemerisDate,0,si.TAI),this._stepSizeDays=e.stepSizeDays??1,this._samplesPerXysFile=e.samplesPerXysFile??1e3,this._totalSamples=e.totalSamples??27426,this._samples=new Array(this._totalSamples*3),this._chunkDownloadsInProgress=[];let t=this._interpolationOrder,n=this._denominators=new Array(t+1),i=this._xTable=new Array(t+1),r=Math.pow(this._stepSizeDays,t);for(let o=0;o<=t;++o){n[o]=r,i[o]=o*this._stepSizeDays;for(let s=0;s<=t;++s)s!==o&&(n[o]*=o-s);n[o]=1/n[o]}this._work=new Array(t+1),this._coef=new Array(t+1)}var Ize=new K(0,0,si.TAI);function oY(e,t,n){let i=Ize;return i.dayNumber=t,i.secondsOfDay=n,K.daysDifference(i,e._sampleZeroDateTT)}qj.prototype.preload=function(e,t,n,i){let r=oY(this,e,t),o=oY(this,n,i),s=r/this._stepSizeDays-this._interpolationOrder/2|0;s<0&&(s=0);let a=o/this._stepSizeDays-this._interpolationOrder/2|0+this._interpolationOrder;a>=this._totalSamples&&(a=this._totalSamples-1);let c=s/this._samplesPerXysFile|0,u=a/this._samplesPerXysFile|0,f=[];for(let d=c;d<=u;++d)f.push(sY(this,d));return Promise.all(f)};qj.prototype.computeXysRadians=function(e,t,n){let i=oY(this,e,t);if(i<0)return;let r=i/this._stepSizeDays|0;if(r>=this._totalSamples)return;let o=this._interpolationOrder,s=r-(o/2|0);s<0&&(s=0);let a=s+o;a>=this._totalSamples&&(a=this._totalSamples-1,s=a-o,s<0&&(s=0));let c=!1,u=this._samples;if(l(u[s*3])||(sY(this,s/this._samplesPerXysFile|0),c=!0),l(u[a*3])||(sY(this,a/this._samplesPerXysFile|0),c=!0),c)return;l(n)?(n.x=0,n.y=0,n.s=0):n=new lx(0,0,0);let f=i-s*this._stepSizeDays,d=this._work,p=this._denominators,g=this._coef,m=this._xTable,y,A;for(y=0;y<=o;++y)d[y]=f-m[y];for(y=0;y<=o;++y){for(g[y]=1,A=0;A<=o;++A)A!==y&&(g[y]*=d[A]);g[y]*=p[y];let b=(s+y)*3;n.x+=g[y]*u[b++],n.y+=g[y]*u[b++],n.s+=g[y]*u[b]}return n};qj.prototype._updateChunkData=function(e,{samples:t}){this._chunkDownloadsInProgress[e]=void 0;let n=this._samplesPerXysFile,i=e*n*3;for(let r=0;r<t.length;++r)this._samples[i+r]=t[r]};async function Pze(e,t,n){try{let i=await e.fetchJson();n._updateChunkData(t,i)}catch{}}function sY(e,t){if(l(e._chunkDownloadsInProgress[t]))return e._chunkDownloadsInProgress[t];let n,i=e._xysFileUrlTemplate;l(i)?n=i.getDerivedResource({templateValues:{0:t}}):n=new De({url:Zt(`Assets/IAU2006_XYS/IAU2006_XYS_${t}.json`)});let r=Pze(n,t,e);return e._chunkDownloadsInProgress[t]=r,r}var _D=qj;function dt(e,t,n,i){this.x=e??0,this.y=t??0,this.z=n??0,this.w=i??0}var yD=new h;dt.fromAxisAngle=function(e,t,n){let i=t/2,r=Math.sin(i);yD=h.normalize(e,yD);let o=yD.x*r,s=yD.y*r,a=yD.z*r,c=Math.cos(i);return l(n)?(n.x=o,n.y=s,n.z=a,n.w=c,n):new dt(o,s,a,c)};var Dze=[1,2,0],Rze=new Array(3);dt.fromRotationMatrix=function(e,t){let n,i,r,o,s,a=e[$.COLUMN0ROW0],c=e[$.COLUMN1ROW1],u=e[$.COLUMN2ROW2],f=a+c+u;if(f>0)n=Math.sqrt(f+1),s=.5*n,n=.5/n,i=(e[$.COLUMN1ROW2]-e[$.COLUMN2ROW1])*n,r=(e[$.COLUMN2ROW0]-e[$.COLUMN0ROW2])*n,o=(e[$.COLUMN0ROW1]-e[$.COLUMN1ROW0])*n;else{let d=Dze,p=0;c>a&&(p=1),u>a&&u>c&&(p=2);let g=d[p],m=d[g];n=Math.sqrt(e[$.getElementIndex(p,p)]-e[$.getElementIndex(g,g)]-e[$.getElementIndex(m,m)]+1);let y=Rze;y[p]=.5*n,n=.5/n,s=(e[$.getElementIndex(m,g)]-e[$.getElementIndex(g,m)])*n,y[g]=(e[$.getElementIndex(g,p)]+e[$.getElementIndex(p,g)])*n,y[m]=(e[$.getElementIndex(m,p)]+e[$.getElementIndex(p,m)])*n,i=-y[0],r=-y[1],o=-y[2]}return l(t)?(t.x=i,t.y=r,t.z=o,t.w=s,t):new dt(i,r,o,s)};var dfe=new dt,hfe=new dt,aY=new dt,mfe=new dt;dt.fromHeadingPitchRoll=function(e,t){return mfe=dt.fromAxisAngle(h.UNIT_X,e.roll,dfe),aY=dt.fromAxisAngle(h.UNIT_Y,-e.pitch,t),t=dt.multiply(aY,mfe,aY),hfe=dt.fromAxisAngle(h.UNIT_Z,-e.heading,dfe),dt.multiply(hfe,t,t)};var Yj=new h,cY=new h,zh=new dt,pfe=new dt,Xj=new dt;dt.packedLength=4;dt.pack=function(e,t,n){return n=n??0,t[n++]=e.x,t[n++]=e.y,t[n++]=e.z,t[n]=e.w,t};dt.unpack=function(e,t,n){return t=t??0,l(n)||(n=new dt),n.x=e[t],n.y=e[t+1],n.z=e[t+2],n.w=e[t+3],n};dt.packedInterpolationLength=3;dt.convertPackedArrayForInterpolation=function(e,t,n,i){dt.unpack(e,n*4,Xj),dt.conjugate(Xj,Xj);for(let r=0,o=n-t+1;r<o;r++){let s=r*3;dt.unpack(e,(t+r)*4,zh),dt.multiply(zh,Xj,zh),zh.w<0&&dt.negate(zh,zh),dt.computeAxis(zh,Yj);let a=dt.computeAngle(zh);l(i)||(i=[]),i[s]=Yj.x*a,i[s+1]=Yj.y*a,i[s+2]=Yj.z*a}};dt.unpackInterpolationResult=function(e,t,n,i,r){l(r)||(r=new dt),h.fromArray(e,0,cY);let o=h.magnitude(cY);return dt.unpack(t,i*4,pfe),o===0?dt.clone(dt.IDENTITY,zh):dt.fromAxisAngle(cY,o,zh),dt.multiply(zh,pfe,r)};dt.clone=function(e,t){if(l(e))return l(t)?(t.x=e.x,t.y=e.y,t.z=e.z,t.w=e.w,t):new dt(e.x,e.y,e.z,e.w)};dt.conjugate=function(e,t){return t.x=-e.x,t.y=-e.y,t.z=-e.z,t.w=e.w,t};dt.magnitudeSquared=function(e){return e.x*e.x+e.y*e.y+e.z*e.z+e.w*e.w};dt.magnitude=function(e){return Math.sqrt(dt.magnitudeSquared(e))};dt.normalize=function(e,t){let n=1/dt.magnitude(e),i=e.x*n,r=e.y*n,o=e.z*n,s=e.w*n;return t.x=i,t.y=r,t.z=o,t.w=s,t};dt.inverse=function(e,t){let n=dt.magnitudeSquared(e);return t=dt.conjugate(e,t),dt.multiplyByScalar(t,1/n,t)};dt.add=function(e,t,n){return n.x=e.x+t.x,n.y=e.y+t.y,n.z=e.z+t.z,n.w=e.w+t.w,n};dt.subtract=function(e,t,n){return n.x=e.x-t.x,n.y=e.y-t.y,n.z=e.z-t.z,n.w=e.w-t.w,n};dt.negate=function(e,t){return t.x=-e.x,t.y=-e.y,t.z=-e.z,t.w=-e.w,t};dt.dot=function(e,t){return e.x*t.x+e.y*t.y+e.z*t.z+e.w*t.w};dt.multiply=function(e,t,n){let i=e.x,r=e.y,o=e.z,s=e.w,a=t.x,c=t.y,u=t.z,f=t.w,d=s*a+i*f+r*u-o*c,p=s*c-i*u+r*f+o*a,g=s*u+i*c-r*a+o*f,m=s*f-i*a-r*c-o*u;return n.x=d,n.y=p,n.z=g,n.w=m,n};dt.multiplyByScalar=function(e,t,n){return n.x=e.x*t,n.y=e.y*t,n.z=e.z*t,n.w=e.w*t,n};dt.divideByScalar=function(e,t,n){return n.x=e.x/t,n.y=e.y/t,n.z=e.z/t,n.w=e.w/t,n};dt.computeAxis=function(e,t){let n=e.w;if(Math.abs(n-1)<D.EPSILON6||Math.abs(n+1)<D.EPSILON6)return t.x=1,t.y=t.z=0,t;let i=1/Math.sqrt(1-n*n);return t.x=e.x*i,t.y=e.y*i,t.z=e.z*i,t};dt.computeAngle=function(e){return Math.abs(e.w-1)<D.EPSILON6?0:2*Math.acos(e.w)};var lY=new dt;dt.lerp=function(e,t,n,i){return lY=dt.multiplyByScalar(t,n,lY),i=dt.multiplyByScalar(e,1-n,i),dt.add(lY,i,i)};var gfe=new dt,uY=new dt,fY=new dt;dt.slerp=function(e,t,n,i){let r=dt.dot(e,t),o=t;if(r<0&&(r=-r,o=gfe=dt.negate(t,gfe)),1-r<D.EPSILON6)return dt.lerp(e,o,n,i);let s=Math.acos(r);return uY=dt.multiplyByScalar(e,Math.sin((1-n)*s),uY),fY=dt.multiplyByScalar(o,Math.sin(n*s),fY),i=dt.add(uY,fY,i),dt.multiplyByScalar(i,1/Math.sin(s),i)};dt.log=function(e,t){let n=D.acosClamped(e.w),i=0;return n!==0&&(i=n/Math.sin(n)),h.multiplyByScalar(e,i,t)};dt.exp=function(e,t){let n=h.magnitude(e),i=0;return n!==0&&(i=Math.sin(n)/n),t.x=e.x*i,t.y=e.y*i,t.z=e.z*i,t.w=Math.cos(n),t};var Oze=new h,Mze=new h,AD=new dt,mv=new dt;dt.computeInnerQuadrangle=function(e,t,n,i){let r=dt.conjugate(t,AD);dt.multiply(r,n,mv);let o=dt.log(mv,Oze);dt.multiply(r,e,mv);let s=dt.log(mv,Mze);return h.add(o,s,o),h.multiplyByScalar(o,.25,o),h.negate(o,o),dt.exp(o,AD),dt.multiply(t,AD,i)};dt.squad=function(e,t,n,i,r,o){let s=dt.slerp(e,t,r,AD),a=dt.slerp(n,i,r,mv);return dt.slerp(s,a,2*r*(1-r),o)};var Nze=new dt,_fe=1.9011074535173003,Kj=dn.supportsTypedArrays()?new Float32Array(8):[],$j=dn.supportsTypedArrays()?new Float32Array(8):[],sg=dn.supportsTypedArrays()?new Float32Array(8):[],ag=dn.supportsTypedArrays()?new Float32Array(8):[];for(let e=0;e<7;++e){let t=e+1,n=2*t+1;Kj[e]=1/(t*n),$j[e]=t/n}Kj[7]=_fe/136;$j[7]=_fe*8/17;dt.fastSlerp=function(e,t,n,i){let r=dt.dot(e,t),o;r>=0?o=1:(o=-1,r=-r);let s=r-1,a=1-n,c=n*n,u=a*a;for(let g=7;g>=0;--g)sg[g]=(Kj[g]*c-$j[g])*s,ag[g]=(Kj[g]*u-$j[g])*s;let f=o*n*(1+sg[0]*(1+sg[1]*(1+sg[2]*(1+sg[3]*(1+sg[4]*(1+sg[5]*(1+sg[6]*(1+sg[7])))))))),d=a*(1+ag[0]*(1+ag[1]*(1+ag[2]*(1+ag[3]*(1+ag[4]*(1+ag[5]*(1+ag[6]*(1+ag[7])))))))),p=dt.multiplyByScalar(e,d,Nze);return dt.multiplyByScalar(t,f,i),dt.add(p,i,i)};dt.fastSquad=function(e,t,n,i,r,o){let s=dt.fastSlerp(e,t,r,AD),a=dt.fastSlerp(n,i,r,mv);return dt.fastSlerp(s,a,2*r*(1-r),o)};dt.equals=function(e,t){return e===t||l(e)&&l(t)&&e.x===t.x&&e.y===t.y&&e.z===t.z&&e.w===t.w};dt.equalsEpsilon=function(e,t,n){return n=n??0,e===t||l(e)&&l(t)&&Math.abs(e.x-t.x)<=n&&Math.abs(e.y-t.y)<=n&&Math.abs(e.z-t.z)<=n&&Math.abs(e.w-t.w)<=n};dt.ZERO=Object.freeze(new dt(0,0,0,0));dt.IDENTITY=Object.freeze(new dt(0,0,0,1));dt.prototype.clone=function(e){return dt.clone(this,e)};dt.prototype.equals=function(e){return dt.equals(this,e)};dt.prototype.equalsEpsilon=function(e,t){return dt.equalsEpsilon(this,e,t)};dt.prototype.toString=function(){return`(${this.x}, ${this.y}, ${this.z}, ${this.w})`};var Le=dt;var Ei={},dY={up:{south:"east",north:"west",west:"south",east:"north"},down:{south:"west",north:"east",west:"north",east:"south"},south:{up:"west",down:"east",west:"down",east:"up"},north:{up:"east",down:"west",west:"up",east:"down"},west:{up:"north",down:"south",north:"down",south:"up"},east:{up:"south",down:"north",north:"up",south:"down"}},pv={north:[-1,0,0],east:[0,1,0],up:[0,0,1],south:[1,0,0],west:[0,-1,0],down:[0,0,-1]},hY={},Du={east:new h,north:new h,up:new h,west:new h,south:new h,down:new h},Ry=new h,Oy=new h,My=new h;Ei.localFrameToFixedFrameGenerator=function(e,t){if(!dY.hasOwnProperty(e)||!dY[e].hasOwnProperty(t))throw new pe("firstAxis and secondAxis must be east, north, up, west, south or down.");let n=dY[e][t],i,r=e+t;return l(hY[r])?i=hY[r]:(i=function(o,s,a){if(l(a)||(a=new N),h.equalsEpsilon(o,h.ZERO,D.EPSILON14))h.unpack(pv[e],0,Ry),h.unpack(pv[t],0,Oy),h.unpack(pv[n],0,My);else if(D.equalsEpsilon(o.x,0,D.EPSILON14)&&D.equalsEpsilon(o.y,0,D.EPSILON14)){let c=D.sign(o.z);h.unpack(pv[e],0,Ry),e!=="east"&&e!=="west"&&h.multiplyByScalar(Ry,c,Ry),h.unpack(pv[t],0,Oy),t!=="east"&&t!=="west"&&h.multiplyByScalar(Oy,c,Oy),h.unpack(pv[n],0,My),n!=="east"&&n!=="west"&&h.multiplyByScalar(My,c,My)}else{s=s??ee.default,s.geodeticSurfaceNormal(o,Du.up);let c=Du.up,u=Du.east;u.x=-o.y,u.y=o.x,u.z=0,h.normalize(u,Du.east),h.cross(c,u,Du.north),h.multiplyByScalar(Du.up,-1,Du.down),h.multiplyByScalar(Du.east,-1,Du.west),h.multiplyByScalar(Du.north,-1,Du.south),Ry=Du[e],Oy=Du[t],My=Du[n]}return a[0]=Ry.x,a[1]=Ry.y,a[2]=Ry.z,a[3]=0,a[4]=Oy.x,a[5]=Oy.y,a[6]=Oy.z,a[7]=0,a[8]=My.x,a[9]=My.y,a[10]=My.z,a[11]=0,a[12]=o.x,a[13]=o.y,a[14]=o.z,a[15]=1,a},hY[r]=i),i};Ei.eastNorthUpToFixedFrame=Ei.localFrameToFixedFrameGenerator("east","north");Ei.northEastDownToFixedFrame=Ei.localFrameToFixedFrameGenerator("north","east");Ei.northUpEastToFixedFrame=Ei.localFrameToFixedFrameGenerator("north","up");Ei.northWestUpToFixedFrame=Ei.localFrameToFixedFrameGenerator("north","west");var Lze=new Le,Fze=new h(1,1,1),Bze=new N;Ei.headingPitchRollToFixedFrame=function(e,t,n,i,r){i=i??Ei.eastNorthUpToFixedFrame;let o=Le.fromHeadingPitchRoll(t,Lze),s=N.fromTranslationQuaternionRotationScale(h.ZERO,o,Fze,Bze);return r=i(e,n,r),N.multiply(r,s,r)};var kze=new N,Uze=new $;Ei.headingPitchRollQuaternion=function(e,t,n,i,r){let o=Ei.headingPitchRollToFixedFrame(e,t,n,i,kze),s=N.getMatrix3(o,Uze);return Le.fromRotationMatrix(s,r)};var zze=new h(1,1,1),Vze=new h,yfe=new N,jze=new N,Hze=new $,Gze=new Le;Ei.fixedFrameToHeadingPitchRoll=function(e,t,n,i){t=t??ee.default,n=n??Ei.eastNorthUpToFixedFrame,l(i)||(i=new wc);let r=N.getTranslation(e,Vze);if(h.equals(r,h.ZERO))return i.heading=0,i.pitch=0,i.roll=0,i;let o=N.inverseTransformation(n(r,t,yfe),yfe),s=N.setScale(e,zze,jze);s=N.setTranslation(s,h.ZERO,s),o=N.multiply(o,s,o);let a=Le.fromRotationMatrix(N.getMatrix3(o,Hze),Gze);return a=Le.normalize(a,a),wc.fromQuaternion(a,i)};var Wze=6*3600+2460+50.54841,qze=8640184812866e-6,Yze=.093104,Xze=-62e-7,Kze=11772758384668e-32,$ze=72921158553e-15,Jze=D.TWO_PI/86400,Jj=new K;Ei.computeIcrfToCentralBodyFixedMatrix=function(e,t){let n=Ei.computeIcrfToFixedMatrix(e,t);return l(n)||(n=Ei.computeTemeToPseudoFixedMatrix(e,t)),n};Ei.computeTemeToPseudoFixedMatrix=function(e,t){Jj=K.addSeconds(e,-K.computeTaiMinusUtc(e),Jj);let n=Jj.dayNumber,i=Jj.secondsOfDay,r,o=n-2451545;i>=43200?r=(o+.5)/kn.DAYS_PER_JULIAN_CENTURY:r=(o-.5)/kn.DAYS_PER_JULIAN_CENTURY;let a=(Wze+r*(qze+r*(Yze+r*Xze)))*Jze%D.TWO_PI,c=$ze+Kze*(n-24515455e-1),u=(i+kn.SECONDS_PER_DAY*.5)%kn.SECONDS_PER_DAY,f=a+c*u,d=Math.cos(f),p=Math.sin(f);return l(t)?(t[0]=d,t[1]=-p,t[2]=0,t[3]=p,t[4]=d,t[5]=0,t[6]=0,t[7]=0,t[8]=1,t):new $(d,p,0,-p,d,0,0,0,1)};Ei.iau2006XysData=new _D;Ei.earthOrientationParameters=gD.NONE;var gY=32.184,Zze=2451545;Ei.preloadIcrfFixed=function(e){let t=e.start.dayNumber,n=e.start.secondsOfDay+gY,i=e.stop.dayNumber,r=e.stop.secondsOfDay+gY;return Ei.iau2006XysData.preload(t,n,i,r)};Ei.computeIcrfToFixedMatrix=function(e,t){l(t)||(t=new $);let n=Ei.computeFixedToIcrfMatrix(e,t);if(l(n))return $.transpose(n,t)};var Qze=32.184,eVe=2451545,Zj=new wc,tVe=new $,nVe=new K;Ei.computeMoonFixedToIcrfMatrix=function(e,t){l(t)||(t=new $);let n=K.addSeconds(e,Qze,nVe),i=K.totalDays(n)-eVe,r=D.toRadians(12.112)-D.toRadians(.052992)*i,o=D.toRadians(24.224)-D.toRadians(.105984)*i,s=D.toRadians(227.645)+D.toRadians(13.012)*i,a=D.toRadians(261.105)+D.toRadians(13.340716)*i,c=D.toRadians(358)+D.toRadians(.9856)*i;return Zj.pitch=D.toRadians(180)-D.toRadians(3.878)*Math.sin(r)-D.toRadians(.12)*Math.sin(o)+D.toRadians(.07)*Math.sin(s)-D.toRadians(.017)*Math.sin(a),Zj.roll=D.toRadians(66.53-90)+D.toRadians(1.543)*Math.cos(r)+D.toRadians(.24)*Math.cos(o)-D.toRadians(.028)*Math.cos(s)+D.toRadians(.007)*Math.cos(a),Zj.heading=D.toRadians(244.375-90)+D.toRadians(13.17635831)*i+D.toRadians(3.558)*Math.sin(r)+D.toRadians(.121)*Math.sin(o)-D.toRadians(.064)*Math.sin(s)+D.toRadians(.016)*Math.sin(a)+D.toRadians(.025)*Math.sin(c),$.fromHeadingPitchRoll(Zj,tVe,t)};Ei.computeIcrfToMoonFixedMatrix=function(e,t){l(t)||(t=new $);let n=Ei.computeMoonFixedToIcrfMatrix(e,t);if(l(n))return $.transpose(n,t)};var iVe=new lx(0,0,0),rVe=new wy(0,0,0,0,0,0),mY=new $,pY=new $;Ei.computeFixedToIcrfMatrix=function(e,t){l(t)||(t=new $);let n=Ei.earthOrientationParameters.compute(e,rVe);if(!l(n))return;let i=e.dayNumber,r=e.secondsOfDay+gY,o=Ei.iau2006XysData.computeXysRadians(i,r,iVe);if(!l(o))return;let s=o.x+n.xPoleOffset,a=o.y+n.yPoleOffset,c=1/(1+Math.sqrt(1-s*s-a*a)),u=mY;u[0]=1-c*s*s,u[3]=-c*s*a,u[6]=s,u[1]=-c*s*a,u[4]=1-c*a*a,u[7]=a,u[2]=-s,u[5]=-a,u[8]=1-c*(s*s+a*a);let f=$.fromRotationZ(-o.s,pY),d=$.multiply(u,f,mY),p=e.dayNumber,g=e.secondsOfDay-K.computeTaiMinusUtc(e)+n.ut1MinusUtc,m=p-2451545,y=g/kn.SECONDS_PER_DAY,A=.779057273264+y+.00273781191135448*(m+y);A=A%1*D.TWO_PI;let b=$.fromRotationZ(A,pY),x=$.multiply(d,b,mY),T=Math.cos(n.xPoleWander),E=Math.cos(n.yPoleWander),v=Math.sin(n.xPoleWander),S=Math.sin(n.yPoleWander),I=i-Zze+r/kn.SECONDS_PER_DAY;I/=36525;let R=-47e-6*I*D.RADIANS_PER_DEGREE/3600,O=Math.cos(R),L=Math.sin(R),_=pY;return _[0]=T*O,_[1]=T*L,_[2]=v,_[3]=-E*L+S*v*O,_[4]=E*O+S*v*L,_[5]=-S*T,_[6]=-S*L-E*v*O,_[7]=S*O-E*v*L,_[8]=E*T,$.multiply(x,_,t)};var oVe=new se;Ei.pointToWindowCoordinates=function(e,t,n,i){return i=Ei.pointToGLWindowCoordinates(e,t,n,i),i.y=2*t[5]-i.y,i};Ei.pointToGLWindowCoordinates=function(e,t,n,i){l(i)||(i=new U);let r=oVe;return N.multiplyByVector(e,se.fromElements(n.x,n.y,n.z,1,r),r),se.multiplyByScalar(r,1/r.w,r),N.multiplyByVector(t,r,r),U.fromCartesian4(r,i)};var sVe=new h,aVe=new h,cVe=new h;Ei.rotationMatrixFromPositionVelocity=function(e,t,n,i){let r=(n??ee.default).geodeticSurfaceNormal(e,sVe),o=h.cross(t,r,aVe);h.equalsEpsilon(o,h.ZERO,D.EPSILON6)&&(o=h.clone(h.UNIT_X,o));let s=h.cross(o,t,cVe);return h.normalize(s,s),h.cross(t,s,o),h.negate(o,o),h.normalize(o,o),l(i)||(i=new $),i[0]=t.x,i[1]=t.y,i[2]=t.z,i[3]=o.x,i[4]=o.y,i[5]=o.z,i[6]=s.x,i[7]=s.y,i[8]=s.z,i};Ei.SWIZZLE_3D_TO_2D_MATRIX=Object.freeze(new N(0,0,1,0,1,0,0,0,0,1,0,0,0,0,0,1));var Afe=new he,_Y=new h,lVe=new h,uVe=new $,yY=new N,bfe=new N;Ei.basisTo2D=function(e,t,n){let i=N.getTranslation(t,lVe),r=e.ellipsoid,o;if(h.equals(i,h.ZERO))o=h.clone(h.ZERO,_Y);else{let f=r.cartesianToCartographic(i,Afe);o=e.project(f,_Y),h.fromElements(o.z,o.x,o.y,o)}let s=Ei.eastNorthUpToFixedFrame(i,r,yY),a=N.inverseTransformation(s,bfe),c=N.getMatrix3(t,uVe),u=N.multiplyByMatrix3(a,c,n);return N.multiply(Ei.SWIZZLE_3D_TO_2D_MATRIX,u,n),N.setTranslation(n,o,n),n};Ei.ellipsoidTo2DModelMatrix=function(e,t,n){let i=e.ellipsoid,r=Ei.eastNorthUpToFixedFrame(t,i,yY),o=N.inverseTransformation(r,bfe),s=i.cartesianToCartographic(t,Afe),a=e.project(s,_Y);h.fromElements(a.z,a.x,a.y,a);let c=N.fromTranslation(a,yY);return N.multiply(Ei.SWIZZLE_3D_TO_2D_MATRIX,o,n),N.multiply(c,n,n),n};var At=Ei;var gv=class e{constructor(t,n,i,r){this.west=t??0,this.south=n??0,this.east=i??0,this.north=r??0}get width(){return e.computeWidth(this)}get height(){return e.computeHeight(this)}static pack(t,n,i){return i=i??0,n[i++]=t.west,n[i++]=t.south,n[i++]=t.east,n[i]=t.north,n}static unpack(t,n,i){return n=n??0,l(i)||(i=new e),i.west=t[n++],i.south=t[n++],i.east=t[n++],i.north=t[n],i}static computeWidth(t){let n=t.east,i=t.west;return n<i&&(n+=D.TWO_PI),n-i}static computeHeight(t){return t.north-t.south}static fromDegrees(t,n,i,r,o){return t=D.toRadians(t??0),n=D.toRadians(n??0),i=D.toRadians(i??0),r=D.toRadians(r??0),l(o)?(o.west=t,o.south=n,o.east=i,o.north=r,o):new e(t,n,i,r)}static fromRadians(t,n,i,r,o){return l(o)?(o.west=t??0,o.south=n??0,o.east=i??0,o.north=r??0,o):new e(t,n,i,r)}static fromCartographicArray(t,n){let i=Number.MAX_VALUE,r=-Number.MAX_VALUE,o=Number.MAX_VALUE,s=-Number.MAX_VALUE,a=Number.MAX_VALUE,c=-Number.MAX_VALUE;for(let u=0,f=t.length;u<f;u++){let d=t[u];i=Math.min(i,d.longitude),r=Math.max(r,d.longitude),a=Math.min(a,d.latitude),c=Math.max(c,d.latitude);let p=d.longitude>=0?d.longitude:d.longitude+D.TWO_PI;o=Math.min(o,p),s=Math.max(s,p)}return r-i>s-o&&(i=o,r=s,r>D.PI&&(r=r-D.TWO_PI),i>D.PI&&(i=i-D.TWO_PI)),l(n)?(n.west=i,n.south=a,n.east=r,n.north=c,n):new e(i,a,r,c)}static fromCartesianArray(t,n,i){n=n??ee.default;let r=Number.MAX_VALUE,o=-Number.MAX_VALUE,s=Number.MAX_VALUE,a=-Number.MAX_VALUE,c=Number.MAX_VALUE,u=-Number.MAX_VALUE;for(let f=0,d=t.length;f<d;f++){let p=n.cartesianToCartographic(t[f]);r=Math.min(r,p.longitude),o=Math.max(o,p.longitude),c=Math.min(c,p.latitude),u=Math.max(u,p.latitude);let g=p.longitude>=0?p.longitude:p.longitude+D.TWO_PI;s=Math.min(s,g),a=Math.max(a,g)}return o-r>a-s&&(r=s,o=a,o>D.PI&&(o=o-D.TWO_PI),r>D.PI&&(r=r-D.TWO_PI)),l(i)?(i.west=r,i.south=c,i.east=o,i.north=u,i):new e(r,c,o,u)}static fromBoundingSphere(t,n,i){let r=t.center,o=t.radius;if(l(n)||(n=ee.default),l(i)||(i=new e),h.equals(r,h.ZERO))return e.clone(e.MAX_VALUE,i),i;let s=At.eastNorthUpToFixedFrame(r,n,fVe),a=N.multiplyByPointAsVector(s,h.UNIT_X,dVe);h.normalize(a,a);let c=N.multiplyByPointAsVector(s,h.UNIT_Y,hVe);h.normalize(c,c),h.multiplyByScalar(c,o,c),h.multiplyByScalar(a,o,a);let u=h.negate(c,pVe),f=h.negate(a,mVe),d=AY,p=d[0];return h.add(r,c,p),p=d[1],h.add(r,f,p),p=d[2],h.add(r,u,p),p=d[3],h.add(r,a,p),d[4]=r,e.fromCartesianArray(d,n,i)}static clone(t,n){if(l(t))return l(n)?(n.west=t.west,n.south=t.south,n.east=t.east,n.north=t.north,n):new e(t.west,t.south,t.east,t.north)}static equalsEpsilon(t,n,i){return i=i??0,t===n||l(t)&&l(n)&&Math.abs(t.west-n.west)<=i&&Math.abs(t.south-n.south)<=i&&Math.abs(t.east-n.east)<=i&&Math.abs(t.north-n.north)<=i}clone(t){return e.clone(this,t)}equals(t){return e.equals(this,t)}static equals(t,n){return t===n||l(t)&&l(n)&&t.west===n.west&&t.south===n.south&&t.east===n.east&&t.north===n.north}equalsEpsilon(t,n){return e.equalsEpsilon(this,t,n)}static _validate(t){}static southwest(t,n){return l(n)?(n.longitude=t.west,n.latitude=t.south,n.height=0,n):new he(t.west,t.south)}static northwest(t,n){return l(n)?(n.longitude=t.west,n.latitude=t.north,n.height=0,n):new he(t.west,t.north)}static northeast(t,n){return l(n)?(n.longitude=t.east,n.latitude=t.north,n.height=0,n):new he(t.east,t.north)}static southeast(t,n){return l(n)?(n.longitude=t.east,n.latitude=t.south,n.height=0,n):new he(t.east,t.south)}static center(t,n){let i=t.east,r=t.west;i<r&&(i+=D.TWO_PI);let o=D.negativePiToPi((r+i)*.5),s=(t.south+t.north)*.5;return l(n)?(n.longitude=o,n.latitude=s,n.height=0,n):new he(o,s)}static intersection(t,n,i){let r=t.east,o=t.west,s=n.east,a=n.west;r<o&&s>0?r+=D.TWO_PI:s<a&&r>0&&(s+=D.TWO_PI),r<o&&a<0?a+=D.TWO_PI:s<a&&o<0&&(o+=D.TWO_PI);let c=D.negativePiToPi(Math.max(o,a)),u=D.negativePiToPi(Math.min(r,s));if(c===D.PI&&u<D.PI&&(c=-D.PI),(t.west<t.east||n.west<n.east)&&u<=c)return;let f=Math.max(t.south,n.south),d=Math.min(t.north,n.north);if(!(f>=d))return l(i)?(i.west=c,i.south=f,i.east=u,i.north=d,i):new e(c,f,u,d)}static simpleIntersection(t,n,i){let r=Math.max(t.west,n.west),o=Math.max(t.south,n.south),s=Math.min(t.east,n.east),a=Math.min(t.north,n.north);if(!(o>=a||r>=s))return l(i)?(i.west=r,i.south=o,i.east=s,i.north=a,i):new e(r,o,s,a)}static union(t,n,i){l(i)||(i=new e);let r=t.east,o=t.west,s=n.east,a=n.west;r<o&&s>0?r+=D.TWO_PI:s<a&&r>0&&(s+=D.TWO_PI),r<o&&a<0?a+=D.TWO_PI:s<a&&o<0&&(o+=D.TWO_PI);let c=D.negativePiToPi(Math.min(o,a)),u=D.negativePiToPi(Math.max(r,s));return i.west=c,i.south=Math.min(t.south,n.south),i.east=u,i.north=Math.max(t.north,n.north),i}static expand(t,n,i){return l(i)||(i=new e),i.west=Math.min(t.west,n.longitude),i.south=Math.min(t.south,n.latitude),i.east=Math.max(t.east,n.longitude),i.north=Math.max(t.north,n.latitude),i}static contains(t,n){let i=n.longitude,r=n.latitude,o=t.west,s=t.east;return s<o&&(s+=D.TWO_PI,i<0&&(i+=D.TWO_PI)),(i>o||D.equalsEpsilon(i,o,D.EPSILON14))&&(i<s||D.equalsEpsilon(i,s,D.EPSILON14))&&r>=t.south&&r<=t.north}static subsample(t,n,i,r){n=n??ee.default,i=i??0,l(r)||(r=[]);let o=0,s=t.north,a=t.south,c=t.east,u=t.west,f=gVe;f.height=i,f.longitude=u,f.latitude=s,r[o]=n.cartographicToCartesian(f,r[o]),o++,f.longitude=c,r[o]=n.cartographicToCartesian(f,r[o]),o++,f.latitude=a,r[o]=n.cartographicToCartesian(f,r[o]),o++,f.longitude=u,r[o]=n.cartographicToCartesian(f,r[o]),o++,s<0?f.latitude=s:a>0?f.latitude=a:f.latitude=0;for(let d=1;d<8;++d)f.longitude=-Math.PI+d*D.PI_OVER_TWO,e.contains(t,f)&&(r[o]=n.cartographicToCartesian(f,r[o]),o++);return f.latitude===0&&(f.longitude=u,r[o]=n.cartographicToCartesian(f,r[o]),o++,f.longitude=c,r[o]=n.cartographicToCartesian(f,r[o]),o++),r.length=o,r}static subsection(t,n,i,r,o,s){if(l(s)||(s=new e),t.west<=t.east){let c=t.east-t.west;s.west=t.west+n*c,s.east=t.west+r*c}else{let c=D.TWO_PI+t.east-t.west;s.west=D.negativePiToPi(t.west+n*c),s.east=D.negativePiToPi(t.west+r*c)}let a=t.north-t.south;return s.south=t.south+i*a,s.north=t.south+o*a,n===1&&(s.west=t.east),r===1&&(s.east=t.east),i===1&&(s.south=t.north),o===1&&(s.north=t.north),s}};gv.packedLength=4;var fVe=new N,dVe=new h,hVe=new h,mVe=new h,pVe=new h,AY=new Array(5);for(let e=0;e<AY.length;++e)AY[e]=new h;var gVe=new he;gv.MAX_VALUE=Object.freeze(new gv(-Math.PI,-D.PI_OVER_TWO,Math.PI,D.PI_OVER_TWO));var ie=gv;function gs(e,t,n,i){this.x=e??0,this.y=t??0,this.width=n??0,this.height=i??0}gs.packedLength=4;gs.pack=function(e,t,n){return n=n??0,t[n++]=e.x,t[n++]=e.y,t[n++]=e.width,t[n]=e.height,t};gs.unpack=function(e,t,n){return t=t??0,l(n)||(n=new gs),n.x=e[t++],n.y=e[t++],n.width=e[t++],n.height=e[t],n};gs.fromPoints=function(e,t){if(l(t)||(t=new gs),!l(e)||e.length===0)return t.x=0,t.y=0,t.width=0,t.height=0,t;let n=e.length,i=e[0].x,r=e[0].y,o=e[0].x,s=e[0].y;for(let a=1;a<n;a++){let c=e[a],u=c.x,f=c.y;i=Math.min(u,i),o=Math.max(u,o),r=Math.min(f,r),s=Math.max(f,s)}return t.x=i,t.y=r,t.width=o-i,t.height=s-r,t};var xfe=new Ui,_Ve=new he,yVe=new he;gs.fromRectangle=function(e,t,n){if(l(n)||(n=new gs),!l(e))return n.x=0,n.y=0,n.width=0,n.height=0,n;xfe._ellipsoid=ee.default,t=t??xfe;let i=t.project(ie.southwest(e,_Ve)),r=t.project(ie.northeast(e,yVe));return U.subtract(r,i,r),n.x=i.x,n.y=i.y,n.width=r.x,n.height=r.y,n};gs.clone=function(e,t){if(l(e))return l(t)?(t.x=e.x,t.y=e.y,t.width=e.width,t.height=e.height,t):new gs(e.x,e.y,e.width,e.height)};gs.union=function(e,t,n){l(n)||(n=new gs);let i=Math.min(e.x,t.x),r=Math.min(e.y,t.y),o=Math.max(e.x+e.width,t.x+t.width),s=Math.max(e.y+e.height,t.y+t.height);return n.x=i,n.y=r,n.width=o-i,n.height=s-r,n};gs.expand=function(e,t,n){n=gs.clone(e,n);let i=t.x-n.x,r=t.y-n.y;return i>n.width?n.width=i:i<0&&(n.width-=i,n.x=t.x),r>n.height?n.height=r:r<0&&(n.height-=r,n.y=t.y),n};gs.intersect=function(e,t){let n=e.x,i=e.y,r=t.x,o=t.y;return n>r+t.width||n+e.width<r||i+e.height<o||i>o+t.height?$t.OUTSIDE:$t.INTERSECTING};gs.equals=function(e,t){return e===t||l(e)&&l(t)&&e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height};gs.prototype.clone=function(e){return gs.clone(this,e)};gs.prototype.intersect=function(e){return gs.intersect(this,e)};gs.prototype.equals=function(e){return gs.equals(this,e)};var et=gs;var ic={POINTS:te.POINTS,LINES:te.LINES,LINE_LOOP:te.LINE_LOOP,LINE_STRIP:te.LINE_STRIP,TRIANGLES:te.TRIANGLES,TRIANGLE_STRIP:te.TRIANGLE_STRIP,TRIANGLE_FAN:te.TRIANGLE_FAN};ic.isLines=function(e){return e===ic.LINES||e===ic.LINE_LOOP||e===ic.LINE_STRIP};ic.isTriangles=function(e){return e===ic.TRIANGLES||e===ic.TRIANGLE_STRIP||e===ic.TRIANGLE_FAN};ic.validate=function(e){return e===ic.POINTS||e===ic.LINES||e===ic.LINE_LOOP||e===ic.LINE_STRIP||e===ic.TRIANGLES||e===ic.TRIANGLE_STRIP||e===ic.TRIANGLE_FAN};Object.freeze(ic);var Oe=ic;var ux=`in vec4 position; +(${this[3]}, ${this[7]}, ${this[11]}, ${this[15]})`}};go.packedLength=16;go.fromArray=go.unpack;go.IDENTITY=new go(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1);go.ZERO=new go(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0);go.COLUMN0ROW0=0;go.COLUMN0ROW1=1;go.COLUMN0ROW2=2;go.COLUMN0ROW3=3;go.COLUMN1ROW0=4;go.COLUMN1ROW1=5;go.COLUMN1ROW2=6;go.COLUMN1ROW3=7;go.COLUMN2ROW0=8;go.COLUMN2ROW1=9;go.COLUMN2ROW2=10;go.COLUMN2ROW3=11;go.COLUMN3ROW0=12;go.COLUMN3ROW1=13;go.COLUMN3ROW2=14;go.COLUMN3ROW3=15;var rv=new h,ov=new h,oD=new h,X3e=new h,K3e=new h,zq=new h,lue=new h,$3e=new h,J3e=new h,Z3e=new $,Q3e=new $,eUe=new se,tUe=new se(0,0,0,1),nUe=new go,N=go;var uue={DEPTH_BUFFER_BIT:256,STENCIL_BUFFER_BIT:1024,COLOR_BUFFER_BIT:16384,POINTS:0,LINES:1,LINE_LOOP:2,LINE_STRIP:3,TRIANGLES:4,TRIANGLE_STRIP:5,TRIANGLE_FAN:6,ZERO:0,ONE:1,SRC_COLOR:768,ONE_MINUS_SRC_COLOR:769,SRC_ALPHA:770,ONE_MINUS_SRC_ALPHA:771,DST_ALPHA:772,ONE_MINUS_DST_ALPHA:773,DST_COLOR:774,ONE_MINUS_DST_COLOR:775,SRC_ALPHA_SATURATE:776,FUNC_ADD:32774,BLEND_EQUATION:32777,BLEND_EQUATION_RGB:32777,BLEND_EQUATION_ALPHA:34877,FUNC_SUBTRACT:32778,FUNC_REVERSE_SUBTRACT:32779,BLEND_DST_RGB:32968,BLEND_SRC_RGB:32969,BLEND_DST_ALPHA:32970,BLEND_SRC_ALPHA:32971,CONSTANT_COLOR:32769,ONE_MINUS_CONSTANT_COLOR:32770,CONSTANT_ALPHA:32771,ONE_MINUS_CONSTANT_ALPHA:32772,BLEND_COLOR:32773,ARRAY_BUFFER:34962,ELEMENT_ARRAY_BUFFER:34963,ARRAY_BUFFER_BINDING:34964,ELEMENT_ARRAY_BUFFER_BINDING:34965,STREAM_DRAW:35040,STATIC_DRAW:35044,DYNAMIC_DRAW:35048,BUFFER_SIZE:34660,BUFFER_USAGE:34661,CURRENT_VERTEX_ATTRIB:34342,FRONT:1028,BACK:1029,FRONT_AND_BACK:1032,CULL_FACE:2884,BLEND:3042,DITHER:3024,STENCIL_TEST:2960,DEPTH_TEST:2929,SCISSOR_TEST:3089,POLYGON_OFFSET_FILL:32823,SAMPLE_ALPHA_TO_COVERAGE:32926,SAMPLE_COVERAGE:32928,NO_ERROR:0,INVALID_ENUM:1280,INVALID_VALUE:1281,INVALID_OPERATION:1282,OUT_OF_MEMORY:1285,CW:2304,CCW:2305,LINE_WIDTH:2849,ALIASED_POINT_SIZE_RANGE:33901,ALIASED_LINE_WIDTH_RANGE:33902,CULL_FACE_MODE:2885,FRONT_FACE:2886,DEPTH_RANGE:2928,DEPTH_WRITEMASK:2930,DEPTH_CLEAR_VALUE:2931,DEPTH_FUNC:2932,STENCIL_CLEAR_VALUE:2961,STENCIL_FUNC:2962,STENCIL_FAIL:2964,STENCIL_PASS_DEPTH_FAIL:2965,STENCIL_PASS_DEPTH_PASS:2966,STENCIL_REF:2967,STENCIL_VALUE_MASK:2963,STENCIL_WRITEMASK:2968,STENCIL_BACK_FUNC:34816,STENCIL_BACK_FAIL:34817,STENCIL_BACK_PASS_DEPTH_FAIL:34818,STENCIL_BACK_PASS_DEPTH_PASS:34819,STENCIL_BACK_REF:36003,STENCIL_BACK_VALUE_MASK:36004,STENCIL_BACK_WRITEMASK:36005,VIEWPORT:2978,SCISSOR_BOX:3088,COLOR_CLEAR_VALUE:3106,COLOR_WRITEMASK:3107,UNPACK_ALIGNMENT:3317,PACK_ALIGNMENT:3333,MAX_TEXTURE_SIZE:3379,MAX_VIEWPORT_DIMS:3386,SUBPIXEL_BITS:3408,RED_BITS:3410,GREEN_BITS:3411,BLUE_BITS:3412,ALPHA_BITS:3413,DEPTH_BITS:3414,STENCIL_BITS:3415,POLYGON_OFFSET_UNITS:10752,POLYGON_OFFSET_FACTOR:32824,TEXTURE_BINDING_2D:32873,SAMPLE_BUFFERS:32936,SAMPLES:32937,SAMPLE_COVERAGE_VALUE:32938,SAMPLE_COVERAGE_INVERT:32939,COMPRESSED_TEXTURE_FORMATS:34467,DONT_CARE:4352,FASTEST:4353,NICEST:4354,GENERATE_MIPMAP_HINT:33170,BYTE:5120,UNSIGNED_BYTE:5121,SHORT:5122,UNSIGNED_SHORT:5123,INT:5124,UNSIGNED_INT:5125,FLOAT:5126,DEPTH_COMPONENT:6402,ALPHA:6406,RGB:6407,RGBA:6408,LUMINANCE:6409,LUMINANCE_ALPHA:6410,UNSIGNED_SHORT_4_4_4_4:32819,UNSIGNED_SHORT_5_5_5_1:32820,UNSIGNED_SHORT_5_6_5:33635,FRAGMENT_SHADER:35632,VERTEX_SHADER:35633,MAX_VERTEX_ATTRIBS:34921,MAX_VERTEX_UNIFORM_VECTORS:36347,MAX_VARYING_VECTORS:36348,MAX_COMBINED_TEXTURE_IMAGE_UNITS:35661,MAX_VERTEX_TEXTURE_IMAGE_UNITS:35660,MAX_TEXTURE_IMAGE_UNITS:34930,MAX_FRAGMENT_UNIFORM_VECTORS:36349,SHADER_TYPE:35663,DELETE_STATUS:35712,LINK_STATUS:35714,VALIDATE_STATUS:35715,ATTACHED_SHADERS:35717,ACTIVE_UNIFORMS:35718,ACTIVE_ATTRIBUTES:35721,SHADING_LANGUAGE_VERSION:35724,CURRENT_PROGRAM:35725,NEVER:512,LESS:513,EQUAL:514,LEQUAL:515,GREATER:516,NOTEQUAL:517,GEQUAL:518,ALWAYS:519,KEEP:7680,REPLACE:7681,INCR:7682,DECR:7683,INVERT:5386,INCR_WRAP:34055,DECR_WRAP:34056,VENDOR:7936,RENDERER:7937,VERSION:7938,NEAREST:9728,LINEAR:9729,NEAREST_MIPMAP_NEAREST:9984,LINEAR_MIPMAP_NEAREST:9985,NEAREST_MIPMAP_LINEAR:9986,LINEAR_MIPMAP_LINEAR:9987,TEXTURE_MAG_FILTER:10240,TEXTURE_MIN_FILTER:10241,TEXTURE_WRAP_S:10242,TEXTURE_WRAP_T:10243,TEXTURE_2D:3553,TEXTURE:5890,TEXTURE_CUBE_MAP:34067,TEXTURE_BINDING_CUBE_MAP:34068,TEXTURE_CUBE_MAP_POSITIVE_X:34069,TEXTURE_CUBE_MAP_NEGATIVE_X:34070,TEXTURE_CUBE_MAP_POSITIVE_Y:34071,TEXTURE_CUBE_MAP_NEGATIVE_Y:34072,TEXTURE_CUBE_MAP_POSITIVE_Z:34073,TEXTURE_CUBE_MAP_NEGATIVE_Z:34074,MAX_CUBE_MAP_TEXTURE_SIZE:34076,TEXTURE0:33984,TEXTURE1:33985,TEXTURE2:33986,TEXTURE3:33987,TEXTURE4:33988,TEXTURE5:33989,TEXTURE6:33990,TEXTURE7:33991,TEXTURE8:33992,TEXTURE9:33993,TEXTURE10:33994,TEXTURE11:33995,TEXTURE12:33996,TEXTURE13:33997,TEXTURE14:33998,TEXTURE15:33999,TEXTURE16:34e3,TEXTURE17:34001,TEXTURE18:34002,TEXTURE19:34003,TEXTURE20:34004,TEXTURE21:34005,TEXTURE22:34006,TEXTURE23:34007,TEXTURE24:34008,TEXTURE25:34009,TEXTURE26:34010,TEXTURE27:34011,TEXTURE28:34012,TEXTURE29:34013,TEXTURE30:34014,TEXTURE31:34015,ACTIVE_TEXTURE:34016,REPEAT:10497,CLAMP_TO_EDGE:33071,MIRRORED_REPEAT:33648,FLOAT_VEC2:35664,FLOAT_VEC3:35665,FLOAT_VEC4:35666,INT_VEC2:35667,INT_VEC3:35668,INT_VEC4:35669,BOOL:35670,BOOL_VEC2:35671,BOOL_VEC3:35672,BOOL_VEC4:35673,FLOAT_MAT2:35674,FLOAT_MAT3:35675,FLOAT_MAT4:35676,SAMPLER_2D:35678,SAMPLER_CUBE:35680,VERTEX_ATTRIB_ARRAY_ENABLED:34338,VERTEX_ATTRIB_ARRAY_SIZE:34339,VERTEX_ATTRIB_ARRAY_STRIDE:34340,VERTEX_ATTRIB_ARRAY_TYPE:34341,VERTEX_ATTRIB_ARRAY_NORMALIZED:34922,VERTEX_ATTRIB_ARRAY_POINTER:34373,VERTEX_ATTRIB_ARRAY_BUFFER_BINDING:34975,IMPLEMENTATION_COLOR_READ_TYPE:35738,IMPLEMENTATION_COLOR_READ_FORMAT:35739,COMPILE_STATUS:35713,LOW_FLOAT:36336,MEDIUM_FLOAT:36337,HIGH_FLOAT:36338,LOW_INT:36339,MEDIUM_INT:36340,HIGH_INT:36341,FRAMEBUFFER:36160,RENDERBUFFER:36161,RGBA4:32854,RGB5_A1:32855,RGB565:36194,DEPTH_COMPONENT16:33189,STENCIL_INDEX:6401,STENCIL_INDEX8:36168,DEPTH_STENCIL:34041,RENDERBUFFER_WIDTH:36162,RENDERBUFFER_HEIGHT:36163,RENDERBUFFER_INTERNAL_FORMAT:36164,RENDERBUFFER_RED_SIZE:36176,RENDERBUFFER_GREEN_SIZE:36177,RENDERBUFFER_BLUE_SIZE:36178,RENDERBUFFER_ALPHA_SIZE:36179,RENDERBUFFER_DEPTH_SIZE:36180,RENDERBUFFER_STENCIL_SIZE:36181,FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE:36048,FRAMEBUFFER_ATTACHMENT_OBJECT_NAME:36049,FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL:36050,FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE:36051,COLOR_ATTACHMENT0:36064,DEPTH_ATTACHMENT:36096,STENCIL_ATTACHMENT:36128,DEPTH_STENCIL_ATTACHMENT:33306,NONE:0,FRAMEBUFFER_COMPLETE:36053,FRAMEBUFFER_INCOMPLETE_ATTACHMENT:36054,FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT:36055,FRAMEBUFFER_INCOMPLETE_DIMENSIONS:36057,FRAMEBUFFER_UNSUPPORTED:36061,FRAMEBUFFER_BINDING:36006,RENDERBUFFER_BINDING:36007,MAX_RENDERBUFFER_SIZE:34024,INVALID_FRAMEBUFFER_OPERATION:1286,UNPACK_FLIP_Y_WEBGL:37440,UNPACK_PREMULTIPLY_ALPHA_WEBGL:37441,CONTEXT_LOST_WEBGL:37442,UNPACK_COLORSPACE_CONVERSION_WEBGL:37443,BROWSER_DEFAULT_WEBGL:37444,COMPRESSED_RGB_S3TC_DXT1_EXT:33776,COMPRESSED_RGBA_S3TC_DXT1_EXT:33777,COMPRESSED_RGBA_S3TC_DXT3_EXT:33778,COMPRESSED_RGBA_S3TC_DXT5_EXT:33779,COMPRESSED_RGB_PVRTC_4BPPV1_IMG:35840,COMPRESSED_RGB_PVRTC_2BPPV1_IMG:35841,COMPRESSED_RGBA_PVRTC_4BPPV1_IMG:35842,COMPRESSED_RGBA_PVRTC_2BPPV1_IMG:35843,COMPRESSED_RGBA_ASTC_4x4_WEBGL:37808,COMPRESSED_RGB_ETC1_WEBGL:36196,COMPRESSED_RGBA_BPTC_UNORM:36492,HALF_FLOAT_OES:36193,DOUBLE:5130,READ_BUFFER:3074,UNPACK_ROW_LENGTH:3314,UNPACK_SKIP_ROWS:3315,UNPACK_SKIP_PIXELS:3316,PACK_ROW_LENGTH:3330,PACK_SKIP_ROWS:3331,PACK_SKIP_PIXELS:3332,COLOR:6144,DEPTH:6145,STENCIL:6146,RED:6403,RGB8:32849,RGBA8:32856,RGB10_A2:32857,TEXTURE_BINDING_3D:32874,UNPACK_SKIP_IMAGES:32877,UNPACK_IMAGE_HEIGHT:32878,TEXTURE_3D:32879,TEXTURE_WRAP_R:32882,MAX_3D_TEXTURE_SIZE:32883,UNSIGNED_INT_2_10_10_10_REV:33640,MAX_ELEMENTS_VERTICES:33e3,MAX_ELEMENTS_INDICES:33001,TEXTURE_MIN_LOD:33082,TEXTURE_MAX_LOD:33083,TEXTURE_BASE_LEVEL:33084,TEXTURE_MAX_LEVEL:33085,MIN:32775,MAX:32776,DEPTH_COMPONENT24:33190,MAX_TEXTURE_LOD_BIAS:34045,TEXTURE_COMPARE_MODE:34892,TEXTURE_COMPARE_FUNC:34893,CURRENT_QUERY:34917,QUERY_RESULT:34918,QUERY_RESULT_AVAILABLE:34919,STREAM_READ:35041,STREAM_COPY:35042,STATIC_READ:35045,STATIC_COPY:35046,DYNAMIC_READ:35049,DYNAMIC_COPY:35050,MAX_DRAW_BUFFERS:34852,DRAW_BUFFER0:34853,DRAW_BUFFER1:34854,DRAW_BUFFER2:34855,DRAW_BUFFER3:34856,DRAW_BUFFER4:34857,DRAW_BUFFER5:34858,DRAW_BUFFER6:34859,DRAW_BUFFER7:34860,DRAW_BUFFER8:34861,DRAW_BUFFER9:34862,DRAW_BUFFER10:34863,DRAW_BUFFER11:34864,DRAW_BUFFER12:34865,DRAW_BUFFER13:34866,DRAW_BUFFER14:34867,DRAW_BUFFER15:34868,MAX_FRAGMENT_UNIFORM_COMPONENTS:35657,MAX_VERTEX_UNIFORM_COMPONENTS:35658,SAMPLER_3D:35679,SAMPLER_2D_SHADOW:35682,FRAGMENT_SHADER_DERIVATIVE_HINT:35723,PIXEL_PACK_BUFFER:35051,PIXEL_UNPACK_BUFFER:35052,PIXEL_PACK_BUFFER_BINDING:35053,PIXEL_UNPACK_BUFFER_BINDING:35055,FLOAT_MAT2x3:35685,FLOAT_MAT2x4:35686,FLOAT_MAT3x2:35687,FLOAT_MAT3x4:35688,FLOAT_MAT4x2:35689,FLOAT_MAT4x3:35690,SRGB:35904,SRGB8:35905,SRGB8_ALPHA8:35907,COMPARE_REF_TO_TEXTURE:34894,RGBA32F:34836,RGB32F:34837,RGBA16F:34842,RGB16F:34843,VERTEX_ATTRIB_ARRAY_INTEGER:35069,MAX_ARRAY_TEXTURE_LAYERS:35071,MIN_PROGRAM_TEXEL_OFFSET:35076,MAX_PROGRAM_TEXEL_OFFSET:35077,MAX_VARYING_COMPONENTS:35659,TEXTURE_2D_ARRAY:35866,TEXTURE_BINDING_2D_ARRAY:35869,R11F_G11F_B10F:35898,UNSIGNED_INT_10F_11F_11F_REV:35899,RGB9_E5:35901,UNSIGNED_INT_5_9_9_9_REV:35902,TRANSFORM_FEEDBACK_BUFFER_MODE:35967,MAX_TRANSFORM_FEEDBACK_SEPARATE_COMPONENTS:35968,TRANSFORM_FEEDBACK_VARYINGS:35971,TRANSFORM_FEEDBACK_BUFFER_START:35972,TRANSFORM_FEEDBACK_BUFFER_SIZE:35973,TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN:35976,RASTERIZER_DISCARD:35977,MAX_TRANSFORM_FEEDBACK_INTERLEAVED_COMPONENTS:35978,MAX_TRANSFORM_FEEDBACK_SEPARATE_ATTRIBS:35979,INTERLEAVED_ATTRIBS:35980,SEPARATE_ATTRIBS:35981,TRANSFORM_FEEDBACK_BUFFER:35982,TRANSFORM_FEEDBACK_BUFFER_BINDING:35983,RGBA32UI:36208,RGB32UI:36209,RGBA16UI:36214,RGB16UI:36215,RGBA8UI:36220,RGB8UI:36221,RGBA32I:36226,RGB32I:36227,RGBA16I:36232,RGB16I:36233,RGBA8I:36238,RGB8I:36239,RED_INTEGER:36244,RGB_INTEGER:36248,RGBA_INTEGER:36249,SAMPLER_2D_ARRAY:36289,SAMPLER_2D_ARRAY_SHADOW:36292,SAMPLER_CUBE_SHADOW:36293,UNSIGNED_INT_VEC2:36294,UNSIGNED_INT_VEC3:36295,UNSIGNED_INT_VEC4:36296,INT_SAMPLER_2D:36298,INT_SAMPLER_3D:36299,INT_SAMPLER_CUBE:36300,INT_SAMPLER_2D_ARRAY:36303,UNSIGNED_INT_SAMPLER_2D:36306,UNSIGNED_INT_SAMPLER_3D:36307,UNSIGNED_INT_SAMPLER_CUBE:36308,UNSIGNED_INT_SAMPLER_2D_ARRAY:36311,DEPTH_COMPONENT32F:36012,DEPTH32F_STENCIL8:36013,FLOAT_32_UNSIGNED_INT_24_8_REV:36269,FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING:33296,FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE:33297,FRAMEBUFFER_ATTACHMENT_RED_SIZE:33298,FRAMEBUFFER_ATTACHMENT_GREEN_SIZE:33299,FRAMEBUFFER_ATTACHMENT_BLUE_SIZE:33300,FRAMEBUFFER_ATTACHMENT_ALPHA_SIZE:33301,FRAMEBUFFER_ATTACHMENT_DEPTH_SIZE:33302,FRAMEBUFFER_ATTACHMENT_STENCIL_SIZE:33303,FRAMEBUFFER_DEFAULT:33304,UNSIGNED_INT_24_8:34042,DEPTH24_STENCIL8:35056,UNSIGNED_NORMALIZED:35863,DRAW_FRAMEBUFFER_BINDING:36006,READ_FRAMEBUFFER:36008,DRAW_FRAMEBUFFER:36009,READ_FRAMEBUFFER_BINDING:36010,RENDERBUFFER_SAMPLES:36011,FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER:36052,MAX_COLOR_ATTACHMENTS:36063,COLOR_ATTACHMENT1:36065,COLOR_ATTACHMENT2:36066,COLOR_ATTACHMENT3:36067,COLOR_ATTACHMENT4:36068,COLOR_ATTACHMENT5:36069,COLOR_ATTACHMENT6:36070,COLOR_ATTACHMENT7:36071,COLOR_ATTACHMENT8:36072,COLOR_ATTACHMENT9:36073,COLOR_ATTACHMENT10:36074,COLOR_ATTACHMENT11:36075,COLOR_ATTACHMENT12:36076,COLOR_ATTACHMENT13:36077,COLOR_ATTACHMENT14:36078,COLOR_ATTACHMENT15:36079,FRAMEBUFFER_INCOMPLETE_MULTISAMPLE:36182,MAX_SAMPLES:36183,HALF_FLOAT:5131,RG:33319,RG_INTEGER:33320,R8:33321,RG8:33323,R16F:33325,R32F:33326,RG16F:33327,RG32F:33328,R8I:33329,R8UI:33330,R16I:33331,R16UI:33332,R32I:33333,R32UI:33334,RG8I:33335,RG8UI:33336,RG16I:33337,RG16UI:33338,RG32I:33339,RG32UI:33340,VERTEX_ARRAY_BINDING:34229,R8_SNORM:36756,RG8_SNORM:36757,RGB8_SNORM:36758,RGBA8_SNORM:36759,SIGNED_NORMALIZED:36764,COPY_READ_BUFFER:36662,COPY_WRITE_BUFFER:36663,COPY_READ_BUFFER_BINDING:36662,COPY_WRITE_BUFFER_BINDING:36663,UNIFORM_BUFFER:35345,UNIFORM_BUFFER_BINDING:35368,UNIFORM_BUFFER_START:35369,UNIFORM_BUFFER_SIZE:35370,MAX_VERTEX_UNIFORM_BLOCKS:35371,MAX_FRAGMENT_UNIFORM_BLOCKS:35373,MAX_COMBINED_UNIFORM_BLOCKS:35374,MAX_UNIFORM_BUFFER_BINDINGS:35375,MAX_UNIFORM_BLOCK_SIZE:35376,MAX_COMBINED_VERTEX_UNIFORM_COMPONENTS:35377,MAX_COMBINED_FRAGMENT_UNIFORM_COMPONENTS:35379,UNIFORM_BUFFER_OFFSET_ALIGNMENT:35380,ACTIVE_UNIFORM_BLOCKS:35382,UNIFORM_TYPE:35383,UNIFORM_SIZE:35384,UNIFORM_BLOCK_INDEX:35386,UNIFORM_OFFSET:35387,UNIFORM_ARRAY_STRIDE:35388,UNIFORM_MATRIX_STRIDE:35389,UNIFORM_IS_ROW_MAJOR:35390,UNIFORM_BLOCK_BINDING:35391,UNIFORM_BLOCK_DATA_SIZE:35392,UNIFORM_BLOCK_ACTIVE_UNIFORMS:35394,UNIFORM_BLOCK_ACTIVE_UNIFORM_INDICES:35395,UNIFORM_BLOCK_REFERENCED_BY_VERTEX_SHADER:35396,UNIFORM_BLOCK_REFERENCED_BY_FRAGMENT_SHADER:35398,INVALID_INDEX:4294967295,MAX_VERTEX_OUTPUT_COMPONENTS:37154,MAX_FRAGMENT_INPUT_COMPONENTS:37157,MAX_SERVER_WAIT_TIMEOUT:37137,OBJECT_TYPE:37138,SYNC_CONDITION:37139,SYNC_STATUS:37140,SYNC_FLAGS:37141,SYNC_FENCE:37142,SYNC_GPU_COMMANDS_COMPLETE:37143,UNSIGNALED:37144,SIGNALED:37145,ALREADY_SIGNALED:37146,TIMEOUT_EXPIRED:37147,CONDITION_SATISFIED:37148,WAIT_FAILED:37149,SYNC_FLUSH_COMMANDS_BIT:1,VERTEX_ATTRIB_ARRAY_DIVISOR:35070,ANY_SAMPLES_PASSED:35887,ANY_SAMPLES_PASSED_CONSERVATIVE:36202,SAMPLER_BINDING:35097,RGB10_A2UI:36975,INT_2_10_10_10_REV:36255,TRANSFORM_FEEDBACK:36386,TRANSFORM_FEEDBACK_PAUSED:36387,TRANSFORM_FEEDBACK_ACTIVE:36388,TRANSFORM_FEEDBACK_BINDING:36389,COMPRESSED_R11_EAC:37488,COMPRESSED_SIGNED_R11_EAC:37489,COMPRESSED_RG11_EAC:37490,COMPRESSED_SIGNED_RG11_EAC:37491,COMPRESSED_RGB8_ETC2:37492,COMPRESSED_SRGB8_ETC2:37493,COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2:37494,COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2:37495,COMPRESSED_RGBA8_ETC2_EAC:37496,COMPRESSED_SRGB8_ALPHA8_ETC2_EAC:37497,TEXTURE_IMMUTABLE_FORMAT:37167,MAX_ELEMENT_INDEX:36203,TEXTURE_IMMUTABLE_LEVELS:33503,MAX_TEXTURE_MAX_ANISOTROPY_EXT:34047};Object.freeze(uue);var te=uue;var iUe=new h;function Nt(e){this._size=e.size,this._datatype=e.datatype,this.getValue=e.getValue}var nc={};nc[te.FLOAT]="float";nc[te.FLOAT_VEC2]="vec2";nc[te.FLOAT_VEC3]="vec3";nc[te.FLOAT_VEC4]="vec4";nc[te.INT]="int";nc[te.INT_VEC2]="ivec2";nc[te.INT_VEC3]="ivec3";nc[te.INT_VEC4]="ivec4";nc[te.BOOL]="bool";nc[te.BOOL_VEC2]="bvec2";nc[te.BOOL_VEC3]="bvec3";nc[te.BOOL_VEC4]="bvec4";nc[te.FLOAT_MAT2]="mat2";nc[te.FLOAT_MAT3]="mat3";nc[te.FLOAT_MAT4]="mat4";nc[te.SAMPLER_2D]="sampler2D";nc[te.SAMPLER_CUBE]="samplerCube";Nt.prototype.getDeclaration=function(e){let t=`uniform ${nc[this._datatype]} ${e}`,n=this._size;return n===1?t+=";":t+=`[${n.toString()}];`,t};var rUe={czm_viewport:new Nt({size:1,datatype:te.FLOAT_VEC4,getValue:function(e){return e.viewportCartesian4}}),czm_viewportOrthographic:new Nt({size:1,datatype:te.FLOAT_MAT4,getValue:function(e){return e.viewportOrthographic}}),czm_viewportTransformation:new Nt({size:1,datatype:te.FLOAT_MAT4,getValue:function(e){return e.viewportTransformation}}),czm_globeDepthTexture:new Nt({size:1,datatype:te.SAMPLER_2D,getValue:function(e){return e.globeDepthTexture}}),czm_edgeIdTexture:new Nt({size:1,datatype:te.SAMPLER_2D,getValue:function(e){return e.edgeIdTexture}}),czm_edgeColorTexture:new Nt({size:1,datatype:te.SAMPLER_2D,getValue:function(e){return e.edgeColorTexture}}),czm_edgeDepthTexture:new Nt({size:1,datatype:te.SAMPLER_2D,getValue:function(e){return e.edgeDepthTexture}}),czm_planarFillIdTexture:new Nt({size:1,datatype:te.SAMPLER_2D,getValue:function(e){return e.planarFillIdTexture}}),czm_model:new Nt({size:1,datatype:te.FLOAT_MAT4,getValue:function(e){return e.model}}),czm_inverseModel:new Nt({size:1,datatype:te.FLOAT_MAT4,getValue:function(e){return e.inverseModel}}),czm_view:new Nt({size:1,datatype:te.FLOAT_MAT4,getValue:function(e){return e.view}}),czm_view3D:new Nt({size:1,datatype:te.FLOAT_MAT4,getValue:function(e){return e.view3D}}),czm_viewRotation:new Nt({size:1,datatype:te.FLOAT_MAT3,getValue:function(e){return e.viewRotation}}),czm_viewRotation3D:new Nt({size:1,datatype:te.FLOAT_MAT3,getValue:function(e){return e.viewRotation3D}}),czm_inverseView:new Nt({size:1,datatype:te.FLOAT_MAT4,getValue:function(e){return e.inverseView}}),czm_inverseView3D:new Nt({size:1,datatype:te.FLOAT_MAT4,getValue:function(e){return e.inverseView3D}}),czm_inverseViewRotation:new Nt({size:1,datatype:te.FLOAT_MAT3,getValue:function(e){return e.inverseViewRotation}}),czm_inverseViewRotation3D:new Nt({size:1,datatype:te.FLOAT_MAT3,getValue:function(e){return e.inverseViewRotation3D}}),czm_projection:new Nt({size:1,datatype:te.FLOAT_MAT4,getValue:function(e){return e.projection}}),czm_inverseProjection:new Nt({size:1,datatype:te.FLOAT_MAT4,getValue:function(e){return e.inverseProjection}}),czm_infiniteProjection:new Nt({size:1,datatype:te.FLOAT_MAT4,getValue:function(e){return e.infiniteProjection}}),czm_modelView:new Nt({size:1,datatype:te.FLOAT_MAT4,getValue:function(e){return e.modelView}}),czm_modelView3D:new Nt({size:1,datatype:te.FLOAT_MAT4,getValue:function(e){return e.modelView3D}}),czm_modelViewRelativeToEye:new Nt({size:1,datatype:te.FLOAT_MAT4,getValue:function(e){return e.modelViewRelativeToEye}}),czm_inverseModelView:new Nt({size:1,datatype:te.FLOAT_MAT4,getValue:function(e){return e.inverseModelView}}),czm_inverseModelView3D:new Nt({size:1,datatype:te.FLOAT_MAT4,getValue:function(e){return e.inverseModelView3D}}),czm_viewProjection:new Nt({size:1,datatype:te.FLOAT_MAT4,getValue:function(e){return e.viewProjection}}),czm_inverseViewProjection:new Nt({size:1,datatype:te.FLOAT_MAT4,getValue:function(e){return e.inverseViewProjection}}),czm_modelViewProjection:new Nt({size:1,datatype:te.FLOAT_MAT4,getValue:function(e){return e.modelViewProjection}}),czm_inverseModelViewProjection:new Nt({size:1,datatype:te.FLOAT_MAT4,getValue:function(e){return e.inverseModelViewProjection}}),czm_modelViewProjectionRelativeToEye:new Nt({size:1,datatype:te.FLOAT_MAT4,getValue:function(e){return e.modelViewProjectionRelativeToEye}}),czm_modelViewInfiniteProjection:new Nt({size:1,datatype:te.FLOAT_MAT4,getValue:function(e){return e.modelViewInfiniteProjection}}),czm_orthographicIn3D:new Nt({size:1,datatype:te.FLOAT,getValue:function(e){return e.orthographicIn3D?1:0}}),czm_normal:new Nt({size:1,datatype:te.FLOAT_MAT3,getValue:function(e){return e.normal}}),czm_normal3D:new Nt({size:1,datatype:te.FLOAT_MAT3,getValue:function(e){return e.normal3D}}),czm_inverseNormal:new Nt({size:1,datatype:te.FLOAT_MAT3,getValue:function(e){return e.inverseNormal}}),czm_inverseNormal3D:new Nt({size:1,datatype:te.FLOAT_MAT3,getValue:function(e){return e.inverseNormal3D}}),czm_eyeHeight:new Nt({size:1,datatype:te.FLOAT,getValue:function(e){return e.eyeHeight}}),czm_eyeCartographic:new Nt({size:1,datatype:te.FLOAT_VEC3,getValue:function(e){return e.eyeCartographic}}),czm_eyeHeight2D:new Nt({size:1,datatype:te.FLOAT_VEC2,getValue:function(e){return e.eyeHeight2D}}),czm_eyeEllipsoidNormalEC:new Nt({size:1,datatype:te.FLOAT_VEC3,getValue:function(e){return e.eyeEllipsoidNormalEC}}),czm_eyeEllipsoidCurvature:new Nt({size:1,datatype:te.FLOAT_VEC2,getValue:function(e){return e.eyeEllipsoidCurvature}}),czm_eyeToEnu:new Nt({size:1,datatype:te.FLOAT_MAT3,getValue:function(e){return e.eyeToEnu}}),czm_modelToEnu:new Nt({size:1,datatype:te.FLOAT_MAT4,getValue:function(e){return e.modelToEnu}}),czm_enuToModel:new Nt({size:1,datatype:te.FLOAT_MAT4,getValue:function(e){return e.enuToModel}}),czm_entireFrustum:new Nt({size:1,datatype:te.FLOAT_VEC2,getValue:function(e){return e.entireFrustum}}),czm_currentFrustum:new Nt({size:1,datatype:te.FLOAT_VEC2,getValue:function(e){return e.currentFrustum}}),czm_frustumPlanes:new Nt({size:1,datatype:te.FLOAT_VEC4,getValue:function(e){return e.frustumPlanes}}),czm_farDepthFromNearPlusOne:new Nt({size:1,datatype:te.FLOAT,getValue:function(e){return e.farDepthFromNearPlusOne}}),czm_log2FarDepthFromNearPlusOne:new Nt({size:1,datatype:te.FLOAT,getValue:function(e){return e.log2FarDepthFromNearPlusOne}}),czm_oneOverLog2FarDepthFromNearPlusOne:new Nt({size:1,datatype:te.FLOAT,getValue:function(e){return e.oneOverLog2FarDepthFromNearPlusOne}}),czm_sunPositionWC:new Nt({size:1,datatype:te.FLOAT_VEC3,getValue:function(e){return e.sunPositionWC}}),czm_sunPositionColumbusView:new Nt({size:1,datatype:te.FLOAT_VEC3,getValue:function(e){return e.sunPositionColumbusView}}),czm_sunDirectionEC:new Nt({size:1,datatype:te.FLOAT_VEC3,getValue:function(e){return e.sunDirectionEC}}),czm_sunDirectionWC:new Nt({size:1,datatype:te.FLOAT_VEC3,getValue:function(e){return e.sunDirectionWC}}),czm_moonDirectionEC:new Nt({size:1,datatype:te.FLOAT_VEC3,getValue:function(e){return e.moonDirectionEC}}),czm_lightDirectionEC:new Nt({size:1,datatype:te.FLOAT_VEC3,getValue:function(e){return e.lightDirectionEC}}),czm_lightDirectionWC:new Nt({size:1,datatype:te.FLOAT_VEC3,getValue:function(e){return e.lightDirectionWC}}),czm_lightColor:new Nt({size:1,datatype:te.FLOAT_VEC3,getValue:function(e){return e.lightColor}}),czm_lightColorHdr:new Nt({size:1,datatype:te.FLOAT_VEC3,getValue:function(e){return e.lightColorHdr}}),czm_encodedCameraPositionMCHigh:new Nt({size:1,datatype:te.FLOAT_VEC3,getValue:function(e){return e.encodedCameraPositionMCHigh}}),czm_encodedCameraPositionMCLow:new Nt({size:1,datatype:te.FLOAT_VEC3,getValue:function(e){return e.encodedCameraPositionMCLow}}),czm_viewerPositionWC:new Nt({size:1,datatype:te.FLOAT_VEC3,getValue:function(e){return N.getTranslation(e.inverseView,iUe)}}),czm_frameNumber:new Nt({size:1,datatype:te.FLOAT,getValue:function(e){return e.frameState.frameNumber}}),czm_morphTime:new Nt({size:1,datatype:te.FLOAT,getValue:function(e){return e.frameState.morphTime}}),czm_sceneMode:new Nt({size:1,datatype:te.FLOAT,getValue:function(e){return e.frameState.mode}}),czm_pass:new Nt({size:1,datatype:te.FLOAT,getValue:function(e){return e.pass}}),czm_backgroundColor:new Nt({size:1,datatype:te.FLOAT_VEC4,getValue:function(e){return e.backgroundColor}}),czm_brdfLut:new Nt({size:1,datatype:te.SAMPLER_2D,getValue:function(e){return e.brdfLut}}),czm_environmentMap:new Nt({size:1,datatype:te.SAMPLER_CUBE,getValue:function(e){return e.environmentMap}}),czm_specularEnvironmentMaps:new Nt({size:1,datatype:te.SAMPLER_CUBE,getValue:function(e){return e.specularEnvironmentMaps}}),czm_specularEnvironmentMapsMaximumLOD:new Nt({size:1,datatype:te.FLOAT,getValue:function(e){return e.specularEnvironmentMapsMaximumLOD}}),czm_sphericalHarmonicCoefficients:new Nt({size:9,datatype:te.FLOAT_VEC3,getValue:function(e){return e.sphericalHarmonicCoefficients}}),czm_temeToPseudoFixed:new Nt({size:1,datatype:te.FLOAT_MAT3,getValue:function(e){return e.temeToPseudoFixedMatrix}}),czm_pixelRatio:new Nt({size:1,datatype:te.FLOAT,getValue:function(e){return e.pixelRatio}}),czm_fogDensity:new Nt({size:1,datatype:te.FLOAT,getValue:function(e){return e.fogDensity}}),czm_fogVisualDensityScalar:new Nt({size:1,datatype:te.FLOAT,getValue:function(e){return e.fogVisualDensityScalar}}),czm_fogMinimumBrightness:new Nt({size:1,datatype:te.FLOAT,getValue:function(e){return e.fogMinimumBrightness}}),czm_atmosphereHsbShift:new Nt({size:1,datatype:te.FLOAT_VEC3,getValue:function(e){return e.atmosphereHsbShift}}),czm_atmosphereLightIntensity:new Nt({size:1,datatype:te.FLOAT,getValue:function(e){return e.atmosphereLightIntensity}}),czm_atmosphereRayleighCoefficient:new Nt({size:1,datatype:te.FLOAT_VEC3,getValue:function(e){return e.atmosphereRayleighCoefficient}}),czm_atmosphereRayleighScaleHeight:new Nt({size:1,datatype:te.FLOAT,getValue:function(e){return e.atmosphereRayleighScaleHeight}}),czm_atmosphereMieCoefficient:new Nt({size:1,datatype:te.FLOAT_VEC3,getValue:function(e){return e.atmosphereMieCoefficient}}),czm_atmosphereMieScaleHeight:new Nt({size:1,datatype:te.FLOAT,getValue:function(e){return e.atmosphereMieScaleHeight}}),czm_atmosphereMieAnisotropy:new Nt({size:1,datatype:te.FLOAT,getValue:function(e){return e.atmosphereMieAnisotropy}}),czm_atmosphereDynamicLighting:new Nt({size:1,datatype:te.FLOAT,getValue:function(e){return e.atmosphereDynamicLighting}}),czm_splitPosition:new Nt({size:1,datatype:te.FLOAT,getValue:function(e){return e.splitPosition}}),czm_geometricToleranceOverMeter:new Nt({size:1,datatype:te.FLOAT,getValue:function(e){return e.geometricToleranceOverMeter}}),czm_minimumDisableDepthTestDistance:new Nt({size:1,datatype:te.FLOAT,getValue:function(e){return e.minimumDisableDepthTestDistance}}),czm_invertClassificationColor:new Nt({size:1,datatype:te.FLOAT_VEC4,getValue:function(e){return e.invertClassificationColor}}),czm_gamma:new Nt({size:1,datatype:te.FLOAT,getValue:function(e){return e.gamma}}),czm_ellipsoidRadii:new Nt({size:1,datatype:te.FLOAT_VEC3,getValue:function(e){return e.ellipsoid.radii}}),czm_ellipsoidInverseRadii:new Nt({size:1,datatype:te.FLOAT_VEC3,getValue:function(e){return e.ellipsoid.oneOverRadii}})},tg=rUe;function oUe(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(e){let t=Math.random()*16|0;return(e==="x"?t:t&3|8).toString(16)})}var Kn=oUe;function sUe(){return!0}function aUe(e,t){t=t??"This object was destroyed, i.e., destroy() was called.";function n(){}for(let i in e)typeof e[i]=="function"&&(e[i]=n);e.isDestroyed=sUe}var le=aUe;var ma={UNSIGNED_BYTE:te.UNSIGNED_BYTE,UNSIGNED_SHORT:te.UNSIGNED_SHORT,UNSIGNED_INT:te.UNSIGNED_INT};ma.getSizeInBytes=function(e){switch(e){case ma.UNSIGNED_BYTE:return Uint8Array.BYTES_PER_ELEMENT;case ma.UNSIGNED_SHORT:return Uint16Array.BYTES_PER_ELEMENT;case ma.UNSIGNED_INT:return Uint32Array.BYTES_PER_ELEMENT}};ma.fromSizeInBytes=function(e){switch(e){case 2:return ma.UNSIGNED_SHORT;case 4:return ma.UNSIGNED_INT;case 1:return ma.UNSIGNED_BYTE}};ma.validate=function(e){return l(e)&&(e===ma.UNSIGNED_BYTE||e===ma.UNSIGNED_SHORT||e===ma.UNSIGNED_INT)};ma.createTypedArray=function(e,t){return e>=D.SIXTY_FOUR_KILOBYTES?new Uint32Array(t):new Uint16Array(t)};ma.createTypedArrayFromArrayBuffer=function(e,t,n,i){return e>=D.SIXTY_FOUR_KILOBYTES?new Uint32Array(t,n,i):new Uint16Array(t,n,i)};ma.fromTypedArray=function(e){if(e instanceof Uint8Array)return ma.UNSIGNED_BYTE;if(e instanceof Uint16Array)return ma.UNSIGNED_SHORT;if(e instanceof Uint32Array)return ma.UNSIGNED_INT};Object.freeze(ma);var je=ma;var ex={STREAM_DRAW:te.STREAM_DRAW,STATIC_DRAW:te.STATIC_DRAW,DYNAMIC_DRAW:te.DYNAMIC_DRAW,DYNAMIC_READ:te.DYNAMIC_READ};ex.validate=function(e){return e===ex.STREAM_DRAW||e===ex.STATIC_DRAW||e===ex.DYNAMIC_DRAW||e===ex.DYNAMIC_READ};Object.freeze(ex);var Me=ex;function Yc(e){e=e??H.EMPTY_OBJECT;let t=e.context._gl,n=e.bufferTarget,i=e.typedArray,r=e.sizeInBytes,o=e.usage,s=l(i);s&&(r=i.byteLength);let a=t.createBuffer();t.bindBuffer(n,a),t.bufferData(n,s?i:r,o),t.bindBuffer(n,null),this._id=Kn(),this._gl=t,this._webgl2=e.context._webgl2,this._bufferTarget=n,this._sizeInBytes=r,this._usage=o,this._buffer=a,this.vertexArrayDestroyable=!0}Yc.createPixelBuffer=function(e){if(!e.context._webgl2)throw new pe("A WebGL 2 context is required to create PixelBuffers.");return new Yc({context:e.context,bufferTarget:te.PIXEL_PACK_BUFFER,typedArray:e.typedArray,sizeInBytes:e.sizeInBytes,usage:e.usage})};Yc.createVertexBuffer=function(e){return new Yc({context:e.context,bufferTarget:te.ARRAY_BUFFER,typedArray:e.typedArray,sizeInBytes:e.sizeInBytes,usage:e.usage})};Yc.createIndexBuffer=function(e){let t=e.context,n=e.indexDatatype,i=je.getSizeInBytes(n),r=new Yc({context:t,bufferTarget:te.ELEMENT_ARRAY_BUFFER,typedArray:e.typedArray,sizeInBytes:e.sizeInBytes,usage:e.usage}),o=r.sizeInBytes/i;return Object.defineProperties(r,{indexDatatype:{get:function(){return n}},bytesPerIndex:{get:function(){return i}},numberOfIndices:{get:function(){return o}}}),r};Object.defineProperties(Yc.prototype,{sizeInBytes:{get:function(){return this._sizeInBytes}},usage:{get:function(){return this._usage}}});Yc.prototype._getBuffer=function(){return this._buffer};Yc.prototype._bind=function(){let e=this._gl,t=this._bufferTarget;e.bindBuffer(t,this._buffer)};Yc.prototype._unBind=function(){let e=this._gl,t=this._bufferTarget;e.bindBuffer(t,null)};Yc.prototype.copyFromArrayView=function(e,t){t=t??0;let n=this._gl,i=this._bufferTarget;n.bindBuffer(i,this._buffer),n.bufferSubData(i,t,e),n.bindBuffer(i,null)};Yc.prototype.copyFromBuffer=function(e,t,n,i){let r=te.COPY_READ_BUFFER,o=te.COPY_WRITE_BUFFER,s=this._gl;s.bindBuffer(o,this._buffer),s.bindBuffer(r,e._buffer),s.copyBufferSubData(r,o,t,n,i),s.bindBuffer(o,null),s.bindBuffer(r,null)};Yc.prototype.getBufferData=function(e,t,n,i){t=t??0,n=n??0;let r=this._gl,o=te.COPY_READ_BUFFER;r.bindBuffer(o,this._buffer),r.getBufferSubData(o,t,e,n,i),r.bindBuffer(o,null)};Yc.prototype.isDestroyed=function(){return!1};Yc.prototype.destroy=function(){return this._gl.deleteBuffer(this._buffer),le(this)};var tt=Yc;var Sy,ms={requestFullscreen:void 0,exitFullscreen:void 0,fullscreenEnabled:void 0,fullscreenElement:void 0,fullscreenchange:void 0,fullscreenerror:void 0},Iu={};Object.defineProperties(Iu,{element:{get:function(){if(Iu.supportsFullscreen())return document[ms.fullscreenElement]}},changeEventName:{get:function(){if(Iu.supportsFullscreen())return ms.fullscreenchange}},errorEventName:{get:function(){if(Iu.supportsFullscreen())return ms.fullscreenerror}},enabled:{get:function(){if(Iu.supportsFullscreen())return document[ms.fullscreenEnabled]}},fullscreen:{get:function(){if(Iu.supportsFullscreen())return Iu.element!==null}}});Iu.supportsFullscreen=function(){if(l(Sy))return Sy;Sy=!1;let e=document.body;if(typeof e.requestFullscreen=="function")return ms.requestFullscreen="requestFullscreen",ms.exitFullscreen="exitFullscreen",ms.fullscreenEnabled="fullscreenEnabled",ms.fullscreenElement="fullscreenElement",ms.fullscreenchange="fullscreenchange",ms.fullscreenerror="fullscreenerror",Sy=!0,Sy;let t=["webkit","moz","o","ms","khtml"],n;for(let i=0,r=t.length;i<r;++i){let o=t[i];n=`${o}RequestFullscreen`,typeof e[n]=="function"?(ms.requestFullscreen=n,Sy=!0):(n=`${o}RequestFullScreen`,typeof e[n]=="function"&&(ms.requestFullscreen=n,Sy=!0)),n=`${o}ExitFullscreen`,typeof document[n]=="function"?ms.exitFullscreen=n:(n=`${o}CancelFullScreen`,typeof document[n]=="function"&&(ms.exitFullscreen=n)),n=`${o}FullscreenEnabled`,document[n]!==void 0?ms.fullscreenEnabled=n:(n=`${o}FullScreenEnabled`,document[n]!==void 0&&(ms.fullscreenEnabled=n)),n=`${o}FullscreenElement`,document[n]!==void 0?ms.fullscreenElement=n:(n=`${o}FullScreenElement`,document[n]!==void 0&&(ms.fullscreenElement=n)),n=`${o}fullscreenchange`,document[`on${n}`]!==void 0&&(o==="ms"&&(n="MSFullscreenChange"),ms.fullscreenchange=n),n=`${o}fullscreenerror`,document[`on${n}`]!==void 0&&(o==="ms"&&(n="MSFullscreenError"),ms.fullscreenerror=n)}return Sy};Iu.requestFullscreen=function(e,t){Iu.supportsFullscreen()&&e[ms.requestFullscreen]({vrDisplay:t})};Iu.exitFullscreen=function(){Iu.supportsFullscreen()&&document[ms.exitFullscreen]()};Iu._names=ms;var es=Iu;var Td;typeof navigator<"u"?Td=navigator:Td={};function sD(e){let t=e.split(".");for(let n=0,i=t.length;n<i;++n)t[n]=parseInt(t[n],10);return t}var bj,fue;function Wq(){if(!l(bj)&&(bj=!1,!Sj())){let e=/ Chrome\/([\.0-9]+)/.exec(Td.userAgent);e!==null&&(bj=!0,fue=sD(e[1]))}return bj}function cUe(){return Wq()&&fue}var xj,due;function hue(){if(!l(xj)&&(xj=!1,!Wq()&&!Sj()&&/ Safari\/[\.0-9]+/.test(Td.userAgent))){let e=/ Version\/([\.0-9]+)/.exec(Td.userAgent);e!==null&&(xj=!0,due=sD(e[1]))}return xj}function lUe(){return hue()&&due}var Tj,Gq;function mue(){if(!l(Tj)){Tj=!1;let e=/ AppleWebKit\/([\.0-9]+)(\+?)/.exec(Td.userAgent);e!==null&&(Tj=!0,Gq=sD(e[1]),Gq.isNightly=!!e[2])}return Tj}function uUe(){return mue()&&Gq}var Ej,pue;function Sj(){if(!l(Ej)){Ej=!1;let e=/ Edg\/([\.0-9]+)/.exec(Td.userAgent);e!==null&&(Ej=!0,pue=sD(e[1]))}return Ej}function fUe(){return Sj()&&pue}var Cj,qq;function wj(){if(!l(Cj)){Cj=!1;let e=/Firefox\/([\.0-9]+)/.exec(Td.userAgent);e!==null&&(Cj=!0,qq=sD(e[1]))}return Cj}var Vq;function dUe(){return l(Vq)||(Vq=/Windows/i.test(Td.appVersion)),Vq}var jq;function hUe(){return l(jq)||(jq=navigator.platform==="iPhone"||navigator.platform==="iPod"||navigator.platform==="iPad"),jq}function mUe(){return wj()&&qq}var Hq;function pUe(){return l(Hq)||(Hq=!wj()&&typeof PointerEvent<"u"&&(!l(Td.pointerEnabled)||Td.pointerEnabled)),Hq}var gue,vj;function _ue(){if(!l(vj)){let e=document.createElement("canvas");e.setAttribute("style","image-rendering: -moz-crisp-edges;image-rendering: pixelated;");let t=e.style.imageRendering;vj=l(t)&&t!=="",vj&&(gue=t)}return vj}function gUe(){return _ue()?gue:void 0}function Ll(){return Ll._result}Ll._promise=void 0;Ll._result=void 0;Ll.initialize=function(){return l(Ll._promise)||(Ll._promise=new Promise(e=>{let t=new Image;t.onload=function(){Ll._result=t.width>0&&t.height>0,e(Ll._result)},t.onerror=function(){Ll._result=!1,e(Ll._result)},t.src="data:image/webp;base64,UklGRiIAAABXRUJQVlA4IBYAAAAwAQCdASoBAAEADsD+JaQAA3AAAAAA"})),Ll._promise};Object.defineProperties(Ll,{initialized:{get:function(){return l(Ll._result)}}});var sv=[];typeof ArrayBuffer<"u"&&(sv.push(Int8Array,Uint8Array,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array),typeof Uint8ClampedArray<"u"&&sv.push(Uint8ClampedArray),typeof Uint8ClampedArray<"u"&&sv.push(Uint8ClampedArray),typeof BigInt64Array<"u"&&sv.push(BigInt64Array),typeof BigUint64Array<"u"&&sv.push(BigUint64Array));var Ed={isChrome:Wq,chromeVersion:cUe,isSafari:hue,safariVersion:lUe,isWebkit:mue,webkitVersion:uUe,isEdge:Sj,edgeVersion:fUe,isFirefox:wj,firefoxVersion:mUe,isWindows:dUe,isIPadOrIOS:hUe,hardwareConcurrency:Td.hardwareConcurrency??3,supportsPointerEvents:pUe,supportsImageRenderingPixelated:_ue,supportsWebP:Ll,imageRenderingValue:gUe,typedArrayTypes:sv};Ed.supportsBasis=function(e){return Ed.supportsWebAssembly()&&e.context.supportsBasis};Ed.supportsFullscreen=function(){return es.supportsFullscreen()};Ed.supportsTypedArrays=function(){return typeof ArrayBuffer<"u"};Ed.supportsBigInt64Array=function(){return typeof BigInt64Array<"u"};Ed.supportsBigUint64Array=function(){return typeof BigUint64Array<"u"};Ed.supportsBigInt=function(){return typeof BigInt<"u"};Ed.supportsWebWorkers=function(){return typeof Worker<"u"};Ed.supportsWebAssembly=function(){return typeof WebAssembly<"u"};Ed.supportsWebgl2=function(e){return e.context.webgl2};Ed.supportsEsmWebWorkers=function(){return!wj()||parseInt(qq)>=114};var dn=Ed;function Yq(e,t,n){return n<0&&(n+=1),n>1&&(n-=1),n*6<1?e+(t-e)*6*n:n*2<1?t:n*3<2?e+(t-e)*(2/3-n)*6:e}var _e=class e{constructor(t,n,i,r){this.red=t??1,this.green=n??1,this.blue=i??1,this.alpha=r??1}static fromCartesian4(t,n){return l(n)?(n.red=t.x,n.green=t.y,n.blue=t.z,n.alpha=t.w,n):new e(t.x,t.y,t.z,t.w)}static fromBytes(t,n,i,r,o){return t=e.byteToFloat(t??255),n=e.byteToFloat(n??255),i=e.byteToFloat(i??255),r=e.byteToFloat(r??255),l(o)?(o.red=t,o.green=n,o.blue=i,o.alpha=r,o):new e(t,n,i,r)}static fromAlpha(t,n,i){return l(i)?(i.red=t.red,i.green=t.green,i.blue=t.blue,i.alpha=n,i):new e(t.red,t.green,t.blue,n)}static fromRgba(t,n){return Kq[0]=t,e.fromBytes(ng[0],ng[1],ng[2],ng[3],n)}static fromHsl(t,n,i,r,o){t=(t??0)%1,n=n??0,i=i??0,r=r??1;let s=i,a=i,c=i;if(n!==0){let u;i<.5?u=i*(1+n):u=i+n-i*n;let f=2*i-u;s=Yq(f,u,t+1/3),a=Yq(f,u,t),c=Yq(f,u,t-1/3)}return l(o)?(o.red=s,o.green=a,o.blue=c,o.alpha=r,o):new e(s,a,c,r)}static fromRandom(t,n){t=t??H.EMPTY_OBJECT;let i=t.red;if(!l(i)){let a=t.minimumRed??0,c=t.maximumRed??1;i=a+D.nextRandomNumber()*(c-a)}let r=t.green;if(!l(r)){let a=t.minimumGreen??0,c=t.maximumGreen??1;r=a+D.nextRandomNumber()*(c-a)}let o=t.blue;if(!l(o)){let a=t.minimumBlue??0,c=t.maximumBlue??1;o=a+D.nextRandomNumber()*(c-a)}let s=t.alpha;if(!l(s)){let a=t.minimumAlpha??0,c=t.maximumAlpha??1;s=a+D.nextRandomNumber()*(c-a)}return l(n)?(n.red=i,n.green=r,n.blue=o,n.alpha=s,n):new e(i,r,o,s)}static fromCssColorString(t,n){l(n)||(n=new e),t=t.trim();let i=e[t.toUpperCase()];if(l(i))return e.clone(i,n),n;let r=_Ue.exec(t);return r!==null?(n.red=parseInt(r[1],16)/15,n.green=parseInt(r[2],16)/15,n.blue=parseInt(r[3],16)/15,n.alpha=parseInt(r[4]??"f",16)/15,n):(r=yUe.exec(t),r!==null?(n.red=parseInt(r[1],16)/255,n.green=parseInt(r[2],16)/255,n.blue=parseInt(r[3],16)/255,n.alpha=parseInt(r[4]??"ff",16)/255,n):(r=AUe.exec(t),r!==null?(n.red=parseFloat(r[1])/(r[1].substr(-1)==="%"?100:255),n.green=parseFloat(r[2])/(r[2].substr(-1)==="%"?100:255),n.blue=parseFloat(r[3])/(r[3].substr(-1)==="%"?100:255),n.alpha=parseFloat(r[4]??"1.0"),n):(r=bUe.exec(t),r!==null?e.fromHsl(parseFloat(r[1])/360,parseFloat(r[2])/100,parseFloat(r[3])/100,parseFloat(r[4]??"1.0"),n):(n=void 0,n))))}static pack(t,n,i){return i=i??0,n[i++]=t.red,n[i++]=t.green,n[i++]=t.blue,n[i]=t.alpha,n}static unpack(t,n,i){return n=n??0,l(i)||(i=new e),i.red=t[n++],i.green=t[n++],i.blue=t[n++],i.alpha=t[n],i}static byteToFloat(t){return t/255}static floatToByte(t){return t===1?255:t*256|0}static clone(t,n){if(l(t))return l(n)?(n.red=t.red,n.green=t.green,n.blue=t.blue,n.alpha=t.alpha,n):new e(t.red,t.green,t.blue,t.alpha)}static equals(t,n){return t===n||l(t)&&l(n)&&t.red===n.red&&t.green===n.green&&t.blue===n.blue&&t.alpha===n.alpha}static equalsArray(t,n,i){return t.red===n[i]&&t.green===n[i+1]&&t.blue===n[i+2]&&t.alpha===n[i+3]}clone(t){return e.clone(this,t)}equals(t){return e.equals(this,t)}equalsEpsilon(t,n){return this===t||l(t)&&Math.abs(this.red-t.red)<=n&&Math.abs(this.green-t.green)<=n&&Math.abs(this.blue-t.blue)<=n&&Math.abs(this.alpha-t.alpha)<=n}toString(){return`(${this.red}, ${this.green}, ${this.blue}, ${this.alpha})`}toCssColorString(){let t=e.floatToByte(this.red),n=e.floatToByte(this.green),i=e.floatToByte(this.blue);return this.alpha===1?`rgb(${t},${n},${i})`:`rgba(${t},${n},${i},${this.alpha})`}toCssHexString(){let t=e.floatToByte(this.red).toString(16);t.length<2&&(t=`0${t}`);let n=e.floatToByte(this.green).toString(16);n.length<2&&(n=`0${n}`);let i=e.floatToByte(this.blue).toString(16);if(i.length<2&&(i=`0${i}`),this.alpha<1){let r=e.floatToByte(this.alpha).toString(16);return r.length<2&&(r=`0${r}`),`#${t}${n}${i}${r}`}return`#${t}${n}${i}`}toBytes(t){let n=e.floatToByte(this.red),i=e.floatToByte(this.green),r=e.floatToByte(this.blue),o=e.floatToByte(this.alpha);return l(t)?(t[0]=n,t[1]=i,t[2]=r,t[3]=o,t):[n,i,r,o]}static bytesToRgba(t,n,i,r){return ng[0]=t,ng[1]=n,ng[2]=i,ng[3]=r,Kq[0]}toRgba(){return e.bytesToRgba(e.floatToByte(this.red),e.floatToByte(this.green),e.floatToByte(this.blue),e.floatToByte(this.alpha))}brighten(t,n){return t=1-t,n.red=1-(1-this.red)*t,n.green=1-(1-this.green)*t,n.blue=1-(1-this.blue)*t,n.alpha=this.alpha,n}darken(t,n){return t=1-t,n.red=this.red*t,n.green=this.green*t,n.blue=this.blue*t,n.alpha=this.alpha,n}withAlpha(t,n){return e.fromAlpha(this,t,n)}static add(t,n,i){return i.red=t.red+n.red,i.green=t.green+n.green,i.blue=t.blue+n.blue,i.alpha=t.alpha+n.alpha,i}static subtract(t,n,i){return i.red=t.red-n.red,i.green=t.green-n.green,i.blue=t.blue-n.blue,i.alpha=t.alpha-n.alpha,i}static multiply(t,n,i){return i.red=t.red*n.red,i.green=t.green*n.green,i.blue=t.blue*n.blue,i.alpha=t.alpha*n.alpha,i}static divide(t,n,i){return i.red=t.red/n.red,i.green=t.green/n.green,i.blue=t.blue/n.blue,i.alpha=t.alpha/n.alpha,i}static mod(t,n,i){return i.red=t.red%n.red,i.green=t.green%n.green,i.blue=t.blue%n.blue,i.alpha=t.alpha%n.alpha,i}static lerp(t,n,i,r){return r.red=D.lerp(t.red,n.red,i),r.green=D.lerp(t.green,n.green,i),r.blue=D.lerp(t.blue,n.blue,i),r.alpha=D.lerp(t.alpha,n.alpha,i),r}static multiplyByScalar(t,n,i){return i.red=t.red*n,i.green=t.green*n,i.blue=t.blue*n,i.alpha=t.alpha*n,i}static divideByScalar(t,n,i){return i.red=t.red/n,i.green=t.green/n,i.blue=t.blue/n,i.alpha=t.alpha/n,i}},Xq,Kq,ng;dn.supportsTypedArrays()&&(Xq=new ArrayBuffer(4),Kq=new Uint32Array(Xq),ng=new Uint8Array(Xq));var _Ue=/^#([0-9a-f])([0-9a-f])([0-9a-f])([0-9a-f])?$/i,yUe=/^#([0-9a-f]{2})([0-9a-f]{2})([0-9a-f]{2})([0-9a-f]{2})?$/i,AUe=/^rgba?\s*\(\s*([0-9.]+%?)\s*[,\s]+\s*([0-9.]+%?)\s*[,\s]+\s*([0-9.]+%?)(?:\s*[,\s/]+\s*([0-9.]+))?\s*\)$/i,bUe=/^hsla?\s*\(\s*([0-9.]+)\s*[,\s]+\s*([0-9.]+%)\s*[,\s]+\s*([0-9.]+%)(?:\s*[,\s/]+\s*([0-9.]+))?\s*\)$/i;_e.packedLength=4;_e.ALICEBLUE=Object.freeze(_e.fromCssColorString("#F0F8FF"));_e.ANTIQUEWHITE=Object.freeze(_e.fromCssColorString("#FAEBD7"));_e.AQUA=Object.freeze(_e.fromCssColorString("#00FFFF"));_e.AQUAMARINE=Object.freeze(_e.fromCssColorString("#7FFFD4"));_e.AZURE=Object.freeze(_e.fromCssColorString("#F0FFFF"));_e.BEIGE=Object.freeze(_e.fromCssColorString("#F5F5DC"));_e.BISQUE=Object.freeze(_e.fromCssColorString("#FFE4C4"));_e.BLACK=Object.freeze(_e.fromCssColorString("#000000"));_e.BLANCHEDALMOND=Object.freeze(_e.fromCssColorString("#FFEBCD"));_e.BLUE=Object.freeze(_e.fromCssColorString("#0000FF"));_e.BLUEVIOLET=Object.freeze(_e.fromCssColorString("#8A2BE2"));_e.BROWN=Object.freeze(_e.fromCssColorString("#A52A2A"));_e.BURLYWOOD=Object.freeze(_e.fromCssColorString("#DEB887"));_e.CADETBLUE=Object.freeze(_e.fromCssColorString("#5F9EA0"));_e.CHARTREUSE=Object.freeze(_e.fromCssColorString("#7FFF00"));_e.CHOCOLATE=Object.freeze(_e.fromCssColorString("#D2691E"));_e.CORAL=Object.freeze(_e.fromCssColorString("#FF7F50"));_e.CORNFLOWERBLUE=Object.freeze(_e.fromCssColorString("#6495ED"));_e.CORNSILK=Object.freeze(_e.fromCssColorString("#FFF8DC"));_e.CRIMSON=Object.freeze(_e.fromCssColorString("#DC143C"));_e.CYAN=Object.freeze(_e.fromCssColorString("#00FFFF"));_e.DARKBLUE=Object.freeze(_e.fromCssColorString("#00008B"));_e.DARKCYAN=Object.freeze(_e.fromCssColorString("#008B8B"));_e.DARKGOLDENROD=Object.freeze(_e.fromCssColorString("#B8860B"));_e.DARKGRAY=Object.freeze(_e.fromCssColorString("#A9A9A9"));_e.DARKGREEN=Object.freeze(_e.fromCssColorString("#006400"));_e.DARKGREY=_e.DARKGRAY;_e.DARKKHAKI=Object.freeze(_e.fromCssColorString("#BDB76B"));_e.DARKMAGENTA=Object.freeze(_e.fromCssColorString("#8B008B"));_e.DARKOLIVEGREEN=Object.freeze(_e.fromCssColorString("#556B2F"));_e.DARKORANGE=Object.freeze(_e.fromCssColorString("#FF8C00"));_e.DARKORCHID=Object.freeze(_e.fromCssColorString("#9932CC"));_e.DARKRED=Object.freeze(_e.fromCssColorString("#8B0000"));_e.DARKSALMON=Object.freeze(_e.fromCssColorString("#E9967A"));_e.DARKSEAGREEN=Object.freeze(_e.fromCssColorString("#8FBC8F"));_e.DARKSLATEBLUE=Object.freeze(_e.fromCssColorString("#483D8B"));_e.DARKSLATEGRAY=Object.freeze(_e.fromCssColorString("#2F4F4F"));_e.DARKSLATEGREY=_e.DARKSLATEGRAY;_e.DARKTURQUOISE=Object.freeze(_e.fromCssColorString("#00CED1"));_e.DARKVIOLET=Object.freeze(_e.fromCssColorString("#9400D3"));_e.DEEPPINK=Object.freeze(_e.fromCssColorString("#FF1493"));_e.DEEPSKYBLUE=Object.freeze(_e.fromCssColorString("#00BFFF"));_e.DIMGRAY=Object.freeze(_e.fromCssColorString("#696969"));_e.DIMGREY=_e.DIMGRAY;_e.DODGERBLUE=Object.freeze(_e.fromCssColorString("#1E90FF"));_e.FIREBRICK=Object.freeze(_e.fromCssColorString("#B22222"));_e.FLORALWHITE=Object.freeze(_e.fromCssColorString("#FFFAF0"));_e.FORESTGREEN=Object.freeze(_e.fromCssColorString("#228B22"));_e.FUCHSIA=Object.freeze(_e.fromCssColorString("#FF00FF"));_e.GAINSBORO=Object.freeze(_e.fromCssColorString("#DCDCDC"));_e.GHOSTWHITE=Object.freeze(_e.fromCssColorString("#F8F8FF"));_e.GOLD=Object.freeze(_e.fromCssColorString("#FFD700"));_e.GOLDENROD=Object.freeze(_e.fromCssColorString("#DAA520"));_e.GRAY=Object.freeze(_e.fromCssColorString("#808080"));_e.GREEN=Object.freeze(_e.fromCssColorString("#008000"));_e.GREENYELLOW=Object.freeze(_e.fromCssColorString("#ADFF2F"));_e.GREY=_e.GRAY;_e.HONEYDEW=Object.freeze(_e.fromCssColorString("#F0FFF0"));_e.HOTPINK=Object.freeze(_e.fromCssColorString("#FF69B4"));_e.INDIANRED=Object.freeze(_e.fromCssColorString("#CD5C5C"));_e.INDIGO=Object.freeze(_e.fromCssColorString("#4B0082"));_e.IVORY=Object.freeze(_e.fromCssColorString("#FFFFF0"));_e.KHAKI=Object.freeze(_e.fromCssColorString("#F0E68C"));_e.LAVENDER=Object.freeze(_e.fromCssColorString("#E6E6FA"));_e.LAVENDAR_BLUSH=Object.freeze(_e.fromCssColorString("#FFF0F5"));_e.LAWNGREEN=Object.freeze(_e.fromCssColorString("#7CFC00"));_e.LEMONCHIFFON=Object.freeze(_e.fromCssColorString("#FFFACD"));_e.LIGHTBLUE=Object.freeze(_e.fromCssColorString("#ADD8E6"));_e.LIGHTCORAL=Object.freeze(_e.fromCssColorString("#F08080"));_e.LIGHTCYAN=Object.freeze(_e.fromCssColorString("#E0FFFF"));_e.LIGHTGOLDENRODYELLOW=Object.freeze(_e.fromCssColorString("#FAFAD2"));_e.LIGHTGRAY=Object.freeze(_e.fromCssColorString("#D3D3D3"));_e.LIGHTGREEN=Object.freeze(_e.fromCssColorString("#90EE90"));_e.LIGHTGREY=_e.LIGHTGRAY;_e.LIGHTPINK=Object.freeze(_e.fromCssColorString("#FFB6C1"));_e.LIGHTSEAGREEN=Object.freeze(_e.fromCssColorString("#20B2AA"));_e.LIGHTSKYBLUE=Object.freeze(_e.fromCssColorString("#87CEFA"));_e.LIGHTSLATEGRAY=Object.freeze(_e.fromCssColorString("#778899"));_e.LIGHTSLATEGREY=_e.LIGHTSLATEGRAY;_e.LIGHTSTEELBLUE=Object.freeze(_e.fromCssColorString("#B0C4DE"));_e.LIGHTYELLOW=Object.freeze(_e.fromCssColorString("#FFFFE0"));_e.LIME=Object.freeze(_e.fromCssColorString("#00FF00"));_e.LIMEGREEN=Object.freeze(_e.fromCssColorString("#32CD32"));_e.LINEN=Object.freeze(_e.fromCssColorString("#FAF0E6"));_e.MAGENTA=Object.freeze(_e.fromCssColorString("#FF00FF"));_e.MAROON=Object.freeze(_e.fromCssColorString("#800000"));_e.MEDIUMAQUAMARINE=Object.freeze(_e.fromCssColorString("#66CDAA"));_e.MEDIUMBLUE=Object.freeze(_e.fromCssColorString("#0000CD"));_e.MEDIUMORCHID=Object.freeze(_e.fromCssColorString("#BA55D3"));_e.MEDIUMPURPLE=Object.freeze(_e.fromCssColorString("#9370DB"));_e.MEDIUMSEAGREEN=Object.freeze(_e.fromCssColorString("#3CB371"));_e.MEDIUMSLATEBLUE=Object.freeze(_e.fromCssColorString("#7B68EE"));_e.MEDIUMSPRINGGREEN=Object.freeze(_e.fromCssColorString("#00FA9A"));_e.MEDIUMTURQUOISE=Object.freeze(_e.fromCssColorString("#48D1CC"));_e.MEDIUMVIOLETRED=Object.freeze(_e.fromCssColorString("#C71585"));_e.MIDNIGHTBLUE=Object.freeze(_e.fromCssColorString("#191970"));_e.MINTCREAM=Object.freeze(_e.fromCssColorString("#F5FFFA"));_e.MISTYROSE=Object.freeze(_e.fromCssColorString("#FFE4E1"));_e.MOCCASIN=Object.freeze(_e.fromCssColorString("#FFE4B5"));_e.NAVAJOWHITE=Object.freeze(_e.fromCssColorString("#FFDEAD"));_e.NAVY=Object.freeze(_e.fromCssColorString("#000080"));_e.OLDLACE=Object.freeze(_e.fromCssColorString("#FDF5E6"));_e.OLIVE=Object.freeze(_e.fromCssColorString("#808000"));_e.OLIVEDRAB=Object.freeze(_e.fromCssColorString("#6B8E23"));_e.ORANGE=Object.freeze(_e.fromCssColorString("#FFA500"));_e.ORANGERED=Object.freeze(_e.fromCssColorString("#FF4500"));_e.ORCHID=Object.freeze(_e.fromCssColorString("#DA70D6"));_e.PALEGOLDENROD=Object.freeze(_e.fromCssColorString("#EEE8AA"));_e.PALEGREEN=Object.freeze(_e.fromCssColorString("#98FB98"));_e.PALETURQUOISE=Object.freeze(_e.fromCssColorString("#AFEEEE"));_e.PALEVIOLETRED=Object.freeze(_e.fromCssColorString("#DB7093"));_e.PAPAYAWHIP=Object.freeze(_e.fromCssColorString("#FFEFD5"));_e.PEACHPUFF=Object.freeze(_e.fromCssColorString("#FFDAB9"));_e.PERU=Object.freeze(_e.fromCssColorString("#CD853F"));_e.PINK=Object.freeze(_e.fromCssColorString("#FFC0CB"));_e.PLUM=Object.freeze(_e.fromCssColorString("#DDA0DD"));_e.POWDERBLUE=Object.freeze(_e.fromCssColorString("#B0E0E6"));_e.PURPLE=Object.freeze(_e.fromCssColorString("#800080"));_e.RED=Object.freeze(_e.fromCssColorString("#FF0000"));_e.ROSYBROWN=Object.freeze(_e.fromCssColorString("#BC8F8F"));_e.ROYALBLUE=Object.freeze(_e.fromCssColorString("#4169E1"));_e.SADDLEBROWN=Object.freeze(_e.fromCssColorString("#8B4513"));_e.SALMON=Object.freeze(_e.fromCssColorString("#FA8072"));_e.SANDYBROWN=Object.freeze(_e.fromCssColorString("#F4A460"));_e.SEAGREEN=Object.freeze(_e.fromCssColorString("#2E8B57"));_e.SEASHELL=Object.freeze(_e.fromCssColorString("#FFF5EE"));_e.SIENNA=Object.freeze(_e.fromCssColorString("#A0522D"));_e.SILVER=Object.freeze(_e.fromCssColorString("#C0C0C0"));_e.SKYBLUE=Object.freeze(_e.fromCssColorString("#87CEEB"));_e.SLATEBLUE=Object.freeze(_e.fromCssColorString("#6A5ACD"));_e.SLATEGRAY=Object.freeze(_e.fromCssColorString("#708090"));_e.SLATEGREY=_e.SLATEGRAY;_e.SNOW=Object.freeze(_e.fromCssColorString("#FFFAFA"));_e.SPRINGGREEN=Object.freeze(_e.fromCssColorString("#00FF7F"));_e.STEELBLUE=Object.freeze(_e.fromCssColorString("#4682B4"));_e.TAN=Object.freeze(_e.fromCssColorString("#D2B48C"));_e.TEAL=Object.freeze(_e.fromCssColorString("#008080"));_e.THISTLE=Object.freeze(_e.fromCssColorString("#D8BFD8"));_e.TOMATO=Object.freeze(_e.fromCssColorString("#FF6347"));_e.TURQUOISE=Object.freeze(_e.fromCssColorString("#40E0D0"));_e.VIOLET=Object.freeze(_e.fromCssColorString("#EE82EE"));_e.WHEAT=Object.freeze(_e.fromCssColorString("#F5DEB3"));_e.WHITE=Object.freeze(_e.fromCssColorString("#FFFFFF"));_e.WHITESMOKE=Object.freeze(_e.fromCssColorString("#F5F5F5"));_e.YELLOW=Object.freeze(_e.fromCssColorString("#FFFF00"));_e.YELLOWGREEN=Object.freeze(_e.fromCssColorString("#9ACD32"));_e.TRANSPARENT=Object.freeze(new _e(0,0,0,0));var z=_e;function Ij(e){e=e??H.EMPTY_OBJECT,this.color=e.color,this.depth=e.depth,this.stencil=e.stencil,this.renderState=e.renderState,this.framebuffer=e.framebuffer,this.owner=e.owner,this.pass=e.pass}Ij.ALL=Object.freeze(new Ij({color:new z(0,0,0,0),depth:1,stencil:0}));Ij.prototype.execute=function(e,t){e.clear(this,t)};var li=Ij;var yue={ENVIRONMENT:0,COMPUTE:1,GLOBE:2,TERRAIN_CLASSIFICATION:3,CESIUM_3D_TILE_EDGES:4,CESIUM_3D_TILE_PLANAR_FILL_ID:5,CESIUM_3D_TILE:6,CESIUM_3D_TILE_CLASSIFICATION:7,CESIUM_3D_TILE_CLASSIFICATION_IGNORE_SHOW:8,OPAQUE:9,TRANSLUCENT:10,VOXELS:11,GAUSSIAN_SPLATS:12,CESIUM_3D_TILE_EDGES_DIRECT:13,OVERLAY:14,NUMBER_OF_PASSES:15};Object.freeze(yue);var Ie=yue;function Aue(e){e=e??H.EMPTY_OBJECT,this.vertexArray=e.vertexArray,this.fragmentShaderSource=e.fragmentShaderSource,this.shaderProgram=e.shaderProgram,this.uniformMap=e.uniformMap,this.outputTexture=e.outputTexture,this.preExecute=e.preExecute,this.postExecute=e.postExecute,this.canceled=e.canceled,this.persists=e.persists??!1,this.pass=Ie.COMPUTE,this.owner=e.owner}Aue.prototype.execute=function(e){e.execute(this)};var xf=Aue;var ps=class e{constructor(t,n){this.x=t??0,this.y=n??0}static fromElements(t,n,i){return l(i)?(i.x=t,i.y=n,i):new e(t,n)}static clone(t,n){if(l(t))return l(n)?(n.x=t.x,n.y=t.y,n):new e(t.x,t.y)}static pack(t,n,i){return i=i??0,n[i++]=t.x,n[i]=t.y,n}static unpack(t,n,i){return n=n??0,l(i)||(i=new e),i.x=t[n++],i.y=t[n],i}static packArray(t,n){let i=t.length,r=i*2;l(n)?!Array.isArray(n)&&n.length!==r||n.length!==r&&(n.length=r):n=new Array(r);for(let o=0;o<i;++o)e.pack(t[o],n,o*2);return n}static unpackArray(t,n){let i=t.length;l(n)?n.length=i/2:n=new Array(i/2);for(let r=0;r<i;r+=2){let o=r/2;n[o]=e.unpack(t,r,n[o])}return n}static maximumComponent(t){return Math.max(t.x,t.y)}static minimumComponent(t){return Math.min(t.x,t.y)}static minimumByComponent(t,n,i){return i.x=Math.min(t.x,n.x),i.y=Math.min(t.y,n.y),i}static maximumByComponent(t,n,i){return i.x=Math.max(t.x,n.x),i.y=Math.max(t.y,n.y),i}static clamp(t,n,i,r){let o=D.clamp(t.x,n.x,i.x),s=D.clamp(t.y,n.y,i.y);return r.x=o,r.y=s,r}static magnitudeSquared(t){return t.x*t.x+t.y*t.y}static magnitude(t){return Math.sqrt(e.magnitudeSquared(t))}static distance(t,n){return e.subtract(t,n,Pj),e.magnitude(Pj)}static distanceSquared(t,n){return e.subtract(t,n,Pj),e.magnitudeSquared(Pj)}static normalize(t,n){let i=e.magnitude(t);return n.x=t.x/i,n.y=t.y/i,n}static dot(t,n){return t.x*n.x+t.y*n.y}static cross(t,n){return t.x*n.y-t.y*n.x}static multiplyComponents(t,n,i){return i.x=t.x*n.x,i.y=t.y*n.y,i}static divideComponents(t,n,i){return i.x=t.x/n.x,i.y=t.y/n.y,i}static add(t,n,i){return i.x=t.x+n.x,i.y=t.y+n.y,i}static subtract(t,n,i){return i.x=t.x-n.x,i.y=t.y-n.y,i}static multiplyByScalar(t,n,i){return i.x=t.x*n,i.y=t.y*n,i}static divideByScalar(t,n,i){return i.x=t.x/n,i.y=t.y/n,i}static negate(t,n){return n.x=-t.x,n.y=-t.y,n}static abs(t,n){return n.x=Math.abs(t.x),n.y=Math.abs(t.y),n}static lerp(t,n,i,r){return e.multiplyByScalar(n,i,bue),r=e.multiplyByScalar(t,1-i,r),e.add(bue,r,r)}static angleBetween(t,n){return e.normalize(t,xue),e.normalize(n,Tue),D.acosClamped(e.dot(xue,Tue))}static mostOrthogonalAxis(t,n){let i=e.normalize(t,xUe);return e.abs(i,i),i.x<=i.y?n=e.clone(e.UNIT_X,n):n=e.clone(e.UNIT_Y,n),n}static equals(t,n){return t===n||l(t)&&l(n)&&t.x===n.x&&t.y===n.y}static equalsArray(t,n,i){return t.x===n[i]&&t.y===n[i+1]}static equalsEpsilon(t,n,i,r){return t===n||l(t)&&l(n)&&D.equalsEpsilon(t.x,n.x,i,r)&&D.equalsEpsilon(t.y,n.y,i,r)}clone(t){return e.clone(this,t)}equals(t){return e.equals(this,t)}equalsEpsilon(t,n,i){return e.equalsEpsilon(this,t,n,i)}toString(){return`(${this.x}, ${this.y})`}};ps.fromCartesian3=ps.clone;ps.fromCartesian4=ps.clone;ps.packedLength=2;ps.fromArray=ps.unpack;var Pj=new ps,bue=new ps,xue=new ps,Tue=new ps,xUe=new ps;ps.ZERO=Object.freeze(new ps(0,0));ps.ONE=Object.freeze(new ps(1,1));ps.UNIT_X=Object.freeze(new ps(1,0));ps.UNIT_Y=Object.freeze(new ps(0,1));var U=ps;var TUe=new h,EUe=new h;function CUe(e,t,n,i,r){let o=e.x,s=e.y,a=e.z,c=t.x,u=t.y,f=t.z,d=o*o*c*c,p=s*s*u*u,g=a*a*f*f,m=d+p+g,y=Math.sqrt(1/m),A=h.multiplyByScalar(e,y,TUe);if(m<i)return isFinite(y)?h.clone(A,r):void 0;let b=n.x,x=n.y,T=n.z,E=EUe;E.x=A.x*b*2,E.y=A.y*x*2,E.z=A.z*T*2;let v=(1-y)*h.magnitude(e)/(.5*h.magnitude(E)),S=0,I,R,O,L,_,C,w,P,M,F,V;do{v-=S,O=1/(1+v*b),L=1/(1+v*x),_=1/(1+v*T),C=O*O,w=L*L,P=_*_,M=C*O,F=w*L,V=P*_,I=d*C+p*w+g*P-1,R=d*M*b+p*F*x+g*V*T;let B=-2*R;S=I/B}while(Math.abs(I)>D.EPSILON12);return l(r)?(r.x=o*O,r.y=s*L,r.z=a*_,r):new h(o*O,s*L,a*_)}var tx=CUe;var Fl=class Fl{constructor(t,n,i){this.longitude=t??0,this.latitude=n??0,this.height=i??0}static fromRadians(t,n,i,r){return i=i??0,l(r)?(r.longitude=t,r.latitude=n,r.height=i,r):new Fl(t,n,i)}static fromDegrees(t,n,i,r){return t=D.toRadians(t),n=D.toRadians(n),Fl.fromRadians(t,n,i,r)}static fromCartesian(t,n,i){let r=l(n)?n.oneOverRadii:Fl._ellipsoidOneOverRadii,o=l(n)?n.oneOverRadiiSquared:Fl._ellipsoidOneOverRadiiSquared,s=l(n)?n._centerToleranceSquared:Fl._ellipsoidCenterToleranceSquared,a=tx(t,r,o,s,SUe);if(!l(a))return;let c=h.multiplyComponents(a,o,vUe);c=h.normalize(c,c);let u=h.subtract(t,a,wUe),f=Math.atan2(c.y,c.x),d=Math.asin(c.z),p=D.sign(h.dot(u,t))*h.magnitude(u);return l(i)?(i.longitude=f,i.latitude=d,i.height=p,i):new Fl(f,d,p)}static toCartesian(t,n,i){return h.fromRadians(t.longitude,t.latitude,t.height,n,i)}static clone(t,n){if(l(t))return l(n)?(n.longitude=t.longitude,n.latitude=t.latitude,n.height=t.height,n):new Fl(t.longitude,t.latitude,t.height)}static equals(t,n){return t===n||l(t)&&l(n)&&t.longitude===n.longitude&&t.latitude===n.latitude&&t.height===n.height}static equalsEpsilon(t,n,i){return i=i??0,t===n||l(t)&&l(n)&&Math.abs(t.longitude-n.longitude)<=i&&Math.abs(t.latitude-n.latitude)<=i&&Math.abs(t.height-n.height)<=i}clone(t){return Fl.clone(this,t)}equals(t){return Fl.equals(this,t)}equalsEpsilon(t,n){return Fl.equalsEpsilon(this,t,n)}toString(){return`(${this.longitude}, ${this.latitude}, ${this.height})`}};ut(Fl,"_ellipsoidOneOverRadii",new h(1/6378137,1/6378137,1/6356752314245179e-9)),ut(Fl,"_ellipsoidOneOverRadiiSquared",new h(1/(6378137*6378137),1/(6378137*6378137),1/(6356752314245179e-9*6356752314245179e-9))),ut(Fl,"_ellipsoidCenterToleranceSquared",D.EPSILON1);var aD=Fl;aD.ZERO=Object.freeze(new aD(0,0,0));var vUe=new h,SUe=new h,wUe=new h,he=aD;function Eue(e,t,n,i){t=t??0,n=n??0,i=i??0,e._radii=new h(t,n,i),e._radiiSquared=new h(t*t,n*n,i*i),e._radiiToTheFourth=new h(t*t*t*t,n*n*n*n,i*i*i*i),e._oneOverRadii=new h(t===0?0:1/t,n===0?0:1/n,i===0?0:1/i),e._oneOverRadiiSquared=new h(t===0?0:1/(t*t),n===0?0:1/(n*n),i===0?0:1/(i*i)),e._minimumRadius=Math.min(t,n,i),e._maximumRadius=Math.max(t,n,i),e._centerToleranceSquared=D.EPSILON1,e._radiiSquared.z!==0&&(e._squaredXOverSquaredZ=e._radiiSquared.x/e._radiiSquared.z)}var Bl=class e{constructor(t,n,i){this._radii=void 0,this._radiiSquared=void 0,this._radiiToTheFourth=void 0,this._oneOverRadii=void 0,this._oneOverRadiiSquared=void 0,this._minimumRadius=void 0,this._maximumRadius=void 0,this._centerToleranceSquared=void 0,this._squaredXOverSquaredZ=void 0,Eue(this,t,n,i)}get radii(){return this._radii}get radiiSquared(){return this._radiiSquared}get radiiToTheFourth(){return this._radiiToTheFourth}get oneOverRadii(){return this._oneOverRadii}get oneOverRadiiSquared(){return this._oneOverRadiiSquared}get minimumRadius(){return this._minimumRadius}get maximumRadius(){return this._maximumRadius}static clone(t,n){if(!l(t))return;let i=t._radii;return l(n)?(h.clone(i,n._radii),h.clone(t._radiiSquared,n._radiiSquared),h.clone(t._radiiToTheFourth,n._radiiToTheFourth),h.clone(t._oneOverRadii,n._oneOverRadii),h.clone(t._oneOverRadiiSquared,n._oneOverRadiiSquared),n._minimumRadius=t._minimumRadius,n._maximumRadius=t._maximumRadius,n._centerToleranceSquared=t._centerToleranceSquared,n):new e(i.x,i.y,i.z)}static fromCartesian3(t,n){return l(n)||(n=new e),l(t)&&Eue(n,t.x,t.y,t.z),n}static get default(){return e._default}static set default(t){e._default=t,h._ellipsoidRadiiSquared=t.radiiSquared,he._ellipsoidOneOverRadii=t.oneOverRadii,he._ellipsoidOneOverRadiiSquared=t.oneOverRadiiSquared,he._ellipsoidCenterToleranceSquared=t._centerToleranceSquared}clone(t){return e.clone(this,t)}static pack(t,n,i){return i=i??0,h.pack(t._radii,n,i),n}static unpack(t,n,i){n=n??0;let r=h.unpack(t,n);return e.fromCartesian3(r,i)}geodeticSurfaceNormalCartographic(t,n){let i=t.longitude,r=t.latitude,o=Math.cos(r),s=o*Math.cos(i),a=o*Math.sin(i),c=Math.sin(r);return l(n)||(n=new h),n.x=s,n.y=a,n.z=c,h.normalize(n,n)}geodeticSurfaceNormal(t,n){if(!h.equalsEpsilon(t,h.ZERO,D.EPSILON14))return l(n)||(n=new h),n=h.multiplyComponents(t,this._oneOverRadiiSquared,n),h.normalize(n,n)}cartographicToCartesian(t,n){let i=IUe,r=PUe;this.geodeticSurfaceNormalCartographic(t,i),h.multiplyComponents(this._radiiSquared,i,r);let o=Math.sqrt(h.dot(i,r));return h.divideByScalar(r,o,r),h.multiplyByScalar(i,t.height,i),l(n)||(n=new h),h.add(r,i,n)}cartographicArrayToCartesianArray(t,n){let i=t.length;l(n)?n.length=i:n=new Array(i);for(let r=0;r<i;r++)n[r]=this.cartographicToCartesian(t[r],n[r]);return n}cartesianToCartographic(t,n){let i=this.scaleToGeodeticSurface(t,RUe);if(!l(i))return;let r=this.geodeticSurfaceNormal(i,DUe),o=h.subtract(t,i,OUe),s=Math.atan2(r.y,r.x),a=Math.asin(r.z),c=D.sign(h.dot(o,t))*h.magnitude(o);return l(n)?(n.longitude=s,n.latitude=a,n.height=c,n):new he(s,a,c)}cartesianArrayToCartographicArray(t,n){let i=t.length;l(n)?n.length=i:n=new Array(i);for(let r=0;r<i;++r)n[r]=this.cartesianToCartographic(t[r],n[r]);return n}scaleToGeodeticSurface(t,n){return tx(t,this._oneOverRadii,this._oneOverRadiiSquared,this._centerToleranceSquared,n)}scaleToGeocentricSurface(t,n){l(n)||(n=new h);let i=t.x,r=t.y,o=t.z,s=this._oneOverRadiiSquared,a=1/Math.sqrt(i*i*s.x+r*r*s.y+o*o*s.z);return h.multiplyByScalar(t,a,n)}transformPositionToScaledSpace(t,n){return l(n)||(n=new h),h.multiplyComponents(t,this._oneOverRadii,n)}transformPositionFromScaledSpace(t,n){return l(n)||(n=new h),h.multiplyComponents(t,this._radii,n)}equals(t){return this===t||l(t)&&h.equals(this._radii,t._radii)}toString(){return this._radii.toString()}getSurfaceNormalIntersectionWithZAxis(t,n,i){n=n??0;let r=this._squaredXOverSquaredZ;if(l(i)||(i=new h),i.x=0,i.y=0,i.z=t.z*(1-r),!(Math.abs(i.z)>=this._radii.z-n))return i}getLocalCurvature(t,n){l(n)||(n=new U);let i=this.getSurfaceNormalIntersectionWithZAxis(t,0,MUe),r=h.distance(t,i),o=this.minimumRadius*r/this.maximumRadius**2,s=r*o**2;return U.fromElements(1/r,1/s,n)}surfaceArea(t){let n=t.west,i=t.east,r=t.south,o=t.north;for(;i<n;)i+=D.TWO_PI;let s=this._radiiSquared,a=s.x,c=s.y,u=s.z,f=a*c;return Cue(r,o,function(d){let p=Math.cos(d),g=Math.sin(d);return Math.cos(d)*Cue(n,i,function(m){let y=Math.cos(m),A=Math.sin(m);return Math.sqrt(f*g*g+u*(c*y*y+a*A*A)*p*p)})})}};Bl.WGS84=Object.freeze(new Bl(6378137,6378137,6356752314245179e-9));Bl.UNIT_SPHERE=Object.freeze(new Bl(1,1,1));Bl.MOON=Object.freeze(new Bl(D.LUNAR_RADIUS,D.LUNAR_RADIUS,D.LUNAR_RADIUS));Bl.MARS=Object.freeze(new Bl(3396190,3396190,3376200));Bl._default=Bl.WGS84;Bl.packedLength=h.packedLength;Bl.prototype.geocentricSurfaceNormal=h.normalize;var IUe=new h,PUe=new h,DUe=new h,RUe=new h,OUe=new h,MUe=new h,NUe=[.14887433898163,.43339539412925,.67940956829902,.86506336668898,.97390652851717,0],LUe=[.29552422471475,.26926671930999,.21908636251598,.14945134915058,.066671344308684,0];function Cue(e,t,n){let i=.5*(t+e),r=.5*(t-e),o=0;for(let s=0;s<5;s++){let a=r*NUe[s];o+=LUe[s]*(n(i+a)+n(i-a))}return o*=r,o}var ee=Bl;var $q=class{constructor(t){this._ellipsoid=t??ee.default,this._semimajorAxis=this._ellipsoid.maximumRadius,this._oneOverSemimajorAxis=1/this._semimajorAxis}get ellipsoid(){return this._ellipsoid}project(t,n){let i=this._semimajorAxis,r=t.longitude*i,o=t.latitude*i,s=t.height;return l(n)?(n.x=r,n.y=o,n.z=s,n):new h(r,o,s)}unproject(t,n){let i=this._oneOverSemimajorAxis,r=t.x*i,o=t.y*i,s=t.z;return l(n)?(n.longitude=r,n.latitude=o,n.height=s,n):new he(r,o,s)}},Ui=$q;var vue={OUTSIDE:-1,INTERSECTING:0,INSIDE:1};Object.freeze(vue);var $t=vue;function FUe(e,t,n){let i=0,r=e.length-1,o,s;for(;i<=r;){if(o=~~((i+r)/2),s=n(e[o],t),s<0){i=o+1;continue}if(s>0){r=o-1;continue}return o}return~(r+1)}var vr=FUe;function BUe(e,t,n,i,r){this.xPoleWander=e,this.yPoleWander=t,this.xPoleOffset=n,this.yPoleOffset=i,this.ut1MinusUtc=r}var wy=BUe;function kUe(e){return e%4===0&&e%100!==0||e%400===0}var kl=kUe;var Sue=[31,28,31,30,31,30,31,31,30,31,30,31];function UUe(e,t,n,i,r,o,s,a){e=e??1,t=t??1,n=n??1,i=i??0,r=r??0,o=o??0,s=s??0,a=a??!1,this.year=e,this.month=t,this.day=n,this.hour=i,this.minute=r,this.second=o,this.millisecond=s,this.isLeapSecond=a;function y(){Wr.typeOf.number.greaterThanOrEquals("Year",e,1),Wr.typeOf.number.lessThanOrEquals("Year",e,9999),Wr.typeOf.number.greaterThanOrEquals("Month",t,1),Wr.typeOf.number.lessThanOrEquals("Month",t,12),Wr.typeOf.number.greaterThanOrEquals("Day",n,1),Wr.typeOf.number.lessThanOrEquals("Day",n,31),Wr.typeOf.number.greaterThanOrEquals("Hour",i,0),Wr.typeOf.number.lessThanOrEquals("Hour",i,23),Wr.typeOf.number.greaterThanOrEquals("Minute",r,0),Wr.typeOf.number.lessThanOrEquals("Minute",r,59),Wr.typeOf.bool("IsLeapSecond",a),Wr.typeOf.number.greaterThanOrEquals("Second",o,0),Wr.typeOf.number.lessThanOrEquals("Second",o,a?60:59),Wr.typeOf.number.greaterThanOrEquals("Millisecond",s,0),Wr.typeOf.number.lessThan("Millisecond",s,1e3)}function A(){let b=t===2&&kl(e)?Sue[t-1]+1:Sue[t-1];if(n>b)throw new pe("Month and Day represents invalid date")}}var Bh=UUe;function zUe(e,t){this.julianDate=e,this.offset=t}var yr=zUe;var wue={SECONDS_PER_MILLISECOND:.001,SECONDS_PER_MINUTE:60,MINUTES_PER_HOUR:60,HOURS_PER_DAY:24,SECONDS_PER_HOUR:3600,MINUTES_PER_DAY:1440,SECONDS_PER_DAY:86400,DAYS_PER_JULIAN_CENTURY:36525,PICOSECOND:1e-9,MODIFIED_JULIAN_DATE_DIFFERENCE:24000005e-1};Object.freeze(wue);var kn=wue;var Iue={UTC:0,TAI:1};Object.freeze(Iue);var si=Iue;var Pue=new Bh,Rj=[31,28,31,30,31,30,31,31,30,31,30,31],Oj=29;function Zq(e,t){return mi.compare(e.julianDate,t.julianDate)}var av=new yr;function Mj(e){av.julianDate=e;let t=mi.leapSeconds,n=vr(t,av,Zq);n<0&&(n=~n),n>=t.length&&(n=t.length-1);let i=t[n].offset;n>0&&mi.secondsDifference(t[n].julianDate,e)>i&&(n--,i=t[n].offset),mi.addSeconds(e,i,e)}function Due(e,t){av.julianDate=e;let n=mi.leapSeconds,i=vr(n,av,Zq);if(i<0&&(i=~i),i===0)return mi.addSeconds(e,-n[0].offset,t);if(i>=n.length)return mi.addSeconds(e,-n[i-1].offset,t);let r=mi.secondsDifference(n[i].julianDate,e);if(r===0)return mi.addSeconds(e,-n[i].offset,t);if(!(r<=1))return mi.addSeconds(e,-n[i-1].offset,t)}function Iy(e,t,n){let i=t/kn.SECONDS_PER_DAY|0;return e+=i,t-=kn.SECONDS_PER_DAY*i,t<0&&(e--,t+=kn.SECONDS_PER_DAY),n.dayNumber=e,n.secondsOfDay=t,n}function Jq(e,t,n,i,r,o,s){let a=(t-14)/12|0,c=e+4800+a,u=(1461*c/4|0)+(367*(t-2-12*a)/12|0)-(3*((c+100)/100|0)/4|0)+n-32075;i=i-12,i<0&&(i+=24);let f=o+(i*kn.SECONDS_PER_HOUR+r*kn.SECONDS_PER_MINUTE+s*kn.SECONDS_PER_MILLISECOND);return f>=43200&&(u-=1),[u,f]}var VUe=/^(\d{4})$/,jUe=/^(\d{4})-(\d{2})$/,HUe=/^(\d{4})-?(\d{3})$/,GUe=/^(\d{4})-?W(\d{2})-?(\d{1})?$/,WUe=/^(\d{4})-?(\d{2})-?(\d{2})$/,Qq=/([Z+\-])?(\d{2})?:?(\d{2})?$/,qUe=/^(\d{2})(\.\d+)?/.source+Qq.source,YUe=/^(\d{2}):?(\d{2})(\.\d+)?/.source+Qq.source,XUe=/^(\d{2}):?(\d{2}):?(\d{2})(\.\d+)?/.source+Qq.source;var Py={year:0,month:0,day:0,hour:0,minute:0,second:0,millisecond:0},KUe=[1,10,100,1e3,1e4,1e5,1e6,1e7,1e8,1e9,1e10,1e11,1e12,1e13,1e14,1e15];function ig(e,t){let n=e.charCodeAt(t)-48,i=e.charCodeAt(t+1)-48;return n<0||n>9||i<0||i>9?-1:n*10+i}var Rue=NaN,Oue=0;function Mue(e,t,n,i,r,o,s){Py.year=e,Py.month=t,Py.day=n,Py.hour=i,Py.minute=r,Py.second=o,Py.millisecond=s}function $Ue(e){let t=e.length;if(t===4){let m=ig(e,0),y=ig(e,2);return m<0||y<0?!1:(Mue(m*100+y,1,1,0,0,0,0),!0)}let n=e.charCodeAt(t-1)===90,i=n?t-1:t;if(i<19||e.charCodeAt(4)!==45||e.charCodeAt(7)!==45||e.charCodeAt(10)!==84||e.charCodeAt(13)!==58||e.charCodeAt(16)!==58)return!1;let r=ig(e,0),o=ig(e,2),s=ig(e,5),a=ig(e,8),c=ig(e,11),u=ig(e,14),f=ig(e,17);if(r<0||o<0||s<1||s>12||a<1||a>31||c<0||c>23||u<0||u>59||f<0||f>60)return!1;let d=0;if(i>19){let m=e.charCodeAt(19),y=i-20;if(m!==46&&m!==44||y<1||y>15)return!1;let A=0;for(let b=20;b<i;b++){let x=e.charCodeAt(b)-48;if(x<0||x>9)return!1;A=A*10+x}d=A/KUe[y]*1e3}let p=r*100+o,g=kl(p);if((s!==2||!g?Rj[s-1]:Oj)<a)return!1;if(!n){let m=Date.UTC(p,s-1,a,c,u);m!==Rue&&(Rue=m,Oue=new Date(m).getTimezoneOffset()),u=u+Oue}return Mue(p,s,a,c,u,f,d),!0}function Nue(e,t,n,i,r,o,s,a,c){let u,f=o===60;for(f&&o--;r>=60;)r-=60,i++;for(;i>=24;)i-=24,n++;for(u=a&&t===2?Oj:Rj[t-1];n>u;)n-=u,t++,t>12&&(t-=12,e++),u=a&&t===2?Oj:Rj[t-1];for(;r<0;)r+=60,i--;for(;i<0;)i+=24,n--;for(;n<1;)t--,t<1&&(t+=12,e--),u=a&&t===2?Oj:Rj[t-1],n+=u;let d=Jq(e,t,n,i,r,o,s);return l(c)?(Iy(d[0],d[1],c),Mj(c)):c=new mi(d[0],d[1],si.UTC),f&&mi.addSeconds(c,1,c),c}var mi=class e{constructor(t,n,i){this.dayNumber=void 0,this.secondsOfDay=void 0,t=t??0,n=n??0,i=i??si.UTC;let r=t|0;n=n+(t-r)*kn.SECONDS_PER_DAY,Iy(r,n,this),i===si.UTC&&Mj(this)}static fromGregorianDate(t,n){let i=Jq(t.year,t.month,t.day,t.hour,t.minute,t.second,t.millisecond);return l(n)?(Iy(i[0],i[1],n),Mj(n),n):new e(i[0],i[1],si.UTC)}static fromDate(t,n){let i=Jq(t.getUTCFullYear(),t.getUTCMonth()+1,t.getUTCDate(),t.getUTCHours(),t.getUTCMinutes(),t.getUTCSeconds(),t.getUTCMilliseconds());return l(n)?(Iy(i[0],i[1],n),Mj(n),n):new e(i[0],i[1],si.UTC)}static fromIso8601(t,n){if($Ue(t)){let A=Py;return Nue(A.year,A.month,A.day,A.hour,A.minute,A.second,A.millisecond,kl(A.year),n)}t=t.replace(",",".");let i=t.split("T"),r,o=1,s=1,a=0,c=0,u=0,f=0,d=i[0],p=i[1],g,m;if(i=d.match(WUe),i!==null)r=+i[1],o=+i[2],s=+i[3];else if(i=d.match(jUe),i!==null)r=+i[1],o=+i[2];else if(i=d.match(VUe),i!==null)r=+i[1];else{let A;if(i=d.match(HUe),i!==null)r=+i[1],A=+i[2],m=kl(r);else if(i=d.match(GUe),i!==null){r=+i[1];let b=+i[2],x=+i[3]||0,T=new Date(Date.UTC(r,0,4));A=b*7+x-T.getUTCDay()-3}g=new Date(Date.UTC(r,0,1)),g.setUTCDate(A),o=g.getUTCMonth()+1,s=g.getUTCDate()}m=kl(r);let y;if(l(p)){i=p.match(XUe),i!==null?(a=+i[1],c=+i[2],u=+i[3],f=+(i[4]||0)*1e3,y=5):(i=p.match(YUe),i!==null?(a=+i[1],c=+i[2],u=+(i[3]||0)*60,y=4):(i=p.match(qUe),i!==null&&(a=+i[1],c=+(i[2]||0)*60,y=3)));let A=i[y],b=+i[y+1],x=+(i[y+2]||0);switch(A){case"+":a=a-b,c=c-x;break;case"-":a=a+b,c=c+x;break;case"Z":break;default:c=c+new Date(Date.UTC(r,o-1,s,a,c)).getTimezoneOffset();break}}return Nue(r,o,s,a,c,u,f,m,n)}static now(t){return e.fromDate(new Date,t)}static toGregorianDate(t,n){let i=!1,r=Due(t,Dj);l(r)||(e.addSeconds(t,-1,Dj),r=Due(Dj,Dj),i=!0);let o=r.dayNumber,s=r.secondsOfDay;s>=43200&&(o+=1);let a=o+68569|0,c=4*a/146097|0;a=a-((146097*c+3)/4|0)|0;let u=4e3*(a+1)/1461001|0;a=a-(1461*u/4|0)+31|0;let f=80*a/2447|0,d=a-(2447*f/80|0)|0;a=f/11|0;let p=f+2-12*a|0,g=100*(c-49)+u+a|0,m=s/kn.SECONDS_PER_HOUR|0,y=s-m*kn.SECONDS_PER_HOUR,A=y/kn.SECONDS_PER_MINUTE|0;y=y-A*kn.SECONDS_PER_MINUTE;let b=y|0,x=(y-b)/kn.SECONDS_PER_MILLISECOND;return m+=12,m>23&&(m-=24),i&&(b+=1),l(n)?(n.year=g,n.month=p,n.day=d,n.hour=m,n.minute=A,n.second=b,n.millisecond=x,n.isLeapSecond=i,n):new Bh(g,p,d,m,A,b,x,i)}static toDate(t){let n=e.toGregorianDate(t,Pue),i=n.second;return n.isLeapSecond&&(i-=1),new Date(Date.UTC(n.year,n.month-1,n.day,n.hour,n.minute,i,n.millisecond))}static toIso8601(t,n){let i=e.toGregorianDate(t,Pue),r=i.year,o=i.month,s=i.day,a=i.hour,c=i.minute,u=i.second,f=i.millisecond;r===1e4&&o===1&&s===1&&a===0&&c===0&&u===0&&f===0&&(r=9999,o=12,s=31,a=24);let d;if(!l(n)&&f!==0){let p=f*.01;return d=p<1e-6?p.toFixed(20).replace(".","").replace(/0+$/,""):p.toString().replace(".",""),`${r.toString().padStart(4,"0")}-${o.toString().padStart(2,"0")}-${s.toString().padStart(2,"0")}T${a.toString().padStart(2,"0")}:${c.toString().padStart(2,"0")}:${u.toString().padStart(2,"0")}.${d}Z`}return!l(n)||n===0?`${r.toString().padStart(4,"0")}-${o.toString().padStart(2,"0")}-${s.toString().padStart(2,"0")}T${a.toString().padStart(2,"0")}:${c.toString().padStart(2,"0")}:${u.toString().padStart(2,"0")}Z`:(d=(f*.01).toFixed(n).replace(".","").slice(0,n),`${r.toString().padStart(4,"0")}-${o.toString().padStart(2,"0")}-${s.toString().padStart(2,"0")}T${a.toString().padStart(2,"0")}:${c.toString().padStart(2,"0")}:${u.toString().padStart(2,"0")}.${d}Z`)}static clone(t,n){if(l(t))return l(n)?(n.dayNumber=t.dayNumber,n.secondsOfDay=t.secondsOfDay,n):new e(t.dayNumber,t.secondsOfDay,si.TAI)}static compare(t,n){let i=t.dayNumber-n.dayNumber;return i!==0?i:t.secondsOfDay-n.secondsOfDay}static equals(t,n){return t===n||l(t)&&l(n)&&t.dayNumber===n.dayNumber&&t.secondsOfDay===n.secondsOfDay}static equalsEpsilon(t,n,i){return i=i??0,t===n||l(t)&&l(n)&&Math.abs(e.secondsDifference(t,n))<=i}static totalDays(t){return t.dayNumber+t.secondsOfDay/kn.SECONDS_PER_DAY}static secondsDifference(t,n){return(t.dayNumber-n.dayNumber)*kn.SECONDS_PER_DAY+(t.secondsOfDay-n.secondsOfDay)}static daysDifference(t,n){let i=t.dayNumber-n.dayNumber,r=(t.secondsOfDay-n.secondsOfDay)/kn.SECONDS_PER_DAY;return i+r}static computeTaiMinusUtc(t){av.julianDate=t;let n=e.leapSeconds,i=vr(n,av,Zq);return i<0&&(i=~i,--i,i<0&&(i=0)),n[i].offset}static addSeconds(t,n,i){return Iy(t.dayNumber,t.secondsOfDay+n,i)}static addMinutes(t,n,i){let r=t.secondsOfDay+n*kn.SECONDS_PER_MINUTE;return Iy(t.dayNumber,r,i)}static addHours(t,n,i){let r=t.secondsOfDay+n*kn.SECONDS_PER_HOUR;return Iy(t.dayNumber,r,i)}static addDays(t,n,i){let r=t.dayNumber+n;return Iy(r,t.secondsOfDay,i)}static lessThan(t,n){return e.compare(t,n)<0}static lessThanOrEquals(t,n){return e.compare(t,n)<=0}static greaterThan(t,n){return e.compare(t,n)>0}static greaterThanOrEquals(t,n){return e.compare(t,n)>=0}clone(t){return e.clone(this,t)}equals(t){return e.equals(this,t)}equalsEpsilon(t,n){return e.equalsEpsilon(this,t,n)}toString(){return e.toIso8601(this)}},Dj=new mi(0,0,si.TAI);mi.leapSeconds=[new yr(new mi(2441317,43210,si.TAI),10),new yr(new mi(2441499,43211,si.TAI),11),new yr(new mi(2441683,43212,si.TAI),12),new yr(new mi(2442048,43213,si.TAI),13),new yr(new mi(2442413,43214,si.TAI),14),new yr(new mi(2442778,43215,si.TAI),15),new yr(new mi(2443144,43216,si.TAI),16),new yr(new mi(2443509,43217,si.TAI),17),new yr(new mi(2443874,43218,si.TAI),18),new yr(new mi(2444239,43219,si.TAI),19),new yr(new mi(2444786,43220,si.TAI),20),new yr(new mi(2445151,43221,si.TAI),21),new yr(new mi(2445516,43222,si.TAI),22),new yr(new mi(2446247,43223,si.TAI),23),new yr(new mi(2447161,43224,si.TAI),24),new yr(new mi(2447892,43225,si.TAI),25),new yr(new mi(2448257,43226,si.TAI),26),new yr(new mi(2448804,43227,si.TAI),27),new yr(new mi(2449169,43228,si.TAI),28),new yr(new mi(2449534,43229,si.TAI),29),new yr(new mi(2450083,43230,si.TAI),30),new yr(new mi(2450630,43231,si.TAI),31),new yr(new mi(2451179,43232,si.TAI),32),new yr(new mi(2453736,43233,si.TAI),33),new yr(new mi(2454832,43234,si.TAI),34),new yr(new mi(2456109,43235,si.TAI),35),new yr(new mi(2457204,43236,si.TAI),36),new yr(new mi(2457754,43237,si.TAI),37)];var K=mi;var tfe=Qo(Tf(),1);function JUe(e){return(e.length===0||e[e.length-1]!=="/")&&(e=`${e}/`),e}var cD=JUe;function Vue(e,t){if(e===null||typeof e!="object")return e;t=t??!1;let n=new e.constructor;for(let i in e)if(e.hasOwnProperty(i)){let r=e[i];t&&(r=Vue(r,t)),n[i]=r}return n}var Je=Vue;function jue(e,t,n){n=n??!1;let i={},r=l(e),o=l(t),s,a,c;if(r)for(s in e)e.hasOwnProperty(s)&&(a=e[s],o&&n&&typeof a=="object"&&t.hasOwnProperty(s)?(c=t[s],typeof c=="object"?i[s]=jue(a,c,n):i[s]=a):i[s]=a);if(o)for(s in t)t.hasOwnProperty(s)&&!i.hasOwnProperty(s)&&(c=t[s],i[s]=c);return i}var Ot=jue;function ZUe(){let e,t,n=new Promise(function(i,r){e=i,t=r});return{resolve:e,reject:t,promise:n}}var Pu=ZUe;var Hue=Qo(Tf(),1);function eY(e,t){let n;return typeof document<"u"&&(n=document),eY._implementation(e,t,n)}eY._implementation=function(e,t,n){if(!l(t)){if(typeof n>"u")return e;t=n.baseURI??n.location.href}let i=new Hue.default(e);return i.scheme()!==""?i.toString():i.absoluteTo(t).toString()};var Cd=eY;var Gue=Qo(Tf(),1);function QUe(e,t){let n="",i=e.lastIndexOf("/");return i!==-1&&(n=e.substring(0,i+1)),t&&(e=new Gue.default(e),e.query().length!==0&&(n+=`?${e.query()}`),e.fragment().length!==0&&(n+=`#${e.fragment()}`)),n}var lD=QUe;var Wue=Qo(Tf(),1);function eze(e){let t=new Wue.default(e);t.normalize();let n=t.path(),i=n.lastIndexOf("/");return i!==-1&&(n=n.substr(i+1)),i=n.lastIndexOf("."),i===-1?n="":n=n.substr(i+1),n}var rg=eze;var que={};function tze(e,t,n){l(t)||(t=e.width),l(n)||(n=e.height);let i=que[t];l(i)||(i={},que[t]=i);let r=i[n];if(!l(r)){let o=document.createElement("canvas");o.width=t,o.height=n,r=o.getContext("2d",{willReadFrequently:!0}),r.globalCompositeOperation="copy",i[n]=r}return r.drawImage(e,0,0,t,n),r.getImageData(0,0,t,n).data}var kh=tze;var nze=/^blob:/i;function ize(e){return nze.test(e)}var nx=ize;var Sp;function rze(e){l(Sp)||(Sp=document.createElement("a")),Sp.href=window.location.href;let t=Sp.host,n=Sp.protocol;return Sp.href=e,Sp.href=Sp.href,n!==Sp.protocol||t!==Sp.host}var Dy=rze;var oze=/^data:/i;function sze(e){return oze.test(e)}var Uh=sze;function aze(e){let t=document.createElement("script");return t.async=!0,t.src=e,new Promise((n,i)=>{window.crossOriginIsolated&&t.setAttribute("crossorigin","anonymous");let r=document.getElementsByTagName("head")[0];t.onload=function(){t.onload=void 0,r.removeChild(t),n()},t.onerror=function(o){i(o)},r.appendChild(t)})}var ix=aze;function cze(e){let t="";for(let n in e)if(e.hasOwnProperty(n)){let i=e[n],r=`${encodeURIComponent(n)}=`;if(Array.isArray(i))for(let o=0,s=i.length;o<s;++o)t+=`${r+encodeURIComponent(i[o])}&`;else t+=`${r+encodeURIComponent(i)}&`}return t=t.slice(0,-1),t}var rx=cze;function lze(e){let t={};if(e==="")return t;let n=e.replace(/\+/g,"%20").split(/[&;]/);for(let i=0,r=n.length;i<r;++i){let o=n[i].split("="),s=decodeURIComponent(o[0]),a=o[1];l(a)?a=decodeURIComponent(a):a="";let c=t[s];typeof c=="string"?t[s]=[c,a]:Array.isArray(c)?c.push(a):t[s]=a}return t}var Ef=lze;var Yue={UNISSUED:0,ISSUED:1,ACTIVE:2,RECEIVED:3,CANCELLED:4,FAILED:5};Object.freeze(Yue);var Ti=Yue;var Xue={TERRAIN:0,IMAGERY:1,TILES3D:2,OTHER:3};Object.freeze(Xue);var Zs=Xue;function Bj(e){e=e??H.EMPTY_OBJECT;let t=e.throttleByServer??!1,n=e.throttle??!1;this.url=e.url,this.requestFunction=e.requestFunction,this.cancelFunction=e.cancelFunction,this.priorityFunction=e.priorityFunction,this.priority=e.priority??0,this.throttle=n,this.throttleByServer=t,this.type=e.type??Zs.OTHER,this.serverKey=e.serverKey,this.state=Ti.UNISSUED,this.deferred=void 0,this.cancelled=!1}Bj.prototype.cancel=function(){this.cancelled=!0};Bj.prototype.clone=function(e){return l(e)?(e.url=this.url,e.requestFunction=this.requestFunction,e.cancelFunction=this.cancelFunction,e.priorityFunction=this.priorityFunction,e.priority=this.priority,e.throttle=this.throttle,e.throttleByServer=this.throttleByServer,e.type=this.type,e.serverKey=this.serverKey,e.state=Ti.UNISSUED,e.deferred=void 0,e.cancelled=!1,e):new Bj(this)};var wo=Bj;function uze(e){let t={};if(!e)return t;let n=e.split(`\r +`);for(let i=0;i<n.length;++i){let r=n[i],o=r.indexOf(": ");if(o>0){let s=r.substring(0,o),a=r.substring(o+2);t[s]=a}}return t}var uD=uze;function Kue(e,t,n){this.statusCode=e,this.response=t,this.responseHeaders=n,typeof this.responseHeaders=="string"&&(this.responseHeaders=uD(this.responseHeaders))}Kue.prototype.toString=function(){let e="Request has failed.";return l(this.statusCode)&&(e+=` Status Code: ${this.statusCode}`),e};var wp=Kue;var zj=Qo(Tf(),1);function fD(){this._listeners=new Map,this._toRemove=new Map,this._toAdd=new Map,this._invokingListeners=!1,this._listenerCount=0}Object.defineProperties(fD.prototype,{numberOfListeners:{get:function(){return this._listenerCount}}});fD.prototype.addEventListener=function(e,t){let n=this,i=n._invokingListeners?n._toAdd:n._listeners;return nY(this,i,e,t)&&n._listenerCount++,function(){n.removeEventListener(e,t)}};function nY(e,t,n,i){t.has(n)||t.set(n,new Set);let r=t.get(n);return r.has(i)?!1:(r.add(i),!0)}fD.prototype.removeEventListener=function(e,t){let n=tY(this,this._listeners,e,t),i=tY(this,this._toAdd,e,t),r=n||i;return r&&this._listenerCount--,r};function tY(e,t,n,i){let r=t.get(n);if(!r||!r.has(i))return!1;if(e._invokingListeners){if(!nY(e,e._toRemove,n,i))return!1}else r.delete(i),r.size===0&&t.delete(n);return!0}var Uj,kj;function fze(e){Uj.apply(e,kj)}function dze(e,t){l(t)&&(Uj=t,e.forEach(fze))}fD.prototype.raiseEvent=function(){this._invokingListeners=!0;let e=Uj,t=kj;kj=arguments;try{this._listeners.forEach(dze)}finally{Uj=e,kj=t}if(this._invokingListeners=!1,this._toAdd.size>0){for(let[n,i]of this._toAdd.entries())for(let r of i)nY(this,this._listeners,n,r);this._toAdd.clear()}if(this._toRemove.size>0){for(let[n,i]of this._toRemove.entries())for(let r of i)tY(this,this._listeners,n,r);this._toRemove.clear()}};var be=fD;function ox(e){this._comparator=e.comparator,this._array=[],this._length=0,this._maximumLength=void 0}Object.defineProperties(ox.prototype,{length:{get:function(){return this._length}},internalArray:{get:function(){return this._array}},maximumLength:{get:function(){return this._maximumLength},set:function(e){let t=this._length;if(e<t){let n=this._array;for(let i=e;i<t;++i)n[i]=void 0;this._length=e,n.length=e}this._maximumLength=e}},comparator:{get:function(){return this._comparator}}});function iY(e,t,n){let i=e[t];e[t]=e[n],e[n]=i}ox.prototype.reserve=function(e){e=e??this._length,this._array.length=e};ox.prototype.heapify=function(e){e=e??0;let t=this._length,n=this._comparator,i=this._array,r,o=!0;for(;o;){let s=2*(e+1),a=s-1;a<t&&n(i[a],i[e])<0?r=a:r=e,s<t&&n(i[s],i[r])<0&&(r=s),r!==e?(iY(i,r,e),e=r):o=!1}};ox.prototype.resort=function(){let e=this._length;for(let t=Math.ceil(e/2);t>=0;--t)this.heapify(t)};ox.prototype.insert=function(e){let t=this._array,n=this._comparator,i=this._maximumLength,r=this._length++;for(r<t.length?t[r]=e:t.push(e);r!==0;){let s=Math.floor((r-1)/2);if(n(t[r],t[s])<0)iY(t,r,s),r=s;else break}let o;return l(i)&&this._length>i&&(o=t[i],this._length=i),o};ox.prototype.pop=function(e){if(e=e??0,this._length===0)return;let t=this._array,n=t[e];return iY(t,e,--this._length),this.heapify(e),t[this._length]=void 0,n};var dD=ox;function hze(e,t){return e.priority-t.priority}var Sr={numberOfAttemptedRequests:0,numberOfActiveRequests:0,numberOfCancelledRequests:0,numberOfCancelledActiveRequests:0,numberOfFailedRequests:0,numberOfActiveRequestsEver:0,lastNumberOfActiveRequests:0},uv=20,Xc=new dD({comparator:hze});Xc.maximumLength=uv;Xc.reserve(uv);var Ip=[],og={},mze=typeof document<"u"?new zj.default(document.location.href):new zj.default,Vj=new be;function Io(){}Io.maximumRequests=50;Io.maximumRequestsPerServer=18;Io.requestsByServer={};Io.throttleRequests=!0;Io.debugShowStatistics=!1;Io.requestCompletedEvent=Vj;Object.defineProperties(Io,{statistics:{get:function(){return Sr}},priorityHeapLength:{get:function(){return uv},set:function(e){if(e<uv)for(;Xc.length>e;){let t=Xc.pop();sx(t)}uv=e,Xc.maximumLength=e,Xc.reserve(e)}}});function $ue(e){l(e.priorityFunction)&&(e.priority=e.priorityFunction())}Io.serverHasOpenSlots=function(e,t){t=t??1;let n=Io.requestsByServer[e]??Io.maximumRequestsPerServer;return og[e]+t<=n};Io.heapHasOpenSlots=function(e){return Xc.length+e<=uv};function Jue(e){return e.state===Ti.UNISSUED&&(e.state=Ti.ISSUED,e.deferred=Pu()),e.deferred.promise}function pze(e){return function(t){if(e.state===Ti.CANCELLED)return;let n=e.deferred;--Sr.numberOfActiveRequests,--og[e.serverKey],Vj.raiseEvent(),e.state=Ti.RECEIVED,e.deferred=void 0,n.resolve(t)}}function gze(e){return function(t){e.state!==Ti.CANCELLED&&(++Sr.numberOfFailedRequests,--Sr.numberOfActiveRequests,--og[e.serverKey],Vj.raiseEvent(t),e.state=Ti.FAILED,e.deferred.reject(t))}}function Zue(e){let t=Jue(e);return e.state=Ti.ACTIVE,Ip.push(e),++Sr.numberOfActiveRequests,++Sr.numberOfActiveRequestsEver,++og[e.serverKey],e.requestFunction().then(pze(e)).catch(gze(e)),t}function sx(e){let t=e.state===Ti.ACTIVE;if(e.state=Ti.CANCELLED,++Sr.numberOfCancelledRequests,l(e.deferred)){let n=e.deferred;n.promise.catch(()=>{}),e.deferred=void 0,n.reject(new oe(`Request cancelled: "${e.url}"`))}t&&(--Sr.numberOfActiveRequests,--og[e.serverKey],++Sr.numberOfCancelledActiveRequests),l(e.cancelFunction)&&e.cancelFunction()}Io.update=function(){let e,t,n=0,i=Ip.length;for(e=0;e<i;++e){if(t=Ip[e],t.cancelled&&sx(t),t.state!==Ti.ACTIVE){++n;continue}n>0&&(Ip[e-n]=t)}Ip.length-=n;let r=Xc.internalArray,o=Xc.length;for(e=0;e<o;++e)$ue(r[e]);Xc.resort();let s=Math.max(Io.maximumRequests-Ip.length,0),a=0;for(;a<s&&Xc.length>0;){if(t=Xc.pop(),t.cancelled){sx(t);continue}if(t.throttleByServer&&!Io.serverHasOpenSlots(t.serverKey)){sx(t);continue}Zue(t),++a}_ze()};Io.getServerKey=function(e){let t=new zj.default(e);t.scheme()===""&&(t=t.absoluteTo(mze),t.normalize());let n=t.authority();/:/.test(n)||(n=`${n}:${t.scheme()==="https"?"443":"80"}`);let i=og[n];return l(i)||(og[n]=0),n};Io.request=function(e){if(Uh(e.url)||nx(e.url))return Vj.raiseEvent(),e.state=Ti.RECEIVED,e.requestFunction();if(++Sr.numberOfAttemptedRequests,l(e.serverKey)||(e.serverKey=Io.getServerKey(e.url)),Io.throttleRequests&&e.throttleByServer&&!Io.serverHasOpenSlots(e.serverKey))return;if(!Io.throttleRequests||!e.throttle)return Zue(e);if(Ip.length>=Io.maximumRequests)return;$ue(e);let t=Xc.insert(e);if(l(t)){if(t===e)return;sx(t)}return Jue(e)};function _ze(){Io.debugShowStatistics&&(Sr.numberOfActiveRequests===0&&Sr.lastNumberOfActiveRequests>0&&(Sr.numberOfAttemptedRequests>0&&(console.log(`Number of attempted requests: ${Sr.numberOfAttemptedRequests}`),Sr.numberOfAttemptedRequests=0),Sr.numberOfCancelledRequests>0&&(console.log(`Number of cancelled requests: ${Sr.numberOfCancelledRequests}`),Sr.numberOfCancelledRequests=0),Sr.numberOfCancelledActiveRequests>0&&(console.log(`Number of cancelled active requests: ${Sr.numberOfCancelledActiveRequests}`),Sr.numberOfCancelledActiveRequests=0),Sr.numberOfFailedRequests>0&&(console.log(`Number of failed requests: ${Sr.numberOfFailedRequests}`),Sr.numberOfFailedRequests=0)),Sr.lastNumberOfActiveRequests=Sr.numberOfActiveRequests)}Io.clearForSpecs=function(){for(;Xc.length>0;){let t=Xc.pop();sx(t)}let e=Ip.length;for(let t=0;t<e;++t)sx(Ip[t]);Ip.length=0,og={},Sr.numberOfAttemptedRequests=0,Sr.numberOfActiveRequests=0,Sr.numberOfCancelledRequests=0,Sr.numberOfCancelledActiveRequests=0,Sr.numberOfFailedRequests=0,Sr.numberOfActiveRequestsEver=0,Sr.lastNumberOfActiveRequests=0};Io.numberOfActiveRequestsByServer=function(e){return og[e]};Io.requestHeap=Xc;var Kc=Io;var Que=Qo(Tf(),1);var hD={},fv={};hD.add=function(e,t){let n=`${e.toLowerCase()}:${t}`;l(fv[n])||(fv[n]=!0)};hD.remove=function(e,t){let n=`${e.toLowerCase()}:${t}`;l(fv[n])&&delete fv[n]};function yze(e){let t=new Que.default(e);t.normalize();let n=t.authority();if(n.length!==0){if(t.authority(n),n.indexOf("@")!==-1&&(n=n.split("@")[1]),n.indexOf(":")===-1){let i=t.scheme();if(i.length===0&&(i=window.location.protocol,i=i.substring(0,i.length-1)),i==="http")n+=":80";else if(i==="https")n+=":443";else return}return n}}hD.contains=function(e){let t=yze(e);return!!(l(t)&&l(fv[t]))};hD.clear=function(){fv={}};var dv=hD;var nfe=(function(){try{let e=new XMLHttpRequest;return e.open("GET","#",!0),e.responseType="blob",e.responseType==="blob"}catch{return!1}})();function zt(e){e=e??H.EMPTY_OBJECT,typeof e=="string"&&(e={url:e}),this._url=void 0,this._templateValues=Pp(e.templateValues,{}),this._queryParameters=Pp(e.queryParameters,{}),this.headers=Pp(e.headers,{}),this.request=e.request??new wo,this.proxy=e.proxy,this.retryCallback=e.retryCallback,this.retryAttempts=e.retryAttempts??0,this._retryCount=0,e.parseUrl??!0?this.parseUrl(e.url,!0,!0):this._url=e.url,this._credits=e.credits}function Pp(e,t){return l(e)?Je(e):t}zt.createIfNeeded=function(e){return e instanceof zt?e.getDerivedResource({request:e.request}):typeof e!="string"?e:new zt({url:e})};var hv;zt.supportsImageBitmapOptions=function(){return l(hv)?hv:typeof createImageBitmap!="function"?(hv=Promise.resolve(!1),hv):(hv=zt.fetchBlob({url:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAIAAACQd1PeAAAABGdBTUEAAE4g3rEiDgAAACBjSFJNAAB6JgAAgIQAAPoAAACA6AAAdTAAAOpgAAA6mAAAF3CculE8AAAADElEQVQI12Ng6GAAAAEUAIngE3ZiAAAAAElFTkSuQmCC"}).then(function(t){let n={imageOrientation:"flipY",premultiplyAlpha:"none",colorSpaceConversion:"none"};return Promise.all([createImageBitmap(t,n),createImageBitmap(t)])}).then(function(t){let n=kh(t[0]),i=kh(t[1]);return n[1]!==i[1]}).catch(function(){return!1}),hv)};Object.defineProperties(zt,{isBlobSupported:{get:function(){return nfe}}});Object.defineProperties(zt.prototype,{queryParameters:{get:function(){return this._queryParameters}},templateValues:{get:function(){return this._templateValues}},url:{get:function(){return this.getUrlComponent(!0,!0)},set:function(e){this.parseUrl(e,!1,!1)}},extension:{get:function(){return rg(this._url)}},isDataUri:{get:function(){return Uh(this._url)}},isBlobUri:{get:function(){return nx(this._url)}},isCrossOriginUrl:{get:function(){return Dy(this._url)}},hasHeaders:{get:function(){return Object.keys(this.headers).length>0}},credits:{get:function(){return this._credits}}});zt.prototype.toString=function(){return this.getUrlComponent(!0,!0)};zt.prototype.parseUrl=function(e,t,n,i){let r=new tfe.default(e),o=Aze(r.query());this._queryParameters=t?Hj(o,this.queryParameters,n):o,r.search(""),r.fragment(""),l(i)&&r.scheme()===""&&(r=r.absoluteTo(Cd(i))),this._url=r.toString()};function Aze(e){return e.length===0?{}:e.indexOf("=")===-1?{[e]:void 0}:Ef(e)}function Hj(e,t,n){if(!n)return Ot(e,t);let i=Je(e,!0);for(let r in t)if(t.hasOwnProperty(r)){let o=i[r],s=t[r];l(o)?(Array.isArray(o)||(o=i[r]=[o]),i[r]=o.concat(s)):i[r]=Array.isArray(s)?s.slice():s}return i}zt.prototype.getUrlComponent=function(e,t){if(this.isDataUri)return this._url;let n=this._url;e&&(n=`${n}${bze(this.queryParameters)}`),n=n.replace(/%7B/g,"{").replace(/%7D/g,"}");let i=this._templateValues;return Object.keys(i).length>0&&(n=n.replace(/{(.*?)}/g,function(r,o){let s=i[o];return l(s)?encodeURIComponent(s):r})),t&&l(this.proxy)&&(n=this.proxy.getURL(n)),n};function bze(e){let t=Object.keys(e);return t.length===0?"":t.length===1&&!l(e[t[0]])?`?${t[0]}`:`?${rx(e)}`}zt.prototype.setQueryParameters=function(e,t){t?this._queryParameters=Hj(this._queryParameters,e,!1):this._queryParameters=Hj(e,this._queryParameters,!1)};zt.prototype.appendQueryParameters=function(e){this._queryParameters=Hj(e,this._queryParameters,!0)};zt.prototype.setTemplateValues=function(e,t){t?this._templateValues=Ot(this._templateValues,e):this._templateValues=Ot(e,this._templateValues)};zt.prototype.getDerivedResource=function(e){let t=this.clone();if(t._retryCount=0,l(e.url)){let n=e.preserveQueryParameters??!1;t.parseUrl(e.url,!0,n,this._url)}return l(e.queryParameters)&&(t._queryParameters=Ot(e.queryParameters,t.queryParameters)),l(e.templateValues)&&(t._templateValues=Ot(e.templateValues,t.templateValues)),l(e.headers)&&(t.headers=Ot(e.headers,t.headers)),l(e.proxy)&&(t.proxy=e.proxy),l(e.request)&&(t.request=e.request),l(e.retryCallback)&&(t.retryCallback=e.retryCallback),l(e.retryAttempts)&&(t.retryAttempts=e.retryAttempts),t};zt.prototype.retryOnError=function(e){let t=this.retryCallback;if(typeof t!="function"||this._retryCount>=this.retryAttempts)return Promise.resolve(!1);let n=this;return Promise.resolve(t(this,e)).then(function(i){return++n._retryCount,i})};zt.prototype.clone=function(e){return l(e)?(e._url=this._url,e._queryParameters=Je(this._queryParameters),e._templateValues=Je(this._templateValues),e.headers=Je(this.headers),e.proxy=this.proxy,e.retryCallback=this.retryCallback,e.retryAttempts=this.retryAttempts,e._retryCount=0,e.request=this.request.clone(),e):new zt({url:this._url,queryParameters:this.queryParameters,templateValues:this.templateValues,headers:this.headers,proxy:this.proxy,retryCallback:this.retryCallback,retryAttempts:this.retryAttempts,request:this.request.clone(),parseUrl:!1,credits:l(this.credits)?this.credits.slice():void 0})};zt.prototype.getBaseUri=function(e){return lD(this.getUrlComponent(e),e)};zt.prototype.appendForwardSlash=function(){this._url=cD(this._url)};zt.prototype.fetchArrayBuffer=function(){return this.fetch({responseType:"arraybuffer"})};zt.fetchArrayBuffer=function(e){return new zt(e).fetchArrayBuffer()};zt.prototype.fetchBlob=function(){return this.fetch({responseType:"blob"})};zt.fetchBlob=function(e){return new zt(e).fetchBlob()};zt.prototype.fetchImage=function(e){e=e??H.EMPTY_OBJECT;let t=e.preferImageBitmap??!1,n=e.preferBlob??!1,i=e.flipY??!1,r=e.skipColorSpaceConversion??!1;if(rY(this.request),!nfe||this.isDataUri||this.isBlobUri||!this.hasHeaders&&!n)return this._fetchImage({resource:this,flipY:i,skipColorSpaceConversion:r,preferImageBitmap:t});let o=this.fetchBlob();if(!l(o))return;let s,a,c,u;return zt.supportsImageBitmapOptions().then(function(f){return s=f,a=s&&t,o}).then(function(f){if(!l(f))return;if(u=f,a)return zt.createImageBitmapFromBlob(f,{flipY:i,premultiplyAlpha:!1,skipColorSpaceConversion:r});let d=window.URL.createObjectURL(f);return c=new zt({url:d}),c._fetchImage({flipY:i,skipColorSpaceConversion:r,preferImageBitmap:!1})}).then(function(f){if(l(f))return f.blob=u,a||window.URL.revokeObjectURL(c.url),f}).catch(function(f){return l(c)&&window.URL.revokeObjectURL(c.url),f.blob=u,Promise.reject(f)})};zt.prototype._fetchImage=function(e){let t=this,n=e.flipY,i=e.skipColorSpaceConversion,r=e.preferImageBitmap,o=t.request;o.url=t.url,o.requestFunction=function(){let a=!1;!t.isDataUri&&!t.isBlobUri&&(a=t.isCrossOriginUrl);let c=Pu();return zt._Implementations.createImage(o,a,c,n,i,r),c.promise};let s=Kc.request(o);if(l(s))return s.catch(function(a){return o.state!==Ti.FAILED?Promise.reject(a):t.retryOnError(a).then(function(c){return c?(o.state=Ti.UNISSUED,o.deferred=void 0,t._fetchImage({flipY:n,skipColorSpaceConversion:i,preferImageBitmap:r})):Promise.reject(a)})})};zt.fetchImage=function(e){return new zt(e).fetchImage({flipY:e.flipY,skipColorSpaceConversion:e.skipColorSpaceConversion,preferBlob:e.preferBlob,preferImageBitmap:e.preferImageBitmap})};zt.prototype.fetchText=function(){return this.fetch({responseType:"text"})};zt.fetchText=function(e){return new zt(e).fetchText()};zt.prototype.fetchJson=function(){let e=this.fetch({responseType:"text",headers:{Accept:"application/json,*/*;q=0.01"}});if(l(e))return e.then(function(t){if(l(t))return JSON.parse(t)})};zt.fetchJson=function(e){return new zt(e).fetchJson()};zt.prototype.fetchXML=function(){return this.fetch({responseType:"document",overrideMimeType:"text/xml"})};zt.fetchXML=function(e){return new zt(e).fetchXML()};zt.prototype.fetchJsonp=function(e){e=e??"callback",rY(this.request);let t;do t=`loadJsonp${D.nextRandomNumber().toString().substring(2,8)}`;while(l(window[t]));return ife(this,e,t)};function ife(e,t,n){let i={};i[t]=n,e.setQueryParameters(i);let r=e.request,o=e.url;r.url=o,r.requestFunction=function(){let a=Pu();return window[n]=function(c){a.resolve(c);try{delete window[n]}catch{window[n]=void 0}},zt._Implementations.loadAndExecuteScript(o,n,a),a.promise};let s=Kc.request(r);if(l(s))return s.catch(function(a){return r.state!==Ti.FAILED?Promise.reject(a):e.retryOnError(a).then(function(c){return c?(r.state=Ti.UNISSUED,r.deferred=void 0,ife(e,t,n)):Promise.reject(a)})})}zt.fetchJsonp=function(e){return new zt(e).fetchJsonp(e.callbackParameterName)};zt.prototype._makeRequest=function(e){let t=this;rY(t.request);let n=t.request,i=t.url;n.url=i,n.requestFunction=function(){let o=e.responseType,s=Ot(e.headers,t.headers),a=e.overrideMimeType,c=e.method,u=e.data,f=Pu(),d=zt._Implementations.loadWithXhr(i,o,c,u,s,f,a);return l(d)&&l(d.abort)&&(n.cancelFunction=function(){d.abort()}),f.promise};let r=Kc.request(n);if(l(r))return r.then(function(o){return n.cancelFunction=void 0,o}).catch(function(o){return n.cancelFunction=void 0,n.state!==Ti.FAILED?Promise.reject(o):t.retryOnError(o).then(function(s){return s?(n.state=Ti.UNISSUED,n.deferred=void 0,t.fetch(e)):Promise.reject(o)})})};function rY(e){if(e.state===Ti.ISSUED||e.state===Ti.ACTIVE)throw new oe("The Resource is already being fetched.");e.state=Ti.UNISSUED,e.deferred=void 0}var xze=/^data:(.*?)(;base64)?,(.*)$/;function jj(e,t){let n=decodeURIComponent(t);return e?atob(n):n}function efe(e,t){let n=jj(e,t),i=new ArrayBuffer(n.length),r=new Uint8Array(i);for(let o=0;o<n.length;o++)r[o]=n.charCodeAt(o);return i}function Tze(e,t){t=t??"";let n=e[1],i=!!e[2],r=e[3],o,s;switch(t){case"":case"text":return jj(i,r);case"arraybuffer":return efe(i,r);case"blob":return o=efe(i,r),new Blob([o],{type:n});case"document":return s=new DOMParser,s.parseFromString(jj(i,r),n);case"json":return JSON.parse(jj(i,r));default:}}zt.prototype.fetch=function(e){return e=Pp(e,{}),e.method="GET",this._makeRequest(e)};zt.fetch=function(e){return new zt(e).fetch({responseType:e.responseType,overrideMimeType:e.overrideMimeType})};zt.prototype.delete=function(e){return e=Pp(e,{}),e.method="DELETE",this._makeRequest(e)};zt.delete=function(e){return new zt(e).delete({responseType:e.responseType,overrideMimeType:e.overrideMimeType,data:e.data})};zt.prototype.head=function(e){return e=Pp(e,{}),e.method="HEAD",this._makeRequest(e)};zt.head=function(e){return new zt(e).head({responseType:e.responseType,overrideMimeType:e.overrideMimeType})};zt.prototype.options=function(e){return e=Pp(e,{}),e.method="OPTIONS",this._makeRequest(e)};zt.options=function(e){return new zt(e).options({responseType:e.responseType,overrideMimeType:e.overrideMimeType})};zt.prototype.post=function(e,t){return Wr.defined("data",e),t=Pp(t,{}),t.method="POST",t.data=e,this._makeRequest(t)};zt.post=function(e){return new zt(e).post(e.data,{responseType:e.responseType,overrideMimeType:e.overrideMimeType})};zt.prototype.put=function(e,t){return Wr.defined("data",e),t=Pp(t,{}),t.method="PUT",t.data=e,this._makeRequest(t)};zt.put=function(e){return new zt(e).put(e.data,{responseType:e.responseType,overrideMimeType:e.overrideMimeType})};zt.prototype.patch=function(e,t){return Wr.defined("data",e),t=Pp(t,{}),t.method="PATCH",t.data=e,this._makeRequest(t)};zt.patch=function(e){return new zt(e).patch(e.data,{responseType:e.responseType,overrideMimeType:e.overrideMimeType})};zt._Implementations={};zt._Implementations.loadImageElement=function(e,t,n){let i=new Image;i.onload=function(){i.naturalWidth===0&&i.naturalHeight===0&&i.width===0&&i.height===0&&(i.width=300,i.height=150),n.resolve(i)},i.onerror=function(r){n.reject(r)},t&&(dv.contains(e)?i.crossOrigin="use-credentials":i.crossOrigin=""),i.src=e};zt._Implementations.createImage=function(e,t,n,i,r,o,s){let a=e.url;zt.supportsImageBitmapOptions().then(function(c){if(!(c&&o)){zt._Implementations.loadImageElement(a,t,n);return}let u="blob",f="GET",d=Pu(),p=zt._Implementations.loadWithXhr(a,u,f,void 0,s,d,void 0,void 0,void 0);return l(p)&&l(p.abort)&&(e.cancelFunction=function(){p.abort()}),d.promise.then(function(g){if(!l(g)){n.reject(new oe(`Successfully retrieved ${a} but it contained no content.`));return}return zt.createImageBitmapFromBlob(g,{flipY:i,premultiplyAlpha:!1,skipColorSpaceConversion:r})}).then(function(g){n.resolve(g)})}).catch(function(c){n.reject(c)})};zt.createImageBitmapFromBlob=function(e,t){return Wr.defined("options",t),Wr.typeOf.bool("options.flipY",t.flipY),Wr.typeOf.bool("options.premultiplyAlpha",t.premultiplyAlpha),Wr.typeOf.bool("options.skipColorSpaceConversion",t.skipColorSpaceConversion),createImageBitmap(e,{imageOrientation:t.flipY?"flipY":"none",premultiplyAlpha:t.premultiplyAlpha?"premultiply":"none",colorSpaceConversion:t.skipColorSpaceConversion?"none":"default"})};function Eze(e,t,n,i,r,o,s){fetch(e,{method:n,headers:r}).then(async a=>{if(!a.ok){let c={};a.headers.forEach((u,f)=>{c[f]=u}),o.reject(new wp(a.status,a,c));return}switch(t){case"text":o.resolve(a.text());break;case"json":o.resolve(a.json());break;default:o.resolve(new Uint8Array(await a.arrayBuffer()).buffer);break}}).catch(()=>{o.reject(new wp)})}var Cze=typeof XMLHttpRequest>"u";zt._Implementations.loadWithXhr=function(e,t,n,i,r,o,s){let a=xze.exec(e);if(a!==null){o.resolve(Tze(a,t));return}if(Cze){Eze(e,t,n,i,r,o,s);return}let c=new XMLHttpRequest;if(dv.contains(e)&&(c.withCredentials=!0),c.open(n,e,!0),l(s)&&l(c.overrideMimeType)&&c.overrideMimeType(s),l(r))for(let f in r)r.hasOwnProperty(f)&&c.setRequestHeader(f,r[f]);l(t)&&(c.responseType=t);let u=!1;return typeof e=="string"&&(u=e.indexOf("file://")===0||typeof window<"u"&&window.location.origin==="file://"),c.onload=function(){if((c.status<200||c.status>=300)&&!(u&&c.status===0)){o.reject(new wp(c.status,c.response,c.getAllResponseHeaders()));return}let f=c.response,d=c.responseType;if(n==="HEAD"||n==="OPTIONS"){let g=c.getAllResponseHeaders().trim().split(/[\r\n]+/),m={};g.forEach(function(y){let A=y.split(": "),b=A.shift();m[b]=A.join(": ")}),o.resolve(m);return}if(c.status===204)o.resolve(void 0);else if(l(f)&&(!l(t)||d===t))o.resolve(f);else if(t==="json"&&typeof f=="string")try{o.resolve(JSON.parse(f))}catch(p){o.reject(p)}else(d===""||d==="document")&&l(c.responseXML)&&c.responseXML.hasChildNodes()?o.resolve(c.responseXML):(d===""||d==="text")&&l(c.responseText)?o.resolve(c.responseText):o.reject(new oe("Invalid XMLHttpRequest response type."))},c.onerror=function(f){o.reject(new wp)},c.send(i),c};zt._Implementations.loadAndExecuteScript=function(e,t,n){return ix(e,t).catch(function(i){n.reject(i)})};zt._DefaultImplementations={};zt._DefaultImplementations.createImage=zt._Implementations.createImage;zt._DefaultImplementations.loadWithXhr=zt._Implementations.loadWithXhr;zt._DefaultImplementations.loadAndExecuteScript=zt._Implementations.loadAndExecuteScript;zt.DEFAULT=Object.freeze(new zt({url:typeof document>"u"?"":document.location.href.split("?")[0]}));var De=zt;function pD(e){e=e??H.EMPTY_OBJECT,this._dates=void 0,this._samples=void 0,this._dateColumn=-1,this._xPoleWanderRadiansColumn=-1,this._yPoleWanderRadiansColumn=-1,this._ut1MinusUtcSecondsColumn=-1,this._xCelestialPoleOffsetRadiansColumn=-1,this._yCelestialPoleOffsetRadiansColumn=-1,this._taiMinusUtcSecondsColumn=-1,this._columnCount=0,this._lastIndex=-1,this._addNewLeapSeconds=e.addNewLeapSeconds??!0,l(e.data)?rfe(this,e.data):rfe(this,{columnNames:["dateIso8601","modifiedJulianDateUtc","xPoleWanderRadians","yPoleWanderRadians","ut1MinusUtcSeconds","lengthOfDayCorrectionSeconds","xCelestialPoleOffsetRadians","yCelestialPoleOffsetRadians","taiMinusUtcSeconds"],samples:[]})}pD.fromUrl=async function(e,t){t=t??H.EMPTY_OBJECT;let n=De.createIfNeeded(e),i;try{i=await n.fetchJson()}catch{throw new oe(`An error occurred while retrieving the EOP data from the URL ${n.url}.`)}return new pD({addNewLeapSeconds:t.addNewLeapSeconds,data:i})};pD.NONE=Object.freeze({compute:function(e,t){return l(t)?(t.xPoleWander=0,t.yPoleWander=0,t.xPoleOffset=0,t.yPoleOffset=0,t.ut1MinusUtc=0):t=new wy(0,0,0,0,0),t}});pD.prototype.compute=function(e,t){if(!l(this._samples))return;if(l(t)||(t=new wy(0,0,0,0,0)),this._samples.length===0)return t.xPoleWander=0,t.yPoleWander=0,t.xPoleOffset=0,t.yPoleOffset=0,t.ut1MinusUtc=0,t;let n=this._dates,i=this._lastIndex,r,o;if(l(i)){let a=n[i],c=n[i+1],u=K.lessThanOrEquals(a,e),f=!l(c),d=f||K.greaterThanOrEquals(c,e);if(u&&d)return r=i,!f&&c.equals(e)&&++r,o=r+1,sfe(this,n,this._samples,e,r,o,t),t}let s=vr(n,e,K.compare,this._dateColumn);return s>=0?(s<n.length-1&&n[s+1].equals(e)&&++s,r=s,o=s):(o=~s,r=o-1,r<0&&(r=0)),this._lastIndex=r,sfe(this,n,this._samples,e,r,o,t),t};function vze(e,t){return K.compare(e.julianDate,t)}function rfe(e,t){if(!l(t.columnNames))throw new oe("Error in loaded EOP data: The columnNames property is required.");if(!l(t.samples))throw new oe("Error in loaded EOP data: The samples property is required.");let n=t.columnNames.indexOf("modifiedJulianDateUtc"),i=t.columnNames.indexOf("xPoleWanderRadians"),r=t.columnNames.indexOf("yPoleWanderRadians"),o=t.columnNames.indexOf("ut1MinusUtcSeconds"),s=t.columnNames.indexOf("xCelestialPoleOffsetRadians"),a=t.columnNames.indexOf("yCelestialPoleOffsetRadians"),c=t.columnNames.indexOf("taiMinusUtcSeconds");if(n<0||i<0||r<0||o<0||s<0||a<0||c<0)throw new oe("Error in loaded EOP data: The columnNames property must include modifiedJulianDateUtc, xPoleWanderRadians, yPoleWanderRadians, ut1MinusUtcSeconds, xCelestialPoleOffsetRadians, yCelestialPoleOffsetRadians, and taiMinusUtcSeconds columns");let u=e._samples=t.samples,f=e._dates=[];e._dateColumn=n,e._xPoleWanderRadiansColumn=i,e._yPoleWanderRadiansColumn=r,e._ut1MinusUtcSecondsColumn=o,e._xCelestialPoleOffsetRadiansColumn=s,e._yCelestialPoleOffsetRadiansColumn=a,e._taiMinusUtcSecondsColumn=c,e._columnCount=t.columnNames.length,e._lastIndex=void 0;let d,p=e._addNewLeapSeconds;for(let g=0,m=u.length;g<m;g+=e._columnCount){let y=u[g+n],A=u[g+c],b=y+kn.MODIFIED_JULIAN_DATE_DIFFERENCE,x=new K(b,A,si.TAI);if(f.push(x),p){if(A!==d&&l(d)){let T=K.leapSeconds,E=vr(T,x,vze);if(E<0){let v=new yr(x,A);T.splice(~E,0,v)}}d=A}}}function ofe(e,t,n,i,r){let o=n*i;r.xPoleWander=t[o+e._xPoleWanderRadiansColumn],r.yPoleWander=t[o+e._yPoleWanderRadiansColumn],r.xPoleOffset=t[o+e._xCelestialPoleOffsetRadiansColumn],r.yPoleOffset=t[o+e._yCelestialPoleOffsetRadiansColumn],r.ut1MinusUtc=t[o+e._ut1MinusUtcSecondsColumn]}function mD(e,t,n){return t+e*(n-t)}function sfe(e,t,n,i,r,o,s){let a=e._columnCount;if(o>t.length-1)return s.xPoleWander=0,s.yPoleWander=0,s.xPoleOffset=0,s.yPoleOffset=0,s.ut1MinusUtc=0,s;let c=t[r],u=t[o];if(c.equals(u)||i.equals(c))return ofe(e,n,r,a,s),s;if(i.equals(u))return ofe(e,n,o,a,s),s;let f=K.secondsDifference(i,c)/K.secondsDifference(u,c),d=r*a,p=o*a,g=n[d+e._ut1MinusUtcSecondsColumn],m=n[p+e._ut1MinusUtcSecondsColumn],y=m-g;if(y>.5||y<-.5){let A=n[d+e._taiMinusUtcSecondsColumn],b=n[p+e._taiMinusUtcSecondsColumn];A!==b&&(u.equals(i)?g=m:m-=b-A)}return s.xPoleWander=mD(f,n[d+e._xPoleWanderRadiansColumn],n[p+e._xPoleWanderRadiansColumn]),s.yPoleWander=mD(f,n[d+e._yPoleWanderRadiansColumn],n[p+e._yPoleWanderRadiansColumn]),s.xPoleOffset=mD(f,n[d+e._xCelestialPoleOffsetRadiansColumn],n[p+e._xCelestialPoleOffsetRadiansColumn]),s.yPoleOffset=mD(f,n[d+e._yCelestialPoleOffsetRadiansColumn],n[p+e._yCelestialPoleOffsetRadiansColumn]),s.ut1MinusUtc=mD(f,g,m),s}var gD=pD;function $c(e,t,n){this.heading=e??0,this.pitch=t??0,this.roll=n??0}$c.fromQuaternion=function(e,t){l(t)||(t=new $c);let n=2*(e.w*e.y-e.z*e.x),i=1-2*(e.x*e.x+e.y*e.y),r=2*(e.w*e.x+e.y*e.z),o=1-2*(e.y*e.y+e.z*e.z),s=2*(e.w*e.z+e.x*e.y);return t.heading=-Math.atan2(s,o),t.roll=Math.atan2(r,i),t.pitch=-D.asinClamped(n),t};$c.fromDegrees=function(e,t,n,i){return l(i)||(i=new $c),i.heading=e*D.RADIANS_PER_DEGREE,i.pitch=t*D.RADIANS_PER_DEGREE,i.roll=n*D.RADIANS_PER_DEGREE,i};$c.clone=function(e,t){if(l(e))return l(t)?(t.heading=e.heading,t.pitch=e.pitch,t.roll=e.roll,t):new $c(e.heading,e.pitch,e.roll)};$c.equals=function(e,t){return e===t||l(e)&&l(t)&&e.heading===t.heading&&e.pitch===t.pitch&&e.roll===t.roll};$c.equalsEpsilon=function(e,t,n,i){return e===t||l(e)&&l(t)&&D.equalsEpsilon(e.heading,t.heading,n,i)&&D.equalsEpsilon(e.pitch,t.pitch,n,i)&&D.equalsEpsilon(e.roll,t.roll,n,i)};$c.prototype.clone=function(e){return $c.clone(this,e)};$c.prototype.equals=function(e){return $c.equals(this,e)};$c.prototype.equalsEpsilon=function(e,t,n){return $c.equalsEpsilon(this,e,t,n)};$c.prototype.toString=function(){return`(${this.heading}, ${this.pitch}, ${this.roll})`};var wc=$c;var afe={},cfe=/((?:.*\/)|^)Cesium\.js(?:\?|\#|$)/;function Sze(){let e=document.getElementsByTagName("script");for(let t=0,n=e.length;t<n;++t){let i=e[t].getAttribute("src"),r=cfe.exec(i);if(r!==null)return r[1]}}var Gj;function lfe(e){return typeof document>"u"?e:(l(Gj)||(Gj=document.createElement("a")),Gj.href=e,Gj.href)}var ax;function ufe(){if(l(ax))return ax;let e;return typeof CESIUM_BASE_URL<"u"?e=CESIUM_BASE_URL:l(afe?.url)?e=Cd(".",afe.url):typeof define=="object"&&l(define.amd)&&!define.amd.toUrlUndefined&&l(require.toUrl)?e=Cd("..",cx("Core/buildModuleUrl.js")):e=Sze(),ax=new De({url:lfe(e)}),ax.appendForwardSlash(),ax}function wze(e){return lfe(require.toUrl(`../${e}`))}function ffe(e){return ufe().getDerivedResource({url:e}).url}var Wj;function cx(e){return l(Wj)||(typeof define=="object"&&l(define.amd)&&!define.amd.toUrlUndefined&&l(require.toUrl)?Wj=wze:Wj=ffe),Wj(e)}cx._cesiumScriptRegex=cfe;cx._buildModuleUrlFromBaseUrl=ffe;cx._clearBaseResource=function(){ax=void 0};cx.setBaseUrl=function(e){ax=De.DEFAULT.getDerivedResource({url:e})};cx.getCesiumBaseUrl=ufe;var Zt=cx;function Ize(e,t,n){this.x=e,this.y=t,this.s=n}var lx=Ize;function qj(e){e=e??H.EMPTY_OBJECT,this._xysFileUrlTemplate=De.createIfNeeded(e.xysFileUrlTemplate),this._interpolationOrder=e.interpolationOrder??9,this._sampleZeroJulianEphemerisDate=e.sampleZeroJulianEphemerisDate??24423965e-1,this._sampleZeroDateTT=new K(this._sampleZeroJulianEphemerisDate,0,si.TAI),this._stepSizeDays=e.stepSizeDays??1,this._samplesPerXysFile=e.samplesPerXysFile??1e3,this._totalSamples=e.totalSamples??27426,this._samples=new Array(this._totalSamples*3),this._chunkDownloadsInProgress=[];let t=this._interpolationOrder,n=this._denominators=new Array(t+1),i=this._xTable=new Array(t+1),r=Math.pow(this._stepSizeDays,t);for(let o=0;o<=t;++o){n[o]=r,i[o]=o*this._stepSizeDays;for(let s=0;s<=t;++s)s!==o&&(n[o]*=o-s);n[o]=1/n[o]}this._work=new Array(t+1),this._coef=new Array(t+1)}var Pze=new K(0,0,si.TAI);function oY(e,t,n){let i=Pze;return i.dayNumber=t,i.secondsOfDay=n,K.daysDifference(i,e._sampleZeroDateTT)}qj.prototype.preload=function(e,t,n,i){let r=oY(this,e,t),o=oY(this,n,i),s=r/this._stepSizeDays-this._interpolationOrder/2|0;s<0&&(s=0);let a=o/this._stepSizeDays-this._interpolationOrder/2|0+this._interpolationOrder;a>=this._totalSamples&&(a=this._totalSamples-1);let c=s/this._samplesPerXysFile|0,u=a/this._samplesPerXysFile|0,f=[];for(let d=c;d<=u;++d)f.push(sY(this,d));return Promise.all(f)};qj.prototype.computeXysRadians=function(e,t,n){let i=oY(this,e,t);if(i<0)return;let r=i/this._stepSizeDays|0;if(r>=this._totalSamples)return;let o=this._interpolationOrder,s=r-(o/2|0);s<0&&(s=0);let a=s+o;a>=this._totalSamples&&(a=this._totalSamples-1,s=a-o,s<0&&(s=0));let c=!1,u=this._samples;if(l(u[s*3])||(sY(this,s/this._samplesPerXysFile|0),c=!0),l(u[a*3])||(sY(this,a/this._samplesPerXysFile|0),c=!0),c)return;l(n)?(n.x=0,n.y=0,n.s=0):n=new lx(0,0,0);let f=i-s*this._stepSizeDays,d=this._work,p=this._denominators,g=this._coef,m=this._xTable,y,A;for(y=0;y<=o;++y)d[y]=f-m[y];for(y=0;y<=o;++y){for(g[y]=1,A=0;A<=o;++A)A!==y&&(g[y]*=d[A]);g[y]*=p[y];let b=(s+y)*3;n.x+=g[y]*u[b++],n.y+=g[y]*u[b++],n.s+=g[y]*u[b]}return n};qj.prototype._updateChunkData=function(e,{samples:t}){this._chunkDownloadsInProgress[e]=void 0;let n=this._samplesPerXysFile,i=e*n*3;for(let r=0;r<t.length;++r)this._samples[i+r]=t[r]};async function Dze(e,t,n){try{let i=await e.fetchJson();n._updateChunkData(t,i)}catch{}}function sY(e,t){if(l(e._chunkDownloadsInProgress[t]))return e._chunkDownloadsInProgress[t];let n,i=e._xysFileUrlTemplate;l(i)?n=i.getDerivedResource({templateValues:{0:t}}):n=new De({url:Zt(`Assets/IAU2006_XYS/IAU2006_XYS_${t}.json`)});let r=Dze(n,t,e);return e._chunkDownloadsInProgress[t]=r,r}var _D=qj;function dt(e,t,n,i){this.x=e??0,this.y=t??0,this.z=n??0,this.w=i??0}var yD=new h;dt.fromAxisAngle=function(e,t,n){let i=t/2,r=Math.sin(i);yD=h.normalize(e,yD);let o=yD.x*r,s=yD.y*r,a=yD.z*r,c=Math.cos(i);return l(n)?(n.x=o,n.y=s,n.z=a,n.w=c,n):new dt(o,s,a,c)};var Rze=[1,2,0],Oze=new Array(3);dt.fromRotationMatrix=function(e,t){let n,i,r,o,s,a=e[$.COLUMN0ROW0],c=e[$.COLUMN1ROW1],u=e[$.COLUMN2ROW2],f=a+c+u;if(f>0)n=Math.sqrt(f+1),s=.5*n,n=.5/n,i=(e[$.COLUMN1ROW2]-e[$.COLUMN2ROW1])*n,r=(e[$.COLUMN2ROW0]-e[$.COLUMN0ROW2])*n,o=(e[$.COLUMN0ROW1]-e[$.COLUMN1ROW0])*n;else{let d=Rze,p=0;c>a&&(p=1),u>a&&u>c&&(p=2);let g=d[p],m=d[g];n=Math.sqrt(e[$.getElementIndex(p,p)]-e[$.getElementIndex(g,g)]-e[$.getElementIndex(m,m)]+1);let y=Oze;y[p]=.5*n,n=.5/n,s=(e[$.getElementIndex(m,g)]-e[$.getElementIndex(g,m)])*n,y[g]=(e[$.getElementIndex(g,p)]+e[$.getElementIndex(p,g)])*n,y[m]=(e[$.getElementIndex(m,p)]+e[$.getElementIndex(p,m)])*n,i=-y[0],r=-y[1],o=-y[2]}return l(t)?(t.x=i,t.y=r,t.z=o,t.w=s,t):new dt(i,r,o,s)};var dfe=new dt,hfe=new dt,aY=new dt,mfe=new dt;dt.fromHeadingPitchRoll=function(e,t){return mfe=dt.fromAxisAngle(h.UNIT_X,e.roll,dfe),aY=dt.fromAxisAngle(h.UNIT_Y,-e.pitch,t),t=dt.multiply(aY,mfe,aY),hfe=dt.fromAxisAngle(h.UNIT_Z,-e.heading,dfe),dt.multiply(hfe,t,t)};var Yj=new h,cY=new h,zh=new dt,pfe=new dt,Xj=new dt;dt.packedLength=4;dt.pack=function(e,t,n){return n=n??0,t[n++]=e.x,t[n++]=e.y,t[n++]=e.z,t[n]=e.w,t};dt.unpack=function(e,t,n){return t=t??0,l(n)||(n=new dt),n.x=e[t],n.y=e[t+1],n.z=e[t+2],n.w=e[t+3],n};dt.packedInterpolationLength=3;dt.convertPackedArrayForInterpolation=function(e,t,n,i){dt.unpack(e,n*4,Xj),dt.conjugate(Xj,Xj);for(let r=0,o=n-t+1;r<o;r++){let s=r*3;dt.unpack(e,(t+r)*4,zh),dt.multiply(zh,Xj,zh),zh.w<0&&dt.negate(zh,zh),dt.computeAxis(zh,Yj);let a=dt.computeAngle(zh);l(i)||(i=[]),i[s]=Yj.x*a,i[s+1]=Yj.y*a,i[s+2]=Yj.z*a}};dt.unpackInterpolationResult=function(e,t,n,i,r){l(r)||(r=new dt),h.fromArray(e,0,cY);let o=h.magnitude(cY);return dt.unpack(t,i*4,pfe),o===0?dt.clone(dt.IDENTITY,zh):dt.fromAxisAngle(cY,o,zh),dt.multiply(zh,pfe,r)};dt.clone=function(e,t){if(l(e))return l(t)?(t.x=e.x,t.y=e.y,t.z=e.z,t.w=e.w,t):new dt(e.x,e.y,e.z,e.w)};dt.conjugate=function(e,t){return t.x=-e.x,t.y=-e.y,t.z=-e.z,t.w=e.w,t};dt.magnitudeSquared=function(e){return e.x*e.x+e.y*e.y+e.z*e.z+e.w*e.w};dt.magnitude=function(e){return Math.sqrt(dt.magnitudeSquared(e))};dt.normalize=function(e,t){let n=1/dt.magnitude(e),i=e.x*n,r=e.y*n,o=e.z*n,s=e.w*n;return t.x=i,t.y=r,t.z=o,t.w=s,t};dt.inverse=function(e,t){let n=dt.magnitudeSquared(e);return t=dt.conjugate(e,t),dt.multiplyByScalar(t,1/n,t)};dt.add=function(e,t,n){return n.x=e.x+t.x,n.y=e.y+t.y,n.z=e.z+t.z,n.w=e.w+t.w,n};dt.subtract=function(e,t,n){return n.x=e.x-t.x,n.y=e.y-t.y,n.z=e.z-t.z,n.w=e.w-t.w,n};dt.negate=function(e,t){return t.x=-e.x,t.y=-e.y,t.z=-e.z,t.w=-e.w,t};dt.dot=function(e,t){return e.x*t.x+e.y*t.y+e.z*t.z+e.w*t.w};dt.multiply=function(e,t,n){let i=e.x,r=e.y,o=e.z,s=e.w,a=t.x,c=t.y,u=t.z,f=t.w,d=s*a+i*f+r*u-o*c,p=s*c-i*u+r*f+o*a,g=s*u+i*c-r*a+o*f,m=s*f-i*a-r*c-o*u;return n.x=d,n.y=p,n.z=g,n.w=m,n};dt.multiplyByScalar=function(e,t,n){return n.x=e.x*t,n.y=e.y*t,n.z=e.z*t,n.w=e.w*t,n};dt.divideByScalar=function(e,t,n){return n.x=e.x/t,n.y=e.y/t,n.z=e.z/t,n.w=e.w/t,n};dt.computeAxis=function(e,t){let n=e.w;if(Math.abs(n-1)<D.EPSILON6||Math.abs(n+1)<D.EPSILON6)return t.x=1,t.y=t.z=0,t;let i=1/Math.sqrt(1-n*n);return t.x=e.x*i,t.y=e.y*i,t.z=e.z*i,t};dt.computeAngle=function(e){return Math.abs(e.w-1)<D.EPSILON6?0:2*Math.acos(e.w)};var lY=new dt;dt.lerp=function(e,t,n,i){return lY=dt.multiplyByScalar(t,n,lY),i=dt.multiplyByScalar(e,1-n,i),dt.add(lY,i,i)};var gfe=new dt,uY=new dt,fY=new dt;dt.slerp=function(e,t,n,i){let r=dt.dot(e,t),o=t;if(r<0&&(r=-r,o=gfe=dt.negate(t,gfe)),1-r<D.EPSILON6)return dt.lerp(e,o,n,i);let s=Math.acos(r);return uY=dt.multiplyByScalar(e,Math.sin((1-n)*s),uY),fY=dt.multiplyByScalar(o,Math.sin(n*s),fY),i=dt.add(uY,fY,i),dt.multiplyByScalar(i,1/Math.sin(s),i)};dt.log=function(e,t){let n=D.acosClamped(e.w),i=0;return n!==0&&(i=n/Math.sin(n)),h.multiplyByScalar(e,i,t)};dt.exp=function(e,t){let n=h.magnitude(e),i=0;return n!==0&&(i=Math.sin(n)/n),t.x=e.x*i,t.y=e.y*i,t.z=e.z*i,t.w=Math.cos(n),t};var Mze=new h,Nze=new h,AD=new dt,mv=new dt;dt.computeInnerQuadrangle=function(e,t,n,i){let r=dt.conjugate(t,AD);dt.multiply(r,n,mv);let o=dt.log(mv,Mze);dt.multiply(r,e,mv);let s=dt.log(mv,Nze);return h.add(o,s,o),h.multiplyByScalar(o,.25,o),h.negate(o,o),dt.exp(o,AD),dt.multiply(t,AD,i)};dt.squad=function(e,t,n,i,r,o){let s=dt.slerp(e,t,r,AD),a=dt.slerp(n,i,r,mv);return dt.slerp(s,a,2*r*(1-r),o)};var Lze=new dt,_fe=1.9011074535173003,Kj=dn.supportsTypedArrays()?new Float32Array(8):[],$j=dn.supportsTypedArrays()?new Float32Array(8):[],sg=dn.supportsTypedArrays()?new Float32Array(8):[],ag=dn.supportsTypedArrays()?new Float32Array(8):[];for(let e=0;e<7;++e){let t=e+1,n=2*t+1;Kj[e]=1/(t*n),$j[e]=t/n}Kj[7]=_fe/136;$j[7]=_fe*8/17;dt.fastSlerp=function(e,t,n,i){let r=dt.dot(e,t),o;r>=0?o=1:(o=-1,r=-r);let s=r-1,a=1-n,c=n*n,u=a*a;for(let g=7;g>=0;--g)sg[g]=(Kj[g]*c-$j[g])*s,ag[g]=(Kj[g]*u-$j[g])*s;let f=o*n*(1+sg[0]*(1+sg[1]*(1+sg[2]*(1+sg[3]*(1+sg[4]*(1+sg[5]*(1+sg[6]*(1+sg[7])))))))),d=a*(1+ag[0]*(1+ag[1]*(1+ag[2]*(1+ag[3]*(1+ag[4]*(1+ag[5]*(1+ag[6]*(1+ag[7])))))))),p=dt.multiplyByScalar(e,d,Lze);return dt.multiplyByScalar(t,f,i),dt.add(p,i,i)};dt.fastSquad=function(e,t,n,i,r,o){let s=dt.fastSlerp(e,t,r,AD),a=dt.fastSlerp(n,i,r,mv);return dt.fastSlerp(s,a,2*r*(1-r),o)};dt.equals=function(e,t){return e===t||l(e)&&l(t)&&e.x===t.x&&e.y===t.y&&e.z===t.z&&e.w===t.w};dt.equalsEpsilon=function(e,t,n){return n=n??0,e===t||l(e)&&l(t)&&Math.abs(e.x-t.x)<=n&&Math.abs(e.y-t.y)<=n&&Math.abs(e.z-t.z)<=n&&Math.abs(e.w-t.w)<=n};dt.ZERO=Object.freeze(new dt(0,0,0,0));dt.IDENTITY=Object.freeze(new dt(0,0,0,1));dt.prototype.clone=function(e){return dt.clone(this,e)};dt.prototype.equals=function(e){return dt.equals(this,e)};dt.prototype.equalsEpsilon=function(e,t){return dt.equalsEpsilon(this,e,t)};dt.prototype.toString=function(){return`(${this.x}, ${this.y}, ${this.z}, ${this.w})`};var Le=dt;var Ei={},dY={up:{south:"east",north:"west",west:"south",east:"north"},down:{south:"west",north:"east",west:"north",east:"south"},south:{up:"west",down:"east",west:"down",east:"up"},north:{up:"east",down:"west",west:"up",east:"down"},west:{up:"north",down:"south",north:"down",south:"up"},east:{up:"south",down:"north",north:"up",south:"down"}},pv={north:[-1,0,0],east:[0,1,0],up:[0,0,1],south:[1,0,0],west:[0,-1,0],down:[0,0,-1]},hY={},Du={east:new h,north:new h,up:new h,west:new h,south:new h,down:new h},Ry=new h,Oy=new h,My=new h;Ei.localFrameToFixedFrameGenerator=function(e,t){if(!dY.hasOwnProperty(e)||!dY[e].hasOwnProperty(t))throw new pe("firstAxis and secondAxis must be east, north, up, west, south or down.");let n=dY[e][t],i,r=e+t;return l(hY[r])?i=hY[r]:(i=function(o,s,a){if(l(a)||(a=new N),h.equalsEpsilon(o,h.ZERO,D.EPSILON14))h.unpack(pv[e],0,Ry),h.unpack(pv[t],0,Oy),h.unpack(pv[n],0,My);else if(D.equalsEpsilon(o.x,0,D.EPSILON14)&&D.equalsEpsilon(o.y,0,D.EPSILON14)){let c=D.sign(o.z);h.unpack(pv[e],0,Ry),e!=="east"&&e!=="west"&&h.multiplyByScalar(Ry,c,Ry),h.unpack(pv[t],0,Oy),t!=="east"&&t!=="west"&&h.multiplyByScalar(Oy,c,Oy),h.unpack(pv[n],0,My),n!=="east"&&n!=="west"&&h.multiplyByScalar(My,c,My)}else{s=s??ee.default,s.geodeticSurfaceNormal(o,Du.up);let c=Du.up,u=Du.east;u.x=-o.y,u.y=o.x,u.z=0,h.normalize(u,Du.east),h.cross(c,u,Du.north),h.multiplyByScalar(Du.up,-1,Du.down),h.multiplyByScalar(Du.east,-1,Du.west),h.multiplyByScalar(Du.north,-1,Du.south),Ry=Du[e],Oy=Du[t],My=Du[n]}return a[0]=Ry.x,a[1]=Ry.y,a[2]=Ry.z,a[3]=0,a[4]=Oy.x,a[5]=Oy.y,a[6]=Oy.z,a[7]=0,a[8]=My.x,a[9]=My.y,a[10]=My.z,a[11]=0,a[12]=o.x,a[13]=o.y,a[14]=o.z,a[15]=1,a},hY[r]=i),i};Ei.eastNorthUpToFixedFrame=Ei.localFrameToFixedFrameGenerator("east","north");Ei.northEastDownToFixedFrame=Ei.localFrameToFixedFrameGenerator("north","east");Ei.northUpEastToFixedFrame=Ei.localFrameToFixedFrameGenerator("north","up");Ei.northWestUpToFixedFrame=Ei.localFrameToFixedFrameGenerator("north","west");var Fze=new Le,Bze=new h(1,1,1),kze=new N;Ei.headingPitchRollToFixedFrame=function(e,t,n,i,r){i=i??Ei.eastNorthUpToFixedFrame;let o=Le.fromHeadingPitchRoll(t,Fze),s=N.fromTranslationQuaternionRotationScale(h.ZERO,o,Bze,kze);return r=i(e,n,r),N.multiply(r,s,r)};var Uze=new N,zze=new $;Ei.headingPitchRollQuaternion=function(e,t,n,i,r){let o=Ei.headingPitchRollToFixedFrame(e,t,n,i,Uze),s=N.getMatrix3(o,zze);return Le.fromRotationMatrix(s,r)};var Vze=new h(1,1,1),jze=new h,yfe=new N,Hze=new N,Gze=new $,Wze=new Le;Ei.fixedFrameToHeadingPitchRoll=function(e,t,n,i){t=t??ee.default,n=n??Ei.eastNorthUpToFixedFrame,l(i)||(i=new wc);let r=N.getTranslation(e,jze);if(h.equals(r,h.ZERO))return i.heading=0,i.pitch=0,i.roll=0,i;let o=N.inverseTransformation(n(r,t,yfe),yfe),s=N.setScale(e,Vze,Hze);s=N.setTranslation(s,h.ZERO,s),o=N.multiply(o,s,o);let a=Le.fromRotationMatrix(N.getMatrix3(o,Gze),Wze);return a=Le.normalize(a,a),wc.fromQuaternion(a,i)};var qze=6*3600+2460+50.54841,Yze=8640184812866e-6,Xze=.093104,Kze=-62e-7,$ze=11772758384668e-32,Jze=72921158553e-15,Zze=D.TWO_PI/86400,Jj=new K;Ei.computeIcrfToCentralBodyFixedMatrix=function(e,t){let n=Ei.computeIcrfToFixedMatrix(e,t);return l(n)||(n=Ei.computeTemeToPseudoFixedMatrix(e,t)),n};Ei.computeTemeToPseudoFixedMatrix=function(e,t){Jj=K.addSeconds(e,-K.computeTaiMinusUtc(e),Jj);let n=Jj.dayNumber,i=Jj.secondsOfDay,r,o=n-2451545;i>=43200?r=(o+.5)/kn.DAYS_PER_JULIAN_CENTURY:r=(o-.5)/kn.DAYS_PER_JULIAN_CENTURY;let a=(qze+r*(Yze+r*(Xze+r*Kze)))*Zze%D.TWO_PI,c=Jze+$ze*(n-24515455e-1),u=(i+kn.SECONDS_PER_DAY*.5)%kn.SECONDS_PER_DAY,f=a+c*u,d=Math.cos(f),p=Math.sin(f);return l(t)?(t[0]=d,t[1]=-p,t[2]=0,t[3]=p,t[4]=d,t[5]=0,t[6]=0,t[7]=0,t[8]=1,t):new $(d,p,0,-p,d,0,0,0,1)};Ei.iau2006XysData=new _D;Ei.earthOrientationParameters=gD.NONE;var gY=32.184,Qze=2451545;Ei.preloadIcrfFixed=function(e){let t=e.start.dayNumber,n=e.start.secondsOfDay+gY,i=e.stop.dayNumber,r=e.stop.secondsOfDay+gY;return Ei.iau2006XysData.preload(t,n,i,r)};Ei.computeIcrfToFixedMatrix=function(e,t){l(t)||(t=new $);let n=Ei.computeFixedToIcrfMatrix(e,t);if(l(n))return $.transpose(n,t)};var eVe=32.184,tVe=2451545,Zj=new wc,nVe=new $,iVe=new K;Ei.computeMoonFixedToIcrfMatrix=function(e,t){l(t)||(t=new $);let n=K.addSeconds(e,eVe,iVe),i=K.totalDays(n)-tVe,r=D.toRadians(12.112)-D.toRadians(.052992)*i,o=D.toRadians(24.224)-D.toRadians(.105984)*i,s=D.toRadians(227.645)+D.toRadians(13.012)*i,a=D.toRadians(261.105)+D.toRadians(13.340716)*i,c=D.toRadians(358)+D.toRadians(.9856)*i;return Zj.pitch=D.toRadians(180)-D.toRadians(3.878)*Math.sin(r)-D.toRadians(.12)*Math.sin(o)+D.toRadians(.07)*Math.sin(s)-D.toRadians(.017)*Math.sin(a),Zj.roll=D.toRadians(66.53-90)+D.toRadians(1.543)*Math.cos(r)+D.toRadians(.24)*Math.cos(o)-D.toRadians(.028)*Math.cos(s)+D.toRadians(.007)*Math.cos(a),Zj.heading=D.toRadians(244.375-90)+D.toRadians(13.17635831)*i+D.toRadians(3.558)*Math.sin(r)+D.toRadians(.121)*Math.sin(o)-D.toRadians(.064)*Math.sin(s)+D.toRadians(.016)*Math.sin(a)+D.toRadians(.025)*Math.sin(c),$.fromHeadingPitchRoll(Zj,nVe,t)};Ei.computeIcrfToMoonFixedMatrix=function(e,t){l(t)||(t=new $);let n=Ei.computeMoonFixedToIcrfMatrix(e,t);if(l(n))return $.transpose(n,t)};var rVe=new lx(0,0,0),oVe=new wy(0,0,0,0,0,0),mY=new $,pY=new $;Ei.computeFixedToIcrfMatrix=function(e,t){l(t)||(t=new $);let n=Ei.earthOrientationParameters.compute(e,oVe);if(!l(n))return;let i=e.dayNumber,r=e.secondsOfDay+gY,o=Ei.iau2006XysData.computeXysRadians(i,r,rVe);if(!l(o))return;let s=o.x+n.xPoleOffset,a=o.y+n.yPoleOffset,c=1/(1+Math.sqrt(1-s*s-a*a)),u=mY;u[0]=1-c*s*s,u[3]=-c*s*a,u[6]=s,u[1]=-c*s*a,u[4]=1-c*a*a,u[7]=a,u[2]=-s,u[5]=-a,u[8]=1-c*(s*s+a*a);let f=$.fromRotationZ(-o.s,pY),d=$.multiply(u,f,mY),p=e.dayNumber,g=e.secondsOfDay-K.computeTaiMinusUtc(e)+n.ut1MinusUtc,m=p-2451545,y=g/kn.SECONDS_PER_DAY,A=.779057273264+y+.00273781191135448*(m+y);A=A%1*D.TWO_PI;let b=$.fromRotationZ(A,pY),x=$.multiply(d,b,mY),T=Math.cos(n.xPoleWander),E=Math.cos(n.yPoleWander),v=Math.sin(n.xPoleWander),S=Math.sin(n.yPoleWander),I=i-Qze+r/kn.SECONDS_PER_DAY;I/=36525;let R=-47e-6*I*D.RADIANS_PER_DEGREE/3600,O=Math.cos(R),L=Math.sin(R),_=pY;return _[0]=T*O,_[1]=T*L,_[2]=v,_[3]=-E*L+S*v*O,_[4]=E*O+S*v*L,_[5]=-S*T,_[6]=-S*L-E*v*O,_[7]=S*O-E*v*L,_[8]=E*T,$.multiply(x,_,t)};var sVe=new se;Ei.pointToWindowCoordinates=function(e,t,n,i){return i=Ei.pointToGLWindowCoordinates(e,t,n,i),i.y=2*t[5]-i.y,i};Ei.pointToGLWindowCoordinates=function(e,t,n,i){l(i)||(i=new U);let r=sVe;return N.multiplyByVector(e,se.fromElements(n.x,n.y,n.z,1,r),r),se.multiplyByScalar(r,1/r.w,r),N.multiplyByVector(t,r,r),U.fromCartesian4(r,i)};var aVe=new h,cVe=new h,lVe=new h;Ei.rotationMatrixFromPositionVelocity=function(e,t,n,i){let r=(n??ee.default).geodeticSurfaceNormal(e,aVe),o=h.cross(t,r,cVe);h.equalsEpsilon(o,h.ZERO,D.EPSILON6)&&(o=h.clone(h.UNIT_X,o));let s=h.cross(o,t,lVe);return h.normalize(s,s),h.cross(t,s,o),h.negate(o,o),h.normalize(o,o),l(i)||(i=new $),i[0]=t.x,i[1]=t.y,i[2]=t.z,i[3]=o.x,i[4]=o.y,i[5]=o.z,i[6]=s.x,i[7]=s.y,i[8]=s.z,i};Ei.SWIZZLE_3D_TO_2D_MATRIX=Object.freeze(new N(0,0,1,0,1,0,0,0,0,1,0,0,0,0,0,1));var Afe=new he,_Y=new h,uVe=new h,fVe=new $,yY=new N,bfe=new N;Ei.basisTo2D=function(e,t,n){let i=N.getTranslation(t,uVe),r=e.ellipsoid,o;if(h.equals(i,h.ZERO))o=h.clone(h.ZERO,_Y);else{let f=r.cartesianToCartographic(i,Afe);o=e.project(f,_Y),h.fromElements(o.z,o.x,o.y,o)}let s=Ei.eastNorthUpToFixedFrame(i,r,yY),a=N.inverseTransformation(s,bfe),c=N.getMatrix3(t,fVe),u=N.multiplyByMatrix3(a,c,n);return N.multiply(Ei.SWIZZLE_3D_TO_2D_MATRIX,u,n),N.setTranslation(n,o,n),n};Ei.ellipsoidTo2DModelMatrix=function(e,t,n){let i=e.ellipsoid,r=Ei.eastNorthUpToFixedFrame(t,i,yY),o=N.inverseTransformation(r,bfe),s=i.cartesianToCartographic(t,Afe),a=e.project(s,_Y);h.fromElements(a.z,a.x,a.y,a);let c=N.fromTranslation(a,yY);return N.multiply(Ei.SWIZZLE_3D_TO_2D_MATRIX,o,n),N.multiply(c,n,n),n};var At=Ei;var gv=class e{constructor(t,n,i,r){this.west=t??0,this.south=n??0,this.east=i??0,this.north=r??0}get width(){return e.computeWidth(this)}get height(){return e.computeHeight(this)}static pack(t,n,i){return i=i??0,n[i++]=t.west,n[i++]=t.south,n[i++]=t.east,n[i]=t.north,n}static unpack(t,n,i){return n=n??0,l(i)||(i=new e),i.west=t[n++],i.south=t[n++],i.east=t[n++],i.north=t[n],i}static computeWidth(t){let n=t.east,i=t.west;return n<i&&(n+=D.TWO_PI),n-i}static computeHeight(t){return t.north-t.south}static fromDegrees(t,n,i,r,o){return t=D.toRadians(t??0),n=D.toRadians(n??0),i=D.toRadians(i??0),r=D.toRadians(r??0),l(o)?(o.west=t,o.south=n,o.east=i,o.north=r,o):new e(t,n,i,r)}static fromRadians(t,n,i,r,o){return l(o)?(o.west=t??0,o.south=n??0,o.east=i??0,o.north=r??0,o):new e(t,n,i,r)}static fromCartographicArray(t,n){let i=Number.MAX_VALUE,r=-Number.MAX_VALUE,o=Number.MAX_VALUE,s=-Number.MAX_VALUE,a=Number.MAX_VALUE,c=-Number.MAX_VALUE;for(let u=0,f=t.length;u<f;u++){let d=t[u];i=Math.min(i,d.longitude),r=Math.max(r,d.longitude),a=Math.min(a,d.latitude),c=Math.max(c,d.latitude);let p=d.longitude>=0?d.longitude:d.longitude+D.TWO_PI;o=Math.min(o,p),s=Math.max(s,p)}return r-i>s-o&&(i=o,r=s,r>D.PI&&(r=r-D.TWO_PI),i>D.PI&&(i=i-D.TWO_PI)),l(n)?(n.west=i,n.south=a,n.east=r,n.north=c,n):new e(i,a,r,c)}static fromCartesianArray(t,n,i){n=n??ee.default;let r=Number.MAX_VALUE,o=-Number.MAX_VALUE,s=Number.MAX_VALUE,a=-Number.MAX_VALUE,c=Number.MAX_VALUE,u=-Number.MAX_VALUE;for(let f=0,d=t.length;f<d;f++){let p=n.cartesianToCartographic(t[f]);r=Math.min(r,p.longitude),o=Math.max(o,p.longitude),c=Math.min(c,p.latitude),u=Math.max(u,p.latitude);let g=p.longitude>=0?p.longitude:p.longitude+D.TWO_PI;s=Math.min(s,g),a=Math.max(a,g)}return o-r>a-s&&(r=s,o=a,o>D.PI&&(o=o-D.TWO_PI),r>D.PI&&(r=r-D.TWO_PI)),l(i)?(i.west=r,i.south=c,i.east=o,i.north=u,i):new e(r,c,o,u)}static fromBoundingSphere(t,n,i){let r=t.center,o=t.radius;if(l(n)||(n=ee.default),l(i)||(i=new e),h.equals(r,h.ZERO))return e.clone(e.MAX_VALUE,i),i;let s=At.eastNorthUpToFixedFrame(r,n,dVe),a=N.multiplyByPointAsVector(s,h.UNIT_X,hVe);h.normalize(a,a);let c=N.multiplyByPointAsVector(s,h.UNIT_Y,mVe);h.normalize(c,c),h.multiplyByScalar(c,o,c),h.multiplyByScalar(a,o,a);let u=h.negate(c,gVe),f=h.negate(a,pVe),d=AY,p=d[0];return h.add(r,c,p),p=d[1],h.add(r,f,p),p=d[2],h.add(r,u,p),p=d[3],h.add(r,a,p),d[4]=r,e.fromCartesianArray(d,n,i)}static clone(t,n){if(l(t))return l(n)?(n.west=t.west,n.south=t.south,n.east=t.east,n.north=t.north,n):new e(t.west,t.south,t.east,t.north)}static equalsEpsilon(t,n,i){return i=i??0,t===n||l(t)&&l(n)&&Math.abs(t.west-n.west)<=i&&Math.abs(t.south-n.south)<=i&&Math.abs(t.east-n.east)<=i&&Math.abs(t.north-n.north)<=i}clone(t){return e.clone(this,t)}equals(t){return e.equals(this,t)}static equals(t,n){return t===n||l(t)&&l(n)&&t.west===n.west&&t.south===n.south&&t.east===n.east&&t.north===n.north}equalsEpsilon(t,n){return e.equalsEpsilon(this,t,n)}static _validate(t){}static southwest(t,n){return l(n)?(n.longitude=t.west,n.latitude=t.south,n.height=0,n):new he(t.west,t.south)}static northwest(t,n){return l(n)?(n.longitude=t.west,n.latitude=t.north,n.height=0,n):new he(t.west,t.north)}static northeast(t,n){return l(n)?(n.longitude=t.east,n.latitude=t.north,n.height=0,n):new he(t.east,t.north)}static southeast(t,n){return l(n)?(n.longitude=t.east,n.latitude=t.south,n.height=0,n):new he(t.east,t.south)}static center(t,n){let i=t.east,r=t.west;i<r&&(i+=D.TWO_PI);let o=D.negativePiToPi((r+i)*.5),s=(t.south+t.north)*.5;return l(n)?(n.longitude=o,n.latitude=s,n.height=0,n):new he(o,s)}static intersection(t,n,i){let r=t.east,o=t.west,s=n.east,a=n.west;r<o&&s>0?r+=D.TWO_PI:s<a&&r>0&&(s+=D.TWO_PI),r<o&&a<0?a+=D.TWO_PI:s<a&&o<0&&(o+=D.TWO_PI);let c=D.negativePiToPi(Math.max(o,a)),u=D.negativePiToPi(Math.min(r,s));if(c===D.PI&&u<D.PI&&(c=-D.PI),(t.west<t.east||n.west<n.east)&&u<=c)return;let f=Math.max(t.south,n.south),d=Math.min(t.north,n.north);if(!(f>=d))return l(i)?(i.west=c,i.south=f,i.east=u,i.north=d,i):new e(c,f,u,d)}static simpleIntersection(t,n,i){let r=Math.max(t.west,n.west),o=Math.max(t.south,n.south),s=Math.min(t.east,n.east),a=Math.min(t.north,n.north);if(!(o>=a||r>=s))return l(i)?(i.west=r,i.south=o,i.east=s,i.north=a,i):new e(r,o,s,a)}static union(t,n,i){l(i)||(i=new e);let r=t.east,o=t.west,s=n.east,a=n.west;r<o&&s>0?r+=D.TWO_PI:s<a&&r>0&&(s+=D.TWO_PI),r<o&&a<0?a+=D.TWO_PI:s<a&&o<0&&(o+=D.TWO_PI);let c=D.negativePiToPi(Math.min(o,a)),u=D.negativePiToPi(Math.max(r,s));return i.west=c,i.south=Math.min(t.south,n.south),i.east=u,i.north=Math.max(t.north,n.north),i}static expand(t,n,i){return l(i)||(i=new e),i.west=Math.min(t.west,n.longitude),i.south=Math.min(t.south,n.latitude),i.east=Math.max(t.east,n.longitude),i.north=Math.max(t.north,n.latitude),i}static contains(t,n){let i=n.longitude,r=n.latitude,o=t.west,s=t.east;return s<o&&(s+=D.TWO_PI,i<0&&(i+=D.TWO_PI)),(i>o||D.equalsEpsilon(i,o,D.EPSILON14))&&(i<s||D.equalsEpsilon(i,s,D.EPSILON14))&&r>=t.south&&r<=t.north}static subsample(t,n,i,r){n=n??ee.default,i=i??0,l(r)||(r=[]);let o=0,s=t.north,a=t.south,c=t.east,u=t.west,f=_Ve;f.height=i,f.longitude=u,f.latitude=s,r[o]=n.cartographicToCartesian(f,r[o]),o++,f.longitude=c,r[o]=n.cartographicToCartesian(f,r[o]),o++,f.latitude=a,r[o]=n.cartographicToCartesian(f,r[o]),o++,f.longitude=u,r[o]=n.cartographicToCartesian(f,r[o]),o++,s<0?f.latitude=s:a>0?f.latitude=a:f.latitude=0;for(let d=1;d<8;++d)f.longitude=-Math.PI+d*D.PI_OVER_TWO,e.contains(t,f)&&(r[o]=n.cartographicToCartesian(f,r[o]),o++);return f.latitude===0&&(f.longitude=u,r[o]=n.cartographicToCartesian(f,r[o]),o++,f.longitude=c,r[o]=n.cartographicToCartesian(f,r[o]),o++),r.length=o,r}static subsection(t,n,i,r,o,s){if(l(s)||(s=new e),t.west<=t.east){let c=t.east-t.west;s.west=t.west+n*c,s.east=t.west+r*c}else{let c=D.TWO_PI+t.east-t.west;s.west=D.negativePiToPi(t.west+n*c),s.east=D.negativePiToPi(t.west+r*c)}let a=t.north-t.south;return s.south=t.south+i*a,s.north=t.south+o*a,n===1&&(s.west=t.east),r===1&&(s.east=t.east),i===1&&(s.south=t.north),o===1&&(s.north=t.north),s}};gv.packedLength=4;var dVe=new N,hVe=new h,mVe=new h,pVe=new h,gVe=new h,AY=new Array(5);for(let e=0;e<AY.length;++e)AY[e]=new h;var _Ve=new he;gv.MAX_VALUE=Object.freeze(new gv(-Math.PI,-D.PI_OVER_TWO,Math.PI,D.PI_OVER_TWO));var ie=gv;function gs(e,t,n,i){this.x=e??0,this.y=t??0,this.width=n??0,this.height=i??0}gs.packedLength=4;gs.pack=function(e,t,n){return n=n??0,t[n++]=e.x,t[n++]=e.y,t[n++]=e.width,t[n]=e.height,t};gs.unpack=function(e,t,n){return t=t??0,l(n)||(n=new gs),n.x=e[t++],n.y=e[t++],n.width=e[t++],n.height=e[t],n};gs.fromPoints=function(e,t){if(l(t)||(t=new gs),!l(e)||e.length===0)return t.x=0,t.y=0,t.width=0,t.height=0,t;let n=e.length,i=e[0].x,r=e[0].y,o=e[0].x,s=e[0].y;for(let a=1;a<n;a++){let c=e[a],u=c.x,f=c.y;i=Math.min(u,i),o=Math.max(u,o),r=Math.min(f,r),s=Math.max(f,s)}return t.x=i,t.y=r,t.width=o-i,t.height=s-r,t};var xfe=new Ui,yVe=new he,AVe=new he;gs.fromRectangle=function(e,t,n){if(l(n)||(n=new gs),!l(e))return n.x=0,n.y=0,n.width=0,n.height=0,n;xfe._ellipsoid=ee.default,t=t??xfe;let i=t.project(ie.southwest(e,yVe)),r=t.project(ie.northeast(e,AVe));return U.subtract(r,i,r),n.x=i.x,n.y=i.y,n.width=r.x,n.height=r.y,n};gs.clone=function(e,t){if(l(e))return l(t)?(t.x=e.x,t.y=e.y,t.width=e.width,t.height=e.height,t):new gs(e.x,e.y,e.width,e.height)};gs.union=function(e,t,n){l(n)||(n=new gs);let i=Math.min(e.x,t.x),r=Math.min(e.y,t.y),o=Math.max(e.x+e.width,t.x+t.width),s=Math.max(e.y+e.height,t.y+t.height);return n.x=i,n.y=r,n.width=o-i,n.height=s-r,n};gs.expand=function(e,t,n){n=gs.clone(e,n);let i=t.x-n.x,r=t.y-n.y;return i>n.width?n.width=i:i<0&&(n.width-=i,n.x=t.x),r>n.height?n.height=r:r<0&&(n.height-=r,n.y=t.y),n};gs.intersect=function(e,t){let n=e.x,i=e.y,r=t.x,o=t.y;return n>r+t.width||n+e.width<r||i+e.height<o||i>o+t.height?$t.OUTSIDE:$t.INTERSECTING};gs.equals=function(e,t){return e===t||l(e)&&l(t)&&e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height};gs.prototype.clone=function(e){return gs.clone(this,e)};gs.prototype.intersect=function(e){return gs.intersect(this,e)};gs.prototype.equals=function(e){return gs.equals(this,e)};var et=gs;var ic={POINTS:te.POINTS,LINES:te.LINES,LINE_LOOP:te.LINE_LOOP,LINE_STRIP:te.LINE_STRIP,TRIANGLES:te.TRIANGLES,TRIANGLE_STRIP:te.TRIANGLE_STRIP,TRIANGLE_FAN:te.TRIANGLE_FAN};ic.isLines=function(e){return e===ic.LINES||e===ic.LINE_LOOP||e===ic.LINE_STRIP};ic.isTriangles=function(e){return e===ic.TRIANGLES||e===ic.TRIANGLE_STRIP||e===ic.TRIANGLE_FAN};ic.validate=function(e){return e===ic.POINTS||e===ic.LINES||e===ic.LINE_LOOP||e===ic.LINE_STRIP||e===ic.TRIANGLES||e===ic.TRIANGLE_STRIP||e===ic.TRIANGLE_FAN};Object.freeze(ic);var Oe=ic;var ux=`in vec4 position; in vec2 textureCoordinates; out vec2 v_textureCoordinates; void main() @@ -85,14 +85,14 @@ void main() gl_Position = position; v_textureCoordinates = textureCoordinates; } -`;var ts={CULL:1,OCCLUDE:2,EXECUTE_IN_CLOSEST_FRUSTUM:4,DEBUG_SHOW_BOUNDING_VOLUME:8,CAST_SHADOWS:16,RECEIVE_SHADOWS:32,PICK_ONLY:64,DEPTH_FOR_TRANSLUCENT_CLASSIFICATION:128},bY=class e{constructor(t=H.EMPTY_OBJECT){this._boundingVolume=t.boundingVolume,this._orientedBoundingBox=t.orientedBoundingBox,this._modelMatrix=t.modelMatrix,this._primitiveType=t.primitiveType??Oe.TRIANGLES,this._vertexArray=t.vertexArray,this._count=t.count,this._offset=t.offset??0,this._instanceCount=t.instanceCount??0,this._shaderProgram=t.shaderProgram,this._uniformMap=t.uniformMap,this._renderState=t.renderState,this._framebuffer=t.framebuffer,this._pass=t.pass,this._owner=t.owner,this._debugOverlappingFrustums=0,this._pickId=t.pickId,this._snapId=t.snapId,this._pickMetadataAllowed=t.pickMetadataAllowed===!0,this._pickedMetadataInfo=void 0,this._flags=0,this.cull=t.cull??!0,this.occlude=t.occlude??!0,this.executeInClosestFrustum=t.executeInClosestFrustum??!1,this.debugShowBoundingVolume=t.debugShowBoundingVolume??!1,this.castShadows=t.castShadows??!1,this.receiveShadows=t.receiveShadows??!1,this.pickOnly=t.pickOnly??!1,this.depthForTranslucentClassification=t.depthForTranslucentClassification??!1,this.dirty=!0,this.lastDirtyTime=0,this.derivedCommands={}}get boundingVolume(){return this._boundingVolume}set boundingVolume(t){this._boundingVolume!==t&&(this._boundingVolume=t,this.dirty=!0)}get orientedBoundingBox(){return this._orientedBoundingBox}set orientedBoundingBox(t){this._orientedBoundingBox!==t&&(this._orientedBoundingBox=t,this.dirty=!0)}get cull(){return Jc(this,ts.CULL)}set cull(t){Jc(this,ts.CULL)!==t&&(Ny(this,ts.CULL,t),this.dirty=!0)}get occlude(){return Jc(this,ts.OCCLUDE)}set occlude(t){Jc(this,ts.OCCLUDE)!==t&&(Ny(this,ts.OCCLUDE,t),this.dirty=!0)}get modelMatrix(){return this._modelMatrix}set modelMatrix(t){this._modelMatrix!==t&&(this._modelMatrix=t,this.dirty=!0)}get primitiveType(){return this._primitiveType}set primitiveType(t){this._primitiveType!==t&&(this._primitiveType=t,this.dirty=!0)}get vertexArray(){return this._vertexArray}set vertexArray(t){this._vertexArray!==t&&(this._vertexArray=t,this.dirty=!0)}get count(){return this._count}set count(t){this._count!==t&&(this._count=t,this.dirty=!0)}get offset(){return this._offset}set offset(t){this._offset!==t&&(this._offset=t,this.dirty=!0)}get instanceCount(){return this._instanceCount}set instanceCount(t){this._instanceCount!==t&&(this._instanceCount=t,this.dirty=!0)}get shaderProgram(){return this._shaderProgram}set shaderProgram(t){this._shaderProgram!==t&&(this._shaderProgram=t,this.dirty=!0)}get castShadows(){return Jc(this,ts.CAST_SHADOWS)}set castShadows(t){Jc(this,ts.CAST_SHADOWS)!==t&&(Ny(this,ts.CAST_SHADOWS,t),this.dirty=!0)}get receiveShadows(){return Jc(this,ts.RECEIVE_SHADOWS)}set receiveShadows(t){Jc(this,ts.RECEIVE_SHADOWS)!==t&&(Ny(this,ts.RECEIVE_SHADOWS,t),this.dirty=!0)}get uniformMap(){return this._uniformMap}set uniformMap(t){this._uniformMap!==t&&(this._uniformMap=t,this.dirty=!0)}get renderState(){return this._renderState}set renderState(t){this._renderState!==t&&(this._renderState=t,this.dirty=!0)}get framebuffer(){return this._framebuffer}set framebuffer(t){this._framebuffer!==t&&(this._framebuffer=t,this.dirty=!0)}get pass(){return this._pass}set pass(t){this._pass!==t&&(this._pass=t,this.dirty=!0)}get executeInClosestFrustum(){return Jc(this,ts.EXECUTE_IN_CLOSEST_FRUSTUM)}set executeInClosestFrustum(t){Jc(this,ts.EXECUTE_IN_CLOSEST_FRUSTUM)!==t&&(Ny(this,ts.EXECUTE_IN_CLOSEST_FRUSTUM,t),this.dirty=!0)}get owner(){return this._owner}set owner(t){this._owner!==t&&(this._owner=t,this.dirty=!0)}get debugShowBoundingVolume(){return Jc(this,ts.DEBUG_SHOW_BOUNDING_VOLUME)}set debugShowBoundingVolume(t){Jc(this,ts.DEBUG_SHOW_BOUNDING_VOLUME)!==t&&(Ny(this,ts.DEBUG_SHOW_BOUNDING_VOLUME,t),this.dirty=!0)}get debugOverlappingFrustums(){return this._debugOverlappingFrustums}set debugOverlappingFrustums(t){this._debugOverlappingFrustums!==t&&(this._debugOverlappingFrustums=t,this.dirty=!0)}get pickId(){return this._pickId}set pickId(t){this._pickId!==t&&(this._pickId=t,this.dirty=!0)}get snapId(){return this._snapId}set snapId(t){this._snapId!==t&&(this._snapId=t,this.dirty=!0)}get pickMetadataAllowed(){return this._pickMetadataAllowed}get pickedMetadataInfo(){return this._pickedMetadataInfo}set pickedMetadataInfo(t){this._pickedMetadataInfo!==t&&(this._pickedMetadataInfo=t,this.dirty=!0)}get pickOnly(){return Jc(this,ts.PICK_ONLY)}set pickOnly(t){Jc(this,ts.PICK_ONLY)!==t&&(Ny(this,ts.PICK_ONLY,t),this.dirty=!0)}get depthForTranslucentClassification(){return Jc(this,ts.DEPTH_FOR_TRANSLUCENT_CLASSIFICATION)}set depthForTranslucentClassification(t){Jc(this,ts.DEPTH_FOR_TRANSLUCENT_CLASSIFICATION)!==t&&(Ny(this,ts.DEPTH_FOR_TRANSLUCENT_CLASSIFICATION,t),this.dirty=!0)}static shallowClone(t,n){if(l(t))return l(n)||(n=new e),n._boundingVolume=t._boundingVolume,n._orientedBoundingBox=t._orientedBoundingBox,n._modelMatrix=t._modelMatrix,n._primitiveType=t._primitiveType,n._vertexArray=t._vertexArray,n._count=t._count,n._offset=t._offset,n._instanceCount=t._instanceCount,n._shaderProgram=t._shaderProgram,n._uniformMap=t._uniformMap,n._renderState=t._renderState,n._framebuffer=t._framebuffer,n._pass=t._pass,n._owner=t._owner,n._debugOverlappingFrustums=t._debugOverlappingFrustums,n._pickId=t._pickId,n._snapId=t._snapId,n._pickMetadataAllowed=t._pickMetadataAllowed,n._pickedMetadataInfo=t._pickedMetadataInfo,n._flags=t._flags,n.dirty=!0,n.lastDirtyTime=0,n}execute(t,n){t.draw(this,n)}};function Jc(e,t){return(e._flags&t)===t}function Ny(e,t,n){n?e._flags|=t:e._flags&=~t}var at=bY;var Oi={UNSIGNED_BYTE:te.UNSIGNED_BYTE,UNSIGNED_SHORT:te.UNSIGNED_SHORT,UNSIGNED_INT:te.UNSIGNED_INT,FLOAT:te.FLOAT,HALF_FLOAT:te.HALF_FLOAT_OES,UNSIGNED_INT_24_8:te.UNSIGNED_INT_24_8,UNSIGNED_SHORT_4_4_4_4:te.UNSIGNED_SHORT_4_4_4_4,UNSIGNED_SHORT_5_5_5_1:te.UNSIGNED_SHORT_5_5_5_1,UNSIGNED_SHORT_5_6_5:te.UNSIGNED_SHORT_5_6_5};Oi.toWebGLConstant=function(e,t){switch(e){case Oi.UNSIGNED_BYTE:return te.UNSIGNED_BYTE;case Oi.UNSIGNED_SHORT:return te.UNSIGNED_SHORT;case Oi.UNSIGNED_INT:return te.UNSIGNED_INT;case Oi.FLOAT:return te.FLOAT;case Oi.HALF_FLOAT:return t.webgl2?te.HALF_FLOAT:te.HALF_FLOAT_OES;case Oi.UNSIGNED_INT_24_8:return te.UNSIGNED_INT_24_8;case Oi.UNSIGNED_SHORT_4_4_4_4:return te.UNSIGNED_SHORT_4_4_4_4;case Oi.UNSIGNED_SHORT_5_5_5_1:return te.UNSIGNED_SHORT_5_5_5_1;case Oi.UNSIGNED_SHORT_5_6_5:return Oi.UNSIGNED_SHORT_5_6_5}};Oi.isPacked=function(e){return e===Oi.UNSIGNED_INT_24_8||e===Oi.UNSIGNED_SHORT_4_4_4_4||e===Oi.UNSIGNED_SHORT_5_5_5_1||e===Oi.UNSIGNED_SHORT_5_6_5};Oi.sizeInBytes=function(e){switch(e){case Oi.UNSIGNED_BYTE:return 1;case Oi.UNSIGNED_SHORT:case Oi.UNSIGNED_SHORT_4_4_4_4:case Oi.UNSIGNED_SHORT_5_5_5_1:case Oi.UNSIGNED_SHORT_5_6_5:case Oi.HALF_FLOAT:return 2;case Oi.UNSIGNED_INT:case Oi.FLOAT:case Oi.UNSIGNED_INT_24_8:return 4}};Oi.validate=function(e){return e===Oi.UNSIGNED_BYTE||e===Oi.UNSIGNED_SHORT||e===Oi.UNSIGNED_INT||e===Oi.FLOAT||e===Oi.HALF_FLOAT||e===Oi.UNSIGNED_INT_24_8||e===Oi.UNSIGNED_SHORT_4_4_4_4||e===Oi.UNSIGNED_SHORT_5_5_5_1||e===Oi.UNSIGNED_SHORT_5_6_5};Oi.getTypedArrayConstructor=function(e){let t=Oi.sizeInBytes(e);return t===Uint8Array.BYTES_PER_ELEMENT?Uint8Array:t===Uint16Array.BYTES_PER_ELEMENT?Uint16Array:t===Float32Array.BYTES_PER_ELEMENT&&e===Oi.FLOAT?Float32Array:Uint32Array};Object.freeze(Oi);var ze=Oi;var ot={DEPTH_COMPONENT:te.DEPTH_COMPONENT,DEPTH_STENCIL:te.DEPTH_STENCIL,ALPHA:te.ALPHA,RED:te.RED,RG:te.RG,RGB:te.RGB,RGBA:te.RGBA,RED_INTEGER:te.RED_INTEGER,RG_INTEGER:te.RG_INTEGER,RGB_INTEGER:te.RGB_INTEGER,RGBA_INTEGER:te.RGBA_INTEGER,LUMINANCE:te.LUMINANCE,LUMINANCE_ALPHA:te.LUMINANCE_ALPHA,RGB_DXT1:te.COMPRESSED_RGB_S3TC_DXT1_EXT,RGBA_DXT1:te.COMPRESSED_RGBA_S3TC_DXT1_EXT,RGBA_DXT3:te.COMPRESSED_RGBA_S3TC_DXT3_EXT,RGBA_DXT5:te.COMPRESSED_RGBA_S3TC_DXT5_EXT,RGB_PVRTC_4BPPV1:te.COMPRESSED_RGB_PVRTC_4BPPV1_IMG,RGB_PVRTC_2BPPV1:te.COMPRESSED_RGB_PVRTC_2BPPV1_IMG,RGBA_PVRTC_4BPPV1:te.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG,RGBA_PVRTC_2BPPV1:te.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG,RGBA_ASTC:te.COMPRESSED_RGBA_ASTC_4x4_WEBGL,RGB_ETC1:te.COMPRESSED_RGB_ETC1_WEBGL,RGB8_ETC2:te.COMPRESSED_RGB8_ETC2,RGBA8_ETC2_EAC:te.COMPRESSED_RGBA8_ETC2_EAC,RGBA_BC7:te.COMPRESSED_RGBA_BPTC_UNORM};ot.componentsLength=function(e){switch(e){case ot.RGB:case ot.RGB_INTEGER:return 3;case ot.RGBA:case ot.RGBA_INTEGER:return 4;case ot.LUMINANCE_ALPHA:case ot.RG:case ot.RG_INTEGER:return 2;case ot.ALPHA:case ot.RED:case ot.RED_INTEGER:case ot.LUMINANCE:return 1;default:return 1}};ot.validate=function(e){return e===ot.DEPTH_COMPONENT||e===ot.DEPTH_STENCIL||e===ot.ALPHA||e===ot.RED||e===ot.RG||e===ot.RGB||e===ot.RGBA||e===ot.RED_INTEGER||e===ot.RG_INTEGER||e===ot.RGB_INTEGER||e===ot.RGBA_INTEGER||e===ot.LUMINANCE||e===ot.LUMINANCE_ALPHA||e===ot.RGB_DXT1||e===ot.RGBA_DXT1||e===ot.RGBA_DXT3||e===ot.RGBA_DXT5||e===ot.RGB_PVRTC_4BPPV1||e===ot.RGB_PVRTC_2BPPV1||e===ot.RGBA_PVRTC_4BPPV1||e===ot.RGBA_PVRTC_2BPPV1||e===ot.RGBA_ASTC||e===ot.RGB_ETC1||e===ot.RGB8_ETC2||e===ot.RGBA8_ETC2_EAC||e===ot.RGBA_BC7};ot.isColorFormat=function(e){return e===ot.RED||e===ot.ALPHA||e===ot.RGB||e===ot.RGBA||e===ot.LUMINANCE||e===ot.LUMINANCE_ALPHA};ot.isDepthFormat=function(e){return e===ot.DEPTH_COMPONENT||e===ot.DEPTH_STENCIL};ot.isCompressedFormat=function(e){return e===ot.RGB_DXT1||e===ot.RGBA_DXT1||e===ot.RGBA_DXT3||e===ot.RGBA_DXT5||e===ot.RGB_PVRTC_4BPPV1||e===ot.RGB_PVRTC_2BPPV1||e===ot.RGBA_PVRTC_4BPPV1||e===ot.RGBA_PVRTC_2BPPV1||e===ot.RGBA_ASTC||e===ot.RGB_ETC1||e===ot.RGB8_ETC2||e===ot.RGBA8_ETC2_EAC||e===ot.RGBA_BC7};ot.isDXTFormat=function(e){return e===ot.RGB_DXT1||e===ot.RGBA_DXT1||e===ot.RGBA_DXT3||e===ot.RGBA_DXT5};ot.isPVRTCFormat=function(e){return e===ot.RGB_PVRTC_4BPPV1||e===ot.RGB_PVRTC_2BPPV1||e===ot.RGBA_PVRTC_4BPPV1||e===ot.RGBA_PVRTC_2BPPV1};ot.isASTCFormat=function(e){return e===ot.RGBA_ASTC};ot.isETC1Format=function(e){return e===ot.RGB_ETC1};ot.isETC2Format=function(e){return e===ot.RGB8_ETC2||e===ot.RGBA8_ETC2_EAC};ot.isBC7Format=function(e){return e===ot.RGBA_BC7};ot.compressedTextureSizeInBytes=function(e,t,n){switch(e){case ot.RGB_DXT1:case ot.RGBA_DXT1:case ot.RGB_ETC1:case ot.RGB8_ETC2:return Math.floor((t+3)/4)*Math.floor((n+3)/4)*8;case ot.RGBA_DXT3:case ot.RGBA_DXT5:case ot.RGBA_ASTC:case ot.RGBA8_ETC2_EAC:return Math.floor((t+3)/4)*Math.floor((n+3)/4)*16;case ot.RGB_PVRTC_4BPPV1:case ot.RGBA_PVRTC_4BPPV1:return Math.floor((Math.max(t,8)*Math.max(n,8)*4+7)/8);case ot.RGB_PVRTC_2BPPV1:case ot.RGBA_PVRTC_2BPPV1:return Math.floor((Math.max(t,16)*Math.max(n,8)*2+7)/8);case ot.RGBA_BC7:return Math.ceil(t/4)*Math.ceil(n/4)*16;default:return 0}};ot.textureSizeInBytes=function(e,t,n,i){let r=ot.componentsLength(e);return ze.isPacked(t)&&(r=1),r*ze.sizeInBytes(t)*n*i};ot.texture3DSizeInBytes=function(e,t,n,i,r){let o=ot.componentsLength(e);return ze.isPacked(t)&&(o=1),o*ze.sizeInBytes(t)*n*i*r};ot.alignmentInBytes=function(e,t,n){let i=ot.textureSizeInBytes(e,t,n,1)%4;return i===0?4:i===2?2:1};ot.createTypedArray=function(e,t,n,i){let r=ze.getTypedArrayConstructor(t),o=ot.componentsLength(e)*n*i;return new r(o)};ot.flipY=function(e,t,n,i,r){if(r===1)return e;let o=ot.createTypedArray(t,n,i,r),s=ot.componentsLength(t),a=i*s;for(let c=0;c<r;++c){let u=c*i*s,f=(r-c-1)*i*s;for(let d=0;d<a;++d)o[f+d]=e[u+d]}return o};ot.toInternalFormat=function(e,t,n){if(!n.webgl2)return e;if(e===ot.DEPTH_STENCIL)return te.DEPTH24_STENCIL8;if(e===ot.DEPTH_COMPONENT){if(t===ze.UNSIGNED_SHORT)return te.DEPTH_COMPONENT16;if(t===ze.UNSIGNED_INT)return te.DEPTH_COMPONENT24}if(t===ze.FLOAT)switch(e){case ot.RGBA:return te.RGBA32F;case ot.RGB:return te.RGB32F;case ot.RG:return te.RG32F;case ot.RED:return te.R32F}if(t===ze.HALF_FLOAT)switch(e){case ot.RGBA:return te.RGBA16F;case ot.RGB:return te.RGB16F;case ot.RG:return te.RG16F;case ot.RED:return te.R16F}if(t===ze.UNSIGNED_BYTE)switch(e){case ot.RGBA:return te.RGBA8;case ot.RGB:return te.RGB8;case ot.RG:return te.RG8;case ot.RED:return te.R8}if(t===ze.INT)switch(e){case ot.RGBA_INTEGER:return te.RGBA32I;case ot.RGB_INTEGER:return te.RGB32I;case ot.RG_INTEGER:return te.RG32I;case ot.RED_INTEGER:return te.R32I}if(t===ze.UNSIGNED_INT)switch(e){case ot.RGBA_INTEGER:return te.RGBA32UI;case ot.RGB_INTEGER:return te.RGB32UI;case ot.RG_INTEGER:return te.RG32UI;case ot.RED_INTEGER:return te.R32UI}return e};Object.freeze(ot);var Ke=ot;var Vo={_maximumCombinedTextureImageUnits:0,_maximumCubeMapSize:0,_maximumFragmentUniformVectors:0,_maximumTextureImageUnits:0,_maximumRenderbufferSize:0,_maximumTextureSize:0,_maximum3DTextureSize:0,_maximumVaryingVectors:0,_maximumVertexAttributes:0,_maximumVertexTextureImageUnits:0,_maximumVertexUniformVectors:0,_minimumAliasedLineWidth:0,_maximumAliasedLineWidth:0,_minimumAliasedPointSize:0,_maximumAliasedPointSize:0,_maximumViewportWidth:0,_maximumViewportHeight:0,_maximumTextureFilterAnisotropy:0,_maximumDrawBuffers:0,_maximumColorAttachments:0,_maximumSamples:0,_highpFloatSupported:!1,_highpIntSupported:!1};Object.defineProperties(Vo,{maximumCombinedTextureImageUnits:{get:function(){return Vo._maximumCombinedTextureImageUnits}},maximumCubeMapSize:{get:function(){return Vo._maximumCubeMapSize}},maximumFragmentUniformVectors:{get:function(){return Vo._maximumFragmentUniformVectors}},maximumTextureImageUnits:{get:function(){return Vo._maximumTextureImageUnits}},maximumRenderbufferSize:{get:function(){return Vo._maximumRenderbufferSize}},maximumTextureSize:{get:function(){return Vo._maximumTextureSize}},maximum3DTextureSize:{get:function(){return Vo._maximum3DTextureSize}},maximumVaryingVectors:{get:function(){return Vo._maximumVaryingVectors}},maximumVertexAttributes:{get:function(){return Vo._maximumVertexAttributes}},maximumVertexTextureImageUnits:{get:function(){return Vo._maximumVertexTextureImageUnits}},maximumVertexUniformVectors:{get:function(){return Vo._maximumVertexUniformVectors}},minimumAliasedLineWidth:{get:function(){return Vo._minimumAliasedLineWidth}},maximumAliasedLineWidth:{get:function(){return Vo._maximumAliasedLineWidth}},minimumAliasedPointSize:{get:function(){return Vo._minimumAliasedPointSize}},maximumAliasedPointSize:{get:function(){return Vo._maximumAliasedPointSize}},maximumViewportWidth:{get:function(){return Vo._maximumViewportWidth}},maximumViewportHeight:{get:function(){return Vo._maximumViewportHeight}},maximumTextureFilterAnisotropy:{get:function(){return Vo._maximumTextureFilterAnisotropy}},maximumDrawBuffers:{get:function(){return Vo._maximumDrawBuffers}},maximumColorAttachments:{get:function(){return Vo._maximumColorAttachments}},maximumSamples:{get:function(){return Vo._maximumSamples}},highpFloatSupported:{get:function(){return Vo._highpFloatSupported}},highpIntSupported:{get:function(){return Vo._highpIntSupported}}});var kt=Vo;function xY(e,t,n){let i=e._gl;i.framebufferTexture2D(i.FRAMEBUFFER,t,n._target,n._texture,0)}function Qj(e,t,n){let i=e._gl;i.framebufferRenderbuffer(i.FRAMEBUFFER,t,i.RENDERBUFFER,n._getRenderbuffer())}function Vh(e){e=e??H.EMPTY_OBJECT;let t=e.context,n=t._gl,i=kt.maximumColorAttachments;if(this._gl=n,this._framebuffer=n.createFramebuffer(),this._colorTextures=[],this._colorRenderbuffers=[],this._activeColorAttachments=[],this._depthTexture=void 0,this._depthRenderbuffer=void 0,this._stencilRenderbuffer=void 0,this._depthStencilTexture=void 0,this._depthStencilRenderbuffer=void 0,this.destroyAttachments=e.destroyAttachments??!0,this._bind(),l(e.colorTextures)){let r=e.colorTextures,o=this._colorTextures.length=this._activeColorAttachments.length=r.length;for(let s=0;s<o;++s){let a=r[s],c=this._gl.COLOR_ATTACHMENT0+s;xY(this,c,a),this._activeColorAttachments[s]=c,this._colorTextures[s]=a}}if(l(e.colorRenderbuffers)){let r=e.colorRenderbuffers,o=this._colorRenderbuffers.length=this._activeColorAttachments.length=r.length;for(let s=0;s<o;++s){let a=r[s],c=this._gl.COLOR_ATTACHMENT0+s;Qj(this,c,a),this._activeColorAttachments[s]=c,this._colorRenderbuffers[s]=a}}if(l(e.depthTexture)){let r=e.depthTexture;xY(this,this._gl.DEPTH_ATTACHMENT,r),this._depthTexture=r}if(l(e.depthRenderbuffer)){let r=e.depthRenderbuffer;Qj(this,this._gl.DEPTH_ATTACHMENT,r),this._depthRenderbuffer=r}if(l(e.stencilRenderbuffer)){let r=e.stencilRenderbuffer;Qj(this,this._gl.STENCIL_ATTACHMENT,r),this._stencilRenderbuffer=r}if(l(e.depthStencilTexture)){let r=e.depthStencilTexture;xY(this,this._gl.DEPTH_STENCIL_ATTACHMENT,r),this._depthStencilTexture=r}if(l(e.depthStencilRenderbuffer)){let r=e.depthStencilRenderbuffer;Qj(this,this._gl.DEPTH_STENCIL_ATTACHMENT,r),this._depthStencilRenderbuffer=r}this._unBind(),t._currentFramebuffer=void 0}Object.defineProperties(Vh.prototype,{status:{get:function(){this._bind();let e=this._gl.checkFramebufferStatus(this._gl.FRAMEBUFFER);return this._unBind(),e}},numberOfColorAttachments:{get:function(){return this._activeColorAttachments.length}},depthTexture:{get:function(){return this._depthTexture}},depthRenderbuffer:{get:function(){return this._depthRenderbuffer}},stencilRenderbuffer:{get:function(){return this._stencilRenderbuffer}},depthStencilTexture:{get:function(){return this._depthStencilTexture}},depthStencilRenderbuffer:{get:function(){return this._depthStencilRenderbuffer}},hasDepthAttachment:{get:function(){return!!(this.depthTexture||this.depthRenderbuffer||this.depthStencilTexture||this.depthStencilRenderbuffer)}}});Vh.prototype._bind=function(){let e=this._gl;e.bindFramebuffer(e.FRAMEBUFFER,this._framebuffer)};Vh.prototype._unBind=function(){let e=this._gl;e.bindFramebuffer(e.FRAMEBUFFER,null)};Vh.prototype.bindDraw=function(){let e=this._gl;e.bindFramebuffer(e.DRAW_FRAMEBUFFER,this._framebuffer)};Vh.prototype.bindRead=function(){let e=this._gl;e.bindFramebuffer(e.READ_FRAMEBUFFER,this._framebuffer)};Vh.prototype._getActiveColorAttachments=function(){return this._activeColorAttachments};Vh.prototype.getColorTexture=function(e){return this._colorTextures[e]};Vh.prototype.getColorRenderbuffer=function(e){return this._colorRenderbuffers[e]};Vh.prototype.isDestroyed=function(){return!1};Vh.prototype.destroy=function(){if(this.destroyAttachments){let e=this._colorTextures;for(let n=0;n<e.length;++n){let i=e[n];l(i)&&i.destroy()}let t=this._colorRenderbuffers;for(let n=0;n<t.length;++n){let i=t[n];l(i)&&i.destroy()}this._depthTexture=this._depthTexture&&this._depthTexture.destroy(),this._depthRenderbuffer=this._depthRenderbuffer&&this._depthRenderbuffer.destroy(),this._stencilRenderbuffer=this._stencilRenderbuffer&&this._stencilRenderbuffer.destroy(),this._depthStencilTexture=this._depthStencilTexture&&this._depthStencilTexture.destroy(),this._depthStencilRenderbuffer=this._depthStencilRenderbuffer&&this._depthStencilRenderbuffer.destroy()}return this._gl.deleteFramebuffer(this._framebuffer),le(this)};var _s=Vh;var bD={CLOCKWISE:te.CW,COUNTER_CLOCKWISE:te.CCW};bD.validate=function(e){return e===bD.CLOCKWISE||e===bD.COUNTER_CLOCKWISE};Object.freeze(bD);var Qs=bD;function Tfe(e){if(typeof e!="object"||e===null)return e;let t,n=Object.keys(e);for(let i=0;i<n.length;i++)t=n[i],e.hasOwnProperty(t)&&t!=="_applyFunctions"&&(e[t]=Tfe(e[t]));return Object.freeze(e)}var TY=Tfe;function Rp(e){let t=e??H.EMPTY_OBJECT,n=t.cull??H.EMPTY_OBJECT,i=t.polygonOffset??H.EMPTY_OBJECT,r=t.scissorTest??H.EMPTY_OBJECT,o=r.rectangle??H.EMPTY_OBJECT,s=t.depthRange??H.EMPTY_OBJECT,a=t.depthTest??H.EMPTY_OBJECT,c=t.colorMask??H.EMPTY_OBJECT,u=t.blending??H.EMPTY_OBJECT,f=u.color??H.EMPTY_OBJECT,d=t.stencilTest??H.EMPTY_OBJECT,p=d.frontOperation??H.EMPTY_OBJECT,g=d.backOperation??H.EMPTY_OBJECT,m=t.sampleCoverage??H.EMPTY_OBJECT,y=t.viewport;this.frontFace=t.frontFace??Qs.COUNTER_CLOCKWISE,this.cull={enabled:n.enabled??!1,face:n.face??te.BACK},this.lineWidth=t.lineWidth??1,this.polygonOffset={enabled:i.enabled??!1,factor:i.factor??0,units:i.units??0},this.scissorTest={enabled:r.enabled??!1,rectangle:et.clone(o)},this.depthRange={near:s.near??0,far:s.far??1},this.depthTest={enabled:a.enabled??!1,func:a.func??te.LESS},this.colorMask={red:c.red??!0,green:c.green??!0,blue:c.blue??!0,alpha:c.alpha??!0},this.depthMask=t.depthMask??!0,this.stencilMask=t.stencilMask??-1,this.blending={enabled:u.enabled??!1,color:new z(f.red??0,f.green??0,f.blue??0,f.alpha??0),equationRgb:u.equationRgb??te.FUNC_ADD,equationAlpha:u.equationAlpha??te.FUNC_ADD,functionSourceRgb:u.functionSourceRgb??te.ONE,functionSourceAlpha:u.functionSourceAlpha??te.ONE,functionDestinationRgb:u.functionDestinationRgb??te.ZERO,functionDestinationAlpha:u.functionDestinationAlpha??te.ZERO},this.stencilTest={enabled:d.enabled??!1,frontFunction:d.frontFunction??te.ALWAYS,backFunction:d.backFunction??te.ALWAYS,reference:d.reference??0,mask:d.mask??-1,frontOperation:{fail:p.fail??te.KEEP,zFail:p.zFail??te.KEEP,zPass:p.zPass??te.KEEP},backOperation:{fail:g.fail??te.KEEP,zFail:g.zFail??te.KEEP,zPass:g.zPass??te.KEEP}},this.sampleCoverage={enabled:m.enabled??!1,value:m.value??1,invert:m.invert??!1},this.viewport=l(y)?new et(y.x,y.y,y.width,y.height):void 0,this.id=0,this._applyFunctions=[]}var AVe=0,Dp={};Rp.fromCache=function(e){let t=JSON.stringify(e),n=Dp[t];if(l(n))return++n.referenceCount,n.state;let i=new Rp(e),r=JSON.stringify(i);return n=Dp[r],l(n)||(i.id=AVe++,n={referenceCount:0,state:i},Dp[r]=n),++n.referenceCount,Dp[t]={referenceCount:1,state:n.state},n.state};Rp.removeFromCache=function(e){let t=new Rp(e),n=JSON.stringify(t),i=Dp[n],r=JSON.stringify(e),o=Dp[r];l(o)&&(--o.referenceCount,o.referenceCount===0&&(delete Dp[r],l(i)&&--i.referenceCount)),l(i)&&i.referenceCount===0&&delete Dp[n]};Rp.getCache=function(){return Dp};Rp.clearCache=function(){Dp={}};function fx(e,t,n){n?e.enable(t):e.disable(t)}function Efe(e,t){e.frontFace(t.frontFace)}function Cfe(e,t){let n=t.cull,i=n.enabled;fx(e,e.CULL_FACE,i),i&&e.cullFace(n.face)}function vfe(e,t){e.lineWidth(t.lineWidth)}function Sfe(e,t){let n=t.polygonOffset,i=n.enabled;fx(e,e.POLYGON_OFFSET_FILL,i),i&&e.polygonOffset(n.factor,n.units)}function wfe(e,t,n){let i=t.scissorTest,r=l(n.scissorTest)?n.scissorTest.enabled:i.enabled;if(fx(e,e.SCISSOR_TEST,r),r){let o=l(n.scissorTest)?n.scissorTest.rectangle:i.rectangle;e.scissor(o.x,o.y,o.width,o.height)}}function Ife(e,t){let n=t.depthRange;e.depthRange(n.near,n.far)}function Pfe(e,t){let n=t.depthTest,i=n.enabled;fx(e,e.DEPTH_TEST,i),i&&e.depthFunc(n.func)}function Dfe(e,t){let n=t.colorMask;e.colorMask(n.red,n.green,n.blue,n.alpha)}function Rfe(e,t){e.depthMask(t.depthMask)}function Ofe(e,t){e.stencilMask(t.stencilMask)}function bVe(e,t){e.blendColor(t.red,t.green,t.blue,t.alpha)}function Mfe(e,t,n){let i=t.blending,r=l(n.blendingEnabled)?n.blendingEnabled:i.enabled;fx(e,e.BLEND,r),r&&(bVe(e,i.color),e.blendEquationSeparate(i.equationRgb,i.equationAlpha),e.blendFuncSeparate(i.functionSourceRgb,i.functionDestinationRgb,i.functionSourceAlpha,i.functionDestinationAlpha))}function Nfe(e,t){let n=t.stencilTest,i=n.enabled;if(fx(e,e.STENCIL_TEST,i),i){let r=n.frontFunction,o=n.backFunction,s=n.reference,a=n.mask;e.stencilFunc(r,s,a),e.stencilFuncSeparate(e.BACK,o,s,a),e.stencilFuncSeparate(e.FRONT,r,s,a);let c=n.frontOperation,u=c.fail,f=c.zFail,d=c.zPass;e.stencilOpSeparate(e.FRONT,u,f,d);let p=n.backOperation,g=p.fail,m=p.zFail,y=p.zPass;e.stencilOpSeparate(e.BACK,g,m,y)}}function Lfe(e,t){let n=t.sampleCoverage,i=n.enabled;fx(e,e.SAMPLE_COVERAGE,i),i&&e.sampleCoverage(n.value,n.invert)}var xVe=new et;function Ffe(e,t,n){let i=t.viewport??n.viewport;l(i)||(i=xVe,i.width=n.context.drawingBufferWidth,i.height=n.context.drawingBufferHeight),n.context.uniformState.viewport=i,e.viewport(i.x,i.y,i.width,i.height)}Rp.apply=function(e,t,n){Efe(e,t),Cfe(e,t),vfe(e,t),Sfe(e,t),Ife(e,t),Pfe(e,t),Dfe(e,t),Rfe(e,t),Ofe(e,t),Nfe(e,t),Lfe(e,t),wfe(e,t,n),Mfe(e,t,n),Ffe(e,t,n)};function TVe(e,t){let n=[];return e.frontFace!==t.frontFace&&n.push(Efe),(e.cull.enabled!==t.cull.enabled||e.cull.face!==t.cull.face)&&n.push(Cfe),e.lineWidth!==t.lineWidth&&n.push(vfe),(e.polygonOffset.enabled!==t.polygonOffset.enabled||e.polygonOffset.factor!==t.polygonOffset.factor||e.polygonOffset.units!==t.polygonOffset.units)&&n.push(Sfe),(e.depthRange.near!==t.depthRange.near||e.depthRange.far!==t.depthRange.far)&&n.push(Ife),(e.depthTest.enabled!==t.depthTest.enabled||e.depthTest.func!==t.depthTest.func)&&n.push(Pfe),(e.colorMask.red!==t.colorMask.red||e.colorMask.green!==t.colorMask.green||e.colorMask.blue!==t.colorMask.blue||e.colorMask.alpha!==t.colorMask.alpha)&&n.push(Dfe),e.depthMask!==t.depthMask&&n.push(Rfe),e.stencilMask!==t.stencilMask&&n.push(Ofe),(e.stencilTest.enabled!==t.stencilTest.enabled||e.stencilTest.frontFunction!==t.stencilTest.frontFunction||e.stencilTest.backFunction!==t.stencilTest.backFunction||e.stencilTest.reference!==t.stencilTest.reference||e.stencilTest.mask!==t.stencilTest.mask||e.stencilTest.frontOperation.fail!==t.stencilTest.frontOperation.fail||e.stencilTest.frontOperation.zFail!==t.stencilTest.frontOperation.zFail||e.stencilTest.backOperation.fail!==t.stencilTest.backOperation.fail||e.stencilTest.backOperation.zFail!==t.stencilTest.backOperation.zFail||e.stencilTest.backOperation.zPass!==t.stencilTest.backOperation.zPass)&&n.push(Nfe),(e.sampleCoverage.enabled!==t.sampleCoverage.enabled||e.sampleCoverage.value!==t.sampleCoverage.value||e.sampleCoverage.invert!==t.sampleCoverage.invert)&&n.push(Lfe),n}Rp.partialApply=function(e,t,n,i,r,o){if(t!==n){let f=n._applyFunctions[t.id];l(f)||(f=TVe(t,n),n._applyFunctions[t.id]=f);let d=f.length;for(let p=0;p<d;++p)f[p](e,n)}let s=l(i.scissorTest)?i.scissorTest:t.scissorTest,a=l(r.scissorTest)?r.scissorTest:n.scissorTest;(s!==a||o)&&wfe(e,n,r);let c=l(i.blendingEnabled)?i.blendingEnabled:t.blending.enabled,u=l(r.blendingEnabled)?r.blendingEnabled:n.blending.enabled;(c!==u||u&&t.blending!==n.blending)&&Mfe(e,n,r),(t!==n||i!==r||i.context!==r.context)&&Ffe(e,n,r)};Rp.getState=function(e){return{frontFace:e.frontFace,cull:{enabled:e.cull.enabled,face:e.cull.face},lineWidth:e.lineWidth,polygonOffset:{enabled:e.polygonOffset.enabled,factor:e.polygonOffset.factor,units:e.polygonOffset.units},scissorTest:{enabled:e.scissorTest.enabled,rectangle:et.clone(e.scissorTest.rectangle)},depthRange:{near:e.depthRange.near,far:e.depthRange.far},depthTest:{enabled:e.depthTest.enabled,func:e.depthTest.func},colorMask:{red:e.colorMask.red,green:e.colorMask.green,blue:e.colorMask.blue,alpha:e.colorMask.alpha},depthMask:e.depthMask,stencilMask:e.stencilMask,blending:{enabled:e.blending.enabled,color:z.clone(e.blending.color),equationRgb:e.blending.equationRgb,equationAlpha:e.blending.equationAlpha,functionSourceRgb:e.blending.functionSourceRgb,functionSourceAlpha:e.blending.functionSourceAlpha,functionDestinationRgb:e.blending.functionDestinationRgb,functionDestinationAlpha:e.blending.functionDestinationAlpha},stencilTest:{enabled:e.stencilTest.enabled,frontFunction:e.stencilTest.frontFunction,backFunction:e.stencilTest.backFunction,reference:e.stencilTest.reference,mask:e.stencilTest.mask,frontOperation:{fail:e.stencilTest.frontOperation.fail,zFail:e.stencilTest.frontOperation.zFail,zPass:e.stencilTest.frontOperation.zPass},backOperation:{fail:e.stencilTest.backOperation.fail,zFail:e.stencilTest.backOperation.zFail,zPass:e.stencilTest.backOperation.zPass}},sampleCoverage:{enabled:e.sampleCoverage.enabled,value:e.sampleCoverage.value,invert:e.sampleCoverage.invert},viewport:l(e.viewport)?et.clone(e.viewport):void 0}};var Ge=Rp;var EVe=Object.freeze([NaN,NaN,NaN,NaN]),Ru=class e{constructor(t,n,i,r){let o=Reflect.construct(Array,EVe,new.target);return o[0]=t??0,o[1]=i??0,o[2]=n??0,o[3]=r??0,o}static pack(t,n,i){return i=i??0,n[i++]=t[0],n[i++]=t[1],n[i++]=t[2],n[i]=t[3],n}static unpack(t,n,i){return n=n??0,l(i)||(i=new e),i[0]=t[n++],i[1]=t[n++],i[2]=t[n++],i[3]=t[n],i}static packArray(t,n){let i=t.length,r=i*4;l(n)?!Array.isArray(n)&&n.length!==r||n.length!==r&&(n.length=r):n=new Array(r);for(let o=0;o<i;++o)e.pack(t[o],n,o*4);return n}static unpackArray(t,n){let i=t.length;l(n)?n.length=i/4:n=new Array(i/4);for(let r=0;r<i;r+=4){let o=r/4;n[o]=e.unpack(t,r,n[o])}return n}static clone(t,n){if(l(t))return l(n)?(n[0]=t[0],n[1]=t[1],n[2]=t[2],n[3]=t[3],n):new e(t[0],t[2],t[1],t[3])}static fromColumnMajorArray(t,n){return e.clone(t,n)}static fromRowMajorArray(t,n){return l(n)?(n[0]=t[0],n[1]=t[2],n[2]=t[1],n[3]=t[3],n):new e(t[0],t[1],t[2],t[3])}static fromScale(t,n){return l(n)?(n[0]=t.x,n[1]=0,n[2]=0,n[3]=t.y,n):new e(t.x,0,0,t.y)}static fromUniformScale(t,n){return l(n)?(n[0]=t,n[1]=0,n[2]=0,n[3]=t,n):new e(t,0,0,t)}static fromRotation(t,n){let i=Math.cos(t),r=Math.sin(t);return l(n)?(n[0]=i,n[1]=r,n[2]=-r,n[3]=i,n):new e(i,-r,r,i)}static toArray(t,n){return l(n)?(n[0]=t[0],n[1]=t[1],n[2]=t[2],n[3]=t[3],n):[t[0],t[1],t[2],t[3]]}static getElementIndex(t,n){return t*2+n}static getColumn(t,n,i){let r=n*2,o=t[r],s=t[r+1];return i.x=o,i.y=s,i}static setColumn(t,n,i,r){r=e.clone(t,r);let o=n*2;return r[o]=i.x,r[o+1]=i.y,r}static getRow(t,n,i){let r=t[n],o=t[n+2];return i.x=r,i.y=o,i}static setRow(t,n,i,r){return r=e.clone(t,r),r[n]=i.x,r[n+2]=i.y,r}static setScale(t,n,i){let r=e.getScale(t,CVe),o=n.x/r.x,s=n.y/r.y;return i[0]=t[0]*o,i[1]=t[1]*o,i[2]=t[2]*s,i[3]=t[3]*s,i}static setUniformScale(t,n,i){let r=e.getScale(t,vVe),o=n/r.x,s=n/r.y;return i[0]=t[0]*o,i[1]=t[1]*o,i[2]=t[2]*s,i[3]=t[3]*s,i}static getScale(t,n){return n.x=U.magnitude(U.fromElements(t[0],t[1],Bfe)),n.y=U.magnitude(U.fromElements(t[2],t[3],Bfe)),n}static getMaximumScale(t){return e.getScale(t,kfe),U.maximumComponent(kfe)}static setRotation(t,n,i){let r=e.getScale(t,SVe);return i[0]=n[0]*r.x,i[1]=n[1]*r.x,i[2]=n[2]*r.y,i[3]=n[3]*r.y,i}static getRotation(t,n){let i=e.getScale(t,wVe);return n[0]=t[0]/i.x,n[1]=t[1]/i.x,n[2]=t[2]/i.y,n[3]=t[3]/i.y,n}static multiply(t,n,i){let r=t[0]*n[0]+t[2]*n[1],o=t[0]*n[2]+t[2]*n[3],s=t[1]*n[0]+t[3]*n[1],a=t[1]*n[2]+t[3]*n[3];return i[0]=r,i[1]=s,i[2]=o,i[3]=a,i}static add(t,n,i){return i[0]=t[0]+n[0],i[1]=t[1]+n[1],i[2]=t[2]+n[2],i[3]=t[3]+n[3],i}static subtract(t,n,i){return i[0]=t[0]-n[0],i[1]=t[1]-n[1],i[2]=t[2]-n[2],i[3]=t[3]-n[3],i}static multiplyByVector(t,n,i){let r=t[0]*n.x+t[2]*n.y,o=t[1]*n.x+t[3]*n.y;return i.x=r,i.y=o,i}static multiplyByScalar(t,n,i){return i[0]=t[0]*n,i[1]=t[1]*n,i[2]=t[2]*n,i[3]=t[3]*n,i}static multiplyByScale(t,n,i){return i[0]=t[0]*n.x,i[1]=t[1]*n.x,i[2]=t[2]*n.y,i[3]=t[3]*n.y,i}static multiplyByUniformScale(t,n,i){return i[0]=t[0]*n,i[1]=t[1]*n,i[2]=t[2]*n,i[3]=t[3]*n,i}static negate(t,n){return n[0]=-t[0],n[1]=-t[1],n[2]=-t[2],n[3]=-t[3],n}static transpose(t,n){let i=t[0],r=t[2],o=t[1],s=t[3];return n[0]=i,n[1]=r,n[2]=o,n[3]=s,n}static abs(t,n){return n[0]=Math.abs(t[0]),n[1]=Math.abs(t[1]),n[2]=Math.abs(t[2]),n[3]=Math.abs(t[3]),n}static equals(t,n){return t===n||l(t)&&l(n)&&t[0]===n[0]&&t[1]===n[1]&&t[2]===n[2]&&t[3]===n[3]}static equalsArray(t,n,i){return t[0]===n[i]&&t[1]===n[i+1]&&t[2]===n[i+2]&&t[3]===n[i+3]}static equalsEpsilon(t,n,i){return i=i??0,t===n||l(t)&&l(n)&&Math.abs(t[0]-n[0])<=i&&Math.abs(t[1]-n[1])<=i&&Math.abs(t[2]-n[2])<=i&&Math.abs(t[3]-n[3])<=i}get length(){return e.packedLength}clone(t){return e.clone(this,t)}equals(t){return e.equals(this,t)}equalsEpsilon(t,n){return e.equalsEpsilon(this,t,n)}toString(){return`(${this[0]}, ${this[2]}) -(${this[1]}, ${this[3]})`}};Ru.packedLength=4;Ru.fromArray=Ru.unpack;Ru.IDENTITY=new Ru(1,0,0,1);Ru.ZERO=new Ru(0,0,0,0);Ru.COLUMN0ROW0=0;Ru.COLUMN0ROW1=1;Ru.COLUMN1ROW0=2;Ru.COLUMN1ROW1=3;var CVe=new U,vVe=new U,Bfe=new U,kfe=new U,SVe=new U,wVe=new U,Xi=Ru;function IVe(e,t,n,i){switch(t.type){case e.FLOAT:return new EY(e,t,n,i);case e.FLOAT_VEC2:return new CY(e,t,n,i);case e.FLOAT_VEC3:return new vY(e,t,n,i);case e.FLOAT_VEC4:return new SY(e,t,n,i);case e.SAMPLER_2D:case e.SAMPLER_3D:case e.SAMPLER_CUBE:return new e6(e,t,n,i);case e.UNSIGNED_INT_SAMPLER_2D:return new e6(e,t,n,i);case e.INT:case e.BOOL:return new wY(e,t,n,i);case e.INT_VEC2:case e.BOOL_VEC2:return new IY(e,t,n,i);case e.INT_VEC3:case e.BOOL_VEC3:return new PY(e,t,n,i);case e.INT_VEC4:case e.BOOL_VEC4:return new DY(e,t,n,i);case e.FLOAT_MAT2:return new RY(e,t,n,i);case e.FLOAT_MAT3:return new OY(e,t,n,i);case e.FLOAT_MAT4:return new MY(e,t,n,i);default:throw new oe(`Unrecognized uniform type: ${t.type} for uniform "${n}".`)}}var EY=class{constructor(t,n,i,r){this.name=i,this.value=void 0,this._value=0,this._gl=t,this._location=r}set(){this.value!==this._value&&(this._value=this.value,this._gl.uniform1f(this._location,this.value))}},CY=class{constructor(t,n,i,r){this.name=i,this.value=void 0,this._value=new U,this._gl=t,this._location=r}set(){let t=this.value;U.equals(t,this._value)||(U.clone(t,this._value),this._gl.uniform2f(this._location,t.x,t.y))}},vY=class{constructor(t,n,i,r){this.name=i,this.value=void 0,this._value=void 0,this._gl=t,this._location=r}set(){let t=this.value;l(t.red)?z.equals(t,this._value)||(this._value=z.clone(t,this._value),this._gl.uniform3f(this._location,t.red,t.green,t.blue)):l(t.x)&&(h.equals(t,this._value)||(this._value=h.clone(t,this._value),this._gl.uniform3f(this._location,t.x,t.y,t.z)))}},SY=class{constructor(t,n,i,r){this.name=i,this.value=void 0,this._value=void 0,this._gl=t,this._location=r}set(){let t=this.value;l(t.red)?z.equals(t,this._value)||(this._value=z.clone(t,this._value),this._gl.uniform4f(this._location,t.red,t.green,t.blue,t.alpha)):l(t.x)&&(se.equals(t,this._value)||(this._value=se.clone(t,this._value),this._gl.uniform4f(this._location,t.x,t.y,t.z,t.w)))}},e6=class{constructor(t,n,i,r){this.name=i,this.value=void 0,this._gl=t,this._location=r,this.textureUnitIndex=void 0}set(){let t=this._gl;t.activeTexture(t.TEXTURE0+this.textureUnitIndex);let n=this.value;t.bindTexture(n._target,n._texture)}_setSampler(t){return this.textureUnitIndex=t,this._gl.uniform1i(this._location,t),t+1}},wY=class{constructor(t,n,i,r){this.name=i,this.value=void 0,this._value=0,this._gl=t,this._location=r}set(){this.value!==this._value&&(this._value=this.value,this._gl.uniform1i(this._location,this.value))}},IY=class{constructor(t,n,i,r){this.name=i,this.value=void 0,this._value=new U,this._gl=t,this._location=r}set(){let t=this.value;U.equals(t,this._value)||(U.clone(t,this._value),this._gl.uniform2i(this._location,t.x,t.y))}},PY=class{constructor(t,n,i,r){this.name=i,this.value=void 0,this._value=new h,this._gl=t,this._location=r}set(){let t=this.value;h.equals(t,this._value)||(h.clone(t,this._value),this._gl.uniform3i(this._location,t.x,t.y,t.z))}},DY=class{constructor(t,n,i,r){this.name=i,this.value=void 0,this._value=new se,this._gl=t,this._location=r}set(){let t=this.value;se.equals(t,this._value)||(se.clone(t,this._value),this._gl.uniform4i(this._location,t.x,t.y,t.z,t.w))}},PVe=new Float32Array(4),RY=class{constructor(t,n,i,r){this.name=i,this.value=void 0,this._value=new Xi,this._gl=t,this._location=r}set(){if(!Xi.equalsArray(this.value,this._value,0)){Xi.clone(this.value,this._value);let t=Xi.toArray(this.value,PVe);this._gl.uniformMatrix2fv(this._location,!1,t)}}},DVe=new Float32Array(9),OY=class{constructor(t,n,i,r){this.name=i,this.value=void 0,this._value=new $,this._gl=t,this._location=r}set(){if(!$.equalsArray(this.value,this._value,0)){$.clone(this.value,this._value);let t=$.toArray(this.value,DVe);this._gl.uniformMatrix3fv(this._location,!1,t)}}},RVe=new Float32Array(16),MY=class{constructor(t,n,i,r){this.name=i,this.value=void 0,this._value=new N,this._gl=t,this._location=r}set(){if(!N.equalsArray(this.value,this._value,0)){N.clone(this.value,this._value);let t=N.toArray(this.value,RVe);this._gl.uniformMatrix4fv(this._location,!1,t)}}},xD=IVe;function OVe(e,t,n,i){switch(t.type){case e.FLOAT:return new NY(e,t,n,i);case e.FLOAT_VEC2:return new LY(e,t,n,i);case e.FLOAT_VEC3:return new FY(e,t,n,i);case e.FLOAT_VEC4:return new BY(e,t,n,i);case e.SAMPLER_2D:case e.SAMPLER_3D:case e.SAMPLER_CUBE:return new kY(e,t,n,i);case e.INT:case e.BOOL:return new UY(e,t,n,i);case e.INT_VEC2:case e.BOOL_VEC2:return new zY(e,t,n,i);case e.INT_VEC3:case e.BOOL_VEC3:return new VY(e,t,n,i);case e.INT_VEC4:case e.BOOL_VEC4:return new jY(e,t,n,i);case e.FLOAT_MAT2:return new HY(e,t,n,i);case e.FLOAT_MAT3:return new GY(e,t,n,i);case e.FLOAT_MAT4:return new WY(e,t,n,i);default:throw new oe(`Unrecognized uniform type: ${t.type} for uniform "${n}".`)}}var NY=class{constructor(t,n,i,r){let o=r.length;this.name=i,this.value=new Array(o),this._value=new Float32Array(o),this._gl=t,this._location=r[0]}set(){let t=this.value,n=t.length,i=this._value,r=!1;for(let o=0;o<n;++o){let s=t[o];s!==i[o]&&(i[o]=s,r=!0)}r&&this._gl.uniform1fv(this._location,i)}},LY=class{constructor(t,n,i,r){let o=r.length;this.name=i,this.value=new Array(o),this._value=new Float32Array(o*2),this._gl=t,this._location=r[0]}set(){let t=this.value,n=t.length,i=this._value,r=!1,o=0;for(let s=0;s<n;++s){let a=t[s];U.equalsArray(a,i,o)||(U.pack(a,i,o),r=!0),o+=2}r&&this._gl.uniform2fv(this._location,i)}},FY=class{constructor(t,n,i,r){let o=r.length;this.name=i,this.value=new Array(o),this._value=new Float32Array(o*3),this._gl=t,this._location=r[0]}set(){let t=this.value,n=t.length,i=this._value,r=!1,o=0;for(let s=0;s<n;++s){let a=t[s];l(a.red)?(a.red!==i[o]||a.green!==i[o+1]||a.blue!==i[o+2])&&(i[o]=a.red,i[o+1]=a.green,i[o+2]=a.blue,r=!0):l(a.x)&&(h.equalsArray(a,i,o)||(h.pack(a,i,o),r=!0)),o+=3}r&&this._gl.uniform3fv(this._location,i)}},BY=class{constructor(t,n,i,r){let o=r.length;this.name=i,this.value=new Array(o),this._value=new Float32Array(o*4),this._gl=t,this._location=r[0]}set(){let t=this.value,n=t.length,i=this._value,r=!1,o=0;for(let s=0;s<n;++s){let a=t[s];l(a.red)?z.equalsArray(a,i,o)||(z.pack(a,i,o),r=!0):l(a.x)&&(se.equalsArray(a,i,o)||(se.pack(a,i,o),r=!0)),o+=4}r&&this._gl.uniform4fv(this._location,i)}},kY=class{constructor(t,n,i,r){let o=r.length;this.name=i,this.value=new Array(o),this._value=new Float32Array(o),this._gl=t,this._locations=r,this.textureUnitIndex=void 0}set(){let t=this._gl,n=t.TEXTURE0+this.textureUnitIndex,i=this.value,r=i.length;for(let o=0;o<r;++o){let s=i[o];t.activeTexture(n+o),t.bindTexture(s._target,s._texture)}}_setSampler(t){this.textureUnitIndex=t;let n=this._locations,i=n.length;for(let r=0;r<i;++r){let o=t+r;this._gl.uniform1i(n[r],o)}return t+i}},UY=class{constructor(t,n,i,r){let o=r.length;this.name=i,this.value=new Array(o),this._value=new Int32Array(o),this._gl=t,this._location=r[0]}set(){let t=this.value,n=t.length,i=this._value,r=!1;for(let o=0;o<n;++o){let s=t[o];s!==i[o]&&(i[o]=s,r=!0)}r&&this._gl.uniform1iv(this._location,i)}},zY=class{constructor(t,n,i,r){let o=r.length;this.name=i,this.value=new Array(o),this._value=new Int32Array(o*2),this._gl=t,this._location=r[0]}set(){let t=this.value,n=t.length,i=this._value,r=!1,o=0;for(let s=0;s<n;++s){let a=t[s];U.equalsArray(a,i,o)||(U.pack(a,i,o),r=!0),o+=2}r&&this._gl.uniform2iv(this._location,i)}},VY=class{constructor(t,n,i,r){let o=r.length;this.name=i,this.value=new Array(o),this._value=new Int32Array(o*3),this._gl=t,this._location=r[0]}set(){let t=this.value,n=t.length,i=this._value,r=!1,o=0;for(let s=0;s<n;++s){let a=t[s];h.equalsArray(a,i,o)||(h.pack(a,i,o),r=!0),o+=3}r&&this._gl.uniform3iv(this._location,i)}},jY=class{constructor(t,n,i,r){let o=r.length;this.name=i,this.value=new Array(o),this._value=new Int32Array(o*4),this._gl=t,this._location=r[0]}set(){let t=this.value,n=t.length,i=this._value,r=!1,o=0;for(let s=0;s<n;++s){let a=t[s];se.equalsArray(a,i,o)||(se.pack(a,i,o),r=!0),o+=4}r&&this._gl.uniform4iv(this._location,i)}},HY=class{constructor(t,n,i,r){let o=r.length;this.name=i,this.value=new Array(o),this._value=new Float32Array(o*4),this._gl=t,this._location=r[0]}set(){let t=this.value,n=t.length,i=this._value,r=!1,o=0;for(let s=0;s<n;++s){let a=t[s];Xi.equalsArray(a,i,o)||(Xi.pack(a,i,o),r=!0),o+=4}r&&this._gl.uniformMatrix2fv(this._location,!1,i)}},GY=class{constructor(t,n,i,r){let o=r.length;this.name=i,this.value=new Array(o),this._value=new Float32Array(o*9),this._gl=t,this._location=r[0]}set(){let t=this.value,n=t.length,i=this._value,r=!1,o=0;for(let s=0;s<n;++s){let a=t[s];$.equalsArray(a,i,o)||($.pack(a,i,o),r=!0),o+=9}r&&this._gl.uniformMatrix3fv(this._location,!1,i)}},WY=class{constructor(t,n,i,r){let o=r.length;this.name=i,this.value=new Array(o),this._value=new Float32Array(o*16),this._gl=t,this._location=r[0]}set(){let t=this.value,n=t.length,i=this._value,r=!1,o=0;for(let s=0;s<n;++s){let a=t[s];N.equalsArray(a,i,o)||(N.pack(a,i,o),r=!0),o+=16}r&&this._gl.uniformMatrix4fv(this._location,!1,i)}},TD=OVe;var MVe=0;function cg(e){let t=e.vertexShaderText,n=e.fragmentShaderText;typeof spector<"u"&&(t=t.replace(/^#line/gm,"//#line"),n=n.replace(/^#line/gm,"//#line"));let i=NVe(t,n);this._gl=e.gl,this._logShaderCompilation=e.logShaderCompilation,this._debugShaders=e.debugShaders,this._attributeLocations=e.attributeLocations,this._program=void 0,this._numberOfVertexAttributes=void 0,this._vertexAttributes=void 0,this._uniformsByName=void 0,this._uniforms=void 0,this._automaticUniforms=void 0,this._manualUniforms=void 0,this._duplicateUniformNames=i.duplicateUniformNames,this._cachedShader=void 0,this.maximumTextureUnitIndex=void 0,this._vertexShaderSource=e.vertexShaderSource,this._vertexShaderText=e.vertexShaderText,this._fragmentShaderSource=e.fragmentShaderSource,this._fragmentShaderText=i.fragmentShaderText,this.id=MVe++}cg.fromCache=function(e){return e=e??H.EMPTY_OBJECT,e.context.shaderCache.getShaderProgram(e)};cg.replaceCache=function(e){return e=e??H.EMPTY_OBJECT,e.context.shaderCache.replaceShaderProgram(e)};Object.defineProperties(cg.prototype,{vertexShaderSource:{get:function(){return this._vertexShaderSource}},fragmentShaderSource:{get:function(){return this._fragmentShaderSource}},vertexAttributes:{get:function(){return t6(this),this._vertexAttributes}},numberOfVertexAttributes:{get:function(){return t6(this),this._numberOfVertexAttributes}},allUniforms:{get:function(){return t6(this),this._uniformsByName}}});function Ufe(e){let t=[],n=e.match(/uniform.*?(?![^{]*})(?=[=\[;])/g);if(l(n)){let i=n.length;for(let r=0;r<i;r++){let o=n[r].trim(),s=o.slice(o.lastIndexOf(" ")+1);t.push(s)}}return t}function NVe(e,t){let n={};if(!kt.highpFloatSupported||!kt.highpIntSupported){let i,r,o,s,a=Ufe(e),c=Ufe(t),u=a.length,f=c.length;for(i=0;i<u;i++)for(r=0;r<f;r++)if(a[i]===c[r]){o=a[i],s=`czm_mediump_${o}`;let d=new RegExp(`${o}\\b`,"g");t=t.replace(d,s),n[s]=o}}return{fragmentShaderText:t,duplicateUniformNames:n}}var Op="[Cesium WebGL] ";function LVe(e,t){let n=t._vertexShaderText,i=t._fragmentShaderText,r=e.createShader(e.VERTEX_SHADER);e.shaderSource(r,n),e.compileShader(r);let o=e.createShader(e.FRAGMENT_SHADER);e.shaderSource(o,i),e.compileShader(o);let s=e.createProgram();e.attachShader(s,r),e.attachShader(s,o);let a=t._attributeLocations;if(l(a))for(let p in a)a.hasOwnProperty(p)&&e.bindAttribLocation(s,a[p],p);e.linkProgram(s);let c;if(e.getProgramParameter(s,e.LINK_STATUS))return t._logShaderCompilation&&(c=e.getShaderInfoLog(r),l(c)&&c.length>0&&console.log(`${Op}Vertex shader compile log: ${c}`),c=e.getShaderInfoLog(o),l(c)&&c.length>0&&console.log(`${Op}Fragment shader compile log: ${c}`),c=e.getProgramInfoLog(s),l(c)&&c.length>0&&console.log(`${Op}Shader program link log: ${c}`)),e.deleteShader(r),e.deleteShader(o),s;let u,f=t._debugShaders;throw e.getShaderParameter(o,e.COMPILE_STATUS)?e.getShaderParameter(r,e.COMPILE_STATUS)?(c=e.getProgramInfoLog(s),console.error(`${Op}Shader program link log: ${c}`),d(r,"vertex"),d(o,"fragment"),u=`Program failed to link. Link log: ${c}`):(c=e.getShaderInfoLog(r),console.error(`${Op}Vertex shader compile log: ${c}`),console.error(`${Op} Vertex shader source: +`;var ts={CULL:1,OCCLUDE:2,EXECUTE_IN_CLOSEST_FRUSTUM:4,DEBUG_SHOW_BOUNDING_VOLUME:8,CAST_SHADOWS:16,RECEIVE_SHADOWS:32,PICK_ONLY:64,DEPTH_FOR_TRANSLUCENT_CLASSIFICATION:128},bY=class e{constructor(t=H.EMPTY_OBJECT){this._boundingVolume=t.boundingVolume,this._orientedBoundingBox=t.orientedBoundingBox,this._modelMatrix=t.modelMatrix,this._primitiveType=t.primitiveType??Oe.TRIANGLES,this._vertexArray=t.vertexArray,this._count=t.count,this._offset=t.offset??0,this._instanceCount=t.instanceCount??0,this._shaderProgram=t.shaderProgram,this._uniformMap=t.uniformMap,this._renderState=t.renderState,this._framebuffer=t.framebuffer,this._pass=t.pass,this._owner=t.owner,this._debugOverlappingFrustums=0,this._pickId=t.pickId,this._snapId=t.snapId,this._pickMetadataAllowed=t.pickMetadataAllowed===!0,this._pickedMetadataInfo=void 0,this._flags=0,this.cull=t.cull??!0,this.occlude=t.occlude??!0,this.executeInClosestFrustum=t.executeInClosestFrustum??!1,this.debugShowBoundingVolume=t.debugShowBoundingVolume??!1,this.castShadows=t.castShadows??!1,this.receiveShadows=t.receiveShadows??!1,this.pickOnly=t.pickOnly??!1,this.depthForTranslucentClassification=t.depthForTranslucentClassification??!1,this.dirty=!0,this.lastDirtyTime=0,this.derivedCommands={}}get boundingVolume(){return this._boundingVolume}set boundingVolume(t){this._boundingVolume!==t&&(this._boundingVolume=t,this.dirty=!0)}get orientedBoundingBox(){return this._orientedBoundingBox}set orientedBoundingBox(t){this._orientedBoundingBox!==t&&(this._orientedBoundingBox=t,this.dirty=!0)}get cull(){return Jc(this,ts.CULL)}set cull(t){Jc(this,ts.CULL)!==t&&(Ny(this,ts.CULL,t),this.dirty=!0)}get occlude(){return Jc(this,ts.OCCLUDE)}set occlude(t){Jc(this,ts.OCCLUDE)!==t&&(Ny(this,ts.OCCLUDE,t),this.dirty=!0)}get modelMatrix(){return this._modelMatrix}set modelMatrix(t){this._modelMatrix!==t&&(this._modelMatrix=t,this.dirty=!0)}get primitiveType(){return this._primitiveType}set primitiveType(t){this._primitiveType!==t&&(this._primitiveType=t,this.dirty=!0)}get vertexArray(){return this._vertexArray}set vertexArray(t){this._vertexArray!==t&&(this._vertexArray=t,this.dirty=!0)}get count(){return this._count}set count(t){this._count!==t&&(this._count=t,this.dirty=!0)}get offset(){return this._offset}set offset(t){this._offset!==t&&(this._offset=t,this.dirty=!0)}get instanceCount(){return this._instanceCount}set instanceCount(t){this._instanceCount!==t&&(this._instanceCount=t,this.dirty=!0)}get shaderProgram(){return this._shaderProgram}set shaderProgram(t){this._shaderProgram!==t&&(this._shaderProgram=t,this.dirty=!0)}get castShadows(){return Jc(this,ts.CAST_SHADOWS)}set castShadows(t){Jc(this,ts.CAST_SHADOWS)!==t&&(Ny(this,ts.CAST_SHADOWS,t),this.dirty=!0)}get receiveShadows(){return Jc(this,ts.RECEIVE_SHADOWS)}set receiveShadows(t){Jc(this,ts.RECEIVE_SHADOWS)!==t&&(Ny(this,ts.RECEIVE_SHADOWS,t),this.dirty=!0)}get uniformMap(){return this._uniformMap}set uniformMap(t){this._uniformMap!==t&&(this._uniformMap=t,this.dirty=!0)}get renderState(){return this._renderState}set renderState(t){this._renderState!==t&&(this._renderState=t,this.dirty=!0)}get framebuffer(){return this._framebuffer}set framebuffer(t){this._framebuffer!==t&&(this._framebuffer=t,this.dirty=!0)}get pass(){return this._pass}set pass(t){this._pass!==t&&(this._pass=t,this.dirty=!0)}get executeInClosestFrustum(){return Jc(this,ts.EXECUTE_IN_CLOSEST_FRUSTUM)}set executeInClosestFrustum(t){Jc(this,ts.EXECUTE_IN_CLOSEST_FRUSTUM)!==t&&(Ny(this,ts.EXECUTE_IN_CLOSEST_FRUSTUM,t),this.dirty=!0)}get owner(){return this._owner}set owner(t){this._owner!==t&&(this._owner=t,this.dirty=!0)}get debugShowBoundingVolume(){return Jc(this,ts.DEBUG_SHOW_BOUNDING_VOLUME)}set debugShowBoundingVolume(t){Jc(this,ts.DEBUG_SHOW_BOUNDING_VOLUME)!==t&&(Ny(this,ts.DEBUG_SHOW_BOUNDING_VOLUME,t),this.dirty=!0)}get debugOverlappingFrustums(){return this._debugOverlappingFrustums}set debugOverlappingFrustums(t){this._debugOverlappingFrustums!==t&&(this._debugOverlappingFrustums=t,this.dirty=!0)}get pickId(){return this._pickId}set pickId(t){this._pickId!==t&&(this._pickId=t,this.dirty=!0)}get snapId(){return this._snapId}set snapId(t){this._snapId!==t&&(this._snapId=t,this.dirty=!0)}get pickMetadataAllowed(){return this._pickMetadataAllowed}get pickedMetadataInfo(){return this._pickedMetadataInfo}set pickedMetadataInfo(t){this._pickedMetadataInfo!==t&&(this._pickedMetadataInfo=t,this.dirty=!0)}get pickOnly(){return Jc(this,ts.PICK_ONLY)}set pickOnly(t){Jc(this,ts.PICK_ONLY)!==t&&(Ny(this,ts.PICK_ONLY,t),this.dirty=!0)}get depthForTranslucentClassification(){return Jc(this,ts.DEPTH_FOR_TRANSLUCENT_CLASSIFICATION)}set depthForTranslucentClassification(t){Jc(this,ts.DEPTH_FOR_TRANSLUCENT_CLASSIFICATION)!==t&&(Ny(this,ts.DEPTH_FOR_TRANSLUCENT_CLASSIFICATION,t),this.dirty=!0)}static shallowClone(t,n){if(l(t))return l(n)||(n=new e),n._boundingVolume=t._boundingVolume,n._orientedBoundingBox=t._orientedBoundingBox,n._modelMatrix=t._modelMatrix,n._primitiveType=t._primitiveType,n._vertexArray=t._vertexArray,n._count=t._count,n._offset=t._offset,n._instanceCount=t._instanceCount,n._shaderProgram=t._shaderProgram,n._uniformMap=t._uniformMap,n._renderState=t._renderState,n._framebuffer=t._framebuffer,n._pass=t._pass,n._owner=t._owner,n._debugOverlappingFrustums=t._debugOverlappingFrustums,n._pickId=t._pickId,n._snapId=t._snapId,n._pickMetadataAllowed=t._pickMetadataAllowed,n._pickedMetadataInfo=t._pickedMetadataInfo,n._flags=t._flags,n.dirty=!0,n.lastDirtyTime=0,n}execute(t,n){t.draw(this,n)}};function Jc(e,t){return(e._flags&t)===t}function Ny(e,t,n){n?e._flags|=t:e._flags&=~t}var at=bY;var Oi={UNSIGNED_BYTE:te.UNSIGNED_BYTE,UNSIGNED_SHORT:te.UNSIGNED_SHORT,UNSIGNED_INT:te.UNSIGNED_INT,FLOAT:te.FLOAT,HALF_FLOAT:te.HALF_FLOAT_OES,UNSIGNED_INT_24_8:te.UNSIGNED_INT_24_8,UNSIGNED_SHORT_4_4_4_4:te.UNSIGNED_SHORT_4_4_4_4,UNSIGNED_SHORT_5_5_5_1:te.UNSIGNED_SHORT_5_5_5_1,UNSIGNED_SHORT_5_6_5:te.UNSIGNED_SHORT_5_6_5};Oi.toWebGLConstant=function(e,t){switch(e){case Oi.UNSIGNED_BYTE:return te.UNSIGNED_BYTE;case Oi.UNSIGNED_SHORT:return te.UNSIGNED_SHORT;case Oi.UNSIGNED_INT:return te.UNSIGNED_INT;case Oi.FLOAT:return te.FLOAT;case Oi.HALF_FLOAT:return t.webgl2?te.HALF_FLOAT:te.HALF_FLOAT_OES;case Oi.UNSIGNED_INT_24_8:return te.UNSIGNED_INT_24_8;case Oi.UNSIGNED_SHORT_4_4_4_4:return te.UNSIGNED_SHORT_4_4_4_4;case Oi.UNSIGNED_SHORT_5_5_5_1:return te.UNSIGNED_SHORT_5_5_5_1;case Oi.UNSIGNED_SHORT_5_6_5:return Oi.UNSIGNED_SHORT_5_6_5}};Oi.isPacked=function(e){return e===Oi.UNSIGNED_INT_24_8||e===Oi.UNSIGNED_SHORT_4_4_4_4||e===Oi.UNSIGNED_SHORT_5_5_5_1||e===Oi.UNSIGNED_SHORT_5_6_5};Oi.sizeInBytes=function(e){switch(e){case Oi.UNSIGNED_BYTE:return 1;case Oi.UNSIGNED_SHORT:case Oi.UNSIGNED_SHORT_4_4_4_4:case Oi.UNSIGNED_SHORT_5_5_5_1:case Oi.UNSIGNED_SHORT_5_6_5:case Oi.HALF_FLOAT:return 2;case Oi.UNSIGNED_INT:case Oi.FLOAT:case Oi.UNSIGNED_INT_24_8:return 4}};Oi.validate=function(e){return e===Oi.UNSIGNED_BYTE||e===Oi.UNSIGNED_SHORT||e===Oi.UNSIGNED_INT||e===Oi.FLOAT||e===Oi.HALF_FLOAT||e===Oi.UNSIGNED_INT_24_8||e===Oi.UNSIGNED_SHORT_4_4_4_4||e===Oi.UNSIGNED_SHORT_5_5_5_1||e===Oi.UNSIGNED_SHORT_5_6_5};Oi.getTypedArrayConstructor=function(e){let t=Oi.sizeInBytes(e);return t===Uint8Array.BYTES_PER_ELEMENT?Uint8Array:t===Uint16Array.BYTES_PER_ELEMENT?Uint16Array:t===Float32Array.BYTES_PER_ELEMENT&&e===Oi.FLOAT?Float32Array:Uint32Array};Object.freeze(Oi);var ze=Oi;var ot={DEPTH_COMPONENT:te.DEPTH_COMPONENT,DEPTH_STENCIL:te.DEPTH_STENCIL,ALPHA:te.ALPHA,RED:te.RED,RG:te.RG,RGB:te.RGB,RGBA:te.RGBA,RED_INTEGER:te.RED_INTEGER,RG_INTEGER:te.RG_INTEGER,RGB_INTEGER:te.RGB_INTEGER,RGBA_INTEGER:te.RGBA_INTEGER,LUMINANCE:te.LUMINANCE,LUMINANCE_ALPHA:te.LUMINANCE_ALPHA,RGB_DXT1:te.COMPRESSED_RGB_S3TC_DXT1_EXT,RGBA_DXT1:te.COMPRESSED_RGBA_S3TC_DXT1_EXT,RGBA_DXT3:te.COMPRESSED_RGBA_S3TC_DXT3_EXT,RGBA_DXT5:te.COMPRESSED_RGBA_S3TC_DXT5_EXT,RGB_PVRTC_4BPPV1:te.COMPRESSED_RGB_PVRTC_4BPPV1_IMG,RGB_PVRTC_2BPPV1:te.COMPRESSED_RGB_PVRTC_2BPPV1_IMG,RGBA_PVRTC_4BPPV1:te.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG,RGBA_PVRTC_2BPPV1:te.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG,RGBA_ASTC:te.COMPRESSED_RGBA_ASTC_4x4_WEBGL,RGB_ETC1:te.COMPRESSED_RGB_ETC1_WEBGL,RGB8_ETC2:te.COMPRESSED_RGB8_ETC2,RGBA8_ETC2_EAC:te.COMPRESSED_RGBA8_ETC2_EAC,RGBA_BC7:te.COMPRESSED_RGBA_BPTC_UNORM};ot.componentsLength=function(e){switch(e){case ot.RGB:case ot.RGB_INTEGER:return 3;case ot.RGBA:case ot.RGBA_INTEGER:return 4;case ot.LUMINANCE_ALPHA:case ot.RG:case ot.RG_INTEGER:return 2;case ot.ALPHA:case ot.RED:case ot.RED_INTEGER:case ot.LUMINANCE:return 1;default:return 1}};ot.validate=function(e){return e===ot.DEPTH_COMPONENT||e===ot.DEPTH_STENCIL||e===ot.ALPHA||e===ot.RED||e===ot.RG||e===ot.RGB||e===ot.RGBA||e===ot.RED_INTEGER||e===ot.RG_INTEGER||e===ot.RGB_INTEGER||e===ot.RGBA_INTEGER||e===ot.LUMINANCE||e===ot.LUMINANCE_ALPHA||e===ot.RGB_DXT1||e===ot.RGBA_DXT1||e===ot.RGBA_DXT3||e===ot.RGBA_DXT5||e===ot.RGB_PVRTC_4BPPV1||e===ot.RGB_PVRTC_2BPPV1||e===ot.RGBA_PVRTC_4BPPV1||e===ot.RGBA_PVRTC_2BPPV1||e===ot.RGBA_ASTC||e===ot.RGB_ETC1||e===ot.RGB8_ETC2||e===ot.RGBA8_ETC2_EAC||e===ot.RGBA_BC7};ot.isColorFormat=function(e){return e===ot.RED||e===ot.ALPHA||e===ot.RGB||e===ot.RGBA||e===ot.LUMINANCE||e===ot.LUMINANCE_ALPHA};ot.isDepthFormat=function(e){return e===ot.DEPTH_COMPONENT||e===ot.DEPTH_STENCIL};ot.isCompressedFormat=function(e){return e===ot.RGB_DXT1||e===ot.RGBA_DXT1||e===ot.RGBA_DXT3||e===ot.RGBA_DXT5||e===ot.RGB_PVRTC_4BPPV1||e===ot.RGB_PVRTC_2BPPV1||e===ot.RGBA_PVRTC_4BPPV1||e===ot.RGBA_PVRTC_2BPPV1||e===ot.RGBA_ASTC||e===ot.RGB_ETC1||e===ot.RGB8_ETC2||e===ot.RGBA8_ETC2_EAC||e===ot.RGBA_BC7};ot.isDXTFormat=function(e){return e===ot.RGB_DXT1||e===ot.RGBA_DXT1||e===ot.RGBA_DXT3||e===ot.RGBA_DXT5};ot.isPVRTCFormat=function(e){return e===ot.RGB_PVRTC_4BPPV1||e===ot.RGB_PVRTC_2BPPV1||e===ot.RGBA_PVRTC_4BPPV1||e===ot.RGBA_PVRTC_2BPPV1};ot.isASTCFormat=function(e){return e===ot.RGBA_ASTC};ot.isETC1Format=function(e){return e===ot.RGB_ETC1};ot.isETC2Format=function(e){return e===ot.RGB8_ETC2||e===ot.RGBA8_ETC2_EAC};ot.isBC7Format=function(e){return e===ot.RGBA_BC7};ot.compressedTextureSizeInBytes=function(e,t,n){switch(e){case ot.RGB_DXT1:case ot.RGBA_DXT1:case ot.RGB_ETC1:case ot.RGB8_ETC2:return Math.floor((t+3)/4)*Math.floor((n+3)/4)*8;case ot.RGBA_DXT3:case ot.RGBA_DXT5:case ot.RGBA_ASTC:case ot.RGBA8_ETC2_EAC:return Math.floor((t+3)/4)*Math.floor((n+3)/4)*16;case ot.RGB_PVRTC_4BPPV1:case ot.RGBA_PVRTC_4BPPV1:return Math.floor((Math.max(t,8)*Math.max(n,8)*4+7)/8);case ot.RGB_PVRTC_2BPPV1:case ot.RGBA_PVRTC_2BPPV1:return Math.floor((Math.max(t,16)*Math.max(n,8)*2+7)/8);case ot.RGBA_BC7:return Math.ceil(t/4)*Math.ceil(n/4)*16;default:return 0}};ot.textureSizeInBytes=function(e,t,n,i){let r=ot.componentsLength(e);return ze.isPacked(t)&&(r=1),r*ze.sizeInBytes(t)*n*i};ot.texture3DSizeInBytes=function(e,t,n,i,r){let o=ot.componentsLength(e);return ze.isPacked(t)&&(o=1),o*ze.sizeInBytes(t)*n*i*r};ot.alignmentInBytes=function(e,t,n){let i=ot.textureSizeInBytes(e,t,n,1)%4;return i===0?4:i===2?2:1};ot.createTypedArray=function(e,t,n,i){let r=ze.getTypedArrayConstructor(t),o=ot.componentsLength(e)*n*i;return new r(o)};ot.flipY=function(e,t,n,i,r){if(r===1)return e;let o=ot.createTypedArray(t,n,i,r),s=ot.componentsLength(t),a=i*s;for(let c=0;c<r;++c){let u=c*i*s,f=(r-c-1)*i*s;for(let d=0;d<a;++d)o[f+d]=e[u+d]}return o};ot.toInternalFormat=function(e,t,n){if(!n.webgl2)return e;if(e===ot.DEPTH_STENCIL)return te.DEPTH24_STENCIL8;if(e===ot.DEPTH_COMPONENT){if(t===ze.UNSIGNED_SHORT)return te.DEPTH_COMPONENT16;if(t===ze.UNSIGNED_INT)return te.DEPTH_COMPONENT24}if(t===ze.FLOAT)switch(e){case ot.RGBA:return te.RGBA32F;case ot.RGB:return te.RGB32F;case ot.RG:return te.RG32F;case ot.RED:return te.R32F}if(t===ze.HALF_FLOAT)switch(e){case ot.RGBA:return te.RGBA16F;case ot.RGB:return te.RGB16F;case ot.RG:return te.RG16F;case ot.RED:return te.R16F}if(t===ze.UNSIGNED_BYTE)switch(e){case ot.RGBA:return te.RGBA8;case ot.RGB:return te.RGB8;case ot.RG:return te.RG8;case ot.RED:return te.R8}if(t===ze.INT)switch(e){case ot.RGBA_INTEGER:return te.RGBA32I;case ot.RGB_INTEGER:return te.RGB32I;case ot.RG_INTEGER:return te.RG32I;case ot.RED_INTEGER:return te.R32I}if(t===ze.UNSIGNED_INT)switch(e){case ot.RGBA_INTEGER:return te.RGBA32UI;case ot.RGB_INTEGER:return te.RGB32UI;case ot.RG_INTEGER:return te.RG32UI;case ot.RED_INTEGER:return te.R32UI}return e};Object.freeze(ot);var Ke=ot;var Vo={_maximumCombinedTextureImageUnits:0,_maximumCubeMapSize:0,_maximumFragmentUniformVectors:0,_maximumTextureImageUnits:0,_maximumRenderbufferSize:0,_maximumTextureSize:0,_maximum3DTextureSize:0,_maximumVaryingVectors:0,_maximumVertexAttributes:0,_maximumVertexTextureImageUnits:0,_maximumVertexUniformVectors:0,_minimumAliasedLineWidth:0,_maximumAliasedLineWidth:0,_minimumAliasedPointSize:0,_maximumAliasedPointSize:0,_maximumViewportWidth:0,_maximumViewportHeight:0,_maximumTextureFilterAnisotropy:0,_maximumDrawBuffers:0,_maximumColorAttachments:0,_maximumSamples:0,_highpFloatSupported:!1,_highpIntSupported:!1};Object.defineProperties(Vo,{maximumCombinedTextureImageUnits:{get:function(){return Vo._maximumCombinedTextureImageUnits}},maximumCubeMapSize:{get:function(){return Vo._maximumCubeMapSize}},maximumFragmentUniformVectors:{get:function(){return Vo._maximumFragmentUniformVectors}},maximumTextureImageUnits:{get:function(){return Vo._maximumTextureImageUnits}},maximumRenderbufferSize:{get:function(){return Vo._maximumRenderbufferSize}},maximumTextureSize:{get:function(){return Vo._maximumTextureSize}},maximum3DTextureSize:{get:function(){return Vo._maximum3DTextureSize}},maximumVaryingVectors:{get:function(){return Vo._maximumVaryingVectors}},maximumVertexAttributes:{get:function(){return Vo._maximumVertexAttributes}},maximumVertexTextureImageUnits:{get:function(){return Vo._maximumVertexTextureImageUnits}},maximumVertexUniformVectors:{get:function(){return Vo._maximumVertexUniformVectors}},minimumAliasedLineWidth:{get:function(){return Vo._minimumAliasedLineWidth}},maximumAliasedLineWidth:{get:function(){return Vo._maximumAliasedLineWidth}},minimumAliasedPointSize:{get:function(){return Vo._minimumAliasedPointSize}},maximumAliasedPointSize:{get:function(){return Vo._maximumAliasedPointSize}},maximumViewportWidth:{get:function(){return Vo._maximumViewportWidth}},maximumViewportHeight:{get:function(){return Vo._maximumViewportHeight}},maximumTextureFilterAnisotropy:{get:function(){return Vo._maximumTextureFilterAnisotropy}},maximumDrawBuffers:{get:function(){return Vo._maximumDrawBuffers}},maximumColorAttachments:{get:function(){return Vo._maximumColorAttachments}},maximumSamples:{get:function(){return Vo._maximumSamples}},highpFloatSupported:{get:function(){return Vo._highpFloatSupported}},highpIntSupported:{get:function(){return Vo._highpIntSupported}}});var kt=Vo;function xY(e,t,n){let i=e._gl;i.framebufferTexture2D(i.FRAMEBUFFER,t,n._target,n._texture,0)}function Qj(e,t,n){let i=e._gl;i.framebufferRenderbuffer(i.FRAMEBUFFER,t,i.RENDERBUFFER,n._getRenderbuffer())}function Vh(e){e=e??H.EMPTY_OBJECT;let t=e.context,n=t._gl,i=kt.maximumColorAttachments;if(this._gl=n,this._framebuffer=n.createFramebuffer(),this._colorTextures=[],this._colorRenderbuffers=[],this._activeColorAttachments=[],this._depthTexture=void 0,this._depthRenderbuffer=void 0,this._stencilRenderbuffer=void 0,this._depthStencilTexture=void 0,this._depthStencilRenderbuffer=void 0,this.destroyAttachments=e.destroyAttachments??!0,this._bind(),l(e.colorTextures)){let r=e.colorTextures,o=this._colorTextures.length=this._activeColorAttachments.length=r.length;for(let s=0;s<o;++s){let a=r[s],c=this._gl.COLOR_ATTACHMENT0+s;xY(this,c,a),this._activeColorAttachments[s]=c,this._colorTextures[s]=a}}if(l(e.colorRenderbuffers)){let r=e.colorRenderbuffers,o=this._colorRenderbuffers.length=this._activeColorAttachments.length=r.length;for(let s=0;s<o;++s){let a=r[s],c=this._gl.COLOR_ATTACHMENT0+s;Qj(this,c,a),this._activeColorAttachments[s]=c,this._colorRenderbuffers[s]=a}}if(l(e.depthTexture)){let r=e.depthTexture;xY(this,this._gl.DEPTH_ATTACHMENT,r),this._depthTexture=r}if(l(e.depthRenderbuffer)){let r=e.depthRenderbuffer;Qj(this,this._gl.DEPTH_ATTACHMENT,r),this._depthRenderbuffer=r}if(l(e.stencilRenderbuffer)){let r=e.stencilRenderbuffer;Qj(this,this._gl.STENCIL_ATTACHMENT,r),this._stencilRenderbuffer=r}if(l(e.depthStencilTexture)){let r=e.depthStencilTexture;xY(this,this._gl.DEPTH_STENCIL_ATTACHMENT,r),this._depthStencilTexture=r}if(l(e.depthStencilRenderbuffer)){let r=e.depthStencilRenderbuffer;Qj(this,this._gl.DEPTH_STENCIL_ATTACHMENT,r),this._depthStencilRenderbuffer=r}this._unBind(),t._currentFramebuffer=void 0}Object.defineProperties(Vh.prototype,{status:{get:function(){this._bind();let e=this._gl.checkFramebufferStatus(this._gl.FRAMEBUFFER);return this._unBind(),e}},numberOfColorAttachments:{get:function(){return this._activeColorAttachments.length}},depthTexture:{get:function(){return this._depthTexture}},depthRenderbuffer:{get:function(){return this._depthRenderbuffer}},stencilRenderbuffer:{get:function(){return this._stencilRenderbuffer}},depthStencilTexture:{get:function(){return this._depthStencilTexture}},depthStencilRenderbuffer:{get:function(){return this._depthStencilRenderbuffer}},hasDepthAttachment:{get:function(){return!!(this.depthTexture||this.depthRenderbuffer||this.depthStencilTexture||this.depthStencilRenderbuffer)}}});Vh.prototype._bind=function(){let e=this._gl;e.bindFramebuffer(e.FRAMEBUFFER,this._framebuffer)};Vh.prototype._unBind=function(){let e=this._gl;e.bindFramebuffer(e.FRAMEBUFFER,null)};Vh.prototype.bindDraw=function(){let e=this._gl;e.bindFramebuffer(e.DRAW_FRAMEBUFFER,this._framebuffer)};Vh.prototype.bindRead=function(){let e=this._gl;e.bindFramebuffer(e.READ_FRAMEBUFFER,this._framebuffer)};Vh.prototype._getActiveColorAttachments=function(){return this._activeColorAttachments};Vh.prototype.getColorTexture=function(e){return this._colorTextures[e]};Vh.prototype.getColorRenderbuffer=function(e){return this._colorRenderbuffers[e]};Vh.prototype.isDestroyed=function(){return!1};Vh.prototype.destroy=function(){if(this.destroyAttachments){let e=this._colorTextures;for(let n=0;n<e.length;++n){let i=e[n];l(i)&&i.destroy()}let t=this._colorRenderbuffers;for(let n=0;n<t.length;++n){let i=t[n];l(i)&&i.destroy()}this._depthTexture=this._depthTexture&&this._depthTexture.destroy(),this._depthRenderbuffer=this._depthRenderbuffer&&this._depthRenderbuffer.destroy(),this._stencilRenderbuffer=this._stencilRenderbuffer&&this._stencilRenderbuffer.destroy(),this._depthStencilTexture=this._depthStencilTexture&&this._depthStencilTexture.destroy(),this._depthStencilRenderbuffer=this._depthStencilRenderbuffer&&this._depthStencilRenderbuffer.destroy()}return this._gl.deleteFramebuffer(this._framebuffer),le(this)};var _s=Vh;var bD={CLOCKWISE:te.CW,COUNTER_CLOCKWISE:te.CCW};bD.validate=function(e){return e===bD.CLOCKWISE||e===bD.COUNTER_CLOCKWISE};Object.freeze(bD);var Qs=bD;function Tfe(e){if(typeof e!="object"||e===null)return e;let t,n=Object.keys(e);for(let i=0;i<n.length;i++)t=n[i],e.hasOwnProperty(t)&&t!=="_applyFunctions"&&(e[t]=Tfe(e[t]));return Object.freeze(e)}var TY=Tfe;function Rp(e){let t=e??H.EMPTY_OBJECT,n=t.cull??H.EMPTY_OBJECT,i=t.polygonOffset??H.EMPTY_OBJECT,r=t.scissorTest??H.EMPTY_OBJECT,o=r.rectangle??H.EMPTY_OBJECT,s=t.depthRange??H.EMPTY_OBJECT,a=t.depthTest??H.EMPTY_OBJECT,c=t.colorMask??H.EMPTY_OBJECT,u=t.blending??H.EMPTY_OBJECT,f=u.color??H.EMPTY_OBJECT,d=t.stencilTest??H.EMPTY_OBJECT,p=d.frontOperation??H.EMPTY_OBJECT,g=d.backOperation??H.EMPTY_OBJECT,m=t.sampleCoverage??H.EMPTY_OBJECT,y=t.viewport;this.frontFace=t.frontFace??Qs.COUNTER_CLOCKWISE,this.cull={enabled:n.enabled??!1,face:n.face??te.BACK},this.lineWidth=t.lineWidth??1,this.polygonOffset={enabled:i.enabled??!1,factor:i.factor??0,units:i.units??0},this.scissorTest={enabled:r.enabled??!1,rectangle:et.clone(o)},this.depthRange={near:s.near??0,far:s.far??1},this.depthTest={enabled:a.enabled??!1,func:a.func??te.LESS},this.colorMask={red:c.red??!0,green:c.green??!0,blue:c.blue??!0,alpha:c.alpha??!0},this.depthMask=t.depthMask??!0,this.stencilMask=t.stencilMask??-1,this.blending={enabled:u.enabled??!1,color:new z(f.red??0,f.green??0,f.blue??0,f.alpha??0),equationRgb:u.equationRgb??te.FUNC_ADD,equationAlpha:u.equationAlpha??te.FUNC_ADD,functionSourceRgb:u.functionSourceRgb??te.ONE,functionSourceAlpha:u.functionSourceAlpha??te.ONE,functionDestinationRgb:u.functionDestinationRgb??te.ZERO,functionDestinationAlpha:u.functionDestinationAlpha??te.ZERO},this.stencilTest={enabled:d.enabled??!1,frontFunction:d.frontFunction??te.ALWAYS,backFunction:d.backFunction??te.ALWAYS,reference:d.reference??0,mask:d.mask??-1,frontOperation:{fail:p.fail??te.KEEP,zFail:p.zFail??te.KEEP,zPass:p.zPass??te.KEEP},backOperation:{fail:g.fail??te.KEEP,zFail:g.zFail??te.KEEP,zPass:g.zPass??te.KEEP}},this.sampleCoverage={enabled:m.enabled??!1,value:m.value??1,invert:m.invert??!1},this.viewport=l(y)?new et(y.x,y.y,y.width,y.height):void 0,this.id=0,this._applyFunctions=[]}var bVe=0,Dp={};Rp.fromCache=function(e){let t=JSON.stringify(e),n=Dp[t];if(l(n))return++n.referenceCount,n.state;let i=new Rp(e),r=JSON.stringify(i);return n=Dp[r],l(n)||(i.id=bVe++,n={referenceCount:0,state:i},Dp[r]=n),++n.referenceCount,Dp[t]={referenceCount:1,state:n.state},n.state};Rp.removeFromCache=function(e){let t=new Rp(e),n=JSON.stringify(t),i=Dp[n],r=JSON.stringify(e),o=Dp[r];l(o)&&(--o.referenceCount,o.referenceCount===0&&(delete Dp[r],l(i)&&--i.referenceCount)),l(i)&&i.referenceCount===0&&delete Dp[n]};Rp.getCache=function(){return Dp};Rp.clearCache=function(){Dp={}};function fx(e,t,n){n?e.enable(t):e.disable(t)}function Efe(e,t){e.frontFace(t.frontFace)}function Cfe(e,t){let n=t.cull,i=n.enabled;fx(e,e.CULL_FACE,i),i&&e.cullFace(n.face)}function vfe(e,t){e.lineWidth(t.lineWidth)}function Sfe(e,t){let n=t.polygonOffset,i=n.enabled;fx(e,e.POLYGON_OFFSET_FILL,i),i&&e.polygonOffset(n.factor,n.units)}function wfe(e,t,n){let i=t.scissorTest,r=l(n.scissorTest)?n.scissorTest.enabled:i.enabled;if(fx(e,e.SCISSOR_TEST,r),r){let o=l(n.scissorTest)?n.scissorTest.rectangle:i.rectangle;e.scissor(o.x,o.y,o.width,o.height)}}function Ife(e,t){let n=t.depthRange;e.depthRange(n.near,n.far)}function Pfe(e,t){let n=t.depthTest,i=n.enabled;fx(e,e.DEPTH_TEST,i),i&&e.depthFunc(n.func)}function Dfe(e,t){let n=t.colorMask;e.colorMask(n.red,n.green,n.blue,n.alpha)}function Rfe(e,t){e.depthMask(t.depthMask)}function Ofe(e,t){e.stencilMask(t.stencilMask)}function xVe(e,t){e.blendColor(t.red,t.green,t.blue,t.alpha)}function Mfe(e,t,n){let i=t.blending,r=l(n.blendingEnabled)?n.blendingEnabled:i.enabled;fx(e,e.BLEND,r),r&&(xVe(e,i.color),e.blendEquationSeparate(i.equationRgb,i.equationAlpha),e.blendFuncSeparate(i.functionSourceRgb,i.functionDestinationRgb,i.functionSourceAlpha,i.functionDestinationAlpha))}function Nfe(e,t){let n=t.stencilTest,i=n.enabled;if(fx(e,e.STENCIL_TEST,i),i){let r=n.frontFunction,o=n.backFunction,s=n.reference,a=n.mask;e.stencilFunc(r,s,a),e.stencilFuncSeparate(e.BACK,o,s,a),e.stencilFuncSeparate(e.FRONT,r,s,a);let c=n.frontOperation,u=c.fail,f=c.zFail,d=c.zPass;e.stencilOpSeparate(e.FRONT,u,f,d);let p=n.backOperation,g=p.fail,m=p.zFail,y=p.zPass;e.stencilOpSeparate(e.BACK,g,m,y)}}function Lfe(e,t){let n=t.sampleCoverage,i=n.enabled;fx(e,e.SAMPLE_COVERAGE,i),i&&e.sampleCoverage(n.value,n.invert)}var TVe=new et;function Ffe(e,t,n){let i=t.viewport??n.viewport;l(i)||(i=TVe,i.width=n.context.drawingBufferWidth,i.height=n.context.drawingBufferHeight),n.context.uniformState.viewport=i,e.viewport(i.x,i.y,i.width,i.height)}Rp.apply=function(e,t,n){Efe(e,t),Cfe(e,t),vfe(e,t),Sfe(e,t),Ife(e,t),Pfe(e,t),Dfe(e,t),Rfe(e,t),Ofe(e,t),Nfe(e,t),Lfe(e,t),wfe(e,t,n),Mfe(e,t,n),Ffe(e,t,n)};function EVe(e,t){let n=[];return e.frontFace!==t.frontFace&&n.push(Efe),(e.cull.enabled!==t.cull.enabled||e.cull.face!==t.cull.face)&&n.push(Cfe),e.lineWidth!==t.lineWidth&&n.push(vfe),(e.polygonOffset.enabled!==t.polygonOffset.enabled||e.polygonOffset.factor!==t.polygonOffset.factor||e.polygonOffset.units!==t.polygonOffset.units)&&n.push(Sfe),(e.depthRange.near!==t.depthRange.near||e.depthRange.far!==t.depthRange.far)&&n.push(Ife),(e.depthTest.enabled!==t.depthTest.enabled||e.depthTest.func!==t.depthTest.func)&&n.push(Pfe),(e.colorMask.red!==t.colorMask.red||e.colorMask.green!==t.colorMask.green||e.colorMask.blue!==t.colorMask.blue||e.colorMask.alpha!==t.colorMask.alpha)&&n.push(Dfe),e.depthMask!==t.depthMask&&n.push(Rfe),e.stencilMask!==t.stencilMask&&n.push(Ofe),(e.stencilTest.enabled!==t.stencilTest.enabled||e.stencilTest.frontFunction!==t.stencilTest.frontFunction||e.stencilTest.backFunction!==t.stencilTest.backFunction||e.stencilTest.reference!==t.stencilTest.reference||e.stencilTest.mask!==t.stencilTest.mask||e.stencilTest.frontOperation.fail!==t.stencilTest.frontOperation.fail||e.stencilTest.frontOperation.zFail!==t.stencilTest.frontOperation.zFail||e.stencilTest.backOperation.fail!==t.stencilTest.backOperation.fail||e.stencilTest.backOperation.zFail!==t.stencilTest.backOperation.zFail||e.stencilTest.backOperation.zPass!==t.stencilTest.backOperation.zPass)&&n.push(Nfe),(e.sampleCoverage.enabled!==t.sampleCoverage.enabled||e.sampleCoverage.value!==t.sampleCoverage.value||e.sampleCoverage.invert!==t.sampleCoverage.invert)&&n.push(Lfe),n}Rp.partialApply=function(e,t,n,i,r,o){if(t!==n){let f=n._applyFunctions[t.id];l(f)||(f=EVe(t,n),n._applyFunctions[t.id]=f);let d=f.length;for(let p=0;p<d;++p)f[p](e,n)}let s=l(i.scissorTest)?i.scissorTest:t.scissorTest,a=l(r.scissorTest)?r.scissorTest:n.scissorTest;(s!==a||o)&&wfe(e,n,r);let c=l(i.blendingEnabled)?i.blendingEnabled:t.blending.enabled,u=l(r.blendingEnabled)?r.blendingEnabled:n.blending.enabled;(c!==u||u&&t.blending!==n.blending)&&Mfe(e,n,r),(t!==n||i!==r||i.context!==r.context)&&Ffe(e,n,r)};Rp.getState=function(e){return{frontFace:e.frontFace,cull:{enabled:e.cull.enabled,face:e.cull.face},lineWidth:e.lineWidth,polygonOffset:{enabled:e.polygonOffset.enabled,factor:e.polygonOffset.factor,units:e.polygonOffset.units},scissorTest:{enabled:e.scissorTest.enabled,rectangle:et.clone(e.scissorTest.rectangle)},depthRange:{near:e.depthRange.near,far:e.depthRange.far},depthTest:{enabled:e.depthTest.enabled,func:e.depthTest.func},colorMask:{red:e.colorMask.red,green:e.colorMask.green,blue:e.colorMask.blue,alpha:e.colorMask.alpha},depthMask:e.depthMask,stencilMask:e.stencilMask,blending:{enabled:e.blending.enabled,color:z.clone(e.blending.color),equationRgb:e.blending.equationRgb,equationAlpha:e.blending.equationAlpha,functionSourceRgb:e.blending.functionSourceRgb,functionSourceAlpha:e.blending.functionSourceAlpha,functionDestinationRgb:e.blending.functionDestinationRgb,functionDestinationAlpha:e.blending.functionDestinationAlpha},stencilTest:{enabled:e.stencilTest.enabled,frontFunction:e.stencilTest.frontFunction,backFunction:e.stencilTest.backFunction,reference:e.stencilTest.reference,mask:e.stencilTest.mask,frontOperation:{fail:e.stencilTest.frontOperation.fail,zFail:e.stencilTest.frontOperation.zFail,zPass:e.stencilTest.frontOperation.zPass},backOperation:{fail:e.stencilTest.backOperation.fail,zFail:e.stencilTest.backOperation.zFail,zPass:e.stencilTest.backOperation.zPass}},sampleCoverage:{enabled:e.sampleCoverage.enabled,value:e.sampleCoverage.value,invert:e.sampleCoverage.invert},viewport:l(e.viewport)?et.clone(e.viewport):void 0}};var Ge=Rp;var CVe=Object.freeze([NaN,NaN,NaN,NaN]),Ru=class e{constructor(t,n,i,r){let o=Reflect.construct(Array,CVe,new.target);return o[0]=t??0,o[1]=i??0,o[2]=n??0,o[3]=r??0,o}static pack(t,n,i){return i=i??0,n[i++]=t[0],n[i++]=t[1],n[i++]=t[2],n[i]=t[3],n}static unpack(t,n,i){return n=n??0,l(i)||(i=new e),i[0]=t[n++],i[1]=t[n++],i[2]=t[n++],i[3]=t[n],i}static packArray(t,n){let i=t.length,r=i*4;l(n)?!Array.isArray(n)&&n.length!==r||n.length!==r&&(n.length=r):n=new Array(r);for(let o=0;o<i;++o)e.pack(t[o],n,o*4);return n}static unpackArray(t,n){let i=t.length;l(n)?n.length=i/4:n=new Array(i/4);for(let r=0;r<i;r+=4){let o=r/4;n[o]=e.unpack(t,r,n[o])}return n}static clone(t,n){if(l(t))return l(n)?(n[0]=t[0],n[1]=t[1],n[2]=t[2],n[3]=t[3],n):new e(t[0],t[2],t[1],t[3])}static fromColumnMajorArray(t,n){return e.clone(t,n)}static fromRowMajorArray(t,n){return l(n)?(n[0]=t[0],n[1]=t[2],n[2]=t[1],n[3]=t[3],n):new e(t[0],t[1],t[2],t[3])}static fromScale(t,n){return l(n)?(n[0]=t.x,n[1]=0,n[2]=0,n[3]=t.y,n):new e(t.x,0,0,t.y)}static fromUniformScale(t,n){return l(n)?(n[0]=t,n[1]=0,n[2]=0,n[3]=t,n):new e(t,0,0,t)}static fromRotation(t,n){let i=Math.cos(t),r=Math.sin(t);return l(n)?(n[0]=i,n[1]=r,n[2]=-r,n[3]=i,n):new e(i,-r,r,i)}static toArray(t,n){return l(n)?(n[0]=t[0],n[1]=t[1],n[2]=t[2],n[3]=t[3],n):[t[0],t[1],t[2],t[3]]}static getElementIndex(t,n){return t*2+n}static getColumn(t,n,i){let r=n*2,o=t[r],s=t[r+1];return i.x=o,i.y=s,i}static setColumn(t,n,i,r){r=e.clone(t,r);let o=n*2;return r[o]=i.x,r[o+1]=i.y,r}static getRow(t,n,i){let r=t[n],o=t[n+2];return i.x=r,i.y=o,i}static setRow(t,n,i,r){return r=e.clone(t,r),r[n]=i.x,r[n+2]=i.y,r}static setScale(t,n,i){let r=e.getScale(t,vVe),o=n.x/r.x,s=n.y/r.y;return i[0]=t[0]*o,i[1]=t[1]*o,i[2]=t[2]*s,i[3]=t[3]*s,i}static setUniformScale(t,n,i){let r=e.getScale(t,SVe),o=n/r.x,s=n/r.y;return i[0]=t[0]*o,i[1]=t[1]*o,i[2]=t[2]*s,i[3]=t[3]*s,i}static getScale(t,n){return n.x=U.magnitude(U.fromElements(t[0],t[1],Bfe)),n.y=U.magnitude(U.fromElements(t[2],t[3],Bfe)),n}static getMaximumScale(t){return e.getScale(t,kfe),U.maximumComponent(kfe)}static setRotation(t,n,i){let r=e.getScale(t,wVe);return i[0]=n[0]*r.x,i[1]=n[1]*r.x,i[2]=n[2]*r.y,i[3]=n[3]*r.y,i}static getRotation(t,n){let i=e.getScale(t,IVe);return n[0]=t[0]/i.x,n[1]=t[1]/i.x,n[2]=t[2]/i.y,n[3]=t[3]/i.y,n}static multiply(t,n,i){let r=t[0]*n[0]+t[2]*n[1],o=t[0]*n[2]+t[2]*n[3],s=t[1]*n[0]+t[3]*n[1],a=t[1]*n[2]+t[3]*n[3];return i[0]=r,i[1]=s,i[2]=o,i[3]=a,i}static add(t,n,i){return i[0]=t[0]+n[0],i[1]=t[1]+n[1],i[2]=t[2]+n[2],i[3]=t[3]+n[3],i}static subtract(t,n,i){return i[0]=t[0]-n[0],i[1]=t[1]-n[1],i[2]=t[2]-n[2],i[3]=t[3]-n[3],i}static multiplyByVector(t,n,i){let r=t[0]*n.x+t[2]*n.y,o=t[1]*n.x+t[3]*n.y;return i.x=r,i.y=o,i}static multiplyByScalar(t,n,i){return i[0]=t[0]*n,i[1]=t[1]*n,i[2]=t[2]*n,i[3]=t[3]*n,i}static multiplyByScale(t,n,i){return i[0]=t[0]*n.x,i[1]=t[1]*n.x,i[2]=t[2]*n.y,i[3]=t[3]*n.y,i}static multiplyByUniformScale(t,n,i){return i[0]=t[0]*n,i[1]=t[1]*n,i[2]=t[2]*n,i[3]=t[3]*n,i}static negate(t,n){return n[0]=-t[0],n[1]=-t[1],n[2]=-t[2],n[3]=-t[3],n}static transpose(t,n){let i=t[0],r=t[2],o=t[1],s=t[3];return n[0]=i,n[1]=r,n[2]=o,n[3]=s,n}static abs(t,n){return n[0]=Math.abs(t[0]),n[1]=Math.abs(t[1]),n[2]=Math.abs(t[2]),n[3]=Math.abs(t[3]),n}static equals(t,n){return t===n||l(t)&&l(n)&&t[0]===n[0]&&t[1]===n[1]&&t[2]===n[2]&&t[3]===n[3]}static equalsArray(t,n,i){return t[0]===n[i]&&t[1]===n[i+1]&&t[2]===n[i+2]&&t[3]===n[i+3]}static equalsEpsilon(t,n,i){return i=i??0,t===n||l(t)&&l(n)&&Math.abs(t[0]-n[0])<=i&&Math.abs(t[1]-n[1])<=i&&Math.abs(t[2]-n[2])<=i&&Math.abs(t[3]-n[3])<=i}get length(){return e.packedLength}clone(t){return e.clone(this,t)}equals(t){return e.equals(this,t)}equalsEpsilon(t,n){return e.equalsEpsilon(this,t,n)}toString(){return`(${this[0]}, ${this[2]}) +(${this[1]}, ${this[3]})`}};Ru.packedLength=4;Ru.fromArray=Ru.unpack;Ru.IDENTITY=new Ru(1,0,0,1);Ru.ZERO=new Ru(0,0,0,0);Ru.COLUMN0ROW0=0;Ru.COLUMN0ROW1=1;Ru.COLUMN1ROW0=2;Ru.COLUMN1ROW1=3;var vVe=new U,SVe=new U,Bfe=new U,kfe=new U,wVe=new U,IVe=new U,Xi=Ru;function PVe(e,t,n,i){switch(t.type){case e.FLOAT:return new EY(e,t,n,i);case e.FLOAT_VEC2:return new CY(e,t,n,i);case e.FLOAT_VEC3:return new vY(e,t,n,i);case e.FLOAT_VEC4:return new SY(e,t,n,i);case e.SAMPLER_2D:case e.SAMPLER_3D:case e.SAMPLER_CUBE:return new e6(e,t,n,i);case e.UNSIGNED_INT_SAMPLER_2D:return new e6(e,t,n,i);case e.INT:case e.BOOL:return new wY(e,t,n,i);case e.INT_VEC2:case e.BOOL_VEC2:return new IY(e,t,n,i);case e.INT_VEC3:case e.BOOL_VEC3:return new PY(e,t,n,i);case e.INT_VEC4:case e.BOOL_VEC4:return new DY(e,t,n,i);case e.FLOAT_MAT2:return new RY(e,t,n,i);case e.FLOAT_MAT3:return new OY(e,t,n,i);case e.FLOAT_MAT4:return new MY(e,t,n,i);default:throw new oe(`Unrecognized uniform type: ${t.type} for uniform "${n}".`)}}var EY=class{constructor(t,n,i,r){this.name=i,this.value=void 0,this._value=0,this._gl=t,this._location=r}set(){this.value!==this._value&&(this._value=this.value,this._gl.uniform1f(this._location,this.value))}},CY=class{constructor(t,n,i,r){this.name=i,this.value=void 0,this._value=new U,this._gl=t,this._location=r}set(){let t=this.value;U.equals(t,this._value)||(U.clone(t,this._value),this._gl.uniform2f(this._location,t.x,t.y))}},vY=class{constructor(t,n,i,r){this.name=i,this.value=void 0,this._value=void 0,this._gl=t,this._location=r}set(){let t=this.value;l(t.red)?z.equals(t,this._value)||(this._value=z.clone(t,this._value),this._gl.uniform3f(this._location,t.red,t.green,t.blue)):l(t.x)&&(h.equals(t,this._value)||(this._value=h.clone(t,this._value),this._gl.uniform3f(this._location,t.x,t.y,t.z)))}},SY=class{constructor(t,n,i,r){this.name=i,this.value=void 0,this._value=void 0,this._gl=t,this._location=r}set(){let t=this.value;l(t.red)?z.equals(t,this._value)||(this._value=z.clone(t,this._value),this._gl.uniform4f(this._location,t.red,t.green,t.blue,t.alpha)):l(t.x)&&(se.equals(t,this._value)||(this._value=se.clone(t,this._value),this._gl.uniform4f(this._location,t.x,t.y,t.z,t.w)))}},e6=class{constructor(t,n,i,r){this.name=i,this.value=void 0,this._gl=t,this._location=r,this.textureUnitIndex=void 0}set(){let t=this._gl;t.activeTexture(t.TEXTURE0+this.textureUnitIndex);let n=this.value;t.bindTexture(n._target,n._texture)}_setSampler(t){return this.textureUnitIndex=t,this._gl.uniform1i(this._location,t),t+1}},wY=class{constructor(t,n,i,r){this.name=i,this.value=void 0,this._value=0,this._gl=t,this._location=r}set(){this.value!==this._value&&(this._value=this.value,this._gl.uniform1i(this._location,this.value))}},IY=class{constructor(t,n,i,r){this.name=i,this.value=void 0,this._value=new U,this._gl=t,this._location=r}set(){let t=this.value;U.equals(t,this._value)||(U.clone(t,this._value),this._gl.uniform2i(this._location,t.x,t.y))}},PY=class{constructor(t,n,i,r){this.name=i,this.value=void 0,this._value=new h,this._gl=t,this._location=r}set(){let t=this.value;h.equals(t,this._value)||(h.clone(t,this._value),this._gl.uniform3i(this._location,t.x,t.y,t.z))}},DY=class{constructor(t,n,i,r){this.name=i,this.value=void 0,this._value=new se,this._gl=t,this._location=r}set(){let t=this.value;se.equals(t,this._value)||(se.clone(t,this._value),this._gl.uniform4i(this._location,t.x,t.y,t.z,t.w))}},DVe=new Float32Array(4),RY=class{constructor(t,n,i,r){this.name=i,this.value=void 0,this._value=new Xi,this._gl=t,this._location=r}set(){if(!Xi.equalsArray(this.value,this._value,0)){Xi.clone(this.value,this._value);let t=Xi.toArray(this.value,DVe);this._gl.uniformMatrix2fv(this._location,!1,t)}}},RVe=new Float32Array(9),OY=class{constructor(t,n,i,r){this.name=i,this.value=void 0,this._value=new $,this._gl=t,this._location=r}set(){if(!$.equalsArray(this.value,this._value,0)){$.clone(this.value,this._value);let t=$.toArray(this.value,RVe);this._gl.uniformMatrix3fv(this._location,!1,t)}}},OVe=new Float32Array(16),MY=class{constructor(t,n,i,r){this.name=i,this.value=void 0,this._value=new N,this._gl=t,this._location=r}set(){if(!N.equalsArray(this.value,this._value,0)){N.clone(this.value,this._value);let t=N.toArray(this.value,OVe);this._gl.uniformMatrix4fv(this._location,!1,t)}}},xD=PVe;function MVe(e,t,n,i){switch(t.type){case e.FLOAT:return new NY(e,t,n,i);case e.FLOAT_VEC2:return new LY(e,t,n,i);case e.FLOAT_VEC3:return new FY(e,t,n,i);case e.FLOAT_VEC4:return new BY(e,t,n,i);case e.SAMPLER_2D:case e.SAMPLER_3D:case e.SAMPLER_CUBE:return new kY(e,t,n,i);case e.INT:case e.BOOL:return new UY(e,t,n,i);case e.INT_VEC2:case e.BOOL_VEC2:return new zY(e,t,n,i);case e.INT_VEC3:case e.BOOL_VEC3:return new VY(e,t,n,i);case e.INT_VEC4:case e.BOOL_VEC4:return new jY(e,t,n,i);case e.FLOAT_MAT2:return new HY(e,t,n,i);case e.FLOAT_MAT3:return new GY(e,t,n,i);case e.FLOAT_MAT4:return new WY(e,t,n,i);default:throw new oe(`Unrecognized uniform type: ${t.type} for uniform "${n}".`)}}var NY=class{constructor(t,n,i,r){let o=r.length;this.name=i,this.value=new Array(o),this._value=new Float32Array(o),this._gl=t,this._location=r[0]}set(){let t=this.value,n=t.length,i=this._value,r=!1;for(let o=0;o<n;++o){let s=t[o];s!==i[o]&&(i[o]=s,r=!0)}r&&this._gl.uniform1fv(this._location,i)}},LY=class{constructor(t,n,i,r){let o=r.length;this.name=i,this.value=new Array(o),this._value=new Float32Array(o*2),this._gl=t,this._location=r[0]}set(){let t=this.value,n=t.length,i=this._value,r=!1,o=0;for(let s=0;s<n;++s){let a=t[s];U.equalsArray(a,i,o)||(U.pack(a,i,o),r=!0),o+=2}r&&this._gl.uniform2fv(this._location,i)}},FY=class{constructor(t,n,i,r){let o=r.length;this.name=i,this.value=new Array(o),this._value=new Float32Array(o*3),this._gl=t,this._location=r[0]}set(){let t=this.value,n=t.length,i=this._value,r=!1,o=0;for(let s=0;s<n;++s){let a=t[s];l(a.red)?(a.red!==i[o]||a.green!==i[o+1]||a.blue!==i[o+2])&&(i[o]=a.red,i[o+1]=a.green,i[o+2]=a.blue,r=!0):l(a.x)&&(h.equalsArray(a,i,o)||(h.pack(a,i,o),r=!0)),o+=3}r&&this._gl.uniform3fv(this._location,i)}},BY=class{constructor(t,n,i,r){let o=r.length;this.name=i,this.value=new Array(o),this._value=new Float32Array(o*4),this._gl=t,this._location=r[0]}set(){let t=this.value,n=t.length,i=this._value,r=!1,o=0;for(let s=0;s<n;++s){let a=t[s];l(a.red)?z.equalsArray(a,i,o)||(z.pack(a,i,o),r=!0):l(a.x)&&(se.equalsArray(a,i,o)||(se.pack(a,i,o),r=!0)),o+=4}r&&this._gl.uniform4fv(this._location,i)}},kY=class{constructor(t,n,i,r){let o=r.length;this.name=i,this.value=new Array(o),this._value=new Float32Array(o),this._gl=t,this._locations=r,this.textureUnitIndex=void 0}set(){let t=this._gl,n=t.TEXTURE0+this.textureUnitIndex,i=this.value,r=i.length;for(let o=0;o<r;++o){let s=i[o];t.activeTexture(n+o),t.bindTexture(s._target,s._texture)}}_setSampler(t){this.textureUnitIndex=t;let n=this._locations,i=n.length;for(let r=0;r<i;++r){let o=t+r;this._gl.uniform1i(n[r],o)}return t+i}},UY=class{constructor(t,n,i,r){let o=r.length;this.name=i,this.value=new Array(o),this._value=new Int32Array(o),this._gl=t,this._location=r[0]}set(){let t=this.value,n=t.length,i=this._value,r=!1;for(let o=0;o<n;++o){let s=t[o];s!==i[o]&&(i[o]=s,r=!0)}r&&this._gl.uniform1iv(this._location,i)}},zY=class{constructor(t,n,i,r){let o=r.length;this.name=i,this.value=new Array(o),this._value=new Int32Array(o*2),this._gl=t,this._location=r[0]}set(){let t=this.value,n=t.length,i=this._value,r=!1,o=0;for(let s=0;s<n;++s){let a=t[s];U.equalsArray(a,i,o)||(U.pack(a,i,o),r=!0),o+=2}r&&this._gl.uniform2iv(this._location,i)}},VY=class{constructor(t,n,i,r){let o=r.length;this.name=i,this.value=new Array(o),this._value=new Int32Array(o*3),this._gl=t,this._location=r[0]}set(){let t=this.value,n=t.length,i=this._value,r=!1,o=0;for(let s=0;s<n;++s){let a=t[s];h.equalsArray(a,i,o)||(h.pack(a,i,o),r=!0),o+=3}r&&this._gl.uniform3iv(this._location,i)}},jY=class{constructor(t,n,i,r){let o=r.length;this.name=i,this.value=new Array(o),this._value=new Int32Array(o*4),this._gl=t,this._location=r[0]}set(){let t=this.value,n=t.length,i=this._value,r=!1,o=0;for(let s=0;s<n;++s){let a=t[s];se.equalsArray(a,i,o)||(se.pack(a,i,o),r=!0),o+=4}r&&this._gl.uniform4iv(this._location,i)}},HY=class{constructor(t,n,i,r){let o=r.length;this.name=i,this.value=new Array(o),this._value=new Float32Array(o*4),this._gl=t,this._location=r[0]}set(){let t=this.value,n=t.length,i=this._value,r=!1,o=0;for(let s=0;s<n;++s){let a=t[s];Xi.equalsArray(a,i,o)||(Xi.pack(a,i,o),r=!0),o+=4}r&&this._gl.uniformMatrix2fv(this._location,!1,i)}},GY=class{constructor(t,n,i,r){let o=r.length;this.name=i,this.value=new Array(o),this._value=new Float32Array(o*9),this._gl=t,this._location=r[0]}set(){let t=this.value,n=t.length,i=this._value,r=!1,o=0;for(let s=0;s<n;++s){let a=t[s];$.equalsArray(a,i,o)||($.pack(a,i,o),r=!0),o+=9}r&&this._gl.uniformMatrix3fv(this._location,!1,i)}},WY=class{constructor(t,n,i,r){let o=r.length;this.name=i,this.value=new Array(o),this._value=new Float32Array(o*16),this._gl=t,this._location=r[0]}set(){let t=this.value,n=t.length,i=this._value,r=!1,o=0;for(let s=0;s<n;++s){let a=t[s];N.equalsArray(a,i,o)||(N.pack(a,i,o),r=!0),o+=16}r&&this._gl.uniformMatrix4fv(this._location,!1,i)}},TD=MVe;var NVe=0;function cg(e){let t=e.vertexShaderText,n=e.fragmentShaderText;typeof spector<"u"&&(t=t.replace(/^#line/gm,"//#line"),n=n.replace(/^#line/gm,"//#line"));let i=LVe(t,n);this._gl=e.gl,this._logShaderCompilation=e.logShaderCompilation,this._debugShaders=e.debugShaders,this._attributeLocations=e.attributeLocations,this._program=void 0,this._numberOfVertexAttributes=void 0,this._vertexAttributes=void 0,this._uniformsByName=void 0,this._uniforms=void 0,this._automaticUniforms=void 0,this._manualUniforms=void 0,this._duplicateUniformNames=i.duplicateUniformNames,this._cachedShader=void 0,this.maximumTextureUnitIndex=void 0,this._vertexShaderSource=e.vertexShaderSource,this._vertexShaderText=e.vertexShaderText,this._fragmentShaderSource=e.fragmentShaderSource,this._fragmentShaderText=i.fragmentShaderText,this.id=NVe++}cg.fromCache=function(e){return e=e??H.EMPTY_OBJECT,e.context.shaderCache.getShaderProgram(e)};cg.replaceCache=function(e){return e=e??H.EMPTY_OBJECT,e.context.shaderCache.replaceShaderProgram(e)};Object.defineProperties(cg.prototype,{vertexShaderSource:{get:function(){return this._vertexShaderSource}},fragmentShaderSource:{get:function(){return this._fragmentShaderSource}},vertexAttributes:{get:function(){return t6(this),this._vertexAttributes}},numberOfVertexAttributes:{get:function(){return t6(this),this._numberOfVertexAttributes}},allUniforms:{get:function(){return t6(this),this._uniformsByName}}});function Ufe(e){let t=[],n=e.match(/uniform.*?(?![^{]*})(?=[=\[;])/g);if(l(n)){let i=n.length;for(let r=0;r<i;r++){let o=n[r].trim(),s=o.slice(o.lastIndexOf(" ")+1);t.push(s)}}return t}function LVe(e,t){let n={};if(!kt.highpFloatSupported||!kt.highpIntSupported){let i,r,o,s,a=Ufe(e),c=Ufe(t),u=a.length,f=c.length;for(i=0;i<u;i++)for(r=0;r<f;r++)if(a[i]===c[r]){o=a[i],s=`czm_mediump_${o}`;let d=new RegExp(`${o}\\b`,"g");t=t.replace(d,s),n[s]=o}}return{fragmentShaderText:t,duplicateUniformNames:n}}var Op="[Cesium WebGL] ";function FVe(e,t){let n=t._vertexShaderText,i=t._fragmentShaderText,r=e.createShader(e.VERTEX_SHADER);e.shaderSource(r,n),e.compileShader(r);let o=e.createShader(e.FRAGMENT_SHADER);e.shaderSource(o,i),e.compileShader(o);let s=e.createProgram();e.attachShader(s,r),e.attachShader(s,o);let a=t._attributeLocations;if(l(a))for(let p in a)a.hasOwnProperty(p)&&e.bindAttribLocation(s,a[p],p);e.linkProgram(s);let c;if(e.getProgramParameter(s,e.LINK_STATUS))return t._logShaderCompilation&&(c=e.getShaderInfoLog(r),l(c)&&c.length>0&&console.log(`${Op}Vertex shader compile log: ${c}`),c=e.getShaderInfoLog(o),l(c)&&c.length>0&&console.log(`${Op}Fragment shader compile log: ${c}`),c=e.getProgramInfoLog(s),l(c)&&c.length>0&&console.log(`${Op}Shader program link log: ${c}`)),e.deleteShader(r),e.deleteShader(o),s;let u,f=t._debugShaders;throw e.getShaderParameter(o,e.COMPILE_STATUS)?e.getShaderParameter(r,e.COMPILE_STATUS)?(c=e.getProgramInfoLog(s),console.error(`${Op}Shader program link log: ${c}`),d(r,"vertex"),d(o,"fragment"),u=`Program failed to link. Link log: ${c}`):(c=e.getShaderInfoLog(r),console.error(`${Op}Vertex shader compile log: ${c}`),console.error(`${Op} Vertex shader source: ${n}`),u=`Vertex shader failed to compile. Compile log: ${c}`):(c=e.getShaderInfoLog(o),console.error(`${Op}Fragment shader compile log: ${c}`),console.error(`${Op} Fragment shader source: ${i}`),u=`Fragment shader failed to compile. Compile log: ${c}`),e.deleteShader(r),e.deleteShader(o),e.deleteProgram(s),new oe(u);function d(p,g){if(!l(f))return;let m=f.getTranslatedShaderSource(p);if(m===""){console.error(`${Op}${g} shader translation failed.`);return}console.error(`${Op}Translated ${g} shaderSource: -${m}`)}}function FVe(e,t,n){let i={};for(let r=0;r<n;++r){let o=e.getActiveAttrib(t,r),s=e.getAttribLocation(t,o.name);i[o.name]={name:o.name,type:o.type,index:s}}return i}function BVe(e,t){let n={},i=[],r=[],o=e.getProgramParameter(t,e.ACTIVE_UNIFORMS);for(let s=0;s<o;++s){let a=e.getActiveUniform(t,s),c="[0]",u=a.name.indexOf(c,a.name.length-c.length)!==-1?a.name.slice(0,a.name.length-3):a.name;if(u.indexOf("gl_")!==0)if(a.name.indexOf("[")<0){let f=e.getUniformLocation(t,u);if(f!==null){let d=xD(e,a,u,f);n[u]=d,i.push(d),d._setSampler&&r.push(d)}}else{let f,d,p,g,m=u.indexOf("[");if(m>=0){if(f=n[u.slice(0,m)],!l(f))continue;d=f._locations,d.length<=1&&(p=f.value,g=e.getUniformLocation(t,u),g!==null&&(d.push(g),p.push(e.getUniform(t,g))))}else{d=[];for(let y=0;y<a.size;++y)g=e.getUniformLocation(t,`${u}[${y}]`),g!==null&&d.push(g);f=TD(e,a,u,d),n[u]=f,i.push(f),f._setSampler&&r.push(f)}}}return{uniformsByName:n,uniforms:i,samplerUniforms:r}}function kVe(e,t){let n=[],i=[];for(let r in t)if(t.hasOwnProperty(r)){let o=t[r],s=r,a=e._duplicateUniformNames[s];l(a)&&(o.name=a,s=a);let c=tg[s];l(c)?n.push({uniform:o,automaticUniform:c}):i.push(o)}return{automaticUniforms:n,manualUniforms:i}}function UVe(e,t,n){e.useProgram(t);let i=0,r=n.length;for(let o=0;o<r;++o)i=n[o]._setSampler(i);return e.useProgram(null),i}function t6(e){l(e._program)||zfe(e)}function zfe(e){let t=e._program,n=e._gl,i=LVe(n,e,e._debugShaders),r=n.getProgramParameter(i,n.ACTIVE_ATTRIBUTES),o=BVe(n,i),s=kVe(e,o.uniformsByName);e._program=i,e._numberOfVertexAttributes=r,e._vertexAttributes=FVe(n,i,r),e._uniformsByName=o.uniformsByName,e._uniforms=o.uniforms,e._automaticUniforms=s.automaticUniforms,e._manualUniforms=s.manualUniforms,e.maximumTextureUnitIndex=UVe(n,i,o.samplerUniforms),t&&e._gl.deleteProgram(t),typeof spector<"u"&&(e._program.__SPECTOR_rebuildProgram=function(a,c,u,f){let d=e._vertexShaderText,p=e._fragmentShaderText,g=/ ! = /g;e._vertexShaderText=a.replace(g," != "),e._fragmentShaderText=c.replace(g," != ");try{zfe(e),u(e._program)}catch(m){e._vertexShaderText=d,e._fragmentShaderText=p;let A=/(?:Compile|Link) error: ([^]*)/.exec(m.message);f(A?A[1]:m.message)}})}cg.prototype._bind=function(){t6(this),this._gl.useProgram(this._program)};cg.prototype._setUniforms=function(e,t,n){let i,r;if(l(e)){let a=this._manualUniforms;for(i=a.length,r=0;r<i;++r){let c=a[r];c.value=e[c.name]()}}let o=this._automaticUniforms;for(i=o.length,r=0;r<i;++r){let a=o[r];a.uniform.value=a.automaticUniform.getValue(t)}let s=this._uniforms;for(i=s.length,r=0;r<i;++r)s[r].set();if(n){let a=this._gl,c=this._program;a.validateProgram(c)}};cg.prototype.isDestroyed=function(){return!1};cg.prototype.destroy=function(){this._cachedShader.cache.releaseShaderProgram(this)};cg.prototype.finalDestroy=function(){return this._gl.deleteProgram(this._program),le(this)};var Qt=cg;function n6(e){this._context=e}var ED,zVe=new at({primitiveType:Oe.TRIANGLES}),VVe=new li({color:new z(0,0,0,0)});function jVe(e,t){return new _s({context:e,colorTextures:[t],destroyAttachments:!1})}function HVe(e,t){return Qt.fromCache({context:e,vertexShaderSource:ux,fragmentShaderSource:t,attributeLocations:{position:0,textureCoordinates:1}})}function GVe(e,t){return(!l(ED)||ED.viewport.width!==e||ED.viewport.height!==t)&&(ED=Ge.fromCache({viewport:new et(0,0,e,t)})),ED}n6.prototype.execute=function(e){l(e.preExecute)&&e.preExecute(e);let t=e.outputTexture,n=t.width,i=t.height,r=this._context,o=l(e.vertexArray)?e.vertexArray:r.getViewportQuadVertexArray(),s=l(e.shaderProgram)?e.shaderProgram:HVe(r,e.fragmentShaderSource),a=jVe(r,t),c=GVe(n,i),u=e.uniformMap,f=VVe;f.framebuffer=a,f.renderState=c,f.execute(r);let d=zVe;d.vertexArray=o,d.renderState=c,d.shaderProgram=s,d.uniformMap=u,d.framebuffer=a,d.execute(r),a.destroy(),e.persists||(s.destroy(),l(e.vertexArray)&&o.destroy()),l(e.postExecute)&&e.postExecute(t)};n6.prototype.isDestroyed=function(){return!1};n6.prototype.destroy=function(){return le(this)};var CD=n6;var An={BYTE:te.BYTE,UNSIGNED_BYTE:te.UNSIGNED_BYTE,SHORT:te.SHORT,UNSIGNED_SHORT:te.UNSIGNED_SHORT,INT:te.INT,UNSIGNED_INT:te.UNSIGNED_INT,FLOAT:te.FLOAT,DOUBLE:te.DOUBLE};An.getSizeInBytes=function(e){switch(e){case An.BYTE:return Int8Array.BYTES_PER_ELEMENT;case An.UNSIGNED_BYTE:return Uint8Array.BYTES_PER_ELEMENT;case An.SHORT:return Int16Array.BYTES_PER_ELEMENT;case An.UNSIGNED_SHORT:return Uint16Array.BYTES_PER_ELEMENT;case An.INT:return Int32Array.BYTES_PER_ELEMENT;case An.UNSIGNED_INT:return Uint32Array.BYTES_PER_ELEMENT;case An.FLOAT:return Float32Array.BYTES_PER_ELEMENT;case An.DOUBLE:return Float64Array.BYTES_PER_ELEMENT}};An.fromTypedArray=function(e){if(e instanceof Int8Array)return An.BYTE;if(e instanceof Uint8Array)return An.UNSIGNED_BYTE;if(e instanceof Int16Array)return An.SHORT;if(e instanceof Uint16Array)return An.UNSIGNED_SHORT;if(e instanceof Int32Array)return An.INT;if(e instanceof Uint32Array)return An.UNSIGNED_INT;if(e instanceof Float32Array)return An.FLOAT;if(e instanceof Float64Array)return An.DOUBLE};An.validate=function(e){return l(e)&&(e===An.BYTE||e===An.UNSIGNED_BYTE||e===An.SHORT||e===An.UNSIGNED_SHORT||e===An.INT||e===An.UNSIGNED_INT||e===An.FLOAT||e===An.DOUBLE)};An.createTypedArray=function(e,t){switch(e){case An.BYTE:return new Int8Array(t);case An.UNSIGNED_BYTE:return new Uint8Array(t);case An.SHORT:return new Int16Array(t);case An.UNSIGNED_SHORT:return new Uint16Array(t);case An.INT:return new Int32Array(t);case An.UNSIGNED_INT:return new Uint32Array(t);case An.FLOAT:return new Float32Array(t);case An.DOUBLE:return new Float64Array(t)}};An.createArrayBufferView=function(e,t,n,i){switch(n=n??0,i=i??(t.byteLength-n)/An.getSizeInBytes(e),e){case An.BYTE:return new Int8Array(t,n,i);case An.UNSIGNED_BYTE:return new Uint8Array(t,n,i);case An.SHORT:return new Int16Array(t,n,i);case An.UNSIGNED_SHORT:return new Uint16Array(t,n,i);case An.INT:return new Int32Array(t,n,i);case An.UNSIGNED_INT:return new Uint32Array(t,n,i);case An.FLOAT:return new Float32Array(t,n,i);case An.DOUBLE:return new Float64Array(t,n,i)}};An.fromName=function(e){switch(e){case"BYTE":return An.BYTE;case"UNSIGNED_BYTE":return An.UNSIGNED_BYTE;case"SHORT":return An.SHORT;case"UNSIGNED_SHORT":return An.UNSIGNED_SHORT;case"INT":return An.INT;case"UNSIGNED_INT":return An.UNSIGNED_INT;case"FLOAT":return An.FLOAT;case"DOUBLE":return An.DOUBLE}};An.dequantize=function(e,t){switch(t){case An.BYTE:return Math.max(e/127,-1);case An.UNSIGNED_BYTE:return e/255;case An.SHORT:return Math.max(e/32767,-1);case An.UNSIGNED_SHORT:return e/65535;case An.INT:return Math.max(e/2147483647,-1);case An.UNSIGNED_INT:return e/4294967295}};Object.freeze(An);var Y=An;var Vfe={NONE:0,TRIANGLES:1,LINES:2,POLYLINES:3};Object.freeze(Vfe);var Sd=Vfe;function qY(e){e=e??H.EMPTY_OBJECT,this.attributes=e.attributes,this.indices=e.indices,this.primitiveType=e.primitiveType??Oe.TRIANGLES,this.boundingSphere=e.boundingSphere,this.geometryType=e.geometryType??Sd.NONE,this.boundingSphereCV=e.boundingSphereCV,this.offsetAttribute=e.offsetAttribute}qY.computeNumberOfVertices=function(e){let t=-1;for(let n in e.attributes)if(e.attributes.hasOwnProperty(n)&&l(e.attributes[n])&&l(e.attributes[n].values)){let i=e.attributes[n];t=i.values.length/i.componentsPerAttribute}return t};var WVe=new he,qVe=new h,jfe=new N,YVe=[new he,new he,new he],XVe=[new U,new U,new U],KVe=[new U,new U,new U],$Ve=new h,JVe=new Le,ZVe=new N,QVe=new Xi;qY._textureCoordinateRotationPoints=function(e,t,n,i){let r,o=ie.center(i,WVe),s=he.toCartesian(o,n,qVe),a=At.eastNorthUpToFixedFrame(s,n,jfe),c=N.inverse(a,jfe),u=XVe,f=YVe;f[0].longitude=i.west,f[0].latitude=i.south,f[1].longitude=i.west,f[1].latitude=i.north,f[2].longitude=i.east,f[2].latitude=i.south;let d=$Ve;for(r=0;r<3;r++)he.toCartesian(f[r],n,d),d=N.multiplyByPointAsVector(c,d,d),u[r].x=d.x,u[r].y=d.y;let p=Le.fromAxisAngle(h.UNIT_Z,-t,JVe),g=$.fromQuaternion(p,ZVe),m=e.length,y=Number.POSITIVE_INFINITY,A=Number.POSITIVE_INFINITY,b=Number.NEGATIVE_INFINITY,x=Number.NEGATIVE_INFINITY;for(r=0;r<m;r++)d=N.multiplyByPointAsVector(c,e[r],d),d=$.multiplyByVector(g,d,d),y=Math.min(y,d.x),A=Math.min(A,d.y),b=Math.max(b,d.x),x=Math.max(x,d.y);let T=Xi.fromRotation(t,QVe),E=KVe;E[0].x=y,E[0].y=A,E[1].x=y,E[1].y=x,E[2].x=b,E[2].y=A;let v=u[0],S=u[2].x-v.x,I=u[1].y-v.y;for(r=0;r<3;r++){let C=E[r];Xi.multiplyByVector(T,C,C),C.x=(C.x-v.x)/S,C.y=(C.y-v.y)/I}let R=E[0],O=E[1],L=E[2],_=new Array(6);return U.pack(R,_),U.pack(O,_,2),U.pack(L,_,4),_};var St=qY;function e4e(e){e=e??H.EMPTY_OBJECT,this.componentDatatype=e.componentDatatype,this.componentsPerAttribute=e.componentsPerAttribute,this.normalize=e.normalize??!1,this.values=e.values}var Ne=e4e;function _v(e,t,n,i,r){this._format=e,this._datatype=t,this._width=n,this._height=i,this._buffer=r}Object.defineProperties(_v.prototype,{internalFormat:{get:function(){return this._format}},pixelDatatype:{get:function(){return this._datatype}},width:{get:function(){return this._width}},height:{get:function(){return this._height}},bufferView:{get:function(){return this._buffer}},arrayBufferView:{get:function(){return this._buffer}}});_v.clone=function(e){if(l(e))return new _v(e._format,e._datatype,e._width,e._height,e._buffer)};_v.prototype.clone=function(){return _v.clone(this)};var vD=_v;var Hfe=Qo(Tf(),1);function Gfe(){if(!l(rc._canTransferArrayBuffer)){let e=KY("transferTypedArrayTest");e.postMessage=e.webkitPostMessage??e.postMessage;let t=99,n=new Int8Array([t]);try{e.postMessage({array:n},[n.buffer])}catch{return rc._canTransferArrayBuffer=!1,rc._canTransferArrayBuffer}rc._canTransferArrayBuffer=new Promise(i=>{e.onmessage=function(r){let o=r.data.array,s=l(o)&&o[0]===t;i(s),e.terminate(),rc._canTransferArrayBuffer=s}})}return rc._canTransferArrayBuffer}var XY=new be;function YY(e){let t;try{t=new Blob([e],{type:"application/javascript"})}catch{let r=window.BlobBuilder||window.WebKitBlobBuilder||window.MozBlobBuilder||window.MSBlobBuilder,o=new r;o.append(e),t=o.getBlob("application/javascript")}return(window.URL||window.webkitURL).createObjectURL(t)}function KY(e){let t=new Hfe.default(e),n=t.scheme().length!==0&&t.fragment().length===0,i=e.replace(/\.js$/,""),r={},o,s;if(Dy(e))s=e;else if(!n){let a=Zt(`${rc._workerModulePrefix}/${i}.js`);Dy(a)&&(s=a)}if(s){let a=`import "${s}";`;return o=YY(a),r.type="module",new Worker(o,r)}if(!n&&typeof CESIUM_WORKERS<"u"){let a=` +${m}`)}}function BVe(e,t,n){let i={};for(let r=0;r<n;++r){let o=e.getActiveAttrib(t,r),s=e.getAttribLocation(t,o.name);i[o.name]={name:o.name,type:o.type,index:s}}return i}function kVe(e,t){let n={},i=[],r=[],o=e.getProgramParameter(t,e.ACTIVE_UNIFORMS);for(let s=0;s<o;++s){let a=e.getActiveUniform(t,s),c="[0]",u=a.name.indexOf(c,a.name.length-c.length)!==-1?a.name.slice(0,a.name.length-3):a.name;if(u.indexOf("gl_")!==0)if(a.name.indexOf("[")<0){let f=e.getUniformLocation(t,u);if(f!==null){let d=xD(e,a,u,f);n[u]=d,i.push(d),d._setSampler&&r.push(d)}}else{let f,d,p,g,m=u.indexOf("[");if(m>=0){if(f=n[u.slice(0,m)],!l(f))continue;d=f._locations,d.length<=1&&(p=f.value,g=e.getUniformLocation(t,u),g!==null&&(d.push(g),p.push(e.getUniform(t,g))))}else{d=[];for(let y=0;y<a.size;++y)g=e.getUniformLocation(t,`${u}[${y}]`),g!==null&&d.push(g);f=TD(e,a,u,d),n[u]=f,i.push(f),f._setSampler&&r.push(f)}}}return{uniformsByName:n,uniforms:i,samplerUniforms:r}}function UVe(e,t){let n=[],i=[];for(let r in t)if(t.hasOwnProperty(r)){let o=t[r],s=r,a=e._duplicateUniformNames[s];l(a)&&(o.name=a,s=a);let c=tg[s];l(c)?n.push({uniform:o,automaticUniform:c}):i.push(o)}return{automaticUniforms:n,manualUniforms:i}}function zVe(e,t,n){e.useProgram(t);let i=0,r=n.length;for(let o=0;o<r;++o)i=n[o]._setSampler(i);return e.useProgram(null),i}function t6(e){l(e._program)||zfe(e)}function zfe(e){let t=e._program,n=e._gl,i=FVe(n,e,e._debugShaders),r=n.getProgramParameter(i,n.ACTIVE_ATTRIBUTES),o=kVe(n,i),s=UVe(e,o.uniformsByName);e._program=i,e._numberOfVertexAttributes=r,e._vertexAttributes=BVe(n,i,r),e._uniformsByName=o.uniformsByName,e._uniforms=o.uniforms,e._automaticUniforms=s.automaticUniforms,e._manualUniforms=s.manualUniforms,e.maximumTextureUnitIndex=zVe(n,i,o.samplerUniforms),t&&e._gl.deleteProgram(t),typeof spector<"u"&&(e._program.__SPECTOR_rebuildProgram=function(a,c,u,f){let d=e._vertexShaderText,p=e._fragmentShaderText,g=/ ! = /g;e._vertexShaderText=a.replace(g," != "),e._fragmentShaderText=c.replace(g," != ");try{zfe(e),u(e._program)}catch(m){e._vertexShaderText=d,e._fragmentShaderText=p;let A=/(?:Compile|Link) error: ([^]*)/.exec(m.message);f(A?A[1]:m.message)}})}cg.prototype._bind=function(){t6(this),this._gl.useProgram(this._program)};cg.prototype._setUniforms=function(e,t,n){let i,r;if(l(e)){let a=this._manualUniforms;for(i=a.length,r=0;r<i;++r){let c=a[r];c.value=e[c.name]()}}let o=this._automaticUniforms;for(i=o.length,r=0;r<i;++r){let a=o[r];a.uniform.value=a.automaticUniform.getValue(t)}let s=this._uniforms;for(i=s.length,r=0;r<i;++r)s[r].set();if(n){let a=this._gl,c=this._program;a.validateProgram(c)}};cg.prototype.isDestroyed=function(){return!1};cg.prototype.destroy=function(){this._cachedShader.cache.releaseShaderProgram(this)};cg.prototype.finalDestroy=function(){return this._gl.deleteProgram(this._program),le(this)};var Qt=cg;function n6(e){this._context=e}var ED,VVe=new at({primitiveType:Oe.TRIANGLES}),jVe=new li({color:new z(0,0,0,0)});function HVe(e,t){return new _s({context:e,colorTextures:[t],destroyAttachments:!1})}function GVe(e,t){return Qt.fromCache({context:e,vertexShaderSource:ux,fragmentShaderSource:t,attributeLocations:{position:0,textureCoordinates:1}})}function WVe(e,t){return(!l(ED)||ED.viewport.width!==e||ED.viewport.height!==t)&&(ED=Ge.fromCache({viewport:new et(0,0,e,t)})),ED}n6.prototype.execute=function(e){l(e.preExecute)&&e.preExecute(e);let t=e.outputTexture,n=t.width,i=t.height,r=this._context,o=l(e.vertexArray)?e.vertexArray:r.getViewportQuadVertexArray(),s=l(e.shaderProgram)?e.shaderProgram:GVe(r,e.fragmentShaderSource),a=HVe(r,t),c=WVe(n,i),u=e.uniformMap,f=jVe;f.framebuffer=a,f.renderState=c,f.execute(r);let d=VVe;d.vertexArray=o,d.renderState=c,d.shaderProgram=s,d.uniformMap=u,d.framebuffer=a,d.execute(r),a.destroy(),e.persists||(s.destroy(),l(e.vertexArray)&&o.destroy()),l(e.postExecute)&&e.postExecute(t)};n6.prototype.isDestroyed=function(){return!1};n6.prototype.destroy=function(){return le(this)};var CD=n6;var An={BYTE:te.BYTE,UNSIGNED_BYTE:te.UNSIGNED_BYTE,SHORT:te.SHORT,UNSIGNED_SHORT:te.UNSIGNED_SHORT,INT:te.INT,UNSIGNED_INT:te.UNSIGNED_INT,FLOAT:te.FLOAT,DOUBLE:te.DOUBLE};An.getSizeInBytes=function(e){switch(e){case An.BYTE:return Int8Array.BYTES_PER_ELEMENT;case An.UNSIGNED_BYTE:return Uint8Array.BYTES_PER_ELEMENT;case An.SHORT:return Int16Array.BYTES_PER_ELEMENT;case An.UNSIGNED_SHORT:return Uint16Array.BYTES_PER_ELEMENT;case An.INT:return Int32Array.BYTES_PER_ELEMENT;case An.UNSIGNED_INT:return Uint32Array.BYTES_PER_ELEMENT;case An.FLOAT:return Float32Array.BYTES_PER_ELEMENT;case An.DOUBLE:return Float64Array.BYTES_PER_ELEMENT}};An.fromTypedArray=function(e){if(e instanceof Int8Array)return An.BYTE;if(e instanceof Uint8Array)return An.UNSIGNED_BYTE;if(e instanceof Int16Array)return An.SHORT;if(e instanceof Uint16Array)return An.UNSIGNED_SHORT;if(e instanceof Int32Array)return An.INT;if(e instanceof Uint32Array)return An.UNSIGNED_INT;if(e instanceof Float32Array)return An.FLOAT;if(e instanceof Float64Array)return An.DOUBLE};An.validate=function(e){return l(e)&&(e===An.BYTE||e===An.UNSIGNED_BYTE||e===An.SHORT||e===An.UNSIGNED_SHORT||e===An.INT||e===An.UNSIGNED_INT||e===An.FLOAT||e===An.DOUBLE)};An.createTypedArray=function(e,t){switch(e){case An.BYTE:return new Int8Array(t);case An.UNSIGNED_BYTE:return new Uint8Array(t);case An.SHORT:return new Int16Array(t);case An.UNSIGNED_SHORT:return new Uint16Array(t);case An.INT:return new Int32Array(t);case An.UNSIGNED_INT:return new Uint32Array(t);case An.FLOAT:return new Float32Array(t);case An.DOUBLE:return new Float64Array(t)}};An.createArrayBufferView=function(e,t,n,i){switch(n=n??0,i=i??(t.byteLength-n)/An.getSizeInBytes(e),e){case An.BYTE:return new Int8Array(t,n,i);case An.UNSIGNED_BYTE:return new Uint8Array(t,n,i);case An.SHORT:return new Int16Array(t,n,i);case An.UNSIGNED_SHORT:return new Uint16Array(t,n,i);case An.INT:return new Int32Array(t,n,i);case An.UNSIGNED_INT:return new Uint32Array(t,n,i);case An.FLOAT:return new Float32Array(t,n,i);case An.DOUBLE:return new Float64Array(t,n,i)}};An.fromName=function(e){switch(e){case"BYTE":return An.BYTE;case"UNSIGNED_BYTE":return An.UNSIGNED_BYTE;case"SHORT":return An.SHORT;case"UNSIGNED_SHORT":return An.UNSIGNED_SHORT;case"INT":return An.INT;case"UNSIGNED_INT":return An.UNSIGNED_INT;case"FLOAT":return An.FLOAT;case"DOUBLE":return An.DOUBLE}};An.dequantize=function(e,t){switch(t){case An.BYTE:return Math.max(e/127,-1);case An.UNSIGNED_BYTE:return e/255;case An.SHORT:return Math.max(e/32767,-1);case An.UNSIGNED_SHORT:return e/65535;case An.INT:return Math.max(e/2147483647,-1);case An.UNSIGNED_INT:return e/4294967295}};Object.freeze(An);var Y=An;var Vfe={NONE:0,TRIANGLES:1,LINES:2,POLYLINES:3};Object.freeze(Vfe);var vd=Vfe;function qY(e){e=e??H.EMPTY_OBJECT,this.attributes=e.attributes,this.indices=e.indices,this.primitiveType=e.primitiveType??Oe.TRIANGLES,this.boundingSphere=e.boundingSphere,this.geometryType=e.geometryType??vd.NONE,this.boundingSphereCV=e.boundingSphereCV,this.offsetAttribute=e.offsetAttribute}qY.computeNumberOfVertices=function(e){let t=-1;for(let n in e.attributes)if(e.attributes.hasOwnProperty(n)&&l(e.attributes[n])&&l(e.attributes[n].values)){let i=e.attributes[n];t=i.values.length/i.componentsPerAttribute}return t};var qVe=new he,YVe=new h,jfe=new N,XVe=[new he,new he,new he],KVe=[new U,new U,new U],$Ve=[new U,new U,new U],JVe=new h,ZVe=new Le,QVe=new N,e4e=new Xi;qY._textureCoordinateRotationPoints=function(e,t,n,i){let r,o=ie.center(i,qVe),s=he.toCartesian(o,n,YVe),a=At.eastNorthUpToFixedFrame(s,n,jfe),c=N.inverse(a,jfe),u=KVe,f=XVe;f[0].longitude=i.west,f[0].latitude=i.south,f[1].longitude=i.west,f[1].latitude=i.north,f[2].longitude=i.east,f[2].latitude=i.south;let d=JVe;for(r=0;r<3;r++)he.toCartesian(f[r],n,d),d=N.multiplyByPointAsVector(c,d,d),u[r].x=d.x,u[r].y=d.y;let p=Le.fromAxisAngle(h.UNIT_Z,-t,ZVe),g=$.fromQuaternion(p,QVe),m=e.length,y=Number.POSITIVE_INFINITY,A=Number.POSITIVE_INFINITY,b=Number.NEGATIVE_INFINITY,x=Number.NEGATIVE_INFINITY;for(r=0;r<m;r++)d=N.multiplyByPointAsVector(c,e[r],d),d=$.multiplyByVector(g,d,d),y=Math.min(y,d.x),A=Math.min(A,d.y),b=Math.max(b,d.x),x=Math.max(x,d.y);let T=Xi.fromRotation(t,e4e),E=$Ve;E[0].x=y,E[0].y=A,E[1].x=y,E[1].y=x,E[2].x=b,E[2].y=A;let v=u[0],S=u[2].x-v.x,I=u[1].y-v.y;for(r=0;r<3;r++){let C=E[r];Xi.multiplyByVector(T,C,C),C.x=(C.x-v.x)/S,C.y=(C.y-v.y)/I}let R=E[0],O=E[1],L=E[2],_=new Array(6);return U.pack(R,_),U.pack(O,_,2),U.pack(L,_,4),_};var St=qY;function t4e(e){e=e??H.EMPTY_OBJECT,this.componentDatatype=e.componentDatatype,this.componentsPerAttribute=e.componentsPerAttribute,this.normalize=e.normalize??!1,this.values=e.values}var Ne=t4e;function _v(e,t,n,i,r){this._format=e,this._datatype=t,this._width=n,this._height=i,this._buffer=r}Object.defineProperties(_v.prototype,{internalFormat:{get:function(){return this._format}},pixelDatatype:{get:function(){return this._datatype}},width:{get:function(){return this._width}},height:{get:function(){return this._height}},bufferView:{get:function(){return this._buffer}},arrayBufferView:{get:function(){return this._buffer}}});_v.clone=function(e){if(l(e))return new _v(e._format,e._datatype,e._width,e._height,e._buffer)};_v.prototype.clone=function(){return _v.clone(this)};var vD=_v;var Hfe=Qo(Tf(),1);function Gfe(){if(!l(rc._canTransferArrayBuffer)){let e=KY("transferTypedArrayTest");e.postMessage=e.webkitPostMessage??e.postMessage;let t=99,n=new Int8Array([t]);try{e.postMessage({array:n},[n.buffer])}catch{return rc._canTransferArrayBuffer=!1,rc._canTransferArrayBuffer}rc._canTransferArrayBuffer=new Promise(i=>{e.onmessage=function(r){let o=r.data.array,s=l(o)&&o[0]===t;i(s),e.terminate(),rc._canTransferArrayBuffer=s}})}return rc._canTransferArrayBuffer}var XY=new be;function YY(e){let t;try{t=new Blob([e],{type:"application/javascript"})}catch{let r=window.BlobBuilder||window.WebKitBlobBuilder||window.MozBlobBuilder||window.MSBlobBuilder,o=new r;o.append(e),t=o.getBlob("application/javascript")}return(window.URL||window.webkitURL).createObjectURL(t)}function KY(e){let t=new Hfe.default(e),n=t.scheme().length!==0&&t.fragment().length===0,i=e.replace(/\.js$/,""),r={},o,s;if(Dy(e))s=e;else if(!n){let a=Zt(`${rc._workerModulePrefix}/${i}.js`);Dy(a)&&(s=a)}if(s){let a=`import "${s}";`;return o=YY(a),r.type="module",new Worker(o,r)}if(!n&&typeof CESIUM_WORKERS<"u"){let a=` importScripts("${YY(CESIUM_WORKERS)}"); CesiumWorkers["${i}"](); - `;return o=YY(a),new Worker(o,r)}if(o=e,n||(o=Zt(`${rc._workerModulePrefix+i}.js`)),!dn.supportsEsmWebWorkers())throw new oe("This browser is not supported. Please update your browser to continue.");return r.type="module",new Worker(o,r)}async function t4e(e,t){let n={modulePath:void 0,wasmBinaryFile:void 0,wasmBinary:void 0};if(!dn.supportsWebAssembly()){if(!l(t.fallbackModulePath))throw new oe(`This browser does not support Web Assembly, and no backup module was provided for ${e._workerPath}`);return n.modulePath=Zt(t.fallbackModulePath),n}n.wasmBinaryFile=Zt(t.wasmBinaryFile);let i=await De.fetchArrayBuffer({url:n.wasmBinaryFile});return n.wasmBinary=i,n}function rc(e,t){this._workerPath=e,this._maximumActiveTasks=t??Number.POSITIVE_INFINITY,this._activeTasks=0,this._nextID=0,this._webAssemblyPromise=void 0}var n4e=(e,t,n,i)=>{let r=({data:o})=>{if(o.id===t){if(l(o.error)){let s=o.error;s.name==="RuntimeError"?(s=new oe(o.error.message),s.stack=o.error.stack):s.name==="DeveloperError"?(s=new pe(o.error.message),s.stack=o.error.stack):s.name==="Error"&&(s=new Error(o.error.message),s.stack=o.error.stack),XY.raiseEvent(s),i(s)}else XY.raiseEvent(),n(o.result);e.removeEventListener("message",r)}};return r},i4e=[];async function r4e(e,t,n){let i=await Promise.resolve(Gfe());l(n)?i||(n.length=0):n=i4e;let r=e._nextID++,o=new Promise((s,a)=>{e._worker.addEventListener("message",n4e(e._worker,r,s,a))});return e._worker.postMessage({id:r,baseUrl:Zt.getCesiumBaseUrl().url,parameters:t,canTransferArrayBuffer:i},n),o}async function o4e(e,t,n){++e._activeTasks;try{let i=await r4e(e,t,n);return--e._activeTasks,i}catch(i){throw--e._activeTasks,i}}rc.prototype.scheduleTask=function(e,t){if(l(this._worker)||(this._worker=KY(this._workerPath)),!(this._activeTasks>=this._maximumActiveTasks))return o4e(this,e,t)};rc.prototype.initWebAssemblyModule=async function(e){if(l(this._webAssemblyPromise))return this._webAssemblyPromise;let t=async()=>{let n=this._worker=KY(this._workerPath),i=await t4e(this,e),r=await Promise.resolve(Gfe()),o,s=i.wasmBinary;l(s)&&r&&(o=[s]);let a=new Promise((c,u)=>{n.onmessage=function({data:f}){l(f)?c(f.result):u(new oe("Could not configure wasm module"))}});return n.postMessage({canTransferArrayBuffer:r,parameters:{webAssemblyConfig:i}},o),a};return this._webAssemblyPromise=t(),this._webAssemblyPromise};rc.prototype.isDestroyed=function(){return!1};rc.prototype.destroy=function(){return l(this._worker)&&this._worker.terminate(),le(this)};rc.taskCompletedEvent=XY;rc._defaultWorkerModulePrefix="Workers/";rc._workerModulePrefix=rc._defaultWorkerModulePrefix;rc._canTransferArrayBuffer=void 0;var $n=rc;function lg(){}lg._transcodeTaskProcessor=new $n("transcodeKTX2",Number.POSITIVE_INFINITY);lg._readyPromise=void 0;function s4e(){let e=lg._transcodeTaskProcessor.initWebAssemblyModule({wasmBinaryFile:"ThirdParty/basis_transcoder.wasm"}).then(function(t){if(t)return lg._transcodeTaskProcessor;throw new oe("KTX2 transcoder could not be initialized.")});lg._readyPromise=e}lg.transcode=function(e,t){return l(lg._readyPromise)||s4e(),lg._readyPromise.then(function(n){let i=e;e instanceof ArrayBuffer&&(i=new Uint8Array(e));let r={supportedTargetFormats:t,ktx2Buffer:i};return n.scheduleTask(r,[i.buffer])}).then(function(n){let i=n.length,r=Object.keys(n[0]);for(let o=0;o<i;o++){let s=n[o];for(let a=0;a<r.length;a++){let c=s[r[a]];s[r[a]]=new vD(c.internalFormat,c.datatype,c.width,c.height,c.levelBuffer)}}if(r.length===1){for(let o=0;o<i;++o)n[o]=n[o][r[0]];i===1&&(n=n[0])}return n}).catch(function(n){throw n})};var SD=lg;var Wfe;qfe.setKTX2SupportedFormats=function(e,t,n,i,r,o){Wfe={s3tc:e,pvrtc:t,astc:n,etc:i,etc1:r,bc7:o}};function qfe(e){let t;return e instanceof ArrayBuffer||ArrayBuffer.isView(e)?t=Promise.resolve(e):t=De.createIfNeeded(e).fetchArrayBuffer(),t.then(function(n){return SD.transcode(n,Wfe)})}var Ou=qfe;function a4e(e,t){this.start=e??0,this.stop=t??0}var Us=a4e;var i6=class e{constructor(t,n){this.center=h.clone(t??h.ZERO),this.radius=n??0}static fromPoints(t,n){if(l(n)||(n=new e),!l(t)||t.length===0)return n.center=h.clone(h.ZERO,n.center),n.radius=0,n;let i=h.clone(t[0],nX),r=h.clone(i,$Y),o=h.clone(i,JY),s=h.clone(i,ZY),a=h.clone(i,QY),c=h.clone(i,eX),u=h.clone(i,tX),f=t.length,d;for(d=1;d<f;d++){h.clone(t[d],i);let O=i.x,L=i.y,_=i.z;O<r.x&&h.clone(i,r),O>a.x&&h.clone(i,a),L<o.y&&h.clone(i,o),L>c.y&&h.clone(i,c),_<s.z&&h.clone(i,s),_>u.z&&h.clone(i,u)}let p=h.magnitudeSquared(h.subtract(a,r,oc)),g=h.magnitudeSquared(h.subtract(c,o,oc)),m=h.magnitudeSquared(h.subtract(u,s,oc)),y=r,A=a,b=p;g>b&&(b=g,y=o,A=c),m>b&&(y=s,A=u);let x=iX;x.x=(y.x+A.x)*.5,x.y=(y.y+A.y)*.5,x.z=(y.z+A.z)*.5;let T=h.magnitudeSquared(h.subtract(A,x,oc)),E=Math.sqrt(T),v=rX;v.x=r.x,v.y=o.y,v.z=s.z;let S=oX;S.x=a.x,S.y=c.y,S.z=u.z;let I=h.midpoint(v,S,sX),R=0;for(d=0;d<f;d++){h.clone(t[d],i);let O=h.magnitude(h.subtract(i,I,oc));O>R&&(R=O);let L=h.magnitudeSquared(h.subtract(i,x,oc));if(L>T){let _=Math.sqrt(L);E=(E+_)*.5,T=E*E;let C=_-E;x.x=(E*x.x+C*i.x)/_,x.y=(E*x.y+C*i.y)/_,x.z=(E*x.z+C*i.z)/_}}return E<R?(h.clone(x,n.center),n.radius=E):(h.clone(I,n.center),n.radius=R),n}static fromRectangle2D(t,n,i){return e.fromRectangleWithHeights2D(t,n,0,0,i)}static fromRectangleWithHeights2D(t,n,i,r,o){if(l(o)||(o=new e),!l(t))return o.center=h.clone(h.ZERO,o.center),o.radius=0,o;Yfe._ellipsoid=ee.default,n=n??Yfe,ie.southwest(t,aX),aX.height=i,ie.northeast(t,cX),cX.height=r;let s=n.project(aX,l4e),a=n.project(cX,u4e),c=a.x-s.x,u=a.y-s.y,f=a.z-s.z;o.radius=Math.sqrt(c*c+u*u+f*f)*.5;let d=o.center;return d.x=s.x+c*.5,d.y=s.y+u*.5,d.z=s.z+f*.5,o}static fromRectangle3D(t,n,i,r){if(n=n??ee.default,i=i??0,l(r)||(r=new e),!l(t))return r.center=h.clone(h.ZERO,r.center),r.radius=0,r;let o=ie.subsample(t,n,i,f4e);return e.fromPoints(o,r)}static fromVertices(t,n,i,r){if(l(r)||(r=new e),!l(t)||t.length===0)return r.center=h.clone(h.ZERO,r.center),r.radius=0,r;n=n??h.ZERO,i=i??3;let o=nX;o.x=t[0]+n.x,o.y=t[1]+n.y,o.z=t[2]+n.z;let s=h.clone(o,$Y),a=h.clone(o,JY),c=h.clone(o,ZY),u=h.clone(o,QY),f=h.clone(o,eX),d=h.clone(o,tX),p=t.length,g;for(g=0;g<p;g+=i){let _=t[g]+n.x,C=t[g+1]+n.y,w=t[g+2]+n.z;o.x=_,o.y=C,o.z=w,_<s.x&&h.clone(o,s),_>u.x&&h.clone(o,u),C<a.y&&h.clone(o,a),C>f.y&&h.clone(o,f),w<c.z&&h.clone(o,c),w>d.z&&h.clone(o,d)}let m=h.magnitudeSquared(h.subtract(u,s,oc)),y=h.magnitudeSquared(h.subtract(f,a,oc)),A=h.magnitudeSquared(h.subtract(d,c,oc)),b=s,x=u,T=m;y>T&&(T=y,b=a,x=f),A>T&&(b=c,x=d);let E=iX;E.x=(b.x+x.x)*.5,E.y=(b.y+x.y)*.5,E.z=(b.z+x.z)*.5;let v=h.magnitudeSquared(h.subtract(x,E,oc)),S=Math.sqrt(v),I=rX;I.x=s.x,I.y=a.y,I.z=c.z;let R=oX;R.x=u.x,R.y=f.y,R.z=d.z;let O=h.midpoint(I,R,sX),L=0;for(g=0;g<p;g+=i){o.x=t[g]+n.x,o.y=t[g+1]+n.y,o.z=t[g+2]+n.z;let _=h.magnitude(h.subtract(o,O,oc));_>L&&(L=_);let C=h.magnitudeSquared(h.subtract(o,E,oc));if(C>v){let w=Math.sqrt(C);S=(S+w)*.5,v=S*S;let P=w-S;E.x=(S*E.x+P*o.x)/w,E.y=(S*E.y+P*o.y)/w,E.z=(S*E.z+P*o.z)/w}}return S<L?(h.clone(E,r.center),r.radius=S):(h.clone(O,r.center),r.radius=L),r}static fromEncodedCartesianVertices(t,n,i){if(l(i)||(i=new e),!l(t)||!l(n)||t.length!==n.length||t.length===0)return i.center=h.clone(h.ZERO,i.center),i.radius=0,i;let r=nX;r.x=t[0]+n[0],r.y=t[1]+n[1],r.z=t[2]+n[2];let o=h.clone(r,$Y),s=h.clone(r,JY),a=h.clone(r,ZY),c=h.clone(r,QY),u=h.clone(r,eX),f=h.clone(r,tX),d=t.length,p;for(p=0;p<d;p+=3){let L=t[p]+n[p],_=t[p+1]+n[p+1],C=t[p+2]+n[p+2];r.x=L,r.y=_,r.z=C,L<o.x&&h.clone(r,o),L>c.x&&h.clone(r,c),_<s.y&&h.clone(r,s),_>u.y&&h.clone(r,u),C<a.z&&h.clone(r,a),C>f.z&&h.clone(r,f)}let g=h.magnitudeSquared(h.subtract(c,o,oc)),m=h.magnitudeSquared(h.subtract(u,s,oc)),y=h.magnitudeSquared(h.subtract(f,a,oc)),A=o,b=c,x=g;m>x&&(x=m,A=s,b=u),y>x&&(A=a,b=f);let T=iX;T.x=(A.x+b.x)*.5,T.y=(A.y+b.y)*.5,T.z=(A.z+b.z)*.5;let E=h.magnitudeSquared(h.subtract(b,T,oc)),v=Math.sqrt(E),S=rX;S.x=o.x,S.y=s.y,S.z=a.z;let I=oX;I.x=c.x,I.y=u.y,I.z=f.z;let R=h.midpoint(S,I,sX),O=0;for(p=0;p<d;p+=3){r.x=t[p]+n[p],r.y=t[p+1]+n[p+1],r.z=t[p+2]+n[p+2];let L=h.magnitude(h.subtract(r,R,oc));L>O&&(O=L);let _=h.magnitudeSquared(h.subtract(r,T,oc));if(_>E){let C=Math.sqrt(_);v=(v+C)*.5,E=v*v;let w=C-v;T.x=(v*T.x+w*r.x)/C,T.y=(v*T.y+w*r.y)/C,T.z=(v*T.z+w*r.z)/C}}return v<O?(h.clone(T,i.center),i.radius=v):(h.clone(R,i.center),i.radius=O),i}static fromCornerPoints(t,n,i){l(i)||(i=new e);let r=h.midpoint(t,n,i.center);return i.radius=h.distance(r,n),i}static fromEllipsoid(t,n){return l(n)||(n=new e),h.clone(h.ZERO,n.center),n.radius=t.maximumRadius,n}static fromBoundingSpheres(t,n){if(l(n)||(n=new e),!l(t)||t.length===0)return n.center=h.clone(h.ZERO,n.center),n.radius=0,n;let i=t.length;if(i===1)return e.clone(t[0],n);if(i===2)return e.union(t[0],t[1],n);let r=[],o;for(o=0;o<i;o++)r.push(t[o].center);n=e.fromPoints(r,n);let s=n.center,a=n.radius;for(o=0;o<i;o++){let c=t[o];a=Math.max(a,h.distance(s,c.center)+c.radius)}return n.radius=a,n}static fromOrientedBoundingBox(t,n){l(n)||(n=new e);let i=t.halfAxes,r=$.getColumn(i,0,d4e),o=$.getColumn(i,1,h4e),s=$.getColumn(i,2,m4e);return h.add(r,o,r),h.add(r,s,r),n.center=h.clone(t.center,n.center),n.radius=h.magnitude(r),n}static fromTransformation(t,n){l(n)||(n=new e);let i=N.getTranslation(t,p4e),r=N.getScale(t,g4e),o=.5*h.magnitude(r);return n.center=h.clone(i,n.center),n.radius=o,n}static clone(t,n){if(l(t))return l(n)?(n.center=h.clone(t.center,n.center),n.radius=t.radius,n):new e(t.center,t.radius)}static pack(t,n,i){i=i??0;let r=t.center;return n[i++]=r.x,n[i++]=r.y,n[i++]=r.z,n[i]=t.radius,n}static unpack(t,n,i){n=n??0,l(i)||(i=new e);let r=i.center;return r.x=t[n++],r.y=t[n++],r.z=t[n++],i.radius=t[n],i}static union(t,n,i){l(i)||(i=new e);let r=t.center,o=t.radius,s=n.center,a=n.radius,c=h.subtract(s,r,_4e),u=h.magnitude(c);if(o>=u+a)return t.clone(i),i;if(a>=u+o)return n.clone(i),i;let f=(o+u+a)*.5,d=h.multiplyByScalar(c,(-o+f)/u,y4e);return h.add(d,r,d),h.clone(d,i.center),i.radius=f,i}static expand(t,n,i){i=e.clone(t,i);let r=h.magnitude(h.subtract(n,i.center,A4e));return r>i.radius&&(i.radius=r),i}static intersectPlane(t,n){let i=t.center,r=t.radius,o=n.normal,s=h.dot(o,i)+n.distance;return s<-r?$t.OUTSIDE:s<r?$t.INTERSECTING:$t.INSIDE}static transform(t,n,i){return l(i)||(i=new e),i.center=N.multiplyByPoint(n,t.center,i.center),i.radius=N.getMaximumScale(n)*t.radius,i}static distanceSquaredTo(t,n){let i=h.subtract(t.center,n,b4e),r=h.magnitude(i)-t.radius;return r<=0?0:r*r}static transformWithoutScale(t,n,i){return l(i)||(i=new e),i.center=N.multiplyByPoint(n,t.center,i.center),i.radius=t.radius,i}static computePlaneDistances(t,n,i,r){l(r)||(r=new Us);let o=h.subtract(t.center,n,x4e),s=h.dot(i,o);return r.start=s-t.radius,r.stop=s+t.radius,r}static projectTo2D(t,n,i){Kfe._ellipsoid=ee.default,n=n??Kfe;let r=n.ellipsoid,o=t.center,s=t.radius,a;h.equals(o,h.ZERO)?a=h.clone(h.UNIT_X,Xfe):a=r.geodeticSurfaceNormal(o,Xfe);let c=h.cross(h.UNIT_Z,a,T4e);h.normalize(c,c);let u=h.cross(a,c,E4e);h.normalize(u,u),h.multiplyByScalar(a,s,a),h.multiplyByScalar(u,s,u),h.multiplyByScalar(c,s,c);let f=h.negate(u,v4e),d=h.negate(c,C4e),p=$fe,g=p[0];h.add(a,u,g),h.add(g,c,g),g=p[1],h.add(a,u,g),h.add(g,d,g),g=p[2],h.add(a,f,g),h.add(g,d,g),g=p[3],h.add(a,f,g),h.add(g,c,g),h.negate(a,a),g=p[4],h.add(a,u,g),h.add(g,c,g),g=p[5],h.add(a,u,g),h.add(g,d,g),g=p[6],h.add(a,f,g),h.add(g,d,g),g=p[7],h.add(a,f,g),h.add(g,c,g);let m=p.length;for(let x=0;x<m;++x){let T=p[x];h.add(o,T,T);let E=r.cartesianToCartographic(T,S4e);n.project(E,T)}i=e.fromPoints(p,i),o=i.center;let y=o.x,A=o.y,b=o.z;return o.x=b,o.y=y,o.z=A,i}static isOccluded(t,n){return!n.isBoundingSphereVisible(t)}static equals(t,n){return t===n||l(t)&&l(n)&&h.equals(t.center,n.center)&&t.radius===n.radius}intersectPlane(t){return e.intersectPlane(this,t)}distanceSquaredTo(t){return e.distanceSquaredTo(this,t)}computePlaneDistances(t,n,i){return e.computePlaneDistances(this,t,n,i)}isOccluded(t){return e.isOccluded(this,t)}equals(t){return e.equals(this,t)}clone(t){return e.clone(this,t)}volume(){let t=this.radius;return c4e*t*t*t}};i6.packedLength=4;var $Y=new h,JY=new h,ZY=new h,QY=new h,eX=new h,tX=new h,nX=new h,oc=new h,iX=new h,rX=new h,oX=new h,sX=new h,c4e=4/3*D.PI,Yfe=new Ui,l4e=new h,u4e=new h,aX=new he,cX=new he,f4e=[],d4e=new h,h4e=new h,m4e=new h,p4e=new h,g4e=new h,_4e=new h,y4e=new h,A4e=new h,b4e=new h,x4e=new h,Xfe=new h,T4e=new h,E4e=new h,C4e=new h,v4e=new h,S4e=new he,$fe=new Array(8);for(let e=0;e<8;++e)$fe[e]=new h;var Kfe=new Ui,ue=i6;function w4e(e){e=e??H.EMPTY_OBJECT,this.position=e.position,this.normal=e.normal,this.st=e.st,this.bitangent=e.bitangent,this.tangent=e.tangent,this.color=e.color}var Tn=w4e;var Jfe={NONE:0,TOP:1,ALL:2};Object.freeze(Jfe);var mn=Jfe;function ea(e){e=e??H.EMPTY_OBJECT,this.position=e.position??!1,this.normal=e.normal??!1,this.st=e.st??!1,this.bitangent=e.bitangent??!1,this.tangent=e.tangent??!1,this.color=e.color??!1}ea.POSITION_ONLY=Object.freeze(new ea({position:!0}));ea.POSITION_AND_NORMAL=Object.freeze(new ea({position:!0,normal:!0}));ea.POSITION_NORMAL_AND_ST=Object.freeze(new ea({position:!0,normal:!0,st:!0}));ea.POSITION_AND_ST=Object.freeze(new ea({position:!0,st:!0}));ea.POSITION_AND_COLOR=Object.freeze(new ea({position:!0,color:!0}));ea.ALL=Object.freeze(new ea({position:!0,normal:!0,st:!0,tangent:!0,bitangent:!0}));ea.DEFAULT=ea.POSITION_NORMAL_AND_ST;ea.packedLength=6;ea.pack=function(e,t,n){return n=n??0,t[n++]=e.position?1:0,t[n++]=e.normal?1:0,t[n++]=e.st?1:0,t[n++]=e.tangent?1:0,t[n++]=e.bitangent?1:0,t[n]=e.color?1:0,t};ea.unpack=function(e,t,n){return t=t??0,l(n)||(n=new ea),n.position=e[t++]===1,n.normal=e[t++]===1,n.st=e[t++]===1,n.tangent=e[t++]===1,n.bitangent=e[t++]===1,n.color=e[t]===1,n};ea.clone=function(e,t){if(l(e))return l(t)||(t=new ea),t.position=e.position,t.normal=e.normal,t.st=e.st,t.tangent=e.tangent,t.bitangent=e.bitangent,t.color=e.color,t};var Be=ea;var I4e=new h;function Cf(e){e=e??H.EMPTY_OBJECT;let t=e.minimum,n=e.maximum,i=e.vertexFormat??Be.DEFAULT;this._minimum=h.clone(t),this._maximum=h.clone(n),this._vertexFormat=i,this._offsetAttribute=e.offsetAttribute,this._workerName="createBoxGeometry"}Cf.fromDimensions=function(e){e=e??H.EMPTY_OBJECT;let t=e.dimensions,n=h.multiplyByScalar(t,.5,new h);return new Cf({minimum:h.negate(n,new h),maximum:n,vertexFormat:e.vertexFormat,offsetAttribute:e.offsetAttribute})};Cf.fromAxisAlignedBoundingBox=function(e){return new Cf({minimum:e.minimum,maximum:e.maximum})};Cf.packedLength=2*h.packedLength+Be.packedLength+1;Cf.pack=function(e,t,n){return n=n??0,h.pack(e._minimum,t,n),h.pack(e._maximum,t,n+h.packedLength),Be.pack(e._vertexFormat,t,n+2*h.packedLength),t[n+2*h.packedLength+Be.packedLength]=e._offsetAttribute??-1,t};var Qfe=new h,ede=new h,tde=new Be,Zfe={minimum:Qfe,maximum:ede,vertexFormat:tde,offsetAttribute:void 0};Cf.unpack=function(e,t,n){t=t??0;let i=h.unpack(e,t,Qfe),r=h.unpack(e,t+h.packedLength,ede),o=Be.unpack(e,t+2*h.packedLength,tde),s=e[t+2*h.packedLength+Be.packedLength];return l(n)?(n._minimum=h.clone(i,n._minimum),n._maximum=h.clone(r,n._maximum),n._vertexFormat=Be.clone(o,n._vertexFormat),n._offsetAttribute=s===-1?void 0:s,n):(Zfe.offsetAttribute=s===-1?void 0:s,new Cf(Zfe))};Cf.createGeometry=function(e){let t=e._minimum,n=e._maximum,i=e._vertexFormat;if(h.equals(t,n))return;let r=new Tn,o,s;if(i.position&&(i.st||i.normal||i.tangent||i.bitangent)){if(i.position&&(s=new Float64Array(72),s[0]=t.x,s[1]=t.y,s[2]=n.z,s[3]=n.x,s[4]=t.y,s[5]=n.z,s[6]=n.x,s[7]=n.y,s[8]=n.z,s[9]=t.x,s[10]=n.y,s[11]=n.z,s[12]=t.x,s[13]=t.y,s[14]=t.z,s[15]=n.x,s[16]=t.y,s[17]=t.z,s[18]=n.x,s[19]=n.y,s[20]=t.z,s[21]=t.x,s[22]=n.y,s[23]=t.z,s[24]=n.x,s[25]=t.y,s[26]=t.z,s[27]=n.x,s[28]=n.y,s[29]=t.z,s[30]=n.x,s[31]=n.y,s[32]=n.z,s[33]=n.x,s[34]=t.y,s[35]=n.z,s[36]=t.x,s[37]=t.y,s[38]=t.z,s[39]=t.x,s[40]=n.y,s[41]=t.z,s[42]=t.x,s[43]=n.y,s[44]=n.z,s[45]=t.x,s[46]=t.y,s[47]=n.z,s[48]=t.x,s[49]=n.y,s[50]=t.z,s[51]=n.x,s[52]=n.y,s[53]=t.z,s[54]=n.x,s[55]=n.y,s[56]=n.z,s[57]=t.x,s[58]=n.y,s[59]=n.z,s[60]=t.x,s[61]=t.y,s[62]=t.z,s[63]=n.x,s[64]=t.y,s[65]=t.z,s[66]=n.x,s[67]=t.y,s[68]=n.z,s[69]=t.x,s[70]=t.y,s[71]=n.z,r.position=new Ne({componentDatatype:Y.DOUBLE,componentsPerAttribute:3,values:s})),i.normal){let u=new Float32Array(72);u[0]=0,u[1]=0,u[2]=1,u[3]=0,u[4]=0,u[5]=1,u[6]=0,u[7]=0,u[8]=1,u[9]=0,u[10]=0,u[11]=1,u[12]=0,u[13]=0,u[14]=-1,u[15]=0,u[16]=0,u[17]=-1,u[18]=0,u[19]=0,u[20]=-1,u[21]=0,u[22]=0,u[23]=-1,u[24]=1,u[25]=0,u[26]=0,u[27]=1,u[28]=0,u[29]=0,u[30]=1,u[31]=0,u[32]=0,u[33]=1,u[34]=0,u[35]=0,u[36]=-1,u[37]=0,u[38]=0,u[39]=-1,u[40]=0,u[41]=0,u[42]=-1,u[43]=0,u[44]=0,u[45]=-1,u[46]=0,u[47]=0,u[48]=0,u[49]=1,u[50]=0,u[51]=0,u[52]=1,u[53]=0,u[54]=0,u[55]=1,u[56]=0,u[57]=0,u[58]=1,u[59]=0,u[60]=0,u[61]=-1,u[62]=0,u[63]=0,u[64]=-1,u[65]=0,u[66]=0,u[67]=-1,u[68]=0,u[69]=0,u[70]=-1,u[71]=0,r.normal=new Ne({componentDatatype:Y.FLOAT,componentsPerAttribute:3,values:u})}if(i.st){let u=new Float32Array(48);u[0]=0,u[1]=0,u[2]=1,u[3]=0,u[4]=1,u[5]=1,u[6]=0,u[7]=1,u[8]=1,u[9]=0,u[10]=0,u[11]=0,u[12]=0,u[13]=1,u[14]=1,u[15]=1,u[16]=0,u[17]=0,u[18]=1,u[19]=0,u[20]=1,u[21]=1,u[22]=0,u[23]=1,u[24]=1,u[25]=0,u[26]=0,u[27]=0,u[28]=0,u[29]=1,u[30]=1,u[31]=1,u[32]=1,u[33]=0,u[34]=0,u[35]=0,u[36]=0,u[37]=1,u[38]=1,u[39]=1,u[40]=0,u[41]=0,u[42]=1,u[43]=0,u[44]=1,u[45]=1,u[46]=0,u[47]=1,r.st=new Ne({componentDatatype:Y.FLOAT,componentsPerAttribute:2,values:u})}if(i.tangent){let u=new Float32Array(72);u[0]=1,u[1]=0,u[2]=0,u[3]=1,u[4]=0,u[5]=0,u[6]=1,u[7]=0,u[8]=0,u[9]=1,u[10]=0,u[11]=0,u[12]=-1,u[13]=0,u[14]=0,u[15]=-1,u[16]=0,u[17]=0,u[18]=-1,u[19]=0,u[20]=0,u[21]=-1,u[22]=0,u[23]=0,u[24]=0,u[25]=1,u[26]=0,u[27]=0,u[28]=1,u[29]=0,u[30]=0,u[31]=1,u[32]=0,u[33]=0,u[34]=1,u[35]=0,u[36]=0,u[37]=-1,u[38]=0,u[39]=0,u[40]=-1,u[41]=0,u[42]=0,u[43]=-1,u[44]=0,u[45]=0,u[46]=-1,u[47]=0,u[48]=-1,u[49]=0,u[50]=0,u[51]=-1,u[52]=0,u[53]=0,u[54]=-1,u[55]=0,u[56]=0,u[57]=-1,u[58]=0,u[59]=0,u[60]=1,u[61]=0,u[62]=0,u[63]=1,u[64]=0,u[65]=0,u[66]=1,u[67]=0,u[68]=0,u[69]=1,u[70]=0,u[71]=0,r.tangent=new Ne({componentDatatype:Y.FLOAT,componentsPerAttribute:3,values:u})}if(i.bitangent){let u=new Float32Array(72);u[0]=0,u[1]=1,u[2]=0,u[3]=0,u[4]=1,u[5]=0,u[6]=0,u[7]=1,u[8]=0,u[9]=0,u[10]=1,u[11]=0,u[12]=0,u[13]=1,u[14]=0,u[15]=0,u[16]=1,u[17]=0,u[18]=0,u[19]=1,u[20]=0,u[21]=0,u[22]=1,u[23]=0,u[24]=0,u[25]=0,u[26]=1,u[27]=0,u[28]=0,u[29]=1,u[30]=0,u[31]=0,u[32]=1,u[33]=0,u[34]=0,u[35]=1,u[36]=0,u[37]=0,u[38]=1,u[39]=0,u[40]=0,u[41]=1,u[42]=0,u[43]=0,u[44]=1,u[45]=0,u[46]=0,u[47]=1,u[48]=0,u[49]=0,u[50]=1,u[51]=0,u[52]=0,u[53]=1,u[54]=0,u[55]=0,u[56]=1,u[57]=0,u[58]=0,u[59]=1,u[60]=0,u[61]=0,u[62]=1,u[63]=0,u[64]=0,u[65]=1,u[66]=0,u[67]=0,u[68]=1,u[69]=0,u[70]=0,u[71]=1,r.bitangent=new Ne({componentDatatype:Y.FLOAT,componentsPerAttribute:3,values:u})}o=new Uint16Array(36),o[0]=0,o[1]=1,o[2]=2,o[3]=0,o[4]=2,o[5]=3,o[6]=6,o[7]=5,o[8]=4,o[9]=7,o[10]=6,o[11]=4,o[12]=8,o[13]=9,o[14]=10,o[15]=8,o[16]=10,o[17]=11,o[18]=14,o[19]=13,o[20]=12,o[21]=15,o[22]=14,o[23]=12,o[24]=18,o[25]=17,o[26]=16,o[27]=19,o[28]=18,o[29]=16,o[30]=20,o[31]=21,o[32]=22,o[33]=20,o[34]=22,o[35]=23}else s=new Float64Array(24),s[0]=t.x,s[1]=t.y,s[2]=t.z,s[3]=n.x,s[4]=t.y,s[5]=t.z,s[6]=n.x,s[7]=n.y,s[8]=t.z,s[9]=t.x,s[10]=n.y,s[11]=t.z,s[12]=t.x,s[13]=t.y,s[14]=n.z,s[15]=n.x,s[16]=t.y,s[17]=n.z,s[18]=n.x,s[19]=n.y,s[20]=n.z,s[21]=t.x,s[22]=n.y,s[23]=n.z,r.position=new Ne({componentDatatype:Y.DOUBLE,componentsPerAttribute:3,values:s}),o=new Uint16Array(36),o[0]=4,o[1]=5,o[2]=6,o[3]=4,o[4]=6,o[5]=7,o[6]=1,o[7]=0,o[8]=3,o[9]=1,o[10]=3,o[11]=2,o[12]=1,o[13]=6,o[14]=5,o[15]=1,o[16]=2,o[17]=6,o[18]=2,o[19]=3,o[20]=7,o[21]=2,o[22]=7,o[23]=6,o[24]=3,o[25]=0,o[26]=4,o[27]=3,o[28]=4,o[29]=7,o[30]=0,o[31]=1,o[32]=5,o[33]=0,o[34]=5,o[35]=4;let a=h.subtract(n,t,I4e),c=h.magnitude(a)*.5;if(l(e._offsetAttribute)){let u=s.length,f=e._offsetAttribute===mn.NONE?0:1,d=new Uint8Array(u/3).fill(f);r.applyOffset=new Ne({componentDatatype:Y.UNSIGNED_BYTE,componentsPerAttribute:1,values:d})}return new St({attributes:r,indices:o,primitiveType:Oe.TRIANGLES,boundingSphere:new ue(h.ZERO,c),offsetAttribute:e._offsetAttribute})};var lX;Cf.getUnitBox=function(){return l(lX)||(lX=Cf.createGeometry(Cf.fromDimensions({dimensions:new h(1,1,1),vertexFormat:Be.POSITION_ONLY}))),lX};var Ic=Cf;var xr={SCALAR:"SCALAR",VEC2:"VEC2",VEC3:"VEC3",VEC4:"VEC4",MAT2:"MAT2",MAT3:"MAT3",MAT4:"MAT4"};xr.getMathType=function(e){switch(e){case xr.SCALAR:return Number;case xr.VEC2:return U;case xr.VEC3:return h;case xr.VEC4:return se;case xr.MAT2:return Xi;case xr.MAT3:return $;case xr.MAT4:return N}};xr.getNumberOfComponents=function(e){switch(e){case xr.SCALAR:return 1;case xr.VEC2:return 2;case xr.VEC3:return 3;case xr.VEC4:case xr.MAT2:return 4;case xr.MAT3:return 9;case xr.MAT4:return 16}};xr.getAttributeLocationCount=function(e){switch(e){case xr.SCALAR:case xr.VEC2:case xr.VEC3:case xr.VEC4:return 1;case xr.MAT2:return 2;case xr.MAT3:return 3;case xr.MAT4:return 4}};xr.getGlslType=function(e){switch(e){case xr.SCALAR:return"float";case xr.VEC2:return"vec2";case xr.VEC3:return"vec3";case xr.VEC4:return"vec4";case xr.MAT2:return"mat2";case xr.MAT3:return"mat3";case xr.MAT4:return"mat4"}};Object.freeze(xr);var Vt=xr;var nde=1/256,P4e=65536,fX=256,Lr={};Lr.octEncodeInRange=function(e,t,n){if(n.x=e.x/(Math.abs(e.x)+Math.abs(e.y)+Math.abs(e.z)),n.y=e.y/(Math.abs(e.x)+Math.abs(e.y)+Math.abs(e.z)),e.z<0){let i=n.x,r=n.y;n.x=(1-Math.abs(r))*D.signNotZero(i),n.y=(1-Math.abs(i))*D.signNotZero(r)}return n.x=D.toSNorm(n.x,t),n.y=D.toSNorm(n.y,t),n};Lr.octEncode=function(e,t){return Lr.octEncodeInRange(e,255,t)};var wD=new U,ide=new Uint8Array(1);function r6(e){return ide[0]=e,ide[0]}Lr.octEncodeToCartesian4=function(e,t){return Lr.octEncodeInRange(e,65535,wD),t.x=r6(wD.x*nde),t.y=r6(wD.x),t.z=r6(wD.y*nde),t.w=r6(wD.y),t};Lr.octDecodeInRange=function(e,t,n,i){if(i.x=D.fromSNorm(e,n),i.y=D.fromSNorm(t,n),i.z=1-(Math.abs(i.x)+Math.abs(i.y)),i.z<0){let r=i.x;i.x=(1-Math.abs(i.y))*D.signNotZero(r),i.y=(1-Math.abs(r))*D.signNotZero(i.y)}return h.normalize(i,i)};Lr.octDecode=function(e,t,n){return Lr.octDecodeInRange(e,t,255,n)};Lr.octDecodeFromCartesian4=function(e,t){let n=e.x,i=e.y,r=e.z,o=e.w,s=n*fX+i,a=r*fX+o;return Lr.octDecodeInRange(s,a,65535,t)};Lr.octPackFloat=function(e){return 256*e.x+e.y};var dX=new U;Lr.octEncodeFloat=function(e){return Lr.octEncode(e,dX),Lr.octPackFloat(dX)};Lr.octDecodeFloat=function(e,t){let n=e/256,i=Math.floor(n),r=(n-i)*256;return Lr.octDecode(i,r,t)};Lr.octPack=function(e,t,n,i){let r=Lr.octEncodeFloat(e),o=Lr.octEncodeFloat(t),s=Lr.octEncode(n,dX);return i.x=65536*s.x+r,i.y=65536*s.y+o,i};Lr.octUnpack=function(e,t,n,i){let r=e.x/65536,o=Math.floor(r),s=(r-o)*65536;r=e.y/65536;let a=Math.floor(r),c=(r-a)*65536;Lr.octDecodeFloat(s,t),Lr.octDecodeFloat(c,n),Lr.octDecode(o,a,i)};Lr.compressTextureCoordinates=function(e){let t=e.x*4095|0,n=e.y*4095|0;return 4096*t+n};Lr.decompressTextureCoordinates=function(e,t){let n=e/4096,i=Math.floor(n);return t.x=i/4095,t.y=(e-i*4096)/4095,t};function uX(e){return e>>1^-(e&1)}Lr.zigZagDeltaDecode=function(e,t,n){let i=e.length,r=0,o=0,s=0;for(let a=0;a<i;++a)r+=uX(e[a]),o+=uX(t[a]),e[a]=r,t[a]=o,l(n)&&(s+=uX(n[a]),n[a]=s)};Lr.dequantize=function(e,t,n,i){let r=Vt.getNumberOfComponents(n),o;switch(t){case Y.BYTE:o=127;break;case Y.UNSIGNED_BYTE:o=255;break;case Y.SHORT:o=32767;break;case Y.UNSIGNED_SHORT:o=65535;break;case Y.INT:o=2147483647;break;case Y.UNSIGNED_INT:o=4294967295;break}let s=new Float32Array(i*r);for(let a=0;a<i;a++)for(let c=0;c<r;c++){let u=a*r+c;s[u]=Math.max(e[u]/o,-1)}return s};Lr.encodeRGB8=function(e){return Math.round(D.clamp(e.red*255,0,255))*P4e+Math.round(D.clamp(e.green*255,0,255))*fX+Math.round(D.clamp(e.blue*255,0,255))};Lr.decodeRGB8=function(e,t){return e=Math.floor(e),t.red=(e>>16&255)/255,t.green=(e>>8&255)/255,t.blue=(e&255)/255,t};Lr.decodeRGB565=function(e,t){let n=e.length;l(t)||(t=new Float32Array(n*3));let i=31,r=63,o=1/31,s=1/63;for(let a=0;a<n;a++){let c=e[a],u=c>>11,f=c>>5&r,d=c&i,p=3*a;t[p]=u*o,t[p+1]=f*s,t[p+2]=d*o}return t};var cn=Lr;var rde=new h,ode=new h,sde=new h;function D4e(e,t,n,i,r){l(r)||(r=new h);let o,s,a,c,u,f,d,p;if(l(t.z)){if(h.equalsEpsilon(e,t,D.EPSILON14))return h.clone(h.UNIT_X,r);if(h.equalsEpsilon(e,n,D.EPSILON14))return h.clone(h.UNIT_Y,r);if(h.equalsEpsilon(e,i,D.EPSILON14))return h.clone(h.UNIT_Z,r);o=h.subtract(n,t,rde),s=h.subtract(i,t,ode),a=h.subtract(e,t,sde),c=h.dot(o,o),u=h.dot(o,s),f=h.dot(o,a),d=h.dot(s,s),p=h.dot(s,a)}else{if(U.equalsEpsilon(e,t,D.EPSILON14))return h.clone(h.UNIT_X,r);if(U.equalsEpsilon(e,n,D.EPSILON14))return h.clone(h.UNIT_Y,r);if(U.equalsEpsilon(e,i,D.EPSILON14))return h.clone(h.UNIT_Z,r);o=U.subtract(n,t,rde),s=U.subtract(i,t,ode),a=U.subtract(e,t,sde),c=U.dot(o,o),u=U.dot(o,s),f=U.dot(o,a),d=U.dot(s,s),p=U.dot(s,a)}r.y=d*f-u*p,r.z=c*p-u*f;let g=c*d-u*u;if(g!==0)return r.y/=g,r.z/=g,r.x=1-r.y-r.z,r}var dx=D4e;function Mp(){this.high=h.clone(h.ZERO),this.low=h.clone(h.ZERO)}Mp.encode=function(e,t){l(t)||(t={high:0,low:0});let n;return e>=0?(n=Math.floor(e/65536)*65536,t.high=n,t.low=e-n):(n=Math.floor(-e/65536)*65536,t.high=-n,t.low=e+n),t};var ug={high:0,low:0};Mp.fromCartesian=function(e,t){l(t)||(t=new Mp);let n=t.high,i=t.low;return Mp.encode(e.x,ug),n.x=ug.high,i.x=ug.low,Mp.encode(e.y,ug),n.y=ug.high,i.y=ug.low,Mp.encode(e.z,ug),n.z=ug.high,i.z=ug.low,t};var hX=new Mp;Mp.writeElements=function(e,t,n){Mp.fromCartesian(e,hX);let i=hX.high,r=hX.low;t[n]=i.x,t[n+1]=i.y,t[n+2]=i.z,t[n+3]=r.x,t[n+4]=r.y,t[n+5]=r.z};var Sn=Mp;var mX={};mX.computeDiscriminant=function(e,t,n){return t*t-4*e*n};function ade(e,t,n){let i=e+t;return D.sign(e)!==D.sign(t)&&Math.abs(i/Math.max(Math.abs(e),Math.abs(t)))<n?0:i}mX.computeRealRoots=function(e,t,n){let i;if(e===0)return t===0?[]:[-n/t];if(t===0){if(n===0)return[0,0];let c=Math.abs(n),u=Math.abs(e);if(c<u&&c/u<D.EPSILON14)return[0,0];if(c>u&&u/c<D.EPSILON14)return[];if(i=-n/e,i<0)return[];let f=Math.sqrt(i);return[-f,f]}else if(n===0)return i=-t/e,i<0?[i,0]:[0,i];let r=t*t,o=4*e*n,s=ade(r,-o,D.EPSILON14);if(s<0)return[];let a=-.5*ade(t,D.sign(t)*Math.sqrt(s),D.EPSILON14);return t>0?[a/e,n/a]:[n/a,a/e]};var Ul=mX;var gX={};gX.computeDiscriminant=function(e,t,n,i){let r=e*e,o=t*t,s=n*n,a=i*i;return 18*e*t*n*i+o*s-27*r*a-4*(e*s*n+o*t*i)};function pX(e,t,n,i){let r=e,o=t/3,s=n/3,a=i,c=r*s,u=o*a,f=o*o,d=s*s,p=r*s-f,g=r*a-o*s,m=o*a-d,y=4*p*m-g*g,A,b;if(y<0){let G,q,Q;f*u>=c*d?(G=r,q=p,Q=-2*o*p+r*g):(G=a,q=m,Q=-a*g+2*s*m);let J=-(Q<0?-1:1)*Math.abs(G)*Math.sqrt(-y);b=-Q+J;let Z=b/2,ae=Z<0?-Math.pow(-Z,1/3):Math.pow(Z,1/3),Ae=b===J?-ae:-q/ae;return A=q<=0?ae+Ae:-Q/(ae*ae+Ae*Ae+q),f*u>=c*d?[(A-o)/r]:[-a/(A+s)]}let x=p,T=-2*o*p+r*g,E=m,v=-a*g+2*s*m,S=Math.sqrt(y),I=Math.sqrt(3)/2,R=Math.abs(Math.atan2(r*S,-T)/3);A=2*Math.sqrt(-x);let O=Math.cos(R);b=A*O;let L=A*(-O/2-I*Math.sin(R)),_=b+L>2*o?b-o:L-o,C=r,w=_/C;R=Math.abs(Math.atan2(a*S,-v)/3),A=2*Math.sqrt(-E),O=Math.cos(R),b=A*O,L=A*(-O/2-I*Math.sin(R));let P=-a,M=b+L<2*s?b+s:L+s,F=P/M,V=C*M,B=-_*M-C*P,j=_*P,k=(s*B-o*j)/(-o*B+s*V);return w<=k?w<=F?k<=F?[w,k,F]:[w,F,k]:[F,w,k]:w<=F?[k,w,F]:k<=F?[k,F,w]:[F,k,w]}gX.computeRealRoots=function(e,t,n,i){let r,o;if(e===0)return Ul.computeRealRoots(t,n,i);if(t===0){if(n===0){if(i===0)return[0,0,0];o=-i/e;let s=o<0?-Math.pow(-o,1/3):Math.pow(o,1/3);return[s,s,s]}else if(i===0)return r=Ul.computeRealRoots(e,0,n),r.Length===0?[0]:[r[0],0,r[1]];return pX(e,0,n,i)}else{if(n===0)return i===0?(o=-t/e,o<0?[o,0,0]:[0,0,o]):pX(e,t,0,i);if(i===0)return r=Ul.computeRealRoots(e,t,n),r.length===0?[0]:r[1]<=0?[r[0],r[1],0]:r[0]>=0?[0,r[0],r[1]]:[r[0],0,r[1]]}return pX(e,t,n,i)};var hx=gX;var _X={};_X.computeDiscriminant=function(e,t,n,i,r){let o=e*e,s=o*e,a=t*t,c=a*t,u=n*n,f=u*n,d=i*i,p=d*i,g=r*r,m=g*r;return a*u*d-4*c*p-4*e*f*d+18*e*t*n*p-27*o*d*d+256*s*m+r*(18*c*n*i-4*a*f+16*e*u*u-80*e*t*u*i-6*e*a*d+144*o*n*d)+g*(144*e*a*n-27*a*a-128*o*u-192*o*t*i)};function jh(e,t,n,i){let r=e*e,o=t-3*r/8,s=n-t*e/2+r*e/8,a=i-n*e/4+t*r/16-3*r*r/256,c=hx.computeRealRoots(1,2*o,o*o-4*a,-s*s);if(c.length>0){let u=-e/4,f=c[c.length-1];if(Math.abs(f)<D.EPSILON14){let d=Ul.computeRealRoots(1,o,a);if(d.length===2){let p=d[0],g=d[1],m;if(p>=0&&g>=0){let y=Math.sqrt(p),A=Math.sqrt(g);return[u-A,u-y,u+y,u+A]}else{if(p>=0&&g<0)return m=Math.sqrt(p),[u-m,u+m];if(p<0&&g>=0)return m=Math.sqrt(g),[u-m,u+m]}}return[]}else if(f>0){let d=Math.sqrt(f),p=(o+f-s/d)/2,g=(o+f+s/d)/2,m=Ul.computeRealRoots(1,d,p),y=Ul.computeRealRoots(1,-d,g);return m.length!==0?(m[0]+=u,m[1]+=u,y.length!==0?(y[0]+=u,y[1]+=u,m[1]<=y[0]?[m[0],m[1],y[0],y[1]]:y[1]<=m[0]?[y[0],y[1],m[0],m[1]]:m[0]>=y[0]&&m[1]<=y[1]?[y[0],m[0],m[1],y[1]]:y[0]>=m[0]&&y[1]<=m[1]?[m[0],y[0],y[1],m[1]]:m[0]>y[0]&&m[0]<y[1]?[y[0],m[0],y[1],m[1]]:[m[0],y[0],m[1],y[1]]):m):y.length!==0?(y[0]+=u,y[1]+=u,y):[]}}return[]}function ID(e,t,n,i){let r=n*n,o=t*t,s=e*e,a=-2*t,c=n*e+o-4*i,u=s*i-n*t*e+r,f=hx.computeRealRoots(1,a,c,u);if(f.length>0){let d=f[0],p=t-d,g=p*p,m=e/2,y=p/2,A=g-4*i,b=g+4*Math.abs(i),x=s-4*d,T=s+4*Math.abs(d),E,v;if(d<0||A*T<x*b){let C=Math.sqrt(x);E=C/2,v=C===0?0:(e*y-n)/C}else{let C=Math.sqrt(A);E=C===0?0:(e*y-n)/C,v=C/2}let S,I;m===0&&E===0?(S=0,I=0):D.sign(m)===D.sign(E)?(S=m+E,I=d/S):(I=m-E,S=d/I);let R,O;y===0&&v===0?(R=0,O=0):D.sign(y)===D.sign(v)?(R=y+v,O=i/R):(O=y-v,R=i/O);let L=Ul.computeRealRoots(1,S,R),_=Ul.computeRealRoots(1,I,O);if(L.length!==0)return _.length!==0?L[1]<=_[0]?[L[0],L[1],_[0],_[1]]:_[1]<=L[0]?[_[0],_[1],L[0],L[1]]:L[0]>=_[0]&&L[1]<=_[1]?[_[0],L[0],L[1],_[1]]:_[0]>=L[0]&&_[1]<=L[1]?[L[0],_[0],_[1],L[1]]:L[0]>_[0]&&L[0]<_[1]?[_[0],L[0],_[1],L[1]]:[L[0],_[0],L[1],_[1]]:L;if(_.length!==0)return _}return[]}_X.computeRealRoots=function(e,t,n,i,r){if(Math.abs(e)<D.EPSILON15)return hx.computeRealRoots(t,n,i,r);let o=t/e,s=n/e,a=i/e,c=r/e,u=o<0?1:0;switch(u+=s<0?u+1:u,u+=a<0?u+1:u,u+=c<0?u+1:u,u){case 0:return jh(o,s,a,c);case 1:return ID(o,s,a,c);case 2:return ID(o,s,a,c);case 3:return jh(o,s,a,c);case 4:return jh(o,s,a,c);case 5:return ID(o,s,a,c);case 6:return jh(o,s,a,c);case 7:return jh(o,s,a,c);case 8:return ID(o,s,a,c);case 9:return jh(o,s,a,c);case 10:return jh(o,s,a,c);case 11:return ID(o,s,a,c);case 12:return jh(o,s,a,c);case 13:return jh(o,s,a,c);case 14:return jh(o,s,a,c);case 15:return jh(o,s,a,c);default:return}};var PD=_X;var yX=class e{constructor(t,n){n=h.clone(n??h.ZERO),h.equals(n,h.ZERO)||h.normalize(n,n),this.origin=h.clone(t??h.ZERO),this.direction=n}static clone(t,n){if(l(t))return l(n)?(n.origin=h.clone(t.origin),n.direction=h.clone(t.direction),n):new e(t.origin,t.direction)}static getPoint(t,n,i){return l(i)||(i=new h),i=h.multiplyByScalar(t.direction,n,i),h.add(t.origin,i,i)}},pn=yX;var io={};io.rayPlane=function(e,t,n){l(n)||(n=new h);let i=e.origin,r=e.direction,o=t.normal,s=h.dot(o,r);if(Math.abs(s)<D.EPSILON15)return;let a=(-t.distance-h.dot(o,i))/s;if(!(a<0))return n=h.multiplyByScalar(r,a,n),h.add(i,n,n)};var R4e=new h,O4e=new h,pde=new h,cde=new h,lde=new h;io.rayTriangleParametric=function(e,t,n,i,r){r=r??!1;let o=e.origin,s=e.direction,a=h.subtract(n,t,R4e),c=h.subtract(i,t,O4e),u=h.cross(s,c,pde),f=h.dot(a,u),d,p,g,m,y;if(r){if(f<D.EPSILON6||(d=h.subtract(o,t,cde),g=h.dot(d,u),g<0||g>f)||(p=h.cross(d,a,lde),m=h.dot(s,p),m<0||g+m>f))return;y=h.dot(c,p)/f}else{if(Math.abs(f)<D.EPSILON6)return;let A=1/f;if(d=h.subtract(o,t,cde),g=h.dot(d,u)*A,g<0||g>1||(p=h.cross(d,a,lde),m=h.dot(s,p)*A,m<0||g+m>1))return;y=h.dot(c,p)*A}return y};io.rayTriangle=function(e,t,n,i,r,o){let s=io.rayTriangleParametric(e,t,n,i,r);if(!(!l(s)||s<0))return l(o)||(o=new h),h.multiplyByScalar(e.direction,s,o),h.add(e.origin,o,o)};var M4e=new pn;io.lineSegmentTriangle=function(e,t,n,i,r,o,s){let a=M4e;h.clone(e,a.origin),h.subtract(t,e,a.direction),h.normalize(a.direction,a.direction);let c=io.rayTriangleParametric(a,n,i,r,o);if(!(!l(c)||c<0||c>h.distance(e,t)))return l(s)||(s=new h),h.multiplyByScalar(a.direction,c,s),h.add(a.origin,s,s)};function N4e(e,t,n,i){let r=t*t-4*e*n;if(r<0)return;if(r>0){let s=1/(2*e),a=Math.sqrt(r),c=(-t+a)*s,u=(-t-a)*s;return c<u?(i.root0=c,i.root1=u):(i.root0=u,i.root1=c),i}let o=-t/(2*e);if(o!==0)return i.root0=i.root1=o,i}var L4e={root0:0,root1:0};function gde(e,t,n){l(n)||(n=new Us);let i=e.origin,r=e.direction,o=t.center,s=t.radius*t.radius,a=h.subtract(i,o,pde),c=h.dot(r,r),u=2*h.dot(r,a),f=h.magnitudeSquared(a)-s,d=N4e(c,u,f,L4e);if(l(d))return n.start=d.root0,n.stop=d.root1,n}io.raySphere=function(e,t,n){if(n=gde(e,t,n),!(!l(n)||n.stop<0))return n.start=Math.max(n.start,0),n};var F4e=new pn;io.lineSegmentSphere=function(e,t,n,i){let r=F4e;h.clone(e,r.origin);let o=h.subtract(t,e,r.direction),s=h.magnitude(o);if(h.normalize(o,o),i=gde(r,n,i),!(!l(i)||i.stop<0||i.start>s))return i.start=Math.max(i.start,0),i.stop=Math.min(i.stop,s),i};var B4e=new h,k4e=new h;io.rayEllipsoid=function(e,t){let n=t.oneOverRadii,i=h.multiplyComponents(n,e.origin,B4e),r=h.multiplyComponents(n,e.direction,k4e),o=h.magnitudeSquared(i),s=h.dot(i,r),a,c,u,f,d;if(o>1){if(s>=0)return;let p=s*s;if(a=o-1,c=h.magnitudeSquared(r),u=c*a,p<u)return;if(p>u){f=s*s-u,d=-s+Math.sqrt(f);let m=d/c,y=a/d;return m<y?new Us(m,y):{start:y,stop:m}}let g=Math.sqrt(a/c);return new Us(g,g)}else if(o<1)return a=o-1,c=h.magnitudeSquared(r),u=c*a,f=s*s-u,d=-s+Math.sqrt(f),new Us(0,d/c);if(s<0)return c=h.magnitudeSquared(r),new Us(0,-s/c)};var U4e=new Us,z4e=new Us,V4e=new Us;io.rayAxisAlignedBoundingBox=function(e,t,n){l(n)||(n=new Us);let i=AX(e.origin.x,e.direction.x,t.minimum.x,t.maximum.x,U4e),r=AX(e.origin.y,e.direction.y,t.minimum.y,t.maximum.y,z4e),o=AX(e.origin.z,e.direction.z,t.minimum.z,t.maximum.z,V4e);if(n.start=i.start>r.start?i.start:r.start,n.stop=i.stop<r.stop?i.stop:r.stop,!(i.start>r.stop||r.start>i.stop)&&!(n.start>o.stop||o.start>n.stop))return o.start>n.start&&(n.start=o.start),o.stop<n.stop&&(n.stop=o.stop),n};function AX(e,t,n,i,r){if(r.start=(n-e)/t,r.stop=(i-e)/t,r.stop<r.start){let o=r.stop;r.stop=r.start,r.start=o}return r}function mx(e,t,n){let i=e+t;return D.sign(e)!==D.sign(t)&&Math.abs(i/Math.max(Math.abs(e),Math.abs(t)))<n?0:i}io.quadraticVectorExpression=function(e,t,n,i,r){let o=i*i,s=r*r,a=(e[$.COLUMN1ROW1]-e[$.COLUMN2ROW2])*s,c=r*(i*mx(e[$.COLUMN1ROW0],e[$.COLUMN0ROW1],D.EPSILON15)+t.y),u=e[$.COLUMN0ROW0]*o+e[$.COLUMN2ROW2]*s+i*t.x+n,f=s*mx(e[$.COLUMN2ROW1],e[$.COLUMN1ROW2],D.EPSILON15),d=r*(i*mx(e[$.COLUMN2ROW0],e[$.COLUMN0ROW2])+t.z),p,g=[];if(d===0&&f===0){if(p=Ul.computeRealRoots(a,c,u),p.length===0)return g;let R=p[0],O=Math.sqrt(Math.max(1-R*R,0));if(g.push(new h(i,r*R,r*-O)),g.push(new h(i,r*R,r*O)),p.length===2){let L=p[1],_=Math.sqrt(Math.max(1-L*L,0));g.push(new h(i,r*L,r*-_)),g.push(new h(i,r*L,r*_))}return g}let m=d*d,y=f*f,A=a*a,b=d*f,x=A+y,T=2*(c*a+b),E=2*u*a+c*c-y+m,v=2*(u*c-b),S=u*u-m;if(x===0&&T===0&&E===0&&v===0)return g;p=PD.computeRealRoots(x,T,E,v,S);let I=p.length;if(I===0)return g;for(let R=0;R<I;++R){let O=p[R],L=O*O,_=Math.max(1-L,0),C=Math.sqrt(_),w;D.sign(a)===D.sign(u)?w=mx(a*L+u,c*O,D.EPSILON12):D.sign(u)===D.sign(c*O)?w=mx(a*L,c*O+u,D.EPSILON12):w=mx(a*L+c*O,u,D.EPSILON12);let P=mx(f*O,d,D.EPSILON15),M=w*P;M<0?g.push(new h(i,r*O,r*C)):M>0?g.push(new h(i,r*O,r*-C)):C!==0?(g.push(new h(i,r*O,r*-C)),g.push(new h(i,r*O,r*C)),++R):g.push(new h(i,r*O,r*C))}return g};var bX=new h,ude=new h,fde=new h,o6=new h,j4e=new h,H4e=new $,G4e=new $,W4e=new $,q4e=new $,Y4e=new $,dde=new $,hde=new $,mde=new h,X4e=new h,K4e=new he;io.grazingAltitudeLocation=function(e,t){let n=e.origin,i=e.direction;if(!h.equals(n,h.ZERO)){let S=t.geodeticSurfaceNormal(n,bX);if(h.dot(i,S)>=0)return n}let r=l(this.rayEllipsoid(e,t)),o=t.transformPositionToScaledSpace(i,bX),s=h.normalize(o,o),a=h.mostOrthogonalAxis(o,o6),c=h.normalize(h.cross(a,s,ude),ude),u=h.normalize(h.cross(s,c,fde),fde),f=H4e;f[0]=s.x,f[1]=s.y,f[2]=s.z,f[3]=c.x,f[4]=c.y,f[5]=c.z,f[6]=u.x,f[7]=u.y,f[8]=u.z;let d=$.transpose(f,G4e),p=$.fromScale(t.radii,W4e),g=$.fromScale(t.oneOverRadii,q4e),m=Y4e;m[0]=0,m[1]=-i.z,m[2]=i.y,m[3]=i.z,m[4]=0,m[5]=-i.x,m[6]=-i.y,m[7]=i.x,m[8]=0;let y=$.multiply($.multiply(d,g,dde),m,dde),A=$.multiply($.multiply(y,p,hde),f,hde),b=$.multiplyByVector(y,n,j4e),x=io.quadraticVectorExpression(A,h.negate(b,bX),0,0,1),T,E,v=x.length;if(v>0){let S=h.clone(h.ZERO,X4e),I=Number.NEGATIVE_INFINITY;for(let O=0;O<v;++O){T=$.multiplyByVector(p,$.multiplyByVector(f,x[O],mde),mde);let L=h.normalize(h.subtract(T,n,o6),o6),_=h.dot(L,i);_>I&&(I=_,S=h.clone(T,S))}let R=t.cartesianToCartographic(S,K4e);return I=D.clamp(I,0,1),E=h.magnitude(h.subtract(S,n,o6))*Math.sqrt(1-I*I),E=r?-E:E,R.height=E,t.cartographicToCartesian(R,new h)}};var $4e=new h;io.lineSegmentPlane=function(e,t,n,i){l(i)||(i=new h);let r=h.subtract(t,e,$4e),o=n.normal,s=h.dot(o,r);if(Math.abs(s)<D.EPSILON6)return;let a=h.dot(o,e),c=-(n.distance+a)/s;if(!(c<0||c>1))return h.multiplyByScalar(r,c,i),h.add(e,i,i),i};io.trianglePlaneIntersection=function(e,t,n,i){let r=i.normal,o=i.distance,s=h.dot(r,e)+o<0,a=h.dot(r,t)+o<0,c=h.dot(r,n)+o<0,u=0;u+=s?1:0,u+=a?1:0,u+=c?1:0;let f,d;if((u===1||u===2)&&(f=new h,d=new h),u===1){if(s)return io.lineSegmentPlane(e,t,i,f),io.lineSegmentPlane(e,n,i,d),{positions:[e,t,n,f,d],indices:[0,3,4,1,2,4,1,4,3]};if(a)return io.lineSegmentPlane(t,n,i,f),io.lineSegmentPlane(t,e,i,d),{positions:[e,t,n,f,d],indices:[1,3,4,2,0,4,2,4,3]};if(c)return io.lineSegmentPlane(n,e,i,f),io.lineSegmentPlane(n,t,i,d),{positions:[e,t,n,f,d],indices:[2,3,4,0,1,4,0,4,3]}}else if(u===2)if(s)if(a){if(!c)return io.lineSegmentPlane(e,n,i,f),io.lineSegmentPlane(t,n,i,d),{positions:[e,t,n,f,d],indices:[0,1,4,0,4,3,2,3,4]}}else return io.lineSegmentPlane(n,t,i,f),io.lineSegmentPlane(e,t,i,d),{positions:[e,t,n,f,d],indices:[2,0,4,2,4,3,1,3,4]};else return io.lineSegmentPlane(t,e,i,f),io.lineSegmentPlane(n,e,i,d),{positions:[e,t,n,f,d],indices:[1,2,4,1,4,3,0,3,4]}};var _i=io;function Na(e,t){this.normal=h.clone(e),this.distance=t}Na.fromPointNormal=function(e,t,n){let i=-h.dot(t,e);return l(n)?(h.clone(t,n.normal),n.distance=i,n):new Na(t,i)};var J4e=new h;Na.fromCartesian4=function(e,t){let n=h.fromCartesian4(e,J4e),i=e.w;return l(t)?(h.clone(n,t.normal),t.distance=i,t):new Na(n,i)};Na.getPointDistance=function(e,t){return h.dot(e.normal,t)+e.distance};var Z4e=new h;Na.projectPointOntoPlane=function(e,t,n){l(n)||(n=new h);let i=Na.getPointDistance(e,t),r=h.multiplyByScalar(e.normal,i,Z4e);return h.subtract(t,r,n)};var Q4e=new N,e8e=new se,t8e=new h;Na.transform=function(e,t,n){let i=e.normal,r=e.distance,o=N.inverseTranspose(t,Q4e),s=se.fromElements(i.x,i.y,i.z,r,e8e);s=N.multiplyByVector(o,s,s);let a=h.fromCartesian4(s,t8e);return s=se.divideByScalar(s,h.magnitude(a),s),Na.fromCartesian4(s,n)};Na.clone=function(e,t){return l(t)?(h.clone(e.normal,t.normal),t.distance=e.distance,t):new Na(e.normal,e.distance)};Na.equals=function(e,t){return e.distance===t.distance&&h.equals(e.normal,t.normal)};Na.ORIGIN_XY_PLANE=Object.freeze(new Na(h.UNIT_Z,0));Na.ORIGIN_YZ_PLANE=Object.freeze(new Na(h.UNIT_X,0));Na.ORIGIN_ZX_PLANE=Object.freeze(new Na(h.UNIT_Y,0));var sn=Na;var xX={};xX.calculateACMR=function(e){e=e??H.EMPTY_OBJECT;let t=e.indices,n=e.maximumIndex,i=e.cacheSize??24,r=t.length;if(!l(n)){n=0;let a=0,c=t[a];for(;a<r;)c>n&&(n=c),++a,c=t[a]}let o=[];for(let a=0;a<n+1;a++)o[a]=0;let s=i+1;for(let a=0;a<r;++a)s-o[t[a]]>i&&(o[t[a]]=s,++s);return(s-i+1)/(r/3)};xX.tipsify=function(e){e=e??H.EMPTY_OBJECT;let t=e.indices,n=e.maximumIndex,i=e.cacheSize??24,r;function o(_,C,w,P){for(;C.length>=1;){let M=C[C.length-1];if(C.splice(C.length-1,1),_[M].numLiveTriangles>0)return M}for(;r<P;){if(_[r].numLiveTriangles>0)return++r,r-1;++r}return-1}function s(_,C,w,P,M,F,V){let B=-1,j,k=-1,G=0;for(;G<w.length;){let q=w[G];P[q].numLiveTriangles&&(j=0,M-P[q].timeStamp+2*P[q].numLiveTriangles<=C&&(j=M-P[q].timeStamp),(j>k||k===-1)&&(k=j,B=q)),++G}return B===-1?o(P,F,_,V):B}let a=t.length,c=0,u=0,f=t[u],d=a;if(l(n))c=n+1;else{for(;u<d;)f>c&&(c=f),++u,f=t[u];if(c===-1)return 0;++c}let p=[],g;for(g=0;g<c;g++)p[g]={numLiveTriangles:0,timeStamp:0,vertexTriangles:[]};u=0;let m=0;for(;u<d;)p[t[u]].vertexTriangles.push(m),++p[t[u]].numLiveTriangles,p[t[u+1]].vertexTriangles.push(m),++p[t[u+1]].numLiveTriangles,p[t[u+2]].vertexTriangles.push(m),++p[t[u+2]].numLiveTriangles,++m,u+=3;let y=0,A=i+1;r=1;let b,x=[],T,E,v=0,S=[],I=a/3,R=[];for(g=0;g<I;g++)R[g]=!1;let O,L;for(;y!==-1;){b=[],E=p[y],L=E.vertexTriangles.length;for(let _=0;_<L;++_)if(m=E.vertexTriangles[_],!R[m]){R[m]=!0,u=m+m+m;for(let C=0;C<3;++C)O=t[u],b.push(O),x.push(O),S[v]=O,++v,T=p[O],--T.numLiveTriangles,A-T.timeStamp>i&&(T.timeStamp=A,++A),++u}y=s(t,i,b,p,A,x,c)}return S};var DD=xX;var zl={};function d6(e,t,n,i,r){e[t++]=n,e[t++]=i,e[t++]=i,e[t++]=r,e[t++]=r,e[t]=n}function n8e(e){let t=e.length,n=t/3*6,i=je.createTypedArray(t,n),r=0;for(let o=0;o<t;o+=3,r+=6)d6(i,r,e[o],e[o+1],e[o+2]);return i}function i8e(e){let t=e.length;if(t>=3){let n=(t-2)*6,i=je.createTypedArray(t,n);d6(i,0,e[0],e[1],e[2]);let r=6;for(let o=3;o<t;++o,r+=6)d6(i,r,e[o-1],e[o],e[o-2]);return i}return new Uint16Array}function r8e(e){if(e.length>0){let t=e.length-1,n=(t-1)*6,i=je.createTypedArray(t,n),r=e[0],o=0;for(let s=1;s<t;++s,o+=6)d6(i,o,r,e[s],e[s+1]);return i}return new Uint16Array}zl.toWireframe=function(e){let t=e.indices;if(l(t)){switch(e.primitiveType){case Oe.TRIANGLES:e.indices=n8e(t);break;case Oe.TRIANGLE_STRIP:e.indices=i8e(t);break;case Oe.TRIANGLE_FAN:e.indices=r8e(t);break}e.primitiveType=Oe.LINES}return e};zl.createLineSegmentsForVectors=function(e,t,n){t=t??"normal",n=n??1e4;let i=e.attributes.position.values,r=e.attributes[t].values,o=i.length,s=new Float64Array(2*o),a=0;for(let f=0;f<o;f+=3)s[a++]=i[f],s[a++]=i[f+1],s[a++]=i[f+2],s[a++]=i[f]+r[f]*n,s[a++]=i[f+1]+r[f+1]*n,s[a++]=i[f+2]+r[f+2]*n;let c,u=e.boundingSphere;return l(u)&&(c=new ue(u.center,u.radius+n)),new St({attributes:{position:new Ne({componentDatatype:Y.DOUBLE,componentsPerAttribute:3,values:s})},primitiveType:Oe.LINES,boundingSphere:c})};zl.createAttributeLocations=function(e){let t=["position","positionHigh","positionLow","position3DHigh","position3DLow","position2DHigh","position2DLow","pickColor","normal","st","tangent","bitangent","extrudeDirection","compressedAttributes"],n=e.attributes,i={},r=0,o,s=t.length;for(o=0;o<s;++o){let a=t[o];l(n[a])&&(i[a]=r++)}for(let a in n)n.hasOwnProperty(a)&&!l(i[a])&&(i[a]=r++);return i};zl.reorderForPreVertexCache=function(e){let t=St.computeNumberOfVertices(e),n=e.indices;if(l(n)){let i=new Int32Array(t);for(let p=0;p<t;p++)i[p]=-1;let r=n,o=r.length,s=je.createTypedArray(t,o),a=0,c=0,u=0,f;for(;a<o;)f=i[r[a]],f!==-1?s[c]=f:(f=r[a],i[f]=u,s[c]=u,++u),++a,++c;e.indices=s;let d=e.attributes;for(let p in d)if(d.hasOwnProperty(p)&&l(d[p])&&l(d[p].values)){let g=d[p],m=g.values,y=0,A=g.componentsPerAttribute,b=Y.createTypedArray(g.componentDatatype,u*A);for(;y<t;){let x=i[y];if(x!==-1)for(let T=0;T<A;T++)b[A*x+T]=m[A*y+T];++y}g.values=b}}return e};zl.reorderForPostVertexCache=function(e,t){let n=e.indices;if(e.primitiveType===Oe.TRIANGLES&&l(n)){let i=n.length,r=0;for(let o=0;o<i;o++)n[o]>r&&(r=n[o]);e.indices=DD.tipsify({indices:n,maximumIndex:r,cacheSize:t})}return e};function _de(e){let t={};for(let n in e)if(e.hasOwnProperty(n)&&l(e[n])&&l(e[n].values)){let i=e[n];t[n]=new Ne({componentDatatype:i.componentDatatype,componentsPerAttribute:i.componentsPerAttribute,normalize:i.normalize,values:[]})}return t}function o8e(e,t,n){for(let i in t)if(t.hasOwnProperty(i)&&l(t[i])&&l(t[i].values)){let r=t[i];for(let o=0;o<r.componentsPerAttribute;++o)e[i].values.push(r.values[n*r.componentsPerAttribute+o])}}zl.fitToUnsignedShortIndices=function(e){let t=[],n=St.computeNumberOfVertices(e);if(l(e.indices)&&n>=D.SIXTY_FOUR_KILOBYTES){let i=[],r=[],o=0,s=_de(e.attributes),a=e.indices,c=a.length,u;e.primitiveType===Oe.TRIANGLES?u=3:e.primitiveType===Oe.LINES?u=2:e.primitiveType===Oe.POINTS&&(u=1);for(let f=0;f<c;f+=u){for(let d=0;d<u;++d){let p=a[f+d],g=i[p];l(g)||(g=o++,i[p]=g,o8e(s,e.attributes,p)),r.push(g)}o+u>=D.SIXTY_FOUR_KILOBYTES&&(t.push(new St({attributes:s,indices:r,primitiveType:e.primitiveType,boundingSphere:e.boundingSphere,boundingSphereCV:e.boundingSphereCV})),i=[],r=[],o=0,s=_de(e.attributes))}r.length!==0&&t.push(new St({attributes:s,indices:r,primitiveType:e.primitiveType,boundingSphere:e.boundingSphere,boundingSphereCV:e.boundingSphereCV}))}else t.push(e);return t};var yde=new h,s8e=new he;zl.projectTo2D=function(e,t,n,i,r){let o=e.attributes[t];r=l(r)?r:new Ui;let s=r.ellipsoid,a=o.values,c=new Float64Array(a.length),u=0;for(let f=0;f<a.length;f+=3){let d=h.fromArray(a,f,yde),p=s.cartesianToCartographic(d,s8e),g=r.project(p,yde);c[u++]=g.x,c[u++]=g.y,c[u++]=g.z}return e.attributes[n]=o,e.attributes[i]=new Ne({componentDatatype:Y.DOUBLE,componentsPerAttribute:3,values:c}),delete e.attributes[t],e};var TX={high:0,low:0};zl.encodeAttribute=function(e,t,n,i){let r=e.attributes[t],o=r.values,s=o.length,a=new Float32Array(s),c=new Float32Array(s);for(let f=0;f<s;++f)Sn.encode(o[f],TX),a[f]=TX.high,c[f]=TX.low;let u=r.componentsPerAttribute;return e.attributes[n]=new Ne({componentDatatype:Y.FLOAT,componentsPerAttribute:u,values:a}),e.attributes[i]=new Ne({componentDatatype:Y.FLOAT,componentsPerAttribute:u,values:c}),delete e.attributes[t],e};var Gh=new h;function EX(e,t){if(l(t)){let n=t.values,i=n.length;for(let r=0;r<i;r+=3)h.unpack(n,r,Gh),N.multiplyByPoint(e,Gh,Gh),h.pack(Gh,n,r)}}function CX(e,t){if(l(t)){let n=t.values,i=n.length;for(let r=0;r<i;r+=3)h.unpack(n,r,Gh),$.multiplyByVector(e,Gh,Gh),Gh=h.normalize(Gh,Gh),h.pack(Gh,n,r)}}var s6=new N,a6=new $;zl.transformToWorldCoordinates=function(e){let t=e.modelMatrix;if(N.equals(t,N.IDENTITY))return e;let n=e.geometry.attributes;EX(t,n.position),EX(t,n.prevPosition),EX(t,n.nextPosition),(l(n.normal)||l(n.tangent)||l(n.bitangent))&&(N.inverse(t,s6),N.transpose(s6,s6),N.getMatrix3(s6,a6),CX(a6,n.normal),CX(a6,n.tangent),CX(a6,n.bitangent));let i=e.geometry.boundingSphere;return l(i)&&(e.geometry.boundingSphere=ue.transform(i,t,i)),e.modelMatrix=N.clone(N.IDENTITY),e};function a8e(e,t){let n=e.length,i={},r=e[0][t].attributes,o;for(o in r)if(r.hasOwnProperty(o)&&l(r[o])&&l(r[o].values)){let s=r[o],a=s.values.length,c=!0;for(let u=1;u<n;++u){let f=e[u][t].attributes[o];if(!l(f)||s.componentDatatype!==f.componentDatatype||s.componentsPerAttribute!==f.componentsPerAttribute||s.normalize!==f.normalize){c=!1;break}a+=f.values.length}c&&(i[o]=new Ne({componentDatatype:s.componentDatatype,componentsPerAttribute:s.componentsPerAttribute,normalize:s.normalize,values:Y.createTypedArray(s.componentDatatype,a)}))}return i}var c8e=new h;function vX(e,t){let n=e.length,i,r,o,s,a=e[0].modelMatrix,c=l(e[0][t].indices),u=e[0][t].primitiveType,f=a8e(e,t),d,p,g;for(i in f)if(f.hasOwnProperty(i))for(d=f[i].values,s=0,r=0;r<n;++r)for(p=e[r][t].attributes[i].values,g=p.length,o=0;o<g;++o)d[s++]=p[o];let m;if(c){let x=0;for(r=0;r<n;++r)x+=e[r][t].indices.length;let T=St.computeNumberOfVertices(new St({attributes:f,primitiveType:Oe.POINTS})),E=je.createTypedArray(T,x),v=0,S=0;for(r=0;r<n;++r){let I=e[r][t].indices,R=I.length;for(s=0;s<R;++s)E[v++]=S+I[s];S+=St.computeNumberOfVertices(e[r][t])}m=E}let y=new h,A=0,b;for(r=0;r<n;++r){if(b=e[r][t].boundingSphere,!l(b)){y=void 0;break}h.add(b.center,y,y)}if(l(y))for(h.divideByScalar(y,n,y),r=0;r<n;++r){b=e[r][t].boundingSphere;let x=h.magnitude(h.subtract(b.center,y,c8e))+b.radius;x>A&&(A=x)}return new St({attributes:f,indices:m,primitiveType:u,boundingSphere:l(y)?new ue(y,A):void 0})}zl.combineInstances=function(e){let t=[],n=[],i=e.length;for(let o=0;o<i;++o){let s=e[o];l(s.geometry)?t.push(s):l(s.westHemisphereGeometry)&&l(s.eastHemisphereGeometry)&&n.push(s)}let r=[];return t.length>0&&r.push(vX(t,"geometry")),n.length>0&&(r.push(vX(n,"westHemisphereGeometry")),r.push(vX(n,"eastHemisphereGeometry"))),r};var wd=new h,RD=new h,yv=new h,Av=new h;zl.computeNormal=function(e){let t=e.indices,n=e.attributes,i=n.position.values,r=n.position.values.length/3,o=t.length,s=new Array(r),a=new Array(o/3),c=new Array(o),u;for(u=0;u<r;u++)s[u]={indexOffset:0,count:0,currentCount:0};let f=0;for(u=0;u<o;u+=3){let m=t[u],y=t[u+1],A=t[u+2],b=m*3,x=y*3,T=A*3;RD.x=i[b],RD.y=i[b+1],RD.z=i[b+2],yv.x=i[x],yv.y=i[x+1],yv.z=i[x+2],Av.x=i[T],Av.y=i[T+1],Av.z=i[T+2],s[m].count++,s[y].count++,s[A].count++,h.subtract(yv,RD,yv),h.subtract(Av,RD,Av),a[f]=h.cross(yv,Av,new h),f++}let d=0;for(u=0;u<r;u++)s[u].indexOffset+=d,d+=s[u].count;f=0;let p;for(u=0;u<o;u+=3){p=s[t[u]];let m=p.indexOffset+p.currentCount;c[m]=f,p.currentCount++,p=s[t[u+1]],m=p.indexOffset+p.currentCount,c[m]=f,p.currentCount++,p=s[t[u+2]],m=p.indexOffset+p.currentCount,c[m]=f,p.currentCount++,f++}let g=new Float32Array(r*3);for(u=0;u<r;u++){let m=u*3;if(p=s[u],h.clone(h.ZERO,wd),p.count>0){for(f=0;f<p.count;f++)h.add(wd,a[c[p.indexOffset+f]],wd);h.equalsEpsilon(h.ZERO,wd,D.EPSILON10)&&h.clone(a[c[p.indexOffset]],wd)}h.equalsEpsilon(h.ZERO,wd,D.EPSILON10)&&(wd.z=1),h.normalize(wd,wd),g[m]=wd.x,g[m+1]=wd.y,g[m+2]=wd.z}return e.attributes.normal=new Ne({componentDatatype:Y.FLOAT,componentsPerAttribute:3,values:g}),e};var l8e=new h,Ade=new h,u8e=new h;zl.computeTangentAndBitangent=function(e){let t=e.attributes,n=e.indices,i=e.attributes.position.values,r=e.attributes.normal.values,o=e.attributes.st.values,s=e.attributes.position.values.length/3,a=n.length,c=new Array(s*3),u;for(u=0;u<c.length;u++)c[u]=0;let f,d,p;for(u=0;u<a;u+=3){let y=n[u],A=n[u+1],b=n[u+2];f=y*3,d=A*3,p=b*3;let x=y*2,T=A*2,E=b*2,v=i[f],S=i[f+1],I=i[f+2],R=o[x],O=o[x+1],L=o[T+1]-O,_=o[E+1]-O,C=1/((o[T]-R)*_-(o[E]-R)*L),w=(_*(i[d]-v)-L*(i[p]-v))*C,P=(_*(i[d+1]-S)-L*(i[p+1]-S))*C,M=(_*(i[d+2]-I)-L*(i[p+2]-I))*C;c[f]+=w,c[f+1]+=P,c[f+2]+=M,c[d]+=w,c[d+1]+=P,c[d+2]+=M,c[p]+=w,c[p+1]+=P,c[p+2]+=M}let g=new Float32Array(s*3),m=new Float32Array(s*3);for(u=0;u<s;u++){f=u*3,d=f+1,p=f+2;let y=h.fromArray(r,f,l8e),A=h.fromArray(c,f,u8e),b=h.dot(y,A);h.multiplyByScalar(y,b,Ade),h.normalize(h.subtract(A,Ade,A),A),g[f]=A.x,g[d]=A.y,g[p]=A.z,h.normalize(h.cross(y,A,A),A),m[f]=A.x,m[d]=A.y,m[p]=A.z}return e.attributes.tangent=new Ne({componentDatatype:Y.FLOAT,componentsPerAttribute:3,values:g}),e.attributes.bitangent=new Ne({componentDatatype:Y.FLOAT,componentsPerAttribute:3,values:m}),e};var OD=new U,Hh=new h,bde=new h,xde=new h,c6=new U;zl.compressVertices=function(e){let t=e.attributes.extrudeDirection,n,i;if(l(t)){let S=t.values;i=S.length/3;let I=new Float32Array(i*2),R=0;for(n=0;n<i;++n){if(h.fromArray(S,n*3,Hh),h.equals(Hh,h.ZERO)){R+=2;continue}c6=cn.octEncodeInRange(Hh,65535,c6),I[R++]=c6.x,I[R++]=c6.y}return e.attributes.compressedAttributes=new Ne({componentDatatype:Y.FLOAT,componentsPerAttribute:2,values:I}),delete e.attributes.extrudeDirection,e}let r=e.attributes.normal,o=e.attributes.st,s=l(r),a=l(o);if(!s&&!a)return e;let c=e.attributes.tangent,u=e.attributes.bitangent,f=l(c),d=l(u),p,g,m,y;s&&(p=r.values),a&&(g=o.values),f&&(m=c.values),d&&(y=u.values),i=(s?p.length:g.length)/(s?3:2);let x=i,T=a&&s?2:1;T+=f||d?1:0,x*=T;let E=new Float32Array(x),v=0;for(n=0;n<i;++n){a&&(U.fromArray(g,n*2,OD),E[v++]=cn.compressTextureCoordinates(OD));let S=n*3;s&&l(m)&&l(y)?(h.fromArray(p,S,Hh),h.fromArray(m,S,bde),h.fromArray(y,S,xde),cn.octPack(Hh,bde,xde,OD),E[v++]=OD.x,E[v++]=OD.y):(s&&(h.fromArray(p,S,Hh),E[v++]=cn.octEncodeFloat(Hh)),f&&(h.fromArray(m,S,Hh),E[v++]=cn.octEncodeFloat(Hh)),d&&(h.fromArray(y,S,Hh),E[v++]=cn.octEncodeFloat(Hh)))}return e.attributes.compressedAttributes=new Ne({componentDatatype:Y.FLOAT,componentsPerAttribute:T,values:E}),s&&delete e.attributes.normal,a&&delete e.attributes.st,d&&delete e.attributes.bitangent,f&&delete e.attributes.tangent,e};function f8e(e){if(l(e.indices))return e;let t=St.computeNumberOfVertices(e),n=je.createTypedArray(t,t);for(let i=0;i<t;++i)n[i]=i;return e.indices=n,e}function d8e(e){let t=St.computeNumberOfVertices(e),n=je.createTypedArray(t,(t-2)*3);n[0]=1,n[1]=0,n[2]=2;let i=3;for(let r=3;r<t;++r)n[i++]=r-1,n[i++]=0,n[i++]=r;return e.indices=n,e.primitiveType=Oe.TRIANGLES,e}function h8e(e){let t=St.computeNumberOfVertices(e),n=je.createTypedArray(t,(t-2)*3);n[0]=0,n[1]=1,n[2]=2,t>3&&(n[3]=0,n[4]=2,n[5]=3);let i=6;for(let r=3;r<t-1;r+=2)n[i++]=r,n[i++]=r-1,n[i++]=r+1,r+2<t&&(n[i++]=r,n[i++]=r+1,n[i++]=r+2);return e.indices=n,e.primitiveType=Oe.TRIANGLES,e}function m8e(e){if(l(e.indices))return e;let t=St.computeNumberOfVertices(e),n=je.createTypedArray(t,t);for(let i=0;i<t;++i)n[i]=i;return e.indices=n,e}function p8e(e){let t=St.computeNumberOfVertices(e),n=je.createTypedArray(t,(t-1)*2);n[0]=0,n[1]=1;let i=2;for(let r=2;r<t;++r)n[i++]=r-1,n[i++]=r;return e.indices=n,e.primitiveType=Oe.LINES,e}function g8e(e){let t=St.computeNumberOfVertices(e),n=je.createTypedArray(t,t*2);n[0]=0,n[1]=1;let i=2;for(let r=2;r<t;++r)n[i++]=r-1,n[i++]=r;return n[i++]=t-1,n[i]=0,e.indices=n,e.primitiveType=Oe.LINES,e}function _8e(e){switch(e.primitiveType){case Oe.TRIANGLE_FAN:return d8e(e);case Oe.TRIANGLE_STRIP:return h8e(e);case Oe.TRIANGLES:return f8e(e);case Oe.LINE_STRIP:return p8e(e);case Oe.LINE_LOOP:return g8e(e);case Oe.LINES:return m8e(e)}return e}function Ly(e,t){Math.abs(e.y)<D.EPSILON6&&(t?e.y=-D.EPSILON6:e.y=D.EPSILON6)}function y8e(e,t,n){if(e.y!==0&&t.y!==0&&n.y!==0){Ly(e,e.y<0),Ly(t,t.y<0),Ly(n,n.y<0);return}let i=Math.abs(e.y),r=Math.abs(t.y),o=Math.abs(n.y),s;i>r?i>o?s=D.sign(e.y):s=D.sign(n.y):r>o?s=D.sign(t.y):s=D.sign(n.y);let a=s<0;Ly(e,a),Ly(t,a),Ly(n,a)}var Tde=new h;function Id(e,t,n,i){h.add(e,h.multiplyByScalar(h.subtract(t,e,Tde),e.y/(e.y-t.y),Tde),n),h.clone(n,i),Ly(n,!0),Ly(i,!1)}var px=new h,gx=new h,_x=new h,yx=new h,SX={positions:new Array(7),indices:new Array(9)};function A8e(e,t,n){if(e.x>=0||t.x>=0||n.x>=0)return;y8e(e,t,n);let i=e.y<0,r=t.y<0,o=n.y<0,s=0;s+=i?1:0,s+=r?1:0,s+=o?1:0;let a=SX.indices;s===1?(a[1]=3,a[2]=4,a[5]=6,a[7]=6,a[8]=5,i?(Id(e,t,px,_x),Id(e,n,gx,yx),a[0]=0,a[3]=1,a[4]=2,a[6]=1):r?(Id(t,n,px,_x),Id(t,e,gx,yx),a[0]=1,a[3]=2,a[4]=0,a[6]=2):o&&(Id(n,e,px,_x),Id(n,t,gx,yx),a[0]=2,a[3]=0,a[4]=1,a[6]=0)):s===2&&(a[2]=4,a[4]=4,a[5]=3,a[7]=5,a[8]=6,i?r?o||(Id(n,e,px,_x),Id(n,t,gx,yx),a[0]=0,a[1]=1,a[3]=0,a[6]=2):(Id(t,n,px,_x),Id(t,e,gx,yx),a[0]=2,a[1]=0,a[3]=2,a[6]=1):(Id(e,t,px,_x),Id(e,n,gx,yx),a[0]=1,a[1]=2,a[3]=1,a[6]=0));let c=SX.positions;return c[0]=e,c[1]=t,c[2]=n,c.length=3,(s===1||s===2)&&(c[3]=px,c[4]=gx,c[5]=_x,c[6]=yx,c.length=7),SX}function Ede(e,t){let n=e.attributes;if(n.position.values.length===0)return;for(let r in n)if(n.hasOwnProperty(r)&&l(n[r])&&l(n[r].values)){let o=n[r];o.values=Y.createTypedArray(o.componentDatatype,o.values)}let i=St.computeNumberOfVertices(e);return e.indices=je.createTypedArray(i,e.indices),t&&(e.boundingSphere=ue.fromVertices(n.position.values)),e}function xv(e){let t=e.attributes,n={};for(let i in t)if(t.hasOwnProperty(i)&&l(t[i])&&l(t[i].values)){let r=t[i];n[i]=new Ne({componentDatatype:r.componentDatatype,componentsPerAttribute:r.componentsPerAttribute,normalize:r.normalize,values:[]})}return new St({attributes:n,indices:[],primitiveType:e.primitiveType})}function DX(e,t,n){let i=l(e.geometry.boundingSphere);t=Ede(t,i),n=Ede(n,i),l(n)&&!l(t)?e.geometry=n:!l(n)&&l(t)?e.geometry=t:(e.westHemisphereGeometry=t,e.eastHemisphereGeometry=n,e.geometry=void 0)}function RX(e,t){let n=new e,i=new e,r=new e;return function(o,s,a,c,u,f,d,p){let g=e.fromArray(u,o*t,n),m=e.fromArray(u,s*t,i),y=e.fromArray(u,a*t,r);e.multiplyByScalar(g,c.x,g),e.multiplyByScalar(m,c.y,m),e.multiplyByScalar(y,c.z,y);let A=e.add(g,m,g);e.add(A,y,A),p&&e.normalize(A,A),e.pack(A,f,d*t)}}var b8e=RX(se,4),f6=RX(h,3),Pde=RX(U,2),x8e=function(e,t,n,i,r,o,s){let a=r[e]*i.x,c=r[t]*i.y,u=r[n]*i.z;o[s]=a+c+u>D.EPSILON6?1:0},MD=new h,wX=new h,IX=new h,T8e=new h;function l6(e,t,n,i,r,o,s,a,c,u,f,d,p,g,m,y){if(!l(o)&&!l(s)&&!l(a)&&!l(c)&&!l(u)&&g===0)return;let A=h.fromArray(r,e*3,MD),b=h.fromArray(r,t*3,wX),x=h.fromArray(r,n*3,IX),T=dx(i,A,b,x,T8e);if(l(T)){if(l(o)&&f6(e,t,n,T,o,d.normal.values,y,!0),l(u)){let E=h.fromArray(u,e*3,MD),v=h.fromArray(u,t*3,wX),S=h.fromArray(u,n*3,IX);h.multiplyByScalar(E,T.x,E),h.multiplyByScalar(v,T.y,v),h.multiplyByScalar(S,T.z,S);let I;!h.equals(E,h.ZERO)||!h.equals(v,h.ZERO)||!h.equals(S,h.ZERO)?(I=h.add(E,v,E),h.add(I,S,I),h.normalize(I,I)):(I=MD,I.x=0,I.y=0,I.z=0),h.pack(I,d.extrudeDirection.values,y*3)}if(l(f)&&x8e(e,t,n,T,f,d.applyOffset.values,y),l(s)&&f6(e,t,n,T,s,d.tangent.values,y,!0),l(a)&&f6(e,t,n,T,a,d.bitangent.values,y,!0),l(c)&&Pde(e,t,n,T,c,d.st.values,y),g>0)for(let E=0;E<g;E++){let v=p[E];E8e(e,t,n,T,y,m[v],d[v])}}}function E8e(e,t,n,i,r,o,s){let a=o.componentsPerAttribute,c=o.values,u=s.values;switch(a){case 4:b8e(e,t,n,i,c,u,r,!1);break;case 3:f6(e,t,n,i,c,u,r,!1);break;case 2:Pde(e,t,n,i,c,u,r,!1);break;default:u[r]=c[e]*i.x+c[t]*i.y+c[n]*i.z}}function Np(e,t,n,i,r,o){let s=e.position.values.length/3;if(r!==-1){let a=i[r],c=n[a];return c===-1?(n[a]=s,e.position.values.push(o.x,o.y,o.z),t.push(s),s):(t.push(c),c)}return e.position.values.push(o.x,o.y,o.z),t.push(s),s}var C8e={position:!0,normal:!0,bitangent:!0,tangent:!0,st:!0,extrudeDirection:!0,applyOffset:!0};function Cde(e){let t=e.geometry,n=t.attributes,i=n.position.values,r=l(n.normal)?n.normal.values:void 0,o=l(n.bitangent)?n.bitangent.values:void 0,s=l(n.tangent)?n.tangent.values:void 0,a=l(n.st)?n.st.values:void 0,c=l(n.extrudeDirection)?n.extrudeDirection.values:void 0,u=l(n.applyOffset)?n.applyOffset.values:void 0,f=t.indices,d=[];for(let I in n)n.hasOwnProperty(I)&&!C8e[I]&&l(n[I])&&d.push(I);let p=d.length,g=xv(t),m=xv(t),y,A,b,x,T,E=[];E.length=i.length/3;let v=[];for(v.length=i.length/3,T=0;T<E.length;++T)E[T]=-1,v[T]=-1;let S=f.length;for(T=0;T<S;T+=3){let I=f[T],R=f[T+1],O=f[T+2],L=h.fromArray(i,I*3),_=h.fromArray(i,R*3),C=h.fromArray(i,O*3),w=A8e(L,_,C);if(l(w)&&w.positions.length>3){let P=w.positions,M=w.indices,F=M.length;for(let V=0;V<F;++V){let B=M[V],j=P[B];j.y<0?(y=m.attributes,A=m.indices,b=E):(y=g.attributes,A=g.indices,b=v),x=Np(y,A,b,f,B<3?T+B:-1,j),l6(I,R,O,j,i,r,s,o,a,c,u,y,d,p,n,x)}}else l(w)&&(L=w.positions[0],_=w.positions[1],C=w.positions[2]),L.y<0?(y=m.attributes,A=m.indices,b=E):(y=g.attributes,A=g.indices,b=v),x=Np(y,A,b,f,T,L),l6(I,R,O,L,i,r,s,o,a,c,u,y,d,p,n,x),x=Np(y,A,b,f,T+1,_),l6(I,R,O,_,i,r,s,o,a,c,u,y,d,p,n,x),x=Np(y,A,b,f,T+2,C),l6(I,R,O,C,i,r,s,o,a,c,u,y,d,p,n,x)}DX(e,m,g)}var Dde=sn.fromPointNormal(h.ZERO,h.UNIT_Y),v8e=new h,S8e=new h;function bv(e,t,n,i,r,o,s){if(!l(s))return;let a=h.fromArray(i,e*3,MD);h.equalsEpsilon(a,n,D.EPSILON10)?o.applyOffset.values[r]=s[e]:o.applyOffset.values[r]=s[t]}function vde(e){let t=e.geometry,n=t.attributes,i=n.position.values,r=l(n.applyOffset)?n.applyOffset.values:void 0,o=t.indices,s=xv(t),a=xv(t),c,u=o.length,f=[];f.length=i.length/3;let d=[];for(d.length=i.length/3,c=0;c<f.length;++c)f[c]=-1,d[c]=-1;for(c=0;c<u;c+=2){let p=o[c],g=o[c+1],m=h.fromArray(i,p*3,MD),y=h.fromArray(i,g*3,wX),A;Math.abs(m.y)<D.EPSILON6&&(m.y<0?m.y=-D.EPSILON6:m.y=D.EPSILON6),Math.abs(y.y)<D.EPSILON6&&(y.y<0?y.y=-D.EPSILON6:y.y=D.EPSILON6);let b=s.attributes,x=s.indices,T=d,E=a.attributes,v=a.indices,S=f,I=_i.lineSegmentPlane(m,y,Dde,IX);if(l(I)){let R=h.multiplyByScalar(h.UNIT_Y,5*D.EPSILON9,v8e);m.y<0&&(h.negate(R,R),b=a.attributes,x=a.indices,T=f,E=s.attributes,v=s.indices,S=d);let O=h.add(I,R,S8e);A=Np(b,x,T,o,c,m),bv(p,g,m,i,A,b,r),A=Np(b,x,T,o,-1,O),bv(p,g,O,i,A,b,r),h.negate(R,R),h.add(I,R,O),A=Np(E,v,S,o,-1,O),bv(p,g,O,i,A,E,r),A=Np(E,v,S,o,c+1,y),bv(p,g,y,i,A,E,r)}else{let R,O,L;m.y<0?(R=a.attributes,O=a.indices,L=f):(R=s.attributes,O=s.indices,L=d),A=Np(R,O,L,o,c,m),bv(p,g,m,i,A,R,r),A=Np(R,O,L,o,c+1,y),bv(p,g,y,i,A,R,r)}}DX(e,a,s)}var Sde=new U,w8e=new U,Rde=new h,Ode=new h,PX=new h,I8e=new h,P8e=new h,D8e=new h,wde=new se;function Ide(e){let t=e.attributes,n=t.position.values,i=t.prevPosition.values,r=t.nextPosition.values,o=n.length;for(let s=0;s<o;s+=3){let a=h.unpack(n,s,Rde);if(a.x>0)continue;let c=h.unpack(i,s,Ode);(a.y<0&&c.y>0||a.y>0&&c.y<0)&&(s-3>0?(i[s]=n[s-3],i[s+1]=n[s-2],i[s+2]=n[s-1]):h.pack(a,i,s));let u=h.unpack(r,s,PX);(a.y<0&&u.y>0||a.y>0&&u.y<0)&&(s+3<o?(r[s]=n[s+3],r[s+1]=n[s+4],r[s+2]=n[s+5]):h.pack(a,r,s))}}var R8e=5*D.EPSILON9,u6=D.EPSILON6;function O8e(e){let t=e.geometry,n=t.attributes,i=n.position.values,r=n.prevPosition.values,o=n.nextPosition.values,s=n.expandAndWidth.values,a=l(n.st)?n.st.values:void 0,c=l(n.color)?n.color.values:void 0,u=xv(t),f=xv(t),d,p,g,m=!1,y=i.length/3;for(d=0;d<y;d+=4){let A=d,b=d+2,x=h.fromArray(i,A*3,Rde),T=h.fromArray(i,b*3,Ode);if(Math.abs(x.y)<u6)for(x.y=u6*(T.y<0?-1:1),i[d*3+1]=x.y,i[(d+1)*3+1]=x.y,p=A*3;p<A*3+12;p+=3)r[p]=i[d*3],r[p+1]=i[d*3+1],r[p+2]=i[d*3+2];if(Math.abs(T.y)<u6)for(T.y=u6*(x.y<0?-1:1),i[(d+2)*3+1]=T.y,i[(d+3)*3+1]=T.y,p=A*3;p<A*3+12;p+=3)o[p]=i[(d+2)*3],o[p+1]=i[(d+2)*3+1],o[p+2]=i[(d+2)*3+2];let E=u.attributes,v=u.indices,S=f.attributes,I=f.indices,R=_i.lineSegmentPlane(x,T,Dde,I8e);if(l(R)){m=!0;let O=h.multiplyByScalar(h.UNIT_Y,R8e,P8e);x.y<0&&(h.negate(O,O),E=f.attributes,v=f.indices,S=u.attributes,I=u.indices);let L=h.add(R,O,D8e);E.position.values.push(x.x,x.y,x.z,x.x,x.y,x.z),E.position.values.push(L.x,L.y,L.z),E.position.values.push(L.x,L.y,L.z),E.prevPosition.values.push(r[A*3],r[A*3+1],r[A*3+2]),E.prevPosition.values.push(r[A*3+3],r[A*3+4],r[A*3+5]),E.prevPosition.values.push(x.x,x.y,x.z,x.x,x.y,x.z),E.nextPosition.values.push(L.x,L.y,L.z),E.nextPosition.values.push(L.x,L.y,L.z),E.nextPosition.values.push(L.x,L.y,L.z),E.nextPosition.values.push(L.x,L.y,L.z),h.negate(O,O),h.add(R,O,L),S.position.values.push(L.x,L.y,L.z),S.position.values.push(L.x,L.y,L.z),S.position.values.push(T.x,T.y,T.z,T.x,T.y,T.z),S.prevPosition.values.push(L.x,L.y,L.z),S.prevPosition.values.push(L.x,L.y,L.z),S.prevPosition.values.push(L.x,L.y,L.z),S.prevPosition.values.push(L.x,L.y,L.z),S.nextPosition.values.push(T.x,T.y,T.z,T.x,T.y,T.z),S.nextPosition.values.push(o[b*3],o[b*3+1],o[b*3+2]),S.nextPosition.values.push(o[b*3+3],o[b*3+4],o[b*3+5]);let _=U.fromArray(s,A*2,Sde),C=Math.abs(_.y);E.expandAndWidth.values.push(-1,C,1,C),E.expandAndWidth.values.push(-1,-C,1,-C),S.expandAndWidth.values.push(-1,C,1,C),S.expandAndWidth.values.push(-1,-C,1,-C);let w=h.magnitudeSquared(h.subtract(R,x,PX));if(w/=h.magnitudeSquared(h.subtract(T,x,PX)),l(c)){let P=se.fromArray(c,A*4,wde),M=se.fromArray(c,b*4,wde),F=D.lerp(P.x,M.x,w),V=D.lerp(P.y,M.y,w),B=D.lerp(P.z,M.z,w),j=D.lerp(P.w,M.w,w);for(p=A*4;p<A*4+8;++p)E.color.values.push(c[p]);for(E.color.values.push(F,V,B,j),E.color.values.push(F,V,B,j),S.color.values.push(F,V,B,j),S.color.values.push(F,V,B,j),p=b*4;p<b*4+8;++p)S.color.values.push(c[p])}if(l(a)){let P=U.fromArray(a,A*2,Sde),M=U.fromArray(a,(d+3)*2,w8e),F=D.lerp(P.x,M.x,w);for(p=A*2;p<A*2+4;++p)E.st.values.push(a[p]);for(E.st.values.push(F,P.y),E.st.values.push(F,M.y),S.st.values.push(F,P.y),S.st.values.push(F,M.y),p=b*2;p<b*2+4;++p)S.st.values.push(a[p])}g=E.position.values.length/3-4,v.push(g,g+2,g+1),v.push(g+1,g+2,g+3),g=S.position.values.length/3-4,I.push(g,g+2,g+1),I.push(g+1,g+2,g+3)}else{let O,L;for(x.y<0?(O=f.attributes,L=f.indices):(O=u.attributes,L=u.indices),O.position.values.push(x.x,x.y,x.z),O.position.values.push(x.x,x.y,x.z),O.position.values.push(T.x,T.y,T.z),O.position.values.push(T.x,T.y,T.z),p=d*3;p<d*3+12;++p)O.prevPosition.values.push(r[p]),O.nextPosition.values.push(o[p]);for(p=d*2;p<d*2+8;++p)O.expandAndWidth.values.push(s[p]),l(a)&&O.st.values.push(a[p]);if(l(c))for(p=d*4;p<d*4+16;++p)O.color.values.push(c[p]);g=O.position.values.length/3-4,L.push(g,g+2,g+1),L.push(g+1,g+2,g+3)}}m&&(Ide(f),Ide(u)),DX(e,f,u)}zl.splitLongitude=function(e){let t=e.geometry,n=t.boundingSphere;if(l(n)&&(n.center.x-n.radius>0||ue.intersectPlane(n,sn.ORIGIN_ZX_PLANE)!==$t.INTERSECTING))return e;if(t.geometryType!==Sd.NONE)switch(t.geometryType){case Sd.POLYLINES:O8e(e);break;case Sd.TRIANGLES:Cde(e);break;case Sd.LINES:vde(e);break}else _8e(t),t.primitiveType===Oe.TRIANGLES?Cde(e):t.primitiveType===Oe.LINES&&vde(e);return e};var Hn=zl;function ND(e,t,n,i,r,o,s,a,c,u,f){this._context=e,this._texture=t,this._textureTarget=n,this._targetFace=i,this._pixelDatatype=s,this._internalFormat=r,this._pixelFormat=o,this._size=a,this._preMultiplyAlpha=c,this._flipY=u,this._initialized=f}Object.defineProperties(ND.prototype,{pixelFormat:{get:function(){return this._pixelFormat}},pixelDatatype:{get:function(){return this._pixelDatatype}},_target:{get:function(){return this._targetFace}}});ND.prototype.copyFrom=function(e){let{xOffset:t=0,yOffset:n=0,source:i,skipColorSpaceConversion:r=!1}=e,{width:o,height:s}=i,a=this._context._gl,c=this._textureTarget,u=this._targetFace;a.activeTexture(a.TEXTURE0),a.bindTexture(c,this._texture);let f=i.arrayBufferView,d=this._size,p=this._pixelFormat,g=this._internalFormat,m=this._pixelDatatype,y=this._preMultiplyAlpha,A=this._flipY,b=4;l(f)&&(b=Ke.alignmentInBytes(p,m,o)),a.pixelStorei(a.UNPACK_ALIGNMENT,b),r?a.pixelStorei(a.UNPACK_COLORSPACE_CONVERSION_WEBGL,a.NONE):a.pixelStorei(a.UNPACK_COLORSPACE_CONVERSION_WEBGL,a.BROWSER_DEFAULT_WEBGL);let x=!1;if(!this._initialized){let T;t===0&&n===0&&o===d&&s===d?(l(f)?(a.pixelStorei(a.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!1),a.pixelStorei(a.UNPACK_FLIP_Y_WEBGL,!1),A&&(f=Ke.flipY(f,p,m,d,d)),T=f):(a.pixelStorei(a.UNPACK_PREMULTIPLY_ALPHA_WEBGL,y),a.pixelStorei(a.UNPACK_FLIP_Y_WEBGL,A),T=i),x=!0):(a.pixelStorei(a.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!1),a.pixelStorei(a.UNPACK_FLIP_Y_WEBGL,!1),T=Ke.createTypedArray(p,m,d,d)),a.texImage2D(u,0,g,d,d,0,p,ze.toWebGLConstant(m,this._context),T),this._initialized=!0}x||(l(f)?(a.pixelStorei(a.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!1),a.pixelStorei(a.UNPACK_FLIP_Y_WEBGL,!1),A&&(f=Ke.flipY(f,p,m,o,s)),a.texSubImage2D(u,0,t,n,o,s,p,ze.toWebGLConstant(m,this._context),f)):(a.pixelStorei(a.UNPACK_PREMULTIPLY_ALPHA_WEBGL,y),a.pixelStorei(a.UNPACK_FLIP_Y_WEBGL,A),a.texSubImage2D(u,0,t,n,p,ze.toWebGLConstant(m,this._context),i))),a.bindTexture(c,null)};ND.prototype.copyFromFramebuffer=function(e,t,n,i,r,o){e=e??0,t=t??0,n=n??0,i=i??0,r=r??this._size,o=o??this._size;let s=this._context._gl,a=this._textureTarget;s.activeTexture(s.TEXTURE0),s.bindTexture(a,this._texture),s.copyTexSubImage2D(this._targetFace,0,e,t,n,i,r,o),s.bindTexture(a,null),this._initialized=!0};ND.prototype.copyMipmapFromFramebuffer=function(e,t,n,i,r){e=e??0,t=t??0,n=n??this._size,i=i??this._size,r=r??0;let o=this._context._gl,s=this._textureTarget;o.activeTexture(o.TEXTURE0),o.bindTexture(s,this._texture),o.copyTexImage2D(this._targetFace,r,this._internalFormat,e,t,n,i,0),o.bindTexture(s,null),this._initialized=!0};var LD=ND;var FD={DONT_CARE:te.DONT_CARE,FASTEST:te.FASTEST,NICEST:te.NICEST,validate:function(e){return e===FD.DONT_CARE||e===FD.FASTEST||e===FD.NICEST}};Object.freeze(FD);var Pd=FD;var BD={NEAREST:te.NEAREST,LINEAR:te.LINEAR};BD.validate=function(e){return e===BD.NEAREST||e===BD.LINEAR};Object.freeze(BD);var Jn=BD;var fg={NEAREST:te.NEAREST,LINEAR:te.LINEAR,NEAREST_MIPMAP_NEAREST:te.NEAREST_MIPMAP_NEAREST,LINEAR_MIPMAP_NEAREST:te.LINEAR_MIPMAP_NEAREST,NEAREST_MIPMAP_LINEAR:te.NEAREST_MIPMAP_LINEAR,LINEAR_MIPMAP_LINEAR:te.LINEAR_MIPMAP_LINEAR};fg.validate=function(e){return e===fg.NEAREST||e===fg.LINEAR||e===fg.NEAREST_MIPMAP_NEAREST||e===fg.LINEAR_MIPMAP_NEAREST||e===fg.NEAREST_MIPMAP_LINEAR||e===fg.LINEAR_MIPMAP_LINEAR};Object.freeze(fg);var Wt=fg;var kD={CLAMP_TO_EDGE:te.CLAMP_TO_EDGE,REPEAT:te.REPEAT,MIRRORED_REPEAT:te.MIRRORED_REPEAT,validate:function(e){return e===kD.CLAMP_TO_EDGE||e===kD.REPEAT||e===kD.MIRRORED_REPEAT}};Object.freeze(kD);var hn=kD;function UD(e){e=e??H.EMPTY_OBJECT;let{wrapR:t=hn.CLAMP_TO_EDGE,wrapS:n=hn.CLAMP_TO_EDGE,wrapT:i=hn.CLAMP_TO_EDGE,minificationFilter:r=Wt.LINEAR,magnificationFilter:o=Jn.LINEAR,maximumAnisotropy:s=1}=e;this._wrapR=t,this._wrapS=n,this._wrapT=i,this._minificationFilter=r,this._magnificationFilter=o,this._maximumAnisotropy=s}Object.defineProperties(UD.prototype,{wrapR:{get:function(){return this._wrapR}},wrapS:{get:function(){return this._wrapS}},wrapT:{get:function(){return this._wrapT}},minificationFilter:{get:function(){return this._minificationFilter}},magnificationFilter:{get:function(){return this._magnificationFilter}},maximumAnisotropy:{get:function(){return this._maximumAnisotropy}}});UD.equals=function(e,t){return e===t||l(e)&&l(t)&&e._wrapR===t._wrapR&&e._wrapS===t._wrapS&&e._wrapT===t._wrapT&&e._minificationFilter===t._minificationFilter&&e._magnificationFilter===t._magnificationFilter&&e._maximumAnisotropy===t._maximumAnisotropy};UD.NEAREST=Object.freeze(new UD({wrapR:hn.CLAMP_TO_EDGE,wrapS:hn.CLAMP_TO_EDGE,wrapT:hn.CLAMP_TO_EDGE,minificationFilter:Wt.NEAREST,magnificationFilter:Jn.NEAREST}));var jt=UD;function M8e(e,t){if(!e)throw new pe(t)}var OX=M8e;function N8e(e,t,n,i){let r=l(t.vertexBuffer),o=l(t.value),s=t.value?t.value.length:t.componentsPerAttribute,a={index:t.index??n,enabled:t.enabled??!0,vertexBuffer:t.vertexBuffer,value:o?t.value.slice(0):void 0,componentsPerAttribute:s,componentDatatype:t.componentDatatype??Y.FLOAT,normalize:t.normalize??!1,offsetInBytes:t.offsetInBytes??0,strideInBytes:t.strideInBytes??0,instanceDivisor:t.instanceDivisor??0};if(r)a.vertexAttrib=function(c){let u=this.index;c.bindBuffer(c.ARRAY_BUFFER,this.vertexBuffer._getBuffer()),c.vertexAttribPointer(u,this.componentsPerAttribute,this.componentDatatype,this.normalize,this.strideInBytes,this.offsetInBytes),c.enableVertexAttribArray(u),this.instanceDivisor>0&&(i.glVertexAttribDivisor(u,this.instanceDivisor),i._vertexAttribDivisors[u]=this.instanceDivisor,i._previousDrawInstanced=!0)},a.disableVertexAttribArray=function(c){c.disableVertexAttribArray(this.index),this.instanceDivisor>0&&i.glVertexAttribDivisor(n,0)};else{switch(a.componentsPerAttribute){case 1:a.vertexAttrib=function(c){c.vertexAttrib1fv(this.index,this.value)};break;case 2:a.vertexAttrib=function(c){c.vertexAttrib2fv(this.index,this.value)};break;case 3:a.vertexAttrib=function(c){c.vertexAttrib3fv(this.index,this.value)};break;case 4:a.vertexAttrib=function(c){c.vertexAttrib4fv(this.index,this.value)};break}a.disableVertexAttribArray=function(c){}}e.push(a)}function Nde(e,t,n){for(let i=0;i<t.length;++i){let r=t[i];r.enabled&&r.vertexAttrib(e)}l(n)&&e.bindBuffer(e.ELEMENT_ARRAY_BUFFER,n._getBuffer())}function Wh(e){e=e??H.EMPTY_OBJECT;let t=e.context,n=t._gl,i=e.attributes,r=e.indexBuffer,o,s=[],a=1,c=!1,u=!1,f=i.length;for(o=0;o<f;++o)N8e(s,i[o],o,t);for(f=s.length,o=0;o<f;++o){let p=s[o];if(l(p.vertexBuffer)&&p.instanceDivisor===0){let g=p.strideInBytes||p.componentsPerAttribute*Y.getSizeInBytes(p.componentDatatype);a=p.vertexBuffer.sizeInBytes/g;break}}for(o=0;o<f;++o)s[o].instanceDivisor>0&&(c=!0),l(s[o].value)&&(u=!0);let d;t.vertexArrayObject&&(d=t.glCreateVertexArray(),t.glBindVertexArray(d),Nde(n,s,r),t.glBindVertexArray(null)),this._numberOfVertices=a,this._hasInstancedAttributes=c,this._hasConstantAttributes=u,this._context=t,this._gl=n,this._vao=d,this._attributes=s,this._indexBuffer=r}function Mde(e){return e.values.length/e.componentsPerAttribute}function L8e(e){return Y.getSizeInBytes(e.componentDatatype)*e.componentsPerAttribute}function F8e(e){let t,n,i,r=[];for(n in e)e.hasOwnProperty(n)&&l(e[n])&&l(e[n].values)&&(r.push(n),e[n].componentDatatype===Y.DOUBLE&&(e[n].componentDatatype=Y.FLOAT,e[n].values=Y.createTypedArray(Y.FLOAT,e[n].values)));let o,s=r.length;if(s>0)for(o=Mde(e[r[0]]),t=1;t<s;++t){let u=Mde(e[r[t]]);if(u!==o)throw new oe(`Each attribute list must have the same number of vertices. Attribute ${r[t]} has a different number of vertices (${u.toString()}) than attribute ${r[0]} (${o.toString()}).`)}r.sort(function(u,f){return Y.getSizeInBytes(e[f].componentDatatype)-Y.getSizeInBytes(e[u].componentDatatype)});let a=0,c={};for(t=0;t<s;++t)n=r[t],i=e[n],c[n]=a,a+=L8e(i);if(a>0){let u=Y.getSizeInBytes(e[r[0]].componentDatatype),f=a%u;f!==0&&(a+=u-f);let d=o*a,p=new ArrayBuffer(d),g={};for(t=0;t<s;++t){n=r[t];let m=Y.getSizeInBytes(e[n].componentDatatype);g[n]={pointer:Y.createTypedArray(e[n].componentDatatype,p),index:c[n]/m,strideInComponentType:a/m}}for(t=0;t<o;++t)for(let m=0;m<s;++m){n=r[m],i=e[n];let y=i.values,A=g[n],b=A.pointer,x=i.componentsPerAttribute;for(let T=0;T<x;++T)b[A.index+T]=y[t*x+T];A.index+=A.strideInComponentType}return{buffer:p,offsetsInBytes:c,vertexSizeInBytes:a}}}Wh.fromGeometry=function(e){e=e??H.EMPTY_OBJECT;let t=e.context,n=e.geometry??H.EMPTY_OBJECT,i=e.bufferUsage??Me.DYNAMIC_DRAW,r=e.attributeLocations??H.EMPTY_OBJECT,o=e.interleave??!1,s=e.vertexArrayAttributes,a,c,u,f=l(s)?s:[],d=n.attributes;if(o){let m=F8e(d);if(l(m)){u=tt.createVertexBuffer({context:t,typedArray:m.buffer,usage:i});let y=m.offsetsInBytes,A=m.vertexSizeInBytes;for(a in d)d.hasOwnProperty(a)&&l(d[a])&&(c=d[a],l(c.values)?f.push({index:r[a],vertexBuffer:u,componentDatatype:c.componentDatatype,componentsPerAttribute:c.componentsPerAttribute,normalize:c.normalize,offsetInBytes:y[a],strideInBytes:A}):f.push({index:r[a],value:c.value,componentDatatype:c.componentDatatype,normalize:c.normalize}))}}else for(a in d)if(d.hasOwnProperty(a)&&l(d[a])){c=d[a];let m=c.componentDatatype;m===Y.DOUBLE&&(m=Y.FLOAT);let y={};l(c.values)&&(u=tt.createVertexBuffer({context:t,typedArray:Y.createTypedArray(m,c.values),usage:i}),y={index:r[a],vertexBuffer:u,value:c.value,componentDatatype:m,componentsPerAttribute:c.componentsPerAttribute,normalize:c.normalize}),l(c.typedArray)&&(u=tt.createVertexBuffer({context:t,typedArray:c.typedArray,usage:i}),y={index:r[a],vertexBuffer:u,value:void 0,componentDatatype:m,componentsPerAttribute:Vt.getNumberOfComponents(c.type),normalize:c.normalized,instanceDivisor:c.instanceDivisor}),f.push(y)}let p,g=n.indices;return l(g)&&(St.computeNumberOfVertices(n)>=D.SIXTY_FOUR_KILOBYTES&&t.elementIndexUint?p=tt.createIndexBuffer({context:t,typedArray:new Uint32Array(g),usage:i,indexDatatype:je.UNSIGNED_INT}):p=tt.createIndexBuffer({context:t,typedArray:new Uint16Array(g),usage:i,indexDatatype:je.UNSIGNED_SHORT})),new Wh({context:t,attributes:f,indexBuffer:p})};Object.defineProperties(Wh.prototype,{numberOfAttributes:{get:function(){return this._attributes.length}},numberOfVertices:{get:function(){return this._numberOfVertices}},indexBuffer:{get:function(){return this._indexBuffer}}});Wh.prototype.getAttribute=function(e){return this._attributes[e]};function B8e(e){let t=e._context,n=e._hasInstancedAttributes;if(!n&&!t._previousDrawInstanced)return;t._previousDrawInstanced=n;let i=t._vertexAttribDivisors,r=e._attributes,o=kt.maximumVertexAttributes,s;if(n){let a=r.length;for(s=0;s<a;++s){let c=r[s];if(c.enabled){let u=c.instanceDivisor,f=c.index;u!==i[f]&&(t.glVertexAttribDivisor(f,u),i[f]=u)}}}else for(s=0;s<o;++s)i[s]>0&&(t.glVertexAttribDivisor(s,0),i[s]=0)}function k8e(e,t){let n=e._attributes,i=n.length;for(let r=0;r<i;++r){let o=n[r];o.enabled&&l(o.value)&&o.vertexAttrib(t)}}Wh.prototype.copyAttributeFromRange=function(e,t,n,i){let r=this.getAttribute(e),o=r.vertexBuffer,s=r.componentsPerAttribute,a=t.constructor,c=n*s*a.BYTES_PER_ELEMENT,u=new a(t.buffer,t.byteOffset+c,i*s);o.copyFromArrayView(u,c)};Wh.prototype.copyIndexFromRange=function(e,t,n){let i=this._indexBuffer,r=e.constructor,o=t*r.BYTES_PER_ELEMENT,s=new r(e.buffer,e.byteOffset+o,n);i.copyFromArrayView(s,o)};Wh.prototype._bind=function(){l(this._vao)?(this._context.glBindVertexArray(this._vao),this._context.instancedArrays&&B8e(this),this._hasConstantAttributes&&k8e(this,this._gl)):Nde(this._gl,this._attributes,this._indexBuffer)};Wh.prototype._unBind=function(){if(l(this._vao))this._context.glBindVertexArray(null);else{let e=this._attributes,t=this._gl;for(let n=0;n<e.length;++n){let i=e[n];i.enabled&&i.disableVertexAttribArray(t)}this._indexBuffer&&t.bindBuffer(t.ELEMENT_ARRAY_BUFFER,null)}};Wh.prototype.isDestroyed=function(){return!1};Wh.prototype.destroy=function(){let e=this._attributes;for(let n=0;n<e.length;++n){let i=e[n].vertexBuffer;l(i)&&!i.isDestroyed()&&i.vertexArrayDestroyable&&i.destroy()}let t=this._indexBuffer;return l(t)&&!t.isDestroyed()&&t.vertexArrayDestroyable&&t.destroy(),l(this._vao)&&this._context.glDeleteVertexArray(this._vao),le(this)};var zn=Wh;function Po(e){e=e??H.EMPTY_OBJECT;let{context:t,source:n,pixelFormat:i=Ke.RGBA,pixelDatatype:r=ze.UNSIGNED_BYTE,flipY:o=!0,skipColorSpaceConversion:s=!1,sampler:a=new jt}=e,c=e.preMultiplyAlpha||i===Ke.RGB||i===Ke.LUMINANCE,{width:u,height:f}=e;l(n)&&({width:u,height:f}=n.positiveX);let d=u,p=Ke.textureSizeInBytes(i,r,d,d)*6,g=Ke.toInternalFormat(i,r,t),m=t._gl,y=m.TEXTURE_CUBE_MAP,A=m.createTexture();this._context=t,this._textureFilterAnisotropic=t._textureFilterAnisotropic,this._textureTarget=y,this._texture=A,this._pixelFormat=i,this._pixelDatatype=r,this._size=d,this._hasMipmap=!1,this._sizeInBytes=p,this._preMultiplyAlpha=c,this._flipY=o;let b=l(n);function x(T){return new LD(t,A,y,T,g,i,r,d,c,o,b)}this._positiveX=x(m.TEXTURE_CUBE_MAP_POSITIVE_X),this._negativeX=x(m.TEXTURE_CUBE_MAP_NEGATIVE_X),this._positiveY=x(m.TEXTURE_CUBE_MAP_POSITIVE_Y),this._negativeY=x(m.TEXTURE_CUBE_MAP_NEGATIVE_Y),this._positiveZ=x(m.TEXTURE_CUBE_MAP_POSITIVE_Z),this._negativeZ=x(m.TEXTURE_CUBE_MAP_NEGATIVE_Z),this._sampler=a,Lde(this,a),m.activeTexture(m.TEXTURE0),m.bindTexture(y,A),s?m.pixelStorei(m.UNPACK_COLORSPACE_CONVERSION_WEBGL,m.NONE):m.pixelStorei(m.UNPACK_COLORSPACE_CONVERSION_WEBGL,m.BROWSER_DEFAULT_WEBGL);for(let T of Po.faceNames())MX(this[T],n?.[T],0);m.bindTexture(y,null)}Po.prototype.copyFace=function(e,t,n,i){let r=e.context,o=new _s({context:r,colorTextures:[t],destroyAttachments:!1});o._bind(),this[n].copyMipmapFromFramebuffer(0,0,t.width,t.height,i??0),o._unBind(),o.destroy()};Po.FaceName=Object.freeze({POSITIVEX:"positiveX",NEGATIVEX:"negativeX",POSITIVEY:"positiveY",NEGATIVEY:"negativeY",POSITIVEZ:"positiveZ",NEGATIVEZ:"negativeZ"});function*U8e(){yield Po.FaceName.POSITIVEX,yield Po.FaceName.NEGATIVEX,yield Po.FaceName.POSITIVEY,yield Po.FaceName.NEGATIVEY,yield Po.FaceName.POSITIVEZ,yield Po.FaceName.NEGATIVEZ}Po.faceNames=function(){return U8e()};function MX(e,t,n){n=n??0;let i=e._targetFace,r=Math.max(Math.floor(e._size/2**n),1),o=e._pixelFormat,s=e._pixelDatatype,a=e._internalFormat,c=e._flipY,u=e._preMultiplyAlpha,f=e._context,d=f._gl;if(!l(t)){d.texImage2D(i,n,a,r,r,0,o,ze.toWebGLConstant(s,f),null);return}let{arrayBufferView:p}=t,g=4;l(p)&&(g=Ke.alignmentInBytes(o,s,r)),d.pixelStorei(d.UNPACK_ALIGNMENT,g),l(p)?(d.pixelStorei(d.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!1),d.pixelStorei(d.UNPACK_FLIP_Y_WEBGL,!1),c&&(p=Ke.flipY(p,o,s,r,r)),d.texImage2D(i,n,a,r,r,0,o,ze.toWebGLConstant(s,f),p)):(d.pixelStorei(d.UNPACK_PREMULTIPLY_ALPHA_WEBGL,u),d.pixelStorei(d.UNPACK_FLIP_Y_WEBGL,c),d.texImage2D(i,n,a,o,ze.toWebGLConstant(s,f),t))}Po.loadFace=MX;Object.defineProperties(Po.prototype,{positiveX:{get:function(){return this._positiveX}},negativeX:{get:function(){return this._negativeX}},positiveY:{get:function(){return this._positiveY}},negativeY:{get:function(){return this._negativeY}},positiveZ:{get:function(){return this._positiveZ}},negativeZ:{get:function(){return this._negativeZ}},sampler:{get:function(){return this._sampler},set:function(e){Lde(this,e),this._sampler=e}},pixelFormat:{get:function(){return this._pixelFormat}},pixelDatatype:{get:function(){return this._pixelDatatype}},width:{get:function(){return this._size}},height:{get:function(){return this._size}},sizeInBytes:{get:function(){return this._hasMipmap?Math.floor(this._sizeInBytes*4/3):this._sizeInBytes}},preMultiplyAlpha:{get:function(){return this._preMultiplyAlpha}},flipY:{get:function(){return this._flipY}},_target:{get:function(){return this._textureTarget}}});Po.getDirection=function(e,t){switch(e){case Po.FaceName.POSITIVEX:return h.clone(h.UNIT_X,t);case Po.FaceName.NEGATIVEX:return h.negate(h.UNIT_X,t);case Po.FaceName.POSITIVEY:return h.clone(h.UNIT_Y,t);case Po.FaceName.NEGATIVEY:return h.negate(h.UNIT_Y,t);case Po.FaceName.POSITIVEZ:return h.clone(h.UNIT_Z,t);case Po.FaceName.NEGATIVEZ:return h.negate(h.UNIT_Z,t)}};function Lde(e,t){let{minificationFilter:n,magnificationFilter:i}=t,r=[Wt.NEAREST_MIPMAP_NEAREST,Wt.NEAREST_MIPMAP_LINEAR,Wt.LINEAR_MIPMAP_NEAREST,Wt.LINEAR_MIPMAP_LINEAR].includes(n),o=e._context,s=e._pixelDatatype;(s===ze.FLOAT&&!o.textureFloatLinear||s===ze.HALF_FLOAT&&!o.textureHalfFloatLinear)&&(n=r?Wt.NEAREST_MIPMAP_NEAREST:Wt.NEAREST,i=Jn.NEAREST);let a=o._gl,c=e._textureTarget;a.activeTexture(a.TEXTURE0),a.bindTexture(c,e._texture),a.texParameteri(c,a.TEXTURE_MIN_FILTER,a.LINEAR),a.texParameteri(c,a.TEXTURE_MAG_FILTER,i),a.texParameteri(c,a.TEXTURE_WRAP_S,t.wrapS),a.texParameteri(c,a.TEXTURE_WRAP_T,t.wrapT),l(e._textureFilterAnisotropic)&&a.texParameteri(c,e._textureFilterAnisotropic.TEXTURE_MAX_ANISOTROPY_EXT,t.maximumAnisotropy),a.bindTexture(c,null)}Po.prototype.loadMipmaps=function(e,t){t=t??!1;let n=this._context._gl,i=this._texture,r=this._textureTarget;n.activeTexture(n.TEXTURE0),n.bindTexture(r,i),t?n.pixelStorei(n.UNPACK_COLORSPACE_CONVERSION_WEBGL,n.NONE):n.pixelStorei(n.UNPACK_COLORSPACE_CONVERSION_WEBGL,n.BROWSER_DEFAULT_WEBGL);for(let o=0;o<e.length;o++){let s=e[o],a=o+1;for(let c of Po.faceNames())MX(this[c],s[c],a)}n.bindTexture(r,null),this._hasMipmap=!0};Po.prototype.generateMipmap=function(e){e=e??Pd.DONT_CARE,this._hasMipmap=!0;let t=this._context._gl,n=this._textureTarget;t.hint(t.GENERATE_MIPMAP_HINT,e),t.activeTexture(t.TEXTURE0),t.bindTexture(n,this._texture),t.generateMipmap(n),t.bindTexture(n,null)};Po.createVertexArray=function(e){let t=Ic.createGeometry(Ic.fromDimensions({dimensions:new h(2,2,2),vertexFormat:Be.POSITION_ONLY})),n=this._attributeLocations=Hn.createAttributeLocations(t);return zn.fromGeometry({context:e,geometry:t,attributeLocations:n,bufferUsage:Me.STATIC_DRAW})};Po.prototype.isDestroyed=function(){return!1};Po.prototype.destroy=function(){return this._context._gl.deleteTexture(this._texture),this._positiveX=le(this._positiveX),this._negativeX=le(this._negativeX),this._positiveY=le(this._positiveY),this._negativeY=le(this._negativeY),this._positiveZ=le(this._positiveZ),this._negativeZ=le(this._negativeZ),le(this)};var ns=Po;function z8e(e){this.context=e,this.framebuffer=void 0,this.blendingEnabled=void 0,this.scissorTest=void 0,this.viewport=void 0}var sc=z8e;var NX=class{constructor(t,n,i){this._pickObjects=t,this.key=n,this.color=i}get object(){return this._pickObjects.get(this.key)}set object(t){this._pickObjects.set(this.key,t)}destroy(){this._pickObjects.delete(this.key)}},zD=NX;var VD=`const float czm_degreesPerRadian = 57.29577951308232; + `;return o=YY(a),new Worker(o,r)}if(o=e,n||(o=Zt(`${rc._workerModulePrefix+i}.js`)),!dn.supportsEsmWebWorkers())throw new oe("This browser is not supported. Please update your browser to continue.");return r.type="module",new Worker(o,r)}async function n4e(e,t){let n={modulePath:void 0,wasmBinaryFile:void 0,wasmBinary:void 0};if(!dn.supportsWebAssembly()){if(!l(t.fallbackModulePath))throw new oe(`This browser does not support Web Assembly, and no backup module was provided for ${e._workerPath}`);return n.modulePath=Zt(t.fallbackModulePath),n}n.wasmBinaryFile=Zt(t.wasmBinaryFile);let i=await De.fetchArrayBuffer({url:n.wasmBinaryFile});return n.wasmBinary=i,n}function rc(e,t){this._workerPath=e,this._maximumActiveTasks=t??Number.POSITIVE_INFINITY,this._activeTasks=0,this._nextID=0,this._webAssemblyPromise=void 0}var i4e=(e,t,n,i)=>{let r=({data:o})=>{if(o.id===t){if(l(o.error)){let s=o.error;s.name==="RuntimeError"?(s=new oe(o.error.message),s.stack=o.error.stack):s.name==="DeveloperError"?(s=new pe(o.error.message),s.stack=o.error.stack):s.name==="Error"&&(s=new Error(o.error.message),s.stack=o.error.stack),XY.raiseEvent(s),i(s)}else XY.raiseEvent(),n(o.result);e.removeEventListener("message",r)}};return r},r4e=[];async function o4e(e,t,n){let i=await Promise.resolve(Gfe());l(n)?i||(n.length=0):n=r4e;let r=e._nextID++,o=new Promise((s,a)=>{e._worker.addEventListener("message",i4e(e._worker,r,s,a))});return e._worker.postMessage({id:r,baseUrl:Zt.getCesiumBaseUrl().url,parameters:t,canTransferArrayBuffer:i},n),o}async function s4e(e,t,n){++e._activeTasks;try{let i=await o4e(e,t,n);return--e._activeTasks,i}catch(i){throw--e._activeTasks,i}}rc.prototype.scheduleTask=function(e,t){if(l(this._worker)||(this._worker=KY(this._workerPath)),!(this._activeTasks>=this._maximumActiveTasks))return s4e(this,e,t)};rc.prototype.initWebAssemblyModule=async function(e){if(l(this._webAssemblyPromise))return this._webAssemblyPromise;let t=async()=>{let n=this._worker=KY(this._workerPath),i=await n4e(this,e),r=await Promise.resolve(Gfe()),o,s=i.wasmBinary;l(s)&&r&&(o=[s]);let a=new Promise((c,u)=>{n.onmessage=function({data:f}){l(f)?c(f.result):u(new oe("Could not configure wasm module"))}});return n.postMessage({canTransferArrayBuffer:r,parameters:{webAssemblyConfig:i}},o),a};return this._webAssemblyPromise=t(),this._webAssemblyPromise};rc.prototype.isDestroyed=function(){return!1};rc.prototype.destroy=function(){return l(this._worker)&&this._worker.terminate(),le(this)};rc.taskCompletedEvent=XY;rc._defaultWorkerModulePrefix="Workers/";rc._workerModulePrefix=rc._defaultWorkerModulePrefix;rc._canTransferArrayBuffer=void 0;var $n=rc;function lg(){}lg._transcodeTaskProcessor=new $n("transcodeKTX2",Number.POSITIVE_INFINITY);lg._readyPromise=void 0;function a4e(){let e=lg._transcodeTaskProcessor.initWebAssemblyModule({wasmBinaryFile:"ThirdParty/basis_transcoder.wasm"}).then(function(t){if(t)return lg._transcodeTaskProcessor;throw new oe("KTX2 transcoder could not be initialized.")});lg._readyPromise=e}lg.transcode=function(e,t){return l(lg._readyPromise)||a4e(),lg._readyPromise.then(function(n){let i=e;e instanceof ArrayBuffer&&(i=new Uint8Array(e));let r={supportedTargetFormats:t,ktx2Buffer:i};return n.scheduleTask(r,[i.buffer])}).then(function(n){let i=n.length,r=Object.keys(n[0]);for(let o=0;o<i;o++){let s=n[o];for(let a=0;a<r.length;a++){let c=s[r[a]];s[r[a]]=new vD(c.internalFormat,c.datatype,c.width,c.height,c.levelBuffer)}}if(r.length===1){for(let o=0;o<i;++o)n[o]=n[o][r[0]];i===1&&(n=n[0])}return n}).catch(function(n){throw n})};var SD=lg;var Wfe;qfe.setKTX2SupportedFormats=function(e,t,n,i,r,o){Wfe={s3tc:e,pvrtc:t,astc:n,etc:i,etc1:r,bc7:o}};function qfe(e){let t;return e instanceof ArrayBuffer||ArrayBuffer.isView(e)?t=Promise.resolve(e):t=De.createIfNeeded(e).fetchArrayBuffer(),t.then(function(n){return SD.transcode(n,Wfe)})}var Ou=qfe;function c4e(e,t){this.start=e??0,this.stop=t??0}var Us=c4e;var i6=class e{constructor(t,n){this.center=h.clone(t??h.ZERO),this.radius=n??0}static fromPoints(t,n){if(l(n)||(n=new e),!l(t)||t.length===0)return n.center=h.clone(h.ZERO,n.center),n.radius=0,n;let i=h.clone(t[0],nX),r=h.clone(i,$Y),o=h.clone(i,JY),s=h.clone(i,ZY),a=h.clone(i,QY),c=h.clone(i,eX),u=h.clone(i,tX),f=t.length,d;for(d=1;d<f;d++){h.clone(t[d],i);let O=i.x,L=i.y,_=i.z;O<r.x&&h.clone(i,r),O>a.x&&h.clone(i,a),L<o.y&&h.clone(i,o),L>c.y&&h.clone(i,c),_<s.z&&h.clone(i,s),_>u.z&&h.clone(i,u)}let p=h.magnitudeSquared(h.subtract(a,r,oc)),g=h.magnitudeSquared(h.subtract(c,o,oc)),m=h.magnitudeSquared(h.subtract(u,s,oc)),y=r,A=a,b=p;g>b&&(b=g,y=o,A=c),m>b&&(y=s,A=u);let x=iX;x.x=(y.x+A.x)*.5,x.y=(y.y+A.y)*.5,x.z=(y.z+A.z)*.5;let T=h.magnitudeSquared(h.subtract(A,x,oc)),E=Math.sqrt(T),v=rX;v.x=r.x,v.y=o.y,v.z=s.z;let S=oX;S.x=a.x,S.y=c.y,S.z=u.z;let I=h.midpoint(v,S,sX),R=0;for(d=0;d<f;d++){h.clone(t[d],i);let O=h.magnitude(h.subtract(i,I,oc));O>R&&(R=O);let L=h.magnitudeSquared(h.subtract(i,x,oc));if(L>T){let _=Math.sqrt(L);E=(E+_)*.5,T=E*E;let C=_-E;x.x=(E*x.x+C*i.x)/_,x.y=(E*x.y+C*i.y)/_,x.z=(E*x.z+C*i.z)/_}}return E<R?(h.clone(x,n.center),n.radius=E):(h.clone(I,n.center),n.radius=R),n}static fromRectangle2D(t,n,i){return e.fromRectangleWithHeights2D(t,n,0,0,i)}static fromRectangleWithHeights2D(t,n,i,r,o){if(l(o)||(o=new e),!l(t))return o.center=h.clone(h.ZERO,o.center),o.radius=0,o;Yfe._ellipsoid=ee.default,n=n??Yfe,ie.southwest(t,aX),aX.height=i,ie.northeast(t,cX),cX.height=r;let s=n.project(aX,u4e),a=n.project(cX,f4e),c=a.x-s.x,u=a.y-s.y,f=a.z-s.z;o.radius=Math.sqrt(c*c+u*u+f*f)*.5;let d=o.center;return d.x=s.x+c*.5,d.y=s.y+u*.5,d.z=s.z+f*.5,o}static fromRectangle3D(t,n,i,r){if(n=n??ee.default,i=i??0,l(r)||(r=new e),!l(t))return r.center=h.clone(h.ZERO,r.center),r.radius=0,r;let o=ie.subsample(t,n,i,d4e);return e.fromPoints(o,r)}static fromVertices(t,n,i,r){if(l(r)||(r=new e),!l(t)||t.length===0)return r.center=h.clone(h.ZERO,r.center),r.radius=0,r;n=n??h.ZERO,i=i??3;let o=nX;o.x=t[0]+n.x,o.y=t[1]+n.y,o.z=t[2]+n.z;let s=h.clone(o,$Y),a=h.clone(o,JY),c=h.clone(o,ZY),u=h.clone(o,QY),f=h.clone(o,eX),d=h.clone(o,tX),p=t.length,g;for(g=0;g<p;g+=i){let _=t[g]+n.x,C=t[g+1]+n.y,w=t[g+2]+n.z;o.x=_,o.y=C,o.z=w,_<s.x&&h.clone(o,s),_>u.x&&h.clone(o,u),C<a.y&&h.clone(o,a),C>f.y&&h.clone(o,f),w<c.z&&h.clone(o,c),w>d.z&&h.clone(o,d)}let m=h.magnitudeSquared(h.subtract(u,s,oc)),y=h.magnitudeSquared(h.subtract(f,a,oc)),A=h.magnitudeSquared(h.subtract(d,c,oc)),b=s,x=u,T=m;y>T&&(T=y,b=a,x=f),A>T&&(b=c,x=d);let E=iX;E.x=(b.x+x.x)*.5,E.y=(b.y+x.y)*.5,E.z=(b.z+x.z)*.5;let v=h.magnitudeSquared(h.subtract(x,E,oc)),S=Math.sqrt(v),I=rX;I.x=s.x,I.y=a.y,I.z=c.z;let R=oX;R.x=u.x,R.y=f.y,R.z=d.z;let O=h.midpoint(I,R,sX),L=0;for(g=0;g<p;g+=i){o.x=t[g]+n.x,o.y=t[g+1]+n.y,o.z=t[g+2]+n.z;let _=h.magnitude(h.subtract(o,O,oc));_>L&&(L=_);let C=h.magnitudeSquared(h.subtract(o,E,oc));if(C>v){let w=Math.sqrt(C);S=(S+w)*.5,v=S*S;let P=w-S;E.x=(S*E.x+P*o.x)/w,E.y=(S*E.y+P*o.y)/w,E.z=(S*E.z+P*o.z)/w}}return S<L?(h.clone(E,r.center),r.radius=S):(h.clone(O,r.center),r.radius=L),r}static fromEncodedCartesianVertices(t,n,i){if(l(i)||(i=new e),!l(t)||!l(n)||t.length!==n.length||t.length===0)return i.center=h.clone(h.ZERO,i.center),i.radius=0,i;let r=nX;r.x=t[0]+n[0],r.y=t[1]+n[1],r.z=t[2]+n[2];let o=h.clone(r,$Y),s=h.clone(r,JY),a=h.clone(r,ZY),c=h.clone(r,QY),u=h.clone(r,eX),f=h.clone(r,tX),d=t.length,p;for(p=0;p<d;p+=3){let L=t[p]+n[p],_=t[p+1]+n[p+1],C=t[p+2]+n[p+2];r.x=L,r.y=_,r.z=C,L<o.x&&h.clone(r,o),L>c.x&&h.clone(r,c),_<s.y&&h.clone(r,s),_>u.y&&h.clone(r,u),C<a.z&&h.clone(r,a),C>f.z&&h.clone(r,f)}let g=h.magnitudeSquared(h.subtract(c,o,oc)),m=h.magnitudeSquared(h.subtract(u,s,oc)),y=h.magnitudeSquared(h.subtract(f,a,oc)),A=o,b=c,x=g;m>x&&(x=m,A=s,b=u),y>x&&(A=a,b=f);let T=iX;T.x=(A.x+b.x)*.5,T.y=(A.y+b.y)*.5,T.z=(A.z+b.z)*.5;let E=h.magnitudeSquared(h.subtract(b,T,oc)),v=Math.sqrt(E),S=rX;S.x=o.x,S.y=s.y,S.z=a.z;let I=oX;I.x=c.x,I.y=u.y,I.z=f.z;let R=h.midpoint(S,I,sX),O=0;for(p=0;p<d;p+=3){r.x=t[p]+n[p],r.y=t[p+1]+n[p+1],r.z=t[p+2]+n[p+2];let L=h.magnitude(h.subtract(r,R,oc));L>O&&(O=L);let _=h.magnitudeSquared(h.subtract(r,T,oc));if(_>E){let C=Math.sqrt(_);v=(v+C)*.5,E=v*v;let w=C-v;T.x=(v*T.x+w*r.x)/C,T.y=(v*T.y+w*r.y)/C,T.z=(v*T.z+w*r.z)/C}}return v<O?(h.clone(T,i.center),i.radius=v):(h.clone(R,i.center),i.radius=O),i}static fromCornerPoints(t,n,i){l(i)||(i=new e);let r=h.midpoint(t,n,i.center);return i.radius=h.distance(r,n),i}static fromEllipsoid(t,n){return l(n)||(n=new e),h.clone(h.ZERO,n.center),n.radius=t.maximumRadius,n}static fromBoundingSpheres(t,n){if(l(n)||(n=new e),!l(t)||t.length===0)return n.center=h.clone(h.ZERO,n.center),n.radius=0,n;let i=t.length;if(i===1)return e.clone(t[0],n);if(i===2)return e.union(t[0],t[1],n);let r=[],o;for(o=0;o<i;o++)r.push(t[o].center);n=e.fromPoints(r,n);let s=n.center,a=n.radius;for(o=0;o<i;o++){let c=t[o];a=Math.max(a,h.distance(s,c.center)+c.radius)}return n.radius=a,n}static fromOrientedBoundingBox(t,n){l(n)||(n=new e);let i=t.halfAxes,r=$.getColumn(i,0,h4e),o=$.getColumn(i,1,m4e),s=$.getColumn(i,2,p4e);return h.add(r,o,r),h.add(r,s,r),n.center=h.clone(t.center,n.center),n.radius=h.magnitude(r),n}static fromTransformation(t,n){l(n)||(n=new e);let i=N.getTranslation(t,g4e),r=N.getScale(t,_4e),o=.5*h.magnitude(r);return n.center=h.clone(i,n.center),n.radius=o,n}static clone(t,n){if(l(t))return l(n)?(n.center=h.clone(t.center,n.center),n.radius=t.radius,n):new e(t.center,t.radius)}static pack(t,n,i){i=i??0;let r=t.center;return n[i++]=r.x,n[i++]=r.y,n[i++]=r.z,n[i]=t.radius,n}static unpack(t,n,i){n=n??0,l(i)||(i=new e);let r=i.center;return r.x=t[n++],r.y=t[n++],r.z=t[n++],i.radius=t[n],i}static union(t,n,i){l(i)||(i=new e);let r=t.center,o=t.radius,s=n.center,a=n.radius,c=h.subtract(s,r,y4e),u=h.magnitude(c);if(o>=u+a)return t.clone(i),i;if(a>=u+o)return n.clone(i),i;let f=(o+u+a)*.5,d=h.multiplyByScalar(c,(-o+f)/u,A4e);return h.add(d,r,d),h.clone(d,i.center),i.radius=f,i}static expand(t,n,i){i=e.clone(t,i);let r=h.magnitude(h.subtract(n,i.center,b4e));return r>i.radius&&(i.radius=r),i}static intersectPlane(t,n){let i=t.center,r=t.radius,o=n.normal,s=h.dot(o,i)+n.distance;return s<-r?$t.OUTSIDE:s<r?$t.INTERSECTING:$t.INSIDE}static transform(t,n,i){return l(i)||(i=new e),i.center=N.multiplyByPoint(n,t.center,i.center),i.radius=N.getMaximumScale(n)*t.radius,i}static distanceSquaredTo(t,n){let i=h.subtract(t.center,n,x4e),r=h.magnitude(i)-t.radius;return r<=0?0:r*r}static transformWithoutScale(t,n,i){return l(i)||(i=new e),i.center=N.multiplyByPoint(n,t.center,i.center),i.radius=t.radius,i}static computePlaneDistances(t,n,i,r){l(r)||(r=new Us);let o=h.subtract(t.center,n,T4e),s=h.dot(i,o);return r.start=s-t.radius,r.stop=s+t.radius,r}static projectTo2D(t,n,i){Kfe._ellipsoid=ee.default,n=n??Kfe;let r=n.ellipsoid,o=t.center,s=t.radius,a;h.equals(o,h.ZERO)?a=h.clone(h.UNIT_X,Xfe):a=r.geodeticSurfaceNormal(o,Xfe);let c=h.cross(h.UNIT_Z,a,E4e);h.normalize(c,c);let u=h.cross(a,c,C4e);h.normalize(u,u),h.multiplyByScalar(a,s,a),h.multiplyByScalar(u,s,u),h.multiplyByScalar(c,s,c);let f=h.negate(u,S4e),d=h.negate(c,v4e),p=$fe,g=p[0];h.add(a,u,g),h.add(g,c,g),g=p[1],h.add(a,u,g),h.add(g,d,g),g=p[2],h.add(a,f,g),h.add(g,d,g),g=p[3],h.add(a,f,g),h.add(g,c,g),h.negate(a,a),g=p[4],h.add(a,u,g),h.add(g,c,g),g=p[5],h.add(a,u,g),h.add(g,d,g),g=p[6],h.add(a,f,g),h.add(g,d,g),g=p[7],h.add(a,f,g),h.add(g,c,g);let m=p.length;for(let x=0;x<m;++x){let T=p[x];h.add(o,T,T);let E=r.cartesianToCartographic(T,w4e);n.project(E,T)}i=e.fromPoints(p,i),o=i.center;let y=o.x,A=o.y,b=o.z;return o.x=b,o.y=y,o.z=A,i}static isOccluded(t,n){return!n.isBoundingSphereVisible(t)}static equals(t,n){return t===n||l(t)&&l(n)&&h.equals(t.center,n.center)&&t.radius===n.radius}intersectPlane(t){return e.intersectPlane(this,t)}distanceSquaredTo(t){return e.distanceSquaredTo(this,t)}computePlaneDistances(t,n,i){return e.computePlaneDistances(this,t,n,i)}isOccluded(t){return e.isOccluded(this,t)}equals(t){return e.equals(this,t)}clone(t){return e.clone(this,t)}volume(){let t=this.radius;return l4e*t*t*t}};i6.packedLength=4;var $Y=new h,JY=new h,ZY=new h,QY=new h,eX=new h,tX=new h,nX=new h,oc=new h,iX=new h,rX=new h,oX=new h,sX=new h,l4e=4/3*D.PI,Yfe=new Ui,u4e=new h,f4e=new h,aX=new he,cX=new he,d4e=[],h4e=new h,m4e=new h,p4e=new h,g4e=new h,_4e=new h,y4e=new h,A4e=new h,b4e=new h,x4e=new h,T4e=new h,Xfe=new h,E4e=new h,C4e=new h,v4e=new h,S4e=new h,w4e=new he,$fe=new Array(8);for(let e=0;e<8;++e)$fe[e]=new h;var Kfe=new Ui,ue=i6;function I4e(e){e=e??H.EMPTY_OBJECT,this.position=e.position,this.normal=e.normal,this.st=e.st,this.bitangent=e.bitangent,this.tangent=e.tangent,this.color=e.color}var Tn=I4e;var Jfe={NONE:0,TOP:1,ALL:2};Object.freeze(Jfe);var mn=Jfe;function ea(e){e=e??H.EMPTY_OBJECT,this.position=e.position??!1,this.normal=e.normal??!1,this.st=e.st??!1,this.bitangent=e.bitangent??!1,this.tangent=e.tangent??!1,this.color=e.color??!1}ea.POSITION_ONLY=Object.freeze(new ea({position:!0}));ea.POSITION_AND_NORMAL=Object.freeze(new ea({position:!0,normal:!0}));ea.POSITION_NORMAL_AND_ST=Object.freeze(new ea({position:!0,normal:!0,st:!0}));ea.POSITION_AND_ST=Object.freeze(new ea({position:!0,st:!0}));ea.POSITION_AND_COLOR=Object.freeze(new ea({position:!0,color:!0}));ea.ALL=Object.freeze(new ea({position:!0,normal:!0,st:!0,tangent:!0,bitangent:!0}));ea.DEFAULT=ea.POSITION_NORMAL_AND_ST;ea.packedLength=6;ea.pack=function(e,t,n){return n=n??0,t[n++]=e.position?1:0,t[n++]=e.normal?1:0,t[n++]=e.st?1:0,t[n++]=e.tangent?1:0,t[n++]=e.bitangent?1:0,t[n]=e.color?1:0,t};ea.unpack=function(e,t,n){return t=t??0,l(n)||(n=new ea),n.position=e[t++]===1,n.normal=e[t++]===1,n.st=e[t++]===1,n.tangent=e[t++]===1,n.bitangent=e[t++]===1,n.color=e[t]===1,n};ea.clone=function(e,t){if(l(e))return l(t)||(t=new ea),t.position=e.position,t.normal=e.normal,t.st=e.st,t.tangent=e.tangent,t.bitangent=e.bitangent,t.color=e.color,t};var Be=ea;var P4e=new h;function Cf(e){e=e??H.EMPTY_OBJECT;let t=e.minimum,n=e.maximum,i=e.vertexFormat??Be.DEFAULT;this._minimum=h.clone(t),this._maximum=h.clone(n),this._vertexFormat=i,this._offsetAttribute=e.offsetAttribute,this._workerName="createBoxGeometry"}Cf.fromDimensions=function(e){e=e??H.EMPTY_OBJECT;let t=e.dimensions,n=h.multiplyByScalar(t,.5,new h);return new Cf({minimum:h.negate(n,new h),maximum:n,vertexFormat:e.vertexFormat,offsetAttribute:e.offsetAttribute})};Cf.fromAxisAlignedBoundingBox=function(e){return new Cf({minimum:e.minimum,maximum:e.maximum})};Cf.packedLength=2*h.packedLength+Be.packedLength+1;Cf.pack=function(e,t,n){return n=n??0,h.pack(e._minimum,t,n),h.pack(e._maximum,t,n+h.packedLength),Be.pack(e._vertexFormat,t,n+2*h.packedLength),t[n+2*h.packedLength+Be.packedLength]=e._offsetAttribute??-1,t};var Qfe=new h,ede=new h,tde=new Be,Zfe={minimum:Qfe,maximum:ede,vertexFormat:tde,offsetAttribute:void 0};Cf.unpack=function(e,t,n){t=t??0;let i=h.unpack(e,t,Qfe),r=h.unpack(e,t+h.packedLength,ede),o=Be.unpack(e,t+2*h.packedLength,tde),s=e[t+2*h.packedLength+Be.packedLength];return l(n)?(n._minimum=h.clone(i,n._minimum),n._maximum=h.clone(r,n._maximum),n._vertexFormat=Be.clone(o,n._vertexFormat),n._offsetAttribute=s===-1?void 0:s,n):(Zfe.offsetAttribute=s===-1?void 0:s,new Cf(Zfe))};Cf.createGeometry=function(e){let t=e._minimum,n=e._maximum,i=e._vertexFormat;if(h.equals(t,n))return;let r=new Tn,o,s;if(i.position&&(i.st||i.normal||i.tangent||i.bitangent)){if(i.position&&(s=new Float64Array(72),s[0]=t.x,s[1]=t.y,s[2]=n.z,s[3]=n.x,s[4]=t.y,s[5]=n.z,s[6]=n.x,s[7]=n.y,s[8]=n.z,s[9]=t.x,s[10]=n.y,s[11]=n.z,s[12]=t.x,s[13]=t.y,s[14]=t.z,s[15]=n.x,s[16]=t.y,s[17]=t.z,s[18]=n.x,s[19]=n.y,s[20]=t.z,s[21]=t.x,s[22]=n.y,s[23]=t.z,s[24]=n.x,s[25]=t.y,s[26]=t.z,s[27]=n.x,s[28]=n.y,s[29]=t.z,s[30]=n.x,s[31]=n.y,s[32]=n.z,s[33]=n.x,s[34]=t.y,s[35]=n.z,s[36]=t.x,s[37]=t.y,s[38]=t.z,s[39]=t.x,s[40]=n.y,s[41]=t.z,s[42]=t.x,s[43]=n.y,s[44]=n.z,s[45]=t.x,s[46]=t.y,s[47]=n.z,s[48]=t.x,s[49]=n.y,s[50]=t.z,s[51]=n.x,s[52]=n.y,s[53]=t.z,s[54]=n.x,s[55]=n.y,s[56]=n.z,s[57]=t.x,s[58]=n.y,s[59]=n.z,s[60]=t.x,s[61]=t.y,s[62]=t.z,s[63]=n.x,s[64]=t.y,s[65]=t.z,s[66]=n.x,s[67]=t.y,s[68]=n.z,s[69]=t.x,s[70]=t.y,s[71]=n.z,r.position=new Ne({componentDatatype:Y.DOUBLE,componentsPerAttribute:3,values:s})),i.normal){let u=new Float32Array(72);u[0]=0,u[1]=0,u[2]=1,u[3]=0,u[4]=0,u[5]=1,u[6]=0,u[7]=0,u[8]=1,u[9]=0,u[10]=0,u[11]=1,u[12]=0,u[13]=0,u[14]=-1,u[15]=0,u[16]=0,u[17]=-1,u[18]=0,u[19]=0,u[20]=-1,u[21]=0,u[22]=0,u[23]=-1,u[24]=1,u[25]=0,u[26]=0,u[27]=1,u[28]=0,u[29]=0,u[30]=1,u[31]=0,u[32]=0,u[33]=1,u[34]=0,u[35]=0,u[36]=-1,u[37]=0,u[38]=0,u[39]=-1,u[40]=0,u[41]=0,u[42]=-1,u[43]=0,u[44]=0,u[45]=-1,u[46]=0,u[47]=0,u[48]=0,u[49]=1,u[50]=0,u[51]=0,u[52]=1,u[53]=0,u[54]=0,u[55]=1,u[56]=0,u[57]=0,u[58]=1,u[59]=0,u[60]=0,u[61]=-1,u[62]=0,u[63]=0,u[64]=-1,u[65]=0,u[66]=0,u[67]=-1,u[68]=0,u[69]=0,u[70]=-1,u[71]=0,r.normal=new Ne({componentDatatype:Y.FLOAT,componentsPerAttribute:3,values:u})}if(i.st){let u=new Float32Array(48);u[0]=0,u[1]=0,u[2]=1,u[3]=0,u[4]=1,u[5]=1,u[6]=0,u[7]=1,u[8]=1,u[9]=0,u[10]=0,u[11]=0,u[12]=0,u[13]=1,u[14]=1,u[15]=1,u[16]=0,u[17]=0,u[18]=1,u[19]=0,u[20]=1,u[21]=1,u[22]=0,u[23]=1,u[24]=1,u[25]=0,u[26]=0,u[27]=0,u[28]=0,u[29]=1,u[30]=1,u[31]=1,u[32]=1,u[33]=0,u[34]=0,u[35]=0,u[36]=0,u[37]=1,u[38]=1,u[39]=1,u[40]=0,u[41]=0,u[42]=1,u[43]=0,u[44]=1,u[45]=1,u[46]=0,u[47]=1,r.st=new Ne({componentDatatype:Y.FLOAT,componentsPerAttribute:2,values:u})}if(i.tangent){let u=new Float32Array(72);u[0]=1,u[1]=0,u[2]=0,u[3]=1,u[4]=0,u[5]=0,u[6]=1,u[7]=0,u[8]=0,u[9]=1,u[10]=0,u[11]=0,u[12]=-1,u[13]=0,u[14]=0,u[15]=-1,u[16]=0,u[17]=0,u[18]=-1,u[19]=0,u[20]=0,u[21]=-1,u[22]=0,u[23]=0,u[24]=0,u[25]=1,u[26]=0,u[27]=0,u[28]=1,u[29]=0,u[30]=0,u[31]=1,u[32]=0,u[33]=0,u[34]=1,u[35]=0,u[36]=0,u[37]=-1,u[38]=0,u[39]=0,u[40]=-1,u[41]=0,u[42]=0,u[43]=-1,u[44]=0,u[45]=0,u[46]=-1,u[47]=0,u[48]=-1,u[49]=0,u[50]=0,u[51]=-1,u[52]=0,u[53]=0,u[54]=-1,u[55]=0,u[56]=0,u[57]=-1,u[58]=0,u[59]=0,u[60]=1,u[61]=0,u[62]=0,u[63]=1,u[64]=0,u[65]=0,u[66]=1,u[67]=0,u[68]=0,u[69]=1,u[70]=0,u[71]=0,r.tangent=new Ne({componentDatatype:Y.FLOAT,componentsPerAttribute:3,values:u})}if(i.bitangent){let u=new Float32Array(72);u[0]=0,u[1]=1,u[2]=0,u[3]=0,u[4]=1,u[5]=0,u[6]=0,u[7]=1,u[8]=0,u[9]=0,u[10]=1,u[11]=0,u[12]=0,u[13]=1,u[14]=0,u[15]=0,u[16]=1,u[17]=0,u[18]=0,u[19]=1,u[20]=0,u[21]=0,u[22]=1,u[23]=0,u[24]=0,u[25]=0,u[26]=1,u[27]=0,u[28]=0,u[29]=1,u[30]=0,u[31]=0,u[32]=1,u[33]=0,u[34]=0,u[35]=1,u[36]=0,u[37]=0,u[38]=1,u[39]=0,u[40]=0,u[41]=1,u[42]=0,u[43]=0,u[44]=1,u[45]=0,u[46]=0,u[47]=1,u[48]=0,u[49]=0,u[50]=1,u[51]=0,u[52]=0,u[53]=1,u[54]=0,u[55]=0,u[56]=1,u[57]=0,u[58]=0,u[59]=1,u[60]=0,u[61]=0,u[62]=1,u[63]=0,u[64]=0,u[65]=1,u[66]=0,u[67]=0,u[68]=1,u[69]=0,u[70]=0,u[71]=1,r.bitangent=new Ne({componentDatatype:Y.FLOAT,componentsPerAttribute:3,values:u})}o=new Uint16Array(36),o[0]=0,o[1]=1,o[2]=2,o[3]=0,o[4]=2,o[5]=3,o[6]=6,o[7]=5,o[8]=4,o[9]=7,o[10]=6,o[11]=4,o[12]=8,o[13]=9,o[14]=10,o[15]=8,o[16]=10,o[17]=11,o[18]=14,o[19]=13,o[20]=12,o[21]=15,o[22]=14,o[23]=12,o[24]=18,o[25]=17,o[26]=16,o[27]=19,o[28]=18,o[29]=16,o[30]=20,o[31]=21,o[32]=22,o[33]=20,o[34]=22,o[35]=23}else s=new Float64Array(24),s[0]=t.x,s[1]=t.y,s[2]=t.z,s[3]=n.x,s[4]=t.y,s[5]=t.z,s[6]=n.x,s[7]=n.y,s[8]=t.z,s[9]=t.x,s[10]=n.y,s[11]=t.z,s[12]=t.x,s[13]=t.y,s[14]=n.z,s[15]=n.x,s[16]=t.y,s[17]=n.z,s[18]=n.x,s[19]=n.y,s[20]=n.z,s[21]=t.x,s[22]=n.y,s[23]=n.z,r.position=new Ne({componentDatatype:Y.DOUBLE,componentsPerAttribute:3,values:s}),o=new Uint16Array(36),o[0]=4,o[1]=5,o[2]=6,o[3]=4,o[4]=6,o[5]=7,o[6]=1,o[7]=0,o[8]=3,o[9]=1,o[10]=3,o[11]=2,o[12]=1,o[13]=6,o[14]=5,o[15]=1,o[16]=2,o[17]=6,o[18]=2,o[19]=3,o[20]=7,o[21]=2,o[22]=7,o[23]=6,o[24]=3,o[25]=0,o[26]=4,o[27]=3,o[28]=4,o[29]=7,o[30]=0,o[31]=1,o[32]=5,o[33]=0,o[34]=5,o[35]=4;let a=h.subtract(n,t,P4e),c=h.magnitude(a)*.5;if(l(e._offsetAttribute)){let u=s.length,f=e._offsetAttribute===mn.NONE?0:1,d=new Uint8Array(u/3).fill(f);r.applyOffset=new Ne({componentDatatype:Y.UNSIGNED_BYTE,componentsPerAttribute:1,values:d})}return new St({attributes:r,indices:o,primitiveType:Oe.TRIANGLES,boundingSphere:new ue(h.ZERO,c),offsetAttribute:e._offsetAttribute})};var lX;Cf.getUnitBox=function(){return l(lX)||(lX=Cf.createGeometry(Cf.fromDimensions({dimensions:new h(1,1,1),vertexFormat:Be.POSITION_ONLY}))),lX};var Ic=Cf;var xr={SCALAR:"SCALAR",VEC2:"VEC2",VEC3:"VEC3",VEC4:"VEC4",MAT2:"MAT2",MAT3:"MAT3",MAT4:"MAT4"};xr.getMathType=function(e){switch(e){case xr.SCALAR:return Number;case xr.VEC2:return U;case xr.VEC3:return h;case xr.VEC4:return se;case xr.MAT2:return Xi;case xr.MAT3:return $;case xr.MAT4:return N}};xr.getNumberOfComponents=function(e){switch(e){case xr.SCALAR:return 1;case xr.VEC2:return 2;case xr.VEC3:return 3;case xr.VEC4:case xr.MAT2:return 4;case xr.MAT3:return 9;case xr.MAT4:return 16}};xr.getAttributeLocationCount=function(e){switch(e){case xr.SCALAR:case xr.VEC2:case xr.VEC3:case xr.VEC4:return 1;case xr.MAT2:return 2;case xr.MAT3:return 3;case xr.MAT4:return 4}};xr.getGlslType=function(e){switch(e){case xr.SCALAR:return"float";case xr.VEC2:return"vec2";case xr.VEC3:return"vec3";case xr.VEC4:return"vec4";case xr.MAT2:return"mat2";case xr.MAT3:return"mat3";case xr.MAT4:return"mat4"}};Object.freeze(xr);var Vt=xr;var nde=1/256,D4e=65536,fX=256,Lr={};Lr.octEncodeInRange=function(e,t,n){if(n.x=e.x/(Math.abs(e.x)+Math.abs(e.y)+Math.abs(e.z)),n.y=e.y/(Math.abs(e.x)+Math.abs(e.y)+Math.abs(e.z)),e.z<0){let i=n.x,r=n.y;n.x=(1-Math.abs(r))*D.signNotZero(i),n.y=(1-Math.abs(i))*D.signNotZero(r)}return n.x=D.toSNorm(n.x,t),n.y=D.toSNorm(n.y,t),n};Lr.octEncode=function(e,t){return Lr.octEncodeInRange(e,255,t)};var wD=new U,ide=new Uint8Array(1);function r6(e){return ide[0]=e,ide[0]}Lr.octEncodeToCartesian4=function(e,t){return Lr.octEncodeInRange(e,65535,wD),t.x=r6(wD.x*nde),t.y=r6(wD.x),t.z=r6(wD.y*nde),t.w=r6(wD.y),t};Lr.octDecodeInRange=function(e,t,n,i){if(i.x=D.fromSNorm(e,n),i.y=D.fromSNorm(t,n),i.z=1-(Math.abs(i.x)+Math.abs(i.y)),i.z<0){let r=i.x;i.x=(1-Math.abs(i.y))*D.signNotZero(r),i.y=(1-Math.abs(r))*D.signNotZero(i.y)}return h.normalize(i,i)};Lr.octDecode=function(e,t,n){return Lr.octDecodeInRange(e,t,255,n)};Lr.octDecodeFromCartesian4=function(e,t){let n=e.x,i=e.y,r=e.z,o=e.w,s=n*fX+i,a=r*fX+o;return Lr.octDecodeInRange(s,a,65535,t)};Lr.octPackFloat=function(e){return 256*e.x+e.y};var dX=new U;Lr.octEncodeFloat=function(e){return Lr.octEncode(e,dX),Lr.octPackFloat(dX)};Lr.octDecodeFloat=function(e,t){let n=e/256,i=Math.floor(n),r=(n-i)*256;return Lr.octDecode(i,r,t)};Lr.octPack=function(e,t,n,i){let r=Lr.octEncodeFloat(e),o=Lr.octEncodeFloat(t),s=Lr.octEncode(n,dX);return i.x=65536*s.x+r,i.y=65536*s.y+o,i};Lr.octUnpack=function(e,t,n,i){let r=e.x/65536,o=Math.floor(r),s=(r-o)*65536;r=e.y/65536;let a=Math.floor(r),c=(r-a)*65536;Lr.octDecodeFloat(s,t),Lr.octDecodeFloat(c,n),Lr.octDecode(o,a,i)};Lr.compressTextureCoordinates=function(e){let t=e.x*4095|0,n=e.y*4095|0;return 4096*t+n};Lr.decompressTextureCoordinates=function(e,t){let n=e/4096,i=Math.floor(n);return t.x=i/4095,t.y=(e-i*4096)/4095,t};function uX(e){return e>>1^-(e&1)}Lr.zigZagDeltaDecode=function(e,t,n){let i=e.length,r=0,o=0,s=0;for(let a=0;a<i;++a)r+=uX(e[a]),o+=uX(t[a]),e[a]=r,t[a]=o,l(n)&&(s+=uX(n[a]),n[a]=s)};Lr.dequantize=function(e,t,n,i){let r=Vt.getNumberOfComponents(n),o;switch(t){case Y.BYTE:o=127;break;case Y.UNSIGNED_BYTE:o=255;break;case Y.SHORT:o=32767;break;case Y.UNSIGNED_SHORT:o=65535;break;case Y.INT:o=2147483647;break;case Y.UNSIGNED_INT:o=4294967295;break}let s=new Float32Array(i*r);for(let a=0;a<i;a++)for(let c=0;c<r;c++){let u=a*r+c;s[u]=Math.max(e[u]/o,-1)}return s};Lr.encodeRGB8=function(e){return Math.round(D.clamp(e.red*255,0,255))*D4e+Math.round(D.clamp(e.green*255,0,255))*fX+Math.round(D.clamp(e.blue*255,0,255))};Lr.decodeRGB8=function(e,t){return e=Math.floor(e),t.red=(e>>16&255)/255,t.green=(e>>8&255)/255,t.blue=(e&255)/255,t};Lr.decodeRGB565=function(e,t){let n=e.length;l(t)||(t=new Float32Array(n*3));let i=31,r=63,o=1/31,s=1/63;for(let a=0;a<n;a++){let c=e[a],u=c>>11,f=c>>5&r,d=c&i,p=3*a;t[p]=u*o,t[p+1]=f*s,t[p+2]=d*o}return t};var cn=Lr;var rde=new h,ode=new h,sde=new h;function R4e(e,t,n,i,r){l(r)||(r=new h);let o,s,a,c,u,f,d,p;if(l(t.z)){if(h.equalsEpsilon(e,t,D.EPSILON14))return h.clone(h.UNIT_X,r);if(h.equalsEpsilon(e,n,D.EPSILON14))return h.clone(h.UNIT_Y,r);if(h.equalsEpsilon(e,i,D.EPSILON14))return h.clone(h.UNIT_Z,r);o=h.subtract(n,t,rde),s=h.subtract(i,t,ode),a=h.subtract(e,t,sde),c=h.dot(o,o),u=h.dot(o,s),f=h.dot(o,a),d=h.dot(s,s),p=h.dot(s,a)}else{if(U.equalsEpsilon(e,t,D.EPSILON14))return h.clone(h.UNIT_X,r);if(U.equalsEpsilon(e,n,D.EPSILON14))return h.clone(h.UNIT_Y,r);if(U.equalsEpsilon(e,i,D.EPSILON14))return h.clone(h.UNIT_Z,r);o=U.subtract(n,t,rde),s=U.subtract(i,t,ode),a=U.subtract(e,t,sde),c=U.dot(o,o),u=U.dot(o,s),f=U.dot(o,a),d=U.dot(s,s),p=U.dot(s,a)}r.y=d*f-u*p,r.z=c*p-u*f;let g=c*d-u*u;if(g!==0)return r.y/=g,r.z/=g,r.x=1-r.y-r.z,r}var dx=R4e;function Mp(){this.high=h.clone(h.ZERO),this.low=h.clone(h.ZERO)}Mp.encode=function(e,t){l(t)||(t={high:0,low:0});let n;return e>=0?(n=Math.floor(e/65536)*65536,t.high=n,t.low=e-n):(n=Math.floor(-e/65536)*65536,t.high=-n,t.low=e+n),t};var ug={high:0,low:0};Mp.fromCartesian=function(e,t){l(t)||(t=new Mp);let n=t.high,i=t.low;return Mp.encode(e.x,ug),n.x=ug.high,i.x=ug.low,Mp.encode(e.y,ug),n.y=ug.high,i.y=ug.low,Mp.encode(e.z,ug),n.z=ug.high,i.z=ug.low,t};var hX=new Mp;Mp.writeElements=function(e,t,n){Mp.fromCartesian(e,hX);let i=hX.high,r=hX.low;t[n]=i.x,t[n+1]=i.y,t[n+2]=i.z,t[n+3]=r.x,t[n+4]=r.y,t[n+5]=r.z};var Sn=Mp;var mX={};mX.computeDiscriminant=function(e,t,n){return t*t-4*e*n};function ade(e,t,n){let i=e+t;return D.sign(e)!==D.sign(t)&&Math.abs(i/Math.max(Math.abs(e),Math.abs(t)))<n?0:i}mX.computeRealRoots=function(e,t,n){let i;if(e===0)return t===0?[]:[-n/t];if(t===0){if(n===0)return[0,0];let c=Math.abs(n),u=Math.abs(e);if(c<u&&c/u<D.EPSILON14)return[0,0];if(c>u&&u/c<D.EPSILON14)return[];if(i=-n/e,i<0)return[];let f=Math.sqrt(i);return[-f,f]}else if(n===0)return i=-t/e,i<0?[i,0]:[0,i];let r=t*t,o=4*e*n,s=ade(r,-o,D.EPSILON14);if(s<0)return[];let a=-.5*ade(t,D.sign(t)*Math.sqrt(s),D.EPSILON14);return t>0?[a/e,n/a]:[n/a,a/e]};var Ul=mX;var gX={};gX.computeDiscriminant=function(e,t,n,i){let r=e*e,o=t*t,s=n*n,a=i*i;return 18*e*t*n*i+o*s-27*r*a-4*(e*s*n+o*t*i)};function pX(e,t,n,i){let r=e,o=t/3,s=n/3,a=i,c=r*s,u=o*a,f=o*o,d=s*s,p=r*s-f,g=r*a-o*s,m=o*a-d,y=4*p*m-g*g,A,b;if(y<0){let G,q,Q;f*u>=c*d?(G=r,q=p,Q=-2*o*p+r*g):(G=a,q=m,Q=-a*g+2*s*m);let J=-(Q<0?-1:1)*Math.abs(G)*Math.sqrt(-y);b=-Q+J;let Z=b/2,ae=Z<0?-Math.pow(-Z,1/3):Math.pow(Z,1/3),Ae=b===J?-ae:-q/ae;return A=q<=0?ae+Ae:-Q/(ae*ae+Ae*Ae+q),f*u>=c*d?[(A-o)/r]:[-a/(A+s)]}let x=p,T=-2*o*p+r*g,E=m,v=-a*g+2*s*m,S=Math.sqrt(y),I=Math.sqrt(3)/2,R=Math.abs(Math.atan2(r*S,-T)/3);A=2*Math.sqrt(-x);let O=Math.cos(R);b=A*O;let L=A*(-O/2-I*Math.sin(R)),_=b+L>2*o?b-o:L-o,C=r,w=_/C;R=Math.abs(Math.atan2(a*S,-v)/3),A=2*Math.sqrt(-E),O=Math.cos(R),b=A*O,L=A*(-O/2-I*Math.sin(R));let P=-a,M=b+L<2*s?b+s:L+s,F=P/M,V=C*M,B=-_*M-C*P,j=_*P,k=(s*B-o*j)/(-o*B+s*V);return w<=k?w<=F?k<=F?[w,k,F]:[w,F,k]:[F,w,k]:w<=F?[k,w,F]:k<=F?[k,F,w]:[F,k,w]}gX.computeRealRoots=function(e,t,n,i){let r,o;if(e===0)return Ul.computeRealRoots(t,n,i);if(t===0){if(n===0){if(i===0)return[0,0,0];o=-i/e;let s=o<0?-Math.pow(-o,1/3):Math.pow(o,1/3);return[s,s,s]}else if(i===0)return r=Ul.computeRealRoots(e,0,n),r.Length===0?[0]:[r[0],0,r[1]];return pX(e,0,n,i)}else{if(n===0)return i===0?(o=-t/e,o<0?[o,0,0]:[0,0,o]):pX(e,t,0,i);if(i===0)return r=Ul.computeRealRoots(e,t,n),r.length===0?[0]:r[1]<=0?[r[0],r[1],0]:r[0]>=0?[0,r[0],r[1]]:[r[0],0,r[1]]}return pX(e,t,n,i)};var hx=gX;var _X={};_X.computeDiscriminant=function(e,t,n,i,r){let o=e*e,s=o*e,a=t*t,c=a*t,u=n*n,f=u*n,d=i*i,p=d*i,g=r*r,m=g*r;return a*u*d-4*c*p-4*e*f*d+18*e*t*n*p-27*o*d*d+256*s*m+r*(18*c*n*i-4*a*f+16*e*u*u-80*e*t*u*i-6*e*a*d+144*o*n*d)+g*(144*e*a*n-27*a*a-128*o*u-192*o*t*i)};function jh(e,t,n,i){let r=e*e,o=t-3*r/8,s=n-t*e/2+r*e/8,a=i-n*e/4+t*r/16-3*r*r/256,c=hx.computeRealRoots(1,2*o,o*o-4*a,-s*s);if(c.length>0){let u=-e/4,f=c[c.length-1];if(Math.abs(f)<D.EPSILON14){let d=Ul.computeRealRoots(1,o,a);if(d.length===2){let p=d[0],g=d[1],m;if(p>=0&&g>=0){let y=Math.sqrt(p),A=Math.sqrt(g);return[u-A,u-y,u+y,u+A]}else{if(p>=0&&g<0)return m=Math.sqrt(p),[u-m,u+m];if(p<0&&g>=0)return m=Math.sqrt(g),[u-m,u+m]}}return[]}else if(f>0){let d=Math.sqrt(f),p=(o+f-s/d)/2,g=(o+f+s/d)/2,m=Ul.computeRealRoots(1,d,p),y=Ul.computeRealRoots(1,-d,g);return m.length!==0?(m[0]+=u,m[1]+=u,y.length!==0?(y[0]+=u,y[1]+=u,m[1]<=y[0]?[m[0],m[1],y[0],y[1]]:y[1]<=m[0]?[y[0],y[1],m[0],m[1]]:m[0]>=y[0]&&m[1]<=y[1]?[y[0],m[0],m[1],y[1]]:y[0]>=m[0]&&y[1]<=m[1]?[m[0],y[0],y[1],m[1]]:m[0]>y[0]&&m[0]<y[1]?[y[0],m[0],y[1],m[1]]:[m[0],y[0],m[1],y[1]]):m):y.length!==0?(y[0]+=u,y[1]+=u,y):[]}}return[]}function ID(e,t,n,i){let r=n*n,o=t*t,s=e*e,a=-2*t,c=n*e+o-4*i,u=s*i-n*t*e+r,f=hx.computeRealRoots(1,a,c,u);if(f.length>0){let d=f[0],p=t-d,g=p*p,m=e/2,y=p/2,A=g-4*i,b=g+4*Math.abs(i),x=s-4*d,T=s+4*Math.abs(d),E,v;if(d<0||A*T<x*b){let C=Math.sqrt(x);E=C/2,v=C===0?0:(e*y-n)/C}else{let C=Math.sqrt(A);E=C===0?0:(e*y-n)/C,v=C/2}let S,I;m===0&&E===0?(S=0,I=0):D.sign(m)===D.sign(E)?(S=m+E,I=d/S):(I=m-E,S=d/I);let R,O;y===0&&v===0?(R=0,O=0):D.sign(y)===D.sign(v)?(R=y+v,O=i/R):(O=y-v,R=i/O);let L=Ul.computeRealRoots(1,S,R),_=Ul.computeRealRoots(1,I,O);if(L.length!==0)return _.length!==0?L[1]<=_[0]?[L[0],L[1],_[0],_[1]]:_[1]<=L[0]?[_[0],_[1],L[0],L[1]]:L[0]>=_[0]&&L[1]<=_[1]?[_[0],L[0],L[1],_[1]]:_[0]>=L[0]&&_[1]<=L[1]?[L[0],_[0],_[1],L[1]]:L[0]>_[0]&&L[0]<_[1]?[_[0],L[0],_[1],L[1]]:[L[0],_[0],L[1],_[1]]:L;if(_.length!==0)return _}return[]}_X.computeRealRoots=function(e,t,n,i,r){if(Math.abs(e)<D.EPSILON15)return hx.computeRealRoots(t,n,i,r);let o=t/e,s=n/e,a=i/e,c=r/e,u=o<0?1:0;switch(u+=s<0?u+1:u,u+=a<0?u+1:u,u+=c<0?u+1:u,u){case 0:return jh(o,s,a,c);case 1:return ID(o,s,a,c);case 2:return ID(o,s,a,c);case 3:return jh(o,s,a,c);case 4:return jh(o,s,a,c);case 5:return ID(o,s,a,c);case 6:return jh(o,s,a,c);case 7:return jh(o,s,a,c);case 8:return ID(o,s,a,c);case 9:return jh(o,s,a,c);case 10:return jh(o,s,a,c);case 11:return ID(o,s,a,c);case 12:return jh(o,s,a,c);case 13:return jh(o,s,a,c);case 14:return jh(o,s,a,c);case 15:return jh(o,s,a,c);default:return}};var PD=_X;var yX=class e{constructor(t,n){n=h.clone(n??h.ZERO),h.equals(n,h.ZERO)||h.normalize(n,n),this.origin=h.clone(t??h.ZERO),this.direction=n}static clone(t,n){if(l(t))return l(n)?(n.origin=h.clone(t.origin),n.direction=h.clone(t.direction),n):new e(t.origin,t.direction)}static getPoint(t,n,i){return l(i)||(i=new h),i=h.multiplyByScalar(t.direction,n,i),h.add(t.origin,i,i)}},pn=yX;var io={};io.rayPlane=function(e,t,n){l(n)||(n=new h);let i=e.origin,r=e.direction,o=t.normal,s=h.dot(o,r);if(Math.abs(s)<D.EPSILON15)return;let a=(-t.distance-h.dot(o,i))/s;if(!(a<0))return n=h.multiplyByScalar(r,a,n),h.add(i,n,n)};var O4e=new h,M4e=new h,pde=new h,cde=new h,lde=new h;io.rayTriangleParametric=function(e,t,n,i,r){r=r??!1;let o=e.origin,s=e.direction,a=h.subtract(n,t,O4e),c=h.subtract(i,t,M4e),u=h.cross(s,c,pde),f=h.dot(a,u),d,p,g,m,y;if(r){if(f<D.EPSILON6||(d=h.subtract(o,t,cde),g=h.dot(d,u),g<0||g>f)||(p=h.cross(d,a,lde),m=h.dot(s,p),m<0||g+m>f))return;y=h.dot(c,p)/f}else{if(Math.abs(f)<D.EPSILON6)return;let A=1/f;if(d=h.subtract(o,t,cde),g=h.dot(d,u)*A,g<0||g>1||(p=h.cross(d,a,lde),m=h.dot(s,p)*A,m<0||g+m>1))return;y=h.dot(c,p)*A}return y};io.rayTriangle=function(e,t,n,i,r,o){let s=io.rayTriangleParametric(e,t,n,i,r);if(!(!l(s)||s<0))return l(o)||(o=new h),h.multiplyByScalar(e.direction,s,o),h.add(e.origin,o,o)};var N4e=new pn;io.lineSegmentTriangle=function(e,t,n,i,r,o,s){let a=N4e;h.clone(e,a.origin),h.subtract(t,e,a.direction),h.normalize(a.direction,a.direction);let c=io.rayTriangleParametric(a,n,i,r,o);if(!(!l(c)||c<0||c>h.distance(e,t)))return l(s)||(s=new h),h.multiplyByScalar(a.direction,c,s),h.add(a.origin,s,s)};function L4e(e,t,n,i){let r=t*t-4*e*n;if(r<0)return;if(r>0){let s=1/(2*e),a=Math.sqrt(r),c=(-t+a)*s,u=(-t-a)*s;return c<u?(i.root0=c,i.root1=u):(i.root0=u,i.root1=c),i}let o=-t/(2*e);if(o!==0)return i.root0=i.root1=o,i}var F4e={root0:0,root1:0};function gde(e,t,n){l(n)||(n=new Us);let i=e.origin,r=e.direction,o=t.center,s=t.radius*t.radius,a=h.subtract(i,o,pde),c=h.dot(r,r),u=2*h.dot(r,a),f=h.magnitudeSquared(a)-s,d=L4e(c,u,f,F4e);if(l(d))return n.start=d.root0,n.stop=d.root1,n}io.raySphere=function(e,t,n){if(n=gde(e,t,n),!(!l(n)||n.stop<0))return n.start=Math.max(n.start,0),n};var B4e=new pn;io.lineSegmentSphere=function(e,t,n,i){let r=B4e;h.clone(e,r.origin);let o=h.subtract(t,e,r.direction),s=h.magnitude(o);if(h.normalize(o,o),i=gde(r,n,i),!(!l(i)||i.stop<0||i.start>s))return i.start=Math.max(i.start,0),i.stop=Math.min(i.stop,s),i};var k4e=new h,U4e=new h;io.rayEllipsoid=function(e,t){let n=t.oneOverRadii,i=h.multiplyComponents(n,e.origin,k4e),r=h.multiplyComponents(n,e.direction,U4e),o=h.magnitudeSquared(i),s=h.dot(i,r),a,c,u,f,d;if(o>1){if(s>=0)return;let p=s*s;if(a=o-1,c=h.magnitudeSquared(r),u=c*a,p<u)return;if(p>u){f=s*s-u,d=-s+Math.sqrt(f);let m=d/c,y=a/d;return m<y?new Us(m,y):{start:y,stop:m}}let g=Math.sqrt(a/c);return new Us(g,g)}else if(o<1)return a=o-1,c=h.magnitudeSquared(r),u=c*a,f=s*s-u,d=-s+Math.sqrt(f),new Us(0,d/c);if(s<0)return c=h.magnitudeSquared(r),new Us(0,-s/c)};var z4e=new Us,V4e=new Us,j4e=new Us;io.rayAxisAlignedBoundingBox=function(e,t,n){l(n)||(n=new Us);let i=AX(e.origin.x,e.direction.x,t.minimum.x,t.maximum.x,z4e),r=AX(e.origin.y,e.direction.y,t.minimum.y,t.maximum.y,V4e),o=AX(e.origin.z,e.direction.z,t.minimum.z,t.maximum.z,j4e);if(n.start=i.start>r.start?i.start:r.start,n.stop=i.stop<r.stop?i.stop:r.stop,!(i.start>r.stop||r.start>i.stop)&&!(n.start>o.stop||o.start>n.stop))return o.start>n.start&&(n.start=o.start),o.stop<n.stop&&(n.stop=o.stop),n};function AX(e,t,n,i,r){if(r.start=(n-e)/t,r.stop=(i-e)/t,r.stop<r.start){let o=r.stop;r.stop=r.start,r.start=o}return r}function mx(e,t,n){let i=e+t;return D.sign(e)!==D.sign(t)&&Math.abs(i/Math.max(Math.abs(e),Math.abs(t)))<n?0:i}io.quadraticVectorExpression=function(e,t,n,i,r){let o=i*i,s=r*r,a=(e[$.COLUMN1ROW1]-e[$.COLUMN2ROW2])*s,c=r*(i*mx(e[$.COLUMN1ROW0],e[$.COLUMN0ROW1],D.EPSILON15)+t.y),u=e[$.COLUMN0ROW0]*o+e[$.COLUMN2ROW2]*s+i*t.x+n,f=s*mx(e[$.COLUMN2ROW1],e[$.COLUMN1ROW2],D.EPSILON15),d=r*(i*mx(e[$.COLUMN2ROW0],e[$.COLUMN0ROW2])+t.z),p,g=[];if(d===0&&f===0){if(p=Ul.computeRealRoots(a,c,u),p.length===0)return g;let R=p[0],O=Math.sqrt(Math.max(1-R*R,0));if(g.push(new h(i,r*R,r*-O)),g.push(new h(i,r*R,r*O)),p.length===2){let L=p[1],_=Math.sqrt(Math.max(1-L*L,0));g.push(new h(i,r*L,r*-_)),g.push(new h(i,r*L,r*_))}return g}let m=d*d,y=f*f,A=a*a,b=d*f,x=A+y,T=2*(c*a+b),E=2*u*a+c*c-y+m,v=2*(u*c-b),S=u*u-m;if(x===0&&T===0&&E===0&&v===0)return g;p=PD.computeRealRoots(x,T,E,v,S);let I=p.length;if(I===0)return g;for(let R=0;R<I;++R){let O=p[R],L=O*O,_=Math.max(1-L,0),C=Math.sqrt(_),w;D.sign(a)===D.sign(u)?w=mx(a*L+u,c*O,D.EPSILON12):D.sign(u)===D.sign(c*O)?w=mx(a*L,c*O+u,D.EPSILON12):w=mx(a*L+c*O,u,D.EPSILON12);let P=mx(f*O,d,D.EPSILON15),M=w*P;M<0?g.push(new h(i,r*O,r*C)):M>0?g.push(new h(i,r*O,r*-C)):C!==0?(g.push(new h(i,r*O,r*-C)),g.push(new h(i,r*O,r*C)),++R):g.push(new h(i,r*O,r*C))}return g};var bX=new h,ude=new h,fde=new h,o6=new h,H4e=new h,G4e=new $,W4e=new $,q4e=new $,Y4e=new $,X4e=new $,dde=new $,hde=new $,mde=new h,K4e=new h,$4e=new he;io.grazingAltitudeLocation=function(e,t){let n=e.origin,i=e.direction;if(!h.equals(n,h.ZERO)){let S=t.geodeticSurfaceNormal(n,bX);if(h.dot(i,S)>=0)return n}let r=l(this.rayEllipsoid(e,t)),o=t.transformPositionToScaledSpace(i,bX),s=h.normalize(o,o),a=h.mostOrthogonalAxis(o,o6),c=h.normalize(h.cross(a,s,ude),ude),u=h.normalize(h.cross(s,c,fde),fde),f=G4e;f[0]=s.x,f[1]=s.y,f[2]=s.z,f[3]=c.x,f[4]=c.y,f[5]=c.z,f[6]=u.x,f[7]=u.y,f[8]=u.z;let d=$.transpose(f,W4e),p=$.fromScale(t.radii,q4e),g=$.fromScale(t.oneOverRadii,Y4e),m=X4e;m[0]=0,m[1]=-i.z,m[2]=i.y,m[3]=i.z,m[4]=0,m[5]=-i.x,m[6]=-i.y,m[7]=i.x,m[8]=0;let y=$.multiply($.multiply(d,g,dde),m,dde),A=$.multiply($.multiply(y,p,hde),f,hde),b=$.multiplyByVector(y,n,H4e),x=io.quadraticVectorExpression(A,h.negate(b,bX),0,0,1),T,E,v=x.length;if(v>0){let S=h.clone(h.ZERO,K4e),I=Number.NEGATIVE_INFINITY;for(let O=0;O<v;++O){T=$.multiplyByVector(p,$.multiplyByVector(f,x[O],mde),mde);let L=h.normalize(h.subtract(T,n,o6),o6),_=h.dot(L,i);_>I&&(I=_,S=h.clone(T,S))}let R=t.cartesianToCartographic(S,$4e);return I=D.clamp(I,0,1),E=h.magnitude(h.subtract(S,n,o6))*Math.sqrt(1-I*I),E=r?-E:E,R.height=E,t.cartographicToCartesian(R,new h)}};var J4e=new h;io.lineSegmentPlane=function(e,t,n,i){l(i)||(i=new h);let r=h.subtract(t,e,J4e),o=n.normal,s=h.dot(o,r);if(Math.abs(s)<D.EPSILON6)return;let a=h.dot(o,e),c=-(n.distance+a)/s;if(!(c<0||c>1))return h.multiplyByScalar(r,c,i),h.add(e,i,i),i};io.trianglePlaneIntersection=function(e,t,n,i){let r=i.normal,o=i.distance,s=h.dot(r,e)+o<0,a=h.dot(r,t)+o<0,c=h.dot(r,n)+o<0,u=0;u+=s?1:0,u+=a?1:0,u+=c?1:0;let f,d;if((u===1||u===2)&&(f=new h,d=new h),u===1){if(s)return io.lineSegmentPlane(e,t,i,f),io.lineSegmentPlane(e,n,i,d),{positions:[e,t,n,f,d],indices:[0,3,4,1,2,4,1,4,3]};if(a)return io.lineSegmentPlane(t,n,i,f),io.lineSegmentPlane(t,e,i,d),{positions:[e,t,n,f,d],indices:[1,3,4,2,0,4,2,4,3]};if(c)return io.lineSegmentPlane(n,e,i,f),io.lineSegmentPlane(n,t,i,d),{positions:[e,t,n,f,d],indices:[2,3,4,0,1,4,0,4,3]}}else if(u===2)if(s)if(a){if(!c)return io.lineSegmentPlane(e,n,i,f),io.lineSegmentPlane(t,n,i,d),{positions:[e,t,n,f,d],indices:[0,1,4,0,4,3,2,3,4]}}else return io.lineSegmentPlane(n,t,i,f),io.lineSegmentPlane(e,t,i,d),{positions:[e,t,n,f,d],indices:[2,0,4,2,4,3,1,3,4]};else return io.lineSegmentPlane(t,e,i,f),io.lineSegmentPlane(n,e,i,d),{positions:[e,t,n,f,d],indices:[1,2,4,1,4,3,0,3,4]}};var _i=io;function Na(e,t){this.normal=h.clone(e),this.distance=t}Na.fromPointNormal=function(e,t,n){let i=-h.dot(t,e);return l(n)?(h.clone(t,n.normal),n.distance=i,n):new Na(t,i)};var Z4e=new h;Na.fromCartesian4=function(e,t){let n=h.fromCartesian4(e,Z4e),i=e.w;return l(t)?(h.clone(n,t.normal),t.distance=i,t):new Na(n,i)};Na.getPointDistance=function(e,t){return h.dot(e.normal,t)+e.distance};var Q4e=new h;Na.projectPointOntoPlane=function(e,t,n){l(n)||(n=new h);let i=Na.getPointDistance(e,t),r=h.multiplyByScalar(e.normal,i,Q4e);return h.subtract(t,r,n)};var e8e=new N,t8e=new se,n8e=new h;Na.transform=function(e,t,n){let i=e.normal,r=e.distance,o=N.inverseTranspose(t,e8e),s=se.fromElements(i.x,i.y,i.z,r,t8e);s=N.multiplyByVector(o,s,s);let a=h.fromCartesian4(s,n8e);return s=se.divideByScalar(s,h.magnitude(a),s),Na.fromCartesian4(s,n)};Na.clone=function(e,t){return l(t)?(h.clone(e.normal,t.normal),t.distance=e.distance,t):new Na(e.normal,e.distance)};Na.equals=function(e,t){return e.distance===t.distance&&h.equals(e.normal,t.normal)};Na.ORIGIN_XY_PLANE=Object.freeze(new Na(h.UNIT_Z,0));Na.ORIGIN_YZ_PLANE=Object.freeze(new Na(h.UNIT_X,0));Na.ORIGIN_ZX_PLANE=Object.freeze(new Na(h.UNIT_Y,0));var sn=Na;var xX={};xX.calculateACMR=function(e){e=e??H.EMPTY_OBJECT;let t=e.indices,n=e.maximumIndex,i=e.cacheSize??24,r=t.length;if(!l(n)){n=0;let a=0,c=t[a];for(;a<r;)c>n&&(n=c),++a,c=t[a]}let o=[];for(let a=0;a<n+1;a++)o[a]=0;let s=i+1;for(let a=0;a<r;++a)s-o[t[a]]>i&&(o[t[a]]=s,++s);return(s-i+1)/(r/3)};xX.tipsify=function(e){e=e??H.EMPTY_OBJECT;let t=e.indices,n=e.maximumIndex,i=e.cacheSize??24,r;function o(_,C,w,P){for(;C.length>=1;){let M=C[C.length-1];if(C.splice(C.length-1,1),_[M].numLiveTriangles>0)return M}for(;r<P;){if(_[r].numLiveTriangles>0)return++r,r-1;++r}return-1}function s(_,C,w,P,M,F,V){let B=-1,j,k=-1,G=0;for(;G<w.length;){let q=w[G];P[q].numLiveTriangles&&(j=0,M-P[q].timeStamp+2*P[q].numLiveTriangles<=C&&(j=M-P[q].timeStamp),(j>k||k===-1)&&(k=j,B=q)),++G}return B===-1?o(P,F,_,V):B}let a=t.length,c=0,u=0,f=t[u],d=a;if(l(n))c=n+1;else{for(;u<d;)f>c&&(c=f),++u,f=t[u];if(c===-1)return 0;++c}let p=[],g;for(g=0;g<c;g++)p[g]={numLiveTriangles:0,timeStamp:0,vertexTriangles:[]};u=0;let m=0;for(;u<d;)p[t[u]].vertexTriangles.push(m),++p[t[u]].numLiveTriangles,p[t[u+1]].vertexTriangles.push(m),++p[t[u+1]].numLiveTriangles,p[t[u+2]].vertexTriangles.push(m),++p[t[u+2]].numLiveTriangles,++m,u+=3;let y=0,A=i+1;r=1;let b,x=[],T,E,v=0,S=[],I=a/3,R=[];for(g=0;g<I;g++)R[g]=!1;let O,L;for(;y!==-1;){b=[],E=p[y],L=E.vertexTriangles.length;for(let _=0;_<L;++_)if(m=E.vertexTriangles[_],!R[m]){R[m]=!0,u=m+m+m;for(let C=0;C<3;++C)O=t[u],b.push(O),x.push(O),S[v]=O,++v,T=p[O],--T.numLiveTriangles,A-T.timeStamp>i&&(T.timeStamp=A,++A),++u}y=s(t,i,b,p,A,x,c)}return S};var DD=xX;var zl={};function d6(e,t,n,i,r){e[t++]=n,e[t++]=i,e[t++]=i,e[t++]=r,e[t++]=r,e[t]=n}function i8e(e){let t=e.length,n=t/3*6,i=je.createTypedArray(t,n),r=0;for(let o=0;o<t;o+=3,r+=6)d6(i,r,e[o],e[o+1],e[o+2]);return i}function r8e(e){let t=e.length;if(t>=3){let n=(t-2)*6,i=je.createTypedArray(t,n);d6(i,0,e[0],e[1],e[2]);let r=6;for(let o=3;o<t;++o,r+=6)d6(i,r,e[o-1],e[o],e[o-2]);return i}return new Uint16Array}function o8e(e){if(e.length>0){let t=e.length-1,n=(t-1)*6,i=je.createTypedArray(t,n),r=e[0],o=0;for(let s=1;s<t;++s,o+=6)d6(i,o,r,e[s],e[s+1]);return i}return new Uint16Array}zl.toWireframe=function(e){let t=e.indices;if(l(t)){switch(e.primitiveType){case Oe.TRIANGLES:e.indices=i8e(t);break;case Oe.TRIANGLE_STRIP:e.indices=r8e(t);break;case Oe.TRIANGLE_FAN:e.indices=o8e(t);break}e.primitiveType=Oe.LINES}return e};zl.createLineSegmentsForVectors=function(e,t,n){t=t??"normal",n=n??1e4;let i=e.attributes.position.values,r=e.attributes[t].values,o=i.length,s=new Float64Array(2*o),a=0;for(let f=0;f<o;f+=3)s[a++]=i[f],s[a++]=i[f+1],s[a++]=i[f+2],s[a++]=i[f]+r[f]*n,s[a++]=i[f+1]+r[f+1]*n,s[a++]=i[f+2]+r[f+2]*n;let c,u=e.boundingSphere;return l(u)&&(c=new ue(u.center,u.radius+n)),new St({attributes:{position:new Ne({componentDatatype:Y.DOUBLE,componentsPerAttribute:3,values:s})},primitiveType:Oe.LINES,boundingSphere:c})};zl.createAttributeLocations=function(e){let t=["position","positionHigh","positionLow","position3DHigh","position3DLow","position2DHigh","position2DLow","pickColor","normal","st","tangent","bitangent","extrudeDirection","compressedAttributes"],n=e.attributes,i={},r=0,o,s=t.length;for(o=0;o<s;++o){let a=t[o];l(n[a])&&(i[a]=r++)}for(let a in n)n.hasOwnProperty(a)&&!l(i[a])&&(i[a]=r++);return i};zl.reorderForPreVertexCache=function(e){let t=St.computeNumberOfVertices(e),n=e.indices;if(l(n)){let i=new Int32Array(t);for(let p=0;p<t;p++)i[p]=-1;let r=n,o=r.length,s=je.createTypedArray(t,o),a=0,c=0,u=0,f;for(;a<o;)f=i[r[a]],f!==-1?s[c]=f:(f=r[a],i[f]=u,s[c]=u,++u),++a,++c;e.indices=s;let d=e.attributes;for(let p in d)if(d.hasOwnProperty(p)&&l(d[p])&&l(d[p].values)){let g=d[p],m=g.values,y=0,A=g.componentsPerAttribute,b=Y.createTypedArray(g.componentDatatype,u*A);for(;y<t;){let x=i[y];if(x!==-1)for(let T=0;T<A;T++)b[A*x+T]=m[A*y+T];++y}g.values=b}}return e};zl.reorderForPostVertexCache=function(e,t){let n=e.indices;if(e.primitiveType===Oe.TRIANGLES&&l(n)){let i=n.length,r=0;for(let o=0;o<i;o++)n[o]>r&&(r=n[o]);e.indices=DD.tipsify({indices:n,maximumIndex:r,cacheSize:t})}return e};function _de(e){let t={};for(let n in e)if(e.hasOwnProperty(n)&&l(e[n])&&l(e[n].values)){let i=e[n];t[n]=new Ne({componentDatatype:i.componentDatatype,componentsPerAttribute:i.componentsPerAttribute,normalize:i.normalize,values:[]})}return t}function s8e(e,t,n){for(let i in t)if(t.hasOwnProperty(i)&&l(t[i])&&l(t[i].values)){let r=t[i];for(let o=0;o<r.componentsPerAttribute;++o)e[i].values.push(r.values[n*r.componentsPerAttribute+o])}}zl.fitToUnsignedShortIndices=function(e){let t=[],n=St.computeNumberOfVertices(e);if(l(e.indices)&&n>=D.SIXTY_FOUR_KILOBYTES){let i=[],r=[],o=0,s=_de(e.attributes),a=e.indices,c=a.length,u;e.primitiveType===Oe.TRIANGLES?u=3:e.primitiveType===Oe.LINES?u=2:e.primitiveType===Oe.POINTS&&(u=1);for(let f=0;f<c;f+=u){for(let d=0;d<u;++d){let p=a[f+d],g=i[p];l(g)||(g=o++,i[p]=g,s8e(s,e.attributes,p)),r.push(g)}o+u>=D.SIXTY_FOUR_KILOBYTES&&(t.push(new St({attributes:s,indices:r,primitiveType:e.primitiveType,boundingSphere:e.boundingSphere,boundingSphereCV:e.boundingSphereCV})),i=[],r=[],o=0,s=_de(e.attributes))}r.length!==0&&t.push(new St({attributes:s,indices:r,primitiveType:e.primitiveType,boundingSphere:e.boundingSphere,boundingSphereCV:e.boundingSphereCV}))}else t.push(e);return t};var yde=new h,a8e=new he;zl.projectTo2D=function(e,t,n,i,r){let o=e.attributes[t];r=l(r)?r:new Ui;let s=r.ellipsoid,a=o.values,c=new Float64Array(a.length),u=0;for(let f=0;f<a.length;f+=3){let d=h.fromArray(a,f,yde),p=s.cartesianToCartographic(d,a8e),g=r.project(p,yde);c[u++]=g.x,c[u++]=g.y,c[u++]=g.z}return e.attributes[n]=o,e.attributes[i]=new Ne({componentDatatype:Y.DOUBLE,componentsPerAttribute:3,values:c}),delete e.attributes[t],e};var TX={high:0,low:0};zl.encodeAttribute=function(e,t,n,i){let r=e.attributes[t],o=r.values,s=o.length,a=new Float32Array(s),c=new Float32Array(s);for(let f=0;f<s;++f)Sn.encode(o[f],TX),a[f]=TX.high,c[f]=TX.low;let u=r.componentsPerAttribute;return e.attributes[n]=new Ne({componentDatatype:Y.FLOAT,componentsPerAttribute:u,values:a}),e.attributes[i]=new Ne({componentDatatype:Y.FLOAT,componentsPerAttribute:u,values:c}),delete e.attributes[t],e};var Gh=new h;function EX(e,t){if(l(t)){let n=t.values,i=n.length;for(let r=0;r<i;r+=3)h.unpack(n,r,Gh),N.multiplyByPoint(e,Gh,Gh),h.pack(Gh,n,r)}}function CX(e,t){if(l(t)){let n=t.values,i=n.length;for(let r=0;r<i;r+=3)h.unpack(n,r,Gh),$.multiplyByVector(e,Gh,Gh),Gh=h.normalize(Gh,Gh),h.pack(Gh,n,r)}}var s6=new N,a6=new $;zl.transformToWorldCoordinates=function(e){let t=e.modelMatrix;if(N.equals(t,N.IDENTITY))return e;let n=e.geometry.attributes;EX(t,n.position),EX(t,n.prevPosition),EX(t,n.nextPosition),(l(n.normal)||l(n.tangent)||l(n.bitangent))&&(N.inverse(t,s6),N.transpose(s6,s6),N.getMatrix3(s6,a6),CX(a6,n.normal),CX(a6,n.tangent),CX(a6,n.bitangent));let i=e.geometry.boundingSphere;return l(i)&&(e.geometry.boundingSphere=ue.transform(i,t,i)),e.modelMatrix=N.clone(N.IDENTITY),e};function c8e(e,t){let n=e.length,i={},r=e[0][t].attributes,o;for(o in r)if(r.hasOwnProperty(o)&&l(r[o])&&l(r[o].values)){let s=r[o],a=s.values.length,c=!0;for(let u=1;u<n;++u){let f=e[u][t].attributes[o];if(!l(f)||s.componentDatatype!==f.componentDatatype||s.componentsPerAttribute!==f.componentsPerAttribute||s.normalize!==f.normalize){c=!1;break}a+=f.values.length}c&&(i[o]=new Ne({componentDatatype:s.componentDatatype,componentsPerAttribute:s.componentsPerAttribute,normalize:s.normalize,values:Y.createTypedArray(s.componentDatatype,a)}))}return i}var l8e=new h;function vX(e,t){let n=e.length,i,r,o,s,a=e[0].modelMatrix,c=l(e[0][t].indices),u=e[0][t].primitiveType,f=c8e(e,t),d,p,g;for(i in f)if(f.hasOwnProperty(i))for(d=f[i].values,s=0,r=0;r<n;++r)for(p=e[r][t].attributes[i].values,g=p.length,o=0;o<g;++o)d[s++]=p[o];let m;if(c){let x=0;for(r=0;r<n;++r)x+=e[r][t].indices.length;let T=St.computeNumberOfVertices(new St({attributes:f,primitiveType:Oe.POINTS})),E=je.createTypedArray(T,x),v=0,S=0;for(r=0;r<n;++r){let I=e[r][t].indices,R=I.length;for(s=0;s<R;++s)E[v++]=S+I[s];S+=St.computeNumberOfVertices(e[r][t])}m=E}let y=new h,A=0,b;for(r=0;r<n;++r){if(b=e[r][t].boundingSphere,!l(b)){y=void 0;break}h.add(b.center,y,y)}if(l(y))for(h.divideByScalar(y,n,y),r=0;r<n;++r){b=e[r][t].boundingSphere;let x=h.magnitude(h.subtract(b.center,y,l8e))+b.radius;x>A&&(A=x)}return new St({attributes:f,indices:m,primitiveType:u,boundingSphere:l(y)?new ue(y,A):void 0})}zl.combineInstances=function(e){let t=[],n=[],i=e.length;for(let o=0;o<i;++o){let s=e[o];l(s.geometry)?t.push(s):l(s.westHemisphereGeometry)&&l(s.eastHemisphereGeometry)&&n.push(s)}let r=[];return t.length>0&&r.push(vX(t,"geometry")),n.length>0&&(r.push(vX(n,"westHemisphereGeometry")),r.push(vX(n,"eastHemisphereGeometry"))),r};var Sd=new h,RD=new h,yv=new h,Av=new h;zl.computeNormal=function(e){let t=e.indices,n=e.attributes,i=n.position.values,r=n.position.values.length/3,o=t.length,s=new Array(r),a=new Array(o/3),c=new Array(o),u;for(u=0;u<r;u++)s[u]={indexOffset:0,count:0,currentCount:0};let f=0;for(u=0;u<o;u+=3){let m=t[u],y=t[u+1],A=t[u+2],b=m*3,x=y*3,T=A*3;RD.x=i[b],RD.y=i[b+1],RD.z=i[b+2],yv.x=i[x],yv.y=i[x+1],yv.z=i[x+2],Av.x=i[T],Av.y=i[T+1],Av.z=i[T+2],s[m].count++,s[y].count++,s[A].count++,h.subtract(yv,RD,yv),h.subtract(Av,RD,Av),a[f]=h.cross(yv,Av,new h),f++}let d=0;for(u=0;u<r;u++)s[u].indexOffset+=d,d+=s[u].count;f=0;let p;for(u=0;u<o;u+=3){p=s[t[u]];let m=p.indexOffset+p.currentCount;c[m]=f,p.currentCount++,p=s[t[u+1]],m=p.indexOffset+p.currentCount,c[m]=f,p.currentCount++,p=s[t[u+2]],m=p.indexOffset+p.currentCount,c[m]=f,p.currentCount++,f++}let g=new Float32Array(r*3);for(u=0;u<r;u++){let m=u*3;if(p=s[u],h.clone(h.ZERO,Sd),p.count>0){for(f=0;f<p.count;f++)h.add(Sd,a[c[p.indexOffset+f]],Sd);h.equalsEpsilon(h.ZERO,Sd,D.EPSILON10)&&h.clone(a[c[p.indexOffset]],Sd)}h.equalsEpsilon(h.ZERO,Sd,D.EPSILON10)&&(Sd.z=1),h.normalize(Sd,Sd),g[m]=Sd.x,g[m+1]=Sd.y,g[m+2]=Sd.z}return e.attributes.normal=new Ne({componentDatatype:Y.FLOAT,componentsPerAttribute:3,values:g}),e};var u8e=new h,Ade=new h,f8e=new h;zl.computeTangentAndBitangent=function(e){let t=e.attributes,n=e.indices,i=e.attributes.position.values,r=e.attributes.normal.values,o=e.attributes.st.values,s=e.attributes.position.values.length/3,a=n.length,c=new Array(s*3),u;for(u=0;u<c.length;u++)c[u]=0;let f,d,p;for(u=0;u<a;u+=3){let y=n[u],A=n[u+1],b=n[u+2];f=y*3,d=A*3,p=b*3;let x=y*2,T=A*2,E=b*2,v=i[f],S=i[f+1],I=i[f+2],R=o[x],O=o[x+1],L=o[T+1]-O,_=o[E+1]-O,C=1/((o[T]-R)*_-(o[E]-R)*L),w=(_*(i[d]-v)-L*(i[p]-v))*C,P=(_*(i[d+1]-S)-L*(i[p+1]-S))*C,M=(_*(i[d+2]-I)-L*(i[p+2]-I))*C;c[f]+=w,c[f+1]+=P,c[f+2]+=M,c[d]+=w,c[d+1]+=P,c[d+2]+=M,c[p]+=w,c[p+1]+=P,c[p+2]+=M}let g=new Float32Array(s*3),m=new Float32Array(s*3);for(u=0;u<s;u++){f=u*3,d=f+1,p=f+2;let y=h.fromArray(r,f,u8e),A=h.fromArray(c,f,f8e),b=h.dot(y,A);h.multiplyByScalar(y,b,Ade),h.normalize(h.subtract(A,Ade,A),A),g[f]=A.x,g[d]=A.y,g[p]=A.z,h.normalize(h.cross(y,A,A),A),m[f]=A.x,m[d]=A.y,m[p]=A.z}return e.attributes.tangent=new Ne({componentDatatype:Y.FLOAT,componentsPerAttribute:3,values:g}),e.attributes.bitangent=new Ne({componentDatatype:Y.FLOAT,componentsPerAttribute:3,values:m}),e};var OD=new U,Hh=new h,bde=new h,xde=new h,c6=new U;zl.compressVertices=function(e){let t=e.attributes.extrudeDirection,n,i;if(l(t)){let S=t.values;i=S.length/3;let I=new Float32Array(i*2),R=0;for(n=0;n<i;++n){if(h.fromArray(S,n*3,Hh),h.equals(Hh,h.ZERO)){R+=2;continue}c6=cn.octEncodeInRange(Hh,65535,c6),I[R++]=c6.x,I[R++]=c6.y}return e.attributes.compressedAttributes=new Ne({componentDatatype:Y.FLOAT,componentsPerAttribute:2,values:I}),delete e.attributes.extrudeDirection,e}let r=e.attributes.normal,o=e.attributes.st,s=l(r),a=l(o);if(!s&&!a)return e;let c=e.attributes.tangent,u=e.attributes.bitangent,f=l(c),d=l(u),p,g,m,y;s&&(p=r.values),a&&(g=o.values),f&&(m=c.values),d&&(y=u.values),i=(s?p.length:g.length)/(s?3:2);let x=i,T=a&&s?2:1;T+=f||d?1:0,x*=T;let E=new Float32Array(x),v=0;for(n=0;n<i;++n){a&&(U.fromArray(g,n*2,OD),E[v++]=cn.compressTextureCoordinates(OD));let S=n*3;s&&l(m)&&l(y)?(h.fromArray(p,S,Hh),h.fromArray(m,S,bde),h.fromArray(y,S,xde),cn.octPack(Hh,bde,xde,OD),E[v++]=OD.x,E[v++]=OD.y):(s&&(h.fromArray(p,S,Hh),E[v++]=cn.octEncodeFloat(Hh)),f&&(h.fromArray(m,S,Hh),E[v++]=cn.octEncodeFloat(Hh)),d&&(h.fromArray(y,S,Hh),E[v++]=cn.octEncodeFloat(Hh)))}return e.attributes.compressedAttributes=new Ne({componentDatatype:Y.FLOAT,componentsPerAttribute:T,values:E}),s&&delete e.attributes.normal,a&&delete e.attributes.st,d&&delete e.attributes.bitangent,f&&delete e.attributes.tangent,e};function d8e(e){if(l(e.indices))return e;let t=St.computeNumberOfVertices(e),n=je.createTypedArray(t,t);for(let i=0;i<t;++i)n[i]=i;return e.indices=n,e}function h8e(e){let t=St.computeNumberOfVertices(e),n=je.createTypedArray(t,(t-2)*3);n[0]=1,n[1]=0,n[2]=2;let i=3;for(let r=3;r<t;++r)n[i++]=r-1,n[i++]=0,n[i++]=r;return e.indices=n,e.primitiveType=Oe.TRIANGLES,e}function m8e(e){let t=St.computeNumberOfVertices(e),n=je.createTypedArray(t,(t-2)*3);n[0]=0,n[1]=1,n[2]=2,t>3&&(n[3]=0,n[4]=2,n[5]=3);let i=6;for(let r=3;r<t-1;r+=2)n[i++]=r,n[i++]=r-1,n[i++]=r+1,r+2<t&&(n[i++]=r,n[i++]=r+1,n[i++]=r+2);return e.indices=n,e.primitiveType=Oe.TRIANGLES,e}function p8e(e){if(l(e.indices))return e;let t=St.computeNumberOfVertices(e),n=je.createTypedArray(t,t);for(let i=0;i<t;++i)n[i]=i;return e.indices=n,e}function g8e(e){let t=St.computeNumberOfVertices(e),n=je.createTypedArray(t,(t-1)*2);n[0]=0,n[1]=1;let i=2;for(let r=2;r<t;++r)n[i++]=r-1,n[i++]=r;return e.indices=n,e.primitiveType=Oe.LINES,e}function _8e(e){let t=St.computeNumberOfVertices(e),n=je.createTypedArray(t,t*2);n[0]=0,n[1]=1;let i=2;for(let r=2;r<t;++r)n[i++]=r-1,n[i++]=r;return n[i++]=t-1,n[i]=0,e.indices=n,e.primitiveType=Oe.LINES,e}function y8e(e){switch(e.primitiveType){case Oe.TRIANGLE_FAN:return h8e(e);case Oe.TRIANGLE_STRIP:return m8e(e);case Oe.TRIANGLES:return d8e(e);case Oe.LINE_STRIP:return g8e(e);case Oe.LINE_LOOP:return _8e(e);case Oe.LINES:return p8e(e)}return e}function Ly(e,t){Math.abs(e.y)<D.EPSILON6&&(t?e.y=-D.EPSILON6:e.y=D.EPSILON6)}function A8e(e,t,n){if(e.y!==0&&t.y!==0&&n.y!==0){Ly(e,e.y<0),Ly(t,t.y<0),Ly(n,n.y<0);return}let i=Math.abs(e.y),r=Math.abs(t.y),o=Math.abs(n.y),s;i>r?i>o?s=D.sign(e.y):s=D.sign(n.y):r>o?s=D.sign(t.y):s=D.sign(n.y);let a=s<0;Ly(e,a),Ly(t,a),Ly(n,a)}var Tde=new h;function wd(e,t,n,i){h.add(e,h.multiplyByScalar(h.subtract(t,e,Tde),e.y/(e.y-t.y),Tde),n),h.clone(n,i),Ly(n,!0),Ly(i,!1)}var px=new h,gx=new h,_x=new h,yx=new h,SX={positions:new Array(7),indices:new Array(9)};function b8e(e,t,n){if(e.x>=0||t.x>=0||n.x>=0)return;A8e(e,t,n);let i=e.y<0,r=t.y<0,o=n.y<0,s=0;s+=i?1:0,s+=r?1:0,s+=o?1:0;let a=SX.indices;s===1?(a[1]=3,a[2]=4,a[5]=6,a[7]=6,a[8]=5,i?(wd(e,t,px,_x),wd(e,n,gx,yx),a[0]=0,a[3]=1,a[4]=2,a[6]=1):r?(wd(t,n,px,_x),wd(t,e,gx,yx),a[0]=1,a[3]=2,a[4]=0,a[6]=2):o&&(wd(n,e,px,_x),wd(n,t,gx,yx),a[0]=2,a[3]=0,a[4]=1,a[6]=0)):s===2&&(a[2]=4,a[4]=4,a[5]=3,a[7]=5,a[8]=6,i?r?o||(wd(n,e,px,_x),wd(n,t,gx,yx),a[0]=0,a[1]=1,a[3]=0,a[6]=2):(wd(t,n,px,_x),wd(t,e,gx,yx),a[0]=2,a[1]=0,a[3]=2,a[6]=1):(wd(e,t,px,_x),wd(e,n,gx,yx),a[0]=1,a[1]=2,a[3]=1,a[6]=0));let c=SX.positions;return c[0]=e,c[1]=t,c[2]=n,c.length=3,(s===1||s===2)&&(c[3]=px,c[4]=gx,c[5]=_x,c[6]=yx,c.length=7),SX}function Ede(e,t){let n=e.attributes;if(n.position.values.length===0)return;for(let r in n)if(n.hasOwnProperty(r)&&l(n[r])&&l(n[r].values)){let o=n[r];o.values=Y.createTypedArray(o.componentDatatype,o.values)}let i=St.computeNumberOfVertices(e);return e.indices=je.createTypedArray(i,e.indices),t&&(e.boundingSphere=ue.fromVertices(n.position.values)),e}function xv(e){let t=e.attributes,n={};for(let i in t)if(t.hasOwnProperty(i)&&l(t[i])&&l(t[i].values)){let r=t[i];n[i]=new Ne({componentDatatype:r.componentDatatype,componentsPerAttribute:r.componentsPerAttribute,normalize:r.normalize,values:[]})}return new St({attributes:n,indices:[],primitiveType:e.primitiveType})}function DX(e,t,n){let i=l(e.geometry.boundingSphere);t=Ede(t,i),n=Ede(n,i),l(n)&&!l(t)?e.geometry=n:!l(n)&&l(t)?e.geometry=t:(e.westHemisphereGeometry=t,e.eastHemisphereGeometry=n,e.geometry=void 0)}function RX(e,t){let n=new e,i=new e,r=new e;return function(o,s,a,c,u,f,d,p){let g=e.fromArray(u,o*t,n),m=e.fromArray(u,s*t,i),y=e.fromArray(u,a*t,r);e.multiplyByScalar(g,c.x,g),e.multiplyByScalar(m,c.y,m),e.multiplyByScalar(y,c.z,y);let A=e.add(g,m,g);e.add(A,y,A),p&&e.normalize(A,A),e.pack(A,f,d*t)}}var x8e=RX(se,4),f6=RX(h,3),Pde=RX(U,2),T8e=function(e,t,n,i,r,o,s){let a=r[e]*i.x,c=r[t]*i.y,u=r[n]*i.z;o[s]=a+c+u>D.EPSILON6?1:0},MD=new h,wX=new h,IX=new h,E8e=new h;function l6(e,t,n,i,r,o,s,a,c,u,f,d,p,g,m,y){if(!l(o)&&!l(s)&&!l(a)&&!l(c)&&!l(u)&&g===0)return;let A=h.fromArray(r,e*3,MD),b=h.fromArray(r,t*3,wX),x=h.fromArray(r,n*3,IX),T=dx(i,A,b,x,E8e);if(l(T)){if(l(o)&&f6(e,t,n,T,o,d.normal.values,y,!0),l(u)){let E=h.fromArray(u,e*3,MD),v=h.fromArray(u,t*3,wX),S=h.fromArray(u,n*3,IX);h.multiplyByScalar(E,T.x,E),h.multiplyByScalar(v,T.y,v),h.multiplyByScalar(S,T.z,S);let I;!h.equals(E,h.ZERO)||!h.equals(v,h.ZERO)||!h.equals(S,h.ZERO)?(I=h.add(E,v,E),h.add(I,S,I),h.normalize(I,I)):(I=MD,I.x=0,I.y=0,I.z=0),h.pack(I,d.extrudeDirection.values,y*3)}if(l(f)&&T8e(e,t,n,T,f,d.applyOffset.values,y),l(s)&&f6(e,t,n,T,s,d.tangent.values,y,!0),l(a)&&f6(e,t,n,T,a,d.bitangent.values,y,!0),l(c)&&Pde(e,t,n,T,c,d.st.values,y),g>0)for(let E=0;E<g;E++){let v=p[E];C8e(e,t,n,T,y,m[v],d[v])}}}function C8e(e,t,n,i,r,o,s){let a=o.componentsPerAttribute,c=o.values,u=s.values;switch(a){case 4:x8e(e,t,n,i,c,u,r,!1);break;case 3:f6(e,t,n,i,c,u,r,!1);break;case 2:Pde(e,t,n,i,c,u,r,!1);break;default:u[r]=c[e]*i.x+c[t]*i.y+c[n]*i.z}}function Np(e,t,n,i,r,o){let s=e.position.values.length/3;if(r!==-1){let a=i[r],c=n[a];return c===-1?(n[a]=s,e.position.values.push(o.x,o.y,o.z),t.push(s),s):(t.push(c),c)}return e.position.values.push(o.x,o.y,o.z),t.push(s),s}var v8e={position:!0,normal:!0,bitangent:!0,tangent:!0,st:!0,extrudeDirection:!0,applyOffset:!0};function Cde(e){let t=e.geometry,n=t.attributes,i=n.position.values,r=l(n.normal)?n.normal.values:void 0,o=l(n.bitangent)?n.bitangent.values:void 0,s=l(n.tangent)?n.tangent.values:void 0,a=l(n.st)?n.st.values:void 0,c=l(n.extrudeDirection)?n.extrudeDirection.values:void 0,u=l(n.applyOffset)?n.applyOffset.values:void 0,f=t.indices,d=[];for(let I in n)n.hasOwnProperty(I)&&!v8e[I]&&l(n[I])&&d.push(I);let p=d.length,g=xv(t),m=xv(t),y,A,b,x,T,E=[];E.length=i.length/3;let v=[];for(v.length=i.length/3,T=0;T<E.length;++T)E[T]=-1,v[T]=-1;let S=f.length;for(T=0;T<S;T+=3){let I=f[T],R=f[T+1],O=f[T+2],L=h.fromArray(i,I*3),_=h.fromArray(i,R*3),C=h.fromArray(i,O*3),w=b8e(L,_,C);if(l(w)&&w.positions.length>3){let P=w.positions,M=w.indices,F=M.length;for(let V=0;V<F;++V){let B=M[V],j=P[B];j.y<0?(y=m.attributes,A=m.indices,b=E):(y=g.attributes,A=g.indices,b=v),x=Np(y,A,b,f,B<3?T+B:-1,j),l6(I,R,O,j,i,r,s,o,a,c,u,y,d,p,n,x)}}else l(w)&&(L=w.positions[0],_=w.positions[1],C=w.positions[2]),L.y<0?(y=m.attributes,A=m.indices,b=E):(y=g.attributes,A=g.indices,b=v),x=Np(y,A,b,f,T,L),l6(I,R,O,L,i,r,s,o,a,c,u,y,d,p,n,x),x=Np(y,A,b,f,T+1,_),l6(I,R,O,_,i,r,s,o,a,c,u,y,d,p,n,x),x=Np(y,A,b,f,T+2,C),l6(I,R,O,C,i,r,s,o,a,c,u,y,d,p,n,x)}DX(e,m,g)}var Dde=sn.fromPointNormal(h.ZERO,h.UNIT_Y),S8e=new h,w8e=new h;function bv(e,t,n,i,r,o,s){if(!l(s))return;let a=h.fromArray(i,e*3,MD);h.equalsEpsilon(a,n,D.EPSILON10)?o.applyOffset.values[r]=s[e]:o.applyOffset.values[r]=s[t]}function vde(e){let t=e.geometry,n=t.attributes,i=n.position.values,r=l(n.applyOffset)?n.applyOffset.values:void 0,o=t.indices,s=xv(t),a=xv(t),c,u=o.length,f=[];f.length=i.length/3;let d=[];for(d.length=i.length/3,c=0;c<f.length;++c)f[c]=-1,d[c]=-1;for(c=0;c<u;c+=2){let p=o[c],g=o[c+1],m=h.fromArray(i,p*3,MD),y=h.fromArray(i,g*3,wX),A;Math.abs(m.y)<D.EPSILON6&&(m.y<0?m.y=-D.EPSILON6:m.y=D.EPSILON6),Math.abs(y.y)<D.EPSILON6&&(y.y<0?y.y=-D.EPSILON6:y.y=D.EPSILON6);let b=s.attributes,x=s.indices,T=d,E=a.attributes,v=a.indices,S=f,I=_i.lineSegmentPlane(m,y,Dde,IX);if(l(I)){let R=h.multiplyByScalar(h.UNIT_Y,5*D.EPSILON9,S8e);m.y<0&&(h.negate(R,R),b=a.attributes,x=a.indices,T=f,E=s.attributes,v=s.indices,S=d);let O=h.add(I,R,w8e);A=Np(b,x,T,o,c,m),bv(p,g,m,i,A,b,r),A=Np(b,x,T,o,-1,O),bv(p,g,O,i,A,b,r),h.negate(R,R),h.add(I,R,O),A=Np(E,v,S,o,-1,O),bv(p,g,O,i,A,E,r),A=Np(E,v,S,o,c+1,y),bv(p,g,y,i,A,E,r)}else{let R,O,L;m.y<0?(R=a.attributes,O=a.indices,L=f):(R=s.attributes,O=s.indices,L=d),A=Np(R,O,L,o,c,m),bv(p,g,m,i,A,R,r),A=Np(R,O,L,o,c+1,y),bv(p,g,y,i,A,R,r)}}DX(e,a,s)}var Sde=new U,I8e=new U,Rde=new h,Ode=new h,PX=new h,P8e=new h,D8e=new h,R8e=new h,wde=new se;function Ide(e){let t=e.attributes,n=t.position.values,i=t.prevPosition.values,r=t.nextPosition.values,o=n.length;for(let s=0;s<o;s+=3){let a=h.unpack(n,s,Rde);if(a.x>0)continue;let c=h.unpack(i,s,Ode);(a.y<0&&c.y>0||a.y>0&&c.y<0)&&(s-3>0?(i[s]=n[s-3],i[s+1]=n[s-2],i[s+2]=n[s-1]):h.pack(a,i,s));let u=h.unpack(r,s,PX);(a.y<0&&u.y>0||a.y>0&&u.y<0)&&(s+3<o?(r[s]=n[s+3],r[s+1]=n[s+4],r[s+2]=n[s+5]):h.pack(a,r,s))}}var O8e=5*D.EPSILON9,u6=D.EPSILON6;function M8e(e){let t=e.geometry,n=t.attributes,i=n.position.values,r=n.prevPosition.values,o=n.nextPosition.values,s=n.expandAndWidth.values,a=l(n.st)?n.st.values:void 0,c=l(n.color)?n.color.values:void 0,u=xv(t),f=xv(t),d,p,g,m=!1,y=i.length/3;for(d=0;d<y;d+=4){let A=d,b=d+2,x=h.fromArray(i,A*3,Rde),T=h.fromArray(i,b*3,Ode);if(Math.abs(x.y)<u6)for(x.y=u6*(T.y<0?-1:1),i[d*3+1]=x.y,i[(d+1)*3+1]=x.y,p=A*3;p<A*3+12;p+=3)r[p]=i[d*3],r[p+1]=i[d*3+1],r[p+2]=i[d*3+2];if(Math.abs(T.y)<u6)for(T.y=u6*(x.y<0?-1:1),i[(d+2)*3+1]=T.y,i[(d+3)*3+1]=T.y,p=A*3;p<A*3+12;p+=3)o[p]=i[(d+2)*3],o[p+1]=i[(d+2)*3+1],o[p+2]=i[(d+2)*3+2];let E=u.attributes,v=u.indices,S=f.attributes,I=f.indices,R=_i.lineSegmentPlane(x,T,Dde,P8e);if(l(R)){m=!0;let O=h.multiplyByScalar(h.UNIT_Y,O8e,D8e);x.y<0&&(h.negate(O,O),E=f.attributes,v=f.indices,S=u.attributes,I=u.indices);let L=h.add(R,O,R8e);E.position.values.push(x.x,x.y,x.z,x.x,x.y,x.z),E.position.values.push(L.x,L.y,L.z),E.position.values.push(L.x,L.y,L.z),E.prevPosition.values.push(r[A*3],r[A*3+1],r[A*3+2]),E.prevPosition.values.push(r[A*3+3],r[A*3+4],r[A*3+5]),E.prevPosition.values.push(x.x,x.y,x.z,x.x,x.y,x.z),E.nextPosition.values.push(L.x,L.y,L.z),E.nextPosition.values.push(L.x,L.y,L.z),E.nextPosition.values.push(L.x,L.y,L.z),E.nextPosition.values.push(L.x,L.y,L.z),h.negate(O,O),h.add(R,O,L),S.position.values.push(L.x,L.y,L.z),S.position.values.push(L.x,L.y,L.z),S.position.values.push(T.x,T.y,T.z,T.x,T.y,T.z),S.prevPosition.values.push(L.x,L.y,L.z),S.prevPosition.values.push(L.x,L.y,L.z),S.prevPosition.values.push(L.x,L.y,L.z),S.prevPosition.values.push(L.x,L.y,L.z),S.nextPosition.values.push(T.x,T.y,T.z,T.x,T.y,T.z),S.nextPosition.values.push(o[b*3],o[b*3+1],o[b*3+2]),S.nextPosition.values.push(o[b*3+3],o[b*3+4],o[b*3+5]);let _=U.fromArray(s,A*2,Sde),C=Math.abs(_.y);E.expandAndWidth.values.push(-1,C,1,C),E.expandAndWidth.values.push(-1,-C,1,-C),S.expandAndWidth.values.push(-1,C,1,C),S.expandAndWidth.values.push(-1,-C,1,-C);let w=h.magnitudeSquared(h.subtract(R,x,PX));if(w/=h.magnitudeSquared(h.subtract(T,x,PX)),l(c)){let P=se.fromArray(c,A*4,wde),M=se.fromArray(c,b*4,wde),F=D.lerp(P.x,M.x,w),V=D.lerp(P.y,M.y,w),B=D.lerp(P.z,M.z,w),j=D.lerp(P.w,M.w,w);for(p=A*4;p<A*4+8;++p)E.color.values.push(c[p]);for(E.color.values.push(F,V,B,j),E.color.values.push(F,V,B,j),S.color.values.push(F,V,B,j),S.color.values.push(F,V,B,j),p=b*4;p<b*4+8;++p)S.color.values.push(c[p])}if(l(a)){let P=U.fromArray(a,A*2,Sde),M=U.fromArray(a,(d+3)*2,I8e),F=D.lerp(P.x,M.x,w);for(p=A*2;p<A*2+4;++p)E.st.values.push(a[p]);for(E.st.values.push(F,P.y),E.st.values.push(F,M.y),S.st.values.push(F,P.y),S.st.values.push(F,M.y),p=b*2;p<b*2+4;++p)S.st.values.push(a[p])}g=E.position.values.length/3-4,v.push(g,g+2,g+1),v.push(g+1,g+2,g+3),g=S.position.values.length/3-4,I.push(g,g+2,g+1),I.push(g+1,g+2,g+3)}else{let O,L;for(x.y<0?(O=f.attributes,L=f.indices):(O=u.attributes,L=u.indices),O.position.values.push(x.x,x.y,x.z),O.position.values.push(x.x,x.y,x.z),O.position.values.push(T.x,T.y,T.z),O.position.values.push(T.x,T.y,T.z),p=d*3;p<d*3+12;++p)O.prevPosition.values.push(r[p]),O.nextPosition.values.push(o[p]);for(p=d*2;p<d*2+8;++p)O.expandAndWidth.values.push(s[p]),l(a)&&O.st.values.push(a[p]);if(l(c))for(p=d*4;p<d*4+16;++p)O.color.values.push(c[p]);g=O.position.values.length/3-4,L.push(g,g+2,g+1),L.push(g+1,g+2,g+3)}}m&&(Ide(f),Ide(u)),DX(e,f,u)}zl.splitLongitude=function(e){let t=e.geometry,n=t.boundingSphere;if(l(n)&&(n.center.x-n.radius>0||ue.intersectPlane(n,sn.ORIGIN_ZX_PLANE)!==$t.INTERSECTING))return e;if(t.geometryType!==vd.NONE)switch(t.geometryType){case vd.POLYLINES:M8e(e);break;case vd.TRIANGLES:Cde(e);break;case vd.LINES:vde(e);break}else y8e(t),t.primitiveType===Oe.TRIANGLES?Cde(e):t.primitiveType===Oe.LINES&&vde(e);return e};var Hn=zl;function ND(e,t,n,i,r,o,s,a,c,u,f){this._context=e,this._texture=t,this._textureTarget=n,this._targetFace=i,this._pixelDatatype=s,this._internalFormat=r,this._pixelFormat=o,this._size=a,this._preMultiplyAlpha=c,this._flipY=u,this._initialized=f}Object.defineProperties(ND.prototype,{pixelFormat:{get:function(){return this._pixelFormat}},pixelDatatype:{get:function(){return this._pixelDatatype}},_target:{get:function(){return this._targetFace}}});ND.prototype.copyFrom=function(e){let{xOffset:t=0,yOffset:n=0,source:i,skipColorSpaceConversion:r=!1}=e,{width:o,height:s}=i,a=this._context._gl,c=this._textureTarget,u=this._targetFace;a.activeTexture(a.TEXTURE0),a.bindTexture(c,this._texture);let f=i.arrayBufferView,d=this._size,p=this._pixelFormat,g=this._internalFormat,m=this._pixelDatatype,y=this._preMultiplyAlpha,A=this._flipY,b=4;l(f)&&(b=Ke.alignmentInBytes(p,m,o)),a.pixelStorei(a.UNPACK_ALIGNMENT,b),r?a.pixelStorei(a.UNPACK_COLORSPACE_CONVERSION_WEBGL,a.NONE):a.pixelStorei(a.UNPACK_COLORSPACE_CONVERSION_WEBGL,a.BROWSER_DEFAULT_WEBGL);let x=!1;if(!this._initialized){let T;t===0&&n===0&&o===d&&s===d?(l(f)?(a.pixelStorei(a.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!1),a.pixelStorei(a.UNPACK_FLIP_Y_WEBGL,!1),A&&(f=Ke.flipY(f,p,m,d,d)),T=f):(a.pixelStorei(a.UNPACK_PREMULTIPLY_ALPHA_WEBGL,y),a.pixelStorei(a.UNPACK_FLIP_Y_WEBGL,A),T=i),x=!0):(a.pixelStorei(a.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!1),a.pixelStorei(a.UNPACK_FLIP_Y_WEBGL,!1),T=Ke.createTypedArray(p,m,d,d)),a.texImage2D(u,0,g,d,d,0,p,ze.toWebGLConstant(m,this._context),T),this._initialized=!0}x||(l(f)?(a.pixelStorei(a.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!1),a.pixelStorei(a.UNPACK_FLIP_Y_WEBGL,!1),A&&(f=Ke.flipY(f,p,m,o,s)),a.texSubImage2D(u,0,t,n,o,s,p,ze.toWebGLConstant(m,this._context),f)):(a.pixelStorei(a.UNPACK_PREMULTIPLY_ALPHA_WEBGL,y),a.pixelStorei(a.UNPACK_FLIP_Y_WEBGL,A),a.texSubImage2D(u,0,t,n,p,ze.toWebGLConstant(m,this._context),i))),a.bindTexture(c,null)};ND.prototype.copyFromFramebuffer=function(e,t,n,i,r,o){e=e??0,t=t??0,n=n??0,i=i??0,r=r??this._size,o=o??this._size;let s=this._context._gl,a=this._textureTarget;s.activeTexture(s.TEXTURE0),s.bindTexture(a,this._texture),s.copyTexSubImage2D(this._targetFace,0,e,t,n,i,r,o),s.bindTexture(a,null),this._initialized=!0};ND.prototype.copyMipmapFromFramebuffer=function(e,t,n,i,r){e=e??0,t=t??0,n=n??this._size,i=i??this._size,r=r??0;let o=this._context._gl,s=this._textureTarget;o.activeTexture(o.TEXTURE0),o.bindTexture(s,this._texture),o.copyTexImage2D(this._targetFace,r,this._internalFormat,e,t,n,i,0),o.bindTexture(s,null),this._initialized=!0};var LD=ND;var FD={DONT_CARE:te.DONT_CARE,FASTEST:te.FASTEST,NICEST:te.NICEST,validate:function(e){return e===FD.DONT_CARE||e===FD.FASTEST||e===FD.NICEST}};Object.freeze(FD);var Id=FD;var BD={NEAREST:te.NEAREST,LINEAR:te.LINEAR};BD.validate=function(e){return e===BD.NEAREST||e===BD.LINEAR};Object.freeze(BD);var Jn=BD;var fg={NEAREST:te.NEAREST,LINEAR:te.LINEAR,NEAREST_MIPMAP_NEAREST:te.NEAREST_MIPMAP_NEAREST,LINEAR_MIPMAP_NEAREST:te.LINEAR_MIPMAP_NEAREST,NEAREST_MIPMAP_LINEAR:te.NEAREST_MIPMAP_LINEAR,LINEAR_MIPMAP_LINEAR:te.LINEAR_MIPMAP_LINEAR};fg.validate=function(e){return e===fg.NEAREST||e===fg.LINEAR||e===fg.NEAREST_MIPMAP_NEAREST||e===fg.LINEAR_MIPMAP_NEAREST||e===fg.NEAREST_MIPMAP_LINEAR||e===fg.LINEAR_MIPMAP_LINEAR};Object.freeze(fg);var Wt=fg;var kD={CLAMP_TO_EDGE:te.CLAMP_TO_EDGE,REPEAT:te.REPEAT,MIRRORED_REPEAT:te.MIRRORED_REPEAT,validate:function(e){return e===kD.CLAMP_TO_EDGE||e===kD.REPEAT||e===kD.MIRRORED_REPEAT}};Object.freeze(kD);var hn=kD;function UD(e){e=e??H.EMPTY_OBJECT;let{wrapR:t=hn.CLAMP_TO_EDGE,wrapS:n=hn.CLAMP_TO_EDGE,wrapT:i=hn.CLAMP_TO_EDGE,minificationFilter:r=Wt.LINEAR,magnificationFilter:o=Jn.LINEAR,maximumAnisotropy:s=1}=e;this._wrapR=t,this._wrapS=n,this._wrapT=i,this._minificationFilter=r,this._magnificationFilter=o,this._maximumAnisotropy=s}Object.defineProperties(UD.prototype,{wrapR:{get:function(){return this._wrapR}},wrapS:{get:function(){return this._wrapS}},wrapT:{get:function(){return this._wrapT}},minificationFilter:{get:function(){return this._minificationFilter}},magnificationFilter:{get:function(){return this._magnificationFilter}},maximumAnisotropy:{get:function(){return this._maximumAnisotropy}}});UD.equals=function(e,t){return e===t||l(e)&&l(t)&&e._wrapR===t._wrapR&&e._wrapS===t._wrapS&&e._wrapT===t._wrapT&&e._minificationFilter===t._minificationFilter&&e._magnificationFilter===t._magnificationFilter&&e._maximumAnisotropy===t._maximumAnisotropy};UD.NEAREST=Object.freeze(new UD({wrapR:hn.CLAMP_TO_EDGE,wrapS:hn.CLAMP_TO_EDGE,wrapT:hn.CLAMP_TO_EDGE,minificationFilter:Wt.NEAREST,magnificationFilter:Jn.NEAREST}));var jt=UD;function N8e(e,t){if(!e)throw new pe(t)}var OX=N8e;function L8e(e,t,n,i){let r=l(t.vertexBuffer),o=l(t.value),s=t.value?t.value.length:t.componentsPerAttribute,a={index:t.index??n,enabled:t.enabled??!0,vertexBuffer:t.vertexBuffer,value:o?t.value.slice(0):void 0,componentsPerAttribute:s,componentDatatype:t.componentDatatype??Y.FLOAT,normalize:t.normalize??!1,offsetInBytes:t.offsetInBytes??0,strideInBytes:t.strideInBytes??0,instanceDivisor:t.instanceDivisor??0};if(r)a.vertexAttrib=function(c){let u=this.index;c.bindBuffer(c.ARRAY_BUFFER,this.vertexBuffer._getBuffer()),c.vertexAttribPointer(u,this.componentsPerAttribute,this.componentDatatype,this.normalize,this.strideInBytes,this.offsetInBytes),c.enableVertexAttribArray(u),this.instanceDivisor>0&&(i.glVertexAttribDivisor(u,this.instanceDivisor),i._vertexAttribDivisors[u]=this.instanceDivisor,i._previousDrawInstanced=!0)},a.disableVertexAttribArray=function(c){c.disableVertexAttribArray(this.index),this.instanceDivisor>0&&i.glVertexAttribDivisor(n,0)};else{switch(a.componentsPerAttribute){case 1:a.vertexAttrib=function(c){c.vertexAttrib1fv(this.index,this.value)};break;case 2:a.vertexAttrib=function(c){c.vertexAttrib2fv(this.index,this.value)};break;case 3:a.vertexAttrib=function(c){c.vertexAttrib3fv(this.index,this.value)};break;case 4:a.vertexAttrib=function(c){c.vertexAttrib4fv(this.index,this.value)};break}a.disableVertexAttribArray=function(c){}}e.push(a)}function Nde(e,t,n){for(let i=0;i<t.length;++i){let r=t[i];r.enabled&&r.vertexAttrib(e)}l(n)&&e.bindBuffer(e.ELEMENT_ARRAY_BUFFER,n._getBuffer())}function Wh(e){e=e??H.EMPTY_OBJECT;let t=e.context,n=t._gl,i=e.attributes,r=e.indexBuffer,o,s=[],a=1,c=!1,u=!1,f=i.length;for(o=0;o<f;++o)L8e(s,i[o],o,t);for(f=s.length,o=0;o<f;++o){let p=s[o];if(l(p.vertexBuffer)&&p.instanceDivisor===0){let g=p.strideInBytes||p.componentsPerAttribute*Y.getSizeInBytes(p.componentDatatype);a=p.vertexBuffer.sizeInBytes/g;break}}for(o=0;o<f;++o)s[o].instanceDivisor>0&&(c=!0),l(s[o].value)&&(u=!0);let d;t.vertexArrayObject&&(d=t.glCreateVertexArray(),t.glBindVertexArray(d),Nde(n,s,r),t.glBindVertexArray(null)),this._numberOfVertices=a,this._hasInstancedAttributes=c,this._hasConstantAttributes=u,this._context=t,this._gl=n,this._vao=d,this._attributes=s,this._indexBuffer=r}function Mde(e){return e.values.length/e.componentsPerAttribute}function F8e(e){return Y.getSizeInBytes(e.componentDatatype)*e.componentsPerAttribute}function B8e(e){let t,n,i,r=[];for(n in e)e.hasOwnProperty(n)&&l(e[n])&&l(e[n].values)&&(r.push(n),e[n].componentDatatype===Y.DOUBLE&&(e[n].componentDatatype=Y.FLOAT,e[n].values=Y.createTypedArray(Y.FLOAT,e[n].values)));let o,s=r.length;if(s>0)for(o=Mde(e[r[0]]),t=1;t<s;++t){let u=Mde(e[r[t]]);if(u!==o)throw new oe(`Each attribute list must have the same number of vertices. Attribute ${r[t]} has a different number of vertices (${u.toString()}) than attribute ${r[0]} (${o.toString()}).`)}r.sort(function(u,f){return Y.getSizeInBytes(e[f].componentDatatype)-Y.getSizeInBytes(e[u].componentDatatype)});let a=0,c={};for(t=0;t<s;++t)n=r[t],i=e[n],c[n]=a,a+=F8e(i);if(a>0){let u=Y.getSizeInBytes(e[r[0]].componentDatatype),f=a%u;f!==0&&(a+=u-f);let d=o*a,p=new ArrayBuffer(d),g={};for(t=0;t<s;++t){n=r[t];let m=Y.getSizeInBytes(e[n].componentDatatype);g[n]={pointer:Y.createTypedArray(e[n].componentDatatype,p),index:c[n]/m,strideInComponentType:a/m}}for(t=0;t<o;++t)for(let m=0;m<s;++m){n=r[m],i=e[n];let y=i.values,A=g[n],b=A.pointer,x=i.componentsPerAttribute;for(let T=0;T<x;++T)b[A.index+T]=y[t*x+T];A.index+=A.strideInComponentType}return{buffer:p,offsetsInBytes:c,vertexSizeInBytes:a}}}Wh.fromGeometry=function(e){e=e??H.EMPTY_OBJECT;let t=e.context,n=e.geometry??H.EMPTY_OBJECT,i=e.bufferUsage??Me.DYNAMIC_DRAW,r=e.attributeLocations??H.EMPTY_OBJECT,o=e.interleave??!1,s=e.vertexArrayAttributes,a,c,u,f=l(s)?s:[],d=n.attributes;if(o){let m=B8e(d);if(l(m)){u=tt.createVertexBuffer({context:t,typedArray:m.buffer,usage:i});let y=m.offsetsInBytes,A=m.vertexSizeInBytes;for(a in d)d.hasOwnProperty(a)&&l(d[a])&&(c=d[a],l(c.values)?f.push({index:r[a],vertexBuffer:u,componentDatatype:c.componentDatatype,componentsPerAttribute:c.componentsPerAttribute,normalize:c.normalize,offsetInBytes:y[a],strideInBytes:A}):f.push({index:r[a],value:c.value,componentDatatype:c.componentDatatype,normalize:c.normalize}))}}else for(a in d)if(d.hasOwnProperty(a)&&l(d[a])){c=d[a];let m=c.componentDatatype;m===Y.DOUBLE&&(m=Y.FLOAT);let y={};l(c.values)&&(u=tt.createVertexBuffer({context:t,typedArray:Y.createTypedArray(m,c.values),usage:i}),y={index:r[a],vertexBuffer:u,value:c.value,componentDatatype:m,componentsPerAttribute:c.componentsPerAttribute,normalize:c.normalize}),l(c.typedArray)&&(u=tt.createVertexBuffer({context:t,typedArray:c.typedArray,usage:i}),y={index:r[a],vertexBuffer:u,value:void 0,componentDatatype:m,componentsPerAttribute:Vt.getNumberOfComponents(c.type),normalize:c.normalized,instanceDivisor:c.instanceDivisor}),f.push(y)}let p,g=n.indices;return l(g)&&(St.computeNumberOfVertices(n)>=D.SIXTY_FOUR_KILOBYTES&&t.elementIndexUint?p=tt.createIndexBuffer({context:t,typedArray:new Uint32Array(g),usage:i,indexDatatype:je.UNSIGNED_INT}):p=tt.createIndexBuffer({context:t,typedArray:new Uint16Array(g),usage:i,indexDatatype:je.UNSIGNED_SHORT})),new Wh({context:t,attributes:f,indexBuffer:p})};Object.defineProperties(Wh.prototype,{numberOfAttributes:{get:function(){return this._attributes.length}},numberOfVertices:{get:function(){return this._numberOfVertices}},indexBuffer:{get:function(){return this._indexBuffer}}});Wh.prototype.getAttribute=function(e){return this._attributes[e]};function k8e(e){let t=e._context,n=e._hasInstancedAttributes;if(!n&&!t._previousDrawInstanced)return;t._previousDrawInstanced=n;let i=t._vertexAttribDivisors,r=e._attributes,o=kt.maximumVertexAttributes,s;if(n){let a=r.length;for(s=0;s<a;++s){let c=r[s];if(c.enabled){let u=c.instanceDivisor,f=c.index;u!==i[f]&&(t.glVertexAttribDivisor(f,u),i[f]=u)}}}else for(s=0;s<o;++s)i[s]>0&&(t.glVertexAttribDivisor(s,0),i[s]=0)}function U8e(e,t){let n=e._attributes,i=n.length;for(let r=0;r<i;++r){let o=n[r];o.enabled&&l(o.value)&&o.vertexAttrib(t)}}Wh.prototype.copyAttributeFromRange=function(e,t,n,i){let r=this.getAttribute(e),o=r.vertexBuffer,s=r.componentsPerAttribute,a=t.constructor,c=n*s*a.BYTES_PER_ELEMENT,u=new a(t.buffer,t.byteOffset+c,i*s);o.copyFromArrayView(u,c)};Wh.prototype.copyIndexFromRange=function(e,t,n){let i=this._indexBuffer,r=e.constructor,o=t*r.BYTES_PER_ELEMENT,s=new r(e.buffer,e.byteOffset+o,n);i.copyFromArrayView(s,o)};Wh.prototype._bind=function(){l(this._vao)?(this._context.glBindVertexArray(this._vao),this._context.instancedArrays&&k8e(this),this._hasConstantAttributes&&U8e(this,this._gl)):Nde(this._gl,this._attributes,this._indexBuffer)};Wh.prototype._unBind=function(){if(l(this._vao))this._context.glBindVertexArray(null);else{let e=this._attributes,t=this._gl;for(let n=0;n<e.length;++n){let i=e[n];i.enabled&&i.disableVertexAttribArray(t)}this._indexBuffer&&t.bindBuffer(t.ELEMENT_ARRAY_BUFFER,null)}};Wh.prototype.isDestroyed=function(){return!1};Wh.prototype.destroy=function(){let e=this._attributes;for(let n=0;n<e.length;++n){let i=e[n].vertexBuffer;l(i)&&!i.isDestroyed()&&i.vertexArrayDestroyable&&i.destroy()}let t=this._indexBuffer;return l(t)&&!t.isDestroyed()&&t.vertexArrayDestroyable&&t.destroy(),l(this._vao)&&this._context.glDeleteVertexArray(this._vao),le(this)};var zn=Wh;function Po(e){e=e??H.EMPTY_OBJECT;let{context:t,source:n,pixelFormat:i=Ke.RGBA,pixelDatatype:r=ze.UNSIGNED_BYTE,flipY:o=!0,skipColorSpaceConversion:s=!1,sampler:a=new jt}=e,c=e.preMultiplyAlpha||i===Ke.RGB||i===Ke.LUMINANCE,{width:u,height:f}=e;l(n)&&({width:u,height:f}=n.positiveX);let d=u,p=Ke.textureSizeInBytes(i,r,d,d)*6,g=Ke.toInternalFormat(i,r,t),m=t._gl,y=m.TEXTURE_CUBE_MAP,A=m.createTexture();this._context=t,this._textureFilterAnisotropic=t._textureFilterAnisotropic,this._textureTarget=y,this._texture=A,this._pixelFormat=i,this._pixelDatatype=r,this._size=d,this._hasMipmap=!1,this._sizeInBytes=p,this._preMultiplyAlpha=c,this._flipY=o;let b=l(n);function x(T){return new LD(t,A,y,T,g,i,r,d,c,o,b)}this._positiveX=x(m.TEXTURE_CUBE_MAP_POSITIVE_X),this._negativeX=x(m.TEXTURE_CUBE_MAP_NEGATIVE_X),this._positiveY=x(m.TEXTURE_CUBE_MAP_POSITIVE_Y),this._negativeY=x(m.TEXTURE_CUBE_MAP_NEGATIVE_Y),this._positiveZ=x(m.TEXTURE_CUBE_MAP_POSITIVE_Z),this._negativeZ=x(m.TEXTURE_CUBE_MAP_NEGATIVE_Z),this._sampler=a,Lde(this,a),m.activeTexture(m.TEXTURE0),m.bindTexture(y,A),s?m.pixelStorei(m.UNPACK_COLORSPACE_CONVERSION_WEBGL,m.NONE):m.pixelStorei(m.UNPACK_COLORSPACE_CONVERSION_WEBGL,m.BROWSER_DEFAULT_WEBGL);for(let T of Po.faceNames())MX(this[T],n?.[T],0);m.bindTexture(y,null)}Po.prototype.copyFace=function(e,t,n,i){let r=e.context,o=new _s({context:r,colorTextures:[t],destroyAttachments:!1});o._bind(),this[n].copyMipmapFromFramebuffer(0,0,t.width,t.height,i??0),o._unBind(),o.destroy()};Po.FaceName=Object.freeze({POSITIVEX:"positiveX",NEGATIVEX:"negativeX",POSITIVEY:"positiveY",NEGATIVEY:"negativeY",POSITIVEZ:"positiveZ",NEGATIVEZ:"negativeZ"});function*z8e(){yield Po.FaceName.POSITIVEX,yield Po.FaceName.NEGATIVEX,yield Po.FaceName.POSITIVEY,yield Po.FaceName.NEGATIVEY,yield Po.FaceName.POSITIVEZ,yield Po.FaceName.NEGATIVEZ}Po.faceNames=function(){return z8e()};function MX(e,t,n){n=n??0;let i=e._targetFace,r=Math.max(Math.floor(e._size/2**n),1),o=e._pixelFormat,s=e._pixelDatatype,a=e._internalFormat,c=e._flipY,u=e._preMultiplyAlpha,f=e._context,d=f._gl;if(!l(t)){d.texImage2D(i,n,a,r,r,0,o,ze.toWebGLConstant(s,f),null);return}let{arrayBufferView:p}=t,g=4;l(p)&&(g=Ke.alignmentInBytes(o,s,r)),d.pixelStorei(d.UNPACK_ALIGNMENT,g),l(p)?(d.pixelStorei(d.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!1),d.pixelStorei(d.UNPACK_FLIP_Y_WEBGL,!1),c&&(p=Ke.flipY(p,o,s,r,r)),d.texImage2D(i,n,a,r,r,0,o,ze.toWebGLConstant(s,f),p)):(d.pixelStorei(d.UNPACK_PREMULTIPLY_ALPHA_WEBGL,u),d.pixelStorei(d.UNPACK_FLIP_Y_WEBGL,c),d.texImage2D(i,n,a,o,ze.toWebGLConstant(s,f),t))}Po.loadFace=MX;Object.defineProperties(Po.prototype,{positiveX:{get:function(){return this._positiveX}},negativeX:{get:function(){return this._negativeX}},positiveY:{get:function(){return this._positiveY}},negativeY:{get:function(){return this._negativeY}},positiveZ:{get:function(){return this._positiveZ}},negativeZ:{get:function(){return this._negativeZ}},sampler:{get:function(){return this._sampler},set:function(e){Lde(this,e),this._sampler=e}},pixelFormat:{get:function(){return this._pixelFormat}},pixelDatatype:{get:function(){return this._pixelDatatype}},width:{get:function(){return this._size}},height:{get:function(){return this._size}},sizeInBytes:{get:function(){return this._hasMipmap?Math.floor(this._sizeInBytes*4/3):this._sizeInBytes}},preMultiplyAlpha:{get:function(){return this._preMultiplyAlpha}},flipY:{get:function(){return this._flipY}},_target:{get:function(){return this._textureTarget}}});Po.getDirection=function(e,t){switch(e){case Po.FaceName.POSITIVEX:return h.clone(h.UNIT_X,t);case Po.FaceName.NEGATIVEX:return h.negate(h.UNIT_X,t);case Po.FaceName.POSITIVEY:return h.clone(h.UNIT_Y,t);case Po.FaceName.NEGATIVEY:return h.negate(h.UNIT_Y,t);case Po.FaceName.POSITIVEZ:return h.clone(h.UNIT_Z,t);case Po.FaceName.NEGATIVEZ:return h.negate(h.UNIT_Z,t)}};function Lde(e,t){let{minificationFilter:n,magnificationFilter:i}=t,r=[Wt.NEAREST_MIPMAP_NEAREST,Wt.NEAREST_MIPMAP_LINEAR,Wt.LINEAR_MIPMAP_NEAREST,Wt.LINEAR_MIPMAP_LINEAR].includes(n),o=e._context,s=e._pixelDatatype;(s===ze.FLOAT&&!o.textureFloatLinear||s===ze.HALF_FLOAT&&!o.textureHalfFloatLinear)&&(n=r?Wt.NEAREST_MIPMAP_NEAREST:Wt.NEAREST,i=Jn.NEAREST);let a=o._gl,c=e._textureTarget;a.activeTexture(a.TEXTURE0),a.bindTexture(c,e._texture),a.texParameteri(c,a.TEXTURE_MIN_FILTER,a.LINEAR),a.texParameteri(c,a.TEXTURE_MAG_FILTER,i),a.texParameteri(c,a.TEXTURE_WRAP_S,t.wrapS),a.texParameteri(c,a.TEXTURE_WRAP_T,t.wrapT),l(e._textureFilterAnisotropic)&&a.texParameteri(c,e._textureFilterAnisotropic.TEXTURE_MAX_ANISOTROPY_EXT,t.maximumAnisotropy),a.bindTexture(c,null)}Po.prototype.loadMipmaps=function(e,t){t=t??!1;let n=this._context._gl,i=this._texture,r=this._textureTarget;n.activeTexture(n.TEXTURE0),n.bindTexture(r,i),t?n.pixelStorei(n.UNPACK_COLORSPACE_CONVERSION_WEBGL,n.NONE):n.pixelStorei(n.UNPACK_COLORSPACE_CONVERSION_WEBGL,n.BROWSER_DEFAULT_WEBGL);for(let o=0;o<e.length;o++){let s=e[o],a=o+1;for(let c of Po.faceNames())MX(this[c],s[c],a)}n.bindTexture(r,null),this._hasMipmap=!0};Po.prototype.generateMipmap=function(e){e=e??Id.DONT_CARE,this._hasMipmap=!0;let t=this._context._gl,n=this._textureTarget;t.hint(t.GENERATE_MIPMAP_HINT,e),t.activeTexture(t.TEXTURE0),t.bindTexture(n,this._texture),t.generateMipmap(n),t.bindTexture(n,null)};Po.createVertexArray=function(e){let t=Ic.createGeometry(Ic.fromDimensions({dimensions:new h(2,2,2),vertexFormat:Be.POSITION_ONLY})),n=this._attributeLocations=Hn.createAttributeLocations(t);return zn.fromGeometry({context:e,geometry:t,attributeLocations:n,bufferUsage:Me.STATIC_DRAW})};Po.prototype.isDestroyed=function(){return!1};Po.prototype.destroy=function(){return this._context._gl.deleteTexture(this._texture),this._positiveX=le(this._positiveX),this._negativeX=le(this._negativeX),this._positiveY=le(this._positiveY),this._negativeY=le(this._negativeY),this._positiveZ=le(this._positiveZ),this._negativeZ=le(this._negativeZ),le(this)};var ns=Po;function V8e(e){this.context=e,this.framebuffer=void 0,this.blendingEnabled=void 0,this.scissorTest=void 0,this.viewport=void 0}var sc=V8e;var NX=class{constructor(t,n,i){this._pickObjects=t,this.key=n,this.color=i}get object(){return this._pickObjects.get(this.key)}set object(t){this._pickObjects.set(this.key,t)}destroy(){this._pickObjects.delete(this.key)}},zD=NX;var VD=`const float czm_degreesPerRadian = 57.29577951308232; `;var jD=`const czm_depthRangeStruct czm_depthRange = czm_depthRangeStruct(0.0, 1.0); `;var HD=`const float czm_epsilon1 = 0.1; `;var GD=`const float czm_epsilon2 = 0.01; @@ -1738,7 +1738,7 @@ xyz.g = Yxy.r; xyz.b = Yxy.r * (1.0 - Yxy.g - Yxy.b) / Yxy.b; return XYZ2RGB * xyz; } -`;var Ax={czm_degreesPerRadian:VD,czm_depthRange:jD,czm_epsilon1:HD,czm_epsilon2:GD,czm_epsilon3:WD,czm_epsilon4:qD,czm_epsilon5:YD,czm_epsilon6:XD,czm_epsilon7:KD,czm_infinity:$D,czm_oneOverPi:JD,czm_oneOverTwoPi:ZD,czm_passCesium3DTile:QD,czm_passCesium3DTileClassification:e1,czm_passCesium3DTileClassificationIgnoreShow:t1,czm_passCesium3DTileEdges:n1,czm_passCesium3DTileEdgesDirect:i1,czm_passCesium3DTilePlanarFillId:r1,czm_passClassification:o1,czm_passCompute:s1,czm_passEnvironment:a1,czm_passGaussianSplats:c1,czm_passGlobe:l1,czm_passOpaque:u1,czm_passOverlay:f1,czm_passTerrainClassification:d1,czm_passTranslucent:h1,czm_passVoxels:m1,czm_pi:p1,czm_piOverFour:g1,czm_piOverSix:_1,czm_piOverThree:y1,czm_piOverTwo:A1,czm_radiansPerDegree:b1,czm_sceneMode2D:x1,czm_sceneMode3D:T1,czm_sceneModeColumbusView:E1,czm_sceneModeMorphing:C1,czm_solarRadius:v1,czm_threePiOver2:S1,czm_twoPi:w1,czm_webMercatorMaxLatitude:I1,czm_depthRangeStruct:P1,czm_material:D1,czm_materialInput:R1,czm_modelMaterial:O1,czm_modelVertexOutput:M1,czm_ray:N1,czm_raySegment:L1,czm_shadowParameters:F1,czm_acesTonemapping:B1,czm_alphaWeight:k1,czm_antialias:U1,czm_applyHSBShift:z1,czm_approximateSphericalCoordinates:V1,czm_approximateTanh:j1,czm_backFacing:H1,czm_branchFreeTernary:G1,czm_cascadeColor:W1,czm_cascadeDistance:q1,czm_cascadeMatrix:Y1,czm_cascadeWeights:X1,czm_columbusViewMorph:K1,czm_computeAtmosphereColor:$1,czm_computeGroundAtmosphereScattering:J1,czm_computePosition:Z1,czm_computeScattering:Q1,czm_computeTextureTransform:eR,czm_cosineAndSine:tR,czm_decodeRGB8:nR,czm_decompressTextureCoordinates:iR,czm_depthClamp:rR,czm_eastNorthUpToEyeCoordinates:oR,czm_ellipsoidContainsPoint:sR,czm_ellipsoidTextureCoordinates:aR,czm_equalsEpsilon:cR,czm_eyeOffset:lR,czm_eyeToCartographicDelta:uR,czm_eyeToWindowCoordinates:fR,czm_fastApproximateAtan:dR,czm_fog:hR,czm_gammaCorrect:mR,czm_geodeticSurfaceNormal:pR,czm_getDefaultMaterial:gR,czm_getDynamicAtmosphereLightDirection:_R,czm_getLambertDiffuse:yR,czm_getSpecular:AR,czm_getWaterNoise:bR,czm_HSBToRGB:xR,czm_HSLToRGB:TR,czm_hue:ER,czm_inverseGamma:CR,czm_isEmpty:vR,czm_isFull:SR,czm_latitudeToWebMercatorFraction:wR,czm_linearToSrgb:IR,czm_lineDistance:PR,czm_luminance:DR,czm_maximumComponent:RR,czm_metersPerPixel:OR,czm_modelToWindowCoordinates:MR,czm_multiplyWithColorBalance:NR,czm_nearFarScalar:LR,czm_octDecode:FR,czm_packDepth:BR,czm_pbrLighting:kR,czm_pbrNeutralTonemapping:UR,czm_phong:zR,czm_planeDistance:VR,czm_pointAlongRay:jR,czm_rayEllipsoidIntersectionInterval:HR,czm_raySphereIntersectionInterval:GR,czm_readDepth:WR,czm_readNonPerspective:qR,czm_reverseLogDepth:YR,czm_RGBToHSB:XR,czm_RGBToHSL:KR,czm_RGBToXYZ:$R,czm_round:JR,czm_saturation:ZR,czm_shadowDepthCompare:QR,czm_shadowVisibility:eO,czm_signNotZero:tO,czm_sphericalHarmonics:nO,czm_srgbToLinear:iO,czm_tangentToEyeSpaceMatrix:rO,czm_textureCube:oO,czm_transformPlane:sO,czm_translateRelativeToEye:aO,czm_translucentPhong:cO,czm_transpose:lO,czm_unpackDepth:uO,czm_unpackFloat:fO,czm_unpackTexture:dO,czm_unpackUint:hO,czm_valueTransform:mO,czm_vertexLogDepth:pO,czm_windowToEyeCoordinates:gO,czm_writeDepthClamp:_O,czm_writeLogDepth:yO,czm_writeNonPerspective:AO,czm_XYZToRGB:bO};function V8e(e,t){let n=e;return n=n.replaceAll("version 300 es",""),n=n.replaceAll(/(texture\()/g,"texture2D("),t?(n=n.replaceAll(/\n\s*(in)\s+(vec\d|mat\d|float)/g,` +`;var Ax={czm_degreesPerRadian:VD,czm_depthRange:jD,czm_epsilon1:HD,czm_epsilon2:GD,czm_epsilon3:WD,czm_epsilon4:qD,czm_epsilon5:YD,czm_epsilon6:XD,czm_epsilon7:KD,czm_infinity:$D,czm_oneOverPi:JD,czm_oneOverTwoPi:ZD,czm_passCesium3DTile:QD,czm_passCesium3DTileClassification:e1,czm_passCesium3DTileClassificationIgnoreShow:t1,czm_passCesium3DTileEdges:n1,czm_passCesium3DTileEdgesDirect:i1,czm_passCesium3DTilePlanarFillId:r1,czm_passClassification:o1,czm_passCompute:s1,czm_passEnvironment:a1,czm_passGaussianSplats:c1,czm_passGlobe:l1,czm_passOpaque:u1,czm_passOverlay:f1,czm_passTerrainClassification:d1,czm_passTranslucent:h1,czm_passVoxels:m1,czm_pi:p1,czm_piOverFour:g1,czm_piOverSix:_1,czm_piOverThree:y1,czm_piOverTwo:A1,czm_radiansPerDegree:b1,czm_sceneMode2D:x1,czm_sceneMode3D:T1,czm_sceneModeColumbusView:E1,czm_sceneModeMorphing:C1,czm_solarRadius:v1,czm_threePiOver2:S1,czm_twoPi:w1,czm_webMercatorMaxLatitude:I1,czm_depthRangeStruct:P1,czm_material:D1,czm_materialInput:R1,czm_modelMaterial:O1,czm_modelVertexOutput:M1,czm_ray:N1,czm_raySegment:L1,czm_shadowParameters:F1,czm_acesTonemapping:B1,czm_alphaWeight:k1,czm_antialias:U1,czm_applyHSBShift:z1,czm_approximateSphericalCoordinates:V1,czm_approximateTanh:j1,czm_backFacing:H1,czm_branchFreeTernary:G1,czm_cascadeColor:W1,czm_cascadeDistance:q1,czm_cascadeMatrix:Y1,czm_cascadeWeights:X1,czm_columbusViewMorph:K1,czm_computeAtmosphereColor:$1,czm_computeGroundAtmosphereScattering:J1,czm_computePosition:Z1,czm_computeScattering:Q1,czm_computeTextureTransform:eR,czm_cosineAndSine:tR,czm_decodeRGB8:nR,czm_decompressTextureCoordinates:iR,czm_depthClamp:rR,czm_eastNorthUpToEyeCoordinates:oR,czm_ellipsoidContainsPoint:sR,czm_ellipsoidTextureCoordinates:aR,czm_equalsEpsilon:cR,czm_eyeOffset:lR,czm_eyeToCartographicDelta:uR,czm_eyeToWindowCoordinates:fR,czm_fastApproximateAtan:dR,czm_fog:hR,czm_gammaCorrect:mR,czm_geodeticSurfaceNormal:pR,czm_getDefaultMaterial:gR,czm_getDynamicAtmosphereLightDirection:_R,czm_getLambertDiffuse:yR,czm_getSpecular:AR,czm_getWaterNoise:bR,czm_HSBToRGB:xR,czm_HSLToRGB:TR,czm_hue:ER,czm_inverseGamma:CR,czm_isEmpty:vR,czm_isFull:SR,czm_latitudeToWebMercatorFraction:wR,czm_linearToSrgb:IR,czm_lineDistance:PR,czm_luminance:DR,czm_maximumComponent:RR,czm_metersPerPixel:OR,czm_modelToWindowCoordinates:MR,czm_multiplyWithColorBalance:NR,czm_nearFarScalar:LR,czm_octDecode:FR,czm_packDepth:BR,czm_pbrLighting:kR,czm_pbrNeutralTonemapping:UR,czm_phong:zR,czm_planeDistance:VR,czm_pointAlongRay:jR,czm_rayEllipsoidIntersectionInterval:HR,czm_raySphereIntersectionInterval:GR,czm_readDepth:WR,czm_readNonPerspective:qR,czm_reverseLogDepth:YR,czm_RGBToHSB:XR,czm_RGBToHSL:KR,czm_RGBToXYZ:$R,czm_round:JR,czm_saturation:ZR,czm_shadowDepthCompare:QR,czm_shadowVisibility:eO,czm_signNotZero:tO,czm_sphericalHarmonics:nO,czm_srgbToLinear:iO,czm_tangentToEyeSpaceMatrix:rO,czm_textureCube:oO,czm_transformPlane:sO,czm_translateRelativeToEye:aO,czm_translucentPhong:cO,czm_transpose:lO,czm_unpackDepth:uO,czm_unpackFloat:fO,czm_unpackTexture:dO,czm_unpackUint:hO,czm_valueTransform:mO,czm_vertexLogDepth:pO,czm_windowToEyeCoordinates:gO,czm_writeDepthClamp:_O,czm_writeLogDepth:yO,czm_writeNonPerspective:AO,czm_XYZToRGB:bO};function j8e(e,t){let n=e;return n=n.replaceAll("version 300 es",""),n=n.replaceAll(/(texture\()/g,"texture2D("),t?(n=n.replaceAll(/\n\s*(in)\s+(vec\d|mat\d|float)/g,` varying $2`),/out_FragData_(\d+)/.test(n)&&(n=`#extension GL_EXT_draw_buffers : enable ${n}`,n=n.replaceAll(/layout\s+\(location\s*=\s*\d+\)\s*out\s+vec4\s+out_FragData_\d+;/g,""),n=n.replaceAll(/out_FragData_(\d+)/g,"gl_FragData[$1]")),n=n.replaceAll(/layout\s+\(location\s*=\s*0\)\s*out\s+vec4\s+out_FragColor;/g,""),n=n.replaceAll(/out_FragColor/g,"gl_FragColor"),n=n.replaceAll(/out_FragColor\[(\d+)\]/g,"gl_FragColor[$1]"),/gl_FragDepth/.test(n)&&(n=`#extension GL_EXT_frag_depth : enable ${n}`,n=n.replaceAll(/gl_FragDepth/g,"gl_FragDepthEXT")),n=`#ifdef GL_EXT_shader_texture_lod @@ -1748,8 +1748,8 @@ ${n}`,n=`#ifdef GL_OES_standard_derivatives #extension GL_OES_standard_derivatives : enable #endif ${n}`):(n=n.replaceAll(/(in)\s+(vec\d|mat\d|float)/g,"attribute $2"),n=n.replaceAll(/(out)\s+(vec\d|mat\d|float)\s+([\w]+);/g,"varying $2 $3;")),n=`#version 100 -${n}`,n}var xO=V8e;function Fde(e){return e=e.replace(/\/\/.*/g,""),e.replace(/\/\*\*[\s\S]*?\*\//gm,function(t){let n=t.match(/\n/gm).length,i="";for(let r=0;r<n;++r)i+=` -`;return i})}function Bde(e,t,n){let i;for(let r=0;r<n.length;++r)n[r].name===e&&(i=n[r]);return l(i)||(t=Fde(t),i={name:e,glslSource:t,dependsOn:[],requiredBy:[],evaluated:!1},n.push(i)),i}function kde(e,t){if(e.evaluated)return;e.evaluated=!0;let n=e.glslSource.match(/\bczm_[a-zA-Z0-9_]*/g);l(n)&&n!==null&&(n=n.filter(function(i,r){return n.indexOf(i)===r}),n.forEach(function(i){if(i!==e.name&&La._czmBuiltinsAndUniforms.hasOwnProperty(i)){let r=Bde(i,La._czmBuiltinsAndUniforms[i],t);e.dependsOn.push(r),r.requiredBy.push(e),kde(r,t)}}))}function j8e(e){let t=[],n=[];for(;e.length>0;){let r=e.pop();n.push(r),r.requiredBy.length===0&&t.push(r)}for(;t.length>0;){let r=t.shift();e.push(r);for(let o=0;o<r.dependsOn.length;++o){let s=r.dependsOn[o],a=s.requiredBy.indexOf(r);s.requiredBy.splice(a,1),s.requiredBy.length===0&&t.push(s)}}let i=[];for(let r=0;r<n.length;++r)n[r].requiredBy.length!==0&&i.push(n[r])}function H8e(e){let t=[],n=Bde("main",e,t);kde(n,t),j8e(t);let i="";for(let r=t.length-1;r>=0;--r)i=`${i+t[r].glslSource} +${n}`,n}var xO=j8e;function Fde(e){return e=e.replace(/\/\/.*/g,""),e.replace(/\/\*\*[\s\S]*?\*\//gm,function(t){let n=t.match(/\n/gm).length,i="";for(let r=0;r<n;++r)i+=` +`;return i})}function Bde(e,t,n){let i;for(let r=0;r<n.length;++r)n[r].name===e&&(i=n[r]);return l(i)||(t=Fde(t),i={name:e,glslSource:t,dependsOn:[],requiredBy:[],evaluated:!1},n.push(i)),i}function kde(e,t){if(e.evaluated)return;e.evaluated=!0;let n=e.glslSource.match(/\bczm_[a-zA-Z0-9_]*/g);l(n)&&n!==null&&(n=n.filter(function(i,r){return n.indexOf(i)===r}),n.forEach(function(i){if(i!==e.name&&La._czmBuiltinsAndUniforms.hasOwnProperty(i)){let r=Bde(i,La._czmBuiltinsAndUniforms[i],t);e.dependsOn.push(r),r.requiredBy.push(e),kde(r,t)}}))}function H8e(e){let t=[],n=[];for(;e.length>0;){let r=e.pop();n.push(r),r.requiredBy.length===0&&t.push(r)}for(;t.length>0;){let r=t.shift();e.push(r);for(let o=0;o<r.dependsOn.length;++o){let s=r.dependsOn[o],a=s.requiredBy.indexOf(r);s.requiredBy.splice(a,1),s.requiredBy.length===0&&t.push(s)}}let i=[];for(let r=0;r<n.length;++r)n[r].requiredBy.length!==0&&i.push(n[r])}function G8e(e){let t=[],n=Bde("main",e,t);kde(n,t),H8e(t);let i="";for(let r=t.length-1;r>=0;--r)i=`${i+t[r].glslSource} `;return i.replace(n.glslSource,"")}function Ude(e,t,n){let i="",r=e.sources;if(l(r))for(let g=0;g<r.length;++g)i+=` #line 0 ${r[g]}`;i=Fde(i);let o;i=i.replace(/#version\s+(.*?)\n/gm,function(g,m){return o=m,` @@ -1770,7 +1770,7 @@ ${r[g]}`;i=Fde(i);let o;i=i.replace(/#version\s+(.*?)\n/gm,function(g,m){return `),n.floatingPointTexture&&(c+=`#define OES_texture_float -`);let d="";e.includeBuiltIns&&(d=H8e(i)),c+=` +`);let d="";e.includeBuiltIns&&(d=G8e(i)),c+=` #line 0 `;let p=d+i;return n.webgl2&&t&&!/layout\s*\(location\s*=\s*0\)\s*out\s+vec4\s+out_FragColor;/g.test(p)&&!/czm_out_FragColor/g.test(p)&&/out_FragColor/g.test(p)&&(c+=`layout(location = 0) out vec4 out_FragColor; @@ -1792,9 +1792,9 @@ void main() } out_FragColor = czm_pickColor; }`;return`${n} -${i}`};function G8e(e,t){let n=e.defines,i=n.length;for(let r=0;r<i;++r)if(n[r]===t)return!0;return!1}function zde(e,t){let n=e.sources,i=n.length;for(let r=0;r<i;++r)if(n[r].indexOf(t)!==-1)return!0;return!1}function Vde(e,t){let n=t.length;for(let i=0;i<n;++i){let r=t[i];if(zde(e,r))return r}}var W8e=["v_normalEC","v_normal"];La.findNormalVarying=function(e){return zde(e,"#ifdef HAS_NORMALS")?G8e(e,"HAS_NORMALS")?"v_normalEC":void 0:Vde(e,W8e)};var q8e=["v_positionEC"];La.findPositionVarying=function(e){return Vde(e,q8e)};var Ye=La;function qh(e){this._context=e,this._shaders={},this._numberOfShaders=0,this._shadersToRelease={}}Object.defineProperties(qh.prototype,{numberOfShaders:{get:function(){return this._numberOfShaders}}});qh.prototype.replaceShaderProgram=function(e){return l(e.shaderProgram)&&e.shaderProgram.destroy(),this.getShaderProgram(e)};function Y8e(e){let t=Object.keys(e).sort();return JSON.stringify(e,t)}qh.prototype.getShaderProgram=function(e){let t=e.vertexShaderSource,n=e.fragmentShaderSource,i=e.attributeLocations;typeof t=="string"&&(t=new Ye({sources:[t]})),typeof n=="string"&&(n=new Ye({sources:[n]}));let r=t.getCacheKey(),o=n.getCacheKey(),s=l(i)?Y8e(i):"",a=`${r}:${o}:${s}`,c;if(l(this._shaders[a]))c=this._shaders[a],delete this._shadersToRelease[a];else{let u=this._context,f=t.createCombinedVertexShader(u),d=n.createCombinedFragmentShader(u),p=new Qt({gl:u._gl,logShaderCompilation:u.logShaderCompilation,debugShaders:u.debugShaders,vertexShaderSource:t,vertexShaderText:f,fragmentShaderSource:n,fragmentShaderText:d,attributeLocations:i});c={cache:this,shaderProgram:p,keyword:a,derivedKeywords:[],count:0},p._cachedShader=c,this._shaders[a]=c,++this._numberOfShaders}return++c.count,c.shaderProgram};qh.prototype.replaceDerivedShaderProgram=function(e,t,n){let i=e._cachedShader,r=t+i.keyword,o=this._shaders[r];if(l(o)){LX(this,o);let s=i.derivedKeywords.indexOf(t);s>-1&&i.derivedKeywords.splice(s,1)}return this.createDerivedShaderProgram(e,t,n)};qh.prototype.getDerivedShaderProgram=function(e,t){let n=e._cachedShader,i=t+n.keyword,r=this._shaders[i];if(l(r))return r.shaderProgram};qh.prototype.createDerivedShaderProgram=function(e,t,n){let i=e._cachedShader,r=t+i.keyword,o=n.vertexShaderSource,s=n.fragmentShaderSource,a=n.attributeLocations;typeof o=="string"&&(o=new Ye({sources:[o]})),typeof s=="string"&&(s=new Ye({sources:[s]}));let c=this._context,u=o.createCombinedVertexShader(c),f=s.createCombinedFragmentShader(c),d=new Qt({gl:c._gl,logShaderCompilation:c.logShaderCompilation,debugShaders:c.debugShaders,vertexShaderSource:o,vertexShaderText:u,fragmentShaderSource:s,fragmentShaderText:f,attributeLocations:a}),p={cache:this,shaderProgram:d,keyword:r,derivedKeywords:[],count:0};return i.derivedKeywords.push(t),d._cachedShader=p,this._shaders[r]=p,d};function LX(e,t){let n=t.derivedKeywords,i=n.length;for(let r=0;r<i;++r){let o=n[r]+t.keyword,s=e._shaders[o];LX(e,s)}delete e._shaders[t.keyword],t.shaderProgram.finalDestroy()}qh.prototype.destroyReleasedShaderPrograms=function(){let e=this._shadersToRelease;for(let t in e)if(e.hasOwnProperty(t)){let n=e[t];LX(this,n),--this._numberOfShaders}this._shadersToRelease={}};qh.prototype.releaseShaderProgram=function(e){if(l(e)){let t=e._cachedShader;t&&--t.count===0&&(this._shadersToRelease[t.keyword]=t)}};qh.prototype.isDestroyed=function(){return!1};qh.prototype.destroy=function(){let e=this._shaders;for(let t in e)e.hasOwnProperty(t)&&e[t].shaderProgram.finalDestroy();return le(this)};var TO=qh;function Dd(e){e=e??H.EMPTY_OBJECT;let{context:t,source:n,pixelFormat:i=Ke.RGBA,pixelDatatype:r=ze.UNSIGNED_BYTE,flipY:o=!0,skipColorSpaceConversion:s=!1,sampler:a=new jt}=e,{width:c,height:u}=e;l(n)&&(l(c)||(c=n.videoWidth??n.naturalWidth??n.width),l(u)||(u=n.videoHeight??n.naturalHeight??n.height));let f=e.preMultiplyAlpha||i===Ke.RGB||i===Ke.LUMINANCE,d=Ke.toInternalFormat(i,r,t),p=Ke.isCompressedFormat(d),g=t._gl,m=p?Ke.compressedTextureSizeInBytes(i,c,u):Ke.textureSizeInBytes(i,r,c,u);this._id=e.id??Kn(),this._context=t,this._textureFilterAnisotropic=t._textureFilterAnisotropic,this._textureTarget=g.TEXTURE_2D,this._texture=g.createTexture(),this._internalFormat=d,this._pixelFormat=i,this._pixelDatatype=r,this._width=c,this._height=u,this._dimensions=new U(c,u),this._hasMipmap=!1,this._sizeInBytes=m,this._preMultiplyAlpha=f,this._flipY=o,this._initialized=!1,this._sampler=void 0,this._sampler=a,Wde(this,a),g.activeTexture(g.TEXTURE0),g.bindTexture(this._textureTarget,this._texture),l(n)?(s?g.pixelStorei(g.UNPACK_COLORSPACE_CONVERSION_WEBGL,g.NONE):g.pixelStorei(g.UNPACK_COLORSPACE_CONVERSION_WEBGL,g.BROWSER_DEFAULT_WEBGL),l(n.arrayBufferView)?Ke.isCompressedFormat(d)?X8e(this,n):jde(this,n):l(n.framebuffer)?$8e(this,n):Hde(this,n),this._initialized=!0):Gde(this),g.bindTexture(this._textureTarget,null)}function X8e(e,t){let i=e._context._gl,r=e._textureTarget,o=e._internalFormat,{width:s,height:a}=e;if(i.pixelStorei(i.UNPACK_ALIGNMENT,4),i.pixelStorei(i.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!1),i.pixelStorei(i.UNPACK_FLIP_Y_WEBGL,!1),i.compressedTexImage2D(r,0,o,s,a,0,t.arrayBufferView),l(t.mipLevels)){let c=s,u=a;for(let f=0;f<t.mipLevels.length;++f)c=h6(c),u=h6(u),i.compressedTexImage2D(r,f+1,o,c,u,0,t.mipLevels[f])}}function jde(e,t){let n=e._context,i=n._gl,r=e._textureTarget,o=e._internalFormat,{width:s,height:a,pixelFormat:c,pixelDatatype:u,flipY:f}=e,d=Ke.alignmentInBytes(c,u,s);i.pixelStorei(i.UNPACK_ALIGNMENT,d),i.pixelStorei(i.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!1),i.pixelStorei(i.UNPACK_FLIP_Y_WEBGL,!1);let{arrayBufferView:p}=t;if(f&&(p=Ke.flipY(p,c,u,s,a)),i.texImage2D(r,0,o,s,a,0,c,ze.toWebGLConstant(u,n),p),l(t.mipLevels)){let g=s,m=a;for(let y=0;y<t.mipLevels.length;++y)g=h6(g),m=h6(m),i.texImage2D(r,y+1,o,g,m,0,c,ze.toWebGLConstant(u,n),t.mipLevels[y])}}function K8e(e,t,n,i,r,o){let s=e._context,a=s._gl,{pixelFormat:c,pixelDatatype:u}=e,f=Ke.alignmentInBytes(c,u,r);a.pixelStorei(a.UNPACK_ALIGNMENT,f),a.pixelStorei(a.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!1),a.pixelStorei(a.UNPACK_FLIP_Y_WEBGL,!1),e.flipY&&(t=Ke.flipY(t,c,u,r,o)),a.texSubImage2D(e._textureTarget,0,n,i,r,o,c,ze.toWebGLConstant(u,s),t)}function $8e(e,t){let n=e._context,i=n._gl;i.pixelStorei(i.UNPACK_ALIGNMENT,4),i.pixelStorei(i.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!1),i.pixelStorei(i.UNPACK_FLIP_Y_WEBGL,!1),t.framebuffer!==n.defaultFramebuffer&&t.framebuffer._bind(),i.copyTexImage2D(e._textureTarget,0,e._internalFormat,t.xOffset,t.yOffset,e.width,e.height,0),t.framebuffer!==n.defaultFramebuffer&&t.framebuffer._unBind()}function Hde(e,t){let n=e._context,i=n._gl;i.pixelStorei(i.UNPACK_ALIGNMENT,4),i.pixelStorei(i.UNPACK_PREMULTIPLY_ALPHA_WEBGL,e.preMultiplyAlpha),i.pixelStorei(i.UNPACK_FLIP_Y_WEBGL,e.flipY),i.texImage2D(e._textureTarget,0,e._internalFormat,e.pixelFormat,ze.toWebGLConstant(e.pixelDatatype,n),t)}function J8e(e,t,n,i){let r=e._context,o=r._gl;o.pixelStorei(o.UNPACK_ALIGNMENT,4),o.pixelStorei(o.UNPACK_PREMULTIPLY_ALPHA_WEBGL,e.preMultiplyAlpha),o.pixelStorei(o.UNPACK_FLIP_Y_WEBGL,e.flipY),o.texSubImage2D(e._textureTarget,0,n,i,e.pixelFormat,ze.toWebGLConstant(e.pixelDatatype,r),t)}function h6(e){let t=Math.floor(e/2)|0;return Math.max(t,1)}function Gde(e){let t=e._context;t._gl.texImage2D(e._textureTarget,0,e._internalFormat,e._width,e._height,0,e._pixelFormat,ze.toWebGLConstant(e._pixelDatatype,t),null)}Dd.create=function(e){return new Dd(e)};Dd.fromFramebuffer=function(e){e=e??H.EMPTY_OBJECT;let t=e.context,{pixelFormat:n=Ke.RGB,framebufferXOffset:i=0,framebufferYOffset:r=0,width:o=t.drawingBufferWidth,height:s=t.drawingBufferHeight,framebuffer:a}=e;return new Dd({context:t,width:o,height:s,pixelFormat:n,source:{framebuffer:l(a)?a:t.defaultFramebuffer,xOffset:i,yOffset:r,width:o,height:s}})};Object.defineProperties(Dd.prototype,{id:{get:function(){return this._id}},sampler:{get:function(){return this._sampler},set:function(e){Wde(this,e),this._sampler=e}},pixelFormat:{get:function(){return this._pixelFormat}},pixelDatatype:{get:function(){return this._pixelDatatype}},dimensions:{get:function(){return this._dimensions}},preMultiplyAlpha:{get:function(){return this._preMultiplyAlpha}},flipY:{get:function(){return this._flipY}},width:{get:function(){return this._width}},height:{get:function(){return this._height}},sizeInBytes:{get:function(){return this._hasMipmap?Math.floor(this._sizeInBytes*4/3):this._sizeInBytes}},_target:{get:function(){return this._textureTarget}}});function Wde(e,t){let{minificationFilter:n,magnificationFilter:i}=t,r=[Wt.NEAREST_MIPMAP_NEAREST,Wt.NEAREST_MIPMAP_LINEAR,Wt.LINEAR_MIPMAP_NEAREST,Wt.LINEAR_MIPMAP_LINEAR].includes(n),o=e._context,s=e._pixelFormat,a=e._pixelDatatype;(a===ze.FLOAT&&!o.textureFloatLinear||a===ze.HALF_FLOAT&&!o.textureHalfFloatLinear)&&(n=r?Wt.NEAREST_MIPMAP_NEAREST:Wt.NEAREST,i=Jn.NEAREST),o.webgl2&&Ke.isDepthFormat(s)&&(n=Wt.NEAREST,i=Jn.NEAREST);let c=o._gl,u=e._textureTarget;c.activeTexture(c.TEXTURE0),c.bindTexture(u,e._texture),c.texParameteri(u,c.TEXTURE_MIN_FILTER,n),c.texParameteri(u,c.TEXTURE_MAG_FILTER,i),c.texParameteri(u,c.TEXTURE_WRAP_S,t.wrapS),c.texParameteri(u,c.TEXTURE_WRAP_T,t.wrapT),l(e._textureFilterAnisotropic)&&c.texParameteri(u,e._textureFilterAnisotropic.TEXTURE_MAX_ANISOTROPY_EXT,t.maximumAnisotropy),c.bindTexture(u,null)}Dd.prototype.copyFrom=function(e){let{xOffset:t=0,yOffset:n=0,source:i,skipColorSpaceConversion:r=!1}=e,s=this._context._gl,a=this._textureTarget;s.activeTexture(s.TEXTURE0),s.bindTexture(a,this._texture);let{width:c,height:u}=i;l(i.videoWidth)&&l(i.videoHeight)?(c=i.videoWidth,u=i.videoHeight):l(i.naturalWidth)&&l(i.naturalHeight)&&(c=i.naturalWidth,u=i.naturalHeight),r?s.pixelStorei(s.UNPACK_COLORSPACE_CONVERSION_WEBGL,s.NONE):s.pixelStorei(s.UNPACK_COLORSPACE_CONVERSION_WEBGL,s.BROWSER_DEFAULT_WEBGL);let f=!1;this._initialized||(t===0&&n===0&&c===this._width&&u===this._height?(l(i.arrayBufferView)?jde(this,i):Hde(this,i),f=!0):(s.pixelStorei(s.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!1),s.pixelStorei(s.UNPACK_FLIP_Y_WEBGL,!1),Gde(this)),this._initialized=!0),f||(l(i.arrayBufferView)?K8e(this,i.arrayBufferView,t,n,c,u):J8e(this,i,t,n)),s.bindTexture(a,null)};Dd.prototype.copyFromFramebuffer=function(e,t,n,i,r,o){e=e??0,t=t??0,n=n??0,i=i??0,r=r??this._width,o=o??this._height;let s=this._context._gl,a=this._textureTarget;s.activeTexture(s.TEXTURE0),s.bindTexture(a,this._texture),s.copyTexSubImage2D(a,0,e,t,n,i,r,o),s.bindTexture(a,null),this._initialized=!0};Dd.prototype.generateMipmap=function(e){e=e??Pd.DONT_CARE,this._hasMipmap=!0;let t=this._context._gl,n=this._textureTarget;t.hint(t.GENERATE_MIPMAP_HINT,e),t.activeTexture(t.TEXTURE0),t.bindTexture(n,this._texture),t.generateMipmap(n),t.bindTexture(n,null)};Dd.prototype.isDestroyed=function(){return!1};Dd.prototype.destroy=function(){return this._context._gl.deleteTexture(this._texture),le(this)};Dd.defaultColor=z.WHITE;var Dt=Dd;function bx(){this._textures={},this._numberOfTextures=0,this._texturesToRelease={}}Object.defineProperties(bx.prototype,{numberOfTextures:{get:function(){return this._numberOfTextures}}});bx.prototype.getTexture=function(e){let t=this._textures[e];if(l(t))return delete this._texturesToRelease[e],++t.count,t.texture};bx.prototype.addTexture=function(e,t){let n={texture:t,count:1};t.finalDestroy=t.destroy;let i=this;t.destroy=function(){--n.count===0&&(i._texturesToRelease[e]=n)},this._textures[e]=n,++this._numberOfTextures};bx.prototype.destroyReleasedTextures=function(){let e=this._texturesToRelease;for(let t in e)if(e.hasOwnProperty(t)){let n=e[t];delete this._textures[t],n.texture.finalDestroy(),--this._numberOfTextures}this._texturesToRelease={}};bx.prototype.isDestroyed=function(){return!1};bx.prototype.destroy=function(){let e=this._textures;for(let t in e)e.hasOwnProperty(t)&&e[t].texture.finalDestroy();return le(this)};var EO=bx;function Rd(e){this.planes=e??[]}var CO=[new h,new h,new h];h.clone(h.UNIT_X,CO[0]);h.clone(h.UNIT_Y,CO[1]);h.clone(h.UNIT_Z,CO[2]);var Fy=new h,Z8e=new h,qde=new sn(new h(1,0,0),0);function Yde(e,t){let n=t.normal;return n.x=e.x,n.y=e.y,n.z=e.z,t.distance=e.w,t}Rd.fromBoundingSphere=function(e,t){l(t)||(t=new Rd);let n=CO.length,i=t.planes;i.length=2*n;let r=e.center,o=e.radius,s=0;for(let a=0;a<n;++a){let c=CO[a],u=i[s],f=i[s+1];l(u)||(u=i[s]=new se),l(f)||(f=i[s+1]=new se),h.multiplyByScalar(c,-o,Fy),h.add(r,Fy,Fy),u.x=c.x,u.y=c.y,u.z=c.z,u.w=-h.dot(c,Fy),h.multiplyByScalar(c,o,Fy),h.add(r,Fy,Fy),f.x=-c.x,f.y=-c.y,f.z=-c.z,f.w=-h.dot(h.negate(c,Z8e),Fy),s+=2}return t};Rd.prototype.computeVisibility=function(e){let t=this.planes,n=!1;for(let i=0,r=t.length;i<r;++i){let o=e.intersectPlane(Yde(t[i],qde));if(o===$t.OUTSIDE)return $t.OUTSIDE;o===$t.INTERSECTING&&(n=!0)}return n?$t.INTERSECTING:$t.INSIDE};Rd.prototype.computeVisibilityWithPlaneMask=function(e,t){if(t===Rd.MASK_OUTSIDE||t===Rd.MASK_INSIDE)return t;let n=Rd.MASK_INSIDE,i=this.planes;for(let r=0,o=i.length;r<o;++r){let s=r<31?1<<r:0;if(r<31&&(t&s)===0)continue;let a=e.intersectPlane(Yde(i[r],qde));if(a===$t.OUTSIDE)return Rd.MASK_OUTSIDE;a===$t.INTERSECTING&&(n|=s)}return n};Rd.MASK_OUTSIDE=4294967295;Rd.MASK_INSIDE=0;Rd.MASK_INDETERMINATE=2147483647;var ta=Rd;function Lp(e){e=e??H.EMPTY_OBJECT,this.left=e.left,this._left=void 0,this.right=e.right,this._right=void 0,this.top=e.top,this._top=void 0,this.bottom=e.bottom,this._bottom=void 0,this.near=e.near??1,this._near=this.near,this.far=e.far??5e8,this._far=this.far,this._cullingVolume=new ta,this._orthographicMatrix=new N}function Xde(e){(e.top!==e._top||e.bottom!==e._bottom||e.left!==e._left||e.right!==e._right||e.near!==e._near||e.far!==e._far)&&(e._left=e.left,e._right=e.right,e._top=e.top,e._bottom=e.bottom,e._near=e.near,e._far=e.far,e._orthographicMatrix=N.computeOrthographicOffCenter(e.left,e.right,e.bottom,e.top,e.near,e.far,e._orthographicMatrix))}Object.defineProperties(Lp.prototype,{projectionMatrix:{get:function(){return Xde(this),this._orthographicMatrix}}});var Q8e=new h,eje=new h,tje=new h,FX=new h;Lp.prototype.computeCullingVolume=function(e,t,n){let i=this._cullingVolume.planes,r=this.top,o=this.bottom,s=this.right,a=this.left,c=this.near,u=this.far,f=h.cross(t,n,Q8e);h.normalize(f,f);let d=eje;h.multiplyByScalar(t,c,d),h.add(e,d,d);let p=tje;h.multiplyByScalar(f,a,p),h.add(d,p,p);let g=i[0];return l(g)||(g=i[0]=new se),g.x=f.x,g.y=f.y,g.z=f.z,g.w=-h.dot(f,p),h.multiplyByScalar(f,s,p),h.add(d,p,p),g=i[1],l(g)||(g=i[1]=new se),g.x=-f.x,g.y=-f.y,g.z=-f.z,g.w=-h.dot(h.negate(f,FX),p),h.multiplyByScalar(n,o,p),h.add(d,p,p),g=i[2],l(g)||(g=i[2]=new se),g.x=n.x,g.y=n.y,g.z=n.z,g.w=-h.dot(n,p),h.multiplyByScalar(n,r,p),h.add(d,p,p),g=i[3],l(g)||(g=i[3]=new se),g.x=-n.x,g.y=-n.y,g.z=-n.z,g.w=-h.dot(h.negate(n,FX),p),g=i[4],l(g)||(g=i[4]=new se),g.x=t.x,g.y=t.y,g.z=t.z,g.w=-h.dot(t,d),h.multiplyByScalar(t,u,p),h.add(e,p,p),g=i[5],l(g)||(g=i[5]=new se),g.x=-t.x,g.y=-t.y,g.z=-t.z,g.w=-h.dot(h.negate(t,FX),p),this._cullingVolume};Lp.prototype.getPixelDimensions=function(e,t,n,i,r){Xde(this);let o=this.right-this.left,s=this.top-this.bottom,a=i*o/e,c=i*s/t;return r.x=a,r.y=c,r};Lp.prototype.clone=function(e){return l(e)||(e=new Lp),e.left=this.left,e.right=this.right,e.top=this.top,e.bottom=this.bottom,e.near=this.near,e.far=this.far,e._left=void 0,e._right=void 0,e._top=void 0,e._bottom=void 0,e._near=void 0,e._far=void 0,e};Lp.prototype.equals=function(e){return l(e)&&e instanceof Lp&&this.right===e.right&&this.left===e.left&&this.top===e.top&&this.bottom===e.bottom&&this.near===e.near&&this.far===e.far};Lp.prototype.equalsEpsilon=function(e,t,n){return e===this||l(e)&&e instanceof Lp&&D.equalsEpsilon(this.right,e.right,t,n)&&D.equalsEpsilon(this.left,e.left,t,n)&&D.equalsEpsilon(this.top,e.top,t,n)&&D.equalsEpsilon(this.bottom,e.bottom,t,n)&&D.equalsEpsilon(this.near,e.near,t,n)&&D.equalsEpsilon(this.far,e.far,t,n)};var ys=Lp;function Mu(e){e=e??H.EMPTY_OBJECT,this._offCenterFrustum=new ys,this.width=e.width,this._width=void 0,this.aspectRatio=e.aspectRatio,this._aspectRatio=void 0,this.near=e.near??1,this._near=this.near,this.far=e.far??5e8,this._far=this.far}Mu.packedLength=4;Mu.pack=function(e,t,n){return n=n??0,t[n++]=e.width,t[n++]=e.aspectRatio,t[n++]=e.near,t[n]=e.far,t};Mu.unpack=function(e,t,n){return t=t??0,l(n)||(n=new Mu),n.width=e[t++],n.aspectRatio=e[t++],n.near=e[t++],n.far=e[t],n};function By(e){let t=e._offCenterFrustum;if(e.width!==e._width||e.aspectRatio!==e._aspectRatio||e.near!==e._near||e.far!==e._far){e._aspectRatio=e.aspectRatio,e._width=e.width,e._near=e.near,e._far=e.far;let n=1/e.aspectRatio;t.right=e.width*.5,t.left=-t.right,t.top=n*t.right,t.bottom=-t.top,t.near=e.near,t.far=e.far}}Object.defineProperties(Mu.prototype,{projectionMatrix:{get:function(){return By(this),this._offCenterFrustum.projectionMatrix}},offCenterFrustum:{get:function(){return By(this),this._offCenterFrustum}}});Mu.prototype.computeCullingVolume=function(e,t,n){return By(this),this._offCenterFrustum.computeCullingVolume(e,t,n)};Mu.prototype.getPixelDimensions=function(e,t,n,i,r){return By(this),this._offCenterFrustum.getPixelDimensions(e,t,n,i,r)};Mu.prototype.clone=function(e){return l(e)||(e=new Mu),e.aspectRatio=this.aspectRatio,e.width=this.width,e.near=this.near,e.far=this.far,e._aspectRatio=void 0,e._width=void 0,e._near=void 0,e._far=void 0,this._offCenterFrustum.clone(e._offCenterFrustum),e};Mu.prototype.equals=function(e){return!l(e)||!(e instanceof Mu)?!1:(By(this),By(e),this.width===e.width&&this.aspectRatio===e.aspectRatio&&this._offCenterFrustum.equals(e._offCenterFrustum))};Mu.prototype.equalsEpsilon=function(e,t,n){return!l(e)||!(e instanceof Mu)?!1:(By(this),By(e),D.equalsEpsilon(this.width,e.width,t,n)&&D.equalsEpsilon(this.aspectRatio,e.aspectRatio,t,n)&&this._offCenterFrustum.equalsEpsilon(e._offCenterFrustum,t,n))};var gn=Mu;var BX={};function nje(e){let t=6.239996+.0172019696544*e;return .001657*Math.sin(t+.01671*Math.sin(t))}var ije=32.184,rje=2451545;function hhe(e,t){t=K.addSeconds(e,ije,t);let n=K.totalDays(t)-rje;return t=K.addSeconds(t,nje(n),t),t}var m6=new K(2451545,0,si.TAI),oje=1e3,Od=D.RADIANS_PER_DEGREE,vf=D.RADIANS_PER_ARCSECOND,Pc=14959787e4,Kde=new $;function mhe(e,t,n,i,r,o,s){n<0&&(n=-n,r+=D.PI);let a=e*(1-t),c=i-r,u=r,f=aje(o-i,t),d=sje(t,0);dje(c,n,u,Kde);let p=a*(1+t),g=Math.cos(f),m=Math.sin(f),y=1+t*g,A=p/y;return l(s)?(s.x=A*g,s.y=A*m,s.z=0):s=new h(A*g,A*m,0),$.multiplyByVector(Kde,s,s)}function sje(e,t){return e<=t?"Circular":e<1-t?"Elliptical":e<=1+t?"Parabolic":"Hyperbolic"}function aje(e,t){let n=uje(e,t);return fje(n,t)}var cje=50,lje=D.EPSILON8;function uje(e,t){let n=Math.floor(e/D.TWO_PI);e-=n*D.TWO_PI;let i=e+t*Math.sin(e)/(1-Math.sin(e+t)+Math.sin(e)),r=Number.MAX_VALUE,o;for(o=0;o<cje&&Math.abs(r-i)>lje;++o){r=i;let s=r-t*Math.sin(r)-e,a=1-t*Math.cos(r);i=r-s/a}return r=i+n*D.TWO_PI,r}function fje(e,t){let n=Math.floor(e/D.TWO_PI);e-=n*D.TWO_PI;let i=Math.cos(e)-t,r=Math.sin(e)*Math.sqrt(1-t*t),o=Math.atan2(r,i);return o=D.zeroToTwoPi(o),e<0&&(o-=D.TWO_PI),o+=n*D.TWO_PI,o}function dje(e,t,n,i){let r=Math.cos(e),o=Math.sin(e),s=Math.cos(t),a=Math.sin(t),c=Math.cos(n),u=Math.sin(n);return l(i)?(i[0]=c*r-u*o*s,i[1]=u*r+c*o*s,i[2]=o*a,i[3]=-c*o-u*r*s,i[4]=-u*o+c*r*s,i[5]=r*a,i[6]=u*a,i[7]=-c*a,i[8]=s):i=new $(c*r-u*o*s,-c*o-u*r*s,u*a,u*r+c*o*s,-u*o+c*r*s,-c*a,o*a,r*a,s),i}var hje=1.0000010178*Pc,mje=100.46645683*Od,pje=129597742283429e-5*vf,$de=16002,Jde=21863,Zde=32004,Qde=10931,ehe=14529,the=16368,nhe=15318,ihe=32794,gje=64*1e-7*Pc,_je=-152*1e-7*Pc,yje=62*1e-7*Pc,Aje=-8*1e-7*Pc,bje=32*1e-7*Pc,xje=-41*1e-7*Pc,Tje=19*1e-7*Pc,Eje=-11*1e-7*Pc,Cje=-150*1e-7*Pc,vje=-46*1e-7*Pc,Sje=68*1e-7*Pc,wje=54*1e-7*Pc,Ije=14*1e-7*Pc,Pje=24*1e-7*Pc,Dje=-28*1e-7*Pc,Rje=22*1e-7*Pc,rhe=10,ohe=16002,she=21863,ahe=10931,che=1473,lhe=32004,uhe=4387,fhe=73,Oje=-325*1e-7,Mje=-322*1e-7,Nje=-79*1e-7,Lje=232*1e-7,Fje=-52*1e-7,Bje=97*1e-7,kje=55*1e-7,Uje=-41*1e-7,zje=-105*1e-7,Vje=-137*1e-7,jje=258*1e-7,Hje=35*1e-7,Gje=-116*1e-7,Wje=-88*1e-7,qje=-112*1e-7,Yje=-80*1e-7,Tv=new K(0,0,si.TAI);function Xje(e,t){hhe(e,Tv);let i=(Tv.dayNumber-m6.dayNumber+(Tv.secondsOfDay-m6.secondsOfDay)/kn.SECONDS_PER_DAY)/(kn.DAYS_PER_JULIAN_CENTURY*10),r=.3595362*i,o=hje+gje*Math.cos($de*r)+Cje*Math.sin($de*r)+_je*Math.cos(Jde*r)+vje*Math.sin(Jde*r)+yje*Math.cos(Zde*r)+Sje*Math.sin(Zde*r)+Aje*Math.cos(Qde*r)+wje*Math.sin(Qde*r)+bje*Math.cos(ehe*r)+Ije*Math.sin(ehe*r)+xje*Math.cos(the*r)+Pje*Math.sin(the*r)+Tje*Math.cos(nhe*r)+Dje*Math.sin(nhe*r)+Eje*Math.cos(ihe*r)+Rje*Math.sin(ihe*r),s=mje+pje*i+Oje*Math.cos(rhe*r)+zje*Math.sin(rhe*r)+Mje*Math.cos(ohe*r)+Vje*Math.sin(ohe*r)+Nje*Math.cos(she*r)+jje*Math.sin(she*r)+Lje*Math.cos(ahe*r)+Hje*Math.sin(ahe*r)+Fje*Math.cos(che*r)+Gje*Math.sin(che*r)+Bje*Math.cos(lhe*r)+Wje*Math.sin(lhe*r)+kje*Math.cos(uhe*r)+qje*Math.sin(uhe*r)+Uje*Math.cos(fhe*r)+Yje*Math.sin(fhe*r),a=.0167086342-.0004203654*i,c=102.93734808*Od+11612.3529*vf*i,u=469.97289*vf*i,f=174.87317577*Od-8679.27034*vf*i;return mhe(o,a,u,c,f,s,t)}function phe(e,t){hhe(e,Tv);let i=(Tv.dayNumber-m6.dayNumber+(Tv.secondsOfDay-m6.secondsOfDay)/kn.SECONDS_PER_DAY)/kn.DAYS_PER_JULIAN_CENTURY,r=i*i,o=r*i,s=o*i,a=383397.7725+.004*i,c=.055545526-16e-9*i,u=5.15668983*Od,f=-8e-5*i+.02966*r-42e-6*o-13e-8*s,d=83.35324312*Od,p=146434202669e-4*i-38.2702*r-.045047*o+21301e-8*s,g=125.04455501*Od,m=-69679193631e-4*i+6.3602*r+.007625*o-3586e-8*s,y=218.31664563*Od,A=17325593434847e-4*i-6.391*r+.006588*o-3169e-8*s,b=297.85019547*Od+vf*(1602961601209e-3*i-6.3706*r+.006593*o-3169e-8*s),x=93.27209062*Od+vf*(17395272628478e-4*i-12.7512*r-.001037*o+417e-8*s),T=134.96340251*Od+vf*(17179159232178e-4*i+31.8792*r+.051635*o-2447e-7*s),E=357.52910918*Od+vf*(1295965810481e-4*i-.5532*r+136e-6*o-1149e-8*s),v=310.17137918*Od-vf*(6967051436e-3*i+6.2068*r+.007618*o-3219e-8*s),S=2*b,I=4*b,R=6*b,O=2*T,L=3*T,_=4*T,C=2*x;a+=3400.4*Math.cos(S)-635.6*Math.cos(S-T)-235.6*Math.cos(T)+218.1*Math.cos(S-E)+181*Math.cos(S+T),c+=.014216*Math.cos(S-T)+.008551*Math.cos(S-O)-.001383*Math.cos(T)+.001356*Math.cos(S+T)-.001147*Math.cos(I-L)-914e-6*Math.cos(I-O)+869e-6*Math.cos(S-E-T)-627e-6*Math.cos(S)-394e-6*Math.cos(I-_)+282e-6*Math.cos(S-E-O)-279e-6*Math.cos(b-T)-236e-6*Math.cos(O)+231e-6*Math.cos(I)+229e-6*Math.cos(R-_)-201e-6*Math.cos(O-C),f+=486.26*Math.cos(S-C)-40.13*Math.cos(S)+37.51*Math.cos(C)+25.73*Math.cos(O-C)+19.97*Math.cos(S-E-C),p+=-55609*Math.sin(S-T)-34711*Math.sin(S-O)-9792*Math.sin(T)+9385*Math.sin(I-L)+7505*Math.sin(I-O)+5318*Math.sin(S+T)+3484*Math.sin(I-_)-3417*Math.sin(S-E-T)-2530*Math.sin(R-_)-2376*Math.sin(S)-2075*Math.sin(S-L)-1883*Math.sin(O)-1736*Math.sin(R-5*T)+1626*Math.sin(E)-1370*Math.sin(R-L),m+=-5392*Math.sin(S-C)-540*Math.sin(E)-441*Math.sin(S)+423*Math.sin(C)-288*Math.sin(O-C),A+=-3332.9*Math.sin(S)+1197.4*Math.sin(S-T)-662.5*Math.sin(E)+396.3*Math.sin(T)-218*Math.sin(S-E);let w=2*v,P=3*v;f+=46.997*Math.cos(v)*i-.614*Math.cos(S-C+v)*i+.614*Math.cos(S-C-v)*i-.0297*Math.cos(w)*r-.0335*Math.cos(v)*r+.0012*Math.cos(S-C+w)*r-16e-5*Math.cos(v)*o+4e-5*Math.cos(P)*o+4e-5*Math.cos(w)*o;let M=2.116*Math.sin(v)*i-.111*Math.sin(S-C-v)*i-.0015*Math.sin(v)*r;p+=M,A+=M,m+=-520.77*Math.sin(v)*i+13.66*Math.sin(S-C+v)*i+1.12*Math.sin(S-v)*i-1.06*Math.sin(C-v)*i+.66*Math.sin(w)*r+.371*Math.sin(v)*r-.035*Math.sin(S-C+w)*r-.015*Math.sin(S-C+v)*r+.0014*Math.sin(v)*o-.0011*Math.sin(P)*o-9e-4*Math.sin(w)*o,a*=oje;let F=u+f*vf,V=d+p*vf,B=y+A*vf,j=g+m*vf;return mhe(a,c,F,V,j,B,t)}var dhe=.012300034,Kje=dhe/(dhe+1)*-1;function $je(e,t){return t=phe(e,t),h.multiplyByScalar(t,Kje,t)}var ghe=new $(1.0000000000000002,5619723173785822e-31,4690511510146299e-34,-5154129427414611e-31,.9174820620691819,-.39777715593191376,-223970096136568e-30,.39777715593191376,.9174820620691819),vO=new h;BX.computeSunPositionInEarthInertialFrame=function(e,t){return l(e)||(e=K.now()),l(t)||(t=new h),vO=Xje(e,vO),t=h.negate(vO,t),$je(e,vO),h.subtract(t,vO,t),$.multiplyByVector(ghe,t,t),t};BX.computeMoonPositionInEarthInertialFrame=function(e,t){return l(e)||(e=K.now()),t=phe(e,t),$.multiplyByVector(ghe,t,t),t};var ky=BX;var SO={MORPHING:0,COLUMBUS_VIEW:1,SCENE2D:2,SCENE3D:3};SO.getMorphTime=function(e){return e===SO.SCENE3D?1:e===SO.MORPHING?void 0:0};Object.freeze(SO);var re=SO;function Jje(e){e=e??H.EMPTY_OBJECT,this.color=z.clone(e.color??z.WHITE),this.intensity=e.intensity??2}var dg=Jje;function Ev(){this.globeDepthTexture=void 0,this.edgeIdTexture=void 0,this.edgeColorTexture=void 0,this.edgeDepthTexture=void 0,this.planarFillIdTexture=void 0,this.gamma=void 0,this._viewport=new et,this._viewportCartesian4=new se,this._viewportDirty=!1,this._viewportOrthographicMatrix=N.clone(N.IDENTITY),this._viewportTransformation=N.clone(N.IDENTITY),this._model=N.clone(N.IDENTITY),this._view=N.clone(N.IDENTITY),this._inverseView=N.clone(N.IDENTITY),this._projection=N.clone(N.IDENTITY),this._infiniteProjection=N.clone(N.IDENTITY),this._entireFrustum=new U,this._currentFrustum=new U,this._frustumPlanes=new se,this._farDepthFromNearPlusOne=void 0,this._log2FarDepthFromNearPlusOne=void 0,this._oneOverLog2FarDepthFromNearPlusOne=void 0,this._frameState=void 0,this._temeToPseudoFixed=$.clone(N.IDENTITY),this._view3DDirty=!0,this._view3D=new N,this._inverseView3DDirty=!0,this._inverseView3D=new N,this._inverseModelDirty=!0,this._inverseModel=new N,this._inverseTransposeModelDirty=!0,this._inverseTransposeModel=new $,this._viewRotation=new $,this._inverseViewRotation=new $,this._viewRotation3D=new $,this._inverseViewRotation3D=new $,this._inverseProjectionDirty=!0,this._inverseProjection=new N,this._modelViewDirty=!0,this._modelView=new N,this._modelView3DDirty=!0,this._modelView3D=new N,this._modelViewRelativeToEyeDirty=!0,this._modelViewRelativeToEye=new N,this._inverseModelViewDirty=!0,this._inverseModelView=new N,this._inverseModelView3DDirty=!0,this._inverseModelView3D=new N,this._viewProjectionDirty=!0,this._viewProjection=new N,this._inverseViewProjectionDirty=!0,this._inverseViewProjection=new N,this._modelViewProjectionDirty=!0,this._modelViewProjection=new N,this._inverseModelViewProjectionDirty=!0,this._inverseModelViewProjection=new N,this._modelViewProjectionRelativeToEyeDirty=!0,this._modelViewProjectionRelativeToEye=new N,this._modelViewInfiniteProjectionDirty=!0,this._modelViewInfiniteProjection=new N,this._normalDirty=!0,this._normal=new $,this._normal3DDirty=!0,this._normal3D=new $,this._inverseNormalDirty=!0,this._inverseNormal=new $,this._inverseNormal3DDirty=!0,this._inverseNormal3D=new $,this._encodedCameraPositionMCDirty=!0,this._encodedCameraPositionMC=new Sn,this._cameraPosition=new h,this._sunPositionWC=new h,this._sunPositionColumbusView=new h,this._sunDirectionWC=new h,this._sunDirectionEC=new h,this._moonDirectionEC=new h,this._lightDirectionWC=new h,this._lightDirectionEC=new h,this._lightColor=new h,this._lightColorHdr=new h,this._pass=void 0,this._mode=void 0,this._mapProjection=void 0,this._ellipsoid=void 0,this._cameraDirection=new h,this._cameraRight=new h,this._cameraUp=new h,this._frustum2DWidth=0,this._eyeHeight=0,this._eyeHeight2D=new U,this._eyeCartographic=new h,this._eyeEllipsoidNormalEC=new h,this._eyeEllipsoidCurvature=new U,this._eyeToEnu=new $,this._modelToEnu=new N,this._enuToModel=new N,this._pixelRatio=1,this._orthographicIn3D=!1,this._backgroundColor=new z,this._brdfLut=void 0,this._environmentMap=void 0,this._sphericalHarmonicCoefficients=void 0,this._specularEnvironmentMaps=void 0,this._specularEnvironmentMapsMaximumLOD=void 0,this._fogDensity=void 0,this._fogVisualDensityScalar=void 0,this._fogMinimumBrightness=void 0,this._atmosphereHsbShift=void 0,this._atmosphereLightIntensity=void 0,this._atmosphereRayleighCoefficient=new h,this._atmosphereRayleighScaleHeight=new h,this._atmosphereMieCoefficient=new h,this._atmosphereMieScaleHeight=void 0,this._atmosphereMieAnisotropy=void 0,this._atmosphereDynamicLighting=void 0,this._invertClassificationColor=void 0,this._splitPosition=0,this._pixelSizePerMeter=void 0,this._geometricToleranceOverMeter=void 0,this._minimumDisableDepthTestDistance=void 0}Object.defineProperties(Ev.prototype,{frameState:{get:function(){return this._frameState}},viewport:{get:function(){return this._viewport},set:function(e){if(!et.equals(e,this._viewport)){et.clone(e,this._viewport);let t=this._viewport,n=this._viewportCartesian4;n.x=t.x,n.y=t.y,n.z=t.width,n.w=t.height,this._viewportDirty=!0}}},viewportCartesian4:{get:function(){return this._viewportCartesian4}},viewportOrthographic:{get:function(){return Ahe(this),this._viewportOrthographicMatrix}},viewportTransformation:{get:function(){return Ahe(this),this._viewportTransformation}},model:{get:function(){return this._model},set:function(e){N.clone(e,this._model),this._modelView3DDirty=!0,this._inverseModelView3DDirty=!0,this._inverseModelDirty=!0,this._inverseTransposeModelDirty=!0,this._modelViewDirty=!0,this._inverseModelViewDirty=!0,this._modelViewRelativeToEyeDirty=!0,this._inverseModelViewDirty=!0,this._modelViewProjectionDirty=!0,this._inverseModelViewProjectionDirty=!0,this._modelViewProjectionRelativeToEyeDirty=!0,this._modelViewInfiniteProjectionDirty=!0,this._normalDirty=!0,this._inverseNormalDirty=!0,this._normal3DDirty=!0,this._inverseNormal3DDirty=!0,this._encodedCameraPositionMCDirty=!0}},inverseModel:{get:function(){return this._inverseModelDirty&&(this._inverseModelDirty=!1,N.inverse(this._model,this._inverseModel)),this._inverseModel}},inverseTransposeModel:{get:function(){let e=this._inverseTransposeModel;return this._inverseTransposeModelDirty&&(this._inverseTransposeModelDirty=!1,N.getMatrix3(this.inverseModel,e),$.transpose(e,e)),e}},view:{get:function(){return this._view}},view3D:{get:function(){return UX(this),this._view3D}},viewRotation:{get:function(){return UX(this),this._viewRotation}},viewRotation3D:{get:function(){return UX(this),this._viewRotation3D}},inverseView:{get:function(){return this._inverseView}},inverseView3D:{get:function(){return The(this),this._inverseView3D}},inverseViewRotation:{get:function(){return this._inverseViewRotation}},inverseViewRotation3D:{get:function(){return The(this),this._inverseViewRotation3D}},projection:{get:function(){return this._projection}},inverseProjection:{get:function(){return c6e(this),this._inverseProjection}},infiniteProjection:{get:function(){return this._infiniteProjection}},modelView:{get:function(){return l6e(this),this._modelView}},modelView3D:{get:function(){return u6e(this),this._modelView3D}},modelViewRelativeToEye:{get:function(){return g6e(this),this._modelViewRelativeToEye}},inverseModelView:{get:function(){return f6e(this),this._inverseModelView}},inverseModelView3D:{get:function(){return d6e(this),this._inverseModelView3D}},viewProjection:{get:function(){return h6e(this),this._viewProjection}},inverseViewProjection:{get:function(){return m6e(this),this._inverseViewProjection}},modelViewProjection:{get:function(){return p6e(this),this._modelViewProjection}},inverseModelViewProjection:{get:function(){return _6e(this),this._inverseModelViewProjection}},modelViewProjectionRelativeToEye:{get:function(){return y6e(this),this._modelViewProjectionRelativeToEye}},modelViewInfiniteProjection:{get:function(){return A6e(this),this._modelViewInfiniteProjection}},normal:{get:function(){return b6e(this),this._normal}},normal3D:{get:function(){return x6e(this),this._normal3D}},inverseNormal:{get:function(){return T6e(this),this._inverseNormal}},inverseNormal3D:{get:function(){return E6e(this),this._inverseNormal3D}},entireFrustum:{get:function(){return this._entireFrustum}},currentFrustum:{get:function(){return this._currentFrustum}},frustumPlanes:{get:function(){return this._frustumPlanes}},farDepthFromNearPlusOne:{get:function(){return this._farDepthFromNearPlusOne}},log2FarDepthFromNearPlusOne:{get:function(){return this._log2FarDepthFromNearPlusOne}},oneOverLog2FarDepthFromNearPlusOne:{get:function(){return this._oneOverLog2FarDepthFromNearPlusOne}},eyeHeight:{get:function(){return this._eyeHeight}},eyeCartographic:{get:function(){return this._eyeCartographic}},eyeHeight2D:{get:function(){return this._eyeHeight2D}},eyeEllipsoidNormalEC:{get:function(){return this._eyeEllipsoidNormalEC}},eyeEllipsoidCurvature:{get:function(){return this._eyeEllipsoidCurvature}},eyeToEnu:{get:function(){return this._eyeToEnu}},modelToEnu:{get:function(){return this._modelToEnu}},enuToModel:{get:function(){return this._enuToModel}},sunPositionWC:{get:function(){return this._sunPositionWC}},sunPositionColumbusView:{get:function(){return this._sunPositionColumbusView}},sunDirectionWC:{get:function(){return this._sunDirectionWC}},sunDirectionEC:{get:function(){return this._sunDirectionEC}},moonDirectionEC:{get:function(){return this._moonDirectionEC}},lightDirectionWC:{get:function(){return this._lightDirectionWC}},lightDirectionEC:{get:function(){return this._lightDirectionEC}},lightColor:{get:function(){return this._lightColor}},lightColorHdr:{get:function(){return this._lightColorHdr}},encodedCameraPositionMCHigh:{get:function(){return xhe(this),this._encodedCameraPositionMC.high}},encodedCameraPositionMCLow:{get:function(){return xhe(this),this._encodedCameraPositionMC.low}},temeToPseudoFixedMatrix:{get:function(){return this._temeToPseudoFixed}},pixelRatio:{get:function(){return this._pixelRatio}},fogDensity:{get:function(){return this._fogDensity}},fogVisualDensityScalar:{get:function(){return this._fogVisualDensityScalar}},fogMinimumBrightness:{get:function(){return this._fogMinimumBrightness}},atmosphereHsbShift:{get:function(){return this._atmosphereHsbShift}},atmosphereLightIntensity:{get:function(){return this._atmosphereLightIntensity}},atmosphereRayleighCoefficient:{get:function(){return this._atmosphereRayleighCoefficient}},atmosphereRayleighScaleHeight:{get:function(){return this._atmosphereRayleighScaleHeight}},atmosphereMieCoefficient:{get:function(){return this._atmosphereMieCoefficient}},atmosphereMieScaleHeight:{get:function(){return this._atmosphereMieScaleHeight}},atmosphereMieAnisotropy:{get:function(){return this._atmosphereMieAnisotropy}},atmosphereDynamicLighting:{get:function(){return this._atmosphereDynamicLighting}},geometricToleranceOverMeter:{get:function(){return this._geometricToleranceOverMeter}},pass:{get:function(){return this._pass}},backgroundColor:{get:function(){return this._backgroundColor}},brdfLut:{get:function(){return this._brdfLut}},environmentMap:{get:function(){return this._environmentMap}},sphericalHarmonicCoefficients:{get:function(){return this._sphericalHarmonicCoefficients}},specularEnvironmentMaps:{get:function(){return this._specularEnvironmentMaps}},specularEnvironmentMapsMaximumLOD:{get:function(){return this._specularEnvironmentMapsMaximumLOD}},splitPosition:{get:function(){return this._splitPosition}},minimumDisableDepthTestDistance:{get:function(){return this._minimumDisableDepthTestDistance}},invertClassificationColor:{get:function(){return this._invertClassificationColor}},orthographicIn3D:{get:function(){return this._orthographicIn3D}},ellipsoid:{get:function(){return this._ellipsoid??ee.default}}});function Zje(e,t){N.clone(t,e._view),N.getMatrix3(t,e._viewRotation),e._view3DDirty=!0,e._inverseView3DDirty=!0,e._modelViewDirty=!0,e._modelView3DDirty=!0,e._modelViewRelativeToEyeDirty=!0,e._inverseModelViewDirty=!0,e._inverseModelView3DDirty=!0,e._viewProjectionDirty=!0,e._inverseViewProjectionDirty=!0,e._modelViewProjectionDirty=!0,e._modelViewProjectionRelativeToEyeDirty=!0,e._modelViewInfiniteProjectionDirty=!0,e._normalDirty=!0,e._inverseNormalDirty=!0,e._normal3DDirty=!0,e._inverseNormal3DDirty=!0}function Qje(e,t){N.clone(t,e._inverseView),N.getMatrix3(t,e._inverseViewRotation)}function e6e(e,t){N.clone(t,e._projection),e._inverseProjectionDirty=!0,e._viewProjectionDirty=!0,e._inverseViewProjectionDirty=!0,e._modelViewProjectionDirty=!0,e._modelViewProjectionRelativeToEyeDirty=!0}function t6e(e,t){N.clone(t,e._infiniteProjection),e._modelViewInfiniteProjectionDirty=!0}var _he=new h,n6e=new N,yhe=new $;function i6e(e,t){h.clone(t.positionWC,e._cameraPosition),h.clone(t.directionWC,e._cameraDirection),h.clone(t.rightWC,e._cameraRight),h.clone(t.upWC,e._cameraUp);let n=e._ellipsoid,i,r=t.positionCartographic;if(l(r)?(e._eyeHeight=r.height,e._eyeCartographic=h.fromElements(r.longitude,r.latitude,r.height,e._eyeCartographic),e._eyeEllipsoidNormalEC=n.geodeticSurfaceNormalCartographic(r,e._eyeEllipsoidNormalEC),i=h.fromRadians(r.longitude,r.latitude,0,n,_he)):(e._eyeHeight=-n.maximumRadius,h.magnitude(t.positionWC)>0&&(e._eyeEllipsoidNormalEC=h.normalize(t.positionWC,e._eyeEllipsoidNormalEC)),i=n.scaleToGeodeticSurface(t.positionWC,_he)),e._encodedCameraPositionMCDirty=!0,!l(i))return;e._eyeEllipsoidNormalEC=$.multiplyByVector(e._viewRotation,e._eyeEllipsoidNormalEC,e._eyeEllipsoidNormalEC);let o=At.eastNorthUpToFixedFrame(i,n,n6e);e._enuToModel=N.multiplyTransformation(e.inverseModel,o,e._enuToModel),e._modelToEnu=N.inverseTransformation(e._enuToModel,e._modelToEnu);let s=N.getRotation(o,yhe),a=$.multiply(e._viewRotation,s,yhe);e._eyeToEnu=$.transpose(a,e._eyeToEnu),D.equalsEpsilon(n._radii.x,n._radii.y,D.EPSILON15)&&(e._eyeEllipsoidCurvature=n.getLocalCurvature(i,e._eyeEllipsoidCurvature))}var kX=new $,r6e=new he;function o6e(e,t){At.computeIcrfToCentralBodyFixedMatrix(t.time,kX);let n=ky.computeSunPositionInEarthInertialFrame(t.time,e._sunPositionWC);$.multiplyByVector(kX,n,n),h.normalize(n,e._sunDirectionWC),n=$.multiplyByVector(e.viewRotation3D,n,e._sunDirectionEC),h.normalize(n,n),n=ky.computeMoonPositionInEarthInertialFrame(t.time,e._moonDirectionEC),$.multiplyByVector(kX,n,n),$.multiplyByVector(e.viewRotation3D,n,n),h.normalize(n,n);let i=t.mapProjection,o=i.ellipsoid.cartesianToCartographic(e._sunPositionWC,r6e);i.project(o,e._sunPositionColumbusView)}Ev.prototype.updateCamera=function(e){Zje(this,e.viewMatrix),Qje(this,e.inverseViewMatrix),i6e(this,e),this._entireFrustum.x=e.frustum.near,this._entireFrustum.y=e.frustum.far,this.updateFrustum(e.frustum),this._orthographicIn3D=this._mode!==re.SCENE2D&&e.frustum instanceof gn};Ev.prototype.updateFrustum=function(e){e6e(this,e.projectionMatrix),l(e.infiniteProjectionMatrix)&&t6e(this,e.infiniteProjectionMatrix),this._currentFrustum.x=e.near,this._currentFrustum.y=e.far,this._farDepthFromNearPlusOne=e.far-e.near+1,this._log2FarDepthFromNearPlusOne=D.log2(this._farDepthFromNearPlusOne),this._oneOverLog2FarDepthFromNearPlusOne=1/this._log2FarDepthFromNearPlusOne;let t=e.offCenterFrustum;l(t)&&(e=t),this._frustumPlanes.x=e.top,this._frustumPlanes.y=e.bottom,this._frustumPlanes.z=e.left,this._frustumPlanes.w=e.right};Ev.prototype.updatePass=function(e){this._pass=e};var s6e=[],a6e=new dg;Ev.prototype.update=function(e){this._mode=e.mode,this._mapProjection=e.mapProjection,this._ellipsoid=e.mapProjection.ellipsoid,this._pixelRatio=e.pixelRatio;let t=e.camera;this.updateCamera(t),e.mode===re.SCENE2D?(this._frustum2DWidth=t.frustum.right-t.frustum.left,this._eyeHeight2D.x=this._frustum2DWidth*.5,this._eyeHeight2D.y=this._eyeHeight2D.x*this._eyeHeight2D.x):(this._frustum2DWidth=0,this._eyeHeight2D.x=0,this._eyeHeight2D.y=0),o6e(this,e);let n=e.light??a6e;n instanceof dg?(this._lightDirectionWC=h.clone(this._sunDirectionWC,this._lightDirectionWC),this._lightDirectionEC=h.clone(this._sunDirectionEC,this._lightDirectionEC)):(this._lightDirectionWC=h.normalize(h.negate(n.direction,this._lightDirectionWC),this._lightDirectionWC),this._lightDirectionEC=$.multiplyByVector(this.viewRotation3D,this._lightDirectionWC,this._lightDirectionEC));let i=n.color,r=h.fromElements(i.red,i.green,i.blue,this._lightColorHdr);r=h.multiplyByScalar(r,n.intensity,r);let o=h.maximumComponent(r);o>1?h.divideByScalar(r,o,this._lightColor):h.clone(r,this._lightColor);let s=e.brdfLutGenerator,a=l(s)?s.colorTexture:void 0;this._brdfLut=a,this._environmentMap=e.environmentMap??e.context.defaultCubeMap,this._sphericalHarmonicCoefficients=e.sphericalHarmonicCoefficients??s6e,this._specularEnvironmentMaps=e.specularEnvironmentMaps,this._specularEnvironmentMapsMaximumLOD=e.specularEnvironmentMapsMaximumLOD,this._fogDensity=e.fog.density,this._fogVisualDensityScalar=e.fog.visualDensityScalar,this._fogMinimumBrightness=e.fog.minimumBrightness;let c=e.atmosphere;l(c)&&(this._atmosphereHsbShift=h.fromElements(c.hueShift,c.saturationShift,c.brightnessShift,this._atmosphereHsbShift),this._atmosphereLightIntensity=c.lightIntensity,this._atmosphereRayleighCoefficient=h.clone(c.rayleighCoefficient,this._atmosphereRayleighCoefficient),this._atmosphereRayleighScaleHeight=c.rayleighScaleHeight,this._atmosphereMieCoefficient=h.clone(c.mieCoefficient,this._atmosphereMieCoefficient),this._atmosphereMieScaleHeight=c.mieScaleHeight,this._atmosphereMieAnisotropy=c.mieAnisotropy,this._atmosphereDynamicLighting=c.dynamicLighting),this._invertClassificationColor=e.invertClassificationColor,this._frameState=e,this._temeToPseudoFixed=At.computeTemeToPseudoFixedMatrix(e.time,this._temeToPseudoFixed),this._splitPosition=e.splitPosition*e.context.drawingBufferWidth;let u=t.frustum.fov,f=this._viewport,d;l(u)?f.height>f.width?d=Math.tan(.5*u)*2/f.height:d=Math.tan(.5*u)*2/f.width:d=1/Math.max(f.width,f.height),this._geometricToleranceOverMeter=d*e.maximumScreenSpaceError,z.clone(e.backgroundColor,this._backgroundColor),this._minimumDisableDepthTestDistance=e.minimumDisableDepthTestDistance,this._minimumDisableDepthTestDistance*=this._minimumDisableDepthTestDistance,this._minimumDisableDepthTestDistance===Number.POSITIVE_INFINITY&&(this._minimumDisableDepthTestDistance=-1)};function Ahe(e){if(e._viewportDirty){let t=e._viewport;N.computeOrthographicOffCenter(t.x,t.x+t.width,t.y,t.y+t.height,0,1,e._viewportOrthographicMatrix),N.computeViewportTransformation(t,0,1,e._viewportTransformation),e._viewportDirty=!1}}function c6e(e){e._inverseProjectionDirty&&(e._inverseProjectionDirty=!1,e._mode!==re.SCENE2D&&e._mode!==re.MORPHING&&!e._orthographicIn3D?N.inverse(e._projection,e._inverseProjection):N.clone(N.ZERO,e._inverseProjection))}function l6e(e){e._modelViewDirty&&(e._modelViewDirty=!1,N.multiplyTransformation(e._view,e._model,e._modelView))}function u6e(e){e._modelView3DDirty&&(e._modelView3DDirty=!1,N.multiplyTransformation(e.view3D,e._model,e._modelView3D))}function f6e(e){e._inverseModelViewDirty&&(e._inverseModelViewDirty=!1,N.inverse(e.modelView,e._inverseModelView))}function d6e(e){e._inverseModelView3DDirty&&(e._inverseModelView3DDirty=!1,N.inverse(e.modelView3D,e._inverseModelView3D))}function h6e(e){e._viewProjectionDirty&&(e._viewProjectionDirty=!1,N.multiply(e._projection,e._view,e._viewProjection))}function m6e(e){e._inverseViewProjectionDirty&&(e._inverseViewProjectionDirty=!1,N.inverse(e.viewProjection,e._inverseViewProjection))}function p6e(e){e._modelViewProjectionDirty&&(e._modelViewProjectionDirty=!1,N.multiply(e._projection,e.modelView,e._modelViewProjection))}function g6e(e){if(e._modelViewRelativeToEyeDirty){e._modelViewRelativeToEyeDirty=!1;let t=e.modelView,n=e._modelViewRelativeToEye;n[0]=t[0],n[1]=t[1],n[2]=t[2],n[3]=t[3],n[4]=t[4],n[5]=t[5],n[6]=t[6],n[7]=t[7],n[8]=t[8],n[9]=t[9],n[10]=t[10],n[11]=t[11],n[12]=0,n[13]=0,n[14]=0,n[15]=t[15]}}function _6e(e){e._inverseModelViewProjectionDirty&&(e._inverseModelViewProjectionDirty=!1,N.inverse(e.modelViewProjection,e._inverseModelViewProjection))}function y6e(e){e._modelViewProjectionRelativeToEyeDirty&&(e._modelViewProjectionRelativeToEyeDirty=!1,N.multiply(e._projection,e.modelViewRelativeToEye,e._modelViewProjectionRelativeToEye))}function A6e(e){e._modelViewInfiniteProjectionDirty&&(e._modelViewInfiniteProjectionDirty=!1,N.multiply(e._infiniteProjection,e.modelView,e._modelViewInfiniteProjection))}function b6e(e){if(e._normalDirty){e._normalDirty=!1;let t=e._normal;N.getMatrix3(e.inverseModelView,t),$.transpose(t,t)}}function x6e(e){if(e._normal3DDirty){e._normal3DDirty=!1;let t=e._normal3D;N.getMatrix3(e.inverseModelView3D,t),$.transpose(t,t)}}function T6e(e){if(e._inverseNormalDirty){e._inverseNormalDirty=!1;let t=e._inverseNormal;N.getMatrix3(e.modelView,t),$.transpose(t,t)}}function E6e(e){if(e._inverseNormal3DDirty){e._inverseNormal3DDirty=!1;let t=e._inverseNormal3D;N.getMatrix3(e.modelView3D,t),$.transpose(t,t)}}var bhe=new h;function xhe(e){e._encodedCameraPositionMCDirty&&(e._encodedCameraPositionMCDirty=!1,N.multiplyByPoint(e.inverseModel,e._cameraPosition,bhe),Sn.fromCartesian(bhe,e._encodedCameraPositionMC))}var C6e=new h,v6e=new h,S6e=new h,w6e=new h,I6e=new he,P6e=new h,D6e=new N;function R6e(e,t,n,i,r,o,s,a){let c=C6e;c.x=e.y,c.y=e.z,c.z=e.x;let u=v6e;u.x=n.y,u.y=n.z,u.z=n.x;let f=S6e;f.x=i.y,f.y=i.z,f.z=i.x;let d=w6e;d.x=t.y,d.y=t.z,d.z=t.x,o===re.SCENE2D&&(c.z=r*.5);let p=s.unproject(c,I6e);p.longitude=D.clamp(p.longitude,-Math.PI,Math.PI),p.latitude=D.clamp(p.latitude,-D.PI_OVER_TWO,D.PI_OVER_TWO);let g=s.ellipsoid,m=g.cartographicToCartesian(p,P6e),y=At.eastNorthUpToFixedFrame(m,g,D6e);return N.multiplyByPointAsVector(y,u,u),N.multiplyByPointAsVector(y,f,f),N.multiplyByPointAsVector(y,d,d),l(a)||(a=new N),a[0]=u.x,a[1]=f.x,a[2]=-d.x,a[3]=0,a[4]=u.y,a[5]=f.y,a[6]=-d.y,a[7]=0,a[8]=u.z,a[9]=f.z,a[10]=-d.z,a[11]=0,a[12]=-h.dot(u,m),a[13]=-h.dot(f,m),a[14]=h.dot(d,m),a[15]=1,a}function UX(e){e._view3DDirty&&(e._mode===re.SCENE3D?N.clone(e._view,e._view3D):R6e(e._cameraPosition,e._cameraDirection,e._cameraRight,e._cameraUp,e._frustum2DWidth,e._mode,e._mapProjection,e._view3D),N.getMatrix3(e._view3D,e._viewRotation3D),e._view3DDirty=!1)}function The(e){e._inverseView3DDirty&&(N.inverseTransformation(e.view3D,e._inverseView3D),N.getMatrix3(e._inverseView3D,e._inverseViewRotation3D),e._inverseView3DDirty=!1)}var wO=Ev;function Nu(e,t){let{getWebGLStub:n,requestWebgl1:i,webgl:r={},allowTextureFilterAnisotropic:o=!0,transparentDefaultTexture:s=!1}=t??{};r.alpha=r.alpha??!1,r.stencil=r.stencil??!0,r.powerPreference=r.powerPreference??"high-performance";let a=l(n)?n(e,r):O6e(e,r,i),u=typeof WebGL2RenderingContext<"u"&&a instanceof WebGL2RenderingContext;this._canvas=e,this._originalGLContext=a,this._gl=a,this._webgl2=u,this._id=Kn(),this.validateFramebuffer=!1,this.validateShaderProgram=!1,this.logShaderCompilation=!1,this._throwOnWebGLError=!1,this._shaderCache=new TO(this),this._textureCache=new EO,this._transparentDefaultTexture=s;let f=a;this._stencilBits=f.getParameter(f.STENCIL_BITS),kt._maximumCombinedTextureImageUnits=f.getParameter(f.MAX_COMBINED_TEXTURE_IMAGE_UNITS),kt._maximumCubeMapSize=f.getParameter(f.MAX_CUBE_MAP_TEXTURE_SIZE),kt._maximumFragmentUniformVectors=f.getParameter(f.MAX_FRAGMENT_UNIFORM_VECTORS),kt._maximumTextureImageUnits=f.getParameter(f.MAX_TEXTURE_IMAGE_UNITS),kt._maximumRenderbufferSize=f.getParameter(f.MAX_RENDERBUFFER_SIZE),kt._maximumTextureSize=f.getParameter(f.MAX_TEXTURE_SIZE),kt._maximum3DTextureSize=f.getParameter(f.MAX_3D_TEXTURE_SIZE),kt._maximumVaryingVectors=f.getParameter(f.MAX_VARYING_VECTORS),kt._maximumVertexAttributes=f.getParameter(f.MAX_VERTEX_ATTRIBS),kt._maximumVertexTextureImageUnits=f.getParameter(f.MAX_VERTEX_TEXTURE_IMAGE_UNITS),kt._maximumVertexUniformVectors=f.getParameter(f.MAX_VERTEX_UNIFORM_VECTORS),kt._maximumSamples=this._webgl2?f.getParameter(f.MAX_SAMPLES):0;let d=f.getParameter(f.ALIASED_LINE_WIDTH_RANGE);kt._minimumAliasedLineWidth=d[0],kt._maximumAliasedLineWidth=d[1];let p=f.getParameter(f.ALIASED_POINT_SIZE_RANGE);kt._minimumAliasedPointSize=p[0],kt._maximumAliasedPointSize=p[1];let g=f.getParameter(f.MAX_VIEWPORT_DIMS);kt._maximumViewportWidth=g[0],kt._maximumViewportHeight=g[1];let m=f.getShaderPrecisionFormat(f.FRAGMENT_SHADER,f.HIGH_FLOAT);kt._highpFloatSupported=m.precision!==0;let y=f.getShaderPrecisionFormat(f.FRAGMENT_SHADER,f.HIGH_INT);kt._highpIntSupported=y.rangeMax!==0,this._antialias=f.getContextAttributes().antialias,this._standardDerivatives=!!is(f,["OES_standard_derivatives"]),this._blendMinmax=!!is(f,["EXT_blend_minmax"]),this._elementIndexUint=!!is(f,["OES_element_index_uint"]),this._depthTexture=!!is(f,["WEBGL_depth_texture","WEBKIT_WEBGL_depth_texture"]),this._fragDepth=!!is(f,["EXT_frag_depth"]),this._debugShaders=is(f,["WEBGL_debug_shaders"]),this._textureFloat=!!is(f,["OES_texture_float"]),this._textureHalfFloat=!!is(f,["OES_texture_half_float"]),this._textureFloatLinear=!!is(f,["OES_texture_float_linear"]),this._textureHalfFloatLinear=!!is(f,["OES_texture_half_float_linear"]),this._supportsTextureLod=!!is(f,["EXT_shader_texture_lod"]),this._colorBufferFloat=!!is(f,["EXT_color_buffer_float","WEBGL_color_buffer_float"]),this._floatBlend=!!is(f,["EXT_float_blend"]),this._colorBufferHalfFloat=!!is(f,["EXT_color_buffer_half_float"]),this._s3tc=!!is(f,["WEBGL_compressed_texture_s3tc","MOZ_WEBGL_compressed_texture_s3tc","WEBKIT_WEBGL_compressed_texture_s3tc"]),this._pvrtc=!!is(f,["WEBGL_compressed_texture_pvrtc","WEBKIT_WEBGL_compressed_texture_pvrtc"]),this._astc=!!is(f,["WEBGL_compressed_texture_astc"]),this._etc=!!is(f,["WEBG_compressed_texture_etc"]),this._etc1=!!is(f,["WEBGL_compressed_texture_etc1"]),this._bc7=!!is(f,["EXT_texture_compression_bptc"]),Ou.setKTX2SupportedFormats(this._s3tc,this._pvrtc,this._astc,this._etc,this._etc1,this._bc7);let A=o?is(f,["EXT_texture_filter_anisotropic","WEBKIT_EXT_texture_filter_anisotropic"]):void 0;this._textureFilterAnisotropic=A,kt._maximumTextureFilterAnisotropy=l(A)?f.getParameter(A.MAX_TEXTURE_MAX_ANISOTROPY_EXT):1;let b,x,T,E,v,S,I,R,O,L;if(u){let P=this;b=function(){return P._gl.createVertexArray()},x=function(M){P._gl.bindVertexArray(M)},T=function(M){P._gl.deleteVertexArray(M)},E=function(M,F,V,B,j){f.drawElementsInstanced(M,F,V,B,j)},v=function(M,F,V,B){f.drawArraysInstanced(M,F,V,B)},S=function(M,F){f.vertexAttribDivisor(M,F)},I=function(M){f.drawBuffers(M)}}else R=is(f,["OES_vertex_array_object"]),l(R)&&(b=function(){return R.createVertexArrayOES()},x=function(P){R.bindVertexArrayOES(P)},T=function(P){R.deleteVertexArrayOES(P)}),O=is(f,["ANGLE_instanced_arrays"]),l(O)&&(E=function(P,M,F,V,B){O.drawElementsInstancedANGLE(P,M,F,V,B)},v=function(P,M,F,V){O.drawArraysInstancedANGLE(P,M,F,V)},S=function(P,M){O.vertexAttribDivisorANGLE(P,M)}),L=is(f,["WEBGL_draw_buffers"]),l(L)&&(I=function(P){L.drawBuffersWEBGL(P)});this.glCreateVertexArray=b,this.glBindVertexArray=x,this.glDeleteVertexArray=T,this.glDrawElementsInstanced=E,this.glDrawArraysInstanced=v,this.glVertexAttribDivisor=S,this.glDrawBuffers=I,this._vertexArrayObject=!!R,this._instancedArrays=!!O,this._drawBuffers=!!L,kt._maximumDrawBuffers=this.drawBuffers?f.getParameter(te.MAX_DRAW_BUFFERS):1,kt._maximumColorAttachments=this.drawBuffers?f.getParameter(te.MAX_COLOR_ATTACHMENTS):1,this._clearColor=new z(0,0,0,0),this._clearDepth=1,this._clearStencil=0;let _=new wO,C=new sc(this),w=Ge.fromCache();this._defaultPassState=C,this._defaultRenderState=w,this._defaultTexture=void 0,this._defaultEmissiveTexture=void 0,this._defaultNormalTexture=void 0,this._defaultCubeMap=void 0,this._us=_,this._currentRenderState=w,this._currentPassState=C,this._currentFramebuffer=void 0,this._maxFrameTextureUnitIndex=0,this._vertexAttribDivisors=[],this._previousDrawInstanced=!1;for(let P=0;P<kt._maximumVertexAttributes;P++)this._vertexAttribDivisors.push(0);this._pickObjects=new Map,this._nextPickColor=new Uint32Array(1),this.options={getWebGLStub:n,requestWebgl1:i,webgl:r,allowTextureFilterAnisotropic:o,transparentDefaultTexture:s},this.cache={},Ge.apply(f,w,C)}function O6e(e,t,n){if(typeof WebGLRenderingContext>"u")throw new oe("The browser does not support WebGL. Visit http://get.webgl.org.");!n&&!(typeof WebGL2RenderingContext<"u")&&(n=!0);let r=n?"webgl":"webgl2",o=e.getContext(r,t);if(!l(o))throw new oe("The browser supports WebGL, but initialization failed.");return o}function M6e(e,t){let n="WebGL Error: ";switch(t){case e.INVALID_ENUM:n+="INVALID_ENUM";break;case e.INVALID_VALUE:n+="INVALID_VALUE";break;case e.INVALID_OPERATION:n+="INVALID_OPERATION";break;case e.OUT_OF_MEMORY:n+="OUT_OF_MEMORY";break;case e.CONTEXT_LOST_WEBGL:n+="CONTEXT_LOST_WEBGL lost";break;default:n+=`Unknown (${t})`}return n}function N6e(e,t,n,i){let r=`${M6e(e,i)}: ${t.name}(`;for(let o=0;o<n.length;++o)o!==0&&(r+=", "),r+=n[o];return r+=");",r}function L6e(e,t,n){let i=e.getError();if(i!==e.NO_ERROR)throw new oe(N6e(e,t,n,i))}function F6e(e,t,n){return{get:function(){let i=e[t];return n(e,`get: ${t}`,i),e[t]},set:function(i){e[t]=i,n(e,`set: ${t}`,i)}}}function B6e(e,t){if(!l(t))return e;function n(r){return function(){let o=r.apply(e,arguments);return t(e,r,arguments),o}}let i={};for(let r in e){let o=e[r];o instanceof Function?i[r]=n(o):Object.defineProperty(i,r,F6e(e,r,t))}return i}function is(e,t){let n=t.length;for(let i=0;i<n;++i){let r=e.getExtension(t[i]);if(r)return r}}var k6e={};Object.defineProperties(Nu.prototype,{id:{get:function(){return this._id}},webgl2:{get:function(){return this._webgl2}},canvas:{get:function(){return this._canvas}},shaderCache:{get:function(){return this._shaderCache}},textureCache:{get:function(){return this._textureCache}},uniformState:{get:function(){return this._us}},stencilBits:{get:function(){return this._stencilBits}},stencilBuffer:{get:function(){return this._stencilBits>=8}},antialias:{get:function(){return this._antialias}},msaa:{get:function(){return this._webgl2}},standardDerivatives:{get:function(){return this._standardDerivatives||this._webgl2}},floatBlend:{get:function(){return this._floatBlend}},blendMinmax:{get:function(){return this._blendMinmax||this._webgl2}},elementIndexUint:{get:function(){return this._elementIndexUint||this._webgl2}},depthTexture:{get:function(){return this._depthTexture||this._webgl2}},floatingPointTexture:{get:function(){return this._webgl2||this._textureFloat}},halfFloatingPointTexture:{get:function(){return this._webgl2||this._textureHalfFloat}},textureFloatLinear:{get:function(){return this._textureFloatLinear}},textureHalfFloatLinear:{get:function(){return this._webgl2&&this._textureFloatLinear||!this._webgl2&&this._textureHalfFloatLinear}},supportsTextureLod:{get:function(){return this._webgl2||this._supportsTextureLod}},textureFilterAnisotropic:{get:function(){return!!this._textureFilterAnisotropic}},s3tc:{get:function(){return this._s3tc}},pvrtc:{get:function(){return this._pvrtc}},astc:{get:function(){return this._astc}},etc:{get:function(){return this._etc}},etc1:{get:function(){return this._etc1}},bc7:{get:function(){return this._bc7}},supportsBasis:{get:function(){return this._s3tc||this._pvrtc||this._astc||this._etc||this._etc1||this._bc7}},vertexArrayObject:{get:function(){return this._vertexArrayObject||this._webgl2}},fragmentDepth:{get:function(){return this._fragDepth||this._webgl2}},instancedArrays:{get:function(){return this._instancedArrays||this._webgl2}},colorBufferFloat:{get:function(){return this._colorBufferFloat}},colorBufferHalfFloat:{get:function(){return this._webgl2&&this._colorBufferFloat||!this._webgl2&&this._colorBufferHalfFloat}},drawBuffers:{get:function(){return this._drawBuffers||this._webgl2}},debugShaders:{get:function(){return this._debugShaders}},throwOnWebGLError:{get:function(){return this._throwOnWebGLError},set:function(e){this._throwOnWebGLError=e,this._gl=B6e(this._originalGLContext,e?L6e:void 0)}},defaultTexture:{get:function(){if(this._defaultTexture===void 0){let e=Dt.defaultColor;this._defaultTexture=new Dt({context:this,source:{width:1,height:1,arrayBufferView:new Uint8Array([e.red*255,e.green*255,e.blue*255,this._transparentDefaultTexture?0:e.alpha*255])},flipY:!1})}return this._defaultTexture}},defaultEmissiveTexture:{get:function(){return this._defaultEmissiveTexture===void 0&&(this._defaultEmissiveTexture=new Dt({context:this,pixelFormat:Ke.RGB,source:{width:1,height:1,arrayBufferView:new Uint8Array([0,0,0])},flipY:!1})),this._defaultEmissiveTexture}},defaultNormalTexture:{get:function(){return this._defaultNormalTexture===void 0&&(this._defaultNormalTexture=new Dt({context:this,pixelFormat:Ke.RGB,source:{width:1,height:1,arrayBufferView:new Uint8Array([128,128,255])},flipY:!1})),this._defaultNormalTexture}},defaultCubeMap:{get:function(){if(this._defaultCubeMap===void 0){let e={width:1,height:1,arrayBufferView:new Uint8Array([255,255,255,255])};this._defaultCubeMap=new ns({context:this,source:{positiveX:e,negativeX:e,positiveY:e,negativeY:e,positiveZ:e,negativeZ:e},flipY:!1})}return this._defaultCubeMap}},drawingBufferHeight:{get:function(){return this._gl.drawingBufferHeight}},drawingBufferWidth:{get:function(){return this._gl.drawingBufferWidth}},defaultFramebuffer:{get:function(){return k6e}}});function Ehe(e,t,n,i){let r=e._currentRenderState,o=e._currentPassState;e._currentRenderState=t,e._currentPassState=n,Ge.partialApply(e._gl,r,t,o,n,i)}var zX;typeof WebGLRenderingContext<"u"&&(zX=[te.BACK]);function p6(e,t){if(t!==e._currentFramebuffer){e._currentFramebuffer=t;let n=zX;if(l(t))t._bind(),n=t._getActiveColorAttachments();else{let i=e._gl;i.bindFramebuffer(i.FRAMEBUFFER,null)}e.drawBuffers&&e.glDrawBuffers(n)}}var U6e=new li;Nu.prototype.clear=function(e,t){e=e??U6e,t=t??this._defaultPassState;let n=this._gl,i=0,r=e.color,o=e.depth,s=e.stencil;l(r)&&(z.equals(this._clearColor,r)||(z.clone(r,this._clearColor),n.clearColor(r.red,r.green,r.blue,r.alpha)),i|=n.COLOR_BUFFER_BIT),l(o)&&(o!==this._clearDepth&&(this._clearDepth=o,n.clearDepth(o)),i|=n.DEPTH_BUFFER_BIT),l(s)&&(s!==this._clearStencil&&(this._clearStencil=s,n.clearStencil(s)),i|=n.STENCIL_BUFFER_BIT);let a=e.renderState??this._defaultRenderState;Ehe(this,a,t,!0);let c=e.framebuffer??t.framebuffer;p6(this,c),n.clear(i)};function z6e(e,t,n,i,r){p6(e,t),Ehe(e,r,n,!1),i._bind(),e._maxFrameTextureUnitIndex=Math.max(e._maxFrameTextureUnitIndex,i.maximumTextureUnitIndex)}function V6e(e,t,n,i){let r=t._primitiveType,o=t._vertexArray,s=t._offset,a=t._count,c=t.instanceCount;e._us.model=t._modelMatrix??N.IDENTITY,n._setUniforms(i,e._us,e.validateShaderProgram),o._bind();let u=o.indexBuffer;l(u)?(s=s*u.bytesPerIndex,l(a)?a=Math.min(a,u.numberOfIndices):a=u.numberOfIndices,c===0?e._gl.drawElements(r,a,u.indexDatatype,s):e.glDrawElementsInstanced(r,a,u.indexDatatype,s,c)):(l(a)?a=Math.min(a,o.numberOfVertices):a=o.numberOfVertices,c===0?e._gl.drawArrays(r,s,a):e.glDrawArraysInstanced(r,s,a,c)),o._unBind()}Nu.prototype.draw=function(e,t,n,i){t=t??this._defaultPassState;let r=e._framebuffer??t.framebuffer,o=e._renderState??this._defaultRenderState;n=n??e._shaderProgram,i=i??e._uniformMap,z6e(this,r,t,n,o),V6e(this,e,n,i)};Nu.prototype.beginFrame=function(){};Nu.prototype.endFrame=function(){let e=this._gl;e.useProgram(null),this._currentFramebuffer=void 0,e.bindFramebuffer(e.FRAMEBUFFER,null);let t=zX;this.drawBuffers&&this.glDrawBuffers(t);let n=this._maxFrameTextureUnitIndex;this._maxFrameTextureUnitIndex=0;for(let i=0;i<n;++i)e.activeTexture(e.TEXTURE0+i),e.bindTexture(e.TEXTURE_2D,null),e.bindTexture(e.TEXTURE_CUBE_MAP,null)};Nu.prototype.readPixelsToPBO=function(e){let t=this._gl;e=e??H.EMPTY_OBJECT;let n=Math.max(e.x??0,0),i=Math.max(e.y??0,0),r=e.width??this.drawingBufferWidth,o=e.height??this.drawingBufferHeight,s=e.framebuffer;if(!this._webgl2)throw new pe("A WebGL 2 context is required to read pixels using a PBO.");let a=ze.UNSIGNED_BYTE,c=Ke.RGBA;l(s)&&s.numberOfColorAttachments>0&&(a=s.getColorTexture(0).pixelDatatype,c=s.getColorTexture(0).pixelFormat);let u=tt.createPixelBuffer({context:this,sizeInBytes:Ke.textureSizeInBytes(c,a,r,o),usage:Me.DYNAMIC_READ});return p6(this,s),u._bind(),t.readPixels(n,i,r,o,c,ze.toWebGLConstant(a,this),0),u._unBind(),u};Nu.prototype.readPixels=function(e){let t=this._gl;e=e??H.EMPTY_OBJECT;let n=Math.max(e.x??0,0),i=Math.max(e.y??0,0),r=e.width??this.drawingBufferWidth,o=e.height??this.drawingBufferHeight,s=e.framebuffer,a=ze.UNSIGNED_BYTE,c=Ke.RGBA;l(s)&&s.numberOfColorAttachments>0&&(a=s.getColorTexture(0).pixelDatatype,c=s.getColorTexture(0).pixelFormat);let u=Ke.createTypedArray(c,a,r,o);return p6(this,s),t.readPixels(n,i,r,o,Ke.RGBA,ze.toWebGLConstant(a,this),u),u};var Che={position:0,textureCoordinates:1};Nu.prototype.getViewportQuadVertexArray=function(){let e=this.cache.viewportQuad_vertexArray;if(!l(e)){let t=new St({attributes:{position:new Ne({componentDatatype:Y.FLOAT,componentsPerAttribute:2,values:[-1,-1,1,-1,1,1,-1,1]}),textureCoordinates:new Ne({componentDatatype:Y.FLOAT,componentsPerAttribute:2,values:[0,0,1,0,1,1,0,1]})},indices:new Uint16Array([0,1,2,0,2,3]),primitiveType:Oe.TRIANGLES});e=zn.fromGeometry({context:this,geometry:t,attributeLocations:Che,bufferUsage:Me.STATIC_DRAW,interleave:!0}),this.cache.viewportQuad_vertexArray=e}return e};Nu.prototype.createViewportQuadCommand=function(e,t){return t=t??H.EMPTY_OBJECT,new at({vertexArray:this.getViewportQuadVertexArray(),primitiveType:Oe.TRIANGLES,renderState:t.renderState,shaderProgram:Qt.fromCache({context:this,vertexShaderSource:ux,fragmentShaderSource:e,attributeLocations:Che}),uniformMap:t.uniformMap,owner:t.owner,framebuffer:t.framebuffer,pass:t.pass})};Nu.prototype.getObjectByPickColor=function(e){return this._pickObjects.get(e)};Nu.prototype.createPickId=function(e){++this._nextPickColor[0];let t=this._nextPickColor[0];if(t===0)throw new oe("Out of unique Pick IDs.");return this._pickObjects.set(t,e),new zD(this._pickObjects,t,z.fromRgba(t))};Nu.prototype.isDestroyed=function(){return!1};Nu.prototype.destroy=function(){let e=this.cache;for(let t in e)if(e.hasOwnProperty(t)){let n=e[t];l(n.destroy)&&n.destroy()}return this._shaderCache=this._shaderCache.destroy(),this._textureCache=this._textureCache.destroy(),this._defaultTexture=this._defaultTexture&&this._defaultTexture.destroy(),this._defaultEmissiveTexture=this._defaultEmissiveTexture&&this._defaultEmissiveTexture.destroy(),this._defaultNormalTexture=this._defaultNormalTexture&&this._defaultNormalTexture.destroy(),this._defaultCubeMap=this._defaultCubeMap&&this._defaultCubeMap.destroy(),le(this)};var xx=Nu;function Cv(e){e=e??H.EMPTY_OBJECT;let{context:t,width:n,height:i,colorRenderbuffers:r,colorTextures:o,depthStencilRenderbuffer:s,depthStencilTexture:a,destroyAttachments:c}=e;if(this._width=n,this._height=i,l(r)!==l(o))throw new pe("Both color renderbuffer and texture attachments must be provided.");if(l(s)!==l(a))throw new pe("Both depth-stencil renderbuffer and texture attachments must be provided.");this._renderFramebuffer=new _s({context:t,colorRenderbuffers:r,depthStencilRenderbuffer:s,destroyAttachments:c}),this._colorFramebuffer=new _s({context:t,colorTextures:o,depthStencilTexture:a,destroyAttachments:c})}Cv.prototype.getRenderFramebuffer=function(){return this._renderFramebuffer};Cv.prototype.getColorFramebuffer=function(){return this._colorFramebuffer};Cv.prototype.blitFramebuffers=function(e,t){this._renderFramebuffer.bindRead(),this._colorFramebuffer.bindDraw();let n=e._gl,i=0;this._colorFramebuffer._colorTextures.length>0&&(i|=n.COLOR_BUFFER_BIT),l(this._colorFramebuffer.depthStencilTexture)&&(i|=n.DEPTH_BUFFER_BIT|(t?n.STENCIL_BUFFER_BIT:0)),n.blitFramebuffer(0,0,this._width,this._height,0,0,this._width,this._height,i,n.NEAREST),n.bindFramebuffer(n.READ_FRAMEBUFFER,null),n.bindFramebuffer(n.DRAW_FRAMEBUFFER,null)};Cv.prototype.isDestroyed=function(){return!1};Cv.prototype.destroy=function(){return this._renderFramebuffer.destroy(),this._colorFramebuffer.destroy(),le(this)};var IO=Cv;var Vl={RGBA4:te.RGBA4,RGBA8:te.RGBA8,RGBA16F:te.RGBA16F,RGBA32F:te.RGBA32F,RGB5_A1:te.RGB5_A1,RGB565:te.RGB565,DEPTH_COMPONENT16:te.DEPTH_COMPONENT16,STENCIL_INDEX8:te.STENCIL_INDEX8,DEPTH_STENCIL:te.DEPTH_STENCIL,DEPTH24_STENCIL8:te.DEPTH24_STENCIL8,validate:function(e){return e===Vl.RGBA4||e===Vl.RGBA8||e===Vl.RGBA16F||e===Vl.RGBA32F||e===Vl.RGB5_A1||e===Vl.RGB565||e===Vl.DEPTH_COMPONENT16||e===Vl.STENCIL_INDEX8||e===Vl.DEPTH_STENCIL||e===Vl.DEPTH24_STENCIL8},getColorFormat:function(e){return e===te.FLOAT?Vl.RGBA32F:e===te.HALF_FLOAT_OES?Vl.RGBA16F:Vl.RGBA8}};Object.freeze(Vl);var jl=Vl;function PO(e){e=e??H.EMPTY_OBJECT;let t=e.context,n=t._gl,i=kt.maximumRenderbufferSize,r=e.format??jl.RGBA4,o=l(e.width)?e.width:t.drawingBufferWidth,s=l(e.height)?e.height:t.drawingBufferHeight,a=e.numSamples??1;this._gl=n,this._format=r,this._width=o,this._height=s,this._renderbuffer=this._gl.createRenderbuffer(),n.bindRenderbuffer(n.RENDERBUFFER,this._renderbuffer),a>1?n.renderbufferStorageMultisample(n.RENDERBUFFER,a,r,o,s):n.renderbufferStorage(n.RENDERBUFFER,r,o,s),n.bindRenderbuffer(n.RENDERBUFFER,null)}Object.defineProperties(PO.prototype,{format:{get:function(){return this._format}},width:{get:function(){return this._width}},height:{get:function(){return this._height}}});PO.prototype._getRenderbuffer=function(){return this._renderbuffer};PO.prototype.isDestroyed=function(){return!1};PO.prototype.destroy=function(){return this._gl.deleteRenderbuffer(this._renderbuffer),le(this)};var Sf=PO;function pa(e){e=e??H.EMPTY_OBJECT,this._numSamples=e.numSamples??1,this._colorAttachmentsLength=e.colorAttachmentsLength??1,this._color=e.color??!0,this._depth=e.depth??!1,this._depthStencil=e.depthStencil??!1,this._supportsDepthTexture=e.supportsDepthTexture??!1,this._createColorAttachments=e.createColorAttachments??!0,this._createDepthAttachments=e.createDepthAttachments??!0,this._pixelDatatype=e.pixelDatatype,this._pixelFormat=e.pixelFormat,this._width=void 0,this._height=void 0,this._framebuffer=void 0,this._multisampleFramebuffer=void 0,this._colorTextures=void 0,this._color&&(this._colorTextures=new Array(this._colorAttachmentsLength),this._colorRenderbuffers=new Array(this._colorAttachmentsLength)),this._colorRenderbuffer=void 0,this._depthStencilRenderbuffer=void 0,this._depthStencilTexture=void 0,this._depthRenderbuffer=void 0,this._depthTexture=void 0,this._attachmentsDirty=!1}Object.defineProperties(pa.prototype,{framebuffer:{get:function(){return this._numSamples>1?this._multisampleFramebuffer.getRenderFramebuffer():this._framebuffer}},numSamples:{get:function(){return this._numSamples}},status:{get:function(){return this.framebuffer.status}}});pa.prototype.isDirty=function(e,t,n,i,r){n=n??1;let o=this._width!==e||this._height!==t,s=this._numSamples!==n,a=l(i)&&this._pixelDatatype!==i||l(r)&&this._pixelFormat!==r,c=n===1?l(this._framebuffer):l(this._multisampleFramebuffer);return this._attachmentsDirty||o||s||a||!c||this._color&&!l(this._colorTextures[0])};pa.prototype.update=function(e,t,n,i,r,o){if(i=e.msaa?i??1:1,r=r??(this._color?this._pixelDatatype??ze.UNSIGNED_BYTE:void 0),o=o??(this._color?this._pixelFormat??Ke.RGBA:void 0),this.isDirty(t,n,i,r,o)){if(this.destroy(),this._width=t,this._height=n,this._numSamples=i,this._pixelDatatype=r,this._pixelFormat=o,this._attachmentsDirty=!1,this._color&&this._createColorAttachments){for(let s=0;s<this._colorAttachmentsLength;++s)if(this._colorTextures[s]=new Dt({context:e,width:t,height:n,pixelFormat:o,pixelDatatype:r,sampler:jt.NEAREST}),this._numSamples>1){let a=jl.getColorFormat(r);this._colorRenderbuffers[s]=new Sf({context:e,width:t,height:n,format:a,numSamples:this._numSamples})}}this._depthStencil&&this._createDepthAttachments&&(this._supportsDepthTexture&&e.depthTexture?(this._depthStencilTexture=new Dt({context:e,width:t,height:n,pixelFormat:Ke.DEPTH_STENCIL,pixelDatatype:ze.UNSIGNED_INT_24_8,sampler:jt.NEAREST}),this._numSamples>1&&(this._depthStencilRenderbuffer=new Sf({context:e,width:t,height:n,format:jl.DEPTH24_STENCIL8,numSamples:this._numSamples}))):this._depthStencilRenderbuffer=new Sf({context:e,width:t,height:n,format:jl.DEPTH_STENCIL})),this._depth&&this._createDepthAttachments&&(this._supportsDepthTexture&&e.depthTexture?this._depthTexture=new Dt({context:e,width:t,height:n,pixelFormat:Ke.DEPTH_COMPONENT,pixelDatatype:ze.UNSIGNED_INT,sampler:jt.NEAREST}):this._depthRenderbuffer=new Sf({context:e,width:t,height:n,format:jl.DEPTH_COMPONENT16})),this._numSamples>1?this._multisampleFramebuffer=new IO({context:e,width:this._width,height:this._height,colorTextures:this._colorTextures,colorRenderbuffers:this._colorRenderbuffers,depthStencilTexture:this._depthStencilTexture,depthStencilRenderbuffer:this._depthStencilRenderbuffer,destroyAttachments:!1}):this._framebuffer=new _s({context:e,colorTextures:this._colorTextures,depthTexture:this._depthTexture,depthRenderbuffer:this._depthRenderbuffer,depthStencilTexture:this._depthStencilTexture,depthStencilRenderbuffer:this._depthStencilRenderbuffer,destroyAttachments:!1})}};pa.prototype.getColorTexture=function(e){return e=e??0,this._colorTextures[e]};pa.prototype.setColorTexture=function(e,t){t=t??0,this._attachmentsDirty=e!==this._colorTextures[t],this._colorTextures[t]=e};pa.prototype.getColorRenderbuffer=function(e){return e=e??0,this._colorRenderbuffers[e]};pa.prototype.setColorRenderbuffer=function(e,t){t=t??0,this._attachmentsDirty=e!==this._colorRenderbuffers[t],this._colorRenderbuffers[t]=e};pa.prototype.getDepthRenderbuffer=function(){return this._depthRenderbuffer};pa.prototype.setDepthRenderbuffer=function(e){this._attachmentsDirty=e!==this._depthRenderbuffer,this._depthRenderbuffer=e};pa.prototype.getDepthTexture=function(){return this._depthTexture};pa.prototype.setDepthTexture=function(e){this._attachmentsDirty=e!==this._depthTexture,this._depthTexture=e};pa.prototype.getDepthStencilRenderbuffer=function(){return this._depthStencilRenderbuffer};pa.prototype.setDepthStencilRenderbuffer=function(e){this._attachmentsDirty=e!==this._depthStencilRenderbuffer,this._depthStencilRenderbuffer=e};pa.prototype.getDepthStencilTexture=function(){return this._depthStencilTexture};pa.prototype.setDepthStencilTexture=function(e){this._attachmentsDirty=e!==this._depthStencilTexture,this._depthStencilTexture=e};pa.prototype.prepareTextures=function(e,t){this._numSamples>1&&this._multisampleFramebuffer.blitFramebuffers(e,t)};pa.prototype.clear=function(e,t,n){let i=t.framebuffer;t.framebuffer=this.framebuffer,t.execute(e,n),t.framebuffer=i};pa.prototype.destroyFramebuffer=function(){this._framebuffer=this._framebuffer&&this._framebuffer.destroy(),this._multisampleFramebuffer=this._multisampleFramebuffer&&this._multisampleFramebuffer.destroy()};pa.prototype.destroy=function(){if(this._color){let e=this._colorTextures,t=this._colorRenderbuffers;for(let n=0;n<e.length;++n){let i=e[n];this._createColorAttachments&&l(i)&&!i.isDestroyed()&&i.destroy(),l(i)&&i.isDestroyed()&&(e[n]=void 0);let r=t[n];this._createColorAttachments&&l(r)&&!r.isDestroyed()&&r.destroy(),l(r)&&r.isDestroyed()&&(t[n]=void 0)}}this._depthStencil&&(this._createDepthAttachments&&(this._depthStencilTexture=this._depthStencilTexture&&this._depthStencilTexture.destroy(),this._depthStencilRenderbuffer=this._depthStencilRenderbuffer&&this._depthStencilRenderbuffer.destroy()),l(this._depthStencilTexture)&&this._depthStencilTexture.isDestroyed()&&(this._depthStencilTexture=void 0),l(this._depthStencilRenderbuffer)&&this._depthStencilRenderbuffer.isDestroyed()&&(this._depthStencilRenderbuffer=void 0)),this._depth&&(this._createDepthAttachments&&(this._depthTexture=this._depthTexture&&this._depthTexture.destroy(),this._depthRenderbuffer=this._depthRenderbuffer&&this._depthRenderbuffer.destroy()),l(this._depthTexture)&&this._depthTexture.isDestroyed()&&(this._depthTexture=void 0),l(this._depthRenderbuffer)&&this._depthRenderbuffer.isDestroyed()&&(this._depthRenderbuffer=void 0)),this.destroyFramebuffer()};var ai=pa;function j6e(e,t,n){let i={flipY:!0,skipColorSpaceConversion:n,preferImageBitmap:!0},r=[De.createIfNeeded(t.positiveX).fetchImage(i),De.createIfNeeded(t.negativeX).fetchImage(i),De.createIfNeeded(t.positiveY).fetchImage(i),De.createIfNeeded(t.negativeY).fetchImage(i),De.createIfNeeded(t.positiveZ).fetchImage(i),De.createIfNeeded(t.negativeZ).fetchImage(i)];return Promise.all(r).then(function(o){return new ns({context:e,source:{positiveX:o[0],negativeX:o[1],positiveY:o[2],negativeY:o[3],positiveZ:o[4],negativeZ:o[5]}})})}var DO=j6e;var Uy={NONE:0,VERTEX:1,FRAGMENT:2,BOTH:3};Uy.includesVertexShader=function(e){return(e&Uy.VERTEX)!==0};Uy.includesFragmentShader=function(e){return(e&Uy.FRAGMENT)!==0};Uy.union=function(...e){let t=0;for(let n=0;n<e.length;n++)t|=e[n];return t};Uy.intersection=function(...e){let t=e[0];for(let n=1;n<e.length;n++)t&=e[n];return t};Object.freeze(Uy);var de=Uy;function VX(e){this.name=e,this.fields=[]}VX.prototype.addField=function(e,t){let n=` ${e} ${t};`;this.fields.push(n)};VX.prototype.generateGlslLines=function(){let e=this.fields;return e.length===0&&(e=[" float _empty;"]),[].concat(`struct ${this.name}`,"{",e,"};")};var RO=VX;function jX(e){this.signature=e,this.body=[]}jX.prototype.addLines=function(e){let t=this.body;if(Array.isArray(e)){let n=e.length;for(let i=0;i<n;i++)t.push(` ${e[i]}`)}else t.push(` ${e}`)};jX.prototype.generateGlslLines=function(){return[].concat(this.signature,"{",this.body,"}")};var OO=jX;function H6e(e,t){if(!l(t))return;let n=t.length;if(n===0)return;let i=e.length;e.length+=n;for(let r=0;r<n;r++)e[i+r]=t[r]}var Zn=H6e;function Hl(){this._positionAttributeLine=void 0,this._nextAttributeLocation=1,this._attributeLocations={},this._attributeLines=[],this._structs={},this._functions={},this._vertexShaderParts={defineLines:[],uniformLines:[],shaderLines:[],varyingLines:[],structIds:[],functionIds:[]},this._fragmentShaderParts={defineLines:[],uniformLines:[],shaderLines:[],varyingLines:[],structIds:[],functionIds:[]}}Object.defineProperties(Hl.prototype,{attributeLocations:{get:function(){return this._attributeLocations}}});Hl.prototype.addDefine=function(e,t,n){n=n??de.BOTH;let i=e;l(t)&&(i+=` ${t.toString()}`),de.includesVertexShader(n)&&this._vertexShaderParts.defineLines.push(i),de.includesFragmentShader(n)&&this._fragmentShaderParts.defineLines.push(i)};Hl.prototype.addStruct=function(e,t,n){this._structs[e]=new RO(t),de.includesVertexShader(n)&&this._vertexShaderParts.structIds.push(e),de.includesFragmentShader(n)&&this._fragmentShaderParts.structIds.push(e)};Hl.prototype.addStructField=function(e,t,n){this._structs[e].addField(t,n)};Hl.prototype.addFunction=function(e,t,n){this._functions[e]=new OO(t),de.includesVertexShader(n)&&this._vertexShaderParts.functionIds.push(e),de.includesFragmentShader(n)&&this._fragmentShaderParts.functionIds.push(e)};Hl.prototype.addFunctionLines=function(e,t){this._functions[e].addLines(t)};Hl.prototype.addUniform=function(e,t,n){n=n??de.BOTH;let i=`uniform ${e} ${t};`;de.includesVertexShader(n)&&this._vertexShaderParts.uniformLines.push(i),de.includesFragmentShader(n)&&this._fragmentShaderParts.uniformLines.push(i)};Hl.prototype.setPositionAttribute=function(e,t){return this._positionAttributeLine=`in ${e} ${t};`,this._attributeLocations[t]=0,0};Hl.prototype.addAttribute=function(e,t){let n=`in ${e} ${t};`;this._attributeLines.push(n);let i=this._nextAttributeLocation;return this._attributeLocations[t]=i,this._nextAttributeLocation+=W6e(e),i};Hl.prototype.addVarying=function(e,t,n){n=l(n)?`${n} `:"";let i=`${e} ${t};`;this._vertexShaderParts.varyingLines.push(`${n}out ${i}`),this._fragmentShaderParts.varyingLines.push(`${n}in ${i}`)};Hl.prototype.addVertexLines=function(e){let t=this._vertexShaderParts.shaderLines;Array.isArray(e)?Zn(t,e):t.push(e)};Hl.prototype.addFragmentLines=function(e){let t=this._fragmentShaderParts.shaderLines;Array.isArray(e)?Zn(t,e):t.push(e)};Hl.prototype.buildShaderProgram=function(e){let t=l(this._positionAttributeLine)?[this._positionAttributeLine]:[],n=G6e(this),i=q6e(this),r=t.concat(this._attributeLines,this._vertexShaderParts.uniformLines,this._vertexShaderParts.varyingLines,n.vertexLines,i.vertexLines,this._vertexShaderParts.shaderLines).join(` +${i}`};function W8e(e,t){let n=e.defines,i=n.length;for(let r=0;r<i;++r)if(n[r]===t)return!0;return!1}function zde(e,t){let n=e.sources,i=n.length;for(let r=0;r<i;++r)if(n[r].indexOf(t)!==-1)return!0;return!1}function Vde(e,t){let n=t.length;for(let i=0;i<n;++i){let r=t[i];if(zde(e,r))return r}}var q8e=["v_normalEC","v_normal"];La.findNormalVarying=function(e){return zde(e,"#ifdef HAS_NORMALS")?W8e(e,"HAS_NORMALS")?"v_normalEC":void 0:Vde(e,q8e)};var Y8e=["v_positionEC"];La.findPositionVarying=function(e){return Vde(e,Y8e)};var Ye=La;function qh(e){this._context=e,this._shaders={},this._numberOfShaders=0,this._shadersToRelease={}}Object.defineProperties(qh.prototype,{numberOfShaders:{get:function(){return this._numberOfShaders}}});qh.prototype.replaceShaderProgram=function(e){return l(e.shaderProgram)&&e.shaderProgram.destroy(),this.getShaderProgram(e)};function X8e(e){let t=Object.keys(e).sort();return JSON.stringify(e,t)}qh.prototype.getShaderProgram=function(e){let t=e.vertexShaderSource,n=e.fragmentShaderSource,i=e.attributeLocations;typeof t=="string"&&(t=new Ye({sources:[t]})),typeof n=="string"&&(n=new Ye({sources:[n]}));let r=t.getCacheKey(),o=n.getCacheKey(),s=l(i)?X8e(i):"",a=`${r}:${o}:${s}`,c;if(l(this._shaders[a]))c=this._shaders[a],delete this._shadersToRelease[a];else{let u=this._context,f=t.createCombinedVertexShader(u),d=n.createCombinedFragmentShader(u),p=new Qt({gl:u._gl,logShaderCompilation:u.logShaderCompilation,debugShaders:u.debugShaders,vertexShaderSource:t,vertexShaderText:f,fragmentShaderSource:n,fragmentShaderText:d,attributeLocations:i});c={cache:this,shaderProgram:p,keyword:a,derivedKeywords:[],count:0},p._cachedShader=c,this._shaders[a]=c,++this._numberOfShaders}return++c.count,c.shaderProgram};qh.prototype.replaceDerivedShaderProgram=function(e,t,n){let i=e._cachedShader,r=t+i.keyword,o=this._shaders[r];if(l(o)){LX(this,o);let s=i.derivedKeywords.indexOf(t);s>-1&&i.derivedKeywords.splice(s,1)}return this.createDerivedShaderProgram(e,t,n)};qh.prototype.getDerivedShaderProgram=function(e,t){let n=e._cachedShader,i=t+n.keyword,r=this._shaders[i];if(l(r))return r.shaderProgram};qh.prototype.createDerivedShaderProgram=function(e,t,n){let i=e._cachedShader,r=t+i.keyword,o=n.vertexShaderSource,s=n.fragmentShaderSource,a=n.attributeLocations;typeof o=="string"&&(o=new Ye({sources:[o]})),typeof s=="string"&&(s=new Ye({sources:[s]}));let c=this._context,u=o.createCombinedVertexShader(c),f=s.createCombinedFragmentShader(c),d=new Qt({gl:c._gl,logShaderCompilation:c.logShaderCompilation,debugShaders:c.debugShaders,vertexShaderSource:o,vertexShaderText:u,fragmentShaderSource:s,fragmentShaderText:f,attributeLocations:a}),p={cache:this,shaderProgram:d,keyword:r,derivedKeywords:[],count:0};return i.derivedKeywords.push(t),d._cachedShader=p,this._shaders[r]=p,d};function LX(e,t){let n=t.derivedKeywords,i=n.length;for(let r=0;r<i;++r){let o=n[r]+t.keyword,s=e._shaders[o];LX(e,s)}delete e._shaders[t.keyword],t.shaderProgram.finalDestroy()}qh.prototype.destroyReleasedShaderPrograms=function(){let e=this._shadersToRelease;for(let t in e)if(e.hasOwnProperty(t)){let n=e[t];LX(this,n),--this._numberOfShaders}this._shadersToRelease={}};qh.prototype.releaseShaderProgram=function(e){if(l(e)){let t=e._cachedShader;t&&--t.count===0&&(this._shadersToRelease[t.keyword]=t)}};qh.prototype.isDestroyed=function(){return!1};qh.prototype.destroy=function(){let e=this._shaders;for(let t in e)e.hasOwnProperty(t)&&e[t].shaderProgram.finalDestroy();return le(this)};var TO=qh;function Pd(e){e=e??H.EMPTY_OBJECT;let{context:t,source:n,pixelFormat:i=Ke.RGBA,pixelDatatype:r=ze.UNSIGNED_BYTE,flipY:o=!0,skipColorSpaceConversion:s=!1,sampler:a=new jt}=e,{width:c,height:u}=e;l(n)&&(l(c)||(c=n.videoWidth??n.naturalWidth??n.width),l(u)||(u=n.videoHeight??n.naturalHeight??n.height));let f=e.preMultiplyAlpha||i===Ke.RGB||i===Ke.LUMINANCE,d=Ke.toInternalFormat(i,r,t),p=Ke.isCompressedFormat(d),g=t._gl,m=p?Ke.compressedTextureSizeInBytes(i,c,u):Ke.textureSizeInBytes(i,r,c,u);this._id=e.id??Kn(),this._context=t,this._textureFilterAnisotropic=t._textureFilterAnisotropic,this._textureTarget=g.TEXTURE_2D,this._texture=g.createTexture(),this._internalFormat=d,this._pixelFormat=i,this._pixelDatatype=r,this._width=c,this._height=u,this._dimensions=new U(c,u),this._hasMipmap=!1,this._sizeInBytes=m,this._preMultiplyAlpha=f,this._flipY=o,this._initialized=!1,this._sampler=void 0,this._sampler=a,Wde(this,a),g.activeTexture(g.TEXTURE0),g.bindTexture(this._textureTarget,this._texture),l(n)?(s?g.pixelStorei(g.UNPACK_COLORSPACE_CONVERSION_WEBGL,g.NONE):g.pixelStorei(g.UNPACK_COLORSPACE_CONVERSION_WEBGL,g.BROWSER_DEFAULT_WEBGL),l(n.arrayBufferView)?Ke.isCompressedFormat(d)?K8e(this,n):jde(this,n):l(n.framebuffer)?J8e(this,n):Hde(this,n),this._initialized=!0):Gde(this),g.bindTexture(this._textureTarget,null)}function K8e(e,t){let i=e._context._gl,r=e._textureTarget,o=e._internalFormat,{width:s,height:a}=e;if(i.pixelStorei(i.UNPACK_ALIGNMENT,4),i.pixelStorei(i.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!1),i.pixelStorei(i.UNPACK_FLIP_Y_WEBGL,!1),i.compressedTexImage2D(r,0,o,s,a,0,t.arrayBufferView),l(t.mipLevels)){let c=s,u=a;for(let f=0;f<t.mipLevels.length;++f)c=h6(c),u=h6(u),i.compressedTexImage2D(r,f+1,o,c,u,0,t.mipLevels[f])}}function jde(e,t){let n=e._context,i=n._gl,r=e._textureTarget,o=e._internalFormat,{width:s,height:a,pixelFormat:c,pixelDatatype:u,flipY:f}=e,d=Ke.alignmentInBytes(c,u,s);i.pixelStorei(i.UNPACK_ALIGNMENT,d),i.pixelStorei(i.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!1),i.pixelStorei(i.UNPACK_FLIP_Y_WEBGL,!1);let{arrayBufferView:p}=t;if(f&&(p=Ke.flipY(p,c,u,s,a)),i.texImage2D(r,0,o,s,a,0,c,ze.toWebGLConstant(u,n),p),l(t.mipLevels)){let g=s,m=a;for(let y=0;y<t.mipLevels.length;++y)g=h6(g),m=h6(m),i.texImage2D(r,y+1,o,g,m,0,c,ze.toWebGLConstant(u,n),t.mipLevels[y])}}function $8e(e,t,n,i,r,o){let s=e._context,a=s._gl,{pixelFormat:c,pixelDatatype:u}=e,f=Ke.alignmentInBytes(c,u,r);a.pixelStorei(a.UNPACK_ALIGNMENT,f),a.pixelStorei(a.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!1),a.pixelStorei(a.UNPACK_FLIP_Y_WEBGL,!1),e.flipY&&(t=Ke.flipY(t,c,u,r,o)),a.texSubImage2D(e._textureTarget,0,n,i,r,o,c,ze.toWebGLConstant(u,s),t)}function J8e(e,t){let n=e._context,i=n._gl;i.pixelStorei(i.UNPACK_ALIGNMENT,4),i.pixelStorei(i.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!1),i.pixelStorei(i.UNPACK_FLIP_Y_WEBGL,!1),t.framebuffer!==n.defaultFramebuffer&&t.framebuffer._bind(),i.copyTexImage2D(e._textureTarget,0,e._internalFormat,t.xOffset,t.yOffset,e.width,e.height,0),t.framebuffer!==n.defaultFramebuffer&&t.framebuffer._unBind()}function Hde(e,t){let n=e._context,i=n._gl;i.pixelStorei(i.UNPACK_ALIGNMENT,4),i.pixelStorei(i.UNPACK_PREMULTIPLY_ALPHA_WEBGL,e.preMultiplyAlpha),i.pixelStorei(i.UNPACK_FLIP_Y_WEBGL,e.flipY),i.texImage2D(e._textureTarget,0,e._internalFormat,e.pixelFormat,ze.toWebGLConstant(e.pixelDatatype,n),t)}function Z8e(e,t,n,i){let r=e._context,o=r._gl;o.pixelStorei(o.UNPACK_ALIGNMENT,4),o.pixelStorei(o.UNPACK_PREMULTIPLY_ALPHA_WEBGL,e.preMultiplyAlpha),o.pixelStorei(o.UNPACK_FLIP_Y_WEBGL,e.flipY),o.texSubImage2D(e._textureTarget,0,n,i,e.pixelFormat,ze.toWebGLConstant(e.pixelDatatype,r),t)}function h6(e){let t=Math.floor(e/2)|0;return Math.max(t,1)}function Gde(e){let t=e._context;t._gl.texImage2D(e._textureTarget,0,e._internalFormat,e._width,e._height,0,e._pixelFormat,ze.toWebGLConstant(e._pixelDatatype,t),null)}Pd.create=function(e){return new Pd(e)};Pd.fromFramebuffer=function(e){e=e??H.EMPTY_OBJECT;let t=e.context,{pixelFormat:n=Ke.RGB,framebufferXOffset:i=0,framebufferYOffset:r=0,width:o=t.drawingBufferWidth,height:s=t.drawingBufferHeight,framebuffer:a}=e;return new Pd({context:t,width:o,height:s,pixelFormat:n,source:{framebuffer:l(a)?a:t.defaultFramebuffer,xOffset:i,yOffset:r,width:o,height:s}})};Object.defineProperties(Pd.prototype,{id:{get:function(){return this._id}},sampler:{get:function(){return this._sampler},set:function(e){Wde(this,e),this._sampler=e}},pixelFormat:{get:function(){return this._pixelFormat}},pixelDatatype:{get:function(){return this._pixelDatatype}},dimensions:{get:function(){return this._dimensions}},preMultiplyAlpha:{get:function(){return this._preMultiplyAlpha}},flipY:{get:function(){return this._flipY}},width:{get:function(){return this._width}},height:{get:function(){return this._height}},sizeInBytes:{get:function(){return this._hasMipmap?Math.floor(this._sizeInBytes*4/3):this._sizeInBytes}},_target:{get:function(){return this._textureTarget}}});function Wde(e,t){let{minificationFilter:n,magnificationFilter:i}=t,r=[Wt.NEAREST_MIPMAP_NEAREST,Wt.NEAREST_MIPMAP_LINEAR,Wt.LINEAR_MIPMAP_NEAREST,Wt.LINEAR_MIPMAP_LINEAR].includes(n),o=e._context,s=e._pixelFormat,a=e._pixelDatatype;(a===ze.FLOAT&&!o.textureFloatLinear||a===ze.HALF_FLOAT&&!o.textureHalfFloatLinear)&&(n=r?Wt.NEAREST_MIPMAP_NEAREST:Wt.NEAREST,i=Jn.NEAREST),o.webgl2&&Ke.isDepthFormat(s)&&(n=Wt.NEAREST,i=Jn.NEAREST);let c=o._gl,u=e._textureTarget;c.activeTexture(c.TEXTURE0),c.bindTexture(u,e._texture),c.texParameteri(u,c.TEXTURE_MIN_FILTER,n),c.texParameteri(u,c.TEXTURE_MAG_FILTER,i),c.texParameteri(u,c.TEXTURE_WRAP_S,t.wrapS),c.texParameteri(u,c.TEXTURE_WRAP_T,t.wrapT),l(e._textureFilterAnisotropic)&&c.texParameteri(u,e._textureFilterAnisotropic.TEXTURE_MAX_ANISOTROPY_EXT,t.maximumAnisotropy),c.bindTexture(u,null)}Pd.prototype.copyFrom=function(e){let{xOffset:t=0,yOffset:n=0,source:i,skipColorSpaceConversion:r=!1}=e,s=this._context._gl,a=this._textureTarget;s.activeTexture(s.TEXTURE0),s.bindTexture(a,this._texture);let{width:c,height:u}=i;l(i.videoWidth)&&l(i.videoHeight)?(c=i.videoWidth,u=i.videoHeight):l(i.naturalWidth)&&l(i.naturalHeight)&&(c=i.naturalWidth,u=i.naturalHeight),r?s.pixelStorei(s.UNPACK_COLORSPACE_CONVERSION_WEBGL,s.NONE):s.pixelStorei(s.UNPACK_COLORSPACE_CONVERSION_WEBGL,s.BROWSER_DEFAULT_WEBGL);let f=!1;this._initialized||(t===0&&n===0&&c===this._width&&u===this._height?(l(i.arrayBufferView)?jde(this,i):Hde(this,i),f=!0):(s.pixelStorei(s.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!1),s.pixelStorei(s.UNPACK_FLIP_Y_WEBGL,!1),Gde(this)),this._initialized=!0),f||(l(i.arrayBufferView)?$8e(this,i.arrayBufferView,t,n,c,u):Z8e(this,i,t,n)),s.bindTexture(a,null)};Pd.prototype.copyFromFramebuffer=function(e,t,n,i,r,o){e=e??0,t=t??0,n=n??0,i=i??0,r=r??this._width,o=o??this._height;let s=this._context._gl,a=this._textureTarget;s.activeTexture(s.TEXTURE0),s.bindTexture(a,this._texture),s.copyTexSubImage2D(a,0,e,t,n,i,r,o),s.bindTexture(a,null),this._initialized=!0};Pd.prototype.generateMipmap=function(e){e=e??Id.DONT_CARE,this._hasMipmap=!0;let t=this._context._gl,n=this._textureTarget;t.hint(t.GENERATE_MIPMAP_HINT,e),t.activeTexture(t.TEXTURE0),t.bindTexture(n,this._texture),t.generateMipmap(n),t.bindTexture(n,null)};Pd.prototype.isDestroyed=function(){return!1};Pd.prototype.destroy=function(){return this._context._gl.deleteTexture(this._texture),le(this)};Pd.defaultColor=z.WHITE;var Dt=Pd;function bx(){this._textures={},this._numberOfTextures=0,this._texturesToRelease={}}Object.defineProperties(bx.prototype,{numberOfTextures:{get:function(){return this._numberOfTextures}}});bx.prototype.getTexture=function(e){let t=this._textures[e];if(l(t))return delete this._texturesToRelease[e],++t.count,t.texture};bx.prototype.addTexture=function(e,t){let n={texture:t,count:1};t.finalDestroy=t.destroy;let i=this;t.destroy=function(){--n.count===0&&(i._texturesToRelease[e]=n)},this._textures[e]=n,++this._numberOfTextures};bx.prototype.destroyReleasedTextures=function(){let e=this._texturesToRelease;for(let t in e)if(e.hasOwnProperty(t)){let n=e[t];delete this._textures[t],n.texture.finalDestroy(),--this._numberOfTextures}this._texturesToRelease={}};bx.prototype.isDestroyed=function(){return!1};bx.prototype.destroy=function(){let e=this._textures;for(let t in e)e.hasOwnProperty(t)&&e[t].texture.finalDestroy();return le(this)};var EO=bx;function Dd(e){this.planes=e??[]}var CO=[new h,new h,new h];h.clone(h.UNIT_X,CO[0]);h.clone(h.UNIT_Y,CO[1]);h.clone(h.UNIT_Z,CO[2]);var Fy=new h,Q8e=new h,qde=new sn(new h(1,0,0),0);function Yde(e,t){let n=t.normal;return n.x=e.x,n.y=e.y,n.z=e.z,t.distance=e.w,t}Dd.fromBoundingSphere=function(e,t){l(t)||(t=new Dd);let n=CO.length,i=t.planes;i.length=2*n;let r=e.center,o=e.radius,s=0;for(let a=0;a<n;++a){let c=CO[a],u=i[s],f=i[s+1];l(u)||(u=i[s]=new se),l(f)||(f=i[s+1]=new se),h.multiplyByScalar(c,-o,Fy),h.add(r,Fy,Fy),u.x=c.x,u.y=c.y,u.z=c.z,u.w=-h.dot(c,Fy),h.multiplyByScalar(c,o,Fy),h.add(r,Fy,Fy),f.x=-c.x,f.y=-c.y,f.z=-c.z,f.w=-h.dot(h.negate(c,Q8e),Fy),s+=2}return t};Dd.prototype.computeVisibility=function(e){let t=this.planes,n=!1;for(let i=0,r=t.length;i<r;++i){let o=e.intersectPlane(Yde(t[i],qde));if(o===$t.OUTSIDE)return $t.OUTSIDE;o===$t.INTERSECTING&&(n=!0)}return n?$t.INTERSECTING:$t.INSIDE};Dd.prototype.computeVisibilityWithPlaneMask=function(e,t){if(t===Dd.MASK_OUTSIDE||t===Dd.MASK_INSIDE)return t;let n=Dd.MASK_INSIDE,i=this.planes;for(let r=0,o=i.length;r<o;++r){let s=r<31?1<<r:0;if(r<31&&(t&s)===0)continue;let a=e.intersectPlane(Yde(i[r],qde));if(a===$t.OUTSIDE)return Dd.MASK_OUTSIDE;a===$t.INTERSECTING&&(n|=s)}return n};Dd.MASK_OUTSIDE=4294967295;Dd.MASK_INSIDE=0;Dd.MASK_INDETERMINATE=2147483647;var ta=Dd;function Lp(e){e=e??H.EMPTY_OBJECT,this.left=e.left,this._left=void 0,this.right=e.right,this._right=void 0,this.top=e.top,this._top=void 0,this.bottom=e.bottom,this._bottom=void 0,this.near=e.near??1,this._near=this.near,this.far=e.far??5e8,this._far=this.far,this._cullingVolume=new ta,this._orthographicMatrix=new N}function Xde(e){(e.top!==e._top||e.bottom!==e._bottom||e.left!==e._left||e.right!==e._right||e.near!==e._near||e.far!==e._far)&&(e._left=e.left,e._right=e.right,e._top=e.top,e._bottom=e.bottom,e._near=e.near,e._far=e.far,e._orthographicMatrix=N.computeOrthographicOffCenter(e.left,e.right,e.bottom,e.top,e.near,e.far,e._orthographicMatrix))}Object.defineProperties(Lp.prototype,{projectionMatrix:{get:function(){return Xde(this),this._orthographicMatrix}}});var eje=new h,tje=new h,nje=new h,FX=new h;Lp.prototype.computeCullingVolume=function(e,t,n){let i=this._cullingVolume.planes,r=this.top,o=this.bottom,s=this.right,a=this.left,c=this.near,u=this.far,f=h.cross(t,n,eje);h.normalize(f,f);let d=tje;h.multiplyByScalar(t,c,d),h.add(e,d,d);let p=nje;h.multiplyByScalar(f,a,p),h.add(d,p,p);let g=i[0];return l(g)||(g=i[0]=new se),g.x=f.x,g.y=f.y,g.z=f.z,g.w=-h.dot(f,p),h.multiplyByScalar(f,s,p),h.add(d,p,p),g=i[1],l(g)||(g=i[1]=new se),g.x=-f.x,g.y=-f.y,g.z=-f.z,g.w=-h.dot(h.negate(f,FX),p),h.multiplyByScalar(n,o,p),h.add(d,p,p),g=i[2],l(g)||(g=i[2]=new se),g.x=n.x,g.y=n.y,g.z=n.z,g.w=-h.dot(n,p),h.multiplyByScalar(n,r,p),h.add(d,p,p),g=i[3],l(g)||(g=i[3]=new se),g.x=-n.x,g.y=-n.y,g.z=-n.z,g.w=-h.dot(h.negate(n,FX),p),g=i[4],l(g)||(g=i[4]=new se),g.x=t.x,g.y=t.y,g.z=t.z,g.w=-h.dot(t,d),h.multiplyByScalar(t,u,p),h.add(e,p,p),g=i[5],l(g)||(g=i[5]=new se),g.x=-t.x,g.y=-t.y,g.z=-t.z,g.w=-h.dot(h.negate(t,FX),p),this._cullingVolume};Lp.prototype.getPixelDimensions=function(e,t,n,i,r){Xde(this);let o=this.right-this.left,s=this.top-this.bottom,a=i*o/e,c=i*s/t;return r.x=a,r.y=c,r};Lp.prototype.clone=function(e){return l(e)||(e=new Lp),e.left=this.left,e.right=this.right,e.top=this.top,e.bottom=this.bottom,e.near=this.near,e.far=this.far,e._left=void 0,e._right=void 0,e._top=void 0,e._bottom=void 0,e._near=void 0,e._far=void 0,e};Lp.prototype.equals=function(e){return l(e)&&e instanceof Lp&&this.right===e.right&&this.left===e.left&&this.top===e.top&&this.bottom===e.bottom&&this.near===e.near&&this.far===e.far};Lp.prototype.equalsEpsilon=function(e,t,n){return e===this||l(e)&&e instanceof Lp&&D.equalsEpsilon(this.right,e.right,t,n)&&D.equalsEpsilon(this.left,e.left,t,n)&&D.equalsEpsilon(this.top,e.top,t,n)&&D.equalsEpsilon(this.bottom,e.bottom,t,n)&&D.equalsEpsilon(this.near,e.near,t,n)&&D.equalsEpsilon(this.far,e.far,t,n)};var ys=Lp;function Mu(e){e=e??H.EMPTY_OBJECT,this._offCenterFrustum=new ys,this.width=e.width,this._width=void 0,this.aspectRatio=e.aspectRatio,this._aspectRatio=void 0,this.near=e.near??1,this._near=this.near,this.far=e.far??5e8,this._far=this.far}Mu.packedLength=4;Mu.pack=function(e,t,n){return n=n??0,t[n++]=e.width,t[n++]=e.aspectRatio,t[n++]=e.near,t[n]=e.far,t};Mu.unpack=function(e,t,n){return t=t??0,l(n)||(n=new Mu),n.width=e[t++],n.aspectRatio=e[t++],n.near=e[t++],n.far=e[t],n};function By(e){let t=e._offCenterFrustum;if(e.width!==e._width||e.aspectRatio!==e._aspectRatio||e.near!==e._near||e.far!==e._far){e._aspectRatio=e.aspectRatio,e._width=e.width,e._near=e.near,e._far=e.far;let n=1/e.aspectRatio;t.right=e.width*.5,t.left=-t.right,t.top=n*t.right,t.bottom=-t.top,t.near=e.near,t.far=e.far}}Object.defineProperties(Mu.prototype,{projectionMatrix:{get:function(){return By(this),this._offCenterFrustum.projectionMatrix}},offCenterFrustum:{get:function(){return By(this),this._offCenterFrustum}}});Mu.prototype.computeCullingVolume=function(e,t,n){return By(this),this._offCenterFrustum.computeCullingVolume(e,t,n)};Mu.prototype.getPixelDimensions=function(e,t,n,i,r){return By(this),this._offCenterFrustum.getPixelDimensions(e,t,n,i,r)};Mu.prototype.clone=function(e){return l(e)||(e=new Mu),e.aspectRatio=this.aspectRatio,e.width=this.width,e.near=this.near,e.far=this.far,e._aspectRatio=void 0,e._width=void 0,e._near=void 0,e._far=void 0,this._offCenterFrustum.clone(e._offCenterFrustum),e};Mu.prototype.equals=function(e){return!l(e)||!(e instanceof Mu)?!1:(By(this),By(e),this.width===e.width&&this.aspectRatio===e.aspectRatio&&this._offCenterFrustum.equals(e._offCenterFrustum))};Mu.prototype.equalsEpsilon=function(e,t,n){return!l(e)||!(e instanceof Mu)?!1:(By(this),By(e),D.equalsEpsilon(this.width,e.width,t,n)&&D.equalsEpsilon(this.aspectRatio,e.aspectRatio,t,n)&&this._offCenterFrustum.equalsEpsilon(e._offCenterFrustum,t,n))};var gn=Mu;var BX={};function ije(e){let t=6.239996+.0172019696544*e;return .001657*Math.sin(t+.01671*Math.sin(t))}var rje=32.184,oje=2451545;function hhe(e,t){t=K.addSeconds(e,rje,t);let n=K.totalDays(t)-oje;return t=K.addSeconds(t,ije(n),t),t}var m6=new K(2451545,0,si.TAI),sje=1e3,Rd=D.RADIANS_PER_DEGREE,vf=D.RADIANS_PER_ARCSECOND,Pc=14959787e4,Kde=new $;function mhe(e,t,n,i,r,o,s){n<0&&(n=-n,r+=D.PI);let a=e*(1-t),c=i-r,u=r,f=cje(o-i,t),d=aje(t,0);hje(c,n,u,Kde);let p=a*(1+t),g=Math.cos(f),m=Math.sin(f),y=1+t*g,A=p/y;return l(s)?(s.x=A*g,s.y=A*m,s.z=0):s=new h(A*g,A*m,0),$.multiplyByVector(Kde,s,s)}function aje(e,t){return e<=t?"Circular":e<1-t?"Elliptical":e<=1+t?"Parabolic":"Hyperbolic"}function cje(e,t){let n=fje(e,t);return dje(n,t)}var lje=50,uje=D.EPSILON8;function fje(e,t){let n=Math.floor(e/D.TWO_PI);e-=n*D.TWO_PI;let i=e+t*Math.sin(e)/(1-Math.sin(e+t)+Math.sin(e)),r=Number.MAX_VALUE,o;for(o=0;o<lje&&Math.abs(r-i)>uje;++o){r=i;let s=r-t*Math.sin(r)-e,a=1-t*Math.cos(r);i=r-s/a}return r=i+n*D.TWO_PI,r}function dje(e,t){let n=Math.floor(e/D.TWO_PI);e-=n*D.TWO_PI;let i=Math.cos(e)-t,r=Math.sin(e)*Math.sqrt(1-t*t),o=Math.atan2(r,i);return o=D.zeroToTwoPi(o),e<0&&(o-=D.TWO_PI),o+=n*D.TWO_PI,o}function hje(e,t,n,i){let r=Math.cos(e),o=Math.sin(e),s=Math.cos(t),a=Math.sin(t),c=Math.cos(n),u=Math.sin(n);return l(i)?(i[0]=c*r-u*o*s,i[1]=u*r+c*o*s,i[2]=o*a,i[3]=-c*o-u*r*s,i[4]=-u*o+c*r*s,i[5]=r*a,i[6]=u*a,i[7]=-c*a,i[8]=s):i=new $(c*r-u*o*s,-c*o-u*r*s,u*a,u*r+c*o*s,-u*o+c*r*s,-c*a,o*a,r*a,s),i}var mje=1.0000010178*Pc,pje=100.46645683*Rd,gje=129597742283429e-5*vf,$de=16002,Jde=21863,Zde=32004,Qde=10931,ehe=14529,the=16368,nhe=15318,ihe=32794,_je=64*1e-7*Pc,yje=-152*1e-7*Pc,Aje=62*1e-7*Pc,bje=-8*1e-7*Pc,xje=32*1e-7*Pc,Tje=-41*1e-7*Pc,Eje=19*1e-7*Pc,Cje=-11*1e-7*Pc,vje=-150*1e-7*Pc,Sje=-46*1e-7*Pc,wje=68*1e-7*Pc,Ije=54*1e-7*Pc,Pje=14*1e-7*Pc,Dje=24*1e-7*Pc,Rje=-28*1e-7*Pc,Oje=22*1e-7*Pc,rhe=10,ohe=16002,she=21863,ahe=10931,che=1473,lhe=32004,uhe=4387,fhe=73,Mje=-325*1e-7,Nje=-322*1e-7,Lje=-79*1e-7,Fje=232*1e-7,Bje=-52*1e-7,kje=97*1e-7,Uje=55*1e-7,zje=-41*1e-7,Vje=-105*1e-7,jje=-137*1e-7,Hje=258*1e-7,Gje=35*1e-7,Wje=-116*1e-7,qje=-88*1e-7,Yje=-112*1e-7,Xje=-80*1e-7,Tv=new K(0,0,si.TAI);function Kje(e,t){hhe(e,Tv);let i=(Tv.dayNumber-m6.dayNumber+(Tv.secondsOfDay-m6.secondsOfDay)/kn.SECONDS_PER_DAY)/(kn.DAYS_PER_JULIAN_CENTURY*10),r=.3595362*i,o=mje+_je*Math.cos($de*r)+vje*Math.sin($de*r)+yje*Math.cos(Jde*r)+Sje*Math.sin(Jde*r)+Aje*Math.cos(Zde*r)+wje*Math.sin(Zde*r)+bje*Math.cos(Qde*r)+Ije*Math.sin(Qde*r)+xje*Math.cos(ehe*r)+Pje*Math.sin(ehe*r)+Tje*Math.cos(the*r)+Dje*Math.sin(the*r)+Eje*Math.cos(nhe*r)+Rje*Math.sin(nhe*r)+Cje*Math.cos(ihe*r)+Oje*Math.sin(ihe*r),s=pje+gje*i+Mje*Math.cos(rhe*r)+Vje*Math.sin(rhe*r)+Nje*Math.cos(ohe*r)+jje*Math.sin(ohe*r)+Lje*Math.cos(she*r)+Hje*Math.sin(she*r)+Fje*Math.cos(ahe*r)+Gje*Math.sin(ahe*r)+Bje*Math.cos(che*r)+Wje*Math.sin(che*r)+kje*Math.cos(lhe*r)+qje*Math.sin(lhe*r)+Uje*Math.cos(uhe*r)+Yje*Math.sin(uhe*r)+zje*Math.cos(fhe*r)+Xje*Math.sin(fhe*r),a=.0167086342-.0004203654*i,c=102.93734808*Rd+11612.3529*vf*i,u=469.97289*vf*i,f=174.87317577*Rd-8679.27034*vf*i;return mhe(o,a,u,c,f,s,t)}function phe(e,t){hhe(e,Tv);let i=(Tv.dayNumber-m6.dayNumber+(Tv.secondsOfDay-m6.secondsOfDay)/kn.SECONDS_PER_DAY)/kn.DAYS_PER_JULIAN_CENTURY,r=i*i,o=r*i,s=o*i,a=383397.7725+.004*i,c=.055545526-16e-9*i,u=5.15668983*Rd,f=-8e-5*i+.02966*r-42e-6*o-13e-8*s,d=83.35324312*Rd,p=146434202669e-4*i-38.2702*r-.045047*o+21301e-8*s,g=125.04455501*Rd,m=-69679193631e-4*i+6.3602*r+.007625*o-3586e-8*s,y=218.31664563*Rd,A=17325593434847e-4*i-6.391*r+.006588*o-3169e-8*s,b=297.85019547*Rd+vf*(1602961601209e-3*i-6.3706*r+.006593*o-3169e-8*s),x=93.27209062*Rd+vf*(17395272628478e-4*i-12.7512*r-.001037*o+417e-8*s),T=134.96340251*Rd+vf*(17179159232178e-4*i+31.8792*r+.051635*o-2447e-7*s),E=357.52910918*Rd+vf*(1295965810481e-4*i-.5532*r+136e-6*o-1149e-8*s),v=310.17137918*Rd-vf*(6967051436e-3*i+6.2068*r+.007618*o-3219e-8*s),S=2*b,I=4*b,R=6*b,O=2*T,L=3*T,_=4*T,C=2*x;a+=3400.4*Math.cos(S)-635.6*Math.cos(S-T)-235.6*Math.cos(T)+218.1*Math.cos(S-E)+181*Math.cos(S+T),c+=.014216*Math.cos(S-T)+.008551*Math.cos(S-O)-.001383*Math.cos(T)+.001356*Math.cos(S+T)-.001147*Math.cos(I-L)-914e-6*Math.cos(I-O)+869e-6*Math.cos(S-E-T)-627e-6*Math.cos(S)-394e-6*Math.cos(I-_)+282e-6*Math.cos(S-E-O)-279e-6*Math.cos(b-T)-236e-6*Math.cos(O)+231e-6*Math.cos(I)+229e-6*Math.cos(R-_)-201e-6*Math.cos(O-C),f+=486.26*Math.cos(S-C)-40.13*Math.cos(S)+37.51*Math.cos(C)+25.73*Math.cos(O-C)+19.97*Math.cos(S-E-C),p+=-55609*Math.sin(S-T)-34711*Math.sin(S-O)-9792*Math.sin(T)+9385*Math.sin(I-L)+7505*Math.sin(I-O)+5318*Math.sin(S+T)+3484*Math.sin(I-_)-3417*Math.sin(S-E-T)-2530*Math.sin(R-_)-2376*Math.sin(S)-2075*Math.sin(S-L)-1883*Math.sin(O)-1736*Math.sin(R-5*T)+1626*Math.sin(E)-1370*Math.sin(R-L),m+=-5392*Math.sin(S-C)-540*Math.sin(E)-441*Math.sin(S)+423*Math.sin(C)-288*Math.sin(O-C),A+=-3332.9*Math.sin(S)+1197.4*Math.sin(S-T)-662.5*Math.sin(E)+396.3*Math.sin(T)-218*Math.sin(S-E);let w=2*v,P=3*v;f+=46.997*Math.cos(v)*i-.614*Math.cos(S-C+v)*i+.614*Math.cos(S-C-v)*i-.0297*Math.cos(w)*r-.0335*Math.cos(v)*r+.0012*Math.cos(S-C+w)*r-16e-5*Math.cos(v)*o+4e-5*Math.cos(P)*o+4e-5*Math.cos(w)*o;let M=2.116*Math.sin(v)*i-.111*Math.sin(S-C-v)*i-.0015*Math.sin(v)*r;p+=M,A+=M,m+=-520.77*Math.sin(v)*i+13.66*Math.sin(S-C+v)*i+1.12*Math.sin(S-v)*i-1.06*Math.sin(C-v)*i+.66*Math.sin(w)*r+.371*Math.sin(v)*r-.035*Math.sin(S-C+w)*r-.015*Math.sin(S-C+v)*r+.0014*Math.sin(v)*o-.0011*Math.sin(P)*o-9e-4*Math.sin(w)*o,a*=sje;let F=u+f*vf,V=d+p*vf,B=y+A*vf,j=g+m*vf;return mhe(a,c,F,V,j,B,t)}var dhe=.012300034,$je=dhe/(dhe+1)*-1;function Jje(e,t){return t=phe(e,t),h.multiplyByScalar(t,$je,t)}var ghe=new $(1.0000000000000002,5619723173785822e-31,4690511510146299e-34,-5154129427414611e-31,.9174820620691819,-.39777715593191376,-223970096136568e-30,.39777715593191376,.9174820620691819),vO=new h;BX.computeSunPositionInEarthInertialFrame=function(e,t){return l(e)||(e=K.now()),l(t)||(t=new h),vO=Kje(e,vO),t=h.negate(vO,t),Jje(e,vO),h.subtract(t,vO,t),$.multiplyByVector(ghe,t,t),t};BX.computeMoonPositionInEarthInertialFrame=function(e,t){return l(e)||(e=K.now()),t=phe(e,t),$.multiplyByVector(ghe,t,t),t};var ky=BX;var SO={MORPHING:0,COLUMBUS_VIEW:1,SCENE2D:2,SCENE3D:3};SO.getMorphTime=function(e){return e===SO.SCENE3D?1:e===SO.MORPHING?void 0:0};Object.freeze(SO);var re=SO;function Zje(e){e=e??H.EMPTY_OBJECT,this.color=z.clone(e.color??z.WHITE),this.intensity=e.intensity??2}var dg=Zje;function Ev(){this.globeDepthTexture=void 0,this.edgeIdTexture=void 0,this.edgeColorTexture=void 0,this.edgeDepthTexture=void 0,this.planarFillIdTexture=void 0,this.gamma=void 0,this._viewport=new et,this._viewportCartesian4=new se,this._viewportDirty=!1,this._viewportOrthographicMatrix=N.clone(N.IDENTITY),this._viewportTransformation=N.clone(N.IDENTITY),this._model=N.clone(N.IDENTITY),this._view=N.clone(N.IDENTITY),this._inverseView=N.clone(N.IDENTITY),this._projection=N.clone(N.IDENTITY),this._infiniteProjection=N.clone(N.IDENTITY),this._entireFrustum=new U,this._currentFrustum=new U,this._frustumPlanes=new se,this._farDepthFromNearPlusOne=void 0,this._log2FarDepthFromNearPlusOne=void 0,this._oneOverLog2FarDepthFromNearPlusOne=void 0,this._frameState=void 0,this._temeToPseudoFixed=$.clone(N.IDENTITY),this._view3DDirty=!0,this._view3D=new N,this._inverseView3DDirty=!0,this._inverseView3D=new N,this._inverseModelDirty=!0,this._inverseModel=new N,this._inverseTransposeModelDirty=!0,this._inverseTransposeModel=new $,this._viewRotation=new $,this._inverseViewRotation=new $,this._viewRotation3D=new $,this._inverseViewRotation3D=new $,this._inverseProjectionDirty=!0,this._inverseProjection=new N,this._modelViewDirty=!0,this._modelView=new N,this._modelView3DDirty=!0,this._modelView3D=new N,this._modelViewRelativeToEyeDirty=!0,this._modelViewRelativeToEye=new N,this._inverseModelViewDirty=!0,this._inverseModelView=new N,this._inverseModelView3DDirty=!0,this._inverseModelView3D=new N,this._viewProjectionDirty=!0,this._viewProjection=new N,this._inverseViewProjectionDirty=!0,this._inverseViewProjection=new N,this._modelViewProjectionDirty=!0,this._modelViewProjection=new N,this._inverseModelViewProjectionDirty=!0,this._inverseModelViewProjection=new N,this._modelViewProjectionRelativeToEyeDirty=!0,this._modelViewProjectionRelativeToEye=new N,this._modelViewInfiniteProjectionDirty=!0,this._modelViewInfiniteProjection=new N,this._normalDirty=!0,this._normal=new $,this._normal3DDirty=!0,this._normal3D=new $,this._inverseNormalDirty=!0,this._inverseNormal=new $,this._inverseNormal3DDirty=!0,this._inverseNormal3D=new $,this._encodedCameraPositionMCDirty=!0,this._encodedCameraPositionMC=new Sn,this._cameraPosition=new h,this._sunPositionWC=new h,this._sunPositionColumbusView=new h,this._sunDirectionWC=new h,this._sunDirectionEC=new h,this._moonDirectionEC=new h,this._lightDirectionWC=new h,this._lightDirectionEC=new h,this._lightColor=new h,this._lightColorHdr=new h,this._pass=void 0,this._mode=void 0,this._mapProjection=void 0,this._ellipsoid=void 0,this._cameraDirection=new h,this._cameraRight=new h,this._cameraUp=new h,this._frustum2DWidth=0,this._eyeHeight=0,this._eyeHeight2D=new U,this._eyeCartographic=new h,this._eyeEllipsoidNormalEC=new h,this._eyeEllipsoidCurvature=new U,this._eyeToEnu=new $,this._modelToEnu=new N,this._enuToModel=new N,this._pixelRatio=1,this._orthographicIn3D=!1,this._backgroundColor=new z,this._brdfLut=void 0,this._environmentMap=void 0,this._sphericalHarmonicCoefficients=void 0,this._specularEnvironmentMaps=void 0,this._specularEnvironmentMapsMaximumLOD=void 0,this._fogDensity=void 0,this._fogVisualDensityScalar=void 0,this._fogMinimumBrightness=void 0,this._atmosphereHsbShift=void 0,this._atmosphereLightIntensity=void 0,this._atmosphereRayleighCoefficient=new h,this._atmosphereRayleighScaleHeight=new h,this._atmosphereMieCoefficient=new h,this._atmosphereMieScaleHeight=void 0,this._atmosphereMieAnisotropy=void 0,this._atmosphereDynamicLighting=void 0,this._invertClassificationColor=void 0,this._splitPosition=0,this._pixelSizePerMeter=void 0,this._geometricToleranceOverMeter=void 0,this._minimumDisableDepthTestDistance=void 0}Object.defineProperties(Ev.prototype,{frameState:{get:function(){return this._frameState}},viewport:{get:function(){return this._viewport},set:function(e){if(!et.equals(e,this._viewport)){et.clone(e,this._viewport);let t=this._viewport,n=this._viewportCartesian4;n.x=t.x,n.y=t.y,n.z=t.width,n.w=t.height,this._viewportDirty=!0}}},viewportCartesian4:{get:function(){return this._viewportCartesian4}},viewportOrthographic:{get:function(){return Ahe(this),this._viewportOrthographicMatrix}},viewportTransformation:{get:function(){return Ahe(this),this._viewportTransformation}},model:{get:function(){return this._model},set:function(e){N.clone(e,this._model),this._modelView3DDirty=!0,this._inverseModelView3DDirty=!0,this._inverseModelDirty=!0,this._inverseTransposeModelDirty=!0,this._modelViewDirty=!0,this._inverseModelViewDirty=!0,this._modelViewRelativeToEyeDirty=!0,this._inverseModelViewDirty=!0,this._modelViewProjectionDirty=!0,this._inverseModelViewProjectionDirty=!0,this._modelViewProjectionRelativeToEyeDirty=!0,this._modelViewInfiniteProjectionDirty=!0,this._normalDirty=!0,this._inverseNormalDirty=!0,this._normal3DDirty=!0,this._inverseNormal3DDirty=!0,this._encodedCameraPositionMCDirty=!0}},inverseModel:{get:function(){return this._inverseModelDirty&&(this._inverseModelDirty=!1,N.inverse(this._model,this._inverseModel)),this._inverseModel}},inverseTransposeModel:{get:function(){let e=this._inverseTransposeModel;return this._inverseTransposeModelDirty&&(this._inverseTransposeModelDirty=!1,N.getMatrix3(this.inverseModel,e),$.transpose(e,e)),e}},view:{get:function(){return this._view}},view3D:{get:function(){return UX(this),this._view3D}},viewRotation:{get:function(){return UX(this),this._viewRotation}},viewRotation3D:{get:function(){return UX(this),this._viewRotation3D}},inverseView:{get:function(){return this._inverseView}},inverseView3D:{get:function(){return The(this),this._inverseView3D}},inverseViewRotation:{get:function(){return this._inverseViewRotation}},inverseViewRotation3D:{get:function(){return The(this),this._inverseViewRotation3D}},projection:{get:function(){return this._projection}},inverseProjection:{get:function(){return l6e(this),this._inverseProjection}},infiniteProjection:{get:function(){return this._infiniteProjection}},modelView:{get:function(){return u6e(this),this._modelView}},modelView3D:{get:function(){return f6e(this),this._modelView3D}},modelViewRelativeToEye:{get:function(){return _6e(this),this._modelViewRelativeToEye}},inverseModelView:{get:function(){return d6e(this),this._inverseModelView}},inverseModelView3D:{get:function(){return h6e(this),this._inverseModelView3D}},viewProjection:{get:function(){return m6e(this),this._viewProjection}},inverseViewProjection:{get:function(){return p6e(this),this._inverseViewProjection}},modelViewProjection:{get:function(){return g6e(this),this._modelViewProjection}},inverseModelViewProjection:{get:function(){return y6e(this),this._inverseModelViewProjection}},modelViewProjectionRelativeToEye:{get:function(){return A6e(this),this._modelViewProjectionRelativeToEye}},modelViewInfiniteProjection:{get:function(){return b6e(this),this._modelViewInfiniteProjection}},normal:{get:function(){return x6e(this),this._normal}},normal3D:{get:function(){return T6e(this),this._normal3D}},inverseNormal:{get:function(){return E6e(this),this._inverseNormal}},inverseNormal3D:{get:function(){return C6e(this),this._inverseNormal3D}},entireFrustum:{get:function(){return this._entireFrustum}},currentFrustum:{get:function(){return this._currentFrustum}},frustumPlanes:{get:function(){return this._frustumPlanes}},farDepthFromNearPlusOne:{get:function(){return this._farDepthFromNearPlusOne}},log2FarDepthFromNearPlusOne:{get:function(){return this._log2FarDepthFromNearPlusOne}},oneOverLog2FarDepthFromNearPlusOne:{get:function(){return this._oneOverLog2FarDepthFromNearPlusOne}},eyeHeight:{get:function(){return this._eyeHeight}},eyeCartographic:{get:function(){return this._eyeCartographic}},eyeHeight2D:{get:function(){return this._eyeHeight2D}},eyeEllipsoidNormalEC:{get:function(){return this._eyeEllipsoidNormalEC}},eyeEllipsoidCurvature:{get:function(){return this._eyeEllipsoidCurvature}},eyeToEnu:{get:function(){return this._eyeToEnu}},modelToEnu:{get:function(){return this._modelToEnu}},enuToModel:{get:function(){return this._enuToModel}},sunPositionWC:{get:function(){return this._sunPositionWC}},sunPositionColumbusView:{get:function(){return this._sunPositionColumbusView}},sunDirectionWC:{get:function(){return this._sunDirectionWC}},sunDirectionEC:{get:function(){return this._sunDirectionEC}},moonDirectionEC:{get:function(){return this._moonDirectionEC}},lightDirectionWC:{get:function(){return this._lightDirectionWC}},lightDirectionEC:{get:function(){return this._lightDirectionEC}},lightColor:{get:function(){return this._lightColor}},lightColorHdr:{get:function(){return this._lightColorHdr}},encodedCameraPositionMCHigh:{get:function(){return xhe(this),this._encodedCameraPositionMC.high}},encodedCameraPositionMCLow:{get:function(){return xhe(this),this._encodedCameraPositionMC.low}},temeToPseudoFixedMatrix:{get:function(){return this._temeToPseudoFixed}},pixelRatio:{get:function(){return this._pixelRatio}},fogDensity:{get:function(){return this._fogDensity}},fogVisualDensityScalar:{get:function(){return this._fogVisualDensityScalar}},fogMinimumBrightness:{get:function(){return this._fogMinimumBrightness}},atmosphereHsbShift:{get:function(){return this._atmosphereHsbShift}},atmosphereLightIntensity:{get:function(){return this._atmosphereLightIntensity}},atmosphereRayleighCoefficient:{get:function(){return this._atmosphereRayleighCoefficient}},atmosphereRayleighScaleHeight:{get:function(){return this._atmosphereRayleighScaleHeight}},atmosphereMieCoefficient:{get:function(){return this._atmosphereMieCoefficient}},atmosphereMieScaleHeight:{get:function(){return this._atmosphereMieScaleHeight}},atmosphereMieAnisotropy:{get:function(){return this._atmosphereMieAnisotropy}},atmosphereDynamicLighting:{get:function(){return this._atmosphereDynamicLighting}},geometricToleranceOverMeter:{get:function(){return this._geometricToleranceOverMeter}},pass:{get:function(){return this._pass}},backgroundColor:{get:function(){return this._backgroundColor}},brdfLut:{get:function(){return this._brdfLut}},environmentMap:{get:function(){return this._environmentMap}},sphericalHarmonicCoefficients:{get:function(){return this._sphericalHarmonicCoefficients}},specularEnvironmentMaps:{get:function(){return this._specularEnvironmentMaps}},specularEnvironmentMapsMaximumLOD:{get:function(){return this._specularEnvironmentMapsMaximumLOD}},splitPosition:{get:function(){return this._splitPosition}},minimumDisableDepthTestDistance:{get:function(){return this._minimumDisableDepthTestDistance}},invertClassificationColor:{get:function(){return this._invertClassificationColor}},orthographicIn3D:{get:function(){return this._orthographicIn3D}},ellipsoid:{get:function(){return this._ellipsoid??ee.default}}});function Qje(e,t){N.clone(t,e._view),N.getMatrix3(t,e._viewRotation),e._view3DDirty=!0,e._inverseView3DDirty=!0,e._modelViewDirty=!0,e._modelView3DDirty=!0,e._modelViewRelativeToEyeDirty=!0,e._inverseModelViewDirty=!0,e._inverseModelView3DDirty=!0,e._viewProjectionDirty=!0,e._inverseViewProjectionDirty=!0,e._modelViewProjectionDirty=!0,e._modelViewProjectionRelativeToEyeDirty=!0,e._modelViewInfiniteProjectionDirty=!0,e._normalDirty=!0,e._inverseNormalDirty=!0,e._normal3DDirty=!0,e._inverseNormal3DDirty=!0}function e6e(e,t){N.clone(t,e._inverseView),N.getMatrix3(t,e._inverseViewRotation)}function t6e(e,t){N.clone(t,e._projection),e._inverseProjectionDirty=!0,e._viewProjectionDirty=!0,e._inverseViewProjectionDirty=!0,e._modelViewProjectionDirty=!0,e._modelViewProjectionRelativeToEyeDirty=!0}function n6e(e,t){N.clone(t,e._infiniteProjection),e._modelViewInfiniteProjectionDirty=!0}var _he=new h,i6e=new N,yhe=new $;function r6e(e,t){h.clone(t.positionWC,e._cameraPosition),h.clone(t.directionWC,e._cameraDirection),h.clone(t.rightWC,e._cameraRight),h.clone(t.upWC,e._cameraUp);let n=e._ellipsoid,i,r=t.positionCartographic;if(l(r)?(e._eyeHeight=r.height,e._eyeCartographic=h.fromElements(r.longitude,r.latitude,r.height,e._eyeCartographic),e._eyeEllipsoidNormalEC=n.geodeticSurfaceNormalCartographic(r,e._eyeEllipsoidNormalEC),i=h.fromRadians(r.longitude,r.latitude,0,n,_he)):(e._eyeHeight=-n.maximumRadius,h.magnitude(t.positionWC)>0&&(e._eyeEllipsoidNormalEC=h.normalize(t.positionWC,e._eyeEllipsoidNormalEC)),i=n.scaleToGeodeticSurface(t.positionWC,_he)),e._encodedCameraPositionMCDirty=!0,!l(i))return;e._eyeEllipsoidNormalEC=$.multiplyByVector(e._viewRotation,e._eyeEllipsoidNormalEC,e._eyeEllipsoidNormalEC);let o=At.eastNorthUpToFixedFrame(i,n,i6e);e._enuToModel=N.multiplyTransformation(e.inverseModel,o,e._enuToModel),e._modelToEnu=N.inverseTransformation(e._enuToModel,e._modelToEnu);let s=N.getRotation(o,yhe),a=$.multiply(e._viewRotation,s,yhe);e._eyeToEnu=$.transpose(a,e._eyeToEnu),D.equalsEpsilon(n._radii.x,n._radii.y,D.EPSILON15)&&(e._eyeEllipsoidCurvature=n.getLocalCurvature(i,e._eyeEllipsoidCurvature))}var kX=new $,o6e=new he;function s6e(e,t){At.computeIcrfToCentralBodyFixedMatrix(t.time,kX);let n=ky.computeSunPositionInEarthInertialFrame(t.time,e._sunPositionWC);$.multiplyByVector(kX,n,n),h.normalize(n,e._sunDirectionWC),n=$.multiplyByVector(e.viewRotation3D,n,e._sunDirectionEC),h.normalize(n,n),n=ky.computeMoonPositionInEarthInertialFrame(t.time,e._moonDirectionEC),$.multiplyByVector(kX,n,n),$.multiplyByVector(e.viewRotation3D,n,n),h.normalize(n,n);let i=t.mapProjection,o=i.ellipsoid.cartesianToCartographic(e._sunPositionWC,o6e);i.project(o,e._sunPositionColumbusView)}Ev.prototype.updateCamera=function(e){Qje(this,e.viewMatrix),e6e(this,e.inverseViewMatrix),r6e(this,e),this._entireFrustum.x=e.frustum.near,this._entireFrustum.y=e.frustum.far,this.updateFrustum(e.frustum),this._orthographicIn3D=this._mode!==re.SCENE2D&&e.frustum instanceof gn};Ev.prototype.updateFrustum=function(e){t6e(this,e.projectionMatrix),l(e.infiniteProjectionMatrix)&&n6e(this,e.infiniteProjectionMatrix),this._currentFrustum.x=e.near,this._currentFrustum.y=e.far,this._farDepthFromNearPlusOne=e.far-e.near+1,this._log2FarDepthFromNearPlusOne=D.log2(this._farDepthFromNearPlusOne),this._oneOverLog2FarDepthFromNearPlusOne=1/this._log2FarDepthFromNearPlusOne;let t=e.offCenterFrustum;l(t)&&(e=t),this._frustumPlanes.x=e.top,this._frustumPlanes.y=e.bottom,this._frustumPlanes.z=e.left,this._frustumPlanes.w=e.right};Ev.prototype.updatePass=function(e){this._pass=e};var a6e=[],c6e=new dg;Ev.prototype.update=function(e){this._mode=e.mode,this._mapProjection=e.mapProjection,this._ellipsoid=e.mapProjection.ellipsoid,this._pixelRatio=e.pixelRatio;let t=e.camera;this.updateCamera(t),e.mode===re.SCENE2D?(this._frustum2DWidth=t.frustum.right-t.frustum.left,this._eyeHeight2D.x=this._frustum2DWidth*.5,this._eyeHeight2D.y=this._eyeHeight2D.x*this._eyeHeight2D.x):(this._frustum2DWidth=0,this._eyeHeight2D.x=0,this._eyeHeight2D.y=0),s6e(this,e);let n=e.light??c6e;n instanceof dg?(this._lightDirectionWC=h.clone(this._sunDirectionWC,this._lightDirectionWC),this._lightDirectionEC=h.clone(this._sunDirectionEC,this._lightDirectionEC)):(this._lightDirectionWC=h.normalize(h.negate(n.direction,this._lightDirectionWC),this._lightDirectionWC),this._lightDirectionEC=$.multiplyByVector(this.viewRotation3D,this._lightDirectionWC,this._lightDirectionEC));let i=n.color,r=h.fromElements(i.red,i.green,i.blue,this._lightColorHdr);r=h.multiplyByScalar(r,n.intensity,r);let o=h.maximumComponent(r);o>1?h.divideByScalar(r,o,this._lightColor):h.clone(r,this._lightColor);let s=e.brdfLutGenerator,a=l(s)?s.colorTexture:void 0;this._brdfLut=a,this._environmentMap=e.environmentMap??e.context.defaultCubeMap,this._sphericalHarmonicCoefficients=e.sphericalHarmonicCoefficients??a6e,this._specularEnvironmentMaps=e.specularEnvironmentMaps,this._specularEnvironmentMapsMaximumLOD=e.specularEnvironmentMapsMaximumLOD,this._fogDensity=e.fog.density,this._fogVisualDensityScalar=e.fog.visualDensityScalar,this._fogMinimumBrightness=e.fog.minimumBrightness;let c=e.atmosphere;l(c)&&(this._atmosphereHsbShift=h.fromElements(c.hueShift,c.saturationShift,c.brightnessShift,this._atmosphereHsbShift),this._atmosphereLightIntensity=c.lightIntensity,this._atmosphereRayleighCoefficient=h.clone(c.rayleighCoefficient,this._atmosphereRayleighCoefficient),this._atmosphereRayleighScaleHeight=c.rayleighScaleHeight,this._atmosphereMieCoefficient=h.clone(c.mieCoefficient,this._atmosphereMieCoefficient),this._atmosphereMieScaleHeight=c.mieScaleHeight,this._atmosphereMieAnisotropy=c.mieAnisotropy,this._atmosphereDynamicLighting=c.dynamicLighting),this._invertClassificationColor=e.invertClassificationColor,this._frameState=e,this._temeToPseudoFixed=At.computeTemeToPseudoFixedMatrix(e.time,this._temeToPseudoFixed),this._splitPosition=e.splitPosition*e.context.drawingBufferWidth;let u=t.frustum.fov,f=this._viewport,d;l(u)?f.height>f.width?d=Math.tan(.5*u)*2/f.height:d=Math.tan(.5*u)*2/f.width:d=1/Math.max(f.width,f.height),this._geometricToleranceOverMeter=d*e.maximumScreenSpaceError,z.clone(e.backgroundColor,this._backgroundColor),this._minimumDisableDepthTestDistance=e.minimumDisableDepthTestDistance,this._minimumDisableDepthTestDistance*=this._minimumDisableDepthTestDistance,this._minimumDisableDepthTestDistance===Number.POSITIVE_INFINITY&&(this._minimumDisableDepthTestDistance=-1)};function Ahe(e){if(e._viewportDirty){let t=e._viewport;N.computeOrthographicOffCenter(t.x,t.x+t.width,t.y,t.y+t.height,0,1,e._viewportOrthographicMatrix),N.computeViewportTransformation(t,0,1,e._viewportTransformation),e._viewportDirty=!1}}function l6e(e){e._inverseProjectionDirty&&(e._inverseProjectionDirty=!1,e._mode!==re.SCENE2D&&e._mode!==re.MORPHING&&!e._orthographicIn3D?N.inverse(e._projection,e._inverseProjection):N.clone(N.ZERO,e._inverseProjection))}function u6e(e){e._modelViewDirty&&(e._modelViewDirty=!1,N.multiplyTransformation(e._view,e._model,e._modelView))}function f6e(e){e._modelView3DDirty&&(e._modelView3DDirty=!1,N.multiplyTransformation(e.view3D,e._model,e._modelView3D))}function d6e(e){e._inverseModelViewDirty&&(e._inverseModelViewDirty=!1,N.inverse(e.modelView,e._inverseModelView))}function h6e(e){e._inverseModelView3DDirty&&(e._inverseModelView3DDirty=!1,N.inverse(e.modelView3D,e._inverseModelView3D))}function m6e(e){e._viewProjectionDirty&&(e._viewProjectionDirty=!1,N.multiply(e._projection,e._view,e._viewProjection))}function p6e(e){e._inverseViewProjectionDirty&&(e._inverseViewProjectionDirty=!1,N.inverse(e.viewProjection,e._inverseViewProjection))}function g6e(e){e._modelViewProjectionDirty&&(e._modelViewProjectionDirty=!1,N.multiply(e._projection,e.modelView,e._modelViewProjection))}function _6e(e){if(e._modelViewRelativeToEyeDirty){e._modelViewRelativeToEyeDirty=!1;let t=e.modelView,n=e._modelViewRelativeToEye;n[0]=t[0],n[1]=t[1],n[2]=t[2],n[3]=t[3],n[4]=t[4],n[5]=t[5],n[6]=t[6],n[7]=t[7],n[8]=t[8],n[9]=t[9],n[10]=t[10],n[11]=t[11],n[12]=0,n[13]=0,n[14]=0,n[15]=t[15]}}function y6e(e){e._inverseModelViewProjectionDirty&&(e._inverseModelViewProjectionDirty=!1,N.inverse(e.modelViewProjection,e._inverseModelViewProjection))}function A6e(e){e._modelViewProjectionRelativeToEyeDirty&&(e._modelViewProjectionRelativeToEyeDirty=!1,N.multiply(e._projection,e.modelViewRelativeToEye,e._modelViewProjectionRelativeToEye))}function b6e(e){e._modelViewInfiniteProjectionDirty&&(e._modelViewInfiniteProjectionDirty=!1,N.multiply(e._infiniteProjection,e.modelView,e._modelViewInfiniteProjection))}function x6e(e){if(e._normalDirty){e._normalDirty=!1;let t=e._normal;N.getMatrix3(e.inverseModelView,t),$.transpose(t,t)}}function T6e(e){if(e._normal3DDirty){e._normal3DDirty=!1;let t=e._normal3D;N.getMatrix3(e.inverseModelView3D,t),$.transpose(t,t)}}function E6e(e){if(e._inverseNormalDirty){e._inverseNormalDirty=!1;let t=e._inverseNormal;N.getMatrix3(e.modelView,t),$.transpose(t,t)}}function C6e(e){if(e._inverseNormal3DDirty){e._inverseNormal3DDirty=!1;let t=e._inverseNormal3D;N.getMatrix3(e.modelView3D,t),$.transpose(t,t)}}var bhe=new h;function xhe(e){e._encodedCameraPositionMCDirty&&(e._encodedCameraPositionMCDirty=!1,N.multiplyByPoint(e.inverseModel,e._cameraPosition,bhe),Sn.fromCartesian(bhe,e._encodedCameraPositionMC))}var v6e=new h,S6e=new h,w6e=new h,I6e=new h,P6e=new he,D6e=new h,R6e=new N;function O6e(e,t,n,i,r,o,s,a){let c=v6e;c.x=e.y,c.y=e.z,c.z=e.x;let u=S6e;u.x=n.y,u.y=n.z,u.z=n.x;let f=w6e;f.x=i.y,f.y=i.z,f.z=i.x;let d=I6e;d.x=t.y,d.y=t.z,d.z=t.x,o===re.SCENE2D&&(c.z=r*.5);let p=s.unproject(c,P6e);p.longitude=D.clamp(p.longitude,-Math.PI,Math.PI),p.latitude=D.clamp(p.latitude,-D.PI_OVER_TWO,D.PI_OVER_TWO);let g=s.ellipsoid,m=g.cartographicToCartesian(p,D6e),y=At.eastNorthUpToFixedFrame(m,g,R6e);return N.multiplyByPointAsVector(y,u,u),N.multiplyByPointAsVector(y,f,f),N.multiplyByPointAsVector(y,d,d),l(a)||(a=new N),a[0]=u.x,a[1]=f.x,a[2]=-d.x,a[3]=0,a[4]=u.y,a[5]=f.y,a[6]=-d.y,a[7]=0,a[8]=u.z,a[9]=f.z,a[10]=-d.z,a[11]=0,a[12]=-h.dot(u,m),a[13]=-h.dot(f,m),a[14]=h.dot(d,m),a[15]=1,a}function UX(e){e._view3DDirty&&(e._mode===re.SCENE3D?N.clone(e._view,e._view3D):O6e(e._cameraPosition,e._cameraDirection,e._cameraRight,e._cameraUp,e._frustum2DWidth,e._mode,e._mapProjection,e._view3D),N.getMatrix3(e._view3D,e._viewRotation3D),e._view3DDirty=!1)}function The(e){e._inverseView3DDirty&&(N.inverseTransformation(e.view3D,e._inverseView3D),N.getMatrix3(e._inverseView3D,e._inverseViewRotation3D),e._inverseView3DDirty=!1)}var wO=Ev;function Nu(e,t){let{getWebGLStub:n,requestWebgl1:i,webgl:r={},allowTextureFilterAnisotropic:o=!0,transparentDefaultTexture:s=!1}=t??{};r.alpha=r.alpha??!1,r.stencil=r.stencil??!0,r.powerPreference=r.powerPreference??"high-performance";let a=l(n)?n(e,r):M6e(e,r,i),u=typeof WebGL2RenderingContext<"u"&&a instanceof WebGL2RenderingContext;this._canvas=e,this._originalGLContext=a,this._gl=a,this._webgl2=u,this._id=Kn(),this.validateFramebuffer=!1,this.validateShaderProgram=!1,this.logShaderCompilation=!1,this._throwOnWebGLError=!1,this._shaderCache=new TO(this),this._textureCache=new EO,this._transparentDefaultTexture=s;let f=a;this._stencilBits=f.getParameter(f.STENCIL_BITS),kt._maximumCombinedTextureImageUnits=f.getParameter(f.MAX_COMBINED_TEXTURE_IMAGE_UNITS),kt._maximumCubeMapSize=f.getParameter(f.MAX_CUBE_MAP_TEXTURE_SIZE),kt._maximumFragmentUniformVectors=f.getParameter(f.MAX_FRAGMENT_UNIFORM_VECTORS),kt._maximumTextureImageUnits=f.getParameter(f.MAX_TEXTURE_IMAGE_UNITS),kt._maximumRenderbufferSize=f.getParameter(f.MAX_RENDERBUFFER_SIZE),kt._maximumTextureSize=f.getParameter(f.MAX_TEXTURE_SIZE),kt._maximum3DTextureSize=f.getParameter(f.MAX_3D_TEXTURE_SIZE),kt._maximumVaryingVectors=f.getParameter(f.MAX_VARYING_VECTORS),kt._maximumVertexAttributes=f.getParameter(f.MAX_VERTEX_ATTRIBS),kt._maximumVertexTextureImageUnits=f.getParameter(f.MAX_VERTEX_TEXTURE_IMAGE_UNITS),kt._maximumVertexUniformVectors=f.getParameter(f.MAX_VERTEX_UNIFORM_VECTORS),kt._maximumSamples=this._webgl2?f.getParameter(f.MAX_SAMPLES):0;let d=f.getParameter(f.ALIASED_LINE_WIDTH_RANGE);kt._minimumAliasedLineWidth=d[0],kt._maximumAliasedLineWidth=d[1];let p=f.getParameter(f.ALIASED_POINT_SIZE_RANGE);kt._minimumAliasedPointSize=p[0],kt._maximumAliasedPointSize=p[1];let g=f.getParameter(f.MAX_VIEWPORT_DIMS);kt._maximumViewportWidth=g[0],kt._maximumViewportHeight=g[1];let m=f.getShaderPrecisionFormat(f.FRAGMENT_SHADER,f.HIGH_FLOAT);kt._highpFloatSupported=m.precision!==0;let y=f.getShaderPrecisionFormat(f.FRAGMENT_SHADER,f.HIGH_INT);kt._highpIntSupported=y.rangeMax!==0,this._antialias=f.getContextAttributes().antialias,this._standardDerivatives=!!is(f,["OES_standard_derivatives"]),this._blendMinmax=!!is(f,["EXT_blend_minmax"]),this._elementIndexUint=!!is(f,["OES_element_index_uint"]),this._depthTexture=!!is(f,["WEBGL_depth_texture","WEBKIT_WEBGL_depth_texture"]),this._fragDepth=!!is(f,["EXT_frag_depth"]),this._debugShaders=is(f,["WEBGL_debug_shaders"]),this._textureFloat=!!is(f,["OES_texture_float"]),this._textureHalfFloat=!!is(f,["OES_texture_half_float"]),this._textureFloatLinear=!!is(f,["OES_texture_float_linear"]),this._textureHalfFloatLinear=!!is(f,["OES_texture_half_float_linear"]),this._supportsTextureLod=!!is(f,["EXT_shader_texture_lod"]),this._colorBufferFloat=!!is(f,["EXT_color_buffer_float","WEBGL_color_buffer_float"]),this._floatBlend=!!is(f,["EXT_float_blend"]),this._colorBufferHalfFloat=!!is(f,["EXT_color_buffer_half_float"]),this._s3tc=!!is(f,["WEBGL_compressed_texture_s3tc","MOZ_WEBGL_compressed_texture_s3tc","WEBKIT_WEBGL_compressed_texture_s3tc"]),this._pvrtc=!!is(f,["WEBGL_compressed_texture_pvrtc","WEBKIT_WEBGL_compressed_texture_pvrtc"]),this._astc=!!is(f,["WEBGL_compressed_texture_astc"]),this._etc=!!is(f,["WEBG_compressed_texture_etc"]),this._etc1=!!is(f,["WEBGL_compressed_texture_etc1"]),this._bc7=!!is(f,["EXT_texture_compression_bptc"]),Ou.setKTX2SupportedFormats(this._s3tc,this._pvrtc,this._astc,this._etc,this._etc1,this._bc7);let A=o?is(f,["EXT_texture_filter_anisotropic","WEBKIT_EXT_texture_filter_anisotropic"]):void 0;this._textureFilterAnisotropic=A,kt._maximumTextureFilterAnisotropy=l(A)?f.getParameter(A.MAX_TEXTURE_MAX_ANISOTROPY_EXT):1;let b,x,T,E,v,S,I,R,O,L;if(u){let P=this;b=function(){return P._gl.createVertexArray()},x=function(M){P._gl.bindVertexArray(M)},T=function(M){P._gl.deleteVertexArray(M)},E=function(M,F,V,B,j){f.drawElementsInstanced(M,F,V,B,j)},v=function(M,F,V,B){f.drawArraysInstanced(M,F,V,B)},S=function(M,F){f.vertexAttribDivisor(M,F)},I=function(M){f.drawBuffers(M)}}else R=is(f,["OES_vertex_array_object"]),l(R)&&(b=function(){return R.createVertexArrayOES()},x=function(P){R.bindVertexArrayOES(P)},T=function(P){R.deleteVertexArrayOES(P)}),O=is(f,["ANGLE_instanced_arrays"]),l(O)&&(E=function(P,M,F,V,B){O.drawElementsInstancedANGLE(P,M,F,V,B)},v=function(P,M,F,V){O.drawArraysInstancedANGLE(P,M,F,V)},S=function(P,M){O.vertexAttribDivisorANGLE(P,M)}),L=is(f,["WEBGL_draw_buffers"]),l(L)&&(I=function(P){L.drawBuffersWEBGL(P)});this.glCreateVertexArray=b,this.glBindVertexArray=x,this.glDeleteVertexArray=T,this.glDrawElementsInstanced=E,this.glDrawArraysInstanced=v,this.glVertexAttribDivisor=S,this.glDrawBuffers=I,this._vertexArrayObject=!!R,this._instancedArrays=!!O,this._drawBuffers=!!L,kt._maximumDrawBuffers=this.drawBuffers?f.getParameter(te.MAX_DRAW_BUFFERS):1,kt._maximumColorAttachments=this.drawBuffers?f.getParameter(te.MAX_COLOR_ATTACHMENTS):1,this._clearColor=new z(0,0,0,0),this._clearDepth=1,this._clearStencil=0;let _=new wO,C=new sc(this),w=Ge.fromCache();this._defaultPassState=C,this._defaultRenderState=w,this._defaultTexture=void 0,this._defaultEmissiveTexture=void 0,this._defaultNormalTexture=void 0,this._defaultCubeMap=void 0,this._us=_,this._currentRenderState=w,this._currentPassState=C,this._currentFramebuffer=void 0,this._maxFrameTextureUnitIndex=0,this._vertexAttribDivisors=[],this._previousDrawInstanced=!1;for(let P=0;P<kt._maximumVertexAttributes;P++)this._vertexAttribDivisors.push(0);this._pickObjects=new Map,this._nextPickColor=new Uint32Array(1),this.options={getWebGLStub:n,requestWebgl1:i,webgl:r,allowTextureFilterAnisotropic:o,transparentDefaultTexture:s},this.cache={},Ge.apply(f,w,C)}function M6e(e,t,n){if(typeof WebGLRenderingContext>"u")throw new oe("The browser does not support WebGL. Visit http://get.webgl.org.");!n&&!(typeof WebGL2RenderingContext<"u")&&(n=!0);let r=n?"webgl":"webgl2",o=e.getContext(r,t);if(!l(o))throw new oe("The browser supports WebGL, but initialization failed.");return o}function N6e(e,t){let n="WebGL Error: ";switch(t){case e.INVALID_ENUM:n+="INVALID_ENUM";break;case e.INVALID_VALUE:n+="INVALID_VALUE";break;case e.INVALID_OPERATION:n+="INVALID_OPERATION";break;case e.OUT_OF_MEMORY:n+="OUT_OF_MEMORY";break;case e.CONTEXT_LOST_WEBGL:n+="CONTEXT_LOST_WEBGL lost";break;default:n+=`Unknown (${t})`}return n}function L6e(e,t,n,i){let r=`${N6e(e,i)}: ${t.name}(`;for(let o=0;o<n.length;++o)o!==0&&(r+=", "),r+=n[o];return r+=");",r}function F6e(e,t,n){let i=e.getError();if(i!==e.NO_ERROR)throw new oe(L6e(e,t,n,i))}function B6e(e,t,n){return{get:function(){let i=e[t];return n(e,`get: ${t}`,i),e[t]},set:function(i){e[t]=i,n(e,`set: ${t}`,i)}}}function k6e(e,t){if(!l(t))return e;function n(r){return function(){let o=r.apply(e,arguments);return t(e,r,arguments),o}}let i={};for(let r in e){let o=e[r];o instanceof Function?i[r]=n(o):Object.defineProperty(i,r,B6e(e,r,t))}return i}function is(e,t){let n=t.length;for(let i=0;i<n;++i){let r=e.getExtension(t[i]);if(r)return r}}var U6e={};Object.defineProperties(Nu.prototype,{id:{get:function(){return this._id}},webgl2:{get:function(){return this._webgl2}},canvas:{get:function(){return this._canvas}},shaderCache:{get:function(){return this._shaderCache}},textureCache:{get:function(){return this._textureCache}},uniformState:{get:function(){return this._us}},stencilBits:{get:function(){return this._stencilBits}},stencilBuffer:{get:function(){return this._stencilBits>=8}},antialias:{get:function(){return this._antialias}},msaa:{get:function(){return this._webgl2}},standardDerivatives:{get:function(){return this._standardDerivatives||this._webgl2}},floatBlend:{get:function(){return this._floatBlend}},blendMinmax:{get:function(){return this._blendMinmax||this._webgl2}},elementIndexUint:{get:function(){return this._elementIndexUint||this._webgl2}},depthTexture:{get:function(){return this._depthTexture||this._webgl2}},floatingPointTexture:{get:function(){return this._webgl2||this._textureFloat}},halfFloatingPointTexture:{get:function(){return this._webgl2||this._textureHalfFloat}},textureFloatLinear:{get:function(){return this._textureFloatLinear}},textureHalfFloatLinear:{get:function(){return this._webgl2&&this._textureFloatLinear||!this._webgl2&&this._textureHalfFloatLinear}},supportsTextureLod:{get:function(){return this._webgl2||this._supportsTextureLod}},textureFilterAnisotropic:{get:function(){return!!this._textureFilterAnisotropic}},s3tc:{get:function(){return this._s3tc}},pvrtc:{get:function(){return this._pvrtc}},astc:{get:function(){return this._astc}},etc:{get:function(){return this._etc}},etc1:{get:function(){return this._etc1}},bc7:{get:function(){return this._bc7}},supportsBasis:{get:function(){return this._s3tc||this._pvrtc||this._astc||this._etc||this._etc1||this._bc7}},vertexArrayObject:{get:function(){return this._vertexArrayObject||this._webgl2}},fragmentDepth:{get:function(){return this._fragDepth||this._webgl2}},instancedArrays:{get:function(){return this._instancedArrays||this._webgl2}},colorBufferFloat:{get:function(){return this._colorBufferFloat}},colorBufferHalfFloat:{get:function(){return this._webgl2&&this._colorBufferFloat||!this._webgl2&&this._colorBufferHalfFloat}},drawBuffers:{get:function(){return this._drawBuffers||this._webgl2}},debugShaders:{get:function(){return this._debugShaders}},throwOnWebGLError:{get:function(){return this._throwOnWebGLError},set:function(e){this._throwOnWebGLError=e,this._gl=k6e(this._originalGLContext,e?F6e:void 0)}},defaultTexture:{get:function(){if(this._defaultTexture===void 0){let e=Dt.defaultColor;this._defaultTexture=new Dt({context:this,source:{width:1,height:1,arrayBufferView:new Uint8Array([e.red*255,e.green*255,e.blue*255,this._transparentDefaultTexture?0:e.alpha*255])},flipY:!1})}return this._defaultTexture}},defaultEmissiveTexture:{get:function(){return this._defaultEmissiveTexture===void 0&&(this._defaultEmissiveTexture=new Dt({context:this,pixelFormat:Ke.RGB,source:{width:1,height:1,arrayBufferView:new Uint8Array([0,0,0])},flipY:!1})),this._defaultEmissiveTexture}},defaultNormalTexture:{get:function(){return this._defaultNormalTexture===void 0&&(this._defaultNormalTexture=new Dt({context:this,pixelFormat:Ke.RGB,source:{width:1,height:1,arrayBufferView:new Uint8Array([128,128,255])},flipY:!1})),this._defaultNormalTexture}},defaultCubeMap:{get:function(){if(this._defaultCubeMap===void 0){let e={width:1,height:1,arrayBufferView:new Uint8Array([255,255,255,255])};this._defaultCubeMap=new ns({context:this,source:{positiveX:e,negativeX:e,positiveY:e,negativeY:e,positiveZ:e,negativeZ:e},flipY:!1})}return this._defaultCubeMap}},drawingBufferHeight:{get:function(){return this._gl.drawingBufferHeight}},drawingBufferWidth:{get:function(){return this._gl.drawingBufferWidth}},defaultFramebuffer:{get:function(){return U6e}}});function Ehe(e,t,n,i){let r=e._currentRenderState,o=e._currentPassState;e._currentRenderState=t,e._currentPassState=n,Ge.partialApply(e._gl,r,t,o,n,i)}var zX;typeof WebGLRenderingContext<"u"&&(zX=[te.BACK]);function p6(e,t){if(t!==e._currentFramebuffer){e._currentFramebuffer=t;let n=zX;if(l(t))t._bind(),n=t._getActiveColorAttachments();else{let i=e._gl;i.bindFramebuffer(i.FRAMEBUFFER,null)}e.drawBuffers&&e.glDrawBuffers(n)}}var z6e=new li;Nu.prototype.clear=function(e,t){e=e??z6e,t=t??this._defaultPassState;let n=this._gl,i=0,r=e.color,o=e.depth,s=e.stencil;l(r)&&(z.equals(this._clearColor,r)||(z.clone(r,this._clearColor),n.clearColor(r.red,r.green,r.blue,r.alpha)),i|=n.COLOR_BUFFER_BIT),l(o)&&(o!==this._clearDepth&&(this._clearDepth=o,n.clearDepth(o)),i|=n.DEPTH_BUFFER_BIT),l(s)&&(s!==this._clearStencil&&(this._clearStencil=s,n.clearStencil(s)),i|=n.STENCIL_BUFFER_BIT);let a=e.renderState??this._defaultRenderState;Ehe(this,a,t,!0);let c=e.framebuffer??t.framebuffer;p6(this,c),n.clear(i)};function V6e(e,t,n,i,r){p6(e,t),Ehe(e,r,n,!1),i._bind(),e._maxFrameTextureUnitIndex=Math.max(e._maxFrameTextureUnitIndex,i.maximumTextureUnitIndex)}function j6e(e,t,n,i){let r=t._primitiveType,o=t._vertexArray,s=t._offset,a=t._count,c=t.instanceCount;e._us.model=t._modelMatrix??N.IDENTITY,n._setUniforms(i,e._us,e.validateShaderProgram),o._bind();let u=o.indexBuffer;l(u)?(s=s*u.bytesPerIndex,l(a)?a=Math.min(a,u.numberOfIndices):a=u.numberOfIndices,c===0?e._gl.drawElements(r,a,u.indexDatatype,s):e.glDrawElementsInstanced(r,a,u.indexDatatype,s,c)):(l(a)?a=Math.min(a,o.numberOfVertices):a=o.numberOfVertices,c===0?e._gl.drawArrays(r,s,a):e.glDrawArraysInstanced(r,s,a,c)),o._unBind()}Nu.prototype.draw=function(e,t,n,i){t=t??this._defaultPassState;let r=e._framebuffer??t.framebuffer,o=e._renderState??this._defaultRenderState;n=n??e._shaderProgram,i=i??e._uniformMap,V6e(this,r,t,n,o),j6e(this,e,n,i)};Nu.prototype.beginFrame=function(){};Nu.prototype.endFrame=function(){let e=this._gl;e.useProgram(null),this._currentFramebuffer=void 0,e.bindFramebuffer(e.FRAMEBUFFER,null);let t=zX;this.drawBuffers&&this.glDrawBuffers(t);let n=this._maxFrameTextureUnitIndex;this._maxFrameTextureUnitIndex=0;for(let i=0;i<n;++i)e.activeTexture(e.TEXTURE0+i),e.bindTexture(e.TEXTURE_2D,null),e.bindTexture(e.TEXTURE_CUBE_MAP,null)};Nu.prototype.readPixelsToPBO=function(e){let t=this._gl;e=e??H.EMPTY_OBJECT;let n=Math.max(e.x??0,0),i=Math.max(e.y??0,0),r=e.width??this.drawingBufferWidth,o=e.height??this.drawingBufferHeight,s=e.framebuffer;if(!this._webgl2)throw new pe("A WebGL 2 context is required to read pixels using a PBO.");let a=ze.UNSIGNED_BYTE,c=Ke.RGBA;l(s)&&s.numberOfColorAttachments>0&&(a=s.getColorTexture(0).pixelDatatype,c=s.getColorTexture(0).pixelFormat);let u=tt.createPixelBuffer({context:this,sizeInBytes:Ke.textureSizeInBytes(c,a,r,o),usage:Me.DYNAMIC_READ});return p6(this,s),u._bind(),t.readPixels(n,i,r,o,c,ze.toWebGLConstant(a,this),0),u._unBind(),u};Nu.prototype.readPixels=function(e){let t=this._gl;e=e??H.EMPTY_OBJECT;let n=Math.max(e.x??0,0),i=Math.max(e.y??0,0),r=e.width??this.drawingBufferWidth,o=e.height??this.drawingBufferHeight,s=e.framebuffer,a=ze.UNSIGNED_BYTE,c=Ke.RGBA;l(s)&&s.numberOfColorAttachments>0&&(a=s.getColorTexture(0).pixelDatatype,c=s.getColorTexture(0).pixelFormat);let u=Ke.createTypedArray(c,a,r,o);return p6(this,s),t.readPixels(n,i,r,o,Ke.RGBA,ze.toWebGLConstant(a,this),u),u};var Che={position:0,textureCoordinates:1};Nu.prototype.getViewportQuadVertexArray=function(){let e=this.cache.viewportQuad_vertexArray;if(!l(e)){let t=new St({attributes:{position:new Ne({componentDatatype:Y.FLOAT,componentsPerAttribute:2,values:[-1,-1,1,-1,1,1,-1,1]}),textureCoordinates:new Ne({componentDatatype:Y.FLOAT,componentsPerAttribute:2,values:[0,0,1,0,1,1,0,1]})},indices:new Uint16Array([0,1,2,0,2,3]),primitiveType:Oe.TRIANGLES});e=zn.fromGeometry({context:this,geometry:t,attributeLocations:Che,bufferUsage:Me.STATIC_DRAW,interleave:!0}),this.cache.viewportQuad_vertexArray=e}return e};Nu.prototype.createViewportQuadCommand=function(e,t){return t=t??H.EMPTY_OBJECT,new at({vertexArray:this.getViewportQuadVertexArray(),primitiveType:Oe.TRIANGLES,renderState:t.renderState,shaderProgram:Qt.fromCache({context:this,vertexShaderSource:ux,fragmentShaderSource:e,attributeLocations:Che}),uniformMap:t.uniformMap,owner:t.owner,framebuffer:t.framebuffer,pass:t.pass})};Nu.prototype.getObjectByPickColor=function(e){return this._pickObjects.get(e)};Nu.prototype.createPickId=function(e){++this._nextPickColor[0];let t=this._nextPickColor[0];if(t===0)throw new oe("Out of unique Pick IDs.");return this._pickObjects.set(t,e),new zD(this._pickObjects,t,z.fromRgba(t))};Nu.prototype.isDestroyed=function(){return!1};Nu.prototype.destroy=function(){let e=this.cache;for(let t in e)if(e.hasOwnProperty(t)){let n=e[t];l(n.destroy)&&n.destroy()}return this._shaderCache=this._shaderCache.destroy(),this._textureCache=this._textureCache.destroy(),this._defaultTexture=this._defaultTexture&&this._defaultTexture.destroy(),this._defaultEmissiveTexture=this._defaultEmissiveTexture&&this._defaultEmissiveTexture.destroy(),this._defaultNormalTexture=this._defaultNormalTexture&&this._defaultNormalTexture.destroy(),this._defaultCubeMap=this._defaultCubeMap&&this._defaultCubeMap.destroy(),le(this)};var xx=Nu;function Cv(e){e=e??H.EMPTY_OBJECT;let{context:t,width:n,height:i,colorRenderbuffers:r,colorTextures:o,depthStencilRenderbuffer:s,depthStencilTexture:a,destroyAttachments:c}=e;if(this._width=n,this._height=i,l(r)!==l(o))throw new pe("Both color renderbuffer and texture attachments must be provided.");if(l(s)!==l(a))throw new pe("Both depth-stencil renderbuffer and texture attachments must be provided.");this._renderFramebuffer=new _s({context:t,colorRenderbuffers:r,depthStencilRenderbuffer:s,destroyAttachments:c}),this._colorFramebuffer=new _s({context:t,colorTextures:o,depthStencilTexture:a,destroyAttachments:c})}Cv.prototype.getRenderFramebuffer=function(){return this._renderFramebuffer};Cv.prototype.getColorFramebuffer=function(){return this._colorFramebuffer};Cv.prototype.blitFramebuffers=function(e,t){this._renderFramebuffer.bindRead(),this._colorFramebuffer.bindDraw();let n=e._gl,i=0;this._colorFramebuffer._colorTextures.length>0&&(i|=n.COLOR_BUFFER_BIT),l(this._colorFramebuffer.depthStencilTexture)&&(i|=n.DEPTH_BUFFER_BIT|(t?n.STENCIL_BUFFER_BIT:0)),n.blitFramebuffer(0,0,this._width,this._height,0,0,this._width,this._height,i,n.NEAREST),n.bindFramebuffer(n.READ_FRAMEBUFFER,null),n.bindFramebuffer(n.DRAW_FRAMEBUFFER,null)};Cv.prototype.isDestroyed=function(){return!1};Cv.prototype.destroy=function(){return this._renderFramebuffer.destroy(),this._colorFramebuffer.destroy(),le(this)};var IO=Cv;var Vl={RGBA4:te.RGBA4,RGBA8:te.RGBA8,RGBA16F:te.RGBA16F,RGBA32F:te.RGBA32F,RGB5_A1:te.RGB5_A1,RGB565:te.RGB565,DEPTH_COMPONENT16:te.DEPTH_COMPONENT16,STENCIL_INDEX8:te.STENCIL_INDEX8,DEPTH_STENCIL:te.DEPTH_STENCIL,DEPTH24_STENCIL8:te.DEPTH24_STENCIL8,validate:function(e){return e===Vl.RGBA4||e===Vl.RGBA8||e===Vl.RGBA16F||e===Vl.RGBA32F||e===Vl.RGB5_A1||e===Vl.RGB565||e===Vl.DEPTH_COMPONENT16||e===Vl.STENCIL_INDEX8||e===Vl.DEPTH_STENCIL||e===Vl.DEPTH24_STENCIL8},getColorFormat:function(e){return e===te.FLOAT?Vl.RGBA32F:e===te.HALF_FLOAT_OES?Vl.RGBA16F:Vl.RGBA8}};Object.freeze(Vl);var jl=Vl;function PO(e){e=e??H.EMPTY_OBJECT;let t=e.context,n=t._gl,i=kt.maximumRenderbufferSize,r=e.format??jl.RGBA4,o=l(e.width)?e.width:t.drawingBufferWidth,s=l(e.height)?e.height:t.drawingBufferHeight,a=e.numSamples??1;this._gl=n,this._format=r,this._width=o,this._height=s,this._renderbuffer=this._gl.createRenderbuffer(),n.bindRenderbuffer(n.RENDERBUFFER,this._renderbuffer),a>1?n.renderbufferStorageMultisample(n.RENDERBUFFER,a,r,o,s):n.renderbufferStorage(n.RENDERBUFFER,r,o,s),n.bindRenderbuffer(n.RENDERBUFFER,null)}Object.defineProperties(PO.prototype,{format:{get:function(){return this._format}},width:{get:function(){return this._width}},height:{get:function(){return this._height}}});PO.prototype._getRenderbuffer=function(){return this._renderbuffer};PO.prototype.isDestroyed=function(){return!1};PO.prototype.destroy=function(){return this._gl.deleteRenderbuffer(this._renderbuffer),le(this)};var Sf=PO;function pa(e){e=e??H.EMPTY_OBJECT,this._numSamples=e.numSamples??1,this._colorAttachmentsLength=e.colorAttachmentsLength??1,this._color=e.color??!0,this._depth=e.depth??!1,this._depthStencil=e.depthStencil??!1,this._supportsDepthTexture=e.supportsDepthTexture??!1,this._createColorAttachments=e.createColorAttachments??!0,this._createDepthAttachments=e.createDepthAttachments??!0,this._pixelDatatype=e.pixelDatatype,this._pixelFormat=e.pixelFormat,this._width=void 0,this._height=void 0,this._framebuffer=void 0,this._multisampleFramebuffer=void 0,this._colorTextures=void 0,this._color&&(this._colorTextures=new Array(this._colorAttachmentsLength),this._colorRenderbuffers=new Array(this._colorAttachmentsLength)),this._colorRenderbuffer=void 0,this._depthStencilRenderbuffer=void 0,this._depthStencilTexture=void 0,this._depthRenderbuffer=void 0,this._depthTexture=void 0,this._attachmentsDirty=!1}Object.defineProperties(pa.prototype,{framebuffer:{get:function(){return this._numSamples>1?this._multisampleFramebuffer.getRenderFramebuffer():this._framebuffer}},numSamples:{get:function(){return this._numSamples}},status:{get:function(){return this.framebuffer.status}}});pa.prototype.isDirty=function(e,t,n,i,r){n=n??1;let o=this._width!==e||this._height!==t,s=this._numSamples!==n,a=l(i)&&this._pixelDatatype!==i||l(r)&&this._pixelFormat!==r,c=n===1?l(this._framebuffer):l(this._multisampleFramebuffer);return this._attachmentsDirty||o||s||a||!c||this._color&&!l(this._colorTextures[0])};pa.prototype.update=function(e,t,n,i,r,o){if(i=e.msaa?i??1:1,r=r??(this._color?this._pixelDatatype??ze.UNSIGNED_BYTE:void 0),o=o??(this._color?this._pixelFormat??Ke.RGBA:void 0),this.isDirty(t,n,i,r,o)){if(this.destroy(),this._width=t,this._height=n,this._numSamples=i,this._pixelDatatype=r,this._pixelFormat=o,this._attachmentsDirty=!1,this._color&&this._createColorAttachments){for(let s=0;s<this._colorAttachmentsLength;++s)if(this._colorTextures[s]=new Dt({context:e,width:t,height:n,pixelFormat:o,pixelDatatype:r,sampler:jt.NEAREST}),this._numSamples>1){let a=jl.getColorFormat(r);this._colorRenderbuffers[s]=new Sf({context:e,width:t,height:n,format:a,numSamples:this._numSamples})}}this._depthStencil&&this._createDepthAttachments&&(this._supportsDepthTexture&&e.depthTexture?(this._depthStencilTexture=new Dt({context:e,width:t,height:n,pixelFormat:Ke.DEPTH_STENCIL,pixelDatatype:ze.UNSIGNED_INT_24_8,sampler:jt.NEAREST}),this._numSamples>1&&(this._depthStencilRenderbuffer=new Sf({context:e,width:t,height:n,format:jl.DEPTH24_STENCIL8,numSamples:this._numSamples}))):this._depthStencilRenderbuffer=new Sf({context:e,width:t,height:n,format:jl.DEPTH_STENCIL})),this._depth&&this._createDepthAttachments&&(this._supportsDepthTexture&&e.depthTexture?this._depthTexture=new Dt({context:e,width:t,height:n,pixelFormat:Ke.DEPTH_COMPONENT,pixelDatatype:ze.UNSIGNED_INT,sampler:jt.NEAREST}):this._depthRenderbuffer=new Sf({context:e,width:t,height:n,format:jl.DEPTH_COMPONENT16})),this._numSamples>1?this._multisampleFramebuffer=new IO({context:e,width:this._width,height:this._height,colorTextures:this._colorTextures,colorRenderbuffers:this._colorRenderbuffers,depthStencilTexture:this._depthStencilTexture,depthStencilRenderbuffer:this._depthStencilRenderbuffer,destroyAttachments:!1}):this._framebuffer=new _s({context:e,colorTextures:this._colorTextures,depthTexture:this._depthTexture,depthRenderbuffer:this._depthRenderbuffer,depthStencilTexture:this._depthStencilTexture,depthStencilRenderbuffer:this._depthStencilRenderbuffer,destroyAttachments:!1})}};pa.prototype.getColorTexture=function(e){return e=e??0,this._colorTextures[e]};pa.prototype.setColorTexture=function(e,t){t=t??0,this._attachmentsDirty=e!==this._colorTextures[t],this._colorTextures[t]=e};pa.prototype.getColorRenderbuffer=function(e){return e=e??0,this._colorRenderbuffers[e]};pa.prototype.setColorRenderbuffer=function(e,t){t=t??0,this._attachmentsDirty=e!==this._colorRenderbuffers[t],this._colorRenderbuffers[t]=e};pa.prototype.getDepthRenderbuffer=function(){return this._depthRenderbuffer};pa.prototype.setDepthRenderbuffer=function(e){this._attachmentsDirty=e!==this._depthRenderbuffer,this._depthRenderbuffer=e};pa.prototype.getDepthTexture=function(){return this._depthTexture};pa.prototype.setDepthTexture=function(e){this._attachmentsDirty=e!==this._depthTexture,this._depthTexture=e};pa.prototype.getDepthStencilRenderbuffer=function(){return this._depthStencilRenderbuffer};pa.prototype.setDepthStencilRenderbuffer=function(e){this._attachmentsDirty=e!==this._depthStencilRenderbuffer,this._depthStencilRenderbuffer=e};pa.prototype.getDepthStencilTexture=function(){return this._depthStencilTexture};pa.prototype.setDepthStencilTexture=function(e){this._attachmentsDirty=e!==this._depthStencilTexture,this._depthStencilTexture=e};pa.prototype.prepareTextures=function(e,t){this._numSamples>1&&this._multisampleFramebuffer.blitFramebuffers(e,t)};pa.prototype.clear=function(e,t,n){let i=t.framebuffer;t.framebuffer=this.framebuffer,t.execute(e,n),t.framebuffer=i};pa.prototype.destroyFramebuffer=function(){this._framebuffer=this._framebuffer&&this._framebuffer.destroy(),this._multisampleFramebuffer=this._multisampleFramebuffer&&this._multisampleFramebuffer.destroy()};pa.prototype.destroy=function(){if(this._color){let e=this._colorTextures,t=this._colorRenderbuffers;for(let n=0;n<e.length;++n){let i=e[n];this._createColorAttachments&&l(i)&&!i.isDestroyed()&&i.destroy(),l(i)&&i.isDestroyed()&&(e[n]=void 0);let r=t[n];this._createColorAttachments&&l(r)&&!r.isDestroyed()&&r.destroy(),l(r)&&r.isDestroyed()&&(t[n]=void 0)}}this._depthStencil&&(this._createDepthAttachments&&(this._depthStencilTexture=this._depthStencilTexture&&this._depthStencilTexture.destroy(),this._depthStencilRenderbuffer=this._depthStencilRenderbuffer&&this._depthStencilRenderbuffer.destroy()),l(this._depthStencilTexture)&&this._depthStencilTexture.isDestroyed()&&(this._depthStencilTexture=void 0),l(this._depthStencilRenderbuffer)&&this._depthStencilRenderbuffer.isDestroyed()&&(this._depthStencilRenderbuffer=void 0)),this._depth&&(this._createDepthAttachments&&(this._depthTexture=this._depthTexture&&this._depthTexture.destroy(),this._depthRenderbuffer=this._depthRenderbuffer&&this._depthRenderbuffer.destroy()),l(this._depthTexture)&&this._depthTexture.isDestroyed()&&(this._depthTexture=void 0),l(this._depthRenderbuffer)&&this._depthRenderbuffer.isDestroyed()&&(this._depthRenderbuffer=void 0)),this.destroyFramebuffer()};var ai=pa;function H6e(e,t,n){let i={flipY:!0,skipColorSpaceConversion:n,preferImageBitmap:!0},r=[De.createIfNeeded(t.positiveX).fetchImage(i),De.createIfNeeded(t.negativeX).fetchImage(i),De.createIfNeeded(t.positiveY).fetchImage(i),De.createIfNeeded(t.negativeY).fetchImage(i),De.createIfNeeded(t.positiveZ).fetchImage(i),De.createIfNeeded(t.negativeZ).fetchImage(i)];return Promise.all(r).then(function(o){return new ns({context:e,source:{positiveX:o[0],negativeX:o[1],positiveY:o[2],negativeY:o[3],positiveZ:o[4],negativeZ:o[5]}})})}var DO=H6e;var Uy={NONE:0,VERTEX:1,FRAGMENT:2,BOTH:3};Uy.includesVertexShader=function(e){return(e&Uy.VERTEX)!==0};Uy.includesFragmentShader=function(e){return(e&Uy.FRAGMENT)!==0};Uy.union=function(...e){let t=0;for(let n=0;n<e.length;n++)t|=e[n];return t};Uy.intersection=function(...e){let t=e[0];for(let n=1;n<e.length;n++)t&=e[n];return t};Object.freeze(Uy);var de=Uy;function VX(e){this.name=e,this.fields=[]}VX.prototype.addField=function(e,t){let n=` ${e} ${t};`;this.fields.push(n)};VX.prototype.generateGlslLines=function(){let e=this.fields;return e.length===0&&(e=[" float _empty;"]),[].concat(`struct ${this.name}`,"{",e,"};")};var RO=VX;function jX(e){this.signature=e,this.body=[]}jX.prototype.addLines=function(e){let t=this.body;if(Array.isArray(e)){let n=e.length;for(let i=0;i<n;i++)t.push(` ${e[i]}`)}else t.push(` ${e}`)};jX.prototype.generateGlslLines=function(){return[].concat(this.signature,"{",this.body,"}")};var OO=jX;function G6e(e,t){if(!l(t))return;let n=t.length;if(n===0)return;let i=e.length;e.length+=n;for(let r=0;r<n;r++)e[i+r]=t[r]}var Zn=G6e;function Hl(){this._positionAttributeLine=void 0,this._nextAttributeLocation=1,this._attributeLocations={},this._attributeLines=[],this._structs={},this._functions={},this._vertexShaderParts={defineLines:[],uniformLines:[],shaderLines:[],varyingLines:[],structIds:[],functionIds:[]},this._fragmentShaderParts={defineLines:[],uniformLines:[],shaderLines:[],varyingLines:[],structIds:[],functionIds:[]}}Object.defineProperties(Hl.prototype,{attributeLocations:{get:function(){return this._attributeLocations}}});Hl.prototype.addDefine=function(e,t,n){n=n??de.BOTH;let i=e;l(t)&&(i+=` ${t.toString()}`),de.includesVertexShader(n)&&this._vertexShaderParts.defineLines.push(i),de.includesFragmentShader(n)&&this._fragmentShaderParts.defineLines.push(i)};Hl.prototype.addStruct=function(e,t,n){this._structs[e]=new RO(t),de.includesVertexShader(n)&&this._vertexShaderParts.structIds.push(e),de.includesFragmentShader(n)&&this._fragmentShaderParts.structIds.push(e)};Hl.prototype.addStructField=function(e,t,n){this._structs[e].addField(t,n)};Hl.prototype.addFunction=function(e,t,n){this._functions[e]=new OO(t),de.includesVertexShader(n)&&this._vertexShaderParts.functionIds.push(e),de.includesFragmentShader(n)&&this._fragmentShaderParts.functionIds.push(e)};Hl.prototype.addFunctionLines=function(e,t){this._functions[e].addLines(t)};Hl.prototype.addUniform=function(e,t,n){n=n??de.BOTH;let i=`uniform ${e} ${t};`;de.includesVertexShader(n)&&this._vertexShaderParts.uniformLines.push(i),de.includesFragmentShader(n)&&this._fragmentShaderParts.uniformLines.push(i)};Hl.prototype.setPositionAttribute=function(e,t){return this._positionAttributeLine=`in ${e} ${t};`,this._attributeLocations[t]=0,0};Hl.prototype.addAttribute=function(e,t){let n=`in ${e} ${t};`;this._attributeLines.push(n);let i=this._nextAttributeLocation;return this._attributeLocations[t]=i,this._nextAttributeLocation+=q6e(e),i};Hl.prototype.addVarying=function(e,t,n){n=l(n)?`${n} `:"";let i=`${e} ${t};`;this._vertexShaderParts.varyingLines.push(`${n}out ${i}`),this._fragmentShaderParts.varyingLines.push(`${n}in ${i}`)};Hl.prototype.addVertexLines=function(e){let t=this._vertexShaderParts.shaderLines;Array.isArray(e)?Zn(t,e):t.push(e)};Hl.prototype.addFragmentLines=function(e){let t=this._fragmentShaderParts.shaderLines;Array.isArray(e)?Zn(t,e):t.push(e)};Hl.prototype.buildShaderProgram=function(e){let t=l(this._positionAttributeLine)?[this._positionAttributeLine]:[],n=W6e(this),i=Y6e(this),r=t.concat(this._attributeLines,this._vertexShaderParts.uniformLines,this._vertexShaderParts.varyingLines,n.vertexLines,i.vertexLines,this._vertexShaderParts.shaderLines).join(` `),o=new Ye({defines:this._vertexShaderParts.defineLines,sources:[r]}),s=this._fragmentShaderParts.uniformLines.concat(this._fragmentShaderParts.varyingLines,n.fragmentLines,i.fragmentLines,this._fragmentShaderParts.shaderLines).join(` -`),a=new Ye({defines:this._fragmentShaderParts.defineLines,sources:[s]});return Qt.fromCache({context:e,vertexShaderSource:o,fragmentShaderSource:a,attributeLocations:this._attributeLocations})};Hl.prototype.clone=function(){return Je(this,!0)};function G6e(e){let t=[],n=[],i,r=e._vertexShaderParts.structIds,o,s,a;for(i=0;i<r.length;i++)o=r[i],s=e._structs[o],a=s.generateGlslLines(),Zn(t,a);for(r=e._fragmentShaderParts.structIds,i=0;i<r.length;i++)o=r[i],s=e._structs[o],a=s.generateGlslLines(),Zn(n,a);return{vertexLines:t,fragmentLines:n}}function W6e(e){switch(e){case"mat2":return 2;case"mat3":return 3;case"mat4":return 4;default:return 1}}function q6e(e){let t=[],n=[],i,r=e._vertexShaderParts.functionIds,o,s,a;for(i=0;i<r.length;i++)o=r[i],s=e._functions[o],a=s.generateGlslLines(),Zn(t,a);for(r=e._fragmentShaderParts.functionIds,i=0;i<r.length;i++)o=r[i],s=e._functions[o],a=s.generateGlslLines(),Zn(n,a);return{vertexLines:t,fragmentLines:n}}var hg=Hl;function g6(e){this._autoDestroy=e?.autoDestroy??!0,this._canvas=document.createElement("canvas"),this._context=new xx(this._canvas,Je(e?.contextOptions)),this._canvases=[]}g6.prototype.createSceneContext=function(e){let t=e.getContext("2d",{alpha:!0}),n=this;n._canvases.push(e);let i=!1,r=function(){i=!0;let c=n._canvases.indexOf(e);c!==-1&&(n._canvases.splice(c,1),n._autoDestroy&&n._canvases.length===0&&n.destroy())},o=function(){let c=n._context.canvas,u=this.drawingBufferWidth;c.width<u&&(c.width=u);let f=this.drawingBufferHeight;c.height<f&&(c.height=f)},s=function(){let c=this.drawingBufferWidth,u=this.drawingBufferHeight,f=n._context.canvas.height-u;t.drawImage(n._context.canvas,0,f,c,u,0,0,c,u),n._context.endFrame()};return new Proxy(this._context,{get(c,u,f){if(u==="isDestroyed")return function(){return i};switch(u){case"_canvas":return e;case"destroy":return r;case"drawingBufferWidth":return e.width;case"drawingBufferHeight":return e.height;case"beginFrame":return o;case"endFrame":return s;default:return Reflect.get(c,u,f)}}})};g6.prototype.destroy=function(){this._context.destroy(),le(this)};g6.prototype.isDestroyed=function(){return!1};var MO=g6;function Tx(e){e=e??H.EMPTY_OBJECT;let t=e.context;if(!t._webgl2)throw new pe("A WebGL 2 context is required to use Sync operations.");let n=t._gl,i=n.fenceSync(te.SYNC_GPU_COMMANDS_COMPLETE,0);this._gl=n,this._sync=i}Tx.create=function(e){return new Tx(e)};Tx.prototype.getStatus=function(){return this._gl.getSyncParameter(this._sync,te.SYNC_STATUS)};Tx.prototype.isDestroyed=function(){return!1};Tx.prototype.destroy=function(){return this._gl.deleteSync(this._sync),le(this)};Tx.prototype.waitForSignal=async function(e,t){let n=this;t=t??10;function i(r,o,s){return()=>{n.getStatus()===te.SIGNALED?r():s<=0?o(new oe("Wait for signal timeout")):e(i(r,o,s-1))}}return new Promise((r,o)=>{e(i(r,o,t))})};var NO=Tx;function zy(e){e=e??H.EMPTY_OBJECT;let{context:t,source:n,pixelFormat:i=Ke.RGBA,pixelDatatype:r=ze.UNSIGNED_BYTE,flipY:o=!0,skipColorSpaceConversion:s=!1,sampler:a=new jt}=e;if(!t.webgl2&&!l(t.options.getWebGLStub))throw new pe("WebGL1 does not support texture3D. Please use a WebGL2 context.");let{width:c,height:u,depth:f}=e;l(n)&&(l(c)||(c=n.width),l(u)||(u=n.height),l(f)||(f=n.depth));let d=e.preMultiplyAlpha||i===Ke.RGB||i===Ke.LUMINANCE,p=Ke.toInternalFormat(i,r,t),g=Ke.isCompressedFormat(p),m=t._gl,y=Ke.texture3DSizeInBytes(i,r,c,u,f);if(this._id=e.id??Kn(),this._context=t,this._textureFilterAnisotropic=t._textureFilterAnisotropic,this._textureTarget=m.TEXTURE_3D,this._texture=m.createTexture(),this._internalFormat=p,this._pixelFormat=i,this._pixelDatatype=r,this._width=c,this._height=u,this._depth=f,this._dimensions=new h(c,u,f),this._hasMipmap=!1,this._sizeInBytes=y,this._preMultiplyAlpha=d,this._flipY=o,this._initialized=!1,this._sampler=void 0,this._sampler=a,whe(this,a),m.activeTexture(m.TEXTURE0),m.bindTexture(this._textureTarget,this._texture),l(n)){if(s?m.pixelStorei(m.UNPACK_COLORSPACE_CONVERSION_WEBGL,m.NONE):m.pixelStorei(m.UNPACK_COLORSPACE_CONVERSION_WEBGL,m.BROWSER_DEFAULT_WEBGL),!l(n.arrayBufferView))throw new pe("For Texture3D, options.source.arrayBufferView must be defined");vhe(this,n),this._initialized=!0}else She(this);m.bindTexture(this._textureTarget,null)}function vhe(e,t){let n=e._context,i=n._gl,r=e._textureTarget,o=e._internalFormat,{width:s,height:a,depth:c,pixelFormat:u,pixelDatatype:f,flipY:d}=e,p=Ke.alignmentInBytes(u,f,s);i.pixelStorei(i.UNPACK_ALIGNMENT,p),i.pixelStorei(i.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!1),i.pixelStorei(i.UNPACK_FLIP_Y_WEBGL,!1);let{arrayBufferView:g}=t;d&&console.warn("texture3D.flipY is not supported.");let m=1;if(t.mipLevels&&t.mipLevels.length&&(m=t.mipLevels.length+1),i.texStorage3D(r,m,o,s,a,c),i.texSubImage3D(r,0,0,0,0,s,a,c,u,ze.toWebGLConstant(f,n),g),m>1){let y=s,A=a,b=c;for(let x=0;x<t.mipLevels.length;++x)y=HX(y),A=HX(A),b=HX(b),i.texSubImage3D(r,x+1,0,0,0,y,A,b,u,ze.toWebGLConstant(f,n),t.mipLevels[x])}}zy.prototype.copyFrom=function(e){e=e??H.EMPTY_OBJECT;let{source:t,xOffset:n=0,yOffset:i=0,zOffset:r=0}=e,s=this._context._gl,a=this._textureTarget;s.activeTexture(s.TEXTURE0),s.bindTexture(a,this._texture);let{width:c,height:u,depth:f}=t,d=!1;this._initialized||(n===0&&i===0&&r===0&&c===this._width&&u===this._height&&f===this._depth?(vhe(this,t),d=!0):(s.pixelStorei(s.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!1),s.pixelStorei(s.UNPACK_FLIP_Y_WEBGL,!1),She(this)),this._initialized=!0),d||Y6e(this,t.arrayBufferView,n,i,r,c,u,f),s.bindTexture(a,null)};function Y6e(e,t,n,i,r,o,s,a){let c=e._context,u=c._gl,{pixelFormat:f,pixelDatatype:d}=e,p=Ke.alignmentInBytes(f,d,o);u.pixelStorei(u.UNPACK_ALIGNMENT,p),u.pixelStorei(u.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!1),u.pixelStorei(u.UNPACK_FLIP_Y_WEBGL,!1),u.texSubImage3D(e._textureTarget,0,n,i,r,o,s,a,f,ze.toWebGLConstant(d,c),t)}function HX(e){let t=Math.floor(e/2)|0;return Math.max(t,1)}function She(e){let t=e._context;t._gl.texImage3D(e._textureTarget,0,e._internalFormat,e._width,e._height,e._depth,0,e._pixelFormat,ze.toWebGLConstant(e._pixelDatatype,t),null)}zy.create=function(e){return new zy(e)};Object.defineProperties(zy.prototype,{id:{get:function(){return this._id}},sampler:{get:function(){return this._sampler},set:function(e){whe(this,e),this._sampler=e}},pixelFormat:{get:function(){return this._pixelFormat}},pixelDatatype:{get:function(){return this._pixelDatatype}},dimensions:{get:function(){return this._dimensions}},preMultiplyAlpha:{get:function(){return this._preMultiplyAlpha}},flipY:{get:function(){return this._flipY}},width:{get:function(){return this._width}},height:{get:function(){return this._height}},depth:{get:function(){return this._depth}},sizeInBytes:{get:function(){return this._hasMipmap?Math.floor(this._sizeInBytes*8/7):this._sizeInBytes}},_target:{get:function(){return this._textureTarget}}});function whe(e,t){let{minificationFilter:n,magnificationFilter:i}=t,r=[Wt.NEAREST_MIPMAP_NEAREST,Wt.NEAREST_MIPMAP_LINEAR,Wt.LINEAR_MIPMAP_NEAREST,Wt.LINEAR_MIPMAP_LINEAR].includes(n),o=e._context,s=e._pixelFormat,a=e._pixelDatatype;(a===ze.FLOAT&&!o.textureFloatLinear||a===ze.HALF_FLOAT&&!o.textureHalfFloatLinear)&&(n=r?Wt.NEAREST_MIPMAP_NEAREST:Wt.NEAREST,i=Jn.NEAREST),Ke.isDepthFormat(s)&&(n=Wt.NEAREST,i=Jn.NEAREST);let c=o._gl,u=e._textureTarget;c.activeTexture(c.TEXTURE0),c.bindTexture(u,e._texture),c.texParameteri(u,c.TEXTURE_MIN_FILTER,n),c.texParameteri(u,c.TEXTURE_MAG_FILTER,i),c.texParameteri(u,c.TEXTURE_WRAP_R,t.wrapR),c.texParameteri(u,c.TEXTURE_WRAP_S,t.wrapS),c.texParameteri(u,c.TEXTURE_WRAP_T,t.wrapT),l(e._textureFilterAnisotropic)&&c.texParameteri(u,e._textureFilterAnisotropic.TEXTURE_MAX_ANISOTROPY_EXT,t.maximumAnisotropy),c.bindTexture(u,null)}zy.prototype.generateMipmap=function(e){e=e??Pd.DONT_CARE,this._hasMipmap=!0;let t=this._context._gl,n=this._textureTarget;t.hint(t.GENERATE_MIPMAP_HINT,e),t.activeTexture(t.TEXTURE0),t.bindTexture(n,this._texture),t.generateMipmap(n),t.bindTexture(n,null)};zy.prototype.isDestroyed=function(){return!1};zy.prototype.destroy=function(){return this._context._gl.deleteTexture(this._texture),le(this)};var LO=zy;function FO({x:e,y:t,width:n,height:i}){this.rectangle=new et(e,t,n,i),this.childNode1=void 0,this.childNode2=void 0,this.index=void 0}function GX({width:e,height:t,borderPadding:n}){this._width=e,this._height=t,this._borderPadding=n,this._root=new FO({x:n,y:n,width:e-2*n,height:t-2*n})}GX.prototype.pack=function(e,{width:t,height:n}){let i=this._findNode(this._root,{width:t,height:n});if(l(i))return i.index=e,i};GX.prototype._findNode=function(e,{width:t,height:n}){if(l(e)){if(!l(e.childNode1)&&!l(e.childNode2)){if(l(e.index))return;let{rectangle:i}=e,r=i.width,o=i.height,s=r-t,a=o-n;if(s<0||a<0)return;if(s===0&&a===0)return e;let c=this._borderPadding;if(s>a){e.childNode1=new FO({x:i.x,y:i.y,width:t,height:o});let f=s-c;return f>0&&(e.childNode2=new FO({x:i.x+t+c,y:i.y,width:f,height:o})),this._findNode(e.childNode1,{width:t,height:n})}e.childNode1=new FO({x:i.x,y:i.y,width:r,height:n});let u=a-c;return u>0&&(e.childNode2=new FO({x:i.x,y:i.y+n+c,width:r,height:u})),this._findNode(e.childNode1,{width:t,height:n})}return this._findNode(e.childNode1,{width:t,height:n})||this._findNode(e.childNode2,{width:t,height:n})}};var vv=GX;var Ihe=16;function Gl(e){e=e??H.EMPTY_OBJECT;let t=e.borderWidthInPixels??1,n=e.initialSize??new U(Ihe,Ihe);this._pixelFormat=e.pixelFormat??Ke.RGBA,this._sampler=e.sampler,this._borderWidthInPixels=t,this._initialSize=n,this._texturePacker=void 0,this._rectangles=[],this._subRegions=new Map,this._guid=Kn(),this._imagesToAddQueue=[],this._indexById=new Map,this._indexPromiseById=new Map,this._nextIndex=0}Object.defineProperties(Gl.prototype,{borderWidthInPixels:{get:function(){return this._borderWidthInPixels}},rectangles:{get:function(){return this._rectangles}},texture:{get:function(){return this._texture}},pixelFormat:{get:function(){return this._pixelFormat}},sampler:{get:function(){return this._sampler}},numberOfImages:{get:function(){return this._nextIndex}},guid:{get:function(){return this._guid}},sizeInBytes:{get:function(){return l(this._texture)?this._texture.sizeInBytes:0}}});Gl.prototype.computeTextureCoordinates=function(e,t){let n=this._texture,i=this._rectangles[e];if(l(t)||(t=new et),!l(i))return t.x=0,t.y=0,t.width=0,t.height=0,t;let r=n.width,o=n.height,s=i.width,a=i.height,c=i.x,u=i.y,f=this._subRegions.get(e);if(l(f)){let d=this._rectangles[f];c+=d.x,u+=d.y}return t.x=c/r,t.y=u/o,t.width=s/r,t.height=a/o,t};Gl.prototype._copyFromTexture=function(e,t,n,i){let r=this._pixelFormat,o=this._sampler,s=new Dt({context:e,height:n,width:t,pixelFormat:r,sampler:o}),a=e._gl,c=s._textureTarget,u=this._texture,f=new _s({context:e,colorTextures:[u],destroyAttachments:!1});a.activeTexture(a.TEXTURE0),a.bindTexture(c,s._texture),f._bind();let d=this.rectangles,p=this._subRegions;for(let g=0;g<d.length;++g){let m=i[g],y=d[g];if(!l(m)||!l(y)||l(p.get(g)))continue;let{x:A,y:b,width:x,height:T}=m;a.copyTexSubImage2D(c,0,A,b,y.x,y.y,x,T)}return a.bindTexture(c,null),s._initialized=!0,f._unBind(),f.destroy(),s};Gl.prototype._resize=function(e,t=0){let n=this._borderWidthInPixels,i=this._rectangles,r=this._imagesToAddQueue,o=this._texture,s=o.width,a=o.height,c=this._subRegions,u=i.map((A,b)=>new Phe({index:b,image:A})).filter((A,b)=>l(A.image)&&!l(c.get(b))),f=0,d=0,p=0;for(let A=t;A<r.length;++A){let{width:b,height:x}=r[A].image;f=Math.max(f,b),d=Math.max(d,x),p+=b*x,u.push(r[A])}for(s=D.nextPowerOfTwo(Math.max(f,s)),a=D.nextPowerOfTwo(Math.max(d,a));p>=s*a;)s>a?a*=2:s*=2;u.sort(({image:A},{image:b})=>b.height*b.width-A.height*A.width);let g=new Array(this._nextIndex);for(let A of this._subRegions.keys())l(c.get(A))&&(g[A]=i[A]);let m,y=!1;for(;!y;){m=new vv({height:a,width:s,borderPadding:n});let A;for(A=0;A<u.length;++A){let{index:b,image:x}=u[A];if(!l(x))continue;let T=m.pack(b,x);if(!l(T)){s>a?a*=2:s*=2;break}g[b]=T.rectangle}y=A===u.length}this._texturePacker=m,this._texture=this._copyFromTexture(e,s,a,g),o.destroy(),this._rectangles=g,this._guid=Kn()};Gl.prototype.getImageIndex=function(e){return this._indexById.get(e)};Gl.prototype._copyImageToTexture=function({index:e,image:t,resolve:n,reject:i}){let r=this._texture,o=this._rectangles[e];try{r.copyFrom({source:t,xOffset:o.x,yOffset:o.y}),l(n)&&n(e)}catch(s){if(l(i)){i(s);return}}};function Phe({index:e,image:t,resolve:n,reject:i}){this.index=e,this.image=t,this.resolve=n,this.reject=i,this.rectangle=void 0}Gl.prototype._addImage=function(e,t){return new Promise((n,i)=>{this._imagesToAddQueue.push(new Phe({index:e,image:t,resolve:n,reject:i})),this._imagesToAddQueue.sort(({image:r},{image:o})=>o.height*o.width-r.height*r.width)})};Gl.prototype._processImageQueue=function(e){let t=this._imagesToAddQueue;if(t.length===0)return!1;this._rectangles.length=this._nextIndex;let n,i;for(n=0;n<t.length;++n){let r=t[n],{image:o,index:s}=r,a=this._texturePacker.pack(s,o);if(!l(a)){try{this._resize(e,n)}catch(c){i=c,l(r.reject)&&r.reject(i)}break}this._rectangles[s]=a.rectangle}if(l(i)){for(n=n+1;n<t.length;++n){let{resolve:r}=t[n];l(r)&&r(-1)}return t.length=0,!1}for(let r=0;r<t.length;++r)this._copyImageToTexture(t[r]);return t.length=0,!0};Gl.prototype.update=function(e){if(!l(this._texture)){let t=this._initialSize.x,n=this._initialSize.y,i=this._pixelFormat,r=this._sampler,o=this._borderWidthInPixels;this._texture=new Dt({context:e,width:t,height:n,pixelFormat:i,sampler:r}),this._texturePacker=new vv({height:n,width:t,borderPadding:o})}return this._processImageQueue(e)};async function X6e(e,t){return typeof e=="function"&&(e=e(t)),(typeof e=="string"||e instanceof De)&&(e=De.createIfNeeded(e).fetchImage()),e}Gl.prototype.addImage=function(e,t,n,i){let r=this._indexPromiseById.get(e),o=this._indexById.get(e);return l(r)?r:l(o)?o:(o=this._nextIndex++,this._indexById.set(e,o),r=(async()=>{let a=await X6e(t,e);if(this.isDestroyed()||!l(a))return this._indexPromiseById.delete(e),-1;l(n)&&(a.width=n),l(i)&&(a.height=i);let c=await this._addImage(o,a);return this._indexPromiseById.delete(e),c})(),this._indexPromiseById.set(e,r),r)};Gl.prototype.getCachedImageSubRegion=function(e,t,n){let i=this._indexPromiseById.get(e);for(let[r,o]of this._subRegions.entries())if(n===o&&this._rectangles[r].equals(t))return i?i.then(a=>a===-1?-1:r):r};Gl.prototype.addImageSubRegion=function(e,t){let n=this._indexById.get(e);if(!l(n))throw new oe(`image with id "${e}" not found in the atlas.`);let i=this.getCachedImageSubRegion(e,t,n);return l(i)?i:(i=this._nextIndex++,this._subRegions.set(i,n),this._rectangles[i]=t.clone(),(this._indexPromiseById.get(e)??Promise.resolve(n)).then(o=>{if(o===-1)return-1;let s=this._rectangles[o];return i}))};Gl.prototype.isDestroyed=function(){return!1};Gl.prototype.destroy=function(){return this._texture=this._texture&&this._texture.destroy(),this._imagesToAddQueue.forEach(({resolve:e})=>{l(e)&&e(-1)}),le(this)};var Ex=Gl;function Fa(e,t,n,i){let r=Fa._verifyAttributes(t);n=n??0;let o=[],s={},a,c,u=r.length;for(let d=0;d<u;++d){let p=r[d];if(p.vertexBuffer){o.push(p);continue}c=p.usage,a=s[c],l(a)||(a=s[c]=[]),a.push(p)}function f(d,p){return Y.getSizeInBytes(p.componentDatatype)-Y.getSizeInBytes(d.componentDatatype)}this._allBuffers=[];for(c in s)if(s.hasOwnProperty(c)){a=s[c],a.sort(f);let d=Fa._vertexSizeInBytes(a),p=a[0].usage,g={vertexSizeInBytes:d,vertexBuffer:void 0,usage:p,needsCommit:!1,arrayBuffer:void 0,arrayViews:Fa._createArrayViews(a,d)};this._allBuffers.push(g)}this._size=0,this._instanced=i??!1,this._precreated=o,this._context=e,this.writers=void 0,this.va=void 0,this.resize(n)}Fa._verifyAttributes=function(e){let t=[];for(let i=0;i<e.length;++i){let r=e[i],o={index:r.index??i,enabled:r.enabled??!0,componentsPerAttribute:r.componentsPerAttribute,componentDatatype:r.componentDatatype??Y.FLOAT,normalize:r.normalize??!1,vertexBuffer:r.vertexBuffer,usage:r.usage??Me.STATIC_DRAW};t.push(o)}let n=new Array(t.length);for(let i=0;i<t.length;++i){let o=t[i].index;n[o]=!0}return t};Fa._vertexSizeInBytes=function(e){let t=0,n=e.length;for(let s=0;s<n;++s){let a=e[s];t+=a.componentsPerAttribute*Y.getSizeInBytes(a.componentDatatype)}let i=n>0?Y.getSizeInBytes(e[0].componentDatatype):0,r=i>0?t%i:0,o=r===0?0:i-r;return t+=o,t};Fa._createArrayViews=function(e,t){let n=[],i=0,r=e.length;for(let o=0;o<r;++o){let s=e[o],a=s.componentDatatype;n.push({index:s.index,enabled:s.enabled,componentsPerAttribute:s.componentsPerAttribute,componentDatatype:a,normalize:s.normalize,offsetInBytes:i,vertexSizeInComponentType:t/Y.getSizeInBytes(a),view:void 0}),i+=s.componentsPerAttribute*Y.getSizeInBytes(a)}return n};Fa.prototype.resize=function(e){this._size=e;let t=this._allBuffers;this.writers=[];for(let n=0,i=t.length;n<i;++n){let r=t[n];Fa._resize(r,this._size),Fa._appendWriters(this.writers,r)}WX(this)};Fa._resize=function(e,t){if(e.vertexSizeInBytes>0){let n=new ArrayBuffer(t*e.vertexSizeInBytes);if(l(e.arrayBuffer)){let o=new Uint8Array(n),s=new Uint8Array(e.arrayBuffer),a=s.length;for(let c=0;c<a;++c)o[c]=s[c]}let i=e.arrayViews,r=i.length;for(let o=0;o<r;++o){let s=i[o];s.view=Y.createArrayBufferView(s.componentDatatype,n,s.offsetInBytes)}e.arrayBuffer=n}};var K6e=[function(e,t,n){return function(i,r){t[i*n]=r,e.needsCommit=!0}},function(e,t,n){return function(i,r,o){let s=i*n;t[s]=r,t[s+1]=o,e.needsCommit=!0}},function(e,t,n){return function(i,r,o,s){let a=i*n;t[a]=r,t[a+1]=o,t[a+2]=s,e.needsCommit=!0}},function(e,t,n){return function(i,r,o,s,a){let c=i*n;t[c]=r,t[c+1]=o,t[c+2]=s,t[c+3]=a,e.needsCommit=!0}}];Fa._appendWriters=function(e,t){let n=t.arrayViews,i=n.length;for(let r=0;r<i;++r){let o=n[r];e[o.index]=K6e[o.componentsPerAttribute-1](t,o.view,o.vertexSizeInComponentType)}};Fa.prototype.commit=function(e){let t=!1,n=this._allBuffers,i,r,o;for(r=0,o=n.length;r<o;++r)i=n[r],t=$6e(this,i)||t;if(t||!l(this.va)){WX(this);let s=this.va=[],a=D.SIXTY_FOUR_KILOBYTES-4,c=l(e)&&!this._instanced?Math.ceil(this._size/a):1;for(let u=0;u<c;++u){let f=[];for(r=0,o=n.length;r<o;++r){i=n[r];let d=u*(i.vertexSizeInBytes*a);Fa._appendAttributes(f,i,d,this._instanced)}f=f.concat(this._precreated),s.push({va:new zn({context:this._context,attributes:f,indexBuffer:e}),indicesCount:1.5*(u!==c-1?a:this._size%a)})}}};function $6e(e,t){if(t.needsCommit&&t.vertexSizeInBytes>0){t.needsCommit=!1;let n=t.vertexBuffer,i=e._size*t.vertexSizeInBytes,r=l(n);if(!r||n.sizeInBytes<i)return r&&n.destroy(),t.vertexBuffer=tt.createVertexBuffer({context:e._context,typedArray:t.arrayBuffer,usage:t.usage}),t.vertexBuffer.vertexArrayDestroyable=!1,!0;t.vertexBuffer.copyFromArrayView(t.arrayBuffer)}return!1}Fa._appendAttributes=function(e,t,n,i){let r=t.arrayViews,o=r.length;for(let s=0;s<o;++s){let a=r[s];e.push({index:a.index,enabled:a.enabled,componentsPerAttribute:a.componentsPerAttribute,componentDatatype:a.componentDatatype,normalize:a.normalize,vertexBuffer:t.vertexBuffer,offsetInBytes:n+a.offsetInBytes,strideInBytes:t.vertexSizeInBytes,instanceDivisor:i?1:0})}};Fa.prototype.subCommit=function(e,t){let n=this._allBuffers;for(let i=0,r=n.length;i<r;++i)J6e(n[i],e,t)};function J6e(e,t,n){if(e.needsCommit&&e.vertexSizeInBytes>0){let i=e.vertexSizeInBytes*t,r=e.vertexSizeInBytes*n;e.vertexBuffer.copyFromArrayView(new Uint8Array(e.arrayBuffer,i,r),i)}}Fa.prototype.endSubCommits=function(){let e=this._allBuffers;for(let t=0,n=e.length;t<n;++t)e[t].needsCommit=!1};function WX(e){let t=e.va;if(!l(t))return;let n=t.length;for(let i=0;i<n;++i)t[i].va.destroy();e.va=void 0}Fa.prototype.isDestroyed=function(){return!1};Fa.prototype.destroy=function(){let e=this._allBuffers;for(let t=0,n=e.length;t<n;++t){let i=e[t];i.vertexBuffer=i.vertexBuffer&&i.vertexBuffer.destroy()}return WX(this),le(this)};var mg=Fa;var Sv=`#ifdef MRT +`),a=new Ye({defines:this._fragmentShaderParts.defineLines,sources:[s]});return Qt.fromCache({context:e,vertexShaderSource:o,fragmentShaderSource:a,attributeLocations:this._attributeLocations})};Hl.prototype.clone=function(){return Je(this,!0)};function W6e(e){let t=[],n=[],i,r=e._vertexShaderParts.structIds,o,s,a;for(i=0;i<r.length;i++)o=r[i],s=e._structs[o],a=s.generateGlslLines(),Zn(t,a);for(r=e._fragmentShaderParts.structIds,i=0;i<r.length;i++)o=r[i],s=e._structs[o],a=s.generateGlslLines(),Zn(n,a);return{vertexLines:t,fragmentLines:n}}function q6e(e){switch(e){case"mat2":return 2;case"mat3":return 3;case"mat4":return 4;default:return 1}}function Y6e(e){let t=[],n=[],i,r=e._vertexShaderParts.functionIds,o,s,a;for(i=0;i<r.length;i++)o=r[i],s=e._functions[o],a=s.generateGlslLines(),Zn(t,a);for(r=e._fragmentShaderParts.functionIds,i=0;i<r.length;i++)o=r[i],s=e._functions[o],a=s.generateGlslLines(),Zn(n,a);return{vertexLines:t,fragmentLines:n}}var hg=Hl;function g6(e){this._autoDestroy=e?.autoDestroy??!0,this._canvas=document.createElement("canvas"),this._context=new xx(this._canvas,Je(e?.contextOptions)),this._canvases=[]}g6.prototype.createSceneContext=function(e){let t=e.getContext("2d",{alpha:!0}),n=this;n._canvases.push(e);let i=!1,r=function(){i=!0;let c=n._canvases.indexOf(e);c!==-1&&(n._canvases.splice(c,1),n._autoDestroy&&n._canvases.length===0&&n.destroy())},o=function(){let c=n._context.canvas,u=this.drawingBufferWidth;c.width<u&&(c.width=u);let f=this.drawingBufferHeight;c.height<f&&(c.height=f)},s=function(){let c=this.drawingBufferWidth,u=this.drawingBufferHeight,f=n._context.canvas.height-u;t.drawImage(n._context.canvas,0,f,c,u,0,0,c,u),n._context.endFrame()};return new Proxy(this._context,{get(c,u,f){if(u==="isDestroyed")return function(){return i};switch(u){case"_canvas":return e;case"destroy":return r;case"drawingBufferWidth":return e.width;case"drawingBufferHeight":return e.height;case"beginFrame":return o;case"endFrame":return s;default:return Reflect.get(c,u,f)}}})};g6.prototype.destroy=function(){this._context.destroy(),le(this)};g6.prototype.isDestroyed=function(){return!1};var MO=g6;function Tx(e){e=e??H.EMPTY_OBJECT;let t=e.context;if(!t._webgl2)throw new pe("A WebGL 2 context is required to use Sync operations.");let n=t._gl,i=n.fenceSync(te.SYNC_GPU_COMMANDS_COMPLETE,0);this._gl=n,this._sync=i}Tx.create=function(e){return new Tx(e)};Tx.prototype.getStatus=function(){return this._gl.getSyncParameter(this._sync,te.SYNC_STATUS)};Tx.prototype.isDestroyed=function(){return!1};Tx.prototype.destroy=function(){return this._gl.deleteSync(this._sync),le(this)};Tx.prototype.waitForSignal=async function(e,t){let n=this;t=t??10;function i(r,o,s){return()=>{n.getStatus()===te.SIGNALED?r():s<=0?o(new oe("Wait for signal timeout")):e(i(r,o,s-1))}}return new Promise((r,o)=>{e(i(r,o,t))})};var NO=Tx;function zy(e){e=e??H.EMPTY_OBJECT;let{context:t,source:n,pixelFormat:i=Ke.RGBA,pixelDatatype:r=ze.UNSIGNED_BYTE,flipY:o=!0,skipColorSpaceConversion:s=!1,sampler:a=new jt}=e;if(!t.webgl2&&!l(t.options.getWebGLStub))throw new pe("WebGL1 does not support texture3D. Please use a WebGL2 context.");let{width:c,height:u,depth:f}=e;l(n)&&(l(c)||(c=n.width),l(u)||(u=n.height),l(f)||(f=n.depth));let d=e.preMultiplyAlpha||i===Ke.RGB||i===Ke.LUMINANCE,p=Ke.toInternalFormat(i,r,t),g=Ke.isCompressedFormat(p),m=t._gl,y=Ke.texture3DSizeInBytes(i,r,c,u,f);if(this._id=e.id??Kn(),this._context=t,this._textureFilterAnisotropic=t._textureFilterAnisotropic,this._textureTarget=m.TEXTURE_3D,this._texture=m.createTexture(),this._internalFormat=p,this._pixelFormat=i,this._pixelDatatype=r,this._width=c,this._height=u,this._depth=f,this._dimensions=new h(c,u,f),this._hasMipmap=!1,this._sizeInBytes=y,this._preMultiplyAlpha=d,this._flipY=o,this._initialized=!1,this._sampler=void 0,this._sampler=a,whe(this,a),m.activeTexture(m.TEXTURE0),m.bindTexture(this._textureTarget,this._texture),l(n)){if(s?m.pixelStorei(m.UNPACK_COLORSPACE_CONVERSION_WEBGL,m.NONE):m.pixelStorei(m.UNPACK_COLORSPACE_CONVERSION_WEBGL,m.BROWSER_DEFAULT_WEBGL),!l(n.arrayBufferView))throw new pe("For Texture3D, options.source.arrayBufferView must be defined");vhe(this,n),this._initialized=!0}else She(this);m.bindTexture(this._textureTarget,null)}function vhe(e,t){let n=e._context,i=n._gl,r=e._textureTarget,o=e._internalFormat,{width:s,height:a,depth:c,pixelFormat:u,pixelDatatype:f,flipY:d}=e,p=Ke.alignmentInBytes(u,f,s);i.pixelStorei(i.UNPACK_ALIGNMENT,p),i.pixelStorei(i.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!1),i.pixelStorei(i.UNPACK_FLIP_Y_WEBGL,!1);let{arrayBufferView:g}=t;d&&console.warn("texture3D.flipY is not supported.");let m=1;if(t.mipLevels&&t.mipLevels.length&&(m=t.mipLevels.length+1),i.texStorage3D(r,m,o,s,a,c),i.texSubImage3D(r,0,0,0,0,s,a,c,u,ze.toWebGLConstant(f,n),g),m>1){let y=s,A=a,b=c;for(let x=0;x<t.mipLevels.length;++x)y=HX(y),A=HX(A),b=HX(b),i.texSubImage3D(r,x+1,0,0,0,y,A,b,u,ze.toWebGLConstant(f,n),t.mipLevels[x])}}zy.prototype.copyFrom=function(e){e=e??H.EMPTY_OBJECT;let{source:t,xOffset:n=0,yOffset:i=0,zOffset:r=0}=e,s=this._context._gl,a=this._textureTarget;s.activeTexture(s.TEXTURE0),s.bindTexture(a,this._texture);let{width:c,height:u,depth:f}=t,d=!1;this._initialized||(n===0&&i===0&&r===0&&c===this._width&&u===this._height&&f===this._depth?(vhe(this,t),d=!0):(s.pixelStorei(s.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!1),s.pixelStorei(s.UNPACK_FLIP_Y_WEBGL,!1),She(this)),this._initialized=!0),d||X6e(this,t.arrayBufferView,n,i,r,c,u,f),s.bindTexture(a,null)};function X6e(e,t,n,i,r,o,s,a){let c=e._context,u=c._gl,{pixelFormat:f,pixelDatatype:d}=e,p=Ke.alignmentInBytes(f,d,o);u.pixelStorei(u.UNPACK_ALIGNMENT,p),u.pixelStorei(u.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!1),u.pixelStorei(u.UNPACK_FLIP_Y_WEBGL,!1),u.texSubImage3D(e._textureTarget,0,n,i,r,o,s,a,f,ze.toWebGLConstant(d,c),t)}function HX(e){let t=Math.floor(e/2)|0;return Math.max(t,1)}function She(e){let t=e._context;t._gl.texImage3D(e._textureTarget,0,e._internalFormat,e._width,e._height,e._depth,0,e._pixelFormat,ze.toWebGLConstant(e._pixelDatatype,t),null)}zy.create=function(e){return new zy(e)};Object.defineProperties(zy.prototype,{id:{get:function(){return this._id}},sampler:{get:function(){return this._sampler},set:function(e){whe(this,e),this._sampler=e}},pixelFormat:{get:function(){return this._pixelFormat}},pixelDatatype:{get:function(){return this._pixelDatatype}},dimensions:{get:function(){return this._dimensions}},preMultiplyAlpha:{get:function(){return this._preMultiplyAlpha}},flipY:{get:function(){return this._flipY}},width:{get:function(){return this._width}},height:{get:function(){return this._height}},depth:{get:function(){return this._depth}},sizeInBytes:{get:function(){return this._hasMipmap?Math.floor(this._sizeInBytes*8/7):this._sizeInBytes}},_target:{get:function(){return this._textureTarget}}});function whe(e,t){let{minificationFilter:n,magnificationFilter:i}=t,r=[Wt.NEAREST_MIPMAP_NEAREST,Wt.NEAREST_MIPMAP_LINEAR,Wt.LINEAR_MIPMAP_NEAREST,Wt.LINEAR_MIPMAP_LINEAR].includes(n),o=e._context,s=e._pixelFormat,a=e._pixelDatatype;(a===ze.FLOAT&&!o.textureFloatLinear||a===ze.HALF_FLOAT&&!o.textureHalfFloatLinear)&&(n=r?Wt.NEAREST_MIPMAP_NEAREST:Wt.NEAREST,i=Jn.NEAREST),Ke.isDepthFormat(s)&&(n=Wt.NEAREST,i=Jn.NEAREST);let c=o._gl,u=e._textureTarget;c.activeTexture(c.TEXTURE0),c.bindTexture(u,e._texture),c.texParameteri(u,c.TEXTURE_MIN_FILTER,n),c.texParameteri(u,c.TEXTURE_MAG_FILTER,i),c.texParameteri(u,c.TEXTURE_WRAP_R,t.wrapR),c.texParameteri(u,c.TEXTURE_WRAP_S,t.wrapS),c.texParameteri(u,c.TEXTURE_WRAP_T,t.wrapT),l(e._textureFilterAnisotropic)&&c.texParameteri(u,e._textureFilterAnisotropic.TEXTURE_MAX_ANISOTROPY_EXT,t.maximumAnisotropy),c.bindTexture(u,null)}zy.prototype.generateMipmap=function(e){e=e??Id.DONT_CARE,this._hasMipmap=!0;let t=this._context._gl,n=this._textureTarget;t.hint(t.GENERATE_MIPMAP_HINT,e),t.activeTexture(t.TEXTURE0),t.bindTexture(n,this._texture),t.generateMipmap(n),t.bindTexture(n,null)};zy.prototype.isDestroyed=function(){return!1};zy.prototype.destroy=function(){return this._context._gl.deleteTexture(this._texture),le(this)};var LO=zy;function FO({x:e,y:t,width:n,height:i}){this.rectangle=new et(e,t,n,i),this.childNode1=void 0,this.childNode2=void 0,this.index=void 0}function GX({width:e,height:t,borderPadding:n}){this._width=e,this._height=t,this._borderPadding=n,this._root=new FO({x:n,y:n,width:e-2*n,height:t-2*n})}GX.prototype.pack=function(e,{width:t,height:n}){let i=this._findNode(this._root,{width:t,height:n});if(l(i))return i.index=e,i};GX.prototype._findNode=function(e,{width:t,height:n}){if(l(e)){if(!l(e.childNode1)&&!l(e.childNode2)){if(l(e.index))return;let{rectangle:i}=e,r=i.width,o=i.height,s=r-t,a=o-n;if(s<0||a<0)return;if(s===0&&a===0)return e;let c=this._borderPadding;if(s>a){e.childNode1=new FO({x:i.x,y:i.y,width:t,height:o});let f=s-c;return f>0&&(e.childNode2=new FO({x:i.x+t+c,y:i.y,width:f,height:o})),this._findNode(e.childNode1,{width:t,height:n})}e.childNode1=new FO({x:i.x,y:i.y,width:r,height:n});let u=a-c;return u>0&&(e.childNode2=new FO({x:i.x,y:i.y+n+c,width:r,height:u})),this._findNode(e.childNode1,{width:t,height:n})}return this._findNode(e.childNode1,{width:t,height:n})||this._findNode(e.childNode2,{width:t,height:n})}};var vv=GX;var Ihe=16;function Gl(e){e=e??H.EMPTY_OBJECT;let t=e.borderWidthInPixels??1,n=e.initialSize??new U(Ihe,Ihe);this._pixelFormat=e.pixelFormat??Ke.RGBA,this._sampler=e.sampler,this._borderWidthInPixels=t,this._initialSize=n,this._texturePacker=void 0,this._rectangles=[],this._subRegions=new Map,this._guid=Kn(),this._imagesToAddQueue=[],this._indexById=new Map,this._indexPromiseById=new Map,this._nextIndex=0}Object.defineProperties(Gl.prototype,{borderWidthInPixels:{get:function(){return this._borderWidthInPixels}},rectangles:{get:function(){return this._rectangles}},texture:{get:function(){return this._texture}},pixelFormat:{get:function(){return this._pixelFormat}},sampler:{get:function(){return this._sampler}},numberOfImages:{get:function(){return this._nextIndex}},guid:{get:function(){return this._guid}},sizeInBytes:{get:function(){return l(this._texture)?this._texture.sizeInBytes:0}}});Gl.prototype.computeTextureCoordinates=function(e,t){let n=this._texture,i=this._rectangles[e];if(l(t)||(t=new et),!l(i))return t.x=0,t.y=0,t.width=0,t.height=0,t;let r=n.width,o=n.height,s=i.width,a=i.height,c=i.x,u=i.y,f=this._subRegions.get(e);if(l(f)){let d=this._rectangles[f];c+=d.x,u+=d.y}return t.x=c/r,t.y=u/o,t.width=s/r,t.height=a/o,t};Gl.prototype._copyFromTexture=function(e,t,n,i){let r=this._pixelFormat,o=this._sampler,s=new Dt({context:e,height:n,width:t,pixelFormat:r,sampler:o}),a=e._gl,c=s._textureTarget,u=this._texture,f=new _s({context:e,colorTextures:[u],destroyAttachments:!1});a.activeTexture(a.TEXTURE0),a.bindTexture(c,s._texture),f._bind();let d=this.rectangles,p=this._subRegions;for(let g=0;g<d.length;++g){let m=i[g],y=d[g];if(!l(m)||!l(y)||l(p.get(g)))continue;let{x:A,y:b,width:x,height:T}=m;a.copyTexSubImage2D(c,0,A,b,y.x,y.y,x,T)}return a.bindTexture(c,null),s._initialized=!0,f._unBind(),f.destroy(),s};Gl.prototype._resize=function(e,t=0){let n=this._borderWidthInPixels,i=this._rectangles,r=this._imagesToAddQueue,o=this._texture,s=o.width,a=o.height,c=this._subRegions,u=i.map((A,b)=>new Phe({index:b,image:A})).filter((A,b)=>l(A.image)&&!l(c.get(b))),f=0,d=0,p=0;for(let A=t;A<r.length;++A){let{width:b,height:x}=r[A].image;f=Math.max(f,b),d=Math.max(d,x),p+=b*x,u.push(r[A])}for(s=D.nextPowerOfTwo(Math.max(f,s)),a=D.nextPowerOfTwo(Math.max(d,a));p>=s*a;)s>a?a*=2:s*=2;u.sort(({image:A},{image:b})=>b.height*b.width-A.height*A.width);let g=new Array(this._nextIndex);for(let A of this._subRegions.keys())l(c.get(A))&&(g[A]=i[A]);let m,y=!1;for(;!y;){m=new vv({height:a,width:s,borderPadding:n});let A;for(A=0;A<u.length;++A){let{index:b,image:x}=u[A];if(!l(x))continue;let T=m.pack(b,x);if(!l(T)){s>a?a*=2:s*=2;break}g[b]=T.rectangle}y=A===u.length}this._texturePacker=m,this._texture=this._copyFromTexture(e,s,a,g),o.destroy(),this._rectangles=g,this._guid=Kn()};Gl.prototype.getImageIndex=function(e){return this._indexById.get(e)};Gl.prototype._copyImageToTexture=function({index:e,image:t,resolve:n,reject:i}){let r=this._texture,o=this._rectangles[e];try{r.copyFrom({source:t,xOffset:o.x,yOffset:o.y}),l(n)&&n(e)}catch(s){if(l(i)){i(s);return}}};function Phe({index:e,image:t,resolve:n,reject:i}){this.index=e,this.image=t,this.resolve=n,this.reject=i,this.rectangle=void 0}Gl.prototype._addImage=function(e,t){return new Promise((n,i)=>{this._imagesToAddQueue.push(new Phe({index:e,image:t,resolve:n,reject:i})),this._imagesToAddQueue.sort(({image:r},{image:o})=>o.height*o.width-r.height*r.width)})};Gl.prototype._processImageQueue=function(e){let t=this._imagesToAddQueue;if(t.length===0)return!1;this._rectangles.length=this._nextIndex;let n,i;for(n=0;n<t.length;++n){let r=t[n],{image:o,index:s}=r,a=this._texturePacker.pack(s,o);if(!l(a)){try{this._resize(e,n)}catch(c){i=c,l(r.reject)&&r.reject(i)}break}this._rectangles[s]=a.rectangle}if(l(i)){for(n=n+1;n<t.length;++n){let{resolve:r}=t[n];l(r)&&r(-1)}return t.length=0,!1}for(let r=0;r<t.length;++r)this._copyImageToTexture(t[r]);return t.length=0,!0};Gl.prototype.update=function(e){if(!l(this._texture)){let t=this._initialSize.x,n=this._initialSize.y,i=this._pixelFormat,r=this._sampler,o=this._borderWidthInPixels;this._texture=new Dt({context:e,width:t,height:n,pixelFormat:i,sampler:r}),this._texturePacker=new vv({height:n,width:t,borderPadding:o})}return this._processImageQueue(e)};async function K6e(e,t){return typeof e=="function"&&(e=e(t)),(typeof e=="string"||e instanceof De)&&(e=De.createIfNeeded(e).fetchImage()),e}Gl.prototype.addImage=function(e,t,n,i){let r=this._indexPromiseById.get(e),o=this._indexById.get(e);return l(r)?r:l(o)?o:(o=this._nextIndex++,this._indexById.set(e,o),r=(async()=>{let a=await K6e(t,e);if(this.isDestroyed()||!l(a))return this._indexPromiseById.delete(e),-1;l(n)&&(a.width=n),l(i)&&(a.height=i);let c=await this._addImage(o,a);return this._indexPromiseById.delete(e),c})(),this._indexPromiseById.set(e,r),r)};Gl.prototype.getCachedImageSubRegion=function(e,t,n){let i=this._indexPromiseById.get(e);for(let[r,o]of this._subRegions.entries())if(n===o&&this._rectangles[r].equals(t))return i?i.then(a=>a===-1?-1:r):r};Gl.prototype.addImageSubRegion=function(e,t){let n=this._indexById.get(e);if(!l(n))throw new oe(`image with id "${e}" not found in the atlas.`);let i=this.getCachedImageSubRegion(e,t,n);return l(i)?i:(i=this._nextIndex++,this._subRegions.set(i,n),this._rectangles[i]=t.clone(),(this._indexPromiseById.get(e)??Promise.resolve(n)).then(o=>{if(o===-1)return-1;let s=this._rectangles[o];return i}))};Gl.prototype.isDestroyed=function(){return!1};Gl.prototype.destroy=function(){return this._texture=this._texture&&this._texture.destroy(),this._imagesToAddQueue.forEach(({resolve:e})=>{l(e)&&e(-1)}),le(this)};var Ex=Gl;function Fa(e,t,n,i){let r=Fa._verifyAttributes(t);n=n??0;let o=[],s={},a,c,u=r.length;for(let d=0;d<u;++d){let p=r[d];if(p.vertexBuffer){o.push(p);continue}c=p.usage,a=s[c],l(a)||(a=s[c]=[]),a.push(p)}function f(d,p){return Y.getSizeInBytes(p.componentDatatype)-Y.getSizeInBytes(d.componentDatatype)}this._allBuffers=[];for(c in s)if(s.hasOwnProperty(c)){a=s[c],a.sort(f);let d=Fa._vertexSizeInBytes(a),p=a[0].usage,g={vertexSizeInBytes:d,vertexBuffer:void 0,usage:p,needsCommit:!1,arrayBuffer:void 0,arrayViews:Fa._createArrayViews(a,d)};this._allBuffers.push(g)}this._size=0,this._instanced=i??!1,this._precreated=o,this._context=e,this.writers=void 0,this.va=void 0,this.resize(n)}Fa._verifyAttributes=function(e){let t=[];for(let i=0;i<e.length;++i){let r=e[i],o={index:r.index??i,enabled:r.enabled??!0,componentsPerAttribute:r.componentsPerAttribute,componentDatatype:r.componentDatatype??Y.FLOAT,normalize:r.normalize??!1,vertexBuffer:r.vertexBuffer,usage:r.usage??Me.STATIC_DRAW};t.push(o)}let n=new Array(t.length);for(let i=0;i<t.length;++i){let o=t[i].index;n[o]=!0}return t};Fa._vertexSizeInBytes=function(e){let t=0,n=e.length;for(let s=0;s<n;++s){let a=e[s];t+=a.componentsPerAttribute*Y.getSizeInBytes(a.componentDatatype)}let i=n>0?Y.getSizeInBytes(e[0].componentDatatype):0,r=i>0?t%i:0,o=r===0?0:i-r;return t+=o,t};Fa._createArrayViews=function(e,t){let n=[],i=0,r=e.length;for(let o=0;o<r;++o){let s=e[o],a=s.componentDatatype;n.push({index:s.index,enabled:s.enabled,componentsPerAttribute:s.componentsPerAttribute,componentDatatype:a,normalize:s.normalize,offsetInBytes:i,vertexSizeInComponentType:t/Y.getSizeInBytes(a),view:void 0}),i+=s.componentsPerAttribute*Y.getSizeInBytes(a)}return n};Fa.prototype.resize=function(e){this._size=e;let t=this._allBuffers;this.writers=[];for(let n=0,i=t.length;n<i;++n){let r=t[n];Fa._resize(r,this._size),Fa._appendWriters(this.writers,r)}WX(this)};Fa._resize=function(e,t){if(e.vertexSizeInBytes>0){let n=new ArrayBuffer(t*e.vertexSizeInBytes);if(l(e.arrayBuffer)){let o=new Uint8Array(n),s=new Uint8Array(e.arrayBuffer),a=s.length;for(let c=0;c<a;++c)o[c]=s[c]}let i=e.arrayViews,r=i.length;for(let o=0;o<r;++o){let s=i[o];s.view=Y.createArrayBufferView(s.componentDatatype,n,s.offsetInBytes)}e.arrayBuffer=n}};var $6e=[function(e,t,n){return function(i,r){t[i*n]=r,e.needsCommit=!0}},function(e,t,n){return function(i,r,o){let s=i*n;t[s]=r,t[s+1]=o,e.needsCommit=!0}},function(e,t,n){return function(i,r,o,s){let a=i*n;t[a]=r,t[a+1]=o,t[a+2]=s,e.needsCommit=!0}},function(e,t,n){return function(i,r,o,s,a){let c=i*n;t[c]=r,t[c+1]=o,t[c+2]=s,t[c+3]=a,e.needsCommit=!0}}];Fa._appendWriters=function(e,t){let n=t.arrayViews,i=n.length;for(let r=0;r<i;++r){let o=n[r];e[o.index]=$6e[o.componentsPerAttribute-1](t,o.view,o.vertexSizeInComponentType)}};Fa.prototype.commit=function(e){let t=!1,n=this._allBuffers,i,r,o;for(r=0,o=n.length;r<o;++r)i=n[r],t=J6e(this,i)||t;if(t||!l(this.va)){WX(this);let s=this.va=[],a=D.SIXTY_FOUR_KILOBYTES-4,c=l(e)&&!this._instanced?Math.ceil(this._size/a):1;for(let u=0;u<c;++u){let f=[];for(r=0,o=n.length;r<o;++r){i=n[r];let d=u*(i.vertexSizeInBytes*a);Fa._appendAttributes(f,i,d,this._instanced)}f=f.concat(this._precreated),s.push({va:new zn({context:this._context,attributes:f,indexBuffer:e}),indicesCount:1.5*(u!==c-1?a:this._size%a)})}}};function J6e(e,t){if(t.needsCommit&&t.vertexSizeInBytes>0){t.needsCommit=!1;let n=t.vertexBuffer,i=e._size*t.vertexSizeInBytes,r=l(n);if(!r||n.sizeInBytes<i)return r&&n.destroy(),t.vertexBuffer=tt.createVertexBuffer({context:e._context,typedArray:t.arrayBuffer,usage:t.usage}),t.vertexBuffer.vertexArrayDestroyable=!1,!0;t.vertexBuffer.copyFromArrayView(t.arrayBuffer)}return!1}Fa._appendAttributes=function(e,t,n,i){let r=t.arrayViews,o=r.length;for(let s=0;s<o;++s){let a=r[s];e.push({index:a.index,enabled:a.enabled,componentsPerAttribute:a.componentsPerAttribute,componentDatatype:a.componentDatatype,normalize:a.normalize,vertexBuffer:t.vertexBuffer,offsetInBytes:n+a.offsetInBytes,strideInBytes:t.vertexSizeInBytes,instanceDivisor:i?1:0})}};Fa.prototype.subCommit=function(e,t){let n=this._allBuffers;for(let i=0,r=n.length;i<r;++i)Z6e(n[i],e,t)};function Z6e(e,t,n){if(e.needsCommit&&e.vertexSizeInBytes>0){let i=e.vertexSizeInBytes*t,r=e.vertexSizeInBytes*n;e.vertexBuffer.copyFromArrayView(new Uint8Array(e.arrayBuffer,i,r),i)}}Fa.prototype.endSubCommits=function(){let e=this._allBuffers;for(let t=0,n=e.length;t<n;++t)e[t].needsCommit=!1};function WX(e){let t=e.va;if(!l(t))return;let n=t.length;for(let i=0;i<n;++i)t[i].va.destroy();e.va=void 0}Fa.prototype.isDestroyed=function(){return!1};Fa.prototype.destroy=function(){let e=this._allBuffers;for(let t=0,n=e.length;t<n;++t){let i=e[t];i.vertexBuffer=i.vertexBuffer&&i.vertexBuffer.destroy()}return WX(this),le(this)};var mg=Fa;var Sv=`#ifdef MRT layout (location = 0) out vec4 out_FragData_0; layout (location = 1) out vec4 out_FragData_1; #else @@ -6122,124 +6122,67 @@ materialInput.normalEC = vec3(0.0, 0.0, -1.0); czm_material material = czm_getMaterial(materialInput); out_FragColor = vec4(material.diffuse + material.emission, material.alpha); } -`;function Hy(e){this._value=void 0,this._hasClone=!1,this._hasEquals=!1,this._definitionChanged=new be,this.setValue(e)}Object.defineProperties(Hy.prototype,{isConstant:{value:!0},definitionChanged:{get:function(){return this._definitionChanged}}});Hy.prototype.getValue=function(e,t){return this._hasClone?this._value.clone(t):this._value};Hy.prototype.setValue=function(e){let t=this._value;if(t!==e){let n=l(e),i=n&&typeof e.clone=="function",r=n&&typeof e.equals=="function";(!r||!e.equals(t))&&(this._hasClone=i,this._hasEquals=r,this._value=i?e.clone(this._value):e,this._definitionChanged.raiseEvent(this))}};Hy.prototype.equals=function(e){return this===e||e instanceof Hy&&(!this._hasEquals&&this._value===e._value||this._hasEquals&&this._value.equals(e._value))};Hy.prototype.valueOf=function(){return this._value};Hy.prototype.toString=function(){return String(this._value)};var ui=Hy;function Z6e(e,t,n,i,r){return{configurable:i,get:function(){return this[t]},set:function(o){let s=this[t],a=this[n];l(a)&&(a(),this[n]=void 0),o!==void 0&&(!l(o)||!l(o.getValue))&&l(r)&&(o=r(o)),s!==o&&(this[t]=o,this._definitionChanged.raiseEvent(this,e,o,s)),l(o)&&l(o.definitionChanged)&&(this[n]=o.definitionChanged.addEventListener(function(){this._definitionChanged.raiseEvent(this,e,o,o)},this))}}}function Q6e(e){return new ui(e)}function eHe(e,t,n){return Z6e(e,`_${e.toString()}`,`_${e.toString()}Subscription`,t??!1,n??Q6e)}var me=eHe;function DM(e){this._definitionChanged=new be,this._show=void 0,this._showSubscription=void 0,this._image=void 0,this._imageSubscription=void 0,this._scale=void 0,this._scaleSubscription=void 0,this._pixelOffset=void 0,this._pixelOffsetSubscription=void 0,this._eyeOffset=void 0,this._eyeOffsetSubscription=void 0,this._horizontalOrigin=void 0,this._horizontalOriginSubscription=void 0,this._verticalOrigin=void 0,this._verticalOriginSubscription=void 0,this._heightReference=void 0,this._heightReferenceSubscription=void 0,this._color=void 0,this._colorSubscription=void 0,this._rotation=void 0,this._rotationSubscription=void 0,this._alignedAxis=void 0,this._alignedAxisSubscription=void 0,this._sizeInMeters=void 0,this._sizeInMetersSubscription=void 0,this._width=void 0,this._widthSubscription=void 0,this._height=void 0,this._heightSubscription=void 0,this._scaleByDistance=void 0,this._scaleByDistanceSubscription=void 0,this._translucencyByDistance=void 0,this._translucencyByDistanceSubscription=void 0,this._pixelOffsetScaleByDistance=void 0,this._pixelOffsetScaleByDistanceSubscription=void 0,this._imageSubRegion=void 0,this._imageSubRegionSubscription=void 0,this._distanceDisplayCondition=void 0,this._distanceDisplayConditionSubscription=void 0,this._disableDepthTestDistance=void 0,this._disableDepthTestDistanceSubscription=void 0,this._splitDirection=void 0,this._splitDirectionSubscription=void 0,this.merge(e??H.EMPTY_OBJECT)}Object.defineProperties(DM.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:me("show"),image:me("image"),scale:me("scale"),pixelOffset:me("pixelOffset"),eyeOffset:me("eyeOffset"),horizontalOrigin:me("horizontalOrigin"),verticalOrigin:me("verticalOrigin"),heightReference:me("heightReference"),color:me("color"),rotation:me("rotation"),alignedAxis:me("alignedAxis"),sizeInMeters:me("sizeInMeters"),width:me("width"),height:me("height"),scaleByDistance:me("scaleByDistance"),translucencyByDistance:me("translucencyByDistance"),pixelOffsetScaleByDistance:me("pixelOffsetScaleByDistance"),imageSubRegion:me("imageSubRegion"),distanceDisplayCondition:me("distanceDisplayCondition"),disableDepthTestDistance:me("disableDepthTestDistance"),splitDirection:me("splitDirection")});DM.prototype.clone=function(e){return l(e)?(e.show=this._show,e.image=this._image,e.scale=this._scale,e.pixelOffset=this._pixelOffset,e.eyeOffset=this._eyeOffset,e.horizontalOrigin=this._horizontalOrigin,e.verticalOrigin=this._verticalOrigin,e.heightReference=this._heightReference,e.color=this._color,e.rotation=this._rotation,e.alignedAxis=this._alignedAxis,e.sizeInMeters=this._sizeInMeters,e.width=this._width,e.height=this._height,e.scaleByDistance=this._scaleByDistance,e.translucencyByDistance=this._translucencyByDistance,e.pixelOffsetScaleByDistance=this._pixelOffsetScaleByDistance,e.imageSubRegion=this._imageSubRegion,e.distanceDisplayCondition=this._distanceDisplayCondition,e.disableDepthTestDistance=this._disableDepthTestDistance,e.splitDirection=this._splitDirection,e):new DM(this)};DM.prototype.merge=function(e){this.show=this._show??e.show,this.image=this._image??e.image,this.scale=this._scale??e.scale,this.pixelOffset=this._pixelOffset??e.pixelOffset,this.eyeOffset=this._eyeOffset??e.eyeOffset,this.horizontalOrigin=this._horizontalOrigin??e.horizontalOrigin,this.verticalOrigin=this._verticalOrigin??e.verticalOrigin,this.heightReference=this._heightReference??e.heightReference,this.color=this._color??e.color,this.rotation=this._rotation??e.rotation,this.alignedAxis=this._alignedAxis??e.alignedAxis,this.sizeInMeters=this._sizeInMeters??e.sizeInMeters,this.width=this._width??e.width,this.height=this._height??e.height,this.scaleByDistance=this._scaleByDistance??e.scaleByDistance,this.translucencyByDistance=this._translucencyByDistance??e.translucencyByDistance,this.pixelOffsetScaleByDistance=this._pixelOffsetScaleByDistance??e.pixelOffsetScaleByDistance,this.imageSubRegion=this._imageSubRegion??e.imageSubRegion,this.distanceDisplayCondition=this._distanceDisplayCondition??e.distanceDisplayCondition,this.disableDepthTestDistance=this._disableDepthTestDistance??e.disableDepthTestDistance,this.splitDirection=this.splitDirection??e.splitDirection};var Zc=DM;var qX=class{constructor(){this._array=[],this._hash={}}get length(){return this._array.length}get values(){return this._array}contains(t){return l(this._hash[t])}set(t,n){let i=this._hash[t];n!==i&&(this.remove(t),this._hash[t]=n,this._array.push(n))}get(t){return this._hash[t]}remove(t){let n=this._hash[t],i=l(n);if(i){let r=this._array;r.splice(r.indexOf(n),1),delete this._hash[t]}return i}removeAll(){let t=this._array;t.length>0&&(this._hash={},t.length=0)}},Ut=qX;function wf(e,t){e=e??0,this._near=e,t=t??Number.MAX_VALUE,this._far=t}Object.defineProperties(wf.prototype,{near:{get:function(){return this._near},set:function(e){this._near=e}},far:{get:function(){return this._far},set:function(e){this._far=e}}});wf.packedLength=2;wf.pack=function(e,t,n){return n=n??0,t[n++]=e.near,t[n]=e.far,t};wf.unpack=function(e,t,n){return t=t??0,l(n)||(n=new wf),n.near=e[t++],n.far=e[t],n};wf.equals=function(e,t){return e===t||l(e)&&l(t)&&e.near===t.near&&e.far===t.far};wf.clone=function(e,t){if(l(e))return l(t)||(t=new wf),t.near=e.near,t.far=e.far,t};wf.prototype.clone=function(e){return wf.clone(this,e)};wf.prototype.equals=function(e){return wf.equals(this,e)};var Ht=wf;function Md(e,t,n,i){this.near=e??0,this.nearValue=t??0,this.far=n??1,this.farValue=i??0}Md.clone=function(e,t){if(l(e))return l(t)?(t.near=e.near,t.nearValue=e.nearValue,t.far=e.far,t.farValue=e.farValue,t):new Md(e.near,e.nearValue,e.far,e.farValue)};Md.packedLength=4;Md.pack=function(e,t,n){return n=n??0,t[n++]=e.near,t[n++]=e.nearValue,t[n++]=e.far,t[n]=e.farValue,t};Md.unpack=function(e,t,n){return t=t??0,l(n)||(n=new Md),n.near=e[t++],n.nearValue=e[t++],n.far=e[t++],n.farValue=e[t],n};Md.equals=function(e,t){return e===t||l(e)&&l(t)&&e.near===t.near&&e.nearValue===t.nearValue&&e.far===t.far&&e.farValue===t.farValue};Md.prototype.clone=function(e){return Md.clone(this,e)};Md.prototype.equals=function(e){return Md.equals(this,e)};var qt=Md;var Gy={NONE:0,CLAMP_TO_GROUND:1,RELATIVE_TO_GROUND:2,CLAMP_TO_TERRAIN:3,RELATIVE_TO_TERRAIN:4,CLAMP_TO_3D_TILE:5,RELATIVE_TO_3D_TILE:6,CLIP_TO_GROUND:7};Object.freeze(Gy);var We=Gy;function As(e){return e===Gy.CLAMP_TO_GROUND||e===Gy.CLAMP_TO_3D_TILE||e===Gy.CLAMP_TO_TERRAIN}function Wy(e){return e===Gy.RELATIVE_TO_GROUND||e===Gy.RELATIVE_TO_3D_TILE||e===Gy.RELATIVE_TO_TERRAIN}var Dhe={CENTER:0,LEFT:1,RIGHT:-1};Object.freeze(Dhe);var zi=Dhe;var Rhe={CENTER:0,BOTTOM:1,BASELINE:2,TOP:-1};Object.freeze(Rhe);var Gn=Rhe;var tHe=Object.freeze({DONE:0,PENDING:1,FAILED:2}),Pt=tHe;function Xh(){pe.throwInstantiationError()}Object.defineProperties(Xh.prototype,{isConstant:{get:pe.throwInstantiationError},definitionChanged:{get:pe.throwInstantiationError}});Xh.prototype.getValue=pe.throwInstantiationError;Xh.prototype.equals=pe.throwInstantiationError;Xh.equals=function(e,t){return e===t||l(e)&&e.equals(t)};Xh.arrayEquals=function(e,t){if(e===t)return!0;if(!l(e)||!l(t)||e.length!==t.length)return!1;let n=e.length;for(let i=0;i<n;i++)if(!Xh.equals(e[i],t[i]))return!1;return!0};Xh.isConstant=function(e){return!l(e)||e.isConstant};Xh.getValueOrUndefined=function(e,t,n){return l(e)?e.getValue(t,n):void 0};Xh.getValueOrDefault=function(e,t,n,i){return l(e)?e.getValue(t,i)??n:n};Xh.getValueOrClonedDefault=function(e,t,n,i){let r;return l(e)&&(r=e.getValue(t,i)),l(r)||(r=n.clone(r)),r};var X=Xh;var nHe=500;function iHe(e,t,n,i,r){let o=t.mostDetailedHeightPosition;if(l(o)&&h.distance(o,n)>nHe&&(l(t.mostDetailedHeight)&&(t.mostDetailedHeightPrevious=t.mostDetailedHeight),t.mostDetailedHeightPosition=void 0,t.mostDetailedHeight=void 0),!l(t.mostDetailedHeightPosition))if(t.mostDetailedHeightPosition=h.clone(n),!l(e)||!e.sampleHeightSupported||e.mode!==re.SCENE3D)t.mostDetailedHeight=null;else{t.mostDetailedHeight=void 0;let a=(e.ellipsoid??ee.default).cartesianToCartographic(n);e.sampleHeightMostDetailed([a],i).then(function(c){r()&&(t.mostDetailedHeight=c[0].height??null)}).catch(function(){r()&&(t.mostDetailedHeight=null)})}return t.mostDetailedHeight===void 0?t.mostDetailedHeightPrevious:t.mostDetailedHeight}var Kh=iHe;var rHe=new he;function oHe(e,t,n,i,r){let o=i.cartesianToCartographic(e,rHe);return n===We.CLIP_TO_GROUND?o.height<t&&(o.height=t):As(n)?o.height=t:Wy(n)&&(o.height+=t),i.cartographicToCartesian(o,r)}var gg=oHe;var Ohe={LEFT:-1,NONE:0,RIGHT:1};Object.freeze(Ohe);var jo=Ohe;var sHe=z.WHITE,aHe=h.ZERO,cHe=We.NONE,lHe=U.ZERO,uHe=1,fHe=0,dHe=h.ZERO,hHe=zi.CENTER,mHe=Gn.CENTER,pHe=!1,gHe=jo.NONE,_He=new h,yHe=new z,AHe=new h,bHe=new U,xHe=new qt,THe=new qt,EHe=new qt,CHe=new et,vHe=new Ht;function Mhe(e){this.entity=e,this.billboard=void 0,this.textureValue=void 0}function qy(e,t){t.collectionChanged.addEventListener(qy.prototype._onCollectionChanged,this),this._cluster=e,this._entityCollection=t,this._items=new Ut,this._onCollectionChanged(t,t.values,[],[])}qy.prototype.update=function(e){let t=this._items.values,n=this._cluster;for(let i=0,r=t.length;i<r;i++){let o=t[i],s=o.entity,a=s._billboard,c,u=o.billboard,f=s.isShowing&&s.isAvailable(e)&&X.getValueOrDefault(a._show,e,!0),d;if(f&&(d=X.getValueOrUndefined(s._position,e,_He),c=X.getValueOrUndefined(a._image,e),f=l(d)&&l(c)),!f){YX(o,s,n);continue}X.isConstant(s._position)||(n._clusterDirty=!0),l(u)||(u=n.getBillboard(s),u.id=s,o.billboard=u,o.textureValue=void 0),u.show=f,u.position=d,u.color=X.getValueOrDefault(a._color,e,sHe,yHe),u.eyeOffset=X.getValueOrDefault(a._eyeOffset,e,aHe,AHe),u.heightReference=X.getValueOrDefault(a._heightReference,e,cHe),u.pixelOffset=X.getValueOrDefault(a._pixelOffset,e,lHe,bHe),u.scale=X.getValueOrDefault(a._scale,e,uHe),u.rotation=X.getValueOrDefault(a._rotation,e,fHe),u.alignedAxis=X.getValueOrDefault(a._alignedAxis,e,dHe),u.horizontalOrigin=X.getValueOrDefault(a._horizontalOrigin,e,hHe),u.verticalOrigin=X.getValueOrDefault(a._verticalOrigin,e,mHe),u.width=X.getValueOrUndefined(a._width,e),u.height=X.getValueOrUndefined(a._height,e),u.scaleByDistance=X.getValueOrUndefined(a._scaleByDistance,e,xHe),u.translucencyByDistance=X.getValueOrUndefined(a._translucencyByDistance,e,THe),u.pixelOffsetScaleByDistance=X.getValueOrUndefined(a._pixelOffsetScaleByDistance,e,EHe),u.sizeInMeters=X.getValueOrDefault(a._sizeInMeters,e,pHe),u.distanceDisplayCondition=X.getValueOrUndefined(a._distanceDisplayCondition,e,vHe),u.disableDepthTestDistance=X.getValueOrUndefined(a._disableDepthTestDistance,e),u.splitDirection=X.getValueOrDefault(a._splitDirection,e,gHe),o.textureValue!==c&&(u.image=c,o.textureValue=c);let p=X.getValueOrUndefined(a._imageSubRegion,e,CHe);l(p)&&u.setImageSubRegion(u.image,p)}return!0};qy.prototype.getBoundingSphere=function(e,t){let n=this._items.get(e.id);if(!l(n)||!l(n.billboard))return Pt.FAILED;let i=n.billboard;if(i.heightReference===We.NONE)t.center=h.clone(i.position,t.center);else if(i._clampedToSurface)t.center=h.clone(i._clampedPosition,t.center);else{let r=this._cluster._scene,o=this._items,s=Kh(r,n,i.position,[i],()=>o.get(e.id)===n);if(s===void 0)return Pt.PENDING;s===null?t.center=h.clone(i.position,t.center):t.center=gg(i.position,s,i.heightReference,r.ellipsoid??ee.default,t.center)}return t.radius=0,Pt.DONE};qy.prototype.isDestroyed=function(){return!1};qy.prototype.destroy=function(){this._entityCollection.collectionChanged.removeEventListener(qy.prototype._onCollectionChanged,this);let e=this._entityCollection.values;for(let t=0;t<e.length;t++)this._cluster.removeBillboard(e[t]);return le(this)};qy.prototype._onCollectionChanged=function(e,t,n,i){let r,o,s=this._items,a=this._cluster;for(r=t.length-1;r>-1;r--)o=t[r],l(o._billboard)&&l(o._position)&&s.set(o.id,new Mhe(o));for(r=i.length-1;r>-1;r--)o=i[r],l(o._billboard)&&l(o._position)?s.contains(o.id)||s.set(o.id,new Mhe(o)):(YX(s.get(o.id),o,a),s.remove(o.id));for(r=n.length-1;r>-1;r--)o=n[r],YX(s.get(o.id),o,a),s.remove(o.id)};function YX(e,t,n){l(e)&&(e.billboard=void 0,n.removeBillboard(t))}var RM=qy;var SHe=new h;function Fp(e){e=e??H.EMPTY_OBJECT;let t=e.minimum,n=e.maximum;this._min=h.clone(t),this._max=h.clone(n),this._offsetAttribute=e.offsetAttribute,this._workerName="createBoxOutlineGeometry"}Fp.fromDimensions=function(e){e=e??H.EMPTY_OBJECT;let t=e.dimensions,n=h.multiplyByScalar(t,.5,new h);return new Fp({minimum:h.negate(n,new h),maximum:n,offsetAttribute:e.offsetAttribute})};Fp.fromAxisAlignedBoundingBox=function(e){return new Fp({minimum:e.minimum,maximum:e.maximum})};Fp.packedLength=2*h.packedLength+1;Fp.pack=function(e,t,n){return n=n??0,h.pack(e._min,t,n),h.pack(e._max,t,n+h.packedLength),t[n+h.packedLength*2]=e._offsetAttribute??-1,t};var Lhe=new h,Fhe=new h,Nhe={minimum:Lhe,maximum:Fhe,offsetAttribute:void 0};Fp.unpack=function(e,t,n){t=t??0;let i=h.unpack(e,t,Lhe),r=h.unpack(e,t+h.packedLength,Fhe),o=e[t+h.packedLength*2];return l(n)?(n._min=h.clone(i,n._min),n._max=h.clone(r,n._max),n._offsetAttribute=o===-1?void 0:o,n):(Nhe.offsetAttribute=o===-1?void 0:o,new Fp(Nhe))};Fp.createGeometry=function(e){let t=e._min,n=e._max;if(h.equals(t,n))return;let i=new Tn,r=new Uint16Array(24),o=new Float64Array(24);o[0]=t.x,o[1]=t.y,o[2]=t.z,o[3]=n.x,o[4]=t.y,o[5]=t.z,o[6]=n.x,o[7]=n.y,o[8]=t.z,o[9]=t.x,o[10]=n.y,o[11]=t.z,o[12]=t.x,o[13]=t.y,o[14]=n.z,o[15]=n.x,o[16]=t.y,o[17]=n.z,o[18]=n.x,o[19]=n.y,o[20]=n.z,o[21]=t.x,o[22]=n.y,o[23]=n.z,i.position=new Ne({componentDatatype:Y.DOUBLE,componentsPerAttribute:3,values:o}),r[0]=4,r[1]=5,r[2]=5,r[3]=6,r[4]=6,r[5]=7,r[6]=7,r[7]=4,r[8]=0,r[9]=1,r[10]=1,r[11]=2,r[12]=2,r[13]=3,r[14]=3,r[15]=0,r[16]=0,r[17]=4,r[18]=1,r[19]=5,r[20]=2,r[21]=6,r[22]=3,r[23]=7;let s=h.subtract(n,t,SHe),a=h.magnitude(s)*.5;if(l(e._offsetAttribute)){let c=o.length,u=e._offsetAttribute===mn.NONE?0:1,f=new Uint8Array(c/3).fill(u);i.applyOffset=new Ne({componentDatatype:Y.UNSIGNED_BYTE,componentsPerAttribute:1,values:f})}return new St({attributes:i,indices:r,primitiveType:Oe.LINES,boundingSphere:new ue(h.ZERO,a),offsetAttribute:e._offsetAttribute})};var $h=Fp;function Mv(e,t,n,i){e=e??1,t=t??1,n=n??1,i=i??1,this.value=new Uint8Array([z.floatToByte(e),z.floatToByte(t),z.floatToByte(n),z.floatToByte(i)])}Object.defineProperties(Mv.prototype,{componentDatatype:{get:function(){return Y.UNSIGNED_BYTE}},componentsPerAttribute:{get:function(){return 4}},normalize:{get:function(){return!0}}});Mv.fromColor=function(e){return new Mv(e.red,e.green,e.blue,e.alpha)};Mv.toValue=function(e,t){return l(t)?e.toBytes(t):new Uint8Array(e.toBytes())};Mv.equals=function(e,t){return e===t||l(e)&&l(t)&&e.value[0]===t.value[0]&&e.value[1]===t.value[1]&&e.value[2]===t.value[2]&&e.value[3]===t.value[3]};var Jt=Mv;function OM(e,t){e=e??0,t=t??Number.MAX_VALUE,this.value=new Float32Array([e,t])}Object.defineProperties(OM.prototype,{componentDatatype:{get:function(){return Y.FLOAT}},componentsPerAttribute:{get:function(){return 2}},normalize:{get:function(){return!1}}});OM.fromDistanceDisplayCondition=function(e){return new OM(e.near,e.far)};OM.toValue=function(e,t){return l(t)?(t[0]=e.near,t[1]=e.far,t):new Float32Array([e.near,e.far])};var Qn=OM;function wHe(e){e=e??H.EMPTY_OBJECT,this.geometry=e.geometry,this.modelMatrix=N.clone(e.modelMatrix??N.IDENTITY),this.id=e.id,this.pickPrimitive=e.pickPrimitive,this.attributes=e.attributes??{},this.westHemisphereGeometry=void 0,this.eastHemisphereGeometry=void 0}var Ft=wHe;function Do(e){e=e??H.EMPTY_OBJECT,this.start=l(e.start)?K.clone(e.start):new K,this.stop=l(e.stop)?K.clone(e.stop):new K,this.data=e.data,this.isStartIncluded=e.isStartIncluded??!0,this.isStopIncluded=e.isStopIncluded??!0}Object.defineProperties(Do.prototype,{isEmpty:{get:function(){let e=K.compare(this.stop,this.start);return e<0||e===0&&(!this.isStartIncluded||!this.isStopIncluded)}}});var Nv={start:void 0,stop:void 0,isStartIncluded:void 0,isStopIncluded:void 0,data:void 0};Do.fromIso8601=function(e,t){let n=e.iso8601.split("/");if(n.length!==2)throw new pe("options.iso8601 is an invalid ISO 8601 interval.");let i=K.fromIso8601(n[0]),r=K.fromIso8601(n[1]),o=e.isStartIncluded??!0,s=e.isStopIncluded??!0,a=e.data;return l(t)?(t.start=i,t.stop=r,t.isStartIncluded=o,t.isStopIncluded=s,t.data=a,t):(Nv.start=i,Nv.stop=r,Nv.isStartIncluded=o,Nv.isStopIncluded=s,Nv.data=a,new Do(Nv))};Do.toIso8601=function(e,t){return`${K.toIso8601(e.start,t)}/${K.toIso8601(e.stop,t)}`};Do.clone=function(e,t){if(l(e))return l(t)?(t.start=e.start,t.stop=e.stop,t.isStartIncluded=e.isStartIncluded,t.isStopIncluded=e.isStopIncluded,t.data=e.data,t):new Do(e)};Do.equals=function(e,t,n){return e===t||l(e)&&l(t)&&(e.isEmpty&&t.isEmpty||e.isStartIncluded===t.isStartIncluded&&e.isStopIncluded===t.isStopIncluded&&K.equals(e.start,t.start)&&K.equals(e.stop,t.stop)&&(e.data===t.data||l(n)&&n(e.data,t.data)))};Do.equalsEpsilon=function(e,t,n,i){return n=n??0,e===t||l(e)&&l(t)&&(e.isEmpty&&t.isEmpty||e.isStartIncluded===t.isStartIncluded&&e.isStopIncluded===t.isStopIncluded&&K.equalsEpsilon(e.start,t.start,n)&&K.equalsEpsilon(e.stop,t.stop,n)&&(e.data===t.data||l(i)&&i(e.data,t.data)))};Do.intersect=function(e,t,n,i){if(!l(t))return Do.clone(Do.EMPTY,n);let r=e.start,o=e.stop,s=t.start,a=t.stop,c=K.greaterThanOrEquals(s,r)&&K.greaterThanOrEquals(o,s),u=!c&&K.lessThanOrEquals(s,r)&&K.lessThanOrEquals(r,a);if(!c&&!u)return Do.clone(Do.EMPTY,n);let f=e.isStartIncluded,d=e.isStopIncluded,p=t.isStartIncluded,g=t.isStopIncluded,m=K.lessThan(o,a);return l(n)||(n=new Do),n.start=c?s:r,n.isStartIncluded=f&&p||!K.equals(s,r)&&(c&&p||u&&f),n.stop=m?o:a,n.isStopIncluded=m?d:d&&g||!K.equals(a,o)&&g,n.data=l(i)?i(e.data,t.data):e.data,n};Do.contains=function(e,t){if(e.isEmpty)return!1;let n=K.compare(e.start,t);if(n===0)return e.isStartIncluded;let i=K.compare(t,e.stop);return i===0?e.isStopIncluded:n<0&&i<0};Do.prototype.clone=function(e){return Do.clone(this,e)};Do.prototype.equals=function(e,t){return Do.equals(this,e,t)};Do.prototype.equalsEpsilon=function(e,t,n){return Do.equalsEpsilon(this,e,t,n)};Do.prototype.toString=function(){return Do.toIso8601(this)};Do.EMPTY=Object.freeze(new Do({start:new K,stop:new K,isStartIncluded:!1,isStopIncluded:!1}));var En=Do;var Bhe=Object.freeze(K.fromIso8601("0000-01-01T00:00:00Z")),khe=Object.freeze(K.fromIso8601("9999-12-31T24:00:00Z")),IHe=Object.freeze(new En({start:Bhe,stop:khe})),PHe={MINIMUM_VALUE:Bhe,MAXIMUM_VALUE:khe,MAXIMUM_INTERVAL:IHe},nt=PHe;function MM(e,t,n){e=e??0,t=t??0,n=n??0,this.value=new Float32Array([e,t,n])}Object.defineProperties(MM.prototype,{componentDatatype:{get:function(){return Y.FLOAT}},componentsPerAttribute:{get:function(){return 3}},normalize:{get:function(){return!1}}});MM.fromCartesian3=function(e){return new MM(e.x,e.y,e.z)};MM.toValue=function(e,t){return l(t)||(t=new Float32Array([e.x,e.y,e.z])),t[0]=e.x,t[1]=e.y,t[2]=e.z,t};var Tr=MM;function _6(e){e=e??!0,this.value=_6.toValue(e)}Object.defineProperties(_6.prototype,{componentDatatype:{get:function(){return Y.UNSIGNED_BYTE}},componentsPerAttribute:{get:function(){return 1}},normalize:{get:function(){return!1}}});_6.toValue=function(e,t){return l(t)?(t[0]=e,t):new Uint8Array([e])};var Pn=_6;var NM=`in vec3 v_positionEC; -in vec3 v_normalEC; -in vec3 v_tangentEC; -in vec3 v_bitangentEC; -in vec2 v_st; -void main() -{ -vec3 positionToEyeEC = -v_positionEC; -mat3 tangentToEyeMatrix = czm_tangentToEyeSpaceMatrix(v_normalEC, v_tangentEC, v_bitangentEC); -vec3 normalEC = normalize(v_normalEC); -#ifdef FACE_FORWARD -normalEC = faceforward(normalEC, vec3(0.0, 0.0, 1.0), -normalEC); -#endif -czm_materialInput materialInput; -materialInput.normalEC = normalEC; -materialInput.tangentToEyeMatrix = tangentToEyeMatrix; -materialInput.positionToEyeEC = positionToEyeEC; -materialInput.st = v_st; -czm_material material = czm_getMaterial(materialInput); -#ifdef FLAT -out_FragColor = vec4(material.diffuse + material.emission, material.alpha); -#else -out_FragColor = czm_phong(normalize(positionToEyeEC), material, czm_lightDirectionEC); -#endif -} -`;var LM=`in vec3 position3DHigh; -in vec3 position3DLow; -in vec3 normal; -in vec3 tangent; -in vec3 bitangent; -in vec2 st; -in float batchId; -out vec3 v_positionEC; -out vec3 v_normalEC; -out vec3 v_tangentEC; -out vec3 v_bitangentEC; -out vec2 v_st; +`;var Dhe={UNBOUNDED:0,CLAMPED:1,LOOP_STOP:2};Object.freeze(Dhe);var As=Dhe;var Rhe={TICK_DEPENDENT:0,SYSTEM_CLOCK_MULTIPLIER:1,SYSTEM_CLOCK:2};Object.freeze(Rhe);var zr=Rhe;var qX;typeof performance<"u"&&typeof performance.now=="function"&&isFinite(performance.now())?qX=function(){return performance.now()}:qX=function(){return Date.now()};var xn=qX;function YX(e){e=e??H.EMPTY_OBJECT;let t=e.currentTime,n=e.startTime,i=e.stopTime;l(t)?t=K.clone(t):l(n)?t=K.clone(n):l(i)?t=K.addDays(i,-1,new K):t=K.now(),l(n)?n=K.clone(n):n=K.clone(t),l(i)?i=K.clone(i):i=K.addDays(n,1,new K),this.startTime=n,this.stopTime=i,this.clockRange=e.clockRange??As.UNBOUNDED,this.canAnimate=e.canAnimate??!0,this.onTick=new be,this.onStop=new be,this._currentTime=void 0,this._multiplier=void 0,this._clockStep=void 0,this._shouldAnimate=void 0,this._lastSystemTime=xn(),this.currentTime=t,this.multiplier=e.multiplier??1,this.shouldAnimate=e.shouldAnimate??!1,this.clockStep=e.clockStep??zr.SYSTEM_CLOCK_MULTIPLIER}Object.defineProperties(YX.prototype,{currentTime:{get:function(){return this._currentTime},set:function(e){K.equals(this._currentTime,e)||(this._clockStep===zr.SYSTEM_CLOCK&&(this._clockStep=zr.SYSTEM_CLOCK_MULTIPLIER),this._currentTime=e)}},multiplier:{get:function(){return this._multiplier},set:function(e){this._multiplier!==e&&(this._clockStep===zr.SYSTEM_CLOCK&&(this._clockStep=zr.SYSTEM_CLOCK_MULTIPLIER),this._multiplier=e)}},clockStep:{get:function(){return this._clockStep},set:function(e){e===zr.SYSTEM_CLOCK&&(this._multiplier=1,this._shouldAnimate=!0,this._currentTime=K.now()),this._clockStep=e}},shouldAnimate:{get:function(){return this._shouldAnimate},set:function(e){this._shouldAnimate!==e&&(this._clockStep===zr.SYSTEM_CLOCK&&(this._clockStep=zr.SYSTEM_CLOCK_MULTIPLIER),this._shouldAnimate=e)}}});YX.prototype.tick=function(){let e=xn(),t=K.clone(this._currentTime);if(this.canAnimate&&this._shouldAnimate){let n=this._clockStep;if(n===zr.SYSTEM_CLOCK)t=K.now(t);else{let i=this._multiplier;if(n===zr.TICK_DEPENDENT)t=K.addSeconds(t,i,t);else{let a=e-this._lastSystemTime;t=K.addSeconds(t,i*(a/1e3),t)}let r=this.clockRange,o=this.startTime,s=this.stopTime;if(r===As.CLAMPED)K.lessThan(t,o)?t=K.clone(o,t):K.greaterThan(t,s)&&(t=K.clone(s,t),this.onStop.raiseEvent(this));else if(r===As.LOOP_STOP)for(K.lessThan(t,o)&&(t=K.clone(o,t));K.greaterThan(t,s);)t=K.addSeconds(o,K.secondsDifference(t,s),t),this.onStop.raiseEvent(this)}}return this._currentTime=t,this._lastSystemTime=e,this.onTick.raiseEvent(this),t};var Xh=YX;function XX(){this._removalFunctions=[]}XX.prototype.add=function(e,t,n){let i=e.addEventListener(t,n);this._removalFunctions.push(i);let r=this;return function(){i();let o=r._removalFunctions;o.splice(o.indexOf(i),1)}};XX.prototype.removeAll=function(){let e=this._removalFunctions;for(let t=0,n=e.length;t<n;++t)e[t]();e.length=0};var jo=XX;function Q6e(e){let t,n=e.name,i=e.message;l(n)&&l(i)?t=`${n}: ${i}`:t=e.toString();let r=e.stack;return l(r)&&(t+=` +${r}`),t}var Fp=Q6e;function KX(e,t,n){this.heading=e??0,this.pitch=t??0,this.range=n??0}KX.clone=function(e,t){if(l(e))return l(t)||(t=new KX),t.heading=e.heading,t.pitch=e.pitch,t.range=e.range,t};var Od=KX;var eHe=Object.freeze({DONE:0,PENDING:1,FAILED:2}),Pt=eHe;function ql(){this._dataSources=[],this._dataSourceAdded=new be,this._dataSourceRemoved=new be,this._dataSourceMoved=new be}Object.defineProperties(ql.prototype,{length:{get:function(){return this._dataSources.length}},dataSourceAdded:{get:function(){return this._dataSourceAdded}},dataSourceRemoved:{get:function(){return this._dataSourceRemoved}},dataSourceMoved:{get:function(){return this._dataSourceMoved}}});ql.prototype.add=function(e){let t=this,n=this._dataSources;return Promise.resolve(e).then(function(i){return n===t._dataSources&&(t._dataSources.push(i),t._dataSourceAdded.raiseEvent(t,i)),i})};ql.prototype.remove=function(e,t){t=t??!1;let n=this._dataSources.indexOf(e);return n!==-1?(this._dataSources.splice(n,1),this._dataSourceRemoved.raiseEvent(this,e),t&&typeof e.destroy=="function"&&e.destroy(),!0):!1};ql.prototype.removeAll=function(e){e=e??!1;let t=this._dataSources;for(let n=0,i=t.length;n<i;++n){let r=t[n];this._dataSourceRemoved.raiseEvent(this,r),e&&typeof r.destroy=="function"&&r.destroy()}this._dataSources=[]};ql.prototype.contains=function(e){return this.indexOf(e)!==-1};ql.prototype.indexOf=function(e){return this._dataSources.indexOf(e)};ql.prototype.get=function(e){return this._dataSources[e]};ql.prototype.getByName=function(e){return this._dataSources.filter(function(t){return t.name===e})};function _6(e,t){return e.indexOf(t)}function Ohe(e,t,n){let i=e._dataSources,r=i.length-1;if(t=D.clamp(t,0,r),n=D.clamp(n,0,r),t===n)return;let o=i[t];i[t]=i[n],i[n]=o,e.dataSourceMoved.raiseEvent(o,n,t)}ql.prototype.raise=function(e){let t=_6(this._dataSources,e);Ohe(this,t,t+1)};ql.prototype.lower=function(e){let t=_6(this._dataSources,e);Ohe(this,t,t-1)};ql.prototype.raiseToTop=function(e){let t=_6(this._dataSources,e);t!==this._dataSources.length-1&&(this._dataSources.splice(t,1),this._dataSources.push(e),this.dataSourceMoved.raiseEvent(e,this._dataSources.length-1,t))};ql.prototype.lowerToBottom=function(e){let t=_6(this._dataSources,e);t!==0&&(this._dataSources.splice(t,1),this._dataSources.splice(0,0,e),this.dataSourceMoved.raiseEvent(e,0,t))};ql.prototype.isDestroyed=function(){return!1};ql.prototype.destroy=function(){return this.removeAll(!0),le(this)};var DM=ql;var $X=class{constructor(t){t=t??H.EMPTY_OBJECT,this._ellipsoid=t.ellipsoid??ee.default,this._rectangle=t.rectangle??ie.MAX_VALUE,this._projection=new Ui(this._ellipsoid),this._numberOfLevelZeroTilesX=t.numberOfLevelZeroTilesX??2,this._numberOfLevelZeroTilesY=t.numberOfLevelZeroTilesY??1}get ellipsoid(){return this._ellipsoid}get rectangle(){return this._rectangle}get projection(){return this._projection}getNumberOfXTilesAtLevel(t){return this._numberOfLevelZeroTilesX<<t}getNumberOfYTilesAtLevel(t){return this._numberOfLevelZeroTilesY<<t}rectangleToNativeRectangle(t,n){let i=D.toDegrees(t.west),r=D.toDegrees(t.south),o=D.toDegrees(t.east),s=D.toDegrees(t.north);return l(n)?(n.west=i,n.south=r,n.east=o,n.north=s,n):new ie(i,r,o,s)}tileXYToNativeRectangle(t,n,i,r){let o=this.tileXYToRectangle(t,n,i,r);return o.west=D.toDegrees(o.west),o.south=D.toDegrees(o.south),o.east=D.toDegrees(o.east),o.north=D.toDegrees(o.north),o}tileXYToRectangle(t,n,i,r){let o=this._rectangle,s=this.getNumberOfXTilesAtLevel(i),a=this.getNumberOfYTilesAtLevel(i),c=o.width/s,u=t*c+o.west,f=(t+1)*c+o.west,d=o.height/a,p=o.north-n*d,g=o.north-(n+1)*d;return l(r)||(r=new ie(u,g,f,p)),r.west=u,r.south=g,r.east=f,r.north=p,r}positionToTileXY(t,n,i){let r=this._rectangle;if(!ie.contains(r,t))return;let o=this.getNumberOfXTilesAtLevel(n),s=this.getNumberOfYTilesAtLevel(n),a=r.width/o,c=r.height/s,u=t.longitude;r.east<r.west&&(u+=D.TWO_PI);let f=(u-r.west)/a|0;f>=o&&(f=o-1);let d=(r.north-t.latitude)/c|0;return d>=s&&(d=s-1),l(i)?(i.x=f,i.y=d,i):new U(f,d)}},Qi=$X;var Mhe=new h,Nhe=new h,Lhe=new he,JX=new h,tHe=new h,Fhe=new ue,nHe=new Qi,RM=[new he,new he,new he,new he],OM=new U,zs={};zs.initialize=function(){let e=zs._initPromise;return l(e)||(e=De.fetchJson(Zt("Assets/approximateTerrainHeights.json")).then(function(t){zs._terrainHeights=t}),zs._initPromise=e),e};zs.getMinimumMaximumHeights=function(e,t){t=t??ee.default;let n=Bhe(e),i=zs._defaultMinTerrainHeight,r=zs._defaultMaxTerrainHeight;if(l(n)){let o=`${n.level}-${n.x}-${n.y}`,s=zs._terrainHeights[o];l(s)&&(i=s[0],r=s[1]),t.cartographicToCartesian(ie.northeast(e,Lhe),Mhe),t.cartographicToCartesian(ie.southwest(e,Lhe),Nhe),h.midpoint(Nhe,Mhe,JX);let a=t.scaleToGeodeticSurface(JX,tHe);if(l(a)){let c=h.distance(JX,a);i=Math.min(i,-c)}else i=zs._defaultMinTerrainHeight}return i=Math.max(zs._defaultMinTerrainHeight,i),{minimumTerrainHeight:i,maximumTerrainHeight:r}};zs.getBoundingSphere=function(e,t){t=t??ee.default;let n=Bhe(e),i=zs._defaultMaxTerrainHeight;if(l(n)){let o=`${n.level}-${n.x}-${n.y}`,s=zs._terrainHeights[o];l(s)&&(i=s[1])}let r=ue.fromRectangle3D(e,t,0);return ue.fromRectangle3D(e,t,i,Fhe),ue.union(r,Fhe,r)};function Bhe(e){he.fromRadians(e.east,e.north,0,RM[0]),he.fromRadians(e.west,e.north,0,RM[1]),he.fromRadians(e.east,e.south,0,RM[2]),he.fromRadians(e.west,e.south,0,RM[3]);let t=0,n=0,i=0,r=0,o=zs._terrainHeightsMaxLevel,s;for(s=0;s<=o;++s){let a=!1;for(let c=0;c<4;++c){let u=RM[c];if(nHe.positionToTileXY(u,s,OM),c===0)i=OM.x,r=OM.y;else if(i!==OM.x||r!==OM.y){a=!0;break}}if(a)break;t=i,n=r}if(s!==0)return{x:t,y:n,level:s>o?o:s-1}}zs._terrainHeightsMaxLevel=6;zs._defaultMaxTerrainHeight=9e3;zs._defaultMinTerrainHeight=-1e5;zs._terrainHeights=void 0;zs._initPromise=void 0;Object.defineProperties(zs,{initialized:{get:function(){return l(zs._terrainHeights)}}});var Mi=zs;function iHe(e){e=e??H.EMPTY_OBJECT,this.geometry=e.geometry,this.modelMatrix=N.clone(e.modelMatrix??N.IDENTITY),this.id=e.id,this.pickPrimitive=e.pickPrimitive,this.attributes=e.attributes??{},this.westHemisphereGeometry=void 0,this.eastHemisphereGeometry=void 0}var Ft=iHe;function rHe(e){e=e??H.EMPTY_OBJECT,this.componentDatatype=e.componentDatatype,this.componentsPerAttribute=e.componentsPerAttribute,this.normalize=e.normalize??!1,this.value=e.value}var Zc=rHe;var khe={NONE:0,GEODESIC:1,RHUMB:2};Object.freeze(khe);var ln=khe;var Uhe=D.EPSILON10;function oHe(e,t,n,i){if(!l(e))return;n=n??!1;let r=l(i),o=e.length;if(o<2)return e;let s,a=e[0],c,u,f=0,d=-1;for(s=1;s<o;++s)c=e[s],t(a,c,Uhe)?(l(u)||(u=e.slice(0,s),f=s-1,d=0),r&&i.push(s)):(l(u)&&(u.push(c),f=s,r&&(d=i.length)),a=c);return n&&t(e[0],e[o-1],Uhe)&&(r&&(l(u)?i.splice(d,0,f):i.push(o-1)),l(u)?u.length-=1:u=e.slice(0,-1)),l(u)?u:e}var Fr=oHe;function sHe(e){let t=e._uSquared,n=e._ellipsoid.maximumRadius,i=e._ellipsoid.minimumRadius,r=(n-i)/n,o=Math.cos(e._startHeading),s=Math.sin(e._startHeading),a=(1-r)*Math.tan(e._start.latitude),c=1/Math.sqrt(1+a*a),u=c*a,f=Math.atan2(a,o),d=c*s,p=d*d,g=1-p,m=Math.sqrt(g),y=t/4,A=y*y,b=A*y,x=A*A,T=1+y-3*A/4+5*b/4-175*x/64,E=1-y+15*A/8-35*b/8,v=1-3*y+35*A/4,S=1-5*y,I=T*f-E*Math.sin(2*f)*y/2-v*Math.sin(4*f)*A/16-S*Math.sin(6*f)*b/48-Math.sin(8*f)*5*x/512,R=e._constants;R.a=n,R.b=i,R.f=r,R.cosineHeading=o,R.sineHeading=s,R.tanU=a,R.cosineU=c,R.sineU=u,R.sigma=f,R.sineAlpha=d,R.sineSquaredAlpha=p,R.cosineSquaredAlpha=g,R.cosineAlpha=m,R.u2Over4=y,R.u4Over16=A,R.u6Over64=b,R.u8Over256=x,R.a0=T,R.a1=E,R.a2=v,R.a3=S,R.distanceRatio=I}function aHe(e,t){return e*t*(4+e*(4-3*t))/16}function zhe(e,t,n,i,r,o,s){let a=aHe(e,n);return(1-a)*e*t*(i+a*r*(s+a*o*(2*s*s-1)))}function cHe(e,t,n,i,r,o,s){let a=(t-n)/t,c=o-i,u=Math.atan((1-a)*Math.tan(r)),f=Math.atan((1-a)*Math.tan(s)),d=Math.cos(u),p=Math.sin(u),g=Math.cos(f),m=Math.sin(f),y=d*g,A=d*m,b=p*m,x=p*g,T=c,E,v,S,I,R,O,L,_;do{v=Math.cos(T),S=Math.sin(T);let k=A-x*v;O=Math.sqrt(g*g*S*S+k*k),R=b+y*v,I=Math.atan2(O,R);let G;O===0?(G=0,L=1):(G=y*S/O,L=1-G*G),E=T,_=R-2*b/L,isFinite(_)||(_=0),T=c+zhe(a,G,L,I,O,R,_)}while(Math.abs(T-E)>D.EPSILON12);let C=L*(t*t-n*n)/(n*n),w=1+C*(4096+C*(C*(320-175*C)-768))/16384,P=C*(256+C*(C*(74-47*C)-128))/1024,M=_*_,F=P*O*(_+P*(R*(2*M-1)-P*_*(4*O*O-3)*(4*M-3)/6)/4),V=n*w*(I-F),B=Math.atan2(g*S,A-x*v),j=Math.atan2(d*S,A*v-x);e._distance=V,e._startHeading=B,e._endHeading=j,e._uSquared=C}var lHe=new h,ZX=new h;function Vhe(e,t,n,i){let r=h.normalize(i.cartographicToCartesian(t,ZX),lHe),o=h.normalize(i.cartographicToCartesian(n,ZX),ZX);cHe(e,i.maximumRadius,i.minimumRadius,t.longitude,t.latitude,n.longitude,n.latitude),e._start=he.clone(t,e._start),e._end=he.clone(n,e._end),e._start.height=0,e._end.height=0,sHe(e)}function MM(e,t,n){let i=n??ee.default;this._ellipsoid=i,this._start=new he,this._end=new he,this._constants={},this._startHeading=void 0,this._endHeading=void 0,this._distance=void 0,this._uSquared=void 0,l(e)&&l(t)&&Vhe(this,e,t,i)}Object.defineProperties(MM.prototype,{ellipsoid:{get:function(){return this._ellipsoid}},surfaceDistance:{get:function(){return this._distance}},start:{get:function(){return this._start}},end:{get:function(){return this._end}},startHeading:{get:function(){return this._startHeading}},endHeading:{get:function(){return this._endHeading}}});MM.prototype.setEndPoints=function(e,t){Vhe(this,e,t,this._ellipsoid)};MM.prototype.interpolateUsingFraction=function(e,t){return this.interpolateUsingSurfaceDistance(this._distance*e,t)};MM.prototype.interpolateUsingSurfaceDistance=function(e,t){let n=this._constants,i=n.distanceRatio+e/n.b,r=Math.cos(2*i),o=Math.cos(4*i),s=Math.cos(6*i),a=Math.sin(2*i),c=Math.sin(4*i),u=Math.sin(6*i),f=Math.sin(8*i),d=i*i,p=i*d,g=n.u8Over256,m=n.u2Over4,y=n.u6Over64,A=n.u4Over16,b=2*p*g*r/3+i*(1-m+7*A/4-15*y/4+579*g/64-(A-15*y/4+187*g/16)*r-(5*y/4-115*g/16)*o-29*g*s/16)+(m/2-A+71*y/32-85*g/16)*a+(5*A/16-5*y/4+383*g/96)*c-d*((y-11*g/2)*a+5*g*c/2)+(29*y/96-29*g/16)*u+539*g*f/1536,x=Math.asin(Math.sin(b)*n.cosineAlpha),T=Math.atan(n.a/n.b*Math.tan(x));b=b-n.sigma;let E=Math.cos(2*n.sigma+b),v=Math.sin(b),S=Math.cos(b),I=n.cosineU*S,R=n.sineU*v,L=Math.atan2(v*n.sineHeading,I-R*n.cosineHeading)-zhe(n.f,n.sineAlpha,n.cosineSquaredAlpha,b,v,S,E);return l(t)?(t.longitude=this._start.longitude+L,t.latitude=T,t.height=0,t):new he(this._start.longitude+L,T,0)};var gg=MM;function eK(e,t,n){if(e===0)return t*n;let i=e*e,r=i*i,o=r*i,s=o*i,a=s*i,c=a*i,u=n,f=Math.sin(2*u),d=Math.sin(4*u),p=Math.sin(6*u),g=Math.sin(8*u),m=Math.sin(10*u),y=Math.sin(12*u);return t*((1-i/4-3*r/64-5*o/256-175*s/16384-441*a/65536-4851*c/1048576)*u-(3*i/8+3*r/32+45*o/1024+105*s/4096+2205*a/131072+6237*c/524288)*f+(15*r/256+45*o/1024+525*s/16384+1575*a/65536+155925*c/8388608)*d-(35*o/3072+175*s/12288+3675*a/262144+13475*c/1048576)*p+(315*s/131072+2205*a/524288+43659*c/8388608)*g-(693*a/1310720+6237*c/5242880)*m+1001*c/8388608*y)}function uHe(e,t,n){let i=e/n;if(t===0)return i;let r=i*i,o=r*i,s=o*i,a=t,c=a*a,u=c*c,f=u*c,d=f*c,p=d*c,g=p*c,m=Math.sin(2*i),y=Math.cos(2*i),A=Math.sin(4*i),b=Math.cos(4*i),x=Math.sin(6*i),T=Math.cos(6*i),E=Math.sin(8*i),v=Math.cos(8*i),S=Math.sin(10*i),I=Math.cos(10*i),R=Math.sin(12*i);return i+i*c/4+7*i*u/64+15*i*f/256+579*i*d/16384+1515*i*p/65536+16837*i*g/1048576+(3*i*u/16+45*i*f/256-i*(32*r-561)*d/4096-i*(232*r-1677)*p/16384+i*(399985-90560*r+512*s)*g/5242880)*y+(21*i*f/256+483*i*d/4096-i*(224*r-1969)*p/16384-i*(33152*r-112599)*g/1048576)*b+(151*i*d/4096+4681*i*p/65536+1479*i*g/16384-453*o*g/32768)*T+(1097*i*p/65536+42783*i*g/1048576)*v+8011*i*g/1048576*I+(3*c/8+3*u/16+213*f/2048-3*r*f/64+255*d/4096-33*r*d/512+20861*p/524288-33*r*p/512+s*p/1024+28273*g/1048576-471*r*g/8192+9*s*g/4096)*m+(21*u/256+21*f/256+533*d/8192-21*r*d/512+197*p/4096-315*r*p/4096+584039*g/16777216-12517*r*g/131072+7*s*g/2048)*A+(151*f/6144+151*d/4096+5019*p/131072-453*r*p/16384+26965*g/786432-8607*r*g/131072)*x+(1097*d/131072+1097*p/65536+225797*g/10485760-1097*r*g/65536)*E+(8011*p/2621440+8011*g/1048576)*S+293393*g/251658240*R}function Mv(e,t){if(e===0)return Math.log(Math.tan(.5*(D.PI_OVER_TWO+t)));let n=e*Math.sin(t);return Math.log(Math.tan(.5*(D.PI_OVER_TWO+t)))-e/2*Math.log((1+n)/(1-n))}function fHe(e,t,n,i,r){let o=Mv(e._ellipticity,n),s=Mv(e._ellipticity,r);return Math.atan2(D.negativePiToPi(i-t),s-o)}function dHe(e,t,n,i,r,o,s){let a=e._heading,c=o-i,u;if(D.equalsEpsilon(Math.abs(a),D.PI_OVER_TWO,D.EPSILON8))if(t===n)u=t*Math.cos(r)*D.negativePiToPi(c);else{let f=Math.sin(r);u=t*Math.cos(r)*D.negativePiToPi(c)/Math.sqrt(1-e._ellipticitySquared*f*f)}else{let f=eK(e._ellipticity,t,r);u=(eK(e._ellipticity,t,s)-f)/Math.cos(a)}return Math.abs(u)}var hHe=new h,QX=new h;function jhe(e,t,n,i){let r=h.normalize(i.cartographicToCartesian(t,QX),hHe),o=h.normalize(i.cartographicToCartesian(n,QX),QX),s=i.maximumRadius,a=i.minimumRadius,c=s*s,u=a*a;e._ellipticitySquared=(c-u)/c,e._ellipticity=Math.sqrt(e._ellipticitySquared),e._start=he.clone(t,e._start),e._start.height=0,e._end=he.clone(n,e._end),e._end.height=0,e._heading=fHe(e,t.longitude,t.latitude,n.longitude,n.latitude),e._distance=dHe(e,i.maximumRadius,i.minimumRadius,t.longitude,t.latitude,n.longitude,n.latitude)}function Hhe(e,t,n,i,r,o){if(n===0)return he.clone(e,o);let s=r*r,a,c,u;if(Math.abs(D.PI_OVER_TWO-Math.abs(t))>D.EPSILON8){let f=eK(r,i,e.latitude),d=n*Math.cos(t),p=f+d;if(c=uHe(p,r,i),Math.abs(t)<D.EPSILON10)a=D.negativePiToPi(e.longitude);else{let g=Mv(r,e.latitude),m=Mv(r,c);u=Math.tan(t)*(m-g),a=D.negativePiToPi(e.longitude+u)}}else{c=e.latitude;let f;if(r===0)f=i*Math.cos(e.latitude);else{let d=Math.sin(e.latitude);f=i*Math.cos(e.latitude)/Math.sqrt(1-s*d*d)}u=n/f,t>0?a=D.negativePiToPi(e.longitude+u):a=D.negativePiToPi(e.longitude-u)}return l(o)?(o.longitude=a,o.latitude=c,o.height=0,o):new he(a,c,0)}function _g(e,t,n){let i=n??ee.default;this._ellipsoid=i,this._start=new he,this._end=new he,this._heading=void 0,this._distance=void 0,this._ellipticity=void 0,this._ellipticitySquared=void 0,l(e)&&l(t)&&jhe(this,e,t,i)}Object.defineProperties(_g.prototype,{ellipsoid:{get:function(){return this._ellipsoid}},surfaceDistance:{get:function(){return this._distance}},start:{get:function(){return this._start}},end:{get:function(){return this._end}},heading:{get:function(){return this._heading}}});_g.fromStartHeadingDistance=function(e,t,n,i,r){let o=i??ee.default,s=o.maximumRadius,a=o.minimumRadius,c=s*s,u=a*a,f=Math.sqrt((c-u)/c);t=D.negativePiToPi(t);let d=Hhe(e,t,n,o.maximumRadius,f);return!l(r)||l(i)&&!i.equals(r.ellipsoid)?new _g(e,d,o):(r.setEndPoints(e,d),r)};_g.prototype.setEndPoints=function(e,t){jhe(this,e,t,this._ellipsoid)};_g.prototype.interpolateUsingFraction=function(e,t){return this.interpolateUsingSurfaceDistance(e*this._distance,t)};_g.prototype.interpolateUsingSurfaceDistance=function(e,t){return Hhe(this._start,this._heading,e,this._ellipsoid.maximumRadius,this._ellipticity,t)};_g.prototype.findIntersectionWithLongitude=function(e,t){let n=this._ellipticity,i=this._heading,r=Math.abs(i),o=this._start;if(e=D.negativePiToPi(e),D.equalsEpsilon(Math.abs(e),Math.PI,D.EPSILON14)&&(e=D.sign(o.longitude)*Math.PI),l(t)||(t=new he),Math.abs(D.PI_OVER_TWO-r)<=D.EPSILON8)return t.longitude=e,t.latitude=o.latitude,t.height=0,t;if(D.equalsEpsilon(Math.abs(D.PI_OVER_TWO-r),D.PI_OVER_TWO,D.EPSILON8))return D.equalsEpsilon(e,o.longitude,D.EPSILON12)?void 0:(t.longitude=e,t.latitude=D.PI_OVER_TWO*D.sign(D.PI_OVER_TWO-i),t.height=0,t);let s=o.latitude,a=n*Math.sin(s),c=Math.tan(.5*(D.PI_OVER_TWO+s))*Math.exp((e-o.longitude)/Math.tan(i)),u=(1+a)/(1-a),f=o.latitude,d;do{d=f;let p=n*Math.sin(d),g=(1+p)/(1-p);f=2*Math.atan(c*Math.pow(g/u,n/2))-D.PI_OVER_TWO}while(!D.equalsEpsilon(f,d,D.EPSILON12));return t.longitude=e,t.latitude=f,t.height=0,t};_g.prototype.findIntersectionWithLatitude=function(e,t){let n=this._ellipticity,i=this._heading,r=this._start;if(D.equalsEpsilon(Math.abs(i),D.PI_OVER_TWO,D.EPSILON8))return;let o=Mv(n,r.latitude),s=Mv(n,e),a=Math.tan(i)*(s-o),c=D.negativePiToPi(r.longitude+a);return l(t)?(t.longitude=c,t.latitude=e,t.height=0,t):new he(c,e,0)};var Dc=_g;var NM=class e{constructor(t){this._ellipsoid=t??ee.WGS84,this._semimajorAxis=this._ellipsoid.maximumRadius,this._oneOverSemimajorAxis=1/this._semimajorAxis}get ellipsoid(){return this._ellipsoid}static mercatorAngleToGeodeticLatitude(t){return D.PI_OVER_TWO-2*Math.atan(Math.exp(-t))}static geodeticLatitudeToMercatorAngle(t){t>e.MaximumLatitude?t=e.MaximumLatitude:t<-e.MaximumLatitude&&(t=-e.MaximumLatitude);let n=Math.sin(t);return .5*Math.log((1+n)/(1-n))}project(t,n){let i=this._semimajorAxis,r=t.longitude*i,o=e.geodeticLatitudeToMercatorAngle(t.latitude)*i,s=t.height;return l(n)?(n.x=r,n.y=o,n.z=s,n):new h(r,o,s)}unproject(t,n){let i=this._oneOverSemimajorAxis,r=t.x*i,o=e.mercatorAngleToGeodeticLatitude(t.y*i),s=t.z;return l(n)?(n.longitude=r,n.latitude=o,n.height=s,n):new he(r,o,s)}};NM.MaximumLatitude=NM.mercatorAngleToGeodeticLatitude(Math.PI);var yi=NM;var cK=[Ui,yi],mHe=cK.length,lme=Math.cos(D.toRadians(30)),Ghe=Math.cos(D.toRadians(150)),ume=0,fme=1e3;function Gy(e){e=e??H.EMPTY_OBJECT;let t=e.positions;this.width=e.width??1,this._positions=t,this.granularity=e.granularity??9999,this.loop=e.loop??!1,this.arcType=e.arcType??ln.GEODESIC,this._ellipsoid=ee.default,this._projectionIndex=0,this._workerName="createGroundPolylineGeometry",this._scene3DOnly=!1}Object.defineProperties(Gy.prototype,{packedLength:{get:function(){return 1+this._positions.length*3+1+1+1+ee.packedLength+1+1}}});Gy.setProjectionAndEllipsoid=function(e,t){let n=0;for(let i=0;i<mHe;i++)if(t instanceof cK[i]){n=i;break}e._projectionIndex=n,e._ellipsoid=t.ellipsoid};var pHe=new h,Whe=new h,qhe=new h;function aK(e,t,n,i,r){let o=Yl(i,e,0,pHe),s=Yl(i,e,n,Whe),a=Yl(i,t,0,qhe),c=yg(s,o,Whe),u=yg(a,o,qhe);return h.cross(u,c,r),h.normalize(r,r)}var gHe=new he,_He=new h,yHe=new h,AHe=new h;function tK(e,t,n,i,r,o,s,a,c,u,f){if(r===0)return;let d;o===ln.GEODESIC?d=new gg(e,t,s):o===ln.RHUMB&&(d=new Dc(e,t,s));let p=d.surfaceDistance;if(p<r)return;let g=aK(e,t,i,s,AHe),m=Math.ceil(p/r),y=p/m,A=y,b=m-1,x=a.length;for(let T=0;T<b;T++){let E=d.interpolateUsingSurfaceDistance(A,gHe),v=Yl(s,E,n,_He),S=Yl(s,E,i,yHe);h.pack(g,a,x),h.pack(v,c,x),h.pack(S,u,x),f.push(E.latitude),f.push(E.longitude),x+=3,A+=y}}var nK=new he;function Yl(e,t,n,i){return he.clone(t,nK),nK.height=n,he.toCartesian(nK,e,i)}Gy.pack=function(e,t,n){let i=n??0,r=e._positions,o=r.length;t[i++]=o;for(let s=0;s<o;++s){let a=r[s];h.pack(a,t,i),i+=3}return t[i++]=e.granularity,t[i++]=e.loop?1:0,t[i++]=e.arcType,ee.pack(e._ellipsoid,t,i),i+=ee.packedLength,t[i++]=e._projectionIndex,t[i]=e._scene3DOnly?1:0,t};Gy.unpack=function(e,t,n){let i=t??0,r=e[i++],o=new Array(r);for(let p=0;p<r;p++)o[p]=h.unpack(e,i),i+=3;let s=e[i++],a=e[i++]===1,c=e[i++],u=ee.unpack(e,i);i+=ee.packedLength;let f=e[i++],d=e[i]===1;return l(n)||(n=new Gy({positions:o})),n._positions=o,n.granularity=s,n.loop=a,n.arcType=c,n._ellipsoid=u,n._projectionIndex=f,n._scene3DOnly=d,n};function yg(e,t,n){return h.subtract(e,t,n),h.normalize(n,n),n}function Yhe(e,t,n,i){return i=yg(e,t,i),i=h.cross(i,n,i),i=h.normalize(i,i),i=h.cross(n,i,i),i}var bHe=new h,xHe=new h,THe=new h,dme=new h,EHe=0,CHe=-1;function iK(e,t,n,i,r){let o=yg(n,t,dme),s=Yhe(e,t,o,bHe),a=Yhe(i,t,o,xHe);if(D.equalsEpsilon(h.dot(s,a),CHe,D.EPSILON5))return r=h.cross(o,s,r),r=h.normalize(r,r),r;r=h.add(a,s,r),r=h.normalize(r,r);let c=h.cross(o,r,THe);return h.dot(a,c)<EHe&&(r=h.negate(r,r)),r}var x6=sn.fromPointNormal(h.ZERO,h.UNIT_Y),vHe=new h,SHe=new h,wHe=new h,IHe=new h,PHe=new h,y6=new h,A6=new he,Xhe=new he,Khe=new he;Gy.createGeometry=function(e){let t=!e._scene3DOnly,n=e.loop,i=e._ellipsoid,r=e.granularity,o=e.arcType,s=new cK[e._projectionIndex](i),a=ume,c=fme,u,f,d=e._positions,p=d.length;p===2&&(n=!1);let g,m,y,A,b=new Dc(void 0,void 0,i),x,T,E,v=[d[0]];for(f=0;f<p-1;f++)g=d[f],m=d[f+1],x=_i.lineSegmentPlane(g,m,x6,y6),l(x)&&!h.equalsEpsilon(x,g,D.EPSILON7)&&!h.equalsEpsilon(x,m,D.EPSILON7)&&(e.arcType===ln.GEODESIC?v.push(h.clone(x)):e.arcType===ln.RHUMB&&(E=i.cartesianToCartographic(x,A6).longitude,y=i.cartesianToCartographic(g,A6),A=i.cartesianToCartographic(m,Xhe),b.setEndPoints(y,A),T=b.findIntersectionWithLongitude(E,Khe),x=i.cartographicToCartesian(T,y6),l(x)&&!h.equalsEpsilon(x,g,D.EPSILON7)&&!h.equalsEpsilon(x,m,D.EPSILON7)&&v.push(h.clone(x)))),v.push(m);n&&(g=d[p-1],m=d[0],x=_i.lineSegmentPlane(g,m,x6,y6),l(x)&&!h.equalsEpsilon(x,g,D.EPSILON7)&&!h.equalsEpsilon(x,m,D.EPSILON7)&&(e.arcType===ln.GEODESIC?v.push(h.clone(x)):e.arcType===ln.RHUMB&&(E=i.cartesianToCartographic(x,A6).longitude,y=i.cartesianToCartographic(g,A6),A=i.cartesianToCartographic(m,Xhe),b.setEndPoints(y,A),T=b.findIntersectionWithLongitude(E,Khe),x=i.cartographicToCartesian(T,y6),l(x)&&!h.equalsEpsilon(x,g,D.EPSILON7)&&!h.equalsEpsilon(x,m,D.EPSILON7)&&v.push(h.clone(x)))));let S=v.length,I=new Array(S);for(f=0;f<S;f++){let q=he.fromCartesian(v[f],i);q.height=0,I[f]=q}if(I=Fr(I,he.equalsEpsilon),S=I.length,S<2)return;let R=[],O=[],L=[],_=[],C=vHe,w=SHe,P=wHe,M=IHe,F=PHe,V=I[0],B=I[1],j=I[S-1];for(C=Yl(i,j,a,C),M=Yl(i,B,a,M),w=Yl(i,V,a,w),P=Yl(i,V,c,P),n?F=iK(C,w,P,M,F):F=aK(V,B,c,i,F),h.pack(F,O,0),h.pack(w,L,0),h.pack(P,_,0),R.push(V.latitude),R.push(V.longitude),tK(V,B,a,c,r,o,i,O,L,_,R),f=1;f<S-1;++f){C=h.clone(w,C),w=h.clone(M,w);let q=I[f];Yl(i,q,c,P),Yl(i,I[f+1],a,M),iK(C,w,P,M,F),u=O.length,h.pack(F,O,u),h.pack(w,L,u),h.pack(P,_,u),R.push(q.latitude),R.push(q.longitude),tK(I[f],I[f+1],a,c,r,o,i,O,L,_,R)}let k=I[S-1],G=I[S-2];if(w=Yl(i,k,a,w),P=Yl(i,k,c,P),n){let q=I[0];C=Yl(i,G,a,C),M=Yl(i,q,a,M),F=iK(C,w,P,M,F)}else F=aK(G,k,c,i,F);if(u=O.length,h.pack(F,O,u),h.pack(w,L,u),h.pack(P,_,u),R.push(k.latitude),R.push(k.longitude),n){for(tK(k,V,a,c,r,o,i,O,L,_,R),u=O.length,f=0;f<3;++f)O[u+f]=O[f],L[u+f]=L[f],_[u+f]=_[f];R.push(V.latitude),R.push(V.longitude)}return tGe(n,s,L,_,O,R,t)};var DHe=new h,RHe=new $,OHe=new Le;function $he(e,t,n,i){let r=yg(n,t,DHe),o=h.dot(r,e);if(o>lme||o<Ghe){let s=yg(i,n,dme),a=o<Ghe?D.PI_OVER_TWO:-D.PI_OVER_TWO,c=Le.fromAxisAngle(s,a,OHe),u=$.fromQuaternion(c,RHe);return $.multiplyByVector(u,e,e),!0}return!1}var Jhe=new he,MHe=new h,Zhe=new h;function LM(e,t,n,i,r){let o=he.toCartesian(t,e._ellipsoid,MHe),s=h.add(o,n,Zhe),a=!1,c=e._ellipsoid,u=c.cartesianToCartographic(s,Jhe);Math.abs(t.longitude-u.longitude)>D.PI_OVER_TWO&&(a=!0,s=h.subtract(o,n,Zhe),u=c.cartesianToCartographic(s,Jhe)),u.height=0;let f=e.project(u,r);return r=h.subtract(f,i,r),r.z=0,r=h.normalize(r,r),a&&h.negate(r,r),r}var NHe=new h,Qhe=new h;function eme(e,t,n,i,r,o){let s=h.subtract(t,e,NHe);h.normalize(s,s);let a=n-ume,c=h.multiplyByScalar(s,a,Qhe);h.add(e,c,r);let u=i-fme;c=h.multiplyByScalar(s,u,Qhe),h.add(t,c,o)}var LHe=new h;function b6(e,t){let n=sn.getPointDistance(x6,e),i=sn.getPointDistance(x6,t),r=LHe;D.equalsEpsilon(n,0,D.EPSILON2)?(r=yg(t,e,r),h.multiplyByScalar(r,D.EPSILON2,r),h.add(e,r,e)):D.equalsEpsilon(i,0,D.EPSILON2)&&(r=yg(e,t,r),h.multiplyByScalar(r,D.EPSILON2,r),h.add(t,r,t))}function FHe(e,t){let n=Math.abs(e.longitude),i=Math.abs(t.longitude);if(D.equalsEpsilon(n,D.PI,D.EPSILON11)){let r=D.sign(t.longitude);return e.longitude=r*(n-D.EPSILON11),1}else if(D.equalsEpsilon(i,D.PI,D.EPSILON11)){let r=D.sign(e.longitude);return t.longitude=r*(i-D.EPSILON11),2}return 0}var hme=new he,mme=new he,tme=new h,rK=new h,nme=new h,ime=new h,BHe=new h,rme=new h,kHe=[hme,mme],UHe=new ie,zHe=new h,VHe=new h,jHe=new h,HHe=new h,GHe=new h,WHe=new h,oK=new h,sK=new h,qHe=new h,YHe=new h,XHe=new h,ome=new h,KHe=new h,$He=new h,JHe=new Sn,ZHe=new Sn,sme=new h,QHe=new h,ame=new h,eGe=[new ue,new ue],pme=[0,2,1,0,3,2,0,7,3,0,4,7,0,5,4,0,1,5,5,7,4,5,6,7,5,2,6,5,1,2,3,6,2,3,7,6],cme=pme.length;function tGe(e,t,n,i,r,o,s){let a,c,u=t._ellipsoid,f=n.length/3-1,d=f*8,p=d*4,g=f*36,m=d>65535?new Uint32Array(g):new Uint16Array(g),y=new Float64Array(d*3),A=new Float32Array(p),b=new Float32Array(p),x=new Float32Array(p),T=new Float32Array(p),E=new Float32Array(p),v,S,I,R;s&&(v=new Float32Array(p),S=new Float32Array(p),I=new Float32Array(p),R=new Float32Array(d*2));let O=o.length/2,L=0,_=hme;_.height=0;let C=mme;C.height=0;let w=tme,P=rK;if(s)for(c=0,a=1;a<O;a++)_.latitude=o[c],_.longitude=o[c+1],C.latitude=o[c+2],C.longitude=o[c+3],w=t.project(_,w),P=t.project(C,P),L+=h.distance(w,P),c+=2;let M=i.length/3;P=h.unpack(i,0,P);let F=0;for(c=3,a=1;a<M;a++)w=h.clone(P,w),P=h.unpack(i,c,P),F+=h.distance(w,P),c+=3;let V;c=3;let B=0,j=0,k=0,G=0,q=!1,Q=h.unpack(n,0,ime),W=h.unpack(i,0,rK),J=h.unpack(r,0,rme);if(e){let Se=h.unpack(n,n.length-6,nme);$he(J,Se,Q,W)&&(J=h.negate(J,J))}let Z=0,ae=0,Ae=0;for(a=0;a<f;a++){let Se=h.clone(Q,nme),Re=h.clone(W,tme),Qe=h.clone(J,BHe);q&&(Qe=h.negate(Qe,Qe)),Q=h.unpack(n,c,ime),W=h.unpack(i,c,rK),J=h.unpack(r,c,rme),q=$he(J,Se,Q,W),_.latitude=o[B],_.longitude=o[B+1],C.latitude=o[B+2],C.longitude=o[B+3];let He,Xe,$e,Pe;if(s){let gi=FHe(_,C);He=t.project(_,GHe),Xe=t.project(C,WHe);let ho=yg(Xe,He,sme);ho.y=Math.abs(ho.y),$e=oK,Pe=sK,gi===0||h.dot(ho,h.UNIT_Y)>lme?($e=LM(t,_,Qe,He,oK),Pe=LM(t,C,J,Xe,sK)):gi===1?(Pe=LM(t,C,J,Xe,sK),$e.x=0,$e.y=D.sign(_.longitude-Math.abs(C.longitude)),$e.z=0):($e=LM(t,_,Qe,He,oK),Pe.x=0,Pe.y=D.sign(_.longitude-C.longitude),Pe.z=0)}let qe=h.distance(Re,W),st=Sn.fromCartesian(Se,JHe),vt=h.subtract(Q,Se,qHe),Gt=h.normalize(vt,ome),lt=h.subtract(Re,Se,YHe);lt=h.normalize(lt,lt);let mt=h.cross(Gt,lt,ome);mt=h.normalize(mt,mt);let ft=h.cross(lt,Qe,KHe);ft=h.normalize(ft,ft);let Xt=h.subtract(W,Q,XHe);Xt=h.normalize(Xt,Xt);let rt=h.cross(J,Xt,$He);rt=h.normalize(rt,rt);let ht=qe/F,Bi=Z/F,Xn=0,bi,Wi,wi,hi=0,xi=0;if(s){Xn=h.distance(He,Xe),bi=Sn.fromCartesian(He,ZHe),Wi=h.subtract(Xe,He,sme),wi=h.normalize(Wi,QHe);let gi=wi.x;wi.x=wi.y,wi.y=-gi,hi=Xn/L,xi=ae/L}for(V=0;V<8;V++){let gi=G+V*4,ho=j+V*2,ur=gi+3,Zo=V<4?1:-1,Bn=V===2||V===3||V===6||V===7?1:-1;h.pack(st.high,A,gi),A[ur]=vt.x,h.pack(st.low,b,gi),b[ur]=vt.y,h.pack(ft,x,gi),x[ur]=vt.z,h.pack(rt,T,gi),T[ur]=ht*Zo,h.pack(mt,E,gi);let qi=Bi*Bn;qi===0&&Bn<0&&(qi=9),E[ur]=qi,s&&(v[gi]=bi.high.x,v[gi+1]=bi.high.y,v[gi+2]=bi.low.x,v[gi+3]=bi.low.y,I[gi]=-$e.y,I[gi+1]=$e.x,I[gi+2]=Pe.y,I[gi+3]=-Pe.x,S[gi]=Wi.x,S[gi+1]=Wi.y,S[gi+2]=wi.x,S[gi+3]=wi.y,R[ho]=hi*Zo,qi=xi*Bn,qi===0&&Bn<0&&(qi=9),R[ho+1]=qi)}let jn=jHe,nn=HHe,Wn=zHe,Zi=VHe,Mr=ie.fromCartographicArray(kHe,UHe),fo=Mi.getMinimumMaximumHeights(Mr,u),Bs=fo.minimumTerrainHeight,Ks=fo.maximumTerrainHeight;Ae+=Math.abs(Bs),Ae+=Math.abs(Ks),eme(Se,Re,Bs,Ks,jn,Wn),eme(Q,W,Bs,Ks,nn,Zi);let no=h.multiplyByScalar(mt,D.EPSILON5,ame);h.add(jn,no,jn),h.add(nn,no,nn),h.add(Wn,no,Wn),h.add(Zi,no,Zi),b6(jn,nn),b6(Wn,Zi),h.pack(jn,y,k),h.pack(nn,y,k+3),h.pack(Zi,y,k+6),h.pack(Wn,y,k+9),no=h.multiplyByScalar(mt,-2*D.EPSILON5,ame),h.add(jn,no,jn),h.add(nn,no,nn),h.add(Wn,no,Wn),h.add(Zi,no,Zi),b6(jn,nn),b6(Wn,Zi),h.pack(jn,y,k+12),h.pack(nn,y,k+15),h.pack(Zi,y,k+18),h.pack(Wn,y,k+21),B+=2,c+=3,j+=16,k+=24,G+=32,Z+=qe,ae+=Xn}c=0;let fe=0;for(a=0;a<f;a++){for(V=0;V<cme;V++)m[c+V]=pme[V]+fe;fe+=8,c+=cme}let xe=eGe;ue.fromVertices(n,h.ZERO,3,xe[0]),ue.fromVertices(i,h.ZERO,3,xe[1]);let ge=ue.fromBoundingSpheres(xe);ge.radius+=Ae/(f*2);let we={position:new Ne({componentDatatype:Y.DOUBLE,componentsPerAttribute:3,normalize:!1,values:y}),startHiAndForwardOffsetX:Hy(A),startLoAndForwardOffsetY:Hy(b),startNormalAndForwardOffsetZ:Hy(x),endNormalAndTextureCoordinateNormalizationX:Hy(T),rightNormalAndTextureCoordinateNormalizationY:Hy(E)};return s&&(we.startHiLo2D=Hy(v),we.offsetAndRight2D=Hy(S),we.startEndNormals2D=Hy(I),we.texcoordNormalization2D=new Ne({componentDatatype:Y.FLOAT,componentsPerAttribute:2,normalize:!1,values:R})),new St({attributes:we,indices:m,boundingSphere:ge})}function Hy(e){return new Ne({componentDatatype:Y.FLOAT,componentsPerAttribute:4,normalize:!1,values:e})}Gy._projectNormal=LM;var vx=Gy;var gme={ADD:te.FUNC_ADD,SUBTRACT:te.FUNC_SUBTRACT,REVERSE_SUBTRACT:te.FUNC_REVERSE_SUBTRACT,MIN:te.MIN,MAX:te.MAX};Object.freeze(gme);var Rc=gme;var _me={ZERO:te.ZERO,ONE:te.ONE,SOURCE_COLOR:te.SRC_COLOR,ONE_MINUS_SOURCE_COLOR:te.ONE_MINUS_SRC_COLOR,DESTINATION_COLOR:te.DST_COLOR,ONE_MINUS_DESTINATION_COLOR:te.ONE_MINUS_DST_COLOR,SOURCE_ALPHA:te.SRC_ALPHA,ONE_MINUS_SOURCE_ALPHA:te.ONE_MINUS_SRC_ALPHA,DESTINATION_ALPHA:te.DST_ALPHA,ONE_MINUS_DESTINATION_ALPHA:te.ONE_MINUS_DST_ALPHA,CONSTANT_COLOR:te.CONSTANT_COLOR,ONE_MINUS_CONSTANT_COLOR:te.ONE_MINUS_CONSTANT_COLOR,CONSTANT_ALPHA:te.CONSTANT_ALPHA,ONE_MINUS_CONSTANT_ALPHA:te.ONE_MINUS_CONSTANT_ALPHA,SOURCE_ALPHA_SATURATE:te.SRC_ALPHA_SATURATE};Object.freeze(_me);var $r=_me;var yme={DISABLED:Object.freeze({enabled:!1}),ALPHA_BLEND:Object.freeze({enabled:!0,equationRgb:Rc.ADD,equationAlpha:Rc.ADD,functionSourceRgb:$r.SOURCE_ALPHA,functionSourceAlpha:$r.ONE,functionDestinationRgb:$r.ONE_MINUS_SOURCE_ALPHA,functionDestinationAlpha:$r.ONE_MINUS_SOURCE_ALPHA}),PRE_MULTIPLIED_ALPHA_BLEND:Object.freeze({enabled:!0,equationRgb:Rc.ADD,equationAlpha:Rc.ADD,functionSourceRgb:$r.ONE,functionSourceAlpha:$r.ONE,functionDestinationRgb:$r.ONE_MINUS_SOURCE_ALPHA,functionDestinationAlpha:$r.ONE_MINUS_SOURCE_ALPHA}),ADDITIVE_BLEND:Object.freeze({enabled:!0,equationRgb:Rc.ADD,equationAlpha:Rc.ADD,functionSourceRgb:$r.SOURCE_ALPHA,functionSourceAlpha:$r.ONE,functionDestinationRgb:$r.ONE,functionDestinationAlpha:$r.ONE})};Object.freeze(yme);var tn=yme;var lK={TERRAIN:0,CESIUM_3D_TILE:1,BOTH:2};lK.NUMBER_OF_CLASSIFICATION_TYPES=3;Object.freeze(lK);var Qn=lK;var Ame={FRONT:te.FRONT,BACK:te.BACK,FRONT_AND_BACK:te.FRONT_AND_BACK};Object.freeze(Ame);var zi=Ame;var Sx=`in vec4 v_color; void main() { -vec4 p = czm_computePosition(); -v_positionEC = (czm_modelViewRelativeToEye * p).xyz; -v_normalEC = czm_normal * normal; -v_tangentEC = czm_normal * tangent; -v_bitangentEC = czm_normal * bitangent; -v_st = st; -gl_Position = czm_modelViewProjectionRelativeToEye * p; -} -`;var FM=`in vec3 v_positionEC; -in vec3 v_normalEC; -void main() -{ -vec3 positionToEyeEC = -v_positionEC; -vec3 normalEC = normalize(v_normalEC); -#ifdef FACE_FORWARD -normalEC = faceforward(normalEC, vec3(0.0, 0.0, 1.0), -normalEC); -#endif -czm_materialInput materialInput; -materialInput.normalEC = normalEC; -materialInput.positionToEyeEC = positionToEyeEC; -czm_material material = czm_getMaterial(materialInput); -#ifdef FLAT -out_FragColor = vec4(material.diffuse + material.emission, material.alpha); -#else -out_FragColor = czm_phong(normalize(positionToEyeEC), material, czm_lightDirectionEC); -#endif +out_FragColor = czm_gammaCorrect(v_color); } -`;var BM=`in vec3 position3DHigh; +`;var FM=`in vec3 position3DHigh; in vec3 position3DLow; -in vec3 normal; +in vec3 prevPosition3DHigh; +in vec3 prevPosition3DLow; +in vec3 nextPosition3DHigh; +in vec3 nextPosition3DLow; +in vec2 expandAndWidth; +in vec4 color; in float batchId; -out vec3 v_positionEC; -out vec3 v_normalEC; +out vec4 v_color; void main() { +float expandDir = expandAndWidth.x; +float width = abs(expandAndWidth.y) + 0.5; +bool usePrev = expandAndWidth.y < 0.0; vec4 p = czm_computePosition(); -v_positionEC = (czm_modelViewRelativeToEye * p).xyz; -v_normalEC = czm_normal * normal; -gl_Position = czm_modelViewProjectionRelativeToEye * p; -} -`;var kM=`in vec3 v_positionEC; -in vec3 v_normalEC; -in vec2 v_st; -void main() -{ -vec3 positionToEyeEC = -v_positionEC; -vec3 normalEC = normalize(v_normalEC); -#ifdef FACE_FORWARD -normalEC = faceforward(normalEC, vec3(0.0, 0.0, 1.0), -normalEC); -#endif -czm_materialInput materialInput; -materialInput.normalEC = normalEC; -materialInput.positionToEyeEC = positionToEyeEC; -materialInput.st = v_st; -czm_material material = czm_getMaterial(materialInput); -#ifdef FLAT -out_FragColor = vec4(material.diffuse + material.emission, material.alpha); -#else -out_FragColor = czm_phong(normalize(positionToEyeEC), material, czm_lightDirectionEC); -#endif +vec4 prev = czm_computePrevPosition(); +vec4 next = czm_computeNextPosition(); +float angle; +vec4 positionWC = getPolylineWindowCoordinates(p, prev, next, expandDir, width, usePrev, angle); +gl_Position = czm_viewportOrthographic * positionWC; +v_color = color; } -`;var UM=`in vec3 position3DHigh; +`;function Nv(e){e=e??H.EMPTY_OBJECT,this.material=e.material,this.translucent=e.translucent??!0,this._vertexShaderSource=e.vertexShaderSource,this._fragmentShaderSource=e.fragmentShaderSource,this._renderState=e.renderState,this._closed=e.closed??!1}Object.defineProperties(Nv.prototype,{vertexShaderSource:{get:function(){return this._vertexShaderSource}},fragmentShaderSource:{get:function(){return this._fragmentShaderSource}},renderState:{get:function(){return this._renderState}},closed:{get:function(){return this._closed}}});Nv.prototype.getFragmentShaderSource=function(){let e=[];return this.flat&&e.push("#define FLAT"),this.faceForward&&e.push("#define FACE_FORWARD"),l(this.material)&&e.push(this.material.shaderSource),e.push(this.fragmentShaderSource),e.join(` +`)};Nv.prototype.isTranslucent=function(){return l(this.material)&&this.material.isTranslucent()||!l(this.material)&&this.translucent};Nv.prototype.getRenderState=function(){let e=this.isTranslucent(),t=Je(this.renderState,!1);return e?(t.depthMask=!1,t.blending=tn.ALPHA_BLEND):t.depthMask=!0,t};Nv.getDefaultRenderState=function(e,t,n){let i={depthTest:{enabled:!0}};return e&&(i.depthMask=!1,i.blending=tn.ALPHA_BLEND),t&&(i.cull={enabled:!0,face:zi.BACK}),l(n)&&(i=Ot(n,i,!0)),i};var wr=Nv;var nGe=`#define CLIP_POLYLINE +${Wl} +${FM}`,iGe=Sx;function wx(e){e=e??H.EMPTY_OBJECT;let t=e.translucent??!0,n=!1,i=wx.VERTEX_FORMAT;this.material=void 0,this.translucent=t,this._vertexShaderSource=e.vertexShaderSource??nGe,this._fragmentShaderSource=e.fragmentShaderSource??iGe,this._renderState=wr.getDefaultRenderState(t,n,e.renderState),this._closed=n,this._vertexFormat=i}Object.defineProperties(wx.prototype,{vertexShaderSource:{get:function(){return this._vertexShaderSource}},fragmentShaderSource:{get:function(){return this._fragmentShaderSource}},renderState:{get:function(){return this._renderState}},closed:{get:function(){return this._closed}},vertexFormat:{get:function(){return this._vertexFormat}}});wx.VERTEX_FORMAT=Be.POSITION_ONLY;wx.prototype.getFragmentShaderSource=wr.prototype.getFragmentShaderSource;wx.prototype.isTranslucent=wr.prototype.isTranslucent;wx.prototype.getRenderState=wr.prototype.getRenderState;var Vs=wx;var BM=`in vec3 position3DHigh; in vec3 position3DLow; -in vec3 normal; +in vec3 prevPosition3DHigh; +in vec3 prevPosition3DLow; +in vec3 nextPosition3DHigh; +in vec3 nextPosition3DLow; +in vec2 expandAndWidth; in vec2 st; in float batchId; -out vec3 v_positionEC; -out vec3 v_normalEC; +out float v_width; out vec2 v_st; +out float v_polylineAngle; void main() { +float expandDir = expandAndWidth.x; +float width = abs(expandAndWidth.y) + 0.5; +bool usePrev = expandAndWidth.y < 0.0; vec4 p = czm_computePosition(); -v_positionEC = (czm_modelViewRelativeToEye * p).xyz; -v_normalEC = czm_normal * normal; -v_st = st; -gl_Position = czm_modelViewProjectionRelativeToEye * p; +vec4 prev = czm_computePrevPosition(); +vec4 next = czm_computeNextPosition(); +float angle; +vec4 positionWC = getPolylineWindowCoordinates(p, prev, next, expandDir, width, usePrev, angle); +gl_Position = czm_viewportOrthographic * positionWC; +v_width = width; +v_st.s = st.s; +v_st.t = czm_writeNonPerspective(st.t, gl_Position.w); +v_polylineAngle = angle; } -`;var Uhe={ADD:te.FUNC_ADD,SUBTRACT:te.FUNC_SUBTRACT,REVERSE_SUBTRACT:te.FUNC_REVERSE_SUBTRACT,MIN:te.MIN,MAX:te.MAX};Object.freeze(Uhe);var Dc=Uhe;var zhe={ZERO:te.ZERO,ONE:te.ONE,SOURCE_COLOR:te.SRC_COLOR,ONE_MINUS_SOURCE_COLOR:te.ONE_MINUS_SRC_COLOR,DESTINATION_COLOR:te.DST_COLOR,ONE_MINUS_DESTINATION_COLOR:te.ONE_MINUS_DST_COLOR,SOURCE_ALPHA:te.SRC_ALPHA,ONE_MINUS_SOURCE_ALPHA:te.ONE_MINUS_SRC_ALPHA,DESTINATION_ALPHA:te.DST_ALPHA,ONE_MINUS_DESTINATION_ALPHA:te.ONE_MINUS_DST_ALPHA,CONSTANT_COLOR:te.CONSTANT_COLOR,ONE_MINUS_CONSTANT_COLOR:te.ONE_MINUS_CONSTANT_COLOR,CONSTANT_ALPHA:te.CONSTANT_ALPHA,ONE_MINUS_CONSTANT_ALPHA:te.ONE_MINUS_CONSTANT_ALPHA,SOURCE_ALPHA_SATURATE:te.SRC_ALPHA_SATURATE};Object.freeze(zhe);var $r=zhe;var Vhe={DISABLED:Object.freeze({enabled:!1}),ALPHA_BLEND:Object.freeze({enabled:!0,equationRgb:Dc.ADD,equationAlpha:Dc.ADD,functionSourceRgb:$r.SOURCE_ALPHA,functionSourceAlpha:$r.ONE,functionDestinationRgb:$r.ONE_MINUS_SOURCE_ALPHA,functionDestinationAlpha:$r.ONE_MINUS_SOURCE_ALPHA}),PRE_MULTIPLIED_ALPHA_BLEND:Object.freeze({enabled:!0,equationRgb:Dc.ADD,equationAlpha:Dc.ADD,functionSourceRgb:$r.ONE,functionSourceAlpha:$r.ONE,functionDestinationRgb:$r.ONE_MINUS_SOURCE_ALPHA,functionDestinationAlpha:$r.ONE_MINUS_SOURCE_ALPHA}),ADDITIVE_BLEND:Object.freeze({enabled:!0,equationRgb:Dc.ADD,equationAlpha:Dc.ADD,functionSourceRgb:$r.SOURCE_ALPHA,functionSourceAlpha:$r.ONE,functionDestinationRgb:$r.ONE,functionDestinationAlpha:$r.ONE})};Object.freeze(Vhe);var tn=Vhe;var jhe={FRONT:te.FRONT,BACK:te.BACK,FRONT_AND_BACK:te.FRONT_AND_BACK};Object.freeze(jhe);var Vi=jhe;function Lv(e){e=e??H.EMPTY_OBJECT,this.material=e.material,this.translucent=e.translucent??!0,this._vertexShaderSource=e.vertexShaderSource,this._fragmentShaderSource=e.fragmentShaderSource,this._renderState=e.renderState,this._closed=e.closed??!1}Object.defineProperties(Lv.prototype,{vertexShaderSource:{get:function(){return this._vertexShaderSource}},fragmentShaderSource:{get:function(){return this._fragmentShaderSource}},renderState:{get:function(){return this._renderState}},closed:{get:function(){return this._closed}}});Lv.prototype.getFragmentShaderSource=function(){let e=[];return this.flat&&e.push("#define FLAT"),this.faceForward&&e.push("#define FACE_FORWARD"),l(this.material)&&e.push(this.material.shaderSource),e.push(this.fragmentShaderSource),e.join(` -`)};Lv.prototype.isTranslucent=function(){return l(this.material)&&this.material.isTranslucent()||!l(this.material)&&this.translucent};Lv.prototype.getRenderState=function(){let e=this.isTranslucent(),t=Je(this.renderState,!1);return e?(t.depthMask=!1,t.blending=tn.ALPHA_BLEND):t.depthMask=!0,t};Lv.getDefaultRenderState=function(e,t,n){let i={depthTest:{enabled:!0}};return e&&(i.depthMask=!1,i.blending=tn.ALPHA_BLEND),t&&(i.cull={enabled:!0,face:Vi.BACK}),l(n)&&(i=Ot(n,i,!0)),i};var wr=Lv;var zM=`uniform sampler2D image; +`;var kM=`uniform sampler2D image; czm_material czm_getMaterial(czm_materialInput materialInput) { czm_material material = czm_getDefaultMaterial(materialInput); @@ -6249,7 +6192,7 @@ material.diffuse = rampColor.rgb; material.alpha = rampColor.a; return material; } -`;var VM=`uniform sampler2D image; +`;var UM=`uniform sampler2D image; uniform float strength; uniform vec2 repeat; czm_material czm_getMaterial(czm_materialInput materialInput) @@ -6270,7 +6213,7 @@ material.normal = normalEC; material.diffuse = vec3(0.01); return material; } -`;var jM=`uniform vec4 lightColor; +`;var zM=`uniform vec4 lightColor; uniform vec4 darkColor; uniform vec2 repeat; czm_material czm_getMaterial(czm_materialInput materialInput) @@ -6290,7 +6233,7 @@ material.diffuse = color.rgb; material.alpha = color.a; return material; } -`;var HM=`uniform vec4 lightColor; +`;var VM=`uniform vec4 lightColor; uniform vec4 darkColor; uniform vec2 repeat; czm_material czm_getMaterial(czm_materialInput materialInput) @@ -6303,7 +6246,7 @@ material.diffuse = color.rgb; material.alpha = color.a; return material; } -`;var GM=`uniform sampler2D heights; +`;var jM=`uniform sampler2D heights; uniform sampler2D colors; float getHeight(int idx, float invTexSize) { @@ -6357,7 +6300,7 @@ material.diffuse = color.rgb; material.alpha = color.a; return material; } -`;var WM=`uniform vec4 color; +`;var HM=`uniform vec4 color; uniform float spacing; uniform float width; czm_material czm_getMaterial(czm_materialInput materialInput) @@ -6377,7 +6320,7 @@ material.diffuse = outColor.rgb; material.alpha = outColor.a; return material; } -`;var qM=`uniform sampler2D image; +`;var GM=`uniform sampler2D image; uniform float minimumHeight; uniform float maximumHeight; czm_material czm_getMaterial(czm_materialInput materialInput) @@ -6390,7 +6333,7 @@ material.diffuse = rampColor.rgb; material.alpha = rampColor.a; return material; } -`;var YM=`uniform vec4 fadeInColor; +`;var WM=`uniform vec4 fadeInColor; uniform vec4 fadeOutColor; uniform float maximumDistance; uniform bool repeat; @@ -6421,7 +6364,7 @@ material.emission = color.rgb; material.alpha = color.a; return material; } -`;var XM=`uniform vec4 color; +`;var qM=`uniform vec4 color; uniform float cellAlpha; uniform vec2 lineCount; uniform vec2 lineThickness; @@ -6463,7 +6406,7 @@ material.emission = halfColor.rgb; material.alpha = halfColor.a; return material; } -`;var KM=`uniform sampler2D image; +`;var YM=`uniform sampler2D image; uniform float strength; uniform vec2 repeat; czm_material czm_getMaterial(czm_materialInput materialInput) @@ -6478,7 +6421,7 @@ vec3 normalEC = materialInput.tangentToEyeMatrix * normalTangentSpace; material.normal = normalEC; return material; } -`;var $M=`uniform vec4 color; +`;var XM=`uniform vec4 color; float getPointOnLine(vec2 p0, vec2 p1, float x) { float slope = (p0.y - p1.y) / (p0.x - p1.x); @@ -6529,7 +6472,7 @@ material.diffuse = outColor.rgb; material.alpha = outColor.a; return material; } -`;var JM=`uniform vec4 color; +`;var KM=`uniform vec4 color; uniform vec4 gapColor; uniform float dashLength; uniform float dashPattern; @@ -6559,7 +6502,7 @@ material.emission = fragColor.rgb; material.alpha = fragColor.a; return material; } -`;var ZM=`uniform vec4 color; +`;var $M=`uniform vec4 color; uniform float glowPower; uniform float taperPower; czm_material czm_getMaterial(czm_materialInput materialInput) @@ -6578,7 +6521,7 @@ material.emission = fragColor.rgb; material.alpha = fragColor.a; return material; } -`;var QM=`uniform vec4 color; +`;var JM=`uniform vec4 color; uniform vec4 outlineColor; uniform float outlineWidth; in float v_width; @@ -6599,7 +6542,7 @@ material.diffuse = outColor.rgb; material.alpha = outColor.a; return material; } -`;var eN=`uniform vec4 color; +`;var ZM=`uniform vec4 color; uniform vec4 rimColor; uniform float width; czm_material czm_getMaterial(czm_materialInput materialInput) @@ -6614,7 +6557,7 @@ material.emission = outRimColor.rgb * s; material.alpha = mix(outColor.a, outRimColor.a, s); return material; } -`;var tN=`uniform sampler2D image; +`;var QM=`uniform sampler2D image; czm_material czm_getMaterial(czm_materialInput materialInput) { czm_material material = czm_getDefaultMaterial(materialInput); @@ -6624,7 +6567,7 @@ material.diffuse = rampColor.rgb; material.alpha = rampColor.a; return material; } -`;var nN=`uniform vec4 evenColor; +`;var eN=`uniform vec4 evenColor; uniform vec4 oddColor; uniform float offset; uniform float repeat; @@ -6642,7 +6585,7 @@ material.diffuse = color.rgb; material.alpha = color.a; return material; } -`;var iN=`uniform vec4 waterColor; +`;var tN=`uniform vec4 waterColor; uniform vec4 landColor; czm_material czm_getMaterial(czm_materialInput materialInput) { @@ -6653,7 +6596,7 @@ material.diffuse = outColor.rgb; material.alpha = outColor.a; return material; } -`;var rN=`uniform sampler2D specularMap; +`;var nN=`uniform sampler2D specularMap; uniform sampler2D normalMap; uniform vec4 baseWaterColor; uniform vec4 blendColor; @@ -6683,67 +6626,19 @@ material.specular = specularIntensity; material.shininess = 10.0; return material; } -`;function it(e){this.type=void 0,this.shaderSource=void 0,this.materials=void 0,this.uniforms=void 0,this._uniforms=void 0,this.translucent=void 0,this._minificationFilter=e.minificationFilter??Wt.LINEAR,this._magnificationFilter=e.magnificationFilter??Jn.LINEAR,this._strict=void 0,this._template=void 0,this._count=void 0,this._texturePaths={},this._loadedImages=[],this._loadedCubeMaps=[],this._textures={},this._updateFunctions=[],this._defaultTexture=void 0,this._initializationPromises=[],this._initializationError=void 0,DHe(e,this),Object.defineProperties(this,{type:{value:this.type,writable:!1},minificationFilter:{get:function(){return this._minificationFilter},set:function(t){this._minificationFilter=t}},magnificationFilter:{get:function(){return this._magnificationFilter},set:function(t){this._magnificationFilter=t}}}),l(it._uniformList[this.type])||(it._uniformList[this.type]=Object.keys(this._uniforms))}it._uniformList={};it.fromType=function(e,t){let n=new it({fabric:{type:e}});if(l(t))for(let i in t)t.hasOwnProperty(i)&&(n.uniforms[i]=t[i]);return n};it.fromTypeAsync=async function(e,t){let n=[],i=new it({fabric:{type:e,uniforms:t}});if(Whe(i,n),await Promise.all(n),n.length=0,l(i._initializationError))throw i._initializationError;return i};function Whe(e,t){t.push(...e._initializationPromises);let n=e.materials;for(let i in n)if(n.hasOwnProperty(i)){let r=n[i];Whe(r,t)}}it.prototype.isTranslucent=function(){if(l(this.translucent))return typeof this.translucent=="function"?this.translucent():this.translucent;let e=!0,t=this._translucentFunctions,n=t.length;for(let i=0;i<n;++i){let r=t[i];if(typeof r=="function"?e=e&&r():e=e&&r,!e)break}return e};it.prototype.update=function(e){this._defaultTexture=e.defaultTexture;let t,n,i=this._loadedImages,r=i.length;for(t=0;t<r;++t){let c=i[t];n=c.id;let u=c.image,f;Array.isArray(u)&&(f=u.slice(1,u.length).map(function(y){return y.bufferView}),u=u[0]);let d=new jt({minificationFilter:this._minificationFilter,magnificationFilter:this._magnificationFilter}),p;l(u.internalFormat)?p=new Dt({context:e,pixelFormat:u.internalFormat,width:u.width,height:u.height,source:{arrayBufferView:u.bufferView,mipLevels:f},sampler:d}):p=new Dt({context:e,source:u,sampler:d});let g=this._textures[n];l(g)&&g!==this._defaultTexture&&g.destroy(),this._textures[n]=p;let m=`${n}Dimensions`;if(this.uniforms.hasOwnProperty(m)){let y=this.uniforms[m];y.x=p._width,y.y=p._height}}i.length=0;let o=this._loadedCubeMaps;for(r=o.length,t=0;t<r;++t){let c=o[t];n=c.id;let u=c.images,f=new ns({context:e,source:{positiveX:u[0],negativeX:u[1],positiveY:u[2],negativeY:u[3],positiveZ:u[4],negativeZ:u[5]},sampler:new jt({minificationFilter:this._minificationFilter,magnificationFilter:this._magnificationFilter})});this._textures[n]=f}o.length=0;let s=this._updateFunctions;for(r=s.length,t=0;t<r;++t)s[t](this,e);let a=this.materials;for(let c in a)a.hasOwnProperty(c)&&a[c].update(e)};it.prototype.isDestroyed=function(){return!1};it.prototype.destroy=function(){let e=this._textures;for(let n in e)if(e.hasOwnProperty(n)){let i=e[n];i!==this._defaultTexture&&i.destroy()}let t=this.materials;for(let n in t)t.hasOwnProperty(n)&&t[n].destroy();return le(this)};function DHe(e,t){e=e??H.EMPTY_OBJECT,t._strict=e.strict??!1,t._count=e.count??0,t._template=Je(e.fabric??H.EMPTY_OBJECT),t.fabric=Je(e.fabric??H.EMPTY_OBJECT),t._template.uniforms=Je(t._template.uniforms??H.EMPTY_OBJECT),t._template.materials=Je(t._template.materials??H.EMPTY_OBJECT),t.type=l(t._template.type)?t._template.type:Kn(),t.shaderSource="",t.materials={},t.uniforms={},t._uniforms={},t._translucentFunctions=[];let n,i=it._materialCache.getMaterial(t.type);if(l(i)){let o=Je(i.fabric,!0);t._template=Ot(t._template,o,!0),n=i.translucent}NHe(t),FHe(t),zHe(t),jHe(t),l(i)||it._materialCache.addMaterial(t.type,t);let r=t._translucentFunctions.length===0?!0:void 0;if(n=n??r,n=e.translucent??n,l(n))if(typeof n=="function"){let o=function(){return n(t)};t._translucentFunctions.push(o)}else t._translucentFunctions.push(n)}function XX(e,t,n,i){if(l(e)){for(let r in e)if(e.hasOwnProperty(r)){let o=t.indexOf(r)!==-1;(i&&!o||!i&&o)&&n(r,t)}}}function Hhe(e,t){}function RHe(e,t){}var OHe=["type","materials","uniforms","components","source"],MHe=["diffuse","specular","shininess","normal","emission","alpha"];function NHe(e){let t=e._template,n=t.uniforms,i=t.materials,r=t.components;XX(t,OHe,Hhe,!0),XX(r,MHe,Hhe,!0);let o=[];for(let s in i)i.hasOwnProperty(s)&&o.push(s);XX(n,o,RHe,!1)}function LHe(e,t){let n=t._template.materials;for(let i in n)if(n.hasOwnProperty(i)&&e.indexOf(i)>-1)return!0;return!1}function FHe(e){let t=e._template.components,n=e._template.source;if(l(n))e.shaderSource+=`${n} +`;function it(e){this.type=void 0,this.shaderSource=void 0,this.materials=void 0,this.uniforms=void 0,this._uniforms=void 0,this.translucent=void 0,this._minificationFilter=e.minificationFilter??Wt.LINEAR,this._magnificationFilter=e.magnificationFilter??Jn.LINEAR,this._strict=void 0,this._template=void 0,this._count=void 0,this._texturePaths={},this._loadedImages=[],this._loadedCubeMaps=[],this._textures={},this._updateFunctions=[],this._defaultTexture=void 0,this._initializationPromises=[],this._initializationError=void 0,rGe(e,this),Object.defineProperties(this,{type:{value:this.type,writable:!1},minificationFilter:{get:function(){return this._minificationFilter},set:function(t){this._minificationFilter=t}},magnificationFilter:{get:function(){return this._magnificationFilter},set:function(t){this._magnificationFilter=t}}}),l(it._uniformList[this.type])||(it._uniformList[this.type]=Object.keys(this._uniforms))}it._uniformList={};it.fromType=function(e,t){let n=new it({fabric:{type:e}});if(l(t))for(let i in t)t.hasOwnProperty(i)&&(n.uniforms[i]=t[i]);return n};it.fromTypeAsync=async function(e,t){let n=[],i=new it({fabric:{type:e,uniforms:t}});if(Tme(i,n),await Promise.all(n),n.length=0,l(i._initializationError))throw i._initializationError;return i};function Tme(e,t){t.push(...e._initializationPromises);let n=e.materials;for(let i in n)if(n.hasOwnProperty(i)){let r=n[i];Tme(r,t)}}it.prototype.isTranslucent=function(){if(l(this.translucent))return typeof this.translucent=="function"?this.translucent():this.translucent;let e=!0,t=this._translucentFunctions,n=t.length;for(let i=0;i<n;++i){let r=t[i];if(typeof r=="function"?e=e&&r():e=e&&r,!e)break}return e};it.prototype.update=function(e){this._defaultTexture=e.defaultTexture;let t,n,i=this._loadedImages,r=i.length;for(t=0;t<r;++t){let c=i[t];n=c.id;let u=c.image,f;Array.isArray(u)&&(f=u.slice(1,u.length).map(function(y){return y.bufferView}),u=u[0]);let d=new jt({minificationFilter:this._minificationFilter,magnificationFilter:this._magnificationFilter}),p;l(u.internalFormat)?p=new Dt({context:e,pixelFormat:u.internalFormat,width:u.width,height:u.height,source:{arrayBufferView:u.bufferView,mipLevels:f},sampler:d}):p=new Dt({context:e,source:u,sampler:d});let g=this._textures[n];l(g)&&g!==this._defaultTexture&&g.destroy(),this._textures[n]=p;let m=`${n}Dimensions`;if(this.uniforms.hasOwnProperty(m)){let y=this.uniforms[m];y.x=p._width,y.y=p._height}}i.length=0;let o=this._loadedCubeMaps;for(r=o.length,t=0;t<r;++t){let c=o[t];n=c.id;let u=c.images,f=new ns({context:e,source:{positiveX:u[0],negativeX:u[1],positiveY:u[2],negativeY:u[3],positiveZ:u[4],negativeZ:u[5]},sampler:new jt({minificationFilter:this._minificationFilter,magnificationFilter:this._magnificationFilter})});this._textures[n]=f}o.length=0;let s=this._updateFunctions;for(r=s.length,t=0;t<r;++t)s[t](this,e);let a=this.materials;for(let c in a)a.hasOwnProperty(c)&&a[c].update(e)};it.prototype.isDestroyed=function(){return!1};it.prototype.destroy=function(){let e=this._textures;for(let n in e)if(e.hasOwnProperty(n)){let i=e[n];i!==this._defaultTexture&&i.destroy()}let t=this.materials;for(let n in t)t.hasOwnProperty(n)&&t[n].destroy();return le(this)};function rGe(e,t){e=e??H.EMPTY_OBJECT,t._strict=e.strict??!1,t._count=e.count??0,t._template=Je(e.fabric??H.EMPTY_OBJECT),t.fabric=Je(e.fabric??H.EMPTY_OBJECT),t._template.uniforms=Je(t._template.uniforms??H.EMPTY_OBJECT),t._template.materials=Je(t._template.materials??H.EMPTY_OBJECT),t.type=l(t._template.type)?t._template.type:Kn(),t.shaderSource="",t.materials={},t.uniforms={},t._uniforms={},t._translucentFunctions=[];let n,i=it._materialCache.getMaterial(t.type);if(l(i)){let o=Je(i.fabric,!0);t._template=Ot(t._template,o,!0),n=i.translucent}cGe(t),uGe(t),mGe(t),gGe(t),l(i)||it._materialCache.addMaterial(t.type,t);let r=t._translucentFunctions.length===0?!0:void 0;if(n=n??r,n=e.translucent??n,l(n))if(typeof n=="function"){let o=function(){return n(t)};t._translucentFunctions.push(o)}else t._translucentFunctions.push(n)}function uK(e,t,n,i){if(l(e)){for(let r in e)if(e.hasOwnProperty(r)){let o=t.indexOf(r)!==-1;(i&&!o||!i&&o)&&n(r,t)}}}function bme(e,t){}function oGe(e,t){}var sGe=["type","materials","uniforms","components","source"],aGe=["diffuse","specular","shininess","normal","emission","alpha"];function cGe(e){let t=e._template,n=t.uniforms,i=t.materials,r=t.components;uK(t,sGe,bme,!0),uK(r,aGe,bme,!0);let o=[];for(let s in i)i.hasOwnProperty(s)&&o.push(s);uK(n,o,oGe,!1)}function lGe(e,t){let n=t._template.materials;for(let i in n)if(n.hasOwnProperty(i)&&e.indexOf(i)>-1)return!0;return!1}function uGe(e){let t=e._template.components,n=e._template.source;if(l(n))e.shaderSource+=`${n} `;else{if(e.shaderSource+=`czm_material czm_getMaterial(czm_materialInput materialInput) { `,e.shaderSource+=`czm_material material = czm_getDefaultMaterial(materialInput); -`,l(t)){let i=Object.keys(e._template.materials).length>0;for(let r in t)if(t.hasOwnProperty(r))if(r==="diffuse"||r==="emission"){let s=i&&LHe(t[r],e)?t[r]:`czm_gammaCorrect(${t[r]})`;e.shaderSource+=`material.${r} = ${s}; +`,l(t)){let i=Object.keys(e._template.materials).length>0;for(let r in t)if(t.hasOwnProperty(r))if(r==="diffuse"||r==="emission"){let s=i&&lGe(t[r],e)?t[r]:`czm_gammaCorrect(${t[r]})`;e.shaderSource+=`material.${r} = ${s}; `}else r==="alpha"?e.shaderSource+=`material.alpha = ${t.alpha}; `:e.shaderSource+=`material.${r} = ${t[r]}; `}e.shaderSource+=`return material; } -`}}var Ghe={mat2:Xi,mat3:$,mat4:N},BHe=/\.ktx2$/i;function kHe(e){let t;return function(n,i){let r=n.uniforms,o=r[e],s=t!==o,a=!l(o)||o===it.DefaultImageId;t=o;let c=n._textures[e],u,f;if(o instanceof HTMLVideoElement){if(o.readyState>=2){if(s&&l(c)&&(c!==i.defaultTexture&&c.destroy(),c=void 0),!l(c)||c===i.defaultTexture){let d=new jt({minificationFilter:n._minificationFilter,magnificationFilter:n._magnificationFilter});c=new Dt({context:i,source:o,sampler:d}),n._textures[e]=c;return}c.copyFrom({source:o})}else l(c)||(n._textures[e]=i.defaultTexture);return}if(o instanceof Dt&&o!==c){n._texturePaths[e]=void 0;let d=n._textures[e];l(d)&&d!==n._defaultTexture&&d.destroy(),n._textures[e]=o,u=`${e}Dimensions`,r.hasOwnProperty(u)&&(f=r[u],f.x=o._width,f.y=o._height);return}if(s&&l(c)&&a&&(c!==n._defaultTexture&&c.destroy(),c=void 0,n._texturePaths[e]=void 0),l(c)||(c=n._textures[e]=n._defaultTexture,u=`${e}Dimensions`,r.hasOwnProperty(u)&&(f=r[u],f.x=c._width,f.y=c._height)),!a){if((o instanceof HTMLCanvasElement||o instanceof HTMLImageElement||o instanceof ImageBitmap||o instanceof OffscreenCanvas)&&o!==n._texturePaths[e]){n._loadedImages.push({id:e,image:o}),n._texturePaths[e]=o;return}qhe(n,e)}}}function qhe(e,t){let i=e.uniforms[t];if(i===it.DefaultImageId)return Promise.resolve();let r=De.createIfNeeded(i);if(!(r instanceof De))return Promise.resolve();let o=De.createIfNeeded(e._texturePaths[t]);if(!(!l(o)||o.url!==r.url))return Promise.resolve();let a;return BHe.test(r.url)?a=Ou(r.url):a=r.fetchImage(),Promise.resolve(a).then(function(c){e._loadedImages.push({id:t,image:c})}).catch(function(c){e._initializationError=c;let u=e._textures[t];l(u)&&u!==e._defaultTexture&&u.destroy(),e._textures[t]=e._defaultTexture}),e._texturePaths[t]=i,a}function UHe(e){return function(t,n){let i=t.uniforms[e];if(i instanceof ns){let r=t._textures[e];r!==t._defaultTexture&&r.destroy(),t._texturePaths[e]=void 0,t._textures[e]=i;return}l(t._textures[e])||(t._textures[e]=n.defaultCubeMap),Yhe(t,e)}}function Yhe(e,t){let i=e.uniforms[t];if(i===it.DefaultCubeMapId)return Promise.resolve();let r=i.positiveX+i.negativeX+i.positiveY+i.negativeY+i.positiveZ+i.negativeZ;if(r===e._texturePaths[t])return Promise.resolve();let o=[De.createIfNeeded(i.positiveX).fetchImage(),De.createIfNeeded(i.negativeX).fetchImage(),De.createIfNeeded(i.positiveY).fetchImage(),De.createIfNeeded(i.negativeY).fetchImage(),De.createIfNeeded(i.positiveZ).fetchImage(),De.createIfNeeded(i.negativeZ).fetchImage()],s=Promise.all(o);return s.then(function(a){e._loadedCubeMaps.push({id:t,images:a})}).catch(function(a){e._initializationError=a}),e._texturePaths[t]=r,s}function zHe(e){let t=e._template.uniforms;for(let n in t)t.hasOwnProperty(n)&&Xhe(e,n)}function Xhe(e,t){let n=e._strict,i=e._template.uniforms,r=i[t],o=VHe(r),s;if(o==="channels")s=oN(e,t,r,!1);else{if(o==="sampler2D"){let u=`${t}Dimensions`;HHe(e,u)>0&&(i[u]={type:"ivec3",x:1,y:1},Xhe(e,u))}if(!new RegExp(`uniform\\s+${o}\\s+${t}\\s*;`).test(e.shaderSource)){let u=`uniform ${o} ${t};`;e.shaderSource=u+e.shaderSource}let c=`${t}_${e._count++}`;if(s=oN(e,t,c),e.uniforms[t]=r,o==="sampler2D")e._uniforms[c]=function(){return e._textures[t]},e._updateFunctions.push(kHe(t)),e._initializationPromises.push(qhe(e,t));else if(o==="samplerCube")e._uniforms[c]=function(){return e._textures[t]},e._updateFunctions.push(UHe(t)),e._initializationPromises.push(Yhe(e,t));else if(o.indexOf("mat")!==-1){let u=new Ghe[o];e._uniforms[c]=function(){return Ghe[o].fromColumnMajorArray(e.uniforms[t],u)}}else e._uniforms[c]=function(){return e.uniforms[t]}}}function VHe(e){let t=e.type;if(!l(t)){let n=typeof e;if(n==="number")t="float";else if(n==="boolean")t="bool";else if(n==="string"||e instanceof De||e instanceof HTMLCanvasElement||e instanceof HTMLImageElement||e instanceof ImageBitmap||e instanceof OffscreenCanvas)/^([rgba]){1,4}$/i.test(e)?t="channels":e===it.DefaultCubeMapId?t="samplerCube":t="sampler2D";else if(n==="object")if(Array.isArray(e))(e.length===4||e.length===9||e.length===16)&&(t=`mat${Math.sqrt(e.length)}`);else{let i=0;for(let r in e)e.hasOwnProperty(r)&&(i+=1);i>=2&&i<=4?t=`vec${i}`:i===6&&(t="samplerCube")}}return t}function jHe(e){let t=e._strict,n=e._template.materials;for(let i in n)if(n.hasOwnProperty(i)){let r=new it({strict:t,fabric:n[i],count:e._count});e._count=r._count,e._uniforms=Ot(e._uniforms,r._uniforms,!0),e.materials[i]=r,e._translucentFunctions=e._translucentFunctions.concat(r._translucentFunctions);let o="czm_getMaterial",s=`${o}_${e._count++}`;oN(r,o,s),e.shaderSource=r.shaderSource+e.shaderSource;let a=`${s}(materialInput)`,c=oN(e,i,a)}}function oN(e,t,n,i){i=i??!0;let r=0,o="([\\w])?",s=`([\\w${i?".":""}])?`,a=new RegExp(s+t+o,"g");return e.shaderSource=e.shaderSource.replace(a,function(c,u,f){return u||f?c:(r+=1,n)}),r}function HHe(e,t,n){return oN(e,t,t,n)}it._materialCache={_materials:{},addMaterial:function(e,t){this._materials[e]=t},getMaterial:function(e){return this._materials[e]}};it.DefaultImageId="czm_defaultImage";it.DefaultCubeMapId="czm_defaultCubeMap";it.ColorType="Color";it._materialCache.addMaterial(it.ColorType,{fabric:{type:it.ColorType,uniforms:{color:new z(1,0,0,.5)},components:{diffuse:"color.rgb",alpha:"color.a"}},translucent:function(e){return e.uniforms.color.alpha<1}});it.ImageType="Image";it._materialCache.addMaterial(it.ImageType,{fabric:{type:it.ImageType,uniforms:{image:it.DefaultImageId,repeat:new U(1,1),color:new z(1,1,1,1)},components:{diffuse:"texture(image, fract(repeat * materialInput.st)).rgb * color.rgb",alpha:"texture(image, fract(repeat * materialInput.st)).a * color.a"}},translucent:function(e){return e.uniforms.color.alpha<1}});it.DiffuseMapType="DiffuseMap";it._materialCache.addMaterial(it.DiffuseMapType,{fabric:{type:it.DiffuseMapType,uniforms:{image:it.DefaultImageId,channels:"rgb",repeat:new U(1,1)},components:{diffuse:"texture(image, fract(repeat * materialInput.st)).channels"}},translucent:!1});it.AlphaMapType="AlphaMap";it._materialCache.addMaterial(it.AlphaMapType,{fabric:{type:it.AlphaMapType,uniforms:{image:it.DefaultImageId,channel:"a",repeat:new U(1,1)},components:{alpha:"texture(image, fract(repeat * materialInput.st)).channel"}},translucent:!0});it.SpecularMapType="SpecularMap";it._materialCache.addMaterial(it.SpecularMapType,{fabric:{type:it.SpecularMapType,uniforms:{image:it.DefaultImageId,channel:"r",repeat:new U(1,1)},components:{specular:"texture(image, fract(repeat * materialInput.st)).channel"}},translucent:!1});it.EmissionMapType="EmissionMap";it._materialCache.addMaterial(it.EmissionMapType,{fabric:{type:it.EmissionMapType,uniforms:{image:it.DefaultImageId,channels:"rgb",repeat:new U(1,1)},components:{emission:"texture(image, fract(repeat * materialInput.st)).channels"}},translucent:!1});it.BumpMapType="BumpMap";it._materialCache.addMaterial(it.BumpMapType,{fabric:{type:it.BumpMapType,uniforms:{image:it.DefaultImageId,channel:"r",strength:.8,repeat:new U(1,1)},source:VM},translucent:!1});it.NormalMapType="NormalMap";it._materialCache.addMaterial(it.NormalMapType,{fabric:{type:it.NormalMapType,uniforms:{image:it.DefaultImageId,channels:"rgb",strength:.8,repeat:new U(1,1)},source:KM},translucent:!1});it.GridType="Grid";it._materialCache.addMaterial(it.GridType,{fabric:{type:it.GridType,uniforms:{color:new z(0,1,0,1),cellAlpha:.1,lineCount:new U(8,8),lineThickness:new U(1,1),lineOffset:new U(0,0)},source:XM},translucent:function(e){let t=e.uniforms;return t.color.alpha<1||t.cellAlpha<1}});it.StripeType="Stripe";it._materialCache.addMaterial(it.StripeType,{fabric:{type:it.StripeType,uniforms:{horizontal:!0,evenColor:new z(1,1,1,.5),oddColor:new z(0,0,1,.5),offset:0,repeat:5},source:nN},translucent:function(e){let t=e.uniforms;return t.evenColor.alpha<1||t.oddColor.alpha<1}});it.CheckerboardType="Checkerboard";it._materialCache.addMaterial(it.CheckerboardType,{fabric:{type:it.CheckerboardType,uniforms:{lightColor:new z(1,1,1,.5),darkColor:new z(0,0,0,.5),repeat:new U(5,5)},source:jM},translucent:function(e){let t=e.uniforms;return t.lightColor.alpha<1||t.darkColor.alpha<1}});it.DotType="Dot";it._materialCache.addMaterial(it.DotType,{fabric:{type:it.DotType,uniforms:{lightColor:new z(1,1,0,.75),darkColor:new z(0,1,1,.75),repeat:new U(5,5)},source:HM},translucent:function(e){let t=e.uniforms;return t.lightColor.alpha<1||t.darkColor.alpha<1}});it.WaterType="Water";it._materialCache.addMaterial(it.WaterType,{fabric:{type:it.WaterType,uniforms:{baseWaterColor:new z(.2,.3,.6,1),blendColor:new z(0,1,.699,1),specularMap:it.DefaultImageId,normalMap:it.DefaultImageId,frequency:10,animationSpeed:.01,amplitude:1,specularIntensity:.5,fadeFactor:1},source:rN},translucent:function(e){let t=e.uniforms;return t.baseWaterColor.alpha<1||t.blendColor.alpha<1}});it.RimLightingType="RimLighting";it._materialCache.addMaterial(it.RimLightingType,{fabric:{type:it.RimLightingType,uniforms:{color:new z(1,0,0,.7),rimColor:new z(1,1,1,.4),width:.3},source:eN},translucent:function(e){let t=e.uniforms;return t.color.alpha<1||t.rimColor.alpha<1}});it.FadeType="Fade";it._materialCache.addMaterial(it.FadeType,{fabric:{type:it.FadeType,uniforms:{fadeInColor:new z(1,0,0,1),fadeOutColor:new z(0,0,0,0),maximumDistance:.5,repeat:!0,fadeDirection:{x:!0,y:!0},time:new U(.5,.5)},source:YM},translucent:function(e){let t=e.uniforms;return t.fadeInColor.alpha<1||t.fadeOutColor.alpha<1}});it.PolylineArrowType="PolylineArrow";it._materialCache.addMaterial(it.PolylineArrowType,{fabric:{type:it.PolylineArrowType,uniforms:{color:new z(1,1,1,1)},source:$M},translucent:!0});it.PolylineDashType="PolylineDash";it._materialCache.addMaterial(it.PolylineDashType,{fabric:{type:it.PolylineDashType,uniforms:{color:new z(1,0,1,1),gapColor:new z(0,0,0,0),dashLength:16,dashPattern:255},source:JM},translucent:!0});it.PolylineGlowType="PolylineGlow";it._materialCache.addMaterial(it.PolylineGlowType,{fabric:{type:it.PolylineGlowType,uniforms:{color:new z(0,.5,1,1),glowPower:.25,taperPower:1},source:ZM},translucent:!0});it.PolylineOutlineType="PolylineOutline";it._materialCache.addMaterial(it.PolylineOutlineType,{fabric:{type:it.PolylineOutlineType,uniforms:{color:new z(1,1,1,1),outlineColor:new z(1,0,0,1),outlineWidth:1},source:QM},translucent:function(e){let t=e.uniforms;return t.color.alpha<1||t.outlineColor.alpha<1}});it.ElevationContourType="ElevationContour";it._materialCache.addMaterial(it.ElevationContourType,{fabric:{type:it.ElevationContourType,uniforms:{spacing:100,color:new z(1,0,0,1),width:1},source:WM},translucent:!1});it.ElevationRampType="ElevationRamp";it._materialCache.addMaterial(it.ElevationRampType,{fabric:{type:it.ElevationRampType,uniforms:{image:it.DefaultImageId,minimumHeight:0,maximumHeight:1e4},source:qM},translucent:!1});it.SlopeRampMaterialType="SlopeRamp";it._materialCache.addMaterial(it.SlopeRampMaterialType,{fabric:{type:it.SlopeRampMaterialType,uniforms:{image:it.DefaultImageId},source:tN},translucent:!1});it.AspectRampMaterialType="AspectRamp";it._materialCache.addMaterial(it.AspectRampMaterialType,{fabric:{type:it.AspectRampMaterialType,uniforms:{image:it.DefaultImageId},source:zM},translucent:!1});it.ElevationBandType="ElevationBand";it._materialCache.addMaterial(it.ElevationBandType,{fabric:{type:it.ElevationBandType,uniforms:{heights:it.DefaultImageId,colors:it.DefaultImageId},source:GM},translucent:!0});it.WaterMaskType="WaterMask";it._materialCache.addMaterial(it.WaterMaskType,{fabric:{type:it.WaterMaskType,source:iN,uniforms:{waterColor:new z(1,1,1,1),landColor:new z(0,0,0,0)}},translucent:!1});var Qi=it;function vx(e){e=e??H.EMPTY_OBJECT;let t=e.translucent??!0,n=e.closed??!1,i=e.materialSupport??vx.MaterialSupport.TEXTURED;this.material=l(e.material)?e.material:Qi.fromType(Qi.ColorType),this.translucent=t,this._vertexShaderSource=e.vertexShaderSource??i.vertexShaderSource,this._fragmentShaderSource=e.fragmentShaderSource??i.fragmentShaderSource,this._renderState=wr.getDefaultRenderState(t,n,e.renderState),this._closed=n,this._materialSupport=i,this._vertexFormat=i.vertexFormat,this._flat=e.flat??!1,this._faceForward=e.faceForward??!n}Object.defineProperties(vx.prototype,{vertexShaderSource:{get:function(){return this._vertexShaderSource}},fragmentShaderSource:{get:function(){return this._fragmentShaderSource}},renderState:{get:function(){return this._renderState}},closed:{get:function(){return this._closed}},materialSupport:{get:function(){return this._materialSupport}},vertexFormat:{get:function(){return this._vertexFormat}},flat:{get:function(){return this._flat}},faceForward:{get:function(){return this._faceForward}}});vx.prototype.getFragmentShaderSource=wr.prototype.getFragmentShaderSource;vx.prototype.isTranslucent=wr.prototype.isTranslucent;vx.prototype.getRenderState=wr.prototype.getRenderState;vx.MaterialSupport={BASIC:Object.freeze({vertexFormat:Be.POSITION_AND_NORMAL,vertexShaderSource:BM,fragmentShaderSource:FM}),TEXTURED:Object.freeze({vertexFormat:Be.POSITION_NORMAL_AND_ST,vertexShaderSource:UM,fragmentShaderSource:kM}),ALL:Object.freeze({vertexFormat:Be.ALL,vertexShaderSource:LM,fragmentShaderSource:NM})};var Er=vx;var sN=`in vec3 v_positionEC; -in vec3 v_normalEC; -in vec4 v_color; -void main() -{ -vec3 positionToEyeEC = -v_positionEC; -vec3 normalEC = normalize(v_normalEC); -#ifdef FACE_FORWARD -normalEC = faceforward(normalEC, vec3(0.0, 0.0, 1.0), -normalEC); -#endif -vec4 color = czm_gammaCorrect(v_color); -czm_materialInput materialInput; -materialInput.normalEC = normalEC; -materialInput.positionToEyeEC = positionToEyeEC; -czm_material material = czm_getDefaultMaterial(materialInput); -material.diffuse = color.rgb; -material.alpha = color.a; -out_FragColor = czm_phong(normalize(positionToEyeEC), material, czm_lightDirectionEC); -} -`;var aN=`in vec3 position3DHigh; -in vec3 position3DLow; -in vec3 normal; -in vec4 color; -in float batchId; -out vec3 v_positionEC; -out vec3 v_normalEC; -out vec4 v_color; -void main() -{ -vec4 p = czm_computePosition(); -v_positionEC = (czm_modelViewRelativeToEye * p).xyz; -v_normalEC = czm_normal * normal; -v_color = color; -gl_Position = czm_modelViewProjectionRelativeToEye * p; -} -`;var Sx=`in vec4 v_color; -void main() -{ -out_FragColor = czm_gammaCorrect(v_color); -} -`;var cN=`in vec3 position3DHigh; -in vec3 position3DLow; -in vec4 color; -in float batchId; -out vec4 v_color; -void main() -{ -vec4 p = czm_computePosition(); -v_color = color; -gl_Position = czm_modelViewProjectionRelativeToEye * p; -} -`;function _g(e){e=e??H.EMPTY_OBJECT;let t=e.translucent??!0,n=e.closed??!1,i=e.flat??!1,r=i?cN:aN,o=i?Sx:sN,s=i?_g.FLAT_VERTEX_FORMAT:_g.VERTEX_FORMAT;this.material=void 0,this.translucent=t,this._vertexShaderSource=e.vertexShaderSource??r,this._fragmentShaderSource=e.fragmentShaderSource??o,this._renderState=wr.getDefaultRenderState(t,n,e.renderState),this._closed=n,this._vertexFormat=s,this._flat=i,this._faceForward=e.faceForward??!n}Object.defineProperties(_g.prototype,{vertexShaderSource:{get:function(){return this._vertexShaderSource}},fragmentShaderSource:{get:function(){return this._fragmentShaderSource}},renderState:{get:function(){return this._renderState}},closed:{get:function(){return this._closed}},vertexFormat:{get:function(){return this._vertexFormat}},flat:{get:function(){return this._flat}},faceForward:{get:function(){return this._faceForward}}});_g.VERTEX_FORMAT=Be.POSITION_AND_NORMAL;_g.FLAT_VERTEX_FORMAT=Be.POSITION_ONLY;_g.prototype.getFragmentShaderSource=wr.prototype.getFragmentShaderSource;_g.prototype.isTranslucent=wr.prototype.isTranslucent;_g.prototype.getRenderState=wr.prototype.getRenderState;var yn=_g;function Fv(e){this._definitionChanged=new be,this._color=void 0,this._colorSubscription=void 0,this.color=e}Object.defineProperties(Fv.prototype,{isConstant:{get:function(){return X.isConstant(this._color)}},definitionChanged:{get:function(){return this._definitionChanged}},color:me("color")});Fv.prototype.getType=function(e){return"Color"};var GHe=new K;Fv.prototype.getValue=function(e,t){return l(e)||(e=K.now(GHe)),l(t)||(t={}),t.color=X.getValueOrClonedDefault(this._color,e,z.WHITE,t.color),t};Fv.prototype.equals=function(e){return this===e||e instanceof Fv&&X.equals(this._color,e._color)};var Kt=Fv;var KX=class{constructor(t){t=t??H.EMPTY_OBJECT,this._ellipsoid=t.ellipsoid??ee.default,this._rectangle=t.rectangle??ie.MAX_VALUE,this._projection=new Ui(this._ellipsoid),this._numberOfLevelZeroTilesX=t.numberOfLevelZeroTilesX??2,this._numberOfLevelZeroTilesY=t.numberOfLevelZeroTilesY??1}get ellipsoid(){return this._ellipsoid}get rectangle(){return this._rectangle}get projection(){return this._projection}getNumberOfXTilesAtLevel(t){return this._numberOfLevelZeroTilesX<<t}getNumberOfYTilesAtLevel(t){return this._numberOfLevelZeroTilesY<<t}rectangleToNativeRectangle(t,n){let i=D.toDegrees(t.west),r=D.toDegrees(t.south),o=D.toDegrees(t.east),s=D.toDegrees(t.north);return l(n)?(n.west=i,n.south=r,n.east=o,n.north=s,n):new ie(i,r,o,s)}tileXYToNativeRectangle(t,n,i,r){let o=this.tileXYToRectangle(t,n,i,r);return o.west=D.toDegrees(o.west),o.south=D.toDegrees(o.south),o.east=D.toDegrees(o.east),o.north=D.toDegrees(o.north),o}tileXYToRectangle(t,n,i,r){let o=this._rectangle,s=this.getNumberOfXTilesAtLevel(i),a=this.getNumberOfYTilesAtLevel(i),c=o.width/s,u=t*c+o.west,f=(t+1)*c+o.west,d=o.height/a,p=o.north-n*d,g=o.north-(n+1)*d;return l(r)||(r=new ie(u,g,f,p)),r.west=u,r.south=g,r.east=f,r.north=p,r}positionToTileXY(t,n,i){let r=this._rectangle;if(!ie.contains(r,t))return;let o=this.getNumberOfXTilesAtLevel(n),s=this.getNumberOfYTilesAtLevel(n),a=r.width/o,c=r.height/s,u=t.longitude;r.east<r.west&&(u+=D.TWO_PI);let f=(u-r.west)/a|0;f>=o&&(f=o-1);let d=(r.north-t.latitude)/c|0;return d>=s&&(d=s-1),l(i)?(i.x=f,i.y=d,i):new U(f,d)}},er=KX;var Khe=new h,$he=new h,Jhe=new he,$X=new h,WHe=new h,Zhe=new ue,qHe=new er,lN=[new he,new he,new he,new he],uN=new U,zs={};zs.initialize=function(){let e=zs._initPromise;return l(e)||(e=De.fetchJson(Zt("Assets/approximateTerrainHeights.json")).then(function(t){zs._terrainHeights=t}),zs._initPromise=e),e};zs.getMinimumMaximumHeights=function(e,t){t=t??ee.default;let n=Qhe(e),i=zs._defaultMinTerrainHeight,r=zs._defaultMaxTerrainHeight;if(l(n)){let o=`${n.level}-${n.x}-${n.y}`,s=zs._terrainHeights[o];l(s)&&(i=s[0],r=s[1]),t.cartographicToCartesian(ie.northeast(e,Jhe),Khe),t.cartographicToCartesian(ie.southwest(e,Jhe),$he),h.midpoint($he,Khe,$X);let a=t.scaleToGeodeticSurface($X,WHe);if(l(a)){let c=h.distance($X,a);i=Math.min(i,-c)}else i=zs._defaultMinTerrainHeight}return i=Math.max(zs._defaultMinTerrainHeight,i),{minimumTerrainHeight:i,maximumTerrainHeight:r}};zs.getBoundingSphere=function(e,t){t=t??ee.default;let n=Qhe(e),i=zs._defaultMaxTerrainHeight;if(l(n)){let o=`${n.level}-${n.x}-${n.y}`,s=zs._terrainHeights[o];l(s)&&(i=s[1])}let r=ue.fromRectangle3D(e,t,0);return ue.fromRectangle3D(e,t,i,Zhe),ue.union(r,Zhe,r)};function Qhe(e){he.fromRadians(e.east,e.north,0,lN[0]),he.fromRadians(e.west,e.north,0,lN[1]),he.fromRadians(e.east,e.south,0,lN[2]),he.fromRadians(e.west,e.south,0,lN[3]);let t=0,n=0,i=0,r=0,o=zs._terrainHeightsMaxLevel,s;for(s=0;s<=o;++s){let a=!1;for(let c=0;c<4;++c){let u=lN[c];if(qHe.positionToTileXY(u,s,uN),c===0)i=uN.x,r=uN.y;else if(i!==uN.x||r!==uN.y){a=!0;break}}if(a)break;t=i,n=r}if(s!==0)return{x:t,y:n,level:s>o?o:s-1}}zs._terrainHeightsMaxLevel=6;zs._defaultMaxTerrainHeight=9e3;zs._defaultMinTerrainHeight=-1e5;zs._terrainHeights=void 0;zs._initPromise=void 0;Object.defineProperties(zs,{initialized:{get:function(){return l(zs._terrainHeights)}}});var Mi=zs;function ac(e,t,n){this.minimum=h.clone(e??h.ZERO),this.maximum=h.clone(t??h.ZERO),l(n)?n=h.clone(n):n=h.midpoint(this.minimum,this.maximum,new h),this.center=n}ac.fromCorners=function(e,t,n){return l(n)||(n=new ac),n.minimum=h.clone(e,n.minimum),n.maximum=h.clone(t,n.maximum),n.center=h.midpoint(e,t,n.center),n};ac.fromPoints=function(e,t){if(l(t)||(t=new ac),!l(e)||e.length===0)return t.minimum=h.clone(h.ZERO,t.minimum),t.maximum=h.clone(h.ZERO,t.maximum),t.center=h.clone(h.ZERO,t.center),t;let n=e[0].x,i=e[0].y,r=e[0].z,o=e[0].x,s=e[0].y,a=e[0].z,c=e.length;for(let d=1;d<c;d++){let p=e[d],g=p.x,m=p.y,y=p.z;n=Math.min(g,n),o=Math.max(g,o),i=Math.min(m,i),s=Math.max(m,s),r=Math.min(y,r),a=Math.max(y,a)}let u=t.minimum;u.x=n,u.y=i,u.z=r;let f=t.maximum;return f.x=o,f.y=s,f.z=a,t.center=h.midpoint(u,f,t.center),t};ac.clone=function(e,t){if(l(e))return l(t)?(t.minimum=h.clone(e.minimum,t.minimum),t.maximum=h.clone(e.maximum,t.maximum),t.center=h.clone(e.center,t.center),t):new ac(e.minimum,e.maximum,e.center)};ac.equals=function(e,t){return e===t||l(e)&&l(t)&&h.equals(e.center,t.center)&&h.equals(e.minimum,t.minimum)&&h.equals(e.maximum,t.maximum)};var y6=new h;ac.intersectPlane=function(e,t){y6=h.subtract(e.maximum,e.minimum,y6);let n=h.multiplyByScalar(y6,.5,y6),i=t.normal,r=n.x*Math.abs(i.x)+n.y*Math.abs(i.y)+n.z*Math.abs(i.z),o=h.dot(e.center,i)+t.distance;return o-r>0?$t.INSIDE:o+r<0?$t.OUTSIDE:$t.INTERSECTING};ac.intersectAxisAlignedBoundingBox=function(e,t){return e.minimum.x<=t.maximum.x&&e.maximum.x>=t.minimum.x&&e.minimum.y<=t.maximum.y&&e.maximum.y>=t.minimum.y&&e.minimum.z<=t.maximum.z&&e.maximum.z>=t.minimum.z};ac.prototype.clone=function(e){return ac.clone(this,e)};ac.prototype.intersectPlane=function(e){return ac.intersectPlane(this,e)};ac.prototype.intersectAxisAlignedBoundingBox=function(e){return ac.intersectAxisAlignedBoundingBox(this,e)};ac.prototype.equals=function(e){return ac.equals(this,e)};var If=ac;var JX=new se;function Bp(e,t){t=t??ee.default,e=t.scaleToGeodeticSurface(e);let n=At.eastNorthUpToFixedFrame(e,t);this._ellipsoid=t,this._origin=e,this._xAxis=h.fromCartesian4(N.getColumn(n,0,JX)),this._yAxis=h.fromCartesian4(N.getColumn(n,1,JX));let i=h.fromCartesian4(N.getColumn(n,2,JX));this._plane=sn.fromPointNormal(e,i)}Object.defineProperties(Bp.prototype,{ellipsoid:{get:function(){return this._ellipsoid}},origin:{get:function(){return this._origin}},plane:{get:function(){return this._plane}},xAxis:{get:function(){return this._xAxis}},yAxis:{get:function(){return this._yAxis}},zAxis:{get:function(){return this._plane.normal}}});var YHe=new If;Bp.fromPoints=function(e,t){let n=If.fromPoints(e,YHe);return new Bp(n.center,t)};var eme=new pn,A6=new h;Bp.prototype.projectPointOntoPlane=function(e,t){let n=eme;n.origin=e,h.normalize(e,n.direction);let i=_i.rayPlane(n,this._plane,A6);if(l(i)||(h.negate(n.direction,n.direction),i=_i.rayPlane(n,this._plane,A6)),l(i)){let r=h.subtract(i,this._origin,i),o=h.dot(this._xAxis,r),s=h.dot(this._yAxis,r);return l(t)?(t.x=o,t.y=s,t):new U(o,s)}};Bp.prototype.projectPointsOntoPlane=function(e,t){l(t)||(t=[]);let n=0,i=e.length;for(let r=0;r<i;r++){let o=this.projectPointOntoPlane(e[r],t[n]);l(o)&&(t[n]=o,n++)}return t.length=n,t};Bp.prototype.projectPointToNearestOnPlane=function(e,t){l(t)||(t=new U);let n=eme;n.origin=e,h.clone(this._plane.normal,n.direction);let i=_i.rayPlane(n,this._plane,A6);l(i)||(h.negate(n.direction,n.direction),i=_i.rayPlane(n,this._plane,A6));let r=h.subtract(i,this._origin,i),o=h.dot(this._xAxis,r),s=h.dot(this._yAxis,r);return t.x=o,t.y=s,t};Bp.prototype.projectPointsToNearestOnPlane=function(e,t){l(t)||(t=[]);let n=e.length;t.length=n;for(let i=0;i<n;i++)t[i]=this.projectPointToNearestOnPlane(e[i],t[i]);return t};var XHe=new h;Bp.prototype.projectPointOntoEllipsoid=function(e,t){l(t)||(t=new h);let n=this._ellipsoid,i=this._origin,r=this._xAxis,o=this._yAxis,s=XHe;return h.multiplyByScalar(r,e.x,s),t=h.add(i,s,t),h.multiplyByScalar(o,e.y,s),h.add(t,s,t),n.scaleToGeocentricSurface(t,t),t};Bp.prototype.projectPointsOntoEllipsoid=function(e,t){let n=e.length;l(t)?t.length=n:t=new Array(n);for(let i=0;i<n;++i)t[i]=this.projectPointOntoEllipsoid(e[i],t[i]);return t};var Vs=Bp;function fr(e,t){this.center=h.clone(e??h.ZERO),this.halfAxes=$.clone(t??$.ZERO)}fr.packedLength=h.packedLength+$.packedLength;fr.pack=function(e,t,n){return n=n??0,h.pack(e.center,t,n),$.pack(e.halfAxes,t,n+h.packedLength),t};fr.unpack=function(e,t,n){return t=t??0,l(n)||(n=new fr),h.unpack(e,t,n.center),$.unpack(e,t+h.packedLength,n.halfAxes),n};var KHe=new h,$He=new h,JHe=new h,ZHe=new h,QHe=new h,eGe=new h,tGe=new $,nGe={unitary:new $,diagonal:new $};fr.fromPoints=function(e,t){if(l(t)||(t=new fr),!l(e)||e.length===0)return t.halfAxes=$.ZERO,t.center=h.ZERO,t;let n,i=e.length,r=h.clone(e[0],KHe);for(n=1;n<i;n++)h.add(r,e[n],r);let o=1/i;h.multiplyByScalar(r,o,r);let s=0,a=0,c=0,u=0,f=0,d=0,p;for(n=0;n<i;n++)p=h.subtract(e[n],r,$He),s+=p.x*p.x,a+=p.x*p.y,c+=p.x*p.z,u+=p.y*p.y,f+=p.y*p.z,d+=p.z*p.z;s*=o,a*=o,c*=o,u*=o,f*=o,d*=o;let g=tGe;g[0]=s,g[1]=a,g[2]=c,g[3]=a,g[4]=u,g[5]=f,g[6]=c,g[7]=f,g[8]=d;let m=$.computeEigenDecomposition(g,nGe),y=$.clone(m.unitary,t.halfAxes),A=$.getColumn(y,0,ZHe),b=$.getColumn(y,1,QHe),x=$.getColumn(y,2,eGe),T=-Number.MAX_VALUE,E=-Number.MAX_VALUE,v=-Number.MAX_VALUE,S=Number.MAX_VALUE,I=Number.MAX_VALUE,R=Number.MAX_VALUE;for(n=0;n<i;n++)p=e[n],T=Math.max(h.dot(A,p),T),E=Math.max(h.dot(b,p),E),v=Math.max(h.dot(x,p),v),S=Math.min(h.dot(A,p),S),I=Math.min(h.dot(b,p),I),R=Math.min(h.dot(x,p),R);A=h.multiplyByScalar(A,.5*(S+T),A),b=h.multiplyByScalar(b,.5*(I+E),b),x=h.multiplyByScalar(x,.5*(R+v),x);let O=h.add(A,b,t.center);h.add(O,x,O);let L=JHe;return L.x=T-S,L.y=E-I,L.z=v-R,h.multiplyByScalar(L,.5,L),$.multiplyByScale(t.halfAxes,L,t.halfAxes),t};var sme=new h,iGe=new h;function tme(e,t,n,i,r,o,s,a,c,u,f){l(f)||(f=new fr);let d=f.halfAxes;$.setColumn(d,0,t,d),$.setColumn(d,1,n,d),$.setColumn(d,2,i,d);let p=sme;p.x=(r+o)/2,p.y=(s+a)/2,p.z=(c+u)/2;let g=iGe;g.x=(o-r)/2,g.y=(a-s)/2,g.z=(u-c)/2;let m=f.center;return p=$.multiplyByVector(d,p,p),h.add(e,p,m),$.multiplyByScale(d,g,d),f}var nme=new he,rGe=new h,oGe=new he,sGe=new he,aGe=new he,cGe=new he,lGe=new he,uGe=new h,ime=new h,fGe=new h,rme=new h,dGe=new h,hGe=new U,mGe=new U,pGe=new U,gGe=new U,_Ge=new U,yGe=new h,AGe=new h,bGe=new h,xGe=new h,TGe=new U,EGe=new h,CGe=new h,vGe=new h,SGe=new sn(h.UNIT_X,0);fr.fromRectangle=function(e,t,n,i,r){t=t??0,n=n??0,i=i??ee.default;let o,s,a,c,u,f,d;if(e.width<=D.PI){let I=ie.center(e,nme),R=i.cartographicToCartesian(I,rGe),O=new Vs(R,i);d=O.plane;let L=I.longitude,_=e.south<0&&e.north>0?0:I.latitude,C=he.fromRadians(L,e.north,n,oGe),w=he.fromRadians(e.west,e.north,n,sGe),P=he.fromRadians(e.west,_,n,aGe),M=he.fromRadians(e.west,e.south,n,cGe),F=he.fromRadians(L,e.south,n,lGe),V=i.cartographicToCartesian(C,uGe),B=i.cartographicToCartesian(w,ime),j=i.cartographicToCartesian(P,fGe),k=i.cartographicToCartesian(M,rme),G=i.cartographicToCartesian(F,dGe),q=O.projectPointToNearestOnPlane(V,hGe),Q=O.projectPointToNearestOnPlane(B,mGe),W=O.projectPointToNearestOnPlane(j,pGe),J=O.projectPointToNearestOnPlane(k,gGe),Z=O.projectPointToNearestOnPlane(G,_Ge);return o=Math.min(Q.x,W.x,J.x),s=-o,c=Math.max(Q.y,q.y),a=Math.min(J.y,Z.y),w.height=M.height=t,B=i.cartographicToCartesian(w,ime),k=i.cartographicToCartesian(M,rme),u=Math.min(sn.getPointDistance(d,B),sn.getPointDistance(d,k)),f=n,tme(O.origin,O.xAxis,O.yAxis,O.zAxis,o,s,a,c,u,f,r)}let p=e.south>0,g=e.north<0,m=p?e.south:g?e.north:0,y=ie.center(e,nme).longitude,A=h.fromRadians(y,m,n,i,yGe);A.z=0;let x=Math.abs(A.x)<D.EPSILON10&&Math.abs(A.y)<D.EPSILON10?h.UNIT_X:h.normalize(A,AGe),T=h.UNIT_Z,E=h.cross(x,T,bGe);d=sn.fromPointNormal(A,x,SGe);let v=h.fromRadians(y+D.PI_OVER_TWO,m,n,i,xGe);s=h.dot(sn.projectPointOntoPlane(d,v,TGe),E),o=-s,c=h.fromRadians(0,e.north,g?t:n,i,EGe).z,a=h.fromRadians(0,e.south,p?t:n,i,CGe).z;let S=h.fromRadians(e.east,m,n,i,vGe);return u=sn.getPointDistance(d,S),f=0,tme(A,E,T,x,o,s,a,c,u,f,r)};fr.fromTransformation=function(e,t){return l(t)||(t=new fr),t.center=N.getTranslation(e,t.center),t.halfAxes=N.getMatrix3(e,t.halfAxes),t.halfAxes=$.multiplyByScalar(t.halfAxes,.5,t.halfAxes),t};fr.clone=function(e,t){if(l(e))return l(t)?(h.clone(e.center,t.center),$.clone(e.halfAxes,t.halfAxes),t):new fr(e.center,e.halfAxes)};fr.intersectPlane=function(e,t){let n=e.center,i=t.normal,r=e.halfAxes,o=i.x,s=i.y,a=i.z,c=Math.abs(o*r[$.COLUMN0ROW0]+s*r[$.COLUMN0ROW1]+a*r[$.COLUMN0ROW2])+Math.abs(o*r[$.COLUMN1ROW0]+s*r[$.COLUMN1ROW1]+a*r[$.COLUMN1ROW2])+Math.abs(o*r[$.COLUMN2ROW0]+s*r[$.COLUMN2ROW1]+a*r[$.COLUMN2ROW2]),u=h.dot(i,n)+t.distance;return u<=-c?$t.OUTSIDE:u>=c?$t.INSIDE:$t.INTERSECTING};var ame=new h,cme=new h,lme=new h,wGe=new h,ome=new h,IGe=new h;fr.distanceSquaredTo=function(e,t){let n=h.subtract(t,e.center,sme),i=e.halfAxes,r=$.getColumn(i,0,ame),o=$.getColumn(i,1,cme),s=$.getColumn(i,2,lme),a=h.magnitude(r),c=h.magnitude(o),u=h.magnitude(s),f=!0,d=!0,p=!0;a>0?h.divideByScalar(r,a,r):f=!1,c>0?h.divideByScalar(o,c,o):d=!1,u>0?h.divideByScalar(s,u,s):p=!1;let g=!f+!d+!p,m,y,A;if(g===1){let E=r;m=o,y=s,d?p||(E=s,y=r):(E=o,m=r),A=h.cross(m,y,ome),E===r?r=A:E===o?o=A:E===s&&(s=A)}else if(g===2){m=r,d?m=o:p&&(m=s);let E=h.UNIT_Y;E.equalsEpsilon(m,D.EPSILON3)&&(E=h.UNIT_X),y=h.cross(m,E,wGe),h.normalize(y,y),A=h.cross(m,y,ome),h.normalize(A,A),m===r?(o=y,s=A):m===o?(s=y,r=A):m===s&&(r=y,o=A)}else g===3&&(r=h.UNIT_X,o=h.UNIT_Y,s=h.UNIT_Z);let b=IGe;b.x=h.dot(n,r),b.y=h.dot(n,o),b.z=h.dot(n,s);let x=0,T;return b.x<-a?(T=b.x+a,x+=T*T):b.x>a&&(T=b.x-a,x+=T*T),b.y<-c?(T=b.y+c,x+=T*T):b.y>c&&(T=b.y-c,x+=T*T),b.z<-u?(T=b.z+u,x+=T*T):b.z>u&&(T=b.z-u,x+=T*T),x};var PGe=new h,DGe=new h;fr.computePlaneDistances=function(e,t,n,i){l(i)||(i=new Us);let r=Number.POSITIVE_INFINITY,o=Number.NEGATIVE_INFINITY,s=e.center,a=e.halfAxes,c=$.getColumn(a,0,ame),u=$.getColumn(a,1,cme),f=$.getColumn(a,2,lme),d=h.add(c,u,PGe);h.add(d,f,d),h.add(d,s,d);let p=h.subtract(d,t,DGe),g=h.dot(n,p);return r=Math.min(g,r),o=Math.max(g,o),h.add(s,c,d),h.add(d,u,d),h.subtract(d,f,d),h.subtract(d,t,p),g=h.dot(n,p),r=Math.min(g,r),o=Math.max(g,o),h.add(s,c,d),h.subtract(d,u,d),h.add(d,f,d),h.subtract(d,t,p),g=h.dot(n,p),r=Math.min(g,r),o=Math.max(g,o),h.add(s,c,d),h.subtract(d,u,d),h.subtract(d,f,d),h.subtract(d,t,p),g=h.dot(n,p),r=Math.min(g,r),o=Math.max(g,o),h.subtract(s,c,d),h.add(d,u,d),h.add(d,f,d),h.subtract(d,t,p),g=h.dot(n,p),r=Math.min(g,r),o=Math.max(g,o),h.subtract(s,c,d),h.add(d,u,d),h.subtract(d,f,d),h.subtract(d,t,p),g=h.dot(n,p),r=Math.min(g,r),o=Math.max(g,o),h.subtract(s,c,d),h.subtract(d,u,d),h.add(d,f,d),h.subtract(d,t,p),g=h.dot(n,p),r=Math.min(g,r),o=Math.max(g,o),h.subtract(s,c,d),h.subtract(d,u,d),h.subtract(d,f,d),h.subtract(d,t,p),g=h.dot(n,p),r=Math.min(g,r),o=Math.max(g,o),i.start=r,i.stop=o,i};var RGe=new h,OGe=new h,MGe=new h;fr.computeCorners=function(e,t){l(t)||(t=[new h,new h,new h,new h,new h,new h,new h,new h]);let n=e.center,i=e.halfAxes,r=$.getColumn(i,0,RGe),o=$.getColumn(i,1,OGe),s=$.getColumn(i,2,MGe);return h.clone(n,t[0]),h.subtract(t[0],r,t[0]),h.subtract(t[0],o,t[0]),h.subtract(t[0],s,t[0]),h.clone(n,t[1]),h.subtract(t[1],r,t[1]),h.subtract(t[1],o,t[1]),h.add(t[1],s,t[1]),h.clone(n,t[2]),h.subtract(t[2],r,t[2]),h.add(t[2],o,t[2]),h.subtract(t[2],s,t[2]),h.clone(n,t[3]),h.subtract(t[3],r,t[3]),h.add(t[3],o,t[3]),h.add(t[3],s,t[3]),h.clone(n,t[4]),h.add(t[4],r,t[4]),h.subtract(t[4],o,t[4]),h.subtract(t[4],s,t[4]),h.clone(n,t[5]),h.add(t[5],r,t[5]),h.subtract(t[5],o,t[5]),h.add(t[5],s,t[5]),h.clone(n,t[6]),h.add(t[6],r,t[6]),h.add(t[6],o,t[6]),h.subtract(t[6],s,t[6]),h.clone(n,t[7]),h.add(t[7],r,t[7]),h.add(t[7],o,t[7]),h.add(t[7],s,t[7]),t};var NGe=new $;fr.computeTransformation=function(e,t){l(t)||(t=new N);let n=e.center,i=$.multiplyByUniformScale(e.halfAxes,2,NGe);return N.fromRotationTranslation(i,n,t)};var LGe=new ue;fr.isOccluded=function(e,t){let n=ue.fromOrientedBoundingBox(e,LGe);return!t.isBoundingSphereVisible(n)};fr.prototype.intersectPlane=function(e){return fr.intersectPlane(this,e)};fr.prototype.distanceSquaredTo=function(e){return fr.distanceSquaredTo(this,e)};fr.prototype.computePlaneDistances=function(e,t,n){return fr.computePlaneDistances(this,e,t,n)};fr.prototype.computeCorners=function(e){return fr.computeCorners(this,e)};fr.prototype.computeTransformation=function(e){return fr.computeTransformation(this,e)};fr.prototype.isOccluded=function(e){return fr.isOccluded(this,e)};fr.equals=function(e,t){return e===t||l(e)&&l(t)&&h.equals(e.center,t.center)&&$.equals(e.halfAxes,t.halfAxes)};fr.prototype.clone=function(e){return fr.clone(this,e)};fr.prototype.equals=function(e){return fr.equals(this,e)};var en=fr;var b6={};b6.getHeight=function(e,t,n){return(e-n)*t+n};var FGe=new he;b6.getPosition=function(e,t,n,i,r){let o=t.cartesianToCartographic(e,FGe);if(!l(o))return h.clone(e,r);let s=b6.getHeight(o.height,n,i);return h.fromRadians(o.longitude,o.latitude,s,t,r)};var Ar=b6;var ZX={TERRAIN:0,CESIUM_3D_TILE:1,BOTH:2};ZX.NUMBER_OF_CLASSIFICATION_TYPES=3;Object.freeze(ZX);var ei=ZX;var ume={NEVER:te.NEVER,LESS:te.LESS,EQUAL:te.EQUAL,LESS_OR_EQUAL:te.LEQUAL,GREATER:te.GREATER,NOT_EQUAL:te.NOTEQUAL,GREATER_OR_EQUAL:te.GEQUAL,ALWAYS:te.ALWAYS};Object.freeze(ume);var cc=ume;function BGe(e,t){let n=[],i=e.length,r=0;for(;r<i;){let o=Math.ceil((i-r)/t--);n.push(e.slice(r,r+o)),r+=o}return n}var fN=BGe;function yg(e,t,n){if(this._attributes=t,this._numberOfInstances=n,t.length===0)return;let i=kGe(t),r=e.floatingPointTexture,o=i===ze.FLOAT&&!r,s=UGe(t,o),a=zGe(s,t,o),c=Math.floor(kt.maximumTextureSize/a),u=Math.min(n,c),f=a*u,d=Math.ceil(n/u),p=1/f,g=p*.5,m=1/d,y=m*.5;this._textureDimensions=new U(f,d),this._textureStep=new se(p,g,m,y),this._pixelDatatype=o?ze.UNSIGNED_BYTE:i,this._packFloats=o,this._offsets=s,this._stride=a,this._texture=void 0;let A=4*f*d;this._batchValues=i===ze.FLOAT&&!o?new Float32Array(A):new Uint8Array(A),this._batchValuesDirty=!1}Object.defineProperties(yg.prototype,{attributes:{get:function(){return this._attributes}},numberOfInstances:{get:function(){return this._numberOfInstances}}});function kGe(e){let t=!1,n=e.length;for(let i=0;i<n;++i)if(e[i].componentDatatype!==Y.UNSIGNED_BYTE){t=!0;break}return t?ze.FLOAT:ze.UNSIGNED_BYTE}function dme(e,t){let n=e[t].componentsPerAttribute;return n===2?U:n===3?h:n===4?se:Number}function UGe(e,t){let n=new Array(e.length),i=0,r=e.length;for(let o=0;o<r;++o){let a=e[o].componentDatatype;n[o]=i,a!==Y.UNSIGNED_BYTE&&t?i+=4:++i}return n}function zGe(e,t,n){let i=e.length,r=e[i-1];return t[i-1].componentDatatype!==Y.UNSIGNED_BYTE&&n?r+4:r+1}var dN=new se;function VGe(e,t,n){let i=se.unpack(e,t,dN),r=se.unpackFloat(i);i=se.unpack(e,t+4,dN);let o=se.unpackFloat(i);i=se.unpack(e,t+8,dN);let s=se.unpackFloat(i);i=se.unpack(e,t+12,dN);let a=se.unpackFloat(i);return se.fromElements(r,o,s,a,n)}function jGe(e,t,n){let i=se.packFloat(e.x,dN);se.pack(i,t,n),i=se.packFloat(e.y,i),se.pack(i,t,n+4),i=se.packFloat(e.z,i),se.pack(i,t,n+8),i=se.packFloat(e.w,i),se.pack(i,t,n+12)}var fme=new se;yg.prototype.getBatchedAttribute=function(e,t,n){let i=this._attributes,r=this._offsets[t],s=4*this._stride*e+4*r,a;this._packFloats&&i[t].componentDatatype!==ze.UNSIGNED_BYTE?a=VGe(this._batchValues,s,fme):a=se.unpack(this._batchValues,s,fme);let c=dme(i,t);return l(c.fromCartesian4)?c.fromCartesian4(a,n):l(c.clone)?c.clone(a,n):a.x};var HGe=[void 0,void 0,new U,new h,new se],GGe=new se;yg.prototype.setBatchedAttribute=function(e,t,n){let i=this._attributes,r=HGe[i[t].componentsPerAttribute],o=this.getBatchedAttribute(e,t,r),s=dme(this._attributes,t);if(l(s.equals)?s.equals(o,n):o===n)return;let c=GGe;c.x=l(n.x)?n.x:n,c.y=l(n.y)?n.y:0,c.z=l(n.z)?n.z:0,c.w=l(n.w)?n.w:0;let u=this._offsets[t],d=4*this._stride*e+4*u;this._packFloats&&i[t].componentDatatype!==ze.UNSIGNED_BYTE?jGe(c,this._batchValues,d):se.pack(c,this._batchValues,d),this._batchValuesDirty=!0};function WGe(e,t){let n=e._textureDimensions;e._texture=new Dt({context:t,pixelFormat:Ke.RGBA,pixelDatatype:e._pixelDatatype,width:n.x,height:n.y,sampler:jt.NEAREST,flipY:!1})}function qGe(e){let t=e._textureDimensions;e._texture.copyFrom({source:{width:t.x,height:t.y,arrayBufferView:e._batchValues}})}yg.prototype.update=function(e){l(this._texture)&&!this._batchValuesDirty||this._attributes.length===0||(this._batchValuesDirty=!1,l(this._texture)||WGe(this,e.context),qGe(this))};yg.prototype.getUniformMapCallback=function(){let e=this;return function(t){return e._attributes.length===0?t:Ot(t,{batchTexture:function(){return e._texture},batchTextureDimensions:function(){return e._textureDimensions},batchTextureStep:function(){return e._textureStep}})}};function YGe(e){let t=e._stride;return e._textureDimensions.y===1?`uniform vec4 batchTextureStep; +`}}var xme={mat2:Xi,mat3:$,mat4:N},fGe=/\.ktx2$/i;function dGe(e){let t;return function(n,i){let r=n.uniforms,o=r[e],s=t!==o,a=!l(o)||o===it.DefaultImageId;t=o;let c=n._textures[e],u,f;if(o instanceof HTMLVideoElement){if(o.readyState>=2){if(s&&l(c)&&(c!==i.defaultTexture&&c.destroy(),c=void 0),!l(c)||c===i.defaultTexture){let d=new jt({minificationFilter:n._minificationFilter,magnificationFilter:n._magnificationFilter});c=new Dt({context:i,source:o,sampler:d}),n._textures[e]=c;return}c.copyFrom({source:o})}else l(c)||(n._textures[e]=i.defaultTexture);return}if(o instanceof Dt&&o!==c){n._texturePaths[e]=void 0;let d=n._textures[e];l(d)&&d!==n._defaultTexture&&d.destroy(),n._textures[e]=o,u=`${e}Dimensions`,r.hasOwnProperty(u)&&(f=r[u],f.x=o._width,f.y=o._height);return}if(s&&l(c)&&a&&(c!==n._defaultTexture&&c.destroy(),c=void 0,n._texturePaths[e]=void 0),l(c)||(c=n._textures[e]=n._defaultTexture,u=`${e}Dimensions`,r.hasOwnProperty(u)&&(f=r[u],f.x=c._width,f.y=c._height)),!a){if((o instanceof HTMLCanvasElement||o instanceof HTMLImageElement||o instanceof ImageBitmap||o instanceof OffscreenCanvas)&&o!==n._texturePaths[e]){n._loadedImages.push({id:e,image:o}),n._texturePaths[e]=o;return}Eme(n,e)}}}function Eme(e,t){let i=e.uniforms[t];if(i===it.DefaultImageId)return Promise.resolve();let r=De.createIfNeeded(i);if(!(r instanceof De))return Promise.resolve();let o=De.createIfNeeded(e._texturePaths[t]);if(!(!l(o)||o.url!==r.url))return Promise.resolve();let a;return fGe.test(r.url)?a=Ou(r.url):a=r.fetchImage(),Promise.resolve(a).then(function(c){e._loadedImages.push({id:t,image:c})}).catch(function(c){e._initializationError=c;let u=e._textures[t];l(u)&&u!==e._defaultTexture&&u.destroy(),e._textures[t]=e._defaultTexture}),e._texturePaths[t]=i,a}function hGe(e){return function(t,n){let i=t.uniforms[e];if(i instanceof ns){let r=t._textures[e];r!==t._defaultTexture&&r.destroy(),t._texturePaths[e]=void 0,t._textures[e]=i;return}l(t._textures[e])||(t._textures[e]=n.defaultCubeMap),Cme(t,e)}}function Cme(e,t){let i=e.uniforms[t];if(i===it.DefaultCubeMapId)return Promise.resolve();let r=i.positiveX+i.negativeX+i.positiveY+i.negativeY+i.positiveZ+i.negativeZ;if(r===e._texturePaths[t])return Promise.resolve();let o=[De.createIfNeeded(i.positiveX).fetchImage(),De.createIfNeeded(i.negativeX).fetchImage(),De.createIfNeeded(i.positiveY).fetchImage(),De.createIfNeeded(i.negativeY).fetchImage(),De.createIfNeeded(i.positiveZ).fetchImage(),De.createIfNeeded(i.negativeZ).fetchImage()],s=Promise.all(o);return s.then(function(a){e._loadedCubeMaps.push({id:t,images:a})}).catch(function(a){e._initializationError=a}),e._texturePaths[t]=r,s}function mGe(e){let t=e._template.uniforms;for(let n in t)t.hasOwnProperty(n)&&vme(e,n)}function vme(e,t){let n=e._strict,i=e._template.uniforms,r=i[t],o=pGe(r),s;if(o==="channels")s=iN(e,t,r,!1);else{if(o==="sampler2D"){let u=`${t}Dimensions`;_Ge(e,u)>0&&(i[u]={type:"ivec3",x:1,y:1},vme(e,u))}if(!new RegExp(`uniform\\s+${o}\\s+${t}\\s*;`).test(e.shaderSource)){let u=`uniform ${o} ${t};`;e.shaderSource=u+e.shaderSource}let c=`${t}_${e._count++}`;if(s=iN(e,t,c),e.uniforms[t]=r,o==="sampler2D")e._uniforms[c]=function(){return e._textures[t]},e._updateFunctions.push(dGe(t)),e._initializationPromises.push(Eme(e,t));else if(o==="samplerCube")e._uniforms[c]=function(){return e._textures[t]},e._updateFunctions.push(hGe(t)),e._initializationPromises.push(Cme(e,t));else if(o.indexOf("mat")!==-1){let u=new xme[o];e._uniforms[c]=function(){return xme[o].fromColumnMajorArray(e.uniforms[t],u)}}else e._uniforms[c]=function(){return e.uniforms[t]}}}function pGe(e){let t=e.type;if(!l(t)){let n=typeof e;if(n==="number")t="float";else if(n==="boolean")t="bool";else if(n==="string"||e instanceof De||e instanceof HTMLCanvasElement||e instanceof HTMLImageElement||e instanceof ImageBitmap||e instanceof OffscreenCanvas)/^([rgba]){1,4}$/i.test(e)?t="channels":e===it.DefaultCubeMapId?t="samplerCube":t="sampler2D";else if(n==="object")if(Array.isArray(e))(e.length===4||e.length===9||e.length===16)&&(t=`mat${Math.sqrt(e.length)}`);else{let i=0;for(let r in e)e.hasOwnProperty(r)&&(i+=1);i>=2&&i<=4?t=`vec${i}`:i===6&&(t="samplerCube")}}return t}function gGe(e){let t=e._strict,n=e._template.materials;for(let i in n)if(n.hasOwnProperty(i)){let r=new it({strict:t,fabric:n[i],count:e._count});e._count=r._count,e._uniforms=Ot(e._uniforms,r._uniforms,!0),e.materials[i]=r,e._translucentFunctions=e._translucentFunctions.concat(r._translucentFunctions);let o="czm_getMaterial",s=`${o}_${e._count++}`;iN(r,o,s),e.shaderSource=r.shaderSource+e.shaderSource;let a=`${s}(materialInput)`,c=iN(e,i,a)}}function iN(e,t,n,i){i=i??!0;let r=0,o="([\\w])?",s=`([\\w${i?".":""}])?`,a=new RegExp(s+t+o,"g");return e.shaderSource=e.shaderSource.replace(a,function(c,u,f){return u||f?c:(r+=1,n)}),r}function _Ge(e,t,n){return iN(e,t,t,n)}it._materialCache={_materials:{},addMaterial:function(e,t){this._materials[e]=t},getMaterial:function(e){return this._materials[e]}};it.DefaultImageId="czm_defaultImage";it.DefaultCubeMapId="czm_defaultCubeMap";it.ColorType="Color";it._materialCache.addMaterial(it.ColorType,{fabric:{type:it.ColorType,uniforms:{color:new z(1,0,0,.5)},components:{diffuse:"color.rgb",alpha:"color.a"}},translucent:function(e){return e.uniforms.color.alpha<1}});it.ImageType="Image";it._materialCache.addMaterial(it.ImageType,{fabric:{type:it.ImageType,uniforms:{image:it.DefaultImageId,repeat:new U(1,1),color:new z(1,1,1,1)},components:{diffuse:"texture(image, fract(repeat * materialInput.st)).rgb * color.rgb",alpha:"texture(image, fract(repeat * materialInput.st)).a * color.a"}},translucent:function(e){return e.uniforms.color.alpha<1}});it.DiffuseMapType="DiffuseMap";it._materialCache.addMaterial(it.DiffuseMapType,{fabric:{type:it.DiffuseMapType,uniforms:{image:it.DefaultImageId,channels:"rgb",repeat:new U(1,1)},components:{diffuse:"texture(image, fract(repeat * materialInput.st)).channels"}},translucent:!1});it.AlphaMapType="AlphaMap";it._materialCache.addMaterial(it.AlphaMapType,{fabric:{type:it.AlphaMapType,uniforms:{image:it.DefaultImageId,channel:"a",repeat:new U(1,1)},components:{alpha:"texture(image, fract(repeat * materialInput.st)).channel"}},translucent:!0});it.SpecularMapType="SpecularMap";it._materialCache.addMaterial(it.SpecularMapType,{fabric:{type:it.SpecularMapType,uniforms:{image:it.DefaultImageId,channel:"r",repeat:new U(1,1)},components:{specular:"texture(image, fract(repeat * materialInput.st)).channel"}},translucent:!1});it.EmissionMapType="EmissionMap";it._materialCache.addMaterial(it.EmissionMapType,{fabric:{type:it.EmissionMapType,uniforms:{image:it.DefaultImageId,channels:"rgb",repeat:new U(1,1)},components:{emission:"texture(image, fract(repeat * materialInput.st)).channels"}},translucent:!1});it.BumpMapType="BumpMap";it._materialCache.addMaterial(it.BumpMapType,{fabric:{type:it.BumpMapType,uniforms:{image:it.DefaultImageId,channel:"r",strength:.8,repeat:new U(1,1)},source:UM},translucent:!1});it.NormalMapType="NormalMap";it._materialCache.addMaterial(it.NormalMapType,{fabric:{type:it.NormalMapType,uniforms:{image:it.DefaultImageId,channels:"rgb",strength:.8,repeat:new U(1,1)},source:YM},translucent:!1});it.GridType="Grid";it._materialCache.addMaterial(it.GridType,{fabric:{type:it.GridType,uniforms:{color:new z(0,1,0,1),cellAlpha:.1,lineCount:new U(8,8),lineThickness:new U(1,1),lineOffset:new U(0,0)},source:qM},translucent:function(e){let t=e.uniforms;return t.color.alpha<1||t.cellAlpha<1}});it.StripeType="Stripe";it._materialCache.addMaterial(it.StripeType,{fabric:{type:it.StripeType,uniforms:{horizontal:!0,evenColor:new z(1,1,1,.5),oddColor:new z(0,0,1,.5),offset:0,repeat:5},source:eN},translucent:function(e){let t=e.uniforms;return t.evenColor.alpha<1||t.oddColor.alpha<1}});it.CheckerboardType="Checkerboard";it._materialCache.addMaterial(it.CheckerboardType,{fabric:{type:it.CheckerboardType,uniforms:{lightColor:new z(1,1,1,.5),darkColor:new z(0,0,0,.5),repeat:new U(5,5)},source:zM},translucent:function(e){let t=e.uniforms;return t.lightColor.alpha<1||t.darkColor.alpha<1}});it.DotType="Dot";it._materialCache.addMaterial(it.DotType,{fabric:{type:it.DotType,uniforms:{lightColor:new z(1,1,0,.75),darkColor:new z(0,1,1,.75),repeat:new U(5,5)},source:VM},translucent:function(e){let t=e.uniforms;return t.lightColor.alpha<1||t.darkColor.alpha<1}});it.WaterType="Water";it._materialCache.addMaterial(it.WaterType,{fabric:{type:it.WaterType,uniforms:{baseWaterColor:new z(.2,.3,.6,1),blendColor:new z(0,1,.699,1),specularMap:it.DefaultImageId,normalMap:it.DefaultImageId,frequency:10,animationSpeed:.01,amplitude:1,specularIntensity:.5,fadeFactor:1},source:nN},translucent:function(e){let t=e.uniforms;return t.baseWaterColor.alpha<1||t.blendColor.alpha<1}});it.RimLightingType="RimLighting";it._materialCache.addMaterial(it.RimLightingType,{fabric:{type:it.RimLightingType,uniforms:{color:new z(1,0,0,.7),rimColor:new z(1,1,1,.4),width:.3},source:ZM},translucent:function(e){let t=e.uniforms;return t.color.alpha<1||t.rimColor.alpha<1}});it.FadeType="Fade";it._materialCache.addMaterial(it.FadeType,{fabric:{type:it.FadeType,uniforms:{fadeInColor:new z(1,0,0,1),fadeOutColor:new z(0,0,0,0),maximumDistance:.5,repeat:!0,fadeDirection:{x:!0,y:!0},time:new U(.5,.5)},source:WM},translucent:function(e){let t=e.uniforms;return t.fadeInColor.alpha<1||t.fadeOutColor.alpha<1}});it.PolylineArrowType="PolylineArrow";it._materialCache.addMaterial(it.PolylineArrowType,{fabric:{type:it.PolylineArrowType,uniforms:{color:new z(1,1,1,1)},source:XM},translucent:!0});it.PolylineDashType="PolylineDash";it._materialCache.addMaterial(it.PolylineDashType,{fabric:{type:it.PolylineDashType,uniforms:{color:new z(1,0,1,1),gapColor:new z(0,0,0,0),dashLength:16,dashPattern:255},source:KM},translucent:!0});it.PolylineGlowType="PolylineGlow";it._materialCache.addMaterial(it.PolylineGlowType,{fabric:{type:it.PolylineGlowType,uniforms:{color:new z(0,.5,1,1),glowPower:.25,taperPower:1},source:$M},translucent:!0});it.PolylineOutlineType="PolylineOutline";it._materialCache.addMaterial(it.PolylineOutlineType,{fabric:{type:it.PolylineOutlineType,uniforms:{color:new z(1,1,1,1),outlineColor:new z(1,0,0,1),outlineWidth:1},source:JM},translucent:function(e){let t=e.uniforms;return t.color.alpha<1||t.outlineColor.alpha<1}});it.ElevationContourType="ElevationContour";it._materialCache.addMaterial(it.ElevationContourType,{fabric:{type:it.ElevationContourType,uniforms:{spacing:100,color:new z(1,0,0,1),width:1},source:HM},translucent:!1});it.ElevationRampType="ElevationRamp";it._materialCache.addMaterial(it.ElevationRampType,{fabric:{type:it.ElevationRampType,uniforms:{image:it.DefaultImageId,minimumHeight:0,maximumHeight:1e4},source:GM},translucent:!1});it.SlopeRampMaterialType="SlopeRamp";it._materialCache.addMaterial(it.SlopeRampMaterialType,{fabric:{type:it.SlopeRampMaterialType,uniforms:{image:it.DefaultImageId},source:QM},translucent:!1});it.AspectRampMaterialType="AspectRamp";it._materialCache.addMaterial(it.AspectRampMaterialType,{fabric:{type:it.AspectRampMaterialType,uniforms:{image:it.DefaultImageId},source:kM},translucent:!1});it.ElevationBandType="ElevationBand";it._materialCache.addMaterial(it.ElevationBandType,{fabric:{type:it.ElevationBandType,uniforms:{heights:it.DefaultImageId,colors:it.DefaultImageId},source:jM},translucent:!0});it.WaterMaskType="WaterMask";it._materialCache.addMaterial(it.WaterMaskType,{fabric:{type:it.WaterMaskType,source:tN,uniforms:{waterColor:new z(1,1,1,1),landColor:new z(0,0,0,0)}},translucent:!1});var er=it;var yGe=`#define CLIP_POLYLINE +${Wl} +${BM}`,AGe=Cx;function Ix(e){e=e??H.EMPTY_OBJECT;let t=e.translucent??!0,n=!1,i=Ix.VERTEX_FORMAT;this.material=l(e.material)?e.material:er.fromType(er.ColorType),this.translucent=t,this._vertexShaderSource=e.vertexShaderSource??yGe,this._fragmentShaderSource=e.fragmentShaderSource??AGe,this._renderState=wr.getDefaultRenderState(t,n,e.renderState),this._closed=n,this._vertexFormat=i}Object.defineProperties(Ix.prototype,{vertexShaderSource:{get:function(){let e=this._vertexShaderSource;return this.material.shaderSource.search(/in\s+float\s+v_polylineAngle;/g)!==-1&&(e=`#define POLYLINE_DASH +${e}`),e}},fragmentShaderSource:{get:function(){return this._fragmentShaderSource}},renderState:{get:function(){return this._renderState}},closed:{get:function(){return this._closed}},vertexFormat:{get:function(){return this._vertexFormat}}});Ix.VERTEX_FORMAT=Be.POSITION_AND_ST;Ix.prototype.getFragmentShaderSource=wr.prototype.getFragmentShaderSource;Ix.prototype.isTranslucent=wr.prototype.isTranslucent;Ix.prototype.getRenderState=wr.prototype.getRenderState;var ac=Ix;function bGe(e,t){let n=[],i=e.length,r=0;for(;r<i;){let o=Math.ceil((i-r)/t--);n.push(e.slice(r,r+o)),r+=o}return n}var rN=bGe;function Ag(e,t,n){if(this._attributes=t,this._numberOfInstances=n,t.length===0)return;let i=xGe(t),r=e.floatingPointTexture,o=i===ze.FLOAT&&!r,s=TGe(t,o),a=EGe(s,t,o),c=Math.floor(kt.maximumTextureSize/a),u=Math.min(n,c),f=a*u,d=Math.ceil(n/u),p=1/f,g=p*.5,m=1/d,y=m*.5;this._textureDimensions=new U(f,d),this._textureStep=new se(p,g,m,y),this._pixelDatatype=o?ze.UNSIGNED_BYTE:i,this._packFloats=o,this._offsets=s,this._stride=a,this._texture=void 0;let A=4*f*d;this._batchValues=i===ze.FLOAT&&!o?new Float32Array(A):new Uint8Array(A),this._batchValuesDirty=!1}Object.defineProperties(Ag.prototype,{attributes:{get:function(){return this._attributes}},numberOfInstances:{get:function(){return this._numberOfInstances}}});function xGe(e){let t=!1,n=e.length;for(let i=0;i<n;++i)if(e[i].componentDatatype!==Y.UNSIGNED_BYTE){t=!0;break}return t?ze.FLOAT:ze.UNSIGNED_BYTE}function wme(e,t){let n=e[t].componentsPerAttribute;return n===2?U:n===3?h:n===4?se:Number}function TGe(e,t){let n=new Array(e.length),i=0,r=e.length;for(let o=0;o<r;++o){let a=e[o].componentDatatype;n[o]=i,a!==Y.UNSIGNED_BYTE&&t?i+=4:++i}return n}function EGe(e,t,n){let i=e.length,r=e[i-1];return t[i-1].componentDatatype!==Y.UNSIGNED_BYTE&&n?r+4:r+1}var oN=new se;function CGe(e,t,n){let i=se.unpack(e,t,oN),r=se.unpackFloat(i);i=se.unpack(e,t+4,oN);let o=se.unpackFloat(i);i=se.unpack(e,t+8,oN);let s=se.unpackFloat(i);i=se.unpack(e,t+12,oN);let a=se.unpackFloat(i);return se.fromElements(r,o,s,a,n)}function vGe(e,t,n){let i=se.packFloat(e.x,oN);se.pack(i,t,n),i=se.packFloat(e.y,i),se.pack(i,t,n+4),i=se.packFloat(e.z,i),se.pack(i,t,n+8),i=se.packFloat(e.w,i),se.pack(i,t,n+12)}var Sme=new se;Ag.prototype.getBatchedAttribute=function(e,t,n){let i=this._attributes,r=this._offsets[t],s=4*this._stride*e+4*r,a;this._packFloats&&i[t].componentDatatype!==ze.UNSIGNED_BYTE?a=CGe(this._batchValues,s,Sme):a=se.unpack(this._batchValues,s,Sme);let c=wme(i,t);return l(c.fromCartesian4)?c.fromCartesian4(a,n):l(c.clone)?c.clone(a,n):a.x};var SGe=[void 0,void 0,new U,new h,new se],wGe=new se;Ag.prototype.setBatchedAttribute=function(e,t,n){let i=this._attributes,r=SGe[i[t].componentsPerAttribute],o=this.getBatchedAttribute(e,t,r),s=wme(this._attributes,t);if(l(s.equals)?s.equals(o,n):o===n)return;let c=wGe;c.x=l(n.x)?n.x:n,c.y=l(n.y)?n.y:0,c.z=l(n.z)?n.z:0,c.w=l(n.w)?n.w:0;let u=this._offsets[t],d=4*this._stride*e+4*u;this._packFloats&&i[t].componentDatatype!==ze.UNSIGNED_BYTE?vGe(c,this._batchValues,d):se.pack(c,this._batchValues,d),this._batchValuesDirty=!0};function IGe(e,t){let n=e._textureDimensions;e._texture=new Dt({context:t,pixelFormat:Ke.RGBA,pixelDatatype:e._pixelDatatype,width:n.x,height:n.y,sampler:jt.NEAREST,flipY:!1})}function PGe(e){let t=e._textureDimensions;e._texture.copyFrom({source:{width:t.x,height:t.y,arrayBufferView:e._batchValues}})}Ag.prototype.update=function(e){l(this._texture)&&!this._batchValuesDirty||this._attributes.length===0||(this._batchValuesDirty=!1,l(this._texture)||IGe(this,e.context),PGe(this))};Ag.prototype.getUniformMapCallback=function(){let e=this;return function(t){return e._attributes.length===0?t:Ot(t,{batchTexture:function(){return e._texture},batchTextureDimensions:function(){return e._textureDimensions},batchTextureStep:function(){return e._textureStep}})}};function DGe(e){let t=e._stride;return e._textureDimensions.y===1?`uniform vec4 batchTextureStep; vec2 computeSt(float batchId) { float stepX = batchTextureStep.x; @@ -6764,7 +6659,7 @@ vec2 computeSt(float batchId) float yId = floor(batchId * numberOfAttributes / batchTextureDimensions.x); return vec2(centerX + (xId * stepX), centerY + (yId * stepY)); } -`}function XGe(e){return e===1?"float":`vec${e}`}function KGe(e){return e===1?".x":e===2?".xy":e===3?".xyz":""}function $Ge(e,t){let i=e._attributes[t],r=i.componentsPerAttribute,o=i.functionName,s=XGe(r),a=KGe(r),c=e._offsets[t],u=`${s} ${o}(float batchId) +`}function RGe(e){return e===1?"float":`vec${e}`}function OGe(e){return e===1?".x":e===2?".xy":e===3?".xyz":""}function MGe(e,t){let i=e._attributes[t],r=i.componentsPerAttribute,o=i.functionName,s=RGe(r),a=OGe(r),c=e._offsets[t],u=`${s} ${o}(float batchId) { vec2 st = computeSt(batchId); st.x += batchTextureStep.x * float(${c}); @@ -6779,11 +6674,11 @@ textureValue.w = czm_unpackFloat(texture(batchTexture, st + vec2(batchTextureSte `:e._pixelDatatype===ze.FLOAT&&i.componentDatatype===Y.UNSIGNED_BYTE&&i.normalize&&(u+=`value /= 255.0; `),u+=` return value; } -`,u}yg.prototype.getVertexShaderCallback=function(){let e=this._attributes;if(e.length===0)return function(i){return i};let t=`uniform highp sampler2D batchTexture; -`;t+=`${YGe(this)} -`;let n=e.length;for(let i=0;i<n;++i)t+=$Ge(this,i);return function(i){let r=i.indexOf("void main"),o=i.substring(0,r),s=i.substring(r);return`${o} +`,u}Ag.prototype.getVertexShaderCallback=function(){let e=this._attributes;if(e.length===0)return function(i){return i};let t=`uniform highp sampler2D batchTexture; +`;t+=`${DGe(this)} +`;let n=e.length;for(let i=0;i<n;++i)t+=MGe(this,i);return function(i){let r=i.indexOf("void main"),o=i.substring(0,r),s=i.substring(r);return`${o} ${t} -${s}`}};yg.prototype.isDestroyed=function(){return!1};yg.prototype.destroy=function(){return this._texture=this._texture&&this._texture.destroy(),le(this)};var wx=yg;var hN=class e{constructor(t){this._ellipsoid=t??ee.WGS84,this._semimajorAxis=this._ellipsoid.maximumRadius,this._oneOverSemimajorAxis=1/this._semimajorAxis}get ellipsoid(){return this._ellipsoid}static mercatorAngleToGeodeticLatitude(t){return D.PI_OVER_TWO-2*Math.atan(Math.exp(-t))}static geodeticLatitudeToMercatorAngle(t){t>e.MaximumLatitude?t=e.MaximumLatitude:t<-e.MaximumLatitude&&(t=-e.MaximumLatitude);let n=Math.sin(t);return .5*Math.log((1+n)/(1-n))}project(t,n){let i=this._semimajorAxis,r=t.longitude*i,o=e.geodeticLatitudeToMercatorAngle(t.latitude)*i,s=t.height;return l(n)?(n.x=r,n.y=o,n.z=s,n):new h(r,o,s)}unproject(t,n){let i=this._oneOverSemimajorAxis,r=t.x*i,o=e.mercatorAngleToGeodeticLatitude(t.y*i),s=t.z;return l(n)?(n.longitude=r,n.latitude=o,n.height=s,n):new he(r,o,s)}};hN.MaximumLatitude=hN.mercatorAngleToGeodeticLatitude(Math.PI);var yi=hN;function JGe(e,t,n){let i=!n,r=e.length,o;if(!i&&r>1){let s=e[0].modelMatrix;for(o=1;o<r;++o)if(!N.equals(s,e[o].modelMatrix)){i=!0;break}}if(i)for(o=0;o<r;++o)l(e[o].geometry)&&Hn.transformToWorldCoordinates(e[o]);else N.multiplyTransformation(t,e[0].modelMatrix,t)}function QX(e,t){let n=e.attributes,i=n.position,r=i.values.length/i.componentsPerAttribute;n.batchId=new Ne({componentDatatype:Y.FLOAT,componentsPerAttribute:1,values:new Float32Array(r)});let o=n.batchId.values;for(let s=0;s<r;++s)o[s]=t}function ZGe(e){let t=e.length;for(let n=0;n<t;++n){let i=e[n];l(i.geometry)?QX(i.geometry,n):l(i.westHemisphereGeometry)&&l(i.eastHemisphereGeometry)&&(QX(i.westHemisphereGeometry,n),QX(i.eastHemisphereGeometry,n))}}function QGe(e){let t=e.instances,n=e.projection,i=e.elementIndexUintSupported,r=e.scene3DOnly,o=e.vertexCacheOptimize,s=e.compressVertices,a=e.modelMatrix,c,u,f,d=t.length;for(c=0;c<d;++c)if(l(t[c].geometry)){f=t[c].geometry.primitiveType;break}if(JGe(t,a,r),!r)for(c=0;c<d;++c)l(t[c].geometry)&&Hn.splitLongitude(t[c]);if(ZGe(t),o)for(c=0;c<d;++c){let g=t[c];l(g.geometry)?(Hn.reorderForPostVertexCache(g.geometry),Hn.reorderForPreVertexCache(g.geometry)):l(g.westHemisphereGeometry)&&l(g.eastHemisphereGeometry)&&(Hn.reorderForPostVertexCache(g.westHemisphereGeometry),Hn.reorderForPreVertexCache(g.westHemisphereGeometry),Hn.reorderForPostVertexCache(g.eastHemisphereGeometry),Hn.reorderForPreVertexCache(g.eastHemisphereGeometry))}let p=Hn.combineInstances(t);for(d=p.length,c=0;c<d;++c){u=p[c];let g=u.attributes;if(r)for(let m in g)g.hasOwnProperty(m)&&g[m].componentDatatype===Y.DOUBLE&&Hn.encodeAttribute(u,m,`${m}3DHigh`,`${m}3DLow`);else for(let m in g)if(g.hasOwnProperty(m)&&g[m].componentDatatype===Y.DOUBLE){let y=`${m}3D`,A=`${m}2D`;Hn.projectTo2D(u,m,y,A,n),l(u.boundingSphere)&&m==="position"&&(u.boundingSphereCV=ue.fromVertices(u.attributes.position2D.values)),Hn.encodeAttribute(u,y,`${y}High`,`${y}Low`),Hn.encodeAttribute(u,A,`${A}High`,`${A}Low`)}s&&Hn.compressVertices(u)}if(!i){let g=[];for(d=p.length,c=0;c<d;++c)u=p[c],g=g.concat(Hn.fitToUnsignedShortIndices(u));p=g}return p}function eK(e,t,n,i){let r,o,s,a=i.length-1;if(a>=0){let u=i[a];r=u.offset+u.count,s=u.index,o=n[s].indices.length}else r=0,s=0,o=n[s].indices.length;let c=e.length;for(let u=0;u<c;++u){let d=e[u][t];if(!l(d))continue;let p=d.indices.length;r+p>o&&(r=0,o=n[++s].indices.length),i.push({index:s,offset:r,count:p}),r+=p}}function e5e(e,t){let n=[];return eK(e,"geometry",t,n),eK(e,"westHemisphereGeometry",t,n),eK(e,"eastHemisphereGeometry",t,n),n}var Ag={};Ag.combineGeometry=function(e){let t,n,i=e.instances,r=i.length,o,s,a=!1;r>0&&(t=QGe(e),t.length>0&&(n=Hn.createAttributeLocations(t[0]),e.createPickOffsets&&(o=e5e(i,t))),l(i[0].attributes)&&l(i[0].attributes.offset)&&(s=new Array(r),a=!0));let c=new Array(r),u=new Array(r);for(let f=0;f<r;++f){let d=i[f],p=d.geometry;l(p)&&(c[f]=p.boundingSphere,u[f]=p.boundingSphereCV,a&&(s[f]=d.geometry.offsetAttribute));let g=d.eastHemisphereGeometry,m=d.westHemisphereGeometry;l(g)&&l(m)&&(l(g.boundingSphere)&&l(m.boundingSphere)&&(c[f]=ue.union(g.boundingSphere,m.boundingSphere)),l(g.boundingSphereCV)&&l(m.boundingSphereCV)&&(u[f]=ue.union(g.boundingSphereCV,m.boundingSphereCV)))}return{geometries:t,modelMatrix:e.modelMatrix,attributeLocations:n,pickOffsets:o,offsetInstanceExtend:s,boundingSpheres:c,boundingSpheresCV:u}};function t5e(e,t){let n=e.attributes;for(let i in n)if(n.hasOwnProperty(i)){let r=n[i];l(r)&&l(r.values)&&t.push(r.values.buffer)}l(e.indices)&&t.push(e.indices.buffer)}function n5e(e,t){let n=e.length;for(let i=0;i<n;++i)t5e(e[i],t)}function i5e(e){let t=1,n=e.length;for(let i=0;i<n;i++){let r=e[i];if(++t,!l(r))continue;let o=r.attributes;t+=7+2*ue.packedLength+(l(r.indices)?r.indices.length:0);for(let s in o)if(o.hasOwnProperty(s)&&l(o[s])){let a=o[s];t+=5+a.values.length}}return t}Ag.packCreateGeometryResults=function(e,t){let n=new Float64Array(i5e(e)),i=[],r={},o=e.length,s=0;n[s++]=o;for(let a=0;a<o;a++){let c=e[a],u=l(c);if(n[s++]=u?1:0,!u)continue;n[s++]=c.primitiveType,n[s++]=c.geometryType,n[s++]=c.offsetAttribute??-1;let f=l(c.boundingSphere)?1:0;n[s++]=f,f&&ue.pack(c.boundingSphere,n,s),s+=ue.packedLength;let d=l(c.boundingSphereCV)?1:0;n[s++]=d,d&&ue.pack(c.boundingSphereCV,n,s),s+=ue.packedLength;let p=c.attributes,g=[];for(let y in p)p.hasOwnProperty(y)&&l(p[y])&&(g.push(y),l(r[y])||(r[y]=i.length,i.push(y)));n[s++]=g.length;for(let y=0;y<g.length;y++){let A=g[y],b=p[A];n[s++]=r[A],n[s++]=b.componentDatatype,n[s++]=b.componentsPerAttribute,n[s++]=b.normalize?1:0,n[s++]=b.values.length,n.set(b.values,s),s+=b.values.length}let m=l(c.indices)?c.indices.length:0;n[s++]=m,m>0&&(n.set(c.indices,s),s+=m)}return t.push(n.buffer),{stringTable:i,packedData:n}};Ag.unpackCreateGeometryResults=function(e){let t=e.stringTable,n=e.packedData,i,r=new Array(n[0]),o=0,s=1;for(;s<n.length;){if(!(n[s++]===1)){r[o++]=void 0;continue}let c=n[s++],u=n[s++],f=n[s++];f===-1&&(f=void 0);let d,p;n[s++]===1&&(d=ue.unpack(n,s)),s+=ue.packedLength,n[s++]===1&&(p=ue.unpack(n,s)),s+=ue.packedLength;let y,A,b,x=new Tn,T=n[s++];for(i=0;i<T;i++){let v=t[n[s++]],S=n[s++];b=n[s++];let I=n[s++]!==0;y=n[s++],A=Y.createTypedArray(S,y);for(let R=0;R<y;R++)A[R]=n[s++];x[v]=new Ne({componentDatatype:S,componentsPerAttribute:b,normalize:I,values:A})}let E;if(y=n[s++],y>0){let v=A.length/b;for(E=je.createTypedArray(v,y),i=0;i<y;i++)E[i]=n[s++]}r[o++]=new St({primitiveType:c,geometryType:u,boundingSphere:d,boundingSphereCV:p,indices:E,attributes:x,offsetAttribute:f})}return r};function r5e(e,t){let n=e.length,i=new Float64Array(1+n*19),r=0;i[r++]=n;for(let o=0;o<n;o++){let s=e[o];if(N.pack(s.modelMatrix,i,r),r+=N.packedLength,l(s.attributes)&&l(s.attributes.offset)){let a=s.attributes.offset.value;i[r]=a[0],i[r+1]=a[1],i[r+2]=a[2]}r+=3}return t.push(i.buffer),i}function o5e(e){let t=e,n=new Array(t[0]),i=0,r=1;for(;r<t.length;){let o=N.unpack(t,r),s;r+=N.packedLength,l(t[r])&&(s={offset:new Tr(t[r],t[r+1],t[r+2])}),r+=3,n[i++]={modelMatrix:o,attributes:s}}return n}Ag.packCombineGeometryParameters=function(e,t){let n=e.createGeometryResults,i=n.length;for(let r=0;r<i;r++)t.push(n[r].packedData.buffer);return{createGeometryResults:e.createGeometryResults,packedInstances:r5e(e.instances,t),ellipsoid:e.ellipsoid,isGeographic:e.projection instanceof Ui,elementIndexUintSupported:e.elementIndexUintSupported,scene3DOnly:e.scene3DOnly,vertexCacheOptimize:e.vertexCacheOptimize,compressVertices:e.compressVertices,modelMatrix:e.modelMatrix,createPickOffsets:e.createPickOffsets}};Ag.unpackCombineGeometryParameters=function(e){let t=o5e(e.packedInstances),n=e.createGeometryResults,i=n.length,r=0;for(let a=0;a<i;a++){let c=Ag.unpackCreateGeometryResults(n[a]),u=c.length;for(let f=0;f<u;f++){let d=c[f],p=t[r];p.geometry=d,++r}}let o=ee.clone(e.ellipsoid),s=e.isGeographic?new Ui(o):new yi(o);return{instances:t,ellipsoid:o,projection:s,elementIndexUintSupported:e.elementIndexUintSupported,scene3DOnly:e.scene3DOnly,vertexCacheOptimize:e.vertexCacheOptimize,compressVertices:e.compressVertices,modelMatrix:N.clone(e.modelMatrix),createPickOffsets:e.createPickOffsets}};function hme(e){let t=e.length,n=1+(ue.packedLength+1)*t,i=new Float32Array(n),r=0;i[r++]=t;for(let o=0;o<t;++o){let s=e[o];l(s)?(i[r++]=1,ue.pack(e[o],i,r)):i[r++]=0,r+=ue.packedLength}return i}function mme(e){let t=new Array(e[0]),n=0,i=1;for(;i<e.length;)e[i++]===1&&(t[n]=ue.unpack(e,i)),++n,i+=ue.packedLength;return t}Ag.packCombineGeometryResults=function(e,t){l(e.geometries)&&n5e(e.geometries,t);let n=hme(e.boundingSpheres),i=hme(e.boundingSpheresCV);return t.push(n.buffer,i.buffer),{geometries:e.geometries,attributeLocations:e.attributeLocations,modelMatrix:e.modelMatrix,pickOffsets:e.pickOffsets,offsetInstanceExtend:e.offsetInstanceExtend,boundingSpheres:n,boundingSpheresCV:i}};Ag.unpackCombineGeometryResults=function(e){return{geometries:e.geometries,attributeLocations:e.attributeLocations,modelMatrix:e.modelMatrix,pickOffsets:e.pickOffsets,offsetInstanceExtend:e.offsetInstanceExtend,boundingSpheres:mme(e.boundingSpheres),boundingSpheresCV:mme(e.boundingSpheresCV)}};var Ix=Ag;var pme={READY:0,CREATING:1,CREATED:2,COMBINING:3,COMBINED:4,COMPLETE:5,FAILED:6};Object.freeze(pme);var rs=pme;var Lu={DISABLED:0,ENABLED:1,CAST_ONLY:2,RECEIVE_ONLY:3};Lu.NUMBER_OF_SHADOW_MODES=4;Lu.castShadows=function(e){return e===Lu.ENABLED||e===Lu.CAST_ONLY};Lu.receiveShadows=function(e){return e===Lu.ENABLED||e===Lu.RECEIVE_ONLY};Lu.fromCastReceive=function(e,t){return e&&t?Lu.ENABLED:e?Lu.CAST_ONLY:t?Lu.RECEIVE_ONLY:Lu.DISABLED};Object.freeze(Lu);var Dn=Lu;function os(e){e=e??H.EMPTY_OBJECT,this.geometryInstances=e.geometryInstances,this.appearance=e.appearance,this._appearance=void 0,this._material=void 0,this.depthFailAppearance=e.depthFailAppearance,this._depthFailAppearance=void 0,this._depthFailMaterial=void 0,this.modelMatrix=N.clone(e.modelMatrix??N.IDENTITY),this._modelMatrix=new N,this.show=e.show??!0,this._vertexCacheOptimize=e.vertexCacheOptimize??!1,this._interleave=e.interleave??!1,this._releaseGeometryInstances=e.releaseGeometryInstances??!0,this._allowPicking=e.allowPicking??!0,this._asynchronous=e.asynchronous??!0,this._compressVertices=e.compressVertices??!0,this.cull=e.cull??!0,this.debugShowBoundingVolume=e.debugShowBoundingVolume??!1,this.rtcCenter=e.rtcCenter,this.shadows=e.shadows??Dn.DISABLED,this._translucent=void 0,this._state=rs.READY,this._geometries=[],this._error=void 0,this._numberOfInstances=0,this._boundingSpheres=[],this._boundingSphereWC=[],this._boundingSphereCV=[],this._boundingSphere2D=[],this._boundingSphereMorph=[],this._perInstanceAttributeCache=new Map,this._instanceIds=[],this._lastPerInstanceAttributeIndex=0,this._va=[],this._attributeLocations=void 0,this._primitiveType=void 0,this._frontFaceRS=void 0,this._backFaceRS=void 0,this._sp=void 0,this._depthFailAppearance=void 0,this._spDepthFail=void 0,this._frontFaceDepthFailRS=void 0,this._backFaceDepthFailRS=void 0,this._pickIds=[],this._colorCommands=[],this._pickCommands=[],this._createBoundingVolumeFunction=e._createBoundingVolumeFunction,this._createRenderStatesFunction=e._createRenderStatesFunction,this._createShaderProgramFunction=e._createShaderProgramFunction,this._createCommandsFunction=e._createCommandsFunction,this._updateAndQueueCommandsFunction=e._updateAndQueueCommandsFunction,this._createPickOffsets=e._createPickOffsets,this._pickOffsets=void 0,this._createGeometryResults=void 0,this._ready=!1,this._batchTable=void 0,this._batchTableAttributeIndices=void 0,this._offsetInstanceExtend=void 0,this._batchTableOffsetAttribute2DIndex=void 0,this._batchTableOffsetsUpdated=!1,this._instanceBoundingSpheres=void 0,this._instanceBoundingSpheresCV=void 0,this._tempBoundingSpheres=void 0,this._recomputeBoundingSpheres=!1,this._batchTableBoundingSpheresUpdated=!1,this._batchTableBoundingSphereAttributeIndices=void 0}Object.defineProperties(os.prototype,{vertexCacheOptimize:{get:function(){return this._vertexCacheOptimize}},interleave:{get:function(){return this._interleave}},releaseGeometryInstances:{get:function(){return this._releaseGeometryInstances}},allowPicking:{get:function(){return this._allowPicking}},asynchronous:{get:function(){return this._asynchronous}},compressVertices:{get:function(){return this._compressVertices}},ready:{get:function(){return this._ready}}});function s5e(e){let t=e.length,n=[],i=e[0].attributes,r;for(r in i)if(i.hasOwnProperty(r)&&l(i[r])){let o=i[r],s=!0;for(let a=1;a<t;++a){let c=e[a].attributes[r];if(!l(c)||o.componentDatatype!==c.componentDatatype||o.componentsPerAttribute!==c.componentsPerAttribute||o.normalize!==c.normalize){s=!1;break}}s&&n.push(r)}return n}var a5e=new U,c5e=new h,Cme=new se;function vme(e){let t=e.length;if(t===1)return e[0];if(t===2)return U.unpack(e,0,a5e);if(t===3)return h.unpack(e,0,c5e);if(t===4)return se.unpack(e,0,Cme)}function l5e(e,t){let n=e.geometryInstances,i=Array.isArray(n)?n:[n],r=i.length;if(r===0)return;let o=s5e(i),s=o.length,a=[],c={},u={},f,p=i[0].attributes,g,m,y;for(g=0;g<s;++g)m=o[g],y=p[m],c[m]=g,a.push({functionName:`czm_batchTable_${m}`,componentDatatype:y.componentDatatype,componentsPerAttribute:y.componentsPerAttribute,normalize:y.normalize});o.indexOf("distanceDisplayCondition")!==-1&&(a.push({functionName:"czm_batchTable_boundingSphereCenter3DHigh",componentDatatype:Y.FLOAT,componentsPerAttribute:3},{functionName:"czm_batchTable_boundingSphereCenter3DLow",componentDatatype:Y.FLOAT,componentsPerAttribute:3},{functionName:"czm_batchTable_boundingSphereCenter2DHigh",componentDatatype:Y.FLOAT,componentsPerAttribute:3},{functionName:"czm_batchTable_boundingSphereCenter2DLow",componentDatatype:Y.FLOAT,componentsPerAttribute:3},{functionName:"czm_batchTable_boundingSphereRadius",componentDatatype:Y.FLOAT,componentsPerAttribute:1}),u.center3DHigh=a.length-5,u.center3DLow=a.length-4,u.center2DHigh=a.length-3,u.center2DLow=a.length-2,u.radius=a.length-1),o.indexOf("offset")!==-1&&(a.push({functionName:"czm_batchTable_offset2D",componentDatatype:Y.FLOAT,componentsPerAttribute:3}),f=a.length-1),a.push({functionName:"czm_batchTable_pickColor",componentDatatype:Y.UNSIGNED_BYTE,componentsPerAttribute:4,normalize:!0});let A=a.length,b=new wx(t,a,r);for(g=0;g<r;++g){let x=i[g];p=x.attributes;for(let I=0;I<s;++I){m=o[I],y=p[m];let R=vme(y.value),O=c[m];b.setBatchedAttribute(g,O,R)}let T={primitive:x.pickPrimitive??e};l(x.id)&&(T.id=x.id);let E=t.createPickId(T);e._pickIds.push(E);let v=E.color,S=Cme;S.x=z.floatToByte(v.red),S.y=z.floatToByte(v.green),S.z=z.floatToByte(v.blue),S.w=z.floatToByte(v.alpha),b.setBatchedAttribute(g,A-1,S)}e._batchTable=b,e._batchTableAttributeIndices=c,e._batchTableBoundingSphereAttributeIndices=u,e._batchTableOffsetAttribute2DIndex=f}function u5e(e){let t;return Array.isArray(e.values)?t=e.values.slice(0):t=new e.values.constructor(e.values),new Ne({componentDatatype:e.componentDatatype,componentsPerAttribute:e.componentsPerAttribute,normalize:e.normalize,values:t})}function f5e(e){let t=e.attributes,n=new Tn;for(let r in t)t.hasOwnProperty(r)&&l(t[r])&&(n[r]=u5e(t[r]));let i;if(l(e.indices)){let r=e.indices;Array.isArray(r)?i=r.slice(0):i=new r.constructor(r)}return new St({attributes:n,indices:i,primitiveType:e.primitiveType,boundingSphere:ue.clone(e.boundingSphere)})}function d5e(e,t){return{geometry:t,attributes:e.attributes,modelMatrix:N.clone(e.modelMatrix),pickPrimitive:e.pickPrimitive,id:e.id}}var h5e=/in\s+vec(?:3|4)\s+(.*)3DHigh;/g;os._modifyShaderPosition=function(e,t,n){let i,r="",o="",s="";for(;(i=h5e.exec(t))!==null;){let a=i[1],c=`vec4 czm_compute${a[0].toUpperCase()}${a.substr(1)}()`;c!=="vec4 czm_computePosition()"&&(r+=`${c}; +${s}`}};Ag.prototype.isDestroyed=function(){return!1};Ag.prototype.destroy=function(){return this._texture=this._texture&&this._texture.destroy(),le(this)};var Px=Ag;var Ime={NEVER:te.NEVER,LESS:te.LESS,EQUAL:te.EQUAL,LESS_OR_EQUAL:te.LEQUAL,GREATER:te.GREATER,NOT_EQUAL:te.NOTEQUAL,GREATER_OR_EQUAL:te.GEQUAL,ALWAYS:te.ALWAYS};Object.freeze(Ime);var cc=Ime;function sN(e,t,n){e=e??0,t=t??0,n=n??0,this.value=new Float32Array([e,t,n])}Object.defineProperties(sN.prototype,{componentDatatype:{get:function(){return Y.FLOAT}},componentsPerAttribute:{get:function(){return 3}},normalize:{get:function(){return!1}}});sN.fromCartesian3=function(e){return new sN(e.x,e.y,e.z)};sN.toValue=function(e,t){return l(t)||(t=new Float32Array([e.x,e.y,e.z])),t[0]=e.x,t[1]=e.y,t[2]=e.z,t};var Tr=sN;function NGe(e,t,n){let i=!n,r=e.length,o;if(!i&&r>1){let s=e[0].modelMatrix;for(o=1;o<r;++o)if(!N.equals(s,e[o].modelMatrix)){i=!0;break}}if(i)for(o=0;o<r;++o)l(e[o].geometry)&&Hn.transformToWorldCoordinates(e[o]);else N.multiplyTransformation(t,e[0].modelMatrix,t)}function fK(e,t){let n=e.attributes,i=n.position,r=i.values.length/i.componentsPerAttribute;n.batchId=new Ne({componentDatatype:Y.FLOAT,componentsPerAttribute:1,values:new Float32Array(r)});let o=n.batchId.values;for(let s=0;s<r;++s)o[s]=t}function LGe(e){let t=e.length;for(let n=0;n<t;++n){let i=e[n];l(i.geometry)?fK(i.geometry,n):l(i.westHemisphereGeometry)&&l(i.eastHemisphereGeometry)&&(fK(i.westHemisphereGeometry,n),fK(i.eastHemisphereGeometry,n))}}function FGe(e){let t=e.instances,n=e.projection,i=e.elementIndexUintSupported,r=e.scene3DOnly,o=e.vertexCacheOptimize,s=e.compressVertices,a=e.modelMatrix,c,u,f,d=t.length;for(c=0;c<d;++c)if(l(t[c].geometry)){f=t[c].geometry.primitiveType;break}if(NGe(t,a,r),!r)for(c=0;c<d;++c)l(t[c].geometry)&&Hn.splitLongitude(t[c]);if(LGe(t),o)for(c=0;c<d;++c){let g=t[c];l(g.geometry)?(Hn.reorderForPostVertexCache(g.geometry),Hn.reorderForPreVertexCache(g.geometry)):l(g.westHemisphereGeometry)&&l(g.eastHemisphereGeometry)&&(Hn.reorderForPostVertexCache(g.westHemisphereGeometry),Hn.reorderForPreVertexCache(g.westHemisphereGeometry),Hn.reorderForPostVertexCache(g.eastHemisphereGeometry),Hn.reorderForPreVertexCache(g.eastHemisphereGeometry))}let p=Hn.combineInstances(t);for(d=p.length,c=0;c<d;++c){u=p[c];let g=u.attributes;if(r)for(let m in g)g.hasOwnProperty(m)&&g[m].componentDatatype===Y.DOUBLE&&Hn.encodeAttribute(u,m,`${m}3DHigh`,`${m}3DLow`);else for(let m in g)if(g.hasOwnProperty(m)&&g[m].componentDatatype===Y.DOUBLE){let y=`${m}3D`,A=`${m}2D`;Hn.projectTo2D(u,m,y,A,n),l(u.boundingSphere)&&m==="position"&&(u.boundingSphereCV=ue.fromVertices(u.attributes.position2D.values)),Hn.encodeAttribute(u,y,`${y}High`,`${y}Low`),Hn.encodeAttribute(u,A,`${A}High`,`${A}Low`)}s&&Hn.compressVertices(u)}if(!i){let g=[];for(d=p.length,c=0;c<d;++c)u=p[c],g=g.concat(Hn.fitToUnsignedShortIndices(u));p=g}return p}function dK(e,t,n,i){let r,o,s,a=i.length-1;if(a>=0){let u=i[a];r=u.offset+u.count,s=u.index,o=n[s].indices.length}else r=0,s=0,o=n[s].indices.length;let c=e.length;for(let u=0;u<c;++u){let d=e[u][t];if(!l(d))continue;let p=d.indices.length;r+p>o&&(r=0,o=n[++s].indices.length),i.push({index:s,offset:r,count:p}),r+=p}}function BGe(e,t){let n=[];return dK(e,"geometry",t,n),dK(e,"westHemisphereGeometry",t,n),dK(e,"eastHemisphereGeometry",t,n),n}var bg={};bg.combineGeometry=function(e){let t,n,i=e.instances,r=i.length,o,s,a=!1;r>0&&(t=FGe(e),t.length>0&&(n=Hn.createAttributeLocations(t[0]),e.createPickOffsets&&(o=BGe(i,t))),l(i[0].attributes)&&l(i[0].attributes.offset)&&(s=new Array(r),a=!0));let c=new Array(r),u=new Array(r);for(let f=0;f<r;++f){let d=i[f],p=d.geometry;l(p)&&(c[f]=p.boundingSphere,u[f]=p.boundingSphereCV,a&&(s[f]=d.geometry.offsetAttribute));let g=d.eastHemisphereGeometry,m=d.westHemisphereGeometry;l(g)&&l(m)&&(l(g.boundingSphere)&&l(m.boundingSphere)&&(c[f]=ue.union(g.boundingSphere,m.boundingSphere)),l(g.boundingSphereCV)&&l(m.boundingSphereCV)&&(u[f]=ue.union(g.boundingSphereCV,m.boundingSphereCV)))}return{geometries:t,modelMatrix:e.modelMatrix,attributeLocations:n,pickOffsets:o,offsetInstanceExtend:s,boundingSpheres:c,boundingSpheresCV:u}};function kGe(e,t){let n=e.attributes;for(let i in n)if(n.hasOwnProperty(i)){let r=n[i];l(r)&&l(r.values)&&t.push(r.values.buffer)}l(e.indices)&&t.push(e.indices.buffer)}function UGe(e,t){let n=e.length;for(let i=0;i<n;++i)kGe(e[i],t)}function zGe(e){let t=1,n=e.length;for(let i=0;i<n;i++){let r=e[i];if(++t,!l(r))continue;let o=r.attributes;t+=7+2*ue.packedLength+(l(r.indices)?r.indices.length:0);for(let s in o)if(o.hasOwnProperty(s)&&l(o[s])){let a=o[s];t+=5+a.values.length}}return t}bg.packCreateGeometryResults=function(e,t){let n=new Float64Array(zGe(e)),i=[],r={},o=e.length,s=0;n[s++]=o;for(let a=0;a<o;a++){let c=e[a],u=l(c);if(n[s++]=u?1:0,!u)continue;n[s++]=c.primitiveType,n[s++]=c.geometryType,n[s++]=c.offsetAttribute??-1;let f=l(c.boundingSphere)?1:0;n[s++]=f,f&&ue.pack(c.boundingSphere,n,s),s+=ue.packedLength;let d=l(c.boundingSphereCV)?1:0;n[s++]=d,d&&ue.pack(c.boundingSphereCV,n,s),s+=ue.packedLength;let p=c.attributes,g=[];for(let y in p)p.hasOwnProperty(y)&&l(p[y])&&(g.push(y),l(r[y])||(r[y]=i.length,i.push(y)));n[s++]=g.length;for(let y=0;y<g.length;y++){let A=g[y],b=p[A];n[s++]=r[A],n[s++]=b.componentDatatype,n[s++]=b.componentsPerAttribute,n[s++]=b.normalize?1:0,n[s++]=b.values.length,n.set(b.values,s),s+=b.values.length}let m=l(c.indices)?c.indices.length:0;n[s++]=m,m>0&&(n.set(c.indices,s),s+=m)}return t.push(n.buffer),{stringTable:i,packedData:n}};bg.unpackCreateGeometryResults=function(e){let t=e.stringTable,n=e.packedData,i,r=new Array(n[0]),o=0,s=1;for(;s<n.length;){if(!(n[s++]===1)){r[o++]=void 0;continue}let c=n[s++],u=n[s++],f=n[s++];f===-1&&(f=void 0);let d,p;n[s++]===1&&(d=ue.unpack(n,s)),s+=ue.packedLength,n[s++]===1&&(p=ue.unpack(n,s)),s+=ue.packedLength;let y,A,b,x=new Tn,T=n[s++];for(i=0;i<T;i++){let v=t[n[s++]],S=n[s++];b=n[s++];let I=n[s++]!==0;y=n[s++],A=Y.createTypedArray(S,y);for(let R=0;R<y;R++)A[R]=n[s++];x[v]=new Ne({componentDatatype:S,componentsPerAttribute:b,normalize:I,values:A})}let E;if(y=n[s++],y>0){let v=A.length/b;for(E=je.createTypedArray(v,y),i=0;i<y;i++)E[i]=n[s++]}r[o++]=new St({primitiveType:c,geometryType:u,boundingSphere:d,boundingSphereCV:p,indices:E,attributes:x,offsetAttribute:f})}return r};function VGe(e,t){let n=e.length,i=new Float64Array(1+n*19),r=0;i[r++]=n;for(let o=0;o<n;o++){let s=e[o];if(N.pack(s.modelMatrix,i,r),r+=N.packedLength,l(s.attributes)&&l(s.attributes.offset)){let a=s.attributes.offset.value;i[r]=a[0],i[r+1]=a[1],i[r+2]=a[2]}r+=3}return t.push(i.buffer),i}function jGe(e){let t=e,n=new Array(t[0]),i=0,r=1;for(;r<t.length;){let o=N.unpack(t,r),s;r+=N.packedLength,l(t[r])&&(s={offset:new Tr(t[r],t[r+1],t[r+2])}),r+=3,n[i++]={modelMatrix:o,attributes:s}}return n}bg.packCombineGeometryParameters=function(e,t){let n=e.createGeometryResults,i=n.length;for(let r=0;r<i;r++)t.push(n[r].packedData.buffer);return{createGeometryResults:e.createGeometryResults,packedInstances:VGe(e.instances,t),ellipsoid:e.ellipsoid,isGeographic:e.projection instanceof Ui,elementIndexUintSupported:e.elementIndexUintSupported,scene3DOnly:e.scene3DOnly,vertexCacheOptimize:e.vertexCacheOptimize,compressVertices:e.compressVertices,modelMatrix:e.modelMatrix,createPickOffsets:e.createPickOffsets}};bg.unpackCombineGeometryParameters=function(e){let t=jGe(e.packedInstances),n=e.createGeometryResults,i=n.length,r=0;for(let a=0;a<i;a++){let c=bg.unpackCreateGeometryResults(n[a]),u=c.length;for(let f=0;f<u;f++){let d=c[f],p=t[r];p.geometry=d,++r}}let o=ee.clone(e.ellipsoid),s=e.isGeographic?new Ui(o):new yi(o);return{instances:t,ellipsoid:o,projection:s,elementIndexUintSupported:e.elementIndexUintSupported,scene3DOnly:e.scene3DOnly,vertexCacheOptimize:e.vertexCacheOptimize,compressVertices:e.compressVertices,modelMatrix:N.clone(e.modelMatrix),createPickOffsets:e.createPickOffsets}};function Pme(e){let t=e.length,n=1+(ue.packedLength+1)*t,i=new Float32Array(n),r=0;i[r++]=t;for(let o=0;o<t;++o){let s=e[o];l(s)?(i[r++]=1,ue.pack(e[o],i,r)):i[r++]=0,r+=ue.packedLength}return i}function Dme(e){let t=new Array(e[0]),n=0,i=1;for(;i<e.length;)e[i++]===1&&(t[n]=ue.unpack(e,i)),++n,i+=ue.packedLength;return t}bg.packCombineGeometryResults=function(e,t){l(e.geometries)&&UGe(e.geometries,t);let n=Pme(e.boundingSpheres),i=Pme(e.boundingSpheresCV);return t.push(n.buffer,i.buffer),{geometries:e.geometries,attributeLocations:e.attributeLocations,modelMatrix:e.modelMatrix,pickOffsets:e.pickOffsets,offsetInstanceExtend:e.offsetInstanceExtend,boundingSpheres:n,boundingSpheresCV:i}};bg.unpackCombineGeometryResults=function(e){return{geometries:e.geometries,attributeLocations:e.attributeLocations,modelMatrix:e.modelMatrix,pickOffsets:e.pickOffsets,offsetInstanceExtend:e.offsetInstanceExtend,boundingSpheres:Dme(e.boundingSpheres),boundingSpheresCV:Dme(e.boundingSpheresCV)}};var Dx=bg;var Rme={READY:0,CREATING:1,CREATED:2,COMBINING:3,COMBINED:4,COMPLETE:5,FAILED:6};Object.freeze(Rme);var rs=Rme;var Lu={DISABLED:0,ENABLED:1,CAST_ONLY:2,RECEIVE_ONLY:3};Lu.NUMBER_OF_SHADOW_MODES=4;Lu.castShadows=function(e){return e===Lu.ENABLED||e===Lu.CAST_ONLY};Lu.receiveShadows=function(e){return e===Lu.ENABLED||e===Lu.RECEIVE_ONLY};Lu.fromCastReceive=function(e,t){return e&&t?Lu.ENABLED:e?Lu.CAST_ONLY:t?Lu.RECEIVE_ONLY:Lu.DISABLED};Object.freeze(Lu);var Pn=Lu;function os(e){e=e??H.EMPTY_OBJECT,this.geometryInstances=e.geometryInstances,this.appearance=e.appearance,this._appearance=void 0,this._material=void 0,this.depthFailAppearance=e.depthFailAppearance,this._depthFailAppearance=void 0,this._depthFailMaterial=void 0,this.modelMatrix=N.clone(e.modelMatrix??N.IDENTITY),this._modelMatrix=new N,this.show=e.show??!0,this._vertexCacheOptimize=e.vertexCacheOptimize??!1,this._interleave=e.interleave??!1,this._releaseGeometryInstances=e.releaseGeometryInstances??!0,this._allowPicking=e.allowPicking??!0,this._asynchronous=e.asynchronous??!0,this._compressVertices=e.compressVertices??!0,this.cull=e.cull??!0,this.debugShowBoundingVolume=e.debugShowBoundingVolume??!1,this.rtcCenter=e.rtcCenter,this.shadows=e.shadows??Pn.DISABLED,this._translucent=void 0,this._state=rs.READY,this._geometries=[],this._error=void 0,this._numberOfInstances=0,this._boundingSpheres=[],this._boundingSphereWC=[],this._boundingSphereCV=[],this._boundingSphere2D=[],this._boundingSphereMorph=[],this._perInstanceAttributeCache=new Map,this._instanceIds=[],this._lastPerInstanceAttributeIndex=0,this._va=[],this._attributeLocations=void 0,this._primitiveType=void 0,this._frontFaceRS=void 0,this._backFaceRS=void 0,this._sp=void 0,this._depthFailAppearance=void 0,this._spDepthFail=void 0,this._frontFaceDepthFailRS=void 0,this._backFaceDepthFailRS=void 0,this._pickIds=[],this._colorCommands=[],this._pickCommands=[],this._createBoundingVolumeFunction=e._createBoundingVolumeFunction,this._createRenderStatesFunction=e._createRenderStatesFunction,this._createShaderProgramFunction=e._createShaderProgramFunction,this._createCommandsFunction=e._createCommandsFunction,this._updateAndQueueCommandsFunction=e._updateAndQueueCommandsFunction,this._createPickOffsets=e._createPickOffsets,this._pickOffsets=void 0,this._createGeometryResults=void 0,this._ready=!1,this._batchTable=void 0,this._batchTableAttributeIndices=void 0,this._offsetInstanceExtend=void 0,this._batchTableOffsetAttribute2DIndex=void 0,this._batchTableOffsetsUpdated=!1,this._instanceBoundingSpheres=void 0,this._instanceBoundingSpheresCV=void 0,this._tempBoundingSpheres=void 0,this._recomputeBoundingSpheres=!1,this._batchTableBoundingSpheresUpdated=!1,this._batchTableBoundingSphereAttributeIndices=void 0}Object.defineProperties(os.prototype,{vertexCacheOptimize:{get:function(){return this._vertexCacheOptimize}},interleave:{get:function(){return this._interleave}},releaseGeometryInstances:{get:function(){return this._releaseGeometryInstances}},allowPicking:{get:function(){return this._allowPicking}},asynchronous:{get:function(){return this._asynchronous}},compressVertices:{get:function(){return this._compressVertices}},ready:{get:function(){return this._ready}}});function HGe(e){let t=e.length,n=[],i=e[0].attributes,r;for(r in i)if(i.hasOwnProperty(r)&&l(i[r])){let o=i[r],s=!0;for(let a=1;a<t;++a){let c=e[a].attributes[r];if(!l(c)||o.componentDatatype!==c.componentDatatype||o.componentsPerAttribute!==c.componentsPerAttribute||o.normalize!==c.normalize){s=!1;break}}s&&n.push(r)}return n}var GGe=new U,WGe=new h,zme=new se;function Vme(e){let t=e.length;if(t===1)return e[0];if(t===2)return U.unpack(e,0,GGe);if(t===3)return h.unpack(e,0,WGe);if(t===4)return se.unpack(e,0,zme)}function qGe(e,t){let n=e.geometryInstances,i=Array.isArray(n)?n:[n],r=i.length;if(r===0)return;let o=HGe(i),s=o.length,a=[],c={},u={},f,p=i[0].attributes,g,m,y;for(g=0;g<s;++g)m=o[g],y=p[m],c[m]=g,a.push({functionName:`czm_batchTable_${m}`,componentDatatype:y.componentDatatype,componentsPerAttribute:y.componentsPerAttribute,normalize:y.normalize});o.indexOf("distanceDisplayCondition")!==-1&&(a.push({functionName:"czm_batchTable_boundingSphereCenter3DHigh",componentDatatype:Y.FLOAT,componentsPerAttribute:3},{functionName:"czm_batchTable_boundingSphereCenter3DLow",componentDatatype:Y.FLOAT,componentsPerAttribute:3},{functionName:"czm_batchTable_boundingSphereCenter2DHigh",componentDatatype:Y.FLOAT,componentsPerAttribute:3},{functionName:"czm_batchTable_boundingSphereCenter2DLow",componentDatatype:Y.FLOAT,componentsPerAttribute:3},{functionName:"czm_batchTable_boundingSphereRadius",componentDatatype:Y.FLOAT,componentsPerAttribute:1}),u.center3DHigh=a.length-5,u.center3DLow=a.length-4,u.center2DHigh=a.length-3,u.center2DLow=a.length-2,u.radius=a.length-1),o.indexOf("offset")!==-1&&(a.push({functionName:"czm_batchTable_offset2D",componentDatatype:Y.FLOAT,componentsPerAttribute:3}),f=a.length-1),a.push({functionName:"czm_batchTable_pickColor",componentDatatype:Y.UNSIGNED_BYTE,componentsPerAttribute:4,normalize:!0});let A=a.length,b=new Px(t,a,r);for(g=0;g<r;++g){let x=i[g];p=x.attributes;for(let I=0;I<s;++I){m=o[I],y=p[m];let R=Vme(y.value),O=c[m];b.setBatchedAttribute(g,O,R)}let T={primitive:x.pickPrimitive??e};l(x.id)&&(T.id=x.id);let E=t.createPickId(T);e._pickIds.push(E);let v=E.color,S=zme;S.x=z.floatToByte(v.red),S.y=z.floatToByte(v.green),S.z=z.floatToByte(v.blue),S.w=z.floatToByte(v.alpha),b.setBatchedAttribute(g,A-1,S)}e._batchTable=b,e._batchTableAttributeIndices=c,e._batchTableBoundingSphereAttributeIndices=u,e._batchTableOffsetAttribute2DIndex=f}function YGe(e){let t;return Array.isArray(e.values)?t=e.values.slice(0):t=new e.values.constructor(e.values),new Ne({componentDatatype:e.componentDatatype,componentsPerAttribute:e.componentsPerAttribute,normalize:e.normalize,values:t})}function XGe(e){let t=e.attributes,n=new Tn;for(let r in t)t.hasOwnProperty(r)&&l(t[r])&&(n[r]=YGe(t[r]));let i;if(l(e.indices)){let r=e.indices;Array.isArray(r)?i=r.slice(0):i=new r.constructor(r)}return new St({attributes:n,indices:i,primitiveType:e.primitiveType,boundingSphere:ue.clone(e.boundingSphere)})}function KGe(e,t){return{geometry:t,attributes:e.attributes,modelMatrix:N.clone(e.modelMatrix),pickPrimitive:e.pickPrimitive,id:e.id}}var $Ge=/in\s+vec(?:3|4)\s+(.*)3DHigh;/g;os._modifyShaderPosition=function(e,t,n){let i,r="",o="",s="";for(;(i=$Ge.exec(t))!==null;){let a=i[1],c=`vec4 czm_compute${a[0].toUpperCase()}${a.substr(1)}()`;c!=="vec4 czm_computePosition()"&&(r+=`${c}; `),l(e.rtcCenter)?(t=t.replace(/in\s+vec(?:3|4)\s+position3DHigh;/g,""),t=t.replace(/in\s+vec(?:3|4)\s+position3DLow;/g,""),r+=`uniform mat4 u_modifiedModelView; `,o+=`in vec4 position; `,s+=`${c} @@ -6825,13 +6720,13 @@ void main() { czm_non_show_main(); gl_Position *= czm_batchTable_show(batchId); -}`:t};os._updateColorAttribute=function(e,t,n){if(!l(e._batchTableAttributeIndices.color)&&!l(e._batchTableAttributeIndices.depthFailColor)||t.search(/in\s+vec4\s+color;/g)===-1)return t;let i=t;return i=i.replace(/in\s+vec4\s+color;/g,""),n?i=i.replace(/(\b)color(\b)/g,"$1czm_batchTable_depthFailColor(batchId)$2"):i=i.replace(/(\b)color(\b)/g,"$1czm_batchTable_color(batchId)$2"),i};function gme(e){return`${Ye.replaceMain(e,"czm_non_pick_main")} +}`:t};os._updateColorAttribute=function(e,t,n){if(!l(e._batchTableAttributeIndices.color)&&!l(e._batchTableAttributeIndices.depthFailColor)||t.search(/in\s+vec4\s+color;/g)===-1)return t;let i=t;return i=i.replace(/in\s+vec4\s+color;/g,""),n?i=i.replace(/(\b)color(\b)/g,"$1czm_batchTable_depthFailColor(batchId)$2"):i=i.replace(/(\b)color(\b)/g,"$1czm_batchTable_color(batchId)$2"),i};function Ome(e){return`${Ye.replaceMain(e,"czm_non_pick_main")} out vec4 v_pickColor; void main() { czm_non_pick_main(); v_pickColor = czm_batchTable_pickColor(batchId); -}`}function _me(e){return`in vec4 v_pickColor; +}`}function Mme(e){return`in vec4 v_pickColor; ${e}`}os._updatePickColorAttribute=function(e){let t=e.replace(/in\s+vec4\s+pickColor;/g,"");return t=t.replace(/(\b)pickColor(\b)/g,"$1czm_batchTable_pickColor(batchId)$2"),t};os._appendOffsetToShader=function(e,t){if(!l(e._batchTableAttributeIndices.offset))return t;let n=`in float batchId; `;n+="in float applyOffset;";let i=t.replace(/in\s+float\s+batchId;/g,n),r=`vec4 $1 = czm_computePosition(); `;return r+=` if (czm_sceneMode == czm_sceneMode3D) @@ -6882,7 +6777,7 @@ ${e}`}os._updatePickColorAttribute=function(e){let t=e.replace(/in\s+vec4\s+pick float show = (distanceSq >= nearSq && distanceSq <= farSq) ? 1.0 : 0.0; gl_Position *= show; }`,`${i} -${r}`};function yme(e,t){if(!e.compressVertices)return t;let n=t.search(/in\s+vec3\s+normal;/g)!==-1,i=t.search(/in\s+vec2\s+st;/g)!==-1;if(!n&&!i)return t;let r=t.search(/in\s+vec3\s+tangent;/g)!==-1,o=t.search(/in\s+vec3\s+bitangent;/g)!==-1,s=i&&n?2:1;s+=r||o?1:0;let a=s>1?`vec${s}`:"float",c="compressedAttributes",u=`in ${a} ${c};`,f="",d="";if(i){f+=`vec2 st; +${r}`};function Nme(e,t){if(!e.compressVertices)return t;let n=t.search(/in\s+vec3\s+normal;/g)!==-1,i=t.search(/in\s+vec2\s+st;/g)!==-1;if(!n&&!i)return t;let r=t.search(/in\s+vec3\s+tangent;/g)!==-1,o=t.search(/in\s+vec3\s+bitangent;/g)!==-1,s=i&&n?2:1;s+=r||o?1:0;let a=s>1?`vec${s}`:"float",c="compressedAttributes",u=`in ${a} ${c};`,f="",d="";if(i){f+=`vec2 st; `;let m=s>1?`${c}.x`:c;d+=` st = czm_decompressTextureCoordinates(${m}); `}n&&r&&o?(f+=`vec3 normal; vec3 tangent; @@ -6898,10 +6793,10 @@ vec3 bitangent; { ${d} czm_non_compressed_main(); }`;return[u,f,p,g].join(` -`)}function m5e(e){let t=Ye.replaceMain(e,"czm_non_depth_clamp_main");return t+=`void main() { +`)}function JGe(e){let t=Ye.replaceMain(e,"czm_non_depth_clamp_main");return t+=`void main() { czm_non_depth_clamp_main(); gl_Position = czm_depthClamp(gl_Position);} -`,t}function p5e(e){let t=Ye.replaceMain(e,"czm_non_depth_clamp_main");return t+=`void main() { +`,t}function ZGe(e){let t=Ye.replaceMain(e,"czm_non_depth_clamp_main");return t+=`void main() { czm_non_depth_clamp_main(); #if defined(LOG_DEPTH) czm_writeLogDepth(); @@ -6909,223 +6804,198 @@ ${d} czm_non_compressed_main(); czm_writeDepthClamp(); #endif } -`,t}function Ame(e,t){let n=e.vertexAttributes}function g5e(e,t){return function(){return e[t]}}var tK=Math.max(dn.hardwareConcurrency-1,1),x6,_5e=new $n("combineGeometry");function y5e(e,t){let n,i,r,o,s=e._instanceIds;if(e._state===rs.READY){n=Array.isArray(e.geometryInstances)?e.geometryInstances:[e.geometryInstances];let a=e._numberOfInstances=n.length,c=[],u=[];for(r=0;r<a;++r)i=n[r].geometry,s.push(n[r].id),u.push({moduleName:i._workerName,modulePath:i._workerPath,geometry:i});if(!l(x6))for(x6=new Array(tK),r=0;r<tK;r++)x6[r]=new $n("createGeometry");let f;for(u=fN(u,tK),r=0;r<u.length;r++){let d=0,p=u[r],g=p.length;for(o=0;o<g;++o)f=p[o],i=f.geometry,l(i.constructor.pack)&&(f.offset=d,d+=i.constructor.packedLength??i.packedLength);let m;if(d>0){let y=new Float64Array(d);for(m=[y.buffer],o=0;o<g;++o)f=p[o],i=f.geometry,l(i.constructor.pack)&&(i.constructor.pack(i,y,f.offset),f.geometry=y)}c.push(x6[r].scheduleTask({subTasks:u[r]},m))}e._state=rs.CREATING,Promise.all(c).then(function(d){e._createGeometryResults=d,e._state=rs.CREATED}).catch(function(d){pN(e,t,rs.FAILED,d)})}else if(e._state===rs.CREATED){let a=[];n=Array.isArray(e.geometryInstances)?e.geometryInstances:[e.geometryInstances];let c=t.scene3DOnly,u=t.mapProjection,f=_5e.scheduleTask(Ix.packCombineGeometryParameters({createGeometryResults:e._createGeometryResults,instances:n,ellipsoid:u.ellipsoid,projection:u,elementIndexUintSupported:t.context.elementIndexUint,scene3DOnly:c,vertexCacheOptimize:e.vertexCacheOptimize,compressVertices:e.compressVertices,modelMatrix:e.modelMatrix,createPickOffsets:e._createPickOffsets},a),a);e._createGeometryResults=void 0,e._state=rs.COMBINING,Promise.resolve(f).then(function(d){let p=Ix.unpackCombineGeometryResults(d);e._geometries=p.geometries,e._attributeLocations=p.attributeLocations,e.modelMatrix=N.clone(p.modelMatrix,e.modelMatrix),e._pickOffsets=p.pickOffsets,e._offsetInstanceExtend=p.offsetInstanceExtend,e._instanceBoundingSpheres=p.boundingSpheres,e._instanceBoundingSpheresCV=p.boundingSpheresCV,l(e._geometries)&&e._geometries.length>0?(e._recomputeBoundingSpheres=!0,e._state=rs.COMBINED):pN(e,t,rs.FAILED,void 0)}).catch(function(d){pN(e,t,rs.FAILED,d)})}}function A5e(e,t){let n=Array.isArray(e.geometryInstances)?e.geometryInstances:[e.geometryInstances],i=e._numberOfInstances=n.length,r=new Array(i),o=e._instanceIds,s,a,c=0;for(a=0;a<i;a++){s=n[a];let p=s.geometry,g;l(p.attributes)&&l(p.primitiveType)?g=f5e(p):g=p.constructor.createGeometry(p),r[c++]=d5e(s,g),o.push(s.id)}r.length=c;let u=t.scene3DOnly,f=t.mapProjection,d=Ix.combineGeometry({instances:r,ellipsoid:f.ellipsoid,projection:f,elementIndexUintSupported:t.context.elementIndexUint,scene3DOnly:u,vertexCacheOptimize:e.vertexCacheOptimize,compressVertices:e.compressVertices,modelMatrix:e.modelMatrix,createPickOffsets:e._createPickOffsets});e._geometries=d.geometries,e._attributeLocations=d.attributeLocations,e.modelMatrix=N.clone(d.modelMatrix,e.modelMatrix),e._pickOffsets=d.pickOffsets,e._offsetInstanceExtend=d.offsetInstanceExtend,e._instanceBoundingSpheres=d.boundingSpheres,e._instanceBoundingSpheresCV=d.boundingSpheresCV,l(e._geometries)&&e._geometries.length>0?(e._recomputeBoundingSpheres=!0,e._state=rs.COMBINED):pN(e,t,rs.FAILED,void 0)}function b5e(e,t){let n=e._batchTableAttributeIndices.offset;if(!e._recomputeBoundingSpheres||!l(n)){e._recomputeBoundingSpheres=!1;return}let i,r=e._offsetInstanceExtend,o=e._instanceBoundingSpheres,s=o.length,a=e._tempBoundingSpheres;if(!l(a)){for(a=new Array(s),i=0;i<s;i++)a[i]=new ue;e._tempBoundingSpheres=a}for(i=0;i<s;++i){let y=a[i],A=e._batchTable.getBatchedAttribute(i,n,new h);y=o[i].clone(y),Pme(y,A,r[i])}let c=[],u=[],f=[];for(i=0;i<s;++i){let y=a[i];y.center.x-y.radius>0||ue.intersectPlane(y,sn.ORIGIN_ZX_PLANE)!==$t.INTERSECTING?c.push(y):(u.push(y),f.push(y))}let d=c[0],p=f[0],g=u[0];for(i=1;i<c.length;i++)d=ue.union(d,c[i]);for(i=1;i<f.length;i++)p=ue.union(p,f[i]);for(i=1;i<u.length;i++)g=ue.union(g,u[i]);let m=[];for(l(d)&&m.push(d),l(p)&&m.push(p),l(g)&&m.push(g),i=0;i<m.length;i++){let y=m[i].clone(e._boundingSpheres[i]);e._boundingSpheres[i]=y,e._boundingSphereCV[i]=ue.projectTo2D(y,t.mapProjection,e._boundingSphereCV[i])}os._updateBoundingVolumes(e,t,e.modelMatrix,!0),e._recomputeBoundingSpheres=!1}var bme=new Sn,Sme=new he,wme=new h,Ime=new ue;function x5e(e,t){if(!l(e._batchTableAttributeIndices.distanceDisplayCondition)||e._batchTableBoundingSpheresUpdated)return;let i=e._batchTableBoundingSphereAttributeIndices,r=i.center3DHigh,o=i.center3DLow,s=i.center2DHigh,a=i.center2DLow,c=i.radius,u=t.mapProjection,f=u.ellipsoid,d=e._batchTable,p=e._instanceBoundingSpheres,g=p.length;for(let m=0;m<g;++m){let y=p[m];if(!l(y))continue;let A=e.modelMatrix;l(A)&&(y=ue.transform(y,A,Ime));let b=y.center,x=y.radius,T=Sn.fromCartesian(b,bme);if(d.setBatchedAttribute(m,r,T.high),d.setBatchedAttribute(m,o,T.low),!t.scene3DOnly){let E=f.cartesianToCartographic(b,Sme),v=u.project(E,wme);T=Sn.fromCartesian(v,bme),d.setBatchedAttribute(m,s,T.high),d.setBatchedAttribute(m,a,T.low)}d.setBatchedAttribute(m,c,x)}e._batchTableBoundingSpheresUpdated=!0}var nK=new h,T5e=new h;function xme(e,t){if(!l(e._batchTableAttributeIndices.offset)||e._batchTableOffsetsUpdated||t.scene3DOnly)return;let i=e._batchTableOffsetAttribute2DIndex,r=t.mapProjection,o=r.ellipsoid,s=e._batchTable,a=e._instanceBoundingSpheres,c=a.length;for(let u=0;u<c;++u){let f=a[u];if(!l(f))continue;let d=s.getBatchedAttribute(u,e._batchTableAttributeIndices.offset);if(h.equals(d,h.ZERO)){s.setBatchedAttribute(u,i,h.ZERO);continue}let p=e.modelMatrix;l(p)&&(f=ue.transform(f,p,Ime));let g=f.center;g=o.scaleToGeodeticSurface(g,T5e);let m=o.cartesianToCartographic(g,Sme),y=r.project(m,wme),A=h.add(d,g,nK);m=o.cartesianToCartographic(A,m);let b=r.project(m,nK),x=h.subtract(b,y,nK),T=x.x;x.x=x.z,x.z=x.y,x.y=T,s.setBatchedAttribute(u,i,x)}e._batchTableOffsetsUpdated=!0}function E5e(e,t){let n=e._attributeLocations,i=e._geometries,r=t.scene3DOnly,o=t.context,s=[],a=i.length;for(let c=0;c<a;++c){let u=i[c];if(s.push(zn.fromGeometry({context:o,geometry:u,attributeLocations:n,bufferUsage:Me.STATIC_DRAW,interleave:e._interleave})),l(e._createBoundingVolumeFunction))e._createBoundingVolumeFunction(t,u);else if(e._boundingSpheres.push(ue.clone(u.boundingSphere)),e._boundingSphereWC.push(new ue),!r){let f=u.boundingSphereCV.center,d=f.x,p=f.y,g=f.z;f.x=g,f.y=d,f.z=p,e._boundingSphereCV.push(ue.clone(u.boundingSphereCV)),e._boundingSphere2D.push(new ue),e._boundingSphereMorph.push(new ue)}}e._va=s,e._primitiveType=i[0].primitiveType,e.releaseGeometryInstances&&(e.geometryInstances=void 0),e._geometries=void 0,pN(e,t,rs.COMPLETE,void 0)}function C5e(e,t,n,i){let r=n.getRenderState(),o;i?(o=Je(r,!1),o.cull={enabled:!0,face:Vi.BACK},e._frontFaceRS=Ge.fromCache(o),o.cull.face=Vi.FRONT,e._backFaceRS=Ge.fromCache(o)):(e._frontFaceRS=Ge.fromCache(r),e._backFaceRS=e._frontFaceRS),o=Je(r,!1),l(e._depthFailAppearance)&&(o.depthTest.enabled=!1),l(e._depthFailAppearance)&&(r=e._depthFailAppearance.getRenderState(),o=Je(r,!1),o.depthTest.func=cc.GREATER,i?(o.cull={enabled:!0,face:Vi.BACK},e._frontFaceDepthFailRS=Ge.fromCache(o),o.cull.face=Vi.FRONT,e._backFaceDepthFailRS=Ge.fromCache(o)):(e._frontFaceDepthFailRS=Ge.fromCache(o),e._backFaceDepthFailRS=e._frontFaceRS))}function v5e(e,t,n){let i=t.context,r=e._attributeLocations,o=e._batchTable.getVertexShaderCallback()(n.vertexShaderSource);o=os._appendOffsetToShader(e,o),o=os._appendShowToShader(e,o),o=os._appendDistanceDisplayConditionToShader(e,o,t.scene3DOnly),o=gme(o),o=os._updateColorAttribute(e,o,!1),o=yme(e,o),o=os._modifyShaderPosition(e,o,t.scene3DOnly);let s=n.getFragmentShaderSource();s=_me(s),e._sp=Qt.replaceCache({context:i,shaderProgram:e._sp,vertexShaderSource:o,fragmentShaderSource:s,attributeLocations:r}),Ame(e._sp,r),l(e._depthFailAppearance)&&(o=e._batchTable.getVertexShaderCallback()(e._depthFailAppearance.vertexShaderSource),o=os._appendShowToShader(e,o),o=os._appendDistanceDisplayConditionToShader(e,o,t.scene3DOnly),o=gme(o),o=os._updateColorAttribute(e,o,!0),o=yme(e,o),o=os._modifyShaderPosition(e,o,t.scene3DOnly),o=m5e(o),s=e._depthFailAppearance.getFragmentShaderSource(),s=_me(s),s=p5e(s),e._spDepthFail=Qt.replaceCache({context:i,shaderProgram:e._spDepthFail,vertexShaderSource:o,fragmentShaderSource:s,attributeLocations:r}),Ame(e._spDepthFail,r))}var mN=new N,Tme=new h;function Eme(e,t,n,i){let r=l(n)?n._uniforms:void 0,o={},s=t.uniforms;if(l(s))for(let c in s)s.hasOwnProperty(c)&&(o[c]=g5e(s,c));let a=Ot(o,r);return a=e._batchTable.getUniformMapCallback()(a),l(e.rtcCenter)&&(a.u_modifiedModelView=function(){let c=i.context.uniformState.view;return N.multiply(c,e._modelMatrix,mN),N.multiplyByPoint(mN,e.rtcCenter,Tme),N.setTranslation(mN,Tme,mN),mN}),a}function S5e(e,t,n,i,r,o,s,a){let c=Eme(e,t,n,a),u;l(e._depthFailAppearance)&&(u=Eme(e,e._depthFailAppearance,e._depthFailAppearance.material,a));let f=i?Ie.TRANSLUCENT:Ie.OPAQUE,d=r?2:1;d*=l(e._depthFailAppearance)?2:1,o.length=e._va.length*d;let p=o.length,g=0;for(let m=0;m<p;++m){let y;r&&(y=o[m],l(y)||(y=o[m]=new at({owner:e,primitiveType:e._primitiveType})),y.vertexArray=e._va[g],y.renderState=e._backFaceRS,y.shaderProgram=e._sp,y.uniformMap=c,y.pass=f,++m),y=o[m],l(y)||(y=o[m]=new at({owner:e,primitiveType:e._primitiveType})),y.vertexArray=e._va[g],y.renderState=e._frontFaceRS,y.shaderProgram=e._sp,y.uniformMap=c,y.pass=f,l(e._depthFailAppearance)&&(r&&(++m,y=o[m],l(y)||(y=o[m]=new at({owner:e,primitiveType:e._primitiveType})),y.vertexArray=e._va[g],y.renderState=e._backFaceDepthFailRS,y.shaderProgram=e._spDepthFail,y.uniformMap=u,y.pass=f),++m,y=o[m],l(y)||(y=o[m]=new at({owner:e,primitiveType:e._primitiveType})),y.vertexArray=e._va[g],y.renderState=e._frontFaceDepthFailRS,y.shaderProgram=e._spDepthFail,y.uniformMap=u,y.pass=f),++g}}os._updateBoundingVolumes=function(e,t,n,i){let r,o,s;if(i||!N.equals(n,e._modelMatrix))for(N.clone(n,e._modelMatrix),o=e._boundingSpheres.length,r=0;r<o;++r)s=e._boundingSpheres[r],l(s)&&(e._boundingSphereWC[r]=ue.transform(s,n,e._boundingSphereWC[r]),t.scene3DOnly||(e._boundingSphere2D[r]=ue.clone(e._boundingSphereCV[r],e._boundingSphere2D[r]),e._boundingSphereMorph[r]=ue.union(e._boundingSphereWC[r],e._boundingSphereCV[r])));let a=e.appearance.pixelSize;if(l(a))for(o=e._boundingSpheres.length,r=0;r<o;++r){s=e._boundingSpheres[r];let c=e._boundingSphereWC[r],f=t.camera.getPixelSize(s,t.context.drawingBufferWidth,t.context.drawingBufferHeight)*a;c.radius=s.radius+f}};function w5e(e,t,n,i,r,o,s,a){os._updateBoundingVolumes(e,t,r);let c;t.mode===re.SCENE3D?c=e._boundingSphereWC:t.mode===re.COLUMBUS_VIEW?c=e._boundingSphereCV:t.mode===re.SCENE2D&&l(e._boundingSphere2D)?c=e._boundingSphere2D:l(e._boundingSphereMorph)&&(c=e._boundingSphereMorph);let u=t.commandList,f=t.passes;if(f.render||f.pick){let d=e.allowPicking,p=Dn.castShadows(e.shadows),g=Dn.receiveShadows(e.shadows),m=n.length,y=a?2:1;y*=l(e._depthFailAppearance)?2:1;for(let A=0;A<m;++A){let b=Math.floor(A/y),x=n[A];x.modelMatrix=r,x.boundingVolume=c[b],x.cull=o,x.debugShowBoundingVolume=s,x.castShadows=p,x.receiveShadows=g,d?x.pickId="v_pickColor":x.pickId=void 0,u.push(x)}}}os.prototype.update=function(e){if(!l(this.geometryInstances)&&this._va.length===0||l(this.geometryInstances)&&Array.isArray(this.geometryInstances)&&this.geometryInstances.length===0||!l(this.appearance)||e.mode!==re.SCENE3D&&e.scene3DOnly||!e.passes.render&&!e.passes.pick)return;if(l(this._error))throw this._error;if(this._state===rs.FAILED)return;let t=e.context;if(l(this._batchTable)||l5e(this,t),this._batchTable.attributes.length>0){if(kt.maximumVertexTextureImageUnits===0)throw new oe("Vertex texture fetch support is required to render primitives with per-instance attributes. The maximum number of vertex texture image units must be greater than zero.");this._batchTable.update(e)}if(this._state!==rs.COMPLETE&&this._state!==rs.COMBINED&&(this.asynchronous?y5e(this,e):A5e(this,e)),this._state===rs.COMBINED&&(x5e(this,e),xme(this,e),E5e(this,e)),!this.show||this._state!==rs.COMPLETE)return;this._batchTableOffsetsUpdated||xme(this,e),this._recomputeBoundingSpheres&&b5e(this,e);let n=this.appearance,i=n.material,r=!1,o=!1;this._appearance!==n?(this._appearance=n,this._material=i,r=!0,o=!0):this._material!==i&&(this._material=i,o=!0);let s=this.depthFailAppearance,a=l(s)?s.material:void 0;this._depthFailAppearance!==s?(this._depthFailAppearance=s,this._depthFailMaterial=a,r=!0,o=!0):this._depthFailMaterial!==a&&(this._depthFailMaterial=a,o=!0);let c=this._appearance.isTranslucent();this._translucent!==c&&(this._translucent=c,r=!0),l(this._material)&&this._material.update(t);let u=n.closed&&c;r&&(this._createRenderStatesFunction??C5e)(this,t,n,u),o&&(this._createShaderProgramFunction??v5e)(this,e,n),(r||o)&&(this._createCommandsFunction??S5e)(this,n,i,c,u,this._colorCommands,this._pickCommands,e),(this._updateAndQueueCommandsFunction??w5e)(this,e,this._colorCommands,this._pickCommands,this.modelMatrix,this.cull,this.debugShowBoundingVolume,u)};var I5e=new ue,P5e=new ue;function Pme(e,t,n){if(n===mn.TOP){let i=ue.clone(e,I5e),r=ue.clone(e,P5e);r.center=h.add(r.center,t,r.center),e=ue.union(i,r,e)}else n===mn.ALL&&(e.center=h.add(e.center,t,e.center));return e}function D5e(e,t,n){return function(){let i=e.getBatchedAttribute(t,n),r=e.attributes[n],o=r.componentsPerAttribute,s=Y.createTypedArray(r.componentDatatype,o);return l(i.constructor.pack)?i.constructor.pack(i,s,0):s[0]=i,s}}function R5e(e,t,n,i,r){return function(o){let s=vme(o);e.setBatchedAttribute(t,n,s),r==="offset"&&(i._recomputeBoundingSpheres=!0,i._batchTableOffsetsUpdated=!1)}}var O5e=new h;function M5e(e,t,n){t.boundingSphere={get:function(){let i=e._instanceBoundingSpheres[n];if(l(i)){i=i.clone();let r=e.modelMatrix,o=t.offset;l(o)&&Pme(i,h.fromArray(o.get(),0,O5e),e._offsetInstanceExtend[n]),l(r)&&(i=ue.transform(i,r))}return i}},t.boundingSphereCV={get:function(){return e._instanceBoundingSpheresCV[n]}}}function N5e(e,t,n){t.pickId={get:function(){return e._pickIds[n]}}}os.prototype.getGeometryInstanceAttributes=function(e){let t=this._perInstanceAttributeCache.get(e);if(l(t))return t;let n=-1,i=this._lastPerInstanceAttributeIndex,r=this._instanceIds,o=r.length;for(let u=0;u<o;++u){let f=(i+u)%o;if(e===r[f]){n=f;break}}if(n===-1)return;let s=this._batchTable,a=this._batchTableAttributeIndices;t={};let c={};for(let u in a)if(a.hasOwnProperty(u)){let f=a[u];c[u]={get:D5e(s,n,f),set:R5e(s,n,f,this,u)}}return M5e(this,c,n),N5e(this,c,n),Object.defineProperties(t,c),this._lastPerInstanceAttributeIndex=n,this._perInstanceAttributeCache.set(e,t),t};os.prototype.isDestroyed=function(){return!1};os.prototype.destroy=function(){let e,t;this._sp=this._sp&&this._sp.destroy(),this._spDepthFail=this._spDepthFail&&this._spDepthFail.destroy();let n=this._va;for(e=n.length,t=0;t<e;++t)n[t].destroy();this._va=void 0;let i=this._pickIds;for(e=i.length,t=0;t<e;++t)i[t].destroy();return this._pickIds=void 0,this._batchTable=this._batchTable&&this._batchTable.destroy(),this._instanceIds=void 0,this._perInstanceAttributeCache=void 0,this._attributeLocations=void 0,le(this)};function pN(e,t,n,i){e._error=i,e._state=n,t.afterRender.push(function(){return e._ready=e._state===rs.COMPLETE||e._state===rs.FAILED,!0})}var On=os;function L5e(e){e=e??H.EMPTY_OBJECT,this.componentDatatype=e.componentDatatype,this.componentsPerAttribute=e.componentsPerAttribute,this.normalize=e.normalize??!1,this.value=e.value}var Qc=L5e;function Nd(e,t,n){this._projectionExtentDefines={eastMostYhighDefine:"",eastMostYlowDefine:"",westMostYhighDefine:"",westMostYlowDefine:""};let i=new iK;i.requiresTextureCoordinates=e,i.requiresEC=!n.flat;let r=new iK;if(r.requiresTextureCoordinates=e,n instanceof yn)i.requiresNormalEC=!n.flat;else{let o=`${n.material.shaderSource} -${n.fragmentShaderSource}`;i.normalEC=o.indexOf("materialInput.normalEC")!==-1||o.indexOf("czm_getDefaultMaterial")!==-1,i.positionToEyeEC=o.indexOf("materialInput.positionToEyeEC")!==-1,i.tangentToEyeMatrix=o.indexOf("materialInput.tangentToEyeMatrix")!==-1,i.st=o.indexOf("materialInput.st")!==-1}this._colorShaderDependencies=i,this._pickShaderDependencies=r,this._appearance=n,this._extentsCulling=e,this._planarExtents=t}Nd.prototype.createFragmentShader=function(e){let t=this._appearance,n=this._colorShaderDependencies,i=[];!e&&!this._planarExtents&&i.push("SPHERICAL"),n.requiresEC&&i.push("REQUIRES_EC"),n.requiresWC&&i.push("REQUIRES_WC"),n.requiresTextureCoordinates&&i.push("TEXTURE_COORDINATES"),this._extentsCulling&&i.push("CULL_FRAGMENTS"),n.requiresNormalEC&&i.push("NORMAL_EC"),t instanceof yn&&i.push("PER_INSTANCE_COLOR"),n.normalEC&&i.push("USES_NORMAL_EC"),n.positionToEyeEC&&i.push("USES_POSITION_TO_EYE_EC"),n.tangentToEyeMatrix&&i.push("USES_TANGENT_TO_EYE"),n.st&&i.push("USES_ST"),t.flat&&i.push("FLAT");let r="";return t instanceof yn||(r=t.material.shaderSource),new Ye({defines:i,sources:[r,Dv]})};Nd.prototype.createPickFragmentShader=function(e){let t=this._pickShaderDependencies,n=["PICK"];return!e&&!this._planarExtents&&n.push("SPHERICAL"),t.requiresEC&&n.push("REQUIRES_EC"),t.requiresWC&&n.push("REQUIRES_WC"),t.requiresTextureCoordinates&&n.push("TEXTURE_COORDINATES"),this._extentsCulling&&n.push("CULL_FRAGMENTS"),new Ye({defines:n,sources:[Dv],pickColorQualifier:"in"})};Nd.prototype.createVertexShader=function(e,t,n,i){return Bme(this._colorShaderDependencies,this._planarExtents,n,e,t,this._appearance,i,this._projectionExtentDefines)};Nd.prototype.createPickVertexShader=function(e,t,n,i){return Bme(this._pickShaderDependencies,this._planarExtents,n,e,t,void 0,i,this._projectionExtentDefines)};var Dme=new h,Rme=new he,Ome={high:0,low:0};function Bme(e,t,n,i,r,o,s,a){let c=i.slice();if(a.eastMostYhighDefine===""){let u=Rme;u.longitude=D.PI,u.latitude=0,u.height=0;let f=s.project(u,Dme),d=Sn.encode(f.x,Ome);a.eastMostYhighDefine=`EAST_MOST_X_HIGH ${d.high.toFixed(`${d.high}`.length+1)}`,a.eastMostYlowDefine=`EAST_MOST_X_LOW ${d.low.toFixed(`${d.low}`.length+1)}`;let p=Rme;p.longitude=-D.PI,p.latitude=0,p.height=0;let g=s.project(p,Dme);d=Sn.encode(g.x,Ome),a.westMostYhighDefine=`WEST_MOST_X_HIGH ${d.high.toFixed(`${d.high}`.length+1)}`,a.westMostYlowDefine=`WEST_MOST_X_LOW ${d.low.toFixed(`${d.low}`.length+1)}`}return n&&(c.push(a.eastMostYhighDefine),c.push(a.eastMostYlowDefine),c.push(a.westMostYhighDefine),c.push(a.westMostYlowDefine)),l(o)&&o instanceof yn&&c.push("PER_INSTANCE_COLOR"),e.requiresTextureCoordinates&&(c.push("TEXTURE_COORDINATES"),t||n||c.push("SPHERICAL"),n&&c.push("COLUMBUS_VIEW_2D")),new Ye({defines:c,sources:[r]})}function iK(){this._requiresEC=!1,this._requiresWC=!1,this._requiresNormalEC=!1,this._requiresTextureCoordinates=!1,this._usesNormalEC=!1,this._usesPositionToEyeEC=!1,this._usesTangentToEyeMat=!1,this._usesSt=!1}Object.defineProperties(iK.prototype,{requiresEC:{get:function(){return this._requiresEC},set:function(e){this._requiresEC=e||this._requiresEC}},requiresWC:{get:function(){return this._requiresWC},set:function(e){this._requiresWC=e||this._requiresWC,this.requiresEC=this._requiresWC}},requiresNormalEC:{get:function(){return this._requiresNormalEC},set:function(e){this._requiresNormalEC=e||this._requiresNormalEC,this.requiresEC=this._requiresNormalEC}},requiresTextureCoordinates:{get:function(){return this._requiresTextureCoordinates},set:function(e){this._requiresTextureCoordinates=e||this._requiresTextureCoordinates,this.requiresWC=this._requiresTextureCoordinates}},normalEC:{set:function(e){this.requiresNormalEC=e,this._usesNormalEC=e},get:function(){return this._usesNormalEC}},tangentToEyeMatrix:{set:function(e){this.requiresWC=e,this.requiresNormalEC=e,this._usesTangentToEyeMat=e},get:function(){return this._usesTangentToEyeMat}},positionToEyeEC:{set:function(e){this.requiresEC=e,this._usesPositionToEyeEC=e},get:function(){return this._usesPositionToEyeEC}},st:{set:function(e){this.requiresTextureCoordinates=e,this._usesSt=e},get:function(){return this._usesSt}}});function Mme(e,t,n){return Math.abs((t.y-e.y)*n.x-(t.x-e.x)*n.y+t.x*e.y-t.y*e.x)/U.distance(t,e)}var F5e=[new U,new U,new U,new U];function kme(e,t){let n=F5e,i=U.unpack(t,0,n[0]),r=U.unpack(t,2,n[1]),o=U.unpack(t,4,n[2]);e.uMaxVmax=new Qc({componentDatatype:Y.FLOAT,componentsPerAttribute:4,normalize:!1,value:[r.x,r.y,o.x,o.y]});let s=1/Mme(i,r,o),a=1/Mme(i,o,r);e.uvMinAndExtents=new Qc({componentDatatype:Y.FLOAT,componentsPerAttribute:4,normalize:!1,value:[i.x,i.y,s,a]})}var Ume=new he,zme=new h,B5e=new h,k5e=new h,T6={high:0,low:0};function Vme(e,t,n){let i=Ume;i.height=0,i.longitude=e.west,i.latitude=e.south;let r=t.project(i,zme);i.latitude=e.north;let o=t.project(i,B5e);i.longitude=e.east,i.latitude=e.south;let s=t.project(i,k5e),a=[0,0,0,0],c=[0,0,0,0],u=Sn.encode(r.x,T6);a[0]=u.high,c[0]=u.low,u=Sn.encode(r.y,T6),a[1]=u.high,c[1]=u.low,u=Sn.encode(o.y,T6),a[2]=u.high,c[2]=u.low,u=Sn.encode(s.x,T6),a[3]=u.high,c[3]=u.low,n.planes2D_HIGH=new Qc({componentDatatype:Y.FLOAT,componentsPerAttribute:4,normalize:!1,value:a}),n.planes2D_LOW=new Qc({componentDatatype:Y.FLOAT,componentsPerAttribute:4,normalize:!1,value:c})}var U5e=new N,z5e=new N,Nme=new h,V5e=new he,j5e=[new he,new he,new he,new he,new he,new he,new he,new he];function H5e(e,t,n,i,r,o){let s=ie.center(e,V5e);s.height=n;let a=he.toCartesian(s,t,Nme),c=At.eastNorthUpToFixedFrame(a,t,U5e),u=N.inverse(c,z5e),f=e.west,d=e.east,p=e.north,g=e.south,m=j5e;m[0].latitude=g,m[0].longitude=f,m[1].latitude=p,m[1].longitude=f,m[2].latitude=p,m[2].longitude=d,m[3].latitude=g,m[3].longitude=d;let y=(f+d)*.5,A=(p+g)*.5;m[4].latitude=g,m[4].longitude=y,m[5].latitude=p,m[5].longitude=y,m[6].latitude=A,m[6].longitude=f,m[7].latitude=A,m[7].longitude=d;let b=Number.POSITIVE_INFINITY,x=Number.NEGATIVE_INFINITY,T=Number.POSITIVE_INFINITY,E=Number.NEGATIVE_INFINITY;for(let R=0;R<8;R++){m[R].height=n;let O=he.toCartesian(m[R],t,Nme);N.multiplyByPoint(u,O,O),O.z=0,b=Math.min(b,O.x),x=Math.max(x,O.x),T=Math.min(T,O.y),E=Math.max(E,O.y)}let v=i;v.x=b,v.y=T,v.z=0,N.multiplyByPoint(c,v,v);let S=r;S.x=x,S.y=T,S.z=0,N.multiplyByPoint(c,S,S),h.subtract(S,v,r);let I=o;I.x=b,I.y=E,I.z=0,N.multiplyByPoint(c,I,I),h.subtract(I,v,o)}var G5e=new h,W5e=new h,q5e=new Sn;Nd.getPlanarTextureCoordinateAttributes=function(e,t,n,i,r){let o=zme,s=G5e,a=W5e;H5e(e,n,r??0,o,s,a);let c={};kme(c,t);let u=Sn.fromCartesian(o,q5e);return c.southWest_HIGH=new Qc({componentDatatype:Y.FLOAT,componentsPerAttribute:3,normalize:!1,value:h.pack(u.high,[0,0,0])}),c.southWest_LOW=new Qc({componentDatatype:Y.FLOAT,componentsPerAttribute:3,normalize:!1,value:h.pack(u.low,[0,0,0])}),c.eastward=new Qc({componentDatatype:Y.FLOAT,componentsPerAttribute:3,normalize:!1,value:h.pack(s,[0,0,0])}),c.northward=new Qc({componentDatatype:Y.FLOAT,componentsPerAttribute:3,normalize:!1,value:h.pack(a,[0,0,0])}),Vme(e,i,c),c};var Y5e=new h;function Lme(e,t,n,i){let r=Ume;r.latitude=e,r.longitude=t,r.height=0;let o=he.toCartesian(r,n,Y5e),s=Math.sqrt(o.x*o.x+o.y*o.y),a=D.fastApproximateAtan2(s,o.z),c=D.fastApproximateAtan2(o.x,o.y);return i.x=a,i.y=c,i}var Fme=new U;Nd.getSphericalExtentGeometryInstanceAttributes=function(e,t,n,i){let r=Lme(e.south,e.west,n,Fme),o=r.x,s=r.y,a=Lme(e.north,e.east,n,Fme),c=a.x,u=a.y,f=0;s>u&&(f=D.PI-s,s=-D.PI,u+=f),o-=D.EPSILON5,s-=D.EPSILON5,c+=D.EPSILON5,u+=D.EPSILON5;let d=1/(u-s),p=1/(c-o),g={sphericalExtents:new Qc({componentDatatype:Y.FLOAT,componentsPerAttribute:4,normalize:!1,value:[o,s,p,d]}),longitudeRotation:new Qc({componentDatatype:Y.FLOAT,componentsPerAttribute:1,normalize:!1,value:[f]})};return kme(g,t),Vme(e,i,g),g};Nd.hasAttributesForTextureCoordinatePlanes=function(e){return l(e.southWest_HIGH)&&l(e.southWest_LOW)&&l(e.northward)&&l(e.eastward)&&l(e.planes2D_HIGH)&&l(e.planes2D_LOW)&&l(e.uMaxVmax)&&l(e.uvMinAndExtents)};Nd.hasAttributesForSphericalExtents=function(e){return l(e.sphericalExtents)&&l(e.longitudeRotation)&&l(e.planes2D_HIGH)&&l(e.planes2D_LOW)&&l(e.uMaxVmax)&&l(e.uvMinAndExtents)};function X5e(e){return Math.max(e.width,e.height)>Nd.MAX_WIDTH_FOR_PLANAR_EXTENTS}Nd.shouldUseSphericalCoordinates=function(e){return X5e(e)};Nd.MAX_WIDTH_FOR_PLANAR_EXTENTS=D.toRadians(1);var Pf=Nd;var jme={NEVER:te.NEVER,LESS:te.LESS,EQUAL:te.EQUAL,LESS_OR_EQUAL:te.LEQUAL,GREATER:te.GREATER,NOT_EQUAL:te.NOTEQUAL,GREATER_OR_EQUAL:te.GEQUAL,ALWAYS:te.ALWAYS};Object.freeze(jme);var ti=jme;var Hme={ZERO:te.ZERO,KEEP:te.KEEP,REPLACE:te.REPLACE,INCREMENT:te.INCR,DECREMENT:te.DECR,INVERT:te.INVERT,INCREMENT_WRAP:te.INCR_WRAP,DECREMENT_WRAP:te.DECR_WRAP};Object.freeze(Hme);var Rt=Hme;var E6={CESIUM_3D_TILE_MASK:128,SKIP_LOD_MASK:112,SKIP_LOD_BIT_SHIFT:4,CLASSIFICATION_MASK:15};E6.setCesium3DTileBit=function(){return{enabled:!0,frontFunction:ti.ALWAYS,frontOperation:{fail:Rt.KEEP,zFail:Rt.KEEP,zPass:Rt.REPLACE},backFunction:ti.ALWAYS,backOperation:{fail:Rt.KEEP,zFail:Rt.KEEP,zPass:Rt.REPLACE},reference:E6.CESIUM_3D_TILE_MASK,mask:E6.CESIUM_3D_TILE_MASK}};var Yt=Object.freeze(E6);function Px(e){e=e??H.EMPTY_OBJECT;let t=e.geometryInstances;this.geometryInstances=t,this.show=e.show??!0,this.classificationType=e.classificationType??ei.BOTH,this.debugShowBoundingVolume=e.debugShowBoundingVolume??!1,this.debugShowShadowVolume=e.debugShowShadowVolume??!1,this._debugShowShadowVolume=!1,this._extruded=e._extruded??!1,this._uniformMap=e._uniformMap,this._sp=void 0,this._spStencil=void 0,this._spPick=void 0,this._spColor=void 0,this._spPick2D=void 0,this._spColor2D=void 0,this._rsStencilDepthPass=void 0,this._rsStencilDepthPass3DTiles=void 0,this._rsColorPass=void 0,this._rsPickPass=void 0,this._commandsIgnoreShow=[],this._ready=!1,this._primitive=void 0,this._pickPrimitive=e._pickPrimitive,this._hasSphericalExtentsAttribute=!1,this._hasPlanarExtentsAttributes=!1,this._hasPerColorAttribute=!1,this.appearance=e.appearance,this._createBoundingVolumeFunction=e._createBoundingVolumeFunction,this._updateAndQueueCommandsFunction=e._updateAndQueueCommandsFunction,this._usePickOffsets=!1,this._primitiveOptions={geometryInstances:void 0,appearance:void 0,vertexCacheOptimize:e.vertexCacheOptimize??!1,interleave:e.interleave??!1,releaseGeometryInstances:e.releaseGeometryInstances??!0,allowPicking:e.allowPicking??!0,asynchronous:e.asynchronous??!0,compressVertices:e.compressVertices??!0,_createBoundingVolumeFunction:void 0,_createRenderStatesFunction:void 0,_createShaderProgramFunction:void 0,_createCommandsFunction:void 0,_updateAndQueueCommandsFunction:void 0,_createPickOffsets:!0}}Object.defineProperties(Px.prototype,{vertexCacheOptimize:{get:function(){return this._primitiveOptions.vertexCacheOptimize}},interleave:{get:function(){return this._primitiveOptions.interleave}},releaseGeometryInstances:{get:function(){return this._primitiveOptions.releaseGeometryInstances}},allowPicking:{get:function(){return this._primitiveOptions.allowPicking}},asynchronous:{get:function(){return this._primitiveOptions.asynchronous}},compressVertices:{get:function(){return this._primitiveOptions.compressVertices}},ready:{get:function(){return this._ready}},_needs2DShader:{get:function(){return this._hasPlanarExtentsAttributes||this._hasSphericalExtentsAttribute}}});Px.isSupported=function(e){return e.context.stencilBuffer};function Bv(e,t){let n=t?ti.EQUAL:ti.ALWAYS;return{colorMask:{red:!1,green:!1,blue:!1,alpha:!1},stencilTest:{enabled:e,frontFunction:n,frontOperation:{fail:Rt.KEEP,zFail:Rt.DECREMENT_WRAP,zPass:Rt.KEEP},backFunction:n,backOperation:{fail:Rt.KEEP,zFail:Rt.INCREMENT_WRAP,zPass:Rt.KEEP},reference:Yt.CESIUM_3D_TILE_MASK,mask:Yt.CESIUM_3D_TILE_MASK},stencilMask:Yt.CLASSIFICATION_MASK,depthTest:{enabled:!0,func:cc.LESS_OR_EQUAL},depthMask:!1}}function oK(e){return{stencilTest:{enabled:e,frontFunction:ti.NOT_EQUAL,frontOperation:{fail:Rt.ZERO,zFail:Rt.ZERO,zPass:Rt.ZERO},backFunction:ti.NOT_EQUAL,backOperation:{fail:Rt.ZERO,zFail:Rt.ZERO,zPass:Rt.ZERO},reference:0,mask:Yt.CLASSIFICATION_MASK},stencilMask:Yt.CLASSIFICATION_MASK,depthTest:{enabled:!1},depthMask:!1,blending:tn.PRE_MULTIPLIED_ALPHA_BLEND}}var K5e={stencilTest:{enabled:!0,frontFunction:ti.NOT_EQUAL,frontOperation:{fail:Rt.ZERO,zFail:Rt.ZERO,zPass:Rt.ZERO},backFunction:ti.NOT_EQUAL,backOperation:{fail:Rt.ZERO,zFail:Rt.ZERO,zPass:Rt.ZERO},reference:0,mask:Yt.CLASSIFICATION_MASK},stencilMask:Yt.CLASSIFICATION_MASK,depthTest:{enabled:!1},depthMask:!1};function $5e(e,t,n,i){if(l(e._rsStencilDepthPass))return;let r=!e.debugShowShadowVolume;e._rsStencilDepthPass=Ge.fromCache(Bv(r,!1)),e._rsStencilDepthPass3DTiles=Ge.fromCache(Bv(r,!0)),e._rsColorPass=Ge.fromCache(oK(r,!1)),e._rsPickPass=Ge.fromCache(K5e)}function J5e(e,t){if(!e.compressVertices)return t;if(t.search(/in\s+vec3\s+extrudeDirection;/g)!==-1){let n="compressedAttributes",i=`in vec2 ${n};`,r=`vec3 extrudeDirection; -`,o=` extrudeDirection = czm_octDecode(${n}, 65535.0); -`,s=t;s=s.replace(/in\s+vec3\s+extrudeDirection;/g,""),s=Ye.replaceMain(s,"czm_non_compressed_main");let a=`void main() -{ -${o} czm_non_compressed_main(); -}`;return[i,r,s,a].join(` -`)}}function Z5e(e,t){let n=t.context,i=e._primitive,r=yM;r=e._primitive._batchTable.getVertexShaderCallback()(r),r=On._appendDistanceDisplayConditionToShader(i,r),r=On._modifyShaderPosition(e,r,t.scene3DOnly),r=On._updateColorAttribute(i,r);let o=e._hasPlanarExtentsAttributes,s=o||e._hasSphericalExtentsAttribute;e._extruded&&(r=J5e(i,r));let a=e._extruded?"EXTRUDED_GEOMETRY":"",c=new Ye({defines:[a],sources:[r]}),u=new Ye({sources:[jy]}),f=e._primitive._attributeLocations,d=new Pf(s,o,e.appearance);if(e._spStencil=Qt.replaceCache({context:n,shaderProgram:e._spStencil,vertexShaderSource:c,fragmentShaderSource:u,attributeLocations:f}),e._primitive.allowPicking){let m=Ye.createPickVertexShaderSource(r);m=On._appendShowToShader(i,m),m=On._updatePickColorAttribute(m);let y=d.createPickFragmentShader(!1),A=d.createPickVertexShader([a],m,!1,t.mapProjection);if(e._spPick=Qt.replaceCache({context:n,shaderProgram:e._spPick,vertexShaderSource:A,fragmentShaderSource:y,attributeLocations:f}),s){let b=n.shaderCache.getDerivedShaderProgram(e._spPick,"2dPick");if(!l(b)){let x=d.createPickFragmentShader(!0),T=d.createPickVertexShader([a],m,!0,t.mapProjection);b=n.shaderCache.createDerivedShaderProgram(e._spPick,"2dPick",{vertexShaderSource:T,fragmentShaderSource:x,attributeLocations:f})}e._spPick2D=b}}else e._spPick=Qt.fromCache({context:n,vertexShaderSource:c,fragmentShaderSource:u,attributeLocations:f});r=On._appendShowToShader(i,r),c=new Ye({defines:[a],sources:[r]}),e._sp=Qt.replaceCache({context:n,shaderProgram:e._sp,vertexShaderSource:c,fragmentShaderSource:u,attributeLocations:f});let p=d.createFragmentShader(!1),g=d.createVertexShader([a],r,!1,t.mapProjection);if(e._spColor=Qt.replaceCache({context:n,shaderProgram:e._spColor,vertexShaderSource:g,fragmentShaderSource:p,attributeLocations:f}),s){let m=n.shaderCache.getDerivedShaderProgram(e._spColor,"2dColor");if(!l(m)){let y=d.createFragmentShader(!0),A=d.createVertexShader([a],r,!0,t.mapProjection);m=n.shaderCache.createDerivedShaderProgram(e._spColor,"2dColor",{vertexShaderSource:A,fragmentShaderSource:y,attributeLocations:f})}e._spColor2D=m}}function Q5e(e,t){let n=e._primitive,i=n._va.length*2;t.length=i;let r,o,s,a=0,c=n._batchTable.getUniformMapCallback()(e._uniformMap),u=e._needs2DShader;for(r=0;r<i;r+=2){let g=n._va[a++];o=t[r],l(o)||(o=t[r]=new at({owner:e,primitiveType:n._primitiveType})),o.vertexArray=g,o.renderState=e._rsStencilDepthPass,o.shaderProgram=e._sp,o.uniformMap=c,o.pass=Ie.TERRAIN_CLASSIFICATION,s=at.shallowClone(o,o.derivedCommands.tileset),s.renderState=e._rsStencilDepthPass3DTiles,s.pass=Ie.CESIUM_3D_TILE_CLASSIFICATION,o.derivedCommands.tileset=s,o=t[r+1],l(o)||(o=t[r+1]=new at({owner:e,primitiveType:n._primitiveType})),o.vertexArray=g,o.renderState=e._rsColorPass,o.shaderProgram=e._spColor,o.pass=Ie.TERRAIN_CLASSIFICATION;let y=e.appearance.material;if(l(y)&&(c=Ot(c,y._uniforms)),o.uniformMap=c,s=at.shallowClone(o,o.derivedCommands.tileset),s.pass=Ie.CESIUM_3D_TILE_CLASSIFICATION,o.derivedCommands.tileset=s,u){let A=at.shallowClone(o,o.derivedCommands.appearance2D);A.shaderProgram=e._spColor2D,o.derivedCommands.appearance2D=A,A=at.shallowClone(s,s.derivedCommands.appearance2D),A.shaderProgram=e._spColor2D,s.derivedCommands.appearance2D=A}}let f=e._commandsIgnoreShow,d=e._spStencil,p=0;i=f.length=i/2;for(let g=0;g<i;++g){let m=f[g]=at.shallowClone(t[p],f[g]);m.shaderProgram=d,m.pass=Ie.CESIUM_3D_TILE_CLASSIFICATION_IGNORE_SHOW,p+=2}}function e9e(e,t){let n=e._usePickOffsets,i=e._primitive,r=i._va.length*2,o,s=0,a;n&&(o=i._pickOffsets,r=o.length*2),t.length=r;let c,u,f,d=0,p=i._batchTable.getUniformMapCallback()(e._uniformMap),g=e._needs2DShader;for(c=0;c<r;c+=2){let m=i._va[d++];if(n&&(a=o[s++],m=i._va[a.index]),u=t[c],l(u)||(u=t[c]=new at({owner:e,primitiveType:i._primitiveType,pickOnly:!0})),u.vertexArray=m,u.renderState=e._rsStencilDepthPass,u.shaderProgram=e._sp,u.uniformMap=p,u.pass=Ie.TERRAIN_CLASSIFICATION,n&&(u.offset=a.offset,u.count=a.count),f=at.shallowClone(u,u.derivedCommands.tileset),f.renderState=e._rsStencilDepthPass3DTiles,f.pass=Ie.CESIUM_3D_TILE_CLASSIFICATION,u.derivedCommands.tileset=f,u=t[c+1],l(u)||(u=t[c+1]=new at({owner:e,primitiveType:i._primitiveType,pickOnly:!0})),u.vertexArray=m,u.renderState=e._rsPickPass,u.shaderProgram=e._spPick,u.uniformMap=p,u.pass=Ie.TERRAIN_CLASSIFICATION,n&&(u.offset=a.offset,u.count=a.count),f=at.shallowClone(u,u.derivedCommands.tileset),f.pass=Ie.CESIUM_3D_TILE_CLASSIFICATION,u.derivedCommands.tileset=f,g){let y=at.shallowClone(u,u.derivedCommands.pick2D);y.shaderProgram=e._spPick2D,u.derivedCommands.pick2D=y,y=at.shallowClone(f,f.derivedCommands.pick2D),y.shaderProgram=e._spPick2D,f.derivedCommands.pick2D=y}}}function t9e(e,t,n,i,r,o,s){Q5e(e,o),e9e(e,s)}function Gme(e,t){return Math.floor(e%t/2)}function rK(e,t,n,i,r,o){e.modelMatrix=n,e.boundingVolume=r,e.cull=i,e.debugShowBoundingVolume=o,t.commandList.push(e)}function Wme(e,t,n,i,r){e.modelMatrix=n,e.boundingVolume=r,e.cull=i,t.commandList.push(e)}function n9e(e,t,n,i,r,o,s,a){let c=e._primitive;On._updateBoundingVolumes(c,t,r);let u;t.mode===re.SCENE3D?u=c._boundingSphereWC:t.mode===re.COLUMBUS_VIEW?u=c._boundingSphereCV:t.mode===re.SCENE2D&&l(c._boundingSphere2D)?u=c._boundingSphere2D:l(c._boundingSphereMorph)&&(u=c._boundingSphereMorph);let f=e.classificationType,d=f!==ei.CESIUM_3D_TILE,p=f!==ei.TERRAIN,g=t.passes,m,y,A;if(g.render){let b=n.length;for(m=0;m<b;++m)y=u[Gme(m,b)],d&&(A=n[m],rK(A,t,r,o,y,s)),p&&(A=n[m].derivedCommands.tileset,rK(A,t,r,o,y,s));if(t.invertClassification){let x=e._commandsIgnoreShow,T=x.length;for(m=0;m<T;++m)y=u[m],A=x[m],rK(A,t,r,o,y,s)}}if(g.pick){let b=i.length,x=c._pickOffsets;for(m=0;m<b;++m){let T=x[Gme(m,b)];y=u[T.index],d&&(A=i[m],Wme(A,t,r,o,y)),p&&(A=i[m].derivedCommands.tileset,Wme(A,t,r,o,y))}}}Px.prototype.update=function(e){if(!l(this._primitive)&&!l(this.geometryInstances))return;let t=this.appearance;l(t)&&l(t.material)&&t.material.update(e.context);let n=this,i=this._primitiveOptions;if(!l(this._primitive)){let r=Array.isArray(this.geometryInstances)?this.geometryInstances:[this.geometryInstances],o=r.length,s,a,c,u=!1,f=!0,d,p=!1,g=!1;for(o>0&&(c=r[0].attributes,p=Pf.hasAttributesForSphericalExtents(c),g=Pf.hasAttributesForTextureCoordinatePlanes(c),d=c.color),s=0;s<o;s++){a=r[s];let y=a.attributes.color;l(y)&&(u=!0),f=f&&l(y)&&Jt.equals(d,y)}if(!f&&!p&&!g)throw new pe("All GeometryInstances must have the same color attribute except via GroundPrimitives");u&&!l(t)&&(t=new yn({flat:!0}),this.appearance=t),this._usePickOffsets=!p&&!g,this._hasSphericalExtentsAttribute=p,this._hasPlanarExtentsAttributes=g,this._hasPerColorAttribute=u;let m=new Array(o);for(s=0;s<o;++s)a=r[s],m[s]=new Ft({geometry:a.geometry,attributes:a.attributes,modelMatrix:a.modelMatrix,id:a.id,pickPrimitive:this._pickPrimitive??n});i.appearance=t,i.geometryInstances=m,l(this._createBoundingVolumeFunction)&&(i._createBoundingVolumeFunction=function(y,A){n._createBoundingVolumeFunction(y,A)}),i._createRenderStatesFunction=function(y,A,b,x){$5e(n,A)},i._createShaderProgramFunction=function(y,A,b){Z5e(n,A)},i._createCommandsFunction=function(y,A,b,x,T,E,v){t9e(n,void 0,void 0,!0,!1,E,v)},l(this._updateAndQueueCommandsFunction)?i._updateAndQueueCommandsFunction=function(y,A,b,x,T,E,v,S){n._updateAndQueueCommandsFunction(y,A,b,x,T,E,v,S)}:i._updateAndQueueCommandsFunction=function(y,A,b,x,T,E,v,S){n9e(n,A,b,x,T,E,v,S)},this._primitive=new On(i)}this.debugShowShadowVolume&&!this._debugShowShadowVolume&&this._ready?(this._debugShowShadowVolume=!0,this._rsStencilDepthPass=Ge.fromCache(Bv(!1,!1)),this._rsStencilDepthPass3DTiles=Ge.fromCache(Bv(!1,!0)),this._rsColorPass=Ge.fromCache(oK(!1))):!this.debugShowShadowVolume&&this._debugShowShadowVolume&&(this._debugShowShadowVolume=!1,this._rsStencilDepthPass=Ge.fromCache(Bv(!0,!1)),this._rsStencilDepthPass3DTiles=Ge.fromCache(Bv(!0,!0)),this._rsColorPass=Ge.fromCache(oK(!0))),this._primitive.appearance!==t&&(this._primitive.appearance=t),this._primitive.show=this.show,this._primitive.debugShowBoundingVolume=this.debugShowBoundingVolume,this._primitive.update(e),e.afterRender.push(()=>{l(this._primitive)&&this._primitive.ready&&(this._ready=!0,this.releaseGeometryInstances&&(this.geometryInstances=void 0))})};Px.prototype.getGeometryInstanceAttributes=function(e){return this._primitive.getGeometryInstanceAttributes(e)};Px.prototype.isDestroyed=function(){return!1};Px.prototype.destroy=function(){return this._primitive=this._primitive&&this._primitive.destroy(),this._sp=this._sp&&this._sp.destroy(),this._spPick=this._spPick&&this._spPick.destroy(),this._spColor=this._spColor&&this._spColor.destroy(),this._spPick2D=void 0,this._spColor2D=void 0,le(this)};var kv=Px;var i9e={u_globeMinimumAltitude:function(){return 55e3}};function Fu(e){e=e??H.EMPTY_OBJECT;let t=e.appearance,n=e.geometryInstances;if(!l(t)&&l(n)){let r=Array.isArray(n)?n:[n],o=r.length;for(let s=0;s<o;s++){let a=r[s].attributes;if(l(a)&&l(a.color)){t=new yn({flat:!0});break}}}this.appearance=t,this.geometryInstances=e.geometryInstances,this.show=e.show??!0,this.classificationType=e.classificationType??ei.BOTH,this.debugShowBoundingVolume=e.debugShowBoundingVolume??!1,this.debugShowShadowVolume=e.debugShowShadowVolume??!1,this._boundingVolumes=[],this._boundingVolumes2D=[],this._ready=!1,this._primitive=void 0,this._maxHeight=void 0,this._minHeight=void 0,this._maxTerrainHeight=Mi._defaultMaxTerrainHeight,this._minTerrainHeight=Mi._defaultMinTerrainHeight,this._boundingSpheresKeys=[],this._boundingSpheres=[],this._useFragmentCulling=!1,this._zIndex=void 0;let i=this;this._classificationPrimitiveOptions={geometryInstances:void 0,appearance:void 0,vertexCacheOptimize:e.vertexCacheOptimize??!1,interleave:e.interleave??!1,releaseGeometryInstances:e.releaseGeometryInstances??!0,allowPicking:e.allowPicking??!0,asynchronous:e.asynchronous??!0,compressVertices:e.compressVertices??!0,_createBoundingVolumeFunction:void 0,_updateAndQueueCommandsFunction:void 0,_pickPrimitive:i,_extruded:!0,_uniformMap:i9e}}Object.defineProperties(Fu.prototype,{vertexCacheOptimize:{get:function(){return this._classificationPrimitiveOptions.vertexCacheOptimize}},interleave:{get:function(){return this._classificationPrimitiveOptions.interleave}},releaseGeometryInstances:{get:function(){return this._classificationPrimitiveOptions.releaseGeometryInstances}},allowPicking:{get:function(){return this._classificationPrimitiveOptions.allowPicking}},asynchronous:{get:function(){return this._classificationPrimitiveOptions.asynchronous}},compressVertices:{get:function(){return this._classificationPrimitiveOptions.compressVertices}},ready:{get:function(){return this._ready}}});Fu.isSupported=kv.isSupported;function qme(e){return function(t,n){let i=n.maximumRadius,r=i/Math.cos(t*.5)-i;return e._maxHeight+r}}function Yme(e){return function(t,n){return e._minHeight}}var r9e=new h,o9e=new h,s9e=new h,a9e=new he,c9e=new ie;function C6(e,t){let n=e.mapProjection.ellipsoid;if(!l(t.attributes)||!l(t.attributes.position3DHigh))return l(t.rectangle)?t.rectangle:void 0;let i=t.attributes.position3DHigh.values,r=t.attributes.position3DLow.values,o=i.length,s=Number.POSITIVE_INFINITY,a=Number.POSITIVE_INFINITY,c=Number.NEGATIVE_INFINITY,u=Number.NEGATIVE_INFINITY;for(let d=0;d<o;d+=3){let p=h.unpack(i,d,r9e),g=h.unpack(r,d,o9e),m=h.add(p,g,s9e),y=n.cartesianToCartographic(m,a9e),A=y.latitude,b=y.longitude;s=Math.min(s,A),a=Math.min(a,b),c=Math.max(c,A),u=Math.max(u,b)}let f=c9e;return f.north=c,f.south=s,f.east=u,f.west=a,f}function l9e(e,t,n){let i=Mi.getMinimumMaximumHeights(t,n);e._minTerrainHeight=i.minimumTerrainHeight,e._maxTerrainHeight=i.maximumTerrainHeight}function u9e(e,t,n){let i=t.mapProjection.ellipsoid,r=C6(t,n),o=en.fromRectangle(r,e._minHeight,e._maxHeight,i);if(e._boundingVolumes.push(o),!t.scene3DOnly){let s=t.mapProjection,a=ue.fromRectangleWithHeights2D(r,s,e._maxHeight,e._minHeight);h.fromElements(a.center.z,a.center.x,a.center.y,a.center),e._boundingVolumes2D.push(a)}}function sK(e,t){return Math.floor(e%t/2)}function aK(e,t,n,i,r,o,s){let a=e._primitive;n.mode!==re.SCENE3D&&t.shaderProgram===a._spColor&&a._needs2DShader&&(t=t.derivedCommands.appearance2D),t.owner=e,t.modelMatrix=i,t.boundingVolume=o,t.cull=r,t.debugShowBoundingVolume=s,n.commandList.push(t)}function Xme(e,t,n,i,r,o){let s=e._primitive;n.mode!==re.SCENE3D&&t.shaderProgram===s._spPick&&s._needs2DShader&&(t=t.derivedCommands.pick2D),t.owner=e,t.modelMatrix=i,t.boundingVolume=o,t.cull=r,n.commandList.push(t)}function f9e(e,t,n,i,r,o,s,a){let c;t.mode===re.SCENE3D?c=e._boundingVolumes:c=e._boundingVolumes2D;let u=e.classificationType,f=u!==ei.CESIUM_3D_TILE,d=u!==ei.TERRAIN,p=t.passes,g=e._primitive,m,y,A;if(p.render){let b=n.length;for(m=0;m<b;++m)y=c[sK(m,b)],f&&(A=n[m],aK(e,A,t,r,o,y,s)),d&&(A=n[m].derivedCommands.tileset,aK(e,A,t,r,o,y,s));if(t.invertClassification){let x=g._commandsIgnoreShow,T=x.length;for(m=0;m<T;++m)y=c[m],A=x[m],aK(e,A,t,r,o,y,s)}}if(p.pick){let b=i.length,x;for(e._useFragmentCulling||(x=g._primitive._pickOffsets),m=0;m<b;++m){if(y=c[sK(m,b)],!e._useFragmentCulling){let T=x[sK(m,b)];y=c[T.index]}f&&(A=i[m],Xme(e,A,t,r,o,y)),d&&(A=i[m].derivedCommands.tileset,Xme(e,A,t,r,o,y))}}}Fu.initializeTerrainHeights=function(){return Mi.initialize()};Fu.prototype.update=function(e){if(!l(this._primitive)&&!l(this.geometryInstances))return;if(!Mi.initialized){Fu.initializeTerrainHeights();return}let t=this,n=this._classificationPrimitiveOptions;if(!l(this._primitive)){let i=e.mapProjection.ellipsoid,r,o,s,a=Array.isArray(this.geometryInstances)?this.geometryInstances:[this.geometryInstances],c=a.length,u=new Array(c),f,d;for(f=0;f<c;++f){r=a[f],o=r.geometry;let y=C6(e,o);l(d)?l(y)&&ie.union(d,y,d):d=ie.clone(y);let A=r.id;if(l(A)&&l(y)){let b=Mi.getBoundingSphere(y,i);this._boundingSpheresKeys.push(A),this._boundingSpheres.push(b)}s=o.constructor,!l(s)||l(s.createShadowVolume)}l9e(this,d,i);let p=e.verticalExaggeration,g=e.verticalExaggerationRelativeHeight;this._minHeight=Ar.getHeight(this._minTerrainHeight,p,g),this._maxHeight=Ar.getHeight(this._maxTerrainHeight,p,g);let m=Fu._supportsMaterials(e.context);if(this._useFragmentCulling=m,m){let y,A=!0;for(f=0;f<c;++f)if(r=a[f],o=r.geometry,d=C6(e,o),Pf.shouldUseSphericalCoordinates(d)){A=!1;break}for(f=0;f<c;++f){r=a[f],o=r.geometry,s=o.constructor;let b=C6(e,o),x=o.textureCoordinateRotationPoints;A?y=Pf.getPlanarTextureCoordinateAttributes(b,x,i,e.mapProjection,this._maxHeight):y=Pf.getSphericalExtentGeometryInstanceAttributes(b,x,i,e.mapProjection);let T=r.attributes;for(let E in T)T.hasOwnProperty(E)&&(y[E]=T[E]);u[f]=new Ft({geometry:s.createShadowVolume(o,Yme(this),qme(this)),attributes:y,id:r.id})}}else for(f=0;f<c;++f)r=a[f],o=r.geometry,s=o.constructor,u[f]=new Ft({geometry:s.createShadowVolume(o,Yme(this),qme(this)),attributes:r.attributes,id:r.id});n.geometryInstances=u,n.appearance=this.appearance,n._createBoundingVolumeFunction=function(y,A){u9e(t,y,A)},n._updateAndQueueCommandsFunction=function(y,A,b,x,T,E,v,S){f9e(t,A,b,x,T,E,v,S)},this._primitive=new kv(n)}this._primitive.appearance=this.appearance,this._primitive.show=this.show,this._primitive.debugShowShadowVolume=this.debugShowShadowVolume,this._primitive.debugShowBoundingVolume=this.debugShowBoundingVolume,this._primitive.update(e),e.afterRender.push(()=>{!this._ready&&l(this._primitive)&&this._primitive.ready&&(this._ready=!0,this.releaseGeometryInstances&&(this.geometryInstances=void 0))})};Fu.prototype.getBoundingSphere=function(e){let t=this._boundingSpheresKeys.indexOf(e);if(t!==-1)return this._boundingSpheres[t]};Fu.prototype.getGeometryInstanceAttributes=function(e){return this._primitive.getGeometryInstanceAttributes(e)};Fu.prototype.isDestroyed=function(){return!1};Fu.prototype.destroy=function(){return this._primitive=this._primitive&&this._primitive.destroy(),le(this)};Fu._supportsMaterials=function(e){return e.depthTexture};Fu.supportsMaterials=function(e){return Fu._supportsMaterials(e.frameState.context)};var ql=Fu;function Uv(){pe.throwInstantiationError()}Object.defineProperties(Uv.prototype,{isConstant:{get:pe.throwInstantiationError},definitionChanged:{get:pe.throwInstantiationError}});Uv.prototype.getType=pe.throwInstantiationError;Uv.prototype.getValue=pe.throwInstantiationError;Uv.prototype.equals=pe.throwInstantiationError;var d9e=new K;Uv.getValue=function(e,t,n){let i;return l(e)||(e=K.now(d9e)),l(t)&&(i=t.getType(e),l(i))?((!l(n)||n.type!==i)&&(n=Qi.fromType(i)),t.getValue(e,n.uniforms),n):((!l(n)||n.type!==Qi.ColorType)&&(n=Qi.fromType(Qi.ColorType)),z.clone(z.WHITE,n.uniforms.color),n)};var _o=Uv;function Dx(e,t,n){this._primitives=t,this._orderedGroundPrimitives=n,this._primitive=void 0,this._outlinePrimitive=void 0,this._geometryUpdater=e,this._options=e._options,this._entity=e._entity,this._material=void 0}Dx.prototype._isHidden=function(e,t,n){return!e.isShowing||!e.isAvailable(n)||!X.getValueOrDefault(t.show,n,!0)};Dx.prototype._setOptions=pe.throwInstantiationError;Dx.prototype.update=function(e){let t=this._geometryUpdater,n=t._onTerrain,i=this._primitives,r=this._orderedGroundPrimitives;n?r.remove(this._primitive):(i.removeAndDestroy(this._primitive),i.removeAndDestroy(this._outlinePrimitive),this._outlinePrimitive=void 0),this._primitive=void 0;let o=this._entity,s=o[this._geometryUpdater._geometryPropertyName];if(this._setOptions(o,s,e),this._isHidden(o,s,e))return;let a=this._geometryUpdater.shadowsProperty.getValue(e),c=this._options;if(!l(s.fill)||s.fill.getValue(e)){let u=t.fillMaterialProperty,f=u instanceof Kt,d,p=t._getIsClosed(c);if(f)d=new yn({closed:p,flat:n&&!t._supportsMaterialsforEntitiesOnTerrain});else{let g=_o.getValue(e,u,this._material);this._material=g,d=new Er({material:g,translucent:g.isTranslucent(),closed:p})}if(n)c.vertexFormat=yn.VERTEX_FORMAT,this._primitive=r.add(new ql({geometryInstances:this._geometryUpdater.createFillGeometryInstance(e),appearance:d,asynchronous:!1,shadows:a,classificationType:this._geometryUpdater.classificationTypeProperty.getValue(e)}),X.getValueOrUndefined(this._geometryUpdater.zIndex,e));else{c.vertexFormat=d.vertexFormat;let g=this._geometryUpdater.createFillGeometryInstance(e);f&&(d.translucent=g.attributes.color.value[3]!==255),this._primitive=i.add(new On({geometryInstances:g,appearance:d,asynchronous:!1,shadows:a}))}}if(!n&&l(s.outline)&&s.outline.getValue(e)){let u=this._geometryUpdater.createOutlineGeometryInstance(e),f=X.getValueOrDefault(s.outlineWidth,e,1);this._outlinePrimitive=i.add(new On({geometryInstances:u,appearance:new yn({flat:!0,translucent:u.attributes.color.value[3]!==255,renderState:{lineWidth:t._scene.clampLineWidth(f)}}),asynchronous:!1,shadows:a}))}};Dx.prototype.getBoundingSphere=function(e){let t=this._entity,n=this._primitive,i=this._outlinePrimitive,r;return l(n)&&n.show&&n.ready&&(r=n.getGeometryInstanceAttributes(t),l(r)&&l(r.boundingSphere))?(ue.clone(r.boundingSphere,e),Pt.DONE):l(i)&&i.show&&i.ready&&(r=i.getGeometryInstanceAttributes(t),l(r)&&l(r.boundingSphere))?(ue.clone(r.boundingSphere,e),Pt.DONE):l(n)&&!n.ready||l(i)&&!i.ready?Pt.PENDING:Pt.FAILED};Dx.prototype.isDestroyed=function(){return!1};Dx.prototype.destroy=function(){let e=this._primitives,t=this._orderedGroundPrimitives;this._geometryUpdater._onTerrain?t.remove(this._primitive):e.removeAndDestroy(this._primitive),e.removeAndDestroy(this._outlinePrimitive),le(this)};var Ii=Dx;var Kme={};function gN(e,t){l(Kme[e])||(Kme[e]=!0,console.warn(t??e))}gN.geometryOutlines="Entity geometry outlines are unsupported on terrain. Outlines will be disabled. To enable outlines, disable geometry terrain clamping by explicitly setting height to 0.";gN.geometryZIndex="Entity geometry with zIndex are unsupported when height or extrudedHeight are defined. zIndex will be ignored";gN.geometryHeightReference="Entity corridor, ellipse, polygon or rectangle with heightReference must also have a defined height. heightReference will be ignored";gN.geometryExtrudedHeightReference="Entity corridor, ellipse, polygon or rectangle with extrudedHeightReference must also have a defined extrudedHeight. extrudedHeightReference will be ignored";var _t=gN;var $me={AUTODETECT:0,ENU:1,INERTIAL:2,VELOCITY:3};Object.freeze($me);var bg=$me;var Jme={NONE:0,GEODESIC:1,RHUMB:2};Object.freeze(Jme);var ln=Jme;var Zme=D.EPSILON10;function h9e(e,t,n,i){if(!l(e))return;n=n??!1;let r=l(i),o=e.length;if(o<2)return e;let s,a=e[0],c,u,f=0,d=-1;for(s=1;s<o;++s)c=e[s],t(a,c,Zme)?(l(u)||(u=e.slice(0,s),f=s-1,d=0),r&&i.push(s)):(l(u)&&(u.push(c),f=s,r&&(d=i.length)),a=c);return n&&t(e[0],e[o-1],Zme)&&(r&&(l(u)?i.splice(d,0,f):i.push(o-1)),l(u)?u.length-=1:u=e.slice(0,-1)),l(u)?u:e}var Fr=h9e;function m9e(e){let t=e._uSquared,n=e._ellipsoid.maximumRadius,i=e._ellipsoid.minimumRadius,r=(n-i)/n,o=Math.cos(e._startHeading),s=Math.sin(e._startHeading),a=(1-r)*Math.tan(e._start.latitude),c=1/Math.sqrt(1+a*a),u=c*a,f=Math.atan2(a,o),d=c*s,p=d*d,g=1-p,m=Math.sqrt(g),y=t/4,A=y*y,b=A*y,x=A*A,T=1+y-3*A/4+5*b/4-175*x/64,E=1-y+15*A/8-35*b/8,v=1-3*y+35*A/4,S=1-5*y,I=T*f-E*Math.sin(2*f)*y/2-v*Math.sin(4*f)*A/16-S*Math.sin(6*f)*b/48-Math.sin(8*f)*5*x/512,R=e._constants;R.a=n,R.b=i,R.f=r,R.cosineHeading=o,R.sineHeading=s,R.tanU=a,R.cosineU=c,R.sineU=u,R.sigma=f,R.sineAlpha=d,R.sineSquaredAlpha=p,R.cosineSquaredAlpha=g,R.cosineAlpha=m,R.u2Over4=y,R.u4Over16=A,R.u6Over64=b,R.u8Over256=x,R.a0=T,R.a1=E,R.a2=v,R.a3=S,R.distanceRatio=I}function p9e(e,t){return e*t*(4+e*(4-3*t))/16}function Qme(e,t,n,i,r,o,s){let a=p9e(e,n);return(1-a)*e*t*(i+a*r*(s+a*o*(2*s*s-1)))}function g9e(e,t,n,i,r,o,s){let a=(t-n)/t,c=o-i,u=Math.atan((1-a)*Math.tan(r)),f=Math.atan((1-a)*Math.tan(s)),d=Math.cos(u),p=Math.sin(u),g=Math.cos(f),m=Math.sin(f),y=d*g,A=d*m,b=p*m,x=p*g,T=c,E,v,S,I,R,O,L,_;do{v=Math.cos(T),S=Math.sin(T);let k=A-x*v;O=Math.sqrt(g*g*S*S+k*k),R=b+y*v,I=Math.atan2(O,R);let G;O===0?(G=0,L=1):(G=y*S/O,L=1-G*G),E=T,_=R-2*b/L,isFinite(_)||(_=0),T=c+Qme(a,G,L,I,O,R,_)}while(Math.abs(T-E)>D.EPSILON12);let C=L*(t*t-n*n)/(n*n),w=1+C*(4096+C*(C*(320-175*C)-768))/16384,P=C*(256+C*(C*(74-47*C)-128))/1024,M=_*_,F=P*O*(_+P*(R*(2*M-1)-P*_*(4*O*O-3)*(4*M-3)/6)/4),V=n*w*(I-F),B=Math.atan2(g*S,A-x*v),j=Math.atan2(d*S,A*v-x);e._distance=V,e._startHeading=B,e._endHeading=j,e._uSquared=C}var _9e=new h,cK=new h;function epe(e,t,n,i){let r=h.normalize(i.cartographicToCartesian(t,cK),_9e),o=h.normalize(i.cartographicToCartesian(n,cK),cK);g9e(e,i.maximumRadius,i.minimumRadius,t.longitude,t.latitude,n.longitude,n.latitude),e._start=he.clone(t,e._start),e._end=he.clone(n,e._end),e._start.height=0,e._end.height=0,m9e(e)}function _N(e,t,n){let i=n??ee.default;this._ellipsoid=i,this._start=new he,this._end=new he,this._constants={},this._startHeading=void 0,this._endHeading=void 0,this._distance=void 0,this._uSquared=void 0,l(e)&&l(t)&&epe(this,e,t,i)}Object.defineProperties(_N.prototype,{ellipsoid:{get:function(){return this._ellipsoid}},surfaceDistance:{get:function(){return this._distance}},start:{get:function(){return this._start}},end:{get:function(){return this._end}},startHeading:{get:function(){return this._startHeading}},endHeading:{get:function(){return this._endHeading}}});_N.prototype.setEndPoints=function(e,t){epe(this,e,t,this._ellipsoid)};_N.prototype.interpolateUsingFraction=function(e,t){return this.interpolateUsingSurfaceDistance(this._distance*e,t)};_N.prototype.interpolateUsingSurfaceDistance=function(e,t){let n=this._constants,i=n.distanceRatio+e/n.b,r=Math.cos(2*i),o=Math.cos(4*i),s=Math.cos(6*i),a=Math.sin(2*i),c=Math.sin(4*i),u=Math.sin(6*i),f=Math.sin(8*i),d=i*i,p=i*d,g=n.u8Over256,m=n.u2Over4,y=n.u6Over64,A=n.u4Over16,b=2*p*g*r/3+i*(1-m+7*A/4-15*y/4+579*g/64-(A-15*y/4+187*g/16)*r-(5*y/4-115*g/16)*o-29*g*s/16)+(m/2-A+71*y/32-85*g/16)*a+(5*A/16-5*y/4+383*g/96)*c-d*((y-11*g/2)*a+5*g*c/2)+(29*y/96-29*g/16)*u+539*g*f/1536,x=Math.asin(Math.sin(b)*n.cosineAlpha),T=Math.atan(n.a/n.b*Math.tan(x));b=b-n.sigma;let E=Math.cos(2*n.sigma+b),v=Math.sin(b),S=Math.cos(b),I=n.cosineU*S,R=n.sineU*v,L=Math.atan2(v*n.sineHeading,I-R*n.cosineHeading)-Qme(n.f,n.sineAlpha,n.cosineSquaredAlpha,b,v,S,E);return l(t)?(t.longitude=this._start.longitude+L,t.latitude=T,t.height=0,t):new he(this._start.longitude+L,T,0)};var xg=_N;function uK(e,t,n){if(e===0)return t*n;let i=e*e,r=i*i,o=r*i,s=o*i,a=s*i,c=a*i,u=n,f=Math.sin(2*u),d=Math.sin(4*u),p=Math.sin(6*u),g=Math.sin(8*u),m=Math.sin(10*u),y=Math.sin(12*u);return t*((1-i/4-3*r/64-5*o/256-175*s/16384-441*a/65536-4851*c/1048576)*u-(3*i/8+3*r/32+45*o/1024+105*s/4096+2205*a/131072+6237*c/524288)*f+(15*r/256+45*o/1024+525*s/16384+1575*a/65536+155925*c/8388608)*d-(35*o/3072+175*s/12288+3675*a/262144+13475*c/1048576)*p+(315*s/131072+2205*a/524288+43659*c/8388608)*g-(693*a/1310720+6237*c/5242880)*m+1001*c/8388608*y)}function y9e(e,t,n){let i=e/n;if(t===0)return i;let r=i*i,o=r*i,s=o*i,a=t,c=a*a,u=c*c,f=u*c,d=f*c,p=d*c,g=p*c,m=Math.sin(2*i),y=Math.cos(2*i),A=Math.sin(4*i),b=Math.cos(4*i),x=Math.sin(6*i),T=Math.cos(6*i),E=Math.sin(8*i),v=Math.cos(8*i),S=Math.sin(10*i),I=Math.cos(10*i),R=Math.sin(12*i);return i+i*c/4+7*i*u/64+15*i*f/256+579*i*d/16384+1515*i*p/65536+16837*i*g/1048576+(3*i*u/16+45*i*f/256-i*(32*r-561)*d/4096-i*(232*r-1677)*p/16384+i*(399985-90560*r+512*s)*g/5242880)*y+(21*i*f/256+483*i*d/4096-i*(224*r-1969)*p/16384-i*(33152*r-112599)*g/1048576)*b+(151*i*d/4096+4681*i*p/65536+1479*i*g/16384-453*o*g/32768)*T+(1097*i*p/65536+42783*i*g/1048576)*v+8011*i*g/1048576*I+(3*c/8+3*u/16+213*f/2048-3*r*f/64+255*d/4096-33*r*d/512+20861*p/524288-33*r*p/512+s*p/1024+28273*g/1048576-471*r*g/8192+9*s*g/4096)*m+(21*u/256+21*f/256+533*d/8192-21*r*d/512+197*p/4096-315*r*p/4096+584039*g/16777216-12517*r*g/131072+7*s*g/2048)*A+(151*f/6144+151*d/4096+5019*p/131072-453*r*p/16384+26965*g/786432-8607*r*g/131072)*x+(1097*d/131072+1097*p/65536+225797*g/10485760-1097*r*g/65536)*E+(8011*p/2621440+8011*g/1048576)*S+293393*g/251658240*R}function zv(e,t){if(e===0)return Math.log(Math.tan(.5*(D.PI_OVER_TWO+t)));let n=e*Math.sin(t);return Math.log(Math.tan(.5*(D.PI_OVER_TWO+t)))-e/2*Math.log((1+n)/(1-n))}function A9e(e,t,n,i,r){let o=zv(e._ellipticity,n),s=zv(e._ellipticity,r);return Math.atan2(D.negativePiToPi(i-t),s-o)}function b9e(e,t,n,i,r,o,s){let a=e._heading,c=o-i,u;if(D.equalsEpsilon(Math.abs(a),D.PI_OVER_TWO,D.EPSILON8))if(t===n)u=t*Math.cos(r)*D.negativePiToPi(c);else{let f=Math.sin(r);u=t*Math.cos(r)*D.negativePiToPi(c)/Math.sqrt(1-e._ellipticitySquared*f*f)}else{let f=uK(e._ellipticity,t,r);u=(uK(e._ellipticity,t,s)-f)/Math.cos(a)}return Math.abs(u)}var x9e=new h,lK=new h;function tpe(e,t,n,i){let r=h.normalize(i.cartographicToCartesian(t,lK),x9e),o=h.normalize(i.cartographicToCartesian(n,lK),lK),s=i.maximumRadius,a=i.minimumRadius,c=s*s,u=a*a;e._ellipticitySquared=(c-u)/c,e._ellipticity=Math.sqrt(e._ellipticitySquared),e._start=he.clone(t,e._start),e._start.height=0,e._end=he.clone(n,e._end),e._end.height=0,e._heading=A9e(e,t.longitude,t.latitude,n.longitude,n.latitude),e._distance=b9e(e,i.maximumRadius,i.minimumRadius,t.longitude,t.latitude,n.longitude,n.latitude)}function npe(e,t,n,i,r,o){if(n===0)return he.clone(e,o);let s=r*r,a,c,u;if(Math.abs(D.PI_OVER_TWO-Math.abs(t))>D.EPSILON8){let f=uK(r,i,e.latitude),d=n*Math.cos(t),p=f+d;if(c=y9e(p,r,i),Math.abs(t)<D.EPSILON10)a=D.negativePiToPi(e.longitude);else{let g=zv(r,e.latitude),m=zv(r,c);u=Math.tan(t)*(m-g),a=D.negativePiToPi(e.longitude+u)}}else{c=e.latitude;let f;if(r===0)f=i*Math.cos(e.latitude);else{let d=Math.sin(e.latitude);f=i*Math.cos(e.latitude)/Math.sqrt(1-s*d*d)}u=n/f,t>0?a=D.negativePiToPi(e.longitude+u):a=D.negativePiToPi(e.longitude-u)}return l(o)?(o.longitude=a,o.latitude=c,o.height=0,o):new he(a,c,0)}function Tg(e,t,n){let i=n??ee.default;this._ellipsoid=i,this._start=new he,this._end=new he,this._heading=void 0,this._distance=void 0,this._ellipticity=void 0,this._ellipticitySquared=void 0,l(e)&&l(t)&&tpe(this,e,t,i)}Object.defineProperties(Tg.prototype,{ellipsoid:{get:function(){return this._ellipsoid}},surfaceDistance:{get:function(){return this._distance}},start:{get:function(){return this._start}},end:{get:function(){return this._end}},heading:{get:function(){return this._heading}}});Tg.fromStartHeadingDistance=function(e,t,n,i,r){let o=i??ee.default,s=o.maximumRadius,a=o.minimumRadius,c=s*s,u=a*a,f=Math.sqrt((c-u)/c);t=D.negativePiToPi(t);let d=npe(e,t,n,o.maximumRadius,f);return!l(r)||l(i)&&!i.equals(r.ellipsoid)?new Tg(e,d,o):(r.setEndPoints(e,d),r)};Tg.prototype.setEndPoints=function(e,t){tpe(this,e,t,this._ellipsoid)};Tg.prototype.interpolateUsingFraction=function(e,t){return this.interpolateUsingSurfaceDistance(e*this._distance,t)};Tg.prototype.interpolateUsingSurfaceDistance=function(e,t){return npe(this._start,this._heading,e,this._ellipsoid.maximumRadius,this._ellipticity,t)};Tg.prototype.findIntersectionWithLongitude=function(e,t){let n=this._ellipticity,i=this._heading,r=Math.abs(i),o=this._start;if(e=D.negativePiToPi(e),D.equalsEpsilon(Math.abs(e),Math.PI,D.EPSILON14)&&(e=D.sign(o.longitude)*Math.PI),l(t)||(t=new he),Math.abs(D.PI_OVER_TWO-r)<=D.EPSILON8)return t.longitude=e,t.latitude=o.latitude,t.height=0,t;if(D.equalsEpsilon(Math.abs(D.PI_OVER_TWO-r),D.PI_OVER_TWO,D.EPSILON8))return D.equalsEpsilon(e,o.longitude,D.EPSILON12)?void 0:(t.longitude=e,t.latitude=D.PI_OVER_TWO*D.sign(D.PI_OVER_TWO-i),t.height=0,t);let s=o.latitude,a=n*Math.sin(s),c=Math.tan(.5*(D.PI_OVER_TWO+s))*Math.exp((e-o.longitude)/Math.tan(i)),u=(1+a)/(1-a),f=o.latitude,d;do{d=f;let p=n*Math.sin(d),g=(1+p)/(1-p);f=2*Math.atan(c*Math.pow(g/u,n/2))-D.PI_OVER_TWO}while(!D.equalsEpsilon(f,d,D.EPSILON12));return t.longitude=e,t.latitude=f,t.height=0,t};Tg.prototype.findIntersectionWithLatitude=function(e,t){let n=this._ellipticity,i=this._heading,r=this._start;if(D.equalsEpsilon(Math.abs(i),D.PI_OVER_TWO,D.EPSILON8))return;let o=zv(n,r.latitude),s=zv(n,e),a=Math.tan(i)*(s-o),c=D.negativePiToPi(r.longitude+a);return l(t)?(t.longitude=c,t.latitude=e,t.height=0,t):new he(c,e,0)};var Rc=Tg;var yK=[Ui,yi],T9e=yK.length,Tpe=Math.cos(D.toRadians(30)),ipe=Math.cos(D.toRadians(150)),Epe=0,Cpe=1e3;function Xy(e){e=e??H.EMPTY_OBJECT;let t=e.positions;this.width=e.width??1,this._positions=t,this.granularity=e.granularity??9999,this.loop=e.loop??!1,this.arcType=e.arcType??ln.GEODESIC,this._ellipsoid=ee.default,this._projectionIndex=0,this._workerName="createGroundPolylineGeometry",this._scene3DOnly=!1}Object.defineProperties(Xy.prototype,{packedLength:{get:function(){return 1+this._positions.length*3+1+1+1+ee.packedLength+1+1}}});Xy.setProjectionAndEllipsoid=function(e,t){let n=0;for(let i=0;i<T9e;i++)if(t instanceof yK[i]){n=i;break}e._projectionIndex=n,e._ellipsoid=t.ellipsoid};var E9e=new h,rpe=new h,ope=new h;function _K(e,t,n,i,r){let o=Yl(i,e,0,E9e),s=Yl(i,e,n,rpe),a=Yl(i,t,0,ope),c=Eg(s,o,rpe),u=Eg(a,o,ope);return h.cross(u,c,r),h.normalize(r,r)}var C9e=new he,v9e=new h,S9e=new h,w9e=new h;function fK(e,t,n,i,r,o,s,a,c,u,f){if(r===0)return;let d;o===ln.GEODESIC?d=new xg(e,t,s):o===ln.RHUMB&&(d=new Rc(e,t,s));let p=d.surfaceDistance;if(p<r)return;let g=_K(e,t,i,s,w9e),m=Math.ceil(p/r),y=p/m,A=y,b=m-1,x=a.length;for(let T=0;T<b;T++){let E=d.interpolateUsingSurfaceDistance(A,C9e),v=Yl(s,E,n,v9e),S=Yl(s,E,i,S9e);h.pack(g,a,x),h.pack(v,c,x),h.pack(S,u,x),f.push(E.latitude),f.push(E.longitude),x+=3,A+=y}}var dK=new he;function Yl(e,t,n,i){return he.clone(t,dK),dK.height=n,he.toCartesian(dK,e,i)}Xy.pack=function(e,t,n){let i=n??0,r=e._positions,o=r.length;t[i++]=o;for(let s=0;s<o;++s){let a=r[s];h.pack(a,t,i),i+=3}return t[i++]=e.granularity,t[i++]=e.loop?1:0,t[i++]=e.arcType,ee.pack(e._ellipsoid,t,i),i+=ee.packedLength,t[i++]=e._projectionIndex,t[i]=e._scene3DOnly?1:0,t};Xy.unpack=function(e,t,n){let i=t??0,r=e[i++],o=new Array(r);for(let p=0;p<r;p++)o[p]=h.unpack(e,i),i+=3;let s=e[i++],a=e[i++]===1,c=e[i++],u=ee.unpack(e,i);i+=ee.packedLength;let f=e[i++],d=e[i]===1;return l(n)||(n=new Xy({positions:o})),n._positions=o,n.granularity=s,n.loop=a,n.arcType=c,n._ellipsoid=u,n._projectionIndex=f,n._scene3DOnly=d,n};function Eg(e,t,n){return h.subtract(e,t,n),h.normalize(n,n),n}function spe(e,t,n,i){return i=Eg(e,t,i),i=h.cross(i,n,i),i=h.normalize(i,i),i=h.cross(n,i,i),i}var I9e=new h,P9e=new h,D9e=new h,vpe=new h,R9e=0,O9e=-1;function hK(e,t,n,i,r){let o=Eg(n,t,vpe),s=spe(e,t,o,I9e),a=spe(i,t,o,P9e);if(D.equalsEpsilon(h.dot(s,a),O9e,D.EPSILON5))return r=h.cross(o,s,r),r=h.normalize(r,r),r;r=h.add(a,s,r),r=h.normalize(r,r);let c=h.cross(o,r,D9e);return h.dot(a,c)<R9e&&(r=h.negate(r,r)),r}var I6=sn.fromPointNormal(h.ZERO,h.UNIT_Y),M9e=new h,N9e=new h,L9e=new h,F9e=new h,B9e=new h,v6=new h,S6=new he,ape=new he,cpe=new he;Xy.createGeometry=function(e){let t=!e._scene3DOnly,n=e.loop,i=e._ellipsoid,r=e.granularity,o=e.arcType,s=new yK[e._projectionIndex](i),a=Epe,c=Cpe,u,f,d=e._positions,p=d.length;p===2&&(n=!1);let g,m,y,A,b=new Rc(void 0,void 0,i),x,T,E,v=[d[0]];for(f=0;f<p-1;f++)g=d[f],m=d[f+1],x=_i.lineSegmentPlane(g,m,I6,v6),l(x)&&!h.equalsEpsilon(x,g,D.EPSILON7)&&!h.equalsEpsilon(x,m,D.EPSILON7)&&(e.arcType===ln.GEODESIC?v.push(h.clone(x)):e.arcType===ln.RHUMB&&(E=i.cartesianToCartographic(x,S6).longitude,y=i.cartesianToCartographic(g,S6),A=i.cartesianToCartographic(m,ape),b.setEndPoints(y,A),T=b.findIntersectionWithLongitude(E,cpe),x=i.cartographicToCartesian(T,v6),l(x)&&!h.equalsEpsilon(x,g,D.EPSILON7)&&!h.equalsEpsilon(x,m,D.EPSILON7)&&v.push(h.clone(x)))),v.push(m);n&&(g=d[p-1],m=d[0],x=_i.lineSegmentPlane(g,m,I6,v6),l(x)&&!h.equalsEpsilon(x,g,D.EPSILON7)&&!h.equalsEpsilon(x,m,D.EPSILON7)&&(e.arcType===ln.GEODESIC?v.push(h.clone(x)):e.arcType===ln.RHUMB&&(E=i.cartesianToCartographic(x,S6).longitude,y=i.cartesianToCartographic(g,S6),A=i.cartesianToCartographic(m,ape),b.setEndPoints(y,A),T=b.findIntersectionWithLongitude(E,cpe),x=i.cartographicToCartesian(T,v6),l(x)&&!h.equalsEpsilon(x,g,D.EPSILON7)&&!h.equalsEpsilon(x,m,D.EPSILON7)&&v.push(h.clone(x)))));let S=v.length,I=new Array(S);for(f=0;f<S;f++){let q=he.fromCartesian(v[f],i);q.height=0,I[f]=q}if(I=Fr(I,he.equalsEpsilon),S=I.length,S<2)return;let R=[],O=[],L=[],_=[],C=M9e,w=N9e,P=L9e,M=F9e,F=B9e,V=I[0],B=I[1],j=I[S-1];for(C=Yl(i,j,a,C),M=Yl(i,B,a,M),w=Yl(i,V,a,w),P=Yl(i,V,c,P),n?F=hK(C,w,P,M,F):F=_K(V,B,c,i,F),h.pack(F,O,0),h.pack(w,L,0),h.pack(P,_,0),R.push(V.latitude),R.push(V.longitude),fK(V,B,a,c,r,o,i,O,L,_,R),f=1;f<S-1;++f){C=h.clone(w,C),w=h.clone(M,w);let q=I[f];Yl(i,q,c,P),Yl(i,I[f+1],a,M),hK(C,w,P,M,F),u=O.length,h.pack(F,O,u),h.pack(w,L,u),h.pack(P,_,u),R.push(q.latitude),R.push(q.longitude),fK(I[f],I[f+1],a,c,r,o,i,O,L,_,R)}let k=I[S-1],G=I[S-2];if(w=Yl(i,k,a,w),P=Yl(i,k,c,P),n){let q=I[0];C=Yl(i,G,a,C),M=Yl(i,q,a,M),F=hK(C,w,P,M,F)}else F=_K(G,k,c,i,F);if(u=O.length,h.pack(F,O,u),h.pack(w,L,u),h.pack(P,_,u),R.push(k.latitude),R.push(k.longitude),n){for(fK(k,V,a,c,r,o,i,O,L,_,R),u=O.length,f=0;f<3;++f)O[u+f]=O[f],L[u+f]=L[f],_[u+f]=_[f];R.push(V.latitude),R.push(V.longitude)}return l7e(n,s,L,_,O,R,t)};var k9e=new h,U9e=new $,z9e=new Le;function lpe(e,t,n,i){let r=Eg(n,t,k9e),o=h.dot(r,e);if(o>Tpe||o<ipe){let s=Eg(i,n,vpe),a=o<ipe?D.PI_OVER_TWO:-D.PI_OVER_TWO,c=Le.fromAxisAngle(s,a,z9e),u=$.fromQuaternion(c,U9e);return $.multiplyByVector(u,e,e),!0}return!1}var upe=new he,V9e=new h,fpe=new h;function yN(e,t,n,i,r){let o=he.toCartesian(t,e._ellipsoid,V9e),s=h.add(o,n,fpe),a=!1,c=e._ellipsoid,u=c.cartesianToCartographic(s,upe);Math.abs(t.longitude-u.longitude)>D.PI_OVER_TWO&&(a=!0,s=h.subtract(o,n,fpe),u=c.cartesianToCartographic(s,upe)),u.height=0;let f=e.project(u,r);return r=h.subtract(f,i,r),r.z=0,r=h.normalize(r,r),a&&h.negate(r,r),r}var j9e=new h,dpe=new h;function hpe(e,t,n,i,r,o){let s=h.subtract(t,e,j9e);h.normalize(s,s);let a=n-Epe,c=h.multiplyByScalar(s,a,dpe);h.add(e,c,r);let u=i-Cpe;c=h.multiplyByScalar(s,u,dpe),h.add(t,c,o)}var H9e=new h;function w6(e,t){let n=sn.getPointDistance(I6,e),i=sn.getPointDistance(I6,t),r=H9e;D.equalsEpsilon(n,0,D.EPSILON2)?(r=Eg(t,e,r),h.multiplyByScalar(r,D.EPSILON2,r),h.add(e,r,e)):D.equalsEpsilon(i,0,D.EPSILON2)&&(r=Eg(e,t,r),h.multiplyByScalar(r,D.EPSILON2,r),h.add(t,r,t))}function G9e(e,t){let n=Math.abs(e.longitude),i=Math.abs(t.longitude);if(D.equalsEpsilon(n,D.PI,D.EPSILON11)){let r=D.sign(t.longitude);return e.longitude=r*(n-D.EPSILON11),1}else if(D.equalsEpsilon(i,D.PI,D.EPSILON11)){let r=D.sign(e.longitude);return t.longitude=r*(i-D.EPSILON11),2}return 0}var Spe=new he,wpe=new he,mpe=new h,mK=new h,ppe=new h,gpe=new h,W9e=new h,_pe=new h,q9e=[Spe,wpe],Y9e=new ie,X9e=new h,K9e=new h,$9e=new h,J9e=new h,Z9e=new h,Q9e=new h,pK=new h,gK=new h,e7e=new h,t7e=new h,n7e=new h,ype=new h,i7e=new h,r7e=new h,o7e=new Sn,s7e=new Sn,Ape=new h,a7e=new h,bpe=new h,c7e=[new ue,new ue],Ipe=[0,2,1,0,3,2,0,7,3,0,4,7,0,5,4,0,1,5,5,7,4,5,6,7,5,2,6,5,1,2,3,6,2,3,7,6],xpe=Ipe.length;function l7e(e,t,n,i,r,o,s){let a,c,u=t._ellipsoid,f=n.length/3-1,d=f*8,p=d*4,g=f*36,m=d>65535?new Uint32Array(g):new Uint16Array(g),y=new Float64Array(d*3),A=new Float32Array(p),b=new Float32Array(p),x=new Float32Array(p),T=new Float32Array(p),E=new Float32Array(p),v,S,I,R;s&&(v=new Float32Array(p),S=new Float32Array(p),I=new Float32Array(p),R=new Float32Array(d*2));let O=o.length/2,L=0,_=Spe;_.height=0;let C=wpe;C.height=0;let w=mpe,P=mK;if(s)for(c=0,a=1;a<O;a++)_.latitude=o[c],_.longitude=o[c+1],C.latitude=o[c+2],C.longitude=o[c+3],w=t.project(_,w),P=t.project(C,P),L+=h.distance(w,P),c+=2;let M=i.length/3;P=h.unpack(i,0,P);let F=0;for(c=3,a=1;a<M;a++)w=h.clone(P,w),P=h.unpack(i,c,P),F+=h.distance(w,P),c+=3;let V;c=3;let B=0,j=0,k=0,G=0,q=!1,Q=h.unpack(n,0,gpe),W=h.unpack(i,0,mK),J=h.unpack(r,0,_pe);if(e){let Se=h.unpack(n,n.length-6,ppe);lpe(J,Se,Q,W)&&(J=h.negate(J,J))}let Z=0,ae=0,Ae=0;for(a=0;a<f;a++){let Se=h.clone(Q,ppe),Re=h.clone(W,mpe),Qe=h.clone(J,W9e);q&&(Qe=h.negate(Qe,Qe)),Q=h.unpack(n,c,gpe),W=h.unpack(i,c,mK),J=h.unpack(r,c,_pe),q=lpe(J,Se,Q,W),_.latitude=o[B],_.longitude=o[B+1],C.latitude=o[B+2],C.longitude=o[B+3];let He,Xe,$e,Pe;if(s){let gi=G9e(_,C);He=t.project(_,Z9e),Xe=t.project(C,Q9e);let ho=Eg(Xe,He,Ape);ho.y=Math.abs(ho.y),$e=pK,Pe=gK,gi===0||h.dot(ho,h.UNIT_Y)>Tpe?($e=yN(t,_,Qe,He,pK),Pe=yN(t,C,J,Xe,gK)):gi===1?(Pe=yN(t,C,J,Xe,gK),$e.x=0,$e.y=D.sign(_.longitude-Math.abs(C.longitude)),$e.z=0):($e=yN(t,_,Qe,He,pK),Pe.x=0,Pe.y=D.sign(_.longitude-C.longitude),Pe.z=0)}let qe=h.distance(Re,W),st=Sn.fromCartesian(Se,o7e),vt=h.subtract(Q,Se,e7e),Gt=h.normalize(vt,ype),lt=h.subtract(Re,Se,t7e);lt=h.normalize(lt,lt);let mt=h.cross(Gt,lt,ype);mt=h.normalize(mt,mt);let ft=h.cross(lt,Qe,i7e);ft=h.normalize(ft,ft);let Xt=h.subtract(W,Q,n7e);Xt=h.normalize(Xt,Xt);let rt=h.cross(J,Xt,r7e);rt=h.normalize(rt,rt);let ht=qe/F,Bi=Z/F,Xn=0,bi,Wi,wi,hi=0,xi=0;if(s){Xn=h.distance(He,Xe),bi=Sn.fromCartesian(He,s7e),Wi=h.subtract(Xe,He,Ape),wi=h.normalize(Wi,a7e);let gi=wi.x;wi.x=wi.y,wi.y=-gi,hi=Xn/L,xi=ae/L}for(V=0;V<8;V++){let gi=G+V*4,ho=j+V*2,ur=gi+3,Zo=V<4?1:-1,Bn=V===2||V===3||V===6||V===7?1:-1;h.pack(st.high,A,gi),A[ur]=vt.x,h.pack(st.low,b,gi),b[ur]=vt.y,h.pack(ft,x,gi),x[ur]=vt.z,h.pack(rt,T,gi),T[ur]=ht*Zo,h.pack(mt,E,gi);let qi=Bi*Bn;qi===0&&Bn<0&&(qi=9),E[ur]=qi,s&&(v[gi]=bi.high.x,v[gi+1]=bi.high.y,v[gi+2]=bi.low.x,v[gi+3]=bi.low.y,I[gi]=-$e.y,I[gi+1]=$e.x,I[gi+2]=Pe.y,I[gi+3]=-Pe.x,S[gi]=Wi.x,S[gi+1]=Wi.y,S[gi+2]=wi.x,S[gi+3]=wi.y,R[ho]=hi*Zo,qi=xi*Bn,qi===0&&Bn<0&&(qi=9),R[ho+1]=qi)}let jn=$9e,nn=J9e,Wn=X9e,Zi=K9e,Mr=ie.fromCartographicArray(q9e,Y9e),fo=Mi.getMinimumMaximumHeights(Mr,u),Bs=fo.minimumTerrainHeight,Ks=fo.maximumTerrainHeight;Ae+=Math.abs(Bs),Ae+=Math.abs(Ks),hpe(Se,Re,Bs,Ks,jn,Wn),hpe(Q,W,Bs,Ks,nn,Zi);let no=h.multiplyByScalar(mt,D.EPSILON5,bpe);h.add(jn,no,jn),h.add(nn,no,nn),h.add(Wn,no,Wn),h.add(Zi,no,Zi),w6(jn,nn),w6(Wn,Zi),h.pack(jn,y,k),h.pack(nn,y,k+3),h.pack(Zi,y,k+6),h.pack(Wn,y,k+9),no=h.multiplyByScalar(mt,-2*D.EPSILON5,bpe),h.add(jn,no,jn),h.add(nn,no,nn),h.add(Wn,no,Wn),h.add(Zi,no,Zi),w6(jn,nn),w6(Wn,Zi),h.pack(jn,y,k+12),h.pack(nn,y,k+15),h.pack(Zi,y,k+18),h.pack(Wn,y,k+21),B+=2,c+=3,j+=16,k+=24,G+=32,Z+=qe,ae+=Xn}c=0;let fe=0;for(a=0;a<f;a++){for(V=0;V<xpe;V++)m[c+V]=Ipe[V]+fe;fe+=8,c+=xpe}let xe=c7e;ue.fromVertices(n,h.ZERO,3,xe[0]),ue.fromVertices(i,h.ZERO,3,xe[1]);let ge=ue.fromBoundingSpheres(xe);ge.radius+=Ae/(f*2);let we={position:new Ne({componentDatatype:Y.DOUBLE,componentsPerAttribute:3,normalize:!1,values:y}),startHiAndForwardOffsetX:Yy(A),startLoAndForwardOffsetY:Yy(b),startNormalAndForwardOffsetZ:Yy(x),endNormalAndTextureCoordinateNormalizationX:Yy(T),rightNormalAndTextureCoordinateNormalizationY:Yy(E)};return s&&(we.startHiLo2D=Yy(v),we.offsetAndRight2D=Yy(S),we.startEndNormals2D=Yy(I),we.texcoordNormalization2D=new Ne({componentDatatype:Y.FLOAT,componentsPerAttribute:2,normalize:!1,values:R})),new St({attributes:we,indices:m,boundingSphere:ge})}function Yy(e){return new Ne({componentDatatype:Y.FLOAT,componentsPerAttribute:4,normalize:!1,values:e})}Xy._projectNormal=yN;var Rx=Xy;var AN=`in vec3 position3DHigh; +`,t}function Lme(e,t){let n=e.vertexAttributes}function QGe(e,t){return function(){return e[t]}}var hK=Math.max(dn.hardwareConcurrency-1,1),T6,e5e=new $n("combineGeometry");function t5e(e,t){let n,i,r,o,s=e._instanceIds;if(e._state===rs.READY){n=Array.isArray(e.geometryInstances)?e.geometryInstances:[e.geometryInstances];let a=e._numberOfInstances=n.length,c=[],u=[];for(r=0;r<a;++r)i=n[r].geometry,s.push(n[r].id),u.push({moduleName:i._workerName,modulePath:i._workerPath,geometry:i});if(!l(T6))for(T6=new Array(hK),r=0;r<hK;r++)T6[r]=new $n("createGeometry");let f;for(u=rN(u,hK),r=0;r<u.length;r++){let d=0,p=u[r],g=p.length;for(o=0;o<g;++o)f=p[o],i=f.geometry,l(i.constructor.pack)&&(f.offset=d,d+=i.constructor.packedLength??i.packedLength);let m;if(d>0){let y=new Float64Array(d);for(m=[y.buffer],o=0;o<g;++o)f=p[o],i=f.geometry,l(i.constructor.pack)&&(i.constructor.pack(i,y,f.offset),f.geometry=y)}c.push(T6[r].scheduleTask({subTasks:u[r]},m))}e._state=rs.CREATING,Promise.all(c).then(function(d){e._createGeometryResults=d,e._state=rs.CREATED}).catch(function(d){cN(e,t,rs.FAILED,d)})}else if(e._state===rs.CREATED){let a=[];n=Array.isArray(e.geometryInstances)?e.geometryInstances:[e.geometryInstances];let c=t.scene3DOnly,u=t.mapProjection,f=e5e.scheduleTask(Dx.packCombineGeometryParameters({createGeometryResults:e._createGeometryResults,instances:n,ellipsoid:u.ellipsoid,projection:u,elementIndexUintSupported:t.context.elementIndexUint,scene3DOnly:c,vertexCacheOptimize:e.vertexCacheOptimize,compressVertices:e.compressVertices,modelMatrix:e.modelMatrix,createPickOffsets:e._createPickOffsets},a),a);e._createGeometryResults=void 0,e._state=rs.COMBINING,Promise.resolve(f).then(function(d){let p=Dx.unpackCombineGeometryResults(d);e._geometries=p.geometries,e._attributeLocations=p.attributeLocations,e.modelMatrix=N.clone(p.modelMatrix,e.modelMatrix),e._pickOffsets=p.pickOffsets,e._offsetInstanceExtend=p.offsetInstanceExtend,e._instanceBoundingSpheres=p.boundingSpheres,e._instanceBoundingSpheresCV=p.boundingSpheresCV,l(e._geometries)&&e._geometries.length>0?(e._recomputeBoundingSpheres=!0,e._state=rs.COMBINED):cN(e,t,rs.FAILED,void 0)}).catch(function(d){cN(e,t,rs.FAILED,d)})}}function n5e(e,t){let n=Array.isArray(e.geometryInstances)?e.geometryInstances:[e.geometryInstances],i=e._numberOfInstances=n.length,r=new Array(i),o=e._instanceIds,s,a,c=0;for(a=0;a<i;a++){s=n[a];let p=s.geometry,g;l(p.attributes)&&l(p.primitiveType)?g=XGe(p):g=p.constructor.createGeometry(p),r[c++]=KGe(s,g),o.push(s.id)}r.length=c;let u=t.scene3DOnly,f=t.mapProjection,d=Dx.combineGeometry({instances:r,ellipsoid:f.ellipsoid,projection:f,elementIndexUintSupported:t.context.elementIndexUint,scene3DOnly:u,vertexCacheOptimize:e.vertexCacheOptimize,compressVertices:e.compressVertices,modelMatrix:e.modelMatrix,createPickOffsets:e._createPickOffsets});e._geometries=d.geometries,e._attributeLocations=d.attributeLocations,e.modelMatrix=N.clone(d.modelMatrix,e.modelMatrix),e._pickOffsets=d.pickOffsets,e._offsetInstanceExtend=d.offsetInstanceExtend,e._instanceBoundingSpheres=d.boundingSpheres,e._instanceBoundingSpheresCV=d.boundingSpheresCV,l(e._geometries)&&e._geometries.length>0?(e._recomputeBoundingSpheres=!0,e._state=rs.COMBINED):cN(e,t,rs.FAILED,void 0)}function i5e(e,t){let n=e._batchTableAttributeIndices.offset;if(!e._recomputeBoundingSpheres||!l(n)){e._recomputeBoundingSpheres=!1;return}let i,r=e._offsetInstanceExtend,o=e._instanceBoundingSpheres,s=o.length,a=e._tempBoundingSpheres;if(!l(a)){for(a=new Array(s),i=0;i<s;i++)a[i]=new ue;e._tempBoundingSpheres=a}for(i=0;i<s;++i){let y=a[i],A=e._batchTable.getBatchedAttribute(i,n,new h);y=o[i].clone(y),Wme(y,A,r[i])}let c=[],u=[],f=[];for(i=0;i<s;++i){let y=a[i];y.center.x-y.radius>0||ue.intersectPlane(y,sn.ORIGIN_ZX_PLANE)!==$t.INTERSECTING?c.push(y):(u.push(y),f.push(y))}let d=c[0],p=f[0],g=u[0];for(i=1;i<c.length;i++)d=ue.union(d,c[i]);for(i=1;i<f.length;i++)p=ue.union(p,f[i]);for(i=1;i<u.length;i++)g=ue.union(g,u[i]);let m=[];for(l(d)&&m.push(d),l(p)&&m.push(p),l(g)&&m.push(g),i=0;i<m.length;i++){let y=m[i].clone(e._boundingSpheres[i]);e._boundingSpheres[i]=y,e._boundingSphereCV[i]=ue.projectTo2D(y,t.mapProjection,e._boundingSphereCV[i])}os._updateBoundingVolumes(e,t,e.modelMatrix,!0),e._recomputeBoundingSpheres=!1}var Fme=new Sn,jme=new he,Hme=new h,Gme=new ue;function r5e(e,t){if(!l(e._batchTableAttributeIndices.distanceDisplayCondition)||e._batchTableBoundingSpheresUpdated)return;let i=e._batchTableBoundingSphereAttributeIndices,r=i.center3DHigh,o=i.center3DLow,s=i.center2DHigh,a=i.center2DLow,c=i.radius,u=t.mapProjection,f=u.ellipsoid,d=e._batchTable,p=e._instanceBoundingSpheres,g=p.length;for(let m=0;m<g;++m){let y=p[m];if(!l(y))continue;let A=e.modelMatrix;l(A)&&(y=ue.transform(y,A,Gme));let b=y.center,x=y.radius,T=Sn.fromCartesian(b,Fme);if(d.setBatchedAttribute(m,r,T.high),d.setBatchedAttribute(m,o,T.low),!t.scene3DOnly){let E=f.cartesianToCartographic(b,jme),v=u.project(E,Hme);T=Sn.fromCartesian(v,Fme),d.setBatchedAttribute(m,s,T.high),d.setBatchedAttribute(m,a,T.low)}d.setBatchedAttribute(m,c,x)}e._batchTableBoundingSpheresUpdated=!0}var mK=new h,o5e=new h;function Bme(e,t){if(!l(e._batchTableAttributeIndices.offset)||e._batchTableOffsetsUpdated||t.scene3DOnly)return;let i=e._batchTableOffsetAttribute2DIndex,r=t.mapProjection,o=r.ellipsoid,s=e._batchTable,a=e._instanceBoundingSpheres,c=a.length;for(let u=0;u<c;++u){let f=a[u];if(!l(f))continue;let d=s.getBatchedAttribute(u,e._batchTableAttributeIndices.offset);if(h.equals(d,h.ZERO)){s.setBatchedAttribute(u,i,h.ZERO);continue}let p=e.modelMatrix;l(p)&&(f=ue.transform(f,p,Gme));let g=f.center;g=o.scaleToGeodeticSurface(g,o5e);let m=o.cartesianToCartographic(g,jme),y=r.project(m,Hme),A=h.add(d,g,mK);m=o.cartesianToCartographic(A,m);let b=r.project(m,mK),x=h.subtract(b,y,mK),T=x.x;x.x=x.z,x.z=x.y,x.y=T,s.setBatchedAttribute(u,i,x)}e._batchTableOffsetsUpdated=!0}function s5e(e,t){let n=e._attributeLocations,i=e._geometries,r=t.scene3DOnly,o=t.context,s=[],a=i.length;for(let c=0;c<a;++c){let u=i[c];if(s.push(zn.fromGeometry({context:o,geometry:u,attributeLocations:n,bufferUsage:Me.STATIC_DRAW,interleave:e._interleave})),l(e._createBoundingVolumeFunction))e._createBoundingVolumeFunction(t,u);else if(e._boundingSpheres.push(ue.clone(u.boundingSphere)),e._boundingSphereWC.push(new ue),!r){let f=u.boundingSphereCV.center,d=f.x,p=f.y,g=f.z;f.x=g,f.y=d,f.z=p,e._boundingSphereCV.push(ue.clone(u.boundingSphereCV)),e._boundingSphere2D.push(new ue),e._boundingSphereMorph.push(new ue)}}e._va=s,e._primitiveType=i[0].primitiveType,e.releaseGeometryInstances&&(e.geometryInstances=void 0),e._geometries=void 0,cN(e,t,rs.COMPLETE,void 0)}function a5e(e,t,n,i){let r=n.getRenderState(),o;i?(o=Je(r,!1),o.cull={enabled:!0,face:zi.BACK},e._frontFaceRS=Ge.fromCache(o),o.cull.face=zi.FRONT,e._backFaceRS=Ge.fromCache(o)):(e._frontFaceRS=Ge.fromCache(r),e._backFaceRS=e._frontFaceRS),o=Je(r,!1),l(e._depthFailAppearance)&&(o.depthTest.enabled=!1),l(e._depthFailAppearance)&&(r=e._depthFailAppearance.getRenderState(),o=Je(r,!1),o.depthTest.func=cc.GREATER,i?(o.cull={enabled:!0,face:zi.BACK},e._frontFaceDepthFailRS=Ge.fromCache(o),o.cull.face=zi.FRONT,e._backFaceDepthFailRS=Ge.fromCache(o)):(e._frontFaceDepthFailRS=Ge.fromCache(o),e._backFaceDepthFailRS=e._frontFaceRS))}function c5e(e,t,n){let i=t.context,r=e._attributeLocations,o=e._batchTable.getVertexShaderCallback()(n.vertexShaderSource);o=os._appendOffsetToShader(e,o),o=os._appendShowToShader(e,o),o=os._appendDistanceDisplayConditionToShader(e,o,t.scene3DOnly),o=Ome(o),o=os._updateColorAttribute(e,o,!1),o=Nme(e,o),o=os._modifyShaderPosition(e,o,t.scene3DOnly);let s=n.getFragmentShaderSource();s=Mme(s),e._sp=Qt.replaceCache({context:i,shaderProgram:e._sp,vertexShaderSource:o,fragmentShaderSource:s,attributeLocations:r}),Lme(e._sp,r),l(e._depthFailAppearance)&&(o=e._batchTable.getVertexShaderCallback()(e._depthFailAppearance.vertexShaderSource),o=os._appendShowToShader(e,o),o=os._appendDistanceDisplayConditionToShader(e,o,t.scene3DOnly),o=Ome(o),o=os._updateColorAttribute(e,o,!0),o=Nme(e,o),o=os._modifyShaderPosition(e,o,t.scene3DOnly),o=JGe(o),s=e._depthFailAppearance.getFragmentShaderSource(),s=Mme(s),s=ZGe(s),e._spDepthFail=Qt.replaceCache({context:i,shaderProgram:e._spDepthFail,vertexShaderSource:o,fragmentShaderSource:s,attributeLocations:r}),Lme(e._spDepthFail,r))}var aN=new N,kme=new h;function Ume(e,t,n,i){let r=l(n)?n._uniforms:void 0,o={},s=t.uniforms;if(l(s))for(let c in s)s.hasOwnProperty(c)&&(o[c]=QGe(s,c));let a=Ot(o,r);return a=e._batchTable.getUniformMapCallback()(a),l(e.rtcCenter)&&(a.u_modifiedModelView=function(){let c=i.context.uniformState.view;return N.multiply(c,e._modelMatrix,aN),N.multiplyByPoint(aN,e.rtcCenter,kme),N.setTranslation(aN,kme,aN),aN}),a}function l5e(e,t,n,i,r,o,s,a){let c=Ume(e,t,n,a),u;l(e._depthFailAppearance)&&(u=Ume(e,e._depthFailAppearance,e._depthFailAppearance.material,a));let f=i?Ie.TRANSLUCENT:Ie.OPAQUE,d=r?2:1;d*=l(e._depthFailAppearance)?2:1,o.length=e._va.length*d;let p=o.length,g=0;for(let m=0;m<p;++m){let y;r&&(y=o[m],l(y)||(y=o[m]=new at({owner:e,primitiveType:e._primitiveType})),y.vertexArray=e._va[g],y.renderState=e._backFaceRS,y.shaderProgram=e._sp,y.uniformMap=c,y.pass=f,++m),y=o[m],l(y)||(y=o[m]=new at({owner:e,primitiveType:e._primitiveType})),y.vertexArray=e._va[g],y.renderState=e._frontFaceRS,y.shaderProgram=e._sp,y.uniformMap=c,y.pass=f,l(e._depthFailAppearance)&&(r&&(++m,y=o[m],l(y)||(y=o[m]=new at({owner:e,primitiveType:e._primitiveType})),y.vertexArray=e._va[g],y.renderState=e._backFaceDepthFailRS,y.shaderProgram=e._spDepthFail,y.uniformMap=u,y.pass=f),++m,y=o[m],l(y)||(y=o[m]=new at({owner:e,primitiveType:e._primitiveType})),y.vertexArray=e._va[g],y.renderState=e._frontFaceDepthFailRS,y.shaderProgram=e._spDepthFail,y.uniformMap=u,y.pass=f),++g}}os._updateBoundingVolumes=function(e,t,n,i){let r,o,s;if(i||!N.equals(n,e._modelMatrix))for(N.clone(n,e._modelMatrix),o=e._boundingSpheres.length,r=0;r<o;++r)s=e._boundingSpheres[r],l(s)&&(e._boundingSphereWC[r]=ue.transform(s,n,e._boundingSphereWC[r]),t.scene3DOnly||(e._boundingSphere2D[r]=ue.clone(e._boundingSphereCV[r],e._boundingSphere2D[r]),e._boundingSphereMorph[r]=ue.union(e._boundingSphereWC[r],e._boundingSphereCV[r])));let a=e.appearance.pixelSize;if(l(a))for(o=e._boundingSpheres.length,r=0;r<o;++r){s=e._boundingSpheres[r];let c=e._boundingSphereWC[r],f=t.camera.getPixelSize(s,t.context.drawingBufferWidth,t.context.drawingBufferHeight)*a;c.radius=s.radius+f}};function u5e(e,t,n,i,r,o,s,a){os._updateBoundingVolumes(e,t,r);let c;t.mode===re.SCENE3D?c=e._boundingSphereWC:t.mode===re.COLUMBUS_VIEW?c=e._boundingSphereCV:t.mode===re.SCENE2D&&l(e._boundingSphere2D)?c=e._boundingSphere2D:l(e._boundingSphereMorph)&&(c=e._boundingSphereMorph);let u=t.commandList,f=t.passes;if(f.render||f.pick){let d=e.allowPicking,p=Pn.castShadows(e.shadows),g=Pn.receiveShadows(e.shadows),m=n.length,y=a?2:1;y*=l(e._depthFailAppearance)?2:1;for(let A=0;A<m;++A){let b=Math.floor(A/y),x=n[A];x.modelMatrix=r,x.boundingVolume=c[b],x.cull=o,x.debugShowBoundingVolume=s,x.castShadows=p,x.receiveShadows=g,d?x.pickId="v_pickColor":x.pickId=void 0,u.push(x)}}}os.prototype.update=function(e){if(!l(this.geometryInstances)&&this._va.length===0||l(this.geometryInstances)&&Array.isArray(this.geometryInstances)&&this.geometryInstances.length===0||!l(this.appearance)||e.mode!==re.SCENE3D&&e.scene3DOnly||!e.passes.render&&!e.passes.pick)return;if(l(this._error))throw this._error;if(this._state===rs.FAILED)return;let t=e.context;if(l(this._batchTable)||qGe(this,t),this._batchTable.attributes.length>0){if(kt.maximumVertexTextureImageUnits===0)throw new oe("Vertex texture fetch support is required to render primitives with per-instance attributes. The maximum number of vertex texture image units must be greater than zero.");this._batchTable.update(e)}if(this._state!==rs.COMPLETE&&this._state!==rs.COMBINED&&(this.asynchronous?t5e(this,e):n5e(this,e)),this._state===rs.COMBINED&&(r5e(this,e),Bme(this,e),s5e(this,e)),!this.show||this._state!==rs.COMPLETE)return;this._batchTableOffsetsUpdated||Bme(this,e),this._recomputeBoundingSpheres&&i5e(this,e);let n=this.appearance,i=n.material,r=!1,o=!1;this._appearance!==n?(this._appearance=n,this._material=i,r=!0,o=!0):this._material!==i&&(this._material=i,o=!0);let s=this.depthFailAppearance,a=l(s)?s.material:void 0;this._depthFailAppearance!==s?(this._depthFailAppearance=s,this._depthFailMaterial=a,r=!0,o=!0):this._depthFailMaterial!==a&&(this._depthFailMaterial=a,o=!0);let c=this._appearance.isTranslucent();this._translucent!==c&&(this._translucent=c,r=!0),l(this._material)&&this._material.update(t);let u=n.closed&&c;r&&(this._createRenderStatesFunction??a5e)(this,t,n,u),o&&(this._createShaderProgramFunction??c5e)(this,e,n),(r||o)&&(this._createCommandsFunction??l5e)(this,n,i,c,u,this._colorCommands,this._pickCommands,e),(this._updateAndQueueCommandsFunction??u5e)(this,e,this._colorCommands,this._pickCommands,this.modelMatrix,this.cull,this.debugShowBoundingVolume,u)};var f5e=new ue,d5e=new ue;function Wme(e,t,n){if(n===mn.TOP){let i=ue.clone(e,f5e),r=ue.clone(e,d5e);r.center=h.add(r.center,t,r.center),e=ue.union(i,r,e)}else n===mn.ALL&&(e.center=h.add(e.center,t,e.center));return e}function h5e(e,t,n){return function(){let i=e.getBatchedAttribute(t,n),r=e.attributes[n],o=r.componentsPerAttribute,s=Y.createTypedArray(r.componentDatatype,o);return l(i.constructor.pack)?i.constructor.pack(i,s,0):s[0]=i,s}}function m5e(e,t,n,i,r){return function(o){let s=Vme(o);e.setBatchedAttribute(t,n,s),r==="offset"&&(i._recomputeBoundingSpheres=!0,i._batchTableOffsetsUpdated=!1)}}var p5e=new h;function g5e(e,t,n){t.boundingSphere={get:function(){let i=e._instanceBoundingSpheres[n];if(l(i)){i=i.clone();let r=e.modelMatrix,o=t.offset;l(o)&&Wme(i,h.fromArray(o.get(),0,p5e),e._offsetInstanceExtend[n]),l(r)&&(i=ue.transform(i,r))}return i}},t.boundingSphereCV={get:function(){return e._instanceBoundingSpheresCV[n]}}}function _5e(e,t,n){t.pickId={get:function(){return e._pickIds[n]}}}os.prototype.getGeometryInstanceAttributes=function(e){let t=this._perInstanceAttributeCache.get(e);if(l(t))return t;let n=-1,i=this._lastPerInstanceAttributeIndex,r=this._instanceIds,o=r.length;for(let u=0;u<o;++u){let f=(i+u)%o;if(e===r[f]){n=f;break}}if(n===-1)return;let s=this._batchTable,a=this._batchTableAttributeIndices;t={};let c={};for(let u in a)if(a.hasOwnProperty(u)){let f=a[u];c[u]={get:h5e(s,n,f),set:m5e(s,n,f,this,u)}}return g5e(this,c,n),_5e(this,c,n),Object.defineProperties(t,c),this._lastPerInstanceAttributeIndex=n,this._perInstanceAttributeCache.set(e,t),t};os.prototype.isDestroyed=function(){return!1};os.prototype.destroy=function(){let e,t;this._sp=this._sp&&this._sp.destroy(),this._spDepthFail=this._spDepthFail&&this._spDepthFail.destroy();let n=this._va;for(e=n.length,t=0;t<e;++t)n[t].destroy();this._va=void 0;let i=this._pickIds;for(e=i.length,t=0;t<e;++t)i[t].destroy();return this._pickIds=void 0,this._batchTable=this._batchTable&&this._batchTable.destroy(),this._instanceIds=void 0,this._perInstanceAttributeCache=void 0,this._attributeLocations=void 0,le(this)};function cN(e,t,n,i){e._error=i,e._state=n,t.afterRender.push(function(){return e._ready=e._state===rs.COMPLETE||e._state===rs.FAILED,!0})}var On=os;var qme={NEVER:te.NEVER,LESS:te.LESS,EQUAL:te.EQUAL,LESS_OR_EQUAL:te.LEQUAL,GREATER:te.GREATER,NOT_EQUAL:te.NOTEQUAL,GREATER_OR_EQUAL:te.GEQUAL,ALWAYS:te.ALWAYS};Object.freeze(qme);var ei=qme;var Yme={ZERO:te.ZERO,KEEP:te.KEEP,REPLACE:te.REPLACE,INCREMENT:te.INCR,DECREMENT:te.DECR,INVERT:te.INVERT,INCREMENT_WRAP:te.INCR_WRAP,DECREMENT_WRAP:te.DECR_WRAP};Object.freeze(Yme);var Rt=Yme;var E6={CESIUM_3D_TILE_MASK:128,SKIP_LOD_MASK:112,SKIP_LOD_BIT_SHIFT:4,CLASSIFICATION_MASK:15};E6.setCesium3DTileBit=function(){return{enabled:!0,frontFunction:ei.ALWAYS,frontOperation:{fail:Rt.KEEP,zFail:Rt.KEEP,zPass:Rt.REPLACE},backFunction:ei.ALWAYS,backOperation:{fail:Rt.KEEP,zFail:Rt.KEEP,zPass:Rt.REPLACE},reference:E6.CESIUM_3D_TILE_MASK,mask:E6.CESIUM_3D_TILE_MASK}};var Yt=Object.freeze(E6);function xg(e){e=e??H.EMPTY_OBJECT,this.geometryInstances=e.geometryInstances,this._hasPerInstanceColors=!0;let t=e.appearance;l(t)||(t=new ac),this.appearance=t,this.show=e.show??!0,this.classificationType=e.classificationType??Qn.BOTH,this.debugShowBoundingVolume=e.debugShowBoundingVolume??!1,this._debugShowShadowVolume=e.debugShowShadowVolume??!1,this._primitiveOptions={geometryInstances:void 0,appearance:void 0,vertexCacheOptimize:!1,interleave:e.interleave??!1,releaseGeometryInstances:e.releaseGeometryInstances??!0,allowPicking:e.allowPicking??!0,asynchronous:e.asynchronous??!0,compressVertices:!1,_createShaderProgramFunction:void 0,_createCommandsFunction:void 0,_updateAndQueueCommandsFunction:void 0},this._zIndex=void 0,this._ready=!1,this._primitive=void 0,this._sp=void 0,this._sp2D=void 0,this._spMorph=void 0,this._renderState=Xme(!1),this._renderState3DTiles=Xme(!0),this._renderStateMorph=Ge.fromCache({cull:{enabled:!0,face:zi.FRONT},depthTest:{enabled:!0},blending:tn.PRE_MULTIPLIED_ALPHA_BLEND,depthMask:!1})}Object.defineProperties(xg.prototype,{interleave:{get:function(){return this._primitiveOptions.interleave}},releaseGeometryInstances:{get:function(){return this._primitiveOptions.releaseGeometryInstances}},allowPicking:{get:function(){return this._primitiveOptions.allowPicking}},asynchronous:{get:function(){return this._primitiveOptions.asynchronous}},ready:{get:function(){return this._ready}},debugShowShadowVolume:{get:function(){return this._debugShowShadowVolume}}});xg.initializeTerrainHeights=function(){return Mi.initialize()};function y5e(e,t,n){let i=t.context,r=e._primitive,o=r._attributeLocations,s=r._batchTable.getVertexShaderCallback()(dM);s=On._appendShowToShader(r,s),s=On._appendDistanceDisplayConditionToShader(r,s),s=On._modifyShaderPosition(e,s,t.scene3DOnly);let a=r._batchTable.getVertexShaderCallback()(fM);a=On._appendShowToShader(r,a),a=On._appendDistanceDisplayConditionToShader(r,a),a=On._modifyShaderPosition(e,a,t.scene3DOnly);let c=r._batchTable.getVertexShaderCallback()(lM),u=[`GLOBE_MINIMUM_ALTITUDE ${t.mapProjection.ellipsoid.minimumRadius.toFixed(1)}`],f="",d="";l(n.material)?(d=l(n.material)?n.material.shaderSource:"",d.search(/in\s+float\s+v_polylineAngle;/g)!==-1&&u.push("ANGLE_VARYING"),d.search(/in\s+float\s+v_width;/g)!==-1&&u.push("WIDTH_VARYING")):f="PER_INSTANCE_COLOR",u.push(f);let p=e.debugShowShadowVolume?["DEBUG_SHOW_VOLUME",f]:[f],g=new Ye({defines:u,sources:[s]}),m=new Ye({defines:p,sources:[d,c]});e._sp=Qt.replaceCache({context:i,shaderProgram:r._sp,vertexShaderSource:g,fragmentShaderSource:m,attributeLocations:o});let y=i.shaderCache.getDerivedShaderProgram(e._sp,"2dColor");if(!l(y)){let b=new Ye({defines:u.concat(["COLUMBUS_VIEW_2D"]),sources:[s]});y=i.shaderCache.createDerivedShaderProgram(e._sp,"2dColor",{context:i,shaderProgram:e._sp2D,vertexShaderSource:b,fragmentShaderSource:m,attributeLocations:o})}e._sp2D=y;let A=i.shaderCache.getDerivedShaderProgram(e._sp,"MorphColor");if(!l(A)){let b=new Ye({defines:u.concat([`MAX_TERRAIN_HEIGHT ${Mi._defaultMaxTerrainHeight.toFixed(1)}`]),sources:[a]});c=r._batchTable.getVertexShaderCallback()(uM);let x=new Ye({defines:p,sources:[d,c]});A=i.shaderCache.createDerivedShaderProgram(e._sp,"MorphColor",{context:i,shaderProgram:e._spMorph,vertexShaderSource:b,fragmentShaderSource:x,attributeLocations:o})}e._spMorph=A}function Xme(e){return Ge.fromCache({cull:{enabled:!0},blending:tn.PRE_MULTIPLIED_ALPHA_BLEND,depthMask:!1,stencilTest:{enabled:e,frontFunction:ei.EQUAL,frontOperation:{fail:Rt.KEEP,zFail:Rt.KEEP,zPass:Rt.KEEP},backFunction:ei.EQUAL,backOperation:{fail:Rt.KEEP,zFail:Rt.KEEP,zPass:Rt.KEEP},reference:Yt.CESIUM_3D_TILE_MASK,mask:Yt.CESIUM_3D_TILE_MASK}})}function A5e(e,t,n,i,r,o){let s=e._primitive,a=s._va.length;r.length=a,o.length=a;let u=t instanceof Vs?{}:n._uniforms,f=s._batchTable.getUniformMapCallback()(u);for(let d=0;d<a;d++){let p=s._va[d],g=r[d];l(g)||(g=r[d]=new at({owner:e,primitiveType:s._primitiveType})),g.vertexArray=p,g.renderState=e._renderState,g.shaderProgram=e._sp,g.uniformMap=f,g.pass=Ie.TERRAIN_CLASSIFICATION,g.pickId="czm_batchTable_pickColor(v_endPlaneNormalEcAndBatchId.w)";let m=at.shallowClone(g,g.derivedCommands.tileset);m.renderState=e._renderState3DTiles,m.pass=Ie.CESIUM_3D_TILE_CLASSIFICATION,g.derivedCommands.tileset=m;let y=at.shallowClone(g,g.derivedCommands.color2D);y.shaderProgram=e._sp2D,g.derivedCommands.color2D=y;let A=at.shallowClone(m,m.derivedCommands.color2D);A.shaderProgram=e._sp2D,m.derivedCommands.color2D=A;let b=at.shallowClone(g,g.derivedCommands.colorMorph);b.renderState=e._renderStateMorph,b.shaderProgram=e._spMorph,b.pickId="czm_batchTable_pickColor(v_batchId)",g.derivedCommands.colorMorph=b}}function Kme(e,t,n,i,r,o,s){n.mode===re.MORPHING?t=t.derivedCommands.colorMorph:n.mode!==re.SCENE3D&&(t=t.derivedCommands.color2D),t.modelMatrix=i,t.boundingVolume=o,t.cull=r,t.debugShowBoundingVolume=s,n.commandList.push(t)}function b5e(e,t,n,i,r,o,s){let a=e._primitive;On._updateBoundingVolumes(a,t,r);let c;t.mode===re.SCENE3D?c=a._boundingSphereWC:t.mode===re.COLUMBUS_VIEW?c=a._boundingSphereCV:t.mode===re.SCENE2D&&l(a._boundingSphere2D)?c=a._boundingSphere2D:l(a._boundingSphereMorph)&&(c=a._boundingSphereMorph);let u=t.mode===re.MORPHING,f=e.classificationType,d=f!==Qn.CESIUM_3D_TILE,p=f!==Qn.TERRAIN&&!u,g,m=t.passes;if(m.render||m.pick&&a.allowPicking){let y=n.length;for(let A=0;A<y;++A){let b=c[A];d&&(g=n[A],Kme(e,g,t,r,o,b,s)),p&&(g=n[A].derivedCommands.tileset,Kme(e,g,t,r,o,b,s))}}}xg.prototype.update=function(e){if(!l(this._primitive)&&!l(this.geometryInstances))return;if(!Mi.initialized){xg.initializeTerrainHeights();return}let t,n=this,i=this._primitiveOptions;if(!l(this._primitive)){let r=Array.isArray(this.geometryInstances)?this.geometryInstances:[this.geometryInstances],o=r.length,s=new Array(o),a;for(t=0;t<o;++t)if(a=r[t].attributes,!l(a)||!l(a.color)){this._hasPerInstanceColors=!1;break}for(t=0;t<o;++t){let c=r[t];a={};let u=c.attributes;for(let f in u)u.hasOwnProperty(f)&&(a[f]=u[f]);l(a.width)||(a.width=new Zc({componentDatatype:Y.UNSIGNED_BYTE,componentsPerAttribute:1,value:[c.geometry.width]})),c.geometry._scene3DOnly=e.scene3DOnly,vx.setProjectionAndEllipsoid(c.geometry,e.mapProjection),s[t]=new Ft({geometry:c.geometry,attributes:a,id:c.id,pickPrimitive:n})}i.geometryInstances=s,i.appearance=this.appearance,i._createShaderProgramFunction=function(c,u,f){y5e(n,u,f)},i._createCommandsFunction=function(c,u,f,d,p,g,m){A5e(n,u,f,d,g,m)},i._updateAndQueueCommandsFunction=function(c,u,f,d,p,g,m,y){b5e(n,u,f,d,p,g,m)},this._primitive=new On(i)}if(this.appearance instanceof Vs&&!this._hasPerInstanceColors)throw new pe("All GeometryInstances must have color attributes to use PolylineColorAppearance with GroundPolylinePrimitive.");this._primitive.appearance=this.appearance,this._primitive.show=this.show,this._primitive.debugShowBoundingVolume=this.debugShowBoundingVolume,this._primitive.update(e),e.afterRender.push(()=>{!this._ready&&l(this._primitive)&&this._primitive.ready&&(this._ready=!0,this.releaseGeometryInstances&&(this.geometryInstances=void 0))})};xg.prototype.getGeometryInstanceAttributes=function(e){return this._primitive.getGeometryInstanceAttributes(e)};xg.isSupported=function(e){return e.frameState.context.depthTexture};xg.prototype.isDestroyed=function(){return!1};xg.prototype.destroy=function(){return this._primitive=this._primitive&&this._primitive.destroy(),this._sp=this._sp&&this._sp.destroy(),this._sp2D=void 0,this._spMorph=void 0,le(this)};var Kh=xg;function lc(e,t,n){this.minimum=h.clone(e??h.ZERO),this.maximum=h.clone(t??h.ZERO),l(n)?n=h.clone(n):n=h.midpoint(this.minimum,this.maximum,new h),this.center=n}lc.fromCorners=function(e,t,n){return l(n)||(n=new lc),n.minimum=h.clone(e,n.minimum),n.maximum=h.clone(t,n.maximum),n.center=h.midpoint(e,t,n.center),n};lc.fromPoints=function(e,t){if(l(t)||(t=new lc),!l(e)||e.length===0)return t.minimum=h.clone(h.ZERO,t.minimum),t.maximum=h.clone(h.ZERO,t.maximum),t.center=h.clone(h.ZERO,t.center),t;let n=e[0].x,i=e[0].y,r=e[0].z,o=e[0].x,s=e[0].y,a=e[0].z,c=e.length;for(let d=1;d<c;d++){let p=e[d],g=p.x,m=p.y,y=p.z;n=Math.min(g,n),o=Math.max(g,o),i=Math.min(m,i),s=Math.max(m,s),r=Math.min(y,r),a=Math.max(y,a)}let u=t.minimum;u.x=n,u.y=i,u.z=r;let f=t.maximum;return f.x=o,f.y=s,f.z=a,t.center=h.midpoint(u,f,t.center),t};lc.clone=function(e,t){if(l(e))return l(t)?(t.minimum=h.clone(e.minimum,t.minimum),t.maximum=h.clone(e.maximum,t.maximum),t.center=h.clone(e.center,t.center),t):new lc(e.minimum,e.maximum,e.center)};lc.equals=function(e,t){return e===t||l(e)&&l(t)&&h.equals(e.center,t.center)&&h.equals(e.minimum,t.minimum)&&h.equals(e.maximum,t.maximum)};var C6=new h;lc.intersectPlane=function(e,t){C6=h.subtract(e.maximum,e.minimum,C6);let n=h.multiplyByScalar(C6,.5,C6),i=t.normal,r=n.x*Math.abs(i.x)+n.y*Math.abs(i.y)+n.z*Math.abs(i.z),o=h.dot(e.center,i)+t.distance;return o-r>0?$t.INSIDE:o+r<0?$t.OUTSIDE:$t.INTERSECTING};lc.intersectAxisAlignedBoundingBox=function(e,t){return e.minimum.x<=t.maximum.x&&e.maximum.x>=t.minimum.x&&e.minimum.y<=t.maximum.y&&e.maximum.y>=t.minimum.y&&e.minimum.z<=t.maximum.z&&e.maximum.z>=t.minimum.z};lc.prototype.clone=function(e){return lc.clone(this,e)};lc.prototype.intersectPlane=function(e){return lc.intersectPlane(this,e)};lc.prototype.intersectAxisAlignedBoundingBox=function(e){return lc.intersectAxisAlignedBoundingBox(this,e)};lc.prototype.equals=function(e){return lc.equals(this,e)};var wf=lc;var pK=new se;function Bp(e,t){t=t??ee.default,e=t.scaleToGeodeticSurface(e);let n=At.eastNorthUpToFixedFrame(e,t);this._ellipsoid=t,this._origin=e,this._xAxis=h.fromCartesian4(N.getColumn(n,0,pK)),this._yAxis=h.fromCartesian4(N.getColumn(n,1,pK));let i=h.fromCartesian4(N.getColumn(n,2,pK));this._plane=sn.fromPointNormal(e,i)}Object.defineProperties(Bp.prototype,{ellipsoid:{get:function(){return this._ellipsoid}},origin:{get:function(){return this._origin}},plane:{get:function(){return this._plane}},xAxis:{get:function(){return this._xAxis}},yAxis:{get:function(){return this._yAxis}},zAxis:{get:function(){return this._plane.normal}}});var x5e=new wf;Bp.fromPoints=function(e,t){let n=wf.fromPoints(e,x5e);return new Bp(n.center,t)};var $me=new pn,v6=new h;Bp.prototype.projectPointOntoPlane=function(e,t){let n=$me;n.origin=e,h.normalize(e,n.direction);let i=_i.rayPlane(n,this._plane,v6);if(l(i)||(h.negate(n.direction,n.direction),i=_i.rayPlane(n,this._plane,v6)),l(i)){let r=h.subtract(i,this._origin,i),o=h.dot(this._xAxis,r),s=h.dot(this._yAxis,r);return l(t)?(t.x=o,t.y=s,t):new U(o,s)}};Bp.prototype.projectPointsOntoPlane=function(e,t){l(t)||(t=[]);let n=0,i=e.length;for(let r=0;r<i;r++){let o=this.projectPointOntoPlane(e[r],t[n]);l(o)&&(t[n]=o,n++)}return t.length=n,t};Bp.prototype.projectPointToNearestOnPlane=function(e,t){l(t)||(t=new U);let n=$me;n.origin=e,h.clone(this._plane.normal,n.direction);let i=_i.rayPlane(n,this._plane,v6);l(i)||(h.negate(n.direction,n.direction),i=_i.rayPlane(n,this._plane,v6));let r=h.subtract(i,this._origin,i),o=h.dot(this._xAxis,r),s=h.dot(this._yAxis,r);return t.x=o,t.y=s,t};Bp.prototype.projectPointsToNearestOnPlane=function(e,t){l(t)||(t=[]);let n=e.length;t.length=n;for(let i=0;i<n;i++)t[i]=this.projectPointToNearestOnPlane(e[i],t[i]);return t};var T5e=new h;Bp.prototype.projectPointOntoEllipsoid=function(e,t){l(t)||(t=new h);let n=this._ellipsoid,i=this._origin,r=this._xAxis,o=this._yAxis,s=T5e;return h.multiplyByScalar(r,e.x,s),t=h.add(i,s,t),h.multiplyByScalar(o,e.y,s),h.add(t,s,t),n.scaleToGeocentricSurface(t,t),t};Bp.prototype.projectPointsOntoEllipsoid=function(e,t){let n=e.length;l(t)?t.length=n:t=new Array(n);for(let i=0;i<n;++i)t[i]=this.projectPointOntoEllipsoid(e[i],t[i]);return t};var js=Bp;function fr(e,t){this.center=h.clone(e??h.ZERO),this.halfAxes=$.clone(t??$.ZERO)}fr.packedLength=h.packedLength+$.packedLength;fr.pack=function(e,t,n){return n=n??0,h.pack(e.center,t,n),$.pack(e.halfAxes,t,n+h.packedLength),t};fr.unpack=function(e,t,n){return t=t??0,l(n)||(n=new fr),h.unpack(e,t,n.center),$.unpack(e,t+h.packedLength,n.halfAxes),n};var E5e=new h,C5e=new h,v5e=new h,S5e=new h,w5e=new h,I5e=new h,P5e=new $,D5e={unitary:new $,diagonal:new $};fr.fromPoints=function(e,t){if(l(t)||(t=new fr),!l(e)||e.length===0)return t.halfAxes=$.ZERO,t.center=h.ZERO,t;let n,i=e.length,r=h.clone(e[0],E5e);for(n=1;n<i;n++)h.add(r,e[n],r);let o=1/i;h.multiplyByScalar(r,o,r);let s=0,a=0,c=0,u=0,f=0,d=0,p;for(n=0;n<i;n++)p=h.subtract(e[n],r,C5e),s+=p.x*p.x,a+=p.x*p.y,c+=p.x*p.z,u+=p.y*p.y,f+=p.y*p.z,d+=p.z*p.z;s*=o,a*=o,c*=o,u*=o,f*=o,d*=o;let g=P5e;g[0]=s,g[1]=a,g[2]=c,g[3]=a,g[4]=u,g[5]=f,g[6]=c,g[7]=f,g[8]=d;let m=$.computeEigenDecomposition(g,D5e),y=$.clone(m.unitary,t.halfAxes),A=$.getColumn(y,0,S5e),b=$.getColumn(y,1,w5e),x=$.getColumn(y,2,I5e),T=-Number.MAX_VALUE,E=-Number.MAX_VALUE,v=-Number.MAX_VALUE,S=Number.MAX_VALUE,I=Number.MAX_VALUE,R=Number.MAX_VALUE;for(n=0;n<i;n++)p=e[n],T=Math.max(h.dot(A,p),T),E=Math.max(h.dot(b,p),E),v=Math.max(h.dot(x,p),v),S=Math.min(h.dot(A,p),S),I=Math.min(h.dot(b,p),I),R=Math.min(h.dot(x,p),R);A=h.multiplyByScalar(A,.5*(S+T),A),b=h.multiplyByScalar(b,.5*(I+E),b),x=h.multiplyByScalar(x,.5*(R+v),x);let O=h.add(A,b,t.center);h.add(O,x,O);let L=v5e;return L.x=T-S,L.y=E-I,L.z=v-R,h.multiplyByScalar(L,.5,L),$.multiplyByScale(t.halfAxes,L,t.halfAxes),t};var npe=new h,R5e=new h;function Jme(e,t,n,i,r,o,s,a,c,u,f){l(f)||(f=new fr);let d=f.halfAxes;$.setColumn(d,0,t,d),$.setColumn(d,1,n,d),$.setColumn(d,2,i,d);let p=npe;p.x=(r+o)/2,p.y=(s+a)/2,p.z=(c+u)/2;let g=R5e;g.x=(o-r)/2,g.y=(a-s)/2,g.z=(u-c)/2;let m=f.center;return p=$.multiplyByVector(d,p,p),h.add(e,p,m),$.multiplyByScale(d,g,d),f}var Zme=new he,O5e=new h,M5e=new he,N5e=new he,L5e=new he,F5e=new he,B5e=new he,k5e=new h,Qme=new h,U5e=new h,epe=new h,z5e=new h,V5e=new U,j5e=new U,H5e=new U,G5e=new U,W5e=new U,q5e=new h,Y5e=new h,X5e=new h,K5e=new h,$5e=new U,J5e=new h,Z5e=new h,Q5e=new h,e9e=new sn(h.UNIT_X,0);fr.fromRectangle=function(e,t,n,i,r){t=t??0,n=n??0,i=i??ee.default;let o,s,a,c,u,f,d;if(e.width<=D.PI){let I=ie.center(e,Zme),R=i.cartographicToCartesian(I,O5e),O=new js(R,i);d=O.plane;let L=I.longitude,_=e.south<0&&e.north>0?0:I.latitude,C=he.fromRadians(L,e.north,n,M5e),w=he.fromRadians(e.west,e.north,n,N5e),P=he.fromRadians(e.west,_,n,L5e),M=he.fromRadians(e.west,e.south,n,F5e),F=he.fromRadians(L,e.south,n,B5e),V=i.cartographicToCartesian(C,k5e),B=i.cartographicToCartesian(w,Qme),j=i.cartographicToCartesian(P,U5e),k=i.cartographicToCartesian(M,epe),G=i.cartographicToCartesian(F,z5e),q=O.projectPointToNearestOnPlane(V,V5e),Q=O.projectPointToNearestOnPlane(B,j5e),W=O.projectPointToNearestOnPlane(j,H5e),J=O.projectPointToNearestOnPlane(k,G5e),Z=O.projectPointToNearestOnPlane(G,W5e);return o=Math.min(Q.x,W.x,J.x),s=-o,c=Math.max(Q.y,q.y),a=Math.min(J.y,Z.y),w.height=M.height=t,B=i.cartographicToCartesian(w,Qme),k=i.cartographicToCartesian(M,epe),u=Math.min(sn.getPointDistance(d,B),sn.getPointDistance(d,k)),f=n,Jme(O.origin,O.xAxis,O.yAxis,O.zAxis,o,s,a,c,u,f,r)}let p=e.south>0,g=e.north<0,m=p?e.south:g?e.north:0,y=ie.center(e,Zme).longitude,A=h.fromRadians(y,m,n,i,q5e);A.z=0;let x=Math.abs(A.x)<D.EPSILON10&&Math.abs(A.y)<D.EPSILON10?h.UNIT_X:h.normalize(A,Y5e),T=h.UNIT_Z,E=h.cross(x,T,X5e);d=sn.fromPointNormal(A,x,e9e);let v=h.fromRadians(y+D.PI_OVER_TWO,m,n,i,K5e);s=h.dot(sn.projectPointOntoPlane(d,v,$5e),E),o=-s,c=h.fromRadians(0,e.north,g?t:n,i,J5e).z,a=h.fromRadians(0,e.south,p?t:n,i,Z5e).z;let S=h.fromRadians(e.east,m,n,i,Q5e);return u=sn.getPointDistance(d,S),f=0,Jme(A,E,T,x,o,s,a,c,u,f,r)};fr.fromTransformation=function(e,t){return l(t)||(t=new fr),t.center=N.getTranslation(e,t.center),t.halfAxes=N.getMatrix3(e,t.halfAxes),t.halfAxes=$.multiplyByScalar(t.halfAxes,.5,t.halfAxes),t};fr.clone=function(e,t){if(l(e))return l(t)?(h.clone(e.center,t.center),$.clone(e.halfAxes,t.halfAxes),t):new fr(e.center,e.halfAxes)};fr.intersectPlane=function(e,t){let n=e.center,i=t.normal,r=e.halfAxes,o=i.x,s=i.y,a=i.z,c=Math.abs(o*r[$.COLUMN0ROW0]+s*r[$.COLUMN0ROW1]+a*r[$.COLUMN0ROW2])+Math.abs(o*r[$.COLUMN1ROW0]+s*r[$.COLUMN1ROW1]+a*r[$.COLUMN1ROW2])+Math.abs(o*r[$.COLUMN2ROW0]+s*r[$.COLUMN2ROW1]+a*r[$.COLUMN2ROW2]),u=h.dot(i,n)+t.distance;return u<=-c?$t.OUTSIDE:u>=c?$t.INSIDE:$t.INTERSECTING};var ipe=new h,rpe=new h,ope=new h,t9e=new h,tpe=new h,n9e=new h;fr.distanceSquaredTo=function(e,t){let n=h.subtract(t,e.center,npe),i=e.halfAxes,r=$.getColumn(i,0,ipe),o=$.getColumn(i,1,rpe),s=$.getColumn(i,2,ope),a=h.magnitude(r),c=h.magnitude(o),u=h.magnitude(s),f=!0,d=!0,p=!0;a>0?h.divideByScalar(r,a,r):f=!1,c>0?h.divideByScalar(o,c,o):d=!1,u>0?h.divideByScalar(s,u,s):p=!1;let g=!f+!d+!p,m,y,A;if(g===1){let E=r;m=o,y=s,d?p||(E=s,y=r):(E=o,m=r),A=h.cross(m,y,tpe),E===r?r=A:E===o?o=A:E===s&&(s=A)}else if(g===2){m=r,d?m=o:p&&(m=s);let E=h.UNIT_Y;E.equalsEpsilon(m,D.EPSILON3)&&(E=h.UNIT_X),y=h.cross(m,E,t9e),h.normalize(y,y),A=h.cross(m,y,tpe),h.normalize(A,A),m===r?(o=y,s=A):m===o?(s=y,r=A):m===s&&(r=y,o=A)}else g===3&&(r=h.UNIT_X,o=h.UNIT_Y,s=h.UNIT_Z);let b=n9e;b.x=h.dot(n,r),b.y=h.dot(n,o),b.z=h.dot(n,s);let x=0,T;return b.x<-a?(T=b.x+a,x+=T*T):b.x>a&&(T=b.x-a,x+=T*T),b.y<-c?(T=b.y+c,x+=T*T):b.y>c&&(T=b.y-c,x+=T*T),b.z<-u?(T=b.z+u,x+=T*T):b.z>u&&(T=b.z-u,x+=T*T),x};var i9e=new h,r9e=new h;fr.computePlaneDistances=function(e,t,n,i){l(i)||(i=new Us);let r=Number.POSITIVE_INFINITY,o=Number.NEGATIVE_INFINITY,s=e.center,a=e.halfAxes,c=$.getColumn(a,0,ipe),u=$.getColumn(a,1,rpe),f=$.getColumn(a,2,ope),d=h.add(c,u,i9e);h.add(d,f,d),h.add(d,s,d);let p=h.subtract(d,t,r9e),g=h.dot(n,p);return r=Math.min(g,r),o=Math.max(g,o),h.add(s,c,d),h.add(d,u,d),h.subtract(d,f,d),h.subtract(d,t,p),g=h.dot(n,p),r=Math.min(g,r),o=Math.max(g,o),h.add(s,c,d),h.subtract(d,u,d),h.add(d,f,d),h.subtract(d,t,p),g=h.dot(n,p),r=Math.min(g,r),o=Math.max(g,o),h.add(s,c,d),h.subtract(d,u,d),h.subtract(d,f,d),h.subtract(d,t,p),g=h.dot(n,p),r=Math.min(g,r),o=Math.max(g,o),h.subtract(s,c,d),h.add(d,u,d),h.add(d,f,d),h.subtract(d,t,p),g=h.dot(n,p),r=Math.min(g,r),o=Math.max(g,o),h.subtract(s,c,d),h.add(d,u,d),h.subtract(d,f,d),h.subtract(d,t,p),g=h.dot(n,p),r=Math.min(g,r),o=Math.max(g,o),h.subtract(s,c,d),h.subtract(d,u,d),h.add(d,f,d),h.subtract(d,t,p),g=h.dot(n,p),r=Math.min(g,r),o=Math.max(g,o),h.subtract(s,c,d),h.subtract(d,u,d),h.subtract(d,f,d),h.subtract(d,t,p),g=h.dot(n,p),r=Math.min(g,r),o=Math.max(g,o),i.start=r,i.stop=o,i};var o9e=new h,s9e=new h,a9e=new h;fr.computeCorners=function(e,t){l(t)||(t=[new h,new h,new h,new h,new h,new h,new h,new h]);let n=e.center,i=e.halfAxes,r=$.getColumn(i,0,o9e),o=$.getColumn(i,1,s9e),s=$.getColumn(i,2,a9e);return h.clone(n,t[0]),h.subtract(t[0],r,t[0]),h.subtract(t[0],o,t[0]),h.subtract(t[0],s,t[0]),h.clone(n,t[1]),h.subtract(t[1],r,t[1]),h.subtract(t[1],o,t[1]),h.add(t[1],s,t[1]),h.clone(n,t[2]),h.subtract(t[2],r,t[2]),h.add(t[2],o,t[2]),h.subtract(t[2],s,t[2]),h.clone(n,t[3]),h.subtract(t[3],r,t[3]),h.add(t[3],o,t[3]),h.add(t[3],s,t[3]),h.clone(n,t[4]),h.add(t[4],r,t[4]),h.subtract(t[4],o,t[4]),h.subtract(t[4],s,t[4]),h.clone(n,t[5]),h.add(t[5],r,t[5]),h.subtract(t[5],o,t[5]),h.add(t[5],s,t[5]),h.clone(n,t[6]),h.add(t[6],r,t[6]),h.add(t[6],o,t[6]),h.subtract(t[6],s,t[6]),h.clone(n,t[7]),h.add(t[7],r,t[7]),h.add(t[7],o,t[7]),h.add(t[7],s,t[7]),t};var c9e=new $;fr.computeTransformation=function(e,t){l(t)||(t=new N);let n=e.center,i=$.multiplyByUniformScale(e.halfAxes,2,c9e);return N.fromRotationTranslation(i,n,t)};var l9e=new ue;fr.isOccluded=function(e,t){let n=ue.fromOrientedBoundingBox(e,l9e);return!t.isBoundingSphereVisible(n)};fr.prototype.intersectPlane=function(e){return fr.intersectPlane(this,e)};fr.prototype.distanceSquaredTo=function(e){return fr.distanceSquaredTo(this,e)};fr.prototype.computePlaneDistances=function(e,t,n){return fr.computePlaneDistances(this,e,t,n)};fr.prototype.computeCorners=function(e){return fr.computeCorners(this,e)};fr.prototype.computeTransformation=function(e){return fr.computeTransformation(this,e)};fr.prototype.isOccluded=function(e){return fr.isOccluded(this,e)};fr.equals=function(e,t){return e===t||l(e)&&l(t)&&h.equals(e.center,t.center)&&$.equals(e.halfAxes,t.halfAxes)};fr.prototype.clone=function(e){return fr.clone(this,e)};fr.prototype.equals=function(e){return fr.equals(this,e)};var en=fr;var S6={};S6.getHeight=function(e,t,n){return(e-n)*t+n};var u9e=new he;S6.getPosition=function(e,t,n,i,r){let o=t.cartesianToCartographic(e,u9e);if(!l(o))return h.clone(e,r);let s=S6.getHeight(o.height,n,i);return h.fromRadians(o.longitude,o.latitude,s,t,r)};var Ar=S6;function Lv(e,t,n,i){e=e??1,t=t??1,n=n??1,i=i??1,this.value=new Uint8Array([z.floatToByte(e),z.floatToByte(t),z.floatToByte(n),z.floatToByte(i)])}Object.defineProperties(Lv.prototype,{componentDatatype:{get:function(){return Y.UNSIGNED_BYTE}},componentsPerAttribute:{get:function(){return 4}},normalize:{get:function(){return!0}}});Lv.fromColor=function(e){return new Lv(e.red,e.green,e.blue,e.alpha)};Lv.toValue=function(e,t){return l(t)?e.toBytes(t):new Uint8Array(e.toBytes())};Lv.equals=function(e,t){return e===t||l(e)&&l(t)&&e.value[0]===t.value[0]&&e.value[1]===t.value[1]&&e.value[2]===t.value[2]&&e.value[3]===t.value[3]};var Jt=Lv;var lN=`in vec3 v_positionEC; +in vec3 v_normalEC; +in vec4 v_color; +void main() +{ +vec3 positionToEyeEC = -v_positionEC; +vec3 normalEC = normalize(v_normalEC); +#ifdef FACE_FORWARD +normalEC = faceforward(normalEC, vec3(0.0, 0.0, 1.0), -normalEC); +#endif +vec4 color = czm_gammaCorrect(v_color); +czm_materialInput materialInput; +materialInput.normalEC = normalEC; +materialInput.positionToEyeEC = positionToEyeEC; +czm_material material = czm_getDefaultMaterial(materialInput); +material.diffuse = color.rgb; +material.alpha = color.a; +out_FragColor = czm_phong(normalize(positionToEyeEC), material, czm_lightDirectionEC); +} +`;var uN=`in vec3 position3DHigh; in vec3 position3DLow; -in vec3 prevPosition3DHigh; -in vec3 prevPosition3DLow; -in vec3 nextPosition3DHigh; -in vec3 nextPosition3DLow; -in vec2 expandAndWidth; +in vec3 normal; in vec4 color; in float batchId; +out vec3 v_positionEC; +out vec3 v_normalEC; out vec4 v_color; void main() { -float expandDir = expandAndWidth.x; -float width = abs(expandAndWidth.y) + 0.5; -bool usePrev = expandAndWidth.y < 0.0; vec4 p = czm_computePosition(); -vec4 prev = czm_computePrevPosition(); -vec4 next = czm_computeNextPosition(); -float angle; -vec4 positionWC = getPolylineWindowCoordinates(p, prev, next, expandDir, width, usePrev, angle); -gl_Position = czm_viewportOrthographic * positionWC; +v_positionEC = (czm_modelViewRelativeToEye * p).xyz; +v_normalEC = czm_normal * normal; v_color = color; +gl_Position = czm_modelViewProjectionRelativeToEye * p; } -`;var u7e=`#define CLIP_POLYLINE -${Wl} -${AN}`,f7e=Sx;function Ox(e){e=e??H.EMPTY_OBJECT;let t=e.translucent??!0,n=!1,i=Ox.VERTEX_FORMAT;this.material=void 0,this.translucent=t,this._vertexShaderSource=e.vertexShaderSource??u7e,this._fragmentShaderSource=e.fragmentShaderSource??f7e,this._renderState=wr.getDefaultRenderState(t,n,e.renderState),this._closed=n,this._vertexFormat=i}Object.defineProperties(Ox.prototype,{vertexShaderSource:{get:function(){return this._vertexShaderSource}},fragmentShaderSource:{get:function(){return this._fragmentShaderSource}},renderState:{get:function(){return this._renderState}},closed:{get:function(){return this._closed}},vertexFormat:{get:function(){return this._vertexFormat}}});Ox.VERTEX_FORMAT=Be.POSITION_ONLY;Ox.prototype.getFragmentShaderSource=wr.prototype.getFragmentShaderSource;Ox.prototype.isTranslucent=wr.prototype.isTranslucent;Ox.prototype.getRenderState=wr.prototype.getRenderState;var js=Ox;var bN=`in vec3 position3DHigh; +`;var fN=`in vec3 position3DHigh; in vec3 position3DLow; -in vec3 prevPosition3DHigh; -in vec3 prevPosition3DLow; -in vec3 nextPosition3DHigh; -in vec3 nextPosition3DLow; -in vec2 expandAndWidth; -in vec2 st; +in vec4 color; in float batchId; -out float v_width; -out vec2 v_st; -out float v_polylineAngle; +out vec4 v_color; void main() { -float expandDir = expandAndWidth.x; -float width = abs(expandAndWidth.y) + 0.5; -bool usePrev = expandAndWidth.y < 0.0; vec4 p = czm_computePosition(); -vec4 prev = czm_computePrevPosition(); -vec4 next = czm_computeNextPosition(); -float angle; -vec4 positionWC = getPolylineWindowCoordinates(p, prev, next, expandDir, width, usePrev, angle); -gl_Position = czm_viewportOrthographic * positionWC; -v_width = width; -v_st.s = st.s; -v_st.t = czm_writeNonPerspective(st.t, gl_Position.w); -v_polylineAngle = angle; +v_color = color; +gl_Position = czm_modelViewProjectionRelativeToEye * p; } -`;var d7e=`#define CLIP_POLYLINE -${Wl} -${bN}`,h7e=Cx;function Mx(e){e=e??H.EMPTY_OBJECT;let t=e.translucent??!0,n=!1,i=Mx.VERTEX_FORMAT;this.material=l(e.material)?e.material:Qi.fromType(Qi.ColorType),this.translucent=t,this._vertexShaderSource=e.vertexShaderSource??d7e,this._fragmentShaderSource=e.fragmentShaderSource??h7e,this._renderState=wr.getDefaultRenderState(t,n,e.renderState),this._closed=n,this._vertexFormat=i}Object.defineProperties(Mx.prototype,{vertexShaderSource:{get:function(){let e=this._vertexShaderSource;return this.material.shaderSource.search(/in\s+float\s+v_polylineAngle;/g)!==-1&&(e=`#define POLYLINE_DASH -${e}`),e}},fragmentShaderSource:{get:function(){return this._fragmentShaderSource}},renderState:{get:function(){return this._renderState}},closed:{get:function(){return this._closed}},vertexFormat:{get:function(){return this._vertexFormat}}});Mx.VERTEX_FORMAT=Be.POSITION_AND_ST;Mx.prototype.getFragmentShaderSource=wr.prototype.getFragmentShaderSource;Mx.prototype.isTranslucent=wr.prototype.isTranslucent;Mx.prototype.getRenderState=wr.prototype.getRenderState;var lc=Mx;function Cg(e){e=e??H.EMPTY_OBJECT,this.geometryInstances=e.geometryInstances,this._hasPerInstanceColors=!0;let t=e.appearance;l(t)||(t=new lc),this.appearance=t,this.show=e.show??!0,this.classificationType=e.classificationType??ei.BOTH,this.debugShowBoundingVolume=e.debugShowBoundingVolume??!1,this._debugShowShadowVolume=e.debugShowShadowVolume??!1,this._primitiveOptions={geometryInstances:void 0,appearance:void 0,vertexCacheOptimize:!1,interleave:e.interleave??!1,releaseGeometryInstances:e.releaseGeometryInstances??!0,allowPicking:e.allowPicking??!0,asynchronous:e.asynchronous??!0,compressVertices:!1,_createShaderProgramFunction:void 0,_createCommandsFunction:void 0,_updateAndQueueCommandsFunction:void 0},this._zIndex=void 0,this._ready=!1,this._primitive=void 0,this._sp=void 0,this._sp2D=void 0,this._spMorph=void 0,this._renderState=Ppe(!1),this._renderState3DTiles=Ppe(!0),this._renderStateMorph=Ge.fromCache({cull:{enabled:!0,face:Vi.FRONT},depthTest:{enabled:!0},blending:tn.PRE_MULTIPLIED_ALPHA_BLEND,depthMask:!1})}Object.defineProperties(Cg.prototype,{interleave:{get:function(){return this._primitiveOptions.interleave}},releaseGeometryInstances:{get:function(){return this._primitiveOptions.releaseGeometryInstances}},allowPicking:{get:function(){return this._primitiveOptions.allowPicking}},asynchronous:{get:function(){return this._primitiveOptions.asynchronous}},ready:{get:function(){return this._ready}},debugShowShadowVolume:{get:function(){return this._debugShowShadowVolume}}});Cg.initializeTerrainHeights=function(){return Mi.initialize()};function m7e(e,t,n){let i=t.context,r=e._primitive,o=r._attributeLocations,s=r._batchTable.getVertexShaderCallback()(dM);s=On._appendShowToShader(r,s),s=On._appendDistanceDisplayConditionToShader(r,s),s=On._modifyShaderPosition(e,s,t.scene3DOnly);let a=r._batchTable.getVertexShaderCallback()(fM);a=On._appendShowToShader(r,a),a=On._appendDistanceDisplayConditionToShader(r,a),a=On._modifyShaderPosition(e,a,t.scene3DOnly);let c=r._batchTable.getVertexShaderCallback()(lM),u=[`GLOBE_MINIMUM_ALTITUDE ${t.mapProjection.ellipsoid.minimumRadius.toFixed(1)}`],f="",d="";l(n.material)?(d=l(n.material)?n.material.shaderSource:"",d.search(/in\s+float\s+v_polylineAngle;/g)!==-1&&u.push("ANGLE_VARYING"),d.search(/in\s+float\s+v_width;/g)!==-1&&u.push("WIDTH_VARYING")):f="PER_INSTANCE_COLOR",u.push(f);let p=e.debugShowShadowVolume?["DEBUG_SHOW_VOLUME",f]:[f],g=new Ye({defines:u,sources:[s]}),m=new Ye({defines:p,sources:[d,c]});e._sp=Qt.replaceCache({context:i,shaderProgram:r._sp,vertexShaderSource:g,fragmentShaderSource:m,attributeLocations:o});let y=i.shaderCache.getDerivedShaderProgram(e._sp,"2dColor");if(!l(y)){let b=new Ye({defines:u.concat(["COLUMBUS_VIEW_2D"]),sources:[s]});y=i.shaderCache.createDerivedShaderProgram(e._sp,"2dColor",{context:i,shaderProgram:e._sp2D,vertexShaderSource:b,fragmentShaderSource:m,attributeLocations:o})}e._sp2D=y;let A=i.shaderCache.getDerivedShaderProgram(e._sp,"MorphColor");if(!l(A)){let b=new Ye({defines:u.concat([`MAX_TERRAIN_HEIGHT ${Mi._defaultMaxTerrainHeight.toFixed(1)}`]),sources:[a]});c=r._batchTable.getVertexShaderCallback()(uM);let x=new Ye({defines:p,sources:[d,c]});A=i.shaderCache.createDerivedShaderProgram(e._sp,"MorphColor",{context:i,shaderProgram:e._spMorph,vertexShaderSource:b,fragmentShaderSource:x,attributeLocations:o})}e._spMorph=A}function Ppe(e){return Ge.fromCache({cull:{enabled:!0},blending:tn.PRE_MULTIPLIED_ALPHA_BLEND,depthMask:!1,stencilTest:{enabled:e,frontFunction:ti.EQUAL,frontOperation:{fail:Rt.KEEP,zFail:Rt.KEEP,zPass:Rt.KEEP},backFunction:ti.EQUAL,backOperation:{fail:Rt.KEEP,zFail:Rt.KEEP,zPass:Rt.KEEP},reference:Yt.CESIUM_3D_TILE_MASK,mask:Yt.CESIUM_3D_TILE_MASK}})}function p7e(e,t,n,i,r,o){let s=e._primitive,a=s._va.length;r.length=a,o.length=a;let u=t instanceof js?{}:n._uniforms,f=s._batchTable.getUniformMapCallback()(u);for(let d=0;d<a;d++){let p=s._va[d],g=r[d];l(g)||(g=r[d]=new at({owner:e,primitiveType:s._primitiveType})),g.vertexArray=p,g.renderState=e._renderState,g.shaderProgram=e._sp,g.uniformMap=f,g.pass=Ie.TERRAIN_CLASSIFICATION,g.pickId="czm_batchTable_pickColor(v_endPlaneNormalEcAndBatchId.w)";let m=at.shallowClone(g,g.derivedCommands.tileset);m.renderState=e._renderState3DTiles,m.pass=Ie.CESIUM_3D_TILE_CLASSIFICATION,g.derivedCommands.tileset=m;let y=at.shallowClone(g,g.derivedCommands.color2D);y.shaderProgram=e._sp2D,g.derivedCommands.color2D=y;let A=at.shallowClone(m,m.derivedCommands.color2D);A.shaderProgram=e._sp2D,m.derivedCommands.color2D=A;let b=at.shallowClone(g,g.derivedCommands.colorMorph);b.renderState=e._renderStateMorph,b.shaderProgram=e._spMorph,b.pickId="czm_batchTable_pickColor(v_batchId)",g.derivedCommands.colorMorph=b}}function Dpe(e,t,n,i,r,o,s){n.mode===re.MORPHING?t=t.derivedCommands.colorMorph:n.mode!==re.SCENE3D&&(t=t.derivedCommands.color2D),t.modelMatrix=i,t.boundingVolume=o,t.cull=r,t.debugShowBoundingVolume=s,n.commandList.push(t)}function g7e(e,t,n,i,r,o,s){let a=e._primitive;On._updateBoundingVolumes(a,t,r);let c;t.mode===re.SCENE3D?c=a._boundingSphereWC:t.mode===re.COLUMBUS_VIEW?c=a._boundingSphereCV:t.mode===re.SCENE2D&&l(a._boundingSphere2D)?c=a._boundingSphere2D:l(a._boundingSphereMorph)&&(c=a._boundingSphereMorph);let u=t.mode===re.MORPHING,f=e.classificationType,d=f!==ei.CESIUM_3D_TILE,p=f!==ei.TERRAIN&&!u,g,m=t.passes;if(m.render||m.pick&&a.allowPicking){let y=n.length;for(let A=0;A<y;++A){let b=c[A];d&&(g=n[A],Dpe(e,g,t,r,o,b,s)),p&&(g=n[A].derivedCommands.tileset,Dpe(e,g,t,r,o,b,s))}}}Cg.prototype.update=function(e){if(!l(this._primitive)&&!l(this.geometryInstances))return;if(!Mi.initialized){Cg.initializeTerrainHeights();return}let t,n=this,i=this._primitiveOptions;if(!l(this._primitive)){let r=Array.isArray(this.geometryInstances)?this.geometryInstances:[this.geometryInstances],o=r.length,s=new Array(o),a;for(t=0;t<o;++t)if(a=r[t].attributes,!l(a)||!l(a.color)){this._hasPerInstanceColors=!1;break}for(t=0;t<o;++t){let c=r[t];a={};let u=c.attributes;for(let f in u)u.hasOwnProperty(f)&&(a[f]=u[f]);l(a.width)||(a.width=new Qc({componentDatatype:Y.UNSIGNED_BYTE,componentsPerAttribute:1,value:[c.geometry.width]})),c.geometry._scene3DOnly=e.scene3DOnly,Rx.setProjectionAndEllipsoid(c.geometry,e.mapProjection),s[t]=new Ft({geometry:c.geometry,attributes:a,id:c.id,pickPrimitive:n})}i.geometryInstances=s,i.appearance=this.appearance,i._createShaderProgramFunction=function(c,u,f){m7e(n,u,f)},i._createCommandsFunction=function(c,u,f,d,p,g,m){p7e(n,u,f,d,g,m)},i._updateAndQueueCommandsFunction=function(c,u,f,d,p,g,m,y){g7e(n,u,f,d,p,g,m)},this._primitive=new On(i)}if(this.appearance instanceof js&&!this._hasPerInstanceColors)throw new pe("All GeometryInstances must have color attributes to use PolylineColorAppearance with GroundPolylinePrimitive.");this._primitive.appearance=this.appearance,this._primitive.show=this.show,this._primitive.debugShowBoundingVolume=this.debugShowBoundingVolume,this._primitive.update(e),e.afterRender.push(()=>{!this._ready&&l(this._primitive)&&this._primitive.ready&&(this._ready=!0,this.releaseGeometryInstances&&(this.geometryInstances=void 0))})};Cg.prototype.getGeometryInstanceAttributes=function(e){return this._primitive.getGeometryInstanceAttributes(e)};Cg.isSupported=function(e){return e.frameState.context.depthTexture};Cg.prototype.isDestroyed=function(){return!1};Cg.prototype.destroy=function(){return this._primitive=this._primitive&&this._primitive.destroy(),this._sp=this._sp&&this._sp.destroy(),this._sp2D=void 0,this._spMorph=void 0,le(this)};var Jh=Cg;var _7e=new U(1,1),y7e=!1,A7e=z.WHITE;function Vv(e){e=e??H.EMPTY_OBJECT,this._definitionChanged=new be,this._image=void 0,this._imageSubscription=void 0,this._repeat=void 0,this._repeatSubscription=void 0,this._color=void 0,this._colorSubscription=void 0,this._transparent=void 0,this._transparentSubscription=void 0,this.image=e.image,this.repeat=e.repeat,this.color=e.color,this.transparent=e.transparent}Object.defineProperties(Vv.prototype,{isConstant:{get:function(){return X.isConstant(this._image)&&X.isConstant(this._repeat)}},definitionChanged:{get:function(){return this._definitionChanged}},image:me("image"),repeat:me("repeat"),color:me("color"),transparent:me("transparent")});Vv.prototype.getType=function(e){return"Image"};var b7e=new K;Vv.prototype.getValue=function(e,t){return l(e)||(e=K.now(b7e)),l(t)||(t={}),t.image=X.getValueOrUndefined(this._image,e),t.repeat=X.getValueOrClonedDefault(this._repeat,e,_7e,t.repeat),t.color=X.getValueOrClonedDefault(this._color,e,A7e,t.color),X.getValueOrDefault(this._transparent,e,y7e)&&(t.color.alpha=Math.min(.99,t.color.alpha)),t};Vv.prototype.equals=function(e){return this===e||e instanceof Vv&&X.equals(this._image,e._image)&&X.equals(this._repeat,e._repeat)&&X.equals(this._color,e._color)&&X.equals(this._transparent,e._transparent)};var Ky=Vv;function x7e(e){if(e instanceof z)return new Kt(e);if(typeof e=="string"||e instanceof De||e instanceof HTMLCanvasElement||e instanceof HTMLVideoElement){let t=new Ky;return t.image=e,t}}function T7e(e,t){return me(e,t,x7e)}var ro=T7e;function xN(e){this._definitionChanged=new be,this._show=void 0,this._showSubscription=void 0,this._dimensions=void 0,this._dimensionsSubscription=void 0,this._heightReference=void 0,this._heightReferenceSubscription=void 0,this._fill=void 0,this._fillSubscription=void 0,this._material=void 0,this._materialSubscription=void 0,this._outline=void 0,this._outlineSubscription=void 0,this._outlineColor=void 0,this._outlineColorSubscription=void 0,this._outlineWidth=void 0,this._outlineWidthSubscription=void 0,this._shadows=void 0,this._shadowsSubscription=void 0,this._distanceDisplayCondition=void 0,this._distanceDisplayConditionSubscription=void 0,this.merge(e??H.EMPTY_OBJECT)}Object.defineProperties(xN.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:me("show"),dimensions:me("dimensions"),heightReference:me("heightReference"),fill:me("fill"),material:ro("material"),outline:me("outline"),outlineColor:me("outlineColor"),outlineWidth:me("outlineWidth"),shadows:me("shadows"),distanceDisplayCondition:me("distanceDisplayCondition")});xN.prototype.clone=function(e){return l(e)?(e.show=this.show,e.dimensions=this.dimensions,e.heightReference=this.heightReference,e.fill=this.fill,e.material=this.material,e.outline=this.outline,e.outlineColor=this.outlineColor,e.outlineWidth=this.outlineWidth,e.shadows=this.shadows,e.distanceDisplayCondition=this.distanceDisplayCondition,e):new xN(this)};xN.prototype.merge=function(e){this.show=this.show??e.show,this.dimensions=this.dimensions??e.dimensions,this.heightReference=this.heightReference??e.heightReference,this.fill=this.fill??e.fill,this.material=this.material??e.material,this.outline=this.outline??e.outline,this.outlineColor=this.outlineColor??e.outlineColor,this.outlineWidth=this.outlineWidth??e.outlineWidth,this.shadows=this.shadows??e.shadows,this.distanceDisplayCondition=this.distanceDisplayCondition??e.distanceDisplayCondition};var Nx=xN;var Rpe={FIXED:0,INERTIAL:1};Object.freeze(Rpe);var ji=Rpe;function jv(){pe.throwInstantiationError()}Object.defineProperties(jv.prototype,{isConstant:{get:pe.throwInstantiationError},definitionChanged:{get:pe.throwInstantiationError},referenceFrame:{get:pe.throwInstantiationError}});jv.prototype.getValue=pe.throwInstantiationError;jv.prototype.getValueInReferenceFrame=pe.throwInstantiationError;jv.prototype.equals=pe.throwInstantiationError;var Ope=new $;jv.convertToReferenceFrame=function(e,t,n,i,r){if(!l(t))return t;if(l(r)||(r=new h),n===i)return h.clone(t,r);let o=At.computeIcrfToCentralBodyFixedMatrix(e,Ope);if(n===ji.INERTIAL)return $.multiplyByVector(o,t,r);if(n===ji.FIXED)return $.multiplyByVector($.transpose(o,Ope),t,r)};var Zh=jv;function Lx(e,t){this._definitionChanged=new be,this._value=h.clone(e),this._referenceFrame=t??ji.FIXED}Object.defineProperties(Lx.prototype,{isConstant:{get:function(){return!l(this._value)||this._referenceFrame===ji.FIXED}},definitionChanged:{get:function(){return this._definitionChanged}},referenceFrame:{get:function(){return this._referenceFrame}}});var E7e=new K;Lx.prototype.getValue=function(e,t){return l(e)||(e=K.now(E7e)),this.getValueInReferenceFrame(e,ji.FIXED,t)};Lx.prototype.setValue=function(e,t){let n=!1;h.equals(this._value,e)||(n=!0,this._value=h.clone(e)),l(t)&&this._referenceFrame!==t&&(n=!0,this._referenceFrame=t),n&&this._definitionChanged.raiseEvent(this)};Lx.prototype.getValueInReferenceFrame=function(e,t,n){return Zh.convertToReferenceFrame(e,this._value,this._referenceFrame,t,n)};Lx.prototype.equals=function(e){return this===e||e instanceof Lx&&h.equals(this._value,e._value)&&this._referenceFrame===e._referenceFrame};var Xl=Lx;function TN(e){this._definitionChanged=new be,this._show=void 0,this._showSubscription=void 0,this._positions=void 0,this._positionsSubscription=void 0,this._width=void 0,this._widthSubscription=void 0,this._height=void 0,this._heightSubscription=void 0,this._heightReference=void 0,this._heightReferenceSubscription=void 0,this._extrudedHeight=void 0,this._extrudedHeightSubscription=void 0,this._extrudedHeightReference=void 0,this._extrudedHeightReferenceSubscription=void 0,this._cornerType=void 0,this._cornerTypeSubscription=void 0,this._granularity=void 0,this._granularitySubscription=void 0,this._fill=void 0,this._fillSubscription=void 0,this._material=void 0,this._materialSubscription=void 0,this._outline=void 0,this._outlineSubscription=void 0,this._outlineColor=void 0,this._outlineColorSubscription=void 0,this._outlineWidth=void 0,this._outlineWidthSubscription=void 0,this._shadows=void 0,this._shadowsSubscription=void 0,this._distanceDisplayCondition=void 0,this._distanceDisplayConditionSubscription=void 0,this._classificationType=void 0,this._classificationTypeSubscription=void 0,this._zIndex=void 0,this._zIndexSubscription=void 0,this.merge(e??H.EMPTY_OBJECT)}Object.defineProperties(TN.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:me("show"),positions:me("positions"),width:me("width"),height:me("height"),heightReference:me("heightReference"),extrudedHeight:me("extrudedHeight"),extrudedHeightReference:me("extrudedHeightReference"),cornerType:me("cornerType"),granularity:me("granularity"),fill:me("fill"),material:ro("material"),outline:me("outline"),outlineColor:me("outlineColor"),outlineWidth:me("outlineWidth"),shadows:me("shadows"),distanceDisplayCondition:me("distanceDisplayCondition"),classificationType:me("classificationType"),zIndex:me("zIndex")});TN.prototype.clone=function(e){return l(e)?(e.show=this.show,e.positions=this.positions,e.width=this.width,e.height=this.height,e.heightReference=this.heightReference,e.extrudedHeight=this.extrudedHeight,e.extrudedHeightReference=this.extrudedHeightReference,e.cornerType=this.cornerType,e.granularity=this.granularity,e.fill=this.fill,e.material=this.material,e.outline=this.outline,e.outlineColor=this.outlineColor,e.outlineWidth=this.outlineWidth,e.shadows=this.shadows,e.distanceDisplayCondition=this.distanceDisplayCondition,e.classificationType=this.classificationType,e.zIndex=this.zIndex,e):new TN(this)};TN.prototype.merge=function(e){this.show=this.show??e.show,this.positions=this.positions??e.positions,this.width=this.width??e.width,this.height=this.height??e.height,this.heightReference=this.heightReference??e.heightReference,this.extrudedHeight=this.extrudedHeight??e.extrudedHeight,this.extrudedHeightReference=this.extrudedHeightReference??e.extrudedHeightReference,this.cornerType=this.cornerType??e.cornerType,this.granularity=this.granularity??e.granularity,this.fill=this.fill??e.fill,this.material=this.material??e.material,this.outline=this.outline??e.outline,this.outlineColor=this.outlineColor??e.outlineColor,this.outlineWidth=this.outlineWidth??e.outlineWidth,this.shadows=this.shadows??e.shadows,this.distanceDisplayCondition=this.distanceDisplayCondition??e.distanceDisplayCondition,this.classificationType=this.classificationType??e.classificationType,this.zIndex=this.zIndex??e.zIndex};var Fx=TN;function C7e(e){return e}function v7e(e,t){return me(e,t,C7e)}var Kl=v7e;function EN(e){this._definitionChanged=new be,this._show=void 0,this._showSubscription=void 0,this._length=void 0,this._lengthSubscription=void 0,this._topRadius=void 0,this._topRadiusSubscription=void 0,this._bottomRadius=void 0,this._bottomRadiusSubscription=void 0,this._heightReference=void 0,this._heightReferenceSubscription=void 0,this._fill=void 0,this._fillSubscription=void 0,this._material=void 0,this._materialSubscription=void 0,this._outline=void 0,this._outlineSubscription=void 0,this._outlineColor=void 0,this._outlineColorSubscription=void 0,this._outlineWidth=void 0,this._outlineWidthSubscription=void 0,this._numberOfVerticalLines=void 0,this._numberOfVerticalLinesSubscription=void 0,this._slices=void 0,this._slicesSubscription=void 0,this._shadows=void 0,this._shadowsSubscription=void 0,this._distanceDisplayCondition=void 0,this._distanceDisplayConditionSubscription=void 0,this.merge(e??H.EMPTY_OBJECT)}Object.defineProperties(EN.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:me("show"),length:me("length"),topRadius:me("topRadius"),bottomRadius:me("bottomRadius"),heightReference:me("heightReference"),fill:me("fill"),material:ro("material"),outline:me("outline"),outlineColor:me("outlineColor"),outlineWidth:me("outlineWidth"),numberOfVerticalLines:me("numberOfVerticalLines"),slices:me("slices"),shadows:me("shadows"),distanceDisplayCondition:me("distanceDisplayCondition")});EN.prototype.clone=function(e){return l(e)?(e.show=this.show,e.length=this.length,e.topRadius=this.topRadius,e.bottomRadius=this.bottomRadius,e.heightReference=this.heightReference,e.fill=this.fill,e.material=this.material,e.outline=this.outline,e.outlineColor=this.outlineColor,e.outlineWidth=this.outlineWidth,e.numberOfVerticalLines=this.numberOfVerticalLines,e.slices=this.slices,e.shadows=this.shadows,e.distanceDisplayCondition=this.distanceDisplayCondition,e):new EN(this)};EN.prototype.merge=function(e){this.show=this.show??e.show,this.length=this.length??e.length,this.topRadius=this.topRadius??e.topRadius,this.bottomRadius=this.bottomRadius??e.bottomRadius,this.heightReference=this.heightReference??e.heightReference,this.fill=this.fill??e.fill,this.material=this.material??e.material,this.outline=this.outline??e.outline,this.outlineColor=this.outlineColor??e.outlineColor,this.outlineWidth=this.outlineWidth??e.outlineWidth,this.numberOfVerticalLines=this.numberOfVerticalLines??e.numberOfVerticalLines,this.slices=this.slices??e.slices,this.shadows=this.shadows??e.shadows,this.distanceDisplayCondition=this.distanceDisplayCondition??e.distanceDisplayCondition};var Bx=EN;function CN(e){this._definitionChanged=new be,this._show=void 0,this._showSubscription=void 0,this._semiMajorAxis=void 0,this._semiMajorAxisSubscription=void 0,this._semiMinorAxis=void 0,this._semiMinorAxisSubscription=void 0,this._height=void 0,this._heightSubscription=void 0,this._heightReference=void 0,this._heightReferenceSubscription=void 0,this._extrudedHeight=void 0,this._extrudedHeightSubscription=void 0,this._extrudedHeightReference=void 0,this._extrudedHeightReferenceSubscription=void 0,this._rotation=void 0,this._rotationSubscription=void 0,this._stRotation=void 0,this._stRotationSubscription=void 0,this._granularity=void 0,this._granularitySubscription=void 0,this._fill=void 0,this._fillSubscription=void 0,this._material=void 0,this._materialSubscription=void 0,this._outline=void 0,this._outlineSubscription=void 0,this._outlineColor=void 0,this._outlineColorSubscription=void 0,this._outlineWidth=void 0,this._outlineWidthSubscription=void 0,this._numberOfVerticalLines=void 0,this._numberOfVerticalLinesSubscription=void 0,this._shadows=void 0,this._shadowsSubscription=void 0,this._distanceDisplayCondition=void 0,this._distanceDisplayConditionSubscription=void 0,this._classificationType=void 0,this._classificationTypeSubscription=void 0,this._zIndex=void 0,this._zIndexSubscription=void 0,this.merge(e??H.EMPTY_OBJECT)}Object.defineProperties(CN.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:me("show"),semiMajorAxis:me("semiMajorAxis"),semiMinorAxis:me("semiMinorAxis"),height:me("height"),heightReference:me("heightReference"),extrudedHeight:me("extrudedHeight"),extrudedHeightReference:me("extrudedHeightReference"),rotation:me("rotation"),stRotation:me("stRotation"),granularity:me("granularity"),fill:me("fill"),material:ro("material"),outline:me("outline"),outlineColor:me("outlineColor"),outlineWidth:me("outlineWidth"),numberOfVerticalLines:me("numberOfVerticalLines"),shadows:me("shadows"),distanceDisplayCondition:me("distanceDisplayCondition"),classificationType:me("classificationType"),zIndex:me("zIndex")});CN.prototype.clone=function(e){return l(e)?(e.show=this.show,e.semiMajorAxis=this.semiMajorAxis,e.semiMinorAxis=this.semiMinorAxis,e.height=this.height,e.heightReference=this.heightReference,e.extrudedHeight=this.extrudedHeight,e.extrudedHeightReference=this.extrudedHeightReference,e.rotation=this.rotation,e.stRotation=this.stRotation,e.granularity=this.granularity,e.fill=this.fill,e.material=this.material,e.outline=this.outline,e.outlineColor=this.outlineColor,e.outlineWidth=this.outlineWidth,e.numberOfVerticalLines=this.numberOfVerticalLines,e.shadows=this.shadows,e.distanceDisplayCondition=this.distanceDisplayCondition,e.classificationType=this.classificationType,e.zIndex=this.zIndex,e):new CN(this)};CN.prototype.merge=function(e){this.show=this.show??e.show,this.semiMajorAxis=this.semiMajorAxis??e.semiMajorAxis,this.semiMinorAxis=this.semiMinorAxis??e.semiMinorAxis,this.height=this.height??e.height,this.heightReference=this.heightReference??e.heightReference,this.extrudedHeight=this.extrudedHeight??e.extrudedHeight,this.extrudedHeightReference=this.extrudedHeightReference??e.extrudedHeightReference,this.rotation=this.rotation??e.rotation,this.stRotation=this.stRotation??e.stRotation,this.granularity=this.granularity??e.granularity,this.fill=this.fill??e.fill,this.material=this.material??e.material,this.outline=this.outline??e.outline,this.outlineColor=this.outlineColor??e.outlineColor,this.outlineWidth=this.outlineWidth??e.outlineWidth,this.numberOfVerticalLines=this.numberOfVerticalLines??e.numberOfVerticalLines,this.shadows=this.shadows??e.shadows,this.distanceDisplayCondition=this.distanceDisplayCondition??e.distanceDisplayCondition,this.classificationType=this.classificationType??e.classificationType,this.zIndex=this.zIndex??e.zIndex};var kx=CN;function vN(e){this._definitionChanged=new be,this._show=void 0,this._showSubscription=void 0,this._radii=void 0,this._radiiSubscription=void 0,this._innerRadii=void 0,this._innerRadiiSubscription=void 0,this._minimumClock=void 0,this._minimumClockSubscription=void 0,this._maximumClock=void 0,this._maximumClockSubscription=void 0,this._minimumCone=void 0,this._minimumConeSubscription=void 0,this._maximumCone=void 0,this._maximumConeSubscription=void 0,this._heightReference=void 0,this._heightReferenceSubscription=void 0,this._fill=void 0,this._fillSubscription=void 0,this._material=void 0,this._materialSubscription=void 0,this._outline=void 0,this._outlineSubscription=void 0,this._outlineColor=void 0,this._outlineColorSubscription=void 0,this._outlineWidth=void 0,this._outlineWidthSubscription=void 0,this._stackPartitions=void 0,this._stackPartitionsSubscription=void 0,this._slicePartitions=void 0,this._slicePartitionsSubscription=void 0,this._subdivisions=void 0,this._subdivisionsSubscription=void 0,this._shadows=void 0,this._shadowsSubscription=void 0,this._distanceDisplayCondition=void 0,this._distanceDisplayConditionSubscription=void 0,this.merge(e??H.EMPTY_OBJECT)}Object.defineProperties(vN.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:me("show"),radii:me("radii"),innerRadii:me("innerRadii"),minimumClock:me("minimumClock"),maximumClock:me("maximumClock"),minimumCone:me("minimumCone"),maximumCone:me("maximumCone"),heightReference:me("heightReference"),fill:me("fill"),material:ro("material"),outline:me("outline"),outlineColor:me("outlineColor"),outlineWidth:me("outlineWidth"),stackPartitions:me("stackPartitions"),slicePartitions:me("slicePartitions"),subdivisions:me("subdivisions"),shadows:me("shadows"),distanceDisplayCondition:me("distanceDisplayCondition")});vN.prototype.clone=function(e){return l(e)?(e.show=this.show,e.radii=this.radii,e.innerRadii=this.innerRadii,e.minimumClock=this.minimumClock,e.maximumClock=this.maximumClock,e.minimumCone=this.minimumCone,e.maximumCone=this.maximumCone,e.heightReference=this.heightReference,e.fill=this.fill,e.material=this.material,e.outline=this.outline,e.outlineColor=this.outlineColor,e.outlineWidth=this.outlineWidth,e.stackPartitions=this.stackPartitions,e.slicePartitions=this.slicePartitions,e.subdivisions=this.subdivisions,e.shadows=this.shadows,e.distanceDisplayCondition=this.distanceDisplayCondition,e):new vN(this)};vN.prototype.merge=function(e){this.show=this.show??e.show,this.radii=this.radii??e.radii,this.innerRadii=this.innerRadii??e.innerRadii,this.minimumClock=this.minimumClock??e.minimumClock,this.maximumClock=this.maximumClock??e.maximumClock,this.minimumCone=this.minimumCone??e.minimumCone,this.maximumCone=this.maximumCone??e.maximumCone,this.heightReference=this.heightReference??e.heightReference,this.fill=this.fill??e.fill,this.material=this.material??e.material,this.outline=this.outline??e.outline,this.outlineColor=this.outlineColor??e.outlineColor,this.outlineWidth=this.outlineWidth??e.outlineWidth,this.stackPartitions=this.stackPartitions??e.stackPartitions,this.slicePartitions=this.slicePartitions??e.slicePartitions,this.subdivisions=this.subdivisions??e.subdivisions,this.shadows=this.shadows??e.shadows,this.distanceDisplayCondition=this.distanceDisplayCondition??e.distanceDisplayCondition};var Ux=vN;function SN(e){this._definitionChanged=new be,this._show=void 0,this._showSubscription=void 0,this._text=void 0,this._textSubscription=void 0,this._font=void 0,this._fontSubscription=void 0,this._style=void 0,this._styleSubscription=void 0,this._scale=void 0,this._scaleSubscription=void 0,this._showBackground=void 0,this._showBackgroundSubscription=void 0,this._backgroundColor=void 0,this._backgroundColorSubscription=void 0,this._backgroundPadding=void 0,this._backgroundPaddingSubscription=void 0,this._pixelOffset=void 0,this._pixelOffsetSubscription=void 0,this._eyeOffset=void 0,this._eyeOffsetSubscription=void 0,this._horizontalOrigin=void 0,this._horizontalOriginSubscription=void 0,this._verticalOrigin=void 0,this._verticalOriginSubscription=void 0,this._heightReference=void 0,this._heightReferenceSubscription=void 0,this._fillColor=void 0,this._fillColorSubscription=void 0,this._outlineColor=void 0,this._outlineColorSubscription=void 0,this._outlineWidth=void 0,this._outlineWidthSubscription=void 0,this._translucencyByDistance=void 0,this._translucencyByDistanceSubscription=void 0,this._pixelOffsetScaleByDistance=void 0,this._pixelOffsetScaleByDistanceSubscription=void 0,this._scaleByDistance=void 0,this._scaleByDistanceSubscription=void 0,this._distanceDisplayCondition=void 0,this._distanceDisplayConditionSubscription=void 0,this._disableDepthTestDistance=void 0,this._disableDepthTestDistanceSubscription=void 0,this.merge(e??H.EMPTY_OBJECT)}Object.defineProperties(SN.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:me("show"),text:me("text"),font:me("font"),style:me("style"),scale:me("scale"),showBackground:me("showBackground"),backgroundColor:me("backgroundColor"),backgroundPadding:me("backgroundPadding"),pixelOffset:me("pixelOffset"),eyeOffset:me("eyeOffset"),horizontalOrigin:me("horizontalOrigin"),verticalOrigin:me("verticalOrigin"),heightReference:me("heightReference"),fillColor:me("fillColor"),outlineColor:me("outlineColor"),outlineWidth:me("outlineWidth"),translucencyByDistance:me("translucencyByDistance"),pixelOffsetScaleByDistance:me("pixelOffsetScaleByDistance"),scaleByDistance:me("scaleByDistance"),distanceDisplayCondition:me("distanceDisplayCondition"),disableDepthTestDistance:me("disableDepthTestDistance")});SN.prototype.clone=function(e){return l(e)?(e.show=this.show,e.text=this.text,e.font=this.font,e.style=this.style,e.scale=this.scale,e.showBackground=this.showBackground,e.backgroundColor=this.backgroundColor,e.backgroundPadding=this.backgroundPadding,e.pixelOffset=this.pixelOffset,e.eyeOffset=this.eyeOffset,e.horizontalOrigin=this.horizontalOrigin,e.verticalOrigin=this.verticalOrigin,e.heightReference=this.heightReference,e.fillColor=this.fillColor,e.outlineColor=this.outlineColor,e.outlineWidth=this.outlineWidth,e.translucencyByDistance=this.translucencyByDistance,e.pixelOffsetScaleByDistance=this.pixelOffsetScaleByDistance,e.scaleByDistance=this.scaleByDistance,e.distanceDisplayCondition=this.distanceDisplayCondition,e.disableDepthTestDistance=this.disableDepthTestDistance,e):new SN(this)};SN.prototype.merge=function(e){this.show=this.show??e.show,this.text=this.text??e.text,this.font=this.font??e.font,this.style=this.style??e.style,this.scale=this.scale??e.scale,this.showBackground=this.showBackground??e.showBackground,this.backgroundColor=this.backgroundColor??e.backgroundColor,this.backgroundPadding=this.backgroundPadding??e.backgroundPadding,this.pixelOffset=this.pixelOffset??e.pixelOffset,this.eyeOffset=this.eyeOffset??e.eyeOffset,this.horizontalOrigin=this.horizontalOrigin??e.horizontalOrigin,this.verticalOrigin=this.verticalOrigin??e.verticalOrigin,this.heightReference=this.heightReference??e.heightReference,this.fillColor=this.fillColor??e.fillColor,this.outlineColor=this.outlineColor??e.outlineColor,this.outlineWidth=this.outlineWidth??e.outlineWidth,this.translucencyByDistance=this.translucencyByDistance??e.translucencyByDistance,this.pixelOffsetScaleByDistance=this.pixelOffsetScaleByDistance??e.pixelOffsetScaleByDistance,this.scaleByDistance=this.scaleByDistance??e.scaleByDistance,this.distanceDisplayCondition=this.distanceDisplayCondition??e.distanceDisplayCondition,this.disableDepthTestDistance=this.disableDepthTestDistance??e.disableDepthTestDistance};var Qh=SN;var S7e=new h(1,1,1),w7e=h.ZERO,I7e=Le.IDENTITY;function Mpe(e,t,n){this.translation=h.clone(e??w7e),this.rotation=Le.clone(t??I7e),this.scale=h.clone(n??S7e)}Mpe.prototype.equals=function(e){return this===e||l(e)&&h.equals(this.translation,e.translation)&&Le.equals(this.rotation,e.rotation)&&h.equals(this.scale,e.scale)};var $y=Mpe;var AK=new $y;function wN(e){e=e??H.EMPTY_OBJECT,this._definitionChanged=new be,this._translation=void 0,this._translationSubscription=void 0,this._rotation=void 0,this._rotationSubscription=void 0,this._scale=void 0,this._scaleSubscription=void 0,this.translation=e.translation,this.rotation=e.rotation,this.scale=e.scale}Object.defineProperties(wN.prototype,{isConstant:{get:function(){return X.isConstant(this._translation)&&X.isConstant(this._rotation)&&X.isConstant(this._scale)}},definitionChanged:{get:function(){return this._definitionChanged}},translation:me("translation"),rotation:me("rotation"),scale:me("scale")});var P7e=new K;wN.prototype.getValue=function(e,t){return l(e)||(e=K.now(P7e)),l(t)||(t=new $y),t.translation=X.getValueOrClonedDefault(this._translation,e,AK.translation,t.translation),t.rotation=X.getValueOrClonedDefault(this._rotation,e,AK.rotation,t.rotation),t.scale=X.getValueOrClonedDefault(this._scale,e,AK.scale,t.scale),t};wN.prototype.equals=function(e){return this===e||e instanceof wN&&X.equals(this._translation,e._translation)&&X.equals(this._rotation,e._rotation)&&X.equals(this._scale,e._scale)};var zx=wN;function vg(e,t){this._propertyNames=[],this._definitionChanged=new be,l(e)&&this.merge(e,t)}Object.defineProperties(vg.prototype,{propertyNames:{get:function(){return this._propertyNames}},isConstant:{get:function(){let e=this._propertyNames;for(let t=0,n=e.length;t<n;t++)if(!X.isConstant(this[e[t]]))return!1;return!0}},definitionChanged:{get:function(){return this._definitionChanged}}});vg.prototype.hasProperty=function(e){return this._propertyNames.indexOf(e)!==-1};function D7e(e){return new ui(e)}vg.prototype.addProperty=function(e,t,n){this._propertyNames.push(e),Object.defineProperty(this,e,me(e,!0,n??D7e)),l(t)&&(this[e]=t),this._definitionChanged.raiseEvent(this)};vg.prototype.removeProperty=function(e){let n=this._propertyNames.indexOf(e);this._propertyNames.splice(n,1),delete this[e],this._definitionChanged.raiseEvent(this)};var R7e=new K;vg.prototype.getValue=function(e,t){l(e)||(e=K.now(R7e)),l(t)||(t={});let n=this._propertyNames;for(let i=0,r=n.length;i<r;i++){let o=n[i];t[o]=X.getValueOrUndefined(this[o],e,t[o])}return t};vg.prototype.merge=function(e,t){let n=this._propertyNames,i=l(e._propertyNames)?e._propertyNames:Object.keys(e);for(let r=0,o=i.length;r<o;r++){let s=i[r],a=this[s],c=e[s];a===void 0&&n.indexOf(s)===-1&&this.addProperty(s,void 0,t),c!==void 0&&(a!==void 0?l(a)&&l(a.merge)&&a.merge(c):l(c)&&l(c.merge)&&l(c.clone)?this[s]=c.clone():this[s]=c)}};function O7e(e,t){let n=e._propertyNames,i=t._propertyNames,r=n.length;if(r!==i.length)return!1;for(let o=0;o<r;++o){let s=n[o];if(i.indexOf(s)===-1||!X.equals(e[s],t[s]))return!1}return!0}vg.prototype.equals=function(e){return this===e||e instanceof vg&&O7e(this,e)};var $l=vg;function Npe(e){return new zx(e)}function M7e(e){return new $l(e,Npe)}function N7e(e){return new $l(e)}function L7e(e){return new $l(e)}function IN(e){this._definitionChanged=new be,this._show=void 0,this._showSubscription=void 0,this._uri=void 0,this._uriSubscription=void 0,this._scale=void 0,this._scaleSubscription=void 0,this._hasVerticalExaggeration=void 0,this._hasVerticalExaggerationSubscription=void 0,this._enableVerticalExaggeration=void 0,this._enableVerticalExaggerationSubscription=void 0,this._minimumPixelSize=void 0,this._minimumPixelSizeSubscription=void 0,this._maximumScale=void 0,this._maximumScaleSubscription=void 0,this._incrementallyLoadTextures=void 0,this._incrementallyLoadTexturesSubscription=void 0,this._runAnimations=void 0,this._runAnimationsSubscription=void 0,this._clampAnimations=void 0,this._clampAnimationsSubscription=void 0,this._shadows=void 0,this._shadowsSubscription=void 0,this._heightReference=void 0,this._heightReferenceSubscription=void 0,this._silhouetteColor=void 0,this._silhouetteColorSubscription=void 0,this._silhouetteSize=void 0,this._silhouetteSizeSubscription=void 0,this._color=void 0,this._colorSubscription=void 0,this._colorBlendMode=void 0,this._colorBlendModeSubscription=void 0,this._colorBlendAmount=void 0,this._colorBlendAmountSubscription=void 0,this._imageBasedLightingFactor=void 0,this._imageBasedLightingFactorSubscription=void 0,this._environmentMapOptions=void 0,this._environmentMapOptionsSubscription=void 0,this._lightColor=void 0,this._lightColorSubscription=void 0,this._distanceDisplayCondition=void 0,this._distanceDisplayConditionSubscription=void 0,this._nodeTransformations=void 0,this._nodeTransformationsSubscription=void 0,this._articulations=void 0,this._articulationsSubscription=void 0,this._clippingPlanes=void 0,this._clippingPlanesSubscription=void 0,this._customShader=void 0,this._customShaderSubscription=void 0,this.merge(e??H.EMPTY_OBJECT)}Object.defineProperties(IN.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:me("show"),uri:me("uri"),scale:me("scale"),enableVerticalExaggeration:me("enableVerticalExaggeration"),minimumPixelSize:me("minimumPixelSize"),maximumScale:me("maximumScale"),incrementallyLoadTextures:me("incrementallyLoadTextures"),runAnimations:me("runAnimations"),clampAnimations:me("clampAnimations"),shadows:me("shadows"),heightReference:me("heightReference"),silhouetteColor:me("silhouetteColor"),silhouetteSize:me("silhouetteSize"),color:me("color"),colorBlendMode:me("colorBlendMode"),colorBlendAmount:me("colorBlendAmount"),imageBasedLightingFactor:me("imageBasedLightingFactor"),environmentMapOptions:me("environmentMapOptions",void 0,L7e),lightColor:me("lightColor"),distanceDisplayCondition:me("distanceDisplayCondition"),nodeTransformations:me("nodeTransformations",void 0,M7e),articulations:me("articulations",void 0,N7e),clippingPlanes:me("clippingPlanes"),customShader:me("customShader")});IN.prototype.clone=function(e){return l(e)?(e.show=this.show,e.uri=this.uri,e.scale=this.scale,e.enableVerticalExaggeration=this.enableVerticalExaggeration,e.minimumPixelSize=this.minimumPixelSize,e.maximumScale=this.maximumScale,e.incrementallyLoadTextures=this.incrementallyLoadTextures,e.runAnimations=this.runAnimations,e.clampAnimations=this.clampAnimations,e.heightReference=this._heightReference,e.silhouetteColor=this.silhouetteColor,e.silhouetteSize=this.silhouetteSize,e.color=this.color,e.colorBlendMode=this.colorBlendMode,e.colorBlendAmount=this.colorBlendAmount,e.imageBasedLightingFactor=this.imageBasedLightingFactor,e.environmentMapOptions=this.environmentMapOptions,e.lightColor=this.lightColor,e.distanceDisplayCondition=this.distanceDisplayCondition,e.nodeTransformations=this.nodeTransformations,e.articulations=this.articulations,e.clippingPlanes=this.clippingPlanes,e.customShader=this.customShader,e):new IN(this)};IN.prototype.merge=function(e){this.show=this.show??e.show,this.uri=this.uri??e.uri,this.scale=this.scale??e.scale,this.enableVerticalExaggeration=this.enableVerticalExaggeration??e.enableVerticalExaggeration,this.minimumPixelSize=this.minimumPixelSize??e.minimumPixelSize,this.maximumScale=this.maximumScale??e.maximumScale,this.incrementallyLoadTextures=this.incrementallyLoadTextures??e.incrementallyLoadTextures,this.runAnimations=this.runAnimations??e.runAnimations,this.clampAnimations=this.clampAnimations??e.clampAnimations,this.shadows=this.shadows??e.shadows,this.heightReference=this.heightReference??e.heightReference,this.silhouetteColor=this.silhouetteColor??e.silhouetteColor,this.silhouetteSize=this.silhouetteSize??e.silhouetteSize,this.color=this.color??e.color,this.colorBlendMode=this.colorBlendMode??e.colorBlendMode,this.colorBlendAmount=this.colorBlendAmount??e.colorBlendAmount,this.imageBasedLightingFactor=this.imageBasedLightingFactor??e.imageBasedLightingFactor,this.environmentMapOptions=this.environmentMapOptions??e.environmentMapOptions,this.lightColor=this.lightColor??e.lightColor,this.distanceDisplayCondition=this.distanceDisplayCondition??e.distanceDisplayCondition,this.clippingPlanes=this.clippingPlanes??e.clippingPlanes,this.customShader=this.customShader??e.customShader;let t=e.nodeTransformations;if(l(t)){let i=this.nodeTransformations;l(i)?i.merge(t):this.nodeTransformations=new $l(t,Npe)}let n=e.articulations;if(l(n)){let i=this.articulations;l(i)?i.merge(n):this.articulations=new $l(n)}};var Sg=IN;function PN(e){this._definitionChanged=new be,this._show=void 0,this._showSubscription=void 0,this._uri=void 0,this._uriSubscription=void 0,this._maximumScreenSpaceError=void 0,this._maximumScreenSpaceErrorSubscription=void 0,this.merge(e??H.EMPTY_OBJECT)}Object.defineProperties(PN.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:me("show"),uri:me("uri"),maximumScreenSpaceError:me("maximumScreenSpaceError")});PN.prototype.clone=function(e){return l(e)?(e.show=this.show,e.uri=this.uri,e.maximumScreenSpaceError=this.maximumScreenSpaceError,e):new PN(this)};PN.prototype.merge=function(e){this.show=this.show??e.show,this.uri=this.uri??e.uri,this.maximumScreenSpaceError=this.maximumScreenSpaceError??e.maximumScreenSpaceError};var Vx=PN;function DN(e){this._definitionChanged=new be,this._show=void 0,this._showSubscription=void 0,this._leadTime=void 0,this._leadTimeSubscription=void 0,this._trailTime=void 0,this._trailTimeSubscription=void 0,this._width=void 0,this._widthSubscription=void 0,this._resolution=void 0,this._resolutionSubscription=void 0,this._material=void 0,this._materialSubscription=void 0,this._distanceDisplayCondition=void 0,this._distanceDisplayConditionSubscription=void 0,this._relativeTo=void 0,this._relativeToSubscription=void 0,this._materialMode=void 0,this._materialModeSubscription=void 0,this.merge(e??H.EMPTY_OBJECT)}Object.defineProperties(DN.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:me("show"),leadTime:me("leadTime"),trailTime:me("trailTime"),width:me("width"),resolution:me("resolution"),material:ro("material"),distanceDisplayCondition:me("distanceDisplayCondition"),relativeTo:me("relativeTo"),materialMode:me("materialMode")});DN.prototype.clone=function(e){return l(e)?(e.show=this.show,e.leadTime=this.leadTime,e.trailTime=this.trailTime,e.width=this.width,e.resolution=this.resolution,e.material=this.material,e.distanceDisplayCondition=this.distanceDisplayCondition,e.relativeTo=this.relativeTo,e.materialMode=this.materialMode,e):new DN(this)};DN.prototype.merge=function(e){this.show=this.show??e.show,this.leadTime=this.leadTime??e.leadTime,this.trailTime=this.trailTime??e.trailTime,this.width=this.width??e.width,this.resolution=this.resolution??e.resolution,this.material=this.material??e.material,this.distanceDisplayCondition=this.distanceDisplayCondition??e.distanceDisplayCondition,this.relativeTo=this.relativeTo??e.relativeTo,this.materialMode=this.materialMode??e.materialMode};var wg=DN;function RN(e){this._definitionChanged=new be,this._show=void 0,this._showSubscription=void 0,this._plane=void 0,this._planeSubscription=void 0,this._dimensions=void 0,this._dimensionsSubscription=void 0,this._fill=void 0,this._fillSubscription=void 0,this._material=void 0,this._materialSubscription=void 0,this._outline=void 0,this._outlineSubscription=void 0,this._outlineColor=void 0,this._outlineColorSubscription=void 0,this._outlineWidth=void 0,this._outlineWidthSubscription=void 0,this._shadows=void 0,this._shadowsSubscription=void 0,this._distanceDisplayCondition=void 0,this._distanceDisplayConditionSubscription=void 0,this.merge(e??H.EMPTY_OBJECT)}Object.defineProperties(RN.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:me("show"),plane:me("plane"),dimensions:me("dimensions"),fill:me("fill"),material:ro("material"),outline:me("outline"),outlineColor:me("outlineColor"),outlineWidth:me("outlineWidth"),shadows:me("shadows"),distanceDisplayCondition:me("distanceDisplayCondition")});RN.prototype.clone=function(e){return l(e)?(e.show=this.show,e.plane=this.plane,e.dimensions=this.dimensions,e.fill=this.fill,e.material=this.material,e.outline=this.outline,e.outlineColor=this.outlineColor,e.outlineWidth=this.outlineWidth,e.shadows=this.shadows,e.distanceDisplayCondition=this.distanceDisplayCondition,e):new RN(this)};RN.prototype.merge=function(e){this.show=this.show??e.show,this.plane=this.plane??e.plane,this.dimensions=this.dimensions??e.dimensions,this.fill=this.fill??e.fill,this.material=this.material??e.material,this.outline=this.outline??e.outline,this.outlineColor=this.outlineColor??e.outlineColor,this.outlineWidth=this.outlineWidth??e.outlineWidth,this.shadows=this.shadows??e.shadows,this.distanceDisplayCondition=this.distanceDisplayCondition??e.distanceDisplayCondition};var ON=RN;function MN(e){this._definitionChanged=new be,this._show=void 0,this._showSubscription=void 0,this._pixelSize=void 0,this._pixelSizeSubscription=void 0,this._heightReference=void 0,this._heightReferenceSubscription=void 0,this._color=void 0,this._colorSubscription=void 0,this._outlineColor=void 0,this._outlineColorSubscription=void 0,this._outlineWidth=void 0,this._outlineWidthSubscription=void 0,this._scaleByDistance=void 0,this._scaleByDistanceSubscription=void 0,this._translucencyByDistance=void 0,this._translucencyByDistanceSubscription=void 0,this._distanceDisplayCondition=void 0,this._distanceDisplayConditionSubscription=void 0,this._disableDepthTestDistance=void 0,this._disableDepthTestDistanceSubscription=void 0,this._splitDirection=void 0,this._splitDirectionSubscription=void 0,this.merge(e??H.EMPTY_OBJECT)}Object.defineProperties(MN.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:me("show"),pixelSize:me("pixelSize"),heightReference:me("heightReference"),color:me("color"),outlineColor:me("outlineColor"),outlineWidth:me("outlineWidth"),scaleByDistance:me("scaleByDistance"),translucencyByDistance:me("translucencyByDistance"),distanceDisplayCondition:me("distanceDisplayCondition"),disableDepthTestDistance:me("disableDepthTestDistance"),splitDirection:me("splitDirection")});MN.prototype.clone=function(e){return l(e)?(e.show=this.show,e.pixelSize=this.pixelSize,e.heightReference=this.heightReference,e.color=this.color,e.outlineColor=this.outlineColor,e.outlineWidth=this.outlineWidth,e.scaleByDistance=this.scaleByDistance,e.translucencyByDistance=this._translucencyByDistance,e.distanceDisplayCondition=this.distanceDisplayCondition,e.disableDepthTestDistance=this.disableDepthTestDistance,e.splitDirection=this.splitDirection,e):new MN(this)};MN.prototype.merge=function(e){this.show=this.show??e.show,this.pixelSize=this.pixelSize??e.pixelSize,this.heightReference=this.heightReference??e.heightReference,this.color=this.color??e.color,this.outlineColor=this.outlineColor??e.outlineColor,this.outlineWidth=this.outlineWidth??e.outlineWidth,this.scaleByDistance=this.scaleByDistance??e.scaleByDistance,this.translucencyByDistance=this._translucencyByDistance??e.translucencyByDistance,this.distanceDisplayCondition=this.distanceDisplayCondition??e.distanceDisplayCondition,this.disableDepthTestDistance=this.disableDepthTestDistance??e.disableDepthTestDistance,this.splitDirection=this.splitDirection??e.splitDirection};var jx=MN;function F7e(e,t){this.positions=l(e)?e:[],this.holes=l(t)?t:[]}var Oc=F7e;function B7e(e){return Array.isArray(e)&&(e=new Oc(e)),new ui(e)}function NN(e){this._definitionChanged=new be,this._show=void 0,this._showSubscription=void 0,this._hierarchy=void 0,this._hierarchySubscription=void 0,this._height=void 0,this._heightSubscription=void 0,this._heightReference=void 0,this._heightReferenceSubscription=void 0,this._extrudedHeight=void 0,this._extrudedHeightSubscription=void 0,this._extrudedHeightReference=void 0,this._extrudedHeightReferenceSubscription=void 0,this._stRotation=void 0,this._stRotationSubscription=void 0,this._granularity=void 0,this._granularitySubscription=void 0,this._fill=void 0,this._fillSubscription=void 0,this._material=void 0,this._materialSubscription=void 0,this._outline=void 0,this._outlineSubscription=void 0,this._outlineColor=void 0,this._outlineColorSubscription=void 0,this._outlineWidth=void 0,this._outlineWidthSubscription=void 0,this._perPositionHeight=void 0,this._perPositionHeightSubscription=void 0,this._closeTop=void 0,this._closeTopSubscription=void 0,this._closeBottom=void 0,this._closeBottomSubscription=void 0,this._arcType=void 0,this._arcTypeSubscription=void 0,this._shadows=void 0,this._shadowsSubscription=void 0,this._distanceDisplayCondition=void 0,this._distanceDisplayConditionSubscription=void 0,this._classificationType=void 0,this._classificationTypeSubscription=void 0,this._zIndex=void 0,this._zIndexSubscription=void 0,this._textureCoordinates=void 0,this._textureCoordinatesSubscription=void 0,this.merge(e??H.EMPTY_OBJECT)}Object.defineProperties(NN.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:me("show"),hierarchy:me("hierarchy",void 0,B7e),height:me("height"),heightReference:me("heightReference"),extrudedHeight:me("extrudedHeight"),extrudedHeightReference:me("extrudedHeightReference"),stRotation:me("stRotation"),granularity:me("granularity"),fill:me("fill"),material:ro("material"),outline:me("outline"),outlineColor:me("outlineColor"),outlineWidth:me("outlineWidth"),perPositionHeight:me("perPositionHeight"),closeTop:me("closeTop"),closeBottom:me("closeBottom"),arcType:me("arcType"),shadows:me("shadows"),distanceDisplayCondition:me("distanceDisplayCondition"),classificationType:me("classificationType"),zIndex:me("zIndex"),textureCoordinates:me("textureCoordinates")});NN.prototype.clone=function(e){return l(e)?(e.show=this.show,e.hierarchy=this.hierarchy,e.height=this.height,e.heightReference=this.heightReference,e.extrudedHeight=this.extrudedHeight,e.extrudedHeightReference=this.extrudedHeightReference,e.stRotation=this.stRotation,e.granularity=this.granularity,e.fill=this.fill,e.material=this.material,e.outline=this.outline,e.outlineColor=this.outlineColor,e.outlineWidth=this.outlineWidth,e.perPositionHeight=this.perPositionHeight,e.closeTop=this.closeTop,e.closeBottom=this.closeBottom,e.arcType=this.arcType,e.shadows=this.shadows,e.distanceDisplayCondition=this.distanceDisplayCondition,e.classificationType=this.classificationType,e.zIndex=this.zIndex,e.textureCoordinates=this.textureCoordinates,e):new NN(this)};NN.prototype.merge=function(e){this.show=this.show??e.show,this.hierarchy=this.hierarchy??e.hierarchy,this.height=this.height??e.height,this.heightReference=this.heightReference??e.heightReference,this.extrudedHeight=this.extrudedHeight??e.extrudedHeight,this.extrudedHeightReference=this.extrudedHeightReference??e.extrudedHeightReference,this.stRotation=this.stRotation??e.stRotation,this.granularity=this.granularity??e.granularity,this.fill=this.fill??e.fill,this.material=this.material??e.material,this.outline=this.outline??e.outline,this.outlineColor=this.outlineColor??e.outlineColor,this.outlineWidth=this.outlineWidth??e.outlineWidth,this.perPositionHeight=this.perPositionHeight??e.perPositionHeight,this.closeTop=this.closeTop??e.closeTop,this.closeBottom=this.closeBottom??e.closeBottom,this.arcType=this.arcType??e.arcType,this.shadows=this.shadows??e.shadows,this.distanceDisplayCondition=this.distanceDisplayCondition??e.distanceDisplayCondition,this.classificationType=this.classificationType??e.classificationType,this.zIndex=this.zIndex??e.zIndex,this.textureCoordinates=this.textureCoordinates??e.textureCoordinates};var em=NN;function LN(e){this._definitionChanged=new be,this._show=void 0,this._showSubscription=void 0,this._positions=void 0,this._positionsSubscription=void 0,this._width=void 0,this._widthSubscription=void 0,this._granularity=void 0,this._granularitySubscription=void 0,this._material=void 0,this._materialSubscription=void 0,this._depthFailMaterial=void 0,this._depthFailMaterialSubscription=void 0,this._arcType=void 0,this._arcTypeSubscription=void 0,this._clampToGround=void 0,this._clampToGroundSubscription=void 0,this._shadows=void 0,this._shadowsSubscription=void 0,this._distanceDisplayCondition=void 0,this._distanceDisplayConditionSubscription=void 0,this._classificationType=void 0,this._classificationTypeSubscription=void 0,this._zIndex=void 0,this._zIndexSubscription=void 0,this.merge(e??H.EMPTY_OBJECT)}Object.defineProperties(LN.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:me("show"),positions:me("positions"),width:me("width"),granularity:me("granularity"),material:ro("material"),depthFailMaterial:ro("depthFailMaterial"),arcType:me("arcType"),clampToGround:me("clampToGround"),shadows:me("shadows"),distanceDisplayCondition:me("distanceDisplayCondition"),classificationType:me("classificationType"),zIndex:me("zIndex")});LN.prototype.clone=function(e){return l(e)?(e.show=this.show,e.positions=this.positions,e.width=this.width,e.granularity=this.granularity,e.material=this.material,e.depthFailMaterial=this.depthFailMaterial,e.arcType=this.arcType,e.clampToGround=this.clampToGround,e.shadows=this.shadows,e.distanceDisplayCondition=this.distanceDisplayCondition,e.classificationType=this.classificationType,e.zIndex=this.zIndex,e):new LN(this)};LN.prototype.merge=function(e){this.show=this.show??e.show,this.positions=this.positions??e.positions,this.width=this.width??e.width,this.granularity=this.granularity??e.granularity,this.material=this.material??e.material,this.depthFailMaterial=this.depthFailMaterial??e.depthFailMaterial,this.arcType=this.arcType??e.arcType,this.clampToGround=this.clampToGround??e.clampToGround,this.shadows=this.shadows??e.shadows,this.distanceDisplayCondition=this.distanceDisplayCondition??e.distanceDisplayCondition,this.classificationType=this.classificationType??e.classificationType,this.zIndex=this.zIndex??e.zIndex};var el=LN;function FN(e){this._definitionChanged=new be,this._show=void 0,this._showSubscription=void 0,this._positions=void 0,this._positionsSubscription=void 0,this._shape=void 0,this._shapeSubscription=void 0,this._cornerType=void 0,this._cornerTypeSubscription=void 0,this._granularity=void 0,this._granularitySubscription=void 0,this._fill=void 0,this._fillSubscription=void 0,this._material=void 0,this._materialSubscription=void 0,this._outline=void 0,this._outlineSubscription=void 0,this._outlineColor=void 0,this._outlineColorSubscription=void 0,this._outlineWidth=void 0,this._outlineWidthSubscription=void 0,this._shadows=void 0,this._shadowsSubscription=void 0,this._distanceDisplayCondition=void 0,this._distanceDisplayConditionSubsription=void 0,this.merge(e??H.EMPTY_OBJECT)}Object.defineProperties(FN.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:me("show"),positions:me("positions"),shape:me("shape"),cornerType:me("cornerType"),granularity:me("granularity"),fill:me("fill"),material:ro("material"),outline:me("outline"),outlineColor:me("outlineColor"),outlineWidth:me("outlineWidth"),shadows:me("shadows"),distanceDisplayCondition:me("distanceDisplayCondition")});FN.prototype.clone=function(e){return l(e)?(e.show=this.show,e.positions=this.positions,e.shape=this.shape,e.cornerType=this.cornerType,e.granularity=this.granularity,e.fill=this.fill,e.material=this.material,e.outline=this.outline,e.outlineColor=this.outlineColor,e.outlineWidth=this.outlineWidth,e.shadows=this.shadows,e.distanceDisplayCondition=this.distanceDisplayCondition,e):new FN(this)};FN.prototype.merge=function(e){this.show=this.show??e.show,this.positions=this.positions??e.positions,this.shape=this.shape??e.shape,this.cornerType=this.cornerType??e.cornerType,this.granularity=this.granularity??e.granularity,this.fill=this.fill??e.fill,this.material=this.material??e.material,this.outline=this.outline??e.outline,this.outlineColor=this.outlineColor??e.outlineColor,this.outlineWidth=this.outlineWidth??e.outlineWidth,this.shadows=this.shadows??e.shadows,this.distanceDisplayCondition=this.distanceDisplayCondition??e.distanceDisplayCondition};var Hx=FN;function BN(e){this._definitionChanged=new be,this._show=void 0,this._showSubscription=void 0,this._coordinates=void 0,this._coordinatesSubscription=void 0,this._height=void 0,this._heightSubscription=void 0,this._heightReference=void 0,this._heightReferenceSubscription=void 0,this._extrudedHeight=void 0,this._extrudedHeightSubscription=void 0,this._extrudedHeightReference=void 0,this._extrudedHeightReferenceSubscription=void 0,this._rotation=void 0,this._rotationSubscription=void 0,this._stRotation=void 0,this._stRotationSubscription=void 0,this._granularity=void 0,this._granularitySubscription=void 0,this._fill=void 0,this._fillSubscription=void 0,this._material=void 0,this._materialSubscription=void 0,this._outline=void 0,this._outlineSubscription=void 0,this._outlineColor=void 0,this._outlineColorSubscription=void 0,this._outlineWidth=void 0,this._outlineWidthSubscription=void 0,this._shadows=void 0,this._shadowsSubscription=void 0,this._distanceDisplayCondition=void 0,this._distancedisplayConditionSubscription=void 0,this._classificationType=void 0,this._classificationTypeSubscription=void 0,this._zIndex=void 0,this._zIndexSubscription=void 0,this.merge(e??H.EMPTY_OBJECT)}Object.defineProperties(BN.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:me("show"),coordinates:me("coordinates"),height:me("height"),heightReference:me("heightReference"),extrudedHeight:me("extrudedHeight"),extrudedHeightReference:me("extrudedHeightReference"),rotation:me("rotation"),stRotation:me("stRotation"),granularity:me("granularity"),fill:me("fill"),material:ro("material"),outline:me("outline"),outlineColor:me("outlineColor"),outlineWidth:me("outlineWidth"),shadows:me("shadows"),distanceDisplayCondition:me("distanceDisplayCondition"),classificationType:me("classificationType"),zIndex:me("zIndex")});BN.prototype.clone=function(e){return l(e)?(e.show=this.show,e.coordinates=this.coordinates,e.height=this.height,e.heightReference=this.heightReference,e.extrudedHeight=this.extrudedHeight,e.extrudedHeightReference=this.extrudedHeightReference,e.rotation=this.rotation,e.stRotation=this.stRotation,e.granularity=this.granularity,e.fill=this.fill,e.material=this.material,e.outline=this.outline,e.outlineColor=this.outlineColor,e.outlineWidth=this.outlineWidth,e.shadows=this.shadows,e.distanceDisplayCondition=this.distanceDisplayCondition,e.classificationType=this.classificationType,e.zIndex=this.zIndex,e):new BN(this)};BN.prototype.merge=function(e){this.show=this.show??e.show,this.coordinates=this.coordinates??e.coordinates,this.height=this.height??e.height,this.heightReference=this.heightReference??e.heightReference,this.extrudedHeight=this.extrudedHeight??e.extrudedHeight,this.extrudedHeightReference=this.extrudedHeightReference??e.extrudedHeightReference,this.rotation=this.rotation??e.rotation,this.stRotation=this.stRotation??e.stRotation,this.granularity=this.granularity??e.granularity,this.fill=this.fill??e.fill,this.material=this.material??e.material,this.outline=this.outline??e.outline,this.outlineColor=this.outlineColor??e.outlineColor,this.outlineWidth=this.outlineWidth??e.outlineWidth,this.shadows=this.shadows??e.shadows,this.distanceDisplayCondition=this.distanceDisplayCondition??e.distanceDisplayCondition,this.classificationType=this.classificationType??e.classificationType,this.zIndex=this.zIndex??e.zIndex};var tm=BN;function kN(e){this._definitionChanged=new be,this._show=void 0,this._showSubscription=void 0,this._positions=void 0,this._positionsSubscription=void 0,this._minimumHeights=void 0,this._minimumHeightsSubscription=void 0,this._maximumHeights=void 0,this._maximumHeightsSubscription=void 0,this._granularity=void 0,this._granularitySubscription=void 0,this._fill=void 0,this._fillSubscription=void 0,this._material=void 0,this._materialSubscription=void 0,this._outline=void 0,this._outlineSubscription=void 0,this._outlineColor=void 0,this._outlineColorSubscription=void 0,this._outlineWidth=void 0,this._outlineWidthSubscription=void 0,this._shadows=void 0,this._shadowsSubscription=void 0,this._distanceDisplayCondition=void 0,this._distanceDisplayConditionSubscription=void 0,this.merge(e??H.EMPTY_OBJECT)}Object.defineProperties(kN.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:me("show"),positions:me("positions"),minimumHeights:me("minimumHeights"),maximumHeights:me("maximumHeights"),granularity:me("granularity"),fill:me("fill"),material:ro("material"),outline:me("outline"),outlineColor:me("outlineColor"),outlineWidth:me("outlineWidth"),shadows:me("shadows"),distanceDisplayCondition:me("distanceDisplayCondition")});kN.prototype.clone=function(e){return l(e)?(e.show=this.show,e.positions=this.positions,e.minimumHeights=this.minimumHeights,e.maximumHeights=this.maximumHeights,e.granularity=this.granularity,e.fill=this.fill,e.material=this.material,e.outline=this.outline,e.outlineColor=this.outlineColor,e.outlineWidth=this.outlineWidth,e.shadows=this.shadows,e.distanceDisplayCondition=this.distanceDisplayCondition,e):new kN(this)};kN.prototype.merge=function(e){this.show=this.show??e.show,this.positions=this.positions??e.positions,this.minimumHeights=this.minimumHeights??e.minimumHeights,this.maximumHeights=this.maximumHeights??e.maximumHeights,this.granularity=this.granularity??e.granularity,this.fill=this.fill??e.fill,this.material=this.material??e.material,this.outline=this.outline??e.outline,this.outlineColor=this.outlineColor??e.outlineColor,this.outlineWidth=this.outlineWidth??e.outlineWidth,this.shadows=this.shadows??e.shadows,this.distanceDisplayCondition=this.distanceDisplayCondition??e.distanceDisplayCondition};var Ig=kN;var k7e=new he,bK=[];function U7e(e){return new Xl(e)}function z7e(e){return me(e,void 0,U7e)}function Ba(e,t){return me(e,void 0,function(n){return n instanceof t?n:new t(n)})}function Ld(e){e=e??H.EMPTY_OBJECT;let t=e.id;l(t)||(t=Kn()),this._availability=void 0,this._id=t,this._definitionChanged=new be,this._name=e.name,this._show=e.show??!0,this._trackingReferenceFrame=e.trackingReferenceFrame??bg.AUTODETECT,this._parent=void 0,this._propertyNames=["billboard","box","corridor","cylinder","description","ellipse","ellipsoid","label","model","tileset","orientation","path","plane","point","polygon","polyline","polylineVolume","position","properties","rectangle","viewFrom","wall",...bK],this._billboard=void 0,this._billboardSubscription=void 0,this._box=void 0,this._boxSubscription=void 0,this._corridor=void 0,this._corridorSubscription=void 0,this._cylinder=void 0,this._cylinderSubscription=void 0,this._description=void 0,this._descriptionSubscription=void 0,this._ellipse=void 0,this._ellipseSubscription=void 0,this._ellipsoid=void 0,this._ellipsoidSubscription=void 0,this._label=void 0,this._labelSubscription=void 0,this._model=void 0,this._modelSubscription=void 0,this._tileset=void 0,this._tilesetSubscription=void 0,this._orientation=void 0,this._orientationSubscription=void 0,this._path=void 0,this._pathSubscription=void 0,this._plane=void 0,this._planeSubscription=void 0,this._point=void 0,this._pointSubscription=void 0,this._polygon=void 0,this._polygonSubscription=void 0,this._polyline=void 0,this._polylineSubscription=void 0,this._polylineVolume=void 0,this._polylineVolumeSubscription=void 0,this._position=void 0,this._positionSubscription=void 0,this._properties=void 0,this._propertiesSubscription=void 0,this._rectangle=void 0,this._rectangleSubscription=void 0,this._viewFrom=void 0,this._viewFromSubscription=void 0,this._wall=void 0,this._wallSubscription=void 0,this._children=[],this.entityCollection=void 0,this.parent=e.parent,this.merge(e)}function xK(e,t,n){let i=t.length;for(let r=0;r<i;r++){let o=t[r],s=o._show;(!n&&s)!==(n&&s)&&xK(o,o._children,n)}e._definitionChanged.raiseEvent(e,"isShowing",n,!n)}Object.defineProperties(Ld.prototype,{availability:Kl("availability"),id:{get:function(){return this._id}},definitionChanged:{get:function(){return this._definitionChanged}},name:Kl("name"),show:{get:function(){return this._show},set:function(e){if(e===this._show)return;let t=this.isShowing;this._show=e;let n=this.isShowing;t!==n&&xK(this,this._children,n),this._definitionChanged.raiseEvent(this,"show",e,!e)}},trackingReferenceFrame:Kl("trackingReferenceFrame"),isShowing:{get:function(){return this._show&&(!l(this.entityCollection)||this.entityCollection.show)&&(!l(this._parent)||this._parent.isShowing)}},parent:{get:function(){return this._parent},set:function(e){let t=this._parent;if(t===e)return;let n=this.isShowing;if(l(t)){let r=t._children.indexOf(this);t._children.splice(r,1)}this._parent=e,l(e)&&e._children.push(this);let i=this.isShowing;n!==i&&xK(this,this._children,i),this._definitionChanged.raiseEvent(this,"parent",e,t)}},propertyNames:{get:function(){return this._propertyNames}},billboard:Ba("billboard",Zc),box:Ba("box",Nx),corridor:Ba("corridor",Fx),cylinder:Ba("cylinder",Bx),description:me("description"),ellipse:Ba("ellipse",kx),ellipsoid:Ba("ellipsoid",Ux),label:Ba("label",Qh),model:Ba("model",Sg),tileset:Ba("tileset",Vx),orientation:me("orientation"),path:Ba("path",wg),plane:Ba("plane",ON),point:Ba("point",jx),polygon:Ba("polygon",em),polyline:Ba("polyline",el),polylineVolume:Ba("polylineVolume",Hx),properties:Ba("properties",$l),position:z7e("position"),rectangle:Ba("rectangle",tm),viewFrom:me("viewFrom"),wall:Ba("wall",Ig)});Ld.registerEntityType=function(e,t){Object.defineProperties(Ld.prototype,{[e]:Ba(e,t)}),bK.includes(e)||bK.push(e)};Ld.prototype.isAvailable=function(e){let t=this._availability;return!l(t)||t.contains(e)};Ld.prototype.addProperty=function(e){this._propertyNames.push(e),Object.defineProperty(this,e,Kl(e,!0))};Ld.prototype.removeProperty=function(e){let n=this._propertyNames.indexOf(e);this._propertyNames.splice(n,1),delete this[e]};Ld.prototype.merge=function(e){this.name=this.name??e.name,this.availability=this.availability??e.availability;let t=this._propertyNames,n=l(e._propertyNames)?e._propertyNames:Object.keys(e),i=n.length;for(let r=0;r<i;r++){let o=n[r];if(o==="parent"||o==="name"||o==="availability"||o==="children")continue;let s=this[o],a=e[o];!l(s)&&t.indexOf(o)===-1&&this.addProperty(o),l(a)&&(l(s)?l(s.merge)&&s.merge(a):l(a.merge)&&l(a.clone)?this[o]=a.clone():this[o]=a)}};var Lpe=new $,Fpe=new h,Bpe=new Le;Ld.prototype.computeModelMatrix=function(e,t){let n=X.getValueOrUndefined(this._position,e,Fpe);if(!l(n))return;let i=X.getValueOrUndefined(this._orientation,e,Bpe);return l(i)?t=N.fromRotationTranslation($.fromQuaternion(i,Lpe),n,t):t=At.eastNorthUpToFixedFrame(n,void 0,t),t};Ld.prototype.computeModelMatrixForHeightReference=function(e,t,n,i,r){let o=X.getValueOrDefault(t,e,We.NONE),s=X.getValueOrUndefined(this._position,e,Fpe);if(o===We.NONE||!l(s)||h.equalsEpsilon(s,h.ZERO,D.EPSILON8))return this.computeModelMatrix(e,r);let a=i.cartesianToCartographic(s,k7e);o===We.CLIP_TO_GROUND?a.height<n&&(a.height=n):As(o)?a.height=n:a.height+=n,s=i.cartographicToCartesian(a,s);let c=X.getValueOrUndefined(this._orientation,e,Bpe);return l(c)?r=N.fromRotationTranslation($.fromQuaternion(c,Lpe),s,r):r=At.eastNorthUpToFixedFrame(s,void 0,r),r};Ld.supportsMaterialsforEntitiesOnTerrain=function(e){return ql.supportsMaterials(e)};Ld.supportsPolylinesOnTerrain=function(e){return Jh.isSupported(e)};var Jr=Ld;var V7e=new Kt(z.WHITE),j7e=new ui(!0),H7e=new ui(!0),G7e=new ui(!1),W7e=new ui(z.BLACK),q7e=new ui(Dn.DISABLED),Y7e=new ui(new Ht),X7e=new ui(ei.BOTH);function Jl(e){let t=e.entity,n=e.geometryPropertyName;this._entity=t,this._scene=e.scene,this._fillEnabled=!1,this._isClosed=!1,this._onTerrain=!1,this._dynamic=!1,this._outlineEnabled=!1,this._geometryChanged=new be,this._showProperty=void 0,this._materialProperty=void 0,this._showOutlineProperty=void 0,this._outlineColorProperty=void 0,this._outlineWidth=1,this._shadowsProperty=void 0,this._distanceDisplayConditionProperty=void 0,this._classificationTypeProperty=void 0,this._options=e.geometryOptions,this._geometryPropertyName=n,this._id=`${n}-${t.id}`,this._observedPropertyNames=e.observedPropertyNames,this._supportsMaterialsforEntitiesOnTerrain=Jr.supportsMaterialsforEntitiesOnTerrain(e.scene)}Object.defineProperties(Jl.prototype,{id:{get:function(){return this._id}},entity:{get:function(){return this._entity}},fillEnabled:{get:function(){return this._fillEnabled}},hasConstantFill:{get:function(){return!this._fillEnabled||!l(this._entity.availability)&&X.isConstant(this._showProperty)&&X.isConstant(this._fillProperty)}},fillMaterialProperty:{get:function(){return this._materialProperty}},outlineEnabled:{get:function(){return this._outlineEnabled}},hasConstantOutline:{get:function(){return!this._outlineEnabled||!l(this._entity.availability)&&X.isConstant(this._showProperty)&&X.isConstant(this._showOutlineProperty)}},outlineColorProperty:{get:function(){return this._outlineColorProperty}},outlineWidth:{get:function(){return this._outlineWidth}},shadowsProperty:{get:function(){return this._shadowsProperty}},distanceDisplayConditionProperty:{get:function(){return this._distanceDisplayConditionProperty}},classificationTypeProperty:{get:function(){return this._classificationTypeProperty}},isDynamic:{get:function(){return this._dynamic}},isClosed:{get:function(){return this._isClosed}},onTerrain:{get:function(){return this._onTerrain}},geometryChanged:{get:function(){return this._geometryChanged}}});Jl.prototype.isOutlineVisible=function(e){let t=this._entity;return(this._outlineEnabled&&t.isAvailable(e)&&this._showProperty.getValue(e)&&this._showOutlineProperty.getValue(e))??!1};Jl.prototype.isFilled=function(e){let t=this._entity;return(this._fillEnabled&&t.isAvailable(e)&&this._showProperty.getValue(e)&&this._fillProperty.getValue(e))??!1};Jl.prototype.createFillGeometryInstance=pe.throwInstantiationError;Jl.prototype.createOutlineGeometryInstance=pe.throwInstantiationError;Jl.prototype.isDestroyed=function(){return!1};Jl.prototype.destroy=function(){le(this)};Jl.prototype._isHidden=function(e,t){let n=t.show;return l(n)&&n.isConstant&&!n.getValue(nt.MINIMUM_VALUE)};Jl.prototype._isOnTerrain=function(e,t){return!1};Jl.prototype._getIsClosed=function(e){return!0};Jl.prototype._isDynamic=pe.throwInstantiationError;Jl.prototype._setStaticOptions=pe.throwInstantiationError;Jl.prototype._onEntityPropertyChanged=function(e,t,n,i){if(this._observedPropertyNames.indexOf(t)===-1)return;let r=this._entity[this._geometryPropertyName];if(!l(r)){(this._fillEnabled||this._outlineEnabled)&&(this._fillEnabled=!1,this._outlineEnabled=!1,this._geometryChanged.raiseEvent(this));return}let o=r.fill,s=l(o)&&o.isConstant?o.getValue(nt.MINIMUM_VALUE):!0,a=r.outline,c=l(a);if(c&&a.isConstant&&(c=a.getValue(nt.MINIMUM_VALUE)),!s&&!c){(this._fillEnabled||this._outlineEnabled)&&(this._fillEnabled=!1,this._outlineEnabled=!1,this._geometryChanged.raiseEvent(this));return}let u=r.show;if(this._isHidden(e,r)){(this._fillEnabled||this._outlineEnabled)&&(this._fillEnabled=!1,this._outlineEnabled=!1,this._geometryChanged.raiseEvent(this));return}this._materialProperty=r.material??V7e,this._fillProperty=o??H7e,this._showProperty=u??j7e,this._showOutlineProperty=r.outline??G7e,this._outlineColorProperty=c?r.outlineColor??W7e:void 0,this._shadowsProperty=r.shadows??q7e,this._distanceDisplayConditionProperty=r.distanceDisplayCondition??Y7e,this._classificationTypeProperty=r.classificationType??X7e,this._fillEnabled=s;let f=this._isOnTerrain(e,r)&&(this._supportsMaterialsforEntitiesOnTerrain||this._materialProperty instanceof Kt);if(c&&f&&(_t(_t.geometryOutlines),c=!1),this._onTerrain=f,this._outlineEnabled=c,this._isDynamic(e,r))this._dynamic||(this._dynamic=!0,this._geometryChanged.raiseEvent(this));else{this._setStaticOptions(e,r),this._isClosed=this._getIsClosed(this._options);let d=r.outlineWidth;this._outlineWidth=l(d)?d.getValue(nt.MINIMUM_VALUE):1,this._dynamic=!1,this._geometryChanged.raiseEvent(this)}};Jl.prototype.createDynamicUpdater=function(e,t){return new this.constructor.DynamicGeometryUpdater(this,e,t)};var Pi=Jl;function Hv(e,t){this._callback=void 0,this._isConstant=void 0,this._definitionChanged=new be,this.setCallback(e,t)}Object.defineProperties(Hv.prototype,{isConstant:{get:function(){return this._isConstant}},definitionChanged:{get:function(){return this._definitionChanged}}});var K7e=new K;Hv.prototype.getValue=function(e,t){return l(e)||(e=K.now(K7e)),this._callback(e,t)};Hv.prototype.setCallback=function(e,t){let n=this._callback!==e||this._isConstant!==t;this._callback=e,this._isConstant=t,n&&this._definitionChanged.raiseEvent(this)};Hv.prototype.equals=function(e){return this===e||e instanceof Hv&&this._callback===e._callback&&this._isConstant===e._isConstant};var nm=Hv;var kpe=new h;function Gv(e,t,n,i){this._scene=e,this._heightReference=n,this._extrudedHeightReference=i,this._positionProperty=t,this._position=new h,this._cartographicPosition=new he,this._normal=new h,this._definitionChanged=new be,this._terrainHeight=0,this._removeCallbackFunc=void 0,this._removeEventListener=void 0,this._removeModeListener=void 0;let r=this;if(l(e.globe)&&(this._removeEventListener=e.terrainProviderChanged.addEventListener(function(){r._updateClamping()}),this._removeModeListener=e.morphComplete.addEventListener(function(){r._updateClamping()})),t.isConstant){let o=t.getValue(nt.MINIMUM_VALUE,kpe);if(!l(o)||h.equals(o,h.ZERO)||!l(e.globe))return;this._position=h.clone(o,this._position),this._updateClamping(),this._normal=e.ellipsoid.geodeticSurfaceNormal(o,this._normal)}}Object.defineProperties(Gv.prototype,{isConstant:{get:function(){return!1}},definitionChanged:{get:function(){return this._definitionChanged}}});Gv.prototype._updateClamping=function(){l(this._removeCallbackFunc)&&this._removeCallbackFunc();let e=this._scene,t=this._position;if(h.equals(t,h.ZERO)){this._terrainHeight=0;return}let i=e.ellipsoid.cartesianToCartographic(t,this._cartographicPosition),r=e.getHeight(i,this._heightReference);l(r)?this._terrainHeight=r:this._terrainHeight=0;let o=s=>{this._terrainHeight=s.height,this.definitionChanged.raiseEvent()};this._removeCallbackFunc=e.updateHeight(i,o,this._heightReference)};var $7e=new K;Gv.prototype.getValue=function(e,t){l(e)||(e=K.now($7e));let n=X.getValueOrDefault(this._heightReference,e,We.NONE),i=X.getValueOrDefault(this._extrudedHeightReference,e,We.NONE);if(n===We.NONE&&!Wy(i))return this._position=h.clone(h.ZERO,this._position),h.clone(h.ZERO,t);if(this._positionProperty.isConstant&&n!==We.CLIP_TO_GROUND)return h.multiplyByScalar(this._normal,this._terrainHeight,t);let r=this._scene,o=this._positionProperty.getValue(e,kpe);if(!l(o)||h.equals(o,h.ZERO)||!l(r.globe))return h.clone(h.ZERO,t);if(h.equalsEpsilon(this._position,o,D.EPSILON10)&&n!==We.CLIP_TO_GROUND)return h.multiplyByScalar(this._normal,this._terrainHeight,t);this._position=h.clone(o,this._position),this._updateClamping();let s=r.ellipsoid.geodeticSurfaceNormal(o,this._normal);if(n===We.CLIP_TO_GROUND){let c=r.globe.ellipsoid.cartesianToCartographic(o,scratchCarto);return this._terrainHeight>=c.height?h.multiplyByScalar(s,this._terrainHeight-c.height,t):h.clone(h.ZERO,t)}return h.multiplyByScalar(s,this._terrainHeight,t)};Gv.prototype.isDestroyed=function(){return!1};Gv.prototype.destroy=function(){return l(this._removeEventListener)&&this._removeEventListener(),l(this._removeModeListener)&&this._removeModeListener(),l(this._removeCallbackFunc)&&this._removeCallbackFunc(),le(this)};var Gx=Gv;function J7e(e,t,n,i){if(Pi.prototype._onEntityPropertyChanged.call(this,e,t,n,i),this._observedPropertyNames.indexOf(t)===-1)return;let r=this._entity[this._geometryPropertyName];if(!l(r))return;l(this._terrainOffsetProperty)&&(this._terrainOffsetProperty.destroy(),this._terrainOffsetProperty=void 0);let o=r.heightReference;if(l(o)){let s=new nm(this._computeCenter.bind(this),!this._dynamic);this._terrainOffsetProperty=new Gx(this._scene,s,o)}}var Pg=J7e;var Upe=h.ZERO,zpe=new h,Z7e=new h,Vpe=new z;function Q7e(e){this.id=e,this.vertexFormat=void 0,this.dimensions=void 0,this.offsetAttribute=void 0}function Df(e,t){Pi.call(this,{entity:e,scene:t,geometryOptions:new Q7e(e),geometryPropertyName:"box",observedPropertyNames:["availability","position","orientation","box"]}),this._onEntityPropertyChanged(e,"box",e.box,void 0)}l(Object.create)&&(Df.prototype=Object.create(Pi.prototype),Df.prototype.constructor=Df);Object.defineProperties(Df.prototype,{terrainOffsetProperty:{get:function(){return this._terrainOffsetProperty}}});Df.prototype.createFillGeometryInstance=function(e){let t=this._entity,n=t.isAvailable(e),i=new Pn(n&&t.isShowing&&this._showProperty.getValue(e)&&this._fillProperty.getValue(e)),r=this._distanceDisplayConditionProperty.getValue(e),o=Qn.fromDistanceDisplayCondition(r),s={show:i,distanceDisplayCondition:o,color:void 0,offset:void 0};if(this._materialProperty instanceof Kt){let a;l(this._materialProperty.color)&&(this._materialProperty.color.isConstant||n)&&(a=this._materialProperty.color.getValue(e,Vpe)),l(a)||(a=z.WHITE),s.color=Jt.fromColor(a)}return l(this._options.offsetAttribute)&&(s.offset=Tr.fromCartesian3(X.getValueOrDefault(this._terrainOffsetProperty,e,Upe,zpe))),new Ft({id:t,geometry:Ic.fromDimensions(this._options),modelMatrix:t.computeModelMatrixForHeightReference(e,t.box.heightReference,this._options.dimensions.z*.5,this._scene.ellipsoid),attributes:s})};Df.prototype.createOutlineGeometryInstance=function(e){let t=this._entity,n=t.isAvailable(e),i=X.getValueOrDefault(this._outlineColorProperty,e,z.BLACK,Vpe),r=this._distanceDisplayConditionProperty.getValue(e),o={show:new Pn(n&&t.isShowing&&this._showProperty.getValue(e)&&this._showOutlineProperty.getValue(e)),color:Jt.fromColor(i),distanceDisplayCondition:Qn.fromDistanceDisplayCondition(r),offset:void 0};return l(this._options.offsetAttribute)&&(o.offset=Tr.fromCartesian3(X.getValueOrDefault(this._terrainOffsetProperty,e,Upe,zpe))),new Ft({id:t,geometry:$h.fromDimensions(this._options),modelMatrix:t.computeModelMatrixForHeightReference(e,t.box.heightReference,this._options.dimensions.z*.5,this._scene.ellipsoid),attributes:o})};Df.prototype._computeCenter=function(e,t){return X.getValueOrUndefined(this._entity.position,e,t)};Df.prototype._isHidden=function(e,t){return!l(t.dimensions)||!l(e.position)||Pi.prototype._isHidden.call(this,e,t)};Df.prototype._isDynamic=function(e,t){return!e.position.isConstant||!X.isConstant(e.orientation)||!t.dimensions.isConstant||!X.isConstant(t.outlineWidth)};Df.prototype._setStaticOptions=function(e,t){let n=X.getValueOrDefault(t.heightReference,nt.MINIMUM_VALUE,We.NONE),i=this._options;i.vertexFormat=this._materialProperty instanceof Kt?yn.VERTEX_FORMAT:Er.MaterialSupport.TEXTURED.vertexFormat,i.dimensions=t.dimensions.getValue(nt.MINIMUM_VALUE,i.dimensions),i.offsetAttribute=n!==We.NONE?mn.ALL:void 0};Df.prototype._onEntityPropertyChanged=Pg;Df.DynamicGeometryUpdater=Wv;function Wv(e,t,n){Ii.call(this,e,t,n)}l(Object.create)&&(Wv.prototype=Object.create(Ii.prototype),Wv.prototype.constructor=Wv);Wv.prototype._isHidden=function(e,t,n){let i=X.getValueOrUndefined(e.position,n,Z7e),r=this._options.dimensions;return!l(i)||!l(r)||Ii.prototype._isHidden.call(this,e,t,n)};Wv.prototype._setOptions=function(e,t,n){let i=X.getValueOrDefault(t.heightReference,n,We.NONE),r=this._options;r.dimensions=X.getValueOrUndefined(t.dimensions,n,r.dimensions),r.offsetAttribute=i!==We.NONE?mn.ALL:void 0};var UN=Df;function Wx(e,t,n){this._callback=void 0,this._isConstant=void 0,this._referenceFrame=n??ji.FIXED,this._definitionChanged=new be,this.setCallback(e,t)}Object.defineProperties(Wx.prototype,{isConstant:{get:function(){return this._isConstant}},definitionChanged:{get:function(){return this._definitionChanged}},referenceFrame:{get:function(){return this._referenceFrame}}});var eWe=new K;Wx.prototype.getValue=function(e,t){return l(e)||(e=K.now(eWe)),this.getValueInReferenceFrame(e,ji.FIXED,t)};Wx.prototype.setCallback=function(e,t){let n=this._callback!==e||this._isConstant!==t;this._callback=e,this._isConstant=t,n&&this._definitionChanged.raiseEvent(this)};Wx.prototype.getValueInReferenceFrame=function(e,t,n){let i=this._callback(e,n);return Zh.convertToReferenceFrame(e,i,this._referenceFrame,t,n)};Wx.prototype.equals=function(e){return this===e||e instanceof Wx&&this._callback===e._callback&&this._isConstant===e._isConstant&&this._referenceFrame===e._referenceFrame};var zN=Wx;/*! @license DOMPurify 3.4.14 | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/3.4.14/LICENSE */function jpe(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,i=Array(t);n<t;n++)i[n]=e[n];return i}function tWe(e){if(Array.isArray(e))return e}function nWe(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var i,r,o,s,a=[],c=!0,u=!1;try{if(o=(n=n.call(e)).next,t!==0)for(;!(c=(i=o.call(n)).done)&&(a.push(i.value),a.length!==t);c=!0);}catch(f){u=!0,r=f}finally{try{if(!c&&n.return!=null&&(s=n.return(),Object(s)!==s))return}finally{if(u)throw r}}return a}}function iWe(){throw new TypeError(`Invalid attempt to destructure non-iterable instance. -In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function rWe(e,t){return tWe(e)||nWe(e,t)||oWe(e,t)||iWe()}function oWe(e,t){if(e){if(typeof e=="string")return jpe(e,t);var n={}.toString.call(e).slice(8,-1);return n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set"?Array.from(e):n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?jpe(e,t):void 0}}var i0e=Object.entries,Hpe=Object.setPrototypeOf,sWe=Object.isFrozen,aWe=Object.getPrototypeOf,cWe=Object.getOwnPropertyDescriptor,ka=Object.freeze,uc=Object.seal,qv=Object.create,r0e=typeof Reflect<"u"&&Reflect,IK=r0e.apply,PK=r0e.construct;ka||(ka=function(t){return t});uc||(uc=function(t){return t});IK||(IK=function(t,n){for(var i=arguments.length,r=new Array(i>2?i-2:0),o=2;o<i;o++)r[o-2]=arguments[o];return t.apply(n,r)});PK||(PK=function(t){for(var n=arguments.length,i=new Array(n>1?n-1:0),r=1;r<n;r++)i[r-1]=arguments[r];return new t(...i)});var Yx=ga(Array.prototype.forEach),lWe=ga(Array.prototype.lastIndexOf),Gpe=ga(Array.prototype.pop),VN=ga(Array.prototype.push),uWe=ga(Array.prototype.splice),Yv=Array.isArray,GN=ga(String.prototype.toLowerCase),TK=ga(String.prototype.toString),Wpe=ga(String.prototype.match),jN=ga(String.prototype.replace),qpe=ga(String.prototype.indexOf),fWe=ga(String.prototype.trim),dWe=ga(Number.prototype.toString),hWe=ga(Boolean.prototype.toString),Ype=typeof BigInt>"u"?null:ga(BigInt.prototype.toString),Xpe=typeof Symbol>"u"?null:ga(Symbol.prototype.toString),Bu=ga(Object.prototype.hasOwnProperty),HN=ga(Object.prototype.toString),tl=ga(RegExp.prototype.test),qx=mWe(TypeError);function ga(e){return function(t){t instanceof RegExp&&(t.lastIndex=0);for(var n=arguments.length,i=new Array(n>1?n-1:0),r=1;r<n;r++)i[r-1]=arguments[r];return IK(e,t,i)}}function mWe(e){return function(){for(var t=arguments.length,n=new Array(t),i=0;i<t;i++)n[i]=arguments[i];return PK(e,n)}}function Ir(e,t){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:GN;if(Hpe&&Hpe(e,null),!Yv(t))return e;let i=t.length;for(;i--;){let r=t[i];if(typeof r=="string"){let o=n(r);o!==r&&(sWe(t)||(t[i]=o),r=o)}e[r]=!0}return e}function pWe(e){for(let t=0;t<e.length;t++)Bu(e,t)||(e[t]=null);return e}function Of(e){let t=qv(null);for(let i of i0e(e)){var n=rWe(i,2);let r=n[0],o=n[1];Bu(e,r)&&(Yv(o)?t[r]=pWe(o):o&&typeof o=="object"&&o.constructor===Object?t[r]=Of(o):t[r]=o)}return t}function gWe(e){switch(typeof e){case"string":return e;case"number":return dWe(e);case"boolean":return hWe(e);case"bigint":return Ype?Ype(e):"0";case"symbol":return Xpe?Xpe(e):"Symbol()";case"undefined":return HN(e);case"function":case"object":{if(e===null)return HN(e);let t=e,n=im(t,"toString");if(typeof n=="function"){let i=n(t);return typeof i=="string"?i:HN(i)}return HN(e)}default:return HN(e)}}function im(e,t){for(;e!==null;){let i=cWe(e,t);if(i){if(i.get)return ga(i.get);if(typeof i.value=="function")return ga(i.value)}e=aWe(e)}function n(){return null}return n}function _We(e){try{return tl(e,""),!0}catch{return!1}}var Kpe=ka(["a","abbr","acronym","address","area","article","aside","audio","b","bdi","bdo","big","blink","blockquote","body","br","button","canvas","caption","center","cite","code","col","colgroup","content","data","datalist","dd","decorator","del","details","dfn","dialog","dir","div","dl","dt","element","em","fieldset","figcaption","figure","font","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","img","input","ins","kbd","label","legend","li","main","map","mark","marquee","menu","menuitem","meter","nav","nobr","ol","optgroup","option","output","p","picture","pre","progress","q","rp","rt","ruby","s","samp","search","section","select","shadow","slot","small","source","spacer","span","strike","strong","style","sub","summary","sup","table","tbody","td","template","textarea","tfoot","th","thead","time","tr","track","tt","u","ul","var","video","wbr"]),EK=ka(["svg","a","altglyph","altglyphdef","altglyphitem","animatecolor","animatemotion","animatetransform","circle","clippath","defs","desc","ellipse","enterkeyhint","exportparts","filter","font","g","glyph","glyphref","hkern","image","inputmode","line","lineargradient","marker","mask","metadata","mpath","part","path","pattern","polygon","polyline","radialgradient","rect","stop","style","switch","symbol","text","textpath","title","tref","tspan","view","vkern"]),CK=ka(["feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feDropShadow","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence"]),yWe=ka(["animate","color-profile","cursor","discard","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","foreignobject","hatch","hatchpath","mesh","meshgradient","meshpatch","meshrow","missing-glyph","script","set","solidcolor","unknown","use"]),vK=ka(["math","menclose","merror","mfenced","mfrac","mglyph","mi","mlabeledtr","mmultiscripts","mn","mo","mover","mpadded","mphantom","mroot","mrow","ms","mspace","msqrt","mstyle","msub","msup","msubsup","mtable","mtd","mtext","mtr","munder","munderover","mprescripts"]),AWe=ka(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),$pe=ka(["#text"]),Jpe=ka(["accept","action","align","alt","autocapitalize","autocomplete","autopictureinpicture","autoplay","background","bgcolor","border","capture","cellpadding","cellspacing","checked","cite","class","clear","color","cols","colspan","command","commandfor","controls","controlslist","coords","crossorigin","datetime","decoding","default","dir","disabled","disablepictureinpicture","disableremoteplayback","download","draggable","enctype","enterkeyhint","exportparts","face","for","headers","height","hidden","high","href","hreflang","id","inert","inputmode","integrity","ismap","kind","label","lang","list","loading","loop","low","max","maxlength","media","method","min","minlength","multiple","muted","name","nonce","noshade","novalidate","nowrap","open","optimum","part","pattern","placeholder","playsinline","popover","popovertarget","popovertargetaction","poster","preload","pubdate","radiogroup","readonly","rel","required","rev","reversed","role","rows","rowspan","spellcheck","scope","selected","shape","size","sizes","slot","span","srclang","start","src","srcset","step","style","summary","tabindex","title","translate","type","usemap","valign","value","width","wrap","xmlns"]),SK=ka(["accent-height","accumulate","additive","alignment-baseline","amplitude","ascent","attributename","attributetype","azimuth","basefrequency","baseline-shift","begin","bias","by","class","clip","clippathunits","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","cx","cy","d","dx","dy","diffuseconstant","direction","display","divisor","dominant-baseline","dur","edgemode","elevation","end","exponent","fill","fill-opacity","fill-rule","filter","filterunits","flood-color","flood-opacity","font-family","font-size","font-size-adjust","font-stretch","font-style","font-variant","font-weight","fx","fy","g1","g2","glyph-name","glyphref","gradientunits","gradienttransform","height","href","id","image-rendering","in","in2","intercept","k","k1","k2","k3","k4","kerning","keypoints","keysplines","keytimes","lang","lengthadjust","letter-spacing","kernelmatrix","kernelunitlength","lighting-color","local","marker-end","marker-mid","marker-start","markerheight","markerunits","markerwidth","maskcontentunits","maskunits","max","mask","mask-type","media","method","mode","min","name","numoctaves","offset","operator","opacity","order","orient","orientation","origin","overflow","paint-order","path","pathlength","patterncontentunits","patterntransform","patternunits","pointer-events","points","preservealpha","preserveaspectratio","primitiveunits","r","rx","ry","radius","refx","refy","repeatcount","repeatdur","restart","result","rotate","scale","seed","shape-rendering","slope","specularconstant","specularexponent","spreadmethod","startoffset","stddeviation","stitchtiles","stop-color","stop-opacity","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke","stroke-width","style","surfacescale","systemlanguage","tabindex","tablevalues","targetx","targety","transform","transform-origin","text-anchor","text-decoration","text-orientation","text-rendering","textlength","type","u1","u2","unicode","values","vector-effect","viewbox","visibility","version","vert-adv-y","vert-origin-x","vert-origin-y","width","word-spacing","wrap","writing-mode","xchannelselector","ychannelselector","x","x1","x2","xmlns","y","y1","y2","z","zoomandpan"]),Zpe=ka(["accent","accentunder","align","bevelled","close","columnalign","columnlines","columnspacing","columnspan","denomalign","depth","dir","display","displaystyle","encoding","fence","frame","height","href","id","largeop","length","linethickness","lquote","lspace","mathbackground","mathcolor","mathsize","mathvariant","maxsize","minsize","movablelimits","notation","numalign","open","rowalign","rowlines","rowspacing","rowspan","rspace","rquote","scriptlevel","scriptminsize","scriptsizemultiplier","selection","separator","separators","stretchy","subscriptshift","supscriptshift","symmetric","voffset","width","xmlns"]),P6=ka(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),bWe=uc(/{{[\w\W]*|^[\w\W]*}}/g),xWe=uc(/<%[\w\W]*|^[\w\W]*%>/g),TWe=uc(/\${[\w\W]*/g),EWe=uc(/^data-[\-\w.\u00B7-\uFFFF]+$/),CWe=uc(/^aria-[\-\w]+$/),Qpe=uc(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),vWe=uc(/^(?:\w+script|data):/i),SWe=uc(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),wWe=uc(/^html$/i),IWe=uc(/^[a-z][.\w]*(-[.\w]+)+$/i),e0e=uc(/<[/\w!]/g),t0e=uc(/<[/\w]/g),PWe=uc(/<\/no(script|embed|frames)/i),DWe=uc(/\/>/i),Rf={element:1,attribute:2,text:3,cdataSection:4,entityReference:5,entityNode:6,processingInstruction:7,comment:8,document:9,documentType:10,documentFragment:11,notation:12},o0e=["style","script","xmp","iframe","noembed","noframes","plaintext","noscript"],RWe=ka(Ir({},o0e)),OWe=(function(){let e={};return Yx(o0e,t=>{e[t]=uc(new RegExp("</"+t+"(?=[\\t\\n\\f\\r />])","i"))}),ka(e)})(),MWe=function(){return typeof window>"u"?null:window},NWe=function(t,n){if(typeof t!="object"||typeof t.createPolicy!="function")return null;let i=null,r="data-tt-policy-suffix";n&&n.hasAttribute(r)&&(i=n.getAttribute(r));let o="dompurify"+(i?"#"+i:"");try{return t.createPolicy(o,{createHTML(s){return s},createScriptURL(s){return s}})}catch{return console.warn("TrustedTypes policy "+o+" could not be created."),null}},n0e=function(){return{afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}},Jy=function(t,n,i,r){return Bu(t,n)&&Yv(t[n])?Ir(r.base?Of(r.base):{},t[n],r.transform):i},wK=function(t,n,i){let r=Bu(t,n)?t[n]:void 0;return r&&typeof r=="object"?Of(r):i()};function s0e(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:MWe(),t=Ct=>s0e(Ct);if(t.version="3.4.14",t.removed=[],!e||!e.document||e.document.nodeType!==Rf.document||!e.Element)return t.isSupported=!1,t;let n=e.document,i=n,r=i.currentScript;e.DocumentFragment;let o=e.HTMLTemplateElement,s=e.Node,a=e.Element,c=e.NodeFilter,u=e.NamedNodeMap;u===void 0&&(e.NamedNodeMap||e.MozNamedAttrMap),e.HTMLFormElement;let f=e.DOMParser,d=e.trustedTypes,p=a.prototype,g=im(p,"cloneNode"),m=im(p,"remove"),y=im(p,"nextSibling"),A=im(p,"childNodes"),b=im(p,"parentNode"),x=im(p,"shadowRoot"),T=im(p,"attributes"),E=s&&s.prototype?im(s.prototype,"nodeType"):null,v=s&&s.prototype?im(s.prototype,"nodeName"):null,S=s&&s.prototype?im(s.prototype,"ownerDocument"):null,I=function(ye){return E?E(ye):ye.nodeType},R=function(ye){return v?v(ye):ye.nodeName};if(typeof o=="function"){let Ct=n.createElement("template");Ct.content&&Ct.content.ownerDocument&&(n=Ct.content.ownerDocument)}let O,L="",_,C=!1,w=0,P=function(){if(w>0)throw qx('A configured TRUSTED_TYPES_POLICY callback (createHTML or createScriptURL) must not call DOMPurify.sanitize, as that causes infinite recursion. Do not pass a policy whose callbacks wrap DOMPurify as TRUSTED_TYPES_POLICY; see the "DOMPurify and Trusted Types" section of the README.')},M=function(ye){P(),w++;try{return O.createHTML(ye)}finally{w--}},F=function(ye){P(),w++;try{return O.createScriptURL(ye)}finally{w--}},V=function(){return C||(_=NWe(d,r),C=!0),_},B=n,j=B.implementation,k=B.createNodeIterator,G=B.createDocumentFragment,q=B.getElementsByTagName,Q=i.importNode,W=n0e();t.isSupported=typeof i0e=="function"&&typeof b=="function"&&j&&j.createHTMLDocument!==void 0;let J=bWe,Z=xWe,ae=TWe,Ae=EWe,fe=CWe,xe=vWe,ge=SWe,we=IWe,Se=Qpe,Re=null,Qe=Ir({},[...Kpe,...EK,...CK,...vK,...$pe]),He=null,Xe=Ir({},[...Jpe,...SK,...Zpe,...P6]),$e=Object.seal(qv(null,{tagNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},allowCustomizedBuiltInElements:{writable:!0,configurable:!1,enumerable:!0,value:!1}})),Pe=null,qe=null,st=Object.seal(qv(null,{tagCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeCheck:{writable:!0,configurable:!1,enumerable:!0,value:null}})),vt=!0,Gt=!0,lt=!1,mt=!0,ft=!1,Xt=!0,rt=!1,ht=!1,Bi=null,Xn=null,bi=!1,Wi=!1,wi=!1,hi=!1,xi=!0,jn=!1,nn="user-content-",Wn=!0,Zi=!1,Mr={},fo=null,Bs=Ir({},["annotation-xml","audio","colgroup","desc","foreignobject","head","iframe","math","mi","mn","mo","ms","mtext","noembed","noframes","noscript","plaintext","script","selectedcontent","style","svg","template","thead","title","video","xmp"]),Ks=null,no=Ir({},["audio","video","img","source","image","track"]),gi=null,ho=Ir({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),ur="http://www.w3.org/1998/Math/MathML",Zo="http://www.w3.org/2000/svg",Bn="http://www.w3.org/1999/xhtml",qi=Bn,ki=!1,Nr=null,Wc=Ir({},[ur,Zo,Bn],TK),xd=ka(["mi","mo","mn","ms","mtext"]),xp=Ir({},xd),Nh=ka(["annotation-xml"]),da=Ir({},Nh),Tp=Ir({},["title","style","font","a","script"]),ks=null,tc=["application/xhtml+xml","text/html"],Kb="text/html",ri=null,Kr=null,Ol=n.createElement("form"),Z0=function(ye){return ye instanceof RegExp||ye instanceof Function},Ma=function(){let ye=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(Kr&&Kr===ye)return;(!ye||typeof ye!="object")&&(ye={}),ye=Of(ye),ks=tc.indexOf(ye.PARSER_MEDIA_TYPE)===-1?Kb:ye.PARSER_MEDIA_TYPE,ri=ks==="application/xhtml+xml"?TK:GN,Re=Jy(ye,"ALLOWED_TAGS",Qe,{transform:ri}),He=Jy(ye,"ALLOWED_ATTR",Xe,{transform:ri}),Nr=Jy(ye,"ALLOWED_NAMESPACES",Wc,{transform:TK}),gi=Jy(ye,"ADD_URI_SAFE_ATTR",ho,{transform:ri,base:ho}),Ks=Jy(ye,"ADD_DATA_URI_TAGS",no,{transform:ri,base:no}),fo=Jy(ye,"FORBID_CONTENTS",Bs,{transform:ri}),Pe=Jy(ye,"FORBID_TAGS",Of({}),{transform:ri}),qe=Jy(ye,"FORBID_ATTR",Of({}),{transform:ri}),Mr=Bu(ye,"USE_PROFILES")?ye.USE_PROFILES&&typeof ye.USE_PROFILES=="object"?Of(ye.USE_PROFILES):ye.USE_PROFILES:!1,vt=ye.ALLOW_ARIA_ATTR!==!1,Gt=ye.ALLOW_DATA_ATTR!==!1,lt=ye.ALLOW_UNKNOWN_PROTOCOLS||!1,mt=ye.ALLOW_SELF_CLOSE_IN_ATTR!==!1,ft=ye.SAFE_FOR_TEMPLATES||!1,Xt=ye.SAFE_FOR_XML!==!1,rt=ye.WHOLE_DOCUMENT||!1,Wi=ye.RETURN_DOM||!1,wi=ye.RETURN_DOM_FRAGMENT||!1,hi=ye.RETURN_TRUSTED_TYPE||!1,bi=ye.FORCE_BODY||!1,xi=ye.SANITIZE_DOM!==!1,jn=ye.SANITIZE_NAMED_PROPS||!1,Wn=ye.KEEP_CONTENT!==!1,Zi=ye.IN_PLACE||!1,Se=_We(ye.ALLOWED_URI_REGEXP)?ye.ALLOWED_URI_REGEXP:Qpe,qi=typeof ye.NAMESPACE=="string"?ye.NAMESPACE:Bn,xp=wK(ye,"MATHML_TEXT_INTEGRATION_POINTS",()=>Ir({},xd)),da=wK(ye,"HTML_INTEGRATION_POINTS",()=>Ir({},Nh));let Fe=wK(ye,"CUSTOM_ELEMENT_HANDLING",()=>qv(null));if($e=qv(null),Bu(Fe,"tagNameCheck")&&Z0(Fe.tagNameCheck)&&($e.tagNameCheck=Fe.tagNameCheck),Bu(Fe,"attributeNameCheck")&&Z0(Fe.attributeNameCheck)&&($e.attributeNameCheck=Fe.attributeNameCheck),Bu(Fe,"allowCustomizedBuiltInElements")&&typeof Fe.allowCustomizedBuiltInElements=="boolean"&&($e.allowCustomizedBuiltInElements=Fe.allowCustomizedBuiltInElements),uc($e),ft&&(Gt=!1),wi&&(Wi=!0),Mr&&(Re=Ir({},$pe),He=qv(null),Mr.html===!0&&(Ir(Re,Kpe),Ir(He,Jpe)),Mr.svg===!0&&(Ir(Re,EK),Ir(He,SK),Ir(He,P6)),Mr.svgFilters===!0&&(Ir(Re,CK),Ir(He,SK),Ir(He,P6)),Mr.mathMl===!0&&(Ir(Re,vK),Ir(He,Zpe),Ir(He,P6))),st.tagCheck=null,st.attributeCheck=null,Bu(ye,"ADD_TAGS")&&(typeof ye.ADD_TAGS=="function"?st.tagCheck=ye.ADD_TAGS:Yv(ye.ADD_TAGS)&&(Re===Qe&&(Re=Of(Re)),Ir(Re,ye.ADD_TAGS,ri))),Bu(ye,"ADD_ATTR")&&(typeof ye.ADD_ATTR=="function"?st.attributeCheck=ye.ADD_ATTR:Yv(ye.ADD_ATTR)&&(He===Xe&&(He=Of(He)),Ir(He,ye.ADD_ATTR,ri))),Bu(ye,"ADD_FORBID_CONTENTS")&&Yv(ye.ADD_FORBID_CONTENTS)&&(fo===Bs&&(fo=Of(fo)),Ir(fo,ye.ADD_FORBID_CONTENTS,ri)),Wn&&(Re["#text"]=!0),rt&&Ir(Re,["html","head","body"]),Re.table&&(Ir(Re,["tbody"]),delete Pe.tbody),ye.TRUSTED_TYPES_POLICY){if(typeof ye.TRUSTED_TYPES_POLICY.createHTML!="function")throw qx('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if(typeof ye.TRUSTED_TYPES_POLICY.createScriptURL!="function")throw qx('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');let gt=O;O=ye.TRUSTED_TYPES_POLICY;try{L=M("")}catch(on){throw O=gt,on}}else ye.TRUSTED_TYPES_POLICY===null?(O=void 0,L=""):(O===void 0&&(O=V()),O&&typeof L=="string"&&(L=M("")));ka&&ka(ye),Kr=ye},Ep=Ir({},[...EK,...CK,...yWe]),Cy=Ir({},[...vK,...AWe]),Sq=function(ye,Fe,gt){return Fe.namespaceURI===Bn?ye==="svg":Fe.namespaceURI===ur?ye==="svg"&&(gt==="annotation-xml"||xp[gt]):!!Ep[ye]},wq=function(ye,Fe,gt){return Fe.namespaceURI===Bn?ye==="math":Fe.namespaceURI===Zo?ye==="math"&&da[gt]:!!Cy[ye]},Iq=function(ye,Fe,gt){return Fe.namespaceURI===Zo&&!da[gt]||Fe.namespaceURI===ur&&!xp[gt]?!1:!Cy[ye]&&(Tp[ye]||!Ep[ye])},Pq=function(ye){let Fe=b(ye);(!Fe||!Fe.tagName)&&(Fe={namespaceURI:qi,tagName:"template"});let gt=GN(ye.tagName),on=GN(Fe.tagName);return Nr[ye.namespaceURI]?ye.namespaceURI===Zo?Sq(gt,Fe,on):ye.namespaceURI===ur?wq(gt,Fe,on):ye.namespaceURI===Bn?Iq(gt,Fe,on):!!(ks==="application/xhtml+xml"&&Nr[ye.namespaceURI]):!1},Cp=function(ye){VN(t.removed,{element:ye});try{b(ye).removeChild(ye)}catch{if(m(ye),!b(ye))throw qx("a node selected for removal could not be detached from its tree and cannot be safely returned; refusing to sanitize in place")}},QC=function(ye,Fe,gt){try{ye.removeAttributeNode(Fe)}catch{try{ye.removeAttribute(gt)}catch{}}},$b=function(ye){Jb(ye);let Fe=A(ye);if(Fe){let on=[];Yx(Fe,In=>{VN(on,In)}),Yx(on,In=>{try{m(In)}catch{}})}let gt=T(ye);if(gt)for(let on=gt.length-1;on>=0;--on){let In=gt[on],oi=In&&In.name;typeof oi=="string"&&QC(ye,In,oi)}},Lh=function(ye,Fe,gt){if(!gt)try{gt=Fe.getAttributeNode(ye)}catch{gt=null}VN(t.removed,{attribute:gt||null,from:Fe});try{gt?Fe.removeAttributeNode(gt):Fe.removeAttribute(ye)}catch{try{Fe.removeAttribute(ye)}catch{}}if(ye==="is")if(Wi||wi)try{Cp(Fe)}catch{}else try{Fe.setAttribute(ye,"")}catch{}},Dq=function(ye){let Fe=T(ye);if(Fe)for(let gt=Fe.length-1;gt>=0;--gt){let on=Fe[gt],In=on&&on.name;typeof In!="string"||He[ri(In)]||QC(ye,on,In)}},Jb=function(ye){let Fe=[ye];for(;Fe.length>0;){let gt=Fe.pop();I(gt)===Rf.element&&Dq(gt);let In=A(gt);if(In)for(let oi=In.length-1;oi>=0;--oi)Fe.push(In[oi])}},ev=function(ye,Fe){return Xt?ye==="patchsrc"?!0:ye==="for"&&Fe!=="label"&&Fe!=="output":!1},vp=function(ye){if(!Xt)return;let Fe=[ye];for(;Fe.length>0;){let gt=Fe.pop(),on=I(gt);if(on===Rf.processingInstruction||on===Rf.comment&&tl(t0e,gt.data)){try{m(gt)}catch{}continue}if(on===Rf.element){let oi=gt,So=ri(R(gt));try{oi.hasAttribute&&oi.hasAttribute("patchsrc")&&oi.removeAttribute("patchsrc"),oi.hasAttribute&&oi.hasAttribute("for")&&ev("for",So)&&oi.removeAttribute("for")}catch{}}let In=A(gt);if(In)for(let oi=In.length-1;oi>=0;--oi)Fe.push(In[oi])}},Zb=function(ye){let Fe=null,gt=null;if(bi)ye="<remove></remove>"+ye;else{let oi=Wpe(ye,/^[\r\n\t ]+/);gt=oi&&oi[0]}ks==="application/xhtml+xml"&&qi===Bn&&(ye='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+ye+"</body></html>");let on=O?M(ye):ye;if(qi===Bn)try{Fe=new f().parseFromString(on,ks)}catch{}if(!Fe||!Fe.documentElement){Fe=j.createDocument(qi,"template",null);try{Fe.documentElement.innerHTML=ki?L:on}catch{}}let In=Fe.body||Fe.documentElement;return ye&>&&In.insertBefore(n.createTextNode(gt),In.childNodes[0]||null),qi===Bn?q.call(Fe,rt?"html":"body")[0]:rt?Fe.documentElement:In},nD=function(ye){let Fe=S?S(ye):ye.ownerDocument;return k.call(Fe||ye,ye,c.SHOW_ELEMENT|c.SHOW_COMMENT|c.SHOW_TEXT|c.SHOW_PROCESSING_INSTRUCTION|c.SHOW_CDATA_SECTION,null)},tv=function(ye){return ye=jN(ye,J," "),ye=jN(ye,Z," "),ye=jN(ye,ae," "),ye},vy=function(ye){var Fe;ye.normalize();let gt=S?S(ye):ye.ownerDocument,on=k.call(gt||ye,ye,c.SHOW_TEXT|c.SHOW_COMMENT|c.SHOW_CDATA_SECTION|c.SHOW_PROCESSING_INSTRUCTION,null),In=on.nextNode();for(;In;)In.data=tv(In.data),In=on.nextNode();let oi=(Fe=ye.querySelectorAll)===null||Fe===void 0?void 0:Fe.call(ye,"template");oi&&Yx(oi,So=>{ne(So.content)&&vy(So.content)})},ce=function(ye){let Fe=v?v(ye):null;return typeof Fe!="string"||ri(Fe)!=="form"?!1:typeof ye.nodeName!="string"||typeof ye.textContent!="string"||typeof ye.removeChild!="function"||ye.attributes!==T(ye)||typeof ye.removeAttribute!="function"||typeof ye.setAttribute!="function"||typeof ye.namespaceURI!="string"||typeof ye.insertBefore!="function"||typeof ye.hasChildNodes!="function"||ye.nodeType!==E(ye)||ye.childNodes!==A(ye)},ne=function(ye){if(!E||typeof ye!="object"||ye===null)return!1;try{return E(ye)===Rf.documentFragment}catch{return!1}},Te=function(ye){if(!E||typeof ye!="object"||ye===null)return!1;try{return typeof E(ye)=="number"}catch{return!1}};function Ce(Ct,ye,Fe){Ct.length!==0&&Yx(Ct,gt=>{gt.call(t,ye,Fe,Kr)})}let Ze=function(ye,Fe){return!!(Xt&&ye.hasChildNodes()&&!Te(ye.firstElementChild)&&tl(e0e,ye.textContent)&&tl(e0e,ye.innerHTML)||Xt&&ye.namespaceURI===Bn&&RWe[Fe]&&(Te(ye.firstElementChild)||typeof ye.textContent=="string"&&tl(OWe[Fe],ye.textContent))||ye.nodeType===Rf.processingInstruction||Xt&&ye.nodeType===Rf.comment&&tl(t0e,ye.data))},Et=function(ye,Fe){if(ye instanceof RegExp)return tl(ye,Fe);if(ye instanceof Function){for(var gt=arguments.length,on=new Array(gt>2?gt-2:0),In=2;In<gt;In++)on[In-2]=arguments[In];return!!ye(Fe,...on)}return!1},pt=function(ye,Fe,gt){if(!Pe[Fe]&&mo(Fe)&&Et($e.tagNameCheck,Fe))return!1;if(Wn&&!fo[Fe]){let on=b(ye),In=A(ye);if(In&&on){let oi=In.length;for(let So=oi-1;So>=0;--So){let ds=ye===gt?g(In[So],!0):In[So];on.insertBefore(ds,y(ye))}}}return Cp(ye),!0},wt=function(ye,Fe,gt,on){return ye.length===0?Fe:Fe===gt||Fe===on?Of(Fe):Fe},bn=function(ye,Fe){return ye===Fe||b(ye)!==null?!1:(Zi&&Jb(ye),!0)},qn=function(ye,Fe){if(Ce(W.beforeSanitizeElements,ye,null),bn(ye,Fe))return!0;if(ce(ye))return Cp(ye),!0;let gt=ri(R(ye));if(Re=wt(W.uponSanitizeElement,Re,Qe,Bi),Ce(W.uponSanitizeElement,ye,{tagName:gt,allowedTags:Re}),bn(ye,Fe))return!0;if(Ze(ye,gt))return Cp(ye),!0;if(Pe[gt]||!(st.tagCheck instanceof Function&&st.tagCheck(gt))&&!Re[gt]){let In=pt(ye,gt,Fe);return In===!1&&Ce(W.afterSanitizeElements,ye,null),In}if(I(ye)===Rf.element&&!Pq(ye)||(gt==="noscript"||gt==="noembed"||gt==="noframes")&&tl(PWe,ye.innerHTML))return Cp(ye),!0;if(ft&&ye.nodeType===Rf.text){let In=tv(ye.textContent);ye.textContent!==In&&(VN(t.removed,{element:ye.cloneNode()}),ye.textContent=In)}return Ce(W.afterSanitizeElements,ye,null),!1},_n=function(ye,Fe,gt){if(qe[Fe]||ev(Fe,ye)||xi&&(Fe==="id"||Fe==="name")&&(gt in n||gt in Ol))return!1;let on=He[Fe]||st.attributeCheck instanceof Function&&st.attributeCheck(Fe,ye);return Gt&&tl(Ae,Fe)||vt&&tl(fe,Fe)?!0:on?gi[Fe]||tl(Se,jN(gt,ge,""))||(Fe==="src"||Fe==="xlink:href"||Fe==="href")&&ye!=="script"&&qpe(gt,"data:")===0&&Ks[ye]||lt&&!tl(xe,jN(gt,ge,""))?!0:!gt:mo(ye)&&Et($e.tagNameCheck,ye)&&Et($e.attributeNameCheck,Fe,ye)||Fe==="is"&&$e.allowCustomizedBuiltInElements&&Et($e.tagNameCheck,gt)},vo=Ir({},["annotation-xml","color-profile","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","missing-glyph"]),mo=function(ye){return!vo[GN(ye)]&&tl(we,ye)},$s=function(ye,Fe,gt,on){if(O&&typeof d=="object"&&typeof d.getAttributeType=="function"&&!gt)switch(d.getAttributeType(ye,Fe)){case"TrustedHTML":return M(on);case"TrustedScriptURL":return F(on)}return on},Sc=function(ye,Fe,gt,on){try{gt?ye.setAttributeNS(gt,Fe,on):ye.setAttribute(Fe,on),ce(ye)?Cp(ye):Gpe(t.removed)}catch{Lh(Fe,ye)}},Ml=function(ye){Ce(W.beforeSanitizeAttributes,ye,null);let Fe=ye.attributes;if(!Fe||ce(ye))return;He=wt(W.uponSanitizeAttribute,He,Xe,Xn);let gt={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:He,forceKeepAttr:void 0},on=Fe.length,In=ri(ye.nodeName);for(;on--;){let oi=Fe[on],So=oi.name,ds=oi.namespaceURI,Su=oi.value,wu=ri(So),Rq=Su,Nl=So==="value"?Rq:fWe(Rq);if(gt.attrName=wu,gt.attrValue=Nl,gt.keepAttr=!0,gt.forceKeepAttr=void 0,Ce(W.uponSanitizeAttribute,ye,gt),Nl=gt.attrValue,jn&&(wu==="id"||wu==="name")&&qpe(Nl,nn)!==0&&(Lh(So,ye,oi),Nl=nn+Nl),Xt&&tl(/((--!?|])>)|<\/(style|script|title|xmp|textarea|noscript|iframe|noembed|noframes)/i,Nl)){Lh(So,ye,oi);continue}if(wu==="attributename"&&Wpe(Nl,"href")){Lh(So,ye,oi);continue}if(!gt.forceKeepAttr){if(!gt.keepAttr){Lh(So,ye,oi);continue}if(!mt&&tl(DWe,Nl)){Lh(So,ye,oi);continue}if(ft&&(Nl=tv(Nl)),!_n(In,wu,Nl)){Lh(So,ye,oi);continue}Nl=$s(In,wu,ds,Nl),Nl!==Rq&&Sc(ye,So,ds,Nl)}}Ce(W.afterSanitizeAttributes,ye,null)},vu=function(ye){let Fe=null,gt=nD(ye);for(Ce(W.beforeSanitizeShadowDOM,ye,null);Fe=gt.nextNode();)if(Ce(W.uponSanitizeShadowNode,Fe,null),qn(Fe,ye),Ml(Fe),ne(Fe.content)&&vu(Fe.content),I(Fe)===Rf.element){let on=x(Fe);ne(on)&&(Q0(on),vu(on))}Ce(W.afterSanitizeShadowDOM,ye,null)},Q0=function(ye){let Fe=[{node:ye,shadow:null}];for(;Fe.length>0;){let gt=Fe.pop();if(gt.shadow){vu(gt.shadow);continue}let on=gt.node,oi=I(on)===Rf.element,So=A(on);if(So)for(let ds=So.length-1;ds>=0;--ds)Fe.push({node:So[ds],shadow:null});if(oi){let ds=v?v(on):null;if(typeof ds=="string"&&ri(ds)==="template"){let Su=on.content;ne(Su)&&Fe.push({node:Su,shadow:null})}}if(oi){let ds=x(on);ne(ds)&&Fe.push({node:null,shadow:ds},{node:ds,shadow:null})}}};return t.sanitize=function(Ct){let ye=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},Fe=null,gt=null,on=null,In=null;if(ki=!Ct,ki&&(Ct="<!-->"),typeof Ct!="string"&&!Te(Ct)&&(Ct=gWe(Ct),typeof Ct!="string"))throw qx("dirty is not a string, aborting");if(!t.isSupported)return Ct;ht?(Re=Bi,He=Xn):Ma(ye),(W.uponSanitizeElement.length>0||W.uponSanitizeAttribute.length>0)&&(Re=Of(Re)),W.uponSanitizeAttribute.length>0&&(He=Of(He)),t.removed=[];let oi=Zi&&typeof Ct!="string"&&Te(Ct);if(oi){vp(Ct);let Su=R(Ct);if(typeof Su=="string"){let wu=ri(Su);if(!Re[wu]||Pe[wu])throw $b(Ct),qx("root node is forbidden and cannot be sanitized in-place")}if(ce(Ct))throw $b(Ct),qx("root node is clobbered and cannot be sanitized in-place");try{Q0(Ct)}catch(wu){throw $b(Ct),wu}}else if(Te(Ct))Fe=Zb("<!---->"),gt=Fe.ownerDocument.importNode(Ct,!0),gt.nodeType===Rf.element&>.nodeName==="BODY"||gt.nodeName==="HTML"?Fe=gt:Fe.appendChild(gt),Q0(gt);else{if(!Wi&&!ft&&!rt&&Ct.indexOf("<")===-1)return O&&hi?M(Ct):Ct;if(Fe=Zb(Ct),!Fe)return Wi?null:hi?L:""}Fe&&bi&&Cp(Fe.firstChild);let So=oi?Ct:Fe;try{let Su=nD(So);for(;on=Su.nextNode();)qn(on,So),Ml(on),ne(on.content)&&vu(on.content)}catch(Su){throw oi&&($b(Ct),Yx(t.removed,wu=>{wu.element&&Jb(wu.element)})),Su}if(oi)return Yx(t.removed,Su=>{Su.element&&Jb(Su.element)}),ft&&vy(Ct),Ct;if(Wi){if(ft&&vy(Fe),wi)for(In=G.call(Fe.ownerDocument);Fe.firstChild;)In.appendChild(Fe.firstChild);else In=Fe;return(He.shadowroot||He.shadowrootmode)&&(In=Q.call(i,In,!0)),In}let ds=rt?Fe.outerHTML:Fe.innerHTML;return rt&&Re["!doctype"]&&Fe.ownerDocument&&Fe.ownerDocument.doctype&&Fe.ownerDocument.doctype.name&&tl(wWe,Fe.ownerDocument.doctype.name)&&(ds="<!DOCTYPE "+Fe.ownerDocument.doctype.name+`> -`+ds),ft&&(ds=tv(ds)),O&&hi?M(ds):ds},t.setConfig=function(){let Ct=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};Ma(Ct),ht=!0,Bi=Re,Xn=He},t.clearConfig=function(){Kr=null,ht=!1,Bi=null,Xn=null,O=_,L=""},t.isValidAttribute=function(Ct,ye,Fe){Kr||Ma({});let gt=ri(Ct),on=ri(ye);return _n(gt,on,Fe)},t.addHook=function(Ct,ye){typeof ye=="function"&&Bu(W,Ct)&&VN(W[Ct],ye)},t.removeHook=function(Ct,ye){if(Bu(W,Ct)){if(ye!==void 0){let Fe=lWe(W[Ct],ye);return Fe===-1?void 0:uWe(W[Ct],Fe,1)[0]}return Gpe(W[Ct])}},t.removeHooks=function(Ct){Bu(W,Ct)&&(W[Ct]=[])},t.removeAllHooks=function(){W=n0e()},t}var a0e=s0e();var LWe=0,DK={},RK=class e{constructor(t,n){let i,r=t;l(DK[r])?i=DK[r]:(i=LWe++,DK[r]=i),n=n??!1,this._id=i,this._html=t,this._showOnScreen=n,this._element=void 0}get html(){return this._html}get id(){return this._id}get showOnScreen(){return this._showOnScreen}set showOnScreen(t){this._showOnScreen=t}get element(){if(!l(this._element)){let t=a0e.sanitize(this._html),n=document.createElement("div");n.className="cesium-credit-wrapper",n._creditId=this._id,n.style.display="inline",n.innerHTML=t;let i=n.querySelectorAll("a");for(let r=0;r<i.length;r++)i[r].setAttribute("target","_blank");this._element=n}return this._element}static equals(t,n){return t===n||l(t)&&l(n)&&t._id===n._id&&t._showOnScreen===n._showOnScreen}equals(t){return e.equals(this,t)}isIon(){return this.html.indexOf("ion-credit.png")!==-1}static getIonCredit(t){let n=l(t.collapsible)&&!t.collapsible;return new e(t.html,n)}static clone(t){if(l(t))return new e(t.html,t.showOnScreen)}},It=RK;function FWe(e,t){_t(e,t)}var qr=FWe;function Xx(e){this._url=e,this._cubeMapBuffers=void 0,this._texture=void 0,this._maximumMipmapLevel=void 0,this._loading=!1,this._ready=!1,this._errorEvent=new be}Object.defineProperties(Xx.prototype,{url:{get:function(){return this._url}},errorEvent:{get:function(){return this._errorEvent}},texture:{get:function(){return this._texture}},maximumMipmapLevel:{get:function(){return this._maximumMipmapLevel}},ready:{get:function(){return this._ready}}});Xx.isSupported=function(e){return(e.colorBufferHalfFloat&&e.halfFloatingPointTexture||e.floatingPointTexture&&e.colorBufferFloat)&&e.supportsTextureLod};function OK(e){e._cubeMapBuffers=void 0}Xx.prototype.update=function(e){let{context:t}=e;if(!Xx.isSupported(t))return;if(l(this._texture)){OK(this);return}if(!l(this._texture)&&!this._loading){let f=t.textureCache.getTexture(this._url);l(f)&&(OK(this),this._texture=f,this._maximumMipmapLevel=this._texture.maximumMipmapLevel,this._ready=!0)}let n=this._cubeMapBuffers;if(!l(n)&&!this._loading){let f=this;Ou(this._url).then(function(d){f._cubeMapBuffers=d,f._loading=!1}).catch(function(d){f.isDestroyed()||f._errorEvent.raiseEvent(d)}),this._loading=!0}if(!l(this._cubeMapBuffers))return;let{pixelDatatype:i}=n[0].positiveX;l(i)||(i=t.halfFloatingPointTexture?ze.HALF_FLOAT:ze.FLOAT);let r=Ke.RGBA,o=n.length;this._maximumMipmapLevel=o-1;let s=n[0].positiveX.width,a=Math.log2(s)+1;if(o!==a){let f={};Object.values(ns.FaceName).forEach(d=>{f[d]=void 0});for(let d=o;d<a;d++)n.push(f)}let c=new jt({minificationFilter:Wt.LINEAR_MIPMAP_LINEAR}),u=new ns({context:t,source:n[0],flipY:!1,pixelDatatype:i,pixelFormat:r,sampler:c});u.loadMipmaps(n.slice(1)),this._texture=u,this._texture.maximumMipmapLevel=this._maximumMipmapLevel,t.textureCache.addTexture(this._url,this._texture),this._ready=!0};Xx.prototype.isDestroyed=function(){return!1};Xx.prototype.destroy=function(){return OK(this),this._texture=this._texture&&this._texture.destroy(),le(this)};var rm=Xx;function WN(e){e=e??H.EMPTY_OBJECT;let t=l(e.imageBasedLightingFactor)?U.clone(e.imageBasedLightingFactor):new U(1,1);this._imageBasedLightingFactor=t;let n=e.sphericalHarmonicCoefficients;this._sphericalHarmonicCoefficients=n,this._specularEnvironmentMaps=e.specularEnvironmentMaps,this._specularEnvironmentCubeMap=void 0,this._specularEnvironmentCubeMapDirty=!0,this._specularEnvironmentMapLoaded=!1,this._previousSpecularEnvironmentMapLoaded=!1,this._useDefaultSpecularMaps=!1,this._useDefaultSphericalHarmonics=!1,this._shouldRegenerateShaders=!1,this._previousFrameNumber=void 0,this._previousFrameContext=void 0,this._previousImageBasedLightingFactor=U.clone(t),this._previousSphericalHarmonicCoefficients=n,this._removeErrorListener=void 0}Object.defineProperties(WN.prototype,{imageBasedLightingFactor:{get:function(){return this._imageBasedLightingFactor},set:function(e){this._previousImageBasedLightingFactor=U.clone(this._imageBasedLightingFactor,this._previousImageBasedLightingFactor),this._imageBasedLightingFactor=U.clone(e,this._imageBasedLightingFactor)}},sphericalHarmonicCoefficients:{get:function(){return this._sphericalHarmonicCoefficients},set:function(e){this._previousSphericalHarmonicCoefficients=this._sphericalHarmonicCoefficients,this._sphericalHarmonicCoefficients=e}},specularEnvironmentMaps:{get:function(){return this._specularEnvironmentMaps},set:function(e){e!==this._specularEnvironmentMaps&&(this._specularEnvironmentCubeMapDirty=this._specularEnvironmentCubeMapDirty||e!==this._specularEnvironmentMaps,this._specularEnvironmentMapLoaded=!1),this._specularEnvironmentMaps=e}},enabled:{get:function(){return this._imageBasedLightingFactor.x>0||this._imageBasedLightingFactor.y>0}},shouldRegenerateShaders:{get:function(){return this._shouldRegenerateShaders}},specularEnvironmentCubeMap:{get:function(){return this._specularEnvironmentCubeMap}},useDefaultSphericalHarmonics:{get:function(){return this._useDefaultSphericalHarmonics}},useDefaultSpecularMaps:{get:function(){return this._useDefaultSpecularMaps}},useSpecularEnvironmentMaps:{get:function(){return l(this._specularEnvironmentCubeMap)&&this._specularEnvironmentCubeMap.ready||this._useDefaultSpecularMaps}}});function BWe(e,t){if(rm.isSupported(t)){if(e._specularEnvironmentCubeMap=e._specularEnvironmentCubeMap&&e._specularEnvironmentCubeMap.destroy(),l(e._specularEnvironmentMaps)){let n=new rm(e._specularEnvironmentMaps);e._specularEnvironmentCubeMap=n,e._removeErrorListener=n.errorEvent.addEventListener(i=>{console.error(`Error loading specularEnvironmentMaps: ${i}`)})}e._shouldRegenerateShaders=!0}}WN.prototype.update=function(e){if(e.frameNumber===this._previousFrameNumber&&e.context===this._previousFrameContext)return;this._previousFrameNumber=e.frameNumber;let t=this._previousFrameContext=e.context;e.brdfLutGenerator.update(e),this._shouldRegenerateShaders=!1;let n=this._imageBasedLightingFactor,i=this._previousImageBasedLightingFactor;U.equals(n,i)||(this._shouldRegenerateShaders=n.x>0&&i.x===0||n.x===0&&i.x>0,this._shouldRegenerateShaders=this._shouldRegenerateShaders||n.y>0&&i.y===0||n.y===0&&i.y>0,this._previousImageBasedLightingFactor=U.clone(this._imageBasedLightingFactor,this._previousImageBasedLightingFactor)),this._previousSphericalHarmonicCoefficients!==this._sphericalHarmonicCoefficients&&(this._shouldRegenerateShaders=this._shouldRegenerateShaders||l(this._previousSphericalHarmonicCoefficients)!==l(this._sphericalHarmonicCoefficients),this._previousSphericalHarmonicCoefficients=this._sphericalHarmonicCoefficients),this._shouldRegenerateShaders=this._shouldRegenerateShaders||this._previousSpecularEnvironmentMapLoaded!==this._specularEnvironmentMapLoaded,this._previousSpecularEnvironmentMapLoaded=this._specularEnvironmentMapLoaded,this._specularEnvironmentCubeMapDirty&&(BWe(this,t),this._specularEnvironmentCubeMapDirty=!1),l(this._specularEnvironmentCubeMap)&&(this._specularEnvironmentCubeMap.update(e),this._specularEnvironmentCubeMap.ready&&(this._specularEnvironmentMapLoaded=!0));let r=!l(this._specularEnvironmentCubeMap)&&l(e.specularEnvironmentMaps)&&!this._useDefaultSpecularMaps,o=!l(e.specularEnvironmentMaps)&&this._useDefaultSpecularMaps,s=!l(this._sphericalHarmonicCoefficients)&&l(e.sphericalHarmonicCoefficients)&&!this._useDefaultSphericalHarmonics,a=!l(e.sphericalHarmonicCoefficients)&&this._useDefaultSphericalHarmonics;this._shouldRegenerateShaders=this._shouldRegenerateShaders||r||o||s||a,this._useDefaultSpecularMaps=!l(this._specularEnvironmentCubeMap)&&l(e.specularEnvironmentMaps),this._useDefaultSphericalHarmonics=!l(this._sphericalHarmonicCoefficients)&&l(e.sphericalHarmonicCoefficients)};WN.prototype.isDestroyed=function(){return!1};WN.prototype.destroy=function(){return this._specularEnvironmentCubeMap=this._specularEnvironmentCubeMap&&this._specularEnvironmentCubeMap.destroy(),this._removeErrorListener=this._removeErrorListener&&this._removeErrorListener(),le(this)};var Kx=WN;var NK=Qo(Tf(),1);var MK,c0e="eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJub25jZSI6ImwwendUTkl3UVk5Uk5XdEkiLCJqdGkiOiJjZGFkZDZlNC0wMDI5LTQ5OTMtYWIwMC01ZWY4ZDVlNTBhMzYiLCJpZCI6MjU5LCJzdWIiOiJDZXNpdW1KUyIsImlzcyI6Imh0dHBzOi8vYXBpLmNlc2l1bS5jb20iLCJhdWQiOiIxLjE0NSBSZWxlYXNlIC0gRGVsZXRlIG9uIE5vdmVtYmVyIDEsIDIwMjYiLCJpYXQiOjE3ODc2MzQ3NzV9.3SPieoGxEZ22pnWLETAIFZveR0xXTzvOh8G4NYTxDSo",D6={};D6.defaultAccessToken=c0e;D6.defaultServer=new De({url:"https://api.cesium.com/"});D6.getDefaultTokenCredit=function(e){if(e===c0e){if(!l(MK)){let t=`<b> This application is using Cesium's default ion access token. Please assign <i>Cesium.Ion.defaultAccessToken</i> with an access token from your ion account before making any Cesium API calls. You can sign up for a free ion account at <a href="https://cesium.com">https://cesium.com</a>.</b>`;MK=new It(t,!0)}return MK}};var ku=D6;function nl(e,t){let n,i=e.externalType,r=l(i);if(!r)n={url:e.url,retryAttempts:1,retryCallback:kWe};else if(i==="3DTILES"||i==="STK_TERRAIN_SERVER")n={url:e.options.url};else throw new oe("Ion.createResource does not support external imagery assets; use IonImageryProvider instead.");De.call(this,n),this._ionEndpoint=e,this._ionEndpointDomain=r?void 0:new NK.default(e.url).authority(),this._ionEndpointResource=t,this._ionRoot=void 0,this._pendingPromise=void 0,this._credits=void 0,this._isExternal=r,this.refreshCallback=void 0}l(Object.create)&&(nl.prototype=Object.create(De.prototype),nl.prototype.constructor=nl);nl.fromAssetId=function(e,t){let n=nl._createEndpointResource(e,t);return n.fetchJson().then(function(i){return new nl(i,n)})};Object.defineProperties(nl.prototype,{credits:{get:function(){return l(this._ionRoot)?this._ionRoot.credits:l(this._credits)?this._credits:(this._credits=nl.getCreditsFromEndpoint(this._ionEndpoint,this._ionEndpointResource),this._credits)}}});nl.getCreditsFromEndpoint=function(e,t){let n=e.attributions.map(It.getIonCredit),i=ku.getDefaultTokenCredit(t.queryParameters.access_token);return l(i)&&n.push(It.clone(i)),n};nl.prototype.clone=function(e){let t=this._ionRoot??this;return l(e)||(e=Object.create(nl.prototype),De.call(e,{url:this._url,parseUrl:!1}),e._ionEndpoint=t._ionEndpoint,e._ionEndpointDomain=t._ionEndpointDomain,e._ionEndpointResource=t._ionEndpointResource,e._ionRoot=void 0,e._pendingPromise=void 0,e._credits=void 0,e._isExternal=this._isExternal,e.refreshCallback=void 0),e=De.prototype.clone.call(this,e),e._ionRoot=t,e._isExternal=this._isExternal,e};nl.prototype.fetchImage=function(e){if(!this._isExternal){let t=e;e={preferBlob:!0},l(t)&&(e.flipY=t.flipY,e.preferImageBitmap=t.preferImageBitmap)}return De.prototype.fetchImage.call(this,e)};nl.prototype._makeRequest=function(e){return this._isExternal||new NK.default(this.url).authority()!==this._ionEndpointDomain?De.prototype._makeRequest.call(this,e):(e.headers=LK(e.headers),e.headers.Authorization=`Bearer ${this._ionEndpoint.accessToken}`,De.prototype._makeRequest.call(this,e))};nl._createEndpointResource=function(e,t){t=t??H.EMPTY_OBJECT;let n=t.server??ku.defaultServer,i=t.accessToken??ku.defaultAccessToken;n=De.createIfNeeded(n);let r={url:`v1/assets/${e}/endpoint`};return l(i)&&(r.queryParameters={access_token:i}),l(t.queryParameters)&&(r.queryParameters={...r.queryParameters,...t.queryParameters}),r.headers=LK(r.headers),n.getDerivedResource(r)};function LK(e={}){return e["X-Cesium-Client"]="CesiumJS",typeof CESIUM_VERSION<"u"&&(e["X-Cesium-Client-Version"]=CESIUM_VERSION),e}nl._addClientHeaders=LK;function kWe(e,t){let n=e._ionRoot??e,i=n._ionEndpointResource,r=typeof Image<"u";return!l(t)||t.statusCode!==401&&!(r&&t.target instanceof Image)?Promise.resolve(!1):(l(n._pendingPromise)||(n._pendingPromise=i.fetchJson().then(function(o){let s=e.refreshCallback??n.refreshCallback;return l(s)&&s(n,o),n._ionEndpoint=o,n._ionEndpoint}).finally(function(o){return n._pendingPromise=void 0,o})),n._pendingPromise.then(function(o){return e._ionEndpoint=o,!0}))}var Ho=nl;function kp(e){e=e??0,this._array=new Array(e),this._length=e}Object.defineProperties(kp.prototype,{length:{get:function(){return this._length},set:function(e){let t=this._array,n=this._length;if(e<n)for(let i=e;i<n;++i)t[i]=void 0;else e>t.length&&(t.length=e);this._length=e}},values:{get:function(){return this._array}}});kp.prototype.get=function(e){return this._array[e]};kp.prototype.set=function(e,t){e>=this._length&&(this.length=e+1),this._array[e]=t};kp.prototype.peek=function(){return this._array[this._length-1]};kp.prototype.push=function(e){let t=this.length++;this._array[t]=e};kp.prototype.pop=function(){if(this._length===0)return;let e=this._array[this._length-1];return--this.length,e};kp.prototype.reserve=function(e){e>this._array.length&&(this._array.length=e)};kp.prototype.resize=function(e){this.length=e};kp.prototype.trim=function(e){e=e??this._length,this._array.length=e};var Zl=kp;var Up={X:0,Y:1,Z:2};Up.Y_UP_TO_Z_UP=N.fromRotationTranslation($.fromArray([1,0,0,0,0,1,0,-1,0]));Up.Z_UP_TO_Y_UP=N.fromRotationTranslation($.fromArray([1,0,0,0,0,-1,0,1,0]));Up.X_UP_TO_Z_UP=N.fromRotationTranslation($.fromArray([0,0,1,0,1,0,-1,0,0]));Up.Z_UP_TO_X_UP=N.fromRotationTranslation($.fromArray([0,0,-1,0,1,0,1,0,0]));Up.X_UP_TO_Y_UP=N.fromRotationTranslation($.fromArray([0,1,0,-1,0,0,0,0,1]));Up.Y_UP_TO_X_UP=N.fromRotationTranslation($.fromArray([0,-1,0,1,0,0,0,0,1]));Up.fromName=function(e){return Up[e]};Object.freeze(Up);var Hi=Up;function l0e(e){e=e??H.EMPTY_OBJECT,this._metadata=e.metadata}Object.defineProperties(l0e.prototype,{metadata:{get:function(){return this._metadata}}});var $x=l0e;function Zy(e,t,n){return t=t??0,n=n??e.byteLength-t,e=e.subarray(t,t+n),Zy.decode(e)}Zy.decodeWithTextDecoder=function(e){return new TextDecoder("utf-8").decode(e)};Zy.decodeWithFromCharCode=function(e){let t="",n=UWe(e),i=n.length;for(let r=0;r<i;++r){let o=n[r];o<=65535?t+=String.fromCharCode(o):(o-=65536,t+=String.fromCharCode((o>>10)+55296,(o&1023)+56320))}return t};function qN(e,t,n){return t<=e&&e<=n}function UWe(e){let t=0,n=0,i=0,r=128,o=191,s=[],a=e.length;for(let c=0;c<a;++c){let u=e[c];if(i===0){if(qN(u,0,127)){s.push(u);continue}if(qN(u,194,223)){i=1,t=u&31;continue}if(qN(u,224,239)){u===224&&(r=160),u===237&&(o=159),i=2,t=u&15;continue}if(qN(u,240,244)){u===240&&(r=144),u===244&&(o=143),i=3,t=u&7;continue}throw new oe("String decoding failed.")}if(!qN(u,r,o)){t=i=n=0,r=128,o=191,--c;continue}r=128,o=191,t=t<<6|u&63,++n,n===i&&(s.push(t),t=i=n=0)}return s}typeof TextDecoder<"u"?Zy.decode=Zy.decodeWithTextDecoder:Zy.decode=Zy.decodeWithFromCharCode;var Uu=Zy;function zWe(e,t){return t=t??0,Uu(e,t,Math.min(4,e.length))}var om=zWe;var FK=class e{constructor(t,n,i,r){this._tileset=t,this._tile=n,this._resource=i,l(r)||(r=[]),this._contents=r,this._metadata=void 0,this._group=void 0,this._ready=!1}get featurePropertiesDirty(){let t=this._contents,n=t.length;for(let i=0;i<n;++i)if(t[i].featurePropertiesDirty)return!0;return!1}set featurePropertiesDirty(t){let n=this._contents,i=n.length;for(let r=0;r<i;++r)n[r].featurePropertiesDirty=t}get featuresLength(){return 0}get pointsLength(){return 0}get trianglesLength(){return 0}get geometryByteLength(){return 0}get texturesByteLength(){return 0}get batchTableByteLength(){return 0}get innerContents(){return this._contents}get ready(){return this._ready}get tileset(){return this._tileset}get tile(){return this._tile}get url(){return this._resource.getUrlComponent(!0)}get metadata(){return this._metadata}set metadata(t){this._metadata=t;let n=this._contents,i=n.length;for(let r=0;r<i;++r)n[r].metadata=t}get batchTable(){}get group(){return this._group}set group(t){this._group=t;let n=this._contents,i=n.length;for(let r=0;r<i;++r)n[r].group=t}static async fromTileType(t,n,i,r,o,s){o=o??0;let a=new Uint8Array(r),c=new DataView(r);o+=YN;let u=c.getUint32(o,!0);if(u!==1)throw new oe(`Only Composite Tile version 1 is supported. Version ${u} is not.`);o+=YN,o+=YN;let f=c.getUint32(o,!0);o+=YN;let d=i.queryParameters.compositeIndex;l(d)?d=`${d}_`:d="";let p=[];p.length=f;for(let y=0;y<f;++y){let A=om(a,o),b=c.getUint32(o+YN*2,!0),x=s[A],T=`${d}${y}`,E=i.getDerivedResource({queryParameters:{compositeIndex:T}});if(l(x))p[y]=Promise.resolve(x(t,n,E,r,o));else throw new oe(`Unknown tile content type, ${A}, inside Composite tile`);o+=b}let g=await Promise.all(p);return new e(t,n,i,g)}hasProperty(t,n){return!1}getFeature(t){}applyDebugSettings(t,n){let i=this._contents,r=i.length;for(let o=0;o<r;++o)i[o].applyDebugSettings(t,n)}applyStyle(t){let n=this._contents,i=n.length;for(let r=0;r<i;++r)n[r].applyStyle(t)}update(t,n){let i=this._contents,r=i.length,o=!0;for(let s=0;s<r;++s)i[s].update(t,n),o=o&&i[s].ready;!this._ready&&o&&(this._ready=!0)}pick(t,n,i){if(!this._ready)return;let r,o=Number.POSITIVE_INFINITY,s=this._contents,a=s.length;for(let c=0;c<a;++c){let u=s[c].pick(t,n,i);if(!l(u))continue;let f=h.distance(t.origin,u);f<o&&(r=u,o=f)}if(l(r))return i}isDestroyed(){return!1}destroy(){let t=this._contents,n=t.length;for(let i=0;i<n;++i)t[i].destroy();return le(this)}},YN=Uint32Array.BYTES_PER_ELEMENT,XN=FK;function VWe(e,t,n){return JSON.parse(Uu(e,t,n))}var Ro=VWe;function il(e){this._id=Kn();let t=e.featuresLength;this._showAlphaProperties=void 0,this._batchValues=void 0,this._batchValuesDirty=!1,this._batchTexture=void 0,this._defaultTexture=void 0,this._pickTexture=void 0,this._pickIds=[];let n,i;if(t>0){let r=Math.min(t,kt.maximumTextureSize),o=Math.ceil(t/kt.maximumTextureSize),s=1/r,a=s*.5,c=1/o,u=c*.5;n=new U(r,o),i=new se(s,a,c,u)}this._translucentFeaturesLength=0,this._featuresLength=t,this._textureDimensions=n,this._textureStep=i,this._owner=e.owner,this._statistics=e.statistics,this._colorChangedCallback=e.colorChangedCallback}Object.defineProperties(il.prototype,{translucentFeaturesLength:{get:function(){return this._translucentFeaturesLength}},byteLength:{get:function(){let e=0;return l(this._pickTexture)&&(e+=this._pickTexture.sizeInBytes),l(this._batchTexture)&&(e+=this._batchTexture.sizeInBytes),e}},textureDimensions:{get:function(){return this._textureDimensions}},textureStep:{get:function(){return this._textureStep}},batchTexture:{get:function(){return this._batchTexture}},defaultTexture:{get:function(){return this._defaultTexture}},pickTexture:{get:function(){return this._pickTexture}}});il.DEFAULT_COLOR_VALUE=z.WHITE;il.DEFAULT_SHOW_VALUE=!0;function u0e(e){let t=e._textureDimensions;return t.x*t.y*4}function f0e(e){if(!l(e._batchValues)){let t=u0e(e),n=new Uint8Array(t).fill(255);e._batchValues=n}return e._batchValues}function d0e(e){if(!l(e._showAlphaProperties)){let t=2*e._featuresLength,n=new Uint8Array(t).fill(255);e._showAlphaProperties=n}return e._showAlphaProperties}il.prototype.setShow=function(e,t){if(t&&!l(this._showAlphaProperties))return;let n=d0e(this),i=e*2,r=t?255:0;if(n[i]!==r){n[i]=r;let o=f0e(this),s=e*4+3;o[s]=t?n[i+1]:0,this._batchValuesDirty=!0}};il.prototype.setAllShow=function(e){let t=this._featuresLength;for(let n=0;n<t;++n)this.setShow(n,e)};il.prototype.getShow=function(e){if(!l(this._showAlphaProperties))return!0;let t=e*2;return this._showAlphaProperties[t]===255};var jWe=new Array(4);il.prototype.setColor=function(e,t){if(z.equals(t,il.DEFAULT_COLOR_VALUE)&&!l(this._batchValues))return;let n=t.toBytes(jWe),i=n[3],r=f0e(this),o=e*4,s=d0e(this),a=e*2;if(r[o]!==n[0]||r[o+1]!==n[1]||r[o+2]!==n[2]||s[a+1]!==i){r[o]=n[0],r[o+1]=n[1],r[o+2]=n[2];let c=s[a+1]!==255,u=s[a]!==0;r[o+3]=u?i:0,s[a+1]=i;let f=i!==255;f&&!c?++this._translucentFeaturesLength:!f&&c&&--this._translucentFeaturesLength,this._batchValuesDirty=!0,l(this._colorChangedCallback)&&this._colorChangedCallback(e,t)}};il.prototype.setAllColor=function(e){let t=this._featuresLength;for(let n=0;n<t;++n)this.setColor(n,e)};il.prototype.getColor=function(e,t){if(!l(this._batchValues))return z.clone(il.DEFAULT_COLOR_VALUE,t);let n=this._batchValues,i=e*4,r=this._showAlphaProperties,o=e*2;return z.fromBytes(n[i],n[i+1],n[i+2],r[o+1],t)};il.prototype.getPickColor=function(e){return this._pickIds[e]};function h0e(e,t,n){let i=e._textureDimensions;return new Dt({context:t,pixelFormat:Ke.RGBA,pixelDatatype:ze.UNSIGNED_BYTE,source:{width:i.x,height:i.y,arrayBufferView:n},flipY:!1,sampler:jt.NEAREST})}function HWe(e,t){let n=e._featuresLength;if(!l(e._pickTexture)&&n>0){let i=e._pickIds,r=u0e(e),o=new Uint8Array(r),s=e._owner,a=e._statistics;for(let c=0;c<n;++c){let u=t.createPickId(s.getFeature(c));i.push(u);let f=u.color,d=c*4;o[d]=z.floatToByte(f.red),o[d+1]=z.floatToByte(f.green),o[d+2]=z.floatToByte(f.blue),o[d+3]=z.floatToByte(f.alpha)}e._pickTexture=h0e(e,t,o),l(a)&&(a.batchTableByteLength+=e._pickTexture.sizeInBytes)}}function GWe(e){let t=e._textureDimensions;e._batchTexture.copyFrom({source:{width:t.x,height:t.y,arrayBufferView:e._batchValues}})}il.prototype.update=function(e,t){let n=t.context;this._defaultTexture=n.defaultTexture;let i=t.passes;(i.pick||i.postProcess)&&HWe(this,n),this._batchValuesDirty&&(this._batchValuesDirty=!1,l(this._batchTexture)||(this._batchTexture=h0e(this,n,this._batchValues),l(this._statistics)&&(this._statistics.batchTableByteLength+=this._batchTexture.sizeInBytes)),GWe(this))};il.prototype.isDestroyed=function(){return!1};il.prototype.destroy=function(){this._batchTexture=this._batchTexture&&this._batchTexture.destroy(),this._pickTexture=this._pickTexture&&this._pickTexture.destroy();let e=this._pickIds,t=e.length;for(let n=0;n<t;++n)e[n].destroy();return le(this)};var Ql=il;var WWe={SCALAR:1,VEC2:2,VEC3:3,VEC4:4,MAT2:4,MAT3:9,MAT4:16},qWe={SCALAR:void 0,VEC2:U,VEC3:h,VEC4:se,MAT2:Xi,MAT3:$,MAT4:N};function YWe(e){let t=e.componentType,n;typeof t=="string"?n=Y.fromName(t):n=t;let i=WWe[e.type],r=qWe[e.type];return{componentsPerAttribute:i,classType:r,createArrayBufferView:function(o,s,a){return Y.createArrayBufferView(n,o,s,i*a)}}}var Fd=YWe;function Dg(e){this._classes=void 0,this._classIds=void 0,this._classIndexes=void 0,this._parentCounts=void 0,this._parentIndexes=void 0,this._parentIds=void 0,this._byteLength=0,XWe(this,e.extension,e.binaryBody)}Object.defineProperties(Dg.prototype,{byteLength:{get:function(){return this._byteLength}}});function XWe(e,t,n){let i,r,o,s=t.instancesLength,a=t.classes,c=t.classIds,u=t.parentCounts,f=t.parentIds,d=s,p=0;l(c.byteOffset)&&(c.componentType=c.componentType??Y.UNSIGNED_SHORT,c.type=Vt.SCALAR,o=Fd(c),c=o.createArrayBufferView(n.buffer,n.byteOffset+c.byteOffset,s),p+=c.byteLength);let g;if(l(u)){for(l(u.byteOffset)&&(u.componentType=u.componentType??Y.UNSIGNED_SHORT,u.type=Vt.SCALAR,o=Fd(u),u=o.createArrayBufferView(n.buffer,n.byteOffset+u.byteOffset,s),p+=u.byteLength),g=new Uint16Array(s),d=0,i=0;i<s;++i)g[i]=d,d+=u[i];p+=g.byteLength}l(f)&&l(f.byteOffset)&&(f.componentType=f.componentType??Y.UNSIGNED_SHORT,f.type=Vt.SCALAR,o=Fd(f),f=o.createArrayBufferView(n.buffer,n.byteOffset+f.byteOffset,d),p+=f.byteLength);let m=a.length;for(i=0;i<m;++i){let b=a[i].length,x=a[i].instances,T=sm.getBinaryProperties(b,x,n);p+=KWe(T),a[i].instances=Ot(T,x)}let y=new Array(m).fill(0),A=new Uint16Array(s);for(i=0;i<s;++i)r=c[i],A[i]=y[r],++y[r];p+=A.byteLength,e._classes=a,e._classIds=c,e._classIndexes=A,e._parentCounts=u,e._parentIndexes=g,e._parentIds=f,e._byteLength=p}function KWe(e){let t=0;for(let n in e)e.hasOwnProperty(n)&&(t+=e[n].typedArray.byteLength);return t}var $We=[],JWe=[],ZWe=0;function QWe(e,t,n){let i=e._classIds,r=e._parentCounts,o=e._parentIds,s=e._parentIndexes,a=i.length,c=$We;c.length=Math.max(c.length,a);let u=++ZWe,f=JWe;for(f.length=0,f.push(t);f.length>0;){if(t=f.pop(),c[t]===u)continue;c[t]=u;let d=n(e,t);if(l(d))return d;let p=r[t],g=s[t];for(let m=0;m<p;++m){let y=o[g+m];y!==t&&f.push(y)}}}function eqe(e,t,n){let i=!0;for(;i;){let r=n(e,t);if(l(r))return r;let o=e._parentIds[t];i=o!==t,t=o}}function KN(e,t,n){let i=e._parentCounts,r=e._parentIds;if(l(r)){if(l(i))return QWe(e,t,n)}else return n(e,t);return eqe(e,t,n)}Dg.prototype.hasProperty=function(e,t){let n=KN(this,e,function(i,r){let o=i._classIds[r],s=i._classes[o].instances;if(l(s[t]))return!0});return l(n)};Dg.prototype.propertyExists=function(e){let t=this._classes,n=t.length;for(let i=0;i<n;++i){let r=t[i].instances;if(l(r[e]))return!0}return!1};Dg.prototype.getPropertyIds=function(e,t){return t=l(t)?t:[],t.length=0,KN(this,e,function(n,i){let r=n._classIds[i],o=n._classes[r].instances;for(let s in o)o.hasOwnProperty(s)&&t.indexOf(s)===-1&&t.push(s)}),t};Dg.prototype.getProperty=function(e,t){return KN(this,e,function(n,i){let r=n._classIds[i],o=n._classes[r],s=n._classIndexes[i],a=o.instances[t];if(l(a))return l(a.typedArray)?tqe(a,s):Je(a[s],!0)})};function tqe(e,t){let n=e.typedArray,i=e.componentCount;return i===1?n[t]:e.type.unpack(n,t*i)}Dg.prototype.setProperty=function(e,t,n){let i=KN(this,e,function(r,o){let s=r._classIds[o],a=r._classes[s],c=r._classIndexes[o],u=a.instances[t];if(l(u))return l(u.typedArray)?nqe(u,c,n):u[c]=Je(n,!0),!0});return l(i)};function nqe(e,t,n){let i=e.typedArray,r=e.componentCount;r===1?i[t]=n:e.type.pack(n,i,t*r)}Dg.prototype.isClass=function(e,t){let n=KN(this,e,function(i,r){let o=i._classIds[r];if(i._classes[o].name===t)return!0});return l(n)};Dg.prototype.getClassName=function(e){let t=this._classIds[e];return this._classes[t].name};var Jx=Dg;var m0e={HIGHLIGHT:0,REPLACE:1,MIX:2};Object.freeze(m0e);var zu=m0e;var BK=Ql.DEFAULT_COLOR_VALUE,kK=Ql.DEFAULT_SHOW_VALUE;function Yr(e,t,n,i,r){this.featuresLength=t;let o;l(n)&&(o=n.extensions),this._extensions=o??{};let s=iqe(n);this._properties=s,this._batchTableHierarchy=rqe(this,n,i);let a=g0e(t,s,i);this._binaryPropertiesByteLength=oqe(a),this._batchTableBinaryProperties=a,this._content=e,this._batchTexture=new Ql({featuresLength:t,colorChangedCallback:r,owner:e,statistics:e.tileset.statistics})}Yr._deprecationWarning=qr;Object.defineProperties(Yr.prototype,{batchTableByteLength:{get:function(){let e=this._binaryPropertiesByteLength;return l(this._batchTableHierarchy)&&(e+=this._batchTableHierarchy.byteLength),e+=this._batchTexture.byteLength,e}}});function iqe(e){let t={};if(!l(e))return t;for(let n in e)e.hasOwnProperty(n)&&n!=="HIERARCHY"&&n!=="extensions"&&n!=="extras"&&(t[n]=Je(e[n],!0));return t}function rqe(e,t,n){if(!l(t))return;let i=e._extensions["3DTILES_batch_table_hierarchy"],r=t.HIERARCHY;if(l(r)&&(Yr._deprecationWarning("batchTableHierarchyExtension","The batch table HIERARCHY property has been moved to an extension. Use extensions.3DTILES_batch_table_hierarchy instead."),e._extensions["3DTILES_batch_table_hierarchy"]=r,i=r),!!l(i))return new Jx({extension:i,binaryBody:n})}function g0e(e,t,n){let i;for(let r in t)if(t.hasOwnProperty(r)){let o=t[r],s=o.byteOffset;if(l(s)){let a=o.componentType,c=o.type;if(!l(a))throw new oe("componentType is required.");if(!l(c))throw new oe("type is required.");if(!l(n))throw new oe(`Property ${r} requires a batch table binary.`);let u=Fd(o),f=u.componentsPerAttribute,d=u.classType,p=u.createArrayBufferView(n.buffer,n.byteOffset+s,e);l(i)||(i={}),i[r]={typedArray:p,componentCount:f,type:d}}}return i}function oqe(e){if(!l(e))return 0;let t=0;for(let n in e)e.hasOwnProperty(n)&&(t+=e[n].typedArray.byteLength);return t}Yr.getBinaryProperties=function(e,t,n){return g0e(e,t,n)};Yr.prototype.setShow=function(e,t){this._batchTexture.setShow(e,t)};Yr.prototype.setAllShow=function(e){this._batchTexture.setAllShow(e)};Yr.prototype.getShow=function(e){return this._batchTexture.getShow(e)};Yr.prototype.setColor=function(e,t){this._batchTexture.setColor(e,t)};Yr.prototype.setAllColor=function(e){this._batchTexture.setAllColor(e)};Yr.prototype.getColor=function(e,t){return this._batchTexture.getColor(e,t)};Yr.prototype.getPickColor=function(e){return this._batchTexture.getPickColor(e)};var sqe=new z;Yr.prototype.applyStyle=function(e){if(!l(e)){this.setAllColor(BK),this.setAllShow(kK);return}let t=this._content,n=this.featuresLength;for(let i=0;i<n;++i){let r=t.getFeature(i),o=l(e.color)?e.color.evaluateColor(r,sqe)??BK:BK,s=l(e.show)?e.show.evaluate(r)??kK:kK;this.setColor(i,o),this.setShow(i,s)}};function aqe(e,t){let n=e.typedArray,i=e.componentCount;return i===1?n[t]:e.type.unpack(n,t*i)}function cqe(e,t,n){let i=e.typedArray,r=e.componentCount;r===1?i[t]=n:e.type.pack(n,i,t*r)}Yr.prototype.isClass=function(e,t){let n=this._batchTableHierarchy;return l(n)?n.isClass(e,t):!1};Yr.prototype.isExactClass=function(e,t){return this.getExactClassName(e)===t};Yr.prototype.getExactClassName=function(e){let t=this._batchTableHierarchy;if(l(t))return t.getClassName(e)};Yr.prototype.hasProperty=function(e,t){return l(this._properties[t])||l(this._batchTableHierarchy)&&this._batchTableHierarchy.hasProperty(e,t)};Yr.prototype.hasPropertyBySemantic=function(){return!1};Yr.prototype.getPropertyIds=function(e,t){t=l(t)?t:[],t.length=0;let n=Object.keys(this._properties);if(Zn(t,n),l(this._batchTableHierarchy)){let i=this._batchTableHierarchy.getPropertyIds(e,n);Zn(t,i)}return t};Yr.prototype.getPropertyBySemantic=function(e,t){};Yr.prototype.getProperty=function(e,t){if(l(this._batchTableBinaryProperties)){let i=this._batchTableBinaryProperties[t];if(l(i))return aqe(i,e)}let n=this._properties[t];if(l(n))return Je(n[e],!0);if(l(this._batchTableHierarchy)){let i=this._batchTableHierarchy.getProperty(e,t);if(l(i))return i}};Yr.prototype.setProperty=function(e,t,n){let i=this.featuresLength;if(l(this._batchTableBinaryProperties)){let o=this._batchTableBinaryProperties[t];if(l(o)){cqe(o,e,n);return}}if(l(this._batchTableHierarchy)&&this._batchTableHierarchy.setProperty(e,t,n))return;let r=this._properties[t];l(r)||(this._properties[t]=new Array(i),r=this._properties[t]),r[e]=Je(n,!0)};function lqe(e){return e._batchTexture.textureDimensions.y===1?`uniform vec4 tile_textureStep; -vec2 computeSt(float batchId) -{ - float stepX = tile_textureStep.x; - float centerX = tile_textureStep.y; - return vec2(centerX + (batchId * stepX), 0.5); -} -`:`uniform vec4 tile_textureStep; -uniform vec2 tile_textureDimensions; -vec2 computeSt(float batchId) -{ - float stepX = tile_textureStep.x; - float centerX = tile_textureStep.y; - float stepY = tile_textureStep.z; - float centerY = tile_textureStep.w; - float xId = mod(batchId, tile_textureDimensions.x); - float yId = floor(batchId / tile_textureDimensions.x); - return vec2(centerX + (xId * stepX), centerY + (yId * stepY)); -} -`}Yr.prototype.getVertexShaderCallback=function(e,t,n){if(this.featuresLength===0)return;let i=this;return function(r){let o=_0e(r,n,!1),s;return kt.maximumVertexTextureImageUnits>0?(s="",e&&(s+=`uniform bool tile_translucentCommand; -`),s+=`uniform sampler2D tile_batchTexture; -out vec4 tile_featureColor; -out vec2 tile_featureSt; -void main() +`;function Tg(e){e=e??H.EMPTY_OBJECT;let t=e.translucent??!0,n=e.closed??!1,i=e.flat??!1,r=i?fN:uN,o=i?Sx:lN,s=i?Tg.FLAT_VERTEX_FORMAT:Tg.VERTEX_FORMAT;this.material=void 0,this.translucent=t,this._vertexShaderSource=e.vertexShaderSource??r,this._fragmentShaderSource=e.fragmentShaderSource??o,this._renderState=wr.getDefaultRenderState(t,n,e.renderState),this._closed=n,this._vertexFormat=s,this._flat=i,this._faceForward=e.faceForward??!n}Object.defineProperties(Tg.prototype,{vertexShaderSource:{get:function(){return this._vertexShaderSource}},fragmentShaderSource:{get:function(){return this._fragmentShaderSource}},renderState:{get:function(){return this._renderState}},closed:{get:function(){return this._closed}},vertexFormat:{get:function(){return this._vertexFormat}},flat:{get:function(){return this._flat}},faceForward:{get:function(){return this._faceForward}}});Tg.VERTEX_FORMAT=Be.POSITION_AND_NORMAL;Tg.FLAT_VERTEX_FORMAT=Be.POSITION_ONLY;Tg.prototype.getFragmentShaderSource=wr.prototype.getFragmentShaderSource;Tg.prototype.isTranslucent=wr.prototype.isTranslucent;Tg.prototype.getRenderState=wr.prototype.getRenderState;var yn=Tg;function Md(e,t,n){this._projectionExtentDefines={eastMostYhighDefine:"",eastMostYlowDefine:"",westMostYhighDefine:"",westMostYlowDefine:""};let i=new gK;i.requiresTextureCoordinates=e,i.requiresEC=!n.flat;let r=new gK;if(r.requiresTextureCoordinates=e,n instanceof yn)i.requiresNormalEC=!n.flat;else{let o=`${n.material.shaderSource} +${n.fragmentShaderSource}`;i.normalEC=o.indexOf("materialInput.normalEC")!==-1||o.indexOf("czm_getDefaultMaterial")!==-1,i.positionToEyeEC=o.indexOf("materialInput.positionToEyeEC")!==-1,i.tangentToEyeMatrix=o.indexOf("materialInput.tangentToEyeMatrix")!==-1,i.st=o.indexOf("materialInput.st")!==-1}this._colorShaderDependencies=i,this._pickShaderDependencies=r,this._appearance=n,this._extentsCulling=e,this._planarExtents=t}Md.prototype.createFragmentShader=function(e){let t=this._appearance,n=this._colorShaderDependencies,i=[];!e&&!this._planarExtents&&i.push("SPHERICAL"),n.requiresEC&&i.push("REQUIRES_EC"),n.requiresWC&&i.push("REQUIRES_WC"),n.requiresTextureCoordinates&&i.push("TEXTURE_COORDINATES"),this._extentsCulling&&i.push("CULL_FRAGMENTS"),n.requiresNormalEC&&i.push("NORMAL_EC"),t instanceof yn&&i.push("PER_INSTANCE_COLOR"),n.normalEC&&i.push("USES_NORMAL_EC"),n.positionToEyeEC&&i.push("USES_POSITION_TO_EYE_EC"),n.tangentToEyeMatrix&&i.push("USES_TANGENT_TO_EYE"),n.st&&i.push("USES_ST"),t.flat&&i.push("FLAT");let r="";return t instanceof yn||(r=t.material.shaderSource),new Ye({defines:i,sources:[r,Dv]})};Md.prototype.createPickFragmentShader=function(e){let t=this._pickShaderDependencies,n=["PICK"];return!e&&!this._planarExtents&&n.push("SPHERICAL"),t.requiresEC&&n.push("REQUIRES_EC"),t.requiresWC&&n.push("REQUIRES_WC"),t.requiresTextureCoordinates&&n.push("TEXTURE_COORDINATES"),this._extentsCulling&&n.push("CULL_FRAGMENTS"),new Ye({defines:n,sources:[Dv],pickColorQualifier:"in"})};Md.prototype.createVertexShader=function(e,t,n,i){return hpe(this._colorShaderDependencies,this._planarExtents,n,e,t,this._appearance,i,this._projectionExtentDefines)};Md.prototype.createPickVertexShader=function(e,t,n,i){return hpe(this._pickShaderDependencies,this._planarExtents,n,e,t,void 0,i,this._projectionExtentDefines)};var spe=new h,ape=new he,cpe={high:0,low:0};function hpe(e,t,n,i,r,o,s,a){let c=i.slice();if(a.eastMostYhighDefine===""){let u=ape;u.longitude=D.PI,u.latitude=0,u.height=0;let f=s.project(u,spe),d=Sn.encode(f.x,cpe);a.eastMostYhighDefine=`EAST_MOST_X_HIGH ${d.high.toFixed(`${d.high}`.length+1)}`,a.eastMostYlowDefine=`EAST_MOST_X_LOW ${d.low.toFixed(`${d.low}`.length+1)}`;let p=ape;p.longitude=-D.PI,p.latitude=0,p.height=0;let g=s.project(p,spe);d=Sn.encode(g.x,cpe),a.westMostYhighDefine=`WEST_MOST_X_HIGH ${d.high.toFixed(`${d.high}`.length+1)}`,a.westMostYlowDefine=`WEST_MOST_X_LOW ${d.low.toFixed(`${d.low}`.length+1)}`}return n&&(c.push(a.eastMostYhighDefine),c.push(a.eastMostYlowDefine),c.push(a.westMostYhighDefine),c.push(a.westMostYlowDefine)),l(o)&&o instanceof yn&&c.push("PER_INSTANCE_COLOR"),e.requiresTextureCoordinates&&(c.push("TEXTURE_COORDINATES"),t||n||c.push("SPHERICAL"),n&&c.push("COLUMBUS_VIEW_2D")),new Ye({defines:c,sources:[r]})}function gK(){this._requiresEC=!1,this._requiresWC=!1,this._requiresNormalEC=!1,this._requiresTextureCoordinates=!1,this._usesNormalEC=!1,this._usesPositionToEyeEC=!1,this._usesTangentToEyeMat=!1,this._usesSt=!1}Object.defineProperties(gK.prototype,{requiresEC:{get:function(){return this._requiresEC},set:function(e){this._requiresEC=e||this._requiresEC}},requiresWC:{get:function(){return this._requiresWC},set:function(e){this._requiresWC=e||this._requiresWC,this.requiresEC=this._requiresWC}},requiresNormalEC:{get:function(){return this._requiresNormalEC},set:function(e){this._requiresNormalEC=e||this._requiresNormalEC,this.requiresEC=this._requiresNormalEC}},requiresTextureCoordinates:{get:function(){return this._requiresTextureCoordinates},set:function(e){this._requiresTextureCoordinates=e||this._requiresTextureCoordinates,this.requiresWC=this._requiresTextureCoordinates}},normalEC:{set:function(e){this.requiresNormalEC=e,this._usesNormalEC=e},get:function(){return this._usesNormalEC}},tangentToEyeMatrix:{set:function(e){this.requiresWC=e,this.requiresNormalEC=e,this._usesTangentToEyeMat=e},get:function(){return this._usesTangentToEyeMat}},positionToEyeEC:{set:function(e){this.requiresEC=e,this._usesPositionToEyeEC=e},get:function(){return this._usesPositionToEyeEC}},st:{set:function(e){this.requiresTextureCoordinates=e,this._usesSt=e},get:function(){return this._usesSt}}});function lpe(e,t,n){return Math.abs((t.y-e.y)*n.x-(t.x-e.x)*n.y+t.x*e.y-t.y*e.x)/U.distance(t,e)}var f9e=[new U,new U,new U,new U];function mpe(e,t){let n=f9e,i=U.unpack(t,0,n[0]),r=U.unpack(t,2,n[1]),o=U.unpack(t,4,n[2]);e.uMaxVmax=new Zc({componentDatatype:Y.FLOAT,componentsPerAttribute:4,normalize:!1,value:[r.x,r.y,o.x,o.y]});let s=1/lpe(i,r,o),a=1/lpe(i,o,r);e.uvMinAndExtents=new Zc({componentDatatype:Y.FLOAT,componentsPerAttribute:4,normalize:!1,value:[i.x,i.y,s,a]})}var ppe=new he,gpe=new h,d9e=new h,h9e=new h,w6={high:0,low:0};function _pe(e,t,n){let i=ppe;i.height=0,i.longitude=e.west,i.latitude=e.south;let r=t.project(i,gpe);i.latitude=e.north;let o=t.project(i,d9e);i.longitude=e.east,i.latitude=e.south;let s=t.project(i,h9e),a=[0,0,0,0],c=[0,0,0,0],u=Sn.encode(r.x,w6);a[0]=u.high,c[0]=u.low,u=Sn.encode(r.y,w6),a[1]=u.high,c[1]=u.low,u=Sn.encode(o.y,w6),a[2]=u.high,c[2]=u.low,u=Sn.encode(s.x,w6),a[3]=u.high,c[3]=u.low,n.planes2D_HIGH=new Zc({componentDatatype:Y.FLOAT,componentsPerAttribute:4,normalize:!1,value:a}),n.planes2D_LOW=new Zc({componentDatatype:Y.FLOAT,componentsPerAttribute:4,normalize:!1,value:c})}var m9e=new N,p9e=new N,upe=new h,g9e=new he,_9e=[new he,new he,new he,new he,new he,new he,new he,new he];function y9e(e,t,n,i,r,o){let s=ie.center(e,g9e);s.height=n;let a=he.toCartesian(s,t,upe),c=At.eastNorthUpToFixedFrame(a,t,m9e),u=N.inverse(c,p9e),f=e.west,d=e.east,p=e.north,g=e.south,m=_9e;m[0].latitude=g,m[0].longitude=f,m[1].latitude=p,m[1].longitude=f,m[2].latitude=p,m[2].longitude=d,m[3].latitude=g,m[3].longitude=d;let y=(f+d)*.5,A=(p+g)*.5;m[4].latitude=g,m[4].longitude=y,m[5].latitude=p,m[5].longitude=y,m[6].latitude=A,m[6].longitude=f,m[7].latitude=A,m[7].longitude=d;let b=Number.POSITIVE_INFINITY,x=Number.NEGATIVE_INFINITY,T=Number.POSITIVE_INFINITY,E=Number.NEGATIVE_INFINITY;for(let R=0;R<8;R++){m[R].height=n;let O=he.toCartesian(m[R],t,upe);N.multiplyByPoint(u,O,O),O.z=0,b=Math.min(b,O.x),x=Math.max(x,O.x),T=Math.min(T,O.y),E=Math.max(E,O.y)}let v=i;v.x=b,v.y=T,v.z=0,N.multiplyByPoint(c,v,v);let S=r;S.x=x,S.y=T,S.z=0,N.multiplyByPoint(c,S,S),h.subtract(S,v,r);let I=o;I.x=b,I.y=E,I.z=0,N.multiplyByPoint(c,I,I),h.subtract(I,v,o)}var A9e=new h,b9e=new h,x9e=new Sn;Md.getPlanarTextureCoordinateAttributes=function(e,t,n,i,r){let o=gpe,s=A9e,a=b9e;y9e(e,n,r??0,o,s,a);let c={};mpe(c,t);let u=Sn.fromCartesian(o,x9e);return c.southWest_HIGH=new Zc({componentDatatype:Y.FLOAT,componentsPerAttribute:3,normalize:!1,value:h.pack(u.high,[0,0,0])}),c.southWest_LOW=new Zc({componentDatatype:Y.FLOAT,componentsPerAttribute:3,normalize:!1,value:h.pack(u.low,[0,0,0])}),c.eastward=new Zc({componentDatatype:Y.FLOAT,componentsPerAttribute:3,normalize:!1,value:h.pack(s,[0,0,0])}),c.northward=new Zc({componentDatatype:Y.FLOAT,componentsPerAttribute:3,normalize:!1,value:h.pack(a,[0,0,0])}),_pe(e,i,c),c};var T9e=new h;function fpe(e,t,n,i){let r=ppe;r.latitude=e,r.longitude=t,r.height=0;let o=he.toCartesian(r,n,T9e),s=Math.sqrt(o.x*o.x+o.y*o.y),a=D.fastApproximateAtan2(s,o.z),c=D.fastApproximateAtan2(o.x,o.y);return i.x=a,i.y=c,i}var dpe=new U;Md.getSphericalExtentGeometryInstanceAttributes=function(e,t,n,i){let r=fpe(e.south,e.west,n,dpe),o=r.x,s=r.y,a=fpe(e.north,e.east,n,dpe),c=a.x,u=a.y,f=0;s>u&&(f=D.PI-s,s=-D.PI,u+=f),o-=D.EPSILON5,s-=D.EPSILON5,c+=D.EPSILON5,u+=D.EPSILON5;let d=1/(u-s),p=1/(c-o),g={sphericalExtents:new Zc({componentDatatype:Y.FLOAT,componentsPerAttribute:4,normalize:!1,value:[o,s,p,d]}),longitudeRotation:new Zc({componentDatatype:Y.FLOAT,componentsPerAttribute:1,normalize:!1,value:[f]})};return mpe(g,t),_pe(e,i,g),g};Md.hasAttributesForTextureCoordinatePlanes=function(e){return l(e.southWest_HIGH)&&l(e.southWest_LOW)&&l(e.northward)&&l(e.eastward)&&l(e.planes2D_HIGH)&&l(e.planes2D_LOW)&&l(e.uMaxVmax)&&l(e.uvMinAndExtents)};Md.hasAttributesForSphericalExtents=function(e){return l(e.sphericalExtents)&&l(e.longitudeRotation)&&l(e.planes2D_HIGH)&&l(e.planes2D_LOW)&&l(e.uMaxVmax)&&l(e.uvMinAndExtents)};function E9e(e){return Math.max(e.width,e.height)>Md.MAX_WIDTH_FOR_PLANAR_EXTENTS}Md.shouldUseSphericalCoordinates=function(e){return E9e(e)};Md.MAX_WIDTH_FOR_PLANAR_EXTENTS=D.toRadians(1);var If=Md;function Rx(e){e=e??H.EMPTY_OBJECT;let t=e.geometryInstances;this.geometryInstances=t,this.show=e.show??!0,this.classificationType=e.classificationType??Qn.BOTH,this.debugShowBoundingVolume=e.debugShowBoundingVolume??!1,this.debugShowShadowVolume=e.debugShowShadowVolume??!1,this._debugShowShadowVolume=!1,this._extruded=e._extruded??!1,this._uniformMap=e._uniformMap,this._sp=void 0,this._spStencil=void 0,this._spPick=void 0,this._spColor=void 0,this._spPick2D=void 0,this._spColor2D=void 0,this._rsStencilDepthPass=void 0,this._rsStencilDepthPass3DTiles=void 0,this._rsColorPass=void 0,this._rsPickPass=void 0,this._commandsIgnoreShow=[],this._ready=!1,this._primitive=void 0,this._pickPrimitive=e._pickPrimitive,this._hasSphericalExtentsAttribute=!1,this._hasPlanarExtentsAttributes=!1,this._hasPerColorAttribute=!1,this.appearance=e.appearance,this._createBoundingVolumeFunction=e._createBoundingVolumeFunction,this._updateAndQueueCommandsFunction=e._updateAndQueueCommandsFunction,this._usePickOffsets=!1,this._primitiveOptions={geometryInstances:void 0,appearance:void 0,vertexCacheOptimize:e.vertexCacheOptimize??!1,interleave:e.interleave??!1,releaseGeometryInstances:e.releaseGeometryInstances??!0,allowPicking:e.allowPicking??!0,asynchronous:e.asynchronous??!0,compressVertices:e.compressVertices??!0,_createBoundingVolumeFunction:void 0,_createRenderStatesFunction:void 0,_createShaderProgramFunction:void 0,_createCommandsFunction:void 0,_updateAndQueueCommandsFunction:void 0,_createPickOffsets:!0}}Object.defineProperties(Rx.prototype,{vertexCacheOptimize:{get:function(){return this._primitiveOptions.vertexCacheOptimize}},interleave:{get:function(){return this._primitiveOptions.interleave}},releaseGeometryInstances:{get:function(){return this._primitiveOptions.releaseGeometryInstances}},allowPicking:{get:function(){return this._primitiveOptions.allowPicking}},asynchronous:{get:function(){return this._primitiveOptions.asynchronous}},compressVertices:{get:function(){return this._primitiveOptions.compressVertices}},ready:{get:function(){return this._ready}},_needs2DShader:{get:function(){return this._hasPlanarExtentsAttributes||this._hasSphericalExtentsAttribute}}});Rx.isSupported=function(e){return e.context.stencilBuffer};function Fv(e,t){let n=t?ei.EQUAL:ei.ALWAYS;return{colorMask:{red:!1,green:!1,blue:!1,alpha:!1},stencilTest:{enabled:e,frontFunction:n,frontOperation:{fail:Rt.KEEP,zFail:Rt.DECREMENT_WRAP,zPass:Rt.KEEP},backFunction:n,backOperation:{fail:Rt.KEEP,zFail:Rt.INCREMENT_WRAP,zPass:Rt.KEEP},reference:Yt.CESIUM_3D_TILE_MASK,mask:Yt.CESIUM_3D_TILE_MASK},stencilMask:Yt.CLASSIFICATION_MASK,depthTest:{enabled:!0,func:cc.LESS_OR_EQUAL},depthMask:!1}}function yK(e){return{stencilTest:{enabled:e,frontFunction:ei.NOT_EQUAL,frontOperation:{fail:Rt.ZERO,zFail:Rt.ZERO,zPass:Rt.ZERO},backFunction:ei.NOT_EQUAL,backOperation:{fail:Rt.ZERO,zFail:Rt.ZERO,zPass:Rt.ZERO},reference:0,mask:Yt.CLASSIFICATION_MASK},stencilMask:Yt.CLASSIFICATION_MASK,depthTest:{enabled:!1},depthMask:!1,blending:tn.PRE_MULTIPLIED_ALPHA_BLEND}}var C9e={stencilTest:{enabled:!0,frontFunction:ei.NOT_EQUAL,frontOperation:{fail:Rt.ZERO,zFail:Rt.ZERO,zPass:Rt.ZERO},backFunction:ei.NOT_EQUAL,backOperation:{fail:Rt.ZERO,zFail:Rt.ZERO,zPass:Rt.ZERO},reference:0,mask:Yt.CLASSIFICATION_MASK},stencilMask:Yt.CLASSIFICATION_MASK,depthTest:{enabled:!1},depthMask:!1};function v9e(e,t,n,i){if(l(e._rsStencilDepthPass))return;let r=!e.debugShowShadowVolume;e._rsStencilDepthPass=Ge.fromCache(Fv(r,!1)),e._rsStencilDepthPass3DTiles=Ge.fromCache(Fv(r,!0)),e._rsColorPass=Ge.fromCache(yK(r,!1)),e._rsPickPass=Ge.fromCache(C9e)}function S9e(e,t){if(!e.compressVertices)return t;if(t.search(/in\s+vec3\s+extrudeDirection;/g)!==-1){let n="compressedAttributes",i=`in vec2 ${n};`,r=`vec3 extrudeDirection; +`,o=` extrudeDirection = czm_octDecode(${n}, 65535.0); +`,s=t;s=s.replace(/in\s+vec3\s+extrudeDirection;/g,""),s=Ye.replaceMain(s,"czm_non_compressed_main");let a=`void main() { - vec2 st = computeSt(${t}); - vec4 featureProperties = texture(tile_batchTexture, st); - tile_color(featureProperties); - float show = ceil(featureProperties.a); - gl_Position *= show; -`,e&&(s+=` bool isStyleTranslucent = (featureProperties.a != 1.0); - if (czm_pass == czm_passTranslucent) - { - if (!isStyleTranslucent && !tile_translucentCommand) - { - gl_Position *= 0.0; - } - } - else - { - if (isStyleTranslucent) - { - gl_Position *= 0.0; - } - } -`),s+=` tile_featureColor = featureProperties; - tile_featureSt = st; -}`):s=`out vec2 tile_featureSt; +${o} czm_non_compressed_main(); +}`;return[i,r,s,a].join(` +`)}}function w9e(e,t){let n=t.context,i=e._primitive,r=yM;r=e._primitive._batchTable.getVertexShaderCallback()(r),r=On._appendDistanceDisplayConditionToShader(i,r),r=On._modifyShaderPosition(e,r,t.scene3DOnly),r=On._updateColorAttribute(i,r);let o=e._hasPlanarExtentsAttributes,s=o||e._hasSphericalExtentsAttribute;e._extruded&&(r=S9e(i,r));let a=e._extruded?"EXTRUDED_GEOMETRY":"",c=new Ye({defines:[a],sources:[r]}),u=new Ye({sources:[jy]}),f=e._primitive._attributeLocations,d=new If(s,o,e.appearance);if(e._spStencil=Qt.replaceCache({context:n,shaderProgram:e._spStencil,vertexShaderSource:c,fragmentShaderSource:u,attributeLocations:f}),e._primitive.allowPicking){let m=Ye.createPickVertexShaderSource(r);m=On._appendShowToShader(i,m),m=On._updatePickColorAttribute(m);let y=d.createPickFragmentShader(!1),A=d.createPickVertexShader([a],m,!1,t.mapProjection);if(e._spPick=Qt.replaceCache({context:n,shaderProgram:e._spPick,vertexShaderSource:A,fragmentShaderSource:y,attributeLocations:f}),s){let b=n.shaderCache.getDerivedShaderProgram(e._spPick,"2dPick");if(!l(b)){let x=d.createPickFragmentShader(!0),T=d.createPickVertexShader([a],m,!0,t.mapProjection);b=n.shaderCache.createDerivedShaderProgram(e._spPick,"2dPick",{vertexShaderSource:T,fragmentShaderSource:x,attributeLocations:f})}e._spPick2D=b}}else e._spPick=Qt.fromCache({context:n,vertexShaderSource:c,fragmentShaderSource:u,attributeLocations:f});r=On._appendShowToShader(i,r),c=new Ye({defines:[a],sources:[r]}),e._sp=Qt.replaceCache({context:n,shaderProgram:e._sp,vertexShaderSource:c,fragmentShaderSource:u,attributeLocations:f});let p=d.createFragmentShader(!1),g=d.createVertexShader([a],r,!1,t.mapProjection);if(e._spColor=Qt.replaceCache({context:n,shaderProgram:e._spColor,vertexShaderSource:g,fragmentShaderSource:p,attributeLocations:f}),s){let m=n.shaderCache.getDerivedShaderProgram(e._spColor,"2dColor");if(!l(m)){let y=d.createFragmentShader(!0),A=d.createVertexShader([a],r,!0,t.mapProjection);m=n.shaderCache.createDerivedShaderProgram(e._spColor,"2dColor",{vertexShaderSource:A,fragmentShaderSource:y,attributeLocations:f})}e._spColor2D=m}}function I9e(e,t){let n=e._primitive,i=n._va.length*2;t.length=i;let r,o,s,a=0,c=n._batchTable.getUniformMapCallback()(e._uniformMap),u=e._needs2DShader;for(r=0;r<i;r+=2){let g=n._va[a++];o=t[r],l(o)||(o=t[r]=new at({owner:e,primitiveType:n._primitiveType})),o.vertexArray=g,o.renderState=e._rsStencilDepthPass,o.shaderProgram=e._sp,o.uniformMap=c,o.pass=Ie.TERRAIN_CLASSIFICATION,s=at.shallowClone(o,o.derivedCommands.tileset),s.renderState=e._rsStencilDepthPass3DTiles,s.pass=Ie.CESIUM_3D_TILE_CLASSIFICATION,o.derivedCommands.tileset=s,o=t[r+1],l(o)||(o=t[r+1]=new at({owner:e,primitiveType:n._primitiveType})),o.vertexArray=g,o.renderState=e._rsColorPass,o.shaderProgram=e._spColor,o.pass=Ie.TERRAIN_CLASSIFICATION;let y=e.appearance.material;if(l(y)&&(c=Ot(c,y._uniforms)),o.uniformMap=c,s=at.shallowClone(o,o.derivedCommands.tileset),s.pass=Ie.CESIUM_3D_TILE_CLASSIFICATION,o.derivedCommands.tileset=s,u){let A=at.shallowClone(o,o.derivedCommands.appearance2D);A.shaderProgram=e._spColor2D,o.derivedCommands.appearance2D=A,A=at.shallowClone(s,s.derivedCommands.appearance2D),A.shaderProgram=e._spColor2D,s.derivedCommands.appearance2D=A}}let f=e._commandsIgnoreShow,d=e._spStencil,p=0;i=f.length=i/2;for(let g=0;g<i;++g){let m=f[g]=at.shallowClone(t[p],f[g]);m.shaderProgram=d,m.pass=Ie.CESIUM_3D_TILE_CLASSIFICATION_IGNORE_SHOW,p+=2}}function P9e(e,t){let n=e._usePickOffsets,i=e._primitive,r=i._va.length*2,o,s=0,a;n&&(o=i._pickOffsets,r=o.length*2),t.length=r;let c,u,f,d=0,p=i._batchTable.getUniformMapCallback()(e._uniformMap),g=e._needs2DShader;for(c=0;c<r;c+=2){let m=i._va[d++];if(n&&(a=o[s++],m=i._va[a.index]),u=t[c],l(u)||(u=t[c]=new at({owner:e,primitiveType:i._primitiveType,pickOnly:!0})),u.vertexArray=m,u.renderState=e._rsStencilDepthPass,u.shaderProgram=e._sp,u.uniformMap=p,u.pass=Ie.TERRAIN_CLASSIFICATION,n&&(u.offset=a.offset,u.count=a.count),f=at.shallowClone(u,u.derivedCommands.tileset),f.renderState=e._rsStencilDepthPass3DTiles,f.pass=Ie.CESIUM_3D_TILE_CLASSIFICATION,u.derivedCommands.tileset=f,u=t[c+1],l(u)||(u=t[c+1]=new at({owner:e,primitiveType:i._primitiveType,pickOnly:!0})),u.vertexArray=m,u.renderState=e._rsPickPass,u.shaderProgram=e._spPick,u.uniformMap=p,u.pass=Ie.TERRAIN_CLASSIFICATION,n&&(u.offset=a.offset,u.count=a.count),f=at.shallowClone(u,u.derivedCommands.tileset),f.pass=Ie.CESIUM_3D_TILE_CLASSIFICATION,u.derivedCommands.tileset=f,g){let y=at.shallowClone(u,u.derivedCommands.pick2D);y.shaderProgram=e._spPick2D,u.derivedCommands.pick2D=y,y=at.shallowClone(f,f.derivedCommands.pick2D),y.shaderProgram=e._spPick2D,f.derivedCommands.pick2D=y}}}function D9e(e,t,n,i,r,o,s){I9e(e,o),P9e(e,s)}function ype(e,t){return Math.floor(e%t/2)}function _K(e,t,n,i,r,o){e.modelMatrix=n,e.boundingVolume=r,e.cull=i,e.debugShowBoundingVolume=o,t.commandList.push(e)}function Ape(e,t,n,i,r){e.modelMatrix=n,e.boundingVolume=r,e.cull=i,t.commandList.push(e)}function R9e(e,t,n,i,r,o,s,a){let c=e._primitive;On._updateBoundingVolumes(c,t,r);let u;t.mode===re.SCENE3D?u=c._boundingSphereWC:t.mode===re.COLUMBUS_VIEW?u=c._boundingSphereCV:t.mode===re.SCENE2D&&l(c._boundingSphere2D)?u=c._boundingSphere2D:l(c._boundingSphereMorph)&&(u=c._boundingSphereMorph);let f=e.classificationType,d=f!==Qn.CESIUM_3D_TILE,p=f!==Qn.TERRAIN,g=t.passes,m,y,A;if(g.render){let b=n.length;for(m=0;m<b;++m)y=u[ype(m,b)],d&&(A=n[m],_K(A,t,r,o,y,s)),p&&(A=n[m].derivedCommands.tileset,_K(A,t,r,o,y,s));if(t.invertClassification){let x=e._commandsIgnoreShow,T=x.length;for(m=0;m<T;++m)y=u[m],A=x[m],_K(A,t,r,o,y,s)}}if(g.pick){let b=i.length,x=c._pickOffsets;for(m=0;m<b;++m){let T=x[ype(m,b)];y=u[T.index],d&&(A=i[m],Ape(A,t,r,o,y)),p&&(A=i[m].derivedCommands.tileset,Ape(A,t,r,o,y))}}}Rx.prototype.update=function(e){if(!l(this._primitive)&&!l(this.geometryInstances))return;let t=this.appearance;l(t)&&l(t.material)&&t.material.update(e.context);let n=this,i=this._primitiveOptions;if(!l(this._primitive)){let r=Array.isArray(this.geometryInstances)?this.geometryInstances:[this.geometryInstances],o=r.length,s,a,c,u=!1,f=!0,d,p=!1,g=!1;for(o>0&&(c=r[0].attributes,p=If.hasAttributesForSphericalExtents(c),g=If.hasAttributesForTextureCoordinatePlanes(c),d=c.color),s=0;s<o;s++){a=r[s];let y=a.attributes.color;l(y)&&(u=!0),f=f&&l(y)&&Jt.equals(d,y)}if(!f&&!p&&!g)throw new pe("All GeometryInstances must have the same color attribute except via GroundPrimitives");u&&!l(t)&&(t=new yn({flat:!0}),this.appearance=t),this._usePickOffsets=!p&&!g,this._hasSphericalExtentsAttribute=p,this._hasPlanarExtentsAttributes=g,this._hasPerColorAttribute=u;let m=new Array(o);for(s=0;s<o;++s)a=r[s],m[s]=new Ft({geometry:a.geometry,attributes:a.attributes,modelMatrix:a.modelMatrix,id:a.id,pickPrimitive:this._pickPrimitive??n});i.appearance=t,i.geometryInstances=m,l(this._createBoundingVolumeFunction)&&(i._createBoundingVolumeFunction=function(y,A){n._createBoundingVolumeFunction(y,A)}),i._createRenderStatesFunction=function(y,A,b,x){v9e(n,A)},i._createShaderProgramFunction=function(y,A,b){w9e(n,A)},i._createCommandsFunction=function(y,A,b,x,T,E,v){D9e(n,void 0,void 0,!0,!1,E,v)},l(this._updateAndQueueCommandsFunction)?i._updateAndQueueCommandsFunction=function(y,A,b,x,T,E,v,S){n._updateAndQueueCommandsFunction(y,A,b,x,T,E,v,S)}:i._updateAndQueueCommandsFunction=function(y,A,b,x,T,E,v,S){R9e(n,A,b,x,T,E,v,S)},this._primitive=new On(i)}this.debugShowShadowVolume&&!this._debugShowShadowVolume&&this._ready?(this._debugShowShadowVolume=!0,this._rsStencilDepthPass=Ge.fromCache(Fv(!1,!1)),this._rsStencilDepthPass3DTiles=Ge.fromCache(Fv(!1,!0)),this._rsColorPass=Ge.fromCache(yK(!1))):!this.debugShowShadowVolume&&this._debugShowShadowVolume&&(this._debugShowShadowVolume=!1,this._rsStencilDepthPass=Ge.fromCache(Fv(!0,!1)),this._rsStencilDepthPass3DTiles=Ge.fromCache(Fv(!0,!0)),this._rsColorPass=Ge.fromCache(yK(!0))),this._primitive.appearance!==t&&(this._primitive.appearance=t),this._primitive.show=this.show,this._primitive.debugShowBoundingVolume=this.debugShowBoundingVolume,this._primitive.update(e),e.afterRender.push(()=>{l(this._primitive)&&this._primitive.ready&&(this._ready=!0,this.releaseGeometryInstances&&(this.geometryInstances=void 0))})};Rx.prototype.getGeometryInstanceAttributes=function(e){return this._primitive.getGeometryInstanceAttributes(e)};Rx.prototype.isDestroyed=function(){return!1};Rx.prototype.destroy=function(){return this._primitive=this._primitive&&this._primitive.destroy(),this._sp=this._sp&&this._sp.destroy(),this._spPick=this._spPick&&this._spPick.destroy(),this._spColor=this._spColor&&this._spColor.destroy(),this._spPick2D=void 0,this._spColor2D=void 0,le(this)};var Bv=Rx;var O9e={u_globeMinimumAltitude:function(){return 55e3}};function Fu(e){e=e??H.EMPTY_OBJECT;let t=e.appearance,n=e.geometryInstances;if(!l(t)&&l(n)){let r=Array.isArray(n)?n:[n],o=r.length;for(let s=0;s<o;s++){let a=r[s].attributes;if(l(a)&&l(a.color)){t=new yn({flat:!0});break}}}this.appearance=t,this.geometryInstances=e.geometryInstances,this.show=e.show??!0,this.classificationType=e.classificationType??Qn.BOTH,this.debugShowBoundingVolume=e.debugShowBoundingVolume??!1,this.debugShowShadowVolume=e.debugShowShadowVolume??!1,this._boundingVolumes=[],this._boundingVolumes2D=[],this._ready=!1,this._primitive=void 0,this._maxHeight=void 0,this._minHeight=void 0,this._maxTerrainHeight=Mi._defaultMaxTerrainHeight,this._minTerrainHeight=Mi._defaultMinTerrainHeight,this._boundingSpheresKeys=[],this._boundingSpheres=[],this._useFragmentCulling=!1,this._zIndex=void 0;let i=this;this._classificationPrimitiveOptions={geometryInstances:void 0,appearance:void 0,vertexCacheOptimize:e.vertexCacheOptimize??!1,interleave:e.interleave??!1,releaseGeometryInstances:e.releaseGeometryInstances??!0,allowPicking:e.allowPicking??!0,asynchronous:e.asynchronous??!0,compressVertices:e.compressVertices??!0,_createBoundingVolumeFunction:void 0,_updateAndQueueCommandsFunction:void 0,_pickPrimitive:i,_extruded:!0,_uniformMap:O9e}}Object.defineProperties(Fu.prototype,{vertexCacheOptimize:{get:function(){return this._classificationPrimitiveOptions.vertexCacheOptimize}},interleave:{get:function(){return this._classificationPrimitiveOptions.interleave}},releaseGeometryInstances:{get:function(){return this._classificationPrimitiveOptions.releaseGeometryInstances}},allowPicking:{get:function(){return this._classificationPrimitiveOptions.allowPicking}},asynchronous:{get:function(){return this._classificationPrimitiveOptions.asynchronous}},compressVertices:{get:function(){return this._classificationPrimitiveOptions.compressVertices}},ready:{get:function(){return this._ready}}});Fu.isSupported=Bv.isSupported;function bpe(e){return function(t,n){let i=n.maximumRadius,r=i/Math.cos(t*.5)-i;return e._maxHeight+r}}function xpe(e){return function(t,n){return e._minHeight}}var M9e=new h,N9e=new h,L9e=new h,F9e=new he,B9e=new ie;function I6(e,t){let n=e.mapProjection.ellipsoid;if(!l(t.attributes)||!l(t.attributes.position3DHigh))return l(t.rectangle)?t.rectangle:void 0;let i=t.attributes.position3DHigh.values,r=t.attributes.position3DLow.values,o=i.length,s=Number.POSITIVE_INFINITY,a=Number.POSITIVE_INFINITY,c=Number.NEGATIVE_INFINITY,u=Number.NEGATIVE_INFINITY;for(let d=0;d<o;d+=3){let p=h.unpack(i,d,M9e),g=h.unpack(r,d,N9e),m=h.add(p,g,L9e),y=n.cartesianToCartographic(m,F9e),A=y.latitude,b=y.longitude;s=Math.min(s,A),a=Math.min(a,b),c=Math.max(c,A),u=Math.max(u,b)}let f=B9e;return f.north=c,f.south=s,f.east=u,f.west=a,f}function k9e(e,t,n){let i=Mi.getMinimumMaximumHeights(t,n);e._minTerrainHeight=i.minimumTerrainHeight,e._maxTerrainHeight=i.maximumTerrainHeight}function U9e(e,t,n){let i=t.mapProjection.ellipsoid,r=I6(t,n),o=en.fromRectangle(r,e._minHeight,e._maxHeight,i);if(e._boundingVolumes.push(o),!t.scene3DOnly){let s=t.mapProjection,a=ue.fromRectangleWithHeights2D(r,s,e._maxHeight,e._minHeight);h.fromElements(a.center.z,a.center.x,a.center.y,a.center),e._boundingVolumes2D.push(a)}}function AK(e,t){return Math.floor(e%t/2)}function bK(e,t,n,i,r,o,s){let a=e._primitive;n.mode!==re.SCENE3D&&t.shaderProgram===a._spColor&&a._needs2DShader&&(t=t.derivedCommands.appearance2D),t.owner=e,t.modelMatrix=i,t.boundingVolume=o,t.cull=r,t.debugShowBoundingVolume=s,n.commandList.push(t)}function Tpe(e,t,n,i,r,o){let s=e._primitive;n.mode!==re.SCENE3D&&t.shaderProgram===s._spPick&&s._needs2DShader&&(t=t.derivedCommands.pick2D),t.owner=e,t.modelMatrix=i,t.boundingVolume=o,t.cull=r,n.commandList.push(t)}function z9e(e,t,n,i,r,o,s,a){let c;t.mode===re.SCENE3D?c=e._boundingVolumes:c=e._boundingVolumes2D;let u=e.classificationType,f=u!==Qn.CESIUM_3D_TILE,d=u!==Qn.TERRAIN,p=t.passes,g=e._primitive,m,y,A;if(p.render){let b=n.length;for(m=0;m<b;++m)y=c[AK(m,b)],f&&(A=n[m],bK(e,A,t,r,o,y,s)),d&&(A=n[m].derivedCommands.tileset,bK(e,A,t,r,o,y,s));if(t.invertClassification){let x=g._commandsIgnoreShow,T=x.length;for(m=0;m<T;++m)y=c[m],A=x[m],bK(e,A,t,r,o,y,s)}}if(p.pick){let b=i.length,x;for(e._useFragmentCulling||(x=g._primitive._pickOffsets),m=0;m<b;++m){if(y=c[AK(m,b)],!e._useFragmentCulling){let T=x[AK(m,b)];y=c[T.index]}f&&(A=i[m],Tpe(e,A,t,r,o,y)),d&&(A=i[m].derivedCommands.tileset,Tpe(e,A,t,r,o,y))}}}Fu.initializeTerrainHeights=function(){return Mi.initialize()};Fu.prototype.update=function(e){if(!l(this._primitive)&&!l(this.geometryInstances))return;if(!Mi.initialized){Fu.initializeTerrainHeights();return}let t=this,n=this._classificationPrimitiveOptions;if(!l(this._primitive)){let i=e.mapProjection.ellipsoid,r,o,s,a=Array.isArray(this.geometryInstances)?this.geometryInstances:[this.geometryInstances],c=a.length,u=new Array(c),f,d;for(f=0;f<c;++f){r=a[f],o=r.geometry;let y=I6(e,o);l(d)?l(y)&&ie.union(d,y,d):d=ie.clone(y);let A=r.id;if(l(A)&&l(y)){let b=Mi.getBoundingSphere(y,i);this._boundingSpheresKeys.push(A),this._boundingSpheres.push(b)}s=o.constructor,!l(s)||l(s.createShadowVolume)}k9e(this,d,i);let p=e.verticalExaggeration,g=e.verticalExaggerationRelativeHeight;this._minHeight=Ar.getHeight(this._minTerrainHeight,p,g),this._maxHeight=Ar.getHeight(this._maxTerrainHeight,p,g);let m=Fu._supportsMaterials(e.context);if(this._useFragmentCulling=m,m){let y,A=!0;for(f=0;f<c;++f)if(r=a[f],o=r.geometry,d=I6(e,o),If.shouldUseSphericalCoordinates(d)){A=!1;break}for(f=0;f<c;++f){r=a[f],o=r.geometry,s=o.constructor;let b=I6(e,o),x=o.textureCoordinateRotationPoints;A?y=If.getPlanarTextureCoordinateAttributes(b,x,i,e.mapProjection,this._maxHeight):y=If.getSphericalExtentGeometryInstanceAttributes(b,x,i,e.mapProjection);let T=r.attributes;for(let E in T)T.hasOwnProperty(E)&&(y[E]=T[E]);u[f]=new Ft({geometry:s.createShadowVolume(o,xpe(this),bpe(this)),attributes:y,id:r.id})}}else for(f=0;f<c;++f)r=a[f],o=r.geometry,s=o.constructor,u[f]=new Ft({geometry:s.createShadowVolume(o,xpe(this),bpe(this)),attributes:r.attributes,id:r.id});n.geometryInstances=u,n.appearance=this.appearance,n._createBoundingVolumeFunction=function(y,A){U9e(t,y,A)},n._updateAndQueueCommandsFunction=function(y,A,b,x,T,E,v,S){z9e(t,A,b,x,T,E,v,S)},this._primitive=new Bv(n)}this._primitive.appearance=this.appearance,this._primitive.show=this.show,this._primitive.debugShowShadowVolume=this.debugShowShadowVolume,this._primitive.debugShowBoundingVolume=this.debugShowBoundingVolume,this._primitive.update(e),e.afterRender.push(()=>{!this._ready&&l(this._primitive)&&this._primitive.ready&&(this._ready=!0,this.releaseGeometryInstances&&(this.geometryInstances=void 0))})};Fu.prototype.getBoundingSphere=function(e){let t=this._boundingSpheresKeys.indexOf(e);if(t!==-1)return this._boundingSpheres[t]};Fu.prototype.getGeometryInstanceAttributes=function(e){return this._primitive.getGeometryInstanceAttributes(e)};Fu.prototype.isDestroyed=function(){return!1};Fu.prototype.destroy=function(){return this._primitive=this._primitive&&this._primitive.destroy(),le(this)};Fu._supportsMaterials=function(e){return e.depthTexture};Fu.supportsMaterials=function(e){return Fu._supportsMaterials(e.frameState.context)};var Xl=Fu;function uc(e){e=e??H.EMPTY_OBJECT,this._primitives=[],this._guid=Kn(),this._primitiveAdded=new be,this._primitiveRemoved=new be,this._zIndex=void 0,this.show=e.show??!0,this.destroyPrimitives=e.destroyPrimitives??!0,this._countReferences=e.countReferences??!1}Object.defineProperties(uc.prototype,{length:{get:function(){return this._primitives.length}},primitiveAdded:{get:function(){return this._primitiveAdded}},primitiveRemoved:{get:function(){return this._primitiveRemoved}}});uc.prototype.add=function(e,t){let n=l(t),i=e._external=e._external||{},r=i._composites=i._composites||{};return r[this._guid]={collection:this},n?this._primitives.splice(t,0,e):this._primitives.push(e),this._countReferences&&(l(i._referenceCount)?++i._referenceCount:i._referenceCount=1),this._primitiveAdded.raiseEvent(e),e};uc.prototype.remove=function(e){if(this.contains(e)){let t=this._primitives.indexOf(e);if(t!==-1)return this._primitives.splice(t,1),delete e._external._composites[this._guid],this._countReferences&&e._external._referenceCount--,this.destroyPrimitives&&(!this._countReferences||e._external._referenceCount<=0)&&e.destroy(),this._primitiveRemoved.raiseEvent(e),!0}return!1};uc.prototype.removeAndDestroy=function(e){let t=this.remove(e);return t&&!this.destroyPrimitives&&e.destroy(),t};uc.prototype.removeAll=function(){let e=this._primitives,t=e.length;for(let n=0;n<t;++n){let i=e[n];delete i._external._composites[this._guid],this._countReferences&&i._external._referenceCount--,this.destroyPrimitives&&(!this._countReferences||i._external._referenceCount<=0)&&i.destroy(),this._primitiveRemoved.raiseEvent(i)}this._primitives=[]};uc.prototype.contains=function(e){return!!(l(e)&&e._external&&e._external._composites&&e._external._composites[this._guid])};function P6(e,t){return e._primitives.indexOf(t)}uc.prototype.raise=function(e){if(l(e)){let t=P6(this,e),n=this._primitives;if(t!==n.length-1){let i=n[t];n[t]=n[t+1],n[t+1]=i}}};uc.prototype.raiseToTop=function(e){if(l(e)){let t=P6(this,e),n=this._primitives;t!==n.length-1&&(n.splice(t,1),n.push(e))}};uc.prototype.lower=function(e){if(l(e)){let t=P6(this,e),n=this._primitives;if(t!==0){let i=n[t];n[t]=n[t-1],n[t-1]=i}}};uc.prototype.lowerToBottom=function(e){if(l(e)){let t=P6(this,e),n=this._primitives;t!==0&&(n.splice(t,1),n.unshift(e))}};uc.prototype.get=function(e){return this._primitives[e]};uc.prototype.update=function(e){if(!this.show)return;let t=this._primitives;for(let n=0;n<t.length;++n)t[n].update(e)};uc.prototype.prePassesUpdate=function(e){let t=this._primitives;for(let n=0;n<t.length;++n){let i=t[n];l(i.prePassesUpdate)&&i.prePassesUpdate(e)}};uc.prototype.updateForPass=function(e,t){let n=this._primitives;for(let i=0;i<n.length;++i){let r=n[i];l(r.updateForPass)&&r.updateForPass(e,t)}};uc.prototype.postPassesUpdate=function(e){let t=this._primitives;for(let n=0;n<t.length;++n){let i=t[n];l(i.postPassesUpdate)&&i.postPassesUpdate(e)}};uc.prototype.isDestroyed=function(){return!1};uc.prototype.destroy=function(){return this.removeAll(),le(this)};var Qc=uc;function kp(){this._length=0,this._collections={},this._collectionsArray=[],this.show=!0}Object.defineProperties(kp.prototype,{length:{get:function(){return this._length}}});kp.prototype.add=function(e,t){t=t??0;let n=this._collections[t];if(!l(n)){n=new Qc({destroyPrimitives:!1}),n._zIndex=t,this._collections[t]=n;let i=this._collectionsArray,r=0;for(;r<i.length&&i[r]._zIndex<t;)r++;i.splice(r,0,n)}return n.add(e),this._length++,e._zIndex=t,e};kp.prototype.set=function(e,t){return t===e._zIndex||(this.remove(e,!0),this.add(e,t)),e};kp.prototype.remove=function(e,t){if(this.contains(e)){let n=e._zIndex,i=this._collections[n],r;return t?r=i.remove(e):r=i.removeAndDestroy(e),r&&this._length--,i.length===0&&(this._collectionsArray.splice(this._collectionsArray.indexOf(i),1),this._collections[n]=void 0,i.destroy()),r}return!1};kp.prototype.removeAll=function(){let e=this._collectionsArray;for(let t=0;t<e.length;t++){let n=e[t];n.destroyPrimitives=!0,n.destroy()}this._collections={},this._collectionsArray=[],this._length=0};kp.prototype.contains=function(e){if(!l(e))return!1;let t=this._collections[e._zIndex];return l(t)&&t.contains(e)};kp.prototype.update=function(e){if(!this.show)return;let t=this._collectionsArray;for(let n=0;n<t.length;n++)t[n].update(e)};kp.prototype.isDestroyed=function(){return!1};kp.prototype.destroy=function(){return this.removeAll(),le(this)};var dN=kp;var xK=class{constructor(){this._array=[],this._hash={}}get length(){return this._array.length}get values(){return this._array}contains(t){return l(this._hash[t])}set(t,n){let i=this._hash[t];n!==i&&(this.remove(t),this._hash[t]=n,this._array.push(n))}get(t){return this._hash[t]}remove(t){let n=this._hash[t],i=l(n);if(i){let r=this._array;r.splice(r.indexOf(n),1),delete this._hash[t]}return i}removeAll(){let t=this._array;t.length>0&&(this._hash={},t.length=0)}},Ut=xK;function Pf(e,t){e=e??0,this._near=e,t=t??Number.MAX_VALUE,this._far=t}Object.defineProperties(Pf.prototype,{near:{get:function(){return this._near},set:function(e){this._near=e}},far:{get:function(){return this._far},set:function(e){this._far=e}}});Pf.packedLength=2;Pf.pack=function(e,t,n){return n=n??0,t[n++]=e.near,t[n]=e.far,t};Pf.unpack=function(e,t,n){return t=t??0,l(n)||(n=new Pf),n.near=e[t++],n.far=e[t],n};Pf.equals=function(e,t){return e===t||l(e)&&l(t)&&e.near===t.near&&e.far===t.far};Pf.clone=function(e,t){if(l(e))return l(t)||(t=new Pf),t.near=e.near,t.far=e.far,t};Pf.prototype.clone=function(e){return Pf.clone(this,e)};Pf.prototype.equals=function(e){return Pf.equals(this,e)};var Ht=Pf;function Nd(e,t,n,i){this.near=e??0,this.nearValue=t??0,this.far=n??1,this.farValue=i??0}Nd.clone=function(e,t){if(l(e))return l(t)?(t.near=e.near,t.nearValue=e.nearValue,t.far=e.far,t.farValue=e.farValue,t):new Nd(e.near,e.nearValue,e.far,e.farValue)};Nd.packedLength=4;Nd.pack=function(e,t,n){return n=n??0,t[n++]=e.near,t[n++]=e.nearValue,t[n++]=e.far,t[n]=e.farValue,t};Nd.unpack=function(e,t,n){return t=t??0,l(n)||(n=new Nd),n.near=e[t++],n.nearValue=e[t++],n.far=e[t++],n.farValue=e[t],n};Nd.equals=function(e,t){return e===t||l(e)&&l(t)&&e.near===t.near&&e.nearValue===t.nearValue&&e.far===t.far&&e.farValue===t.farValue};Nd.prototype.clone=function(e){return Nd.clone(this,e)};Nd.prototype.equals=function(e){return Nd.equals(this,e)};var qt=Nd;var Wy={NONE:0,CLAMP_TO_GROUND:1,RELATIVE_TO_GROUND:2,CLAMP_TO_TERRAIN:3,RELATIVE_TO_TERRAIN:4,CLAMP_TO_3D_TILE:5,RELATIVE_TO_3D_TILE:6,CLIP_TO_GROUND:7};Object.freeze(Wy);var We=Wy;function bs(e){return e===Wy.CLAMP_TO_GROUND||e===Wy.CLAMP_TO_3D_TILE||e===Wy.CLAMP_TO_TERRAIN}function qy(e){return e===Wy.RELATIVE_TO_GROUND||e===Wy.RELATIVE_TO_3D_TILE||e===Wy.RELATIVE_TO_TERRAIN}var Epe={CENTER:0,LEFT:1,RIGHT:-1};Object.freeze(Epe);var Vi=Epe;var Cpe={CENTER:0,BOTTOM:1,BASELINE:2,TOP:-1};Object.freeze(Cpe);var Gn=Cpe;function $h(){pe.throwInstantiationError()}Object.defineProperties($h.prototype,{isConstant:{get:pe.throwInstantiationError},definitionChanged:{get:pe.throwInstantiationError}});$h.prototype.getValue=pe.throwInstantiationError;$h.prototype.equals=pe.throwInstantiationError;$h.equals=function(e,t){return e===t||l(e)&&e.equals(t)};$h.arrayEquals=function(e,t){if(e===t)return!0;if(!l(e)||!l(t)||e.length!==t.length)return!1;let n=e.length;for(let i=0;i<n;i++)if(!$h.equals(e[i],t[i]))return!1;return!0};$h.isConstant=function(e){return!l(e)||e.isConstant};$h.getValueOrUndefined=function(e,t,n){return l(e)?e.getValue(t,n):void 0};$h.getValueOrDefault=function(e,t,n,i){return l(e)?e.getValue(t,i)??n:n};$h.getValueOrClonedDefault=function(e,t,n,i){let r;return l(e)&&(r=e.getValue(t,i)),l(r)||(r=n.clone(r)),r};var X=$h;var V9e=500;function j9e(e,t,n,i,r){let o=t.mostDetailedHeightPosition;if(l(o)&&h.distance(o,n)>V9e&&(l(t.mostDetailedHeight)&&(t.mostDetailedHeightPrevious=t.mostDetailedHeight),t.mostDetailedHeightPosition=void 0,t.mostDetailedHeight=void 0),!l(t.mostDetailedHeightPosition))if(t.mostDetailedHeightPosition=h.clone(n),!l(e)||!e.sampleHeightSupported||e.mode!==re.SCENE3D)t.mostDetailedHeight=null;else{t.mostDetailedHeight=void 0;let a=(e.ellipsoid??ee.default).cartesianToCartographic(n);e.sampleHeightMostDetailed([a],i).then(function(c){r()&&(t.mostDetailedHeight=c[0].height??null)}).catch(function(){r()&&(t.mostDetailedHeight=null)})}return t.mostDetailedHeight===void 0?t.mostDetailedHeightPrevious:t.mostDetailedHeight}var Jh=j9e;var H9e=new he;function G9e(e,t,n,i,r){let o=i.cartesianToCartographic(e,H9e);return n===We.CLIP_TO_GROUND?o.height<t&&(o.height=t):bs(n)?o.height=t:qy(n)&&(o.height+=t),i.cartographicToCartesian(o,r)}var Eg=G9e;var vpe={LEFT:-1,NONE:0,RIGHT:1};Object.freeze(vpe);var Ho=vpe;var W9e=z.WHITE,q9e=h.ZERO,Y9e=We.NONE,X9e=U.ZERO,K9e=1,$9e=0,J9e=h.ZERO,Z9e=Vi.CENTER,Q9e=Gn.CENTER,e7e=!1,t7e=Ho.NONE,n7e=new h,i7e=new z,r7e=new h,o7e=new U,s7e=new qt,a7e=new qt,c7e=new qt,l7e=new et,u7e=new Ht;function Spe(e){this.entity=e,this.billboard=void 0,this.textureValue=void 0}function Yy(e,t){t.collectionChanged.addEventListener(Yy.prototype._onCollectionChanged,this),this._cluster=e,this._entityCollection=t,this._items=new Ut,this._onCollectionChanged(t,t.values,[],[])}Yy.prototype.update=function(e){let t=this._items.values,n=this._cluster;for(let i=0,r=t.length;i<r;i++){let o=t[i],s=o.entity,a=s._billboard,c,u=o.billboard,f=s.isShowing&&s.isAvailable(e)&&X.getValueOrDefault(a._show,e,!0),d;if(f&&(d=X.getValueOrUndefined(s._position,e,n7e),c=X.getValueOrUndefined(a._image,e),f=l(d)&&l(c)),!f){TK(o,s,n);continue}X.isConstant(s._position)||(n._clusterDirty=!0),l(u)||(u=n.getBillboard(s),u.id=s,o.billboard=u,o.textureValue=void 0),u.show=f,u.position=d,u.color=X.getValueOrDefault(a._color,e,W9e,i7e),u.eyeOffset=X.getValueOrDefault(a._eyeOffset,e,q9e,r7e),u.heightReference=X.getValueOrDefault(a._heightReference,e,Y9e),u.pixelOffset=X.getValueOrDefault(a._pixelOffset,e,X9e,o7e),u.scale=X.getValueOrDefault(a._scale,e,K9e),u.rotation=X.getValueOrDefault(a._rotation,e,$9e),u.alignedAxis=X.getValueOrDefault(a._alignedAxis,e,J9e),u.horizontalOrigin=X.getValueOrDefault(a._horizontalOrigin,e,Z9e),u.verticalOrigin=X.getValueOrDefault(a._verticalOrigin,e,Q9e),u.width=X.getValueOrUndefined(a._width,e),u.height=X.getValueOrUndefined(a._height,e),u.scaleByDistance=X.getValueOrUndefined(a._scaleByDistance,e,s7e),u.translucencyByDistance=X.getValueOrUndefined(a._translucencyByDistance,e,a7e),u.pixelOffsetScaleByDistance=X.getValueOrUndefined(a._pixelOffsetScaleByDistance,e,c7e),u.sizeInMeters=X.getValueOrDefault(a._sizeInMeters,e,e7e),u.distanceDisplayCondition=X.getValueOrUndefined(a._distanceDisplayCondition,e,u7e),u.disableDepthTestDistance=X.getValueOrUndefined(a._disableDepthTestDistance,e),u.splitDirection=X.getValueOrDefault(a._splitDirection,e,t7e),o.textureValue!==c&&(u.image=c,o.textureValue=c);let p=X.getValueOrUndefined(a._imageSubRegion,e,l7e);l(p)&&u.setImageSubRegion(u.image,p)}return!0};Yy.prototype.getBoundingSphere=function(e,t){let n=this._items.get(e.id);if(!l(n)||!l(n.billboard))return Pt.FAILED;let i=n.billboard;if(i.heightReference===We.NONE)t.center=h.clone(i.position,t.center);else if(i._clampedToSurface)t.center=h.clone(i._clampedPosition,t.center);else{let r=this._cluster._scene,o=this._items,s=Jh(r,n,i.position,[i],()=>o.get(e.id)===n);if(s===void 0)return Pt.PENDING;s===null?t.center=h.clone(i.position,t.center):t.center=Eg(i.position,s,i.heightReference,r.ellipsoid??ee.default,t.center)}return t.radius=0,Pt.DONE};Yy.prototype.isDestroyed=function(){return!1};Yy.prototype.destroy=function(){this._entityCollection.collectionChanged.removeEventListener(Yy.prototype._onCollectionChanged,this);let e=this._entityCollection.values;for(let t=0;t<e.length;t++)this._cluster.removeBillboard(e[t]);return le(this)};Yy.prototype._onCollectionChanged=function(e,t,n,i){let r,o,s=this._items,a=this._cluster;for(r=t.length-1;r>-1;r--)o=t[r],l(o._billboard)&&l(o._position)&&s.set(o.id,new Spe(o));for(r=i.length-1;r>-1;r--)o=i[r],l(o._billboard)&&l(o._position)?s.contains(o.id)||s.set(o.id,new Spe(o)):(TK(s.get(o.id),o,a),s.remove(o.id));for(r=n.length-1;r>-1;r--)o=n[r],TK(s.get(o.id),o,a),s.remove(o.id)};function TK(e,t,n){l(e)&&(e.billboard=void 0,n.removeBillboard(t))}var hN=Yy;function D6(){pe.throwInstantiationError()}Object.defineProperties(D6.prototype,{name:{get:pe.throwInstantiationError},clock:{get:pe.throwInstantiationError},entities:{get:pe.throwInstantiationError},isLoading:{get:pe.throwInstantiationError},changedEvent:{get:pe.throwInstantiationError},errorEvent:{get:pe.throwInstantiationError},loadingEvent:{get:pe.throwInstantiationError},show:{get:pe.throwInstantiationError},clustering:{get:pe.throwInstantiationError}});D6.prototype.update=function(e){pe.throwInstantiationError()};D6.setLoading=function(e,t){e._isLoading!==t&&(t?e._entityCollection.suspendEvents():e._entityCollection.resumeEvents(),e._isLoading=t,e._loading.raiseEvent(e,t))};var xs=D6;function Up(e,t){this._ellipsoid=e,this._cameraPosition=new h,this._cameraPositionInScaledSpace=new h,this._distanceToLimbInScaledSpaceSquared=0,l(t)&&(this.cameraPosition=t)}Object.defineProperties(Up.prototype,{ellipsoid:{get:function(){return this._ellipsoid}},cameraPosition:{get:function(){return this._cameraPosition},set:function(e){let n=this._ellipsoid.transformPositionToScaledSpace(e,this._cameraPositionInScaledSpace),i=h.magnitudeSquared(n)-1;h.clone(e,this._cameraPosition),this._cameraPositionInScaledSpace=n,this._distanceToLimbInScaledSpaceSquared=i}}});var wpe=new h;Up.prototype.isPointVisible=function(e){let n=this._ellipsoid.transformPositionToScaledSpace(e,wpe);return CK(n,this._cameraPositionInScaledSpace,this._distanceToLimbInScaledSpaceSquared)};Up.prototype.isScaledSpacePointVisible=function(e){return CK(e,this._cameraPositionInScaledSpace,this._distanceToLimbInScaledSpaceSquared)};var f7e=new h;Up.prototype.isScaledSpacePointVisiblePossiblyUnderEllipsoid=function(e,t){let n=this._ellipsoid,i,r;return l(t)&&t<0&&n.minimumRadius>-t?(r=f7e,r.x=this._cameraPosition.x/(n.radii.x+t),r.y=this._cameraPosition.y/(n.radii.y+t),r.z=this._cameraPosition.z/(n.radii.z+t),i=r.x*r.x+r.y*r.y+r.z*r.z-1):(r=this._cameraPositionInScaledSpace,i=this._distanceToLimbInScaledSpaceSquared),CK(e,r,i)};Up.prototype.computeHorizonCullingPoint=function(e,t,n){return Dpe(this._ellipsoid,e,t,n)};var Ipe=ee.clone(ee.UNIT_SPHERE);Up.prototype.computeHorizonCullingPointPossiblyUnderEllipsoid=function(e,t,n,i){let r=Ppe(this._ellipsoid,n,Ipe);return Dpe(r,e,t,i)};Up.prototype.computeHorizonCullingPointFromVertices=function(e,t,n,i,r){return Rpe(this._ellipsoid,e,t,n,i,r)};Up.prototype.computeHorizonCullingPointFromVerticesPossiblyUnderEllipsoid=function(e,t,n,i,r,o){let s=Ppe(this._ellipsoid,r,Ipe);return Rpe(s,e,t,n,i,o)};var d7e=[];Up.prototype.computeHorizonCullingPointFromRectangle=function(e,t,n){let i=ie.subsample(e,t,0,d7e),r=ue.fromPoints(i);if(!(h.magnitude(r.center)<.1*t.minimumRadius))return this.computeHorizonCullingPoint(r.center,i,n)};var h7e=new h;function Ppe(e,t,n){if(l(t)&&t<0&&e.minimumRadius>-t){let i=h.fromElements(e.radii.x+t,e.radii.y+t,e.radii.z+t,h7e);e=ee.fromCartesian3(i,n)}return e}function Dpe(e,t,n,i){l(i)||(i=new h);let r=Npe(e,t),o=0;for(let s=0,a=n.length;s<a;++s){let c=n[s],u=Ope(e,c,r);if(u<0)return;o=Math.max(o,u)}return Mpe(r,o,i)}var R6=new h;function Rpe(e,t,n,i,r,o){l(o)||(o=new h),i=i??3,r=r??h.ZERO;let s=Npe(e,t),a=0;for(let c=0,u=n.length;c<u;c+=i){R6.x=n[c]+r.x,R6.y=n[c+1]+r.y,R6.z=n[c+2]+r.z;let f=Ope(e,R6,s);if(f<0)return;a=Math.max(a,f)}return Mpe(s,a,o)}function CK(e,t,n){let i=t,r=n,o=h.subtract(e,i,wpe),s=-h.dot(o,i);return!(r<0?s>0:s>r&&s*s/h.magnitudeSquared(o)>r)}var m7e=new h,p7e=new h;function Ope(e,t,n){let i=e.transformPositionToScaledSpace(t,m7e),r=h.magnitudeSquared(i),o=Math.sqrt(r),s=h.divideByScalar(i,o,p7e);r=Math.max(1,r),o=Math.max(1,o);let a=h.dot(s,n),c=h.magnitude(h.cross(s,n,s)),u=1/o,f=Math.sqrt(r-1)*u;return 1/(a*u-c*f)}function Mpe(e,t,n){if(!(t<=0||t===1/0||t!==t))return h.multiplyByScalar(e,t,n)}var EK=new h;function Npe(e,t){return h.equals(t,h.ZERO)?t:(e.transformPositionToScaledSpace(t,EK),h.normalize(EK,EK))}var Zh=Up;var g7e=Object.freeze({NONE:0,LOADING:2,LOADED:3,ERROR:4,FAILED:5}),Hs=g7e;function Qh(e){this._billboardCollection=e,this._id=void 0,this._loadState=Hs.NONE,this._loadError=void 0,this._index=-1,this._width=void 0,this._height=void 0,this._hasSubregion=!1,this.dirty=!1}Object.defineProperties(Qh.prototype,{loadError:{get:function(){return this._loadError}},loadState:{get:function(){return this._loadState}},ready:{get:function(){return this._loadState===Hs.LOADED}},hasImage:{get:function(){return this._loadState!==Hs.NONE}},id:{get:function(){return this._id}},width:{get:function(){return this._width}},height:{get:function(){return this._height}}});Qh.prototype.unload=async function(){this._loadState!==Hs.NONE&&(this._id=void 0,this._loadError=void 0,this._loadState=Hs.NONE,this._index=-1,this._width=void 0,this._height=void 0,this.dirty=!0)};Qh.prototype.loadImage=async function(e,t,n,i){if(this._id===e)return;let r=this._billboardCollection,o=r.billboardTextureCache,s=o.get(e);if(l(s)&&t.loadState===Hs.LOADING||t.loadState===Hs.LOADED){Qh.clone(s,this);return}l(s)||(s=new Qh(r),o.set(e,s)),s._id=this._id=e,s._loadState=this._loadState=Hs.LOADING,s._loadError=this._loadError=void 0;let a,c=this._billboardCollection.textureAtlas;try{let f=c.addImage(e,t,n,i);typeof f=="number"?a=f:a=await f}catch(f){if(s._loadState=Hs.ERROR,s._loadError=f,this._id!==e)return;this._loadState=Hs.ERROR,this._loadError=f;return}if(!l(a)||a===-1){if(s._loadState=Hs.FAILED,s._index=-1,this._id!==e)return;this._loadState=Hs.FAILED,this._index=-1;return}s._index=a,s._loadState=Hs.LOADED;let u=c.rectangles[a];s._width=u.width,s._height=u.height,this._id===e&&(this._index=a,this._loadState=Hs.LOADED,this._width=u.width,this._height=u.height,this.dirty=!0)};Qh.prototype.addImageSubRegion=function(e,t){this._id=e,this._loadError=void 0,this._hasSubregion=!0;let i=this._billboardCollection.textureAtlas.addImageSubRegion(e,t);if(typeof i=="number"){this.setImageSubRegion(i,t);return}this.loadImageSubRegion(e,t,i)};Qh.prototype.loadImageSubRegion=async function(e,t,n){let i;try{this._loadState=Hs.LOADING,i=await n}catch(r){this._loadState=Hs.ERROR,this._loadError=r;return}this._id===e&&(this._loadState=Hs.LOADED,this.setImageSubRegion(i,t))};Qh.prototype.setImageSubRegion=function(e,t){if(this._index!==e){if(!l(e)||e===-1){this._loadState=Hs.FAILED,this._index=-1,this._width=void 0,this._height=void 0;return}this._width=t.width,this._height=t.height,this._index=e,this.dirty=!0}};Qh.prototype.computeTextureCoordinates=function(e){return this._billboardCollection.textureAtlas.computeTextureCoordinates(this._index,e)};Qh.clone=function(e,t){if(t._id=e._id,t._loadState=e._loadState,t._loadError=void 0,t._index=e._index,t._width=e._width,t._height=e._height,t._hasSubregion=e._hasSubregion,e.ready){t.dirty=!0;return}return(async()=>{let i=e._id;await e._billboardCollection.textureAtlas._indexPromiseById.get(i),t._id===i&&(e._hasSubregion&&await Promise.resolve(),t._id=i,t._loadState=e._loadState,t._loadError=e._loadError,t._index=e._index,t._width=e._width,t._height=e._height,t.dirty=!0)})(),t};var Cg=Qh;var Oc={},_7e=new se(0,0,0,1),el=new se,y7e=new et,vK=new U,SK=new U;Oc.worldToWindowCoordinates=function(e,t,n){return Oc.worldWithEyeOffsetToWindowCoordinates(e,t,h.ZERO,n)};var Lpe=new se,Fpe=new h;function mN(e,t,n,i){let r=n.viewMatrix,o=N.multiplyByVector(r,se.fromElements(e.x,e.y,e.z,1,Lpe),Lpe),s=h.multiplyComponents(t,h.normalize(o,Fpe),Fpe);return o.x+=t.x+s.x,o.y+=t.y+s.y,o.z+=s.z,N.multiplyByVector(n.frustum.projectionMatrix,o,i)}var A7e=new he(Math.PI,D.PI_OVER_TWO),b7e=new h,x7e=new h;Oc.worldWithEyeOffsetToWindowCoordinates=function(e,t,n,i){let r=e.frameState,o=Oc.computeActualEllipsoidPosition(r,t,_7e);if(!l(o))return;let s=e.canvas,a=y7e;a.x=0,a.y=0,a.width=s.clientWidth,a.height=s.clientHeight;let c=e.camera,u=!1;if(r.mode===re.SCENE2D){let f=e.mapProjection,d=A7e,p=f.project(d,b7e),g=h.clone(c.position,x7e),m=c.frustum.clone(),y=N.computeViewportTransformation(a,0,1,new N),A=c.frustum.projectionMatrix,b=c.positionWC.y,x=h.fromElements(D.sign(b)*p.x-b,0,-c.positionWC.x),T=At.pointToGLWindowCoordinates(A,y,x);if(b===0||T.x<=0||T.x>=s.clientWidth)u=!0;else{if(T.x>s.clientWidth*.5){a.width=T.x,c.frustum.right=p.x-b,el=mN(o,n,c,el),Oc.clipToGLWindowCoordinates(a,el,vK),a.x+=T.x,c.position.x=-c.position.x;let E=c.frustum.right;c.frustum.right=-c.frustum.left,c.frustum.left=-E,el=mN(o,n,c,el),Oc.clipToGLWindowCoordinates(a,el,SK)}else{a.x+=T.x,a.width-=T.x,c.frustum.left=-p.x-b,el=mN(o,n,c,el),Oc.clipToGLWindowCoordinates(a,el,vK),a.x=a.x-a.width,c.position.x=-c.position.x;let E=c.frustum.left;c.frustum.left=-c.frustum.right,c.frustum.right=-E,el=mN(o,n,c,el),Oc.clipToGLWindowCoordinates(a,el,SK)}h.clone(g,c.position),c.frustum=m.clone(),i=U.clone(vK,i),(i.x<0||i.x>s.clientWidth)&&(i.x=SK.x)}}if(r.mode!==re.SCENE2D||u){if(el=mN(o,n,c,el),el.z<0&&!(c.frustum instanceof gn)&&!(c.frustum instanceof ys))return;i=Oc.clipToGLWindowCoordinates(a,el,i)}return i.y=s.clientHeight-i.y,i};Oc.worldToDrawingBufferCoordinates=function(e,t,n){if(n=Oc.worldToWindowCoordinates(e,t,n),!!l(n))return Oc.transformWindowToDrawingBuffer(e,n,n)};var vg=new h,T7e=new he;Oc.computeActualEllipsoidPosition=function(e,t,n){let i=e.mode;if(i===re.SCENE3D)return h.clone(t,n);let r=e.mapProjection,o=r.ellipsoid.cartesianToCartographic(t,T7e);if(!l(o))return;if(r.project(o,vg),i===re.COLUMBUS_VIEW)return h.fromElements(vg.z,vg.x,vg.y,n);if(i===re.SCENE2D)return h.fromElements(0,vg.x,vg.y,n);let s=e.morphTime;return h.fromElements(D.lerp(vg.z,t.x,s),D.lerp(vg.x,t.y,s),D.lerp(vg.y,t.z,s),n)};var Bpe=new h,kpe=new h,Upe=new N;Oc.clipToGLWindowCoordinates=function(e,t,n){return h.divideByScalar(t,t.w,Bpe),N.computeViewportTransformation(e,0,1,Upe),N.multiplyByPoint(Upe,Bpe,kpe),U.fromCartesian3(kpe,n)};Oc.transformWindowToDrawingBuffer=function(e,t,n){let i=e.canvas,r=e.drawingBufferWidth/i.clientWidth,o=e.drawingBufferHeight/i.clientHeight;return U.fromElements(t.x*r,t.y*o,n)};var E7e=new se,zpe=new se;Oc.drawingBufferToWorldCoordinates=function(e,t,n,i){let o=e.context.uniformState,s=o.currentFrustum,a=s.x,c=s.y;if(e.frameState.useLogDepth){let g=n*o.log2FarDepthFromNearPlusOne,m=Math.pow(2,g)-1;n=c*(1-a/(m+a))/(c-a)}let u=e.view.passState.viewport,f=se.clone(se.UNIT_W,E7e);f.x=(t.x-u.x)/u.width*2-1,f.y=(t.y-u.y)/u.height*2-1,f.z=n*2-1,f.w=1;let d,p=e.camera.frustum;if(l(p.fovy)){d=N.multiplyByVector(o.inverseViewProjection,f,zpe);let g=1/d.w;h.multiplyByScalar(d,g,d)}else{let g=p.offCenterFrustum;l(g)&&(p=g),d=zpe,d.x=(f.x*(p.right-p.left)+p.left+p.right)*.5,d.y=(f.y*(p.top-p.bottom)+p.bottom+p.top)*.5,d.z=(f.z*(a-c)-a-c)*.5,d.w=1,d=N.multiplyByVector(o.inverseView,d,d)}return h.fromCartesian4(d,i)};var dr=Oc;function Ni(e,t){e=e??H.EMPTY_OBJECT;let n=e.translucencyByDistance,i=e.pixelOffsetScaleByDistance,r=e.scaleByDistance,o=e.distanceDisplayCondition;l(n)&&(n=qt.clone(n)),l(i)&&(i=qt.clone(i)),l(r)&&(r=qt.clone(r)),l(o)&&(o=Ht.clone(o)),this._show=e.show??!0,this._position=h.clone(e.position??h.ZERO),this._actualPosition=h.clone(this._position),this._pixelOffset=U.clone(e.pixelOffset??U.ZERO),this._translate=new U(0,0),this._eyeOffset=h.clone(e.eyeOffset??h.ZERO),this._heightReference=e.heightReference??We.NONE,this._verticalOrigin=e.verticalOrigin??Gn.CENTER,this._horizontalOrigin=e.horizontalOrigin??Vi.CENTER,this._scale=e.scale??1,this._color=z.clone(e.color??z.WHITE),this._rotation=e.rotation??0,this._alignedAxis=h.clone(e.alignedAxis??h.ZERO),this._width=e.width,this._height=e.height,this._scaleByDistance=r,this._translucencyByDistance=n,this._pixelOffsetScaleByDistance=i,this._sizeInMeters=e.sizeInMeters??!1,this._distanceDisplayCondition=o,this._disableDepthTestDistance=e.disableDepthTestDistance,this._id=e.id,this._collection=e.collection??t,this._pickId=void 0,this._pickPrimitive=e._pickPrimitive??this,this._billboardCollection=t,this._dirty=!1,this._index=-1,this._batchIndex=void 0,this._imageTexture=new Cg(t),this._imageId=e.imageId,this._imageWidth=void 0,this._imageHeight=void 0,this._labelDimensions=void 0,this._labelHorizontalOrigin=void 0,this._labelTranslate=void 0;let s=e.image;l(s)&&(this._computeImageTextureProperties(e.imageId,s),this._imageTexture.loadImage(this._imageId,s,this._imageWidth,this._imageHeight)),l(e.imageSubRegion)&&this._imageTexture.addImageSubRegion(this._imageId,e.imageSubRegion),this._actualClampedPosition=void 0,this._removeCallbackFunc=void 0,this._lastSurfaceHeight=void 0,this._lastSurfaceQueryFrame=-1,this._lastSurfaceQueryMissed=!1,this._clampedToSurface=!1,this._clampingCartesian=void 0,this._clampingHeight=0,this._clampingHeightValid=!1,this._mode=re.SCENE3D,this._clusterShow=!0,this._outlineColor=z.clone(e.outlineColor??z.BLACK),this._outlineWidth=e.outlineWidth??0,this._updateClamping(),this._splitDirection=e.splitDirection??Ho.NONE,this._positionFromParent=!1}var Vpe=Ni.SHOW_INDEX=0,M6=Ni.POSITION_INDEX=1,$pe=Ni.PIXEL_OFFSET_INDEX=2,C7e=Ni.EYE_OFFSET_INDEX=3,v7e=Ni.HORIZONTAL_ORIGIN_INDEX=4,S7e=Ni.VERTICAL_ORIGIN_INDEX=5,w7e=Ni.SCALE_INDEX=6,jpe=Ni.IMAGE_INDEX_INDEX=7,Hpe=Ni.COLOR_INDEX=8,I7e=Ni.ROTATION_INDEX=9,P7e=Ni.ALIGNED_AXIS_INDEX=10,D7e=Ni.SCALE_BY_DISTANCE_INDEX=11,R7e=Ni.TRANSLUCENCY_BY_DISTANCE_INDEX=12,O7e=Ni.PIXEL_OFFSET_SCALE_BY_DISTANCE_INDEX=13,M7e=Ni.DISTANCE_DISPLAY_CONDITION=14,N7e=Ni.DISABLE_DEPTH_DISTANCE=15;Ni.TEXTURE_COORDINATE_BOUNDS=16;var Gpe=Ni.SDF_INDEX=17,L7e=Ni.SPLIT_DIRECTION_INDEX=18;Ni.NUMBER_OF_PROPERTIES=19;function Do(e,t){let n=e._billboardCollection;l(n)&&(n._updateBillboard(e,t),e._dirty=!0)}function wK(e,t){return e===t||l(e)&&l(t)&&e.x===t.x&&e.y===t.y&&e.z===t.z}function Ox(e,t){if(l(e))return l(t)?(t.x=e.x,t.y=e.y,t.z=e.z,t):new h(e.x,e.y,e.z)}Object.defineProperties(Ni.prototype,{show:{get:function(){return this._show},set:function(e){this._show!==e&&(this._show=e,Do(this,Vpe))}},position:{get:function(){return this._position},set:function(e){let t=this._position;wK(t,e)||(Ox(e,t),Ox(e,this._actualPosition),this._updateClamping(),Do(this,M6))}},heightReference:{get:function(){return this._heightReference},set:function(e){let t=this._heightReference;e!==t&&(this._heightReference=e,this._updateClamping(),Do(this,M6))}},pixelOffset:{get:function(){return this._pixelOffset},set:function(e){let t=this._pixelOffset;U.equals(t,e)||(U.clone(e,t),Do(this,$pe))}},scaleByDistance:{get:function(){return this._scaleByDistance},set:function(e){let t=this._scaleByDistance;qt.equals(t,e)||(this._scaleByDistance=qt.clone(e,t),Do(this,D7e))}},translucencyByDistance:{get:function(){return this._translucencyByDistance},set:function(e){let t=this._translucencyByDistance;qt.equals(t,e)||(this._translucencyByDistance=qt.clone(e,t),Do(this,R7e))}},pixelOffsetScaleByDistance:{get:function(){return this._pixelOffsetScaleByDistance},set:function(e){let t=this._pixelOffsetScaleByDistance;qt.equals(t,e)||(this._pixelOffsetScaleByDistance=qt.clone(e,t),Do(this,O7e))}},eyeOffset:{get:function(){return this._eyeOffset},set:function(e){let t=this._eyeOffset;h.equals(t,e)||(h.clone(e,t),Do(this,C7e))}},horizontalOrigin:{get:function(){return this._horizontalOrigin},set:function(e){this._horizontalOrigin!==e&&(this._horizontalOrigin=e,Do(this,v7e))}},verticalOrigin:{get:function(){return this._verticalOrigin},set:function(e){this._verticalOrigin!==e&&(this._verticalOrigin=e,Do(this,S7e))}},scale:{get:function(){return this._scale},set:function(e){this._scale!==e&&(this._scale=e,Do(this,w7e))}},color:{get:function(){return this._color},set:function(e){let t=this._color;z.equals(t,e)||(z.clone(e,t),Do(this,Hpe))}},rotation:{get:function(){return this._rotation},set:function(e){this._rotation!==e&&(this._rotation=e,Do(this,I7e))}},alignedAxis:{get:function(){return this._alignedAxis},set:function(e){let t=this._alignedAxis;h.equals(t,e)||(h.clone(e,t),Do(this,P7e))}},width:{get:function(){return this._width??this._imageTexture.width},set:function(e){this._width!==e&&(this._width=e,Do(this,jpe))}},height:{get:function(){return this._height??this._imageTexture.height},set:function(e){this._height!==e&&(this._height=e,Do(this,jpe))}},sizeInMeters:{get:function(){return this._sizeInMeters},set:function(e){this._sizeInMeters!==e&&(this._sizeInMeters=e,Do(this,Hpe))}},distanceDisplayCondition:{get:function(){return this._distanceDisplayCondition},set:function(e){Ht.equals(e,this._distanceDisplayCondition)||(this._distanceDisplayCondition=Ht.clone(e,this._distanceDisplayCondition),Do(this,M7e))}},disableDepthTestDistance:{get:function(){return this._disableDepthTestDistance},set:function(e){this._disableDepthTestDistance!==e&&(this._disableDepthTestDistance=e,Do(this,N7e))}},id:{get:function(){return this._id},set:function(e){this._id=e,l(this._pickId)&&(this._pickId.object.id=e)}},pickPrimitive:{get:function(){return this._pickPrimitive},set:function(e){this._pickPrimitive=e,l(this._pickId)&&(this._pickId.object.primitive=e)}},pickId:{get:function(){return this._pickId}},image:{get:function(){return this._imageTexture.id},set:function(e){if(!l(e)){this._imageTexture.unload();return}this._computeImageTextureProperties(void 0,e),this._imageTexture.loadImage(this._imageId,e,this._imageWidth,this._imageHeight)}},ready:{get:function(){return this._imageTexture.ready}},loadError:{get:function(){return this._imageTexture.loadError}},textureDirty:{get:function(){return this._imageTexture.dirty},set:function(e){this._imageTexture.dirty=e}},_clampedPosition:{get:function(){return this._actualClampedPosition},set:function(e){this._actualClampedPosition=Ox(e,this._actualClampedPosition),Do(this,M6)}},clusterShow:{get:function(){return this._clusterShow},set:function(e){this._clusterShow!==e&&(this._clusterShow=e,Do(this,Vpe))}},outlineColor:{get:function(){return this._outlineColor},set:function(e){let t=this._outlineColor;z.equals(t,e)||(z.clone(e,t),Do(this,Gpe))}},outlineWidth:{get:function(){return this._outlineWidth},set:function(e){this._outlineWidth!==e&&(this._outlineWidth=e,Do(this,Gpe))}},splitDirection:{get:function(){return this._splitDirection},set:function(e){this._splitDirection!==e&&(this._splitDirection=e,Do(this,L7e))}}});Ni.prototype.getPickId=function(e){return l(this._pickId)||(this._pickId=e.createPickId({primitive:this._pickPrimitive,collection:this._collection,id:this._id})),this._pickId};Ni.prototype._updateClamping=function(){Ni._updateClamping(this._billboardCollection,this)};var N6=new he,F7e=new he,Wpe=200,qpe=30;function Ype(e,t,n,i){let r=t.cartographicToCartesian(i,e._clampedPosition);qy(e._heightReference)?e._mode===re.SCENE3D?(i.height+=n.height,t.cartographicToCartesian(i,r)):r.x+=n.height:e._heightReference===We.CLIP_TO_GROUND&&n.height>i.height&&(e._mode===re.SCENE3D?(i.height=n.height,t.cartographicToCartesian(i,r)):r.x=n.height),e._clampedPosition=r}Ni._updateClamping=function(e,t){if(!l(e)||!l(e._scene))return;let n=e._scene,i=n.ellipsoid??ee.default,r=n.frameState.mode,o=r!==t._mode;if(t._mode=r,(t._heightReference===We.NONE||o)&&l(t._removeCallbackFunc)&&(t._removeCallbackFunc(),t._removeCallbackFunc=void 0,t._clampedPosition=void 0,t._lastSurfaceHeight=void 0,t._clampedToSurface=!1),t._heightReference===We.NONE||t._positionFromParent||!l(t._position))return;let s=n.frameState.frameNumber;if(t._clampingHeightValid&&t._heightReference===We.CLIP_TO_GROUND&&r===re.SCENE3D&&l(t._removeCallbackFunc)&&l(t._lastSurfaceHeight)&&s-t._lastSurfaceQueryFrame<qpe){let A=t._position,b=t._clampingCartesian,x=A.x-b.x,T=A.y-b.y,E=A.z-b.z,v=Math.sqrt(x*x+T*T+E*E);if(t._clampingHeight-v>t._lastSurfaceHeight+Wpe){t._clampedToSurface=!0,t._clampedPosition=A;return}}let a=i.cartesianToCartographic(t._position,F7e);if(!l(a)){t._actualClampedPosition=void 0,t._clampingHeightValid=!1;return}t._clampingCartesian=Ox(t._position,t._clampingCartesian),t._clampingHeight=a.height,t._clampingHeightValid=!0;let c=t._heightReference===We.CLIP_TO_GROUND,u=s-t._lastSurfaceQueryFrame<qpe,f=c&&l(t._lastSurfaceHeight)&&a.height>t._lastSurfaceHeight+Wpe,d=f&&u,p=c&&u&&t._lastSurfaceQueryMissed;if(!((c&&t._lastSurfaceQueryMissed||f)&&l(t._removeCallbackFunc))){l(t._removeCallbackFunc)&&t._removeCallbackFunc();let A=he.clone(a);t._removeCallbackFunc=n.updateHeight(A,b=>{let x=n.getHeight(A,t._heightReference);l(x)&&(b.height=x,t._lastSurfaceQueryFrame=n.frameState.frameNumber,t._lastSurfaceQueryMissed=!1),t._lastSurfaceHeight=b.height,t._clampedToSurface=!0,Ype(t,i,A,b)},t._heightReference)}he.clone(a,N6);let y;d||p?y=t._lastSurfaceHeight:(t._lastSurfaceQueryFrame=s,y=n.getHeight(a,t._heightReference),t._lastSurfaceQueryMissed=!l(y),l(y)?t._lastSurfaceHeight=y:y=t._lastSurfaceHeight),t._clampedToSurface=l(y),l(y)&&(N6.height=y),Ype(t,i,a,N6)};Ni.prototype.computeTextureCoordinates=function(e){return this._imageTexture.computeTextureCoordinates(e)};Ni.prototype.setImage=function(e,t){this._computeImageTextureProperties(e,t),this._imageTexture.loadImage(this._imageId,t,this._imageWidth,this._imageHeight)};Ni.prototype.setImageTexture=function(e){Cg.clone(e,this._imageTexture)};var Xpe=512;Ni.prototype._computeImageTextureProperties=function(e,t){if(this._imageWidth=void 0,this._imageHeight=void 0,!l(t)){this._imageId=Kn();return}let n;typeof t=="string"?n=t:t instanceof De?n=t._url:l(t.src)&&(n=t.src),this._imageId=e??n??Kn(),l(this._width)&&l(this._height)&&!this._sizeInMeters&&B7e(n)&&(this._imageWidth=Math.min(this._width,Xpe),this._imageHeight=Math.min(this._height,Xpe))};function B7e(e){return l(e)?Uh(e)?e.startsWith("data:image/svg+xml"):rg(e)==="svg":!1}Ni.prototype.setImageSubRegion=function(e,t){this._imageTexture.addImageSubRegion(e,t)};Ni.prototype._setTranslate=function(e){let t=this._translate;U.equals(t,e)||(U.clone(e,t),Do(this,$pe))};Ni.prototype._getActualPosition=function(){return l(this._clampedPosition)?this._clampedPosition:this._actualPosition};Ni.prototype._setActualPosition=function(e){l(this._clampedPosition)||h.clone(e,this._actualPosition),Do(this,M6)};var Kpe=new se;Ni._computeActualPosition=function(e,t,n,i){return l(e._clampedPosition)?(n.mode!==e._mode&&e._updateClamping(),e._clampedPosition):n.mode===re.SCENE3D?t:(N.multiplyByPoint(i,t,Kpe),dr.computeActualEllipsoidPosition(n,Kpe))};var Jpe=new h;Ni._computeScreenSpacePosition=function(e,t,n,i,r,o){let s=N.multiplyByPoint(e,t,Jpe),a=dr.worldWithEyeOffsetToWindowCoordinates(r,s,n,o);if(l(a))return U.add(a,i,a),a};var O6=new U(0,0);Ni.prototype.computeScreenSpacePosition=function(e,t){let n=this._billboardCollection;l(t)||(t=new U),U.clone(this._pixelOffset,O6),U.add(O6,this._translate,O6);let i=n.modelMatrix,r=this._position;if(l(this._clampedPosition)&&(r=this._clampedPosition,e.mode!==re.SCENE3D)){let s=e.mapProjection,a=s.ellipsoid,c=s.unproject(r,N6);r=a.cartographicToCartesian(c,Jpe),i=N.IDENTITY}return Ni._computeScreenSpacePosition(i,r,this._eyeOffset,O6,e,t)};Ni.getScreenSpaceBoundingBox=function(e,t,n){let i=e.width,r=e.height,o=e.scale;i*=o,r*=o;let s=t.x;e.horizontalOrigin===Vi.RIGHT?s-=i:e.horizontalOrigin===Vi.CENTER&&(s-=i*.5);let a=t.y;return e.verticalOrigin===Gn.BOTTOM||e.verticalOrigin===Gn.BASELINE?a-=r:e.verticalOrigin===Gn.CENTER&&(a-=r*.5),l(n)||(n=new et),n.x=s,n.y=a,n.width=i,n.height=r,n};Ni.prototype.equals=function(e){return this===e||l(e)&&this._id===e._id&&h.equals(this._position,e._position)&&this.image===e.image&&this._show===e._show&&this._scale===e._scale&&this._verticalOrigin===e._verticalOrigin&&this._horizontalOrigin===e._horizontalOrigin&&this._heightReference===e._heightReference&&z.equals(this._color,e._color)&&U.equals(this._pixelOffset,e._pixelOffset)&&U.equals(this._translate,e._translate)&&h.equals(this._eyeOffset,e._eyeOffset)&&qt.equals(this._scaleByDistance,e._scaleByDistance)&&qt.equals(this._translucencyByDistance,e._translucencyByDistance)&&qt.equals(this._pixelOffsetScaleByDistance,e._pixelOffsetScaleByDistance)&&Ht.equals(this._distanceDisplayCondition,e._distanceDisplayCondition)&&this._disableDepthTestDistance===e._disableDepthTestDistance&&this._splitDirection===e._splitDirection};Ni.prototype._destroy=function(){l(this._customData)&&(this._billboardCollection._scene.globe._surface.removeTileCustomData(this._customData),this._customData=void 0),l(this._removeCallbackFunc)&&(this._removeCallbackFunc(),this._removeCallbackFunc=void 0),this.image=void 0,this._pickId=this._pickId&&this._pickId.destroy(),this._billboardCollection=void 0};var Br=Ni;var Zpe={OPAQUE:0,TRANSLUCENT:1,OPAQUE_AND_TRANSLUCENT:2};Object.freeze(Zpe);var Li=Zpe;var k7e={FONT_SIZE:48,PADDING:10,RADIUS:8,CUTOFF:.25},Ba=Object.freeze(k7e);var U7e=Br.SHOW_INDEX,pN=Br.POSITION_INDEX,e0e=Br.PIXEL_OFFSET_INDEX,t0e=Br.EYE_OFFSET_INDEX,z7e=Br.HORIZONTAL_ORIGIN_INDEX,V7e=Br.VERTICAL_ORIGIN_INDEX,j7e=Br.SCALE_INDEX,Mx=Br.IMAGE_INDEX_INDEX,n0e=Br.COLOR_INDEX,H7e=Br.ROTATION_INDEX,G7e=Br.ALIGNED_AXIS_INDEX,i0e=Br.SCALE_BY_DISTANCE_INDEX,r0e=Br.TRANSLUCENCY_BY_DISTANCE_INDEX,o0e=Br.PIXEL_OFFSET_SCALE_BY_DISTANCE_INDEX,s0e=Br.DISTANCE_DISPLAY_CONDITION,W7e=Br.DISABLE_DEPTH_DISTANCE,q7e=Br.TEXTURE_COORDINATE_BOUNDS,a0e=Br.SDF_INDEX,c0e=Br.SPLIT_DIRECTION_INDEX,MK=Br.NUMBER_OF_PROPERTIES,Vr={direction:0,positionHighAndScale:1,positionLowAndRotation:2,compressedAttribute0:3,compressedAttribute1:4,compressedAttribute2:5,eyeOffset:6,scaleByDistance:7,pixelOffsetScaleByDistance:8,compressedAttribute3:9,textureCoordinateBoundsOrLabelTranslate:10,a_batchId:11,sdf:12,splitDirection:13};function Fd(e){e=e??H.EMPTY_OBJECT,this._scene=e.scene,this._batchTable=e.batchTable;let t=e.textureAtlas;l(t)||(t=new Ex),this._textureAtlas=t,this._textureAtlasGUID=t.guid,this._destroyTextureAtlas=!0,this._billboardTextureCache=new Map,this._sp=void 0,this._spTranslucent=void 0,this._rsOpaque=void 0,this._rsTranslucent=void 0,this._vaf=void 0,this._billboards=[],this._billboardsToUpdate=[],this._billboardsToUpdateIndex=0,this._billboardsRemoved=!1,this._createVertexArray=!1,this._shaderRotation=!1,this._compiledShaderRotation=!1,this._shaderAlignedAxis=!1,this._compiledShaderAlignedAxis=!1,this._shaderScaleByDistance=!1,this._compiledShaderScaleByDistance=!1,this._shaderTranslucencyByDistance=!1,this._compiledShaderTranslucencyByDistance=!1,this._shaderPixelOffsetScaleByDistance=!1,this._compiledShaderPixelOffsetScaleByDistance=!1,this._shaderDistanceDisplayCondition=!1,this._compiledShaderDistanceDisplayCondition=!1,this._shaderDisableDepthDistance=!1,this._compiledShaderDisableDepthDistance=!1,this._shaderClampToGround=!1,this._compiledShaderClampToGround=!1,this._propertiesChanged=new Uint32Array(MK),this._maxSize=0,this._maxEyeOffset=0,this._maxScale=1,this._maxPixelOffset=0,this._allHorizontalCenter=!0,this._allVerticalCenter=!0,this._allSizedInMeters=!0,this._baseVolume=new ue,this._baseVolumeWC=new ue,this._baseVolume2D=new ue,this._boundingVolume=new ue,this._boundingVolumeDirty=!1,this._colorCommands=[],this._allBillboardsReady=!1,this.show=e.show??!0,this.modelMatrix=N.clone(e.modelMatrix??N.IDENTITY),this._modelMatrix=N.clone(N.IDENTITY),this.debugShowBoundingVolume=e.debugShowBoundingVolume??!1,this.debugShowTextureAtlas=e.debugShowTextureAtlas??!1,this.blendOption=e.blendOption??Li.OPAQUE_AND_TRANSLUCENT,this._blendOption=void 0,this._mode=re.SCENE3D,this._buffersUsage=[Me.STATIC_DRAW,Me.STATIC_DRAW,Me.STATIC_DRAW,Me.STATIC_DRAW,Me.STATIC_DRAW,Me.STATIC_DRAW,Me.STATIC_DRAW,Me.STATIC_DRAW,Me.STATIC_DRAW,Me.STATIC_DRAW,Me.STATIC_DRAW,Me.STATIC_DRAW,Me.STATIC_DRAW,Me.STATIC_DRAW,Me.STATIC_DRAW,Me.STATIC_DRAW,Me.STATIC_DRAW],this._highlightColor=z.clone(z.WHITE),this._coarseDepthTestDistance=e.coarseDepthTestDistance??ee.default.minimumRadius/10,this._threePointDepthTestDistance=e.threePointDepthTestDistance??ee.default.minimumRadius/1e3,this._uniforms={u_atlas:()=>this.textureAtlas.texture,u_highlightColor:()=>this._highlightColor,u_coarseDepthTestDistance:()=>this._coarseDepthTestDistance,u_threePointDepthTestDistance:()=>this._threePointDepthTestDistance};let n=this._scene;l(n)&&l(n.terrainProviderChanged)&&(this._removeCallbackFunc=n.terrainProviderChanged.addEventListener(function(){let i=this._billboards,r=i.length;for(let o=0;o<r;++o)l(i[o])&&i[o]._updateClamping()},this))}Object.defineProperties(Fd.prototype,{length:{get:function(){return NK(this),this._billboards.length}},textureAtlas:{get:function(){return this._textureAtlas},set:function(e){this._textureAtlas!==e&&(this._textureAtlas=this._destroyTextureAtlas&&this._textureAtlas&&this._textureAtlas.destroy(),this._textureAtlas=e)}},destroyTextureAtlas:{get:function(){return this._destroyTextureAtlas},set:function(e){this._destroyTextureAtlas=e}},sizeInBytes:{get:function(){return this._textureAtlas.sizeInBytes}},ready:{get:function(){return this._allBillboardsReady}},billboardTextureCache:{get:function(){return this._billboardTextureCache}},coarseDepthTestDistance:{get:function(){return this._coarseDepthTestDistance},set:function(e){this._coarseDepthTestDistance=e}},threePointDepthTestDistance:{get:function(){return this._threePointDepthTestDistance},set:function(e){this._threePointDepthTestDistance=e}}});function l0e(e){let t=e.length;for(let n=0;n<t;++n)e[n]&&e[n]._destroy()}Fd.prototype.add=function(e){let t=new Br(e,this);return t._index=this._billboards.length,this._billboards.push(t),this._createVertexArray=!0,t};Fd.prototype.remove=function(e){return this.contains(e)?(this._billboards[e._index]=void 0,this._billboardsRemoved=!0,this._createVertexArray=!0,e._destroy(),!0):!1};Fd.prototype.removeAll=function(){l0e(this._billboards),this._billboards=[],this._billboardsToUpdate=[],this._billboardsToUpdateIndex=0,this._billboardsRemoved=!1,this._createVertexArray=!0};function NK(e){if(e._billboardsRemoved){e._billboardsRemoved=!1;let t=[],n=e._billboards,i=n.length;for(let r=0,o=0;r<i;++r){let s=n[r];l(s)&&(s._index=o++,t.push(s))}e._billboards=t}}Fd.prototype._updateBillboard=function(e,t){e._dirty||(this._billboardsToUpdate[this._billboardsToUpdateIndex++]=e),++this._propertiesChanged[t]};Fd.prototype.contains=function(e){return l(e)&&e._billboardCollection===this};Fd.prototype.get=function(e){return NK(this),this._billboards[e]};function Qpe(e){let t=e.cache.billboardCollection_indexBufferInstanced;return l(t)||(t=tt.createIndexBuffer({context:e,typedArray:new Uint16Array([0,1,2,0,2,3]),usage:Me.STATIC_DRAW,indexDatatype:je.UNSIGNED_SHORT}),t.vertexArrayDestroyable=!1,e.cache.billboardCollection_indexBufferInstanced=t),t}function Y7e(e){let t=e.cache.billboardCollection_vertexBufferInstanced;return l(t)||(t=tt.createVertexBuffer({context:e,typedArray:new Float32Array([0,0,1,0,1,1,0,1]),usage:Me.STATIC_DRAW}),t.vertexArrayDestroyable=!1,e.cache.billboardCollection_vertexBufferInstanced=t),t}Fd.prototype.computeNewBuffersUsage=function(){let e=this._buffersUsage,t=!1,n=this._propertiesChanged;for(let i=0;i<MK;++i){let r=n[i]===0?Me.STATIC_DRAW:Me.STREAM_DRAW;t=t||e[i]!==r,e[i]=r}return t};function X7e(e,t,n,i,r){let o=[{index:Vr.positionHighAndScale,componentsPerAttribute:4,componentDatatype:Y.FLOAT,usage:n[pN]},{index:Vr.positionLowAndRotation,componentsPerAttribute:4,componentDatatype:Y.FLOAT,usage:n[pN]},{index:Vr.compressedAttribute0,componentsPerAttribute:4,componentDatatype:Y.FLOAT,usage:n[e0e]},{index:Vr.compressedAttribute1,componentsPerAttribute:4,componentDatatype:Y.FLOAT,usage:n[r0e]},{index:Vr.compressedAttribute2,componentsPerAttribute:4,componentDatatype:Y.FLOAT,usage:n[n0e]},{index:Vr.eyeOffset,componentsPerAttribute:4,componentDatatype:Y.FLOAT,usage:n[t0e]},{index:Vr.scaleByDistance,componentsPerAttribute:4,componentDatatype:Y.FLOAT,usage:n[i0e]},{index:Vr.pixelOffsetScaleByDistance,componentsPerAttribute:4,componentDatatype:Y.FLOAT,usage:n[o0e]},{index:Vr.compressedAttribute3,componentsPerAttribute:4,componentDatatype:Y.FLOAT,usage:n[s0e]},{index:Vr.textureCoordinateBoundsOrLabelTranslate,componentsPerAttribute:4,componentDatatype:Y.FLOAT,usage:n[q7e]},{index:Vr.splitDirection,componentsPerAttribute:1,componentDatatype:Y.FLOAT,usage:n[c0e]},{index:Vr.direction,componentsPerAttribute:2,componentDatatype:Y.FLOAT,vertexBuffer:Y7e(e)}];return l(i)&&o.push({index:Vr.a_batchId,componentsPerAttribute:1,componentDatatype:Y.FLOAT,bufferUsage:Me.STATIC_DRAW}),r&&o.push({index:Vr.sdf,componentsPerAttribute:2,componentDatatype:Y.FLOAT,usage:n[a0e]}),new mg(e,o,t,!0)}var IK=new Sn;function u0e(e,t){let n=e.center,i=t.x-n.x,r=t.y-n.y,o=t.z-n.z,s=Math.sqrt(i*i+r*r+o*o);s>e.radius&&(e.radius=s)}function f0e(e,t,n,i){let r=n[Vr.positionHighAndScale],o=n[Vr.positionLowAndRotation],s=i._getActualPosition();e._mode===re.SCENE3D&&(u0e(e._baseVolume,s),e._boundingVolumeDirty=!0),Sn.fromCartesian(s,IK);let a=i.scale,c=i.rotation;c!==0&&(e._shaderRotation=!0),e._maxScale=Math.max(e._maxScale,a);let u=IK.high,f=IK.low;r(i._index,u.x,u.y,u.z,a),o(i._index,f.x,f.y,f.z,c)}var Xy=new U,Ld=32768,LK=65536,PK=4096,Nx=256,K7e=128,$7e=32,J7e=8,L6=4,Z7e=1/256,d0e=new et;function h0e(e,t,n,i){let r=n[Vr.compressedAttribute0],o=i.pixelOffset,s=o.x,a=o.y,c=i._translate,u=c.x,f=c.y;e._maxPixelOffset=Math.max(e._maxPixelOffset,Math.abs(s+u),Math.abs(-a+f));let d=i.horizontalOrigin,p=i._verticalOrigin,g=i.show&&i.clusterShow;i.color.alpha===0&&(g=!1),p===Gn.BASELINE&&(p=Gn.BOTTOM),e._allHorizontalCenter=e._allHorizontalCenter&&d===Vi.CENTER,e._allVerticalCenter=e._allVerticalCenter&&p===Gn.CENTER;let m=0,y=0;if(i.ready){let I=i.computeTextureCoordinates(d0e);m=I.x,y=I.y}let A=Math.floor(D.clamp(s,-Ld,Ld)+Ld)*K7e;A+=(d+1)*$7e,A+=(p+1)*J7e,A+=(g?1:0)*L6;let b=Math.floor(D.clamp(a,-Ld,Ld)+Ld)*Nx,x=Math.floor(D.clamp(u*L6,-Ld,Ld)+Ld)*Nx,T=(D.clamp(f*L6,-Ld,Ld)+Ld)*Z7e,E=Math.floor(T),v=Math.floor((T-E)*Nx);b+=E,x+=v,Xy.x=m,Xy.y=y;let S=cn.compressTextureCoordinates(Xy);r(i._index,A,b,x,S)}function m0e(e,t,n,i){let r=n[Vr.compressedAttribute1],o=i.alignedAxis;h.equals(o,h.ZERO)||(o=h.normalize(o,new h),e._shaderAlignedAxis=!0);let s=0,a=1,c=1,u=1,f=i.translucencyByDistance;l(f)&&(s=f.near,a=f.nearValue,c=f.far,u=f.farValue,(a!==1||u!==1)&&(e._shaderTranslucencyByDistance=!0));let d=Math.round(i.width??0);e._maxSize=Math.max(e._maxSize,d);let p=D.clamp(d,0,LK),g=0;Math.abs(h.magnitudeSquared(o)-1)<D.EPSILON6&&(g=cn.octEncodeFloat(o)),a=D.clamp(a,0,1),a=a===1?255:a*255|0,p=p*Nx+a,u=D.clamp(u,0,1),u=u===1?255:u*255|0,g=g*Nx+u,r(i._index,p,g,s,c)}function RK(e,t,n,i){let r=n[Vr.compressedAttribute2],o=i.color,s=l(e._batchTable)?z.WHITE:i.getPickId(t.context).color,a=i.sizeInMeters?1:0,c=i.alignedAxis,u=h.equals(c,h.ZERO)?c:h.normalize(c,new h),f=Math.abs(h.magnitudeSquared(u)-1)<D.EPSILON6?1:0;e._allSizedInMeters=e._allSizedInMeters&&a===1;let d=i.height??0;e._maxSize=Math.max(e._maxSize,d);let p=i._labelHorizontalOrigin??-2;p+=2;let g=cn.encodeRGB8(o),m=cn.encodeRGB8(s),y=z.floatToByte(o.alpha)*LK+z.floatToByte(s.alpha)*Nx+(a*2+f),A=d*L6+p;r(i._index,g,m,y,A)}function OK(e,t,n,i){let r=n[Vr.eyeOffset],o=i.eyeOffset,s=o.z;if(i._heightReference!==We.NONE&&(s*=1.005),e._maxEyeOffset=Math.max(e._maxEyeOffset,Math.abs(o.x),Math.abs(o.y),Math.abs(s)),Xy.x=0,Xy.y=0,i.ready){let c=i.computeTextureCoordinates(d0e);Xy.x=c.width,Xy.y=c.height}let a=cn.compressTextureCoordinates(Xy);r(i._index,o.x,o.y,s,a)}function p0e(e,t,n,i){let r=n[Vr.scaleByDistance],o=0,s=1,a=1,c=1,u=i.scaleByDistance;l(u)&&(o=u.near,s=u.nearValue,a=u.far,c=u.farValue,(s!==1||c!==1)&&(e._shaderScaleByDistance=!0)),r(i._index,o,s,a,c)}function g0e(e,t,n,i){let r=n[Vr.pixelOffsetScaleByDistance],o=0,s=1,a=1,c=1,u=i.pixelOffsetScaleByDistance;l(u)&&(o=u.near,s=u.nearValue,a=u.far,c=u.farValue,(s!==1||c!==1)&&(e._shaderPixelOffsetScaleByDistance=!0)),r(i._index,o,s,a,c)}function _0e(e,t,n,i){let r=n[Vr.compressedAttribute3],o=0,s=Number.MAX_VALUE,a=i.distanceDisplayCondition;l(a)&&(o=a.near,s=a.far,o*=o,s*=s,e._shaderDistanceDisplayCondition=!0);let c=i.disableDepthTestDistance,u=bs(i.heightReference)&&t.context.depthTexture;c*=c,(u||c>0)&&(e._shaderDisableDepthDistance=!0,c===Number.POSITIVE_INFINITY&&(c=-1));let f,d;l(i._labelDimensions)?(d=i._labelDimensions.x,f=i._labelDimensions.y):(d=i.width??0,f=i.height??0);let p=Math.floor(D.clamp(d,0,PK)),g=Math.floor(D.clamp(f,0,PK)),m=p*PK+g;r(i._index,o,s,c,m)}function y0e(e,t,n,i){if(bs(i.heightReference)){let a=e._scene,c=t.context,u=t.globeTranslucencyState.translucent,f=l(a.globe)&&a.globe.depthTestAgainstTerrain;e._shaderClampToGround=c.depthTexture&&!u&&f}let r=n[Vr.textureCoordinateBoundsOrLabelTranslate],o=0,s=0;l(i._labelTranslate)&&(o=i._labelTranslate.x,s=i._labelTranslate.y),r(i._index,o,s,0,0)}function Q7e(e,t,n,i){if(!l(e._batchTable))return;let r=n[Vr.a_batchId],o=i._batchIndex;r(i._index,o)}function A0e(e,t,n,i){if(!e._sdf)return;let r=n[Vr.sdf],o=i.outlineColor,s=i.outlineWidth,a=cn.encodeRGB8(o),c=s/Ba.RADIUS,u=z.floatToByte(o.alpha)*LK+z.floatToByte(c)*Nx;r(i._index,a,u)}function b0e(e,t,n,i){let r=n[Vr.splitDirection],o=0,s=i.splitDirection;l(s)&&(o=s),r(i._index,o)}function eWe(e,t,n,i){f0e(e,t,n,i),h0e(e,t,n,i),m0e(e,t,n,i),RK(e,t,n,i),OK(e,t,n,i),p0e(e,t,n,i),g0e(e,t,n,i),_0e(e,t,n,i),y0e(e,t,n,i),Q7e(e,t,n,i),A0e(e,t,n,i),b0e(e,t,n,i)}function DK(e,t,n,i,r,o){let s;i.mode===re.SCENE3D?(s=e._baseVolume,e._boundingVolumeDirty=!0):s=e._baseVolume2D;let a=[];for(let c=0;c<n;++c){let u=t[c],f=u.position,d=Br._computeActualPosition(u,f,i,r);l(d)&&(u._setActualPosition(d),o?a.push(d):u0e(s,d))}o&&ue.fromPoints(a,s)}function tWe(e,t){let n=t.mode,i=e._billboards,r=e._billboardsToUpdate,o=e._modelMatrix;e._createVertexArray||e._mode!==n||n!==re.SCENE3D&&!N.equals(o,e.modelMatrix)?(e._mode=n,N.clone(e.modelMatrix,o),e._createVertexArray=!0,(n===re.SCENE3D||n===re.SCENE2D||n===re.COLUMBUS_VIEW)&&DK(e,i,i.length,t,o,!0)):n===re.MORPHING?DK(e,i,i.length,t,o,!0):(n===re.SCENE2D||n===re.COLUMBUS_VIEW)&&DK(e,r,e._billboardsToUpdateIndex,t,o,!1)}function nWe(e,t,n){let i=1;(!e._allSizedInMeters||e._maxPixelOffset!==0)&&(i=t.camera.getPixelSize(n,t.context.drawingBufferWidth,t.context.drawingBufferHeight));let r=i*e._maxScale*e._maxSize*2;e._allHorizontalCenter&&e._allVerticalCenter&&(r*=.5);let o=i*e._maxPixelOffset+e._maxEyeOffset;n.radius+=r+o}function iWe(e,t){let i=t.createViewportQuadCommand(`uniform sampler2D billboard_texture; +in vec2 v_textureCoordinates; void main() { - tile_color(vec4(1.0)); - tile_featureSt = computeSt(${t}); -}`,`${o} -${lqe(i)}${s}`}};function p0e(e,t){return e=Ye.replaceMain(e,"tile_main"),t?`${e}uniform float tile_colorBlend; -void tile_color(vec4 tile_featureColor) -{ - tile_main(); - tile_featureColor = czm_gammaCorrect(tile_featureColor); - out_FragColor.a *= tile_featureColor.a; - float highlight = ceil(tile_colorBlend); - out_FragColor.rgb *= mix(tile_featureColor.rgb, vec3(1.0), highlight); -} -`:`${e}void tile_color(vec4 tile_featureColor) -{ - tile_main(); -} -`}function uqe(e,t){let n=`texture(${t}`,i=0,r=e.indexOf(n,i),o;for(;r>-1;){let s=0;for(let u=r;u<e.length;++u){let f=e.charAt(u);if(f==="(")++s;else if(f===")"&&(--s,s===0)){o=u+1;break}}let c=`tile_diffuse_final(${e.slice(r,o)}, tile_diffuse)`;e=e.slice(0,r)+c+e.slice(o),i=r+c.length,r=e.indexOf(n,i)}return e}function _0e(e,t,n){if(!l(t))return p0e(e,n);let i=new RegExp(`(uniform|attribute|in)\\s+(vec[34]|sampler2D)\\s+${t};`),r=e.match(i);if(!l(r))return p0e(e,n);let o=r[0],s=r[2];e=Ye.replaceMain(e,"tile_main"),e=e.replace(o,"");let a=`bool isWhite(vec3 color) -{ - return all(greaterThan(color, vec3(1.0 - czm_epsilon3))); -} -vec4 tile_diffuse_final(vec4 sourceDiffuse, vec4 tileDiffuse) -{ - vec4 blendDiffuse = mix(sourceDiffuse, tileDiffuse, tile_colorBlend); - vec4 diffuse = isWhite(tileDiffuse.rgb) ? sourceDiffuse : blendDiffuse; - return vec4(diffuse.rgb, sourceDiffuse.a); + out_FragColor = texture(billboard_texture, v_textureCoordinates); } -`,c=` tile_featureColor = czm_gammaCorrect(tile_featureColor); - out_FragColor.a *= tile_featureColor.a; - float highlight = ceil(tile_colorBlend); - out_FragColor.rgb *= mix(tile_featureColor.rgb, vec3(1.0), highlight); -`,u;if(s==="vec3"||s==="vec4"){let f=s==="vec3"?`vec4(${t}, 1.0)`:t,d=s==="vec3"?"tile_diffuse.xyz":"tile_diffuse";i=new RegExp(t,"g"),e=e.replace(i,d),u=` vec4 source = ${f}; - tile_diffuse = tile_diffuse_final(source, tile_featureColor); - tile_main(); -`}else s==="sampler2D"&&(e=uqe(e,t),u=` tile_diffuse = tile_featureColor; - tile_main(); -`);return e=`uniform float tile_colorBlend; -vec4 tile_diffuse = vec4(1.0); -${a}${o} -${e} -void tile_color(vec4 tile_featureColor) -{ -${u}`,n&&(e+=c),e+=`} -`,e}Yr.prototype.getFragmentShaderCallback=function(e,t,n){if(this.featuresLength!==0)return function(i){return i=_0e(i,t,!0),kt.maximumVertexTextureImageUnits>0?(i+=`uniform sampler2D tile_pickTexture; -in vec2 tile_featureSt; -in vec4 tile_featureColor; -void main() -{ - tile_color(tile_featureColor); -`,n&&(i+=` out_FragColor.rgb *= out_FragColor.a; -`),i+="}"):(e&&(i+=`uniform bool tile_translucentCommand; -`),i+=`uniform sampler2D tile_pickTexture; -uniform sampler2D tile_batchTexture; -in vec2 tile_featureSt; -void main() -{ - vec4 featureProperties = texture(tile_batchTexture, tile_featureSt); - if (featureProperties.a == 0.0) { - discard; - } -`,e&&(i+=` bool isStyleTranslucent = (featureProperties.a != 1.0); - if (czm_pass == czm_passTranslucent) - { - if (!isStyleTranslucent && !tile_translucentCommand) - { - discard; - } - } - else - { - if (isStyleTranslucent) - { - discard; - } - } -`),i+=` tile_color(featureProperties); -`,n&&(i+=` out_FragColor.rgb *= out_FragColor.a; -`),i+=`} -`),i}};function fqe(e){let t=e._content.tileset,n=t.colorBlendMode,i=t.colorBlendAmount;if(n===zu.HIGHLIGHT)return 0;if(n===zu.REPLACE)return 1;if(n===zu.MIX)return D.clamp(i,D.EPSILON4,1)}Yr.prototype.getUniformMapCallback=function(){if(this.featuresLength===0)return;let e=this;return function(t){return Ot(t,{tile_batchTexture:function(){return e._batchTexture.batchTexture??e._batchTexture.defaultTexture},tile_textureDimensions:function(){return e._batchTexture.textureDimensions},tile_textureStep:function(){return e._batchTexture.textureStep},tile_colorBlend:function(){return fqe(e)},tile_pickTexture:function(){return e._batchTexture.pickTexture}})}};Yr.prototype.getPickId=function(){return"texture(tile_pickTexture, tile_featureSt)"};var Qy={ALL_OPAQUE:0,ALL_TRANSLUCENT:1,OPAQUE_AND_TRANSLUCENT:2};Yr.prototype.addDerivedCommands=function(e,t){let n=e.commandList,i=n.length,r=this._content._tile,o=r._finalResolution,s=r.tileset,a=s.isSkippingLevelOfDetail&&s.hasMixedContent&&e.context.stencilBuffer,c=dqe(this);for(let u=t;u<i;++u){let f=n[u];if(f.pass===Ie.COMPUTE)continue;let d=f.derivedCommands.tileset;(!l(d)||f.dirty)&&(d={},f.derivedCommands.tileset=d,d.originalCommand=hqe(f),f.dirty=!1);let p=d.originalCommand;c!==Qy.ALL_OPAQUE&&f.pass!==Ie.TRANSLUCENT&&(l(d.translucent)||(d.translucent=mqe(p))),c!==Qy.ALL_TRANSLUCENT&&f.pass!==Ie.TRANSLUCENT&&(l(d.opaque)||(d.opaque=pqe(p)),a&&(o||(l(d.zback)||(d.zback=_qe(e.context,p)),s._backfaceCommands.push(d.zback)),(!l(d.stencil)||r._selectionDepth!==Aqe(d.stencil))&&(f.renderState.depthMask?d.stencil=yqe(p,r._selectionDepth):d.stencil=d.opaque)));let g=a?d.stencil:d.opaque,m=d.translucent;f.pass!==Ie.TRANSLUCENT?(c===Qy.ALL_OPAQUE&&(n[u]=g),c===Qy.ALL_TRANSLUCENT&&(n[u]=m),c===Qy.OPAQUE_AND_TRANSLUCENT&&(n[u]=g,n.push(m))):n[u]=p}};function dqe(e){let t=e._batchTexture.translucentFeaturesLength;return t===0?Qy.ALL_OPAQUE:t===e.featuresLength?Qy.ALL_TRANSLUCENT:Qy.OPAQUE_AND_TRANSLUCENT}function hqe(e){let t=at.shallowClone(e),n=t.pass===Ie.TRANSLUCENT;return t.uniformMap=l(t.uniformMap)?t.uniformMap:{},t.uniformMap.tile_translucentCommand=function(){return n},t}function mqe(e){let t=at.shallowClone(e);return t.pass=Ie.TRANSLUCENT,t.renderState=bqe(e.renderState),t}function pqe(e){let t=at.shallowClone(e);return t.renderState=xqe(e.renderState),t}function gqe(e,t){let n=e.shaderCache.getDerivedShaderProgram(t,"zBackfaceLogDepth");if(!l(n)){let i=t.fragmentShaderSource.clone();i.defines=l(i.defines)?i.defines.slice(0):[],i.defines.push("POLYGON_OFFSET"),n=e.shaderCache.createDerivedShaderProgram(t,"zBackfaceLogDepth",{vertexShaderSource:t.vertexShaderSource,fragmentShaderSource:i,attributeLocations:t._attributeLocations})}return n}function _qe(e,t){let n=at.shallowClone(t),i=Je(n.renderState,!0);i.cull.enabled=!0,i.cull.face=Vi.FRONT,i.colorMask={red:!1,green:!1,blue:!1,alpha:!1},i.polygonOffset={enabled:!0,factor:5,units:5},i.stencilTest=Yt.setCesium3DTileBit(),i.stencilMask=Yt.CESIUM_3D_TILE_MASK,n.renderState=Ge.fromCache(i),n.castShadows=!1,n.receiveShadows=!1,n.uniformMap=Je(t.uniformMap);let r=new U(5,5);return n.uniformMap.u_polygonOffset=function(){return r},n.shaderProgram=gqe(e,t.shaderProgram),n}function yqe(e,t){let n=at.shallowClone(e),i=Je(n.renderState,!0);return i.stencilTest.enabled=!0,i.stencilTest.mask=Yt.SKIP_LOD_MASK,i.stencilTest.reference=Yt.CESIUM_3D_TILE_MASK|t<<Yt.SKIP_LOD_BIT_SHIFT,i.stencilTest.frontFunction=ti.GREATER_OR_EQUAL,i.stencilTest.frontOperation.zPass=Rt.REPLACE,i.stencilTest.backFunction=ti.GREATER_OR_EQUAL,i.stencilTest.backOperation.zPass=Rt.REPLACE,i.stencilMask=Yt.CESIUM_3D_TILE_MASK|Yt.SKIP_LOD_MASK,n.renderState=Ge.fromCache(i),n}function Aqe(e){return(e.renderState.stencilTest.reference&Yt.SKIP_LOD_MASK)>>>Yt.SKIP_LOD_BIT_SHIFT}function bqe(e){let t=Je(e,!0);return t.cull.enabled=!1,t.depthTest.enabled=!0,t.depthMask=!1,t.blending=tn.ALPHA_BLEND,t.stencilTest=Yt.setCesium3DTileBit(),t.stencilMask=Yt.CESIUM_3D_TILE_MASK,Ge.fromCache(t)}function xqe(e){let t=Je(e,!0);return t.stencilTest=Yt.setCesium3DTileBit(),t.stencilMask=Yt.CESIUM_3D_TILE_MASK,Ge.fromCache(t)}Yr.prototype.update=function(e,t){this._batchTexture.update(e,t)};Yr.prototype.isDestroyed=function(){return!1};Yr.prototype.destroy=function(){return this._batchTexture=this._batchTexture&&this._batchTexture.destroy(),le(this)};var sm=Yr;function Tqe(e){this.offset=e.offset,this.count=e.count,this.color=e.color,this.batchIds=e.batchIds}var zp=Tqe;var UK=class e{constructor(t,n){this._content=t,this._batchId=n,this._color=void 0}get show(){return this._content.batchTable.getShow(this._batchId)}set show(t){this._content.batchTable.setShow(this._batchId,t)}get color(){return l(this._color)||(this._color=new z),this._content.batchTable.getColor(this._batchId,this._color)}set color(t){this._content.batchTable.setColor(this._batchId,t)}get polylinePositions(){if(l(this._content.getPolylinePositions))return this._content.getPolylinePositions(this._batchId)}get content(){return this._content}get tileset(){return this._content.tileset}get primitive(){return this._content.tileset}get featureId(){return this._batchId}get pickId(){return this._content.batchTable.getPickColor(this._batchId)}hasProperty(t){return this._content.batchTable.hasProperty(this._batchId,t)}getPropertyIds(t){return this._content.batchTable.getPropertyIds(this._batchId,t)}getProperty(t){return this._content.batchTable.getProperty(this._batchId,t)}static getPropertyInherited(t,n,i,r=t.batchTable){if(l(r)){if(r.hasPropertyBySemantic(n,i))return r.getPropertyBySemantic(n,i);if(r.hasProperty(n,i))return r.getProperty(n,i)}let o=t.metadata;if(l(o)){if(o.hasPropertyBySemantic(i))return o.getPropertyBySemantic(i);if(o.hasProperty(i))return o.getProperty(i)}let s=t.tile,a=s.metadata;if(l(a)){if(a.hasPropertyBySemantic(i))return a.getPropertyBySemantic(i);if(a.hasProperty(i))return a.getProperty(i)}let c;if(l(s.implicitSubtree)&&(c=s.implicitSubtree.metadata),l(c)){if(c.hasPropertyBySemantic(i))return c.getPropertyBySemantic(i);if(c.hasProperty(i))return c.getProperty(i)}let u=l(t.group)?t.group.metadata:void 0;if(l(u)){if(u.hasPropertyBySemantic(i))return u.getPropertyBySemantic(i);if(u.hasProperty(i))return u.getProperty(i)}let f=t.tileset.metadata;if(l(f)){if(f.hasPropertyBySemantic(i))return f.getPropertyBySemantic(i);if(f.hasProperty(i))return f.getProperty(i)}}getPropertyInherited(t){return e.getPropertyInherited(this._content,this._batchId,t)}setProperty(t,n){this._content.batchTable.setProperty(this._batchId,t,n),this._content.featurePropertiesDirty=!0}isExactClass(t){return this._content.batchTable.isExactClass(this._batchId,t)}isClass(t){return this._content.batchTable.isClass(this._batchId,t)}getExactClassName(){return this._content.batchTable.getExactClassName(this._batchId)}},na=UK;var zK=class{add(t,n,i){if(typeof arguments[0]!="string")for(let r in arguments[0])this.add(r,arguments[0][r],arguments[1]);else(Array.isArray(t)?t:[t]).forEach(function(r){this[r]=this[r]||[],n&&this[r][i?"unshift":"push"](n)},this)}run(t,n){this[t]=this[t]||[],this[t].forEach(function(i){i.call(n&&n.context?n.context:n,n)})}},VK=class{constructor(t){this.jsep=t,this.registered={}}register(...t){t.forEach(n=>{if(typeof n!="object"||!n.name||!n.init)throw new Error("Invalid JSEP plugin format");this.registered[n.name]||(n.init(this.jsep),this.registered[n.name]=n)})}},Vu=class e{static get version(){return"1.4.0"}static toString(){return"JavaScript Expression Parser (JSEP) v"+e.version}static addUnaryOp(t){return e.max_unop_len=Math.max(t.length,e.max_unop_len),e.unary_ops[t]=1,e}static addBinaryOp(t,n,i){return e.max_binop_len=Math.max(t.length,e.max_binop_len),e.binary_ops[t]=n,i?e.right_associative.add(t):e.right_associative.delete(t),e}static addIdentifierChar(t){return e.additional_identifier_chars.add(t),e}static addLiteral(t,n){return e.literals[t]=n,e}static removeUnaryOp(t){return delete e.unary_ops[t],t.length===e.max_unop_len&&(e.max_unop_len=e.getMaxKeyLen(e.unary_ops)),e}static removeAllUnaryOps(){return e.unary_ops={},e.max_unop_len=0,e}static removeIdentifierChar(t){return e.additional_identifier_chars.delete(t),e}static removeBinaryOp(t){return delete e.binary_ops[t],t.length===e.max_binop_len&&(e.max_binop_len=e.getMaxKeyLen(e.binary_ops)),e.right_associative.delete(t),e}static removeAllBinaryOps(){return e.binary_ops={},e.max_binop_len=0,e}static removeLiteral(t){return delete e.literals[t],e}static removeAllLiterals(){return e.literals={},e}get char(){return this.expr.charAt(this.index)}get code(){return this.expr.charCodeAt(this.index)}constructor(t){this.expr=t,this.index=0}static parse(t){return new e(t).parse()}static getMaxKeyLen(t){return Math.max(0,...Object.keys(t).map(n=>n.length))}static isDecimalDigit(t){return t>=48&&t<=57}static binaryPrecedence(t){return e.binary_ops[t]||0}static isIdentifierStart(t){return t>=65&&t<=90||t>=97&&t<=122||t>=128&&!e.binary_ops[String.fromCharCode(t)]||e.additional_identifier_chars.has(String.fromCharCode(t))}static isIdentifierPart(t){return e.isIdentifierStart(t)||e.isDecimalDigit(t)}throwError(t){let n=new Error(t+" at character "+this.index);throw n.index=this.index,n.description=t,n}runHook(t,n){if(e.hooks[t]){let i={context:this,node:n};return e.hooks.run(t,i),i.node}return n}searchHook(t){if(e.hooks[t]){let n={context:this};return e.hooks[t].find(function(i){return i.call(n.context,n),n.node}),n.node}}gobbleSpaces(){let t=this.code;for(;t===e.SPACE_CODE||t===e.TAB_CODE||t===e.LF_CODE||t===e.CR_CODE;)t=this.expr.charCodeAt(++this.index);this.runHook("gobble-spaces")}parse(){this.runHook("before-all");let t=this.gobbleExpressions(),n=t.length===1?t[0]:{type:e.COMPOUND,body:t};return this.runHook("after-all",n)}gobbleExpressions(t){let n=[],i,r;for(;this.index<this.expr.length;)if(i=this.code,i===e.SEMCOL_CODE||i===e.COMMA_CODE)this.index++;else if(r=this.gobbleExpression())n.push(r);else if(this.index<this.expr.length){if(i===t)break;this.throwError('Unexpected "'+this.char+'"')}return n}gobbleExpression(){let t=this.searchHook("gobble-expression")||this.gobbleBinaryExpression();return this.gobbleSpaces(),this.runHook("after-expression",t)}gobbleBinaryOp(){this.gobbleSpaces();let t=this.expr.substr(this.index,e.max_binop_len),n=t.length;for(;n>0;){if(e.binary_ops.hasOwnProperty(t)&&(!e.isIdentifierStart(this.code)||this.index+t.length<this.expr.length&&!e.isIdentifierPart(this.expr.charCodeAt(this.index+t.length))))return this.index+=n,t;t=t.substr(0,--n)}return!1}gobbleBinaryExpression(){let t,n,i,r,o,s,a,c,u;if(s=this.gobbleToken(),!s||(n=this.gobbleBinaryOp(),!n))return s;for(o={value:n,prec:e.binaryPrecedence(n),right_a:e.right_associative.has(n)},a=this.gobbleToken(),a||this.throwError("Expected expression after "+n),r=[s,o,a];n=this.gobbleBinaryOp();){if(i=e.binaryPrecedence(n),i===0){this.index-=n.length;break}o={value:n,prec:i,right_a:e.right_associative.has(n)},u=n;let f=d=>o.right_a&&d.right_a?i>d.prec:i<=d.prec;for(;r.length>2&&f(r[r.length-2]);)a=r.pop(),n=r.pop().value,s=r.pop(),t={type:e.BINARY_EXP,operator:n,left:s,right:a},r.push(t);t=this.gobbleToken(),t||this.throwError("Expected expression after "+u),r.push(o,t)}for(c=r.length-1,t=r[c];c>1;)t={type:e.BINARY_EXP,operator:r[c-1].value,left:r[c-2],right:t},c-=2;return t}gobbleToken(){let t,n,i,r;if(this.gobbleSpaces(),r=this.searchHook("gobble-token"),r)return this.runHook("after-token",r);if(t=this.code,e.isDecimalDigit(t)||t===e.PERIOD_CODE)return this.gobbleNumericLiteral();if(t===e.SQUOTE_CODE||t===e.DQUOTE_CODE)r=this.gobbleStringLiteral();else if(t===e.OBRACK_CODE)r=this.gobbleArray();else{for(n=this.expr.substr(this.index,e.max_unop_len),i=n.length;i>0;){if(e.unary_ops.hasOwnProperty(n)&&(!e.isIdentifierStart(this.code)||this.index+n.length<this.expr.length&&!e.isIdentifierPart(this.expr.charCodeAt(this.index+n.length)))){this.index+=i;let o=this.gobbleToken();return o||this.throwError("missing unaryOp argument"),this.runHook("after-token",{type:e.UNARY_EXP,operator:n,argument:o,prefix:!0})}n=n.substr(0,--i)}e.isIdentifierStart(t)?(r=this.gobbleIdentifier(),e.literals.hasOwnProperty(r.name)?r={type:e.LITERAL,value:e.literals[r.name],raw:r.name}:r.name===e.this_str&&(r={type:e.THIS_EXP})):t===e.OPAREN_CODE&&(r=this.gobbleGroup())}return r?(r=this.gobbleTokenProperty(r),this.runHook("after-token",r)):this.runHook("after-token",!1)}gobbleTokenProperty(t){this.gobbleSpaces();let n=this.code;for(;n===e.PERIOD_CODE||n===e.OBRACK_CODE||n===e.OPAREN_CODE||n===e.QUMARK_CODE;){let i;if(n===e.QUMARK_CODE){if(this.expr.charCodeAt(this.index+1)!==e.PERIOD_CODE)break;i=!0,this.index+=2,this.gobbleSpaces(),n=this.code}this.index++,n===e.OBRACK_CODE?(t={type:e.MEMBER_EXP,computed:!0,object:t,property:this.gobbleExpression()},t.property||this.throwError('Unexpected "'+this.char+'"'),this.gobbleSpaces(),n=this.code,n!==e.CBRACK_CODE&&this.throwError("Unclosed ["),this.index++):n===e.OPAREN_CODE?t={type:e.CALL_EXP,arguments:this.gobbleArguments(e.CPAREN_CODE),callee:t}:(n===e.PERIOD_CODE||i)&&(i&&this.index--,this.gobbleSpaces(),t={type:e.MEMBER_EXP,computed:!1,object:t,property:this.gobbleIdentifier()}),i&&(t.optional=!0),this.gobbleSpaces(),n=this.code}return t}gobbleNumericLiteral(){let t="",n,i;for(;e.isDecimalDigit(this.code);)t+=this.expr.charAt(this.index++);if(this.code===e.PERIOD_CODE)for(t+=this.expr.charAt(this.index++);e.isDecimalDigit(this.code);)t+=this.expr.charAt(this.index++);if(n=this.char,n==="e"||n==="E"){for(t+=this.expr.charAt(this.index++),n=this.char,(n==="+"||n==="-")&&(t+=this.expr.charAt(this.index++));e.isDecimalDigit(this.code);)t+=this.expr.charAt(this.index++);e.isDecimalDigit(this.expr.charCodeAt(this.index-1))||this.throwError("Expected exponent ("+t+this.char+")")}return i=this.code,e.isIdentifierStart(i)?this.throwError("Variable names cannot start with a number ("+t+this.char+")"):(i===e.PERIOD_CODE||t.length===1&&t.charCodeAt(0)===e.PERIOD_CODE)&&this.throwError("Unexpected period"),{type:e.LITERAL,value:parseFloat(t),raw:t}}gobbleStringLiteral(){let t="",n=this.index,i=this.expr.charAt(this.index++),r=!1;for(;this.index<this.expr.length;){let o=this.expr.charAt(this.index++);if(o===i){r=!0;break}else if(o==="\\")switch(o=this.expr.charAt(this.index++),o){case"n":t+=` -`;break;case"r":t+="\r";break;case"t":t+=" ";break;case"b":t+="\b";break;case"f":t+="\f";break;case"v":t+="\v";break;default:t+=o}else t+=o}return r||this.throwError('Unclosed quote after "'+t+'"'),{type:e.LITERAL,value:t,raw:this.expr.substring(n,this.index)}}gobbleIdentifier(){let t=this.code,n=this.index;for(e.isIdentifierStart(t)?this.index++:this.throwError("Unexpected "+this.char);this.index<this.expr.length&&(t=this.code,e.isIdentifierPart(t));)this.index++;return{type:e.IDENTIFIER,name:this.expr.slice(n,this.index)}}gobbleArguments(t){let n=[],i=!1,r=0;for(;this.index<this.expr.length;){this.gobbleSpaces();let o=this.code;if(o===t){i=!0,this.index++,t===e.CPAREN_CODE&&r&&r>=n.length&&this.throwError("Unexpected token "+String.fromCharCode(t));break}else if(o===e.COMMA_CODE){if(this.index++,r++,r!==n.length){if(t===e.CPAREN_CODE)this.throwError("Unexpected token ,");else if(t===e.CBRACK_CODE)for(let s=n.length;s<r;s++)n.push(null)}}else if(n.length!==r&&r!==0)this.throwError("Expected comma");else{let s=this.gobbleExpression();(!s||s.type===e.COMPOUND)&&this.throwError("Expected comma"),n.push(s)}}return i||this.throwError("Expected "+String.fromCharCode(t)),n}gobbleGroup(){this.index++;let t=this.gobbleExpressions(e.CPAREN_CODE);if(this.code===e.CPAREN_CODE)return this.index++,t.length===1?t[0]:t.length?{type:e.SEQUENCE_EXP,expressions:t}:!1;this.throwError("Unclosed (")}gobbleArray(){return this.index++,{type:e.ARRAY_EXP,elements:this.gobbleArguments(e.CBRACK_CODE)}}},Eqe=new zK;Object.assign(Vu,{hooks:Eqe,plugins:new VK(Vu),COMPOUND:"Compound",SEQUENCE_EXP:"SequenceExpression",IDENTIFIER:"Identifier",MEMBER_EXP:"MemberExpression",LITERAL:"Literal",THIS_EXP:"ThisExpression",CALL_EXP:"CallExpression",UNARY_EXP:"UnaryExpression",BINARY_EXP:"BinaryExpression",ARRAY_EXP:"ArrayExpression",TAB_CODE:9,LF_CODE:10,CR_CODE:13,SPACE_CODE:32,PERIOD_CODE:46,COMMA_CODE:44,SQUOTE_CODE:39,DQUOTE_CODE:34,OPAREN_CODE:40,CPAREN_CODE:41,OBRACK_CODE:91,CBRACK_CODE:93,QUMARK_CODE:63,SEMCOL_CODE:59,COLON_CODE:58,unary_ops:{"-":1,"!":1,"~":1,"+":1},binary_ops:{"||":1,"??":1,"&&":2,"|":3,"^":4,"&":5,"==":6,"!=":6,"===":6,"!==":6,"<":7,">":7,"<=":7,">=":7,"<<":8,">>":8,">>>":8,"+":9,"-":9,"*":10,"/":10,"%":10,"**":11},right_associative:new Set(["**"]),additional_identifier_chars:new Set(["$","_"]),literals:{true:!0,false:!1,null:null},this_str:"this"});Vu.max_unop_len=Vu.getMaxKeyLen(Vu.unary_ops);Vu.max_binop_len=Vu.getMaxKeyLen(Vu.binary_ops);var eA=e=>new Vu(e).parse(),Cqe=Object.getOwnPropertyNames(class{});Object.getOwnPropertyNames(Vu).filter(e=>!Cqe.includes(e)&&eA[e]===void 0).forEach(e=>{eA[e]=Vu[e]});eA.Jsep=Vu;var vqe="ConditionalExpression",Sqe={name:"ternary",init(e){e.hooks.add("after-expression",function(n){if(n.node&&this.code===e.QUMARK_CODE){this.index++;let i=n.node,r=this.gobbleExpression();if(r||this.throwError("Expected expression"),this.gobbleSpaces(),this.code===e.COLON_CODE){this.index++;let o=this.gobbleExpression();if(o||this.throwError("Expected expression"),n.node={type:vqe,test:i,consequent:r,alternate:o},i.operator&&e.binary_ops[i.operator]<=.9){let s=i;for(;s.right.operator&&e.binary_ops[s.right.operator]<=.9;)s=s.right;n.node.test=s.right,s.right=n.node,n.node=i}}else this.throwError("Expected :")}})}};eA.plugins.register(Sqe);var y0e={VARIABLE:0,UNARY:1,BINARY:2,TERNARY:3,CONDITIONAL:4,MEMBER:5,FUNCTION_CALL:6,ARRAY:7,REGEX:8,VARIABLE_IN_STRING:9,LITERAL_NULL:10,LITERAL_BOOLEAN:11,LITERAL_NUMBER:12,LITERAL_STRING:13,LITERAL_COLOR:14,LITERAL_VECTOR:15,LITERAL_REGEX:16,LITERAL_UNDEFINED:17,BUILTIN_VARIABLE:18};Object.freeze(y0e);var Mt=y0e;function am(e,t){this._expression=e,e=Uqe(e,t),e=Vqe(zqe(e)),eA.addBinaryOp("=~",0),eA.addBinaryOp("!~",0);let n;try{n=eA(e)}catch(i){throw new oe(i)}this._runtimeAst=Ki(this,n)}Object.defineProperties(am.prototype,{expression:{get:function(){return this._expression}}});var Un={arrayIndex:0,arrayArray:[[]],cartesian2Index:0,cartesian3Index:0,cartesian4Index:0,cartesian2Array:[new U],cartesian3Array:[new h],cartesian4Array:[new se],reset:function(){this.arrayIndex=0,this.cartesian2Index=0,this.cartesian3Index=0,this.cartesian4Index=0},getArray:function(){this.arrayIndex>=this.arrayArray.length&&this.arrayArray.push([]);let e=this.arrayArray[this.arrayIndex++];return e.length=0,e},getCartesian2:function(){return this.cartesian2Index>=this.cartesian2Array.length&&this.cartesian2Array.push(new U),this.cartesian2Array[this.cartesian2Index++]},getCartesian3:function(){return this.cartesian3Index>=this.cartesian3Array.length&&this.cartesian3Array.push(new h),this.cartesian3Array[this.cartesian3Index++]},getCartesian4:function(){return this.cartesian4Index>=this.cartesian4Array.length&&this.cartesian4Array.push(new se),this.cartesian4Array[this.cartesian4Index++]}};am.prototype.evaluate=function(e,t){Un.reset();let n=this._runtimeAst.evaluate(e);return t instanceof z&&n instanceof se?z.fromCartesian4(n,t):n instanceof U||n instanceof h||n instanceof se?n.clone(t):n};am.prototype.evaluateColor=function(e,t){Un.reset();let n=this._runtimeAst.evaluate(e);return z.fromCartesian4(n,t)};am.prototype.getShaderFunction=function(e,t,n,i){let r=this.getShaderExpression(t,n);return r=`${i} ${e} +`,{uniformMap:{billboard_texture:function(){return e.textureAtlas.texture}}});return i.pass=Ie.OVERLAY,i}var rWe=[];Fd.prototype.update=function(e){if(NK(this),!this.show)return;let t=e.context;if(!t.instancedArrays||!(kt.maximumVertexTextureImageUnits>0))throw new pe("Beginning in CesiumJS 1.140, billboards and labels require device support for WebGL 2, or WebGL 1 with ANGLE_instanced_arrays and MAX_VERTEX_TEXTURE_IMAGE_UNITS > 0. For more information or to share feedback, see: https://github.com/CesiumGS/cesium/issues/13053");let n=this._billboards,i=n.length,r=!0;for(let I=0;I<i;++I){let R=n[I];l(R.loadError)&&(console.error(`Error loading image for billboard: ${R.loadError}`),R.image=void 0),R.textureDirty&&this._updateBillboard(R,Mx),R.show&&(r=r&&R.ready)}let o=this._textureAtlas;if(e.afterRender.push(()=>{if(!this.isDestroyed())return o.update(e.context)}),!l(o.texture))return;tWe(this,e),n=this._billboards,i=n.length;let s=this._billboardsToUpdate,a=this._billboardsToUpdateIndex,c=this._propertiesChanged,u=o.guid,f=this._createVertexArray||this._textureAtlasGUID!==u;this._textureAtlasGUID=u;let d,p=e.passes,g=p.pick;if(f||!g&&this.computeNewBuffersUsage()){this._createVertexArray=!1;for(let I=0;I<MK;++I)c[I]=0;if(this._vaf=this._vaf&&this._vaf.destroy(),i>0){this._vaf=X7e(t,i,this._buffersUsage,this._batchTable,this._sdf),d=this._vaf.writers;for(let I=0;I<i;++I){let R=this._billboards[I];R._dirty=!1,R.textureDirty=!1,eWe(this,e,d,R)}this._vaf.commit(Qpe(t))}this._billboardsToUpdateIndex=0}else if(a>0){let I=rWe;I.length=0,(c[pN]||c[H7e]||c[j7e])&&I.push(f0e),(c[Mx]||c[e0e]||c[z7e]||c[V7e]||c[U7e])&&(I.push(h0e),I.push(OK)),(c[Mx]||c[G7e]||c[r0e])&&(I.push(m0e),I.push(RK)),(c[Mx]||c[n0e])&&I.push(RK),(c[Mx]||c[t0e])&&I.push(OK),c[i0e]&&I.push(p0e),c[o0e]&&I.push(g0e),(c[s0e]||c[W7e]||c[Mx]||c[pN])&&I.push(_0e),(c[Mx]||c[pN])&&I.push(y0e),c[a0e]&&I.push(A0e),c[c0e]&&I.push(b0e);let R=I.length;if(d=this._vaf.writers,a/i>.1){for(let O=0;O<a;++O){let L=s[O];L._dirty=!1,L.textureDirty=!1;for(let _=0;_<R;++_)I[_](this,e,d,L)}this._vaf.commit(Qpe(t))}else{for(let O=0;O<a;++O){let L=s[O];L._dirty=!1,L.textureDirty=!1;for(let _=0;_<R;++_)I[_](this,e,d,L);this._vaf.subCommit(L._index,1)}this._vaf.endSubCommits()}this._billboardsToUpdateIndex=0}if(a>i*1.5&&(s.length=i),!l(this._vaf)||!l(this._vaf.va))return;this._boundingVolumeDirty&&(this._boundingVolumeDirty=!1,ue.transform(this._baseVolume,this.modelMatrix,this._baseVolumeWC));let m,y=N.IDENTITY;e.mode===re.SCENE3D?(y=this.modelMatrix,m=ue.clone(this._baseVolumeWC,this._boundingVolume)):m=ue.clone(this._baseVolume2D,this._boundingVolume),nWe(this,e,m);let A=this._blendOption!==this.blendOption;if(this._blendOption=this.blendOption,A){this._blendOption===Li.OPAQUE||this._blendOption===Li.OPAQUE_AND_TRANSLUCENT?this._rsOpaque=Ge.fromCache({depthTest:{enabled:!0,func:te.LESS},depthMask:!0}):this._rsOpaque=void 0;let I=this._blendOption===Li.TRANSLUCENT;this._blendOption===Li.TRANSLUCENT||this._blendOption===Li.OPAQUE_AND_TRANSLUCENT?this._rsTranslucent=Ge.fromCache({depthTest:{enabled:!0,func:I?te.LEQUAL:te.LESS},depthMask:I,blending:tn.ALPHA_BLEND}):this._rsTranslucent=void 0}this._shaderDisableDepthDistance=this._shaderDisableDepthDistance||e.minimumDisableDepthTestDistance!==0;let b,x,T,E,v;if(A||this._shaderRotation!==this._compiledShaderRotation||this._shaderAlignedAxis!==this._compiledShaderAlignedAxis||this._shaderScaleByDistance!==this._compiledShaderScaleByDistance||this._shaderTranslucencyByDistance!==this._compiledShaderTranslucencyByDistance||this._shaderPixelOffsetScaleByDistance!==this._compiledShaderPixelOffsetScaleByDistance||this._shaderDistanceDisplayCondition!==this._compiledShaderDistanceDisplayCondition||this._shaderDisableDepthDistance!==this._compiledShaderDisableDepthDistance||this._shaderClampToGround!==this._compiledShaderClampToGround||this._sdf!==this._compiledSDF){b=kO,x=BO,v=["INSTANCED"],l(this._batchTable)&&(v.push("VECTOR_TILE"),b=this._batchTable.getVertexShaderCallback(!1,"a_batchId",void 0)(b),x=this._batchTable.getFragmentShaderCallback(!1,void 0)(x)),T=new Ye({defines:v,sources:[b]}),this._shaderRotation&&T.defines.push("ROTATION"),this._shaderAlignedAxis&&T.defines.push("ALIGNED_AXIS"),this._shaderScaleByDistance&&T.defines.push("EYE_DISTANCE_SCALING"),this._shaderTranslucencyByDistance&&T.defines.push("EYE_DISTANCE_TRANSLUCENCY"),this._shaderPixelOffsetScaleByDistance&&T.defines.push("EYE_DISTANCE_PIXEL_OFFSET"),this._shaderDistanceDisplayCondition&&T.defines.push("DISTANCE_DISPLAY_CONDITION"),this._shaderDisableDepthDistance&&T.defines.push("DISABLE_DEPTH_DISTANCE"),this._shaderClampToGround&&T.defines.push("VS_THREE_POINT_DEPTH_CHECK");let I=1-Ba.CUTOFF;this._sdf&&T.defines.push("SDF");let R=l(this._batchTable)?"VECTOR_TILE":"";this._blendOption===Li.OPAQUE_AND_TRANSLUCENT&&(E=new Ye({defines:["OPAQUE",R],sources:[x]}),this._shaderClampToGround&&E.defines.push("VS_THREE_POINT_DEPTH_CHECK"),this._sdf&&(E.defines.push("SDF"),E.defines.push(`SDF_EDGE ${I}`)),this._sp=Qt.replaceCache({context:t,shaderProgram:this._sp,vertexShaderSource:T,fragmentShaderSource:E,attributeLocations:Vr}),E=new Ye({defines:["TRANSLUCENT",R],sources:[x]}),this._shaderClampToGround&&E.defines.push("VS_THREE_POINT_DEPTH_CHECK"),this._sdf&&(E.defines.push("SDF"),E.defines.push(`SDF_EDGE ${I}`)),this._spTranslucent=Qt.replaceCache({context:t,shaderProgram:this._spTranslucent,vertexShaderSource:T,fragmentShaderSource:E,attributeLocations:Vr})),this._blendOption===Li.OPAQUE&&(E=new Ye({defines:[R],sources:[x]}),this._shaderClampToGround&&E.defines.push("VS_THREE_POINT_DEPTH_CHECK"),this._sdf&&(E.defines.push("SDF"),E.defines.push(`SDF_EDGE ${I}`)),this._sp=Qt.replaceCache({context:t,shaderProgram:this._sp,vertexShaderSource:T,fragmentShaderSource:E,attributeLocations:Vr})),this._blendOption===Li.TRANSLUCENT&&(E=new Ye({defines:[R],sources:[x]}),this._shaderClampToGround&&E.defines.push("VS_THREE_POINT_DEPTH_CHECK"),this._sdf&&(E.defines.push("SDF"),E.defines.push(`SDF_EDGE ${I}`)),this._spTranslucent=Qt.replaceCache({context:t,shaderProgram:this._spTranslucent,vertexShaderSource:T,fragmentShaderSource:E,attributeLocations:Vr})),this._compiledShaderRotation=this._shaderRotation,this._compiledShaderAlignedAxis=this._shaderAlignedAxis,this._compiledShaderScaleByDistance=this._shaderScaleByDistance,this._compiledShaderTranslucencyByDistance=this._shaderTranslucencyByDistance,this._compiledShaderPixelOffsetScaleByDistance=this._shaderPixelOffsetScaleByDistance,this._compiledShaderDistanceDisplayCondition=this._shaderDistanceDisplayCondition,this._compiledShaderDisableDepthDistance=this._shaderDisableDepthDistance,this._compiledShaderClampToGround=this._shaderClampToGround,this._compiledSDF=this._sdf}let S=e.commandList;if(p.render||p.pick){let I=this._colorCommands,R=this._blendOption===Li.OPAQUE,O=this._blendOption===Li.OPAQUE_AND_TRANSLUCENT,L=this._vaf.va,_=L.length,C=this._uniforms,w;l(this._batchTable)?(C=this._batchTable.getUniformMapCallback()(C),w=this._batchTable.getPickId()):w="v_pickColor",I.length=_;let P=O?_*2:_;for(let M=0;M<P;++M){let F=I[M];l(F)||(F=I[M]=new at);let V=R||O&&M%2===0;F.pass=V||!O?Ie.OPAQUE:Ie.TRANSLUCENT,F.owner=this;let B=O?Math.floor(M/2):M;F.boundingVolume=m,F.modelMatrix=y,F.count=L[B].indicesCount,F.shaderProgram=V?this._sp:this._spTranslucent,F.uniformMap=C,F.vertexArray=L[B].va,F.renderState=V?this._rsOpaque:this._rsTranslucent,F.debugShowBoundingVolume=this.debugShowBoundingVolume,F.pickId=w,F.count=6,F.instanceCount=i,S.push(F)}this.debugShowTextureAtlas&&(l(this.debugCommand)||(this.debugCommand=iWe(this,e.context)),S.push(this.debugCommand))}this._allBillboardsReady=r};Fd.prototype.isDestroyed=function(){return!1};Fd.prototype.destroy=function(){return l(this._removeCallbackFunc)&&(this._removeCallbackFunc(),this._removeCallbackFunc=void 0),this._textureAtlas=this._destroyTextureAtlas&&this._textureAtlas&&this._textureAtlas.destroy(),this._sp=this._sp&&this._sp.destroy(),this._spTranslucent=this._spTranslucent&&this._spTranslucent.destroy(),this._vaf=this._vaf&&this._vaf.destroy(),l0e(this._billboards),le(this)};var Df=Fd;var x0e={FILL:0,OUTLINE:1,FILL_AND_OUTLINE:2};Object.freeze(x0e);var _o=x0e;var T0e={},E0e=0,oWe=256,sWe=new z(.165,.165,.165,.8),aWe=new U(7,5),na=Object.freeze({LTR:0,RTL:1,WEAK:2,BRACKETS:3});function Lx(e){!e._rebindAllGlyphs&&!e._repositionAllGlyphs&&e._labelCollection._labelsToUpdate.push(e),e._rebindAllGlyphs=!0}function gN(e){!e._rebindAllGlyphs&&!e._repositionAllGlyphs&&e._labelCollection._labelsToUpdate.push(e),e._repositionAllGlyphs=!0}function _N(e,t){return document.defaultView.getComputedStyle(e,null).getPropertyValue(t)}function v0e(e){let t=T0e[e._font];if(!l(t)){let n=document.createElement("div");n.style.position="absolute",n.style.opacity=0,n.style.font=e._font,document.body.appendChild(n);let i=parseFloat(_N(n,"line-height"));isNaN(i)&&(i=void 0),t={family:_N(n,"font-family"),size:_N(n,"font-size").replace("px",""),style:_N(n,"font-style"),weight:_N(n,"font-weight"),lineHeight:i},document.body.removeChild(n),E0e<oWe&&(T0e[e._font]=t,E0e++)}e._fontFamily=t.family,e._fontSize=t.size,e._fontStyle=t.style,e._fontWeight=t.weight,e._lineHeight=t.lineHeight}function em(e,t){e=e??H.EMPTY_OBJECT;let n=e.translucencyByDistance,i=e.pixelOffsetScaleByDistance,r=e.scaleByDistance,o=e.distanceDisplayCondition;l(n)&&(n=qt.clone(n)),l(i)&&(i=qt.clone(i)),l(r)&&(r=qt.clone(r)),l(o)&&(o=Ht.clone(o)),this._renderedText=void 0,this._text=void 0,this._show=e.show??!0,this._font=e.font??"30px sans-serif",this._fillColor=z.clone(e.fillColor??z.WHITE),this._outlineColor=z.clone(e.outlineColor??z.BLACK),this._outlineWidth=e.outlineWidth??1,this._showBackground=e.showBackground??!1,this._backgroundColor=z.clone(e.backgroundColor??sWe),this._backgroundPadding=U.clone(e.backgroundPadding??aWe),this._style=e.style??_o.FILL,this._verticalOrigin=e.verticalOrigin??Gn.BASELINE,this._horizontalOrigin=e.horizontalOrigin??Vi.LEFT,this._pixelOffset=U.clone(e.pixelOffset??U.ZERO),this._eyeOffset=h.clone(e.eyeOffset??h.ZERO),this._position=h.clone(e.position??h.ZERO),this._scale=e.scale??1,this._id=e.id,this._translucencyByDistance=n,this._pixelOffsetScaleByDistance=i,this._scaleByDistance=r,this._heightReference=e.heightReference??We.NONE,this._distanceDisplayCondition=o,this._disableDepthTestDistance=e.disableDepthTestDistance,this._labelCollection=t,this._glyphs=[],this._backgroundBillboard=void 0,this._batchIndex=void 0,this._rebindAllGlyphs=!0,this._repositionAllGlyphs=!0,this._actualClampedPosition=void 0,this._removeCallbackFunc=void 0,this._lastSurfaceHeight=void 0,this._lastSurfaceQueryFrame=-1,this._lastSurfaceQueryMissed=!1,this._clampedToSurface=!1,this._clampingCartesian=void 0,this._clampingHeight=0,this._clampingHeightValid=!1,this._mode=void 0,this._clusterShow=!0,this.text=e.text??"",this._relativeSize=1,v0e(this),this._updateClamping()}Object.defineProperties(em.prototype,{show:{get:function(){return this._show},set:function(e){if(this._show!==e){this._show=e;let t=this._glyphs;for(let i=0,r=t.length;i<r;i++){let o=t[i].billboard;l(o)&&(o.show=e)}let n=this._backgroundBillboard;l(n)&&(n.show=e)}}},position:{get:function(){return this._position},set:function(e){let t=this._position;if(!wK(t,e)){Ox(e,t);let n=this._glyphs;for(let r=0,o=n.length;r<o;r++){let s=n[r].billboard;l(s)&&(s.position=e)}let i=this._backgroundBillboard;l(i)&&(i.position=e),this._updateClamping()}}},heightReference:{get:function(){return this._heightReference},set:function(e){if(e!==this._heightReference){this._heightReference=e;let t=this._glyphs;for(let i=0,r=t.length;i<r;i++){let o=t[i].billboard;l(o)&&(o.heightReference=e)}let n=this._backgroundBillboard;l(n)&&(n.heightReference=e),gN(this),this._updateClamping()}}},text:{get:function(){return this._text},set:function(e){if(this._text!==e){this._text=e;let t=em.filterUnsupportedCharacters(e);this._renderedText=em.enableRightToLeftDetection?hWe(t):t,Lx(this)}}},font:{get:function(){return this._font},set:function(e){this._font!==e&&(this._font=e,Lx(this),v0e(this))}},fillColor:{get:function(){return this._fillColor},set:function(e){let t=this._fillColor;z.equals(t,e)||(z.clone(e,t),Lx(this))}},outlineColor:{get:function(){return this._outlineColor},set:function(e){let t=this._outlineColor;z.equals(t,e)||(z.clone(e,t),Lx(this))}},outlineWidth:{get:function(){return this._outlineWidth},set:function(e){this._outlineWidth!==e&&(this._outlineWidth=e,Lx(this))}},showBackground:{get:function(){return this._showBackground},set:function(e){this._showBackground!==e&&(this._showBackground=e,Lx(this))}},backgroundColor:{get:function(){return this._backgroundColor},set:function(e){let t=this._backgroundColor;if(!z.equals(t,e)){z.clone(e,t);let n=this._backgroundBillboard;l(n)&&(n.color=t)}}},backgroundPadding:{get:function(){return this._backgroundPadding},set:function(e){let t=this._backgroundPadding;U.equals(t,e)||(U.clone(e,t),gN(this))}},style:{get:function(){return this._style},set:function(e){this._style!==e&&(this._style=e,Lx(this))}},pixelOffset:{get:function(){return this._pixelOffset},set:function(e){let t=this._pixelOffset;if(!U.equals(t,e)){U.clone(e,t);let n=this._glyphs;for(let r=0,o=n.length;r<o;r++){let s=n[r];l(s.billboard)&&(s.billboard.pixelOffset=e)}let i=this._backgroundBillboard;l(i)&&(i.pixelOffset=e)}}},translucencyByDistance:{get:function(){return this._translucencyByDistance},set:function(e){let t=this._translucencyByDistance;if(!qt.equals(t,e)){this._translucencyByDistance=qt.clone(e,t);let n=this._glyphs;for(let r=0,o=n.length;r<o;r++){let s=n[r];l(s.billboard)&&(s.billboard.translucencyByDistance=e)}let i=this._backgroundBillboard;l(i)&&(i.translucencyByDistance=e)}}},pixelOffsetScaleByDistance:{get:function(){return this._pixelOffsetScaleByDistance},set:function(e){let t=this._pixelOffsetScaleByDistance;if(!qt.equals(t,e)){this._pixelOffsetScaleByDistance=qt.clone(e,t);let n=this._glyphs;for(let r=0,o=n.length;r<o;r++){let s=n[r];l(s.billboard)&&(s.billboard.pixelOffsetScaleByDistance=e)}let i=this._backgroundBillboard;l(i)&&(i.pixelOffsetScaleByDistance=e)}}},scaleByDistance:{get:function(){return this._scaleByDistance},set:function(e){let t=this._scaleByDistance;if(!qt.equals(t,e)){this._scaleByDistance=qt.clone(e,t);let n=this._glyphs;for(let r=0,o=n.length;r<o;r++){let s=n[r];l(s.billboard)&&(s.billboard.scaleByDistance=e)}let i=this._backgroundBillboard;l(i)&&(i.scaleByDistance=e)}}},eyeOffset:{get:function(){return this._eyeOffset},set:function(e){let t=this._eyeOffset;if(!h.equals(t,e)){h.clone(e,t);let n=this._glyphs;for(let r=0,o=n.length;r<o;r++){let s=n[r];l(s.billboard)&&(s.billboard.eyeOffset=e)}let i=this._backgroundBillboard;l(i)&&(i.eyeOffset=e)}}},horizontalOrigin:{get:function(){return this._horizontalOrigin},set:function(e){this._horizontalOrigin!==e&&(this._horizontalOrigin=e,gN(this))}},verticalOrigin:{get:function(){return this._verticalOrigin},set:function(e){if(this._verticalOrigin!==e){this._verticalOrigin=e;let t=this._glyphs;for(let i=0,r=t.length;i<r;i++){let o=t[i];l(o.billboard)&&(o.billboard.verticalOrigin=e)}let n=this._backgroundBillboard;l(n)&&(n.verticalOrigin=e),gN(this)}}},scale:{get:function(){return this._scale},set:function(e){if(this._scale!==e){this._scale=e;let t=this._glyphs;for(let i=0,r=t.length;i<r;i++){let o=t[i];l(o.billboard)&&(o.billboard.scale=e*this._relativeSize)}let n=this._backgroundBillboard;l(n)&&(n.scale=e*this._relativeSize),gN(this)}}},totalScale:{get:function(){return this._scale*this._relativeSize}},distanceDisplayCondition:{get:function(){return this._distanceDisplayCondition},set:function(e){if(!Ht.equals(e,this._distanceDisplayCondition)){this._distanceDisplayCondition=Ht.clone(e,this._distanceDisplayCondition);let t=this._glyphs;for(let i=0,r=t.length;i<r;i++){let o=t[i];l(o.billboard)&&(o.billboard.distanceDisplayCondition=e)}let n=this._backgroundBillboard;l(n)&&(n.distanceDisplayCondition=e)}}},disableDepthTestDistance:{get:function(){return this._disableDepthTestDistance},set:function(e){if(this._disableDepthTestDistance!==e){this._disableDepthTestDistance=e;let t=this._glyphs;for(let i=0,r=t.length;i<r;i++){let o=t[i];l(o.billboard)&&(o.billboard.disableDepthTestDistance=e)}let n=this._backgroundBillboard;l(n)&&(n.disableDepthTestDistance=e)}}},id:{get:function(){return this._id},set:function(e){if(this._id!==e){this._id=e;let t=this._glyphs;for(let i=0,r=t.length;i<r;i++){let o=t[i];l(o.billboard)&&(o.billboard.id=e)}let n=this._backgroundBillboard;l(n)&&(n.id=e)}}},pickId:{get:function(){if(!(this._glyphs.length===0||!l(this._glyphs[0].billboard)))return this._glyphs[0].billboard.pickId}},_clampedPosition:{get:function(){return this._actualClampedPosition},set:function(e){this._actualClampedPosition=Ox(e,this._actualClampedPosition);let t=this._glyphs;for(let i=0,r=t.length;i<r;i++){let o=t[i];l(o.billboard)&&(o.billboard._clampedPosition=e)}let n=this._backgroundBillboard;l(n)&&(n._clampedPosition=e)}},clusterShow:{get:function(){return this._clusterShow},set:function(e){if(this._clusterShow!==e){this._clusterShow=e;let t=this._glyphs;for(let i=0,r=t.length;i<r;i++){let o=t[i];l(o.billboard)&&(o.billboard.clusterShow=e)}let n=this._backgroundBillboard;l(n)&&(n.clusterShow=e)}}},ready:{get:function(){if(this._rebindAllGlyphs||this._repositionAllGlyphs||l(this._backgroundBillboard)&&!this._backgroundBillboard.ready)return!1;let e=this._glyphs;for(let t=0,n=e.length;t<n;t++){let i=e[t];if(l(i.billboard)&&!i.billboard.ready)return!1}return!0}}});em.prototype._updateClamping=function(){Br._updateClamping(this._labelCollection,this)};em.prototype.computeScreenSpacePosition=function(e,t){l(t)||(t=new U);let i=this._labelCollection.modelMatrix,r=l(this._actualClampedPosition)?this._actualClampedPosition:this._position;return Br._computeScreenSpacePosition(i,r,this._eyeOffset,this._pixelOffset,e,t)};em.getScreenSpaceBoundingBox=function(e,t,n){let i,r,o,s,a=e.totalScale,c=e._backgroundBillboard;if(l(c))i=t.x+c._translate.x,r=t.y-c._translate.y,o=c.width*a,s=c.height*a,e.verticalOrigin===Gn.BOTTOM||e.verticalOrigin===Gn.BASELINE?r-=s:e.verticalOrigin===Gn.CENTER&&(r-=s*.5);else{i=Number.POSITIVE_INFINITY,r=Number.POSITIVE_INFINITY;let u=0,f=0,d=e._glyphs,p=d.length;for(let g=0;g<p;++g){let m=d[g],y=m.billboard;if(!l(y))continue;let A=t.x+y._translate.x,b=t.y-y._translate.y,x=m.dimensions.width*a,T=m.dimensions.height*a;e.verticalOrigin===Gn.BOTTOM||e.verticalOrigin===Gn.BASELINE?b-=T:e.verticalOrigin===Gn.CENTER&&(b-=T*.5),e._verticalOrigin===Gn.TOP?b+=Ba.PADDING*a:(e._verticalOrigin===Gn.BOTTOM||e._verticalOrigin===Gn.BASELINE)&&(b-=Ba.PADDING*a),i=Math.min(i,A),r=Math.min(r,b),u=Math.max(u,A+x),f=Math.max(f,b+T)}o=u-i,s=f-r}return l(n)||(n=new et),n.x=i,n.y=r,n.width=o,n.height=s,n};em.filterUnsupportedCharacters=function(e){let t=new RegExp(/[\u0000-\u0008\u000E-\u001F\u00ad\u202a-\u206f\u200b-\u200f]/,"g");return e.replace(t,"")};em.prototype.equals=function(e){return this===e||l(e)&&this._show===e._show&&this._scale===e._scale&&this._outlineWidth===e._outlineWidth&&this._showBackground===e._showBackground&&this._style===e._style&&this._verticalOrigin===e._verticalOrigin&&this._horizontalOrigin===e._horizontalOrigin&&this._heightReference===e._heightReference&&this._renderedText===e._renderedText&&this._font===e._font&&h.equals(this._position,e._position)&&z.equals(this._fillColor,e._fillColor)&&z.equals(this._outlineColor,e._outlineColor)&&z.equals(this._backgroundColor,e._backgroundColor)&&U.equals(this._backgroundPadding,e._backgroundPadding)&&U.equals(this._pixelOffset,e._pixelOffset)&&h.equals(this._eyeOffset,e._eyeOffset)&&qt.equals(this._translucencyByDistance,e._translucencyByDistance)&&qt.equals(this._pixelOffsetScaleByDistance,e._pixelOffsetScaleByDistance)&&qt.equals(this._scaleByDistance,e._scaleByDistance)&&Ht.equals(this._distanceDisplayCondition,e._distanceDisplayCondition)&&this._disableDepthTestDistance===e._disableDepthTestDistance&&this._id===e._id};em.prototype.isDestroyed=function(){return!1};em.enableRightToLeftDetection=!1;function cWe(e,t){let n=/[a-zA-Z0-9]/,i=/[()[\]{}<>]/,r=[],o="",s=na.LTR,a="",c=e.length;for(let u=0;u<c;++u){let f=e.charAt(u);t.test(f)?a=na.RTL:n.test(f)?a=na.LTR:i.test(f)?a=na.BRACKETS:a=na.WEAK,u===0&&(s=a),s===a&&a!==na.BRACKETS?o+=f:(o!==""&&r.push({Type:s,Word:o}),s=a,o=f)}return r.push({Type:a,Word:o}),r}function lWe(e){return e.split("").reverse().join("")}function yN(e,t,n){return e.slice(0,t)+n+e.slice(t)}function uWe(e){switch(e){case"(":return")";case")":return"(";case"[":return"]";case"]":return"[";case"{":return"}";case"}":return"{";case"<":return">";case">":return"<"}}var fWe="\u05D0-\u05EA",dWe="\u0600-\u06FF\u0750-\u077F\u08A0-\u08FF",C0e=new RegExp(`[${fWe}${dWe}]`);function hWe(e){let t=e.split(` +`),n="";for(let i=0;i<t.length;i++){let r=t[i],o=C0e.test(r.charAt(0)),s=cWe(r,C0e),a=0,c="";for(let u=0;u<s.length;++u){let f=s[u],d=f.Type===na.BRACKETS?uWe(f.Word):lWe(f.Word);o?f.Type===na.RTL?(c=d+c,a=0):f.Type===na.LTR?(c=yN(c,a,f.Word),a+=f.Word.length):(f.Type===na.WEAK||f.Type===na.BRACKETS)&&(f.Type===na.WEAK&&s[u-1].Type===na.BRACKETS?c=d+c:s[u-1].Type===na.RTL?(c=d+c,a=0):s.length>u+1?s[u+1].Type===na.RTL?(c=d+c,a=0):(c=yN(c,a,f.Word),a+=f.Word.length):c=yN(c,0,d)):f.Type===na.RTL?c=yN(c,a,d):f.Type===na.LTR?(c+=f.Word,a=c.length):(f.Type===na.WEAK||f.Type===na.BRACKETS)&&(u>0&&s[u-1].Type===na.RTL?s.length>u+1?s[u+1].Type===na.RTL?c=yN(c,a,d):(c+=f.Word,a=c.length):c+=f.Word:(c+=f.Word,a=c.length))}n+=c,i<t.length-1&&(n+=` +`)}return n}var Ky=em;function mWe(e,t){let n=e.measureText(t);if(!/\S/.test(t))return{width:n.width,height:0,ascent:0,descent:0,minx:0};let r=Math.round(n.actualBoundingBoxAscent),o=Math.round(n.actualBoundingBoxDescent),s=Math.max(r+o,1);return{width:n.width,height:s,ascent:r,descent:o,minx:-Math.round(n.actualBoundingBoxLeft)}}var Fx;function pWe(e,t){if(e==="")return;t=t??H.EMPTY_OBJECT;let n=t.font??"10px sans-serif",i=t.stroke??!1,r=t.fill??!0,o=t.strokeWidth??1,s=t.backgroundColor??z.TRANSPARENT,a=t.padding??0,c=a*2,u=document.createElement("canvas");u.width=1,u.height=1,u.style.font=n;let f=u.getContext("2d",{willReadFrequently:!0});l(Fx)||(l(f.imageSmoothingEnabled)?Fx="imageSmoothingEnabled":l(f.mozImageSmoothingEnabled)?Fx="mozImageSmoothingEnabled":l(f.webkitImageSmoothingEnabled)?Fx="webkitImageSmoothingEnabled":l(f.msImageSmoothingEnabled)&&(Fx="msImageSmoothingEnabled")),f.font=n,f.lineJoin="round",f.lineWidth=o,f[Fx]=!1,u.style.visibility="hidden",document.body.appendChild(u);let d=mWe(f,e);u.dimensions=d,document.body.removeChild(u),u.style.visibility="";let p=!/\S/.test(e),g=i&&!p?Math.ceil(o/2):0,m=g*2,y=-d.minx+g,A=Math.ceil(d.width)+y+c+g,b=d.height+c+m,x=d.ascent+a+g;if(u.width=A,u.height=b,f.font=n,f.lineJoin="round",f.lineWidth=o,f[Fx]=!1,s!==z.TRANSPARENT&&(f.fillStyle=s.toCssColorString(),f.fillRect(0,0,u.width,u.height)),i){let T=t.strokeColor??z.BLACK;f.strokeStyle=T.toCssColorString(),f.strokeText(e,y+a,x)}if(r){let T=t.fillColor??z.WHITE;f.fillStyle=T.toCssColorString(),f.fillText(e,y+a,x)}return u}var Bx=pWe;var M0e=Qo(P0e(),1);var N0e=Qo(D0e(),1);function yWe(){this.dimensions=void 0,this.billboardTexture=void 0,this.billboard=void 0}var AWe=1.2,R0e="ID_WHITE_PIXEL",FK=new U(4,4),bWe=new et(1,1,1,1);function xWe(e,t){let n=t._backgroundBillboardTexture;if(!n.hasImage){let r=document.createElement("canvas");r.width=FK.x,r.height=FK.y;let o=r.getContext("2d");o.fillStyle="#fff",o.fillRect(0,0,r.width,r.height),n.loadImage(R0e,r),n.addImageSubRegion(R0e,bWe)}let i=e.add({collection:t});return i.setImageTexture(n),i._positionFromParent=!0,i._labelTranslate=new U,i}var Sg={};function TWe(e,t,n,i,r,o){return Sg.font=t,Sg.fillColor=n,Sg.strokeColor=i,Sg.strokeWidth=r,Sg.padding=Ba.PADDING,Sg.fill=o===_o.FILL||o===_o.FILL_AND_OUTLINE,Sg.stroke=o===_o.OUTLINE||o===_o.FILL_AND_OUTLINE,Sg.backgroundColor=z.BLACK,Bx(e,Sg)}function BK(e,t){let n=t.billboard;l(n)&&(n.show=!1,n._clampedPosition=void 0,l(n._removeCallbackFunc)&&(n._removeCallbackFunc(),n._removeCallbackFunc=void 0),e._spareBillboards.push(n),t.billboard=void 0)}var EWe=new N0e.default,CWe=/\s/;function vWe(e,t){let n=t._renderedText,i=EWe.splitGraphemes(n),r=i.length,o=t._glyphs,s=o.length;if(t._relativeSize=t._fontSize/Ba.FONT_SIZE,r<s)for(let p=r;p<s;++p)BK(e,o[p]);o.length=r;let a=t._backgroundBillboard,c=e._backgroundBillboardCollection;t._showBackground&&!l(a)&&(a=xWe(c,e),t._backgroundBillboard=a),SWe(c,t,a);let u=e._glyphBillboardCollection,f=u.billboardTextureCache,d=e._textDimensionsCache;for(let p=0;p<r;++p){let g=i[p],m=t._verticalOrigin,y=JSON.stringify([g,t._fontFamily,t._fontStyle,t._fontWeight,+m]),A=d[y],b=f.get(y);if(!l(b)||!l(A)){b=new Cg(u),f.set(y,b);let v=`${t._fontStyle} ${t._fontWeight} ${Ba.FONT_SIZE}px ${t._fontFamily}`,S=TWe(g,v,z.WHITE,z.WHITE,0,_o.FILL);if(A=S.dimensions,d[y]=A,S.width>0&&S.height>0&&!CWe.test(g)){let I=(0,M0e.default)(S,{cutoff:Ba.CUTOFF,radius:Ba.RADIUS}),R=S.getContext("2d"),O=S.width,L=S.height,_=R.getImageData(0,0,O,L);for(let C=0;C<O;C++)for(let w=0;w<L;w++){let P=w*O+C,M=I[P]*255,F=P*4;_.data[F+0]=M,_.data[F+1]=M,_.data[F+2]=M,_.data[F+3]=M}R.putImageData(_,0,0),b.loadImage(y,S)}}let x=o[p];if(l(x)||(x=new yWe,x.dimensions=A,x.billboardTexture=b,o[p]=x),x.billboardTexture.id!==y&&(x.billboardTexture=b,x.dimensions=A),!b.hasImage){BK(e,x);continue}let T=x.billboard,E=e._spareBillboards;l(T)||(E.length>0?T=E.pop():(T=u.add({collection:e}),T._labelDimensions=new U,T._labelTranslate=new U,T._positionFromParent=!0),x.billboard=T),T.setImageTexture(b),T.show=t._show,T.position=t._position,T.eyeOffset=t._eyeOffset,T.pixelOffset=t._pixelOffset,T.horizontalOrigin=Vi.LEFT,T.verticalOrigin=t._verticalOrigin,T.heightReference=t._heightReference,l(t._clampedPosition)&&(T._clampedPosition=t._clampedPosition),T.scale=t.totalScale,T.pickPrimitive=t,T.id=t._id,T.translucencyByDistance=t._translucencyByDistance,T.pixelOffsetScaleByDistance=t._pixelOffsetScaleByDistance,T.scaleByDistance=t._scaleByDistance,T.distanceDisplayCondition=t._distanceDisplayCondition,T.disableDepthTestDistance=t._disableDepthTestDistance,T._batchIndex=t._batchIndex,T.outlineColor=t.outlineColor,t.style===_o.FILL_AND_OUTLINE?(T.color=t._fillColor,T.outlineWidth=t.outlineWidth):t.style===_o.FILL?(T.color=t._fillColor,T.outlineWidth=0):t.style===_o.OUTLINE&&(T.color=z.TRANSPARENT,T.outlineWidth=t.outlineWidth)}t._repositionAllGlyphs=!0}function SWe(e,t,n){if(!l(n))return;let i=t.show&&t._showBackground&&t._renderedText.split(` +`).join("").length>0;if(t.show&&!i){e.remove(n),t._backgroundBillboard=void 0;return}n.color=t._backgroundColor,n.show=t._show,n.position=t._position,n.eyeOffset=t._eyeOffset,n.pixelOffset=t._pixelOffset,n.horizontalOrigin=Vi.LEFT,n.verticalOrigin=t._verticalOrigin,n.heightReference=t._heightReference,l(t._clampedPosition)&&(n._clampedPosition=t._clampedPosition),n.scale=t.totalScale,n.pickPrimitive=t,n.id=t._id,n.translucencyByDistance=t._translucencyByDistance,n.pixelOffsetScaleByDistance=t._pixelOffsetScaleByDistance,n.scaleByDistance=t._scaleByDistance,n.distanceDisplayCondition=t._distanceDisplayCondition,n.disableDepthTestDistance=t._disableDepthTestDistance,n.clusterShow=t.clusterShow}function O0e(e,t,n){return t===Vi.CENTER?-e/2:t===Vi.RIGHT?-(e+n.x):n.x}var Go=new U,wWe=new U;function IWe(e){let t=e._glyphs,n=e._renderedText,i=0,r=0,o=[],s=Number.NEGATIVE_INFINITY,a=0,c=1,u=t.length,f=e._backgroundBillboard,d=U.clone(l(f)?e._backgroundPadding:U.ZERO,wWe);d.x/=e._relativeSize,d.y/=e._relativeSize;for(let O=0;O<u;++O){if(n.charAt(O)===` +`){o.push(i),++c,i=0;continue}let _=t[O].dimensions;l(_)&&(a=Math.max(a,_.height-_.descent),s=Math.max(s,_.descent),i+=_.width-_.minx,O<u-1&&(i+=t[O+1].dimensions.minx),r=Math.max(r,i))}o.push(i);let p=a+s,g=e.totalScale,m=e._horizontalOrigin,y=e._verticalOrigin,A=0,b=o[A],x=O0e(b,m,d),T=(l(e._lineHeight)?e._lineHeight:AWe*e._fontSize)/e._relativeSize,E=T*(c-1),v=r,S=p+E;l(f)&&(v+=d.x*2,S+=d.y*2,f._labelHorizontalOrigin=m),Go.x=x*g,Go.y=0;let I=!0,R=0;for(let O=0;O<u;++O){if(n.charAt(O)===` +`){++A,R+=T,b=o[A],x=O0e(b,m,d),Go.x=x*g,I=!0;continue}let L=t[O],_=L.dimensions;if(l(_)&&(y===Gn.TOP?(Go.y=_.height-a-d.y,Go.y+=Ba.PADDING):y===Gn.CENTER?Go.y=(E+_.height-a)/2:y===Gn.BASELINE?(Go.y=E,Go.y-=Ba.PADDING):(Go.y=E+s+d.y,Go.y-=Ba.PADDING),Go.y=(Go.y-_.descent-R)*g,I&&(Go.x-=Ba.PADDING*g,I=!1),l(L.billboard)&&(L.billboard._setTranslate(Go),L.billboard._labelDimensions.x=v,L.billboard._labelDimensions.y=S,L.billboard._labelHorizontalOrigin=m,bs(e.heightReference)&&(L.billboard._labelTranslate=U.clone(Go,L.billboard._labelTranslate))),O<u-1)){let C=t[O+1];Go.x+=(_.width-_.minx+C.dimensions.minx)*g}}l(f)&&n.split(` +`).join("").length>0&&(m===Vi.CENTER?x=-r/2-d.x:m===Vi.RIGHT?x=-(r+d.x*2):x=0,Go.x=x*g,y===Gn.TOP?Go.y=p-a-s:y===Gn.CENTER?Go.y=(p-a)/2-s:y===Gn.BASELINE?Go.y=-d.y-s:Go.y=0,Go.y=Go.y*g,f.width=v,f.height=S,f._setTranslate(Go),f._labelTranslate=U.clone(Go,f._labelTranslate))}function L0e(e,t){let n=t._glyphs;for(let i=0,r=n.length;i<r;++i)BK(e,n[i]);l(t._backgroundBillboard)&&(e._backgroundBillboardCollection.remove(t._backgroundBillboard),t._backgroundBillboard=void 0),t._labelCollection=void 0,l(t._removeCallbackFunc)&&t._removeCallbackFunc(),le(t)}function zp(e){e=e??H.EMPTY_OBJECT,this._scene=e.scene,this._batchTable=e.batchTable;let t=new Df({scene:this._scene,textureAtlas:new Ex({initialSize:FK}),coarseDepthTestDistance:e.coarseDepthTestDistance,threePointDepthTestDistance:e.threePointDepthTestDistance});this._backgroundBillboardCollection=t,this._backgroundBillboardTexture=new Cg(t),this._glyphBillboardCollection=new Df({scene:this._scene,batchTable:this._batchTable,coarseDepthTestDistance:e.coarseDepthTestDistance,threePointDepthTestDistance:e.threePointDepthTestDistance}),this._glyphBillboardCollection._sdf=!0,this._spareBillboards=[],this._textDimensionsCache={},this._labels=[],this._labelsToUpdate=[],this._totalGlyphCount=0,this._highlightColor=z.clone(z.WHITE),this.show=e.show??!0,this.modelMatrix=N.clone(e.modelMatrix??N.IDENTITY),this.debugShowBoundingVolume=e.debugShowBoundingVolume??!1,this.blendOption=e.blendOption??Li.OPAQUE_AND_TRANSLUCENT}Object.defineProperties(zp.prototype,{length:{get:function(){return this._labels.length}},sizeInBytes:{get:function(){return this._glyphBillboardCollection.sizeInBytes+this._backgroundBillboardCollection.sizeInBytes}},ready:{get:function(){let e=this._backgroundBillboardCollection.get(0);return l(e)&&!e.ready?!1:this._glyphBillboardCollection.ready}},coarseDepthTestDistance:{get:function(){return this._backgroundBillboardCollection.coarseDepthTestDistance},set:function(e){this._backgroundBillboardCollection.coarseDepthTestDistance=e,this._glyphBillboardCollection.coarseDepthTestDistance=e}},threePointDepthTestDistance:{get:function(){return this._backgroundBillboardCollection.threePointDepthTestDistance},set:function(e){this._backgroundBillboardCollection.threePointDepthTestDistance=e,this._glyphBillboardCollection.threePointDepthTestDistance=e}}});zp.prototype.add=function(e){let t=new Ky(e,this);return this._labels.push(t),this._labelsToUpdate.push(t),t};zp.prototype.remove=function(e){if(l(e)&&e._labelCollection===this){let t=this._labels.indexOf(e);if(t!==-1)return this._labels.splice(t,1),L0e(this,e),!0}return!1};zp.prototype.removeAll=function(){let e=this._labels;for(let t=0,n=e.length;t<n;++t)L0e(this,e[t]);e.length=0};zp.prototype.contains=function(e){return l(e)&&e._labelCollection===this};zp.prototype.get=function(e){return this._labels[e]};zp.prototype.update=function(e){if(!this.show)return;let t=this._glyphBillboardCollection,n=this._backgroundBillboardCollection;t.modelMatrix=this.modelMatrix,t.debugShowBoundingVolume=this.debugShowBoundingVolume,n.modelMatrix=this.modelMatrix,n.debugShowBoundingVolume=this.debugShowBoundingVolume;let i=this._labelsToUpdate.length;for(let o=0;o<i;++o){let s=this._labelsToUpdate[o];if(s.isDestroyed())continue;let a=s._glyphs.length;s._rebindAllGlyphs&&(vWe(this,s),s._rebindAllGlyphs=!1),s._repositionAllGlyphs&&(IWe(s),s._repositionAllGlyphs=!1);let c=s._glyphs.length-a;this._totalGlyphCount+=c}let r=n.length>0?Li.TRANSLUCENT:this.blendOption;t.blendOption=r,n.blendOption=r,t._highlightColor=this._highlightColor,n._highlightColor=this._highlightColor,this._labelsToUpdate.length=0,n.update(e),t.update(e)};zp.prototype.isDestroyed=function(){return!1};zp.prototype.destroy=function(){return this.removeAll(),this._glyphBillboardCollection=this._glyphBillboardCollection.destroy(),this._backgroundBillboardCollection=this._backgroundBillboardCollection.destroy(),le(this)};var Vp=zp;function ss(e,t){e=e??H.EMPTY_OBJECT;let n=e.translucencyByDistance,i=e.scaleByDistance,r=e.distanceDisplayCondition;l(n)&&(n=qt.clone(n)),l(i)&&(i=qt.clone(i)),l(r)&&(r=Ht.clone(r)),this._show=e.show??!0,this._position=h.clone(e.position??h.ZERO),this._actualPosition=h.clone(this._position),this._color=z.clone(e.color??z.WHITE),this._outlineColor=z.clone(e.outlineColor??z.TRANSPARENT),this._outlineWidth=e.outlineWidth??0,this._pixelSize=e.pixelSize??10,this._scaleByDistance=i,this._translucencyByDistance=n,this._distanceDisplayCondition=r,this._disableDepthTestDistance=e.disableDepthTestDistance??0,this._id=e.id,this._collection=e.collection??t,this._clusterShow=!0,this._pickId=void 0,this._pointPrimitiveCollection=t,this._dirty=!1,this._index=-1,this._splitDirection=e.splitDirection??Ho.NONE}var F0e=ss.SHOW_INDEX=0,U0e=ss.POSITION_INDEX=1,PWe=ss.COLOR_INDEX=2,DWe=ss.OUTLINE_COLOR_INDEX=3,RWe=ss.OUTLINE_WIDTH_INDEX=4,OWe=ss.PIXEL_SIZE_INDEX=5,MWe=ss.SCALE_BY_DISTANCE_INDEX=6,NWe=ss.TRANSLUCENCY_BY_DISTANCE_INDEX=7,LWe=ss.DISTANCE_DISPLAY_CONDITION_INDEX=8,FWe=ss.DISABLE_DEPTH_DISTANCE_INDEX=9,BWe=ss.SPLIT_DIRECTION_INDEX=10;ss.NUMBER_OF_PROPERTIES=11;function Rf(e,t){let n=e._pointPrimitiveCollection;l(n)&&(n._updatePointPrimitive(e,t),e._dirty=!0)}Object.defineProperties(ss.prototype,{show:{get:function(){return this._show},set:function(e){this._show!==e&&(this._show=e,Rf(this,F0e))}},position:{get:function(){return this._position},set:function(e){let t=this._position;h.equals(t,e)||(h.clone(e,t),h.clone(e,this._actualPosition),Rf(this,U0e))}},scaleByDistance:{get:function(){return this._scaleByDistance},set:function(e){let t=this._scaleByDistance;qt.equals(t,e)||(this._scaleByDistance=qt.clone(e,t),Rf(this,MWe))}},translucencyByDistance:{get:function(){return this._translucencyByDistance},set:function(e){let t=this._translucencyByDistance;qt.equals(t,e)||(this._translucencyByDistance=qt.clone(e,t),Rf(this,NWe))}},pixelSize:{get:function(){return this._pixelSize},set:function(e){this._pixelSize!==e&&(this._pixelSize=e,Rf(this,OWe))}},color:{get:function(){return this._color},set:function(e){let t=this._color;z.equals(t,e)||(z.clone(e,t),Rf(this,PWe))}},outlineColor:{get:function(){return this._outlineColor},set:function(e){let t=this._outlineColor;z.equals(t,e)||(z.clone(e,t),Rf(this,DWe))}},outlineWidth:{get:function(){return this._outlineWidth},set:function(e){this._outlineWidth!==e&&(this._outlineWidth=e,Rf(this,RWe))}},distanceDisplayCondition:{get:function(){return this._distanceDisplayCondition},set:function(e){Ht.equals(this._distanceDisplayCondition,e)||(this._distanceDisplayCondition=Ht.clone(e,this._distanceDisplayCondition),Rf(this,LWe))}},disableDepthTestDistance:{get:function(){return this._disableDepthTestDistance},set:function(e){this._disableDepthTestDistance!==e&&(this._disableDepthTestDistance=e,Rf(this,FWe))}},id:{get:function(){return this._id},set:function(e){this._id=e,l(this._pickId)&&(this._pickId.object.id=e)}},pickId:{get:function(){return this._pickId}},clusterShow:{get:function(){return this._clusterShow},set:function(e){this._clusterShow!==e&&(this._clusterShow=e,Rf(this,F0e))}},splitDirection:{get:function(){return this._splitDirection},set:function(e){this._splitDirection!==e&&(this._splitDirection=e,Rf(this,BWe))}}});ss.prototype.getPickId=function(e){return l(this._pickId)||(this._pickId=e.createPickId({primitive:this,collection:this._collection,id:this._id})),this._pickId};ss.prototype._getActualPosition=function(){return this._actualPosition};ss.prototype._setActualPosition=function(e){h.clone(e,this._actualPosition),Rf(this,U0e)};var B0e=new se;ss._computeActualPosition=function(e,t,n){return t.mode===re.SCENE3D?e:(N.multiplyByPoint(n,e,B0e),dr.computeActualEllipsoidPosition(t,B0e))};var k0e=new se;ss._computeScreenSpacePosition=function(e,t,n,i){let r=N.multiplyByVector(e,se.fromElements(t.x,t.y,t.z,1,k0e),k0e);return dr.worldToWindowCoordinates(n,r,i)};ss.prototype.computeScreenSpacePosition=function(e,t){let n=this._pointPrimitiveCollection;l(t)||(t=new U);let i=n.modelMatrix,r=ss._computeScreenSpacePosition(i,this._actualPosition,e,t);if(l(r))return r.y=e.canvas.clientHeight-r.y,r};ss.getScreenSpaceBoundingBox=function(e,t,n){let i=e.pixelSize,r=i*.5,o=t.x-r,s=t.y-r,a=i,c=i;return l(n)||(n=new et),n.x=o,n.y=s,n.width=a,n.height=c,n};ss.prototype.equals=function(e){return this===e||l(e)&&this._id===e._id&&h.equals(this._position,e._position)&&z.equals(this._color,e._color)&&this._pixelSize===e._pixelSize&&this._outlineWidth===e._outlineWidth&&this._show===e._show&&z.equals(this._outlineColor,e._outlineColor)&&qt.equals(this._scaleByDistance,e._scaleByDistance)&&qt.equals(this._translucencyByDistance,e._translucencyByDistance)&&Ht.equals(this._distanceDisplayCondition,e._distanceDisplayCondition)&&this._disableDepthTestDistance===e._disableDepthTestDistance&&this._splitDirection===e._splitDirection};ss.prototype._destroy=function(){this._pickId=this._pickId&&this._pickId.destroy(),this._pointPrimitiveCollection=void 0};var ga=ss;var kWe=ga.SHOW_INDEX,zK=ga.POSITION_INDEX,z0e=ga.COLOR_INDEX,UWe=ga.OUTLINE_COLOR_INDEX,zWe=ga.OUTLINE_WIDTH_INDEX,VWe=ga.PIXEL_SIZE_INDEX,V0e=ga.SCALE_BY_DISTANCE_INDEX,j0e=ga.TRANSLUCENCY_BY_DISTANCE_INDEX,H0e=ga.DISTANCE_DISPLAY_CONDITION_INDEX,jWe=ga.DISABLE_DEPTH_DISTANCE_INDEX,HWe=ga.SPLIT_DIRECTION_INDEX,VK=ga.NUMBER_OF_PROPERTIES,tl={positionHighAndSize:0,positionLowAndOutline:1,compressedAttribute0:2,compressedAttribute1:3,scaleByDistance:4,distanceDisplayConditionAndDisableDepthAndSplitDirection:5};function Bd(e){e=e??H.EMPTY_OBJECT,this._sp=void 0,this._spTranslucent=void 0,this._rsOpaque=void 0,this._rsTranslucent=void 0,this._vaf=void 0,this._pointPrimitives=[],this._pointPrimitivesToUpdate=[],this._pointPrimitivesToUpdateIndex=0,this._pointPrimitivesRemoved=!1,this._createVertexArray=!1,this._shaderScaleByDistance=!1,this._compiledShaderScaleByDistance=!1,this._shaderTranslucencyByDistance=!1,this._compiledShaderTranslucencyByDistance=!1,this._shaderDistanceDisplayCondition=!1,this._compiledShaderDistanceDisplayCondition=!1,this._shaderDisableDepthDistance=!1,this._compiledShaderDisableDepthDistance=!1,this._propertiesChanged=new Uint32Array(VK),this._maxPixelSize=1,this._baseVolume=new ue,this._baseVolumeWC=new ue,this._baseVolume2D=new ue,this._boundingVolume=new ue,this._boundingVolumeDirty=!1,this._colorCommands=[],this.show=e.show??!0,this.modelMatrix=N.clone(e.modelMatrix??N.IDENTITY),this._modelMatrix=N.clone(N.IDENTITY),this.debugShowBoundingVolume=e.debugShowBoundingVolume??!1,this.blendOption=e.blendOption??Li.OPAQUE_AND_TRANSLUCENT,this._blendOption=void 0,this._mode=re.SCENE3D,this._maxTotalPointSize=1,this._buffersUsage=[Me.STATIC_DRAW,Me.STATIC_DRAW,Me.STATIC_DRAW,Me.STATIC_DRAW,Me.STATIC_DRAW,Me.STATIC_DRAW,Me.STATIC_DRAW,Me.STATIC_DRAW,Me.STATIC_DRAW];let t=this;this._uniforms={u_maxTotalPointSize:function(){return t._maxTotalPointSize}}}Object.defineProperties(Bd.prototype,{length:{get:function(){return jK(this),this._pointPrimitives.length}}});function G0e(e){let t=e.length;for(let n=0;n<t;++n)e[n]&&e[n]._destroy()}Bd.prototype.add=function(e){let t=new ga(e,this);return t._index=this._pointPrimitives.length,this._pointPrimitives.push(t),this._createVertexArray=!0,t};Bd.prototype.remove=function(e){return this.contains(e)?(this._pointPrimitives[e._index]=null,this._pointPrimitivesRemoved=!0,this._createVertexArray=!0,e._destroy(),!0):!1};Bd.prototype.removeAll=function(){G0e(this._pointPrimitives),this._pointPrimitives=[],this._pointPrimitivesToUpdate=[],this._pointPrimitivesToUpdateIndex=0,this._pointPrimitivesRemoved=!1,this._createVertexArray=!0};function jK(e){if(e._pointPrimitivesRemoved){e._pointPrimitivesRemoved=!1;let t=[],n=e._pointPrimitives,i=n.length;for(let r=0,o=0;r<i;++r){let s=n[r];s&&(s._index=o++,t.push(s))}e._pointPrimitives=t}}Bd.prototype._updatePointPrimitive=function(e,t){e._dirty||(this._pointPrimitivesToUpdate[this._pointPrimitivesToUpdateIndex++]=e),++this._propertiesChanged[t]};Bd.prototype.contains=function(e){return l(e)&&e._pointPrimitiveCollection===this};Bd.prototype.get=function(e){return jK(this),this._pointPrimitives[e]};Bd.prototype.computeNewBuffersUsage=function(){let e=this._buffersUsage,t=!1,n=this._propertiesChanged;for(let i=0;i<VK;++i){let r=n[i]===0?Me.STATIC_DRAW:Me.STREAM_DRAW;t=t||e[i]!==r,e[i]=r}return t};function GWe(e,t,n){return new mg(e,[{index:tl.positionHighAndSize,componentsPerAttribute:4,componentDatatype:Y.FLOAT,usage:n[zK]},{index:tl.positionLowAndShow,componentsPerAttribute:4,componentDatatype:Y.FLOAT,usage:n[zK]},{index:tl.compressedAttribute0,componentsPerAttribute:4,componentDatatype:Y.FLOAT,usage:n[z0e]},{index:tl.compressedAttribute1,componentsPerAttribute:4,componentDatatype:Y.FLOAT,usage:n[j0e]},{index:tl.scaleByDistance,componentsPerAttribute:4,componentDatatype:Y.FLOAT,usage:n[V0e]},{index:tl.distanceDisplayConditionAndDisableDepthAndSplitDirection,componentsPerAttribute:4,componentDatatype:Y.FLOAT,usage:n[H0e]}],t)}var kK=new Sn,B6=new z;function W0e(e,t,n,i){let r=i._index,o=i._getActualPosition();e._mode===re.SCENE3D&&(ue.expand(e._baseVolume,o,e._baseVolume),e._boundingVolumeDirty=!0),Sn.fromCartesian(o,kK);let s=i.pixelSize,a=i.outlineWidth;e._maxPixelSize=Math.max(e._maxPixelSize,s+a);let c=n[tl.positionHighAndSize],u=kK.high;c(r,u.x,u.y,u.z,s);let f=n[tl.positionLowAndOutline],d=kK.low;f(r,d.x,d.y,d.z,a)}var WWe=256;function q0e(e,t,n,i){let r=i._index,o=i.color,s=i.outlineColor,a=i.getPickId(t).color;B6.red=o.alpha,B6.green=s.alpha,B6.blue=a.alpha;let c=n[tl.compressedAttribute0];c(r,cn.encodeRGB8(o),cn.encodeRGB8(s),cn.encodeRGB8(a),cn.encodeRGB8(B6))}function Y0e(e,t,n,i){let r=i._index,o=0,s=1,a=1,c=1,u=i.translucencyByDistance;l(u)&&(o=u.near,s=u.nearValue,a=u.far,c=u.farValue,(s!==1||c!==1)&&(e._shaderTranslucencyByDistance=!0));let f=i.show&&i.clusterShow;i.color.alpha===0&&i.outlineColor.alpha===0&&(f=!1),s=D.clamp(s,0,1),s=s===1?255:s*255|0;let d=(f?1:0)*WWe+s;c=D.clamp(c,0,1),c=c===1?255:c*255|0;let p=c,g=n[tl.compressedAttribute1];g(r,d,p,o,a)}function X0e(e,t,n,i){let r=i._index,o=n[tl.scaleByDistance],s=0,a=1,c=1,u=1,f=i.scaleByDistance;l(f)&&(s=f.near,a=f.nearValue,c=f.far,u=f.farValue,(a!==1||u!==1)&&(e._shaderScaleByDistance=!0)),o(r,s,a,c,u)}function K0e(e,t,n,i){let r=i._index,o=n[tl.distanceDisplayConditionAndDisableDepthAndSplitDirection],s=0,a=Number.MAX_VALUE,c=i.distanceDisplayCondition;l(c)&&(s=c.near,a=c.far,s*=s,a*=a,e._shaderDistanceDisplayCondition=!0);let u=i.disableDepthTestDistance;u*=u,u>0&&(e._shaderDisableDepthDistance=!0,u===Number.POSITIVE_INFINITY&&(u=-1));let f=0,d=i.splitDirection;l(d)&&(f=d),o(r,s,a,u,f)}function qWe(e,t,n,i){W0e(e,t,n,i),q0e(e,t,n,i),Y0e(e,t,n,i),X0e(e,t,n,i),K0e(e,t,n,i)}function UK(e,t,n,i,r,o){let s;i.mode===re.SCENE3D?(s=e._baseVolume,e._boundingVolumeDirty=!0):s=e._baseVolume2D;let a=[];for(let c=0;c<n;++c){let u=t[c],f=u.position,d=ga._computeActualPosition(f,i,r);l(d)&&(u._setActualPosition(d),o?a.push(d):ue.expand(s,d,s))}o&&ue.fromPoints(a,s)}function YWe(e,t){let n=t.mode,i=e._pointPrimitives,r=e._pointPrimitivesToUpdate,o=e._modelMatrix;e._createVertexArray||e._mode!==n||n!==re.SCENE3D&&!N.equals(o,e.modelMatrix)?(e._mode=n,N.clone(e.modelMatrix,o),e._createVertexArray=!0,(n===re.SCENE3D||n===re.SCENE2D||n===re.COLUMBUS_VIEW)&&UK(e,i,i.length,t,o,!0)):n===re.MORPHING?UK(e,i,i.length,t,o,!0):(n===re.SCENE2D||n===re.COLUMBUS_VIEW)&&UK(e,r,e._pointPrimitivesToUpdateIndex,t,o,!1)}function XWe(e,t,n){let r=t.camera.getPixelSize(n,t.context.drawingBufferWidth,t.context.drawingBufferHeight)*e._maxPixelSize;n.radius+=r}var KWe=[];Bd.prototype.update=function(e){if(jK(this),!this.show)return;this._maxTotalPointSize=kt.maximumAliasedPointSize,YWe(this,e);let n=this._pointPrimitives.length,i=this._pointPrimitivesToUpdate,r=this._pointPrimitivesToUpdateIndex,o=this._propertiesChanged,s=this._createVertexArray,a,c=e.context,u=e.passes,f=u.pick;if(s||!f&&this.computeNewBuffersUsage()){this._createVertexArray=!1;for(let v=0;v<VK;++v)o[v]=0;if(this._vaf=this._vaf&&this._vaf.destroy(),n>0){this._vaf=GWe(c,n,this._buffersUsage),a=this._vaf.writers;for(let v=0;v<n;++v){let S=this._pointPrimitives[v];S._dirty=!1,qWe(this,c,a,S)}this._vaf.commit()}this._pointPrimitivesToUpdateIndex=0}else if(r>0){let v=KWe;v.length=0,(o[zK]||o[zWe]||o[VWe])&&v.push(W0e),(o[z0e]||o[UWe])&&v.push(q0e),(o[kWe]||o[j0e])&&v.push(Y0e),o[V0e]&&v.push(X0e),(o[H0e]||o[jWe]||o[HWe])&&v.push(K0e);let S=v.length;if(a=this._vaf.writers,r/n>.1){for(let I=0;I<r;++I){let R=i[I];R._dirty=!1;for(let O=0;O<S;++O)v[O](this,c,a,R)}this._vaf.commit()}else{for(let I=0;I<r;++I){let R=i[I];R._dirty=!1;for(let O=0;O<S;++O)v[O](this,c,a,R);this._vaf.subCommit(R._index,1)}this._vaf.endSubCommits()}this._pointPrimitivesToUpdateIndex=0}if(r>n*1.5&&(i.length=n),!l(this._vaf)||!l(this._vaf.va))return;this._boundingVolumeDirty&&(this._boundingVolumeDirty=!1,ue.transform(this._baseVolume,this.modelMatrix,this._baseVolumeWC));let d,p=N.IDENTITY;e.mode===re.SCENE3D?(p=this.modelMatrix,d=ue.clone(this._baseVolumeWC,this._boundingVolume)):d=ue.clone(this._baseVolume2D,this._boundingVolume),XWe(this,e,d);let g=this._blendOption!==this.blendOption;this._blendOption=this.blendOption,g&&(this._blendOption===Li.OPAQUE||this._blendOption===Li.OPAQUE_AND_TRANSLUCENT?this._rsOpaque=Ge.fromCache({depthTest:{enabled:!0,func:te.LEQUAL},depthMask:!0}):this._rsOpaque=void 0,this._blendOption===Li.TRANSLUCENT||this._blendOption===Li.OPAQUE_AND_TRANSLUCENT?this._rsTranslucent=Ge.fromCache({depthTest:{enabled:!0,func:te.LEQUAL},depthMask:!1,blending:tn.ALPHA_BLEND}):this._rsTranslucent=void 0),this._shaderDisableDepthDistance=this._shaderDisableDepthDistance||e.minimumDisableDepthTestDistance!==0;let m,y;(g||this._shaderScaleByDistance&&!this._compiledShaderScaleByDistance||this._shaderTranslucencyByDistance&&!this._compiledShaderTranslucencyByDistance||this._shaderDistanceDisplayCondition&&!this._compiledShaderDistanceDisplayCondition||this._shaderDisableDepthDistance!==this._compiledShaderDisableDepthDistance)&&(m=new Ye({sources:[cM]}),this._shaderScaleByDistance&&m.defines.push("EYE_DISTANCE_SCALING"),this._shaderTranslucencyByDistance&&m.defines.push("EYE_DISTANCE_TRANSLUCENCY"),this._shaderDistanceDisplayCondition&&m.defines.push("DISTANCE_DISPLAY_CONDITION"),this._shaderDisableDepthDistance&&m.defines.push("DISABLE_DEPTH_DISTANCE"),this._blendOption===Li.OPAQUE_AND_TRANSLUCENT&&(y=new Ye({defines:["OPAQUE"],sources:[Vy]}),this._sp=Qt.replaceCache({context:c,shaderProgram:this._sp,vertexShaderSource:m,fragmentShaderSource:y,attributeLocations:tl}),y=new Ye({defines:["TRANSLUCENT"],sources:[Vy]}),this._spTranslucent=Qt.replaceCache({context:c,shaderProgram:this._spTranslucent,vertexShaderSource:m,fragmentShaderSource:y,attributeLocations:tl})),this._blendOption===Li.OPAQUE&&(y=new Ye({sources:[Vy]}),this._sp=Qt.replaceCache({context:c,shaderProgram:this._sp,vertexShaderSource:m,fragmentShaderSource:y,attributeLocations:tl})),this._blendOption===Li.TRANSLUCENT&&(y=new Ye({sources:[Vy]}),this._spTranslucent=Qt.replaceCache({context:c,shaderProgram:this._spTranslucent,vertexShaderSource:m,fragmentShaderSource:y,attributeLocations:tl})),this._compiledShaderScaleByDistance=this._shaderScaleByDistance,this._compiledShaderTranslucencyByDistance=this._shaderTranslucencyByDistance,this._compiledShaderDistanceDisplayCondition=this._shaderDistanceDisplayCondition,this._compiledShaderDisableDepthDistance=this._shaderDisableDepthDistance);let A,b,x,T,E=e.commandList;if(u.render||f){let v=this._colorCommands,S=this._blendOption===Li.OPAQUE,I=this._blendOption===Li.OPAQUE_AND_TRANSLUCENT;A=this._vaf.va,b=A.length,v.length=b;let R=I?b*2:b;for(T=0;T<R;++T){let O=S||I&&T%2===0;x=v[T],l(x)||(x=v[T]=new at),x.primitiveType=Oe.POINTS,x.pass=O||!I?Ie.OPAQUE:Ie.TRANSLUCENT,x.owner=this;let L=I?Math.floor(T/2):T;x.boundingVolume=d,x.modelMatrix=p,x.shaderProgram=O?this._sp:this._spTranslucent,x.uniformMap=this._uniforms,x.vertexArray=A[L].va,x.renderState=O?this._rsOpaque:this._rsTranslucent,x.debugShowBoundingVolume=this.debugShowBoundingVolume,x.pickId="v_pickColor",E.push(x)}}};Bd.prototype.isDestroyed=function(){return!1};Bd.prototype.destroy=function(){return this._sp=this._sp&&this._sp.destroy(),this._spTranslucent=this._spTranslucent&&this._spTranslucent.destroy(),this._spPick=this._spPick&&this._spPick.destroy(),this._vaf=this._vaf&&this._vaf.destroy(),G0e(this._pointPrimitives),le(this)};var kv=Bd;var $0e=[Int8Array,Uint8Array,Uint8ClampedArray,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array],HK=1,bN=8,as=new Uint32Array(96),TN=class e{static from(t){if(!t||t.byteLength===void 0||t.buffer)throw new Error("Data must be an instance of ArrayBuffer or SharedArrayBuffer.");let[n,i]=new Uint8Array(t,0,2);if(n!==219)throw new Error("Data does not appear to be in a KDBush format.");let r=i>>4;if(r!==HK)throw new Error(`Got v${r} data when expected v${HK}.`);let o=$0e[i&15];if(!o)throw new Error("Unrecognized array type.");let[s]=new Uint16Array(t,2,1),[a]=new Uint32Array(t,4,1);return new e(a,s,o,void 0,t)}constructor(t,n=64,i=Float64Array,r=ArrayBuffer,o){if(isNaN(t)||t<0)throw new Error(`Unexpected numItems value: ${t}.`);this.numItems=+t,this.nodeSize=Math.min(Math.max(+n,2),65535),this.ArrayType=i,this.IndexArrayType=t<65536?Uint16Array:Uint32Array;let s=$0e.indexOf(this.ArrayType),a=t*2*this.ArrayType.BYTES_PER_ELEMENT,c=t*this.IndexArrayType.BYTES_PER_ELEMENT,u=(8-c%8)%8;if(s<0)throw new Error(`Unexpected typed array class: ${i}.`);if(o)this.data=o,this.ids=new this.IndexArrayType(o,bN,t),this.coords=new i(o,bN+c+u,t*2),this._pos=t*2,this._finished=!0;else{let f=this.data=new r(bN+a+c+u);this.ids=new this.IndexArrayType(f,bN,t),this.coords=new i(f,bN+c+u,t*2),this._pos=0,this._finished=!1,new Uint8Array(f,0,2).set([219,(HK<<4)+s]),new Uint16Array(f,2,1)[0]=n,new Uint32Array(f,4,1)[0]=t}}add(t,n){let i=this._pos>>1;return this.ids[i]=i,this.coords[this._pos++]=t,this.coords[this._pos++]=n,i}finish(){let t=this._pos>>1;if(t!==this.numItems)throw new Error(`Added ${t} items when expected ${this.numItems}.`);return WK(this.ids,this.coords,this.nodeSize,0,this.numItems-1,0),this._finished=!0,this}range(t,n,i,r){if(!this._finished)throw new Error("Data not yet indexed - call index.finish().");let{ids:o,coords:s,nodeSize:a}=this;as[0]=0,as[1]=o.length-1,as[2]=0;let c=3,u=[];for(;c>0;){let f=as[--c],d=as[--c],p=as[--c];if(d-p<=a){for(let A=p;A<=d;A++){let b=s[2*A],x=s[2*A+1];b>=t&&b<=i&&x>=n&&x<=r&&u.push(o[A])}continue}let g=p+d>>1,m=s[2*g],y=s[2*g+1];m>=t&&m<=i&&y>=n&&y<=r&&u.push(o[g]),(f===0?t<=m:n<=y)&&(as[c++]=p,as[c++]=g-1,as[c++]=1-f),(f===0?i>=m:r>=y)&&(as[c++]=g+1,as[c++]=d,as[c++]=1-f)}return u}within(t,n,i){let r=[];return this.withinInto(t,n,i,r),r}withinInto(t,n,i,r){if(!this._finished)throw new Error("Data not yet indexed - call index.finish().");let{ids:o,coords:s,nodeSize:a}=this;as[0]=0,as[1]=o.length-1,as[2]=0;let c=3,u=0,f=i*i;for(;c>0;){let d=as[--c],p=as[--c],g=as[--c];if(p-g<=a){for(let b=g;b<=p;b++)J0e(s[2*b],s[2*b+1],t,n)<=f&&(r[u++]=o[b]);continue}let m=g+p>>1,y=s[2*m],A=s[2*m+1];J0e(y,A,t,n)<=f&&(r[u++]=o[m]),(d===0?t-i<=y:n-i<=A)&&(as[c++]=g,as[c++]=m-1,as[c++]=1-d),(d===0?t+i>=y:n+i>=A)&&(as[c++]=m+1,as[c++]=p,as[c++]=1-d)}return u}};function WK(e,t,n,i,r,o){if(r-i<=n)return;let s=i+r>>1;Z0e(e,t,s,i,r,o),WK(e,t,n,i,s-1,1-o),WK(e,t,n,s+1,r,1-o)}function Z0e(e,t,n,i,r,o){for(;r>i;){if(r-i>600){let u=r-i+1,f=n-i+1,d=Math.log(u),p=.5*Math.exp(2*d/3),g=.5*Math.sqrt(d*p*(u-p)/u)*(f-u/2<0?-1:1),m=Math.max(i,Math.floor(n-f*p/u+g)),y=Math.min(r,Math.floor(n+(u-f)*p/u+g));Z0e(e,t,n,m,y,o)}let s=t[2*n+o],a=i,c=r;for(xN(e,t,i,n),t[2*r+o]>s&&xN(e,t,i,r);a<c;){for(xN(e,t,a,c),a++,c--;t[2*a+o]<s;)a++;for(;t[2*c+o]>s;)c--}t[2*i+o]===s?xN(e,t,i,c):(c++,xN(e,t,c,r)),c<=n&&(i=c+1),n<=c&&(r=c-1)}}function xN(e,t,n,i){GK(e,n,i),GK(t,2*n,2*i),GK(t,2*n+1,2*i+1)}function GK(e,t,n){let i=e[t];e[t]=e[n],e[n]=i}function J0e(e,t,n,i){let r=e-n,o=t-i;return r*r+o*o}function tm(e){e=e??H.EMPTY_OBJECT,this._enabled=e.enabled??!1,this._pixelRange=e.pixelRange??80,this._minimumClusterSize=e.minimumClusterSize??2,this._clusterBillboards=e.clusterBillboards??!0,this._clusterLabels=e.clusterLabels??!0,this._clusterPoints=e.clusterPoints??!0,this._labelCollection=void 0,this._billboardCollection=void 0,this._pointCollection=void 0,this._clusterBillboardCollection=void 0,this._clusterLabelCollection=void 0,this._clusterPointCollection=void 0,this._collectionIndicesByEntity={},this._unusedLabelIndices=[],this._unusedBillboardIndices=[],this._unusedPointIndices=[],this._previousClusters=[],this._previousHeight=void 0,this._enabledDirty=!1,this._clusterDirty=!1,this._cluster=void 0,this._removeEventListener=void 0,this._clusterEvent=new be,this.show=e.show??!0}function Q0e(e,t){e.x-=t,e.y-=t,e.width+=t*2,e.height+=t*2}var $We=new et;function ege(e,t,n,i,r){if(l(e._labelCollection)&&i._clusterLabels?r=Ky.getScreenSpaceBoundingBox(e,t,r):l(e._billboardCollection)&&i._clusterBillboards?r=Br.getScreenSpaceBoundingBox(e,t,r):l(e._pointPrimitiveCollection)&&i._clusterPoints&&(r=ga.getScreenSpaceBoundingBox(e,t,r)),Q0e(r,n),i._clusterLabels&&!l(e._labelCollection)&&l(e.id)&&nge(i,e.id.id)&&l(e.id._label)){let o=i._collectionIndicesByEntity[e.id.id].labelIndex,s=i._labelCollection.get(o),a=Ky.getScreenSpaceBoundingBox(s,t,$We);Q0e(a,n),r=et.union(r,a,r)}return r}function JWe(e,t){if(e.clusterShow=!0,!l(e._labelCollection)&&l(e.id)&&nge(t,e.id.id)&&l(e.id._label)){let n=t._collectionIndicesByEntity[e.id.id].labelIndex,i=t._labelCollection.get(n);i.clusterShow=!0}}function tge(e,t,n,i){let r={billboard:i._clusterBillboardCollection.add(),label:i._clusterLabelCollection.add(),point:i._clusterPointCollection.add()};r.billboard.show=!1,r.point.show=!1,r.label.show=!0,r.label.text=t.toLocaleString(),r.label.id=n,r.billboard.position=r.label.position=r.point.position=e,i._clusterEvent.raiseEvent(n,r)}function nge(e,t){return l(e)&&l(e._collectionIndicesByEntity[t])&&l(e._collectionIndicesByEntity[t].labelIndex)}function qK(e,t,n,i,r){if(!l(e))return;let o=e.length;for(let s=0;s<o;++s){let a=e.get(s);if(a.clusterShow=!1,!a.show||r._scene.mode===re.SCENE3D&&!i.isPointVisible(a.position))continue;let c=r._clusterLabels&&l(a._labelCollection),u=r._clusterBillboards&&l(a.id._billboard),f=r._clusterPoints&&l(a.id._point);if(c&&(f||u))continue;let d=a.computeScreenSpacePosition(n);l(d)&&t.push({index:s,collection:e,clustered:!1,coord:d})}}var ZWe=new et,QWe=new et,eqe=new et;function tqe(e){return function(t){if(l(t)&&t<.05||!e.enabled)return;let n=e._scene,i=e._labelCollection,r=e._billboardCollection,o=e._pointCollection;if(!l(i)&&!l(r)&&!l(o)||!e._clusterBillboards&&!e._clusterLabels&&!e._clusterPoints)return;let s=e._clusterLabelCollection,a=e._clusterBillboardCollection,c=e._clusterPointCollection;l(s)?s.removeAll():s=e._clusterLabelCollection=new Vp({scene:n}),l(a)?a.removeAll():a=e._clusterBillboardCollection=new Df({scene:n}),l(c)?c.removeAll():c=e._clusterPointCollection=new kv;let u=e._pixelRange,f=e._minimumClusterSize,d=e._previousClusters,p=[],g=e._previousHeight,m=n.camera.positionCartographic.height,y=n.ellipsoid,A=n.camera.positionWC,b=new Zh(y,A),x=[];e._clusterLabels&&qK(i,x,n,b,e),e._clusterBillboards&&qK(r,x,n,b,e),e._clusterPoints&&qK(o,x,n,b,e);let T,E,v,S,I,R,O,L,_,C,w,P;if(x.length>0){let M=new TN(x.length,64,Float64Array);for(let F=0;F<x.length;++F)M.add(x[F].coord.x,x[F].coord.y);if(M.finish(),m<g)for(v=d.length,T=0;T<v;++T){let F=d[T];if(!b.isPointVisible(F.position))continue;let V=Br._computeScreenSpacePosition(N.IDENTITY,F.position,h.ZERO,U.ZERO,n);if(!l(V))continue;let B=1-m/g,j=F.width=F.width*B,k=F.height=F.height*B;j=Math.max(j,F.minimumWidth),k=Math.max(k,F.minimumHeight);let G=V.x-j*.5,q=V.y-k*.5,Q=V.x+j,W=V.y+k;for(I=M.range(G,q,Q,W),R=I.length,C=0,_=[],E=0;E<R;++E)O=I[E],L=x[O],L.clustered||(++C,w=L.collection,P=L.index,_.push(w.get(P).id));if(C>=f)for(tge(F.position,C,_,e),p.push(F),E=0;E<R;++E)x[I[E]].clustered=!0}for(v=x.length,T=0;T<v;++T){let F=x[T];if(F.clustered)continue;F.clustered=!0,w=F.collection,P=F.index;let V=w.get(P);S=ege(V,F.coord,u,e,ZWe);let B=et.clone(S,QWe);I=M.range(S.x,S.y,S.x+S.width,S.y+S.height),R=I.length;let j=h.clone(V.position);for(C=1,_=[V.id],E=0;E<R;++E)if(O=I[E],L=x[O],!L.clustered){let k=L.collection.get(L.index),G=ege(k,L.coord,u,e,eqe);h.add(k.position,j,j),et.union(B,G,B),++C,_.push(k.id)}if(C>=f){let k=h.multiplyByScalar(j,1/C,j);for(tge(k,C,_,e),p.push({position:k,width:B.width,height:B.height,minimumWidth:S.width,minimumHeight:S.height}),E=0;E<R;++E)x[I[E]].clustered=!0}else JWe(V,e)}}s.length===0&&(s.destroy(),e._clusterLabelCollection=void 0),a.length===0&&(a.destroy(),e._clusterBillboardCollection=void 0),c.length===0&&(c.destroy(),e._clusterPointCollection=void 0),e._previousClusters=p,e._previousHeight=m}}tm.prototype._initialize=function(e){this._scene=e;let t=tqe(this);this._cluster=t,this._removeEventListener=e.camera.changed.addEventListener(t)};Object.defineProperties(tm.prototype,{enabled:{get:function(){return this._enabled},set:function(e){this._enabledDirty=e!==this._enabled,this._enabled=e}},pixelRange:{get:function(){return this._pixelRange},set:function(e){this._clusterDirty=this._clusterDirty||e!==this._pixelRange,this._pixelRange=e}},minimumClusterSize:{get:function(){return this._minimumClusterSize},set:function(e){this._clusterDirty=this._clusterDirty||e!==this._minimumClusterSize,this._minimumClusterSize=e}},clusterEvent:{get:function(){return this._clusterEvent}},clusterBillboards:{get:function(){return this._clusterBillboards},set:function(e){this._clusterDirty=this._clusterDirty||e!==this._clusterBillboards,this._clusterBillboards=e}},clusterLabels:{get:function(){return this._clusterLabels},set:function(e){this._clusterDirty=this._clusterDirty||e!==this._clusterLabels,this._clusterLabels=e}},clusterPoints:{get:function(){return this._clusterPoints},set:function(e){this._clusterDirty=this._clusterDirty||e!==this._clusterPoints,this._clusterPoints=e}},ready:{get:function(){return!this._enabledDirty&&!this._clusterDirty&&(!l(this._billboardCollection)||this._billboardCollection.ready)&&(!l(this._labelCollection)||this._labelCollection.ready)}}});function XK(e,t,n,i){return function(r){let o=this[e];l(this._collectionIndicesByEntity)||(this._collectionIndicesByEntity={});let s=this._collectionIndicesByEntity[r.id];if(l(s)||(s=this._collectionIndicesByEntity[r.id]={billboardIndex:void 0,labelIndex:void 0,pointIndex:void 0}),l(o)&&l(s[i]))return o.get(s[i]);l(o)||(o=this[e]=new t({scene:this._scene}));let a,c,u=this[n];u.length>0?(a=u.shift(),c=o.get(a)):(c=o.add(),a=o.length-1),s[i]=a;let f=this;return Promise.resolve().then(function(){f._clusterDirty=!0}),c}}function KK(e,t){let n=e._collectionIndicesByEntity[t];!l(n.billboardIndex)&&!l(n.labelIndex)&&!l(n.pointIndex)&&delete e._collectionIndicesByEntity[t]}tm.prototype.getLabel=XK("_labelCollection",Vp,"_unusedLabelIndices","labelIndex");tm.prototype.removeLabel=function(e){let t=this._collectionIndicesByEntity&&this._collectionIndicesByEntity[e.id];if(!l(this._labelCollection)||!l(t)||!l(t.labelIndex))return;let n=t.labelIndex;t.labelIndex=void 0,KK(this,e.id);let i=this._labelCollection.get(n);i.show=!1,i.text="",i.id=void 0,this._unusedLabelIndices.push(n),this._clusterDirty=!0};tm.prototype.getBillboard=XK("_billboardCollection",Df,"_unusedBillboardIndices","billboardIndex");tm.prototype.removeBillboard=function(e){let t=this._collectionIndicesByEntity&&this._collectionIndicesByEntity[e.id];if(!l(this._billboardCollection)||!l(t)||!l(t.billboardIndex))return;let n=t.billboardIndex;t.billboardIndex=void 0,KK(this,e.id);let i=this._billboardCollection.get(n);i.id=void 0,i.show=!1,i.image=void 0,this._unusedBillboardIndices.push(n),this._clusterDirty=!0};tm.prototype.getPoint=XK("_pointCollection",kv,"_unusedPointIndices","pointIndex");tm.prototype.removePoint=function(e){let t=this._collectionIndicesByEntity&&this._collectionIndicesByEntity[e.id];if(!l(this._pointCollection)||!l(t)||!l(t.pointIndex))return;let n=t.pointIndex;t.pointIndex=void 0,KK(this,e.id);let i=this._pointCollection.get(n);i.show=!1,i.id=void 0,this._unusedPointIndices.push(n),this._clusterDirty=!0};function YK(e){if(!l(e))return;let t=e.length;for(let n=0;n<t;++n)e.get(n).clusterShow=!0}function nqe(e){e.enabled||(l(e._clusterLabelCollection)&&e._clusterLabelCollection.destroy(),l(e._clusterBillboardCollection)&&e._clusterBillboardCollection.destroy(),l(e._clusterPointCollection)&&e._clusterPointCollection.destroy(),e._clusterLabelCollection=void 0,e._clusterBillboardCollection=void 0,e._clusterPointCollection=void 0,YK(e._labelCollection),YK(e._billboardCollection),YK(e._pointCollection))}tm.prototype.update=function(e){if(!this.show)return;let t,n=this._labelCollection;l(n)&&n.length>0&&!n.ready&&(t=e.commandList,e.commandList=[],n.update(e),e.commandList=t);let i=this._billboardCollection;l(i)&&i.length>0&&!i.ready&&(t=e.commandList,e.commandList=[],i.update(e),e.commandList=t),this._enabledDirty&&(this._enabledDirty=!1,nqe(this),this._clusterDirty=!0),this._clusterDirty&&(this._cluster(),this._clusterDirty=l(n)&&!n.ready||l(i)&&!i.ready),l(this._clusterLabelCollection)&&this._clusterLabelCollection.update(e),l(this._clusterBillboardCollection)&&this._clusterBillboardCollection.update(e),l(this._clusterPointCollection)&&this._clusterPointCollection.update(e),l(n)&&n.update(e),l(i)&&i.update(e),l(this._pointCollection)&&this._pointCollection.update(e)};tm.prototype.destroy=function(){l(this._removeEventListener)&&(this._removeEventListener(),this._removeEventListener=void 0),this._labelCollection=this._labelCollection&&this._labelCollection.destroy(),this._billboardCollection=this._billboardCollection&&this._billboardCollection.destroy(),this._pointCollection=this._pointCollection&&this._pointCollection.destroy(),this._clusterLabelCollection=this._clusterLabelCollection&&this._clusterLabelCollection.destroy(),this._clusterBillboardCollection=this._clusterBillboardCollection&&this._clusterBillboardCollection.destroy(),this._clusterPointCollection=this._clusterPointCollection&&this._clusterPointCollection.destroy(),this._labelCollection=void 0,this._billboardCollection=void 0,this._pointCollection=void 0,this._clusterBillboardCollection=void 0,this._clusterLabelCollection=void 0,this._clusterPointCollection=void 0,this._collectionIndicesByEntity=void 0,this._unusedLabelIndices=[],this._unusedBillboardIndices=[],this._unusedPointIndices=[],this._previousClusters=[],this._previousHeight=void 0,this._enabledDirty=!1,this._pixelRangeDirty=!1,this._minimumClusterSizeDirty=!1};var Of=tm;function Ro(e){e=e??H.EMPTY_OBJECT,this.start=l(e.start)?K.clone(e.start):new K,this.stop=l(e.stop)?K.clone(e.stop):new K,this.data=e.data,this.isStartIncluded=e.isStartIncluded??!0,this.isStopIncluded=e.isStopIncluded??!0}Object.defineProperties(Ro.prototype,{isEmpty:{get:function(){let e=K.compare(this.stop,this.start);return e<0||e===0&&(!this.isStartIncluded||!this.isStopIncluded)}}});var Uv={start:void 0,stop:void 0,isStartIncluded:void 0,isStopIncluded:void 0,data:void 0};Ro.fromIso8601=function(e,t){let n=e.iso8601.split("/");if(n.length!==2)throw new pe("options.iso8601 is an invalid ISO 8601 interval.");let i=K.fromIso8601(n[0]),r=K.fromIso8601(n[1]),o=e.isStartIncluded??!0,s=e.isStopIncluded??!0,a=e.data;return l(t)?(t.start=i,t.stop=r,t.isStartIncluded=o,t.isStopIncluded=s,t.data=a,t):(Uv.start=i,Uv.stop=r,Uv.isStartIncluded=o,Uv.isStopIncluded=s,Uv.data=a,new Ro(Uv))};Ro.toIso8601=function(e,t){return`${K.toIso8601(e.start,t)}/${K.toIso8601(e.stop,t)}`};Ro.clone=function(e,t){if(l(e))return l(t)?(t.start=e.start,t.stop=e.stop,t.isStartIncluded=e.isStartIncluded,t.isStopIncluded=e.isStopIncluded,t.data=e.data,t):new Ro(e)};Ro.equals=function(e,t,n){return e===t||l(e)&&l(t)&&(e.isEmpty&&t.isEmpty||e.isStartIncluded===t.isStartIncluded&&e.isStopIncluded===t.isStopIncluded&&K.equals(e.start,t.start)&&K.equals(e.stop,t.stop)&&(e.data===t.data||l(n)&&n(e.data,t.data)))};Ro.equalsEpsilon=function(e,t,n,i){return n=n??0,e===t||l(e)&&l(t)&&(e.isEmpty&&t.isEmpty||e.isStartIncluded===t.isStartIncluded&&e.isStopIncluded===t.isStopIncluded&&K.equalsEpsilon(e.start,t.start,n)&&K.equalsEpsilon(e.stop,t.stop,n)&&(e.data===t.data||l(i)&&i(e.data,t.data)))};Ro.intersect=function(e,t,n,i){if(!l(t))return Ro.clone(Ro.EMPTY,n);let r=e.start,o=e.stop,s=t.start,a=t.stop,c=K.greaterThanOrEquals(s,r)&&K.greaterThanOrEquals(o,s),u=!c&&K.lessThanOrEquals(s,r)&&K.lessThanOrEquals(r,a);if(!c&&!u)return Ro.clone(Ro.EMPTY,n);let f=e.isStartIncluded,d=e.isStopIncluded,p=t.isStartIncluded,g=t.isStopIncluded,m=K.lessThan(o,a);return l(n)||(n=new Ro),n.start=c?s:r,n.isStartIncluded=f&&p||!K.equals(s,r)&&(c&&p||u&&f),n.stop=m?o:a,n.isStopIncluded=m?d:d&&g||!K.equals(a,o)&&g,n.data=l(i)?i(e.data,t.data):e.data,n};Ro.contains=function(e,t){if(e.isEmpty)return!1;let n=K.compare(e.start,t);if(n===0)return e.isStartIncluded;let i=K.compare(t,e.stop);return i===0?e.isStopIncluded:n<0&&i<0};Ro.prototype.clone=function(e){return Ro.clone(this,e)};Ro.prototype.equals=function(e,t){return Ro.equals(this,e,t)};Ro.prototype.equalsEpsilon=function(e,t,n){return Ro.equalsEpsilon(this,e,t,n)};Ro.prototype.toString=function(){return Ro.toIso8601(this)};Ro.EMPTY=Object.freeze(new Ro({start:new K,stop:new K,isStartIncluded:!1,isStopIncluded:!1}));var En=Ro;var ige=Object.freeze(K.fromIso8601("0000-01-01T00:00:00Z")),rge=Object.freeze(K.fromIso8601("9999-12-31T24:00:00Z")),iqe=Object.freeze(new En({start:ige,stop:rge})),rqe={MINIMUM_VALUE:ige,MAXIMUM_VALUE:rge,MAXIMUM_INTERVAL:iqe},nt=rqe;var oge={AUTODETECT:0,ENU:1,INERTIAL:2,VELOCITY:3};Object.freeze(oge);var wg=oge;function $y(e){this._value=void 0,this._hasClone=!1,this._hasEquals=!1,this._definitionChanged=new be,this.setValue(e)}Object.defineProperties($y.prototype,{isConstant:{value:!0},definitionChanged:{get:function(){return this._definitionChanged}}});$y.prototype.getValue=function(e,t){return this._hasClone?this._value.clone(t):this._value};$y.prototype.setValue=function(e){let t=this._value;if(t!==e){let n=l(e),i=n&&typeof e.clone=="function",r=n&&typeof e.equals=="function";(!r||!e.equals(t))&&(this._hasClone=i,this._hasEquals=r,this._value=i?e.clone(this._value):e,this._definitionChanged.raiseEvent(this))}};$y.prototype.equals=function(e){return this===e||e instanceof $y&&(!this._hasEquals&&this._value===e._value||this._hasEquals&&this._value.equals(e._value))};$y.prototype.valueOf=function(){return this._value};$y.prototype.toString=function(){return String(this._value)};var ui=$y;function oqe(e,t,n,i,r){return{configurable:i,get:function(){return this[t]},set:function(o){let s=this[t],a=this[n];l(a)&&(a(),this[n]=void 0),o!==void 0&&(!l(o)||!l(o.getValue))&&l(r)&&(o=r(o)),s!==o&&(this[t]=o,this._definitionChanged.raiseEvent(this,e,o,s)),l(o)&&l(o.definitionChanged)&&(this[n]=o.definitionChanged.addEventListener(function(){this._definitionChanged.raiseEvent(this,e,o,o)},this))}}}function sqe(e){return new ui(e)}function aqe(e,t,n){return oqe(e,`_${e.toString()}`,`_${e.toString()}Subscription`,t??!1,n??sqe)}var me=aqe;function EN(e){this._definitionChanged=new be,this._show=void 0,this._showSubscription=void 0,this._image=void 0,this._imageSubscription=void 0,this._scale=void 0,this._scaleSubscription=void 0,this._pixelOffset=void 0,this._pixelOffsetSubscription=void 0,this._eyeOffset=void 0,this._eyeOffsetSubscription=void 0,this._horizontalOrigin=void 0,this._horizontalOriginSubscription=void 0,this._verticalOrigin=void 0,this._verticalOriginSubscription=void 0,this._heightReference=void 0,this._heightReferenceSubscription=void 0,this._color=void 0,this._colorSubscription=void 0,this._rotation=void 0,this._rotationSubscription=void 0,this._alignedAxis=void 0,this._alignedAxisSubscription=void 0,this._sizeInMeters=void 0,this._sizeInMetersSubscription=void 0,this._width=void 0,this._widthSubscription=void 0,this._height=void 0,this._heightSubscription=void 0,this._scaleByDistance=void 0,this._scaleByDistanceSubscription=void 0,this._translucencyByDistance=void 0,this._translucencyByDistanceSubscription=void 0,this._pixelOffsetScaleByDistance=void 0,this._pixelOffsetScaleByDistanceSubscription=void 0,this._imageSubRegion=void 0,this._imageSubRegionSubscription=void 0,this._distanceDisplayCondition=void 0,this._distanceDisplayConditionSubscription=void 0,this._disableDepthTestDistance=void 0,this._disableDepthTestDistanceSubscription=void 0,this._splitDirection=void 0,this._splitDirectionSubscription=void 0,this.merge(e??H.EMPTY_OBJECT)}Object.defineProperties(EN.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:me("show"),image:me("image"),scale:me("scale"),pixelOffset:me("pixelOffset"),eyeOffset:me("eyeOffset"),horizontalOrigin:me("horizontalOrigin"),verticalOrigin:me("verticalOrigin"),heightReference:me("heightReference"),color:me("color"),rotation:me("rotation"),alignedAxis:me("alignedAxis"),sizeInMeters:me("sizeInMeters"),width:me("width"),height:me("height"),scaleByDistance:me("scaleByDistance"),translucencyByDistance:me("translucencyByDistance"),pixelOffsetScaleByDistance:me("pixelOffsetScaleByDistance"),imageSubRegion:me("imageSubRegion"),distanceDisplayCondition:me("distanceDisplayCondition"),disableDepthTestDistance:me("disableDepthTestDistance"),splitDirection:me("splitDirection")});EN.prototype.clone=function(e){return l(e)?(e.show=this._show,e.image=this._image,e.scale=this._scale,e.pixelOffset=this._pixelOffset,e.eyeOffset=this._eyeOffset,e.horizontalOrigin=this._horizontalOrigin,e.verticalOrigin=this._verticalOrigin,e.heightReference=this._heightReference,e.color=this._color,e.rotation=this._rotation,e.alignedAxis=this._alignedAxis,e.sizeInMeters=this._sizeInMeters,e.width=this._width,e.height=this._height,e.scaleByDistance=this._scaleByDistance,e.translucencyByDistance=this._translucencyByDistance,e.pixelOffsetScaleByDistance=this._pixelOffsetScaleByDistance,e.imageSubRegion=this._imageSubRegion,e.distanceDisplayCondition=this._distanceDisplayCondition,e.disableDepthTestDistance=this._disableDepthTestDistance,e.splitDirection=this._splitDirection,e):new EN(this)};EN.prototype.merge=function(e){this.show=this._show??e.show,this.image=this._image??e.image,this.scale=this._scale??e.scale,this.pixelOffset=this._pixelOffset??e.pixelOffset,this.eyeOffset=this._eyeOffset??e.eyeOffset,this.horizontalOrigin=this._horizontalOrigin??e.horizontalOrigin,this.verticalOrigin=this._verticalOrigin??e.verticalOrigin,this.heightReference=this._heightReference??e.heightReference,this.color=this._color??e.color,this.rotation=this._rotation??e.rotation,this.alignedAxis=this._alignedAxis??e.alignedAxis,this.sizeInMeters=this._sizeInMeters??e.sizeInMeters,this.width=this._width??e.width,this.height=this._height??e.height,this.scaleByDistance=this._scaleByDistance??e.scaleByDistance,this.translucencyByDistance=this._translucencyByDistance??e.translucencyByDistance,this.pixelOffsetScaleByDistance=this._pixelOffsetScaleByDistance??e.pixelOffsetScaleByDistance,this.imageSubRegion=this._imageSubRegion??e.imageSubRegion,this.distanceDisplayCondition=this._distanceDisplayCondition??e.distanceDisplayCondition,this.disableDepthTestDistance=this._disableDepthTestDistance??e.disableDepthTestDistance,this.splitDirection=this.splitDirection??e.splitDirection};var nl=EN;function zv(e){this._definitionChanged=new be,this._color=void 0,this._colorSubscription=void 0,this.color=e}Object.defineProperties(zv.prototype,{isConstant:{get:function(){return X.isConstant(this._color)}},definitionChanged:{get:function(){return this._definitionChanged}},color:me("color")});zv.prototype.getType=function(e){return"Color"};var cqe=new K;zv.prototype.getValue=function(e,t){return l(e)||(e=K.now(cqe)),l(t)||(t={}),t.color=X.getValueOrClonedDefault(this._color,e,z.WHITE,t.color),t};zv.prototype.equals=function(e){return this===e||e instanceof zv&&X.equals(this._color,e._color)};var Kt=zv;var lqe=new U(1,1),uqe=!1,fqe=z.WHITE;function Vv(e){e=e??H.EMPTY_OBJECT,this._definitionChanged=new be,this._image=void 0,this._imageSubscription=void 0,this._repeat=void 0,this._repeatSubscription=void 0,this._color=void 0,this._colorSubscription=void 0,this._transparent=void 0,this._transparentSubscription=void 0,this.image=e.image,this.repeat=e.repeat,this.color=e.color,this.transparent=e.transparent}Object.defineProperties(Vv.prototype,{isConstant:{get:function(){return X.isConstant(this._image)&&X.isConstant(this._repeat)}},definitionChanged:{get:function(){return this._definitionChanged}},image:me("image"),repeat:me("repeat"),color:me("color"),transparent:me("transparent")});Vv.prototype.getType=function(e){return"Image"};var dqe=new K;Vv.prototype.getValue=function(e,t){return l(e)||(e=K.now(dqe)),l(t)||(t={}),t.image=X.getValueOrUndefined(this._image,e),t.repeat=X.getValueOrClonedDefault(this._repeat,e,lqe,t.repeat),t.color=X.getValueOrClonedDefault(this._color,e,fqe,t.color),X.getValueOrDefault(this._transparent,e,uqe)&&(t.color.alpha=Math.min(.99,t.color.alpha)),t};Vv.prototype.equals=function(e){return this===e||e instanceof Vv&&X.equals(this._image,e._image)&&X.equals(this._repeat,e._repeat)&&X.equals(this._color,e._color)&&X.equals(this._transparent,e._transparent)};var Jy=Vv;function hqe(e){if(e instanceof z)return new Kt(e);if(typeof e=="string"||e instanceof De||e instanceof HTMLCanvasElement||e instanceof HTMLVideoElement){let t=new Jy;return t.image=e,t}}function mqe(e,t){return me(e,t,hqe)}var ro=mqe;function CN(e){this._definitionChanged=new be,this._show=void 0,this._showSubscription=void 0,this._dimensions=void 0,this._dimensionsSubscription=void 0,this._heightReference=void 0,this._heightReferenceSubscription=void 0,this._fill=void 0,this._fillSubscription=void 0,this._material=void 0,this._materialSubscription=void 0,this._outline=void 0,this._outlineSubscription=void 0,this._outlineColor=void 0,this._outlineColorSubscription=void 0,this._outlineWidth=void 0,this._outlineWidthSubscription=void 0,this._shadows=void 0,this._shadowsSubscription=void 0,this._distanceDisplayCondition=void 0,this._distanceDisplayConditionSubscription=void 0,this.merge(e??H.EMPTY_OBJECT)}Object.defineProperties(CN.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:me("show"),dimensions:me("dimensions"),heightReference:me("heightReference"),fill:me("fill"),material:ro("material"),outline:me("outline"),outlineColor:me("outlineColor"),outlineWidth:me("outlineWidth"),shadows:me("shadows"),distanceDisplayCondition:me("distanceDisplayCondition")});CN.prototype.clone=function(e){return l(e)?(e.show=this.show,e.dimensions=this.dimensions,e.heightReference=this.heightReference,e.fill=this.fill,e.material=this.material,e.outline=this.outline,e.outlineColor=this.outlineColor,e.outlineWidth=this.outlineWidth,e.shadows=this.shadows,e.distanceDisplayCondition=this.distanceDisplayCondition,e):new CN(this)};CN.prototype.merge=function(e){this.show=this.show??e.show,this.dimensions=this.dimensions??e.dimensions,this.heightReference=this.heightReference??e.heightReference,this.fill=this.fill??e.fill,this.material=this.material??e.material,this.outline=this.outline??e.outline,this.outlineColor=this.outlineColor??e.outlineColor,this.outlineWidth=this.outlineWidth??e.outlineWidth,this.shadows=this.shadows??e.shadows,this.distanceDisplayCondition=this.distanceDisplayCondition??e.distanceDisplayCondition};var kx=CN;var sge={FIXED:0,INERTIAL:1};Object.freeze(sge);var ji=sge;function jv(){pe.throwInstantiationError()}Object.defineProperties(jv.prototype,{isConstant:{get:pe.throwInstantiationError},definitionChanged:{get:pe.throwInstantiationError},referenceFrame:{get:pe.throwInstantiationError}});jv.prototype.getValue=pe.throwInstantiationError;jv.prototype.getValueInReferenceFrame=pe.throwInstantiationError;jv.prototype.equals=pe.throwInstantiationError;var age=new $;jv.convertToReferenceFrame=function(e,t,n,i,r){if(!l(t))return t;if(l(r)||(r=new h),n===i)return h.clone(t,r);let o=At.computeIcrfToCentralBodyFixedMatrix(e,age);if(n===ji.INERTIAL)return $.multiplyByVector(o,t,r);if(n===ji.FIXED)return $.multiplyByVector($.transpose(o,age),t,r)};var nm=jv;function Ux(e,t){this._definitionChanged=new be,this._value=h.clone(e),this._referenceFrame=t??ji.FIXED}Object.defineProperties(Ux.prototype,{isConstant:{get:function(){return!l(this._value)||this._referenceFrame===ji.FIXED}},definitionChanged:{get:function(){return this._definitionChanged}},referenceFrame:{get:function(){return this._referenceFrame}}});var pqe=new K;Ux.prototype.getValue=function(e,t){return l(e)||(e=K.now(pqe)),this.getValueInReferenceFrame(e,ji.FIXED,t)};Ux.prototype.setValue=function(e,t){let n=!1;h.equals(this._value,e)||(n=!0,this._value=h.clone(e)),l(t)&&this._referenceFrame!==t&&(n=!0,this._referenceFrame=t),n&&this._definitionChanged.raiseEvent(this)};Ux.prototype.getValueInReferenceFrame=function(e,t,n){return nm.convertToReferenceFrame(e,this._value,this._referenceFrame,t,n)};Ux.prototype.equals=function(e){return this===e||e instanceof Ux&&h.equals(this._value,e._value)&&this._referenceFrame===e._referenceFrame};var Kl=Ux;function vN(e){this._definitionChanged=new be,this._show=void 0,this._showSubscription=void 0,this._positions=void 0,this._positionsSubscription=void 0,this._width=void 0,this._widthSubscription=void 0,this._height=void 0,this._heightSubscription=void 0,this._heightReference=void 0,this._heightReferenceSubscription=void 0,this._extrudedHeight=void 0,this._extrudedHeightSubscription=void 0,this._extrudedHeightReference=void 0,this._extrudedHeightReferenceSubscription=void 0,this._cornerType=void 0,this._cornerTypeSubscription=void 0,this._granularity=void 0,this._granularitySubscription=void 0,this._fill=void 0,this._fillSubscription=void 0,this._material=void 0,this._materialSubscription=void 0,this._outline=void 0,this._outlineSubscription=void 0,this._outlineColor=void 0,this._outlineColorSubscription=void 0,this._outlineWidth=void 0,this._outlineWidthSubscription=void 0,this._shadows=void 0,this._shadowsSubscription=void 0,this._distanceDisplayCondition=void 0,this._distanceDisplayConditionSubscription=void 0,this._classificationType=void 0,this._classificationTypeSubscription=void 0,this._zIndex=void 0,this._zIndexSubscription=void 0,this.merge(e??H.EMPTY_OBJECT)}Object.defineProperties(vN.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:me("show"),positions:me("positions"),width:me("width"),height:me("height"),heightReference:me("heightReference"),extrudedHeight:me("extrudedHeight"),extrudedHeightReference:me("extrudedHeightReference"),cornerType:me("cornerType"),granularity:me("granularity"),fill:me("fill"),material:ro("material"),outline:me("outline"),outlineColor:me("outlineColor"),outlineWidth:me("outlineWidth"),shadows:me("shadows"),distanceDisplayCondition:me("distanceDisplayCondition"),classificationType:me("classificationType"),zIndex:me("zIndex")});vN.prototype.clone=function(e){return l(e)?(e.show=this.show,e.positions=this.positions,e.width=this.width,e.height=this.height,e.heightReference=this.heightReference,e.extrudedHeight=this.extrudedHeight,e.extrudedHeightReference=this.extrudedHeightReference,e.cornerType=this.cornerType,e.granularity=this.granularity,e.fill=this.fill,e.material=this.material,e.outline=this.outline,e.outlineColor=this.outlineColor,e.outlineWidth=this.outlineWidth,e.shadows=this.shadows,e.distanceDisplayCondition=this.distanceDisplayCondition,e.classificationType=this.classificationType,e.zIndex=this.zIndex,e):new vN(this)};vN.prototype.merge=function(e){this.show=this.show??e.show,this.positions=this.positions??e.positions,this.width=this.width??e.width,this.height=this.height??e.height,this.heightReference=this.heightReference??e.heightReference,this.extrudedHeight=this.extrudedHeight??e.extrudedHeight,this.extrudedHeightReference=this.extrudedHeightReference??e.extrudedHeightReference,this.cornerType=this.cornerType??e.cornerType,this.granularity=this.granularity??e.granularity,this.fill=this.fill??e.fill,this.material=this.material??e.material,this.outline=this.outline??e.outline,this.outlineColor=this.outlineColor??e.outlineColor,this.outlineWidth=this.outlineWidth??e.outlineWidth,this.shadows=this.shadows??e.shadows,this.distanceDisplayCondition=this.distanceDisplayCondition??e.distanceDisplayCondition,this.classificationType=this.classificationType??e.classificationType,this.zIndex=this.zIndex??e.zIndex};var zx=vN;function gqe(e){return e}function _qe(e,t){return me(e,t,gqe)}var $l=_qe;function SN(e){this._definitionChanged=new be,this._show=void 0,this._showSubscription=void 0,this._length=void 0,this._lengthSubscription=void 0,this._topRadius=void 0,this._topRadiusSubscription=void 0,this._bottomRadius=void 0,this._bottomRadiusSubscription=void 0,this._heightReference=void 0,this._heightReferenceSubscription=void 0,this._fill=void 0,this._fillSubscription=void 0,this._material=void 0,this._materialSubscription=void 0,this._outline=void 0,this._outlineSubscription=void 0,this._outlineColor=void 0,this._outlineColorSubscription=void 0,this._outlineWidth=void 0,this._outlineWidthSubscription=void 0,this._numberOfVerticalLines=void 0,this._numberOfVerticalLinesSubscription=void 0,this._slices=void 0,this._slicesSubscription=void 0,this._shadows=void 0,this._shadowsSubscription=void 0,this._distanceDisplayCondition=void 0,this._distanceDisplayConditionSubscription=void 0,this.merge(e??H.EMPTY_OBJECT)}Object.defineProperties(SN.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:me("show"),length:me("length"),topRadius:me("topRadius"),bottomRadius:me("bottomRadius"),heightReference:me("heightReference"),fill:me("fill"),material:ro("material"),outline:me("outline"),outlineColor:me("outlineColor"),outlineWidth:me("outlineWidth"),numberOfVerticalLines:me("numberOfVerticalLines"),slices:me("slices"),shadows:me("shadows"),distanceDisplayCondition:me("distanceDisplayCondition")});SN.prototype.clone=function(e){return l(e)?(e.show=this.show,e.length=this.length,e.topRadius=this.topRadius,e.bottomRadius=this.bottomRadius,e.heightReference=this.heightReference,e.fill=this.fill,e.material=this.material,e.outline=this.outline,e.outlineColor=this.outlineColor,e.outlineWidth=this.outlineWidth,e.numberOfVerticalLines=this.numberOfVerticalLines,e.slices=this.slices,e.shadows=this.shadows,e.distanceDisplayCondition=this.distanceDisplayCondition,e):new SN(this)};SN.prototype.merge=function(e){this.show=this.show??e.show,this.length=this.length??e.length,this.topRadius=this.topRadius??e.topRadius,this.bottomRadius=this.bottomRadius??e.bottomRadius,this.heightReference=this.heightReference??e.heightReference,this.fill=this.fill??e.fill,this.material=this.material??e.material,this.outline=this.outline??e.outline,this.outlineColor=this.outlineColor??e.outlineColor,this.outlineWidth=this.outlineWidth??e.outlineWidth,this.numberOfVerticalLines=this.numberOfVerticalLines??e.numberOfVerticalLines,this.slices=this.slices??e.slices,this.shadows=this.shadows??e.shadows,this.distanceDisplayCondition=this.distanceDisplayCondition??e.distanceDisplayCondition};var Vx=SN;function wN(e){this._definitionChanged=new be,this._show=void 0,this._showSubscription=void 0,this._semiMajorAxis=void 0,this._semiMajorAxisSubscription=void 0,this._semiMinorAxis=void 0,this._semiMinorAxisSubscription=void 0,this._height=void 0,this._heightSubscription=void 0,this._heightReference=void 0,this._heightReferenceSubscription=void 0,this._extrudedHeight=void 0,this._extrudedHeightSubscription=void 0,this._extrudedHeightReference=void 0,this._extrudedHeightReferenceSubscription=void 0,this._rotation=void 0,this._rotationSubscription=void 0,this._stRotation=void 0,this._stRotationSubscription=void 0,this._granularity=void 0,this._granularitySubscription=void 0,this._fill=void 0,this._fillSubscription=void 0,this._material=void 0,this._materialSubscription=void 0,this._outline=void 0,this._outlineSubscription=void 0,this._outlineColor=void 0,this._outlineColorSubscription=void 0,this._outlineWidth=void 0,this._outlineWidthSubscription=void 0,this._numberOfVerticalLines=void 0,this._numberOfVerticalLinesSubscription=void 0,this._shadows=void 0,this._shadowsSubscription=void 0,this._distanceDisplayCondition=void 0,this._distanceDisplayConditionSubscription=void 0,this._classificationType=void 0,this._classificationTypeSubscription=void 0,this._zIndex=void 0,this._zIndexSubscription=void 0,this.merge(e??H.EMPTY_OBJECT)}Object.defineProperties(wN.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:me("show"),semiMajorAxis:me("semiMajorAxis"),semiMinorAxis:me("semiMinorAxis"),height:me("height"),heightReference:me("heightReference"),extrudedHeight:me("extrudedHeight"),extrudedHeightReference:me("extrudedHeightReference"),rotation:me("rotation"),stRotation:me("stRotation"),granularity:me("granularity"),fill:me("fill"),material:ro("material"),outline:me("outline"),outlineColor:me("outlineColor"),outlineWidth:me("outlineWidth"),numberOfVerticalLines:me("numberOfVerticalLines"),shadows:me("shadows"),distanceDisplayCondition:me("distanceDisplayCondition"),classificationType:me("classificationType"),zIndex:me("zIndex")});wN.prototype.clone=function(e){return l(e)?(e.show=this.show,e.semiMajorAxis=this.semiMajorAxis,e.semiMinorAxis=this.semiMinorAxis,e.height=this.height,e.heightReference=this.heightReference,e.extrudedHeight=this.extrudedHeight,e.extrudedHeightReference=this.extrudedHeightReference,e.rotation=this.rotation,e.stRotation=this.stRotation,e.granularity=this.granularity,e.fill=this.fill,e.material=this.material,e.outline=this.outline,e.outlineColor=this.outlineColor,e.outlineWidth=this.outlineWidth,e.numberOfVerticalLines=this.numberOfVerticalLines,e.shadows=this.shadows,e.distanceDisplayCondition=this.distanceDisplayCondition,e.classificationType=this.classificationType,e.zIndex=this.zIndex,e):new wN(this)};wN.prototype.merge=function(e){this.show=this.show??e.show,this.semiMajorAxis=this.semiMajorAxis??e.semiMajorAxis,this.semiMinorAxis=this.semiMinorAxis??e.semiMinorAxis,this.height=this.height??e.height,this.heightReference=this.heightReference??e.heightReference,this.extrudedHeight=this.extrudedHeight??e.extrudedHeight,this.extrudedHeightReference=this.extrudedHeightReference??e.extrudedHeightReference,this.rotation=this.rotation??e.rotation,this.stRotation=this.stRotation??e.stRotation,this.granularity=this.granularity??e.granularity,this.fill=this.fill??e.fill,this.material=this.material??e.material,this.outline=this.outline??e.outline,this.outlineColor=this.outlineColor??e.outlineColor,this.outlineWidth=this.outlineWidth??e.outlineWidth,this.numberOfVerticalLines=this.numberOfVerticalLines??e.numberOfVerticalLines,this.shadows=this.shadows??e.shadows,this.distanceDisplayCondition=this.distanceDisplayCondition??e.distanceDisplayCondition,this.classificationType=this.classificationType??e.classificationType,this.zIndex=this.zIndex??e.zIndex};var jx=wN;function IN(e){this._definitionChanged=new be,this._show=void 0,this._showSubscription=void 0,this._radii=void 0,this._radiiSubscription=void 0,this._innerRadii=void 0,this._innerRadiiSubscription=void 0,this._minimumClock=void 0,this._minimumClockSubscription=void 0,this._maximumClock=void 0,this._maximumClockSubscription=void 0,this._minimumCone=void 0,this._minimumConeSubscription=void 0,this._maximumCone=void 0,this._maximumConeSubscription=void 0,this._heightReference=void 0,this._heightReferenceSubscription=void 0,this._fill=void 0,this._fillSubscription=void 0,this._material=void 0,this._materialSubscription=void 0,this._outline=void 0,this._outlineSubscription=void 0,this._outlineColor=void 0,this._outlineColorSubscription=void 0,this._outlineWidth=void 0,this._outlineWidthSubscription=void 0,this._stackPartitions=void 0,this._stackPartitionsSubscription=void 0,this._slicePartitions=void 0,this._slicePartitionsSubscription=void 0,this._subdivisions=void 0,this._subdivisionsSubscription=void 0,this._shadows=void 0,this._shadowsSubscription=void 0,this._distanceDisplayCondition=void 0,this._distanceDisplayConditionSubscription=void 0,this.merge(e??H.EMPTY_OBJECT)}Object.defineProperties(IN.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:me("show"),radii:me("radii"),innerRadii:me("innerRadii"),minimumClock:me("minimumClock"),maximumClock:me("maximumClock"),minimumCone:me("minimumCone"),maximumCone:me("maximumCone"),heightReference:me("heightReference"),fill:me("fill"),material:ro("material"),outline:me("outline"),outlineColor:me("outlineColor"),outlineWidth:me("outlineWidth"),stackPartitions:me("stackPartitions"),slicePartitions:me("slicePartitions"),subdivisions:me("subdivisions"),shadows:me("shadows"),distanceDisplayCondition:me("distanceDisplayCondition")});IN.prototype.clone=function(e){return l(e)?(e.show=this.show,e.radii=this.radii,e.innerRadii=this.innerRadii,e.minimumClock=this.minimumClock,e.maximumClock=this.maximumClock,e.minimumCone=this.minimumCone,e.maximumCone=this.maximumCone,e.heightReference=this.heightReference,e.fill=this.fill,e.material=this.material,e.outline=this.outline,e.outlineColor=this.outlineColor,e.outlineWidth=this.outlineWidth,e.stackPartitions=this.stackPartitions,e.slicePartitions=this.slicePartitions,e.subdivisions=this.subdivisions,e.shadows=this.shadows,e.distanceDisplayCondition=this.distanceDisplayCondition,e):new IN(this)};IN.prototype.merge=function(e){this.show=this.show??e.show,this.radii=this.radii??e.radii,this.innerRadii=this.innerRadii??e.innerRadii,this.minimumClock=this.minimumClock??e.minimumClock,this.maximumClock=this.maximumClock??e.maximumClock,this.minimumCone=this.minimumCone??e.minimumCone,this.maximumCone=this.maximumCone??e.maximumCone,this.heightReference=this.heightReference??e.heightReference,this.fill=this.fill??e.fill,this.material=this.material??e.material,this.outline=this.outline??e.outline,this.outlineColor=this.outlineColor??e.outlineColor,this.outlineWidth=this.outlineWidth??e.outlineWidth,this.stackPartitions=this.stackPartitions??e.stackPartitions,this.slicePartitions=this.slicePartitions??e.slicePartitions,this.subdivisions=this.subdivisions??e.subdivisions,this.shadows=this.shadows??e.shadows,this.distanceDisplayCondition=this.distanceDisplayCondition??e.distanceDisplayCondition};var Hx=IN;function PN(e){this._definitionChanged=new be,this._show=void 0,this._showSubscription=void 0,this._text=void 0,this._textSubscription=void 0,this._font=void 0,this._fontSubscription=void 0,this._style=void 0,this._styleSubscription=void 0,this._scale=void 0,this._scaleSubscription=void 0,this._showBackground=void 0,this._showBackgroundSubscription=void 0,this._backgroundColor=void 0,this._backgroundColorSubscription=void 0,this._backgroundPadding=void 0,this._backgroundPaddingSubscription=void 0,this._pixelOffset=void 0,this._pixelOffsetSubscription=void 0,this._eyeOffset=void 0,this._eyeOffsetSubscription=void 0,this._horizontalOrigin=void 0,this._horizontalOriginSubscription=void 0,this._verticalOrigin=void 0,this._verticalOriginSubscription=void 0,this._heightReference=void 0,this._heightReferenceSubscription=void 0,this._fillColor=void 0,this._fillColorSubscription=void 0,this._outlineColor=void 0,this._outlineColorSubscription=void 0,this._outlineWidth=void 0,this._outlineWidthSubscription=void 0,this._translucencyByDistance=void 0,this._translucencyByDistanceSubscription=void 0,this._pixelOffsetScaleByDistance=void 0,this._pixelOffsetScaleByDistanceSubscription=void 0,this._scaleByDistance=void 0,this._scaleByDistanceSubscription=void 0,this._distanceDisplayCondition=void 0,this._distanceDisplayConditionSubscription=void 0,this._disableDepthTestDistance=void 0,this._disableDepthTestDistanceSubscription=void 0,this.merge(e??H.EMPTY_OBJECT)}Object.defineProperties(PN.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:me("show"),text:me("text"),font:me("font"),style:me("style"),scale:me("scale"),showBackground:me("showBackground"),backgroundColor:me("backgroundColor"),backgroundPadding:me("backgroundPadding"),pixelOffset:me("pixelOffset"),eyeOffset:me("eyeOffset"),horizontalOrigin:me("horizontalOrigin"),verticalOrigin:me("verticalOrigin"),heightReference:me("heightReference"),fillColor:me("fillColor"),outlineColor:me("outlineColor"),outlineWidth:me("outlineWidth"),translucencyByDistance:me("translucencyByDistance"),pixelOffsetScaleByDistance:me("pixelOffsetScaleByDistance"),scaleByDistance:me("scaleByDistance"),distanceDisplayCondition:me("distanceDisplayCondition"),disableDepthTestDistance:me("disableDepthTestDistance")});PN.prototype.clone=function(e){return l(e)?(e.show=this.show,e.text=this.text,e.font=this.font,e.style=this.style,e.scale=this.scale,e.showBackground=this.showBackground,e.backgroundColor=this.backgroundColor,e.backgroundPadding=this.backgroundPadding,e.pixelOffset=this.pixelOffset,e.eyeOffset=this.eyeOffset,e.horizontalOrigin=this.horizontalOrigin,e.verticalOrigin=this.verticalOrigin,e.heightReference=this.heightReference,e.fillColor=this.fillColor,e.outlineColor=this.outlineColor,e.outlineWidth=this.outlineWidth,e.translucencyByDistance=this.translucencyByDistance,e.pixelOffsetScaleByDistance=this.pixelOffsetScaleByDistance,e.scaleByDistance=this.scaleByDistance,e.distanceDisplayCondition=this.distanceDisplayCondition,e.disableDepthTestDistance=this.disableDepthTestDistance,e):new PN(this)};PN.prototype.merge=function(e){this.show=this.show??e.show,this.text=this.text??e.text,this.font=this.font??e.font,this.style=this.style??e.style,this.scale=this.scale??e.scale,this.showBackground=this.showBackground??e.showBackground,this.backgroundColor=this.backgroundColor??e.backgroundColor,this.backgroundPadding=this.backgroundPadding??e.backgroundPadding,this.pixelOffset=this.pixelOffset??e.pixelOffset,this.eyeOffset=this.eyeOffset??e.eyeOffset,this.horizontalOrigin=this.horizontalOrigin??e.horizontalOrigin,this.verticalOrigin=this.verticalOrigin??e.verticalOrigin,this.heightReference=this.heightReference??e.heightReference,this.fillColor=this.fillColor??e.fillColor,this.outlineColor=this.outlineColor??e.outlineColor,this.outlineWidth=this.outlineWidth??e.outlineWidth,this.translucencyByDistance=this.translucencyByDistance??e.translucencyByDistance,this.pixelOffsetScaleByDistance=this.pixelOffsetScaleByDistance??e.pixelOffsetScaleByDistance,this.scaleByDistance=this.scaleByDistance??e.scaleByDistance,this.distanceDisplayCondition=this.distanceDisplayCondition??e.distanceDisplayCondition,this.disableDepthTestDistance=this.disableDepthTestDistance??e.disableDepthTestDistance};var im=PN;var yqe=new h(1,1,1),Aqe=h.ZERO,bqe=Le.IDENTITY;function cge(e,t,n){this.translation=h.clone(e??Aqe),this.rotation=Le.clone(t??bqe),this.scale=h.clone(n??yqe)}cge.prototype.equals=function(e){return this===e||l(e)&&h.equals(this.translation,e.translation)&&Le.equals(this.rotation,e.rotation)&&h.equals(this.scale,e.scale)};var Zy=cge;var $K=new Zy;function DN(e){e=e??H.EMPTY_OBJECT,this._definitionChanged=new be,this._translation=void 0,this._translationSubscription=void 0,this._rotation=void 0,this._rotationSubscription=void 0,this._scale=void 0,this._scaleSubscription=void 0,this.translation=e.translation,this.rotation=e.rotation,this.scale=e.scale}Object.defineProperties(DN.prototype,{isConstant:{get:function(){return X.isConstant(this._translation)&&X.isConstant(this._rotation)&&X.isConstant(this._scale)}},definitionChanged:{get:function(){return this._definitionChanged}},translation:me("translation"),rotation:me("rotation"),scale:me("scale")});var xqe=new K;DN.prototype.getValue=function(e,t){return l(e)||(e=K.now(xqe)),l(t)||(t=new Zy),t.translation=X.getValueOrClonedDefault(this._translation,e,$K.translation,t.translation),t.rotation=X.getValueOrClonedDefault(this._rotation,e,$K.rotation,t.rotation),t.scale=X.getValueOrClonedDefault(this._scale,e,$K.scale,t.scale),t};DN.prototype.equals=function(e){return this===e||e instanceof DN&&X.equals(this._translation,e._translation)&&X.equals(this._rotation,e._rotation)&&X.equals(this._scale,e._scale)};var Gx=DN;function Ig(e,t){this._propertyNames=[],this._definitionChanged=new be,l(e)&&this.merge(e,t)}Object.defineProperties(Ig.prototype,{propertyNames:{get:function(){return this._propertyNames}},isConstant:{get:function(){let e=this._propertyNames;for(let t=0,n=e.length;t<n;t++)if(!X.isConstant(this[e[t]]))return!1;return!0}},definitionChanged:{get:function(){return this._definitionChanged}}});Ig.prototype.hasProperty=function(e){return this._propertyNames.indexOf(e)!==-1};function Tqe(e){return new ui(e)}Ig.prototype.addProperty=function(e,t,n){this._propertyNames.push(e),Object.defineProperty(this,e,me(e,!0,n??Tqe)),l(t)&&(this[e]=t),this._definitionChanged.raiseEvent(this)};Ig.prototype.removeProperty=function(e){let n=this._propertyNames.indexOf(e);this._propertyNames.splice(n,1),delete this[e],this._definitionChanged.raiseEvent(this)};var Eqe=new K;Ig.prototype.getValue=function(e,t){l(e)||(e=K.now(Eqe)),l(t)||(t={});let n=this._propertyNames;for(let i=0,r=n.length;i<r;i++){let o=n[i];t[o]=X.getValueOrUndefined(this[o],e,t[o])}return t};Ig.prototype.merge=function(e,t){let n=this._propertyNames,i=l(e._propertyNames)?e._propertyNames:Object.keys(e);for(let r=0,o=i.length;r<o;r++){let s=i[r],a=this[s],c=e[s];a===void 0&&n.indexOf(s)===-1&&this.addProperty(s,void 0,t),c!==void 0&&(a!==void 0?l(a)&&l(a.merge)&&a.merge(c):l(c)&&l(c.merge)&&l(c.clone)?this[s]=c.clone():this[s]=c)}};function Cqe(e,t){let n=e._propertyNames,i=t._propertyNames,r=n.length;if(r!==i.length)return!1;for(let o=0;o<r;++o){let s=n[o];if(i.indexOf(s)===-1||!X.equals(e[s],t[s]))return!1}return!0}Ig.prototype.equals=function(e){return this===e||e instanceof Ig&&Cqe(this,e)};var Jl=Ig;function lge(e){return new Gx(e)}function vqe(e){return new Jl(e,lge)}function Sqe(e){return new Jl(e)}function wqe(e){return new Jl(e)}function RN(e){this._definitionChanged=new be,this._show=void 0,this._showSubscription=void 0,this._uri=void 0,this._uriSubscription=void 0,this._scale=void 0,this._scaleSubscription=void 0,this._hasVerticalExaggeration=void 0,this._hasVerticalExaggerationSubscription=void 0,this._enableVerticalExaggeration=void 0,this._enableVerticalExaggerationSubscription=void 0,this._minimumPixelSize=void 0,this._minimumPixelSizeSubscription=void 0,this._maximumScale=void 0,this._maximumScaleSubscription=void 0,this._incrementallyLoadTextures=void 0,this._incrementallyLoadTexturesSubscription=void 0,this._runAnimations=void 0,this._runAnimationsSubscription=void 0,this._clampAnimations=void 0,this._clampAnimationsSubscription=void 0,this._shadows=void 0,this._shadowsSubscription=void 0,this._heightReference=void 0,this._heightReferenceSubscription=void 0,this._silhouetteColor=void 0,this._silhouetteColorSubscription=void 0,this._silhouetteSize=void 0,this._silhouetteSizeSubscription=void 0,this._color=void 0,this._colorSubscription=void 0,this._colorBlendMode=void 0,this._colorBlendModeSubscription=void 0,this._colorBlendAmount=void 0,this._colorBlendAmountSubscription=void 0,this._imageBasedLightingFactor=void 0,this._imageBasedLightingFactorSubscription=void 0,this._environmentMapOptions=void 0,this._environmentMapOptionsSubscription=void 0,this._lightColor=void 0,this._lightColorSubscription=void 0,this._distanceDisplayCondition=void 0,this._distanceDisplayConditionSubscription=void 0,this._nodeTransformations=void 0,this._nodeTransformationsSubscription=void 0,this._articulations=void 0,this._articulationsSubscription=void 0,this._clippingPlanes=void 0,this._clippingPlanesSubscription=void 0,this._customShader=void 0,this._customShaderSubscription=void 0,this.merge(e??H.EMPTY_OBJECT)}Object.defineProperties(RN.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:me("show"),uri:me("uri"),scale:me("scale"),enableVerticalExaggeration:me("enableVerticalExaggeration"),minimumPixelSize:me("minimumPixelSize"),maximumScale:me("maximumScale"),incrementallyLoadTextures:me("incrementallyLoadTextures"),runAnimations:me("runAnimations"),clampAnimations:me("clampAnimations"),shadows:me("shadows"),heightReference:me("heightReference"),silhouetteColor:me("silhouetteColor"),silhouetteSize:me("silhouetteSize"),color:me("color"),colorBlendMode:me("colorBlendMode"),colorBlendAmount:me("colorBlendAmount"),imageBasedLightingFactor:me("imageBasedLightingFactor"),environmentMapOptions:me("environmentMapOptions",void 0,wqe),lightColor:me("lightColor"),distanceDisplayCondition:me("distanceDisplayCondition"),nodeTransformations:me("nodeTransformations",void 0,vqe),articulations:me("articulations",void 0,Sqe),clippingPlanes:me("clippingPlanes"),customShader:me("customShader")});RN.prototype.clone=function(e){return l(e)?(e.show=this.show,e.uri=this.uri,e.scale=this.scale,e.enableVerticalExaggeration=this.enableVerticalExaggeration,e.minimumPixelSize=this.minimumPixelSize,e.maximumScale=this.maximumScale,e.incrementallyLoadTextures=this.incrementallyLoadTextures,e.runAnimations=this.runAnimations,e.clampAnimations=this.clampAnimations,e.heightReference=this._heightReference,e.silhouetteColor=this.silhouetteColor,e.silhouetteSize=this.silhouetteSize,e.color=this.color,e.colorBlendMode=this.colorBlendMode,e.colorBlendAmount=this.colorBlendAmount,e.imageBasedLightingFactor=this.imageBasedLightingFactor,e.environmentMapOptions=this.environmentMapOptions,e.lightColor=this.lightColor,e.distanceDisplayCondition=this.distanceDisplayCondition,e.nodeTransformations=this.nodeTransformations,e.articulations=this.articulations,e.clippingPlanes=this.clippingPlanes,e.customShader=this.customShader,e):new RN(this)};RN.prototype.merge=function(e){this.show=this.show??e.show,this.uri=this.uri??e.uri,this.scale=this.scale??e.scale,this.enableVerticalExaggeration=this.enableVerticalExaggeration??e.enableVerticalExaggeration,this.minimumPixelSize=this.minimumPixelSize??e.minimumPixelSize,this.maximumScale=this.maximumScale??e.maximumScale,this.incrementallyLoadTextures=this.incrementallyLoadTextures??e.incrementallyLoadTextures,this.runAnimations=this.runAnimations??e.runAnimations,this.clampAnimations=this.clampAnimations??e.clampAnimations,this.shadows=this.shadows??e.shadows,this.heightReference=this.heightReference??e.heightReference,this.silhouetteColor=this.silhouetteColor??e.silhouetteColor,this.silhouetteSize=this.silhouetteSize??e.silhouetteSize,this.color=this.color??e.color,this.colorBlendMode=this.colorBlendMode??e.colorBlendMode,this.colorBlendAmount=this.colorBlendAmount??e.colorBlendAmount,this.imageBasedLightingFactor=this.imageBasedLightingFactor??e.imageBasedLightingFactor,this.environmentMapOptions=this.environmentMapOptions??e.environmentMapOptions,this.lightColor=this.lightColor??e.lightColor,this.distanceDisplayCondition=this.distanceDisplayCondition??e.distanceDisplayCondition,this.clippingPlanes=this.clippingPlanes??e.clippingPlanes,this.customShader=this.customShader??e.customShader;let t=e.nodeTransformations;if(l(t)){let i=this.nodeTransformations;l(i)?i.merge(t):this.nodeTransformations=new Jl(t,lge)}let n=e.articulations;if(l(n)){let i=this.articulations;l(i)?i.merge(n):this.articulations=new Jl(n)}};var Pg=RN;function ON(e){this._definitionChanged=new be,this._show=void 0,this._showSubscription=void 0,this._uri=void 0,this._uriSubscription=void 0,this._maximumScreenSpaceError=void 0,this._maximumScreenSpaceErrorSubscription=void 0,this.merge(e??H.EMPTY_OBJECT)}Object.defineProperties(ON.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:me("show"),uri:me("uri"),maximumScreenSpaceError:me("maximumScreenSpaceError")});ON.prototype.clone=function(e){return l(e)?(e.show=this.show,e.uri=this.uri,e.maximumScreenSpaceError=this.maximumScreenSpaceError,e):new ON(this)};ON.prototype.merge=function(e){this.show=this.show??e.show,this.uri=this.uri??e.uri,this.maximumScreenSpaceError=this.maximumScreenSpaceError??e.maximumScreenSpaceError};var Wx=ON;function MN(e){this._definitionChanged=new be,this._show=void 0,this._showSubscription=void 0,this._leadTime=void 0,this._leadTimeSubscription=void 0,this._trailTime=void 0,this._trailTimeSubscription=void 0,this._width=void 0,this._widthSubscription=void 0,this._resolution=void 0,this._resolutionSubscription=void 0,this._material=void 0,this._materialSubscription=void 0,this._distanceDisplayCondition=void 0,this._distanceDisplayConditionSubscription=void 0,this._relativeTo=void 0,this._relativeToSubscription=void 0,this._materialMode=void 0,this._materialModeSubscription=void 0,this.merge(e??H.EMPTY_OBJECT)}Object.defineProperties(MN.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:me("show"),leadTime:me("leadTime"),trailTime:me("trailTime"),width:me("width"),resolution:me("resolution"),material:ro("material"),distanceDisplayCondition:me("distanceDisplayCondition"),relativeTo:me("relativeTo"),materialMode:me("materialMode")});MN.prototype.clone=function(e){return l(e)?(e.show=this.show,e.leadTime=this.leadTime,e.trailTime=this.trailTime,e.width=this.width,e.resolution=this.resolution,e.material=this.material,e.distanceDisplayCondition=this.distanceDisplayCondition,e.relativeTo=this.relativeTo,e.materialMode=this.materialMode,e):new MN(this)};MN.prototype.merge=function(e){this.show=this.show??e.show,this.leadTime=this.leadTime??e.leadTime,this.trailTime=this.trailTime??e.trailTime,this.width=this.width??e.width,this.resolution=this.resolution??e.resolution,this.material=this.material??e.material,this.distanceDisplayCondition=this.distanceDisplayCondition??e.distanceDisplayCondition,this.relativeTo=this.relativeTo??e.relativeTo,this.materialMode=this.materialMode??e.materialMode};var Dg=MN;function NN(e){this._definitionChanged=new be,this._show=void 0,this._showSubscription=void 0,this._plane=void 0,this._planeSubscription=void 0,this._dimensions=void 0,this._dimensionsSubscription=void 0,this._fill=void 0,this._fillSubscription=void 0,this._material=void 0,this._materialSubscription=void 0,this._outline=void 0,this._outlineSubscription=void 0,this._outlineColor=void 0,this._outlineColorSubscription=void 0,this._outlineWidth=void 0,this._outlineWidthSubscription=void 0,this._shadows=void 0,this._shadowsSubscription=void 0,this._distanceDisplayCondition=void 0,this._distanceDisplayConditionSubscription=void 0,this.merge(e??H.EMPTY_OBJECT)}Object.defineProperties(NN.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:me("show"),plane:me("plane"),dimensions:me("dimensions"),fill:me("fill"),material:ro("material"),outline:me("outline"),outlineColor:me("outlineColor"),outlineWidth:me("outlineWidth"),shadows:me("shadows"),distanceDisplayCondition:me("distanceDisplayCondition")});NN.prototype.clone=function(e){return l(e)?(e.show=this.show,e.plane=this.plane,e.dimensions=this.dimensions,e.fill=this.fill,e.material=this.material,e.outline=this.outline,e.outlineColor=this.outlineColor,e.outlineWidth=this.outlineWidth,e.shadows=this.shadows,e.distanceDisplayCondition=this.distanceDisplayCondition,e):new NN(this)};NN.prototype.merge=function(e){this.show=this.show??e.show,this.plane=this.plane??e.plane,this.dimensions=this.dimensions??e.dimensions,this.fill=this.fill??e.fill,this.material=this.material??e.material,this.outline=this.outline??e.outline,this.outlineColor=this.outlineColor??e.outlineColor,this.outlineWidth=this.outlineWidth??e.outlineWidth,this.shadows=this.shadows??e.shadows,this.distanceDisplayCondition=this.distanceDisplayCondition??e.distanceDisplayCondition};var LN=NN;function FN(e){this._definitionChanged=new be,this._show=void 0,this._showSubscription=void 0,this._pixelSize=void 0,this._pixelSizeSubscription=void 0,this._heightReference=void 0,this._heightReferenceSubscription=void 0,this._color=void 0,this._colorSubscription=void 0,this._outlineColor=void 0,this._outlineColorSubscription=void 0,this._outlineWidth=void 0,this._outlineWidthSubscription=void 0,this._scaleByDistance=void 0,this._scaleByDistanceSubscription=void 0,this._translucencyByDistance=void 0,this._translucencyByDistanceSubscription=void 0,this._distanceDisplayCondition=void 0,this._distanceDisplayConditionSubscription=void 0,this._disableDepthTestDistance=void 0,this._disableDepthTestDistanceSubscription=void 0,this._splitDirection=void 0,this._splitDirectionSubscription=void 0,this.merge(e??H.EMPTY_OBJECT)}Object.defineProperties(FN.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:me("show"),pixelSize:me("pixelSize"),heightReference:me("heightReference"),color:me("color"),outlineColor:me("outlineColor"),outlineWidth:me("outlineWidth"),scaleByDistance:me("scaleByDistance"),translucencyByDistance:me("translucencyByDistance"),distanceDisplayCondition:me("distanceDisplayCondition"),disableDepthTestDistance:me("disableDepthTestDistance"),splitDirection:me("splitDirection")});FN.prototype.clone=function(e){return l(e)?(e.show=this.show,e.pixelSize=this.pixelSize,e.heightReference=this.heightReference,e.color=this.color,e.outlineColor=this.outlineColor,e.outlineWidth=this.outlineWidth,e.scaleByDistance=this.scaleByDistance,e.translucencyByDistance=this._translucencyByDistance,e.distanceDisplayCondition=this.distanceDisplayCondition,e.disableDepthTestDistance=this.disableDepthTestDistance,e.splitDirection=this.splitDirection,e):new FN(this)};FN.prototype.merge=function(e){this.show=this.show??e.show,this.pixelSize=this.pixelSize??e.pixelSize,this.heightReference=this.heightReference??e.heightReference,this.color=this.color??e.color,this.outlineColor=this.outlineColor??e.outlineColor,this.outlineWidth=this.outlineWidth??e.outlineWidth,this.scaleByDistance=this.scaleByDistance??e.scaleByDistance,this.translucencyByDistance=this._translucencyByDistance??e.translucencyByDistance,this.distanceDisplayCondition=this.distanceDisplayCondition??e.distanceDisplayCondition,this.disableDepthTestDistance=this.disableDepthTestDistance??e.disableDepthTestDistance,this.splitDirection=this.splitDirection??e.splitDirection};var qx=FN;function Iqe(e,t){this.positions=l(e)?e:[],this.holes=l(t)?t:[]}var Mc=Iqe;function Pqe(e){return Array.isArray(e)&&(e=new Mc(e)),new ui(e)}function BN(e){this._definitionChanged=new be,this._show=void 0,this._showSubscription=void 0,this._hierarchy=void 0,this._hierarchySubscription=void 0,this._height=void 0,this._heightSubscription=void 0,this._heightReference=void 0,this._heightReferenceSubscription=void 0,this._extrudedHeight=void 0,this._extrudedHeightSubscription=void 0,this._extrudedHeightReference=void 0,this._extrudedHeightReferenceSubscription=void 0,this._stRotation=void 0,this._stRotationSubscription=void 0,this._granularity=void 0,this._granularitySubscription=void 0,this._fill=void 0,this._fillSubscription=void 0,this._material=void 0,this._materialSubscription=void 0,this._outline=void 0,this._outlineSubscription=void 0,this._outlineColor=void 0,this._outlineColorSubscription=void 0,this._outlineWidth=void 0,this._outlineWidthSubscription=void 0,this._perPositionHeight=void 0,this._perPositionHeightSubscription=void 0,this._closeTop=void 0,this._closeTopSubscription=void 0,this._closeBottom=void 0,this._closeBottomSubscription=void 0,this._arcType=void 0,this._arcTypeSubscription=void 0,this._shadows=void 0,this._shadowsSubscription=void 0,this._distanceDisplayCondition=void 0,this._distanceDisplayConditionSubscription=void 0,this._classificationType=void 0,this._classificationTypeSubscription=void 0,this._zIndex=void 0,this._zIndexSubscription=void 0,this._textureCoordinates=void 0,this._textureCoordinatesSubscription=void 0,this.merge(e??H.EMPTY_OBJECT)}Object.defineProperties(BN.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:me("show"),hierarchy:me("hierarchy",void 0,Pqe),height:me("height"),heightReference:me("heightReference"),extrudedHeight:me("extrudedHeight"),extrudedHeightReference:me("extrudedHeightReference"),stRotation:me("stRotation"),granularity:me("granularity"),fill:me("fill"),material:ro("material"),outline:me("outline"),outlineColor:me("outlineColor"),outlineWidth:me("outlineWidth"),perPositionHeight:me("perPositionHeight"),closeTop:me("closeTop"),closeBottom:me("closeBottom"),arcType:me("arcType"),shadows:me("shadows"),distanceDisplayCondition:me("distanceDisplayCondition"),classificationType:me("classificationType"),zIndex:me("zIndex"),textureCoordinates:me("textureCoordinates")});BN.prototype.clone=function(e){return l(e)?(e.show=this.show,e.hierarchy=this.hierarchy,e.height=this.height,e.heightReference=this.heightReference,e.extrudedHeight=this.extrudedHeight,e.extrudedHeightReference=this.extrudedHeightReference,e.stRotation=this.stRotation,e.granularity=this.granularity,e.fill=this.fill,e.material=this.material,e.outline=this.outline,e.outlineColor=this.outlineColor,e.outlineWidth=this.outlineWidth,e.perPositionHeight=this.perPositionHeight,e.closeTop=this.closeTop,e.closeBottom=this.closeBottom,e.arcType=this.arcType,e.shadows=this.shadows,e.distanceDisplayCondition=this.distanceDisplayCondition,e.classificationType=this.classificationType,e.zIndex=this.zIndex,e.textureCoordinates=this.textureCoordinates,e):new BN(this)};BN.prototype.merge=function(e){this.show=this.show??e.show,this.hierarchy=this.hierarchy??e.hierarchy,this.height=this.height??e.height,this.heightReference=this.heightReference??e.heightReference,this.extrudedHeight=this.extrudedHeight??e.extrudedHeight,this.extrudedHeightReference=this.extrudedHeightReference??e.extrudedHeightReference,this.stRotation=this.stRotation??e.stRotation,this.granularity=this.granularity??e.granularity,this.fill=this.fill??e.fill,this.material=this.material??e.material,this.outline=this.outline??e.outline,this.outlineColor=this.outlineColor??e.outlineColor,this.outlineWidth=this.outlineWidth??e.outlineWidth,this.perPositionHeight=this.perPositionHeight??e.perPositionHeight,this.closeTop=this.closeTop??e.closeTop,this.closeBottom=this.closeBottom??e.closeBottom,this.arcType=this.arcType??e.arcType,this.shadows=this.shadows??e.shadows,this.distanceDisplayCondition=this.distanceDisplayCondition??e.distanceDisplayCondition,this.classificationType=this.classificationType??e.classificationType,this.zIndex=this.zIndex??e.zIndex,this.textureCoordinates=this.textureCoordinates??e.textureCoordinates};var rm=BN;function kN(e){this._definitionChanged=new be,this._show=void 0,this._showSubscription=void 0,this._positions=void 0,this._positionsSubscription=void 0,this._width=void 0,this._widthSubscription=void 0,this._granularity=void 0,this._granularitySubscription=void 0,this._material=void 0,this._materialSubscription=void 0,this._depthFailMaterial=void 0,this._depthFailMaterialSubscription=void 0,this._arcType=void 0,this._arcTypeSubscription=void 0,this._clampToGround=void 0,this._clampToGroundSubscription=void 0,this._shadows=void 0,this._shadowsSubscription=void 0,this._distanceDisplayCondition=void 0,this._distanceDisplayConditionSubscription=void 0,this._classificationType=void 0,this._classificationTypeSubscription=void 0,this._zIndex=void 0,this._zIndexSubscription=void 0,this.merge(e??H.EMPTY_OBJECT)}Object.defineProperties(kN.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:me("show"),positions:me("positions"),width:me("width"),granularity:me("granularity"),material:ro("material"),depthFailMaterial:ro("depthFailMaterial"),arcType:me("arcType"),clampToGround:me("clampToGround"),shadows:me("shadows"),distanceDisplayCondition:me("distanceDisplayCondition"),classificationType:me("classificationType"),zIndex:me("zIndex")});kN.prototype.clone=function(e){return l(e)?(e.show=this.show,e.positions=this.positions,e.width=this.width,e.granularity=this.granularity,e.material=this.material,e.depthFailMaterial=this.depthFailMaterial,e.arcType=this.arcType,e.clampToGround=this.clampToGround,e.shadows=this.shadows,e.distanceDisplayCondition=this.distanceDisplayCondition,e.classificationType=this.classificationType,e.zIndex=this.zIndex,e):new kN(this)};kN.prototype.merge=function(e){this.show=this.show??e.show,this.positions=this.positions??e.positions,this.width=this.width??e.width,this.granularity=this.granularity??e.granularity,this.material=this.material??e.material,this.depthFailMaterial=this.depthFailMaterial??e.depthFailMaterial,this.arcType=this.arcType??e.arcType,this.clampToGround=this.clampToGround??e.clampToGround,this.shadows=this.shadows??e.shadows,this.distanceDisplayCondition=this.distanceDisplayCondition??e.distanceDisplayCondition,this.classificationType=this.classificationType??e.classificationType,this.zIndex=this.zIndex??e.zIndex};var il=kN;function UN(e){this._definitionChanged=new be,this._show=void 0,this._showSubscription=void 0,this._positions=void 0,this._positionsSubscription=void 0,this._shape=void 0,this._shapeSubscription=void 0,this._cornerType=void 0,this._cornerTypeSubscription=void 0,this._granularity=void 0,this._granularitySubscription=void 0,this._fill=void 0,this._fillSubscription=void 0,this._material=void 0,this._materialSubscription=void 0,this._outline=void 0,this._outlineSubscription=void 0,this._outlineColor=void 0,this._outlineColorSubscription=void 0,this._outlineWidth=void 0,this._outlineWidthSubscription=void 0,this._shadows=void 0,this._shadowsSubscription=void 0,this._distanceDisplayCondition=void 0,this._distanceDisplayConditionSubsription=void 0,this.merge(e??H.EMPTY_OBJECT)}Object.defineProperties(UN.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:me("show"),positions:me("positions"),shape:me("shape"),cornerType:me("cornerType"),granularity:me("granularity"),fill:me("fill"),material:ro("material"),outline:me("outline"),outlineColor:me("outlineColor"),outlineWidth:me("outlineWidth"),shadows:me("shadows"),distanceDisplayCondition:me("distanceDisplayCondition")});UN.prototype.clone=function(e){return l(e)?(e.show=this.show,e.positions=this.positions,e.shape=this.shape,e.cornerType=this.cornerType,e.granularity=this.granularity,e.fill=this.fill,e.material=this.material,e.outline=this.outline,e.outlineColor=this.outlineColor,e.outlineWidth=this.outlineWidth,e.shadows=this.shadows,e.distanceDisplayCondition=this.distanceDisplayCondition,e):new UN(this)};UN.prototype.merge=function(e){this.show=this.show??e.show,this.positions=this.positions??e.positions,this.shape=this.shape??e.shape,this.cornerType=this.cornerType??e.cornerType,this.granularity=this.granularity??e.granularity,this.fill=this.fill??e.fill,this.material=this.material??e.material,this.outline=this.outline??e.outline,this.outlineColor=this.outlineColor??e.outlineColor,this.outlineWidth=this.outlineWidth??e.outlineWidth,this.shadows=this.shadows??e.shadows,this.distanceDisplayCondition=this.distanceDisplayCondition??e.distanceDisplayCondition};var Yx=UN;function zN(e){this._definitionChanged=new be,this._show=void 0,this._showSubscription=void 0,this._coordinates=void 0,this._coordinatesSubscription=void 0,this._height=void 0,this._heightSubscription=void 0,this._heightReference=void 0,this._heightReferenceSubscription=void 0,this._extrudedHeight=void 0,this._extrudedHeightSubscription=void 0,this._extrudedHeightReference=void 0,this._extrudedHeightReferenceSubscription=void 0,this._rotation=void 0,this._rotationSubscription=void 0,this._stRotation=void 0,this._stRotationSubscription=void 0,this._granularity=void 0,this._granularitySubscription=void 0,this._fill=void 0,this._fillSubscription=void 0,this._material=void 0,this._materialSubscription=void 0,this._outline=void 0,this._outlineSubscription=void 0,this._outlineColor=void 0,this._outlineColorSubscription=void 0,this._outlineWidth=void 0,this._outlineWidthSubscription=void 0,this._shadows=void 0,this._shadowsSubscription=void 0,this._distanceDisplayCondition=void 0,this._distancedisplayConditionSubscription=void 0,this._classificationType=void 0,this._classificationTypeSubscription=void 0,this._zIndex=void 0,this._zIndexSubscription=void 0,this.merge(e??H.EMPTY_OBJECT)}Object.defineProperties(zN.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:me("show"),coordinates:me("coordinates"),height:me("height"),heightReference:me("heightReference"),extrudedHeight:me("extrudedHeight"),extrudedHeightReference:me("extrudedHeightReference"),rotation:me("rotation"),stRotation:me("stRotation"),granularity:me("granularity"),fill:me("fill"),material:ro("material"),outline:me("outline"),outlineColor:me("outlineColor"),outlineWidth:me("outlineWidth"),shadows:me("shadows"),distanceDisplayCondition:me("distanceDisplayCondition"),classificationType:me("classificationType"),zIndex:me("zIndex")});zN.prototype.clone=function(e){return l(e)?(e.show=this.show,e.coordinates=this.coordinates,e.height=this.height,e.heightReference=this.heightReference,e.extrudedHeight=this.extrudedHeight,e.extrudedHeightReference=this.extrudedHeightReference,e.rotation=this.rotation,e.stRotation=this.stRotation,e.granularity=this.granularity,e.fill=this.fill,e.material=this.material,e.outline=this.outline,e.outlineColor=this.outlineColor,e.outlineWidth=this.outlineWidth,e.shadows=this.shadows,e.distanceDisplayCondition=this.distanceDisplayCondition,e.classificationType=this.classificationType,e.zIndex=this.zIndex,e):new zN(this)};zN.prototype.merge=function(e){this.show=this.show??e.show,this.coordinates=this.coordinates??e.coordinates,this.height=this.height??e.height,this.heightReference=this.heightReference??e.heightReference,this.extrudedHeight=this.extrudedHeight??e.extrudedHeight,this.extrudedHeightReference=this.extrudedHeightReference??e.extrudedHeightReference,this.rotation=this.rotation??e.rotation,this.stRotation=this.stRotation??e.stRotation,this.granularity=this.granularity??e.granularity,this.fill=this.fill??e.fill,this.material=this.material??e.material,this.outline=this.outline??e.outline,this.outlineColor=this.outlineColor??e.outlineColor,this.outlineWidth=this.outlineWidth??e.outlineWidth,this.shadows=this.shadows??e.shadows,this.distanceDisplayCondition=this.distanceDisplayCondition??e.distanceDisplayCondition,this.classificationType=this.classificationType??e.classificationType,this.zIndex=this.zIndex??e.zIndex};var om=zN;function VN(e){this._definitionChanged=new be,this._show=void 0,this._showSubscription=void 0,this._positions=void 0,this._positionsSubscription=void 0,this._minimumHeights=void 0,this._minimumHeightsSubscription=void 0,this._maximumHeights=void 0,this._maximumHeightsSubscription=void 0,this._granularity=void 0,this._granularitySubscription=void 0,this._fill=void 0,this._fillSubscription=void 0,this._material=void 0,this._materialSubscription=void 0,this._outline=void 0,this._outlineSubscription=void 0,this._outlineColor=void 0,this._outlineColorSubscription=void 0,this._outlineWidth=void 0,this._outlineWidthSubscription=void 0,this._shadows=void 0,this._shadowsSubscription=void 0,this._distanceDisplayCondition=void 0,this._distanceDisplayConditionSubscription=void 0,this.merge(e??H.EMPTY_OBJECT)}Object.defineProperties(VN.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:me("show"),positions:me("positions"),minimumHeights:me("minimumHeights"),maximumHeights:me("maximumHeights"),granularity:me("granularity"),fill:me("fill"),material:ro("material"),outline:me("outline"),outlineColor:me("outlineColor"),outlineWidth:me("outlineWidth"),shadows:me("shadows"),distanceDisplayCondition:me("distanceDisplayCondition")});VN.prototype.clone=function(e){return l(e)?(e.show=this.show,e.positions=this.positions,e.minimumHeights=this.minimumHeights,e.maximumHeights=this.maximumHeights,e.granularity=this.granularity,e.fill=this.fill,e.material=this.material,e.outline=this.outline,e.outlineColor=this.outlineColor,e.outlineWidth=this.outlineWidth,e.shadows=this.shadows,e.distanceDisplayCondition=this.distanceDisplayCondition,e):new VN(this)};VN.prototype.merge=function(e){this.show=this.show??e.show,this.positions=this.positions??e.positions,this.minimumHeights=this.minimumHeights??e.minimumHeights,this.maximumHeights=this.maximumHeights??e.maximumHeights,this.granularity=this.granularity??e.granularity,this.fill=this.fill??e.fill,this.material=this.material??e.material,this.outline=this.outline??e.outline,this.outlineColor=this.outlineColor??e.outlineColor,this.outlineWidth=this.outlineWidth??e.outlineWidth,this.shadows=this.shadows??e.shadows,this.distanceDisplayCondition=this.distanceDisplayCondition??e.distanceDisplayCondition};var Rg=VN;var Dqe=new he,JK=[];function Rqe(e){return new Kl(e)}function Oqe(e){return me(e,void 0,Rqe)}function ka(e,t){return me(e,void 0,function(n){return n instanceof t?n:new t(n)})}function kd(e){e=e??H.EMPTY_OBJECT;let t=e.id;l(t)||(t=Kn()),this._availability=void 0,this._id=t,this._definitionChanged=new be,this._name=e.name,this._show=e.show??!0,this._trackingReferenceFrame=e.trackingReferenceFrame??wg.AUTODETECT,this._parent=void 0,this._propertyNames=["billboard","box","corridor","cylinder","description","ellipse","ellipsoid","label","model","tileset","orientation","path","plane","point","polygon","polyline","polylineVolume","position","properties","rectangle","viewFrom","wall",...JK],this._billboard=void 0,this._billboardSubscription=void 0,this._box=void 0,this._boxSubscription=void 0,this._corridor=void 0,this._corridorSubscription=void 0,this._cylinder=void 0,this._cylinderSubscription=void 0,this._description=void 0,this._descriptionSubscription=void 0,this._ellipse=void 0,this._ellipseSubscription=void 0,this._ellipsoid=void 0,this._ellipsoidSubscription=void 0,this._label=void 0,this._labelSubscription=void 0,this._model=void 0,this._modelSubscription=void 0,this._tileset=void 0,this._tilesetSubscription=void 0,this._orientation=void 0,this._orientationSubscription=void 0,this._path=void 0,this._pathSubscription=void 0,this._plane=void 0,this._planeSubscription=void 0,this._point=void 0,this._pointSubscription=void 0,this._polygon=void 0,this._polygonSubscription=void 0,this._polyline=void 0,this._polylineSubscription=void 0,this._polylineVolume=void 0,this._polylineVolumeSubscription=void 0,this._position=void 0,this._positionSubscription=void 0,this._properties=void 0,this._propertiesSubscription=void 0,this._rectangle=void 0,this._rectangleSubscription=void 0,this._viewFrom=void 0,this._viewFromSubscription=void 0,this._wall=void 0,this._wallSubscription=void 0,this._children=[],this.entityCollection=void 0,this.parent=e.parent,this.merge(e)}function ZK(e,t,n){let i=t.length;for(let r=0;r<i;r++){let o=t[r],s=o._show;(!n&&s)!==(n&&s)&&ZK(o,o._children,n)}e._definitionChanged.raiseEvent(e,"isShowing",n,!n)}Object.defineProperties(kd.prototype,{availability:$l("availability"),id:{get:function(){return this._id}},definitionChanged:{get:function(){return this._definitionChanged}},name:$l("name"),show:{get:function(){return this._show},set:function(e){if(e===this._show)return;let t=this.isShowing;this._show=e;let n=this.isShowing;t!==n&&ZK(this,this._children,n),this._definitionChanged.raiseEvent(this,"show",e,!e)}},trackingReferenceFrame:$l("trackingReferenceFrame"),isShowing:{get:function(){return this._show&&(!l(this.entityCollection)||this.entityCollection.show)&&(!l(this._parent)||this._parent.isShowing)}},parent:{get:function(){return this._parent},set:function(e){let t=this._parent;if(t===e)return;let n=this.isShowing;if(l(t)){let r=t._children.indexOf(this);t._children.splice(r,1)}this._parent=e,l(e)&&e._children.push(this);let i=this.isShowing;n!==i&&ZK(this,this._children,i),this._definitionChanged.raiseEvent(this,"parent",e,t)}},propertyNames:{get:function(){return this._propertyNames}},billboard:ka("billboard",nl),box:ka("box",kx),corridor:ka("corridor",zx),cylinder:ka("cylinder",Vx),description:me("description"),ellipse:ka("ellipse",jx),ellipsoid:ka("ellipsoid",Hx),label:ka("label",im),model:ka("model",Pg),tileset:ka("tileset",Wx),orientation:me("orientation"),path:ka("path",Dg),plane:ka("plane",LN),point:ka("point",qx),polygon:ka("polygon",rm),polyline:ka("polyline",il),polylineVolume:ka("polylineVolume",Yx),properties:ka("properties",Jl),position:Oqe("position"),rectangle:ka("rectangle",om),viewFrom:me("viewFrom"),wall:ka("wall",Rg)});kd.registerEntityType=function(e,t){Object.defineProperties(kd.prototype,{[e]:ka(e,t)}),JK.includes(e)||JK.push(e)};kd.prototype.isAvailable=function(e){let t=this._availability;return!l(t)||t.contains(e)};kd.prototype.addProperty=function(e){this._propertyNames.push(e),Object.defineProperty(this,e,$l(e,!0))};kd.prototype.removeProperty=function(e){let n=this._propertyNames.indexOf(e);this._propertyNames.splice(n,1),delete this[e]};kd.prototype.merge=function(e){this.name=this.name??e.name,this.availability=this.availability??e.availability;let t=this._propertyNames,n=l(e._propertyNames)?e._propertyNames:Object.keys(e),i=n.length;for(let r=0;r<i;r++){let o=n[r];if(o==="parent"||o==="name"||o==="availability"||o==="children")continue;let s=this[o],a=e[o];!l(s)&&t.indexOf(o)===-1&&this.addProperty(o),l(a)&&(l(s)?l(s.merge)&&s.merge(a):l(a.merge)&&l(a.clone)?this[o]=a.clone():this[o]=a)}};var uge=new $,fge=new h,dge=new Le;kd.prototype.computeModelMatrix=function(e,t){let n=X.getValueOrUndefined(this._position,e,fge);if(!l(n))return;let i=X.getValueOrUndefined(this._orientation,e,dge);return l(i)?t=N.fromRotationTranslation($.fromQuaternion(i,uge),n,t):t=At.eastNorthUpToFixedFrame(n,void 0,t),t};kd.prototype.computeModelMatrixForHeightReference=function(e,t,n,i,r){let o=X.getValueOrDefault(t,e,We.NONE),s=X.getValueOrUndefined(this._position,e,fge);if(o===We.NONE||!l(s)||h.equalsEpsilon(s,h.ZERO,D.EPSILON8))return this.computeModelMatrix(e,r);let a=i.cartesianToCartographic(s,Dqe);o===We.CLIP_TO_GROUND?a.height<n&&(a.height=n):bs(o)?a.height=n:a.height+=n,s=i.cartographicToCartesian(a,s);let c=X.getValueOrUndefined(this._orientation,e,dge);return l(c)?r=N.fromRotationTranslation($.fromQuaternion(c,uge),s,r):r=At.eastNorthUpToFixedFrame(s,void 0,r),r};kd.supportsMaterialsforEntitiesOnTerrain=function(e){return Xl.supportsMaterials(e)};kd.supportsPolylinesOnTerrain=function(e){return Kh.isSupported(e)};var Jr=kd;var hge={id:void 0};function jN(e){if(e._firing){e._refire=!0;return}if(e._suspendCount===0){let t=e._addedEntities,n=e._removedEntities,i=e._changedEntities;if(i.length!==0||t.length!==0||n.length!==0){e._firing=!0;do{e._refire=!1;let r=t.values.slice(0),o=n.values.slice(0),s=i.values.slice(0);t.removeAll(),n.removeAll(),i.removeAll(),e._collectionChanged.raiseEvent(e,r,o,s)}while(e._refire);e._firing=!1}}}function rl(e){this._owner=e,this._entities=new Ut,this._addedEntities=new Ut,this._removedEntities=new Ut,this._changedEntities=new Ut,this._suspendCount=0,this._collectionChanged=new be,this._id=Kn(),this._show=!0,this._firing=!1,this._refire=!1}rl.prototype.suspendEvents=function(){this._suspendCount++};rl.prototype.resumeEvents=function(){this._suspendCount--,jN(this)};Object.defineProperties(rl.prototype,{collectionChanged:{get:function(){return this._collectionChanged}},id:{get:function(){return this._id}},values:{get:function(){return this._entities.values}},show:{get:function(){return this._show},set:function(e){if(e===this._show)return;this.suspendEvents();let t,n=[],i=this._entities.values,r=i.length;for(t=0;t<r;t++)n.push(i[t].isShowing);for(this._show=e,t=0;t<r;t++){let o=n[t],s=i[t];o!==s.isShowing&&s.definitionChanged.raiseEvent(s,"isShowing",s.isShowing,o)}this.resumeEvents()}},owner:{get:function(){return this._owner}}});rl.prototype.computeAvailability=function(){let e=nt.MAXIMUM_VALUE,t=nt.MINIMUM_VALUE,n=this._entities.values;for(let i=0,r=n.length;i<r;i++){let s=n[i].availability;if(l(s)){let a=s.start,c=s.stop;K.lessThan(a,e)&&!a.equals(nt.MINIMUM_VALUE)&&(e=a),K.greaterThan(c,t)&&!c.equals(nt.MAXIMUM_VALUE)&&(t=c)}}return nt.MAXIMUM_VALUE.equals(e)&&(e=nt.MINIMUM_VALUE),nt.MINIMUM_VALUE.equals(t)&&(t=nt.MAXIMUM_VALUE),new En({start:e,stop:t})};rl.prototype.add=function(e){e instanceof Jr||(e=new Jr(e));let t=e.id,n=this._entities;if(n.contains(t))throw new pe(`An entity with id ${t} already exists in this collection.`);return e.entityCollection=this,n.set(t,e),this._removedEntities.remove(t)||this._addedEntities.set(t,e),e.definitionChanged.addEventListener(rl.prototype._onEntityDefinitionChanged,this),jN(this),e};rl.prototype.remove=function(e){return l(e)?this.removeById(e.id):!1};rl.prototype.contains=function(e){return this._entities.get(e.id)===e};rl.prototype.removeById=function(e){if(!l(e))return!1;let n=this._entities.get(e);return this._entities.remove(e)?(this._addedEntities.remove(e)||(this._removedEntities.set(e,n),this._changedEntities.remove(e)),this._entities.remove(e),n.definitionChanged.removeEventListener(rl.prototype._onEntityDefinitionChanged,this),jN(this),!0):!1};rl.prototype.removeAll=function(){let e=this._entities,t=e.length,n=e.values,i=this._addedEntities,r=this._removedEntities;for(let o=0;o<t;o++){let s=n[o],a=s.id,c=i.get(a);l(c)||(s.definitionChanged.removeEventListener(rl.prototype._onEntityDefinitionChanged,this),r.set(a,s))}e.removeAll(),i.removeAll(),this._changedEntities.removeAll(),jN(this)};rl.prototype.getById=function(e){return this._entities.get(e)};rl.prototype.getOrCreateEntity=function(e){let t=this._entities.get(e);return l(t)||(hge.id=e,t=new Jr(hge),this.add(t)),t};rl.prototype._onEntityDefinitionChanged=function(e){let t=e.id;this._addedEntities.contains(t)||this._changedEntities.set(t,e),jN(this)};var Ua=rl;function QK(e){this._name=e,this._clock=void 0,this._changed=new be,this._error=new be,this._isLoading=!1,this._loading=new be,this._entityCollection=new Ua(this),this._entityCluster=new Of}Object.defineProperties(QK.prototype,{name:{get:function(){return this._name},set:function(e){this._name!==e&&(this._name=e,this._changed.raiseEvent(this))}},clock:{get:function(){return this._clock},set:function(e){this._clock!==e&&(this._clock=e,this._changed.raiseEvent(this))}},entities:{get:function(){return this._entityCollection}},isLoading:{get:function(){return this._isLoading},set:function(e){xs.setLoading(this,e)}},changedEvent:{get:function(){return this._changed}},errorEvent:{get:function(){return this._error}},loadingEvent:{get:function(){return this._loading}},show:{get:function(){return this._entityCollection.show},set:function(e){this._entityCollection.show=e}},clustering:{get:function(){return this._entityCluster},set:function(e){this._entityCluster=e}}});QK.prototype.update=function(e){return!0};var HN=QK;var GN=`in vec3 v_positionEC; +in vec3 v_normalEC; +in vec3 v_tangentEC; +in vec3 v_bitangentEC; +in vec2 v_st; +void main() +{ +vec3 positionToEyeEC = -v_positionEC; +mat3 tangentToEyeMatrix = czm_tangentToEyeSpaceMatrix(v_normalEC, v_tangentEC, v_bitangentEC); +vec3 normalEC = normalize(v_normalEC); +#ifdef FACE_FORWARD +normalEC = faceforward(normalEC, vec3(0.0, 0.0, 1.0), -normalEC); +#endif +czm_materialInput materialInput; +materialInput.normalEC = normalEC; +materialInput.tangentToEyeMatrix = tangentToEyeMatrix; +materialInput.positionToEyeEC = positionToEyeEC; +materialInput.st = v_st; +czm_material material = czm_getMaterial(materialInput); +#ifdef FLAT +out_FragColor = vec4(material.diffuse + material.emission, material.alpha); +#else +out_FragColor = czm_phong(normalize(positionToEyeEC), material, czm_lightDirectionEC); +#endif +} +`;var WN=`in vec3 position3DHigh; +in vec3 position3DLow; +in vec3 normal; +in vec3 tangent; +in vec3 bitangent; +in vec2 st; +in float batchId; +out vec3 v_positionEC; +out vec3 v_normalEC; +out vec3 v_tangentEC; +out vec3 v_bitangentEC; +out vec2 v_st; +void main() +{ +vec4 p = czm_computePosition(); +v_positionEC = (czm_modelViewRelativeToEye * p).xyz; +v_normalEC = czm_normal * normal; +v_tangentEC = czm_normal * tangent; +v_bitangentEC = czm_normal * bitangent; +v_st = st; +gl_Position = czm_modelViewProjectionRelativeToEye * p; +} +`;var qN=`in vec3 v_positionEC; +in vec3 v_normalEC; +void main() +{ +vec3 positionToEyeEC = -v_positionEC; +vec3 normalEC = normalize(v_normalEC); +#ifdef FACE_FORWARD +normalEC = faceforward(normalEC, vec3(0.0, 0.0, 1.0), -normalEC); +#endif +czm_materialInput materialInput; +materialInput.normalEC = normalEC; +materialInput.positionToEyeEC = positionToEyeEC; +czm_material material = czm_getMaterial(materialInput); +#ifdef FLAT +out_FragColor = vec4(material.diffuse + material.emission, material.alpha); +#else +out_FragColor = czm_phong(normalize(positionToEyeEC), material, czm_lightDirectionEC); +#endif +} +`;var YN=`in vec3 position3DHigh; +in vec3 position3DLow; +in vec3 normal; +in float batchId; +out vec3 v_positionEC; +out vec3 v_normalEC; +void main() { - return ${r}; +vec4 p = czm_computePosition(); +v_positionEC = (czm_modelViewRelativeToEye * p).xyz; +v_normalEC = czm_normal * normal; +gl_Position = czm_modelViewProjectionRelativeToEye * p; } -`,r};am.prototype.getShaderExpression=function(e,t){return this._runtimeAst.getShaderExpression(e,t)};am.prototype.getVariables=function(){let e=[];return this._runtimeAst.getVariables(e),e=e.filter(function(t,n,i){return i.indexOf(t)===n}),e};var wqe=["!","-","+"],A0e=["+","-","*","/","%","===","!==",">",">=","<","<=","&&","||","!~","=~"],$N=/\${(.*?)}/g,Iqe=/\\/g,Pqe="@#%",Dqe=/@#%/g,M6=new z,N6={abs:Ua(Math.abs),sqrt:Ua(Math.sqrt),cos:Ua(Math.cos),sin:Ua(Math.sin),tan:Ua(Math.tan),acos:Ua(Math.acos),asin:Ua(Math.asin),atan:Ua(Math.atan),radians:Ua(D.toRadians),degrees:Ua(D.toDegrees),sign:Ua(D.sign),floor:Ua(Math.floor),ceil:Ua(Math.ceil),round:Ua(Math.round),exp:Ua(Math.exp),exp2:Ua(Oqe),log:Ua(Math.log),log2:Ua(Mqe),fract:Ua(Rqe),length:Nqe,normalize:Lqe},L6={atan2:R6(Math.atan2,!1),pow:R6(Math.pow,!1),min:R6(Math.min,!0),max:R6(Math.max,!0),distance:Fqe,dot:Bqe,cross:kqe},GK={clamp:b0e(D.clamp,!0),mix:b0e(D.lerp,!0)};function Rqe(e){return e-Math.floor(e)}function Oqe(e){return Math.pow(2,e)}function Mqe(e){return D.log2(e)}function Ua(e){return function(t,n){if(typeof n=="number")return e(n);if(n instanceof U)return U.fromElements(e(n.x),e(n.y),Un.getCartesian2());if(n instanceof h)return h.fromElements(e(n.x),e(n.y),e(n.z),Un.getCartesian3());if(n instanceof se)return se.fromElements(e(n.x),e(n.y),e(n.z),e(n.w),Un.getCartesian4());throw new oe(`Function "${t}" requires a vector or number argument. Argument is ${n}.`)}}function R6(e,t){return function(n,i,r){if(t&&typeof r=="number"){if(typeof i=="number")return e(i,r);if(i instanceof U)return U.fromElements(e(i.x,r),e(i.y,r),Un.getCartesian2());if(i instanceof h)return h.fromElements(e(i.x,r),e(i.y,r),e(i.z,r),Un.getCartesian3());if(i instanceof se)return se.fromElements(e(i.x,r),e(i.y,r),e(i.z,r),e(i.w,r),Un.getCartesian4())}if(typeof i=="number"&&typeof r=="number")return e(i,r);if(i instanceof U&&r instanceof U)return U.fromElements(e(i.x,r.x),e(i.y,r.y),Un.getCartesian2());if(i instanceof h&&r instanceof h)return h.fromElements(e(i.x,r.x),e(i.y,r.y),e(i.z,r.z),Un.getCartesian3());if(i instanceof se&&r instanceof se)return se.fromElements(e(i.x,r.x),e(i.y,r.y),e(i.z,r.z),e(i.w,r.w),Un.getCartesian4());throw new oe(`Function "${n}" requires vector or number arguments of matching types. Arguments are ${i} and ${r}.`)}}function b0e(e,t){return function(n,i,r,o){if(t&&typeof o=="number"){if(typeof i=="number"&&typeof r=="number")return e(i,r,o);if(i instanceof U&&r instanceof U)return U.fromElements(e(i.x,r.x,o),e(i.y,r.y,o),Un.getCartesian2());if(i instanceof h&&r instanceof h)return h.fromElements(e(i.x,r.x,o),e(i.y,r.y,o),e(i.z,r.z,o),Un.getCartesian3());if(i instanceof se&&r instanceof se)return se.fromElements(e(i.x,r.x,o),e(i.y,r.y,o),e(i.z,r.z,o),e(i.w,r.w,o),Un.getCartesian4())}if(typeof i=="number"&&typeof r=="number"&&typeof o=="number")return e(i,r,o);if(i instanceof U&&r instanceof U&&o instanceof U)return U.fromElements(e(i.x,r.x,o.x),e(i.y,r.y,o.y),Un.getCartesian2());if(i instanceof h&&r instanceof h&&o instanceof h)return h.fromElements(e(i.x,r.x,o.x),e(i.y,r.y,o.y),e(i.z,r.z,o.z),Un.getCartesian3());if(i instanceof se&&r instanceof se&&o instanceof se)return se.fromElements(e(i.x,r.x,o.x),e(i.y,r.y,o.y),e(i.z,r.z,o.z),e(i.w,r.w,o.w),Un.getCartesian4());throw new oe(`Function "${n}" requires vector or number arguments of matching types. Arguments are ${i}, ${r}, and ${o}.`)}}function Nqe(e,t){if(typeof t=="number")return Math.abs(t);if(t instanceof U)return U.magnitude(t);if(t instanceof h)return h.magnitude(t);if(t instanceof se)return se.magnitude(t);throw new oe(`Function "${e}" requires a vector or number argument. Argument is ${t}.`)}function Lqe(e,t){if(typeof t=="number")return 1;if(t instanceof U)return U.normalize(t,Un.getCartesian2());if(t instanceof h)return h.normalize(t,Un.getCartesian3());if(t instanceof se)return se.normalize(t,Un.getCartesian4());throw new oe(`Function "${e}" requires a vector or number argument. Argument is ${t}.`)}function Fqe(e,t,n){if(typeof t=="number"&&typeof n=="number")return Math.abs(t-n);if(t instanceof U&&n instanceof U)return U.distance(t,n);if(t instanceof h&&n instanceof h)return h.distance(t,n);if(t instanceof se&&n instanceof se)return se.distance(t,n);throw new oe(`Function "${e}" requires vector or number arguments of matching types. Arguments are ${t} and ${n}.`)}function Bqe(e,t,n){if(typeof t=="number"&&typeof n=="number")return t*n;if(t instanceof U&&n instanceof U)return U.dot(t,n);if(t instanceof h&&n instanceof h)return h.dot(t,n);if(t instanceof se&&n instanceof se)return se.dot(t,n);throw new oe(`Function "${e}" requires vector or number arguments of matching types. Arguments are ${t} and ${n}.`)}function kqe(e,t,n){if(t instanceof h&&n instanceof h)return h.cross(t,n,Un.getCartesian3());throw new oe(`Function "${e}" requires vec3 arguments. Arguments are ${t} and ${n}.`)}function Bt(e,t,n,i,r){this._type=e,this._value=t,this._left=n,this._right=i,this._test=r,this.evaluate=void 0,Jqe(this)}function Uqe(e,t){if(!l(t))return e;for(let n in t)if(t.hasOwnProperty(n)){let i=new RegExp(`\\$\\{${n}\\}`,"g"),r=`(${t[n]})`;l(r)&&(e=e.replace(i,r))}return e}function zqe(e){return e.replace(Iqe,Pqe)}function HK(e){return e.replace(Dqe,"\\")}function Vqe(e){let t=e,n="",i=t.indexOf("${");for(;i>=0;){let r=t.indexOf("'"),o=t.indexOf('"'),s;if(r>=0&&r<i)s=t.indexOf("'",r+1),n+=t.substr(0,s+1),t=t.substr(s+1),i=t.indexOf("${");else if(o>=0&&o<i)s=t.indexOf('"',o+1),n+=t.substr(0,s+1),t=t.substr(s+1),i=t.indexOf("${");else{n+=t.substr(0,i);let a=t.indexOf("}");if(a<0)throw new oe("Unmatched {.");n+=`czm_${t.substr(i+2,a-(i+2))}`,t=t.substr(a+1),i=t.indexOf("${")}}return n+=t,n}function jqe(e){let t=typeof e.value;if(e.value===null)return new Bt(Mt.LITERAL_NULL,null);if(t==="boolean")return new Bt(Mt.LITERAL_BOOLEAN,e.value);if(t==="number")return new Bt(Mt.LITERAL_NUMBER,e.value);if(t==="string")return e.value.indexOf("${")>=0?new Bt(Mt.VARIABLE_IN_STRING,e.value):new Bt(Mt.LITERAL_STRING,HK(e.value))}function Hqe(e,t){let n=t.arguments,i=n.length,r,o,s,a;if(t.callee.type==="MemberExpression"){r=t.callee.property.name;let c=t.callee.object;if(r==="test"||r==="exec"){if(!l(c.callee)||c.callee.name!=="regExp")throw new oe(`${r} is not a function.`);return i===0?r==="test"?new Bt(Mt.LITERAL_BOOLEAN,!1):new Bt(Mt.LITERAL_NULL,null):(s=Ki(e,c),a=Ki(e,n[0]),new Bt(Mt.FUNCTION_CALL,r,s,a))}else if(r==="toString")return o=Ki(e,c),new Bt(Mt.FUNCTION_CALL,r,o);throw new oe(`Unexpected function call "${r}".`)}if(r=t.callee.name,r==="color"){if(i===0)return new Bt(Mt.LITERAL_COLOR,r);if(o=Ki(e,n[0]),l(n[1])){let c=Ki(e,n[1]);return new Bt(Mt.LITERAL_COLOR,r,[o,c])}return new Bt(Mt.LITERAL_COLOR,r,[o])}else if(r==="rgb"||r==="hsl"){if(i<3)throw new oe(`${r} requires three arguments.`);return o=[Ki(e,n[0]),Ki(e,n[1]),Ki(e,n[2])],new Bt(Mt.LITERAL_COLOR,r,o)}else if(r==="rgba"||r==="hsla"){if(i<4)throw new oe(`${r} requires four arguments.`);return o=[Ki(e,n[0]),Ki(e,n[1]),Ki(e,n[2]),Ki(e,n[3])],new Bt(Mt.LITERAL_COLOR,r,o)}else if(r==="vec2"||r==="vec3"||r==="vec4"){o=new Array(i);for(let c=0;c<i;++c)o[c]=Ki(e,n[c]);return new Bt(Mt.LITERAL_VECTOR,r,o)}else{if(r==="isNaN"||r==="isFinite")return i===0?r==="isNaN"?new Bt(Mt.LITERAL_BOOLEAN,!0):new Bt(Mt.LITERAL_BOOLEAN,!1):(o=Ki(e,n[0]),new Bt(Mt.UNARY,r,o));if(r==="isExactClass"||r==="isClass"){if(i<1||i>1)throw new oe(`${r} requires exactly one argument.`);return o=Ki(e,n[0]),new Bt(Mt.UNARY,r,o)}else if(r==="getExactClassName"){if(i>0)throw new oe(`${r} does not take any argument.`);return new Bt(Mt.UNARY,r)}else if(l(N6[r])){if(i!==1)throw new oe(`${r} requires exactly one argument.`);return o=Ki(e,n[0]),new Bt(Mt.UNARY,r,o)}else if(l(L6[r])){if(i!==2)throw new oe(`${r} requires exactly two arguments.`);return s=Ki(e,n[0]),a=Ki(e,n[1]),new Bt(Mt.BINARY,r,s,a)}else if(l(GK[r])){if(i!==3)throw new oe(`${r} requires exactly three arguments.`);s=Ki(e,n[0]),a=Ki(e,n[1]);let c=Ki(e,n[2]);return new Bt(Mt.TERNARY,r,s,a,c)}else{if(r==="Boolean")return i===0?new Bt(Mt.LITERAL_BOOLEAN,!1):(o=Ki(e,n[0]),new Bt(Mt.UNARY,r,o));if(r==="Number")return i===0?new Bt(Mt.LITERAL_NUMBER,0):(o=Ki(e,n[0]),new Bt(Mt.UNARY,r,o));if(r==="String")return i===0?new Bt(Mt.LITERAL_STRING,""):(o=Ki(e,n[0]),new Bt(Mt.UNARY,r,o));if(r==="regExp")return Gqe(e,t)}}throw new oe(`Unexpected function call "${r}".`)}function Gqe(e,t){let n=t.arguments;if(n.length===0)return new Bt(Mt.LITERAL_REGEX,new RegExp);let i=Ki(e,n[0]),r;if(n.length>1){let o=Ki(e,n[1]);if(jK(i)&&jK(o)){try{r=new RegExp(HK(String(i._value)),o._value)}catch(s){throw new oe(s)}return new Bt(Mt.LITERAL_REGEX,r)}return new Bt(Mt.REGEX,i,o)}if(jK(i)){try{r=new RegExp(HK(String(i._value)))}catch(o){throw new oe(o)}return new Bt(Mt.LITERAL_REGEX,r)}return new Bt(Mt.REGEX,i)}function Wqe(e){if(Kqe(e.name)){let t=$qe(e.name);return t.substr(0,8)==="tiles3d_"?new Bt(Mt.BUILTIN_VARIABLE,t):new Bt(Mt.VARIABLE,t)}else{if(e.name==="NaN")return new Bt(Mt.LITERAL_NUMBER,NaN);if(e.name==="Infinity")return new Bt(Mt.LITERAL_NUMBER,1/0);if(e.name==="undefined")return new Bt(Mt.LITERAL_UNDEFINED,void 0)}throw new oe(`${e.name} is not defined.`)}function qqe(e){let t=e.property.name;if(t==="PI")return new Bt(Mt.LITERAL_NUMBER,Math.PI);if(t==="E")return new Bt(Mt.LITERAL_NUMBER,Math.E)}function Yqe(e){if(e.property.name==="POSITIVE_INFINITY")return new Bt(Mt.LITERAL_NUMBER,Number.POSITIVE_INFINITY)}function Xqe(e,t){if(t.object.name==="Math")return qqe(t);if(t.object.name==="Number")return Yqe(t);let n,i=Ki(e,t.object);return t.computed?(n=Ki(e,t.property),new Bt(Mt.MEMBER,"brackets",i,n)):(n=new Bt(Mt.LITERAL_STRING,t.property.name),new Bt(Mt.MEMBER,"dot",i,n))}function jK(e){return e._type>=Mt.LITERAL_NULL}function Kqe(e){return e.substr(0,4)==="czm_"}function $qe(e){return e.substr(4)}function Ki(e,t){let n,i,r,o;if(t.type==="Literal")n=jqe(t);else if(t.type==="CallExpression")n=Hqe(e,t);else if(t.type==="Identifier")n=Wqe(t);else if(t.type==="UnaryExpression"){i=t.operator;let s=Ki(e,t.argument);if(wqe.indexOf(i)>-1)n=new Bt(Mt.UNARY,i,s);else throw new oe(`Unexpected operator "${i}".`)}else if(t.type==="BinaryExpression")if(i=t.operator,r=Ki(e,t.left),o=Ki(e,t.right),A0e.indexOf(i)>-1)n=new Bt(Mt.BINARY,i,r,o);else throw new oe(`Unexpected operator "${i}".`);else if(t.type==="LogicalExpression")i=t.operator,r=Ki(e,t.left),o=Ki(e,t.right),A0e.indexOf(i)>-1&&(n=new Bt(Mt.BINARY,i,r,o));else if(t.type==="ConditionalExpression"){let s=Ki(e,t.test);r=Ki(e,t.consequent),o=Ki(e,t.alternate),n=new Bt(Mt.CONDITIONAL,"?",r,o,s)}else if(t.type==="MemberExpression")n=Xqe(e,t);else if(t.type==="ArrayExpression"){let s=[];for(let a=0;a<t.elements.length;a++)s[a]=Ki(e,t.elements[a]);n=new Bt(Mt.ARRAY,s)}else throw t.type==="Compound"?new oe("Provide exactly one expression."):new oe("Cannot parse expression.");return n}function Jqe(e){e._type===Mt.CONDITIONAL?e.evaluate=e._evaluateConditional:e._type===Mt.FUNCTION_CALL?e._value==="test"?e.evaluate=e._evaluateRegExpTest:e._value==="exec"?e.evaluate=e._evaluateRegExpExec:e._value==="toString"&&(e.evaluate=e._evaluateToString):e._type===Mt.UNARY?e._value==="!"?e.evaluate=e._evaluateNot:e._value==="-"?e.evaluate=e._evaluateNegative:e._value==="+"?e.evaluate=e._evaluatePositive:e._value==="isNaN"?e.evaluate=e._evaluateNaN:e._value==="isFinite"?e.evaluate=e._evaluateIsFinite:e._value==="isExactClass"?e.evaluate=e._evaluateIsExactClass:e._value==="isClass"?e.evaluate=e._evaluateIsClass:e._value==="getExactClassName"?e.evaluate=e._evaluateGetExactClassName:e._value==="Boolean"?e.evaluate=e._evaluateBooleanConversion:e._value==="Number"?e.evaluate=e._evaluateNumberConversion:e._value==="String"?e.evaluate=e._evaluateStringConversion:l(N6[e._value])&&(e.evaluate=Qqe(e._value)):e._type===Mt.BINARY?e._value==="+"?e.evaluate=e._evaluatePlus:e._value==="-"?e.evaluate=e._evaluateMinus:e._value==="*"?e.evaluate=e._evaluateTimes:e._value==="/"?e.evaluate=e._evaluateDivide:e._value==="%"?e.evaluate=e._evaluateMod:e._value==="==="?e.evaluate=e._evaluateEqualsStrict:e._value==="!=="?e.evaluate=e._evaluateNotEqualsStrict:e._value==="<"?e.evaluate=e._evaluateLessThan:e._value==="<="?e.evaluate=e._evaluateLessThanOrEquals:e._value===">"?e.evaluate=e._evaluateGreaterThan:e._value===">="?e.evaluate=e._evaluateGreaterThanOrEquals:e._value==="&&"?e.evaluate=e._evaluateAnd:e._value==="||"?e.evaluate=e._evaluateOr:e._value==="=~"?e.evaluate=e._evaluateRegExpMatch:e._value==="!~"?e.evaluate=e._evaluateRegExpNotMatch:l(L6[e._value])&&(e.evaluate=eYe(e._value)):e._type===Mt.TERNARY?e.evaluate=tYe(e._value):e._type===Mt.MEMBER?e._value==="brackets"?e.evaluate=e._evaluateMemberBrackets:e.evaluate=e._evaluateMemberDot:e._type===Mt.ARRAY?e.evaluate=e._evaluateArray:e._type===Mt.VARIABLE?e.evaluate=e._evaluateVariable:e._type===Mt.VARIABLE_IN_STRING?e.evaluate=e._evaluateVariableString:e._type===Mt.LITERAL_COLOR?e.evaluate=e._evaluateLiteralColor:e._type===Mt.LITERAL_VECTOR?e.evaluate=e._evaluateLiteralVector:e._type===Mt.LITERAL_STRING?e.evaluate=e._evaluateLiteralString:e._type===Mt.REGEX?e.evaluate=e._evaluateRegExp:e._type===Mt.BUILTIN_VARIABLE?e._value==="tiles3d_tileset_time"&&(e.evaluate=Zqe):e.evaluate=e._evaluateLiteral}function Zqe(e){return l(e)?e.content.tileset.timeSinceLoad:0}function Qqe(e){let t=N6[e];return function(n){let i=this._left.evaluate(n);return t(e,i)}}function eYe(e){let t=L6[e];return function(n){let i=this._left.evaluate(n),r=this._right.evaluate(n);return t(e,i,r)}}function tYe(e){let t=GK[e];return function(n){let i=this._left.evaluate(n),r=this._right.evaluate(n),o=this._test.evaluate(n);return t(e,i,r,o)}}function F6(e,t){if(l(e))return e.getPropertyInherited(t)}Bt.prototype._evaluateLiteral=function(){return this._value};Bt.prototype._evaluateLiteralColor=function(e){let t=M6,n=this._left;if(this._value==="color")l(n)?n.length>1?(z.fromCssColorString(n[0].evaluate(e),t),t.alpha=n[1].evaluate(e)):z.fromCssColorString(n[0].evaluate(e),t):z.fromBytes(255,255,255,255,t);else if(this._value==="rgb")z.fromBytes(n[0].evaluate(e),n[1].evaluate(e),n[2].evaluate(e),255,t);else if(this._value==="rgba"){let i=n[3].evaluate(e)*255;z.fromBytes(n[0].evaluate(e),n[1].evaluate(e),n[2].evaluate(e),i,t)}else this._value==="hsl"?z.fromHsl(n[0].evaluate(e),n[1].evaluate(e),n[2].evaluate(e),1,t):this._value==="hsla"&&z.fromHsl(n[0].evaluate(e),n[1].evaluate(e),n[2].evaluate(e),n[3].evaluate(e),t);return se.fromColor(t,Un.getCartesian4())};Bt.prototype._evaluateLiteralVector=function(e){let t=Un.getArray(),n=this._value,i=this._left,r=i.length;for(let a=0;a<r;++a){let c=i[a].evaluate(e);if(typeof c=="number")t.push(c);else if(c instanceof U)t.push(c.x,c.y);else if(c instanceof h)t.push(c.x,c.y,c.z);else if(c instanceof se)t.push(c.x,c.y,c.z,c.w);else throw new oe(`${n} argument must be a vector or number. Argument is ${c}.`)}let o=t.length,s=parseInt(n.charAt(3));if(o===0)throw new oe(`Invalid ${n} constructor. No valid arguments.`);if(o<s&&o>1)throw new oe(`Invalid ${n} constructor. Not enough arguments.`);if(o>s&&r>1)throw new oe(`Invalid ${n} constructor. Too many arguments.`);if(o===1){let a=t[0];t.push(a,a,a)}if(n==="vec2")return U.fromArray(t,0,Un.getCartesian2());if(n==="vec3")return h.fromArray(t,0,Un.getCartesian3());if(n==="vec4")return se.fromArray(t,0,Un.getCartesian4())};Bt.prototype._evaluateLiteralString=function(){return this._value};Bt.prototype._evaluateVariableString=function(e){let t=this._value,n=$N.exec(t);for(;n!==null;){let i=n[0],r=n[1],o=F6(e,r);l(o)||(o=""),t=t.replace(i,o),$N.lastIndex+=o.length-i.length,n=$N.exec(t)}return t};Bt.prototype._evaluateVariable=function(e){return F6(e,this._value)};function Zx(e){return e._value==="feature"}Bt.prototype._evaluateMemberDot=function(e){if(Zx(this._left))return F6(e,this._right.evaluate(e));let t=this._left.evaluate(e);if(!l(t))return;let n=this._right.evaluate(e);if(t instanceof U||t instanceof h||t instanceof se){if(n==="r")return t.x;if(n==="g")return t.y;if(n==="b")return t.z;if(n==="a")return t.w}return t[n]};Bt.prototype._evaluateMemberBrackets=function(e){if(Zx(this._left))return F6(e,this._right.evaluate(e));let t=this._left.evaluate(e);if(!l(t))return;let n=this._right.evaluate(e);if(t instanceof U||t instanceof h||t instanceof se){if(n===0||n==="r")return t.x;if(n===1||n==="g")return t.y;if(n===2||n==="b")return t.z;if(n===3||n==="a")return t.w}return t[n]};Bt.prototype._evaluateArray=function(e){let t=[];for(let n=0;n<this._value.length;n++)t[n]=this._value[n].evaluate(e);return t};Bt.prototype._evaluateNot=function(e){let t=this._left.evaluate(e);if(typeof t!="boolean")throw new oe(`Operator "!" requires a boolean argument. Argument is ${t}.`);return!t};Bt.prototype._evaluateNegative=function(e){let t=this._left.evaluate(e);if(t instanceof U)return U.negate(t,Un.getCartesian2());if(t instanceof h)return h.negate(t,Un.getCartesian3());if(t instanceof se)return se.negate(t,Un.getCartesian4());if(typeof t=="number")return-t;throw new oe(`Operator "-" requires a vector or number argument. Argument is ${t}.`)};Bt.prototype._evaluatePositive=function(e){let t=this._left.evaluate(e);if(!(t instanceof U||t instanceof h||t instanceof se||typeof t=="number"))throw new oe(`Operator "+" requires a vector or number argument. Argument is ${t}.`);return t};Bt.prototype._evaluateLessThan=function(e){let t=this._left.evaluate(e),n=this._right.evaluate(e);if(typeof t!="number"||typeof n!="number")throw new oe(`Operator "<" requires number arguments. Arguments are ${t} and ${n}.`);return t<n};Bt.prototype._evaluateLessThanOrEquals=function(e){let t=this._left.evaluate(e),n=this._right.evaluate(e);if(typeof t!="number"||typeof n!="number")throw new oe(`Operator "<=" requires number arguments. Arguments are ${t} and ${n}.`);return t<=n};Bt.prototype._evaluateGreaterThan=function(e){let t=this._left.evaluate(e),n=this._right.evaluate(e);if(typeof t!="number"||typeof n!="number")throw new oe(`Operator ">" requires number arguments. Arguments are ${t} and ${n}.`);return t>n};Bt.prototype._evaluateGreaterThanOrEquals=function(e){let t=this._left.evaluate(e),n=this._right.evaluate(e);if(typeof t!="number"||typeof n!="number")throw new oe(`Operator ">=" requires number arguments. Arguments are ${t} and ${n}.`);return t>=n};Bt.prototype._evaluateOr=function(e){let t=this._left.evaluate(e);if(typeof t!="boolean")throw new oe(`Operator "||" requires boolean arguments. First argument is ${t}.`);if(t)return!0;let n=this._right.evaluate(e);if(typeof n!="boolean")throw new oe(`Operator "||" requires boolean arguments. Second argument is ${n}.`);return t||n};Bt.prototype._evaluateAnd=function(e){let t=this._left.evaluate(e);if(typeof t!="boolean")throw new oe(`Operator "&&" requires boolean arguments. First argument is ${t}.`);if(!t)return!1;let n=this._right.evaluate(e);if(typeof n!="boolean")throw new oe(`Operator "&&" requires boolean arguments. Second argument is ${n}.`);return t&&n};Bt.prototype._evaluatePlus=function(e){let t=this._left.evaluate(e),n=this._right.evaluate(e);if(n instanceof U&&t instanceof U)return U.add(t,n,Un.getCartesian2());if(n instanceof h&&t instanceof h)return h.add(t,n,Un.getCartesian3());if(n instanceof se&&t instanceof se)return se.add(t,n,Un.getCartesian4());if(typeof t=="string"||typeof n=="string")return t+n;if(typeof t=="number"&&typeof n=="number")return t+n;throw new oe(`Operator "+" requires vector or number arguments of matching types, or at least one string argument. Arguments are ${t} and ${n}.`)};Bt.prototype._evaluateMinus=function(e){let t=this._left.evaluate(e),n=this._right.evaluate(e);if(n instanceof U&&t instanceof U)return U.subtract(t,n,Un.getCartesian2());if(n instanceof h&&t instanceof h)return h.subtract(t,n,Un.getCartesian3());if(n instanceof se&&t instanceof se)return se.subtract(t,n,Un.getCartesian4());if(typeof t=="number"&&typeof n=="number")return t-n;throw new oe(`Operator "-" requires vector or number arguments of matching types. Arguments are ${t} and ${n}.`)};Bt.prototype._evaluateTimes=function(e){let t=this._left.evaluate(e),n=this._right.evaluate(e);if(n instanceof U&&t instanceof U)return U.multiplyComponents(t,n,Un.getCartesian2());if(n instanceof U&&typeof t=="number")return U.multiplyByScalar(n,t,Un.getCartesian2());if(t instanceof U&&typeof n=="number")return U.multiplyByScalar(t,n,Un.getCartesian2());if(n instanceof h&&t instanceof h)return h.multiplyComponents(t,n,Un.getCartesian3());if(n instanceof h&&typeof t=="number")return h.multiplyByScalar(n,t,Un.getCartesian3());if(t instanceof h&&typeof n=="number")return h.multiplyByScalar(t,n,Un.getCartesian3());if(n instanceof se&&t instanceof se)return se.multiplyComponents(t,n,Un.getCartesian4());if(n instanceof se&&typeof t=="number")return se.multiplyByScalar(n,t,Un.getCartesian4());if(t instanceof se&&typeof n=="number")return se.multiplyByScalar(t,n,Un.getCartesian4());if(typeof t=="number"&&typeof n=="number")return t*n;throw new oe(`Operator "*" requires vector or number arguments. If both arguments are vectors they must be matching types. Arguments are ${t} and ${n}.`)};Bt.prototype._evaluateDivide=function(e){let t=this._left.evaluate(e),n=this._right.evaluate(e);if(n instanceof U&&t instanceof U)return U.divideComponents(t,n,Un.getCartesian2());if(t instanceof U&&typeof n=="number")return U.divideByScalar(t,n,Un.getCartesian2());if(n instanceof h&&t instanceof h)return h.divideComponents(t,n,Un.getCartesian3());if(t instanceof h&&typeof n=="number")return h.divideByScalar(t,n,Un.getCartesian3());if(n instanceof se&&t instanceof se)return se.divideComponents(t,n,Un.getCartesian4());if(t instanceof se&&typeof n=="number")return se.divideByScalar(t,n,Un.getCartesian4());if(typeof t=="number"&&typeof n=="number")return t/n;throw new oe(`Operator "/" requires vector or number arguments of matching types, or a number as the second argument. Arguments are ${t} and ${n}.`)};Bt.prototype._evaluateMod=function(e){let t=this._left.evaluate(e),n=this._right.evaluate(e);if(n instanceof U&&t instanceof U)return U.fromElements(t.x%n.x,t.y%n.y,Un.getCartesian2());if(n instanceof h&&t instanceof h)return h.fromElements(t.x%n.x,t.y%n.y,t.z%n.z,Un.getCartesian3());if(n instanceof se&&t instanceof se)return se.fromElements(t.x%n.x,t.y%n.y,t.z%n.z,t.w%n.w,Un.getCartesian4());if(typeof t=="number"&&typeof n=="number")return t%n;throw new oe(`Operator "%" requires vector or number arguments of matching types. Arguments are ${t} and ${n}.`)};Bt.prototype._evaluateEqualsStrict=function(e){let t=this._left.evaluate(e),n=this._right.evaluate(e);return n instanceof U&&t instanceof U||n instanceof h&&t instanceof h||n instanceof se&&t instanceof se?t.equals(n):t===n};Bt.prototype._evaluateNotEqualsStrict=function(e){let t=this._left.evaluate(e),n=this._right.evaluate(e);return n instanceof U&&t instanceof U||n instanceof h&&t instanceof h||n instanceof se&&t instanceof se?!t.equals(n):t!==n};Bt.prototype._evaluateConditional=function(e){let t=this._test.evaluate(e);if(typeof t!="boolean")throw new oe(`Conditional argument of conditional expression must be a boolean. Argument is ${t}.`);return t?this._left.evaluate(e):this._right.evaluate(e)};Bt.prototype._evaluateNaN=function(e){return isNaN(this._left.evaluate(e))};Bt.prototype._evaluateIsFinite=function(e){return isFinite(this._left.evaluate(e))};Bt.prototype._evaluateIsExactClass=function(e){return l(e)?e.isExactClass(this._left.evaluate(e)):!1};Bt.prototype._evaluateIsClass=function(e){return l(e)?e.isClass(this._left.evaluate(e)):!1};Bt.prototype._evaluateGetExactClassName=function(e){if(l(e))return e.getExactClassName()};Bt.prototype._evaluateBooleanConversion=function(e){return!!this._left.evaluate(e)};Bt.prototype._evaluateNumberConversion=function(e){return Number(this._left.evaluate(e))};Bt.prototype._evaluateStringConversion=function(e){return String(this._left.evaluate(e))};Bt.prototype._evaluateRegExp=function(e){let t=this._value.evaluate(e),n="";l(this._left)&&(n=this._left.evaluate(e));let i;try{i=new RegExp(t,n)}catch(r){throw new oe(r)}return i};Bt.prototype._evaluateRegExpTest=function(e){let t=this._left.evaluate(e),n=this._right.evaluate(e);if(!(t instanceof RegExp&&typeof n=="string"))throw new oe(`RegExp.test requires the first argument to be a RegExp and the second argument to be a string. Arguments are ${t} and ${n}.`);return t.test(n)};Bt.prototype._evaluateRegExpMatch=function(e){let t=this._left.evaluate(e),n=this._right.evaluate(e);if(t instanceof RegExp&&typeof n=="string")return t.test(n);if(n instanceof RegExp&&typeof t=="string")return n.test(t);throw new oe(`Operator "=~" requires one RegExp argument and one string argument. Arguments are ${t} and ${n}.`)};Bt.prototype._evaluateRegExpNotMatch=function(e){let t=this._left.evaluate(e),n=this._right.evaluate(e);if(t instanceof RegExp&&typeof n=="string")return!t.test(n);if(n instanceof RegExp&&typeof t=="string")return!n.test(t);throw new oe(`Operator "!~" requires one RegExp argument and one string argument. Arguments are ${t} and ${n}.`)};Bt.prototype._evaluateRegExpExec=function(e){let t=this._left.evaluate(e),n=this._right.evaluate(e);if(!(t instanceof RegExp&&typeof n=="string"))throw new oe(`RegExp.exec requires the first argument to be a RegExp and the second argument to be a string. Arguments are ${t} and ${n}.`);let i=t.exec(n);return l(i)?i[1]:null};Bt.prototype._evaluateToString=function(e){let t=this._left.evaluate(e);if(t instanceof RegExp||t instanceof U||t instanceof h||t instanceof se)return String(t);throw new oe(`Unexpected function call "${this._value}".`)};function x0e(e){let t=e._left,n=t.length;for(let a=0;a<n;++a)if(t[a]._type!==Mt.LITERAL_NUMBER)return;let i=t[0]._value,r=t[1]._value,o=t[2]._value,s=n===4?t[3]._value:1;return z.fromHsl(i,r,o,s,M6)}function T0e(e){let t=e._left,n=t.length;for(let r=0;r<n;++r)if(t[r]._type!==Mt.LITERAL_NUMBER)return;let i=M6;return i.red=t[0]._value/255,i.green=t[1]._value/255,i.blue=t[2]._value/255,i.alpha=n===4?t[3]._value:1,i}function tA(e){return e%1===0?e.toFixed(1):e.toString()}function nYe(e){let t=tA(e.red),n=tA(e.green),i=tA(e.blue);return`vec3(${t}, ${n}, ${i})`}function O6(e){let t=tA(e.red),n=tA(e.green),i=tA(e.blue),r=tA(e.alpha);return`vec4(${t}, ${n}, ${i}, ${r})`}function E0e(e,t,n,i){let r=e.length,o=new Array(r);for(let s=0;s<r;++s)o[s]=e[s].getShaderExpression(t,n,i);return o}function C0e(e,t){return l(t[e])?t[e]:am.NULL_SENTINEL}am.NULL_SENTINEL="czm_infinity";Bt.prototype.getShaderExpression=function(e,t,n){let i,r,o,s,a=this._type,c=this._value;l(this._left)&&(Array.isArray(this._left)?r=E0e(this._left,e,t,this):r=this._left.getShaderExpression(e,t,this)),l(this._right)&&(o=this._right.getShaderExpression(e,t,this)),l(this._test)&&(s=this._test.getShaderExpression(e,t,this)),Array.isArray(this._value)&&(c=E0e(this._value,e,t,this));let u,f,d;switch(a){case Mt.VARIABLE:return Zx(this)?void 0:C0e(c,e);case Mt.UNARY:if(c==="Boolean")return`bool(${r})`;if(c==="Number")return`float(${r})`;if(c==="round")return`floor(${r} + 0.5)`;if(l(N6[c]))return`${c}(${r})`;if(c==="isNaN")return`(${r} != ${r})`;if(c==="isFinite")return`(abs(${r}) < czm_infinity)`;if(c==="String"||c==="isExactClass"||c==="isClass"||c==="getExactClassName")throw new oe(`Error generating style shader: "${c}" is not supported.`);return c+r;case Mt.BINARY:return c==="%"?`mod(${r}, ${o})`:c==="==="?`(${r} == ${o})`:c==="!=="?`(${r} != ${o})`:c==="atan2"?`atan(${r}, ${o})`:l(L6[c])?`${c}(${r}, ${o})`:`(${r} ${c} ${o})`;case Mt.TERNARY:if(l(GK[c]))return`${c}(${r}, ${o}, ${s})`;break;case Mt.CONDITIONAL:return`(${s} ? ${r} : ${o})`;case Mt.MEMBER:return Zx(this._left)?C0e(o,e):o==="r"||o==="x"||o==="0.0"?`${r}[0]`:o==="g"||o==="y"||o==="1.0"?`${r}[1]`:o==="b"||o==="z"||o==="2.0"?`${r}[2]`:o==="a"||o==="w"||o==="3.0"?`${r}[3]`:`${r}[int(${o})]`;case Mt.FUNCTION_CALL:throw new oe(`Error generating style shader: "${c}" is not supported.`);case Mt.ARRAY:if(c.length===4)return`vec4(${c[0]}, ${c[1]}, ${c[2]}, ${c[3]})`;if(c.length===3)return`vec3(${c[0]}, ${c[1]}, ${c[2]})`;if(c.length===2)return`vec2(${c[0]}, ${c[1]})`;throw new oe("Error generating style shader: Invalid array length. Array length should be 2, 3, or 4.");case Mt.REGEX:throw new oe("Error generating style shader: Regular expressions are not supported.");case Mt.VARIABLE_IN_STRING:throw new oe("Error generating style shader: Converting a variable to a string is not supported.");case Mt.LITERAL_NULL:return am.NULL_SENTINEL;case Mt.LITERAL_BOOLEAN:return c?"true":"false";case Mt.LITERAL_NUMBER:return tA(c);case Mt.LITERAL_STRING:if(l(n)&&n._type===Mt.MEMBER&&(c==="r"||c==="g"||c==="b"||c==="a"||c==="x"||c==="y"||c==="z"||c==="w"||Zx(n._left)))return c;if(i=z.fromCssColorString(c,M6),l(i))return nYe(i);throw new oe("Error generating style shader: String literals are not supported.");case Mt.LITERAL_COLOR:if(u=r,c==="color"){if(l(u)){if(u.length>1){let p=u[0],g=u[1];return g!=="1.0"&&(t.translucent=!0),`vec4(${p}, ${g})`}}else return"vec4(1.0)";return`vec4(${u[0]}, 1.0)`}else{if(c==="rgb")return i=T0e(this),l(i)?O6(i):`vec4(${u[0]} / 255.0, ${u[1]} / 255.0, ${u[2]} / 255.0, 1.0)`;if(c==="rgba")return u[3]!=="1.0"&&(t.translucent=!0),i=T0e(this),l(i)?O6(i):`vec4(${u[0]} / 255.0, ${u[1]} / 255.0, ${u[2]} / 255.0, ${u[3]})`;if(c==="hsl")return i=x0e(this),l(i)?O6(i):`vec4(czm_HSLToRGB(vec3(${u[0]}, ${u[1]}, ${u[2]})), 1.0)`;if(c==="hsla")return i=x0e(this),l(i)?(i.alpha!==1&&(t.translucent=!0),O6(i)):(u[3]!=="1.0"&&(t.translucent=!0),`vec4(czm_HSLToRGB(vec3(${u[0]}, ${u[1]}, ${u[2]})), ${u[3]})`)}break;case Mt.LITERAL_VECTOR:f=r.length,d=`${c}(`;for(let p=0;p<f;++p)d+=r[p],p<f-1&&(d+=", ");return d+=")",d;case Mt.LITERAL_REGEX:throw new oe("Error generating style shader: Regular expressions are not supported.");case Mt.LITERAL_UNDEFINED:return am.NULL_SENTINEL;case Mt.BUILTIN_VARIABLE:if(c==="tiles3d_tileset_time")return c}};Bt.prototype.getVariables=function(e,t){let n,i,r,o=this._type,s=this._value;if(l(this._left))if(Array.isArray(this._left))for(n=this._left,i=n.length,r=0;r<i;++r)n[r].getVariables(e,this);else this._left.getVariables(e,this);if(l(this._right)&&this._right.getVariables(e,this),l(this._test)&&this._test.getVariables(e,this),Array.isArray(this._value))for(n=this._value,i=n.length,r=0;r<i;++r)n[r].getVariables(e,this);let a;switch(o){case Mt.VARIABLE:Zx(this)||e.push(s);break;case Mt.VARIABLE_IN_STRING:for(a=$N.exec(s);a!==null;)e.push(a[1]),a=$N.exec(s);break;case Mt.LITERAL_STRING:l(t)&&t._type===Mt.MEMBER&&Zx(t._left)&&e.push(s);break}};var Bd=am;function Rg(e){e=e??H.EMPTY_OBJECT,this._batchTable=e.batchTable,this._batchIds=e.batchIds,this._positions=e.positions,this._vertexBatchIds=e.vertexBatchIds,this._indices=e.indices,this._indexCounts=e.indexCounts,this._indexOffsets=e.indexOffsets,this._batchedIndices=e.batchedIndices,this._boundingVolume=e.boundingVolume,this._boundingVolumes=e.boundingVolumes,this._center=e.center??h.ZERO,this._va=void 0,this._sp=void 0,this._spStencil=void 0,this._spPick=void 0,this._uniformMap=void 0,this._vaSwap=void 0,this._rsStencilDepthPass=void 0,this._rsStencilDepthPass3DTiles=void 0,this._rsColorPass=void 0,this._rsPickPass=void 0,this._rsWireframe=void 0,this._commands=[],this._commandsIgnoreShow=[],this._pickCommands=[],this._constantColor=z.clone(z.WHITE),this._highlightColor=this._constantColor,this._batchDirty=!0,this._pickCommandsDirty=!0,this._framesSinceLastRebatch=0,this._updatingAllCommands=!1,this._trianglesLength=this._indices.length/3,this._geometryByteLength=this._indices.byteLength+this._positions.byteLength+this._vertexBatchIds.byteLength,this.debugWireframe=!1,this._debugWireframe=this.debugWireframe,this._wireframeDirty=!1,this.forceRebatch=!1,this.classificationType=e.classificationType??ei.BOTH,this._vertexShaderSource=e._vertexShaderSource,this._fragmentShaderSource=e._fragmentShaderSource,this._attributeLocations=e._attributeLocations,this._uniformMap=e._uniformMap,this._pickId=e._pickId,this._modelMatrix=e._modelMatrix,this._boundingSphere=e._boundingSphere,this._batchIdLookUp={};let t=this._batchIds.length;for(let n=0;n<t;++n){let i=this._batchIds[n];this._batchIdLookUp[i]=n}}Object.defineProperties(Rg.prototype,{trianglesLength:{get:function(){return this._trianglesLength}},geometryByteLength:{get:function(){return this._geometryByteLength}}});var iYe={position:0,a_batchId:1};function rYe(e,t){if(l(e._va))return;let n=tt.createVertexBuffer({context:t,typedArray:e._positions,usage:Me.STATIC_DRAW}),i=tt.createVertexBuffer({context:t,typedArray:e._vertexBatchIds,usage:Me.STATIC_DRAW}),r=tt.createIndexBuffer({context:t,typedArray:e._indices,usage:Me.DYNAMIC_DRAW,indexDatatype:e._indices.BYTES_PER_ELEMENT===2?je.UNSIGNED_SHORT:je.UNSIGNED_INT}),o=[{index:0,vertexBuffer:n,componentDatatype:Y.fromTypedArray(e._positions),componentsPerAttribute:3},{index:1,vertexBuffer:i,componentDatatype:Y.fromTypedArray(e._vertexBatchIds),componentsPerAttribute:1}];e._va=new zn({context:t,attributes:o,indexBuffer:r}),t.webgl2&&(e._vaSwap=new zn({context:t,attributes:o,indexBuffer:tt.createIndexBuffer({context:t,sizeInBytes:r.sizeInBytes,usage:Me.DYNAMIC_DRAW,indexDatatype:r.indexDatatype})})),e._batchedPositions=void 0,e._transferrableBatchIds=void 0,e._vertexBatchIds=void 0}function oYe(e,t){if(l(e._sp))return;let n=e._batchTable,i=e._attributeLocations??iYe,r=e._pickId,o=e._vertexShaderSource,s=e._fragmentShaderSource;if(l(o)){e._sp=Qt.fromCache({context:t,vertexShaderSource:o,fragmentShaderSource:s,attributeLocations:i}),e._spStencil=e._sp,s=Ye.replaceMain(s,"czm_non_pick_main"),s=`${s}void main() -{ - czm_non_pick_main(); - out_FragColor = ${r}; -} -`,e._spPick=Qt.fromCache({context:t,vertexShaderSource:o,fragmentShaderSource:s,attributeLocations:i});return}let a=n.getVertexShaderCallback(!1,"a_batchId",void 0)(Ov),c=n.getFragmentShaderCallback(!1,void 0,!0)(jy);r=n.getPickId();let u=new Ye({sources:[a]}),f=new Ye({defines:["VECTOR_TILE"],sources:[c]});e._sp=Qt.fromCache({context:t,vertexShaderSource:u,fragmentShaderSource:f,attributeLocations:i}),u=new Ye({sources:[Ov]}),f=new Ye({defines:["VECTOR_TILE"],sources:[jy]}),e._spStencil=Qt.fromCache({context:t,vertexShaderSource:u,fragmentShaderSource:f,attributeLocations:i}),c=Ye.replaceMain(c,"czm_non_pick_main"),c=`${c} -void main() -{ - czm_non_pick_main(); - out_FragColor = ${r}; -} -`;let d=new Ye({sources:[a]}),p=new Ye({defines:["VECTOR_TILE"],sources:[c]});e._spPick=Qt.fromCache({context:t,vertexShaderSource:d,fragmentShaderSource:p,attributeLocations:i})}function v0e(e){let t=e?ti.EQUAL:ti.ALWAYS;return{colorMask:{red:!1,green:!1,blue:!1,alpha:!1},stencilTest:{enabled:!0,frontFunction:t,frontOperation:{fail:Rt.KEEP,zFail:Rt.DECREMENT_WRAP,zPass:Rt.KEEP},backFunction:t,backOperation:{fail:Rt.KEEP,zFail:Rt.INCREMENT_WRAP,zPass:Rt.KEEP},reference:Yt.CESIUM_3D_TILE_MASK,mask:Yt.CESIUM_3D_TILE_MASK},stencilMask:Yt.CLASSIFICATION_MASK,depthTest:{enabled:!0,func:cc.LESS_OR_EQUAL},depthMask:!1}}var sYe={stencilTest:{enabled:!0,frontFunction:ti.NOT_EQUAL,frontOperation:{fail:Rt.ZERO,zFail:Rt.ZERO,zPass:Rt.ZERO},backFunction:ti.NOT_EQUAL,backOperation:{fail:Rt.ZERO,zFail:Rt.ZERO,zPass:Rt.ZERO},reference:0,mask:Yt.CLASSIFICATION_MASK},stencilMask:Yt.CLASSIFICATION_MASK,depthTest:{enabled:!1},depthMask:!1,blending:tn.PRE_MULTIPLIED_ALPHA_BLEND},aYe={stencilTest:{enabled:!0,frontFunction:ti.NOT_EQUAL,frontOperation:{fail:Rt.ZERO,zFail:Rt.ZERO,zPass:Rt.ZERO},backFunction:ti.NOT_EQUAL,backOperation:{fail:Rt.ZERO,zFail:Rt.ZERO,zPass:Rt.ZERO},reference:0,mask:Yt.CLASSIFICATION_MASK},stencilMask:Yt.CLASSIFICATION_MASK,depthTest:{enabled:!1},depthMask:!1};function cYe(e){l(e._rsStencilDepthPass)||(e._rsStencilDepthPass=Ge.fromCache(v0e(!1)),e._rsStencilDepthPass3DTiles=Ge.fromCache(v0e(!0)),e._rsColorPass=Ge.fromCache(sYe),e._rsPickPass=Ge.fromCache(aYe))}var Qx=new N,S0e=new h;function lYe(e,t){if(l(e._uniformMap))return;let n={u_modifiedModelViewProjection:function(){let i=t.uniformState.view,r=t.uniformState.projection;return N.clone(i,Qx),N.multiplyByPoint(Qx,e._center,S0e),N.setTranslation(Qx,S0e,Qx),N.multiply(r,Qx,Qx),Qx},u_highlightColor:function(){return e._highlightColor}};e._uniformMap=e._batchTable.getUniformMapCallback()(n)}function WK(e,t,n,i,r,o,s){let a=e.constructor.BYTES_PER_ELEMENT,c=o.length;for(let u=0;u<c;++u){let f=o[u],d=s[f],p=i[d],g=r[d],m=new e.constructor(e.buffer,a*p,g);t.set(m,n),i[d]=n,n+=g}return n}function uYe(e,t){let n=e._indices,i=e._indexOffsets,r=e._indexCounts,o=e._batchIdLookUp,s=new n.constructor(n.length),a=t.pop(),c=[a],u=WK(n,s,0,i,r,a.batchIds,o);for(a.offset=0,a.count=u;t.length>0;){let f=t.pop();if(z.equals(f.color,a.color))u=WK(n,s,u,i,r,f.batchIds,o),a.batchIds=a.batchIds.concat(f.batchIds),a.count=u-a.offset;else{let d=u;u=WK(n,s,u,i,r,f.batchIds,o),f.offset=d,f.count=u-d,c.push(f),a=f}}e._va.indexBuffer.copyFromArrayView(s),e._indices=s,e._batchedIndices=c}function qK(e,t,n,i,r,o,s){let a=e.bytesPerIndex,c=o.length;for(let u=0;u<c;++u){let f=o[u],d=s[f],p=i[d],g=r[d];t.copyFromBuffer(e,p*a,n*a,g*a),i[d]=n,n+=g}return n}function fYe(e,t){let n=e._indexOffsets,i=e._indexCounts,r=e._batchIdLookUp,o=t.pop(),s=[o],a=e._va.indexBuffer,c=e._vaSwap.indexBuffer,u=qK(a,c,0,n,i,o.batchIds,r);for(o.offset=0,o.count=u;t.length>0;){let d=t.pop();if(z.equals(d.color,o.color))u=qK(a,c,u,n,i,d.batchIds,r),o.batchIds=o.batchIds.concat(d.batchIds),o.count=u-o.offset;else{let p=u;u=qK(a,c,u,n,i,d.batchIds,r),d.offset=p,d.count=u-p,s.push(d),o=d}}let f=e._va;e._va=e._vaSwap,e._vaSwap=f,e._batchedIndices=s}function dYe(e,t){return t.color.toRgba()-e.color.toRgba()}function hYe(e,t){if(!e._batchDirty)return!1;let n=e._batchedIndices,i=n.length,r=!1,o={};for(let s=0;s<i;++s){let c=n[s].color.toRgba();if(l(o[c])){r=!0;break}else o[c]=!0}if(!r)return e._batchDirty=!1,!1;if(r&&!e.forceRebatch&&e._framesSinceLastRebatch<120){++e._framesSinceLastRebatch;return}return n.sort(dYe),t.webgl2?fYe(e,n):uYe(e,n),e._framesSinceLastRebatch=0,e._batchDirty=!1,e._pickCommandsDirty=!0,e._wireframeDirty=!0,!0}function mYe(e,t){let n=hYe(e,t),i=e._commands,r=e._batchedIndices,o=r.length,s=o*2;if(l(i)&&!n&&i.length===s)return;i.length=s;let a=e._va,c=e._sp,u=e._modelMatrix??N.IDENTITY,f=e._uniformMap,d=e._boundingVolume;for(let p=0;p<o;++p){let g=r[p].offset,m=r[p].count,y=i[p*2];l(y)||(y=i[p*2]=new at({owner:e})),y.vertexArray=a,y.modelMatrix=u,y.offset=g,y.count=m,y.renderState=e._rsStencilDepthPass,y.shaderProgram=c,y.uniformMap=f,y.boundingVolume=d,y.cull=!1,y.pass=Ie.TERRAIN_CLASSIFICATION;let A=at.shallowClone(y,y.derivedCommands.tileset);A.renderState=e._rsStencilDepthPass3DTiles,A.pass=Ie.CESIUM_3D_TILE_CLASSIFICATION,y.derivedCommands.tileset=A;let b=i[p*2+1];l(b)||(b=i[p*2+1]=new at({owner:e})),b.vertexArray=a,b.modelMatrix=u,b.offset=g,b.count=m,b.renderState=e._rsColorPass,b.shaderProgram=c,b.uniformMap=f,b.boundingVolume=d,b.cull=!1,b.pass=Ie.TERRAIN_CLASSIFICATION;let x=at.shallowClone(b,b.derivedCommands.tileset);x.pass=Ie.CESIUM_3D_TILE_CLASSIFICATION,b.derivedCommands.tileset=x}e._commandsDirty=!0}function pYe(e,t){if(e.classificationType===ei.TERRAIN||!t.invertClassification||l(e._commandsIgnoreShow)&&!e._commandsDirty)return;let n=e._commands,i=e._commandsIgnoreShow,r=e._spStencil,o=n.length,s=i.length=o/2,a=0;for(let c=0;c<s;++c){let u=i[c]=at.shallowClone(n[a],i[c]);u.shaderProgram=r,u.pass=Ie.CESIUM_3D_TILE_CLASSIFICATION_IGNORE_SHOW,a+=2}e._commandsDirty=!1}function gYe(e){if(!e._pickCommandsDirty)return;let t=e._indexOffsets.length,n=e._pickCommands;n.length=t*2;let i=e._va,r=e._spStencil,o=e._spPick,s=e._modelMatrix??N.IDENTITY,a=e._uniformMap;for(let c=0;c<t;++c){let u=e._indexOffsets[c],f=e._indexCounts[c],d=l(e._boundingVolumes)?e._boundingVolumes[c]:e.boundingVolume,p=n[c*2];l(p)||(p=n[c*2]=new at({owner:e,pickOnly:!0})),p.vertexArray=i,p.modelMatrix=s,p.offset=u,p.count=f,p.renderState=e._rsStencilDepthPass,p.shaderProgram=r,p.uniformMap=a,p.boundingVolume=d,p.pass=Ie.TERRAIN_CLASSIFICATION;let g=at.shallowClone(p,p.derivedCommands.tileset);g.renderState=e._rsStencilDepthPass3DTiles,g.pass=Ie.CESIUM_3D_TILE_CLASSIFICATION,p.derivedCommands.tileset=g;let m=n[c*2+1];l(m)||(m=n[c*2+1]=new at({owner:e,pickOnly:!0})),m.vertexArray=i,m.modelMatrix=s,m.offset=u,m.count=f,m.renderState=e._rsPickPass,m.shaderProgram=o,m.uniformMap=a,m.boundingVolume=d,m.pass=Ie.TERRAIN_CLASSIFICATION;let y=at.shallowClone(m,m.derivedCommands.tileset);y.pass=Ie.CESIUM_3D_TILE_CLASSIFICATION,m.derivedCommands.tileset=y}e._pickCommandsDirty=!1}Rg.prototype.createFeatures=function(e,t){let n=this._batchIds,i=n.length;for(let r=0;r<i;++r){let o=n[r];t[o]=new na(e,o)}};Rg.prototype.applyDebugSettings=function(e,t){this._highlightColor=e?t:this._constantColor};function _Ye(e,t){e._updatingAllCommands=!0;let n=e._batchIds,i=n.length,r;for(r=0;r<i;++r){let s=n[r],a=t[s];a.show=!0,a.color=z.WHITE}let o=e._batchedIndices;for(i=o.length,r=0;r<i;++r)o[r].color=z.clone(z.WHITE);e._updatingAllCommands=!1,e._batchDirty=!0}var yYe=new z,AYe=z.WHITE,bYe=!0,xYe=/\$/;Rg.prototype.applyStyle=function(e,t){if(!l(e)){_Ye(this,t);return}let n=e.color,i=n instanceof Bd&&!xYe.test(n.expression);this._updatingAllCommands=i;let r=this._batchIds,o=r.length,s;for(s=0;s<o;++s){let a=r[s],c=t[a];c.color=l(e.color)?e.color.evaluateColor(c,yYe):AYe,c.show=l(e.show)?e.show.evaluate(c):bYe}if(i){let a=this._batchedIndices;for(o=a.length,s=0;s<o;++s)a[s].color=z.clone(z.WHITE);this._updatingAllCommands=!1,this._batchDirty=!0}};Rg.prototype.updateCommands=function(e,t){if(this._updatingAllCommands)return;let n=this._batchIdLookUp,i=n[e];if(!l(i))return;let r=this._indexOffsets,o=this._indexCounts,s=r[i],a=o[i],c=this._batchedIndices,u=c.length,f;for(f=0;f<u;++f){let y=c[f].offset,A=c[f].count;if(s>=y&&s<y+A)break}c.push(new zp({color:z.clone(t),offset:s,count:a,batchIds:[e]}));let d=[],p=[],g=c[f].batchIds,m=g.length;for(let y=0;y<m;++y){let A=g[y];if(A===e)continue;let b=n[A];r[b]<s?d.push(A):p.push(A)}p.length!==0&&c.push(new zp({color:z.clone(c[f].color),offset:s+a,count:c[f].offset+c[f].count-(s+a),batchIds:p})),d.length!==0?(c[f].count=s-c[f].offset,c[f].batchIds=d):c.splice(f,1),this._batchDirty=!0};function w0e(e,t,n,i){let r=e.classificationType,o=r!==ei.CESIUM_3D_TILE,s=r!==ei.TERRAIN,a=t.commandList,c=n.length,u,f;for(f=0;f<c;++f)o&&(u=n[f],u.pass=Ie.TERRAIN_CLASSIFICATION,a.push(u)),s&&(u=n[f].derivedCommands.tileset,u.pass=Ie.CESIUM_3D_TILE_CLASSIFICATION,a.push(u));if(!(!t.invertClassification||!l(i)))for(c=i.length,f=0;f<c;++f)a.push(i[f])}function TYe(e,t){let n=e.commandList,i=t.length;for(let r=0;r<i;r+=2){let o=t[r+1];o.pass=Ie.OPAQUE,n.push(o)}}function EYe(e){let t=e.debugWireframe===e._debugWireframe;if(t=t&&!(e.debugWireframe&&e._wireframeDirty),t)return;l(e._rsWireframe)||(e._rsWireframe=Ge.fromCache({}));let n,i;e.debugWireframe?(n=e._rsWireframe,i=Oe.LINES):(n=e._rsColorPass,i=Oe.TRIANGLES);let r=e._commands,o=r.length;for(let s=0;s<o;s+=2){let a=r[s+1];a.renderState=n,a.primitiveType=i}e._debugWireframe=e.debugWireframe,e._wireframeDirty=!1}Rg.prototype.update=function(e){let t=e.context;rYe(this,t),oYe(this,t),cYe(this),lYe(this,t);let n=e.passes;n.render&&(mYe(this,t),pYe(this,e),EYe(this),this._debugWireframe?TYe(e,this._commands):w0e(this,e,this._commands,this._commandsIgnoreShow)),n.pick&&(gYe(this),w0e(this,e,this._pickCommands))};Rg.prototype.isDestroyed=function(){return!1};Rg.prototype.destroy=function(){return this._va=this._va&&this._va.destroy(),this._sp=this._sp&&this._sp.destroy(),this._spPick=this._spPick&&this._spPick.destroy(),this._vaSwap=this._vaSwap&&this._vaSwap.destroy(),le(this)};var eT=Rg;function Mf(e){this._boxes=e.boxes,this._boxBatchIds=e.boxBatchIds,this._cylinders=e.cylinders,this._cylinderBatchIds=e.cylinderBatchIds,this._ellipsoids=e.ellipsoids,this._ellipsoidBatchIds=e.ellipsoidBatchIds,this._spheres=e.spheres,this._sphereBatchIds=e.sphereBatchIds,this._modelMatrix=e.modelMatrix,this._batchTable=e.batchTable,this._boundingVolume=e.boundingVolume,this._center=e.center,l(this._center)||(l(this._boundingVolume)?this._center=h.clone(this._boundingVolume.center):this._center=h.clone(h.ZERO)),this._boundingVolumes=void 0,this._batchedIndices=void 0,this._indices=void 0,this._indexOffsets=void 0,this._indexCounts=void 0,this._positions=void 0,this._vertexBatchIds=void 0,this._batchIds=void 0,this._batchTableColors=void 0,this._packedBuffer=void 0,this._ready=!1,this._promise=void 0,this._error=void 0,this._verticesPromise=void 0,this._primitive=void 0,this.debugWireframe=!1,this.forceRebatch=!1,this.classificationType=ei.BOTH}Object.defineProperties(Mf.prototype,{trianglesLength:{get:function(){return l(this._primitive)?this._primitive.trianglesLength:0}},geometryByteLength:{get:function(){return l(this._primitive)?this._primitive.geometryByteLength:0}},ready:{get:function(){return this._ready}}});Mf.packedBoxLength=N.packedLength+h.packedLength;Mf.packedCylinderLength=N.packedLength+2;Mf.packedEllipsoidLength=N.packedLength+h.packedLength;Mf.packedSphereLength=h.packedLength+1;function CYe(e){let t=new Float64Array(N.packedLength+h.packedLength),n=0;return h.pack(e._center,t,n),n+=h.packedLength,N.pack(e._modelMatrix,t,n),t}function vYe(e,t){let n=0,i=t[n++],r=t[n++],o=e._boundingVolumes=new Array(r);for(let c=0;c<r;++c)o[c]=ue.unpack(t,n),n+=ue.packedLength;let s=t[n++],a=e._batchedIndices=new Array(s);for(let c=0;c<s;++c){let u=z.unpack(t,n);n+=z.packedLength;let f=t[n++],d=t[n++],p=t[n++],g=new Array(p);for(let m=0;m<p;++m)g[m]=t[n++];a[c]=new zp({color:u,offset:f,count:d,batchIds:g})}return i}var SYe=new $n("createVectorTileGeometries",5),wYe=new z;function IYe(e){if(!l(e._primitive)&&!l(e._verticesPromise)){let t=e._boxes,n=e._boxBatchIds,i=e._cylinders,r=e._cylinderBatchIds,o=e._ellipsoids,s=e._ellipsoidBatchIds,a=e._spheres,c=e._sphereBatchIds,u=e._batchTableColors,f=e._packedBuffer;if(!l(u)){let m=0;l(e._boxes)&&(t=e._boxes=t.slice(),n=e._boxBatchIds=n.slice(),m+=n.length),l(e._cylinders)&&(i=e._cylinders=i.slice(),r=e._cylinderBatchIds=r.slice(),m+=r.length),l(e._ellipsoids)&&(o=e._ellipsoids=o.slice(),s=e._ellipsoidBatchIds=s.slice(),m+=s.length),l(e._spheres)&&(a=e._sphere=a.slice(),c=e._sphereBatchIds=c.slice(),m+=c.length),u=e._batchTableColors=new Uint32Array(m);let y=e._batchTable;for(let A=0;A<m;++A){let b=y.getColor(A,wYe);u[A]=b.toRgba()}f=e._packedBuffer=CYe(e)}let d=[];l(t)&&d.push(t.buffer,n.buffer),l(i)&&d.push(i.buffer,r.buffer),l(o)&&d.push(o.buffer,s.buffer),l(a)&&d.push(a.buffer,c.buffer),d.push(u.buffer,f.buffer);let p={boxes:l(t)?t.buffer:void 0,boxBatchIds:l(t)?n.buffer:void 0,cylinders:l(i)?i.buffer:void 0,cylinderBatchIds:l(i)?r.buffer:void 0,ellipsoids:l(o)?o.buffer:void 0,ellipsoidBatchIds:l(o)?s.buffer:void 0,spheres:l(a)?a.buffer:void 0,sphereBatchIds:l(a)?c.buffer:void 0,batchTableColors:u.buffer,packedBuffer:f.buffer},g=e._verticesPromise=SYe.scheduleTask(p,d);return l(g)?g.then(function(m){if(e.isDestroyed())return;let y=new Float64Array(m.packedBuffer);vYe(e,y)===2?e._indices=new Uint16Array(m.indices):e._indices=new Uint32Array(m.indices),e._indexOffsets=new Uint32Array(m.indexOffsets),e._indexCounts=new Uint32Array(m.indexCounts),e._positions=new Float32Array(m.positions),e._vertexBatchIds=new Uint16Array(m.vertexBatchIds),e._batchIds=new Uint16Array(m.batchIds),PYe(e),e._ready=!0}).catch(m=>{e.isDestroyed()||(e._error=m)}):void 0}}function PYe(e){l(e._primitive)||(e._primitive=new eT({batchTable:e._batchTable,positions:e._positions,batchIds:e._batchIds,vertexBatchIds:e._vertexBatchIds,indices:e._indices,indexOffsets:e._indexOffsets,indexCounts:e._indexCounts,batchedIndices:e._batchedIndices,boundingVolume:e._boundingVolume,boundingVolumes:e._boundingVolumes,center:e._center,pickObject:e._pickObject??e}),e._boxes=void 0,e._boxBatchIds=void 0,e._cylinders=void 0,e._cylinderBatchIds=void 0,e._ellipsoids=void 0,e._ellipsoidBatchIds=void 0,e._spheres=void 0,e._sphereBatchIds=void 0,e._center=void 0,e._modelMatrix=void 0,e._batchTable=void 0,e._boundingVolume=void 0,e._boundingVolumes=void 0,e._batchedIndices=void 0,e._indices=void 0,e._indexOffsets=void 0,e._indexCounts=void 0,e._positions=void 0,e._vertexBatchIds=void 0,e._batchIds=void 0,e._batchTableColors=void 0,e._packedBuffer=void 0,e._verticesPromise=void 0)}Mf.prototype.createFeatures=function(e,t){this._primitive.createFeatures(e,t)};Mf.prototype.applyDebugSettings=function(e,t){this._primitive.applyDebugSettings(e,t)};Mf.prototype.applyStyle=function(e,t){this._primitive.applyStyle(e,t)};Mf.prototype.updateCommands=function(e,t){this._primitive.updateCommands(e,t)};Mf.prototype.update=function(e){if(!this._ready){if(l(this._promise)||(this._promise=IYe(this)),l(this._error)){let t=this._error;throw this._error=void 0,t}return}this._primitive.debugWireframe=this.debugWireframe,this._primitive.forceRebatch=this.forceRebatch,this._primitive.classificationType=this.classificationType,this._primitive.update(e)};Mf.prototype.isDestroyed=function(){return!1};Mf.prototype.destroy=function(){return this._primitive=this._primitive&&this._primitive.destroy(),le(this)};var Og=Mf;var YK=class{constructor(t,n,i,r,o){this._tileset=t,this._tile=n,this._resource=i,this._geometries=void 0,this._metadata=void 0,this._batchTable=void 0,this._features=void 0,this.featurePropertiesDirty=!1,this._group=void 0,this._ready=!1,OYe(this,r,o)}get featuresLength(){return l(this._batchTable)?this._batchTable.featuresLength:0}get pointsLength(){return 0}get trianglesLength(){return l(this._geometries)?this._geometries.trianglesLength:0}get geometryByteLength(){return l(this._geometries)?this._geometries.geometryByteLength:0}get texturesByteLength(){return 0}get batchTableByteLength(){return l(this._batchTable)?this._batchTable.batchTableByteLength:0}get innerContents(){}get ready(){return this._ready}get tileset(){return this._tileset}get tile(){return this._tile}get url(){return this._resource.getUrlComponent(!0)}get metadata(){return this._metadata}set metadata(t){this._metadata=t}get batchTable(){return this._batchTable}get group(){return this._group}set group(t){this._group=t}hasProperty(t,n){return this._batchTable.hasProperty(t,n)}getFeature(t){return I0e(this),this._features[t]}applyDebugSettings(t,n){l(this._geometries)&&this._geometries.applyDebugSettings(t,n)}applyStyle(t){I0e(this),l(this._geometries)&&this._geometries.applyStyle(t,this._features)}update(t,n){l(this._geometries)&&(this._geometries.classificationType=this._tileset.classificationType,this._geometries.debugWireframe=this._tileset.debugWireframe,this._geometries.update(n)),l(this._batchTable)&&this._geometries.ready&&(this._batchTable.update(t,n),this._ready=!0)}pick(t,n,i){}isDestroyed(){return!1}destroy(){return this._geometries=this._geometries&&this._geometries.destroy(),this._batchTable=this._batchTable&&this._batchTable.destroy(),le(this)}};function DYe(e){return function(t,n){l(e._geometries)&&e._geometries.updateCommands(t,n)}}function RYe(e,t){let n,i,r,o,s,a=e.BOXES_LENGTH??0,c=e.CYLINDERS_LENGTH??0,u=e.ELLIPSOIDS_LENGTH??0,f=e.SPHERES_LENGTH??0;if(a>0&&l(e.BOX_BATCH_IDS)){let m=t.byteOffset+e.BOX_BATCH_IDS.byteOffset;n=new Uint16Array(t.buffer,m,a)}if(c>0&&l(e.CYLINDER_BATCH_IDS)){let m=t.byteOffset+e.CYLINDER_BATCH_IDS.byteOffset;i=new Uint16Array(t.buffer,m,c)}if(u>0&&l(e.ELLIPSOID_BATCH_IDS)){let m=t.byteOffset+e.ELLIPSOID_BATCH_IDS.byteOffset;r=new Uint16Array(t.buffer,m,u)}if(f>0&&l(e.SPHERE_BATCH_IDS)){let m=t.byteOffset+e.SPHERE_BATCH_IDS.byteOffset;o=new Uint16Array(t.buffer,m,f)}let d=l(n)||l(i)||l(r)||l(o),p=a>0&&!l(n)||c>0&&!l(i)||u>0&&!l(r)||f>0&&!l(o);if(d&&p)throw new oe("If one group of batch ids is defined, then all batch ids must be defined");if(!l(n)&&!l(i)&&!l(r)&&!l(o)){let m=0;if(!l(n)&&a>0)for(n=new Uint16Array(a),s=0;s<a;++s)n[s]=m++;if(!l(i)&&c>0)for(i=new Uint16Array(c),s=0;s<c;++s)i[s]=m++;if(!l(r)&&u>0)for(r=new Uint16Array(u),s=0;s<u;++s)r[s]=m++;if(!l(o)&&f>0)for(o=new Uint16Array(f),s=0;s<f;++s)o[s]=m++}return{boxes:n,cylinders:i,ellipsoids:r,spheres:o}}var tT=Uint32Array.BYTES_PER_ELEMENT;function OYe(e,t,n){n=n??0;let i=new Uint8Array(t),r=new DataView(t);n+=tT;let o=r.getUint32(n,!0);if(o!==1)throw new oe(`Only Geometry tile version 1 is supported. Version ${o} is not.`);n+=tT;let s=r.getUint32(n,!0);if(n+=tT,s===0){e._ready=!0;return}let a=r.getUint32(n,!0);if(n+=tT,a===0)throw new oe("Feature table must have a byte length greater than zero");let c=r.getUint32(n,!0);n+=tT;let u=r.getUint32(n,!0);n+=tT;let f=r.getUint32(n,!0);n+=tT;let d=Ro(i,n,a);n+=a;let p=new Uint8Array(t,n,c);n+=c;let g,m;u>0&&(g=Ro(i,n,u),n+=u,f>0&&(m=new Uint8Array(t,n,f),m=new Uint8Array(m)));let y=d.BOXES_LENGTH??0,A=d.CYLINDERS_LENGTH??0,b=d.ELLIPSOIDS_LENGTH??0,x=d.SPHERES_LENGTH??0,T=y+A+b+x,E=new sm(e,T,g,m,DYe(e));if(e._batchTable=E,T===0)return;let v=e.tile.computedTransform,S;l(d.RTC_CENTER)&&(S=h.unpack(d.RTC_CENTER),N.multiplyByPoint(v,S,S));let I=RYe(d,p);if(y>0||A>0||b>0||x>0){let R,O,L,_;if(y>0){let C=p.byteOffset+d.BOXES.byteOffset;R=new Float32Array(p.buffer,C,Og.packedBoxLength*y)}if(A>0){let C=p.byteOffset+d.CYLINDERS.byteOffset;O=new Float32Array(p.buffer,C,Og.packedCylinderLength*A)}if(b>0){let C=p.byteOffset+d.ELLIPSOIDS.byteOffset;L=new Float32Array(p.buffer,C,Og.packedEllipsoidLength*b)}if(x>0){let C=p.byteOffset+d.SPHERES.byteOffset;_=new Float32Array(p.buffer,C,Og.packedSphereLength*x)}return e._geometries=new Og({boxes:R,boxBatchIds:I.boxes,cylinders:O,cylinderBatchIds:I.cylinders,ellipsoids:L,ellipsoidBatchIds:I.ellipsoids,spheres:_,sphereBatchIds:I.spheres,center:S,modelMatrix:v,batchTable:E,boundingVolume:e.tile.boundingVolume.boundingVolume}),e}return Promise.resolve(e)}function I0e(e){let t=e.featuresLength;if(!l(e._features)&&t>0){let n=new Array(t);l(e._geometries)&&e._geometries.createFeatures(e,n),e._features=n}}var JN=YK;var XK={};XK.encode2D=function(e,t,n){let i=Math.pow(2,e),r={x:t,y:n},o,s,a,c=BigInt(0);for(a=i/2;a>0;a/=2)o=(r.x&a)>0?1:0,s=(r.y&a)>0?1:0,c+=BigInt((3*o^s)*a*a),P0e(i,r,o,s);return c};XK.decode2D=function(e,t){let n=Math.pow(2,e),i={x:0,y:0},r,o,s,a;for(s=1,a=t;s<n;s*=2)r=1&Number(a/BigInt(2)),o=1&Number(a^BigInt(r)),P0e(s,i,r,o),i.x+=s*r,i.y+=s*o,a/=BigInt(4);return[i.x,i.y]};function P0e(e,t,n,i){if(i!==0)return;n===1&&(t.x=e-1-t.x,t.y=e-1-t.y);let r=t.x;t.x=t.y,t.y=r}var Xv=XK;var nT=30,MYe=1<<nT,NYe=1<<nT+1>>>0,KK=2*nT+1,nA=4,O0e=[],M0e=[],LYe=[[0,1,3,2],[0,2,3,1],[3,2,0,1],[3,1,0,2]],iA=1,Kv=2,B6=[iA,0,0,iA|Kv];function Hs(e){if(!dn.supportsBigInt())throw new oe("S2 required BigInt support");this._cellId=e,this._level=Hs.getLevel(e)}Hs.fromToken=function(e){return new Hs(Hs.getIdFromToken(e))};Hs.isValidId=function(e){return!(e<=0||e>>BigInt(KK)>5||!(e&~e+BigInt(1)&BigInt("0x1555555555555555")))};Hs.isValidToken=function(e){return/^[0-9a-fA-F]{1,16}$/.test(e)?Hs.isValidId(Hs.getIdFromToken(e)):!1};Hs.getIdFromToken=function(e){return BigInt("0x"+e+"0".repeat(16-e.length))};Hs.getTokenFromId=function(e){let t=Math.floor(WYe(e)/4),n=e.toString(16).replace(/0*$/,"");return Array(17-t-n.length).join("0")+n};Hs.getLevel=function(e){let t=0;for(;e!==BigInt(0)&&!(e&BigInt(1));)t++,e=e>>BigInt(1);return nT-(t>>1)};Hs.prototype.getChild=function(e){let t=F0e(this._cellId)>>BigInt(2),n=this._cellId+BigInt(2*e+1-4)*t;return new Hs(n)};Hs.prototype.getParent=function(){let e=F0e(this._cellId)<<BigInt(2);return new Hs(this._cellId&~e+BigInt(1)|e)};Hs.prototype.getParentAtLevel=function(e){let t=HYe(e);return new Hs(this._cellId&-t|t)};Hs.prototype.getCenter=function(e){e=e??ee.WGS84;let t=FYe(this._cellId,this._level);t=h.normalize(t,t);let n=he.fromCartesian(t,ee.UNIT_SPHERE);return he.toCartesian(n,e,new h)};Hs.prototype.getVertex=function(e,t){t=t??ee.WGS84;let n=BYe(this._cellId,this._level,e);n=h.normalize(n,n);let i=he.fromCartesian(n,ee.UNIT_SPHERE);return he.toCartesian(i,t,new h)};Hs.fromFacePositionLevel=function(e,t,n){let i=(e<4?"0":"")+(e<2?"0":"")+e.toString(2),r=t.toString(2),o=Array(2*n-r.length+1).join("0"),s=Array(KK-2*n).join("0"),a=BigInt(`0b${i}${o}${r}1${s}`);return new Hs(a)};function FYe(e,t){let n=kYe(e,t);return UYe(n[0],n[1],n[2])}function BYe(e,t,n){let i=N0e(e,t),r=zYe([i[1],i[2]],t),o=n>>1&1;return L0e(i[0],r[0][o^n&1],r[1][o])}function kYe(e,t){let n=N0e(e),i=n[0],r=n[1],o=n[2],s=t===30,a=!s&&(BigInt(r)^e>>BigInt(2))&BigInt(1),c=s?1:a?2:0,u=(r<<1)+c,f=(o<<1)+c;return[i,u,f]}function N0e(e){O0e.length===0&&jYe();let t=Number(e>>BigInt(KK)),n=t&iA,i=(1<<nA)-1,r=0,o=0;for(let s=7;s>=0;s--){let c=(1<<2*(s===7?nT-7*nA:nA))-1;n+=Number(e>>BigInt(s*2*nA+1)&BigInt(c))<<2,n=M0e[n];let u=s*nA;r+=n>>nA+2<<u,o+=(n>>2&i)<<u,n&=iA|Kv}return[t,r,o]}function UYe(e,t,n){let i=D0e(t),r=D0e(n),o=k6(i),s=k6(r);return L0e(e,o,s)}function L0e(e,t,n){switch(e){case 0:return new h(1,t,n);case 1:return new h(-t,1,n);case 2:return new h(-t,-n,1);case 3:return new h(-1,-n,-t);case 4:return new h(n,-1,-t);default:return new h(n,t,-1)}}function k6(e){return e>=.5?1/3*(4*e*e-1):1/3*(1-4*(1-e)*(1-e))}function D0e(e){return 1/NYe*e}function zYe(e,t){let n=[[],[]],i=VYe(t);for(let r=0;r<2;++r){let o=e[r]&-i,s=o+i;n[r][0]=k6(R0e(o)),n[r][1]=k6(R0e(s))}return n}function VYe(e){return 1<<nT-e>>>0}function R0e(e){return 1/MYe*e}function rA(e,t,n,i,r,o){if(e===nA){let s=(t<<nA)+n;O0e[(s<<2)+i]=(r<<2)+o,M0e[(r<<2)+i]=(s<<2)+o}else{e++,t<<=1,n<<=1,r<<=2;let s=LYe[o];rA(e,t+(s[0]>>1),n+(s[0]&1),i,r,o^B6[0]),rA(e,t+(s[1]>>1),n+(s[1]&1),i,r+1,o^B6[1]),rA(e,t+(s[2]>>1),n+(s[2]&1),i,r+2,o^B6[2]),rA(e,t+(s[3]>>1),n+(s[3]&1),i,r+3,o^B6[3])}}function jYe(){rA(0,0,0,0,0,0),rA(0,0,0,iA,0,iA),rA(0,0,0,Kv,0,Kv),rA(0,0,0,iA|Kv,0,iA|Kv)}function F0e(e){return e&~e+BigInt(1)}function HYe(e){return BigInt(1)<<BigInt(2*(nT-e))}var GYe=[64,0,1,39,2,15,40,23,3,12,16,59,41,19,24,54,4,64,13,10,17,62,60,28,42,30,20,51,25,44,55,47,5,32,65,38,14,22,11,58,18,53,63,9,61,27,29,50,43,46,31,37,21,57,52,8,26,49,45,36,56,7,48,35,6,34,33,0];function WYe(e){return GYe[(-e&e)%BigInt(67)]}var Mg=Hs;function qYe(e,t){return l(e)&&l(e.extensions)&&l(e.extensions[t])}var tr=qYe;function $K(e){let t=e.lengthBits,n=e.availableCount,i=e.constant,r=e.bitstream;if(l(i))n=t;else{let o=Math.ceil(t/8);if(r.length!==o)throw new oe(`Availability bitstream must be exactly ${o} bytes long to store ${t} bits. Actual bitstream was ${r.length} bytes long.`);let s=e.computeAvailableCountEnabled??!1;!l(n)&&s&&(n=YYe(r,t))}this._lengthBits=t,this._availableCount=n,this._constant=i,this._bitstream=r}function YYe(e,t){let n=0;for(let i=0;i<t;i++){let r=i>>3,o=i%8;n+=e[r]>>o&1}return n}Object.defineProperties($K.prototype,{lengthBits:{get:function(){return this._lengthBits}},availableCount:{get:function(){return this._availableCount}}});$K.prototype.getBit=function(e){if(l(this._constant))return this._constant;let t=e>>3,n=e%8;return(this._bitstream[t]>>n&1)===1};var $v=$K;function Ng(e){e=e??H.EMPTY_OBJECT;let t=e.metadataTable,n=e.class,i=e.entityId,r=e.propertyTableJson;this._class=n,this._metadataTable=t,this._entityId=i,this._extensions=r.extensions,this._extras=r.extras}Object.defineProperties(Ng.prototype,{class:{get:function(){return this._class}},extras:{get:function(){return this._extras}},extensions:{get:function(){return this._extensions}}});Ng.prototype.hasProperty=function(e){return this._metadataTable.hasProperty(e)};Ng.prototype.hasPropertyBySemantic=function(e){return this._metadataTable.hasPropertyBySemantic(e)};Ng.prototype.getPropertyIds=function(e){return this._metadataTable.getPropertyIds(e)};Ng.prototype.getProperty=function(e){return this._metadataTable.getProperty(this._entityId,e)};Ng.prototype.setProperty=function(e,t){return this._metadataTable.setProperty(this._entityId,e,t)};Ng.prototype.getPropertyBySemantic=function(e){return this._metadataTable.getPropertyBySemantic(this._entityId,e)};Ng.prototype.setPropertyBySemantic=function(e,t){return this._metadataTable.setPropertyBySemantic(this._entityId,e,t)};var Jv=Ng;var ZN={QUADTREE:"QUADTREE",OCTREE:"OCTREE"};ZN.getBranchingFactor=function(e){switch(e){case ZN.OCTREE:return 8;case ZN.QUADTREE:return 4}};Object.freeze(ZN);var Gs=ZN;function fc(){}Object.defineProperties(fc.prototype,{class:{get:function(){pe.throwInstantiationError()}}});fc.prototype.hasProperty=function(e){pe.throwInstantiationError()};fc.prototype.hasPropertyBySemantic=function(e){pe.throwInstantiationError()};fc.prototype.getPropertyIds=function(e){pe.throwInstantiationError()};fc.prototype.getProperty=function(e){pe.throwInstantiationError()};fc.prototype.setProperty=function(e,t){pe.throwInstantiationError()};fc.prototype.getPropertyBySemantic=function(e){pe.throwInstantiationError()};fc.prototype.setPropertyBySemantic=function(e,t){pe.throwInstantiationError()};fc.hasProperty=function(e,t,n){if(l(t[e]))return!0;let i=n.properties;if(!l(i))return!1;let r=i[e];return!!(l(r)&&l(r.default))};fc.hasPropertyBySemantic=function(e,t,n){let i=n.propertiesBySemantic;if(!l(i))return!1;let r=i[e];return l(r)};fc.getPropertyIds=function(e,t,n){n=l(n)?n:[],n.length=0;for(let r in e)e.hasOwnProperty(r)&&l(e[r])&&n.push(r);let i=t.properties;if(l(i))for(let r in i)i.hasOwnProperty(r)&&!l(e[r])&&l(i[r].default)&&n.push(r);return n};fc.getProperty=function(e,t,n){let i=n.properties[e],r=t[e];Array.isArray(r)&&l(r.slice)&&(r=r.slice());let o=!0;if(r=i.handleNoData(r),!l(r)&&l(i.default))return r=Je(i.default,!0),i.unpackVectorAndMatrixTypes(r,o);if(l(r))return r=i.normalize(r),r=i.applyValueTransform(r),i.unpackVectorAndMatrixTypes(r,o)};fc.setProperty=function(e,t,n,i){if(!l(n[e]))return!1;Array.isArray(t)&&l(t.slice)&&(t=t.slice());let r,o=i.properties;return l(o)&&(r=o[e]),l(r)&&(t=r.packVectorAndMatrixTypes(t,!0),t=r.unapplyValueTransform(t),t=r.unnormalize(t)),n[e]=t,!0};fc.getPropertyBySemantic=function(e,t,n){let i=n.propertiesBySemantic;if(!l(i))return;let r=i[e];if(l(r))return fc.getProperty(r.id,t,n)};fc.setPropertyBySemantic=function(e,t,n,i){let r=i.propertiesBySemantic;if(!l(r))return!1;let o=i.propertiesBySemantic[e];return l(o)?fc.setProperty(o.id,t,n,i):!1};var Yn=fc;function Lg(e){e=e??H.EMPTY_OBJECT;let t=e.subtreeMetadata,n=e.class,i=l(t.properties)?t.properties:{};this._class=n,this._properties=i,this._extras=t.extras,this._extensions=t.extensions}Object.defineProperties(Lg.prototype,{class:{get:function(){return this._class}},extras:{get:function(){return this._extras}},extensions:{get:function(){return this._extensions}}});Lg.prototype.hasProperty=function(e){return Yn.hasProperty(e,this._properties,this._class)};Lg.prototype.hasPropertyBySemantic=function(e){return Yn.hasPropertyBySemantic(e,this._properties,this._class)};Lg.prototype.getPropertyIds=function(e){return Yn.getPropertyIds(this._properties,this._class,e)};Lg.prototype.getProperty=function(e){return Yn.getProperty(e,this._properties,this._class)};Lg.prototype.setProperty=function(e,t){return Yn.setProperty(e,t,this._properties,this._class)};Lg.prototype.getPropertyBySemantic=function(e){return Yn.getPropertyBySemantic(e,this._properties,this._class)};Lg.prototype.setPropertyBySemantic=function(e,t){return Yn.setPropertyBySemantic(e,t,this._properties,this._class)};var QN=Lg;var fn={INT8:"INT8",UINT8:"UINT8",INT16:"INT16",UINT16:"UINT16",INT32:"INT32",UINT32:"UINT32",INT64:"INT64",UINT64:"UINT64",FLOAT32:"FLOAT32",FLOAT64:"FLOAT64"},rl={INTEGER:"int",UNSIGNED_INTEGER:"uint",FLOAT:"float"};fn.typeInfo={INT8:{vectorCompatible:!0,size:1,maximumValue:127,minimumValue:-128,category:rl.INTEGER},UINT8:{vectorCompatible:!0,size:1,maximumValue:255,minimumValue:0,category:rl.UNSIGNED_INTEGER},INT16:{vectorCompatible:!0,size:2,maximumValue:32767,minimumValue:-32768,category:rl.INTEGER},UINT16:{vectorCompatible:!0,size:2,maximumValue:65535,minimumValue:0,category:rl.UNSIGNED_INTEGER},INT32:{vectorCompatible:!0,size:4,maximumValue:2147483647,minimumValue:-2147483648,category:rl.INTEGER},UINT32:{vectorCompatible:!0,size:4,maximumValue:4294967295,minimumValue:0,category:rl.UNSIGNED_INTEGER},INT64:{vectorCompatible:!1,size:8,maximumValue:BigInt("9223372036854775807"),minimumValue:BigInt("-9223372036854775808"),category:rl.INTEGER,downcastFunction:e=>fn.clampToLimits(e,fn.INT32)},UINT64:{vectorCompatible:!1,size:8,maximumValue:BigInt("18446744073709551615"),minimumValue:BigInt(0),category:rl.UNSIGNED_INTEGER,downcastFunction:e=>fn.clampToLimits(e,fn.UINT32)},FLOAT32:{vectorCompatible:!0,size:4,maximumValue:34028234663852886e22,minimumValue:-34028234663852886e22,category:rl.FLOAT},FLOAT64:{vectorCompatible:!0,size:8,maximumValue:Number.MAX_VALUE,minimumValue:-Number.MAX_VALUE,category:rl.FLOAT,downcastFunction:e=>Math.fround(e)}};fn.getMinimum=function(e){return fn.typeInfo[e].minimumValue};fn.getMaximum=function(e){return fn.typeInfo[e].maximumValue};fn.isIntegerType=function(e){return fn.typeInfo[e].category!==rl.FLOAT};fn.isUnsignedIntegerType=function(e){return fn.typeInfo[e].category===rl.UNSIGNED_INTEGER};fn.isVectorCompatible=function(e){return fn.typeInfo[e].vectorCompatible};fn.category=function(e){return fn.typeInfo[e].category};fn.gpuComponentType=function(e){switch(e){case fn.INT64:return"INT32";case fn.UINT64:return"UINT32";case fn.FLOAT64:return"FLOAT32";default:return e}};fn.normalize=function(e,t){return Math.max(Number(e)/Number(fn.getMaximum(t)),-1)};fn.unnormalize=function(e,t){let n=fn.getMaximum(t),i=fn.isUnsignedIntegerType(t)?0:-n;return e=D.sign(e)*Math.round(Math.abs(e)*Number(n)),(t===fn.INT64||t===fn.UINT64)&&dn.supportsBigInt()&&(e=BigInt(e)),e>n?n:e<i?i:e};fn.applyValueTransform=function(e,t,n){return n*e+t};fn.unapplyValueTransform=function(e,t,n){return n===0?0:(e-t)/n};fn.getSizeInBytes=function(e){return fn.typeInfo[e].size};fn.clampToLimits=function(e,t){let n=fn.getMinimum(t),i=fn.getMaximum(t);if(typeof e=="bigint"){let r=BigInt(n),o=BigInt(i);return e<r?n:e>o?i:Number(e)}return Math.max(n,Math.min(i,e))};fn.downcastFunction=function(e){let n=fn.typeInfo[e].downcastFunction;return l(n)?n:i=>i};fn.fromComponentDatatype=function(e){switch(e){case Y.BYTE:return fn.INT8;case Y.UNSIGNED_BYTE:return fn.UINT8;case Y.SHORT:return fn.INT16;case Y.UNSIGNED_SHORT:return fn.UINT16;case Y.INT:return fn.INT32;case Y.UNSIGNED_INT:return fn.UINT32;case Y.FLOAT:return fn.FLOAT32;case Y.DOUBLE:return fn.FLOAT64}};fn.toComponentDatatype=function(e){switch(e){case fn.INT8:return Y.BYTE;case fn.UINT8:return Y.UNSIGNED_BYTE;case fn.INT16:return Y.SHORT;case fn.UINT16:return Y.UNSIGNED_SHORT;case fn.INT32:return Y.INT;case fn.UINT32:return Y.UNSIGNED_INT;case fn.FLOAT32:return Y.FLOAT;case fn.FLOAT64:return Y.DOUBLE}};fn.getDataViewAccessors=function(e,t){return{[fn.UINT8]:{get:e.getUint8.bind(e),set:e.setUint8.bind(e)},[fn.INT8]:{get:e.getInt8.bind(e),set:e.setInt8.bind(e)},[fn.UINT16]:{get:i=>e.getUint16(i,!0),set:(i,r)=>e.setUint16(i,r,!0)},[fn.INT16]:{get:i=>e.getInt16(i,!0),set:(i,r)=>e.setInt16(i,r,!0)},[fn.UINT32]:{get:i=>e.getUint32(i,!0),set:(i,r)=>e.setUint32(i,r,!0)},[fn.INT32]:{get:i=>e.getInt32(i,!0),set:(i,r)=>e.setInt32(i,r,!0)},[fn.FLOAT32]:{get:i=>e.getFloat32(i,!0),set:(i,r)=>e.setFloat32(i,r,!0)},[fn.FLOAT64]:{get:i=>e.getFloat64(i,!0),set:(i,r)=>e.setFloat64(i,r,!0)},[fn.UINT64]:{get:i=>e.getBigUint64(i,!0),set:(i,r)=>e.setBigUint64(i,BigInt(r),!0)},[fn.INT64]:{get:i=>e.getBigInt64(i,!0),set:(i,r)=>e.setBigInt64(i,BigInt(r),!0)}}[t]};Object.freeze(fn);var Lt=fn;var oo={SCALAR:"SCALAR",VEC2:"VEC2",VEC3:"VEC3",VEC4:"VEC4",MAT2:"MAT2",MAT3:"MAT3",MAT4:"MAT4",BOOLEAN:"BOOLEAN",STRING:"STRING",ENUM:"ENUM"};oo.isVectorType=function(e){switch(e){case oo.VEC2:case oo.VEC3:case oo.VEC4:return!0;default:return!1}};oo.isMatrixType=function(e){switch(e){case oo.MAT2:case oo.MAT3:case oo.MAT4:return!0;default:return!1}};oo.getComponentCount=function(e){switch(e){case oo.SCALAR:case oo.STRING:case oo.ENUM:case oo.BOOLEAN:return 1;case oo.VEC2:return 2;case oo.VEC3:return 3;case oo.VEC4:return 4;case oo.MAT2:return 4;case oo.MAT3:return 9;case oo.MAT4:return 16}};oo.getMathType=function(e){switch(e){case oo.VEC2:return U;case oo.VEC3:return h;case oo.VEC4:return se;case oo.MAT2:return Xi;case oo.MAT3:return $;case oo.MAT4:return N;default:return}};Object.freeze(oo);var bt=oo;function ss(e){e=e??H.EMPTY_OBJECT;let t=e.id,n=e.type,i=e.componentType,r=e.enumType,o=l(i)&&(e.normalized??!1)&&Lt.isIntegerType(i);this._id=t,this._name=e.name,this._description=e.description,this._semantic=e.semantic,this._isLegacyExtension=e.isLegacyExtension,this._type=n,this._componentType=i,this._enumType=r,this._valueType=l(r)?r.valueType:i,this._isArray=e.isArray??!1,this._isVariableLengthArray=e.isVariableLengthArray??!1,this._arrayLength=e.arrayLength,this._min=Je(e.min,!0),this._max=Je(e.max,!0),this._normalized=o;let s=Je(e.offset,!0),a=Je(e.scale,!0),c=l(s)||l(a),u=!0;l(s)||(s=this.expandConstant(0,u)),l(a)||(a=this.expandConstant(1,u)),this._offset=s,this._scale=a,this._hasValueTransform=c,this._noData=Je(e.noData,!0),this._default=Je(e.default,!0),this._required=e.required??!0,this._extras=Je(e.extras,!0),this._extensions=Je(e.extensions,!0)}ss.fromJson=function(e){e=e??H.EMPTY_OBJECT;let t=e.id,n=e.property,i=XYe(n),r=KYe(n,e.enums),o;return l(i)?i?o=l(n.optional)?!n.optional:!0:o=n.required??!1:o=!1,new ss({id:t,type:r.type,componentType:r.componentType,enumType:r.enumType,isArray:r.isArray,isVariableLengthArray:r.isVariableLengthArray,arrayLength:r.arrayLength,normalized:n.normalized,min:n.min,max:n.max,offset:n.offset,scale:n.scale,noData:n.noData,default:n.default,required:o,name:n.name,description:n.description,semantic:n.semantic,extras:n.extras,extensions:n.extensions,isLegacyExtension:i})};Object.defineProperties(ss.prototype,{id:{get:function(){return this._id}},name:{get:function(){return this._name}},description:{get:function(){return this._description}},type:{get:function(){return this._type}},enumType:{get:function(){return this._enumType}},componentType:{get:function(){return this._componentType}},valueType:{get:function(){return this._valueType}},isArray:{get:function(){return this._isArray}},isVariableLengthArray:{get:function(){return this._isVariableLengthArray}},arrayLength:{get:function(){return this._arrayLength}},normalized:{get:function(){return this._normalized}},max:{get:function(){return this._max}},min:{get:function(){return this._min}},noData:{get:function(){return this._noData}},default:{get:function(){return this._default}},required:{get:function(){return this._required}},semantic:{get:function(){return this._semantic}},hasValueTransform:{get:function(){return this._hasValueTransform}},offset:{get:function(){return this._offset}},scale:{get:function(){return this._scale}},extras:{get:function(){return this._extras}},extensions:{get:function(){return this._extensions}}});function XYe(e){if(e.type==="ARRAY")return!0;let t=e.type;if(t===bt.SCALAR||bt.isMatrixType(t)||bt.isVectorType(t))return!1;if(l(Lt[t]))return!0;if(l(e.noData)||l(e.scale)||l(e.offset)||l(e.required)||l(e.count)||l(e.array)||l(e.optional))return!1}function KYe(e,t){let n=e.type,i=e.componentType,r=n==="ARRAY",o,s,a;r?(o=!0,s=e.componentCount,a=!l(s)):e.array?(o=!0,s=e.count,a=!l(e.count)):(o=!1,s=void 0,a=!1);let c;if(l(e.enumType)&&(c=t[e.enumType]),n===bt.ENUM)return{type:n,componentType:void 0,enumType:c,valueType:c.valueType,isArray:o,isVariableLengthArray:a,arrayLength:s};if(r&&i===bt.ENUM)return{type:i,componentType:void 0,enumType:c,valueType:c.valueType,isArray:o,isVariableLengthArray:a,arrayLength:s};if(n===bt.SCALAR||bt.isMatrixType(n)||bt.isVectorType(n))return{type:n,componentType:i,enumType:void 0,valueType:i,isArray:o,isVariableLengthArray:a,arrayLength:s};if(n===bt.BOOLEAN||n===bt.STRING)return{type:n,componentType:void 0,enumType:void 0,valueType:void 0,isArray:o,isVariableLengthArray:a,arrayLength:s};if(r&&(i===bt.BOOLEAN||i===bt.STRING))return{type:i,componentType:void 0,enumType:void 0,valueType:void 0,isArray:o,isVariableLengthArray:a,arrayLength:s};if(l(i)&&l(Lt[i]))return{type:bt.SCALAR,componentType:i,enumType:void 0,valueType:i,isArray:o,isVariableLengthArray:a,arrayLength:s};if(l(Lt[n]))return{type:bt.SCALAR,componentType:n,enumType:void 0,valueType:n,isArray:o,isVariableLengthArray:a,arrayLength:s}}ss.prototype.normalize=function(e){return this._normalized?JK(e,this._valueType,Lt.normalize):e};ss.prototype.unnormalize=function(e){return this._normalized?JK(e,this._valueType,Lt.unnormalize):e};ss.prototype.applyValueTransform=function(e){return!this._hasValueTransform||this._isVariableLengthArray?e:ss.valueTransformInPlace(e,this._offset,this._scale,Lt.applyValueTransform)};ss.prototype.unapplyValueTransform=function(e){return!this._hasValueTransform||this._isVariableLengthArray?e:ss.valueTransformInPlace(e,this._offset,this._scale,Lt.unapplyValueTransform)};ss.prototype.expandConstant=function(e,t){t=t??!1;let n=this._isArray,i=this._arrayLength,r=bt.getComponentCount(this._type),o=n&&r>1;if(!n&&r===1)return e;if(!n)return new Array(r).fill(e);if(!o)return new Array(i).fill(e);if(!t)return new Array(this._arrayLength*r).fill(e);let s=new Array(r).fill(e);return new Array(this._arrayLength).fill(s)};ss.prototype.handleNoData=function(e){let t=this._noData;if(!l(t))return e;if(!z0e(e,t))return e};function eL(e){return Array.isArray(e)&&!(e instanceof Xi)&&!(e instanceof $)&&!(e instanceof N)}function z0e(e,t){if(!eL(e))return e===t;if(!eL(t)||e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(!z0e(e[n],t[n]))return!1;return!0}ss.prototype.unpackVectorAndMatrixTypes=function(e,t){t=t??!1;let n=bt.getMathType(this._type),i=this._isArray,r=bt.getComponentCount(this._type),o=i&&r>1;return l(n)?t&&o?e.map(function(s){return n.unpack(s)}):i?n.unpackArray(e):n.unpack(e):e};ss.prototype.packVectorAndMatrixTypes=function(e,t){t=t??!1;let n=bt.getMathType(this._type),i=this._isArray,r=bt.getComponentCount(this._type),o=i&&r>1;return l(n)?t&&o?e.map(function(s){return n.pack(s,[])}):i?n.packArray(e,[]):n.pack(e,[]):e};ss.prototype.validate=function(e){if(!(!l(e)&&l(this._default)))return this._required&&!l(e)?"required property must have a value":this._isArray?$Ye(this,e):V0e(this,e)};function $Ye(e,t){if(!eL(t))return`value ${t} must be an array`;let n=t.length;if(!e._isVariableLengthArray&&n!==e._arrayLength)return"Array length does not match property.arrayLength";for(let i=0;i<n;i++){let r=V0e(e,t[i]);if(l(r))return r}}function V0e(e,t){let n=e._type,i=e._componentType,r=e._enumType,o=e._normalized;return bt.isVectorType(n)?JYe(t,n,i):bt.isMatrixType(n)?ZYe(t,n,i):n===bt.STRING?QYe(t):n===bt.BOOLEAN?eXe(t):n===bt.ENUM?tXe(t,r):nXe(t,i,o)}function JYe(e,t,n){if(!Lt.isVectorCompatible(n))return`componentType ${n} is incompatible with vector type ${t}`;if(t===bt.VEC2&&!(e instanceof U))return`vector value ${e} must be a Cartesian2`;if(t===bt.VEC3&&!(e instanceof h))return`vector value ${e} must be a Cartesian3`;if(t===bt.VEC4&&!(e instanceof se))return`vector value ${e} must be a Cartesian4`}function ZYe(e,t,n){if(!Lt.isVectorCompatible(n))return`componentType ${n} is incompatible with matrix type ${t}`;if(t===bt.MAT2&&!(e instanceof Xi))return`matrix value ${e} must be a Matrix2`;if(t===bt.MAT3&&!(e instanceof $))return`matrix value ${e} must be a Matrix3`;if(t===bt.MAT4&&!(e instanceof N))return`matrix value ${e} must be a Matrix4`}function QYe(e){if(typeof e!="string")return U6(e,bt.STRING)}function eXe(e){if(typeof e!="boolean")return U6(e,bt.BOOLEAN)}function tXe(e,t){let n=typeof e;if(l(t))return n!=="string"||!l(t.valuesByName[e])?`value ${e} is not a valid enum name for ${t.id}`:void 0}function nXe(e,t,n){let i=typeof e;switch(t){case Lt.INT8:case Lt.UINT8:case Lt.INT16:case Lt.UINT16:case Lt.INT32:case Lt.UINT32:case Lt.FLOAT32:case Lt.FLOAT64:return i!=="number"?U6(e,t):isFinite(e)?k0e(e,t,n):U0e(e,t);case Lt.INT64:case Lt.UINT64:return i!=="number"&&i!=="bigint"?U6(e,t):i==="number"&&!isFinite(e)?U0e(e,t):k0e(e,t,n)}}function U6(e,t){return`value ${e} does not match type ${t}`}function B0e(e,t,n){let i=`value ${e} is out of range for type ${t}`;return n&&(i+=" (normalized)"),i}function k0e(e,t,n){if(n){let i=Lt.isUnsignedIntegerType(t)?0:-1;return e<i||e>1?B0e(e,t,n):void 0}if(e<Lt.getMinimum(t)||e>Lt.getMaximum(t))return B0e(e,t,n)}function U0e(e,t){return`value ${e} of type ${t} must be finite`}function JK(e,t,n){if(!eL(e))return n(e,t);for(let i=0;i<e.length;i++)e[i]=JK(e[i],t,n);return e}ss.valueTransformInPlace=function(e,t,n,i){if(!eL(e))return i(e,t,n);for(let r=0;r<e.length;r++)e[r]=ss.valueTransformInPlace(e[r],t[r],n[r],i);return e};ss.prototype.cpuBytesPerElement=function(){return j0e(this,this.valueType)};ss.prototype.gpuBytesPerElement=function(){let e=Lt.gpuComponentType(this.valueType);return j0e(this,e)};function j0e(e,t){let n=e.type,i=bt.getComponentCount(n),r=e.isArray?e.arrayLength:1,o=Lt.getSizeInBytes(t);return i*r*o}ss.prototype.isGpuCompatible=function(e){let t=this.type;return!(this.isVariableLengthArray||t===bt.STRING||t===bt.BOOLEAN||this.gpuBytesPerElement()>e)};var ZK=[void 0,"float","vec2","vec3","vec4"],H0e=[void 0,"int","ivec2","ivec3","ivec4"],iXe=[void 0,"uint","uvec2","uvec3","uvec4"],rXe={[rl.FLOAT]:"uintBitsToFloat",[rl.INTEGER]:"int",[rl.UNSIGNED_INTEGER]:""};ss.prototype.getGlslTypeWebGL1=function(){let e=bt.getComponentCount(this.type);return this.isArray&&(e=this.arrayLength),this.normalized?ZK[e]:H0e[e]};ss.prototype.getGlslType=function(){let e=this.valueType,t=bt.getComponentCount(this.type),n=this.isArray?this.arrayLength:1;return t*=n,!Lt.isIntegerType(e)||this.normalized?ZK[t]:Lt.isUnsignedIntegerType(e)?iXe[t]:H0e[t]};ss.prototype.unpackTextureInShader=function(e,t,n,i){let r=this.getGlslType(),o=Lt.gpuComponentType(this.valueType),s=t.length,a=this.type,c=bt.getComponentCount(a)*(this.isArray?this.arrayLength:1),u=Math.floor(s/c),f=`${n}_rawChannels`,d=`${n}_rawBits`,p=`${n}_unpackedValue`,g=`${r} ${p};`,m=`uint ${d};`;i.push(g),i.push(m);let y=`${ZK[s]} ${f} = ${e};`;i.push(y);let A=rXe[Lt.category(o)],b=c>1;for(let x=0;x<c;x++){let T="rgba".slice(x*u,(x+1)*u),E=s>1?`.${T}`:"",v=`${d} = czm_unpackTexture(${f}${E});`,S="";b&&(S=`[${x}]`);let I="",R="";if(this.normalized){let L=Lt.getMaximum(o);I=` * ${1/Number(L)}`,R="float"}let O=`${p}${S} = ${R}(${A}(${d}))${I};`;i.push(v),i.push(O)}return p};ss.prototype.unpackTextureInShaderWebGL1=function(e){return this.normalized?e:`${this.getGlslTypeWebGL1()}(255.0 * ${e})`};var Vp=ss;function tL(e){e=e??H.EMPTY_OBJECT;let t=e.count,n=e.property,i=e.classProperty,r=e.bufferViews,o=i.type,s=i.isArray,a=i.isVariableLengthArray,c=i.valueType,u=i.enumType,f=o===bt.STRING,d=o===bt.BOOLEAN,p=0,g;if(a){let _=n.arrayOffsetType??n.offsetType;_=Lt[_]??Lt.UINT32;let C=n.arrayOffsets??n.arrayOffsetBufferView;g=new QK(r[C],_,t+1),p+=g.typedArray.byteLength}let m=bt.getComponentCount(o),y;a?y=g.get(t)-g.get(0):s?y=t*i.arrayLength:y=t;let A=m*y,b;if(f){let _=n.stringOffsetType??n.offsetType;_=Lt[_]??Lt.UINT32;let C=n.stringOffsets??n.stringOffsetBufferView;b=new QK(r[C],_,A+1),p+=b.typedArray.byteLength}(f||d)&&(c=Lt.UINT8);let x;f?x=b.get(A)-b.get(0):d?x=Math.ceil(A/8):x=A;let T=n.values??n.bufferView,E=new QK(r[T],c,x);p+=E.typedArray.byteLength;let v=n.offset,S=n.scale,I=i.hasValueTransform||l(v)||l(S);v=v??i.offset,S=S??i.scale,v=G0e(v),S=G0e(S);let R,O,L=this;f?R=function(_){return aXe(_,L._values,L._stringOffsets)}:d?(R=function(_){return cXe(_,L._values)},O=function(_,C){lXe(_,L._values,C)}):l(u)?(R=function(_){let C=L._values.get(_);return u.namesByValue[C]},O=function(_,C){let w=u.valuesByName[C];L._values.set(_,w)}):(R=function(_){return L._values.get(_)},O=function(_,C){L._values.set(_,C)}),this._arrayOffsets=g,this._stringOffsets=b,this._values=E,this._classProperty=i,this._count=t,this._vectorComponentCount=m,this._min=n.min,this._max=n.max,this._offset=v,this._scale=S,this._hasValueTransform=I,this._getValue=R,this._setValue=O,this._unpackedValues=void 0,this._extras=n.extras,this._extensions=n.extensions,this._byteLength=p}Object.defineProperties(tL.prototype,{hasValueTransform:{get:function(){return this._hasValueTransform}},offset:{get:function(){return this._offset}},scale:{get:function(){return this._scale}},extras:{get:function(){return this._extras}},extensions:{get:function(){return this._extensions}},byteLength:{get:function(){return this._byteLength}},classProperty:{get:function(){return this._classProperty}}});tL.prototype.get=function(e){let t=oXe(this,e);return t=this._classProperty.handleNoData(t),l(t)?(t=this._classProperty.normalize(t),t=_Xe(this,t),this._classProperty.unpackVectorAndMatrixTypes(t)):(t=this._classProperty.default,this._classProperty.unpackVectorAndMatrixTypes(t))};tL.prototype.set=function(e,t){let n=this._classProperty;t=n.packVectorAndMatrixTypes(t),t=yXe(this,t),t=n.unnormalize(t),sXe(this,e,t)};tL.prototype.getTypedArray=function(){if(l(this._values))return this._values.typedArray};function G0e(e){if(!Array.isArray(e)||!l(e.slice))return e;let t=[];for(let n=0;n<e.length;n++){let i=e[n];Array.isArray(i)?Zn(t,i):t.push(i)}return t}function oXe(e,t){q0e(e)&&Y0e(e);let n=e._classProperty,i=n.isArray,r=n.type,o=bt.getComponentCount(r);if(l(e._unpackedValues)){let s=e._unpackedValues[t];return i?Je(s,!0):s}return!i&&o===1?e._getValue(t):W0e(e,n,t)}function W0e(e,t,n){let i,r;if(t.isVariableLengthArray){i=e._arrayOffsets.get(n),r=e._arrayOffsets.get(n+1)-i;let s=bt.getComponentCount(t.type);i*=s,r*=s}else{let a=(t.arrayLength??1)*e._vectorComponentCount;i=n*a,r=a}let o=new Array(r);for(let s=0;s<r;s++)o[s]=e._getValue(i+s);return o}function sXe(e,t,n){pXe(e,t,n)&&Y0e(e);let i=e._classProperty,r=i.isArray,o=i.type,s=bt.getComponentCount(o);if(l(e._unpackedValues)){i.isArray&&(n=Je(n,!0)),e._unpackedValues[t]=n;return}if(!r&&s===1){e._setValue(t,n);return}let a,c;if(i.isVariableLengthArray)a=e._arrayOffsets.get(t),c=e._arrayOffsets.get(t+1)-a;else{let f=(i.arrayLength??1)*e._vectorComponentCount;a=t*f,c=f}for(let u=0;u<c;++u)e._setValue(a+u,n[u])}function aXe(e,t,n){let i=n.get(e),r=n.get(e+1)-i;return Uu(t.typedArray,i,r)}function cXe(e,t){let n=e>>3,i=e%8;return(t.typedArray[n]>>i&1)===1}function lXe(e,t,n){let i=e>>3,r=e%8;n?t.typedArray[i]|=1<<r:t.typedArray[i]&=~(1<<r)}function uXe(e,t){let n=t.dataView,i=e*8,r=0,o=(n.getUint8(i+7)&128)>0,s=!0;for(let a=0;a<8;++a){let c=n.getUint8(i+a);o&&(s?c!==0&&(c=~(c-1)&255,s=!1):c=~c&255),r+=c*Math.pow(256,a)}return o&&(r=-r),r}function fXe(e,t){let n=t.dataView,i=e*8,r=BigInt(0),o=(n.getUint8(i+7)&128)>0,s=!0;for(let a=0;a<8;++a){let c=n.getUint8(i+a);o&&(s?c!==0&&(c=~(c-1)&255,s=!1):c=~c&255),r+=BigInt(c)*(BigInt(1)<<BigInt(a*8))}return o&&(r=-r),r}function dXe(e,t){let n=t.dataView,i=e*8,r=n.getUint32(i,!0),o=n.getUint32(i+4,!0);return r+4294967296*o}function hXe(e,t){let n=t.dataView,i=e*8,r=BigInt(n.getUint32(i,!0)),o=BigInt(n.getUint32(i+4,!0));return r+BigInt(4294967296)*o}function mXe(e){switch(e){case Lt.INT8:return Y.BYTE;case Lt.UINT8:return Y.UNSIGNED_BYTE;case Lt.INT16:return Y.SHORT;case Lt.UINT16:return Y.UNSIGNED_SHORT;case Lt.INT32:return Y.INT;case Lt.UINT32:return Y.UNSIGNED_INT;case Lt.FLOAT32:return Y.FLOAT;case Lt.FLOAT64:return Y.DOUBLE}}function q0e(e){if(l(e._unpackedValues))return!1;let t=e._classProperty,n=t.type,i=t.valueType;return n===bt.STRING||i===Lt.INT64&&!dn.supportsBigInt64Array()||i===Lt.UINT64&&!dn.supportsBigUint64Array()}function pXe(e,t,n){if(q0e(e))return!0;let i=e._arrayOffsets;if(l(i)){let r=i.get(t+1)-i.get(t),o=n.length;if(r!==o)return!0}return!1}function Y0e(e){e._unpackedValues=gXe(e),e._arrayOffsets=void 0,e._stringOffsets=void 0,e._values=void 0}function gXe(e){let t=e._count,n=new Array(t),i=e._classProperty,r=i.isArray,o=i.type,s=bt.getComponentCount(o);if(!r&&s===1){for(let a=0;a<t;++a)n[a]=e._getValue(a);return n}for(let a=0;a<t;a++)n[a]=W0e(e,i,a);return n}function _Xe(e,t){let i=e._classProperty.isVariableLengthArray;return!e._hasValueTransform||i?t:Vp.valueTransformInPlace(t,e._offset,e._scale,Lt.applyValueTransform)}function yXe(e,t){let i=e._classProperty.isVariableLengthArray;return!e._hasValueTransform||i?t:Vp.valueTransformInPlace(t,e._offset,e._scale,Lt.unapplyValueTransform)}function QK(e,t,n){let i=this,r,o,s;if(t===Lt.INT64)dn.supportsBigInt()?dn.supportsBigInt64Array()?(r=new BigInt64Array(e.buffer,e.byteOffset,n),s=function(a,c){i.typedArray[a]=BigInt(c)}):(r=new Uint8Array(e.buffer,e.byteOffset,n*8),o=function(a){return fXe(a,i)}):(_t("INT64 type is not fully supported on this platform. Values greater than 2^53 - 1 or less than -(2^53 - 1) may lose precision when read."),r=new Uint8Array(e.buffer,e.byteOffset,n*8),o=function(a){return uXe(a,i)});else if(t===Lt.UINT64)dn.supportsBigInt()?dn.supportsBigUint64Array()?(r=new BigUint64Array(e.buffer,e.byteOffset,n),s=function(a,c){i.typedArray[a]=BigInt(c)}):(r=new Uint8Array(e.buffer,e.byteOffset,n*8),o=function(a){return hXe(a,i)}):(_t("UINT64 type is not fully supported on this platform. Values greater than 2^53 - 1 may lose precision when read."),r=new Uint8Array(e.buffer,e.byteOffset,n*8),o=function(a){return dXe(a,i)});else{let a=mXe(t);r=Y.createArrayBufferView(a,e.buffer,e.byteOffset,n),s=function(c,u){i.typedArray[c]=u}}l(o)||(o=function(a){return i.typedArray[a]}),this.typedArray=r,this.dataView=new DataView(r.buffer,r.byteOffset),this.get=o,this.set=s,this._componentType=t}var nL=tL;function cm(e){e=e??H.EMPTY_OBJECT;let t=e.count,n=e.class,i=0,r={};if(l(e.properties)){for(let o in e.properties)if(e.properties.hasOwnProperty(o)){let s=new nL({count:t,property:e.properties[o],classProperty:n.properties[o],bufferViews:e.bufferViews});r[o]=s,i+=s.byteLength}}this._count=t,this._class=n,this._properties=r,this._byteLength=i}Object.defineProperties(cm.prototype,{count:{get:function(){return this._count}},class:{get:function(){return this._class}},byteLength:{get:function(){return this._byteLength}},properties:{get:function(){return this._properties}}});cm.prototype.hasProperty=function(e){return Yn.hasProperty(e,this._properties,this._class)};cm.prototype.hasPropertyBySemantic=function(e){return Yn.hasPropertyBySemantic(e,this._properties,this._class)};cm.prototype.getPropertyIds=function(e){return Yn.getPropertyIds(this._properties,this._class,e)};cm.prototype.getProperty=function(e,t){let n=this._properties[t],i;return l(n)?i=n.get(e):i=AXe(this._class,t),i};cm.prototype.setProperty=function(e,t,n){let i=this._properties[t];return l(i)?(i.set(e,n),!0):!1};cm.prototype.getPropertyBySemantic=function(e,t){let n,i=this._class.propertiesBySemantic;if(l(i)&&(n=i[t]),l(n))return this.getProperty(e,n.id)};cm.prototype.setPropertyBySemantic=function(e,t,n){let i,r=this._class.propertiesBySemantic;return l(r)&&(i=r[t]),l(i)?this.setProperty(e,i.id,n):!1};cm.prototype.getPropertyTypedArray=function(e){let t=this._properties[e];if(l(t))return t.getTypedArray()};cm.prototype.getPropertyTypedArrayBySemantic=function(e){let t,n=this._class.propertiesBySemantic;if(l(n)&&(t=n[e]),l(t))return this.getPropertyTypedArray(t.id)};function AXe(e,t){let n=e.properties;if(!l(n))return;let i=n[t];if(l(i)&&l(i.default)){let r=i.default;return i.isArray&&(r=Je(r,!0)),r=i.normalize(r),i.unpackVectorAndMatrixTypes(r)}}var kd=cm;var e$=class{get cacheKey(){pe.throwInstantiationError()}load(){pe.throwInstantiationError()}unload(){}process(t){return!1}getError(t,n){l(n)&&l(n.message)&&(t+=` +`;var XN=`in vec3 v_positionEC; +in vec3 v_normalEC; +in vec2 v_st; +void main() +{ +vec3 positionToEyeEC = -v_positionEC; +vec3 normalEC = normalize(v_normalEC); +#ifdef FACE_FORWARD +normalEC = faceforward(normalEC, vec3(0.0, 0.0, 1.0), -normalEC); +#endif +czm_materialInput materialInput; +materialInput.normalEC = normalEC; +materialInput.positionToEyeEC = positionToEyeEC; +materialInput.st = v_st; +czm_material material = czm_getMaterial(materialInput); +#ifdef FLAT +out_FragColor = vec4(material.diffuse + material.emission, material.alpha); +#else +out_FragColor = czm_phong(normalize(positionToEyeEC), material, czm_lightDirectionEC); +#endif +} +`;var KN=`in vec3 position3DHigh; +in vec3 position3DLow; +in vec3 normal; +in vec2 st; +in float batchId; +out vec3 v_positionEC; +out vec3 v_normalEC; +out vec2 v_st; +void main() +{ +vec4 p = czm_computePosition(); +v_positionEC = (czm_modelViewRelativeToEye * p).xyz; +v_normalEC = czm_normal * normal; +v_st = st; +gl_Position = czm_modelViewProjectionRelativeToEye * p; +} +`;function Xx(e){e=e??H.EMPTY_OBJECT;let t=e.translucent??!0,n=e.closed??!1,i=e.materialSupport??Xx.MaterialSupport.TEXTURED;this.material=l(e.material)?e.material:er.fromType(er.ColorType),this.translucent=t,this._vertexShaderSource=e.vertexShaderSource??i.vertexShaderSource,this._fragmentShaderSource=e.fragmentShaderSource??i.fragmentShaderSource,this._renderState=wr.getDefaultRenderState(t,n,e.renderState),this._closed=n,this._materialSupport=i,this._vertexFormat=i.vertexFormat,this._flat=e.flat??!1,this._faceForward=e.faceForward??!n}Object.defineProperties(Xx.prototype,{vertexShaderSource:{get:function(){return this._vertexShaderSource}},fragmentShaderSource:{get:function(){return this._fragmentShaderSource}},renderState:{get:function(){return this._renderState}},closed:{get:function(){return this._closed}},materialSupport:{get:function(){return this._materialSupport}},vertexFormat:{get:function(){return this._vertexFormat}},flat:{get:function(){return this._flat}},faceForward:{get:function(){return this._faceForward}}});Xx.prototype.getFragmentShaderSource=wr.prototype.getFragmentShaderSource;Xx.prototype.isTranslucent=wr.prototype.isTranslucent;Xx.prototype.getRenderState=wr.prototype.getRenderState;Xx.MaterialSupport={BASIC:Object.freeze({vertexFormat:Be.POSITION_AND_NORMAL,vertexShaderSource:YN,fragmentShaderSource:qN}),TEXTURED:Object.freeze({vertexFormat:Be.POSITION_NORMAL_AND_ST,vertexShaderSource:KN,fragmentShaderSource:XN}),ALL:Object.freeze({vertexFormat:Be.ALL,vertexShaderSource:WN,fragmentShaderSource:GN})};var Er=Xx;function Hv(e,t){this._primitives=e,this._orderedGroundPrimitives=t,this._dynamicUpdaters=new Ut}Hv.prototype.add=function(e,t){this._dynamicUpdaters.set(t.id,t.createDynamicUpdater(this._primitives,this._orderedGroundPrimitives))};Hv.prototype.remove=function(e){let t=e.id,n=this._dynamicUpdaters.get(t);l(n)&&(this._dynamicUpdaters.remove(t),n.destroy())};Hv.prototype.update=function(e){let t=this._dynamicUpdaters.values;for(let n=0,i=t.length;n<i;n++)t[n].update(e);return!0};Hv.prototype.removeAllPrimitives=function(){let e=this._dynamicUpdaters.values;for(let t=0,n=e.length;t<n;t++)e[t].destroy();this._dynamicUpdaters.removeAll()};Hv.prototype.getBoundingSphere=function(e,t){return e=this._dynamicUpdaters.get(e.id),l(e)&&l(e.getBoundingSphere)?e.getBoundingSphere(t):Pt.FAILED};var Kx=Hv;var Mqe=new h;function jp(e){e=e??H.EMPTY_OBJECT;let t=e.minimum,n=e.maximum;this._min=h.clone(t),this._max=h.clone(n),this._offsetAttribute=e.offsetAttribute,this._workerName="createBoxOutlineGeometry"}jp.fromDimensions=function(e){e=e??H.EMPTY_OBJECT;let t=e.dimensions,n=h.multiplyByScalar(t,.5,new h);return new jp({minimum:h.negate(n,new h),maximum:n,offsetAttribute:e.offsetAttribute})};jp.fromAxisAlignedBoundingBox=function(e){return new jp({minimum:e.minimum,maximum:e.maximum})};jp.packedLength=2*h.packedLength+1;jp.pack=function(e,t,n){return n=n??0,h.pack(e._min,t,n),h.pack(e._max,t,n+h.packedLength),t[n+h.packedLength*2]=e._offsetAttribute??-1,t};var pge=new h,gge=new h,mge={minimum:pge,maximum:gge,offsetAttribute:void 0};jp.unpack=function(e,t,n){t=t??0;let i=h.unpack(e,t,pge),r=h.unpack(e,t+h.packedLength,gge),o=e[t+h.packedLength*2];return l(n)?(n._min=h.clone(i,n._min),n._max=h.clone(r,n._max),n._offsetAttribute=o===-1?void 0:o,n):(mge.offsetAttribute=o===-1?void 0:o,new jp(mge))};jp.createGeometry=function(e){let t=e._min,n=e._max;if(h.equals(t,n))return;let i=new Tn,r=new Uint16Array(24),o=new Float64Array(24);o[0]=t.x,o[1]=t.y,o[2]=t.z,o[3]=n.x,o[4]=t.y,o[5]=t.z,o[6]=n.x,o[7]=n.y,o[8]=t.z,o[9]=t.x,o[10]=n.y,o[11]=t.z,o[12]=t.x,o[13]=t.y,o[14]=n.z,o[15]=n.x,o[16]=t.y,o[17]=n.z,o[18]=n.x,o[19]=n.y,o[20]=n.z,o[21]=t.x,o[22]=n.y,o[23]=n.z,i.position=new Ne({componentDatatype:Y.DOUBLE,componentsPerAttribute:3,values:o}),r[0]=4,r[1]=5,r[2]=5,r[3]=6,r[4]=6,r[5]=7,r[6]=7,r[7]=4,r[8]=0,r[9]=1,r[10]=1,r[11]=2,r[12]=2,r[13]=3,r[14]=3,r[15]=0,r[16]=0,r[17]=4,r[18]=1,r[19]=5,r[20]=2,r[21]=6,r[22]=3,r[23]=7;let s=h.subtract(n,t,Mqe),a=h.magnitude(s)*.5;if(l(e._offsetAttribute)){let c=o.length,u=e._offsetAttribute===mn.NONE?0:1,f=new Uint8Array(c/3).fill(u);i.applyOffset=new Ne({componentDatatype:Y.UNSIGNED_BYTE,componentsPerAttribute:1,values:f})}return new St({attributes:i,indices:r,primitiveType:Oe.LINES,boundingSphere:new ue(h.ZERO,a),offsetAttribute:e._offsetAttribute})};var sm=jp;function $N(e,t){e=e??0,t=t??Number.MAX_VALUE,this.value=new Float32Array([e,t])}Object.defineProperties($N.prototype,{componentDatatype:{get:function(){return Y.FLOAT}},componentsPerAttribute:{get:function(){return 2}},normalize:{get:function(){return!1}}});$N.fromDistanceDisplayCondition=function(e){return new $N(e.near,e.far)};$N.toValue=function(e,t){return l(t)?(t[0]=e.near,t[1]=e.far,t):new Float32Array([e.near,e.far])};var ti=$N;function k6(e){e=e??!0,this.value=k6.toValue(e)}Object.defineProperties(k6.prototype,{componentDatatype:{get:function(){return Y.UNSIGNED_BYTE}},componentsPerAttribute:{get:function(){return 1}},normalize:{get:function(){return!1}}});k6.toValue=function(e,t){return l(t)?(t[0]=e,t):new Uint8Array([e])};var Dn=k6;function Gv(){pe.throwInstantiationError()}Object.defineProperties(Gv.prototype,{isConstant:{get:pe.throwInstantiationError},definitionChanged:{get:pe.throwInstantiationError}});Gv.prototype.getType=pe.throwInstantiationError;Gv.prototype.getValue=pe.throwInstantiationError;Gv.prototype.equals=pe.throwInstantiationError;var Nqe=new K;Gv.getValue=function(e,t,n){let i;return l(e)||(e=K.now(Nqe)),l(t)&&(i=t.getType(e),l(i))?((!l(n)||n.type!==i)&&(n=er.fromType(i)),t.getValue(e,n.uniforms),n):((!l(n)||n.type!==er.ColorType)&&(n=er.fromType(er.ColorType)),z.clone(z.WHITE,n.uniforms.color),n)};var yo=Gv;function $x(e,t,n){this._primitives=t,this._orderedGroundPrimitives=n,this._primitive=void 0,this._outlinePrimitive=void 0,this._geometryUpdater=e,this._options=e._options,this._entity=e._entity,this._material=void 0}$x.prototype._isHidden=function(e,t,n){return!e.isShowing||!e.isAvailable(n)||!X.getValueOrDefault(t.show,n,!0)};$x.prototype._setOptions=pe.throwInstantiationError;$x.prototype.update=function(e){let t=this._geometryUpdater,n=t._onTerrain,i=this._primitives,r=this._orderedGroundPrimitives;n?r.remove(this._primitive):(i.removeAndDestroy(this._primitive),i.removeAndDestroy(this._outlinePrimitive),this._outlinePrimitive=void 0),this._primitive=void 0;let o=this._entity,s=o[this._geometryUpdater._geometryPropertyName];if(this._setOptions(o,s,e),this._isHidden(o,s,e))return;let a=this._geometryUpdater.shadowsProperty.getValue(e),c=this._options;if(!l(s.fill)||s.fill.getValue(e)){let u=t.fillMaterialProperty,f=u instanceof Kt,d,p=t._getIsClosed(c);if(f)d=new yn({closed:p,flat:n&&!t._supportsMaterialsforEntitiesOnTerrain});else{let g=yo.getValue(e,u,this._material);this._material=g,d=new Er({material:g,translucent:g.isTranslucent(),closed:p})}if(n)c.vertexFormat=yn.VERTEX_FORMAT,this._primitive=r.add(new Xl({geometryInstances:this._geometryUpdater.createFillGeometryInstance(e),appearance:d,asynchronous:!1,shadows:a,classificationType:this._geometryUpdater.classificationTypeProperty.getValue(e)}),X.getValueOrUndefined(this._geometryUpdater.zIndex,e));else{c.vertexFormat=d.vertexFormat;let g=this._geometryUpdater.createFillGeometryInstance(e);f&&(d.translucent=g.attributes.color.value[3]!==255),this._primitive=i.add(new On({geometryInstances:g,appearance:d,asynchronous:!1,shadows:a}))}}if(!n&&l(s.outline)&&s.outline.getValue(e)){let u=this._geometryUpdater.createOutlineGeometryInstance(e),f=X.getValueOrDefault(s.outlineWidth,e,1);this._outlinePrimitive=i.add(new On({geometryInstances:u,appearance:new yn({flat:!0,translucent:u.attributes.color.value[3]!==255,renderState:{lineWidth:t._scene.clampLineWidth(f)}}),asynchronous:!1,shadows:a}))}};$x.prototype.getBoundingSphere=function(e){let t=this._entity,n=this._primitive,i=this._outlinePrimitive,r;return l(n)&&n.show&&n.ready&&(r=n.getGeometryInstanceAttributes(t),l(r)&&l(r.boundingSphere))?(ue.clone(r.boundingSphere,e),Pt.DONE):l(i)&&i.show&&i.ready&&(r=i.getGeometryInstanceAttributes(t),l(r)&&l(r.boundingSphere))?(ue.clone(r.boundingSphere,e),Pt.DONE):l(n)&&!n.ready||l(i)&&!i.ready?Pt.PENDING:Pt.FAILED};$x.prototype.isDestroyed=function(){return!1};$x.prototype.destroy=function(){let e=this._primitives,t=this._orderedGroundPrimitives;this._geometryUpdater._onTerrain?t.remove(this._primitive):e.removeAndDestroy(this._primitive),e.removeAndDestroy(this._outlinePrimitive),le(this)};var Ii=$x;var _ge={};function JN(e,t){l(_ge[e])||(_ge[e]=!0,console.warn(t??e))}JN.geometryOutlines="Entity geometry outlines are unsupported on terrain. Outlines will be disabled. To enable outlines, disable geometry terrain clamping by explicitly setting height to 0.";JN.geometryZIndex="Entity geometry with zIndex are unsupported when height or extrudedHeight are defined. zIndex will be ignored";JN.geometryHeightReference="Entity corridor, ellipse, polygon or rectangle with heightReference must also have a defined height. heightReference will be ignored";JN.geometryExtrudedHeightReference="Entity corridor, ellipse, polygon or rectangle with extrudedHeightReference must also have a defined extrudedHeight. extrudedHeightReference will be ignored";var _t=JN;var Lqe=new Kt(z.WHITE),Fqe=new ui(!0),Bqe=new ui(!0),kqe=new ui(!1),Uqe=new ui(z.BLACK),zqe=new ui(Pn.DISABLED),Vqe=new ui(new Ht),jqe=new ui(Qn.BOTH);function Zl(e){let t=e.entity,n=e.geometryPropertyName;this._entity=t,this._scene=e.scene,this._fillEnabled=!1,this._isClosed=!1,this._onTerrain=!1,this._dynamic=!1,this._outlineEnabled=!1,this._geometryChanged=new be,this._showProperty=void 0,this._materialProperty=void 0,this._showOutlineProperty=void 0,this._outlineColorProperty=void 0,this._outlineWidth=1,this._shadowsProperty=void 0,this._distanceDisplayConditionProperty=void 0,this._classificationTypeProperty=void 0,this._options=e.geometryOptions,this._geometryPropertyName=n,this._id=`${n}-${t.id}`,this._observedPropertyNames=e.observedPropertyNames,this._supportsMaterialsforEntitiesOnTerrain=Jr.supportsMaterialsforEntitiesOnTerrain(e.scene)}Object.defineProperties(Zl.prototype,{id:{get:function(){return this._id}},entity:{get:function(){return this._entity}},fillEnabled:{get:function(){return this._fillEnabled}},hasConstantFill:{get:function(){return!this._fillEnabled||!l(this._entity.availability)&&X.isConstant(this._showProperty)&&X.isConstant(this._fillProperty)}},fillMaterialProperty:{get:function(){return this._materialProperty}},outlineEnabled:{get:function(){return this._outlineEnabled}},hasConstantOutline:{get:function(){return!this._outlineEnabled||!l(this._entity.availability)&&X.isConstant(this._showProperty)&&X.isConstant(this._showOutlineProperty)}},outlineColorProperty:{get:function(){return this._outlineColorProperty}},outlineWidth:{get:function(){return this._outlineWidth}},shadowsProperty:{get:function(){return this._shadowsProperty}},distanceDisplayConditionProperty:{get:function(){return this._distanceDisplayConditionProperty}},classificationTypeProperty:{get:function(){return this._classificationTypeProperty}},isDynamic:{get:function(){return this._dynamic}},isClosed:{get:function(){return this._isClosed}},onTerrain:{get:function(){return this._onTerrain}},geometryChanged:{get:function(){return this._geometryChanged}}});Zl.prototype.isOutlineVisible=function(e){let t=this._entity;return(this._outlineEnabled&&t.isAvailable(e)&&this._showProperty.getValue(e)&&this._showOutlineProperty.getValue(e))??!1};Zl.prototype.isFilled=function(e){let t=this._entity;return(this._fillEnabled&&t.isAvailable(e)&&this._showProperty.getValue(e)&&this._fillProperty.getValue(e))??!1};Zl.prototype.createFillGeometryInstance=pe.throwInstantiationError;Zl.prototype.createOutlineGeometryInstance=pe.throwInstantiationError;Zl.prototype.isDestroyed=function(){return!1};Zl.prototype.destroy=function(){le(this)};Zl.prototype._isHidden=function(e,t){let n=t.show;return l(n)&&n.isConstant&&!n.getValue(nt.MINIMUM_VALUE)};Zl.prototype._isOnTerrain=function(e,t){return!1};Zl.prototype._getIsClosed=function(e){return!0};Zl.prototype._isDynamic=pe.throwInstantiationError;Zl.prototype._setStaticOptions=pe.throwInstantiationError;Zl.prototype._onEntityPropertyChanged=function(e,t,n,i){if(this._observedPropertyNames.indexOf(t)===-1)return;let r=this._entity[this._geometryPropertyName];if(!l(r)){(this._fillEnabled||this._outlineEnabled)&&(this._fillEnabled=!1,this._outlineEnabled=!1,this._geometryChanged.raiseEvent(this));return}let o=r.fill,s=l(o)&&o.isConstant?o.getValue(nt.MINIMUM_VALUE):!0,a=r.outline,c=l(a);if(c&&a.isConstant&&(c=a.getValue(nt.MINIMUM_VALUE)),!s&&!c){(this._fillEnabled||this._outlineEnabled)&&(this._fillEnabled=!1,this._outlineEnabled=!1,this._geometryChanged.raiseEvent(this));return}let u=r.show;if(this._isHidden(e,r)){(this._fillEnabled||this._outlineEnabled)&&(this._fillEnabled=!1,this._outlineEnabled=!1,this._geometryChanged.raiseEvent(this));return}this._materialProperty=r.material??Lqe,this._fillProperty=o??Bqe,this._showProperty=u??Fqe,this._showOutlineProperty=r.outline??kqe,this._outlineColorProperty=c?r.outlineColor??Uqe:void 0,this._shadowsProperty=r.shadows??zqe,this._distanceDisplayConditionProperty=r.distanceDisplayCondition??Vqe,this._classificationTypeProperty=r.classificationType??jqe,this._fillEnabled=s;let f=this._isOnTerrain(e,r)&&(this._supportsMaterialsforEntitiesOnTerrain||this._materialProperty instanceof Kt);if(c&&f&&(_t(_t.geometryOutlines),c=!1),this._onTerrain=f,this._outlineEnabled=c,this._isDynamic(e,r))this._dynamic||(this._dynamic=!0,this._geometryChanged.raiseEvent(this));else{this._setStaticOptions(e,r),this._isClosed=this._getIsClosed(this._options);let d=r.outlineWidth;this._outlineWidth=l(d)?d.getValue(nt.MINIMUM_VALUE):1,this._dynamic=!1,this._geometryChanged.raiseEvent(this)}};Zl.prototype.createDynamicUpdater=function(e,t){return new this.constructor.DynamicGeometryUpdater(this,e,t)};var Pi=Zl;function Wv(e,t){this._callback=void 0,this._isConstant=void 0,this._definitionChanged=new be,this.setCallback(e,t)}Object.defineProperties(Wv.prototype,{isConstant:{get:function(){return this._isConstant}},definitionChanged:{get:function(){return this._definitionChanged}}});var Hqe=new K;Wv.prototype.getValue=function(e,t){return l(e)||(e=K.now(Hqe)),this._callback(e,t)};Wv.prototype.setCallback=function(e,t){let n=this._callback!==e||this._isConstant!==t;this._callback=e,this._isConstant=t,n&&this._definitionChanged.raiseEvent(this)};Wv.prototype.equals=function(e){return this===e||e instanceof Wv&&this._callback===e._callback&&this._isConstant===e._isConstant};var am=Wv;var yge=new h;function qv(e,t,n,i){this._scene=e,this._heightReference=n,this._extrudedHeightReference=i,this._positionProperty=t,this._position=new h,this._cartographicPosition=new he,this._normal=new h,this._definitionChanged=new be,this._terrainHeight=0,this._removeCallbackFunc=void 0,this._removeEventListener=void 0,this._removeModeListener=void 0;let r=this;if(l(e.globe)&&(this._removeEventListener=e.terrainProviderChanged.addEventListener(function(){r._updateClamping()}),this._removeModeListener=e.morphComplete.addEventListener(function(){r._updateClamping()})),t.isConstant){let o=t.getValue(nt.MINIMUM_VALUE,yge);if(!l(o)||h.equals(o,h.ZERO)||!l(e.globe))return;this._position=h.clone(o,this._position),this._updateClamping(),this._normal=e.ellipsoid.geodeticSurfaceNormal(o,this._normal)}}Object.defineProperties(qv.prototype,{isConstant:{get:function(){return!1}},definitionChanged:{get:function(){return this._definitionChanged}}});qv.prototype._updateClamping=function(){l(this._removeCallbackFunc)&&this._removeCallbackFunc();let e=this._scene,t=this._position;if(h.equals(t,h.ZERO)){this._terrainHeight=0;return}let i=e.ellipsoid.cartesianToCartographic(t,this._cartographicPosition),r=e.getHeight(i,this._heightReference);l(r)?this._terrainHeight=r:this._terrainHeight=0;let o=s=>{this._terrainHeight=s.height,this.definitionChanged.raiseEvent()};this._removeCallbackFunc=e.updateHeight(i,o,this._heightReference)};var Gqe=new K;qv.prototype.getValue=function(e,t){l(e)||(e=K.now(Gqe));let n=X.getValueOrDefault(this._heightReference,e,We.NONE),i=X.getValueOrDefault(this._extrudedHeightReference,e,We.NONE);if(n===We.NONE&&!qy(i))return this._position=h.clone(h.ZERO,this._position),h.clone(h.ZERO,t);if(this._positionProperty.isConstant&&n!==We.CLIP_TO_GROUND)return h.multiplyByScalar(this._normal,this._terrainHeight,t);let r=this._scene,o=this._positionProperty.getValue(e,yge);if(!l(o)||h.equals(o,h.ZERO)||!l(r.globe))return h.clone(h.ZERO,t);if(h.equalsEpsilon(this._position,o,D.EPSILON10)&&n!==We.CLIP_TO_GROUND)return h.multiplyByScalar(this._normal,this._terrainHeight,t);this._position=h.clone(o,this._position),this._updateClamping();let s=r.ellipsoid.geodeticSurfaceNormal(o,this._normal);if(n===We.CLIP_TO_GROUND){let c=r.globe.ellipsoid.cartesianToCartographic(o,scratchCarto);return this._terrainHeight>=c.height?h.multiplyByScalar(s,this._terrainHeight-c.height,t):h.clone(h.ZERO,t)}return h.multiplyByScalar(s,this._terrainHeight,t)};qv.prototype.isDestroyed=function(){return!1};qv.prototype.destroy=function(){return l(this._removeEventListener)&&this._removeEventListener(),l(this._removeModeListener)&&this._removeModeListener(),l(this._removeCallbackFunc)&&this._removeCallbackFunc(),le(this)};var Jx=qv;function Wqe(e,t,n,i){if(Pi.prototype._onEntityPropertyChanged.call(this,e,t,n,i),this._observedPropertyNames.indexOf(t)===-1)return;let r=this._entity[this._geometryPropertyName];if(!l(r))return;l(this._terrainOffsetProperty)&&(this._terrainOffsetProperty.destroy(),this._terrainOffsetProperty=void 0);let o=r.heightReference;if(l(o)){let s=new am(this._computeCenter.bind(this),!this._dynamic);this._terrainOffsetProperty=new Jx(this._scene,s,o)}}var Og=Wqe;var Age=h.ZERO,bge=new h,qqe=new h,xge=new z;function Yqe(e){this.id=e,this.vertexFormat=void 0,this.dimensions=void 0,this.offsetAttribute=void 0}function Mf(e,t){Pi.call(this,{entity:e,scene:t,geometryOptions:new Yqe(e),geometryPropertyName:"box",observedPropertyNames:["availability","position","orientation","box"]}),this._onEntityPropertyChanged(e,"box",e.box,void 0)}l(Object.create)&&(Mf.prototype=Object.create(Pi.prototype),Mf.prototype.constructor=Mf);Object.defineProperties(Mf.prototype,{terrainOffsetProperty:{get:function(){return this._terrainOffsetProperty}}});Mf.prototype.createFillGeometryInstance=function(e){let t=this._entity,n=t.isAvailable(e),i=new Dn(n&&t.isShowing&&this._showProperty.getValue(e)&&this._fillProperty.getValue(e)),r=this._distanceDisplayConditionProperty.getValue(e),o=ti.fromDistanceDisplayCondition(r),s={show:i,distanceDisplayCondition:o,color:void 0,offset:void 0};if(this._materialProperty instanceof Kt){let a;l(this._materialProperty.color)&&(this._materialProperty.color.isConstant||n)&&(a=this._materialProperty.color.getValue(e,xge)),l(a)||(a=z.WHITE),s.color=Jt.fromColor(a)}return l(this._options.offsetAttribute)&&(s.offset=Tr.fromCartesian3(X.getValueOrDefault(this._terrainOffsetProperty,e,Age,bge))),new Ft({id:t,geometry:Ic.fromDimensions(this._options),modelMatrix:t.computeModelMatrixForHeightReference(e,t.box.heightReference,this._options.dimensions.z*.5,this._scene.ellipsoid),attributes:s})};Mf.prototype.createOutlineGeometryInstance=function(e){let t=this._entity,n=t.isAvailable(e),i=X.getValueOrDefault(this._outlineColorProperty,e,z.BLACK,xge),r=this._distanceDisplayConditionProperty.getValue(e),o={show:new Dn(n&&t.isShowing&&this._showProperty.getValue(e)&&this._showOutlineProperty.getValue(e)),color:Jt.fromColor(i),distanceDisplayCondition:ti.fromDistanceDisplayCondition(r),offset:void 0};return l(this._options.offsetAttribute)&&(o.offset=Tr.fromCartesian3(X.getValueOrDefault(this._terrainOffsetProperty,e,Age,bge))),new Ft({id:t,geometry:sm.fromDimensions(this._options),modelMatrix:t.computeModelMatrixForHeightReference(e,t.box.heightReference,this._options.dimensions.z*.5,this._scene.ellipsoid),attributes:o})};Mf.prototype._computeCenter=function(e,t){return X.getValueOrUndefined(this._entity.position,e,t)};Mf.prototype._isHidden=function(e,t){return!l(t.dimensions)||!l(e.position)||Pi.prototype._isHidden.call(this,e,t)};Mf.prototype._isDynamic=function(e,t){return!e.position.isConstant||!X.isConstant(e.orientation)||!t.dimensions.isConstant||!X.isConstant(t.outlineWidth)};Mf.prototype._setStaticOptions=function(e,t){let n=X.getValueOrDefault(t.heightReference,nt.MINIMUM_VALUE,We.NONE),i=this._options;i.vertexFormat=this._materialProperty instanceof Kt?yn.VERTEX_FORMAT:Er.MaterialSupport.TEXTURED.vertexFormat,i.dimensions=t.dimensions.getValue(nt.MINIMUM_VALUE,i.dimensions),i.offsetAttribute=n!==We.NONE?mn.ALL:void 0};Mf.prototype._onEntityPropertyChanged=Og;Mf.DynamicGeometryUpdater=Yv;function Yv(e,t,n){Ii.call(this,e,t,n)}l(Object.create)&&(Yv.prototype=Object.create(Ii.prototype),Yv.prototype.constructor=Yv);Yv.prototype._isHidden=function(e,t,n){let i=X.getValueOrUndefined(e.position,n,qqe),r=this._options.dimensions;return!l(i)||!l(r)||Ii.prototype._isHidden.call(this,e,t,n)};Yv.prototype._setOptions=function(e,t,n){let i=X.getValueOrDefault(t.heightReference,n,We.NONE),r=this._options;r.dimensions=X.getValueOrUndefined(t.dimensions,n,r.dimensions),r.offsetAttribute=i!==We.NONE?mn.ALL:void 0};var ZN=Mf;var Tge={ROUNDED:0,MITERED:1,BEVELED:2};Object.freeze(Tge);var tr=Tge;var Ql={};Ql.numberOfPoints=function(e,t,n){let i=h.distance(e,t);return Math.ceil(i/n)};Ql.numberOfPointsRhumbLine=function(e,t,n){let i=Math.pow(e.longitude-t.longitude,2)+Math.pow(e.latitude-t.latitude,2);return Math.max(1,Math.ceil(Math.sqrt(i/(n*n))))};var Xqe=new he;Ql.extractHeights=function(e,t){let n=e.length,i=new Array(n);for(let r=0;r<n;r++){let o=e[r];i[r]=t.cartesianToCartographic(o,Xqe).height}return i};var Kqe=new N,$qe=new h,Ege=new h,Jqe=new sn(h.UNIT_X,0),Cge=new h,Zqe=new sn(h.UNIT_X,0),Qqe=new h,eYe=new h,t$=[];function Sge(e,t,n){let i=t$;i.length=e;let r;if(t===n){for(r=0;r<e;r++)i[r]=t;return i}let s=(n-t)/e;for(r=0;r<e;r++){let a=t+r*s;i[r]=a}return i}var z6=new he,U6=new he,Qy=new h,n$=new h,tYe=new h,e$=new gg,QN=new Dc;function nYe(e,t,n,i,r,o,s,a){let c=i.scaleToGeodeticSurface(e,n$),u=i.scaleToGeodeticSurface(t,tYe),f=Ql.numberOfPoints(e,t,n),d=i.cartesianToCartographic(c,z6),p=i.cartesianToCartographic(u,U6),g=Sge(f,r,o);e$.setEndPoints(d,p);let m=e$.surfaceDistance/f,y=a;d.height=r;let A=i.cartographicToCartesian(d,Qy);h.pack(A,s,y),y+=3;for(let b=1;b<f;b++){let x=e$.interpolateUsingSurfaceDistance(b*m,U6);x.height=g[b],A=i.cartographicToCartesian(x,Qy),h.pack(A,s,y),y+=3}return y}function iYe(e,t,n,i,r,o,s,a){let c=i.cartesianToCartographic(e,z6),u=i.cartesianToCartographic(t,U6),f=Ql.numberOfPointsRhumbLine(c,u,n);c.height=0,u.height=0;let d=Sge(f,r,o);QN.ellipsoid.equals(i)||(QN=new Dc(void 0,void 0,i)),QN.setEndPoints(c,u);let p=QN.surfaceDistance/f,g=a;c.height=r;let m=i.cartographicToCartesian(c,Qy);h.pack(m,s,g),g+=3;for(let y=1;y<f;y++){let A=QN.interpolateUsingSurfaceDistance(y*p,U6);A.height=d[y],m=i.cartographicToCartesian(A,Qy),h.pack(m,s,g),g+=3}return g}Ql.wrapLongitude=function(e,t){let n=[],i=[];if(l(e)&&e.length>0){t=t??N.IDENTITY;let r=N.inverseTransformation(t,Kqe),o=N.multiplyByPoint(r,h.ZERO,$qe),s=h.normalize(N.multiplyByPointAsVector(r,h.UNIT_Y,Ege),Ege),a=sn.fromPointNormal(o,s,Jqe),c=h.normalize(N.multiplyByPointAsVector(r,h.UNIT_X,Cge),Cge),u=sn.fromPointNormal(o,c,Zqe),f=1;n.push(h.clone(e[0]));let d=n[0],p=e.length;for(let g=1;g<p;++g){let m=e[g];if(sn.getPointDistance(u,d)<0||sn.getPointDistance(u,m)<0){let y=_i.lineSegmentPlane(d,m,a,Qqe);if(l(y)){let A=h.multiplyByScalar(s,5e-9,eYe);sn.getPointDistance(a,d)<0&&h.negate(A,A),n.push(h.add(y,A,new h)),i.push(f+1),h.negate(A,A),n.push(h.add(y,A,new h)),f=1}}n.push(h.clone(e[g])),f++,d=m}i.push(f)}return{positions:n,lengths:i}};Ql.generateArc=function(e){l(e)||(e={});let t=e.positions,n=t.length,i=e.ellipsoid??ee.default,r=e.height??0,o=Array.isArray(r);if(n<1)return[];if(n===1){let y=i.scaleToGeodeticSurface(t[0],n$);if(r=o?r[0]:r,r!==0){let A=i.geodeticSurfaceNormal(y,Qy);h.multiplyByScalar(A,r,A),h.add(y,A,y)}return[y.x,y.y,y.z]}let s=e.minDistance;if(!l(s)){let y=e.granularity??D.RADIANS_PER_DEGREE;s=D.chordLength(y,i.maximumRadius)}let a=0,c;for(c=0;c<n-1;c++)a+=Ql.numberOfPoints(t[c],t[c+1],s);let u=(a+1)*3,f=new Array(u),d=0;for(c=0;c<n-1;c++){let y=t[c],A=t[c+1],b=o?r[c]:r,x=o?r[c+1]:r;d=nYe(y,A,s,i,b,x,f,d)}t$.length=0;let p=t[n-1],g=i.cartesianToCartographic(p,z6);g.height=o?r[n-1]:r;let m=i.cartographicToCartesian(g,Qy);return h.pack(m,f,u-3),f};var vge=new he,rYe=new he;Ql.generateRhumbArc=function(e){l(e)||(e={});let t=e.positions,n=t.length,i=e.ellipsoid??ee.default,r=e.height??0,o=Array.isArray(r);if(n<1)return[];if(n===1){let b=i.scaleToGeodeticSurface(t[0],n$);if(r=o?r[0]:r,r!==0){let x=i.geodeticSurfaceNormal(b,Qy);h.multiplyByScalar(x,r,x),h.add(b,x,b)}return[b.x,b.y,b.z]}let s=e.granularity??D.RADIANS_PER_DEGREE,a=0,c,u=i.cartesianToCartographic(t[0],vge),f;for(c=0;c<n-1;c++)f=i.cartesianToCartographic(t[c+1],rYe),a+=Ql.numberOfPointsRhumbLine(u,f,s),u=he.clone(f,vge);let d=(a+1)*3,p=new Array(d),g=0;for(c=0;c<n-1;c++){let b=t[c],x=t[c+1],T=o?r[c]:r,E=o?r[c+1]:r;g=iYe(b,x,s,i,T,E,p,g)}t$.length=0;let m=t[n-1],y=i.cartesianToCartographic(m,z6);y.height=o?r[n-1]:r;let A=i.cartographicToCartesian(y,Qy);return h.pack(A,p,d-3),p};Ql.generateCartesianArc=function(e){let t=Ql.generateArc(e),n=t.length/3,i=new Array(n);for(let r=0;r<n;r++)i[r]=h.unpack(t,r*3);return i};Ql.generateCartesianRhumbArc=function(e){let t=Ql.generateRhumbArc(e),n=t.length/3,i=new Array(n);for(let r=0;r<n;r++)i[r]=h.unpack(t,r*3);return i};var nr=Ql;var fc=[new h,new h],oYe=new h,sYe=new h,aYe=new h,cYe=new h,lYe=new h,uYe=new h,fYe=new h,dYe=new h,hYe=new h,Xv=new h,V6=new h,eL={},i$=new he;function mYe(e,t){let n=new Array(e.length);for(let i=0;i<e.length;i++){let r=e[i];i$=t.cartesianToCartographic(r,i$),n[i]=i$.height,e[i]=t.scaleToGeodeticSurface(r,r)}return n}function r$(e,t,n,i){let r=e[0],o=e[1],s=h.angleBetween(r,o),a=Math.ceil(s/i),c=new Array(a),u;if(t===n){for(u=0;u<a;u++)c[u]=t;return c.push(n),c}let d=(n-t)/a;for(u=1;u<a;u++){let p=t+u*d;c[u]=p}return c[0]=t,c.push(n),c}var j6=new h,H6=new h;function pYe(e,t,n,i){let r=new js(n,i),o=r.projectPointOntoPlane(h.add(n,e,j6),j6),s=r.projectPointOntoPlane(h.add(n,t,H6),H6),a=U.angleBetween(o,s);return s.x*o.y-s.y*o.x>=0?-a:a}var gYe=new h(-1,0,0),Zx=new N,_Ye=new N,o$=new $,yYe=$.IDENTITY.clone(),AYe=new h,bYe=new se,wge=new h;function Mg(e,t,n,i,r,o,s,a){let c=AYe,u=bYe;Zx=At.eastNorthUpToFixedFrame(e,r,Zx),c=N.multiplyByPointAsVector(Zx,gYe,c),c=h.normalize(c,c);let f=pYe(c,t,e,r);o$=$.fromRotationZ(f,o$),wge.z=o,Zx=N.multiplyTransformation(Zx,N.fromRotationTranslation(o$,wge,_Ye),Zx);let d=yYe;d[0]=s;for(let p=0;p<a;p++)for(let g=0;g<n.length;g+=3)u=h.fromArray(n,g,u),u=$.multiplyByVector(d,u,u),u=N.multiplyByPoint(Zx,u,u),i.push(u.x,u.y,u.z);return i}var xYe=new h;function s$(e,t,n,i,r,o,s){for(let a=0;a<e.length;a+=3){let c=h.fromArray(e,a,xYe);i=Mg(c,t,n,i,r,o[a/3],s,1)}return i}function TYe(e,t){let n=e.length,i=new Array(n*6),r=0,o=t.x+t.width/2,s=t.y+t.height/2,a=e[0];i[r++]=a.x-o,i[r++]=0,i[r++]=a.y-s;for(let c=1;c<n;c++){a=e[c];let u=a.x-o,f=a.y-s;i[r++]=u,i[r++]=0,i[r++]=f,i[r++]=u,i[r++]=0,i[r++]=f}return a=e[0],i[r++]=a.x-o,i[r++]=0,i[r]=a.y-s,i}function Ige(e,t){let n=e.length,i=new Array(n*3),r=0,o=t.x+t.width/2,s=t.y+t.height/2;for(let a=0;a<n;a++)i[r++]=e[a].x-o,i[r++]=0,i[r++]=e[a].y-s;return i}var Pge=new Le,Dge=new h,Rge=new $;function Oge(e,t,n,i,r,o,s,a,c,u){let f=h.angleBetween(h.subtract(t,e,Xv),h.subtract(n,e,V6)),d=i===tr.BEVELED?0:Math.ceil(f/D.toRadians(5)),p;r?p=$.fromQuaternion(Le.fromAxisAngle(h.negate(e,Xv),f/(d+1),Pge),Rge):p=$.fromQuaternion(Le.fromAxisAngle(e,f/(d+1),Pge),Rge);let g,m;if(t=h.clone(t,Dge),d>0){let y=u?2:1;for(let A=0;A<d;A++)t=$.multiplyByVector(p,t,t),g=h.subtract(t,e,Xv),g=h.normalize(g,g),r||(g=h.negate(g,g)),m=o.scaleToGeodeticSurface(t,V6),s=Mg(m,g,a,s,o,c,1,y)}else g=h.subtract(t,e,Xv),g=h.normalize(g,g),r||(g=h.negate(g,g)),m=o.scaleToGeodeticSurface(t,V6),s=Mg(m,g,a,s,o,c,1,1),n=h.clone(n,Dge),g=h.subtract(n,e,Xv),g=h.normalize(g,g),r||(g=h.negate(g,g)),m=o.scaleToGeodeticSurface(n,V6),s=Mg(m,g,a,s,o,c,1,1);return s}eL.removeDuplicatesFromShape=function(e){let t=e.length,n=[];for(let i=t-1,r=0;r<t;i=r++){let o=e[i],s=e[r];U.equals(o,s)||n.push(s)}return n};eL.angleIsGreaterThanPi=function(e,t,n,i){let r=new js(n,i),o=r.projectPointOntoPlane(h.add(n,e,j6),j6),s=r.projectPointOntoPlane(h.add(n,t,H6),H6);return s.x*o.y-s.y*o.x>=0};var EYe=new h,CYe=new h;eL.computePositions=function(e,t,n,i,r){let o=i._ellipsoid,s=mYe(e,o),a=i._granularity,c=i._cornerType,u=r?TYe(t,n):Ige(t,n),f=r?Ige(t,n):void 0,d=n.height/2,p=n.width/2,g=e.length,m=[],y=r?[]:void 0,A=oYe,b=sYe,x=aYe,T=cYe,E=lYe,v=uYe,S=fYe,I=dYe,R=hYe,O=e[0],L=e[1];T=o.geodeticSurfaceNormal(O,T),A=h.subtract(L,O,A),A=h.normalize(A,A),I=h.cross(T,A,I),I=h.normalize(I,I);let _=s[0],C=s[1];r&&(y=Mg(O,I,f,y,o,_+d,1,1)),R=h.clone(O,R),O=L,b=h.negate(A,b);let w,P;for(let V=1;V<g-1;V++){let B=r?2:1;if(L=e[V+1],O.equals(L)){_t("Positions are too close and are considered equivalent with rounding error.");continue}A=h.subtract(L,O,A),A=h.normalize(A,A),T=o.geodeticSurfaceNormal(O,T);let j=h.multiplyByScalar(T,h.dot(A,T),EYe);h.subtract(A,j,j),h.normalize(j,j);let k=h.multiplyByScalar(T,h.dot(b,T),CYe);if(h.subtract(b,k,k),h.normalize(k,k),!D.equalsEpsilon(Math.abs(h.dot(j,k)),1,D.EPSILON7)){x=h.add(A,b,x),x=h.normalize(x,x),x=h.cross(x,T,x),x=h.cross(T,x,x),x=h.normalize(x,x);let q=1/Math.max(.25,h.magnitude(h.cross(x,b,Xv))),Q=eL.angleIsGreaterThanPi(A,b,O,o);Q?(E=h.add(O,h.multiplyByScalar(x,q*p,x),E),v=h.add(E,h.multiplyByScalar(I,p,v),v),fc[0]=h.clone(R,fc[0]),fc[1]=h.clone(v,fc[1]),w=r$(fc,_+d,C+d,a),P=nr.generateArc({positions:fc,granularity:a,ellipsoid:o}),m=s$(P,I,u,m,o,w,1),I=h.cross(T,A,I),I=h.normalize(I,I),S=h.add(E,h.multiplyByScalar(I,p,S),S),c===tr.ROUNDED||c===tr.BEVELED?Oge(E,v,S,c,Q,o,m,u,C+d,r):(x=h.negate(x,x),m=Mg(O,x,u,m,o,C+d,q,B)),R=h.clone(S,R)):(E=h.add(O,h.multiplyByScalar(x,q*p,x),E),v=h.add(E,h.multiplyByScalar(I,-p,v),v),fc[0]=h.clone(R,fc[0]),fc[1]=h.clone(v,fc[1]),w=r$(fc,_+d,C+d,a),P=nr.generateArc({positions:fc,granularity:a,ellipsoid:o}),m=s$(P,I,u,m,o,w,1),I=h.cross(T,A,I),I=h.normalize(I,I),S=h.add(E,h.multiplyByScalar(I,-p,S),S),c===tr.ROUNDED||c===tr.BEVELED?Oge(E,v,S,c,Q,o,m,u,C+d,r):m=Mg(O,x,u,m,o,C+d,q,B),R=h.clone(S,R)),b=h.negate(A,b)}else m=Mg(R,I,u,m,o,_+d,1,1),R=O;_=C,C=s[V+1],O=L}fc[0]=h.clone(R,fc[0]),fc[1]=h.clone(O,fc[1]),w=r$(fc,_+d,C+d,a),P=nr.generateArc({positions:fc,granularity:a,ellipsoid:o}),m=s$(P,I,u,m,o,w,1),r&&(y=Mg(O,I,f,y,o,C+d,1,1)),g=m.length;let M=r?g+y.length:g,F=new Float64Array(M);return F.set(m),r&&F.set(y,g),F};var cm=eL;var c$={},Kv=new h,Bge=new h,vYe=new h,Mge=new h,eu=[new h,new h],kge=new h,Uge=new h,zge=new h,SYe=new h,wYe=new h,IYe=new h,PYe=new h,DYe=new h,RYe=new h,OYe=new h,Nge=new Le,Lge=new $;function G6(e,t,n,i,r){let o=h.angleBetween(h.subtract(t,e,Kv),h.subtract(n,e,Bge)),s=i===tr.BEVELED?1:Math.ceil(o/D.toRadians(5))+1,a=s*3,c=new Array(a);c[a-3]=n.x,c[a-2]=n.y,c[a-1]=n.z;let u;r?u=$.fromQuaternion(Le.fromAxisAngle(h.negate(e,Kv),o/s,Nge),Lge):u=$.fromQuaternion(Le.fromAxisAngle(e,o/s,Nge),Lge);let f=0;t=h.clone(t,Kv);for(let d=0;d<s;d++)t=$.multiplyByVector(u,t,t),c[f++]=t.x,c[f++]=t.y,c[f++]=t.z;return c}function MYe(e){let t=kge,n=Uge,i=zge,r=e[1];n=h.fromArray(e[1],r.length-3,n),i=h.fromArray(e[0],0,i),t=h.midpoint(n,i,t);let o=G6(t,n,i,tr.ROUNDED,!1),s=e.length-1,a=e[s-1];r=e[s],n=h.fromArray(a,a.length-3,n),i=h.fromArray(r,0,i),t=h.midpoint(n,i,t);let c=G6(t,n,i,tr.ROUNDED,!1);return[o,c]}function Fge(e,t,n,i){let r=Kv;return i?r=h.add(e,t,r):(t=h.negate(t,t),r=h.add(e,t,r)),[r.x,r.y,r.z,n.x,n.y,n.z]}function a$(e,t,n,i){let r=new Array(e.length),o=new Array(e.length),s=h.multiplyByScalar(t,n,Kv),a=h.negate(s,Bge),c=0,u=e.length-1;for(let f=0;f<e.length;f+=3){let d=h.fromArray(e,f,vYe),p=h.add(d,a,Mge);r[c++]=p.x,r[c++]=p.y,r[c++]=p.z;let g=h.add(d,s,Mge);o[u--]=g.z,o[u--]=g.y,o[u--]=g.x}return i.push(r,o),i}c$.addAttribute=function(e,t,n,i){let r=t.x,o=t.y,s=t.z;l(n)&&(e[n]=r,e[n+1]=o,e[n+2]=s),l(i)&&(e[i]=s,e[i-1]=o,e[i-2]=r)};var NYe=new h,LYe=new h;c$.computePositions=function(e){let t=e.granularity,n=e.positions,i=e.ellipsoid,r=e.width/2,o=e.cornerType,s=e.saveAttributes,a=kge,c=Uge,u=zge,f=SYe,d=wYe,p=IYe,g=PYe,m=DYe,y=RYe,A=OYe,b=[],x=s?[]:void 0,T=s?[]:void 0,E=n[0],v=n[1];c=h.normalize(h.subtract(v,E,c),c),a=i.geodeticSurfaceNormal(E,a),f=h.normalize(h.cross(a,c,f),f),s&&(x.push(f.x,f.y,f.z),T.push(a.x,a.y,a.z)),g=h.clone(E,g),E=v,u=h.negate(c,u);let S,I=[],R,O=n.length;for(R=1;R<O-1;R++){a=i.geodeticSurfaceNormal(E,a),v=n[R+1],c=h.normalize(h.subtract(v,E,c),c);let _=h.multiplyByScalar(a,h.dot(c,a),NYe);h.subtract(c,_,_),h.normalize(_,_);let C=h.multiplyByScalar(a,h.dot(u,a),LYe);if(h.subtract(u,C,C),h.normalize(C,C),!D.equalsEpsilon(Math.abs(h.dot(_,C)),1,D.EPSILON7)){d=h.normalize(h.add(c,u,d),d),d=h.cross(d,a,d),d=h.cross(a,d,d),d=h.normalize(d,d);let P=r/Math.max(.25,h.magnitude(h.cross(d,u,Kv))),M=cm.angleIsGreaterThanPi(c,u,E,i);d=h.multiplyByScalar(d,P,d),M?(m=h.add(E,d,m),A=h.add(m,h.multiplyByScalar(f,r,A),A),y=h.add(m,h.multiplyByScalar(f,r*2,y),y),eu[0]=h.clone(g,eu[0]),eu[1]=h.clone(A,eu[1]),S=nr.generateArc({positions:eu,granularity:t,ellipsoid:i}),b=a$(S,f,r,b),s&&(x.push(f.x,f.y,f.z),T.push(a.x,a.y,a.z)),p=h.clone(y,p),f=h.normalize(h.cross(a,c,f),f),y=h.add(m,h.multiplyByScalar(f,r*2,y),y),g=h.add(m,h.multiplyByScalar(f,r,g),g),o===tr.ROUNDED||o===tr.BEVELED?I.push({leftPositions:G6(m,p,y,o,M)}):I.push({leftPositions:Fge(E,h.negate(d,d),y,M)})):(y=h.add(E,d,y),A=h.add(y,h.negate(h.multiplyByScalar(f,r,A),A),A),m=h.add(y,h.negate(h.multiplyByScalar(f,r*2,m),m),m),eu[0]=h.clone(g,eu[0]),eu[1]=h.clone(A,eu[1]),S=nr.generateArc({positions:eu,granularity:t,ellipsoid:i}),b=a$(S,f,r,b),s&&(x.push(f.x,f.y,f.z),T.push(a.x,a.y,a.z)),p=h.clone(m,p),f=h.normalize(h.cross(a,c,f),f),m=h.add(y,h.negate(h.multiplyByScalar(f,r*2,m),m),m),g=h.add(y,h.negate(h.multiplyByScalar(f,r,g),g),g),o===tr.ROUNDED||o===tr.BEVELED?I.push({rightPositions:G6(y,p,m,o,M)}):I.push({rightPositions:Fge(E,d,m,M)})),u=h.negate(c,u)}E=v}a=i.geodeticSurfaceNormal(E,a),eu[0]=h.clone(g,eu[0]),eu[1]=h.clone(E,eu[1]),S=nr.generateArc({positions:eu,granularity:t,ellipsoid:i}),b=a$(S,f,r,b),s&&(x.push(f.x,f.y,f.z),T.push(a.x,a.y,a.z));let L;return o===tr.ROUNDED&&(L=MYe(b)),{positions:b,corners:I,lefts:x,normals:T,endPositions:L}};var hr=c$;function f$(e,t,n=2){let i=t&&t.length,r=i?t[0]*n:e.length,o=jge(e,0,r,n,!0),s=[];if(!o||o.next===o.prev)return s;let a,c,u;if(i&&(o=zYe(e,t,o,n)),e.length>80*n){a=e[0],c=e[1];let f=a,d=c;for(let p=n;p<r;p+=n){let g=e[p],m=e[p+1];g<a&&(a=g),m<c&&(c=m),g>f&&(f=g),m>d&&(d=m)}u=Math.max(f-a,d-c),u=u!==0?32767/u:0}return nL(o,s,n,a,c,u,0),s}function jge(e,t,n,i,r){let o;if(r===JYe(e,t,n,i)>0)for(let s=t;s<n;s+=i)o=Vge(s/i|0,e[s],e[s+1],o);else for(let s=n-i;s>=t;s-=i)o=Vge(s/i|0,e[s],e[s+1],o);return o&&$v(o,o.next)&&(rL(o),o=o.next),o}function Qx(e,t){if(!e)return e;t||(t=e);let n=e,i;do if(i=!1,!n.steiner&&($v(n,n.next)||Ts(n.prev,n,n.next)===0)){if(rL(n),n=t=n.prev,n===n.next)break;i=!0}else n=n.next;while(i||n!==t);return t}function nL(e,t,n,i,r,o,s){if(!e)return;!s&&o&&WYe(e,i,r,o);let a=e;for(;e.prev!==e.next;){let c=e.prev,u=e.next;if(o?BYe(e,i,r,o):FYe(e)){t.push(c.i,e.i,u.i),rL(e),e=u.next,a=u.next;continue}if(e=u,e===a){s?s===1?(e=kYe(Qx(e),t),nL(e,t,n,i,r,o,2)):s===2&&UYe(e,t,n,i,r,o):nL(Qx(e),t,n,i,r,o,1);break}}}function FYe(e){let t=e.prev,n=e,i=e.next;if(Ts(t,n,i)>=0)return!1;let r=t.x,o=n.x,s=i.x,a=t.y,c=n.y,u=i.y,f=Math.min(r,o,s),d=Math.min(a,c,u),p=Math.max(r,o,s),g=Math.max(a,c,u),m=i.next;for(;m!==t;){if(m.x>=f&&m.x<=p&&m.y>=d&&m.y<=g&&tL(r,a,o,c,s,u,m.x,m.y)&&Ts(m.prev,m,m.next)>=0)return!1;m=m.next}return!0}function BYe(e,t,n,i){let r=e.prev,o=e,s=e.next;if(Ts(r,o,s)>=0)return!1;let a=r.x,c=o.x,u=s.x,f=r.y,d=o.y,p=s.y,g=Math.min(a,c,u),m=Math.min(f,d,p),y=Math.max(a,c,u),A=Math.max(f,d,p),b=l$(g,m,t,n,i),x=l$(y,A,t,n,i),T=e.prevZ,E=e.nextZ;for(;T&&T.z>=b&&E&&E.z<=x;){if(T.x>=g&&T.x<=y&&T.y>=m&&T.y<=A&&T!==r&&T!==s&&tL(a,f,c,d,u,p,T.x,T.y)&&Ts(T.prev,T,T.next)>=0||(T=T.prevZ,E.x>=g&&E.x<=y&&E.y>=m&&E.y<=A&&E!==r&&E!==s&&tL(a,f,c,d,u,p,E.x,E.y)&&Ts(E.prev,E,E.next)>=0))return!1;E=E.nextZ}for(;T&&T.z>=b;){if(T.x>=g&&T.x<=y&&T.y>=m&&T.y<=A&&T!==r&&T!==s&&tL(a,f,c,d,u,p,T.x,T.y)&&Ts(T.prev,T,T.next)>=0)return!1;T=T.prevZ}for(;E&&E.z<=x;){if(E.x>=g&&E.x<=y&&E.y>=m&&E.y<=A&&E!==r&&E!==s&&tL(a,f,c,d,u,p,E.x,E.y)&&Ts(E.prev,E,E.next)>=0)return!1;E=E.nextZ}return!0}function kYe(e,t){let n=e;do{let i=n.prev,r=n.next.next;!$v(i,r)&&Gge(i,n,n.next,r)&&iL(i,r)&&iL(r,i)&&(t.push(i.i,n.i,r.i),rL(n),rL(n.next),n=e=r),n=n.next}while(n!==e);return Qx(n)}function UYe(e,t,n,i,r,o){let s=e;do{let a=s.next.next;for(;a!==s.prev;){if(s.i!==a.i&&XYe(s,a)){let c=Wge(s,a);s=Qx(s,s.next),c=Qx(c,c.next),nL(s,t,n,i,r,o,0),nL(c,t,n,i,r,o,0);return}a=a.next}s=s.next}while(s!==e)}function zYe(e,t,n,i){let r=[];for(let o=0,s=t.length;o<s;o++){let a=t[o]*i,c=o<s-1?t[o+1]*i:e.length,u=jge(e,a,c,i,!1);u===u.next&&(u.steiner=!0),r.push(YYe(u))}r.sort(VYe);for(let o=0;o<r.length;o++)n=jYe(r[o],n);return n}function VYe(e,t){let n=e.x-t.x;if(n===0&&(n=e.y-t.y,n===0)){let i=(e.next.y-e.y)/(e.next.x-e.x),r=(t.next.y-t.y)/(t.next.x-t.x);n=i-r}return n}function jYe(e,t){let n=HYe(e,t);if(!n)return t;let i=Wge(n,e);return Qx(i,i.next),Qx(n,n.next)}function HYe(e,t){let n=t,i=e.x,r=e.y,o=-1/0,s;if($v(e,n))return n;do{if($v(e,n.next))return n.next;if(r<=n.y&&r>=n.next.y&&n.next.y!==n.y){let d=n.x+(r-n.y)*(n.next.x-n.x)/(n.next.y-n.y);if(d<=i&&d>o&&(o=d,s=n.x<n.next.x?n:n.next,d===i))return s}n=n.next}while(n!==t);if(!s)return null;let a=s,c=s.x,u=s.y,f=1/0;n=s;do{if(i>=n.x&&n.x>=c&&i!==n.x&&Hge(r<u?i:o,r,c,u,r<u?o:i,r,n.x,n.y)){let d=Math.abs(r-n.y)/(i-n.x);iL(n,e)&&(d<f||d===f&&(n.x>s.x||n.x===s.x&&GYe(s,n)))&&(s=n,f=d)}n=n.next}while(n!==a);return s}function GYe(e,t){return Ts(e.prev,e,t.prev)<0&&Ts(t.next,e,e.next)<0}function WYe(e,t,n,i){let r=e;do r.z===0&&(r.z=l$(r.x,r.y,t,n,i)),r.prevZ=r.prev,r.nextZ=r.next,r=r.next;while(r!==e);r.prevZ.nextZ=null,r.prevZ=null,qYe(r)}function qYe(e){let t,n=1;do{let i=e,r;e=null;let o=null;for(t=0;i;){t++;let s=i,a=0;for(let u=0;u<n&&(a++,s=s.nextZ,!!s);u++);let c=n;for(;a>0||c>0&&s;)a!==0&&(c===0||!s||i.z<=s.z)?(r=i,i=i.nextZ,a--):(r=s,s=s.nextZ,c--),o?o.nextZ=r:e=r,r.prevZ=o,o=r;i=s}o.nextZ=null,n*=2}while(t>1);return e}function l$(e,t,n,i,r){return e=(e-n)*r|0,t=(t-i)*r|0,e=(e|e<<8)&16711935,e=(e|e<<4)&252645135,e=(e|e<<2)&858993459,e=(e|e<<1)&1431655765,t=(t|t<<8)&16711935,t=(t|t<<4)&252645135,t=(t|t<<2)&858993459,t=(t|t<<1)&1431655765,e|t<<1}function YYe(e){let t=e,n=e;do(t.x<n.x||t.x===n.x&&t.y<n.y)&&(n=t),t=t.next;while(t!==e);return n}function Hge(e,t,n,i,r,o,s,a){return(r-s)*(t-a)>=(e-s)*(o-a)&&(e-s)*(i-a)>=(n-s)*(t-a)&&(n-s)*(o-a)>=(r-s)*(i-a)}function tL(e,t,n,i,r,o,s,a){return!(e===s&&t===a)&&Hge(e,t,n,i,r,o,s,a)}function XYe(e,t){return e.next.i!==t.i&&e.prev.i!==t.i&&!KYe(e,t)&&(iL(e,t)&&iL(t,e)&&$Ye(e,t)&&(Ts(e.prev,e,t.prev)||Ts(e,t.prev,t))||$v(e,t)&&Ts(e.prev,e,e.next)>0&&Ts(t.prev,t,t.next)>0)}function Ts(e,t,n){return(t.y-e.y)*(n.x-t.x)-(t.x-e.x)*(n.y-t.y)}function $v(e,t){return e.x===t.x&&e.y===t.y}function Gge(e,t,n,i){let r=q6(Ts(e,t,n)),o=q6(Ts(e,t,i)),s=q6(Ts(n,i,e)),a=q6(Ts(n,i,t));return!!(r!==o&&s!==a||r===0&&W6(e,n,t)||o===0&&W6(e,i,t)||s===0&&W6(n,e,i)||a===0&&W6(n,t,i))}function W6(e,t,n){return t.x<=Math.max(e.x,n.x)&&t.x>=Math.min(e.x,n.x)&&t.y<=Math.max(e.y,n.y)&&t.y>=Math.min(e.y,n.y)}function q6(e){return e>0?1:e<0?-1:0}function KYe(e,t){let n=e;do{if(n.i!==e.i&&n.next.i!==e.i&&n.i!==t.i&&n.next.i!==t.i&&Gge(n,n.next,e,t))return!0;n=n.next}while(n!==e);return!1}function iL(e,t){return Ts(e.prev,e,e.next)<0?Ts(e,t,e.next)>=0&&Ts(e,e.prev,t)>=0:Ts(e,t,e.prev)<0||Ts(e,e.next,t)<0}function $Ye(e,t){let n=e,i=!1,r=(e.x+t.x)/2,o=(e.y+t.y)/2;do n.y>o!=n.next.y>o&&n.next.y!==n.y&&r<(n.next.x-n.x)*(o-n.y)/(n.next.y-n.y)+n.x&&(i=!i),n=n.next;while(n!==e);return i}function Wge(e,t){let n=u$(e.i,e.x,e.y),i=u$(t.i,t.x,t.y),r=e.next,o=t.prev;return e.next=t,t.prev=e,n.next=r,r.prev=n,i.next=n,n.prev=i,o.next=i,i.prev=o,i}function Vge(e,t,n,i){let r=u$(e,t,n);return i?(r.next=i.next,r.prev=i,i.next.prev=r,i.next=r):(r.prev=r,r.next=r),r}function rL(e){e.next.prev=e.prev,e.prev.next=e.next,e.prevZ&&(e.prevZ.nextZ=e.nextZ),e.nextZ&&(e.nextZ.prevZ=e.prevZ)}function u$(e,t,n){return{i:e,x:t,y:n,prev:null,next:null,z:0,prevZ:null,nextZ:null,steiner:!1}}function JYe(e,t,n,i){let r=0;for(let o=t,s=n-i;o<n;o+=i)r+=(e[s]-e[o])*(e[o+1]+e[s+1]),s=o;return r}var ZYe=new h,QYe=new h,eA={};eA.computeArea2D=function(e){let t=e.length,n=0;for(let i=t-1,r=0;r<t;i=r++){let o=e[i],s=e[r];n+=o.x*s.y-s.x*o.y}return n*.5};eA.computeWindingOrder2D=function(e){return eA.computeArea2D(e)>0?Qs.COUNTER_CLOCKWISE:Qs.CLOCKWISE};eA.triangulate=function(e,t){let n=U.packArray(e);return f$(n,t,2)};var Kge=new h,$ge=new h,Jge=new h,qge=new h,Yge=new h,Xge=new h,Ng=new h,Zge=new U,Qge=new U,e_e=new U,Jv=new U;eA.computeSubdivision=function(e,t,n,i,r){r=r??D.RADIANS_PER_DEGREE;let o=l(i),s=n.slice(0),a,c=t.length,u=new Array(c*3),f=new Array(c*2),d=0,p=0;for(a=0;a<c;a++){let T=t[a];if(u[d++]=T.x,u[d++]=T.y,u[d++]=T.z,o){let E=i[a];f[p++]=E.x,f[p++]=E.y}}let g=[],m={},y=e.maximumRadius,A=D.chordLength(r,y),b=A*A;for(;s.length>0;){let T=s.pop(),E=s.pop(),v=s.pop(),S=h.fromArray(u,v*3,Kge),I=h.fromArray(u,E*3,$ge),R=h.fromArray(u,T*3,Jge),O,L,_;o&&(O=U.fromArray(f,v*2,Zge),L=U.fromArray(f,E*2,Qge),_=U.fromArray(f,T*2,e_e));let C=h.multiplyByScalar(h.normalize(S,qge),y,qge),w=h.multiplyByScalar(h.normalize(I,Yge),y,Yge),P=h.multiplyByScalar(h.normalize(R,Xge),y,Xge),M=h.magnitudeSquared(h.subtract(C,w,Ng)),F=h.magnitudeSquared(h.subtract(w,P,Ng)),V=h.magnitudeSquared(h.subtract(P,C,Ng)),B=Math.max(M,F,V),j,k,G;B>b?M===B?(j=`${Math.min(v,E)} ${Math.max(v,E)}`,a=m[j],l(a)||(k=h.add(S,I,Ng),h.multiplyByScalar(k,.5,k),u.push(k.x,k.y,k.z),a=u.length/3-1,m[j]=a,o&&(G=U.add(O,L,Jv),U.multiplyByScalar(G,.5,G),f.push(G.x,G.y))),s.push(v,a,T),s.push(a,E,T)):F===B?(j=`${Math.min(E,T)} ${Math.max(E,T)}`,a=m[j],l(a)||(k=h.add(I,R,Ng),h.multiplyByScalar(k,.5,k),u.push(k.x,k.y,k.z),a=u.length/3-1,m[j]=a,o&&(G=U.add(L,_,Jv),U.multiplyByScalar(G,.5,G),f.push(G.x,G.y))),s.push(E,a,v),s.push(a,T,v)):V===B&&(j=`${Math.min(T,v)} ${Math.max(T,v)}`,a=m[j],l(a)||(k=h.add(R,S,Ng),h.multiplyByScalar(k,.5,k),u.push(k.x,k.y,k.z),a=u.length/3-1,m[j]=a,o&&(G=U.add(_,O,Jv),U.multiplyByScalar(G,.5,G),f.push(G.x,G.y))),s.push(T,a,E),s.push(a,v,E)):(g.push(v),g.push(E),g.push(T))}let x={attributes:{position:new Ne({componentDatatype:Y.DOUBLE,componentsPerAttribute:3,values:u})},indices:g,primitiveType:Oe.TRIANGLES};return o&&(x.attributes.st=new Ne({componentDatatype:Y.FLOAT,componentsPerAttribute:2,values:f})),new St(x)};var eXe=new he,tXe=new he,nXe=new he,d$=new he;eA.computeRhumbLineSubdivision=function(e,t,n,i,r){r=r??D.RADIANS_PER_DEGREE;let o=l(i),s=n.slice(0),a,c=t.length,u=new Array(c*3),f=new Array(c*2),d=0,p=0;for(a=0;a<c;a++){let v=t[a];if(u[d++]=v.x,u[d++]=v.y,u[d++]=v.z,o){let S=i[a];f[p++]=S.x,f[p++]=S.y}}let g=[],m={},y=e.maximumRadius,A=D.chordLength(r,y),b=new Dc(void 0,void 0,e),x=new Dc(void 0,void 0,e),T=new Dc(void 0,void 0,e);for(;s.length>0;){let v=s.pop(),S=s.pop(),I=s.pop(),R=h.fromArray(u,I*3,Kge),O=h.fromArray(u,S*3,$ge),L=h.fromArray(u,v*3,Jge),_,C,w;o&&(_=U.fromArray(f,I*2,Zge),C=U.fromArray(f,S*2,Qge),w=U.fromArray(f,v*2,e_e));let P=e.cartesianToCartographic(R,eXe),M=e.cartesianToCartographic(O,tXe),F=e.cartesianToCartographic(L,nXe);b.setEndPoints(P,M);let V=b.surfaceDistance;x.setEndPoints(M,F);let B=x.surfaceDistance;T.setEndPoints(F,P);let j=T.surfaceDistance,k=Math.max(V,B,j),G,q,Q,W,J;k>A?V===k?(G=`${Math.min(I,S)} ${Math.max(I,S)}`,a=m[G],l(a)||(q=b.interpolateUsingFraction(.5,d$),Q=(P.height+M.height)*.5,W=h.fromRadians(q.longitude,q.latitude,Q,e,Ng),u.push(W.x,W.y,W.z),a=u.length/3-1,m[G]=a,o&&(J=U.add(_,C,Jv),U.multiplyByScalar(J,.5,J),f.push(J.x,J.y))),s.push(I,a,v),s.push(a,S,v)):B===k?(G=`${Math.min(S,v)} ${Math.max(S,v)}`,a=m[G],l(a)||(q=x.interpolateUsingFraction(.5,d$),Q=(M.height+F.height)*.5,W=h.fromRadians(q.longitude,q.latitude,Q,e,Ng),u.push(W.x,W.y,W.z),a=u.length/3-1,m[G]=a,o&&(J=U.add(C,w,Jv),U.multiplyByScalar(J,.5,J),f.push(J.x,J.y))),s.push(S,a,I),s.push(a,v,I)):j===k&&(G=`${Math.min(v,I)} ${Math.max(v,I)}`,a=m[G],l(a)||(q=T.interpolateUsingFraction(.5,d$),Q=(F.height+P.height)*.5,W=h.fromRadians(q.longitude,q.latitude,Q,e,Ng),u.push(W.x,W.y,W.z),a=u.length/3-1,m[G]=a,o&&(J=U.add(w,_,Jv),U.multiplyByScalar(J,.5,J),f.push(J.x,J.y))),s.push(v,a,S),s.push(a,I,S)):(g.push(I),g.push(S),g.push(v))}let E={attributes:{position:new Ne({componentDatatype:Y.DOUBLE,componentsPerAttribute:3,values:u})},indices:g,primitiveType:Oe.TRIANGLES};return o&&(E.attributes.st=new Ne({componentDatatype:Y.FLOAT,componentsPerAttribute:2,values:f})),new St(E)};eA.scaleToGeodeticHeight=function(e,t,n,i){n=n??ee.default;let r=ZYe,o=QYe;if(t=t??0,i=i??!0,l(e)){let s=e.length;for(let a=0;a<s;a+=3)h.fromArray(e,a,o),i&&(o=n.scaleToGeodeticSurface(o,o)),t!==0&&(r=n.geodeticSurfaceNormal(o,r),h.multiplyByScalar(r,t,r),h.add(o,r,o)),e[a]=o.x,e[a+1]=o.y,e[a+2]=o.z}return e};var fi=eA;var i_e=new h,r_e=new h,Y6=new h,X6=new h,iXe=new h,o_e=new h,tA=new h,Zv=new h;function s_e(e,t){for(let n=0;n<e.length;n++)e[n]=t.scaleToGeodeticSurface(e[n],e[n]);return e}function lm(e,t,n,i,r,o){let s=e.normals,a=e.tangents,c=e.bitangents,u=h.normalize(h.cross(n,t,tA),tA);o.normal&&hr.addAttribute(s,t,i,r),o.tangent&&hr.addAttribute(a,u,i,r),o.bitangent&&hr.addAttribute(c,n,i,r)}function a_e(e,t,n){let i=e.positions,r=e.corners,o=e.endPositions,s=e.lefts,a=e.normals,c=new Tn,u=0,f=0,d,p=0,g;for(d=0;d<i.length;d+=2)g=i[d].length-3,u+=g,p+=g*2,f+=i[d+1].length-3;for(u+=3,f+=3,d=0;d<r.length;d++){let J=r[d].leftPositions;l(J)?(g=J.length,u+=g,p+=g):(g=r[d].rightPositions.length,f+=g,p+=g)}let m=l(o),y;m&&(y=o[0].length-3,u+=y,f+=y,y/=3,p+=y*6);let A=u+f,b=new Float64Array(A),x=t.normal?new Float32Array(A):void 0,T=t.tangent?new Float32Array(A):void 0,E=t.bitangent?new Float32Array(A):void 0,v={normals:x,tangents:T,bitangents:E},S=0,I=A-1,R,O,L,_,C=i_e,w=r_e,P,M,F=y/2,V=je.createTypedArray(A/3,p),B=0;if(m){M=Y6,P=X6;let J=o[0];for(C=h.fromArray(a,0,C),w=h.fromArray(s,0,w),d=0;d<F;d++)M=h.fromArray(J,(F-1-d)*3,M),P=h.fromArray(J,(F+d)*3,P),hr.addAttribute(b,P,S),hr.addAttribute(b,M,void 0,I),lm(v,C,w,S,I,t),O=S/3,_=O+1,R=(I-2)/3,L=R-1,V[B++]=R,V[B++]=O,V[B++]=L,V[B++]=L,V[B++]=O,V[B++]=_,S+=3,I-=3}let j=0,k=0,G=i[j++],q=i[j++];b.set(G,S),b.set(q,I-q.length+1),w=h.fromArray(s,k,w);let Q,W;for(g=q.length-3,d=0;d<g;d+=3)Q=n.geodeticSurfaceNormal(h.fromArray(G,d,tA),tA),W=n.geodeticSurfaceNormal(h.fromArray(q,g-d,Zv),Zv),C=h.normalize(h.add(Q,W,C),C),lm(v,C,w,S,I,t),O=S/3,_=O+1,R=(I-2)/3,L=R-1,V[B++]=R,V[B++]=O,V[B++]=L,V[B++]=L,V[B++]=O,V[B++]=_,S+=3,I-=3;for(Q=n.geodeticSurfaceNormal(h.fromArray(G,g,tA),tA),W=n.geodeticSurfaceNormal(h.fromArray(q,g,Zv),Zv),C=h.normalize(h.add(Q,W,C),C),k+=3,d=0;d<r.length;d++){let J,Z=r[d],ae=Z.leftPositions,Ae=Z.rightPositions,fe,xe,ge=o_e,we=Y6,Se=X6;if(C=h.fromArray(a,k,C),l(ae)){for(lm(v,C,w,void 0,I,t),I-=3,fe=_,xe=L,J=0;J<ae.length/3;J++)ge=h.fromArray(ae,J*3,ge),V[B++]=fe,V[B++]=xe-J-1,V[B++]=xe-J,hr.addAttribute(b,ge,void 0,I),we=h.fromArray(b,(xe-J-1)*3,we),Se=h.fromArray(b,fe*3,Se),w=h.normalize(h.subtract(we,Se,w),w),lm(v,C,w,void 0,I,t),I-=3;ge=h.fromArray(b,fe*3,ge),we=h.subtract(h.fromArray(b,xe*3,we),ge,we),Se=h.subtract(h.fromArray(b,(xe-J)*3,Se),ge,Se),w=h.normalize(h.add(we,Se,w),w),lm(v,C,w,S,void 0,t),S+=3}else{for(lm(v,C,w,S,void 0,t),S+=3,fe=L,xe=_,J=0;J<Ae.length/3;J++)ge=h.fromArray(Ae,J*3,ge),V[B++]=fe,V[B++]=xe+J,V[B++]=xe+J+1,hr.addAttribute(b,ge,S),we=h.fromArray(b,fe*3,we),Se=h.fromArray(b,(xe+J)*3,Se),w=h.normalize(h.subtract(we,Se,w),w),lm(v,C,w,S,void 0,t),S+=3;ge=h.fromArray(b,fe*3,ge),we=h.subtract(h.fromArray(b,(xe+J)*3,we),ge,we),Se=h.subtract(h.fromArray(b,xe*3,Se),ge,Se),w=h.normalize(h.negate(h.add(Se,we,w),w),w),lm(v,C,w,void 0,I,t),I-=3}for(G=i[j++],q=i[j++],G.splice(0,3),q.splice(q.length-3,3),b.set(G,S),b.set(q,I-q.length+1),g=q.length-3,k+=3,w=h.fromArray(s,k,w),J=0;J<q.length;J+=3)Q=n.geodeticSurfaceNormal(h.fromArray(G,J,tA),tA),W=n.geodeticSurfaceNormal(h.fromArray(q,g-J,Zv),Zv),C=h.normalize(h.add(Q,W,C),C),lm(v,C,w,S,I,t),_=S/3,O=_-1,L=(I-2)/3,R=L+1,V[B++]=R,V[B++]=O,V[B++]=L,V[B++]=L,V[B++]=O,V[B++]=_,S+=3,I-=3;S-=3,I+=3}if(C=h.fromArray(a,a.length-3,C),lm(v,C,w,S,I,t),m){S+=3,I-=3,M=Y6,P=X6;let J=o[1];for(d=0;d<F;d++)M=h.fromArray(J,(y-d-1)*3,M),P=h.fromArray(J,d*3,P),hr.addAttribute(b,M,void 0,I),hr.addAttribute(b,P,S),lm(v,C,w,S,I,t),_=S/3,O=_-1,L=(I-2)/3,R=L+1,V[B++]=R,V[B++]=O,V[B++]=L,V[B++]=L,V[B++]=O,V[B++]=_,S+=3,I-=3}if(c.position=new Ne({componentDatatype:Y.DOUBLE,componentsPerAttribute:3,values:b}),t.st){let J=new Float32Array(A/3*2),Z,ae,Ae=0;if(m){u/=3,f/=3;let fe=Math.PI/(y+1);ae=1/(u-y+1),Z=1/(f-y+1);let xe,ge=y/2;for(d=ge+1;d<y+1;d++)xe=D.PI_OVER_TWO+fe*d,J[Ae++]=Z*(1+Math.cos(xe)),J[Ae++]=.5*(1+Math.sin(xe));for(d=1;d<f-y+1;d++)J[Ae++]=d*Z,J[Ae++]=0;for(d=y;d>ge;d--)xe=D.PI_OVER_TWO-d*fe,J[Ae++]=1-Z*(1+Math.cos(xe)),J[Ae++]=.5*(1+Math.sin(xe));for(d=ge;d>0;d--)xe=D.PI_OVER_TWO-fe*d,J[Ae++]=1-ae*(1+Math.cos(xe)),J[Ae++]=.5*(1+Math.sin(xe));for(d=u-y;d>0;d--)J[Ae++]=d*ae,J[Ae++]=1;for(d=1;d<ge+1;d++)xe=D.PI_OVER_TWO+fe*d,J[Ae++]=ae*(1+Math.cos(xe)),J[Ae++]=.5*(1+Math.sin(xe))}else{for(u/=3,f/=3,ae=1/(u-1),Z=1/(f-1),d=0;d<f;d++)J[Ae++]=d*Z,J[Ae++]=0;for(d=u;d>0;d--)J[Ae++]=(d-1)*ae,J[Ae++]=1}c.st=new Ne({componentDatatype:Y.FLOAT,componentsPerAttribute:2,values:J})}return t.normal&&(c.normal=new Ne({componentDatatype:Y.FLOAT,componentsPerAttribute:3,values:v.normals})),t.tangent&&(c.tangent=new Ne({componentDatatype:Y.FLOAT,componentsPerAttribute:3,values:v.tangents})),t.bitangent&&(c.bitangent=new Ne({componentDatatype:Y.FLOAT,componentsPerAttribute:3,values:v.bitangents})),{attributes:c,indices:V}}function rXe(e,t){if(!t.normal&&!t.tangent&&!t.bitangent&&!t.st)return e;let n=e.position.values,i,r;(t.normal||t.bitangent)&&(i=e.normal.values,r=e.bitangent.values);let o=e.position.values.length/18,s=o*3,a=o*2,c=s*2,u;if(t.normal||t.bitangent||t.tangent){let f=t.normal?new Float32Array(s*6):void 0,d=t.tangent?new Float32Array(s*6):void 0,p=t.bitangent?new Float32Array(s*6):void 0,g=i_e,m=r_e,y=Y6,A=X6,b=iXe,x=o_e,T=c;for(u=0;u<s;u+=3){let E=T+c;g=h.fromArray(n,u,g),m=h.fromArray(n,u+s,m),y=h.fromArray(n,(u+3)%s,y),m=h.subtract(m,g,m),y=h.subtract(y,g,y),A=h.normalize(h.cross(m,y,A),A),t.normal&&(hr.addAttribute(f,A,E),hr.addAttribute(f,A,E+3),hr.addAttribute(f,A,T),hr.addAttribute(f,A,T+3)),(t.tangent||t.bitangent)&&(x=h.fromArray(i,u,x),t.bitangent&&(hr.addAttribute(p,x,E),hr.addAttribute(p,x,E+3),hr.addAttribute(p,x,T),hr.addAttribute(p,x,T+3)),t.tangent&&(b=h.normalize(h.cross(x,A,b),b),hr.addAttribute(d,b,E),hr.addAttribute(d,b,E+3),hr.addAttribute(d,b,T),hr.addAttribute(d,b,T+3))),T+=6}if(t.normal){for(f.set(i),u=0;u<s;u+=3)f[u+s]=-i[u],f[u+s+1]=-i[u+1],f[u+s+2]=-i[u+2];e.normal.values=f}else e.normal=void 0;if(t.bitangent?(p.set(r),p.set(r,s),e.bitangent.values=p):e.bitangent=void 0,t.tangent){let E=e.tangent.values;d.set(E),d.set(E,s),e.tangent.values=d}}if(t.st){let f=e.st.values,d=new Float32Array(a*6);d.set(f),d.set(f,a);let p=a*2;for(let g=0;g<2;g++){for(d[p++]=f[0],d[p++]=f[1],u=2;u<a;u+=2){let m=f[u],y=f[u+1];d[p++]=m,d[p++]=y,d[p++]=m,d[p++]=y}d[p++]=f[0],d[p++]=f[1]}e.st.values=d}return e}function h$(e,t,n){n[t++]=e[0],n[t++]=e[1],n[t++]=e[2];for(let i=3;i<e.length;i+=3){let r=e[i],o=e[i+1],s=e[i+2];n[t++]=r,n[t++]=o,n[t++]=s,n[t++]=r,n[t++]=o,n[t++]=s}return n[t++]=e[0],n[t++]=e[1],n[t]=e[2],n}function oXe(e,t){let n=new Be({position:t.position,normal:t.normal||t.bitangent||e.shadowVolume,tangent:t.tangent,bitangent:t.normal||t.bitangent,st:t.st}),i=e.ellipsoid,r=hr.computePositions(e),o=a_e(r,n,i),s=e.height,a=e.extrudedHeight,c=o.attributes,u=o.indices,f=c.position.values,d=f.length,p=new Float64Array(d*6),g=new Float64Array(d);g.set(f);let m=new Float64Array(d*4);f=fi.scaleToGeodeticHeight(f,s,i),m=h$(f,0,m),g=fi.scaleToGeodeticHeight(g,a,i),m=h$(g,d*2,m),p.set(f),p.set(g,d),p.set(m,d*2),c.position.values=p,c=rXe(c,t);let y,A=d/3;if(e.shadowVolume){let O=c.normal.values;d=O.length;let L=new Float32Array(d*6);for(y=0;y<d;y++)O[y]=-O[y];L.set(O,d),L=h$(O,d*4,L),c.extrudeDirection=new Ne({componentDatatype:Y.FLOAT,componentsPerAttribute:3,values:L}),t.normal||(c.normal=void 0)}if(l(e.offsetAttribute)){let O=new Uint8Array(A*6);if(e.offsetAttribute===mn.TOP)O=O.fill(1,0,A).fill(1,A*2,A*4);else{let L=e.offsetAttribute===mn.NONE?0:1;O=O.fill(L)}c.applyOffset=new Ne({componentDatatype:Y.UNSIGNED_BYTE,componentsPerAttribute:1,values:O})}let b=u.length,x=A+A,T=je.createTypedArray(p.length/3,b*2+x*3);T.set(u);let E=b;for(y=0;y<b;y+=3){let O=u[y],L=u[y+1],_=u[y+2];T[E++]=_+A,T[E++]=L+A,T[E++]=O+A}let v,S,I,R;for(y=0;y<x;y+=2)v=y+x,S=v+x,I=v+1,R=S+1,T[E++]=v,T[E++]=S,T[E++]=I,T[E++]=I,T[E++]=S,T[E++]=R;return{attributes:c,indices:T}}var t_e=new h,oL=new h,zd=new he;function n_e(e,t,n,i,r,o){let s=h.subtract(t,e,t_e);h.normalize(s,s);let a=n.geodeticSurfaceNormal(e,oL),c=h.cross(s,a,t_e);h.multiplyByScalar(c,i,c);let u=r.latitude,f=r.longitude,d=o.latitude,p=o.longitude;h.add(e,c,oL),n.cartesianToCartographic(oL,zd);let g=zd.latitude,m=zd.longitude;u=Math.min(u,g),f=Math.min(f,m),d=Math.max(d,g),p=Math.max(p,m),h.subtract(e,c,oL),n.cartesianToCartographic(oL,zd),g=zd.latitude,m=zd.longitude,u=Math.min(u,g),f=Math.min(f,m),d=Math.max(d,g),p=Math.max(p,m),r.latitude=u,r.longitude=f,o.latitude=d,o.longitude=p}var Ud=new h,sL=new h,Bu=new he,ku=new he;function c_e(e,t,n,i,r){e=s_e(e,t);let o=Fr(e,h.equalsEpsilon),s=o.length;if(s<2||n<=0)return new ie;let a=n*.5;Bu.latitude=Number.POSITIVE_INFINITY,Bu.longitude=Number.POSITIVE_INFINITY,ku.latitude=Number.NEGATIVE_INFINITY,ku.longitude=Number.NEGATIVE_INFINITY;let c,u;if(i===tr.ROUNDED){let p=o[0];h.subtract(p,o[1],Ud),h.normalize(Ud,Ud),h.multiplyByScalar(Ud,a,Ud),h.add(p,Ud,sL),t.cartesianToCartographic(sL,zd),c=zd.latitude,u=zd.longitude,Bu.latitude=Math.min(Bu.latitude,c),Bu.longitude=Math.min(Bu.longitude,u),ku.latitude=Math.max(ku.latitude,c),ku.longitude=Math.max(ku.longitude,u)}for(let p=0;p<s-1;++p)n_e(o[p],o[p+1],t,a,Bu,ku);let f=o[s-1];h.subtract(f,o[s-2],Ud),h.normalize(Ud,Ud),h.multiplyByScalar(Ud,a,Ud),h.add(f,Ud,sL),n_e(f,sL,t,a,Bu,ku),i===tr.ROUNDED&&(t.cartesianToCartographic(sL,zd),c=zd.latitude,u=zd.longitude,Bu.latitude=Math.min(Bu.latitude,c),Bu.longitude=Math.min(Bu.longitude,u),ku.latitude=Math.max(ku.latitude,c),ku.longitude=Math.max(ku.longitude,u));let d=l(r)?r:new ie;return d.north=ku.latitude,d.south=Bu.latitude,d.east=ku.longitude,d.west=Bu.longitude,d}function Fg(e){e=e??H.EMPTY_OBJECT;let t=e.positions,n=e.width,i=e.height??0,r=e.extrudedHeight??i;this._positions=t,this._ellipsoid=ee.clone(e.ellipsoid??ee.default),this._vertexFormat=Be.clone(e.vertexFormat??Be.DEFAULT),this._width=n,this._height=Math.max(i,r),this._extrudedHeight=Math.min(i,r),this._cornerType=e.cornerType??tr.ROUNDED,this._granularity=e.granularity??D.RADIANS_PER_DEGREE,this._shadowVolume=e.shadowVolume??!1,this._workerName="createCorridorGeometry",this._offsetAttribute=e.offsetAttribute,this._rectangle=void 0,this.packedLength=1+t.length*h.packedLength+ee.packedLength+Be.packedLength+7}Fg.pack=function(e,t,n){n=n??0;let i=e._positions,r=i.length;t[n++]=r;for(let o=0;o<r;++o,n+=h.packedLength)h.pack(i[o],t,n);return ee.pack(e._ellipsoid,t,n),n+=ee.packedLength,Be.pack(e._vertexFormat,t,n),n+=Be.packedLength,t[n++]=e._width,t[n++]=e._height,t[n++]=e._extrudedHeight,t[n++]=e._cornerType,t[n++]=e._granularity,t[n++]=e._shadowVolume?1:0,t[n]=e._offsetAttribute??-1,t};var l_e=ee.clone(ee.UNIT_SPHERE),u_e=new Be,Lg={positions:void 0,ellipsoid:l_e,vertexFormat:u_e,width:void 0,height:void 0,extrudedHeight:void 0,cornerType:void 0,granularity:void 0,shadowVolume:void 0,offsetAttribute:void 0};Fg.unpack=function(e,t,n){t=t??0;let i=e[t++],r=new Array(i);for(let m=0;m<i;++m,t+=h.packedLength)r[m]=h.unpack(e,t);let o=ee.unpack(e,t,l_e);t+=ee.packedLength;let s=Be.unpack(e,t,u_e);t+=Be.packedLength;let a=e[t++],c=e[t++],u=e[t++],f=e[t++],d=e[t++],p=e[t++]===1,g=e[t];return l(n)?(n._positions=r,n._ellipsoid=ee.clone(o,n._ellipsoid),n._vertexFormat=Be.clone(s,n._vertexFormat),n._width=a,n._height=c,n._extrudedHeight=u,n._cornerType=f,n._granularity=d,n._shadowVolume=p,n._offsetAttribute=g===-1?void 0:g,n):(Lg.positions=r,Lg.width=a,Lg.height=c,Lg.extrudedHeight=u,Lg.cornerType=f,Lg.granularity=d,Lg.shadowVolume=p,Lg.offsetAttribute=g===-1?void 0:g,new Fg(Lg))};Fg.computeRectangle=function(e,t){e=e??H.EMPTY_OBJECT;let n=e.positions,i=e.width,r=e.ellipsoid??ee.default,o=e.cornerType??tr.ROUNDED;return c_e(n,r,i,o,t)};Fg.createGeometry=function(e){let t=e._positions,n=e._width,i=e._ellipsoid;t=s_e(t,i);let r=Fr(t,h.equalsEpsilon);if(r.length<2||n<=0)return;let o=e._height,s=e._extrudedHeight,a=!D.equalsEpsilon(o,s,0,D.EPSILON2),c=e._vertexFormat,u={ellipsoid:i,positions:r,width:n,cornerType:e._cornerType,granularity:e._granularity,saveAttributes:!0},f;if(a)u.height=o,u.extrudedHeight=s,u.shadowVolume=e._shadowVolume,u.offsetAttribute=e._offsetAttribute,f=oXe(u,c);else{let g=hr.computePositions(u);if(f=a_e(g,c,i),f.attributes.position.values=fi.scaleToGeodeticHeight(f.attributes.position.values,o,i),l(e._offsetAttribute)){let m=e._offsetAttribute===mn.NONE?0:1,y=f.attributes.position.values.length,A=new Uint8Array(y/3).fill(m);f.attributes.applyOffset=new Ne({componentDatatype:Y.UNSIGNED_BYTE,componentsPerAttribute:1,values:A})}}let d=f.attributes,p=ue.fromVertices(d.position.values,void 0,3);return c.position||(f.attributes.position.values=void 0),new St({attributes:d,indices:f.indices,primitiveType:Oe.TRIANGLES,boundingSphere:p,offsetAttribute:e._offsetAttribute})};Fg.createShadowVolume=function(e,t,n){let i=e._granularity,r=e._ellipsoid,o=t(i,r),s=n(i,r);return new Fg({positions:e._positions,width:e._width,cornerType:e._cornerType,ellipsoid:r,granularity:i,extrudedHeight:o,height:s,vertexFormat:Be.POSITION_ONLY,shadowVolume:!0})};Object.defineProperties(Fg.prototype,{rectangle:{get:function(){return l(this._rectangle)||(this._rectangle=c_e(this._positions,this._ellipsoid,this._width,this._cornerType)),this._rectangle}},textureCoordinateRotationPoints:{get:function(){return[0,0,0,1,1,0]}}});var eT=Fg;var f_e=new h,d_e=new h,sXe=new h;function aXe(e,t){for(let n=0;n<e.length;n++)e[n]=t.scaleToGeodeticSurface(e[n],e[n]);return e}function h_e(e,t){let n=[],i=e.positions,r=e.corners,o=e.endPositions,s=new Tn,a,c=0,u=0,f,d=0,p;for(f=0;f<i.length;f+=2)p=i[f].length-3,c+=p,d+=p/3*4,u+=i[f+1].length-3;for(c+=3,u+=3,f=0;f<r.length;f++){let M=r[f].leftPositions;l(M)?(p=M.length,c+=p,d+=p/3*2):(p=r[f].rightPositions.length,u+=p,d+=p/3*2)}let g=l(o),m;g&&(m=o[0].length-3,c+=m,u+=m,m/=3,d+=m*4);let y=c+u,A=new Float64Array(y),b=0,x=y-1,T,E,v,S,I,R,O=m/2,L=je.createTypedArray(y/3,d+4),_=0;if(L[_++]=b/3,L[_++]=(x-2)/3,g){n.push(b/3),R=f_e,I=d_e;let M=o[0];for(f=0;f<O;f++)R=h.fromArray(M,(O-1-f)*3,R),I=h.fromArray(M,(O+f)*3,I),hr.addAttribute(A,I,b),hr.addAttribute(A,R,void 0,x),E=b/3,S=E+1,T=(x-2)/3,v=T-1,L[_++]=T,L[_++]=v,L[_++]=E,L[_++]=S,b+=3,x-=3}let C=0,w=i[C++],P=i[C++];for(A.set(w,b),A.set(P,x-P.length+1),p=P.length-3,n.push(b/3,(x-2)/3),f=0;f<p;f+=3)E=b/3,S=E+1,T=(x-2)/3,v=T-1,L[_++]=T,L[_++]=v,L[_++]=E,L[_++]=S,b+=3,x-=3;for(f=0;f<r.length;f++){let M;a=r[f];let F=a.leftPositions,V=a.rightPositions,B,j=sXe;if(l(F)){for(x-=3,B=v,n.push(S),M=0;M<F.length/3;M++)j=h.fromArray(F,M*3,j),L[_++]=B-M-1,L[_++]=B-M,hr.addAttribute(A,j,void 0,x),x-=3;n.push(B-Math.floor(F.length/6)),t===tr.BEVELED&&n.push((x-2)/3+1),b+=3}else{for(b+=3,B=S,n.push(v),M=0;M<V.length/3;M++)j=h.fromArray(V,M*3,j),L[_++]=B+M,L[_++]=B+M+1,hr.addAttribute(A,j,b),b+=3;n.push(B+Math.floor(V.length/6)),t===tr.BEVELED&&n.push(b/3-1),x-=3}for(w=i[C++],P=i[C++],w.splice(0,3),P.splice(P.length-3,3),A.set(w,b),A.set(P,x-P.length+1),M=0;M<P.length;M+=3)S=b/3,E=S-1,v=(x-2)/3,T=v+1,L[_++]=T,L[_++]=v,L[_++]=E,L[_++]=S,b+=3,x-=3;b-=3,x+=3,n.push(b/3,(x-2)/3)}if(g){b+=3,x-=3,R=f_e,I=d_e;let M=o[1];for(f=0;f<O;f++)R=h.fromArray(M,(m-f-1)*3,R),I=h.fromArray(M,f*3,I),hr.addAttribute(A,R,void 0,x),hr.addAttribute(A,I,b),S=b/3,E=S-1,v=(x-2)/3,T=v+1,L[_++]=T,L[_++]=v,L[_++]=E,L[_++]=S,b+=3,x-=3;n.push(b/3)}else n.push(b/3,(x-2)/3);return L[_++]=b/3,L[_]=(x-2)/3,s.position=new Ne({componentDatatype:Y.DOUBLE,componentsPerAttribute:3,values:A}),{attributes:s,indices:L,wallIndices:n}}function cXe(e){let t=e.ellipsoid,n=hr.computePositions(e),i=h_e(n,e.cornerType),r=i.wallIndices,o=e.height,s=e.extrudedHeight,a=i.attributes,c=i.indices,u=a.position.values,f=u.length,d=new Float64Array(f);d.set(u);let p=new Float64Array(f*2);if(u=fi.scaleToGeodeticHeight(u,o,t),d=fi.scaleToGeodeticHeight(d,s,t),p.set(u),p.set(d,f),a.position.values=p,f/=3,l(e.offsetAttribute)){let T=new Uint8Array(f*2);if(e.offsetAttribute===mn.TOP)T=T.fill(1,0,f);else{let E=e.offsetAttribute===mn.NONE?0:1;T=T.fill(E)}a.applyOffset=new Ne({componentDatatype:Y.UNSIGNED_BYTE,componentsPerAttribute:1,values:T})}let g,m=c.length,y=je.createTypedArray(p.length/3,(m+r.length)*2);y.set(c);let A=m;for(g=0;g<m;g+=2){let T=c[g],E=c[g+1];y[A++]=T+f,y[A++]=E+f}let b,x;for(g=0;g<r.length;g++)b=r[g],x=b+f,y[A++]=b,y[A++]=x;return{attributes:a,indices:y}}function aL(e){e=e??H.EMPTY_OBJECT;let t=e.positions,n=e.width,i=e.height??0,r=e.extrudedHeight??i;this._positions=t,this._ellipsoid=ee.clone(e.ellipsoid??ee.default),this._width=n,this._height=Math.max(i,r),this._extrudedHeight=Math.min(i,r),this._cornerType=e.cornerType??tr.ROUNDED,this._granularity=e.granularity??D.RADIANS_PER_DEGREE,this._offsetAttribute=e.offsetAttribute,this._workerName="createCorridorOutlineGeometry",this.packedLength=1+t.length*h.packedLength+ee.packedLength+6}aL.pack=function(e,t,n){n=n??0;let i=e._positions,r=i.length;t[n++]=r;for(let o=0;o<r;++o,n+=h.packedLength)h.pack(i[o],t,n);return ee.pack(e._ellipsoid,t,n),n+=ee.packedLength,t[n++]=e._width,t[n++]=e._height,t[n++]=e._extrudedHeight,t[n++]=e._cornerType,t[n++]=e._granularity,t[n]=e._offsetAttribute??-1,t};var m_e=ee.clone(ee.UNIT_SPHERE),nA={positions:void 0,ellipsoid:m_e,width:void 0,height:void 0,extrudedHeight:void 0,cornerType:void 0,granularity:void 0,offsetAttribute:void 0};aL.unpack=function(e,t,n){t=t??0;let i=e[t++],r=new Array(i);for(let p=0;p<i;++p,t+=h.packedLength)r[p]=h.unpack(e,t);let o=ee.unpack(e,t,m_e);t+=ee.packedLength;let s=e[t++],a=e[t++],c=e[t++],u=e[t++],f=e[t++],d=e[t];return l(n)?(n._positions=r,n._ellipsoid=ee.clone(o,n._ellipsoid),n._width=s,n._height=a,n._extrudedHeight=c,n._cornerType=u,n._granularity=f,n._offsetAttribute=d===-1?void 0:d,n):(nA.positions=r,nA.width=s,nA.height=a,nA.extrudedHeight=c,nA.cornerType=u,nA.granularity=f,nA.offsetAttribute=d===-1?void 0:d,new aL(nA))};aL.createGeometry=function(e){let t=e._positions,n=e._width,i=e._ellipsoid;t=aXe(t,i);let r=Fr(t,h.equalsEpsilon);if(r.length<2||n<=0)return;let o=e._height,s=e._extrudedHeight,a=!D.equalsEpsilon(o,s,0,D.EPSILON2),c={ellipsoid:i,positions:r,width:n,cornerType:e._cornerType,granularity:e._granularity,saveAttributes:!1},u;if(a)c.height=o,c.extrudedHeight=s,c.offsetAttribute=e._offsetAttribute,u=cXe(c);else{let p=hr.computePositions(c);if(u=h_e(p,c.cornerType),u.attributes.position.values=fi.scaleToGeodeticHeight(u.attributes.position.values,o,i),l(e._offsetAttribute)){let g=u.attributes.position.values.length,m=e._offsetAttribute===mn.NONE?0:1,y=new Uint8Array(g/3).fill(m);u.attributes.applyOffset=new Ne({componentDatatype:Y.UNSIGNED_BYTE,componentsPerAttribute:1,values:y})}}let f=u.attributes,d=ue.fromVertices(f.position.values,void 0,3);return new St({attributes:f,indices:u.indices,primitiveType:Oe.LINES,boundingSphere:d,offsetAttribute:e._offsetAttribute})};var cL=aL;var lXe=new ui(0);function tu(e){Pi.call(this,e),this._zIndex=0,this._terrainOffsetProperty=void 0}l(Object.create)&&(tu.prototype=Object.create(Pi.prototype),tu.prototype.constructor=tu);Object.defineProperties(tu.prototype,{zIndex:{get:function(){return this._zIndex}},terrainOffsetProperty:{get:function(){return this._terrainOffsetProperty}}});tu.prototype._isOnTerrain=function(e,t){return this._fillEnabled&&!l(t.height)&&!l(t.extrudedHeight)&&Xl.isSupported(this._scene)};tu.prototype._getIsClosed=function(e){let t=e.height,n=e.extrudedHeight;return t===0||l(n)&&n!==t};tu.prototype._computeCenter=pe.throwInstantiationError;tu.prototype._onEntityPropertyChanged=function(e,t,n,i){if(Pi.prototype._onEntityPropertyChanged.call(this,e,t,n,i),this._observedPropertyNames.indexOf(t)===-1)return;let r=this._entity[this._geometryPropertyName];if(!l(r))return;l(r.zIndex)&&(l(r.height)||l(r.extrudedHeight))&&_t(_t.geometryZIndex),this._zIndex=r.zIndex??lXe,l(this._terrainOffsetProperty)&&(this._terrainOffsetProperty.destroy(),this._terrainOffsetProperty=void 0);let o=r.heightReference,s=r.extrudedHeightReference;if(l(o)||l(s)){let a=new am(this._computeCenter.bind(this),!this._dynamic);this._terrainOffsetProperty=new Jx(this._scene,a,o,s)}};tu.prototype.destroy=function(){l(this._terrainOffsetProperty)&&(this._terrainOffsetProperty.destroy(),this._terrainOffsetProperty=void 0),Pi.prototype.destroy.call(this)};tu.getGeometryHeight=function(e,t){if(!l(e)){t!==We.NONE&&_t(_t.geometryHeightReference);return}return bs(t)?0:e};tu.getGeometryExtrudedHeight=function(e,t){if(!l(e)){t!==We.NONE&&_t(_t.geometryExtrudedHeightReference);return}return bs(t)?tu.CLAMP_TO_GROUND:e};tu.CLAMP_TO_GROUND="clamp";tu.computeGeometryOffsetAttribute=function(e,t,n,i){(!l(e)||!l(t))&&(t=We.NONE),(!l(n)||!l(i))&&(i=We.NONE);let r=0;if(t!==We.NONE&&r++,i===We.RELATIVE_TO_GROUND&&r++,r===2)return mn.ALL;if(r===1)return mn.TOP};var ii=tu;var p_e=new z,g_e=h.ZERO,__e=new h,y_e=new ie;function uXe(e){this.id=e,this.vertexFormat=void 0,this.positions=void 0,this.width=void 0,this.cornerType=void 0,this.height=void 0,this.extrudedHeight=void 0,this.granularity=void 0,this.offsetAttribute=void 0}function um(e,t){ii.call(this,{entity:e,scene:t,geometryOptions:new uXe(e),geometryPropertyName:"corridor",observedPropertyNames:["availability","corridor"]}),this._onEntityPropertyChanged(e,"corridor",e.corridor,void 0)}l(Object.create)&&(um.prototype=Object.create(ii.prototype),um.prototype.constructor=um);um.prototype.createFillGeometryInstance=function(e){let t=this._entity,n=t.isAvailable(e),i={show:new Dn(n&&t.isShowing&&this._showProperty.getValue(e)&&this._fillProperty.getValue(e)),distanceDisplayCondition:ti.fromDistanceDisplayCondition(this._distanceDisplayConditionProperty.getValue(e)),offset:void 0,color:void 0};if(this._materialProperty instanceof Kt){let r;l(this._materialProperty.color)&&(this._materialProperty.color.isConstant||n)&&(r=this._materialProperty.color.getValue(e,p_e)),l(r)||(r=z.WHITE),i.color=Jt.fromColor(r)}return l(this._options.offsetAttribute)&&(i.offset=Tr.fromCartesian3(X.getValueOrDefault(this._terrainOffsetProperty,e,g_e,__e))),new Ft({id:t,geometry:new eT(this._options),attributes:i})};um.prototype.createOutlineGeometryInstance=function(e){let t=this._entity,n=t.isAvailable(e),i=X.getValueOrDefault(this._outlineColorProperty,e,z.BLACK,p_e),r={show:new Dn(n&&t.isShowing&&this._showProperty.getValue(e)&&this._showOutlineProperty.getValue(e)),color:Jt.fromColor(i),distanceDisplayCondition:ti.fromDistanceDisplayCondition(this._distanceDisplayConditionProperty.getValue(e)),offset:void 0};return l(this._options.offsetAttribute)&&(r.offset=Tr.fromCartesian3(X.getValueOrDefault(this._terrainOffsetProperty,e,g_e,__e))),new Ft({id:t,geometry:new cL(this._options),attributes:r})};um.prototype._computeCenter=function(e,t){let n=X.getValueOrUndefined(this._entity.corridor.positions,e);if(!(!l(n)||n.length===0))return h.clone(n[Math.floor(n.length/2)],t)};um.prototype._isHidden=function(e,t){return!l(t.positions)||!l(t.width)||Pi.prototype._isHidden.call(this,e,t)};um.prototype._isDynamic=function(e,t){return!t.positions.isConstant||!X.isConstant(t.height)||!X.isConstant(t.extrudedHeight)||!X.isConstant(t.granularity)||!X.isConstant(t.width)||!X.isConstant(t.outlineWidth)||!X.isConstant(t.cornerType)||!X.isConstant(t.zIndex)||this._onTerrain&&!X.isConstant(this._materialProperty)&&!(this._materialProperty instanceof Kt)};um.prototype._setStaticOptions=function(e,t){let n=X.getValueOrUndefined(t.height,nt.MINIMUM_VALUE),i=X.getValueOrDefault(t.heightReference,nt.MINIMUM_VALUE,We.NONE),r=X.getValueOrUndefined(t.extrudedHeight,nt.MINIMUM_VALUE),o=X.getValueOrDefault(t.extrudedHeightReference,nt.MINIMUM_VALUE,We.NONE);l(r)&&!l(n)&&(n=0);let s=this._options;s.vertexFormat=this._materialProperty instanceof Kt?yn.VERTEX_FORMAT:Er.MaterialSupport.TEXTURED.vertexFormat,s.positions=t.positions.getValue(nt.MINIMUM_VALUE,s.positions),s.width=t.width.getValue(nt.MINIMUM_VALUE),s.granularity=X.getValueOrUndefined(t.granularity,nt.MINIMUM_VALUE),s.cornerType=X.getValueOrUndefined(t.cornerType,nt.MINIMUM_VALUE),s.offsetAttribute=ii.computeGeometryOffsetAttribute(n,i,r,o),s.height=ii.getGeometryHeight(n,i),r=ii.getGeometryExtrudedHeight(r,o),r===ii.CLAMP_TO_GROUND&&(r=Mi.getMinimumMaximumHeights(eT.computeRectangle(s,y_e)).minimumTerrainHeight),s.extrudedHeight=r};um.DynamicGeometryUpdater=Qv;function Qv(e,t,n){Ii.call(this,e,t,n)}l(Object.create)&&(Qv.prototype=Object.create(Ii.prototype),Qv.prototype.constructor=Qv);Qv.prototype._isHidden=function(e,t,n){let i=this._options;return!l(i.positions)||!l(i.width)||Ii.prototype._isHidden.call(this,e,t,n)};Qv.prototype._setOptions=function(e,t,n){let i=this._options,r=X.getValueOrUndefined(t.height,n),o=X.getValueOrDefault(t.heightReference,n,We.NONE),s=X.getValueOrUndefined(t.extrudedHeight,n),a=X.getValueOrDefault(t.extrudedHeightReference,n,We.NONE);l(s)&&!l(r)&&(r=0),i.positions=X.getValueOrUndefined(t.positions,n),i.width=X.getValueOrUndefined(t.width,n),i.granularity=X.getValueOrUndefined(t.granularity,n),i.cornerType=X.getValueOrUndefined(t.cornerType,n),i.offsetAttribute=ii.computeGeometryOffsetAttribute(r,o,s,a),i.height=ii.getGeometryHeight(r,o),s=ii.getGeometryExtrudedHeight(s,a),s===ii.CLAMP_TO_GROUND&&(s=Mi.getMinimumMaximumHeights(eT.computeRectangle(i,y_e)).minimumTerrainHeight),i.extrudedHeight=s};var lL=um;var A_e={};A_e.computePositions=function(e,t,n,i,r){let o=e*.5,s=-o,a=i+i,c=r?2*a:a,u=new Float64Array(c*3),f,d=0,p=0,g=r?a*3:0,m=r?(a+i)*3:i*3;for(f=0;f<i;f++){let y=f/i*D.TWO_PI,A=Math.cos(y),b=Math.sin(y),x=A*n,T=b*n,E=A*t,v=b*t;u[p+g]=x,u[p+g+1]=T,u[p+g+2]=s,u[p+m]=E,u[p+m+1]=v,u[p+m+2]=o,p+=3,r&&(u[d++]=x,u[d++]=T,u[d++]=s,u[d++]=E,u[d++]=v,u[d++]=o)}return u};var tT=A_e;var m$=new U,fXe=new h,dXe=new h,hXe=new h,mXe=new h;function Bg(e){e=e??H.EMPTY_OBJECT;let t=e.length,n=e.topRadius,i=e.bottomRadius,r=e.vertexFormat??Be.DEFAULT,o=e.slices??128;this._length=t,this._topRadius=n,this._bottomRadius=i,this._vertexFormat=Be.clone(r),this._slices=o,this._offsetAttribute=e.offsetAttribute,this._workerName="createCylinderGeometry"}Bg.packedLength=Be.packedLength+5;Bg.pack=function(e,t,n){return n=n??0,Be.pack(e._vertexFormat,t,n),n+=Be.packedLength,t[n++]=e._length,t[n++]=e._topRadius,t[n++]=e._bottomRadius,t[n++]=e._slices,t[n]=e._offsetAttribute??-1,t};var b_e=new Be,eS={vertexFormat:b_e,length:void 0,topRadius:void 0,bottomRadius:void 0,slices:void 0,offsetAttribute:void 0};Bg.unpack=function(e,t,n){t=t??0;let i=Be.unpack(e,t,b_e);t+=Be.packedLength;let r=e[t++],o=e[t++],s=e[t++],a=e[t++],c=e[t];return l(n)?(n._vertexFormat=Be.clone(i,n._vertexFormat),n._length=r,n._topRadius=o,n._bottomRadius=s,n._slices=a,n._offsetAttribute=c===-1?void 0:c,n):(eS.length=r,eS.topRadius=o,eS.bottomRadius=s,eS.slices=a,eS.offsetAttribute=c===-1?void 0:c,new Bg(eS))};Bg.createGeometry=function(e){let t=e._length,n=e._topRadius,i=e._bottomRadius,r=e._vertexFormat,o=e._slices;if(t<=0||n<0||i<0||n===0&&i===0)return;let s=o+o,a=o+s,c=s+s,u=tT.computePositions(t,n,i,o,!0),f=r.st?new Float32Array(c*2):void 0,d=r.normal?new Float32Array(c*3):void 0,p=r.tangent?new Float32Array(c*3):void 0,g=r.bitangent?new Float32Array(c*3):void 0,m,y=r.normal||r.tangent||r.bitangent;if(y){let I=r.tangent||r.bitangent,R=0,O=0,L=0,_=Math.atan2(i-n,t),C=fXe;C.z=Math.sin(_);let w=Math.cos(_),P=hXe,M=dXe;for(m=0;m<o;m++){let F=m/o*D.TWO_PI,V=w*Math.cos(F),B=w*Math.sin(F);y&&(C.x=V,C.y=B,I&&(P=h.normalize(h.cross(h.UNIT_Z,C,P),P)),r.normal&&(d[R++]=C.x,d[R++]=C.y,d[R++]=C.z,d[R++]=C.x,d[R++]=C.y,d[R++]=C.z),r.tangent&&(p[O++]=P.x,p[O++]=P.y,p[O++]=P.z,p[O++]=P.x,p[O++]=P.y,p[O++]=P.z),r.bitangent&&(M=h.normalize(h.cross(C,P,M),M),g[L++]=M.x,g[L++]=M.y,g[L++]=M.z,g[L++]=M.x,g[L++]=M.y,g[L++]=M.z))}for(m=0;m<o;m++)r.normal&&(d[R++]=0,d[R++]=0,d[R++]=-1),r.tangent&&(p[O++]=1,p[O++]=0,p[O++]=0),r.bitangent&&(g[L++]=0,g[L++]=-1,g[L++]=0);for(m=0;m<o;m++)r.normal&&(d[R++]=0,d[R++]=0,d[R++]=1),r.tangent&&(p[O++]=1,p[O++]=0,p[O++]=0),r.bitangent&&(g[L++]=0,g[L++]=1,g[L++]=0)}let A=12*o-12,b=je.createTypedArray(c,A),x=0,T=0;for(m=0;m<o-1;m++)b[x++]=T,b[x++]=T+2,b[x++]=T+3,b[x++]=T,b[x++]=T+3,b[x++]=T+1,T+=2;for(b[x++]=s-2,b[x++]=0,b[x++]=1,b[x++]=s-2,b[x++]=1,b[x++]=s-1,m=1;m<o-1;m++)b[x++]=s+m+1,b[x++]=s+m,b[x++]=s;for(m=1;m<o-1;m++)b[x++]=a,b[x++]=a+m,b[x++]=a+m+1;let E=0;if(r.st){let I=Math.max(n,i);for(m=0;m<c;m++){let R=h.fromArray(u,m*3,mXe);f[E++]=(R.x+I)/(2*I),f[E++]=(R.y+I)/(2*I)}}let v=new Tn;r.position&&(v.position=new Ne({componentDatatype:Y.DOUBLE,componentsPerAttribute:3,values:u})),r.normal&&(v.normal=new Ne({componentDatatype:Y.FLOAT,componentsPerAttribute:3,values:d})),r.tangent&&(v.tangent=new Ne({componentDatatype:Y.FLOAT,componentsPerAttribute:3,values:p})),r.bitangent&&(v.bitangent=new Ne({componentDatatype:Y.FLOAT,componentsPerAttribute:3,values:g})),r.st&&(v.st=new Ne({componentDatatype:Y.FLOAT,componentsPerAttribute:2,values:f})),m$.x=t*.5,m$.y=Math.max(i,n);let S=new ue(h.ZERO,U.magnitude(m$));if(l(e._offsetAttribute)){t=u.length;let I=e._offsetAttribute===mn.NONE?0:1,R=new Uint8Array(t/3).fill(I);v.applyOffset=new Ne({componentDatatype:Y.UNSIGNED_BYTE,componentsPerAttribute:1,values:R})}return new St({attributes:v,indices:b,primitiveType:Oe.TRIANGLES,boundingSphere:S,offsetAttribute:e._offsetAttribute})};var p$;Bg.getUnitCylinder=function(){return l(p$)||(p$=Bg.createGeometry(new Bg({topRadius:1,bottomRadius:1,length:1,vertexFormat:Be.POSITION_ONLY}))),p$};var uL=Bg;var g$=new U;function tS(e){e=e??H.EMPTY_OBJECT;let t=e.length,n=e.topRadius,i=e.bottomRadius,r=e.slices??128,o=Math.max(e.numberOfVerticalLines??16,0);this._length=t,this._topRadius=n,this._bottomRadius=i,this._slices=r,this._numberOfVerticalLines=o,this._offsetAttribute=e.offsetAttribute,this._workerName="createCylinderOutlineGeometry"}tS.packedLength=6;tS.pack=function(e,t,n){return n=n??0,t[n++]=e._length,t[n++]=e._topRadius,t[n++]=e._bottomRadius,t[n++]=e._slices,t[n++]=e._numberOfVerticalLines,t[n]=e._offsetAttribute??-1,t};var nT={length:void 0,topRadius:void 0,bottomRadius:void 0,slices:void 0,numberOfVerticalLines:void 0,offsetAttribute:void 0};tS.unpack=function(e,t,n){t=t??0;let i=e[t++],r=e[t++],o=e[t++],s=e[t++],a=e[t++],c=e[t];return l(n)?(n._length=i,n._topRadius=r,n._bottomRadius=o,n._slices=s,n._numberOfVerticalLines=a,n._offsetAttribute=c===-1?void 0:c,n):(nT.length=i,nT.topRadius=r,nT.bottomRadius=o,nT.slices=s,nT.numberOfVerticalLines=a,nT.offsetAttribute=c===-1?void 0:c,new tS(nT))};tS.createGeometry=function(e){let t=e._length,n=e._topRadius,i=e._bottomRadius,r=e._slices,o=e._numberOfVerticalLines;if(t<=0||n<0||i<0||n===0&&i===0)return;let s=r*2,a=tT.computePositions(t,n,i,r,!1),c=r*2,u;if(o>0){let y=Math.min(o,r);u=Math.round(r/y),c+=y}let f=je.createTypedArray(s,c*2),d=0,p;for(p=0;p<r-1;p++)f[d++]=p,f[d++]=p+1,f[d++]=p+r,f[d++]=p+1+r;if(f[d++]=r-1,f[d++]=0,f[d++]=r+r-1,f[d++]=r,o>0)for(p=0;p<r;p+=u)f[d++]=p,f[d++]=p+r;let g=new Tn;g.position=new Ne({componentDatatype:Y.DOUBLE,componentsPerAttribute:3,values:a}),g$.x=t*.5,g$.y=Math.max(i,n);let m=new ue(h.ZERO,U.magnitude(g$));if(l(e._offsetAttribute)){t=a.length;let y=e._offsetAttribute===mn.NONE?0:1,A=new Uint8Array(t/3).fill(y);g.applyOffset=new Ne({componentDatatype:Y.UNSIGNED_BYTE,componentsPerAttribute:1,values:A})}return new St({attributes:g,indices:f,primitiveType:Oe.LINES,boundingSphere:m,offsetAttribute:e._offsetAttribute})};var fL=tS;var x_e=h.ZERO,T_e=new h,pXe=new h,E_e=new z;function gXe(e){this.id=e,this.vertexFormat=void 0,this.length=void 0,this.topRadius=void 0,this.bottomRadius=void 0,this.slices=void 0,this.numberOfVerticalLines=void 0,this.offsetAttribute=void 0}function Nf(e,t){Pi.call(this,{entity:e,scene:t,geometryOptions:new gXe(e),geometryPropertyName:"cylinder",observedPropertyNames:["availability","position","orientation","cylinder"]}),this._onEntityPropertyChanged(e,"cylinder",e.cylinder,void 0)}l(Object.create)&&(Nf.prototype=Object.create(Pi.prototype),Nf.prototype.constructor=Nf);Object.defineProperties(Nf.prototype,{terrainOffsetProperty:{get:function(){return this._terrainOffsetProperty}}});Nf.prototype.createFillGeometryInstance=function(e){let t=this._entity,n=t.isAvailable(e),i=new Dn(n&&t.isShowing&&this._showProperty.getValue(e)&&this._fillProperty.getValue(e)),r=this._distanceDisplayConditionProperty.getValue(e),o=ti.fromDistanceDisplayCondition(r),s={show:i,distanceDisplayCondition:o,color:void 0,offset:void 0};if(this._materialProperty instanceof Kt){let a;l(this._materialProperty.color)&&(this._materialProperty.color.isConstant||n)&&(a=this._materialProperty.color.getValue(e,E_e)),l(a)||(a=z.WHITE),s.color=Jt.fromColor(a)}return l(this._options.offsetAttribute)&&(s.offset=Tr.fromCartesian3(X.getValueOrDefault(this._terrainOffsetProperty,e,x_e,T_e))),new Ft({id:t,geometry:new uL(this._options),modelMatrix:t.computeModelMatrixForHeightReference(e,t.cylinder.heightReference,this._options.length*.5,this._scene.ellipsoid),attributes:s})};Nf.prototype.createOutlineGeometryInstance=function(e){let t=this._entity,n=t.isAvailable(e),i=X.getValueOrDefault(this._outlineColorProperty,e,z.BLACK,E_e),r=this._distanceDisplayConditionProperty.getValue(e),o={show:new Dn(n&&t.isShowing&&this._showProperty.getValue(e)&&this._showOutlineProperty.getValue(e)),color:Jt.fromColor(i),distanceDisplayCondition:ti.fromDistanceDisplayCondition(r),offset:void 0};return l(this._options.offsetAttribute)&&(o.offset=Tr.fromCartesian3(X.getValueOrDefault(this._terrainOffsetProperty,e,x_e,T_e))),new Ft({id:t,geometry:new fL(this._options),modelMatrix:t.computeModelMatrixForHeightReference(e,t.cylinder.heightReference,this._options.length*.5,this._scene.ellipsoid),attributes:o})};Nf.prototype._computeCenter=function(e,t){return X.getValueOrUndefined(this._entity.position,e,t)};Nf.prototype._isHidden=function(e,t){return!l(e.position)||!l(t.length)||!l(t.topRadius)||!l(t.bottomRadius)||Pi.prototype._isHidden.call(this,e,t)};Nf.prototype._isDynamic=function(e,t){return!e.position.isConstant||!X.isConstant(e.orientation)||!t.length.isConstant||!t.topRadius.isConstant||!t.bottomRadius.isConstant||!X.isConstant(t.slices)||!X.isConstant(t.outlineWidth)||!X.isConstant(t.numberOfVerticalLines)};Nf.prototype._setStaticOptions=function(e,t){let n=X.getValueOrDefault(t.heightReference,nt.MINIMUM_VALUE,We.NONE),i=this._options;i.vertexFormat=this._materialProperty instanceof Kt?yn.VERTEX_FORMAT:Er.MaterialSupport.TEXTURED.vertexFormat,i.length=t.length.getValue(nt.MINIMUM_VALUE),i.topRadius=t.topRadius.getValue(nt.MINIMUM_VALUE),i.bottomRadius=t.bottomRadius.getValue(nt.MINIMUM_VALUE),i.slices=X.getValueOrUndefined(t.slices,nt.MINIMUM_VALUE),i.numberOfVerticalLines=X.getValueOrUndefined(t.numberOfVerticalLines,nt.MINIMUM_VALUE),i.offsetAttribute=n!==We.NONE?mn.ALL:void 0};Nf.prototype._onEntityPropertyChanged=Og;Nf.DynamicGeometryUpdater=nS;function nS(e,t,n){Ii.call(this,e,t,n)}l(Object.create)&&(nS.prototype=Object.create(Ii.prototype),nS.prototype.constructor=nS);nS.prototype._isHidden=function(e,t,n){let i=this._options,r=X.getValueOrUndefined(e.position,n,pXe);return!l(r)||!l(i.length)||!l(i.topRadius)||!l(i.bottomRadius)||Ii.prototype._isHidden.call(this,e,t,n)};nS.prototype._setOptions=function(e,t,n){let i=X.getValueOrDefault(t.heightReference,n,We.NONE),r=this._options;r.length=X.getValueOrUndefined(t.length,n),r.topRadius=X.getValueOrUndefined(t.topRadius,n),r.bottomRadius=X.getValueOrUndefined(t.bottomRadius,n),r.slices=X.getValueOrUndefined(t.slices,n),r.numberOfVerticalLines=X.getValueOrUndefined(t.numberOfVerticalLines,n),r.offsetAttribute=i!==We.NONE?mn.ALL:void 0};var dL=Nf;var y$={},K6=new h,C_e=new h,v_e=new Le,S_e=new $;function iS(e,t,n,i,r,o,s,a,c,u){let f=e+t;h.multiplyByScalar(i,Math.cos(f),K6),h.multiplyByScalar(n,Math.sin(f),C_e),h.add(K6,C_e,K6);let d=Math.cos(e);d=d*d;let p=Math.sin(e);p=p*p;let m=o/Math.sqrt(s*d+r*p)/a;return Le.fromAxisAngle(K6,m,v_e),$.fromQuaternion(v_e,S_e),$.multiplyByVector(S_e,c,u),h.normalize(u,u),h.multiplyByScalar(u,a,u),u}var w_e=new h,I_e=new h,_$=new h,_Xe=new h;y$.raisePositionsToHeight=function(e,t,n){let i=t.ellipsoid,r=t.height,o=t.extrudedHeight,s=n?e.length/3*2:e.length/3,a=new Float64Array(s*3),c=e.length,u=n?c:0;for(let f=0;f<c;f+=3){let d=f+1,p=f+2,g=h.fromArray(e,f,w_e);i.scaleToGeodeticSurface(g,g);let m=h.clone(g,I_e),y=i.geodeticSurfaceNormal(g,_Xe),A=h.multiplyByScalar(y,r,_$);h.add(g,A,g),n&&(h.multiplyByScalar(y,o,A),h.add(m,A,m),a[f+u]=m.x,a[d+u]=m.y,a[p+u]=m.z),a[f]=g.x,a[d]=g.y,a[p]=g.z}return a};var yXe=new h,AXe=new h,bXe=new h;y$.computeEllipsePositions=function(e,t,n){let i=e.semiMinorAxis,r=e.semiMajorAxis,o=e.rotation,s=e.center,a=e.granularity*8,c=i*i,u=r*r,f=r*i,d=h.magnitude(s),p=h.normalize(s,yXe),g=h.cross(h.UNIT_Z,s,AXe);g=h.normalize(g,g);let m=h.cross(p,g,bXe),y=1+Math.ceil(D.PI_OVER_TWO/a),A=D.PI_OVER_TWO/(y-1),b=D.PI_OVER_TWO-y*A;b<0&&(y-=Math.ceil(Math.abs(b)/A));let x=2*(y*(y+2)),T=t?new Array(x*3):void 0,E=0,v=w_e,S=I_e,I=y*4*3,R=I-1,O=0,L=n?new Array(I):void 0,_,C,w,P,M;for(b=D.PI_OVER_TWO,v=iS(b,o,m,g,c,f,u,d,p,v),t&&(T[E++]=v.x,T[E++]=v.y,T[E++]=v.z),n&&(L[R--]=v.z,L[R--]=v.y,L[R--]=v.x),b=D.PI_OVER_TWO-A,_=1;_<y+1;++_){if(v=iS(b,o,m,g,c,f,u,d,p,v),S=iS(Math.PI-b,o,m,g,c,f,u,d,p,S),t){for(T[E++]=v.x,T[E++]=v.y,T[E++]=v.z,w=2*_+2,C=1;C<w-1;++C)P=C/(w-1),M=h.lerp(v,S,P,_$),T[E++]=M.x,T[E++]=M.y,T[E++]=M.z;T[E++]=S.x,T[E++]=S.y,T[E++]=S.z}n&&(L[R--]=v.z,L[R--]=v.y,L[R--]=v.x,L[O++]=S.x,L[O++]=S.y,L[O++]=S.z),b=D.PI_OVER_TWO-(_+1)*A}for(_=y;_>1;--_){if(b=D.PI_OVER_TWO-(_-1)*A,v=iS(-b,o,m,g,c,f,u,d,p,v),S=iS(b+Math.PI,o,m,g,c,f,u,d,p,S),t){for(T[E++]=v.x,T[E++]=v.y,T[E++]=v.z,w=2*(_-1)+2,C=1;C<w-1;++C)P=C/(w-1),M=h.lerp(v,S,P,_$),T[E++]=M.x,T[E++]=M.y,T[E++]=M.z;T[E++]=S.x,T[E++]=S.y,T[E++]=S.z}n&&(L[R--]=v.z,L[R--]=v.y,L[R--]=v.x,L[O++]=S.x,L[O++]=S.y,L[O++]=S.z)}b=D.PI_OVER_TWO,v=iS(-b,o,m,g,c,f,u,d,p,v);let F={};return t&&(T[E++]=v.x,T[E++]=v.y,T[E]=v.z,F.positions=T,F.numPts=y),n&&(L[R--]=v.z,L[R--]=v.y,L[R]=v.x,F.outerPositions=L),F};var Uu=y$;var rS=new h,A$=new h,b$=new h,P_e=new h,_a=new U,D_e=new $,xXe=new $,x$=new Le,R_e=new h,O_e=new h,M_e=new h,Z6=new he,N_e=new h,L_e=new U,F_e=new U;function B_e(e,t,n){let i=t.vertexFormat,r=t.center,o=t.semiMajorAxis,s=t.semiMinorAxis,a=t.ellipsoid,c=t.stRotation,u=n?e.length/3*2:e.length/3,f=t.shadowVolume,d=i.st?new Float32Array(u*2):void 0,p=i.normal?new Float32Array(u*3):void 0,g=i.tangent?new Float32Array(u*3):void 0,m=i.bitangent?new Float32Array(u*3):void 0,y=f?new Float32Array(u*3):void 0,A=0,b=R_e,x=O_e,T=M_e,E=new Ui(a),v=E.project(a.cartesianToCartographic(r,Z6),N_e),S=a.scaleToGeodeticSurface(r,rS);a.geodeticSurfaceNormal(S,S);let I=D_e,R=xXe;if(c!==0){let M=Le.fromAxisAngle(S,c,x$);I=$.fromQuaternion(M,I),M=Le.fromAxisAngle(S,-c,x$),R=$.fromQuaternion(M,R)}else I=$.clone($.IDENTITY,I),R=$.clone($.IDENTITY,R);let O=U.fromElements(Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY,L_e),L=U.fromElements(Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY,F_e),_=e.length,C=n?_:0,w=C/3*2;for(let M=0;M<_;M+=3){let F=M+1,V=M+2,B=h.fromArray(e,M,rS);if(i.st){let j=$.multiplyByVector(I,B,A$),k=E.project(a.cartesianToCartographic(j,Z6),b$);h.subtract(k,v,k),_a.x=(k.x+o)/(2*o),_a.y=(k.y+s)/(2*s),O.x=Math.min(_a.x,O.x),O.y=Math.min(_a.y,O.y),L.x=Math.max(_a.x,L.x),L.y=Math.max(_a.y,L.y),n&&(d[A+w]=_a.x,d[A+1+w]=_a.y),d[A++]=_a.x,d[A++]=_a.y}(i.normal||i.tangent||i.bitangent||f)&&(b=a.geodeticSurfaceNormal(B,b),f&&(y[M+C]=-b.x,y[F+C]=-b.y,y[V+C]=-b.z),(i.normal||i.tangent||i.bitangent)&&((i.tangent||i.bitangent)&&(x=h.normalize(h.cross(h.UNIT_Z,b,x),x),$.multiplyByVector(R,x,x)),i.normal&&(p[M]=b.x,p[F]=b.y,p[V]=b.z,n&&(p[M+C]=-b.x,p[F+C]=-b.y,p[V+C]=-b.z)),i.tangent&&(g[M]=x.x,g[F]=x.y,g[V]=x.z,n&&(g[M+C]=-x.x,g[F+C]=-x.y,g[V+C]=-x.z)),i.bitangent&&(T=h.normalize(h.cross(b,x,T),T),m[M]=T.x,m[F]=T.y,m[V]=T.z,n&&(m[M+C]=T.x,m[F+C]=T.y,m[V+C]=T.z))))}if(i.st){_=d.length;for(let M=0;M<_;M+=2)d[M]=(d[M]-O.x)/(L.x-O.x),d[M+1]=(d[M+1]-O.y)/(L.y-O.y)}let P=new Tn;if(i.position){let M=Uu.raisePositionsToHeight(e,t,n);P.position=new Ne({componentDatatype:Y.DOUBLE,componentsPerAttribute:3,values:M})}if(i.st&&(P.st=new Ne({componentDatatype:Y.FLOAT,componentsPerAttribute:2,values:d})),i.normal&&(P.normal=new Ne({componentDatatype:Y.FLOAT,componentsPerAttribute:3,values:p})),i.tangent&&(P.tangent=new Ne({componentDatatype:Y.FLOAT,componentsPerAttribute:3,values:g})),i.bitangent&&(P.bitangent=new Ne({componentDatatype:Y.FLOAT,componentsPerAttribute:3,values:m})),f&&(P.extrudeDirection=new Ne({componentDatatype:Y.FLOAT,componentsPerAttribute:3,values:y})),n&&l(t.offsetAttribute)){let M=new Uint8Array(u);if(t.offsetAttribute===mn.TOP)M=M.fill(1,0,u/2);else{let F=t.offsetAttribute===mn.NONE?0:1;M=M.fill(F)}P.applyOffset=new Ne({componentDatatype:Y.UNSIGNED_BYTE,componentsPerAttribute:1,values:M})}return P}function k_e(e){let t=new Array(12*(e*(e+1))-6),n=0,i,r,o,s,a;for(i=0,o=1,s=0;s<3;s++)t[n++]=o++,t[n++]=i,t[n++]=o;for(s=2;s<e+1;++s){for(o=s*(s+1)-1,i=(s-1)*s-1,t[n++]=o++,t[n++]=i,t[n++]=o,r=2*s,a=0;a<r-1;++a)t[n++]=o,t[n++]=i++,t[n++]=i,t[n++]=o++,t[n++]=i,t[n++]=o;t[n++]=o++,t[n++]=i,t[n++]=o}for(r=e*2,++o,++i,s=0;s<r-1;++s)t[n++]=o,t[n++]=i++,t[n++]=i,t[n++]=o++,t[n++]=i,t[n++]=o;for(t[n++]=o,t[n++]=i++,t[n++]=i,t[n++]=o++,t[n++]=i++,t[n++]=i,++i,s=e-1;s>1;--s){for(t[n++]=i++,t[n++]=i,t[n++]=o,r=2*s,a=0;a<r-1;++a)t[n++]=o,t[n++]=i++,t[n++]=i,t[n++]=o++,t[n++]=i,t[n++]=o;t[n++]=i++,t[n++]=i++,t[n++]=o++}for(s=0;s<3;s++)t[n++]=i++,t[n++]=i,t[n++]=o;return t}var iT=new h;function TXe(e){let t=e.center;iT=h.multiplyByScalar(e.ellipsoid.geodeticSurfaceNormal(t,iT),e.height,iT),iT=h.add(t,iT,iT);let n=new ue(iT,e.semiMajorAxis),i=Uu.computeEllipsePositions(e,!0,!1),r=i.positions,o=i.numPts,s=B_e(r,e,!1),a=k_e(o);return a=je.createTypedArray(r.length/3,a),{boundingSphere:n,attributes:s,indices:a}}function EXe(e,t){let n=t.vertexFormat,i=t.center,r=t.semiMajorAxis,o=t.semiMinorAxis,s=t.ellipsoid,a=t.height,c=t.extrudedHeight,u=t.stRotation,f=e.length/3*2,d=new Float64Array(f*3),p=n.st?new Float32Array(f*2):void 0,g=n.normal?new Float32Array(f*3):void 0,m=n.tangent?new Float32Array(f*3):void 0,y=n.bitangent?new Float32Array(f*3):void 0,A=t.shadowVolume,b=A?new Float32Array(f*3):void 0,x=0,T=R_e,E=O_e,v=M_e,S=new Ui(s),I=S.project(s.cartesianToCartographic(i,Z6),N_e),R=s.scaleToGeodeticSurface(i,rS);s.geodeticSurfaceNormal(R,R);let O=Le.fromAxisAngle(R,u,x$),L=$.fromQuaternion(O,D_e),_=U.fromElements(Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY,L_e),C=U.fromElements(Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY,F_e),w=e.length,P=w/3*2;for(let F=0;F<w;F+=3){let V=F+1,B=F+2,j=h.fromArray(e,F,rS),k;if(n.st){let q=$.multiplyByVector(L,j,A$),Q=S.project(s.cartesianToCartographic(q,Z6),b$);h.subtract(Q,I,Q),_a.x=(Q.x+r)/(2*r),_a.y=(Q.y+o)/(2*o),_.x=Math.min(_a.x,_.x),_.y=Math.min(_a.y,_.y),C.x=Math.max(_a.x,C.x),C.y=Math.max(_a.y,C.y),p[x+P]=_a.x,p[x+1+P]=_a.y,p[x++]=_a.x,p[x++]=_a.y}j=s.scaleToGeodeticSurface(j,j),k=h.clone(j,A$),T=s.geodeticSurfaceNormal(j,T),A&&(b[F+w]=-T.x,b[V+w]=-T.y,b[B+w]=-T.z);let G=h.multiplyByScalar(T,a,P_e);if(j=h.add(j,G,j),G=h.multiplyByScalar(T,c,G),k=h.add(k,G,k),n.position&&(d[F+w]=k.x,d[V+w]=k.y,d[B+w]=k.z,d[F]=j.x,d[V]=j.y,d[B]=j.z),n.normal||n.tangent||n.bitangent){v=h.clone(T,v);let q=h.fromArray(e,(F+3)%w,P_e);h.subtract(q,j,q);let Q=h.subtract(k,j,b$);T=h.normalize(h.cross(Q,q,T),T),n.normal&&(g[F]=T.x,g[V]=T.y,g[B]=T.z,g[F+w]=T.x,g[V+w]=T.y,g[B+w]=T.z),n.tangent&&(E=h.normalize(h.cross(v,T,E),E),m[F]=E.x,m[V]=E.y,m[B]=E.z,m[F+w]=E.x,m[F+1+w]=E.y,m[F+2+w]=E.z),n.bitangent&&(y[F]=v.x,y[V]=v.y,y[B]=v.z,y[F+w]=v.x,y[V+w]=v.y,y[B+w]=v.z)}}if(n.st){w=p.length;for(let F=0;F<w;F+=2)p[F]=(p[F]-_.x)/(C.x-_.x),p[F+1]=(p[F+1]-_.y)/(C.y-_.y)}let M=new Tn;if(n.position&&(M.position=new Ne({componentDatatype:Y.DOUBLE,componentsPerAttribute:3,values:d})),n.st&&(M.st=new Ne({componentDatatype:Y.FLOAT,componentsPerAttribute:2,values:p})),n.normal&&(M.normal=new Ne({componentDatatype:Y.FLOAT,componentsPerAttribute:3,values:g})),n.tangent&&(M.tangent=new Ne({componentDatatype:Y.FLOAT,componentsPerAttribute:3,values:m})),n.bitangent&&(M.bitangent=new Ne({componentDatatype:Y.FLOAT,componentsPerAttribute:3,values:y})),A&&(M.extrudeDirection=new Ne({componentDatatype:Y.FLOAT,componentsPerAttribute:3,values:b})),l(t.offsetAttribute)){let F=new Uint8Array(f);if(t.offsetAttribute===mn.TOP)F=F.fill(1,0,f/2);else{let V=t.offsetAttribute===mn.NONE?0:1;F=F.fill(V)}M.applyOffset=new Ne({componentDatatype:Y.UNSIGNED_BYTE,componentsPerAttribute:1,values:F})}return M}function CXe(e){let t=e.length/3,n=je.createTypedArray(t,t*6),i=0;for(let r=0;r<t;r++){let o=r,s=r+t,a=(o+1)%t,c=a+t;n[i++]=o,n[i++]=s,n[i++]=a,n[i++]=a,n[i++]=s,n[i++]=c}return n}var $6=new ue,J6=new ue;function vXe(e){let t=e.center,n=e.ellipsoid,i=e.semiMajorAxis,r=h.multiplyByScalar(n.geodeticSurfaceNormal(t,rS),e.height,rS);$6.center=h.add(t,r,$6.center),$6.radius=i,r=h.multiplyByScalar(n.geodeticSurfaceNormal(t,r),e.extrudedHeight,r),J6.center=h.add(t,r,J6.center),J6.radius=i;let o=Uu.computeEllipsePositions(e,!0,!0),s=o.positions,a=o.numPts,c=o.outerPositions,u=ue.union($6,J6),f=B_e(s,e,!0),d=k_e(a),p=d.length;d.length=p*2;let g=s.length/3;for(let E=0;E<p;E+=3)d[E+p]=d[E+2]+g,d[E+1+p]=d[E+1]+g,d[E+2+p]=d[E]+g;let m=je.createTypedArray(g*2/3,d),y=new St({attributes:f,indices:m,primitiveType:Oe.TRIANGLES}),A=EXe(c,e);d=CXe(c);let b=je.createTypedArray(c.length*2/3,d),x=new St({attributes:A,indices:b,primitiveType:Oe.TRIANGLES}),T=Hn.combineInstances([new Ft({geometry:y}),new Ft({geometry:x})]);return{boundingSphere:u,attributes:T[0].attributes,indices:T[0].indices}}function U_e(e,t,n,i,r,o,s){let c=Uu.computeEllipsePositions({center:e,semiMajorAxis:t,semiMinorAxis:n,rotation:i,granularity:r},!1,!0).outerPositions,u=c.length/3,f=new Array(u);for(let p=0;p<u;++p)f[p]=h.fromArray(c,p*3);let d=ie.fromCartesianArray(f,o,s);return d.width>D.PI&&(d.north=d.north>0?D.PI_OVER_TWO-D.EPSILON7:d.north,d.south=d.south<0?D.EPSILON7-D.PI_OVER_TWO:d.south,d.east=D.PI,d.west=-D.PI),d}function Gp(e){e=e??H.EMPTY_OBJECT;let t=e.center,n=e.ellipsoid??ee.default,i=e.semiMajorAxis,r=e.semiMinorAxis,o=e.granularity??D.RADIANS_PER_DEGREE,s=e.vertexFormat??Be.DEFAULT,a=e.height??0,c=e.extrudedHeight??a;this._center=h.clone(t),this._semiMajorAxis=i,this._semiMinorAxis=r,this._ellipsoid=ee.clone(n),this._rotation=e.rotation??0,this._stRotation=e.stRotation??0,this._height=Math.max(c,a),this._granularity=o,this._vertexFormat=Be.clone(s),this._extrudedHeight=Math.min(c,a),this._shadowVolume=e.shadowVolume??!1,this._workerName="createEllipseGeometry",this._offsetAttribute=e.offsetAttribute,this._rectangle=void 0,this._textureCoordinateRotationPoints=void 0}Gp.packedLength=h.packedLength+ee.packedLength+Be.packedLength+9;Gp.pack=function(e,t,n){return n=n??0,h.pack(e._center,t,n),n+=h.packedLength,ee.pack(e._ellipsoid,t,n),n+=ee.packedLength,Be.pack(e._vertexFormat,t,n),n+=Be.packedLength,t[n++]=e._semiMajorAxis,t[n++]=e._semiMinorAxis,t[n++]=e._rotation,t[n++]=e._stRotation,t[n++]=e._height,t[n++]=e._granularity,t[n++]=e._extrudedHeight,t[n++]=e._shadowVolume?1:0,t[n]=e._offsetAttribute??-1,t};var z_e=new h,V_e=new ee,j_e=new Be,Hp={center:z_e,ellipsoid:V_e,vertexFormat:j_e,semiMajorAxis:void 0,semiMinorAxis:void 0,rotation:void 0,stRotation:void 0,height:void 0,granularity:void 0,extrudedHeight:void 0,shadowVolume:void 0,offsetAttribute:void 0};Gp.unpack=function(e,t,n){t=t??0;let i=h.unpack(e,t,z_e);t+=h.packedLength;let r=ee.unpack(e,t,V_e);t+=ee.packedLength;let o=Be.unpack(e,t,j_e);t+=Be.packedLength;let s=e[t++],a=e[t++],c=e[t++],u=e[t++],f=e[t++],d=e[t++],p=e[t++],g=e[t++]===1,m=e[t];return l(n)?(n._center=h.clone(i,n._center),n._ellipsoid=ee.clone(r,n._ellipsoid),n._vertexFormat=Be.clone(o,n._vertexFormat),n._semiMajorAxis=s,n._semiMinorAxis=a,n._rotation=c,n._stRotation=u,n._height=f,n._granularity=d,n._extrudedHeight=p,n._shadowVolume=g,n._offsetAttribute=m===-1?void 0:m,n):(Hp.height=f,Hp.extrudedHeight=p,Hp.granularity=d,Hp.stRotation=u,Hp.rotation=c,Hp.semiMajorAxis=s,Hp.semiMinorAxis=a,Hp.shadowVolume=g,Hp.offsetAttribute=m===-1?void 0:m,new Gp(Hp))};Gp.computeRectangle=function(e,t){e=e??H.EMPTY_OBJECT;let n=e.center,i=e.ellipsoid??ee.default,r=e.semiMajorAxis,o=e.semiMinorAxis,s=e.granularity??D.RADIANS_PER_DEGREE,a=e.rotation??0;return U_e(n,r,o,a,s,i,t)};Gp.createGeometry=function(e){if(e._semiMajorAxis<=0||e._semiMinorAxis<=0)return;let t=e._height,n=e._extrudedHeight,i=!D.equalsEpsilon(t,n,0,D.EPSILON2);e._center=e._ellipsoid.scaleToGeodeticSurface(e._center,e._center);let r={center:e._center,semiMajorAxis:e._semiMajorAxis,semiMinorAxis:e._semiMinorAxis,ellipsoid:e._ellipsoid,rotation:e._rotation,height:t,granularity:e._granularity,vertexFormat:e._vertexFormat,stRotation:e._stRotation},o;if(i)r.extrudedHeight=n,r.shadowVolume=e._shadowVolume,r.offsetAttribute=e._offsetAttribute,o=vXe(r);else if(o=TXe(r),l(e._offsetAttribute)){let s=o.attributes.position.values.length,a=e._offsetAttribute===mn.NONE?0:1,c=new Uint8Array(s/3).fill(a);o.attributes.applyOffset=new Ne({componentDatatype:Y.UNSIGNED_BYTE,componentsPerAttribute:1,values:c})}return new St({attributes:o.attributes,indices:o.indices,primitiveType:Oe.TRIANGLES,boundingSphere:o.boundingSphere,offsetAttribute:e._offsetAttribute})};Gp.createShadowVolume=function(e,t,n){let i=e._granularity,r=e._ellipsoid,o=t(i,r),s=n(i,r);return new Gp({center:e._center,semiMajorAxis:e._semiMajorAxis,semiMinorAxis:e._semiMinorAxis,ellipsoid:r,rotation:e._rotation,stRotation:e._stRotation,granularity:i,extrudedHeight:o,height:s,vertexFormat:Be.POSITION_ONLY,shadowVolume:!0})};function SXe(e){let t=-e._stRotation;if(t===0)return[0,0,0,1,1,0];let i=Uu.computeEllipsePositions({center:e._center,semiMajorAxis:e._semiMajorAxis,semiMinorAxis:e._semiMinorAxis,rotation:e._rotation,granularity:e._granularity},!1,!0).outerPositions,r=i.length/3,o=new Array(r);for(let c=0;c<r;++c)o[c]=h.fromArray(i,c*3);let s=e._ellipsoid,a=e.rectangle;return St._textureCoordinateRotationPoints(o,t,s,a)}Object.defineProperties(Gp.prototype,{rectangle:{get:function(){return l(this._rectangle)||(this._rectangle=U_e(this._center,this._semiMajorAxis,this._semiMinorAxis,this._rotation,this._granularity,this._ellipsoid)),this._rectangle}},textureCoordinateRotationPoints:{get:function(){return l(this._textureCoordinateRotationPoints)||(this._textureCoordinateRotationPoints=SXe(this)),this._textureCoordinateRotationPoints}}});var nu=Gp;var H_e=new h,rT=new h;function wXe(e){let t=e.center;rT=h.multiplyByScalar(e.ellipsoid.geodeticSurfaceNormal(t,rT),e.height,rT),rT=h.add(t,rT,rT);let n=new ue(rT,e.semiMajorAxis),i=Uu.computeEllipsePositions(e,!1,!0).outerPositions,r=new Tn({position:new Ne({componentDatatype:Y.DOUBLE,componentsPerAttribute:3,values:Uu.raisePositionsToHeight(i,e,!1)})}),o=i.length/3,s=je.createTypedArray(o,o*2),a=0;for(let c=0;c<o;++c)s[a++]=c,s[a++]=(c+1)%o;return{boundingSphere:n,attributes:r,indices:s}}var Q6=new ue,eH=new ue;function IXe(e){let t=e.center,n=e.ellipsoid,i=e.semiMajorAxis,r=h.multiplyByScalar(n.geodeticSurfaceNormal(t,H_e),e.height,H_e);Q6.center=h.add(t,r,Q6.center),Q6.radius=i,r=h.multiplyByScalar(n.geodeticSurfaceNormal(t,r),e.extrudedHeight,r),eH.center=h.add(t,r,eH.center),eH.radius=i;let o=Uu.computeEllipsePositions(e,!1,!0).outerPositions,s=new Tn({position:new Ne({componentDatatype:Y.DOUBLE,componentsPerAttribute:3,values:Uu.raisePositionsToHeight(o,e,!0)})});o=s.position.values;let a=ue.union(Q6,eH),c=o.length/3;if(l(e.offsetAttribute)){let m=new Uint8Array(c);if(e.offsetAttribute===mn.TOP)m=m.fill(1,0,c/2);else{let y=e.offsetAttribute===mn.NONE?0:1;m=m.fill(y)}s.applyOffset=new Ne({componentDatatype:Y.UNSIGNED_BYTE,componentsPerAttribute:1,values:m})}let u=e.numberOfVerticalLines??16;u=D.clamp(u,0,c/2);let f=je.createTypedArray(c,c*2+u*2);c/=2;let d=0,p;for(p=0;p<c;++p)f[d++]=p,f[d++]=(p+1)%c,f[d++]=p+c,f[d++]=(p+1)%c+c;let g;if(u>0){let m=Math.min(u,c);g=Math.round(c/m);let y=Math.min(g*u,c);for(p=0;p<y;p+=g)f[d++]=p,f[d++]=p+c}return{boundingSphere:a,attributes:s,indices:f}}function oS(e){e=e??H.EMPTY_OBJECT;let t=e.center,n=e.ellipsoid??ee.default,i=e.semiMajorAxis,r=e.semiMinorAxis,o=e.granularity??D.RADIANS_PER_DEGREE,s=e.height??0,a=e.extrudedHeight??s;this._center=h.clone(t),this._semiMajorAxis=i,this._semiMinorAxis=r,this._ellipsoid=ee.clone(n),this._rotation=e.rotation??0,this._height=Math.max(a,s),this._granularity=o,this._extrudedHeight=Math.min(a,s),this._numberOfVerticalLines=Math.max(e.numberOfVerticalLines??16,0),this._offsetAttribute=e.offsetAttribute,this._workerName="createEllipseOutlineGeometry"}oS.packedLength=h.packedLength+ee.packedLength+8;oS.pack=function(e,t,n){return n=n??0,h.pack(e._center,t,n),n+=h.packedLength,ee.pack(e._ellipsoid,t,n),n+=ee.packedLength,t[n++]=e._semiMajorAxis,t[n++]=e._semiMinorAxis,t[n++]=e._rotation,t[n++]=e._height,t[n++]=e._granularity,t[n++]=e._extrudedHeight,t[n++]=e._numberOfVerticalLines,t[n]=e._offsetAttribute??-1,t};var G_e=new h,W_e=new ee,kg={center:G_e,ellipsoid:W_e,semiMajorAxis:void 0,semiMinorAxis:void 0,rotation:void 0,height:void 0,granularity:void 0,extrudedHeight:void 0,numberOfVerticalLines:void 0,offsetAttribute:void 0};oS.unpack=function(e,t,n){t=t??0;let i=h.unpack(e,t,G_e);t+=h.packedLength;let r=ee.unpack(e,t,W_e);t+=ee.packedLength;let o=e[t++],s=e[t++],a=e[t++],c=e[t++],u=e[t++],f=e[t++],d=e[t++],p=e[t];return l(n)?(n._center=h.clone(i,n._center),n._ellipsoid=ee.clone(r,n._ellipsoid),n._semiMajorAxis=o,n._semiMinorAxis=s,n._rotation=a,n._height=c,n._granularity=u,n._extrudedHeight=f,n._numberOfVerticalLines=d,n._offsetAttribute=p===-1?void 0:p,n):(kg.height=c,kg.extrudedHeight=f,kg.granularity=u,kg.rotation=a,kg.semiMajorAxis=o,kg.semiMinorAxis=s,kg.numberOfVerticalLines=d,kg.offsetAttribute=p===-1?void 0:p,new oS(kg))};oS.createGeometry=function(e){if(e._semiMajorAxis<=0||e._semiMinorAxis<=0)return;let t=e._height,n=e._extrudedHeight,i=!D.equalsEpsilon(t,n,0,D.EPSILON2);e._center=e._ellipsoid.scaleToGeodeticSurface(e._center,e._center);let r={center:e._center,semiMajorAxis:e._semiMajorAxis,semiMinorAxis:e._semiMinorAxis,ellipsoid:e._ellipsoid,rotation:e._rotation,height:t,granularity:e._granularity,numberOfVerticalLines:e._numberOfVerticalLines},o;if(i)r.extrudedHeight=n,r.offsetAttribute=e._offsetAttribute,o=IXe(r);else if(o=wXe(r),l(e._offsetAttribute)){let s=o.attributes.position.values.length,a=e._offsetAttribute===mn.NONE?0:1,c=new Uint8Array(s/3).fill(a);o.attributes.applyOffset=new Ne({componentDatatype:Y.UNSIGNED_BYTE,componentsPerAttribute:1,values:c})}return new St({attributes:o.attributes,indices:o.indices,primitiveType:Oe.LINES,boundingSphere:o.boundingSphere,offsetAttribute:e._offsetAttribute})};var Lf=oS;var q_e=new z,Y_e=h.ZERO,X_e=new h,K_e=new ie;function PXe(e){this.id=e,this.vertexFormat=void 0,this.center=void 0,this.semiMajorAxis=void 0,this.semiMinorAxis=void 0,this.rotation=void 0,this.height=void 0,this.extrudedHeight=void 0,this.granularity=void 0,this.stRotation=void 0,this.numberOfVerticalLines=void 0,this.offsetAttribute=void 0}function fm(e,t){ii.call(this,{entity:e,scene:t,geometryOptions:new PXe(e),geometryPropertyName:"ellipse",observedPropertyNames:["availability","position","ellipse"]}),this._onEntityPropertyChanged(e,"ellipse",e.ellipse,void 0)}l(Object.create)&&(fm.prototype=Object.create(ii.prototype),fm.prototype.constructor=fm);fm.prototype.createFillGeometryInstance=function(e){let t=this._entity,n=t.isAvailable(e),i={show:new Dn(n&&t.isShowing&&this._showProperty.getValue(e)&&this._fillProperty.getValue(e)),distanceDisplayCondition:ti.fromDistanceDisplayCondition(this._distanceDisplayConditionProperty.getValue(e)),offset:void 0,color:void 0};if(this._materialProperty instanceof Kt){let r;l(this._materialProperty.color)&&(this._materialProperty.color.isConstant||n)&&(r=this._materialProperty.color.getValue(e,q_e)),l(r)||(r=z.WHITE),i.color=Jt.fromColor(r)}return l(this._options.offsetAttribute)&&(i.offset=Tr.fromCartesian3(X.getValueOrDefault(this._terrainOffsetProperty,e,Y_e,X_e))),new Ft({id:t,geometry:new nu(this._options),attributes:i})};fm.prototype.createOutlineGeometryInstance=function(e){let t=this._entity,n=t.isAvailable(e),i=X.getValueOrDefault(this._outlineColorProperty,e,z.BLACK,q_e),r=this._distanceDisplayConditionProperty.getValue(e),o={show:new Dn(n&&t.isShowing&&this._showProperty.getValue(e)&&this._showOutlineProperty.getValue(e)),color:Jt.fromColor(i),distanceDisplayCondition:ti.fromDistanceDisplayCondition(r),offset:void 0};return l(this._options.offsetAttribute)&&(o.offset=Tr.fromCartesian3(X.getValueOrDefault(this._terrainOffsetProperty,e,Y_e,X_e))),new Ft({id:t,geometry:new Lf(this._options),attributes:o})};fm.prototype._computeCenter=function(e,t){return X.getValueOrUndefined(this._entity.position,e,t)};fm.prototype._isHidden=function(e,t){let n=e.position;return!l(n)||!l(t.semiMajorAxis)||!l(t.semiMinorAxis)||Pi.prototype._isHidden.call(this,e,t)};fm.prototype._isDynamic=function(e,t){return!e.position.isConstant||!t.semiMajorAxis.isConstant||!t.semiMinorAxis.isConstant||!X.isConstant(t.rotation)||!X.isConstant(t.height)||!X.isConstant(t.extrudedHeight)||!X.isConstant(t.granularity)||!X.isConstant(t.stRotation)||!X.isConstant(t.outlineWidth)||!X.isConstant(t.numberOfVerticalLines)||!X.isConstant(t.zIndex)||this._onTerrain&&!X.isConstant(this._materialProperty)&&!(this._materialProperty instanceof Kt)};fm.prototype._setStaticOptions=function(e,t){let n=X.getValueOrUndefined(t.height,nt.MINIMUM_VALUE),i=X.getValueOrDefault(t.heightReference,nt.MINIMUM_VALUE,We.NONE),r=X.getValueOrUndefined(t.extrudedHeight,nt.MINIMUM_VALUE),o=X.getValueOrDefault(t.extrudedHeightReference,nt.MINIMUM_VALUE,We.NONE);l(r)&&!l(n)&&(n=0);let s=this._options;s.vertexFormat=this._materialProperty instanceof Kt?yn.VERTEX_FORMAT:Er.MaterialSupport.TEXTURED.vertexFormat,s.center=e.position.getValue(nt.MINIMUM_VALUE,s.center),s.semiMajorAxis=t.semiMajorAxis.getValue(nt.MINIMUM_VALUE,s.semiMajorAxis),s.semiMinorAxis=t.semiMinorAxis.getValue(nt.MINIMUM_VALUE,s.semiMinorAxis),s.rotation=X.getValueOrUndefined(t.rotation,nt.MINIMUM_VALUE),s.granularity=X.getValueOrUndefined(t.granularity,nt.MINIMUM_VALUE),s.stRotation=X.getValueOrUndefined(t.stRotation,nt.MINIMUM_VALUE),s.numberOfVerticalLines=X.getValueOrUndefined(t.numberOfVerticalLines,nt.MINIMUM_VALUE),s.offsetAttribute=ii.computeGeometryOffsetAttribute(n,i,r,o),s.height=ii.getGeometryHeight(n,i),r=ii.getGeometryExtrudedHeight(r,o),r===ii.CLAMP_TO_GROUND&&(r=Mi.getMinimumMaximumHeights(nu.computeRectangle(s,K_e)).minimumTerrainHeight),s.extrudedHeight=r};fm.DynamicGeometryUpdater=sS;function sS(e,t,n){Ii.call(this,e,t,n)}l(Object.create)&&(sS.prototype=Object.create(Ii.prototype),sS.prototype.constructor=sS);sS.prototype._isHidden=function(e,t,n){let i=this._options;return!l(i.center)||!l(i.semiMajorAxis)||!l(i.semiMinorAxis)||Ii.prototype._isHidden.call(this,e,t,n)};sS.prototype._setOptions=function(e,t,n){let i=this._options,r=X.getValueOrUndefined(t.height,n),o=X.getValueOrDefault(t.heightReference,n,We.NONE),s=X.getValueOrUndefined(t.extrudedHeight,n),a=X.getValueOrDefault(t.extrudedHeightReference,n,We.NONE);l(s)&&!l(r)&&(r=0),i.center=X.getValueOrUndefined(e.position,n,i.center),i.semiMajorAxis=X.getValueOrUndefined(t.semiMajorAxis,n),i.semiMinorAxis=X.getValueOrUndefined(t.semiMinorAxis,n),i.rotation=X.getValueOrUndefined(t.rotation,n),i.granularity=X.getValueOrUndefined(t.granularity,n),i.stRotation=X.getValueOrUndefined(t.stRotation,n),i.numberOfVerticalLines=X.getValueOrUndefined(t.numberOfVerticalLines,n),i.offsetAttribute=ii.computeGeometryOffsetAttribute(r,o,s,a),i.height=ii.getGeometryHeight(r,o),s=ii.getGeometryExtrudedHeight(s,a),s===ii.CLAMP_TO_GROUND&&(s=Mi.getMinimumMaximumHeights(nu.computeRectangle(i,K_e)).minimumTerrainHeight),i.extrudedHeight=s};var hL=fm;var DXe=new h,RXe=new h,OXe=new h,MXe=new h,NXe=new h,LXe=new h(1,1,1),$_e=Math.cos,J_e=Math.sin;function Ug(e){e=e??H.EMPTY_OBJECT;let t=e.radii??LXe,n=e.innerRadii??t,i=e.minimumClock??0,r=e.maximumClock??D.TWO_PI,o=e.minimumCone??0,s=e.maximumCone??D.PI,a=Math.round(e.stackPartitions??64),c=Math.round(e.slicePartitions??64),u=e.vertexFormat??Be.DEFAULT;this._radii=h.clone(t),this._innerRadii=h.clone(n),this._minimumClock=i,this._maximumClock=r,this._minimumCone=o,this._maximumCone=s,this._stackPartitions=a,this._slicePartitions=c,this._vertexFormat=Be.clone(u),this._offsetAttribute=e.offsetAttribute,this._workerName="createEllipsoidGeometry"}Ug.packedLength=2*h.packedLength+Be.packedLength+7;Ug.pack=function(e,t,n){return n=n??0,h.pack(e._radii,t,n),n+=h.packedLength,h.pack(e._innerRadii,t,n),n+=h.packedLength,Be.pack(e._vertexFormat,t,n),n+=Be.packedLength,t[n++]=e._minimumClock,t[n++]=e._maximumClock,t[n++]=e._minimumCone,t[n++]=e._maximumCone,t[n++]=e._stackPartitions,t[n++]=e._slicePartitions,t[n]=e._offsetAttribute??-1,t};var Z_e=new h,Q_e=new h,eye=new Be,iA={radii:Z_e,innerRadii:Q_e,vertexFormat:eye,minimumClock:void 0,maximumClock:void 0,minimumCone:void 0,maximumCone:void 0,stackPartitions:void 0,slicePartitions:void 0,offsetAttribute:void 0};Ug.unpack=function(e,t,n){t=t??0;let i=h.unpack(e,t,Z_e);t+=h.packedLength;let r=h.unpack(e,t,Q_e);t+=h.packedLength;let o=Be.unpack(e,t,eye);t+=Be.packedLength;let s=e[t++],a=e[t++],c=e[t++],u=e[t++],f=e[t++],d=e[t++],p=e[t];return l(n)?(n._radii=h.clone(i,n._radii),n._innerRadii=h.clone(r,n._innerRadii),n._vertexFormat=Be.clone(o,n._vertexFormat),n._minimumClock=s,n._maximumClock=a,n._minimumCone=c,n._maximumCone=u,n._stackPartitions=f,n._slicePartitions=d,n._offsetAttribute=p===-1?void 0:p,n):(iA.minimumClock=s,iA.maximumClock=a,iA.minimumCone=c,iA.maximumCone=u,iA.stackPartitions=f,iA.slicePartitions=d,iA.offsetAttribute=p===-1?void 0:p,new Ug(iA))};Ug.createGeometry=function(e){let t=e._radii;if(t.x<=0||t.y<=0||t.z<=0)return;let n=e._innerRadii;if(n.x<=0||n.y<=0||n.z<=0)return;let i=e._minimumClock,r=e._maximumClock,o=e._minimumCone,s=e._maximumCone,a=e._vertexFormat,c=e._slicePartitions+1,u=e._stackPartitions+1;c=Math.round(c*Math.abs(r-i)/D.TWO_PI),u=Math.round(u*Math.abs(s-o)/D.PI),c<2&&(c=2),u<2&&(u=2);let f,d,p=0,g=[o],m=[i];for(f=0;f<u;f++)g.push(o+f*(s-o)/(u-1));for(g.push(s),d=0;d<c;d++)m.push(i+d*(r-i)/(c-1));m.push(r);let y=g.length,A=m.length,b=0,x=1,T=n.x!==t.x||n.y!==t.y||n.z!==t.z,E=!1,v=!1,S=!1;T&&(x=2,o>0&&(E=!0,b+=c-1),s<Math.PI&&(v=!0,b+=c-1),(r-i)%D.TWO_PI?(S=!0,b+=(u-1)*2+1):b+=1);let I=A*y*x,R=new Float64Array(I*3),O=new Array(I).fill(!1),L=new Array(I).fill(!1),_=c*u*x,C=6*(_+b+1-(c+u)*x),w=je.createTypedArray(_,C),P=a.normal?new Float32Array(I*3):void 0,M=a.tangent?new Float32Array(I*3):void 0,F=a.bitangent?new Float32Array(I*3):void 0,V=a.st?new Float32Array(I*2):void 0,B=new Array(y),j=new Array(y);for(f=0;f<y;f++)B[f]=J_e(g[f]),j[f]=$_e(g[f]);let k=new Array(A),G=new Array(A);for(d=0;d<A;d++)G[d]=$_e(m[d]),k[d]=J_e(m[d]);for(f=0;f<y;f++)for(d=0;d<A;d++)R[p++]=t.x*B[f]*G[d],R[p++]=t.y*B[f]*k[d],R[p++]=t.z*j[f];let q=I/2;if(T)for(f=0;f<y;f++)for(d=0;d<A;d++)R[p++]=n.x*B[f]*G[d],R[p++]=n.y*B[f]*k[d],R[p++]=n.z*j[f],O[q]=!0,f>0&&f!==y-1&&d!==0&&d!==A-1&&(L[q]=!0),q++;p=0;let Q,W;for(f=1;f<y-2;f++)for(Q=f*A,W=(f+1)*A,d=1;d<A-2;d++)w[p++]=W+d,w[p++]=W+d+1,w[p++]=Q+d+1,w[p++]=W+d,w[p++]=Q+d+1,w[p++]=Q+d;if(T){let He=y*A;for(f=1;f<y-2;f++)for(Q=He+f*A,W=He+(f+1)*A,d=1;d<A-2;d++)w[p++]=W+d,w[p++]=Q+d,w[p++]=Q+d+1,w[p++]=W+d,w[p++]=Q+d+1,w[p++]=W+d+1}let J,Z;if(T){if(E)for(Z=y*A,f=1;f<A-2;f++)w[p++]=f,w[p++]=f+1,w[p++]=Z+f+1,w[p++]=f,w[p++]=Z+f+1,w[p++]=Z+f;if(v)for(J=y*A-A,Z=y*A*x-A,f=1;f<A-2;f++)w[p++]=J+f+1,w[p++]=J+f,w[p++]=Z+f,w[p++]=J+f+1,w[p++]=Z+f,w[p++]=Z+f+1}if(S){for(f=1;f<y-2;f++)Z=A*y+A*f,J=A*f,w[p++]=Z,w[p++]=J+A,w[p++]=J,w[p++]=Z,w[p++]=Z+A,w[p++]=J+A;for(f=1;f<y-2;f++)Z=A*y+A*(f+1)-1,J=A*(f+1)-1,w[p++]=J+A,w[p++]=Z,w[p++]=J,w[p++]=J+A,w[p++]=Z+A,w[p++]=Z}let ae=new Tn;a.position&&(ae.position=new Ne({componentDatatype:Y.DOUBLE,componentsPerAttribute:3,values:R}));let Ae=0,fe=0,xe=0,ge=0,we=I/2,Se,Re=ee.fromCartesian3(t),Qe=ee.fromCartesian3(n);if(a.st||a.normal||a.tangent||a.bitangent){for(f=0;f<I;f++){Se=O[f]?Qe:Re;let He=h.fromArray(R,f*3,DXe),Xe=Se.geodeticSurfaceNormal(He,RXe);if(L[f]&&h.negate(Xe,Xe),a.st){let $e=U.negate(Xe,NXe);V[Ae++]=Math.atan2($e.y,$e.x)/D.TWO_PI+.5,V[Ae++]=Math.asin(Xe.z)/Math.PI+.5}if(a.normal&&(P[fe++]=Xe.x,P[fe++]=Xe.y,P[fe++]=Xe.z),a.tangent||a.bitangent){let $e=OXe,Pe=0,qe;if(O[f]&&(Pe=we),!E&&f>=Pe&&f<Pe+A*2?qe=h.UNIT_X:qe=h.UNIT_Z,h.cross(qe,Xe,$e),h.normalize($e,$e),a.tangent&&(M[xe++]=$e.x,M[xe++]=$e.y,M[xe++]=$e.z),a.bitangent){let st=h.cross(Xe,$e,MXe);h.normalize(st,st),F[ge++]=st.x,F[ge++]=st.y,F[ge++]=st.z}}}a.st&&(ae.st=new Ne({componentDatatype:Y.FLOAT,componentsPerAttribute:2,values:V})),a.normal&&(ae.normal=new Ne({componentDatatype:Y.FLOAT,componentsPerAttribute:3,values:P})),a.tangent&&(ae.tangent=new Ne({componentDatatype:Y.FLOAT,componentsPerAttribute:3,values:M})),a.bitangent&&(ae.bitangent=new Ne({componentDatatype:Y.FLOAT,componentsPerAttribute:3,values:F}))}if(l(e._offsetAttribute)){let He=R.length,Xe=e._offsetAttribute===mn.NONE?0:1,$e=new Uint8Array(He/3).fill(Xe);ae.applyOffset=new Ne({componentDatatype:Y.UNSIGNED_BYTE,componentsPerAttribute:1,values:$e})}return new St({attributes:ae,indices:w,primitiveType:Oe.TRIANGLES,boundingSphere:ue.fromEllipsoid(Re),offsetAttribute:e._offsetAttribute})};var T$;Ug.getUnitEllipsoid=function(){return l(T$)||(T$=Ug.createGeometry(new Ug({radii:new h(1,1,1),vertexFormat:Be.POSITION_ONLY}))),T$};var za=Ug;var FXe=new h(1,1,1),tH=Math.cos,nH=Math.sin;function aS(e){e=e??H.EMPTY_OBJECT;let t=e.radii??FXe,n=e.innerRadii??t,i=e.minimumClock??0,r=e.maximumClock??D.TWO_PI,o=e.minimumCone??0,s=e.maximumCone??D.PI,a=Math.round(e.stackPartitions??10),c=Math.round(e.slicePartitions??8),u=Math.round(e.subdivisions??128);this._radii=h.clone(t),this._innerRadii=h.clone(n),this._minimumClock=i,this._maximumClock=r,this._minimumCone=o,this._maximumCone=s,this._stackPartitions=a,this._slicePartitions=c,this._subdivisions=u,this._offsetAttribute=e.offsetAttribute,this._workerName="createEllipsoidOutlineGeometry"}aS.packedLength=2*h.packedLength+8;aS.pack=function(e,t,n){return n=n??0,h.pack(e._radii,t,n),n+=h.packedLength,h.pack(e._innerRadii,t,n),n+=h.packedLength,t[n++]=e._minimumClock,t[n++]=e._maximumClock,t[n++]=e._minimumCone,t[n++]=e._maximumCone,t[n++]=e._stackPartitions,t[n++]=e._slicePartitions,t[n++]=e._subdivisions,t[n]=e._offsetAttribute??-1,t};var tye=new h,nye=new h,zg={radii:tye,innerRadii:nye,minimumClock:void 0,maximumClock:void 0,minimumCone:void 0,maximumCone:void 0,stackPartitions:void 0,slicePartitions:void 0,subdivisions:void 0,offsetAttribute:void 0};aS.unpack=function(e,t,n){t=t??0;let i=h.unpack(e,t,tye);t+=h.packedLength;let r=h.unpack(e,t,nye);t+=h.packedLength;let o=e[t++],s=e[t++],a=e[t++],c=e[t++],u=e[t++],f=e[t++],d=e[t++],p=e[t];return l(n)?(n._radii=h.clone(i,n._radii),n._innerRadii=h.clone(r,n._innerRadii),n._minimumClock=o,n._maximumClock=s,n._minimumCone=a,n._maximumCone=c,n._stackPartitions=u,n._slicePartitions=f,n._subdivisions=d,n._offsetAttribute=p===-1?void 0:p,n):(zg.minimumClock=o,zg.maximumClock=s,zg.minimumCone=a,zg.maximumCone=c,zg.stackPartitions=u,zg.slicePartitions=f,zg.subdivisions=d,zg.offsetAttribute=p===-1?void 0:p,new aS(zg))};aS.createGeometry=function(e){let t=e._radii;if(t.x<=0||t.y<=0||t.z<=0)return;let n=e._innerRadii;if(n.x<=0||n.y<=0||n.z<=0)return;let i=e._minimumClock,r=e._maximumClock,o=e._minimumCone,s=e._maximumCone,a=e._subdivisions,c=ee.fromCartesian3(t),u=e._slicePartitions+1,f=e._stackPartitions+1;u=Math.round(u*Math.abs(r-i)/D.TWO_PI),f=Math.round(f*Math.abs(s-o)/D.PI),u<2&&(u=2),f<2&&(f=2);let d=0,p=1,g=n.x!==t.x||n.y!==t.y||n.z!==t.z,m=!1,y=!1;g&&(p=2,o>0&&(m=!0,d+=u),s<Math.PI&&(y=!0,d+=u));let A=a*p*(f+u),b=new Float64Array(A*3),x=2*(A+d-(u+f)*p),T=je.createTypedArray(A,x),E,v,S,I,R=0,O=new Array(f),L=new Array(f);for(E=0;E<f;E++)I=o+E*(s-o)/(f-1),O[E]=nH(I),L[E]=tH(I);let _=new Array(a),C=new Array(a);for(E=0;E<a;E++)S=i+E*(r-i)/(a-1),_[E]=nH(S),C[E]=tH(S);for(E=0;E<f;E++)for(v=0;v<a;v++)b[R++]=t.x*O[E]*C[v],b[R++]=t.y*O[E]*_[v],b[R++]=t.z*L[E];if(g)for(E=0;E<f;E++)for(v=0;v<a;v++)b[R++]=n.x*O[E]*C[v],b[R++]=n.y*O[E]*_[v],b[R++]=n.z*L[E];for(O.length=a,L.length=a,E=0;E<a;E++)I=o+E*(s-o)/(a-1),O[E]=nH(I),L[E]=tH(I);for(_.length=u,C.length=u,E=0;E<u;E++)S=i+E*(r-i)/(u-1),_[E]=nH(S),C[E]=tH(S);for(E=0;E<a;E++)for(v=0;v<u;v++)b[R++]=t.x*O[E]*C[v],b[R++]=t.y*O[E]*_[v],b[R++]=t.z*L[E];if(g)for(E=0;E<a;E++)for(v=0;v<u;v++)b[R++]=n.x*O[E]*C[v],b[R++]=n.y*O[E]*_[v],b[R++]=n.z*L[E];for(R=0,E=0;E<f*p;E++){let M=E*a;for(v=0;v<a-1;v++)T[R++]=M+v,T[R++]=M+v+1}let w=f*a*p;for(E=0;E<u;E++)for(v=0;v<a-1;v++)T[R++]=w+E+v*u,T[R++]=w+E+(v+1)*u;if(g)for(w=f*a*p+u*a,E=0;E<u;E++)for(v=0;v<a-1;v++)T[R++]=w+E+v*u,T[R++]=w+E+(v+1)*u;if(g){let M=f*a*p,F=M+a*u;if(m)for(E=0;E<u;E++)T[R++]=M+E,T[R++]=F+E;if(y)for(M+=a*u-u,F+=a*u-u,E=0;E<u;E++)T[R++]=M+E,T[R++]=F+E}let P=new Tn({position:new Ne({componentDatatype:Y.DOUBLE,componentsPerAttribute:3,values:b})});if(l(e._offsetAttribute)){let M=b.length,F=e._offsetAttribute===mn.NONE?0:1,V=new Uint8Array(M/3).fill(F);P.applyOffset=new Ne({componentDatatype:Y.UNSIGNED_BYTE,componentsPerAttribute:1,values:V})}return new St({attributes:P,indices:T,primitiveType:Oe.LINES,boundingSphere:ue.fromEllipsoid(c),offsetAttribute:e._offsetAttribute})};var Ff=aS;var BXe=new Kt(z.WHITE),E$=h.ZERO,C$=new h,kXe=new h,UXe=new h,v$=new z,zXe=new h(1,1,1);function VXe(e){this.id=e,this.vertexFormat=void 0,this.radii=void 0,this.innerRadii=void 0,this.minimumClock=void 0,this.maximumClock=void 0,this.minimumCone=void 0,this.maximumCone=void 0,this.stackPartitions=void 0,this.slicePartitions=void 0,this.subdivisions=void 0,this.offsetAttribute=void 0}function Bf(e,t){Pi.call(this,{entity:e,scene:t,geometryOptions:new VXe(e),geometryPropertyName:"ellipsoid",observedPropertyNames:["availability","position","orientation","ellipsoid"]}),this._onEntityPropertyChanged(e,"ellipsoid",e.ellipsoid,void 0)}l(Object.create)&&(Bf.prototype=Object.create(Pi.prototype),Bf.prototype.constructor=Bf);Object.defineProperties(Bf.prototype,{terrainOffsetProperty:{get:function(){return this._terrainOffsetProperty}}});Bf.prototype.createFillGeometryInstance=function(e,t,n){let i=this._entity,r=i.isAvailable(e),o,s=new Dn(r&&i.isShowing&&this._showProperty.getValue(e)&&this._fillProperty.getValue(e)),a=this._distanceDisplayConditionProperty.getValue(e),c=ti.fromDistanceDisplayCondition(a),u={show:s,distanceDisplayCondition:c,color:void 0,offset:void 0};if(this._materialProperty instanceof Kt){let f;l(this._materialProperty.color)&&(this._materialProperty.color.isConstant||r)&&(f=this._materialProperty.color.getValue(e,v$)),l(f)||(f=z.WHITE),o=Jt.fromColor(f),u.color=o}return l(this._options.offsetAttribute)&&(u.offset=Tr.fromCartesian3(X.getValueOrDefault(this._terrainOffsetProperty,e,E$,C$))),new Ft({id:i,geometry:new za(this._options),modelMatrix:t?void 0:i.computeModelMatrixForHeightReference(e,i.ellipsoid.heightReference,this._options.radii.z*.5,this._scene.ellipsoid,n),attributes:u})};Bf.prototype.createOutlineGeometryInstance=function(e,t,n){let i=this._entity,r=i.isAvailable(e),o=X.getValueOrDefault(this._outlineColorProperty,e,z.BLACK,v$),s=this._distanceDisplayConditionProperty.getValue(e),a={show:new Dn(r&&i.isShowing&&this._showProperty.getValue(e)&&this._showOutlineProperty.getValue(e)),color:Jt.fromColor(o),distanceDisplayCondition:ti.fromDistanceDisplayCondition(s),offset:void 0};return l(this._options.offsetAttribute)&&(a.offset=Tr.fromCartesian3(X.getValueOrDefault(this._terrainOffsetProperty,e,E$,C$))),new Ft({id:i,geometry:new Ff(this._options),modelMatrix:t?void 0:i.computeModelMatrixForHeightReference(e,i.ellipsoid.heightReference,this._options.radii.z*.5,this._scene.ellipsoid,n),attributes:a})};Bf.prototype._computeCenter=function(e,t){return X.getValueOrUndefined(this._entity.position,e,t)};Bf.prototype._isHidden=function(e,t){return!l(e.position)||!l(t.radii)||Pi.prototype._isHidden.call(this,e,t)};Bf.prototype._isDynamic=function(e,t){return!e.position.isConstant||!X.isConstant(e.orientation)||!t.radii.isConstant||!X.isConstant(t.innerRadii)||!X.isConstant(t.stackPartitions)||!X.isConstant(t.slicePartitions)||!X.isConstant(t.outlineWidth)||!X.isConstant(t.minimumClock)||!X.isConstant(t.maximumClock)||!X.isConstant(t.minimumCone)||!X.isConstant(t.maximumCone)||!X.isConstant(t.subdivisions)};Bf.prototype._setStaticOptions=function(e,t){let n=X.getValueOrDefault(t.heightReference,nt.MINIMUM_VALUE,We.NONE),i=this._options;i.vertexFormat=this._materialProperty instanceof Kt?yn.VERTEX_FORMAT:Er.MaterialSupport.TEXTURED.vertexFormat,i.radii=t.radii.getValue(nt.MINIMUM_VALUE,i.radii),i.innerRadii=X.getValueOrUndefined(t.innerRadii,i.radii),i.minimumClock=X.getValueOrUndefined(t.minimumClock,nt.MINIMUM_VALUE),i.maximumClock=X.getValueOrUndefined(t.maximumClock,nt.MINIMUM_VALUE),i.minimumCone=X.getValueOrUndefined(t.minimumCone,nt.MINIMUM_VALUE),i.maximumCone=X.getValueOrUndefined(t.maximumCone,nt.MINIMUM_VALUE),i.stackPartitions=X.getValueOrUndefined(t.stackPartitions,nt.MINIMUM_VALUE),i.slicePartitions=X.getValueOrUndefined(t.slicePartitions,nt.MINIMUM_VALUE),i.subdivisions=X.getValueOrUndefined(t.subdivisions,nt.MINIMUM_VALUE),i.offsetAttribute=n!==We.NONE?mn.ALL:void 0};Bf.prototype._onEntityPropertyChanged=Og;Bf.DynamicGeometryUpdater=mL;function mL(e,t,n){Ii.call(this,e,t,n),this._scene=e._scene,this._modelMatrix=new N,this._attributes=void 0,this._outlineAttributes=void 0,this._lastSceneMode=void 0,this._lastShow=void 0,this._lastOutlineShow=void 0,this._lastOutlineWidth=void 0,this._lastOutlineColor=void 0,this._lastOffset=new h,this._material={}}l(Object.create)&&(mL.prototype=Object.create(Ii.prototype),mL.prototype.constructor=mL);mL.prototype.update=function(e){let t=this._entity,n=t.ellipsoid;if(!t.isShowing||!t.isAvailable(e)||!X.getValueOrDefault(n.show,e,!0)){l(this._primitive)&&(this._primitive.show=!1),l(this._outlinePrimitive)&&(this._outlinePrimitive.show=!1);return}let i=X.getValueOrUndefined(n.radii,e,kXe),r=l(i)?t.computeModelMatrixForHeightReference(e,n.heightReference,i.z*.5,this._scene.ellipsoid,this._modelMatrix):void 0;if(!l(r)||!l(i)){l(this._primitive)&&(this._primitive.show=!1),l(this._outlinePrimitive)&&(this._outlinePrimitive.show=!1);return}let o=X.getValueOrDefault(n.fill,e,!0),s=X.getValueOrDefault(n.outline,e,!1),a=X.getValueOrClonedDefault(n.outlineColor,e,z.BLACK,v$),c=yo.getValue(e,n.material??BXe,this._material),u=X.getValueOrUndefined(n.innerRadii,e,UXe),f=X.getValueOrUndefined(n.minimumClock,e),d=X.getValueOrUndefined(n.maximumClock,e),p=X.getValueOrUndefined(n.minimumCone,e),g=X.getValueOrUndefined(n.maximumCone,e),m=X.getValueOrUndefined(n.stackPartitions,e),y=X.getValueOrUndefined(n.slicePartitions,e),A=X.getValueOrUndefined(n.subdivisions,e),b=X.getValueOrDefault(n.outlineWidth,e,1),x=X.getValueOrDefault(n.heightReference,e,We.NONE),T=x!==We.NONE?mn.ALL:void 0,E=this._scene.mode,v=E===re.SCENE3D&&x===We.NONE,S=this._options,I=this._geometryUpdater.shadowsProperty.getValue(e),O=this._geometryUpdater.distanceDisplayConditionProperty.getValue(e),L=X.getValueOrDefault(this._geometryUpdater.terrainOffsetProperty,e,E$,C$);if(!v||this._lastSceneMode!==E||!l(this._primitive)||S.stackPartitions!==m||S.slicePartitions!==y||l(u)&&!h.equals(S.innerRadii!==u)||S.minimumClock!==f||S.maximumClock!==d||S.minimumCone!==p||S.maximumCone!==g||S.subdivisions!==A||this._lastOutlineWidth!==b||S.offsetAttribute!==T){let C=this._primitives;C.removeAndDestroy(this._primitive),C.removeAndDestroy(this._outlinePrimitive),this._primitive=void 0,this._outlinePrimitive=void 0,this._lastSceneMode=E,this._lastOutlineWidth=b,S.stackPartitions=m,S.slicePartitions=y,S.subdivisions=A,S.offsetAttribute=T,S.radii=h.clone(v?zXe:i,S.radii),l(u)?v?S.innerRadii=h.fromElements(u.x/i.x,u.y/i.y,u.z/i.z,S.innerRadii):S.innerRadii=h.clone(u,S.innerRadii):S.innerRadii=void 0,S.minimumClock=f,S.maximumClock=d,S.minimumCone=p,S.maximumCone=g;let w=new Er({material:c,translucent:c.isTranslucent(),closed:!0});S.vertexFormat=w.vertexFormat;let P=this._geometryUpdater.createFillGeometryInstance(e,v,this._modelMatrix);this._primitive=C.add(new On({geometryInstances:P,appearance:w,asynchronous:!1,shadows:I}));let M=this._geometryUpdater.createOutlineGeometryInstance(e,v,this._modelMatrix);this._outlinePrimitive=C.add(new On({geometryInstances:M,appearance:new yn({flat:!0,translucent:M.attributes.color.value[3]!==255,renderState:{lineWidth:this._geometryUpdater._scene.clampLineWidth(b)}}),asynchronous:!1,shadows:I})),this._lastShow=o,this._lastOutlineShow=s,this._lastOutlineColor=z.clone(a,this._lastOutlineColor),this._lastDistanceDisplayCondition=O,this._lastOffset=h.clone(L,this._lastOffset)}else if(this._primitive.ready){let C=this._primitive,w=this._outlinePrimitive;C.show=!0,w.show=!0,C.appearance.material=c;let P=this._attributes;l(P)||(P=C.getGeometryInstanceAttributes(t),this._attributes=P),o!==this._lastShow&&(P.show=Dn.toValue(o,P.show),this._lastShow=o);let M=this._outlineAttributes;l(M)||(M=w.getGeometryInstanceAttributes(t),this._outlineAttributes=M),s!==this._lastOutlineShow&&(M.show=Dn.toValue(s,M.show),this._lastOutlineShow=s),z.equals(a,this._lastOutlineColor)||(M.color=Jt.toValue(a,M.color),z.clone(a,this._lastOutlineColor)),Ht.equals(O,this._lastDistanceDisplayCondition)||(P.distanceDisplayCondition=ti.toValue(O,P.distanceDisplayCondition),M.distanceDisplayCondition=ti.toValue(O,M.distanceDisplayCondition),Ht.clone(O,this._lastDistanceDisplayCondition)),h.equals(L,this._lastOffset)||(P.offset=Tr.toValue(L,P.offset),M.offset=Tr.toValue(L,P.offset),h.clone(L,this._lastOffset))}v&&(i.x=Math.max(i.x,.001),i.y=Math.max(i.y,.001),i.z=Math.max(i.z,.001),r=N.multiplyByScale(r,i,r),this._primitive.modelMatrix=r,this._outlinePrimitive.modelMatrix=r)};var pL=Bf;function cS(e){e=e??H.EMPTY_OBJECT;let t=e.vertexFormat??Be.DEFAULT;this._vertexFormat=t,this._workerName="createPlaneGeometry"}cS.packedLength=Be.packedLength;cS.pack=function(e,t,n){return n=n??0,Be.pack(e._vertexFormat,t,n),t};var iye=new Be,jXe={vertexFormat:iye};cS.unpack=function(e,t,n){t=t??0;let i=Be.unpack(e,t,iye);return l(n)?(n._vertexFormat=Be.clone(i,n._vertexFormat),n):new cS(jXe)};var iH=new h(-.5,-.5,0),rH=new h(.5,.5,0);cS.createGeometry=function(e){let t=e._vertexFormat,n=new Tn,i,r;if(t.position){if(r=new Float64Array(12),r[0]=iH.x,r[1]=iH.y,r[2]=0,r[3]=rH.x,r[4]=iH.y,r[5]=0,r[6]=rH.x,r[7]=rH.y,r[8]=0,r[9]=iH.x,r[10]=rH.y,r[11]=0,n.position=new Ne({componentDatatype:Y.DOUBLE,componentsPerAttribute:3,values:r}),t.normal){let o=new Float32Array(12);o[0]=0,o[1]=0,o[2]=1,o[3]=0,o[4]=0,o[5]=1,o[6]=0,o[7]=0,o[8]=1,o[9]=0,o[10]=0,o[11]=1,n.normal=new Ne({componentDatatype:Y.FLOAT,componentsPerAttribute:3,values:o})}if(t.st){let o=new Float32Array(8);o[0]=0,o[1]=0,o[2]=1,o[3]=0,o[4]=1,o[5]=1,o[6]=0,o[7]=1,n.st=new Ne({componentDatatype:Y.FLOAT,componentsPerAttribute:2,values:o})}if(t.tangent){let o=new Float32Array(12);o[0]=1,o[1]=0,o[2]=0,o[3]=1,o[4]=0,o[5]=0,o[6]=1,o[7]=0,o[8]=0,o[9]=1,o[10]=0,o[11]=0,n.tangent=new Ne({componentDatatype:Y.FLOAT,componentsPerAttribute:3,values:o})}if(t.bitangent){let o=new Float32Array(12);o[0]=0,o[1]=1,o[2]=0,o[3]=0,o[4]=1,o[5]=0,o[6]=0,o[7]=1,o[8]=0,o[9]=0,o[10]=1,o[11]=0,n.bitangent=new Ne({componentDatatype:Y.FLOAT,componentsPerAttribute:3,values:o})}i=new Uint16Array(6),i[0]=0,i[1]=1,i[2]=2,i[3]=0,i[4]=2,i[5]=3}return new St({attributes:n,indices:i,primitiveType:Oe.TRIANGLES,boundingSphere:new ue(h.ZERO,Math.sqrt(2))})};var gL=cS;function lS(){this._workerName="createPlaneOutlineGeometry"}lS.packedLength=0;lS.pack=function(e,t){return t};lS.unpack=function(e,t,n){return l(n)?n:new lS};var rA=new h(-.5,-.5,0),oH=new h(.5,.5,0);lS.createGeometry=function(){let e=new Tn,t=new Uint16Array(8),n=new Float64Array(12);return n[0]=rA.x,n[1]=rA.y,n[2]=rA.z,n[3]=oH.x,n[4]=rA.y,n[5]=rA.z,n[6]=oH.x,n[7]=oH.y,n[8]=rA.z,n[9]=rA.x,n[10]=oH.y,n[11]=rA.z,e.position=new Ne({componentDatatype:Y.DOUBLE,componentsPerAttribute:3,values:n}),t[0]=0,t[1]=1,t[2]=1,t[3]=2,t[4]=2,t[5]=3,t[6]=3,t[7]=0,new St({attributes:e,indices:t,primitiveType:Oe.LINES,boundingSphere:new ue(h.ZERO,Math.sqrt(2))})};var _L=lS;var HXe=new h,rye=new z;function GXe(e){this.id=e,this.vertexFormat=void 0,this.plane=void 0,this.dimensions=void 0}function Vd(e,t){Pi.call(this,{entity:e,scene:t,geometryOptions:new GXe(e),geometryPropertyName:"plane",observedPropertyNames:["availability","position","orientation","plane"]}),this._onEntityPropertyChanged(e,"plane",e.plane,void 0)}l(Object.create)&&(Vd.prototype=Object.create(Pi.prototype),Vd.prototype.constructor=Vd);Vd.prototype.createFillGeometryInstance=function(e){let t=this._entity,n=t.isAvailable(e),i,r,o=new Dn(n&&t.isShowing&&this._showProperty.getValue(e)&&this._fillProperty.getValue(e)),s=this._distanceDisplayConditionProperty.getValue(e),a=ti.fromDistanceDisplayCondition(s);if(this._materialProperty instanceof Kt){let g;l(this._materialProperty.color)&&(this._materialProperty.color.isConstant||n)&&(g=this._materialProperty.color.getValue(e,rye)),l(g)||(g=z.WHITE),r=Jt.fromColor(g),i={show:o,distanceDisplayCondition:a,color:r}}else i={show:o,distanceDisplayCondition:a};let c=t.plane,u=this._options,f=t.computeModelMatrix(e),d=X.getValueOrDefault(c.plane,e,u.plane),p=X.getValueOrUndefined(c.dimensions,e,u.dimensions);return u.plane=d,u.dimensions=p,f=S$(d,p,f,f),new Ft({id:t,geometry:new gL(this._options),modelMatrix:f,attributes:i})};Vd.prototype.createOutlineGeometryInstance=function(e){let t=this._entity,n=t.isAvailable(e),i=X.getValueOrDefault(this._outlineColorProperty,e,z.BLACK,rye),r=this._distanceDisplayConditionProperty.getValue(e),o=t.plane,s=this._options,a=t.computeModelMatrix(e),c=X.getValueOrDefault(o.plane,e,s.plane),u=X.getValueOrUndefined(o.dimensions,e,s.dimensions);return s.plane=c,s.dimensions=u,a=S$(c,u,a,a),new Ft({id:t,geometry:new _L,modelMatrix:a,attributes:{show:new Dn(n&&t.isShowing&&this._showProperty.getValue(e)&&this._showOutlineProperty.getValue(e)),color:Jt.fromColor(i),distanceDisplayCondition:ti.fromDistanceDisplayCondition(r)}})};Vd.prototype._isHidden=function(e,t){return!l(t.plane)||!l(t.dimensions)||!l(e.position)||Pi.prototype._isHidden.call(this,e,t)};Vd.prototype._getIsClosed=function(e){return!1};Vd.prototype._isDynamic=function(e,t){return!e.position.isConstant||!X.isConstant(e.orientation)||!t.plane.isConstant||!t.dimensions.isConstant||!X.isConstant(t.outlineWidth)};Vd.prototype._setStaticOptions=function(e,t){let n=this._materialProperty instanceof Kt,i=this._options;i.vertexFormat=n?yn.VERTEX_FORMAT:Er.MaterialSupport.TEXTURED.vertexFormat,i.plane=t.plane.getValue(nt.MINIMUM_VALUE,i.plane),i.dimensions=t.dimensions.getValue(nt.MINIMUM_VALUE,i.dimensions)};Vd.DynamicGeometryUpdater=uS;function uS(e,t,n){Ii.call(this,e,t,n)}l(Object.create)&&(uS.prototype=Object.create(Ii.prototype),uS.prototype.constructor=uS);uS.prototype._isHidden=function(e,t,n){let i=this._options,r=X.getValueOrUndefined(e.position,n,HXe);return!l(r)||!l(i.plane)||!l(i.dimensions)||Ii.prototype._isHidden.call(this,e,t,n)};uS.prototype._setOptions=function(e,t,n){let i=this._options;i.plane=X.getValueOrDefault(t.plane,n,i.plane),i.dimensions=X.getValueOrUndefined(t.dimensions,n,i.dimensions)};var WXe=new h,qXe=new h,YXe=new h,XXe=new h,KXe=new $,$Xe=new $,JXe=new N;function S$(e,t,n,i){let r=e.normal,o=e.distance,s=h.multiplyByScalar(r,-o,YXe),a=h.clone(h.UNIT_Z,qXe);D.equalsEpsilon(Math.abs(h.dot(a,r)),1,D.EPSILON8)&&(a=h.clone(h.UNIT_Y,a));let c=h.cross(a,r,WXe);a=h.cross(r,c,a),h.normalize(c,c),h.normalize(a,a);let u=KXe;$.setColumn(u,0,c,u),$.setColumn(u,1,a,u),$.setColumn(u,2,r,u);let f=h.fromElements(t.x,t.y,1,XXe),d=$.multiplyByScale(u,f,$Xe),p=N.fromRotationTranslation(d,s,JXe);return N.multiplyTransformation(n,p,i)}Vd.createPrimitiveMatrix=S$;var yL=Vd;var AL={},ZXe=new h,oye=new h,sye=new h,aye=new h,cye=new en;AL.validOutline=function(e){let n=en.fromPoints(e,cye).halfAxes,i=$.getColumn(n,0,oye),r=$.getColumn(n,1,sye),o=$.getColumn(n,2,aye),s=h.magnitude(i),a=h.magnitude(r),c=h.magnitude(o);return!(s===0&&(a===0||c===0)||a===0&&c===0)};AL.computeProjectTo2DArguments=function(e,t,n,i){let r=en.fromPoints(e,cye),o=r.halfAxes,s=$.getColumn(o,0,oye),a=$.getColumn(o,1,sye),c=$.getColumn(o,2,aye),u=h.magnitude(s),f=h.magnitude(a),d=h.magnitude(c),p=Math.min(u,f,d);if(u===0&&(f===0||d===0)||f===0&&d===0)return!1;let g,m;return(p===f||p===d)&&(g=s),p===u?g=a:p===d&&(m=a),(p===u||p===f)&&(m=c),h.normalize(g,n),h.normalize(m,i),h.clone(r.center,t),!0};function lye(e,t,n,i,r){let o=h.subtract(e,t,ZXe),s=h.dot(n,o),a=h.dot(i,o);return U.fromElements(s,a,r)}AL.createProjectPointsTo2DFunction=function(e,t,n){return function(i){let r=new Array(i.length);for(let o=0;o<i.length;o++)r[o]=lye(i[o],e,t,n);return r}};AL.createProjectPointTo2DFunction=function(e,t,n){return function(i,r){return lye(i,e,t,n,r)}};var Vg=AL;function oA(){this._array=[],this._offset=0,this._length=0}Object.defineProperties(oA.prototype,{length:{get:function(){return this._length}}});oA.prototype.enqueue=function(e){this._array.push(e),this._length++};oA.prototype.dequeue=function(){if(this._length===0)return;let e=this._array,t=this._offset,n=e[t];return e[t]=void 0,t++,t>10&&t*2>e.length&&(this._array=e.slice(t),t=0),this._offset=t,this._length--,n};oA.prototype.peek=function(){if(this._length!==0)return this._array[this._offset]};oA.prototype.contains=function(e){return this._array.indexOf(e)!==-1};oA.prototype.clear=function(){this._array.length=this._offset=this._length=0};oA.prototype.sort=function(e){this._offset>0&&(this._array=this._array.slice(this._offset),this._offset=0),this._array.sort(e)};var sA=oA;var Oo={};Oo.computeHierarchyPackedLength=function(e,t){let n=0,i=[e];for(;i.length>0;){let r=i.pop();if(!l(r))continue;n+=2;let o=r.positions,s=r.holes;if(l(o)&&o.length>0&&(n+=o.length*t.packedLength),l(s)){let a=s.length;for(let c=0;c<a;++c)i.push(s[c])}}return n};Oo.packPolygonHierarchy=function(e,t,n,i){let r=[e];for(;r.length>0;){let o=r.pop();if(!l(o))continue;let s=o.positions,a=o.holes;if(t[n++]=l(s)?s.length:0,t[n++]=l(a)?a.length:0,l(s)){let c=s.length;for(let u=0;u<c;++u,n+=i.packedLength)i.pack(s[u],t,n)}if(l(a)){let c=a.length;for(let u=0;u<c;++u)r.push(a[u])}}return n};Oo.unpackPolygonHierarchy=function(e,t,n){let i=e[t++],r=e[t++],o=new Array(i),s=r>0?new Array(r):void 0;for(let a=0;a<i;++a,t+=n.packedLength)o[a]=n.unpack(e,t);for(let a=0;a<r;++a)s[a]=Oo.unpackPolygonHierarchy(e,t,n),t=s[a].startingIndex,delete s[a].startingIndex;return{positions:o,holes:s,startingIndex:t}};var oT=new U;function dye(e,t,n,i){return U.subtract(t,e,oT),U.multiplyByScalar(oT,n/i,oT),U.add(e,oT,oT),[oT.x,oT.y]}var aA=new h;function QXe(e,t,n,i){return h.subtract(t,e,aA),h.multiplyByScalar(aA,n/i,aA),h.add(e,aA,aA),[aA.x,aA.y,aA.z]}Oo.subdivideLineCount=function(e,t,n){let r=h.distance(e,t)/n,o=Math.max(0,Math.ceil(D.log2(r)));return Math.pow(2,o)};var aH=new he,cH=new he,eKe=new he,tKe=new h,sH=new Dc;Oo.subdivideRhumbLineCount=function(e,t,n,i){let r=e.cartesianToCartographic(t,aH),o=e.cartesianToCartographic(n,cH),a=new Dc(r,o,e).surfaceDistance/i,c=Math.max(0,Math.ceil(D.log2(a)));return Math.pow(2,c)};Oo.subdivideTexcoordLine=function(e,t,n,i,r,o){let s=Oo.subdivideLineCount(n,i,r),a=U.distance(e,t),c=a/s,u=o;u.length=s*2;let f=0;for(let d=0;d<s;d++){let p=dye(e,t,d*c,a);u[f++]=p[0],u[f++]=p[1]}return u};Oo.subdivideLine=function(e,t,n,i){let r=Oo.subdivideLineCount(e,t,n),o=h.distance(e,t),s=o/r;l(i)||(i=[]);let a=i;a.length=r*3;let c=0;for(let u=0;u<r;u++){let f=QXe(e,t,u*s,o);a[c++]=f[0],a[c++]=f[1],a[c++]=f[2]}return a};Oo.subdivideTexcoordRhumbLine=function(e,t,n,i,r,o,s){let a=n.cartesianToCartographic(i,aH),c=n.cartesianToCartographic(r,cH);sH.setEndPoints(a,c);let u=sH.surfaceDistance/o,f=Math.max(0,Math.ceil(D.log2(u))),d=Math.pow(2,f),p=U.distance(e,t),g=p/d,m=s;m.length=d*2;let y=0;for(let A=0;A<d;A++){let b=dye(e,t,A*g,p);m[y++]=b[0],m[y++]=b[1]}return m};Oo.subdivideRhumbLine=function(e,t,n,i,r){let o=e.cartesianToCartographic(t,aH),s=e.cartesianToCartographic(n,cH),a=new Dc(o,s,e);if(l(r)||(r=[]),a.surfaceDistance<=i)return r.length=3,r[0]=t.x,r[1]=t.y,r[2]=t.z,r;let c=a.surfaceDistance/i,u=Math.max(0,Math.ceil(D.log2(c))),f=Math.pow(2,u),d=a.surfaceDistance/f,p=r;p.length=f*3;let g=0;for(let m=0;m<f;m++){let y=a.interpolateUsingSurfaceDistance(m*d,eKe),A=e.cartographicToCartesian(y,tKe);p[g++]=A.x,p[g++]=A.y,p[g++]=A.z}return p};var nKe=new h,iKe=new h,rKe=new h,oKe=new h;Oo.scaleToGeodeticHeightExtruded=function(e,t,n,i,r){i=i??ee.default;let o=nKe,s=iKe,a=rKe,c=oKe;if(l(e)&&l(e.attributes)&&l(e.attributes.position)){let u=e.attributes.position.values,f=u.length/2;for(let d=0;d<f;d+=3)h.fromArray(u,d,a),i.geodeticSurfaceNormal(a,o),c=i.scaleToGeodeticSurface(a,c),s=h.multiplyByScalar(o,n,s),s=h.add(c,s,s),u[d+f]=s.x,u[d+1+f]=s.y,u[d+2+f]=s.z,r&&(c=h.clone(a,c)),s=h.multiplyByScalar(o,t,s),s=h.add(c,s,s),u[d]=s.x,u[d+1]=s.y,u[d+2]=s.z}return e};Oo.polygonOutlinesFromHierarchy=function(e,t,n){let i=[],r=new sA;r.enqueue(e);let o,s,a;for(;r.length!==0;){let c=r.dequeue(),u=c.positions;if(t)for(a=u.length,o=0;o<a;o++)n.scaleToGeodeticSurface(u[o],u[o]);if(u=Fr(u,h.equalsEpsilon,!0),u.length<3)continue;let f=c.holes?c.holes.length:0;for(o=0;o<f;o++){let d=c.holes[o],p=d.positions;if(t)for(a=p.length,s=0;s<a;++s)n.scaleToGeodeticSurface(p[s],p[s]);if(p=Fr(p,h.equalsEpsilon,!0),p.length<3)continue;i.push(p);let g=0;for(l(d.holes)&&(g=d.holes.length),s=0;s<g;s++)r.enqueue(d.holes[s])}i.push(u)}return i};var sKe=new he;function aKe(e,t,n){let i=n.cartesianToCartographic(e,aH),r=n.cartesianToCartographic(t,cH);if(Math.sign(i.latitude)===Math.sign(r.latitude))return;sH.setEndPoints(i,r);let o=sH.findIntersectionWithLatitude(0,sKe);if(!l(o))return;let s=Math.min(i.longitude,r.longitude),a=Math.max(i.longitude,r.longitude);if(Math.abs(a-s)>D.PI){let c=s;s=a,a=c}if(!(o.longitude<s||o.longitude>a))return n.cartographicToCartesian(o)}function cKe(e,t,n,i){if(i===ln.RHUMB)return aKe(e,t,n);let r=_i.lineSegmentPlane(e,t,sn.ORIGIN_XY_PLANE);if(l(r))return n.scaleToGeodeticSurface(r,r)}var lKe=new he;function uKe(e,t,n){let i=[],r,o,s,a,c,u=0;for(;u<e.length;){r=e[u],o=e[(u+1)%e.length],s=D.sign(r.z),a=D.sign(o.z);let f=d=>t.cartesianToCartographic(d,lKe).longitude;if(s===0)i.push({position:u,type:s,visited:!1,next:a,theta:f(r)});else if(a!==0){if(c=cKe(r,o,t,n),++u,!l(c))continue;e.splice(u,0,c),i.push({position:u,type:s,visited:!1,next:a,theta:f(c)})}++u}return i}function hye(e,t,n,i,r,o,s){let a=[],c=o,u=d=>p=>p.position===d,f=[];do{let d=n[c];a.push(d);let p=i.findIndex(u(c)),g=i[p];if(!l(g)){++c;continue}let{visited:m,type:y,next:A}=g;if(g.visited=!0,y===0){if(A===0){let E=i[p-(s?1:-1)];if(E?.position===c+1)E.visited=!0;else{++c;continue}}if(!m&&s&&A>0||o===c&&!s&&A<0){++c;continue}}if(!(s?y>=0:y<=0)){++c;continue}m||f.push(c);let x=p+(s?1:-1),T=i[x];if(!l(T)){++c;continue}c=T.position}while(c<n.length&&c>=0&&c!==o&&a.length<n.length);e.splice(t,r,a);for(let d of f)t=hye(e,t+1,n,i,0,d,!s);return t}Oo.splitPolygonsOnEquator=function(e,t,n,i){l(i)||(i=[]),i.splice(0,0,...e),i.length=e.length;let r=0;for(;r<i.length;){let o=i[r],s=o.slice();if(o.length<3){i[r]=s,++r;continue}let a=uKe(s,t,n);if(s.length===o.length||a.length<=1){i[r]=s,++r;continue}a.sort((u,f)=>u.theta-f.theta);let c=s[0].z>=0;r=hye(i,r,s,a,1,0,c)}return i};Oo.polygonsFromHierarchy=function(e,t,n,i,r,o){let s=[],a=[],c=new sA;c.enqueue(e);let u=l(o);for(;c.length!==0;){let f=c.dequeue(),d=f.positions,p=f.holes,g,m;if(i)for(m=d.length,g=0;g<m;g++)r.scaleToGeodeticSurface(d[g],d[g]);if(t||(d=Fr(d,h.equalsEpsilon,!0)),d.length<3)continue;let y=n(d);if(!l(y))continue;let A=[],b=fi.computeWindingOrder2D(y);if(b===Qs.CLOCKWISE&&(y.reverse(),d=d.slice().reverse()),u){u=!1;let S=[d];if(S=o(S,S),S.length>1){for(let I of S)c.enqueue(new Mc(I,p));continue}}let x=d.slice(),T=l(p)?p.length:0,E=[],v;for(g=0;g<T;g++){let S=p[g],I=S.positions;if(i)for(m=I.length,v=0;v<m;++v)r.scaleToGeodeticSurface(I[v],I[v]);if(t||(I=Fr(I,h.equalsEpsilon,!0)),I.length<3)continue;let R=n(I);if(!l(R))continue;b=fi.computeWindingOrder2D(R),b===Qs.CLOCKWISE&&(R.reverse(),I=I.slice().reverse()),E.push(I),A.push(x.length),x=x.concat(I),y=y.concat(R);let O=0;for(l(S.holes)&&(O=S.holes.length),v=0;v<O;v++)c.enqueue(S.holes[v])}s.push({outerRing:d,holes:E}),a.push({positions:x,positions2D:y,holes:A})}return{hierarchy:s,polygons:a}};var fKe=new U,dKe=new h,hKe=new Le,mKe=new $;Oo.computeBoundingRectangle=function(e,t,n,i,r){let o=Le.fromAxisAngle(e,i,hKe),s=$.fromQuaternion(o,mKe),a=Number.POSITIVE_INFINITY,c=Number.NEGATIVE_INFINITY,u=Number.POSITIVE_INFINITY,f=Number.NEGATIVE_INFINITY,d=n.length;for(let p=0;p<d;++p){let g=h.clone(n[p],dKe);$.multiplyByVector(s,g,g);let m=t(g,fKe);l(m)&&(a=Math.min(a,m.x),c=Math.max(c,m.x),u=Math.min(u,m.y),f=Math.max(f,m.y))}return r.x=a,r.y=u,r.width=c-a,r.height=f-u,r};Oo.createGeometryFromPositions=function(e,t,n,i,r,o,s){let a=fi.triangulate(t.positions2D,t.holes);a.length<3&&(a=[0,1,2]);let c=t.positions,u=l(n),f=u?n.positions:void 0;if(r){let d=c.length,p=new Array(d*3),g=0;for(let A=0;A<d;A++){let b=c[A];p[g++]=b.x,p[g++]=b.y,p[g++]=b.z}let m={attributes:{position:new Ne({componentDatatype:Y.DOUBLE,componentsPerAttribute:3,values:p})},indices:a,primitiveType:Oe.TRIANGLES};u&&(m.attributes.st=new Ne({componentDatatype:Y.FLOAT,componentsPerAttribute:2,values:U.packArray(f)}));let y=new St(m);return o.normal?Hn.computeNormal(y):y}if(s===ln.GEODESIC)return fi.computeSubdivision(e,c,a,f,i);if(s===ln.RHUMB)return fi.computeRhumbLineSubdivision(e,c,a,f,i)};var uye=[],fye=[],pKe=new h,gKe=new h;Oo.computeWallGeometry=function(e,t,n,i,r,o){let s,a,c,u,f,d,p,g,m,y=e.length,A=0,b=0,x=l(t),T=x?t.positions:void 0;if(r)for(a=y*3*2,s=new Array(a*2),x&&(m=y*2*2,g=new Array(m*2)),c=0;c<y;c++)u=e[c],f=e[(c+1)%y],s[A]=s[A+a]=u.x,++A,s[A]=s[A+a]=u.y,++A,s[A]=s[A+a]=u.z,++A,s[A]=s[A+a]=f.x,++A,s[A]=s[A+a]=f.y,++A,s[A]=s[A+a]=f.z,++A,x&&(d=T[c],p=T[(c+1)%y],g[b]=g[b+m]=d.x,++b,g[b]=g[b+m]=d.y,++b,g[b]=g[b+m]=p.x,++b,g[b]=g[b+m]=p.y,++b);else{let R=D.chordLength(i,n.maximumRadius),O=0;if(o===ln.GEODESIC)for(c=0;c<y;c++)O+=Oo.subdivideLineCount(e[c],e[(c+1)%y],R);else if(o===ln.RHUMB)for(c=0;c<y;c++)O+=Oo.subdivideRhumbLineCount(n,e[c],e[(c+1)%y],R);for(a=(O+y)*3,s=new Array(a*2),x&&(m=(O+y)*2,g=new Array(m*2)),c=0;c<y;c++){u=e[c],f=e[(c+1)%y];let L,_;x&&(d=T[c],p=T[(c+1)%y]),o===ln.GEODESIC?(L=Oo.subdivideLine(u,f,R,fye),x&&(_=Oo.subdivideTexcoordLine(d,p,u,f,R,uye))):o===ln.RHUMB&&(L=Oo.subdivideRhumbLine(n,u,f,R,fye),x&&(_=Oo.subdivideTexcoordRhumbLine(d,p,n,u,f,R,uye)));let C=L.length;for(let w=0;w<C;++w,++A)s[A]=L[w],s[A+a]=L[w];if(s[A]=f.x,s[A+a]=f.x,++A,s[A]=f.y,s[A+a]=f.y,++A,s[A]=f.z,s[A+a]=f.z,++A,x){let w=_.length;for(let P=0;P<w;++P,++b)g[b]=_[P],g[b+m]=_[P];g[b]=p.x,g[b+m]=p.x,++b,g[b]=p.y,g[b+m]=p.y,++b}}}y=s.length;let E=je.createTypedArray(y/3,y-e.length*6),v=0;for(y/=6,c=0;c<y;c++){let R=c,O=R+1,L=R+y,_=L+1;u=h.fromArray(s,R*3,pKe),f=h.fromArray(s,O*3,gKe),!h.equalsEpsilon(u,f,D.EPSILON10,D.EPSILON10)&&(E[v++]=R,E[v++]=L,E[v++]=O,E[v++]=O,E[v++]=L,E[v++]=_)}let S={attributes:new Tn({position:new Ne({componentDatatype:Y.DOUBLE,componentsPerAttribute:3,values:s})}),indices:E,primitiveType:Oe.TRIANGLES};return x&&(S.attributes.st=new Ne({componentDatatype:Y.FLOAT,componentsPerAttribute:2,values:g})),new St(S)};var ni=Oo;var _Ke=new h,yKe=new et,AKe=new U,bKe=new U,xKe=new h,TKe=new h,EKe=new h,bL=new h,CKe=new h,vKe=new h,mye=new Le,SKe=new $,wKe=new $,IKe=new h;function PKe(e,t,n,i,r,o,s,a,c){let u=e.positions,f=fi.triangulate(e.positions2D,e.holes);f.length<3&&(f=[0,1,2]);let d=je.createTypedArray(u.length,f.length);d.set(f);let p=SKe;if(i!==0){let _=Le.fromAxisAngle(s,i,mye);if(p=$.fromQuaternion(_,p),t.tangent||t.bitangent){_=Le.fromAxisAngle(s,-i,mye);let C=$.fromQuaternion(_,wKe);a=h.normalize($.multiplyByVector(C,a,a),a),t.bitangent&&(c=h.normalize(h.cross(s,a,c),c))}}else p=$.clone($.IDENTITY,p);let g=bKe;t.st&&(g.x=n.x,g.y=n.y);let m=u.length,y=m*3,A=new Float64Array(y),b=t.normal?new Float32Array(y):void 0,x=t.tangent?new Float32Array(y):void 0,T=t.bitangent?new Float32Array(y):void 0,E=t.st?new Float32Array(m*2):void 0,v=0,S=0,I=0,R=0,O=0;for(let _=0;_<m;_++){let C=u[_];if(A[v++]=C.x,A[v++]=C.y,A[v++]=C.z,t.st)if(l(r)&&r.positions.length===m)E[O++]=r.positions[_].x,E[O++]=r.positions[_].y;else{let w=$.multiplyByVector(p,C,_Ke),P=o(w,AKe);U.subtract(P,g,P);let M=D.clamp(P.x/n.width,0,1),F=D.clamp(P.y/n.height,0,1);E[O++]=M,E[O++]=F}t.normal&&(b[S++]=s.x,b[S++]=s.y,b[S++]=s.z),t.tangent&&(x[R++]=a.x,x[R++]=a.y,x[R++]=a.z),t.bitangent&&(T[I++]=c.x,T[I++]=c.y,T[I++]=c.z)}let L=new Tn;return t.position&&(L.position=new Ne({componentDatatype:Y.DOUBLE,componentsPerAttribute:3,values:A})),t.normal&&(L.normal=new Ne({componentDatatype:Y.FLOAT,componentsPerAttribute:3,values:b})),t.tangent&&(L.tangent=new Ne({componentDatatype:Y.FLOAT,componentsPerAttribute:3,values:x})),t.bitangent&&(L.bitangent=new Ne({componentDatatype:Y.FLOAT,componentsPerAttribute:3,values:T})),t.st&&(L.st=new Ne({componentDatatype:Y.FLOAT,componentsPerAttribute:2,values:E})),new St({attributes:L,indices:d,primitiveType:Oe.TRIANGLES})}function sT(e){e=e??H.EMPTY_OBJECT;let t=e.polygonHierarchy,n=e.textureCoordinates,i=e.vertexFormat??Be.DEFAULT;this._vertexFormat=Be.clone(i),this._polygonHierarchy=t,this._stRotation=e.stRotation??0,this._ellipsoid=ee.clone(e.ellipsoid??ee.default),this._workerName="createCoplanarPolygonGeometry",this._textureCoordinates=n,this.packedLength=ni.computeHierarchyPackedLength(t,h)+Be.packedLength+ee.packedLength+(l(n)?ni.computeHierarchyPackedLength(n,U):1)+2}sT.fromPositions=function(e){e=e??H.EMPTY_OBJECT;let t={polygonHierarchy:{positions:e.positions},vertexFormat:e.vertexFormat,stRotation:e.stRotation,ellipsoid:e.ellipsoid,textureCoordinates:e.textureCoordinates};return new sT(t)};sT.pack=function(e,t,n){return n=n??0,n=ni.packPolygonHierarchy(e._polygonHierarchy,t,n,h),ee.pack(e._ellipsoid,t,n),n+=ee.packedLength,Be.pack(e._vertexFormat,t,n),n+=Be.packedLength,t[n++]=e._stRotation,l(e._textureCoordinates)?n=ni.packPolygonHierarchy(e._textureCoordinates,t,n,U):t[n++]=-1,t[n]=e.packedLength,t};var DKe=ee.clone(ee.UNIT_SPHERE),RKe=new Be,OKe={polygonHierarchy:{}};sT.unpack=function(e,t,n){t=t??0;let i=ni.unpackPolygonHierarchy(e,t,h);t=i.startingIndex,delete i.startingIndex;let r=ee.unpack(e,t,DKe);t+=ee.packedLength;let o=Be.unpack(e,t,RKe);t+=Be.packedLength;let s=e[t++],a=e[t]===-1?void 0:ni.unpackPolygonHierarchy(e,t,U);l(a)?(t=a.startingIndex,delete a.startingIndex):t++;let c=e[t];return l(n)||(n=new sT(OKe)),n._polygonHierarchy=i,n._ellipsoid=ee.clone(r,n._ellipsoid),n._vertexFormat=Be.clone(o,n._vertexFormat),n._stRotation=s,n._textureCoordinates=a,n.packedLength=c,n};sT.createGeometry=function(e){let t=e._vertexFormat,n=e._polygonHierarchy,i=e._stRotation,r=e._textureCoordinates,o=l(r),s=n.positions;if(s=Fr(s,h.equalsEpsilon,!0),s.length<3)return;let a=xKe,c=TKe,u=EKe,f=CKe,d=vKe;if(!Vg.computeProjectTo2DArguments(s,bL,f,d))return;if(a=h.cross(f,d,a),a=h.normalize(a,a),!h.equalsEpsilon(bL,h.ZERO,D.EPSILON6)){let O=e._ellipsoid.geodeticSurfaceNormal(bL,IKe);h.dot(a,O)<0&&(a=h.negate(a,a),f=h.negate(f,f))}let g=Vg.createProjectPointsTo2DFunction(bL,f,d),m=Vg.createProjectPointTo2DFunction(bL,f,d);t.tangent&&(c=h.clone(f,c)),t.bitangent&&(u=h.clone(d,u));let y=ni.polygonsFromHierarchy(n,o,g,!1),A=y.hierarchy,b=y.polygons,x=function(O){return O},T=o?ni.polygonsFromHierarchy(r,!0,x,!1).polygons:void 0;if(A.length===0)return;s=A[0].outerRing;let E=ue.fromPoints(s),v=ni.computeBoundingRectangle(a,m,s,i,yKe),S=[];for(let O=0;O<b.length;O++){let L=new Ft({geometry:PKe(b[O],t,v,i,o?T[O]:void 0,m,a,c,u)});S.push(L)}let I=Hn.combineInstances(S)[0];I.attributes.position.values=new Float64Array(I.attributes.position.values),I.indices=je.createTypedArray(I.attributes.position.values.length/3,I.indices);let R=I.attributes;return t.position||delete R.position,new St({attributes:R,indices:I.indices,primitiveType:I.primitiveType,boundingSphere:E})};var xL=sT;function MKe(e){let t=e.length,n=new Float64Array(t*3),i=je.createTypedArray(t,t*2),r=0,o=0;for(let a=0;a<t;a++){let c=e[a];n[r++]=c.x,n[r++]=c.y,n[r++]=c.z,i[o++]=a,i[o++]=(a+1)%t}let s=new Tn({position:new Ne({componentDatatype:Y.DOUBLE,componentsPerAttribute:3,values:n})});return new St({attributes:s,indices:i,primitiveType:Oe.LINES})}function aT(e){e=e??H.EMPTY_OBJECT;let t=e.polygonHierarchy;this._polygonHierarchy=t,this._workerName="createCoplanarPolygonOutlineGeometry",this.packedLength=ni.computeHierarchyPackedLength(t,h)+1}aT.fromPositions=function(e){e=e??H.EMPTY_OBJECT;let t={polygonHierarchy:{positions:e.positions}};return new aT(t)};aT.pack=function(e,t,n){return n=n??0,n=ni.packPolygonHierarchy(e._polygonHierarchy,t,n,h),t[n]=e.packedLength,t};var NKe={polygonHierarchy:{}};aT.unpack=function(e,t,n){t=t??0;let i=ni.unpackPolygonHierarchy(e,t,h);t=i.startingIndex,delete i.startingIndex;let r=e[t];return l(n)||(n=new aT(NKe)),n._polygonHierarchy=i,n.packedLength=r,n};aT.createGeometry=function(e){let t=e._polygonHierarchy,n=t.positions;if(n=Fr(n,h.equalsEpsilon,!0),n.length<3||!Vg.validOutline(n))return;let r=ni.polygonOutlinesFromHierarchy(t,!1);if(r.length===0)return;let o=[];for(let c=0;c<r.length;c++){let u=new Ft({geometry:MKe(r[c])});o.push(u)}let s=Hn.combineInstances(o)[0],a=ue.fromPoints(t.positions);return new St({attributes:s.attributes,indices:s.indices,primitiveType:s.primitiveType,boundingSphere:a})};var jd=aT;function Es(e,t){this.position=e,l(this.position)||(this.position=new U),this.tangentPlane=t,l(this.tangentPlane)||(this.tangentPlane=Es.NORTH_POLE_TANGENT_PLANE)}Object.defineProperties(Es.prototype,{ellipsoid:{get:function(){return this.tangentPlane.ellipsoid}},x:{get:function(){return this.position.x}},y:{get:function(){return this.position.y}},conformalLatitude:{get:function(){let e=U.magnitude(this.position),t=2*this.ellipsoid.maximumRadius;return this.tangentPlane.plane.normal.z*(D.PI_OVER_TWO-2*Math.atan2(e,t))}},longitude:{get:function(){let e=D.PI_OVER_TWO+Math.atan2(this.y,this.x);return e>Math.PI&&(e-=D.TWO_PI),e}}});var fS=new he,LKe=new h;Es.prototype.getLatitude=function(e){l(e)||(e=ee.default),fS.latitude=this.conformalLatitude,fS.longitude=this.longitude,fS.height=0;let t=this.ellipsoid.cartographicToCartesian(fS,LKe);return e.cartesianToCartographic(t,fS),fS.latitude};var FKe=new pn,BKe=new h,kKe=new h;Es.fromCartesian=function(e,t){let n=D.signNotZero(e.z),i=Es.NORTH_POLE_TANGENT_PLANE,r=Es.SOUTH_POLE;n<0&&(i=Es.SOUTH_POLE_TANGENT_PLANE,r=Es.NORTH_POLE);let o=FKe;o.origin=i.ellipsoid.scaleToGeocentricSurface(e,o.origin),o.direction=h.subtract(o.origin,r,BKe),h.normalize(o.direction,o.direction);let s=_i.rayPlane(o,i.plane,kKe),a=h.subtract(s,r,s),c=h.dot(i.xAxis,a),u=n*h.dot(i.yAxis,a);return l(t)?(t.position=new U(c,u),t.tangentPlane=i,t):new Es(new U(c,u),i)};Es.fromCartesianArray=function(e,t){let n=e.length;l(t)?t.length=n:t=new Array(n);for(let i=0;i<n;i++)t[i]=Es.fromCartesian(e[i],t[i]);return t};Es.clone=function(e,t){if(l(e))return l(t)?(t.position=e.position,t.tangentPlane=e.tangentPlane,t):new Es(e.position,e.tangentPlane)};Es.HALF_UNIT_SPHERE=Object.freeze(new ee(.5,.5,.5));Es.NORTH_POLE=Object.freeze(new h(0,0,.5));Es.SOUTH_POLE=Object.freeze(new h(0,0,-.5));Es.NORTH_POLE_TANGENT_PLANE=Object.freeze(new js(Es.NORTH_POLE,Es.HALF_UNIT_SPHERE));Es.SOUTH_POLE_TANGENT_PLANE=Object.freeze(new js(Es.SOUTH_POLE,Es.HALF_UNIT_SPHERE));var ol=Es;var UKe=new he,pye=new he;function zKe(e,t,n,i){let o=i.cartesianToCartographic(e,UKe).height,s=i.cartesianToCartographic(t,pye);s.height=o,i.cartographicToCartesian(s,t);let a=i.cartesianToCartographic(n,pye);a.height=o-100,i.cartographicToCartesian(a,n)}var gye=new et,VKe=new h,jKe=new h,HKe=new h,GKe=new h,WKe=new h,qKe=new h,lH=new h,Wp=new h,dS=new h,YKe=new U,XKe=new U,KKe=new h,_ye=new Le,$Ke=new $,JKe=new $;function w$(e){let t=e.vertexFormat,n=e.geometry,i=e.shadowVolume,r=n.attributes.position.values,o=l(n.attributes.st)?n.attributes.st.values:void 0,s=r.length,a=e.wall,c=e.top||a,u=e.bottom||a;if(t.st||t.normal||t.tangent||t.bitangent||i){let f=e.boundingRectangle,d=e.rotationAxis,p=e.projectTo2d,g=e.ellipsoid,m=e.stRotation,y=e.perPositionHeight,A=YKe;A.x=f.x,A.y=f.y;let b=t.st?new Float32Array(2*(s/3)):void 0,x;t.normal&&(y&&c&&!a?x=n.attributes.normal.values:x=new Float32Array(s));let T=t.tangent?new Float32Array(s):void 0,E=t.bitangent?new Float32Array(s):void 0,v=i?new Float32Array(s):void 0,S=0,I=0,R=jKe,O=HKe,L=GKe,_=!0,C=$Ke,w=JKe;if(m!==0){let F=Le.fromAxisAngle(d,m,_ye);C=$.fromQuaternion(F,C),F=Le.fromAxisAngle(d,-m,_ye),w=$.fromQuaternion(F,w)}else C=$.clone($.IDENTITY,C),w=$.clone($.IDENTITY,w);let P=0,M=0;c&&u&&(P=s/2,M=s/3,s/=2);for(let F=0;F<s;F+=3){let V=h.fromArray(r,F,KKe);if(t.st&&!l(o)){let B=$.multiplyByVector(C,V,VKe);B=g.scaleToGeodeticSurface(B,B);let j=p([B],XKe)[0];U.subtract(j,A,j);let k=D.clamp(j.x/f.width,0,1),G=D.clamp(j.y/f.height,0,1);u&&(b[S+M]=k,b[S+1+M]=G),c&&(b[S]=k,b[S+1]=G),S+=2}if(t.normal||t.tangent||t.bitangent||i){let B=I+1,j=I+2;if(a){if(F+3<s){let k=h.fromArray(r,F+3,WKe);if(_){let G=h.fromArray(r,F+s,qKe);y&&zKe(V,k,G,g),h.subtract(k,V,k),h.subtract(G,V,G),R=h.normalize(h.cross(G,k,R),R),_=!1}h.equalsEpsilon(k,V,D.EPSILON10)&&(_=!0)}(t.tangent||t.bitangent)&&(L=g.geodeticSurfaceNormal(V,L),t.tangent&&(O=h.normalize(h.cross(L,R,O),O)))}else R=g.geodeticSurfaceNormal(V,R),(t.tangent||t.bitangent)&&(y&&(lH=h.fromArray(x,I,lH),Wp=h.cross(h.UNIT_Z,lH,Wp),Wp=h.normalize($.multiplyByVector(w,Wp,Wp),Wp),t.bitangent&&(dS=h.normalize(h.cross(lH,Wp,dS),dS))),O=h.cross(h.UNIT_Z,R,O),O=h.normalize($.multiplyByVector(w,O,O),O),t.bitangent&&(L=h.normalize(h.cross(R,O,L),L)));t.normal&&(e.wall?(x[I+P]=R.x,x[B+P]=R.y,x[j+P]=R.z):u&&(x[I+P]=-R.x,x[B+P]=-R.y,x[j+P]=-R.z),(c&&!y||a)&&(x[I]=R.x,x[B]=R.y,x[j]=R.z)),i&&(a&&(R=g.geodeticSurfaceNormal(V,R)),v[I+P]=-R.x,v[B+P]=-R.y,v[j+P]=-R.z),t.tangent&&(e.wall?(T[I+P]=O.x,T[B+P]=O.y,T[j+P]=O.z):u&&(T[I+P]=-O.x,T[B+P]=-O.y,T[j+P]=-O.z),c&&(y?(T[I]=Wp.x,T[B]=Wp.y,T[j]=Wp.z):(T[I]=O.x,T[B]=O.y,T[j]=O.z))),t.bitangent&&(u&&(E[I+P]=L.x,E[B+P]=L.y,E[j+P]=L.z),c&&(y?(E[I]=dS.x,E[B]=dS.y,E[j]=dS.z):(E[I]=L.x,E[B]=L.y,E[j]=L.z))),I+=3}}t.st&&!l(o)&&(n.attributes.st=new Ne({componentDatatype:Y.FLOAT,componentsPerAttribute:2,values:b})),t.normal&&(n.attributes.normal=new Ne({componentDatatype:Y.FLOAT,componentsPerAttribute:3,values:x})),t.tangent&&(n.attributes.tangent=new Ne({componentDatatype:Y.FLOAT,componentsPerAttribute:3,values:T})),t.bitangent&&(n.attributes.bitangent=new Ne({componentDatatype:Y.FLOAT,componentsPerAttribute:3,values:E})),i&&(n.attributes.extrudeDirection=new Ne({componentDatatype:Y.FLOAT,componentsPerAttribute:3,values:v}))}if(e.extrude&&l(e.offsetAttribute)){let f=r.length/3,d=new Uint8Array(f);if(e.offsetAttribute===mn.TOP)c&&u||a?d=d.fill(1,0,f/2):c&&(d=d.fill(1));else{let p=e.offsetAttribute===mn.NONE?0:1;d=d.fill(p)}n.attributes.applyOffset=new Ne({componentDatatype:Y.UNSIGNED_BYTE,componentsPerAttribute:1,values:d})}return n}var yye=[];function ZKe(e,t,n,i,r,o,s,a,c,u){let f={walls:[]},d;if(s||a){let x=ni.createGeometryFromPositions(e,t,n,i,o,c,u),T=x.attributes.position.values,E=x.indices,v,S;if(s&&a){let I=T.concat(T);v=I.length/3,S=je.createTypedArray(v,E.length*2),S.set(E);let R=E.length,O=v/2;for(d=0;d<R;d+=3){let L=S[d]+O,_=S[d+1]+O,C=S[d+2]+O;S[d+R]=C,S[d+1+R]=_,S[d+2+R]=L}if(x.attributes.position.values=I,o&&c.normal){let L=x.attributes.normal.values;x.attributes.normal.values=new Float32Array(I.length),x.attributes.normal.values.set(L)}if(c.st&&l(n)){let L=x.attributes.st.values;x.attributes.st.values=new Float32Array(v*2),x.attributes.st.values=L.concat(L)}x.indices=S}else if(a){for(v=T.length/3,S=je.createTypedArray(v,E.length),d=0;d<E.length;d+=3)S[d]=E[d+2],S[d+1]=E[d+1],S[d+2]=E[d];x.indices=S}f.topAndBottom=new Ft({geometry:x})}let p=r.outerRing,g=js.fromPoints(p,e),m=g.projectPointsOntoPlane(p,yye),y=fi.computeWindingOrder2D(m);y===Qs.CLOCKWISE&&(p=p.slice().reverse());let A=ni.computeWallGeometry(p,n,e,i,o,u);f.walls.push(new Ft({geometry:A}));let b=r.holes;for(d=0;d<b.length;d++){let x=b[d];m=g.projectPointsOntoPlane(x,yye),y=fi.computeWindingOrder2D(m),y===Qs.COUNTER_CLOCKWISE&&(x=x.slice().reverse()),A=ni.computeWallGeometry(x,n,e,i,o,u),f.walls.push(new Ft({geometry:A}))}return f}function Gd(e){let t=e.polygonHierarchy,n=e.vertexFormat??Be.DEFAULT,i=e.ellipsoid??ee.default,r=e.granularity??D.RADIANS_PER_DEGREE,o=e.stRotation??0,s=e.textureCoordinates,a=e.perPositionHeight??!1,c=a&&l(e.extrudedHeight),u=e.height??0,f=e.extrudedHeight??u;if(!c){let d=Math.max(u,f);f=Math.min(u,f),u=d}this._vertexFormat=Be.clone(n),this._ellipsoid=ee.clone(i),this._granularity=r,this._stRotation=o,this._height=u,this._extrudedHeight=f,this._closeTop=e.closeTop??!0,this._closeBottom=e.closeBottom??!0,this._polygonHierarchy=t,this._perPositionHeight=a,this._perPositionHeightExtrude=c,this._shadowVolume=e.shadowVolume??!1,this._workerName="createPolygonGeometry",this._offsetAttribute=e.offsetAttribute,this._arcType=e.arcType??ln.GEODESIC,this._rectangle=void 0,this._textureCoordinateRotationPoints=void 0,this._textureCoordinates=s,this.packedLength=ni.computeHierarchyPackedLength(t,h)+ee.packedLength+Be.packedLength+(s?ni.computeHierarchyPackedLength(s,U):1)+12}Gd.fromPositions=function(e){e=e??H.EMPTY_OBJECT;let t={polygonHierarchy:{positions:e.positions},height:e.height,extrudedHeight:e.extrudedHeight,vertexFormat:e.vertexFormat,stRotation:e.stRotation,ellipsoid:e.ellipsoid,granularity:e.granularity,perPositionHeight:e.perPositionHeight,closeTop:e.closeTop,closeBottom:e.closeBottom,offsetAttribute:e.offsetAttribute,arcType:e.arcType,textureCoordinates:e.textureCoordinates};return new Gd(t)};Gd.pack=function(e,t,n){return n=n??0,n=ni.packPolygonHierarchy(e._polygonHierarchy,t,n,h),ee.pack(e._ellipsoid,t,n),n+=ee.packedLength,Be.pack(e._vertexFormat,t,n),n+=Be.packedLength,t[n++]=e._height,t[n++]=e._extrudedHeight,t[n++]=e._granularity,t[n++]=e._stRotation,t[n++]=e._perPositionHeightExtrude?1:0,t[n++]=e._perPositionHeight?1:0,t[n++]=e._closeTop?1:0,t[n++]=e._closeBottom?1:0,t[n++]=e._shadowVolume?1:0,t[n++]=e._offsetAttribute??-1,t[n++]=e._arcType,l(e._textureCoordinates)?n=ni.packPolygonHierarchy(e._textureCoordinates,t,n,U):t[n++]=-1,t[n]=e.packedLength,t};var QKe=ee.clone(ee.UNIT_SPHERE),e$e=new Be,t$e={polygonHierarchy:{}};Gd.unpack=function(e,t,n){t=t??0;let i=ni.unpackPolygonHierarchy(e,t,h);t=i.startingIndex,delete i.startingIndex;let r=ee.unpack(e,t,QKe);t+=ee.packedLength;let o=Be.unpack(e,t,e$e);t+=Be.packedLength;let s=e[t++],a=e[t++],c=e[t++],u=e[t++],f=e[t++]===1,d=e[t++]===1,p=e[t++]===1,g=e[t++]===1,m=e[t++]===1,y=e[t++],A=e[t++],b=e[t]===-1?void 0:ni.unpackPolygonHierarchy(e,t,U);l(b)?(t=b.startingIndex,delete b.startingIndex):t++;let x=e[t];return l(n)||(n=new Gd(t$e)),n._polygonHierarchy=i,n._ellipsoid=ee.clone(r,n._ellipsoid),n._vertexFormat=Be.clone(o,n._vertexFormat),n._height=s,n._extrudedHeight=a,n._granularity=c,n._stRotation=u,n._perPositionHeightExtrude=f,n._perPositionHeight=d,n._closeTop=p,n._closeBottom=g,n._shadowVolume=m,n._offsetAttribute=y===-1?void 0:y,n._arcType=A,n._textureCoordinates=b,n.packedLength=x,n};var n$e=new U,i$e=new U,r$e=new ol;function Aye(e,t,n,i,r,o){let s=e.longitude,a=s>=0?s:s+D.TWO_PI;r.westOverIdl=Math.min(r.westOverIdl,a),r.eastOverIdl=Math.max(r.eastOverIdl,a),o.west=Math.min(o.west,s),o.east=Math.max(o.east,s);let c=e.getLatitude(n),u=c;if(o.south=Math.min(o.south,c),o.north=Math.max(o.north,c),i!==ln.RHUMB){let p=U.subtract(t.position,e.position,n$e),g=U.dot(t.position,p)/U.dot(p,p);if(g>0&&g<1){let m=U.add(t.position,U.multiplyByScalar(p,-g,p),i$e),y=ol.clone(t,r$e);y.position=m;let A=y.getLatitude(n);o.south=Math.min(o.south,A),o.north=Math.max(o.north,A),Math.abs(c)>Math.abs(A)&&(u=A)}}let f=t.x*e.y-e.x*t.y,d=Math.sign(f);d!==0&&(d*=U.angleBetween(t.position,e.position)),u>=0&&(r.northAngle+=d),u<=0&&(r.southAngle+=d)}var bye=new ol,o$e=new ol,Hd={northAngle:0,southAngle:0,westOverIdl:0,eastOverIdl:0};Gd.computeRectangleFromPositions=function(e,t,n,i){if(l(i)||(i=new ie),e.length<3)return i;i.west=Number.POSITIVE_INFINITY,i.east=Number.NEGATIVE_INFINITY,i.south=Number.POSITIVE_INFINITY,i.north=Number.NEGATIVE_INFINITY,Hd.northAngle=0,Hd.southAngle=0,Hd.westOverIdl=Number.POSITIVE_INFINITY,Hd.eastOverIdl=Number.NEGATIVE_INFINITY;let r=e.length,o=ol.fromCartesian(e[0],o$e);for(let s=1;s<r;s++){let a=ol.fromCartesian(e[s],bye);Aye(a,o,t,n,Hd,i),o=ol.clone(a,o)}return Aye(ol.fromCartesian(e[0],bye),o,t,n,Hd,i),i.east-i.west>Hd.eastOverIdl-Hd.westOverIdl&&(i.west=Hd.westOverIdl,i.east=Hd.eastOverIdl,i.east>D.PI&&(i.east=i.east-D.TWO_PI),i.west>D.PI&&(i.west=i.west-D.TWO_PI)),D.equalsEpsilon(Math.abs(Hd.northAngle),D.TWO_PI,D.EPSILON10)&&(i.north=D.PI_OVER_TWO,i.east=D.PI,i.west=-D.PI),D.equalsEpsilon(Math.abs(Hd.southAngle),D.TWO_PI,D.EPSILON10)&&(i.south=-D.PI_OVER_TWO,i.east=D.PI,i.west=-D.PI),i};var s$e=new ol;function a$e(e,t,n){return e.height>=D.PI||e.width>=D.PI?ol.fromCartesian(t[0],s$e).tangentPlane:js.fromPoints(t,n)}var xye=new he;function c$e(e,t,n){return(i,r)=>{if(e.height>=D.PI||e.width>=D.PI){if(e.south<0&&e.north>0){l(r)||(r=[]);for(let s=0;s<i.length;++s){let a=n.cartesianToCartographic(i[s],xye);r[s]=new U(a.longitude/D.PI,a.latitude/D.PI_OVER_TWO)}return r.length=i.length,r}return ol.fromCartesianArray(i,r)}return js.fromPoints(t,n).projectPointsOntoPlane(i,r)}}function l$e(e,t,n){if(e.height>=D.PI||e.width>=D.PI)return(r,o)=>{if(e.south<0&&e.north>0){let s=n.cartesianToCartographic(r,xye);return l(o)||(o=new U),o.x=s.longitude/D.PI,o.y=s.latitude/D.PI_OVER_TWO,o}return ol.fromCartesian(r,o)};let i=js.fromPoints(t,n);return(r,o)=>i.projectPointsOntoPlane(r,o)}function u$e(e,t,n,i){return(r,o)=>!i&&(e.height>=D.PI_OVER_TWO||e.width>=2*D.PI_OVER_THREE)?ni.splitPolygonsOnEquator(r,t,n,o):r}function f$e(e,t,n,i){if(t.height>=D.PI||t.width>=D.PI)return et.fromRectangle(t,void 0,gye);let r=e,o=js.fromPoints(r,n);return ni.computeBoundingRectangle(o.plane.normal,o.projectPointOntoPlane.bind(o),r,i,gye)}Gd.createGeometry=function(e){let t=e._vertexFormat,n=e._ellipsoid,i=e._granularity,r=e._stRotation,o=e._polygonHierarchy,s=e._perPositionHeight,a=e._closeTop,c=e._closeBottom,u=e._arcType,f=e._textureCoordinates,d=l(f),p=o.positions;if(p.length<3)return;let g=e.rectangle,m=ni.polygonsFromHierarchy(o,d,c$e(g,p,n),!s,n,u$e(g,n,u,s)),y=m.hierarchy,A=m.polygons,b=function(P){return P},x=d?ni.polygonsFromHierarchy(f,!0,b,!1,n).polygons:void 0;if(y.length===0)return;let T=y[0].outerRing,E=f$e(T,g,n,r),v=[],S=e._height,I=e._extrudedHeight,R=e._perPositionHeightExtrude||!D.equalsEpsilon(S,I,0,D.EPSILON2),O={perPositionHeight:s,vertexFormat:t,geometry:void 0,rotationAxis:a$e(g,T,n).plane.normal,projectTo2d:l$e(g,T,n),boundingRectangle:E,ellipsoid:n,stRotation:r,textureCoordinates:void 0,bottom:!1,top:!0,wall:!1,extrude:!1,arcType:u},L;if(R)for(O.extrude=!0,O.top=a,O.bottom=c,O.shadowVolume=e._shadowVolume,O.offsetAttribute=e._offsetAttribute,L=0;L<A.length;L++){let P=ZKe(n,A[L],d?x[L]:void 0,i,y[L],s,a,c,t,u),M;a&&c?(M=P.topAndBottom,O.geometry=ni.scaleToGeodeticHeightExtruded(M.geometry,S,I,n,s)):a?(M=P.topAndBottom,M.geometry.attributes.position.values=fi.scaleToGeodeticHeight(M.geometry.attributes.position.values,S,n,!s),O.geometry=M.geometry):c&&(M=P.topAndBottom,M.geometry.attributes.position.values=fi.scaleToGeodeticHeight(M.geometry.attributes.position.values,I,n,!0),O.geometry=M.geometry),(a||c)&&(O.wall=!1,M.geometry=w$(O),v.push(M));let F=P.walls;O.wall=!0;for(let V=0;V<F.length;V++){let B=F[V];O.geometry=ni.scaleToGeodeticHeightExtruded(B.geometry,S,I,n,s),B.geometry=w$(O),v.push(B)}}else for(L=0;L<A.length;L++){let P=new Ft({geometry:ni.createGeometryFromPositions(n,A[L],d?x[L]:void 0,i,s,t,u)});if(P.geometry.attributes.position.values=fi.scaleToGeodeticHeight(P.geometry.attributes.position.values,S,n,!s),O.geometry=P.geometry,P.geometry=w$(O),l(e._offsetAttribute)){let M=P.geometry.attributes.position.values.length,F=e._offsetAttribute===mn.NONE?0:1,V=new Uint8Array(M/3).fill(F);P.geometry.attributes.applyOffset=new Ne({componentDatatype:Y.UNSIGNED_BYTE,componentsPerAttribute:1,values:V})}v.push(P)}let _=Hn.combineInstances(v)[0];_.attributes.position.values=new Float64Array(_.attributes.position.values),_.indices=je.createTypedArray(_.attributes.position.values.length/3,_.indices);let C=_.attributes,w=ue.fromVertices(C.position.values);return t.position||delete C.position,new St({attributes:C,indices:_.indices,primitiveType:_.primitiveType,boundingSphere:w,offsetAttribute:e._offsetAttribute})};Gd.createShadowVolume=function(e,t,n){let i=e._granularity,r=e._ellipsoid,o=t(i,r),s=n(i,r);return new Gd({polygonHierarchy:e._polygonHierarchy,ellipsoid:r,stRotation:e._stRotation,granularity:i,perPositionHeight:!1,extrudedHeight:o,height:s,vertexFormat:Be.POSITION_ONLY,shadowVolume:!0,arcType:e._arcType})};function d$e(e){let t=-e._stRotation;if(t===0)return[0,0,0,1,1,0];let n=e._ellipsoid,i=e._polygonHierarchy.positions,r=e.rectangle;return St._textureCoordinateRotationPoints(i,t,n,r)}Object.defineProperties(Gd.prototype,{rectangle:{get:function(){if(!l(this._rectangle)){let e=this._polygonHierarchy.positions;this._rectangle=Gd.computeRectangleFromPositions(e,this._ellipsoid,this._arcType)}return this._rectangle}},textureCoordinateRotationPoints:{get:function(){return l(this._textureCoordinateRotationPoints)||(this._textureCoordinateRotationPoints=d$e(this)),this._textureCoordinateRotationPoints}}});var qp=Gd;var Tye=[],uH=[];function h$e(e,t,n,i,r){let s=js.fromPoints(t,e).projectPointsOntoPlane(t,Tye);fi.computeWindingOrder2D(s)===Qs.CLOCKWISE&&(s.reverse(),t=t.slice().reverse());let c,u,f=t.length,d=0;if(i)for(c=new Float64Array(f*2*3),u=0;u<f;u++){let m=t[u],y=t[(u+1)%f];c[d++]=m.x,c[d++]=m.y,c[d++]=m.z,c[d++]=y.x,c[d++]=y.y,c[d++]=y.z}else{let m=0;if(r===ln.GEODESIC)for(u=0;u<f;u++)m+=ni.subdivideLineCount(t[u],t[(u+1)%f],n);else if(r===ln.RHUMB)for(u=0;u<f;u++)m+=ni.subdivideRhumbLineCount(e,t[u],t[(u+1)%f],n);for(c=new Float64Array(m*3),u=0;u<f;u++){let y;r===ln.GEODESIC?y=ni.subdivideLine(t[u],t[(u+1)%f],n,uH):r===ln.RHUMB&&(y=ni.subdivideRhumbLine(e,t[u],t[(u+1)%f],n,uH));let A=y.length;for(let b=0;b<A;++b)c[d++]=y[b]}}f=c.length/3;let p=f*2,g=je.createTypedArray(f,p);for(d=0,u=0;u<f-1;u++)g[d++]=u,g[d++]=u+1;return g[d++]=f-1,g[d]=0,new Ft({geometry:new St({attributes:new Tn({position:new Ne({componentDatatype:Y.DOUBLE,componentsPerAttribute:3,values:c})}),indices:g,primitiveType:Oe.LINES})})}function m$e(e,t,n,i,r){let s=js.fromPoints(t,e).projectPointsOntoPlane(t,Tye);fi.computeWindingOrder2D(s)===Qs.CLOCKWISE&&(s.reverse(),t=t.slice().reverse());let c,u,f=t.length,d=new Array(f),p=0;if(i)for(c=new Float64Array(f*2*3*2),u=0;u<f;++u){d[u]=p/3;let A=t[u],b=t[(u+1)%f];c[p++]=A.x,c[p++]=A.y,c[p++]=A.z,c[p++]=b.x,c[p++]=b.y,c[p++]=b.z}else{let A=0;if(r===ln.GEODESIC)for(u=0;u<f;u++)A+=ni.subdivideLineCount(t[u],t[(u+1)%f],n);else if(r===ln.RHUMB)for(u=0;u<f;u++)A+=ni.subdivideRhumbLineCount(e,t[u],t[(u+1)%f],n);for(c=new Float64Array(A*3*2),u=0;u<f;++u){d[u]=p/3;let b;r===ln.GEODESIC?b=ni.subdivideLine(t[u],t[(u+1)%f],n,uH):r===ln.RHUMB&&(b=ni.subdivideRhumbLine(e,t[u],t[(u+1)%f],n,uH));let x=b.length;for(let T=0;T<x;++T)c[p++]=b[T]}}f=c.length/6;let g=d.length,m=(f*2+g)*2,y=je.createTypedArray(f+g,m);for(p=0,u=0;u<f;++u)y[p++]=u,y[p++]=(u+1)%f,y[p++]=u+f,y[p++]=(u+1)%f+f;for(u=0;u<g;u++){let A=d[u];y[p++]=A,y[p++]=A+f}return new Ft({geometry:new St({attributes:new Tn({position:new Ne({componentDatatype:Y.DOUBLE,componentsPerAttribute:3,values:c})}),indices:y,primitiveType:Oe.LINES})})}function cT(e){let t=e.polygonHierarchy,n=e.ellipsoid??ee.default,i=e.granularity??D.RADIANS_PER_DEGREE,r=e.perPositionHeight??!1,o=r&&l(e.extrudedHeight),s=e.arcType??ln.GEODESIC,a=e.height??0,c=e.extrudedHeight??a;if(!o){let u=Math.max(a,c);c=Math.min(a,c),a=u}this._ellipsoid=ee.clone(n),this._granularity=i,this._height=a,this._extrudedHeight=c,this._arcType=s,this._polygonHierarchy=t,this._perPositionHeight=r,this._perPositionHeightExtrude=o,this._offsetAttribute=e.offsetAttribute,this._workerName="createPolygonOutlineGeometry",this.packedLength=ni.computeHierarchyPackedLength(t,h)+ee.packedLength+8}cT.pack=function(e,t,n){return n=n??0,n=ni.packPolygonHierarchy(e._polygonHierarchy,t,n,h),ee.pack(e._ellipsoid,t,n),n+=ee.packedLength,t[n++]=e._height,t[n++]=e._extrudedHeight,t[n++]=e._granularity,t[n++]=e._perPositionHeightExtrude?1:0,t[n++]=e._perPositionHeight?1:0,t[n++]=e._arcType,t[n++]=e._offsetAttribute??-1,t[n]=e.packedLength,t};var p$e=ee.clone(ee.UNIT_SPHERE),g$e={polygonHierarchy:{}};cT.unpack=function(e,t,n){t=t??0;let i=ni.unpackPolygonHierarchy(e,t,h);t=i.startingIndex,delete i.startingIndex;let r=ee.unpack(e,t,p$e);t+=ee.packedLength;let o=e[t++],s=e[t++],a=e[t++],c=e[t++]===1,u=e[t++]===1,f=e[t++],d=e[t++],p=e[t];return l(n)||(n=new cT(g$e)),n._polygonHierarchy=i,n._ellipsoid=ee.clone(r,n._ellipsoid),n._height=o,n._extrudedHeight=s,n._granularity=a,n._perPositionHeight=u,n._perPositionHeightExtrude=c,n._arcType=f,n._offsetAttribute=d===-1?void 0:d,n.packedLength=p,n};cT.fromPositions=function(e){e=e??H.EMPTY_OBJECT;let t={polygonHierarchy:{positions:e.positions},height:e.height,extrudedHeight:e.extrudedHeight,ellipsoid:e.ellipsoid,granularity:e.granularity,perPositionHeight:e.perPositionHeight,arcType:e.arcType,offsetAttribute:e.offsetAttribute};return new cT(t)};cT.createGeometry=function(e){let t=e._ellipsoid,n=e._granularity,i=e._polygonHierarchy,r=e._perPositionHeight,o=e._arcType,s=ni.polygonOutlinesFromHierarchy(i,!r,t);if(s.length===0)return;let a,c=[],u=D.chordLength(n,t.maximumRadius),f=e._height,d=e._extrudedHeight,p=e._perPositionHeightExtrude||!D.equalsEpsilon(f,d,0,D.EPSILON2),g,m;if(p)for(m=0;m<s.length;m++){if(a=m$e(t,s[m],u,r,o),a.geometry=ni.scaleToGeodeticHeightExtruded(a.geometry,f,d,t,r),l(e._offsetAttribute)){let b=a.geometry.attributes.position.values.length/3,x=new Uint8Array(b);e._offsetAttribute===mn.TOP?x=x.fill(1,0,b/2):(g=e._offsetAttribute===mn.NONE?0:1,x=x.fill(g)),a.geometry.attributes.applyOffset=new Ne({componentDatatype:Y.UNSIGNED_BYTE,componentsPerAttribute:1,values:x})}c.push(a)}else for(m=0;m<s.length;m++){if(a=h$e(t,s[m],u,r,o),a.geometry.attributes.position.values=fi.scaleToGeodeticHeight(a.geometry.attributes.position.values,f,t,!r),l(e._offsetAttribute)){let b=a.geometry.attributes.position.values.length;g=e._offsetAttribute===mn.NONE?0:1;let x=new Uint8Array(b/3).fill(g);a.geometry.attributes.applyOffset=new Ne({componentDatatype:Y.UNSIGNED_BYTE,componentsPerAttribute:1,values:x})}c.push(a)}let y=Hn.combineInstances(c)[0],A=ue.fromVertices(y.attributes.position.values);return new St({attributes:y.attributes,indices:y.indices,primitiveType:y.primitiveType,boundingSphere:A,offsetAttribute:e._offsetAttribute})};var TL=cT;var Eye="Entity polygons cannot have both height and perPositionHeight. height will be ignored",Cye="heightReference is not supported for entity polygons with perPositionHeight. heightReference will be ignored",vye=new z,Sye=h.ZERO,wye=new h,Iye=new ie,_$e=[],y$e=new U;function A$e(e){this.id=e,this.vertexFormat=void 0,this.polygonHierarchy=void 0,this.perPositionHeight=void 0,this.closeTop=void 0,this.closeBottom=void 0,this.height=void 0,this.extrudedHeight=void 0,this.granularity=void 0,this.stRotation=void 0,this.offsetAttribute=void 0,this.arcType=void 0,this.textureCoordinates=void 0}function kf(e,t){ii.call(this,{entity:e,scene:t,geometryOptions:new A$e(e),geometryPropertyName:"polygon",observedPropertyNames:["availability","polygon"]}),this._onEntityPropertyChanged(e,"polygon",e.polygon,void 0)}l(Object.create)&&(kf.prototype=Object.create(ii.prototype),kf.prototype.constructor=kf);kf.prototype.createFillGeometryInstance=function(e){let t=this._entity,n=t.isAvailable(e),i=this._options,r={show:new Dn(n&&t.isShowing&&this._showProperty.getValue(e)&&this._fillProperty.getValue(e)),distanceDisplayCondition:ti.fromDistanceDisplayCondition(this._distanceDisplayConditionProperty.getValue(e)),offset:void 0,color:void 0};if(this._materialProperty instanceof Kt){let s;l(this._materialProperty.color)&&(this._materialProperty.color.isConstant||n)&&(s=this._materialProperty.color.getValue(e,vye)),l(s)||(s=z.WHITE),r.color=Jt.fromColor(s)}l(i.offsetAttribute)&&(r.offset=Tr.fromCartesian3(X.getValueOrDefault(this._terrainOffsetProperty,e,Sye,wye)));let o;return i.perPositionHeight&&!l(i.extrudedHeight)?o=new xL(i):o=new qp(i),new Ft({id:t,geometry:o,attributes:r})};kf.prototype.createOutlineGeometryInstance=function(e){let t=this._entity,n=t.isAvailable(e),i=this._options,r=X.getValueOrDefault(this._outlineColorProperty,e,z.BLACK,vye),o=this._distanceDisplayConditionProperty.getValue(e),s={show:new Dn(n&&t.isShowing&&this._showProperty.getValue(e)&&this._showOutlineProperty.getValue(e)),color:Jt.fromColor(r),distanceDisplayCondition:ti.fromDistanceDisplayCondition(o),offset:void 0};l(i.offsetAttribute)&&(s.offset=Tr.fromCartesian3(X.getValueOrDefault(this._terrainOffsetProperty,e,Sye,wye)));let a;return i.perPositionHeight&&!l(i.extrudedHeight)?a=new jd(i):a=new TL(i),new Ft({id:t,geometry:a,attributes:s})};kf.prototype._computeCenter=function(e,t){let n=X.getValueOrUndefined(this._entity.polygon.hierarchy,e);if(!l(n))return;let i=n.positions;if(i.length===0)return;let r=this._scene.ellipsoid,o=js.fromPoints(i,r),s=o.projectPointsOntoPlane(i,_$e),a=s.length,c=0,u=a-1,f=new U;for(let p=0;p<a;u=p++){let g=s[p],m=s[u],y=g.x*m.y-m.x*g.y,A=U.add(g,m,y$e);A=U.multiplyByScalar(A,y,A),f=U.add(f,A,f),c+=y}let d=1/(c*3);return f=U.multiplyByScalar(f,d,f),o.projectPointOntoEllipsoid(f,t)};kf.prototype._isHidden=function(e,t){return!l(t.hierarchy)||Pi.prototype._isHidden.call(this,e,t)};kf.prototype._isOnTerrain=function(e,t){let n=ii.prototype._isOnTerrain.call(this,e,t),i=t.perPositionHeight,r=l(i)&&(i.isConstant?i.getValue(nt.MINIMUM_VALUE):!0);return n&&!r};kf.prototype._isDynamic=function(e,t){return!t.hierarchy.isConstant||!X.isConstant(t.height)||!X.isConstant(t.extrudedHeight)||!X.isConstant(t.granularity)||!X.isConstant(t.stRotation)||!X.isConstant(t.textureCoordinates)||!X.isConstant(t.outlineWidth)||!X.isConstant(t.perPositionHeight)||!X.isConstant(t.closeTop)||!X.isConstant(t.closeBottom)||!X.isConstant(t.zIndex)||!X.isConstant(t.arcType)||this._onTerrain&&!X.isConstant(this._materialProperty)&&!(this._materialProperty instanceof Kt)};kf.prototype._setStaticOptions=function(e,t){let n=this._materialProperty instanceof Kt,i=this._options;i.vertexFormat=n?yn.VERTEX_FORMAT:Er.MaterialSupport.TEXTURED.vertexFormat;let r=t.hierarchy.getValue(nt.MINIMUM_VALUE),o=X.getValueOrUndefined(t.height,nt.MINIMUM_VALUE),s=X.getValueOrDefault(t.heightReference,nt.MINIMUM_VALUE,We.NONE),a=X.getValueOrUndefined(t.extrudedHeight,nt.MINIMUM_VALUE),c=X.getValueOrDefault(t.extrudedHeightReference,nt.MINIMUM_VALUE,We.NONE),u=X.getValueOrDefault(t.perPositionHeight,nt.MINIMUM_VALUE,!1);o=ii.getGeometryHeight(o,s);let f;if(u?(l(o)&&(o=void 0,_t(Eye)),s!==We.NONE&&u&&(o=void 0,_t(Cye))):(l(a)&&!l(o)&&(o=0),f=ii.computeGeometryOffsetAttribute(o,s,a,c)),i.polygonHierarchy=r,i.granularity=X.getValueOrUndefined(t.granularity,nt.MINIMUM_VALUE),i.stRotation=X.getValueOrUndefined(t.stRotation,nt.MINIMUM_VALUE),i.perPositionHeight=u,i.closeTop=X.getValueOrDefault(t.closeTop,nt.MINIMUM_VALUE,!0),i.closeBottom=X.getValueOrDefault(t.closeBottom,nt.MINIMUM_VALUE,!0),i.offsetAttribute=f,i.height=o,i.arcType=X.getValueOrDefault(t.arcType,nt.MINIMUM_VALUE,ln.GEODESIC),i.textureCoordinates=X.getValueOrUndefined(t.textureCoordinates,nt.MINIMUM_VALUE),a=ii.getGeometryExtrudedHeight(a,c),a===ii.CLAMP_TO_GROUND){let d=qp.computeRectangleFromPositions(i.polygonHierarchy.positions,i.ellipsoid,i.arcType,Iye);a=Mi.getMinimumMaximumHeights(d).minimumTerrainHeight}i.extrudedHeight=a};kf.prototype._getIsClosed=function(e){let t=e.height,n=e.extrudedHeight,i=l(n)&&n!==t;return!e.perPositionHeight&&(!i&&t===0||i&&e.closeTop&&e.closeBottom)};kf.DynamicGeometryUpdater=hS;function hS(e,t,n){Ii.call(this,e,t,n)}l(Object.create)&&(hS.prototype=Object.create(Ii.prototype),hS.prototype.constructor=hS);hS.prototype._isHidden=function(e,t,n){return!l(this._options.polygonHierarchy)||Ii.prototype._isHidden.call(this,e,t,n)};hS.prototype._setOptions=function(e,t,n){let i=this._options;i.polygonHierarchy=X.getValueOrUndefined(t.hierarchy,n);let r=X.getValueOrUndefined(t.height,n),o=X.getValueOrDefault(t.heightReference,n,We.NONE),s=X.getValueOrDefault(t.extrudedHeightReference,n,We.NONE),a=X.getValueOrUndefined(t.extrudedHeight,n),c=X.getValueOrUndefined(t.perPositionHeight,n);r=ii.getGeometryHeight(r,s);let u;if(c?(l(r)&&(r=void 0,_t(Eye)),o!==We.NONE&&c&&(r=void 0,_t(Cye))):(l(a)&&!l(r)&&(r=0),u=ii.computeGeometryOffsetAttribute(r,o,a,s)),i.granularity=X.getValueOrUndefined(t.granularity,n),i.stRotation=X.getValueOrUndefined(t.stRotation,n),i.textureCoordinates=X.getValueOrUndefined(t.textureCoordinates,n),i.perPositionHeight=X.getValueOrUndefined(t.perPositionHeight,n),i.closeTop=X.getValueOrDefault(t.closeTop,n,!0),i.closeBottom=X.getValueOrDefault(t.closeBottom,n,!0),i.offsetAttribute=u,i.height=r,i.arcType=X.getValueOrDefault(t.arcType,n,ln.GEODESIC),a=ii.getGeometryExtrudedHeight(a,s),a===ii.CLAMP_TO_GROUND){let f=qp.computeRectangleFromPositions(i.polygonHierarchy.positions,i.ellipsoid,i.arcType,Iye);a=Mi.getMinimumMaximumHeights(f).minimumTerrainHeight}i.extrudedHeight=a};var EL=kf;function b$e(e,t,n,i){let r=new Tn;i.position&&(r.position=new Ne({componentDatatype:Y.DOUBLE,componentsPerAttribute:3,values:e}));let o=t.length,s=e.length/3,a=(s-o*2)/(o*2),c=fi.triangulate(t),u=(a-1)*o*6+c.length*2,f=je.createTypedArray(s,u),d,p,g,m,y,A,b=o*2,x=0;for(d=0;d<a-1;d++){for(p=0;p<o-1;p++)g=p*2+d*o*2,A=g+b,m=g+1,y=m+b,f[x++]=m,f[x++]=g,f[x++]=y,f[x++]=y,f[x++]=g,f[x++]=A;g=o*2-2+d*o*2,m=g+1,y=m+b,A=g+b,f[x++]=m,f[x++]=g,f[x++]=y,f[x++]=y,f[x++]=g,f[x++]=A}if(i.st||i.tangent||i.bitangent){let v=new Float32Array(s*2),S=1/(a-1),I=1/n.height,R=n.height/2,O,L,_=0;for(d=0;d<a;d++){for(O=d*S,L=I*(t[0].y+R),v[_++]=O,v[_++]=L,p=1;p<o;p++)L=I*(t[p].y+R),v[_++]=O,v[_++]=L,v[_++]=O,v[_++]=L;L=I*(t[0].y+R),v[_++]=O,v[_++]=L}for(p=0;p<o;p++)O=0,L=I*(t[p].y+R),v[_++]=O,v[_++]=L;for(p=0;p<o;p++)O=(a-1)*S,L=I*(t[p].y+R),v[_++]=O,v[_++]=L;r.st=new Ne({componentDatatype:Y.FLOAT,componentsPerAttribute:2,values:new Float32Array(v)})}let T=s-o*2;for(d=0;d<c.length;d+=3){let v=c[d]+T,S=c[d+1]+T,I=c[d+2]+T;f[x++]=v,f[x++]=S,f[x++]=I,f[x++]=I+o,f[x++]=S+o,f[x++]=v+o}let E=new St({attributes:r,indices:f,boundingSphere:ue.fromVertices(e),primitiveType:Oe.TRIANGLES});if(i.normal&&(E=Hn.computeNormal(E)),i.tangent||i.bitangent){try{E=Hn.computeTangentAndBitangent(E)}catch{_t("polyline-volume-tangent-bitangent","Unable to compute tangents and bitangents for polyline volume geometry")}i.tangent||(E.attributes.tangent=void 0),i.bitangent||(E.attributes.bitangent=void 0),i.st||(E.attributes.st=void 0)}return E}function vL(e){e=e??H.EMPTY_OBJECT;let t=e.polylinePositions,n=e.shapePositions;this._positions=t,this._shape=n,this._ellipsoid=ee.clone(e.ellipsoid??ee.default),this._cornerType=e.cornerType??tr.ROUNDED,this._vertexFormat=Be.clone(e.vertexFormat??Be.DEFAULT),this._granularity=e.granularity??D.RADIANS_PER_DEGREE,this._workerName="createPolylineVolumeGeometry";let i=1+t.length*h.packedLength;i+=1+n.length*U.packedLength,this.packedLength=i+ee.packedLength+Be.packedLength+2}vL.pack=function(e,t,n){n=n??0;let i,r=e._positions,o=r.length;for(t[n++]=o,i=0;i<o;++i,n+=h.packedLength)h.pack(r[i],t,n);let s=e._shape;for(o=s.length,t[n++]=o,i=0;i<o;++i,n+=U.packedLength)U.pack(s[i],t,n);return ee.pack(e._ellipsoid,t,n),n+=ee.packedLength,Be.pack(e._vertexFormat,t,n),n+=Be.packedLength,t[n++]=e._cornerType,t[n]=e._granularity,t};var Pye=ee.clone(ee.UNIT_SPHERE),Dye=new Be,CL={polylinePositions:void 0,shapePositions:void 0,ellipsoid:Pye,vertexFormat:Dye,cornerType:void 0,granularity:void 0};vL.unpack=function(e,t,n){t=t??0;let i,r=e[t++],o=new Array(r);for(i=0;i<r;++i,t+=h.packedLength)o[i]=h.unpack(e,t);r=e[t++];let s=new Array(r);for(i=0;i<r;++i,t+=U.packedLength)s[i]=U.unpack(e,t);let a=ee.unpack(e,t,Pye);t+=ee.packedLength;let c=Be.unpack(e,t,Dye);t+=Be.packedLength;let u=e[t++],f=e[t];return l(n)?(n._positions=o,n._shape=s,n._ellipsoid=ee.clone(a,n._ellipsoid),n._vertexFormat=Be.clone(c,n._vertexFormat),n._cornerType=u,n._granularity=f,n):(CL.polylinePositions=o,CL.shapePositions=s,CL.cornerType=u,CL.granularity=f,new vL(CL))};var x$e=new et;vL.createGeometry=function(e){let t=e._positions,n=Fr(t,h.equalsEpsilon),i=e._shape;if(i=cm.removeDuplicatesFromShape(i),n.length<2||i.length<3)return;fi.computeWindingOrder2D(i)===Qs.CLOCKWISE&&i.reverse();let r=et.fromPoints(i,x$e),o=cm.computePositions(n,i,r,e,!0);return b$e(o,i,r,e._vertexFormat)};var SL=vL;function T$e(e,t){let n=new Tn;n.position=new Ne({componentDatatype:Y.DOUBLE,componentsPerAttribute:3,values:e});let i=t.length,r=n.position.values.length/3,s=e.length/3/i,a=je.createTypedArray(r,2*i*(s+1)),c,u,f=0;c=0;let d=c*i;for(u=0;u<i-1;u++)a[f++]=u+d,a[f++]=u+d+1;for(a[f++]=i-1+d,a[f++]=d,c=s-1,d=c*i,u=0;u<i-1;u++)a[f++]=u+d,a[f++]=u+d+1;for(a[f++]=i-1+d,a[f++]=d,c=0;c<s-1;c++){let g=i*c,m=g+i;for(u=0;u<i;u++)a[f++]=u+g,a[f++]=u+m}return new St({attributes:n,indices:je.createTypedArray(r,a),boundingSphere:ue.fromVertices(e),primitiveType:Oe.LINES})}function IL(e){e=e??H.EMPTY_OBJECT;let t=e.polylinePositions,n=e.shapePositions;this._positions=t,this._shape=n,this._ellipsoid=ee.clone(e.ellipsoid??ee.default),this._cornerType=e.cornerType??tr.ROUNDED,this._granularity=e.granularity??D.RADIANS_PER_DEGREE,this._workerName="createPolylineVolumeOutlineGeometry";let i=1+t.length*h.packedLength;i+=1+n.length*U.packedLength,this.packedLength=i+ee.packedLength+2}IL.pack=function(e,t,n){n=n??0;let i,r=e._positions,o=r.length;for(t[n++]=o,i=0;i<o;++i,n+=h.packedLength)h.pack(r[i],t,n);let s=e._shape;for(o=s.length,t[n++]=o,i=0;i<o;++i,n+=U.packedLength)U.pack(s[i],t,n);return ee.pack(e._ellipsoid,t,n),n+=ee.packedLength,t[n++]=e._cornerType,t[n]=e._granularity,t};var Rye=ee.clone(ee.UNIT_SPHERE),wL={polylinePositions:void 0,shapePositions:void 0,ellipsoid:Rye,height:void 0,cornerType:void 0,granularity:void 0};IL.unpack=function(e,t,n){t=t??0;let i,r=e[t++],o=new Array(r);for(i=0;i<r;++i,t+=h.packedLength)o[i]=h.unpack(e,t);r=e[t++];let s=new Array(r);for(i=0;i<r;++i,t+=U.packedLength)s[i]=U.unpack(e,t);let a=ee.unpack(e,t,Rye);t+=ee.packedLength;let c=e[t++],u=e[t];return l(n)?(n._positions=o,n._shape=s,n._ellipsoid=ee.clone(a,n._ellipsoid),n._cornerType=c,n._granularity=u,n):(wL.polylinePositions=o,wL.shapePositions=s,wL.cornerType=c,wL.granularity=u,new IL(wL))};var E$e=new et;IL.createGeometry=function(e){let t=e._positions,n=Fr(t,h.equalsEpsilon),i=e._shape;if(i=cm.removeDuplicatesFromShape(i),n.length<2||i.length<3)return;fi.computeWindingOrder2D(i)===Qs.CLOCKWISE&&i.reverse();let r=et.fromPoints(i,E$e),o=cm.computePositions(n,i,r,e,!1);return T$e(o,i)};var PL=IL;var Oye=new z;function C$e(e){this.id=e,this.vertexFormat=void 0,this.polylinePositions=void 0,this.shapePositions=void 0,this.cornerType=void 0,this.granularity=void 0}function Yp(e,t){Pi.call(this,{entity:e,scene:t,geometryOptions:new C$e(e),geometryPropertyName:"polylineVolume",observedPropertyNames:["availability","polylineVolume"]}),this._onEntityPropertyChanged(e,"polylineVolume",e.polylineVolume,void 0)}l(Object.create)&&(Yp.prototype=Object.create(Pi.prototype),Yp.prototype.constructor=Yp);Yp.prototype.createFillGeometryInstance=function(e){let t=this._entity,n=t.isAvailable(e),i,r,o=new Dn(n&&t.isShowing&&this._showProperty.getValue(e)&&this._fillProperty.getValue(e)),s=this._distanceDisplayConditionProperty.getValue(e),a=ti.fromDistanceDisplayCondition(s);if(this._materialProperty instanceof Kt){let c;l(this._materialProperty.color)&&(this._materialProperty.color.isConstant||n)&&(c=this._materialProperty.color.getValue(e,Oye)),l(c)||(c=z.WHITE),r=Jt.fromColor(c),i={show:o,distanceDisplayCondition:a,color:r}}else i={show:o,distanceDisplayCondition:a};return new Ft({id:t,geometry:new SL(this._options),attributes:i})};Yp.prototype.createOutlineGeometryInstance=function(e){let t=this._entity,n=t.isAvailable(e),i=X.getValueOrDefault(this._outlineColorProperty,e,z.BLACK,Oye),r=this._distanceDisplayConditionProperty.getValue(e);return new Ft({id:t,geometry:new PL(this._options),attributes:{show:new Dn(n&&t.isShowing&&this._showProperty.getValue(e)&&this._showOutlineProperty.getValue(e)),color:Jt.fromColor(i),distanceDisplayCondition:ti.fromDistanceDisplayCondition(r)}})};Yp.prototype._isHidden=function(e,t){return!l(t.positions)||!l(t.shape)||Pi.prototype._isHidden.call(this,e,t)};Yp.prototype._isDynamic=function(e,t){return!t.positions.isConstant||!t.shape.isConstant||!X.isConstant(t.granularity)||!X.isConstant(t.outlineWidth)||!X.isConstant(t.cornerType)};Yp.prototype._setStaticOptions=function(e,t){let n=t.granularity,i=t.cornerType,r=this._options,o=this._materialProperty instanceof Kt;r.vertexFormat=o?yn.VERTEX_FORMAT:Er.MaterialSupport.TEXTURED.vertexFormat,r.polylinePositions=t.positions.getValue(nt.MINIMUM_VALUE,r.polylinePositions),r.shapePositions=t.shape.getValue(nt.MINIMUM_VALUE,r.shape),r.granularity=l(n)?n.getValue(nt.MINIMUM_VALUE):void 0,r.cornerType=l(i)?i.getValue(nt.MINIMUM_VALUE):void 0};Yp.DynamicGeometryUpdater=mS;function mS(e,t,n){Ii.call(this,e,t,n)}l(Object.create)&&(mS.prototype=Object.create(Ii.prototype),mS.prototype.constructor=mS);mS.prototype._isHidden=function(e,t,n){let i=this._options;return!l(i.polylinePositions)||!l(i.shapePositions)||Ii.prototype._isHidden.call(this,e,t,n)};mS.prototype._setOptions=function(e,t,n){let i=this._options;i.polylinePositions=X.getValueOrUndefined(t.positions,n,i.polylinePositions),i.shapePositions=X.getValueOrUndefined(t.shape,n),i.granularity=X.getValueOrUndefined(t.granularity,n),i.cornerType=X.getValueOrUndefined(t.cornerType,n)};var DL=Yp;var Mye=Math.cos,Nye=Math.sin,v$e=Math.sqrt,I$={};I$.computePosition=function(e,t,n,i,r,o,s){let a=t.radiiSquared,c=e.nwCorner,u=e.boundingRectangle,f=c.latitude-e.granYCos*i+r*e.granXSin,d=Mye(f),p=Nye(f),g=a.z*p,m=c.longitude+i*e.granYSin+r*e.granXCos,y=d*Mye(m),A=d*Nye(m),b=a.x*y,x=a.y*A,T=v$e(b*y+x*A+g*p);if(o.x=b/T,o.y=x/T,o.z=g/T,n){let E=e.stNwCorner;l(E)?(f=E.latitude-e.stGranYCos*i+r*e.stGranXSin,m=E.longitude+i*e.stGranYSin+r*e.stGranXCos,s.x=(m-e.stWest)*e.lonScalar,s.y=(f-e.stSouth)*e.latScalar):(s.x=(m-u.west)*e.lonScalar,s.y=(f-u.south)*e.latScalar)}};var S$e=new Xi,Wd=new h,w$e=new he,fH=new h,RL=new Ui;function Lye(e,t,n,i,r,o,s){let a=Math.cos(t),c=i*a,u=n*a,f=Math.sin(t),d=i*f,p=n*f;RL._ellipsoid=ee.default,Wd=RL.project(e,Wd),Wd=h.subtract(Wd,fH,Wd);let g=Xi.fromRotation(t,S$e);Wd=Xi.multiplyByVector(g,Wd,Wd),Wd=h.add(Wd,fH,Wd),e=RL.unproject(Wd,e),o-=1,s-=1;let m=e.latitude,y=m+o*p,A=m-c*s,b=m-c*s+o*p,x=Math.max(m,y,A,b),T=Math.min(m,y,A,b),E=e.longitude,v=E+o*u,S=E+s*d,I=E+s*d+o*u,R=Math.max(E,v,S,I),O=Math.min(E,v,S,I);return{north:x,south:T,east:R,west:O,granYCos:c,granYSin:d,granXCos:u,granXSin:p,nwCorner:e}}I$.computeOptions=function(e,t,n,i,r,o,s){let a=e.east,c=e.west,u=e.north,f=e.south,d=!1,p=!1;u===D.PI_OVER_TWO&&(d=!0),f===-D.PI_OVER_TWO&&(p=!0);let g,m=u-f;c>a?g=D.TWO_PI-c+a:g=a-c;let y=Math.ceil(g/t)+1,A=Math.ceil(m/t)+1,b=g/(y-1),x=m/(A-1),T=ie.northwest(e,o),E=ie.center(e,w$e);(n!==0||i!==0)&&(E.longitude<T.longitude&&(E.longitude+=D.TWO_PI),RL._ellipsoid=ee.default,fH=RL.project(E,fH));let v=x,S=b,I=0,R=0,O=ie.clone(e,r),L={granYCos:v,granYSin:I,granXCos:S,granXSin:R,nwCorner:T,boundingRectangle:O,width:y,height:A,northCap:d,southCap:p};if(n!==0){let _=Lye(T,n,b,x,E,y,A);u=_.north,f=_.south,a=_.east,c=_.west,L.granYCos=_.granYCos,L.granYSin=_.granYSin,L.granXCos=_.granXCos,L.granXSin=_.granXSin,O.north=u,O.south=f,O.east=a,O.west=c}if(i!==0){n=n-i;let _=ie.northwest(O,s),C=Lye(_,n,b,x,E,y,A);L.stGranYCos=C.granYCos,L.stGranXCos=C.granXCos,L.stGranYSin=C.granYSin,L.stGranXSin=C.granXSin,L.stNwCorner=_,L.stWest=C.west,L.stSouth=C.south}return L};var ya=I$;var P$=new h,kye=new h,Uye=new h,zye=new h,Vye=new ie,I$e=new U,P$e=new ue,D$e=new ue;function jye(e,t){let n=new St({attributes:new Tn,primitiveType:Oe.TRIANGLES});return n.attributes.position=new Ne({componentDatatype:Y.DOUBLE,componentsPerAttribute:3,values:t.positions}),e.normal&&(n.attributes.normal=new Ne({componentDatatype:Y.FLOAT,componentsPerAttribute:3,values:t.normals})),e.tangent&&(n.attributes.tangent=new Ne({componentDatatype:Y.FLOAT,componentsPerAttribute:3,values:t.tangents})),e.bitangent&&(n.attributes.bitangent=new Ne({componentDatatype:Y.FLOAT,componentsPerAttribute:3,values:t.bitangents})),n}function R$e(e,t,n,i){let r=e.length,o=t.normal?new Float32Array(r):void 0,s=t.tangent?new Float32Array(r):void 0,a=t.bitangent?new Float32Array(r):void 0,c=0,u=zye,f=Uye,d=kye;if(t.normal||t.tangent||t.bitangent)for(let p=0;p<r;p+=3){let g=h.fromArray(e,p,P$),m=c+1,y=c+2;d=n.geodeticSurfaceNormal(g,d),(t.tangent||t.bitangent)&&(h.cross(h.UNIT_Z,d,f),$.multiplyByVector(i,f,f),h.normalize(f,f),t.bitangent&&h.normalize(h.cross(d,f,u),u)),t.normal&&(o[c]=d.x,o[m]=d.y,o[y]=d.z),t.tangent&&(s[c]=f.x,s[m]=f.y,s[y]=f.z),t.bitangent&&(a[c]=u.x,a[m]=u.y,a[y]=u.z),c+=3}return jye(t,{positions:e,normals:o,tangents:s,bitangents:a})}var D$=new h,Hye=new h;function O$e(e,t,n){let i=e.length,r=t.normal?new Float32Array(i):void 0,o=t.tangent?new Float32Array(i):void 0,s=t.bitangent?new Float32Array(i):void 0,a=0,c=0,u=0,f=!0,d=zye,p=Uye,g=kye;if(t.normal||t.tangent||t.bitangent)for(let m=0;m<i;m+=6){let y=h.fromArray(e,m,P$),A=h.fromArray(e,(m+6)%i,D$);if(f){let b=h.fromArray(e,(m+3)%i,Hye);h.subtract(A,y,A),h.subtract(b,y,b),g=h.normalize(h.cross(b,A,g),g),f=!1}h.equalsEpsilon(A,y,D.EPSILON10)&&(f=!0),(t.tangent||t.bitangent)&&(d=n.geodeticSurfaceNormal(y,d),t.tangent&&(p=h.normalize(h.cross(d,g,p),p))),t.normal&&(r[a++]=g.x,r[a++]=g.y,r[a++]=g.z,r[a++]=g.x,r[a++]=g.y,r[a++]=g.z),t.tangent&&(o[c++]=p.x,o[c++]=p.y,o[c++]=p.z,o[c++]=p.x,o[c++]=p.y,o[c++]=p.z),t.bitangent&&(s[u++]=d.x,s[u++]=d.y,s[u++]=d.z,s[u++]=d.x,s[u++]=d.y,s[u++]=d.z)}return jye(t,{positions:e,normals:r,tangents:o,bitangents:s})}function Gye(e,t){let n=e._vertexFormat,i=e._ellipsoid,r=t.height,o=t.width,s=t.northCap,a=t.southCap,c=0,u=r,f=r,d=0;s&&(c=1,f-=1,d+=1),a&&(u-=1,f-=1,d+=1),d+=o*f;let p=n.position?new Float64Array(d*3):void 0,g=n.st?new Float32Array(d*2):void 0,m=0,y=0,A=P$,b=I$e,x=Number.MAX_VALUE,T=Number.MAX_VALUE,E=-Number.MAX_VALUE,v=-Number.MAX_VALUE;for(let C=c;C<u;++C)for(let w=0;w<o;++w)ya.computePosition(t,i,n.st,C,w,A,b),p[m++]=A.x,p[m++]=A.y,p[m++]=A.z,n.st&&(g[y++]=b.x,g[y++]=b.y,x=Math.min(x,b.x),T=Math.min(T,b.y),E=Math.max(E,b.x),v=Math.max(v,b.y));if(s&&(ya.computePosition(t,i,n.st,0,0,A,b),p[m++]=A.x,p[m++]=A.y,p[m++]=A.z,n.st&&(g[y++]=b.x,g[y++]=b.y,x=b.x,T=b.y,E=b.x,v=b.y)),a&&(ya.computePosition(t,i,n.st,r-1,0,A,b),p[m++]=A.x,p[m++]=A.y,p[m]=A.z,n.st&&(g[y++]=b.x,g[y]=b.y,x=Math.min(x,b.x),T=Math.min(T,b.y),E=Math.max(E,b.x),v=Math.max(v,b.y))),n.st&&(x<0||T<0||E>1||v>1))for(let C=0;C<g.length;C+=2)g[C]=(g[C]-x)/(E-x),g[C+1]=(g[C+1]-T)/(v-T);let S=R$e(p,n,i,t.tangentRotationMatrix),I=6*(o-1)*(f-1);s&&(I+=3*(o-1)),a&&(I+=3*(o-1));let R=je.createTypedArray(d,I),O=0,L=0,_;for(_=0;_<f-1;++_){for(let C=0;C<o-1;++C){let w=O,P=w+o,M=P+1,F=w+1;R[L++]=w,R[L++]=P,R[L++]=F,R[L++]=F,R[L++]=P,R[L++]=M,++O}++O}if(s||a){let C=d-1,w=d-1;s&&a&&(C=d-2);let P,M;if(O=0,s)for(_=0;_<o-1;_++)P=O,M=P+1,R[L++]=C,R[L++]=P,R[L++]=M,++O;if(a)for(O=(f-1)*o,_=0;_<o-1;_++)P=O,M=P+1,R[L++]=P,R[L++]=w,R[L++]=M,++O}return S.indices=R,n.st&&(S.attributes.st=new Ne({componentDatatype:Y.FLOAT,componentsPerAttribute:2,values:g})),S}function pS(e,t,n,i,r){return e[t++]=i[n],e[t++]=i[n+1],e[t++]=i[n+2],e[t++]=r[n],e[t++]=r[n+1],e[t]=r[n+2],e}function gS(e,t,n,i){return e[t++]=i[n],e[t++]=i[n+1],e[t++]=i[n],e[t]=i[n+1],e}var R$=new Be;function M$e(e,t){let n=e._shadowVolume,i=e._offsetAttribute,r=e._vertexFormat,o=e._extrudedHeight,s=e._surfaceHeight,a=e._ellipsoid,c=t.height,u=t.width,f;if(n){let Pe=Be.clone(r,R$);Pe.normal=!0,e._vertexFormat=Pe}let d=Gye(e,t);n&&(e._vertexFormat=r);let p=fi.scaleToGeodeticHeight(d.attributes.position.values,s,a,!1);p=new Float64Array(p);let g=p.length,m=g*2,y=new Float64Array(m);y.set(p);let A=fi.scaleToGeodeticHeight(d.attributes.position.values,o,a);y.set(A,g),d.attributes.position.values=y;let b=r.normal?new Float32Array(m):void 0,x=r.tangent?new Float32Array(m):void 0,T=r.bitangent?new Float32Array(m):void 0,E=r.st?new Float32Array(m/3*2):void 0,v,S;if(r.normal){for(S=d.attributes.normal.values,b.set(S),f=0;f<g;f++)S[f]=-S[f];b.set(S,g),d.attributes.normal.values=b}if(n){S=d.attributes.normal.values,r.normal||(d.attributes.normal=void 0);let Pe=new Float32Array(m);for(f=0;f<g;f++)S[f]=-S[f];Pe.set(S,g),d.attributes.extrudeDirection=new Ne({componentDatatype:Y.FLOAT,componentsPerAttribute:3,values:Pe})}let I,R=l(i);if(R){let Pe=g/3*2,qe=new Uint8Array(Pe);i===mn.TOP?qe=qe.fill(1,0,Pe/2):(I=i===mn.NONE?0:1,qe=qe.fill(I)),d.attributes.applyOffset=new Ne({componentDatatype:Y.UNSIGNED_BYTE,componentsPerAttribute:1,values:qe})}if(r.tangent){let Pe=d.attributes.tangent.values;for(x.set(Pe),f=0;f<g;f++)Pe[f]=-Pe[f];x.set(Pe,g),d.attributes.tangent.values=x}if(r.bitangent){let Pe=d.attributes.bitangent.values;T.set(Pe),T.set(Pe,g),d.attributes.bitangent.values=T}r.st&&(v=d.attributes.st.values,E.set(v),E.set(v,g/3*2),d.attributes.st.values=E);let O=d.indices,L=O.length,_=g/3,C=je.createTypedArray(m/3,L*2);for(C.set(O),f=0;f<L;f+=3)C[f+L]=O[f+2]+_,C[f+1+L]=O[f+1]+_,C[f+2+L]=O[f]+_;d.indices=C;let w=t.northCap,P=t.southCap,M=c,F=2,V=0,B=4,j=4;w&&(F-=1,M-=1,V+=1,B-=2,j-=1),P&&(F-=1,M-=1,V+=1,B-=2,j-=1),V+=F*u+2*M-B;let k=(V+j)*2,G=new Float64Array(k*3),q=n?new Float32Array(k*3):void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]=S[ge+2]),J&&(Q[fe++]=1,fe+=1);let we=O$e(G,r,a);r.st&&(we.attributes.st=new Ne({componentDatatype:Y.FLOAT,componentsPerAttribute:2,values:W})),n&&(we.attributes.extrudeDirection=new Ne({componentDatatype:Y.FLOAT,componentsPerAttribute:3,values:q})),R&&(we.attributes.applyOffset=new Ne({componentDatatype:Y.UNSIGNED_BYTE,componentsPerAttribute:1,values:Q}));let Se=je.createTypedArray(k,V*6),Re,Qe,He,Xe;g=G.length/3;let $e=0;for(f=0;f<g-1;f+=2){Re=f,Xe=(Re+2)%g;let Pe=h.fromArray(G,Re*3,D$),qe=h.fromArray(G,Xe*3,Hye);h.equalsEpsilon(Pe,qe,D.EPSILON10)||(Qe=(Re+1)%g,He=(Qe+2)%g,Se[$e++]=Re,Se[$e++]=Qe,Se[$e++]=Xe,Se[$e++]=Xe,Se[$e++]=Qe,Se[$e++]=He)}return we.indices=Se,we=Hn.combineInstances([new Ft({geometry:d}),new Ft({geometry:we})]),we[0]}var N$e=[new h,new h,new h,new h],Wye=new he,L$e=new he;function O$(e,t,n,i,r){if(n===0)return ie.clone(e,r);let o=ya.computeOptions(e,t,n,0,Vye,Wye),s=o.height,a=o.width,c=N$e;return ya.computePosition(o,i,!1,0,0,c[0]),ya.computePosition(o,i,!1,0,a-1,c[1]),ya.computePosition(o,i,!1,s-1,0,c[2]),ya.computePosition(o,i,!1,s-1,a-1,c[3]),ie.fromCartesianArray(c,i,r)}function Xp(e){e=e??H.EMPTY_OBJECT;let t=e.rectangle,n=e.height??0,i=e.extrudedHeight??n;this._rectangle=ie.clone(t),this._granularity=e.granularity??D.RADIANS_PER_DEGREE,this._ellipsoid=ee.clone(e.ellipsoid??ee.default),this._surfaceHeight=Math.max(n,i),this._rotation=e.rotation??0,this._stRotation=e.stRotation??0,this._vertexFormat=Be.clone(e.vertexFormat??Be.DEFAULT),this._extrudedHeight=Math.min(n,i),this._shadowVolume=e.shadowVolume??!1,this._workerName="createRectangleGeometry",this._offsetAttribute=e.offsetAttribute,this._rotatedRectangle=void 0,this._textureCoordinateRotationPoints=void 0}Xp.packedLength=ie.packedLength+ee.packedLength+Be.packedLength+7;Xp.pack=function(e,t,n){return n=n??0,ie.pack(e._rectangle,t,n),n+=ie.packedLength,ee.pack(e._ellipsoid,t,n),n+=ee.packedLength,Be.pack(e._vertexFormat,t,n),n+=Be.packedLength,t[n++]=e._granularity,t[n++]=e._surfaceHeight,t[n++]=e._rotation,t[n++]=e._stRotation,t[n++]=e._extrudedHeight,t[n++]=e._shadowVolume?1:0,t[n]=e._offsetAttribute??-1,t};var qye=new ie,Yye=ee.clone(ee.UNIT_SPHERE),cA={rectangle:qye,ellipsoid:Yye,vertexFormat:R$,granularity:void 0,height:void 0,rotation:void 0,stRotation:void 0,extrudedHeight:void 0,shadowVolume:void 0,offsetAttribute:void 0};Xp.unpack=function(e,t,n){t=t??0;let i=ie.unpack(e,t,qye);t+=ie.packedLength;let r=ee.unpack(e,t,Yye);t+=ee.packedLength;let o=Be.unpack(e,t,R$);t+=Be.packedLength;let s=e[t++],a=e[t++],c=e[t++],u=e[t++],f=e[t++],d=e[t++]===1,p=e[t];return l(n)?(n._rectangle=ie.clone(i,n._rectangle),n._ellipsoid=ee.clone(r,n._ellipsoid),n._vertexFormat=Be.clone(o,n._vertexFormat),n._granularity=s,n._surfaceHeight=a,n._rotation=c,n._stRotation=u,n._extrudedHeight=f,n._shadowVolume=d,n._offsetAttribute=p===-1?void 0:p,n):(cA.granularity=s,cA.height=a,cA.rotation=c,cA.stRotation=u,cA.extrudedHeight=f,cA.shadowVolume=d,cA.offsetAttribute=p===-1?void 0:p,new Xp(cA))};Xp.computeRectangle=function(e,t){e=e??H.EMPTY_OBJECT;let n=e.rectangle,i=e.granularity??D.RADIANS_PER_DEGREE,r=e.ellipsoid??ee.default,o=e.rotation??0;return O$(n,i,o,r,t)};var F$e=new $,Fye=new Le,B$e=new he;Xp.createGeometry=function(e){if(D.equalsEpsilon(e._rectangle.north,e._rectangle.south,D.EPSILON10)||D.equalsEpsilon(e._rectangle.east,e._rectangle.west,D.EPSILON10))return;let t=e._rectangle,n=e._ellipsoid,i=e._rotation,r=e._stRotation,o=e._vertexFormat,s=ya.computeOptions(t,e._granularity,i,r,Vye,Wye,L$e),a=F$e;if(r!==0||i!==0){let g=ie.center(t,B$e),m=n.geodeticSurfaceNormalCartographic(g,D$);Le.fromAxisAngle(m,-r,Fye),$.fromQuaternion(Fye,a)}else $.clone($.IDENTITY,a);let c=e._surfaceHeight,u=e._extrudedHeight,f=!D.equalsEpsilon(c,u,0,D.EPSILON2);s.lonScalar=1/e._rectangle.width,s.latScalar=1/e._rectangle.height,s.tangentRotationMatrix=a;let d,p;if(t=e._rectangle,f){d=M$e(e,s);let g=ue.fromRectangle3D(t,n,c,D$e),m=ue.fromRectangle3D(t,n,u,P$e);p=ue.union(g,m)}else{if(d=Gye(e,s),d.attributes.position.values=fi.scaleToGeodeticHeight(d.attributes.position.values,c,n,!1),l(e._offsetAttribute)){let g=d.attributes.position.values.length,m=e._offsetAttribute===mn.NONE?0:1,y=new Uint8Array(g/3).fill(m);d.attributes.applyOffset=new Ne({componentDatatype:Y.UNSIGNED_BYTE,componentsPerAttribute:1,values:y})}p=ue.fromRectangle3D(t,n,c)}return o.position||delete d.attributes.position,new St({attributes:d.attributes,indices:d.indices,primitiveType:d.primitiveType,boundingSphere:p,offsetAttribute:e._offsetAttribute})};Xp.createShadowVolume=function(e,t,n){let i=e._granularity,r=e._ellipsoid,o=t(i,r),s=n(i,r);return new Xp({rectangle:e._rectangle,rotation:e._rotation,ellipsoid:r,stRotation:e._stRotation,granularity:i,extrudedHeight:s,height:o,vertexFormat:Be.POSITION_ONLY,shadowVolume:!0})};var Bye=new ie,k$e=[new U,new U,new U],U$e=new Xi,z$e=new he;function V$e(e){if(e._stRotation===0)return[0,0,0,1,1,0];let t=ie.clone(e._rectangle,Bye),n=e._granularity,i=e._ellipsoid,r=e._rotation-e._stRotation,o=O$(t,n,r,i,Bye),s=k$e;s[0].x=o.west,s[0].y=o.south,s[1].x=o.west,s[1].y=o.north,s[2].x=o.east,s[2].y=o.south;let a=e.rectangle,c=Xi.fromRotation(e._stRotation,U$e),u=ie.center(a,z$e);for(let m=0;m<3;++m){let y=s[m];y.x-=u.longitude,y.y-=u.latitude,Xi.multiplyByVector(c,y,y),y.x+=u.longitude,y.y+=u.latitude,y.x=(y.x-a.west)/a.width,y.y=(y.y-a.south)/a.height}let f=s[0],d=s[1],p=s[2],g=new Array(6);return U.pack(f,g),U.pack(d,g,2),U.pack(p,g,4),g}Object.defineProperties(Xp.prototype,{rectangle:{get:function(){return l(this._rotatedRectangle)||(this._rotatedRectangle=O$(this._rectangle,this._granularity,this._rotation,this._ellipsoid)),this._rotatedRectangle}},textureCoordinateRotationPoints:{get:function(){return l(this._textureCoordinateRotationPoints)||(this._textureCoordinateRotationPoints=V$e(this)),this._textureCoordinateRotationPoints}}});var lT=Xp;var j$e=new ue,H$e=new ue,G$e=new h,W$e=new ie;function Xye(e,t){let n=e._ellipsoid,i=t.height,r=t.width,o=t.northCap,s=t.southCap,a=i,c=2,u=0,f=4;o&&(c-=1,a-=1,u+=1,f-=2),s&&(c-=1,a-=1,u+=1,f-=2),u+=c*r+2*a-f;let d=new Float64Array(u*3),p=0,g=0,m,y=G$e;if(o)ya.computePosition(t,n,!1,g,0,y),d[p++]=y.x,d[p++]=y.y,d[p++]=y.z;else for(m=0;m<r;m++)ya.computePosition(t,n,!1,g,m,y),d[p++]=y.x,d[p++]=y.y,d[p++]=y.z;for(m=r-1,g=1;g<i;g++)ya.computePosition(t,n,!1,g,m,y),d[p++]=y.x,d[p++]=y.y,d[p++]=y.z;if(g=i-1,!s)for(m=r-2;m>=0;m--)ya.computePosition(t,n,!1,g,m,y),d[p++]=y.x,d[p++]=y.y,d[p++]=y.z;for(m=0,g=i-2;g>0;g--)ya.computePosition(t,n,!1,g,m,y),d[p++]=y.x,d[p++]=y.y,d[p++]=y.z;let A=d.length/3*2,b=je.createTypedArray(d.length/3,A),x=0;for(let E=0;E<d.length/3-1;E++)b[x++]=E,b[x++]=E+1;b[x++]=d.length/3-1,b[x]=0;let T=new St({attributes:new Tn,primitiveType:Oe.LINES});return T.attributes.position=new Ne({componentDatatype:Y.DOUBLE,componentsPerAttribute:3,values:d}),T.indices=b,T}function q$e(e,t){let n=e._surfaceHeight,i=e._extrudedHeight,r=e._ellipsoid,o=Xye(e,t),s=t.height,a=t.width,c=fi.scaleToGeodeticHeight(o.attributes.position.values,n,r,!1),u=c.length,f=new Float64Array(u*2);f.set(c);let d=fi.scaleToGeodeticHeight(o.attributes.position.values,i,r);f.set(d,u),o.attributes.position.values=f;let p=t.northCap,g=t.southCap,m=4;p&&(m-=1),g&&(m-=1);let y=(f.length/3+m)*2,A=je.createTypedArray(f.length/3,y);u=f.length/6;let b=0;for(let T=0;T<u-1;T++)A[b++]=T,A[b++]=T+1,A[b++]=T+u,A[b++]=T+u+1;A[b++]=u-1,A[b++]=0,A[b++]=u+u-1,A[b++]=u,A[b++]=0,A[b++]=u;let x;if(p)x=s-1;else{let T=a-1;A[b++]=T,A[b++]=T+u,x=a+s-2}if(A[b++]=x,A[b++]=x+u,!g){let T=a+x-1;A[b++]=T,A[b]=T+u}return o.indices=A,o}function yS(e){e=e??H.EMPTY_OBJECT;let t=e.rectangle,n=e.granularity??D.RADIANS_PER_DEGREE,i=e.ellipsoid??ee.default,r=e.rotation??0,o=e.height??0,s=e.extrudedHeight??o;this._rectangle=ie.clone(t),this._granularity=n,this._ellipsoid=i,this._surfaceHeight=Math.max(o,s),this._rotation=r,this._extrudedHeight=Math.min(o,s),this._offsetAttribute=e.offsetAttribute,this._workerName="createRectangleOutlineGeometry"}yS.packedLength=ie.packedLength+ee.packedLength+5;yS.pack=function(e,t,n){return n=n??0,ie.pack(e._rectangle,t,n),n+=ie.packedLength,ee.pack(e._ellipsoid,t,n),n+=ee.packedLength,t[n++]=e._granularity,t[n++]=e._surfaceHeight,t[n++]=e._rotation,t[n++]=e._extrudedHeight,t[n]=e._offsetAttribute??-1,t};var Kye=new ie,$ye=ee.clone(ee.UNIT_SPHERE),_S={rectangle:Kye,ellipsoid:$ye,granularity:void 0,height:void 0,rotation:void 0,extrudedHeight:void 0,offsetAttribute:void 0};yS.unpack=function(e,t,n){t=t??0;let i=ie.unpack(e,t,Kye);t+=ie.packedLength;let r=ee.unpack(e,t,$ye);t+=ee.packedLength;let o=e[t++],s=e[t++],a=e[t++],c=e[t++],u=e[t];return l(n)?(n._rectangle=ie.clone(i,n._rectangle),n._ellipsoid=ee.clone(r,n._ellipsoid),n._surfaceHeight=s,n._rotation=a,n._extrudedHeight=c,n._offsetAttribute=u===-1?void 0:u,n):(_S.granularity=o,_S.height=s,_S.rotation=a,_S.extrudedHeight=c,_S.offsetAttribute=u===-1?void 0:u,new yS(_S))};var Y$e=new he;yS.createGeometry=function(e){let t=e._rectangle,n=e._ellipsoid,i=ya.computeOptions(t,e._granularity,e._rotation,0,W$e,Y$e),r,o;if(D.equalsEpsilon(t.north,t.south,D.EPSILON10)||D.equalsEpsilon(t.east,t.west,D.EPSILON10))return;let s=e._surfaceHeight,a=e._extrudedHeight,c=!D.equalsEpsilon(s,a,0,D.EPSILON2),u;if(c){if(r=q$e(e,i),l(e._offsetAttribute)){let p=r.attributes.position.values.length/3,g=new Uint8Array(p);e._offsetAttribute===mn.TOP?g=g.fill(1,0,p/2):(u=e._offsetAttribute===mn.NONE?0:1,g=g.fill(u)),r.attributes.applyOffset=new Ne({componentDatatype:Y.UNSIGNED_BYTE,componentsPerAttribute:1,values:g})}let f=ue.fromRectangle3D(t,n,s,H$e),d=ue.fromRectangle3D(t,n,a,j$e);o=ue.union(f,d)}else{if(r=Xye(e,i),r.attributes.position.values=fi.scaleToGeodeticHeight(r.attributes.position.values,s,n,!1),l(e._offsetAttribute)){let f=r.attributes.position.values.length;u=e._offsetAttribute===mn.NONE?0:1;let d=new Uint8Array(f/3).fill(u);r.attributes.applyOffset=new Ne({componentDatatype:Y.UNSIGNED_BYTE,componentsPerAttribute:1,values:d})}o=ue.fromRectangle3D(t,n,s)}return new St({attributes:r.attributes,indices:r.indices,primitiveType:Oe.LINES,boundingSphere:o,offsetAttribute:e._offsetAttribute})};var uT=yS;var Jye=new z,Zye=h.ZERO,Qye=new h,eAe=new ie,X$e=new ie,K$e=new he;function $$e(e){this.id=e,this.vertexFormat=void 0,this.rectangle=void 0,this.height=void 0,this.extrudedHeight=void 0,this.granularity=void 0,this.stRotation=void 0,this.rotation=void 0,this.offsetAttribute=void 0}function dm(e,t){ii.call(this,{entity:e,scene:t,geometryOptions:new $$e(e),geometryPropertyName:"rectangle",observedPropertyNames:["availability","rectangle"]}),this._onEntityPropertyChanged(e,"rectangle",e.rectangle,void 0)}l(Object.create)&&(dm.prototype=Object.create(ii.prototype),dm.prototype.constructor=dm);dm.prototype.createFillGeometryInstance=function(e){let t=this._entity,n=t.isAvailable(e),i={show:new Dn(n&&t.isShowing&&this._showProperty.getValue(e)&&this._fillProperty.getValue(e)),distanceDisplayCondition:ti.fromDistanceDisplayCondition(this._distanceDisplayConditionProperty.getValue(e)),offset:void 0,color:void 0};if(this._materialProperty instanceof Kt){let r;l(this._materialProperty.color)&&(this._materialProperty.color.isConstant||n)&&(r=this._materialProperty.color.getValue(e,Jye)),l(r)||(r=z.WHITE),i.color=Jt.fromColor(r)}return l(this._options.offsetAttribute)&&(i.offset=Tr.fromCartesian3(X.getValueOrDefault(this._terrainOffsetProperty,e,Zye,Qye))),new Ft({id:t,geometry:new lT(this._options),attributes:i})};dm.prototype.createOutlineGeometryInstance=function(e){let t=this._entity,n=t.isAvailable(e),i=X.getValueOrDefault(this._outlineColorProperty,e,z.BLACK,Jye),r=this._distanceDisplayConditionProperty.getValue(e),o={show:new Dn(n&&t.isShowing&&this._showProperty.getValue(e)&&this._showOutlineProperty.getValue(e)),color:Jt.fromColor(i),distanceDisplayCondition:ti.fromDistanceDisplayCondition(r),offset:void 0};return l(this._options.offsetAttribute)&&(o.offset=Tr.fromCartesian3(X.getValueOrDefault(this._terrainOffsetProperty,e,Zye,Qye))),new Ft({id:t,geometry:new uT(this._options),attributes:o})};dm.prototype._computeCenter=function(e,t){let n=X.getValueOrUndefined(this._entity.rectangle.coordinates,e,X$e);if(!l(n))return;let i=ie.center(n,K$e);return he.toCartesian(i,ee.default,t)};dm.prototype._isHidden=function(e,t){return!l(t.coordinates)||Pi.prototype._isHidden.call(this,e,t)};dm.prototype._isDynamic=function(e,t){return!t.coordinates.isConstant||!X.isConstant(t.height)||!X.isConstant(t.extrudedHeight)||!X.isConstant(t.granularity)||!X.isConstant(t.stRotation)||!X.isConstant(t.rotation)||!X.isConstant(t.outlineWidth)||!X.isConstant(t.zIndex)||this._onTerrain&&!X.isConstant(this._materialProperty)&&!(this._materialProperty instanceof Kt)};dm.prototype._setStaticOptions=function(e,t){let n=this._materialProperty instanceof Kt,i=X.getValueOrUndefined(t.height,nt.MINIMUM_VALUE),r=X.getValueOrDefault(t.heightReference,nt.MINIMUM_VALUE,We.NONE),o=X.getValueOrUndefined(t.extrudedHeight,nt.MINIMUM_VALUE),s=X.getValueOrDefault(t.extrudedHeightReference,nt.MINIMUM_VALUE,We.NONE);l(o)&&!l(i)&&(i=0);let a=this._options;a.vertexFormat=n?yn.VERTEX_FORMAT:Er.MaterialSupport.TEXTURED.vertexFormat,a.rectangle=t.coordinates.getValue(nt.MINIMUM_VALUE,a.rectangle),a.granularity=X.getValueOrUndefined(t.granularity,nt.MINIMUM_VALUE),a.stRotation=X.getValueOrUndefined(t.stRotation,nt.MINIMUM_VALUE),a.rotation=X.getValueOrUndefined(t.rotation,nt.MINIMUM_VALUE),a.offsetAttribute=ii.computeGeometryOffsetAttribute(i,r,o,s),a.height=ii.getGeometryHeight(i,r),o=ii.getGeometryExtrudedHeight(o,s),o===ii.CLAMP_TO_GROUND&&(o=Mi.getMinimumMaximumHeights(lT.computeRectangle(a,eAe)).minimumTerrainHeight),a.extrudedHeight=o};dm.DynamicGeometryUpdater=AS;function AS(e,t,n){Ii.call(this,e,t,n)}l(Object.create)&&(AS.prototype=Object.create(Ii.prototype),AS.prototype.constructor=AS);AS.prototype._isHidden=function(e,t,n){return!l(this._options.rectangle)||Ii.prototype._isHidden.call(this,e,t,n)};AS.prototype._setOptions=function(e,t,n){let i=this._options,r=X.getValueOrUndefined(t.height,n),o=X.getValueOrDefault(t.heightReference,n,We.NONE),s=X.getValueOrUndefined(t.extrudedHeight,n),a=X.getValueOrDefault(t.extrudedHeightReference,n,We.NONE);l(s)&&!l(r)&&(r=0),i.rectangle=X.getValueOrUndefined(t.coordinates,n,i.rectangle),i.granularity=X.getValueOrUndefined(t.granularity,n),i.stRotation=X.getValueOrUndefined(t.stRotation,n),i.rotation=X.getValueOrUndefined(t.rotation,n),i.offsetAttribute=ii.computeGeometryOffsetAttribute(r,o,s,a),i.height=ii.getGeometryHeight(r,o),s=ii.getGeometryExtrudedHeight(s,a),s===ii.CLAMP_TO_GROUND&&(s=Mi.getMinimumMaximumHeights(lT.computeRectangle(i,eAe)).minimumTerrainHeight),i.extrudedHeight=s};var OL=dm;var tAe={};function J$e(e,t){return D.equalsEpsilon(e.latitude,t.latitude,D.EPSILON10)&&D.equalsEpsilon(e.longitude,t.longitude,D.EPSILON10)}var Z$e=new he,Q$e=new he;function eJe(e,t,n,i){t=Fr(t,h.equalsEpsilon);let r=t.length;if(r<2)return;let o=l(i),s=l(n),a=new Array(r),c=new Array(r),u=new Array(r),f=t[0];a[0]=f;let d=e.cartesianToCartographic(f,Z$e);s&&(d.height=n[0]),c[0]=d.height,o?u[0]=i[0]:u[0]=0;let p=c[0],g=u[0],m=p===g,y=1;for(let A=1;A<r;++A){let b=t[A],x=e.cartesianToCartographic(b,Q$e);s&&(x.height=n[A]),m=m&&x.height===0,J$e(d,x)?d.height<x.height&&(c[y-1]=x.height):(a[y]=b,c[y]=x.height,o?u[y]=i[A]:u[y]=0,m=m&&c[y]===u[y],he.clone(x,d),++y)}if(!(m||y<2))return a.length=y,c.length=y,u.length=y,{positions:a,topHeights:c,bottomHeights:u}}var tJe=new Array(2),nJe=new Array(2),iJe={positions:void 0,height:void 0,granularity:void 0,ellipsoid:void 0};tAe.computePositions=function(e,t,n,i,r,o){let s=eJe(e,t,n,i);if(!l(s))return;t=s.positions,n=s.topHeights,i=s.bottomHeights;let a=t.length,c=a-2,u,f,d=D.chordLength(r,e.maximumRadius),p=iJe;if(p.minDistance=d,p.ellipsoid=e,o){let g=0,m;for(m=0;m<a-1;m++)g+=nr.numberOfPoints(t[m],t[m+1],d)+1;u=new Float64Array(g*3),f=new Float64Array(g*3);let y=tJe,A=nJe;p.positions=y,p.height=A;let b=0;for(m=0;m<a-1;m++){y[0]=t[m],y[1]=t[m+1],A[0]=n[m],A[1]=n[m+1];let x=nr.generateArc(p);u.set(x,b),A[0]=i[m],A[1]=i[m+1],f.set(nr.generateArc(p),b),b+=x.length}}else p.positions=t,p.height=n,u=new Float64Array(nr.generateArc(p)),p.height=i,f=new Float64Array(nr.generateArc(p));return{bottomPositions:f,topPositions:u,numCorners:c}};var fT=tAe;var M$=new h,dH=new h,rJe=new h,nAe=new h,oJe=new h,sJe=new h,aJe=new h;function dT(e){e=e??H.EMPTY_OBJECT;let t=e.positions,n=e.maximumHeights,i=e.minimumHeights,r=e.vertexFormat??Be.DEFAULT,o=e.granularity??D.RADIANS_PER_DEGREE,s=e.ellipsoid??ee.default;this._positions=t,this._minimumHeights=i,this._maximumHeights=n,this._vertexFormat=Be.clone(r),this._granularity=o,this._ellipsoid=ee.clone(s),this._workerName="createWallGeometry";let a=1+t.length*h.packedLength+2;l(i)&&(a+=i.length),l(n)&&(a+=n.length),this.packedLength=a+ee.packedLength+Be.packedLength+1}dT.pack=function(e,t,n){n=n??0;let i,r=e._positions,o=r.length;for(t[n++]=o,i=0;i<o;++i,n+=h.packedLength)h.pack(r[i],t,n);let s=e._minimumHeights;if(o=l(s)?s.length:0,t[n++]=o,l(s))for(i=0;i<o;++i)t[n++]=s[i];let a=e._maximumHeights;if(o=l(a)?a.length:0,t[n++]=o,l(a))for(i=0;i<o;++i)t[n++]=a[i];return ee.pack(e._ellipsoid,t,n),n+=ee.packedLength,Be.pack(e._vertexFormat,t,n),n+=Be.packedLength,t[n]=e._granularity,t};var iAe=ee.clone(ee.UNIT_SPHERE),rAe=new Be,ML={positions:void 0,minimumHeights:void 0,maximumHeights:void 0,ellipsoid:iAe,vertexFormat:rAe,granularity:void 0};dT.unpack=function(e,t,n){t=t??0;let i,r=e[t++],o=new Array(r);for(i=0;i<r;++i,t+=h.packedLength)o[i]=h.unpack(e,t);r=e[t++];let s;if(r>0)for(s=new Array(r),i=0;i<r;++i)s[i]=e[t++];r=e[t++];let a;if(r>0)for(a=new Array(r),i=0;i<r;++i)a[i]=e[t++];let c=ee.unpack(e,t,iAe);t+=ee.packedLength;let u=Be.unpack(e,t,rAe);t+=Be.packedLength;let f=e[t];return l(n)?(n._positions=o,n._minimumHeights=s,n._maximumHeights=a,n._ellipsoid=ee.clone(c,n._ellipsoid),n._vertexFormat=Be.clone(u,n._vertexFormat),n._granularity=f,n):(ML.positions=o,ML.minimumHeights=s,ML.maximumHeights=a,ML.granularity=f,new dT(ML))};dT.fromConstantHeights=function(e){e=e??H.EMPTY_OBJECT;let t=e.positions,n,i,r=e.minimumHeight,o=e.maximumHeight,s=l(r),a=l(o);if(s||a){let u=t.length;n=s?new Array(u):void 0,i=a?new Array(u):void 0;for(let f=0;f<u;++f)s&&(n[f]=r),a&&(i[f]=o)}let c={positions:t,maximumHeights:i,minimumHeights:n,ellipsoid:e.ellipsoid,vertexFormat:e.vertexFormat};return new dT(c)};dT.createGeometry=function(e){let t=e._positions,n=e._minimumHeights,i=e._maximumHeights,r=e._vertexFormat,o=e._granularity,s=e._ellipsoid,a=fT.computePositions(s,t,i,n,o,!0);if(!l(a))return;let c=a.bottomPositions,u=a.topPositions,f=a.numCorners,d=u.length,p=d*2,g=r.position?new Float64Array(p):void 0,m=r.normal?new Float32Array(p):void 0,y=r.tangent?new Float32Array(p):void 0,A=r.bitangent?new Float32Array(p):void 0,b=r.st?new Float32Array(p/3*2):void 0,x=0,T=0,E=0,v=0,S=0,I=aJe,R=sJe,O=oJe,L=!0;d/=3;let _,C=0,w=1/(d-f-1);for(_=0;_<d;++_){let B=_*3,j=h.fromArray(u,B,M$),k=h.fromArray(c,B,dH);if(r.position&&(g[x++]=k.x,g[x++]=k.y,g[x++]=k.z,g[x++]=j.x,g[x++]=j.y,g[x++]=j.z),r.st&&(b[S++]=C,b[S++]=0,b[S++]=C,b[S++]=1),r.normal||r.tangent||r.bitangent){let G=h.clone(h.ZERO,nAe),q=h.subtract(j,s.geodeticSurfaceNormal(j,dH),dH);if(_+1<d&&(G=h.fromArray(u,B+3,nAe)),L){let Q=h.subtract(G,j,rJe),W=h.subtract(q,j,M$);I=h.normalize(h.cross(W,Q,I),I),L=!1}h.equalsEpsilon(j,G,D.EPSILON10)?L=!0:(C+=w,r.tangent&&(R=h.normalize(h.subtract(G,j,R),R)),r.bitangent&&(O=h.normalize(h.cross(I,R,O),O))),r.normal&&(m[T++]=I.x,m[T++]=I.y,m[T++]=I.z,m[T++]=I.x,m[T++]=I.y,m[T++]=I.z),r.tangent&&(y[v++]=R.x,y[v++]=R.y,y[v++]=R.z,y[v++]=R.x,y[v++]=R.y,y[v++]=R.z),r.bitangent&&(A[E++]=O.x,A[E++]=O.y,A[E++]=O.z,A[E++]=O.x,A[E++]=O.y,A[E++]=O.z)}}let P=new Tn;r.position&&(P.position=new Ne({componentDatatype:Y.DOUBLE,componentsPerAttribute:3,values:g})),r.normal&&(P.normal=new Ne({componentDatatype:Y.FLOAT,componentsPerAttribute:3,values:m})),r.tangent&&(P.tangent=new Ne({componentDatatype:Y.FLOAT,componentsPerAttribute:3,values:y})),r.bitangent&&(P.bitangent=new Ne({componentDatatype:Y.FLOAT,componentsPerAttribute:3,values:A})),r.st&&(P.st=new Ne({componentDatatype:Y.FLOAT,componentsPerAttribute:2,values:b}));let M=p/3;p-=6*(f+1);let F=je.createTypedArray(M,p),V=0;for(_=0;_<M-2;_+=2){let B=_,j=_+2,k=h.fromArray(g,B*3,M$),G=h.fromArray(g,j*3,dH);if(h.equalsEpsilon(k,G,D.EPSILON10))continue;let q=_+1,Q=_+3;F[V++]=q,F[V++]=B,F[V++]=Q,F[V++]=Q,F[V++]=B,F[V++]=j}return new St({attributes:P,indices:F,primitiveType:Oe.TRIANGLES,boundingSphere:ue.fromVertices(g)})};var NL=dT;var oAe=new h,sAe=new h;function hT(e){e=e??H.EMPTY_OBJECT;let t=e.positions,n=e.maximumHeights,i=e.minimumHeights,r=e.granularity??D.RADIANS_PER_DEGREE,o=e.ellipsoid??ee.default;this._positions=t,this._minimumHeights=i,this._maximumHeights=n,this._granularity=r,this._ellipsoid=ee.clone(o),this._workerName="createWallOutlineGeometry";let s=1+t.length*h.packedLength+2;l(i)&&(s+=i.length),l(n)&&(s+=n.length),this.packedLength=s+ee.packedLength+1}hT.pack=function(e,t,n){n=n??0;let i,r=e._positions,o=r.length;for(t[n++]=o,i=0;i<o;++i,n+=h.packedLength)h.pack(r[i],t,n);let s=e._minimumHeights;if(o=l(s)?s.length:0,t[n++]=o,l(s))for(i=0;i<o;++i)t[n++]=s[i];let a=e._maximumHeights;if(o=l(a)?a.length:0,t[n++]=o,l(a))for(i=0;i<o;++i)t[n++]=a[i];return ee.pack(e._ellipsoid,t,n),n+=ee.packedLength,t[n]=e._granularity,t};var aAe=ee.clone(ee.UNIT_SPHERE),LL={positions:void 0,minimumHeights:void 0,maximumHeights:void 0,ellipsoid:aAe,granularity:void 0};hT.unpack=function(e,t,n){t=t??0;let i,r=e[t++],o=new Array(r);for(i=0;i<r;++i,t+=h.packedLength)o[i]=h.unpack(e,t);r=e[t++];let s;if(r>0)for(s=new Array(r),i=0;i<r;++i)s[i]=e[t++];r=e[t++];let a;if(r>0)for(a=new Array(r),i=0;i<r;++i)a[i]=e[t++];let c=ee.unpack(e,t,aAe);t+=ee.packedLength;let u=e[t];return l(n)?(n._positions=o,n._minimumHeights=s,n._maximumHeights=a,n._ellipsoid=ee.clone(c,n._ellipsoid),n._granularity=u,n):(LL.positions=o,LL.minimumHeights=s,LL.maximumHeights=a,LL.granularity=u,new hT(LL))};hT.fromConstantHeights=function(e){e=e??H.EMPTY_OBJECT;let t=e.positions,n,i,r=e.minimumHeight,o=e.maximumHeight,s=l(r),a=l(o);if(s||a){let u=t.length;n=s?new Array(u):void 0,i=a?new Array(u):void 0;for(let f=0;f<u;++f)s&&(n[f]=r),a&&(i[f]=o)}let c={positions:t,maximumHeights:i,minimumHeights:n,ellipsoid:e.ellipsoid};return new hT(c)};hT.createGeometry=function(e){let t=e._positions,n=e._minimumHeights,i=e._maximumHeights,r=e._granularity,o=e._ellipsoid,s=fT.computePositions(o,t,i,n,r,!1);if(!l(s))return;let a=s.bottomPositions,c=s.topPositions,u=c.length,f=u*2,d=new Float64Array(f),p=0;u/=3;let g;for(g=0;g<u;++g){let x=g*3,T=h.fromArray(c,x,oAe),E=h.fromArray(a,x,sAe);d[p++]=E.x,d[p++]=E.y,d[p++]=E.z,d[p++]=T.x,d[p++]=T.y,d[p++]=T.z}let m=new Tn({position:new Ne({componentDatatype:Y.DOUBLE,componentsPerAttribute:3,values:d})}),y=f/3;f=2*y-4+y;let A=je.createTypedArray(y,f),b=0;for(g=0;g<y-2;g+=2){let x=g,T=g+2,E=h.fromArray(d,x*3,oAe),v=h.fromArray(d,T*3,sAe);if(h.equalsEpsilon(E,v,D.EPSILON10))continue;let S=g+1,I=g+3;A[b++]=S,A[b++]=x,A[b++]=S,A[b++]=I,A[b++]=x,A[b++]=T}return A[b++]=y-2,A[b]=y-1,new St({attributes:m,indices:A,primitiveType:Oe.LINES,boundingSphere:ue.fromVertices(d)})};var FL=hT;var cAe=new z;function cJe(e){this.id=e,this.vertexFormat=void 0,this.positions=void 0,this.minimumHeights=void 0,this.maximumHeights=void 0,this.granularity=void 0}function hm(e,t){Pi.call(this,{entity:e,scene:t,geometryOptions:new cJe(e),geometryPropertyName:"wall",observedPropertyNames:["availability","wall"]}),this._onEntityPropertyChanged(e,"wall",e.wall,void 0)}l(Object.create)&&(hm.prototype=Object.create(Pi.prototype),hm.prototype.constructor=hm);hm.prototype.createFillGeometryInstance=function(e){let t=this._entity,n=t.isAvailable(e),i,r,o=new Dn(n&&t.isShowing&&this._showProperty.getValue(e)&&this._fillProperty.getValue(e)),s=this._distanceDisplayConditionProperty.getValue(e),a=ti.fromDistanceDisplayCondition(s);if(this._materialProperty instanceof Kt){let c;l(this._materialProperty.color)&&(this._materialProperty.color.isConstant||n)&&(c=this._materialProperty.color.getValue(e,cAe)),l(c)||(c=z.WHITE),r=Jt.fromColor(c),i={show:o,distanceDisplayCondition:a,color:r}}else i={show:o,distanceDisplayCondition:a};return new Ft({id:t,geometry:new NL(this._options),attributes:i})};hm.prototype.createOutlineGeometryInstance=function(e){let t=this._entity,n=t.isAvailable(e),i=X.getValueOrDefault(this._outlineColorProperty,e,z.BLACK,cAe),r=this._distanceDisplayConditionProperty.getValue(e);return new Ft({id:t,geometry:new FL(this._options),attributes:{show:new Dn(n&&t.isShowing&&this._showProperty.getValue(e)&&this._showOutlineProperty.getValue(e)),color:Jt.fromColor(i),distanceDisplayCondition:ti.fromDistanceDisplayCondition(r)}})};hm.prototype._isHidden=function(e,t){return!l(t.positions)||Pi.prototype._isHidden.call(this,e,t)};hm.prototype._getIsClosed=function(e){return!1};hm.prototype._isDynamic=function(e,t){return!t.positions.isConstant||!X.isConstant(t.minimumHeights)||!X.isConstant(t.maximumHeights)||!X.isConstant(t.outlineWidth)||!X.isConstant(t.granularity)};hm.prototype._setStaticOptions=function(e,t){let n=t.minimumHeights,i=t.maximumHeights,r=t.granularity,o=this._materialProperty instanceof Kt,s=this._options;s.vertexFormat=o?yn.VERTEX_FORMAT:Er.MaterialSupport.TEXTURED.vertexFormat,s.positions=t.positions.getValue(nt.MINIMUM_VALUE,s.positions),s.minimumHeights=l(n)?n.getValue(nt.MINIMUM_VALUE,s.minimumHeights):void 0,s.maximumHeights=l(i)?i.getValue(nt.MINIMUM_VALUE,s.maximumHeights):void 0,s.granularity=l(r)?r.getValue(nt.MINIMUM_VALUE):void 0};hm.DynamicGeometryUpdater=bS;function bS(e,t,n){Ii.call(this,e,t,n)}l(Object.create)&&(bS.prototype=Object.create(Ii.prototype),bS.prototype.constructor=bS);bS.prototype._isHidden=function(e,t,n){return!l(this._options.positions)||Ii.prototype._isHidden.call(this,e,t,n)};bS.prototype._setOptions=function(e,t,n){let i=this._options;i.positions=X.getValueOrUndefined(t.positions,n,i.positions),i.minimumHeights=X.getValueOrUndefined(t.minimumHeights,n,i.minimumHeights),i.maximumHeights=X.getValueOrUndefined(t.maximumHeights,n,i.maximumHeights),i.granularity=X.getValueOrUndefined(t.granularity,n)};var BL=hm;var mT=[ZN,dL,lL,hL,pL,yL,EL,DL,OL,BL];function pT(e,t){this.entity=e,this.scene=t;let n=new Array(mT.length),i=new be,r=new jo;for(let o=0;o<n.length;o++){let s=new mT[o](e,t);r.add(s.geometryChanged,a=>{i.raiseEvent(a)}),n[o]=s}this.updaters=n,this.geometryChanged=i,this.eventHelper=r,this._removeEntitySubscription=e.definitionChanged.addEventListener(pT.prototype._onEntityPropertyChanged,this)}pT.prototype._onEntityPropertyChanged=function(e,t,n,i){let r=this.updaters;for(let o=0;o<r.length;o++)r[o]._onEntityPropertyChanged(e,t,n,i)};pT.prototype.forEach=function(e){let t=this.updaters;for(let n=0;n<t.length;n++)e(t[n])};pT.prototype.destroy=function(){this.eventHelper.removeAll();let e=this.updaters;for(let t=0;t<e.length;t++)e[t].destroy();this._removeEntitySubscription(),le(this)};pT.registerUpdater=function(e){mT.includes(e)||mT.push(e)};pT.unregisterUpdater=function(e){if(mT.includes(e)){let t=mT.indexOf(e);mT.splice(t,1)}};var gT=pT;var lAe=new z,lJe=new Ht,uJe=new Ht,fJe=h.ZERO,dJe=new h;function mm(e,t,n,i,r,o,s){this.translucent=t,this.appearanceType=n,this.depthFailAppearanceType=i,this.depthFailMaterialProperty=r,this.depthFailMaterial=void 0,this.closed=o,this.shadows=s,this.primitives=e,this.createPrimitive=!1,this.waitingOnCreate=!1,this.primitive=void 0,this.oldPrimitive=void 0,this.geometry=new Ut,this.updaters=new Ut,this.updatersWithAttributes=new Ut,this.attributes=new Ut,this.subscriptions=new Ut,this.showsUpdated=new Ut,this.itemsToRemove=[],this.invalidated=!1;let a;l(r)&&(a=r.definitionChanged.addEventListener(mm.prototype.onMaterialChanged,this)),this.removeMaterialSubscription=a}mm.prototype.onMaterialChanged=function(){this.invalidated=!0};mm.prototype.isMaterial=function(e){let t=this.depthFailMaterialProperty,n=e.depthFailMaterialProperty;return n===t?!0:l(t)?t.equals(n):!1};mm.prototype.add=function(e,t){let n=e.id;if(this.createPrimitive=!0,this.geometry.set(n,t),this.updaters.set(n,e),!e.hasConstantFill||!e.fillMaterialProperty.isConstant||!X.isConstant(e.distanceDisplayConditionProperty)||!X.isConstant(e.terrainOffsetProperty))this.updatersWithAttributes.set(n,e);else{let i=this;this.subscriptions.set(n,e.entity.definitionChanged.addEventListener(function(r,o,s,a){o==="isShowing"&&i.showsUpdated.set(e.id,e)}))}};mm.prototype.remove=function(e){let t=e.id;if(this.createPrimitive=this.geometry.remove(t)||this.createPrimitive,this.updaters.remove(t)){this.updatersWithAttributes.remove(t);let n=this.subscriptions.get(t);return l(n)&&(n(),this.subscriptions.remove(t),this.showsUpdated.remove(t)),!0}return!1};mm.prototype.update=function(e){let t=!0,n=0,i=this.primitive,r=this.primitives,o;if(this.createPrimitive){let s=this.geometry.values;if(s.length>0){l(i)&&(l(this.oldPrimitive)?r.remove(i):this.oldPrimitive=i);let c;if(l(this.depthFailAppearanceType)){l(this.depthFailMaterialProperty)&&(this.depthFailMaterial=yo.getValue(e,this.depthFailMaterialProperty,this.depthFailMaterial));let f=this.depthFailAppearanceType;c=new f({material:this.depthFailMaterial,translucent:this.translucent,closed:this.closed})}let u=this.appearanceType;i=new On({show:!1,asynchronous:!0,geometryInstances:s.slice(),appearance:new u({translucent:this.translucent,closed:this.closed}),depthFailAppearance:c,shadows:this.shadows}),r.add(i),t=!1}else{l(i)&&(r.remove(i),i=void 0);let c=this.oldPrimitive;l(c)&&(r.remove(c),this.oldPrimitive=void 0)}this.attributes.removeAll(),this.primitive=i,this.createPrimitive=!1,this.waitingOnCreate=!0}else if(l(i)&&i.ready){i.show=!0,l(this.oldPrimitive)&&(r.remove(this.oldPrimitive),this.oldPrimitive=void 0),l(this.depthFailAppearanceType)&&!(this.depthFailMaterialProperty instanceof Kt)&&(this.depthFailMaterial=yo.getValue(e,this.depthFailMaterialProperty,this.depthFailMaterial),this.primitive.depthFailAppearance.material=this.depthFailMaterial);let s=this.updatersWithAttributes.values,a=s.length,c=this.waitingOnCreate;for(o=0;o<a;o++){let u=s[o],f=this.geometry.get(u.id),d=this.attributes.get(f.id.id);if(l(d)||(d=i.getGeometryInstanceAttributes(f.id),this.attributes.set(f.id.id,d)),!u.fillMaterialProperty.isConstant||c){let A=u.fillMaterialProperty.color,b=X.getValueOrDefault(A,e,z.WHITE,lAe);z.equals(d._lastColor,b)||(d._lastColor=z.clone(b,d._lastColor),d.color=Jt.toValue(b,d.color),(this.translucent&&d.color[3]===255||!this.translucent&&d.color[3]!==255)&&(this.itemsToRemove[n++]=u))}if(l(this.depthFailAppearanceType)&&u.depthFailMaterialProperty instanceof Kt&&(!u.depthFailMaterialProperty.isConstant||c)){let A=u.depthFailMaterialProperty.color,b=X.getValueOrDefault(A,e,z.WHITE,lAe);z.equals(d._lastDepthFailColor,b)||(d._lastDepthFailColor=z.clone(b,d._lastDepthFailColor),d.depthFailColor=Jt.toValue(b,d.depthFailColor))}let p=u.entity.isShowing&&(u.hasConstantFill||u.isFilled(e)),g=d.show[0]===1;p!==g&&(d.show=Dn.toValue(p,d.show));let m=u.distanceDisplayConditionProperty;if(!X.isConstant(m)){let A=X.getValueOrDefault(m,e,uJe,lJe);Ht.equals(A,d._lastDistanceDisplayCondition)||(d._lastDistanceDisplayCondition=Ht.clone(A,d._lastDistanceDisplayCondition),d.distanceDisplayCondition=ti.toValue(A,d.distanceDisplayCondition))}let y=u.terrainOffsetProperty;if(!X.isConstant(y)){let A=X.getValueOrDefault(y,e,fJe,dJe);h.equals(A,d._lastOffset)||(d._lastOffset=h.clone(A,d._lastOffset),d.offset=Tr.toValue(A,d.offset))}}this.updateShows(i),this.waitingOnCreate=!1}else l(i)&&!i.ready&&(t=!1);return this.itemsToRemove.length=n,t};mm.prototype.updateShows=function(e){let t=this.showsUpdated.values,n=t.length;for(let i=0;i<n;i++){let r=t[i],o=this.geometry.get(r.id),s=this.attributes.get(o.id.id);l(s)||(s=e.getGeometryInstanceAttributes(o.id),this.attributes.set(o.id.id,s));let a=r.entity.isShowing,c=s.show[0]===1;a!==c&&(s.show=Dn.toValue(a,s.show),o.attributes.show.value[0]=s.show[0])}this.showsUpdated.removeAll()};mm.prototype.contains=function(e){return this.updaters.contains(e.id)};mm.prototype.getBoundingSphere=function(e,t){let n=this.primitive;if(!n.ready)return Pt.PENDING;let i=n.getGeometryInstanceAttributes(e.entity);return!l(i)||!l(i.boundingSphere)||l(i.show)&&i.show[0]===0?Pt.FAILED:(i.boundingSphere.clone(t),Pt.DONE)};mm.prototype.destroy=function(){let e=this.primitive,t=this.primitives;l(e)&&t.remove(e);let n=this.oldPrimitive;l(n)&&t.remove(n),l(this.removeMaterialSubscription)&&this.removeMaterialSubscription()};function xS(e,t,n,i,r){this._solidItems=[],this._translucentItems=[],this._primitives=e,this._appearanceType=t,this._depthFailAppearanceType=n,this._closed=i,this._shadows=r}xS.prototype.add=function(e,t){let n,i,r=t.createFillGeometryInstance(e);r.attributes.color.value[3]===255?(n=this._solidItems,i=!1):(n=this._translucentItems,i=!0);let o=n.length;for(let a=0;a<o;a++){let c=n[a];if(c.isMaterial(t)){c.add(t,r);return}}let s=new mm(this._primitives,i,this._appearanceType,this._depthFailAppearanceType,t.depthFailMaterialProperty,this._closed,this._shadows);s.add(t,r),n.push(s)};function uAe(e,t){let n=e.length;for(let i=n-1;i>=0;i--){let r=e[i];if(r.remove(t))return r.updaters.length===0&&(e.splice(i,1),r.destroy()),!0}return!1}xS.prototype.remove=function(e){uAe(this._solidItems,e)||uAe(this._translucentItems,e)};function fAe(e,t,n){let i=!1,r=t.length;for(let o=0;o<r;++o){let s=t[o],a=s.itemsToRemove,c=a.length;if(c>0)for(o=0;o<c;o++){let u=a[o];s.remove(u),e.add(n,u),i=!0}}return i}function hH(e,t,n,i){let r=t.length,o;for(o=r-1;o>=0;o--){let s=t[o];if(s.invalidated){t.splice(o,1);let a=s.updaters.values,c=a.length;for(let u=0;u<c;u++)e.add(n,a[u]);s.destroy()}}for(r=t.length,o=0;o<r;++o)i=t[o].update(n)&&i;return i}xS.prototype.update=function(e){let t=hH(this,this._solidItems,e,!0);t=hH(this,this._translucentItems,e,t)&&t;let n=fAe(this,this._solidItems,e),i=fAe(this,this._translucentItems,e);return(n||i)&&(t=hH(this,this._solidItems,e,t)&&t,t=hH(this,this._translucentItems,e,t)&&t),t};function dAe(e,t,n){let i=e.length;for(let r=0;r<i;r++){let o=e[r];if(o.contains(t))return o.getBoundingSphere(t,n)}return Pt.FAILED}xS.prototype.getBoundingSphere=function(e,t){let n=dAe(this._solidItems,e,t);return n===Pt.FAILED?dAe(this._translucentItems,e,t):n};function hAe(e){let t=e.length;for(let n=0;n<t;n++)e[n].destroy();e.length=0}xS.prototype.removeAllPrimitives=function(){hAe(this._solidItems),hAe(this._translucentItems)};var qd=xS;var hJe=new Ht,mJe=new Ht,pJe=h.ZERO,gJe=new h;function pm(e,t,n,i,r,o,s){this.primitives=e,this.appearanceType=t,this.materialProperty=n,this.depthFailAppearanceType=i,this.depthFailMaterialProperty=r,this.closed=o,this.shadows=s,this.updaters=new Ut,this.createPrimitive=!0,this.primitive=void 0,this.oldPrimitive=void 0,this.geometry=new Ut,this.material=void 0,this.depthFailMaterial=void 0,this.updatersWithAttributes=new Ut,this.attributes=new Ut,this.invalidated=!1,this.removeMaterialSubscription=n.definitionChanged.addEventListener(pm.prototype.onMaterialChanged,this),this.subscriptions=new Ut,this.showsUpdated=new Ut}pm.prototype.onMaterialChanged=function(){this.invalidated=!0};pm.prototype.isMaterial=function(e){let t=this.materialProperty,n=e.fillMaterialProperty,i=this.depthFailMaterialProperty,r=e.depthFailMaterialProperty;if(n===t&&r===i)return!0;let o=l(t)&&t.equals(n);return o=(!l(i)&&!l(r)||l(i)&&i.equals(r))&&o,o};pm.prototype.add=function(e,t){let n=t.id;if(this.updaters.set(n,t),this.geometry.set(n,t.createFillGeometryInstance(e)),!t.hasConstantFill||!t.fillMaterialProperty.isConstant||!X.isConstant(t.distanceDisplayConditionProperty)||!X.isConstant(t.terrainOffsetProperty))this.updatersWithAttributes.set(n,t);else{let i=this;this.subscriptions.set(n,t.entity.definitionChanged.addEventListener(function(r,o,s,a){o==="isShowing"&&i.showsUpdated.set(t.id,t)}))}this.createPrimitive=!0};pm.prototype.remove=function(e){let t=e.id;if(this.createPrimitive=this.geometry.remove(t)||this.createPrimitive,this.updaters.remove(t)){this.updatersWithAttributes.remove(t);let n=this.subscriptions.get(t);return l(n)&&(n(),this.subscriptions.remove(t),this.showsUpdated.remove(t)),!0}return!1};var _Je=new z;pm.prototype.update=function(e){let t=!0,n=this.primitive,i=this.primitives,r=this.geometry.values,o;if(this.createPrimitive){if(r.length>0){l(n)&&(l(this.oldPrimitive)?i.remove(n):this.oldPrimitive=n),this.material=yo.getValue(e,this.materialProperty,this.material);let a;if(l(this.depthFailMaterialProperty)){this.depthFailMaterial=yo.getValue(e,this.depthFailMaterialProperty,this.depthFailMaterial);let u=this.depthFailAppearanceType;a=new u({material:this.depthFailMaterial,translucent:this.depthFailMaterial.isTranslucent(),closed:this.closed})}let c=this.appearanceType;n=new On({show:!1,asynchronous:!0,geometryInstances:r.slice(),appearance:new c({material:this.material,translucent:this.material.isTranslucent(),closed:this.closed}),depthFailAppearance:a,shadows:this.shadows}),i.add(n),t=!1}else{l(n)&&(i.remove(n),n=void 0);let a=this.oldPrimitive;l(a)&&(i.remove(a),this.oldPrimitive=void 0)}this.attributes.removeAll(),this.primitive=n,this.createPrimitive=!1}else if(l(n)&&n.ready){n.show=!0,l(this.oldPrimitive)&&(i.remove(this.oldPrimitive),this.oldPrimitive=void 0),this.material=yo.getValue(e,this.materialProperty,this.material),this.primitive.appearance.material=this.material,l(this.depthFailAppearanceType)&&!(this.depthFailMaterialProperty instanceof Kt)&&(this.depthFailMaterial=yo.getValue(e,this.depthFailMaterialProperty,this.depthFailMaterial),this.primitive.depthFailAppearance.material=this.depthFailMaterial);let s=this.updatersWithAttributes.values,a=s.length;for(o=0;o<a;o++){let c=s[o],u=c.entity,f=this.geometry.get(c.id),d=this.attributes.get(f.id.id);if(l(d)||(d=n.getGeometryInstanceAttributes(f.id),this.attributes.set(f.id.id,d)),l(this.depthFailAppearanceType)&&this.depthFailMaterialProperty instanceof Kt&&!c.depthFailMaterialProperty.isConstant){let A=c.depthFailMaterialProperty.color,b=X.getValueOrDefault(A,e,z.WHITE,_Je);z.equals(d._lastDepthFailColor,b)||(d._lastDepthFailColor=z.clone(b,d._lastDepthFailColor),d.depthFailColor=Jt.toValue(b,d.depthFailColor))}let p=u.isShowing&&(c.hasConstantFill||c.isFilled(e)),g=d.show[0]===1;p!==g&&(d.show=Dn.toValue(p,d.show));let m=c.distanceDisplayConditionProperty;if(!X.isConstant(m)){let A=X.getValueOrDefault(m,e,mJe,hJe);Ht.equals(A,d._lastDistanceDisplayCondition)||(d._lastDistanceDisplayCondition=Ht.clone(A,d._lastDistanceDisplayCondition),d.distanceDisplayCondition=ti.toValue(A,d.distanceDisplayCondition))}let y=c.terrainOffsetProperty;if(!X.isConstant(y)){let A=X.getValueOrDefault(y,e,pJe,gJe);h.equals(A,d._lastOffset)||(d._lastOffset=h.clone(A,d._lastOffset),d.offset=Tr.toValue(A,d.offset))}}this.updateShows(n)}else l(n)&&!n.ready&&(t=!1);return t};pm.prototype.updateShows=function(e){let t=this.showsUpdated.values,n=t.length;for(let i=0;i<n;i++){let r=t[i],o=r.entity,s=this.geometry.get(r.id),a=this.attributes.get(s.id.id);l(a)||(a=e.getGeometryInstanceAttributes(s.id),this.attributes.set(s.id.id,a));let c=o.isShowing,u=a.show[0]===1;c!==u&&(a.show=Dn.toValue(c,a.show),s.attributes.show.value[0]=a.show[0])}this.showsUpdated.removeAll()};pm.prototype.contains=function(e){return this.updaters.contains(e.id)};pm.prototype.getBoundingSphere=function(e,t){let n=this.primitive;if(!n.ready)return Pt.PENDING;let i=n.getGeometryInstanceAttributes(e.entity);return!l(i)||!l(i.boundingSphere)||l(i.show)&&i.show[0]===0?Pt.FAILED:(i.boundingSphere.clone(t),Pt.DONE)};pm.prototype.destroy=function(){let e=this.primitive,t=this.primitives;l(e)&&t.remove(e);let n=this.oldPrimitive;l(n)&&t.remove(n),this.removeMaterialSubscription()};function TS(e,t,n,i,r){this._items=[],this._primitives=e,this._appearanceType=t,this._depthFailAppearanceType=n,this._closed=i,this._shadows=r}TS.prototype.add=function(e,t){let n=this._items,i=n.length;for(let o=0;o<i;o++){let s=n[o];if(s.isMaterial(t)){s.add(e,t);return}}let r=new pm(this._primitives,this._appearanceType,t.fillMaterialProperty,this._depthFailAppearanceType,t.depthFailMaterialProperty,this._closed,this._shadows);r.add(e,t),n.push(r)};TS.prototype.remove=function(e){let t=this._items,n=t.length;for(let i=n-1;i>=0;i--){let r=t[i];if(r.remove(e)){r.updaters.length===0&&(t.splice(i,1),r.destroy());break}}};TS.prototype.update=function(e){let t,n=this._items,i=n.length;for(t=i-1;t>=0;t--){let o=n[t];if(o.invalidated){n.splice(t,1);let s=o.updaters.values,a=s.length;for(let c=0;c<a;c++)this.add(e,s[c]);o.destroy()}}let r=!0;for(t=0;t<n.length;t++)r=n[t].update(e)&&r;return r};TS.prototype.getBoundingSphere=function(e,t){let n=this._items,i=n.length;for(let r=0;r<i;r++){let o=n[r];if(o.contains(e))return o.getBoundingSphere(e,t)}return Pt.FAILED};TS.prototype.removeAllPrimitives=function(){let e=this._items,t=e.length;for(let n=0;n<t;n++)e[n].destroy();this._items.length=0};var Yd=TS;function mH(e,t,n=0,i=e.length-1,r=yJe){for(;i>n;){if(i-n>600){let c=i-n+1,u=t-n+1,f=Math.log(c),d=.5*Math.exp(2*f/3),p=.5*Math.sqrt(f*d*(c-d)/c)*(u-c/2<0?-1:1),g=Math.max(n,Math.floor(t-u*d/c+p)),m=Math.min(i,Math.floor(t+(c-u)*d/c+p));mH(e,t,g,m,r)}let o=e[t],s=n,a=i;for(kL(e,n,t),r(e[i],o)>0&&kL(e,n,i);s<a;){for(kL(e,s,a),s++,a--;r(e[s],o)<0;)s++;for(;r(e[a],o)>0;)a--}r(e[n],o)===0?kL(e,n,a):(a++,kL(e,a,i)),a<=t&&(n=a+1),t<=a&&(i=a-1)}}function kL(e,t,n){let i=e[t];e[t]=e[n],e[n]=i}function yJe(e,t){return e<t?-1:e>t?1:0}var VL=class{constructor(t=9){this._maxEntries=Math.max(4,t),this._minEntries=Math.max(2,Math.ceil(this._maxEntries*.4)),this.clear()}all(){return this._all(this.data,[])}search(t){let n=this.data,i=[];if(!gH(t,n))return i;let r=this.toBBox,o=[];for(;n;){for(let s=0;s<n.children.length;s++){let a=n.children[s],c=n.leaf?r(a):a;gH(t,c)&&(n.leaf?i.push(a):L$(t,c)?this._all(a,i):o.push(a))}n=o.pop()}return i}collides(t){let n=this.data;if(!gH(t,n))return!1;let i=[];for(;n;){for(let r=0;r<n.children.length;r++){let o=n.children[r],s=n.leaf?this.toBBox(o):o;if(gH(t,s)){if(n.leaf||L$(t,s))return!0;i.push(o)}}n=i.pop()}return!1}load(t){if(!(t&&t.length))return this;if(t.length<this._minEntries){for(let i=0;i<t.length;i++)this.insert(t[i]);return this}let n=this._build(t.slice(),0,t.length-1,0);if(!this.data.children.length)this.data=n;else if(this.data.height===n.height)this._splitRoot(this.data,n);else{if(this.data.height<n.height){let i=this.data;this.data=n,n=i}this._insert(n,this.data.height-n.height-1,!0)}return this}insert(t){return t&&this._insert(t,this.data.height-1),this}clear(){return this.data=CS([]),this}remove(t,n){if(!t)return this;let i=this.data,r=this.toBBox(t),o=[],s=[],a,c,u;for(;i||o.length;){if(i||(i=o.pop(),c=o[o.length-1],a=s.pop(),u=!0),i.leaf){let f=AJe(t,i.children,n);if(f!==-1)return i.children.splice(f,1),o.push(i),this._condense(o),this}!u&&!i.leaf&&L$(i,r)?(o.push(i),s.push(a),a=0,c=i,i=i.children[0]):c?(a++,i=c.children[a],u=!1):i=null}return this}toBBox(t){return t}compareMinX(t,n){return t.minX-n.minX}compareMinY(t,n){return t.minY-n.minY}toJSON(){return this.data}fromJSON(t){return this.data=t,this}_all(t,n){let i=[];for(;t;)t.leaf?n.push(...t.children):i.push(...t.children),t=i.pop();return n}_build(t,n,i,r){let o=i-n+1,s=this._maxEntries,a;if(o<=s)return a=CS(t.slice(n,i+1)),ES(a,this.toBBox),a;r||(r=Math.ceil(Math.log(o)/Math.log(s)),s=Math.ceil(o/Math.pow(s,r-1))),a=CS([]),a.leaf=!1,a.height=r;let c=Math.ceil(o/s),u=c*Math.ceil(Math.sqrt(s));mAe(t,n,i,u,this.compareMinX);for(let f=n;f<=i;f+=u){let d=Math.min(f+u-1,i);mAe(t,f,d,c,this.compareMinY);for(let p=f;p<=d;p+=c){let g=Math.min(p+c-1,d);a.children.push(this._build(t,p,g,r-1))}}return ES(a,this.toBBox),a}_chooseSubtree(t,n,i,r){for(;r.push(n),!(n.leaf||r.length-1===i);){let o=1/0,s=1/0,a;for(let c=0;c<n.children.length;c++){let u=n.children[c],f=N$(u),d=TJe(t,u)-f;d<s?(s=d,o=f<o?f:o,a=u):d===s&&f<o&&(o=f,a=u)}n=a||n.children[0]}return n}_insert(t,n,i){let r=i?t:this.toBBox(t),o=[],s=this._chooseSubtree(r,this.data,n,o);for(s.children.push(t),zL(s,r);n>=0&&o[n].children.length>this._maxEntries;)this._split(o,n),n--;this._adjustParentBBoxes(r,o,n)}_split(t,n){let i=t[n],r=i.children.length,o=this._minEntries;this._chooseSplitAxis(i,o,r);let s=this._chooseSplitIndex(i,o,r),a=CS(i.children.splice(s,i.children.length-s));a.height=i.height,a.leaf=i.leaf,ES(i,this.toBBox),ES(a,this.toBBox),n?t[n-1].children.push(a):this._splitRoot(i,a)}_splitRoot(t,n){this.data=CS([t,n]),this.data.height=t.height+1,this.data.leaf=!1,ES(this.data,this.toBBox)}_chooseSplitIndex(t,n,i){let r,o=1/0,s=1/0;for(let a=n;a<=i-n;a++){let c=UL(t,0,a,this.toBBox),u=UL(t,a,i,this.toBBox),f=EJe(c,u),d=N$(c)+N$(u);f<o?(o=f,r=a,s=d<s?d:s):f===o&&d<s&&(s=d,r=a)}return r||i-n}_chooseSplitAxis(t,n,i){let r=t.leaf?this.compareMinX:bJe,o=t.leaf?this.compareMinY:xJe,s=this._allDistMargin(t,n,i,r),a=this._allDistMargin(t,n,i,o);s<a&&t.children.sort(r)}_allDistMargin(t,n,i,r){t.children.sort(r);let o=this.toBBox,s=UL(t,0,n,o),a=UL(t,i-n,i,o),c=pH(s)+pH(a);for(let u=n;u<i-n;u++){let f=t.children[u];zL(s,t.leaf?o(f):f),c+=pH(s)}for(let u=i-n-1;u>=n;u--){let f=t.children[u];zL(a,t.leaf?o(f):f),c+=pH(a)}return c}_adjustParentBBoxes(t,n,i){for(let r=i;r>=0;r--)zL(n[r],t)}_condense(t){for(let n=t.length-1,i;n>=0;n--)t[n].children.length===0?n>0?(i=t[n-1].children,i.splice(i.indexOf(t[n]),1)):this.clear():ES(t[n],this.toBBox)}};function AJe(e,t,n){if(!n)return t.indexOf(e);for(let i=0;i<t.length;i++)if(n(e,t[i]))return i;return-1}function ES(e,t){UL(e,0,e.children.length,t,e)}function UL(e,t,n,i,r){r||(r=CS(null)),r.minX=1/0,r.minY=1/0,r.maxX=-1/0,r.maxY=-1/0;for(let o=t;o<n;o++){let s=e.children[o];zL(r,e.leaf?i(s):s)}return r}function zL(e,t){return e.minX=Math.min(e.minX,t.minX),e.minY=Math.min(e.minY,t.minY),e.maxX=Math.max(e.maxX,t.maxX),e.maxY=Math.max(e.maxY,t.maxY),e}function bJe(e,t){return e.minX-t.minX}function xJe(e,t){return e.minY-t.minY}function N$(e){return(e.maxX-e.minX)*(e.maxY-e.minY)}function pH(e){return e.maxX-e.minX+(e.maxY-e.minY)}function TJe(e,t){return(Math.max(t.maxX,e.maxX)-Math.min(t.minX,e.minX))*(Math.max(t.maxY,e.maxY)-Math.min(t.minY,e.minY))}function EJe(e,t){let n=Math.max(e.minX,t.minX),i=Math.max(e.minY,t.minY),r=Math.min(e.maxX,t.maxX),o=Math.min(e.maxY,t.maxY);return Math.max(0,r-n)*Math.max(0,o-i)}function L$(e,t){return e.minX<=t.minX&&e.minY<=t.minY&&t.maxX<=e.maxX&&t.maxY<=e.maxY}function gH(e,t){return t.minX<=e.maxX&&t.minY<=e.maxY&&t.maxX>=e.minX&&t.maxY>=e.minY}function CS(e){return{children:e,height:1,leaf:!0,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0}}function mAe(e,t,n,i,r){let o=[t,n];for(;o.length;){if(n=o.pop(),t=o.pop(),n-t<=i)continue;let s=t+Math.ceil((n-t)/i/2)*i;mH(e,s,t,n,r),o.push(t,s,s,n)}}function _H(){this._tree=new VL}function _T(){this.minX=0,this.minY=0,this.maxX=0,this.maxY=0,this.id=""}_T.fromRectangleAndId=function(e,t,n){return n.minX=t.west,n.minY=t.south,n.maxX=t.east,n.maxY=t.north,n.id=e,n};_H.prototype.insert=function(e,t){let n=_T.fromRectangleAndId(e,t,new _T);this._tree.insert(n)};function CJe(e,t){return e.id===t.id}var vJe=new _T;_H.prototype.remove=function(e,t){let n=_T.fromRectangleAndId(e,t,vJe);this._tree.remove(n,CJe)};var SJe=new _T;_H.prototype.collides=function(e){let t=_T.fromRectangleAndId("",e,SJe);return this._tree.collides(t)};var yT=_H;var wJe=new z,IJe=new Ht,PJe=new Ht;function jg(e,t,n,i){this.primitives=e,this.zIndex=i,this.classificationType=t,this.color=n,this.createPrimitive=!1,this.waitingOnCreate=!1,this.primitive=void 0,this.oldPrimitive=void 0,this.geometry=new Ut,this.updaters=new Ut,this.updatersWithAttributes=new Ut,this.attributes=new Ut,this.subscriptions=new Ut,this.showsUpdated=new Ut,this.itemsToRemove=[],this.isDirty=!1,this.rectangleCollisionCheck=new yT}jg.prototype.overlapping=function(e){return this.rectangleCollisionCheck.collides(e)};jg.prototype.add=function(e,t){let n=e.id;if(this.createPrimitive=!0,this.geometry.set(n,t),this.updaters.set(n,e),this.rectangleCollisionCheck.insert(n,t.geometry.rectangle),!e.hasConstantFill||!e.fillMaterialProperty.isConstant||!X.isConstant(e.distanceDisplayConditionProperty))this.updatersWithAttributes.set(n,e);else{let i=this;this.subscriptions.set(n,e.entity.definitionChanged.addEventListener(function(r,o,s,a){o==="isShowing"&&i.showsUpdated.set(e.id,e)}))}};jg.prototype.remove=function(e){let t=e.id,n=this.geometry.get(t);if(this.createPrimitive=this.geometry.remove(t)||this.createPrimitive,this.updaters.remove(t)){this.rectangleCollisionCheck.remove(t,n.geometry.rectangle),this.updatersWithAttributes.remove(t);let i=this.subscriptions.get(t);return l(i)&&(i(),this.subscriptions.remove(t),this.showsUpdated.remove(t)),!0}return!1};jg.prototype.update=function(e){let t=!0,n=0,i=this.primitive,r=this.primitives,o;if(this.createPrimitive){let s=this.geometry.values;if(s.length>0)l(i)&&(l(this.oldPrimitive)?r.remove(i):this.oldPrimitive=i),i=new Xl({show:!1,asynchronous:!0,geometryInstances:s.slice(),classificationType:this.classificationType}),r.add(i,this.zIndex),t=!1;else{l(i)&&(r.remove(i),i=void 0);let c=this.oldPrimitive;l(c)&&(r.remove(c),this.oldPrimitive=void 0)}this.attributes.removeAll(),this.primitive=i,this.createPrimitive=!1,this.waitingOnCreate=!0}else if(l(i)&&i.ready){i.show=!0,l(this.oldPrimitive)&&(r.remove(this.oldPrimitive),this.oldPrimitive=void 0);let s=this.updatersWithAttributes.values,a=s.length,c=this.waitingOnCreate;for(o=0;o<a;o++){let u=s[o],f=this.geometry.get(u.id),d=this.attributes.get(f.id.id);if(l(d)||(d=i.getGeometryInstanceAttributes(f.id),this.attributes.set(f.id.id,d)),!u.fillMaterialProperty.isConstant||c){let y=u.fillMaterialProperty.color,A=X.getValueOrDefault(y,e,z.WHITE,wJe);z.equals(d._lastColor,A)||(d._lastColor=z.clone(A,d._lastColor),d.color=Jt.toValue(A,d.color))}let p=u.entity.isShowing&&(u.hasConstantFill||u.isFilled(e)),g=d.show[0]===1;p!==g&&(d.show=Dn.toValue(p,d.show));let m=u.distanceDisplayConditionProperty;if(!X.isConstant(m)){let y=X.getValueOrDefault(m,e,PJe,IJe);Ht.equals(y,d._lastDistanceDisplayCondition)||(d._lastDistanceDisplayCondition=Ht.clone(y,d._lastDistanceDisplayCondition),d.distanceDisplayCondition=ti.toValue(y,d.distanceDisplayCondition))}}this.updateShows(i),this.waitingOnCreate=!1}else l(i)&&!i.ready&&(t=!1);return this.itemsToRemove.length=n,t};jg.prototype.updateShows=function(e){let t=this.showsUpdated.values,n=t.length;for(let i=0;i<n;i++){let r=t[i],o=this.geometry.get(r.id),s=this.attributes.get(o.id.id);l(s)||(s=e.getGeometryInstanceAttributes(o.id),this.attributes.set(o.id.id,s));let a=r.entity.isShowing,c=s.show[0]===1;a!==c&&(s.show=Dn.toValue(a,s.show),o.attributes.show.value[0]=s.show[0])}this.showsUpdated.removeAll()};jg.prototype.contains=function(e){return this.updaters.contains(e.id)};jg.prototype.getBoundingSphere=function(e,t){let n=this.primitive;if(!n.ready)return Pt.PENDING;let i=n.getBoundingSphere(e.entity);return l(i)?(i.clone(t),Pt.DONE):Pt.FAILED};jg.prototype.removeAllPrimitives=function(){let e=this.primitives,t=this.primitive;l(t)&&(e.remove(t),this.primitive=void 0,this.geometry.removeAll(),this.updaters.removeAll());let n=this.oldPrimitive;l(n)&&(e.remove(n),this.oldPrimitive=void 0)};function vS(e,t){this._batches=[],this._primitives=e,this._classificationType=t}vS.prototype.add=function(e,t){let n=t.createFillGeometryInstance(e),i=this._batches,r=X.getValueOrDefault(t.zIndex,0),o,s=i.length;for(let a=0;a<s;++a){let c=i[a];if(c.zIndex===r&&!c.overlapping(n.geometry.rectangle)){o=c;break}}return l(o)||(o=new jg(this._primitives,this._classificationType,n.attributes.color.value,r),i.push(o)),o.add(t,n),o};vS.prototype.remove=function(e){let t=this._batches,n=t.length;for(let i=0;i<n;++i)if(t[i].remove(e))return};vS.prototype.update=function(e){let t,n,i=!0,r=this._batches,o=r.length;for(t=0;t<o;++t)i=r[t].update(e)&&i;for(t=0;t<o;++t){let s=r[t],a=s.itemsToRemove,c=a.length;for(let u=0;u<c;u++){n=a[u],s.remove(n);let f=this.add(e,n);s.isDirty=!0,f.isDirty=!0}}for(t=o-1;t>=0;--t){let s=r[t];s.isDirty&&(i=r[t].update(e)&&i,s.isDirty=!1),s.geometry.length===0&&r.splice(t,1)}return i};vS.prototype.getBoundingSphere=function(e,t){let n=this._batches,i=n.length;for(let r=0;r<i;++r){let o=n[r];if(o.contains(e))return o.getBoundingSphere(e,t)}return Pt.FAILED};vS.prototype.removeAllPrimitives=function(){let e=this._batches,t=e.length;for(let n=0;n<t;++n)e[n].removeAllPrimitives()};var SS=vS;var DJe=new Ht,RJe=new Ht;function Kp(e,t,n,i,r,o){this.primitives=e,this.classificationType=t,this.appearanceType=n,this.materialProperty=i,this.updaters=new Ut,this.createPrimitive=!0,this.primitive=void 0,this.oldPrimitive=void 0,this.geometry=new Ut,this.material=void 0,this.updatersWithAttributes=new Ut,this.attributes=new Ut,this.subscriptions=new Ut,this.showsUpdated=new Ut,this.usingSphericalTextureCoordinates=r,this.zIndex=o,this.rectangleCollisionCheck=new yT}Kp.prototype.overlapping=function(e){return this.rectangleCollisionCheck.collides(e)};Kp.prototype.isMaterial=function(e){let t=this.materialProperty,n=e.fillMaterialProperty;return n===t||n instanceof Kt&&t instanceof Kt?!0:l(t)&&t.equals(n)};Kp.prototype.add=function(e,t,n){let i=t.id;if(this.updaters.set(i,t),this.geometry.set(i,n),this.rectangleCollisionCheck.insert(i,n.geometry.rectangle),!t.hasConstantFill||!t.fillMaterialProperty.isConstant||!X.isConstant(t.distanceDisplayConditionProperty))this.updatersWithAttributes.set(i,t);else{let r=this;this.subscriptions.set(i,t.entity.definitionChanged.addEventListener(function(o,s,a,c){s==="isShowing"&&r.showsUpdated.set(t.id,t)}))}this.createPrimitive=!0};Kp.prototype.remove=function(e){let t=e.id,n=this.geometry.get(t);if(this.createPrimitive=this.geometry.remove(t)||this.createPrimitive,this.updaters.remove(t)){this.rectangleCollisionCheck.remove(t,n.geometry.rectangle),this.updatersWithAttributes.remove(t);let i=this.subscriptions.get(t);return l(i)&&(i(),this.subscriptions.remove(t),this.showsUpdated.remove(t)),!0}return!1};Kp.prototype.update=function(e){let t=!0,n=this.primitive,i=this.primitives,r=this.geometry.values,o;if(this.createPrimitive){if(r.length>0){l(n)&&(l(this.oldPrimitive)?i.remove(n):this.oldPrimitive=n),this.material=yo.getValue(e,this.materialProperty,this.material);let a=this.appearanceType;n=new Xl({show:!1,asynchronous:!0,geometryInstances:r.slice(),appearance:new a({material:this.material}),classificationType:this.classificationType}),i.add(n,this.zIndex),t=!1}else{l(n)&&(i.remove(n),n=void 0);let a=this.oldPrimitive;l(a)&&(i.remove(a),this.oldPrimitive=void 0)}this.attributes.removeAll(),this.primitive=n,this.createPrimitive=!1}else if(l(n)&&n.ready){n.show=!0,l(this.oldPrimitive)&&(i.remove(this.oldPrimitive),this.oldPrimitive=void 0),this.material=yo.getValue(e,this.materialProperty,this.material),this.primitive.appearance.material=this.material;let s=this.updatersWithAttributes.values,a=s.length;for(o=0;o<a;o++){let c=s[o],u=c.entity,f=this.geometry.get(c.id),d=this.attributes.get(f.id.id);l(d)||(d=n.getGeometryInstanceAttributes(f.id),this.attributes.set(f.id.id,d));let p=u.isShowing&&(c.hasConstantFill||c.isFilled(e)),g=d.show[0]===1;p!==g&&(d.show=Dn.toValue(p,d.show));let m=c.distanceDisplayConditionProperty;if(!X.isConstant(m)){let y=X.getValueOrDefault(m,e,RJe,DJe);Ht.equals(y,d._lastDistanceDisplayCondition)||(d._lastDistanceDisplayCondition=Ht.clone(y,d._lastDistanceDisplayCondition),d.distanceDisplayCondition=ti.toValue(y,d.distanceDisplayCondition))}}this.updateShows(n)}else l(n)&&!n.ready&&(t=!1);return t};Kp.prototype.updateShows=function(e){let t=this.showsUpdated.values,n=t.length;for(let i=0;i<n;i++){let r=t[i],o=r.entity,s=this.geometry.get(r.id),a=this.attributes.get(s.id.id);l(a)||(a=e.getGeometryInstanceAttributes(s.id),this.attributes.set(s.id.id,a));let c=o.isShowing,u=a.show[0]===1;c!==u&&(a.show=Dn.toValue(c,a.show),s.attributes.show.value[0]=a.show[0])}this.showsUpdated.removeAll()};Kp.prototype.contains=function(e){return this.updaters.contains(e.id)};Kp.prototype.getBoundingSphere=function(e,t){let n=this.primitive;if(!n.ready)return Pt.PENDING;let i=n.getGeometryInstanceAttributes(e.entity);return!l(i)||!l(i.boundingSphere)||l(i.show)&&i.show[0]===0?Pt.FAILED:(i.boundingSphere.clone(t),Pt.DONE)};Kp.prototype.destroy=function(){let e=this.primitive,t=this.primitives;l(e)&&t.remove(e);let n=this.oldPrimitive;l(n)&&t.remove(n)};function wS(e,t,n){this._items=[],this._primitives=e,this._classificationType=t,this._appearanceType=n}wS.prototype.add=function(e,t){let n=this._items,i=n.length,r=t.createFillGeometryInstance(e),o=If.shouldUseSphericalCoordinates(r.geometry.rectangle),s=X.getValueOrDefault(t.zIndex,0);for(let c=0;c<i;++c){let u=n[c];if(u.isMaterial(t)&&u.usingSphericalTextureCoordinates===o&&u.zIndex===s&&!u.overlapping(r.geometry.rectangle)){u.add(e,t,r);return}}let a=new Kp(this._primitives,this._classificationType,this._appearanceType,t.fillMaterialProperty,o,s);a.add(e,t,r),n.push(a)};wS.prototype.remove=function(e){let t=this._items,n=t.length;for(let i=n-1;i>=0&&!t[i].remove(e);i--);};wS.prototype.update=function(e){let t,n=this._items,i=n.length;for(t=i-1;t>=0;t--){let o=n[t];o.updaters.length===0&&(n.splice(t,1),o.destroy())}let r=!0;for(t=0;t<n.length;t++)r=n[t].update(e)&&r;return r};wS.prototype.getBoundingSphere=function(e,t){let n=this._items,i=n.length;for(let r=0;r<i;r++){let o=n[r];if(o.contains(e))return o.getBoundingSphere(e,t)}return Pt.FAILED};wS.prototype.removeAllPrimitives=function(){let e=this._items,t=e.length;for(let n=0;n<t;n++)e[n].destroy();this._items.length=0};var jL=wS;var OJe=new z,MJe=new Ht,NJe=new Ht,LJe=h.ZERO,FJe=new h;function Hg(e,t,n,i){this.translucent=t,this.width=n,this.shadows=i,this.primitives=e,this.createPrimitive=!1,this.waitingOnCreate=!1,this.primitive=void 0,this.oldPrimitive=void 0,this.geometry=new Ut,this.updaters=new Ut,this.updatersWithAttributes=new Ut,this.attributes=new Ut,this.itemsToRemove=[],this.subscriptions=new Ut,this.showsUpdated=new Ut}Hg.prototype.add=function(e,t){let n=e.id;if(this.createPrimitive=!0,this.geometry.set(n,t),this.updaters.set(n,e),!e.hasConstantOutline||!e.outlineColorProperty.isConstant||!X.isConstant(e.distanceDisplayConditionProperty)||!X.isConstant(e.terrainOffsetProperty))this.updatersWithAttributes.set(n,e);else{let i=this;this.subscriptions.set(n,e.entity.definitionChanged.addEventListener(function(r,o,s,a){o==="isShowing"&&i.showsUpdated.set(e.id,e)}))}};Hg.prototype.remove=function(e){let t=e.id;if(this.createPrimitive=this.geometry.remove(t)||this.createPrimitive,this.updaters.remove(t)){this.updatersWithAttributes.remove(t);let n=this.subscriptions.get(t);return l(n)&&(n(),this.subscriptions.remove(t),this.showsUpdated.remove(t)),!0}return!1};Hg.prototype.update=function(e){let t=!0,n=0,i=this.primitive,r=this.primitives,o;if(this.createPrimitive){let s=this.geometry.values;if(s.length>0)l(i)&&(l(this.oldPrimitive)?r.remove(i):this.oldPrimitive=i),i=new On({show:!1,asynchronous:!0,geometryInstances:s.slice(),appearance:new yn({flat:!0,translucent:this.translucent,renderState:{lineWidth:this.width}}),shadows:this.shadows}),r.add(i),t=!1;else{l(i)&&(r.remove(i),i=void 0);let c=this.oldPrimitive;l(c)&&(r.remove(c),this.oldPrimitive=void 0)}this.attributes.removeAll(),this.primitive=i,this.createPrimitive=!1,this.waitingOnCreate=!0}else if(l(i)&&i.ready){i.show=!0,l(this.oldPrimitive)&&(r.remove(this.oldPrimitive),this.oldPrimitive=void 0);let s=this.updatersWithAttributes.values,a=s.length,c=this.waitingOnCreate;for(o=0;o<a;o++){let u=s[o],f=this.geometry.get(u.id),d=this.attributes.get(f.id.id);if(l(d)||(d=i.getGeometryInstanceAttributes(f.id),this.attributes.set(f.id.id,d)),!u.outlineColorProperty.isConstant||c){let A=u.outlineColorProperty,b=X.getValueOrDefault(A,e,z.WHITE,OJe);z.equals(d._lastColor,b)||(d._lastColor=z.clone(b,d._lastColor),d.color=Jt.toValue(b,d.color),(this.translucent&&d.color[3]===255||!this.translucent&&d.color[3]!==255)&&(this.itemsToRemove[n++]=u))}let p=u.entity.isShowing&&(u.hasConstantOutline||u.isOutlineVisible(e)),g=d.show[0]===1;p!==g&&(d.show=Dn.toValue(p,d.show));let m=u.distanceDisplayConditionProperty;if(!X.isConstant(m)){let A=X.getValueOrDefault(m,e,NJe,MJe);Ht.equals(A,d._lastDistanceDisplayCondition)||(d._lastDistanceDisplayCondition=Ht.clone(A,d._lastDistanceDisplayCondition),d.distanceDisplayCondition=ti.toValue(A,d.distanceDisplayCondition))}let y=u.terrainOffsetProperty;if(!X.isConstant(y)){let A=X.getValueOrDefault(y,e,LJe,FJe);h.equals(A,d._lastOffset)||(d._lastOffset=h.clone(A,d._lastOffset),d.offset=Tr.toValue(A,d.offset))}}this.updateShows(i),this.waitingOnCreate=!1}else l(i)&&!i.ready&&(t=!1);return this.itemsToRemove.length=n,t};Hg.prototype.updateShows=function(e){let t=this.showsUpdated.values,n=t.length;for(let i=0;i<n;i++){let r=t[i],o=this.geometry.get(r.id),s=this.attributes.get(o.id.id);l(s)||(s=e.getGeometryInstanceAttributes(o.id),this.attributes.set(o.id.id,s));let a=r.entity.isShowing,c=s.show[0]===1;a!==c&&(s.show=Dn.toValue(a,s.show),o.attributes.show.value[0]=s.show[0])}this.showsUpdated.removeAll()};Hg.prototype.contains=function(e){return this.updaters.contains(e.id)};Hg.prototype.getBoundingSphere=function(e,t){let n=this.primitive;if(!n.ready)return Pt.PENDING;let i=n.getGeometryInstanceAttributes(e.entity);return!l(i)||!l(i.boundingSphere)||l(i.show)&&i.show[0]===0?Pt.FAILED:(i.boundingSphere.clone(t),Pt.DONE)};Hg.prototype.removeAllPrimitives=function(){let e=this.primitives,t=this.primitive;l(t)&&(e.remove(t),this.primitive=void 0,this.geometry.removeAll(),this.updaters.removeAll());let n=this.oldPrimitive;l(n)&&(e.remove(n),this.oldPrimitive=void 0)};function IS(e,t,n){this._primitives=e,this._scene=t,this._shadows=n,this._solidBatches=new Ut,this._translucentBatches=new Ut}IS.prototype.add=function(e,t){let n=t.createOutlineGeometryInstance(e),i=this._scene.clampLineWidth(t.outlineWidth),r,o;n.attributes.color.value[3]===255?(r=this._solidBatches,o=r.get(i),l(o)||(o=new Hg(this._primitives,!1,i,this._shadows),r.set(i,o)),o.add(t,n)):(r=this._translucentBatches,o=r.get(i),l(o)||(o=new Hg(this._primitives,!0,i,this._shadows),r.set(i,o)),o.add(t,n))};IS.prototype.remove=function(e){let t,n=this._solidBatches.values,i=n.length;for(t=0;t<i;t++)if(n[t].remove(e))return;let r=this._translucentBatches.values,o=r.length;for(t=0;t<o;t++)if(r[t].remove(e))return};IS.prototype.update=function(e){let t,n,i,r,o=this._solidBatches.values,s=o.length,a=this._translucentBatches.values,c=a.length,u,f=!0,d;do{for(d=!1,n=0;n<s;n++){r=o[n],f=r.update(e),u=r.itemsToRemove;let p=u.length;if(p>0)for(d=!0,t=0;t<p;t++)i=u[t],r.remove(i),this.add(e,i)}for(n=0;n<c;n++){r=a[n],f=r.update(e),u=r.itemsToRemove;let p=u.length;if(p>0)for(d=!0,t=0;t<p;t++)i=u[t],r.remove(i),this.add(e,i)}}while(d);return f};IS.prototype.getBoundingSphere=function(e,t){let n,i=this._solidBatches.values,r=i.length;for(n=0;n<r;n++){let a=i[n];if(a.contains(e))return a.getBoundingSphere(e,t)}let o=this._translucentBatches.values,s=o.length;for(n=0;n<s;n++){let a=o[n];if(a.contains(e))return a.getBoundingSphere(e,t)}return Pt.FAILED};IS.prototype.removeAllPrimitives=function(){let e,t=this._solidBatches.values,n=t.length;for(e=0;e<n;e++)t[e].removeAllPrimitives();let i=this._translucentBatches.values,r=i.length;for(e=0;e<r;e++)i[e].removeAllPrimitives()};var PS=IS;var BJe=[];function zu(e,t,n,i){n=n??e.primitives,i=i??e.groundPrimitives,this._scene=e,this._primitives=n,this._groundPrimitives=i,this._entityCollection=void 0,this._addedObjects=new Ut,this._removedObjects=new Ut,this._changedObjects=new Ut;let r=Pn.NUMBER_OF_SHADOW_MODES;this._outlineBatches=new Array(r*2),this._closedColorBatches=new Array(r*2),this._closedMaterialBatches=new Array(r*2),this._openColorBatches=new Array(r*2),this._openMaterialBatches=new Array(r*2);let o=Jr.supportsMaterialsforEntitiesOnTerrain(e);this._supportsMaterialsforEntitiesOnTerrain=o;let s;for(s=0;s<r;++s)this._outlineBatches[s]=new PS(n,e,s,!1),this._outlineBatches[r+s]=new PS(n,e,s,!0),this._closedColorBatches[s]=new qd(n,yn,void 0,!0,s,!0),this._closedColorBatches[r+s]=new qd(n,yn,void 0,!0,s,!1),this._closedMaterialBatches[s]=new Yd(n,Er,void 0,!0,s,!0),this._closedMaterialBatches[r+s]=new Yd(n,Er,void 0,!0,s,!1),this._openColorBatches[s]=new qd(n,yn,void 0,!1,s,!0),this._openColorBatches[r+s]=new qd(n,yn,void 0,!1,s,!1),this._openMaterialBatches[s]=new Yd(n,Er,void 0,!1,s,!0),this._openMaterialBatches[r+s]=new Yd(n,Er,void 0,!1,s,!1);let a=Qn.NUMBER_OF_CLASSIFICATION_TYPES,c=new Array(a),u=[];if(o)for(s=0;s<a;++s)u.push(new jL(i,s,Er)),c[s]=new SS(i,s);else for(s=0;s<a;++s)c[s]=new SS(i,s);this._groundColorBatches=c,this._groundMaterialBatches=u,this._dynamicBatch=new Kx(n,i),this._batches=this._outlineBatches.concat(this._closedColorBatches,this._closedMaterialBatches,this._openColorBatches,this._openMaterialBatches,this._groundColorBatches,this._groundMaterialBatches,this._dynamicBatch),this._subscriptions=new Ut,this._updaterSets=new Ut,this._entityCollection=t,t.collectionChanged.addEventListener(zu.prototype._onCollectionChanged,this),this._onCollectionChanged(t,t.values,BJe)}zu.registerUpdater=function(e){gT.registerUpdater(e)};zu.unregisterUpdater=function(e){gT.unregisterUpdater(e)};zu.prototype.update=function(e){let t=this._addedObjects,n=t.values,i=this._removedObjects,r=i.values,o=this._changedObjects,s=o.values,a,c,u,f,d=this;for(a=s.length-1;a>-1;a--)c=s[a],u=c.id,f=this._updaterSets.get(u),f.entity===c?f.forEach(function(y){d._removeUpdater(y),d._insertUpdaterIntoBatch(e,y)}):(r.push(c),n.push(c));for(a=r.length-1;a>-1;a--)c=r[a],u=c.id,f=this._updaterSets.get(u),f.forEach(this._removeUpdater.bind(this)),f.destroy(),this._updaterSets.remove(u),this._subscriptions.get(u)(),this._subscriptions.remove(u);for(a=n.length-1;a>-1;a--)c=n[a],u=c.id,f=new gT(c,this._scene),this._updaterSets.set(u,f),f.forEach(function(y){d._insertUpdaterIntoBatch(e,y)}),this._subscriptions.set(u,f.geometryChanged.addEventListener(zu._onGeometryChanged,this));t.removeAll(),i.removeAll(),o.removeAll();let p=!0,g=this._batches,m=g.length;for(a=0;a<m;a++)p=g[a].update(e)&&p;return p};var kJe=[],UJe=new ue;zu.prototype.getBoundingSphere=function(e,t){let n=kJe,i=UJe,r=0,o,s=this._batches,a=s.length,c=e.id,u=this._updaterSets.get(c).updaters;for(let f=0;f<u.length;f++){let d=u[f];for(let p=0;p<a;p++){if(o=s[p].getBoundingSphere(d,i),o===Pt.PENDING)return Pt.PENDING;o===Pt.DONE&&(n[r]=ue.clone(i,n[r]),r++)}}return r===0?Pt.FAILED:(n.length=r,ue.fromBoundingSpheres(n,t),Pt.DONE)};zu.prototype.isDestroyed=function(){return!1};zu.prototype.destroy=function(){this._entityCollection.collectionChanged.removeEventListener(zu.prototype._onCollectionChanged,this),this._addedObjects.removeAll(),this._removedObjects.removeAll();let e,t=this._batches,n=t.length;for(e=0;e<n;e++)t[e].removeAllPrimitives();let i=this._subscriptions.values;for(n=i.length,e=0;e<n;e++)i[e]();this._subscriptions.removeAll();let r=this._updaterSets.values;for(n=r.length,e=0;e<n;e++)r[e].destroy();return this._updaterSets.removeAll(),le(this)};zu.prototype._removeUpdater=function(e){let t=this._batches,n=t.length;for(let i=0;i<n;i++)t[i].remove(e)};zu.prototype._insertUpdaterIntoBatch=function(e,t){if(t.isDynamic){this._dynamicBatch.add(e,t);return}let n;(t.outlineEnabled||t.fillEnabled)&&(n=t.shadowsProperty.getValue(e));let i=Pn.NUMBER_OF_SHADOW_MODES;if(t.outlineEnabled&&(l(t.terrainOffsetProperty)?this._outlineBatches[i+n].add(e,t):this._outlineBatches[n].add(e,t)),t.fillEnabled)if(t.onTerrain){let r=t.classificationTypeProperty.getValue(e);t.fillMaterialProperty instanceof Kt?this._groundColorBatches[r].add(e,t):this._groundMaterialBatches[r].add(e,t)}else t.isClosed?t.fillMaterialProperty instanceof Kt?l(t.terrainOffsetProperty)?this._closedColorBatches[i+n].add(e,t):this._closedColorBatches[n].add(e,t):l(t.terrainOffsetProperty)?this._closedMaterialBatches[i+n].add(e,t):this._closedMaterialBatches[n].add(e,t):t.fillMaterialProperty instanceof Kt?l(t.terrainOffsetProperty)?this._openColorBatches[i+n].add(e,t):this._openColorBatches[n].add(e,t):l(t.terrainOffsetProperty)?this._openMaterialBatches[i+n].add(e,t):this._openMaterialBatches[n].add(e,t)};zu._onGeometryChanged=function(e){let t=this._removedObjects,n=this._changedObjects,i=e.entity,r=i.id;!l(t.get(r))&&!l(n.get(r))&&n.set(r,i)};zu.prototype._onCollectionChanged=function(e,t,n){let i=this._addedObjects,r=this._removedObjects,o=this._changedObjects,s,a,c;for(s=n.length-1;s>-1;s--)c=n[s],a=c.id,i.remove(a)||(r.set(a,c),o.remove(a));for(s=t.length-1;s>-1;s--)c=t[s],a=c.id,r.remove(a)?o.set(a,c):i.set(a,c)};var HL=zu;var zJe=1,VJe="30px sans-serif",jJe=_o.FILL,HJe=z.WHITE,GJe=z.BLACK,WJe=1,qJe=!1,YJe=new z(.165,.165,.165,.8),XJe=new U(7,5),KJe=U.ZERO,$Je=h.ZERO,JJe=We.NONE,ZJe=Vi.CENTER,QJe=Gn.CENTER,eZe=new h,tZe=new z,nZe=new z,iZe=new z,rZe=new U,oZe=new h,sZe=new U,aZe=new qt,cZe=new qt,lZe=new qt,uZe=new Ht;function pAe(e){this.entity=e,this.label=void 0,this.index=void 0}function lA(e,t){t.collectionChanged.addEventListener(lA.prototype._onCollectionChanged,this),this._cluster=e,this._entityCollection=t,this._items=new Ut,this._onCollectionChanged(t,t.values,[],[])}lA.prototype.update=function(e){let t=this._items.values,n=this._cluster;for(let i=0,r=t.length;i<r;i++){let o=t[i],s=o.entity,a=s._label,c,u=o.label,f=s.isShowing&&s.isAvailable(e)&&X.getValueOrDefault(a._show,e,!0),d;if(f&&(d=X.getValueOrUndefined(s._position,e,eZe),c=X.getValueOrUndefined(a._text,e),f=l(d)&&l(c)),!f){F$(o,s,n);continue}X.isConstant(s._position)||(n._clusterDirty=!0);let p=!1,g=X.getValueOrDefault(a._heightReference,e,JJe);l(u)||(u=n.getLabel(s),u.id=s,o.label=u,p=h.equals(u.position,d)&&u.heightReference===g),u.show=!0,u.position=d,u.text=c,u.scale=X.getValueOrDefault(a._scale,e,zJe),u.font=X.getValueOrDefault(a._font,e,VJe),u.style=X.getValueOrDefault(a._style,e,jJe),u.fillColor=X.getValueOrDefault(a._fillColor,e,HJe,tZe),u.outlineColor=X.getValueOrDefault(a._outlineColor,e,GJe,nZe),u.outlineWidth=X.getValueOrDefault(a._outlineWidth,e,WJe),u.showBackground=X.getValueOrDefault(a._showBackground,e,qJe),u.backgroundColor=X.getValueOrDefault(a._backgroundColor,e,YJe,iZe),u.backgroundPadding=X.getValueOrDefault(a._backgroundPadding,e,XJe,rZe),u.pixelOffset=X.getValueOrDefault(a._pixelOffset,e,KJe,sZe),u.eyeOffset=X.getValueOrDefault(a._eyeOffset,e,$Je,oZe),u.heightReference=g,u.horizontalOrigin=X.getValueOrDefault(a._horizontalOrigin,e,ZJe),u.verticalOrigin=X.getValueOrDefault(a._verticalOrigin,e,QJe),u.translucencyByDistance=X.getValueOrUndefined(a._translucencyByDistance,e,aZe),u.pixelOffsetScaleByDistance=X.getValueOrUndefined(a._pixelOffsetScaleByDistance,e,cZe),u.scaleByDistance=X.getValueOrUndefined(a._scaleByDistance,e,lZe),u.distanceDisplayCondition=X.getValueOrUndefined(a._distanceDisplayCondition,e,uZe),u.disableDepthTestDistance=X.getValueOrUndefined(a._disableDepthTestDistance,e),p&&u._updateClamping()}return!0};lA.prototype.getBoundingSphere=function(e,t){let n=this._items.get(e.id);if(!l(n)||!l(n.label))return Pt.FAILED;let i=n.label;if(i.heightReference===We.NONE)t.center=h.clone(i.position,t.center);else if(i._clampedToSurface)t.center=h.clone(i._clampedPosition,t.center);else{let r=this._cluster._scene,o=this._items,s=Jh(r,n,i.position,[i],()=>o.get(e.id)===n);if(s===void 0)return Pt.PENDING;s===null?t.center=h.clone(i.position,t.center):t.center=Eg(i.position,s,i.heightReference,r.ellipsoid??ee.default,t.center)}return t.radius=0,Pt.DONE};lA.prototype.isDestroyed=function(){return!1};lA.prototype.destroy=function(){this._entityCollection.collectionChanged.removeEventListener(lA.prototype._onCollectionChanged,this);let e=this._entityCollection.values;for(let t=0;t<e.length;t++)this._cluster.removeLabel(e[t]);return le(this)};lA.prototype._onCollectionChanged=function(e,t,n,i){let r,o,s=this._items,a=this._cluster;for(r=t.length-1;r>-1;r--)o=t[r],l(o._label)&&l(o._position)&&s.set(o.id,new pAe(o));for(r=i.length-1;r>-1;r--)o=i[r],l(o._label)&&l(o._position)?s.contains(o.id)||s.set(o.id,new pAe(o)):(F$(s.get(o.id),o,a),s.remove(o.id));for(r=n.length-1;r>-1;r--)o=n[r],F$(s.get(o.id),o,a),s.remove(o.id)};function F$(e,t,n){l(e)&&(e.label=void 0,n.removeLabel(t))}var GL=lA;var DS={HIGHLIGHT:0,REPLACE:1,MIX:2};DS.getColorBlend=function(e,t){if(e===DS.HIGHLIGHT)return 0;if(e===DS.REPLACE)return 1;if(e===DS.MIX)return D.clamp(t,D.EPSILON4,1)};Object.freeze(DS);var sl=DS;/*! @license DOMPurify 3.4.14 | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/3.4.14/LICENSE */function gAe(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,i=Array(t);n<t;n++)i[n]=e[n];return i}function fZe(e){if(Array.isArray(e))return e}function dZe(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var i,r,o,s,a=[],c=!0,u=!1;try{if(o=(n=n.call(e)).next,t!==0)for(;!(c=(i=o.call(n)).done)&&(a.push(i.value),a.length!==t);c=!0);}catch(f){u=!0,r=f}finally{try{if(!c&&n.return!=null&&(s=n.return(),Object(s)!==s))return}finally{if(u)throw r}}return a}}function hZe(){throw new TypeError(`Invalid attempt to destructure non-iterable instance. +In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function mZe(e,t){return fZe(e)||dZe(e,t)||pZe(e,t)||hZe()}function pZe(e,t){if(e){if(typeof e=="string")return gAe(e,t);var n={}.toString.call(e).slice(8,-1);return n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set"?Array.from(e):n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?gAe(e,t):void 0}}var RAe=Object.entries,_Ae=Object.setPrototypeOf,gZe=Object.isFrozen,_Ze=Object.getPrototypeOf,yZe=Object.getOwnPropertyDescriptor,Va=Object.freeze,dc=Object.seal,RS=Object.create,OAe=typeof Reflect<"u"&&Reflect,H$=OAe.apply,G$=OAe.construct;Va||(Va=function(t){return t});dc||(dc=function(t){return t});H$||(H$=function(t,n){for(var i=arguments.length,r=new Array(i>2?i-2:0),o=2;o<i;o++)r[o-2]=arguments[o];return t.apply(n,r)});G$||(G$=function(t){for(var n=arguments.length,i=new Array(n>1?n-1:0),r=1;r<n;r++)i[r-1]=arguments[r];return new t(...i)});var bT=Aa(Array.prototype.forEach),AZe=Aa(Array.prototype.lastIndexOf),yAe=Aa(Array.prototype.pop),WL=Aa(Array.prototype.push),bZe=Aa(Array.prototype.splice),OS=Array.isArray,XL=Aa(String.prototype.toLowerCase),B$=Aa(String.prototype.toString),AAe=Aa(String.prototype.match),qL=Aa(String.prototype.replace),bAe=Aa(String.prototype.indexOf),xZe=Aa(String.prototype.trim),TZe=Aa(Number.prototype.toString),EZe=Aa(Boolean.prototype.toString),xAe=typeof BigInt>"u"?null:Aa(BigInt.prototype.toString),TAe=typeof Symbol>"u"?null:Aa(Symbol.prototype.toString),Vu=Aa(Object.prototype.hasOwnProperty),YL=Aa(Object.prototype.toString),al=Aa(RegExp.prototype.test),AT=CZe(TypeError);function Aa(e){return function(t){t instanceof RegExp&&(t.lastIndex=0);for(var n=arguments.length,i=new Array(n>1?n-1:0),r=1;r<n;r++)i[r-1]=arguments[r];return H$(e,t,i)}}function CZe(e){return function(){for(var t=arguments.length,n=new Array(t),i=0;i<t;i++)n[i]=arguments[i];return G$(e,n)}}function Ir(e,t){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:XL;if(_Ae&&_Ae(e,null),!OS(t))return e;let i=t.length;for(;i--;){let r=t[i];if(typeof r=="string"){let o=n(r);o!==r&&(gZe(t)||(t[i]=o),r=o)}e[r]=!0}return e}function vZe(e){for(let t=0;t<e.length;t++)Vu(e,t)||(e[t]=null);return e}function zf(e){let t=RS(null);for(let i of RAe(e)){var n=mZe(i,2);let r=n[0],o=n[1];Vu(e,r)&&(OS(o)?t[r]=vZe(o):o&&typeof o=="object"&&o.constructor===Object?t[r]=zf(o):t[r]=o)}return t}function SZe(e){switch(typeof e){case"string":return e;case"number":return TZe(e);case"boolean":return EZe(e);case"bigint":return xAe?xAe(e):"0";case"symbol":return TAe?TAe(e):"Symbol()";case"undefined":return YL(e);case"function":case"object":{if(e===null)return YL(e);let t=e,n=gm(t,"toString");if(typeof n=="function"){let i=n(t);return typeof i=="string"?i:YL(i)}return YL(e)}default:return YL(e)}}function gm(e,t){for(;e!==null;){let i=yZe(e,t);if(i){if(i.get)return Aa(i.get);if(typeof i.value=="function")return Aa(i.value)}e=_Ze(e)}function n(){return null}return n}function wZe(e){try{return al(e,""),!0}catch{return!1}}var EAe=Va(["a","abbr","acronym","address","area","article","aside","audio","b","bdi","bdo","big","blink","blockquote","body","br","button","canvas","caption","center","cite","code","col","colgroup","content","data","datalist","dd","decorator","del","details","dfn","dialog","dir","div","dl","dt","element","em","fieldset","figcaption","figure","font","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","img","input","ins","kbd","label","legend","li","main","map","mark","marquee","menu","menuitem","meter","nav","nobr","ol","optgroup","option","output","p","picture","pre","progress","q","rp","rt","ruby","s","samp","search","section","select","shadow","slot","small","source","spacer","span","strike","strong","style","sub","summary","sup","table","tbody","td","template","textarea","tfoot","th","thead","time","tr","track","tt","u","ul","var","video","wbr"]),k$=Va(["svg","a","altglyph","altglyphdef","altglyphitem","animatecolor","animatemotion","animatetransform","circle","clippath","defs","desc","ellipse","enterkeyhint","exportparts","filter","font","g","glyph","glyphref","hkern","image","inputmode","line","lineargradient","marker","mask","metadata","mpath","part","path","pattern","polygon","polyline","radialgradient","rect","stop","style","switch","symbol","text","textpath","title","tref","tspan","view","vkern"]),U$=Va(["feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feDropShadow","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence"]),IZe=Va(["animate","color-profile","cursor","discard","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","foreignobject","hatch","hatchpath","mesh","meshgradient","meshpatch","meshrow","missing-glyph","script","set","solidcolor","unknown","use"]),z$=Va(["math","menclose","merror","mfenced","mfrac","mglyph","mi","mlabeledtr","mmultiscripts","mn","mo","mover","mpadded","mphantom","mroot","mrow","ms","mspace","msqrt","mstyle","msub","msup","msubsup","mtable","mtd","mtext","mtr","munder","munderover","mprescripts"]),PZe=Va(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),CAe=Va(["#text"]),vAe=Va(["accept","action","align","alt","autocapitalize","autocomplete","autopictureinpicture","autoplay","background","bgcolor","border","capture","cellpadding","cellspacing","checked","cite","class","clear","color","cols","colspan","command","commandfor","controls","controlslist","coords","crossorigin","datetime","decoding","default","dir","disabled","disablepictureinpicture","disableremoteplayback","download","draggable","enctype","enterkeyhint","exportparts","face","for","headers","height","hidden","high","href","hreflang","id","inert","inputmode","integrity","ismap","kind","label","lang","list","loading","loop","low","max","maxlength","media","method","min","minlength","multiple","muted","name","nonce","noshade","novalidate","nowrap","open","optimum","part","pattern","placeholder","playsinline","popover","popovertarget","popovertargetaction","poster","preload","pubdate","radiogroup","readonly","rel","required","rev","reversed","role","rows","rowspan","spellcheck","scope","selected","shape","size","sizes","slot","span","srclang","start","src","srcset","step","style","summary","tabindex","title","translate","type","usemap","valign","value","width","wrap","xmlns"]),V$=Va(["accent-height","accumulate","additive","alignment-baseline","amplitude","ascent","attributename","attributetype","azimuth","basefrequency","baseline-shift","begin","bias","by","class","clip","clippathunits","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","cx","cy","d","dx","dy","diffuseconstant","direction","display","divisor","dominant-baseline","dur","edgemode","elevation","end","exponent","fill","fill-opacity","fill-rule","filter","filterunits","flood-color","flood-opacity","font-family","font-size","font-size-adjust","font-stretch","font-style","font-variant","font-weight","fx","fy","g1","g2","glyph-name","glyphref","gradientunits","gradienttransform","height","href","id","image-rendering","in","in2","intercept","k","k1","k2","k3","k4","kerning","keypoints","keysplines","keytimes","lang","lengthadjust","letter-spacing","kernelmatrix","kernelunitlength","lighting-color","local","marker-end","marker-mid","marker-start","markerheight","markerunits","markerwidth","maskcontentunits","maskunits","max","mask","mask-type","media","method","mode","min","name","numoctaves","offset","operator","opacity","order","orient","orientation","origin","overflow","paint-order","path","pathlength","patterncontentunits","patterntransform","patternunits","pointer-events","points","preservealpha","preserveaspectratio","primitiveunits","r","rx","ry","radius","refx","refy","repeatcount","repeatdur","restart","result","rotate","scale","seed","shape-rendering","slope","specularconstant","specularexponent","spreadmethod","startoffset","stddeviation","stitchtiles","stop-color","stop-opacity","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke","stroke-width","style","surfacescale","systemlanguage","tabindex","tablevalues","targetx","targety","transform","transform-origin","text-anchor","text-decoration","text-orientation","text-rendering","textlength","type","u1","u2","unicode","values","vector-effect","viewbox","visibility","version","vert-adv-y","vert-origin-x","vert-origin-y","width","word-spacing","wrap","writing-mode","xchannelselector","ychannelselector","x","x1","x2","xmlns","y","y1","y2","z","zoomandpan"]),SAe=Va(["accent","accentunder","align","bevelled","close","columnalign","columnlines","columnspacing","columnspan","denomalign","depth","dir","display","displaystyle","encoding","fence","frame","height","href","id","largeop","length","linethickness","lquote","lspace","mathbackground","mathcolor","mathsize","mathvariant","maxsize","minsize","movablelimits","notation","numalign","open","rowalign","rowlines","rowspacing","rowspan","rspace","rquote","scriptlevel","scriptminsize","scriptsizemultiplier","selection","separator","separators","stretchy","subscriptshift","supscriptshift","symmetric","voffset","width","xmlns"]),yH=Va(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),DZe=dc(/{{[\w\W]*|^[\w\W]*}}/g),RZe=dc(/<%[\w\W]*|^[\w\W]*%>/g),OZe=dc(/\${[\w\W]*/g),MZe=dc(/^data-[\-\w.\u00B7-\uFFFF]+$/),NZe=dc(/^aria-[\-\w]+$/),wAe=dc(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),LZe=dc(/^(?:\w+script|data):/i),FZe=dc(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),BZe=dc(/^html$/i),kZe=dc(/^[a-z][.\w]*(-[.\w]+)+$/i),IAe=dc(/<[/\w!]/g),PAe=dc(/<[/\w]/g),UZe=dc(/<\/no(script|embed|frames)/i),zZe=dc(/\/>/i),Uf={element:1,attribute:2,text:3,cdataSection:4,entityReference:5,entityNode:6,processingInstruction:7,comment:8,document:9,documentType:10,documentFragment:11,notation:12},MAe=["style","script","xmp","iframe","noembed","noframes","plaintext","noscript"],VZe=Va(Ir({},MAe)),jZe=(function(){let e={};return bT(MAe,t=>{e[t]=dc(new RegExp("</"+t+"(?=[\\t\\n\\f\\r />])","i"))}),Va(e)})(),HZe=function(){return typeof window>"u"?null:window},GZe=function(t,n){if(typeof t!="object"||typeof t.createPolicy!="function")return null;let i=null,r="data-tt-policy-suffix";n&&n.hasAttribute(r)&&(i=n.getAttribute(r));let o="dompurify"+(i?"#"+i:"");try{return t.createPolicy(o,{createHTML(s){return s},createScriptURL(s){return s}})}catch{return console.warn("TrustedTypes policy "+o+" could not be created."),null}},DAe=function(){return{afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}},uA=function(t,n,i,r){return Vu(t,n)&&OS(t[n])?Ir(r.base?zf(r.base):{},t[n],r.transform):i},j$=function(t,n,i){let r=Vu(t,n)?t[n]:void 0;return r&&typeof r=="object"?zf(r):i()};function NAe(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:HZe(),t=Ct=>NAe(Ct);if(t.version="3.4.14",t.removed=[],!e||!e.document||e.document.nodeType!==Uf.document||!e.Element)return t.isSupported=!1,t;let n=e.document,i=n,r=i.currentScript;e.DocumentFragment;let o=e.HTMLTemplateElement,s=e.Node,a=e.Element,c=e.NodeFilter,u=e.NamedNodeMap;u===void 0&&(e.NamedNodeMap||e.MozNamedAttrMap),e.HTMLFormElement;let f=e.DOMParser,d=e.trustedTypes,p=a.prototype,g=gm(p,"cloneNode"),m=gm(p,"remove"),y=gm(p,"nextSibling"),A=gm(p,"childNodes"),b=gm(p,"parentNode"),x=gm(p,"shadowRoot"),T=gm(p,"attributes"),E=s&&s.prototype?gm(s.prototype,"nodeType"):null,v=s&&s.prototype?gm(s.prototype,"nodeName"):null,S=s&&s.prototype?gm(s.prototype,"ownerDocument"):null,I=function(ye){return E?E(ye):ye.nodeType},R=function(ye){return v?v(ye):ye.nodeName};if(typeof o=="function"){let Ct=n.createElement("template");Ct.content&&Ct.content.ownerDocument&&(n=Ct.content.ownerDocument)}let O,L="",_,C=!1,w=0,P=function(){if(w>0)throw AT('A configured TRUSTED_TYPES_POLICY callback (createHTML or createScriptURL) must not call DOMPurify.sanitize, as that causes infinite recursion. Do not pass a policy whose callbacks wrap DOMPurify as TRUSTED_TYPES_POLICY; see the "DOMPurify and Trusted Types" section of the README.')},M=function(ye){P(),w++;try{return O.createHTML(ye)}finally{w--}},F=function(ye){P(),w++;try{return O.createScriptURL(ye)}finally{w--}},V=function(){return C||(_=GZe(d,r),C=!0),_},B=n,j=B.implementation,k=B.createNodeIterator,G=B.createDocumentFragment,q=B.getElementsByTagName,Q=i.importNode,W=DAe();t.isSupported=typeof RAe=="function"&&typeof b=="function"&&j&&j.createHTMLDocument!==void 0;let J=DZe,Z=RZe,ae=OZe,Ae=MZe,fe=NZe,xe=LZe,ge=FZe,we=kZe,Se=wAe,Re=null,Qe=Ir({},[...EAe,...k$,...U$,...z$,...CAe]),He=null,Xe=Ir({},[...vAe,...V$,...SAe,...yH]),$e=Object.seal(RS(null,{tagNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},allowCustomizedBuiltInElements:{writable:!0,configurable:!1,enumerable:!0,value:!1}})),Pe=null,qe=null,st=Object.seal(RS(null,{tagCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeCheck:{writable:!0,configurable:!1,enumerable:!0,value:null}})),vt=!0,Gt=!0,lt=!1,mt=!0,ft=!1,Xt=!0,rt=!1,ht=!1,Bi=null,Xn=null,bi=!1,Wi=!1,wi=!1,hi=!1,xi=!0,jn=!1,nn="user-content-",Wn=!0,Zi=!1,Mr={},fo=null,Bs=Ir({},["annotation-xml","audio","colgroup","desc","foreignobject","head","iframe","math","mi","mn","mo","ms","mtext","noembed","noframes","noscript","plaintext","script","selectedcontent","style","svg","template","thead","title","video","xmp"]),Ks=null,no=Ir({},["audio","video","img","source","image","track"]),gi=null,ho=Ir({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),ur="http://www.w3.org/1998/Math/MathML",Zo="http://www.w3.org/2000/svg",Bn="http://www.w3.org/1999/xhtml",qi=Bn,ki=!1,Nr=null,Wc=Ir({},[ur,Zo,Bn],B$),bd=Va(["mi","mo","mn","ms","mtext"]),xp=Ir({},bd),Nh=Va(["annotation-xml"]),da=Ir({},Nh),Tp=Ir({},["title","style","font","a","script"]),ks=null,tc=["application/xhtml+xml","text/html"],Kb="text/html",ri=null,Kr=null,Ol=n.createElement("form"),Z0=function(ye){return ye instanceof RegExp||ye instanceof Function},Ma=function(){let ye=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(Kr&&Kr===ye)return;(!ye||typeof ye!="object")&&(ye={}),ye=zf(ye),ks=tc.indexOf(ye.PARSER_MEDIA_TYPE)===-1?Kb:ye.PARSER_MEDIA_TYPE,ri=ks==="application/xhtml+xml"?B$:XL,Re=uA(ye,"ALLOWED_TAGS",Qe,{transform:ri}),He=uA(ye,"ALLOWED_ATTR",Xe,{transform:ri}),Nr=uA(ye,"ALLOWED_NAMESPACES",Wc,{transform:B$}),gi=uA(ye,"ADD_URI_SAFE_ATTR",ho,{transform:ri,base:ho}),Ks=uA(ye,"ADD_DATA_URI_TAGS",no,{transform:ri,base:no}),fo=uA(ye,"FORBID_CONTENTS",Bs,{transform:ri}),Pe=uA(ye,"FORBID_TAGS",zf({}),{transform:ri}),qe=uA(ye,"FORBID_ATTR",zf({}),{transform:ri}),Mr=Vu(ye,"USE_PROFILES")?ye.USE_PROFILES&&typeof ye.USE_PROFILES=="object"?zf(ye.USE_PROFILES):ye.USE_PROFILES:!1,vt=ye.ALLOW_ARIA_ATTR!==!1,Gt=ye.ALLOW_DATA_ATTR!==!1,lt=ye.ALLOW_UNKNOWN_PROTOCOLS||!1,mt=ye.ALLOW_SELF_CLOSE_IN_ATTR!==!1,ft=ye.SAFE_FOR_TEMPLATES||!1,Xt=ye.SAFE_FOR_XML!==!1,rt=ye.WHOLE_DOCUMENT||!1,Wi=ye.RETURN_DOM||!1,wi=ye.RETURN_DOM_FRAGMENT||!1,hi=ye.RETURN_TRUSTED_TYPE||!1,bi=ye.FORCE_BODY||!1,xi=ye.SANITIZE_DOM!==!1,jn=ye.SANITIZE_NAMED_PROPS||!1,Wn=ye.KEEP_CONTENT!==!1,Zi=ye.IN_PLACE||!1,Se=wZe(ye.ALLOWED_URI_REGEXP)?ye.ALLOWED_URI_REGEXP:wAe,qi=typeof ye.NAMESPACE=="string"?ye.NAMESPACE:Bn,xp=j$(ye,"MATHML_TEXT_INTEGRATION_POINTS",()=>Ir({},bd)),da=j$(ye,"HTML_INTEGRATION_POINTS",()=>Ir({},Nh));let Fe=j$(ye,"CUSTOM_ELEMENT_HANDLING",()=>RS(null));if($e=RS(null),Vu(Fe,"tagNameCheck")&&Z0(Fe.tagNameCheck)&&($e.tagNameCheck=Fe.tagNameCheck),Vu(Fe,"attributeNameCheck")&&Z0(Fe.attributeNameCheck)&&($e.attributeNameCheck=Fe.attributeNameCheck),Vu(Fe,"allowCustomizedBuiltInElements")&&typeof Fe.allowCustomizedBuiltInElements=="boolean"&&($e.allowCustomizedBuiltInElements=Fe.allowCustomizedBuiltInElements),dc($e),ft&&(Gt=!1),wi&&(Wi=!0),Mr&&(Re=Ir({},CAe),He=RS(null),Mr.html===!0&&(Ir(Re,EAe),Ir(He,vAe)),Mr.svg===!0&&(Ir(Re,k$),Ir(He,V$),Ir(He,yH)),Mr.svgFilters===!0&&(Ir(Re,U$),Ir(He,V$),Ir(He,yH)),Mr.mathMl===!0&&(Ir(Re,z$),Ir(He,SAe),Ir(He,yH))),st.tagCheck=null,st.attributeCheck=null,Vu(ye,"ADD_TAGS")&&(typeof ye.ADD_TAGS=="function"?st.tagCheck=ye.ADD_TAGS:OS(ye.ADD_TAGS)&&(Re===Qe&&(Re=zf(Re)),Ir(Re,ye.ADD_TAGS,ri))),Vu(ye,"ADD_ATTR")&&(typeof ye.ADD_ATTR=="function"?st.attributeCheck=ye.ADD_ATTR:OS(ye.ADD_ATTR)&&(He===Xe&&(He=zf(He)),Ir(He,ye.ADD_ATTR,ri))),Vu(ye,"ADD_FORBID_CONTENTS")&&OS(ye.ADD_FORBID_CONTENTS)&&(fo===Bs&&(fo=zf(fo)),Ir(fo,ye.ADD_FORBID_CONTENTS,ri)),Wn&&(Re["#text"]=!0),rt&&Ir(Re,["html","head","body"]),Re.table&&(Ir(Re,["tbody"]),delete Pe.tbody),ye.TRUSTED_TYPES_POLICY){if(typeof ye.TRUSTED_TYPES_POLICY.createHTML!="function")throw AT('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if(typeof ye.TRUSTED_TYPES_POLICY.createScriptURL!="function")throw AT('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');let gt=O;O=ye.TRUSTED_TYPES_POLICY;try{L=M("")}catch(on){throw O=gt,on}}else ye.TRUSTED_TYPES_POLICY===null?(O=void 0,L=""):(O===void 0&&(O=V()),O&&typeof L=="string"&&(L=M("")));Va&&Va(ye),Kr=ye},Ep=Ir({},[...k$,...U$,...IZe]),Cy=Ir({},[...z$,...PZe]),Sq=function(ye,Fe,gt){return Fe.namespaceURI===Bn?ye==="svg":Fe.namespaceURI===ur?ye==="svg"&&(gt==="annotation-xml"||xp[gt]):!!Ep[ye]},wq=function(ye,Fe,gt){return Fe.namespaceURI===Bn?ye==="math":Fe.namespaceURI===Zo?ye==="math"&&da[gt]:!!Cy[ye]},Iq=function(ye,Fe,gt){return Fe.namespaceURI===Zo&&!da[gt]||Fe.namespaceURI===ur&&!xp[gt]?!1:!Cy[ye]&&(Tp[ye]||!Ep[ye])},Pq=function(ye){let Fe=b(ye);(!Fe||!Fe.tagName)&&(Fe={namespaceURI:qi,tagName:"template"});let gt=XL(ye.tagName),on=XL(Fe.tagName);return Nr[ye.namespaceURI]?ye.namespaceURI===Zo?Sq(gt,Fe,on):ye.namespaceURI===ur?wq(gt,Fe,on):ye.namespaceURI===Bn?Iq(gt,Fe,on):!!(ks==="application/xhtml+xml"&&Nr[ye.namespaceURI]):!1},Cp=function(ye){WL(t.removed,{element:ye});try{b(ye).removeChild(ye)}catch{if(m(ye),!b(ye))throw AT("a node selected for removal could not be detached from its tree and cannot be safely returned; refusing to sanitize in place")}},QC=function(ye,Fe,gt){try{ye.removeAttributeNode(Fe)}catch{try{ye.removeAttribute(gt)}catch{}}},$b=function(ye){Jb(ye);let Fe=A(ye);if(Fe){let on=[];bT(Fe,In=>{WL(on,In)}),bT(on,In=>{try{m(In)}catch{}})}let gt=T(ye);if(gt)for(let on=gt.length-1;on>=0;--on){let In=gt[on],oi=In&&In.name;typeof oi=="string"&&QC(ye,In,oi)}},Lh=function(ye,Fe,gt){if(!gt)try{gt=Fe.getAttributeNode(ye)}catch{gt=null}WL(t.removed,{attribute:gt||null,from:Fe});try{gt?Fe.removeAttributeNode(gt):Fe.removeAttribute(ye)}catch{try{Fe.removeAttribute(ye)}catch{}}if(ye==="is")if(Wi||wi)try{Cp(Fe)}catch{}else try{Fe.setAttribute(ye,"")}catch{}},Dq=function(ye){let Fe=T(ye);if(Fe)for(let gt=Fe.length-1;gt>=0;--gt){let on=Fe[gt],In=on&&on.name;typeof In!="string"||He[ri(In)]||QC(ye,on,In)}},Jb=function(ye){let Fe=[ye];for(;Fe.length>0;){let gt=Fe.pop();I(gt)===Uf.element&&Dq(gt);let In=A(gt);if(In)for(let oi=In.length-1;oi>=0;--oi)Fe.push(In[oi])}},ev=function(ye,Fe){return Xt?ye==="patchsrc"?!0:ye==="for"&&Fe!=="label"&&Fe!=="output":!1},vp=function(ye){if(!Xt)return;let Fe=[ye];for(;Fe.length>0;){let gt=Fe.pop(),on=I(gt);if(on===Uf.processingInstruction||on===Uf.comment&&al(PAe,gt.data)){try{m(gt)}catch{}continue}if(on===Uf.element){let oi=gt,So=ri(R(gt));try{oi.hasAttribute&&oi.hasAttribute("patchsrc")&&oi.removeAttribute("patchsrc"),oi.hasAttribute&&oi.hasAttribute("for")&&ev("for",So)&&oi.removeAttribute("for")}catch{}}let In=A(gt);if(In)for(let oi=In.length-1;oi>=0;--oi)Fe.push(In[oi])}},Zb=function(ye){let Fe=null,gt=null;if(bi)ye="<remove></remove>"+ye;else{let oi=AAe(ye,/^[\r\n\t ]+/);gt=oi&&oi[0]}ks==="application/xhtml+xml"&&qi===Bn&&(ye='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+ye+"</body></html>");let on=O?M(ye):ye;if(qi===Bn)try{Fe=new f().parseFromString(on,ks)}catch{}if(!Fe||!Fe.documentElement){Fe=j.createDocument(qi,"template",null);try{Fe.documentElement.innerHTML=ki?L:on}catch{}}let In=Fe.body||Fe.documentElement;return ye&>&&In.insertBefore(n.createTextNode(gt),In.childNodes[0]||null),qi===Bn?q.call(Fe,rt?"html":"body")[0]:rt?Fe.documentElement:In},nD=function(ye){let Fe=S?S(ye):ye.ownerDocument;return k.call(Fe||ye,ye,c.SHOW_ELEMENT|c.SHOW_COMMENT|c.SHOW_TEXT|c.SHOW_PROCESSING_INSTRUCTION|c.SHOW_CDATA_SECTION,null)},tv=function(ye){return ye=qL(ye,J," "),ye=qL(ye,Z," "),ye=qL(ye,ae," "),ye},vy=function(ye){var Fe;ye.normalize();let gt=S?S(ye):ye.ownerDocument,on=k.call(gt||ye,ye,c.SHOW_TEXT|c.SHOW_COMMENT|c.SHOW_CDATA_SECTION|c.SHOW_PROCESSING_INSTRUCTION,null),In=on.nextNode();for(;In;)In.data=tv(In.data),In=on.nextNode();let oi=(Fe=ye.querySelectorAll)===null||Fe===void 0?void 0:Fe.call(ye,"template");oi&&bT(oi,So=>{ne(So.content)&&vy(So.content)})},ce=function(ye){let Fe=v?v(ye):null;return typeof Fe!="string"||ri(Fe)!=="form"?!1:typeof ye.nodeName!="string"||typeof ye.textContent!="string"||typeof ye.removeChild!="function"||ye.attributes!==T(ye)||typeof ye.removeAttribute!="function"||typeof ye.setAttribute!="function"||typeof ye.namespaceURI!="string"||typeof ye.insertBefore!="function"||typeof ye.hasChildNodes!="function"||ye.nodeType!==E(ye)||ye.childNodes!==A(ye)},ne=function(ye){if(!E||typeof ye!="object"||ye===null)return!1;try{return E(ye)===Uf.documentFragment}catch{return!1}},Te=function(ye){if(!E||typeof ye!="object"||ye===null)return!1;try{return typeof E(ye)=="number"}catch{return!1}};function Ce(Ct,ye,Fe){Ct.length!==0&&bT(Ct,gt=>{gt.call(t,ye,Fe,Kr)})}let Ze=function(ye,Fe){return!!(Xt&&ye.hasChildNodes()&&!Te(ye.firstElementChild)&&al(IAe,ye.textContent)&&al(IAe,ye.innerHTML)||Xt&&ye.namespaceURI===Bn&&VZe[Fe]&&(Te(ye.firstElementChild)||typeof ye.textContent=="string"&&al(jZe[Fe],ye.textContent))||ye.nodeType===Uf.processingInstruction||Xt&&ye.nodeType===Uf.comment&&al(PAe,ye.data))},Et=function(ye,Fe){if(ye instanceof RegExp)return al(ye,Fe);if(ye instanceof Function){for(var gt=arguments.length,on=new Array(gt>2?gt-2:0),In=2;In<gt;In++)on[In-2]=arguments[In];return!!ye(Fe,...on)}return!1},pt=function(ye,Fe,gt){if(!Pe[Fe]&&mo(Fe)&&Et($e.tagNameCheck,Fe))return!1;if(Wn&&!fo[Fe]){let on=b(ye),In=A(ye);if(In&&on){let oi=In.length;for(let So=oi-1;So>=0;--So){let ds=ye===gt?g(In[So],!0):In[So];on.insertBefore(ds,y(ye))}}}return Cp(ye),!0},wt=function(ye,Fe,gt,on){return ye.length===0?Fe:Fe===gt||Fe===on?zf(Fe):Fe},bn=function(ye,Fe){return ye===Fe||b(ye)!==null?!1:(Zi&&Jb(ye),!0)},qn=function(ye,Fe){if(Ce(W.beforeSanitizeElements,ye,null),bn(ye,Fe))return!0;if(ce(ye))return Cp(ye),!0;let gt=ri(R(ye));if(Re=wt(W.uponSanitizeElement,Re,Qe,Bi),Ce(W.uponSanitizeElement,ye,{tagName:gt,allowedTags:Re}),bn(ye,Fe))return!0;if(Ze(ye,gt))return Cp(ye),!0;if(Pe[gt]||!(st.tagCheck instanceof Function&&st.tagCheck(gt))&&!Re[gt]){let In=pt(ye,gt,Fe);return In===!1&&Ce(W.afterSanitizeElements,ye,null),In}if(I(ye)===Uf.element&&!Pq(ye)||(gt==="noscript"||gt==="noembed"||gt==="noframes")&&al(UZe,ye.innerHTML))return Cp(ye),!0;if(ft&&ye.nodeType===Uf.text){let In=tv(ye.textContent);ye.textContent!==In&&(WL(t.removed,{element:ye.cloneNode()}),ye.textContent=In)}return Ce(W.afterSanitizeElements,ye,null),!1},_n=function(ye,Fe,gt){if(qe[Fe]||ev(Fe,ye)||xi&&(Fe==="id"||Fe==="name")&&(gt in n||gt in Ol))return!1;let on=He[Fe]||st.attributeCheck instanceof Function&&st.attributeCheck(Fe,ye);return Gt&&al(Ae,Fe)||vt&&al(fe,Fe)?!0:on?gi[Fe]||al(Se,qL(gt,ge,""))||(Fe==="src"||Fe==="xlink:href"||Fe==="href")&&ye!=="script"&&bAe(gt,"data:")===0&&Ks[ye]||lt&&!al(xe,qL(gt,ge,""))?!0:!gt:mo(ye)&&Et($e.tagNameCheck,ye)&&Et($e.attributeNameCheck,Fe,ye)||Fe==="is"&&$e.allowCustomizedBuiltInElements&&Et($e.tagNameCheck,gt)},vo=Ir({},["annotation-xml","color-profile","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","missing-glyph"]),mo=function(ye){return!vo[XL(ye)]&&al(we,ye)},$s=function(ye,Fe,gt,on){if(O&&typeof d=="object"&&typeof d.getAttributeType=="function"&&!gt)switch(d.getAttributeType(ye,Fe)){case"TrustedHTML":return M(on);case"TrustedScriptURL":return F(on)}return on},Sc=function(ye,Fe,gt,on){try{gt?ye.setAttributeNS(gt,Fe,on):ye.setAttribute(Fe,on),ce(ye)?Cp(ye):yAe(t.removed)}catch{Lh(Fe,ye)}},Ml=function(ye){Ce(W.beforeSanitizeAttributes,ye,null);let Fe=ye.attributes;if(!Fe||ce(ye))return;He=wt(W.uponSanitizeAttribute,He,Xe,Xn);let gt={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:He,forceKeepAttr:void 0},on=Fe.length,In=ri(ye.nodeName);for(;on--;){let oi=Fe[on],So=oi.name,ds=oi.namespaceURI,Su=oi.value,wu=ri(So),Rq=Su,Nl=So==="value"?Rq:xZe(Rq);if(gt.attrName=wu,gt.attrValue=Nl,gt.keepAttr=!0,gt.forceKeepAttr=void 0,Ce(W.uponSanitizeAttribute,ye,gt),Nl=gt.attrValue,jn&&(wu==="id"||wu==="name")&&bAe(Nl,nn)!==0&&(Lh(So,ye,oi),Nl=nn+Nl),Xt&&al(/((--!?|])>)|<\/(style|script|title|xmp|textarea|noscript|iframe|noembed|noframes)/i,Nl)){Lh(So,ye,oi);continue}if(wu==="attributename"&&AAe(Nl,"href")){Lh(So,ye,oi);continue}if(!gt.forceKeepAttr){if(!gt.keepAttr){Lh(So,ye,oi);continue}if(!mt&&al(zZe,Nl)){Lh(So,ye,oi);continue}if(ft&&(Nl=tv(Nl)),!_n(In,wu,Nl)){Lh(So,ye,oi);continue}Nl=$s(In,wu,ds,Nl),Nl!==Rq&&Sc(ye,So,ds,Nl)}}Ce(W.afterSanitizeAttributes,ye,null)},vu=function(ye){let Fe=null,gt=nD(ye);for(Ce(W.beforeSanitizeShadowDOM,ye,null);Fe=gt.nextNode();)if(Ce(W.uponSanitizeShadowNode,Fe,null),qn(Fe,ye),Ml(Fe),ne(Fe.content)&&vu(Fe.content),I(Fe)===Uf.element){let on=x(Fe);ne(on)&&(Q0(on),vu(on))}Ce(W.afterSanitizeShadowDOM,ye,null)},Q0=function(ye){let Fe=[{node:ye,shadow:null}];for(;Fe.length>0;){let gt=Fe.pop();if(gt.shadow){vu(gt.shadow);continue}let on=gt.node,oi=I(on)===Uf.element,So=A(on);if(So)for(let ds=So.length-1;ds>=0;--ds)Fe.push({node:So[ds],shadow:null});if(oi){let ds=v?v(on):null;if(typeof ds=="string"&&ri(ds)==="template"){let Su=on.content;ne(Su)&&Fe.push({node:Su,shadow:null})}}if(oi){let ds=x(on);ne(ds)&&Fe.push({node:null,shadow:ds},{node:ds,shadow:null})}}};return t.sanitize=function(Ct){let ye=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},Fe=null,gt=null,on=null,In=null;if(ki=!Ct,ki&&(Ct="<!-->"),typeof Ct!="string"&&!Te(Ct)&&(Ct=SZe(Ct),typeof Ct!="string"))throw AT("dirty is not a string, aborting");if(!t.isSupported)return Ct;ht?(Re=Bi,He=Xn):Ma(ye),(W.uponSanitizeElement.length>0||W.uponSanitizeAttribute.length>0)&&(Re=zf(Re)),W.uponSanitizeAttribute.length>0&&(He=zf(He)),t.removed=[];let oi=Zi&&typeof Ct!="string"&&Te(Ct);if(oi){vp(Ct);let Su=R(Ct);if(typeof Su=="string"){let wu=ri(Su);if(!Re[wu]||Pe[wu])throw $b(Ct),AT("root node is forbidden and cannot be sanitized in-place")}if(ce(Ct))throw $b(Ct),AT("root node is clobbered and cannot be sanitized in-place");try{Q0(Ct)}catch(wu){throw $b(Ct),wu}}else if(Te(Ct))Fe=Zb("<!---->"),gt=Fe.ownerDocument.importNode(Ct,!0),gt.nodeType===Uf.element&>.nodeName==="BODY"||gt.nodeName==="HTML"?Fe=gt:Fe.appendChild(gt),Q0(gt);else{if(!Wi&&!ft&&!rt&&Ct.indexOf("<")===-1)return O&&hi?M(Ct):Ct;if(Fe=Zb(Ct),!Fe)return Wi?null:hi?L:""}Fe&&bi&&Cp(Fe.firstChild);let So=oi?Ct:Fe;try{let Su=nD(So);for(;on=Su.nextNode();)qn(on,So),Ml(on),ne(on.content)&&vu(on.content)}catch(Su){throw oi&&($b(Ct),bT(t.removed,wu=>{wu.element&&Jb(wu.element)})),Su}if(oi)return bT(t.removed,Su=>{Su.element&&Jb(Su.element)}),ft&&vy(Ct),Ct;if(Wi){if(ft&&vy(Fe),wi)for(In=G.call(Fe.ownerDocument);Fe.firstChild;)In.appendChild(Fe.firstChild);else In=Fe;return(He.shadowroot||He.shadowrootmode)&&(In=Q.call(i,In,!0)),In}let ds=rt?Fe.outerHTML:Fe.innerHTML;return rt&&Re["!doctype"]&&Fe.ownerDocument&&Fe.ownerDocument.doctype&&Fe.ownerDocument.doctype.name&&al(BZe,Fe.ownerDocument.doctype.name)&&(ds="<!DOCTYPE "+Fe.ownerDocument.doctype.name+`> +`+ds),ft&&(ds=tv(ds)),O&&hi?M(ds):ds},t.setConfig=function(){let Ct=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};Ma(Ct),ht=!0,Bi=Re,Xn=He},t.clearConfig=function(){Kr=null,ht=!1,Bi=null,Xn=null,O=_,L=""},t.isValidAttribute=function(Ct,ye,Fe){Kr||Ma({});let gt=ri(Ct),on=ri(ye);return _n(gt,on,Fe)},t.addHook=function(Ct,ye){typeof ye=="function"&&Vu(W,Ct)&&WL(W[Ct],ye)},t.removeHook=function(Ct,ye){if(Vu(W,Ct)){if(ye!==void 0){let Fe=AZe(W[Ct],ye);return Fe===-1?void 0:bZe(W[Ct],Fe,1)[0]}return yAe(W[Ct])}},t.removeHooks=function(Ct){Vu(W,Ct)&&(W[Ct]=[])},t.removeAllHooks=function(){W=DAe()},t}var LAe=NAe();var WZe=0,W$={},q$=class e{constructor(t,n){let i,r=t;l(W$[r])?i=W$[r]:(i=WZe++,W$[r]=i),n=n??!1,this._id=i,this._html=t,this._showOnScreen=n,this._element=void 0}get html(){return this._html}get id(){return this._id}get showOnScreen(){return this._showOnScreen}set showOnScreen(t){this._showOnScreen=t}get element(){if(!l(this._element)){let t=LAe.sanitize(this._html),n=document.createElement("div");n.className="cesium-credit-wrapper",n._creditId=this._id,n.style.display="inline",n.innerHTML=t;let i=n.querySelectorAll("a");for(let r=0;r<i.length;r++)i[r].setAttribute("target","_blank");this._element=n}return this._element}static equals(t,n){return t===n||l(t)&&l(n)&&t._id===n._id&&t._showOnScreen===n._showOnScreen}equals(t){return e.equals(this,t)}isIon(){return this.html.indexOf("ion-credit.png")!==-1}static getIonCredit(t){let n=l(t.collapsible)&&!t.collapsible;return new e(t.html,n)}static clone(t){if(l(t))return new e(t.html,t.showOnScreen)}},It=q$;function MS(e,t){this._distance=t,this._normal=new FAe(e,this),this.onChangeCallback=void 0,this.index=-1}Object.defineProperties(MS.prototype,{distance:{get:function(){return this._distance},set:function(e){l(this.onChangeCallback)&&e!==this._distance&&this.onChangeCallback(this.index),this._distance=e}},normal:{get:function(){return this._normal},set:function(e){l(this.onChangeCallback)&&!h.equals(this._normal._cartesian3,e)&&this.onChangeCallback(this.index),h.clone(e,this._normal._cartesian3)}}});MS.fromPlane=function(e,t){return l(t)?(t.normal=e.normal,t.distance=e.distance):t=new MS(e.normal,e.distance),t};MS.clone=function(e,t){return l(t)?(t.normal=e.normal,t.distance=e.distance,t):new MS(e.normal,e.distance)};function FAe(e,t){this._clippingPlane=t,this._cartesian3=h.clone(e)}Object.defineProperties(FAe.prototype,{x:{get:function(){return this._cartesian3.x},set:function(e){l(this._clippingPlane.onChangeCallback)&&e!==this._cartesian3.x&&this._clippingPlane.onChangeCallback(this._clippingPlane.index),this._cartesian3.x=e}},y:{get:function(){return this._cartesian3.y},set:function(e){l(this._clippingPlane.onChangeCallback)&&e!==this._cartesian3.y&&this._clippingPlane.onChangeCallback(this._clippingPlane.index),this._cartesian3.y=e}},z:{get:function(){return this._cartesian3.z},set:function(e){l(this._clippingPlane.onChangeCallback)&&e!==this._cartesian3.z&&this._clippingPlane.onChangeCallback(this._clippingPlane.index),this._cartesian3.z=e}}});var ia=MS;function cl(e){e=e??H.EMPTY_OBJECT,this._planes=[],this._dirtyIndex=-1,this._multipleDirtyPlanes=!1,this._enabled=e.enabled??!0,this.modelMatrix=N.clone(e.modelMatrix??N.IDENTITY),this.edgeColor=z.clone(e.edgeColor??z.WHITE),this.edgeWidth=e.edgeWidth??0,this.planeAdded=new be,this.planeRemoved=new be,this._owner=void 0;let t=e.unionClippingRegions??!1;this._unionClippingRegions=t,this._testIntersection=t?VAe:jAe,this._uint8View=void 0,this._float32View=void 0,this._clippingPlanesTexture=void 0;let n=e.planes;if(l(n)){let i=n.length;for(let r=0;r<i;++r)this.add(n[r])}}function VAe(e){return e===$t.OUTSIDE}function jAe(e){return e===$t.INSIDE}Object.defineProperties(cl.prototype,{length:{get:function(){return this._planes.length}},unionClippingRegions:{get:function(){return this._unionClippingRegions},set:function(e){this._unionClippingRegions!==e&&(this._unionClippingRegions=e,this._testIntersection=e?VAe:jAe)}},enabled:{get:function(){return this._enabled},set:function(e){this._enabled!==e&&(this._enabled=e)}},texture:{get:function(){return this._clippingPlanesTexture}},owner:{get:function(){return this._owner}},clippingPlanesState:{get:function(){return this._unionClippingRegions?this._planes.length:-this._planes.length}}});function BAe(e,t){e._multipleDirtyPlanes=e._multipleDirtyPlanes||e._dirtyIndex!==-1&&e._dirtyIndex!==t,e._dirtyIndex=t}cl.prototype.add=function(e){let t=this._planes.length,n=this;e.onChangeCallback=function(i){BAe(n,i)},e.index=t,BAe(this,t),this._planes.push(e),this.planeAdded.raiseEvent(e,t)};cl.prototype.get=function(e){return this._planes[e]};function HAe(e,t){let n=e.length;for(let i=0;i<n;++i)if(sn.equals(e[i],t))return i;return-1}cl.prototype.contains=function(e){return HAe(this._planes,e)!==-1};cl.prototype.remove=function(e){let t=this._planes,n=HAe(t,e);if(n===-1)return!1;e instanceof ia&&(e.onChangeCallback=void 0,e.index=-1);let i=t.length-1;for(let r=n;r<i;++r){let o=t[r+1];t[r]=o,o instanceof ia&&(o.index=r)}return this._multipleDirtyPlanes=!0,t.length=i,this.planeRemoved.raiseEvent(e,n),!0};cl.prototype.removeAll=function(){let e=this._planes,t=e.length;for(let n=0;n<t;++n){let i=e[n];i instanceof ia&&(i.onChangeCallback=void 0,i.index=-1),this.planeRemoved.raiseEvent(i,n)}this._multipleDirtyPlanes=!0,this._planes=[]};var qZe=new se,YZe=new se;function kAe(e,t,n){let i=e._uint8View,r=e._planes,o=0;for(let s=t;s<n;++s){let a=r[s],c=cn.octEncodeToCartesian4(a.normal,YZe);i[o]=c.x,i[o+1]=c.y,i[o+2]=c.z,i[o+3]=c.w;let u=se.packFloat(a.distance,qZe);i[o+4]=u.x,i[o+5]=u.y,i[o+6]=u.z,i[o+7]=u.w,o+=8}}function UAe(e,t,n){let i=e._float32View,r=e._planes,o=0;for(let s=t;s<n;++s){let a=r[s],c=a.normal;i[o]=c.x,i[o+1]=c.y,i[o+2]=c.z,i[o+3]=a.distance,o+=4}}function GAe(e,t){let n=kt.maximumTextureSize;return t.x=Math.min(e,n),t.y=Math.ceil(e/t.x),t}var XZe=new U;cl.prototype.update=function(e){let t=this._clippingPlanesTexture,n=e.context,i=cl.useFloatTexture(n),r=i?this.length:this.length*2;if(l(t)){let s=t.width*t.height;(s<r||r<.25*s)&&(t.destroy(),t=void 0,this._clippingPlanesTexture=void 0)}if(this.length===0)return;if(!l(t)){let s=GAe(r,XZe);s.y*=2,i?(t=new Dt({context:n,width:s.x,height:s.y,pixelFormat:Ke.RGBA,pixelDatatype:ze.FLOAT,sampler:jt.NEAREST,flipY:!1}),this._float32View=new Float32Array(s.x*s.y*4)):(t=new Dt({context:n,width:s.x,height:s.y,pixelFormat:Ke.RGBA,pixelDatatype:ze.UNSIGNED_BYTE,sampler:jt.NEAREST,flipY:!1}),this._uint8View=new Uint8Array(s.x*s.y*4)),this._clippingPlanesTexture=t,this._multipleDirtyPlanes=!0}let o=this._dirtyIndex;if(!(!this._multipleDirtyPlanes&&o===-1)){if(this._multipleDirtyPlanes)i?(UAe(this,0,this._planes.length),t.copyFrom({source:{width:t.width,height:t.height,arrayBufferView:this._float32View}})):(kAe(this,0,this._planes.length),t.copyFrom({source:{width:t.width,height:t.height,arrayBufferView:this._uint8View}}));else{let s,a;i?(a=Math.floor(o/t.width),s=Math.floor(o-a*t.width),UAe(this,o,o+1),t.copyFrom({source:{width:1,height:1,arrayBufferView:this._float32View},xOffset:s,yOffset:a})):(a=Math.floor(o*2/t.width),s=Math.floor(o*2-a*t.width),kAe(this,o,o+1),t.copyFrom({source:{width:2,height:1,arrayBufferView:this._uint8View},xOffset:s,yOffset:a}))}this._multipleDirtyPlanes=!1,this._dirtyIndex=-1}};var KZe=new N,zAe=new sn(h.UNIT_X,0);cl.prototype.computeIntersectionWithBoundingVolume=function(e,t){let n=this._planes,i=n.length,r=this.modelMatrix;l(t)&&(r=N.multiply(t,r,KZe));let o=$t.INSIDE;!this.unionClippingRegions&&i>0&&(o=$t.OUTSIDE);for(let s=0;s<i;++s){let a=n[s];sn.transform(a,r,zAe);let c=e.intersectPlane(zAe);if(c===$t.INTERSECTING)o=c;else if(this._testIntersection(c))return c}return o};cl.setOwner=function(e,t,n){e!==t[n]&&(t[n]=t[n]&&t[n].destroy(),l(e)&&(e._owner=t,t[n]=e))};cl.useFloatTexture=function(e){return e.floatingPointTexture};cl.getTextureResolution=function(e,t,n){let i=e.texture;if(l(i))return n.x=i.width,n.y=i.height,n;let r=cl.useFloatTexture(t)?e.length:e.length*2,o=GAe(r,n);return o.y*=2,o};cl.prototype.isDestroyed=function(){return!1};cl.prototype.destroy=function(){return this._clippingPlanesTexture=this._clippingPlanesTexture&&this._clippingPlanesTexture.destroy(),le(this)};var Cs=cl;function $Ze(e,t){_t(e,t)}var qr=$Ze;function NS(e){this._ellipsoid=e.ellipsoid??ee.default,this._positions=AH(e.positions),this._holes=l(e.holes)?e.holes.map(AH):[],this._rectangle=qp.computeRectangleFromPositions(this._positions,this._ellipsoid),Y$(this._positions),WAe(this._holes)}function AH(e){if(!l(e))return;let t=e.length,n=Array(t);for(let i=0;i<t;i++)n[i]=h.clone(e[i]);return n}function Y$(e){for(let t=0;t<e.length;t++)Object.freeze(e[t]);return Object.freeze(e)}function WAe(e){for(let t=0;t<e.length;t++)Y$(e[t]);return Object.freeze(e)}function JZe(e,t){if(!l(e)&&!l(t))return!0;if(l(e)!==l(t)||e.length!==t.length)return!1;let n=e.length;for(let i=0;i<n;i++){let r=e[i],o=t[i];if(!h.equals(r,o))return!1}return!0}function ZZe(e,t){if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(!JZe(e[n],t[n]))return!1;return!0}Object.defineProperties(NS.prototype,{length:{get:function(){let e=this._positions.length,t=this._holes;for(let n=0;n<t.length;n++)e+=t[n].length;return e}},positions:{get:function(){return this._positions}},holes:{get:function(){return this._holes}},ellipsoid:{get:function(){return this._ellipsoid}},rectangle:{get:function(){return this._rectangle}}});NS.clone=function(e,t){return l(t)?(t._ellipsoid=e.ellipsoid,t._positions=AH(e.positions),t._holes=e.holes.map(AH),t._rectangle=qp.computeRectangleFromPositions(t._positions,t._ellipsoid),Y$(t._positions),WAe(t._holes),t):new NS({positions:e.positions,holes:e.holes,ellipsoid:e.ellipsoid})};NS.equals=function(e,t){return e.ellipsoid.equals(t.ellipsoid)&&e.positions===t.positions&&ZZe(e.holes,t.holes)};NS.prototype.computeRectangle=function(e){return qr("ClippingPolygon.computeRectangle","ClippingPolygon.computeRectangle is deprecated as of CesiumJS 1.145 and will be removed in 1.147. Use the ClippingPolygon.rectangle property instead."),ie.clone(this._rectangle,e)};var LS=NS;var KL=class KL{constructor(t=H.EMPTY_OBJECT){ut(this,"_renderContext",null);this.show=t.show??!0,this._heightReference=t.heightReference??We.NONE,this._blendOption=t.blendOption??Li.TRANSLUCENT,this._modelMatrix=N.clone(t.modelMatrix??N.IDENTITY),this._boundingVolume=ue.clone(t.boundingVolume??new ue,new ue),this._boundingVolumeAutoUpdate=!l(t.boundingVolume),this._allowPicking=t.allowPicking??!1,this._pickIds=new Map,this._customPickObjects=[],this.debugShowBoundingVolume=t.debugShowBoundingVolume??!1,this._primitiveCount=0,this._primitiveCountMax=t.primitiveCountMax??KL.DEFAULT_CAPACITY,this._primitiveView=null,this._positionCount=0,this._positionCountMax=t.vertexCountMax??KL.DEFAULT_CAPACITY,this._positionView=null,this._positionDatatype=t.positionDatatype??Y.DOUBLE,this._positionNormalized=t.positionNormalized??!1,this._materialView=null,this._dirtyOffset=0,this._dirtyCount=0,this._dirtyBoundingVolume=!1,this._version=0,this._allocatePrimitiveBuffer(),this._allocatePositionBuffer(),this._allocateMaterialBuffer()}_getCollectionClass(){pe.throwInstantiationError()}_getPrimitiveClass(){pe.throwInstantiationError()}_getMaterialClass(){pe.throwInstantiationError()}_allocatePrimitiveBuffer(){let t=this._getPrimitiveClass().Layout;this._primitiveView=new DataView(new ArrayBuffer(this._primitiveCountMax*t.__BYTE_LENGTH))}_allocatePositionBuffer(){this._positionView=Y.createTypedArray(this._positionDatatype,this._positionCountMax*3)}_allocateMaterialBuffer(){let t=this._getMaterialClass();this._materialView=new DataView(new ArrayBuffer(this._primitiveCountMax*t.packedLength))}isDestroyed(){return!1}destroy(){this._customPickObjects.length=0;for(let t of this._pickIds.values())for(let n of t)n.destroy();l(this._renderContext)&&(this._renderContext.destroy(),this._renderContext=void 0,this._dirtyOffset=0,this._dirtyCount=this.primitiveCount)}sort(t,n=new Uint32Array(this.primitiveCount)){let i=this._getPrimitiveClass(),r=this._getCollectionClass(),{primitiveCount:o}=this,s=new i,a=new i,c=new Uint32Array(o);for(let f=0;f<o;f++)c[f]=f;c.sort((f,d)=>t(this.get(f,s),this.get(d,a)));for(let f=0;f<o;f++)n[c[f]]=f;let u=this._cloneEmpty();for(let f=0;f<o;f++){let d=this.get(c[f],s),p=u.add({},a);i.clone(d,p)}return r._replaceBuffers(u,this),this._dirtyOffset=0,this._dirtyCount=o,n}static clone(t,n,i){if(l(i))return this._cloneFiltered(t,n,i);let r=t._getPrimitiveClass().Layout,o=t._getMaterialClass(),s=t._getPrimitiveClass();this._copySubDataView(t._primitiveView,n._primitiveView,t.primitiveCount*r.__BYTE_LENGTH),this._copySubArray(t._positionView,n._positionView,t.vertexCount*3),this._copySubDataView(t._materialView,n._materialView,t.primitiveCount*o.packedLength),n._primitiveCount=t._primitiveCount,n._positionCount=t._positionCount;let a=t._customPickObjects,c=n._customPickObjects;c.length=0;let u=new s;for(let f=0,d=n.primitiveCount;f<d;f++)c[f]=a[f],n.get(f,u)._pickId=0;return n._dirtyOffset=0,n._dirtyCount=n.primitiveCount,t.boundingVolume.clone(n.boundingVolume),n}static _cloneFiltered(t,n,i){let r=t._getPrimitiveClass(),o=new r,s=new r,a=t._customPickObjects,c=n._customPickObjects;c.length=0;for(let u=0,f=t._primitiveCount;u<f;u++){if(t.get(u,o),!i(o,u))continue;let d=n._primitiveCount;r.clone(o,n.add({},s)),l(a[u])&&(c[d]=a[u])}return n}static fromCollection(t,n=H.EMPTY_OBJECT,i){let r=t._cloneEmpty(n);return t._getCollectionClass().clone(t,r,i),r}_cloneEmptyBaseArgs(t){return{primitiveCountMax:this.primitiveCountMax,vertexCountMax:this.vertexCountMax,positionDatatype:this.positionDatatype,positionNormalized:this.positionNormalized,modelMatrix:this._modelMatrix,show:this.show,debugShowBoundingVolume:this.debugShowBoundingVolume,blendOption:this._blendOption,allowPicking:this._allowPicking,boundingVolume:this._boundingVolumeAutoUpdate?void 0:this._boundingVolume,...t}}_cloneEmpty(t){pe.throwInstantiationError()}static _replaceBuffers(t,n){n._primitiveView=t._primitiveView,n._positionView=t._positionView,n._materialView=t._materialView}_updateBoundingVolume(){let t=this._positionView.subarray(0,this._positionCount*3);this._positionNormalized&&(t=cn.dequantize(t,this._positionDatatype,Vt.VEC3,this._positionCount)),ue.fromVertices(t,h.ZERO,3,this._boundingVolume),ue.transform(this._boundingVolume,this._modelMatrix,this._boundingVolume),this._dirtyBoundingVolume=!1}_updatePickIds(t){let n=this._pickIds.get(t);if(n&&n.length===this._primitiveCount)return;n||(n=[],this._pickIds.set(t,n));let i=this,r=this._getPrimitiveClass(),o=new r;for(let s=n.length,a=this._primitiveCount;s<a;s++){this.get(s,o);let c=this._customPickObjects[s]||{collection:this,index:s,get primitive(){return i.get(s,new r)}},u=t.createPickId(c);o._pickId=u.key,n.push(u)}}get(t,n){return n._collection=this,n._index=t,n._byteOffset=t*this._getPrimitiveClass().Layout.__BYTE_LENGTH,n}add(t=H.EMPTY_OBJECT,n){let i=this._getMaterialClass(),r=this._primitiveCount++;return n=this.get(r,n),n.featureId=t.featureId??r,n.show=t.show??!0,n.setMaterial(t.material??i.DEFAULT_MATERIAL),n._pickId=0,n._dirty=!0,l(t.pickObject)&&(this._customPickObjects[r]=t.pickObject),n}_makeDirty(t){this._dirtyCount===0?(this._dirtyCount=1,this._dirtyOffset=t):t<this._dirtyOffset?(this._dirtyCount+=this._dirtyOffset-t,this._dirtyOffset=t):t+1>this._dirtyOffset+this._dirtyCount&&(this._dirtyCount=t+1-this._dirtyOffset)}_makeClean(){this._dirtyCount>0&&(this._dirtyCount=0,this._dirtyOffset=0,this._version++)}_makeDirtyBoundingVolume(){this._boundingVolumeAutoUpdate&&(this._dirtyBoundingVolume=!0)}update(t){t.mode!==re.SCENE3D&&_t("bufferprim-scenemode","BufferPrimitiveCollection requires SceneMode.SCENE3D."),this._dirtyBoundingVolume&&this._updateBoundingVolume(),this._allowPicking&&this._updatePickIds(t.context)}_isRendered(t){let n=t.passes;return this.show&&!bs(this._heightReference)&&(n.render||n.pick)}get primitiveCount(){return this._primitiveCount}get primitiveCountMax(){return this._primitiveCountMax}get byteLength(){return this._primitiveView.byteLength+this._positionView.byteLength+this._materialView.byteLength}get vertexCount(){return this._positionCount}get vertexCountMax(){return this._positionCountMax}get modelMatrix(){return this._modelMatrix}get boundingVolume(){return this._dirtyBoundingVolume&&this._updateBoundingVolume(),this._boundingVolume}get positionDatatype(){return this._positionDatatype}get positionNormalized(){return this._positionNormalized}get heightReference(){return this._heightReference}static _copySubArray(t,n,i){for(let r=0;r<i;r++)n[r]=t[r]}static _copySubDataView(t,n,i){this._copySubArray(new Uint32Array(t.buffer,t.byteOffset,t.byteLength/4),new Uint32Array(n.buffer,n.byteOffset,n.byteLength/4),i/4)}toJSON(){let t=this._getPrimitiveClass(),n=new t,i=[];for(let r=0,o=this.primitiveCount;r<o;r++)i.push(this.get(r,n).toJSON());return i}};ut(KL,"Error",{ERR_RESIZE:"BufferPrimitive range cannot be resized after initialization.",ERR_CAPACITY:"BufferPrimitiveCollection capacity exceeded.",ERR_MULTIPLE_OF_FOUR:"BufferPrimitive byte length must be a multiple of 4.",ERR_OUT_OF_RANGE:"BufferPrimitive buffer access out of range."});var bH=KL;bH.DEFAULT_CAPACITY=1024;var ra=bH;var _m=class _m{constructor(){ut(this,"_collection",null);ut(this,"_index",-1);ut(this,"_byteOffset",-1)}static clone(t,n){let i=t._collection._getMaterialClass();return n.featureId=t.featureId,n.show=t.show,n.setMaterial(t.getMaterial(new i)),n}_isResizable(){return this._index===this._collection.primitiveCount-1}get featureId(){return this._getUint32(_m.Layout.FEATURE_ID_U32)}set featureId(t){this._setUint32(_m.Layout.FEATURE_ID_U32,t)}get show(){return this._getUint8(_m.Layout.SHOW_U8)===1}set show(t){this._setUint8(_m.Layout.SHOW_U8,t?1:0)}getMaterial(t){let n=this._collection,i=n._getMaterialClass();return i.unpack(n._materialView,this._index*i.packedLength,t)}setMaterial(t){let n=this._collection,i=n._getMaterialClass();return i.pack(t,n._materialView,this._index*i.packedLength),this._dirty=!0,t}get _dirty(){return this._getUint8(_m.Layout.DIRTY_U8)===1}set _dirty(t){this._collection._primitiveView.setUint8(this._byteOffset+_m.Layout.DIRTY_U8,t?1:0),t&&this._collection._makeDirty(this._index)}get _pickId(){return this._getUint32(_m.Layout.PICK_ID_U32)}set _pickId(t){this._setUint32(_m.Layout.PICK_ID_U32,t)}_getUint8(t){return this._collection._primitiveView.getUint8(this._byteOffset+t)}_setUint8(t,n){this._collection._primitiveView.setUint8(this._byteOffset+t,n),this._dirty=!0}_getUint32(t){return this._collection._primitiveView.getUint32(this._byteOffset+t,!0)}_setUint32(t,n){this._collection._primitiveView.setUint32(this._byteOffset+t,n,!0),this._dirty=!0}_getFloat32(t){return this._collection._primitiveView.getFloat32(this._byteOffset+t,!0)}_setFloat32(t,n){this._collection._primitiveView.setFloat32(this._byteOffset+t,n,!0),this._dirty=!0}toJSON(){let n=this._collection._getMaterialClass();return{featureId:this.featureId,show:this.show,dirty:this._dirty,material:this.getMaterial(new n).toJSON()}}};ut(_m,"Layout",{FEATURE_ID_U32:0,SHOW_U8:4,DIRTY_U8:5,PICK_ID_U32:8,__BYTE_LENGTH:12});var X$=_m,cs=X$;var{ERR_CAPACITY:DUn,ERR_RESIZE:RUn,ERR_OUT_OF_RANGE:OUn}=ra.Error,Xd=class Xd extends cs{constructor(){super(...arguments);ut(this,"_collection",null)}static clone(n,i){return super.clone(n,i),i.setPositions(n.getPositions()),i.setHoles(n.getHoles()),i.setTriangles(n.getTriangles()),i}get vertexOffset(){return this._getUint32(Xd.Layout.POSITION_OFFSET_U32)}get vertexCount(){return this._getUint32(Xd.Layout.POSITION_COUNT_U32)}getPositions(n){return this._getPositionsRange(0,this.vertexCount,n)}setPositions(n){let i=this._collection,r=this.vertexOffset,o=this.vertexCount,s=n.length/3,a=i.vertexCount+s-o;i._positionCount=a,this._setUint32(Xd.Layout.POSITION_COUNT_U32,s);let c=i._positionView;for(let u=0;u<s;u++)c[(r+u)*3]=n[u*3],c[(r+u)*3+1]=n[u*3+1],c[(r+u)*3+2]=n[u*3+2];this._dirty=!0,i._makeDirtyBoundingVolume()}get outerVertexOffset(){return this.vertexOffset}get outerVertexCount(){return this.holeCount>0?this.getHoles()[0]:this.vertexCount}getOuterPositions(n){return this._getPositionsRange(0,this.outerVertexCount,n)}get holeOffset(){return this._getUint32(Xd.Layout.HOLE_OFFSET_U32)}get holeCount(){return this._getUint32(Xd.Layout.HOLE_COUNT_U32)}getHoles(n){let{holeOffset:i,holeCount:r}=this,o=this._collection._holeIndexView;if(!l(n)){let s=o.byteOffset+i*o.BYTES_PER_ELEMENT,a=o.constructor;return new a(o.buffer,s,r)}for(let s=0;s<r;s++)n[s]=o[i+s];return n}setHoles(n){let i=this._collection,r=this.holeOffset,o=this.holeCount,s=n.length,a=i.holeCount+s-o;i._holeCount=a,this._setUint32(Xd.Layout.HOLE_COUNT_U32,s);let c=i._holeIndexView;for(let u=0;u<s;u++)c[r+u]=n[u];this._dirty=!0}getHoleVertexCount(n){let i=this.getHoles(),r=i[n];return n===i.length-1?this.vertexCount-r:i[n+1]-r}getHolePositions(n,i){let o=this.getHoles()[n],s=this.getHoleVertexCount(n);return this._getPositionsRange(o,s,i)}_getPositionsRange(n,i,r){let o=this._collection,s=this._collection._positionView,a=this.vertexOffset+n;if(!l(r)){let c=s.byteOffset+a*3*s.BYTES_PER_ELEMENT,u=s.constructor;return new u(s.buffer,c,i*3)}for(let c=0;c<i;c++)r[c*3]=s[(a+c)*3],r[c*3+1]=s[(a+c)*3+1],r[c*3+2]=s[(a+c)*3+2];return r}get triangleOffset(){return this._getUint32(Xd.Layout.TRIANGLE_OFFSET_U32)}get triangleCount(){return this._getUint32(Xd.Layout.TRIANGLE_COUNT_U32)}getTriangles(n){let{triangleOffset:i,triangleCount:r}=this,o=this._collection._triangleIndexView;if(!l(n)){let s=o.byteOffset+i*3*o.BYTES_PER_ELEMENT,a=o.constructor;return new a(o.buffer,s,r*3)}for(let s=0;s<r;s++)n[s*3]=o[(i+s)*3],n[s*3+1]=o[(i+s)*3+1],n[s*3+2]=o[(i+s)*3+2];return n}setTriangles(n){let i=this._collection,r=this.triangleOffset,o=this.triangleCount,s=n.length/3,a=i.triangleCount+s-o;i._triangleCount+=s-o,this._setUint32(Xd.Layout.TRIANGLE_COUNT_U32,s);let c=i._triangleIndexView;for(let u=0;u<s;u++)c[(r+u)*3]=n[u*3],c[(r+u)*3+1]=n[u*3+1],c[(r+u)*3+2]=n[u*3+2];this._dirty=!0}toJSON(){return{...super.toJSON(),positions:Array.from(this.getPositions()),holes:Array.from(this.getHoles()),triangles:Array.from(this.getTriangles())}}};ut(Xd,"Layout",{...cs.Layout,POSITION_OFFSET_U32:cs.Layout.__BYTE_LENGTH,POSITION_COUNT_U32:cs.Layout.__BYTE_LENGTH+4,HOLE_OFFSET_U32:cs.Layout.__BYTE_LENGTH+8,HOLE_COUNT_U32:cs.Layout.__BYTE_LENGTH+12,TRIANGLE_OFFSET_U32:cs.Layout.__BYTE_LENGTH+16,TRIANGLE_COUNT_U32:cs.Layout.__BYTE_LENGTH+20,__BYTE_LENGTH:cs.Layout.__BYTE_LENGTH+24});var K$=Xd,Mo=K$;var $L=class{constructor(t=H.EMPTY_OBJECT){this.color=z.clone(t.color??z.WHITE),this.outlineColor=z.clone(t.outlineColor??z.WHITE),this.outlineWidth=t.outlineWidth??0}static get packedLength(){return this.Layout.__BYTE_LENGTH}static pack(t,n,i){n.setUint32(this.Layout.COLOR_U32+i,t.color.toRgba(),!0),n.setUint32(this.Layout.OUTLINE_COLOR_U32+i,t.outlineColor.toRgba(),!0),n.setUint8(this.Layout.OUTLINE_WIDTH_U8+i,t.outlineWidth)}static unpack(t,n,i){return z.fromRgba(t.getUint32(this.Layout.COLOR_U32+n,!0),i.color),z.fromRgba(t.getUint32(this.Layout.OUTLINE_COLOR_U32+n,!0),i.outlineColor),i.outlineWidth=t.getUint8(this.Layout.OUTLINE_WIDTH_U8+n),i}toJSON(){return{color:this.color.toCssHexString(),outlineColor:this.outlineColor.toCssHexString(),outlineWidth:this.outlineWidth}}};ut($L,"Layout",{COLOR_U32:0,OUTLINE_COLOR_U32:4,OUTLINE_WIDTH_U8:8,__BYTE_LENGTH:12}),ut($L,"DEFAULT_MATERIAL");var iu=$L;var xH=class xH extends iu{constructor(t=H.EMPTY_OBJECT){super(t)}};ut(xH,"DEFAULT_MATERIAL",Object.freeze(new xH));var $$=xH,Vf=$$;var J$={positionHigh:0,positionLow:1,pickColor:2,showColorAlpha:3},qAe={position:0,pickColor:1,showColorAlpha:2},ba=new Mo,Z$=new Vf,JL=new z,YAe=new h,Q$=new Sn;function QZe(e,t,n){let i=t.context;n=n||{destroy:tQe};let r=e._positionDatatype===Y.DOUBLE,o=r?J$:qAe;if(!l(n.attributeArrays)||!l(n.indexArray)){let{vertexCountMax:c,triangleCountMax:u}=e;n.indexArray=je.createTypedArray(c,u*3),n.attributeArrays={...r?{positionHigh:new Float32Array(c*3),positionLow:new Float32Array(c*3)}:{position:e._positionView},pickColor:new Uint8Array(c*4),showColorAlpha:new Float32Array(c*3)}}if(e._dirtyCount>0){let{attributeArrays:c}=n,{_dirtyOffset:u,_dirtyCount:f}=e,d=c.positionHigh,p=c.positionLow,g=n.indexArray,m=c.pickColor,y=c.showColorAlpha;for(let A=u,b=u+f;A<b;A++){if(e.get(A,ba),!ba._dirty)continue;let x=ba.triangleOffset,T=ba.vertexOffset,E=ba.getTriangles();for(let R=0,O=ba.triangleCount;R<O;R++)g[x*3]=T+E[R*3],g[x*3+1]=T+E[R*3+1],g[x*3+2]=T+E[R*3+2],x++;let v=ba.show,S=r?ba.getPositions():null;ba.getMaterial(Z$);let I=cn.encodeRGB8(Z$.color);z.fromRgba(ba._pickId,JL);for(let R=0,O=ba.vertexCount;R<O;R++)r&&(h.fromArray(S,R*3,YAe),Sn.fromCartesian(YAe,Q$),h.pack(Q$.high,d,T*3),h.pack(Q$.low,p,T*3)),m[T*4]=z.floatToByte(JL.red),m[T*4+1]=z.floatToByte(JL.green),m[T*4+2]=z.floatToByte(JL.blue),m[T*4+3]=z.floatToByte(JL.alpha),y[T*3]=v?1:0,y[T*3+1]=I,y[T*3+2]=Z$.color.alpha,T++;ba._dirty=!1}}if(l(n.vertexArray)){if(e._dirtyCount>0){let{indexOffset:c,indexCount:u,vertexOffset:f,vertexCount:d}=eQe(e);n.vertexArray.copyIndexFromRange(n.indexArray,c,u);for(let p in o)if(Object.hasOwn(o,p)){let g=p;n.vertexArray.copyAttributeFromRange(o[g],n.attributeArrays[g],f,d)}}}else{let{attributeArrays:c}=n;n.vertexArray=new zn({context:i,indexBuffer:tt.createIndexBuffer({context:i,typedArray:n.indexArray,usage:Me.STATIC_DRAW,indexDatatype:je.fromTypedArray(n.indexArray)}),attributes:[...r?[{index:J$.positionHigh,componentDatatype:Y.FLOAT,componentsPerAttribute:3,vertexBuffer:tt.createVertexBuffer({typedArray:c.positionHigh,context:i,usage:Me.STATIC_DRAW})},{index:J$.positionLow,componentDatatype:Y.FLOAT,componentsPerAttribute:3,vertexBuffer:tt.createVertexBuffer({typedArray:c.positionLow,context:i,usage:Me.STATIC_DRAW})}]:[{index:qAe.position,componentDatatype:e._positionDatatype,componentsPerAttribute:3,normalize:e._positionNormalized,vertexBuffer:tt.createVertexBuffer({typedArray:c.position,context:i,usage:Me.STATIC_DRAW})}],{index:o.pickColor,componentDatatype:Y.UNSIGNED_BYTE,componentsPerAttribute:4,vertexBuffer:tt.createVertexBuffer({typedArray:c.pickColor,context:i,usage:Me.STATIC_DRAW})},{index:o.showColorAlpha,componentDatatype:Y.FLOAT,componentsPerAttribute:3,vertexBuffer:tt.createVertexBuffer({typedArray:c.showColorAlpha,context:i,usage:Me.STATIC_DRAW})}]})}l(n.renderState)||(n.renderState=Ge.fromCache({blending:e._blendOption===Li.OPAQUE?tn.DISABLED:tn.ALPHA_BLEND,depthTest:{enabled:!0}})),l(n.shaderProgram)||(n.shaderProgram=Qt.fromCache({context:i,vertexShaderSource:new Ye({sources:[HO],defines:r?["USE_FLOAT64"]:[]}),fragmentShaderSource:new Ye({sources:[jO]}),attributeLocations:o}));let s=e.triangleCount*3;l(n.command)||(n.command=new at({vertexArray:n.vertexArray,renderState:n.renderState,shaderProgram:n.shaderProgram,primitiveType:Oe.TRIANGLES,pass:e._blendOption===Li.OPAQUE?Ie.OPAQUE:Ie.TRANSLUCENT,pickId:e._allowPicking?"v_pickColor":void 0,owner:e,count:s,modelMatrix:e.modelMatrix,boundingVolume:e.boundingVolume,debugShowBoundingVolume:e.debugShowBoundingVolume}));let a=n.command;return a.count!==s&&(a.count=s),a.debugShowBoundingVolume!==e.debugShowBoundingVolume&&(a.debugShowBoundingVolume=e.debugShowBoundingVolume),t.commandList.push(a),e._makeClean(),n}function eQe(e){let{_dirtyOffset:t,_dirtyCount:n}=e;e.get(t,ba);let i=ba.vertexOffset,r=ba.triangleOffset*3;e.get(t+n-1,ba);let o=ba.vertexOffset+ba.vertexCount-i,s=(ba.triangleOffset+ba.triangleCount)*3-r;return{indexOffset:r,indexCount:s,vertexOffset:i,vertexCount:o}}function tQe(){let e=this;l(e.vertexArray)&&e.vertexArray.destroy(),l(e.shaderProgram)&&e.shaderProgram.destroy(),l(e.renderState)&&Ge.removeFromCache(e.renderState)}var ZL=QZe;var{ERR_CAPACITY:Azn}=ra.Error,eJ=class e extends ra{constructor(t=H.EMPTY_OBJECT){super(t),this._holeCount=0,this._holeCountMax=t.holeCountMax??ra.DEFAULT_CAPACITY,this._holeIndexView=null,this._triangleCount=0,this._triangleCountMax=t.triangleCountMax??ra.DEFAULT_CAPACITY,this._triangleIndexView=null,this._allocateHoleIndexBuffer(),this._allocateTriangleIndexBuffer()}_getCollectionClass(){return e}_getPrimitiveClass(){return Mo}_getMaterialClass(){return Vf}_allocateHoleIndexBuffer(){this._holeIndexView=je.createTypedArray(this._positionCountMax,this._holeCountMax)}_allocateTriangleIndexBuffer(){this._triangleIndexView=je.createTypedArray(this._positionCountMax,this._triangleCountMax*3)}static clone(t,n,i){return super.clone(t,n,i),l(i)||(this._copySubArray(t._holeIndexView,n._holeIndexView,t.holeCount),this._copySubArray(t._triangleIndexView,n._triangleIndexView,t._triangleCount*3),n._holeCount=t._holeCount,n._triangleCount=t._triangleCount),n}static fromCollection(t,n,i){return super.fromCollection(t,n,i)}_cloneEmpty(t=H.EMPTY_OBJECT){return new e({holeCountMax:this.holeCountMax,triangleCountMax:this.triangleCountMax,...this._cloneEmptyBaseArgs(t)})}static _replaceBuffers(t,n){super._replaceBuffers(t,n),n._holeIndexView=t._holeIndexView,n._triangleIndexView=t._triangleIndexView}add(t,n=new Mo){super.add(t,n);let i=this._positionCount;n._setUint32(Mo.Layout.POSITION_OFFSET_U32,i),n._setUint32(Mo.Layout.POSITION_COUNT_U32,0);let r=this._holeCount;n._setUint32(Mo.Layout.HOLE_OFFSET_U32,r),n._setUint32(Mo.Layout.HOLE_COUNT_U32,0);let o=this._triangleCount;return n._setUint32(Mo.Layout.TRIANGLE_OFFSET_U32,o),n._setUint32(Mo.Layout.TRIANGLE_COUNT_U32,0),l(t.positions)&&n.setPositions(t.positions),l(t.holes)&&n.setHoles(t.holes),l(t.triangles)&&n.setTriangles(t.triangles),n}update(t){super.update(t),this._isRendered(t)&&(this._renderContext=ZL(this,t,this._renderContext))}get byteLength(){return super.byteLength+this._holeIndexView.byteLength+this._triangleIndexView.byteLength}get holeCount(){return this._holeCount}get holeCountMax(){return this._holeCountMax}get triangleCount(){return this._triangleCount}get triangleCountMax(){return this._triangleCountMax}},ja=eJ;var{ERR_RESIZE:Czn,ERR_CAPACITY:vzn}=ra.Error,FS=class FS extends cs{constructor(){super(...arguments);ut(this,"_collection",null)}static clone(n,i){return super.clone(n,i),i.setPositions(n.getPositions()),i}get vertexOffset(){return this._getUint32(FS.Layout.POSITION_OFFSET_U32)}get vertexCount(){return this._getUint32(FS.Layout.POSITION_COUNT_U32)}getPositions(n){let{vertexOffset:i,vertexCount:r}=this,o=this._collection._positionView;if(!l(n)){let s=o.byteOffset+i*3*o.BYTES_PER_ELEMENT,a=o.constructor;return new a(o.buffer,s,r*3)}for(let s=0;s<r;s++)n[s*3]=o[(i+s)*3],n[s*3+1]=o[(i+s)*3+1],n[s*3+2]=o[(i+s)*3+2];return n}setPositions(n){let i=this._collection,r=this.vertexOffset,o=this.vertexCount,s=n.length/3,a=i._positionCount+s-o;i._positionCount=a,this._setUint32(FS.Layout.POSITION_COUNT_U32,s);let c=i._positionView;for(let u=0;u<s;u++)c[(r+u)*3]=n[u*3],c[(r+u)*3+1]=n[u*3+1],c[(r+u)*3+2]=n[u*3+2];this._dirty=!0,i._makeDirtyBoundingVolume()}toJSON(){return{...super.toJSON(),positions:Array.from(this.getPositions())}}};ut(FS,"Layout",{...cs.Layout,POSITION_OFFSET_U32:cs.Layout.__BYTE_LENGTH,POSITION_COUNT_U32:cs.Layout.__BYTE_LENGTH+4,__BYTE_LENGTH:cs.Layout.__BYTE_LENGTH+8});var tJ=FS,xa=tJ;var QL=class QL extends iu{constructor(t=H.EMPTY_OBJECT){super(t),this.width=t.width??1}static pack(t,n,i){super.pack(t,n,i),n.setFloat32(this.Layout.WIDTH_F32+i,t.width,!0)}static unpack(t,n,i){return super.unpack(t,n,i),i.width=t.getFloat32(this.Layout.WIDTH_F32+n,!0),i}toJSON(){return{...super.toJSON(),width:this.width}}};ut(QL,"Layout",{...iu.Layout,WIDTH_F32:iu.Layout.__BYTE_LENGTH,__BYTE_LENGTH:iu.Layout.__BYTE_LENGTH+4}),ut(QL,"DEFAULT_MATERIAL",Object.freeze(new QL));var nJ=QL,jf=nJ;var XAe=16,nQe=.35,KAe=new xa,iQe=new jf,$Ae=new Mo,rQe=new Vf,oQe=new h,sQe=new h,aQe=new he,cQe=new U,lQe=new U,eF=new z,rJ=class{static packPolylineCollectionData(t,n,i){if(l(i)&&t._dirtyCount===0&&t._version===i.version)return i;let r=t.primitiveCount,o=t.boundingVolume,s=ie.fromBoundingSphere(o,n),a=ibe(t,n),c=new Float32Array(r),u=new Uint8Array(r*4),f=new Uint8Array(r*4),d=t.widthUnits==="meters";for(let p=0;p<r;p++){let g=t.get(p,KAe),m=g.getMaterial(iQe);c[p]=d?-m.width:m.width,u[p*4]=z.floatToByte(m.color.red),u[p*4+1]=z.floatToByte(m.color.green),u[p*4+2]=z.floatToByte(m.color.blue),u[p*4+3]=z.floatToByte(m.color.alpha),JAe(f,p,g._pickId)}return Object.assign(i??{},{version:t._version,rectangle:s,positions:a,widths:c,widthInMeters:d,colors:u,pickColors:f})}static packPolylineSegments(t,n,i,r){r.polylineSegments??(r.polylineSegments=[]),r.widths??(r.widths=[]),r.colors??(r.colors=[]),r.pickColors??(r.pickColors=[]),r.polylineSegmentPrimitiveIndices??(r.polylineSegmentPrimitiveIndices=[]),r.primitiveCount??(r.primitiveCount=0),r.rectangle??(r.rectangle=ie.clone(i));let o=i.width,s=t.primitiveCount,a=n.positions;for(let c=0;c<s;c++){let u=t.get(c,KAe);if(!u.show)continue;let f=u.vertexCount,d=u.vertexOffset,p=Math.max(D.EPSILON3,ZAe(n.widths[c],r));for(let g=0;g+1<f;g++){let m=U.fromArray(a,(d+g)*2,cQe),y=U.fromArray(a,(d+g+1)*2,lQe);uQe(m,y,i,o),fQe(m,y,p)&&(r.polylineSegments.push([m.x,m.y,y.x,y.y]),r.polylineSegmentPrimitiveIndices.push(r.primitiveCount+c))}}r.widths.push(n.widths),r.colors.push(n.colors),r.pickColors.push(n.pickColors),s>0&&(r.hasPixelWidths||(r.hasPixelWidths=!n.widthInMeters),r.hasMeterWidths||(r.hasMeterWidths=n.widthInMeters)),r.primitiveCount+=s}static packPolylineGrid(t){let n=t.polylineSegments,i=t.polylineSegmentPrimitiveIndices,r=Math.max(1,Math.ceil(Math.sqrt(n.length/XAe))),o=new Array(r*r);for(let A=0;A<o.length;A++)o[A]=[];let s=0,a=nQe/r,c=TH(t.widths);for(let A=0;A<n.length;A++){let b=n[A],x=Math.max(a,ZAe(c[i[A]],t)),T=Math.max(0,Math.min(b[0],b[2])-x),E=Math.min(1,Math.max(b[0],b[2])+x),v=Math.max(0,Math.min(b[1],b[3])-x),S=Math.min(1,Math.max(b[1],b[3])+x),I=fA(Math.floor(T*r),r),R=fA(Math.floor(E*r),r),O=fA(Math.floor(v*r),r),L=fA(Math.floor(S*r),r);for(let _=O;_<=L;_++)for(let C=I;C<=R;C++)o[_*r+C].push(A),s++}let[u,f]=EH(s),d=u*f,p=new Float32Array(d*4).fill(-1),g=new Float32Array(d).fill(-1),m=new Uint32Array(o.length+2);m[0]=r,m[1]=r;let y=0;for(let A=0;A<o.length;A++){let b=o[A];for(let x=0;x<b.length;x++){let T=b[x],E=n[T];p[y*4]=E[0],p[y*4+1]=E[1],p[y*4+2]=E[2],p[y*4+3]=E[3];let v=i[T];g[y]=v,y++}m[A+2]=y}t.polylineSegmentTexels=p,t.polylineSegmentTextureWidth=u,t.polylineSegmentTextureHeight=f,t.polylineSegmentPrimitiveIndicesTexels=g,t.polylineGridCellIndices=m}static packPolygonCollectionData(t,n,i){if(l(i)&&t._dirtyCount===0&&t._version===i.version)return i;let r=t.primitiveCount,o=t.boundingVolume,s=ie.fromBoundingSphere(o,n),a=ibe(t,n),c=new Float32Array(r),u=new Uint8Array(r*4),f=new Uint8Array(r*4);for(let d=0;d<r;d++){let p=t.get(d,$Ae),g=p.getMaterial(rQe);u[d*4]=z.floatToByte(g.color.red),u[d*4+1]=z.floatToByte(g.color.green),u[d*4+2]=z.floatToByte(g.color.blue),u[d*4+3]=z.floatToByte(g.color.alpha),JAe(f,d,p._pickId)}return Object.assign(i??{},{version:t._version,rectangle:s,positions:a,widths:c,colors:u,pickColors:f})}static packPolygonRings(t,n,i,r){r.polygonRings??(r.polygonRings=[]),r.polygonRingPrimitiveIndices??(r.polygonRingPrimitiveIndices=[]),r.widths??(r.widths=[]),r.colors??(r.colors=[]),r.pickColors??(r.pickColors=[]),r.primitiveCount??(r.primitiveCount=0),r.rectangle??(r.rectangle=ie.clone(i));let o=i.width,s=t.primitiveCount,a=n.positions;for(let c=0;c<s;c++){let u=t.get(c,$Ae);if(!u.show)continue;let f=u.vertexOffset,d=u.vertexCount,p=u.getHoles();for(let g=0;g<=p.length;g++){let m=g===0?0:p[g-1],A=(g===p.length?d:p[g])-m;if(A<3)continue;let b=dQe(a,f+m,A,i,o),x=tbe(b,A,-D.EPSILON3,1+D.EPSILON3,-D.EPSILON3,1+D.EPSILON3,ebe);x.vertexCount<3||(r.polygonRings.push(x.positions.slice(0,x.vertexCount*2)),r.polygonRingPrimitiveIndices.push(r.primitiveCount+c))}}r.widths.push(n.widths),r.colors.push(n.colors),r.pickColors.push(n.pickColors),r.primitiveCount+=s}static packPolygonGrid(t){let n=t.polygonRings,i=t.polygonRingPrimitiveIndices,r=0;for(let y=0;y<n.length;y++)r+=n[y].length/2;let o=Math.max(1,Math.ceil(Math.sqrt(r/XAe))),s=new Array(o*o);for(let y=0;y<s.length;y++)s[y]=[];let a=0;for(let y=0;y<n.length;y++){let A=n[y],b=i[y],x=A.length/2,T=1/0,E=1/0,v=-1/0,S=-1/0;for(let _=0;_<x;_++)T=Math.min(T,A[_*2]),v=Math.max(v,A[_*2]),E=Math.min(E,A[_*2+1]),S=Math.max(S,A[_*2+1]);let I=fA(Math.floor(T*o),o),R=fA(Math.floor(v*o),o),O=fA(Math.floor(E*o),o),L=fA(Math.floor(S*o),o);for(let _=O;_<=L;_++)for(let C=I;C<=R;C++){let w=tbe(A,x,C/o-D.EPSILON5,(C+1)/o+D.EPSILON5,_/o-D.EPSILON5,(_+1)/o+D.EPSILON5,ebe),P=w.vertexCount;if(P<3)continue;let M=w.positions,F=s[_*o+C];for(let V=0;V<P;V++){let B=(V+1)%P,j=M[V*2],k=M[V*2+1],G=M[B*2],q=M[B*2+1];k!==q&&(F.push(j,k,G,q,b),a++)}}}let[c,u]=EH(a),f=c*u,d=new Float32Array(f*4).fill(-1),p=new Float32Array(f).fill(-1),g=new Uint32Array(s.length+2);g[0]=o,g[1]=o;let m=0;for(let y=0;y<s.length;y++){let A=s[y];for(let b=0;b<A.length;b+=5)d[m*4]=A[b],d[m*4+1]=A[b+1],d[m*4+2]=A[b+2],d[m*4+3]=A[b+3],p[m]=A[b+4],m++;g[y+2]=m}t.polygonEdgeTexels=d,t.polygonEdgeTextureWidth=c,t.polygonEdgeTextureHeight=u,t.polygonEdgePrimitiveIndicesTexels=p,t.polygonGridCellIndices=g}static packPrimitiveTextures(t,n){let[i,r]=EH(n.primitiveCount),o=new Float32Array(i*r);o.set(TH(n.widths)),n.widthTexture=new Dt({context:t,pixelFormat:Ke.RED,pixelDatatype:ze.FLOAT,source:{width:i,height:r,arrayBufferView:o},sampler:jt.NEAREST,flipY:!1});let s=new Uint8Array(i*r*4);s.set(TH(n.colors)),n.colorTexture=new Dt({context:t,pixelFormat:Ke.RGBA,pixelDatatype:ze.UNSIGNED_BYTE,source:{width:i,height:r,arrayBufferView:s},sampler:jt.NEAREST,flipY:!1});let a=new Uint8Array(i*r*4);a.set(TH(n.pickColors)),n.pickColorTexture=new Dt({context:t,pixelFormat:Ke.RGBA,pixelDatatype:ze.UNSIGNED_BYTE,source:{width:i,height:r,arrayBufferView:a},sampler:jt.NEAREST,flipY:!1})}static packPolylineTextures(t,n){n.polylineSegmentTexture=new Dt({context:t,pixelFormat:Ke.RGBA,pixelDatatype:ze.FLOAT,source:{width:n.polylineSegmentTextureWidth,height:n.polylineSegmentTextureHeight,arrayBufferView:n.polylineSegmentTexels},sampler:jt.NEAREST,flipY:!1}),n.polylineSegmentPrimitiveIndicesTexture=new Dt({context:t,pixelFormat:Ke.RED,pixelDatatype:ze.FLOAT,source:{width:n.polylineSegmentTextureWidth,height:n.polylineSegmentTextureHeight,arrayBufferView:n.polylineSegmentPrimitiveIndicesTexels},sampler:jt.NEAREST,flipY:!1}),n.polylineGridCellIndicesTexture=nbe(t,n.polylineGridCellIndices)}static packPolygonTextures(t,n){n.polygonEdgeTexture=new Dt({context:t,pixelFormat:Ke.RGBA,pixelDatatype:ze.FLOAT,source:{width:n.polygonEdgeTextureWidth,height:n.polygonEdgeTextureHeight,arrayBufferView:n.polygonEdgeTexels},sampler:jt.NEAREST,flipY:!1}),n.polygonEdgePrimitiveIndicesTexture=new Dt({context:t,pixelFormat:Ke.RED,pixelDatatype:ze.FLOAT,source:{width:n.polygonEdgeTextureWidth,height:n.polygonEdgeTextureHeight,arrayBufferView:n.polygonEdgePrimitiveIndicesTexels},sampler:jt.NEAREST,flipY:!1}),n.polygonGridCellIndicesTexture=nbe(t,n.polygonGridCellIndices)}static freeResources(t){t.polylineSegmentTexture?.destroy(),t.widthTexture?.destroy(),t.colorTexture?.destroy(),t.pickColorTexture?.destroy(),t.polylineSegmentPrimitiveIndicesTexture?.destroy(),t.polylineGridCellIndicesTexture?.destroy(),t.polygonEdgeTexture?.destroy(),t.polygonEdgePrimitiveIndicesTexture?.destroy(),t.polygonGridCellIndicesTexture?.destroy()}};function JAe(e,t,n){z.fromRgba(n,eF),e[t*4]=z.floatToByte(eF.red),e[t*4+1]=z.floatToByte(eF.green),e[t*4+2]=z.floatToByte(eF.blue),e[t*4+3]=z.floatToByte(eF.alpha)}function ZAe(e,t){if(e>=0)return(e+1)*.5/t.minimumTileScreenPixels;let n=t.metersPerUv;return-e*.5/Math.min(n.x,n.y)}function uQe(e,t,n,i){let r=e.x,o=t.x;o=r+D.negativePiToPi(o-r);let s=n.west+i*.5,a=s+D.negativePiToPi(r-s)-r;r+=a,o+=a;let c=n.north-n.south;e.x=(r-n.west)/i,e.y=(e.y-n.south)/c,t.x=(o-n.west)/i,t.y=(t.y-n.south)/c}function fQe(e,t,n){let i=-n,r=1+n,o=0,s=1,a=e.x,c=e.y,u=t.x,f=t.y,d=u-a,p=f-c,g=[-d,d,-p,p],m=[a-i,r-a,c-i,r-c];for(let y=0;y<4;y++){if(Math.abs(g[y])<1e-12){if(m[y]<0)return!1;continue}let A=m[y]/g[y];if(g[y]<0?o=Math.max(o,A):s=Math.min(s,A),o>s)return!1}return e.x=a+o*d,e.y=c+o*p,t.x=a+s*d,t.y=c+s*p,!0}function fA(e,t){return Math.max(0,Math.min(t-1,e))}var iJ=new Float64Array(512),QAe=new Float64Array(512),ebe={positions:new Float64Array(512),vertexCount:0};function dQe(e,t,n,i,r){iJ.length<n*2&&(iJ=new Float64Array(n*4));let o=iJ,s=i.north-i.south,a=e[t*2];o[0]=a,o[1]=e[t*2+1];for(let d=1;d<n;d++){let p=a+D.negativePiToPi(e[(t+d)*2]-a);o[d*2]=p,o[d*2+1]=e[(t+d)*2+1],a=p}let c=i.west+r*.5,u=o[0],f=c+D.negativePiToPi(u-c)-u;for(let d=0;d<n;d++)o[d*2]=(o[d*2]+f-i.west)/r,o[d*2+1]=(o[d*2+1]-i.south)/s;return o}function tbe(e,t,n,i,r,o,s){let a=e,c=t;for(let u=0;u<4;u++){let f=u>>1,d=(u&1)===0?1:-1,p=u===0?n:u===1?i:u===2?r:o,g=c*4+4,m=(u&1)===0,y=m?QAe:s.positions;y.length<g&&(y=new Float64Array(g*2),m?QAe=y:s.positions=y);let A=0,b=a[(c-1)*2],x=a[(c-1)*2+1],T=d*((f===0?b:x)-p)>=0;for(let E=0;E<c;E++){let v=a[E*2],S=a[E*2+1],I=d*((f===0?v:S)-p)>=0;if(I!==T){let R=f===0?(p-b)/(v-b):(p-x)/(S-x);y[A*2]=f===0?p:b+R*(v-b),y[A*2+1]=f===0?x+R*(S-x):p,A++}I&&(y[A*2]=v,y[A*2+1]=S,A++),b=v,x=S,T=I}if(A===0)return s.vertexCount=0,s;a=y,c=A}return s.vertexCount=c,s}function EH(e){let t=D.nextPowerOfTwo(Math.max(1,Math.ceil(Math.sqrt(e)))),n=D.nextPowerOfTwo(Math.max(1,Math.ceil(e/t)));return[t,n]}function nbe(e,t){let[n,i]=EH(t.length),r=new Float32Array(n*i);return r.set(t),new Dt({context:e,pixelFormat:Ke.RED,pixelDatatype:ze.FLOAT,source:{width:n,height:i,arrayBufferView:r},sampler:jt.NEAREST,flipY:!1})}function ibe(e,t,n){l(n)||(n=new Float64Array(e._positionCountMax*2));let i=e._positionView,r=e.modelMatrix;for(let o=0;o<e._positionCount;o++){let s=h.fromArray(i,o*3,oQe),a=N.multiplyByPoint(r,s,sQe),c=t.cartesianToCartographic(a,aQe);n[o*2]=c.longitude,n[o*2+1]=c.latitude}return n}function TH(e){let t=0;for(let o of e)t+=o.byteLength;let n=e[0].constructor,i=new n(t/n.BYTES_PER_ELEMENT),r=0;for(let o of e)i.set(o,r),r+=o.length;return i}var vs=rJ;var aJ=new Mo,oJ="ClippingPolygonCollection.quality is deprecated as of CesiumJS 1.145 and will be removed in 1.147. Signed distance field clipping was replaced with vector clipping, so this property no longer has any effect.",sJ="ClippingPolygonCollection.debugShowDistanceTexture is deprecated as of CesiumJS 1.145 and will be removed in 1.147. Signed distance field clipping was replaced with vector clipping, so this property no longer has any effect.",hQe="ClippingPolygonCollection.isDestroyed is deprecated as of CesiumJS 1.145 and will be removed in 1.147. The collection no longer holds any GPU resources of its own, so it does not need to be destroyed.",mQe="ClippingPolygonCollection.destroy is deprecated as of CesiumJS 1.145 and will be removed in 1.147. The collection no longer holds any GPU resources of its own, so it does not need to be destroyed.";function ll(e){e=e??H.EMPTY_OBJECT,this._polygons=[];let t=e.polygons??[],n=0,i=0;for(let r=0;r<t.length;++r)n+=t[r].length,i+=t[r].holes.length;this._dirty=!1,this._bufferPolygonCollection=new ja({show:!1,allowPicking:!1,primitiveCountMax:2*t.length,vertexCountMax:2*n,holeCountMax:i>0?2*i:0,triangleCountMax:0});for(let r=0;r<t.length;++r){let o=this._bufferPolygonCollection.primitiveCount;this._bufferPolygonCollection.add(obe(t[r]),aJ),this._polygons.push({clippingPolygon:t[r],bufferIndex:o})}l(e.debugShowDistanceTexture)&&qr("ClippingPolygonCollection.debugShowDistanceTexture",sJ),this._debugShowDistanceTexture=e.debugShowDistanceTexture??!1,this.enabled=e.enabled??!0,this.inverse=e.inverse??!1,l(e.quality)&&qr("ClippingPolygonCollection.quality",oJ),this._quality=e.quality??1,this.polygonAdded=new be,this.polygonRemoved=new be,this.ellipsoid=e.ellipsoid??ee.default,this._owner=void 0,this._vectorCollectionData=vs.packPolygonCollectionData(this._bufferPolygonCollection,this.ellipsoid)}Object.defineProperties(ll.prototype,{length:{get:function(){return this._polygons.length}},debugShowDistanceTexture:{get:function(){return qr("ClippingPolygonCollection.debugShowDistanceTexture",sJ),this._debugShowDistanceTexture},set:function(e){qr("ClippingPolygonCollection.debugShowDistanceTexture",sJ),this._debugShowDistanceTexture=e}},quality:{get:function(){return qr("ClippingPolygonCollection.quality",oJ),this._quality},set:function(e){qr("ClippingPolygonCollection.quality",oJ),this._quality=e}},owner:{get:function(){return this._owner}},clippingPolygonsState:{get:function(){return!this.enabled||this.length===0?0:this.inverse?-1:1}}});function obe(e){let t=e.positions,n=e.holes,i=new Float64Array(e.length*3),r=0;for(let s=0;s<t.length;s++)h.pack(t[s],i,r*3),r++;if(n.length===0)return{positions:i,holes:void 0};let o=new Uint32Array(n.length);for(let s=0;s<n.length;s++){let a=n[s];o[s]=r;for(let c=0;c<a.length;c++)h.pack(a[c],i,r*3),r++}return{positions:i,holes:o}}function pQe(e,t,n){let i=e._bufferPolygonCollection,r=i.primitiveCount+1,o=i.vertexCount+t,s=i.holeCount+n;if(r<=i.primitiveCountMax&&o<=i.vertexCountMax&&s<=i.holeCountMax)return i;let a=e._polygons.length!==i.primitiveCount,c=ja.fromCollection(i,{primitiveCountMax:D.nextPowerOfTwo(r),vertexCountMax:D.nextPowerOfTwo(o),holeCountMax:D.nextPowerOfTwo(s)},a?u=>u.show:void 0);if(i.destroy(),e._bufferPolygonCollection=c,a){let u=e._polygons;for(let f=0;f<u.length;++f)u[f].bufferIndex=f}return c}function sbe(e,t){e._bufferPolygonCollection.get(t.bufferIndex,aJ).show=!1,t.bufferIndex=-1}ll.prototype.add=function(e){let t=this._polygons.length,n=pQe(this,e.length,e.holes.length);return this._polygons.push({clippingPolygon:e,bufferIndex:n.primitiveCount}),n.add(obe(e),aJ),this._dirty=!0,this.polygonAdded.raiseEvent(e,t),e};ll.prototype.get=function(e){return this._polygons[e]?.clippingPolygon};ll.prototype.contains=function(e){return this._polygons.some(t=>LS.equals(t.clippingPolygon,e))};ll.prototype.remove=function(e){let t=this._polygons,n=t.findIndex(r=>LS.equals(r.clippingPolygon,e));if(n===-1)return!1;let[i]=t.splice(n,1);return sbe(this,i),this._dirty=!0,this.polygonRemoved.raiseEvent(i.clippingPolygon,n),!0};ll.prototype.removeAll=function(){let e=this._polygons,t=e.length;for(let n=0;n<t;++n){let i=e[n];sbe(this,i),this.polygonRemoved.raiseEvent(i.clippingPolygon,n)}this._dirty=!0,this._polygons=[]};ll.prototype.update=function(e){if(!ll.isSupported(e))throw new oe("ClippingPolygonCollections are only supported for WebGL 2.");this._dirty&&(this._dirty=!1,this.length!==0&&(this._vectorCollectionData=vs.packPolygonCollectionData(this._bufferPolygonCollection,this.ellipsoid)))};var rbe=new ie,gQe=new ie;ll.prototype.computeIntersectionWithBoundingVolume=function(e,t){let n=this._polygons,i=n.length,r=$t.OUTSIDE;this.inverse&&(r=$t.INSIDE);let o=e.rectangle;if(!l(o)&&l(e.boundingVolume?.computeCorners)){let s=e.boundingVolume.computeCorners();o=ie.fromCartesianArray(s,t,rbe)}l(o)||(o=ie.fromBoundingSphere(e.boundingSphere,t,rbe));for(let s=0;s<i;++s){let a=n[s].clippingPolygon,c=ie.intersection(o,a.rectangle,gQe);if(l(c))return $t.INTERSECTING}return r};ll.setOwner=function(e,t,n){e!==t[n]&&(t[n]=void 0,l(e)&&(e._owner=t,t[n]=e))};ll.prototype.requestRectangleData=function(e,t){let n={rectangle:ie.clone(e),polygonRings:[]};return this.length===0||(vs.packPolygonRings(this._bufferPolygonCollection,this._vectorCollectionData,e,n),n.polygonRings.length===0)||(vs.packPolygonGrid(n),vs.packPolygonTextures(t,n)),n};ll.releaseRectangleData=function(e){vs.freeResources(e)};ll.isSupported=function(e){return e?.context.webgl2};ll.prototype.isDestroyed=function(){return qr("ClippingPolygonCollection.isDestroyed",hQe),!1};ll.prototype.destroy=function(){return qr("ClippingPolygonCollection.destroy",mQe),le(this)};var Nc=ll;var BS={NONE:0,SCENE_LIGHT:1,SUNLIGHT:2};BS.fromGlobeFlags=function(e){return e.enableLighting&&e.dynamicAtmosphereLighting?e.dynamicAtmosphereLightingFromSun?BS.SUNLIGHT:BS.SCENE_LIGHT:BS.NONE};Object.freeze(BS);var Gg=BS;function abe(){this.lightIntensity=10,this.rayleighCoefficient=new h(55e-7,13e-6,284e-7),this.mieCoefficient=new h(21e-6,21e-6,21e-6),this.rayleighScaleHeight=1e4,this.mieScaleHeight=3200,this.mieAnisotropy=.9,this.hueShift=0,this.saturationShift=0,this.brightnessShift=0,this.dynamicLighting=Gg.NONE}abe.requiresColorCorrect=function(e){return!(D.equalsEpsilon(e.hueShift,0,D.EPSILON7)&&D.equalsEpsilon(e.saturationShift,0,D.EPSILON7)&&D.equalsEpsilon(e.brightnessShift,0,D.EPSILON7))};var xT=abe;function Ci(e){this._position=void 0,this._radianceMapDirty=!1,this._radianceCommandsDirty=!1,this._convolutionsCommandsDirty=!1,this._irradianceCommandDirty=!1,this._irradianceTextureDirty=!1,this._sphericalHarmonicCoefficientsDirty=!1,this._shouldRegenerateShaders=!1,this._shouldReset=!1,e=e??H.EMPTY_OBJECT;let t=Math.max(Math.floor(Math.min(e.mipmapLevels??7,Math.log2(kt.maximumCubeMapSize))),0);this._mipmapLevels=t;let n=Math.max(t-1,0)*6;this._radianceMapComputeCommands=new Array(6),this._convolutionComputeCommands=new Array(n),this._irradianceComputeCommand=void 0,this._radianceMapFS=void 0,this._irradianceMapFS=void 0,this._convolveSP=void 0,this._va=void 0,this._radianceMapTextures=new Array(6),this._specularMapTextures=new Array(n),this._radianceCubeMap=void 0,this._irradianceMapTexture=void 0,this._sphericalHarmonicCoefficients=Ci.DEFAULT_SPHERICAL_HARMONIC_COEFFICIENTS.slice(),this._lastTime=new K;let i=Math.max(Math.pow(2,t-1),1);this._textureDimensions=new U(i,i),this._radiiAndDynamicAtmosphereColor=new h,this._sceneEnvironmentMap=void 0,this._backgroundColor=void 0,this._owner=void 0,this.enabled=e.enabled??!0,this.shouldUpdate=!0,this.maximumSecondsDifference=e.maximumSecondsDifference??3600,this.maximumPositionEpsilon=e.maximumPositionEpsilon??1e3,this.atmosphereScatteringIntensity=e.atmosphereScatteringIntensity??2,this.gamma=e.gamma??1,this.brightness=e.brightness??1,this.saturation=e.saturation??1,this.groundColor=e.groundColor??Ci.AVERAGE_EARTH_GROUND_COLOR,this.groundAlbedo=e.groundAlbedo??.31}Object.defineProperties(Ci.prototype,{owner:{get:function(){return this._owner}},shouldRegenerateShaders:{get:function(){return this._shouldRegenerateShaders}},position:{get:function(){return this._position},set:function(e){h.equalsEpsilon(e,this._position,0,this.maximumPositionEpsilon)||(this._position=h.clone(e,this._position),this._shouldReset=!0)}},radianceCubeMap:{get:function(){return this._radianceCubeMap}},maximumMipmapLevel:{get:function(){return this._mipmapLevels}},sphericalHarmonicCoefficients:{get:function(){return this._sphericalHarmonicCoefficients}}});Ci._maximumComputeCommandCount=8;Ci._activeComputeCommandCount=0;Ci._nextFrameCommandQueue=[];Ci._queueCommand=(e,t)=>{if(Ci._activeComputeCommandCount>=Ci._maximumComputeCommandCount){Ci._nextFrameCommandQueue.push(e);return}t.commandList.push(e),Ci._activeComputeCommandCount++};Ci._updateCommandQueue=e=>{if(Ci._maximumComputeCommandCount=Math.log2(kt.maximumCubeMapSize),Ci._nextFrameCommandQueue.length>0&&Ci._activeComputeCommandCount<Ci._maximumComputeCommandCount){let t=Ci._nextFrameCommandQueue.shift();for(;l(t)&&Ci._activeComputeCommandCount<Ci._maximumComputeCommandCount;){if(t.owner.isDestroyed()||t.canceled){t=Ci._nextFrameCommandQueue.shift();continue}e.commandList.push(t),Ci._activeComputeCommandCount++,t=Ci._nextFrameCommandQueue.shift()}l(t)&&Ci._nextFrameCommandQueue.push(t)}};Ci.setOwner=function(e,t,n){e!==t[n]&&(t[n]=t[n]&&t[n].destroy(),l(e)&&(e._owner=t,t[n]=e))};Ci.prototype.reset=function(){let e=this._radianceMapComputeCommands.length;for(let t=0;t<e;++t)l(this._radianceMapComputeCommands[t])&&(this._radianceMapComputeCommands[t].canceled=!0),this._radianceMapComputeCommands[t]=void 0;e=this._convolutionComputeCommands.length;for(let t=0;t<e;++t)l(this._convolutionComputeCommands[t])&&(this._convolutionComputeCommands[t].canceled=!0),this._convolutionComputeCommands[t]=void 0;l(this._irradianceComputeCommand)&&(this._irradianceComputeCommand.canceled=!0,this._irradianceComputeCommand=void 0),this._radianceMapDirty=!0,this._radianceCommandsDirty=!0,this._convolutionsCommandsDirty=!1,this._irradianceCommandDirty=!1};var _Qe=new h,yQe=new h;function AQe(e,t){let n=e._position,i=t.atmosphere,r=t.mapProjection.ellipsoid,o=r.scaleToGeodeticSurface(n,yQe),s=1.025,a=_Qe,c=l(o)?h.magnitude(o):r.maximumRadius;return a.x=c*s,a.y=c,a.z=i.dynamicLighting,!h.equalsEpsilon(e._radiiAndDynamicAtmosphereColor,a)||t.environmentMap!==e._sceneEnvironmentMap||t.backgroundColor!==e._backgroundColor?(h.clone(a,e._radiiAndDynamicAtmosphereColor),e._sceneEnvironmentMap=t.environmentMap,e._backgroundColor=t.backgroundColor,!0):!1}var cbe=new h,bQe=new N,xQe=new se,TQe=new z;function EQe(e,t){let n=t.context,i=e._textureDimensions;if(l(e._radianceCubeMap)||(e._radianceCubeMap=new ns({context:n,width:i.x,height:i.y,pixelDatatype:ze.UNSIGNED_BYTE,pixelFormat:Ke.RGBA})),e._radianceCommandsDirty){let r=e._radianceMapFS;l(r)||(r=new Ye({sources:[Yh,QO]}),e._radianceMapFS=r),xT.requiresColorCorrect(t.atmosphere)&&r.defines.push("ATMOSPHERE_COLOR_CORRECT");let o=e._position,s=e._radiiAndDynamicAtmosphereColor,a=t.mapProjection.ellipsoid,c=At.eastNorthUpToFixedFrame(o,a,bQe),u=xQe;u.x=e.brightness,u.y=e.saturation,u.z=e.gamma,u.w=e.atmosphereScatteringIntensity,(e.brightness!==1||e.saturation!==1||e.gamma!==1)&&r.defines.push("ENVIRONMENT_COLOR_CORRECT");let f=0;for(let d of ns.faceNames()){let p=e._radianceMapTextures[f];l(p)&&!p.isDestroyed()&&p.destroy(),p=new Dt({context:n,width:i.x,height:i.y,pixelDatatype:ze.UNSIGNED_BYTE,pixelFormat:Ke.RGBA}),e._radianceMapTextures[f]=p;let g=f,m=new xf({fragmentShaderSource:r,outputTexture:p,uniformMap:{u_radiiAndDynamicAtmosphereColor:()=>s,u_enuToFixedFrame:()=>c,u_faceDirection:()=>ns.getDirection(d,cbe),u_positionWC:()=>o,u_brightnessSaturationGammaIntensity:()=>u,u_groundColor:()=>e.groundColor.withAlpha(e.groundAlbedo,TQe)},owner:e});m.postExecute=()=>{if(e.isDestroyed()||m.canceled){Ci._activeComputeCommandCount--;return}let y=e._radianceMapComputeCommands;y[g]=void 0;let A=new _s({context:n,colorTextures:[e._radianceMapTextures[g]]});A._bind(),e._radianceCubeMap[d].copyFromFramebuffer(),A._unBind(),A.destroy(),Ci._activeComputeCommandCount--,y.some(l)||(e._convolutionsCommandsDirty=!0,e._shouldRegenerateShaders=!0)},e._radianceMapComputeCommands[f]=m,Ci._queueCommand(m,t),f++}e._radianceCommandsDirty=!1}}function CQe(e,t){let n=e._radianceCubeMap;n.generateMipmap();let i=e._mipmapLevels,r=e._textureDimensions,o=r.x/2,s=r.y/2,a=t.context,c=0,u=()=>{let p=e._specularMapTextures.length;c>=p&&(e._irradianceCommandDirty=!0,i>1&&(n.sampler=new jt({minificationFilter:Wt.LINEAR_MIPMAP_LINEAR}),e._shouldRegenerateShaders=!0,e._va.destroy(),e._va=void 0,e._convolveSP.destroy(),e._convolveSP=void 0))},f=(p,g,m,y,A)=>()=>{if(e.isDestroyed()||p.canceled){Ci._activeComputeCommandCount--;return}let b=e._convolutionComputeCommands;b[g]=void 0,n.copyFace(t,m,y,A),c++,Ci._activeComputeCommandCount--,m.destroy(),e._specularMapTextures[g]=void 0,u()},d=0;for(let p=1;p<i;++p){for(let g of ns.faceNames()){l(e._specularMapTextures[d])&&e._specularMapTextures[d].destroy();let m=e._specularMapTextures[d]=new Dt({context:a,width:o,height:s,pixelDatatype:ze.UNSIGNED_BYTE,pixelFormat:Ke.RGBA}),y=e._va;l(y)||(y=ns.createVertexArray(a,g),e._va=y);let A=e._convolveSP;l(A)||(A=Qt.fromCache({context:a,vertexShaderSource:tM,fragmentShaderSource:eM,attributeLocations:{positions:0}}),e._convolveSP=A);let b=new xf({shaderProgram:A,vertexArray:y,outputTexture:m,persists:!0,owner:e,uniformMap:{u_roughness:()=>p/(i-1),u_radianceTexture:()=>n??a.defaultTexture,u_faceDirection:()=>ns.getDirection(g,cbe)}});b.postExecute=f(b,d,m,g,p),e._convolutionComputeCommands[d]=b,Ci._queueCommand(b,t),++d}o/=2,s/=2}u()}var lbe=new U(3,3);function vQe(e,t){let n=t.context,i=lbe,r=e._irradianceMapTexture;l(r)&&!r.isDestroyed()&&r.destroy(),r=new Dt({context:n,width:i.x,height:i.y,pixelDatatype:ze.FLOAT,pixelFormat:Ke.RGBA}),e._irradianceMapTexture=r;let o=e._irradianceMapFS;l(o)||(o=new Ye({sources:[ZO]}),e._irradianceMapFS=o);let s=new xf({fragmentShaderSource:o,outputTexture:r,owner:e,uniformMap:{u_radianceMap:()=>e._radianceCubeMap??n.defaultTexture}});s.postExecute=()=>{if(e.isDestroyed()||s.canceled){Ci._activeComputeCommandCount--;return}e._irradianceTextureDirty=!1,e._irradianceComputeCommand=void 0,e._sphericalHarmonicCoefficientsDirty=!0,e._irradianceMapFS=void 0,Ci._activeComputeCommandCount--},e._irradianceComputeCommand=s,Ci._queueCommand(s,t),e._irradianceTextureDirty=!0}function SQe(e,t){let n=t.context;if(!l(e._irradianceMapTexture))return;let i=new _s({context:n,colorTextures:[e._irradianceMapTexture],destroyAttachments:!1}),r=lbe,o=n.readPixels({x:0,y:0,width:r.x,height:r.y,framebuffer:i});for(let s=0;s<9;++s)e._sphericalHarmonicCoefficients[s]=h.unpack(o,s*4),h.multiplyByScalar(e._sphericalHarmonicCoefficients[s],e.atmosphereScatteringIntensity,e._sphericalHarmonicCoefficients[s]);i.destroy(),e._irradianceMapTexture.destroy(),e._irradianceMapTexture=void 0,e._shouldRegenerateShaders=!0}Ci.prototype.update=function(e){let t=e.mode;if(!(Ci.isDynamicUpdateSupported(e)&&this._mipmapLevels>=1)||!this.enabled||!this.shouldUpdate||!l(this._position)||t===re.MORPHING){this._shouldRegenerateShaders=!1;return}Ci._updateCommandQueue(e);let i=e.atmosphere.dynamicLighting,r=AQe(this,e)||i===Gg.SUNLIGHT&&!K.equalsEpsilon(e.time,this._lastTime,this.maximumSecondsDifference);if(this._shouldReset||r){this.reset(),this._shouldReset=!1,this._lastTime=K.clone(e.time,this._lastTime);return}if(this._radianceMapDirty&&(EQe(this,e),this._radianceMapDirty=!1),this._convolutionsCommandsDirty&&(CQe(this,e),this._convolutionsCommandsDirty=!1),this._irradianceCommandDirty&&(vQe(this,e),this._irradianceCommandDirty=!1),this._irradianceTextureDirty){this._shouldRegenerateShaders=!1;return}if(this._sphericalHarmonicCoefficientsDirty){SQe(this,e),this._sphericalHarmonicCoefficientsDirty=!1;return}this._shouldRegenerateShaders=!1};Ci.prototype.isDestroyed=function(){return!1};Ci.prototype.destroy=function(){let e=this._radianceMapComputeCommands.length;for(let t=0;t<e;++t)this._radianceMapComputeCommands[t]=void 0;e=this._convolutionComputeCommands.length;for(let t=0;t<e;++t)this._convolutionComputeCommands[t]=void 0;this._irradianceMapComputeCommand=void 0,e=this._radianceMapTextures.length;for(let t=0;t<e;++t)this._radianceMapTextures[t]=this._radianceMapTextures[t]&&!this._radianceMapTextures[t].isDestroyed()&&this._radianceMapTextures[t].destroy();e=this._specularMapTextures.length;for(let t=0;t<e;++t)this._specularMapTextures[t]=this._specularMapTextures[t]&&!this._specularMapTextures[t].isDestroyed()&&this._specularMapTextures[t].destroy();return this._radianceCubeMap=this._radianceCubeMap&&this._radianceCubeMap.destroy(),this._irradianceMapTexture=this._irradianceMapTexture&&!this._irradianceMapTexture.isDestroyed()&&this._irradianceMapTexture.destroy(),l(this._va)&&this._va.destroy(),l(this._convolveSP)&&this._convolveSP.destroy(),le(this)};Ci.isDynamicUpdateSupported=function(e){let t=e.context;return t.halfFloatingPointTexture||t.colorBufferFloat};Ci.AVERAGE_EARTH_GROUND_COLOR=Object.freeze(z.fromCssColorString("#717145"));Ci.DEFAULT_SPHERICAL_HARMONIC_COEFFICIENTS=Object.freeze([Object.freeze(new h(.35449,.35449,.35449)),h.ZERO,h.ZERO,h.ZERO,h.ZERO,h.ZERO,h.ZERO,h.ZERO,h.ZERO]);var Wg=Ci;var ube={SURFACES_ONLY:0,SURFACES_AND_EDGES:1,EDGES_ONLY:2};Object.freeze(ube);var Kd=ube;var fbe={XTRANSLATE:"xTranslate",YTRANSLATE:"yTranslate",ZTRANSLATE:"zTranslate",XROTATE:"xRotate",YROTATE:"yRotate",ZROTATE:"zRotate",XSCALE:"xScale",YSCALE:"yScale",ZSCALE:"zScale",UNIFORMSCALE:"uniformScale"};Object.freeze(fbe);var ul=fbe;var dbe={STEP:0,LINEAR:1,CUBICSPLINE:2};Object.freeze(dbe);var ym=dbe;function wQe(e){switch(e){case"SCALAR":return 1;case"VEC2":return 2;case"VEC3":return 3;case"VEC4":case"MAT2":return 4;case"MAT3":return 9;case"MAT4":return 16}}var Hf=wQe;function IQe(e,t){let n=t.bufferView;if(l(n)){let i=e.bufferViews[n];if(l(i.byteStride)&&i.byteStride>0)return i.byteStride}return Y.getSizeInBytes(t.componentType)*Hf(t.type)}var ju=IQe;function PQe(e){switch(e){case Y.BYTE:return function(t,n,i,r,o){for(let s=0;s<i;++s)o[s]=t.getInt8(n+s*r)};case Y.UNSIGNED_BYTE:return function(t,n,i,r,o){for(let s=0;s<i;++s)o[s]=t.getUint8(n+s*r)};case Y.SHORT:return function(t,n,i,r,o){for(let s=0;s<i;++s)o[s]=t.getInt16(n+s*r,!0)};case Y.UNSIGNED_SHORT:return function(t,n,i,r,o){for(let s=0;s<i;++s)o[s]=t.getUint16(n+s*r,!0)};case Y.INT:return function(t,n,i,r,o){for(let s=0;s<i;++s)o[s]=t.getInt32(n+s*r,!0)};case Y.UNSIGNED_INT:return function(t,n,i,r,o){for(let s=0;s<i;++s)o[s]=t.getUint32(n+s*r,!0)};case Y.FLOAT:return function(t,n,i,r,o){for(let s=0;s<i;++s)o[s]=t.getFloat32(n+s*r,!0)};case Y.DOUBLE:return function(t,n,i,r,o){for(let s=0;s<i;++s)o[s]=t.getFloat64(n+s*r,!0)}}}var qg=PQe;function hc(){}Object.defineProperties(hc.prototype,{class:{get:function(){pe.throwInstantiationError()}}});hc.prototype.hasProperty=function(e){pe.throwInstantiationError()};hc.prototype.hasPropertyBySemantic=function(e){pe.throwInstantiationError()};hc.prototype.getPropertyIds=function(e){pe.throwInstantiationError()};hc.prototype.getProperty=function(e){pe.throwInstantiationError()};hc.prototype.setProperty=function(e,t){pe.throwInstantiationError()};hc.prototype.getPropertyBySemantic=function(e){pe.throwInstantiationError()};hc.prototype.setPropertyBySemantic=function(e,t){pe.throwInstantiationError()};hc.hasProperty=function(e,t,n){if(l(t[e]))return!0;let i=n.properties;if(!l(i))return!1;let r=i[e];return!!(l(r)&&l(r.default))};hc.hasPropertyBySemantic=function(e,t,n){let i=n.propertiesBySemantic;if(!l(i))return!1;let r=i[e];return l(r)};hc.getPropertyIds=function(e,t,n){n=l(n)?n:[],n.length=0;for(let r in e)e.hasOwnProperty(r)&&l(e[r])&&n.push(r);let i=t.properties;if(l(i))for(let r in i)i.hasOwnProperty(r)&&!l(e[r])&&l(i[r].default)&&n.push(r);return n};hc.getProperty=function(e,t,n){let i=n.properties[e],r=t[e];Array.isArray(r)&&l(r.slice)&&(r=r.slice());let o=!0;if(r=i.handleNoData(r),!l(r)&&l(i.default))return r=Je(i.default,!0),i.unpackVectorAndMatrixTypes(r,o);if(l(r))return r=i.normalize(r),r=i.applyValueTransform(r),i.unpackVectorAndMatrixTypes(r,o)};hc.setProperty=function(e,t,n,i){if(!l(n[e]))return!1;Array.isArray(t)&&l(t.slice)&&(t=t.slice());let r,o=i.properties;return l(o)&&(r=o[e]),l(r)&&(t=r.packVectorAndMatrixTypes(t,!0),t=r.unapplyValueTransform(t),t=r.unnormalize(t)),n[e]=t,!0};hc.getPropertyBySemantic=function(e,t,n){let i=n.propertiesBySemantic;if(!l(i))return;let r=i[e];if(l(r))return hc.getProperty(r.id,t,n)};hc.setPropertyBySemantic=function(e,t,n,i){let r=i.propertiesBySemantic;if(!l(r))return!1;let o=i.propertiesBySemantic[e];return l(o)?hc.setProperty(o.id,t,n,i):!1};var Yn=hc;var hbe={};function tF(e){this._count=e.count,this._properties=Je(e.properties,!0)}tF.prototype.hasProperty=function(e){return Yn.hasProperty(e,this._properties,hbe)};tF.prototype.getPropertyIds=function(e){return Yn.getPropertyIds(this._properties,hbe,e)};tF.prototype.getProperty=function(e,t){let n=this._properties[t];if(l(n))return Je(n[e],!0)};tF.prototype.setProperty=function(e,t,n){let i=this._properties[t];l(i)||(i=new Array(this._count),this._properties[t]=i),i[e]=Je(n,!0)};var Yg=tF;function Lc(e){e=e??H.EMPTY_OBJECT,this._name=e.name,this._id=e.id,this._count=e.count,this._extras=e.extras,this._extensions=e.extensions,this._metadataTable=e.metadataTable,this._jsonMetadataTable=e.jsonMetadataTable,this._batchTableHierarchy=e.batchTableHierarchy,this._texture=e.texture}Object.defineProperties(Lc.prototype,{name:{get:function(){return this._name}},id:{get:function(){return this._id}},count:{get:function(){return this._count}},class:{get:function(){if(l(this._metadataTable))return this._metadataTable.class}},properties:{get:function(){if(l(this._metadataTable))return this._metadataTable.properties}},extras:{get:function(){return this._extras}},extensions:{get:function(){return this._extensions}},byteLength:{get:function(){let e=0;return l(this._metadataTable)&&(e+=this._metadataTable.byteLength),l(this._batchTableHierarchy)&&(e+=this._batchTableHierarchy.byteLength),e}},texture:{get:function(){return this._texture}}});Lc.prototype.hasProperty=function(e,t){return!!(l(this._metadataTable)&&this._metadataTable.hasProperty(t)||l(this._batchTableHierarchy)&&this._batchTableHierarchy.hasProperty(e,t)||l(this._jsonMetadataTable)&&this._jsonMetadataTable.hasProperty(t))};Lc.prototype.hasPropertyBySemantic=function(e,t){return l(this._metadataTable)?this._metadataTable.hasPropertyBySemantic(t):!1};Lc.prototype.propertyExists=function(e){return!!(l(this._metadataTable)&&this._metadataTable.hasProperty(e)||l(this._batchTableHierarchy)&&this._batchTableHierarchy.propertyExists(e)||l(this._jsonMetadataTable)&&this._jsonMetadataTable.hasProperty(e))};Lc.prototype.propertyExistsBySemantic=function(e){return l(this._metadataTable)?this._metadataTable.hasPropertyBySemantic(e):!1};var cJ=[];Lc.prototype.getPropertyIds=function(e,t){if(t=l(t)?t:[],t.length=0,l(this._metadataTable)){let n=this._metadataTable.getPropertyIds(cJ);Zn(t,n)}if(l(this._batchTableHierarchy)){let n=this._batchTableHierarchy.getPropertyIds(e,cJ);Zn(t,n)}if(l(this._jsonMetadataTable)){let n=this._jsonMetadataTable.getPropertyIds(cJ);Zn(t,n)}return t};Lc.prototype.getProperty=function(e,t){let n;if(l(this._metadataTable)&&(n=this._metadataTable.getProperty(e,t),l(n))||l(this._batchTableHierarchy)&&(n=this._batchTableHierarchy.getProperty(e,t),l(n))||l(this._jsonMetadataTable)&&(n=this._jsonMetadataTable.getProperty(e,t),l(n)))return n};Lc.prototype.setProperty=function(e,t,n){l(this._metadataTable)&&this._metadataTable.setProperty(e,t,n)||l(this._batchTableHierarchy)&&this._batchTableHierarchy.setProperty(e,t,n)||(l(this._jsonMetadataTable)||(this._jsonMetadataTable=new Yg({count:this._count,properties:{}})),this._jsonMetadataTable.setProperty(e,t,n))};Lc.prototype.getPropertyBySemantic=function(e,t){if(l(this._metadataTable))return this._metadataTable.getPropertyBySemantic(e,t)};Lc.prototype.setPropertyBySemantic=function(e,t,n){return l(this._metadataTable)?this._metadataTable.setPropertyBySemantic(e,t,n):!1};Lc.prototype.getPropertyTypedArray=function(e){if(l(this._metadataTable))return this._metadataTable.getPropertyTypedArray(e)};Lc.prototype.getPropertyTypedArrayBySemantic=function(e){if(l(this._metadataTable))return this._metadataTable.getPropertyTypedArrayBySemantic(e)};Lc.prototype.isClass=function(e,t){let n=this._batchTableHierarchy;return l(n)?n.isClass(e,t):!1};Lc.prototype.isExactClass=function(e,t){return this.getExactClassName(e)===t};Lc.prototype.getExactClassName=function(e){let t=this._batchTableHierarchy;if(l(t))return t.getClassName(e)};Lc.prototype.destroy=function(){return this._texture=this._texture&&this._texture.destroy(),le(this)};var ru=Lc;var mbe={OPAQUE:"OPAQUE",MASK:"MASK",BLEND:"BLEND"};Object.freeze(mbe);var $p=mbe;var Pr={},lJ=class{constructor(){this.octEncoded=!1,this.octEncodedZXY=!1,this.normalizationRange=void 0,this.quantizedVolumeOffset=void 0,this.quantizedVolumeDimensions=void 0,this.quantizedVolumeStepSize=void 0,this.componentDatatype=void 0,this.type=void 0}},uJ=class{constructor(){this.name=void 0,this.semantic=void 0,this.setIndex=void 0,this.componentDatatype=void 0,this.type=void 0,this.normalized=!1,this.count=void 0,this.min=void 0,this.max=void 0,this.constant=void 0,this.quantization=void 0,this.typedArray=void 0,this.buffer=void 0,this.byteOffset=0,this.byteStride=void 0}},fJ=class{constructor(){this.indexDatatype=void 0,this.count=void 0,this.buffer=void 0,this.typedArray=void 0}},dJ=class{constructor(){this.featureCount=void 0,this.nullFeatureId=void 0,this.propertyTableId=void 0,this.setIndex=void 0,this.label=void 0,this.positionalLabel=void 0}},hJ=class{constructor(){this.featureCount=void 0,this.nullFeatureId=void 0,this.propertyTableId=void 0,this.offset=0,this.repeat=void 0,this.label=void 0,this.positionalLabel=void 0}},mJ=class{constructor(){this.featureCount=void 0,this.nullFeatureId=void 0,this.propertyTableId=void 0,this.textureReader=void 0,this.label=void 0,this.positionalLabel=void 0}},pJ=class{constructor(){this.attributes=[]}},gJ=class{constructor(){this.attributes=[],this.morphTargets=[],this.indices=void 0,this.material=void 0,this.primitiveType=void 0,this.polygon=void 0,this.vector=void 0,this.featureIds=[],this.propertyTextureIds=[],this.propertyAttributeIds=[],this.outlineCoordinates=void 0,this.modelPrimitiveImagery=void 0,this.edgeVisibility=void 0}},_J=class{constructor(){this.attributes=[],this.featureIds=[],this.transformInWorldSpace=!1}},yJ=class{constructor(){this.index=void 0,this.joints=[],this.inverseBindMatrices=[]}},AJ=class{constructor(){this.name=void 0,this.index=void 0,this.children=[],this.primitives=[],this.instances=void 0,this.skin=void 0,this.matrix=void 0,this.translation=void 0,this.rotation=void 0,this.scale=void 0,this.morphWeights=[],this.articulationName=void 0,this.meshVector=void 0}},bJ=class{constructor(){this.nodes=[]}},DQe={TRANSLATION:"translation",ROTATION:"rotation",SCALE:"scale",WEIGHTS:"weights"},xJ=class{constructor(){this.input=[],this.interpolation=void 0,this.output=[]}},TJ=class{constructor(){this.node=void 0,this.path=void 0}},EJ=class{constructor(){this.sampler=void 0,this.target=void 0}},CJ=class{constructor(){this.name=void 0,this.samplers=[],this.channels=[]}},vJ=class{constructor(){this.name=void 0,this.type=void 0,this.minimumValue=void 0,this.maximumValue=void 0,this.initialValue=void 0}},SJ=class{constructor(){this.name=void 0,this.stages=[]}},CH=class{constructor(){this.credits=[]}},wJ=class{constructor(){this.asset=new CH,this.scene=void 0,this.nodes=[],this.skins=[],this.animations=[],this.articulations=[],this.structuralMetadata=void 0,this.upAxis=void 0,this.forwardAxis=void 0,this.transform=N.clone(N.IDENTITY),this.extensions={}}},IJ=class{constructor(){this.texture=void 0,this.index=void 0,this.texCoord=0,this.transform=$.clone($.IDENTITY),this.scale=1,this.channels=void 0,this.constantLod=void 0}},dA=class dA{constructor(){this.baseColorTexture=void 0,this.metallicRoughnessTexture=void 0,this.baseColorFactor=se.clone(dA.DEFAULT_BASE_COLOR_FACTOR),this.metallicFactor=dA.DEFAULT_METALLIC_FACTOR,this.roughnessFactor=dA.DEFAULT_ROUGHNESS_FACTOR}};ut(dA,"DEFAULT_BASE_COLOR_FACTOR",se.ONE),ut(dA,"DEFAULT_METALLIC_FACTOR",1),ut(dA,"DEFAULT_ROUGHNESS_FACTOR",1);var vH=dA,hA=class hA{constructor(){this.diffuseTexture=void 0,this.specularGlossinessTexture=void 0,this.diffuseFactor=se.clone(hA.DEFAULT_DIFFUSE_FACTOR),this.specularFactor=h.clone(hA.DEFAULT_SPECULAR_FACTOR),this.glossinessFactor=hA.DEFAULT_GLOSSINESS_FACTOR}};ut(hA,"DEFAULT_DIFFUSE_FACTOR",se.ONE),ut(hA,"DEFAULT_SPECULAR_FACTOR",h.ONE),ut(hA,"DEFAULT_GLOSSINESS_FACTOR",1);var PJ=hA,kS=class kS{constructor(){this.specularFactor=kS.DEFAULT_SPECULAR_FACTOR,this.specularTexture=void 0,this.specularColorFactor=h.clone(kS.DEFAULT_SPECULAR_COLOR_FACTOR),this.specularColorTexture=void 0}};ut(kS,"DEFAULT_SPECULAR_FACTOR",1),ut(kS,"DEFAULT_SPECULAR_COLOR_FACTOR",h.ONE);var DJ=kS,US=class US{constructor(){this.anisotropyStrength=US.DEFAULT_ANISOTROPY_STRENGTH,this.anisotropyRotation=US.DEFAULT_ANISOTROPY_ROTATION,this.anisotropyTexture=void 0}};ut(US,"DEFAULT_ANISOTROPY_STRENGTH",0),ut(US,"DEFAULT_ANISOTROPY_ROTATION",0);var RJ=US,zS=class zS{constructor(){this.clearcoatFactor=zS.DEFAULT_CLEARCOAT_FACTOR,this.clearcoatTexture=void 0,this.clearcoatRoughnessFactor=zS.DEFAULT_CLEARCOAT_ROUGHNESS_FACTOR,this.clearcoatRoughnessTexture=void 0,this.clearcoatNormalTexture=void 0}};ut(zS,"DEFAULT_CLEARCOAT_FACTOR",0),ut(zS,"DEFAULT_CLEARCOAT_ROUGHNESS_FACTOR",0);var OJ=zS,MJ=class{constructor(){ut(this,"width");ut(this,"pattern")}},SH=class SH{constructor(t={}){let{wireframeFill:n=SH.DEFAULT_WIREFRAME_FILL,backgroundFill:i=!1,behind:r=!1}=t;this.wireframeFill=n,this.backgroundFill=i,this.behind=r}};ut(SH,"DEFAULT_WIREFRAME_FILL",0);var NJ=SH,wH=class wH{constructor(){this.metallicRoughness=new vH,this.specularGlossiness=void 0,this.specular=void 0,this.anisotropy=void 0,this.clearcoat=void 0,this.emissiveTexture=void 0,this.normalTexture=void 0,this.occlusionTexture=void 0,this.emissiveFactor=h.clone(wH.DEFAULT_EMISSIVE_FACTOR),this.alphaMode=$p.OPAQUE,this.alphaCutoff=.5,this.doubleSided=!1,this.unlit=!1,this.pointDiameter=void 0,this.planarFill=void 0,this.lineStyle=void 0}};ut(wH,"DEFAULT_EMISSIVE_FACTOR",h.ZERO);var LJ=wH,FJ=class{constructor(){ut(this,"count",0);ut(this,"triangleIndices");ut(this,"triangleIndicesOffsets");ut(this,"loopIndices");ut(this,"loopIndicesOffsets")}},BJ=class{constructor(){ut(this,"vector",!0);ut(this,"count",0);ut(this,"polygonAttributeOffsets");ut(this,"polygonHoleCounts");ut(this,"polygonHoleOffsets");ut(this,"polygonIndicesOffsets")}};Pr.Quantization=lJ;Pr.Attribute=uJ;Pr.Indices=fJ;Pr.FeatureIdAttribute=dJ;Pr.FeatureIdTexture=mJ;Pr.FeatureIdImplicitRange=hJ;Pr.MorphTarget=pJ;Pr.Primitive=gJ;Pr.Instances=_J;Pr.Skin=yJ;Pr.Node=AJ;Pr.Scene=bJ;Pr.AnimatedPropertyType=Object.freeze(DQe);Pr.AnimationSampler=xJ;Pr.AnimationTarget=TJ;Pr.AnimationChannel=EJ;Pr.Animation=CJ;Pr.ArticulationStage=vJ;Pr.Articulation=SJ;Pr.Asset=CH;Pr.Components=wJ;Pr.TextureReader=IJ;Pr.MetallicRoughness=vH;Pr.SpecularGlossiness=PJ;Pr.Specular=DJ;Pr.Anisotropy=RJ;Pr.Clearcoat=OJ;Pr.PlanarFill=NJ;Pr.LineStyle=MJ;Pr.Material=LJ;Pr.Vector=BJ;Pr.Polygon=FJ;var Cn=Pr;var IH={};IH.getImageIdFromTexture=function(e){e=e??H.EMPTY_OBJECT;let{gltf:t,textureId:n,supportedImageFormats:i}=e,r=t.textures[n],o=r.extensions;if(l(o)){if(i.webp&&l(o.EXT_texture_webp))return o.EXT_texture_webp.source;if(i.basis&&l(o.KHR_texture_basisu))return o.KHR_texture_basisu.source}return r.source};IH.createSampler=function(e){e=e??H.EMPTY_OBJECT;let{gltf:t,textureInfo:n,compressedTextureNoMipmap:i=!1}=e,r=hn.REPEAT,o=hn.REPEAT,s=Wt.LINEAR,a=Jn.LINEAR,c=n.index,f=t.textures[c].sampler;if(l(f)){let d=t.samplers[f];r=d.wrapS??r,o=d.wrapT??o,s=d.minFilter??s,a=d.magFilter??a}return i&&s!==Wt.LINEAR&&s!==Wt.NEAREST&&(s===Wt.NEAREST_MIPMAP_NEAREST||s===Wt.NEAREST_MIPMAP_LINEAR?s=Wt.NEAREST:s=Wt.LINEAR),hn.validate(r)||(r=hn.REPEAT),hn.validate(o)||(o=hn.REPEAT),Wt.validate(s)||(s=Wt.LINEAR),Jn.validate(a)||(a=Jn.LINEAR),new jt({wrapS:r,wrapT:o,minificationFilter:s,magnificationFilter:a})};var RQe=new U(1,1);IH.createModelTextureReader=function(e){e=e??H.EMPTY_OBJECT;let{textureInfo:t,channels:n,texture:i}=e,r=t.texCoord??0,o,s=t.extensions?.KHR_texture_transform;if(l(s)){r=s.texCoord??r;let u=l(s.offset)?U.unpack(s.offset):U.ZERO,f=s.rotation??0,d=l(s.scale)?U.unpack(s.scale):RQe;f=-f,o=new $(Math.cos(f)*d.x,-Math.sin(f)*d.y,u.x,Math.sin(f)*d.x,Math.cos(f)*d.y,u.y,0,0,1)}let a=new Cn.TextureReader;a.index=t.index,a.texture=i,a.texCoord=r,a.scale=t.scale,a.transform=o,a.channels=n;let c=t.extensions?.EXT_textureInfo_constant_lod;return l(c)&&(a.constantLod={repetitions:c.repetitions??1,offset:l(c.offset)?U.unpack(c.offset):U.ZERO,minClampDistance:c.minClampDistance??1,maxClampDistance:c.maxClampDistance??4294967296}),a};var Hu=IH;function pbe(e){e=e??H.EMPTY_OBJECT;let t=e.property,n=e.classProperty,i=e.textures,r=l(t.channels)?t.channels:[0],o=t,s=Hu.createModelTextureReader({textureInfo:o,channels:OQe(r),texture:i[o.index]});this._min=t.min,this._max=t.max;let a=t.offset,c=t.scale,u=n.hasValueTransform||l(a)||l(c);a=a??n.offset,c=c??n.scale,a=n.unpackVectorAndMatrixTypes(a),c=n.unpackVectorAndMatrixTypes(c),this._offset=a,this._scale=c,this._hasValueTransform=u,this._textureReader=s,this._classProperty=n,this._extras=t.extras,this._extensions=t.extensions}Object.defineProperties(pbe.prototype,{textureReader:{get:function(){return this._textureReader}},hasValueTransform:{get:function(){return this._hasValueTransform}},offset:{get:function(){return this._offset}},scale:{get:function(){return this._scale}},classProperty:{get:function(){return this._classProperty}},extras:{get:function(){return this._extras}},extensions:{get:function(){return this._extensions}}});function OQe(e){return e.map(function(t){return"rgba".charAt(t)}).join("")}var nF=pbe;function kJ(e){e=e??H.EMPTY_OBJECT;let t=e.propertyTexture,n=e.class,i=e.textures,r=t.extensions,o=t.extras,s={};if(l(t.properties))for(let a in t.properties)t.properties.hasOwnProperty(a)&&(s[a]=new nF({property:t.properties[a],classProperty:n.properties[a],textures:i}));this._name=e.name,this._id=e.id,this._class=n,this._properties=s,this._extras=o,this._extensions=r}Object.defineProperties(kJ.prototype,{name:{get:function(){return this._name}},id:{get:function(){return this._id}},class:{get:function(){return this._class}},properties:{get:function(){return this._properties}},extras:{get:function(){return this._extras}},extensions:{get:function(){return this._extensions}}});kJ.prototype.getProperty=function(e){return this._properties[e]};var Xg=kJ;function gbe(e){e=e??H.EMPTY_OBJECT;let t=e.property,n=e.classProperty;this._attribute=t.attribute,this._classProperty=n,this._min=t.min,this._max=t.max;let i=t.offset,r=t.scale,o=n.hasValueTransform||l(i)||l(r);i=i??n.offset,r=r??n.scale,i=n.unpackVectorAndMatrixTypes(i),r=n.unpackVectorAndMatrixTypes(r),this._offset=i,this._scale=r,this._hasValueTransform=o,this._extras=t.extras,this._extensions=t.extensions}Object.defineProperties(gbe.prototype,{attribute:{get:function(){return this._attribute}},hasValueTransform:{get:function(){return this._hasValueTransform}},offset:{get:function(){return this._offset}},scale:{get:function(){return this._scale}},classProperty:{get:function(){return this._classProperty}},extras:{get:function(){return this._extras}},extensions:{get:function(){return this._extensions}}});var iF=gbe;function UJ(e){e=e??H.EMPTY_OBJECT;let t=e.propertyAttribute,n=e.class,i={};if(l(t.properties))for(let r in t.properties)t.properties.hasOwnProperty(r)&&(i[r]=new iF({property:t.properties[r],classProperty:n.properties[r]}));this._name=e.name,this._id=e.id,this._class=n,this._properties=i,this._extras=t.extras,this._extensions=t.extensions}Object.defineProperties(UJ.prototype,{name:{get:function(){return this._name}},id:{get:function(){return this._id}},class:{get:function(){return this._class}},properties:{get:function(){return this._properties}},extras:{get:function(){return this._extras}},extensions:{get:function(){return this._extensions}}});UJ.prototype.getProperty=function(e){return this._properties[e]};var TT=UJ;function VS(e){e=e??H.EMPTY_OBJECT,this._schema=e.schema;let t=e.propertyTables;this._propertyTableCount=l(t)?t.length:0,this._propertyTables=t??[],this._propertyTextures=e.propertyTextures??[],this._propertyAttributes=e.propertyAttributes??[],this._statistics=e.statistics,this._extras=e.extras,this._extensions=e.extensions}Object.defineProperties(VS.prototype,{schema:{get:function(){return this._schema}},statistics:{get:function(){return this._statistics}},extras:{get:function(){return this._extras}},extensions:{get:function(){return this._extensions}},propertyTableCount:{get:function(){return this._propertyTableCount}},propertyTables:{get:function(){return this._propertyTables}},propertyTextures:{get:function(){return this._propertyTextures}},propertyAttributes:{get:function(){return this._propertyAttributes}},propertyTablesByteLength:{get:function(){if(!l(this._propertyTables))return 0;let e=0,t=this._propertyTables.length;for(let n=0;n<t;n++)e+=this._propertyTables[n].byteLength;return e}}});VS.prototype.getPropertyTable=function(e){return this._propertyTables[e]};VS.prototype.getPropertyTexture=function(e){return this._propertyTextures[e]};VS.prototype.getPropertyAttribute=function(e){return this._propertyAttributes[e]};VS.prototype.destroy=function(){let e=this._propertyTables;for(let t=0;t<e.length;t++)e[t]=e[t]&&e[t].destroy();return le(this)};var Ha=VS;function mA(e,t,n){return t=t??0,n=n??e.byteLength-t,e=e.subarray(t,t+n),mA.decode(e)}mA.decodeWithTextDecoder=function(e){return new TextDecoder("utf-8").decode(e)};mA.decodeWithFromCharCode=function(e){let t="",n=MQe(e),i=n.length;for(let r=0;r<i;++r){let o=n[r];o<=65535?t+=String.fromCharCode(o):(o-=65536,t+=String.fromCharCode((o>>10)+55296,(o&1023)+56320))}return t};function rF(e,t,n){return t<=e&&e<=n}function MQe(e){let t=0,n=0,i=0,r=128,o=191,s=[],a=e.length;for(let c=0;c<a;++c){let u=e[c];if(i===0){if(rF(u,0,127)){s.push(u);continue}if(rF(u,194,223)){i=1,t=u&31;continue}if(rF(u,224,239)){u===224&&(r=160),u===237&&(o=159),i=2,t=u&15;continue}if(rF(u,240,244)){u===240&&(r=144),u===244&&(o=143),i=3,t=u&7;continue}throw new oe("String decoding failed.")}if(!rF(u,r,o)){t=i=n=0,r=128,o=191,--c;continue}r=128,o=191,t=t<<6|u&63,++n,n===i&&(s.push(t),t=i=n=0)}return s}typeof TextDecoder<"u"?mA.decode=mA.decodeWithTextDecoder:mA.decode=mA.decodeWithFromCharCode;var Gu=mA;var fn={INT8:"INT8",UINT8:"UINT8",INT16:"INT16",UINT16:"UINT16",INT32:"INT32",UINT32:"UINT32",INT64:"INT64",UINT64:"UINT64",FLOAT32:"FLOAT32",FLOAT64:"FLOAT64"},fl={INTEGER:"int",UNSIGNED_INTEGER:"uint",FLOAT:"float"};fn.typeInfo={INT8:{vectorCompatible:!0,size:1,maximumValue:127,minimumValue:-128,category:fl.INTEGER},UINT8:{vectorCompatible:!0,size:1,maximumValue:255,minimumValue:0,category:fl.UNSIGNED_INTEGER},INT16:{vectorCompatible:!0,size:2,maximumValue:32767,minimumValue:-32768,category:fl.INTEGER},UINT16:{vectorCompatible:!0,size:2,maximumValue:65535,minimumValue:0,category:fl.UNSIGNED_INTEGER},INT32:{vectorCompatible:!0,size:4,maximumValue:2147483647,minimumValue:-2147483648,category:fl.INTEGER},UINT32:{vectorCompatible:!0,size:4,maximumValue:4294967295,minimumValue:0,category:fl.UNSIGNED_INTEGER},INT64:{vectorCompatible:!1,size:8,maximumValue:BigInt("9223372036854775807"),minimumValue:BigInt("-9223372036854775808"),category:fl.INTEGER,downcastFunction:e=>fn.clampToLimits(e,fn.INT32)},UINT64:{vectorCompatible:!1,size:8,maximumValue:BigInt("18446744073709551615"),minimumValue:BigInt(0),category:fl.UNSIGNED_INTEGER,downcastFunction:e=>fn.clampToLimits(e,fn.UINT32)},FLOAT32:{vectorCompatible:!0,size:4,maximumValue:34028234663852886e22,minimumValue:-34028234663852886e22,category:fl.FLOAT},FLOAT64:{vectorCompatible:!0,size:8,maximumValue:Number.MAX_VALUE,minimumValue:-Number.MAX_VALUE,category:fl.FLOAT,downcastFunction:e=>Math.fround(e)}};fn.getMinimum=function(e){return fn.typeInfo[e].minimumValue};fn.getMaximum=function(e){return fn.typeInfo[e].maximumValue};fn.isIntegerType=function(e){return fn.typeInfo[e].category!==fl.FLOAT};fn.isUnsignedIntegerType=function(e){return fn.typeInfo[e].category===fl.UNSIGNED_INTEGER};fn.isVectorCompatible=function(e){return fn.typeInfo[e].vectorCompatible};fn.category=function(e){return fn.typeInfo[e].category};fn.gpuComponentType=function(e){switch(e){case fn.INT64:return"INT32";case fn.UINT64:return"UINT32";case fn.FLOAT64:return"FLOAT32";default:return e}};fn.normalize=function(e,t){return Math.max(Number(e)/Number(fn.getMaximum(t)),-1)};fn.unnormalize=function(e,t){let n=fn.getMaximum(t),i=fn.isUnsignedIntegerType(t)?0:-n;return e=D.sign(e)*Math.round(Math.abs(e)*Number(n)),(t===fn.INT64||t===fn.UINT64)&&dn.supportsBigInt()&&(e=BigInt(e)),e>n?n:e<i?i:e};fn.applyValueTransform=function(e,t,n){return n*e+t};fn.unapplyValueTransform=function(e,t,n){return n===0?0:(e-t)/n};fn.getSizeInBytes=function(e){return fn.typeInfo[e].size};fn.clampToLimits=function(e,t){let n=fn.getMinimum(t),i=fn.getMaximum(t);if(typeof e=="bigint"){let r=BigInt(n),o=BigInt(i);return e<r?n:e>o?i:Number(e)}return Math.max(n,Math.min(i,e))};fn.downcastFunction=function(e){let n=fn.typeInfo[e].downcastFunction;return l(n)?n:i=>i};fn.fromComponentDatatype=function(e){switch(e){case Y.BYTE:return fn.INT8;case Y.UNSIGNED_BYTE:return fn.UINT8;case Y.SHORT:return fn.INT16;case Y.UNSIGNED_SHORT:return fn.UINT16;case Y.INT:return fn.INT32;case Y.UNSIGNED_INT:return fn.UINT32;case Y.FLOAT:return fn.FLOAT32;case Y.DOUBLE:return fn.FLOAT64}};fn.toComponentDatatype=function(e){switch(e){case fn.INT8:return Y.BYTE;case fn.UINT8:return Y.UNSIGNED_BYTE;case fn.INT16:return Y.SHORT;case fn.UINT16:return Y.UNSIGNED_SHORT;case fn.INT32:return Y.INT;case fn.UINT32:return Y.UNSIGNED_INT;case fn.FLOAT32:return Y.FLOAT;case fn.FLOAT64:return Y.DOUBLE}};fn.getDataViewAccessors=function(e,t){return{[fn.UINT8]:{get:e.getUint8.bind(e),set:e.setUint8.bind(e)},[fn.INT8]:{get:e.getInt8.bind(e),set:e.setInt8.bind(e)},[fn.UINT16]:{get:i=>e.getUint16(i,!0),set:(i,r)=>e.setUint16(i,r,!0)},[fn.INT16]:{get:i=>e.getInt16(i,!0),set:(i,r)=>e.setInt16(i,r,!0)},[fn.UINT32]:{get:i=>e.getUint32(i,!0),set:(i,r)=>e.setUint32(i,r,!0)},[fn.INT32]:{get:i=>e.getInt32(i,!0),set:(i,r)=>e.setInt32(i,r,!0)},[fn.FLOAT32]:{get:i=>e.getFloat32(i,!0),set:(i,r)=>e.setFloat32(i,r,!0)},[fn.FLOAT64]:{get:i=>e.getFloat64(i,!0),set:(i,r)=>e.setFloat64(i,r,!0)},[fn.UINT64]:{get:i=>e.getBigUint64(i,!0),set:(i,r)=>e.setBigUint64(i,BigInt(r),!0)},[fn.INT64]:{get:i=>e.getBigInt64(i,!0),set:(i,r)=>e.setBigInt64(i,BigInt(r),!0)}}[t]};Object.freeze(fn);var Lt=fn;var oo={SCALAR:"SCALAR",VEC2:"VEC2",VEC3:"VEC3",VEC4:"VEC4",MAT2:"MAT2",MAT3:"MAT3",MAT4:"MAT4",BOOLEAN:"BOOLEAN",STRING:"STRING",ENUM:"ENUM"};oo.isVectorType=function(e){switch(e){case oo.VEC2:case oo.VEC3:case oo.VEC4:return!0;default:return!1}};oo.isMatrixType=function(e){switch(e){case oo.MAT2:case oo.MAT3:case oo.MAT4:return!0;default:return!1}};oo.getComponentCount=function(e){switch(e){case oo.SCALAR:case oo.STRING:case oo.ENUM:case oo.BOOLEAN:return 1;case oo.VEC2:return 2;case oo.VEC3:return 3;case oo.VEC4:return 4;case oo.MAT2:return 4;case oo.MAT3:return 9;case oo.MAT4:return 16}};oo.getMathType=function(e){switch(e){case oo.VEC2:return U;case oo.VEC3:return h;case oo.VEC4:return se;case oo.MAT2:return Xi;case oo.MAT3:return $;case oo.MAT4:return N;default:return}};Object.freeze(oo);var bt=oo;function ls(e){e=e??H.EMPTY_OBJECT;let t=e.id,n=e.type,i=e.componentType,r=e.enumType,o=l(i)&&(e.normalized??!1)&&Lt.isIntegerType(i);this._id=t,this._name=e.name,this._description=e.description,this._semantic=e.semantic,this._isLegacyExtension=e.isLegacyExtension,this._type=n,this._componentType=i,this._enumType=r,this._valueType=l(r)?r.valueType:i,this._isArray=e.isArray??!1,this._isVariableLengthArray=e.isVariableLengthArray??!1,this._arrayLength=e.arrayLength,this._min=Je(e.min,!0),this._max=Je(e.max,!0),this._normalized=o;let s=Je(e.offset,!0),a=Je(e.scale,!0),c=l(s)||l(a),u=!0;l(s)||(s=this.expandConstant(0,u)),l(a)||(a=this.expandConstant(1,u)),this._offset=s,this._scale=a,this._hasValueTransform=c,this._noData=Je(e.noData,!0),this._default=Je(e.default,!0),this._required=e.required??!0,this._extras=Je(e.extras,!0),this._extensions=Je(e.extensions,!0)}ls.fromJson=function(e){e=e??H.EMPTY_OBJECT;let t=e.id,n=e.property,i=NQe(n),r=LQe(n,e.enums),o;return l(i)?i?o=l(n.optional)?!n.optional:!0:o=n.required??!1:o=!1,new ls({id:t,type:r.type,componentType:r.componentType,enumType:r.enumType,isArray:r.isArray,isVariableLengthArray:r.isVariableLengthArray,arrayLength:r.arrayLength,normalized:n.normalized,min:n.min,max:n.max,offset:n.offset,scale:n.scale,noData:n.noData,default:n.default,required:o,name:n.name,description:n.description,semantic:n.semantic,extras:n.extras,extensions:n.extensions,isLegacyExtension:i})};Object.defineProperties(ls.prototype,{id:{get:function(){return this._id}},name:{get:function(){return this._name}},description:{get:function(){return this._description}},type:{get:function(){return this._type}},enumType:{get:function(){return this._enumType}},componentType:{get:function(){return this._componentType}},valueType:{get:function(){return this._valueType}},isArray:{get:function(){return this._isArray}},isVariableLengthArray:{get:function(){return this._isVariableLengthArray}},arrayLength:{get:function(){return this._arrayLength}},normalized:{get:function(){return this._normalized}},max:{get:function(){return this._max}},min:{get:function(){return this._min}},noData:{get:function(){return this._noData}},default:{get:function(){return this._default}},required:{get:function(){return this._required}},semantic:{get:function(){return this._semantic}},hasValueTransform:{get:function(){return this._hasValueTransform}},offset:{get:function(){return this._offset}},scale:{get:function(){return this._scale}},extras:{get:function(){return this._extras}},extensions:{get:function(){return this._extensions}}});function NQe(e){if(e.type==="ARRAY")return!0;let t=e.type;if(t===bt.SCALAR||bt.isMatrixType(t)||bt.isVectorType(t))return!1;if(l(Lt[t]))return!0;if(l(e.noData)||l(e.scale)||l(e.offset)||l(e.required)||l(e.count)||l(e.array)||l(e.optional))return!1}function LQe(e,t){let n=e.type,i=e.componentType,r=n==="ARRAY",o,s,a;r?(o=!0,s=e.componentCount,a=!l(s)):e.array?(o=!0,s=e.count,a=!l(e.count)):(o=!1,s=void 0,a=!1);let c;if(l(e.enumType)&&(c=t[e.enumType]),n===bt.ENUM)return{type:n,componentType:void 0,enumType:c,valueType:c.valueType,isArray:o,isVariableLengthArray:a,arrayLength:s};if(r&&i===bt.ENUM)return{type:i,componentType:void 0,enumType:c,valueType:c.valueType,isArray:o,isVariableLengthArray:a,arrayLength:s};if(n===bt.SCALAR||bt.isMatrixType(n)||bt.isVectorType(n))return{type:n,componentType:i,enumType:void 0,valueType:i,isArray:o,isVariableLengthArray:a,arrayLength:s};if(n===bt.BOOLEAN||n===bt.STRING)return{type:n,componentType:void 0,enumType:void 0,valueType:void 0,isArray:o,isVariableLengthArray:a,arrayLength:s};if(r&&(i===bt.BOOLEAN||i===bt.STRING))return{type:i,componentType:void 0,enumType:void 0,valueType:void 0,isArray:o,isVariableLengthArray:a,arrayLength:s};if(l(i)&&l(Lt[i]))return{type:bt.SCALAR,componentType:i,enumType:void 0,valueType:i,isArray:o,isVariableLengthArray:a,arrayLength:s};if(l(Lt[n]))return{type:bt.SCALAR,componentType:n,enumType:void 0,valueType:n,isArray:o,isVariableLengthArray:a,arrayLength:s}}ls.prototype.normalize=function(e){return this._normalized?zJ(e,this._valueType,Lt.normalize):e};ls.prototype.unnormalize=function(e){return this._normalized?zJ(e,this._valueType,Lt.unnormalize):e};ls.prototype.applyValueTransform=function(e){return!this._hasValueTransform||this._isVariableLengthArray?e:ls.valueTransformInPlace(e,this._offset,this._scale,Lt.applyValueTransform)};ls.prototype.unapplyValueTransform=function(e){return!this._hasValueTransform||this._isVariableLengthArray?e:ls.valueTransformInPlace(e,this._offset,this._scale,Lt.unapplyValueTransform)};ls.prototype.expandConstant=function(e,t){t=t??!1;let n=this._isArray,i=this._arrayLength,r=bt.getComponentCount(this._type),o=n&&r>1;if(!n&&r===1)return e;if(!n)return new Array(r).fill(e);if(!o)return new Array(i).fill(e);if(!t)return new Array(this._arrayLength*r).fill(e);let s=new Array(r).fill(e);return new Array(this._arrayLength).fill(s)};ls.prototype.handleNoData=function(e){let t=this._noData;if(!l(t))return e;if(!bbe(e,t))return e};function oF(e){return Array.isArray(e)&&!(e instanceof Xi)&&!(e instanceof $)&&!(e instanceof N)}function bbe(e,t){if(!oF(e))return e===t;if(!oF(t)||e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(!bbe(e[n],t[n]))return!1;return!0}ls.prototype.unpackVectorAndMatrixTypes=function(e,t){t=t??!1;let n=bt.getMathType(this._type),i=this._isArray,r=bt.getComponentCount(this._type),o=i&&r>1;return l(n)?t&&o?e.map(function(s){return n.unpack(s)}):i?n.unpackArray(e):n.unpack(e):e};ls.prototype.packVectorAndMatrixTypes=function(e,t){t=t??!1;let n=bt.getMathType(this._type),i=this._isArray,r=bt.getComponentCount(this._type),o=i&&r>1;return l(n)?t&&o?e.map(function(s){return n.pack(s,[])}):i?n.packArray(e,[]):n.pack(e,[]):e};ls.prototype.validate=function(e){if(!(!l(e)&&l(this._default)))return this._required&&!l(e)?"required property must have a value":this._isArray?FQe(this,e):xbe(this,e)};function FQe(e,t){if(!oF(t))return`value ${t} must be an array`;let n=t.length;if(!e._isVariableLengthArray&&n!==e._arrayLength)return"Array length does not match property.arrayLength";for(let i=0;i<n;i++){let r=xbe(e,t[i]);if(l(r))return r}}function xbe(e,t){let n=e._type,i=e._componentType,r=e._enumType,o=e._normalized;return bt.isVectorType(n)?BQe(t,n,i):bt.isMatrixType(n)?kQe(t,n,i):n===bt.STRING?UQe(t):n===bt.BOOLEAN?zQe(t):n===bt.ENUM?VQe(t,r):jQe(t,i,o)}function BQe(e,t,n){if(!Lt.isVectorCompatible(n))return`componentType ${n} is incompatible with vector type ${t}`;if(t===bt.VEC2&&!(e instanceof U))return`vector value ${e} must be a Cartesian2`;if(t===bt.VEC3&&!(e instanceof h))return`vector value ${e} must be a Cartesian3`;if(t===bt.VEC4&&!(e instanceof se))return`vector value ${e} must be a Cartesian4`}function kQe(e,t,n){if(!Lt.isVectorCompatible(n))return`componentType ${n} is incompatible with matrix type ${t}`;if(t===bt.MAT2&&!(e instanceof Xi))return`matrix value ${e} must be a Matrix2`;if(t===bt.MAT3&&!(e instanceof $))return`matrix value ${e} must be a Matrix3`;if(t===bt.MAT4&&!(e instanceof N))return`matrix value ${e} must be a Matrix4`}function UQe(e){if(typeof e!="string")return PH(e,bt.STRING)}function zQe(e){if(typeof e!="boolean")return PH(e,bt.BOOLEAN)}function VQe(e,t){let n=typeof e;if(l(t))return n!=="string"||!l(t.valuesByName[e])?`value ${e} is not a valid enum name for ${t.id}`:void 0}function jQe(e,t,n){let i=typeof e;switch(t){case Lt.INT8:case Lt.UINT8:case Lt.INT16:case Lt.UINT16:case Lt.INT32:case Lt.UINT32:case Lt.FLOAT32:case Lt.FLOAT64:return i!=="number"?PH(e,t):isFinite(e)?ybe(e,t,n):Abe(e,t);case Lt.INT64:case Lt.UINT64:return i!=="number"&&i!=="bigint"?PH(e,t):i==="number"&&!isFinite(e)?Abe(e,t):ybe(e,t,n)}}function PH(e,t){return`value ${e} does not match type ${t}`}function _be(e,t,n){let i=`value ${e} is out of range for type ${t}`;return n&&(i+=" (normalized)"),i}function ybe(e,t,n){if(n){let i=Lt.isUnsignedIntegerType(t)?0:-1;return e<i||e>1?_be(e,t,n):void 0}if(e<Lt.getMinimum(t)||e>Lt.getMaximum(t))return _be(e,t,n)}function Abe(e,t){return`value ${e} of type ${t} must be finite`}function zJ(e,t,n){if(!oF(e))return n(e,t);for(let i=0;i<e.length;i++)e[i]=zJ(e[i],t,n);return e}ls.valueTransformInPlace=function(e,t,n,i){if(!oF(e))return i(e,t,n);for(let r=0;r<e.length;r++)e[r]=ls.valueTransformInPlace(e[r],t[r],n[r],i);return e};ls.prototype.cpuBytesPerElement=function(){return Tbe(this,this.valueType)};ls.prototype.gpuBytesPerElement=function(){let e=Lt.gpuComponentType(this.valueType);return Tbe(this,e)};function Tbe(e,t){let n=e.type,i=bt.getComponentCount(n),r=e.isArray?e.arrayLength:1,o=Lt.getSizeInBytes(t);return i*r*o}ls.prototype.isGpuCompatible=function(e){let t=this.type;return!(this.isVariableLengthArray||t===bt.STRING||t===bt.BOOLEAN||this.gpuBytesPerElement()>e)};var VJ=[void 0,"float","vec2","vec3","vec4"],Ebe=[void 0,"int","ivec2","ivec3","ivec4"],HQe=[void 0,"uint","uvec2","uvec3","uvec4"],GQe={[fl.FLOAT]:"uintBitsToFloat",[fl.INTEGER]:"int",[fl.UNSIGNED_INTEGER]:""};ls.prototype.getGlslTypeWebGL1=function(){let e=bt.getComponentCount(this.type);return this.isArray&&(e=this.arrayLength),this.normalized?VJ[e]:Ebe[e]};ls.prototype.getGlslType=function(){let e=this.valueType,t=bt.getComponentCount(this.type),n=this.isArray?this.arrayLength:1;return t*=n,!Lt.isIntegerType(e)||this.normalized?VJ[t]:Lt.isUnsignedIntegerType(e)?HQe[t]:Ebe[t]};ls.prototype.unpackTextureInShader=function(e,t,n,i){let r=this.getGlslType(),o=Lt.gpuComponentType(this.valueType),s=t.length,a=this.type,c=bt.getComponentCount(a)*(this.isArray?this.arrayLength:1),u=Math.floor(s/c),f=`${n}_rawChannels`,d=`${n}_rawBits`,p=`${n}_unpackedValue`,g=`${r} ${p};`,m=`uint ${d};`;i.push(g),i.push(m);let y=`${VJ[s]} ${f} = ${e};`;i.push(y);let A=GQe[Lt.category(o)],b=c>1;for(let x=0;x<c;x++){let T="rgba".slice(x*u,(x+1)*u),E=s>1?`.${T}`:"",v=`${d} = czm_unpackTexture(${f}${E});`,S="";b&&(S=`[${x}]`);let I="",R="";if(this.normalized){let L=Lt.getMaximum(o);I=` * ${1/Number(L)}`,R="float"}let O=`${p}${S} = ${R}(${A}(${d}))${I};`;i.push(v),i.push(O)}return p};ls.prototype.unpackTextureInShaderWebGL1=function(e){return this.normalized?e:`${this.getGlslTypeWebGL1()}(255.0 * ${e})`};var Jp=ls;function sF(e){e=e??H.EMPTY_OBJECT;let t=e.count,n=e.property,i=e.classProperty,r=e.bufferViews,o=i.type,s=i.isArray,a=i.isVariableLengthArray,c=i.valueType,u=i.enumType,f=o===bt.STRING,d=o===bt.BOOLEAN,p=0,g;if(a){let _=n.arrayOffsetType??n.offsetType;_=Lt[_]??Lt.UINT32;let C=n.arrayOffsets??n.arrayOffsetBufferView;g=new jJ(r[C],_,t+1),p+=g.typedArray.byteLength}let m=bt.getComponentCount(o),y;a?y=g.get(t)-g.get(0):s?y=t*i.arrayLength:y=t;let A=m*y,b;if(f){let _=n.stringOffsetType??n.offsetType;_=Lt[_]??Lt.UINT32;let C=n.stringOffsets??n.stringOffsetBufferView;b=new jJ(r[C],_,A+1),p+=b.typedArray.byteLength}(f||d)&&(c=Lt.UINT8);let x;f?x=b.get(A)-b.get(0):d?x=Math.ceil(A/8):x=A;let T=n.values??n.bufferView,E=new jJ(r[T],c,x);p+=E.typedArray.byteLength;let v=n.offset,S=n.scale,I=i.hasValueTransform||l(v)||l(S);v=v??i.offset,S=S??i.scale,v=Cbe(v),S=Cbe(S);let R,O,L=this;f?R=function(_){return YQe(_,L._values,L._stringOffsets)}:d?(R=function(_){return XQe(_,L._values)},O=function(_,C){KQe(_,L._values,C)}):l(u)?(R=function(_){let C=L._values.get(_);return u.namesByValue[C]},O=function(_,C){let w=u.valuesByName[C];L._values.set(_,w)}):(R=function(_){return L._values.get(_)},O=function(_,C){L._values.set(_,C)}),this._arrayOffsets=g,this._stringOffsets=b,this._values=E,this._classProperty=i,this._count=t,this._vectorComponentCount=m,this._min=n.min,this._max=n.max,this._offset=v,this._scale=S,this._hasValueTransform=I,this._getValue=R,this._setValue=O,this._unpackedValues=void 0,this._extras=n.extras,this._extensions=n.extensions,this._byteLength=p}Object.defineProperties(sF.prototype,{hasValueTransform:{get:function(){return this._hasValueTransform}},offset:{get:function(){return this._offset}},scale:{get:function(){return this._scale}},extras:{get:function(){return this._extras}},extensions:{get:function(){return this._extensions}},byteLength:{get:function(){return this._byteLength}},classProperty:{get:function(){return this._classProperty}}});sF.prototype.get=function(e){let t=WQe(this,e);return t=this._classProperty.handleNoData(t),l(t)?(t=this._classProperty.normalize(t),t=iet(this,t),this._classProperty.unpackVectorAndMatrixTypes(t)):(t=this._classProperty.default,this._classProperty.unpackVectorAndMatrixTypes(t))};sF.prototype.set=function(e,t){let n=this._classProperty;t=n.packVectorAndMatrixTypes(t),t=ret(this,t),t=n.unnormalize(t),qQe(this,e,t)};sF.prototype.getTypedArray=function(){if(l(this._values))return this._values.typedArray};function Cbe(e){if(!Array.isArray(e)||!l(e.slice))return e;let t=[];for(let n=0;n<e.length;n++){let i=e[n];Array.isArray(i)?Zn(t,i):t.push(i)}return t}function WQe(e,t){Sbe(e)&&wbe(e);let n=e._classProperty,i=n.isArray,r=n.type,o=bt.getComponentCount(r);if(l(e._unpackedValues)){let s=e._unpackedValues[t];return i?Je(s,!0):s}return!i&&o===1?e._getValue(t):vbe(e,n,t)}function vbe(e,t,n){let i,r;if(t.isVariableLengthArray){i=e._arrayOffsets.get(n),r=e._arrayOffsets.get(n+1)-i;let s=bt.getComponentCount(t.type);i*=s,r*=s}else{let a=(t.arrayLength??1)*e._vectorComponentCount;i=n*a,r=a}let o=new Array(r);for(let s=0;s<r;s++)o[s]=e._getValue(i+s);return o}function qQe(e,t,n){tet(e,t,n)&&wbe(e);let i=e._classProperty,r=i.isArray,o=i.type,s=bt.getComponentCount(o);if(l(e._unpackedValues)){i.isArray&&(n=Je(n,!0)),e._unpackedValues[t]=n;return}if(!r&&s===1){e._setValue(t,n);return}let a,c;if(i.isVariableLengthArray)a=e._arrayOffsets.get(t),c=e._arrayOffsets.get(t+1)-a;else{let f=(i.arrayLength??1)*e._vectorComponentCount;a=t*f,c=f}for(let u=0;u<c;++u)e._setValue(a+u,n[u])}function YQe(e,t,n){let i=n.get(e),r=n.get(e+1)-i;return Gu(t.typedArray,i,r)}function XQe(e,t){let n=e>>3,i=e%8;return(t.typedArray[n]>>i&1)===1}function KQe(e,t,n){let i=e>>3,r=e%8;n?t.typedArray[i]|=1<<r:t.typedArray[i]&=~(1<<r)}function $Qe(e,t){let n=t.dataView,i=e*8,r=0,o=(n.getUint8(i+7)&128)>0,s=!0;for(let a=0;a<8;++a){let c=n.getUint8(i+a);o&&(s?c!==0&&(c=~(c-1)&255,s=!1):c=~c&255),r+=c*Math.pow(256,a)}return o&&(r=-r),r}function JQe(e,t){let n=t.dataView,i=e*8,r=BigInt(0),o=(n.getUint8(i+7)&128)>0,s=!0;for(let a=0;a<8;++a){let c=n.getUint8(i+a);o&&(s?c!==0&&(c=~(c-1)&255,s=!1):c=~c&255),r+=BigInt(c)*(BigInt(1)<<BigInt(a*8))}return o&&(r=-r),r}function ZQe(e,t){let n=t.dataView,i=e*8,r=n.getUint32(i,!0),o=n.getUint32(i+4,!0);return r+4294967296*o}function QQe(e,t){let n=t.dataView,i=e*8,r=BigInt(n.getUint32(i,!0)),o=BigInt(n.getUint32(i+4,!0));return r+BigInt(4294967296)*o}function eet(e){switch(e){case Lt.INT8:return Y.BYTE;case Lt.UINT8:return Y.UNSIGNED_BYTE;case Lt.INT16:return Y.SHORT;case Lt.UINT16:return Y.UNSIGNED_SHORT;case Lt.INT32:return Y.INT;case Lt.UINT32:return Y.UNSIGNED_INT;case Lt.FLOAT32:return Y.FLOAT;case Lt.FLOAT64:return Y.DOUBLE}}function Sbe(e){if(l(e._unpackedValues))return!1;let t=e._classProperty,n=t.type,i=t.valueType;return n===bt.STRING||i===Lt.INT64&&!dn.supportsBigInt64Array()||i===Lt.UINT64&&!dn.supportsBigUint64Array()}function tet(e,t,n){if(Sbe(e))return!0;let i=e._arrayOffsets;if(l(i)){let r=i.get(t+1)-i.get(t),o=n.length;if(r!==o)return!0}return!1}function wbe(e){e._unpackedValues=net(e),e._arrayOffsets=void 0,e._stringOffsets=void 0,e._values=void 0}function net(e){let t=e._count,n=new Array(t),i=e._classProperty,r=i.isArray,o=i.type,s=bt.getComponentCount(o);if(!r&&s===1){for(let a=0;a<t;++a)n[a]=e._getValue(a);return n}for(let a=0;a<t;a++)n[a]=vbe(e,i,a);return n}function iet(e,t){let i=e._classProperty.isVariableLengthArray;return!e._hasValueTransform||i?t:Jp.valueTransformInPlace(t,e._offset,e._scale,Lt.applyValueTransform)}function ret(e,t){let i=e._classProperty.isVariableLengthArray;return!e._hasValueTransform||i?t:Jp.valueTransformInPlace(t,e._offset,e._scale,Lt.unapplyValueTransform)}function jJ(e,t,n){let i=this,r,o,s;if(t===Lt.INT64)dn.supportsBigInt()?dn.supportsBigInt64Array()?(r=new BigInt64Array(e.buffer,e.byteOffset,n),s=function(a,c){i.typedArray[a]=BigInt(c)}):(r=new Uint8Array(e.buffer,e.byteOffset,n*8),o=function(a){return JQe(a,i)}):(_t("INT64 type is not fully supported on this platform. Values greater than 2^53 - 1 or less than -(2^53 - 1) may lose precision when read."),r=new Uint8Array(e.buffer,e.byteOffset,n*8),o=function(a){return $Qe(a,i)});else if(t===Lt.UINT64)dn.supportsBigInt()?dn.supportsBigUint64Array()?(r=new BigUint64Array(e.buffer,e.byteOffset,n),s=function(a,c){i.typedArray[a]=BigInt(c)}):(r=new Uint8Array(e.buffer,e.byteOffset,n*8),o=function(a){return QQe(a,i)}):(_t("UINT64 type is not fully supported on this platform. Values greater than 2^53 - 1 may lose precision when read."),r=new Uint8Array(e.buffer,e.byteOffset,n*8),o=function(a){return ZQe(a,i)});else{let a=eet(t);r=Y.createArrayBufferView(a,e.buffer,e.byteOffset,n),s=function(c,u){i.typedArray[c]=u}}l(o)||(o=function(a){return i.typedArray[a]}),this.typedArray=r,this.dataView=new DataView(r.buffer,r.byteOffset),this.get=o,this.set=s,this._componentType=t}var aF=sF;function Am(e){e=e??H.EMPTY_OBJECT;let t=e.count,n=e.class,i=0,r={};if(l(e.properties)){for(let o in e.properties)if(e.properties.hasOwnProperty(o)){let s=new aF({count:t,property:e.properties[o],classProperty:n.properties[o],bufferViews:e.bufferViews});r[o]=s,i+=s.byteLength}}this._count=t,this._class=n,this._properties=r,this._byteLength=i}Object.defineProperties(Am.prototype,{count:{get:function(){return this._count}},class:{get:function(){return this._class}},byteLength:{get:function(){return this._byteLength}},properties:{get:function(){return this._properties}}});Am.prototype.hasProperty=function(e){return Yn.hasProperty(e,this._properties,this._class)};Am.prototype.hasPropertyBySemantic=function(e){return Yn.hasPropertyBySemantic(e,this._properties,this._class)};Am.prototype.getPropertyIds=function(e){return Yn.getPropertyIds(this._properties,this._class,e)};Am.prototype.getProperty=function(e,t){let n=this._properties[t],i;return l(n)?i=n.get(e):i=oet(this._class,t),i};Am.prototype.setProperty=function(e,t,n){let i=this._properties[t];return l(i)?(i.set(e,n),!0):!1};Am.prototype.getPropertyBySemantic=function(e,t){let n,i=this._class.propertiesBySemantic;if(l(i)&&(n=i[t]),l(n))return this.getProperty(e,n.id)};Am.prototype.setPropertyBySemantic=function(e,t,n){let i,r=this._class.propertiesBySemantic;return l(r)&&(i=r[t]),l(i)?this.setProperty(e,i.id,n):!1};Am.prototype.getPropertyTypedArray=function(e){let t=this._properties[e];if(l(t))return t.getTypedArray()};Am.prototype.getPropertyTypedArrayBySemantic=function(e){let t,n=this._class.propertiesBySemantic;if(l(n)&&(t=n[e]),l(t))return this.getPropertyTypedArray(t.id)};function oet(e,t){let n=e.properties;if(!l(n))return;let i=n[t];if(l(i)&&l(i.default)){let r=i.default;return i.isArray&&(r=Je(r,!0)),r=i.normalize(r),i.unpackVectorAndMatrixTypes(r)}}var $d=Am;function set(e){e=e??H.EMPTY_OBJECT;let t=e.extension,n=e.schema,i=[];if(l(t.propertyTables))for(let s=0;s<t.propertyTables.length;s++){let a=t.propertyTables[s],c=n.classes[a.class],u=aet(a,e.bufferViews,c,e.context),f=new $d({count:a.count,properties:a.properties,class:c,bufferViews:e.bufferViews});i.push(new ru({id:s,name:a.name,count:a.count,metadataTable:f,extras:a.extras,extensions:a.extensions,texture:u}))}let r=[];if(l(t.propertyTextures))for(let s=0;s<t.propertyTextures.length;s++){let a=t.propertyTextures[s];r.push(new Xg({id:s,name:a.name,propertyTexture:a,class:n.classes[a.class],textures:e.textures}))}let o=[];if(l(t.propertyAttributes))for(let s=0;s<t.propertyAttributes.length;s++){let a=t.propertyAttributes[s];o.push(new TT({id:s,name:a.name,class:n.classes[a.class],propertyAttribute:a}))}return new Ha({schema:n,propertyTables:i,propertyTextures:r,propertyAttributes:o,statistics:t.statistics,extras:t.extras,extensions:t.extensions})}var cF=4;function aet(e,t,n,i){let r=e.properties;if(!l(r))return;let o=e.count,s;try{s=cet(r,t,n,o)}catch(f){console.warn(`Failed to create texture for property table "${e.name}": ${f.message}`);return}let a=s.length;if(a===0)return;if(o>kt.maximumTextureSize||a>kt.maximumTextureSize){_t("PropertyTableTextureExceedsMaximumSize",`Cannot create a texture for the property table "${e.name}" because it exceeds the maximum texture size of ${kt.maximumTextureSize}.`);return}let c=fet(s,o),u=new jt({wrapS:hn.CLAMP_TO_EDGE,wrapT:hn.CLAMP_TO_EDGE,minificationFilter:Wt.NEAREST,magnificationFilter:Jn.NEAREST});return Dt.create({context:i,pixelFormat:Ke.RGBA,pixelDatatype:ze.UNSIGNED_BYTE,sampler:u,flipY:!1,source:{width:o,height:a,arrayBufferView:c}})}function cet(e,t,n,i){let r=[],o=n.properties;for(let[s,a]of Object.entries(o)){if(!a.isGpuCompatible(cF))continue;let c=e[s],u=l(c)?t[c.values]:uet(a,i),f=u.length,d=a.cpuBytesPerElement(),p=f/d;if(p!==i)throw new oe(`Property with ID: "${s}" has (${p}), which does not match number of features in the property table: (${i}).`);r.push({view:u,classProperty:a})}return r}function uet(e,t){let n=e.noData,i=bt.getComponentCount(e.type),r=e.isArray?e.arrayLength:1;e.type===bt.ENUM&&(n=e.enumType.valuesByName[n]),i===1&&(n=[n]),r===1&&(n=[n]);let o=e.cpuBytesPerElement(),s=Lt.getSizeInBytes(e.valueType),a=new ArrayBuffer(o*t),c=new DataView(a),u=Lt.getDataViewAccessors(c,e.valueType);for(let f=0;f<t;f++)for(let d=0;d<r;d++)for(let p=0;p<i;p++){let g=d*i+p;u.set(o*f+g*s,n[d][p])}return new Uint8Array(a)}function fet(e,t){let n=e.length,i=new Uint8Array(n*t*cF),r=new DataView(i.buffer,i.byteOffset,i.byteLength);for(let o=0;o<n;o++){let s=e[o],a=s.classProperty,c=o*t*cF,u=a.valueType,f=Lt.gpuComponentType(u);if(u!==f){het(s,r,c);continue}det(s,i,c)}return i}function det(e,t,n){let i=e.view,r=e.classProperty.cpuBytesPerElement(),o=i.length/r;for(let s=0;s<o;s++){let a=s*r,c=n+s*cF;t.set(i.subarray(a,a+r),c)}}function het(e,t,n){let i=e.classProperty,r=e.view,o=i.valueType,s=Lt.gpuComponentType(o),a=i.cpuBytesPerElement(),c=r.length/a,u=new DataView(r.buffer,r.byteOffset,r.byteLength),f=Lt.getDataViewAccessors(u,o),d=Lt.getDataViewAccessors(t,s),p=Lt.downcastFunction(o);for(let g=0;g<c;g++){let m=g*a,y=n+g*cF,A=f.get(m);d.set(y,p(A))}}var lF=set;function met(e){e=e??H.EMPTY_OBJECT;let t=e.extension,n=e.schema,i,r=[],o;if(l(t.featureTables))for(o=Object.keys(t.featureTables).sort(),i=0;i<o.length;i++){let a=o[i],c=t.featureTables[a],u=n.classes[c.class],f=new $d({count:c.count,properties:c.properties,class:u,bufferViews:e.bufferViews});r.push(new ru({id:a,count:c.count,metadataTable:f,extras:c.extras,extensions:c.extensions}))}let s=[];if(l(t.featureTextures))for(o=Object.keys(t.featureTextures).sort(),i=0;i<o.length;i++){let a=o[i],c=t.featureTextures[a];s.push(new Xg({id:a,propertyTexture:pet(c),class:n.classes[c.class],textures:e.textures}))}return new Ha({schema:n,propertyTables:r,propertyTextures:s,statistics:t.statistics,extras:t.extras,extensions:t.extensions})}function pet(e){let t={class:e.class,properties:{}},n=e.properties;for(let i in n)if(n.hasOwnProperty(i)){let r=n[i],o={channels:get(r.channels),extras:r.extras,extensions:r.extensions};t.properties[i]=Ot(r.texture,o,!0)}return t}function get(e){let t=e.length,n=new Array(t);for(let i=0;i<t;i++)n[i]="rgba".indexOf(e[i]);return n}var uF=met;var HJ=class{get cacheKey(){pe.throwInstantiationError()}load(){pe.throwInstantiationError()}unload(){}process(t){return!1}getError(t,n){l(n)&&l(n.message)&&(t+=` ${n.message}`);let i=new oe(t);return l(n)&&(i.stack=`Original stack: ${n.stack} Handler stack: -${i.stack}`),i}isDestroyed(){return!1}destroy(){return this.unload(),le(this)}},nr=e$;var X0e={UNLOADED:0,LOADING:1,LOADED:2,PROCESSING:3,READY:4,FAILED:5};Object.freeze(X0e);var Tt=X0e;var z6=class extends nr{constructor(t){super(),t=t??H.EMPTY_OBJECT;let n=t.typedArray,i=t.resource,r=t.cacheKey;this._typedArray=n,this._resource=i,this._cacheKey=r,this._state=Tt.UNLOADED,this._promise=void 0}get cacheKey(){return this._cacheKey}get typedArray(){return this._typedArray}async load(){return l(this._promise)?this._promise:l(this._typedArray)?(this._promise=Promise.resolve(this),this._promise):(this._promise=bXe(this),this._promise)}static _fetchArrayBuffer(t){return t.fetchArrayBuffer()}unload(){this._typedArray=void 0}};async function bXe(e){let t=e._resource;e._state=Tt.LOADING;try{let n=await z6._fetchArrayBuffer(t);return e.isDestroyed()?void 0:(e._typedArray=new Uint8Array(n),e._state=Tt.READY,e)}catch(n){if(e.isDestroyed())return;e._state=Tt.FAILED;let i=`Failed to load external buffer: ${t.url}`;throw e.getError(i,n)}}var iT=z6;function xXe(e){let t=e?.extensions;if(l(t))return t.KHR_meshopt_compression??t.EXT_meshopt_compression}var oA=xXe;var YSn=(function(){var e="b9H79Tebbbe9ok9Geueu9Geub9Gbb9Gruuuuuuueu9Gvuuuuueu9Gduueu9Gluuuueu9Gvuuuuub9Gouuuuuub9Gluuuub9GiuuueuiE8AdilveoveovrrwrrrDDoDrbqqbelve9Weiiviebeoweuecj:Gdkr:PlCo9TW9T9VV95dbH9F9F939H79T9F9J9H229F9Jt9VV7bb8F9TW79O9V9Wt9FW9U9J9V9KW9wWVtW949c919M9MWV9mW4W2be8A9TW79O9V9Wt9FW9U9J9V9KW9wWVtW949c919M9MWVbd8F9TW79O9V9Wt9FW9U9J9V9KW9wWVtW949c919M9MWV9c9V919U9KbiE9TW79O9V9Wt9FW9U9J9V9KW9wWVtW949wWV79P9V9UblY9TW79O9V9Wt9FW9U9J9V9KW69U9KW949c919M9MWVbv8E9TW79O9V9Wt9FW9U9J9V9KW69U9KW949c919M9MWV9c9V919U9Kbo8A9TW79O9V9Wt9FW9U9J9V9KW69U9KW949wWV79P9V9UbrE9TW79O9V9Wt9FW9U9J9V9KW69U9KW949tWG91W9U9JWbwa9TW79O9V9Wt9FW9U9J9V9KW69U9KW949tWG91W9U9JW9c9V919U9KbDL9TW79O9V9Wt9FW9U9J9V9KWS9P2tWV9p9JtbqK9TW79O9V9Wt9FW9U9J9V9KWS9P2tWV9r919HtbkL9TW79O9V9Wt9FW9U9J9V9KWS9P2tWVT949WbxY9TW79O9V9Wt9FW9U9J9V9KWS9P2tWVJ9V29VVbmE9TW79O9V9Wt9F9V9Wt9P9T9P96W9wWVtW94J9H9J9OWbza9TW79O9V9Wt9F9V9Wt9P9T9P96W9wWVtW94J9H9J9OW9ttV9P9WbHa9TW79O9V9Wt9F9V9Wt9P9T9P96W9wWVtW94SWt9J9O9sW9T9H9WbOK9TW79O9V9Wt9F79W9Ht9P9H29t9VVt9sW9T9H9WbAl79IV9RbXDwebcekdKYq:zf8Adbk;wadhud9:8Jjjjjbc;qw9Rgr8KjjjjbcbhwdnaeTmbabcbyd;i:I:cjbaoaocb9iEgDc:GeV86bbarc;adfcbcjdz:xjjjb8AdnaiTmbarc;adfadalz:wjjjb8Akarc;abfalfcbcbcjdal9RalcFe0Ez:xjjjb8Aarc;abfarc;adfalz:wjjjb8Aar9cb83iUar9cb83i8War9cb83iyar9cb83iaar9cb83iKar9cb83izar9cb83iwar9cb83ibcj;abal9Uc;WFbGcjdalca0Ehqdnaicd6mbavcd9imbaDTmbadcefhkaqci2gxal2hmarc;alfclfhParc;qlfceVhsarc;qofclVhzcbhHincdhOcbhAdnavci6mbar9cb83i;Ooar9cb83i;Goar9cb83i;yoar9cb83i;qoadaHfgoybbhCcbhXincbhwcbhQdninaoalfhLaoybbgKaC7aQVhQawcP0meaLhoaKhCawcefgwaXfai6mbkkcbhCarc;qofhwincwhYcwh8AdnaQaC93gocFeGgEcs0mbclh8AaEci0mbcdcbaEEh8Akdnaocw4cFeGgEcs0mbclhYaEci0mbcdcbaEEhYkaYa8AfhEawydbh3cwhYcwh8Adnaocz4cFeGg5cs0mbclh8Aa5ci0mbcdcba5Eh8AkaEa3fhEdnaocFFFFb0mbclhYaocFFF8F0mbcbcdaocjjjw6EhYkawaEa8AfaYfBdbawclfhwaCcefgCcw9hmbkaLhoaKhCaXczfgXai6mbkcbhocehwazhQinawaoaQydbarc;qofaocdtfydb6EhoaQclfhQawcefgwcw9hmbkaoclthAcihOkcbhEarc;qlfcbcjdz:xjjjb8AarcbBd;ilar9cb83i;aladh8Eaqh8Fakh3inarc;qlfadaEaEcb9h9Ral2falz:wjjjb8Aaia8Faia8F6EhadnaqaiaE9RaEaqfai6EgKcsfc9WGgoaK9nmbarc;qofaKfcbaoaK9Rz:xjjjb8AkadaEal2fhhcbhginagaAVcl4hXarc;alfagcdtfh8JaHh8Kcbh8Lina8LaHfhwdndndndndndndnagPlbedibkaKTmvahawfhoarc;qlfawfRbbhQarc;qofhwaahCinawaoRbbgYaQ9RgQcetaQcKtc8F91786bbawcefhwaoalfhoaYhQaEaCcufgC9hmbxvkkaKTmla8Kc9:Ghoa8LcitcwGh8Aarc;qlfawceVfRbbcwtarc;qlfawc9:GfRbbVhQarc;qofhwaahCinawa3aofRbbcwta8EaofRbbVgYaQ9RgQcetaQcztc8F917cFFiGa8A486bbaoalfhoawcefhwaYhQaEaCcufgC9hmbxlkkasa8Kc98GgQfhoa3aQfhYarc;qlfawc98GgQfRbbhCcwhwinaoRbbawtaCVhCaocefhoawcwfgwca9hmbxdkkaKTmdxekaKTmea8Lcith5ahaQfh8AcbhLina8ARbbhQcwhoaYhwinawRbbaotaQVhQawcefhwaocwfgoca9hmbkarc;qofaLfaQaC7aX93a5486bbaYalfhYa8Aalfh8AaQhCaLcefgLaK9hmbkka8Jydbh8AcbhLarc;qofhoincdhQcbhwinaQaoawfRbbcb9hfhQawcefgwcz9hmbkclhCcbhwinaCaoawfRbbcd0fhCawcefgwcz9hmbkcwhYcbhwinaYaoawfRbbcP0fhYawcefgwcz9hmbkaQaCaQaC6EgwaYawaY6Egwczawcz6Ea8Afh8AaoczfhoaLczfgLaK6mbka8Ja8ABdbka8Kcefh8Ka8Lcefg8Lcl9hmbkagcefggaO9hmbka8Eamfh8Ea8Faxfh8Fa3amfh3aEaxfgEai6mbkcbhocehwaPhQinawaoaQydbarc;alfaocdtfydb6EhoaQclfhQaOawcefgw9hmbkaraHcd4faAcdVaoaocdSE86bbaHclfgHal6mbkkabaefhgabcefhoalcd4g8McbaDEhkadcefh8Narc;abfceVhecbhmdndninaiam9nmearc;qofcbcjdz:xjjjb8Aagao9Rak6mdadamal2gwfhxcbhHa8Nawfhzaocbakz:xjjjbg8Fakfh3aqaiam9Ramaqfai6Egscsfgocl4cifcd4hOaoc9WGg8JThPindndndndndndndndndndnaDTmbaraHcd4fRbbgQciGPlbedlbkasTmdaxaHfhoarc;abfaHfRbbhQarc;qofhwashCinawaoRbbgYaQ9RgQcetaQcKtc8F91786bbawcefhwaoalfhoaYhQaCcufgCmbxikkasTmiaHcitcwGh8Aarc;abfaHceVfRbbcwtarc;abfaHc9:GgofRbbVhQaxaofhoarc;qofhwashCinawao8VbbgYaQ9RgQcetaQcztc8F917cFFiGa8A486bbawcefhwaoalfhoaYhQaCcufgCmbxikkaeaHc98Gg8Afhoaza8AfhYarc;abfa8AfRbbhCcwhwinaoRbbawtaCVhCaocefhoawcwfgwca9hmbkasTmdaQcl4hKaHcitcKGhEaxa8Afh8AcbhLina8ARbbhQcwhoaYhwinawRbbaotaQVhQawcefhwaocwfgoca9hmbkarc;qofaLfaQaC7aK93aE486bbaYalfhYa8Aalfh8AaQhCaLcefgLas9hmbkkaDmbcbhoxlka8JTmbcbhodninarc;qofaofgwcwf8Pibaw8Pib:e9qTmeaoczfgoa8J9pmdxbkkdnavmbcehoxikcbh8AaOhLaOhKinarc;qofa8Afgocwf8Pibhyao8Pibh8PcdhQcbhwinaQaoawfRbbcb9hfhQawcefgwcz9hmbkclhCcbhwinaCaoawfRbbcd0fhCawcefgwcz9hmbkcwhYcbhwinaYaoawfRbbcP0fhYawcefgwcz9hmbkaQaCaQaC6EgoaYaoaY6Egoczaocz6EaKfhKaocucbaya8P:e9cb9sEgwaoaw6EaLfhLa8Aczfg8Aa8J9pmdxbkka8FaHcd4fgoaoRbbcdaHcetcoGtV86bbxikdnaLas6mbaKas6mba8FaHcd4fgoaoRbbciaHcetcoGtV86bbaga39Ras6mra3arc;qofasz:wjjjbasfh3xikaLaK9phoka8FaHcd4fgwawRbbaoaHcetcoGtV86bbkaga39RaO6mla3cbaOz:xjjjbgaaOfhKdndna8JmbaPhoxekdnagaK9RcK9pmbaPhoxekaocdtc:q:G:cjbfcj:G:cjbaDEg3ydxghcetc;:FFFeGhAcuhEcuahtcu7cFeGh8Ecbh8Karc;qofhQinarc;qofa8KfhXczh8AdndndnahPDbeeeeeeedekcucbaXcwf8PibaX8Pib:e9cb9sEh8AxekcbhoaAh8Aina8Aa8EaQaofRbb9nfh8Aaocefgocz9hmbkkcih5cbhYinczhwdndndna3aYcdtfydbgLPDbeeeeeeedekcucbaXcwf8PibaX8Pib:e9cb9sEhwxekaLcetc;:FFFeGhwcuaLtcu7cFeGhCcbhoinawaCaQaofRbb9nfhwaocefgocz9hmbkkdndnawa8A6mbaLaE9hmeawa8A9hmea3a5cdtfydbcwSmekaYh5awh8AkaYcefgYci9hmbkaaa8Kco4fgoaoRbba5a8Kci4coGtV86bbdndndna3a5cdtfydbgEPDdbbbbbbbebkdncwaE9Tg5TmbcuaEtcu7hwdndnaEceSmbcbh8LaQhXinaXhoa5hYcbhCinaoRbbg8AawcFeGgLa8AaL6EaCaEtVhCaocefhoaYcufgYmbkaKaC86bbaXa5fhXaKcefhKa8La5fg8Lcz6mbxdkkcbh8LaQhXinaXhoa5hYcbhCinaoRbbg8AawcFeGgLa8AaL6EaCcetVhCaocefhoaYcufgYmbkaKaC:T9cFe:d9c:c:qj:bw9:9c:q;c1:I1e:d9c:b:c:e1z9:9ca188bbaXa5fhXaKcefhKa8La5fg8Lcz6mbkkcbhoinaKaQaofRbbgC86bbaKaCawcFeG9pfhKaocefgocz9hmbxikkdnaEceSmbinaKcb86bbaKcefhKxbkkinaKcb86bbaKcefhKxbkkaKaX8Pbw83bwaKaX8Pbb83bbaKczfhKka8Kczfg8Ka8J9pgomeaQczfhQagaK9RcK9pmbkkaoTmlaKh3aKTmlkaHcefgHal9hmbkarc;abfaxascufal2falz:wjjjb8Aasamfhma3hoa3mbkcbhwxdkdnagao9RakalfgwcKcaaDEgQawaQ0EgC9pmbcbhwxdkdnawaQ9pmbaocbaCaw9Rgwz:xjjjbawfhokaoarc;adfalz:wjjjbalfhodnaDTmbaoara8Mz:wjjjba8Mfhokaoab9Rhwxekcbhwkarc;qwf8Kjjjjbawk5babaeadaialcdcbyd;i:I:cjbz:bjjjbk9reduaecd4gdaefgicaaica0Eabcj;abae9Uc;WFbGcjdaeca0Egifcufai9Uae2aiadfaicl4cifcd4f2fcefkmbcbabBd;i:I:cjbk;HPeLu8Jjjjjbc;ae9Rgl8Kjjjjbcbhvdnaeaici9UgocHf6mbabcbyd;m:I:cjbgrc;GeV86bbalc;abfcFecjez:xjjjb8Aal9cu83iUal9cu83i8Wal9cu83iyal9cu83iaal9cu83iKal9cu83izal9cu83iwal9cu83ibabaefc9WfhwabcefgDaofhednaiTmbcmcsarcb9kgqEhkcbhxcbhmcbhPcbhscbhzindnaeaw9nmbcbhvxikazcufhvadaPcdtfgHydbhOaHcwfydbhAaHclfydbhCcbhXdndndninalc;abfavcsGcitfgoydlhQdndndnaoydbgoaO9hmbaQaCSmekdnaoaC9hmbaQaA9hmbaXcefhXxekaoaA9hmeaQaO9hmeaXcdfhXkaXc870mdascufhvaHaXcdtgAcxGgoyd:4:G:cjbcdtfydbhQaHaoyd:0:G:cjbcdtfydbhCaHaoyd:W:G:cjbcdtfydbhOcbhodnindnalavcsGcdtfydbaQ9hmbaohXxdkcuhXavcufhvaocefgocz9hmbkkaxaQaxSgvaXce9iaXak9oVgoGfhxdndndncbcsavEaXaoEgvcs9hmbarce9imbaQaQamaQcefamSgvEgmcefSmecmcsavEhvkaDavaAc;WeGV86bbavcs9hmeaQam9Rgvcetavc8F917hvinaecbcjeavcje6EavcFbGV86bbaecefheavcr4gvmbkaQhmxvkcPhvaDaAcPV86bbaQhmkavTmiavak9omicdhocehXazhAxlkavcufhvaXclfgXc;ab9hmbkkdnaHcecdcbaAaxSEaCaxSEcdtgvyd:W:G:cjbcdtfydbgOTaHavyd:0:G:cjbcdtfydbgCceSGaHavyd:4:G:cjbcdtfydbgQcdSGaxcb9hGaqGgLce9hmbal9cu83iUal9cu83i8Wal9cu83iyal9cu83iaal9cu83iKal9cu83izal9cu83iwal9cu83ibcbhxkcbhXascufgvhodnindnalaocsGcdtfydbaC9hmbaXhAxdkcuhAaocufhoaXcefgXcz9hmbkkcbhodnindnalavcsGcdtfydbaQ9hmbaohXxdkcuhXavcufhvaocefgocz9hmbkkaxaOaxSgKfhHdndnaAcm0mbaAcefhAxekcbcsaCaHSgvEhAaHavfhHkdndnaXcm0mbaXcefhXxekcbcsaQaHSgvEhXaHavfhHkc9:cuaKEhYcbhvaXaAcltVg8AcFeGhodndndninavc;q:G:cjbfRbbaoSmeavcefgvcz9hmbxdkkaLaOax9havcm0VVmbaDavc;WeV86bbxekaDaY86bbaea8A86bbaecefhekdnaKmbaOam9Rgvcetavc8F917hvinaecbcjeavcje6EavcFbGV86bbaecefheavcr4gvmbkaOhmkdnaAcs9hmbaCam9Rgvcetavc8F917hvinaecbcjeavcje6EavcFbGV86bbaecefheavcr4gvmbkaChmkdnaXcs9hmbaQam9Rgvcetavc8F917hvinaecbcjeavcje6EavcFbGV86bbaecefheavcr4gvmbkaQhmkalascdtfaOBdbascefcsGhvdndnaAPzbeeeeeeeeeeeeeebekalavcdtfaCBdbascdfcsGhvkdndnaXPzbeeeeeeeeeeeeeebekalavcdtfaQBdbavcefcsGhvkcihoalc;abfazcitfgXaOBdlaXaCBdbazcefcsGhAcdhXavhsaHhxxekcdhoalascdtfaQBdbcehXascefcsGhsazhAkalc;abfaAcitfgvaCBdlavaQBdbalc;abfazaXfcsGcitfgvaQBdlavaOBdbaDcefhDazaofcsGhzaPcifgPai6mbkkdnaeaw9nmbcbhvxekcbhvinaeavfavc;q:G:cjbfRbb86bbavcefgvcz9hmbkaeab9Ravfhvkalc;aef8KjjjjbavkZeeucbhddninadcefgdc8F0meaeceadt0mbkkadcrfcFeGcr9Uci2cdfabci9U2cHfkmbcbabBd;m:I:cjbk:zderu8Jjjjjbcz9Rhlcbhvdnaeaicvf6mbabcbRb;m:I:cjbc;qeV86bbal9cb83iwabcefhvabaefc98fhodnaiTmbcbhecbhrcbhwindnavao6mbcbskadawcdtfydbgDalcwfaraDae9Rgeaec8F91ge7ae9Rc507grcdtfgqydb9Rgec8E91c9:Gaecdt7arVheinavcbcjeaecje6EaecFbGV86bbavcefhvaecr4gembkaqaDBdbaDheawcefgwai9hmbkkdnavao9nmbcbskavcbBbbavab9RclfhvkavkBeeucbhddninadcefgdc8F0meaeceadt0mbkkabadcwfcFeGcr9U2cvfk:dvli99dui99ludnaeTmbcuadcetcuftcu7:Zhvdndncuaicuftcu7:ZgoJbbbZMgr:lJbbb9p9DTmbar:Ohwxekcjjjj94hwkcbhicbhDinalclfIdbgrJbbbbJbbjZalIdbgq:lar:lMalcwfIdbgk:lMgr:varJbbbb9BEgrNhxaqarNhralcxfIdbhqdndnakJbbbb9GTmbaxhkxekJbbjZar:l:tgkak:maxJbbbb9GEhkJbbjZax:l:tgxax:marJbbbb9GEhrkdndnaqJbbj:;aqJbbj:;9GEgxJbbjZaxJbbjZ9FEavNJbbbZJbbb:;aqJbbbb9GEMgq:lJbbb9p9DTmbaq:Ohmxekcjjjj94hmkdndnakJbbj:;akJbbj:;9GEgqJbbjZaqJbbjZ9FEaoNJbbbZJbbb:;akJbbbb9GEMgq:lJbbb9p9DTmbaq:OhPxekcjjjj94hPkdndnarJbbj:;arJbbj:;9GEgqJbbjZaqJbbjZ9FEaoNJbbbZJbbb:;arJbbbb9GEMgr:lJbbb9p9DTmbar:Ohsxekcjjjj94hskdndnadcl9hmbabaDfgzas86bbazcifam86bbazcdfaw86bbazcefaP86bbxekabaifgzas87ebazcofam87ebazclfaw87ebazcdfaP87ebkaicwfhiaDclfhDalczfhlaecufgembkkk;hlld99eud99eudnaeTmbdndncuaicuftcu7:ZgvJbbbZMgo:lJbbb9p9DTmbao:Ohixekcjjjj94hikaic;8FiGhrinabcofcicdalclfIdb:lalIdb:l9EgialcwfIdb:lalaicdtfIdb:l9EEgialcxfIdb:lalaicdtfIdb:l9EEgiarV87ebdndnJbbj:;JbbjZalaicdtfIdbJbbbb9DEgoalaicd7cdtfIdbJ;Zl:1ZNNgwJbbj:;awJbbj:;9GEgDJbbjZaDJbbjZ9FEavNJbbbZJbbb:;awJbbbb9GEMgw:lJbbb9p9DTmbaw:Ohqxekcjjjj94hqkabcdfaq87ebdndnalaicefciGcdtfIdbJ;Zl:1ZNaoNgwJbbj:;awJbbj:;9GEgDJbbjZaDJbbjZ9FEavNJbbbZJbbb:;awJbbbb9GEMgw:lJbbb9p9DTmbaw:Ohqxekcjjjj94hqkabaq87ebdndnaoalaicufciGcdtfIdbJ;Zl:1ZNNgoJbbj:;aoJbbj:;9GEgwJbbjZawJbbjZ9FEavNJbbbZJbbb:;aoJbbbb9GEMgo:lJbbb9p9DTmbao:Ohixekcjjjj94hikabclfai87ebabcwfhbalczfhlaecufgembkkk;gvdDue998Jjjjjbcjd9Rgo8Kjjjjbdndndnadcd4grTmbc:CucbavEhwaohdarhDinadawBdbadclfhdaDcufgDmbkavcd9hmbaeTmbarcdthqcbhkalhxinaohdaxhDarhwinadadydbgmaDydbcL4cFeGc:cufgPamaP9kEBdbaDclfhDadclfhdawcufgwmbkaxaqfhxakcefgkae9hmbxdkkaeTmekarcdthxavce9hhqcbhkindndndnaqmbarTmdc:CuhDalhdarhwinaDadydbcL4cFeGc:cufgmaDam9kEhDadclfhdawcufgwmbxdkkdndndndnavPleddbdkarTmlaohdalhDarhwinadcbaDydbcL4cFeGgmc:cufgPaPam0EBdbadclfhdaDclfhDawcufgwmbxikkarTmicbhdarhDindnaladfIdbgsJbbbb9Bmbaoadfas:8cL4cFeGgwc8Aawc8A0Ec:cufBdbkadclfhdaDcufgDmbxdkkarTmdkc:CuhDkcbhdarhminaDhwdnavceSmbaoadfydbhwkdndnaladfIdbgscjjj;8iawai9RcefgwcLt9R::NJbbbZJbbb:;asJbbbb9GEMgs:lJbbb9p9DTmbas:OhPxekcjjjj94hPkabadfaPcFFFrGawcKtVBdbadclfhdamcufgmmbkkabaxfhbalaxfhlakcefgkae9hmbkkaocjdf8Kjjjjbk:Olveue99iue99iudnaeTmbceaicufthvcuaitcu7:Zhocbhradcl9hhwcbhDindndnalcwfIdbgqJbbbbaqJbbbb9GEgqJbbjZaqJbbjZ9FEaoNJbbbZMgq:lJbbb9p9DTmbaq:Ohixekcjjjj94hikdndnalIdbgqJbbbbaqJbbbb9GEgqJbbjZaqJbbjZ9FEaoNJbbbZMgq:lJbbb9p9DTmbaq:Ohdxekcjjjj94hdkadai9Rcd9TgkaifhidndnalclfIdbgqJbbbbaqJbbbb9GEgqJbbjZaqJbbjZ9FEaoNJbbbZMgq:lJbbb9p9DTmbaq:Ohdxekcjjjj94hdkadai9Rcd9ThddndnalcxfIdbgqJbbbbaqJbbbb9GEgqJbbjZaqJbbjZ9FEaoNJbbbZMgq:lJbbb9p9DTmbaq:Ohxxekcjjjj94hxkadaifhiaxce91avVhxdndnawmbabaDfgmai86bbamcifax86bbamcdfad86bbamcefak86bbxekabarfgmai87ebamcofax87ebamclfad87ebamcdfak87ebkarcwfhraDclfhDalczfhlaecufgembkkk;mqdQui998Jjjjjbc:qd9Rgv8Kjjjjbavc:Sefcbc;Kbz:xjjjb8AdnadTmbaiTmbdndnabaeSmbaehoxekavcuadcdtgradcFFFFi0Ecbyd;q:I:cjbHjjjjbbgoBd:SeavceBd:mdaoaearz:wjjjb8AkavcbBd:Oeav9cb83i:Geavc:Gefaoadaiavc:Sefz:pjjjbavyd:Gehwadci9UgDcbyd;q:I:cjbHjjjjbbheavc:Sefavyd:mdgqcdtfaeBdbavaqcefgrBd:mdaecbaDz:xjjjbhkavc:SefarcdtfcuaicdtaicFFFFi0Ecbyd;q:I:cjbHjjjjbbgxBdbavaqcdfgmBd:mdalc;ebfhPawheaxhrinaralIdbaPaeydbgscwascw6EcdtfIdbMUdbaeclfhearclfhraicufgimbkavc:SefamcdtfcuaDcdtadcFFFF970Ecbyd;q:I:cjbHjjjjbbgmBdbdnadci6mbaoheamhraDhiinaraxaeydbcdtfIdbaxaeclfydbcdtfIdbMaxaecwfydbcdtfIdbMUdbaecxfhearclfhraicufgimbkkaqcifhzalc;ebfhHavc;qbfhOavheavyd:KehAavyd:OehCcbhscbhrcbhXcehQinaehLaoarcx2fgKydbhPaKclfydbhdabaXcx2fgecwfaKcwfydbgYBdbaeclfadBdbaeaPBdbakarfce86bbaOaYBdwaOadBdlaOaPBdbamarcdtfcbBdbcih8AdnasTmbaLhiinaOa8AcdtfaiydbgeBdba8AaeaY9haeaP9haead9hGGfh8AaiclfhiascufgsmbkkaXcefhXcbhsinaCaAaKascdtfydbcdtgifydbcdtfgYheawaifgdydbgPhidnaPTmbdninaeydbarSmeaeclfheaicufgiTmdxbkkaeaYaPcdtfc98fydbBdbadadydbcufBdbkascefgsci9hmbkdndndna8ATmbcuhrJbbbbhEcbhdavyd:KehYavyd:OehKindnawaOadcdtfydbcdtgsfydbgeTmbaxasfgiIdbh3aialcuadadcs0EcdtfclfIdbaHaecwaecw6EcdtfIdbMg5Udba5a3:th5aecdthiaKaYasfydbcdtfheinamaeydbgscdtfgPa5aPIdbMg3Udba3aEaEa39DgPEhEasaraPEhraeclfheaic98fgimbkkadcefgda8A9hmbkarcu9hmekaQaD9pmeindnakaQfRbbmbaQhrxdkaDaQcefgQ9hmbxdkka8Acza8Acz6EhsaOheaLhOarcu9hmekkazTmbaqcdtavc:Seffcwfheinaeydbcbyd;u:I:cjbH:bjjjbbaec98fheazcufgzmbkkavc:qdf8Kjjjjbk:0leoucuaicdtgvaicFFFFi0Egocbyd;q:I:cjbHjjjjbbhralalyd9GgwcdtfarBdbalawcefBd9GabarBdbaocbyd;q:I:cjbHjjjjbbhralalyd9GgocdtfarBdbalaocefBd9GabarBdlcuadcdtadcFFFFi0Ecbyd;q:I:cjbHjjjjbbhralalyd9GgocdtfarBdbalaocefBd9GabarBdwabydbcbavz:xjjjb8AabydbhraehladhvinaralydbcdtfgoaoydbcefBdbalclfhlavcufgvmbkcbhvabydlglhoarhwaihDinaoavBdbaoclfhoawydbavfhvawclfhwaDcufgDmbkadci9Uhqdnadcd9nmbabydwhocbhvinaecwfydbhwaeclfydbhDalaeydbcdtfgbabydbgbcefBdbaoabcdtfavBdbalaDcdtfgDaDydbgDcefBdbaoaDcdtfavBdbalawcdtfgwawydbgwcefBdbaoawcdtfavBdbaecxfheaqavcefgv9hmbkkinalalydbarydb9RBdbarclfhralclfhlaicufgimbkkQbabaeadaic;G:G:cjbz:ojjjbkQbabaeadaic;i:H:cjbz:ojjjbk9DeeuabcFeaicdtz:xjjjbhlcbhbdnadTmbindnalaeydbcdtfgiydbcu9hmbaiabBdbabcefhbkaeclfheadcufgdmbkkabk:3vioud9:du8Jjjjjbc;Wa9Rgl8Kjjjjbcbhvalcxfcbc;Kbz:xjjjb8AalcuadcitgoadcFFFFe0Ecbyd;q:I:cjbHjjjjbbgrBdxalceBd2araeadaicezNjjjbalcuaoadcjjjjoGEcbyd;q:I:cjbHjjjjbbgwBdzadcdthednadTmbabhiinaiavBdbaiclfhiadavcefgv9hmbkkawaefhDalabBdwalawBdl9cbhqindnadTmbaq9cq9:hkarhvaDhiadheinaiav8Pibak1:NcFrG87ebavcwfhvaicdfhiaecufgembkkalclfaq:NceGcdtfydbhxalclfaq9ce98gq:NceGcdtfydbhmalc;Wbfcbcjaz:xjjjb8AaDhvadhidnadTmbinalc;Wbfav8VebcdtfgeaeydbcefBdbavcdfhvaicufgimbkkcbhvcbhiinalc;WbfavfgeydbhoaeaiBdbaoaifhiavclfgvcja9hmbkadhvdndnadTmbinalc;WbfaDamydbgicetf8VebcdtfgeaeydbgecefBdbaxaecdtfaiBdbamclfhmavcufgvmbkaq9cv9smdcbhvinabawydbcdtfavBdbawclfhwadavcefgv9hmbxdkkaq9cv9smekkcwhvcbhiinalcxfavfc98fydbcbyd;u:I:cjbH:bjjjbbaiceGheclhvcehiaeTmbkalc;Waf8Kjjjjbk:Awliuo99iud9:cbhv8Jjjjjbca9Rgocbyd:4:I:cjbBdKaocb8Pd:W:I:cjb83izaocbyd;e:I:cjbBdwaocb8Pd:8:I:cjb83ibaicd4hrdndnadmbJFFuFhwJFFuuhDJFFuuhqJFFuFhkJFFuuhxJFFuFhmxekarcdthPaehsincbhiinaoczfaifgzasaifIdbgwazIdbgDaDaw9EEUdbaoaifgzawazIdbgDaDaw9DEUdbaiclfgicx9hmbkasaPfhsavcefgvad9hmbkaoIdKhDaoIdwhwaoIdChqaoIdlhkaoIdzhxaoIdbhmkdnadTmbJbbbbJbFu9hJbbbbamax:tgmamJbbbb9DEgmakaq:tgkakam9DEgkawaD:tgwawak9DEgw:vawJbbbb9BEhwdnalmbarcdthoindndnaeclfIdbaq:tawNJbbbZMgk:lJbbb9p9DTmbak:Ohixekcjjjj94hikai:S9cC:ghHdndnaeIdbax:tawNJbbbZMgk:lJbbb9p9DTmbak:Ohixekcjjjj94hikaHai:S:ehHdndnaecwfIdbaD:tawNJbbbZMgk:lJbbb9p9DTmbak:Ohixekcjjjj94hikabaHai:T9cy:g:e83ibaeaofheabcwfhbadcufgdmbxdkkarcdthoindndnaeIdbax:tawNJbbbZMgk:lJbbb9p9DTmbak:Ohixekcjjjj94hikai:SgH9ca:gaH9cz:g9cjjj;4s:d:eaH9cFe:d:e9cF:bj;4:pj;ar:d9c:bd9:9c:p;G:d;4j:E;ar:d9cH9:9c;d;H:W:y:m:g;d;Hb:d9cv9:9c;j:KM;j:KM;j:Kd:dhOdndnaeclfIdbaq:tawNJbbbZMgk:lJbbb9p9DTmbak:Ohixekcjjjj94hikai:SgH9ca:gaH9cz:g9cjjj;4s:d:eaH9cFe:d:e9cF:bj;4:pj;ar:d9c:bd9:9c:p;G:d;4j:E;ar:d9cH9:9c;d;H:W:y:m:g;d;Hb:d9cq9:9cM;j:KM;j:KM;jl:daO:ehOdndnaecwfIdbaD:tawNJbbbZMgk:lJbbb9p9DTmbak:Ohixekcjjjj94hikabaOai:SgH9ca:gaH9cz:g9cjjj;4s:d:eaH9cFe:d:e9cF:bj;4:pj;ar:d9c:bd9:9c:p;G:d;4j:E;ar:d9cH9:9c;d;H:W:y:m:g;d;Hb:d9cC9:9c:KM;j:KM;j:KMD:d:e83ibaeaofheabcwfhbadcufgdmbkkk9teiucbcbyd;y:I:cjbgeabcifc98GfgbBd;y:I:cjbdndnabZbcztgd9nmbcuhiabad9RcFFifcz4nbcuSmekaehikaik;LeeeudndnaeabVciGTmbabhixekdndnadcz9pmbabhixekabhiinaiaeydbBdbaiclfaeclfydbBdbaicwfaecwfydbBdbaicxfaecxfydbBdbaeczfheaiczfhiadc9Wfgdcs0mbkkadcl6mbinaiaeydbBdbaeclfheaiclfhiadc98fgdci0mbkkdnadTmbinaiaeRbb86bbaicefhiaecefheadcufgdmbkkabk;aeedudndnabciGTmbabhixekaecFeGc:b:c:ew2hldndnadcz9pmbabhixekabhiinaialBdbaicxfalBdbaicwfalBdbaiclfalBdbaiczfhiadc9Wfgdcs0mbkkadcl6mbinaialBdbaiclfhiadc98fgdci0mbkkdnadTmbinaiae86bbaicefhiadcufgdmbkkabk9teiucbcbyd;y:I:cjbgeabcrfc94GfgbBd;y:I:cjbdndnabZbcztgd9nmbcuhiabad9RcFFifcz4nbcuSmekaehikaikTeeucbabcbyd;y:I:cjbge9Rcifc98GaefgbBd;y:I:cjbdnabZbcztge9nmbabae9RcFFifcz4nb8Akkk;Sddbcj:Gdk;idbbbbdbbblbbbwbbbbbbbebbbdbbblbbbwbbbbbbbbbbbbbbbbbbbebbbdbbbbbbbebbbbbbbbbbbbbbbb4:h9w9N94:P:gW:j9O:ye9Pbbbbbb:l29hZ;69:9kZ;N;76Z;rg97Z;z;o9xZ8J;B85Z;:;u9yZ;b;k9HZ:2;Z9DZ9e:l9mZ59A8KZ:r;T3Z:A:zYZ79OHZ;j4::8::Y:D9V8:bbbb9s:49:Z8R:hBZ9M9M;M8:L;z;o8:;8:PG89q;x:J878R:hQ8::M:B;e87bbbbbbjZbbjZbbjZ:E;V;N8::Y:DsZ9i;H;68:xd;R8:;h0838:;W:NoZbbbb:WV9O8:uf888:9i;H;68:9c9G;L89;n;m9m89;D8Ko8:bbbbf:8tZ9m836ZS:2AZL;zPZZ818EZ9e:lxZ;U98F8:819E;68:FFuuFFuuFFuuFFuFFFuFFFuFbc;i:IdkCebbbebbbebbbdbbb9G:rbb",t=new Uint8Array([32,0,65,2,1,106,34,33,3,128,11,4,13,64,6,253,10,7,15,116,127,5,8,12,40,16,19,54,20,9,27,255,113,17,42,67,24,23,146,148,18,14,22,45,70,69,56,114,101,21,25,63,75,136,108,28,118,29,73,115]);if(typeof WebAssembly!="object")return{supported:!1};var n,i=WebAssembly.instantiate(r(e),{}).then(function(g){n=g.instance,n.exports.__wasm_call_ctors(),n.exports.meshopt_encodeVertexVersion(1),n.exports.meshopt_encodeIndexVersion(1)});function r(g){for(var m=new Uint8Array(g.length),y=0;y<g.length;++y){var A=g.charCodeAt(y);m[y]=A>96?A-97:A>64?A-39:A+4}for(var b=0,y=0;y<g.length;++y)m[b++]=m[y]<60?t[m[y]]:(m[y]-60)*64+m[++y];return m.buffer.slice(0,b)}function o(g){if(!g)throw new Error("Assertion failed")}function s(g){return new Uint8Array(g.buffer,g.byteOffset,g.byteLength)}function a(g,m,y,A){var b=n.exports.sbrk,x=b(m.length*4),T=b(y*4),E=new Uint8Array(n.exports.memory.buffer),v=s(m);E.set(v,x),A&&A(x,x,m.length,y);var S=g(T,x,m.length,y);E=new Uint8Array(n.exports.memory.buffer);var I=new Uint32Array(y);new Uint8Array(I.buffer).set(E.subarray(T,T+y*4)),v.set(E.subarray(x,x+m.length*4)),b(x-b(0));for(var R=0;R<m.length;++R)m[R]=I[m[R]];return[I,S]}function c(g,m,y,A){var b=n.exports.sbrk,x=b(y*4),T=b(y*A),E=new Uint8Array(n.exports.memory.buffer);E.set(s(m),T),g(x,T,y,A),E=new Uint8Array(n.exports.memory.buffer);var v=new Uint32Array(y);return new Uint8Array(v.buffer).set(E.subarray(x,x+y*4)),b(x-b(0)),v}function u(g,m,y,A,b,x,T){var E=n.exports.sbrk,v=E(m),S=E(A*b),I=new Uint8Array(n.exports.memory.buffer);I.set(s(y),S);var R=g(v,m,S,A,b,x,T),O=new Uint8Array(R);return O.set(I.subarray(v,v+R)),E(v-E(0)),O}function f(g){for(var m=0,y=0;y<g.length;++y){var A=g[y];m=m<A?A:m}return m}function d(g,m){if(o(m==2||m==4),m==4)return new Uint32Array(g.buffer,g.byteOffset,g.byteLength/4);var y=new Uint16Array(g.buffer,g.byteOffset,g.byteLength/2);return new Uint32Array(y)}function p(g,m,y,A,b,x,T){var E=n.exports.sbrk,v=E(y*A),S=E(y*x),I=new Uint8Array(n.exports.memory.buffer);I.set(s(m),S),g(v,y,A,b,S,T);var R=new Uint8Array(y*A);return R.set(I.subarray(v,v+y*A)),E(v-E(0)),R}return{ready:i,supported:!0,reorderMesh:function(g,m,y){o(g instanceof Uint32Array||g instanceof Int32Array),o(!m||g.length%3==0);var A=m?y?n.exports.meshopt_optimizeVertexCacheStrip:n.exports.meshopt_optimizeVertexCache:void 0;return a(n.exports.meshopt_optimizeVertexFetchRemap,g,f(g)+1,A)},reorderPoints:function(g,m){return o(g instanceof Float32Array),o(g.length%m==0),o(m>=3),c(n.exports.meshopt_spatialSortRemap,g,g.length/m,m*4)},encodeVertexBuffer:function(g,m,y){o(y>0&&y<=256),o(y%4==0);var A=n.exports.meshopt_encodeVertexBufferBound(m,y);return u(n.exports.meshopt_encodeVertexBuffer,A,g,m,y)},encodeVertexBufferLevel:function(g,m,y,A,b){o(y>0&&y<=256),o(y%4==0),o(A>=0&&A<=3),o(b===void 0||b==0||b==1);var x=n.exports.meshopt_encodeVertexBufferBound(m,y);return u(n.exports.meshopt_encodeVertexBufferLevel,x,g,m,y,A,b===void 0?-1:b)},encodeIndexBuffer:function(g,m,y){o(y==2||y==4),o(m%3==0);var A=d(g,y),b=n.exports.meshopt_encodeIndexBufferBound(m,f(A)+1);return u(n.exports.meshopt_encodeIndexBuffer,b,A,m,4)},encodeIndexSequence:function(g,m,y){o(y==2||y==4);var A=d(g,y),b=n.exports.meshopt_encodeIndexSequenceBound(m,f(A)+1);return u(n.exports.meshopt_encodeIndexSequence,b,A,m,4)},encodeGltfBuffer:function(g,m,y,A,b){var x={ATTRIBUTES:this.encodeVertexBufferLevel,TRIANGLES:this.encodeIndexBuffer,INDICES:this.encodeIndexSequence};return o(x[A]),x[A](g,m,y,2,b===void 0?0:b)},encodeFilterOct:function(g,m,y,A){return o(y==4||y==8),o(A>=2&&A<=16),p(n.exports.meshopt_encodeFilterOct,g,m,y,A,16)},encodeFilterQuat:function(g,m,y,A){return o(y==8),o(A>=4&&A<=16),p(n.exports.meshopt_encodeFilterQuat,g,m,y,A,16)},encodeFilterExp:function(g,m,y,A,b){o(y>0&&y%4==0),o(A>=1&&A<=24);var x={Separate:0,SharedVector:1,SharedComponent:2,Clamped:3};return o(!b||b in x),p(n.exports.meshopt_encodeFilterExp,g,m,y,A,y,b?x[b]:1)},encodeFilterColor:function(g,m,y,A){return o(y==4||y==8),o(A>=2&&A<=16),p(n.exports.meshopt_encodeFilterColor,g,m,y,A,16)}}})();var sA=(function(){var e="b9H79Tebbbe8Fv9Gbb9Gvuuuuueu9Giuuub9Geueu9Giuuueuixkbeeeddddillviebeoweuecj:Gdkr;Neqo9TW9T9VV95dbH9F9F939H79T9F9J9H229F9Jt9VV7bb8A9TW79O9V9Wt9F9KW9J9V9KW9wWVtW949c919M9MWVbeY9TW79O9V9Wt9F9KW9J9V9KW69U9KW949c919M9MWVbdE9TW79O9V9Wt9F9KW9J9V9KW69U9KW949tWG91W9U9JWbiL9TW79O9V9Wt9F9KW9J9V9KWS9P2tWV9p9JtblK9TW79O9V9Wt9F9KW9J9V9KWS9P2tWV9r919HtbvL9TW79O9V9Wt9F9KW9J9V9KWS9P2tWVT949WboY9TW79O9V9Wt9F9KW9J9V9KWS9P2tWVJ9V29VVbrl79IV9Rbwq1Zkdbk:kYi5ud9:du8Jjjjjbcjq9Rgv8Kjjjjbc9:hodnalTmbcuhoaiRbbgrc;WeGc:Ge9hmbarcsGgwce0mbc9:hoalcufadcd4cbawEgDadfgrcKcaawEgqaraq0Egk6mbaicefhxcj;abad9Uc;WFbGcjdadca0EhmaialfgPar9Rgoadfhsavaoadz:jjjjbgzceVhHcbhOdndninaeaO9nmeaPax9RaD6mdamaeaO9RaOamfgoae6EgAcsfglc9WGhCaAcethXaxaDfhiaOaeaoaeao6E9RhQalcl4cifcd4hLazcjdfaAfhKcbhYabaOad2fg8AhEaHh3incbh5dnawTmbaxaYcd4fRbbh5kcbh8Eazcjdfhqinaih8Fdndndndna5a8Ecet4ciGgoc9:fPdebdkaPa8F9RaA6mrazcjdfa8EaA2fa8FaAz:jjjjb8Aa8FaAfhixdkazcjdfa8EaA2fcbaAz:kjjjb8Aa8FhixekaPa8F9RaL6mva8FaLfhidnaCTmbaPai9RcK6mbaocdtc:q:G:cjbfcj:G:cjbawEhaczhrcbhlinargoc9Wfghaqfhrdndndndndndnaaa8Fahco4fRbbalcoG4ciGcdtfydbPDbedvivvvlvkar9cb83bwar9cb83bbxlkarcbaiRbdai8Xbb9c:c:qj:bw9:9c:q;c1:I1e:d9c:b:c:e1z9:gg9cjjjjjz:dg8J9qE86bbaqaofgrcGfcbaicdfa8J9c8N1:NfghRbbag9cjjjjjw:dg8J9qE86bbarcVfcbaha8J9c8M1:NfghRbbag9cjjjjjl:dg8J9qE86bbarc7fcbaha8J9c8L1:NfghRbbag9cjjjjjd:dg8J9qE86bbarctfcbaha8J9c8K1:NfghRbbag9cjjjjje:dg8J9qE86bbarc91fcbaha8J9c8J1:NfghRbbag9cjjjj;ab:dg8J9qE86bbarc4fcbaha8J9cg1:NfghRbbag9cjjjja:dg8J9qE86bbarc93fcbaha8J9ch1:NfghRbbag9cjjjjz:dgg9qE86bbarc94fcbahag9ca1:NfghRbbai8Xbe9c:c:qj:bw9:9c:q;c1:I1e:d9c:b:c:e1z9:gg9cjjjjjz:dg8J9qE86bbarc95fcbaha8J9c8N1:NfgiRbbag9cjjjjjw:dg8J9qE86bbarc96fcbaia8J9c8M1:NfgiRbbag9cjjjjjl:dg8J9qE86bbarc97fcbaia8J9c8L1:NfgiRbbag9cjjjjjd:dg8J9qE86bbarc98fcbaia8J9c8K1:NfgiRbbag9cjjjjje:dg8J9qE86bbarc99fcbaia8J9c8J1:NfgiRbbag9cjjjj;ab:dg8J9qE86bbarc9:fcbaia8J9cg1:NfgiRbbag9cjjjja:dg8J9qE86bbarcufcbaia8J9ch1:NfgiRbbag9cjjjjz:dgg9qE86bbaiag9ca1:NfhixikaraiRblaiRbbghco4g8Ka8KciSg8KE86bbaqaofgrcGfaiclfa8Kfg8KRbbahcl4ciGg8La8LciSg8LE86bbarcVfa8Ka8Lfg8KRbbahcd4ciGg8La8LciSg8LE86bbarc7fa8Ka8Lfg8KRbbahciGghahciSghE86bbarctfa8Kahfg8KRbbaiRbeghco4g8La8LciSg8LE86bbarc91fa8Ka8Lfg8KRbbahcl4ciGg8La8LciSg8LE86bbarc4fa8Ka8Lfg8KRbbahcd4ciGg8La8LciSg8LE86bbarc93fa8Ka8Lfg8KRbbahciGghahciSghE86bbarc94fa8Kahfg8KRbbaiRbdghco4g8La8LciSg8LE86bbarc95fa8Ka8Lfg8KRbbahcl4ciGg8La8LciSg8LE86bbarc96fa8Ka8Lfg8KRbbahcd4ciGg8La8LciSg8LE86bbarc97fa8Ka8Lfg8KRbbahciGghahciSghE86bbarc98fa8KahfghRbbaiRbigico4g8Ka8KciSg8KE86bbarc99faha8KfghRbbaicl4ciGg8Ka8KciSg8KE86bbarc9:faha8KfghRbbaicd4ciGg8Ka8KciSg8KE86bbarcufaha8KfgrRbbaiciGgiaiciSgiE86bbaraifhixdkaraiRbwaiRbbghcl4g8Ka8KcsSg8KE86bbaqaofgrcGfaicwfa8Kfg8KRbbahcsGghahcsSghE86bbarcVfa8KahfghRbbaiRbeg8Kcl4g8La8LcsSg8LE86bbarc7faha8LfghRbba8KcsGg8Ka8KcsSg8KE86bbarctfaha8KfghRbbaiRbdg8Kcl4g8La8LcsSg8LE86bbarc91faha8LfghRbba8KcsGg8Ka8KcsSg8KE86bbarc4faha8KfghRbbaiRbig8Kcl4g8La8LcsSg8LE86bbarc93faha8LfghRbba8KcsGg8Ka8KcsSg8KE86bbarc94faha8KfghRbbaiRblg8Kcl4g8La8LcsSg8LE86bbarc95faha8LfghRbba8KcsGg8Ka8KcsSg8KE86bbarc96faha8KfghRbbaiRbvg8Kcl4g8La8LcsSg8LE86bbarc97faha8LfghRbba8KcsGg8Ka8KcsSg8KE86bbarc98faha8KfghRbbaiRbog8Kcl4g8La8LcsSg8LE86bbarc99faha8LfghRbba8KcsGg8Ka8KcsSg8KE86bbarc9:faha8KfghRbbaiRbrgicl4g8Ka8KcsSg8KE86bbarcufaha8KfgrRbbaicsGgiaicsSgiE86bbaraifhixekarai8Pbw83bwarai8Pbb83bbaiczfhikdnaoaC9pmbalcdfhlaoczfhraPai9RcL0mekkaoaC6moaimexokaCmva8FTmvkaqaAfhqa8Ecefg8Ecl9hmbkdndndndnawTmbasaYcd4fRbbgociGPlbedrbkaATmdazaYfh8Fazcjdfhhcbh8EaEhaina8FRbbhraahocbhlinaoahalfRbbgqce4cbaqceG9R7arfgr86bbaoadfhoaAalcefgl9hmbkaacefhaa8Fcefh8FahaAfhha8Ecefg8Ecl9hmbxikkaATmeazaYfhaazcjdfhhcbhoceh8EaKh8FinaEaofhlaa8Vbbhrcbhoinala8FaofRbbcwtahaofRbbgqVc;:FiGce4cbaqceG9R7arfgr87bbaladfhlaQaocefgofmbka8FaXfh8FcdhoaacdfhaahaXfhha8EceGhlcbh8EalmbxdkkaATmbaocl4h8EazaYfRbbhqcwhoa3hlinalRbbaotaqVhqalcefhlaocwfgoca9hmbkcbhhaEh8FaKhainazcjdfahfRbbhrcwhoaahlinalRbbaotarVhralaAfhlaocwfgoca9hmbkara8E94aq7hqcbhoa8Fhlinalaqao486bbalcefhlaocwfgoca9hmbka8Fadfh8FaacefhaahcefghaA9hmbkkaEclfhEa3clfh3aYclfgYad6mbkaza8AaAcufad2fadz:jjjjb8AaAaOfhOaihxaimbkc9:hoxdkcbc99aPax9RakSEhoxekc9:hokavcjqf8Kjjjjbaok:ysezu8Jjjjjbc;ae9Rgv8Kjjjjbc9:hodnalaeci9UgrcHf6mbcuhoaiRbbgwc;WeGc;Ge9hmbawcsGgDce0mbavc;abfcFecjez:kjjjb8Aav9cu83iUav9cu83i8Wav9cu83iyav9cu83iaav9cu83iKav9cu83izav9cu83iwav9cu83ibaialfc9WfhqaicefgwarfhldnaeTmbcmcsaDceSEhkcbhxcbhmcbhrcbhicbhoindnalaq9nmbc9:hoxikdndnawRbbgDc;Ve0mbavc;abfaoaDcu7gPcl4fcsGcitfgsydlhzasydbhHdndnaDcsGgsak9pmbavaiaPfcsGcdtfydbaxasEhDaxasTgOfhxxekdndnascsSmbcehOasc987asamffcefhDxekalcefhDal8SbbgscFeGhPdndnascu9mmbaDhlxekalcvfhlaPcFbGhPcrhsdninaD8SbbgOcFbGastaPVhPaOcu9kmeaDcefhDascrfgsc8J9hmbxdkkaDcefhlkcehOaPce4cbaPceG9R7amfhDkaDhmkavc;abfaocitfgsaDBdbasazBdlavaicdtfaDBdbavc;abfaocefcsGcitfgsaHBdbasaDBdlaocdfhoaOaifhidnadcd9hmbabarcetfgsaH87ebasclfaD87ebascdfaz87ebxdkabarcdtfgsaHBdbascwfaDBdbasclfazBdbxekdnaDcpe0mbavaiaqaDcsGfRbbgscl4gP9RcsGcdtfydbaxcefgOaPEhDavaias9RcsGcdtfydbaOaPTgzfgOascsGgPEhsaPThPdndnadcd9hmbabarcetfgHax87ebaHclfas87ebaHcdfaD87ebxekabarcdtfgHaxBdbaHcwfasBdbaHclfaDBdbkavaicdtfaxBdbavc;abfaocitfgHaDBdbaHaxBdlavaicefgicsGcdtfaDBdbavc;abfaocefcsGcitfgHasBdbaHaDBdlavaiazfgicsGcdtfasBdbavc;abfaocdfcsGcitfgDaxBdbaDasBdlaocifhoaiaPfhiaOaPfhxxekaxcbalRbbgsEgHaDc;:eSgDfhOascsGhAdndnascl4gCmbaOcefhzxekaOhzavaiaC9RcsGcdtfydbhOkdndnaAmbazcefhxxekazhxavaias9RcsGcdtfydbhzkdndnaDTmbalcefhDxekalcdfhDal8SbegPcFeGhsdnaPcu9kmbalcofhHascFbGhscrhldninaD8SbbgPcFbGaltasVhsaPcu9kmeaDcefhDalcrfglc8J9hmbkaHhDxekaDcefhDkasce4cbasceG9R7amfgmhHkdndnaCcsSmbaDhsxekaDcefhsaD8SbbglcFeGhPdnalcu9kmbaDcvfhOaPcFbGhPcrhldninas8SbbgDcFbGaltaPVhPaDcu9kmeascefhsalcrfglc8J9hmbkaOhsxekascefhskaPce4cbaPceG9R7amfgmhOkdndnaAcsSmbashlxekascefhlas8SbbgDcFeGhPdnaDcu9kmbascvfhzaPcFbGhPcrhDdninal8SbbgscFbGaDtaPVhPascu9kmealcefhlaDcrfgDc8J9hmbkazhlxekalcefhlkaPce4cbaPceG9R7amfgmhzkdndnadcd9hmbabarcetfgDaH87ebaDclfaz87ebaDcdfaO87ebxekabarcdtfgDaHBdbaDcwfazBdbaDclfaOBdbkavc;abfaocitfgDaOBdbaDaHBdlavaicdtfaHBdbavc;abfaocefcsGcitfgDazBdbaDaOBdlavaicefgicsGcdtfaOBdbavc;abfaocdfcsGcitfgDaHBdbaDazBdlavaiaCTaCcsSVfgicsGcdtfazBdbaiaATaAcsSVfhiaocifhokawcefhwaocsGhoaicsGhiarcifgrae6mbkkcbc99alaqSEhokavc;aef8Kjjjjbaok:clevu8Jjjjjbcz9Rhvdnalaecvf9pmbc9:skdnaiRbbc;:eGc;qeSmbcuskav9cb83iwaicefhoaialfc98fhrdnaeTmbdnadcdSmbcbhwindnaoar6mbc9:skaocefhlao8SbbgicFeGhddndnaicu9mmbalhoxekaocvfhoadcFbGhdcrhidninal8SbbgDcFbGaitadVhdaDcu9kmealcefhlaicrfgic8J9hmbxdkkalcefhokabawcdtfadc8Etc8F91adcd47avcwfadceGcdtVglydbfgiBdbalaiBdbawcefgwae9hmbxdkkcbhwindnaoar6mbc9:skaocefhlao8SbbgicFeGhddndnaicu9mmbalhoxekaocvfhoadcFbGhdcrhidninal8SbbgDcFbGaitadVhdaDcu9kmealcefhlaicrfgic8J9hmbxdkkalcefhokabawcetfadc8Etc8F91adcd47avcwfadceGcdtVglydbfgi87ebalaiBdbawcefgwae9hmbkkcbc99aoarSEk:Lvoeue99dud99eud99dndnadcl9hmbaeTmeindndnabcdfgd8Sbb:Yab8Sbbgi:Ygl:l:tabcefgv8Sbbgo:Ygr:l:tgwJbb;:9cawawNJbbbbawawJbbbb9GgDEgq:mgkaqaicb9iEalMgwawNakaqaocb9iEarMgqaqNMM:r:vglNJbbbZJbbb:;aDEMgr:lJbbb9p9DTmbar:Ohixekcjjjj94hikadai86bbdndnaqalNJbbbZJbbb:;aqJbbbb9GEMgq:lJbbb9p9DTmbaq:Ohdxekcjjjj94hdkavad86bbdndnawalNJbbbZJbbb:;awJbbbb9GEMgw:lJbbb9p9DTmbaw:Ohdxekcjjjj94hdkabad86bbabclfhbaecufgembxdkkaeTmbindndnabclfgd8Ueb:Yab8Uebgi:Ygl:l:tabcdfgv8Uebgo:Ygr:l:tgwJb;:FSawawNJbbbbawawJbbbb9GgDEgq:mgkaqaicb9iEalMgwawNakaqaocb9iEarMgqaqNMM:r:vglNJbbbZJbbb:;aDEMgr:lJbbb9p9DTmbar:Ohixekcjjjj94hikadai87ebdndnaqalNJbbbZJbbb:;aqJbbbb9GEMgq:lJbbb9p9DTmbaq:Ohdxekcjjjj94hdkavad87ebdndnawalNJbbbZJbbb:;awJbbbb9GEMgw:lJbbb9p9DTmbaw:Ohdxekcjjjj94hdkabad87ebabcwfhbaecufgembkkk:4ioiue99dud99dud99dnaeTmbcbhiabhlindndnal8Uebgv:YgoJ:ji:1Salcof8UebgrciVgw:Y:vgDNJbbbZJbbb:;avcu9kEMgq:lJbbb9p9DTmbaq:Ohkxekcjjjj94hkkalclf8Uebhvalcdf8UebhxalarcefciGcetfak87ebdndnax:YgqaDNJbbbZJbbb:;axcu9kEMgm:lJbbb9p9DTmbam:Ohxxekcjjjj94hxkabaiarciGgkfcd7cetfax87ebdndnav:YgmaDNJbbbZJbbb:;avcu9kEMgP:lJbbb9p9DTmbaP:Ohvxekcjjjj94hvkalarcufciGcetfav87ebdndnawaw2:ZgPaPMaoaoN:taqaqN:tamamN:tgoJbbbbaoJbbbb9GE:raDNJbbbZMgD:lJbbb9p9DTmbaD:Ohrxekcjjjj94hrkalakcetfar87ebalcwfhlaiclfhiaecufgembkkk9mbdnadcd4ae2gdTmbinababydbgecwtcw91:Yaece91cjjj98Gcjjj;8if::NUdbabclfhbadcufgdmbkkk:Tvirud99eudndnadcl9hmbaeTmeindndnabRbbgiabcefgl8Sbbgvabcdfgo8Sbbgrf9R:YJbbuJabcifgwRbbgdce4adVgDcd4aDVgDcl4aDVgD:Z:vgqNJbbbZMgk:lJbbb9p9DTmbak:Ohxxekcjjjj94hxkaoax86bbdndnaraif:YaqNJbbbZMgk:lJbbb9p9DTmbak:Ohoxekcjjjj94hokalao86bbdndnavaifar9R:YaqNJbbbZMgk:lJbbb9p9DTmbak:Ohixekcjjjj94hikabai86bbdndnaDadcetGadceGV:ZaqNJbbbZMgq:lJbbb9p9DTmbaq:Ohdxekcjjjj94hdkawad86bbabclfhbaecufgembxdkkaeTmbindndnab8Vebgiabcdfgl8Uebgvabclfgo8Uebgrf9R:YJbFu9habcofgw8Vebgdce4adVgDcd4aDVgDcl4aDVgDcw4aDVgD:Z:vgqNJbbbZMgk:lJbbb9p9DTmbak:Ohxxekcjjjj94hxkaoax87ebdndnaraif:YaqNJbbbZMgk:lJbbb9p9DTmbak:Ohoxekcjjjj94hokalao87ebdndnavaifar9R:YaqNJbbbZMgk:lJbbb9p9DTmbak:Ohixekcjjjj94hikabai87ebdndnaDadcetGadceGV:ZaqNJbbbZMgq:lJbbb9p9DTmbaq:Ohdxekcjjjj94hdkawad87ebabcwfhbaecufgembkkk9teiucbcbyd:K:G:cjbgeabcifc98GfgbBd:K:G:cjbdndnabZbcztgd9nmbcuhiabad9RcFFifcz4nbcuSmekaehikaik;LeeeudndnaeabVciGTmbabhixekdndnadcz9pmbabhixekabhiinaiaeydbBdbaiclfaeclfydbBdbaicwfaecwfydbBdbaicxfaecxfydbBdbaeczfheaiczfhiadc9Wfgdcs0mbkkadcl6mbinaiaeydbBdbaeclfheaiclfhiadc98fgdci0mbkkdnadTmbinaiaeRbb86bbaicefhiaecefheadcufgdmbkkabk;aeedudndnabciGTmbabhixekaecFeGc:b:c:ew2hldndnadcz9pmbabhixekabhiinaialBdbaicxfalBdbaicwfalBdbaiclfalBdbaiczfhiadc9Wfgdcs0mbkkadcl6mbinaialBdbaiclfhiadc98fgdci0mbkkdnadTmbinaiae86bbaicefhiadcufgdmbkkabkk83dbcj:Gdk8Kbbbbdbbblbbbwbbbbbbbebbbdbbblbbbwbbbbc:K:Gdkl8W:qbb",t="b9H79TebbbeKl9Gbb9Gvuuuuueu9Giuuub9Geueuixkbbebeeddddilve9Weeeviebeoweuecj:Gdkr;Neqo9TW9T9VV95dbH9F9F939H79T9F9J9H229F9Jt9VV7bb8A9TW79O9V9Wt9F9KW9J9V9KW9wWVtW949c919M9MWVbdY9TW79O9V9Wt9F9KW9J9V9KW69U9KW949c919M9MWVblE9TW79O9V9Wt9F9KW9J9V9KW69U9KW949tWG91W9U9JWbvL9TW79O9V9Wt9F9KW9J9V9KWS9P2tWV9p9JtboK9TW79O9V9Wt9F9KW9J9V9KWS9P2tWV9r919HtbrL9TW79O9V9Wt9F9KW9J9V9KWS9P2tWVT949WbwY9TW79O9V9Wt9F9KW9J9V9KWS9P2tWVJ9V29VVbDl79IV9Rbqq:59Dklbzik94evu8Jjjjjbcz9Rhbcbheincbhdcbhiinabcwfadfaicjuaead4ceGglE86bbaialfhiadcefgdcw9hmbkaeai86b:q:W:cjbaecitab8Piw83i:q:G:cjbaecefgecjd9hmbkk:SBlEud97dur978Jjjjjbcj;kb9Rgv8Kjjjjbc9:hodnalTmbcuhoaiRbbgrc;WeGc:Ge9hmbarcsGgwce0mbc9:hoalcufadcd4cbawEgDadfgrcKcaawEgqaraq0Egk6mbaialfgxar9RhodnadTgmmbavaoad;8qbbkaicefhPcj;abad9Uc;WFbGcjdadca0EhsdndndnadTmbaoadfhzcbhHinaeaH9nmdaxaP9RaD6miabaHad2fgOavcjdfasaeaH9RaHasfae6EgAaAcsfgoc9WGgCSEhXaPaDfhQaocl4cifcd4hLavcj;cbfaCcetfhKavcj;cbfaCci2fhYavcj;cbfaCfh8AcbhEaoc;ab6h3incbh5dnawTmbaPaEcd4fRbbh5kcbh8Eavcj;cbfh8Findndndndna5a8Ecet4ciGgoc9:fPdebdkaxaQ9RaC6mwdnaCTmbavcj;cbfa8EaC2faQaC;8qbbkaQaAfhQxdkaCTmeavcj;cbfa8EaC2fcbaC;8kbxekaxaQ9RaL6moaoclVcbawEhraQaLfhocbhidna3mbaxao9Rc;Gb6mbcbhlina8FalfhidndndndndndnaQalco4fRbbgqciGarfPDbedibledibkaipxbbbbbbbbbbbbbbbbpklbxlkaiaopbblaopbbbgaclp:meaapmbzeHdOiAlCvXoQrLgacdp:meaapmbzeHdOiAlCvXoQrLpxiiiiiiiiiiiiiiiip9oghpxiiiiiiiiiiiiiiiip8Jgap5b9cjF;8;4;W;G;ab9:9cU1:Nggcitpbi:q:G:cjbagRb:q:W:cjbggpsaap5e9cjF;8;4;W;G;ab9:9cU1:Ng8Jcitpbi:q:G:cjbp9UpmbedilvorzHOACXQLpPahaap9spklbagaoclffa8JRb:q:W:cjbfhoxikaiaopbbwaopbbbgaclp:meaapmbzeHdOiAlCvXoQrLpxssssssssssssssssp9oghpxssssssssssssssssp8Jgap5b9cjF;8;4;W;G;ab9:9cU1:Nggcitpbi:q:G:cjbagRb:q:W:cjbggpsaap5e9cjF;8;4;W;G;ab9:9cU1:Ng8Jcitpbi:q:G:cjbp9UpmbedilvorzHOACXQLpPahaap9spklbagaocwffa8JRb:q:W:cjbfhoxdkaiaopbbbpklbaoczfhoxekaiaopbbdaoRbbggcitpbi:q:G:cjbagRb:q:W:cjbggpsaoRbeg8Jcitpbi:q:G:cjbp9UpmbedilvorzHOACXQLpPpklbagaocdffa8JRb:q:W:cjbfhokdndndndndndnaqcd4ciGarfPDbedibledibkaiczfpxbbbbbbbbbbbbbbbbpklbxlkaiczfaopbblaopbbbgaclp:meaapmbzeHdOiAlCvXoQrLgacdp:meaapmbzeHdOiAlCvXoQrLpxiiiiiiiiiiiiiiiip9oghpxiiiiiiiiiiiiiiiip8Jgap5b9cjF;8;4;W;G;ab9:9cU1:Nggcitpbi:q:G:cjbagRb:q:W:cjbggpsaap5e9cjF;8;4;W;G;ab9:9cU1:Ng8Jcitpbi:q:G:cjbp9UpmbedilvorzHOACXQLpPahaap9spklbagaoclffa8JRb:q:W:cjbfhoxikaiczfaopbbwaopbbbgaclp:meaapmbzeHdOiAlCvXoQrLpxssssssssssssssssp9oghpxssssssssssssssssp8Jgap5b9cjF;8;4;W;G;ab9:9cU1:Nggcitpbi:q:G:cjbagRb:q:W:cjbggpsaap5e9cjF;8;4;W;G;ab9:9cU1:Ng8Jcitpbi:q:G:cjbp9UpmbedilvorzHOACXQLpPahaap9spklbagaocwffa8JRb:q:W:cjbfhoxdkaiczfaopbbbpklbaoczfhoxekaiczfaopbbdaoRbbggcitpbi:q:G:cjbagRb:q:W:cjbggpsaoRbeg8Jcitpbi:q:G:cjbp9UpmbedilvorzHOACXQLpPpklbagaocdffa8JRb:q:W:cjbfhokdndndndndndnaqcl4ciGarfPDbedibledibkaicafpxbbbbbbbbbbbbbbbbpklbxlkaicafaopbblaopbbbgaclp:meaapmbzeHdOiAlCvXoQrLgacdp:meaapmbzeHdOiAlCvXoQrLpxiiiiiiiiiiiiiiiip9oghpxiiiiiiiiiiiiiiiip8Jgap5b9cjF;8;4;W;G;ab9:9cU1:Nggcitpbi:q:G:cjbagRb:q:W:cjbggpsaap5e9cjF;8;4;W;G;ab9:9cU1:Ng8Jcitpbi:q:G:cjbp9UpmbedilvorzHOACXQLpPahaap9spklbagaoclffa8JRb:q:W:cjbfhoxikaicafaopbbwaopbbbgaclp:meaapmbzeHdOiAlCvXoQrLpxssssssssssssssssp9oghpxssssssssssssssssp8Jgap5b9cjF;8;4;W;G;ab9:9cU1:Nggcitpbi:q:G:cjbagRb:q:W:cjbggpsaap5e9cjF;8;4;W;G;ab9:9cU1:Ng8Jcitpbi:q:G:cjbp9UpmbedilvorzHOACXQLpPahaap9spklbagaocwffa8JRb:q:W:cjbfhoxdkaicafaopbbbpklbaoczfhoxekaicafaopbbdaoRbbggcitpbi:q:G:cjbagRb:q:W:cjbggpsaoRbeg8Jcitpbi:q:G:cjbp9UpmbedilvorzHOACXQLpPpklbagaocdffa8JRb:q:W:cjbfhokdndndndndndnaqco4arfPDbedibledibkaic8Wfpxbbbbbbbbbbbbbbbbpklbxlkaic8Wfaopbblaopbbbgaclp:meaapmbzeHdOiAlCvXoQrLgacdp:meaapmbzeHdOiAlCvXoQrLpxiiiiiiiiiiiiiiiip9oghpxiiiiiiiiiiiiiiiip8Jgap5b9cjF;8;4;W;G;ab9:9cU1:Ngicitpbi:q:G:cjbaiRb:q:W:cjbgipsaap5e9cjF;8;4;W;G;ab9:9cU1:Ngqcitpbi:q:G:cjbp9UpmbedilvorzHOACXQLpPahaap9spklbaiaoclffaqRb:q:W:cjbfhoxikaic8Wfaopbbwaopbbbgaclp:meaapmbzeHdOiAlCvXoQrLpxssssssssssssssssp9oghpxssssssssssssssssp8Jgap5b9cjF;8;4;W;G;ab9:9cU1:Ngicitpbi:q:G:cjbaiRb:q:W:cjbgipsaap5e9cjF;8;4;W;G;ab9:9cU1:Ngqcitpbi:q:G:cjbp9UpmbedilvorzHOACXQLpPahaap9spklbaiaocwffaqRb:q:W:cjbfhoxdkaic8Wfaopbbbpklbaoczfhoxekaic8WfaopbbdaoRbbgicitpbi:q:G:cjbaiRb:q:W:cjbgipsaoRbegqcitpbi:q:G:cjbp9UpmbedilvorzHOACXQLpPpklbaiaocdffaqRb:q:W:cjbfhokalc;abfhialcjefaC0meaihlaxao9Rc;Fb0mbkkdnaiaC9pmbaici4hlinaxao9RcK6mwa8FaifhqdndndndndndnaQaico4fRbbalcoG4ciGarfPDbedibledibkaqpxbbbbbbbbbbbbbbbbpkbbxlkaqaopbblaopbbbgaclp:meaapmbzeHdOiAlCvXoQrLgacdp:meaapmbzeHdOiAlCvXoQrLpxiiiiiiiiiiiiiiiip9oghpxiiiiiiiiiiiiiiiip8Jgap5b9cjF;8;4;W;G;ab9:9cU1:Nggcitpbi:q:G:cjbagRb:q:W:cjbggpsaap5e9cjF;8;4;W;G;ab9:9cU1:Ng8Jcitpbi:q:G:cjbp9UpmbedilvorzHOACXQLpPahaap9spkbbagaoclffa8JRb:q:W:cjbfhoxikaqaopbbwaopbbbgaclp:meaapmbzeHdOiAlCvXoQrLpxssssssssssssssssp9oghpxssssssssssssssssp8Jgap5b9cjF;8;4;W;G;ab9:9cU1:Nggcitpbi:q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KaaaapmxmPsxmPsxmPsxmPsp9Ug8Kp9Abbbaladfgla8Ka8La8MpmwDKYqk8AExm35Ps8E8Fgacep9Taaahp9op9Hp9rgap9Ughp9Abbbaladfglahaaaapmlvorlvorlvorlvorp9Ughp9AbbbaladfglahaaaapmwDqkwDqkwDqkwDqkp9Ughp9AbbbaladfglahaaaapmxmPsxmPsxmPsxmPsp9Ug8Kp9AbbbaladfhlaoczfgoaC6mbxikkaCTmeaXaEfhlavaEfpbdbh8Kcbhoinalavcj;cbfaofpblbg8La8Aaofpblbg8MpmbzeHdOiAlCvXoQrLg8NaKaofpblbgyaYaofpblbg8PpmbzeHdOiAlCvXoQrLgIpmbezHdiOAlvCXorQLgacep:neaapxebebebebebebebebghp9op:bep9rgaa8Kp:oeg8Kp9Abbbaladfgla8Kaaaapmlvorlvorlvorlvorp:oeg8Kp9Abbbaladfgla8KaaaapmwDqkwDqkwDqkwDqkp:oeg8Kp9Abbbaladfgla8KaaaapmxmPsxmPsxmPsxmPsp:oeg8Kp9Abbbaladfgla8Ka8NaIpmwDKYqk8AExm35Ps8E8Fgacep:neaaahp9op:bep9rgap:oeg8Kp9Abbbaladfgla8Kaaaapmlvorlvorlvorlvorp:oeg8Kp9Abbbaladfgla8KaaaapmwDqkwDqkwDqkwDqkp:oeg8Kp9Abbbaladfgla8KaaaapmxmPsxmPsxmPsxmPsp:oeg8Kp9Abbbaladfgla8Ka8La8MpmwKDYq8AkEx3m5P8Es8Fg8Laya8PpmwKDYq8AkEx3m5P8Es8Fg8MpmbezHdiOAlvCXorQLgacep:neaaahp9op:bep9rgap:oeg8Kp9Abbbaladfgla8Kaaaapmlvorlvorlvorlvorp:oeg8Kp9Abbbaladfgla8KaaaapmwDqkwDqkwDqkwDqkp:oeg8Kp9Abbbaladfgla8KaaaapmxmPsxmPsxmPsxmPsp:oeg8Kp9Abbbaladfgla8Ka8La8MpmwDKYqk8AExm35Ps8E8Fgacep:neaaahp9op:bep9rgap:oeghp9Abbbaladfglahaaaapmlvorlvorlvorlvorp:oeghp9AbbbaladfglahaaaapmwDqkwDqkwDqkwDqkp:oeghp9AbbbaladfglahaaaapmxmPsxmPsxmPsxmPsp:oeg8Kp9AbbbaladfhlaoczfgoaC6mbxdkkaCTmbaXaEfhrcbhocbalcl4gl9Rc8FGhiavaEfpbdbhhinaravcj;cbfaofpblbg8Ka8Aaofpblbg8LpmbzeHdOiAlCvXoQrLg8MaKaofpblbg8NaYaofpblbgypmbzeHdOiAlCvXoQrLg8PpmbezHdiOAlvCXorQLgaaip:Reaaalp:Tep9qgaahp9rghp9Abbbaradfgrahaaaapmlvorlvorlvorlvorp9rghp9AbbbaradfgrahaaaapmwDqkwDqkwDqkwDqkp9rghp9AbbbaradfgrahaaaapmxmPsxmPsxmPsxmPsp9rghp9Abbbaradfgraha8Ma8PpmwDKYqk8AExm35Ps8E8Fgaaip:Reaaalp:Tep9qgap9rghp9Abbbaradfgrahaaaapmlvorlvorlvorlvorp9rghp9AbbbaradfgrahaaaapmwDqkwDqkwDqkwDqkp9rghp9AbbbaradfgrahaaaapmxmPsxmPsxmPsxmPsp9rghp9Abbbaradfgraha8Ka8LpmwKDYq8AkEx3m5P8Es8Fg8Ka8NaypmwKDYq8AkEx3m5P8Es8Fg8LpmbezHdiOAlvCXorQLgaaip:Reaaalp:Tep9qgap9rghp9Abbbaradfgrahaaaapmlvorlvorlvorlvorp9rghp9AbbbaradfgrahaaaapmwDqkwDqkwDqkwDqkp9rghp9AbbbaradfgrahaaaapmxmPsxmPsxmPsxmPsp9rghp9Abbbaradfgraha8Ka8LpmwDKYqk8AExm35Ps8E8Fgaaip:Reaaalp:Tep9qgap9rghp9Abbbaradfgrahaaaapmlvorlvorlvorlvorp9rghp9AbbbaradfgrahaaaapmwDqkwDqkwDqkwDqkp9rghp9AbbbaradfgrahaaaapmxmPsxmPsxmPsxmPsp9rghp9AbbbaradfhraoczfgoaC6mbkkaEclfgEad6mbkdnaXavcjdf9hmbaAad2goTmbaOavcjdfao;8qbbkdnammbavaXaAcufad2fad;8qbbkaAaHfhHc9:hoaQhPaQmbxlkkaeTmbaDalfhrcbhocuhlinaralaD9RglfaD6mdasaeao9Raoasfae6Eaofgoae6mbkaial9RhPkcbc99axaP9RakSEhoxekc9:hokavcj;kbf8Kjjjjbaokwbz:bjjjbkNsezu8Jjjjjbc;ae9Rgv8Kjjjjbc9:hodnalaeci9UgrcHf6mbcuhoaiRbbgwc;WeGc;Ge9hmbawcsGgDce0mbavc;abfcFecje;8kbav9cu83iUav9cu83i8Wav9cu83iyav9cu83iaav9cu83iKav9cu83izav9cu83iwav9cu83ibaialfc9WfhqaicefgwarfhldnaeTmbcmcsaDceSEhkcbhxcbhmcbhrcbhicbhoindnalaq9nmbc9:hoxikdndnawRbbgDc;Ve0mbavc;abfaoaDcu7gPcl4fcsGcitfgsydlhzasydbhHdndnaDcsGgsak9pmbavaiaPfcsGcdtfydbaxasEhDaxasTgOfhxxekdndnascsSmbcehOasc987asamffcefhDxekalcefhDal8SbbgscFeGhPdndnascu9mmbaDhlxekalcvfhlaPcFbGhPcrhsdninaD8SbbgOcFbGastaPVhPaOcu9kmeaDcefhDascrfgsc8J9hmbxdkkaDcefhlkcehOaPce4cbaPceG9R7amfhDkaDhmkavc;abfaocitfgsaDBdbasazBdlavaicdtfaDBdbavc;abfaocefcsGcitfgsaHBdbasaDBdlaocdfhoaOaifhidnadcd9hmbabarcetfgsaH87ebasclfaD87ebascdfaz87ebxdkabarcdtfgsaHBdbascwfaDBdbasclfazBdbxekdnaDcpe0mbavaiaqaDcsGfRbbgscl4gP9RcsGcdtfydbaxcefgOaPEhDavaias9RcsGcdtfydbaOaPTgzfgOascsGgPEhsaPThPdndnadcd9hmbabarcetfgHax87ebaHclfas87ebaHcdfaD87ebxekabarcdtfgHaxBdbaHcwfasBdbaHclfaDBdbkavaicdtfaxBdbavc;abfaocitfgHaDBdbaHaxBdlavaicefgicsGcdtfaDBdbavc;abfaocefcsGcitfgHasBdbaHaDBdlavaiazfgicsGcdtfasBdbavc;abfaocdfcsGcitfgDaxBdbaDasBdlaocifhoaiaPfhiaOaPfhxxekaxcbalRbbgsEgHaDc;:eSgDfhOascsGhAdndnascl4gCmbaOcefhzxekaOhzavaiaC9RcsGcdtfydbhOkdndnaAmbazcefhxxekazhxavaias9RcsGcdtfydbhzkdndnaDTmbalcefhDxekalcdfhDal8SbegPcFeGhsdnaPcu9kmbalcofhHascFbGhscrhldninaD8SbbgPcFbGaltasVhsaPcu9kmeaDcefhDalcrfglc8J9hmbkaHhDxekaDcefhDkasce4cbasceG9R7amfgmhHkdndnaCcsSmbaDhsxekaDcefhsaD8SbbglcFeGhPdnalcu9kmbaDcvfhOaPcFbGhPcrhldninas8SbbgDcFbGaltaPVhPaDcu9kmeascefhsalcrfglc8J9hmbkaOhsxekascefhskaPce4cbaPceG9R7amfgmhOkdndnaAcsSmbashlxekascefhlas8SbbgDcFeGhPdnaDcu9kmbascvfhzaPcFbGhPcrhDdninal8SbbgscFbGaDtaPVhPascu9kmealcefhlaDcrfgDc8J9hmbkazhlxekalcefhlkaPce4cbaPceG9R7amfgmhzkdndnadcd9hmbabarcetfgDaH87ebaDclfaz87ebaDcdfaO87ebxekabarcdtfgDaHBdbaDcwfazBdbaDclfaOBdbkavc;abfaocitfgDaOBdbaDaHBdlavaicdtfaHBdbavc;abfaocefcsGcitfgDazBdbaDaOBdlavaicefgicsGcdtfaOBdbavc;abfaocdfcsGcitfgDaHBdbaDazBdlavaiaCTaCcsSVfgicsGcdtfazBdbaiaATaAcsSVfhiaocifhokawcefhwaocsGhoaicsGhiarcifgrae6mbkkcbc99alaqSEhokavc;aef8Kjjjjbaok:clevu8Jjjjjbcz9Rhvdnalaecvf9pmbc9:skdnaiRbbc;:eGc;qeSmbcuskav9cb83iwaicefhoaialfc98fhrdnaeTmbdnadcdSmbcbhwindnaoar6mbc9:skaocefhlao8SbbgicFeGhddndnaicu9mmbalhoxekaocvfhoadcFbGhdcrhidninal8SbbgDcFbGaitadVhdaDcu9kmealcefhlaicrfgic8J9hmbxdkkalcefhokabawcdtfadc8Etc8F91adcd47avcwfadceGcdtVglydbfgiBdbalaiBdbawcefgwae9hmbxdkkcbhwindnaoar6mbc9:skaocefhlao8SbbgicFeGhddndnaicu9mmbalhoxekaocvfhoadcFbGhdcrhidninal8SbbgDcFbGaitadVhdaDcu9kmealcefhlaicrfgic8J9hmbxdkkalcefhokabawcetfadc8Etc8F91adcd47avcwfadceGcdtVglydbfgi87ebalaiBdbawcefgwae9hmbkkcbc99aoarSEk;Toio97eue97aec98Ghedndnadcl9hmbaeTmecbhdinababpbbbgicKp:RecKp:Sep;6eglaicwp:RecKp:Sep;6ealp;Geaiczp:RecKp:Sep;6egvp;Gep;Kep;Legopxbbbbbbbbbbbbbbbbp:2egralpxbbbjbbbjbbbjbbbjgwp9op9rp;Keglpxbb;:9cbb;:9cbb;:9cbb;:9calalp;Meaoaop;Meavaravawp9op9rp;Keglalp;Mep;Kep;Kep;Jep;Negvp;Mepxbbn0bbn0bbn0bbn0grp;KepxFbbbFbbbFbbbFbbbp9oaipxbbbFbbbFbbbFbbbFp9op9qalavp;Mearp;Kecwp:RepxbFbbbFbbbFbbbFbbp9op9qaoavp;Mearp;Keczp:RepxbbFbbbFbbbFbbbFbp9op9qpkbbabczfhbadclfgdae6mbxdkkaeTmbcbhdinabczfgDaDpbbbgipxbbbbbbFFbbbbbbFFgwp9oabpbbbgoaipmbediwDqkzHOAKY8AEgvczp:Reczp:Sep;6eglaoaipmlvorxmPsCXQL358E8FpxFubbFubbFubbFubbp9op;6eavczp:Sep;6egvp;Gealp;Gep;Kep;Legipxbbbbbbbbbbbbbbbbp:2egralpxbbbjbbbjbbbjbbbjgqp9op9rp;Keglpxb;:FSb;:FSb;:FSb;:FSalalp;Meaiaip;Meavaravaqp9op9rp;Keglalp;Mep;Kep;Kep;Jep;Negvp;Mepxbbn0bbn0bbn0bbn0grp;KepxFFbbFFbbFFbbFFbbp9oaiavp;Mearp;Keczp:Rep9qgialavp;Mearp;KepxFFbbFFbbFFbbFFbbp9oglpmwDKYqk8AExm35Ps8E8Fp9qpkbbabaoawp9oaialpmbezHdiOAlvCXorQLp9qpkbbabcafhbadclfgdae6mbkkk;2ileue97euo97dnaec98GgiTmbcbheinabcKfpx:ji:1S:ji:1S:ji:1S:ji:1SabpbbbglabczfgvpbbbgopmlvorxmPsCXQL358E8Fgrczp:Segwpxibbbibbbibbbibbbp9qp;6egDp;NegqaDaDp;MegDaDp;KealaopmbediwDqkzHOAKY8AEgDczp:Reczp:Sep;6eglalp;MeaDczp:Sep;6egoaop;Mearczp:Reczp:Sep;6egrarp;Mep;Kep;Kep;Lepxbbbbbbbbbbbbbbbbp:4ep;Jep;Mepxbbn0bbn0bbn0bbn0gDp;KepxFFbbFFbbFFbbFFbbgkp9oaqaop;MeaDp;Keczp:Rep9qgoaqalp;MeaDp;Keakp9oaqarp;MeaDp;Keczp:Rep9qgDpmwDKYqk8AExm35Ps8E8Fglp5eawclp:RegqpEi:T:j83ibavalp5baqpEd:T:j83ibabcwfaoaDpmbezHdiOAlvCXorQLgDp5eaqpEe:T:j83ibabaDp5baqpEb:T:j83ibabcafhbaeclfgeai6mbkkkuee97dnadcd4ae2c98GgeTmbcbhdinababpbbbgicwp:Recwp:Sep;6eaicep:SepxbbjFbbjFbbjFbbjFp9opxbbjZbbjZbbjZbbjZp:Uep;Mepkbbabczfhbadclfgdae6mbkkk:Sodw97euaec98Ghedndnadcl9hmbaeTmecbhdinabpxbbuJbbuJbbuJbbuJabpbbbgicKp:TeglaicYp:Tep9qgvcdp:Teavp9qgvclp:Teavp9qgop;6ep;Negvaicwp:RecKp:SegraipxFbbbFbbbFbbbFbbbgwp9ogDp:Uep;6ep;Mepxbbn0bbn0bbn0bbn0gqp;Kecwp:RepxbFbbbFbbbFbbbFbbp9oavaDarp:Xeaiczp:RecKp:Segip:Uep;6ep;Meaqp;Keawp9op9qavaDaraip:Uep:Xep;6ep;Meaqp;Keczp:RepxbbFbbbFbbbFbbbFbp9op9qavaoalcep:Rep9oalpxebbbebbbebbbebbbp9op9qp;6ep;Meaqp;KecKp:Rep9qpkbbabczfhbadclfgdae6mbxdkkaeTmbcbhdinabczfgkpxbFu9hbFu9hbFu9hbFu9habpbbbglakpbbbgrpmlvorxmPsCXQL358E8Fgvczp:TegqavcHp:Tep9qgicdp:Teaip9qgiclp:Teaip9qgicwp:Teaip9qgop;6ep;NegialarpmbediwDqkzHOAKY8AEgDpxFFbbFFbbFFbbFFbbglp9ograDczp:Segwp:Ueavczp:Reczp:SegDp:Xep;6ep;Mepxbbn0bbn0bbn0bbn0gvp;Kealp9oaiarawaDp:Uep:Xep;6ep;Meavp;Keczp:Rep9qgwaiaoaqcep:Rep9oaqpxebbbebbbebbbebbbp9op9qp;6ep;Meavp;Keczp:ReaiaDarp:Uep;6ep;Meavp;Kealp9op9qgipmwDKYqk8AExm35Ps8E8FpkbbabawaipmbezHdiOAlvCXorQLpkbbabcafhbadclfgdae6mbkkk9teiucbcbydj:G:cjbgeabcifc98GfgbBdj:G:cjbdndnabZbcztgd9nmbcuhiabad9RcFFifcz4nbcuSmekaehikaikkxebcj:Gdklz:zbb",n=new Uint8Array([0,97,115,109,1,0,0,0,1,4,1,96,0,0,3,3,2,0,0,5,3,1,0,1,12,1,0,10,22,2,12,0,65,0,65,0,65,0,252,10,0,0,11,7,0,65,0,253,15,26,11]),i=new Uint8Array([32,0,65,2,1,106,34,33,3,128,11,4,13,64,6,253,10,7,15,116,127,5,8,12,40,16,19,54,20,9,27,255,113,17,42,67,24,23,146,148,18,14,22,45,70,69,56,114,101,21,25,63,75,136,108,28,118,29,73,115]);if(typeof WebAssembly!="object")return{supported:!1};var r=WebAssembly.validate(n)?a(t):a(e),o,s=WebAssembly.instantiate(r,{}).then(function(b){o=b.instance,o.exports.__wasm_call_ctors()});function a(b){for(var x=new Uint8Array(b.length),T=0;T<b.length;++T){var E=b.charCodeAt(T);x[T]=E>96?E-97:E>64?E-39:E+4}for(var v=0,T=0;T<b.length;++T)x[v++]=x[T]<60?i[x[T]]:(x[T]-60)*64+x[++T];return x.buffer.slice(0,v)}function c(b,x,T,E,v,S,I){var R=b.exports.sbrk,O=E+3&-4,L=R(O*v),_=R(S.length),C=new Uint8Array(b.exports.memory.buffer);C.set(S,_);var w=x(L,E,v,_,S.length);if(w==0&&I&&I(L,O,v),T.set(C.subarray(L,L+E*v)),R(L-R(0)),w!=0)throw new Error("Malformed buffer data: "+w)}var u={NONE:"",OCTAHEDRAL:"meshopt_decodeFilterOct",QUATERNION:"meshopt_decodeFilterQuat",EXPONENTIAL:"meshopt_decodeFilterExp",COLOR:"meshopt_decodeFilterColor"},f={ATTRIBUTES:"meshopt_decodeVertexBuffer",TRIANGLES:"meshopt_decodeIndexBuffer",INDICES:"meshopt_decodeIndexSequence"},d=[],p=0;function g(b){var x={object:new Worker(b),pending:0,requests:{}};return x.object.onmessage=function(T){var E=T.data;x.pending-=E.count,x.requests[E.id][E.action](E.value),delete x.requests[E.id]},x}function m(b){for(var x="self.ready = WebAssembly.instantiate(new Uint8Array(["+new Uint8Array(r)+"]), {}).then(function(result) { result.instance.exports.__wasm_call_ctors(); return result.instance; });self.onmessage = "+A.name+";"+c.toString()+A.toString(),T=new Blob([x],{type:"text/javascript"}),E=URL.createObjectURL(T),v=d.length;v<b;++v)d[v]=g(E);for(var v=b;v<d.length;++v)d[v].object.postMessage({});d.length=b,URL.revokeObjectURL(E)}function y(b,x,T,E,v){for(var S=d[0],I=1;I<d.length;++I)d[I].pending<S.pending&&(S=d[I]);return new Promise(function(R,O){var L=new Uint8Array(T),_=++p;S.pending+=b,S.requests[_]={resolve:R,reject:O},S.object.postMessage({id:_,count:b,size:x,source:L,mode:E,filter:v},[L.buffer])})}function A(b){var x=b.data;self.ready.then(function(T){if(!x.id)return self.close();try{var E=new Uint8Array(x.count*x.size);c(T,T.exports[x.mode],E,x.count,x.size,x.source,T.exports[x.filter]),self.postMessage({id:x.id,count:x.count,action:"resolve",value:E},[E.buffer])}catch(v){self.postMessage({id:x.id,count:x.count,action:"reject",value:v})}})}return{ready:s,supported:!0,useWorkers:function(b){m(b)},decodeVertexBuffer:function(b,x,T,E,v){c(o,o.exports.meshopt_decodeVertexBuffer,b,x,T,E,o.exports[u[v]])},decodeIndexBuffer:function(b,x,T,E){c(o,o.exports.meshopt_decodeIndexBuffer,b,x,T,E)},decodeIndexSequence:function(b,x,T,E){c(o,o.exports.meshopt_decodeIndexSequence,b,x,T,E)},decodeGltfBuffer:function(b,x,T,E,v,S){c(o,o.exports[f[v]],b,x,T,E,o.exports[u[S]])},decodeGltfBufferAsync:function(b,x,T,E,v){return d.length>0?y(b,x,T,f[E],u[v]):s.then(function(){var S=new Uint8Array(b*x);return c(o,o.exports[f[E]],S,b,x,T,o.exports[u[v]]),S})}}})();var $Sn=(function(){var e="b9H79Tebbbe:6eO9Geueu9Geub9Gbb9Gsuuuuuuuuuuuu99uueu9Gvuuuuub9Gruuuuuuub9Gouuuuuue999Gvuuuuueu9Gzuuuuuuuuuuu99uuuub9Gquuuuuuu99uueu9GPuuuuuuuuuuu99uueu9Gquuuuuuuu99ueu9Gruuuuuu99eu9Gwuuuuuu99ueu9Giuuue999Gluuuueu9Gluuuub9GiuuueuiLQdilvorlwDiqkxmPszbHHbelve9Weiiviebeoweuecj:Gdkr:Bdxo9TW9T9VV95dbH9F9F939H79T9F9J9H229F9Jt9VV7bbz9TW79O9V9Wt9F79P9T9W29P9M95bw8E9TW79O9V9Wt9F79P9T9W29P9M959x9Pt9OcttV9P9I91tW7bD8A9TW79O9V9Wt9F79P9T9W29P9M959x9Pt9O9v9W9K9HtWbqQ9TW79O9V9Wt9F79P9T9W29P9M959t29V9W9W95bkX9TW79O9V9Wt9F79P9T9W29P9M959qV919UWbxQ9TW79O9V9Wt9F79P9T9W29P9M959q9V9P9Ut7bmX9TW79O9V9Wt9F79P9T9W29P9M959t9J9H2WbPa9TW79O9V9Wt9F9V9Wt9P9T9P96W9wWVtW94SWt9J9O9sW9T9H9Wbs59TW79O9V9Wt9F9NW9UWV9HtW9q9V79Pt9P9V9U9sW9T9H9Wbzl79IV9RbHDwebcekdCXq;y;WeQdbk;r:herYue99iuY99Xue9:D998Jjjjjbcj;sb9Rgs8Kjjjjbcbhzasc:Cefcbc;Kbz:tjjjb8AdnabaeSmbabaeadcdtzMjjjb8AkdnamcdGTmbalcrfci4cbyd1:H:cjbHjjjjbbhHasc:Cefasyd;8egecdtfaHBdbasaecefBd;8ecbhlcbhednadTmbabheadhOinaHaeydbci4fcb86bbaeclfheaOcufgOmbkcbhlabheadhOinaHaeydbgAci4fgCaCRbbgCceaAcrGgAtV86bbaCcu7aA4ceGalfhlaeclfheaOcufgOmbkcualcdtalcFFFFi0Ehekaecbyd1:H:cjbHjjjjbbhzasc:Cefasyd;8egecdtfazBdbasaecefBd;8ealcd4alfhOcehHinaHgecethHaeaO6mbkcbhXcuaecdtgOaecFFFFi0Ecbyd1:H:cjbHjjjjbbhHasc:Cefasyd;8egAcdtfaHBdbasaAcefBd;8eaHcFeaOz:tjjjbhQdnadTmbaecufhLcbhKindndnaQabaKcdtfgYydbgAc:v;t;h;Ev2aLGgOcdtfgCydbgHcuSmbceheinazaHcdtfydbaASmdaOaefhHaecefheaQaHaLGgOcdtfgCydbgHcu9hmbkkazaXcdtfaABdbaCaXBdbaXhHaXcefhXkaYaHBdbaKcefgKad9hmbkkaQcbyd:m:H:cjbH:bjjjbbasasyd;8ecufBd;8ekcbh8AcualcefgecdtaecFFFFi0Ecbyd1:H:cjbHjjjjbbhLasc:Cefasyd;8egecdtfaLBdbasaLBdNeasaecefBd;8ecuadcitadcFFFFe0Ecbyd1:H:cjbHjjjjbbhEasc:Cefasyd;8egecdtfaEBdbasaEBd:yeasaecefBd;8eascNefabadalcbz:cjjjbcualcdtgealcFFFFi0Eg3cbyd1:H:cjbHjjjjbbhOasc:Cefasyd;8egHcdtfaOBdbasaHcefBd;8ea3cbyd1:H:cjbHjjjjbbhQasc:Cefasyd;8egHcdtfaQBdbasaHcefBd;8eaOaQaialavazasc:Cefz:djjjbalcbyd1:H:cjbHjjjjbbhYasc:Cefasyd;8egHcdtfaYBdbasaHcefBd;8ea3cbyd1:H:cjbHjjjjbbhHasc:Cefasyd;8egAcdtfaHBdbasaAcefBd;8ea3cbyd1:H:cjbHjjjjbbhAasc:Cefasyd;8egCcdtfaABdbasaCcefBd;8eaHcFeaez:tjjjbh5aAcFeaez:tjjjbh8EdnalTmbindnaLa8AgAcefg8AcdtfydbgCaLaAcdtgefydbgHSmbaCaH9Rh8FaEaHcitfhaa8Eaefhha5aefhKcbhCindndnaaaCcitfydbgXaA9hmbaKaABdbahaABdbxekdnaLaXcdtggfgeclfydbgHaeydbgeSmbaHae9RhHaEaecitfheinaeydbaASmdaecwfheaHcufgHmbkka8EagfgeaAaXaeydbcuSEBdbaKaXaAaKydbcuSEBdbkaCcefgCa8F9hmbkka8Aal9hmbkaOhHaQhAa5hXa8EhCcbheindndnaeaHydbgK9hmbdnaeaAydbgK9hmbaXydbhKdnaCydbg8Fcu9hmbaKcu9hmbaYaefcb86bbxikdna8FcuSmbaKcuSmbaea8FSmbaOa8FcdtfydbaOaKcdtfydb9hmbaYaefcd86bbxikaYaefhadnaea8FSmbaeaKSmbaace86bbxikaacl86bbxdkdnaeaQaKcdtg8Ffydb9hmbdnaCydbgacuSmbaeaaSmbaXydbggcuSmbaeagSmba8Ea8FfydbghcuSmbahaKSmba5a8Ffydbg8FcuSmba8FaKSmbdnaOaacdtfydbgKaOa8Fcdtfydb9hmbaKaOagcdtfydbg8FSmba8FaOahcdtfydb9hmbaYaefcd86bbxlkaYaefcl86bbxikaYaefcl86bbxdkaYaefcl86bbxekaYaefaYaKfRbb86bbkaHclfhHaAclfhAaXclfhXaCclfhCalaecefge9hmbkdnamcaGTmbcbh8JindndnaYa8Jfg8KRbbg8Lc9:fPibebekdndndnaOa8Jcdtfydbgea8J9hmbdnaqmbcbh8FxdkdnazTmbcbh8Fa8JheinaqazaecdtgefydbfRbbce4a8FVceGh8FaQaefydbgea8J9hmbxikkcbh8Fa8JheinaqaefRbbce4a8FVceGh8FaQaecdtfydbgea8J9hmbxdkkaYaefRbbhexeka8JheindnaLaecdtg8AfgeclfydbgHaeydbgeSmbaHae9RhgaEaecitfhhaOa8AfhacbhKinahaKcitfydbgXhednindnaLaecdtgCfgeclfydbgHaeydbgeSmbaHae9RhHaEaecitfheaaydbhAdninaOaeydbcdtfydbaASmeaecwfheaHcufgHTmdxbkkcbhexdkaQaCfydbgeaX9hmbkceheka8FaeVh8FaKcefgKag9hmbkkaQa8Afydbgea8J9hmbka8Lcia8FceGEheka8Kae86bbka8Jcefg8Jal9hmbkkdnaqTmbdndnazTmbazheaOhHalhAindnaqaeydbfRbbceGTmbaYaHydbfcl86bbkaeclfheaHclfhHaAcufgAmbxdkkaqheaOhHalhAindnaeRbbceGTmbaYaHydbfcl86bbkaecefheaHclfhHaAcufgAmbkkaOhealhAaYhHindnaYaeydbfRbbcl9hmbaHcl86bbkaeclfheaHcefhHaAcufgAmbkkamceGTmbaYhealhHindnaeRbbce9hmbaecl86bbkaecefheaHcufgHmbkkcbh8Mcualcx2alc;v:Q;v:Qe0Ecbyd1:H:cjbHjjjjbbh8Nasc:Cefasyd;8egecdtfa8NBdbasaecefBd;8eascbBd:qeas9cb83i1ea8Naialavazasc1efz:ejjjbhydndnaDmbcbh8PcbhCxekcbhCawhecbhHindnaeIdbJbbbb9ETmbasaCcdtfaHBdbaCcefhCkaeclfheaDaHcefgH9hmbkcuaCal2gecdtaecFFFFi0Ecbyd1:H:cjbHjjjjbbh8Pasc:Cefasyd;8egecdtfa8PBdbasaecefBd;8ealTmbdnaCmbcbhCxekarcd4hgdnazTmbaCcdthhcbh8Fa8Phainaoaza8Fcdtfydbag2cdtfhKasheaahHaChAinaHaKaeydbcdtgXfIdbawaXfIdbNUdbaeclfheaHclfhHaAcufgAmbkaaahfhaa8Fcefg8Fal9hmbxdkkaCcdthhcbh8Fa8Phainaoa8Fag2cdtfhKasheaahHaChAinaHaKae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d;8egecdtfa9iBdbasaecefBd;8ecua9ialabadaOz:fjjjbgXcltaXcjjjjiGEcbyd1:H:cjbHjjjjbbh9hasc:Cefasyd;8egecdtfa9hBdbasaecefBd;8ea9haXa9ia8Nalz:gjjjbJFFuuh8SaXTmba9hheaXhHinaeIdbgRa8Sa8SaR9EEh8SaeclfheaHcufgHmbkaXhSkdnalTmbaLclfheaLydbhXaYhHalhKcbhAincbaeydbg8FaX9RaHRbbcpeGEaAfhAaHcefhHaeclfhea8FhXaKcufgKmbkaAce4hAkcuadaA9Rcifg6cx2a6c;v:Q;v:Qe0Ecbyd1:H:cjbHjjjjbbh9kasc:Cefasyd;8egecdtfa9kBdbasaecefBd;8ecua6cdta6cFFFFi0Ecbyd1:H:cjbHjjjjbbh0asc:Cefasyd;8egecdtfa0BdbasaecefBd;8ea3cbyd1:H:cjbHjjjjbbh9masc:Cefasyd;8egecdtfa9mBdbasaecefBd;8ealcbyd1:H:cjbHjjjjbbh9nasc:Cefasyd;8egecdtfa9nBdbasaecefBd;8eaxaxNayJbbjZamclGEgZaZN:vh87JbbbbhUdnadak9nmbdna6ci6mbaCclth9oa9kcwfh9pJbbbbh85JbbbbhUinascNefabadalaOz:cjjjbabh8Acbh9qcbh9rinaba9rcdtfhDcbheindnaOa8AaefydbgAcdtghfydbgXaOaDaec:W:G:cjbfydbcdtfydbgHcdtg8JfydbgKSmbaYaHfRbbgacv2aYaAfRbbg8FfRb;a:G:cjbg8La8Fcv2aafg8KRb;a:G:cjbg3VcFeGTmbdnaKaX9nmba8KRb;G:G:cjbcFeGmekdna8FcufcFeGce0mbaaTmba5ahfydbaH9hmekdna8FTmbaacufcFeGce0mba8Ea8JfydbaA9hmeka9ka9qcx2fgXaHaAa3cFeGgKEBdlaXaAaHaKEBdbaXaKa8LGcb9hBdwa9qcefh9qkaeclfgecx9hmbkdna9rcifg9rad9pmba8Acxfh8Aa9qcifa69nmekka9qTmdcbh8KinaIaOa9ka8Kcx2fghydbgKcdtgXfydbg8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dbNMMMg8Va8VM:tNaRMhRaHclfhHaeczfheaAcufgAmbkdndnaDmbJbbbbh8VxekagaXc8S2fgAIdwa8Naacx2fgeIdwg8XNaAIdzaeIdbg8YNaAIdaMg8Va8VMMa8XNaAIdlaeIdlg81NaAIdCa8XNaAId3Mg8Va8VMMa81NaAIdba8YNaAIdxa81NaAIdKMg8Va8VMMa8YNaAId8KMMMh8Va8Pa8JcdtfhHa8Ra8AcltfheaAIdyh80aChAinaHIdbg8Wa8Wa80NaecxfIdba8XaecwfIdbNa8YaeIdbNa81aeclfIdbNMMMg8Wa8WM:tNa8VMh8VaHclfhHaeczfheaAcufgAmbka8V:lh8VkaBaR:lMhBa86a8VMh86kaha86aBa86aB9DgeEUdwahaKa8FaeaDcb9hGgeEBdlaha8FaKaeEBdba8Kcefg8Ka9q9hmbkascjdfcbcj;qbz:tjjjb8Aa9phea9qhHinascjdfaeydbcA4cF8FGgAcFAaAcFA6EcdtfgAaAydbcefBdbaecxfheaHcufgHmbkcbhecbhHinascjdfaefgAydbhXaAaHBdbaXaHfhHaeclfgecj;qb9hmbkcbhea9phHinascjdfaHydbcA4cF8FGgAcFAaAcFA6EcdtfgAaAydbgAcefBdba0aAcdtfaeBdbaHcxfhHa9qaecefge9hmbkadak9RgAci9Uh9sdnalTmbcbhea9mhHinaHaeBdbaHclfhHalaecefge9hmbkkcbh9ta9ncbalz:tjjjbh3aAcO9Uh9ua9sce4h9rcbh8Lcbh8Kdnina9ka0a8Kcdtfydbcx2fg8JIdwgRa879Emea8La9s9pmeJFFuuh8Vdna9ra9q9pmba9ka0a9rcdtfydbcx2fIdwJbb;aZNh8VkdnaRa8V9ETmbaRaU9ETmba8La9u0mdkdna3aOa8JydlgDcdtg9vfg8AydbgAfg9wRbba3aOa8Jydbghcdtg9xfydbgefg9yRbbVmbaYahfRbbh9zdndnaLaecdtfgHclfydbgXaHydbgHSmbaXaH9RhXa8NaAcx2fh8Fa8Naecx2fhaaEaHcitfheindna9maeydbcdtfydbgHaASmba9maeclfydbcdtfydbgKaASmbaHaKSmba8NaKcx2fgKIdba8NaHcx2fgHIdbg8W:tgRaaIdlaHIdlg8X:tg80NaKIdla8X:tg8VaaIdba8W:tgBN:tg8YaRa8FIdla8X:tg86Na8Va8FIdba8W:tg8UN:tg8XNa8VaaIdwaHIdwg81:tg8ZNaKIdwa81:tg8Wa80N:tg80a8Va8FIdwa81:tg83Na8Wa86N:tg8VNa8WaBNaRa8ZN:tg81a8Wa8UNaRa83N:tgRNMMa8Ya8YNa80a80Na81a81NMMa8Xa8XNa8Va8VNaRaRNMMN:rJbbj8:N9FmikaecwfheaXcufgXmbkkdndndndna9zc9:fPdebdkahheina8AydbhAdndna5aecdtgHfydbgecuSmbaOaecdtfydbaASmekdna8EaHfydbgecuSmbaOaecdtfydbaASmekaDheka9maHfaeBdbaQaHfydbgeah9hmbxikkdna8Ea5a5a9xfydbaDSEaQa9xfydbghcdtfydbgecu9hmbaQa9vfydbheka9ma9xfaDBdbaehDka9mahcdtfaDBdbka9yce86bba9wce86bba8JIdwgRaUaUaR9DEhUa9tcefh9tcecda9zceSEa8Lfh8Lxeka9rcefh9rka8Kcefg8Ka9q9hmbkka9tTmddnalTmbcbh8Fcbhhindna9mahcdtgefydbgAahSmbaOaAcdtfydbh8AdnahaOaefydb9hg8JmbaIa8Ac8S2fgeaIahc8S2fgHIdbaeIdbMUdbaeaHIdlaeIdlMUdlaeaHIdwaeIdwMUdwaeaHIdxaeIdxMUdxaeaHIdzaeIdzMUdzaeaHIdCaeIdCMUdCaeaHIdKaeIdKMUdKaeaHId3aeId3MUd3aeaHIdaaeIdaMUdaaeaHId8KaeId8KMUd8KaeaHIdyaeIdyMUdya8MTmba8Ma8Acltfgea8MahcltfgHIdbaeIdbMUdbaeaHIdlaeIdlMUdlaeaHIdwaeIdwMUdwaeaHIdxaeIdxMUdxkaCTmbagaAc8S2fgeagahc8S2gDfgHIdbaeIdbMUdbaeaHIdlaeIdlMUdlaeaHIdwaeIdwMUdwaeaHIdxaeIdxMUdxaeaHIdzaeIdzMUdzaeaHIdCaeIdCMUdCaeaHIdKaeIdKMUdKaeaHId3aeId3MUd3aeaHIdaaeIdaMUdaaeaHId8KaeId8KMUd8KaeaHIdyaeIdyMUdya9oaA2haa8RhHaChXinaHaafgeaHa8FfgAIdbaeIdbMUdbaeclfgKaAclfIdbaKIdbMUdbaecwfgKaAcwfIdbaKIdbMUdbaecxfgeaAcxfIdbaeIdbMUdbaHczfhHaXcufgXmbka8JmbJbbbbJbbjZaIaDfgeIdygR:vaRJbbbb9BEaeIdwa8Na8Acx2fgHIdwgRNaeIdzaHIdbg8VNaeIdaMg8Wa8WMMaRNaeIdlaHIdlg8WNaeIdCaRNaeId3MgRaRMMa8WNaeIdba8VNaeIdxa8WNaeIdKMgRaRMMa8VNaeId8KMMM:lNgRa85a85aR9DEh85ka8Fa9ofh8Fahcefghal9hmbkcbhHa5heindnaeydbgAcuSmbdnaHa9maAcdtgXfydbgA9hmbcuhAa5aXfydbgXcuSmba9maXcdtfydbhAkaeaABdbkaeclfhealaHcefgH9hmbkcbhHa8EheindnaeydbgAcuSmbdnaHa9maAcdtgXfydbgA9hmbcuhAa8EaXfydbgXcuSmba9maXcdtfydbhAkaeaABdbkaeclfhealaHcefgH9hmbkka85aUaCEh85cbhHabhecbhAindnaOa9maeydbcdtfydbg8FcdtfydbgXaOa9maeclfydbcdtfydbgacdtfydbgKSmbaXaOa9maecwfydbcdtfydbg8AcdtfydbghSmbaKahSmbabaHcdtfgXa8FBdbaXcwfa8ABdbaXclfaaBdbaHcifhHkaecxfheaAcifgAad6mbkdndnaTmbaHhdxekdnaHak0mbaHhdxekdna8Sa859FmbaHhdxekJFFuuh8ScbhdabhecbhAindna9ha9iaeydbgXcdtfydbcdtfIdbgRa859ETmbaeclf8Pdbh9AabadcdtfgKaXBdbaKclfa9A83dbaRa8Sa8SaR9EEh8SadcifhdkaecxfheaAcifgAaH6mbkkadak0mbxdkkascNefabadalaOz:cjjjbkdndnadak0mbadhaxekdnaTmbadhaxekdna8Sa879FmbadhaxekcehKina8SJbb;aZNgRa87aRa879DEh8WJbbbbhRdnaSTmba9hheaShHinaeIdbg8VaRa8Va8W9FEaRa8VaR9EEhRaeclfheaHcufgHmbkkJFFuuh8ScbhaabhecbhHindna9ha9iaeydbgAcdtfydbcdtfIdbg8Va8W9ETmbaeclf8Pdbh9AabaacdtfgXaABdbaXclfa9A83dba8Va8Sa8Sa8V9EEh8SaacifhakaecxfheaHcifgHad6mbkdnaKaaad9hVceGmbadhaxdkaRaUaUaR9DEhUaaak9nmecbhKaahda8Sa879FmbkkdnamcjjjjdGTmba9ncbalz:tjjjbh8AdnaaTmbabheaahHina8AaeydbgAfce86bba8AaOaAcdtfydbfce86bbaeclfheaHcufgHmbkkascNefabaaalaOz:cjjjbdndnalTmbcbhXindna8AaXfRbbTmbdnaYaXfRbbgecl0mbceaetcQGmekdnaOaXcdtg8FfydbgeaXSmba8NaXcx2fgHa8Naecx2fgeydwBdwaHae8Pdb83dbxekaIaXc8S2fgKIdygcacJL:3;rUNgRMh87aKIdwg9BaRMh8SaKIdlg9CaRMh8UaKIdbg9DaRMh81aKIdag9EaRa8NaXcx2fg8JIdwg88N:th8ZaKId3g9FaRa8JIdlg89N:th83aKIdKg9Ga8JIdbg8:aRN:th80JbbbbhnaKIdCg9HJbbbbMh85aKIdzg9IJbbbbMhBaKIdxg9JJbbbbMh86dndnaCTmbaXhAinJbbbba87agaAc8S2fgHIdygR:vaRJbbbb9BEhRa8RaAaC2cltfheaHIdaa87Na8ZMh8ZaHId3a87Na83Mh83aHIdKa87Na80Mh80aHIdCa87Na85Mh85aHIdza87NaBMhBaHIdxa87Na86Mh86aHIdwa87Na8SMh8SaHIdla87Na8UMh8UaHIdba87Na81Mh81aChHina8ZaecwfIdbg8VaecxfIdbg8YNaRN:th8Za83aeclfIdbg8Wa8YNaRN:th83a85a8Wa8VNaRN:th85a81aeIdbg8Xa8XNaRN:th81a80a8Xa8YNaRN:th80aBa8Xa8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BdbaYaHfRbbc3thOdna5aHcdtfydbaASmbcjjjj94cba8EaEfydbaHSEhCkaXaOaCVaHVBdbaecxfheaLcifgLaa6mbkkdnazTmbaaTmbaaheinabazabydbcdtfydbBdbabclfhbaecufgembkkdnaPTmbaPaZaU:rNUdbkdnasyd;8egHTmbaHcdtasc:Ceffc98fheinaeydbcbyd:m:H:cjbH:bjjjbbaec98fheaHcufgHmbkkascj;sbf8Kjjjjbaak;Yieouabydlhvabydbclfcbaicdtz:tjjjbhoadci9UhrdnadTmbdnalTmbaehwadhDinaoalawydbcdtfydbcdtfgqaqydbcefBdbawclfhwaDcufgDmbxdkkaehwadhDinaoawydbcdtfgqaqydbcefBdbawclfhwaDcufgDmbkkdnaiTmbcbhDaohwinawydbhqawaDBdbawclfhwaqaDfhDaicufgimbkkdnadci6mbinaecwfydbhwaeclfydbhDaeydbhidnalTmbalawcdtfydbhwalaDcdtfydbhDalaicdtfydbhikavaoaicdtfgqydbcitfaDBdbavaqydbcitfawBdlaqaqydbcefBdbavaoaDcdtfgqydbcitfawBdbavaqydbcitfaiBdlaqaqydbcefBdbavaoawcdtfgwydbcitfaiBdbavawydbcitfaDBdlawawydbcefBdbaecxfhearcufgrmbkkabydbcbBdbk:todDue99aicd4aifhrcehwinawgDcethwaDar6mbkcuaDcdtgraDcFFFFi0Ecbyd1:H:cjbHjjjjbbhwaoaoyd9GgqcefBd9GaoaqcdtfawBdbawcFearz:tjjjbhkdnaiTmbalcd4hlaDcufhxcbhminamhDdnavTmbavamcdtfydbhDkcbadaDal2cdtfgDydlgwawcjjjj94SEgwcH4aw7c:F:b:DD2cbaDydbgwawcjjjj94SEgwcH4aw7c;D;O:B8J27cbaDydwgDaDcjjjj94SEgDcH4aD7c:3F;N8N27axGhwamcdthPdndndnavTmbakawcdtfgrydbgDcuSmeadavaPfydbal2cdtfgsIdbhzcehqinaqhrdnadavaDcdtfydbal2cdtfgqIdbaz9CmbaqIdlasIdl9CmbaqIdwasIdw9BmlkarcefhqakawarfaxGgwcdtfgrydbgDcu9hmbxdkkakawcdtfgrydbgDcuSmbadamal2cdtfgsIdbhzcehqinaqhrdnadaDal2cdtfgqIdbaz9CmbaqIdlasIdl9CmbaqIdwasIdw9BmikarcefhqakawarfaxGgwcdtfgrydbgDcu9hmbkkaramBdbamhDkabaPfaDBdbamcefgmai9hmbkkakcbyd:m:H:cjbH:bjjjbbaoaoyd9GcufBd9GdnaeTmbaiTmbcbhDaehwinawaDBdbawclfhwaiaDcefgD9hmbkcbhDaehwindnaDabydbgrSmbawaearcdtfgrydbBdbaraDBdbkabclfhbawclfhwaiaDcefgD9hmbkkk;:odvuv998Jjjjjbca9Rgocbyd1:G:cjbBdKaocb8Pdj:G:cjb83izaocbydN:G:cjbBdwaocb8Pd:m:G:cjb83ibdnadTmbaicd4hrdnabmbdnalTmbcbhwinaealawcdtfydbar2cdtfhDcbhiinaoczfaifgqaDaifIdbgkaqIdbgxaxak9EEUdbaoaifgqakaqIdbgxaxak9DEUdbaiclfgicx9hmbkawcefgwad9hmbxikkarcdthwcbhDincbhiinaoczfaifgqaeaifIdbgkaqIdbgxaxak9EEUdbaoaifgqakaqIdbgxaxak9DEUdbaiclfgicx9hmbkaeawfheaDcefgDad9hmbxdkkdnalTmbcbhwinabawcx2fgiaealawcdtfydbar2cdtfgDIdbUdbaiaDIdlUdlaiaDIdwUdwcbhiinaoczfaifgqaDaifIdbgkaqIdbgxaxak9EEUdbaoaifgqakaqIdbgxaxak9DEUdbaiclfgicx9hmbkawcefgwad9hmbxdkkarcdthlcbhwaehDinabawcx2fgiaeawar2cdtfgqIdbUdbaiaqIdlUdlaiaqIdwUdwcbhiinaoczfaifgqaDaifIdbgkaqIdbgxaxak9EEUdbaoaifgqakaqIdbgxaxak9DEUdbaiclfgicx9hmbkaDalfhDawcefgwad9hmbkkJbbbbaoIdbaoIdzgx:tgkakJbbbb9DEgkaoIdlaoIdCgm:tgPaPak9DEgkaoIdwaoIdKgP:tgsasak9DEhsdnabTmbadTmbJbbbbJbbjZas:vasJbbbb9BEhkinabakabIdbax:tNUdbabclfgoakaoIdbam:tNUdbabcwfgoakaoIdbaP:tNUdbabcxfhbadcufgdmbkkdnavTmbavaPUdwavamUdlavaxUdbkask:WlewudnaeTmbcbhvabhoinaoavBdbaoclfhoaeavcefgv9hmbkkdnaiTmbcbhrinadarcdtfhwcbhDinalawaDcdtgvyd:G:G:cjbcdtfydbcdtfydbhodnalawavfydbcdtfydbgqabaqcdtfgkydbgvSmbinakabavgqcdtfgxydbgvBdbaxhkaqav9hmbkkdnaoabaocdtfgkydbgvSmbinakabavgocdtfgxydbgvBdbaxhkaoav9hmbkkdnaqaoSmbabaqaoaqao0Ecdtfaqaoaqao6EBdbkaDcefgDci9hmbkarcifgrai6mbkkdnaembcbskcbhxindnalaxcdtgvfydbax9hmbaxhodnaxabavfgDydbgvSmbaDhqinaqabavgocdtfgkydbgvBdbakhqaoav9hmbkkaDaoBdbkaxcefgxae9hmbkcbhkabhvcbhoindndnaoalydbgq9hmbdnaoavydbgq9hmbavakBdbakcefhkxdkavabaqcdtfydbBdbxekavabaqcdtfydbBdbkalclfhlavclfhvaeaocefgo9hmbkakk;jiilud99euabcbaecltz:tjjjbhvdnalTmbadhoaihralhwinarcwfIdbhDarclfIdbhqavaoydbcltfgkarIdbakIdbMUdbakaqakIdlMUdlakaDakIdwMUdwakakIdxJbbjZMUdxaoclfhoarcxfhrawcufgwmbkkdnaeTmbavhkaehrinakcxfgoIdbhDaocbBdbakakIdbJbbbbJbbjZaD:vaDJbbbb9BEgDNUdbakclfgoaDaoIdbNUdbakcwfgoaDaoIdbNUdbakczfhkarcufgrmbkkdnalTmbinavadydbcltfgkaicwfIdbakIdw:tgDaDNaiIdbakIdb:tgDaDNaiclfIdbakIdl:tgDaDNMMgDakIdxgqaqaD9DEUdxadclfhdaicxfhialcufglmbkkdnaeTmbavcxfhkinabakIdbUdbakczfhkabclfhbaecufgembkkk:moerudnaoTmbaecd4hzdnavTmbaicd4hHavcdthOcbhAindnaPaAfRbbTmbaAhednaDTmbaDaAcdtfydbhekdnasTmbasaefRbbceGmekdnamaAfRbbclSmbabaeaz2cdtfgiaraAcx2fgCIdbakNaxIdbMUdbaiaCIdlakNaxIdlMUdlaiaCIdwakNaxIdwMUdwkadaeaH2cdtfhXaqheawhiavhCinaXaeydbcdtgQfaiIdbalaQfIdb:vUdbaeclfheaiclfhiaCcufgCmbkkawaOfhwaAcefgAao9hmbxdkkdnasmbcbheaDhiindnaPaefRbbTmbaehCdnaDTmbaiydbhCkamaefRbbclSmbabaCaz2cdtfgCarIdbakNaxIdbMUdbaCarclfIdbakNaxIdlMUdlaCarcwfIdbakNaxIdwMUdwkaiclfhiarcxfhraoaecefge9hmbxdkkdnaDTmbindnaPRbbTmbasaDydbgefRbbceGmbamRbbclSmbabaeaz2cdtfgearIdbakNaxIdbMUdbaearclfIdbakNaxIdlMUdlaearcwfIdbakNaxIdwMUdwkaPcefhPaDclfhDamcefhmarcxfhraocufgombxdkkazcdthicbheindnaPaefRbbTmbasaefRbbceGmbamaefRbbclSmbabarIdbakNaxIdbMUdbabclfarclfIdbakNaxIdlMUdbabcwfarcwfIdbakNaxIdwMUdbkarcxfhrabaifhbaoaecefge9hmbkkk8MbabaeadaialavcbcbcbcbcbaoarawaDz:bjjjbk8MbabaeadaialavaoarawaDaqakaxamaPz:bjjjbkRbababaeadaialavaoarawaDaqakaxcjjjjdVamz:bjjjbk:g8Koque99due99duq998Jjjjjbc;Wb9Rgq8Kjjjjbcbhkaqcxfcbc;Kbz:tjjjb8Aaqcualcx2alc;v:Q;v:Qe0Ecbyd1:H:cjbHjjjjbbgxBdxaqceBd2axaialavcbcbz:ejjjb8AaqcualcdtalcFFFFi0Egmcbyd1:H:cjbHjjjjbbgiBdzaqcdBd2dndnJFF959eJbbjZawJbbjZawJbbjZ9DE:vawJ9VO:d869DEgw:lJbbb9p9DTmbaw:OhPxekcjjjj94hPkadci9Uhsarco9UhzdndnaombaPcd9imekdnalTmbaPcuf:YhwdnaoTmbcbhvaihHaxhOindndnaoavfRbbceGTmbavcjjjjlVhAxekdndnaOclfIdbawNJbbbZMgC:lJbbb9p9DTmbaC:OhAxekcjjjj94hAkaAcqthAdndnaOcwfIdbawNJbbbZMgC:lJbbb9p9DTmbaC:OhXxekcjjjj94hXkaAaXVhAdndnaOIdbawNJbbbZMgC:lJbbb9p9DTmbaC:OhXxekcjjjj94hXkaAaXcCtVhAkaHaABdbaHclfhHaOcxfhOalavcefgv9hmbxdkkaxhvaihOalhHindndnavIdbawNJbbbZMgC:lJbbb9p9DTmbaC:OhAxekcjjjj94hAkaAcCthAdndnavclfIdbawNJbbbZMgC:lJbbb9p9DTmbaC:OhXxekcjjjj94hXkaXcqtaAVhAdndnavcwfIdbawNJbbbZMgC:lJbbb9p9DTmbaC:OhXxekcjjjj94hXkaOaAaXVBdbavcxfhvaOclfhOaHcufgHmbkkadTmbcbhkaehvcbhOinakaiavclfydbcdtfydbgHaiavcwfydbcdtfydbgA9haiavydbcdtfydbgXaH9haXaA9hGGfhkavcxfhvaOcifgOad6mbkkarci9UhQdndnaz:Z:rJbbbZMgw:lJbbb9p9DTmbaw:Ohvxekcjjjj94hvkaQ:ZhLcbhKc:bwhzdninakaQ9pmeazaP9Rcd9imeavazcufgOavaO9iEaPcefavaP9kEhYdnalTmbaYcuf:YhwdnaoTmbcbhOaihHaxhvindndnaoaOfRbbceGTmbaOcjjjjlVhAxekdndnavclfIdbawNJbbbZMgC:lJbbb9p9DTmbaC:OhAxekcjjjj94hAkaAcqthAdndnavcwfIdbawNJbbbZMgC:lJbbb9p9DTmbaC:OhXxekcjjjj94hXkaAaXVhAdndnavIdbawNJbbbZMgC:lJbbb9p9DTmbaC:OhXxekcjjjj94hXkaAaXcCtVhAkaHaABdbaHclfhHavcxfhvalaOcefgO9hmbxdkkaxhvaihOalhHindndnavIdbawNJbbbZMgC:lJbbb9p9DTmbaC:OhAxekcjjjj94hAkaAcCthAdndnavclfIdbawNJbbbZMgC:lJbbb9p9DT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Ohrxekcjjjj94hrkaHaXarVBdbaOcxfhOaHclfhHaAcufgAmbkkaKcFeaYz:tjjjbhravcufhocbhPcbhYindndndnaraiaYcdtgKfydbgAcm4aA7c:v;t;h;Ev2gvcs4av7aoGgHcdtfgXydbgOcuSmbcehvinaiaOcdtgOfydbaASmdaHavfhOavcefhvaraOaoGgHcdtfgXydbgOcu9hmbkkaXaYBdbaPhvaPcefhPxekazaOfydbhvkazaKfavBdbaYcefgYal9hmbkcuaPc8S2gOaPc;D;O;f8U0EhvkcbhXaqavcbyd1:H:cjbHjjjjbbgvBd3aqcvBd2avcbaOz:tjjjbhOdnadTmbaehiinaxaiclfydbgrcx2fgvIdbaxaiydbgocx2fgHIdbg3:tgCaxaicwfydbgYcx2fgAIdlaHIdlg8A:tgwNavIdla8A:tgEaAIdba3:tg8EN:tgLaLNaEaAIdwaHIdwg5:tg8FNavIdwa5:tgEawN:tgwawNaEa8ENaCa8FN:tgCaCNMMg8E:rhEJbbnnJbbjZazaocdtfydbgvazarcdtfydbgASavazaYcdtfydbgrSGgHEh8Fdna8EJbbbb9ETmbaLaE:vhLaCaE:vhCawaE:vhwkaOavc8S2fgvavIdbawa8FaE:rNgEawNNg8FMUdbavaCaEaCNgaNghavIdlMUdlavaLaEaLNg8ENggavIdwMUdwavawaaNgaavIdxMUdxava8EawNg8JavIdzMUdzavaCa8ENg8EavIdCMUdCavawaEaLa5Nawa3Na8AaCNMM:mg8ANg3NgwavIdKMUdKavaCa3NgCavId3MUd3avaLa3NgLavIdaMUdaava3a8ANg3avId8KMUd8KavaEavIdyMUdydnaHmbaOaAc8S2fgva8FavIdbMUdbavahavIdlMUdlavagavIdwMUdwavaaavIdxMUdxava8JavIdzMUdzava8EavIdCMUdCavawavIdKMUdKavaCavId3MUd3avaLavIdaMUdaava3avId8KMUd8KavaEavIdyMUdyaOarc8S2fgva8FavIdbMUdbavahavIdlMUdlavagavIdwMUdwavaaavIdxMUdxava8JavIdzMUdzava8EavIdCMUdCavawavIdKMUdKavaCavId3MUd3avaLavIdaMUdaava3avId8KMUd8KavaEavIdyMUdykaicxfhiaXcifgXad6mbkkcbhAaqcuaPcdtgvaPcFFFFi0Egicbyd1:H:cjbHjjjjbbgHBdaaqcoBd2aqaicbyd1:H:cjbHjjjjbbgiBd8KaqcrBd2aHcFeavz:tjjjbhYdnalTmbazhHinJbbbbJbbjZaOaHydbgXc8S2fgvIdygw:vawJbbbb9BEavIdwaxcwfIdbgwNavIdzaxIdbgCNavIdaMgLaLMMawNavIdlaxclfIdbgLNavIdCawNavId3MgwawMMaLNavIdbaCNavIdxaLNavIdKMgwawMMaCNavId8KMMM:lNhwdndnaYaXcdtgvfgXydbcuSmbaiavfIdbaw9ETmekaXaABdbaiavfawUdbkaHclfhHaxcxfhxalaAcefgA9hmbkkdndnaPmbJbbbbhwxekJbbbbhwinaiIdbgCawawaC9DEhwaiclfhiaPcufgPmbkaw:rhwkakcd4akfhOcehiinaigvcethiavaO6mbkcbhOaqcuavcdtgiavcFFFFi0Ecbyd1:H:cjbHjjjjbbgHBdyaHcFeaiz:tjjjbhXdnadTmbavcufhrcbhPcbhxindnazaeaxcdtfgvydbcdtfydbgiazavclfydbcdtfydbgOSmbaiazavcwfydbcdtfydbgvSmbaOavSmbaYavcdtfydbhAdndnaYaOcdtfydbgvaYaicdtfydbgi9pmbavaA9pmbaAhlaihoavhAxekdnaAai9pmbaAav9pmbaihlavhoxekavhlaAhoaihAkabaPcx2fgvaABdbavcwfaoBdbavclfalBdbdnaXaoc:3F;N8N2alc:F:b:DD27aAc;D;O:B8J27arGgOcdtfgvydbgicuSmbcehHinaHhvdnabaicx2fgiydbaA9hmbaiydlal9hmbaiydwaoSmikavcefhHaXaOavfarGgOcdtfgvydbgicu9hmbkkavaPBdbaPcefhPkaxcifgxad6mbkaPci2hOkcwhvaDTmekaDawUdbkavcdthvaqcxfc98fhiinaiavfydbcbyd:m:H:cjbH:bjjjbbavc98fgvmbkaqc;Wbf8KjjjjbaOk:3ldrue9:8Jjjjjbc;Wb9Rgr8Kjjjjbcbhwarcxfcbc;Kbz:tjjjb8AdnabaeSmbabaeadcdtzMjjjb8AkarcualcdtalcFFFFi0EgDcbyd1:H:cjbHjjjjbbgqBdxarceBd2aqcbaialavcbarcxfz:djjjbcualcx2alc;v:Q;v:Qe0Ecbyd1:H:cjbHjjjjbbhkarcxfaryd2gxcdtfakBdbaraxcefgmBd2akaialavcbcbz:ejjjb8AarcxfamcdtfaDcbyd1:H:cjbHjjjjbbgiBdbaraxcdfgvBd2arcxfavcdtfcuaialaeadaqz:fjjjbgecltaecjjjjiGEcbyd1:H:cjbHjjjjbbgqBdbaqaeaiakalz:gjjjbaxcifhkdnadTmbaoaoNhocbhwabhlcbheindnaqaialydbgvcdtfydbcdtfIdbao9ETmbalclf8PdbhPabawcdtfgDavBdbaDclfaP83dbawcifhwkalcxfhlaecifgead6mbkkdnakTmbaxcdtarcxffcwfhlinalydbcbyd:m:H:cjbH:bjjjbbalc98fhlakcufgkmbkkarc;Wbf8Kjjjjbawk:WCoDud99vue99vuv998Jjjjjbc;Wb9Rgw8KjjjjbdndnarmbcbhDxekawcxfcbc;Kbz:tjjjb8Aawcuadcx2adc;v:Q;v:Qe0Ecbyd1:H:cjbHjjjjbbgqBdxawceBd2aqaeadaicbcbz:ejjjb8AawcuadcdtadcFFFFi0Egkcbyd1:H:cjbHjjjjbbgxBdzawcdBd2adcd4adfhmceheinaegicetheaiam6mbkcbhPawcuaicdtgsaicFFFFi0Ecbyd1:H:cjbHjjjjbbgzBdCawciBd2dndnar:ZgH:rJbbbZMgO:lJbbb9p9DTmbaO:Ohexekcjjjj94hekaicufhAc:bwhCcbhXadhQcbhLinaeaCcufgiaeai9iEaPcefaeaP9kEhDdndnadTmbaDcuf:YhOaqhiaxheadhmindndnaiIdbaONJbbbZMgK:lJbbb9p9DTmbaK:OhYxekcjjjj94hYkaYcCthYdndnaiclfIdbaONJbbbZMgK:lJbbb9p9DTmbaK:Oh8Axekcjjjj94h8Aka8AcqtaYVhYdndnaicwfIdbaONJbbbZMgK:lJbbb9p9DTmbaK:Oh8Axekcjjjj94h8AkaeaYa8AVBdbaicxfhiaeclfheamcufgmmbkazcFeasz:tjjjbhEcbh3cbh5indnaEaxa5cdtfydbgYcm4aY7c:v;t;h;Ev2gics4ai7aAGgmcdtfg8AydbgecuSmbaeaYSmbcehiinaEamaifaAGgmcdtfg8AydbgecuSmeaicefhiaeaY9hmbkka8AaYBdba3aecuSfh3a5cefg5ad9hmbxdkkazcFeasz:tjjjb8Acbh3kdnaQ:ZgKaH:taD:YgOaC:Y:tg8ENaX:Zg8Fa3:Zga:tNa8FaH:taOaP:Y:tghNaaaK:tNMggJbbbb9BmbaKa8F:taha8EaaaH:tNNNag:vaOMhOkaPaDa3ar0giEhPaXa3aiEhXdna3arSmbaDaCaiEgCaP9Rcd9imbdndnaLcl0mbdnaOJbbbZMgO:lJbbb9p9DTmbaO:Ohexdkcjjjj94hexekaPaCfcd9Theka3aQaiEhQaLcefgLcs9hmekkdndnaXmbcihicbhDxekcbhiawakcbyd1:H:cjbHjjjjbbg5BdKawclBd2aPcuf:YhKdndnadTmbaqhiaxheadhmindndnaiIdbaKNJbbbZMgO:lJbbb9p9DTmbaO:OhYxekcjjjj94hYkaYcCthYdndnaiclfIdbaKNJbbbZMgO:lJbbb9p9DTmbaO:Oh8Axekcjjjj94h8Aka8AcqtaYVhYdndnaicwfIdbaKNJbbbZMgO:lJbbb9p9DTmbaO:Oh8Axekcjjjj94h8AkaeaYa8AVBdbaicxfhiaeclfheamcufgmmbkazcFeasz:tjjjbhEcbhDcbh3indndndnaEaxa3cdtgCfydbgYcm4aY7c:v;t;h;Ev2gics4ai7aAGgmcdtfg8AydbgecuSmbcehiinaxaecdtgefydbaYSmdamaifheaicefhiaEaeaAGgmcdtfg8Aydbgecu9hmbkka8Aa3BdbaDhiaDcefhDxeka5aefydbhika5aCfaiBdba3cefg3ad9hmbkcuaDc32giaDc;j:KM;jb0EhexekazcFeasz:tjjjb8AcbhDcbhekawaecbyd1:H:cjbHjjjjbbgeBd3awcvBd2aecbaiz:tjjjbh8Aavcd4hxdnadTmbdnalTmbaxcdthEa5hYaqhealhmadhAina8AaYydbc32fgiaeIdbaiIdbMUdbaiaeclfIdbaiIdlMUdlaiaecwfIdbaiIdwMUdwaiamIdbaiIdxMUdxaiamclfIdbaiIdzMUdzaiamcwfIdbaiIdCMUdCaiaiIdKJbbjZMUdKaYclfhYaecxfheamaEfhmaAcufgAmbxdkka5hmaqheadhYina8Aamydbc32fgiaeIdbaiIdbMUdbaiaeclfIdbaiIdlMUdlaiaecwfIdbaiIdwMUdwaiaiIdxJbbbbMUdxaiaiIdzJbbbbMUdzaiaiIdCJbbbbMUdCaiaiIdKJbbjZMUdKamclfhmaecxfheaYcufgYmbkkdnaDTmba8AhiaDheinaiaiIdbJbbbbJbbjZaicKfIdbgO:vaOJbbbb9BEgONUdbaiclfgmaOamIdbNUdbaicwfgmaOamIdbNUdbaicxfgmaOamIdbNUdbaiczfgmaOamIdbNUdbaicCfgmaOamIdbNUdbaic3fhiaecufgembkkcbhYawcuaDcdtgCaDcFFFFi0Egicbyd1:H:cjbHjjjjbbgeBdaawcoBd2awaicbyd1:H:cjbHjjjjbbgEBd8KaecFeaCz:tjjjbh3dnadTmbaoJbbjZJbbjZaK:vaPceSENgOaONhKaxcdthxalheinaKaec;8:G:cjbalEgmIdwa8Aa5ydbgAc32fgiIdC:tgOaONamIdbaiIdx:tgOaONamIdlaiIdz:tgOaONMMNaqcwfIdbaiIdw:tgOaONaqIdbaiIdb:tgOaONaqclfIdbaiIdl:tgOaONMMMhOdndna3aAcdtgifgmydbcuSmbaEaifIdbaO9ETmekamaYBdbaEaifaOUdbka5clfh5aqcxfhqaeaxfheadaYcefgY9hmbkkaba3aCzMjjjb8Acrhikaicdthiawcxfc98fheinaeaifydbcbyd:m:H:cjbH:bjjjbbaic98fgimbkkawc;Wbf8KjjjjbaDk:Pdidui99ducbhi8Jjjjjbca9Rglcbyd1:G:cjbBdKalcb8Pdj:G:cjb83izalcbydN:G:cjbBdwalcb8Pd:m:G:cjb83ibdndnaembJbbjFhvJbbjFhoJbbjFhrxekadcd4cdthwincbhdinalczfadfgDabadfIdbgvaDIdbgoaoav9EEUdbaladfgDavaDIdbgoaoav9DEUdbadclfgdcx9hmbkabawfhbaicefgiae9hmbkalIdwalIdK:thralIdlalIdC:thoalIdbalIdz:thvkJbbbbavavJbbbb9DEgvaoaoav9DEgvararav9DEk9DeeuabcFeaicdtz:tjjjbhlcbhbdnadTmbindnalaeydbcdtfgiydbcu9hmbaiabBdbabcefhbkaeclfheadcufgdmbkkabk;Bidqui998Jjjjjbc;Wb9Rgl8Kjjjjbalcxfcbc;Kbz:tjjjb8Aadcd4adfhvcehoinaogrcethoarav6mbkalcuarcdtgoarcFFFFi0Ecbyd1:H:cjbHjjjjbbgvBdxavcFeaoz:tjjjbhwdnadTmbaicd4hDarcufhqcbhkindndnawcbaeakaD2cdtfgrydlgiaicjjjj94SEgocH4ao7c:F:b:DD2cbarydbgxaxcjjjj94SEgocH4ao7c;D;O:B8J27cbarydwgmamcjjjj94SEgrcH4ar7c:3F;N8N27aqGgvcdtfgrydbgocuSmbam::hPai::hsax::hzcehiinaihrdnaeaoaD2cdtfgiIdbaz9CmbaiIdlas9CmbaiIdwaP9BmikarcefhiawavarfaqGgvcdtfgrydbgocu9hmbkkarakBdbakhokabakcdtfaoBdbakcefgkad9hmbkkalydxcbyd:m:H:cjbH:bjjjbbalc;Wbf8Kjjjjbk9teiucbcbyd:q:H:cjbgeabcifc98GfgbBd:q:H:cjbdndnabZbcztgd9nmbcuhiabad9RcFFifcz4nbcuSmekaehikaik;LeeeudndnaeabVciGTmbabhixekdndnadcz9pmbabhixekabhiinaiaeydbBdbaiclfaeclfydbBdbaicwfaecwfydbBdbaicxfaecxfydbBdbaeczfheaiczfhiadc9Wfgdcs0mbkkadcl6mbinaiaeydbBdbaeclfheaiclfhiadc98fgdci0mbkkdnadTmbinaiaeRbb86bbaicefhiaecefheadcufgdmbkkabk;aeedudndnabciGTmbabhixekaecFeGc:b:c:ew2hldndnadcz9pmbabhixekabhiinaialBdbaicxfalBdbaicwfalBdbaiclfalBdbaiczfhiadc9Wfgdcs0mbkkadcl6mbinaialBdbaiclfhiadc98fgdci0mbkkdnadTmbinaiae86bbaicefhiadcufgdmbkkabk9teiucbcbyd:q:H:cjbgeabcrfc94GfgbBd:q:H:cjbdndnabZbcztgd9nmbcuhiabad9RcFFifcz4nbcuSmekaehikaikTeeucbabcbyd:q:H:cjbge9Rcifc98GaefgbBd:q:H:cjbdnabZbcztge9nmbabae9RcFFifcz4nb8Akkk:Kedbcj:Gdk1eFFuuFFuuFFuuFFuFFFuFFFuFbbbbbbbbebbbdbbbbbbbebbbebbbdbbbbbbbbbbbeeeeebebbebbebebbbeebbbbbbbbbbbbeeeeeebebbeeebeebbbbebebbbbbbbbbbbbbbbbbbc1:Hdkxebbbdbbb:G:qbb",t=new Uint8Array([32,0,65,2,1,106,34,33,3,128,11,4,13,64,6,253,10,7,15,116,127,5,8,12,40,16,19,54,20,9,27,255,113,17,42,67,24,23,146,148,18,14,22,45,70,69,56,114,101,21,25,63,75,136,108,28,118,29,73,115]);if(typeof WebAssembly!="object")return{supported:!1};var n,i=WebAssembly.instantiate(r(e),{}).then(function(x){n=x.instance,n.exports.__wasm_call_ctors()});function r(x){for(var T=new Uint8Array(x.length),E=0;E<x.length;++E){var v=x.charCodeAt(E);T[E]=v>96?v-97:v>64?v-39:v+4}for(var S=0,E=0;E<x.length;++E)T[S++]=T[E]<60?t[T[E]]:(T[E]-60)*64+T[++E];return T.buffer.slice(0,S)}function o(x){if(!x)throw new Error("Assertion failed")}function s(x){return new Uint8Array(x.buffer,x.byteOffset,x.byteLength)}function a(x,T,E,v){var S=n.exports.sbrk,I=S(E*4),R=S(E*v*4),O=new Uint8Array(n.exports.memory.buffer);O.set(s(T),R),x(I,R,E,v*4),O=new Uint8Array(n.exports.memory.buffer);var L=new Uint32Array(E);return new Uint8Array(L.buffer).set(O.subarray(I,I+E*4)),S(I-S(0)),L}function c(x,T,E){var v=n.exports.sbrk,S=v(T.length*4),I=v(E*4),R=new Uint8Array(n.exports.memory.buffer),O=s(T);R.set(O,S);var L=x(I,S,T.length,E);R=new Uint8Array(n.exports.memory.buffer);var _=new Uint32Array(E);new Uint8Array(_.buffer).set(R.subarray(I,I+E*4)),v(S-v(0));for(var C=0;C<T.length;++C)T[C]=_[T[C]];return[_,L]}function u(x){for(var T=0,E=0;E<x.length;++E){var v=x[E];T=T<v?v:T}return T}function f(x,T,E,v,S,I,R,O,L){var _=n.exports.sbrk,C=_(4),w=_(E*4),P=_(S*I),M=_(E*4),F=new Uint8Array(n.exports.memory.buffer);F.set(s(v),P),F.set(s(T),M);var V=x(w,M,E,P,S,I,R,O,L,C);F=new Uint8Array(n.exports.memory.buffer);var B=new Uint32Array(V);s(B).set(F.subarray(w,w+V*4));var j=new Float32Array(1);return s(j).set(F.subarray(C,C+4)),_(C-_(0)),[B,j[0]]}function d(x,T,E,v,S,I,R,O,L,_,C,w,P){var M=n.exports.sbrk,F=M(4),V=M(E*4),B=M(S*I),j=M(S*O),k=M(L.length*4),G=M(E*4),q=_?M(S):0,Q=new Uint8Array(n.exports.memory.buffer);Q.set(s(v),B),Q.set(s(R),j),Q.set(s(L),k),Q.set(s(T),G),_&&Q.set(s(_),q);var W=x(V,G,E,B,S,I,j,O,k,L.length,q,C,w,P,F);Q=new Uint8Array(n.exports.memory.buffer);var J=new Uint32Array(W);s(J).set(Q.subarray(V,V+W*4));var Z=new Float32Array(1);return s(Z).set(Q.subarray(F,F+4)),M(F-M(0)),[J,Z[0]]}function p(x,T,E,v,S,I,R,O,L,_,C,w,P){var M=n.exports.sbrk,F=M(4),V=M(S*I),B=M(S*O),j=M(L.length*4),k=M(E*4),G=_?M(S):0,q=new Uint8Array(n.exports.memory.buffer);q.set(s(v),V),q.set(s(R),B),q.set(s(L),j),q.set(s(T),k),_&&q.set(s(_),G);var Q=x(k,E,V,S,I,B,O,j,L.length,G,C,w,P,F);q=new Uint8Array(n.exports.memory.buffer),s(T).set(q.subarray(k,k+Q*4)),s(v).set(q.subarray(V,V+S*I)),s(R).set(q.subarray(B,B+S*O));var W=new Float32Array(1);return s(W).set(q.subarray(F,F+4)),M(F-M(0)),[Q,W[0]]}function g(x,T,E,v){var S=n.exports.sbrk,I=S(E*v),R=new Uint8Array(n.exports.memory.buffer);R.set(s(T),I);var O=x(I,E,v);return S(I-S(0)),O}function m(x,T,E,v,S,I,R,O){var L=n.exports.sbrk,_=L(O*4),C=L(E*v),w=S?L(E*I):0,P=new Uint8Array(n.exports.memory.buffer);P.set(s(T),C),S&&P.set(s(S),w);var M=x(_,C,E,v,w,I,R,O);P=new Uint8Array(n.exports.memory.buffer);var F=new Uint32Array(M);return s(F).set(P.subarray(_,_+M*4)),L(_-L(0)),F}function y(x,T,E,v,S,I,R,O,L){var _=n.exports.sbrk,C=_(4),w=_(E*4),P=_(S*I),M=_(E*4),F=R?_(S):0,V=new Uint8Array(n.exports.memory.buffer);V.set(s(v),P),V.set(s(T),M),R&&V.set(s(R),F);var B=x(w,M,E,P,S,I,F,O,L,C);V=new Uint8Array(n.exports.memory.buffer);var j=new Uint32Array(B);s(j).set(V.subarray(w,w+B*4));var k=new Float32Array(1);return s(k).set(V.subarray(C,C+4)),_(C-_(0)),[j,k[0]]}function A(x,T,E,v,S,I,R){var O=n.exports.sbrk,L=O(E*4),_=O(S*I),C=O(E*4),w=new Uint8Array(n.exports.memory.buffer);w.set(s(v),_),w.set(s(T),C);var P=x(L,C,E,_,S,I,R);w=new Uint8Array(n.exports.memory.buffer);var M=new Uint32Array(P);return s(M).set(w.subarray(L,L+P*4)),O(L-O(0)),M}var b={LockBorder:1,Sparse:2,ErrorAbsolute:4,Prune:8,Regularize:16,Permissive:32,RegularizeLight:64,_InternalDebug:1<<30};return{ready:i,supported:!0,compactMesh:function(x){o(x instanceof Uint32Array||x instanceof Int32Array||x instanceof Uint16Array||x instanceof Int16Array),o(x.length%3==0);var T=x.BYTES_PER_ELEMENT==4?x:new Uint32Array(x),E=c(n.exports.meshopt_optimizeVertexFetchRemap,T,u(x)+1);if(x!==T)for(var v=0;v<T.length;++v)x[v]=T[v];return E},generatePositionRemap:function(x,T){return o(x instanceof Float32Array),o(x.length%T==0),o(T>=3),a(n.exports.meshopt_generatePositionRemap,x,x.length/T,T)},simplify:function(x,T,E,v,S,I){o(x instanceof Uint32Array||x instanceof Int32Array||x instanceof Uint16Array||x instanceof Int16Array),o(x.length%3==0),o(T instanceof Float32Array),o(T.length%E==0),o(E>=3),o(v>=0&&v<=x.length),o(v%3==0),o(S>=0);for(var R=0,O=0;O<(I?I.length:0);++O)o(I[O]in b),R|=b[I[O]];var L=x.BYTES_PER_ELEMENT==4?x:new Uint32Array(x),_=f(n.exports.meshopt_simplify,L,x.length,T,T.length/E,E*4,v,S,R);return _[0]=x instanceof Uint32Array?_[0]:new x.constructor(_[0]),_},simplifyWithAttributes:function(x,T,E,v,S,I,R,O,L,_){o(x instanceof Uint32Array||x instanceof Int32Array||x instanceof Uint16Array||x instanceof Int16Array),o(x.length%3==0),o(T instanceof Float32Array),o(T.length%E==0),o(E>=3),o(v instanceof Float32Array),o(v.length==S*(T.length/E)),o(S>=0),o(R==null||R instanceof Uint8Array),o(R==null||R.length==T.length/E),o(O>=0&&O<=x.length),o(O%3==0),o(L>=0),o(Array.isArray(I)),o(S>=I.length),o(I.length<=32);for(var C=0;C<I.length;++C)o(I[C]>=0);for(var w=0,C=0;C<(_?_.length:0);++C)o(_[C]in b),w|=b[_[C]];var P=x.BYTES_PER_ELEMENT==4?x:new Uint32Array(x),M=d(n.exports.meshopt_simplifyWithAttributes,P,x.length,T,T.length/E,E*4,v,S*4,new Float32Array(I),R,O,L,w);return M[0]=x instanceof Uint32Array?M[0]:new x.constructor(M[0]),M},simplifyWithUpdate:function(x,T,E,v,S,I,R,O,L,_){o(x instanceof Uint32Array||x instanceof Int32Array||x instanceof Uint16Array||x instanceof Int16Array),o(x.length%3==0),o(T instanceof Float32Array),o(T.length%E==0),o(E>=3),o(v instanceof Float32Array),o(v.length==S*(T.length/E)),o(S>=0),o(R==null||R instanceof Uint8Array),o(R==null||R.length==T.length/E),o(O>=0&&O<=x.length),o(O%3==0),o(L>=0),o(Array.isArray(I)),o(S>=I.length),o(I.length<=32);for(var C=0;C<I.length;++C)o(I[C]>=0);for(var w=0,C=0;C<(_?_.length:0);++C)o(_[C]in b),w|=b[_[C]];var P=x.BYTES_PER_ELEMENT==4?x:new Uint32Array(x),M=p(n.exports.meshopt_simplifyWithUpdate,P,x.length,T,T.length/E,E*4,v,S*4,new Float32Array(I),R,O,L,w);if(x!==P)for(var C=0;C<M[0];++C)x[C]=P[C];return M},getScale:function(x,T){return o(x instanceof Float32Array),o(x.length%T==0),o(T>=3),g(n.exports.meshopt_simplifyScale,x,x.length/T,T*4)},simplifyPoints:function(x,T,E,v,S,I){return o(x instanceof Float32Array),o(x.length%T==0),o(T>=3),o(E>=0&&E<=x.length/T),v?(o(v instanceof Float32Array),o(v.length%S==0),o(S>=3),o(x.length/T==v.length/S),m(n.exports.meshopt_simplifyPoints,x,x.length/T,T*4,v,S*4,I||0,E)):m(n.exports.meshopt_simplifyPoints,x,x.length/T,T*4,void 0,0,0,E)},simplifySloppy:function(x,T,E,v,S,I){o(x instanceof Uint32Array||x instanceof Int32Array||x instanceof Uint16Array||x instanceof Int16Array),o(x.length%3==0),o(T instanceof Float32Array),o(T.length%E==0),o(E>=3),o(v==null||v instanceof Uint8Array),o(v==null||v.length==T.length/E),o(S>=0&&S<=x.length),o(S%3==0),o(I>=0);var R=x.BYTES_PER_ELEMENT==4?x:new Uint32Array(x),O=y(n.exports.meshopt_simplifySloppy,R,x.length,T,T.length/E,E*4,v,S,I);return O[0]=x instanceof Uint32Array?O[0]:new x.constructor(O[0]),O},simplifyPrune:function(x,T,E,v){o(x instanceof Uint32Array||x instanceof Int32Array||x instanceof Uint16Array||x instanceof Int16Array),o(x.length%3==0),o(T instanceof Float32Array),o(T.length%E==0),o(E>=3),o(v>=0);var S=x.BYTES_PER_ELEMENT==4?x:new Uint32Array(x),I=A(n.exports.meshopt_simplifyPrune,S,x.length,T,T.length/E,E*4,v);return I=x instanceof Uint32Array?I:new x.constructor(I),I}}})();var ZSn=(function(){var e="b9H79Tebbbe:neP9Geueu9Geub9Gbb9Giuuueu9Gmuuuuuuuuuuu9999eu9Gouuuuuueu9Gruuuuuuub9Gxuuuuuuuuuuuueu9Gxuuuuuuuuuuu99eu9GPuuuuuuuuuuuuu99b9Gouuuuuub9Gwuuuuuuuub9Gvuuuuub9GluuuubiQXdilvorwDqokoqxmbiibeilve9Weiiviebeoweuecj:Gdkr;Zeqo9TW9T9VV95dbH9F9F939H79T9F9J9H229F9Jt9VV7bb8A9TW79O9V9Wt9F9I919P29K9nW79O2Wt79c9V919U9KbeY9TW79O9V9Wt9F9I919P29K9nW79O2Wt7S2W94bd39TW79O9V9Wt9F9I919P29K9nW79O2Wt79t9W9Ht9P9H2bo39TW79O9V9Wt9F9J9V9T9W91tWJ2917tWV9c9V919U9K7bw39TW79O9V9Wt9F9J9V9T9W91tW9nW79O2Wt9c9V919U9K7bkE9TW79O9V9Wt9F9J9V9T9W91tW9t9W9OWVW9c9V919U9K7bxL9TW79O9V9Wt9F9V9Wt9P9T9P96W9nW79O2WtbPl79IV9RbsDwebcekdOAq;W:leXdbkIbabaec9:fgefcufae9Ugeabci9Uadfcufad9Ugbaeab0Ek:88JDPue99eux99due99euo99iu8Jjjjjbc:WD9Rgm8KjjjjbdndnalmbcbhPxekamc:Cwfcbc;Kbz:rjjjb8AcuaocdtgsaocFFFFi0Ehzcbyd;0:G:cjbhHdndnalcb9imbaoal9nmbamazaHHjjjjbbgHBd:CwamceBd;8wamazcbyd;0:G:cjbHjjjjbbgOBd:GwamcdBd;8wamcualcdtalcFFFFi0Ecbyd;0:G:cjbHjjjjbbgABd:KwamciBd;8waihzalhsinaHazydbcdtfcbBdbazclfhzascufgsmbkaihzalhsinaHazydbcdtfgCaCydbcefBdbazclfhzascufgsmbkaihzalhCcbhXindnaHazydbcdtgQfgsydbcb9imbaOaQfaXBdbasasydbgQcjjjj94VBdbaQaXfhXkazclfhzaCcufgCmbkalci9UhLdnalci6mbcbhzaihsinascwfydbhCasclfydbhXaOasydbcdtfgQaQydbgQcefBdbaAaQcdtfazBdbaOaXcdtfgXaXydbgXcefBdbaAaXcdtfazBdbaOaCcdtfgCaCydbgCcefBdbaAaCcdtfazBdbascxfhsaLazcefgz9hmbkkaihzalhsindnaHazydbcdtgCfgXydbgQcu9kmbaXaQcFFFFrGgQBdbaOaCfgCaCydbaQ9RBdbkazclfhzascufgsmbxdkkamazaHHjjjjbbgHBd:CwamceBd;8wamazcbyd;0:G:cjbHjjjjbbgOBd:GwamcdBd;8wamcualcdtalcFFFFi0Ecbyd;0:G:cjbHjjjjbbgABd:KwamciBd;8waHcbasz:rjjjbhXaihzalhsinaXazydbcdtfgCaCydbcefBdbazclfhzascufgsmbkalci9UhLdnaoTmbcbhzaOhsaXhCaohQinasazBdbasclfhsaCydbazfhzaCclfhCaQcufgQmbkkdnalci6mbcbhzaihsinascwfydbhCasclfydbhQaOasydbcdtfgKaKydbgKcefBdbaAaKcdtfazBdbaOaQcdtfgQaQydbgQcefBdbaAaQcdtfazBdbaOaCcdtfgCaCydbgCcefBdbaAaCcdtfazBdbascxfhsaLazcefgz9hmbkkaoTmbcbhzaohsinaOazfgCaCydbaXazfydb9RBdbazclfhzascufgsmbkkamaLcbyd;0:G:cjbHjjjjbbgzBd:OwamclBd;8wazcbaLz:rjjjbhYamcuaLcK2alcjjjjd0Ecbyd;0:G:cjbHjjjjbbg8ABd:SwamcvBd;8wJbbbbhEdnalci6g3mbarcd4hKaihsa8AhzaLhrJbbbbh5inavasclfydbaK2cdtfgCIdlh8EavasydbaK2cdtfgXIdlhEavascwfydbaK2cdtfgQIdlh8FaCIdwhaaXIdwhhaQIdwhgazaCIdbg8JaXIdbg8KMaQIdbg8LMJbbnn:vUdbazclfaXIdlaCIdlMaQIdlMJbbnn:vUdbaQIdwh8MaCIdwh8NaXIdwhyazcxfa8EaE:tg8Eagah:tggNaaah:tgaa8FaE:tghN:tgEJbbbbJbbjZa8Ja8K:tg8FahNa8Ea8La8K:tg8KN:tghahNaEaENaaa8KNa8FagN:tgEaENMMg8K:rg8E:va8KJbbbb9BEg8KNUdbazczfaEa8KNUdbazcCfaha8KNUdbazcwfa8Maya8NMMJbbnn:vUdba5a8EMh5ascxfhsazcKfhzarcufgrmbka5aL:Z:vJbbbZNhEkamcuaLcdtalcFFFF970Ecbyd;0:G:cjbHjjjjbbgCBd:WwamcoBd;8waq:Zhhdna3mbcbhzaChsinasazBdbasclfhsaLazcefgz9hmbkkaEahNhhamcuaLcltalcFFFFd0Ecbyd;0:G:cjbHjjjjbbg8PBd:0wamcrBd;8wcba8Pa8AaCaLcbz:djjjb8AJFFuuh8MJFFuuh8NJFFuuhydnalci6mbJFFuuhya8AhzaLhsJFFuuh8NJFFuuh8MinazcwfIdbgEa8Ma8MaE9EEh8MazclfIdbgEa8Na8NaE9EEh8NazIdbgEayayaE9EEhyazcKfhzascufgsmbkkah:rhEamaocetgzcuaocu9kEcbyd;0:G:cjbHjjjjbbgCBd:4wdndnaoal9nmbaihzalhsinaCazydbcetfcFFi87ebazclfhzascufgsmbxdkkaCcFeazz:rjjjb8AkaEJbbbZNh8JcuhIdnalci6mbcbhsJFFuuhEa8AhzcuhIinazcwfIdba8M:tghahNazIdbay:tghahNazclfIdba8N:tghahNMM:rghaEaIcuSahaE9DVgXEhEasaIaXEhIazcKfhzaLascefgs9hmbkkamczfcbcjwz:rjjjb8Aam9cb83iwam9cb83ibaxa8JNh8RJbbjZak:th8Lcbh8SJbbbbhRJbbbbh8UJbbbbh8VJbbbbh8WJbbbbh8XJbbbbh8Ycbh8ZcbhPinJbbbbhEdna8STmbJbbjZa8S:Z:vhEkJbbbbhhdna8Ya8YNa8Wa8WNa8Xa8XNMMg8KJbbbb9BmbJbbjZa8K:r:vhhka8VaENh8Ka8UaENh5aRaENh8EaIhLdndndndndna8SaPVTmbamydwg80Tmea8YahNh8Fa8XahNhaa8WahNhgaeamydbcdtfh81cbh3JFFuuhEcvhQcuhLindnaHa81a3cdtfydbcdtgzfydbgvTmbaAaOazfydbcdtfhsindndnaCaiasydbgKcx2fgzclfydbgrcetf8Vebcs4aCazydbgXcetf8Vebcs4faCazcwfydbglcetf8Vebcs4fgombcbhzxekcehzaHaXcdtfydbgXceSmbcehzaHarcdtfydbgrceSmbcehzaHalcdtfydbglceSmbdnarcdSaXcdSfalcdSfcd6mbaocefhzxekaocdfhzkdnazaQ9kmba8AaKcK2fgXIdwa8K:tghahNaXIdba8E:tghahNaXIdla5:tghahNMM:ra8J:va8LNJbbjZMJ9VO:d86JbbjZaXIdCa8FNaXIdxagNaaaXIdzNMMakN:tghahJ9VO:d869DENghaEazaQ6ahaE9DVgXEhEaKaLaXEhLazaQaXEhQkasclfhsavcufgvmbkka3cefg3a809hmbkkaLcu9hmekama8KUd:ODama5Ud:KDama8EUd:GDamcuBd:qDamcFFF;7rBdjDa8Pcba8AaYamc:GDfamc:qDfamcjDfz:ejjjbamyd:qDhLdndnaxJbbbb9ETmba8SaD6mbaLcuSmeceh3amIdjDa8R9EmixdkaLcu9hmekdna8STmbabaPcltfgHam8Piw83dwaHam8Pib83dbaPcefhPkc3hHinamc:CwfaHfydbcbyd;4:G:cjbH:bjjjbbaHc98fgHc989hmbxvkkcbh3a8Saq9pmbamydwaCaiaLcx2fgzydbcetf8Vebcs4aCazcwfydbcetf8Vebcs4faCazclfydbcetf8Vebcs4ffaw9nmekcbhzcbhsdna8ZTmbcbhsamczfhXinamczfascdtfaXydbgQBdbaXclfhXasaYaQfRbbTfhsa8Zcufg8ZmbkkamydwhlamydbhXam9cu83i:GDam9cu83i:ODam9cu83i:qDam9cu83i:yDinamcjDfazfcFFF;7rBdbazclfgzcz9hmbkasc;8easclfc:bd6Eg8Zcdth80dnalTmbaeaXcdtfhocbhrindnaHaoarcdtfydbcdtgzfydbgvTmbaAaOazfydbcdtfhscuhQcuhzinaHaiasydbgKcx2fgXclfydbcdtfydbaHaXydbcdtfydbfaHaXcwfydbcdtfydbfgXazaXaz6gXEhzaKaQaXEhQasclfhsavcufgvmbkaQcuSmba8AaQcK2fgsIdwa8M:tgEaENasIdbay:tgEaENasIdla8N:tgEaENMM:rhEcbhsindndnazamc:qDfasfgvydbgX6mbazaX9hmeaEamcjDfasfIdb9FTmekavazBdbamc:GDfasfaQBdbamcjDfasfaEUdbxdkasclfgscz9hmbkkarcefgral9hmbkkamczfa80fhQcbhzcbhsindnamc:GDfazfydbgXcuSmbaQascdtfaXBdbascefhskazclfgzcz9hmbkasa8Zfg8ZTmbJFFuuhhcuhKamczfhza8ZhvcuhQina8AazydbgXcK2fgsIdwa8M:tgEaENasIdbay:tgEaENasIdla8N:tgEaENMM:rhEdndnaHaiaXcx2fgsclfydbcdtfydbaHasydbcdtfydbfaHascwfydbcdtfydbfgsaQ6mbasaQ9hmeaEah9DTmekaEhhashQaXhKkazclfhzavcufgvmbkaKcuSmbaKhLkdnamaiaLcx2fgrydbarclfydbarcwfydbaCabaeadaPawaqa3z:fjjjbTmbaPcefhPJbbbbhRJbbbbh8UJbbbbh8VJbbbbh8WJbbbbh8XJbbbbh8YkcbhXinaAaOaraXcdtfydbcdtgsfydbcdtfgKhzaHasfgvydbgQhsdnaQTmbdninazydbaLSmeazclfhzascufgsTmdxbkkazaKaQcdtfc98fydbBdbavavydbcufBdbkaXcefgXci9hmbka8AaLcK2fgzIdbhEazIdlhhazIdwh8KazIdxh5azIdzh8EazIdCh8FaYaLfce86bba8Ya8FMh8Ya8Xa8EMh8Xa8Wa5Mh8Wa8Va8KMh8Va8UahMh8UaRaEMhRamydxh8Sxbkkamc:WDf8KjjjjbaPkjoivuv99lu8Jjjjjbca9Rgo8Kjjjjbdndnalcw0mbaiydbhraeabcitfgwalcdtciVBdlawarBdbdnalcd6mbaiclfhralcufhDawcxfhwinarydbhqawcuBdbawc98faqBdbawcwfhwarclfhraDcufgDmbkkalabfhwxekcbhqaocbBdKao9cb83izaocbBdwao9cb83ibJbbjZhkJbbjZhxinadaiaqcdtfydbcK2fhDcbhwinaoczfawfgraDawfIdbgmarIdbgP:tgsaxNaPMgPUdbaoawfgrasamaP:tNarIdbMUdbawclfgwcx9hmbkJbbjZakJbbjZMgk:vhxaqcefgqal9hmbkcbhradcbcecdaoIdlgmaoIdwgP9GEgwaoIdbgsaP9GEawasam9GEgzcdtgwfhHaoczfawfIdbhmaihwalhDinaiarcdtfgqydbhOaqawydbgABdbawaOBdbawclfhwaraHaAcK2fIdbam9DfhraDcufgDmbkdndnarcv6mbavc8X9kmbaralc98f6mekaiydbhraeabcitfgwalcdtciVBdlawarBdbaiclfhralcufhDawcxfhwinarydbhqawcuBdbawc98faqBdbawcwfhwarclfhraDcufgDmbkalabfhwxekaeabcitfgwamUdbawawydlc98GazVBdlabcefaeadaiaravcefgqz:djjjbhDawawydlciGaDabcu7fcdtVBdlaDaeadaiarcdtfalar9Raqz:djjjbhwkaocaf8Kjjjjbawk;Oddvue99dninabaecitfgrydlgwcd4gDTmednawciGgqci9hmbcihqdnawcl6mbabaecitfhbcbheawhqcehkindnaiabydbgDfRbbmbcbhkadaDcK2fgwIdwalIdw:tgxaxNawIdbalIdb:tgxaxNawIdlalIdl:tgxaxNMM:rgxaoIdb9DTmbaoaxUdbavaDBdbarydlhqkabcwfhbaecefgeaqcd46mbkakceGTmikaraqciGBdlskdnabcbaDalaqcdtfIdbarIdb:tgxJbbbb9FEgwaD7aecefgDfgecitfydlabawaDfgDcitfydlVci0mbaraqBdlkabaDadaialavaoz:ejjjbax:laoIdb9Fmbkkkjlevudndnabydwgxaladcetfgm8Vebcs4alaecetfgP8Vebgscs4falaicetfgz8Vebcs4ffaD0mbakmbcbhDabydxaq6mekavawcltfgxab8Pdw83dwaxab8Pdb83dbabydbhDdnabydwgwTmbaoaDcdtfhxawhsinalaxydbcetfcFFi87ebaxclfhxascufgsmbkkabaDawfBdbabydxhxab9cb83dwababydlaxci2fBdlaP8VebhscehDcbhxkdnascztcz91cu9kmbabaxcefBdwaPax87ebaoabydbcdtfaxcdtfaeBdbkdnam8Uebcu9kmbababydwgxcefBdwamax87ebaoabydbcdtfaxcdtfadBdbkdnaz8Uebcu9kmbababydwgxcefBdwazax87ebaoabydbcdtfaxcdtfaiBdbkarabydlfabydxci2faPRbb86bbarabydlfabydxci2fcefamRbb86bbarabydlfabydxci2fcdfazRbb86bbababydxcefBdxaDk:mPrHue99eue99eue99iu8Jjjjjbc;W;Gb9Rgx8KjjjjbdndnalmbcbhmxekcbhPaxc:m;Gbfcbc;Kbz:rjjjb8Aaxcualci9UgscltascjjjjiGEcbyd;0:G:cjbHjjjjbbgzBd:m9GaxceBd;S9GaxcuascK2gHcKfalcpFFFe0Ecbyd;0:G:cjbHjjjjbbgOBd:q9GaxcdBd;S9Gdnalci6gAmbarcd4hCascdthXaOhQazhLinavaiaPcx2fgrydwaC2cdtfhKavarydlaC2cdtfhYavarydbaC2cdtfh8AcbhraLhEinaQarfgma8Aarfg3Idbg5aYarfg8EIdbg8Fa5a8F9DEg5UdbamaKarfgaIdbg8Fa5a8Fa59DEg8FUdbamcxfgma3Idbg5a8EIdbgha5ah9EEg5UdbamaaIdbgha5aha59EEg5UdbaEa8Fa5MJbbbZNUdbaEaXfhEarclfgrcx9hmbkaQcKfhQaLclfhLaPcefgPas9hmbkkaOaHfgr9cb83dbar9cb83dzar9cb83dwaxcuascx2gralc:bjjjl0Ecbyd;0:G:cjbHjjjjbbgHBdN9GaxciBd;S9GascdthgazarfhvaxcwVhPaxclVhCaHh8Jazh8KcbhLinaxcbcj;Gbz:rjjjbhEaLas2cdthadnaAmba8Khrash3inaEarydbgmc8F91cjjjj94Vam7gmcQ4cx2fg8Ea8EydwcefBdwaEamcd4cFrGcx2fg8Ea8EydbcefBdbaEamcx4cFrGcx2fgmamydlcefBdlarclfhra3cufg3mbkkazaafh8AaHaafhXcbhmcbh3cbh8EcbhainaEamfgrydbhQara3BdbarcwfgKydbhYaKaaBdbarclfgrydbhKara8EBdbaQa3fh3aYaafhaaKa8Efh8Eamcxfgmcj;Gb9hmbkdnaAmbcbhravhminamarBdbamclfhmasarcefgr9hmbkavhrashminaEa8Aarydbg3cdtfydbg8Ec8F91a8E7cd4cFrGcx2fg8Ea8Eydbg8EcefBdbaXa8Ecdtfa3Bdbarclfhramcufgmmbka8JhrashminaCa8Aarydbg3cdtfydbg8Ec8F91a8E7cx4cFrGcx2fg8Ea8Eydbg8EcefBdbava8Ecdtfa3BdbarclfhramcufgmmbkavhrashminaPa8Aarydbg3cdtfydbg8Ec8F91cjjjj94Va8E7cQ4cx2fg8Ea8Eydbg8EcefBdbaXa8Ecdtfa3Bdbarclfhramcufgmmbkka8Jagfh8Ja8Kagfh8KaLcefgLci9hmbkaEaocetgrcuaocu9kEcbyd;0:G:cjbHjjjjbbgKBd:y9GaEclBd;S9Gdndnaoal9nmbaihralhminaKarydbcetfcFFi87ebarclfhramcufgmmbxdkkaKcFearz:rjjjb8Akcbh8EaEascbyd;0:G:cjbHjjjjbbg8ABd:C9GaOaHaHascdtfaHascitfa8AascbazaKaiawaDaqakz:hjjjbdndnalci6mba8Ahrashmina8EarRbbfh8EarcefhramcufgmmbkaE9cb83iwaE9cb83ibalawc9:fgrfcufar9UgrasaDfcufaD9Ugmaram0EhYcbhmcbhra8Ehaincbh3dnarTmba8AarfRbbceSh3kamaEaiaHydbcx2fgQydbaQclfydbaQcwfydbaKabaeadamawaqa3a3ce7a8EaY9nVaaamfaY6VGz:fjjjbfhmaHclfhHaaa8AarfRbb9Rhaasarcefgr9hmbkaEydxTmeabamcltfgraE8Piw83dwaraE8Pib83dbamcefhmxekaE9cb83iwaE9cb83ibcbhmkczhrinaEc:m;Gbfarfydbcbyd;4:G:cjbH:bjjjbbarc98fgrc989hmbkkaxc;W;Gbf8Kjjjjbamk:wKDQue99iue99iul9:euw99iu8Jjjjjbc;qb9RgP8Kjjjjbaxhsaxhzdndnavax0gHmbdnavTmbcbhOaehzavhAinawaDazydbcx2fgCcwfydbcetfgX8VebhQawaCclfydbcetfgL8VebhKawaCydbcetfgC8VebhYaXce87ebaLce87ebaCce87ebaOaKcs4aYcs4faQcs4ffhOazclfhzaAcufgAmbkaehzavhAinawaDazydbcx2fgCcwfydbcetfcFFi87ebawaCclfydbcetfcFFi87ebawaCydbcetfcFFi87ebazclfhzaAcufgAmbkcehzaqhsaOaq0mekalce86bbalcefcbavcufz:rjjjb8AxekaPaiBdxaPadBdwaPaeBdlavakaqci9Ug8Aaka8Aak6EaHEgK9RhEaxaK9Rh3aKcufh5aKceth8EaKcdtgCc98fh8FavcitgOaC9Rarfc98fhaascufhhavcufhgaraOfh8JJbbjZas:Y:vh8KcbazceakaxSEg8Lcdtg8M9Rh8NJFFuuhycuh8PcbhIcbh8RinaPclfa8RcdtfydbhQaPcb8Pd:y:G:cjbg8S83i9iaPcb8Pd:q:G:cjbgR83inaPcb8Pd1:G:cjbg8U83iUaPcb8Pdj:G:cjbg8V83i8WaPa8S83iyaPaR83iaaPa8U83iKaPa8V83izaQavcdtgYfh8WcbhXinabaQaXcdtgLfydbcK2fhAcbhzinaPc8WfazfgCaAazfgOIdbg8XaCIdbg8Ya8Xa8Y9DEUdbaCczfgCaOcxfIdbg8XaCIdbg8Ya8Xa8Y9EEUdbazclfgzcx9hmbkaba8WaXcu7cdtfydbcK2fhAcbhzaPIdUh8ZaPId9ih80aPId80h81aPId9ehBaPId8Wh83aPIdnhUinaPczfazfgCaAazfgOIdbg8XaCIdbg8Ya8Xa8Y9DEUdbaCczfgCaOcxfIdbg8XaCIdbg8Ya8Xa8Y9EEUdbazclfgzcx9hmbkaraLfgza80a8Z:tg8XaUa83:tg8YNa8YaBa81:tg8ZNa8Za8XNMMUdbazaYfaPIdyaPIdK:tg8XaPIdaaPIdz:tg8YNa8YaPId8KaPIdC:tg8ZNa8Za8XNMMUdbaXcefgXav9hmbkcbh85dnaHmbcbhAaQhza8JhCavhXinawaDazydbcx2fgOcwfydbcetfgL8Vebh8WawaOclfydbcetfg858Vebh86awaOydbcetfgO8Vebh87aLce87eba85ce87ebaOce87ebaCaAa86cs4a87cs4fa8Wcs4ffgABdbazclfhzaCclfhCaXcufgXmbkavhCinawaDaQydbcx2fgzcwfydbcetfcFFi87ebawazclfydbcetfcFFi87ebawazydbcetfcFFi87ebaQclfhQaCcufgCmbka8Jh85kdndndndndndndndndndndnava8E6mba8Eax9nmeavavaK9UgzaK29Raza320mda5aE9pmqa85Th87ceh8WaEhQxwka5ag9pmDa8Eax9nmixokavaK6mea5aE9pmwcehQaEhXa85Tmixlka5ag6mlxrka5ag9pmokcbhQaghXa85mekJFFuuh8XcbhLa5hzindnazcefgCaK6mbaQavaC9RgOaK6GmbarazcdtfIdbg8YaC:YNaravaz9RcdtfaYfc94fIdbg8ZaO:YNMg80a8X9Embdndna8KaOahf:YNg81:lJbbb9p9DTmba81:OhAxekcjjjj94hAka8ZasaA2aO9R:YNh8Zdndna8Kazasf:YNg81:lJbbb9p9DTmba81:OhOxekcjjjj94hOkamasaO2aC9R:Ya8YNa8ZMNa80Mg8Ya8Xa8Ya8X9DgOEh8XaCaLaOEhLkaza8LfgzaX6mbxlkkJFFuuh8XcbhLaEhCaahAa8FhOaKhzindnazaK6mbaQaCaK6GmbaraOfIdbg8Yaz:YNaAIdbg8ZaC:YNMg80a8X9Embdndna8Ka85aOfydbgYahf:YNg81:lJbbb9p9DTmba81:Oh8Wxekcjjjj94h8Wkamasa8W2aY9R:Yg81a8YNa8Za81NMNa80Mg8Ya8Xa8Ya8X9DgYEh8XazaLaYEhLkaCa8L9RhCaAa8NfhAaOa8MfhOaza8LfgzcufaX6mbxikka85Th87cbh8WaghQkJFFuuh8XcbhLaEhCaahAa8FhOaKhzindnazazaK9UgXaK29RaXa320mbdna8WTmbaCaCaK9UgXaK29RaXa320mekaraOfIdbg8Yaz:YNaAIdbg8ZaC:YNMg80a8X9EmbazhXaChYdna87mba85aOfydbgXhYkdndna8KaYahf:YNg81:lJbbb9p9DTmba81:Oh86xekcjjjj94h86ka8Zasa862aY9R:YNh8Zdndna8KaXahf:YNg81:lJbbb9p9DTmba81:OhYxekcjjjj94hYkamasaY2aX9R:Ya8YNa8ZMNa80Mg8Ya8Xa8Ya8X9DgXEh8XazaLaXEhLkaCa8L9RhCaAa8NfhAaOa8MfhOaza8LfgzcufaQ6mbkkaLTmba8Xay9DTmba8XhyaLhIa8Rh8Pka8Rcefg8Rci9hmbkdndnaoc8X9kmba8Pcb9omeka8Acufh85cbhYindndndnavaY9RaxaYaxfav0Eg8WTmbcbhAaeaYcdtfgzhCa8WhXinawaDaCydbcx2fgOcwfydbcetfgQ8VebhbawaOclfydbcetfgL8VebhrawaOydbcetfgO8VebhKaQce87ebaLce87ebaOce87ebaAarcs4aKcs4fabcs4ffhAaCclfhCaXcufgXmbka8WhOinawaDazydbcx2fgCcwfydbcetfcFFi87ebawaCclfydbcetfcFFi87ebawaCydbcetfcFFi87ebazclfhzaOcufgOmbkaAaq0mekalaYfgzce86bbazcefcba8Wcufz:rjjjb8AxekalaYfgzce86bbazcefcba85z:rjjjb8Aa8Ah8Wka8WaYfgYav9pmdxbkkaravcdtg8WfhLdnaITmbaPclfa8PcdtfydbhzaIhCinaLazydbfcb86bbazclfhzaCcufgCmbkkdnavaI9nmbaPclfa8PcdtfydbaIcdtfhzavaI9RhCinaLazydbfce86bbazclfhzaCcufgCmbkkcbhYindnaYa8PSmbcbhzaraPclfaYcdtfydbgKa8Wz:qjjjbhCavhXaIhOinaKaOazaLaCydbgQfRbbgAEcdtfaQBdbaCclfhCaOaAfhOazaA9RcefhzaXcufgXmbkkaYcefgYci9hmbkabaeadaialaIaocefgCarawaDaqakaxamz:hjjjbabaeaIcdtgzfadazfaiazfalaIfavaI9RaCarawaDaqakaxamz:hjjjbkaPc;qbf8Kjjjjbk:Seeru8Jjjjjbc:q;ab9Rgo8Kjjjjbaoc:q8WfcFecjzz:rjjjb8AcbhrdnadTmbaehwadhDinaoarcdtfawydbgqBdbaoc:q8WfaqcFiGcdtfgkydbhxakaqBdbawclfhwaraxaq9hfhraDcufgDmbkkabaeadaoaraiavz:jjjjbaoc:q;abf8Kjjjjbk;Sqloud99euD998Jjjjjbc:W;ab9Rgr8KjjjjbdndnadTmbaocd4hwcbhDcbhqindnavaeclfydbaw2cdtfgkIdbavaeydbaw2cdtfgxIdbgm:tgPavaecwfydbaw2cdtfgsIdlaxIdlgz:tgHNakIdlaz:tgOasIdbam:tgAN:tgCaCNaOasIdwaxIdwgX:tgQNakIdwaX:tgOaHN:tgHaHNaOaANaPaQN:tgPaPNMMgOJbbbb9Bmbarc8WfaDcltfgkaCaO:rgO:vgCUdwakaPaO:vgPUdlakaHaO:vgHUdbakaCaXNaHamNazaPNMM:mUdxaDcefhDkaecxfheaqcifgqad6mbkab9cb83dyab9cb83daab9cb83dKab9cb83dzab9cb83dwab9cb83dbaDTmearcbBd8Sar9cb83iKar9cb83izarczfavalaoarc8Sfcbcraiz:kjjjbarIdKhQarIdChLarIdzhKar9cb83iwar9cb83ibararc8WfaDczarc8Sfcbcicbz:kjjjbJbbbbhmdnarIdwgzazNarIdbgHaHNarIdlgXaXNMMgCJbbbb9BmbJbbjZaC:r:vhmkazamNhCaXamNhXaHamNhHJbbjZhmarc8WfheaDhvinaecwfIdbaCNaeIdbaHNaXaeclfIdbNMMgzamazam9DEhmaeczfheavcufgvmbkabaQUdwabaLUdlabaKUdbabarId3UdxdndnamJ;n;m;m899FmbJbbbbhzarc8WfheinaecxfIdbaQaecwfIdbgPNaKaeIdbgONaLaeclfIdbgANMMMaCaPNaHaONaXaANMM:vgPazaPaz9EEhzaeczfheaDcufgDmbkabaCUd8KabaXUdaabaHUd3abaQaCazN:tUdKabaLaXazN:tUdCabaKaHazN:tUdzabJbbjZamamN:t:rgmUdydndnaCJbbj:;aCJbbj:;9GEgzJbbjZazJbbjZ9FEJbb;:9cNJbbbZJbbb:;aCJbbbb9GEMgz:lJbbb9p9DTmbaz:Ohexekcjjjj94hekabae86b8UdndnaXJbbj:;aXJbbj:;9GEgzJbbjZazJbbjZ9FEJbb;:9cNJbbbZJbbb:;aXJbbbb9GEMgz:lJbbb9p9DTmbaz:Ohvxekcjjjj94hvkabav86bRdndnaHJbbj:;aHJbbj:;9GEgzJbbjZazJbbjZ9FEJbb;:9cNJbbbZJbbb:;aHJbbbb9GEMgz:lJbbb9p9DTmbaz:Ohwxekcjjjj94hwkabaw86b8SdndnaecKtcK91:YJbb;:9c:vaC:t:lavcKtcK91:YJbb;:9c:vaX:t:lawcKtcK91:YJbb;:9c:vaH:t:lamMMMJbb;:9cNJbbjZMgm:lJbbb9p9DTmbam:Ohexekcjjjj94hekaecFbaecFb9iEhexekabcjjj;8iBdycFbhekabae86b8Vxekab9cb83dyab9cb83daab9cb83dKab9cb83dzab9cb83dwab9cb83dbkarc:W;abf8Kjjjjbk;7woDuo99eue99euv998Jjjjjbcje9Rgw8Kjjjjbawc;abfcbaocdtgDz:rjjjb8Aawc;GbfcbaDz:rjjjb8AawcafhDawhqaohkinaqcFFF97BdbaDcFFF;7rBdbaqclfhqaDclfhDakcufgkmbkavcd4hxaicd4hmdnadTmbaocx2hPcbhsinashzdnarTmbarascdtfydbhzkaeazam2cdtfgDIdwhHaDIdlhOaDIdbhAalazax2cdtfIdbhCcbhDawcafhqawc;Gbfhvawhkawc;abfhiinaCaDc:O:G:cjbfIdbaHNaDc:G:G:cjbfIdbaANaDc:K:G:cjbfIdbaONMMgXMhQazhLdnaXaC:tgXaqIdbgK9DgYmbavydbhLkavaLBdbazhLdnaQakIdbg8A9EmbaiydbhLa8AhQkaiaLBdbakaQUdbaqaXaKaYEUdbaiclfhiakclfhkavclfhvaqclfhqaPaDcxfgD9hmbkascefgsad9hmbkkJbbbbhQcbhLawc;GbfhDawc;abfhqcbhkinalaqydbgvax2cdtfIdbalaDydbgiax2cdtfIdbaeavam2cdtfgvIdwaeaiam2cdtfgiIdw:tgCaCNavIdbaiIdb:tgCaCNavIdlaiIdl:tgCaCNMM:rMMgCaQaCaQ9EgvEhQakaLavEhLaqclfhqaDclfhDaoakcefgk9hmbkJbbbbhCdnaeawc;abfaLcdtgqfydbgkam2cdtfgDIdwaeawc;Gbfaqfydbgvam2cdtfgqIdwgH:tgXaXNaDIdbaqIdbgA:tg8Aa8ANaDIdlaqIdlgE:tgOaONMMgKJbbbb9ETmbaK:rgCalakax2cdtfIdbMalavax2cdtfIdb:taCaCM:vhCkaQJbbbZNhKaXaCNaHMhHaOaCNaEMhOa8AaCNaAMhAdnadTmbcbhqarhkinaqhDdnarTmbakydbhDkdnalaDax2cdtfIdbg3aeaDam2cdtfgDIdwaH:tgQaQNaDIdbaA:tgCaCNaDIdlaO:tgXaXNMMg5:rgEMg8EaK9ETmbJbbbbh8Adna5Jbbbb9ETmba8EaK:taEaEM:vh8Aka8AaQNaHMhHa8AaXNaOMhOa8AaCNaAMhAa3aKaEMMJbbbZNhKkakclfhkadaqcefgq9hmbkkabaKUdxabaHUdwabaOUdlabaAUdbawcjef8Kjjjjbk:reevu8Jjjjjbcj8W9Rgr8Kjjjjbaici2hwcbhDdnaiTmbarhiawhqinaiaeadRbbgkcdtfydbBdbaDakcefgkaDak0EhDaiclfhiadcefhdaqcufgqmbkkabarawaeaDalaoz:jjjjbarcj8Wf8Kjjjjbk:Eeeeu8Jjjjjbca9Rgo8Kjjjjbab9cb83dyab9cb83daab9cb83dKab9cb83dzab9cb83dwab9cb83dbdnadTmbaocbBd3ao9cb83iwao9cb83ibaoaeadaialaoc3falEavcbalEcrcbz:kjjjbabao8Pib83dbabao8Piw83dwkaocaf8Kjjjjbk::meQu8Jjjjjbcjz9Rgv8KjjjjbcbhoavcjPfcbaez:rjjjb8Aavcjxfcbaez:rjjjb8AdnaiTmbadhoaihrinavcjxfaoRbbfgwawRbbcef86bbavcjxfaocefRbbfgwawRbbcef86bbavcjxfaocdfRbbfgwawRbbcef86bbaocifhoarcufgrmbkcbhDcjehoadhqcehkindndnalTmbcbhxcuhmaqhrakhwcuhPinawcufamaoavcjPfarcefRbbgsfRbb9RcFeGgzci6aoavcjPfarRbbgHfRbb9RcFeGgOci6faoavcjPfarcdfRbbgAfRbb9RcFeGgCci6fgXcOtaOcFr7azaCf9RcwtVavcjxfaAfRbbgzavcjxfaHfRbbgHavcjxfasfRbbgsaHas6Egsazas6EcFe7VgsaP9kgzEhmaXcd6gHaxcefgOal9iVce9hmdasaPazEhPaxaOaHEhxarcifhrawai6hsawcefhwasmbxdkkcuhmaqhrakhwcuhxinawcufamaoavcjPfarcefRbbfRbb9RcFeGci6aoavcjPfarRbbfRbb9RcFeGci6faoavcjPfarcdfRbbfRbb9RcFeGci6fgPax9kgsEhmaPce0meaPaxasEhxarcifhrawai6hPawcefhwaPmbkkadamci2fgrcdfRbbhwarcefRbbhxarRbbhPadaDci2fgrcifaramaD9Rci2zNjjjb8AaPavcjPffaocefgo86bbaPavcjxffgmamRbbcuf86bbaxavcjPffao86bbaxavcjxffgmamRbbcuf86bbarcdfaw86bbarcefax86bbaraP86bbawavcjPffao86bbawavcjxffgrarRbbcuf86bbaqcifhqakcefhkaDcefgDai9hmbkcbhzdnalcb9mmbcbhsavcjPfcbaez:rjjjb8Aadcvfhlinadasci2fgxcefgDRbbhoaxcdfgqRbbhrdndnavcjPfaxRbbgmfRbbmbavcjPfarfRbbhwdndndnavcjPfaofRbbTmbawcFeGTmexikawcFeGmdascefgAai9pmdasc980mdascifhQcbhLarcFeGhCamcFeGhXalhwcbhKcbhYinawcufRbbhPawRbbhOcehkdndnawc9:fRbbgHao9hmbaPcFeGamSmekdnaPcFeGao9hmbaOcFeGamSmekaHamSaOcFeGaoSGhkkceh8AaYceGhYdndnaHar9hmbaPcFeGaoSmekdnaPcFeGar9hmbaOcFeGaoSmekaHaoSaOcFeGarSGh8AkakaYVhYaLaHcFeGgHaXSaPcFeGgPaCSGaPaXSaOcFeGgPaCSGVaHaCSaPaXSGVVhLa8AaKceGVhKdnaAcefgPai9pmbawcifhwaAaQ6hHaPhAaHmekkaYTmeaKmekarhwaohPaohHarhOamhrxdkdnaYTaLVceGTmbaYaKTVaLVceGmekamhwarhParhHamhOaohrxekaohwamhPamhHaohOkavcjPfarfce86bbavcjPfawfce86bbaxaH86bbaqar86bbaDaO86bbavcjPfaPfce86bbalcifhlascefgsai9hmbkkavcFeaecetz:rjjjbhwaici2hrindnawadRbbgmcetfgx8Uebgocu9kmbaxaz87ebawcjlfazcdtfabamcdtfydbBdbazhoazcefhzkadao86bbadcefhdarcufgrmbkazcdthokabavcjlfaoz:qjjjb8Aavcjzf8KjjjjbkObabaiaeadcbz:njjjbk9teiucbcbyd;8:G:cjbgeabcifc98GfgbBd;8:G:cjbdndnabZbcztgd9nmbcuhiabad9RcFFifcz4nbcuSmekaehikaik;LeeeudndnaeabVciGTmbabhixekdndnadcz9pmbabhixekabhiinaiaeydbBdbaiclfaeclfydbBdbaicwfaecwfydbBdbaicxfaecxfydbBdbaeczfheaiczfhiadc9Wfgdcs0mbkkadcl6mbinaiaeydbBdbaeclfheaiclfhiadc98fgdci0mbkkdnadTmbinaiaeRbb86bbaicefhiaecefheadcufgdmbkkabk;aeedudndnabciGTmbabhixekaecFeGc:b:c:ew2hldndnadcz9pmbabhixekabhiinaialBdbaicxfalBdbaicwfalBdbaiclfalBdbaiczfhiadc9Wfgdcs0mbkkadcl6mbinaialBdbaiclfhiadc98fgdci0mbkkdnadTmbinaiae86bbaicefhiadcufgdmbkkabk9teiucbcbyd;8:G:cjbgeabcrfc94GfgbBd;8:G:cjbdndnabZbcztgd9nmbcuhiabad9RcFFifcz4nbcuSmekaehikaikTeeucbabcbyd;8:G:cjbge9Rcifc98GaefgbBd;8:G:cjbdnabZbcztge9nmbabae9RcFFifcz4nb8Akk:3qeludndnadch6mbadTmeabaead;8qbbabskabaeSmbdnaeadabfgi9Rcbadcet9R0mbadTmeabaead;8qbbabskaeab7ciGhldndndnabae9pmbdnalTmbadhvabhixikdnabciGmbadhvabhixdkadTmiabaeRbb86bbadcufhvdnabcefgiciGmbaecefhexdkavTmiabaeRbe86beadc9:fhvdnabcdfgiciGmbaecdfhexdkavTmiabaeRbd86bdadc99fhvdnabcifgiciGmbaecifhexdkavTmiabaeRbi86biabclfhiaeclfheadc98fhvxekdnalmbdnaiciGTmbadTmlabadcufgifglaeaifRbb86bbdnalciGmbaihdxekaiTmlabadc9:fgifglaeaifRbb86bbdnalciGmbaihdxekaiTmlabadc99fgifglaeaifRbb86bbdnalciGmbaihdxekaiTmlabadc98fgdfaeadfRbb86bbkadcl6mbdnadc98fgocxGcxSmbaocd4cefciGhiaec98fhlabc98fhvinavadfaladfydbBdbadc98fhdaicufgimbkkaocx6mbaec9Wfhvabc9WfhoinaoadfgicxfavadfglcxfydbBdbaicwfalcwfydbBdbaiclfalclfydbBdbaialydbBdbadc9Wfgdci0mbkkadTmdadhidnadciGglTmbaecufhvabcufhoadhiinaoaifavaifRbb86bbaicufhialcufglmbkkadcl6mdaec98fhlabc98fhvinavaifgecifalaifgdcifRbb86bbaecdfadcdfRbb86bbaecefadcefRbb86bbaeadRbb86bbaic98fgimbxikkavcl6mbdnavc98fglc3Gc3Smbavalcd4cefcrGgdcdt9RhvinaiaeydbBdbaeclfheaiclfhiadcufgdmbkkalc36mbinaiaeydbBdbaiclfaeclfydbBdbaicwfaecwfydbBdbaicxfaecxfydbBdbaiczfaeczfydbBdbaicCfaecCfydbBdbaicKfaecKfydbBdbaic3faec3fydbBdbaecafheaicafhiavc9Gfgvci0mbkkavTmbdndnavcrGgdmbavhlxekavc94GhlinaiaeRbb86bbaicefhiaecefheadcufgdmbkkavcw6mbinaiaeRbb86bbaicefaecefRbb86bbaicdfaecdfRbb86bbaicifaecifRbb86bbaiclfaeclfRbb86bbaicvfaecvfRbb86bbaicofaecofRbb86bbaicrfaecrfRbb86bbaicwfhiaecwfhealc94fglmbkkabkk:pedbcj:GdktFFuuFFuuFFuubbbbFFuFFFuFFFuFbbbbbbjZbbbbbbbbbbbbbbjZbbbbbbbbbbbbbbjZ86;nAZ86;nAZ86;nAZ86;nA:;86;nAZ86;nAZ86;nAZ86;nA:;86;nAZ86;nAZ86;nAZ86;nA:;bc;0:Gdkxebbbdbbbj:qbb",t=new Uint8Array([32,0,65,2,1,106,34,33,3,128,11,4,13,64,6,253,10,7,15,116,127,5,8,12,40,16,19,54,20,9,27,255,113,17,42,67,24,23,146,148,18,14,22,45,70,69,56,114,101,21,25,63,75,136,108,28,118,29,73,115]);if(typeof WebAssembly!="object")return{supported:!1};var n,i=WebAssembly.instantiate(r(e),{}).then(function(y){n=y.instance,n.exports.__wasm_call_ctors()});function r(y){for(var A=new Uint8Array(y.length),b=0;b<y.length;++b){var x=y.charCodeAt(b);A[b]=x>96?x-97:x>64?x-39:x+4}for(var T=0,b=0;b<y.length;++b)A[T++]=A[b]<60?t[A[b]]:(A[b]-60)*64+A[++b];return A.buffer.slice(0,T)}function o(y){if(!y)throw new Error("Assertion failed")}function s(y){return new Uint8Array(y.buffer,y.byteOffset,y.byteLength)}var a=48,c=16;function u(y,A){var b=y.meshlets[A*4+0],x=y.meshlets[A*4+1],T=y.meshlets[A*4+2],E=y.meshlets[A*4+3];return{vertices:y.vertices.subarray(b,b+T),triangles:y.triangles.subarray(x,x+E*3)}}function f(y,A,b,x,T,E,v,S,I,R){var O=n.exports.sbrk,L=n.exports.meshopt_buildMeshletsBound(A.length,E,v),_=O(L*c),C=O(A.length*4),w=O(A.length),P=O(A.byteLength),M=O(b.byteLength),F=new Uint8Array(n.exports.memory.buffer);F.set(s(A),P),F.set(s(b),M);var V=y(_,C,w,P,A.length,M,x,T,E,v,S,I,R);F=new Uint8Array(n.exports.memory.buffer);for(var B=F.subarray(_,_+V*c),j=new Uint32Array(B.buffer,B.byteOffset,B.byteLength/4).slice(),k=0;k<V;++k){var G=j[k*4+0],q=j[k*4+1],x=j[k*4+2],Q=j[k*4+3];n.exports.meshopt_optimizeMeshlet(C+G*4,w+q,Q,x)}var W=V?j[(V-1)*4+0]+j[(V-1)*4+2]:0,J=V?j[(V-1)*4+1]+j[(V-1)*4+3]*3:0,Z={meshlets:j,vertices:new Uint32Array(F.buffer,C,W).slice(),triangles:new Uint8Array(F.buffer,w,J).slice(),meshletCount:V};return O(_-O(0)),Z}function d(y){var A=new Float32Array(n.exports.memory.buffer,y,a/4);return{centerX:A[0],centerY:A[1],centerZ:A[2],radius:A[3],coneApexX:A[4],coneApexY:A[5],coneApexZ:A[6],coneAxisX:A[7],coneAxisY:A[8],coneAxisZ:A[9],coneCutoff:A[10]}}function p(y,A,b,x){var T=n.exports.sbrk,E=[],v=T(A.byteLength),S=T(y.vertices.byteLength),I=T(y.triangles.byteLength),R=T(a),O=new Uint8Array(n.exports.memory.buffer);O.set(s(A),v),O.set(s(y.vertices),S),O.set(s(y.triangles),I);for(var L=0;L<y.meshletCount;++L){var _=y.meshlets[L*4+0],C=y.meshlets[L*4+1],w=y.meshlets[L*4+3];n.exports.meshopt_computeMeshletBounds(R,S+_*4,I+C,w,v,b,x),E.push(d(R))}return T(v-T(0)),E}function g(y,A,b,x){var T=n.exports.sbrk,E=T(a),v=T(y.byteLength),S=T(A.byteLength),I=new Uint8Array(n.exports.memory.buffer);I.set(s(y),v),I.set(s(A),S),n.exports.meshopt_computeClusterBounds(E,v,y.length,S,b,x);var R=d(E);return T(E-T(0)),R}function m(y,A,b,x,T){var E=n.exports.sbrk,v=E(a),S=E(y.byteLength),I=x?E(x.byteLength):0,R=new Uint8Array(n.exports.memory.buffer);R.set(s(y),S),x&&R.set(s(x),I),n.exports.meshopt_computeSphereBounds(v,S,A,b,I,x?T:0);var O=d(v);return E(v-E(0)),O}return{ready:i,supported:!0,buildMeshlets:function(y,A,b,x,T,E){o(y.length%3==0),o(A instanceof Float32Array),o(A.length%b==0),o(b>=3),o(x>=3&&x<=256),o(T>=1&&T<=512),E=E||0;var v=y.BYTES_PER_ELEMENT==4?y:new Uint32Array(y);return f(n.exports.meshopt_buildMeshletsFlex,v,A,A.length/b,b*4,x,T,T,E,0)},buildMeshletsFlex:function(y,A,b,x,T,E,v,S){o(y.length%3==0),o(A instanceof Float32Array),o(A.length%b==0),o(b>=3),o(x>=3&&x<=256),o(T>=1&&E<=512),o(T<=E),v=v||0,S=S||0;var I=y.BYTES_PER_ELEMENT==4?y:new Uint32Array(y);return f(n.exports.meshopt_buildMeshletsFlex,I,A,A.length/b,b*4,x,T,E,v,S)},buildMeshletsSpatial:function(y,A,b,x,T,E,v){o(y.length%3==0),o(A instanceof Float32Array),o(A.length%b==0),o(b>=3),o(x>=3&&x<=256),o(T>=1&&E<=512),o(T<=E),v=v||0;var S=y.BYTES_PER_ELEMENT==4?y:new Uint32Array(y);return f(n.exports.meshopt_buildMeshletsSpatial,S,A,A.length/b,b*4,x,T,E,v)},extractMeshlet:function(y,A){return o(A>=0&&A<y.meshletCount),u(y,A)},computeClusterBounds:function(y,A,b){o(y.length%3==0),o(y.length/3<=512),o(A instanceof Float32Array),o(A.length%b==0),o(b>=3);var x=y.BYTES_PER_ELEMENT==4?y:new Uint32Array(y);return g(x,A,A.length/b,b*4)},computeMeshletBounds:function(y,A,b){return o(A instanceof Float32Array),o(A.length%b==0),o(b>=3),p(y,A,A.length/b,b*4)},computeSphereBounds:function(y,A,b,x){return o(y instanceof Float32Array),o(y.length%A==0),o(A>=3),o(!b||b instanceof Float32Array),o(!b||b.length%x==0),o(!b||x>=1),o(!b||y.length/A==b.length/x),x=x||0,m(y,y.length/A,A*4,b,x*4)}}})();var ewn=(function(){var e="b9H79Tebbbegv9Geueu9Geub9Gbb9Gkuuuuuuuuuuub9Giuuueuirodiblbelve9Weiiviebeoweuecj:Gdkrnlo9TW9T9VV95dbH9F9F939H79T9F9J9H229F9Jt9VV7bbK9TW79O9V9Wt9F9NW9UWV9HtW9u9H9U9NW9Ut7bel79IV9RbdDwebcekdlvq;m8Lodbk:wgvOuw99iuv99vu8Jjjjjbc;Wb9Rgk8Kjjjjbakcxfcbc;Kbz:djjjb8AakcualcdtgxalcFFFFi0Ecbyd:q:G:cjbHjjjjbbgmBdxakceBd2adci9UhPalcd4alfhscehzinazgHcethzaHas6mbkakcuaHcdtgzaHcFFFFi0Ecbyd:q:G:cjbHjjjjbbgsBdzakcdBd2ascFeazz:djjjbhOaDcd4hAarcd4hCavcd4hXdnalTmbaHcufhrcbhvindndnaOcbaiavaX2cdtfgHydlgDaDcjjjj94SEgscH4cbaoavaC2cdtfgzydlgQcs4aQcjjjj94SE7as7c:F:b:DD2cbaHydbgLaLcjjjj94SEgscH4cbazydbgKcs4aKcjjjj94SE7as7c;D;O:B8J27cbaHydwgYaYcjjjj94SEgHcH4cbazydwg8Acs4a8Acjjjj94SE7aH7c:3F;N8N27awavaA2cdtfgHydlgEaHydbg37cFFFFrGgHcm4aH7c:fjjK27arGgscdtfgHydbgzcuSmbaE::h5a3::h8Ea8A::h8FaQ::haaK::hhaY::hgaD::h8JaL::h8KcehDinaDhHdnaiazaX2cdtfgDIdba8K9CmbaDIdla8J9CmbaDIdwag9CmbaoazaC2cdtfgDIdbah9CmbaDIdlaa9CmbaDIdwa8F9CmbawazaA2cdtfgDIdba8E9CmbaDIdla59BmikaHcefhDaOasaHfarGgscdtfgHydbgzcu9hmbkkaHavBdbavhzkamavcdtfazBdbavcefgval9hmbkkaOcbydN:G:cjbH:bjjjbbakceBd2akcualcefgHcdtaHcFFFFi0Ecbyd:q:G:cjbHjjjjbbg8LBdzakcdBd2akcuadcdtadcFFFFi0EgYcbyd:q:G:cjbHjjjjbbg8MBdCakciBd2a8Lclfcbaxz:djjjbhzdnadTmbdnaeTmbaehHadhsinazamaHydbcdtfydbcdtfgDaDydbcefBdbaHclfhHascufgsmbxdkkamhHadhsinazaHydbcdtfgDaDydbcefBdbaHclfhHascufgsmbkkdnalTmbcbhsazhHalhDinaHydbhOaHasBdbaHclfhHaOasfhsaDcufgDmbkkdnadci6gQmbcbhscdhHaPhOindndnaeTmbamaeasfgvydbcdtfhDamavcwfydbcdtfhramavclfydbcdtfhvxekamasfgDcwfhraDclfhvkarydbhravydbhvazaDydbcdtfgDaDydbgDcefBdba8MaDcdtfaHc9:fBdbazavcdtfgDaDydbgDcefBdba8MaDcdtfaHcufBdbazarcdtfgDaDydbgDcefBdba8MaDcdtfaHBdbascxfhsaHclfhHaOcufgOmbkkcbhsa8LcbBdbakcuaPcltadcFFFFd0Ecbyd:q:G:cjbHjjjjbbg8NBdKakclBd2dnaQmbaehza8NhHaPhvindndnaeTmbazcwfydbhDazclfydbhOazydbhrxekascdfhDascefhOashrkJbbbbh8KJbbbbJbbbbJbbbbJbbbbJbbjZJbbj:;awaOaA2cdtfgQIdbawaraA2cdtfgLIdbgh:tawaDaA2cdtfgKIdlaLIdlgg:tg8JNaQIdlag:tggaKIdbah:tN:tghJbbbb9EEahJbbbb9BEg8EaiaraX2cdtfgrIdwghaiaOaX2cdtfgOIdwg59BEa8EarIdlgaaOIdlgy9BEa8EarIdbg8FaOIdbg8P9BEg8EahaiaDaX2cdtfgDIdwgI9BEa8EaaaDIdlg8R9BEa8Ea8FaDIdbg8S9BEg8Ea5aI9BEa8Eaya8R9BEa8Ea8Pa8S9BEh8Edna8Ja5ah:tNagaIah:tN:tghahNa8Ja8Pa8F:tNaga8Sa8F:tN:tg8Fa8FNa8Jayaa:tNaga8Raa:tN:tg8Ja8JNMMggJbbbb9Bmba8Eag:r:vh8KkaHcxfa8EUdbaHcwfaha8KNUdbaHclfa8Ja8KNUdbaHa8Fa8KNUdbazcxfhzaHczfhHascifhsavcufgvmbkkcbhHakaYcbyd:q:G:cjbHjjjjbbgDBd3akcvBd2dnadTmbaDhzinazaHBdbazclfhzadaHcefgH9hmbkkakcuaPcdtadcFFFF970Ecbyd:q:G:cjbHjjjjbbgvBdaakcoBd2akaPcbyd:q:G:cjbHjjjjbbg8ABd8KakcrBd2dnadci6mba8NcxfhzavhscbhHinasaHBdba8AaHfcdcbazIdbg8KJbbbb9DEa8KJbbbb9EV86bbasclfhsazczfhzaPaHcefgH9hmbkkdnalTmbcbhRinaRcdthHdna8LaRcefgRcdtfydbgza8LaHfydbgHSmbazaH9RhLa8MaHcdtfhKcbh8UinaKa8Ucdtfg8VydbgHcd4g8Wci2gxaHciGcdtgzyd:e:G:cjbfhHaxazydj:G:cjbfhzdnaeTmbaeaHcdtfydbhHaeazcdtfydbhzkdna8Ucefg8UaL9pmbamaHcdtfydbhYamazcdtfydbh3a8Aa8WfhEava8Wcdtfh8Xa8UhwinaKawcdtfgQydbgHcd4gzci2gAaHciGcdtgHyd:e:G:cjbfhsaAaHydj:G:cjbfhHdnaeTmbaeascdtfydbhsaeaHcdtfydbhHkdndnamaHcdtfydbaYSmbamascdtfydba39hmeka8AazfRbbgHaERbbgsVciSmbdnaHasGmba8Whsdna8Wa8XydbgHSmba8XhOinaOavaHgscdtfgrydbgHBdbarhOasaH9hmbkkdnazavazcdtfgOydbgHSmbinaOavaHgzcdtfgrydbgHBdbarhOazaH9hmbkkasazSmba8AazfgORbba8AasfgHRbbVciSmeavazcdtfasBdbaHaHRbbaORbbV86bbkdna8VydbciGaxfgzaDazcdtfgsydbgHSmbinasaDaHgzcdtfgOydbgHBdbaOhsazaH9hmbkkdnaQydbciGaAfgsaDascdtfgOydbgHSmbinaOaDaHgscdtfgrydbgHBdbarhOasaH9hmbkkazasSmbaDascdtfazBdbkawcefgwaL9hmbkka8UaL9hmbkkaRal9hmbkkdnadTmbcbhrinarhzdnaraDarcdtfgwydbgHSmbawhsinasaDaHgzcdtfgOydbgHBdbaOhsazaH9hmbkkawazBdbarcefgrad9hmbkcbh8Vabcbadcltz:djjjbhKdnadci6mbaqceGhEaDhYaeh3cbh8Windna8Na8WcltfgsIdxJbbbb9Bmbama8Wcx2gHfhxaeaHfhLcbhza8VhwinaKaYazfydbcltfhHdndnaeTmbamaLazc:e:G:cjbfydbcdtfydbcdtfhAamaLazcj:G:cjbfydbcdtfydbcdtfhra3azfydbhOxekaxazc:e:G:cjbfydbcdtfhAaxazcj:G:cjbfydbcdtfhrawhOkaHasIdbggao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HcefgH9hmbkkdnakyd2gzTmbazcdtakcxffc98fhHinaHydbcbydN:G:cjbH:bjjjbbaHc98fhHazcufgzmbkkakc;Wbf8Kjjjjbk9teiucbcbyd:y:G:cjbgeabcifc98GfgbBd:y:G:cjbdndnabZbcztgd9nmbcuhiabad9RcFFifcz4nbcuSmekaehikaik;aeedudndnabciGTmbabhixekaecFeGc:b:c:ew2hldndnadcz9pmbabhixekabhiinaialBdbaicxfalBdbaicwfalBdbaiclfalBdbaiczfhiadc9Wfgdcs0mbkkadcl6mbinaialBdbaiclfhiadc98fgdci0mbkkdnadTmbinaiae86bbaicefhiadcufgdmbkkabk9teiucbcbyd:y:G:cjbgeabcrfc94GfgbBd:y:G:cjbdndnabZbcztgd9nmbcuhiabad9RcFFifcz4nbcuSmekaehikaikTeeucbabcbyd:y:G:cjbge9Rcifc98GaefgbBd:y:G:cjbdnabZbcztge9nmbabae9RcFFifcz4nb8Akkk8Rdbcj:Gdkzebbbdbbbbbbbebbbbc:q:Gdkxebbbdbbba:qbb",t=new Uint8Array([32,0,65,2,1,106,34,33,3,128,11,4,13,64,6,253,10,7,15,116,127,5,8,12,40,16,19,54,20,9,27,255,113,17,42,67,24,23,146,148,18,14,22,45,70,69,56,114,101,21,25,63,75,136,108,28,118,29,73,115]);if(typeof WebAssembly!="object")return{supported:!1};var n,i=WebAssembly.instantiate(r(e),{}).then(function(u){n=u.instance,n.exports.__wasm_call_ctors()});function r(u){for(var f=new Uint8Array(u.length),d=0;d<u.length;++d){var p=u.charCodeAt(d);f[d]=p>96?p-97:p>64?p-39:p+4}for(var g=0,d=0;d<u.length;++d)f[g++]=f[d]<60?t[f[d]]:(f[d]-60)*64+f[++d];return f.buffer.slice(0,g)}function o(u){if(!u)throw new Error("Assertion failed")}function s(u){return new Uint8Array(u.buffer,u.byteOffset,u.byteLength)}function a(u,f,d,p,g,m,y,A,b,x){var T=n.exports.sbrk,E=T(f*16),v=u?T(u.byteLength):0,S=T(d.byteLength),I=T(m.byteLength),R=T(A.byteLength),O=new Uint8Array(n.exports.memory.buffer);u&&O.set(s(u),v),O.set(s(d),S),O.set(s(m),I),O.set(s(A),R),n.exports.meshopt_generateTangents(E,v,f,S,p,g*4,I,y*4,R,b*4,x),O=new Uint8Array(n.exports.memory.buffer);var L=new Float32Array(O.buffer,E,f*4).slice();return T(E-T(0)),L}var c={Compatible:1,ZeroFallback:2};return{ready:i,supported:!0,generateTangents:function(u,f,d,p,g,m,y,A){o(u===null||u instanceof Uint32Array||u instanceof Int32Array||u instanceof Uint16Array||u instanceof Int16Array),o(u===null||u.length%3==0),o(f instanceof Float32Array),o(f.length%d==0),o(d>=3),o(p instanceof Float32Array),o(p.length%g==0),o(g>=3),o(m instanceof Float32Array),o(m.length%y==0),o(y>=2),o(f.length/d==p.length/g),o(f.length/d==m.length/y),o(u!==null||f.length/d%3==0);for(var b=0,x=0;x<(A?A.length:0);++x)o(A[x]in c),b|=c[A[x]];var T=f.length/d,E=u?u.length:T,v=u===null||u.BYTES_PER_ELEMENT==4?u:new Uint32Array(u);return a(v,E,f,T,d,p,g,m,y,b)}}})();var t$=class extends nr{constructor(t){super(),t=t??H.EMPTY_OBJECT;let n=t.resourceCache,i=t.gltf,r=t.bufferViewId,o=t.gltfResource,s=t.baseResource,a=t.cacheKey,c=i.bufferViews[r],u=c.buffer,f=c.byteOffset,d=c.byteLength,p=!1,g,m,y,A,b=oA(c);l(b)&&(u=b.buffer,f=b.byteOffset??0,d=b.byteLength,p=!0,g=b.byteStride,m=b.count,y=b.mode,A=b.filter??"NONE");let x=i.buffers[u];this._hasMeshopt=p,this._meshoptByteStride=g,this._meshoptCount=m,this._meshoptMode=y,this._meshoptFilter=A,this._resourceCache=n,this._gltfResource=o,this._baseResource=s,this._buffer=x,this._bufferId=u,this._byteOffset=f,this._byteLength=d,this._cacheKey=a,this._bufferLoader=void 0,this._typedArray=void 0,this._state=Tt.UNLOADED,this._promise=void 0}get cacheKey(){return this._cacheKey}get typedArray(){return this._typedArray}async load(){return l(this._promise)?this._promise:(this._state=Tt.LOADING,this._promise=TXe(this),this._promise)}unload(){l(this._bufferLoader)&&!this._bufferLoader.isDestroyed()&&this._resourceCache.unload(this._bufferLoader),this._bufferLoader=void 0,this._typedArray=void 0}};async function TXe(e){try{let t=EXe(e);if(e._bufferLoader=t,await t.load(),e.isDestroyed())return;let n=t.typedArray,i=new Uint8Array(n.buffer,n.byteOffset+e._byteOffset,e._byteLength);if(e.unload(),e._typedArray=i,e._hasMeshopt){let r=e._meshoptCount,o=e._meshoptByteStride,s=new Uint8Array(r*o);sA.decodeGltfBuffer(s,r,o,e._typedArray,e._meshoptMode,e._meshoptFilter),e._typedArray=s}return e._state=Tt.READY,e}catch(t){if(e.isDestroyed())return;throw e.unload(),e._state=Tt.FAILED,e.getError("Failed to load buffer view",t)}}function EXe(e){let t=e._resourceCache,n=e._buffer;if(l(n.uri)){let o=e._baseResource.getDerivedResource({url:n.uri});return t.getExternalBufferLoader({resource:o})}let i=n.extras?._pipeline?.source;return t.getEmbeddedBufferLoader({parentResource:e._gltfResource,bufferId:e._bufferId,typedArray:i})}var Zv=t$;var rT=class e{static _getDecoderTaskProcessor(){if(!l(e._decoderTaskProcessor)){let t=new $n("decodeDraco",e._maxDecodingConcurrency);t.initWebAssemblyModule({wasmBinaryFile:"ThirdParty/draco_decoder.wasm"}).then(function(n){n?e._taskProcessorReady=!0:e._error=new oe("Draco decoder could not be initialized.")}).catch(n=>{e._error=n}),e._decoderTaskProcessor=t}return e._decoderTaskProcessor}static decodePointCloud(t){let n=e._getDecoderTaskProcessor();if(l(e._error))throw e._error;if(e._taskProcessorReady)return n.scheduleTask(t,[t.buffer.buffer])}static decodeBufferView(t){let n=e._getDecoderTaskProcessor();if(l(e._error))throw e._error;if(e._taskProcessorReady)return n.scheduleTask(t,[t.array.buffer])}};rT._maxDecodingConcurrency=Math.max(dn.hardwareConcurrency-1,1);rT._decoderTaskProcessor=void 0;rT._taskProcessorReady=!1;rT._error=void 0;var Fg=rT;var Mn={POSITION:"POSITION",NORMAL:"NORMAL",TANGENT:"TANGENT",TEXCOORD:"TEXCOORD",COLOR:"COLOR",JOINTS:"JOINTS",WEIGHTS:"WEIGHTS",FEATURE_ID:"_FEATURE_ID",SCALE:"KHR_gaussian_splatting:SCALE",ROTATION:"KHR_gaussian_splatting:ROTATION",CUMULATIVE_DISTANCE:"BENTLEY_materials_line_style:CUMULATIVE_DISTANCE"};function CXe(e){switch(e){case Mn.POSITION:return"positionMC";case Mn.NORMAL:return"normalMC";case Mn.TANGENT:return"tangentMC";case Mn.TEXCOORD:return"texCoord";case Mn.COLOR:return"color";case Mn.JOINTS:return"joints";case Mn.WEIGHTS:return"weights";case Mn.FEATURE_ID:return"featureId";case Mn.SCALE:return"scale";case Mn.ROTATION:return"rotation";case Mn.CUMULATIVE_DISTANCE:return"cumulativeDistance"}}Mn.hasSetIndex=function(e){switch(e){case Mn.POSITION:case Mn.NORMAL:case Mn.TANGENT:case Mn.CUMULATIVE_DISTANCE:return!1;case Mn.TEXCOORD:case Mn.COLOR:case Mn.JOINTS:case Mn.WEIGHTS:case Mn.FEATURE_ID:case Mn.SCALE:case Mn.ROTATION:return!0}};Mn.fromGltfSemantic=function(e){let t=e,i=/^(\w+)_\d+$/.exec(e);switch(i!==null&&(t=i[1]),t){case"POSITION":return Mn.POSITION;case"NORMAL":return Mn.NORMAL;case"TANGENT":return Mn.TANGENT;case"TEXCOORD":return Mn.TEXCOORD;case"COLOR":return Mn.COLOR;case"JOINTS":return Mn.JOINTS;case"WEIGHTS":return Mn.WEIGHTS;case"_FEATURE_ID":return Mn.FEATURE_ID;case"KHR_gaussian_splatting:SCALE":case"_SCALE":return Mn.SCALE;case"KHR_gaussian_splatting:ROTATION":case"_ROTATION":return Mn.ROTATION;case"BENTLEY_materials_line_style:CUMULATIVE_DISTANCE":return Mn.CUMULATIVE_DISTANCE}};Mn.fromPntsSemantic=function(e){switch(e){case"POSITION":case"POSITION_QUANTIZED":return Mn.POSITION;case"RGBA":case"RGB":case"RGB565":return Mn.COLOR;case"NORMAL":case"NORMAL_OCT16P":return Mn.NORMAL;case"BATCH_ID":return Mn.FEATURE_ID}};Mn.getGlslType=function(e){switch(e){case Mn.POSITION:case Mn.NORMAL:case Mn.TANGENT:return"vec3";case Mn.TEXCOORD:return"vec2";case Mn.COLOR:return"vec4";case Mn.JOINTS:return"ivec4";case Mn.WEIGHTS:return"vec4";case Mn.FEATURE_ID:return"int";case Mn.SCALE:return"vec3";case Mn.ROTATION:return"vec4";case Mn.CUMULATIVE_DISTANCE:return"float";case Mn.OPACITY:return"float"}};Mn.getVariableName=function(e,t){let n=CXe(e);return l(t)&&(n+=`_${t}`),n};Object.freeze(Mn);var ct=Mn;var n$=class extends nr{constructor(t){super(),t=t??H.EMPTY_OBJECT;let n=t.resourceCache,i=t.gltf,r=t.primitive,o=t.draco,s=t.gltfResource,a=t.baseResource,c=t.cacheKey;this._resourceCache=n,this._gltfResource=s,this._baseResource=a,this._gltf=i,this._primitive=r,this._draco=o,this._cacheKey=c,this._bufferViewLoader=void 0,this._bufferViewTypedArray=void 0,this._decodePromise=void 0,this._decodedData=void 0,this._state=Tt.UNLOADED,this._promise=void 0,this._dracoError=void 0}get cacheKey(){return this._cacheKey}get decodedData(){return this._decodedData}async load(){return l(this._promise)?this._promise:(this._state=Tt.LOADING,this._promise=vXe(this),this._promise)}process(t){if(this._state===Tt.READY)return!0;if(this._state!==Tt.PROCESSING||(l(this._dracoError)&&K0e(this,this._dracoError),!l(this._bufferViewTypedArray))||l(this._decodePromise))return!1;let n=this._draco,i=this._primitive,r=this._gltf,o=r.bufferViews,s=n.bufferView,a=o[s],c=n.attributes,u=[];for(let p in i.attributes)if(i.attributes.hasOwnProperty(p)){let g=wXe(p);l(g)&&r.accessors[i.attributes[p]].componentType===Y.FLOAT&&(u.includes(g)||u.push(g))}let f={array:new Uint8Array(this._bufferViewTypedArray),bufferView:a,compressedAttributes:c,dequantizeInShader:!0,attributesToSkipTransform:u},d=Fg.decodeBufferView(f);if(!l(d))return!1;this._decodePromise=SXe(this,d)}unload(){l(this._bufferViewLoader)&&this._resourceCache.unload(this._bufferViewLoader),this._bufferViewLoader=void 0,this._bufferViewTypedArray=void 0,this._decodedData=void 0,this._gltf=void 0,this._primitive=void 0}};async function vXe(e){let t=e._resourceCache;try{let n=t.getBufferViewLoader({gltf:e._gltf,bufferViewId:e._draco.bufferView,gltfResource:e._gltfResource,baseResource:e._baseResource});return e._bufferViewLoader=n,await n.load(),e.isDestroyed()?void 0:(e._bufferViewTypedArray=n.typedArray,e._state=Tt.PROCESSING,e)}catch(n){if(e.isDestroyed())return;K0e(e,n)}}function K0e(e,t){throw e.unload(),e._state=Tt.FAILED,e.getError("Failed to load Draco",t)}async function SXe(e,t){try{let n=await t;return e.isDestroyed()?void 0:(e.unload(),e._decodedData={indices:n.indexArray,vertexAttributes:n.attributeData},e._state=Tt.READY,e._baseResource)}catch(n){if(e.isDestroyed())return;e._dracoError=n}}var oT={};oT[ct.POSITION]="POSITION";oT[ct.NORMAL]="NORMAL";oT[ct.COLOR]="COLOR";oT[ct.TEXCOORD]="TEX_COORD";function wXe(e){for(let t in oT)if(oT.hasOwnProperty(t)&&e.startsWith(t))return oT[t]}var Qv=n$;function IXe(e){let{uint8Array:t,format:n,request:i}=e,r=e.flipY??!1,o=e.skipColorSpaceConversion??!1,s=new Blob([t],{type:n}),a;return De.supportsImageBitmapOptions().then(function(c){return c?Promise.resolve(De.createImageBitmapFromBlob(s,{flipY:r,premultiplyAlpha:!1,skipColorSpaceConversion:o})):(a=window.URL.createObjectURL(s),new De({url:a,request:i}).fetchImage({flipY:r,skipColorSpaceConversion:o}))}).then(function(c){return l(a)&&window.URL.revokeObjectURL(a),c}).catch(function(c){return l(a)&&window.URL.revokeObjectURL(a),Promise.reject(c)})}var Bg=IXe;var iL=class extends nr{constructor(t){super(),t=t??H.EMPTY_OBJECT;let n=t.resourceCache,i=t.gltf,r=t.imageId,o=t.gltfResource,s=t.baseResource,a=t.cacheKey,c=i.images[r],u=c.bufferView,f=c.uri;this._resourceCache=n,this._gltfResource=o,this._baseResource=s,this._gltf=i,this._bufferViewId=u,this._uri=f,this._cacheKey=a,this._bufferViewLoader=void 0,this._image=void 0,this._mipLevels=void 0,this._state=Tt.UNLOADED,this._promise=void 0}get cacheKey(){return this._cacheKey}get image(){return this._image}get mipLevels(){return this._mipLevels}load(){return l(this._promise)?this._promise:l(this._bufferViewId)?(this._promise=PXe(this),this._promise):(this._promise=DXe(this),this._promise)}unload(){l(this._bufferViewLoader)&&!this._bufferViewLoader.isDestroyed()&&this._resourceCache.unload(this._bufferViewLoader),this._bufferViewLoader=void 0,this._uri=void 0,this._image=void 0,this._mipLevels=void 0,this._gltf=void 0}};function $0e(e){let t;return Array.isArray(e)&&(t=e.slice(1,e.length).map(function(n){return n.bufferView}),e=e[0]),{image:e,mipLevels:t}}async function PXe(e){e._state=Tt.LOADING;let t=e._resourceCache;try{let n=t.getBufferViewLoader({gltf:e._gltf,bufferViewId:e._bufferViewId,gltfResource:e._gltfResource,baseResource:e._baseResource});if(e._bufferViewLoader=n,await n.load(),e.isDestroyed())return;let i=n.typedArray,r=await OXe(i);if(e.isDestroyed())return;let o=$0e(r);return e.unload(),e._image=o.image,e._mipLevels=o.mipLevels,e._state=Tt.READY,e}catch(n){return e.isDestroyed()?void 0:J0e(e,n,"Failed to load embedded image")}}async function DXe(e){e._state=Tt.LOADING;let t=e._baseResource,n=e._uri,i=t.getDerivedResource({url:n});try{let r=await NXe(i);if(e.isDestroyed())return;let o=$0e(r);return e.unload(),e._image=o.image,e._mipLevels=o.mipLevels,e._state=Tt.READY,e}catch(r){return e.isDestroyed()?void 0:J0e(e,r,`Failed to load image: ${n}`)}}function J0e(e,t,n){return e.unload(),e._state=Tt.FAILED,Promise.reject(e.getError(n,t))}function RXe(e){let t=e.subarray(0,2),n=e.subarray(0,4),i=e.subarray(8,12);if(t[0]===255&&t[1]===216)return"image/jpeg";if(t[0]===137&&t[1]===80)return"image/png";if(t[0]===171&&t[1]===75)return"image/ktx2";if(n[0]===82&&n[1]===73&&n[2]===70&&n[3]===70&&i[0]===87&&i[1]===69&&i[2]===66&&i[3]===80)return"image/webp";throw new oe("Image format is not recognized")}async function OXe(e){let t=RXe(e);if(t==="image/ktx2"){let n=new Uint8Array(e);return Ou(n)}return iL._loadImageFromTypedArray({uint8Array:e,format:t,flipY:!1,skipColorSpaceConversion:!0})}var MXe=/(^data:image\/ktx2)|(\.ktx2$)/i;function NXe(e){let t=e.getUrlComponent(!1,!0);return MXe.test(t)?Ou(e):e.fetchImage({skipColorSpaceConversion:!0,preferImageBitmap:!0})}iL._loadImageFromTypedArray=Bg;var eS=iL;var Z0e={TEXTURE:0,PROGRAM:1,BUFFER:2,NUMBER_OF_JOB_TYPES:3};Object.freeze(Z0e);var Mc=Z0e;var i$=class extends nr{constructor(t){super(),t=t??H.EMPTY_OBJECT;let n=t.resourceCache,i=t.gltf,r=t.accessorId,o=t.gltfResource,s=t.baseResource,a=t.primitive,c=t.draco,u=t.cacheKey,f=t.asynchronous??!0,d=t.loadBuffer??!1,p=t.loadTypedArray??!1,g=i.accessors[r].componentType;this._resourceCache=n,this._gltfResource=o,this._baseResource=s,this._gltf=i,this._accessorId=r,this._indexDatatype=g,this._primitive=a,this._draco=c,this._cacheKey=u,this._asynchronous=f,this._loadBuffer=d,this._loadTypedArray=p,this._bufferViewLoader=void 0,this._dracoLoader=void 0,this._typedArray=void 0,this._buffer=void 0,this._state=Tt.UNLOADED,this._promise=void 0}get cacheKey(){return this._cacheKey}get buffer(){return this._buffer}get typedArray(){return this._typedArray}get indexDatatype(){return this._indexDatatype}async load(){return l(this._promise)?this._promise:l(this._draco)?(this._promise=FXe(this),this._promise):(this._promise=BXe(this),this._promise)}process(t){if(this._state===Tt.READY)return!0;if(this._state!==Tt.LOADED&&this._state!==Tt.PROCESSING)return!1;let n=this._typedArray,i=this._indexDatatype;if(l(this._dracoLoader))try{this._dracoLoader.process(t)&&(n=this._dracoLoader.decodedData.indices.typedArray,this._typedArray=n,i=Y.fromTypedArray(n),this._indexDatatype=i)}catch(o){o$(this,o)}if(!l(n))return!1;let r;if(this._loadBuffer&&this._asynchronous){let o=LXe;if(o.set(n,i,t.context),!t.jobScheduler.execute(o,Mc.BUFFER))return!1;r=o.buffer}else this._loadBuffer&&(r=Q0e(n,i,t.context));return this.unload(),this._buffer=r,this._typedArray=this._loadTypedArray?n:void 0,this._state=Tt.READY,this._resourceCache.statistics.addGeometryLoader(this),!0}unload(){l(this._buffer)&&this._buffer.destroy();let t=this._resourceCache;l(this._bufferViewLoader)&&!this._bufferViewLoader.isDestroyed()&&t.unload(this._bufferViewLoader),l(this._dracoLoader)&&t.unload(this._dracoLoader),this._bufferViewLoader=void 0,this._dracoLoader=void 0,this._typedArray=void 0,this._buffer=void 0,this._gltf=void 0,this._primitive=void 0}},r$=class{constructor(){this.typedArray=void 0,this.indexDatatype=void 0,this.context=void 0,this.buffer=void 0}set(t,n,i){this.typedArray=t,this.indexDatatype=n,this.context=i}execute(){this.buffer=Q0e(this.typedArray,this.indexDatatype,this.context)}};function Q0e(e,t,n){let i=tt.createIndexBuffer({typedArray:e,context:n,usage:Me.STATIC_DRAW,indexDatatype:t});return i.vertexArrayDestroyable=!1,i}var LXe=new r$;async function FXe(e){e._state=Tt.LOADING;let t=e._resourceCache;try{let n=t.getDracoLoader({gltf:e._gltf,primitive:e._primitive,draco:e._draco,gltfResource:e._gltfResource,baseResource:e._baseResource});return e._dracoLoader=n,await n.load(),e.isDestroyed()?void 0:(e._state=Tt.LOADED,e)}catch(n){if(e.isDestroyed())return;o$(e,n)}}async function BXe(e){let t=e._gltf,n=e._accessorId,r=t.accessors[n].bufferView;e._state=Tt.LOADING;let o=e._resourceCache;try{let s=o.getBufferViewLoader({gltf:t,bufferViewId:r,gltfResource:e._gltfResource,baseResource:e._baseResource});if(e._bufferViewLoader=s,await s.load(),e.isDestroyed())return;let a=s.typedArray;return e._typedArray=kXe(e,a),e._state=Tt.PROCESSING,e}catch(s){if(e.isDestroyed())return;o$(e,s)}}function kXe(e,t){let n=e._gltf,i=e._accessorId,r=n.accessors[i],o=r.count,s=r.componentType,a=je.getSizeInBytes(s),c=t.buffer,u=t.byteOffset+r.byteOffset;if(u%a!==0){let d=o*a,p=new Uint8Array(c,u,d);c=new Uint8Array(p).buffer,u=0,qr("index-buffer-unaligned",`The index array is not aligned to a ${a}-byte boundary.`)}let f;return s===je.UNSIGNED_BYTE?f=new Uint8Array(c,u,o):s===je.UNSIGNED_SHORT?f=new Uint16Array(c,u,o):s===je.UNSIGNED_INT&&(f=new Uint32Array(c,u,o)),f}function o$(e,t){throw e.unload(),e._state=Tt.FAILED,e.getError("Failed to load index buffer",t)}var tS=i$;function UXe(e,t,n){if(n=n??!1,n){let i=e.indexOf(t);if(i>-1)return i}return e.push(t),e.length-1}var _a=UXe;function zXe(e,t){return l(e.extensionsUsed)&&e.extensionsUsed.indexOf(t)>=0}var Go=zXe;function rn(){}rn.objectLegacy=function(e,t){if(l(e)){for(let n in e)if(Object.prototype.hasOwnProperty.call(e,n)){let i=e[n],r=t(i,n);if(l(r))return r}}};rn.object=function(e,t){if(l(e)){let n=e.length;for(let i=0;i<n;i++){let r=e[i],o=t(r,i);if(l(o))return o}}};rn.topLevel=function(e,t,n){let i=e[t];return l(i)&&!Array.isArray(i)?rn.objectLegacy(i,n):rn.object(i,n)};rn.accessor=function(e,t){return rn.topLevel(e,"accessors",t)};rn.accessorWithSemantic=function(e,t,n){let i={};return rn.mesh(e,function(r){return rn.meshPrimitive(r,function(o){let s=rn.meshPrimitiveAttribute(o,function(a,c){if(c.indexOf(t)===0&&!l(i[a])){i[a]=!0;let u=n(a);if(l(u))return u}});return l(s)?s:rn.meshPrimitiveTarget(o,function(a){return rn.meshPrimitiveTargetAttribute(a,function(c,u){if(u.indexOf(t)===0&&!l(i[c])){i[c]=!0;let f=n(c);if(l(f))return f}})})})})};rn.accessorContainingVertexAttributeData=function(e,t){let n={};return rn.mesh(e,function(i){return rn.meshPrimitive(i,function(r){let o=rn.meshPrimitiveAttribute(r,function(s){if(!l(n[s])){n[s]=!0;let a=t(s);if(l(a))return a}});return l(o)?o:rn.meshPrimitiveTarget(r,function(s){return rn.meshPrimitiveTargetAttribute(s,function(a){if(!l(n[a])){n[a]=!0;let c=t(a);if(l(c))return c}})})})})};rn.accessorContainingIndexData=function(e,t){let n={};return rn.mesh(e,function(i){return rn.meshPrimitive(i,function(r){let o=r.indices;if(l(o)&&!l(n[o])){n[o]=!0;let s=t(o);if(l(s))return s}})})};rn.animation=function(e,t){return rn.topLevel(e,"animations",t)};rn.animationChannel=function(e,t){let n=e.channels;return rn.object(n,t)};rn.animationSampler=function(e,t){let n=e.samplers;return rn.object(n,t)};rn.buffer=function(e,t){return rn.topLevel(e,"buffers",t)};rn.bufferView=function(e,t){return rn.topLevel(e,"bufferViews",t)};rn.camera=function(e,t){return rn.topLevel(e,"cameras",t)};rn.image=function(e,t){return rn.topLevel(e,"images",t)};rn.material=function(e,t){return rn.topLevel(e,"materials",t)};rn.materialValue=function(e,t){let n=e.values;l(e.extensions)&&l(e.extensions.KHR_techniques_webgl)&&(n=e.extensions.KHR_techniques_webgl.values);for(let i in n)if(Object.prototype.hasOwnProperty.call(n,i)){let r=t(n[i],i);if(l(r))return r}};rn.mesh=function(e,t){return rn.topLevel(e,"meshes",t)};rn.meshPrimitive=function(e,t){let n=e.primitives;if(l(n)){let i=n.length;for(let r=0;r<i;r++){let o=n[r],s=t(o,r);if(l(s))return s}}};rn.meshPrimitiveAttribute=function(e,t){let n=e.attributes;for(let i in n)if(Object.prototype.hasOwnProperty.call(n,i)){let r=t(n[i],i);if(l(r))return r}};rn.meshPrimitiveTarget=function(e,t){let n=e.targets;if(l(n)){let i=n.length;for(let r=0;r<i;++r){let o=t(n[r],r);if(l(o))return o}}};rn.meshPrimitiveTargetAttribute=function(e,t){for(let n in e)if(Object.prototype.hasOwnProperty.call(e,n)){let i=e[n],r=t(i,n);if(l(r))return r}};rn.node=function(e,t){return rn.topLevel(e,"nodes",t)};rn.nodeInTree=function(e,t,n){let i=e.nodes;if(l(i)){let r=t.length;for(let o=0;o<r;o++){let s=t[o],a=i[s];if(l(a)){let c=n(a,s);if(l(c))return c;let u=a.children;if(l(u)&&(c=rn.nodeInTree(e,u,n),l(c)))return c}}}};rn.nodeInScene=function(e,t,n){let i=t.nodes;if(l(i))return rn.nodeInTree(e,i,n)};rn.program=function(e,t){return Go(e,"KHR_techniques_webgl")?rn.object(e.extensions.KHR_techniques_webgl.programs,t):rn.topLevel(e,"programs",t)};rn.sampler=function(e,t){return rn.topLevel(e,"samplers",t)};rn.scene=function(e,t){return rn.topLevel(e,"scenes",t)};rn.shader=function(e,t){return Go(e,"KHR_techniques_webgl")?rn.object(e.extensions.KHR_techniques_webgl.shaders,t):rn.topLevel(e,"shaders",t)};rn.skin=function(e,t){return rn.topLevel(e,"skins",t)};rn.skinJoint=function(e,t){let n=e.joints;if(l(n)){let i=n.length;for(let r=0;r<i;r++){let o=n[r],s=t(o);if(l(s))return s}}};rn.techniqueAttribute=function(e,t){let n=e.attributes;for(let i in n)if(Object.prototype.hasOwnProperty.call(n,i)){let r=t(n[i],i);if(l(r))return r}};rn.techniqueUniform=function(e,t){let n=e.uniforms;for(let i in n)if(Object.prototype.hasOwnProperty.call(n,i)){let r=t(n[i],i);if(l(r))return r}};rn.techniqueParameter=function(e,t){let n=e.parameters;for(let i in n)if(Object.prototype.hasOwnProperty.call(n,i)){let r=t(n[i],i);if(l(r))return r}};rn.technique=function(e,t){return Go(e,"KHR_techniques_webgl")?rn.object(e.extensions.KHR_techniques_webgl.techniques,t):rn.topLevel(e,"techniques",t)};rn.texture=function(e,t){return rn.topLevel(e,"textures",t)};var ke=rn;function VXe(e){switch(e){case"SCALAR":return 1;case"VEC2":return 2;case"VEC3":return 3;case"VEC4":case"MAT2":return 4;case"MAT3":return 9;case"MAT4":return 16}}var Nf=VXe;function jXe(e,t){let n=t.bufferView;if(l(n)){let i=e.bufferViews[n];if(l(i.byteStride)&&i.byteStride>0)return i.byteStride}return Y.getSizeInBytes(t.componentType)*Nf(t.type)}var ju=jXe;function HXe(e){ke.accessor(e,function(n){l(n.bufferView)&&(n.byteOffset=n.byteOffset??0)}),ke.bufferView(e,function(n){l(n.buffer)&&(n.byteOffset=n.byteOffset??0)}),ke.mesh(e,function(n){ke.meshPrimitive(n,function(i){if(i.mode=i.mode??te.TRIANGLES,!l(i.material)){l(e.materials)||(e.materials=[]);let r={name:"default"};i.material=_a(e.materials,r)}})}),ke.accessorContainingVertexAttributeData(e,function(n){let i=e.accessors[n],r=i.bufferView;if(i.normalized=i.normalized??!1,l(r)){let o=e.bufferViews[r];o.byteStride=ju(e,i),o.target=te.ARRAY_BUFFER}}),ke.accessorContainingIndexData(e,function(n){let r=e.accessors[n].bufferView;if(l(r)){let o=e.bufferViews[r];o.target=te.ELEMENT_ARRAY_BUFFER}}),ke.material(e,function(n){let i=n.extensions??{},r=i.KHR_materials_common;if(l(r)){let c=r.technique,u=l(r.values)?r.values:{};r.values=u,u.ambient=l(u.ambient)?u.ambient:[0,0,0,1],u.emission=l(u.emission)?u.emission:[0,0,0,1],u.transparency=u.transparency??1,c!=="CONSTANT"&&(u.diffuse=l(u.diffuse)?u.diffuse:[0,0,0,1],c!=="LAMBERT"&&(u.specular=l(u.specular)?u.specular:[0,0,0,1],u.shininess=u.shininess??0)),r.transparent=r.transparent??!1,r.doubleSided=r.doubleSided??!1;return}n.emissiveFactor=n.emissiveFactor??[0,0,0],n.alphaMode=n.alphaMode??"OPAQUE",n.doubleSided=n.doubleSided??!1,n.alphaMode==="MASK"&&(n.alphaCutoff=n.alphaCutoff??.5);let o=i.KHR_techniques_webgl;l(o)&&ke.materialValue(n,function(c){l(c.index)&&sT(c)}),sT(n.emissiveTexture),sT(n.normalTexture),sT(n.occlusionTexture);let s=n.pbrMetallicRoughness;l(s)&&(s.baseColorFactor=s.baseColorFactor??[1,1,1,1],s.metallicFactor=s.metallicFactor??1,s.roughnessFactor=s.roughnessFactor??1,sT(s.baseColorTexture),sT(s.metallicRoughnessTexture));let a=i.KHR_materials_pbrSpecularGlossiness;l(a)&&(a.diffuseFactor=a.diffuseFactor??[1,1,1,1],a.specularFactor=a.specularFactor??[1,1,1],a.glossinessFactor=a.glossinessFactor??1,sT(a.specularGlossinessTexture))}),ke.animation(e,function(n){ke.animationSampler(n,function(i){i.interpolation=i.interpolation??"LINEAR"})});let t=GXe(e);return ke.node(e,function(n,i){l(t[i])||l(n.translation)||l(n.rotation)||l(n.scale)?(n.translation=n.translation??[0,0,0],n.rotation=n.rotation??[0,0,0,1],n.scale=n.scale??[1,1,1]):n.matrix=n.matrix??[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]}),ke.sampler(e,function(n){n.wrapS=n.wrapS??te.REPEAT,n.wrapT=n.wrapT??te.REPEAT}),l(e.scenes)&&!l(e.scene)&&(e.scene=0),e}function GXe(e){let t={};return ke.animation(e,function(n){ke.animationChannel(n,function(i){let r=i.target,o=r.node,s=r.path;(s==="translation"||s==="rotation"||s==="scale")&&(t[o]=!0)})}),t}function sT(e){l(e)&&(e.texCoord=e.texCoord??0)}var rL=HXe;function WXe(e){return ke.shader(e,function(t){V6(t)}),ke.buffer(e,function(t){V6(t)}),ke.image(e,function(t){V6(t)}),V6(e),e}function V6(e){e.extras=l(e.extras)?e.extras:{},e.extras._pipeline=l(e.extras._pipeline)?e.extras._pipeline:{}}var aA=WXe;function qXe(e,t){let n=e.extensionsRequired;if(l(n)){let i=n.indexOf(t);i>=0&&n.splice(i,1),n.length===0&&delete e.extensionsRequired}}var oL=qXe;function YXe(e,t){let n=e.extensionsUsed;if(l(n)){let i=n.indexOf(t);i>=0&&n.splice(i,1),oL(e,t),n.length===0&&delete e.extensionsUsed}}var aT=YXe;var XXe=4;function KXe(e){if(om(e)!=="glTF")throw new oe("File is not valid binary glTF");let n=ege(e,0,5),i=n[1];if(i!==1&&i!==2)throw new oe("Binary glTF version is not 1 or 2");return i===1?$Xe(e,n):JXe(e,n)}function ege(e,t,n){let i=new DataView(e.buffer),r=new Array(n);for(let o=0;o<n;++o)r[o]=i.getUint32(e.byteOffset+t+o*XXe,!0);return r}function $Xe(e,t){let n=t[2],i=t[3];if(t[4]!==0)throw new oe("Binary glTF scene format is not JSON");let o=20,s=o+i,a=Uu(e,o,i),c=JSON.parse(a);aA(c);let u=e.subarray(s,n),f=c.buffers;if(l(f)&&Object.keys(f).length>0){let d=f.binary_glTF??f.KHR_binary_glTF;l(d)&&(d.extras._pipeline.source=u,delete d.uri)}return aT(c,"KHR_binary_glTF"),c}function JXe(e,t){let n=t[2],i=12,r,o;for(;i<n;){let s=ege(e,i,2),a=s[0],c=s[1];i+=8;let u=e.subarray(i,i+a);if(i+=a,c===1313821514){let f=Uu(u);r=JSON.parse(f),aA(r)}else c===5130562&&(o=u)}if(l(r)&&l(o)){let s=r.buffers;if(l(s)&&s.length>0){let a=s[0];a.extras._pipeline.source=o}}return r}var cT=KXe;function ZXe(e){return ke.shader(e,function(t){j6(t)}),ke.buffer(e,function(t){j6(t)}),ke.image(e,function(t){j6(t)}),j6(e),e}function j6(e){l(e.extras)&&(l(e.extras._pipeline)&&delete e.extras._pipeline,Object.keys(e.extras).length===0&&delete e.extras)}var sL=ZXe;function QXe(e,t){let n=e.extensionsUsed;l(n)||(n=[],e.extensionsUsed=n),_a(n,t,!0)}var Ud=QXe;function eKe(e){switch(e){case Y.BYTE:return function(t,n,i,r,o){for(let s=0;s<i;++s)o[s]=t.getInt8(n+s*r)};case Y.UNSIGNED_BYTE:return function(t,n,i,r,o){for(let s=0;s<i;++s)o[s]=t.getUint8(n+s*r)};case Y.SHORT:return function(t,n,i,r,o){for(let s=0;s<i;++s)o[s]=t.getInt16(n+s*r,!0)};case Y.UNSIGNED_SHORT:return function(t,n,i,r,o){for(let s=0;s<i;++s)o[s]=t.getUint16(n+s*r,!0)};case Y.INT:return function(t,n,i,r,o){for(let s=0;s<i;++s)o[s]=t.getInt32(n+s*r,!0)};case Y.UNSIGNED_INT:return function(t,n,i,r,o){for(let s=0;s<i;++s)o[s]=t.getUint32(n+s*r,!0)};case Y.FLOAT:return function(t,n,i,r,o){for(let s=0;s<i;++s)o[s]=t.getFloat32(n+s*r,!0)};case Y.DOUBLE:return function(t,n,i,r,o){for(let s=0;s<i;++s)o[s]=t.getFloat64(n+s*r,!0)}}}var kg=eKe;function tKe(e,t){let n=e.bufferViews,i=e.buffers,r=t.bufferView,o=Nf(t.type);if(!l(t.bufferView))return{min:new Array(o).fill(0),max:new Array(o).fill(0)};let s=new Array(o).fill(Number.POSITIVE_INFINITY),a=new Array(o).fill(Number.NEGATIVE_INFINITY),c=n[r],u=c.buffer,d=i[u].extras._pipeline.source,p=t.count,g=ju(e,t),m=t.byteOffset+c.byteOffset+d.byteOffset,y=t.componentType,A=Y.getSizeInBytes(y),b=new DataView(d.buffer),x=new Array(o),T=kg(y);for(let E=0;E<p;E++){T(b,m,o,A,x);for(let v=0;v<o;v++){let S=x[v];s[v]=Math.min(s[v],S),a[v]=Math.max(a[v],S)}m+=g}return{min:s,max:a}}var lT=tKe;var nKe=[te.FUNC_ADD,te.FUNC_ADD],iKe=[te.ONE,te.ZERO,te.ONE,te.ZERO];function tge(e,t){let n=e.enable;return l(n)?n.indexOf(t)>-1:!1}var rKe=[te.ZERO,te.ONE,te.SRC_COLOR,te.ONE_MINUS_SRC_COLOR,te.SRC_ALPHA,te.ONE_MINUS_SRC_ALPHA,te.DST_ALPHA,te.ONE_MINUS_DST_ALPHA,te.DST_COLOR,te.ONE_MINUS_DST_COLOR];function oKe(e,t){if(!l(e))return t;for(let n=0;n<4;n++)if(rKe.indexOf(e[n])===-1)return t;return e}function sKe(e){let t={},n={},i=e.techniques;return l(i)&&(ke.technique(e,function(r,o){let s=r.states;if(l(s)){let a=n[o]={};if(tge(s,te.BLEND)){a.alphaMode="BLEND";let c=s.functions;l(c)&&(l(c.blendEquationSeparate)||l(c.blendFuncSeparate))&&(t[o]={blendEquation:c.blendEquationSeparate??nKe,blendFactors:oKe(c.blendFuncSeparate,iKe)})}tge(s,te.CULL_FACE)||(a.doubleSided=!0),delete r.states}}),Object.keys(t).length>0&&(l(e.extensions)||(e.extensions={}),Ud(e,"KHR_blend")),ke.material(e,function(r){if(l(r.technique)){let o=n[r.technique];ke.objectLegacy(o,function(a,c){r[c]=a});let s=t[r.technique];l(s)&&(l(r.extensions)||(r.extensions={}),r.extensions.KHR_blend=s)}})),e}var aL=sKe;function aKe(e,t){let n=e.extensionsRequired;l(n)||(n=[],e.extensionsRequired=n),_a(n,t,!0),Ud(e,t)}var cL=aKe;function cKe(e){let t=e.techniques,n={},i={},r={};if(l(t)){let o={programs:[],shaders:[],techniques:[]},s=e.glExtensionsUsed;delete e.glExtensionsUsed,ke.technique(e,function(a,c){let u={name:a.name,program:void 0,attributes:{},uniforms:{}},f;if(ke.techniqueAttribute(a,function(d,p){f=a.parameters[d],u.attributes[p]={semantic:f.semantic}}),ke.techniqueUniform(a,function(d,p){f=a.parameters[d],u.uniforms[p]={count:f.count,node:f.node,type:f.type,semantic:f.semantic,value:f.value},l(n[c])||(n[c]={}),n[c][d]=p}),l(r[a.program]))u.program=r[a.program];else{let d=e.programs[a.program],p={name:d.name,fragmentShader:void 0,vertexShader:void 0,glExtensions:s},g=e.shaders[d.fragmentShader];p.fragmentShader=_a(o.shaders,g,!0);let m=e.shaders[d.vertexShader];p.vertexShader=_a(o.shaders,m,!0),u.program=_a(o.programs,p),r[a.program]=u.program}i[c]=_a(o.techniques,u)}),o.techniques.length>0&&(l(e.extensions)||(e.extensions={}),e.extensions.KHR_techniques_webgl=o,Ud(e,"KHR_techniques_webgl"),cL(e,"KHR_techniques_webgl"))}return ke.material(e,function(o){if(l(o.technique)){let s={technique:i[o.technique]};ke.objectLegacy(o.values,function(a,c){l(s.values)||(s.values={});let u=n[o.technique][c];l(u)&&(s.values[u]=a)}),l(o.extensions)||(o.extensions={}),o.extensions.KHR_techniques_webgl=s}delete o.technique,delete o.values}),delete e.techniques,delete e.programs,delete e.shaders,e}var lL=cKe;function lKe(e,t){Wr.typeOf.object("material",e),Wr.defined("handler",t);let n=e.pbrMetallicRoughness;if(l(n)){if(l(n.baseColorTexture)){let o=n.baseColorTexture,s=t(o.index,o);if(l(s))return s}if(l(n.metallicRoughnessTexture)){let o=n.metallicRoughnessTexture,s=t(o.index,o);if(l(s))return s}}let{extensions:i}=e;if(l(i)){let o=i.KHR_materials_pbrSpecularGlossiness;if(l(o)){if(l(o.diffuseTexture)){let u=o.diffuseTexture,f=t(u.index,u);if(l(f))return f}if(l(o.specularGlossinessTexture)){let u=o.specularGlossinessTexture,f=t(u.index,u);if(l(f))return f}}let s=i.KHR_materials_specular;if(l(s)){let{specularTexture:u,specularColorTexture:f}=s;if(l(u)){let d=t(u.index,u);if(l(d))return d}if(l(f)){let d=t(f.index,f);if(l(d))return d}}let a=i.KHR_materials_transmission;if(l(a)&&l(a.transmissionTexture)){let u=a.transmissionTexture,f=t(u.index,u);if(l(f))return f}let c=i.KHR_materials_common;if(l(c)&&l(c.values)){let{diffuse:u,ambient:f,emission:d,specular:p}=c.values;if(l(u)&&l(u.index)){let g=t(u.index,u);if(l(g))return g}if(l(f)&&l(f.index)){let g=t(f.index,f);if(l(g))return g}if(l(d)&&l(d.index)){let g=t(d.index,d);if(l(g))return g}if(l(p)&&l(p.index)){let g=t(p.index,p);if(l(g))return g}}}let r=ke.materialValue(e,function(o){if(l(o.index)){let s=t(o.index,o);if(l(s))return s}});if(l(r))return r;if(l(e.emissiveTexture)){let o=e.emissiveTexture,s=t(o.index,o);if(l(s))return s}if(l(e.normalTexture)){let o=e.normalTexture,s=t(o.index,o);if(l(s))return s}if(l(e.occlusionTexture)){let o=e.occlusionTexture,s=t(o.index,o);if(l(s))return s}}var nS=lKe;var nge=["mesh","node","material","accessor","bufferView","buffer","texture","sampler","image"];function uKe(e,t){return t=t??nge,nge.forEach(function(n){t.indexOf(n)>-1&&dKe(e,n)}),e}var fKe={accessor:"accessors",buffer:"buffers",bufferView:"bufferViews",image:"images",node:"nodes",material:"materials",mesh:"meshes",sampler:"samplers",texture:"textures"};function dKe(e,t){let n=fKe[t],i=e[n];if(l(i)){let r=0,o=Hp[t](e),s=i.length;for(let a=0;a<s;++a)o[a]||(jp[t](e,a-r),r++)}}function jp(){}jp.accessor=function(e,t){e.accessors.splice(t,1),ke.mesh(e,function(i){ke.meshPrimitive(i,function(r){ke.meshPrimitiveAttribute(r,function(a,c){a>t&&r.attributes[c]--}),ke.meshPrimitiveTarget(r,function(a){ke.meshPrimitiveTargetAttribute(a,function(c,u){c>t&&a[u]--})});let o=r.indices;l(o)&&o>t&&r.indices--;let s=r.extensions;l(s)&&l(s.CESIUM_primitive_outline)&&s.CESIUM_primitive_outline.indices>t&&--s.CESIUM_primitive_outline.indices})}),ke.skin(e,function(i){l(i.inverseBindMatrices)&&i.inverseBindMatrices>t&&i.inverseBindMatrices--}),ke.animation(e,function(i){ke.animationSampler(i,function(r){l(r.input)&&r.input>t&&r.input--,l(r.output)&&r.output>t&&r.output--})})};jp.buffer=function(e,t){e.buffers.splice(t,1),ke.bufferView(e,function(i){l(i.buffer)&&i.buffer>t&&i.buffer--;let r=i.extensions;if(l(r)){let o=r.EXT_meshopt_compression;l(o)&&o.buffer>t&&o.buffer--;let s=r.KHR_meshopt_compression;l(s)&&s.buffer>t&&s.buffer--}})};jp.bufferView=function(e,t){if(e.bufferViews.splice(t,1),ke.accessor(e,function(i){l(i.bufferView)&&i.bufferView>t&&i.bufferView--}),ke.shader(e,function(i){l(i.bufferView)&&i.bufferView>t&&i.bufferView--}),ke.image(e,function(i){l(i.bufferView)&&i.bufferView>t&&i.bufferView--}),Go(e,"KHR_draco_mesh_compression")&&ke.mesh(e,function(i){ke.meshPrimitive(i,function(r){l(r.extensions)&&l(r.extensions.KHR_draco_mesh_compression)&&r.extensions.KHR_draco_mesh_compression.bufferView>t&&r.extensions.KHR_draco_mesh_compression.bufferView--})}),Go(e,"EXT_feature_metadata")){let r=e.extensions.EXT_feature_metadata.featureTables;for(let o in r)if(r.hasOwnProperty(o)){let a=r[o].properties;if(l(a)){for(let c in a)if(a.hasOwnProperty(c)){let u=a[c];l(u.bufferView)&&u.bufferView>t&&u.bufferView--,l(u.arrayOffsetBufferView)&&u.arrayOffsetBufferView>t&&u.arrayOffsetBufferView--,l(u.stringOffsetBufferView)&&u.stringOffsetBufferView>t&&u.stringOffsetBufferView--}}}}if(Go(e,"EXT_structural_metadata")){let r=e.extensions.EXT_structural_metadata.propertyTables;if(l(r)){let o=r.length;for(let s=0;s<o;++s){let c=r[s].properties;for(let u in c)if(c.hasOwnProperty(u)){let f=c[u];l(f.values)&&f.values>t&&f.values--,l(f.arrayOffsets)&&f.arrayOffsets>t&&f.arrayOffsets--,l(f.stringOffsets)&&f.stringOffsets>t&&f.stringOffsets--}}}}};jp.image=function(e,t){e.images.splice(t,1),ke.texture(e,function(i){l(i.source)&&i.source>t&&--i.source;let r=i.extensions;l(r)&&l(r.EXT_texture_webp)&&r.EXT_texture_webp.source>t?--i.extensions.EXT_texture_webp.source:l(r)&&l(r.KHR_texture_basisu)&&r.KHR_texture_basisu.source>t&&--i.extensions.KHR_texture_basisu.source})};jp.mesh=function(e,t){e.meshes.splice(t,1),ke.node(e,function(i){l(i.mesh)&&(i.mesh>t?i.mesh--:i.mesh===t&&delete i.mesh)})};jp.node=function(e,t){e.nodes.splice(t,1),ke.skin(e,function(i){l(i.skeleton)&&i.skeleton>t&&i.skeleton--,i.joints=i.joints.map(function(r){return r>t?r-1:r})}),ke.animation(e,function(i){ke.animationChannel(i,function(r){l(r.target)&&l(r.target.node)&&r.target.node>t&&r.target.node--})}),ke.technique(e,function(i){ke.techniqueUniform(i,function(r){l(r.node)&&r.node>t&&r.node--})}),ke.node(e,function(i){l(i.children)&&(i.children=i.children.filter(function(r){return r!==t}).map(function(r){return r>t?r-1:r}))}),ke.scene(e,function(i){i.nodes=i.nodes.filter(function(r){return r!==t}).map(function(r){return r>t?r-1:r})})};jp.material=function(e,t){e.materials.splice(t,1),ke.mesh(e,function(i){ke.meshPrimitive(i,function(r){l(r.material)&&r.material>t&&r.material--})})};jp.sampler=function(e,t){e.samplers.splice(t,1),ke.texture(e,function(i){l(i.sampler)&&i.sampler>t&&--i.sampler})};jp.texture=function(e,t){if(e.textures.splice(t,1),ke.material(e,function(i){nS(i,function(r,o){o.index>t&&--o.index})}),Go(e,"EXT_feature_metadata")){ke.mesh(e,function(o){ke.meshPrimitive(o,function(s){let a=s.extensions;if(l(a)&&l(a.EXT_feature_metadata)){let u=a.EXT_feature_metadata.featureIdTextures;if(l(u)){let f=u.length;for(let d=0;d<f;++d){let g=u[d].featureIds.texture;g.index>t&&--g.index}}}})});let r=e.extensions.EXT_feature_metadata.featureTextures;for(let o in r)if(r.hasOwnProperty(o)){let a=r[o].properties;if(l(a)){for(let c in a)if(a.hasOwnProperty(c)){let f=a[c].texture;f.index>t&&--f.index}}}}if(Go(e,"EXT_mesh_features")&&ke.mesh(e,function(i){ke.meshPrimitive(i,function(r){let o=r.extensions;if(l(o)&&l(o.EXT_mesh_features)){let a=o.EXT_mesh_features.featureIds;if(l(a)){let c=a.length;for(let u=0;u<c;++u){let f=a[u];l(f.texture)&&f.texture.index>t&&--f.texture.index}}}})}),Go(e,"EXT_structural_metadata")){let r=e.extensions.EXT_structural_metadata.propertyTextures;if(l(r)){let o=r.length;for(let s=0;s<o;++s){let c=r[s].properties;for(let u in c)if(c.hasOwnProperty(u)){let f=c[u];f.index>t&&--f.index}}}}};function Hp(){}Hp.accessor=function(e){let t={};return ke.mesh(e,function(n){ke.meshPrimitive(n,function(i){ke.meshPrimitiveAttribute(i,function(o){t[o]=!0}),ke.meshPrimitiveTarget(i,function(o){ke.meshPrimitiveTargetAttribute(o,function(s){t[s]=!0})});let r=i.indices;l(r)&&(t[r]=!0)})}),ke.skin(e,function(n){l(n.inverseBindMatrices)&&(t[n.inverseBindMatrices]=!0)}),ke.animation(e,function(n){ke.animationSampler(n,function(i){l(i.input)&&(t[i.input]=!0),l(i.output)&&(t[i.output]=!0)})}),Go(e,"EXT_mesh_gpu_instancing")&&ke.node(e,function(n){l(n.extensions)&&l(n.extensions.EXT_mesh_gpu_instancing)&&Object.keys(n.extensions.EXT_mesh_gpu_instancing.attributes).forEach(function(i){let r=n.extensions.EXT_mesh_gpu_instancing.attributes[i];t[r]=!0})}),Go(e,"CESIUM_primitive_outline")&&ke.mesh(e,function(n){ke.meshPrimitive(n,function(i){let r=i.extensions;if(l(r)&&l(r.CESIUM_primitive_outline)){let s=r.CESIUM_primitive_outline.indices;l(s)&&(t[s]=!0)}})}),t};Hp.buffer=function(e){let t={};return ke.bufferView(e,function(n){l(n.buffer)&&(t[n.buffer]=!0);let i=n.extensions;if(l(i)){let r=i.EXT_meshopt_compression;l(r)&&(t[r.buffer]=!0);let o=i.KHR_meshopt_compression;l(o)&&(t[o.buffer]=!0)}}),t};Hp.bufferView=function(e){let t={};if(ke.accessor(e,function(n){l(n.bufferView)&&(t[n.bufferView]=!0)}),ke.shader(e,function(n){l(n.bufferView)&&(t[n.bufferView]=!0)}),ke.image(e,function(n){l(n.bufferView)&&(t[n.bufferView]=!0)}),Go(e,"KHR_draco_mesh_compression")&&ke.mesh(e,function(n){ke.meshPrimitive(n,function(i){l(i.extensions)&&l(i.extensions.KHR_draco_mesh_compression)&&(t[i.extensions.KHR_draco_mesh_compression.bufferView]=!0)})}),Go(e,"EXT_feature_metadata")){let i=e.extensions.EXT_feature_metadata.featureTables;for(let r in i)if(i.hasOwnProperty(r)){let s=i[r].properties;if(l(s)){for(let a in s)if(s.hasOwnProperty(a)){let c=s[a];l(c.bufferView)&&(t[c.bufferView]=!0),l(c.arrayOffsetBufferView)&&(t[c.arrayOffsetBufferView]=!0),l(c.stringOffsetBufferView)&&(t[c.stringOffsetBufferView]=!0)}}}}if(Go(e,"EXT_structural_metadata")){let i=e.extensions.EXT_structural_metadata.propertyTables;if(l(i)){let r=i.length;for(let o=0;o<r;++o){let a=i[o].properties;for(let c in a)if(a.hasOwnProperty(c)){let u=a[c];l(u.values)&&(t[u.values]=!0),l(u.arrayOffsets)&&(t[u.arrayOffsets]=!0),l(u.stringOffsets)&&(t[u.stringOffsets]=!0)}}}}return t};Hp.image=function(e){let t={};return ke.texture(e,function(n){l(n.source)&&(t[n.source]=!0),l(n.extensions)&&l(n.extensions.EXT_texture_webp)?t[n.extensions.EXT_texture_webp.source]=!0:l(n.extensions)&&l(n.extensions.KHR_texture_basisu)&&(t[n.extensions.KHR_texture_basisu.source]=!0)}),t};Hp.mesh=function(e){let t={};return ke.node(e,function(n){if(l(n.mesh&&l(e.meshes))){let i=e.meshes[n.mesh];l(i)&&l(i.primitives)&&i.primitives.length>0&&(t[n.mesh]=!0)}}),t};function ige(e,t,n){let i=e.nodes[t];return l(i.mesh)||l(i.camera)||l(i.skin)||l(i.weights)||l(i.extras)||l(i.extensions)&&Object.keys(i.extensions).length!==0||l(n[t])?!1:!l(i.children)||i.children.filter(function(r){return!ige(e,r,n)}).length===0}Hp.node=function(e){let t={};return ke.skin(e,function(n){l(n.skeleton)&&(t[n.skeleton]=!0),ke.skinJoint(n,function(i){t[i]=!0})}),ke.animation(e,function(n){ke.animationChannel(n,function(i){l(i.target)&&l(i.target.node)&&(t[i.target.node]=!0)})}),ke.technique(e,function(n){ke.techniqueUniform(n,function(i){l(i.node)&&(t[i.node]=!0)})}),ke.node(e,function(n,i){ige(e,i,t)||(t[i]=!0)}),t};Hp.material=function(e){let t={};return ke.mesh(e,function(n){ke.meshPrimitive(n,function(i){l(i.material)&&(t[i.material]=!0)})}),t};Hp.texture=function(e){let t={};if(ke.material(e,function(n){nS(n,function(i){t[i]=!0})}),Go(e,"EXT_feature_metadata")){ke.mesh(e,function(r){ke.meshPrimitive(r,function(o){let s=o.extensions;if(l(s)&&l(s.EXT_feature_metadata)){let c=s.EXT_feature_metadata.featureIdTextures;if(l(c)){let u=c.length;for(let f=0;f<u;++f){let p=c[f].featureIds.texture;t[p.index]=!0}}}})});let i=e.extensions.EXT_feature_metadata.featureTextures;for(let r in i)if(i.hasOwnProperty(r)){let s=i[r].properties;if(l(s)){for(let a in s)if(s.hasOwnProperty(a)){let u=s[a].texture;t[u.index]=!0}}}}if(Go(e,"EXT_mesh_features")&&ke.mesh(e,function(n){ke.meshPrimitive(n,function(i){let r=i.extensions;if(l(r)&&l(r.EXT_mesh_features)){let s=r.EXT_mesh_features.featureIds;if(l(s)){let a=s.length;for(let c=0;c<a;++c){let u=s[c];l(u.texture)&&(t[u.texture.index]=!0)}}}})}),Go(e,"EXT_structural_metadata")){let i=e.extensions.EXT_structural_metadata.propertyTextures;if(l(i)){let r=i.length;for(let o=0;o<r;++o){let a=i[o].properties;for(let c in a)if(a.hasOwnProperty(c)){let u=a[c];t[u.index]=!0}}}}return t};Hp.sampler=function(e){let t={};return ke.texture(e,function(n){l(n.sampler)&&(t[n.sampler]=!0)}),t};var uL=uKe;function hKe(e,t){let n={byteLength:t.length,extras:{_pipeline:{source:t}}},r={buffer:_a(e.buffers,n),byteOffset:0,byteLength:t.length};return _a(e.bufferViews,r)}var fL=hKe;function mKe(e,t){let n=ju(e,t),i=Y.getSizeInBytes(t.componentType),r=Nf(t.type),o=t.count,s=new Array(r*o);if(!l(t.bufferView))return s.fill(0);let a=e.bufferViews[t.bufferView],c=e.buffers[a.buffer].extras._pipeline.source,u=t.byteOffset+a.byteOffset+c.byteOffset,f=new DataView(c.buffer),d=new Array(r),p=kg(t.componentType);for(let g=0;g<o;++g){p(f,u,r,i,d);for(let m=0;m<r;++m)s[g*r+m]=d[m];u+=n}return s}var dL=mKe;function pKe(e){let t;return ke.accessorWithSemantic(e,"JOINTS_0",function(n){let i=e.accessors[n];t=i.componentType,t===te.BYTE?H6(e,i,Y.UNSIGNED_BYTE):t!==te.UNSIGNED_BYTE&&t!==te.UNSIGNED_SHORT&&H6(e,i,Y.UNSIGNED_SHORT)}),ke.accessorWithSemantic(e,"WEIGHTS_0",function(n){let i=e.accessors[n];t=i.componentType,t===te.BYTE?H6(e,i,Y.UNSIGNED_BYTE):t===te.SHORT&&H6(e,i,Y.UNSIGNED_SHORT)}),e}function H6(e,t,n){let i=Y.createTypedArray(n,dL(e,t)),r=new Uint8Array(i.buffer);t.bufferView=fL(e,r),t.componentType=n,t.byteOffset=0}var hL=pKe;function gKe(e,t){return aT(e,t),t==="CESIUM_RTC"&&_Ke(e),s$(e,t)}function _Ke(e){ke.technique(e,function(t){ke.techniqueUniform(t,function(n){n.semantic==="CESIUM_RTC_MODELVIEW"&&(n.semantic="MODELVIEW")})})}function s$(e,t){if(Array.isArray(e)){let n=e.length;for(let i=0;i<n;++i)s$(e[i],t)}else if(e!==null&&typeof e=="object"&&e.constructor===Object){let n=e.extensions,i;l(n)&&(i=n[t],l(i)&&(delete n[t],Object.keys(n).length===0&&delete e.extensions));for(let r in e)Object.prototype.hasOwnProperty.call(e,r)&&s$(e[r],t);return i}}var uT=gKe;var G6={.8:EKe,"1.0":GKe,"2.0":void 0};function yKe(e,t){t=t??{};let n=t.targetVersion,i=e.version;e.asset=e.asset??{version:"1.0"},e.asset.version=e.asset.version??"1.0",i=(i??e.asset.version).toString(),Object.prototype.hasOwnProperty.call(G6,i)||(l(i)&&(i=i.substring(0,3)),Object.prototype.hasOwnProperty.call(G6,i)||(i="1.0"));let r=G6[i];for(;l(r)&&i!==n;)r(e,t),i=e.asset.version,r=G6[i];return t.keepLegacyExtensions||(YKe(e,t),XKe(e)),e}function sge(e){let t=e.materials;for(let n in t)if(Object.prototype.hasOwnProperty.call(t,n)){let i=t[n],r=i.instanceTechnique;l(r)&&(i.technique=r.technique,i.values=r.values,delete i.instanceTechnique)}}function AKe(e){let t=e.meshes;for(let n in t)if(Object.prototype.hasOwnProperty.call(t,n)){let r=t[n].primitives;if(l(r)){let o=r.length;for(let s=0;s<o;++s){let a=r[s],c=a.primitive??te.TRIANGLES;a.mode=a.mode??c,delete a.primitive}}}}function bKe(e){let t=e.nodes,n=new h,i=new Le;for(let r in t)if(Object.prototype.hasOwnProperty.call(t,r)){let o=t[r];if(l(o.rotation)){let a=o.rotation;h.fromArray(a,0,n),Le.fromAxisAngle(n,a[3],i),o.rotation=[i.x,i.y,i.z,i.w]}let s=o.instanceSkin;l(s)&&(o.skeletons=s.skeletons,o.skin=s.skin,o.meshes=s.meshes,delete o.instanceSkin)}}function xKe(e){let t=e.animations,n=e.accessors,i=e.bufferViews,r=e.buffers,o={},s=new h,a=new Le;for(let c in t)if(Object.prototype.hasOwnProperty.call(t,c)){let u=t[c],f=u.channels,d=u.parameters,p=u.samplers;if(l(f)){let g=f.length;for(let m=0;m<g;++m){let y=f[m];if(y.target.path==="rotation"){let A=d[p[y.sampler].output];if(l(o[A]))continue;o[A]=!0;let b=n[A],x=i[b.bufferView],E=r[x.buffer].extras._pipeline.source,v=E.byteOffset+x.byteOffset+b.byteOffset,S=b.componentType,I=b.count,R=Nf(b.type),O=b.count*R,L=Y.createArrayBufferView(S,E.buffer,v,O);for(let _=0;_<I;_++){let C=_*R;h.unpack(L,C,s);let w=L[C+3];Le.fromAxisAngle(s,w,a),Le.pack(a,L,C)}}}}}}function TKe(e){let t=e.techniques;for(let n in t)if(Object.prototype.hasOwnProperty.call(t,n)){let i=t[n],r=i.passes;if(l(r)){let o=i.pass??"defaultPass";if(Object.prototype.hasOwnProperty.call(r,o)){let s=r[o],a=s.instanceProgram;i.attributes=i.attributes??a.attributes,i.program=i.program??a.program,i.uniforms=i.uniforms??a.uniforms,i.states=i.states??s.states}delete i.passes,delete i.pass}}}function EKe(e){l(e.asset)||(e.asset={});let t=e.asset;if(t.version="1.0",typeof t.profile=="string"){let n=t.profile.split(" ");t.profile={api:n[0],version:n[1]}}else t.profile={};if(l(e.version)&&delete e.version,sge(e),AKe(e),bKe(e),xKe(e),TKe(e),l(e.allExtensions)&&(e.extensionsUsed=e.allExtensions,delete e.allExtensions),l(e.lights)){let n=e.extensions??{};e.extensions=n;let i=n.KHR_materials_common??{};n.KHR_materials_common=i,i.lights=e.lights,delete e.lights,Ud(e,"KHR_materials_common")}}function CKe(e){let t=e.animations;for(let n in t)if(Object.prototype.hasOwnProperty.call(t,n)){let i=t[n],r=i.parameters;if(l(r)){let o=i.samplers;for(let s in o)if(Object.prototype.hasOwnProperty.call(o,s)){let a=o[s];a.input=r[a.input],a.output=r[a.output]}delete i.parameters}}}function rge(e,t){let n=[];for(let i in e)if(Object.prototype.hasOwnProperty.call(e,i)){let r=e[i];t[i]=n.length,n.push(r),l(r.name)||(r.name=i)}return n}function vKe(e){let t,n={accessors:{},animations:{},buffers:{},bufferViews:{},cameras:{},images:{},materials:{},meshes:{},nodes:{},programs:{},samplers:{},scenes:{},shaders:{},skins:{},textures:{},techniques:{}},i,r={},o=e.nodes;for(let s in o)Object.prototype.hasOwnProperty.call(o,s)&&(i=o[s].jointName,l(i)&&(r[i]=s));for(let s in e)if(Object.prototype.hasOwnProperty.call(e,s)&&l(n[s])){let a={},c=e[s];e[s]=rge(c,a),n[s]=a}for(i in r)Object.prototype.hasOwnProperty.call(r,i)&&(r[i]=n.nodes[r[i]]);l(e.scene)&&(e.scene=n.scenes[e.scene]),ke.bufferView(e,function(s){l(s.buffer)&&(s.buffer=n.buffers[s.buffer])}),ke.accessor(e,function(s){l(s.bufferView)&&(s.bufferView=n.bufferViews[s.bufferView])}),ke.shader(e,function(s){let a=s.extensions;if(l(a)){let c=a.KHR_binary_glTF;l(c)&&(s.bufferView=n.bufferViews[c.bufferView],delete a.KHR_binary_glTF),Object.keys(a).length===0&&delete s.extensions}}),ke.program(e,function(s){l(s.vertexShader)&&(s.vertexShader=n.shaders[s.vertexShader]),l(s.fragmentShader)&&(s.fragmentShader=n.shaders[s.fragmentShader])}),ke.technique(e,function(s){l(s.program)&&(s.program=n.programs[s.program]),ke.techniqueParameter(s,function(a){l(a.node)&&(a.node=n.nodes[a.node]);let c=a.value;typeof c=="string"&&(a.value={index:n.textures[c]})})}),ke.mesh(e,function(s){ke.meshPrimitive(s,function(a){l(a.indices)&&(a.indices=n.accessors[a.indices]),ke.meshPrimitiveAttribute(a,function(c,u){a.attributes[u]=n.accessors[c]}),l(a.material)&&(a.material=n.materials[a.material])})}),ke.node(e,function(s){let a=s.children;if(l(a)){let c=a.length;for(t=0;t<c;++t)a[t]=n.nodes[a[t]]}if(l(s.meshes)){let c=s.meshes,u=c.length;if(u>0)for(s.mesh=n.meshes[c[0]],t=1;t<u;++t){let f={mesh:n.meshes[c[t]]},d=_a(e.nodes,f);l(a)||(a=[],s.children=a),a.push(d)}delete s.meshes}if(l(s.camera)&&(s.camera=n.cameras[s.camera]),l(s.skin)&&(s.skin=n.skins[s.skin]),l(s.skeletons)){let c=s.skeletons;if(c.length>0&&l(s.skin)){let f=e.skins[s.skin];f.skeleton=n.nodes[c[0]]}delete s.skeletons}l(s.jointName)&&delete s.jointName}),ke.skin(e,function(s){l(s.inverseBindMatrices)&&(s.inverseBindMatrices=n.accessors[s.inverseBindMatrices]);let a=s.jointNames;if(l(a)){let c=[],u=a.length;for(t=0;t<u;++t)c[t]=r[a[t]];s.joints=c,delete s.jointNames}}),ke.scene(e,function(s){let a=s.nodes;if(l(a)){let c=a.length;for(t=0;t<c;++t)a[t]=n.nodes[a[t]]}}),ke.animation(e,function(s){let a={};s.samplers=rge(s.samplers,a),ke.animationSampler(s,function(c){c.input=n.accessors[c.input],c.output=n.accessors[c.output]}),ke.animationChannel(s,function(c){c.sampler=a[c.sampler];let u=c.target;l(u)&&(u.node=n.nodes[u.id],delete u.id)})}),ke.material(e,function(s){l(s.technique)&&(s.technique=n.techniques[s.technique]),ke.materialValue(s,function(c,u){typeof c=="string"&&(s.values[u]={index:n.textures[c]})});let a=s.extensions;if(l(a)){let c=a.KHR_materials_common;l(c)&&l(c.values)&&ke.materialValue(c,function(u,f){typeof u=="string"&&(c.values[f]={index:n.textures[u]})})}}),ke.image(e,function(s){let a=s.extensions;if(l(a)){let c=a.KHR_binary_glTF;l(c)&&(s.bufferView=n.bufferViews[c.bufferView],s.mimeType=c.mimeType,delete a.KHR_binary_glTF),Object.keys(a).length===0&&delete s.extensions}}),ke.texture(e,function(s){l(s.sampler)&&(s.sampler=n.samplers[s.sampler]),l(s.source)&&(s.source=n.images[s.source])})}function SKe(e){ke.animation(e,function(t){ke.animationSampler(t,function(n){delete n.name})})}function wKe(e){for(let t in e)if(Object.prototype.hasOwnProperty.call(e,t)){let n=e[t];Array.isArray(n)&&n.length===0&&delete e[t]}ke.node(e,function(t){l(t.children)&&t.children.length===0&&delete t.children})}function IKe(e){let t=e.asset;delete t.profile,delete t.premultipliedAlpha}var PKe={CESIUM_RTC:!0,KHR_materials_common:!0,WEB3D_quantized_attributes:!0};function DKe(e){let t=e.extensionsUsed;if(e.extensionsRequired=e.extensionsRequired??[],l(t)){let n=t.length;for(let i=0;i<n;++i){let r=t[i];l(PKe[r])&&e.extensionsRequired.push(r)}}}function RKe(e){ke.buffer(e,function(t){delete t.type})}function OKe(e){ke.texture(e,function(t){delete t.format,delete t.internalFormat,delete t.target,delete t.type})}function MKe(e){ke.mesh(e,function(t){ke.meshPrimitive(t,function(n){ke.meshPrimitiveAttribute(n,function(i,r){r==="TEXCOORD"?n.attributes.TEXCOORD_0=i:r==="COLOR"&&(n.attributes.COLOR_0=i)}),delete n.attributes.TEXCOORD,delete n.attributes.COLOR})}),ke.technique(e,function(t){ke.techniqueParameter(t,function(n){let i=n.semantic;l(i)&&(i==="TEXCOORD"?n.semantic="TEXCOORD_0":i==="COLOR"&&(n.semantic="COLOR_0"))})})}var NKe={POSITION:!0,NORMAL:!0,TANGENT:!0},LKe={COLOR:"COLOR",JOINT:"JOINTS",JOINTS:"JOINTS",TEXCOORD:"TEXCOORD",WEIGHT:"WEIGHTS",WEIGHTS:"WEIGHTS"};function FKe(e){let t={};ke.mesh(e,function(n){ke.meshPrimitive(n,function(i){ke.meshPrimitiveAttribute(i,function(r,o){if(o.charAt(0)!=="_"){let s=o.search(/_[0-9]+/g),a=o,c="_0";s>=0&&(a=o.substring(0,s),c=o.substring(s));let u,f=LKe[a];l(f)?(u=f+c,t[o]=u):l(NKe[a])||(u=`_${o}`,t[o]=u)}});for(let r in t)if(Object.prototype.hasOwnProperty.call(t,r)){let o=t[r],s=i.attributes[r];l(s)&&(delete i.attributes[r],i.attributes[o]=s)}})}),ke.technique(e,function(n){ke.techniqueParameter(n,function(i){let r=t[i.semantic];l(r)&&(i.semantic=r)})})}function BKe(e){ke.camera(e,function(t){let n=t.perspective;if(l(n)){let i=n.aspectRatio;l(i)&&i===0&&delete n.aspectRatio;let r=n.yfov;l(r)&&r===0&&(n.yfov=1)}})}function c$(e,t){return l(t.byteStride)&&t.byteStride!==0?t.byteStride:ju(e,t)}function kKe(e){ke.buffer(e,function(t){l(t.byteLength)||(t.byteLength=t.extras._pipeline.source.length)}),ke.accessor(e,function(t){let n=t.bufferView;if(l(n)){let i=e.bufferViews[n],r=c$(e,t),o=t.byteOffset+t.count*r;i.byteLength=Math.max(i.byteLength??0,o)}})}function UKe(e){let t,n,i,r=e.bufferViews,o={};ke.accessorContainingVertexAttributeData(e,function(a){let c=e.accessors[a];l(c.bufferView)&&(o[c.bufferView]=!0)});let s={};ke.accessor(e,function(a){l(a.bufferView)&&(s[a.bufferView]=s[a.bufferView]??[],s[a.bufferView].push(a))});for(let a in s)if(Object.prototype.hasOwnProperty.call(s,a)){i=r[a];let c=s[a];c.sort(function(p,g){return p.byteOffset-g.byteOffset});let u=0,f=0,d=c.length;for(t=0;t<d;++t){let p=c[t],g=c$(e,p),m=p.byteOffset,y=p.count*g;delete p.byteStride;let A=t<d-1,b=A?c$(e,c[t+1]):void 0;if(g!==b){let x=Je(i,!0);o[a]&&(x.byteStride=g),x.byteOffset+=u,x.byteLength=m+y-u;let T=_a(r,x);for(n=f;n<=t;++n)p=c[n],p.bufferView=T,p.byteOffset=p.byteOffset-u;u=A?c[t+1].byteOffset:void 0,f=t+1}}}uL(e,["accessor","bufferView","buffer"])}function zKe(e){ke.accessorWithSemantic(e,"POSITION",function(t){let n=e.accessors[t];if(!l(n.min)||!l(n.max)){let i=lT(e,n);n.min=i.min,n.max=i.max}})}function age(e){return(!l(e.children)||e.children.length===0)&&(!l(e.meshes)||e.meshes.length===0)&&!l(e.camera)&&!l(e.skin)&&!l(e.skeletons)&&!l(e.jointName)&&(!l(e.translation)||h.fromArray(e.translation).equals(h.ZERO))&&(!l(e.scale)||h.fromArray(e.scale).equals(new h(1,1,1)))&&(!l(e.rotation)||se.fromArray(e.rotation).equals(new se(0,0,0,1)))&&(!l(e.matrix)||N.fromColumnMajorArray(e.matrix).equals(N.IDENTITY))&&!l(e.extensions)&&!l(e.extras)}function cge(e,t){ke.scene(e,function(n){let i=n.nodes;if(l(i)){let r=i.length;for(let o=r;o>=0;--o)if(i[o]===t){i.splice(o,1);return}}}),ke.node(e,function(n,i){if(l(n.children)){let r=n.children.indexOf(t);r>-1&&(n.children.splice(r,1),age(n)&&cge(e,i))}}),delete e.nodes[t]}function VKe(e){return ke.node(e,function(t,n){age(t)&&cge(e,n)}),e}function jKe(e){ke.animation(e,function(t){ke.animationSampler(t,function(n){let i=e.accessors[n.input];if(!l(i.min)||!l(i.max)){let r=lT(e,i);i.min=r.min,i.max=r.max}})})}function HKe(e){ke.accessor(e,function(t){if(l(t.min)||l(t.max)){let n=lT(e,t);l(t.min)&&(t.min=n.min),l(t.max)&&(t.max=n.max)}})}function GKe(e){e.asset=e.asset??{},e.asset.version="2.0",sge(e),CKe(e),VKe(e),vKe(e),SKe(e),IKe(e),DKe(e),kKe(e),UKe(e),zKe(e),jKe(e),HKe(e),RKe(e),OKe(e),MKe(e),FKe(e),hL(e),BKe(e),aL(e),lL(e),wKe(e)}var WKe=["u_tex","u_diffuse","u_emission","u_diffuse_tex"],qKe=["u_diffuse","u_diffuse_mat"];function l$(e){e.pbrMetallicRoughness=l(e.pbrMetallicRoughness)?e.pbrMetallicRoughness:{},e.pbrMetallicRoughness.roughnessFactor=1,e.pbrMetallicRoughness.metallicFactor=0}function u$(e){return l(e.index)}function f$(e){return Array.isArray(e)&&e.length===4}function lge(e){let t=new Array(4);t[3]=e[3];for(let n=0;n<3;n++){let i=e[n];i<=.04045?t[n]=e[n]*.07739938080495357:t[n]=Math.pow((i+.055)*.9478672985781991,2.4)}return t}function YKe(e,t){t=t??{};let n=t.baseColorTextureNames??WKe,i=t.baseColorFactorNames??qKe;ke.material(e,function(r){ke.materialValue(r,function(o,s){n.indexOf(s)!==-1&&u$(o)?(l$(r),r.pbrMetallicRoughness.baseColorTexture=o):i.indexOf(s)!==-1&&f$(o)&&(l$(r),r.pbrMetallicRoughness.baseColorFactor=lge(o))})}),uT(e,"KHR_techniques_webgl"),uT(e,"KHR_blend")}function a$(e,t){l(t)&&(f$(t)?e.pbrMetallicRoughness.baseColorFactor=lge(t):u$(t)&&(e.pbrMetallicRoughness.baseColorTexture=t))}function oge(e,t){l(t)&&(f$(t)?e.emissiveFactor=t.slice(0,3):u$(t)&&(e.emissiveTexture=t))}function XKe(e){ke.material(e,function(t){let n=(t.extensions??{}).KHR_materials_common;if(!l(n))return;let i=n.values??{},r=i.ambient,o=i.diffuse,s=i.emission,a=i.transparency,c=n.doubleSided,u=n.transparent;l$(t),n.technique==="CONSTANT"?(Ud(e,"KHR_materials_unlit"),t.extensions=l(t.extensions)?t.extensions:{},t.extensions.KHR_materials_unlit={},a$(t,s),a$(t,r)):(a$(t,o),oge(t,r),oge(t,s)),l(c)&&(t.doubleSided=c),l(a)&&(l(t.pbrMetallicRoughness.baseColorFactor)?t.pbrMetallicRoughness.baseColorFactor[3]*=a:t.pbrMetallicRoughness.baseColorFactor=[1,1,1,a]),l(u)&&(t.alphaMode=u?"BLEND":"OPAQUE")}),uT(e,"KHR_materials_common")}var mL=yKe;function ol(){}ol.getError=function(e,t,n){let i=`Failed to load ${e}: ${t}`;l(n)&&l(n.message)&&(i+=` +${i.stack}`),i}isDestroyed(){return!1}destroy(){return this.unload(),le(this)}},ir=HJ;var Ibe={UNLOADED:0,LOADING:1,LOADED:2,PROCESSING:3,READY:4,FAILED:5};Object.freeze(Ibe);var Tt=Ibe;var DH=class extends ir{constructor(t){super(),t=t??H.EMPTY_OBJECT;let n=t.typedArray,i=t.resource,r=t.cacheKey;this._typedArray=n,this._resource=i,this._cacheKey=r,this._state=Tt.UNLOADED,this._promise=void 0}get cacheKey(){return this._cacheKey}get typedArray(){return this._typedArray}async load(){return l(this._promise)?this._promise:l(this._typedArray)?(this._promise=Promise.resolve(this),this._promise):(this._promise=_et(this),this._promise)}static _fetchArrayBuffer(t){return t.fetchArrayBuffer()}unload(){this._typedArray=void 0}};async function _et(e){let t=e._resource;e._state=Tt.LOADING;try{let n=await DH._fetchArrayBuffer(t);return e.isDestroyed()?void 0:(e._typedArray=new Uint8Array(n),e._state=Tt.READY,e)}catch(n){if(e.isDestroyed())return;e._state=Tt.FAILED;let i=`Failed to load external buffer: ${t.url}`;throw e.getError(i,n)}}var ET=DH;function yet(e){let t=e?.extensions;if(l(t))return t.KHR_meshopt_compression??t.EXT_meshopt_compression}var pA=yet;var Djn=(function(){var e="b9H79Tebbbe9ok9Geueu9Geub9Gbb9Gruuuuuuueu9Gvuuuuueu9Gduueu9Gluuuueu9Gvuuuuub9Gouuuuuub9Gluuuub9GiuuueuiE8AdilveoveovrrwrrrDDoDrbqqbelve9Weiiviebeoweuecj:Gdkr:PlCo9TW9T9VV95dbH9F9F939H79T9F9J9H229F9Jt9VV7bb8F9TW79O9V9Wt9FW9U9J9V9KW9wWVtW949c919M9MWV9mW4W2be8A9TW79O9V9Wt9FW9U9J9V9KW9wWVtW949c919M9MWVbd8F9TW79O9V9Wt9FW9U9J9V9KW9wWVtW949c919M9MWV9c9V919U9KbiE9TW79O9V9Wt9FW9U9J9V9KW9wWVtW949wWV79P9V9UblY9TW79O9V9Wt9FW9U9J9V9KW69U9KW949c919M9MWVbv8E9TW79O9V9Wt9FW9U9J9V9KW69U9KW949c919M9MWV9c9V919U9Kbo8A9TW79O9V9Wt9FW9U9J9V9KW69U9KW949wWV79P9V9UbrE9TW79O9V9Wt9FW9U9J9V9KW69U9KW949tWG91W9U9JWbwa9TW79O9V9Wt9FW9U9J9V9KW69U9KW949tWG91W9U9JW9c9V919U9KbDL9TW79O9V9Wt9FW9U9J9V9KWS9P2tWV9p9JtbqK9TW79O9V9Wt9FW9U9J9V9KWS9P2tWV9r919HtbkL9TW79O9V9Wt9FW9U9J9V9KWS9P2tWVT949WbxY9TW79O9V9Wt9FW9U9J9V9KWS9P2tWVJ9V29VVbmE9TW79O9V9Wt9F9V9Wt9P9T9P96W9wWVtW94J9H9J9OWbza9TW79O9V9Wt9F9V9Wt9P9T9P96W9wWVtW94J9H9J9OW9ttV9P9WbHa9TW79O9V9Wt9F9V9Wt9P9T9P96W9wWVtW94SWt9J9O9sW9T9H9WbOK9TW79O9V9Wt9F79W9Ht9P9H29t9VVt9sW9T9H9WbAl79IV9RbXDwebcekdKYq:zf8Adbk;wadhud9:8Jjjjjbc;qw9Rgr8KjjjjbcbhwdnaeTmbabcbyd;i:I:cjbaoaocb9iEgDc:GeV86bbarc;adfcbcjdz:xjjjb8AdnaiTmbarc;adfadalz:wjjjb8Akarc;abfalfcbcbcjdal9RalcFe0Ez:xjjjb8Aarc;abfarc;adfalz:wjjjb8Aar9cb83iUar9cb83i8War9cb83iyar9cb83iaar9cb83iKar9cb83izar9cb83iwar9cb83ibcj;abal9Uc;WFbGcjdalca0Ehqdnaicd6mbavcd9imbaDTmbadcefhkaqci2gxal2hmarc;alfclfhParc;qlfceVhsarc;qofclVhzcbhHincdhOcbhAdnavci6mbar9cb83i;Ooar9cb83i;Goar9cb83i;yoar9cb83i;qoadaHfgoybbhCcbhXincbhwcbhQdninaoalfhLaoybbgKaC7aQVhQawcP0meaLhoaKhCawcefgwaXfai6mbkkcbhCarc;qofhwincwhYcwh8AdnaQaC93gocFeGgEcs0mbclh8AaEci0mbcdcbaEEh8Akdnaocw4cFeGgEcs0mbclhYaEci0mbcdcbaEEhYkaYa8AfhEawydbh3cwhYcwh8Adnaocz4cFeGg5cs0mbclh8Aa5ci0mbcdcba5Eh8AkaEa3fhEdnaocFFFFb0mbclhYaocFFF8F0mbcbcdaocjjjw6EhYkawaEa8AfaYfBdbawclfhwaCcefgCcw9hmbkaLhoaKhCaXczfgXai6mbkcbhocehwazhQinawaoaQydbarc;qofaocdtfydb6EhoaQclfhQawcefgwcw9hmbkaoclthAcihOkcbhEarc;qlfcbcjdz:xjjjb8AarcbBd;ilar9cb83i;aladh8Eaqh8Fakh3inarc;qlfadaEaEcb9h9Ral2falz:wjjjb8Aaia8Faia8F6EhadnaqaiaE9RaEaqfai6EgKcsfc9WGgoaK9nmbarc;qofaKfcbaoaK9Rz:xjjjb8AkadaEal2fhhcbhginagaAVcl4hXarc;alfagcdtfh8JaHh8Kcbh8Lina8LaHfhwdndndndndndndnagPlbedibkaKTmvahawfhoarc;qlfawfRbbhQarc;qofhwaahCinawaoRbbgYaQ9RgQcetaQcKtc8F91786bbawcefhwaoalfhoaYhQaEaCcufgC9hmbxvkkaKTmla8Kc9:Ghoa8LcitcwGh8Aarc;qlfawceVfRbbcwtarc;qlfawc9:GfRbbVhQarc;qofhwaahCinawa3aofRbbcwta8EaofRbbVgYaQ9RgQcetaQcztc8F917cFFiGa8A486bbaoalfhoawcefhwaYhQaEaCcufgC9hmbxlkkasa8Kc98GgQfhoa3aQfhYarc;qlfawc98GgQfRbbhCcwhwinaoRbbawtaCVhCaocefhoawcwfgwca9hmbxdkkaKTmdxekaKTmea8Lcith5ahaQfh8AcbhLina8ARbbhQcwhoaYhwinawRbbaotaQVhQawcefhwaocwfgoca9hmbkarc;qofaLfaQaC7aX93a5486bbaYalfhYa8Aalfh8AaQhCaLcefgLaK9hmbkka8Jydbh8AcbhLarc;qofhoincdhQcbhwinaQaoawfRbbcb9hfhQawcefgwcz9hmbkclhCcbhwinaCaoawfRbbcd0fhCawcefgwcz9hmbkcwhYcbhwinaYaoawfRbbcP0fhYawcefgwcz9hmbkaQaCaQaC6EgwaYawaY6Egwczawcz6Ea8Afh8AaoczfhoaLczfgLaK6mbka8Ja8ABdbka8Kcefh8Ka8Lcefg8Lcl9hmbkagcefggaO9hmbka8Eamfh8Ea8Faxfh8Fa3amfh3aEaxfgEai6mbkcbhocehwaPhQinawaoaQydbarc;alfaocdtfydb6EhoaQclfhQaOawcefgw9hmbkaraHcd4faAcdVaoaocdSE86bbaHclfgHal6mbkkabaefhgabcefhoalcd4g8McbaDEhkadcefh8Narc;abfceVhecbhmdndninaiam9nmearc;qofcbcjdz:xjjjb8Aagao9Rak6mdadamal2gwfhxcbhHa8Nawfhzaocbakz:xjjjbg8Fakfh3aqaiam9Ramaqfai6Egscsfgocl4cifcd4hOaoc9WGg8JThPindndndndndndndndndndnaDTmbaraHcd4fRbbgQciGPlbedlbkasTmdaxaHfhoarc;abfaHfRbbhQarc;qofhwashCinawaoRbbgYaQ9RgQcetaQcKtc8F91786bbawcefhwaoalfhoaYhQaCcufgCmbxikkasTmiaHcitcwGh8Aarc;abfaHceVfRbbcwtarc;abfaHc9:GgofRbbVhQaxaofhoarc;qofhwashCinawao8VbbgYaQ9RgQcetaQcztc8F917cFFiGa8A486bbawcefhwaoalfhoaYhQaCcufgCmbxikkaeaHc98Gg8Afhoaza8AfhYarc;abfa8AfRbbhCcwhwinaoRbbawtaCVhCaocefhoawcwfgwca9hmbkasTmdaQcl4hKaHcitcKGhEaxa8Afh8AcbhLina8ARbbhQcwhoaYhwinawRbbaotaQVhQawcefhwaocwfgoca9hmbkarc;qofaLfaQaC7aK93aE486bbaYalfhYa8Aalfh8AaQhCaLcefgLas9hmbkkaDmbcbhoxlka8JTmbcbhodninarc;qofaofgwcwf8Pibaw8Pib:e9qTmeaoczfgoa8J9pmdxbkkdnavmbcehoxikcbh8AaOhLaOhKinarc;qofa8Afgocwf8Pibhyao8Pibh8PcdhQcbhwinaQaoawfRbbcb9hfhQawcefgwcz9hmbkclhCcbhwinaCaoawfRbbcd0fhCawcefgwcz9hmbkcwhYcbhwinaYaoawfRbbcP0fhYawcefgwcz9hmbkaQaCaQaC6EgoaYaoaY6Egoczaocz6EaKfhKaocucbaya8P:e9cb9sEgwaoaw6EaLfhLa8Aczfg8Aa8J9pmdxbkka8FaHcd4fgoaoRbbcdaHcetcoGtV86bbxikdnaLas6mbaKas6mba8FaHcd4fgoaoRbbciaHcetcoGtV86bbaga39Ras6mra3arc;qofasz:wjjjbasfh3xikaLaK9phoka8FaHcd4fgwawRbbaoaHcetcoGtV86bbkaga39RaO6mla3cbaOz:xjjjbgaaOfhKdndna8JmbaPhoxekdnagaK9RcK9pmbaPhoxekaocdtc:q:G:cjbfcj:G:cjbaDEg3ydxghcetc;:FFFeGhAcuhEcuahtcu7cFeGh8Ecbh8Karc;qofhQinarc;qofa8KfhXczh8AdndndnahPDbeeeeeeedekcucbaXcwf8PibaX8Pib:e9cb9sEh8AxekcbhoaAh8Aina8Aa8EaQaofRbb9nfh8Aaocefgocz9hmbkkcih5cbhYinczhwdndndna3aYcdtfydbgLPDbeeeeeeedekcucbaXcwf8PibaX8Pib:e9cb9sEhwxekaLcetc;:FFFeGhwcuaLtcu7cFeGhCcbhoinawaCaQaofRbb9nfhwaocefgocz9hmbkkdndnawa8A6mbaLaE9hmeawa8A9hmea3a5cdtfydbcwSmekaYh5awh8AkaYcefgYci9hmbkaaa8Kco4fgoaoRbba5a8Kci4coGtV86bbdndndna3a5cdtfydbgEPDdbbbbbbbebkdncwaE9Tg5TmbcuaEtcu7hwdndnaEceSmbcbh8LaQhXinaXhoa5hYcbhCinaoRbbg8AawcFeGgLa8AaL6EaCaEtVhCaocefhoaYcufgYmbkaKaC86bbaXa5fhXaKcefhKa8La5fg8Lcz6mbxdkkcbh8LaQhXinaXhoa5hYcbhCinaoRbbg8AawcFeGgLa8AaL6EaCcetVhCaocefhoaYcufgYmbkaKaC:T9cFe:d9c:c:qj:bw9:9c:q;c1:I1e:d9c:b:c:e1z9:9ca188bbaXa5fhXaKcefhKa8La5fg8Lcz6mbkkcbhoinaKaQaofRbbgC86bbaKaCawcFeG9pfhKaocefgocz9hmbxikkdnaEceSmbinaKcb86bbaKcefhKxbkkinaKcb86bbaKcefhKxbkkaKaX8Pbw83bwaKaX8Pbb83bbaKczfhKka8Kczfg8Ka8J9pgomeaQczfhQagaK9RcK9pmbkkaoTmlaKh3aKTmlkaHcefgHal9hmbkarc;abfaxascufal2falz:wjjjb8Aasamfhma3hoa3mbkcbhwxdkdnagao9RakalfgwcKcaaDEgQawaQ0EgC9pmbcbhwxdkdnawaQ9pmbaocbaCaw9Rgwz:xjjjbawfhokaoarc;adfalz:wjjjbalfhodnaDTmbaoara8Mz:wjjjba8Mfhokaoab9Rhwxekcbhwkarc;qwf8Kjjjjbawk5babaeadaialcdcbyd;i:I:cjbz:bjjjbk9reduaecd4gdaefgicaaica0Eabcj;abae9Uc;WFbGcjdaeca0Egifcufai9Uae2aiadfaicl4cifcd4f2fcefkmbcbabBd;i:I:cjbk;HPeLu8Jjjjjbc;ae9Rgl8Kjjjjbcbhvdnaeaici9UgocHf6mbabcbyd;m:I:cjbgrc;GeV86bbalc;abfcFecjez:xjjjb8Aal9cu83iUal9cu83i8Wal9cu83iyal9cu83iaal9cu83iKal9cu83izal9cu83iwal9cu83ibabaefc9WfhwabcefgDaofhednaiTmbcmcsarcb9kgqEhkcbhxcbhmcbhPcbhscbhzindnaeaw9nmbcbhvxikazcufhvadaPcdtfgHydbhOaHcwfydbhAaHclfydbhCcbhXdndndninalc;abfavcsGcitfgoydlhQdndndnaoydbgoaO9hmbaQaCSmekdnaoaC9hmbaQaA9hmbaXcefhXxekaoaA9hmeaQaO9hmeaXcdfhXkaXc870mdascufhvaHaXcdtgAcxGgoyd:4:G:cjbcdtfydbhQaHaoyd:0:G:cjbcdtfydbhCaHaoyd:W:G:cjbcdtfydbhOcbhodnindnalavcsGcdtfydbaQ9hmbaohXxdkcuhXavcufhvaocefgocz9hmbkkaxaQaxSgvaXce9iaXak9oVgoGfhxdndndncbcsavEaXaoEgvcs9hmbarce9imbaQaQamaQcefamSgvEgmcefSmecmcsavEhvkaDavaAc;WeGV86bbavcs9hmeaQam9Rgvcetavc8F917hvinaecbcjeavcje6EavcFbGV86bbaecefheavcr4gvmbkaQhmxvkcPhvaDaAcPV86bbaQhmkavTmiavak9omicdhocehXazhAxlkavcufhvaXclfgXc;ab9hmbkkdnaHcecdcbaAaxSEaCaxSEcdtgvyd:W:G:cjbcdtfydbgOTaHavyd:0:G:cjbcdtfydbgCceSGaHavyd:4:G:cjbcdtfydbgQcdSGaxcb9hGaqGgLce9hmbal9cu83iUal9cu83i8Wal9cu83iyal9cu83iaal9cu83iKal9cu83izal9cu83iwal9cu83ibcbhxkcbhXascufgvhodnindnalaocsGcdtfydbaC9hmbaXhAxdkcuhAaocufhoaXcefgXcz9hmbkkcbhodnindnalavcsGcdtfydbaQ9hmbaohXxdkcuhXavcufhvaocefgocz9hmbkkaxaOaxSgKfhHdndnaAcm0mbaAcefhAxekcbcsaCaHSgvEhAaHavfhHkdndnaXcm0mbaXcefhXxekcbcsaQaHSgvEhXaHavfhHkc9:cuaKEhYcbhvaXaAcltVg8AcFeGhodndndninavc;q:G:cjbfRbbaoSmeavcefgvcz9hmbxdkkaLaOax9havcm0VVmbaDavc;WeV86bbxekaDaY86bbaea8A86bbaecefhekdnaKmbaOam9Rgvcetavc8F917hvinaecbcjeavcje6EavcFbGV86bbaecefheavcr4gvmbkaOhmkdnaAcs9hmbaCam9Rgvcetavc8F917hvinaecbcjeavcje6EavcFbGV86bbaecefheavcr4gvmbkaChmkdnaXcs9hmbaQam9Rgvcetavc8F917hvinaecbcjeavcje6EavcFbGV86bbaecefheavcr4gvmbkaQhmkalascdtfaOBdbascefcsGhvdndnaAPzbeeeeeeeeeeeeeebekalavcdtfaCBdbascdfcsGhvkdndnaXPzbeeeeeeeeeeeeeebekalavcdtfaQBdbavcefcsGhvkcihoalc;abfazcitfgXaOBdlaXaCBdbazcefcsGhAcdhXavhsaHhxxekcdhoalascdtfaQBdbcehXascefcsGhsazhAkalc;abfaAcitfgvaCBdlavaQBdbalc;abfazaXfcsGcitfgvaQBdlavaOBdbaDcefhDazaofcsGhzaPcifgPai6mbkkdnaeaw9nmbcbhvxekcbhvinaeavfavc;q:G:cjbfRbb86bbavcefgvcz9hmbkaeab9Ravfhvkalc;aef8KjjjjbavkZeeucbhddninadcefgdc8F0meaeceadt0mbkkadcrfcFeGcr9Uci2cdfabci9U2cHfkmbcbabBd;m:I:cjbk:zderu8Jjjjjbcz9Rhlcbhvdnaeaicvf6mbabcbRb;m:I:cjbc;qeV86bbal9cb83iwabcefhvabaefc98fhodnaiTmbcbhecbhrcbhwindnavao6mbcbskadawcdtfydbgDalcwfaraDae9Rgeaec8F91ge7ae9Rc507grcdtfgqydb9Rgec8E91c9:Gaecdt7arVheinavcbcjeaecje6EaecFbGV86bbavcefhvaecr4gembkaqaDBdbaDheawcefgwai9hmbkkdnavao9nmbcbskavcbBbbavab9RclfhvkavkBeeucbhddninadcefgdc8F0meaeceadt0mbkkabadcwfcFeGcr9U2cvfk:dvli99dui99ludnaeTmbcuadcetcuftcu7:Zhvdndncuaicuftcu7:ZgoJbbbZMgr:lJbbb9p9DTmbar:Ohwxekcjjjj94hwkcbhicbhDinalclfIdbgrJbbbbJbbjZalIdbgq:lar:lMalcwfIdbgk:lMgr:varJbbbb9BEgrNhxaqarNhralcxfIdbhqdndnakJbbbb9GTmbaxhkxekJbbjZar:l:tgkak:maxJbbbb9GEhkJbbjZax:l:tgxax:marJbbbb9GEhrkdndnaqJbbj:;aqJbbj:;9GEgxJbbjZaxJbbjZ9FEavNJbbbZJbbb:;aqJbbbb9GEMgq:lJbbb9p9DTmbaq:Ohmxekcjjjj94hmkdndnakJbbj:;akJbbj:;9GEgqJbbjZaqJbbjZ9FEaoNJbbbZJbbb:;akJbbbb9GEMgq:lJbbb9p9DTmbaq:OhPxekcjjjj94hPkdndnarJbbj:;arJbbj:;9GEgqJbbjZaqJbbjZ9FEaoNJbbbZJbbb:;arJbbbb9GEMgr:lJbbb9p9DTmbar:Ohsxekcjjjj94hskdndnadcl9hmbabaDfgzas86bbazcifam86bbazcdfaw86bbazcefaP86bbxekabaifgzas87ebazcofam87ebazclfaw87ebazcdfaP87ebkaicwfhiaDclfhDalczfhlaecufgembkkk;hlld99eud99eudnaeTmbdndncuaicuftcu7:ZgvJbbbZMgo:lJbbb9p9DTmbao:Ohixekcjjjj94hikaic;8FiGhrinabcofcicdalclfIdb:lalIdb:l9EgialcwfIdb:lalaicdtfIdb:l9EEgialcxfIdb:lalaicdtfIdb:l9EEgiarV87ebdndnJbbj:;JbbjZalaicdtfIdbJbbbb9DEgoalaicd7cdtfIdbJ;Zl:1ZNNgwJbbj:;awJbbj:;9GEgDJbbjZaDJbbjZ9FEavNJbbbZJbbb:;awJbbbb9GEMgw:lJbbb9p9DTmbaw:Ohqxekcjjjj94hqkabcdfaq87ebdndnalaicefciGcdtfIdbJ;Zl:1ZNaoNgwJbbj:;awJbbj:;9GEgDJbbjZaDJbbjZ9FEavNJbbbZJbbb:;awJbbbb9GEMgw:lJbbb9p9DTmbaw:Ohqxekcjjjj94hqkabaq87ebdndnaoalaicufciGcdtfIdbJ;Zl:1ZNNgoJbbj:;aoJbbj:;9GEgwJbbjZawJbbjZ9FEavNJbbbZJbbb:;aoJbbbb9GEMgo:lJbbb9p9DTmbao:Ohixekcjjjj94hikabclfai87ebabcwfhbalczfhlaecufgembkkk;gvdDue998Jjjjjbcjd9Rgo8Kjjjjbdndndnadcd4grTmbc:CucbavEhwaohdarhDinadawBdbadclfhdaDcufgDmbkavcd9hmbaeTmbarcdthqcbhkalhxinaohdaxhDarhwinadadydbgmaDydbcL4cFeGc:cufgPamaP9kEBdbaDclfhDadclfhdawcufgwmbkaxaqfhxakcefgkae9hmbxdkkaeTmekarcdthxavce9hhqcbhkindndndnaqmbarTmdc:CuhDalhdarhwinaDadydbcL4cFeGc:cufgmaDam9kEhDadclfhdawcufgwmbxdkkdndndndnavPleddbdkarTmlaohdalhDarhwinadcbaDydbcL4cFeGgmc:cufgPaPam0EBdbadclfhdaDclfhDawcufgwmbxikkarTmicbhdarhDindnaladfIdbgsJbbbb9Bmbaoadfas:8cL4cFeGgwc8Aawc8A0Ec:cufBdbkadclfhdaDcufgDmbxdkkarTmdkc:CuhDkcbhdarhminaDhwdnavceSmbaoadfydbhwkdndnaladfIdbgscjjj;8iawai9RcefgwcLt9R::NJbbbZJbbb:;asJbbbb9GEMgs:lJbbb9p9DTmbas:OhPxekcjjjj94hPkabadfaPcFFFrGawcKtVBdbadclfhdamcufgmmbkkabaxfhbalaxfhlakcefgkae9hmbkkaocjdf8Kjjjjbk:Olveue99iue99iudnaeTmbceaicufthvcuaitcu7:Zhocbhradcl9hhwcbhDindndnalcwfIdbgqJbbbbaqJbbbb9GEgqJbbjZaqJbbjZ9FEaoNJbbbZMgq:lJbbb9p9DTmbaq:Ohixekcjjjj94hikdndnalIdbgqJbbbbaqJbbbb9GEgqJbbjZaqJbbjZ9FEaoNJbbbZMgq:lJbbb9p9DTmbaq:Ohdxekcjjjj94hdkadai9Rcd9TgkaifhidndnalclfIdbgqJbbbbaqJbbbb9GEgqJbbjZaqJbbjZ9FEaoNJbbbZMgq:lJbbb9p9DTmbaq:Ohdxekcjjjj94hdkadai9Rcd9ThddndnalcxfIdbgqJbbbbaqJbbbb9GEgqJbbjZaqJbbjZ9FEaoNJbbbZMgq:lJbbb9p9DTmbaq:Ohxxekcjjjj94hxkadaifhiaxce91avVhxdndnawmbabaDfgmai86bbamcifax86bbamcdfad86bbamcefak86bbxekabarfgmai87ebamcofax87ebamclfad87ebamcdfak87ebkarcwfhraDclfhDalczfhlaecufgembkkk;mqdQui998Jjjjjbc:qd9Rgv8Kjjjjbavc:Sefcbc;Kbz:xjjjb8AdnadTmbaiTmbdndnabaeSmbaehoxekavcuadcdtgradcFFFFi0Ecbyd;q:I:cjbHjjjjbbgoBd:SeavceBd:mdaoaearz:wjjjb8AkavcbBd:Oeav9cb83i:Geavc:Gefaoadaiavc:Sefz:pjjjbavyd:Gehwadci9UgDcbyd;q:I:cjbHjjjjbbheavc:Sefavyd:mdgqcdtfaeBdbavaqcefgrBd:mdaecbaDz:xjjjbhkavc:SefarcdtfcuaicdtaicFFFFi0Ecbyd;q:I:cjbHjjjjbbgxBdbavaqcdfgmBd:mdalc;ebfhPawheaxhrinaralIdbaPaeydbgscwascw6EcdtfIdbMUdbaeclfhearclfhraicufgimbkavc:SefamcdtfcuaDcdtadcFFFF970Ecbyd;q:I:cjbHjjjjbbgmBdbdnadci6mbaoheamhraDhiinaraxaeydbcdtfIdbaxaeclfydbcdtfIdbMaxaecwfydbcdtfIdbMUdbaecxfhearclfhraicufgimbkkaqcifhzalc;ebfhHavc;qbfhOavheavyd:KehAavyd:OehCcbhscbhrcbhXcehQinaehLaoarcx2fgKydbhPaKclfydbhdabaXcx2fgecwfaKcwfydbgYBdbaeclfadBdbaeaPBdbakarfce86bbaOaYBdwaOadBdlaOaPBdbamarcdtfcbBdbcih8AdnasTmbaLhiinaOa8AcdtfaiydbgeBdba8AaeaY9haeaP9haead9hGGfh8AaiclfhiascufgsmbkkaXcefhXcbhsinaCaAaKascdtfydbcdtgifydbcdtfgYheawaifgdydbgPhidnaPTmbdninaeydbarSmeaeclfheaicufgiTmdxbkkaeaYaPcdtfc98fydbBdbadadydbcufBdbkascefgsci9hmbkdndndna8ATmbcuhrJbbbbhEcbhdavyd:KehYavyd:OehKindnawaOadcdtfydbcdtgsfydbgeTmbaxasfgiIdbh3aialcuadadcs0EcdtfclfIdbaHaecwaecw6EcdtfIdbMg5Udba5a3:th5aecdthiaKaYasfydbcdtfheinamaeydbgscdtfgPa5aPIdbMg3Udba3aEaEa39DgPEhEasaraPEhraeclfheaic98fgimbkkadcefgda8A9hmbkarcu9hmekaQaD9pmeindnakaQfRbbmbaQhrxdkaDaQcefgQ9hmbxdkka8Acza8Acz6EhsaOheaLhOarcu9hmekkazTmbaqcdtavc:Seffcwfheinaeydbcbyd;u:I:cjbH:bjjjbbaec98fheazcufgzmbkkavc:qdf8Kjjjjbk:0leoucuaicdtgvaicFFFFi0Egocbyd;q:I:cjbHjjjjbbhralalyd9GgwcdtfarBdbalawcefBd9GabarBdbaocbyd;q:I:cjbHjjjjbbhralalyd9GgocdtfarBdbalaocefBd9GabarBdlcuadcdtadcFFFFi0Ecbyd;q:I:cjbHjjjjbbhralalyd9GgocdtfarBdbalaocefBd9GabarBdwabydbcbavz:xjjjb8AabydbhraehladhvinaralydbcdtfgoaoydbcefBdbalclfhlavcufgvmbkcbhvabydlglhoarhwaihDinaoavBdbaoclfhoawydbavfhvawclfhwaDcufgDmbkadci9Uhqdnadcd9nmbabydwhocbhvinaecwfydbhwaeclfydbhDalaeydbcdtfgbabydbgbcefBdbaoabcdtfavBdbalaDcdtfgDaDydbgDcefBdbaoaDcdtfavBdbalawcdtfgwawydbgwcefBdbaoawcdtfavBdbaecxfheaqavcefgv9hmbkkinalalydbarydb9RBdbarclfhralclfhlaicufgimbkkQbabaeadaic;G:G:cjbz:ojjjbkQbabaeadaic;i:H:cjbz:ojjjbk9DeeuabcFeaicdtz:xjjjbhlcbhbdnadTmbindnalaeydbcdtfgiydbcu9hmbaiabBdbabcefhbkaeclfheadcufgdmbkkabk:3vioud9:du8Jjjjjbc;Wa9Rgl8Kjjjjbcbhvalcxfcbc;Kbz:xjjjb8AalcuadcitgoadcFFFFe0Ecbyd;q:I:cjbHjjjjbbgrBdxalceBd2araeadaicezNjjjbalcuaoadcjjjjoGEcbyd;q:I:cjbHjjjjbbgwBdzadcdthednadTmbabhiinaiavBdbaiclfhiadavcefgv9hmbkkawaefhDalabBdwalawBdl9cbhqindnadTmbaq9cq9:hkarhvaDhiadheinaiav8Pibak1:NcFrG87ebavcwfhvaicdfhiaecufgembkkalclfaq:NceGcdtfydbhxalclfaq9ce98gq:NceGcdtfydbhmalc;Wbfcbcjaz:xjjjb8AaDhvadhidnadTmbinalc;Wbfav8VebcdtfgeaeydbcefBdbavcdfhvaicufgimbkkcbhvcbhiinalc;WbfavfgeydbhoaeaiBdbaoaifhiavclfgvcja9hmbkadhvdndnadTmbinalc;WbfaDamydbgicetf8VebcdtfgeaeydbgecefBdbaxaecdtfaiBdbamclfhmavcufgvmbkaq9cv9smdcbhvinabawydbcdtfavBdbawclfhwadavcefgv9hmbxdkkaq9cv9smekkcwhvcbhiinalcxfavfc98fydbcbyd;u:I:cjbH:bjjjbbaiceGheclhvcehiaeTmbkalc;Waf8Kjjjjbk:Awliuo99iud9:cbhv8Jjjjjbca9Rgocbyd:4:I:cjbBdKaocb8Pd:W:I:cjb83izaocbyd;e:I:cjbBdwaocb8Pd:8:I:cjb83ibaicd4hrdndnadmbJFFuFhwJFFuuhDJFFuuhqJFFuFhkJFFuuhxJFFuFhmxekarcdthPaehsincbhiinaoczfaifgzasaifIdbgwazIdbgDaDaw9EEUdbaoaifgzawazIdbgDaDaw9DEUdbaiclfgicx9hmbkasaPfhsavcefgvad9hmbkaoIdKhDaoIdwhwaoIdChqaoIdlhkaoIdzhxaoIdbhmkdnadTmbJbbbbJbFu9hJbbbbamax:tgmamJbbbb9DEgmakaq:tgkakam9DEgkawaD:tgwawak9DEgw:vawJbbbb9BEhwdnalmbarcdthoindndnaeclfIdbaq:tawNJbbbZMgk:lJbbb9p9DTmbak:Ohixekcjjjj94hikai:S9cC:ghHdndnaeIdbax:tawNJbbbZMgk:lJbbb9p9DTmbak:Ohixekcjjjj94hikaHai:S:ehHdndnaecwfIdbaD:tawNJbbbZMgk:lJbbb9p9DTmbak:Ohixekcjjjj94hikabaHai:T9cy:g:e83ibaeaofheabcwfhbadcufgdmbxdkkarcdthoindndnaeIdbax:tawNJbbbZMgk:lJbbb9p9DTmbak:Ohixekcjjjj94hikai:SgH9ca:gaH9cz:g9cjjj;4s:d:eaH9cFe:d:e9cF:bj;4:pj;ar:d9c:bd9:9c:p;G:d;4j:E;ar:d9cH9:9c;d;H:W:y:m:g;d;Hb:d9cv9:9c;j:KM;j:KM;j:Kd:dhOdndnaeclfIdbaq:tawNJbbbZMgk:lJbbb9p9DTmbak:Ohixekcjjjj94hikai:SgH9ca:gaH9cz:g9cjjj;4s:d:eaH9cFe:d:e9cF:bj;4:pj;ar:d9c:bd9:9c:p;G:d;4j:E;ar:d9cH9:9c;d;H:W:y:m:g;d;Hb:d9cq9:9cM;j:KM;j:KM;jl:daO:ehOdndnaecwfIdbaD:tawNJbbbZMgk:lJbbb9p9DTmbak:Ohixekcjjjj94hikabaOai:SgH9ca:gaH9cz:g9cjjj;4s:d:eaH9cFe:d:e9cF:bj;4:pj;ar:d9c:bd9:9c:p;G:d;4j:E;ar:d9cH9:9c;d;H:W:y:m:g;d;Hb:d9cC9:9c:KM;j:KM;j:KMD:d:e83ibaeaofheabcwfhbadcufgdmbkkk9teiucbcbyd;y:I:cjbgeabcifc98GfgbBd;y:I:cjbdndnabZbcztgd9nmbcuhiabad9RcFFifcz4nbcuSmekaehikaik;LeeeudndnaeabVciGTmbabhixekdndnadcz9pmbabhixekabhiinaiaeydbBdbaiclfaeclfydbBdbaicwfaecwfydbBdbaicxfaecxfydbBdbaeczfheaiczfhiadc9Wfgdcs0mbkkadcl6mbinaiaeydbBdbaeclfheaiclfhiadc98fgdci0mbkkdnadTmbinaiaeRbb86bbaicefhiaecefheadcufgdmbkkabk;aeedudndnabciGTmbabhixekaecFeGc:b:c:ew2hldndnadcz9pmbabhixekabhiinaialBdbaicxfalBdbaicwfalBdbaiclfalBdbaiczfhiadc9Wfgdcs0mbkkadcl6mbinaialBdbaiclfhiadc98fgdci0mbkkdnadTmbinaiae86bbaicefhiadcufgdmbkkabk9teiucbcbyd;y:I:cjbgeabcrfc94GfgbBd;y:I:cjbdndnabZbcztgd9nmbcuhiabad9RcFFifcz4nbcuSmekaehikaikTeeucbabcbyd;y:I:cjbge9Rcifc98GaefgbBd;y:I:cjbdnabZbcztge9nmbabae9RcFFifcz4nb8Akkk;Sddbcj:Gdk;idbbbbdbbblbbbwbbbbbbbebbbdbbblbbbwbbbbbbbbbbbbbbbbbbbebbbdbbbbbbbebbbbbbbbbbbbbbbb4:h9w9N94:P:gW:j9O:ye9Pbbbbbb:l29hZ;69:9kZ;N;76Z;rg97Z;z;o9xZ8J;B85Z;:;u9yZ;b;k9HZ:2;Z9DZ9e:l9mZ59A8KZ:r;T3Z:A:zYZ79OHZ;j4::8::Y:D9V8:bbbb9s:49:Z8R:hBZ9M9M;M8:L;z;o8:;8:PG89q;x:J878R:hQ8::M:B;e87bbbbbbjZbbjZbbjZ:E;V;N8::Y:DsZ9i;H;68:xd;R8:;h0838:;W:NoZbbbb:WV9O8:uf888:9i;H;68:9c9G;L89;n;m9m89;D8Ko8:bbbbf:8tZ9m836ZS:2AZL;zPZZ818EZ9e:lxZ;U98F8:819E;68:FFuuFFuuFFuuFFuFFFuFFFuFbc;i:IdkCebbbebbbebbbdbbb9G:rbb",t=new Uint8Array([32,0,65,2,1,106,34,33,3,128,11,4,13,64,6,253,10,7,15,116,127,5,8,12,40,16,19,54,20,9,27,255,113,17,42,67,24,23,146,148,18,14,22,45,70,69,56,114,101,21,25,63,75,136,108,28,118,29,73,115]);if(typeof WebAssembly!="object")return{supported:!1};var n,i=WebAssembly.instantiate(r(e),{}).then(function(g){n=g.instance,n.exports.__wasm_call_ctors(),n.exports.meshopt_encodeVertexVersion(1),n.exports.meshopt_encodeIndexVersion(1)});function r(g){for(var m=new Uint8Array(g.length),y=0;y<g.length;++y){var A=g.charCodeAt(y);m[y]=A>96?A-97:A>64?A-39:A+4}for(var b=0,y=0;y<g.length;++y)m[b++]=m[y]<60?t[m[y]]:(m[y]-60)*64+m[++y];return m.buffer.slice(0,b)}function o(g){if(!g)throw new Error("Assertion failed")}function s(g){return new Uint8Array(g.buffer,g.byteOffset,g.byteLength)}function a(g,m,y,A){var b=n.exports.sbrk,x=b(m.length*4),T=b(y*4),E=new Uint8Array(n.exports.memory.buffer),v=s(m);E.set(v,x),A&&A(x,x,m.length,y);var S=g(T,x,m.length,y);E=new Uint8Array(n.exports.memory.buffer);var I=new Uint32Array(y);new Uint8Array(I.buffer).set(E.subarray(T,T+y*4)),v.set(E.subarray(x,x+m.length*4)),b(x-b(0));for(var R=0;R<m.length;++R)m[R]=I[m[R]];return[I,S]}function c(g,m,y,A){var b=n.exports.sbrk,x=b(y*4),T=b(y*A),E=new Uint8Array(n.exports.memory.buffer);E.set(s(m),T),g(x,T,y,A),E=new Uint8Array(n.exports.memory.buffer);var v=new Uint32Array(y);return new Uint8Array(v.buffer).set(E.subarray(x,x+y*4)),b(x-b(0)),v}function u(g,m,y,A,b,x,T){var E=n.exports.sbrk,v=E(m),S=E(A*b),I=new Uint8Array(n.exports.memory.buffer);I.set(s(y),S);var R=g(v,m,S,A,b,x,T),O=new Uint8Array(R);return O.set(I.subarray(v,v+R)),E(v-E(0)),O}function f(g){for(var m=0,y=0;y<g.length;++y){var A=g[y];m=m<A?A:m}return m}function d(g,m){if(o(m==2||m==4),m==4)return new Uint32Array(g.buffer,g.byteOffset,g.byteLength/4);var y=new Uint16Array(g.buffer,g.byteOffset,g.byteLength/2);return new Uint32Array(y)}function p(g,m,y,A,b,x,T){var E=n.exports.sbrk,v=E(y*A),S=E(y*x),I=new Uint8Array(n.exports.memory.buffer);I.set(s(m),S),g(v,y,A,b,S,T);var R=new Uint8Array(y*A);return R.set(I.subarray(v,v+y*A)),E(v-E(0)),R}return{ready:i,supported:!0,reorderMesh:function(g,m,y){o(g instanceof Uint32Array||g instanceof Int32Array),o(!m||g.length%3==0);var A=m?y?n.exports.meshopt_optimizeVertexCacheStrip:n.exports.meshopt_optimizeVertexCache:void 0;return a(n.exports.meshopt_optimizeVertexFetchRemap,g,f(g)+1,A)},reorderPoints:function(g,m){return o(g instanceof Float32Array),o(g.length%m==0),o(m>=3),c(n.exports.meshopt_spatialSortRemap,g,g.length/m,m*4)},encodeVertexBuffer:function(g,m,y){o(y>0&&y<=256),o(y%4==0);var A=n.exports.meshopt_encodeVertexBufferBound(m,y);return u(n.exports.meshopt_encodeVertexBuffer,A,g,m,y)},encodeVertexBufferLevel:function(g,m,y,A,b){o(y>0&&y<=256),o(y%4==0),o(A>=0&&A<=3),o(b===void 0||b==0||b==1);var x=n.exports.meshopt_encodeVertexBufferBound(m,y);return u(n.exports.meshopt_encodeVertexBufferLevel,x,g,m,y,A,b===void 0?-1:b)},encodeIndexBuffer:function(g,m,y){o(y==2||y==4),o(m%3==0);var A=d(g,y),b=n.exports.meshopt_encodeIndexBufferBound(m,f(A)+1);return u(n.exports.meshopt_encodeIndexBuffer,b,A,m,4)},encodeIndexSequence:function(g,m,y){o(y==2||y==4);var A=d(g,y),b=n.exports.meshopt_encodeIndexSequenceBound(m,f(A)+1);return u(n.exports.meshopt_encodeIndexSequence,b,A,m,4)},encodeGltfBuffer:function(g,m,y,A,b){var x={ATTRIBUTES:this.encodeVertexBufferLevel,TRIANGLES:this.encodeIndexBuffer,INDICES:this.encodeIndexSequence};return o(x[A]),x[A](g,m,y,2,b===void 0?0:b)},encodeFilterOct:function(g,m,y,A){return o(y==4||y==8),o(A>=2&&A<=16),p(n.exports.meshopt_encodeFilterOct,g,m,y,A,16)},encodeFilterQuat:function(g,m,y,A){return o(y==8),o(A>=4&&A<=16),p(n.exports.meshopt_encodeFilterQuat,g,m,y,A,16)},encodeFilterExp:function(g,m,y,A,b){o(y>0&&y%4==0),o(A>=1&&A<=24);var x={Separate:0,SharedVector:1,SharedComponent:2,Clamped:3};return o(!b||b in x),p(n.exports.meshopt_encodeFilterExp,g,m,y,A,y,b?x[b]:1)},encodeFilterColor:function(g,m,y,A){return o(y==4||y==8),o(A>=2&&A<=16),p(n.exports.meshopt_encodeFilterColor,g,m,y,A,16)}}})();var gA=(function(){var e="b9H79Tebbbe8Fv9Gbb9Gvuuuuueu9Giuuub9Geueu9Giuuueuixkbeeeddddillviebeoweuecj:Gdkr;Neqo9TW9T9VV95dbH9F9F939H79T9F9J9H229F9Jt9VV7bb8A9TW79O9V9Wt9F9KW9J9V9KW9wWVtW949c919M9MWVbeY9TW79O9V9Wt9F9KW9J9V9KW69U9KW949c919M9MWVbdE9TW79O9V9Wt9F9KW9J9V9KW69U9KW949tWG91W9U9JWbiL9TW79O9V9Wt9F9KW9J9V9KWS9P2tWV9p9JtblK9TW79O9V9Wt9F9KW9J9V9KWS9P2tWV9r919HtbvL9TW79O9V9Wt9F9KW9J9V9KWS9P2tWVT949WboY9TW79O9V9Wt9F9KW9J9V9KWS9P2tWVJ9V29VVbrl79IV9Rbwq1Zkdbk:kYi5ud9:du8Jjjjjbcjq9Rgv8Kjjjjbc9:hodnalTmbcuhoaiRbbgrc;WeGc:Ge9hmbarcsGgwce0mbc9:hoalcufadcd4cbawEgDadfgrcKcaawEgqaraq0Egk6mbaicefhxcj;abad9Uc;WFbGcjdadca0EhmaialfgPar9Rgoadfhsavaoadz:jjjjbgzceVhHcbhOdndninaeaO9nmeaPax9RaD6mdamaeaO9RaOamfgoae6EgAcsfglc9WGhCaAcethXaxaDfhiaOaeaoaeao6E9RhQalcl4cifcd4hLazcjdfaAfhKcbhYabaOad2fg8AhEaHh3incbh5dnawTmbaxaYcd4fRbbh5kcbh8Eazcjdfhqinaih8Fdndndndna5a8Ecet4ciGgoc9:fPdebdkaPa8F9RaA6mrazcjdfa8EaA2fa8FaAz:jjjjb8Aa8FaAfhixdkazcjdfa8EaA2fcbaAz:kjjjb8Aa8FhixekaPa8F9RaL6mva8FaLfhidnaCTmbaPai9RcK6mbaocdtc:q:G:cjbfcj:G:cjbawEhaczhrcbhlinargoc9Wfghaqfhrdndndndndndnaaa8Fahco4fRbbalcoG4ciGcdtfydbPDbedvivvvlvkar9cb83bwar9cb83bbxlkarcbaiRbdai8Xbb9c:c:qj:bw9:9c:q;c1:I1e:d9c:b:c:e1z9:gg9cjjjjjz:dg8J9qE86bbaqaofgrcGfcbaicdfa8J9c8N1:NfghRbbag9cjjjjjw:dg8J9qE86bbarcVfcbaha8J9c8M1:NfghRbbag9cjjjjjl:dg8J9qE86bbarc7fcbaha8J9c8L1:NfghRbbag9cjjjjjd:dg8J9qE86bbarctfcbaha8J9c8K1:NfghRbbag9cjjjjje:dg8J9qE86bbarc91fcbaha8J9c8J1:NfghRbbag9cjjjj;ab:dg8J9qE86bbarc4fcbaha8J9cg1:NfghRbbag9cjjjja:dg8J9qE86bbarc93fcbaha8J9ch1:NfghRbbag9cjjjjz:dgg9qE86bbarc94fcbahag9ca1:NfghRbbai8Xbe9c:c:qj:bw9:9c:q;c1:I1e:d9c:b:c:e1z9:gg9cjjjjjz:dg8J9qE86bbarc95fcbaha8J9c8N1:NfgiRbbag9cjjjjjw:dg8J9qE86bbarc96fcbaia8J9c8M1:NfgiRbbag9cjjjjjl:dg8J9qE86bbarc97fcbaia8J9c8L1:NfgiRbbag9cjjjjjd:dg8J9qE86bbarc98fcbaia8J9c8K1:NfgiRbbag9cjjjjje:dg8J9qE86bbarc99fcbaia8J9c8J1:NfgiRbbag9cjjjj;ab:dg8J9qE86bbarc9:fcbaia8J9cg1:NfgiRbbag9cjjjja:dg8J9qE86bbarcufcbaia8J9ch1:NfgiRbbag9cjjjjz:dgg9qE86bbaiag9ca1:NfhixikaraiRblaiRbbghco4g8Ka8KciSg8KE86bbaqaofgrcGfaiclfa8Kfg8KRbbahcl4ciGg8La8LciSg8LE86bbarcVfa8Ka8Lfg8KRbbahcd4ciGg8La8LciSg8LE86bbarc7fa8Ka8Lfg8KRbbahciGghahciSghE86bbarctfa8Kahfg8KRbbaiRbeghco4g8La8LciSg8LE86bbarc91fa8Ka8Lfg8KRbbahcl4ciGg8La8LciSg8LE86bbarc4fa8Ka8Lfg8KRbbahcd4ciGg8La8LciSg8LE86bbarc93fa8Ka8Lfg8KRbbahciGghahciSghE86bbarc94fa8Kahfg8KRbbaiRbdghco4g8La8LciSg8LE86bbarc95fa8Ka8Lfg8KRbbahcl4ciGg8La8LciSg8LE86bbarc96fa8Ka8Lfg8KRbbahcd4ciGg8La8LciSg8LE86bbarc97fa8Ka8Lfg8KRbbahciGghahciSghE86bbarc98fa8KahfghRbbaiRbigico4g8Ka8KciSg8KE86bbarc99faha8KfghRbbaicl4ciGg8Ka8KciSg8KE86bbarc9:faha8KfghRbbaicd4ciGg8Ka8KciSg8KE86bbarcufaha8KfgrRbbaiciGgiaiciSgiE86bbaraifhixdkaraiRbwaiRbbghcl4g8Ka8KcsSg8KE86bbaqaofgrcGfaicwfa8Kfg8KRbbahcsGghahcsSghE86bbarcVfa8KahfghRbbaiRbeg8Kcl4g8La8LcsSg8LE86bbarc7faha8LfghRbba8KcsGg8Ka8KcsSg8KE86bbarctfaha8KfghRbbaiRbdg8Kcl4g8La8LcsSg8LE86bbarc91faha8LfghRbba8KcsGg8Ka8KcsSg8KE86bbarc4faha8KfghRbbaiRbig8Kcl4g8La8LcsSg8LE86bbarc93faha8LfghRbba8KcsGg8Ka8KcsSg8KE86bbarc94faha8KfghRbbaiRblg8Kcl4g8La8LcsSg8LE86bbarc95faha8LfghRbba8KcsGg8Ka8KcsSg8KE86bbarc96faha8KfghRbbaiRbvg8Kcl4g8La8LcsSg8LE86bbarc97faha8LfghRbba8KcsGg8Ka8KcsSg8KE86bbarc98faha8KfghRbbaiRbog8Kcl4g8La8LcsSg8LE86bbarc99faha8LfghRbba8KcsGg8Ka8KcsSg8KE86bbarc9:faha8KfghRbbaiRbrgicl4g8Ka8KcsSg8KE86bbarcufaha8KfgrRbbaicsGgiaicsSgiE86bbaraifhixekarai8Pbw83bwarai8Pbb83bbaiczfhikdnaoaC9pmbalcdfhlaoczfhraPai9RcL0mekkaoaC6moaimexokaCmva8FTmvkaqaAfhqa8Ecefg8Ecl9hmbkdndndndnawTmbasaYcd4fRbbgociGPlbedrbkaATmdazaYfh8Fazcjdfhhcbh8EaEhaina8FRbbhraahocbhlinaoahalfRbbgqce4cbaqceG9R7arfgr86bbaoadfhoaAalcefgl9hmbkaacefhaa8Fcefh8FahaAfhha8Ecefg8Ecl9hmbxikkaATmeazaYfhaazcjdfhhcbhoceh8EaKh8FinaEaofhlaa8Vbbhrcbhoinala8FaofRbbcwtahaofRbbgqVc;:FiGce4cbaqceG9R7arfgr87bbaladfhlaQaocefgofmbka8FaXfh8FcdhoaacdfhaahaXfhha8EceGhlcbh8EalmbxdkkaATmbaocl4h8EazaYfRbbhqcwhoa3hlinalRbbaotaqVhqalcefhlaocwfgoca9hmbkcbhhaEh8FaKhainazcjdfahfRbbhrcwhoaahlinalRbbaotarVhralaAfhlaocwfgoca9hmbkara8E94aq7hqcbhoa8Fhlinalaqao486bbalcefhlaocwfgoca9hmbka8Fadfh8FaacefhaahcefghaA9hmbkkaEclfhEa3clfh3aYclfgYad6mbkaza8AaAcufad2fadz:jjjjb8AaAaOfhOaihxaimbkc9:hoxdkcbc99aPax9RakSEhoxekc9:hokavcjqf8Kjjjjbaok:ysezu8Jjjjjbc;ae9Rgv8Kjjjjbc9:hodnalaeci9UgrcHf6mbcuhoaiRbbgwc;WeGc;Ge9hmbawcsGgDce0mbavc;abfcFecjez:kjjjb8Aav9cu83iUav9cu83i8Wav9cu83iyav9cu83iaav9cu83iKav9cu83izav9cu83iwav9cu83ibaialfc9WfhqaicefgwarfhldnaeTmbcmcsaDceSEhkcbhxcbhmcbhrcbhicbhoindnalaq9nmbc9:hoxikdndnawRbbgDc;Ve0mbavc;abfaoaDcu7gPcl4fcsGcitfgsydlhzasydbhHdndnaDcsGgsak9pmbavaiaPfcsGcdtfydbaxasEhDaxasTgOfhxxekdndnascsSmbcehOasc987asamffcefhDxekalcefhDal8SbbgscFeGhPdndnascu9mmbaDhlxekalcvfhlaPcFbGhPcrhsdninaD8SbbgOcFbGastaPVhPaOcu9kmeaDcefhDascrfgsc8J9hmbxdkkaDcefhlkcehOaPce4cbaPceG9R7amfhDkaDhmkavc;abfaocitfgsaDBdbasazBdlavaicdtfaDBdbavc;abfaocefcsGcitfgsaHBdbasaDBdlaocdfhoaOaifhidnadcd9hmbabarcetfgsaH87ebasclfaD87ebascdfaz87ebxdkabarcdtfgsaHBdbascwfaDBdbasclfazBdbxekdnaDcpe0mbavaiaqaDcsGfRbbgscl4gP9RcsGcdtfydbaxcefgOaPEhDavaias9RcsGcdtfydbaOaPTgzfgOascsGgPEhsaPThPdndnadcd9hmbabarcetfgHax87ebaHclfas87ebaHcdfaD87ebxekabarcdtfgHaxBdbaHcwfasBdbaHclfaDBdbkavaicdtfaxBdbavc;abfaocitfgHaDBdbaHaxBdlavaicefgicsGcdtfaDBdbavc;abfaocefcsGcitfgHasBdbaHaDBdlavaiazfgicsGcdtfasBdbavc;abfaocdfcsGcitfgDaxBdbaDasBdlaocifhoaiaPfhiaOaPfhxxekaxcbalRbbgsEgHaDc;:eSgDfhOascsGhAdndnascl4gCmbaOcefhzxekaOhzavaiaC9RcsGcdtfydbhOkdndnaAmbazcefhxxekazhxavaias9RcsGcdtfydbhzkdndnaDTmbalcefhDxekalcdfhDal8SbegPcFeGhsdnaPcu9kmbalcofhHascFbGhscrhldninaD8SbbgPcFbGaltasVhsaPcu9kmeaDcefhDalcrfglc8J9hmbkaHhDxekaDcefhDkasce4cbasceG9R7amfgmhHkdndnaCcsSmbaDhsxekaDcefhsaD8SbbglcFeGhPdnalcu9kmbaDcvfhOaPcFbGhPcrhldninas8SbbgDcFbGaltaPVhPaDcu9kmeascefhsalcrfglc8J9hmbkaOhsxekascefhskaPce4cbaPceG9R7amfgmhOkdndnaAcsSmbashlxekascefhlas8SbbgDcFeGhPdnaDcu9kmbascvfhzaPcFbGhPcrhDdninal8SbbgscFbGaDtaPVhPascu9kmealcefhlaDcrfgDc8J9hmbkazhlxekalcefhlkaPce4cbaPceG9R7amfgmhzkdndnadcd9hmbabarcetfgDaH87ebaDclfaz87ebaDcdfaO87ebxekabarcdtfgDaHBdbaDcwfazBdbaDclfaOBdbkavc;abfaocitfgDaOBdbaDaHBdlavaicdtfaHBdbavc;abfaocefcsGcitfgDazBdbaDaOBdlavaicefgicsGcdtfaOBdbavc;abfaocdfcsGcitfgDaHBdbaDazBdlavaiaCTaCcsSVfgicsGcdtfazBdbaiaATaAcsSVfhiaocifhokawcefhwaocsGhoaicsGhiarcifgrae6mbkkcbc99alaqSEhokavc;aef8Kjjjjbaok:clevu8Jjjjjbcz9Rhvdnalaecvf9pmbc9:skdnaiRbbc;:eGc;qeSmbcuskav9cb83iwaicefhoaialfc98fhrdnaeTmbdnadcdSmbcbhwindnaoar6mbc9:skaocefhlao8SbbgicFeGhddndnaicu9mmbalhoxekaocvfhoadcFbGhdcrhidninal8SbbgDcFbGaitadVhdaDcu9kmealcefhlaicrfgic8J9hmbxdkkalcefhokabawcdtfadc8Etc8F91adcd47avcwfadceGcdtVglydbfgiBdbalaiBdbawcefgwae9hmbxdkkcbhwindnaoar6mbc9:skaocefhlao8SbbgicFeGhddndnaicu9mmbalhoxekaocvfhoadcFbGhdcrhidninal8SbbgDcFbGaitadVhdaDcu9kmealcefhlaicrfgic8J9hmbxdkkalcefhokabawcetfadc8Etc8F91adcd47avcwfadceGcdtVglydbfgi87ebalaiBdbawcefgwae9hmbkkcbc99aoarSEk:Lvoeue99dud99eud99dndnadcl9hmbaeTmeindndnabcdfgd8Sbb:Yab8Sbbgi:Ygl:l:tabcefgv8Sbbgo:Ygr:l:tgwJbb;:9cawawNJbbbbawawJbbbb9GgDEgq:mgkaqaicb9iEalMgwawNakaqaocb9iEarMgqaqNMM:r:vglNJbbbZJbbb:;aDEMgr:lJbbb9p9DTmbar:Ohixekcjjjj94hikadai86bbdndnaqalNJbbbZJbbb:;aqJbbbb9GEMgq:lJbbb9p9DTmbaq:Ohdxekcjjjj94hdkavad86bbdndnawalNJbbbZJbbb:;awJbbbb9GEMgw:lJbbb9p9DTmbaw:Ohdxekcjjjj94hdkabad86bbabclfhbaecufgembxdkkaeTmbindndnabclfgd8Ueb:Yab8Uebgi:Ygl:l:tabcdfgv8Uebgo:Ygr:l:tgwJb;:FSawawNJbbbbawawJbbbb9GgDEgq:mgkaqaicb9iEalMgwawNakaqaocb9iEarMgqaqNMM:r:vglNJbbbZJbbb:;aDEMgr:lJbbb9p9DTmbar:Ohixekcjjjj94hikadai87ebdndnaqalNJbbbZJbbb:;aqJbbbb9GEMgq:lJbbb9p9DTmbaq:Ohdxekcjjjj94hdkavad87ebdndnawalNJbbbZJbbb:;awJbbbb9GEMgw:lJbbb9p9DTmbaw:Ohdxekcjjjj94hdkabad87ebabcwfhbaecufgembkkk:4ioiue99dud99dud99dnaeTmbcbhiabhlindndnal8Uebgv:YgoJ:ji:1Salcof8UebgrciVgw:Y:vgDNJbbbZJbbb:;avcu9kEMgq:lJbbb9p9DTmbaq:Ohkxekcjjjj94hkkalclf8Uebhvalcdf8UebhxalarcefciGcetfak87ebdndnax:YgqaDNJbbbZJbbb:;axcu9kEMgm:lJbbb9p9DTmbam:Ohxxekcjjjj94hxkabaiarciGgkfcd7cetfax87ebdndnav:YgmaDNJbbbZJbbb:;avcu9kEMgP:lJbbb9p9DTmbaP:Ohvxekcjjjj94hvkalarcufciGcetfav87ebdndnawaw2:ZgPaPMaoaoN:taqaqN:tamamN:tgoJbbbbaoJbbbb9GE:raDNJbbbZMgD:lJbbb9p9DTmbaD:Ohrxekcjjjj94hrkalakcetfar87ebalcwfhlaiclfhiaecufgembkkk9mbdnadcd4ae2gdTmbinababydbgecwtcw91:Yaece91cjjj98Gcjjj;8if::NUdbabclfhbadcufgdmbkkk:Tvirud99eudndnadcl9hmbaeTmeindndnabRbbgiabcefgl8Sbbgvabcdfgo8Sbbgrf9R:YJbbuJabcifgwRbbgdce4adVgDcd4aDVgDcl4aDVgD:Z:vgqNJbbbZMgk:lJbbb9p9DTmbak:Ohxxekcjjjj94hxkaoax86bbdndnaraif:YaqNJbbbZMgk:lJbbb9p9DTmbak:Ohoxekcjjjj94hokalao86bbdndnavaifar9R:YaqNJbbbZMgk:lJbbb9p9DTmbak:Ohixekcjjjj94hikabai86bbdndnaDadcetGadceGV:ZaqNJbbbZMgq:lJbbb9p9DTmbaq:Ohdxekcjjjj94hdkawad86bbabclfhbaecufgembxdkkaeTmbindndnab8Vebgiabcdfgl8Uebgvabclfgo8Uebgrf9R:YJbFu9habcofgw8Vebgdce4adVgDcd4aDVgDcl4aDVgDcw4aDVgD:Z:vgqNJbbbZMgk:lJbbb9p9DTmbak:Ohxxekcjjjj94hxkaoax87ebdndnaraif:YaqNJbbbZMgk:lJbbb9p9DTmbak:Ohoxekcjjjj94hokalao87ebdndnavaifar9R:YaqNJbbbZMgk:lJbbb9p9DTmbak:Ohixekcjjjj94hikabai87ebdndnaDadcetGadceGV:ZaqNJbbbZMgq:lJbbb9p9DTmbaq:Ohdxekcjjjj94hdkawad87ebabcwfhbaecufgembkkk9teiucbcbyd:K:G:cjbgeabcifc98GfgbBd:K:G:cjbdndnabZbcztgd9nmbcuhiabad9RcFFifcz4nbcuSmekaehikaik;LeeeudndnaeabVciGTmbabhixekdndnadcz9pmbabhixekabhiinaiaeydbBdbaiclfaeclfydbBdbaicwfaecwfydbBdbaicxfaecxfydbBdbaeczfheaiczfhiadc9Wfgdcs0mbkkadcl6mbinaiaeydbBdbaeclfheaiclfhiadc98fgdci0mbkkdnadTmbinaiaeRbb86bbaicefhiaecefheadcufgdmbkkabk;aeedudndnabciGTmbabhixekaecFeGc:b:c:ew2hldndnadcz9pmbabhixekabhiinaialBdbaicxfalBdbaicwfalBdbaiclfalBdbaiczfhiadc9Wfgdcs0mbkkadcl6mbinaialBdbaiclfhiadc98fgdci0mbkkdnadTmbinaiae86bbaicefhiadcufgdmbkkabkk83dbcj:Gdk8Kbbbbdbbblbbbwbbbbbbbebbbdbbblbbbwbbbbc:K:Gdkl8W:qbb",t="b9H79TebbbeKl9Gbb9Gvuuuuueu9Giuuub9Geueuixkbbebeeddddilve9Weeeviebeoweuecj:Gdkr;Neqo9TW9T9VV95dbH9F9F939H79T9F9J9H229F9Jt9VV7bb8A9TW79O9V9Wt9F9KW9J9V9KW9wWVtW949c919M9MWVbdY9TW79O9V9Wt9F9KW9J9V9KW69U9KW949c919M9MWVblE9TW79O9V9Wt9F9KW9J9V9KW69U9KW949tWG91W9U9JWbvL9TW79O9V9Wt9F9KW9J9V9KWS9P2tWV9p9JtboK9TW79O9V9Wt9F9KW9J9V9KWS9P2tWV9r919HtbrL9TW79O9V9Wt9F9KW9J9V9KWS9P2tWVT949WbwY9TW79O9V9Wt9F9KW9J9V9KWS9P2tWVJ9V29VVbDl79IV9Rbqq:59Dklbzik94evu8Jjjjjbcz9Rhbcbheincbhdcbhiinabcwfadfaicjuaead4ceGglE86bbaialfhiadcefgdcw9hmbkaeai86b:q:W:cjbaecitab8Piw83i:q:G:cjbaecefgecjd9hmbkk:SBlEud97dur978Jjjjjbcj;kb9Rgv8Kjjjjbc9:hodnalTmbcuhoaiRbbgrc;WeGc:Ge9hmbarcsGgwce0mbc9:hoalcufadcd4cbawEgDadfgrcKcaawEgqaraq0Egk6mbaialfgxar9RhodnadTgmmbavaoad;8qbbkaicefhPcj;abad9Uc;WFbGcjdadca0EhsdndndnadTmbaoadfhzcbhHinaeaH9nmdaxaP9RaD6miabaHad2fgOavcjdfasaeaH9RaHasfae6EgAaAcsfgoc9WGgCSEhXaPaDfhQaocl4cifcd4hLavcj;cbfaCcetfhKavcj;cbfaCci2fhYavcj;cbfaCfh8AcbhEaoc;ab6h3incbh5dnawTmbaPaEcd4fRbbh5kcbh8Eavcj;cbfh8Findndndndna5a8Ecet4ciGgoc9:fPdebdkaxaQ9RaC6mwdnaCTmbavcj;cbfa8EaC2faQaC;8qbbkaQaAfhQxdkaCTmeavcj;cbfa8EaC2fcbaC;8kbxekaxaQ9RaL6moaoclVcbawEhraQaLfhocbhidna3mbaxao9Rc;Gb6mbcbhlina8FalfhidndndndndndnaQalco4fRbbgqciGarfPDbedibledibkaipxbbbbbbbbbbbbbbbbpklbxlkaiaopbblaopbbbgaclp:meaapmbzeHdOiAlCvXoQrLgacdp:meaapmbzeHdOiAlCvXoQrLpxiiiiiiiiiiiiiiiip9oghpxiiiiiiiiiiiiiiiip8Jgap5b9cjF;8;4;W;G;ab9:9cU1:Nggcitpbi:q:G:cjbagRb:q:W:cjbggpsaap5e9cjF;8;4;W;G;ab9:9cU1:Ng8Jcitpbi:q:G:cjbp9UpmbedilvorzHOACXQLpPahaap9spklbagaoclffa8JRb:q:W:cjbfhoxikaiaopbbwaopbbbgaclp:meaapmbzeHdOiAlCvXoQrLpxssssssssssssssssp9oghpxssssssssssssssssp8Jgap5b9cjF;8;4;W;G;ab9:9cU1:Nggcitpbi:q:G:cjbagRb:q:W:cjbggpsaap5e9cjF;8;4;W;G;ab9:9cU1:Ng8Jcitpbi:q:G:cjbp9UpmbedilvorzHOACXQLpPahaap9spklbagaocwffa8JRb:q:W:cjbfhoxdkaiaopbbbpklbaoczfhoxekaiaopbbdaoRbbggcitpbi:q:G:cjbagRb:q:W:cjbggpsaoRbeg8Jcitpbi:q:G:cjbp9UpmbedilvorzHOACXQLpPpklbagaocdffa8JRb:q:W:cjbfhokdndndndndndnaqcd4ciGarfPDbedibledibkaiczfpxbbbbbbbbbbbbbbbbpklbxlkaiczfaopbblaopbbbgaclp:meaapmbzeHdOiAlCvXoQrLgacdp:meaapmbzeHdOiAlCvXoQrLpxiiiiiiiiiiiiiiiip9oghpxiiiiiiiiiiiiiiiip8Jgap5b9cjF;8;4;W;G;ab9:9cU1:Nggcitpbi:q:G:cjbagRb:q:W:cjbggpsaap5e9cjF;8;4;W;G;ab9:9cU1:Ng8Jcitpbi:q:G:cjbp9UpmbedilvorzHOACXQLpPahaap9spklbagaoclffa8JRb:q:W:cjbfhoxikaiczfaopbbwaopbbbgaclp:meaapmbzeHdOiAlCvXoQrLpxssssssssssssssssp9oghpxssssssssssssssssp8Jgap5b9cjF;8;4;W;G;ab9:9cU1:Nggcitpbi:q:G:cjbagRb:q:W:cjbggpsaap5e9cjF;8;4;W;G;ab9:9cU1:Ng8Jcitpbi:q:G:cjbp9UpmbedilvorzHOACXQLpPahaap9spklbagaocwffa8JRb:q:W:cjbfhoxdkaiczfaopbbbpklbaoczfhoxekaiczfaopbbdaoRbbggcitpbi:q:G:cjbagRb:q:W:cjbggpsaoRbeg8Jcitpbi:q:G:cjbp9UpmbedilvorzHOACXQLpPpklbagaocdffa8JRb:q:W:cjbfhokdndndndndndnaqcl4ciGarfPDbedibledibkaicafpxbbbbbbbbbbbbbbbbpklbxlkaicafaopbblaopbbbgaclp:meaapmbzeHdOiAlCvXoQrLgacdp:meaapmbzeHdOiAlCvXoQrLpxiiiiiiiiiiiiiiiip9oghpxiiiiiiiiiiiiiiiip8Jgap5b9cjF;8;4;W;G;ab9:9cU1:Nggcitpbi:q:G:cjbagRb:q:W:cjbggpsaap5e9cjF;8;4;W;G;ab9:9cU1:Ng8Jcitpbi:q:G:cjbp9UpmbedilvorzHOACXQLpPahaap9spklbagaoclffa8JRb:q:W:cjbfhoxikaicafaopbbwaopbbbgaclp:meaapmbzeHdOiAlCvXoQrLpxssssssssssssssssp9oghpxssssssssssssssssp8Jgap5b9cjF;8;4;W;G;ab9:9cU1:Nggcitpbi:q:G:cjbagRb:q:W:cjbggpsaap5e9cjF;8;4;W;G;ab9:9cU1:Ng8Jcitpbi:q:G:cjbp9UpmbedilvorzHOACXQLpPahaap9spklbagaocwffa8JRb:q:W:cjbfhoxdkaicafaopbbbpklbaoczfhoxekaicafaopbbdaoRbbggcitpbi:q:G:cjbagRb:q:W:cjbggpsaoRbeg8Jcitpbi:q:G:cjbp9UpmbedilvorzHOACXQLpPpklbagaocdffa8JRb:q:W:cjbfhokdndndndndndnaqco4arfPDbedibledibkaic8Wfpxbbbbbbbbbbbbbbbbpklbxlkaic8Wfaopbblaopbbbgaclp:meaapmbzeHdOiAlCvXoQrLgacdp:meaapmbzeHdOiAlCvXoQrLpxiiiiiiiiiiiiiiiip9oghpxiiiiiiiiiiiiiiiip8Jgap5b9cjF;8;4;W;G;ab9:9cU1:Ngicitpbi:q:G:cjbaiRb:q:W:cjbgipsaap5e9cjF;8;4;W;G;ab9:9cU1:Ngqcitpbi:q:G:cjbp9UpmbedilvorzHOACXQLpPahaap9spklbaiaoclffaqRb:q:W:cjbfhoxikaic8Wfaopbbwaopbbbgaclp:meaapmbzeHdOiAlCvXoQrLpxssssssssssssssssp9oghpxssssssssssssssssp8Jgap5b9cjF;8;4;W;G;ab9:9cU1:Ngicitpbi:q:G:cjbaiRb:q:W:cjbgipsaap5e9cjF;8;4;W;G;ab9:9cU1:Ngqcitpbi:q:G:cjbp9UpmbedilvorzHOACXQLpPahaap9spklbaiaocwffaqRb:q:W:cjbfhoxdkaic8Wfaopbbbpklbaoczfhoxekaic8WfaopbbdaoRbbgicitpbi:q:G:cjbaiRb:q:W:cjbgipsaoRbegqcitpbi:q:G:cjbp9UpmbedilvorzHOACXQLpPpklbaiaocdffaqRb:q:W:cjbfhokalc;abfhialcjefaC0meaihlaxao9Rc;Fb0mbkkdnaiaC9pmbaici4hlinaxao9RcK6mwa8FaifhqdndndndndndnaQaico4fRbbalcoG4ciGarfPDbedibledibkaqpxbbbbbbbbbbbbbbbbpkbbxlkaqaopbblaopbbbgaclp:meaapmbzeHdOiAlCvXoQrLgacdp:meaapmbzeHdOiAlCvXoQrLpxiiiiiiiiiiiiiiiip9oghpxiiiiiiiiiiiiiiiip8Jgap5b9cjF;8;4;W;G;ab9:9cU1:Nggcitpbi:q:G:cjbagRb:q:W:cjbggpsaap5e9cjF;8;4;W;G;ab9:9cU1:Ng8Jcitpbi:q:G:cjbp9UpmbedilvorzHOACXQLpPahaap9spkbbagaoclffa8JRb:q:W:cjbfhoxikaqaopbbwaopbbbgaclp:meaapmbzeHdOiAlCvXoQrLpxssssssssssssssssp9oghpxssssssssssssssssp8Jgap5b9cjF;8;4;W;G;ab9:9cU1:Nggcitpbi:q:G:cjbagRb:q:W:cjbggpsaap5e9cjF;8;4;W;G;ab9:9cU1:Ng8Jcitpbi:q:G:cjbp9UpmbedilvorzHOACXQLpPahaap9spkbbagaocwffa8JRb:q:W:cjbfhoxdkaqaopbbbpkbbaoczfhoxekaqaopbbdaoRbbggcitpbi:q:G:cjbagRb:q:W:cjbggpsaoRbeg8Jcitpbi:q:G:cjbp9UpmbedilvorzHOACXQLpPpkbbagaocdffa8JRb:q:W:cjbfhokalcdfhlaiczfgiaC6mbkkaohQao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aofpblbg8La8Aaofpblbg8MpmbzeHdOiAlCvXoQrLg8NaKaofpblbgyaYaofpblbg8PpmbzeHdOiAlCvXoQrLgIpmbezHdiOAlvCXorQLgacep:neaapxebebebebebebebebghp9op:bep9rgaa8Kp:oeg8Kp9Abbbaladfgla8Kaaaapmlvorlvorlvorlvorp:oeg8Kp9Abbbaladfgla8KaaaapmwDqkwDqkwDqkwDqkp:oeg8Kp9Abbbaladfgla8KaaaapmxmPsxmPsxmPsxmPsp:oeg8Kp9Abbbaladfgla8Ka8NaIpmwDKYqk8AExm35Ps8E8Fgacep:neaaahp9op:bep9rgap:oeg8Kp9Abbbaladfgla8Kaaaapmlvorlvorlvorlvorp:oeg8Kp9Abbbaladfgla8KaaaapmwDqkwDqkwDqkwDqkp:oeg8Kp9Abbbaladfgla8KaaaapmxmPsxmPsxmPsxmPsp:oeg8Kp9Abbbaladfgla8Ka8La8MpmwKDYq8AkEx3m5P8Es8Fg8Laya8PpmwKDYq8AkEx3m5P8Es8Fg8MpmbezHdiOAlvCXorQLgacep:neaaahp9op:bep9rgap:oeg8Kp9Abbbaladfgla8Kaaaapmlvorlvorlvorlvorp:oeg8Kp9Abbbaladfgla8KaaaapmwDqkwDqkwDqkwDqkp:oeg8Kp9Abbbaladfgla8KaaaapmxmPsxmPsxmPsxmPsp:oeg8Kp9Abbbaladfgla8Ka8La8MpmwDKYqk8AExm35Ps8E8Fgacep:neaaahp9op:bep9rgap:oeghp9Abbbaladfglahaaaapmlvorlvorlvorlvorp:oeghp9AbbbaladfglahaaaapmwDqkwDqkwDqkwDqkp:oeghp9AbbbaladfglahaaaapmxmPsxmPsxmPsxmPsp:oeg8Kp9AbbbaladfhlaoczfgoaC6mbxdkkaCTmbaXaEfhrcbhocbalcl4gl9Rc8FGhiavaEfpbdbhhinaravcj;cbfaofpblbg8Ka8Aaofpblbg8LpmbzeHdOiAlCvXoQrLg8MaKaofpblbg8NaYaofpblbgypmbzeHdOiAlCvXoQrLg8PpmbezHdiOAlvCXorQLgaaip:Reaaalp:Tep9qgaahp9rghp9Abbbaradfgrahaaaapmlvorlvorlvorlvorp9rghp9AbbbaradfgrahaaaapmwDqkwDqkwDqkwDqkp9rghp9AbbbaradfgrahaaaapmxmPsxmPsxmPsxmPsp9rghp9Abbbaradfgraha8Ma8PpmwDKYqk8AExm35Ps8E8Fgaaip:Reaaalp:Tep9qgap9rghp9Abbbaradfgrahaaaapmlvorlvorlvorlvorp9rghp9AbbbaradfgrahaaaapmwDqkwDqkwDqkwDqkp9rghp9AbbbaradfgrahaaaapmxmPsxmPsxmPsxmPsp9rghp9Abbbaradfgraha8Ka8LpmwKDYq8AkEx3m5P8Es8Fg8Ka8NaypmwKDYq8AkEx3m5P8Es8Fg8LpmbezHdiOAlvCXorQLgaaip:Reaaalp:Tep9qgap9rghp9Abbbaradfgrahaaaapmlvorlvorlvorlvorp9rghp9AbbbaradfgrahaaaapmwDqkwDqkwDqkwDqkp9rghp9AbbbaradfgrahaaaapmxmPsxmPsxmPsxmPsp9rghp9Abbbaradfgraha8Ka8LpmwDKYqk8AExm35Ps8E8Fgaaip:Reaaalp:Tep9qgap9rghp9Abbbaradfgrahaaaapmlvorlvorlvorlvorp9rghp9AbbbaradfgrahaaaapmwDqkwDqkwDqkwDqkp9rghp9AbbbaradfgrahaaaapmxmPsxmPsxmPsxmPsp9rghp9AbbbaradfhraoczfgoaC6mbkkaEclfgEad6mbkdnaXavcjdf9hmbaAad2goTmbaOavcjdfao;8qbbkdnammbavaXaAcufad2fad;8qbbkaAaHfhHc9:hoaQhPaQmbxlkkaeTmbaDalfhrcbhocuhlinaralaD9RglfaD6mdasaeao9Raoasfae6Eaofgoae6mbkaial9RhPkcbc99axaP9RakSEhoxekc9:hokavcj;kbf8Kjjjjbaokwbz:bjjjbkNsezu8Jjjjjbc;ae9Rgv8Kjjjjbc9:hodnalaeci9UgrcHf6mbcuhoaiRbbgwc;WeGc;Ge9hmbawcsGgDce0mbavc;abfcFecje;8kbav9cu83iUav9cu83i8Wav9cu83iyav9cu83iaav9cu83iKav9cu83izav9cu83iwav9cu83ibaialfc9WfhqaicefgwarfhldnaeTmbcmcsaDceSEhkcbhxcbhmcbhrcbhicbhoindnalaq9nmbc9:hoxikdndnawRbbgDc;Ve0mbavc;abfaoaDcu7gPcl4fcsGcitfgsydlhzasydbhHdndnaDcsGgsak9pmbavaiaPfcsGcdtfydbaxasEhDaxasTgOfhxxekdndnascsSmbcehOasc987asamffcefhDxekalcefhDal8SbbgscFeGhPdndnascu9mmbaDhlxekalcvfhlaPcFbGhPcrhsdninaD8SbbgOcFbGastaPVhPaOcu9kmeaDcefhDascrfgsc8J9hmbxdkkaDcefhlkcehOaPce4cbaPceG9R7amfhDkaDhmkavc;abfaocitfgsaDBdbasazBdlavaicdtfaDBdbavc;abfaocefcsGcitfgsaHBdbasaDBdlaocdfhoaOaifhidnadcd9hmbabarcetfgsaH87ebasclfaD87ebascdfaz87ebxdkabarcdtfgsaHBdbascwfaDBdbasclfazBdbxekdnaDcpe0mbavaiaqaDcsGfRbbgscl4gP9RcsGcdtfydbaxcefgOaPEhDavaias9RcsGcdtfydbaOaPTgzfgOascsGgPEhsaPThPdndnadcd9hmbabarcetfgHax87ebaHclfas87ebaHcdfaD87ebxekabarcdtfgHaxBdbaHcwfasBdbaHclfaDBdbkavaicdtfaxBdbavc;abfaocitfgHaDBdbaHaxBdlavaicefgicsGcdtfaDBdbavc;abfaocefcsGcitfgHasBdbaHaDBdlavaiazfgicsGcdtfasBdbavc;abfaocdfcsGcitfgDaxBdbaDasBdlaocifhoaiaPfhiaOaPfhxxekaxcbalRbbgsEgHaDc;:eSgDfhOascsGhAdndnascl4gCmbaOcefhzxekaOhzavaiaC9RcsGcdtfydbhOkdndnaAmbazcefhxxekazhxavaias9RcsGcdtfydbhzkdndnaDTmbalcefhDxekalcdfhDal8SbegPcFeGhsdnaPcu9kmbalcofhHascFbGhscrhldninaD8SbbgPcFbGaltasVhsaPcu9kmeaDcefhDalcrfglc8J9hmbkaHhDxekaDcefhDkasce4cbasceG9R7amfgmhHkdndnaCcsSmbaDhsxekaDcefhsaD8SbbglcFeGhPdnalcu9kmbaDcvfhOaPcFbGhPcrhldninas8SbbgDcFbGaltaPVhPaDcu9kmeascefhsalcrfglc8J9hmbkaOhsxekascefhskaPce4cbaPceG9R7amfgmhOkdndnaAcsSmbashlxekascefhlas8SbbgDcFeGhPdnaDcu9kmbascvfhzaPcFbGhPcrhDdninal8SbbgscFbGaDtaPVhPascu9kmealcefhlaDcrfgDc8J9hmbkazhlxekalcefhlkaPce4cbaPceG9R7amfgmhzkdndnadcd9hmbabarcetfgDaH87ebaDclfaz87ebaDcdfaO87ebxekabarcdtfgDaHBdbaDcwfazBdbaDclfaOBdbkavc;abfaocitfgDaOBdbaDaHBdlavaicdtfaHBdbavc;abfaocefcsGcitfgDazBdbaDaOBdlavaicefgicsGcdtfaOBdbavc;abfaocdfcsGcitfgDaHBdbaDazBdlavaiaCTaCcsSVfgicsGcdtfazBdbaiaATaAcsSVfhiaocifhokawcefhwaocsGhoaicsGhiarcifgrae6mbkkcbc99alaqSEhokavc;aef8Kjjjjbaok:clevu8Jjjjjbcz9Rhvdnalaecvf9pmbc9:skdnaiRbbc;:eGc;qeSmbcuskav9cb83iwaicefhoaialfc98fhrdnaeTmbdnadcdSmbcbhwindnaoar6mbc9:skaocefhlao8SbbgicFeGhddndnaicu9mmbalhoxekaocvfhoadcFbGhdcrhidninal8SbbgDcFbGaitadVhdaDcu9kmealcefhlaicrfgic8J9hmbxdkkalcefhokabawcdtfadc8Etc8F91adcd47avcwfadceGcdtVglydbfgiBdbalaiBdbawcefgwae9hmbxdkkcbhwindnaoar6mbc9:skaocefhlao8SbbgicFeGhddndnaicu9mmbalhoxekaocvfhoadcFbGhdcrhidninal8SbbgDcFbGaitadVhdaDcu9kmealcefhlaicrfgic8J9hmbxdkkalcefhokabawcetfadc8Etc8F91adcd47avcwfadceGcdtVglydbfgi87ebalaiBdbawcefgwae9hmbkkcbc99aoarSEk;Toio97eue97aec98Ghedndnadcl9hmbaeTmecbhdinababpbbbgicKp:RecKp:Sep;6eglaicwp:RecKp:Sep;6ealp;Geaiczp:RecKp:Sep;6egvp;Gep;Kep;Legopxbbbbbbbbbbbbbbbbp:2egralpxbbbjbbbjbbbjbbbjgwp9op9rp;Keglpxbb;:9cbb;:9cbb;:9cbb;:9calalp;Meaoaop;Meavaravawp9op9rp;Keglalp;Mep;Kep;Kep;Jep;Negvp;Mepxbbn0bbn0bbn0bbn0grp;KepxFbbbFbbbFbbbFbbbp9oaipxbbbFbbbFbbbFbbbFp9op9qalavp;Mearp;Kecwp:RepxbFbbbFbbbFbbbFbbp9op9qaoavp;Mearp;Keczp:RepxbbFbbbFbbbFbbbFbp9op9qpkbbabczfhbadclfgdae6mbxdkkaeTmbcbhdinabczfgDaDpbbbgipxbbbbbbFFbbbbbbFFgwp9oabpbbbgoaipmbediwDqkzHOAKY8AEgvczp:Reczp:Sep;6eglaoaipmlvorxmPsCXQL358E8FpxFubbFubbFubbFubbp9op;6eavczp:Sep;6egvp;Gealp;Gep;Kep;Legipxbbbbbbbbbbbbbbbbp:2egralpxbbbjbbbjbbbjbbbjgqp9op9rp;Keglpxb;:FSb;:FSb;:FSb;:FSalalp;Meaiaip;Meavaravaqp9op9rp;Keglalp;Mep;Kep;Kep;Jep;Negvp;Mepxbbn0bbn0bbn0bbn0grp;KepxFFbbFFbbFFbbFFbbp9oaiavp;Mearp;Keczp:Rep9qgialavp;Mearp;KepxFFbbFFbbFFbbFFbbp9oglpmwDKYqk8AExm35Ps8E8Fp9qpkbbabaoawp9oaialpmbezHdiOAlvCXorQLp9qpkbbabcafhbadclfgdae6mbkkk;2ileue97euo97dnaec98GgiTmbcbheinabcKfpx:ji:1S:ji:1S:ji:1S:ji:1SabpbbbglabczfgvpbbbgopmlvorxmPsCXQL358E8Fgrczp:Segwpxibbbibbbibbbibbbp9qp;6egDp;NegqaDaDp;MegDaDp;KealaopmbediwDqkzHOAKY8AEgDczp:Reczp:Sep;6eglalp;MeaDczp:Sep;6egoaop;Mearczp:Reczp:Sep;6egrarp;Mep;Kep;Kep;Lepxbbbbbbbbbbbbbbbbp:4ep;Jep;Mepxbbn0bbn0bbn0bbn0gDp;KepxFFbbFFbbFFbbFFbbgkp9oaqaop;MeaDp;Keczp:Rep9qgoaqalp;MeaDp;Keakp9oaqarp;MeaDp;Keczp:Rep9qgDpmwDKYqk8AExm35Ps8E8Fglp5eawclp:RegqpEi:T:j83ibavalp5baqpEd:T:j83ibabcwfaoaDpmbezHdiOAlvCXorQLgDp5eaqpEe:T:j83ibabaDp5baqpEb:T:j83ibabcafhbaeclfgeai6mbkkkuee97dnadcd4ae2c98GgeTmbcbhdinababpbbbgicwp:Recwp:Sep;6eaicep:SepxbbjFbbjFbbjFbbjFp9opxbbjZbbjZbbjZbbjZp:Uep;Mepkbbabczfhbadclfgdae6mbkkk:Sodw97euaec98Ghedndnadcl9hmbaeTmecbhdinabpxbbuJbbuJbbuJbbuJabpbbbgicKp:TeglaicYp:Tep9qgvcdp:Teavp9qgvclp:Teavp9qgop;6ep;Negvaicwp:RecKp:SegraipxFbbbFbbbFbbbFbbbgwp9ogDp:Uep;6ep;Mepxbbn0bbn0bbn0bbn0gqp;Kecwp:RepxbFbbbFbbbFbbbFbbp9oavaDarp:Xeaiczp:RecKp:Segip:Uep;6ep;Meaqp;Keawp9op9qavaDaraip:Uep:Xep;6ep;Meaqp;Keczp:RepxbbFbbbFbbbFbbbFbp9op9qavaoalcep:Rep9oalpxebbbebbbebbbebbbp9op9qp;6ep;Meaqp;KecKp:Rep9qpkbbabczfhbadclfgdae6mbxdkkaeTmbcbhdinabczfgkpxbFu9hbFu9hbFu9hbFu9habpbbbglakpbbbgrpmlvorxmPsCXQL358E8Fgvczp:TegqavcHp:Tep9qgicdp:Teaip9qgiclp:Teaip9qgicwp:Teaip9qgop;6ep;NegialarpmbediwDqkzHOAKY8AEgDpxFFbbFFbbFFbbFFbbglp9ograDczp:Segwp:Ueavczp:Reczp:SegDp:Xep;6ep;Mepxbbn0bbn0bbn0bbn0gvp;Kealp9oaiarawaDp:Uep:Xep;6ep;Meavp;Keczp:Rep9qgwaiaoaqcep:Rep9oaqpxebbbebbbebbbebbbp9op9qp;6ep;Meavp;Keczp:ReaiaDarp:Uep;6ep;Meavp;Kealp9op9qgipmwDKYqk8AExm35Ps8E8FpkbbabawaipmbezHdiOAlvCXorQLpkbbabcafhbadclfgdae6mbkkk9teiucbcbydj:G:cjbgeabcifc98GfgbBdj:G:cjbdndnabZbcztgd9nmbcuhiabad9RcFFifcz4nbcuSmekaehikaikkxebcj:Gdklz:zbb",n=new Uint8Array([0,97,115,109,1,0,0,0,1,4,1,96,0,0,3,3,2,0,0,5,3,1,0,1,12,1,0,10,22,2,12,0,65,0,65,0,65,0,252,10,0,0,11,7,0,65,0,253,15,26,11]),i=new Uint8Array([32,0,65,2,1,106,34,33,3,128,11,4,13,64,6,253,10,7,15,116,127,5,8,12,40,16,19,54,20,9,27,255,113,17,42,67,24,23,146,148,18,14,22,45,70,69,56,114,101,21,25,63,75,136,108,28,118,29,73,115]);if(typeof WebAssembly!="object")return{supported:!1};var r=WebAssembly.validate(n)?a(t):a(e),o,s=WebAssembly.instantiate(r,{}).then(function(b){o=b.instance,o.exports.__wasm_call_ctors()});function a(b){for(var x=new Uint8Array(b.length),T=0;T<b.length;++T){var E=b.charCodeAt(T);x[T]=E>96?E-97:E>64?E-39:E+4}for(var v=0,T=0;T<b.length;++T)x[v++]=x[T]<60?i[x[T]]:(x[T]-60)*64+x[++T];return x.buffer.slice(0,v)}function c(b,x,T,E,v,S,I){var R=b.exports.sbrk,O=E+3&-4,L=R(O*v),_=R(S.length),C=new Uint8Array(b.exports.memory.buffer);C.set(S,_);var w=x(L,E,v,_,S.length);if(w==0&&I&&I(L,O,v),T.set(C.subarray(L,L+E*v)),R(L-R(0)),w!=0)throw new Error("Malformed buffer data: "+w)}var u={NONE:"",OCTAHEDRAL:"meshopt_decodeFilterOct",QUATERNION:"meshopt_decodeFilterQuat",EXPONENTIAL:"meshopt_decodeFilterExp",COLOR:"meshopt_decodeFilterColor"},f={ATTRIBUTES:"meshopt_decodeVertexBuffer",TRIANGLES:"meshopt_decodeIndexBuffer",INDICES:"meshopt_decodeIndexSequence"},d=[],p=0;function g(b){var x={object:new Worker(b),pending:0,requests:{}};return x.object.onmessage=function(T){var E=T.data;x.pending-=E.count,x.requests[E.id][E.action](E.value),delete x.requests[E.id]},x}function m(b){for(var x="self.ready = WebAssembly.instantiate(new Uint8Array(["+new Uint8Array(r)+"]), {}).then(function(result) { result.instance.exports.__wasm_call_ctors(); return result.instance; });self.onmessage = "+A.name+";"+c.toString()+A.toString(),T=new Blob([x],{type:"text/javascript"}),E=URL.createObjectURL(T),v=d.length;v<b;++v)d[v]=g(E);for(var v=b;v<d.length;++v)d[v].object.postMessage({});d.length=b,URL.revokeObjectURL(E)}function y(b,x,T,E,v){for(var S=d[0],I=1;I<d.length;++I)d[I].pending<S.pending&&(S=d[I]);return new Promise(function(R,O){var L=new Uint8Array(T),_=++p;S.pending+=b,S.requests[_]={resolve:R,reject:O},S.object.postMessage({id:_,count:b,size:x,source:L,mode:E,filter:v},[L.buffer])})}function A(b){var x=b.data;self.ready.then(function(T){if(!x.id)return self.close();try{var E=new Uint8Array(x.count*x.size);c(T,T.exports[x.mode],E,x.count,x.size,x.source,T.exports[x.filter]),self.postMessage({id:x.id,count:x.count,action:"resolve",value:E},[E.buffer])}catch(v){self.postMessage({id:x.id,count:x.count,action:"reject",value:v})}})}return{ready:s,supported:!0,useWorkers:function(b){m(b)},decodeVertexBuffer:function(b,x,T,E,v){c(o,o.exports.meshopt_decodeVertexBuffer,b,x,T,E,o.exports[u[v]])},decodeIndexBuffer:function(b,x,T,E){c(o,o.exports.meshopt_decodeIndexBuffer,b,x,T,E)},decodeIndexSequence:function(b,x,T,E){c(o,o.exports.meshopt_decodeIndexSequence,b,x,T,E)},decodeGltfBuffer:function(b,x,T,E,v,S){c(o,o.exports[f[v]],b,x,T,E,o.exports[u[S]])},decodeGltfBufferAsync:function(b,x,T,E,v){return d.length>0?y(b,x,T,f[E],u[v]):s.then(function(){var S=new Uint8Array(b*x);return c(o,o.exports[f[E]],S,b,x,T,o.exports[u[v]]),S})}}})();var Mjn=(function(){var e="b9H79Tebbbe:6eO9Geueu9Geub9Gbb9Gsuuuuuuuuuuuu99uueu9Gvuuuuub9Gruuuuuuub9Gouuuuuue999Gvuuuuueu9Gzuuuuuuuuuuu99uuuub9Gquuuuuuu99uueu9GPuuuuuuuuuuu99uueu9Gquuuuuuuu99ueu9Gruuuuuu99eu9Gwuuuuuu99ueu9Giuuue999Gluuuueu9Gluuuub9GiuuueuiLQdilvorlwDiqkxmPszbHHbelve9Weiiviebeoweuecj:Gdkr:Bdxo9TW9T9VV95dbH9F9F939H79T9F9J9H229F9Jt9VV7bbz9TW79O9V9Wt9F79P9T9W29P9M95bw8E9TW79O9V9Wt9F79P9T9W29P9M959x9Pt9OcttV9P9I91tW7bD8A9TW79O9V9Wt9F79P9T9W29P9M959x9Pt9O9v9W9K9HtWbqQ9TW79O9V9Wt9F79P9T9W29P9M959t29V9W9W95bkX9TW79O9V9Wt9F79P9T9W29P9M959qV919UWbxQ9TW79O9V9Wt9F79P9T9W29P9M959q9V9P9Ut7bmX9TW79O9V9Wt9F79P9T9W29P9M959t9J9H2WbPa9TW79O9V9Wt9F9V9Wt9P9T9P96W9wWVtW94SWt9J9O9sW9T9H9Wbs59TW79O9V9Wt9F9NW9UWV9HtW9q9V79Pt9P9V9U9sW9T9H9Wbzl79IV9RbHDwebcekdCXq;y;WeQdbk;r:herYue99iuY99Xue9:D998Jjjjjbcj;sb9Rgs8Kjjjjbcbhzasc:Cefcbc;Kbz:tjjjb8AdnabaeSmbabaeadcdtzMjjjb8AkdnamcdGTmbalcrfci4cbyd1:H:cjbHjjjjbbhHasc:Cefasyd;8egecdtfaHBdbasaecefBd;8ecbhlcbhednadTmbabheadhOinaHaeydbci4fcb86bbaeclfheaOcufgOmbkcbhlabheadhOinaHaeydbgAci4fgCaCRbbgCceaAcrGgAtV86bbaCcu7aA4ceGalfhlaeclfheaOcufgOmbkcualcdtalcFFFFi0Ehekaecbyd1:H:cjbHjjjjbbhzasc:Cefasyd;8egecdtfazBdbasaecefBd;8ealcd4alfhOcehHinaHgecethHaeaO6mbkcbhXcuaecdtgOaecFFFFi0Ecbyd1:H:cjbHjjjjbbhHasc:Cefasyd;8egAcdtfaHBdbasaAcefBd;8eaHcFeaOz:tjjjbhQdnadTmbaecufhLcbhKindndnaQabaKcdtfgYydbgAc:v;t;h;Ev2aLGgOcdtfgCydbgHcuSmbceheinazaHcdtfydbaASmdaOaefhHaecefheaQaHaLGgOcdtfgCydbgHcu9hmbkkazaXcdtfaABdbaCaXBdbaXhHaXcefhXkaYaHBdbaKcefgKad9hmbkkaQcbyd:m:H:cjbH:bjjjbbasasyd;8ecufBd;8ekcbh8AcualcefgecdtaecFFFFi0Ecbyd1:H:cjbHjjjjbbhLasc:Cefasyd;8egecdtfaLBdbasaLBdNeasaecefBd;8ecuadcitadcFFFFe0Ecbyd1:H:cjbHjjjjbbhEasc:Cefasyd;8egecdtfaEBdbasaEBd:yeasaecefBd;8eascNefabadalcbz:cjjjbcualcdtgealcFFFFi0Eg3cbyd1:H:cjbHjjjjbbhOasc:Cefasyd;8egHcdtfaOBdbasaHcefBd;8ea3cbyd1:H:cjbHjjjjbbhQasc:Cefasyd;8egHcdtfaQBdbasaHcefBd;8eaOaQaialavazasc:Cefz:djjjbalcbyd1:H:cjbHjjjjbbhYasc:Cefasyd;8egHcdtfaYBdbasaHcefBd;8ea3cbyd1:H:cjbHjjjjbbhHasc:Cefasyd;8egAcdtfaHBdbasaAcefBd;8ea3cbyd1:H:cjbHjjjjbbhAasc:Cefasyd;8egCcdtfaABdbasaCcefBd;8eaHcFeaez:tjjjbh5aAcFeaez:tjjjbh8EdnalTmbindnaLa8AgAcefg8AcdtfydbgCaLaAcdtgefydbgHSmbaCaH9Rh8FaEaHcitfhaa8Eaefhha5aefhKcbhCindndnaaaCcitfydbgXaA9hmbaKaABdbahaABdbxekdnaLaXcdtggfgeclfydbgHaeydbgeSmbaHae9RhHaEaecitfheinaeydbaASmdaecwfheaHcufgHmbkka8EagfgeaAaXaeydbcuSEBdbaKaXaAaKydbcuSEBdbkaCcefgCa8F9hmbkka8Aal9hmbkaOhHaQhAa5hXa8EhCcbheindndnaeaHydbgK9hmbdnaeaAydbgK9hmbaXydbhKdnaCydbg8Fcu9hmbaKcu9hmbaYaefcb86bbxikdna8FcuSmbaKcuSmbaea8FSmbaOa8FcdtfydbaOaKcdtfydb9hmbaYaefcd86bbxikaYaefhadnaea8FSmbaeaKSmbaace86bbxikaacl86bbxdkdnaeaQaKcdtg8Ffydb9hmbdnaCydbgacuSmbaeaaSmbaXydbggcuSmbaeagSmba8Ea8FfydbghcuSmbahaKSmba5a8Ffydbg8FcuSmba8FaKSmbdnaOaacdtfydbgKaOa8Fcdtfydb9hmbaKaOagcdtfydbg8FSmba8FaOahcdtfydb9hmbaYaefcd86bbxlkaYaefcl86bbxikaYaefcl86bbxdkaYaefcl86bbxekaYaefaYaKfRbb86bbkaHclfhHaAclfhAaXclfhXaCclfhCalaecefge9hmbkdnamcaGTmbcbh8JindndnaYa8Jfg8KRbbg8Lc9:fPibebekdndndnaOa8Jcdtfydbgea8J9hmbdnaqmbcbh8FxdkdnazTmbcbh8Fa8JheinaqazaecdtgefydbfRbbce4a8FVceGh8FaQaefydbgea8J9hmbxikkcbh8Fa8JheinaqaefRbbce4a8FVceGh8FaQaecdtfydbgea8J9hmbxdkkaYaefRbbhexeka8JheindnaLaecdtg8AfgeclfydbgHaeydbgeSmbaHae9RhgaEaecitfhhaOa8AfhacbhKinahaKcitfydbgXhednindnaLaecdtgCfgeclfydbgHaeydbgeSmbaHae9RhHaEaecitfheaaydbhAdninaOaeydbcdtfydbaASmeaecwfheaHcufgHTmdxbkkcbhexdkaQaCfydbgeaX9hmbkceheka8FaeVh8FaKcefgKag9hmbkkaQa8Afydbgea8J9hmbka8Lcia8FceGEheka8Kae86bbka8Jcefg8Jal9hmbkkdnaqTmbdndnazTmbazheaOhHalhAindnaqaeydbfRbbceGTmbaYaHydbfcl86bbkaeclfheaHclfhHaAcufgAmbxdkkaqheaOhHalhAindnaeRbbceGTmbaYaHydbfcl86bbkaecefheaHclfhHaAcufgAmbkkaOhealhAaYhHindnaYaeydbfRbbcl9hmbaHcl86bbkaeclfheaHcefhHaAcufgAmbkkamceGTmbaYhealhHindnaeRbbce9hmbaecl86bbkaecefheaHcufgHmbkkcbh8Mcualcx2alc;v:Q;v:Qe0Ecbyd1:H:cjbHjjjjbbh8Nasc:Cefasyd;8egecdtfa8NBdbasaecefBd;8eascbBd:qeas9cb83i1ea8Naialavazasc1efz:ejjjbhydndnaDmbcbh8PcbhCxekcbhCawhecbhHindnaeIdbJbbbb9ETmbasaCcdtfaHBdbaCcefhCkaeclfheaDaHcefgH9hmbkcuaCal2gecdtaecFFFFi0Ecbyd1:H:cjbHjjjjbbh8Pasc:Cefasyd;8egecdtfa8PBdbasaecefBd;8ealTmbdnaCmbcbhCxekarcd4hgdnazTmbaCcdthhcbh8Fa8Phainaoaza8Fcdtfydbag2cdtfhKasheaahHaChAinaHaKaeydbcdtgXfIdbawaXfIdbNUdbaeclfheaHclfhHaAcufgAmbkaaahfhaa8Fcefg8Fal9hmbxdkkaCcdthhcbh8Fa8Phainaoa8Fag2cdtfhKasheaahHaChAinaHaKaeydbcdtgXfIdbawaXfIdbNUdbaeclfheaHclfhHaAcufgAmbkaaahfhaa8Fcefg8Fal9hmbkkcualc8S2gHalc;D;O;f8U0EgXcbyd1:H:cjbHjjjjbbheasc:Cefasyd;8egAcdtfaeBdbasaAcefBd;8eaecbaHz:tjjjbhIcbh8RcbhgdnaCTmbcbh8MaXcbyd1:H:cjbHjjjjbbhgasc:Cefasyd;8egecdtfagBdbasaecefBd;8eagcbaHz:tjjjb8AcuaCal2gecltgHaecFFFFb0Ecbyd1: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dbMUdbaeaBaeIdlMUdlaea86aeIdwMUdwaea8SaeIdxMUdxaea8UaeIdzMUdzaea8ZaeIdCMUdCaea83aeIdKMUdKaea85aeId3MUd3aea87aeIdaMUdaaeaUaeId8KMUd8KaeaRaeIdyMUdyaga8Ac8S2fgea80aeIdbMUdbaeaBaeIdlMUdlaea86aeIdwMUdwaea8SaeIdxMUdxaea8UaeIdzMUdzaea8ZaeIdCMUdCaea83aeIdKMUdKaea85aeId3MUd3aea87aeIdaMUdaaeaUaeId8KMUd8KaeaRaeIdyMUdya8Ra8Jcltfh8FcbhHaChXina8FaHfgeascjdfaHfgAIdbaeIdbMUdbaeclfgKaAclfIdbaKIdbMUdbaecwfgKaAcwfIdbaKIdbMUdbaecxfgeaAcxfIdbaeIdbMUdbaHczfhHaXcufgXmbka8Ra8Kcltfh8FcbhHaChXina8FaHfgeascjdfaHfgAIdbaeIdbMUdbaeclfgKaAclfIdbaKIdbMUdbaecwfgKaAcwfIdbaKIdbMUdbaecxfgeaAcxfIdbaeIdbMUdbaHczfhHaXcufgXmbka8RaDcltfh8FcbhHaChXina8FaHfgeascjdfaHfgAIdbaeIdbMUdbaeclfgKaAclfIdbaKIdbMUdbaecwfgKaAcwfIdbaKIdbMUdbaecxfgeaAcxfIdbaeIdbMUdbaHczfhHaXcufgXmbkaacifgaad6mbkkcbhAdndnamcwGgTmbJbbbbh8ScbhScbh9hcbh9ixekcbhSa3cbyd1:H:cjbHjjjjbbh9iasc:Cefasyd;8egecdtfa9iBdbasaecefBd;8ecua9ialabadaOz:fjjjbgXcltaXcjjjjiGEcbyd1:H:cjbHjjjjbbh9hasc:Cefasyd;8egecdtfa9hBdbasaecefBd;8ea9haXa9ia8Nalz:gjjjbJFFuuh8SaXTmba9hheaXhHinaeIdbgRa8Sa8SaR9EEh8SaeclfheaHcufgHmbkaXhSkdnalTmbaLclfheaLydbhXaYhHalhKcbhAincbaeydbg8FaX9RaHRbbcpeGEaAfhAaHcefhHaeclfhea8FhXaKcufgKm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ecwfIdbNa8YaeIdbNa81aeclfIdbNMMMg8Wa8WM:tNa8VMh8VaHclfhHaeczfheaAcufgAmbka8V:lh8VkaBaR:lMhBa86a8VMh86kaha86aBa86aB9DgeEUdwahaKa8FaeaDcb9hGgeEBdlaha8FaKaeEBdba8Kcefg8Ka9q9hmbkascjdfcbcj;qbz:tjjjb8Aa9phea9qhHinascjdfaeydbcA4cF8FGgAcFAaAcFA6EcdtfgAaAydbcefBdbaecxfheaHcufgHmbkcbhecbhHinascjdfaefgAydbhXaAaHBdbaXaHfhHaeclfgecj;qb9hmbkcbhea9phHinascjdfaHydbcA4cF8FGgAcFAaAcFA6EcdtfgAaAydbgAcefBdba0aAcdtfaeBdbaHcxfhHa9qaecefge9hmbkadak9RgAci9Uh9sdnalTmbcbhea9mhHinaHaeBdbaHclfhHalaecefge9hmbkkcbh9ta9ncbalz:tjjjbh3aAcO9Uh9ua9sce4h9rcbh8Lcbh8Kdnina9ka0a8Kcdtfydbcx2fg8JIdwgRa879Emea8La9s9pmeJFFuuh8Vdna9ra9q9pmba9ka0a9rcdtfydbcx2fIdwJbb;aZNh8VkdnaRa8V9ETmbaRaU9ETmba8La9u0mdkdna3aOa8JydlgDcdtg9vfg8AydbgAfg9wRbba3aOa8Jydbghcdtg9xfydbgefg9yRbbVmbaYahfRbbh9zdndnaLaecdtfgHclfydbgXaHydbgHSmbaXaH9RhXa8NaAcx2fh8Fa8Naecx2fhaaEaHcitfheindna9maeydbcdtfydbgHaASmba9maeclfydbcdtfydbgKaASmbaHaKSmba8NaKcx2fgKIdba8NaHcx2fgHIdbg8W:tgRaaIdlaHIdlg8X:tg80NaKIdla8X:tg8VaaIdba8W:tgBN:tg8YaRa8FIdla8X:tg86Na8Va8FIdba8W:tg8UN:tg8XNa8VaaIdwaHIdwg81:tg8ZNaKIdwa81:tg8Wa80N:tg80a8Va8FIdwa81:tg83Na8Wa86N:tg8VNa8WaBNaRa8ZN:tg81a8Wa8UNaRa83N:tgRNMMa8Ya8YNa80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fgeIdygR:vaRJbbbb9BEaeIdwa8Na8Acx2fgHIdwgRNaeIdzaHIdbg8VNaeIdaMg8Wa8WMMaRNaeIdlaHIdlg8WNaeIdCaRNaeId3MgRaRMMa8WNaeIdba8VNaeIdxa8WNaeIdKMgRaRMMa8VNaeId8KMMM:lNgRa85a85aR9DEh85ka8Fa9ofh8Fahcefghal9hmbkcbhHa5heindnaeydbgAcuSmbdnaHa9maAcdtgXfydbgA9hmbcuhAa5aXfydbgXcuSmba9maXcdtfydbhAkaeaABdbkaeclfhealaHcefgH9hmbkcbhHa8EheindnaeydbgAcuSmbdnaHa9maAcdtgXfydbgA9hmbcuhAa8EaXfydbgXcuSmba9maXcdtfydbhAkaeaABdbkaeclfhealaHcefgH9hmbkka85aUaCEh85cbhHabhecbhAindnaOa9maeydbcdtfydbg8FcdtfydbgXaOa9maeclfydbcdtfydbgacdtfydbgKSmbaXaOa9maecwfydbcdtfydbg8AcdtfydbghSmbaKahSmbabaHcdtfgXa8FBdbaXcwfa8ABdbaXclfaaBdbaHcifhHkaecxfheaAcifgAad6mbkdndnaTmbaHhdxekdnaHak0mbaHhdxekdna8Sa859FmbaHhdxekJFFuuh8ScbhdabhecbhAindna9ha9iaeydbgXcdtfydbcdtfIdbgRa859ETmbaeclf8Pdbh9AabadcdtfgKaXBdbaKclfa9A83dbaRa8Sa8SaR9EEh8SadcifhdkaecxfheaAcifgAaH6mbkkadak0mbxdkkascNefabadalaOz:cjjjbkdndnadak0mbadhaxekdnaTmbadhaxekdna8Sa879FmbadhaxekcehKina8SJbb;aZNgRa87aRa879DEh8WJbbbbhRdnaSTmba9hheaShHinaeIdbg8VaRa8Va8W9FEaRa8VaR9EEhRaeclfheaHcufgHmbkkJFFuuh8ScbhaabhecbhHindna9ha9iaeydbgAcdtfydbcdtfIdbg8Va8W9ETmbaeclf8Pdbh9AabaacdtfgXaABdbaXclfa9A83dba8Va8Sa8Sa8V9EEh8SaacifhakaecxfheaHcifgHad6mbkdnaKaaad9hVceGmbadhaxdkaRaUaUaR9DEhUaaak9nmecbhKaahda8Sa879FmbkkdnamcjjjjdGTmba9ncbalz:tjjjbh8AdnaaTmbabheaahHina8AaeydbgAfce86bba8AaOaAcdtfydbfce86bbaeclfheaHcufgHmbkkascNefabaaalaOz:cjjjbdndnalTmbcbhXindna8AaXfRbbTmbdnaYaXfRbbgecl0mbceaetcQGmekdnaOaXcdtg8FfydbgeaXSmba8NaXcx2fgHa8Naecx2fgeydwBdwaHae8Pdb83dbxekaIaXc8S2fgKIdygcacJL:3;rUNgRMh87aKIdwg9BaRMh8SaKIdlg9CaRMh8UaKIdbg9DaRMh81aKIdag9EaRa8NaXcx2fg8JIdwg88N:th8ZaKId3g9FaRa8JIdlg89N:th83aKIdKg9Ga8JIdbg8:aRN:th80JbbbbhnaKIdCg9HJbbbbMh85aKIdzg9IJbbbbMhBaKIdxg9JJbbbbMh86dndnaCTmbaXhAinJbbbba87agaAc8S2fgHIdygR:vaRJbbbb9BEhRa8RaAaC2cltfheaHIdaa87Na8ZMh8ZaHId3a87Na83Mh83aHIdKa87Na80Mh80aHIdCa87Na85Mh85aHIdza87NaBMhBaHIdxa87Na86Mh86aHIdwa87Na8SMh8SaHIdla87Na8UMh8UaHIdba87Na81Mh81aChHina8ZaecwfIdbg8VaecxfIdbg8YNaRN:th8Za83aeclfIdbg8Wa8YNaRN:th83a85a8Wa8VNaRN:th85a81aeIdbg8Xa8XNaRN:th81a80a8Xa8YNaRN:th80aBa8Xa8VNaRN:thBa86a8Xa8WNaRN:th86a8Sa8Va8VNaRN:th8Sa8Ua8Wa8WNaRN:th8UaeczfheaHcufgHmbkaQaAcdtfydbgAaX9hmbka8MTmba8MaXcltfgeIdxhxaeIdwh9caeIdlhJaeIdbhRxekJbbbbhxJbbbbh9cJbbbbhJJbbbbhRkaBa81:vg8Wa80Na8Z:ta85aBa86a81:vg8VN:tg8Za8Ua86a8VN:tg8Y:vg8Xa8Va80Na83:tg8UN:th83a9caRa8WN:taJaRa8VN:tg86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ja89Na9GMg8Va8VMMa8:NanMMM:lNJbb;aZNJ:983:g81M9Emba8JaBUdwa8Ja85Udla8Ja87UdbkaXcefgXal9hmbkdnaCmbcbhCxdkcbhXindna8AaXfRbbTmbaOaXcdtgefydbaX9hmbaYaXfhhaQaefh8Ja8NaXcx2fhAa8PaXaC2cdtfhDcbhEincuhLdnahRbbci9hmbaXhLa8JydbgeaXSmba8PaEcdtgHfhKaDaHfIdbhRaXhLinaLhHcuhLdnaKaeaC2cdtfIdbaR9CmbaHcuSmbaHhLagaec8S2fIdyagaHc8S2fIdy9ETmbaehLkaQaecdtfydbgeaX9hmbkka8PaEcdtfhKa8RaEcltfh8FaXheinaKaeaC2cdtfJbbbbJbbjZagaeaLaLcuSEgHc8S2fIdygR:vaRJbbbb9BEa8FaHaC2cltfgHIdwaAIdwNaHIdbaAIdbNaHIdlaAIdlNMMaHIdxMNUdbaQaecdtfydbgeaX9hmbkaEcefgEaC9hmbkkaXcefgXal9hmbxdkkaCmbcbhCkaiavaoarawaCala8Na8Pazasayasc1efaYa8Aaqz:hjjjbkdnamcjjjjlGTmbazmbaaTmbabhecbhLinaYaeydbgAfRbbc3thQaecwfgXydbhHcjjjj94hCdna5aAcdtgEfydbaeclfgKydbgOSmbcjjjj94cba8EaOcdtfydbaASEhCkaeaQaCVaAVBdbaYaOfRbbc3th8Fcjjjj94hCcjjjj94hQdna5aOcdtfydbaHSmbcjjjj94cba8EaHcdtfydbaOSEhQkaKa8FaQVaOVBdbaYaHfRbbc3thOdna5aHcdtfydbaASmbcjjjj94cba8EaEfydbaHSEhCkaXaOaCVaHVBdbaecxfheaLcifgLaa6mbkkdnazTmbaaTmbaaheinabazabydbcdtfydbBdbabclfhbaecufgembkkdnaPTmbaPaZaU:rNUdbkdnasyd;8egHTmbaHcdtasc:Ceffc98fheinaeydbcbyd:m:H:cjbH:bjjjbbaec98fheaHcufgHmbkkascj;sbf8Kjjjjbaak;Yieouabydlhvabydbclfcbaicdtz:tjjjbhoadci9UhrdnadTmbdnalTmbaehwadhDinaoalawydbcdtfydbcdtfgqaqydbcefBdbawclfhwaDcufgDmbxdkkaehwadhDinaoawydbcdtfgqaqydbcefBdbawclfhwaDcufgDmbkkdnaiTmbcbhDaohwinawydbhqawaDBdbawclfhwaqaDfhDaicufgimbkkdnadci6mbinaecwfydbhwaeclfydbhDaeydbhidnalTmbalawcdtfydbhwalaDcdtfydbhDalaicdtfydbhikavaoaicdtfgqydbcitfaDBdbavaqydbcitfawBdlaqaqydbcefBdbavaoaDcdtfgqydbcitfawBdbavaqydbcitfaiBdlaqaqydbcefBdbavaoawcdtfgwydbcitfaiBdbavawydbcitfaDBdlawawydbcefBdbaecxfhearcufgrmbkkabydbcbBdbk:todDue99aicd4aifhrcehwinawgDcethwaDar6mbkcuaDcdtgraDcFFFFi0Ecbyd1:H:cjbHjjjjbbhwaoaoyd9GgqcefBd9GaoaqcdtfawBdbawcFearz:tjjjbhkdnaiTmbalcd4hlaDcufhxcbhminamhDdnavTmbavamcdtfydbhDkcbadaDal2cdtfgDydlgwawcjjjj94SEgwcH4aw7c:F:b:DD2cbaDydbgwawcjjjj94SEgwcH4aw7c;D;O:B8J27cbaDydwgDaDcjjjj94SEgDcH4aD7c:3F;N8N27axGhwamcdthPdndndnavTmbakawcdtfgrydbgDcuSmeadavaPfydbal2cdtfgsIdbhzcehqinaqhrdnadavaDcdtfydbal2cdtfgqIdbaz9CmbaqIdlasIdl9CmbaqIdwasIdw9BmlkarcefhqakawarfaxGgwcdtfgrydbgDcu9hmbxdkkakawcdtfgrydbgDcuSmbadamal2cdtfgsIdbhzcehqinaqhrdnadaDal2cdtfgqIdbaz9CmbaqIdlasIdl9CmbaqIdwasIdw9BmikarcefhqakawarfaxGgwcdtfgrydbgDcu9hmbkkaramBdbamhDkabaPfaDBdbamcefgmai9hmbkkakcbyd:m:H:cjbH:bjjjbbaoaoyd9GcufBd9GdnaeTmbaiTmbcbhDaehwinawaDBdbawclfhwaiaDcefgD9hmbkcbhDaehwindnaDabydbgrSmbawaearcdtfgrydbBdbaraDBdbkabclfhbawclfhwaiaDcefgD9hmbkkk;:odvuv998Jjjjjbca9Rgocbyd1:G:cjbBdKaocb8Pdj:G:cjb83izaocbydN:G:cjbBdwaocb8Pd:m:G:cjb83ibdnadTmbaicd4hrdnabmbdnalTmbcbhwinaealawcdtfydbar2cdtfhDcbhiinaoczfaifgqaDaifIdbgkaqIdbgxaxak9EEUdbaoaifgqakaqIdbgxaxak9DEUdbaiclfgicx9hmbkawcefgwad9hmbxikkarcdthwcbhDincbhiinaoczfaifgqaeaifIdbgkaqIdbgxaxak9EEUdbaoaifgqakaqIdbgxaxak9DEUdbaiclfgicx9hmbkaeawfheaDcefgDad9hmbxdkkdnalTmbcbhwinabawcx2fgiaealawcdtfydbar2cdtfgDIdbUdbaiaDIdlUdlaiaDIdwUdwcbhiinaoczfaifgqaDaifIdbgkaqIdbgxaxak9EEUdbaoaifgqakaqIdbgxaxak9DEUdbaiclfgicx9hmbkawcefgwad9hmbxdkkarcdthlcbhwaehDinabawcx2fgiaeawar2cdtfgqIdbUdbaiaqIdlUdlaiaqIdwUdwcbhiinaoczfaifgqaDaifIdbgkaqIdbgxaxak9EEUdbaoaifgqakaqIdbgxaxak9DEUdbaiclfgicx9hmbkaDalfhDawcefgwad9hmbkkJbbbbaoIdbaoIdzgx:tgkakJbbbb9DEgkaoIdlaoIdCgm:tgPaPak9DEgkaoIdwaoIdKgP:tgsasak9DEhsdnabTmbadTmbJbbbbJbbjZas:vasJbbbb9BEhkinabakabIdbax:tNUdbabclfgoakaoIdbam:tNUdbabcwfgoakaoIdbaP:tNUdbabcxfhbadcufgdmbkkdnavTmbavaPUdwavamUdlavaxUdbkask:WlewudnaeTmbcbhvabhoinaoavBdbaoclfhoaeavcefgv9hmbkkdnaiTmbcbhrinadarcdtfhwcbhDinalawaDcdtgvyd:G:G:cjbcdtfydbcdtfydbhodnalawavfydbcdtfydbgqabaqcdtfgkydbgvSmbinakabavgqcdtfgxydbgvBdbaxhkaqav9hmbkkdnaoabaocdtfgkydbgvSmbinakabavgocdtfgxydbgvBdbaxhkaoav9hmbkkdnaqaoSmbabaqaoaqao0Ecdtfaqaoaqao6EBdbkaDcefgDci9hmbkarcifgrai6mbkkdnaembcbskcbhxindnalaxcdtgvfydbax9hmbaxhodnaxabavfgDydbgvSmbaDhqinaqabavgocdtfgkydbgvBdbakhqaoav9hmbkkaDaoBdbkaxcefgxae9hmbkcbhkabhvcbhoindndnaoalydbgq9hmbdnaoavydbgq9hmbavakBdbakcefhkxdkavabaqcdtfydbBdbxekavabaqcdtfydbBdbkalclfhlavclfhvaeaocefgo9hmbkakk;jiilud99euabcbaecltz:tjjjbhvdnalTmbadhoaihralhwinarcwfIdbhDarclfIdbhqavaoydbcltfgkarIdbakIdbMUdbakaqakIdlMUdlakaDakIdwMUdwakakIdxJbbjZMUdxaoclfhoarcxfhrawcufgwmbkkdnaeTmbavhkaehrinakcxfgoIdbhDaocbBdbakakIdbJbbbbJbbjZaD:vaDJbbbb9BEgDNUdbakclfgoaDaoIdbNUdbakcwfgoaDaoIdbNUdbakczfhkarcufgrmbkkdnalTmbinavadydbcltfgkaicwfIdbakIdw:tgDaDNaiIdbakIdb:tgDaDNaiclfIdbakIdl:tgDaDNMMgDakIdxgqaqaD9DEUdxadclfhdaicxfhialcufglmbkkdnaeTmbavcxfhkinabakIdbUdbakczfhkabclfhbaecufgembkkk:moerudnaoTmbaecd4hzdnavTmbaicd4hHavcdthOcbhAindnaPaAfRbbTmbaAhednaDTmbaDaAcdtfydbhekdnasTmbasaefRbbceGmekdnamaAfRbbclSmbabaeaz2cdtfgiaraAcx2fgCIdbakNaxIdbMUdbaiaCIdlakNaxIdlMUdlaiaCIdwakNaxIdwMUdwkadaeaH2cdtfhXaqheawhiavhCinaXaeydbcdtgQfaiIdbalaQfIdb:vUdbaeclfheaiclfhiaCcufgCmbkkawaOfhwaAcefgAao9hmbxdkkdnasmbcbheaDhiindnaPaefRbbTmbaehCdnaDTmbaiydbhCkamaefRbbclSmbabaCaz2cdtfgCarIdbakNaxIdbMUdbaCarclfIdbakNaxIdlMUdlaCarcwfIdbakNaxIdwMUdwkaiclfhiarcxfhraoaecefge9hmbxdkkdnaDTmbindnaPRbbTmbasaDydbgefRbbceGmbamRbbclSmbabaeaz2cdtfgearIdbakNaxIdbMUdbaearclfIdbakNaxIdlMUdlaearcwfIdbakNaxIdwMUdwkaPcefhPaDclfhDamcefhmarcxfhraocufgombxdkkazcdthicbheindnaPaefRbbTmbasaefRbbceGmbamaefRbbclSmbabarIdbakNaxIdbMUdbabclfarclfIdbakNaxIdlMUdbabcwfarcwfIdbakNaxIdwMUdbkarcxfhrabaifhbaoaecefge9hmbkkk8MbabaeadaialavcbcbcbcbcbaoarawaDz:bjjjbk8MbabaeadaialavaoarawaDaqakaxamaPz:bjjjbkRbababaeadaialavaoarawaDaqakaxcjjjjdVamz:bjjjbk:g8Koque99due99duq998Jjjjjbc;Wb9Rgq8Kjjjjbcbhkaqcxfcbc;Kbz:tjjjb8Aaqcualcx2alc;v:Q;v:Qe0Ecbyd1:H:cjbHjjjjbbgxBdxaqceBd2axaialavcbcbz:ejjjb8AaqcualcdtalcFFFFi0Egmcbyd1:H:cjbHjjjjbbgiBdzaqcdBd2dndnJFF959eJbbjZawJbbjZawJbbjZ9DE:vawJ9VO:d869DEgw:lJbbb9p9DTmbaw:OhPxekcjjjj94hPkadci9Uhsarco9UhzdndnaombaPcd9imekdnalTmbaPcuf:YhwdnaoTmbcbhvaihHaxhOindndnaoavfRbbceGTmbavcjjjjlVhAxekdndnaOclfIdbawNJbbbZMgC:lJbbb9p9DTmbaC:OhAxekcjjjj94hAkaAcqthAdndnaOcwfIdbawNJbbbZMgC:lJbbb9p9DTmbaC:OhXxekcjjjj94hXkaAaXVhAdndnaOIdbawNJbbbZMgC:lJbbb9p9DTmbaC:OhXxekcjjjj94hXkaAaXcCtVhAkaHaABdbaHclfhHaOcxfhOalavcefgv9hmbxdkkaxhvaihOalhHindndnavIdbawNJbbbZMgC:lJbbb9p9DTmbaC:OhAxekcjjjj94hAkaAcCthAdndnavclfIdbawNJbbbZMgC:lJbbb9p9DTmbaC:OhXxekcjjjj94hXkaXcqtaAVhAdndnavcwfIdbawNJbbbZMgC:lJbbb9p9DTmbaC:OhXxekcjjjj94hXkaOaAaXVBdbavcxfhvaOclfhOaHcufgHmbkkadTmbcbhkaehvcbhOinakaiavclfydbcdtfydbgHaiavcwfydbcdtfydbgA9haiavydbcdtfydbgXaH9haXaA9hGGfhkavcxfhvaOcifgOad6mbkkarci9UhQdndnaz:Z:rJbbbZMgw:lJbbb9p9DTmbaw:Ohvxekcjjjj94hvkaQ:ZhLcbhKc:bwhzdninakaQ9pmeazaP9Rcd9imeavazcufgOavaO9iEaPcefavaP9kEhYdnalTmbaYcuf:YhwdnaoTmbcbhOaihHaxhvindndnaoaOfRbbceGTmbaOcjjjjlVhAxekdndnavclfIdbawNJbbbZMgC:lJbbb9p9DTmbaC:OhAxekcjjjj94hAkaAcqthAdndnavcwfIdbawNJbbbZMgC:lJbbb9p9DTmbaC:OhXxekcjjjj94hXkaAaXVhAdndnavIdbawNJbbbZMgC:lJbbb9p9DTmbaC:OhXxekcjjjj94hXkaAaXcCtVhAkaHaABdbaHclfhHavcxfhvalaOcefgO9hmbxdkkaxhvaihOalhHindndnavIdbawNJbbbZMgC:lJbbb9p9DTmbaC:OhAxekcjjjj94hAkaAcCthAdndnavclfIdbawNJbbbZMgC:lJbbb9p9DTmbaC:OhXxekcjjjj94hXkaXcqtaAVhAdndnavcwfIdbawNJbbbZMgC:lJbbb9p9DTmbaC:OhXxekcjjjj94hXkaOaAaXVBdbavcxfhvaOclfhOaHcufgHmbkkcbhOdnadTmbaehvcbhHinaOaiavclfydbcdtfydbgAaiavcwfydbcdtfydbgX9haiavydbcdtfydbgraA9haraX9hGGfhOavcxfhvaHcifgHad6mbkkdnas:ZgCaL:taY:Ygwaz:Y:tg8ANak:ZgEaO:Zg3:tNaEaL:tawaP:Y:t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EhvkcbhXaqavcbyd1:H:cjbHjjjjbbgvBd3aqcvBd2avcbaOz:tjjjbhOdnadTmbaehiinaxaiclfydbgrcx2fgvIdbaxaiydbgocx2fgHIdbg3:tgCaxaicwfydbgYcx2fgAIdlaHIdlg8A:tgwNavIdla8A:tgEaAIdba3:tg8EN:tgLaLNaEaAIdwaHIdwg5:tg8FNavIdwa5:tgEawN:tgwawNaEa8ENaCa8FN:tgCaCNMMg8E:rhEJbbnnJbbjZazaocdtfydbgvazarcdtfydbgASavazaYcdtfydbgrSGgHEh8Fdna8EJbbbb9ETmbaLaE:vhLaCaE:vhCawaE:vhwkaOavc8S2fgvavIdbawa8FaE:rNgEawNNg8FMUdbavaCaEaCNgaNghavIdlMUdlavaLaEaLNg8ENggavIdwMUdwavawaaNgaavIdxMUdxava8EawNg8JavIdzMUdzavaCa8ENg8EavIdCMUdCavawaEaLa5Nawa3Na8AaCNMM:mg8ANg3NgwavIdKMUdKavaCa3NgCavId3MUd3avaLa3NgLavIdaMUdaava3a8ANg3avId8KMUd8KavaEavIdyMUdydnaHmbaOaAc8S2fgva8FavIdbMUdbavahavIdlMUdlavagavIdwMUdwavaaavIdxMUdxava8JavIdzMUdzava8EavIdCMUdCavawavIdKMUdKavaCavId3MUd3avaLavIdaMUdaava3avId8KMUd8KavaEavIdyMUdyaOarc8S2fgva8FavIdbMUdbavahavIdlMUdlavagavIdwMUdwavaaavIdxMUdxava8JavIdzMUdzava8EavIdCMUdCavawavIdKMUdKavaCavId3MUd3avaLavIdaMUdaava3avId8KMUd8KavaEavIdyMUdykaicxfhiaXcifgXad6mbkkcbhAaqcuaPcdtgvaPcFFFFi0Egicbyd1:H:cjbHjjjjbbgHBdaaqcoBd2aqaicbyd1:H:cjbHjjjjbbgiBd8KaqcrBd2aHcFeavz:tjjjbhYdnalTmbazhHinJbbbbJbbjZaOaHydbgXc8S2fgvIdygw:vawJbbbb9BEavIdwaxcwfIdbgwNavIdzaxIdbgCNavIdaMgLaLMMawNavIdlaxclfIdbgLNavIdCawNavId3MgwawMMaLNavIdbaCNavIdxaLNavIdKMgwawMMaCNavId8KMMM:lNhwdndnaYaXcdtgvfgXydbcuSmbaiavfIdbaw9ETmekaXaABdbaiavfawUdbkaHclfhHaxcxfhxalaAcefgA9hmbkkdndnaPmbJbbbbhwxekJbbbbhwinaiIdbgCawawaC9DEhwaiclfhiaPcufgPmbkaw:rhwkakcd4akfhOcehiinaigvcethiavaO6mbkcbhOaqcuavcdtgiavcFFFFi0Ecbyd1:H:cjbHjjjjbbgHBdyaHcFeaiz:tjjjbhXdnadTmbavcufhrcbhPcbhxindnazaeaxcdtfgvydbcdtfydbgiazavclfydbcdtfydbgOSmbaiazavcwfydbcdtfydbgvSmbaOavSmbaYavcdtfydbhAdndnaYaOcdtfydbgvaYaicdtfydbgi9pmbavaA9pmbaAhlaihoavhAxekdnaAai9pmbaAav9pmbaihlavhoxekavhlaAhoaihAkabaPcx2fgvaABdbavcwfaoBdbavclfalBdbdnaXaoc:3F;N8N2alc:F:b:DD27aAc;D;O:B8J27arGgOcdtfgvydbgicuSmbcehHinaHhvdnabaicx2fgiydbaA9hmbaiydlal9hmbaiydwaoSmikavcefhHaXaOavfarGgOcdtfgvydbgicu9hmbkkavaPBdbaPcefhPkaxcifgxad6mbkaPci2hOkcwhvaDTmekaDawUdbkavcdthvaqcxfc98fhiinaiavfydbcbyd:m:H:cjbH:bjjjbbavc98fgvmbkaqc;Wbf8KjjjjbaOk:3ldrue9:8Jjjjjbc;Wb9Rgr8Kjjjjbcbhwarcxfcbc;Kbz:tjjjb8AdnabaeSmbabaeadcdtzMjjjb8AkarcualcdtalcFFFFi0EgDcbyd1:H:cjbHjjjjbbgqBdxarceBd2aqcbaialavcbarcxfz:djjjbcualcx2alc;v:Q;v:Qe0Ecbyd1:H:cjbHjjjjbbhkarcxfaryd2gxcdtfakBdbaraxcefgmBd2akaialavcbcbz:ejjjb8AarcxfamcdtfaDcbyd1:H:cjbHjjjjbbgiBdbaraxcdfgvBd2arcxfavcdtfcuaialaeadaqz:fjjjbgecltaecjjjjiGEcbyd1:H:cjbHjjjjbbgqBdbaqaeaiakalz:gjjjbaxcifhkdnadTmbaoaoNhocbhwabhlcbheindnaqaialydbgvcdtfydbcdtfIdbao9ETmbalclf8PdbhPabawcdtfgDavBdbaDclfaP83dbawcifhwkalcxfhlaecifgead6mbkkdnakTmbaxcdtarcxffcwfhlinalydbcbyd:m:H:cjbH:bjjjbbalc98fhlakcufgkmbkkarc;Wbf8Kjjjjbawk:WCoDud99vue99vuv998Jjjjjbc;Wb9Rgw8KjjjjbdndnarmbcbhDxekawcxfcbc;Kbz:tjjjb8Aawcuadcx2adc;v:Q;v:Qe0Ecbyd1:H:cjbHjjjjbbgqBdxawceBd2aqaeadaicbcbz:ejjjb8AawcuadcdtadcFFFFi0Egkcbyd1:H:cjbHjjjjbbgxBdzawcdBd2adcd4adfhmceheinaegicetheaiam6mbkcbhPawcuaicdtgsaicFFFFi0Ecbyd1:H:cjbHjjjjbbgzBdCawciBd2dndnar:ZgH:rJbbbZMgO:lJbbb9p9DTmbaO:Ohexekcjjjj94hekaicufhAc:bwhCcbhXadhQcbhLinaeaCcufgiaeai9iEaPcefaeaP9kEhDdndnadTmbaDcuf:YhOaqhiaxheadhmindndnaiIdbaONJbbbZMgK:lJbbb9p9DTmbaK:OhYxekcjjjj94hYkaYcCthYdndnaiclfIdbaONJbbbZMgK:lJbbb9p9DTmbaK:Oh8Axekcjjjj94h8Aka8AcqtaYVhYdndnaicwfIdbaONJbbbZMgK:lJbbb9p9DTmbaK:Oh8Axekcjjjj94h8AkaeaYa8AVBdbaicxfhiaeclfheamcufgmmbkazcFeasz:tjjjbhEcbh3cbh5indnaEaxa5cdtfydbgYcm4aY7c:v;t;h;Ev2gics4ai7aAGgmcdtfg8AydbgecuSmbaeaYSmbcehiinaEamaifaAGgmcdtfg8AydbgecuSmeaicefhiaeaY9hmbkka8AaYBdba3aecuSfh3a5cefg5ad9hmbxdkkazcFeasz:tjjjb8Acbh3kdnaQ:ZgKaH:taD:YgOaC:Y:tg8ENaX:Zg8Fa3:Zga:tNa8FaH:taOaP:Y:tghNaaaK:tNMggJbbbb9BmbaKa8F:taha8EaaaH:tNNNag:vaOMhOkaPaDa3ar0giEhPaXa3aiEhXdna3arSmbaDaCaiEgCaP9Rcd9imbdndnaLcl0mbdnaOJbbbZMgO:lJbbb9p9DTmbaO:Ohexdkcjjjj94hexekaPaCfcd9Theka3aQaiEhQaLcefgLcs9hmekkdndnaXmbcihicbhDxekcbhiawakcbyd1:H:cjbHjjjjbbg5BdKawclBd2aPcuf:YhKdndnadTmbaqhiaxheadhmindndnaiIdbaKNJbbbZMgO:lJbbb9p9DTmbaO:OhYxekcjjjj94hYkaYcCthYdndnaiclfIdbaKNJbbbZMgO:lJbbb9p9DTmbaO:Oh8Axekcjjjj94h8Aka8AcqtaYVhYdndnaicwfIdbaKNJbbbZMgO:lJbbb9p9DTmbaO:Oh8Axekcjjjj94h8AkaeaYa8AVBdbaicxfhiaeclfheamcufgmmbkazcFeasz:tjjjbhEcbhDcbh3indndndnaEaxa3cdtgCfydbgYcm4aY7c:v;t;h;Ev2gics4ai7aAGgmcdtfg8AydbgecuSmbcehiinaxaecdtgefydbaYSmdamaifheaicefhiaEaeaAGgmcdtfg8Aydbgecu9hmbkka8Aa3BdbaDhiaDcefhDxeka5aefydbhika5aCfaiBdba3cefg3ad9hmbkcuaDc32giaDc;j:KM;jb0EhexekazcFeasz:tjjjb8AcbhDcbhekawaecbyd1:H:cjbHjjjjbbgeBd3awcvBd2aecbaiz:tjjjbh8Aavcd4hxdnadTmbdnalTmbaxcdthEa5hYaqhealhmadhAina8AaYydbc32fgiaeIdbaiIdbMUdbaiaeclfIdbaiIdlMUdlaiaecwfIdbaiIdwMUdwaiamIdbaiIdxMUdxaiamclfIdbaiIdzMUdzaiamcwfIdbaiIdCMUdCaiaiIdKJbbjZMUdKaYclfhYaecxfheamaEfhmaAcufgAmbxdkka5hmaqheadhYina8Aamydbc32fgiaeIdbaiIdbMUdbaiaeclfIdbaiIdlMUdlaiaecwfIdbaiIdwMUdwaiaiIdxJbbbbMUdxaiaiIdzJbbbbMUdzaiaiIdCJbbbbMUdCaiaiIdKJbbjZMUdKamclfhmaecxfheaYcufgYmbkkdnaDTmba8AhiaDheinaiaiIdbJbbbbJbbjZaicKfIdbgO:vaOJbbbb9BEgONUdbaiclfgmaOamIdbNUdbaicwfgmaOamIdbNUdbaicxfgmaOamIdbNUdbaiczfgmaOamIdbNUdbaicCfgmaOamIdbNUdbaic3fhiaecufgembkkcbhYawcuaDcdtgCaDcFFFFi0Egicbyd1:H:cjbHjjjjbbgeBdaawcoBd2awaicbyd1:H:cjbHjjjjbbgEBd8KaecFeaCz:tjjjbh3dnadTmbaoJbbjZJbbjZaK:vaPceSENgOaONhKaxcdthxalheinaKaec;8:G:cjbalEgmIdwa8Aa5ydbgAc32fgiIdC:tgOaONamIdbaiIdx:tgOaONamIdlaiIdz:tgOaONMMNaqcwfIdbaiIdw:tgOaONaqIdbaiIdb:tgOaONaqclfIdbaiIdl:tgOaONMMMhOdndna3aAcdtgifgmydbcuSmbaEaifIdbaO9ETmekamaYBdbaEaifaOUdbka5clfh5aqcxfhqaeaxfheadaYcefgY9hmbkkaba3aCzMjjjb8Acrhikaicdthiawcxfc98fheinaeaifydbcbyd:m:H:cjbH:bjjjbbaic98fgimbkkawc;Wbf8KjjjjbaDk:Pdidui99ducbhi8Jjjjjbca9Rglcbyd1:G:cjbBdKalcb8Pdj:G:cjb83izalcbydN:G:cjbBdwalcb8Pd:m:G:cjb83ibdndnaembJbbjFhvJbbjFhoJbbjFhrxekadcd4cdthwincbhdinalczfadfgDabadfIdbgvaDIdbgoaoav9EEUdbaladfgDavaDIdbgoaoav9DEUdbadclfgdcx9hmbkabawfhbaicefgiae9hmbkalIdwalIdK:thralIdlalIdC:thoalIdbalIdz:thvkJbbbbavavJbbbb9DEgvaoaoav9DEgvararav9DEk9DeeuabcFeaicdtz:tjjjbhlcbhbdnadTmbindnalaeydbcdtfgiydbcu9hmbaiabBdbabcefhbkaeclfheadcufgdmbkkabk;Bidqui998Jjjjjbc;Wb9Rgl8Kjjjjbalcxfcbc;Kbz:tjjjb8Aadcd4adfhvcehoinaogrcethoarav6mbkalcuarcdtgoarcFFFFi0Ecbyd1:H:cjbHjjjjbbgvBdxavcFeaoz:tjjjbhwdnadTmbaicd4hDarcufhqcbhkindndnawcbaeakaD2cdtfgrydlgiaicjjjj94SEgocH4ao7c:F:b:DD2cbarydbgxaxcjjjj94SEgocH4ao7c;D;O:B8J27cbarydwgmamcjjjj94SEgrcH4ar7c:3F;N8N27aqGgvcdtfgrydbgocuSmbam::hPai::hsax::hzcehiinaihrdnaeaoaD2cdtfgiIdbaz9CmbaiIdlas9CmbaiIdwaP9BmikarcefhiawavarfaqGgvcdtfgrydbgocu9hmbkkarakBdbakhokabakcdtfaoBdbakcefgkad9hmbkkalydxcbyd:m:H:cjbH:bjjjbbalc;Wbf8Kjjjjbk9teiucbcbyd:q:H:cjbgeabcifc98GfgbBd:q:H:cjbdndnabZbcztgd9nmbcuhiabad9RcFFifcz4nbcuSmekaehikaik;LeeeudndnaeabVciGTmbabhixekdndnadcz9pmbabhixekabhiinaiaeydbBdbaiclfaeclfydbBdbaicwfaecwfydbBdbaicxfaecxfydbBdbaeczfheaiczfhiadc9Wfgdcs0mbkkadcl6mbinaiaeydbBdbaeclfheaiclfhiadc98fgdci0mbkkdnadTmbinaiaeRbb86bbaicefhiaecefheadcufgdmbkkabk;aeedudndnabciGTmbabhixekaecFeGc:b:c:ew2hldndnadcz9pmbabhixekabhiinaialBdbaicxfalBdbaicwfalBdbaiclfalBdbaiczfhiadc9Wfgdcs0mbkkadcl6mbinaialBdbaiclfhiadc98fgdci0mbkkdnadTmbinaiae86bbaicefhiadcufgdmbkkabk9teiucbcbyd:q:H:cjbgeabcrfc94GfgbBd:q:H:cjbdndnabZbcztgd9nmbcuhiabad9RcFFifcz4nbcuSmekaehikaikTeeucbabcbyd:q:H:cjbge9Rcifc98GaefgbBd:q:H:cjbdnabZbcztge9nmbabae9RcFFifcz4nb8Akkk:Kedbcj:Gdk1eFFuuFFuuFFuuFFuFFFuFFFuFbbbbbbbbebbbdbbbbbbbebbbebbbdbbbbbbbbbbbeeeeebebbebbebebbbeebbbbbbbbbbbbeeeeeebebbeeebeebbbbebebbbbbbbbbbbbbbbbbbc1:Hdkxebbbdbbb:G:qbb",t=new Uint8Array([32,0,65,2,1,106,34,33,3,128,11,4,13,64,6,253,10,7,15,116,127,5,8,12,40,16,19,54,20,9,27,255,113,17,42,67,24,23,146,148,18,14,22,45,70,69,56,114,101,21,25,63,75,136,108,28,118,29,73,115]);if(typeof WebAssembly!="object")return{supported:!1};var n,i=WebAssembly.instantiate(r(e),{}).then(function(x){n=x.instance,n.exports.__wasm_call_ctors()});function r(x){for(var T=new Uint8Array(x.length),E=0;E<x.length;++E){var v=x.charCodeAt(E);T[E]=v>96?v-97:v>64?v-39:v+4}for(var S=0,E=0;E<x.length;++E)T[S++]=T[E]<60?t[T[E]]:(T[E]-60)*64+T[++E];return T.buffer.slice(0,S)}function o(x){if(!x)throw new Error("Assertion failed")}function s(x){return new Uint8Array(x.buffer,x.byteOffset,x.byteLength)}function a(x,T,E,v){var S=n.exports.sbrk,I=S(E*4),R=S(E*v*4),O=new Uint8Array(n.exports.memory.buffer);O.set(s(T),R),x(I,R,E,v*4),O=new Uint8Array(n.exports.memory.buffer);var L=new Uint32Array(E);return new Uint8Array(L.buffer).set(O.subarray(I,I+E*4)),S(I-S(0)),L}function c(x,T,E){var v=n.exports.sbrk,S=v(T.length*4),I=v(E*4),R=new Uint8Array(n.exports.memory.buffer),O=s(T);R.set(O,S);var L=x(I,S,T.length,E);R=new Uint8Array(n.exports.memory.buffer);var _=new Uint32Array(E);new Uint8Array(_.buffer).set(R.subarray(I,I+E*4)),v(S-v(0));for(var C=0;C<T.length;++C)T[C]=_[T[C]];return[_,L]}function u(x){for(var T=0,E=0;E<x.length;++E){var v=x[E];T=T<v?v:T}return T}function f(x,T,E,v,S,I,R,O,L){var _=n.exports.sbrk,C=_(4),w=_(E*4),P=_(S*I),M=_(E*4),F=new Uint8Array(n.exports.memory.buffer);F.set(s(v),P),F.set(s(T),M);var V=x(w,M,E,P,S,I,R,O,L,C);F=new Uint8Array(n.exports.memory.buffer);var B=new Uint32Array(V);s(B).set(F.subarray(w,w+V*4));var j=new Float32Array(1);return s(j).set(F.subarray(C,C+4)),_(C-_(0)),[B,j[0]]}function d(x,T,E,v,S,I,R,O,L,_,C,w,P){var M=n.exports.sbrk,F=M(4),V=M(E*4),B=M(S*I),j=M(S*O),k=M(L.length*4),G=M(E*4),q=_?M(S):0,Q=new Uint8Array(n.exports.memory.buffer);Q.set(s(v),B),Q.set(s(R),j),Q.set(s(L),k),Q.set(s(T),G),_&&Q.set(s(_),q);var W=x(V,G,E,B,S,I,j,O,k,L.length,q,C,w,P,F);Q=new Uint8Array(n.exports.memory.buffer);var J=new Uint32Array(W);s(J).set(Q.subarray(V,V+W*4));var Z=new Float32Array(1);return s(Z).set(Q.subarray(F,F+4)),M(F-M(0)),[J,Z[0]]}function p(x,T,E,v,S,I,R,O,L,_,C,w,P){var M=n.exports.sbrk,F=M(4),V=M(S*I),B=M(S*O),j=M(L.length*4),k=M(E*4),G=_?M(S):0,q=new Uint8Array(n.exports.memory.buffer);q.set(s(v),V),q.set(s(R),B),q.set(s(L),j),q.set(s(T),k),_&&q.set(s(_),G);var Q=x(k,E,V,S,I,B,O,j,L.length,G,C,w,P,F);q=new Uint8Array(n.exports.memory.buffer),s(T).set(q.subarray(k,k+Q*4)),s(v).set(q.subarray(V,V+S*I)),s(R).set(q.subarray(B,B+S*O));var W=new Float32Array(1);return s(W).set(q.subarray(F,F+4)),M(F-M(0)),[Q,W[0]]}function g(x,T,E,v){var S=n.exports.sbrk,I=S(E*v),R=new Uint8Array(n.exports.memory.buffer);R.set(s(T),I);var O=x(I,E,v);return S(I-S(0)),O}function m(x,T,E,v,S,I,R,O){var L=n.exports.sbrk,_=L(O*4),C=L(E*v),w=S?L(E*I):0,P=new Uint8Array(n.exports.memory.buffer);P.set(s(T),C),S&&P.set(s(S),w);var M=x(_,C,E,v,w,I,R,O);P=new Uint8Array(n.exports.memory.buffer);var F=new Uint32Array(M);return s(F).set(P.subarray(_,_+M*4)),L(_-L(0)),F}function y(x,T,E,v,S,I,R,O,L){var _=n.exports.sbrk,C=_(4),w=_(E*4),P=_(S*I),M=_(E*4),F=R?_(S):0,V=new Uint8Array(n.exports.memory.buffer);V.set(s(v),P),V.set(s(T),M),R&&V.set(s(R),F);var B=x(w,M,E,P,S,I,F,O,L,C);V=new Uint8Array(n.exports.memory.buffer);var j=new Uint32Array(B);s(j).set(V.subarray(w,w+B*4));var k=new Float32Array(1);return s(k).set(V.subarray(C,C+4)),_(C-_(0)),[j,k[0]]}function A(x,T,E,v,S,I,R){var O=n.exports.sbrk,L=O(E*4),_=O(S*I),C=O(E*4),w=new Uint8Array(n.exports.memory.buffer);w.set(s(v),_),w.set(s(T),C);var P=x(L,C,E,_,S,I,R);w=new Uint8Array(n.exports.memory.buffer);var M=new Uint32Array(P);return s(M).set(w.subarray(L,L+P*4)),O(L-O(0)),M}var b={LockBorder:1,Sparse:2,ErrorAbsolute:4,Prune:8,Regularize:16,Permissive:32,RegularizeLight:64,_InternalDebug:1<<30};return{ready:i,supported:!0,compactMesh:function(x){o(x instanceof Uint32Array||x instanceof Int32Array||x instanceof Uint16Array||x instanceof Int16Array),o(x.length%3==0);var T=x.BYTES_PER_ELEMENT==4?x:new Uint32Array(x),E=c(n.exports.meshopt_optimizeVertexFetchRemap,T,u(x)+1);if(x!==T)for(var v=0;v<T.length;++v)x[v]=T[v];return E},generatePositionRemap:function(x,T){return o(x instanceof Float32Array),o(x.length%T==0),o(T>=3),a(n.exports.meshopt_generatePositionRemap,x,x.length/T,T)},simplify:function(x,T,E,v,S,I){o(x instanceof Uint32Array||x instanceof Int32Array||x instanceof Uint16Array||x instanceof Int16Array),o(x.length%3==0),o(T instanceof Float32Array),o(T.length%E==0),o(E>=3),o(v>=0&&v<=x.length),o(v%3==0),o(S>=0);for(var R=0,O=0;O<(I?I.length:0);++O)o(I[O]in b),R|=b[I[O]];var L=x.BYTES_PER_ELEMENT==4?x:new Uint32Array(x),_=f(n.exports.meshopt_simplify,L,x.length,T,T.length/E,E*4,v,S,R);return _[0]=x instanceof Uint32Array?_[0]:new x.constructor(_[0]),_},simplifyWithAttributes:function(x,T,E,v,S,I,R,O,L,_){o(x instanceof Uint32Array||x instanceof Int32Array||x instanceof Uint16Array||x instanceof Int16Array),o(x.length%3==0),o(T instanceof Float32Array),o(T.length%E==0),o(E>=3),o(v instanceof Float32Array),o(v.length==S*(T.length/E)),o(S>=0),o(R==null||R instanceof Uint8Array),o(R==null||R.length==T.length/E),o(O>=0&&O<=x.length),o(O%3==0),o(L>=0),o(Array.isArray(I)),o(S>=I.length),o(I.length<=32);for(var C=0;C<I.length;++C)o(I[C]>=0);for(var w=0,C=0;C<(_?_.length:0);++C)o(_[C]in b),w|=b[_[C]];var P=x.BYTES_PER_ELEMENT==4?x:new Uint32Array(x),M=d(n.exports.meshopt_simplifyWithAttributes,P,x.length,T,T.length/E,E*4,v,S*4,new Float32Array(I),R,O,L,w);return M[0]=x instanceof Uint32Array?M[0]:new x.constructor(M[0]),M},simplifyWithUpdate:function(x,T,E,v,S,I,R,O,L,_){o(x instanceof Uint32Array||x instanceof Int32Array||x instanceof Uint16Array||x instanceof Int16Array),o(x.length%3==0),o(T instanceof Float32Array),o(T.length%E==0),o(E>=3),o(v instanceof Float32Array),o(v.length==S*(T.length/E)),o(S>=0),o(R==null||R instanceof Uint8Array),o(R==null||R.length==T.length/E),o(O>=0&&O<=x.length),o(O%3==0),o(L>=0),o(Array.isArray(I)),o(S>=I.length),o(I.length<=32);for(var C=0;C<I.length;++C)o(I[C]>=0);for(var w=0,C=0;C<(_?_.length:0);++C)o(_[C]in b),w|=b[_[C]];var P=x.BYTES_PER_ELEMENT==4?x:new Uint32Array(x),M=p(n.exports.meshopt_simplifyWithUpdate,P,x.length,T,T.length/E,E*4,v,S*4,new Float32Array(I),R,O,L,w);if(x!==P)for(var C=0;C<M[0];++C)x[C]=P[C];return M},getScale:function(x,T){return o(x instanceof Float32Array),o(x.length%T==0),o(T>=3),g(n.exports.meshopt_simplifyScale,x,x.length/T,T*4)},simplifyPoints:function(x,T,E,v,S,I){return o(x instanceof Float32Array),o(x.length%T==0),o(T>=3),o(E>=0&&E<=x.length/T),v?(o(v instanceof Float32Array),o(v.length%S==0),o(S>=3),o(x.length/T==v.length/S),m(n.exports.meshopt_simplifyPoints,x,x.length/T,T*4,v,S*4,I||0,E)):m(n.exports.meshopt_simplifyPoints,x,x.length/T,T*4,void 0,0,0,E)},simplifySloppy:function(x,T,E,v,S,I){o(x instanceof Uint32Array||x instanceof Int32Array||x instanceof Uint16Array||x instanceof Int16Array),o(x.length%3==0),o(T instanceof Float32Array),o(T.length%E==0),o(E>=3),o(v==null||v instanceof Uint8Array),o(v==null||v.length==T.length/E),o(S>=0&&S<=x.length),o(S%3==0),o(I>=0);var R=x.BYTES_PER_ELEMENT==4?x:new Uint32Array(x),O=y(n.exports.meshopt_simplifySloppy,R,x.length,T,T.length/E,E*4,v,S,I);return O[0]=x instanceof Uint32Array?O[0]:new x.constructor(O[0]),O},simplifyPrune:function(x,T,E,v){o(x instanceof Uint32Array||x instanceof Int32Array||x instanceof Uint16Array||x instanceof Int16Array),o(x.length%3==0),o(T instanceof Float32Array),o(T.length%E==0),o(E>=3),o(v>=0);var S=x.BYTES_PER_ELEMENT==4?x:new Uint32Array(x),I=A(n.exports.meshopt_simplifyPrune,S,x.length,T,T.length/E,E*4,v);return I=x instanceof Uint32Array?I:new x.constructor(I),I}}})();var Ljn=(function(){var e="b9H79Tebbbe:neP9Geueu9Geub9Gbb9Giuuueu9Gmuuuuuuuuuuu9999eu9Gouuuuuueu9Gruuuuuuub9Gxuuuuuuuuuuuueu9Gxuuuuuuuuuuu99eu9GPuuuuuuuuuuuuu99b9Gouuuuuub9Gwuuuuuuuub9Gvuuuuub9GluuuubiQXdilvorwDqokoqxmbiibeilve9Weiiviebeoweuecj:Gdkr;Zeqo9TW9T9VV95dbH9F9F939H79T9F9J9H229F9Jt9VV7bb8A9TW79O9V9Wt9F9I919P29K9nW79O2Wt79c9V919U9KbeY9TW79O9V9Wt9F9I919P29K9nW79O2Wt7S2W94bd39TW79O9V9Wt9F9I919P29K9nW79O2Wt79t9W9Ht9P9H2bo39TW79O9V9Wt9F9J9V9T9W91tWJ2917tWV9c9V919U9K7bw39TW79O9V9Wt9F9J9V9T9W91tW9nW79O2Wt9c9V919U9K7bkE9TW79O9V9Wt9F9J9V9T9W91tW9t9W9OWVW9c9V919U9K7bxL9TW79O9V9Wt9F9V9Wt9P9T9P96W9nW79O2WtbPl79IV9RbsDwebcekdOAq;W:leXdbkIbabaec9:fgefcufae9Ugeabci9Uadfcufad9Ugbaeab0Ek:88JDPue99eux99due99euo99iu8Jjjjjbc:WD9Rgm8KjjjjbdndnalmbcbhPxekamc:Cwfcbc;Kbz:rjjjb8AcuaocdtgsaocFFFFi0Ehzcbyd;0:G:cjbhHdndnalcb9imbaoal9nmbamazaHHjjjjbbgHBd:CwamceBd;8wamazcbyd;0:G:cjbHjjjjbbgOBd:GwamcdBd;8wamcualcdtalcFFFFi0Ecbyd;0:G:cjbHjjjjbbgABd:KwamciBd;8waihzalhsinaHazydbcdtfcbBdbazclfhzascufgsmbkaihzalhsinaHazydbcdtfgCaCydbcefBdbazclfhzascufgsmbkaihzalhCcbhXindnaHazydbcdtgQfgsydbcb9imbaOaQfaXBdbasasydbgQcjjjj94VBdbaQaXfhXkazclfhzaCcufgCmbkalci9UhLdnalci6mbcbhzaihsinascwfydbhCasclfydbhXaOasydbcdtfgQaQydbgQcefBdbaAaQcdtfazBdbaOaXcdtfgXaXydbgXcefBdbaAaXcdtfazBdbaOaCcdtfgCaCydbgCcefBdbaAaCcdtfazBdbascxfhsaLazcefgz9hmbkkaihzalhsindnaHazydbcdtgCfgXydbgQcu9kmbaXaQcFFFFrGgQBdbaOaCfgCaCydbaQ9RBdbkazclfhzascufgsmbxdkkamazaHHjjjjbbgHBd:CwamceBd;8wamazcbyd;0:G:cjbHjjjjbbgOBd:GwamcdBd;8wamcualcdtalcFFFFi0Ecbyd;0:G:cjbHjjjjbbgABd:KwamciBd;8waHcbasz:rjjjbhXaihzalhsinaXazydbcdtfgCaCydbcefBdbazclfhzascufgsmbkalci9UhLdnaoTmbcbhzaOhsaXhCaohQinasazBdbasclfhsaCydbazfhzaCclfhCaQcufgQmbkkdnalci6mbcbhzaihsinascwfydbhCasclfydbhQaOasydbcdtfgKaKydbgKcefBdbaAaKcdtfazBdbaOaQcdtfgQaQydbgQcefBdbaAaQcdtfazBdbaOaCcdtfgCaCydbgCcefBdbaAaCcdtfazBdbascxfhsaLazcefgz9hmbkkaoTmbcbhzaohsinaOazfgCaCydbaXazfydb9RBdbazclfhzascufgsmbkkamaLcbyd;0:G:cjbHjjjjbbgzBd:OwamclBd;8wazcbaLz:rjjjbhYamcuaLcK2alcjjjjd0Ecbyd;0:G:cjbHjjjjbbg8ABd:SwamcvBd;8wJbbbbhEdnalci6g3mbarcd4hKaihsa8AhzaLhrJbbbbh5inavasclfydbaK2cdtfgCIdlh8EavasydbaK2cdtfgXIdlhEavascwfydbaK2cdtfgQIdlh8FaCIdwhaaXIdwhhaQIdwhgazaCIdbg8JaXIdbg8KMaQIdbg8LMJbbnn:vUdbazclfaXIdlaCIdlMaQIdlMJbbnn:vUdbaQIdwh8MaCIdwh8NaXIdwhyazcxfa8EaE:tg8Eagah:tggNaaah:tgaa8FaE:tghN:tgEJbbbbJbbjZa8Ja8K:tg8FahNa8Ea8La8K:tg8KN:tghahNaEaENaaa8KNa8FagN:tgEaENMMg8K:rg8E:va8KJbbbb9BEg8KNUdbazczfaEa8KNUdbazcCfaha8KNUdbazcwfa8Maya8NMMJbbnn:vUdba5a8EMh5ascxfhsazcKfhzarcufgrmbka5aL:Z:vJbbbZNhEkamcuaLcdtalcFFFF970Ecbyd;0:G:cjbHjjjjbbgCBd:WwamcoBd;8waq:Zhhdna3mbcbhzaChsinasazBdbasclfhsaLazcefgz9hmbkkaEahNhhamcuaLcltalcFFFFd0Ecbyd;0:G:cjbHjjjjbbg8PBd:0wamcrBd;8wcba8Pa8AaCaLcbz:djjjb8AJFFuuh8MJFFuuh8NJFFuuhydnalci6mbJFFuuhya8AhzaLhsJFFuuh8NJFFuuh8MinazcwfIdbgEa8Ma8MaE9EEh8MazclfIdbgEa8Na8NaE9EEh8NazIdbgEayayaE9EEhyazcKfhzascufgsmbkkah:rhEamaocetgzcuaocu9kEcbyd;0:G:cjbHjjjjbbgCBd:4wdndnaoal9nmbaihzalhsinaCazydbcetfcFFi87ebazclfhzascufgsmbxdkkaCcFeazz:rjjjb8AkaEJbbbZNh8JcuhIdnalci6mbcbhsJFFuuhEa8AhzcuhIinazcwfIdba8M:tghahNazIdbay:tghahNazclfIdba8N:tghahNMM:rghaEaIcuSahaE9DVgXEhEasaIaXEhIazcKfhzaLascefgs9hmbkkamczfcbcjwz:rjjjb8Aam9cb83iwam9cb83ibaxa8JNh8RJbbjZak:th8Lcbh8SJbbbbhRJbbbbh8UJbbbbh8VJbbbbh8WJbbbbh8XJbbbbh8Ycbh8ZcbhPinJbbbbhEdna8STmbJbbjZa8S:Z:vhEkJbbbbhhdna8Ya8YNa8Wa8WNa8Xa8XNMMg8KJbbbb9BmbJbbjZa8K:r:vhhka8VaENh8Ka8UaENh5aRaENh8EaIhLdndndndndna8SaPVTmbamydwg80Tmea8YahNh8Fa8XahNhaa8WahNhgaeamydbcdtfh81cbh3JFFuuhEcvhQcuhLindnaHa81a3cdtfydbcdtgzfydbgvTmbaAaOazfydbcdtfhsindndnaCaiasydbgKcx2fgzclfydbgrcetf8Vebcs4aCazydbgXcetf8Vebcs4faCazcwfydbglcetf8Vebcs4fgombcbhzxekcehzaHaXcdtfydbgXceSmbcehzaHarcdtfydbgrceSmbcehzaHalcdtfydbglceSmbdnarcdSaXcdSfalcdSfcd6mbaocefhzxekaocdfhzkdnazaQ9kmba8AaKcK2fgXIdwa8K:tghahNaXIdba8E:tghahNaXIdla5:tghahNMM:ra8J:va8LNJbbjZMJ9VO:d86JbbjZaXIdCa8FNaXIdxagNaaaXIdzNMMakN:tghahJ9VO:d869DENghaEazaQ6ahaE9DVgXEhEaKaLaXEhLazaQaXEhQkasclfhsavcufgvmbkka3cefg3a809hmbkkaLcu9hmekama8KUd:ODama5Ud:KDama8EUd:GDamcuBd:qDamcFFF;7rBdjDa8Pcba8AaYamc:GDfamc:qDfamcjDfz:ejjjbamyd:qDhLdndnaxJbbbb9ETmba8SaD6mbaLcuSmeceh3amIdjDa8R9EmixdkaLcu9hmekdna8STmbabaPcltfgHam8Piw83dwaHam8Pib83dbaPcefhPkc3hHinamc:CwfaHfydbcbyd;4:G:cjbH:bjjjbbaHc98fgHc989hmbxvkkcbh3a8Saq9pmbamydwaCaiaLcx2fgzydbcetf8Vebcs4aCazcwfydbcetf8Vebcs4faCazclfydbcetf8Vebcs4ffaw9nmekcbhzcbhsdna8ZTmbcbhsamczfhXinamczfascdtfaXydbgQBdbaXclfhXasaYaQfRbbTfhsa8Zcufg8ZmbkkamydwhlamydbhXam9cu83i:GDam9cu83i:ODam9cu83i:qDam9cu83i:yDinamcjDfazfcFFF;7rBdbazclfgzcz9hmbkasc;8easclfc:bd6Eg8Zcdth80dnalTmbaeaXcdtfhocbhrindnaHaoarcdtfydbcdtgzfydbgvTmbaAaOazfydbcdtfhscuhQcuhzinaHaiasydbgKcx2fgXclfydbcdtfydbaHaXydbcdtfydbfaHaXcwfydbcdtfydbfgXazaXaz6gXEhzaKaQaXEhQasclfhsavcufgvmbkaQcuSmba8AaQcK2fgsIdwa8M:tgEaENasIdbay:tgEaENasIdla8N:tgEaENMM:rhEcbhsindndnazamc:qDfasfgvydbgX6mbazaX9hmeaEamcjDfasfIdb9FTmekavazBdbamc:GDfasfaQBdbamcjDfasfaEUdbxdkasclfgscz9hmbkkarcefgral9hmbkkamczfa80fhQcbhzcbhsindnamc:GDfazfydbgXcuSmbaQascdtfaXBdbascefhskazclfgzcz9hmbkasa8Zfg8ZTmbJFFuuhhcuhKamczfhza8ZhvcuhQina8AazydbgXcK2fgsIdwa8M:tgEaENasIdbay:tgEaENasIdla8N:tgEaENMM:rhEdndnaHaiaXcx2fgsclfydbcdtfydbaHasydbcdtfydbfaHascwfydbcdtfydbfgsaQ6mbasaQ9hmeaEah9DTmekaEhhashQaXhKkazclfhzavcufgvmbkaKcuSmbaKhLkdnamaiaLcx2fgrydbarclfydbarcwfydbaCabaeadaPawaqa3z:fjjjbTmbaPcefhPJbbbbhRJbbbbh8UJbbbbh8VJbbbbh8WJbbbbh8XJbbbbh8YkcbhXinaAaOaraXcdtfydbcdtgsfydbcdtfgKhzaHasfgvydbgQhsdnaQTmbdninazydbaLSmeazclfhzascufgsTmdxbkkazaKaQcdtfc98fydbBdbavavydbcufBdbkaXcefgXci9hmbka8AaLcK2fgzIdbhEazIdlhhazIdwh8KazIdxh5azIdzh8EazIdCh8FaYaLfce86bba8Ya8FMh8Ya8Xa8EMh8Xa8Wa5Mh8Wa8Va8KMh8Va8UahMh8UaRaEMhRamydxh8Sxbkkamc:WDf8KjjjjbaPkjoivuv99lu8Jjjjjbca9Rgo8Kjjjjbdndnalcw0mbaiydbhraeabcitfgwalcdtciVBdlawarBdbdnalcd6mbaiclfhralcufhDawcxfhwinarydbhqawcuBdbawc98faqBdbawcwfhwarclfhraDcufgDmbkkalabfhwxekcbhqaocbBdKao9cb83izaocbBdwao9cb83ibJbbjZhkJbbjZhxinadaiaqcdtfydbcK2fhDcbhwinaoczfawfgraDawfIdbgmarIdbgP:tgsaxNaPMgPUdbaoawfgrasamaP:tNarIdbMUdbawclfgwcx9hmbkJbbjZakJbbjZMgk:vhxaqcefgqal9hmbkcbhradcbcecdaoIdlgmaoIdwgP9GEgwaoIdbgsaP9GEawasam9GEgzcdtgwfhHaoczfawfIdbhmaihwalhDinaiarcdtfgqydbhOaqawydbgABdbawaOBdbawclfhwaraHaAcK2fIdbam9DfhraDcufgDmbkdndnarcv6mbavc8X9kmbaralc98f6mekaiydbhraeabcitfgwalcdtciVBdlawarBdbaiclfhralcufhDawcxfhwinarydbhqawcuBdbawc98faqBdbawcwfhwarclfhraDcufgDmbkalabfhwxekaeabcitfgwamUdbawawydlc98GazVBdlabcefaeadaiaravcefgqz:djjjbhDawawydlciGaDabcu7fcdtVBdlaDaeadaiarcdtfalar9Raqz:djjjbhwkaocaf8Kjjjjbawk;Oddvue99dninabaecitfgrydlgwcd4gDTmednawciGgqci9hmbcihqdnawcl6mbabaecitfhbcbheawhqcehkindnaiabydbgDfRbbmbcbhkadaDcK2fgwIdwalIdw:tgxaxNawIdbalIdb:tgxaxNawIdlalIdl:tgxaxNMM:rgxaoIdb9DTmbaoaxUdbavaDBdbarydlhqkabcwfhbaecefgeaqcd46mbkakceGTmikaraqciGBdlskdnabcbaDalaqcdtfIdbarIdb:tgxJbbbb9FEgwaD7aecefgDfgecitfydlabawaDfgDcitfydlVci0mbaraqBdlkabaDadaialavaoz:ejjjbax:laoIdb9Fmbkkkjlevudndnabydwgxaladcetfgm8Vebcs4alaecetfgP8Vebgscs4falaicetfgz8Vebcs4ffaD0mbakmbcbhDabydxaq6mekavawcltfgxab8Pdw83dwaxab8Pdb83dbabydbhDdnabydwgwTmbaoaDcdtfhxawhsinalaxydbcetfcFFi87ebaxclfhxascufgsmbkkabaDawfBdbabydxhxab9cb83dwababydlaxci2fBdlaP8VebhscehDcbhxkdnascztcz91cu9kmbabaxcefBdwaPax87ebaoabydbcdtfaxcdtfaeBdbkdnam8Uebcu9kmbababydwgxcefBdwamax87ebaoabydbcdtfaxcdtfadBdbkdnaz8Uebcu9kmbababydwgxcefBdwazax87ebaoabydbcdtfaxcdtfaiBdbkarabydlfabydxci2faPRbb86bbarabydlfabydxci2fcefamRbb86bbarabydlfabydxci2fcdfazRbb86bbababydxcefBdxaDk:mPrHue99eue99eue99iu8Jjjjjbc;W;Gb9Rgx8KjjjjbdndnalmbcbhmxekcbhPaxc:m;Gbfcbc;Kbz:rjjjb8Aaxcualci9UgscltascjjjjiGEcbyd;0:G:cjbHjjjjbbgzBd:m9GaxceBd;S9GaxcuascK2gHcKfalcpFFFe0Ecbyd;0:G:cjbHjjjjbbgOBd:q9GaxcdBd;S9Gdnalci6gAmbarcd4hCascdthXaOhQazhLinavaiaPcx2fgrydwaC2cdtfhKavarydlaC2cdtfhYavarydbaC2cdtfh8AcbhraLhEinaQarfgma8Aarfg3Idbg5aYarfg8EIdbg8Fa5a8F9DEg5UdbamaKarfgaIdbg8Fa5a8Fa59DEg8FUdbamcxfgma3Idbg5a8EIdbgha5ah9EEg5UdbamaaIdbgha5aha59EEg5UdbaEa8Fa5MJbbbZNUdbaEaXfhEarclfgrcx9hmbkaQcKfhQaLclfhLaPcefgPas9hmbkkaOaHfgr9cb83dbar9cb83dzar9cb83dwaxcuascx2gralc:bjjjl0Ecbyd;0:G:cjbHjjjjbbgHBdN9GaxciBd;S9GascdthgazarfhvaxcwVhPaxclVhCaHh8Jazh8KcbhLinaxcbcj;Gbz:rjjjbhEaLas2cdthadnaAmba8Khrash3inaEarydbgmc8F91cjjjj94Vam7gmcQ4cx2fg8Ea8EydwcefBdwaEamcd4cFrGcx2fg8Ea8EydbcefBdbaEamcx4cFrGcx2fgmamydlcefBdlarclfhra3cufg3mbkkazaafh8AaHaafhXcbhmcbh3cbh8EcbhainaEamfgrydbhQara3BdbarcwfgKydbhYaKaaBdbarclfgrydbhKara8EBdbaQa3fh3aYaafhaaKa8Efh8Eamcxfgmcj;Gb9hmbkdnaAmbcbhravhminamarBdbamclfhmasarcefgr9hmbkavhrashminaEa8Aarydbg3cdtfydbg8Ec8F91a8E7cd4cFrGcx2fg8Ea8Eydbg8EcefBdbaXa8Ecdtfa3Bdbarclfhramcufgmmbka8JhrashminaCa8Aarydbg3cdtfydbg8Ec8F91a8E7cx4cFrGcx2fg8Ea8Eydbg8EcefBdbava8Ecdtfa3BdbarclfhramcufgmmbkavhrashminaPa8Aarydbg3cdtfydbg8Ec8F91cjjjj94Va8E7cQ4cx2fg8Ea8Eydbg8EcefBdbaXa8Ecdtfa3Bdbarclfhramcufgmmbkka8Jagfh8Ja8Kagfh8KaLcefgLci9hmbkaEaocetgrcuaocu9kEcbyd;0:G:cjbHjjjjbbgKBd:y9GaEclBd;S9Gdndnaoal9nmbaihralhminaKarydbcetfcFFi87ebarclfhramcufgmmbxdkkaKcFearz:rjjjb8Akcbh8EaEascbyd;0:G:cjbHjjjjbbg8ABd:C9GaOaHaHascdtfaHascitfa8AascbazaKaiawaDaqakz:hjjjbdndnalci6mba8Ahrashmina8EarRbbfh8EarcefhramcufgmmbkaE9cb83iwaE9cb83ibalawc9:fgrfcufar9UgrasaDfcufaD9Ugmaram0EhYcbhmcbhra8Ehaincbh3dnarTmba8AarfRbbceSh3kamaEaiaHydbcx2fgQydbaQclfydbaQcwfydbaKabaeadamawaqa3a3ce7a8EaY9nVaaamfaY6VGz:fjjjbfhmaHclfhHaaa8AarfRbb9Rhaasarcefgr9hmbkaEydxTmeabamcltfgraE8Piw83dwaraE8Pib83dbamcefhmxekaE9cb83iwaE9cb83ibcbhmkczhrinaEc:m;Gbfarfydbcbyd;4:G:cjbH:bjjjbbarc98fgrc989hmbkkaxc;W;Gbf8Kjjjjbamk:wKDQue99iue99iul9:euw99iu8Jjjjjbc;qb9RgP8Kjjjjbaxhsaxhzdndnavax0gHmbdnavTmbcbhOaehzavhAinawaDazydbcx2fgCcwfydbcetfgX8VebhQawaCclfydbcetfgL8VebhKawaCydbcetfgC8VebhYaXce87ebaLce87ebaCce87ebaOaKcs4aYcs4faQcs4ffhOazclfhzaAcufgAmbkaehzavhAinawaDazydbcx2fgCcwfydbcetfcFFi87ebawaCclfydbcetfcFFi87ebawaCydbcetfcFFi87ebazclfhzaAcufgAmbkcehzaqhsaOaq0mekalce86bbalcefcbavcufz:rjjjb8AxekaPaiBdxaPadBdwaPaeBdlavakaqci9Ug8Aaka8Aak6EaHEgK9RhEaxaK9Rh3aKcufh5aKceth8EaKcdtgCc98fh8FavcitgOaC9Rarfc98fhaascufhhavcufhgaraOfh8JJbbjZas:Y:vh8KcbazceakaxSEg8Lcdtg8M9Rh8NJFFuuhycuh8PcbhIcbh8RinaPclfa8RcdtfydbhQaPcb8Pd:y:G:cjbg8S83i9iaPcb8Pd:q:G:cjbgR83inaPcb8Pd1:G:cjbg8U83iUaPcb8Pdj:G:cjbg8V83i8WaPa8S83iyaPaR83iaaPa8U83iKaPa8V83izaQavcdtgYfh8WcbhXinabaQaXcdtgLfydbcK2fhAcbhzinaPc8WfazfgCaAazfgOIdbg8XaCIdbg8Ya8Xa8Y9DEUdbaCczfgCaOcxfIdbg8XaCIdbg8Ya8Xa8Y9EEUdbazclfgzcx9hmbkaba8WaXcu7cdtfydbcK2fhAcbhzaPIdUh8ZaPId9ih80aPId80h81aPId9ehBaPId8Wh83aPIdnhUinaPczfazfgCaAazfgOIdbg8XaCIdbg8Ya8Xa8Y9DEUdbaCczfgCaOcxfIdbg8XaCIdbg8Ya8Xa8Y9EEUdbazclfgzcx9hmbkaraLfgza80a8Z:tg8XaUa83:tg8YNa8YaBa81:tg8ZNa8Za8XNMMUdbazaYfaPIdyaPIdK:tg8XaPIdaaPIdz:tg8YNa8YaPId8KaPIdC:tg8ZNa8Za8XNMMUdbaXcefgXav9hmbkcbh85dnaHmbcbhAaQhza8JhCavhXinawaDazydbcx2fgOcwfydbcetfgL8Vebh8WawaOclfydbcetfg858Vebh86awaOydbcetfgO8Vebh87aLce87eba85ce87ebaOce87ebaCaAa86cs4a87cs4fa8Wcs4ffgABdbazclfhzaCclfhCaXcufgXmbkavhCinawaDaQydbcx2fgzcwfydbcetfcFFi87ebawazclfydbcetfcFFi87ebawazydbcetfcFFi87ebaQclfhQaCcufgCmbka8Jh85kdndndndndndndndndndndnava8E6mba8Eax9nmeavavaK9UgzaK29Raza320mda5aE9pmqa85Th87ceh8WaEhQxwka5ag9pmDa8Eax9nmixokavaK6mea5aE9pmwcehQaEhXa85Tmixlka5ag6mlxrka5ag9pmokcbhQaghXa85mekJFFuuh8XcbhLa5hzindnazcefgCaK6mbaQavaC9RgOaK6GmbarazcdtfIdbg8YaC:YNaravaz9RcdtfaYfc94fIdbg8ZaO:YNMg80a8X9Embdndna8KaOahf:YNg81:lJbbb9p9DTmba81:OhAxekcjjjj94hAka8ZasaA2aO9R:YNh8Zdndna8Kazasf:YNg81:lJbbb9p9DTmba81:OhOxekcjjjj94hOkamasaO2aC9R:Ya8YNa8ZMNa80Mg8Ya8Xa8Ya8X9DgOEh8XaCaLaOEhLkaza8LfgzaX6mbxlkkJFFuuh8XcbhLaEhCaahAa8FhOaKhzindnazaK6mbaQaCaK6GmbaraOfIdbg8Yaz:YNaAIdbg8ZaC:YNMg80a8X9Embdndna8Ka85aOfydbgYahf:YNg81:lJbbb9p9DTmba81:Oh8Wxekcjjjj94h8Wkamasa8W2aY9R:Yg81a8YNa8Za81NMNa80Mg8Ya8Xa8Ya8X9DgYEh8XazaLaYEhLkaCa8L9RhCaAa8NfhAaOa8MfhOaza8LfgzcufaX6mbxikka85Th87cbh8WaghQkJFFuuh8XcbhLaEhCaahAa8FhOaKhzindnazazaK9UgXaK29RaXa320mbdna8WTmbaCaCaK9UgXaK29RaXa320mekaraOfIdbg8Yaz:YNaAIdbg8ZaC:YNMg80a8X9EmbazhXaChYdna87mba85aOfydbgXhYkdndna8KaYahf:YNg81:lJbbb9p9DTmba81:Oh86xekcjjjj94h86ka8Zasa862aY9R:YNh8Zdndna8KaXahf:YNg81:lJbbb9p9DTmba81:OhYxekcjjjj94hYkamasaY2aX9R:Ya8YNa8ZMNa80Mg8Ya8Xa8Ya8X9DgXEh8XazaLaXEhLkaCa8L9RhCaAa8NfhAaOa8MfhOaza8LfgzcufaQ6mbkkaLTmba8Xay9DTmba8XhyaLhIa8Rh8Pka8Rcefg8Rci9hmbkdndnaoc8X9kmba8Pcb9omeka8Acufh85cbhYindndndnavaY9RaxaYaxfav0Eg8WTmbcbhAaeaYcdtfgzhCa8WhXinawaDaCydbcx2fgOcwfydbcetfgQ8VebhbawaOclfydbcetfgL8VebhrawaOydbcetfgO8VebhKaQce87ebaLce87ebaOce87ebaAarcs4aKcs4fabcs4ffhAaCclfhCaXcufgXmbka8WhOinawaDazydbcx2fgCcwfydbcetfcFFi87ebawaCclfydbcetfcFFi87ebawaCydbcetfcFFi87ebazclfhzaOcufgOmbkaAaq0mekalaYfgzce86bbazcefcba8Wcufz:rjjjb8AxekalaYfgzce86bbazcefcba85z:rjjjb8Aa8Ah8Wka8WaYfgYav9pmdxbkkaravcdtg8WfhLdnaITmbaPclfa8PcdtfydbhzaIhCinaLazydbfcb86bbazclfhzaCcufgCmbkkdnavaI9nmbaPclfa8PcdtfydbaIcdtfhzavaI9RhCinaLazydbfce86bbazclfhzaCcufgCmbkkcbhYindnaYa8PSmbcbhzaraPclfaYcdtfydbgKa8Wz:qjjjbhCavhXaIhOinaKaOazaLaCydbgQfRbbgAEcdtfaQBdbaCclfhCaOaAfhOazaA9RcefhzaXcufgXmbkkaYcefgYci9hmbkabaeadaialaIaocefgCarawaDaqakaxamz:hjjjbabaeaIcdtgzfadazfaiazfalaIfavaI9RaCarawaDaqakaxamz:hjjjbkaPc;qbf8Kjjjjbk:Seeru8Jjjjjbc:q;ab9Rgo8Kjjjjbaoc:q8WfcFecjzz:rjjjb8AcbhrdnadTmbaehwadhDinaoarcdtfawydbgqBdbaoc:q8WfaqcFiGcdtfgkydbhxakaqBdbawclfhwaraxaq9hfhraDcufgDmbkkabaeadaoaraiavz:jjjjbaoc:q;abf8Kjjjjbk;Sqloud99euD998Jjjjjbc:W;ab9Rgr8KjjjjbdndnadTmbaocd4hwcbhDcbhqindnavaeclfydbaw2cdtfgkIdbavaeydbaw2cdtfgxIdbgm:tgPavaecwfydbaw2cdtfgsIdlaxIdlgz:tgHNakIdlaz:tgOasIdbam:tgAN:tgCaCNaOasIdwaxIdwgX:tgQNakIdwaX:tgOaHN:tgHaHNaOaANaPaQN:tgPaPNMMgOJbbbb9Bmbarc8WfaDcltfgkaCaO:rgO:vgCUdwakaPaO:vgPUdlakaHaO:vgHUdbakaCaXNaHamNazaPNMM:mUdxaDcefhDkaecxfheaqcifgqad6mbkab9cb83dyab9cb83daab9cb83dKab9cb83dzab9cb83dwab9cb83dbaDTmearcbBd8Sar9cb83iKar9cb83izarczfavalaoarc8Sfcbcraiz:kjjjbarIdKhQarIdChLarIdzhKar9cb83iwar9cb83ibararc8WfaDczarc8Sfcbcicbz:kjjjbJbbbbhmdnarIdwgzazNarIdbgHaHNarIdlgXaXNMMgCJbbbb9BmbJbbjZaC:r:vhmkazamNhCaXamNhXaHamNhHJbbjZhmarc8WfheaDhvinaecwfIdbaCNaeIdbaHNaXaeclfIdbNMMgzamazam9DEhmaeczfheavcufgvmbkabaQUdwabaLUdlabaKUdbabarId3UdxdndnamJ;n;m;m899FmbJbbbbhzarc8WfheinaecxfIdbaQaecwfIdbgPNaKaeIdbgONaLaeclfIdbgANMMMaCaPNaHaONaXaANMM:vgPazaPaz9EEhzaeczfheaDcufgDmbkabaCUd8KabaXUdaabaHUd3abaQaCazN:tUdKabaLaXazN:tUdCabaKaHazN:tUdzabJbbjZamamN:t:rgmUdydndnaCJbbj:;aCJbbj:;9GEgzJbbjZazJbbjZ9FEJbb;:9cNJbbbZJbbb:;aCJbbbb9GEMgz:lJbbb9p9DTmbaz:Ohexekcjjjj94hekabae86b8UdndnaXJbbj:;aXJbbj:;9GEgzJbbjZazJbbjZ9FEJbb;:9cNJbbbZJbbb:;aXJbbbb9GEMgz:lJbbb9p9DTmbaz:Ohvxekcjjjj94hvkabav86bRdndnaHJbbj:;aHJbbj:;9GEgzJbbjZazJbbjZ9FEJbb;:9cNJbbbZJbbb:;aHJbbbb9GEMgz:lJbbb9p9DTmbaz:Ohwxekcjjjj94hwkabaw86b8SdndnaecKtcK91:YJbb;:9c:vaC:t:lavcKtcK91:YJbb;:9c:vaX:t:lawcKtcK91:YJbb;:9c:vaH:t:lamMMMJbb;:9cNJbbjZMgm:lJbbb9p9DTmbam:Ohexekcjjjj94hekaecFbaecFb9iEhexekabcjjj;8iBdycFbhekabae86b8Vxekab9cb83dyab9cb83daab9cb83dKab9cb83dzab9cb83dwab9cb83dbkarc:W;abf8Kjjjjbk;7woDuo99eue99euv998Jjjjjbcje9Rgw8Kjjjjbawc;abfcbaocdtgDz:rjjjb8Aawc;GbfcbaDz:rjjjb8AawcafhDawhqaohkinaqcFFF97BdbaDcFFF;7rBdbaqclfhqaDclfhDakcufgkmbkavcd4hxaicd4hmdnadTmbaocx2hPcbhsinashzdnarTmbarascdtfydbhzkaeazam2cdtfgDIdwhHaDIdlhOaDIdbhAalazax2cdtfIdbhCcbhDawcafhqawc;Gbfhvawhkawc;abfhiinaCaDc:O:G:cjbfIdbaHNaDc:G:G:cjbfIdbaANaDc:K:G:cjbfIdbaONMMgXMhQazhLdnaXaC:tgXaqIdbgK9DgYmbavydbhLkavaLBdbazhLdnaQakIdbg8A9EmbaiydbhLa8AhQkaiaLBdbakaQUdbaqaXaKaYEUdbaiclfhiakclfhkavclfhvaqclfhqaPaDcxfgD9hmbkascefgsad9hmbkkJbbbbhQcbhLawc;GbfhDawc;abfhqcbhkinalaqydbgvax2cdtfIdbalaDydbgiax2cdtfIdbaeavam2cdtfgvIdwaeaiam2cdtfgiIdw:tgCaCNavIdbaiIdb:tgCaCNavIdlaiIdl:tgCaCNMM:rMMgCaQaCaQ9EgvEhQakaLavEhLaqclfhqaDclfhDaoakcefgk9hmbkJbbbbhCdnaeawc;abfaLcdtgqfydbgkam2cdtfgDIdwaeawc;Gbfaqfydbgvam2cdtfgqIdwgH:tgXaXNaDIdbaqIdbgA:tg8Aa8ANaDIdlaqIdlgE:tgOaONMMgKJbbbb9ETmbaK:rgCalakax2cdtfIdbMalavax2cdtfIdb:taCaCM:vhCkaQJbbbZNhKaXaCNaHMhHaOaCNaEMhOa8AaCNaAMhAdnadTmbcbhqarhkinaqhDdnarTmbakydbhDkdnalaDax2cdtfIdbg3aeaDam2cdtfgDIdwaH:tgQaQNaDIdbaA:tgCaCNaDIdlaO:tgXaXNMMg5:rgEMg8EaK9ETmbJbbbbh8Adna5Jbbbb9ETmba8EaK:taEaEM:vh8Aka8AaQNaHMhHa8AaXNaOMhOa8AaCNaAMhAa3aKaEMMJbbbZNhKkakclfhkadaqcefgq9hmbkkabaKUdxabaHUdwabaOUdlabaAUdbawcjef8Kjjjjbk:reevu8Jjjjjbcj8W9Rgr8Kjjjjbaici2hwcbhDdnaiTmbarhiawhqinaiaeadRbbgkcdtfydbBdbaDakcefgkaDak0EhDaiclfhiadcefhdaqcufgqmbkkabarawaeaDalaoz:jjjjbarcj8Wf8Kjjjjbk:Eeeeu8Jjjjjbca9Rgo8Kjjjjbab9cb83dyab9cb83daab9cb83dKab9cb83dzab9cb83dwab9cb83dbdnadTmbaocbBd3ao9cb83iwao9cb83ibaoaeadaialaoc3falEavcbalEcrcbz:kjjjbabao8Pib83dbabao8Piw83dwkaocaf8Kjjjjbk::meQu8Jjjjjbcjz9Rgv8KjjjjbcbhoavcjPfcbaez:rjjjb8Aavcjxfcbaez:rjjjb8AdnaiTmbadhoaihrinavcjxfaoRbbfgwawRbbcef86bbavcjxfaocefRbbfgwawRbbcef86bbavcjxfaocdfRbbfgwawRbbcef86bbaocifhoarcufgrmbkcbhDcjehoadhqcehkindndnalTmbcbhxcuhmaqhrakhwcuhPinawcufamaoavcjPfarcefRbbgsfRbb9RcFeGgzci6aoavcjPfarRbbgHfRbb9RcFeGgOci6faoavcjPfarcdfRbbgAfRbb9RcFeGgCci6fgXcOtaOcFr7azaCf9RcwtVavcjxfaAfRbbgzavcjxfaHfRbbgHavcjxfasfRbbgsaHas6Egsazas6EcFe7VgsaP9kgzEhmaXcd6gHaxcefgOal9iVce9hmdasaPazEhPaxaOaHEhxarcifhrawai6hsawcefhwasmbxdkkcuhmaqhrakhwcuhxinawcufamaoavcjPfarcefRbbfRbb9RcFeGci6aoavcjPfarRbbfRbb9RcFeGci6faoavcjPfarcdfRbbfRbb9RcFeGci6fgPax9kgsEhmaPce0meaPaxasEhxarcifhrawai6hPawcefhwaPmbkkadamci2fgrcdfRbbhwarcefRbbhxarRbbhPadaDci2fgrcifaramaD9Rci2zNjjjb8AaPavcjPffaocefgo86bbaPavcjxffgmamRbbcuf86bbaxavcjPffao86bbaxavcjxffgmamRbbcuf86bbarcdfaw86bbarcefax86bbaraP86bbawavcjPffao86bbawavcjxffgrarRbbcuf86bbaqcifhqakcefhkaDcefgDai9hmbkcbhzdnalcb9mmbcbhsavcjPfcbaez:rjjjb8Aadcvfhlinadasci2fgxcefgDRbbhoaxcdfgqRbbhrdndnavcjPfaxRbbgmfRbbmbavcjPfarfRbbhwdndndnavcjPfaofRbbTmbawcFeGTmexikawcFeGmdascefgAai9pmdasc980mdascifhQcbhLarcFeGhCamcFeGhXalhwcbhKcbhYinawcufRbbhPawRbbhOcehkdndnawc9:fRbbgHao9hmbaPcFeGamSmekdnaPcFeGao9hmbaOcFeGamSmekaHamSaOcFeGaoSGhkkceh8AaYceGhYdndnaHar9hmbaPcFeGaoSmekdnaPcFeGar9hmbaOcFeGaoSmekaHaoSaOcFeGarSGh8AkakaYVhYaLaHcFeGgHaXSaPcFeGgPaCSGaPaXSaOcFeGgPaCSGVaHaCSaPaXSGVVhLa8AaKceGVhKdnaAcefgPai9pmbawcifhwaAaQ6hHaPhAaHmekkaYTmeaKmekarhwaohPaohHarhOamhrxdkdnaYTaLVceGTmbaYaKTVaLVceGmekamhwarhParhHamhOaohrxekaohwamhPamhHaohOkavcjPfarfce86bbavcjPfawfce86bbaxaH86bbaqar86bbaDaO86bbavcjPfaPfce86bbalcifhlascefgsai9hmbkkavcFeaecetz:rjjjbhwaici2hrindnawadRbbgmcetfgx8Uebgocu9kmbaxaz87ebawcjlfazcdtfabamcdtfydbBdbazhoazcefhzkadao86bbadcefhdarcufgrmbkazcdthokabavcjlfaoz:qjjjb8Aavcjzf8KjjjjbkObabaiaeadcbz:njjjbk9teiucbcbyd;8:G:cjbgeabcifc98GfgbBd;8:G:cjbdndnabZbcztgd9nmbcuhiabad9RcFFifcz4nbcuSmekaehikaik;LeeeudndnaeabVciGTmbabhixekdndnadcz9pmbabhixekabhiinaiaeydbBdbaiclfaeclfydbBdbaicwfaecwfydbBdbaicxfaecxfydbBdbaeczfheaiczfhiadc9Wfgdcs0mbkkadcl6mbinaiaeydbBdbaeclfheaiclfhiadc98fgdci0mbkkdnadTmbinaiaeRbb86bbaicefhiaecefheadcufgdmbkkabk;aeedudndnabciGTmbabhixekaecFeGc:b:c:ew2hldndnadcz9pmbabhixekabhiinaialBdbaicxfalBdbaicwfalBdbaiclfalBdbaiczfhiadc9Wfgdcs0mbkkadcl6mbinaialBdbaiclfhiadc98fgdci0mbkkdnadTmbinaiae86bbaicefhiadcufgdmbkkabk9teiucbcbyd;8:G:cjbgeabcrfc94GfgbBd;8:G:cjbdndnabZbcztgd9nmbcuhiabad9RcFFifcz4nbcuSmekaehikaikTeeucbabcbyd;8:G:cjbge9Rcifc98GaefgbBd;8:G:cjbdnabZbcztge9nmbabae9RcFFifcz4nb8Akk:3qeludndnadch6mbadTmeabaead;8qbbabskabaeSmbdnaeadabfgi9Rcbadcet9R0mbadTmeabaead;8qbbabskaeab7ciGhldndndnabae9pmbdnalTmbadhvabhixikdnabciGmbadhvabhixdkadTmiabaeRbb86bbadcufhvdnabcefgiciGmbaecefhexdkavTmiabaeRbe86beadc9:fhvdnabcdfgiciGmbaecdfhexdkavTmiabaeRbd86bdadc99fhvdnabcifgiciGmbaecifhexdkavTmiabaeRbi86biabclfhiaeclfheadc98fhvxekdnalmbdnaiciGTmbadTmlabadcufgifglaeaifRbb86bbdnalciGmbaihdxekaiTmlabadc9:fgifglaeaifRbb86bbdnalciGmbaihdxekaiTmlabadc99fgifglaeaifRbb86bbdnalciGmbaihdxekaiTmlabadc98fgdfaeadfRbb86bbkadcl6mbdnadc98fgocxGcxSmbaocd4cefciGhiaec98fhlabc98fhvinavadfaladfydbBdbadc98fhdaicufgimbkkaocx6mbaec9Wfhvabc9WfhoinaoadfgicxfavadfglcxfydbBdbaicwfalcwfydbBdbaiclfalclfydbBdbaialydbBdbadc9Wfgdci0mbkkadTmdadhidnadciGglTmbaecufhvabcufhoadhiinaoaifavaifRbb86bbaicufhialcufglmbkkadcl6mdaec98fhlabc98fhvinavaifgecifalaifgdcifRbb86bbaecdfadcdfRbb86bbaecefadcefRbb86bbaeadRbb86bbaic98fgimbxikkavcl6mbdnavc98fglc3Gc3Smbavalcd4cefcrGgdcdt9RhvinaiaeydbBdbaeclfheaiclfhiadcufgdmbkkalc36mbinaiaeydbBdbaiclfaeclfydbBdbaicwfaecwfydbBdbaicxfaecxfydbBdbaiczfaeczfydbBdbaicCfaecCfydbBdbaicKfaecKfydbBdbaic3faec3fydbBdbaecafheaicafhiavc9Gfgvci0mbkkavTmbdndnavcrGgdmbavhlxekavc94GhlinaiaeRbb86bbaicefhiaecefheadcufgdmbkkavcw6mbinaiaeRbb86bbaicefaecefRbb86bbaicdfaecdfRbb86bbaicifaecifRbb86bbaiclfaeclfRbb86bbaicvfaecvfRbb86bbaicofaecofRbb86bbaicrfaecrfRbb86bbaicwfhiaecwfhealc94fglmbkkabkk:pedbcj:GdktFFuuFFuuFFuubbbbFFuFFFuFFFuFbbbbbbjZbbbbbbbbbbbbbbjZbbbbbbbbbbbbbbjZ86;nAZ86;nAZ86;nAZ86;nA:;86;nAZ86;nAZ86;nAZ86;nA:;86;nAZ86;nAZ86;nAZ86;nA:;bc;0:Gdkxebbbdbbbj:qbb",t=new Uint8Array([32,0,65,2,1,106,34,33,3,128,11,4,13,64,6,253,10,7,15,116,127,5,8,12,40,16,19,54,20,9,27,255,113,17,42,67,24,23,146,148,18,14,22,45,70,69,56,114,101,21,25,63,75,136,108,28,118,29,73,115]);if(typeof WebAssembly!="object")return{supported:!1};var n,i=WebAssembly.instantiate(r(e),{}).then(function(y){n=y.instance,n.exports.__wasm_call_ctors()});function r(y){for(var A=new Uint8Array(y.length),b=0;b<y.length;++b){var x=y.charCodeAt(b);A[b]=x>96?x-97:x>64?x-39:x+4}for(var T=0,b=0;b<y.length;++b)A[T++]=A[b]<60?t[A[b]]:(A[b]-60)*64+A[++b];return A.buffer.slice(0,T)}function o(y){if(!y)throw new Error("Assertion failed")}function s(y){return new Uint8Array(y.buffer,y.byteOffset,y.byteLength)}var a=48,c=16;function u(y,A){var b=y.meshlets[A*4+0],x=y.meshlets[A*4+1],T=y.meshlets[A*4+2],E=y.meshlets[A*4+3];return{vertices:y.vertices.subarray(b,b+T),triangles:y.triangles.subarray(x,x+E*3)}}function f(y,A,b,x,T,E,v,S,I,R){var O=n.exports.sbrk,L=n.exports.meshopt_buildMeshletsBound(A.length,E,v),_=O(L*c),C=O(A.length*4),w=O(A.length),P=O(A.byteLength),M=O(b.byteLength),F=new Uint8Array(n.exports.memory.buffer);F.set(s(A),P),F.set(s(b),M);var V=y(_,C,w,P,A.length,M,x,T,E,v,S,I,R);F=new Uint8Array(n.exports.memory.buffer);for(var B=F.subarray(_,_+V*c),j=new Uint32Array(B.buffer,B.byteOffset,B.byteLength/4).slice(),k=0;k<V;++k){var G=j[k*4+0],q=j[k*4+1],x=j[k*4+2],Q=j[k*4+3];n.exports.meshopt_optimizeMeshlet(C+G*4,w+q,Q,x)}var W=V?j[(V-1)*4+0]+j[(V-1)*4+2]:0,J=V?j[(V-1)*4+1]+j[(V-1)*4+3]*3:0,Z={meshlets:j,vertices:new Uint32Array(F.buffer,C,W).slice(),triangles:new Uint8Array(F.buffer,w,J).slice(),meshletCount:V};return O(_-O(0)),Z}function d(y){var A=new Float32Array(n.exports.memory.buffer,y,a/4);return{centerX:A[0],centerY:A[1],centerZ:A[2],radius:A[3],coneApexX:A[4],coneApexY:A[5],coneApexZ:A[6],coneAxisX:A[7],coneAxisY:A[8],coneAxisZ:A[9],coneCutoff:A[10]}}function p(y,A,b,x){var T=n.exports.sbrk,E=[],v=T(A.byteLength),S=T(y.vertices.byteLength),I=T(y.triangles.byteLength),R=T(a),O=new Uint8Array(n.exports.memory.buffer);O.set(s(A),v),O.set(s(y.vertices),S),O.set(s(y.triangles),I);for(var L=0;L<y.meshletCount;++L){var _=y.meshlets[L*4+0],C=y.meshlets[L*4+1],w=y.meshlets[L*4+3];n.exports.meshopt_computeMeshletBounds(R,S+_*4,I+C,w,v,b,x),E.push(d(R))}return T(v-T(0)),E}function g(y,A,b,x){var T=n.exports.sbrk,E=T(a),v=T(y.byteLength),S=T(A.byteLength),I=new Uint8Array(n.exports.memory.buffer);I.set(s(y),v),I.set(s(A),S),n.exports.meshopt_computeClusterBounds(E,v,y.length,S,b,x);var R=d(E);return T(E-T(0)),R}function m(y,A,b,x,T){var E=n.exports.sbrk,v=E(a),S=E(y.byteLength),I=x?E(x.byteLength):0,R=new Uint8Array(n.exports.memory.buffer);R.set(s(y),S),x&&R.set(s(x),I),n.exports.meshopt_computeSphereBounds(v,S,A,b,I,x?T:0);var O=d(v);return E(v-E(0)),O}return{ready:i,supported:!0,buildMeshlets:function(y,A,b,x,T,E){o(y.length%3==0),o(A instanceof Float32Array),o(A.length%b==0),o(b>=3),o(x>=3&&x<=256),o(T>=1&&T<=512),E=E||0;var v=y.BYTES_PER_ELEMENT==4?y:new Uint32Array(y);return f(n.exports.meshopt_buildMeshletsFlex,v,A,A.length/b,b*4,x,T,T,E,0)},buildMeshletsFlex:function(y,A,b,x,T,E,v,S){o(y.length%3==0),o(A instanceof Float32Array),o(A.length%b==0),o(b>=3),o(x>=3&&x<=256),o(T>=1&&E<=512),o(T<=E),v=v||0,S=S||0;var I=y.BYTES_PER_ELEMENT==4?y:new Uint32Array(y);return f(n.exports.meshopt_buildMeshletsFlex,I,A,A.length/b,b*4,x,T,E,v,S)},buildMeshletsSpatial:function(y,A,b,x,T,E,v){o(y.length%3==0),o(A instanceof Float32Array),o(A.length%b==0),o(b>=3),o(x>=3&&x<=256),o(T>=1&&E<=512),o(T<=E),v=v||0;var S=y.BYTES_PER_ELEMENT==4?y:new Uint32Array(y);return f(n.exports.meshopt_buildMeshletsSpatial,S,A,A.length/b,b*4,x,T,E,v)},extractMeshlet:function(y,A){return o(A>=0&&A<y.meshletCount),u(y,A)},computeClusterBounds:function(y,A,b){o(y.length%3==0),o(y.length/3<=512),o(A instanceof Float32Array),o(A.length%b==0),o(b>=3);var x=y.BYTES_PER_ELEMENT==4?y:new Uint32Array(y);return g(x,A,A.length/b,b*4)},computeMeshletBounds:function(y,A,b){return o(A instanceof Float32Array),o(A.length%b==0),o(b>=3),p(y,A,A.length/b,b*4)},computeSphereBounds:function(y,A,b,x){return o(y instanceof Float32Array),o(y.length%A==0),o(A>=3),o(!b||b instanceof Float32Array),o(!b||b.length%x==0),o(!b||x>=1),o(!b||y.length/A==b.length/x),x=x||0,m(y,y.length/A,A*4,b,x*4)}}})();var Bjn=(function(){var e="b9H79Tebbbegv9Geueu9Geub9Gbb9Gkuuuuuuuuuuub9Giuuueuirodiblbelve9Weiiviebeoweuecj:Gdkrnlo9TW9T9VV95dbH9F9F939H79T9F9J9H229F9Jt9VV7bbK9TW79O9V9Wt9F9NW9UWV9HtW9u9H9U9NW9Ut7bel79IV9RbdDwebcekdlvq;m8Lodbk:wgvOuw99iuv99vu8Jjjjjbc;Wb9Rgk8Kjjjjbakcxfcbc;Kbz:djjjb8AakcualcdtgxalcFFFFi0Ecbyd:q:G:cjbHjjjjbbgmBdxakceBd2adci9UhPalcd4alfhscehzinazgHcethzaHas6mbkakcuaHcdtgzaHcFFFFi0Ecbyd:q:G:cjbHjjjjbbgsBdzakcdBd2ascFeazz:djjjbhOaDcd4hAarcd4hCavcd4hXdnalTmbaHcufhrcbhvindndnaOcbaiavaX2cdtfgHydlgDaDcjjjj94SEgscH4cbaoavaC2cdtfgzydlgQcs4aQcjjjj94SE7as7c:F:b:DD2cbaHydbgLaLcjjjj94SEgscH4cbazydbgKcs4aKcjjjj94SE7as7c;D;O:B8J27cbaHydwgYaYcjjjj94SEgHcH4cbazydwg8Acs4a8Acjjjj94SE7aH7c:3F;N8N27awavaA2cdtfgHydlgEaHydbg37cFFFFrGgHcm4aH7c:fjjK27arGgscdtfgHydbgzcuSmbaE::h5a3::h8Ea8A::h8FaQ::haaK::hhaY::hgaD::h8JaL::h8KcehDinaDhHdnaiazaX2cdtfgDIdba8K9CmbaDIdla8J9CmbaDIdwag9CmbaoazaC2cdtfgDIdbah9CmbaDIdlaa9CmbaDIdwa8F9CmbawazaA2cdtfgDIdba8E9CmbaDIdla59BmikaHcefhDaOasaHfarGgscdtfgHydbgzcu9hmbkkaHavBdbavhzkamavcdtfazBdbavcefgval9hmbkkaOcbydN:G:cjbH:bjjjbbakceBd2akcualcefgHcdtaHcFFFFi0Ecbyd:q:G:cjbHjjjjbbg8LBdzakcdBd2akcuadcdtadcFFFFi0EgYcbyd:q:G:cjbHjjjjbbg8MBdCakciBd2a8Lclfcbaxz:djjjbhzdnadTmbdnaeTmbaehHadhsinazamaHydbcdtfydbcdtfgDaDydbcefBdbaHclfhHascufgsmbxdkkamhHadhsinazaHydbcdtfgDaDydbcefBdbaHclfhHascufgsmbkkdnalTmbcbhsazhHalhDinaHydbhOaHasBdbaHclfhHaOasfhsaDcufgDmbkkdnadci6gQmbcbhscdhHaPhOindndnaeTmbamaeasfgvydbcdtfhDamavcwfydbcdtfhramavclfydbcdtfhvxekamasfgDcwfhraDclfhvkarydbhravydbhvazaDydbcdtfgDaDydbgDcefBdba8MaDcdtfaHc9:fBdbazavcdtfgDaDydbgDcefBdba8MaDcdtfaHcufBdbazarcdtfgDaDydbgDcefBdba8MaDcdtfaHBdbascxfhsaHclfhHaOcufgOmbkkcbhsa8LcbBdbakcuaPcltadcFFFFd0Ecbyd:q:G:cjbHjjjjbbg8NBdKakclBd2dnaQmbaehza8NhHaPhvindndnaeTmbazcwfydbhDazclfydbhOazydbhrxekascdfhDascefh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fhsaAaHydj:G:cjbfhHdnaeTmbaeascdtfydbhsaeaHcdtfydbhHkdndnamaHcdtfydbaYSmbamascdtfydba39hmeka8AazfRbbgHaERbbgsVciSmbdnaHasGmba8Whsdna8Wa8XydbgHSmba8XhOinaOavaHgscdtfgrydbgHBdbarhOasaH9hmbkkdnazavazcdtfgOydbgHSmbinaOavaHgzcdtfgrydbgHBdbarhOazaH9hmbkkasazSmba8AazfgORbba8AasfgHRbbVciSmeavazcdtfasBdbaHaHRbbaORbbV86bbkdna8VydbciGaxfgzaDazcdtfgsydbgHSmbinasaDaHgzcdtfgOydbgHBdbaOhsazaH9hmbkkdnaQydbciGaAfgsaDascdtfgOydbgHSmbinaOaDaHgscdtfgrydbgHBdbarhOasaH9hmbkkazasSmbaDascdtfazBdbkawcefgwaL9hmbkka8UaL9hmbkkaRal9hmbkkdnadTmbcbhrinarhzdnaraDarcdtfgwydbgHSmbawhsinasaDaHgzcdtfgOydbgHBdbaOhsazaH9hmbkkawazBdbarcefgrad9hmbkcbh8Vabcbadcltz:djjjbhKdnadci6mbaqceGhEaDhYaeh3cbh8Windna8Na8WcltfgsIdxJbbbb9Bmbama8Wcx2gHfhxaeaHfhLcbhza8VhwinaKaYazfydbcltfhHdndnaeTmbamaLazc:e:G:cjbfydbcdtfydbcdtfhAamaLazcj:G:cjbfydbcdtfydbcdtfhra3azfydbhOxekaxazc:e:G:cjbfydbcdtfhAaxazcj:G:cjbfydbcdtfhrawhOkaHasIdbggaoamaOcdtfydbgQaC2cdtfgOIdbg8KasIdwg8FaOIdwg8JNaga8KNasIdlg8EaOIdlggNMMghN:tgaJbbbbJbbjZa8Fa8JahN:tg8Fa8FNaaaaNa8EagahN:tghahNMMga:r:vaaJbbbb9BEJ;As6nJbbjZaiarydbaX2cdtfgOIdwaiaQaX2cdtfgrIdwg5:tgaa8Jaaa8JNaOIdbarIdbgy:tg8Pa8KNagaOIdlarIdlgI:tg8RNMMgaN:tg8EaiaAydbaX2cdtfgOIdwa5:tg5a8Ja5a8JNaOIdbay:tg8Sa8KNagaOIdlaI:tgINMMg5N:tg8JNa8Pa8KaaN:tgya8Sa8Ka5N:tg8KNa8RagaaN:tgaaIaga5N:tggNMMJbbbbJbbjZa8Ea8ENayayNaaaaNMMa8Ja8JNa8Ka8KNagagNMMNg8K:rg8J:va8KJbbbb9BENgg:lg8Ka8KJbbjZ9EEg8Ka8KJ7;A9s89NJ:L9t9s::MNJ;ob;jZMJbbjZa8K:t:rNg8K:ta8KagJbbbb9DENg8Ka8Ja8KNaEEg8KNaHIdbMUdbaHaha8KNaHIdlMUdlaHa8Fa8KNaHIdwMUdwawcefhwazclfgzcx9hmbkkaYcxfhYa3cxfh3a8Vcifh8Va8Wcefg8WaP9hmbkcbhrinarhzdnaravarcdtfgsydbgHSmbinasavaHgzcdtfgOydbgHBdbaOhsazaH9hmbkkaKarc8W2fgHc3fJbbjZJbbj:;a8AazfRbbceGEg8KUdbaHc8Sfa8KUdbaHa8KUdxarcefgraP9hmbkkaqcdGhvcbhzaDhsaKhHindnazasydb9hmbJbbbbh8KdnaHcwfgOIdbg8Ja8JNaHIdbggagNaHclfgrIdbghahNMMgaJbbbb9BmbJbbjZaa:r:vh8KkaOa8Ja8KNUdbaraha8KNUdbaHaga8KNg8JUdbavmbaHJbbjZa8Ja8KJbbbb9BEUdbkasclfhsaHczfhHadazcefgz9hmbkcbhHaKhzindnaHaDydbgsSmbazaKascltfgsydwBdwazas8Pdb83dbkaDclfhDazczfhzadaHcefgH9hmbkkdnakyd2gzTmbazcdtakcxffc98fhHinaHydbcbydN:G:cjbH:bjjjbbaHc98fhHazcufgzmbkkakc;Wbf8Kjjjjbk9teiucbcbyd:y:G:cjbgeabcifc98GfgbBd:y:G:cjbdndnabZbcztgd9nmbcuhiabad9RcFFifcz4nbcuSmekaehikaik;aeedudndnabciGTmbabhixekaecFeGc:b:c:ew2hldndnadcz9pmbabhixekabhiinaialBdbaicxfalBdbaicwfalBdbaiclfalBdbaiczfhiadc9Wfgdcs0mbkkadcl6mbinaialBdbaiclfhiadc98fgdci0mbkkdnadTmbinaiae86bbaicefhiadcufgdmbkkabk9teiucbcbyd:y:G:cjbgeabcrfc94GfgbBd:y:G:cjbdndnabZbcztgd9nmbcuhiabad9RcFFifcz4nbcuSmekaehikaikTeeucbabcbyd:y:G:cjbge9Rcifc98GaefgbBd:y:G:cjbdnabZbcztge9nmbabae9RcFFifcz4nb8Akkk8Rdbcj:Gdkzebbbdbbbbbbbebbbbc:q:Gdkxebbbdbbba:qbb",t=new Uint8Array([32,0,65,2,1,106,34,33,3,128,11,4,13,64,6,253,10,7,15,116,127,5,8,12,40,16,19,54,20,9,27,255,113,17,42,67,24,23,146,148,18,14,22,45,70,69,56,114,101,21,25,63,75,136,108,28,118,29,73,115]);if(typeof WebAssembly!="object")return{supported:!1};var n,i=WebAssembly.instantiate(r(e),{}).then(function(u){n=u.instance,n.exports.__wasm_call_ctors()});function r(u){for(var f=new Uint8Array(u.length),d=0;d<u.length;++d){var p=u.charCodeAt(d);f[d]=p>96?p-97:p>64?p-39:p+4}for(var g=0,d=0;d<u.length;++d)f[g++]=f[d]<60?t[f[d]]:(f[d]-60)*64+f[++d];return f.buffer.slice(0,g)}function o(u){if(!u)throw new Error("Assertion failed")}function s(u){return new Uint8Array(u.buffer,u.byteOffset,u.byteLength)}function a(u,f,d,p,g,m,y,A,b,x){var T=n.exports.sbrk,E=T(f*16),v=u?T(u.byteLength):0,S=T(d.byteLength),I=T(m.byteLength),R=T(A.byteLength),O=new Uint8Array(n.exports.memory.buffer);u&&O.set(s(u),v),O.set(s(d),S),O.set(s(m),I),O.set(s(A),R),n.exports.meshopt_generateTangents(E,v,f,S,p,g*4,I,y*4,R,b*4,x),O=new Uint8Array(n.exports.memory.buffer);var L=new Float32Array(O.buffer,E,f*4).slice();return T(E-T(0)),L}var c={Compatible:1,ZeroFallback:2};return{ready:i,supported:!0,generateTangents:function(u,f,d,p,g,m,y,A){o(u===null||u instanceof Uint32Array||u instanceof Int32Array||u instanceof Uint16Array||u instanceof Int16Array),o(u===null||u.length%3==0),o(f instanceof Float32Array),o(f.length%d==0),o(d>=3),o(p instanceof Float32Array),o(p.length%g==0),o(g>=3),o(m instanceof Float32Array),o(m.length%y==0),o(y>=2),o(f.length/d==p.length/g),o(f.length/d==m.length/y),o(u!==null||f.length/d%3==0);for(var b=0,x=0;x<(A?A.length:0);++x)o(A[x]in c),b|=c[A[x]];var T=f.length/d,E=u?u.length:T,v=u===null||u.BYTES_PER_ELEMENT==4?u:new Uint32Array(u);return a(v,E,f,T,d,p,g,m,y,b)}}})();var GJ=class extends ir{constructor(t){super(),t=t??H.EMPTY_OBJECT;let n=t.resourceCache,i=t.gltf,r=t.bufferViewId,o=t.gltfResource,s=t.baseResource,a=t.cacheKey,c=i.bufferViews[r],u=c.buffer,f=c.byteOffset,d=c.byteLength,p=!1,g,m,y,A,b=pA(c);l(b)&&(u=b.buffer,f=b.byteOffset??0,d=b.byteLength,p=!0,g=b.byteStride,m=b.count,y=b.mode,A=b.filter??"NONE");let x=i.buffers[u];this._hasMeshopt=p,this._meshoptByteStride=g,this._meshoptCount=m,this._meshoptMode=y,this._meshoptFilter=A,this._resourceCache=n,this._gltfResource=o,this._baseResource=s,this._buffer=x,this._bufferId=u,this._byteOffset=f,this._byteLength=d,this._cacheKey=a,this._bufferLoader=void 0,this._typedArray=void 0,this._state=Tt.UNLOADED,this._promise=void 0}get cacheKey(){return this._cacheKey}get typedArray(){return this._typedArray}async load(){return l(this._promise)?this._promise:(this._state=Tt.LOADING,this._promise=Aet(this),this._promise)}unload(){l(this._bufferLoader)&&!this._bufferLoader.isDestroyed()&&this._resourceCache.unload(this._bufferLoader),this._bufferLoader=void 0,this._typedArray=void 0}};async function Aet(e){try{let t=bet(e);if(e._bufferLoader=t,await t.load(),e.isDestroyed())return;let n=t.typedArray,i=new Uint8Array(n.buffer,n.byteOffset+e._byteOffset,e._byteLength);if(e.unload(),e._typedArray=i,e._hasMeshopt){let r=e._meshoptCount,o=e._meshoptByteStride,s=new Uint8Array(r*o);gA.decodeGltfBuffer(s,r,o,e._typedArray,e._meshoptMode,e._meshoptFilter),e._typedArray=s}return e._state=Tt.READY,e}catch(t){if(e.isDestroyed())return;throw e.unload(),e._state=Tt.FAILED,e.getError("Failed to load buffer view",t)}}function bet(e){let t=e._resourceCache,n=e._buffer;if(l(n.uri)){let o=e._baseResource.getDerivedResource({url:n.uri});return t.getExternalBufferLoader({resource:o})}let i=n.extras?._pipeline?.source;return t.getEmbeddedBufferLoader({parentResource:e._gltfResource,bufferId:e._bufferId,typedArray:i})}var jS=GJ;var CT=class e{static _getDecoderTaskProcessor(){if(!l(e._decoderTaskProcessor)){let t=new $n("decodeDraco",e._maxDecodingConcurrency);t.initWebAssemblyModule({wasmBinaryFile:"ThirdParty/draco_decoder.wasm"}).then(function(n){n?e._taskProcessorReady=!0:e._error=new oe("Draco decoder could not be initialized.")}).catch(n=>{e._error=n}),e._decoderTaskProcessor=t}return e._decoderTaskProcessor}static decodePointCloud(t){let n=e._getDecoderTaskProcessor();if(l(e._error))throw e._error;if(e._taskProcessorReady)return n.scheduleTask(t,[t.buffer.buffer])}static decodeBufferView(t){let n=e._getDecoderTaskProcessor();if(l(e._error))throw e._error;if(e._taskProcessorReady)return n.scheduleTask(t,[t.array.buffer])}};CT._maxDecodingConcurrency=Math.max(dn.hardwareConcurrency-1,1);CT._decoderTaskProcessor=void 0;CT._taskProcessorReady=!1;CT._error=void 0;var Kg=CT;var Mn={POSITION:"POSITION",NORMAL:"NORMAL",TANGENT:"TANGENT",TEXCOORD:"TEXCOORD",COLOR:"COLOR",JOINTS:"JOINTS",WEIGHTS:"WEIGHTS",FEATURE_ID:"_FEATURE_ID",SCALE:"KHR_gaussian_splatting:SCALE",ROTATION:"KHR_gaussian_splatting:ROTATION",CUMULATIVE_DISTANCE:"BENTLEY_materials_line_style:CUMULATIVE_DISTANCE"};function xet(e){switch(e){case Mn.POSITION:return"positionMC";case Mn.NORMAL:return"normalMC";case Mn.TANGENT:return"tangentMC";case Mn.TEXCOORD:return"texCoord";case Mn.COLOR:return"color";case Mn.JOINTS:return"joints";case Mn.WEIGHTS:return"weights";case Mn.FEATURE_ID:return"featureId";case Mn.SCALE:return"scale";case Mn.ROTATION:return"rotation";case Mn.CUMULATIVE_DISTANCE:return"cumulativeDistance"}}Mn.hasSetIndex=function(e){switch(e){case Mn.POSITION:case Mn.NORMAL:case Mn.TANGENT:case Mn.CUMULATIVE_DISTANCE:return!1;case Mn.TEXCOORD:case Mn.COLOR:case Mn.JOINTS:case Mn.WEIGHTS:case Mn.FEATURE_ID:case Mn.SCALE:case Mn.ROTATION:return!0}};Mn.fromGltfSemantic=function(e){let t=e,i=/^(\w+)_\d+$/.exec(e);switch(i!==null&&(t=i[1]),t){case"POSITION":return Mn.POSITION;case"NORMAL":return Mn.NORMAL;case"TANGENT":return Mn.TANGENT;case"TEXCOORD":return Mn.TEXCOORD;case"COLOR":return Mn.COLOR;case"JOINTS":return Mn.JOINTS;case"WEIGHTS":return Mn.WEIGHTS;case"_FEATURE_ID":return Mn.FEATURE_ID;case"KHR_gaussian_splatting:SCALE":case"_SCALE":return Mn.SCALE;case"KHR_gaussian_splatting:ROTATION":case"_ROTATION":return Mn.ROTATION;case"BENTLEY_materials_line_style:CUMULATIVE_DISTANCE":return Mn.CUMULATIVE_DISTANCE}};Mn.fromPntsSemantic=function(e){switch(e){case"POSITION":case"POSITION_QUANTIZED":return Mn.POSITION;case"RGBA":case"RGB":case"RGB565":return Mn.COLOR;case"NORMAL":case"NORMAL_OCT16P":return Mn.NORMAL;case"BATCH_ID":return Mn.FEATURE_ID}};Mn.getGlslType=function(e){switch(e){case Mn.POSITION:case Mn.NORMAL:case Mn.TANGENT:return"vec3";case Mn.TEXCOORD:return"vec2";case Mn.COLOR:return"vec4";case Mn.JOINTS:return"ivec4";case Mn.WEIGHTS:return"vec4";case Mn.FEATURE_ID:return"int";case Mn.SCALE:return"vec3";case Mn.ROTATION:return"vec4";case Mn.CUMULATIVE_DISTANCE:return"float";case Mn.OPACITY:return"float"}};Mn.getVariableName=function(e,t){let n=xet(e);return l(t)&&(n+=`_${t}`),n};Object.freeze(Mn);var ct=Mn;var WJ=class extends ir{constructor(t){super(),t=t??H.EMPTY_OBJECT;let n=t.resourceCache,i=t.gltf,r=t.primitive,o=t.draco,s=t.gltfResource,a=t.baseResource,c=t.cacheKey;this._resourceCache=n,this._gltfResource=s,this._baseResource=a,this._gltf=i,this._primitive=r,this._draco=o,this._cacheKey=c,this._bufferViewLoader=void 0,this._bufferViewTypedArray=void 0,this._decodePromise=void 0,this._decodedData=void 0,this._state=Tt.UNLOADED,this._promise=void 0,this._dracoError=void 0}get cacheKey(){return this._cacheKey}get decodedData(){return this._decodedData}async load(){return l(this._promise)?this._promise:(this._state=Tt.LOADING,this._promise=Tet(this),this._promise)}process(t){if(this._state===Tt.READY)return!0;if(this._state!==Tt.PROCESSING||(l(this._dracoError)&&Pbe(this,this._dracoError),!l(this._bufferViewTypedArray))||l(this._decodePromise))return!1;let n=this._draco,i=this._primitive,r=this._gltf,o=r.bufferViews,s=n.bufferView,a=o[s],c=n.attributes,u=[];for(let p in i.attributes)if(i.attributes.hasOwnProperty(p)){let g=Cet(p);l(g)&&r.accessors[i.attributes[p]].componentType===Y.FLOAT&&(u.includes(g)||u.push(g))}let f={array:new Uint8Array(this._bufferViewTypedArray),bufferView:a,compressedAttributes:c,dequantizeInShader:!0,attributesToSkipTransform:u},d=Kg.decodeBufferView(f);if(!l(d))return!1;this._decodePromise=Eet(this,d)}unload(){l(this._bufferViewLoader)&&this._resourceCache.unload(this._bufferViewLoader),this._bufferViewLoader=void 0,this._bufferViewTypedArray=void 0,this._decodedData=void 0,this._gltf=void 0,this._primitive=void 0}};async function Tet(e){let t=e._resourceCache;try{let n=t.getBufferViewLoader({gltf:e._gltf,bufferViewId:e._draco.bufferView,gltfResource:e._gltfResource,baseResource:e._baseResource});return e._bufferViewLoader=n,await n.load(),e.isDestroyed()?void 0:(e._bufferViewTypedArray=n.typedArray,e._state=Tt.PROCESSING,e)}catch(n){if(e.isDestroyed())return;Pbe(e,n)}}function Pbe(e,t){throw e.unload(),e._state=Tt.FAILED,e.getError("Failed to load Draco",t)}async function Eet(e,t){try{let n=await t;return e.isDestroyed()?void 0:(e.unload(),e._decodedData={indices:n.indexArray,vertexAttributes:n.attributeData},e._state=Tt.READY,e._baseResource)}catch(n){if(e.isDestroyed())return;e._dracoError=n}}var vT={};vT[ct.POSITION]="POSITION";vT[ct.NORMAL]="NORMAL";vT[ct.COLOR]="COLOR";vT[ct.TEXCOORD]="TEX_COORD";function Cet(e){for(let t in vT)if(vT.hasOwnProperty(t)&&e.startsWith(t))return vT[t]}var HS=WJ;function vet(e){let{uint8Array:t,format:n,request:i}=e,r=e.flipY??!1,o=e.skipColorSpaceConversion??!1,s=new Blob([t],{type:n}),a;return De.supportsImageBitmapOptions().then(function(c){return c?Promise.resolve(De.createImageBitmapFromBlob(s,{flipY:r,premultiplyAlpha:!1,skipColorSpaceConversion:o})):(a=window.URL.createObjectURL(s),new De({url:a,request:i}).fetchImage({flipY:r,skipColorSpaceConversion:o}))}).then(function(c){return l(a)&&window.URL.revokeObjectURL(a),c}).catch(function(c){return l(a)&&window.URL.revokeObjectURL(a),Promise.reject(c)})}var $g=vet;var fF=class extends ir{constructor(t){super(),t=t??H.EMPTY_OBJECT;let n=t.resourceCache,i=t.gltf,r=t.imageId,o=t.gltfResource,s=t.baseResource,a=t.cacheKey,c=i.images[r],u=c.bufferView,f=c.uri;this._resourceCache=n,this._gltfResource=o,this._baseResource=s,this._gltf=i,this._bufferViewId=u,this._uri=f,this._cacheKey=a,this._bufferViewLoader=void 0,this._image=void 0,this._mipLevels=void 0,this._state=Tt.UNLOADED,this._promise=void 0}get cacheKey(){return this._cacheKey}get image(){return this._image}get mipLevels(){return this._mipLevels}load(){return l(this._promise)?this._promise:l(this._bufferViewId)?(this._promise=wet(this),this._promise):(this._promise=Iet(this),this._promise)}unload(){l(this._bufferViewLoader)&&!this._bufferViewLoader.isDestroyed()&&this._resourceCache.unload(this._bufferViewLoader),this._bufferViewLoader=void 0,this._uri=void 0,this._image=void 0,this._mipLevels=void 0,this._gltf=void 0}};function Dbe(e){let t;return Array.isArray(e)&&(t=e.slice(1,e.length).map(function(n){return n.bufferView}),e=e[0]),{image:e,mipLevels:t}}async function wet(e){e._state=Tt.LOADING;let t=e._resourceCache;try{let n=t.getBufferViewLoader({gltf:e._gltf,bufferViewId:e._bufferViewId,gltfResource:e._gltfResource,baseResource:e._baseResource});if(e._bufferViewLoader=n,await n.load(),e.isDestroyed())return;let i=n.typedArray,r=await Det(i);if(e.isDestroyed())return;let o=Dbe(r);return e.unload(),e._image=o.image,e._mipLevels=o.mipLevels,e._state=Tt.READY,e}catch(n){return e.isDestroyed()?void 0:Rbe(e,n,"Failed to load embedded image")}}async function Iet(e){e._state=Tt.LOADING;let t=e._baseResource,n=e._uri,i=t.getDerivedResource({url:n});try{let r=await Oet(i);if(e.isDestroyed())return;let o=Dbe(r);return e.unload(),e._image=o.image,e._mipLevels=o.mipLevels,e._state=Tt.READY,e}catch(r){return e.isDestroyed()?void 0:Rbe(e,r,`Failed to load image: ${n}`)}}function Rbe(e,t,n){return e.unload(),e._state=Tt.FAILED,Promise.reject(e.getError(n,t))}function Pet(e){let t=e.subarray(0,2),n=e.subarray(0,4),i=e.subarray(8,12);if(t[0]===255&&t[1]===216)return"image/jpeg";if(t[0]===137&&t[1]===80)return"image/png";if(t[0]===171&&t[1]===75)return"image/ktx2";if(n[0]===82&&n[1]===73&&n[2]===70&&n[3]===70&&i[0]===87&&i[1]===69&&i[2]===66&&i[3]===80)return"image/webp";throw new oe("Image format is not recognized")}async function Det(e){let t=Pet(e);if(t==="image/ktx2"){let n=new Uint8Array(e);return Ou(n)}return fF._loadImageFromTypedArray({uint8Array:e,format:t,flipY:!1,skipColorSpaceConversion:!0})}var Ret=/(^data:image\/ktx2)|(\.ktx2$)/i;function Oet(e){let t=e.getUrlComponent(!1,!0);return Ret.test(t)?Ou(e):e.fetchImage({skipColorSpaceConversion:!0,preferImageBitmap:!0})}fF._loadImageFromTypedArray=$g;var GS=fF;var Obe={TEXTURE:0,PROGRAM:1,BUFFER:2,NUMBER_OF_JOB_TYPES:3};Object.freeze(Obe);var Fc=Obe;var qJ=class extends ir{constructor(t){super(),t=t??H.EMPTY_OBJECT;let n=t.resourceCache,i=t.gltf,r=t.accessorId,o=t.gltfResource,s=t.baseResource,a=t.primitive,c=t.draco,u=t.cacheKey,f=t.asynchronous??!0,d=t.loadBuffer??!1,p=t.loadTypedArray??!1,g=i.accessors[r].componentType;this._resourceCache=n,this._gltfResource=o,this._baseResource=s,this._gltf=i,this._accessorId=r,this._indexDatatype=g,this._primitive=a,this._draco=c,this._cacheKey=u,this._asynchronous=f,this._loadBuffer=d,this._loadTypedArray=p,this._bufferViewLoader=void 0,this._dracoLoader=void 0,this._typedArray=void 0,this._buffer=void 0,this._state=Tt.UNLOADED,this._promise=void 0}get cacheKey(){return this._cacheKey}get buffer(){return this._buffer}get typedArray(){return this._typedArray}get indexDatatype(){return this._indexDatatype}async load(){return l(this._promise)?this._promise:l(this._draco)?(this._promise=Net(this),this._promise):(this._promise=Let(this),this._promise)}process(t){if(this._state===Tt.READY)return!0;if(this._state!==Tt.LOADED&&this._state!==Tt.PROCESSING)return!1;let n=this._typedArray,i=this._indexDatatype;if(l(this._dracoLoader))try{this._dracoLoader.process(t)&&(n=this._dracoLoader.decodedData.indices.typedArray,this._typedArray=n,i=Y.fromTypedArray(n),this._indexDatatype=i)}catch(o){XJ(this,o)}if(!l(n))return!1;let r;if(this._loadBuffer&&this._asynchronous){let o=Met;if(o.set(n,i,t.context),!t.jobScheduler.execute(o,Fc.BUFFER))return!1;r=o.buffer}else this._loadBuffer&&(r=Mbe(n,i,t.context));return this.unload(),this._buffer=r,this._typedArray=this._loadTypedArray?n:void 0,this._state=Tt.READY,this._resourceCache.statistics.addGeometryLoader(this),!0}unload(){l(this._buffer)&&this._buffer.destroy();let t=this._resourceCache;l(this._bufferViewLoader)&&!this._bufferViewLoader.isDestroyed()&&t.unload(this._bufferViewLoader),l(this._dracoLoader)&&t.unload(this._dracoLoader),this._bufferViewLoader=void 0,this._dracoLoader=void 0,this._typedArray=void 0,this._buffer=void 0,this._gltf=void 0,this._primitive=void 0}},YJ=class{constructor(){this.typedArray=void 0,this.indexDatatype=void 0,this.context=void 0,this.buffer=void 0}set(t,n,i){this.typedArray=t,this.indexDatatype=n,this.context=i}execute(){this.buffer=Mbe(this.typedArray,this.indexDatatype,this.context)}};function Mbe(e,t,n){let i=tt.createIndexBuffer({typedArray:e,context:n,usage:Me.STATIC_DRAW,indexDatatype:t});return i.vertexArrayDestroyable=!1,i}var Met=new YJ;async function Net(e){e._state=Tt.LOADING;let t=e._resourceCache;try{let n=t.getDracoLoader({gltf:e._gltf,primitive:e._primitive,draco:e._draco,gltfResource:e._gltfResource,baseResource:e._baseResource});return e._dracoLoader=n,await n.load(),e.isDestroyed()?void 0:(e._state=Tt.LOADED,e)}catch(n){if(e.isDestroyed())return;XJ(e,n)}}async function Let(e){let t=e._gltf,n=e._accessorId,r=t.accessors[n].bufferView;e._state=Tt.LOADING;let o=e._resourceCache;try{let s=o.getBufferViewLoader({gltf:t,bufferViewId:r,gltfResource:e._gltfResource,baseResource:e._baseResource});if(e._bufferViewLoader=s,await s.load(),e.isDestroyed())return;let a=s.typedArray;return e._typedArray=Fet(e,a),e._state=Tt.PROCESSING,e}catch(s){if(e.isDestroyed())return;XJ(e,s)}}function Fet(e,t){let n=e._gltf,i=e._accessorId,r=n.accessors[i],o=r.count,s=r.componentType,a=je.getSizeInBytes(s),c=t.buffer,u=t.byteOffset+r.byteOffset;if(u%a!==0){let d=o*a,p=new Uint8Array(c,u,d);c=new Uint8Array(p).buffer,u=0,qr("index-buffer-unaligned",`The index array is not aligned to a ${a}-byte boundary.`)}let f;return s===je.UNSIGNED_BYTE?f=new Uint8Array(c,u,o):s===je.UNSIGNED_SHORT?f=new Uint16Array(c,u,o):s===je.UNSIGNED_INT&&(f=new Uint32Array(c,u,o)),f}function XJ(e,t){throw e.unload(),e._state=Tt.FAILED,e.getError("Failed to load index buffer",t)}var WS=qJ;function Bet(e,t,n){return JSON.parse(Gu(e,t,n))}var No=Bet;function ket(e,t){return t=t??0,Gu(e,t,Math.min(4,e.length))}var bm=ket;function Uet(e,t,n){if(n=n??!1,n){let i=e.indexOf(t);if(i>-1)return i}return e.push(t),e.length-1}var Ta=Uet;function zet(e,t){return l(e.extensionsUsed)&&e.extensionsUsed.indexOf(t)>=0}var Wo=zet;function rn(){}rn.objectLegacy=function(e,t){if(l(e)){for(let n in e)if(Object.prototype.hasOwnProperty.call(e,n)){let i=e[n],r=t(i,n);if(l(r))return r}}};rn.object=function(e,t){if(l(e)){let n=e.length;for(let i=0;i<n;i++){let r=e[i],o=t(r,i);if(l(o))return o}}};rn.topLevel=function(e,t,n){let i=e[t];return l(i)&&!Array.isArray(i)?rn.objectLegacy(i,n):rn.object(i,n)};rn.accessor=function(e,t){return rn.topLevel(e,"accessors",t)};rn.accessorWithSemantic=function(e,t,n){let i={};return rn.mesh(e,function(r){return rn.meshPrimitive(r,function(o){let s=rn.meshPrimitiveAttribute(o,function(a,c){if(c.indexOf(t)===0&&!l(i[a])){i[a]=!0;let u=n(a);if(l(u))return u}});return l(s)?s:rn.meshPrimitiveTarget(o,function(a){return rn.meshPrimitiveTargetAttribute(a,function(c,u){if(u.indexOf(t)===0&&!l(i[c])){i[c]=!0;let f=n(c);if(l(f))return f}})})})})};rn.accessorContainingVertexAttributeData=function(e,t){let n={};return rn.mesh(e,function(i){return rn.meshPrimitive(i,function(r){let o=rn.meshPrimitiveAttribute(r,function(s){if(!l(n[s])){n[s]=!0;let a=t(s);if(l(a))return a}});return l(o)?o:rn.meshPrimitiveTarget(r,function(s){return rn.meshPrimitiveTargetAttribute(s,function(a){if(!l(n[a])){n[a]=!0;let c=t(a);if(l(c))return c}})})})})};rn.accessorContainingIndexData=function(e,t){let n={};return rn.mesh(e,function(i){return rn.meshPrimitive(i,function(r){let o=r.indices;if(l(o)&&!l(n[o])){n[o]=!0;let s=t(o);if(l(s))return s}})})};rn.animation=function(e,t){return rn.topLevel(e,"animations",t)};rn.animationChannel=function(e,t){let n=e.channels;return rn.object(n,t)};rn.animationSampler=function(e,t){let n=e.samplers;return rn.object(n,t)};rn.buffer=function(e,t){return rn.topLevel(e,"buffers",t)};rn.bufferView=function(e,t){return rn.topLevel(e,"bufferViews",t)};rn.camera=function(e,t){return rn.topLevel(e,"cameras",t)};rn.image=function(e,t){return rn.topLevel(e,"images",t)};rn.material=function(e,t){return rn.topLevel(e,"materials",t)};rn.materialValue=function(e,t){let n=e.values;l(e.extensions)&&l(e.extensions.KHR_techniques_webgl)&&(n=e.extensions.KHR_techniques_webgl.values);for(let i in n)if(Object.prototype.hasOwnProperty.call(n,i)){let r=t(n[i],i);if(l(r))return r}};rn.mesh=function(e,t){return rn.topLevel(e,"meshes",t)};rn.meshPrimitive=function(e,t){let n=e.primitives;if(l(n)){let i=n.length;for(let r=0;r<i;r++){let o=n[r],s=t(o,r);if(l(s))return s}}};rn.meshPrimitiveAttribute=function(e,t){let n=e.attributes;for(let i in n)if(Object.prototype.hasOwnProperty.call(n,i)){let r=t(n[i],i);if(l(r))return r}};rn.meshPrimitiveTarget=function(e,t){let n=e.targets;if(l(n)){let i=n.length;for(let r=0;r<i;++r){let o=t(n[r],r);if(l(o))return o}}};rn.meshPrimitiveTargetAttribute=function(e,t){for(let n in e)if(Object.prototype.hasOwnProperty.call(e,n)){let i=e[n],r=t(i,n);if(l(r))return r}};rn.node=function(e,t){return rn.topLevel(e,"nodes",t)};rn.nodeInTree=function(e,t,n){let i=e.nodes;if(l(i)){let r=t.length;for(let o=0;o<r;o++){let s=t[o],a=i[s];if(l(a)){let c=n(a,s);if(l(c))return c;let u=a.children;if(l(u)&&(c=rn.nodeInTree(e,u,n),l(c)))return c}}}};rn.nodeInScene=function(e,t,n){let i=t.nodes;if(l(i))return rn.nodeInTree(e,i,n)};rn.program=function(e,t){return Wo(e,"KHR_techniques_webgl")?rn.object(e.extensions.KHR_techniques_webgl.programs,t):rn.topLevel(e,"programs",t)};rn.sampler=function(e,t){return rn.topLevel(e,"samplers",t)};rn.scene=function(e,t){return rn.topLevel(e,"scenes",t)};rn.shader=function(e,t){return Wo(e,"KHR_techniques_webgl")?rn.object(e.extensions.KHR_techniques_webgl.shaders,t):rn.topLevel(e,"shaders",t)};rn.skin=function(e,t){return rn.topLevel(e,"skins",t)};rn.skinJoint=function(e,t){let n=e.joints;if(l(n)){let i=n.length;for(let r=0;r<i;r++){let o=n[r],s=t(o);if(l(s))return s}}};rn.techniqueAttribute=function(e,t){let n=e.attributes;for(let i in n)if(Object.prototype.hasOwnProperty.call(n,i)){let r=t(n[i],i);if(l(r))return r}};rn.techniqueUniform=function(e,t){let n=e.uniforms;for(let i in n)if(Object.prototype.hasOwnProperty.call(n,i)){let r=t(n[i],i);if(l(r))return r}};rn.techniqueParameter=function(e,t){let n=e.parameters;for(let i in n)if(Object.prototype.hasOwnProperty.call(n,i)){let r=t(n[i],i);if(l(r))return r}};rn.technique=function(e,t){return Wo(e,"KHR_techniques_webgl")?rn.object(e.extensions.KHR_techniques_webgl.techniques,t):rn.topLevel(e,"techniques",t)};rn.texture=function(e,t){return rn.topLevel(e,"textures",t)};var ke=rn;function Vet(e){ke.accessor(e,function(n){l(n.bufferView)&&(n.byteOffset=n.byteOffset??0)}),ke.bufferView(e,function(n){l(n.buffer)&&(n.byteOffset=n.byteOffset??0)}),ke.mesh(e,function(n){ke.meshPrimitive(n,function(i){if(i.mode=i.mode??te.TRIANGLES,!l(i.material)){l(e.materials)||(e.materials=[]);let r={name:"default"};i.material=Ta(e.materials,r)}})}),ke.accessorContainingVertexAttributeData(e,function(n){let i=e.accessors[n],r=i.bufferView;if(i.normalized=i.normalized??!1,l(r)){let o=e.bufferViews[r];o.byteStride=ju(e,i),o.target=te.ARRAY_BUFFER}}),ke.accessorContainingIndexData(e,function(n){let r=e.accessors[n].bufferView;if(l(r)){let o=e.bufferViews[r];o.target=te.ELEMENT_ARRAY_BUFFER}}),ke.material(e,function(n){let i=n.extensions??{},r=i.KHR_materials_common;if(l(r)){let c=r.technique,u=l(r.values)?r.values:{};r.values=u,u.ambient=l(u.ambient)?u.ambient:[0,0,0,1],u.emission=l(u.emission)?u.emission:[0,0,0,1],u.transparency=u.transparency??1,c!=="CONSTANT"&&(u.diffuse=l(u.diffuse)?u.diffuse:[0,0,0,1],c!=="LAMBERT"&&(u.specular=l(u.specular)?u.specular:[0,0,0,1],u.shininess=u.shininess??0)),r.transparent=r.transparent??!1,r.doubleSided=r.doubleSided??!1;return}n.emissiveFactor=n.emissiveFactor??[0,0,0],n.alphaMode=n.alphaMode??"OPAQUE",n.doubleSided=n.doubleSided??!1,n.alphaMode==="MASK"&&(n.alphaCutoff=n.alphaCutoff??.5);let o=i.KHR_techniques_webgl;l(o)&&ke.materialValue(n,function(c){l(c.index)&&ST(c)}),ST(n.emissiveTexture),ST(n.normalTexture),ST(n.occlusionTexture);let s=n.pbrMetallicRoughness;l(s)&&(s.baseColorFactor=s.baseColorFactor??[1,1,1,1],s.metallicFactor=s.metallicFactor??1,s.roughnessFactor=s.roughnessFactor??1,ST(s.baseColorTexture),ST(s.metallicRoughnessTexture));let a=i.KHR_materials_pbrSpecularGlossiness;l(a)&&(a.diffuseFactor=a.diffuseFactor??[1,1,1,1],a.specularFactor=a.specularFactor??[1,1,1],a.glossinessFactor=a.glossinessFactor??1,ST(a.specularGlossinessTexture))}),ke.animation(e,function(n){ke.animationSampler(n,function(i){i.interpolation=i.interpolation??"LINEAR"})});let t=jet(e);return ke.node(e,function(n,i){l(t[i])||l(n.translation)||l(n.rotation)||l(n.scale)?(n.translation=n.translation??[0,0,0],n.rotation=n.rotation??[0,0,0,1],n.scale=n.scale??[1,1,1]):n.matrix=n.matrix??[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]}),ke.sampler(e,function(n){n.wrapS=n.wrapS??te.REPEAT,n.wrapT=n.wrapT??te.REPEAT}),l(e.scenes)&&!l(e.scene)&&(e.scene=0),e}function jet(e){let t={};return ke.animation(e,function(n){ke.animationChannel(n,function(i){let r=i.target,o=r.node,s=r.path;(s==="translation"||s==="rotation"||s==="scale")&&(t[o]=!0)})}),t}function ST(e){l(e)&&(e.texCoord=e.texCoord??0)}var dF=Vet;function Het(e){return ke.shader(e,function(t){RH(t)}),ke.buffer(e,function(t){RH(t)}),ke.image(e,function(t){RH(t)}),RH(e),e}function RH(e){e.extras=l(e.extras)?e.extras:{},e.extras._pipeline=l(e.extras._pipeline)?e.extras._pipeline:{}}var _A=Het;function Get(e,t){let n=e.extensionsRequired;if(l(n)){let i=n.indexOf(t);i>=0&&n.splice(i,1),n.length===0&&delete e.extensionsRequired}}var hF=Get;function Wet(e,t){let n=e.extensionsUsed;if(l(n)){let i=n.indexOf(t);i>=0&&n.splice(i,1),hF(e,t),n.length===0&&delete e.extensionsUsed}}var wT=Wet;var qet=4;function Yet(e){if(bm(e)!=="glTF")throw new oe("File is not valid binary glTF");let n=Nbe(e,0,5),i=n[1];if(i!==1&&i!==2)throw new oe("Binary glTF version is not 1 or 2");return i===1?Xet(e,n):Ket(e,n)}function Nbe(e,t,n){let i=new DataView(e.buffer),r=new Array(n);for(let o=0;o<n;++o)r[o]=i.getUint32(e.byteOffset+t+o*qet,!0);return r}function Xet(e,t){let n=t[2],i=t[3];if(t[4]!==0)throw new oe("Binary glTF scene format is not JSON");let o=20,s=o+i,a=Gu(e,o,i),c=JSON.parse(a);_A(c);let u=e.subarray(s,n),f=c.buffers;if(l(f)&&Object.keys(f).length>0){let d=f.binary_glTF??f.KHR_binary_glTF;l(d)&&(d.extras._pipeline.source=u,delete d.uri)}return wT(c,"KHR_binary_glTF"),c}function Ket(e,t){let n=t[2],i=12,r,o;for(;i<n;){let s=Nbe(e,i,2),a=s[0],c=s[1];i+=8;let u=e.subarray(i,i+a);if(i+=a,c===1313821514){let f=Gu(u);r=JSON.parse(f),_A(r)}else c===5130562&&(o=u)}if(l(r)&&l(o)){let s=r.buffers;if(l(s)&&s.length>0){let a=s[0];a.extras._pipeline.source=o}}return r}var IT=Yet;function $et(e){return ke.shader(e,function(t){OH(t)}),ke.buffer(e,function(t){OH(t)}),ke.image(e,function(t){OH(t)}),OH(e),e}function OH(e){l(e.extras)&&(l(e.extras._pipeline)&&delete e.extras._pipeline,Object.keys(e.extras).length===0&&delete e.extras)}var mF=$et;function Jet(e,t){let n=e.extensionsUsed;l(n)||(n=[],e.extensionsUsed=n),Ta(n,t,!0)}var Jd=Jet;function Zet(e,t){let n=e.bufferViews,i=e.buffers,r=t.bufferView,o=Hf(t.type);if(!l(t.bufferView))return{min:new Array(o).fill(0),max:new Array(o).fill(0)};let s=new Array(o).fill(Number.POSITIVE_INFINITY),a=new Array(o).fill(Number.NEGATIVE_INFINITY),c=n[r],u=c.buffer,d=i[u].extras._pipeline.source,p=t.count,g=ju(e,t),m=t.byteOffset+c.byteOffset+d.byteOffset,y=t.componentType,A=Y.getSizeInBytes(y),b=new DataView(d.buffer),x=new Array(o),T=qg(y);for(let E=0;E<p;E++){T(b,m,o,A,x);for(let v=0;v<o;v++){let S=x[v];s[v]=Math.min(s[v],S),a[v]=Math.max(a[v],S)}m+=g}return{min:s,max:a}}var PT=Zet;var Qet=[te.FUNC_ADD,te.FUNC_ADD],ett=[te.ONE,te.ZERO,te.ONE,te.ZERO];function Lbe(e,t){let n=e.enable;return l(n)?n.indexOf(t)>-1:!1}var ttt=[te.ZERO,te.ONE,te.SRC_COLOR,te.ONE_MINUS_SRC_COLOR,te.SRC_ALPHA,te.ONE_MINUS_SRC_ALPHA,te.DST_ALPHA,te.ONE_MINUS_DST_ALPHA,te.DST_COLOR,te.ONE_MINUS_DST_COLOR];function ntt(e,t){if(!l(e))return t;for(let n=0;n<4;n++)if(ttt.indexOf(e[n])===-1)return t;return e}function itt(e){let t={},n={},i=e.techniques;return l(i)&&(ke.technique(e,function(r,o){let s=r.states;if(l(s)){let a=n[o]={};if(Lbe(s,te.BLEND)){a.alphaMode="BLEND";let c=s.functions;l(c)&&(l(c.blendEquationSeparate)||l(c.blendFuncSeparate))&&(t[o]={blendEquation:c.blendEquationSeparate??Qet,blendFactors:ntt(c.blendFuncSeparate,ett)})}Lbe(s,te.CULL_FACE)||(a.doubleSided=!0),delete r.states}}),Object.keys(t).length>0&&(l(e.extensions)||(e.extensions={}),Jd(e,"KHR_blend")),ke.material(e,function(r){if(l(r.technique)){let o=n[r.technique];ke.objectLegacy(o,function(a,c){r[c]=a});let s=t[r.technique];l(s)&&(l(r.extensions)||(r.extensions={}),r.extensions.KHR_blend=s)}})),e}var pF=itt;function rtt(e,t){let n=e.extensionsRequired;l(n)||(n=[],e.extensionsRequired=n),Ta(n,t,!0),Jd(e,t)}var gF=rtt;function ott(e){let t=e.techniques,n={},i={},r={};if(l(t)){let o={programs:[],shaders:[],techniques:[]},s=e.glExtensionsUsed;delete e.glExtensionsUsed,ke.technique(e,function(a,c){let u={name:a.name,program:void 0,attributes:{},uniforms:{}},f;if(ke.techniqueAttribute(a,function(d,p){f=a.parameters[d],u.attributes[p]={semantic:f.semantic}}),ke.techniqueUniform(a,function(d,p){f=a.parameters[d],u.uniforms[p]={count:f.count,node:f.node,type:f.type,semantic:f.semantic,value:f.value},l(n[c])||(n[c]={}),n[c][d]=p}),l(r[a.program]))u.program=r[a.program];else{let d=e.programs[a.program],p={name:d.name,fragmentShader:void 0,vertexShader:void 0,glExtensions:s},g=e.shaders[d.fragmentShader];p.fragmentShader=Ta(o.shaders,g,!0);let m=e.shaders[d.vertexShader];p.vertexShader=Ta(o.shaders,m,!0),u.program=Ta(o.programs,p),r[a.program]=u.program}i[c]=Ta(o.techniques,u)}),o.techniques.length>0&&(l(e.extensions)||(e.extensions={}),e.extensions.KHR_techniques_webgl=o,Jd(e,"KHR_techniques_webgl"),gF(e,"KHR_techniques_webgl"))}return ke.material(e,function(o){if(l(o.technique)){let s={technique:i[o.technique]};ke.objectLegacy(o.values,function(a,c){l(s.values)||(s.values={});let u=n[o.technique][c];l(u)&&(s.values[u]=a)}),l(o.extensions)||(o.extensions={}),o.extensions.KHR_techniques_webgl=s}delete o.technique,delete o.values}),delete e.techniques,delete e.programs,delete e.shaders,e}var _F=ott;function stt(e,t){Wr.typeOf.object("material",e),Wr.defined("handler",t);let n=e.pbrMetallicRoughness;if(l(n)){if(l(n.baseColorTexture)){let o=n.baseColorTexture,s=t(o.index,o);if(l(s))return s}if(l(n.metallicRoughnessTexture)){let o=n.metallicRoughnessTexture,s=t(o.index,o);if(l(s))return s}}let{extensions:i}=e;if(l(i)){let o=i.KHR_materials_pbrSpecularGlossiness;if(l(o)){if(l(o.diffuseTexture)){let u=o.diffuseTexture,f=t(u.index,u);if(l(f))return f}if(l(o.specularGlossinessTexture)){let u=o.specularGlossinessTexture,f=t(u.index,u);if(l(f))return f}}let s=i.KHR_materials_specular;if(l(s)){let{specularTexture:u,specularColorTexture:f}=s;if(l(u)){let d=t(u.index,u);if(l(d))return d}if(l(f)){let d=t(f.index,f);if(l(d))return d}}let a=i.KHR_materials_transmission;if(l(a)&&l(a.transmissionTexture)){let u=a.transmissionTexture,f=t(u.index,u);if(l(f))return f}let c=i.KHR_materials_common;if(l(c)&&l(c.values)){let{diffuse:u,ambient:f,emission:d,specular:p}=c.values;if(l(u)&&l(u.index)){let g=t(u.index,u);if(l(g))return g}if(l(f)&&l(f.index)){let g=t(f.index,f);if(l(g))return g}if(l(d)&&l(d.index)){let g=t(d.index,d);if(l(g))return g}if(l(p)&&l(p.index)){let g=t(p.index,p);if(l(g))return g}}}let r=ke.materialValue(e,function(o){if(l(o.index)){let s=t(o.index,o);if(l(s))return s}});if(l(r))return r;if(l(e.emissiveTexture)){let o=e.emissiveTexture,s=t(o.index,o);if(l(s))return s}if(l(e.normalTexture)){let o=e.normalTexture,s=t(o.index,o);if(l(s))return s}if(l(e.occlusionTexture)){let o=e.occlusionTexture,s=t(o.index,o);if(l(s))return s}}var qS=stt;var Fbe=["mesh","node","material","accessor","bufferView","buffer","texture","sampler","image"];function att(e,t){return t=t??Fbe,Fbe.forEach(function(n){t.indexOf(n)>-1&<t(e,n)}),e}var ctt={accessor:"accessors",buffer:"buffers",bufferView:"bufferViews",image:"images",node:"nodes",material:"materials",mesh:"meshes",sampler:"samplers",texture:"textures"};function ltt(e,t){let n=ctt[t],i=e[n];if(l(i)){let r=0,o=Qp[t](e),s=i.length;for(let a=0;a<s;++a)o[a]||(Zp[t](e,a-r),r++)}}function Zp(){}Zp.accessor=function(e,t){e.accessors.splice(t,1),ke.mesh(e,function(i){ke.meshPrimitive(i,function(r){ke.meshPrimitiveAttribute(r,function(a,c){a>t&&r.attributes[c]--}),ke.meshPrimitiveTarget(r,function(a){ke.meshPrimitiveTargetAttribute(a,function(c,u){c>t&&a[u]--})});let o=r.indices;l(o)&&o>t&&r.indices--;let s=r.extensions;l(s)&&l(s.CESIUM_primitive_outline)&&s.CESIUM_primitive_outline.indices>t&&--s.CESIUM_primitive_outline.indices})}),ke.skin(e,function(i){l(i.inverseBindMatrices)&&i.inverseBindMatrices>t&&i.inverseBindMatrices--}),ke.animation(e,function(i){ke.animationSampler(i,function(r){l(r.input)&&r.input>t&&r.input--,l(r.output)&&r.output>t&&r.output--})})};Zp.buffer=function(e,t){e.buffers.splice(t,1),ke.bufferView(e,function(i){l(i.buffer)&&i.buffer>t&&i.buffer--;let r=i.extensions;if(l(r)){let o=r.EXT_meshopt_compression;l(o)&&o.buffer>t&&o.buffer--;let s=r.KHR_meshopt_compression;l(s)&&s.buffer>t&&s.buffer--}})};Zp.bufferView=function(e,t){if(e.bufferViews.splice(t,1),ke.accessor(e,function(i){l(i.bufferView)&&i.bufferView>t&&i.bufferView--}),ke.shader(e,function(i){l(i.bufferView)&&i.bufferView>t&&i.bufferView--}),ke.image(e,function(i){l(i.bufferView)&&i.bufferView>t&&i.bufferView--}),Wo(e,"KHR_draco_mesh_compression")&&ke.mesh(e,function(i){ke.meshPrimitive(i,function(r){l(r.extensions)&&l(r.extensions.KHR_draco_mesh_compression)&&r.extensions.KHR_draco_mesh_compression.bufferView>t&&r.extensions.KHR_draco_mesh_compression.bufferView--})}),Wo(e,"EXT_feature_metadata")){let r=e.extensions.EXT_feature_metadata.featureTables;for(let o in r)if(r.hasOwnProperty(o)){let a=r[o].properties;if(l(a)){for(let c in a)if(a.hasOwnProperty(c)){let u=a[c];l(u.bufferView)&&u.bufferView>t&&u.bufferView--,l(u.arrayOffsetBufferView)&&u.arrayOffsetBufferView>t&&u.arrayOffsetBufferView--,l(u.stringOffsetBufferView)&&u.stringOffsetBufferView>t&&u.stringOffsetBufferView--}}}}if(Wo(e,"EXT_structural_metadata")){let r=e.extensions.EXT_structural_metadata.propertyTables;if(l(r)){let o=r.length;for(let s=0;s<o;++s){let c=r[s].properties;for(let u in c)if(c.hasOwnProperty(u)){let f=c[u];l(f.values)&&f.values>t&&f.values--,l(f.arrayOffsets)&&f.arrayOffsets>t&&f.arrayOffsets--,l(f.stringOffsets)&&f.stringOffsets>t&&f.stringOffsets--}}}}};Zp.image=function(e,t){e.images.splice(t,1),ke.texture(e,function(i){l(i.source)&&i.source>t&&--i.source;let r=i.extensions;l(r)&&l(r.EXT_texture_webp)&&r.EXT_texture_webp.source>t?--i.extensions.EXT_texture_webp.source:l(r)&&l(r.KHR_texture_basisu)&&r.KHR_texture_basisu.source>t&&--i.extensions.KHR_texture_basisu.source})};Zp.mesh=function(e,t){e.meshes.splice(t,1),ke.node(e,function(i){l(i.mesh)&&(i.mesh>t?i.mesh--:i.mesh===t&&delete i.mesh)})};Zp.node=function(e,t){e.nodes.splice(t,1),ke.skin(e,function(i){l(i.skeleton)&&i.skeleton>t&&i.skeleton--,i.joints=i.joints.map(function(r){return r>t?r-1:r})}),ke.animation(e,function(i){ke.animationChannel(i,function(r){l(r.target)&&l(r.target.node)&&r.target.node>t&&r.target.node--})}),ke.technique(e,function(i){ke.techniqueUniform(i,function(r){l(r.node)&&r.node>t&&r.node--})}),ke.node(e,function(i){l(i.children)&&(i.children=i.children.filter(function(r){return r!==t}).map(function(r){return r>t?r-1:r}))}),ke.scene(e,function(i){i.nodes=i.nodes.filter(function(r){return r!==t}).map(function(r){return r>t?r-1:r})})};Zp.material=function(e,t){e.materials.splice(t,1),ke.mesh(e,function(i){ke.meshPrimitive(i,function(r){l(r.material)&&r.material>t&&r.material--})})};Zp.sampler=function(e,t){e.samplers.splice(t,1),ke.texture(e,function(i){l(i.sampler)&&i.sampler>t&&--i.sampler})};Zp.texture=function(e,t){if(e.textures.splice(t,1),ke.material(e,function(i){qS(i,function(r,o){o.index>t&&--o.index})}),Wo(e,"EXT_feature_metadata")){ke.mesh(e,function(o){ke.meshPrimitive(o,function(s){let a=s.extensions;if(l(a)&&l(a.EXT_feature_metadata)){let u=a.EXT_feature_metadata.featureIdTextures;if(l(u)){let f=u.length;for(let d=0;d<f;++d){let g=u[d].featureIds.texture;g.index>t&&--g.index}}}})});let r=e.extensions.EXT_feature_metadata.featureTextures;for(let o in r)if(r.hasOwnProperty(o)){let a=r[o].properties;if(l(a)){for(let c in a)if(a.hasOwnProperty(c)){let f=a[c].texture;f.index>t&&--f.index}}}}if(Wo(e,"EXT_mesh_features")&&ke.mesh(e,function(i){ke.meshPrimitive(i,function(r){let o=r.extensions;if(l(o)&&l(o.EXT_mesh_features)){let a=o.EXT_mesh_features.featureIds;if(l(a)){let c=a.length;for(let u=0;u<c;++u){let f=a[u];l(f.texture)&&f.texture.index>t&&--f.texture.index}}}})}),Wo(e,"EXT_structural_metadata")){let r=e.extensions.EXT_structural_metadata.propertyTextures;if(l(r)){let o=r.length;for(let s=0;s<o;++s){let c=r[s].properties;for(let u in c)if(c.hasOwnProperty(u)){let f=c[u];f.index>t&&--f.index}}}}};function Qp(){}Qp.accessor=function(e){let t={};return ke.mesh(e,function(n){ke.meshPrimitive(n,function(i){ke.meshPrimitiveAttribute(i,function(o){t[o]=!0}),ke.meshPrimitiveTarget(i,function(o){ke.meshPrimitiveTargetAttribute(o,function(s){t[s]=!0})});let r=i.indices;l(r)&&(t[r]=!0)})}),ke.skin(e,function(n){l(n.inverseBindMatrices)&&(t[n.inverseBindMatrices]=!0)}),ke.animation(e,function(n){ke.animationSampler(n,function(i){l(i.input)&&(t[i.input]=!0),l(i.output)&&(t[i.output]=!0)})}),Wo(e,"EXT_mesh_gpu_instancing")&&ke.node(e,function(n){l(n.extensions)&&l(n.extensions.EXT_mesh_gpu_instancing)&&Object.keys(n.extensions.EXT_mesh_gpu_instancing.attributes).forEach(function(i){let r=n.extensions.EXT_mesh_gpu_instancing.attributes[i];t[r]=!0})}),Wo(e,"CESIUM_primitive_outline")&&ke.mesh(e,function(n){ke.meshPrimitive(n,function(i){let r=i.extensions;if(l(r)&&l(r.CESIUM_primitive_outline)){let s=r.CESIUM_primitive_outline.indices;l(s)&&(t[s]=!0)}})}),t};Qp.buffer=function(e){let t={};return ke.bufferView(e,function(n){l(n.buffer)&&(t[n.buffer]=!0);let i=n.extensions;if(l(i)){let r=i.EXT_meshopt_compression;l(r)&&(t[r.buffer]=!0);let o=i.KHR_meshopt_compression;l(o)&&(t[o.buffer]=!0)}}),t};Qp.bufferView=function(e){let t={};if(ke.accessor(e,function(n){l(n.bufferView)&&(t[n.bufferView]=!0)}),ke.shader(e,function(n){l(n.bufferView)&&(t[n.bufferView]=!0)}),ke.image(e,function(n){l(n.bufferView)&&(t[n.bufferView]=!0)}),Wo(e,"KHR_draco_mesh_compression")&&ke.mesh(e,function(n){ke.meshPrimitive(n,function(i){l(i.extensions)&&l(i.extensions.KHR_draco_mesh_compression)&&(t[i.extensions.KHR_draco_mesh_compression.bufferView]=!0)})}),Wo(e,"EXT_feature_metadata")){let i=e.extensions.EXT_feature_metadata.featureTables;for(let r in i)if(i.hasOwnProperty(r)){let s=i[r].properties;if(l(s)){for(let a in s)if(s.hasOwnProperty(a)){let c=s[a];l(c.bufferView)&&(t[c.bufferView]=!0),l(c.arrayOffsetBufferView)&&(t[c.arrayOffsetBufferView]=!0),l(c.stringOffsetBufferView)&&(t[c.stringOffsetBufferView]=!0)}}}}if(Wo(e,"EXT_structural_metadata")){let i=e.extensions.EXT_structural_metadata.propertyTables;if(l(i)){let r=i.length;for(let o=0;o<r;++o){let a=i[o].properties;for(let c in a)if(a.hasOwnProperty(c)){let u=a[c];l(u.values)&&(t[u.values]=!0),l(u.arrayOffsets)&&(t[u.arrayOffsets]=!0),l(u.stringOffsets)&&(t[u.stringOffsets]=!0)}}}}return t};Qp.image=function(e){let t={};return ke.texture(e,function(n){l(n.source)&&(t[n.source]=!0),l(n.extensions)&&l(n.extensions.EXT_texture_webp)?t[n.extensions.EXT_texture_webp.source]=!0:l(n.extensions)&&l(n.extensions.KHR_texture_basisu)&&(t[n.extensions.KHR_texture_basisu.source]=!0)}),t};Qp.mesh=function(e){let t={};return ke.node(e,function(n){if(l(n.mesh&&l(e.meshes))){let i=e.meshes[n.mesh];l(i)&&l(i.primitives)&&i.primitives.length>0&&(t[n.mesh]=!0)}}),t};function Bbe(e,t,n){let i=e.nodes[t];return l(i.mesh)||l(i.camera)||l(i.skin)||l(i.weights)||l(i.extras)||l(i.extensions)&&Object.keys(i.extensions).length!==0||l(n[t])?!1:!l(i.children)||i.children.filter(function(r){return!Bbe(e,r,n)}).length===0}Qp.node=function(e){let t={};return ke.skin(e,function(n){l(n.skeleton)&&(t[n.skeleton]=!0),ke.skinJoint(n,function(i){t[i]=!0})}),ke.animation(e,function(n){ke.animationChannel(n,function(i){l(i.target)&&l(i.target.node)&&(t[i.target.node]=!0)})}),ke.technique(e,function(n){ke.techniqueUniform(n,function(i){l(i.node)&&(t[i.node]=!0)})}),ke.node(e,function(n,i){Bbe(e,i,t)||(t[i]=!0)}),t};Qp.material=function(e){let t={};return ke.mesh(e,function(n){ke.meshPrimitive(n,function(i){l(i.material)&&(t[i.material]=!0)})}),t};Qp.texture=function(e){let t={};if(ke.material(e,function(n){qS(n,function(i){t[i]=!0})}),Wo(e,"EXT_feature_metadata")){ke.mesh(e,function(r){ke.meshPrimitive(r,function(o){let s=o.extensions;if(l(s)&&l(s.EXT_feature_metadata)){let c=s.EXT_feature_metadata.featureIdTextures;if(l(c)){let u=c.length;for(let f=0;f<u;++f){let p=c[f].featureIds.texture;t[p.index]=!0}}}})});let i=e.extensions.EXT_feature_metadata.featureTextures;for(let r in i)if(i.hasOwnProperty(r)){let s=i[r].properties;if(l(s)){for(let a in s)if(s.hasOwnProperty(a)){let u=s[a].texture;t[u.index]=!0}}}}if(Wo(e,"EXT_mesh_features")&&ke.mesh(e,function(n){ke.meshPrimitive(n,function(i){let r=i.extensions;if(l(r)&&l(r.EXT_mesh_features)){let s=r.EXT_mesh_features.featureIds;if(l(s)){let a=s.length;for(let c=0;c<a;++c){let u=s[c];l(u.texture)&&(t[u.texture.index]=!0)}}}})}),Wo(e,"EXT_structural_metadata")){let i=e.extensions.EXT_structural_metadata.propertyTextures;if(l(i)){let r=i.length;for(let o=0;o<r;++o){let a=i[o].properties;for(let c in a)if(a.hasOwnProperty(c)){let u=a[c];t[u.index]=!0}}}}return t};Qp.sampler=function(e){let t={};return ke.texture(e,function(n){l(n.sampler)&&(t[n.sampler]=!0)}),t};var yF=att;function utt(e,t){let n={byteLength:t.length,extras:{_pipeline:{source:t}}},r={buffer:Ta(e.buffers,n),byteOffset:0,byteLength:t.length};return Ta(e.bufferViews,r)}var AF=utt;function ftt(e,t){let n=ju(e,t),i=Y.getSizeInBytes(t.componentType),r=Hf(t.type),o=t.count,s=new Array(r*o);if(!l(t.bufferView))return s.fill(0);let a=e.bufferViews[t.bufferView],c=e.buffers[a.buffer].extras._pipeline.source,u=t.byteOffset+a.byteOffset+c.byteOffset,f=new DataView(c.buffer),d=new Array(r),p=qg(t.componentType);for(let g=0;g<o;++g){p(f,u,r,i,d);for(let m=0;m<r;++m)s[g*r+m]=d[m];u+=n}return s}var bF=ftt;function dtt(e){let t;return ke.accessorWithSemantic(e,"JOINTS_0",function(n){let i=e.accessors[n];t=i.componentType,t===te.BYTE?MH(e,i,Y.UNSIGNED_BYTE):t!==te.UNSIGNED_BYTE&&t!==te.UNSIGNED_SHORT&&MH(e,i,Y.UNSIGNED_SHORT)}),ke.accessorWithSemantic(e,"WEIGHTS_0",function(n){let i=e.accessors[n];t=i.componentType,t===te.BYTE?MH(e,i,Y.UNSIGNED_BYTE):t===te.SHORT&&MH(e,i,Y.UNSIGNED_SHORT)}),e}function MH(e,t,n){let i=Y.createTypedArray(n,bF(e,t)),r=new Uint8Array(i.buffer);t.bufferView=AF(e,r),t.componentType=n,t.byteOffset=0}var xF=dtt;function htt(e,t){return wT(e,t),t==="CESIUM_RTC"&&mtt(e),KJ(e,t)}function mtt(e){ke.technique(e,function(t){ke.techniqueUniform(t,function(n){n.semantic==="CESIUM_RTC_MODELVIEW"&&(n.semantic="MODELVIEW")})})}function KJ(e,t){if(Array.isArray(e)){let n=e.length;for(let i=0;i<n;++i)KJ(e[i],t)}else if(e!==null&&typeof e=="object"&&e.constructor===Object){let n=e.extensions,i;l(n)&&(i=n[t],l(i)&&(delete n[t],Object.keys(n).length===0&&delete e.extensions));for(let r in e)Object.prototype.hasOwnProperty.call(e,r)&&KJ(e[r],t);return i}}var DT=htt;var NH={.8:btt,"1.0":Vtt,"2.0":void 0};function ptt(e,t){t=t??{};let n=t.targetVersion,i=e.version;e.asset=e.asset??{version:"1.0"},e.asset.version=e.asset.version??"1.0",i=(i??e.asset.version).toString(),Object.prototype.hasOwnProperty.call(NH,i)||(l(i)&&(i=i.substring(0,3)),Object.prototype.hasOwnProperty.call(NH,i)||(i="1.0"));let r=NH[i];for(;l(r)&&i!==n;)r(e,t),i=e.asset.version,r=NH[i];return t.keepLegacyExtensions||(Gtt(e,t),Wtt(e)),e}function zbe(e){let t=e.materials;for(let n in t)if(Object.prototype.hasOwnProperty.call(t,n)){let i=t[n],r=i.instanceTechnique;l(r)&&(i.technique=r.technique,i.values=r.values,delete i.instanceTechnique)}}function gtt(e){let t=e.meshes;for(let n in t)if(Object.prototype.hasOwnProperty.call(t,n)){let r=t[n].primitives;if(l(r)){let o=r.length;for(let s=0;s<o;++s){let a=r[s],c=a.primitive??te.TRIANGLES;a.mode=a.mode??c,delete a.primitive}}}}function _tt(e){let t=e.nodes,n=new h,i=new Le;for(let r in t)if(Object.prototype.hasOwnProperty.call(t,r)){let o=t[r];if(l(o.rotation)){let a=o.rotation;h.fromArray(a,0,n),Le.fromAxisAngle(n,a[3],i),o.rotation=[i.x,i.y,i.z,i.w]}let s=o.instanceSkin;l(s)&&(o.skeletons=s.skeletons,o.skin=s.skin,o.meshes=s.meshes,delete o.instanceSkin)}}function ytt(e){let t=e.animations,n=e.accessors,i=e.bufferViews,r=e.buffers,o={},s=new h,a=new Le;for(let c in t)if(Object.prototype.hasOwnProperty.call(t,c)){let u=t[c],f=u.channels,d=u.parameters,p=u.samplers;if(l(f)){let g=f.length;for(let m=0;m<g;++m){let y=f[m];if(y.target.path==="rotation"){let A=d[p[y.sampler].output];if(l(o[A]))continue;o[A]=!0;let b=n[A],x=i[b.bufferView],E=r[x.buffer].extras._pipeline.source,v=E.byteOffset+x.byteOffset+b.byteOffset,S=b.componentType,I=b.count,R=Hf(b.type),O=b.count*R,L=Y.createArrayBufferView(S,E.buffer,v,O);for(let _=0;_<I;_++){let C=_*R;h.unpack(L,C,s);let w=L[C+3];Le.fromAxisAngle(s,w,a),Le.pack(a,L,C)}}}}}}function Att(e){let t=e.techniques;for(let n in t)if(Object.prototype.hasOwnProperty.call(t,n)){let i=t[n],r=i.passes;if(l(r)){let o=i.pass??"defaultPass";if(Object.prototype.hasOwnProperty.call(r,o)){let s=r[o],a=s.instanceProgram;i.attributes=i.attributes??a.attributes,i.program=i.program??a.program,i.uniforms=i.uniforms??a.uniforms,i.states=i.states??s.states}delete i.passes,delete i.pass}}}function btt(e){l(e.asset)||(e.asset={});let t=e.asset;if(t.version="1.0",typeof t.profile=="string"){let n=t.profile.split(" ");t.profile={api:n[0],version:n[1]}}else t.profile={};if(l(e.version)&&delete e.version,zbe(e),gtt(e),_tt(e),ytt(e),Att(e),l(e.allExtensions)&&(e.extensionsUsed=e.allExtensions,delete e.allExtensions),l(e.lights)){let n=e.extensions??{};e.extensions=n;let i=n.KHR_materials_common??{};n.KHR_materials_common=i,i.lights=e.lights,delete e.lights,Jd(e,"KHR_materials_common")}}function xtt(e){let t=e.animations;for(let n in t)if(Object.prototype.hasOwnProperty.call(t,n)){let i=t[n],r=i.parameters;if(l(r)){let o=i.samplers;for(let s in o)if(Object.prototype.hasOwnProperty.call(o,s)){let a=o[s];a.input=r[a.input],a.output=r[a.output]}delete i.parameters}}}function kbe(e,t){let n=[];for(let i in e)if(Object.prototype.hasOwnProperty.call(e,i)){let r=e[i];t[i]=n.length,n.push(r),l(r.name)||(r.name=i)}return n}function Ttt(e){let t,n={accessors:{},animations:{},buffers:{},bufferViews:{},cameras:{},images:{},materials:{},meshes:{},nodes:{},programs:{},samplers:{},scenes:{},shaders:{},skins:{},textures:{},techniques:{}},i,r={},o=e.nodes;for(let s in o)Object.prototype.hasOwnProperty.call(o,s)&&(i=o[s].jointName,l(i)&&(r[i]=s));for(let s in e)if(Object.prototype.hasOwnProperty.call(e,s)&&l(n[s])){let a={},c=e[s];e[s]=kbe(c,a),n[s]=a}for(i in r)Object.prototype.hasOwnProperty.call(r,i)&&(r[i]=n.nodes[r[i]]);l(e.scene)&&(e.scene=n.scenes[e.scene]),ke.bufferView(e,function(s){l(s.buffer)&&(s.buffer=n.buffers[s.buffer])}),ke.accessor(e,function(s){l(s.bufferView)&&(s.bufferView=n.bufferViews[s.bufferView])}),ke.shader(e,function(s){let a=s.extensions;if(l(a)){let c=a.KHR_binary_glTF;l(c)&&(s.bufferView=n.bufferViews[c.bufferView],delete a.KHR_binary_glTF),Object.keys(a).length===0&&delete s.extensions}}),ke.program(e,function(s){l(s.vertexShader)&&(s.vertexShader=n.shaders[s.vertexShader]),l(s.fragmentShader)&&(s.fragmentShader=n.shaders[s.fragmentShader])}),ke.technique(e,function(s){l(s.program)&&(s.program=n.programs[s.program]),ke.techniqueParameter(s,function(a){l(a.node)&&(a.node=n.nodes[a.node]);let c=a.value;typeof c=="string"&&(a.value={index:n.textures[c]})})}),ke.mesh(e,function(s){ke.meshPrimitive(s,function(a){l(a.indices)&&(a.indices=n.accessors[a.indices]),ke.meshPrimitiveAttribute(a,function(c,u){a.attributes[u]=n.accessors[c]}),l(a.material)&&(a.material=n.materials[a.material])})}),ke.node(e,function(s){let a=s.children;if(l(a)){let c=a.length;for(t=0;t<c;++t)a[t]=n.nodes[a[t]]}if(l(s.meshes)){let c=s.meshes,u=c.length;if(u>0)for(s.mesh=n.meshes[c[0]],t=1;t<u;++t){let f={mesh:n.meshes[c[t]]},d=Ta(e.nodes,f);l(a)||(a=[],s.children=a),a.push(d)}delete s.meshes}if(l(s.camera)&&(s.camera=n.cameras[s.camera]),l(s.skin)&&(s.skin=n.skins[s.skin]),l(s.skeletons)){let c=s.skeletons;if(c.length>0&&l(s.skin)){let f=e.skins[s.skin];f.skeleton=n.nodes[c[0]]}delete s.skeletons}l(s.jointName)&&delete s.jointName}),ke.skin(e,function(s){l(s.inverseBindMatrices)&&(s.inverseBindMatrices=n.accessors[s.inverseBindMatrices]);let a=s.jointNames;if(l(a)){let c=[],u=a.length;for(t=0;t<u;++t)c[t]=r[a[t]];s.joints=c,delete s.jointNames}}),ke.scene(e,function(s){let a=s.nodes;if(l(a)){let c=a.length;for(t=0;t<c;++t)a[t]=n.nodes[a[t]]}}),ke.animation(e,function(s){let a={};s.samplers=kbe(s.samplers,a),ke.animationSampler(s,function(c){c.input=n.accessors[c.input],c.output=n.accessors[c.output]}),ke.animationChannel(s,function(c){c.sampler=a[c.sampler];let u=c.target;l(u)&&(u.node=n.nodes[u.id],delete u.id)})}),ke.material(e,function(s){l(s.technique)&&(s.technique=n.techniques[s.technique]),ke.materialValue(s,function(c,u){typeof c=="string"&&(s.values[u]={index:n.textures[c]})});let a=s.extensions;if(l(a)){let c=a.KHR_materials_common;l(c)&&l(c.values)&&ke.materialValue(c,function(u,f){typeof u=="string"&&(c.values[f]={index:n.textures[u]})})}}),ke.image(e,function(s){let a=s.extensions;if(l(a)){let c=a.KHR_binary_glTF;l(c)&&(s.bufferView=n.bufferViews[c.bufferView],s.mimeType=c.mimeType,delete a.KHR_binary_glTF),Object.keys(a).length===0&&delete s.extensions}}),ke.texture(e,function(s){l(s.sampler)&&(s.sampler=n.samplers[s.sampler]),l(s.source)&&(s.source=n.images[s.source])})}function Ett(e){ke.animation(e,function(t){ke.animationSampler(t,function(n){delete n.name})})}function Ctt(e){for(let t in e)if(Object.prototype.hasOwnProperty.call(e,t)){let n=e[t];Array.isArray(n)&&n.length===0&&delete e[t]}ke.node(e,function(t){l(t.children)&&t.children.length===0&&delete t.children})}function vtt(e){let t=e.asset;delete t.profile,delete t.premultipliedAlpha}var Stt={CESIUM_RTC:!0,KHR_materials_common:!0,WEB3D_quantized_attributes:!0};function wtt(e){let t=e.extensionsUsed;if(e.extensionsRequired=e.extensionsRequired??[],l(t)){let n=t.length;for(let i=0;i<n;++i){let r=t[i];l(Stt[r])&&e.extensionsRequired.push(r)}}}function Itt(e){ke.buffer(e,function(t){delete t.type})}function Ptt(e){ke.texture(e,function(t){delete t.format,delete t.internalFormat,delete t.target,delete t.type})}function Dtt(e){ke.mesh(e,function(t){ke.meshPrimitive(t,function(n){ke.meshPrimitiveAttribute(n,function(i,r){r==="TEXCOORD"?n.attributes.TEXCOORD_0=i:r==="COLOR"&&(n.attributes.COLOR_0=i)}),delete n.attributes.TEXCOORD,delete n.attributes.COLOR})}),ke.technique(e,function(t){ke.techniqueParameter(t,function(n){let i=n.semantic;l(i)&&(i==="TEXCOORD"?n.semantic="TEXCOORD_0":i==="COLOR"&&(n.semantic="COLOR_0"))})})}var Rtt={POSITION:!0,NORMAL:!0,TANGENT:!0},Ott={COLOR:"COLOR",JOINT:"JOINTS",JOINTS:"JOINTS",TEXCOORD:"TEXCOORD",WEIGHT:"WEIGHTS",WEIGHTS:"WEIGHTS"};function Mtt(e){let t={};ke.mesh(e,function(n){ke.meshPrimitive(n,function(i){ke.meshPrimitiveAttribute(i,function(r,o){if(o.charAt(0)!=="_"){let s=o.search(/_[0-9]+/g),a=o,c="_0";s>=0&&(a=o.substring(0,s),c=o.substring(s));let u,f=Ott[a];l(f)?(u=f+c,t[o]=u):l(Rtt[a])||(u=`_${o}`,t[o]=u)}});for(let r in t)if(Object.prototype.hasOwnProperty.call(t,r)){let o=t[r],s=i.attributes[r];l(s)&&(delete i.attributes[r],i.attributes[o]=s)}})}),ke.technique(e,function(n){ke.techniqueParameter(n,function(i){let r=t[i.semantic];l(r)&&(i.semantic=r)})})}function Ntt(e){ke.camera(e,function(t){let n=t.perspective;if(l(n)){let i=n.aspectRatio;l(i)&&i===0&&delete n.aspectRatio;let r=n.yfov;l(r)&&r===0&&(n.yfov=1)}})}function JJ(e,t){return l(t.byteStride)&&t.byteStride!==0?t.byteStride:ju(e,t)}function Ltt(e){ke.buffer(e,function(t){l(t.byteLength)||(t.byteLength=t.extras._pipeline.source.length)}),ke.accessor(e,function(t){let n=t.bufferView;if(l(n)){let i=e.bufferViews[n],r=JJ(e,t),o=t.byteOffset+t.count*r;i.byteLength=Math.max(i.byteLength??0,o)}})}function Ftt(e){let t,n,i,r=e.bufferViews,o={};ke.accessorContainingVertexAttributeData(e,function(a){let c=e.accessors[a];l(c.bufferView)&&(o[c.bufferView]=!0)});let s={};ke.accessor(e,function(a){l(a.bufferView)&&(s[a.bufferView]=s[a.bufferView]??[],s[a.bufferView].push(a))});for(let a in s)if(Object.prototype.hasOwnProperty.call(s,a)){i=r[a];let c=s[a];c.sort(function(p,g){return p.byteOffset-g.byteOffset});let u=0,f=0,d=c.length;for(t=0;t<d;++t){let p=c[t],g=JJ(e,p),m=p.byteOffset,y=p.count*g;delete p.byteStride;let A=t<d-1,b=A?JJ(e,c[t+1]):void 0;if(g!==b){let x=Je(i,!0);o[a]&&(x.byteStride=g),x.byteOffset+=u,x.byteLength=m+y-u;let T=Ta(r,x);for(n=f;n<=t;++n)p=c[n],p.bufferView=T,p.byteOffset=p.byteOffset-u;u=A?c[t+1].byteOffset:void 0,f=t+1}}}yF(e,["accessor","bufferView","buffer"])}function Btt(e){ke.accessorWithSemantic(e,"POSITION",function(t){let n=e.accessors[t];if(!l(n.min)||!l(n.max)){let i=PT(e,n);n.min=i.min,n.max=i.max}})}function Vbe(e){return(!l(e.children)||e.children.length===0)&&(!l(e.meshes)||e.meshes.length===0)&&!l(e.camera)&&!l(e.skin)&&!l(e.skeletons)&&!l(e.jointName)&&(!l(e.translation)||h.fromArray(e.translation).equals(h.ZERO))&&(!l(e.scale)||h.fromArray(e.scale).equals(new h(1,1,1)))&&(!l(e.rotation)||se.fromArray(e.rotation).equals(new se(0,0,0,1)))&&(!l(e.matrix)||N.fromColumnMajorArray(e.matrix).equals(N.IDENTITY))&&!l(e.extensions)&&!l(e.extras)}function jbe(e,t){ke.scene(e,function(n){let i=n.nodes;if(l(i)){let r=i.length;for(let o=r;o>=0;--o)if(i[o]===t){i.splice(o,1);return}}}),ke.node(e,function(n,i){if(l(n.children)){let r=n.children.indexOf(t);r>-1&&(n.children.splice(r,1),Vbe(n)&&jbe(e,i))}}),delete e.nodes[t]}function ktt(e){return ke.node(e,function(t,n){Vbe(t)&&jbe(e,n)}),e}function Utt(e){ke.animation(e,function(t){ke.animationSampler(t,function(n){let i=e.accessors[n.input];if(!l(i.min)||!l(i.max)){let r=PT(e,i);i.min=r.min,i.max=r.max}})})}function ztt(e){ke.accessor(e,function(t){if(l(t.min)||l(t.max)){let n=PT(e,t);l(t.min)&&(t.min=n.min),l(t.max)&&(t.max=n.max)}})}function Vtt(e){e.asset=e.asset??{},e.asset.version="2.0",zbe(e),xtt(e),ktt(e),Ttt(e),Ett(e),vtt(e),wtt(e),Ltt(e),Ftt(e),Btt(e),Utt(e),ztt(e),Itt(e),Ptt(e),Dtt(e),Mtt(e),xF(e),Ntt(e),pF(e),_F(e),Ctt(e)}var jtt=["u_tex","u_diffuse","u_emission","u_diffuse_tex"],Htt=["u_diffuse","u_diffuse_mat"];function ZJ(e){e.pbrMetallicRoughness=l(e.pbrMetallicRoughness)?e.pbrMetallicRoughness:{},e.pbrMetallicRoughness.roughnessFactor=1,e.pbrMetallicRoughness.metallicFactor=0}function QJ(e){return l(e.index)}function eZ(e){return Array.isArray(e)&&e.length===4}function Hbe(e){let t=new Array(4);t[3]=e[3];for(let n=0;n<3;n++){let i=e[n];i<=.04045?t[n]=e[n]*.07739938080495357:t[n]=Math.pow((i+.055)*.9478672985781991,2.4)}return t}function Gtt(e,t){t=t??{};let n=t.baseColorTextureNames??jtt,i=t.baseColorFactorNames??Htt;ke.material(e,function(r){ke.materialValue(r,function(o,s){n.indexOf(s)!==-1&&QJ(o)?(ZJ(r),r.pbrMetallicRoughness.baseColorTexture=o):i.indexOf(s)!==-1&&eZ(o)&&(ZJ(r),r.pbrMetallicRoughness.baseColorFactor=Hbe(o))})}),DT(e,"KHR_techniques_webgl"),DT(e,"KHR_blend")}function $J(e,t){l(t)&&(eZ(t)?e.pbrMetallicRoughness.baseColorFactor=Hbe(t):QJ(t)&&(e.pbrMetallicRoughness.baseColorTexture=t))}function Ube(e,t){l(t)&&(eZ(t)?e.emissiveFactor=t.slice(0,3):QJ(t)&&(e.emissiveTexture=t))}function Wtt(e){ke.material(e,function(t){let n=(t.extensions??{}).KHR_materials_common;if(!l(n))return;let i=n.values??{},r=i.ambient,o=i.diffuse,s=i.emission,a=i.transparency,c=n.doubleSided,u=n.transparent;ZJ(t),n.technique==="CONSTANT"?(Jd(e,"KHR_materials_unlit"),t.extensions=l(t.extensions)?t.extensions:{},t.extensions.KHR_materials_unlit={},$J(t,s),$J(t,r)):($J(t,o),Ube(t,r),Ube(t,s)),l(c)&&(t.doubleSided=c),l(a)&&(l(t.pbrMetallicRoughness.baseColorFactor)?t.pbrMetallicRoughness.baseColorFactor[3]*=a:t.pbrMetallicRoughness.baseColorFactor=[1,1,1,a]),l(u)&&(t.alphaMode=u?"BLEND":"OPAQUE")}),DT(e,"KHR_materials_common")}var TF=ptt;var e0={X:0,Y:1,Z:2};e0.Y_UP_TO_Z_UP=N.fromRotationTranslation($.fromArray([1,0,0,0,0,1,0,-1,0]));e0.Z_UP_TO_Y_UP=N.fromRotationTranslation($.fromArray([1,0,0,0,0,-1,0,1,0]));e0.X_UP_TO_Z_UP=N.fromRotationTranslation($.fromArray([0,0,1,0,1,0,-1,0,0]));e0.Z_UP_TO_X_UP=N.fromRotationTranslation($.fromArray([0,0,-1,0,1,0,1,0,0]));e0.X_UP_TO_Y_UP=N.fromRotationTranslation($.fromArray([0,1,0,-1,0,0,0,0,1]));e0.Y_UP_TO_X_UP=N.fromRotationTranslation($.fromArray([0,-1,0,1,0,0,0,0,1]));e0.fromName=function(e){return e0[e]};Object.freeze(e0);var Hi=e0;function dl(){}dl.getError=function(e,t,n){let i=`Failed to load ${e}: ${t}`;l(n)&&l(n.message)&&(i+=` ${n.message}`);let r=new oe(i);return l(n)&&(r.stack=`Original stack: ${n.stack} Handler stack: -${r.stack}`),r};ol.getNodeTransform=function(e){return l(e.matrix)?e.matrix:N.fromTranslationQuaternionRotationScale(l(e.translation)?e.translation:h.ZERO,l(e.rotation)?e.rotation:Le.IDENTITY,l(e.scale)?e.scale:h.ONE)};ol.getAttributeBySemantic=function(e,t,n){let i=e.attributes,r=i.length;for(let o=0;o<r;++o){let s=i[o],a=l(n)?s.setIndex===n:!0;if(s.semantic===t&&a)return s}};ol.getAttributeByName=function(e,t){let n=e.attributes,i=n.length;for(let r=0;r<i;++r){let o=n[r];if(o.name===t)return o}};ol.getFeatureIdsByLabel=function(e,t){for(let n=0;n<e.length;n++){let i=e[n];if(i.positionalLabel===t||i.label===t)return i}};ol.hasQuantizedAttributes=function(e){if(!l(e))return!1;for(let t=0;t<e.length;t++){let n=e[t];if(l(n.quantization))return!0}return!1};ol.getAttributeInfo=function(e){let t=e.semantic,n=e.setIndex,i,r=!1;l(t)?(i=ct.getVariableName(t,n),r=!0):(i=e.name,i=i.replace(/^_/,""),i=i.toLowerCase());let o=/^color_\d+$/.test(i),s=e.type,a=Vt.getGlslType(s);o&&(a="vec4");let c=l(e.quantization),u;return c&&(u=o?"vec4":Vt.getGlslType(e.quantization.type)),{attribute:e,isQuantized:c,variableName:i,hasSemantic:r,glslType:a,quantizedGlslType:u}};var KKe=new h,$Ke=new h;ol.getPositionMinMax=function(e,t,n){let i=ol.getAttributeBySemantic(e,"POSITION"),r=i.max,o=i.min;return l(n)&&l(t)&&(o=h.add(o,t,$Ke),r=h.add(r,n,KKe)),{min:o,max:r}};ol.getAxisCorrectionMatrix=function(e,t,n){return n=N.clone(N.IDENTITY,n),e===Hi.Y?n=N.clone(Hi.Y_UP_TO_Z_UP,n):e===Hi.X&&(n=N.clone(Hi.X_UP_TO_Z_UP,n)),t===Hi.Z&&(n=N.multiplyTransformation(n,Hi.Z_UP_TO_X_UP,n)),n};var JKe=new $;ol.getCullFace=function(e,t){if(!Oe.isTriangles(t))return Vi.BACK;let n=N.getMatrix3(e,JKe);return $.determinant(n)<0?Vi.FRONT:Vi.BACK};ol.sanitizeGlslIdentifier=function(e){let t=e.replaceAll(/[^A-Za-z0-9]+/g,"_");return t=t.replace(/^gl_/,""),/^\d/.test(t)&&(t=`_${t}`),t};ol.supportedExtensions={AGI_articulations:!0,CESIUM_mesh_vector:!0,CESIUM_primitive_outline:!0,CESIUM_RTC:!0,EXT_feature_metadata:!0,EXT_implicit_cylinder_region:!0,EXT_implicit_ellipsoid_region:!0,EXT_instance_features:!0,EXT_mesh_features:!0,EXT_mesh_gpu_instancing:!0,EXT_mesh_polygon:!0,EXT_mesh_primitive_edge_visibility:!0,EXT_meshopt_compression:!0,EXT_primitive_voxels:!0,EXT_structural_metadata:!0,EXT_texture_webp:!0,KHR_blend:!0,KHR_draco_mesh_compression:!0,KHR_implicit_shapes:!0,KHR_materials_common:!0,KHR_materials_pbrSpecularGlossiness:!0,KHR_materials_specular:!0,KHR_materials_anisotropy:!0,KHR_materials_clearcoat:!0,KHR_materials_unlit:!0,KHR_mesh_quantization:!0,KHR_mesh_primitive_restart:!0,KHR_meshopt_compression:!0,KHR_techniques_webgl:!0,KHR_texture_basisu:!0,KHR_texture_transform:!0,KHR_gaussian_splatting:!0,KHR_gaussian_splatting_compression_spz_2:!0,WEB3D_quantized_attributes:!0};ol.checkSupportedExtensions=function(e){let t=e.length;for(let n=0;n<t;n++){let i=e[n];if(!ol.supportedExtensions[i])throw new oe(`Unsupported glTF Extension: ${i}`)}};var xt=ol;var d$=class extends nr{constructor(t){super(),t=t??H.EMPTY_OBJECT;let n=t.resourceCache,i=t.gltfResource,r=t.baseResource,o=t.typedArray,s=t.gltfJson,a=t.cacheKey;this._resourceCache=n,this._gltfResource=i,this._baseResource=r,this._typedArray=o,this._gltfJson=s,this._cacheKey=a,this._gltf=void 0,this._bufferLoaders=[],this._state=Tt.UNLOADED,this._promise=void 0}get cacheKey(){return this._cacheKey}get gltf(){return this._gltf}async load(){return l(this._promise)?this._promise:(this._state=Tt.LOADING,l(this._gltfJson)?(this._promise=uge(this,this._gltfJson),this._promise):l(this._typedArray)?(this._promise=fge(this,this._typedArray),this._promise):(this._promise=ZKe(this),this._promise))}unload(){let t=this._bufferLoaders,n=t.length;for(let i=0;i<n;++i)t[i]=!t[i].isDestroyed()&&this._resourceCache.unload(t[i]);this._bufferLoaders.length=0,this._gltf=void 0}_fetchGltf(){return this._gltfResource.fetchArrayBuffer()}};async function ZKe(e){let t;try{let n=await e._fetchGltf();if(e.isDestroyed())return;t=new Uint8Array(n)}catch(n){if(e.isDestroyed())return;h$(e,n)}return fge(e,t)}function h$(e,t){e.unload(),e._state=Tt.FAILED;let n=`Failed to load glTF: ${e._gltfResource.url}`;throw e.getError(n,t)}async function QKe(e,t){if(l(t.asset)&&t.asset.version==="2.0"&&!Go(t,"KHR_techniques_webgl")&&!Go(t,"KHR_materials_common"))return Promise.resolve();let n=[];ke.buffer(t,function(i){if(!l(i.extras._pipeline.source)&&l(i.uri)){let r=e._baseResource.getDerivedResource({url:i.uri}),s=e._resourceCache.getExternalBufferLoader({resource:r});e._bufferLoaders.push(s),n.push(s.load().then(function(){s.isDestroyed()||(i.extras._pipeline.source=s.typedArray)}))}}),await Promise.all(n),mL(t)}function e$e(e){let t=[];return ke.buffer(e,function(n){let i=n.uri;!l(n.extras._pipeline.source)&&l(i)&&Uh(i)&&(delete n.uri,t.push(De.fetchArrayBuffer(i).then(function(r){n.extras._pipeline.source=new Uint8Array(r)})))}),Promise.all(t)}function t$e(e,t){let n=[];return ke.buffer(t,function(i,r){let o=i.extras._pipeline.source;if(l(o)&&!l(i.uri)){let a=e._resourceCache.getEmbeddedBufferLoader({parentResource:e._gltfResource,bufferId:r,typedArray:o});e._bufferLoaders.push(a),n.push(a.load())}}),Promise.all(n)}async function uge(e,t){try{aA(t),await e$e(t),await QKe(e,t),rL(t),await t$e(e,t),sL(t);let n=t.asset.version;if(n!=="1.0"&&n!=="2.0")throw new oe(`Unsupported glTF version: ${n}`);let i=t.extensionsRequired;return l(i)&&xt.checkSupportedExtensions(i),e._gltf=t,e._state=Tt.READY,e}catch(n){if(e.isDestroyed())return;h$(e,n)}}async function fge(e,t){let n;try{om(t)==="glTF"?n=cT(t):n=Ro(t)}catch(i){if(e.isDestroyed())return;h$(e,i)}return uge(e,n)}var iS=d$;var dge={OPAQUE:"OPAQUE",MASK:"MASK",BLEND:"BLEND"};Object.freeze(dge);var Gp=dge;var Pr={},m$=class{constructor(){this.octEncoded=!1,this.octEncodedZXY=!1,this.normalizationRange=void 0,this.quantizedVolumeOffset=void 0,this.quantizedVolumeDimensions=void 0,this.quantizedVolumeStepSize=void 0,this.componentDatatype=void 0,this.type=void 0}},p$=class{constructor(){this.name=void 0,this.semantic=void 0,this.setIndex=void 0,this.componentDatatype=void 0,this.type=void 0,this.normalized=!1,this.count=void 0,this.min=void 0,this.max=void 0,this.constant=void 0,this.quantization=void 0,this.typedArray=void 0,this.buffer=void 0,this.byteOffset=0,this.byteStride=void 0}},g$=class{constructor(){this.indexDatatype=void 0,this.count=void 0,this.buffer=void 0,this.typedArray=void 0}},_$=class{constructor(){this.featureCount=void 0,this.nullFeatureId=void 0,this.propertyTableId=void 0,this.setIndex=void 0,this.label=void 0,this.positionalLabel=void 0}},y$=class{constructor(){this.featureCount=void 0,this.nullFeatureId=void 0,this.propertyTableId=void 0,this.offset=0,this.repeat=void 0,this.label=void 0,this.positionalLabel=void 0}},A$=class{constructor(){this.featureCount=void 0,this.nullFeatureId=void 0,this.propertyTableId=void 0,this.textureReader=void 0,this.label=void 0,this.positionalLabel=void 0}},b$=class{constructor(){this.attributes=[]}},x$=class{constructor(){this.attributes=[],this.morphTargets=[],this.indices=void 0,this.material=void 0,this.primitiveType=void 0,this.polygon=void 0,this.vector=void 0,this.featureIds=[],this.propertyTextureIds=[],this.propertyAttributeIds=[],this.outlineCoordinates=void 0,this.modelPrimitiveImagery=void 0,this.edgeVisibility=void 0}},T$=class{constructor(){this.attributes=[],this.featureIds=[],this.transformInWorldSpace=!1}},E$=class{constructor(){this.index=void 0,this.joints=[],this.inverseBindMatrices=[]}},C$=class{constructor(){this.name=void 0,this.index=void 0,this.children=[],this.primitives=[],this.instances=void 0,this.skin=void 0,this.matrix=void 0,this.translation=void 0,this.rotation=void 0,this.scale=void 0,this.morphWeights=[],this.articulationName=void 0,this.meshVector=void 0}},v$=class{constructor(){this.nodes=[]}},n$e={TRANSLATION:"translation",ROTATION:"rotation",SCALE:"scale",WEIGHTS:"weights"},S$=class{constructor(){this.input=[],this.interpolation=void 0,this.output=[]}},w$=class{constructor(){this.node=void 0,this.path=void 0}},I$=class{constructor(){this.sampler=void 0,this.target=void 0}},P$=class{constructor(){this.name=void 0,this.samplers=[],this.channels=[]}},D$=class{constructor(){this.name=void 0,this.type=void 0,this.minimumValue=void 0,this.maximumValue=void 0,this.initialValue=void 0}},R$=class{constructor(){this.name=void 0,this.stages=[]}},W6=class{constructor(){this.credits=[]}},O$=class{constructor(){this.asset=new W6,this.scene=void 0,this.nodes=[],this.skins=[],this.animations=[],this.articulations=[],this.structuralMetadata=void 0,this.upAxis=void 0,this.forwardAxis=void 0,this.transform=N.clone(N.IDENTITY),this.extensions={}}},M$=class{constructor(){this.texture=void 0,this.index=void 0,this.texCoord=0,this.transform=$.clone($.IDENTITY),this.scale=1,this.channels=void 0,this.constantLod=void 0}},cA=class cA{constructor(){this.baseColorTexture=void 0,this.metallicRoughnessTexture=void 0,this.baseColorFactor=se.clone(cA.DEFAULT_BASE_COLOR_FACTOR),this.metallicFactor=cA.DEFAULT_METALLIC_FACTOR,this.roughnessFactor=cA.DEFAULT_ROUGHNESS_FACTOR}};ut(cA,"DEFAULT_BASE_COLOR_FACTOR",se.ONE),ut(cA,"DEFAULT_METALLIC_FACTOR",1),ut(cA,"DEFAULT_ROUGHNESS_FACTOR",1);var q6=cA,lA=class lA{constructor(){this.diffuseTexture=void 0,this.specularGlossinessTexture=void 0,this.diffuseFactor=se.clone(lA.DEFAULT_DIFFUSE_FACTOR),this.specularFactor=h.clone(lA.DEFAULT_SPECULAR_FACTOR),this.glossinessFactor=lA.DEFAULT_GLOSSINESS_FACTOR}};ut(lA,"DEFAULT_DIFFUSE_FACTOR",se.ONE),ut(lA,"DEFAULT_SPECULAR_FACTOR",h.ONE),ut(lA,"DEFAULT_GLOSSINESS_FACTOR",1);var N$=lA,rS=class rS{constructor(){this.specularFactor=rS.DEFAULT_SPECULAR_FACTOR,this.specularTexture=void 0,this.specularColorFactor=h.clone(rS.DEFAULT_SPECULAR_COLOR_FACTOR),this.specularColorTexture=void 0}};ut(rS,"DEFAULT_SPECULAR_FACTOR",1),ut(rS,"DEFAULT_SPECULAR_COLOR_FACTOR",h.ONE);var L$=rS,oS=class oS{constructor(){this.anisotropyStrength=oS.DEFAULT_ANISOTROPY_STRENGTH,this.anisotropyRotation=oS.DEFAULT_ANISOTROPY_ROTATION,this.anisotropyTexture=void 0}};ut(oS,"DEFAULT_ANISOTROPY_STRENGTH",0),ut(oS,"DEFAULT_ANISOTROPY_ROTATION",0);var F$=oS,sS=class sS{constructor(){this.clearcoatFactor=sS.DEFAULT_CLEARCOAT_FACTOR,this.clearcoatTexture=void 0,this.clearcoatRoughnessFactor=sS.DEFAULT_CLEARCOAT_ROUGHNESS_FACTOR,this.clearcoatRoughnessTexture=void 0,this.clearcoatNormalTexture=void 0}};ut(sS,"DEFAULT_CLEARCOAT_FACTOR",0),ut(sS,"DEFAULT_CLEARCOAT_ROUGHNESS_FACTOR",0);var B$=sS,k$=class{constructor(){ut(this,"width");ut(this,"pattern")}},Y6=class Y6{constructor(t={}){let{wireframeFill:n=Y6.DEFAULT_WIREFRAME_FILL,backgroundFill:i=!1,behind:r=!1}=t;this.wireframeFill=n,this.backgroundFill=i,this.behind=r}};ut(Y6,"DEFAULT_WIREFRAME_FILL",0);var U$=Y6,X6=class X6{constructor(){this.metallicRoughness=new q6,this.specularGlossiness=void 0,this.specular=void 0,this.anisotropy=void 0,this.clearcoat=void 0,this.emissiveTexture=void 0,this.normalTexture=void 0,this.occlusionTexture=void 0,this.emissiveFactor=h.clone(X6.DEFAULT_EMISSIVE_FACTOR),this.alphaMode=Gp.OPAQUE,this.alphaCutoff=.5,this.doubleSided=!1,this.unlit=!1,this.pointDiameter=void 0,this.planarFill=void 0,this.lineStyle=void 0}};ut(X6,"DEFAULT_EMISSIVE_FACTOR",h.ZERO);var z$=X6,V$=class{constructor(){ut(this,"count",0);ut(this,"triangleIndices");ut(this,"triangleIndicesOffsets");ut(this,"loopIndices");ut(this,"loopIndicesOffsets")}},j$=class{constructor(){ut(this,"vector",!0);ut(this,"count",0);ut(this,"polygonAttributeOffsets");ut(this,"polygonHoleCounts");ut(this,"polygonHoleOffsets");ut(this,"polygonIndicesOffsets")}};Pr.Quantization=m$;Pr.Attribute=p$;Pr.Indices=g$;Pr.FeatureIdAttribute=_$;Pr.FeatureIdTexture=A$;Pr.FeatureIdImplicitRange=y$;Pr.MorphTarget=b$;Pr.Primitive=x$;Pr.Instances=T$;Pr.Skin=E$;Pr.Node=C$;Pr.Scene=v$;Pr.AnimatedPropertyType=Object.freeze(n$e);Pr.AnimationSampler=S$;Pr.AnimationTarget=w$;Pr.AnimationChannel=I$;Pr.Animation=P$;Pr.ArticulationStage=D$;Pr.Articulation=R$;Pr.Asset=W6;Pr.Components=O$;Pr.TextureReader=M$;Pr.MetallicRoughness=q6;Pr.SpecularGlossiness=N$;Pr.Specular=L$;Pr.Anisotropy=F$;Pr.Clearcoat=B$;Pr.PlanarFill=U$;Pr.LineStyle=k$;Pr.Material=z$;Pr.Vector=j$;Pr.Polygon=V$;var Cn=Pr;var K6={};K6.getImageIdFromTexture=function(e){e=e??H.EMPTY_OBJECT;let{gltf:t,textureId:n,supportedImageFormats:i}=e,r=t.textures[n],o=r.extensions;if(l(o)){if(i.webp&&l(o.EXT_texture_webp))return o.EXT_texture_webp.source;if(i.basis&&l(o.KHR_texture_basisu))return o.KHR_texture_basisu.source}return r.source};K6.createSampler=function(e){e=e??H.EMPTY_OBJECT;let{gltf:t,textureInfo:n,compressedTextureNoMipmap:i=!1}=e,r=hn.REPEAT,o=hn.REPEAT,s=Wt.LINEAR,a=Jn.LINEAR,c=n.index,f=t.textures[c].sampler;if(l(f)){let d=t.samplers[f];r=d.wrapS??r,o=d.wrapT??o,s=d.minFilter??s,a=d.magFilter??a}return i&&s!==Wt.LINEAR&&s!==Wt.NEAREST&&(s===Wt.NEAREST_MIPMAP_NEAREST||s===Wt.NEAREST_MIPMAP_LINEAR?s=Wt.NEAREST:s=Wt.LINEAR),hn.validate(r)||(r=hn.REPEAT),hn.validate(o)||(o=hn.REPEAT),Wt.validate(s)||(s=Wt.LINEAR),Jn.validate(a)||(a=Jn.LINEAR),new jt({wrapS:r,wrapT:o,minificationFilter:s,magnificationFilter:a})};var i$e=new U(1,1);K6.createModelTextureReader=function(e){e=e??H.EMPTY_OBJECT;let{textureInfo:t,channels:n,texture:i}=e,r=t.texCoord??0,o,s=t.extensions?.KHR_texture_transform;if(l(s)){r=s.texCoord??r;let u=l(s.offset)?U.unpack(s.offset):U.ZERO,f=s.rotation??0,d=l(s.scale)?U.unpack(s.scale):i$e;f=-f,o=new $(Math.cos(f)*d.x,-Math.sin(f)*d.y,u.x,Math.sin(f)*d.x,Math.cos(f)*d.y,u.y,0,0,1)}let a=new Cn.TextureReader;a.index=t.index,a.texture=i,a.texCoord=r,a.scale=t.scale,a.transform=o,a.channels=n;let c=t.extensions?.EXT_textureInfo_constant_lod;return l(c)&&(a.constantLod={repetitions:c.repetitions??1,offset:l(c.offset)?U.unpack(c.offset):U.ZERO,minClampDistance:c.minClampDistance??1,maxClampDistance:c.maxClampDistance??4294967296}),a};var Hu=K6;function r$e(e){let t=document.createElement("canvas");return t.width=D.nextPowerOfTwo(e.width),t.height=D.nextPowerOfTwo(e.height),t.getContext("2d").drawImage(e,0,0,e.width,e.height,0,0,t.width,t.height),t}var uA=r$e;var H$=class extends nr{constructor(t){super(),t=t??H.EMPTY_OBJECT;let n=t.resourceCache,i=t.gltf,r=t.textureInfo,o=t.gltfResource,s=t.baseResource,a=t.supportedImageFormats,c=t.cacheKey,u=t.asynchronous??!0,f=r.index,d=Hu.getImageIdFromTexture({gltf:i,textureId:f,supportedImageFormats:a});this._resourceCache=n,this._gltf=i,this._textureInfo=r,this._imageId=d,this._gltfResource=o,this._baseResource=s,this._cacheKey=c,this._asynchronous=u,this._imageLoader=void 0,this._image=void 0,this._mipLevels=void 0,this._texture=void 0,this._state=Tt.UNLOADED,this._promise=void 0}get cacheKey(){return this._cacheKey}get texture(){return this._texture}async load(){return l(this._promise)?this._promise:(this._state=Tt.LOADING,this._promise=s$e(this),this._promise)}process(t){if(this._state===Tt.READY)return!0;if(this._state!==Tt.LOADED&&this._state!==Tt.PROCESSING||l(this._texture)||!l(this._image))return!1;this._state=Tt.PROCESSING;let n;if(this._asynchronous){let i=o$e;if(i.set(this._gltf,this._textureInfo,this._cacheKey,this._image,this._mipLevels,t.context),!t.jobScheduler.execute(i,Mc.TEXTURE))return!1;n=i.texture}else n=hge(this._gltf,this._textureInfo,this._cacheKey,this._image,this._mipLevels,t.context);return this.unload(),this._texture=n,this._state=Tt.READY,this._resourceCache.statistics.addTextureLoader(this),!0}unload(){l(this._texture)&&this._texture.destroy(),l(this._imageLoader)&&!this._imageLoader.isDestroyed()&&this._resourceCache.unload(this._imageLoader),this._imageLoader=void 0,this._image=void 0,this._mipLevels=void 0,this._texture=void 0,this._gltf=void 0}},G$=class{constructor(){this.gltf=void 0,this.textureInfo=void 0,this.textureId=void 0,this.image=void 0,this.context=void 0,this.texture=void 0}set(t,n,i,r,o,s){this.gltf=t,this.textureInfo=n,this.textureId=i,this.image=r,this.mipLevels=o,this.context=s}execute(){this.texture=hge(this.gltf,this.textureInfo,this.textureId,this.image,this.mipLevels,this.context)}};function hge(e,t,n,i,r,o){let s=i.internalFormat,a=!1;Ke.isCompressedFormat(s)&&!l(r)&&(a=!0);let c=Hu.createSampler({gltf:e,textureInfo:t,compressedTextureNoMipmap:a}),u=c.minificationFilter,f=c.wrapS,d=c.wrapT,p=u===Wt.NEAREST_MIPMAP_NEAREST||u===Wt.NEAREST_MIPMAP_LINEAR||u===Wt.LINEAR_MIPMAP_NEAREST||u===Wt.LINEAR_MIPMAP_LINEAR,g=!l(s)&&p,m=g||f===hn.REPEAT||f===hn.MIRRORED_REPEAT||d===hn.REPEAT||d===hn.MIRRORED_REPEAT,y=!D.isPowerOfTwo(i.width)||!D.isPowerOfTwo(i.height),A=m&&y,b;return l(s)?(!o.webgl2&&Ke.isCompressedFormat(s)&&y&&m&&console.warn("Compressed texture uses REPEAT or MIRRORED_REPEAT texture wrap mode and dimensions are not powers of two. The texture may be rendered incorrectly."),b=Dt.create({id:n,context:o,source:{arrayBufferView:i.bufferView,mipLevels:r},width:i.width,height:i.height,pixelFormat:i.internalFormat,sampler:c})):(A&&(i=uA(i)),b=Dt.create({id:n,context:o,source:i,sampler:c,flipY:!1,skipColorSpaceConversion:!0})),g&&b.generateMipmap(),b}var o$e=new G$;async function s$e(e){let t=e._resourceCache;try{let n=t.getImageLoader({gltf:e._gltf,imageId:e._imageId,gltfResource:e._gltfResource,baseResource:e._baseResource});return e._imageLoader=n,await n.load(),e.isDestroyed()?void 0:(e._image=n.image,e._mipLevels=n.mipLevels,e._state=Tt.LOADED,e)}catch(n){if(e.isDestroyed())return;throw e.unload(),e._state=Tt.FAILED,e.getError("Failed to load texture",n)}}var aS=H$;var W$=class extends nr{constructor(t){super(),t=t??H.EMPTY_OBJECT;let n=t.resourceCache,i=t.gltf,r=t.gltfResource,o=t.baseResource,s=t.bufferViewId,a=t.primitive,c=t.draco,u=t.attributeSemantic,f=t.accessorId,d=t.cacheKey,p=t.spz,g=t.asynchronous??!0,m=t.loadBuffer??!1,y=t.loadTypedArray??!1;this._resourceCache=n,this._gltfResource=r,this._baseResource=o,this._gltf=i,this._bufferViewId=s,this._primitive=a,this._draco=c,this._spz=p,this._attributeSemantic=u,this._accessorId=f,this._cacheKey=d,this._asynchronous=g,this._loadBuffer=m,this._loadTypedArray=y,this._bufferViewLoader=void 0,this._dracoLoader=void 0,this._quantization=void 0,this._typedArray=void 0,this._buffer=void 0,this._state=Tt.UNLOADED,this._promise=void 0}get cacheKey(){return this._cacheKey}get buffer(){return this._buffer}get typedArray(){return this._typedArray}get quantization(){return this._quantization}async load(){return l(this._promise)?this._promise:l(this._spz)?(this._promise=l$e(this),this._promise):a$e(this._draco,this._attributeSemantic)?(this._promise=h$e(this),this._promise):(this._promise=p$e(this),this._promise)}process(t){if(this._state===Tt.READY)return!0;if(this._state!==Tt.LOADED&&this._state!==Tt.PROCESSING)return!1;if(l(this._dracoLoader)){try{if(!this._dracoLoader.process(t))return!1}catch(r){$6(this,r)}m$e(this)}if(l(this._spzLoader)){try{if(!this._spzLoader.process(t))return!1}catch(r){$6(this,r)}d$e(this)}let n,i=this._typedArray;if(this._loadBuffer&&this._asynchronous){let r=g$e;if(r.set(i,t.context),!t.jobScheduler.execute(r,Mc.BUFFER))return!1;n=r.buffer}else this._loadBuffer&&(n=mge(i,t.context));return this.unload(),this._buffer=n,this._typedArray=this._loadTypedArray?i:void 0,this._state=Tt.READY,this._resourceCache.statistics.addGeometryLoader(this),!0}unload(){l(this._buffer)&&this._buffer.destroy();let t=this._resourceCache;l(this._bufferViewLoader)&&!this._bufferViewLoader.isDestroyed()&&t.unload(this._bufferViewLoader),l(this._dracoLoader)&&t.unload(this._dracoLoader),l(this._spzLoader)&&t.unload(this._spzLoader),this._bufferViewLoader=void 0,this._dracoLoader=void 0,this._spzLoader=void 0,this._typedArray=void 0,this._buffer=void 0,this._gltf=void 0,this._primitive=void 0}};function a$e(e,t){return l(e)&&l(e.attributes)&&l(e.attributes[t])}function c$e(e,t,n,i){let o=(1<<e.quantizationBits)-1,s=1/o,a=new Cn.Quantization;if(a.componentDatatype=t,a.octEncoded=e.octEncoded,a.octEncodedZXY=!0,a.type=i,a.octEncoded)a.type=Vt.VEC2,a.normalizationRange=o;else{let c=Vt.getMathType(i);if(c===Number){let u=e.range;a.quantizedVolumeOffset=e.minValues[0],a.quantizedVolumeDimensions=u,a.normalizationRange=o,a.quantizedVolumeStepSize=u*s}else{a.quantizedVolumeOffset=c.unpack(e.minValues),a.normalizationRange=c.unpack(new Array(n).fill(o));let u=new Array(n).fill(e.range);a.quantizedVolumeDimensions=c.unpack(u);let f=u.map(function(d){return d*s});a.quantizedVolumeStepSize=c.unpack(f)}}return a}async function l$e(e){e._state=Tt.LOADING;let t=e._resourceCache;try{let n=t.getSpzLoader({gltf:e._gltf,primitive:e._primitive,spz:e._spz,gltfResource:e._gltfResource,baseResource:e._baseResource});return e._spzLoader=n,await n.load(),e.isDestroyed()?void 0:(e._state=Tt.LOADED,e)}catch{if(e.isDestroyed())return}}function u$e(e){return`${e.startsWith("KHR_gaussian_splatting:")?"KHR_gaussian_splatting:":"_"}SH_DEGREE_`}function f$e(e){let t=u$e(e),n="_COEF_",i=t.length,r=e.indexOf(n,i),o=parseInt(e.slice(i,r),10),s=parseInt(e.slice(r+n.length),10);return{l:o,n:s}}function d$e(e){e._state=Tt.PROCESSING;let n=e._spzLoader.decodedData.gcloud;if(e._attributeSemantic==="POSITION")e._typedArray=n.positions;else if(e._attributeSemantic==="KHR_gaussian_splatting:SCALE"||e._attributeSemantic==="_SCALE")e._typedArray=n.scales;else if(e._attributeSemantic==="KHR_gaussian_splatting:ROTATION"||e._attributeSemantic==="_ROTATION")e._typedArray=n.rotations;else if(e._attributeSemantic==="COLOR_0"){let i=n.colors,r=n.alphas;e._typedArray=new Uint8Array(i.length/3*4);for(let o=0;o<i.length/3;o++)e._typedArray[o*4]=D.clamp(i[o*3]*255,0,255),e._typedArray[o*4+1]=D.clamp(i[o*3+1]*255,0,255),e._typedArray[o*4+2]=D.clamp(i[o*3+2]*255,0,255),e._typedArray[o*4+3]=D.clamp(r[o]*255,0,255)}else if(e._attributeSemantic.includes("SH_DEGREE_")){let{l:i,n:r}=f$e(e._attributeSemantic),o=n.shDegree,s=0,a=[0,9,24];switch(o){case 1:s=9;break;case 2:s=24;break;case 3:s=45;break}let c=n.numPoints,u=n.sh;e._typedArray=new Float32Array(c*3);for(let f=0;f<c;f++){let d=f*s+a[i-1]+r*3;e._typedArray[f*3]=u[d],e._typedArray[f*3+1]=u[d+1],e._typedArray[f*3+2]=u[d+2]}}}async function h$e(e){e._state=Tt.LOADING;let t=e._resourceCache;try{let n=t.getDracoLoader({gltf:e._gltf,primitive:e._primitive,draco:e._draco,gltfResource:e._gltfResource,baseResource:e._baseResource});return e._dracoLoader=n,await n.load(),e.isDestroyed()?void 0:(e._state=Tt.LOADED,e)}catch{if(e.isDestroyed())return;$6(e)}}function m$e(e){e._state=Tt.PROCESSING;let n=e._dracoLoader.decodedData.vertexAttributes,i=e._attributeSemantic,r=n[i],o=e._accessorId,a=e._gltf.accessors[o].type,c=r.array,u=r.data.quantization;l(u)&&(e._quantization=c$e(u,r.data.componentDatatype,r.data.componentsPerAttribute,a)),e._typedArray=new Uint8Array(c.buffer,c.byteOffset,c.byteLength)}async function p$e(e){e._state=Tt.LOADING;let t=e._resourceCache;try{let n=t.getBufferViewLoader({gltf:e._gltf,bufferViewId:e._bufferViewId,gltfResource:e._gltfResource,baseResource:e._baseResource});return e._bufferViewLoader=n,await n.load(),e.isDestroyed()?void 0:(e._typedArray=n.typedArray,e._state=Tt.PROCESSING,e)}catch(n){if(e.isDestroyed())return;$6(e,n)}}function $6(e,t){throw e.unload(),e._state=Tt.FAILED,e.getError("Failed to load vertex buffer",t)}var q$=class{constructor(){this.typedArray=void 0,this.context=void 0,this.buffer=void 0}set(t,n){this.typedArray=t,this.context=n}execute(){this.buffer=mge(this.typedArray,this.context)}};function mge(e,t){let n=tt.createVertexBuffer({typedArray:e,context:t,usage:Me.STATIC_DRAW});return n.vertexArrayDestroyable=!1,n}var g$e=new q$,cS=W$;var pge={};async function _$e(e={}){var t,n,i,r,o=e,s=!!globalThis.window,a=!!globalThis.WorkerGlobalScope,c=((n=(t=globalThis.process)==null?void 0:t.versions)==null?void 0:n.node)&&((i=globalThis.process)==null?void 0:i.type)!="renderer";if(c){let{createRequire:ce}=await Promise.resolve().then(()=>T$e);var u=ce(pge.url)}var f="./this.program",d=pge.url;if(c)u("node:fs"),d.startsWith("file:")&&u("node:path").dirname(u("node:url").fileURLToPath(d)),1<process.argv.length&&(f=process.argv[1].replace(/\\/g,"/")),process.argv.slice(2);else if(s||a)try{new URL(".",d)}catch{}var p=console.log.bind(console),g=console.error.bind(console),m=!1;function y(ce){for(var ne=0,Te=ce.length,Ce=new Uint8Array(Te),Ze;ne<Te;++ne)Ze=ce.charCodeAt(ne),Ce[ne]=~Ze>>8&Ze;return Ce}var A,b,x,T,E,v,S,I,R,O,L,_,C=!1;function w(){var ce=Zb.buffer;x=new Int8Array(ce),E=new Int16Array(ce),o.HEAPU8=T=new Uint8Array(ce),v=new Uint16Array(ce),S=new Int32Array(ce),I=new Uint32Array(ce),o.HEAPF32=R=new Float32Array(ce),O=new Float64Array(ce),L=new BigInt64Array(ce),_=new BigUint64Array(ce)}function P(ce){var ne;throw(ne=o.onAbort)==null||ne.call(o,ce),ce="Aborted("+ce+")",g(ce),m=!0,ce=new WebAssembly.RuntimeError(ce+". Build with -sASSERTIONS for more info."),b?.(ce),ce}var M;async function F(ce){return ce}async function V(ce){var ne=M;try{var Te=await F(ne);return await WebAssembly.instantiate(Te,ce)}catch(Ce){g(`failed to asynchronously prepare wasm: ${Ce}`),P(Ce)}}async function B(ce){return V(ce)}var j=ce=>{for(;0<ce.length;)ce.shift()(o)},k=[],G=[],q=()=>{var ce=o.preRun.shift();G.push(ce)},Q={},W=ce=>{for(;ce.length;){var ne=ce.pop();ce.pop()(ne)}};function J(ce){return this.O(I[ce>>2])}var Z={},ae={},Ae={},fe=class extends Error{constructor(ce){super(ce),this.name="InternalError"}},xe=(ce,ne,Te)=>{function Ce(wt){if(wt=Te(wt),wt.length!==ce.length)throw new fe("Mismatched type converter count");for(var bn=0;bn<ce.length;++bn)Qe(ce[bn],wt[bn])}ce.forEach(wt=>Ae[wt]=ne);var Ze=Array(ne.length),Et=[],pt=0;for(let[wt,bn]of ne.entries())ae.hasOwnProperty(bn)?Ze[wt]=ae[bn]:(Et.push(bn),Z.hasOwnProperty(bn)||(Z[bn]=[]),Z[bn].push(()=>{Ze[wt]=ae[bn],++pt,pt===Et.length&&Ce(Ze)}));Et.length===0&&Ce(Ze)},ge=ce=>{for(var ne="";;){var Te=T[ce++];if(!Te)return ne;ne+=String.fromCharCode(Te)}},we=class extends Error{constructor(ce){super(ce),this.name="BindingError"}},Se=ce=>{throw new we(ce)};function Re(ce,ne,Te={}){var Ce=ne.name;if(!ce)throw new we(`type "${Ce}" must have a positive integer typeid pointer`);if(ae.hasOwnProperty(ce)){if(Te.Aa)return;throw new we(`Cannot register type '${Ce}' twice`)}ae[ce]=ne,delete Ae[ce],Z.hasOwnProperty(ce)&&(ne=Z[ce],delete Z[ce],ne.forEach(Ze=>Ze()))}function Qe(ce,ne,Te={}){return Re(ce,ne,Te)}var He=(ce,ne,Te)=>{switch(ne){case 1:return Te?Ce=>x[Ce]:Ce=>T[Ce];case 2:return Te?Ce=>E[Ce>>1]:Ce=>v[Ce>>1];case 4:return Te?Ce=>S[Ce>>2]:Ce=>I[Ce>>2];case 8:return Te?Ce=>L[Ce>>3]:Ce=>_[Ce>>3];default:throw new TypeError(`invalid integer width (${ne}): ${ce}`)}},Xe=ce=>{throw new we(ce.M.R.N.name+" instance already deleted")},$e=!1,Pe=()=>{},qe=ce=>globalThis.FinalizationRegistry?($e=new FinalizationRegistry(ne=>{ne=ne.M,--ne.count.value,ne.count.value===0&&(ne.V?ne.Y.Z(ne.V):ne.R.N.Z(ne.P))}),qe=ne=>{var Te=ne.M;return Te.V&&$e.register(ne,{M:Te},ne),ne},Pe=ne=>{$e.unregister(ne)},qe(ce)):(qe=ne=>ne,ce);function st(){}var vt=(ce,ne)=>Object.defineProperty(ne,"name",{value:ce}),Gt={},lt=(ce,ne,Te)=>{if(ce[ne].U===void 0){var Ce=ce[ne];ce[ne]=function(...Ze){if(!ce[ne].U.hasOwnProperty(Ze.length))throw new we(`Function '${Te}' called with an invalid number of arguments (${Ze.length}) - expects one of (${ce[ne].U})!`);return ce[ne].U[Ze.length].apply(this,Ze)},ce[ne].U=[],ce[ne].U[Ce.$]=Ce}},mt=(ce,ne,Te)=>{if(o.hasOwnProperty(ce)){if(Te===void 0||o[ce].U!==void 0&&o[ce].U[Te]!==void 0)throw new we(`Cannot register public name '${ce}' twice`);if(lt(o,ce,ce),o[ce].U.hasOwnProperty(Te))throw new we(`Cannot register multiple overloads of a function with the same number of arguments (${Te})!`);o[ce].U[Te]=ne}else o[ce]=ne,o[ce].$=Te},ft=ce=>{ce=ce.replace(/[^a-zA-Z0-9_]/g,"$");var ne=ce.charCodeAt(0);return 48<=ne&&57>=ne?`_${ce}`:ce};function Xt(ce,ne,Te,Ce,Ze,Et,pt,wt){this.name=ce,this.constructor=ne,this.ba=Te,this.Z=Ce,this.W=Ze,this.va=Et,this.fa=pt,this.ta=wt,this.Ca=[]}var rt=(ce,ne,Te)=>{for(;ne!==Te;){if(!ne.fa)throw new we(`Expected null or instance of ${Te.name}, got an instance of ${ne.name}`);ce=ne.fa(ce),ne=ne.W}return ce},ht=ce=>{if(ce===null)return"null";var ne=typeof ce;return ne==="object"||ne==="array"||ne==="function"?ce.toString():""+ce};function Bi(ce,ne){if(ne===null){if(this.ia)throw new we(`null is not a valid ${this.name}`);return 0}if(!ne.M)throw new we(`Cannot pass "${ht(ne)}" as a ${this.name}`);if(!ne.M.P)throw new we(`Cannot pass deleted object as a pointer of type ${this.name}`);return rt(ne.M.P,ne.M.R.N,this.N)}function Xn(ce,ne){if(ne===null){if(this.ia)throw new we(`null is not a valid ${this.name}`);if(this.ha){var Te=this.ka();return ce!==null&&ce.push(this.Z,Te),Te}return 0}if(!ne||!ne.M)throw new we(`Cannot pass "${ht(ne)}" as a ${this.name}`);if(!ne.M.P)throw new we(`Cannot pass deleted object as a pointer of type ${this.name}`);if(!this.ga&&ne.M.R.ga)throw new we(`Cannot convert argument of type ${ne.M.Y?ne.M.Y.name:ne.M.R.name} to parameter type ${this.name}`);if(Te=rt(ne.M.P,ne.M.R.N,this.N),this.ha){if(ne.M.V===void 0)throw new we("Passing raw pointer to smart pointer is illegal");switch(this.Ha){case 0:if(ne.M.Y===this)Te=ne.M.V;else throw new we(`Cannot convert argument of type ${ne.M.Y?ne.M.Y.name:ne.M.R.name} to parameter type ${this.name}`);break;case 1:Te=ne.M.V;break;case 2:if(ne.M.Y===this)Te=ne.M.V;else{var Ce=ne.clone();Te=this.Da(Te,qi(()=>Ce.delete())),ce!==null&&ce.push(this.Z,Te)}break;default:throw new we("Unsupported sharing policy")}}return Te}function bi(ce,ne){if(ne===null){if(this.ia)throw new we(`null is not a valid ${this.name}`);return 0}if(!ne.M)throw new we(`Cannot pass "${ht(ne)}" as a ${this.name}`);if(!ne.M.P)throw new we(`Cannot pass deleted object as a pointer of type ${this.name}`);if(ne.M.R.ga)throw new we(`Cannot convert argument of type ${ne.M.R.name} to parameter type ${this.name}`);return rt(ne.M.P,ne.M.R.N,this.N)}var Wi=(ce,ne,Te)=>ne===Te?ce:Te.W===void 0?null:(ce=Wi(ce,ne,Te.W),ce===null?null:Te.ta(ce)),wi={},hi=(ce,ne)=>{if(ne===void 0)throw new we("ptr should not be undefined");for(;ce.W;)ne=ce.fa(ne),ce=ce.W;return wi[ne]},xi=(ce,ne)=>{if(!ne.R||!ne.P)throw new fe("makeClassHandle requires ptr and ptrType");if(!!ne.Y!=!!ne.V)throw new fe("Both smartPtrType and smartPtr must be specified");return ne.count={value:1},qe(Object.create(ce,{M:{value:ne,writable:!0}}))};function jn(ce,ne,Te,Ce,Ze,Et,pt,wt,bn,qn,_n){this.name=ce,this.N=ne,this.ia=Te,this.ga=Ce,this.ha=Ze,this.Ba=Et,this.Ha=pt,this.pa=wt,this.ka=bn,this.Da=qn,this.Z=_n,Ze||ne.W!==void 0?this.S=Xn:(this.S=Ce?Bi:bi,this.T=null)}var nn=(ce,ne,Te)=>{if(!o.hasOwnProperty(ce))throw new fe("Replacing nonexistent public symbol");o[ce].U!==void 0&&Te!==void 0?o[ce].U[Te]=ne:(o[ce]=ne,o[ce].$=Te)},Wn=(ce,ne)=>{ce=ge(ce);var Te=nD.get(ne);if(typeof Te!="function")throw new we(`unknown function pointer with signature ${ce}: ${ne}`);return Te};class Zi extends Error{}var Mr=ce=>{ce=Jb(ce);var ne=ge(ce);return vp(ce),ne},fo=(ce,ne)=>{function Te(Et){Ze[Et]||ae[Et]||(Ae[Et]?Ae[Et].forEach(Te):(Ce.push(Et),Ze[Et]=!0))}var Ce=[],Ze={};throw ne.forEach(Te),new Zi(`${ce}: `+Ce.map(Mr).join([", "]))},Bs=(ce,ne)=>{for(var Te=[],Ce=0;Ce<ce;Ce++)Te.push(I[ne+4*Ce>>2]);return Te};function Ks(ce){for(var ne=1;ne<ce.length;++ne)if(ce[ne]!==null&&ce[ne].T===void 0)return!0;return!1}function no(ce,ne,Te,Ce,Ze,Et){var pt=ne.length;if(2>pt)throw new we("argTypes array size mismatch! Must at least get return value and 'this' types!");var wt=ne[1]!==null&&Te!==null,bn=Ks(ne);Te=!ne[0].oa;var qn=ne[0],_n=ne[1];for(Ce=[ce,Se,Ce,Ze,W,qn.O.bind(qn),_n?.S.bind(_n)],Ze=2;Ze<pt;++Ze)qn=ne[Ze],Ce.push(qn.S.bind(qn));if(!bn)for(Ze=wt?1:2;Ze<ne.length;++Ze)ne[Ze].T!==null&&Ce.push(ne[Ze].T);for(bn=Ks(ne),Ze=ne.length-2,_n=[],qn=["fn"],wt&&qn.push("thisWired"),pt=0;pt<Ze;++pt)_n.push(`arg${pt}`),qn.push(`arg${pt}Wired`);_n=_n.join(","),qn=qn.join(","),_n=`return function (${_n}) { +${r.stack}`),r};dl.getNodeTransform=function(e){return l(e.matrix)?e.matrix:N.fromTranslationQuaternionRotationScale(l(e.translation)?e.translation:h.ZERO,l(e.rotation)?e.rotation:Le.IDENTITY,l(e.scale)?e.scale:h.ONE)};dl.getAttributeBySemantic=function(e,t,n){let i=e.attributes,r=i.length;for(let o=0;o<r;++o){let s=i[o],a=l(n)?s.setIndex===n:!0;if(s.semantic===t&&a)return s}};dl.getAttributeByName=function(e,t){let n=e.attributes,i=n.length;for(let r=0;r<i;++r){let o=n[r];if(o.name===t)return o}};dl.getFeatureIdsByLabel=function(e,t){for(let n=0;n<e.length;n++){let i=e[n];if(i.positionalLabel===t||i.label===t)return i}};dl.hasQuantizedAttributes=function(e){if(!l(e))return!1;for(let t=0;t<e.length;t++){let n=e[t];if(l(n.quantization))return!0}return!1};dl.getAttributeInfo=function(e){let t=e.semantic,n=e.setIndex,i,r=!1;l(t)?(i=ct.getVariableName(t,n),r=!0):(i=e.name,i=i.replace(/^_/,""),i=i.toLowerCase());let o=/^color_\d+$/.test(i),s=e.type,a=Vt.getGlslType(s);o&&(a="vec4");let c=l(e.quantization),u;return c&&(u=o?"vec4":Vt.getGlslType(e.quantization.type)),{attribute:e,isQuantized:c,variableName:i,hasSemantic:r,glslType:a,quantizedGlslType:u}};var qtt=new h,Ytt=new h;dl.getPositionMinMax=function(e,t,n){let i=dl.getAttributeBySemantic(e,"POSITION"),r=i.max,o=i.min;return l(n)&&l(t)&&(o=h.add(o,t,Ytt),r=h.add(r,n,qtt)),{min:o,max:r}};dl.getAxisCorrectionMatrix=function(e,t,n){return n=N.clone(N.IDENTITY,n),e===Hi.Y?n=N.clone(Hi.Y_UP_TO_Z_UP,n):e===Hi.X&&(n=N.clone(Hi.X_UP_TO_Z_UP,n)),t===Hi.Z&&(n=N.multiplyTransformation(n,Hi.Z_UP_TO_X_UP,n)),n};var Xtt=new $;dl.getCullFace=function(e,t){if(!Oe.isTriangles(t))return zi.BACK;let n=N.getMatrix3(e,Xtt);return $.determinant(n)<0?zi.FRONT:zi.BACK};dl.sanitizeGlslIdentifier=function(e){let t=e.replaceAll(/[^A-Za-z0-9]+/g,"_");return t=t.replace(/^gl_/,""),/^\d/.test(t)&&(t=`_${t}`),t};dl.supportedExtensions={AGI_articulations:!0,CESIUM_mesh_vector:!0,CESIUM_primitive_outline:!0,CESIUM_RTC:!0,EXT_feature_metadata:!0,EXT_implicit_cylinder_region:!0,EXT_implicit_ellipsoid_region:!0,EXT_instance_features:!0,EXT_mesh_features:!0,EXT_mesh_gpu_instancing:!0,EXT_mesh_polygon:!0,EXT_mesh_primitive_edge_visibility:!0,EXT_meshopt_compression:!0,EXT_primitive_voxels:!0,EXT_structural_metadata:!0,EXT_texture_webp:!0,KHR_blend:!0,KHR_draco_mesh_compression:!0,KHR_implicit_shapes:!0,KHR_materials_common:!0,KHR_materials_pbrSpecularGlossiness:!0,KHR_materials_specular:!0,KHR_materials_anisotropy:!0,KHR_materials_clearcoat:!0,KHR_materials_unlit:!0,KHR_mesh_quantization:!0,KHR_mesh_primitive_restart:!0,KHR_meshopt_compression:!0,KHR_techniques_webgl:!0,KHR_texture_basisu:!0,KHR_texture_transform:!0,KHR_gaussian_splatting:!0,KHR_gaussian_splatting_compression_spz_2:!0,WEB3D_quantized_attributes:!0};dl.checkSupportedExtensions=function(e){let t=e.length;for(let n=0;n<t;n++){let i=e[n];if(!dl.supportedExtensions[i])throw new oe(`Unsupported glTF Extension: ${i}`)}};var xt=dl;var tZ=class extends ir{constructor(t){super(),t=t??H.EMPTY_OBJECT;let n=t.resourceCache,i=t.gltfResource,r=t.baseResource,o=t.typedArray,s=t.gltfJson,a=t.cacheKey;this._resourceCache=n,this._gltfResource=i,this._baseResource=r,this._typedArray=o,this._gltfJson=s,this._cacheKey=a,this._gltf=void 0,this._bufferLoaders=[],this._state=Tt.UNLOADED,this._promise=void 0}get cacheKey(){return this._cacheKey}get gltf(){return this._gltf}async load(){return l(this._promise)?this._promise:(this._state=Tt.LOADING,l(this._gltfJson)?(this._promise=Gbe(this,this._gltfJson),this._promise):l(this._typedArray)?(this._promise=Wbe(this,this._typedArray),this._promise):(this._promise=Ktt(this),this._promise))}unload(){let t=this._bufferLoaders,n=t.length;for(let i=0;i<n;++i)t[i]=!t[i].isDestroyed()&&this._resourceCache.unload(t[i]);this._bufferLoaders.length=0,this._gltf=void 0}_fetchGltf(){return this._gltfResource.fetchArrayBuffer()}};async function Ktt(e){let t;try{let n=await e._fetchGltf();if(e.isDestroyed())return;t=new Uint8Array(n)}catch(n){if(e.isDestroyed())return;nZ(e,n)}return Wbe(e,t)}function nZ(e,t){e.unload(),e._state=Tt.FAILED;let n=`Failed to load glTF: ${e._gltfResource.url}`;throw e.getError(n,t)}async function $tt(e,t){if(l(t.asset)&&t.asset.version==="2.0"&&!Wo(t,"KHR_techniques_webgl")&&!Wo(t,"KHR_materials_common"))return Promise.resolve();let n=[];ke.buffer(t,function(i){if(!l(i.extras._pipeline.source)&&l(i.uri)){let r=e._baseResource.getDerivedResource({url:i.uri}),s=e._resourceCache.getExternalBufferLoader({resource:r});e._bufferLoaders.push(s),n.push(s.load().then(function(){s.isDestroyed()||(i.extras._pipeline.source=s.typedArray)}))}}),await Promise.all(n),TF(t)}function Jtt(e){let t=[];return ke.buffer(e,function(n){let i=n.uri;!l(n.extras._pipeline.source)&&l(i)&&Uh(i)&&(delete n.uri,t.push(De.fetchArrayBuffer(i).then(function(r){n.extras._pipeline.source=new Uint8Array(r)})))}),Promise.all(t)}function Ztt(e,t){let n=[];return ke.buffer(t,function(i,r){let o=i.extras._pipeline.source;if(l(o)&&!l(i.uri)){let a=e._resourceCache.getEmbeddedBufferLoader({parentResource:e._gltfResource,bufferId:r,typedArray:o});e._bufferLoaders.push(a),n.push(a.load())}}),Promise.all(n)}async function Gbe(e,t){try{_A(t),await Jtt(t),await $tt(e,t),dF(t),await Ztt(e,t),mF(t);let n=t.asset.version;if(n!=="1.0"&&n!=="2.0")throw new oe(`Unsupported glTF version: ${n}`);let i=t.extensionsRequired;return l(i)&&xt.checkSupportedExtensions(i),e._gltf=t,e._state=Tt.READY,e}catch(n){if(e.isDestroyed())return;nZ(e,n)}}async function Wbe(e,t){let n;try{bm(t)==="glTF"?n=IT(t):n=No(t)}catch(i){if(e.isDestroyed())return;nZ(e,i)}return Gbe(e,n)}var YS=tZ;function Qtt(e){let t=document.createElement("canvas");return t.width=D.nextPowerOfTwo(e.width),t.height=D.nextPowerOfTwo(e.height),t.getContext("2d").drawImage(e,0,0,e.width,e.height,0,0,t.width,t.height),t}var yA=Qtt;var iZ=class extends ir{constructor(t){super(),t=t??H.EMPTY_OBJECT;let n=t.resourceCache,i=t.gltf,r=t.textureInfo,o=t.gltfResource,s=t.baseResource,a=t.supportedImageFormats,c=t.cacheKey,u=t.asynchronous??!0,f=r.index,d=Hu.getImageIdFromTexture({gltf:i,textureId:f,supportedImageFormats:a});this._resourceCache=n,this._gltf=i,this._textureInfo=r,this._imageId=d,this._gltfResource=o,this._baseResource=s,this._cacheKey=c,this._asynchronous=u,this._imageLoader=void 0,this._image=void 0,this._mipLevels=void 0,this._texture=void 0,this._state=Tt.UNLOADED,this._promise=void 0}get cacheKey(){return this._cacheKey}get texture(){return this._texture}async load(){return l(this._promise)?this._promise:(this._state=Tt.LOADING,this._promise=tnt(this),this._promise)}process(t){if(this._state===Tt.READY)return!0;if(this._state!==Tt.LOADED&&this._state!==Tt.PROCESSING||l(this._texture)||!l(this._image))return!1;this._state=Tt.PROCESSING;let n;if(this._asynchronous){let i=ent;if(i.set(this._gltf,this._textureInfo,this._cacheKey,this._image,this._mipLevels,t.context),!t.jobScheduler.execute(i,Fc.TEXTURE))return!1;n=i.texture}else n=qbe(this._gltf,this._textureInfo,this._cacheKey,this._image,this._mipLevels,t.context);return this.unload(),this._texture=n,this._state=Tt.READY,this._resourceCache.statistics.addTextureLoader(this),!0}unload(){l(this._texture)&&this._texture.destroy(),l(this._imageLoader)&&!this._imageLoader.isDestroyed()&&this._resourceCache.unload(this._imageLoader),this._imageLoader=void 0,this._image=void 0,this._mipLevels=void 0,this._texture=void 0,this._gltf=void 0}},rZ=class{constructor(){this.gltf=void 0,this.textureInfo=void 0,this.textureId=void 0,this.image=void 0,this.context=void 0,this.texture=void 0}set(t,n,i,r,o,s){this.gltf=t,this.textureInfo=n,this.textureId=i,this.image=r,this.mipLevels=o,this.context=s}execute(){this.texture=qbe(this.gltf,this.textureInfo,this.textureId,this.image,this.mipLevels,this.context)}};function qbe(e,t,n,i,r,o){let s=i.internalFormat,a=!1;Ke.isCompressedFormat(s)&&!l(r)&&(a=!0);let c=Hu.createSampler({gltf:e,textureInfo:t,compressedTextureNoMipmap:a}),u=c.minificationFilter,f=c.wrapS,d=c.wrapT,p=u===Wt.NEAREST_MIPMAP_NEAREST||u===Wt.NEAREST_MIPMAP_LINEAR||u===Wt.LINEAR_MIPMAP_NEAREST||u===Wt.LINEAR_MIPMAP_LINEAR,g=!l(s)&&p,m=g||f===hn.REPEAT||f===hn.MIRRORED_REPEAT||d===hn.REPEAT||d===hn.MIRRORED_REPEAT,y=!D.isPowerOfTwo(i.width)||!D.isPowerOfTwo(i.height),A=m&&y,b;return l(s)?(!o.webgl2&&Ke.isCompressedFormat(s)&&y&&m&&console.warn("Compressed texture uses REPEAT or MIRRORED_REPEAT texture wrap mode and dimensions are not powers of two. The texture may be rendered incorrectly."),b=Dt.create({id:n,context:o,source:{arrayBufferView:i.bufferView,mipLevels:r},width:i.width,height:i.height,pixelFormat:i.internalFormat,sampler:c})):(A&&(i=yA(i)),b=Dt.create({id:n,context:o,source:i,sampler:c,flipY:!1,skipColorSpaceConversion:!0})),g&&b.generateMipmap(),b}var ent=new rZ;async function tnt(e){let t=e._resourceCache;try{let n=t.getImageLoader({gltf:e._gltf,imageId:e._imageId,gltfResource:e._gltfResource,baseResource:e._baseResource});return e._imageLoader=n,await n.load(),e.isDestroyed()?void 0:(e._image=n.image,e._mipLevels=n.mipLevels,e._state=Tt.LOADED,e)}catch(n){if(e.isDestroyed())return;throw e.unload(),e._state=Tt.FAILED,e.getError("Failed to load texture",n)}}var XS=iZ;var oZ=class extends ir{constructor(t){super(),t=t??H.EMPTY_OBJECT;let n=t.resourceCache,i=t.gltf,r=t.gltfResource,o=t.baseResource,s=t.bufferViewId,a=t.primitive,c=t.draco,u=t.attributeSemantic,f=t.accessorId,d=t.cacheKey,p=t.spz,g=t.asynchronous??!0,m=t.loadBuffer??!1,y=t.loadTypedArray??!1;this._resourceCache=n,this._gltfResource=r,this._baseResource=o,this._gltf=i,this._bufferViewId=s,this._primitive=a,this._draco=c,this._spz=p,this._attributeSemantic=u,this._accessorId=f,this._cacheKey=d,this._asynchronous=g,this._loadBuffer=m,this._loadTypedArray=y,this._bufferViewLoader=void 0,this._dracoLoader=void 0,this._quantization=void 0,this._typedArray=void 0,this._buffer=void 0,this._state=Tt.UNLOADED,this._promise=void 0}get cacheKey(){return this._cacheKey}get buffer(){return this._buffer}get typedArray(){return this._typedArray}get quantization(){return this._quantization}async load(){return l(this._promise)?this._promise:l(this._spz)?(this._promise=rnt(this),this._promise):nnt(this._draco,this._attributeSemantic)?(this._promise=cnt(this),this._promise):(this._promise=unt(this),this._promise)}process(t){if(this._state===Tt.READY)return!0;if(this._state!==Tt.LOADED&&this._state!==Tt.PROCESSING)return!1;if(l(this._dracoLoader)){try{if(!this._dracoLoader.process(t))return!1}catch(r){LH(this,r)}lnt(this)}if(l(this._spzLoader)){try{if(!this._spzLoader.process(t))return!1}catch(r){LH(this,r)}ant(this)}let n,i=this._typedArray;if(this._loadBuffer&&this._asynchronous){let r=fnt;if(r.set(i,t.context),!t.jobScheduler.execute(r,Fc.BUFFER))return!1;n=r.buffer}else this._loadBuffer&&(n=Ybe(i,t.context));return this.unload(),this._buffer=n,this._typedArray=this._loadTypedArray?i:void 0,this._state=Tt.READY,this._resourceCache.statistics.addGeometryLoader(this),!0}unload(){l(this._buffer)&&this._buffer.destroy();let t=this._resourceCache;l(this._bufferViewLoader)&&!this._bufferViewLoader.isDestroyed()&&t.unload(this._bufferViewLoader),l(this._dracoLoader)&&t.unload(this._dracoLoader),l(this._spzLoader)&&t.unload(this._spzLoader),this._bufferViewLoader=void 0,this._dracoLoader=void 0,this._spzLoader=void 0,this._typedArray=void 0,this._buffer=void 0,this._gltf=void 0,this._primitive=void 0}};function nnt(e,t){return l(e)&&l(e.attributes)&&l(e.attributes[t])}function int(e,t,n,i){let o=(1<<e.quantizationBits)-1,s=1/o,a=new Cn.Quantization;if(a.componentDatatype=t,a.octEncoded=e.octEncoded,a.octEncodedZXY=!0,a.type=i,a.octEncoded)a.type=Vt.VEC2,a.normalizationRange=o;else{let c=Vt.getMathType(i);if(c===Number){let u=e.range;a.quantizedVolumeOffset=e.minValues[0],a.quantizedVolumeDimensions=u,a.normalizationRange=o,a.quantizedVolumeStepSize=u*s}else{a.quantizedVolumeOffset=c.unpack(e.minValues),a.normalizationRange=c.unpack(new Array(n).fill(o));let u=new Array(n).fill(e.range);a.quantizedVolumeDimensions=c.unpack(u);let f=u.map(function(d){return d*s});a.quantizedVolumeStepSize=c.unpack(f)}}return a}async function rnt(e){e._state=Tt.LOADING;let t=e._resourceCache;try{let n=t.getSpzLoader({gltf:e._gltf,primitive:e._primitive,spz:e._spz,gltfResource:e._gltfResource,baseResource:e._baseResource});return e._spzLoader=n,await n.load(),e.isDestroyed()?void 0:(e._state=Tt.LOADED,e)}catch{if(e.isDestroyed())return}}function ont(e){return`${e.startsWith("KHR_gaussian_splatting:")?"KHR_gaussian_splatting:":"_"}SH_DEGREE_`}function snt(e){let t=ont(e),n="_COEF_",i=t.length,r=e.indexOf(n,i),o=parseInt(e.slice(i,r),10),s=parseInt(e.slice(r+n.length),10);return{l:o,n:s}}function ant(e){e._state=Tt.PROCESSING;let n=e._spzLoader.decodedData.gcloud;if(e._attributeSemantic==="POSITION")e._typedArray=n.positions;else if(e._attributeSemantic==="KHR_gaussian_splatting:SCALE"||e._attributeSemantic==="_SCALE")e._typedArray=n.scales;else if(e._attributeSemantic==="KHR_gaussian_splatting:ROTATION"||e._attributeSemantic==="_ROTATION")e._typedArray=n.rotations;else if(e._attributeSemantic==="COLOR_0"){let i=n.colors,r=n.alphas;e._typedArray=new Uint8Array(i.length/3*4);for(let o=0;o<i.length/3;o++)e._typedArray[o*4]=D.clamp(i[o*3]*255,0,255),e._typedArray[o*4+1]=D.clamp(i[o*3+1]*255,0,255),e._typedArray[o*4+2]=D.clamp(i[o*3+2]*255,0,255),e._typedArray[o*4+3]=D.clamp(r[o]*255,0,255)}else if(e._attributeSemantic.includes("SH_DEGREE_")){let{l:i,n:r}=snt(e._attributeSemantic),o=n.shDegree,s=0,a=[0,9,24];switch(o){case 1:s=9;break;case 2:s=24;break;case 3:s=45;break}let c=n.numPoints,u=n.sh;e._typedArray=new Float32Array(c*3);for(let f=0;f<c;f++){let d=f*s+a[i-1]+r*3;e._typedArray[f*3]=u[d],e._typedArray[f*3+1]=u[d+1],e._typedArray[f*3+2]=u[d+2]}}}async function cnt(e){e._state=Tt.LOADING;let t=e._resourceCache;try{let n=t.getDracoLoader({gltf:e._gltf,primitive:e._primitive,draco:e._draco,gltfResource:e._gltfResource,baseResource:e._baseResource});return e._dracoLoader=n,await n.load(),e.isDestroyed()?void 0:(e._state=Tt.LOADED,e)}catch{if(e.isDestroyed())return;LH(e)}}function lnt(e){e._state=Tt.PROCESSING;let n=e._dracoLoader.decodedData.vertexAttributes,i=e._attributeSemantic,r=n[i],o=e._accessorId,a=e._gltf.accessors[o].type,c=r.array,u=r.data.quantization;l(u)&&(e._quantization=int(u,r.data.componentDatatype,r.data.componentsPerAttribute,a)),e._typedArray=new Uint8Array(c.buffer,c.byteOffset,c.byteLength)}async function unt(e){e._state=Tt.LOADING;let t=e._resourceCache;try{let n=t.getBufferViewLoader({gltf:e._gltf,bufferViewId:e._bufferViewId,gltfResource:e._gltfResource,baseResource:e._baseResource});return e._bufferViewLoader=n,await n.load(),e.isDestroyed()?void 0:(e._typedArray=n.typedArray,e._state=Tt.PROCESSING,e)}catch(n){if(e.isDestroyed())return;LH(e,n)}}function LH(e,t){throw e.unload(),e._state=Tt.FAILED,e.getError("Failed to load vertex buffer",t)}var sZ=class{constructor(){this.typedArray=void 0,this.context=void 0,this.buffer=void 0}set(t,n){this.typedArray=t,this.context=n}execute(){this.buffer=Ybe(this.typedArray,this.context)}};function Ybe(e,t){let n=tt.createVertexBuffer({typedArray:e,context:t,usage:Me.STATIC_DRAW});return n.vertexArrayDestroyable=!1,n}var fnt=new sZ,KS=oZ;var Xbe={};async function dnt(e={}){var t,n,i,r,o=e,s=!!globalThis.window,a=!!globalThis.WorkerGlobalScope,c=((n=(t=globalThis.process)==null?void 0:t.versions)==null?void 0:n.node)&&((i=globalThis.process)==null?void 0:i.type)!="renderer";if(c){let{createRequire:ce}=await Promise.resolve().then(()=>_nt);var u=ce(Xbe.url)}var f="./this.program",d=Xbe.url;if(c)u("node:fs"),d.startsWith("file:")&&u("node:path").dirname(u("node:url").fileURLToPath(d)),1<process.argv.length&&(f=process.argv[1].replace(/\\/g,"/")),process.argv.slice(2);else if(s||a)try{new URL(".",d)}catch{}var p=console.log.bind(console),g=console.error.bind(console),m=!1;function y(ce){for(var ne=0,Te=ce.length,Ce=new Uint8Array(Te),Ze;ne<Te;++ne)Ze=ce.charCodeAt(ne),Ce[ne]=~Ze>>8&Ze;return Ce}var A,b,x,T,E,v,S,I,R,O,L,_,C=!1;function w(){var ce=Zb.buffer;x=new Int8Array(ce),E=new Int16Array(ce),o.HEAPU8=T=new Uint8Array(ce),v=new Uint16Array(ce),S=new Int32Array(ce),I=new Uint32Array(ce),o.HEAPF32=R=new Float32Array(ce),O=new Float64Array(ce),L=new BigInt64Array(ce),_=new BigUint64Array(ce)}function P(ce){var ne;throw(ne=o.onAbort)==null||ne.call(o,ce),ce="Aborted("+ce+")",g(ce),m=!0,ce=new WebAssembly.RuntimeError(ce+". Build with -sASSERTIONS for more info."),b?.(ce),ce}var M;async function F(ce){return ce}async function V(ce){var ne=M;try{var Te=await F(ne);return await WebAssembly.instantiate(Te,ce)}catch(Ce){g(`failed to asynchronously prepare wasm: ${Ce}`),P(Ce)}}async function B(ce){return V(ce)}var j=ce=>{for(;0<ce.length;)ce.shift()(o)},k=[],G=[],q=()=>{var ce=o.preRun.shift();G.push(ce)},Q={},W=ce=>{for(;ce.length;){var ne=ce.pop();ce.pop()(ne)}};function J(ce){return this.O(I[ce>>2])}var Z={},ae={},Ae={},fe=class extends Error{constructor(ce){super(ce),this.name="InternalError"}},xe=(ce,ne,Te)=>{function Ce(wt){if(wt=Te(wt),wt.length!==ce.length)throw new fe("Mismatched type converter count");for(var bn=0;bn<ce.length;++bn)Qe(ce[bn],wt[bn])}ce.forEach(wt=>Ae[wt]=ne);var Ze=Array(ne.length),Et=[],pt=0;for(let[wt,bn]of ne.entries())ae.hasOwnProperty(bn)?Ze[wt]=ae[bn]:(Et.push(bn),Z.hasOwnProperty(bn)||(Z[bn]=[]),Z[bn].push(()=>{Ze[wt]=ae[bn],++pt,pt===Et.length&&Ce(Ze)}));Et.length===0&&Ce(Ze)},ge=ce=>{for(var ne="";;){var Te=T[ce++];if(!Te)return ne;ne+=String.fromCharCode(Te)}},we=class extends Error{constructor(ce){super(ce),this.name="BindingError"}},Se=ce=>{throw new we(ce)};function Re(ce,ne,Te={}){var Ce=ne.name;if(!ce)throw new we(`type "${Ce}" must have a positive integer typeid pointer`);if(ae.hasOwnProperty(ce)){if(Te.Aa)return;throw new we(`Cannot register type '${Ce}' twice`)}ae[ce]=ne,delete Ae[ce],Z.hasOwnProperty(ce)&&(ne=Z[ce],delete Z[ce],ne.forEach(Ze=>Ze()))}function Qe(ce,ne,Te={}){return Re(ce,ne,Te)}var He=(ce,ne,Te)=>{switch(ne){case 1:return Te?Ce=>x[Ce]:Ce=>T[Ce];case 2:return Te?Ce=>E[Ce>>1]:Ce=>v[Ce>>1];case 4:return Te?Ce=>S[Ce>>2]:Ce=>I[Ce>>2];case 8:return Te?Ce=>L[Ce>>3]:Ce=>_[Ce>>3];default:throw new TypeError(`invalid integer width (${ne}): ${ce}`)}},Xe=ce=>{throw new we(ce.M.R.N.name+" instance already deleted")},$e=!1,Pe=()=>{},qe=ce=>globalThis.FinalizationRegistry?($e=new FinalizationRegistry(ne=>{ne=ne.M,--ne.count.value,ne.count.value===0&&(ne.V?ne.Y.Z(ne.V):ne.R.N.Z(ne.P))}),qe=ne=>{var Te=ne.M;return Te.V&&$e.register(ne,{M:Te},ne),ne},Pe=ne=>{$e.unregister(ne)},qe(ce)):(qe=ne=>ne,ce);function st(){}var vt=(ce,ne)=>Object.defineProperty(ne,"name",{value:ce}),Gt={},lt=(ce,ne,Te)=>{if(ce[ne].U===void 0){var Ce=ce[ne];ce[ne]=function(...Ze){if(!ce[ne].U.hasOwnProperty(Ze.length))throw new we(`Function '${Te}' called with an invalid number of arguments (${Ze.length}) - expects one of (${ce[ne].U})!`);return ce[ne].U[Ze.length].apply(this,Ze)},ce[ne].U=[],ce[ne].U[Ce.$]=Ce}},mt=(ce,ne,Te)=>{if(o.hasOwnProperty(ce)){if(Te===void 0||o[ce].U!==void 0&&o[ce].U[Te]!==void 0)throw new we(`Cannot register public name '${ce}' twice`);if(lt(o,ce,ce),o[ce].U.hasOwnProperty(Te))throw new we(`Cannot register multiple overloads of a function with the same number of arguments (${Te})!`);o[ce].U[Te]=ne}else o[ce]=ne,o[ce].$=Te},ft=ce=>{ce=ce.replace(/[^a-zA-Z0-9_]/g,"$");var ne=ce.charCodeAt(0);return 48<=ne&&57>=ne?`_${ce}`:ce};function Xt(ce,ne,Te,Ce,Ze,Et,pt,wt){this.name=ce,this.constructor=ne,this.ba=Te,this.Z=Ce,this.W=Ze,this.va=Et,this.fa=pt,this.ta=wt,this.Ca=[]}var rt=(ce,ne,Te)=>{for(;ne!==Te;){if(!ne.fa)throw new we(`Expected null or instance of ${Te.name}, got an instance of ${ne.name}`);ce=ne.fa(ce),ne=ne.W}return ce},ht=ce=>{if(ce===null)return"null";var ne=typeof ce;return ne==="object"||ne==="array"||ne==="function"?ce.toString():""+ce};function Bi(ce,ne){if(ne===null){if(this.ia)throw new we(`null is not a valid ${this.name}`);return 0}if(!ne.M)throw new we(`Cannot pass "${ht(ne)}" as a ${this.name}`);if(!ne.M.P)throw new we(`Cannot pass deleted object as a pointer of type ${this.name}`);return rt(ne.M.P,ne.M.R.N,this.N)}function Xn(ce,ne){if(ne===null){if(this.ia)throw new we(`null is not a valid ${this.name}`);if(this.ha){var Te=this.ka();return ce!==null&&ce.push(this.Z,Te),Te}return 0}if(!ne||!ne.M)throw new we(`Cannot pass "${ht(ne)}" as a ${this.name}`);if(!ne.M.P)throw new we(`Cannot pass deleted object as a pointer of type ${this.name}`);if(!this.ga&&ne.M.R.ga)throw new we(`Cannot convert argument of type ${ne.M.Y?ne.M.Y.name:ne.M.R.name} to parameter type ${this.name}`);if(Te=rt(ne.M.P,ne.M.R.N,this.N),this.ha){if(ne.M.V===void 0)throw new we("Passing raw pointer to smart pointer is illegal");switch(this.Ha){case 0:if(ne.M.Y===this)Te=ne.M.V;else throw new we(`Cannot convert argument of type ${ne.M.Y?ne.M.Y.name:ne.M.R.name} to parameter type ${this.name}`);break;case 1:Te=ne.M.V;break;case 2:if(ne.M.Y===this)Te=ne.M.V;else{var Ce=ne.clone();Te=this.Da(Te,qi(()=>Ce.delete())),ce!==null&&ce.push(this.Z,Te)}break;default:throw new we("Unsupported sharing policy")}}return Te}function bi(ce,ne){if(ne===null){if(this.ia)throw new we(`null is not a valid ${this.name}`);return 0}if(!ne.M)throw new we(`Cannot pass "${ht(ne)}" as a ${this.name}`);if(!ne.M.P)throw new we(`Cannot pass deleted object as a pointer of type ${this.name}`);if(ne.M.R.ga)throw new we(`Cannot convert argument of type ${ne.M.R.name} to parameter type ${this.name}`);return rt(ne.M.P,ne.M.R.N,this.N)}var Wi=(ce,ne,Te)=>ne===Te?ce:Te.W===void 0?null:(ce=Wi(ce,ne,Te.W),ce===null?null:Te.ta(ce)),wi={},hi=(ce,ne)=>{if(ne===void 0)throw new we("ptr should not be undefined");for(;ce.W;)ne=ce.fa(ne),ce=ce.W;return wi[ne]},xi=(ce,ne)=>{if(!ne.R||!ne.P)throw new fe("makeClassHandle requires ptr and ptrType");if(!!ne.Y!=!!ne.V)throw new fe("Both smartPtrType and smartPtr must be specified");return ne.count={value:1},qe(Object.create(ce,{M:{value:ne,writable:!0}}))};function jn(ce,ne,Te,Ce,Ze,Et,pt,wt,bn,qn,_n){this.name=ce,this.N=ne,this.ia=Te,this.ga=Ce,this.ha=Ze,this.Ba=Et,this.Ha=pt,this.pa=wt,this.ka=bn,this.Da=qn,this.Z=_n,Ze||ne.W!==void 0?this.S=Xn:(this.S=Ce?Bi:bi,this.T=null)}var nn=(ce,ne,Te)=>{if(!o.hasOwnProperty(ce))throw new fe("Replacing nonexistent public symbol");o[ce].U!==void 0&&Te!==void 0?o[ce].U[Te]=ne:(o[ce]=ne,o[ce].$=Te)},Wn=(ce,ne)=>{ce=ge(ce);var Te=nD.get(ne);if(typeof Te!="function")throw new we(`unknown function pointer with signature ${ce}: ${ne}`);return Te};class Zi extends Error{}var Mr=ce=>{ce=Jb(ce);var ne=ge(ce);return vp(ce),ne},fo=(ce,ne)=>{function Te(Et){Ze[Et]||ae[Et]||(Ae[Et]?Ae[Et].forEach(Te):(Ce.push(Et),Ze[Et]=!0))}var Ce=[],Ze={};throw ne.forEach(Te),new Zi(`${ce}: `+Ce.map(Mr).join([", "]))},Bs=(ce,ne)=>{for(var Te=[],Ce=0;Ce<ce;Ce++)Te.push(I[ne+4*Ce>>2]);return Te};function Ks(ce){for(var ne=1;ne<ce.length;++ne)if(ce[ne]!==null&&ce[ne].T===void 0)return!0;return!1}function no(ce,ne,Te,Ce,Ze,Et){var pt=ne.length;if(2>pt)throw new we("argTypes array size mismatch! Must at least get return value and 'this' types!");var wt=ne[1]!==null&&Te!==null,bn=Ks(ne);Te=!ne[0].oa;var qn=ne[0],_n=ne[1];for(Ce=[ce,Se,Ce,Ze,W,qn.O.bind(qn),_n?.S.bind(_n)],Ze=2;Ze<pt;++Ze)qn=ne[Ze],Ce.push(qn.S.bind(qn));if(!bn)for(Ze=wt?1:2;Ze<ne.length;++Ze)ne[Ze].T!==null&&Ce.push(ne[Ze].T);for(bn=Ks(ne),Ze=ne.length-2,_n=[],qn=["fn"],wt&&qn.push("thisWired"),pt=0;pt<Ze;++pt)_n.push(`arg${pt}`),qn.push(`arg${pt}Wired`);_n=_n.join(","),qn=qn.join(","),_n=`return function (${_n}) { `,bn&&(_n+=`var destructors = []; `);var vo=bn?"destructors":"null",mo="humanName throwBindingError invoker fn runDestructors fromRetWire toClassParamWire".split(" ");for(wt&&(_n+=`var thisWired = toClassParamWire(${vo}, this); `),pt=0;pt<Ze;++pt){var $s=`toArg${pt}Wire`;_n+=`var arg${pt}Wired = ${$s}(${vo}, arg${pt}); @@ -7135,7 +7005,7 @@ ${r.stack}`),r};ol.getNodeTransform=function(e){return l(e.matrix)?e.matrix:N.fr `,mo.push(`${Et}_dtor`));return Te&&(_n+=`var ret = fromRetWire(rv); return ret; `),ne=new Function(mo,_n+`} -`)(...Ce),vt(ce,ne)}var gi=ce=>{ce=ce.trim();let ne=ce.indexOf("(");return ne===-1?ce:ce.slice(0,ne)},ho=[],ur=[0,1,,1,null,1,!0,1,!1,1],Zo=ce=>{9<ce&&--ur[ce+1]===0&&(ur[ce]=void 0,ho.push(ce))},Bn=ce=>{if(!ce)throw new we(`Cannot use deleted val. handle = ${ce}`);return ur[ce]},qi=ce=>{switch(ce){case void 0:return 2;case null:return 4;case!0:return 6;case!1:return 8;default:let ne=ho.pop()||ur.length;return ur[ne]=ce,ur[ne+1]=1,ne}},ki={name:"emscripten::val",O:ce=>{var ne=Bn(ce);return Zo(ce),ne},S:(ce,ne)=>qi(ne),X:J,T:null},Nr=(ce,ne,Te)=>{switch(ne){case 1:return Te?function(Ce){return this.O(x[Ce])}:function(Ce){return this.O(T[Ce])};case 2:return Te?function(Ce){return this.O(E[Ce>>1])}:function(Ce){return this.O(v[Ce>>1])};case 4:return Te?function(Ce){return this.O(S[Ce>>2])}:function(Ce){return this.O(I[Ce>>2])};default:throw new TypeError(`invalid integer width (${ne}): ${ce}`)}},Wc=(ce,ne)=>{var Te=ae[ce];if(Te===void 0)throw ce=`${ne} has unknown type ${Mr(ce)}`,new we(ce);return Te},xd=(ce,ne)=>{switch(ne){case 4:return function(Te){return this.O(R[Te>>2])};case 8:return function(Te){return this.O(O[Te>>3])};default:throw new TypeError(`invalid float width (${ne}): ${ce}`)}},xp=(ce,ne,Te)=>{let Ce=(Ze,Et)=>{let pt=0;return{next(){if(pt>=Ze)return{done:!0};let wt=pt;return pt++,{value:Et(wt),done:!1}},[Symbol.iterator](){return this}}};ce[Symbol.iterator]||(ce[Symbol.iterator]=function(){let Ze=this[ne]();return Ce(Ze,Et=>this[Te](Et))})},Nh=Object.assign({optional:!0},ki),da=(ce,ne,Te)=>{var Ce=T;if(!(0<Te))return 0;var Ze=ne;Te=ne+Te-1;for(var Et=0;Et<ce.length;++Et){var pt=ce.codePointAt(Et);if(127>=pt){if(ne>=Te)break;Ce[ne++]=pt}else if(2047>=pt){if(ne+1>=Te)break;Ce[ne++]=192|pt>>6,Ce[ne++]=128|pt&63}else if(65535>=pt){if(ne+2>=Te)break;Ce[ne++]=224|pt>>12,Ce[ne++]=128|pt>>6&63,Ce[ne++]=128|pt&63}else{if(ne+3>=Te)break;Ce[ne++]=240|pt>>18,Ce[ne++]=128|pt>>12&63,Ce[ne++]=128|pt>>6&63,Ce[ne++]=128|pt&63,Et++}}return Ce[ne]=0,ne-Ze},Tp=ce=>{for(var ne=0,Te=0;Te<ce.length;++Te){var Ce=ce.charCodeAt(Te);127>=Ce?ne++:2047>=Ce?ne+=2:55296<=Ce&&57343>=Ce?(ne+=4,++Te):ne+=3}return ne},ks=new TextDecoder,tc=(ce,ne,Te,Ce)=>{if(Te=ne+Te,Ce)return Te;for(;ce[ne]&&!(ne>=Te);)++ne;return ne},Kb=new TextDecoder("utf-16le"),ri=(ce,ne,Te)=>(ce>>=1,Kb.decode(v.subarray(ce,tc(v,ce,ne/2,Te)))),Kr=(ce,ne,Te)=>{if(Te??(Te=2147483647),2>Te)return 0;Te-=2;var Ce=ne;Te=Te<2*ce.length?Te/2:ce.length;for(var Ze=0;Ze<Te;++Ze)E[ne>>1]=ce.charCodeAt(Ze),ne+=2;return E[ne>>1]=0,ne-Ce},Ol=ce=>2*ce.length,Z0=(ce,ne,Te)=>{var Ce="";ce>>=2;for(var Ze=0;!(Ze>=ne/4);Ze++){var Et=I[ce+Ze];if(!Et&&!Te)break;Ce+=String.fromCodePoint(Et)}return Ce},Ma=(ce,ne,Te)=>{if(Te??(Te=2147483647),4>Te)return 0;var Ce=ne;Te=Ce+Te-4;for(var Ze=0;Ze<ce.length;++Ze){var Et=ce.codePointAt(Ze);if(65535<Et&&Ze++,S[ne>>2]=Et,ne+=4,ne+4>Te)break}return S[ne>>2]=0,ne-Ce},Ep=ce=>{for(var ne=0,Te=0;Te<ce.length;++Te)65535<ce.codePointAt(Te)&&Te++,ne+=4;return ne},Cy=[],Sq=ce=>{var ne=Cy.length;return Cy.push(ce),ne},wq=(ce,ne)=>{for(var Te=Array(ce),Ce=0;Ce<ce;++Ce)Te[Ce]=Wc(I[ne+4*Ce>>2],`parameter ${Ce}`);return Te},Iq=(ce,ne,Te)=>{var Ce=[];return ce=ce(Ce,Te),Ce.length&&(I[ne>>2]=qi(Ce)),ce},Pq={},Cp=ce=>{var ne=Pq[ce];return ne===void 0?ge(ce):ne},QC={},$b=()=>{var ce;if(!Lh){var ne={USER:"web_user",LOGNAME:"web_user",PATH:"/",PWD:"/",HOME:"/home/web_user",LANG:(((ce=globalThis.navigator)==null?void 0:ce.language)??"C").replace("-","_")+".UTF-8",_:f||"./this.program"},Te;for(Te in QC)QC[Te]===void 0?delete ne[Te]:ne[Te]=QC[Te];var Ce=[];for(Te in ne)Ce.push(`${Te}=${ne[Te]}`);Lh=Ce}return Lh},Lh,Dq=[null,[],[]];if((()=>{let ce=st.prototype;Object.assign(ce,{isAliasOf:function(Te){if(!(this instanceof st&&Te instanceof st))return!1;var Ce=this.M.R.N,Ze=this.M.P;Te.M=Te.M;var Et=Te.M.R.N;for(Te=Te.M.P;Ce.W;)Ze=Ce.fa(Ze),Ce=Ce.W;for(;Et.W;)Te=Et.fa(Te),Et=Et.W;return Ce===Et&&Ze===Te},clone:function(){if(this.M.P||Xe(this),this.M.ea)return this.M.count.value+=1,this;var Te=qe,Ce=Object,Ze=Ce.create,Et=Object.getPrototypeOf(this),pt=this.M;return Te=Te(Ze.call(Ce,Et,{M:{value:{count:pt.count,da:pt.da,ea:pt.ea,P:pt.P,R:pt.R,V:pt.V,Y:pt.Y}}})),Te.M.count.value+=1,Te.M.da=!1,Te},delete(){if(this.M.P||Xe(this),this.M.da&&!this.M.ea)throw new we("Object already scheduled for deletion");Pe(this);var Te=this.M;--Te.count.value,Te.count.value===0&&(Te.V?Te.Y.Z(Te.V):Te.R.N.Z(Te.P)),this.M.ea||(this.M.V=void 0,this.M.P=void 0)},isDeleted:function(){return!this.M.P},deleteLater:function(){if(this.M.P||Xe(this),this.M.da&&!this.M.ea)throw new we("Object already scheduled for deletion");return this.M.da=!0,this}});let ne=Symbol.dispose;ne&&(ce[ne]=ce.delete)})(),Object.assign(jn.prototype,{wa(ce){return this.pa&&(ce=this.pa(ce)),ce},ma(ce){var ne;(ne=this.Z)==null||ne.call(this,ce)},X:J,O:function(ce){function ne(){return this.ha?xi(this.N.ba,{R:this.Ba,P:Te,Y:this,V:ce}):xi(this.N.ba,{R:this,P:ce})}var Te=this.wa(ce);if(!Te)return this.ma(ce),null;var Ce=hi(this.N,Te);if(Ce!==void 0)return Ce.M.count.value===0?(Ce.M.P=Te,Ce.M.V=ce,Ce.clone()):(Ce=Ce.clone(),this.ma(ce),Ce);if(Ce=this.N.va(Te),Ce=Gt[Ce],!Ce)return ne.call(this);Ce=this.ga?Ce.sa:Ce.pointerType;var Ze=Wi(Te,this.N,Ce.N);return Ze===null?ne.call(this):this.ha?xi(Ce.N.ba,{R:Ce,P:Ze,Y:this,V:ce}):xi(Ce.N.ba,{R:Ce,P:Ze})}}),o.print&&(p=o.print),o.printErr&&(g=o.printErr),o.thisProgram&&(f=o.thisProgram),o.preInit)for(typeof o.preInit=="function"&&(o.preInit=[o.preInit]);0<o.preInit.length;)o.preInit.shift()();var Jb,ev,vp,Zb,nD,tv={y:()=>P(""),r:ce=>{var ne=Q[ce];delete Q[ce];var Te=ne.ka,Ce=ne.Z,Ze=ne.na,Et=Ze.map(pt=>pt.za).concat(Ze.map(pt=>pt.Fa));xe([ce],Et,pt=>{var wt={},bn,qn;for([bn,qn]of Ze.entries()){let _n=pt[bn],vo=qn.xa,mo=qn.ya,$s=pt[bn+Ze.length],Sc=qn.Ea,Ml=qn.Ga;wt[qn.ua]={read:vu=>_n.O(vo(mo,vu)),write:(vu,Q0)=>{var Ct=[];Sc(Ml,vu,$s.S(Ct,Q0)),W(Ct)},optional:_n.optional}}return[{name:ne.name,O:_n=>{var vo={},mo;for(mo in wt)vo[mo]=wt[mo].read(_n);return Ce(_n),vo},S:(_n,vo)=>{for(var mo in wt)if(!(mo in vo||wt[mo].optional))throw new TypeError(`Missing field: "${mo}"`);var $s=Te();for(mo in wt)wt[mo].write($s,vo[mo]);return _n!==null&&_n.push(Ce,$s),$s},X:J,T:Ce}]})},o:(ce,ne,Te,Ce,Ze)=>{ne=ge(ne),Ce=Ce===0n;let Et=pt=>pt;if(Ce){let pt=8*Te;Et=wt=>BigInt.asUintN(pt,wt),Ze=Et(Ze)}Qe(ce,{name:ne,O:Et,S:(pt,wt)=>(typeof wt=="number"&&(wt=BigInt(wt)),wt),X:He(ne,Te,!Ce),T:null})},C:(ce,ne,Te,Ce)=>{ne=ge(ne),Qe(ce,{name:ne,O:function(Ze){return!!Ze},S:function(Ze,Et){return Et?Te:Ce},X:function(Ze){return this.O(T[Ze])},T:null})},k:(ce,ne,Te,Ce,Ze,Et,pt,wt,bn,qn,_n,vo,mo)=>{_n=ge(_n),Et=Wn(Ze,Et),wt&&(wt=Wn(pt,wt)),qn&&(qn=Wn(bn,qn)),mo=Wn(vo,mo);var $s=ft(_n);mt($s,function(){fo(`Cannot construct ${_n} due to unbound types`,[Ce])}),xe([ce,ne,Te],Ce?[Ce]:[],Sc=>{if(Sc=Sc[0],Ce)var Ml=Sc.N,vu=Ml.ba;else vu=st.prototype;Sc=vt(_n,function(...Fe){if(Object.getPrototypeOf(this)!==Q0)throw new we(`Use 'new' to construct ${_n}`);if(Ct.aa===void 0)throw new we(`${_n} has no accessible constructor`);var gt=Ct.aa[Fe.length];if(gt===void 0)throw new we(`Tried to invoke ctor of ${_n} with invalid number of parameters (${Fe.length}) - expected (${Object.keys(Ct.aa).toString()}) parameters instead!`);return gt.apply(this,Fe)});var Q0=Object.create(vu,{constructor:{value:Sc}});Sc.prototype=Q0;var Ct=new Xt(_n,Sc,Q0,mo,Ml,Et,wt,qn);if(Ct.W){var ye;(ye=Ct.W).la??(ye.la=[]),Ct.W.la.push(Ct)}return Ml=new jn(_n,Ct,!0,!1,!1),ye=new jn(_n+"*",Ct,!1,!1,!1),vu=new jn(_n+" const*",Ct,!1,!0,!1),Gt[ce]={pointerType:ye,sa:vu},nn($s,Sc),[Ml,ye,vu]})},g:(ce,ne,Te,Ce,Ze,Et)=>{var pt=Bs(ne,Te);Ze=Wn(Ce,Ze),xe([],[ce],wt=>{wt=wt[0];var bn=`constructor ${wt.name}`;if(wt.N.aa===void 0&&(wt.N.aa=[]),wt.N.aa[ne-1]!==void 0)throw new we(`Cannot register multiple constructors with identical number of parameters (${ne-1}) for class '${wt.name}'! Overload resolution is currently only performed using the parameter count, not actual type info!`);return wt.N.aa[ne-1]=()=>{fo(`Cannot construct ${wt.name} due to unbound types`,pt)},xe([],pt,qn=>(qn.splice(1,0,null),wt.N.aa[ne-1]=no(bn,qn,null,Ze,Et),[])),[]})},b:(ce,ne,Te,Ce,Ze,Et,pt,wt,bn)=>{var qn=Bs(Te,Ce);ne=ge(ne),ne=gi(ne),Et=Wn(Ze,Et),xe([],[ce],_n=>{function vo(){fo(`Cannot call ${mo} due to unbound types`,qn)}_n=_n[0];var mo=`${_n.name}.${ne}`;ne.startsWith("@@")&&(ne=Symbol[ne.substring(2)]),wt&&_n.N.Ca.push(ne);var $s=_n.N.ba,Sc=$s[ne];return Sc===void 0||Sc.U===void 0&&Sc.className!==_n.name&&Sc.$===Te-2?(vo.$=Te-2,vo.className=_n.name,$s[ne]=vo):(lt($s,ne,mo),$s[ne].U[Te-2]=vo),xe([],qn,Ml=>(Ml=no(mo,Ml,_n,Et,pt,bn),$s[ne].U===void 0?(Ml.$=Te-2,$s[ne]=Ml):$s[ne].U[Te-2]=Ml,[])),[]})},A:ce=>Qe(ce,ki),s:(ce,ne,Te,Ce,Ze)=>{switch(ne=ge(ne),Ze=Ze===0?"object":Ze===1?"number":"string",Ze){case"object":let pt=function(){};pt.values={},Qe(ce,{name:ne,constructor:pt,valueType:Ze,O:function(wt){return this.constructor.values[wt]},S:(wt,bn)=>bn.value,X:Nr(ne,Te,Ce),T:null}),mt(ne,pt);break;case"number":var Et={};Qe(ce,{name:ne,ja:Et,valueType:Ze,O:wt=>wt,S:(wt,bn)=>bn,X:Nr(ne,Te,Ce),T:null}),mt(ne,Et),delete o[ne].$;break;case"string":Et={},Qe(ce,{name:ne,ra:{},qa:{},ja:Et,valueType:Ze,O:function(wt){return this.qa[wt]},S:function(wt,bn){return this.ra[bn]},X:Nr(ne,Te,Ce),T:null}),mt(ne,Et),delete o[ne].$}},d:(ce,ne,Te)=>{var Ce=Wc(ce,"enum");switch(ne=ge(ne),Ce.valueType){case"object":ce=Ce.constructor,Ce=Object.create(Ce.constructor.prototype,{value:{value:Te},constructor:{value:vt(`${Ce.name}_${ne}`,function(){})}}),ce.values[Te]=Ce,ce[ne]=Ce;break;case"number":Ce.ja[ne]=Te;break;case"string":Ce.ra[ne]=Te,Ce.qa[Te]=ne,Ce.ja[ne]=ne}},n:(ce,ne,Te)=>{ne=ge(ne),Qe(ce,{name:ne,O:Ce=>Ce,S:(Ce,Ze)=>Ze,X:xd(ne,Te),T:null})},m:(ce,ne,Te,Ce,Ze,Et,pt)=>{var wt=Bs(ne,Te);ce=ge(ce),ce=gi(ce),Ze=Wn(Ce,Ze),mt(ce,function(){fo(`Cannot call ${ce} due to unbound types`,wt)},ne-1),xe([],wt,bn=>(bn=[bn[0],null].concat(bn.slice(1)),nn(ce,no(ce,bn,null,Ze,Et,pt),ne-1),[]))},c:(ce,ne,Te,Ce,Ze)=>{ne=ge(ne);let Et=wt=>wt;if(Ce===0){var pt=32-8*Te;Et=wt=>wt<<pt>>>pt,Ze=Et(Ze)}Qe(ce,{name:ne,O:Et,S:(wt,bn)=>bn,X:He(ne,Te,Ce!==0),T:null})},j:(ce,ne,Te,Ce)=>{Te=ge(Te),Ce=ge(Ce),xe([],[ce,ne],Ze=>(xp(Ze[0].N.ba,Te,Ce),[]))},a:(ce,ne,Te)=>{function Ce(Et){return new Ze(x.buffer,I[Et+4>>2],I[Et>>2])}var Ze=[Int8Array,Uint8Array,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array,BigInt64Array,BigUint64Array][ne];Te=ge(Te),Qe(ce,{name:Te,O:Ce,X:Ce},{Aa:!0})},h:ce=>{Qe(ce,Nh)},B:(ce,ne)=>{ne=ge(ne),Qe(ce,{name:ne,O(Te){var Ce=(Ce=Te+4)?ks.decode(T.subarray(Ce,tc(T,Ce,I[Te>>2],!0))):"";return vp(Te),Ce},S(Te,Ce){Ce instanceof ArrayBuffer&&(Ce=new Uint8Array(Ce));var Ze=typeof Ce=="string";if(!(Ze||ArrayBuffer.isView(Ce)&&Ce.BYTES_PER_ELEMENT==1))throw new we("Cannot pass non-string to std::string");var Et=Ze?Tp(Ce):Ce.length,pt=ev(4+Et+1),wt=pt+4;return I[pt>>2]=Et,Ze?da(Ce,wt,Et+1):T.set(Ce,wt),Te!==null&&Te.push(vp,pt),pt},X:J,T(Te){vp(Te)}})},f:(ce,ne,Te)=>{if(Te=ge(Te),ne===2)var Ce=ri,Ze=Kr,Et=Ol;else Ce=Z0,Ze=Ma,Et=Ep;Qe(ce,{name:Te,O:pt=>{var wt=Ce(pt+4,I[pt>>2]*ne,!0);return vp(pt),wt},S:(pt,wt)=>{if(typeof wt!="string")throw new we(`Cannot pass non-string to C++ string type ${Te}`);var bn=Et(wt),qn=ev(4+bn+ne);return I[qn>>2]=bn/ne,Ze(wt,qn+4,bn+ne),pt!==null&&pt.push(vp,qn),qn},X:J,T(pt){vp(pt)}})},i:(ce,ne,Te,Ce,Ze,Et)=>{Q[ce]={name:ge(ne),ka:Wn(Te,Ce),Z:Wn(Ze,Et),na:[]}},e:(ce,ne,Te,Ce,Ze,Et,pt,wt,bn,qn)=>{Q[ce].na.push({ua:ge(ne),za:Te,xa:Wn(Ce,Ze),ya:Et,Fa:pt,Ea:Wn(wt,bn),Ga:qn})},D:(ce,ne)=>{ne=ge(ne),Qe(ce,{oa:!0,name:ne,O:()=>{},S:()=>{}})},q:(ce,ne,Te)=>{var[Ce,...Ze]=wq(ce,ne);ne=Ce.S.bind(Ce);var Et=Ze.map(bn=>bn.X.bind(bn));ce--;var pt={toValue:Bn};switch(ce=Et.map((bn,qn)=>{var _n=`argFromPtr${qn}`;return pt[_n]=bn,`${_n}(args${qn?"+"+8*qn:""})`}),Te){case 0:var wt="toValue(handle)";break;case 2:wt="new (toValue(handle))";break;case 3:wt="";break;case 1:pt.getStringOrSymbol=Cp,wt="toValue(handle)[getStringOrSymbol(methodName)]"}return wt+=`(${ce})`,Ce.oa||(pt.toReturnWire=ne,pt.emval_returnValue=Iq,wt=`return emval_returnValue(toReturnWire, destructorsRef, ${wt})`),wt=`return function (handle, methodName, destructorsRef, args) { +`)(...Ce),vt(ce,ne)}var gi=ce=>{ce=ce.trim();let ne=ce.indexOf("(");return ne===-1?ce:ce.slice(0,ne)},ho=[],ur=[0,1,,1,null,1,!0,1,!1,1],Zo=ce=>{9<ce&&--ur[ce+1]===0&&(ur[ce]=void 0,ho.push(ce))},Bn=ce=>{if(!ce)throw new we(`Cannot use deleted val. handle = ${ce}`);return ur[ce]},qi=ce=>{switch(ce){case void 0:return 2;case null:return 4;case!0:return 6;case!1:return 8;default:let ne=ho.pop()||ur.length;return ur[ne]=ce,ur[ne+1]=1,ne}},ki={name:"emscripten::val",O:ce=>{var ne=Bn(ce);return Zo(ce),ne},S:(ce,ne)=>qi(ne),X:J,T:null},Nr=(ce,ne,Te)=>{switch(ne){case 1:return Te?function(Ce){return this.O(x[Ce])}:function(Ce){return this.O(T[Ce])};case 2:return Te?function(Ce){return this.O(E[Ce>>1])}:function(Ce){return this.O(v[Ce>>1])};case 4:return Te?function(Ce){return this.O(S[Ce>>2])}:function(Ce){return this.O(I[Ce>>2])};default:throw new TypeError(`invalid integer width (${ne}): ${ce}`)}},Wc=(ce,ne)=>{var Te=ae[ce];if(Te===void 0)throw ce=`${ne} has unknown type ${Mr(ce)}`,new we(ce);return Te},bd=(ce,ne)=>{switch(ne){case 4:return function(Te){return this.O(R[Te>>2])};case 8:return function(Te){return this.O(O[Te>>3])};default:throw new TypeError(`invalid float width (${ne}): ${ce}`)}},xp=(ce,ne,Te)=>{let Ce=(Ze,Et)=>{let pt=0;return{next(){if(pt>=Ze)return{done:!0};let wt=pt;return pt++,{value:Et(wt),done:!1}},[Symbol.iterator](){return this}}};ce[Symbol.iterator]||(ce[Symbol.iterator]=function(){let Ze=this[ne]();return Ce(Ze,Et=>this[Te](Et))})},Nh=Object.assign({optional:!0},ki),da=(ce,ne,Te)=>{var Ce=T;if(!(0<Te))return 0;var Ze=ne;Te=ne+Te-1;for(var Et=0;Et<ce.length;++Et){var pt=ce.codePointAt(Et);if(127>=pt){if(ne>=Te)break;Ce[ne++]=pt}else if(2047>=pt){if(ne+1>=Te)break;Ce[ne++]=192|pt>>6,Ce[ne++]=128|pt&63}else if(65535>=pt){if(ne+2>=Te)break;Ce[ne++]=224|pt>>12,Ce[ne++]=128|pt>>6&63,Ce[ne++]=128|pt&63}else{if(ne+3>=Te)break;Ce[ne++]=240|pt>>18,Ce[ne++]=128|pt>>12&63,Ce[ne++]=128|pt>>6&63,Ce[ne++]=128|pt&63,Et++}}return Ce[ne]=0,ne-Ze},Tp=ce=>{for(var ne=0,Te=0;Te<ce.length;++Te){var Ce=ce.charCodeAt(Te);127>=Ce?ne++:2047>=Ce?ne+=2:55296<=Ce&&57343>=Ce?(ne+=4,++Te):ne+=3}return ne},ks=new TextDecoder,tc=(ce,ne,Te,Ce)=>{if(Te=ne+Te,Ce)return Te;for(;ce[ne]&&!(ne>=Te);)++ne;return ne},Kb=new TextDecoder("utf-16le"),ri=(ce,ne,Te)=>(ce>>=1,Kb.decode(v.subarray(ce,tc(v,ce,ne/2,Te)))),Kr=(ce,ne,Te)=>{if(Te??(Te=2147483647),2>Te)return 0;Te-=2;var Ce=ne;Te=Te<2*ce.length?Te/2:ce.length;for(var Ze=0;Ze<Te;++Ze)E[ne>>1]=ce.charCodeAt(Ze),ne+=2;return E[ne>>1]=0,ne-Ce},Ol=ce=>2*ce.length,Z0=(ce,ne,Te)=>{var Ce="";ce>>=2;for(var Ze=0;!(Ze>=ne/4);Ze++){var Et=I[ce+Ze];if(!Et&&!Te)break;Ce+=String.fromCodePoint(Et)}return Ce},Ma=(ce,ne,Te)=>{if(Te??(Te=2147483647),4>Te)return 0;var Ce=ne;Te=Ce+Te-4;for(var Ze=0;Ze<ce.length;++Ze){var Et=ce.codePointAt(Ze);if(65535<Et&&Ze++,S[ne>>2]=Et,ne+=4,ne+4>Te)break}return S[ne>>2]=0,ne-Ce},Ep=ce=>{for(var ne=0,Te=0;Te<ce.length;++Te)65535<ce.codePointAt(Te)&&Te++,ne+=4;return ne},Cy=[],Sq=ce=>{var ne=Cy.length;return Cy.push(ce),ne},wq=(ce,ne)=>{for(var Te=Array(ce),Ce=0;Ce<ce;++Ce)Te[Ce]=Wc(I[ne+4*Ce>>2],`parameter ${Ce}`);return Te},Iq=(ce,ne,Te)=>{var Ce=[];return ce=ce(Ce,Te),Ce.length&&(I[ne>>2]=qi(Ce)),ce},Pq={},Cp=ce=>{var ne=Pq[ce];return ne===void 0?ge(ce):ne},QC={},$b=()=>{var ce;if(!Lh){var ne={USER:"web_user",LOGNAME:"web_user",PATH:"/",PWD:"/",HOME:"/home/web_user",LANG:(((ce=globalThis.navigator)==null?void 0:ce.language)??"C").replace("-","_")+".UTF-8",_:f||"./this.program"},Te;for(Te in QC)QC[Te]===void 0?delete ne[Te]:ne[Te]=QC[Te];var Ce=[];for(Te in ne)Ce.push(`${Te}=${ne[Te]}`);Lh=Ce}return Lh},Lh,Dq=[null,[],[]];if((()=>{let ce=st.prototype;Object.assign(ce,{isAliasOf:function(Te){if(!(this instanceof st&&Te instanceof st))return!1;var Ce=this.M.R.N,Ze=this.M.P;Te.M=Te.M;var Et=Te.M.R.N;for(Te=Te.M.P;Ce.W;)Ze=Ce.fa(Ze),Ce=Ce.W;for(;Et.W;)Te=Et.fa(Te),Et=Et.W;return Ce===Et&&Ze===Te},clone:function(){if(this.M.P||Xe(this),this.M.ea)return this.M.count.value+=1,this;var Te=qe,Ce=Object,Ze=Ce.create,Et=Object.getPrototypeOf(this),pt=this.M;return Te=Te(Ze.call(Ce,Et,{M:{value:{count:pt.count,da:pt.da,ea:pt.ea,P:pt.P,R:pt.R,V:pt.V,Y:pt.Y}}})),Te.M.count.value+=1,Te.M.da=!1,Te},delete(){if(this.M.P||Xe(this),this.M.da&&!this.M.ea)throw new we("Object already scheduled for deletion");Pe(this);var Te=this.M;--Te.count.value,Te.count.value===0&&(Te.V?Te.Y.Z(Te.V):Te.R.N.Z(Te.P)),this.M.ea||(this.M.V=void 0,this.M.P=void 0)},isDeleted:function(){return!this.M.P},deleteLater:function(){if(this.M.P||Xe(this),this.M.da&&!this.M.ea)throw new we("Object already scheduled for deletion");return this.M.da=!0,this}});let ne=Symbol.dispose;ne&&(ce[ne]=ce.delete)})(),Object.assign(jn.prototype,{wa(ce){return this.pa&&(ce=this.pa(ce)),ce},ma(ce){var ne;(ne=this.Z)==null||ne.call(this,ce)},X:J,O:function(ce){function ne(){return this.ha?xi(this.N.ba,{R:this.Ba,P:Te,Y:this,V:ce}):xi(this.N.ba,{R:this,P:ce})}var Te=this.wa(ce);if(!Te)return this.ma(ce),null;var Ce=hi(this.N,Te);if(Ce!==void 0)return Ce.M.count.value===0?(Ce.M.P=Te,Ce.M.V=ce,Ce.clone()):(Ce=Ce.clone(),this.ma(ce),Ce);if(Ce=this.N.va(Te),Ce=Gt[Ce],!Ce)return ne.call(this);Ce=this.ga?Ce.sa:Ce.pointerType;var Ze=Wi(Te,this.N,Ce.N);return Ze===null?ne.call(this):this.ha?xi(Ce.N.ba,{R:Ce,P:Ze,Y:this,V:ce}):xi(Ce.N.ba,{R:Ce,P:Ze})}}),o.print&&(p=o.print),o.printErr&&(g=o.printErr),o.thisProgram&&(f=o.thisProgram),o.preInit)for(typeof o.preInit=="function"&&(o.preInit=[o.preInit]);0<o.preInit.length;)o.preInit.shift()();var Jb,ev,vp,Zb,nD,tv={y:()=>P(""),r:ce=>{var ne=Q[ce];delete Q[ce];var Te=ne.ka,Ce=ne.Z,Ze=ne.na,Et=Ze.map(pt=>pt.za).concat(Ze.map(pt=>pt.Fa));xe([ce],Et,pt=>{var wt={},bn,qn;for([bn,qn]of Ze.entries()){let _n=pt[bn],vo=qn.xa,mo=qn.ya,$s=pt[bn+Ze.length],Sc=qn.Ea,Ml=qn.Ga;wt[qn.ua]={read:vu=>_n.O(vo(mo,vu)),write:(vu,Q0)=>{var Ct=[];Sc(Ml,vu,$s.S(Ct,Q0)),W(Ct)},optional:_n.optional}}return[{name:ne.name,O:_n=>{var vo={},mo;for(mo in wt)vo[mo]=wt[mo].read(_n);return Ce(_n),vo},S:(_n,vo)=>{for(var mo in wt)if(!(mo in vo||wt[mo].optional))throw new TypeError(`Missing field: "${mo}"`);var $s=Te();for(mo in wt)wt[mo].write($s,vo[mo]);return _n!==null&&_n.push(Ce,$s),$s},X:J,T:Ce}]})},o:(ce,ne,Te,Ce,Ze)=>{ne=ge(ne),Ce=Ce===0n;let Et=pt=>pt;if(Ce){let pt=8*Te;Et=wt=>BigInt.asUintN(pt,wt),Ze=Et(Ze)}Qe(ce,{name:ne,O:Et,S:(pt,wt)=>(typeof wt=="number"&&(wt=BigInt(wt)),wt),X:He(ne,Te,!Ce),T:null})},C:(ce,ne,Te,Ce)=>{ne=ge(ne),Qe(ce,{name:ne,O:function(Ze){return!!Ze},S:function(Ze,Et){return Et?Te:Ce},X:function(Ze){return this.O(T[Ze])},T:null})},k:(ce,ne,Te,Ce,Ze,Et,pt,wt,bn,qn,_n,vo,mo)=>{_n=ge(_n),Et=Wn(Ze,Et),wt&&(wt=Wn(pt,wt)),qn&&(qn=Wn(bn,qn)),mo=Wn(vo,mo);var $s=ft(_n);mt($s,function(){fo(`Cannot construct ${_n} due to unbound types`,[Ce])}),xe([ce,ne,Te],Ce?[Ce]:[],Sc=>{if(Sc=Sc[0],Ce)var Ml=Sc.N,vu=Ml.ba;else vu=st.prototype;Sc=vt(_n,function(...Fe){if(Object.getPrototypeOf(this)!==Q0)throw new we(`Use 'new' to construct ${_n}`);if(Ct.aa===void 0)throw new we(`${_n} has no accessible constructor`);var gt=Ct.aa[Fe.length];if(gt===void 0)throw new we(`Tried to invoke ctor of ${_n} with invalid number of parameters (${Fe.length}) - expected (${Object.keys(Ct.aa).toString()}) parameters instead!`);return gt.apply(this,Fe)});var Q0=Object.create(vu,{constructor:{value:Sc}});Sc.prototype=Q0;var Ct=new Xt(_n,Sc,Q0,mo,Ml,Et,wt,qn);if(Ct.W){var ye;(ye=Ct.W).la??(ye.la=[]),Ct.W.la.push(Ct)}return Ml=new jn(_n,Ct,!0,!1,!1),ye=new jn(_n+"*",Ct,!1,!1,!1),vu=new jn(_n+" const*",Ct,!1,!0,!1),Gt[ce]={pointerType:ye,sa:vu},nn($s,Sc),[Ml,ye,vu]})},g:(ce,ne,Te,Ce,Ze,Et)=>{var pt=Bs(ne,Te);Ze=Wn(Ce,Ze),xe([],[ce],wt=>{wt=wt[0];var bn=`constructor ${wt.name}`;if(wt.N.aa===void 0&&(wt.N.aa=[]),wt.N.aa[ne-1]!==void 0)throw new we(`Cannot register multiple constructors with identical number of parameters (${ne-1}) for class '${wt.name}'! Overload resolution is currently only performed using the parameter count, not actual type info!`);return wt.N.aa[ne-1]=()=>{fo(`Cannot construct ${wt.name} due to unbound types`,pt)},xe([],pt,qn=>(qn.splice(1,0,null),wt.N.aa[ne-1]=no(bn,qn,null,Ze,Et),[])),[]})},b:(ce,ne,Te,Ce,Ze,Et,pt,wt,bn)=>{var qn=Bs(Te,Ce);ne=ge(ne),ne=gi(ne),Et=Wn(Ze,Et),xe([],[ce],_n=>{function vo(){fo(`Cannot call ${mo} due to unbound types`,qn)}_n=_n[0];var mo=`${_n.name}.${ne}`;ne.startsWith("@@")&&(ne=Symbol[ne.substring(2)]),wt&&_n.N.Ca.push(ne);var $s=_n.N.ba,Sc=$s[ne];return Sc===void 0||Sc.U===void 0&&Sc.className!==_n.name&&Sc.$===Te-2?(vo.$=Te-2,vo.className=_n.name,$s[ne]=vo):(lt($s,ne,mo),$s[ne].U[Te-2]=vo),xe([],qn,Ml=>(Ml=no(mo,Ml,_n,Et,pt,bn),$s[ne].U===void 0?(Ml.$=Te-2,$s[ne]=Ml):$s[ne].U[Te-2]=Ml,[])),[]})},A:ce=>Qe(ce,ki),s:(ce,ne,Te,Ce,Ze)=>{switch(ne=ge(ne),Ze=Ze===0?"object":Ze===1?"number":"string",Ze){case"object":let pt=function(){};pt.values={},Qe(ce,{name:ne,constructor:pt,valueType:Ze,O:function(wt){return this.constructor.values[wt]},S:(wt,bn)=>bn.value,X:Nr(ne,Te,Ce),T:null}),mt(ne,pt);break;case"number":var Et={};Qe(ce,{name:ne,ja:Et,valueType:Ze,O:wt=>wt,S:(wt,bn)=>bn,X:Nr(ne,Te,Ce),T:null}),mt(ne,Et),delete o[ne].$;break;case"string":Et={},Qe(ce,{name:ne,ra:{},qa:{},ja:Et,valueType:Ze,O:function(wt){return this.qa[wt]},S:function(wt,bn){return this.ra[bn]},X:Nr(ne,Te,Ce),T:null}),mt(ne,Et),delete o[ne].$}},d:(ce,ne,Te)=>{var Ce=Wc(ce,"enum");switch(ne=ge(ne),Ce.valueType){case"object":ce=Ce.constructor,Ce=Object.create(Ce.constructor.prototype,{value:{value:Te},constructor:{value:vt(`${Ce.name}_${ne}`,function(){})}}),ce.values[Te]=Ce,ce[ne]=Ce;break;case"number":Ce.ja[ne]=Te;break;case"string":Ce.ra[ne]=Te,Ce.qa[Te]=ne,Ce.ja[ne]=ne}},n:(ce,ne,Te)=>{ne=ge(ne),Qe(ce,{name:ne,O:Ce=>Ce,S:(Ce,Ze)=>Ze,X:bd(ne,Te),T:null})},m:(ce,ne,Te,Ce,Ze,Et,pt)=>{var wt=Bs(ne,Te);ce=ge(ce),ce=gi(ce),Ze=Wn(Ce,Ze),mt(ce,function(){fo(`Cannot call ${ce} due to unbound types`,wt)},ne-1),xe([],wt,bn=>(bn=[bn[0],null].concat(bn.slice(1)),nn(ce,no(ce,bn,null,Ze,Et,pt),ne-1),[]))},c:(ce,ne,Te,Ce,Ze)=>{ne=ge(ne);let Et=wt=>wt;if(Ce===0){var pt=32-8*Te;Et=wt=>wt<<pt>>>pt,Ze=Et(Ze)}Qe(ce,{name:ne,O:Et,S:(wt,bn)=>bn,X:He(ne,Te,Ce!==0),T:null})},j:(ce,ne,Te,Ce)=>{Te=ge(Te),Ce=ge(Ce),xe([],[ce,ne],Ze=>(xp(Ze[0].N.ba,Te,Ce),[]))},a:(ce,ne,Te)=>{function Ce(Et){return new Ze(x.buffer,I[Et+4>>2],I[Et>>2])}var Ze=[Int8Array,Uint8Array,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array,BigInt64Array,BigUint64Array][ne];Te=ge(Te),Qe(ce,{name:Te,O:Ce,X:Ce},{Aa:!0})},h:ce=>{Qe(ce,Nh)},B:(ce,ne)=>{ne=ge(ne),Qe(ce,{name:ne,O(Te){var Ce=(Ce=Te+4)?ks.decode(T.subarray(Ce,tc(T,Ce,I[Te>>2],!0))):"";return vp(Te),Ce},S(Te,Ce){Ce instanceof ArrayBuffer&&(Ce=new Uint8Array(Ce));var Ze=typeof Ce=="string";if(!(Ze||ArrayBuffer.isView(Ce)&&Ce.BYTES_PER_ELEMENT==1))throw new we("Cannot pass non-string to std::string");var Et=Ze?Tp(Ce):Ce.length,pt=ev(4+Et+1),wt=pt+4;return I[pt>>2]=Et,Ze?da(Ce,wt,Et+1):T.set(Ce,wt),Te!==null&&Te.push(vp,pt),pt},X:J,T(Te){vp(Te)}})},f:(ce,ne,Te)=>{if(Te=ge(Te),ne===2)var Ce=ri,Ze=Kr,Et=Ol;else Ce=Z0,Ze=Ma,Et=Ep;Qe(ce,{name:Te,O:pt=>{var wt=Ce(pt+4,I[pt>>2]*ne,!0);return vp(pt),wt},S:(pt,wt)=>{if(typeof wt!="string")throw new we(`Cannot pass non-string to C++ string type ${Te}`);var bn=Et(wt),qn=ev(4+bn+ne);return I[qn>>2]=bn/ne,Ze(wt,qn+4,bn+ne),pt!==null&&pt.push(vp,qn),qn},X:J,T(pt){vp(pt)}})},i:(ce,ne,Te,Ce,Ze,Et)=>{Q[ce]={name:ge(ne),ka:Wn(Te,Ce),Z:Wn(Ze,Et),na:[]}},e:(ce,ne,Te,Ce,Ze,Et,pt,wt,bn,qn)=>{Q[ce].na.push({ua:ge(ne),za:Te,xa:Wn(Ce,Ze),ya:Et,Fa:pt,Ea:Wn(wt,bn),Ga:qn})},D:(ce,ne)=>{ne=ge(ne),Qe(ce,{oa:!0,name:ne,O:()=>{},S:()=>{}})},q:(ce,ne,Te)=>{var[Ce,...Ze]=wq(ce,ne);ne=Ce.S.bind(Ce);var Et=Ze.map(bn=>bn.X.bind(bn));ce--;var pt={toValue:Bn};switch(ce=Et.map((bn,qn)=>{var _n=`argFromPtr${qn}`;return pt[_n]=bn,`${_n}(args${qn?"+"+8*qn:""})`}),Te){case 0:var wt="toValue(handle)";break;case 2:wt="new (toValue(handle))";break;case 3:wt="";break;case 1:pt.getStringOrSymbol=Cp,wt="toValue(handle)[getStringOrSymbol(methodName)]"}return wt+=`(${ce})`,Ce.oa||(pt.toReturnWire=ne,pt.emval_returnValue=Iq,wt=`return emval_returnValue(toReturnWire, destructorsRef, ${wt})`),wt=`return function (handle, methodName, destructorsRef, args) { ${wt} }`,Te=new Function(Object.keys(pt),wt)(...Object.values(pt)),wt=`methodCaller<(${Ze.map(bn=>bn.name)}) => ${Ce.name}>`,Sq(vt(wt,Te))},F:Zo,p:(ce,ne,Te,Ce,Ze)=>Cy[ce](ne,Te,Ce,Ze),E:ce=>{var ne=Bn(ce);W(ne),Zo(ce)},t:(ce,ne,Te,Ce)=>{var Ze=new Date().getFullYear(),Et=new Date(Ze,0,1).getTimezoneOffset();Ze=new Date(Ze,6,1).getTimezoneOffset(),I[ce>>2]=60*Math.max(Et,Ze),S[ne>>2]=+(Et!=Ze),ne=pt=>{var wt=Math.abs(pt);return`UTC${0<=pt?"-":"+"}${String(Math.floor(wt/60)).padStart(2,"0")}${String(wt%60).padStart(2,"0")}`},ce=ne(Et),ne=ne(Ze),Ze<Et?(da(ce,Te,17),da(ne,Ce,17)):(da(ce,Ce,17),da(ne,Te,17))},z:ce=>{var ne=T.length;if(ce>>>=0,2147483648<ce)return!1;for(var Te=1;4>=Te;Te*=2){var Ce=ne*(1+.2/Te);Ce=Math.min(Ce,ce+100663296);e:{Ce=(Math.min(2147483648,65536*Math.ceil(Math.max(ce,Ce)/65536))-Zb.buffer.byteLength+65535)/65536|0;try{Zb.grow(Ce),w();var Ze=1;break e}catch{}Ze=void 0}if(Ze)return!0}return!1},u:(ce,ne)=>{var Te=0,Ce=0,Ze;for(Ze of $b()){var Et=ne+Te;I[ce+Ce>>2]=Et,Te+=da(Ze,Et,1/0)+1,Ce+=4}return 0},v:(ce,ne)=>{var Te=$b();I[ce>>2]=Te.length,ce=0;for(var Ce of Te)ce+=Tp(Ce)+1;return I[ne>>2]=ce,0},w:()=>52,x:function(){return 70},l:(ce,ne,Te,Ce)=>{for(var Ze=0,Et=0;Et<Te;Et++){var pt=I[ne>>2],wt=I[ne+4>>2];ne+=8;for(var bn=0;bn<wt;bn++){var qn=ce,_n=T[pt+bn],vo=Dq[qn];_n===0||_n===10?(qn=qn===1?p:g,_n=tc(vo,0),_n=ks.decode(vo.buffer?vo.subarray(0,_n):new Uint8Array(vo.slice(0,_n))),qn(_n),vo.length=0):vo.push(_n)}Ze+=wt}return I[Ce>>2]=Ze,0}},vy;return vy=await(async function(){function ce(Te){return Te=vy=Te.exports,Jb=Te.J,ev=o._malloc=Te.K,vp=o._free=Te.L,Zb=Te.G,nD=Te.I,w(),vy}var ne={a:tv};return o.instantiateWasm?new Promise(Te=>{o.instantiateWasm(ne,(Ce,Ze)=>{Te(ce(Ce))})}):(M??(M=y(`\0asm\0\0\0\xD79\`\x7F\x7F\`\x7F\x7F\0\`\x7F\x7F\x7F\x7F\`\x7F\x7F\x7F\`\x7F\0\`\x7F\x7F\x7F\x7F\x7F\x7F\x7F\`\x7F\x7F\x7F\x7F\x7F\`\x7F\x7F\x7F\0\`\x7F\x7F\x7F\x7F\0\`\x7F\x7F\x7F\x7F\x7F\x7F\`\x7F\x7F\x7F\x7F\x7F\0\`\x7F\x7F\x7F\x7F\x7F\x7F\0\`\b\x7F\x7F\x7F\x7F\x7F\x7F\x7F\x7F\x7F\`\0\0\`\x07\x7F\x7F\x7F\x7F\x7F\x7F\x7F\x7F\`\x7F~~~~\0\`\0\x7F\` \x7F\x7F\x7F\x7F\x7F\x7F\x7F\x7F\x7F\x7F\0\`\x07\x7F\x7F\x7F\x7F\x7F\x7F\x7F\0\`\x7F\x7F\x7F\x7F~\x7F\`\b\x7F\x7F\x7F\x7F\x7F\x7F\x7F\x7F\0\`\x7F~~\x7F\0\`\x7F~\x7F~\`\x7F\x7F~\x7F\x7F\0\` @@ -8155,7 +8025,7 @@ OW\xC6\xBF\xA0\x8E\v{"^\xF2?\0\x81\x9C\xC7+\xAA\xC1\xBF?4JJ\xBB\xF1?^\x8C\xCEv \0\0\0d\0\0\0\xE8\0\0'\0\0\xA0\x86\0@B\0\x80\x96\x98\0\0\xE1\xF5\0\xCA\x9A;\0\0\0\0\0\0\0\x0000010203040506070809101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899\0\0\0\0\0\0\0\x00000000010010001101000101011001111000100110101011110011011110111100010203040506071011121314151617202122232425262730313233343536374041424344454647505152535455565760616263646566677071727374757677000102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f202122232425262728292a2b2c2d2e2f303132333435363738393a3b3c3d3e3f404142434445464748494a4b4c4d4e4f505152535455565758595a5b5c5d5e5f606162636465666768696a6b6c6d6e6f707172737475767778797a7b7c7d7e7f808182838485868788898a8b8c8d8e8f909192939495969798999a9b9c9d9e9fa0a1a2a3a4a5a6a7a8a9aaabacadaeafb0b1b2b3b4b5b6b7b8b9babbbcbdbebfc0c1c2c3c4c5c6c7c8c9cacbcccdcecfd0d1d2d3d4d5d6d7d8d9dadbdcdddedfe0e1e2e3e4e5e6e7e8e9eaebecedeeeff0f1f2f3f4f5f6f7f8f9fafbfcfdfeff\0\0\0\0\0\0\0\0 \0\0\0\0\0\0\0d\0\0\0\0\0\0\0\xE8\0\0\0\0\0\0'\0\0\0\0\0\0\xA0\x86\0\0\0\0\0@B\0\0\0\0\0\x80\x96\x98\0\0\0\0\0\0\xE1\xF5\0\0\0\0\0\xCA\x9A;\0\0\0\0\0\xE4\vT\0\0\0\0\xE8vH\0\0\0\0\xA5\xD4\xE8\0\0\0\0\xA0rN \0\0\0@z\xF3Z\0\0\0\x80\xC6\xA4~\x8D\0\0\0\xC1o\xF2\x86#\0\0\0\x8A]xEc\0\0d\xA7\xB3\xB6\xE0\r\0\0\xE8\x89#\xC7\x8A\xA4d\0\0\xF8a\0\0NSt3__214__shared_countE\0\0\0\0hf\0\0\xCCd\0\0$b\0\0\x98e\0\0N10__cxxabiv116__shim_type_infoE\0\0\0\0\xCCd\0\0Tb\0\0b\0\0N10__cxxabiv117__class_type_infoE\0\0\0\xCCd\0\0\x84b\0\0b\0\0N10__cxxabiv117__pbase_type_infoE\0\0\0\xCCd\0\0\xB4b\0\0xb\0\0N10__cxxabiv119__pointer_type_infoE\0\xCCd\0\0\xE4b\0\0b\0\0N10__cxxabiv120__function_type_infoE\0\0\0\0\xCCd\0\0c\0\0xb\0\0N10__cxxabiv129__pointer_to_member_type_infoE\0\0\0\0\0\0\0dc\0\0g\0\0h\0\0i\0\0j\0\0k\0\0\xCCd\0\0pc\0\0b\0\0N10__cxxabiv123__fundamental_type_infoE\0Pc\0\0\xA0c\0\0v\0Dn\0\0\0\0Pc\0\0\xB0c\0\0b\0\0\0Pc\0\0\xBCc\0\0c\0\0\0Pc\0\0\xC8c\0\0h\0\0\0Pc\0\0\xD4c\0\0a\0\0\0Pc\0\0\xE0c\0\0s\0\0\0Pc\0\0\xECc\0\0t\0\0\0Pc\0\0\xF8c\0\0i\0\0\0Pc\0\0d\0\0j\0\0\0Pc\0\0d\0\0l\0\0\0Pc\0\0d\0\0m\0\0\0Pc\0\0(d\0\0x\0\0\0Pc\0\x004d\0\0y\0\0\0Pc\0\0@d\0\0f\0\0\0Pc\0\0Ld\0\0d\0\0\0\0\0\0\0ld\0\0g\0\0l\0\0i\0\0j\0\0m\0\0\xCCd\0\0xd\0\0b\0\0N10__cxxabiv116__enum_type_infoE\0\0\0\0\0\0\0\0Hb\0\0g\0\0n\0\0i\0\0j\0\0o\0\0p\0\0q\0\0r\0\0\0\0\0\0\xECd\0\0g\0\0s\0\0i\0\0j\0\0o\0\0t\0\0u\0\0v\0\0\xCCd\0\0\xF8d\0\0Hb\0\0N10__cxxabiv120__si_class_type_infoE\0\0\0\0\0\0\0\0He\0\0g\0\0w\0\0i\0\0j\0\0o\0\0x\0\0y\0\0z\0\0\xCCd\0\0Te\0\0Hb\0\0N10__cxxabiv121__vmi_class_type_infoE\0\0\0\0\0\0\0\xA8b\0\0g\0\0{\0\0i\0\0j\0\0|\0\0\xA4d\0\0\xA0e\0\0St9type_info\0A\xB1\xCB\v\b \0\0\0\0\0\0\0A\xC4\xCB\v1\0A\xDC\xCB\v2\0\0\x003\0\0\0\xF8g\0\0\0\0A\xF4\xCB\v\0A\x84\xCC\v\xFF\xFF\xFF\xFF \0A\xC8\xCC\v!\xB8e\0\0@v\0%m/%d/%y\0\0\0\b%H:%M:%S\0\0\0\b\0A\xF4\xCC\ve\0A\x8C\xCD\v -2\0\0\0f\0\x004v\0A\xA4\xCD\v\0A\xB4\xCD\v\b\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\0A\xF8\xCD\vhf`)),ce((await B(ne)).instance))})(),(function(){function ce(){var ne;if(o.calledRun=!0,!m){if(C=!0,vy.H(),A?.(o),(ne=o.onRuntimeInitialized)==null||ne.call(o),o.postRun)for(typeof o.postRun=="function"&&(o.postRun=[o.postRun]);o.postRun.length;){var Te=o.postRun.shift();k.push(Te)}j(k)}}if(o.preRun)for(typeof o.preRun=="function"&&(o.preRun=[o.preRun]);o.preRun.length;)q();j(G),o.setStatus?(o.setStatus("Running..."),setTimeout(()=>{setTimeout(()=>o.setStatus(""),1),ce()},1)):ce()})(),C?r=o:r=new Promise((ce,ne)=>{A=ce,b=ne}),r}var lS=(e,t,n)=>{let i=e.vf32_ptr(t),r=t.size(),o=i>>2,s=e.HEAPF32.slice(o,o+r);if(n!==void 0)for(let a=0;a<r;a++)s[a]=n(s[a]);return s},y$e=e=>1/(1+Math.exp(-e)),A$e=e=>t=>t*e+.5,b$e=(e,t,n)=>{let i=n?.colorScaleFactor??.282;return{numPoints:t.numPoints,shDegree:t.shDegree,antialiased:t.antialiased,positions:lS(e,t.positions),scales:lS(e,t.scales,Math.exp),rotations:lS(e,t.rotations),alphas:lS(e,t.alphas,y$e),colors:lS(e,t.colors,A$e(i)),sh:lS(e,t.sh)}},x$e=(e,t)=>{e._free(e.vf32_ptr(t.positions)),e._free(e.vf32_ptr(t.scales)),e._free(e.vf32_ptr(t.rotations)),e._free(e.vf32_ptr(t.alphas)),e._free(e.vf32_ptr(t.colors)),e._free(e.vf32_ptr(t.sh))},gge=async(e,t)=>{var n;let i=await _$e(),r=e instanceof Uint8Array?e:new Uint8Array(e),o=null;try{if(o=i._malloc(Uint8Array.BYTES_PER_ELEMENT*r.length),o===null)throw new Error("couldn't allocate memory");i.HEAPU8.set(r,o/Uint8Array.BYTES_PER_ELEMENT);let s=i.CoordinateSystem[((n=t?.unpackOptions)==null?void 0:n.coordinateSystem)??"UNSPECIFIED"],a=i.load_spz(o,r.length,{coordinateSystem:s}),c=b$e(i,a,t);return x$e(i,a),c}catch(s){throw s}finally{o!==null&&i._free(o)}};var T$e=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"}));var E$e=[0,9,24,45],C$e=14,v$e=1.6*1024*1024*1024;function S$e(e,t){let n=t?.attributes;if(!l(n))return;let i=n.POSITION;if(!l(i))return;let r=e?.accessors?.[i];if(!l(r)||r.count<=0)return;let o=0;for(let s in n)if(Object.prototype.hasOwnProperty.call(n,s)){let a=/SH_DEGREE_(\d+)_COEF_/.exec(s);a&&(o=Math.max(o,parseInt(a[1],10)))}return{numPoints:r.count,shDegree:o}}function w$e(e,t){let n=C$e+(E$e[t]??0);return e*n*Float32Array.BYTES_PER_ELEMENT*2}var Y$=class extends nr{constructor(t){super(),t=t??H.EMPTY_OBJECT;let n=t.resourceCache,i=t.gltf,r=t.primitive,o=t.spz,s=t.gltfResource,a=t.baseResource,c=t.cacheKey;this._resourceCache=n,this._gltfResource=s,this._baseResource=a,this._gltf=i,this._primitive=r,this._spz=o,this._cacheKey=c,this._bufferViewLoader=void 0,this._bufferViewTypedArray=void 0,this._decodePromise=void 0,this._decodedData=void 0,this._state=Tt.UNLOADED,this._promise=void 0,this._spzError=void 0}get cacheKey(){return this._cacheKey}get decodedData(){return this._decodedData}async load(){return l(this._promise)?this._promise:(this._state=Tt.LOADING,this._promise=I$e(this),this._promise)}process(t){if(this._state===Tt.READY)return!0;if(this._state!==Tt.PROCESSING||(l(this._spzError)&&X$(this,this._spzError),!l(this._bufferViewTypedArray))||l(this._decodePromise))return!1;let n=S$e(this._gltf,this._primitive);if(l(n)){let r=w$e(n.numPoints,n.shDegree);if(r>v$e){let o=Math.round(r/1048576);return X$(this,new oe(`SPZ data too large to decode: ${n.numPoints.toLocaleString()} splats with spherical harmonics degree ${n.shDegree} would require approximately ${o} MB, which exceeds the WASM memory limit. Consider using a lower spherical harmonics degree or splitting the dataset into smaller tiles.`)),!1}}let i=gge(this._bufferViewTypedArray,{unpackOptions:{coordinateSystem:"UNSPECIFIED"}});if(!l(i))return!1;this._decodePromise=P$e(this,i)}unload(){l(this._bufferViewLoader)&&this._resourceCache.unload(this._bufferViewLoader),this._bufferViewLoader=void 0,this._bufferViewTypedArray=void 0,this._decodedData=void 0,this._gltf=void 0,this._primitive=void 0}};async function I$e(e){let t=e._resourceCache;try{let n=t.getBufferViewLoader({gltf:e._gltf,bufferViewId:e._spz.bufferView,gltfResource:e._gltfResource,baseResource:e._baseResource});return e._bufferViewLoader=n,await n.load(),e.isDestroyed()?void 0:(e._bufferViewTypedArray=n.typedArray,e._state=Tt.PROCESSING,e)}catch(n){if(e.isDestroyed())return;X$(e,n)}}function X$(e,t){throw e.unload(),e._state=Tt.FAILED,e.getError("Failed to load SPZ",t)}async function P$e(e,t){try{let n=await t;return e.isDestroyed()?void 0:(e.unload(),e._decodedData={gcloud:n},e._state=Tt.READY,e._baseResource)}catch(n){if(e.isDestroyed())return;e._spzError=n}}var pL=Y$;function gL(e){e=e??H.EMPTY_OBJECT;let t=e.id,n=e.properties??{},i={};for(let r in n)if(n.hasOwnProperty(r)){let o=n[r];l(o.semantic)&&(i[o.semantic]=o)}this._id=t,this._name=e.name,this._description=e.description,this._properties=n,this._propertiesBySemantic=i,this._extras=Je(e.extras,!0),this._extensions=Je(e.extensions,!0)}gL.fromJson=function(e){e=e??H.EMPTY_OBJECT;let t=e.id,n=e.class,i={};for(let r in n.properties)if(n.properties.hasOwnProperty(r)){let o=Vp.fromJson({id:r,property:n.properties[r],enums:e.enums});i[r]=o}return new gL({id:t,name:n.name,description:n.description,properties:i,extras:n.extras,extensions:n.extensions})};Object.defineProperties(gL.prototype,{properties:{get:function(){return this._properties}},propertiesBySemantic:{get:function(){return this._propertiesBySemantic}},id:{get:function(){return this._id}},name:{get:function(){return this._name}},description:{get:function(){return this._description}},extras:{get:function(){return this._extras}},extensions:{get:function(){return this._extensions}}});gL.BATCH_TABLE_CLASS_NAME="_batchTable";var lm=gL;function J6(e){e=e??H.EMPTY_OBJECT;let t=e.value,n=e.name;this._value=t,this._name=n,this._description=e.description,this._extras=Je(e.extras,!0),this._extensions=Je(e.extensions,!0)}J6.fromJson=function(e){return new J6({value:e.value,name:e.name,description:e.description,extras:e.extras,extensions:e.extensions})};Object.defineProperties(J6.prototype,{value:{get:function(){return this._value}},name:{get:function(){return this._name}},description:{get:function(){return this._description}},extras:{get:function(){return this._extras}},extensions:{get:function(){return this._extensions}}});var _L=J6;function Z6(e){e=e??H.EMPTY_OBJECT;let t=e.id,n=e.values,i={},r={},o=n.length;for(let a=0;a<o;++a){let c=n[a];i[c.value]=c.name,r[c.name]=c.value}let s=e.valueType??Lt.UINT16;this._values=n,this._namesByValue=i,this._valuesByName=r,this._valueType=s,this._id=t,this._name=e.name,this._description=e.description,this._extras=Je(e.extras,!0),this._extensions=Je(e.extensions,!0)}Z6.fromJson=function(e){e=e??H.EMPTY_OBJECT;let t=e.id,n=e.enum,i=n.values.map(function(r){return _L.fromJson(r)});return new Z6({id:t,values:i,valueType:Lt[n.valueType],name:n.name,description:n.description,extras:n.extras,extensions:n.extensions})};Object.defineProperties(Z6.prototype,{values:{get:function(){return this._values}},namesByValue:{get:function(){return this._namesByValue}},valuesByName:{get:function(){return this._valuesByName}},valueType:{get:function(){return this._valueType}},id:{get:function(){return this._id}},name:{get:function(){return this._name}},description:{get:function(){return this._description}},extras:{get:function(){return this._extras}},extensions:{get:function(){return this._extensions}}});var yL=Z6;function Q6(e){e=e??H.EMPTY_OBJECT;let t=e.classes??{},n=e.enums??{};this._classes=t,this._enums=n,this._id=e.id,this._name=e.name,this._description=e.description,this._version=e.version,this._extras=Je(e.extras,!0),this._extensions=Je(e.extensions,!0)}Q6.fromJson=function(e){let t={};if(l(e.enums))for(let i in e.enums)e.enums.hasOwnProperty(i)&&(t[i]=yL.fromJson({id:i,enum:e.enums[i]}));let n={};if(l(e.classes))for(let i in e.classes)e.classes.hasOwnProperty(i)&&(n[i]=lm.fromJson({id:i,class:e.classes[i],enums:t}));return new Q6({id:e.id,name:e.name,description:e.description,version:e.version,classes:n,enums:t,extras:e.extras,extensions:e.extensions})};Object.defineProperties(Q6.prototype,{classes:{get:function(){return this._classes}},enums:{get:function(){return this._enums}},id:{get:function(){return this._id}},name:{get:function(){return this._name}},description:{get:function(){return this._description}},version:{get:function(){return this._version}},extras:{get:function(){return this._extras}},extensions:{get:function(){return this._extensions}}});var eu=Q6;var K$=class extends nr{constructor(t){super(),t=t??H.EMPTY_OBJECT;let n=t.schema,i=t.resource,r=t.cacheKey;this._schema=l(n)?eu.fromJson(n):void 0,this._resource=i,this._cacheKey=r,this._state=Tt.UNLOADED,this._promise=void 0}get cacheKey(){return this._cacheKey}get schema(){return this._schema}async load(){return l(this._promise)?this._promise:l(this._schema)?(this._promise=Promise.resolve(this),this._promise):(this._promise=D$e(this),this._promise)}unload(){this._schema=void 0}};async function D$e(e){let t=e._resource;e._state=Tt.LOADING;try{let n=await t.fetchJson();return e.isDestroyed()?void 0:(e._schema=eu.fromJson(n),e._state=Tt.READY,e)}catch(n){if(e.isDestroyed())return;e._state=Tt.FAILED;let i=`Failed to load schema: ${t.url}`;throw e.getError(i,n)}}var fA=K$;var zd={};function uS(e){return vd(e.url)}function AL(e){let{byteOffset:t,byteLength:n}=e,i=oA(e);return l(i)&&(t=i.byteOffset??0,n=i.byteLength),`${t}-${t+n}`}function R$e(e,t){let n=t.byteOffset+e.byteOffset,{componentType:i,type:r,count:o}=e;return`${n}-${i}-${r}-${o}`}function _ge(e,t){return`${uS(e)}-buffer-id-${t}`}function fS(e,t,n,i){if(l(e.uri)){let r=i.getDerivedResource({url:e.uri});return uS(r)}return _ge(n,t)}function $$(e,t,n,i){let r=t.bufferView,o=e.bufferViews[r],s=o.buffer,a=e.buffers[s],c=fS(a,s,n,i),u=AL(o);return`${c}-range-${u}`}function yge(e,t,n,i){let r=t.bufferView,o=e.bufferViews[r],s=o.buffer,a=e.buffers[s],c=fS(a,s,n,i),u=AL(o);return`${c}-range-${u}`}function Age(e,t,n,i){let r=e.images[t],o=r.bufferView,s=r.uri;if(l(s)){let p=i.getDerivedResource({url:s});return uS(p)}let a=e.bufferViews[o],c=a.buffer,u=e.buffers[c],f=fS(u,c,n,i),d=AL(a);return`${f}-range-${d}`}function O$e(e,t){let n=Hu.createSampler({gltf:e,textureInfo:t});return`${n.wrapS}-${n.wrapT}-${n.minificationFilter}-${n.magnificationFilter}`}zd.getSchemaCacheKey=function(e){let{schema:t,resource:n}=e;return l(t)?`embedded-schema:${JSON.stringify(t)}`:`external-schema:${uS(n)}`};zd.getExternalBufferCacheKey=function(e){e=e??H.EMPTY_OBJECT;let{resource:t}=e;return`external-buffer:${uS(t)}`};zd.getEmbeddedBufferCacheKey=function(e){e=e??H.EMPTY_OBJECT;let{parentResource:t,bufferId:n}=e;return`embedded-buffer:${_ge(t,n)}`};zd.getGltfCacheKey=function(e){e=e??H.EMPTY_OBJECT;let{gltfResource:t}=e;return`gltf:${uS(t)}`};zd.getBufferViewCacheKey=function(e){e=e??H.EMPTY_OBJECT;let{gltf:t,bufferViewId:n,gltfResource:i,baseResource:r}=e,o=t.bufferViews[n],s=o.buffer,a=t.buffers[s],c=oA(o);l(c)&&(s=c.buffer);let u=fS(a,s,i,r),f=AL(o);return`buffer-view:${u}-range-${f}`};zd.getDracoCacheKey=function(e){e=e??H.EMPTY_OBJECT;let{gltf:t,draco:n,gltfResource:i,baseResource:r}=e;return`draco:${$$(t,n,i,r)}`};zd.getSpzCacheKey=function(e){e=e??H.EMPTY_OBJECT;let{gltf:t,spz:n,gltfResource:i,baseResource:r}=e;return`spz:${yge(t,n,i,r)}`};zd.getVertexBufferCacheKey=function(e){e=e??H.EMPTY_OBJECT;let{gltf:t,gltfResource:n,baseResource:i,frameState:r,bufferViewId:o,draco:s,spz:a,attributeSemantic:c,dequantize:u=!1,loadBuffer:f=!1,loadTypedArray:d=!1}=e,p="";if(u&&(p+="-dequantize"),f&&(p+="-buffer",p+=`-context-${r.context.id}`),d&&(p+="-typed-array"),l(a))return`vertex-buffer:${yge(t,a,n,i)}-spz-${c}${p}`;if(l(s))return`vertex-buffer:${$$(t,s,n,i)}-draco-${c}${p}`;let g=t.bufferViews[o],m=g.buffer,y=t.buffers[m],A=fS(y,m,n,i),b=AL(g);return`vertex-buffer:${A}-range-${b}${p}`};zd.getIndexBufferCacheKey=function(e){e=e??H.EMPTY_OBJECT;let{gltf:t,accessorId:n,gltfResource:i,baseResource:r,frameState:o,draco:s,loadBuffer:a=!1,loadTypedArray:c=!1}=e,u="";if(a&&(u+="-buffer",u+=`-context-${o.context.id}`),c&&(u+="-typed-array"),l(s))return`index-buffer:${$$(t,s,i,r)}-draco${u}`;let f=t.accessors[n],d=f.bufferView,p=t.bufferViews[d],g=p.buffer,m=t.buffers[g],y=fS(m,g,i,r),A=R$e(f,p);return`index-buffer:${y}-accessor-${A}${u}`};zd.getImageCacheKey=function(e){e=e??H.EMPTY_OBJECT;let{gltf:t,imageId:n,gltfResource:i,baseResource:r}=e;return`image:${Age(t,n,i,r)}`};zd.getTextureCacheKey=function(e){e=e??H.EMPTY_OBJECT;let{gltf:t,textureInfo:n,gltfResource:i,baseResource:r,supportedImageFormats:o,frameState:s}=e,a=n.index,c=Hu.getImageIdFromTexture({gltf:t,textureId:a,supportedImageFormats:o}),u=Age(t,c,i,r),f=O$e(t,n);return`texture:${u}-sampler-${f}-context-${s.context.id}`};var tu=zd;function bL(){this.geometryByteLength=0,this.texturesByteLength=0,this._geometrySizes={},this._textureSizes={}}bL.prototype.clear=function(){this.geometryByteLength=0,this.texturesByteLength=0,this._geometrySizes={},this._textureSizes={}};bL.prototype.addGeometryLoader=function(e){let t=e.cacheKey;if(this._geometrySizes.hasOwnProperty(t))return;this._geometrySizes[t]=0;let n=e.buffer,i=e.typedArray,r=0;l(n)&&(r+=n.sizeInBytes),l(i)&&(r+=i.byteLength),this.geometryByteLength+=r,this._geometrySizes[t]=r};bL.prototype.addTextureLoader=function(e){let t=e.cacheKey;if(this._textureSizes.hasOwnProperty(t))return;this._textureSizes[t]=0;let n=e.texture.sizeInBytes;this.texturesByteLength+=e.texture.sizeInBytes,this._textureSizes[t]=n};bL.prototype.removeLoader=function(e){let t=e.cacheKey,n=this._geometrySizes[t];delete this._geometrySizes[t],l(n)&&(this.geometryByteLength-=n);let i=this._textureSizes[t];delete this._textureSizes[t],l(i)&&(this.texturesByteLength-=i)};var xL=bL;function Nn(){}Nn.cacheEntries={};Nn.statistics=new xL;function M$e(e){this.referenceCount=1,this.resourceLoader=e,this._statisticsPromise=void 0}Nn.get=function(e){let t=Nn.cacheEntries[e];if(l(t))return++t.referenceCount,t.resourceLoader};Nn.add=function(e){let t=e.cacheKey;return Nn.cacheEntries[t]=new M$e(e),e};Nn.unload=function(e){let t=e.cacheKey,n=Nn.cacheEntries[t];--n.referenceCount,n.referenceCount===0&&(Nn.statistics.removeLoader(e),e.destroy(),delete Nn.cacheEntries[t])};Nn.getSchemaLoader=function(e){e=e??H.EMPTY_OBJECT;let{schema:t,resource:n}=e,i=tu.getSchemaCacheKey({schema:t,resource:n}),r=Nn.get(i);return l(r)?r:(r=new fA({schema:t,resource:n,cacheKey:i}),Nn.add(r))};Nn.getEmbeddedBufferLoader=function(e){e=e??H.EMPTY_OBJECT;let{parentResource:t,bufferId:n,typedArray:i}=e,r=tu.getEmbeddedBufferCacheKey({parentResource:t,bufferId:n}),o=Nn.get(r);return l(o)?o:(o=new iT({typedArray:i,cacheKey:r}),Nn.add(o))};Nn.getExternalBufferLoader=function(e){e=e??H.EMPTY_OBJECT;let{resource:t}=e,n=tu.getExternalBufferCacheKey({resource:t}),i=Nn.get(n);return l(i)?i:(i=new iT({resource:t,cacheKey:n}),Nn.add(i))};Nn.getGltfJsonLoader=function(e){e=e??H.EMPTY_OBJECT;let{gltfResource:t,baseResource:n,typedArray:i,gltfJson:r}=e,o=tu.getGltfCacheKey({gltfResource:t}),s=Nn.get(o);return l(s)?s:(s=new iS({resourceCache:Nn,gltfResource:t,baseResource:n,typedArray:i,gltfJson:r,cacheKey:o}),Nn.add(s))};Nn.getBufferViewLoader=function(e){e=e??H.EMPTY_OBJECT;let{gltf:t,bufferViewId:n,gltfResource:i,baseResource:r}=e,o=tu.getBufferViewCacheKey({gltf:t,bufferViewId:n,gltfResource:i,baseResource:r}),s=Nn.get(o);return l(s)?s:(s=new Zv({resourceCache:Nn,gltf:t,bufferViewId:n,gltfResource:i,baseResource:r,cacheKey:o}),Nn.add(s))};Nn.getDracoLoader=function(e){e=e??H.EMPTY_OBJECT;let{gltf:t,primitive:n,draco:i,gltfResource:r,baseResource:o}=e,s=tu.getDracoCacheKey({gltf:t,draco:i,gltfResource:r,baseResource:o}),a=Nn.get(s);return l(a)?a:(a=new Qv({resourceCache:Nn,gltf:t,primitive:n,draco:i,gltfResource:r,baseResource:o,cacheKey:s}),Nn.add(a))};Nn.getSpzLoader=function(e){e=e??H.EMPTY_OBJECT;let{gltf:t,primitive:n,spz:i,gltfResource:r,baseResource:o}=e,s=tu.getSpzCacheKey({gltf:t,spz:i,gltfResource:r,baseResource:o}),a=Nn.get(s);return l(a)?a:(a=new pL({resourceCache:Nn,gltf:t,primitive:n,spz:i,gltfResource:r,baseResource:o,cacheKey:s}),Nn.add(a))};Nn.getVertexBufferLoader=function(e){e=e??H.EMPTY_OBJECT;let{gltf:t,gltfResource:n,baseResource:i,frameState:r,bufferViewId:o,primitive:s,draco:a,spz:c,attributeSemantic:u,accessorId:f,asynchronous:d=!0,dequantize:p=!1,loadBuffer:g=!1,loadTypedArray:m=!1}=e,y=tu.getVertexBufferCacheKey({gltf:t,gltfResource:n,baseResource:i,frameState:r,bufferViewId:o,draco:a,spz:c,attributeSemantic:u,dequantize:p,loadBuffer:g,loadTypedArray:m}),A=Nn.get(y);return l(A)?A:(A=new cS({resourceCache:Nn,gltf:t,gltfResource:n,baseResource:i,bufferViewId:o,primitive:s,draco:a,spz:c,attributeSemantic:u,accessorId:f,cacheKey:y,asynchronous:d,dequantize:p,loadBuffer:g,loadTypedArray:m}),Nn.add(A))};Nn.getIndexBufferLoader=function(e){e=e??H.EMPTY_OBJECT;let{gltf:t,accessorId:n,gltfResource:i,baseResource:r,frameState:o,primitive:s,draco:a,asynchronous:c=!0,loadBuffer:u=!1,loadTypedArray:f=!1}=e,d=tu.getIndexBufferCacheKey({gltf:t,accessorId:n,gltfResource:i,baseResource:r,frameState:o,draco:a,loadBuffer:u,loadTypedArray:f}),p=Nn.get(d);return l(p)?p:(p=new tS({resourceCache:Nn,gltf:t,accessorId:n,gltfResource:i,baseResource:r,primitive:s,draco:a,cacheKey:d,asynchronous:c,loadBuffer:u,loadTypedArray:f}),Nn.add(p))};Nn.getImageLoader=function(e){e=e??H.EMPTY_OBJECT;let{gltf:t,imageId:n,gltfResource:i,baseResource:r}=e,o=tu.getImageCacheKey({gltf:t,imageId:n,gltfResource:i,baseResource:r}),s=Nn.get(o);return l(s)?s:(s=new eS({resourceCache:Nn,gltf:t,imageId:n,gltfResource:i,baseResource:r,cacheKey:o}),Nn.add(s))};Nn.getTextureLoader=function(e){e=e??H.EMPTY_OBJECT;let{gltf:t,textureInfo:n,gltfResource:i,baseResource:r,supportedImageFormats:o,frameState:s,asynchronous:a=!0}=e,c=tu.getTextureCacheKey({gltf:t,textureInfo:n,gltfResource:i,baseResource:r,supportedImageFormats:o,frameState:s}),u=Nn.get(c);return l(u)?u:(u=new aS({resourceCache:Nn,gltf:t,textureInfo:n,gltfResource:i,baseResource:r,supportedImageFormats:o,cacheKey:c,asynchronous:a}),Nn.add(u))};Nn.clearForSpecs=function(){let e=[cS,tS,Qv,aS,eS,Zv,iT,fA,iS],t,n=Nn.cacheEntries,i=[];for(t in n)n.hasOwnProperty(t)&&i.push(n[t]);i.sort(function(o,s){let a=e.indexOf(o.resourceLoader.constructor),c=e.indexOf(s.resourceLoader.constructor);return a-c});let r=i.length;for(let o=0;o<r;++o){let s=i[o];t=s.resourceLoader.cacheKey,l(n[t])&&(s.resourceLoader.destroy(),delete n[t])}Nn.statistics.clear()};var Li=Nn;function dc(e,t,n){this._resource=e,this._subtreeJson=void 0,this._bufferLoader=void 0,this._tileAvailability=void 0,this._contentAvailabilityBitstreams=[],this._childSubtreeAvailability=void 0,this._implicitCoordinates=n,this._subtreeLevels=t.subtreeLevels,this._subdivisionScheme=t.subdivisionScheme,this._branchingFactor=t.branchingFactor,this._metadata=void 0,this._tileMetadataTable=void 0,this._tilePropertyTableJson=void 0,this._contentMetadataTables=[],this._contentPropertyTableJsons=[],this._tileJumpBuffer=void 0,this._contentJumpBuffers=[],this._ready=!1}Object.defineProperties(dc.prototype,{ready:{get:function(){return this._ready}},metadata:{get:function(){return this._metadata}},tileMetadataTable:{get:function(){return this._tileMetadataTable}},tilePropertyTableJson:{get:function(){return this._tilePropertyTableJson}},contentMetadataTables:{get:function(){return this._contentMetadataTables}},contentPropertyTableJsons:{get:function(){return this._contentPropertyTableJsons}},implicitCoordinates:{get:function(){return this._implicitCoordinates}}});dc.prototype.tileIsAvailableAtIndex=function(e){return this._tileAvailability.getBit(e)};dc.prototype.tileIsAvailableAtCoordinates=function(e){let t=this.getTileIndex(e);return this.tileIsAvailableAtIndex(t)};dc.prototype.contentIsAvailableAtIndex=function(e,t){return t=t??0,this._contentAvailabilityBitstreams[t].getBit(e)};dc.prototype.contentIsAvailableAtCoordinates=function(e,t){let n=this.getTileIndex(e);return this.contentIsAvailableAtIndex(n,t)};dc.prototype.childSubtreeIsAvailableAtIndex=function(e){return this._childSubtreeAvailability.getBit(e)};dc.prototype.childSubtreeIsAvailableAtCoordinates=function(e){let t=this.getChildSubtreeIndex(e);return this.childSubtreeIsAvailableAtIndex(t)};dc.prototype.getLevelOffset=function(e){let t=this._branchingFactor;return(Math.pow(t,e)-1)/(t-1)};dc.prototype.getParentMortonIndex=function(e){let t=2;return this._subdivisionScheme===Gs.OCTREE&&(t=3),e>>t};dc.fromSubtreeJson=async function(e,t,n,i,r){let o=new dc(e,i,r),s;l(t)?s={json:t,binary:void 0}:s=N$e(n);let a=s.json;o._subtreeJson=a;let c;if(tr(a,"3DTILES_metadata"))c=a.extensions["3DTILES_metadata"];else if(l(a.tileMetadata)){let x=a.tileMetadata;c=a.propertyTables[x]}let u=[];if(l(a.contentMetadata)){let x=a.contentMetadata.length;for(let T=0;T<x;T++){let E=a.contentMetadata[T];u.push(a.propertyTables[E])}}let f,d=i.metadataSchema,p=a.subtreeMetadata;if(l(p)){let x=p.class,T=d.classes[x];f=new QN({subtreeMetadata:p,class:T})}o._metadata=f,o._tilePropertyTableJson=c,o._contentPropertyTableJsons=u;let g={constant:0};a.contentAvailabilityHeaders=[],tr(a,"3DTILES_multiple_contents")?a.contentAvailabilityHeaders=a.extensions["3DTILES_multiple_contents"].contentAvailability:Array.isArray(a.contentAvailability)?a.contentAvailabilityHeaders=a.contentAvailability:a.contentAvailabilityHeaders.push(a.contentAvailability??g);let m=L$e(a.buffers),y=F$e(a.bufferViews,m);B$e(a,y),l(c)&&bge(c,y);for(let x=0;x<u.length;x++){let T=u[x];bge(T,y)}let A=await k$e(o,m,s.binary),b=z$e(y,A);return V$e(o,a,i,b),l(c)&&(j$e(o,i,b),G$e(o)),H$e(o,i,b),W$e(o),o._ready=!0,o};function N$e(e){let n=new DataView(e.buffer,e.byteOffset),i=8,r=n.getUint32(i,!0);i+=8;let o=n.getUint32(i,!0);i+=8;let s=Ro(e,i,r);i+=r;let a=e.subarray(i,i+o);return{json:s,binary:a}}function L$e(e){e=l(e)?e:[];for(let t=0;t<e.length;t++){let n=e[t];n.isExternal=l(n.uri),n.isActive=!1}return e}function F$e(e,t){e=l(e)?e:[];for(let n=0;n<e.length;n++){let i=e[n],r=t[i.buffer];i.bufferHeader=r,i.isActive=!1}return e}function B$e(e,t){let n,i=e.tileAvailability;l(i.bitstream)?n=t[i.bitstream]:l(i.bufferView)&&(n=t[i.bufferView]),l(n)&&(n.isActive=!0,n.bufferHeader.isActive=!0);let r=e.contentAvailabilityHeaders;for(let s=0;s<r.length;s++)n=void 0,l(r[s].bitstream)?n=t[r[s].bitstream]:l(r[s].bufferView)&&(n=t[r[s].bufferView]),l(n)&&(n.isActive=!0,n.bufferHeader.isActive=!0);n=void 0;let o=e.childSubtreeAvailability;l(o.bitstream)?n=t[o.bitstream]:l(o.bufferView)&&(n=t[o.bufferView]),l(n)&&(n.isActive=!0,n.bufferHeader.isActive=!0)}function bge(e,t){let n=e.properties,i;for(let r in n)if(n.hasOwnProperty(r)){let o=n[r],s=o.values??o.bufferView;i=t[s],i.isActive=!0,i.bufferHeader.isActive=!0;let a=o.stringOffsets??o.stringOffsetBufferView;l(a)&&(i=t[a],i.isActive=!0,i.bufferHeader.isActive=!0);let c=o.arrayOffsets??o.arrayOffsetBufferView;l(c)&&(i=t[c],i.isActive=!0,i.bufferHeader.isActive=!0)}}function k$e(e,t,n){let i=[];for(let r=0;r<t.length;r++){let o=t[r];if(!o.isActive)i.push(Promise.resolve(void 0));else if(o.isExternal){let s=U$e(e,o);i.push(s)}else i.push(Promise.resolve(n))}return Promise.all(i).then(function(r){let o={};for(let s=0;s<r.length;s++){let a=r[s];l(a)&&(o[s]=a)}return o})}async function U$e(e,t){let i=e._resource.getDerivedResource({url:t.uri}),r=Li.getExternalBufferLoader({resource:i});e._bufferLoader=r;try{await r.load()}catch(o){if(r.isDestroyed())return;throw o}return r.typedArray}function z$e(e,t){let n={};for(let i=0;i<e.length;i++){let r=e[i];if(!r.isActive)continue;let o=r.byteOffset,s=o+r.byteLength,c=t[r.buffer].subarray(o,s);n[i]=c}return n}function V$e(e,t,n,i){let r=n.branchingFactor,o=n.subtreeLevels,s=(Math.pow(r,o)-1)/(r-1),a=Math.pow(r,o),c=tr(t,"3DTILES_metadata"),u=l(e._tilePropertyTableJson),f=c||u;e._tileAvailability=J$(t.tileAvailability,i,s,f);let d=e._contentPropertyTableJsons.length>0;f=f||d;for(let p=0;p<t.contentAvailabilityHeaders.length;p++){let g=J$(t.contentAvailabilityHeaders[p],i,s,f);e._contentAvailabilityBitstreams.push(g)}e._childSubtreeAvailability=J$(t.childSubtreeAvailability,i,a)}function J$(e,t,n,i){if(l(e.constant))return new $v({constant:!!e.constant,lengthBits:n,availableCount:e.availableCount});let r;return l(e.bitstream)?r=t[e.bitstream]:l(e.bufferView)&&(r=t[e.bufferView]),new $v({bitstream:r,lengthBits:n,availableCount:e.availableCount,computeAvailableCountEnabled:i})}function j$e(e,t,n){let i=e._tilePropertyTableJson,r=e._tileAvailability.availableCount,o=t.metadataSchema,s=i.class,a=o.classes[s];e._tileMetadataTable=new kd({class:a,count:r,properties:i.properties,bufferViews:n})}function H$e(e,t,n){let i=e._contentPropertyTableJsons,r=e._contentAvailabilityBitstreams,o=t.metadataSchema,s=e._contentMetadataTables;for(let a=0;a<i.length;a++){let c=i[a],f=r[a].availableCount,d=c.class,p=o.classes[d],g=new kd({class:p,count:f,properties:c.properties,bufferViews:n});s.push(g)}}function xge(e){let t=0,n=e.lengthBits,i=e.availableCount,r;i<256?r=new Uint8Array(n):i<65536?r=new Uint16Array(n):r=new Uint32Array(n);for(let o=0;o<e.lengthBits;o++)e.getBit(o)&&(r[o]=t,t++);return r}function G$e(e){let t=xge(e._tileAvailability);e._tileJumpBuffer=t}function W$e(e){let t=e._contentJumpBuffers,n=e._contentAvailabilityBitstreams;for(let i=0;i<n.length;i++){let r=n[i],o=xge(r);t.push(o)}}dc.prototype.getTileIndex=function(e){let t=e.level-this._implicitCoordinates.level;if(t<0||this._subtreeLevels<=t)throw new oe("level is out of bounds for this subtree");return e.getSubtreeCoordinates().getOffsetCoordinates(e).tileIndex};dc.prototype.getChildSubtreeIndex=function(e){if(e.level-this._implicitCoordinates.level!==this._implicitCoordinates.subtreeLevels)throw new oe("level is out of bounds for this subtree");return e.getParentSubtreeCoordinates().getOffsetCoordinates(e).mortonIndex};function q$e(e,t){if(!l(e._tileMetadataTable))return;let n=e.getTileIndex(t);if(e._tileAvailability.getBit(n))return e._tileJumpBuffer[n]}function Y$e(e,t,n){let i=e._contentMetadataTables;if(!l(i))return;let r=i[n];if(!l(r))return;let o=e._contentAvailabilityBitstreams[n],s=e.getTileIndex(t);if(o.getBit(s))return e._contentJumpBuffers[n][s]}dc.prototype.getTileMetadataView=function(e){let t=q$e(this,e);if(!l(t))return;let n=this._tileMetadataTable;return new Jv({class:n.class,metadataTable:n,entityId:t,propertyTableJson:this._tilePropertyTableJson})};dc.prototype.getContentMetadataView=function(e,t){let n=Y$e(this,e,t);if(!l(n))return;let i=this._contentMetadataTables[t],r=this._contentPropertyTableJsons[t];return new Jv({class:i.class,metadataTable:i,entityId:n,contentIndex:t,propertyTableJson:r})};dc.prototype.isDestroyed=function(){return!1};dc.prototype.destroy=function(){return l(this._bufferLoader)&&Li.unload(this._bufferLoader),le(this)};var Ug=dc;var Tge={ID:"ID",NAME:"NAME",DESCRIPTION:"DESCRIPTION",TILESET_TILE_COUNT:"TILESET_TILE_COUNT",TILE_BOUNDING_BOX:"TILE_BOUNDING_BOX",TILE_BOUNDING_REGION:"TILE_BOUNDING_REGION",TILE_BOUNDING_SPHERE:"TILE_BOUNDING_SPHERE",TILE_MINIMUM_HEIGHT:"TILE_MINIMUM_HEIGHT",TILE_MAXIMUM_HEIGHT:"TILE_MAXIMUM_HEIGHT",TILE_HORIZON_OCCLUSION_POINT:"TILE_HORIZON_OCCLUSION_POINT",TILE_GEOMETRIC_ERROR:"TILE_GEOMETRIC_ERROR",CONTENT_BOUNDING_BOX:"CONTENT_BOUNDING_BOX",CONTENT_BOUNDING_REGION:"CONTENT_BOUNDING_REGION",CONTENT_BOUNDING_SPHERE:"CONTENT_BOUNDING_SPHERE",CONTENT_MINIMUM_HEIGHT:"CONTENT_MINIMUM_HEIGHT",CONTENT_MAXIMUM_HEIGHT:"CONTENT_MAXIMUM_HEIGHT",CONTENT_HORIZON_OCCLUSION_POINT:"CONTENT_HORIZON_OCCLUSION_POINT"};Object.freeze(Tge);var Vd=Tge;var dA={};dA.parseAllBoundingVolumeSemantics=function(e,t){return{boundingVolume:dA.parseBoundingVolumeSemantic(e,t),minimumHeight:dA._parseMinimumHeight(e,t),maximumHeight:dA._parseMaximumHeight(e,t)}};dA.parseBoundingVolumeSemantic=function(e,t){let n=`${e}_BOUNDING_BOX`,i=t.getPropertyBySemantic(n);if(l(i))return{box:i};let r=`${e}_BOUNDING_REGION`,o=t.getPropertyBySemantic(r);if(l(o))return{region:o};let s=`${e}_BOUNDING_SPHERE`,a=t.getPropertyBySemantic(s);if(l(a))return{sphere:a}};dA._parseMinimumHeight=function(e,t){let n=`${e}_MINIMUM_HEIGHT`;return t.getPropertyBySemantic(n)};dA._parseMaximumHeight=function(e,t){let n=`${e}_MAXIMUM_HEIGHT`;return t.getPropertyBySemantic(n)};var hA=dA;var dS=class e{constructor(t,n,i){let r=n.implicitTileset,o=n.implicitCoordinates;this._implicitTileset=r,this._implicitCoordinates=o,this._implicitSubtree=void 0,this._tileset=t,this._tile=n,this._resource=i,this._metadata=void 0,this.featurePropertiesDirty=!1,this._group=void 0;let s=o.getTemplateValues(),a=r.subtreeUriTemplate.getDerivedResource({templateValues:s});this._url=a.getUrlComponent(!0),this._ready=!1}get featuresLength(){return 0}get pointsLength(){return 0}get trianglesLength(){return 0}get geometryByteLength(){return 0}get texturesByteLength(){return 0}get batchTableByteLength(){return 0}get innerContents(){}get ready(){return this._ready}get tileset(){return this._tileset}get tile(){return this._tile}get url(){return this._url}get metadata(){}set metadata(t){}get batchTable(){}get group(){return this._group}set group(t){this._group=t}static async fromSubtreeJson(t,n,i,r,o,s){s=s??0;let a;l(o)&&(a=new Uint8Array(o,s));let c=n.implicitTileset,u=n.implicitCoordinates,f=await Ug.fromSubtreeJson(i,r,a,c,u),d=new e(t,n,i);return d._implicitSubtree=f,X$e(d,f),d._ready=!0,d}hasProperty(t,n){return!1}getFeature(t){}applyDebugSettings(t,n){}applyStyle(t){}update(t,n){}pick(t,n,i){}isDestroyed(){return!1}destroy(){return this._implicitSubtree=this._implicitSubtree&&this._implicitSubtree.destroy(),le(this)}};function X$e(e,t){let n=e._tile,i=e._implicitCoordinates.childIndex,r=$$e(e,t,n,i),o=e._tileset.statistics;n.children.push(r.rootTile),o.numberOfTilesTotal++;let s=K$e(e,t,r.bottomRow);for(let a=0;a<s.length;a++){let c=s[a],u=c.tile,f=oJe(e,u,c.childIndex);u.children.push(f),o.numberOfTilesTotal++}}function K$e(e,t,n){let i=[],r=e._implicitTileset.branchingFactor;for(let o=0;o<n.length;o++){let s=n[o];if(l(s))for(let a=0;a<r;a++){let c=o*r+a;t.childSubtreeIsAvailableAtIndex(c)&&i.push({tile:s,childIndex:a})}}return i}function $$e(e,t,n,i){let s=Ege(e,t,n,i,0,!0),a=e._tileset.statistics,c=[s],u=[],f=e._implicitTileset;for(let d=1;d<f.subtreeLevels;d++){let p=t.getLevelOffset(d),g=f.branchingFactor*c.length;for(let m=0;m<g;m++){let y=p+m;if(!t.tileIsAvailableAtIndex(y)){u.push(void 0);continue}let A=t.getParentMortonIndex(m),b=c[A],x=m%f.branchingFactor,T=Ege(e,t,b,x,y);b.children.push(T),a.numberOfTilesTotal++,u.push(T)}c=u,u=[]}return{rootTile:s,bottomRow:c}}function Cge(e,t,n){let i=Vd.TILE_GEOMETRIC_ERROR;return l(e)&&e.hasPropertyBySemantic(i)?e.getPropertyBySemantic(i):t.geometricError/Math.pow(2,n.level)}function Ege(e,t,n,i,r,o){let s=e._implicitTileset,a;o??!1?a=n.implicitCoordinates:a=n.implicitCoordinates.getChildCoordinates(i);let c,u;l(t.tilePropertyTableJson)&&(c=t.getTileMetadataView(a),u=hA.parseAllBoundingVolumeSemantics("TILE",c));let d=t.contentPropertyTableJsons.length,p=!1;for(let v=0;v<d;v++)if(t.contentIsAvailableAtCoordinates(a,v)){p=!0;break}let g=Q$e(s,a,i,o,n,u),m=[];for(let v=0;v<s.contentCount;v++){if(!t.contentIsAvailableAtIndex(r,v))continue;let R={uri:s.contentUriTemplates[v].getDerivedResource({templateValues:a.getTemplateValues()}).url},O;if(t.contentPropertyTableJsons.length>0){let _=t.getContentMetadataView(a,v);O=hA.parseAllBoundingVolumeSemantics("CONTENT",_)}let L=eJe(g,O);l(L)&&(R.boundingVolume=L),m.push(Ot(R,s.contentHeaders[v]))}let y=Cge(c,s,a),A={boundingVolume:g,geometricError:y,refine:s.refine,contents:m},b=!0,x=Je(s.tileHeader,b);delete x.boundingVolume,delete x.transform,delete x.metadata;let T=Ot(A,x,b),E=Pge(e,s.baseResource,T,n);return E.implicitCoordinates=a,E.implicitSubtree=t,E.metadata=c,E.hasImplicitContentMetadata=p,E}function eH(e,t){return l(e)&&l(t)&&(l(t.minimumHeight)||l(t.maximumHeight))&&(tr(e,"3DTILES_bounding_volume_S2")||l(e.region))}function Q$(e,t){l(t)&&(tr(e,"3DTILES_bounding_volume_S2")?Z$e(e.extensions["3DTILES_bounding_volume_S2"],t.minimumHeight,t.maximumHeight):l(e.region)&&J$e(e.region,t.minimumHeight,t.maximumHeight))}function J$e(e,t,n){l(t)&&(e[4]=t),l(n)&&(e[5]=n)}function Z$e(e,t,n){l(t)&&(e.minimumHeight=t),l(n)&&(e.maximumHeight=n)}function Q$e(e,t,n,i,r,o){let s;return!l(o)||!l(o.boundingVolume)||!eH(o.boundingVolume,o)&&eH(e.boundingVolume,o)?s=vge(e,t,n,i??!1,r):s=o.boundingVolume,Q$(s,o),s}function eJe(e,t){let n;return l(t)&&(n=t.boundingVolume),eH(n,t)?Q$(n,t):eH(e,t)&&(n=Je(e,!0),Q$(n,t)),n}function vge(e,t,n,i,r){let o=e.boundingVolume;return tr(o,"3DTILES_bounding_volume_S2")?Sge(i,r,n,t.level,t.x,t.y,t.z):l(o.region)?{region:Ige(o.region,t.level,t.x,t.y,t.z)}:{box:wge(o.box,t.level,t.x,t.y,t.z)}}function Sge(e,t,n,i,r,o,s){let a=t._boundingVolume;if(e)return{extensions:{"3DTILES_bounding_volume_S2":{token:Mg.getTokenFromId(a.s2Cell._cellId),minimumHeight:a.minimumHeight,maximumHeight:a.maximumHeight}}};let c=Number(t._boundingVolume.s2Cell._cellId>>BigInt(61)),u=c%2===0?Xv.encode2D(i,r,o):Xv.encode2D(i,o,r),f=Mg.fromFacePositionLevel(c,BigInt(u),i),d,p;if(l(s)){let g=(a.maximumHeight+a.minimumHeight)/2;d=n<4?a.minimumHeight:g,p=n<4?g:a.maximumHeight}else d=a.minimumHeight,p=a.maximumHeight;return{extensions:{"3DTILES_bounding_volume_S2":{token:Mg.getTokenFromId(f._cellId),minimumHeight:d,maximumHeight:p}}}}var tJe=new h,nJe=new h,Z$=new h,iJe=new $;function wge(e,t,n,i,r){if(t===0)return e;let o=h.unpack(e,0,nJe),s=$.unpack(e,3,iJe),a=Math.pow(2,-t),c=-1+(2*n+1)*a,u=-1+(2*i+1)*a,f=0,d=h.fromElements(a,a,1,tJe);l(r)&&(f=-1+(2*r+1)*a,d.z=a);let p=h.fromElements(c,u,f,Z$);p=$.multiplyByVector(s,p,Z$),p=h.add(p,o,Z$);let g=$.clone(s);g=$.multiplyByScale(g,d,g);let m=new Array(12);return h.pack(p,m),$.pack(g,m,3),m}var rJe=new ie;function Ige(e,t,n,i,r){if(t===0)return e.slice();let o=ie.unpack(e,0,rJe),s=e[4],a=e[5],c=Math.pow(2,-t),u=c*o.width,f=D.negativePiToPi(o.west+n*u),d=D.negativePiToPi(f+u),p=c*o.height,g=D.negativePiToPi(o.south+i*p),m=D.negativePiToPi(g+p),y=s,A=a;if(l(r)){let b=c*(a-s);y+=r*b,A=y+b}return[f,g,d,m,y,A]}function oJe(e,t,n){let i=e._implicitTileset,r=t.implicitCoordinates.getChildCoordinates(n),o=vge(i,r,n,!1,t),s=Cge(void 0,i,r),a=i.subtreeUriTemplate.getDerivedResource({templateValues:r.getTemplateValues()}).url,c={boundingVolume:o,geometricError:s,refine:i.refine,contents:[{uri:a}]},u=Pge(e,i.baseResource,c,t);return u.implicitTileset=i,u.implicitCoordinates=r,u}function Pge(e,t,n,i){let r=e._tile.constructor;return new r(e._tileset,t,n,i)}dS._deriveBoundingBox=wge;dS._deriveBoundingRegion=Ige;dS._deriveBoundingVolumeS2=Sge;var hS=dS;var Dge={NONE:0,REPEAT:1,MIRRORED_REPEAT:2};Object.freeze(Dge);var Gu=Dge;function mS(e,t){this._distance=t,this._normal=new Rge(e,this),this.onChangeCallback=void 0,this.index=-1}Object.defineProperties(mS.prototype,{distance:{get:function(){return this._distance},set:function(e){l(this.onChangeCallback)&&e!==this._distance&&this.onChangeCallback(this.index),this._distance=e}},normal:{get:function(){return this._normal},set:function(e){l(this.onChangeCallback)&&!h.equals(this._normal._cartesian3,e)&&this.onChangeCallback(this.index),h.clone(e,this._normal._cartesian3)}}});mS.fromPlane=function(e,t){return l(t)?(t.normal=e.normal,t.distance=e.distance):t=new mS(e.normal,e.distance),t};mS.clone=function(e,t){return l(t)?(t.normal=e.normal,t.distance=e.distance,t):new mS(e.normal,e.distance)};function Rge(e,t){this._clippingPlane=t,this._cartesian3=h.clone(e)}Object.defineProperties(Rge.prototype,{x:{get:function(){return this._cartesian3.x},set:function(e){l(this._clippingPlane.onChangeCallback)&&e!==this._cartesian3.x&&this._clippingPlane.onChangeCallback(this._clippingPlane.index),this._cartesian3.x=e}},y:{get:function(){return this._cartesian3.y},set:function(e){l(this._clippingPlane.onChangeCallback)&&e!==this._cartesian3.y&&this._clippingPlane.onChangeCallback(this._clippingPlane.index),this._cartesian3.y=e}},z:{get:function(){return this._cartesian3.z},set:function(e){l(this._clippingPlane.onChangeCallback)&&e!==this._cartesian3.z&&this._clippingPlane.onChangeCallback(this._clippingPlane.index),this._cartesian3.z=e}}});var ia=mS;function sl(e){e=e??H.EMPTY_OBJECT,this._planes=[],this._dirtyIndex=-1,this._multipleDirtyPlanes=!1,this._enabled=e.enabled??!0,this.modelMatrix=N.clone(e.modelMatrix??N.IDENTITY),this.edgeColor=z.clone(e.edgeColor??z.WHITE),this.edgeWidth=e.edgeWidth??0,this.planeAdded=new be,this.planeRemoved=new be,this._owner=void 0;let t=e.unionClippingRegions??!1;this._unionClippingRegions=t,this._testIntersection=t?Fge:Bge,this._uint8View=void 0,this._float32View=void 0,this._clippingPlanesTexture=void 0;let n=e.planes;if(l(n)){let i=n.length;for(let r=0;r<i;++r)this.add(n[r])}}function Fge(e){return e===$t.OUTSIDE}function Bge(e){return e===$t.INSIDE}Object.defineProperties(sl.prototype,{length:{get:function(){return this._planes.length}},unionClippingRegions:{get:function(){return this._unionClippingRegions},set:function(e){this._unionClippingRegions!==e&&(this._unionClippingRegions=e,this._testIntersection=e?Fge:Bge)}},enabled:{get:function(){return this._enabled},set:function(e){this._enabled!==e&&(this._enabled=e)}},texture:{get:function(){return this._clippingPlanesTexture}},owner:{get:function(){return this._owner}},clippingPlanesState:{get:function(){return this._unionClippingRegions?this._planes.length:-this._planes.length}}});function Oge(e,t){e._multipleDirtyPlanes=e._multipleDirtyPlanes||e._dirtyIndex!==-1&&e._dirtyIndex!==t,e._dirtyIndex=t}sl.prototype.add=function(e){let t=this._planes.length,n=this;e.onChangeCallback=function(i){Oge(n,i)},e.index=t,Oge(this,t),this._planes.push(e),this.planeAdded.raiseEvent(e,t)};sl.prototype.get=function(e){return this._planes[e]};function kge(e,t){let n=e.length;for(let i=0;i<n;++i)if(sn.equals(e[i],t))return i;return-1}sl.prototype.contains=function(e){return kge(this._planes,e)!==-1};sl.prototype.remove=function(e){let t=this._planes,n=kge(t,e);if(n===-1)return!1;e instanceof ia&&(e.onChangeCallback=void 0,e.index=-1);let i=t.length-1;for(let r=n;r<i;++r){let o=t[r+1];t[r]=o,o instanceof ia&&(o.index=r)}return this._multipleDirtyPlanes=!0,t.length=i,this.planeRemoved.raiseEvent(e,n),!0};sl.prototype.removeAll=function(){let e=this._planes,t=e.length;for(let n=0;n<t;++n){let i=e[n];i instanceof ia&&(i.onChangeCallback=void 0,i.index=-1),this.planeRemoved.raiseEvent(i,n)}this._multipleDirtyPlanes=!0,this._planes=[]};var sJe=new se,aJe=new se;function Mge(e,t,n){let i=e._uint8View,r=e._planes,o=0;for(let s=t;s<n;++s){let a=r[s],c=cn.octEncodeToCartesian4(a.normal,aJe);i[o]=c.x,i[o+1]=c.y,i[o+2]=c.z,i[o+3]=c.w;let u=se.packFloat(a.distance,sJe);i[o+4]=u.x,i[o+5]=u.y,i[o+6]=u.z,i[o+7]=u.w,o+=8}}function Nge(e,t,n){let i=e._float32View,r=e._planes,o=0;for(let s=t;s<n;++s){let a=r[s],c=a.normal;i[o]=c.x,i[o+1]=c.y,i[o+2]=c.z,i[o+3]=a.distance,o+=4}}function Uge(e,t){let n=kt.maximumTextureSize;return t.x=Math.min(e,n),t.y=Math.ceil(e/t.x),t}var cJe=new U;sl.prototype.update=function(e){let t=this._clippingPlanesTexture,n=e.context,i=sl.useFloatTexture(n),r=i?this.length:this.length*2;if(l(t)){let s=t.width*t.height;(s<r||r<.25*s)&&(t.destroy(),t=void 0,this._clippingPlanesTexture=void 0)}if(this.length===0)return;if(!l(t)){let s=Uge(r,cJe);s.y*=2,i?(t=new Dt({context:n,width:s.x,height:s.y,pixelFormat:Ke.RGBA,pixelDatatype:ze.FLOAT,sampler:jt.NEAREST,flipY:!1}),this._float32View=new Float32Array(s.x*s.y*4)):(t=new Dt({context:n,width:s.x,height:s.y,pixelFormat:Ke.RGBA,pixelDatatype:ze.UNSIGNED_BYTE,sampler:jt.NEAREST,flipY:!1}),this._uint8View=new Uint8Array(s.x*s.y*4)),this._clippingPlanesTexture=t,this._multipleDirtyPlanes=!0}let o=this._dirtyIndex;if(!(!this._multipleDirtyPlanes&&o===-1)){if(this._multipleDirtyPlanes)i?(Nge(this,0,this._planes.length),t.copyFrom({source:{width:t.width,height:t.height,arrayBufferView:this._float32View}})):(Mge(this,0,this._planes.length),t.copyFrom({source:{width:t.width,height:t.height,arrayBufferView:this._uint8View}}));else{let s,a;i?(a=Math.floor(o/t.width),s=Math.floor(o-a*t.width),Nge(this,o,o+1),t.copyFrom({source:{width:1,height:1,arrayBufferView:this._float32View},xOffset:s,yOffset:a})):(a=Math.floor(o*2/t.width),s=Math.floor(o*2-a*t.width),Mge(this,o,o+1),t.copyFrom({source:{width:2,height:1,arrayBufferView:this._uint8View},xOffset:s,yOffset:a}))}this._multipleDirtyPlanes=!1,this._dirtyIndex=-1}};var lJe=new N,Lge=new sn(h.UNIT_X,0);sl.prototype.computeIntersectionWithBoundingVolume=function(e,t){let n=this._planes,i=n.length,r=this.modelMatrix;l(t)&&(r=N.multiply(t,r,lJe));let o=$t.INSIDE;!this.unionClippingRegions&&i>0&&(o=$t.OUTSIDE);for(let s=0;s<i;++s){let a=n[s];sn.transform(a,r,Lge);let c=e.intersectPlane(Lge);if(c===$t.INTERSECTING)o=c;else if(this._testIntersection(c))return c}return o};sl.setOwner=function(e,t,n){e!==t[n]&&(t[n]=t[n]&&t[n].destroy(),l(e)&&(e._owner=t,t[n]=e))};sl.useFloatTexture=function(e){return e.floatingPointTexture};sl.getTextureResolution=function(e,t,n){let i=e.texture;if(l(i))return n.x=i.width,n.y=i.height,n;let r=sl.useFloatTexture(t)?e.length:e.length*2,o=Uge(r,n);return o.y*=2,o};sl.prototype.isDestroyed=function(){return!1};sl.prototype.destroy=function(){return this._clippingPlanesTexture=this._clippingPlanesTexture&&this._clippingPlanesTexture.destroy(),le(this)};var bs=sl;function nJ(e,t,n=2){let i=t&&t.length,r=i?t[0]*n:e.length,o=Vge(e,0,r,n,!0),s=[];if(!o||o.next===o.prev)return s;let a,c,u;if(i&&(o=mJe(e,t,o,n)),e.length>80*n){a=e[0],c=e[1];let f=a,d=c;for(let p=n;p<r;p+=n){let g=e[p],m=e[p+1];g<a&&(a=g),m<c&&(c=m),g>f&&(f=g),m>d&&(d=m)}u=Math.max(f-a,d-c),u=u!==0?32767/u:0}return EL(o,s,n,a,c,u,0),s}function Vge(e,t,n,i,r){let o;if(r===vJe(e,t,n,i)>0)for(let s=t;s<n;s+=i)o=zge(s/i|0,e[s],e[s+1],o);else for(let s=n-i;s>=t;s-=i)o=zge(s/i|0,e[s],e[s+1],o);return o&&pS(o,o.next)&&(vL(o),o=o.next),o}function fT(e,t){if(!e)return e;t||(t=e);let n=e,i;do if(i=!1,!n.steiner&&(pS(n,n.next)||xs(n.prev,n,n.next)===0)){if(vL(n),n=t=n.prev,n===n.next)break;i=!0}else n=n.next;while(i||n!==t);return t}function EL(e,t,n,i,r,o,s){if(!e)return;!s&&o&&AJe(e,i,r,o);let a=e;for(;e.prev!==e.next;){let c=e.prev,u=e.next;if(o?fJe(e,i,r,o):uJe(e)){t.push(c.i,e.i,u.i),vL(e),e=u.next,a=u.next;continue}if(e=u,e===a){s?s===1?(e=dJe(fT(e),t),EL(e,t,n,i,r,o,2)):s===2&&hJe(e,t,n,i,r,o):EL(fT(e),t,n,i,r,o,1);break}}}function uJe(e){let t=e.prev,n=e,i=e.next;if(xs(t,n,i)>=0)return!1;let r=t.x,o=n.x,s=i.x,a=t.y,c=n.y,u=i.y,f=Math.min(r,o,s),d=Math.min(a,c,u),p=Math.max(r,o,s),g=Math.max(a,c,u),m=i.next;for(;m!==t;){if(m.x>=f&&m.x<=p&&m.y>=d&&m.y<=g&&TL(r,a,o,c,s,u,m.x,m.y)&&xs(m.prev,m,m.next)>=0)return!1;m=m.next}return!0}function fJe(e,t,n,i){let r=e.prev,o=e,s=e.next;if(xs(r,o,s)>=0)return!1;let a=r.x,c=o.x,u=s.x,f=r.y,d=o.y,p=s.y,g=Math.min(a,c,u),m=Math.min(f,d,p),y=Math.max(a,c,u),A=Math.max(f,d,p),b=eJ(g,m,t,n,i),x=eJ(y,A,t,n,i),T=e.prevZ,E=e.nextZ;for(;T&&T.z>=b&&E&&E.z<=x;){if(T.x>=g&&T.x<=y&&T.y>=m&&T.y<=A&&T!==r&&T!==s&&TL(a,f,c,d,u,p,T.x,T.y)&&xs(T.prev,T,T.next)>=0||(T=T.prevZ,E.x>=g&&E.x<=y&&E.y>=m&&E.y<=A&&E!==r&&E!==s&&TL(a,f,c,d,u,p,E.x,E.y)&&xs(E.prev,E,E.next)>=0))return!1;E=E.nextZ}for(;T&&T.z>=b;){if(T.x>=g&&T.x<=y&&T.y>=m&&T.y<=A&&T!==r&&T!==s&&TL(a,f,c,d,u,p,T.x,T.y)&&xs(T.prev,T,T.next)>=0)return!1;T=T.prevZ}for(;E&&E.z<=x;){if(E.x>=g&&E.x<=y&&E.y>=m&&E.y<=A&&E!==r&&E!==s&&TL(a,f,c,d,u,p,E.x,E.y)&&xs(E.prev,E,E.next)>=0)return!1;E=E.nextZ}return!0}function dJe(e,t){let n=e;do{let i=n.prev,r=n.next.next;!pS(i,r)&&Hge(i,n,n.next,r)&&CL(i,r)&&CL(r,i)&&(t.push(i.i,n.i,r.i),vL(n),vL(n.next),n=e=r),n=n.next}while(n!==e);return fT(n)}function hJe(e,t,n,i,r,o){let s=e;do{let a=s.next.next;for(;a!==s.prev;){if(s.i!==a.i&&TJe(s,a)){let c=Gge(s,a);s=fT(s,s.next),c=fT(c,c.next),EL(s,t,n,i,r,o,0),EL(c,t,n,i,r,o,0);return}a=a.next}s=s.next}while(s!==e)}function mJe(e,t,n,i){let r=[];for(let o=0,s=t.length;o<s;o++){let a=t[o]*i,c=o<s-1?t[o+1]*i:e.length,u=Vge(e,a,c,i,!1);u===u.next&&(u.steiner=!0),r.push(xJe(u))}r.sort(pJe);for(let o=0;o<r.length;o++)n=gJe(r[o],n);return n}function pJe(e,t){let n=e.x-t.x;if(n===0&&(n=e.y-t.y,n===0)){let i=(e.next.y-e.y)/(e.next.x-e.x),r=(t.next.y-t.y)/(t.next.x-t.x);n=i-r}return n}function gJe(e,t){let n=_Je(e,t);if(!n)return t;let i=Gge(n,e);return fT(i,i.next),fT(n,n.next)}function _Je(e,t){let n=t,i=e.x,r=e.y,o=-1/0,s;if(pS(e,n))return n;do{if(pS(e,n.next))return n.next;if(r<=n.y&&r>=n.next.y&&n.next.y!==n.y){let d=n.x+(r-n.y)*(n.next.x-n.x)/(n.next.y-n.y);if(d<=i&&d>o&&(o=d,s=n.x<n.next.x?n:n.next,d===i))return s}n=n.next}while(n!==t);if(!s)return null;let a=s,c=s.x,u=s.y,f=1/0;n=s;do{if(i>=n.x&&n.x>=c&&i!==n.x&&jge(r<u?i:o,r,c,u,r<u?o:i,r,n.x,n.y)){let d=Math.abs(r-n.y)/(i-n.x);CL(n,e)&&(d<f||d===f&&(n.x>s.x||n.x===s.x&&yJe(s,n)))&&(s=n,f=d)}n=n.next}while(n!==a);return s}function yJe(e,t){return xs(e.prev,e,t.prev)<0&&xs(t.next,e,e.next)<0}function AJe(e,t,n,i){let r=e;do r.z===0&&(r.z=eJ(r.x,r.y,t,n,i)),r.prevZ=r.prev,r.nextZ=r.next,r=r.next;while(r!==e);r.prevZ.nextZ=null,r.prevZ=null,bJe(r)}function bJe(e){let t,n=1;do{let i=e,r;e=null;let o=null;for(t=0;i;){t++;let s=i,a=0;for(let u=0;u<n&&(a++,s=s.nextZ,!!s);u++);let c=n;for(;a>0||c>0&&s;)a!==0&&(c===0||!s||i.z<=s.z)?(r=i,i=i.nextZ,a--):(r=s,s=s.nextZ,c--),o?o.nextZ=r:e=r,r.prevZ=o,o=r;i=s}o.nextZ=null,n*=2}while(t>1);return e}function eJ(e,t,n,i,r){return e=(e-n)*r|0,t=(t-i)*r|0,e=(e|e<<8)&16711935,e=(e|e<<4)&252645135,e=(e|e<<2)&858993459,e=(e|e<<1)&1431655765,t=(t|t<<8)&16711935,t=(t|t<<4)&252645135,t=(t|t<<2)&858993459,t=(t|t<<1)&1431655765,e|t<<1}function xJe(e){let t=e,n=e;do(t.x<n.x||t.x===n.x&&t.y<n.y)&&(n=t),t=t.next;while(t!==e);return n}function jge(e,t,n,i,r,o,s,a){return(r-s)*(t-a)>=(e-s)*(o-a)&&(e-s)*(i-a)>=(n-s)*(t-a)&&(n-s)*(o-a)>=(r-s)*(i-a)}function TL(e,t,n,i,r,o,s,a){return!(e===s&&t===a)&&jge(e,t,n,i,r,o,s,a)}function TJe(e,t){return e.next.i!==t.i&&e.prev.i!==t.i&&!EJe(e,t)&&(CL(e,t)&&CL(t,e)&&CJe(e,t)&&(xs(e.prev,e,t.prev)||xs(e,t.prev,t))||pS(e,t)&&xs(e.prev,e,e.next)>0&&xs(t.prev,t,t.next)>0)}function xs(e,t,n){return(t.y-e.y)*(n.x-t.x)-(t.x-e.x)*(n.y-t.y)}function pS(e,t){return e.x===t.x&&e.y===t.y}function Hge(e,t,n,i){let r=nH(xs(e,t,n)),o=nH(xs(e,t,i)),s=nH(xs(n,i,e)),a=nH(xs(n,i,t));return!!(r!==o&&s!==a||r===0&&tH(e,n,t)||o===0&&tH(e,i,t)||s===0&&tH(n,e,i)||a===0&&tH(n,t,i))}function tH(e,t,n){return t.x<=Math.max(e.x,n.x)&&t.x>=Math.min(e.x,n.x)&&t.y<=Math.max(e.y,n.y)&&t.y>=Math.min(e.y,n.y)}function nH(e){return e>0?1:e<0?-1:0}function EJe(e,t){let n=e;do{if(n.i!==e.i&&n.next.i!==e.i&&n.i!==t.i&&n.next.i!==t.i&&Hge(n,n.next,e,t))return!0;n=n.next}while(n!==e);return!1}function CL(e,t){return xs(e.prev,e,e.next)<0?xs(e,t,e.next)>=0&&xs(e,e.prev,t)>=0:xs(e,t,e.prev)<0||xs(e,e.next,t)<0}function CJe(e,t){let n=e,i=!1,r=(e.x+t.x)/2,o=(e.y+t.y)/2;do n.y>o!=n.next.y>o&&n.next.y!==n.y&&r<(n.next.x-n.x)*(o-n.y)/(n.next.y-n.y)+n.x&&(i=!i),n=n.next;while(n!==e);return i}function Gge(e,t){let n=tJ(e.i,e.x,e.y),i=tJ(t.i,t.x,t.y),r=e.next,o=t.prev;return e.next=t,t.prev=e,n.next=r,r.prev=n,i.next=n,n.prev=i,o.next=i,i.prev=o,i}function zge(e,t,n,i){let r=tJ(e,t,n);return i?(r.next=i.next,r.prev=i,i.next.prev=r,i.next=r):(r.prev=r,r.next=r),r}function vL(e){e.next.prev=e.prev,e.prev.next=e.next,e.prevZ&&(e.prevZ.nextZ=e.nextZ),e.nextZ&&(e.nextZ.prevZ=e.prevZ)}function tJ(e,t,n){return{i:e,x:t,y:n,prev:null,next:null,z:0,prevZ:null,nextZ:null,steiner:!1}}function vJe(e,t,n,i){let r=0;for(let o=t,s=n-i;o<n;o+=i)r+=(e[s]-e[o])*(e[o+1]+e[s+1]),s=o;return r}var SJe=new h,wJe=new h,mA={};mA.computeArea2D=function(e){let t=e.length,n=0;for(let i=t-1,r=0;r<t;i=r++){let o=e[i],s=e[r];n+=o.x*s.y-s.x*o.y}return n*.5};mA.computeWindingOrder2D=function(e){return mA.computeArea2D(e)>0?Qs.COUNTER_CLOCKWISE:Qs.CLOCKWISE};mA.triangulate=function(e,t){let n=U.packArray(e);return nJ(n,t,2)};var Xge=new h,Kge=new h,$ge=new h,Wge=new h,qge=new h,Yge=new h,zg=new h,Jge=new U,Zge=new U,Qge=new U,gS=new U;mA.computeSubdivision=function(e,t,n,i,r){r=r??D.RADIANS_PER_DEGREE;let o=l(i),s=n.slice(0),a,c=t.length,u=new Array(c*3),f=new Array(c*2),d=0,p=0;for(a=0;a<c;a++){let T=t[a];if(u[d++]=T.x,u[d++]=T.y,u[d++]=T.z,o){let E=i[a];f[p++]=E.x,f[p++]=E.y}}let g=[],m={},y=e.maximumRadius,A=D.chordLength(r,y),b=A*A;for(;s.length>0;){let T=s.pop(),E=s.pop(),v=s.pop(),S=h.fromArray(u,v*3,Xge),I=h.fromArray(u,E*3,Kge),R=h.fromArray(u,T*3,$ge),O,L,_;o&&(O=U.fromArray(f,v*2,Jge),L=U.fromArray(f,E*2,Zge),_=U.fromArray(f,T*2,Qge));let C=h.multiplyByScalar(h.normalize(S,Wge),y,Wge),w=h.multiplyByScalar(h.normalize(I,qge),y,qge),P=h.multiplyByScalar(h.normalize(R,Yge),y,Yge),M=h.magnitudeSquared(h.subtract(C,w,zg)),F=h.magnitudeSquared(h.subtract(w,P,zg)),V=h.magnitudeSquared(h.subtract(P,C,zg)),B=Math.max(M,F,V),j,k,G;B>b?M===B?(j=`${Math.min(v,E)} ${Math.max(v,E)}`,a=m[j],l(a)||(k=h.add(S,I,zg),h.multiplyByScalar(k,.5,k),u.push(k.x,k.y,k.z),a=u.length/3-1,m[j]=a,o&&(G=U.add(O,L,gS),U.multiplyByScalar(G,.5,G),f.push(G.x,G.y))),s.push(v,a,T),s.push(a,E,T)):F===B?(j=`${Math.min(E,T)} ${Math.max(E,T)}`,a=m[j],l(a)||(k=h.add(I,R,zg),h.multiplyByScalar(k,.5,k),u.push(k.x,k.y,k.z),a=u.length/3-1,m[j]=a,o&&(G=U.add(L,_,gS),U.multiplyByScalar(G,.5,G),f.push(G.x,G.y))),s.push(E,a,v),s.push(a,T,v)):V===B&&(j=`${Math.min(T,v)} ${Math.max(T,v)}`,a=m[j],l(a)||(k=h.add(R,S,zg),h.multiplyByScalar(k,.5,k),u.push(k.x,k.y,k.z),a=u.length/3-1,m[j]=a,o&&(G=U.add(_,O,gS),U.multiplyByScalar(G,.5,G),f.push(G.x,G.y))),s.push(T,a,E),s.push(a,v,E)):(g.push(v),g.push(E),g.push(T))}let x={attributes:{position:new Ne({componentDatatype:Y.DOUBLE,componentsPerAttribute:3,values:u})},indices:g,primitiveType:Oe.TRIANGLES};return o&&(x.attributes.st=new Ne({componentDatatype:Y.FLOAT,componentsPerAttribute:2,values:f})),new St(x)};var IJe=new he,PJe=new he,DJe=new he,iJ=new he;mA.computeRhumbLineSubdivision=function(e,t,n,i,r){r=r??D.RADIANS_PER_DEGREE;let o=l(i),s=n.slice(0),a,c=t.length,u=new Array(c*3),f=new Array(c*2),d=0,p=0;for(a=0;a<c;a++){let v=t[a];if(u[d++]=v.x,u[d++]=v.y,u[d++]=v.z,o){let S=i[a];f[p++]=S.x,f[p++]=S.y}}let g=[],m={},y=e.maximumRadius,A=D.chordLength(r,y),b=new Rc(void 0,void 0,e),x=new Rc(void 0,void 0,e),T=new Rc(void 0,void 0,e);for(;s.length>0;){let v=s.pop(),S=s.pop(),I=s.pop(),R=h.fromArray(u,I*3,Xge),O=h.fromArray(u,S*3,Kge),L=h.fromArray(u,v*3,$ge),_,C,w;o&&(_=U.fromArray(f,I*2,Jge),C=U.fromArray(f,S*2,Zge),w=U.fromArray(f,v*2,Qge));let P=e.cartesianToCartographic(R,IJe),M=e.cartesianToCartographic(O,PJe),F=e.cartesianToCartographic(L,DJe);b.setEndPoints(P,M);let V=b.surfaceDistance;x.setEndPoints(M,F);let B=x.surfaceDistance;T.setEndPoints(F,P);let j=T.surfaceDistance,k=Math.max(V,B,j),G,q,Q,W,J;k>A?V===k?(G=`${Math.min(I,S)} ${Math.max(I,S)}`,a=m[G],l(a)||(q=b.interpolateUsingFraction(.5,iJ),Q=(P.height+M.height)*.5,W=h.fromRadians(q.longitude,q.latitude,Q,e,zg),u.push(W.x,W.y,W.z),a=u.length/3-1,m[G]=a,o&&(J=U.add(_,C,gS),U.multiplyByScalar(J,.5,J),f.push(J.x,J.y))),s.push(I,a,v),s.push(a,S,v)):B===k?(G=`${Math.min(S,v)} ${Math.max(S,v)}`,a=m[G],l(a)||(q=x.interpolateUsingFraction(.5,iJ),Q=(M.height+F.height)*.5,W=h.fromRadians(q.longitude,q.latitude,Q,e,zg),u.push(W.x,W.y,W.z),a=u.length/3-1,m[G]=a,o&&(J=U.add(C,w,gS),U.multiplyByScalar(J,.5,J),f.push(J.x,J.y))),s.push(S,a,I),s.push(a,v,I)):j===k&&(G=`${Math.min(v,I)} ${Math.max(v,I)}`,a=m[G],l(a)||(q=T.interpolateUsingFraction(.5,iJ),Q=(F.height+P.height)*.5,W=h.fromRadians(q.longitude,q.latitude,Q,e,zg),u.push(W.x,W.y,W.z),a=u.length/3-1,m[G]=a,o&&(J=U.add(w,_,gS),U.multiplyByScalar(J,.5,J),f.push(J.x,J.y))),s.push(v,a,S),s.push(a,I,S)):(g.push(I),g.push(S),g.push(v))}let E={attributes:{position:new Ne({componentDatatype:Y.DOUBLE,componentsPerAttribute:3,values:u})},indices:g,primitiveType:Oe.TRIANGLES};return o&&(E.attributes.st=new Ne({componentDatatype:Y.FLOAT,componentsPerAttribute:2,values:f})),new St(E)};mA.scaleToGeodeticHeight=function(e,t,n,i){n=n??ee.default;let r=SJe,o=wJe;if(t=t??0,i=i??!0,l(e)){let s=e.length;for(let a=0;a<s;a+=3)h.fromArray(e,a,o),i&&(o=n.scaleToGeodeticSurface(o,o)),t!==0&&(r=n.geodeticSurfaceNormal(o,r),h.multiplyByScalar(r,t,r),h.add(o,r,o)),e[a]=o.x,e[a+1]=o.y,e[a+2]=o.z}return e};var fi=mA;function pA(){this._array=[],this._offset=0,this._length=0}Object.defineProperties(pA.prototype,{length:{get:function(){return this._length}}});pA.prototype.enqueue=function(e){this._array.push(e),this._length++};pA.prototype.dequeue=function(){if(this._length===0)return;let e=this._array,t=this._offset,n=e[t];return e[t]=void 0,t++,t>10&&t*2>e.length&&(this._array=e.slice(t),t=0),this._offset=t,this._length--,n};pA.prototype.peek=function(){if(this._length!==0)return this._array[this._offset]};pA.prototype.contains=function(e){return this._array.indexOf(e)!==-1};pA.prototype.clear=function(){this._array.length=this._offset=this._length=0};pA.prototype.sort=function(e){this._offset>0&&(this._array=this._array.slice(this._offset),this._offset=0),this._array.sort(e)};var gA=pA;var Oo={};Oo.computeHierarchyPackedLength=function(e,t){let n=0,i=[e];for(;i.length>0;){let r=i.pop();if(!l(r))continue;n+=2;let o=r.positions,s=r.holes;if(l(o)&&o.length>0&&(n+=o.length*t.packedLength),l(s)){let a=s.length;for(let c=0;c<a;++c)i.push(s[c])}}return n};Oo.packPolygonHierarchy=function(e,t,n,i){let r=[e];for(;r.length>0;){let o=r.pop();if(!l(o))continue;let s=o.positions,a=o.holes;if(t[n++]=l(s)?s.length:0,t[n++]=l(a)?a.length:0,l(s)){let c=s.length;for(let u=0;u<c;++u,n+=i.packedLength)i.pack(s[u],t,n)}if(l(a)){let c=a.length;for(let u=0;u<c;++u)r.push(a[u])}}return n};Oo.unpackPolygonHierarchy=function(e,t,n){let i=e[t++],r=e[t++],o=new Array(i),s=r>0?new Array(r):void 0;for(let a=0;a<i;++a,t+=n.packedLength)o[a]=n.unpack(e,t);for(let a=0;a<r;++a)s[a]=Oo.unpackPolygonHierarchy(e,t,n),t=s[a].startingIndex,delete s[a].startingIndex;return{positions:o,holes:s,startingIndex:t}};var dT=new U;function n_e(e,t,n,i){return U.subtract(t,e,dT),U.multiplyByScalar(dT,n/i,dT),U.add(e,dT,dT),[dT.x,dT.y]}var _A=new h;function RJe(e,t,n,i){return h.subtract(t,e,_A),h.multiplyByScalar(_A,n/i,_A),h.add(e,_A,_A),[_A.x,_A.y,_A.z]}Oo.subdivideLineCount=function(e,t,n){let r=h.distance(e,t)/n,o=Math.max(0,Math.ceil(D.log2(r)));return Math.pow(2,o)};var rH=new he,oH=new he,OJe=new he,MJe=new h,iH=new Rc;Oo.subdivideRhumbLineCount=function(e,t,n,i){let r=e.cartesianToCartographic(t,rH),o=e.cartesianToCartographic(n,oH),a=new Rc(r,o,e).surfaceDistance/i,c=Math.max(0,Math.ceil(D.log2(a)));return Math.pow(2,c)};Oo.subdivideTexcoordLine=function(e,t,n,i,r,o){let s=Oo.subdivideLineCount(n,i,r),a=U.distance(e,t),c=a/s,u=o;u.length=s*2;let f=0;for(let d=0;d<s;d++){let p=n_e(e,t,d*c,a);u[f++]=p[0],u[f++]=p[1]}return u};Oo.subdivideLine=function(e,t,n,i){let r=Oo.subdivideLineCount(e,t,n),o=h.distance(e,t),s=o/r;l(i)||(i=[]);let a=i;a.length=r*3;let c=0;for(let u=0;u<r;u++){let f=RJe(e,t,u*s,o);a[c++]=f[0],a[c++]=f[1],a[c++]=f[2]}return a};Oo.subdivideTexcoordRhumbLine=function(e,t,n,i,r,o,s){let a=n.cartesianToCartographic(i,rH),c=n.cartesianToCartographic(r,oH);iH.setEndPoints(a,c);let u=iH.surfaceDistance/o,f=Math.max(0,Math.ceil(D.log2(u))),d=Math.pow(2,f),p=U.distance(e,t),g=p/d,m=s;m.length=d*2;let y=0;for(let A=0;A<d;A++){let b=n_e(e,t,A*g,p);m[y++]=b[0],m[y++]=b[1]}return m};Oo.subdivideRhumbLine=function(e,t,n,i,r){let o=e.cartesianToCartographic(t,rH),s=e.cartesianToCartographic(n,oH),a=new Rc(o,s,e);if(l(r)||(r=[]),a.surfaceDistance<=i)return r.length=3,r[0]=t.x,r[1]=t.y,r[2]=t.z,r;let c=a.surfaceDistance/i,u=Math.max(0,Math.ceil(D.log2(c))),f=Math.pow(2,u),d=a.surfaceDistance/f,p=r;p.length=f*3;let g=0;for(let m=0;m<f;m++){let y=a.interpolateUsingSurfaceDistance(m*d,OJe),A=e.cartographicToCartesian(y,MJe);p[g++]=A.x,p[g++]=A.y,p[g++]=A.z}return p};var NJe=new h,LJe=new h,FJe=new h,BJe=new h;Oo.scaleToGeodeticHeightExtruded=function(e,t,n,i,r){i=i??ee.default;let o=NJe,s=LJe,a=FJe,c=BJe;if(l(e)&&l(e.attributes)&&l(e.attributes.position)){let u=e.attributes.position.values,f=u.length/2;for(let d=0;d<f;d+=3)h.fromArray(u,d,a),i.geodeticSurfaceNormal(a,o),c=i.scaleToGeodeticSurface(a,c),s=h.multiplyByScalar(o,n,s),s=h.add(c,s,s),u[d+f]=s.x,u[d+1+f]=s.y,u[d+2+f]=s.z,r&&(c=h.clone(a,c)),s=h.multiplyByScalar(o,t,s),s=h.add(c,s,s),u[d]=s.x,u[d+1]=s.y,u[d+2]=s.z}return e};Oo.polygonOutlinesFromHierarchy=function(e,t,n){let i=[],r=new gA;r.enqueue(e);let o,s,a;for(;r.length!==0;){let c=r.dequeue(),u=c.positions;if(t)for(a=u.length,o=0;o<a;o++)n.scaleToGeodeticSurface(u[o],u[o]);if(u=Fr(u,h.equalsEpsilon,!0),u.length<3)continue;let f=c.holes?c.holes.length:0;for(o=0;o<f;o++){let d=c.holes[o],p=d.positions;if(t)for(a=p.length,s=0;s<a;++s)n.scaleToGeodeticSurface(p[s],p[s]);if(p=Fr(p,h.equalsEpsilon,!0),p.length<3)continue;i.push(p);let g=0;for(l(d.holes)&&(g=d.holes.length),s=0;s<g;s++)r.enqueue(d.holes[s])}i.push(u)}return i};var kJe=new he;function UJe(e,t,n){let i=n.cartesianToCartographic(e,rH),r=n.cartesianToCartographic(t,oH);if(Math.sign(i.latitude)===Math.sign(r.latitude))return;iH.setEndPoints(i,r);let o=iH.findIntersectionWithLatitude(0,kJe);if(!l(o))return;let s=Math.min(i.longitude,r.longitude),a=Math.max(i.longitude,r.longitude);if(Math.abs(a-s)>D.PI){let c=s;s=a,a=c}if(!(o.longitude<s||o.longitude>a))return n.cartographicToCartesian(o)}function zJe(e,t,n,i){if(i===ln.RHUMB)return UJe(e,t,n);let r=_i.lineSegmentPlane(e,t,sn.ORIGIN_XY_PLANE);if(l(r))return n.scaleToGeodeticSurface(r,r)}var VJe=new he;function jJe(e,t,n){let i=[],r,o,s,a,c,u=0;for(;u<e.length;){r=e[u],o=e[(u+1)%e.length],s=D.sign(r.z),a=D.sign(o.z);let f=d=>t.cartesianToCartographic(d,VJe).longitude;if(s===0)i.push({position:u,type:s,visited:!1,next:a,theta:f(r)});else if(a!==0){if(c=zJe(r,o,t,n),++u,!l(c))continue;e.splice(u,0,c),i.push({position:u,type:s,visited:!1,next:a,theta:f(c)})}++u}return i}function i_e(e,t,n,i,r,o,s){let a=[],c=o,u=d=>p=>p.position===d,f=[];do{let d=n[c];a.push(d);let p=i.findIndex(u(c)),g=i[p];if(!l(g)){++c;continue}let{visited:m,type:y,next:A}=g;if(g.visited=!0,y===0){if(A===0){let E=i[p-(s?1:-1)];if(E?.position===c+1)E.visited=!0;else{++c;continue}}if(!m&&s&&A>0||o===c&&!s&&A<0){++c;continue}}if(!(s?y>=0:y<=0)){++c;continue}m||f.push(c);let x=p+(s?1:-1),T=i[x];if(!l(T)){++c;continue}c=T.position}while(c<n.length&&c>=0&&c!==o&&a.length<n.length);e.splice(t,r,a);for(let d of f)t=i_e(e,t+1,n,i,0,d,!s);return t}Oo.splitPolygonsOnEquator=function(e,t,n,i){l(i)||(i=[]),i.splice(0,0,...e),i.length=e.length;let r=0;for(;r<i.length;){let o=i[r],s=o.slice();if(o.length<3){i[r]=s,++r;continue}let a=jJe(s,t,n);if(s.length===o.length||a.length<=1){i[r]=s,++r;continue}a.sort((u,f)=>u.theta-f.theta);let c=s[0].z>=0;r=i_e(i,r,s,a,1,0,c)}return i};Oo.polygonsFromHierarchy=function(e,t,n,i,r,o){let s=[],a=[],c=new gA;c.enqueue(e);let u=l(o);for(;c.length!==0;){let f=c.dequeue(),d=f.positions,p=f.holes,g,m;if(i)for(m=d.length,g=0;g<m;g++)r.scaleToGeodeticSurface(d[g],d[g]);if(t||(d=Fr(d,h.equalsEpsilon,!0)),d.length<3)continue;let y=n(d);if(!l(y))continue;let A=[],b=fi.computeWindingOrder2D(y);if(b===Qs.CLOCKWISE&&(y.reverse(),d=d.slice().reverse()),u){u=!1;let S=[d];if(S=o(S,S),S.length>1){for(let I of S)c.enqueue(new Oc(I,p));continue}}let x=d.slice(),T=l(p)?p.length:0,E=[],v;for(g=0;g<T;g++){let S=p[g],I=S.positions;if(i)for(m=I.length,v=0;v<m;++v)r.scaleToGeodeticSurface(I[v],I[v]);if(t||(I=Fr(I,h.equalsEpsilon,!0)),I.length<3)continue;let R=n(I);if(!l(R))continue;b=fi.computeWindingOrder2D(R),b===Qs.CLOCKWISE&&(R.reverse(),I=I.slice().reverse()),E.push(I),A.push(x.length),x=x.concat(I),y=y.concat(R);let O=0;for(l(S.holes)&&(O=S.holes.length),v=0;v<O;v++)c.enqueue(S.holes[v])}s.push({outerRing:d,holes:E}),a.push({positions:x,positions2D:y,holes:A})}return{hierarchy:s,polygons:a}};var HJe=new U,GJe=new h,WJe=new Le,qJe=new $;Oo.computeBoundingRectangle=function(e,t,n,i,r){let o=Le.fromAxisAngle(e,i,WJe),s=$.fromQuaternion(o,qJe),a=Number.POSITIVE_INFINITY,c=Number.NEGATIVE_INFINITY,u=Number.POSITIVE_INFINITY,f=Number.NEGATIVE_INFINITY,d=n.length;for(let p=0;p<d;++p){let g=h.clone(n[p],GJe);$.multiplyByVector(s,g,g);let m=t(g,HJe);l(m)&&(a=Math.min(a,m.x),c=Math.max(c,m.x),u=Math.min(u,m.y),f=Math.max(f,m.y))}return r.x=a,r.y=u,r.width=c-a,r.height=f-u,r};Oo.createGeometryFromPositions=function(e,t,n,i,r,o,s){let a=fi.triangulate(t.positions2D,t.holes);a.length<3&&(a=[0,1,2]);let c=t.positions,u=l(n),f=u?n.positions:void 0;if(r){let d=c.length,p=new Array(d*3),g=0;for(let A=0;A<d;A++){let b=c[A];p[g++]=b.x,p[g++]=b.y,p[g++]=b.z}let m={attributes:{position:new Ne({componentDatatype:Y.DOUBLE,componentsPerAttribute:3,values:p})},indices:a,primitiveType:Oe.TRIANGLES};u&&(m.attributes.st=new Ne({componentDatatype:Y.FLOAT,componentsPerAttribute:2,values:U.packArray(f)}));let y=new St(m);return o.normal?Hn.computeNormal(y):y}if(s===ln.GEODESIC)return fi.computeSubdivision(e,c,a,f,i);if(s===ln.RHUMB)return fi.computeRhumbLineSubdivision(e,c,a,f,i)};var e_e=[],t_e=[],YJe=new h,XJe=new h;Oo.computeWallGeometry=function(e,t,n,i,r,o){let s,a,c,u,f,d,p,g,m,y=e.length,A=0,b=0,x=l(t),T=x?t.positions:void 0;if(r)for(a=y*3*2,s=new Array(a*2),x&&(m=y*2*2,g=new Array(m*2)),c=0;c<y;c++)u=e[c],f=e[(c+1)%y],s[A]=s[A+a]=u.x,++A,s[A]=s[A+a]=u.y,++A,s[A]=s[A+a]=u.z,++A,s[A]=s[A+a]=f.x,++A,s[A]=s[A+a]=f.y,++A,s[A]=s[A+a]=f.z,++A,x&&(d=T[c],p=T[(c+1)%y],g[b]=g[b+m]=d.x,++b,g[b]=g[b+m]=d.y,++b,g[b]=g[b+m]=p.x,++b,g[b]=g[b+m]=p.y,++b);else{let R=D.chordLength(i,n.maximumRadius),O=0;if(o===ln.GEODESIC)for(c=0;c<y;c++)O+=Oo.subdivideLineCount(e[c],e[(c+1)%y],R);else if(o===ln.RHUMB)for(c=0;c<y;c++)O+=Oo.subdivideRhumbLineCount(n,e[c],e[(c+1)%y],R);for(a=(O+y)*3,s=new Array(a*2),x&&(m=(O+y)*2,g=new Array(m*2)),c=0;c<y;c++){u=e[c],f=e[(c+1)%y];let L,_;x&&(d=T[c],p=T[(c+1)%y]),o===ln.GEODESIC?(L=Oo.subdivideLine(u,f,R,t_e),x&&(_=Oo.subdivideTexcoordLine(d,p,u,f,R,e_e))):o===ln.RHUMB&&(L=Oo.subdivideRhumbLine(n,u,f,R,t_e),x&&(_=Oo.subdivideTexcoordRhumbLine(d,p,n,u,f,R,e_e)));let C=L.length;for(let w=0;w<C;++w,++A)s[A]=L[w],s[A+a]=L[w];if(s[A]=f.x,s[A+a]=f.x,++A,s[A]=f.y,s[A+a]=f.y,++A,s[A]=f.z,s[A+a]=f.z,++A,x){let w=_.length;for(let P=0;P<w;++P,++b)g[b]=_[P],g[b+m]=_[P];g[b]=p.x,g[b+m]=p.x,++b,g[b]=p.y,g[b+m]=p.y,++b}}}y=s.length;let E=je.createTypedArray(y/3,y-e.length*6),v=0;for(y/=6,c=0;c<y;c++){let R=c,O=R+1,L=R+y,_=L+1;u=h.fromArray(s,R*3,YJe),f=h.fromArray(s,O*3,XJe),!h.equalsEpsilon(u,f,D.EPSILON10,D.EPSILON10)&&(E[v++]=R,E[v++]=L,E[v++]=O,E[v++]=O,E[v++]=L,E[v++]=_)}let S={attributes:new Tn({position:new Ne({componentDatatype:Y.DOUBLE,componentsPerAttribute:3,values:s})}),indices:E,primitiveType:Oe.TRIANGLES};return x&&(S.attributes.st=new Ne({componentDatatype:Y.FLOAT,componentsPerAttribute:2,values:g})),new St(S)};var ni=Oo;function Ts(e,t){this.position=e,l(this.position)||(this.position=new U),this.tangentPlane=t,l(this.tangentPlane)||(this.tangentPlane=Ts.NORTH_POLE_TANGENT_PLANE)}Object.defineProperties(Ts.prototype,{ellipsoid:{get:function(){return this.tangentPlane.ellipsoid}},x:{get:function(){return this.position.x}},y:{get:function(){return this.position.y}},conformalLatitude:{get:function(){let e=U.magnitude(this.position),t=2*this.ellipsoid.maximumRadius;return this.tangentPlane.plane.normal.z*(D.PI_OVER_TWO-2*Math.atan2(e,t))}},longitude:{get:function(){let e=D.PI_OVER_TWO+Math.atan2(this.y,this.x);return e>Math.PI&&(e-=D.TWO_PI),e}}});var _S=new he,KJe=new h;Ts.prototype.getLatitude=function(e){l(e)||(e=ee.default),_S.latitude=this.conformalLatitude,_S.longitude=this.longitude,_S.height=0;let t=this.ellipsoid.cartographicToCartesian(_S,KJe);return e.cartesianToCartographic(t,_S),_S.latitude};var $Je=new pn,JJe=new h,ZJe=new h;Ts.fromCartesian=function(e,t){let n=D.signNotZero(e.z),i=Ts.NORTH_POLE_TANGENT_PLANE,r=Ts.SOUTH_POLE;n<0&&(i=Ts.SOUTH_POLE_TANGENT_PLANE,r=Ts.NORTH_POLE);let o=$Je;o.origin=i.ellipsoid.scaleToGeocentricSurface(e,o.origin),o.direction=h.subtract(o.origin,r,JJe),h.normalize(o.direction,o.direction);let s=_i.rayPlane(o,i.plane,ZJe),a=h.subtract(s,r,s),c=h.dot(i.xAxis,a),u=n*h.dot(i.yAxis,a);return l(t)?(t.position=new U(c,u),t.tangentPlane=i,t):new Ts(new U(c,u),i)};Ts.fromCartesianArray=function(e,t){let n=e.length;l(t)?t.length=n:t=new Array(n);for(let i=0;i<n;i++)t[i]=Ts.fromCartesian(e[i],t[i]);return t};Ts.clone=function(e,t){if(l(e))return l(t)?(t.position=e.position,t.tangentPlane=e.tangentPlane,t):new Ts(e.position,e.tangentPlane)};Ts.HALF_UNIT_SPHERE=Object.freeze(new ee(.5,.5,.5));Ts.NORTH_POLE=Object.freeze(new h(0,0,.5));Ts.SOUTH_POLE=Object.freeze(new h(0,0,-.5));Ts.NORTH_POLE_TANGENT_PLANE=Object.freeze(new Vs(Ts.NORTH_POLE,Ts.HALF_UNIT_SPHERE));Ts.SOUTH_POLE_TANGENT_PLANE=Object.freeze(new Vs(Ts.SOUTH_POLE,Ts.HALF_UNIT_SPHERE));var al=Ts;var QJe=new he,r_e=new he;function eZe(e,t,n,i){let o=i.cartesianToCartographic(e,QJe).height,s=i.cartesianToCartographic(t,r_e);s.height=o,i.cartographicToCartesian(s,t);let a=i.cartesianToCartographic(n,r_e);a.height=o-100,i.cartographicToCartesian(a,n)}var o_e=new et,tZe=new h,nZe=new h,iZe=new h,rZe=new h,oZe=new h,sZe=new h,sH=new h,Wp=new h,yS=new h,aZe=new U,cZe=new U,lZe=new h,s_e=new Le,uZe=new $,fZe=new $;function rJ(e){let t=e.vertexFormat,n=e.geometry,i=e.shadowVolume,r=n.attributes.position.values,o=l(n.attributes.st)?n.attributes.st.values:void 0,s=r.length,a=e.wall,c=e.top||a,u=e.bottom||a;if(t.st||t.normal||t.tangent||t.bitangent||i){let f=e.boundingRectangle,d=e.rotationAxis,p=e.projectTo2d,g=e.ellipsoid,m=e.stRotation,y=e.perPositionHeight,A=aZe;A.x=f.x,A.y=f.y;let b=t.st?new Float32Array(2*(s/3)):void 0,x;t.normal&&(y&&c&&!a?x=n.attributes.normal.values:x=new Float32Array(s));let T=t.tangent?new Float32Array(s):void 0,E=t.bitangent?new Float32Array(s):void 0,v=i?new Float32Array(s):void 0,S=0,I=0,R=nZe,O=iZe,L=rZe,_=!0,C=uZe,w=fZe;if(m!==0){let F=Le.fromAxisAngle(d,m,s_e);C=$.fromQuaternion(F,C),F=Le.fromAxisAngle(d,-m,s_e),w=$.fromQuaternion(F,w)}else C=$.clone($.IDENTITY,C),w=$.clone($.IDENTITY,w);let P=0,M=0;c&&u&&(P=s/2,M=s/3,s/=2);for(let F=0;F<s;F+=3){let V=h.fromArray(r,F,lZe);if(t.st&&!l(o)){let B=$.multiplyByVector(C,V,tZe);B=g.scaleToGeodeticSurface(B,B);let j=p([B],cZe)[0];U.subtract(j,A,j);let k=D.clamp(j.x/f.width,0,1),G=D.clamp(j.y/f.height,0,1);u&&(b[S+M]=k,b[S+1+M]=G),c&&(b[S]=k,b[S+1]=G),S+=2}if(t.normal||t.tangent||t.bitangent||i){let B=I+1,j=I+2;if(a){if(F+3<s){let k=h.fromArray(r,F+3,oZe);if(_){let G=h.fromArray(r,F+s,sZe);y&&eZe(V,k,G,g),h.subtract(k,V,k),h.subtract(G,V,G),R=h.normalize(h.cross(G,k,R),R),_=!1}h.equalsEpsilon(k,V,D.EPSILON10)&&(_=!0)}(t.tangent||t.bitangent)&&(L=g.geodeticSurfaceNormal(V,L),t.tangent&&(O=h.normalize(h.cross(L,R,O),O)))}else R=g.geodeticSurfaceNormal(V,R),(t.tangent||t.bitangent)&&(y&&(sH=h.fromArray(x,I,sH),Wp=h.cross(h.UNIT_Z,sH,Wp),Wp=h.normalize($.multiplyByVector(w,Wp,Wp),Wp),t.bitangent&&(yS=h.normalize(h.cross(sH,Wp,yS),yS))),O=h.cross(h.UNIT_Z,R,O),O=h.normalize($.multiplyByVector(w,O,O),O),t.bitangent&&(L=h.normalize(h.cross(R,O,L),L)));t.normal&&(e.wall?(x[I+P]=R.x,x[B+P]=R.y,x[j+P]=R.z):u&&(x[I+P]=-R.x,x[B+P]=-R.y,x[j+P]=-R.z),(c&&!y||a)&&(x[I]=R.x,x[B]=R.y,x[j]=R.z)),i&&(a&&(R=g.geodeticSurfaceNormal(V,R)),v[I+P]=-R.x,v[B+P]=-R.y,v[j+P]=-R.z),t.tangent&&(e.wall?(T[I+P]=O.x,T[B+P]=O.y,T[j+P]=O.z):u&&(T[I+P]=-O.x,T[B+P]=-O.y,T[j+P]=-O.z),c&&(y?(T[I]=Wp.x,T[B]=Wp.y,T[j]=Wp.z):(T[I]=O.x,T[B]=O.y,T[j]=O.z))),t.bitangent&&(u&&(E[I+P]=L.x,E[B+P]=L.y,E[j+P]=L.z),c&&(y?(E[I]=yS.x,E[B]=yS.y,E[j]=yS.z):(E[I]=L.x,E[B]=L.y,E[j]=L.z))),I+=3}}t.st&&!l(o)&&(n.attributes.st=new Ne({componentDatatype:Y.FLOAT,componentsPerAttribute:2,values:b})),t.normal&&(n.attributes.normal=new Ne({componentDatatype:Y.FLOAT,componentsPerAttribute:3,values:x})),t.tangent&&(n.attributes.tangent=new Ne({componentDatatype:Y.FLOAT,componentsPerAttribute:3,values:T})),t.bitangent&&(n.attributes.bitangent=new Ne({componentDatatype:Y.FLOAT,componentsPerAttribute:3,values:E})),i&&(n.attributes.extrudeDirection=new Ne({componentDatatype:Y.FLOAT,componentsPerAttribute:3,values:v}))}if(e.extrude&&l(e.offsetAttribute)){let f=r.length/3,d=new Uint8Array(f);if(e.offsetAttribute===mn.TOP)c&&u||a?d=d.fill(1,0,f/2):c&&(d=d.fill(1));else{let p=e.offsetAttribute===mn.NONE?0:1;d=d.fill(p)}n.attributes.applyOffset=new Ne({componentDatatype:Y.UNSIGNED_BYTE,componentsPerAttribute:1,values:d})}return n}var a_e=[];function dZe(e,t,n,i,r,o,s,a,c,u){let f={walls:[]},d;if(s||a){let x=ni.createGeometryFromPositions(e,t,n,i,o,c,u),T=x.attributes.position.values,E=x.indices,v,S;if(s&&a){let I=T.concat(T);v=I.length/3,S=je.createTypedArray(v,E.length*2),S.set(E);let R=E.length,O=v/2;for(d=0;d<R;d+=3){let L=S[d]+O,_=S[d+1]+O,C=S[d+2]+O;S[d+R]=C,S[d+1+R]=_,S[d+2+R]=L}if(x.attributes.position.values=I,o&&c.normal){let L=x.attributes.normal.values;x.attributes.normal.values=new Float32Array(I.length),x.attributes.normal.values.set(L)}if(c.st&&l(n)){let L=x.attributes.st.values;x.attributes.st.values=new Float32Array(v*2),x.attributes.st.values=L.concat(L)}x.indices=S}else if(a){for(v=T.length/3,S=je.createTypedArray(v,E.length),d=0;d<E.length;d+=3)S[d]=E[d+2],S[d+1]=E[d+1],S[d+2]=E[d];x.indices=S}f.topAndBottom=new Ft({geometry:x})}let p=r.outerRing,g=Vs.fromPoints(p,e),m=g.projectPointsOntoPlane(p,a_e),y=fi.computeWindingOrder2D(m);y===Qs.CLOCKWISE&&(p=p.slice().reverse());let A=ni.computeWallGeometry(p,n,e,i,o,u);f.walls.push(new Ft({geometry:A}));let b=r.holes;for(d=0;d<b.length;d++){let x=b[d];m=g.projectPointsOntoPlane(x,a_e),y=fi.computeWindingOrder2D(m),y===Qs.COUNTER_CLOCKWISE&&(x=x.slice().reverse()),A=ni.computeWallGeometry(x,n,e,i,o,u),f.walls.push(new Ft({geometry:A}))}return f}function Hd(e){let t=e.polygonHierarchy,n=e.vertexFormat??Be.DEFAULT,i=e.ellipsoid??ee.default,r=e.granularity??D.RADIANS_PER_DEGREE,o=e.stRotation??0,s=e.textureCoordinates,a=e.perPositionHeight??!1,c=a&&l(e.extrudedHeight),u=e.height??0,f=e.extrudedHeight??u;if(!c){let d=Math.max(u,f);f=Math.min(u,f),u=d}this._vertexFormat=Be.clone(n),this._ellipsoid=ee.clone(i),this._granularity=r,this._stRotation=o,this._height=u,this._extrudedHeight=f,this._closeTop=e.closeTop??!0,this._closeBottom=e.closeBottom??!0,this._polygonHierarchy=t,this._perPositionHeight=a,this._perPositionHeightExtrude=c,this._shadowVolume=e.shadowVolume??!1,this._workerName="createPolygonGeometry",this._offsetAttribute=e.offsetAttribute,this._arcType=e.arcType??ln.GEODESIC,this._rectangle=void 0,this._textureCoordinateRotationPoints=void 0,this._textureCoordinates=s,this.packedLength=ni.computeHierarchyPackedLength(t,h)+ee.packedLength+Be.packedLength+(s?ni.computeHierarchyPackedLength(s,U):1)+12}Hd.fromPositions=function(e){e=e??H.EMPTY_OBJECT;let t={polygonHierarchy:{positions:e.positions},height:e.height,extrudedHeight:e.extrudedHeight,vertexFormat:e.vertexFormat,stRotation:e.stRotation,ellipsoid:e.ellipsoid,granularity:e.granularity,perPositionHeight:e.perPositionHeight,closeTop:e.closeTop,closeBottom:e.closeBottom,offsetAttribute:e.offsetAttribute,arcType:e.arcType,textureCoordinates:e.textureCoordinates};return new Hd(t)};Hd.pack=function(e,t,n){return n=n??0,n=ni.packPolygonHierarchy(e._polygonHierarchy,t,n,h),ee.pack(e._ellipsoid,t,n),n+=ee.packedLength,Be.pack(e._vertexFormat,t,n),n+=Be.packedLength,t[n++]=e._height,t[n++]=e._extrudedHeight,t[n++]=e._granularity,t[n++]=e._stRotation,t[n++]=e._perPositionHeightExtrude?1:0,t[n++]=e._perPositionHeight?1:0,t[n++]=e._closeTop?1:0,t[n++]=e._closeBottom?1:0,t[n++]=e._shadowVolume?1:0,t[n++]=e._offsetAttribute??-1,t[n++]=e._arcType,l(e._textureCoordinates)?n=ni.packPolygonHierarchy(e._textureCoordinates,t,n,U):t[n++]=-1,t[n]=e.packedLength,t};var hZe=ee.clone(ee.UNIT_SPHERE),mZe=new Be,pZe={polygonHierarchy:{}};Hd.unpack=function(e,t,n){t=t??0;let i=ni.unpackPolygonHierarchy(e,t,h);t=i.startingIndex,delete i.startingIndex;let r=ee.unpack(e,t,hZe);t+=ee.packedLength;let o=Be.unpack(e,t,mZe);t+=Be.packedLength;let s=e[t++],a=e[t++],c=e[t++],u=e[t++],f=e[t++]===1,d=e[t++]===1,p=e[t++]===1,g=e[t++]===1,m=e[t++]===1,y=e[t++],A=e[t++],b=e[t]===-1?void 0:ni.unpackPolygonHierarchy(e,t,U);l(b)?(t=b.startingIndex,delete b.startingIndex):t++;let x=e[t];return l(n)||(n=new Hd(pZe)),n._polygonHierarchy=i,n._ellipsoid=ee.clone(r,n._ellipsoid),n._vertexFormat=Be.clone(o,n._vertexFormat),n._height=s,n._extrudedHeight=a,n._granularity=c,n._stRotation=u,n._perPositionHeightExtrude=f,n._perPositionHeight=d,n._closeTop=p,n._closeBottom=g,n._shadowVolume=m,n._offsetAttribute=y===-1?void 0:y,n._arcType=A,n._textureCoordinates=b,n.packedLength=x,n};var gZe=new U,_Ze=new U,yZe=new al;function c_e(e,t,n,i,r,o){let s=e.longitude,a=s>=0?s:s+D.TWO_PI;r.westOverIdl=Math.min(r.westOverIdl,a),r.eastOverIdl=Math.max(r.eastOverIdl,a),o.west=Math.min(o.west,s),o.east=Math.max(o.east,s);let c=e.getLatitude(n),u=c;if(o.south=Math.min(o.south,c),o.north=Math.max(o.north,c),i!==ln.RHUMB){let p=U.subtract(t.position,e.position,gZe),g=U.dot(t.position,p)/U.dot(p,p);if(g>0&&g<1){let m=U.add(t.position,U.multiplyByScalar(p,-g,p),_Ze),y=al.clone(t,yZe);y.position=m;let A=y.getLatitude(n);o.south=Math.min(o.south,A),o.north=Math.max(o.north,A),Math.abs(c)>Math.abs(A)&&(u=A)}}let f=t.x*e.y-e.x*t.y,d=Math.sign(f);d!==0&&(d*=U.angleBetween(t.position,e.position)),u>=0&&(r.northAngle+=d),u<=0&&(r.southAngle+=d)}var l_e=new al,AZe=new al,jd={northAngle:0,southAngle:0,westOverIdl:0,eastOverIdl:0};Hd.computeRectangleFromPositions=function(e,t,n,i){if(l(i)||(i=new ie),e.length<3)return i;i.west=Number.POSITIVE_INFINITY,i.east=Number.NEGATIVE_INFINITY,i.south=Number.POSITIVE_INFINITY,i.north=Number.NEGATIVE_INFINITY,jd.northAngle=0,jd.southAngle=0,jd.westOverIdl=Number.POSITIVE_INFINITY,jd.eastOverIdl=Number.NEGATIVE_INFINITY;let r=e.length,o=al.fromCartesian(e[0],AZe);for(let s=1;s<r;s++){let a=al.fromCartesian(e[s],l_e);c_e(a,o,t,n,jd,i),o=al.clone(a,o)}return c_e(al.fromCartesian(e[0],l_e),o,t,n,jd,i),i.east-i.west>jd.eastOverIdl-jd.westOverIdl&&(i.west=jd.westOverIdl,i.east=jd.eastOverIdl,i.east>D.PI&&(i.east=i.east-D.TWO_PI),i.west>D.PI&&(i.west=i.west-D.TWO_PI)),D.equalsEpsilon(Math.abs(jd.northAngle),D.TWO_PI,D.EPSILON10)&&(i.north=D.PI_OVER_TWO,i.east=D.PI,i.west=-D.PI),D.equalsEpsilon(Math.abs(jd.southAngle),D.TWO_PI,D.EPSILON10)&&(i.south=-D.PI_OVER_TWO,i.east=D.PI,i.west=-D.PI),i};var bZe=new al;function xZe(e,t,n){return e.height>=D.PI||e.width>=D.PI?al.fromCartesian(t[0],bZe).tangentPlane:Vs.fromPoints(t,n)}var u_e=new he;function TZe(e,t,n){return(i,r)=>{if(e.height>=D.PI||e.width>=D.PI){if(e.south<0&&e.north>0){l(r)||(r=[]);for(let s=0;s<i.length;++s){let a=n.cartesianToCartographic(i[s],u_e);r[s]=new U(a.longitude/D.PI,a.latitude/D.PI_OVER_TWO)}return r.length=i.length,r}return al.fromCartesianArray(i,r)}return Vs.fromPoints(t,n).projectPointsOntoPlane(i,r)}}function EZe(e,t,n){if(e.height>=D.PI||e.width>=D.PI)return(r,o)=>{if(e.south<0&&e.north>0){let s=n.cartesianToCartographic(r,u_e);return l(o)||(o=new U),o.x=s.longitude/D.PI,o.y=s.latitude/D.PI_OVER_TWO,o}return al.fromCartesian(r,o)};let i=Vs.fromPoints(t,n);return(r,o)=>i.projectPointsOntoPlane(r,o)}function CZe(e,t,n,i){return(r,o)=>!i&&(e.height>=D.PI_OVER_TWO||e.width>=2*D.PI_OVER_THREE)?ni.splitPolygonsOnEquator(r,t,n,o):r}function vZe(e,t,n,i){if(t.height>=D.PI||t.width>=D.PI)return et.fromRectangle(t,void 0,o_e);let r=e,o=Vs.fromPoints(r,n);return ni.computeBoundingRectangle(o.plane.normal,o.projectPointOntoPlane.bind(o),r,i,o_e)}Hd.createGeometry=function(e){let t=e._vertexFormat,n=e._ellipsoid,i=e._granularity,r=e._stRotation,o=e._polygonHierarchy,s=e._perPositionHeight,a=e._closeTop,c=e._closeBottom,u=e._arcType,f=e._textureCoordinates,d=l(f),p=o.positions;if(p.length<3)return;let g=e.rectangle,m=ni.polygonsFromHierarchy(o,d,TZe(g,p,n),!s,n,CZe(g,n,u,s)),y=m.hierarchy,A=m.polygons,b=function(P){return P},x=d?ni.polygonsFromHierarchy(f,!0,b,!1,n).polygons:void 0;if(y.length===0)return;let T=y[0].outerRing,E=vZe(T,g,n,r),v=[],S=e._height,I=e._extrudedHeight,R=e._perPositionHeightExtrude||!D.equalsEpsilon(S,I,0,D.EPSILON2),O={perPositionHeight:s,vertexFormat:t,geometry:void 0,rotationAxis:xZe(g,T,n).plane.normal,projectTo2d:EZe(g,T,n),boundingRectangle:E,ellipsoid:n,stRotation:r,textureCoordinates:void 0,bottom:!1,top:!0,wall:!1,extrude:!1,arcType:u},L;if(R)for(O.extrude=!0,O.top=a,O.bottom=c,O.shadowVolume=e._shadowVolume,O.offsetAttribute=e._offsetAttribute,L=0;L<A.length;L++){let P=dZe(n,A[L],d?x[L]:void 0,i,y[L],s,a,c,t,u),M;a&&c?(M=P.topAndBottom,O.geometry=ni.scaleToGeodeticHeightExtruded(M.geometry,S,I,n,s)):a?(M=P.topAndBottom,M.geometry.attributes.position.values=fi.scaleToGeodeticHeight(M.geometry.attributes.position.values,S,n,!s),O.geometry=M.geometry):c&&(M=P.topAndBottom,M.geometry.attributes.position.values=fi.scaleToGeodeticHeight(M.geometry.attributes.position.values,I,n,!0),O.geometry=M.geometry),(a||c)&&(O.wall=!1,M.geometry=rJ(O),v.push(M));let F=P.walls;O.wall=!0;for(let V=0;V<F.length;V++){let B=F[V];O.geometry=ni.scaleToGeodeticHeightExtruded(B.geometry,S,I,n,s),B.geometry=rJ(O),v.push(B)}}else for(L=0;L<A.length;L++){let P=new Ft({geometry:ni.createGeometryFromPositions(n,A[L],d?x[L]:void 0,i,s,t,u)});if(P.geometry.attributes.position.values=fi.scaleToGeodeticHeight(P.geometry.attributes.position.values,S,n,!s),O.geometry=P.geometry,P.geometry=rJ(O),l(e._offsetAttribute)){let M=P.geometry.attributes.position.values.length,F=e._offsetAttribute===mn.NONE?0:1,V=new Uint8Array(M/3).fill(F);P.geometry.attributes.applyOffset=new Ne({componentDatatype:Y.UNSIGNED_BYTE,componentsPerAttribute:1,values:V})}v.push(P)}let _=Hn.combineInstances(v)[0];_.attributes.position.values=new Float64Array(_.attributes.position.values),_.indices=je.createTypedArray(_.attributes.position.values.length/3,_.indices);let C=_.attributes,w=ue.fromVertices(C.position.values);return t.position||delete C.position,new St({attributes:C,indices:_.indices,primitiveType:_.primitiveType,boundingSphere:w,offsetAttribute:e._offsetAttribute})};Hd.createShadowVolume=function(e,t,n){let i=e._granularity,r=e._ellipsoid,o=t(i,r),s=n(i,r);return new Hd({polygonHierarchy:e._polygonHierarchy,ellipsoid:r,stRotation:e._stRotation,granularity:i,perPositionHeight:!1,extrudedHeight:o,height:s,vertexFormat:Be.POSITION_ONLY,shadowVolume:!0,arcType:e._arcType})};function SZe(e){let t=-e._stRotation;if(t===0)return[0,0,0,1,1,0];let n=e._ellipsoid,i=e._polygonHierarchy.positions,r=e.rectangle;return St._textureCoordinateRotationPoints(i,t,n,r)}Object.defineProperties(Hd.prototype,{rectangle:{get:function(){if(!l(this._rectangle)){let e=this._polygonHierarchy.positions;this._rectangle=Hd.computeRectangleFromPositions(e,this._ellipsoid,this._arcType)}return this._rectangle}},textureCoordinateRotationPoints:{get:function(){return l(this._textureCoordinateRotationPoints)||(this._textureCoordinateRotationPoints=SZe(this)),this._textureCoordinateRotationPoints}}});var qp=Hd;function AS(e){this._ellipsoid=e.ellipsoid??ee.default,this._positions=aH(e.positions),this._holes=l(e.holes)?e.holes.map(aH):[],this._rectangle=qp.computeRectangleFromPositions(this._positions,this._ellipsoid),oJ(this._positions),f_e(this._holes)}function aH(e){if(!l(e))return;let t=e.length,n=Array(t);for(let i=0;i<t;i++)n[i]=h.clone(e[i]);return n}function oJ(e){for(let t=0;t<e.length;t++)Object.freeze(e[t]);return Object.freeze(e)}function f_e(e){for(let t=0;t<e.length;t++)oJ(e[t]);return Object.freeze(e)}function wZe(e,t){if(!l(e)&&!l(t))return!0;if(l(e)!==l(t)||e.length!==t.length)return!1;let n=e.length;for(let i=0;i<n;i++){let r=e[i],o=t[i];if(!h.equals(r,o))return!1}return!0}function IZe(e,t){if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(!wZe(e[n],t[n]))return!1;return!0}Object.defineProperties(AS.prototype,{length:{get:function(){let e=this._positions.length,t=this._holes;for(let n=0;n<t.length;n++)e+=t[n].length;return e}},positions:{get:function(){return this._positions}},holes:{get:function(){return this._holes}},ellipsoid:{get:function(){return this._ellipsoid}},rectangle:{get:function(){return this._rectangle}}});AS.clone=function(e,t){return l(t)?(t._ellipsoid=e.ellipsoid,t._positions=aH(e.positions),t._holes=e.holes.map(aH),t._rectangle=qp.computeRectangleFromPositions(t._positions,t._ellipsoid),oJ(t._positions),f_e(t._holes),t):new AS({positions:e.positions,holes:e.holes,ellipsoid:e.ellipsoid})};AS.equals=function(e,t){return e.ellipsoid.equals(t.ellipsoid)&&e.positions===t.positions&&IZe(e.holes,t.holes)};AS.prototype.computeRectangle=function(e){return qr("ClippingPolygon.computeRectangle","ClippingPolygon.computeRectangle is deprecated as of CesiumJS 1.145 and will be removed in 1.147. Use the ClippingPolygon.rectangle property instead."),ie.clone(this._rectangle,e)};var bS=AS;var d_e={OPAQUE:0,TRANSLUCENT:1,OPAQUE_AND_TRANSLUCENT:2};Object.freeze(d_e);var Fi=d_e;var SL=class SL{constructor(t=H.EMPTY_OBJECT){ut(this,"_renderContext",null);this.show=t.show??!0,this._heightReference=t.heightReference??We.NONE,this._blendOption=t.blendOption??Fi.TRANSLUCENT,this._modelMatrix=N.clone(t.modelMatrix??N.IDENTITY),this._boundingVolume=ue.clone(t.boundingVolume??new ue,new ue),this._boundingVolumeAutoUpdate=!l(t.boundingVolume),this._allowPicking=t.allowPicking??!1,this._pickIds=new Map,this._customPickObjects=[],this.debugShowBoundingVolume=t.debugShowBoundingVolume??!1,this._primitiveCount=0,this._primitiveCountMax=t.primitiveCountMax??SL.DEFAULT_CAPACITY,this._primitiveView=null,this._positionCount=0,this._positionCountMax=t.vertexCountMax??SL.DEFAULT_CAPACITY,this._positionView=null,this._positionDatatype=t.positionDatatype??Y.DOUBLE,this._positionNormalized=t.positionNormalized??!1,this._materialView=null,this._dirtyOffset=0,this._dirtyCount=0,this._dirtyBoundingVolume=!1,this._version=0,this._allocatePrimitiveBuffer(),this._allocatePositionBuffer(),this._allocateMaterialBuffer()}_getCollectionClass(){pe.throwInstantiationError()}_getPrimitiveClass(){pe.throwInstantiationError()}_getMaterialClass(){pe.throwInstantiationError()}_allocatePrimitiveBuffer(){let t=this._getPrimitiveClass().Layout;this._primitiveView=new DataView(new ArrayBuffer(this._primitiveCountMax*t.__BYTE_LENGTH))}_allocatePositionBuffer(){this._positionView=Y.createTypedArray(this._positionDatatype,this._positionCountMax*3)}_allocateMaterialBuffer(){let t=this._getMaterialClass();this._materialView=new DataView(new ArrayBuffer(this._primitiveCountMax*t.packedLength))}isDestroyed(){return!1}destroy(){this._customPickObjects.length=0;for(let t of this._pickIds.values())for(let n of t)n.destroy();l(this._renderContext)&&(this._renderContext.destroy(),this._renderContext=void 0,this._dirtyOffset=0,this._dirtyCount=this.primitiveCount)}sort(t,n=new Uint32Array(this.primitiveCount)){let i=this._getPrimitiveClass(),r=this._getCollectionClass(),{primitiveCount:o}=this,s=new i,a=new i,c=new Uint32Array(o);for(let f=0;f<o;f++)c[f]=f;c.sort((f,d)=>t(this.get(f,s),this.get(d,a)));for(let f=0;f<o;f++)n[c[f]]=f;let u=this._cloneEmpty();for(let f=0;f<o;f++){let d=this.get(c[f],s),p=u.add({},a);i.clone(d,p)}return r._replaceBuffers(u,this),this._dirtyOffset=0,this._dirtyCount=o,n}static clone(t,n,i){if(l(i))return this._cloneFiltered(t,n,i);let r=t._getPrimitiveClass().Layout,o=t._getMaterialClass(),s=t._getPrimitiveClass();this._copySubDataView(t._primitiveView,n._primitiveView,t.primitiveCount*r.__BYTE_LENGTH),this._copySubArray(t._positionView,n._positionView,t.vertexCount*3),this._copySubDataView(t._materialView,n._materialView,t.primitiveCount*o.packedLength),n._primitiveCount=t._primitiveCount,n._positionCount=t._positionCount;let a=t._customPickObjects,c=n._customPickObjects;c.length=0;let u=new s;for(let f=0,d=n.primitiveCount;f<d;f++)c[f]=a[f],n.get(f,u)._pickId=0;return n._dirtyOffset=0,n._dirtyCount=n.primitiveCount,t.boundingVolume.clone(n.boundingVolume),n}static _cloneFiltered(t,n,i){let r=t._getPrimitiveClass(),o=new r,s=new r,a=t._customPickObjects,c=n._customPickObjects;c.length=0;for(let u=0,f=t._primitiveCount;u<f;u++){if(t.get(u,o),!i(o,u))continue;let d=n._primitiveCount;r.clone(o,n.add({},s)),l(a[u])&&(c[d]=a[u])}return n}static fromCollection(t,n=H.EMPTY_OBJECT,i){let r=t._cloneEmpty(n);return t._getCollectionClass().clone(t,r,i),r}_cloneEmptyBaseArgs(t){return{primitiveCountMax:this.primitiveCountMax,vertexCountMax:this.vertexCountMax,positionDatatype:this.positionDatatype,positionNormalized:this.positionNormalized,modelMatrix:this._modelMatrix,show:this.show,debugShowBoundingVolume:this.debugShowBoundingVolume,blendOption:this._blendOption,allowPicking:this._allowPicking,boundingVolume:this._boundingVolumeAutoUpdate?void 0:this._boundingVolume,...t}}_cloneEmpty(t){pe.throwInstantiationError()}static _replaceBuffers(t,n){n._primitiveView=t._primitiveView,n._positionView=t._positionView,n._materialView=t._materialView}_updateBoundingVolume(){let t=this._positionView.subarray(0,this._positionCount*3);this._positionNormalized&&(t=cn.dequantize(t,this._positionDatatype,Vt.VEC3,this._positionCount)),ue.fromVertices(t,h.ZERO,3,this._boundingVolume),ue.transform(this._boundingVolume,this._modelMatrix,this._boundingVolume),this._dirtyBoundingVolume=!1}_updatePickIds(t){let n=this._pickIds.get(t);if(n&&n.length===this._primitiveCount)return;n||(n=[],this._pickIds.set(t,n));let i=this,r=this._getPrimitiveClass(),o=new r;for(let s=n.length,a=this._primitiveCount;s<a;s++){this.get(s,o);let c=this._customPickObjects[s]||{collection:this,index:s,get primitive(){return i.get(s,new r)}},u=t.createPickId(c);o._pickId=u.key,n.push(u)}}get(t,n){return n._collection=this,n._index=t,n._byteOffset=t*this._getPrimitiveClass().Layout.__BYTE_LENGTH,n}add(t=H.EMPTY_OBJECT,n){let i=this._getMaterialClass(),r=this._primitiveCount++;return n=this.get(r,n),n.featureId=t.featureId??r,n.show=t.show??!0,n.setMaterial(t.material??i.DEFAULT_MATERIAL),n._pickId=0,n._dirty=!0,l(t.pickObject)&&(this._customPickObjects[r]=t.pickObject),n}_makeDirty(t){this._dirtyCount===0?(this._dirtyCount=1,this._dirtyOffset=t):t<this._dirtyOffset?(this._dirtyCount+=this._dirtyOffset-t,this._dirtyOffset=t):t+1>this._dirtyOffset+this._dirtyCount&&(this._dirtyCount=t+1-this._dirtyOffset)}_makeClean(){this._dirtyCount>0&&(this._dirtyCount=0,this._dirtyOffset=0,this._version++)}_makeDirtyBoundingVolume(){this._boundingVolumeAutoUpdate&&(this._dirtyBoundingVolume=!0)}update(t){t.mode!==re.SCENE3D&&_t("bufferprim-scenemode","BufferPrimitiveCollection requires SceneMode.SCENE3D."),this._dirtyBoundingVolume&&this._updateBoundingVolume(),this._allowPicking&&this._updatePickIds(t.context)}_isRendered(t){let n=t.passes;return this.show&&!As(this._heightReference)&&(n.render||n.pick)}get primitiveCount(){return this._primitiveCount}get primitiveCountMax(){return this._primitiveCountMax}get byteLength(){return this._primitiveView.byteLength+this._positionView.byteLength+this._materialView.byteLength}get vertexCount(){return this._positionCount}get vertexCountMax(){return this._positionCountMax}get modelMatrix(){return this._modelMatrix}get boundingVolume(){return this._dirtyBoundingVolume&&this._updateBoundingVolume(),this._boundingVolume}get positionDatatype(){return this._positionDatatype}get positionNormalized(){return this._positionNormalized}get heightReference(){return this._heightReference}static _copySubArray(t,n,i){for(let r=0;r<i;r++)n[r]=t[r]}static _copySubDataView(t,n,i){this._copySubArray(new Uint32Array(t.buffer,t.byteOffset,t.byteLength/4),new Uint32Array(n.buffer,n.byteOffset,n.byteLength/4),i/4)}toJSON(){let t=this._getPrimitiveClass(),n=new t,i=[];for(let r=0,o=this.primitiveCount;r<o;r++)i.push(this.get(r,n).toJSON());return i}};ut(SL,"Error",{ERR_RESIZE:"BufferPrimitive range cannot be resized after initialization.",ERR_CAPACITY:"BufferPrimitiveCollection capacity exceeded.",ERR_MULTIPLE_OF_FOUR:"BufferPrimitive byte length must be a multiple of 4.",ERR_OUT_OF_RANGE:"BufferPrimitive buffer access out of range."});var cH=SL;cH.DEFAULT_CAPACITY=1024;var ra=cH;var um=class um{constructor(){ut(this,"_collection",null);ut(this,"_index",-1);ut(this,"_byteOffset",-1)}static clone(t,n){let i=t._collection._getMaterialClass();return n.featureId=t.featureId,n.show=t.show,n.setMaterial(t.getMaterial(new i)),n}_isResizable(){return this._index===this._collection.primitiveCount-1}get featureId(){return this._getUint32(um.Layout.FEATURE_ID_U32)}set featureId(t){this._setUint32(um.Layout.FEATURE_ID_U32,t)}get show(){return this._getUint8(um.Layout.SHOW_U8)===1}set show(t){this._setUint8(um.Layout.SHOW_U8,t?1:0)}getMaterial(t){let n=this._collection,i=n._getMaterialClass();return i.unpack(n._materialView,this._index*i.packedLength,t)}setMaterial(t){let n=this._collection,i=n._getMaterialClass();return i.pack(t,n._materialView,this._index*i.packedLength),this._dirty=!0,t}get _dirty(){return this._getUint8(um.Layout.DIRTY_U8)===1}set _dirty(t){this._collection._primitiveView.setUint8(this._byteOffset+um.Layout.DIRTY_U8,t?1:0),t&&this._collection._makeDirty(this._index)}get _pickId(){return this._getUint32(um.Layout.PICK_ID_U32)}set _pickId(t){this._setUint32(um.Layout.PICK_ID_U32,t)}_getUint8(t){return this._collection._primitiveView.getUint8(this._byteOffset+t)}_setUint8(t,n){this._collection._primitiveView.setUint8(this._byteOffset+t,n),this._dirty=!0}_getUint32(t){return this._collection._primitiveView.getUint32(this._byteOffset+t,!0)}_setUint32(t,n){this._collection._primitiveView.setUint32(this._byteOffset+t,n,!0),this._dirty=!0}_getFloat32(t){return this._collection._primitiveView.getFloat32(this._byteOffset+t,!0)}_setFloat32(t,n){this._collection._primitiveView.setFloat32(this._byteOffset+t,n,!0),this._dirty=!0}toJSON(){let n=this._collection._getMaterialClass();return{featureId:this.featureId,show:this.show,dirty:this._dirty,material:this.getMaterial(new n).toJSON()}}};ut(um,"Layout",{FEATURE_ID_U32:0,SHOW_U8:4,DIRTY_U8:5,PICK_ID_U32:8,__BYTE_LENGTH:12});var sJ=um,as=sJ;var{ERR_CAPACITY:bNn,ERR_RESIZE:xNn,ERR_OUT_OF_RANGE:TNn}=ra.Error,Gd=class Gd extends as{constructor(){super(...arguments);ut(this,"_collection",null)}static clone(n,i){return super.clone(n,i),i.setPositions(n.getPositions()),i.setHoles(n.getHoles()),i.setTriangles(n.getTriangles()),i}get vertexOffset(){return this._getUint32(Gd.Layout.POSITION_OFFSET_U32)}get vertexCount(){return this._getUint32(Gd.Layout.POSITION_COUNT_U32)}getPositions(n){return this._getPositionsRange(0,this.vertexCount,n)}setPositions(n){let i=this._collection,r=this.vertexOffset,o=this.vertexCount,s=n.length/3,a=i.vertexCount+s-o;i._positionCount=a,this._setUint32(Gd.Layout.POSITION_COUNT_U32,s);let c=i._positionView;for(let u=0;u<s;u++)c[(r+u)*3]=n[u*3],c[(r+u)*3+1]=n[u*3+1],c[(r+u)*3+2]=n[u*3+2];this._dirty=!0,i._makeDirtyBoundingVolume()}get outerVertexOffset(){return this.vertexOffset}get outerVertexCount(){return this.holeCount>0?this.getHoles()[0]:this.vertexCount}getOuterPositions(n){return this._getPositionsRange(0,this.outerVertexCount,n)}get holeOffset(){return this._getUint32(Gd.Layout.HOLE_OFFSET_U32)}get holeCount(){return this._getUint32(Gd.Layout.HOLE_COUNT_U32)}getHoles(n){let{holeOffset:i,holeCount:r}=this,o=this._collection._holeIndexView;if(!l(n)){let s=o.byteOffset+i*o.BYTES_PER_ELEMENT,a=o.constructor;return new a(o.buffer,s,r)}for(let s=0;s<r;s++)n[s]=o[i+s];return n}setHoles(n){let i=this._collection,r=this.holeOffset,o=this.holeCount,s=n.length,a=i.holeCount+s-o;i._holeCount=a,this._setUint32(Gd.Layout.HOLE_COUNT_U32,s);let c=i._holeIndexView;for(let u=0;u<s;u++)c[r+u]=n[u];this._dirty=!0}getHoleVertexCount(n){let i=this.getHoles(),r=i[n];return n===i.length-1?this.vertexCount-r:i[n+1]-r}getHolePositions(n,i){let o=this.getHoles()[n],s=this.getHoleVertexCount(n);return this._getPositionsRange(o,s,i)}_getPositionsRange(n,i,r){let o=this._collection,s=this._collection._positionView,a=this.vertexOffset+n;if(!l(r)){let c=s.byteOffset+a*3*s.BYTES_PER_ELEMENT,u=s.constructor;return new u(s.buffer,c,i*3)}for(let c=0;c<i;c++)r[c*3]=s[(a+c)*3],r[c*3+1]=s[(a+c)*3+1],r[c*3+2]=s[(a+c)*3+2];return r}get triangleOffset(){return this._getUint32(Gd.Layout.TRIANGLE_OFFSET_U32)}get triangleCount(){return this._getUint32(Gd.Layout.TRIANGLE_COUNT_U32)}getTriangles(n){let{triangleOffset:i,triangleCount:r}=this,o=this._collection._triangleIndexView;if(!l(n)){let s=o.byteOffset+i*3*o.BYTES_PER_ELEMENT,a=o.constructor;return new a(o.buffer,s,r*3)}for(let s=0;s<r;s++)n[s*3]=o[(i+s)*3],n[s*3+1]=o[(i+s)*3+1],n[s*3+2]=o[(i+s)*3+2];return n}setTriangles(n){let i=this._collection,r=this.triangleOffset,o=this.triangleCount,s=n.length/3,a=i.triangleCount+s-o;i._triangleCount+=s-o,this._setUint32(Gd.Layout.TRIANGLE_COUNT_U32,s);let c=i._triangleIndexView;for(let u=0;u<s;u++)c[(r+u)*3]=n[u*3],c[(r+u)*3+1]=n[u*3+1],c[(r+u)*3+2]=n[u*3+2];this._dirty=!0}toJSON(){return{...super.toJSON(),positions:Array.from(this.getPositions()),holes:Array.from(this.getHoles()),triangles:Array.from(this.getTriangles())}}};ut(Gd,"Layout",{...as.Layout,POSITION_OFFSET_U32:as.Layout.__BYTE_LENGTH,POSITION_COUNT_U32:as.Layout.__BYTE_LENGTH+4,HOLE_OFFSET_U32:as.Layout.__BYTE_LENGTH+8,HOLE_COUNT_U32:as.Layout.__BYTE_LENGTH+12,TRIANGLE_OFFSET_U32:as.Layout.__BYTE_LENGTH+16,TRIANGLE_COUNT_U32:as.Layout.__BYTE_LENGTH+20,__BYTE_LENGTH:as.Layout.__BYTE_LENGTH+24});var aJ=Gd,Mo=aJ;var wL=class{constructor(t=H.EMPTY_OBJECT){this.color=z.clone(t.color??z.WHITE),this.outlineColor=z.clone(t.outlineColor??z.WHITE),this.outlineWidth=t.outlineWidth??0}static get packedLength(){return this.Layout.__BYTE_LENGTH}static pack(t,n,i){n.setUint32(this.Layout.COLOR_U32+i,t.color.toRgba(),!0),n.setUint32(this.Layout.OUTLINE_COLOR_U32+i,t.outlineColor.toRgba(),!0),n.setUint8(this.Layout.OUTLINE_WIDTH_U8+i,t.outlineWidth)}static unpack(t,n,i){return z.fromRgba(t.getUint32(this.Layout.COLOR_U32+n,!0),i.color),z.fromRgba(t.getUint32(this.Layout.OUTLINE_COLOR_U32+n,!0),i.outlineColor),i.outlineWidth=t.getUint8(this.Layout.OUTLINE_WIDTH_U8+n),i}toJSON(){return{color:this.color.toCssHexString(),outlineColor:this.outlineColor.toCssHexString(),outlineWidth:this.outlineWidth}}};ut(wL,"Layout",{COLOR_U32:0,OUTLINE_COLOR_U32:4,OUTLINE_WIDTH_U8:8,__BYTE_LENGTH:12}),ut(wL,"DEFAULT_MATERIAL");var nu=wL;var lH=class lH extends nu{constructor(t=H.EMPTY_OBJECT){super(t)}};ut(lH,"DEFAULT_MATERIAL",Object.freeze(new lH));var cJ=lH,Lf=cJ;var lJ={positionHigh:0,positionLow:1,pickColor:2,showColorAlpha:3},h_e={position:0,pickColor:1,showColorAlpha:2},ya=new Mo,uJ=new Lf,IL=new z,m_e=new h,fJ=new Sn;function PZe(e,t,n){let i=t.context;n=n||{destroy:RZe};let r=e._positionDatatype===Y.DOUBLE,o=r?lJ:h_e;if(!l(n.attributeArrays)||!l(n.indexArray)){let{vertexCountMax:c,triangleCountMax:u}=e;n.indexArray=je.createTypedArray(c,u*3),n.attributeArrays={...r?{positionHigh:new Float32Array(c*3),positionLow:new Float32Array(c*3)}:{position:e._positionView},pickColor:new Uint8Array(c*4),showColorAlpha:new Float32Array(c*3)}}if(e._dirtyCount>0){let{attributeArrays:c}=n,{_dirtyOffset:u,_dirtyCount:f}=e,d=c.positionHigh,p=c.positionLow,g=n.indexArray,m=c.pickColor,y=c.showColorAlpha;for(let A=u,b=u+f;A<b;A++){if(e.get(A,ya),!ya._dirty)continue;let x=ya.triangleOffset,T=ya.vertexOffset,E=ya.getTriangles();for(let R=0,O=ya.triangleCount;R<O;R++)g[x*3]=T+E[R*3],g[x*3+1]=T+E[R*3+1],g[x*3+2]=T+E[R*3+2],x++;let v=ya.show,S=r?ya.getPositions():null;ya.getMaterial(uJ);let I=cn.encodeRGB8(uJ.color);z.fromRgba(ya._pickId,IL);for(let R=0,O=ya.vertexCount;R<O;R++)r&&(h.fromArray(S,R*3,m_e),Sn.fromCartesian(m_e,fJ),h.pack(fJ.high,d,T*3),h.pack(fJ.low,p,T*3)),m[T*4]=z.floatToByte(IL.red),m[T*4+1]=z.floatToByte(IL.green),m[T*4+2]=z.floatToByte(IL.blue),m[T*4+3]=z.floatToByte(IL.alpha),y[T*3]=v?1:0,y[T*3+1]=I,y[T*3+2]=uJ.color.alpha,T++;ya._dirty=!1}}if(l(n.vertexArray)){if(e._dirtyCount>0){let{indexOffset:c,indexCount:u,vertexOffset:f,vertexCount:d}=DZe(e);n.vertexArray.copyIndexFromRange(n.indexArray,c,u);for(let p in o)if(Object.hasOwn(o,p)){let g=p;n.vertexArray.copyAttributeFromRange(o[g],n.attributeArrays[g],f,d)}}}else{let{attributeArrays:c}=n;n.vertexArray=new zn({context:i,indexBuffer:tt.createIndexBuffer({context:i,typedArray:n.indexArray,usage:Me.STATIC_DRAW,indexDatatype:je.fromTypedArray(n.indexArray)}),attributes:[...r?[{index:lJ.positionHigh,componentDatatype:Y.FLOAT,componentsPerAttribute:3,vertexBuffer:tt.createVertexBuffer({typedArray:c.positionHigh,context:i,usage:Me.STATIC_DRAW})},{index:lJ.positionLow,componentDatatype:Y.FLOAT,componentsPerAttribute:3,vertexBuffer:tt.createVertexBuffer({typedArray:c.positionLow,context:i,usage:Me.STATIC_DRAW})}]:[{index:h_e.position,componentDatatype:e._positionDatatype,componentsPerAttribute:3,normalize:e._positionNormalized,vertexBuffer:tt.createVertexBuffer({typedArray:c.position,context:i,usage:Me.STATIC_DRAW})}],{index:o.pickColor,componentDatatype:Y.UNSIGNED_BYTE,componentsPerAttribute:4,vertexBuffer:tt.createVertexBuffer({typedArray:c.pickColor,context:i,usage:Me.STATIC_DRAW})},{index:o.showColorAlpha,componentDatatype:Y.FLOAT,componentsPerAttribute:3,vertexBuffer:tt.createVertexBuffer({typedArray:c.showColorAlpha,context:i,usage:Me.STATIC_DRAW})}]})}l(n.renderState)||(n.renderState=Ge.fromCache({blending:e._blendOption===Fi.OPAQUE?tn.DISABLED:tn.ALPHA_BLEND,depthTest:{enabled:!0}})),l(n.shaderProgram)||(n.shaderProgram=Qt.fromCache({context:i,vertexShaderSource:new Ye({sources:[HO],defines:r?["USE_FLOAT64"]:[]}),fragmentShaderSource:new Ye({sources:[jO]}),attributeLocations:o}));let s=e.triangleCount*3;l(n.command)||(n.command=new at({vertexArray:n.vertexArray,renderState:n.renderState,shaderProgram:n.shaderProgram,primitiveType:Oe.TRIANGLES,pass:e._blendOption===Fi.OPAQUE?Ie.OPAQUE:Ie.TRANSLUCENT,pickId:e._allowPicking?"v_pickColor":void 0,owner:e,count:s,modelMatrix:e.modelMatrix,boundingVolume:e.boundingVolume,debugShowBoundingVolume:e.debugShowBoundingVolume}));let a=n.command;return a.count!==s&&(a.count=s),a.debugShowBoundingVolume!==e.debugShowBoundingVolume&&(a.debugShowBoundingVolume=e.debugShowBoundingVolume),t.commandList.push(a),e._makeClean(),n}function DZe(e){let{_dirtyOffset:t,_dirtyCount:n}=e;e.get(t,ya);let i=ya.vertexOffset,r=ya.triangleOffset*3;e.get(t+n-1,ya);let o=ya.vertexOffset+ya.vertexCount-i,s=(ya.triangleOffset+ya.triangleCount)*3-r;return{indexOffset:r,indexCount:s,vertexOffset:i,vertexCount:o}}function RZe(){let e=this;l(e.vertexArray)&&e.vertexArray.destroy(),l(e.shaderProgram)&&e.shaderProgram.destroy(),l(e.renderState)&&Ge.removeFromCache(e.renderState)}var PL=PZe;var{ERR_CAPACITY:lLn}=ra.Error,dJ=class e extends ra{constructor(t=H.EMPTY_OBJECT){super(t),this._holeCount=0,this._holeCountMax=t.holeCountMax??ra.DEFAULT_CAPACITY,this._holeIndexView=null,this._triangleCount=0,this._triangleCountMax=t.triangleCountMax??ra.DEFAULT_CAPACITY,this._triangleIndexView=null,this._allocateHoleIndexBuffer(),this._allocateTriangleIndexBuffer()}_getCollectionClass(){return e}_getPrimitiveClass(){return Mo}_getMaterialClass(){return Lf}_allocateHoleIndexBuffer(){this._holeIndexView=je.createTypedArray(this._positionCountMax,this._holeCountMax)}_allocateTriangleIndexBuffer(){this._triangleIndexView=je.createTypedArray(this._positionCountMax,this._triangleCountMax*3)}static clone(t,n,i){return super.clone(t,n,i),l(i)||(this._copySubArray(t._holeIndexView,n._holeIndexView,t.holeCount),this._copySubArray(t._triangleIndexView,n._triangleIndexView,t._triangleCount*3),n._holeCount=t._holeCount,n._triangleCount=t._triangleCount),n}static fromCollection(t,n,i){return super.fromCollection(t,n,i)}_cloneEmpty(t=H.EMPTY_OBJECT){return new e({holeCountMax:this.holeCountMax,triangleCountMax:this.triangleCountMax,...this._cloneEmptyBaseArgs(t)})}static _replaceBuffers(t,n){super._replaceBuffers(t,n),n._holeIndexView=t._holeIndexView,n._triangleIndexView=t._triangleIndexView}add(t,n=new Mo){super.add(t,n);let i=this._positionCount;n._setUint32(Mo.Layout.POSITION_OFFSET_U32,i),n._setUint32(Mo.Layout.POSITION_COUNT_U32,0);let r=this._holeCount;n._setUint32(Mo.Layout.HOLE_OFFSET_U32,r),n._setUint32(Mo.Layout.HOLE_COUNT_U32,0);let o=this._triangleCount;return n._setUint32(Mo.Layout.TRIANGLE_OFFSET_U32,o),n._setUint32(Mo.Layout.TRIANGLE_COUNT_U32,0),l(t.positions)&&n.setPositions(t.positions),l(t.holes)&&n.setHoles(t.holes),l(t.triangles)&&n.setTriangles(t.triangles),n}update(t){super.update(t),this._isRendered(t)&&(this._renderContext=PL(this,t,this._renderContext))}get byteLength(){return super.byteLength+this._holeIndexView.byteLength+this._triangleIndexView.byteLength}get holeCount(){return this._holeCount}get holeCountMax(){return this._holeCountMax}get triangleCount(){return this._triangleCount}get triangleCountMax(){return this._triangleCountMax}},za=dJ;var{ERR_RESIZE:mLn,ERR_CAPACITY:pLn}=ra.Error,xS=class xS extends as{constructor(){super(...arguments);ut(this,"_collection",null)}static clone(n,i){return super.clone(n,i),i.setPositions(n.getPositions()),i}get vertexOffset(){return this._getUint32(xS.Layout.POSITION_OFFSET_U32)}get vertexCount(){return this._getUint32(xS.Layout.POSITION_COUNT_U32)}getPositions(n){let{vertexOffset:i,vertexCount:r}=this,o=this._collection._positionView;if(!l(n)){let s=o.byteOffset+i*3*o.BYTES_PER_ELEMENT,a=o.constructor;return new a(o.buffer,s,r*3)}for(let s=0;s<r;s++)n[s*3]=o[(i+s)*3],n[s*3+1]=o[(i+s)*3+1],n[s*3+2]=o[(i+s)*3+2];return n}setPositions(n){let i=this._collection,r=this.vertexOffset,o=this.vertexCount,s=n.length/3,a=i._positionCount+s-o;i._positionCount=a,this._setUint32(xS.Layout.POSITION_COUNT_U32,s);let c=i._positionView;for(let u=0;u<s;u++)c[(r+u)*3]=n[u*3],c[(r+u)*3+1]=n[u*3+1],c[(r+u)*3+2]=n[u*3+2];this._dirty=!0,i._makeDirtyBoundingVolume()}toJSON(){return{...super.toJSON(),positions:Array.from(this.getPositions())}}};ut(xS,"Layout",{...as.Layout,POSITION_OFFSET_U32:as.Layout.__BYTE_LENGTH,POSITION_COUNT_U32:as.Layout.__BYTE_LENGTH+4,__BYTE_LENGTH:as.Layout.__BYTE_LENGTH+8});var hJ=xS,Aa=hJ;var DL=class DL extends nu{constructor(t=H.EMPTY_OBJECT){super(t),this.width=t.width??1}static pack(t,n,i){super.pack(t,n,i),n.setFloat32(this.Layout.WIDTH_F32+i,t.width,!0)}static unpack(t,n,i){return super.unpack(t,n,i),i.width=t.getFloat32(this.Layout.WIDTH_F32+n,!0),i}toJSON(){return{...super.toJSON(),width:this.width}}};ut(DL,"Layout",{...nu.Layout,WIDTH_F32:nu.Layout.__BYTE_LENGTH,__BYTE_LENGTH:nu.Layout.__BYTE_LENGTH+4}),ut(DL,"DEFAULT_MATERIAL",Object.freeze(new DL));var mJ=DL,Ff=mJ;var p_e=16,OZe=.35,g_e=new Aa,MZe=new Ff,__e=new Mo,NZe=new Lf,LZe=new h,FZe=new h,BZe=new he,kZe=new U,UZe=new U,RL=new z,gJ=class{static packPolylineCollectionData(t,n,i){if(l(i)&&t._dirtyCount===0&&t._version===i.version)return i;let r=t.primitiveCount,o=t.boundingVolume,s=ie.fromBoundingSphere(o,n),a=C_e(t,n),c=new Float32Array(r),u=new Uint8Array(r*4),f=new Uint8Array(r*4),d=t.widthUnits==="meters";for(let p=0;p<r;p++){let g=t.get(p,g_e),m=g.getMaterial(MZe);c[p]=d?-m.width:m.width,u[p*4]=z.floatToByte(m.color.red),u[p*4+1]=z.floatToByte(m.color.green),u[p*4+2]=z.floatToByte(m.color.blue),u[p*4+3]=z.floatToByte(m.color.alpha),y_e(f,p,g._pickId)}return Object.assign(i??{},{version:t._version,rectangle:s,positions:a,widths:c,widthInMeters:d,colors:u,pickColors:f})}static packPolylineSegments(t,n,i,r){r.polylineSegments??(r.polylineSegments=[]),r.widths??(r.widths=[]),r.colors??(r.colors=[]),r.pickColors??(r.pickColors=[]),r.polylineSegmentPrimitiveIndices??(r.polylineSegmentPrimitiveIndices=[]),r.primitiveCount??(r.primitiveCount=0),r.rectangle??(r.rectangle=ie.clone(i));let o=i.width,s=t.primitiveCount,a=n.positions;for(let c=0;c<s;c++){let u=t.get(c,g_e);if(!u.show)continue;let f=u.vertexCount,d=u.vertexOffset,p=Math.max(D.EPSILON3,A_e(n.widths[c],r));for(let g=0;g+1<f;g++){let m=U.fromArray(a,(d+g)*2,kZe),y=U.fromArray(a,(d+g+1)*2,UZe);zZe(m,y,i,o),VZe(m,y,p)&&(r.polylineSegments.push([m.x,m.y,y.x,y.y]),r.polylineSegmentPrimitiveIndices.push(r.primitiveCount+c))}}r.widths.push(n.widths),r.colors.push(n.colors),r.pickColors.push(n.pickColors),s>0&&(r.hasPixelWidths||(r.hasPixelWidths=!n.widthInMeters),r.hasMeterWidths||(r.hasMeterWidths=n.widthInMeters)),r.primitiveCount+=s}static packPolylineGrid(t){let n=t.polylineSegments,i=t.polylineSegmentPrimitiveIndices,r=Math.max(1,Math.ceil(Math.sqrt(n.length/p_e))),o=new Array(r*r);for(let A=0;A<o.length;A++)o[A]=[];let s=0,a=OZe/r,c=uH(t.widths);for(let A=0;A<n.length;A++){let b=n[A],x=Math.max(a,A_e(c[i[A]],t)),T=Math.max(0,Math.min(b[0],b[2])-x),E=Math.min(1,Math.max(b[0],b[2])+x),v=Math.max(0,Math.min(b[1],b[3])-x),S=Math.min(1,Math.max(b[1],b[3])+x),I=yA(Math.floor(T*r),r),R=yA(Math.floor(E*r),r),O=yA(Math.floor(v*r),r),L=yA(Math.floor(S*r),r);for(let _=O;_<=L;_++)for(let C=I;C<=R;C++)o[_*r+C].push(A),s++}let[u,f]=fH(s),d=u*f,p=new Float32Array(d*4).fill(-1),g=new Float32Array(d).fill(-1),m=new Uint32Array(o.length+2);m[0]=r,m[1]=r;let y=0;for(let A=0;A<o.length;A++){let b=o[A];for(let x=0;x<b.length;x++){let T=b[x],E=n[T];p[y*4]=E[0],p[y*4+1]=E[1],p[y*4+2]=E[2],p[y*4+3]=E[3];let v=i[T];g[y]=v,y++}m[A+2]=y}t.polylineSegmentTexels=p,t.polylineSegmentTextureWidth=u,t.polylineSegmentTextureHeight=f,t.polylineSegmentPrimitiveIndicesTexels=g,t.polylineGridCellIndices=m}static packPolygonCollectionData(t,n,i){if(l(i)&&t._dirtyCount===0&&t._version===i.version)return i;let r=t.primitiveCount,o=t.boundingVolume,s=ie.fromBoundingSphere(o,n),a=C_e(t,n),c=new Float32Array(r),u=new Uint8Array(r*4),f=new Uint8Array(r*4);for(let d=0;d<r;d++){let p=t.get(d,__e),g=p.getMaterial(NZe);u[d*4]=z.floatToByte(g.color.red),u[d*4+1]=z.floatToByte(g.color.green),u[d*4+2]=z.floatToByte(g.color.blue),u[d*4+3]=z.floatToByte(g.color.alpha),y_e(f,d,p._pickId)}return Object.assign(i??{},{version:t._version,rectangle:s,positions:a,widths:c,colors:u,pickColors:f})}static packPolygonRings(t,n,i,r){r.polygonRings??(r.polygonRings=[]),r.polygonRingPrimitiveIndices??(r.polygonRingPrimitiveIndices=[]),r.widths??(r.widths=[]),r.colors??(r.colors=[]),r.pickColors??(r.pickColors=[]),r.primitiveCount??(r.primitiveCount=0),r.rectangle??(r.rectangle=ie.clone(i));let o=i.width,s=t.primitiveCount,a=n.positions;for(let c=0;c<s;c++){let u=t.get(c,__e);if(!u.show)continue;let f=u.vertexOffset,d=u.vertexCount,p=u.getHoles();for(let g=0;g<=p.length;g++){let m=g===0?0:p[g-1],A=(g===p.length?d:p[g])-m;if(A<3)continue;let b=jZe(a,f+m,A,i,o),x=T_e(b,A,-D.EPSILON3,1+D.EPSILON3,-D.EPSILON3,1+D.EPSILON3,x_e);x.vertexCount<3||(r.polygonRings.push(x.positions.slice(0,x.vertexCount*2)),r.polygonRingPrimitiveIndices.push(r.primitiveCount+c))}}r.widths.push(n.widths),r.colors.push(n.colors),r.pickColors.push(n.pickColors),r.primitiveCount+=s}static packPolygonGrid(t){let n=t.polygonRings,i=t.polygonRingPrimitiveIndices,r=0;for(let y=0;y<n.length;y++)r+=n[y].length/2;let o=Math.max(1,Math.ceil(Math.sqrt(r/p_e))),s=new Array(o*o);for(let y=0;y<s.length;y++)s[y]=[];let a=0;for(let y=0;y<n.length;y++){let A=n[y],b=i[y],x=A.length/2,T=1/0,E=1/0,v=-1/0,S=-1/0;for(let _=0;_<x;_++)T=Math.min(T,A[_*2]),v=Math.max(v,A[_*2]),E=Math.min(E,A[_*2+1]),S=Math.max(S,A[_*2+1]);let I=yA(Math.floor(T*o),o),R=yA(Math.floor(v*o),o),O=yA(Math.floor(E*o),o),L=yA(Math.floor(S*o),o);for(let _=O;_<=L;_++)for(let C=I;C<=R;C++){let w=T_e(A,x,C/o-D.EPSILON5,(C+1)/o+D.EPSILON5,_/o-D.EPSILON5,(_+1)/o+D.EPSILON5,x_e),P=w.vertexCount;if(P<3)continue;let M=w.positions,F=s[_*o+C];for(let V=0;V<P;V++){let B=(V+1)%P,j=M[V*2],k=M[V*2+1],G=M[B*2],q=M[B*2+1];k!==q&&(F.push(j,k,G,q,b),a++)}}}let[c,u]=fH(a),f=c*u,d=new Float32Array(f*4).fill(-1),p=new Float32Array(f).fill(-1),g=new Uint32Array(s.length+2);g[0]=o,g[1]=o;let m=0;for(let y=0;y<s.length;y++){let A=s[y];for(let b=0;b<A.length;b+=5)d[m*4]=A[b],d[m*4+1]=A[b+1],d[m*4+2]=A[b+2],d[m*4+3]=A[b+3],p[m]=A[b+4],m++;g[y+2]=m}t.polygonEdgeTexels=d,t.polygonEdgeTextureWidth=c,t.polygonEdgeTextureHeight=u,t.polygonEdgePrimitiveIndicesTexels=p,t.polygonGridCellIndices=g}static packPrimitiveTextures(t,n){let[i,r]=fH(n.primitiveCount),o=new Float32Array(i*r);o.set(uH(n.widths)),n.widthTexture=new Dt({context:t,pixelFormat:Ke.RED,pixelDatatype:ze.FLOAT,source:{width:i,height:r,arrayBufferView:o},sampler:jt.NEAREST,flipY:!1});let s=new Uint8Array(i*r*4);s.set(uH(n.colors)),n.colorTexture=new Dt({context:t,pixelFormat:Ke.RGBA,pixelDatatype:ze.UNSIGNED_BYTE,source:{width:i,height:r,arrayBufferView:s},sampler:jt.NEAREST,flipY:!1});let a=new Uint8Array(i*r*4);a.set(uH(n.pickColors)),n.pickColorTexture=new Dt({context:t,pixelFormat:Ke.RGBA,pixelDatatype:ze.UNSIGNED_BYTE,source:{width:i,height:r,arrayBufferView:a},sampler:jt.NEAREST,flipY:!1})}static packPolylineTextures(t,n){n.polylineSegmentTexture=new Dt({context:t,pixelFormat:Ke.RGBA,pixelDatatype:ze.FLOAT,source:{width:n.polylineSegmentTextureWidth,height:n.polylineSegmentTextureHeight,arrayBufferView:n.polylineSegmentTexels},sampler:jt.NEAREST,flipY:!1}),n.polylineSegmentPrimitiveIndicesTexture=new Dt({context:t,pixelFormat:Ke.RED,pixelDatatype:ze.FLOAT,source:{width:n.polylineSegmentTextureWidth,height:n.polylineSegmentTextureHeight,arrayBufferView:n.polylineSegmentPrimitiveIndicesTexels},sampler:jt.NEAREST,flipY:!1}),n.polylineGridCellIndicesTexture=E_e(t,n.polylineGridCellIndices)}static packPolygonTextures(t,n){n.polygonEdgeTexture=new Dt({context:t,pixelFormat:Ke.RGBA,pixelDatatype:ze.FLOAT,source:{width:n.polygonEdgeTextureWidth,height:n.polygonEdgeTextureHeight,arrayBufferView:n.polygonEdgeTexels},sampler:jt.NEAREST,flipY:!1}),n.polygonEdgePrimitiveIndicesTexture=new Dt({context:t,pixelFormat:Ke.RED,pixelDatatype:ze.FLOAT,source:{width:n.polygonEdgeTextureWidth,height:n.polygonEdgeTextureHeight,arrayBufferView:n.polygonEdgePrimitiveIndicesTexels},sampler:jt.NEAREST,flipY:!1}),n.polygonGridCellIndicesTexture=E_e(t,n.polygonGridCellIndices)}static freeResources(t){t.polylineSegmentTexture?.destroy(),t.widthTexture?.destroy(),t.colorTexture?.destroy(),t.pickColorTexture?.destroy(),t.polylineSegmentPrimitiveIndicesTexture?.destroy(),t.polylineGridCellIndicesTexture?.destroy(),t.polygonEdgeTexture?.destroy(),t.polygonEdgePrimitiveIndicesTexture?.destroy(),t.polygonGridCellIndicesTexture?.destroy()}};function y_e(e,t,n){z.fromRgba(n,RL),e[t*4]=z.floatToByte(RL.red),e[t*4+1]=z.floatToByte(RL.green),e[t*4+2]=z.floatToByte(RL.blue),e[t*4+3]=z.floatToByte(RL.alpha)}function A_e(e,t){if(e>=0)return(e+1)*.5/t.minimumTileScreenPixels;let n=t.metersPerUv;return-e*.5/Math.min(n.x,n.y)}function zZe(e,t,n,i){let r=e.x,o=t.x;o=r+D.negativePiToPi(o-r);let s=n.west+i*.5,a=s+D.negativePiToPi(r-s)-r;r+=a,o+=a;let c=n.north-n.south;e.x=(r-n.west)/i,e.y=(e.y-n.south)/c,t.x=(o-n.west)/i,t.y=(t.y-n.south)/c}function VZe(e,t,n){let i=-n,r=1+n,o=0,s=1,a=e.x,c=e.y,u=t.x,f=t.y,d=u-a,p=f-c,g=[-d,d,-p,p],m=[a-i,r-a,c-i,r-c];for(let y=0;y<4;y++){if(Math.abs(g[y])<1e-12){if(m[y]<0)return!1;continue}let A=m[y]/g[y];if(g[y]<0?o=Math.max(o,A):s=Math.min(s,A),o>s)return!1}return e.x=a+o*d,e.y=c+o*p,t.x=a+s*d,t.y=c+s*p,!0}function yA(e,t){return Math.max(0,Math.min(t-1,e))}var pJ=new Float64Array(512),b_e=new Float64Array(512),x_e={positions:new Float64Array(512),vertexCount:0};function jZe(e,t,n,i,r){pJ.length<n*2&&(pJ=new Float64Array(n*4));let o=pJ,s=i.north-i.south,a=e[t*2];o[0]=a,o[1]=e[t*2+1];for(let d=1;d<n;d++){let p=a+D.negativePiToPi(e[(t+d)*2]-a);o[d*2]=p,o[d*2+1]=e[(t+d)*2+1],a=p}let c=i.west+r*.5,u=o[0],f=c+D.negativePiToPi(u-c)-u;for(let d=0;d<n;d++)o[d*2]=(o[d*2]+f-i.west)/r,o[d*2+1]=(o[d*2+1]-i.south)/s;return o}function T_e(e,t,n,i,r,o,s){let a=e,c=t;for(let u=0;u<4;u++){let f=u>>1,d=(u&1)===0?1:-1,p=u===0?n:u===1?i:u===2?r:o,g=c*4+4,m=(u&1)===0,y=m?b_e:s.positions;y.length<g&&(y=new Float64Array(g*2),m?b_e=y:s.positions=y);let A=0,b=a[(c-1)*2],x=a[(c-1)*2+1],T=d*((f===0?b:x)-p)>=0;for(let E=0;E<c;E++){let v=a[E*2],S=a[E*2+1],I=d*((f===0?v:S)-p)>=0;if(I!==T){let R=f===0?(p-b)/(v-b):(p-x)/(S-x);y[A*2]=f===0?p:b+R*(v-b),y[A*2+1]=f===0?x+R*(S-x):p,A++}I&&(y[A*2]=v,y[A*2+1]=S,A++),b=v,x=S,T=I}if(A===0)return s.vertexCount=0,s;a=y,c=A}return s.vertexCount=c,s}function fH(e){let t=D.nextPowerOfTwo(Math.max(1,Math.ceil(Math.sqrt(e)))),n=D.nextPowerOfTwo(Math.max(1,Math.ceil(e/t)));return[t,n]}function E_e(e,t){let[n,i]=fH(t.length),r=new Float32Array(n*i);return r.set(t),new Dt({context:e,pixelFormat:Ke.RED,pixelDatatype:ze.FLOAT,source:{width:n,height:i,arrayBufferView:r},sampler:jt.NEAREST,flipY:!1})}function C_e(e,t,n){l(n)||(n=new Float64Array(e._positionCountMax*2));let i=e._positionView,r=e.modelMatrix;for(let o=0;o<e._positionCount;o++){let s=h.fromArray(i,o*3,LZe),a=N.multiplyByPoint(r,s,FZe),c=t.cartesianToCartographic(a,BZe);n[o*2]=c.longitude,n[o*2+1]=c.latitude}return n}function uH(e){let t=0;for(let o of e)t+=o.byteLength;let n=e[0].constructor,i=new n(t/n.BYTES_PER_ELEMENT),r=0;for(let o of e)i.set(o,r),r+=o.length;return i}var Es=gJ;var AJ=new Mo,_J="ClippingPolygonCollection.quality is deprecated as of CesiumJS 1.145 and will be removed in 1.147. Signed distance field clipping was replaced with vector clipping, so this property no longer has any effect.",yJ="ClippingPolygonCollection.debugShowDistanceTexture is deprecated as of CesiumJS 1.145 and will be removed in 1.147. Signed distance field clipping was replaced with vector clipping, so this property no longer has any effect.",HZe="ClippingPolygonCollection.isDestroyed is deprecated as of CesiumJS 1.145 and will be removed in 1.147. The collection no longer holds any GPU resources of its own, so it does not need to be destroyed.",GZe="ClippingPolygonCollection.destroy is deprecated as of CesiumJS 1.145 and will be removed in 1.147. The collection no longer holds any GPU resources of its own, so it does not need to be destroyed.";function cl(e){e=e??H.EMPTY_OBJECT,this._polygons=[];let t=e.polygons??[],n=0,i=0;for(let r=0;r<t.length;++r)n+=t[r].length,i+=t[r].holes.length;this._dirty=!1,this._bufferPolygonCollection=new za({show:!1,allowPicking:!1,primitiveCountMax:2*t.length,vertexCountMax:2*n,holeCountMax:i>0?2*i:0,triangleCountMax:0});for(let r=0;r<t.length;++r){let o=this._bufferPolygonCollection.primitiveCount;this._bufferPolygonCollection.add(S_e(t[r]),AJ),this._polygons.push({clippingPolygon:t[r],bufferIndex:o})}l(e.debugShowDistanceTexture)&&qr("ClippingPolygonCollection.debugShowDistanceTexture",yJ),this._debugShowDistanceTexture=e.debugShowDistanceTexture??!1,this.enabled=e.enabled??!0,this.inverse=e.inverse??!1,l(e.quality)&&qr("ClippingPolygonCollection.quality",_J),this._quality=e.quality??1,this.polygonAdded=new be,this.polygonRemoved=new be,this.ellipsoid=e.ellipsoid??ee.default,this._owner=void 0,this._vectorCollectionData=Es.packPolygonCollectionData(this._bufferPolygonCollection,this.ellipsoid)}Object.defineProperties(cl.prototype,{length:{get:function(){return this._polygons.length}},debugShowDistanceTexture:{get:function(){return qr("ClippingPolygonCollection.debugShowDistanceTexture",yJ),this._debugShowDistanceTexture},set:function(e){qr("ClippingPolygonCollection.debugShowDistanceTexture",yJ),this._debugShowDistanceTexture=e}},quality:{get:function(){return qr("ClippingPolygonCollection.quality",_J),this._quality},set:function(e){qr("ClippingPolygonCollection.quality",_J),this._quality=e}},owner:{get:function(){return this._owner}},clippingPolygonsState:{get:function(){return!this.enabled||this.length===0?0:this.inverse?-1:1}}});function S_e(e){let t=e.positions,n=e.holes,i=new Float64Array(e.length*3),r=0;for(let s=0;s<t.length;s++)h.pack(t[s],i,r*3),r++;if(n.length===0)return{positions:i,holes:void 0};let o=new Uint32Array(n.length);for(let s=0;s<n.length;s++){let a=n[s];o[s]=r;for(let c=0;c<a.length;c++)h.pack(a[c],i,r*3),r++}return{positions:i,holes:o}}function WZe(e,t,n){let i=e._bufferPolygonCollection,r=i.primitiveCount+1,o=i.vertexCount+t,s=i.holeCount+n;if(r<=i.primitiveCountMax&&o<=i.vertexCountMax&&s<=i.holeCountMax)return i;let a=e._polygons.length!==i.primitiveCount,c=za.fromCollection(i,{primitiveCountMax:D.nextPowerOfTwo(r),vertexCountMax:D.nextPowerOfTwo(o),holeCountMax:D.nextPowerOfTwo(s)},a?u=>u.show:void 0);if(i.destroy(),e._bufferPolygonCollection=c,a){let u=e._polygons;for(let f=0;f<u.length;++f)u[f].bufferIndex=f}return c}function w_e(e,t){e._bufferPolygonCollection.get(t.bufferIndex,AJ).show=!1,t.bufferIndex=-1}cl.prototype.add=function(e){let t=this._polygons.length,n=WZe(this,e.length,e.holes.length);return this._polygons.push({clippingPolygon:e,bufferIndex:n.primitiveCount}),n.add(S_e(e),AJ),this._dirty=!0,this.polygonAdded.raiseEvent(e,t),e};cl.prototype.get=function(e){return this._polygons[e]?.clippingPolygon};cl.prototype.contains=function(e){return this._polygons.some(t=>bS.equals(t.clippingPolygon,e))};cl.prototype.remove=function(e){let t=this._polygons,n=t.findIndex(r=>bS.equals(r.clippingPolygon,e));if(n===-1)return!1;let[i]=t.splice(n,1);return w_e(this,i),this._dirty=!0,this.polygonRemoved.raiseEvent(i.clippingPolygon,n),!0};cl.prototype.removeAll=function(){let e=this._polygons,t=e.length;for(let n=0;n<t;++n){let i=e[n];w_e(this,i),this.polygonRemoved.raiseEvent(i.clippingPolygon,n)}this._dirty=!0,this._polygons=[]};cl.prototype.update=function(e){if(!cl.isSupported(e))throw new oe("ClippingPolygonCollections are only supported for WebGL 2.");this._dirty&&(this._dirty=!1,this.length!==0&&(this._vectorCollectionData=Es.packPolygonCollectionData(this._bufferPolygonCollection,this.ellipsoid)))};var v_e=new ie,qZe=new ie;cl.prototype.computeIntersectionWithBoundingVolume=function(e,t){let n=this._polygons,i=n.length,r=$t.OUTSIDE;this.inverse&&(r=$t.INSIDE);let o=e.rectangle;if(!l(o)&&l(e.boundingVolume?.computeCorners)){let s=e.boundingVolume.computeCorners();o=ie.fromCartesianArray(s,t,v_e)}l(o)||(o=ie.fromBoundingSphere(e.boundingSphere,t,v_e));for(let s=0;s<i;++s){let a=n[s].clippingPolygon,c=ie.intersection(o,a.rectangle,qZe);if(l(c))return $t.INTERSECTING}return r};cl.setOwner=function(e,t,n){e!==t[n]&&(t[n]=void 0,l(e)&&(e._owner=t,t[n]=e))};cl.prototype.requestRectangleData=function(e,t){let n={rectangle:ie.clone(e),polygonRings:[]};return this.length===0||(Es.packPolygonRings(this._bufferPolygonCollection,this._vectorCollectionData,e,n),n.polygonRings.length===0)||(Es.packPolygonGrid(n),Es.packPolygonTextures(t,n)),n};cl.releaseRectangleData=function(e){Es.freeResources(e)};cl.isSupported=function(e){return e?.context.webgl2};cl.prototype.isDestroyed=function(){return qr("ClippingPolygonCollection.isDestroyed",HZe),!1};cl.prototype.destroy=function(){return qr("ClippingPolygonCollection.destroy",GZe),le(this)};var Nc=cl;var TS={NONE:0,SCENE_LIGHT:1,SUNLIGHT:2};TS.fromGlobeFlags=function(e){return e.enableLighting&&e.dynamicAtmosphereLighting?e.dynamicAtmosphereLightingFromSun?TS.SUNLIGHT:TS.SCENE_LIGHT:TS.NONE};Object.freeze(TS);var Vg=TS;function I_e(){this.lightIntensity=10,this.rayleighCoefficient=new h(55e-7,13e-6,284e-7),this.mieCoefficient=new h(21e-6,21e-6,21e-6),this.rayleighScaleHeight=1e4,this.mieScaleHeight=3200,this.mieAnisotropy=.9,this.hueShift=0,this.saturationShift=0,this.brightnessShift=0,this.dynamicLighting=Vg.NONE}I_e.requiresColorCorrect=function(e){return!(D.equalsEpsilon(e.hueShift,0,D.EPSILON7)&&D.equalsEpsilon(e.saturationShift,0,D.EPSILON7)&&D.equalsEpsilon(e.brightnessShift,0,D.EPSILON7))};var hT=I_e;function Ci(e){this._position=void 0,this._radianceMapDirty=!1,this._radianceCommandsDirty=!1,this._convolutionsCommandsDirty=!1,this._irradianceCommandDirty=!1,this._irradianceTextureDirty=!1,this._sphericalHarmonicCoefficientsDirty=!1,this._shouldRegenerateShaders=!1,this._shouldReset=!1,e=e??H.EMPTY_OBJECT;let t=Math.max(Math.floor(Math.min(e.mipmapLevels??7,Math.log2(kt.maximumCubeMapSize))),0);this._mipmapLevels=t;let n=Math.max(t-1,0)*6;this._radianceMapComputeCommands=new Array(6),this._convolutionComputeCommands=new Array(n),this._irradianceComputeCommand=void 0,this._radianceMapFS=void 0,this._irradianceMapFS=void 0,this._convolveSP=void 0,this._va=void 0,this._radianceMapTextures=new Array(6),this._specularMapTextures=new Array(n),this._radianceCubeMap=void 0,this._irradianceMapTexture=void 0,this._sphericalHarmonicCoefficients=Ci.DEFAULT_SPHERICAL_HARMONIC_COEFFICIENTS.slice(),this._lastTime=new K;let i=Math.max(Math.pow(2,t-1),1);this._textureDimensions=new U(i,i),this._radiiAndDynamicAtmosphereColor=new h,this._sceneEnvironmentMap=void 0,this._backgroundColor=void 0,this._owner=void 0,this.enabled=e.enabled??!0,this.shouldUpdate=!0,this.maximumSecondsDifference=e.maximumSecondsDifference??3600,this.maximumPositionEpsilon=e.maximumPositionEpsilon??1e3,this.atmosphereScatteringIntensity=e.atmosphereScatteringIntensity??2,this.gamma=e.gamma??1,this.brightness=e.brightness??1,this.saturation=e.saturation??1,this.groundColor=e.groundColor??Ci.AVERAGE_EARTH_GROUND_COLOR,this.groundAlbedo=e.groundAlbedo??.31}Object.defineProperties(Ci.prototype,{owner:{get:function(){return this._owner}},shouldRegenerateShaders:{get:function(){return this._shouldRegenerateShaders}},position:{get:function(){return this._position},set:function(e){h.equalsEpsilon(e,this._position,0,this.maximumPositionEpsilon)||(this._position=h.clone(e,this._position),this._shouldReset=!0)}},radianceCubeMap:{get:function(){return this._radianceCubeMap}},maximumMipmapLevel:{get:function(){return this._mipmapLevels}},sphericalHarmonicCoefficients:{get:function(){return this._sphericalHarmonicCoefficients}}});Ci._maximumComputeCommandCount=8;Ci._activeComputeCommandCount=0;Ci._nextFrameCommandQueue=[];Ci._queueCommand=(e,t)=>{if(Ci._activeComputeCommandCount>=Ci._maximumComputeCommandCount){Ci._nextFrameCommandQueue.push(e);return}t.commandList.push(e),Ci._activeComputeCommandCount++};Ci._updateCommandQueue=e=>{if(Ci._maximumComputeCommandCount=Math.log2(kt.maximumCubeMapSize),Ci._nextFrameCommandQueue.length>0&&Ci._activeComputeCommandCount<Ci._maximumComputeCommandCount){let t=Ci._nextFrameCommandQueue.shift();for(;l(t)&&Ci._activeComputeCommandCount<Ci._maximumComputeCommandCount;){if(t.owner.isDestroyed()||t.canceled){t=Ci._nextFrameCommandQueue.shift();continue}e.commandList.push(t),Ci._activeComputeCommandCount++,t=Ci._nextFrameCommandQueue.shift()}l(t)&&Ci._nextFrameCommandQueue.push(t)}};Ci.setOwner=function(e,t,n){e!==t[n]&&(t[n]=t[n]&&t[n].destroy(),l(e)&&(e._owner=t,t[n]=e))};Ci.prototype.reset=function(){let e=this._radianceMapComputeCommands.length;for(let t=0;t<e;++t)l(this._radianceMapComputeCommands[t])&&(this._radianceMapComputeCommands[t].canceled=!0),this._radianceMapComputeCommands[t]=void 0;e=this._convolutionComputeCommands.length;for(let t=0;t<e;++t)l(this._convolutionComputeCommands[t])&&(this._convolutionComputeCommands[t].canceled=!0),this._convolutionComputeCommands[t]=void 0;l(this._irradianceComputeCommand)&&(this._irradianceComputeCommand.canceled=!0,this._irradianceComputeCommand=void 0),this._radianceMapDirty=!0,this._radianceCommandsDirty=!0,this._convolutionsCommandsDirty=!1,this._irradianceCommandDirty=!1};var YZe=new h,XZe=new h;function KZe(e,t){let n=e._position,i=t.atmosphere,r=t.mapProjection.ellipsoid,o=r.scaleToGeodeticSurface(n,XZe),s=1.025,a=YZe,c=l(o)?h.magnitude(o):r.maximumRadius;return a.x=c*s,a.y=c,a.z=i.dynamicLighting,!h.equalsEpsilon(e._radiiAndDynamicAtmosphereColor,a)||t.environmentMap!==e._sceneEnvironmentMap||t.backgroundColor!==e._backgroundColor?(h.clone(a,e._radiiAndDynamicAtmosphereColor),e._sceneEnvironmentMap=t.environmentMap,e._backgroundColor=t.backgroundColor,!0):!1}var P_e=new h,$Ze=new N,JZe=new se,ZZe=new z;function QZe(e,t){let n=t.context,i=e._textureDimensions;if(l(e._radianceCubeMap)||(e._radianceCubeMap=new ns({context:n,width:i.x,height:i.y,pixelDatatype:ze.UNSIGNED_BYTE,pixelFormat:Ke.RGBA})),e._radianceCommandsDirty){let r=e._radianceMapFS;l(r)||(r=new Ye({sources:[Yh,QO]}),e._radianceMapFS=r),hT.requiresColorCorrect(t.atmosphere)&&r.defines.push("ATMOSPHERE_COLOR_CORRECT");let o=e._position,s=e._radiiAndDynamicAtmosphereColor,a=t.mapProjection.ellipsoid,c=At.eastNorthUpToFixedFrame(o,a,$Ze),u=JZe;u.x=e.brightness,u.y=e.saturation,u.z=e.gamma,u.w=e.atmosphereScatteringIntensity,(e.brightness!==1||e.saturation!==1||e.gamma!==1)&&r.defines.push("ENVIRONMENT_COLOR_CORRECT");let f=0;for(let d of ns.faceNames()){let p=e._radianceMapTextures[f];l(p)&&!p.isDestroyed()&&p.destroy(),p=new Dt({context:n,width:i.x,height:i.y,pixelDatatype:ze.UNSIGNED_BYTE,pixelFormat:Ke.RGBA}),e._radianceMapTextures[f]=p;let g=f,m=new xf({fragmentShaderSource:r,outputTexture:p,uniformMap:{u_radiiAndDynamicAtmosphereColor:()=>s,u_enuToFixedFrame:()=>c,u_faceDirection:()=>ns.getDirection(d,P_e),u_positionWC:()=>o,u_brightnessSaturationGammaIntensity:()=>u,u_groundColor:()=>e.groundColor.withAlpha(e.groundAlbedo,ZZe)},owner:e});m.postExecute=()=>{if(e.isDestroyed()||m.canceled){Ci._activeComputeCommandCount--;return}let y=e._radianceMapComputeCommands;y[g]=void 0;let A=new _s({context:n,colorTextures:[e._radianceMapTextures[g]]});A._bind(),e._radianceCubeMap[d].copyFromFramebuffer(),A._unBind(),A.destroy(),Ci._activeComputeCommandCount--,y.some(l)||(e._convolutionsCommandsDirty=!0,e._shouldRegenerateShaders=!0)},e._radianceMapComputeCommands[f]=m,Ci._queueCommand(m,t),f++}e._radianceCommandsDirty=!1}}function eQe(e,t){let n=e._radianceCubeMap;n.generateMipmap();let i=e._mipmapLevels,r=e._textureDimensions,o=r.x/2,s=r.y/2,a=t.context,c=0,u=()=>{let p=e._specularMapTextures.length;c>=p&&(e._irradianceCommandDirty=!0,i>1&&(n.sampler=new jt({minificationFilter:Wt.LINEAR_MIPMAP_LINEAR}),e._shouldRegenerateShaders=!0,e._va.destroy(),e._va=void 0,e._convolveSP.destroy(),e._convolveSP=void 0))},f=(p,g,m,y,A)=>()=>{if(e.isDestroyed()||p.canceled){Ci._activeComputeCommandCount--;return}let b=e._convolutionComputeCommands;b[g]=void 0,n.copyFace(t,m,y,A),c++,Ci._activeComputeCommandCount--,m.destroy(),e._specularMapTextures[g]=void 0,u()},d=0;for(let p=1;p<i;++p){for(let g of ns.faceNames()){l(e._specularMapTextures[d])&&e._specularMapTextures[d].destroy();let m=e._specularMapTextures[d]=new Dt({context:a,width:o,height:s,pixelDatatype:ze.UNSIGNED_BYTE,pixelFormat:Ke.RGBA}),y=e._va;l(y)||(y=ns.createVertexArray(a,g),e._va=y);let A=e._convolveSP;l(A)||(A=Qt.fromCache({context:a,vertexShaderSource:tM,fragmentShaderSource:eM,attributeLocations:{positions:0}}),e._convolveSP=A);let b=new xf({shaderProgram:A,vertexArray:y,outputTexture:m,persists:!0,owner:e,uniformMap:{u_roughness:()=>p/(i-1),u_radianceTexture:()=>n??a.defaultTexture,u_faceDirection:()=>ns.getDirection(g,P_e)}});b.postExecute=f(b,d,m,g,p),e._convolutionComputeCommands[d]=b,Ci._queueCommand(b,t),++d}o/=2,s/=2}u()}var D_e=new U(3,3);function tQe(e,t){let n=t.context,i=D_e,r=e._irradianceMapTexture;l(r)&&!r.isDestroyed()&&r.destroy(),r=new Dt({context:n,width:i.x,height:i.y,pixelDatatype:ze.FLOAT,pixelFormat:Ke.RGBA}),e._irradianceMapTexture=r;let o=e._irradianceMapFS;l(o)||(o=new Ye({sources:[ZO]}),e._irradianceMapFS=o);let s=new xf({fragmentShaderSource:o,outputTexture:r,owner:e,uniformMap:{u_radianceMap:()=>e._radianceCubeMap??n.defaultTexture}});s.postExecute=()=>{if(e.isDestroyed()||s.canceled){Ci._activeComputeCommandCount--;return}e._irradianceTextureDirty=!1,e._irradianceComputeCommand=void 0,e._sphericalHarmonicCoefficientsDirty=!0,e._irradianceMapFS=void 0,Ci._activeComputeCommandCount--},e._irradianceComputeCommand=s,Ci._queueCommand(s,t),e._irradianceTextureDirty=!0}function nQe(e,t){let n=t.context;if(!l(e._irradianceMapTexture))return;let i=new _s({context:n,colorTextures:[e._irradianceMapTexture],destroyAttachments:!1}),r=D_e,o=n.readPixels({x:0,y:0,width:r.x,height:r.y,framebuffer:i});for(let s=0;s<9;++s)e._sphericalHarmonicCoefficients[s]=h.unpack(o,s*4),h.multiplyByScalar(e._sphericalHarmonicCoefficients[s],e.atmosphereScatteringIntensity,e._sphericalHarmonicCoefficients[s]);i.destroy(),e._irradianceMapTexture.destroy(),e._irradianceMapTexture=void 0,e._shouldRegenerateShaders=!0}Ci.prototype.update=function(e){let t=e.mode;if(!(Ci.isDynamicUpdateSupported(e)&&this._mipmapLevels>=1)||!this.enabled||!this.shouldUpdate||!l(this._position)||t===re.MORPHING){this._shouldRegenerateShaders=!1;return}Ci._updateCommandQueue(e);let i=e.atmosphere.dynamicLighting,r=KZe(this,e)||i===Vg.SUNLIGHT&&!K.equalsEpsilon(e.time,this._lastTime,this.maximumSecondsDifference);if(this._shouldReset||r){this.reset(),this._shouldReset=!1,this._lastTime=K.clone(e.time,this._lastTime);return}if(this._radianceMapDirty&&(QZe(this,e),this._radianceMapDirty=!1),this._convolutionsCommandsDirty&&(eQe(this,e),this._convolutionsCommandsDirty=!1),this._irradianceCommandDirty&&(tQe(this,e),this._irradianceCommandDirty=!1),this._irradianceTextureDirty){this._shouldRegenerateShaders=!1;return}if(this._sphericalHarmonicCoefficientsDirty){nQe(this,e),this._sphericalHarmonicCoefficientsDirty=!1;return}this._shouldRegenerateShaders=!1};Ci.prototype.isDestroyed=function(){return!1};Ci.prototype.destroy=function(){let e=this._radianceMapComputeCommands.length;for(let t=0;t<e;++t)this._radianceMapComputeCommands[t]=void 0;e=this._convolutionComputeCommands.length;for(let t=0;t<e;++t)this._convolutionComputeCommands[t]=void 0;this._irradianceMapComputeCommand=void 0,e=this._radianceMapTextures.length;for(let t=0;t<e;++t)this._radianceMapTextures[t]=this._radianceMapTextures[t]&&!this._radianceMapTextures[t].isDestroyed()&&this._radianceMapTextures[t].destroy();e=this._specularMapTextures.length;for(let t=0;t<e;++t)this._specularMapTextures[t]=this._specularMapTextures[t]&&!this._specularMapTextures[t].isDestroyed()&&this._specularMapTextures[t].destroy();return this._radianceCubeMap=this._radianceCubeMap&&this._radianceCubeMap.destroy(),this._irradianceMapTexture=this._irradianceMapTexture&&!this._irradianceMapTexture.isDestroyed()&&this._irradianceMapTexture.destroy(),l(this._va)&&this._va.destroy(),l(this._convolveSP)&&this._convolveSP.destroy(),le(this)};Ci.isDynamicUpdateSupported=function(e){let t=e.context;return t.halfFloatingPointTexture||t.colorBufferFloat};Ci.AVERAGE_EARTH_GROUND_COLOR=Object.freeze(z.fromCssColorString("#717145"));Ci.DEFAULT_SPHERICAL_HARMONIC_COEFFICIENTS=Object.freeze([Object.freeze(new h(.35449,.35449,.35449)),h.ZERO,h.ZERO,h.ZERO,h.ZERO,h.ZERO,h.ZERO,h.ZERO,h.ZERO]);var jg=Ci;var ES={HIGHLIGHT:0,REPLACE:1,MIX:2};ES.getColorBlend=function(e,t){if(e===ES.HIGHLIGHT)return 0;if(e===ES.REPLACE)return 1;if(e===ES.MIX)return D.clamp(t,D.EPSILON4,1)};Object.freeze(ES);var ll=ES;var R_e={SURFACES_ONLY:0,SURFACES_AND_EDGES:1,EDGES_ONLY:2};Object.freeze(R_e);var Wd=R_e;var O_e={XTRANSLATE:"xTranslate",YTRANSLATE:"yTranslate",ZTRANSLATE:"zTranslate",XROTATE:"xRotate",YROTATE:"yRotate",ZROTATE:"zRotate",XSCALE:"xScale",YSCALE:"yScale",ZSCALE:"zScale",UNIFORMSCALE:"uniformScale"};Object.freeze(O_e);var ul=O_e;var M_e={STEP:0,LINEAR:1,CUBICSPLINE:2};Object.freeze(M_e);var fm=M_e;var N_e={};function OL(e){this._count=e.count,this._properties=Je(e.properties,!0)}OL.prototype.hasProperty=function(e){return Yn.hasProperty(e,this._properties,N_e)};OL.prototype.getPropertyIds=function(e){return Yn.getPropertyIds(this._properties,N_e,e)};OL.prototype.getProperty=function(e,t){let n=this._properties[t];if(l(n))return Je(n[e],!0)};OL.prototype.setProperty=function(e,t,n){let i=this._properties[t];l(i)||(i=new Array(this._count),this._properties[t]=i),i[e]=Je(n,!0)};var Hg=OL;function Lc(e){e=e??H.EMPTY_OBJECT,this._name=e.name,this._id=e.id,this._count=e.count,this._extras=e.extras,this._extensions=e.extensions,this._metadataTable=e.metadataTable,this._jsonMetadataTable=e.jsonMetadataTable,this._batchTableHierarchy=e.batchTableHierarchy,this._texture=e.texture}Object.defineProperties(Lc.prototype,{name:{get:function(){return this._name}},id:{get:function(){return this._id}},count:{get:function(){return this._count}},class:{get:function(){if(l(this._metadataTable))return this._metadataTable.class}},properties:{get:function(){if(l(this._metadataTable))return this._metadataTable.properties}},extras:{get:function(){return this._extras}},extensions:{get:function(){return this._extensions}},byteLength:{get:function(){let e=0;return l(this._metadataTable)&&(e+=this._metadataTable.byteLength),l(this._batchTableHierarchy)&&(e+=this._batchTableHierarchy.byteLength),e}},texture:{get:function(){return this._texture}}});Lc.prototype.hasProperty=function(e,t){return!!(l(this._metadataTable)&&this._metadataTable.hasProperty(t)||l(this._batchTableHierarchy)&&this._batchTableHierarchy.hasProperty(e,t)||l(this._jsonMetadataTable)&&this._jsonMetadataTable.hasProperty(t))};Lc.prototype.hasPropertyBySemantic=function(e,t){return l(this._metadataTable)?this._metadataTable.hasPropertyBySemantic(t):!1};Lc.prototype.propertyExists=function(e){return!!(l(this._metadataTable)&&this._metadataTable.hasProperty(e)||l(this._batchTableHierarchy)&&this._batchTableHierarchy.propertyExists(e)||l(this._jsonMetadataTable)&&this._jsonMetadataTable.hasProperty(e))};Lc.prototype.propertyExistsBySemantic=function(e){return l(this._metadataTable)?this._metadataTable.hasPropertyBySemantic(e):!1};var bJ=[];Lc.prototype.getPropertyIds=function(e,t){if(t=l(t)?t:[],t.length=0,l(this._metadataTable)){let n=this._metadataTable.getPropertyIds(bJ);Zn(t,n)}if(l(this._batchTableHierarchy)){let n=this._batchTableHierarchy.getPropertyIds(e,bJ);Zn(t,n)}if(l(this._jsonMetadataTable)){let n=this._jsonMetadataTable.getPropertyIds(bJ);Zn(t,n)}return t};Lc.prototype.getProperty=function(e,t){let n;if(l(this._metadataTable)&&(n=this._metadataTable.getProperty(e,t),l(n))||l(this._batchTableHierarchy)&&(n=this._batchTableHierarchy.getProperty(e,t),l(n))||l(this._jsonMetadataTable)&&(n=this._jsonMetadataTable.getProperty(e,t),l(n)))return n};Lc.prototype.setProperty=function(e,t,n){l(this._metadataTable)&&this._metadataTable.setProperty(e,t,n)||l(this._batchTableHierarchy)&&this._batchTableHierarchy.setProperty(e,t,n)||(l(this._jsonMetadataTable)||(this._jsonMetadataTable=new Hg({count:this._count,properties:{}})),this._jsonMetadataTable.setProperty(e,t,n))};Lc.prototype.getPropertyBySemantic=function(e,t){if(l(this._metadataTable))return this._metadataTable.getPropertyBySemantic(e,t)};Lc.prototype.setPropertyBySemantic=function(e,t,n){return l(this._metadataTable)?this._metadataTable.setPropertyBySemantic(e,t,n):!1};Lc.prototype.getPropertyTypedArray=function(e){if(l(this._metadataTable))return this._metadataTable.getPropertyTypedArray(e)};Lc.prototype.getPropertyTypedArrayBySemantic=function(e){if(l(this._metadataTable))return this._metadataTable.getPropertyTypedArrayBySemantic(e)};Lc.prototype.isClass=function(e,t){let n=this._batchTableHierarchy;return l(n)?n.isClass(e,t):!1};Lc.prototype.isExactClass=function(e,t){return this.getExactClassName(e)===t};Lc.prototype.getExactClassName=function(e){let t=this._batchTableHierarchy;if(l(t))return t.getClassName(e)};Lc.prototype.destroy=function(){return this._texture=this._texture&&this._texture.destroy(),le(this)};var iu=Lc;function L_e(e){e=e??H.EMPTY_OBJECT;let t=e.property,n=e.classProperty,i=e.textures,r=l(t.channels)?t.channels:[0],o=t,s=Hu.createModelTextureReader({textureInfo:o,channels:iQe(r),texture:i[o.index]});this._min=t.min,this._max=t.max;let a=t.offset,c=t.scale,u=n.hasValueTransform||l(a)||l(c);a=a??n.offset,c=c??n.scale,a=n.unpackVectorAndMatrixTypes(a),c=n.unpackVectorAndMatrixTypes(c),this._offset=a,this._scale=c,this._hasValueTransform=u,this._textureReader=s,this._classProperty=n,this._extras=t.extras,this._extensions=t.extensions}Object.defineProperties(L_e.prototype,{textureReader:{get:function(){return this._textureReader}},hasValueTransform:{get:function(){return this._hasValueTransform}},offset:{get:function(){return this._offset}},scale:{get:function(){return this._scale}},classProperty:{get:function(){return this._classProperty}},extras:{get:function(){return this._extras}},extensions:{get:function(){return this._extensions}}});function iQe(e){return e.map(function(t){return"rgba".charAt(t)}).join("")}var ML=L_e;function xJ(e){e=e??H.EMPTY_OBJECT;let t=e.propertyTexture,n=e.class,i=e.textures,r=t.extensions,o=t.extras,s={};if(l(t.properties))for(let a in t.properties)t.properties.hasOwnProperty(a)&&(s[a]=new ML({property:t.properties[a],classProperty:n.properties[a],textures:i}));this._name=e.name,this._id=e.id,this._class=n,this._properties=s,this._extras=o,this._extensions=r}Object.defineProperties(xJ.prototype,{name:{get:function(){return this._name}},id:{get:function(){return this._id}},class:{get:function(){return this._class}},properties:{get:function(){return this._properties}},extras:{get:function(){return this._extras}},extensions:{get:function(){return this._extensions}}});xJ.prototype.getProperty=function(e){return this._properties[e]};var Gg=xJ;function F_e(e){e=e??H.EMPTY_OBJECT;let t=e.property,n=e.classProperty;this._attribute=t.attribute,this._classProperty=n,this._min=t.min,this._max=t.max;let i=t.offset,r=t.scale,o=n.hasValueTransform||l(i)||l(r);i=i??n.offset,r=r??n.scale,i=n.unpackVectorAndMatrixTypes(i),r=n.unpackVectorAndMatrixTypes(r),this._offset=i,this._scale=r,this._hasValueTransform=o,this._extras=t.extras,this._extensions=t.extensions}Object.defineProperties(F_e.prototype,{attribute:{get:function(){return this._attribute}},hasValueTransform:{get:function(){return this._hasValueTransform}},offset:{get:function(){return this._offset}},scale:{get:function(){return this._scale}},classProperty:{get:function(){return this._classProperty}},extras:{get:function(){return this._extras}},extensions:{get:function(){return this._extensions}}});var NL=F_e;function TJ(e){e=e??H.EMPTY_OBJECT;let t=e.propertyAttribute,n=e.class,i={};if(l(t.properties))for(let r in t.properties)t.properties.hasOwnProperty(r)&&(i[r]=new NL({property:t.properties[r],classProperty:n.properties[r]}));this._name=e.name,this._id=e.id,this._class=n,this._properties=i,this._extras=t.extras,this._extensions=t.extensions}Object.defineProperties(TJ.prototype,{name:{get:function(){return this._name}},id:{get:function(){return this._id}},class:{get:function(){return this._class}},properties:{get:function(){return this._properties}},extras:{get:function(){return this._extras}},extensions:{get:function(){return this._extensions}}});TJ.prototype.getProperty=function(e){return this._properties[e]};var mT=TJ;function CS(e){e=e??H.EMPTY_OBJECT,this._schema=e.schema;let t=e.propertyTables;this._propertyTableCount=l(t)?t.length:0,this._propertyTables=t??[],this._propertyTextures=e.propertyTextures??[],this._propertyAttributes=e.propertyAttributes??[],this._statistics=e.statistics,this._extras=e.extras,this._extensions=e.extensions}Object.defineProperties(CS.prototype,{schema:{get:function(){return this._schema}},statistics:{get:function(){return this._statistics}},extras:{get:function(){return this._extras}},extensions:{get:function(){return this._extensions}},propertyTableCount:{get:function(){return this._propertyTableCount}},propertyTables:{get:function(){return this._propertyTables}},propertyTextures:{get:function(){return this._propertyTextures}},propertyAttributes:{get:function(){return this._propertyAttributes}},propertyTablesByteLength:{get:function(){if(!l(this._propertyTables))return 0;let e=0,t=this._propertyTables.length;for(let n=0;n<t;n++)e+=this._propertyTables[n].byteLength;return e}}});CS.prototype.getPropertyTable=function(e){return this._propertyTables[e]};CS.prototype.getPropertyTexture=function(e){return this._propertyTextures[e]};CS.prototype.getPropertyAttribute=function(e){return this._propertyAttributes[e]};CS.prototype.destroy=function(){let e=this._propertyTables;for(let t=0;t<e.length;t++)e[t]=e[t]&&e[t].destroy();return le(this)};var Va=CS;function rQe(e){e=e??H.EMPTY_OBJECT;let t=e.extension,n=e.schema,i=[];if(l(t.propertyTables))for(let s=0;s<t.propertyTables.length;s++){let a=t.propertyTables[s],c=n.classes[a.class],u=oQe(a,e.bufferViews,c,e.context),f=new kd({count:a.count,properties:a.properties,class:c,bufferViews:e.bufferViews});i.push(new iu({id:s,name:a.name,count:a.count,metadataTable:f,extras:a.extras,extensions:a.extensions,texture:u}))}let r=[];if(l(t.propertyTextures))for(let s=0;s<t.propertyTextures.length;s++){let a=t.propertyTextures[s];r.push(new Gg({id:s,name:a.name,propertyTexture:a,class:n.classes[a.class],textures:e.textures}))}let o=[];if(l(t.propertyAttributes))for(let s=0;s<t.propertyAttributes.length;s++){let a=t.propertyAttributes[s];o.push(new mT({id:s,name:a.name,class:n.classes[a.class],propertyAttribute:a}))}return new Va({schema:n,propertyTables:i,propertyTextures:r,propertyAttributes:o,statistics:t.statistics,extras:t.extras,extensions:t.extensions})}var LL=4;function oQe(e,t,n,i){let r=e.properties;if(!l(r))return;let o=e.count,s;try{s=sQe(r,t,n,o)}catch(f){console.warn(`Failed to create texture for property table "${e.name}": ${f.message}`);return}let a=s.length;if(a===0)return;if(o>kt.maximumTextureSize||a>kt.maximumTextureSize){_t("PropertyTableTextureExceedsMaximumSize",`Cannot create a texture for the property table "${e.name}" because it exceeds the maximum texture size of ${kt.maximumTextureSize}.`);return}let c=cQe(s,o),u=new jt({wrapS:hn.CLAMP_TO_EDGE,wrapT:hn.CLAMP_TO_EDGE,minificationFilter:Wt.NEAREST,magnificationFilter:Jn.NEAREST});return Dt.create({context:i,pixelFormat:Ke.RGBA,pixelDatatype:ze.UNSIGNED_BYTE,sampler:u,flipY:!1,source:{width:o,height:a,arrayBufferView:c}})}function sQe(e,t,n,i){let r=[],o=n.properties;for(let[s,a]of Object.entries(o)){if(!a.isGpuCompatible(LL))continue;let c=e[s],u=l(c)?t[c.values]:aQe(a,i),f=u.length,d=a.cpuBytesPerElement(),p=f/d;if(p!==i)throw new oe(`Property with ID: "${s}" has (${p}), which does not match number of features in the property table: (${i}).`);r.push({view:u,classProperty:a})}return r}function aQe(e,t){let n=e.noData,i=bt.getComponentCount(e.type),r=e.isArray?e.arrayLength:1;e.type===bt.ENUM&&(n=e.enumType.valuesByName[n]),i===1&&(n=[n]),r===1&&(n=[n]);let o=e.cpuBytesPerElement(),s=Lt.getSizeInBytes(e.valueType),a=new ArrayBuffer(o*t),c=new DataView(a),u=Lt.getDataViewAccessors(c,e.valueType);for(let f=0;f<t;f++)for(let d=0;d<r;d++)for(let p=0;p<i;p++){let g=d*i+p;u.set(o*f+g*s,n[d][p])}return new Uint8Array(a)}function cQe(e,t){let n=e.length,i=new Uint8Array(n*t*LL),r=new DataView(i.buffer,i.byteOffset,i.byteLength);for(let o=0;o<n;o++){let s=e[o],a=s.classProperty,c=o*t*LL,u=a.valueType,f=Lt.gpuComponentType(u);if(u!==f){uQe(s,r,c);continue}lQe(s,i,c)}return i}function lQe(e,t,n){let i=e.view,r=e.classProperty.cpuBytesPerElement(),o=i.length/r;for(let s=0;s<o;s++){let a=s*r,c=n+s*LL;t.set(i.subarray(a,a+r),c)}}function uQe(e,t,n){let i=e.classProperty,r=e.view,o=i.valueType,s=Lt.gpuComponentType(o),a=i.cpuBytesPerElement(),c=r.length/a,u=new DataView(r.buffer,r.byteOffset,r.byteLength),f=Lt.getDataViewAccessors(u,o),d=Lt.getDataViewAccessors(t,s),p=Lt.downcastFunction(o);for(let g=0;g<c;g++){let m=g*a,y=n+g*LL,A=f.get(m);d.set(y,p(A))}}var FL=rQe;function fQe(e){e=e??H.EMPTY_OBJECT;let t=e.extension,n=e.schema,i,r=[],o;if(l(t.featureTables))for(o=Object.keys(t.featureTables).sort(),i=0;i<o.length;i++){let a=o[i],c=t.featureTables[a],u=n.classes[c.class],f=new kd({count:c.count,properties:c.properties,class:u,bufferViews:e.bufferViews});r.push(new iu({id:a,count:c.count,metadataTable:f,extras:c.extras,extensions:c.extensions}))}let s=[];if(l(t.featureTextures))for(o=Object.keys(t.featureTextures).sort(),i=0;i<o.length;i++){let a=o[i],c=t.featureTextures[a];s.push(new Gg({id:a,propertyTexture:dQe(c),class:n.classes[c.class],textures:e.textures}))}return new Va({schema:n,propertyTables:r,propertyTextures:s,statistics:t.statistics,extras:t.extras,extensions:t.extensions})}function dQe(e){let t={class:e.class,properties:{}},n=e.properties;for(let i in n)if(n.hasOwnProperty(i)){let r=n[i],o={channels:hQe(r.channels),extras:r.extras,extensions:r.extensions};t.properties[i]=Ot(r.texture,o,!0)}return t}function hQe(e){let t=e.length,n=new Array(t);for(let i=0;i<t;i++)n[i]="rgba".indexOf(e[i]);return n}var BL=fQe;var EJ=class extends nr{constructor(t){super(),t=t??H.EMPTY_OBJECT;let{gltf:n,extension:i,extensionLegacy:r,gltfResource:o,baseResource:s,supportedImageFormats:a,frameState:c,cacheKey:u,asynchronous:f=!0}=t;this._gltfResource=o,this._baseResource=s,this._gltf=n,this._extension=i,this._extensionLegacy=r,this._supportedImageFormats=a,this._frameState=c,this._cacheKey=u,this._asynchronous=f,this._bufferViewLoaders=[],this._bufferViewIds=[],this._textureLoaders=[],this._textureIds=[],this._schemaLoader=void 0,this._structuralMetadata=void 0,this._state=Tt.UNLOADED,this._promise=void 0}get cacheKey(){return this._cacheKey}get structuralMetadata(){return this._structuralMetadata}load(){return l(this._promise)?this._promise:(this._state=Tt.LOADING,this._promise=mQe(this),this._promise)}process(t){if(this._state===Tt.READY)return!0;if(this._state!==Tt.LOADED)return!1;let n=this._textureLoaders,i=n.length,r=!0;for(let c=0;c<i;++c){let f=n[c].process(t);r=r&&f}if(!r)return!1;let o=this._schemaLoader.schema,s={};for(let c=0;c<this._bufferViewIds.length;++c){let u=this._bufferViewIds[c],f=this._bufferViewLoaders[c];if(!f.isDestroyed()){let d=new Uint8Array(f.typedArray);s[u]=d}}let a={};for(let c=0;c<this._textureIds.length;++c){let u=this._textureIds[c],f=n[c];f.isDestroyed()||(a[u]=f.texture)}return l(this._extension)?this._structuralMetadata=FL({extension:this._extension,schema:o,bufferViews:s,textures:a,context:t.context}):this._structuralMetadata=BL({extension:this._extensionLegacy,schema:o,bufferViews:s,textures:a}),B_e(this),this._state=Tt.READY,!0}unload(){B_e(this),SQe(this),l(this._schemaLoader)&&Li.unload(this._schemaLoader),this._schemaLoader=void 0,l(this._structuralMetadata)&&this._structuralMetadata.destroy(),this._structuralMetadata=void 0}};async function mQe(e){try{let t=AQe(e),n=CQe(e),i=vQe(e);return await Promise.all([t,n,i]),e.isDestroyed()?void 0:(e._gltf=void 0,e._state=Tt.LOADED,e)}catch(t){if(e.isDestroyed())return;throw e.unload(),e._state=Tt.FAILED,e.getError("Failed to load structural metadata",t)}}function pQe(e,t){for(let n in e)if(e.hasOwnProperty(n)){let i=e[n],r=i.values,o=i.arrayOffsets,s=i.stringOffsets;l(r)&&(t[r]=!0),l(o)&&(t[o]=!0),l(s)&&(t[s]=!0)}}function gQe(e,t){for(let n in e)if(e.hasOwnProperty(n)){let i=e[n],r=i.bufferView,o=i.arrayOffsetBufferView,s=i.stringOffsetBufferView;l(r)&&(t[r]=!0),l(o)&&(t[o]=!0),l(s)&&(t[s]=!0)}}function _Qe(e){let t=e.propertyTables,n={};if(l(t))for(let i=0;i<t.length;i++){let r=t[i];pQe(r.properties,n)}return n}function yQe(e){let t=e.featureTables,n={};if(l(t)){for(let i in t)if(t.hasOwnProperty(i)){let o=t[i].properties;l(o)&&gQe(o,n)}}return n}async function AQe(e){let t;l(e._extension)?t=_Qe(e._extension):t=yQe(e._extensionLegacy);let n=[];for(let i in t)if(t.hasOwnProperty(i)){let r=Li.getBufferViewLoader({gltf:e._gltf,bufferViewId:parseInt(i),gltfResource:e._gltfResource,baseResource:e._baseResource});e._bufferViewLoaders.push(r),e._bufferViewIds.push(i),n.push(r.load())}return Promise.all(n)}function bQe(e){let t={},n=e.propertyTextures;if(l(n))for(let i=0;i<n.length;i++){let o=n[i].properties;l(o)&&xQe(o,t)}return t}function xQe(e,t){for(let n in e)if(e.hasOwnProperty(n)){let i=e[n];t[i.index]=i}}function TQe(e){let t={},n=e.featureTextures;if(l(n)){for(let i in n)if(n.hasOwnProperty(i)){let o=n[i].properties;l(o)&&EQe(o,t)}}return t}function EQe(e,t){for(let n in e)if(e.hasOwnProperty(n)){let r=e[n].texture;t[r.index]=r}}function CQe(e){let t;l(e._extension)?t=bQe(e._extension):t=TQe(e._extensionLegacy);let n=e._gltf,i=e._gltfResource,r=e._baseResource,o=e._supportedImageFormats,s=e._frameState,a=e._asynchronous,c=[];for(let u in t)if(t.hasOwnProperty(u)){let f=Li.getTextureLoader({gltf:n,textureInfo:t[u],gltfResource:i,baseResource:r,supportedImageFormats:o,frameState:s,asynchronous:a});e._textureLoaders.push(f),e._textureIds.push(u),c.push(f.load())}return Promise.all(c)}async function vQe(e){let t=e._extension??e._extensionLegacy,n;if(l(t.schemaUri)){let i=e._baseResource.getDerivedResource({url:t.schemaUri});n=Li.getSchemaLoader({resource:i})}else n=Li.getSchemaLoader({schema:t.schema});if(e._schemaLoader=n,await n.load(),!n.isDestroyed())return n.schema}function B_e(e){let t=e._bufferViewLoaders,n=t.length;for(let i=0;i<n;++i)Li.unload(t[i]);e._bufferViewLoaders.length=0,e._bufferViewIds.length=0}function SQe(e){let t=e._textureLoaders,n=t.length;for(let i=0;i<n;++i)Li.unload(t[i]);e._textureLoaders.length=0,e._textureIds.length=0}var kL=EJ;var pT={TRANSLATION:"TRANSLATION",ROTATION:"ROTATION",SCALE:"SCALE",FEATURE_ID:"_FEATURE_ID"};pT.fromGltfSemantic=function(e){let t=e,i=/^(\w+)_\d+$/.exec(e);switch(i!==null&&(t=i[1]),t){case"TRANSLATION":return pT.TRANSLATION;case"ROTATION":return pT.ROTATION;case"SCALE":return pT.SCALE;case"_FEATURE_ID":return pT.FEATURE_ID}};Object.freeze(pT);var No=pT;var wQe=65534,IQe=255;function dH(e){e=e??H.EMPTY_OBJECT;let t=e.triangleIndices,n=e.outlineIndices,i=e.originalVertexCount;this._triangleIndices=t,this._originalVertexCount=i,this._edges=new z_e(n,i),this._outlineCoordinatesTypedArray=void 0,this._extraVertices=[],PQe(this)}Object.defineProperties(dH.prototype,{updatedTriangleIndices:{get:function(){return this._triangleIndices}},outlineCoordinates:{get:function(){return this._outlineCoordinatesTypedArray}}});function PQe(e){let t=e._triangleIndices,n=e._edges,i=[],r=e._extraVertices,o=e._originalVertexCount,s={};for(let a=0;a<t.length;a+=3){let c=t[a],u=t[a+1],f=t[a+2],d=!1,p=d||n.hasEdge(c,u),g=d||n.hasEdge(u,f),m=d||n.hasEdge(f,c),y=k_e(i,c,u,f,p,g,m);for(;l(y);){let A=s[y];if(!l(A)){A=o+r.length;let b=y;for(;b>=o;)b=r[b-o];r.push(b),s[y]=A}A>wQe&&(t instanceof Uint16Array||t instanceof Uint8Array)?t=new Uint32Array(t):A>IQe&&t instanceof Uint8Array&&(t=new Uint16Array(t)),y===c?(c=A,t[a]=A):y===u?(u=A,t[a+1]=A):(f=A,t[a+2]=A),y=k_e(i,c,u,f,p,g,m)}}e._triangleIndices=t,e._outlineCoordinatesTypedArray=new Float32Array(i)}function k_e(e,t,n,i,r,o,s){let a=s?1:0,c=r?1:0,u=0,f=CJ(e,t,a,c,u);if(f===0)return t;let d=0,p=r?1:0,g=o?1:0,m=CJ(e,n,d,p,g);if(m===0)return n;let y=s?1:0,A=0,b=o?1:0,x=CJ(e,i,y,A,b);if(x===0)return i;let T=f&m&x,E,v,S;if(T&1)E=0,v=1,S=2;else if(T&2)E=0,S=1,v=2;else if(T&4)v=0,E=1,S=2;else if(T&8)v=0,S=1,E=2;else if(T&16)S=0,E=1,v=2;else if(T&32)S=0,v=1,E=2;else{let L=vJ(f),_=vJ(m),C=vJ(x);return L<_&&L<C?t:_<C?n:i}let I=t*3;e[I+E]=a,e[I+v]=c,e[I+S]=u;let R=n*3;e[R+E]=d,e[R+v]=p,e[R+S]=g;let O=i*3;e[O+E]=y,e[O+v]=A,e[O+S]=b}function CJ(e,t,n,i,r){let o=t*3,s=e[o],a=e[o+1],c=e[o+2];return l(s)?(s===n&&a===i&&c===r)<<0|(s===n&&a===r&&c===i)<<1|(s===i&&a===n&&c===r)<<2|(s===i&&a===r&&c===n)<<3|(s===r&&a===n&&c===i)<<4|(s===r&&a===i&&c===n)<<5:63}function vJ(e){return(e&1)+(e>>1&1)+(e>>2&1)+(e>>3&1)+(e>>4&1)+(e>>5&1)}dH.prototype.updateAttribute=function(e){let t=this._extraVertices,n=e.length,i=n/this._originalVertexCount,r=t.length,o=e.constructor,s=new o(e.length+r*i);s.set(e);for(let a=0;a<r;a++){let c=t[a]*i,u=n+a*i;for(let f=0;f<i;f++)s[u+f]=s[c+f]}return s};dH.createTexture=function(e){let t=e.cache.modelOutliningCache;if(l(t)||(t=e.cache.modelOutliningCache={}),l(t.outlineTexture))return t.outlineTexture;let n=Math.min(4096,kt.maximumTextureSize),i=n,r=U_e(i),o=[];for(;i>1;)i>>=1,o.push(U_e(i));let s=new Dt({context:e,source:{arrayBufferView:r,mipLevels:o},width:n,height:1,pixelFormat:Ke.LUMINANCE,sampler:new jt({wrapS:hn.CLAMP_TO_EDGE,wrapT:hn.CLAMP_TO_EDGE,minificationFilter:Wt.LINEAR_MIPMAP_LINEAR,magnificationFilter:Jn.LINEAR})});return t.outlineTexture=s,s};function U_e(e){let t=new Uint8Array(e);return t[e-1]=192,e===8?t[e-1]=96:e===4?t[e-1]=48:e===2?t[e-1]=24:e===1&&(t[e-1]=12),t}function z_e(e,t){this._originalVertexCount=t,this._edges=new Set;for(let n=0;n<e.length;n+=2){let i=e[n],r=e[n+1],o=Math.min(i,r),s=Math.max(i,r),a=o*this._originalVertexCount+s;this._edges.add(a)}}z_e.prototype.hasEdge=function(e,t){let n=Math.min(e,t),i=Math.max(e,t),r=n*this._originalVertexCount+i;return this._edges.has(r)};var gT=dH;function V_e(e){this.attribute=e,this.loadBuffer=!1,this.loadTypedArray=!1}function DQe(e){this.indices=e,this.loadBuffer=!1,this.loadTypedArray=!1}function hH(e){this.primitive=e,this.attributePlans=[],this.indicesPlan=void 0,this.needsOutlines=!1,this.outlineIndices=void 0,this.needsGaussianSplats=!1}hH.prototype.postProcess=function(e){this.needsOutlines&&(RQe(this),NQe(this,e)),this.needsGaussianSplats&&MQe(this,e)};function RQe(e){let t=e.primitive,n=t.indices,i=t.attributes[0].count,r=new gT({triangleIndices:n.typedArray,outlineIndices:e.outlineIndices,originalVertexCount:i});n.typedArray=r.updatedTriangleIndices,n.indexDatatype=je.fromTypedArray(n.typedArray);let o=OQe(r.outlineCoordinates),s=new V_e(o);s.loadBuffer=!0,s.loadTypedArray=!1,e.attributePlans.push(s),t.outlineCoordinates=s.attribute;let a=e.attributePlans,c=e.attributePlans.length;for(let u=0;u<c;u++){let f=a[u].attribute;f.typedArray=r.updateAttribute(f.typedArray)}}function OQe(e){let t=new Cn.Attribute;return t.name="_OUTLINE_COORDINATES",t.typedArray=e,t.componentDatatype=Y.FLOAT,t.type=Vt.VEC3,t.normalized=!1,t.count=e.length/3,t}function MQe(e,t){let n=e.attributePlans,i=n.length;for(let r=0;r<i;r++){let o=n[r];o.loadBuffer=!1,o.loadTypedArray=!0}}function NQe(e,t){LQe(e.attributePlans,t),l(e.indicesPlan)&&FQe(e.indicesPlan,t)}function LQe(e,t){let n=e.length;for(let i=0;i<n;i++){let r=e[i],o=r.attribute,s=o.typedArray;if(r.loadBuffer){let a=tt.createVertexBuffer({typedArray:s,context:t,usage:Me.STATIC_DRAW});a.vertexArrayDestroyable=!1,o.buffer=a}r.loadTypedArray||(o.typedArray=void 0)}}function FQe(e,t){let n=e.indices;if(e.loadBuffer){let i=tt.createIndexBuffer({typedArray:n.typedArray,context:t,usage:Me.STATIC_DRAW,indexDatatype:n.indexDatatype});n.buffer=i,i.vertexArrayDestroyable=!1}e.loadTypedArray||(n.typedArray=void 0)}hH.AttributeLoadPlan=V_e;hH.IndicesLoadPlan=DQe;var _T=hH;function BQe(e){e=e??H.EMPTY_OBJECT,this.webp=e.webp??!1,this.basis=e.basis??!1}var UL=BQe;function j_e(e){this._position=e.position,this._adjustmentParams=e.adjustmentParams}Object.defineProperties(j_e.prototype,{position:{get:function(){return this._position}},adjustmentParams:{get:function(){return this._adjustmentParams}}});var zL=j_e;function H_e(e){this._position=e.position,this._adjustmentParams=e.adjustmentParams,this._covarianceMatrix=e.covarianceMatrix}Object.defineProperties(H_e.prototype,{position:{get:function(){return this._position}},adjustmentParams:{get:function(){return this._adjustmentParams}},covarianceMatrix:{get:function(){return this._covarianceMatrix}}});var VL=H_e;function G_e(e){this._groupFlags=e.groupFlags,this._rotationThetas=e.rotationThetas,this._params=e.params}Object.defineProperties(G_e.prototype,{groupFlags:{get:function(){return this._groupFlags}},rotationThetas:{get:function(){return this._rotationThetas}},params:{get:function(){return this._params}}});var jL=G_e;var W_e={Direct:"Direct",Indirect:"Indirect"};Object.freeze(W_e);var AA=W_e;function q_e(e){this._storageType=e.storageType,this._anchorPointsIndirect=e.anchorPointsIndirect,this._anchorPointsDirect=e.anchorPointsDirect,this._intraTileCorrelationGroups=e.intraTileCorrelationGroups,this._covarianceDirect=e.covarianceDirect}Object.defineProperties(q_e.prototype,{storageType:{get:function(){return this._storageType}},anchorPointsIndirect:{get:function(){return this._anchorPointsIndirect}},anchorPointsDirect:{get:function(){return this._anchorPointsDirect}},intraTileCorrelationGroups:{get:function(){return this._intraTileCorrelationGroups}},covarianceDirect:{get:function(){return this._covarianceDirect}}});var vS=q_e;function Y_e(e){this._A=e.A,this._alpha=e.alpha,this._beta=e.beta,this._T=e.T}Object.defineProperties(Y_e.prototype,{A:{get:function(){return this._A}},alpha:{get:function(){return this._alpha}},beta:{get:function(){return this._beta}},T:{get:function(){return this._T}}});var HL=Y_e;function SS(){}function X_e(e){return new $(e[0],e[1],e[3],e[1],e[2],e[4],e[3],e[4],e[5])}function kQe(e){let t=h.fromArray(e.position,0,new h),n=h.fromArray(e.adjustmentParams,0,new h);return new zL({position:t,adjustmentParams:n})}function UQe(e){let t=h.fromArray(e.position,0,new h),n=h.fromArray(e.adjustmentParams,0,new h),i=X_e(e.covarianceMatrix);return new VL({position:t,adjustmentParams:n,covarianceMatrix:i})}function zQe(e){let t=e.groupFlags,n=h.fromArray(e.rotationThetas,0,new h),i=[];for(let o of e.params){let s=new HL({A:o.A,alpha:o.alpha,beta:o.beta,T:o.T});i.push(s)}return new jL({groupFlags:t,rotationThetas:n,params:i})}SS.load=function(e){let t=e.storageType;if(t===AA.Direct)return SS.loadDirect(e);if(t===AA.Indirect)return SS.loadIndirect(e);throw new oe(`Invalid storage type in NGA_gpm_local - expected 'Direct' or 'Indirect', but found ${t}`)};SS.loadDirect=function(e){let t=[],n=e.anchorPointsDirect;for(let o of n){let s=kQe(o);t.push(s)}let i=X_e(e.covarianceDirectUpperTriangle);return new vS({storageType:AA.Direct,anchorPointsDirect:t,covarianceDirect:i})};SS.loadIndirect=function(e){let t=[],n=e.anchorPointsIndirect;for(let s of n){let a=UQe(s);t.push(a)}let i=e.intraTileCorrelationGroups,r=[];for(let s of i){let a=zQe(s);r.push(a)}return new vS({storageType:AA.Indirect,anchorPointsIndirect:t,intraTileCorrelationGroups:r})};var GL=SS;function K_e(e){this._traits=e.traits,this._noData=e.noData,this._offset=e.offset,this._scale=e.scale,this._index=e.index,this._texCoord=e.texCoord}Object.defineProperties(K_e.prototype,{traits:{get:function(){return this._traits}},noData:{get:function(){return this._noData}},offset:{get:function(){return this._offset}},scale:{get:function(){return this._scale}},index:{get:function(){return this._index}},texCoord:{get:function(){return this._texCoord}}});var WL=K_e;function $_e(e){this._min=e.min,this._max=e.max,this._source=e.source}Object.defineProperties($_e.prototype,{min:{get:function(){return this._min}},max:{get:function(){return this._max}},source:{get:function(){return this._source}}});var qL=$_e;function J_e(e){this._ppeTextures=e}Object.defineProperties(J_e.prototype,{ppeTextures:{get:function(){return this._ppeTextures}}});var YL=J_e;function cs(e){e=e??H.EMPTY_OBJECT;let t=e.gltf,n=e.extension,i=e.gltfResource,r=e.baseResource,o=e.supportedImageFormats,s=e.frameState,a=e.cacheKey,c=e.asynchronous??!0;this._gltfResource=i,this._baseResource=r,this._gltf=t,this._extension=n,this._supportedImageFormats=o,this._frameState=s,this._cacheKey=a,this._asynchronous=c,this._textureLoaders=[],this._textureIds=[],this._meshPrimitiveGpmLocal=void 0,this._structuralMetadata=void 0,this._state=Tt.UNLOADED,this._promise=void 0}l(Object.create)&&(cs.prototype=Object.create(nr.prototype),cs.prototype.constructor=cs);Object.defineProperties(cs.prototype,{cacheKey:{get:function(){return this._cacheKey}},meshPrimitiveGpmLocal:{get:function(){return this._meshPrimitiveGpmLocal}},structuralMetadata:{get:function(){return this._structuralMetadata}}});cs.prototype._loadResources=async function(){try{return await this._loadTextures(),this.isDestroyed()?void 0:(this._gltf=void 0,this._state=Tt.LOADED,this)}catch(e){if(this.isDestroyed())return;throw this.unload(),this._state=Tt.FAILED,this.getError("Failed to load GPM data",e)}};cs.prototype.load=function(){return l(this._promise)?this._promise:(this._state=Tt.LOADING,this._promise=this._loadResources(this),this._promise)};function VQe(e){let t={},n=e.ppeTextures;if(l(n))for(let i=0;i<n.length;i++){let r=n[i];t[r.index]=r}return t}cs.prototype._loadTextures=function(){let e;l(this._extension)&&(e=VQe(this._extension));let t=this._gltf,n=this._gltfResource,i=this._baseResource,r=this._supportedImageFormats,o=this._frameState,s=this._asynchronous,a=[];for(let c in e)if(e.hasOwnProperty(c)){let u=Li.getTextureLoader({gltf:t,textureInfo:e[c],gltfResource:n,baseResource:i,supportedImageFormats:r,frameState:o,asynchronous:s});this._textureLoaders.push(u),this._textureIds.push(c),a.push(u.load())}return Promise.all(a)};cs.ppeTexturesMetadataSchemaCache=new Map;cs._createPpeTextureClassJson=function(e,t){let n=e.traits,i=n.source,r=e.offset??0,o=(e.scale??1)*255;return{name:`PPE texture class ${t}`,properties:{[i]:{name:"PPE",type:"SCALAR",componentType:"UINT8",normalized:!0,offset:r,scale:o,min:n.min,max:n.max}}}};cs._obtainPpeTexturesMetadataSchema=function(e){let n=cs._collectPpeTexturePropertyIdentifiers(e).toString(),i=cs.ppeTexturesMetadataSchemaCache.get(n);if(l(i))return i;let o={id:`PPE_TEXTURE_SCHEMA_${cs.ppeTexturesMetadataSchemaCache.size}`,classes:{}},s=e.ppeTextures;for(let a=0;a<s.length;a++){let c=s[a],u=`ppeTexture_${a}`,f=cs._createPpeTextureClassJson(c,a);o.classes[u]=f}return i=eu.fromJson(o),cs.ppeTexturesMetadataSchemaCache.set(n,i),i};cs._collectPpeTexturePropertyIdentifiers=function(e){let t=[],n=e.ppeTextures;for(let i=0;i<n.length;i++){let r=n[i],o=cs._createPpeTextureClassJson(r,i),s=JSON.stringify(o);t.push(s)}return t};cs._convertToStructuralMetadata=function(e,t){let n=[],i=cs._obtainPpeTexturesMetadataSchema(e),r=e.ppeTextures;for(let s=0;s<r.length;s++){let a=r[s],c=`ppeTexture_${s}`,f=a.traits.source,d=i.classes[c],p={class:c,properties:{[f]:{index:a.index,texCoord:a.texCoord}}};n.push(new Gg({id:s,name:a.name,propertyTexture:p,class:d,textures:t}))}return new Va({schema:i,propertyTables:[],propertyTextures:n,propertyAttributes:[]})};cs.prototype.process=function(e){if(this._state===Tt.READY)return!0;if(this._state!==Tt.LOADED)return!1;let t=this._textureLoaders,n=t.length,i=!0;for(let u=0;u<n;++u){let d=t[u].process(e);i=i&&d}if(!i)return!1;let r={};for(let u=0;u<this._textureIds.length;++u){let f=this._textureIds[u],d=t[u];d.isDestroyed()||(r[f]=d.texture)}let o=[],s=this._extension;if(l(s.ppeTextures)){let u=s.ppeTextures;for(let f of u){let d=f.traits,p=new qL({min:d.min,max:d.max,source:d.source}),g=new WL({traits:p,noData:f.noData,offset:f.offset,scale:f.scale,index:f.index,texCoord:f.texCoord});o.push(g)}}let a=new YL(o);this._meshPrimitiveGpmLocal=a;let c=cs._convertToStructuralMetadata(a,r);return this._structuralMetadata=c,this._state=Tt.READY,!0};cs.prototype._unloadTextures=function(){let e=this._textureLoaders,t=e.length;for(let n=0;n<t;++n)Li.unload(e[n]);this._textureLoaders.length=0,this._textureIds.length=0};cs.prototype.unload=function(){this._unloadTextures(),this._gltf=void 0,this._extension=void 0,this._structuralMetadata=void 0};var XL=cs;function jQe(e){let n=(e.extensions??H.EMPTY_OBJECT).EXT_mesh_primitive_restart,i=e.primitives;if(!l(n))return i;let r=[];Zn(r,i);for(let o of n.primitiveGroups){let s=o.primitives[0];if(!l(s)||!i[s])return i;let a={...i[s],indices:o.indices};switch(a.mode){case te.TRIANGLE_FAN:case te.TRIANGLE_STRIP:case te.LINE_STRIP:case te.LINE_LOOP:break;default:return i}for(let c of o.primitives){let u=r[c];if(!l(u?.indices)||u.mode!==a.mode)return i;r[c]=void 0}r[s]=a}return r.filter(l)}var KL=jQe;var{Attribute:HQe,Indices:GQe,FeatureIdAttribute:Q_e,FeatureIdTexture:eye,FeatureIdImplicitRange:tye,MorphTarget:WQe,Primitive:qQe,Instances:YQe,Skin:XQe,Node:KQe,AnimatedPropertyType:$Qe,AnimationSampler:JQe,AnimationTarget:ZQe,AnimationChannel:QQe,Animation:eet,ArticulationStage:tet,Articulation:net,Asset:iet,Scene:ret,Components:oet,MetallicRoughness:set,SpecularGlossiness:aet,Specular:cet,Anisotropy:SJ,Clearcoat:wJ,PlanarFill:uet,LineStyle:fet,Material:det,Vector:het,Polygon:met}=Cn,so={NOT_LOADED:0,LOADING:1,LOADED:2,PROCESSING:3,POST_PROCESSING:4,PROCESSED:5,READY:6,FAILED:7,UNLOADED:8},IJ=class extends nr{constructor(t){super(),t=t??H.EMPTY_OBJECT;let{gltfResource:n,typedArray:i,releaseGltfJson:r=!1,asynchronous:o=!0,incrementallyLoadTextures:s=!0,upAxis:a=Hi.Y,forwardAxis:c=Hi.Z,loadAttributesAsTypedArray:u=!1,loadAttributesFor2D:f=!1,enablePick:d=!1,loadIndicesForWireframe:p=!1,loadPrimitiveOutline:g=!0,loadForClassification:m=!1,renameBatchIdSemantic:y=!1}=t,{baseResource:A=n.clone()}=t;this._gltfJson=t.gltfJson,this._gltfResource=n,this._baseResource=A,this._typedArray=i,this._releaseGltfJson=r,this._asynchronous=o,this._incrementallyLoadTextures=s,this._upAxis=a,this._forwardAxis=c,this._loadAttributesAsTypedArray=u,this._loadAttributesFor2D=f,this._enablePick=d,this._loadIndicesForWireframe=p,this._loadPrimitiveOutline=g,this._loadForClassification=m,this._renameBatchIdSemantic=y,this._sortedPropertyTableIds=void 0,this._sortedFeatureTextureIds=void 0,this._gltfJsonLoader=void 0,this._state=so.NOT_LOADED,this._textureState=so.NOT_LOADED,this._promise=void 0,this._processError=void 0,this._textureErrors=[],this._primitiveLoadPlans=[],this._loaderPromises=[],this._textureLoaders=[],this._texturesPromises=[],this._textureCallbacks=[],this._bufferViewLoaders=[],this._geometryLoaders=[],this._geometryCallbacks=[],this._structuralMetadataLoader=void 0,this._meshPrimitiveGpmLoader=void 0,this._loadResourcesPromise=void 0,this._resourcesLoaded=!1,this._texturesLoaded=!1,this._supportedImageFormats=void 0,this._postProcessBuffers=[],this._components=void 0}get cacheKey(){}get components(){return this._components}get gltfJson(){return l(this._gltfJsonLoader)?this._gltfJsonLoader.gltf:this._gltfJson}get incrementallyLoadTextures(){return this._incrementallyLoadTextures}get texturesLoaded(){return this._texturesLoaded}async load(){return l(this._promise)?this._promise:(this._promise=pet(this),this._promise)}_process(t){return this._state===so.READY?!0:(this._state===so.PROCESSING&&_et(this,t),this._resourcesLoaded&&this._state===so.POST_PROCESSING&&(yet(this,t.context),this._state=so.PROCESSED),this._resourcesLoaded&&this._state===so.PROCESSED?(Z_e(this),this._typedArray=void 0,this._state=so.READY,!0):!1)}_processTextures(t){if(this._textureState===so.READY)return!0;if(this._textureState!==so.PROCESSING)return!1;let n=!0,i=this._textureLoaders;for(let r=0;r<i.length;++r){let o=i[r].process(t);o&&l(this._textureCallbacks[r])&&(this._textureCallbacks[r](),this._textureCallbacks[r]=void 0),n=n&&o}return n?(this._textureState=so.READY,this._texturesLoaded=!0,!0):!1}process(t){if(this._state===so.LOADED&&!l(this._loadResourcesPromise)&&(this._loadResourcesPromise=get(this,t).then(()=>{this._resourcesLoaded=!0}).catch(o=>{this._processError=o})),l(this._processError)){this._state=so.FAILED;let o=this._processError;this._processError=void 0,mH(this,o)}let n=this._textureErrors.pop();if(l(n)){let o=this.getError("Failed to load glTF texture",n);throw o.name="TextureError",o}if(this._state===so.FAILED)return!1;let i=!1;try{i=this._process(t)}catch(o){this._state=so.FAILED,mH(this,o)}let r=!1;try{r=this._processTextures(t)}catch(o){this._textureState=so.FAILED,mH(this,o)}return this._incrementallyLoadTextures?i:i&&r}isUnloaded(){return this._state===so.UNLOADED}unload(){l(this._gltfJsonLoader)&&!this._gltfJsonLoader.isDestroyed()&&Li.unload(this._gltfJsonLoader),this._gltfJsonLoader=void 0,Rtt(this),Z_e(this),Ott(this),Mtt(this),Ntt(this),Ltt(this),this._components=void 0,this._typedArray=void 0,this._state=so.UNLOADED}};async function pet(e){e._state=so.LOADING,e._textureState=so.LOADING;try{let t=Li.getGltfJsonLoader({gltfResource:e._gltfResource,baseResource:e._baseResource,typedArray:e._typedArray,gltfJson:e._gltfJson});return e._gltfJsonLoader=t,await t.load(),e.isDestroyed()||e.isUnloaded()||t.isDestroyed()?void 0:(e._state=so.LOADED,e._textureState=so.LOADED,e)}catch(t){if(e.isDestroyed())return;e._state=so.FAILED,e._textureState=so.FAILED,mH(e,t)}}async function get(e,t){dn.supportsWebP.initialized||await dn.supportsWebP.initialize(),e._supportedImageFormats=new UL({webp:dn.supportsWebP(),basis:t.context.supportsBasis});let n=Dtt(e,t);return e._state=so.PROCESSING,e._textureState=so.PROCESSING,l(e._gltfJsonLoader)&&e._releaseGltfJson&&(Li.unload(e._gltfJsonLoader),e._gltfJsonLoader=void 0),n}function mH(e,t){throw e.unload(),e.getError("Failed to load glTF",t)}function _et(e,t){let n=!0,i=e._geometryLoaders;for(let s=0;s<i.length;++s){let a=i[s].process(t);a&&l(e._geometryCallbacks[s])&&(e._geometryCallbacks[s](),e._geometryCallbacks[s]=void 0),n=n&&a}let r=e._structuralMetadataLoader;if(l(r)){let s=r.process(t);s&&(e._components.structuralMetadata=r.structuralMetadata),n=n&&s}let o=e._meshPrimitiveGpmLoader;if(l(o)){let s=o.process(t);s&&(l(e._components.structuralMetadata)&&_t("structural-metadata-gpm","The model defines both the 'EXT_structural_metadata' extension and the 'NGA_gpm_local' extension. The data from the 'EXT_structural_metadata' extension will be replaced with the data from the 'NGA_gpm_local' extension, and will no longer be available for styling and picking."),e._components.structuralMetadata=o.structuralMetadata),n=n&&s}n&&(e._state=so.POST_PROCESSING)}function yet(e,t){let n=e._primitiveLoadPlans;for(let i=0;i<n.length;i++){let r=n[i];r.postProcess(t),(r.needsOutlines||r.needsGaussianSplats)&&Aet(e,r)}}function Aet(e,t){let n=e._postProcessBuffers,i=t.primitive,r=i.outlineCoordinates;l(r)&&n.push(r.buffer);let o=i.attributes;for(let a=0;a<o.length;a++){let c=o[a];l(c.buffer)&&n.push(c.buffer)}let s=i.indices;l(s)&&l(s.buffer)&&n.push(s.buffer)}function bet(e,t,n,i,r,o,s,a,c){let u=e.gltfJson,d=u.accessors[t].bufferView;return Li.getVertexBufferLoader({gltf:u,gltfResource:e._gltfResource,baseResource:e._baseResource,frameState:c,bufferViewId:d,primitive:i,draco:r,spz:o,attributeSemantic:n,accessorId:t,asynchronous:e._asynchronous,loadBuffer:s,loadTypedArray:a})}function xet(e,t,n,i,r,o,s){return Li.getIndexBufferLoader({gltf:e.gltfJson,accessorId:t,gltfResource:e._gltfResource,baseResource:e._baseResource,frameState:s,primitive:n,draco:i,asynchronous:e._asynchronous,loadBuffer:r,loadTypedArray:o})}function nye(e,t){let n=Li.getBufferViewLoader({gltf:e.gltfJson,bufferViewId:t,gltfResource:e._gltfResource,baseResource:e._baseResource});return e._bufferViewLoaders.push(n),n}function PJ(e,t,n){let i=t.byteOffset,r=ju(e,t),o=t.count,s=Nf(t.type),a=t.componentType,c=Y.getSizeInBytes(a),u=c*s,f=o*s;if(r===u)return n=new Uint8Array(n),Y.createArrayBufferView(a,n.buffer,n.byteOffset+i,f);let d=Y.createTypedArray(a,f),p=new DataView(n.buffer),g=new Array(s),m=kg(t.componentType);i=n.byteOffset+i;for(let y=0;y<o;++y){m(p,i,s,c,g);for(let A=0;A<s;++A)d[y*s+A]=g[A];i+=r}return d}function Tet(e,t){let n=e.type;if(n===Vt.SCALAR)return t.fill(0);let i=Vt.getMathType(n);return t.fill(i.clone(i.ZERO))}function Eet(e,t,n,i){let r=e.type,o=e.count;if(r===Vt.SCALAR)for(let s=0;s<o;s++)n[s]=t[s];else if(r===Vt.VEC4&&i)for(let s=0;s<o;s++)n[s]=Le.unpack(t,s*4);else{let s=Vt.getMathType(r),a=Vt.getNumberOfComponents(r);for(let c=0;c<o;c++)n[c]=s.unpack(t,c*a)}return n}async function Cet(e,t,n,i,r){let{gltfJson:o}=e;if(await t.load(),e.isDestroyed())return;let s=PJ(o,n,t.typedArray);i=i??!1,Eet(n,s,r,i)}function $L(e,t,n){let i=new Array(t.count),r=t.bufferView;if(l(r)){let o=nye(e,r),s=Cet(e,o,t,n,i);return e._loaderPromises.push(s),i}return Tet(t,i)}function dm(e,t){let n=Y.createTypedArray(t.componentType,t.count*Vt.getNumberOfComponents(t.type));if(!l(t.bufferView))return n;let i=nye(e,t.bufferView),{gltfJson:r}=e,o=i.load().then(()=>{if(e.isDestroyed())return;let s=PJ(r,t,i.typedArray);n.set(s)});return e._loaderPromises.push(o),n}function Wu(e,t){if(l(t))return e===Number?t[0]:e.unpack(t)}function vet(e){return e===Number?0:new e}function wet(e){switch(e){case Y.BYTE:return 127;case Y.UNSIGNED_BYTE:return 255;case Y.SHORT:return 32767;case Y.UNSIGNED_SHORT:return 65535;default:return 1}}var Iet={VEC2:new U(-1,-1),VEC3:new h(-1,-1,-1),VEC4:new se(-1,-1,-1,-1)};function Pet(e,t){let n=wet(e.componentDatatype),i=Iet[e.type],r=e.min;l(r)&&(r=t.divideByScalar(r,n,r),r=t.maximumByComponent(r,i,r));let o=e.max;l(o)&&(o=t.divideByScalar(o,n,o),o=t.maximumByComponent(o,i,o)),e.min=r,e.max=o}function Det(e,t,n){let i=e.decodeMatrix,r=Wu(n,e.decodedMin),o=Wu(n,e.decodedMax);l(r)&&l(o)&&(t.min=r,t.max=o);let s=new Cn.Quantization;s.componentDatatype=t.componentDatatype,s.type=t.type,i.length===4?(s.quantizedVolumeOffset=i[2],s.quantizedVolumeStepSize=i[0]):i.length===9?(s.quantizedVolumeOffset=new U(i[6],i[7]),s.quantizedVolumeStepSize=new U(i[0],i[4])):i.length===16?(s.quantizedVolumeOffset=new h(i[12],i[13],i[14]),s.quantizedVolumeStepSize=new h(i[0],i[5],i[10])):i.length===25&&(s.quantizedVolumeOffset=new se(i[20],i[21],i[22],i[23]),s.quantizedVolumeStepSize=new se(i[0],i[6],i[12],i[18])),t.quantization=s}function Ret(e,t,n,i,r){let o=e.accessors[t],s=Vt.getMathType(o.type),a=o.normalized??!1,c=new HQe;c.name=n,c.semantic=i,c.setIndex=r,c.constant=vet(s),c.componentDatatype=o.componentType,c.normalized=a,c.count=o.count,c.type=o.type,c.min=Wu(s,o.min),c.max=Wu(s,o.max),c.byteOffset=o.byteOffset,c.byteStride=ju(e,o),tr(o,"WEB3D_quantized_attributes")&&Det(o.extensions.WEB3D_quantized_attributes,c,s);let u=c.semantic===ct.POSITION||c.semantic===ct.NORMAL||c.semantic===ct.TANGENT||c.semantic===ct.TEXCOORD||c.semantic===ct.FEATURE_ID||c.semantic===ct.SCALE||c.semantic===ct.ROTATION;return e.extensionsRequired?.includes("KHR_mesh_quantization")&&a&&u&&Pet(c,s),c}function iye(e){let n=/^\w+_(\d+)$/.exec(e);if(n!==null)return parseInt(n[1])}var Oet={gltfSemantic:void 0,renamedSemantic:void 0,modelSemantic:void 0};function DJ(e,t,n){let i=n;e._renameBatchIdSemantic&&(n==="_BATCHID"||n==="BATCHID")&&(i="_FEATURE_ID_0");let r=t.fromGltfSemantic(i),o=Oet;return o.gltfSemantic=n,o.renamedSemantic=i,o.modelSemantic=r,o}function Met(e){let t=e===ct.POSITION,n=e===ct.FEATURE_ID,i=e===ct.TEXCOORD;return t||n||i}function Net(e,t,n,i){if(e.byteOffset=0,e.byteStride=void 0,e.quantization=t.quantization,n&&(e.buffer=t.buffer),i){let r=l(t.quantization)?t.quantization.componentDatatype:e.componentDatatype;e.typedArray=Y.createArrayBufferView(r,t.typedArray.buffer)}}function Let(e,t,n,i){if(e.byteOffset=0,e.byteStride=void 0,n&&(e.buffer=t.buffer),i&&l(t.typedArray)&&(e.typedArray=Y.createArrayBufferView(e.componentDatatype,t.typedArray.buffer)),e.semantic===ct.POSITION){let r=s=>{let a=1/0,c=-1/0,u=1/0,f=-1/0,d=1/0,p=-1/0;for(let g=0;g<s.length;g+=3){let m=s[g],y=s[g+1],A=s[g+2];a=Math.min(a,m),c=Math.max(c,m),u=Math.min(u,y),f=Math.max(f,y),d=Math.min(d,A),p=Math.max(p,A)}return[new h(a,u,d),new h(c,f,p)]},o=e.typedArray;[e.min,e.max]=r(o)}}function Fet(e,t,n,i,r,o){if(r&&(n.buffer=i.buffer),o){let s=i.typedArray;n.typedArray=PJ(e,t,s),r||(n.byteOffset=0,n.byteStride=void 0)}}function rye(e,t,n,i,r,o,s,a,c){let u=e.gltfJson,f=u.accessors[t],d=f.bufferView,p=n.gltfSemantic,g=n.renamedSemantic,m=n.modelSemantic,y=l(m)?iye(g):void 0,b=Ret(u,t,p,m,y);if(!l(r)&&!l(d)&&!l(o))return b;let x=bet(e,t,p,i,r,o,s,a,c),T=e._geometryLoaders.length;e._geometryLoaders.push(x);let E=x.load();return e._loaderPromises.push(E),e._geometryCallbacks[T]=()=>{l(r)&&l(r.attributes)&&l(r.attributes[p])?Net(b,x,s,a):l(o)?Let(b,x,s,a):Fet(u,f,b,x,s,a)},b}function oye(e,t,n,i,r,o,s,a,c){let u=n.modelSemantic,f=u===ct.POSITION,d=u===ct.FEATURE_ID,p=f&&!s&&e._loadAttributesFor2D&&!c.scene3DOnly,g=f&&e._enablePick&&!c.context.webgl2,m=e._loadForClassification&&d,y=e._loadAttributesAsTypedArray,A=!y,b=y||p||g||m,E=rye(e,t,n,i,r,o,a?!1:A,a?!0:b,c),v=new _T.AttributeLoadPlan(E);return v.loadBuffer=A,v.loadTypedArray=b,v}function Bet(e,t,n,i,r){let o=e.gltfJson.accessors,s=l(n.ROTATION),a=l(n.TRANSLATION)&&l(o[n.TRANSLATION].min)&&l(o[n.TRANSLATION].max),c=DJ(e,No,i),u=c.modelSemantic,f=u===No.TRANSLATION||u===No.ROTATION||u===No.SCALE,d=u===No.TRANSLATION,p=e._loadAttributesAsTypedArray||s&&f||!r.context.instancedArrays,g=e._enablePick&&!r.context.webgl2,m=!p,y=e._loadAttributesFor2D&&!r.scene3DOnly;return rye(e,t,c,void 0,void 0,void 0,m,p||d&&(!a||y||g),r)}function ket(e,t,n,i,r,o){let s=e.gltfJson.accessors[t],a=s.bufferView,c=n.extensions??H.EMPTY_OBJECT,u=c.KHR_draco_mesh_compression,f=l(c.EXT_mesh_primitive_edge_visibility);if(!l(u)&&!l(a))return;let d=new GQe;d.count=s.count;let p=e._loadAttributesAsTypedArray,g=(e._loadIndicesForWireframe||e._enablePick)&&!o.context.webgl2,m=e._loadForClassification&&i,A=!p,b=p||g||m||f,E=xet(e,t,n,u,r?!1:A,r?!0:b,o),v=e._geometryLoaders.length;e._geometryLoaders.push(E);let S=E.load();e._loaderPromises.push(S),e._geometryCallbacks[v]=()=>{d.indexDatatype=E.indexDatatype,d.buffer=E.buffer,d.typedArray=E.typedArray};let I=new _T.IndicesLoadPlan(d);return I.loadBuffer=A,I.loadTypedArray=b,I}function Uet(e,t,n){return new jt({wrapR:e.wrapR,wrapS:e.wrapS,wrapT:e.wrapT,minificationFilter:t??e.minificationFilter,magnificationFilter:n??e.magnificationFilter,maximumAnisotropy:e.maximumAnisotropy})}function ru(e,t,n,i,r){let o=e.gltfJson,s=Hu.getImageIdFromTexture({gltf:o,textureId:t.index,supportedImageFormats:e._supportedImageFormats});if(!l(s))return;let a=Li.getTextureLoader({gltf:o,textureInfo:t,gltfResource:e._gltfResource,baseResource:e._baseResource,supportedImageFormats:e._supportedImageFormats,frameState:n,asynchronous:e._asynchronous}),c=Hu.createModelTextureReader({textureInfo:t}),u=e._textureLoaders.length;e._textureLoaders.push(a);let f=a.load().catch(d=>{if(!e.isDestroyed()){if(!e._incrementallyLoadTextures)throw d;e._textureState=so.FAILED,e._textureErrors.push(d)}});return e._texturesPromises.push(f),e._textureCallbacks[u]=()=>{let d=a.texture;c.texture=d,(l(i)||l(r))&&(d.sampler=Uet(d.sampler,i,r))},c}function zet(e,t,n){let{diffuseTexture:i,specularGlossinessTexture:r,diffuseFactor:o,specularFactor:s,glossinessFactor:a}=t,c=new aet;return l(i)&&(c.diffuseTexture=ru(e,i,n)),l(r)&&(c.specularGlossinessTexture=ru(e,r,n)),c.diffuseFactor=Wu(se,o),c.specularFactor=Wu(h,s),c.glossinessFactor=a,c}function Vet(e,t,n){let{baseColorTexture:i,metallicRoughnessTexture:r,baseColorFactor:o,metallicFactor:s,roughnessFactor:a}=t,c=new set;return l(i)&&(c.baseColorTexture=ru(e,i,n)),l(r)&&(c.metallicRoughnessTexture=ru(e,r,n)),c.baseColorFactor=Wu(se,o),c.metallicFactor=s,c.roughnessFactor=a,c}function jet(e,t,n){let{specularFactor:i,specularTexture:r,specularColorFactor:o,specularColorTexture:s}=t,a=new cet;return l(r)&&(a.specularTexture=ru(e,r,n)),l(s)&&(a.specularColorTexture=ru(e,s,n)),a.specularFactor=i,a.specularColorFactor=Wu(h,o),a}function Het(e,t,n){let{anisotropyStrength:i=SJ.DEFAULT_ANISOTROPY_STRENGTH,anisotropyRotation:r=SJ.DEFAULT_ANISOTROPY_ROTATION,anisotropyTexture:o}=t,s=new SJ;return l(o)&&(s.anisotropyTexture=ru(e,o,n)),s.anisotropyStrength=i,s.anisotropyRotation=r,s}function Get(e,t,n){let{clearcoatFactor:i=wJ.DEFAULT_CLEARCOAT_FACTOR,clearcoatTexture:r,clearcoatRoughnessFactor:o=wJ.DEFAULT_CLEARCOAT_ROUGHNESS_FACTOR,clearcoatRoughnessTexture:s,clearcoatNormalTexture:a}=t,c=new wJ;return l(r)&&(c.clearcoatTexture=ru(e,r,n)),l(s)&&(c.clearcoatRoughnessTexture=ru(e,s,n)),l(a)&&(c.clearcoatNormalTexture=ru(e,a,n)),c.clearcoatFactor=i,c.clearcoatRoughnessFactor=o,c}function Wet(e){return new uet(e)}function qet(e){if(!l(e))return;let t=new fet;if(l(e.width)){let n=e.width;n>0&&Math.floor(n)===n&&(t.width=n)}if(l(e.pattern)){let n=e.pattern;n>=0&&n<=65535&&Math.floor(n)===n&&(t.pattern=n)}if(!(!l(t.width)&&!l(t.pattern)))return t}function Yet(e,t,n){let i=new det,r=t.extensions??H.EMPTY_OBJECT,o=r.KHR_materials_pbrSpecularGlossiness,s=r.KHR_materials_specular,a=r.KHR_materials_anisotropy,c=r.KHR_materials_clearcoat,u=t.pbrMetallicRoughness,f=r.BENTLEY_materials_planar_fill;i.unlit=l(r.KHR_materials_unlit),l(o)?i.specularGlossiness=zet(e,o,n):(l(u)&&(i.metallicRoughness=Vet(e,u,n)),l(s)&&!i.unlit&&(i.specular=jet(e,s,n)),l(a)&&!i.unlit&&(i.anisotropy=Het(e,a,n)),l(c)&&!i.unlit&&(i.clearcoat=Get(e,c,n))),l(t.emissiveTexture)&&(i.emissiveTexture=ru(e,t.emissiveTexture,n)),l(t.normalTexture)&&!e._loadForClassification&&(i.normalTexture=ru(e,t.normalTexture,n)),l(t.occlusionTexture)&&(i.occlusionTexture=ru(e,t.occlusionTexture,n)),i.emissiveFactor=Wu(h,t.emissiveFactor),i.alphaMode=t.alphaMode,i.alphaCutoff=t.alphaCutoff,i.doubleSided=t.doubleSided,l(f)&&(i.planarFill=Wet(f));let d=r.BENTLEY_materials_point_style;if(l(d)&&l(d.diameter)){let p=d.diameter;p>=1&&(i.pointDiameter=Math.floor(p))}return i.lineStyle=qet(r.BENTLEY_materials_line_style),i}function sye(e,t){let n=new Q_e;return n.featureCount=e.featureCount,n.nullFeatureId=e.nullFeatureId,n.propertyTableId=e.propertyTable,n.setIndex=e.attribute,n.label=e.label,n.positionalLabel=t,n}function aye(e,t,n,i){let r=new Q_e,o=e.featureIds;return r.featureCount=n,r.propertyTableId=t,r.setIndex=iye(o.attribute),r.positionalLabel=i,r}function cye(e,t){let n=new tye;return n.propertyTableId=e.propertyTable,n.featureCount=e.featureCount,n.nullFeatureId=e.nullFeatureId,n.label=e.label,n.positionalLabel=t,n.offset=0,n.repeat=1,n}function lye(e,t,n,i){let r=new tye,o=e.featureIds;r.propertyTableId=t,r.featureCount=n,r.offset=o.constant??0;let s=o.divisor??0;return r.repeat=s===0?void 0:s,r.positionalLabel=i,r}function Xet(e,t,n,i){let r=new eye;r.featureCount=t.featureCount,r.nullFeatureId=t.nullFeatureId,r.propertyTableId=t.propertyTable,r.label=t.label,r.positionalLabel=i;let o=t.texture;r.textureReader=ru(e,o,n,Wt.NEAREST,Jn.NEAREST);let a=(l(o.channels)?o.channels:[0]).map(function(c){return"rgba".charAt(c)}).join("");return r.textureReader.channels=a,r}function Ket(e,t,n,i,r,o){let s=new eye,a=t.featureIds,c=a.texture;return s.featureCount=r,s.propertyTableId=n,s.textureReader=ru(e,c,i,Wt.NEAREST,Jn.NEAREST),s.textureReader.channels=a.channels,s.positionalLabel=o,s}function $et(e,t,n,i,r){let o=new WQe,s=void 0,a=void 0,c=void 0,u=!1;for(let f in t){if(!t.hasOwnProperty(f))continue;let d=t[f],p=DJ(e,ct,f),g=oye(e,d,p,s,a,c,u,n,r);o.attributes.push(g.attribute),i.attributePlans.push(g)}return o}function Jet(e){let i=e?.KHR_gaussian_splatting?.extensions?.KHR_gaussian_splatting_compression_spz_2;if(l(i))return i}function uye(e,t){if(!l(t))return;let n=e.gltfJson.materials;if(!l(n)||t<0||t>=n.length)return;let i=n[t];if(!l(i))return;let r=i.pbrMetallicRoughness??H.EMPTY_OBJECT,o=Wu(se,r.baseColorFactor);return l(o)?o:new se(1,1,1,1)}function Zet(e){switch(e){case Y.UNSIGNED_BYTE:return 255;case Y.UNSIGNED_SHORT:return 65535;case Y.UNSIGNED_INT:return 4294967295;default:throw new oe("EXT_mesh_primitive_edge_visibility line strings indices must use unsigned scalar component types.")}}function Qet(e,t,n){if(!l(t)||t.length===0)return;let i=new Array(t.length);for(let r=0;r<t.length;r++){let o=t[r]??H.EMPTY_OBJECT,s=o.indices,a=e.gltfJson.accessors[s];if(!l(a))throw new oe("Edge visibility line string accessor not found!");let c=dm(e,a),u=Zet(a.componentType),f=l(o.material)?o.material:n;i[r]={indices:c,restartIndex:u,componentType:a.componentType,materialColor:uye(e,f)}}return i}function ett(e,t){if(!l(t))return;let n={},i=t.visibility;if(l(i)){let r=e.gltfJson.accessors[i];if(!l(r))throw new oe("Edge visibility accessor not found!");n.visibility=dm(e,r)}if(n.materialColor=uye(e,t.material),l(t.silhouetteNormals)){let r=e.gltfJson.accessors[t.silhouetteNormals];l(r)&&(n.silhouetteNormals=dm(e,r))}return l(t.lineStrings)&&(n.lineStrings=Qet(e,t.lineStrings,t.material)),n}function ttt(e,t,n,i){let r=new qQe,o=new _T(r);e._primitiveLoadPlans.push(o);let s=t.material;l(s)&&(r.material=Yet(e,e.gltfJson.materials[s],i));let a=t.extensions??H.EMPTY_OBJECT,c=a.EXT_mesh_polygon;l(c)&&(r.polygon=itt(e,t,c));let u=a.CESIUM_mesh_vector;l(u)&&(r.vector=rtt(e,u));let f=!1,d=a.CESIUM_primitive_outline;e._loadPrimitiveOutline&&l(d)&&(f=!0,o.needsOutlines=!0,o.outlineIndices=ntt(e,d,o)),r.edgeVisibility=ett(e,a.EXT_mesh_primitive_edge_visibility);let p=Jet(a);l(p)&&(f=!0,o.needsGaussianSplats=!0);let g=e._loadForClassification,m=a.KHR_draco_mesh_compression,y=!1,A=t.attributes;if(l(A))for(let O in A){if(!A.hasOwnProperty(O))continue;let L=A[O],_=DJ(e,ct,O),C=_.modelSemantic;if(g&&!Met(C))continue;C===ct.FEATURE_ID&&(y=!0);let w=oye(e,L,_,t,m,p,n,f,i);o.attributePlans.push(w),r.attributes.push(w.attribute)}let b=t.targets;if(l(b)&&!g)for(let O=0;O<b.length;++O)r.morphTargets.push($et(e,b[O],f,o,i));let x=t.indices;if(l(x)){let O=ket(e,x,t,y,f,i);l(O)&&(o.indicesPlan=O,r.indices=O.indices)}let T=a.EXT_structural_metadata,E=a.EXT_mesh_features,v=a.EXT_feature_metadata,S=l(v),I=a.NGA_gpm_local;l(E)?ott(e,r,E,i):S&&stt(e,r,v,i),l(T)?att(r,T):S&&ctt(e,r,v),l(I)&<t(r,I);let R=t.mode;if(g&&R!==Oe.TRIANGLES)throw new oe("Only triangle meshes can be used for classification.");return r.primitiveType=R,r}function ntt(e,t){let n=t.indices,i=e.gltfJson.accessors[n];return $L(e,i,!1)}function itt(e,t,n){let i=new met,r=e.gltfJson.accessors;return i.count=n.count,t.mode===Oe.LINE_LOOP?(i.loopIndices=dm(e,r[t.indices]),i.loopIndicesOffsets=dm(e,r[n.indicesOffsets]),i.triangleIndices=dm(e,r[n.triangleIndices]),i.triangleIndicesOffsets=dm(e,r[n.triangleIndicesOffsets])):t.mode===Oe.TRIANGLES&&(i.loopIndices=dm(e,r[n.loopIndices]),i.loopIndicesOffsets=dm(e,r[n.loopIndicesOffsets]),i.triangleIndices=dm(e,r[t.indices]),i.triangleIndicesOffsets=dm(e,r[n.indicesOffsets])),i}function rtt(e,t){if(!l(t))return;let n=new het;n.vector=t.vector,n.count=t.count;let i=e.gltfJson.accessors;function r(o,s){if(l(o))return $L(e,i[o])}return n.polygonAttributeOffsets=r(t.polygonAttributeOffsets,"polygonAttributeOffsets"),n.polygonHoleCounts=r(t.polygonHoleCounts,"polygonHoleCounts"),n.polygonHoleOffsets=r(t.polygonHoleOffsets,"polygonHoleOffsets"),n.polygonIndicesOffsets=r(t.polygonIndicesOffsets,"polygonIndicesOffsets"),n}function ott(e,t,n,i){let r;l(n)&&l(n.featureIds)?r=n.featureIds:r=[];for(let o=0;o<r.length;o++){let s=r[o],a=`featureId_${o}`,c;l(s.texture)?c=Xet(e,s,i,a):l(s.attribute)?c=sye(s,a):c=cye(s,a),t.featureIds.push(c)}}function stt(e,t,n,i){let{featureTables:r}=e.gltfJson.extensions.EXT_feature_metadata,o=0,s=n.featureIdAttributes;if(l(s))for(let c=0;c<s.length;++c){let u=s[c],f=u.featureTable,d=e._sortedPropertyTableIds.indexOf(f),p=r[f].count,g=`featureId_${o}`;o++;let m;l(u.featureIds.attribute)?m=aye(u,d,p,g):m=lye(u,d,p,g),t.featureIds.push(m)}let a=n.featureIdTextures;if(l(a))for(let c=0;c<a.length;++c){let u=a[c],f=u.featureTable,d=e._sortedPropertyTableIds.indexOf(f),p=r[f].count,g=`featureId_${o}`;o++;let m=Ket(e,u,d,i,p,g);t.featureIds.push(m)}}function att(e,t){if(!l(t))return;let{propertyTextures:n,propertyAttributes:i}=t;l(n)&&(e.propertyTextureIds=n),l(i)&&(e.propertyAttributeIds=i)}function ctt(e,t,n){l(n.featureTextures)&&(t.propertyTextureIds=n.featureTextures.map(function(i){return e._sortedFeatureTextureIds.indexOf(i)}))}function ltt(e,t){let n=t.ppeTextures??[];for(let i=0;i<n.length;i++)e.propertyTextureIds.push(i)}function utt(e,t,n){let i=t.EXT_mesh_gpu_instancing,r=new YQe,o=i.attributes;if(l(o))for(let u in o){if(!o.hasOwnProperty(u))continue;let f=o[u];r.attributes.push(Bet(e,f,o,u,n))}let s=i.extensions??H.EMPTY_OBJECT,a=t.EXT_instance_features,c=s.EXT_feature_metadata;return l(a)?ftt(r,a):l(c)&&dtt(e.gltfJson,r,c,e._sortedPropertyTableIds),r}function ftt(e,t){let n=t.featureIds;for(let i=0;i<n.length;i++){let r=n[i],o=`instanceFeatureId_${i}`,s;l(r.attribute)?s=sye(r,o):s=cye(r,o),e.featureIds.push(s)}}function dtt(e,t,n,i){let r=e.extensions.EXT_feature_metadata.featureTables,o=n.featureIdAttributes;if(l(o))for(let s=0;s<o.length;++s){let a=o[s],c=a.featureTable,u=i.indexOf(c),f=r[c].count,d=`instanceFeatureId_${s}`,p;l(a.featureIds.attribute)?p=aye(a,u,f,d):p=lye(a,u,f,d),t.featureIds.push(p)}}function htt(e,t,n){let i=new KQe;i.name=t.name,i.matrix=Wu(N,t.matrix),i.translation=Wu(h,t.translation),i.rotation=Wu(Le,t.rotation),i.scale=Wu(h,t.scale);let r=t.extensions??H.EMPTY_OBJECT,o=r.EXT_mesh_gpu_instancing,s=r.AGI_articulations,a=r.CESIUM_mesh_vector;if(l(o)){if(e._loadForClassification)throw new oe("Models with the EXT_mesh_gpu_instancing extension cannot be used for classification.");i.instances=utt(e,r,n)}l(s)&&(i.articulationName=s.articulationName),l(a)&&(i.meshVector=a);let c=t.mesh;if(l(c)){let u=e.gltfJson.meshes[c],f=KL(u);for(let g=0;g<f.length;++g)i.primitives.push(ttt(e,f[g],l(i.instances),n));let d=t.weights??u.weights,p=i.primitives[0].morphTargets;i.morphWeights=l(d)?d.slice():new Array(p.length).fill(0)}return i}function mtt(e,t){let n=e.gltfJson.nodes;if(!l(n))return[];let i=n.map(function(r,o){let s=htt(e,r,t);return s.index=o,s});for(let r=0;r<i.length;++r){let o=n[r].children;if(l(o))for(let s=0;s<o.length;++s)i[r].children.push(i[o[s]])}return i}function ptt(e,t,n){let i=new XQe,r=t.joints;i.joints=r.map(s=>n[s]);let o=t.inverseBindMatrices;if(l(o)){let s=e.gltfJson.accessors[o];i.inverseBindMatrices=$L(e,s)}else i.inverseBindMatrices=new Array(r.length).fill(N.IDENTITY);return i}function gtt(e,t){let n=e.gltfJson.skins;if(e._loadForClassification||!l(n))return[];let i=n.map(function(o,s){let a=ptt(e,o,t);return a.index=s,a}),r=e.gltfJson.nodes;for(let o=0;o<t.length;++o){let s=r[o].skin;l(s)&&(t[o].skin=i[s])}return i}async function _tt(e,t,n,i){let r=new kL({gltf:e.gltfJson,extension:t,extensionLegacy:n,gltfResource:e._gltfResource,baseResource:e._baseResource,supportedImageFormats:e._supportedImageFormats,frameState:i,asynchronous:e._asynchronous});return e._structuralMetadataLoader=r,r.load()}async function ytt(e,t,n,i){let r=new XL({gltf:t,extension:n,gltfResource:e._gltfResource,baseResource:e._baseResource,supportedImageFormats:e._supportedImageFormats,frameState:i,asynchronous:e._asynchronous});return e._meshPrimitiveGpmLoader=r,r.load()}function Att(e,t){let n=new JQe,i=e.gltfJson.accessors,r=i[t.input];n.input=$L(e,r);let o=t.interpolation;n.interpolation=fm[o]??fm.LINEAR;let s=i[t.output];return n.output=$L(e,s,!0),n}function btt(e,t){let n=new ZQe,i=e.node;if(!l(i))return;n.node=t[i];let r=e.path.toUpperCase();return n.path=$Qe[r],n}function xtt(e,t,n){let i=new QQe,r=e.sampler;return i.sampler=t[r],i.target=btt(e.target,n),i}function Ttt(e,t,n){let i=new eet;i.name=t.name;let r=t.samplers.map(function(s,a){let c=Att(e,s);return c.index=a,c}),o=t.channels.map(function(s){return xtt(s,r,n)});return i.samplers=r,i.channels=o,i}function Ett(e,t){let n=e.gltfJson.animations;return e._loadForClassification||!l(n)?[]:n.map(function(r,o){let s=Ttt(e,r,t);return s.index=o,s})}function Ctt(e){let t=new tet;t.name=e.name;let n=e.type.toUpperCase();return t.type=ul[n],t.minimumValue=e.minimumValue,t.maximumValue=e.maximumValue,t.initialValue=e.initialValue,t}function vtt(e){let t=new net;return t.name=e.name,t.stages=e.stages.map(Ctt),t}function Stt(e){let n=(e.extensions??H.EMPTY_OBJECT).AGI_articulations?.articulations;return l(n)?n.map(vtt):[]}function wtt(e){let t;return l(e.scenes)&&l(e.scene)&&(t=e.scenes[e.scene].nodes),t=t??e.nodes,t=l(t)?t:[],t}function Itt(e,t){let n=new ret,i=wtt(e);return n.nodes=i.map(function(r){return t[r]}),n}var Ptt=new h;function Dtt(e,t){let n=e.gltfJson,i=n.extensions??H.EMPTY_OBJECT,r=i.EXT_structural_metadata,o=i.EXT_feature_metadata,s=i.CESIUM_RTC;if(l(o)){let x=o.featureTables,T=o.featureTextures,E=l(x)?x:[],v=l(T)?T:[];e._sortedPropertyTableIds=Object.keys(E).sort(),e._sortedFeatureTextureIds=Object.keys(v).sort()}let a=mtt(e,t),c=gtt(e,a),u=Ett(e,a),f=Stt(n),d=Itt(n,a),p=new oet,g=new iet,m=n.asset.copyright;if(l(m)){let x=m.split(";").map(function(T){return new It(T.trim())});g.credits=x}if(p.asset=g,p.scene=d,p.nodes=a,p.skins=c,p.animations=u,p.articulations=f,p.upAxis=e._upAxis,p.forwardAxis=e._forwardAxis,l(s)){let x=h.fromArray(s.center,0,Ptt);p.transform=N.fromTranslation(x,p.transform)}if(e._components=p,l(r)||l(o)){let x=_tt(e,r,o,t);e._loaderPromises.push(x)}let y=i.NGA_gpm_local;if(l(y)){let x=GL.load(y);e._components.extensions.NGA_gpm_local=x}let A=n.meshes;if(l(A))for(let x of A){let T=x.primitives;if(l(T))for(let E of T){let v=E.extensions;if(l(v)){let S=v.NGA_gpm_local;if(l(S)){let I=ytt(e,n,S,t);e._loaderPromises.push(I)}}}}let b=[];return Zn(b,e._loaderPromises),e._incrementallyLoadTextures||Zn(b,e._texturesPromises),Promise.all(b)}function Rtt(e){let t=e._textureLoaders;for(let n=0;n<t.length;++n)t[n]=!t[n].isDestroyed()&&Li.unload(t[n]);e._textureLoaders.length=0}function Z_e(e){let t=e._bufferViewLoaders;for(let n=0;n<t.length;++n)t[n]=!t[n].isDestroyed()&&Li.unload(t[n]);e._bufferViewLoaders.length=0}function Ott(e){let t=e._geometryLoaders;for(let n=0;n<t.length;++n)t[n]=!t[n].isDestroyed()&&Li.unload(t[n]);e._geometryLoaders.length=0}function Mtt(e){let t=e._postProcessBuffers;for(let n=0;n<t.length;n++){let i=t[n];i.isDestroyed()||i.destroy()}t.length=0}function Ntt(e){l(e._structuralMetadataLoader)&&!e._structuralMetadataLoader.isDestroyed()&&(e._structuralMetadataLoader.destroy(),e._structuralMetadataLoader=void 0)}function Ltt(e){l(e._meshPrimitiveGpmLoader)&&!e._meshPrimitiveGpmLoader.isDestroyed()&&(e._meshPrimitiveGpmLoader.destroy(),e._meshPrimitiveGpmLoader=void 0)}var Bf=IJ;var JL=`uniform sampler2D u_pointCloud_colorGBuffer; +2\0\0\0f\0\x004v\0A\xA4\xCD\v\0A\xB4\xCD\v\b\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\0A\xF8\xCD\vhf`)),ce((await B(ne)).instance))})(),(function(){function ce(){var ne;if(o.calledRun=!0,!m){if(C=!0,vy.H(),A?.(o),(ne=o.onRuntimeInitialized)==null||ne.call(o),o.postRun)for(typeof o.postRun=="function"&&(o.postRun=[o.postRun]);o.postRun.length;){var Te=o.postRun.shift();k.push(Te)}j(k)}}if(o.preRun)for(typeof o.preRun=="function"&&(o.preRun=[o.preRun]);o.preRun.length;)q();j(G),o.setStatus?(o.setStatus("Running..."),setTimeout(()=>{setTimeout(()=>o.setStatus(""),1),ce()},1)):ce()})(),C?r=o:r=new Promise((ce,ne)=>{A=ce,b=ne}),r}var $S=(e,t,n)=>{let i=e.vf32_ptr(t),r=t.size(),o=i>>2,s=e.HEAPF32.slice(o,o+r);if(n!==void 0)for(let a=0;a<r;a++)s[a]=n(s[a]);return s},hnt=e=>1/(1+Math.exp(-e)),mnt=e=>t=>t*e+.5,pnt=(e,t,n)=>{let i=n?.colorScaleFactor??.282;return{numPoints:t.numPoints,shDegree:t.shDegree,antialiased:t.antialiased,positions:$S(e,t.positions),scales:$S(e,t.scales,Math.exp),rotations:$S(e,t.rotations),alphas:$S(e,t.alphas,hnt),colors:$S(e,t.colors,mnt(i)),sh:$S(e,t.sh)}},gnt=(e,t)=>{e._free(e.vf32_ptr(t.positions)),e._free(e.vf32_ptr(t.scales)),e._free(e.vf32_ptr(t.rotations)),e._free(e.vf32_ptr(t.alphas)),e._free(e.vf32_ptr(t.colors)),e._free(e.vf32_ptr(t.sh))},Kbe=async(e,t)=>{var n;let i=await dnt(),r=e instanceof Uint8Array?e:new Uint8Array(e),o=null;try{if(o=i._malloc(Uint8Array.BYTES_PER_ELEMENT*r.length),o===null)throw new Error("couldn't allocate memory");i.HEAPU8.set(r,o/Uint8Array.BYTES_PER_ELEMENT);let s=i.CoordinateSystem[((n=t?.unpackOptions)==null?void 0:n.coordinateSystem)??"UNSPECIFIED"],a=i.load_spz(o,r.length,{coordinateSystem:s}),c=pnt(i,a,t);return gnt(i,a),c}catch(s){throw s}finally{o!==null&&i._free(o)}};var _nt=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"}));var ynt=[0,9,24,45],Ant=14,bnt=1.6*1024*1024*1024;function xnt(e,t){let n=t?.attributes;if(!l(n))return;let i=n.POSITION;if(!l(i))return;let r=e?.accessors?.[i];if(!l(r)||r.count<=0)return;let o=0;for(let s in n)if(Object.prototype.hasOwnProperty.call(n,s)){let a=/SH_DEGREE_(\d+)_COEF_/.exec(s);a&&(o=Math.max(o,parseInt(a[1],10)))}return{numPoints:r.count,shDegree:o}}function Tnt(e,t){let n=Ant+(ynt[t]??0);return e*n*Float32Array.BYTES_PER_ELEMENT*2}var aZ=class extends ir{constructor(t){super(),t=t??H.EMPTY_OBJECT;let n=t.resourceCache,i=t.gltf,r=t.primitive,o=t.spz,s=t.gltfResource,a=t.baseResource,c=t.cacheKey;this._resourceCache=n,this._gltfResource=s,this._baseResource=a,this._gltf=i,this._primitive=r,this._spz=o,this._cacheKey=c,this._bufferViewLoader=void 0,this._bufferViewTypedArray=void 0,this._decodePromise=void 0,this._decodedData=void 0,this._state=Tt.UNLOADED,this._promise=void 0,this._spzError=void 0}get cacheKey(){return this._cacheKey}get decodedData(){return this._decodedData}async load(){return l(this._promise)?this._promise:(this._state=Tt.LOADING,this._promise=Ent(this),this._promise)}process(t){if(this._state===Tt.READY)return!0;if(this._state!==Tt.PROCESSING||(l(this._spzError)&&cZ(this,this._spzError),!l(this._bufferViewTypedArray))||l(this._decodePromise))return!1;let n=xnt(this._gltf,this._primitive);if(l(n)){let r=Tnt(n.numPoints,n.shDegree);if(r>bnt){let o=Math.round(r/1048576);return cZ(this,new oe(`SPZ data too large to decode: ${n.numPoints.toLocaleString()} splats with spherical harmonics degree ${n.shDegree} would require approximately ${o} MB, which exceeds the WASM memory limit. Consider using a lower spherical harmonics degree or splitting the dataset into smaller tiles.`)),!1}}let i=Kbe(this._bufferViewTypedArray,{unpackOptions:{coordinateSystem:"UNSPECIFIED"}});if(!l(i))return!1;this._decodePromise=Cnt(this,i)}unload(){l(this._bufferViewLoader)&&this._resourceCache.unload(this._bufferViewLoader),this._bufferViewLoader=void 0,this._bufferViewTypedArray=void 0,this._decodedData=void 0,this._gltf=void 0,this._primitive=void 0}};async function Ent(e){let t=e._resourceCache;try{let n=t.getBufferViewLoader({gltf:e._gltf,bufferViewId:e._spz.bufferView,gltfResource:e._gltfResource,baseResource:e._baseResource});return e._bufferViewLoader=n,await n.load(),e.isDestroyed()?void 0:(e._bufferViewTypedArray=n.typedArray,e._state=Tt.PROCESSING,e)}catch(n){if(e.isDestroyed())return;cZ(e,n)}}function cZ(e,t){throw e.unload(),e._state=Tt.FAILED,e.getError("Failed to load SPZ",t)}async function Cnt(e,t){try{let n=await t;return e.isDestroyed()?void 0:(e.unload(),e._decodedData={gcloud:n},e._state=Tt.READY,e._baseResource)}catch(n){if(e.isDestroyed())return;e._spzError=n}}var EF=aZ;function CF(e){e=e??H.EMPTY_OBJECT;let t=e.id,n=e.properties??{},i={};for(let r in n)if(n.hasOwnProperty(r)){let o=n[r];l(o.semantic)&&(i[o.semantic]=o)}this._id=t,this._name=e.name,this._description=e.description,this._properties=n,this._propertiesBySemantic=i,this._extras=Je(e.extras,!0),this._extensions=Je(e.extensions,!0)}CF.fromJson=function(e){e=e??H.EMPTY_OBJECT;let t=e.id,n=e.class,i={};for(let r in n.properties)if(n.properties.hasOwnProperty(r)){let o=Jp.fromJson({id:r,property:n.properties[r],enums:e.enums});i[r]=o}return new CF({id:t,name:n.name,description:n.description,properties:i,extras:n.extras,extensions:n.extensions})};Object.defineProperties(CF.prototype,{properties:{get:function(){return this._properties}},propertiesBySemantic:{get:function(){return this._propertiesBySemantic}},id:{get:function(){return this._id}},name:{get:function(){return this._name}},description:{get:function(){return this._description}},extras:{get:function(){return this._extras}},extensions:{get:function(){return this._extensions}}});CF.BATCH_TABLE_CLASS_NAME="_batchTable";var xm=CF;function FH(e){e=e??H.EMPTY_OBJECT;let t=e.value,n=e.name;this._value=t,this._name=n,this._description=e.description,this._extras=Je(e.extras,!0),this._extensions=Je(e.extensions,!0)}FH.fromJson=function(e){return new FH({value:e.value,name:e.name,description:e.description,extras:e.extras,extensions:e.extensions})};Object.defineProperties(FH.prototype,{value:{get:function(){return this._value}},name:{get:function(){return this._name}},description:{get:function(){return this._description}},extras:{get:function(){return this._extras}},extensions:{get:function(){return this._extensions}}});var vF=FH;function BH(e){e=e??H.EMPTY_OBJECT;let t=e.id,n=e.values,i={},r={},o=n.length;for(let a=0;a<o;++a){let c=n[a];i[c.value]=c.name,r[c.name]=c.value}let s=e.valueType??Lt.UINT16;this._values=n,this._namesByValue=i,this._valuesByName=r,this._valueType=s,this._id=t,this._name=e.name,this._description=e.description,this._extras=Je(e.extras,!0),this._extensions=Je(e.extensions,!0)}BH.fromJson=function(e){e=e??H.EMPTY_OBJECT;let t=e.id,n=e.enum,i=n.values.map(function(r){return vF.fromJson(r)});return new BH({id:t,values:i,valueType:Lt[n.valueType],name:n.name,description:n.description,extras:n.extras,extensions:n.extensions})};Object.defineProperties(BH.prototype,{values:{get:function(){return this._values}},namesByValue:{get:function(){return this._namesByValue}},valuesByName:{get:function(){return this._valuesByName}},valueType:{get:function(){return this._valueType}},id:{get:function(){return this._id}},name:{get:function(){return this._name}},description:{get:function(){return this._description}},extras:{get:function(){return this._extras}},extensions:{get:function(){return this._extensions}}});var SF=BH;function kH(e){e=e??H.EMPTY_OBJECT;let t=e.classes??{},n=e.enums??{};this._classes=t,this._enums=n,this._id=e.id,this._name=e.name,this._description=e.description,this._version=e.version,this._extras=Je(e.extras,!0),this._extensions=Je(e.extensions,!0)}kH.fromJson=function(e){let t={};if(l(e.enums))for(let i in e.enums)e.enums.hasOwnProperty(i)&&(t[i]=SF.fromJson({id:i,enum:e.enums[i]}));let n={};if(l(e.classes))for(let i in e.classes)e.classes.hasOwnProperty(i)&&(n[i]=xm.fromJson({id:i,class:e.classes[i],enums:t}));return new kH({id:e.id,name:e.name,description:e.description,version:e.version,classes:n,enums:t,extras:e.extras,extensions:e.extensions})};Object.defineProperties(kH.prototype,{classes:{get:function(){return this._classes}},enums:{get:function(){return this._enums}},id:{get:function(){return this._id}},name:{get:function(){return this._name}},description:{get:function(){return this._description}},version:{get:function(){return this._version}},extras:{get:function(){return this._extras}},extensions:{get:function(){return this._extensions}}});var ou=kH;var lZ=class extends ir{constructor(t){super(),t=t??H.EMPTY_OBJECT;let n=t.schema,i=t.resource,r=t.cacheKey;this._schema=l(n)?ou.fromJson(n):void 0,this._resource=i,this._cacheKey=r,this._state=Tt.UNLOADED,this._promise=void 0}get cacheKey(){return this._cacheKey}get schema(){return this._schema}async load(){return l(this._promise)?this._promise:l(this._schema)?(this._promise=Promise.resolve(this),this._promise):(this._promise=vnt(this),this._promise)}unload(){this._schema=void 0}};async function vnt(e){let t=e._resource;e._state=Tt.LOADING;try{let n=await t.fetchJson();return e.isDestroyed()?void 0:(e._schema=ou.fromJson(n),e._state=Tt.READY,e)}catch(n){if(e.isDestroyed())return;e._state=Tt.FAILED;let i=`Failed to load schema: ${t.url}`;throw e.getError(i,n)}}var AA=lZ;var Zd={};function JS(e){return Cd(e.url)}function wF(e){let{byteOffset:t,byteLength:n}=e,i=pA(e);return l(i)&&(t=i.byteOffset??0,n=i.byteLength),`${t}-${t+n}`}function Snt(e,t){let n=t.byteOffset+e.byteOffset,{componentType:i,type:r,count:o}=e;return`${n}-${i}-${r}-${o}`}function $be(e,t){return`${JS(e)}-buffer-id-${t}`}function ZS(e,t,n,i){if(l(e.uri)){let r=i.getDerivedResource({url:e.uri});return JS(r)}return $be(n,t)}function uZ(e,t,n,i){let r=t.bufferView,o=e.bufferViews[r],s=o.buffer,a=e.buffers[s],c=ZS(a,s,n,i),u=wF(o);return`${c}-range-${u}`}function Jbe(e,t,n,i){let r=t.bufferView,o=e.bufferViews[r],s=o.buffer,a=e.buffers[s],c=ZS(a,s,n,i),u=wF(o);return`${c}-range-${u}`}function Zbe(e,t,n,i){let r=e.images[t],o=r.bufferView,s=r.uri;if(l(s)){let p=i.getDerivedResource({url:s});return JS(p)}let a=e.bufferViews[o],c=a.buffer,u=e.buffers[c],f=ZS(u,c,n,i),d=wF(a);return`${f}-range-${d}`}function wnt(e,t){let n=Hu.createSampler({gltf:e,textureInfo:t});return`${n.wrapS}-${n.wrapT}-${n.minificationFilter}-${n.magnificationFilter}`}Zd.getSchemaCacheKey=function(e){let{schema:t,resource:n}=e;return l(t)?`embedded-schema:${JSON.stringify(t)}`:`external-schema:${JS(n)}`};Zd.getExternalBufferCacheKey=function(e){e=e??H.EMPTY_OBJECT;let{resource:t}=e;return`external-buffer:${JS(t)}`};Zd.getEmbeddedBufferCacheKey=function(e){e=e??H.EMPTY_OBJECT;let{parentResource:t,bufferId:n}=e;return`embedded-buffer:${$be(t,n)}`};Zd.getGltfCacheKey=function(e){e=e??H.EMPTY_OBJECT;let{gltfResource:t}=e;return`gltf:${JS(t)}`};Zd.getBufferViewCacheKey=function(e){e=e??H.EMPTY_OBJECT;let{gltf:t,bufferViewId:n,gltfResource:i,baseResource:r}=e,o=t.bufferViews[n],s=o.buffer,a=t.buffers[s],c=pA(o);l(c)&&(s=c.buffer);let u=ZS(a,s,i,r),f=wF(o);return`buffer-view:${u}-range-${f}`};Zd.getDracoCacheKey=function(e){e=e??H.EMPTY_OBJECT;let{gltf:t,draco:n,gltfResource:i,baseResource:r}=e;return`draco:${uZ(t,n,i,r)}`};Zd.getSpzCacheKey=function(e){e=e??H.EMPTY_OBJECT;let{gltf:t,spz:n,gltfResource:i,baseResource:r}=e;return`spz:${Jbe(t,n,i,r)}`};Zd.getVertexBufferCacheKey=function(e){e=e??H.EMPTY_OBJECT;let{gltf:t,gltfResource:n,baseResource:i,frameState:r,bufferViewId:o,draco:s,spz:a,attributeSemantic:c,dequantize:u=!1,loadBuffer:f=!1,loadTypedArray:d=!1}=e,p="";if(u&&(p+="-dequantize"),f&&(p+="-buffer",p+=`-context-${r.context.id}`),d&&(p+="-typed-array"),l(a))return`vertex-buffer:${Jbe(t,a,n,i)}-spz-${c}${p}`;if(l(s))return`vertex-buffer:${uZ(t,s,n,i)}-draco-${c}${p}`;let g=t.bufferViews[o],m=g.buffer,y=t.buffers[m],A=ZS(y,m,n,i),b=wF(g);return`vertex-buffer:${A}-range-${b}${p}`};Zd.getIndexBufferCacheKey=function(e){e=e??H.EMPTY_OBJECT;let{gltf:t,accessorId:n,gltfResource:i,baseResource:r,frameState:o,draco:s,loadBuffer:a=!1,loadTypedArray:c=!1}=e,u="";if(a&&(u+="-buffer",u+=`-context-${o.context.id}`),c&&(u+="-typed-array"),l(s))return`index-buffer:${uZ(t,s,i,r)}-draco${u}`;let f=t.accessors[n],d=f.bufferView,p=t.bufferViews[d],g=p.buffer,m=t.buffers[g],y=ZS(m,g,i,r),A=Snt(f,p);return`index-buffer:${y}-accessor-${A}${u}`};Zd.getImageCacheKey=function(e){e=e??H.EMPTY_OBJECT;let{gltf:t,imageId:n,gltfResource:i,baseResource:r}=e;return`image:${Zbe(t,n,i,r)}`};Zd.getTextureCacheKey=function(e){e=e??H.EMPTY_OBJECT;let{gltf:t,textureInfo:n,gltfResource:i,baseResource:r,supportedImageFormats:o,frameState:s}=e,a=n.index,c=Hu.getImageIdFromTexture({gltf:t,textureId:a,supportedImageFormats:o}),u=Zbe(t,c,i,r),f=wnt(t,n);return`texture:${u}-sampler-${f}-context-${s.context.id}`};var su=Zd;function IF(){this.geometryByteLength=0,this.texturesByteLength=0,this._geometrySizes={},this._textureSizes={}}IF.prototype.clear=function(){this.geometryByteLength=0,this.texturesByteLength=0,this._geometrySizes={},this._textureSizes={}};IF.prototype.addGeometryLoader=function(e){let t=e.cacheKey;if(this._geometrySizes.hasOwnProperty(t))return;this._geometrySizes[t]=0;let n=e.buffer,i=e.typedArray,r=0;l(n)&&(r+=n.sizeInBytes),l(i)&&(r+=i.byteLength),this.geometryByteLength+=r,this._geometrySizes[t]=r};IF.prototype.addTextureLoader=function(e){let t=e.cacheKey;if(this._textureSizes.hasOwnProperty(t))return;this._textureSizes[t]=0;let n=e.texture.sizeInBytes;this.texturesByteLength+=e.texture.sizeInBytes,this._textureSizes[t]=n};IF.prototype.removeLoader=function(e){let t=e.cacheKey,n=this._geometrySizes[t];delete this._geometrySizes[t],l(n)&&(this.geometryByteLength-=n);let i=this._textureSizes[t];delete this._textureSizes[t],l(i)&&(this.texturesByteLength-=i)};var PF=IF;function Nn(){}Nn.cacheEntries={};Nn.statistics=new PF;function Int(e){this.referenceCount=1,this.resourceLoader=e,this._statisticsPromise=void 0}Nn.get=function(e){let t=Nn.cacheEntries[e];if(l(t))return++t.referenceCount,t.resourceLoader};Nn.add=function(e){let t=e.cacheKey;return Nn.cacheEntries[t]=new Int(e),e};Nn.unload=function(e){let t=e.cacheKey,n=Nn.cacheEntries[t];--n.referenceCount,n.referenceCount===0&&(Nn.statistics.removeLoader(e),e.destroy(),delete Nn.cacheEntries[t])};Nn.getSchemaLoader=function(e){e=e??H.EMPTY_OBJECT;let{schema:t,resource:n}=e,i=su.getSchemaCacheKey({schema:t,resource:n}),r=Nn.get(i);return l(r)?r:(r=new AA({schema:t,resource:n,cacheKey:i}),Nn.add(r))};Nn.getEmbeddedBufferLoader=function(e){e=e??H.EMPTY_OBJECT;let{parentResource:t,bufferId:n,typedArray:i}=e,r=su.getEmbeddedBufferCacheKey({parentResource:t,bufferId:n}),o=Nn.get(r);return l(o)?o:(o=new ET({typedArray:i,cacheKey:r}),Nn.add(o))};Nn.getExternalBufferLoader=function(e){e=e??H.EMPTY_OBJECT;let{resource:t}=e,n=su.getExternalBufferCacheKey({resource:t}),i=Nn.get(n);return l(i)?i:(i=new ET({resource:t,cacheKey:n}),Nn.add(i))};Nn.getGltfJsonLoader=function(e){e=e??H.EMPTY_OBJECT;let{gltfResource:t,baseResource:n,typedArray:i,gltfJson:r}=e,o=su.getGltfCacheKey({gltfResource:t}),s=Nn.get(o);return l(s)?s:(s=new YS({resourceCache:Nn,gltfResource:t,baseResource:n,typedArray:i,gltfJson:r,cacheKey:o}),Nn.add(s))};Nn.getBufferViewLoader=function(e){e=e??H.EMPTY_OBJECT;let{gltf:t,bufferViewId:n,gltfResource:i,baseResource:r}=e,o=su.getBufferViewCacheKey({gltf:t,bufferViewId:n,gltfResource:i,baseResource:r}),s=Nn.get(o);return l(s)?s:(s=new jS({resourceCache:Nn,gltf:t,bufferViewId:n,gltfResource:i,baseResource:r,cacheKey:o}),Nn.add(s))};Nn.getDracoLoader=function(e){e=e??H.EMPTY_OBJECT;let{gltf:t,primitive:n,draco:i,gltfResource:r,baseResource:o}=e,s=su.getDracoCacheKey({gltf:t,draco:i,gltfResource:r,baseResource:o}),a=Nn.get(s);return l(a)?a:(a=new HS({resourceCache:Nn,gltf:t,primitive:n,draco:i,gltfResource:r,baseResource:o,cacheKey:s}),Nn.add(a))};Nn.getSpzLoader=function(e){e=e??H.EMPTY_OBJECT;let{gltf:t,primitive:n,spz:i,gltfResource:r,baseResource:o}=e,s=su.getSpzCacheKey({gltf:t,spz:i,gltfResource:r,baseResource:o}),a=Nn.get(s);return l(a)?a:(a=new EF({resourceCache:Nn,gltf:t,primitive:n,spz:i,gltfResource:r,baseResource:o,cacheKey:s}),Nn.add(a))};Nn.getVertexBufferLoader=function(e){e=e??H.EMPTY_OBJECT;let{gltf:t,gltfResource:n,baseResource:i,frameState:r,bufferViewId:o,primitive:s,draco:a,spz:c,attributeSemantic:u,accessorId:f,asynchronous:d=!0,dequantize:p=!1,loadBuffer:g=!1,loadTypedArray:m=!1}=e,y=su.getVertexBufferCacheKey({gltf:t,gltfResource:n,baseResource:i,frameState:r,bufferViewId:o,draco:a,spz:c,attributeSemantic:u,dequantize:p,loadBuffer:g,loadTypedArray:m}),A=Nn.get(y);return l(A)?A:(A=new KS({resourceCache:Nn,gltf:t,gltfResource:n,baseResource:i,bufferViewId:o,primitive:s,draco:a,spz:c,attributeSemantic:u,accessorId:f,cacheKey:y,asynchronous:d,dequantize:p,loadBuffer:g,loadTypedArray:m}),Nn.add(A))};Nn.getIndexBufferLoader=function(e){e=e??H.EMPTY_OBJECT;let{gltf:t,accessorId:n,gltfResource:i,baseResource:r,frameState:o,primitive:s,draco:a,asynchronous:c=!0,loadBuffer:u=!1,loadTypedArray:f=!1}=e,d=su.getIndexBufferCacheKey({gltf:t,accessorId:n,gltfResource:i,baseResource:r,frameState:o,draco:a,loadBuffer:u,loadTypedArray:f}),p=Nn.get(d);return l(p)?p:(p=new WS({resourceCache:Nn,gltf:t,accessorId:n,gltfResource:i,baseResource:r,primitive:s,draco:a,cacheKey:d,asynchronous:c,loadBuffer:u,loadTypedArray:f}),Nn.add(p))};Nn.getImageLoader=function(e){e=e??H.EMPTY_OBJECT;let{gltf:t,imageId:n,gltfResource:i,baseResource:r}=e,o=su.getImageCacheKey({gltf:t,imageId:n,gltfResource:i,baseResource:r}),s=Nn.get(o);return l(s)?s:(s=new GS({resourceCache:Nn,gltf:t,imageId:n,gltfResource:i,baseResource:r,cacheKey:o}),Nn.add(s))};Nn.getTextureLoader=function(e){e=e??H.EMPTY_OBJECT;let{gltf:t,textureInfo:n,gltfResource:i,baseResource:r,supportedImageFormats:o,frameState:s,asynchronous:a=!0}=e,c=su.getTextureCacheKey({gltf:t,textureInfo:n,gltfResource:i,baseResource:r,supportedImageFormats:o,frameState:s}),u=Nn.get(c);return l(u)?u:(u=new XS({resourceCache:Nn,gltf:t,textureInfo:n,gltfResource:i,baseResource:r,supportedImageFormats:o,cacheKey:c,asynchronous:a}),Nn.add(u))};Nn.clearForSpecs=function(){let e=[KS,WS,HS,XS,GS,jS,ET,AA,YS],t,n=Nn.cacheEntries,i=[];for(t in n)n.hasOwnProperty(t)&&i.push(n[t]);i.sort(function(o,s){let a=e.indexOf(o.resourceLoader.constructor),c=e.indexOf(s.resourceLoader.constructor);return a-c});let r=i.length;for(let o=0;o<r;++o){let s=i[o];t=s.resourceLoader.cacheKey,l(n[t])&&(s.resourceLoader.destroy(),delete n[t])}Nn.statistics.clear()};var Fi=Nn;var fZ=class extends ir{constructor(t){super(),t=t??H.EMPTY_OBJECT;let{gltf:n,extension:i,extensionLegacy:r,gltfResource:o,baseResource:s,supportedImageFormats:a,frameState:c,cacheKey:u,asynchronous:f=!0}=t;this._gltfResource=o,this._baseResource=s,this._gltf=n,this._extension=i,this._extensionLegacy=r,this._supportedImageFormats=a,this._frameState=c,this._cacheKey=u,this._asynchronous=f,this._bufferViewLoaders=[],this._bufferViewIds=[],this._textureLoaders=[],this._textureIds=[],this._schemaLoader=void 0,this._structuralMetadata=void 0,this._state=Tt.UNLOADED,this._promise=void 0}get cacheKey(){return this._cacheKey}get structuralMetadata(){return this._structuralMetadata}load(){return l(this._promise)?this._promise:(this._state=Tt.LOADING,this._promise=Pnt(this),this._promise)}process(t){if(this._state===Tt.READY)return!0;if(this._state!==Tt.LOADED)return!1;let n=this._textureLoaders,i=n.length,r=!0;for(let c=0;c<i;++c){let f=n[c].process(t);r=r&&f}if(!r)return!1;let o=this._schemaLoader.schema,s={};for(let c=0;c<this._bufferViewIds.length;++c){let u=this._bufferViewIds[c],f=this._bufferViewLoaders[c];if(!f.isDestroyed()){let d=new Uint8Array(f.typedArray);s[u]=d}}let a={};for(let c=0;c<this._textureIds.length;++c){let u=this._textureIds[c],f=n[c];f.isDestroyed()||(a[u]=f.texture)}return l(this._extension)?this._structuralMetadata=lF({extension:this._extension,schema:o,bufferViews:s,textures:a,context:t.context}):this._structuralMetadata=uF({extension:this._extensionLegacy,schema:o,bufferViews:s,textures:a}),Qbe(this),this._state=Tt.READY,!0}unload(){Qbe(this),Vnt(this),l(this._schemaLoader)&&Fi.unload(this._schemaLoader),this._schemaLoader=void 0,l(this._structuralMetadata)&&this._structuralMetadata.destroy(),this._structuralMetadata=void 0}};async function Pnt(e){try{let t=Nnt(e),n=Unt(e),i=znt(e);return await Promise.all([t,n,i]),e.isDestroyed()?void 0:(e._gltf=void 0,e._state=Tt.LOADED,e)}catch(t){if(e.isDestroyed())return;throw e.unload(),e._state=Tt.FAILED,e.getError("Failed to load structural metadata",t)}}function Dnt(e,t){for(let n in e)if(e.hasOwnProperty(n)){let i=e[n],r=i.values,o=i.arrayOffsets,s=i.stringOffsets;l(r)&&(t[r]=!0),l(o)&&(t[o]=!0),l(s)&&(t[s]=!0)}}function Rnt(e,t){for(let n in e)if(e.hasOwnProperty(n)){let i=e[n],r=i.bufferView,o=i.arrayOffsetBufferView,s=i.stringOffsetBufferView;l(r)&&(t[r]=!0),l(o)&&(t[o]=!0),l(s)&&(t[s]=!0)}}function Ont(e){let t=e.propertyTables,n={};if(l(t))for(let i=0;i<t.length;i++){let r=t[i];Dnt(r.properties,n)}return n}function Mnt(e){let t=e.featureTables,n={};if(l(t)){for(let i in t)if(t.hasOwnProperty(i)){let o=t[i].properties;l(o)&&Rnt(o,n)}}return n}async function Nnt(e){let t;l(e._extension)?t=Ont(e._extension):t=Mnt(e._extensionLegacy);let n=[];for(let i in t)if(t.hasOwnProperty(i)){let r=Fi.getBufferViewLoader({gltf:e._gltf,bufferViewId:parseInt(i),gltfResource:e._gltfResource,baseResource:e._baseResource});e._bufferViewLoaders.push(r),e._bufferViewIds.push(i),n.push(r.load())}return Promise.all(n)}function Lnt(e){let t={},n=e.propertyTextures;if(l(n))for(let i=0;i<n.length;i++){let o=n[i].properties;l(o)&&Fnt(o,t)}return t}function Fnt(e,t){for(let n in e)if(e.hasOwnProperty(n)){let i=e[n];t[i.index]=i}}function Bnt(e){let t={},n=e.featureTextures;if(l(n)){for(let i in n)if(n.hasOwnProperty(i)){let o=n[i].properties;l(o)&&knt(o,t)}}return t}function knt(e,t){for(let n in e)if(e.hasOwnProperty(n)){let r=e[n].texture;t[r.index]=r}}function Unt(e){let t;l(e._extension)?t=Lnt(e._extension):t=Bnt(e._extensionLegacy);let n=e._gltf,i=e._gltfResource,r=e._baseResource,o=e._supportedImageFormats,s=e._frameState,a=e._asynchronous,c=[];for(let u in t)if(t.hasOwnProperty(u)){let f=Fi.getTextureLoader({gltf:n,textureInfo:t[u],gltfResource:i,baseResource:r,supportedImageFormats:o,frameState:s,asynchronous:a});e._textureLoaders.push(f),e._textureIds.push(u),c.push(f.load())}return Promise.all(c)}async function znt(e){let t=e._extension??e._extensionLegacy,n;if(l(t.schemaUri)){let i=e._baseResource.getDerivedResource({url:t.schemaUri});n=Fi.getSchemaLoader({resource:i})}else n=Fi.getSchemaLoader({schema:t.schema});if(e._schemaLoader=n,await n.load(),!n.isDestroyed())return n.schema}function Qbe(e){let t=e._bufferViewLoaders,n=t.length;for(let i=0;i<n;++i)Fi.unload(t[i]);e._bufferViewLoaders.length=0,e._bufferViewIds.length=0}function Vnt(e){let t=e._textureLoaders,n=t.length;for(let i=0;i<n;++i)Fi.unload(t[i]);e._textureLoaders.length=0,e._textureIds.length=0}var DF=fZ;function jnt(e,t){return l(e)&&l(e.extensions)&&l(e.extensions[t])}var rr=jnt;var RT={TRANSLATION:"TRANSLATION",ROTATION:"ROTATION",SCALE:"SCALE",FEATURE_ID:"_FEATURE_ID"};RT.fromGltfSemantic=function(e){let t=e,i=/^(\w+)_\d+$/.exec(e);switch(i!==null&&(t=i[1]),t){case"TRANSLATION":return RT.TRANSLATION;case"ROTATION":return RT.ROTATION;case"SCALE":return RT.SCALE;case"_FEATURE_ID":return RT.FEATURE_ID}};Object.freeze(RT);var Lo=RT;var Hnt=65534,Gnt=255;function UH(e){e=e??H.EMPTY_OBJECT;let t=e.triangleIndices,n=e.outlineIndices,i=e.originalVertexCount;this._triangleIndices=t,this._originalVertexCount=i,this._edges=new nxe(n,i),this._outlineCoordinatesTypedArray=void 0,this._extraVertices=[],Wnt(this)}Object.defineProperties(UH.prototype,{updatedTriangleIndices:{get:function(){return this._triangleIndices}},outlineCoordinates:{get:function(){return this._outlineCoordinatesTypedArray}}});function Wnt(e){let t=e._triangleIndices,n=e._edges,i=[],r=e._extraVertices,o=e._originalVertexCount,s={};for(let a=0;a<t.length;a+=3){let c=t[a],u=t[a+1],f=t[a+2],d=!1,p=d||n.hasEdge(c,u),g=d||n.hasEdge(u,f),m=d||n.hasEdge(f,c),y=exe(i,c,u,f,p,g,m);for(;l(y);){let A=s[y];if(!l(A)){A=o+r.length;let b=y;for(;b>=o;)b=r[b-o];r.push(b),s[y]=A}A>Hnt&&(t instanceof Uint16Array||t instanceof Uint8Array)?t=new Uint32Array(t):A>Gnt&&t instanceof Uint8Array&&(t=new Uint16Array(t)),y===c?(c=A,t[a]=A):y===u?(u=A,t[a+1]=A):(f=A,t[a+2]=A),y=exe(i,c,u,f,p,g,m)}}e._triangleIndices=t,e._outlineCoordinatesTypedArray=new Float32Array(i)}function exe(e,t,n,i,r,o,s){let a=s?1:0,c=r?1:0,u=0,f=dZ(e,t,a,c,u);if(f===0)return t;let d=0,p=r?1:0,g=o?1:0,m=dZ(e,n,d,p,g);if(m===0)return n;let y=s?1:0,A=0,b=o?1:0,x=dZ(e,i,y,A,b);if(x===0)return i;let T=f&m&x,E,v,S;if(T&1)E=0,v=1,S=2;else if(T&2)E=0,S=1,v=2;else if(T&4)v=0,E=1,S=2;else if(T&8)v=0,S=1,E=2;else if(T&16)S=0,E=1,v=2;else if(T&32)S=0,v=1,E=2;else{let L=hZ(f),_=hZ(m),C=hZ(x);return L<_&&L<C?t:_<C?n:i}let I=t*3;e[I+E]=a,e[I+v]=c,e[I+S]=u;let R=n*3;e[R+E]=d,e[R+v]=p,e[R+S]=g;let O=i*3;e[O+E]=y,e[O+v]=A,e[O+S]=b}function dZ(e,t,n,i,r){let o=t*3,s=e[o],a=e[o+1],c=e[o+2];return l(s)?(s===n&&a===i&&c===r)<<0|(s===n&&a===r&&c===i)<<1|(s===i&&a===n&&c===r)<<2|(s===i&&a===r&&c===n)<<3|(s===r&&a===n&&c===i)<<4|(s===r&&a===i&&c===n)<<5:63}function hZ(e){return(e&1)+(e>>1&1)+(e>>2&1)+(e>>3&1)+(e>>4&1)+(e>>5&1)}UH.prototype.updateAttribute=function(e){let t=this._extraVertices,n=e.length,i=n/this._originalVertexCount,r=t.length,o=e.constructor,s=new o(e.length+r*i);s.set(e);for(let a=0;a<r;a++){let c=t[a]*i,u=n+a*i;for(let f=0;f<i;f++)s[u+f]=s[c+f]}return s};UH.createTexture=function(e){let t=e.cache.modelOutliningCache;if(l(t)||(t=e.cache.modelOutliningCache={}),l(t.outlineTexture))return t.outlineTexture;let n=Math.min(4096,kt.maximumTextureSize),i=n,r=txe(i),o=[];for(;i>1;)i>>=1,o.push(txe(i));let s=new Dt({context:e,source:{arrayBufferView:r,mipLevels:o},width:n,height:1,pixelFormat:Ke.LUMINANCE,sampler:new jt({wrapS:hn.CLAMP_TO_EDGE,wrapT:hn.CLAMP_TO_EDGE,minificationFilter:Wt.LINEAR_MIPMAP_LINEAR,magnificationFilter:Jn.LINEAR})});return t.outlineTexture=s,s};function txe(e){let t=new Uint8Array(e);return t[e-1]=192,e===8?t[e-1]=96:e===4?t[e-1]=48:e===2?t[e-1]=24:e===1&&(t[e-1]=12),t}function nxe(e,t){this._originalVertexCount=t,this._edges=new Set;for(let n=0;n<e.length;n+=2){let i=e[n],r=e[n+1],o=Math.min(i,r),s=Math.max(i,r),a=o*this._originalVertexCount+s;this._edges.add(a)}}nxe.prototype.hasEdge=function(e,t){let n=Math.min(e,t),i=Math.max(e,t),r=n*this._originalVertexCount+i;return this._edges.has(r)};var OT=UH;function ixe(e){this.attribute=e,this.loadBuffer=!1,this.loadTypedArray=!1}function qnt(e){this.indices=e,this.loadBuffer=!1,this.loadTypedArray=!1}function zH(e){this.primitive=e,this.attributePlans=[],this.indicesPlan=void 0,this.needsOutlines=!1,this.outlineIndices=void 0,this.needsGaussianSplats=!1}zH.prototype.postProcess=function(e){this.needsOutlines&&(Ynt(this),$nt(this,e)),this.needsGaussianSplats&&Knt(this,e)};function Ynt(e){let t=e.primitive,n=t.indices,i=t.attributes[0].count,r=new OT({triangleIndices:n.typedArray,outlineIndices:e.outlineIndices,originalVertexCount:i});n.typedArray=r.updatedTriangleIndices,n.indexDatatype=je.fromTypedArray(n.typedArray);let o=Xnt(r.outlineCoordinates),s=new ixe(o);s.loadBuffer=!0,s.loadTypedArray=!1,e.attributePlans.push(s),t.outlineCoordinates=s.attribute;let a=e.attributePlans,c=e.attributePlans.length;for(let u=0;u<c;u++){let f=a[u].attribute;f.typedArray=r.updateAttribute(f.typedArray)}}function Xnt(e){let t=new Cn.Attribute;return t.name="_OUTLINE_COORDINATES",t.typedArray=e,t.componentDatatype=Y.FLOAT,t.type=Vt.VEC3,t.normalized=!1,t.count=e.length/3,t}function Knt(e,t){let n=e.attributePlans,i=n.length;for(let r=0;r<i;r++){let o=n[r];o.loadBuffer=!1,o.loadTypedArray=!0}}function $nt(e,t){Jnt(e.attributePlans,t),l(e.indicesPlan)&&Znt(e.indicesPlan,t)}function Jnt(e,t){let n=e.length;for(let i=0;i<n;i++){let r=e[i],o=r.attribute,s=o.typedArray;if(r.loadBuffer){let a=tt.createVertexBuffer({typedArray:s,context:t,usage:Me.STATIC_DRAW});a.vertexArrayDestroyable=!1,o.buffer=a}r.loadTypedArray||(o.typedArray=void 0)}}function Znt(e,t){let n=e.indices;if(e.loadBuffer){let i=tt.createIndexBuffer({typedArray:n.typedArray,context:t,usage:Me.STATIC_DRAW,indexDatatype:n.indexDatatype});n.buffer=i,i.vertexArrayDestroyable=!1}e.loadTypedArray||(n.typedArray=void 0)}zH.AttributeLoadPlan=ixe;zH.IndicesLoadPlan=qnt;var MT=zH;function Qnt(e){e=e??H.EMPTY_OBJECT,this.webp=e.webp??!1,this.basis=e.basis??!1}var RF=Qnt;function rxe(e){this._position=e.position,this._adjustmentParams=e.adjustmentParams}Object.defineProperties(rxe.prototype,{position:{get:function(){return this._position}},adjustmentParams:{get:function(){return this._adjustmentParams}}});var OF=rxe;function oxe(e){this._position=e.position,this._adjustmentParams=e.adjustmentParams,this._covarianceMatrix=e.covarianceMatrix}Object.defineProperties(oxe.prototype,{position:{get:function(){return this._position}},adjustmentParams:{get:function(){return this._adjustmentParams}},covarianceMatrix:{get:function(){return this._covarianceMatrix}}});var MF=oxe;function sxe(e){this._groupFlags=e.groupFlags,this._rotationThetas=e.rotationThetas,this._params=e.params}Object.defineProperties(sxe.prototype,{groupFlags:{get:function(){return this._groupFlags}},rotationThetas:{get:function(){return this._rotationThetas}},params:{get:function(){return this._params}}});var NF=sxe;var axe={Direct:"Direct",Indirect:"Indirect"};Object.freeze(axe);var bA=axe;function cxe(e){this._storageType=e.storageType,this._anchorPointsIndirect=e.anchorPointsIndirect,this._anchorPointsDirect=e.anchorPointsDirect,this._intraTileCorrelationGroups=e.intraTileCorrelationGroups,this._covarianceDirect=e.covarianceDirect}Object.defineProperties(cxe.prototype,{storageType:{get:function(){return this._storageType}},anchorPointsIndirect:{get:function(){return this._anchorPointsIndirect}},anchorPointsDirect:{get:function(){return this._anchorPointsDirect}},intraTileCorrelationGroups:{get:function(){return this._intraTileCorrelationGroups}},covarianceDirect:{get:function(){return this._covarianceDirect}}});var QS=cxe;function lxe(e){this._A=e.A,this._alpha=e.alpha,this._beta=e.beta,this._T=e.T}Object.defineProperties(lxe.prototype,{A:{get:function(){return this._A}},alpha:{get:function(){return this._alpha}},beta:{get:function(){return this._beta}},T:{get:function(){return this._T}}});var LF=lxe;function ew(){}function uxe(e){return new $(e[0],e[1],e[3],e[1],e[2],e[4],e[3],e[4],e[5])}function eit(e){let t=h.fromArray(e.position,0,new h),n=h.fromArray(e.adjustmentParams,0,new h);return new OF({position:t,adjustmentParams:n})}function tit(e){let t=h.fromArray(e.position,0,new h),n=h.fromArray(e.adjustmentParams,0,new h),i=uxe(e.covarianceMatrix);return new MF({position:t,adjustmentParams:n,covarianceMatrix:i})}function nit(e){let t=e.groupFlags,n=h.fromArray(e.rotationThetas,0,new h),i=[];for(let o of e.params){let s=new LF({A:o.A,alpha:o.alpha,beta:o.beta,T:o.T});i.push(s)}return new NF({groupFlags:t,rotationThetas:n,params:i})}ew.load=function(e){let t=e.storageType;if(t===bA.Direct)return ew.loadDirect(e);if(t===bA.Indirect)return ew.loadIndirect(e);throw new oe(`Invalid storage type in NGA_gpm_local - expected 'Direct' or 'Indirect', but found ${t}`)};ew.loadDirect=function(e){let t=[],n=e.anchorPointsDirect;for(let o of n){let s=eit(o);t.push(s)}let i=uxe(e.covarianceDirectUpperTriangle);return new QS({storageType:bA.Direct,anchorPointsDirect:t,covarianceDirect:i})};ew.loadIndirect=function(e){let t=[],n=e.anchorPointsIndirect;for(let s of n){let a=tit(s);t.push(a)}let i=e.intraTileCorrelationGroups,r=[];for(let s of i){let a=nit(s);r.push(a)}return new QS({storageType:bA.Indirect,anchorPointsIndirect:t,intraTileCorrelationGroups:r})};var FF=ew;function fxe(e){this._traits=e.traits,this._noData=e.noData,this._offset=e.offset,this._scale=e.scale,this._index=e.index,this._texCoord=e.texCoord}Object.defineProperties(fxe.prototype,{traits:{get:function(){return this._traits}},noData:{get:function(){return this._noData}},offset:{get:function(){return this._offset}},scale:{get:function(){return this._scale}},index:{get:function(){return this._index}},texCoord:{get:function(){return this._texCoord}}});var BF=fxe;function dxe(e){this._min=e.min,this._max=e.max,this._source=e.source}Object.defineProperties(dxe.prototype,{min:{get:function(){return this._min}},max:{get:function(){return this._max}},source:{get:function(){return this._source}}});var kF=dxe;function hxe(e){this._ppeTextures=e}Object.defineProperties(hxe.prototype,{ppeTextures:{get:function(){return this._ppeTextures}}});var UF=hxe;function us(e){e=e??H.EMPTY_OBJECT;let t=e.gltf,n=e.extension,i=e.gltfResource,r=e.baseResource,o=e.supportedImageFormats,s=e.frameState,a=e.cacheKey,c=e.asynchronous??!0;this._gltfResource=i,this._baseResource=r,this._gltf=t,this._extension=n,this._supportedImageFormats=o,this._frameState=s,this._cacheKey=a,this._asynchronous=c,this._textureLoaders=[],this._textureIds=[],this._meshPrimitiveGpmLocal=void 0,this._structuralMetadata=void 0,this._state=Tt.UNLOADED,this._promise=void 0}l(Object.create)&&(us.prototype=Object.create(ir.prototype),us.prototype.constructor=us);Object.defineProperties(us.prototype,{cacheKey:{get:function(){return this._cacheKey}},meshPrimitiveGpmLocal:{get:function(){return this._meshPrimitiveGpmLocal}},structuralMetadata:{get:function(){return this._structuralMetadata}}});us.prototype._loadResources=async function(){try{return await this._loadTextures(),this.isDestroyed()?void 0:(this._gltf=void 0,this._state=Tt.LOADED,this)}catch(e){if(this.isDestroyed())return;throw this.unload(),this._state=Tt.FAILED,this.getError("Failed to load GPM data",e)}};us.prototype.load=function(){return l(this._promise)?this._promise:(this._state=Tt.LOADING,this._promise=this._loadResources(this),this._promise)};function iit(e){let t={},n=e.ppeTextures;if(l(n))for(let i=0;i<n.length;i++){let r=n[i];t[r.index]=r}return t}us.prototype._loadTextures=function(){let e;l(this._extension)&&(e=iit(this._extension));let t=this._gltf,n=this._gltfResource,i=this._baseResource,r=this._supportedImageFormats,o=this._frameState,s=this._asynchronous,a=[];for(let c in e)if(e.hasOwnProperty(c)){let u=Fi.getTextureLoader({gltf:t,textureInfo:e[c],gltfResource:n,baseResource:i,supportedImageFormats:r,frameState:o,asynchronous:s});this._textureLoaders.push(u),this._textureIds.push(c),a.push(u.load())}return Promise.all(a)};us.ppeTexturesMetadataSchemaCache=new Map;us._createPpeTextureClassJson=function(e,t){let n=e.traits,i=n.source,r=e.offset??0,o=(e.scale??1)*255;return{name:`PPE texture class ${t}`,properties:{[i]:{name:"PPE",type:"SCALAR",componentType:"UINT8",normalized:!0,offset:r,scale:o,min:n.min,max:n.max}}}};us._obtainPpeTexturesMetadataSchema=function(e){let n=us._collectPpeTexturePropertyIdentifiers(e).toString(),i=us.ppeTexturesMetadataSchemaCache.get(n);if(l(i))return i;let o={id:`PPE_TEXTURE_SCHEMA_${us.ppeTexturesMetadataSchemaCache.size}`,classes:{}},s=e.ppeTextures;for(let a=0;a<s.length;a++){let c=s[a],u=`ppeTexture_${a}`,f=us._createPpeTextureClassJson(c,a);o.classes[u]=f}return i=ou.fromJson(o),us.ppeTexturesMetadataSchemaCache.set(n,i),i};us._collectPpeTexturePropertyIdentifiers=function(e){let t=[],n=e.ppeTextures;for(let i=0;i<n.length;i++){let r=n[i],o=us._createPpeTextureClassJson(r,i),s=JSON.stringify(o);t.push(s)}return t};us._convertToStructuralMetadata=function(e,t){let n=[],i=us._obtainPpeTexturesMetadataSchema(e),r=e.ppeTextures;for(let s=0;s<r.length;s++){let a=r[s],c=`ppeTexture_${s}`,f=a.traits.source,d=i.classes[c],p={class:c,properties:{[f]:{index:a.index,texCoord:a.texCoord}}};n.push(new Xg({id:s,name:a.name,propertyTexture:p,class:d,textures:t}))}return new Ha({schema:i,propertyTables:[],propertyTextures:n,propertyAttributes:[]})};us.prototype.process=function(e){if(this._state===Tt.READY)return!0;if(this._state!==Tt.LOADED)return!1;let t=this._textureLoaders,n=t.length,i=!0;for(let u=0;u<n;++u){let d=t[u].process(e);i=i&&d}if(!i)return!1;let r={};for(let u=0;u<this._textureIds.length;++u){let f=this._textureIds[u],d=t[u];d.isDestroyed()||(r[f]=d.texture)}let o=[],s=this._extension;if(l(s.ppeTextures)){let u=s.ppeTextures;for(let f of u){let d=f.traits,p=new kF({min:d.min,max:d.max,source:d.source}),g=new BF({traits:p,noData:f.noData,offset:f.offset,scale:f.scale,index:f.index,texCoord:f.texCoord});o.push(g)}}let a=new UF(o);this._meshPrimitiveGpmLocal=a;let c=us._convertToStructuralMetadata(a,r);return this._structuralMetadata=c,this._state=Tt.READY,!0};us.prototype._unloadTextures=function(){let e=this._textureLoaders,t=e.length;for(let n=0;n<t;++n)Fi.unload(e[n]);this._textureLoaders.length=0,this._textureIds.length=0};us.prototype.unload=function(){this._unloadTextures(),this._gltf=void 0,this._extension=void 0,this._structuralMetadata=void 0};var zF=us;function rit(e){let n=(e.extensions??H.EMPTY_OBJECT).EXT_mesh_primitive_restart,i=e.primitives;if(!l(n))return i;let r=[];Zn(r,i);for(let o of n.primitiveGroups){let s=o.primitives[0];if(!l(s)||!i[s])return i;let a={...i[s],indices:o.indices};switch(a.mode){case te.TRIANGLE_FAN:case te.TRIANGLE_STRIP:case te.LINE_STRIP:case te.LINE_LOOP:break;default:return i}for(let c of o.primitives){let u=r[c];if(!l(u?.indices)||u.mode!==a.mode)return i;r[c]=void 0}r[s]=a}return r.filter(l)}var VF=rit;var{Attribute:oit,Indices:sit,FeatureIdAttribute:pxe,FeatureIdTexture:gxe,FeatureIdImplicitRange:_xe,MorphTarget:ait,Primitive:cit,Instances:lit,Skin:uit,Node:fit,AnimatedPropertyType:dit,AnimationSampler:hit,AnimationTarget:mit,AnimationChannel:pit,Animation:git,ArticulationStage:_it,Articulation:yit,Asset:Ait,Scene:bit,Components:xit,MetallicRoughness:Tit,SpecularGlossiness:Eit,Specular:Cit,Anisotropy:mZ,Clearcoat:pZ,PlanarFill:vit,LineStyle:Sit,Material:wit,Vector:Iit,Polygon:Pit}=Cn,so={NOT_LOADED:0,LOADING:1,LOADED:2,PROCESSING:3,POST_PROCESSING:4,PROCESSED:5,READY:6,FAILED:7,UNLOADED:8},gZ=class extends ir{constructor(t){super(),t=t??H.EMPTY_OBJECT;let{gltfResource:n,typedArray:i,releaseGltfJson:r=!1,asynchronous:o=!0,incrementallyLoadTextures:s=!0,upAxis:a=Hi.Y,forwardAxis:c=Hi.Z,loadAttributesAsTypedArray:u=!1,loadAttributesFor2D:f=!1,enablePick:d=!1,loadIndicesForWireframe:p=!1,loadPrimitiveOutline:g=!0,loadForClassification:m=!1,renameBatchIdSemantic:y=!1}=t,{baseResource:A=n.clone()}=t;this._gltfJson=t.gltfJson,this._gltfResource=n,this._baseResource=A,this._typedArray=i,this._releaseGltfJson=r,this._asynchronous=o,this._incrementallyLoadTextures=s,this._upAxis=a,this._forwardAxis=c,this._loadAttributesAsTypedArray=u,this._loadAttributesFor2D=f,this._enablePick=d,this._loadIndicesForWireframe=p,this._loadPrimitiveOutline=g,this._loadForClassification=m,this._renameBatchIdSemantic=y,this._sortedPropertyTableIds=void 0,this._sortedFeatureTextureIds=void 0,this._gltfJsonLoader=void 0,this._state=so.NOT_LOADED,this._textureState=so.NOT_LOADED,this._promise=void 0,this._processError=void 0,this._textureErrors=[],this._primitiveLoadPlans=[],this._loaderPromises=[],this._textureLoaders=[],this._texturesPromises=[],this._textureCallbacks=[],this._bufferViewLoaders=[],this._geometryLoaders=[],this._geometryCallbacks=[],this._structuralMetadataLoader=void 0,this._meshPrimitiveGpmLoader=void 0,this._loadResourcesPromise=void 0,this._resourcesLoaded=!1,this._texturesLoaded=!1,this._supportedImageFormats=void 0,this._postProcessBuffers=[],this._components=void 0}get cacheKey(){}get components(){return this._components}get gltfJson(){return l(this._gltfJsonLoader)?this._gltfJsonLoader.gltf:this._gltfJson}get incrementallyLoadTextures(){return this._incrementallyLoadTextures}get texturesLoaded(){return this._texturesLoaded}async load(){return l(this._promise)?this._promise:(this._promise=Dit(this),this._promise)}_process(t){return this._state===so.READY?!0:(this._state===so.PROCESSING&&Oit(this,t),this._resourcesLoaded&&this._state===so.POST_PROCESSING&&(Mit(this,t.context),this._state=so.PROCESSED),this._resourcesLoaded&&this._state===so.PROCESSED?(mxe(this),this._typedArray=void 0,this._state=so.READY,!0):!1)}_processTextures(t){if(this._textureState===so.READY)return!0;if(this._textureState!==so.PROCESSING)return!1;let n=!0,i=this._textureLoaders;for(let r=0;r<i.length;++r){let o=i[r].process(t);o&&l(this._textureCallbacks[r])&&(this._textureCallbacks[r](),this._textureCallbacks[r]=void 0),n=n&&o}return n?(this._textureState=so.READY,this._texturesLoaded=!0,!0):!1}process(t){if(this._state===so.LOADED&&!l(this._loadResourcesPromise)&&(this._loadResourcesPromise=Rit(this,t).then(()=>{this._resourcesLoaded=!0}).catch(o=>{this._processError=o})),l(this._processError)){this._state=so.FAILED;let o=this._processError;this._processError=void 0,VH(this,o)}let n=this._textureErrors.pop();if(l(n)){let o=this.getError("Failed to load glTF texture",n);throw o.name="TextureError",o}if(this._state===so.FAILED)return!1;let i=!1;try{i=this._process(t)}catch(o){this._state=so.FAILED,VH(this,o)}let r=!1;try{r=this._processTextures(t)}catch(o){this._textureState=so.FAILED,VH(this,o)}return this._incrementallyLoadTextures?i:i&&r}isUnloaded(){return this._state===so.UNLOADED}unload(){l(this._gltfJsonLoader)&&!this._gltfJsonLoader.isDestroyed()&&Fi.unload(this._gltfJsonLoader),this._gltfJsonLoader=void 0,Wrt(this),mxe(this),qrt(this),Yrt(this),Xrt(this),Krt(this),this._components=void 0,this._typedArray=void 0,this._state=so.UNLOADED}};async function Dit(e){e._state=so.LOADING,e._textureState=so.LOADING;try{let t=Fi.getGltfJsonLoader({gltfResource:e._gltfResource,baseResource:e._baseResource,typedArray:e._typedArray,gltfJson:e._gltfJson});return e._gltfJsonLoader=t,await t.load(),e.isDestroyed()||e.isUnloaded()||t.isDestroyed()?void 0:(e._state=so.LOADED,e._textureState=so.LOADED,e)}catch(t){if(e.isDestroyed())return;e._state=so.FAILED,e._textureState=so.FAILED,VH(e,t)}}async function Rit(e,t){dn.supportsWebP.initialized||await dn.supportsWebP.initialize(),e._supportedImageFormats=new RF({webp:dn.supportsWebP(),basis:t.context.supportsBasis});let n=Grt(e,t);return e._state=so.PROCESSING,e._textureState=so.PROCESSING,l(e._gltfJsonLoader)&&e._releaseGltfJson&&(Fi.unload(e._gltfJsonLoader),e._gltfJsonLoader=void 0),n}function VH(e,t){throw e.unload(),e.getError("Failed to load glTF",t)}function Oit(e,t){let n=!0,i=e._geometryLoaders;for(let s=0;s<i.length;++s){let a=i[s].process(t);a&&l(e._geometryCallbacks[s])&&(e._geometryCallbacks[s](),e._geometryCallbacks[s]=void 0),n=n&&a}let r=e._structuralMetadataLoader;if(l(r)){let s=r.process(t);s&&(e._components.structuralMetadata=r.structuralMetadata),n=n&&s}let o=e._meshPrimitiveGpmLoader;if(l(o)){let s=o.process(t);s&&(l(e._components.structuralMetadata)&&_t("structural-metadata-gpm","The model defines both the 'EXT_structural_metadata' extension and the 'NGA_gpm_local' extension. The data from the 'EXT_structural_metadata' extension will be replaced with the data from the 'NGA_gpm_local' extension, and will no longer be available for styling and picking."),e._components.structuralMetadata=o.structuralMetadata),n=n&&s}n&&(e._state=so.POST_PROCESSING)}function Mit(e,t){let n=e._primitiveLoadPlans;for(let i=0;i<n.length;i++){let r=n[i];r.postProcess(t),(r.needsOutlines||r.needsGaussianSplats)&&Nit(e,r)}}function Nit(e,t){let n=e._postProcessBuffers,i=t.primitive,r=i.outlineCoordinates;l(r)&&n.push(r.buffer);let o=i.attributes;for(let a=0;a<o.length;a++){let c=o[a];l(c.buffer)&&n.push(c.buffer)}let s=i.indices;l(s)&&l(s.buffer)&&n.push(s.buffer)}function Lit(e,t,n,i,r,o,s,a,c){let u=e.gltfJson,d=u.accessors[t].bufferView;return Fi.getVertexBufferLoader({gltf:u,gltfResource:e._gltfResource,baseResource:e._baseResource,frameState:c,bufferViewId:d,primitive:i,draco:r,spz:o,attributeSemantic:n,accessorId:t,asynchronous:e._asynchronous,loadBuffer:s,loadTypedArray:a})}function Fit(e,t,n,i,r,o,s){return Fi.getIndexBufferLoader({gltf:e.gltfJson,accessorId:t,gltfResource:e._gltfResource,baseResource:e._baseResource,frameState:s,primitive:n,draco:i,asynchronous:e._asynchronous,loadBuffer:r,loadTypedArray:o})}function yxe(e,t){let n=Fi.getBufferViewLoader({gltf:e.gltfJson,bufferViewId:t,gltfResource:e._gltfResource,baseResource:e._baseResource});return e._bufferViewLoaders.push(n),n}function _Z(e,t,n){let i=t.byteOffset,r=ju(e,t),o=t.count,s=Hf(t.type),a=t.componentType,c=Y.getSizeInBytes(a),u=c*s,f=o*s;if(r===u)return n=new Uint8Array(n),Y.createArrayBufferView(a,n.buffer,n.byteOffset+i,f);let d=Y.createTypedArray(a,f),p=new DataView(n.buffer),g=new Array(s),m=qg(t.componentType);i=n.byteOffset+i;for(let y=0;y<o;++y){m(p,i,s,c,g);for(let A=0;A<s;++A)d[y*s+A]=g[A];i+=r}return d}function Bit(e,t){let n=e.type;if(n===Vt.SCALAR)return t.fill(0);let i=Vt.getMathType(n);return t.fill(i.clone(i.ZERO))}function kit(e,t,n,i){let r=e.type,o=e.count;if(r===Vt.SCALAR)for(let s=0;s<o;s++)n[s]=t[s];else if(r===Vt.VEC4&&i)for(let s=0;s<o;s++)n[s]=Le.unpack(t,s*4);else{let s=Vt.getMathType(r),a=Vt.getNumberOfComponents(r);for(let c=0;c<o;c++)n[c]=s.unpack(t,c*a)}return n}async function Uit(e,t,n,i,r){let{gltfJson:o}=e;if(await t.load(),e.isDestroyed())return;let s=_Z(o,n,t.typedArray);i=i??!1,kit(n,s,r,i)}function jF(e,t,n){let i=new Array(t.count),r=t.bufferView;if(l(r)){let o=yxe(e,r),s=Uit(e,o,t,n,i);return e._loaderPromises.push(s),i}return Bit(t,i)}function Tm(e,t){let n=Y.createTypedArray(t.componentType,t.count*Vt.getNumberOfComponents(t.type));if(!l(t.bufferView))return n;let i=yxe(e,t.bufferView),{gltfJson:r}=e,o=i.load().then(()=>{if(e.isDestroyed())return;let s=_Z(r,t,i.typedArray);n.set(s)});return e._loaderPromises.push(o),n}function Wu(e,t){if(l(t))return e===Number?t[0]:e.unpack(t)}function zit(e){return e===Number?0:new e}function Vit(e){switch(e){case Y.BYTE:return 127;case Y.UNSIGNED_BYTE:return 255;case Y.SHORT:return 32767;case Y.UNSIGNED_SHORT:return 65535;default:return 1}}var jit={VEC2:new U(-1,-1),VEC3:new h(-1,-1,-1),VEC4:new se(-1,-1,-1,-1)};function Hit(e,t){let n=Vit(e.componentDatatype),i=jit[e.type],r=e.min;l(r)&&(r=t.divideByScalar(r,n,r),r=t.maximumByComponent(r,i,r));let o=e.max;l(o)&&(o=t.divideByScalar(o,n,o),o=t.maximumByComponent(o,i,o)),e.min=r,e.max=o}function Git(e,t,n){let i=e.decodeMatrix,r=Wu(n,e.decodedMin),o=Wu(n,e.decodedMax);l(r)&&l(o)&&(t.min=r,t.max=o);let s=new Cn.Quantization;s.componentDatatype=t.componentDatatype,s.type=t.type,i.length===4?(s.quantizedVolumeOffset=i[2],s.quantizedVolumeStepSize=i[0]):i.length===9?(s.quantizedVolumeOffset=new U(i[6],i[7]),s.quantizedVolumeStepSize=new U(i[0],i[4])):i.length===16?(s.quantizedVolumeOffset=new h(i[12],i[13],i[14]),s.quantizedVolumeStepSize=new h(i[0],i[5],i[10])):i.length===25&&(s.quantizedVolumeOffset=new se(i[20],i[21],i[22],i[23]),s.quantizedVolumeStepSize=new se(i[0],i[6],i[12],i[18])),t.quantization=s}function Wit(e,t,n,i,r){let o=e.accessors[t],s=Vt.getMathType(o.type),a=o.normalized??!1,c=new oit;c.name=n,c.semantic=i,c.setIndex=r,c.constant=zit(s),c.componentDatatype=o.componentType,c.normalized=a,c.count=o.count,c.type=o.type,c.min=Wu(s,o.min),c.max=Wu(s,o.max),c.byteOffset=o.byteOffset,c.byteStride=ju(e,o),rr(o,"WEB3D_quantized_attributes")&&Git(o.extensions.WEB3D_quantized_attributes,c,s);let u=c.semantic===ct.POSITION||c.semantic===ct.NORMAL||c.semantic===ct.TANGENT||c.semantic===ct.TEXCOORD||c.semantic===ct.FEATURE_ID||c.semantic===ct.SCALE||c.semantic===ct.ROTATION;return e.extensionsRequired?.includes("KHR_mesh_quantization")&&a&&u&&Hit(c,s),c}function Axe(e){let n=/^\w+_(\d+)$/.exec(e);if(n!==null)return parseInt(n[1])}var qit={gltfSemantic:void 0,renamedSemantic:void 0,modelSemantic:void 0};function yZ(e,t,n){let i=n;e._renameBatchIdSemantic&&(n==="_BATCHID"||n==="BATCHID")&&(i="_FEATURE_ID_0");let r=t.fromGltfSemantic(i),o=qit;return o.gltfSemantic=n,o.renamedSemantic=i,o.modelSemantic=r,o}function Yit(e){let t=e===ct.POSITION,n=e===ct.FEATURE_ID,i=e===ct.TEXCOORD;return t||n||i}function Xit(e,t,n,i){if(e.byteOffset=0,e.byteStride=void 0,e.quantization=t.quantization,n&&(e.buffer=t.buffer),i){let r=l(t.quantization)?t.quantization.componentDatatype:e.componentDatatype;e.typedArray=Y.createArrayBufferView(r,t.typedArray.buffer)}}function Kit(e,t,n,i){if(e.byteOffset=0,e.byteStride=void 0,n&&(e.buffer=t.buffer),i&&l(t.typedArray)&&(e.typedArray=Y.createArrayBufferView(e.componentDatatype,t.typedArray.buffer)),e.semantic===ct.POSITION){let r=s=>{let a=1/0,c=-1/0,u=1/0,f=-1/0,d=1/0,p=-1/0;for(let g=0;g<s.length;g+=3){let m=s[g],y=s[g+1],A=s[g+2];a=Math.min(a,m),c=Math.max(c,m),u=Math.min(u,y),f=Math.max(f,y),d=Math.min(d,A),p=Math.max(p,A)}return[new h(a,u,d),new h(c,f,p)]},o=e.typedArray;[e.min,e.max]=r(o)}}function $it(e,t,n,i,r,o){if(r&&(n.buffer=i.buffer),o){let s=i.typedArray;n.typedArray=_Z(e,t,s),r||(n.byteOffset=0,n.byteStride=void 0)}}function bxe(e,t,n,i,r,o,s,a,c){let u=e.gltfJson,f=u.accessors[t],d=f.bufferView,p=n.gltfSemantic,g=n.renamedSemantic,m=n.modelSemantic,y=l(m)?Axe(g):void 0,b=Wit(u,t,p,m,y);if(!l(r)&&!l(d)&&!l(o))return b;let x=Lit(e,t,p,i,r,o,s,a,c),T=e._geometryLoaders.length;e._geometryLoaders.push(x);let E=x.load();return e._loaderPromises.push(E),e._geometryCallbacks[T]=()=>{l(r)&&l(r.attributes)&&l(r.attributes[p])?Xit(b,x,s,a):l(o)?Kit(b,x,s,a):$it(u,f,b,x,s,a)},b}function xxe(e,t,n,i,r,o,s,a,c){let u=n.modelSemantic,f=u===ct.POSITION,d=u===ct.FEATURE_ID,p=f&&!s&&e._loadAttributesFor2D&&!c.scene3DOnly,g=f&&e._enablePick&&!c.context.webgl2,m=e._loadForClassification&&d,y=e._loadAttributesAsTypedArray,A=!y,b=y||p||g||m,E=bxe(e,t,n,i,r,o,a?!1:A,a?!0:b,c),v=new MT.AttributeLoadPlan(E);return v.loadBuffer=A,v.loadTypedArray=b,v}function Jit(e,t,n,i,r){let o=e.gltfJson.accessors,s=l(n.ROTATION),a=l(n.TRANSLATION)&&l(o[n.TRANSLATION].min)&&l(o[n.TRANSLATION].max),c=yZ(e,Lo,i),u=c.modelSemantic,f=u===Lo.TRANSLATION||u===Lo.ROTATION||u===Lo.SCALE,d=u===Lo.TRANSLATION,p=e._loadAttributesAsTypedArray||s&&f||!r.context.instancedArrays,g=e._enablePick&&!r.context.webgl2,m=!p,y=e._loadAttributesFor2D&&!r.scene3DOnly;return bxe(e,t,c,void 0,void 0,void 0,m,p||d&&(!a||y||g),r)}function Zit(e,t,n,i,r,o){let s=e.gltfJson.accessors[t],a=s.bufferView,c=n.extensions??H.EMPTY_OBJECT,u=c.KHR_draco_mesh_compression,f=l(c.EXT_mesh_primitive_edge_visibility);if(!l(u)&&!l(a))return;let d=new sit;d.count=s.count;let p=e._loadAttributesAsTypedArray,g=(e._loadIndicesForWireframe||e._enablePick)&&!o.context.webgl2,m=e._loadForClassification&&i,A=!p,b=p||g||m||f,E=Fit(e,t,n,u,r?!1:A,r?!0:b,o),v=e._geometryLoaders.length;e._geometryLoaders.push(E);let S=E.load();e._loaderPromises.push(S),e._geometryCallbacks[v]=()=>{d.indexDatatype=E.indexDatatype,d.buffer=E.buffer,d.typedArray=E.typedArray};let I=new MT.IndicesLoadPlan(d);return I.loadBuffer=A,I.loadTypedArray=b,I}function Qit(e,t,n){return new jt({wrapR:e.wrapR,wrapS:e.wrapS,wrapT:e.wrapT,minificationFilter:t??e.minificationFilter,magnificationFilter:n??e.magnificationFilter,maximumAnisotropy:e.maximumAnisotropy})}function au(e,t,n,i,r){let o=e.gltfJson,s=Hu.getImageIdFromTexture({gltf:o,textureId:t.index,supportedImageFormats:e._supportedImageFormats});if(!l(s))return;let a=Fi.getTextureLoader({gltf:o,textureInfo:t,gltfResource:e._gltfResource,baseResource:e._baseResource,supportedImageFormats:e._supportedImageFormats,frameState:n,asynchronous:e._asynchronous}),c=Hu.createModelTextureReader({textureInfo:t}),u=e._textureLoaders.length;e._textureLoaders.push(a);let f=a.load().catch(d=>{if(!e.isDestroyed()){if(!e._incrementallyLoadTextures)throw d;e._textureState=so.FAILED,e._textureErrors.push(d)}});return e._texturesPromises.push(f),e._textureCallbacks[u]=()=>{let d=a.texture;c.texture=d,(l(i)||l(r))&&(d.sampler=Qit(d.sampler,i,r))},c}function ert(e,t,n){let{diffuseTexture:i,specularGlossinessTexture:r,diffuseFactor:o,specularFactor:s,glossinessFactor:a}=t,c=new Eit;return l(i)&&(c.diffuseTexture=au(e,i,n)),l(r)&&(c.specularGlossinessTexture=au(e,r,n)),c.diffuseFactor=Wu(se,o),c.specularFactor=Wu(h,s),c.glossinessFactor=a,c}function trt(e,t,n){let{baseColorTexture:i,metallicRoughnessTexture:r,baseColorFactor:o,metallicFactor:s,roughnessFactor:a}=t,c=new Tit;return l(i)&&(c.baseColorTexture=au(e,i,n)),l(r)&&(c.metallicRoughnessTexture=au(e,r,n)),c.baseColorFactor=Wu(se,o),c.metallicFactor=s,c.roughnessFactor=a,c}function nrt(e,t,n){let{specularFactor:i,specularTexture:r,specularColorFactor:o,specularColorTexture:s}=t,a=new Cit;return l(r)&&(a.specularTexture=au(e,r,n)),l(s)&&(a.specularColorTexture=au(e,s,n)),a.specularFactor=i,a.specularColorFactor=Wu(h,o),a}function irt(e,t,n){let{anisotropyStrength:i=mZ.DEFAULT_ANISOTROPY_STRENGTH,anisotropyRotation:r=mZ.DEFAULT_ANISOTROPY_ROTATION,anisotropyTexture:o}=t,s=new mZ;return l(o)&&(s.anisotropyTexture=au(e,o,n)),s.anisotropyStrength=i,s.anisotropyRotation=r,s}function rrt(e,t,n){let{clearcoatFactor:i=pZ.DEFAULT_CLEARCOAT_FACTOR,clearcoatTexture:r,clearcoatRoughnessFactor:o=pZ.DEFAULT_CLEARCOAT_ROUGHNESS_FACTOR,clearcoatRoughnessTexture:s,clearcoatNormalTexture:a}=t,c=new pZ;return l(r)&&(c.clearcoatTexture=au(e,r,n)),l(s)&&(c.clearcoatRoughnessTexture=au(e,s,n)),l(a)&&(c.clearcoatNormalTexture=au(e,a,n)),c.clearcoatFactor=i,c.clearcoatRoughnessFactor=o,c}function ort(e){return new vit(e)}function srt(e){if(!l(e))return;let t=new Sit;if(l(e.width)){let n=e.width;n>0&&Math.floor(n)===n&&(t.width=n)}if(l(e.pattern)){let n=e.pattern;n>=0&&n<=65535&&Math.floor(n)===n&&(t.pattern=n)}if(!(!l(t.width)&&!l(t.pattern)))return t}function art(e,t,n){let i=new wit,r=t.extensions??H.EMPTY_OBJECT,o=r.KHR_materials_pbrSpecularGlossiness,s=r.KHR_materials_specular,a=r.KHR_materials_anisotropy,c=r.KHR_materials_clearcoat,u=t.pbrMetallicRoughness,f=r.BENTLEY_materials_planar_fill;i.unlit=l(r.KHR_materials_unlit),l(o)?i.specularGlossiness=ert(e,o,n):(l(u)&&(i.metallicRoughness=trt(e,u,n)),l(s)&&!i.unlit&&(i.specular=nrt(e,s,n)),l(a)&&!i.unlit&&(i.anisotropy=irt(e,a,n)),l(c)&&!i.unlit&&(i.clearcoat=rrt(e,c,n))),l(t.emissiveTexture)&&(i.emissiveTexture=au(e,t.emissiveTexture,n)),l(t.normalTexture)&&!e._loadForClassification&&(i.normalTexture=au(e,t.normalTexture,n)),l(t.occlusionTexture)&&(i.occlusionTexture=au(e,t.occlusionTexture,n)),i.emissiveFactor=Wu(h,t.emissiveFactor),i.alphaMode=t.alphaMode,i.alphaCutoff=t.alphaCutoff,i.doubleSided=t.doubleSided,l(f)&&(i.planarFill=ort(f));let d=r.BENTLEY_materials_point_style;if(l(d)&&l(d.diameter)){let p=d.diameter;p>=1&&(i.pointDiameter=Math.floor(p))}return i.lineStyle=srt(r.BENTLEY_materials_line_style),i}function Txe(e,t){let n=new pxe;return n.featureCount=e.featureCount,n.nullFeatureId=e.nullFeatureId,n.propertyTableId=e.propertyTable,n.setIndex=e.attribute,n.label=e.label,n.positionalLabel=t,n}function Exe(e,t,n,i){let r=new pxe,o=e.featureIds;return r.featureCount=n,r.propertyTableId=t,r.setIndex=Axe(o.attribute),r.positionalLabel=i,r}function Cxe(e,t){let n=new _xe;return n.propertyTableId=e.propertyTable,n.featureCount=e.featureCount,n.nullFeatureId=e.nullFeatureId,n.label=e.label,n.positionalLabel=t,n.offset=0,n.repeat=1,n}function vxe(e,t,n,i){let r=new _xe,o=e.featureIds;r.propertyTableId=t,r.featureCount=n,r.offset=o.constant??0;let s=o.divisor??0;return r.repeat=s===0?void 0:s,r.positionalLabel=i,r}function crt(e,t,n,i){let r=new gxe;r.featureCount=t.featureCount,r.nullFeatureId=t.nullFeatureId,r.propertyTableId=t.propertyTable,r.label=t.label,r.positionalLabel=i;let o=t.texture;r.textureReader=au(e,o,n,Wt.NEAREST,Jn.NEAREST);let a=(l(o.channels)?o.channels:[0]).map(function(c){return"rgba".charAt(c)}).join("");return r.textureReader.channels=a,r}function lrt(e,t,n,i,r,o){let s=new gxe,a=t.featureIds,c=a.texture;return s.featureCount=r,s.propertyTableId=n,s.textureReader=au(e,c,i,Wt.NEAREST,Jn.NEAREST),s.textureReader.channels=a.channels,s.positionalLabel=o,s}function urt(e,t,n,i,r){let o=new ait,s=void 0,a=void 0,c=void 0,u=!1;for(let f in t){if(!t.hasOwnProperty(f))continue;let d=t[f],p=yZ(e,ct,f),g=xxe(e,d,p,s,a,c,u,n,r);o.attributes.push(g.attribute),i.attributePlans.push(g)}return o}function frt(e){let i=e?.KHR_gaussian_splatting?.extensions?.KHR_gaussian_splatting_compression_spz_2;if(l(i))return i}function Sxe(e,t){if(!l(t))return;let n=e.gltfJson.materials;if(!l(n)||t<0||t>=n.length)return;let i=n[t];if(!l(i))return;let r=i.pbrMetallicRoughness??H.EMPTY_OBJECT,o=Wu(se,r.baseColorFactor);return l(o)?o:new se(1,1,1,1)}function drt(e){switch(e){case Y.UNSIGNED_BYTE:return 255;case Y.UNSIGNED_SHORT:return 65535;case Y.UNSIGNED_INT:return 4294967295;default:throw new oe("EXT_mesh_primitive_edge_visibility line strings indices must use unsigned scalar component types.")}}function hrt(e,t,n){if(!l(t)||t.length===0)return;let i=new Array(t.length);for(let r=0;r<t.length;r++){let o=t[r]??H.EMPTY_OBJECT,s=o.indices,a=e.gltfJson.accessors[s];if(!l(a))throw new oe("Edge visibility line string accessor not found!");let c=Tm(e,a),u=drt(a.componentType),f=l(o.material)?o.material:n;i[r]={indices:c,restartIndex:u,componentType:a.componentType,materialColor:Sxe(e,f)}}return i}function mrt(e,t){if(!l(t))return;let n={},i=t.visibility;if(l(i)){let r=e.gltfJson.accessors[i];if(!l(r))throw new oe("Edge visibility accessor not found!");n.visibility=Tm(e,r)}if(n.materialColor=Sxe(e,t.material),l(t.silhouetteNormals)){let r=e.gltfJson.accessors[t.silhouetteNormals];l(r)&&(n.silhouetteNormals=Tm(e,r))}return l(t.lineStrings)&&(n.lineStrings=hrt(e,t.lineStrings,t.material)),n}function prt(e,t,n,i){let r=new cit,o=new MT(r);e._primitiveLoadPlans.push(o);let s=t.material;l(s)&&(r.material=art(e,e.gltfJson.materials[s],i));let a=t.extensions??H.EMPTY_OBJECT,c=a.EXT_mesh_polygon;l(c)&&(r.polygon=_rt(e,t,c));let u=a.CESIUM_mesh_vector;l(u)&&(r.vector=yrt(e,u));let f=!1,d=a.CESIUM_primitive_outline;e._loadPrimitiveOutline&&l(d)&&(f=!0,o.needsOutlines=!0,o.outlineIndices=grt(e,d,o)),r.edgeVisibility=mrt(e,a.EXT_mesh_primitive_edge_visibility);let p=frt(a);l(p)&&(f=!0,o.needsGaussianSplats=!0);let g=e._loadForClassification,m=a.KHR_draco_mesh_compression,y=!1,A=t.attributes;if(l(A))for(let O in A){if(!A.hasOwnProperty(O))continue;let L=A[O],_=yZ(e,ct,O),C=_.modelSemantic;if(g&&!Yit(C))continue;C===ct.FEATURE_ID&&(y=!0);let w=xxe(e,L,_,t,m,p,n,f,i);o.attributePlans.push(w),r.attributes.push(w.attribute)}let b=t.targets;if(l(b)&&!g)for(let O=0;O<b.length;++O)r.morphTargets.push(urt(e,b[O],f,o,i));let x=t.indices;if(l(x)){let O=Zit(e,x,t,y,f,i);l(O)&&(o.indicesPlan=O,r.indices=O.indices)}let T=a.EXT_structural_metadata,E=a.EXT_mesh_features,v=a.EXT_feature_metadata,S=l(v),I=a.NGA_gpm_local;l(E)?Art(e,r,E,i):S&&brt(e,r,v,i),l(T)?xrt(r,T):S&&Trt(e,r,v),l(I)&&Ert(r,I);let R=t.mode;if(g&&R!==Oe.TRIANGLES)throw new oe("Only triangle meshes can be used for classification.");return r.primitiveType=R,r}function grt(e,t){let n=t.indices,i=e.gltfJson.accessors[n];return jF(e,i,!1)}function _rt(e,t,n){let i=new Pit,r=e.gltfJson.accessors;return i.count=n.count,t.mode===Oe.LINE_LOOP?(i.loopIndices=Tm(e,r[t.indices]),i.loopIndicesOffsets=Tm(e,r[n.indicesOffsets]),i.triangleIndices=Tm(e,r[n.triangleIndices]),i.triangleIndicesOffsets=Tm(e,r[n.triangleIndicesOffsets])):t.mode===Oe.TRIANGLES&&(i.loopIndices=Tm(e,r[n.loopIndices]),i.loopIndicesOffsets=Tm(e,r[n.loopIndicesOffsets]),i.triangleIndices=Tm(e,r[t.indices]),i.triangleIndicesOffsets=Tm(e,r[n.indicesOffsets])),i}function yrt(e,t){if(!l(t))return;let n=new Iit;n.vector=t.vector,n.count=t.count;let i=e.gltfJson.accessors;function r(o,s){if(l(o))return jF(e,i[o])}return n.polygonAttributeOffsets=r(t.polygonAttributeOffsets,"polygonAttributeOffsets"),n.polygonHoleCounts=r(t.polygonHoleCounts,"polygonHoleCounts"),n.polygonHoleOffsets=r(t.polygonHoleOffsets,"polygonHoleOffsets"),n.polygonIndicesOffsets=r(t.polygonIndicesOffsets,"polygonIndicesOffsets"),n}function Art(e,t,n,i){let r;l(n)&&l(n.featureIds)?r=n.featureIds:r=[];for(let o=0;o<r.length;o++){let s=r[o],a=`featureId_${o}`,c;l(s.texture)?c=crt(e,s,i,a):l(s.attribute)?c=Txe(s,a):c=Cxe(s,a),t.featureIds.push(c)}}function brt(e,t,n,i){let{featureTables:r}=e.gltfJson.extensions.EXT_feature_metadata,o=0,s=n.featureIdAttributes;if(l(s))for(let c=0;c<s.length;++c){let u=s[c],f=u.featureTable,d=e._sortedPropertyTableIds.indexOf(f),p=r[f].count,g=`featureId_${o}`;o++;let m;l(u.featureIds.attribute)?m=Exe(u,d,p,g):m=vxe(u,d,p,g),t.featureIds.push(m)}let a=n.featureIdTextures;if(l(a))for(let c=0;c<a.length;++c){let u=a[c],f=u.featureTable,d=e._sortedPropertyTableIds.indexOf(f),p=r[f].count,g=`featureId_${o}`;o++;let m=lrt(e,u,d,i,p,g);t.featureIds.push(m)}}function xrt(e,t){if(!l(t))return;let{propertyTextures:n,propertyAttributes:i}=t;l(n)&&(e.propertyTextureIds=n),l(i)&&(e.propertyAttributeIds=i)}function Trt(e,t,n){l(n.featureTextures)&&(t.propertyTextureIds=n.featureTextures.map(function(i){return e._sortedFeatureTextureIds.indexOf(i)}))}function Ert(e,t){let n=t.ppeTextures??[];for(let i=0;i<n.length;i++)e.propertyTextureIds.push(i)}function Crt(e,t,n){let i=t.EXT_mesh_gpu_instancing,r=new lit,o=i.attributes;if(l(o))for(let u in o){if(!o.hasOwnProperty(u))continue;let f=o[u];r.attributes.push(Jit(e,f,o,u,n))}let s=i.extensions??H.EMPTY_OBJECT,a=t.EXT_instance_features,c=s.EXT_feature_metadata;return l(a)?vrt(r,a):l(c)&&Srt(e.gltfJson,r,c,e._sortedPropertyTableIds),r}function vrt(e,t){let n=t.featureIds;for(let i=0;i<n.length;i++){let r=n[i],o=`instanceFeatureId_${i}`,s;l(r.attribute)?s=Txe(r,o):s=Cxe(r,o),e.featureIds.push(s)}}function Srt(e,t,n,i){let r=e.extensions.EXT_feature_metadata.featureTables,o=n.featureIdAttributes;if(l(o))for(let s=0;s<o.length;++s){let a=o[s],c=a.featureTable,u=i.indexOf(c),f=r[c].count,d=`instanceFeatureId_${s}`,p;l(a.featureIds.attribute)?p=Exe(a,u,f,d):p=vxe(a,u,f,d),t.featureIds.push(p)}}function wrt(e,t,n){let i=new fit;i.name=t.name,i.matrix=Wu(N,t.matrix),i.translation=Wu(h,t.translation),i.rotation=Wu(Le,t.rotation),i.scale=Wu(h,t.scale);let r=t.extensions??H.EMPTY_OBJECT,o=r.EXT_mesh_gpu_instancing,s=r.AGI_articulations,a=r.CESIUM_mesh_vector;if(l(o)){if(e._loadForClassification)throw new oe("Models with the EXT_mesh_gpu_instancing extension cannot be used for classification.");i.instances=Crt(e,r,n)}l(s)&&(i.articulationName=s.articulationName),l(a)&&(i.meshVector=a);let c=t.mesh;if(l(c)){let u=e.gltfJson.meshes[c],f=VF(u);for(let g=0;g<f.length;++g)i.primitives.push(prt(e,f[g],l(i.instances),n));let d=t.weights??u.weights,p=i.primitives[0].morphTargets;i.morphWeights=l(d)?d.slice():new Array(p.length).fill(0)}return i}function Irt(e,t){let n=e.gltfJson.nodes;if(!l(n))return[];let i=n.map(function(r,o){let s=wrt(e,r,t);return s.index=o,s});for(let r=0;r<i.length;++r){let o=n[r].children;if(l(o))for(let s=0;s<o.length;++s)i[r].children.push(i[o[s]])}return i}function Prt(e,t,n){let i=new uit,r=t.joints;i.joints=r.map(s=>n[s]);let o=t.inverseBindMatrices;if(l(o)){let s=e.gltfJson.accessors[o];i.inverseBindMatrices=jF(e,s)}else i.inverseBindMatrices=new Array(r.length).fill(N.IDENTITY);return i}function Drt(e,t){let n=e.gltfJson.skins;if(e._loadForClassification||!l(n))return[];let i=n.map(function(o,s){let a=Prt(e,o,t);return a.index=s,a}),r=e.gltfJson.nodes;for(let o=0;o<t.length;++o){let s=r[o].skin;l(s)&&(t[o].skin=i[s])}return i}async function Rrt(e,t,n,i){let r=new DF({gltf:e.gltfJson,extension:t,extensionLegacy:n,gltfResource:e._gltfResource,baseResource:e._baseResource,supportedImageFormats:e._supportedImageFormats,frameState:i,asynchronous:e._asynchronous});return e._structuralMetadataLoader=r,r.load()}async function Ort(e,t,n,i){let r=new zF({gltf:t,extension:n,gltfResource:e._gltfResource,baseResource:e._baseResource,supportedImageFormats:e._supportedImageFormats,frameState:i,asynchronous:e._asynchronous});return e._meshPrimitiveGpmLoader=r,r.load()}function Mrt(e,t){let n=new hit,i=e.gltfJson.accessors,r=i[t.input];n.input=jF(e,r);let o=t.interpolation;n.interpolation=ym[o]??ym.LINEAR;let s=i[t.output];return n.output=jF(e,s,!0),n}function Nrt(e,t){let n=new mit,i=e.node;if(!l(i))return;n.node=t[i];let r=e.path.toUpperCase();return n.path=dit[r],n}function Lrt(e,t,n){let i=new pit,r=e.sampler;return i.sampler=t[r],i.target=Nrt(e.target,n),i}function Frt(e,t,n){let i=new git;i.name=t.name;let r=t.samplers.map(function(s,a){let c=Mrt(e,s);return c.index=a,c}),o=t.channels.map(function(s){return Lrt(s,r,n)});return i.samplers=r,i.channels=o,i}function Brt(e,t){let n=e.gltfJson.animations;return e._loadForClassification||!l(n)?[]:n.map(function(r,o){let s=Frt(e,r,t);return s.index=o,s})}function krt(e){let t=new _it;t.name=e.name;let n=e.type.toUpperCase();return t.type=ul[n],t.minimumValue=e.minimumValue,t.maximumValue=e.maximumValue,t.initialValue=e.initialValue,t}function Urt(e){let t=new yit;return t.name=e.name,t.stages=e.stages.map(krt),t}function zrt(e){let n=(e.extensions??H.EMPTY_OBJECT).AGI_articulations?.articulations;return l(n)?n.map(Urt):[]}function Vrt(e){let t;return l(e.scenes)&&l(e.scene)&&(t=e.scenes[e.scene].nodes),t=t??e.nodes,t=l(t)?t:[],t}function jrt(e,t){let n=new bit,i=Vrt(e);return n.nodes=i.map(function(r){return t[r]}),n}var Hrt=new h;function Grt(e,t){let n=e.gltfJson,i=n.extensions??H.EMPTY_OBJECT,r=i.EXT_structural_metadata,o=i.EXT_feature_metadata,s=i.CESIUM_RTC;if(l(o)){let x=o.featureTables,T=o.featureTextures,E=l(x)?x:[],v=l(T)?T:[];e._sortedPropertyTableIds=Object.keys(E).sort(),e._sortedFeatureTextureIds=Object.keys(v).sort()}let a=Irt(e,t),c=Drt(e,a),u=Brt(e,a),f=zrt(n),d=jrt(n,a),p=new xit,g=new Ait,m=n.asset.copyright;if(l(m)){let x=m.split(";").map(function(T){return new It(T.trim())});g.credits=x}if(p.asset=g,p.scene=d,p.nodes=a,p.skins=c,p.animations=u,p.articulations=f,p.upAxis=e._upAxis,p.forwardAxis=e._forwardAxis,l(s)){let x=h.fromArray(s.center,0,Hrt);p.transform=N.fromTranslation(x,p.transform)}if(e._components=p,l(r)||l(o)){let x=Rrt(e,r,o,t);e._loaderPromises.push(x)}let y=i.NGA_gpm_local;if(l(y)){let x=FF.load(y);e._components.extensions.NGA_gpm_local=x}let A=n.meshes;if(l(A))for(let x of A){let T=x.primitives;if(l(T))for(let E of T){let v=E.extensions;if(l(v)){let S=v.NGA_gpm_local;if(l(S)){let I=Ort(e,n,S,t);e._loaderPromises.push(I)}}}}let b=[];return Zn(b,e._loaderPromises),e._incrementallyLoadTextures||Zn(b,e._texturesPromises),Promise.all(b)}function Wrt(e){let t=e._textureLoaders;for(let n=0;n<t.length;++n)t[n]=!t[n].isDestroyed()&&Fi.unload(t[n]);e._textureLoaders.length=0}function mxe(e){let t=e._bufferViewLoaders;for(let n=0;n<t.length;++n)t[n]=!t[n].isDestroyed()&&Fi.unload(t[n]);e._bufferViewLoaders.length=0}function qrt(e){let t=e._geometryLoaders;for(let n=0;n<t.length;++n)t[n]=!t[n].isDestroyed()&&Fi.unload(t[n]);e._geometryLoaders.length=0}function Yrt(e){let t=e._postProcessBuffers;for(let n=0;n<t.length;n++){let i=t[n];i.isDestroyed()||i.destroy()}t.length=0}function Xrt(e){l(e._structuralMetadataLoader)&&!e._structuralMetadataLoader.isDestroyed()&&(e._structuralMetadataLoader.destroy(),e._structuralMetadataLoader=void 0)}function Krt(e){l(e._meshPrimitiveGpmLoader)&&!e._meshPrimitiveGpmLoader.isDestroyed()&&(e._meshPrimitiveGpmLoader.destroy(),e._meshPrimitiveGpmLoader=void 0)}var Gf=gZ;function NT(e){this._url=e,this._cubeMapBuffers=void 0,this._texture=void 0,this._maximumMipmapLevel=void 0,this._loading=!1,this._ready=!1,this._errorEvent=new be}Object.defineProperties(NT.prototype,{url:{get:function(){return this._url}},errorEvent:{get:function(){return this._errorEvent}},texture:{get:function(){return this._texture}},maximumMipmapLevel:{get:function(){return this._maximumMipmapLevel}},ready:{get:function(){return this._ready}}});NT.isSupported=function(e){return(e.colorBufferHalfFloat&&e.halfFloatingPointTexture||e.floatingPointTexture&&e.colorBufferFloat)&&e.supportsTextureLod};function AZ(e){e._cubeMapBuffers=void 0}NT.prototype.update=function(e){let{context:t}=e;if(!NT.isSupported(t))return;if(l(this._texture)){AZ(this);return}if(!l(this._texture)&&!this._loading){let f=t.textureCache.getTexture(this._url);l(f)&&(AZ(this),this._texture=f,this._maximumMipmapLevel=this._texture.maximumMipmapLevel,this._ready=!0)}let n=this._cubeMapBuffers;if(!l(n)&&!this._loading){let f=this;Ou(this._url).then(function(d){f._cubeMapBuffers=d,f._loading=!1}).catch(function(d){f.isDestroyed()||f._errorEvent.raiseEvent(d)}),this._loading=!0}if(!l(this._cubeMapBuffers))return;let{pixelDatatype:i}=n[0].positiveX;l(i)||(i=t.halfFloatingPointTexture?ze.HALF_FLOAT:ze.FLOAT);let r=Ke.RGBA,o=n.length;this._maximumMipmapLevel=o-1;let s=n[0].positiveX.width,a=Math.log2(s)+1;if(o!==a){let f={};Object.values(ns.FaceName).forEach(d=>{f[d]=void 0});for(let d=o;d<a;d++)n.push(f)}let c=new jt({minificationFilter:Wt.LINEAR_MIPMAP_LINEAR}),u=new ns({context:t,source:n[0],flipY:!1,pixelDatatype:i,pixelFormat:r,sampler:c});u.loadMipmaps(n.slice(1)),this._texture=u,this._texture.maximumMipmapLevel=this._maximumMipmapLevel,t.textureCache.addTexture(this._url,this._texture),this._ready=!0};NT.prototype.isDestroyed=function(){return!1};NT.prototype.destroy=function(){return AZ(this),this._texture=this._texture&&this._texture.destroy(),le(this)};var Em=NT;function HF(e){e=e??H.EMPTY_OBJECT;let t=l(e.imageBasedLightingFactor)?U.clone(e.imageBasedLightingFactor):new U(1,1);this._imageBasedLightingFactor=t;let n=e.sphericalHarmonicCoefficients;this._sphericalHarmonicCoefficients=n,this._specularEnvironmentMaps=e.specularEnvironmentMaps,this._specularEnvironmentCubeMap=void 0,this._specularEnvironmentCubeMapDirty=!0,this._specularEnvironmentMapLoaded=!1,this._previousSpecularEnvironmentMapLoaded=!1,this._useDefaultSpecularMaps=!1,this._useDefaultSphericalHarmonics=!1,this._shouldRegenerateShaders=!1,this._previousFrameNumber=void 0,this._previousFrameContext=void 0,this._previousImageBasedLightingFactor=U.clone(t),this._previousSphericalHarmonicCoefficients=n,this._removeErrorListener=void 0}Object.defineProperties(HF.prototype,{imageBasedLightingFactor:{get:function(){return this._imageBasedLightingFactor},set:function(e){this._previousImageBasedLightingFactor=U.clone(this._imageBasedLightingFactor,this._previousImageBasedLightingFactor),this._imageBasedLightingFactor=U.clone(e,this._imageBasedLightingFactor)}},sphericalHarmonicCoefficients:{get:function(){return this._sphericalHarmonicCoefficients},set:function(e){this._previousSphericalHarmonicCoefficients=this._sphericalHarmonicCoefficients,this._sphericalHarmonicCoefficients=e}},specularEnvironmentMaps:{get:function(){return this._specularEnvironmentMaps},set:function(e){e!==this._specularEnvironmentMaps&&(this._specularEnvironmentCubeMapDirty=this._specularEnvironmentCubeMapDirty||e!==this._specularEnvironmentMaps,this._specularEnvironmentMapLoaded=!1),this._specularEnvironmentMaps=e}},enabled:{get:function(){return this._imageBasedLightingFactor.x>0||this._imageBasedLightingFactor.y>0}},shouldRegenerateShaders:{get:function(){return this._shouldRegenerateShaders}},specularEnvironmentCubeMap:{get:function(){return this._specularEnvironmentCubeMap}},useDefaultSphericalHarmonics:{get:function(){return this._useDefaultSphericalHarmonics}},useDefaultSpecularMaps:{get:function(){return this._useDefaultSpecularMaps}},useSpecularEnvironmentMaps:{get:function(){return l(this._specularEnvironmentCubeMap)&&this._specularEnvironmentCubeMap.ready||this._useDefaultSpecularMaps}}});function $rt(e,t){if(Em.isSupported(t)){if(e._specularEnvironmentCubeMap=e._specularEnvironmentCubeMap&&e._specularEnvironmentCubeMap.destroy(),l(e._specularEnvironmentMaps)){let n=new Em(e._specularEnvironmentMaps);e._specularEnvironmentCubeMap=n,e._removeErrorListener=n.errorEvent.addEventListener(i=>{console.error(`Error loading specularEnvironmentMaps: ${i}`)})}e._shouldRegenerateShaders=!0}}HF.prototype.update=function(e){if(e.frameNumber===this._previousFrameNumber&&e.context===this._previousFrameContext)return;this._previousFrameNumber=e.frameNumber;let t=this._previousFrameContext=e.context;e.brdfLutGenerator.update(e),this._shouldRegenerateShaders=!1;let n=this._imageBasedLightingFactor,i=this._previousImageBasedLightingFactor;U.equals(n,i)||(this._shouldRegenerateShaders=n.x>0&&i.x===0||n.x===0&&i.x>0,this._shouldRegenerateShaders=this._shouldRegenerateShaders||n.y>0&&i.y===0||n.y===0&&i.y>0,this._previousImageBasedLightingFactor=U.clone(this._imageBasedLightingFactor,this._previousImageBasedLightingFactor)),this._previousSphericalHarmonicCoefficients!==this._sphericalHarmonicCoefficients&&(this._shouldRegenerateShaders=this._shouldRegenerateShaders||l(this._previousSphericalHarmonicCoefficients)!==l(this._sphericalHarmonicCoefficients),this._previousSphericalHarmonicCoefficients=this._sphericalHarmonicCoefficients),this._shouldRegenerateShaders=this._shouldRegenerateShaders||this._previousSpecularEnvironmentMapLoaded!==this._specularEnvironmentMapLoaded,this._previousSpecularEnvironmentMapLoaded=this._specularEnvironmentMapLoaded,this._specularEnvironmentCubeMapDirty&&($rt(this,t),this._specularEnvironmentCubeMapDirty=!1),l(this._specularEnvironmentCubeMap)&&(this._specularEnvironmentCubeMap.update(e),this._specularEnvironmentCubeMap.ready&&(this._specularEnvironmentMapLoaded=!0));let r=!l(this._specularEnvironmentCubeMap)&&l(e.specularEnvironmentMaps)&&!this._useDefaultSpecularMaps,o=!l(e.specularEnvironmentMaps)&&this._useDefaultSpecularMaps,s=!l(this._sphericalHarmonicCoefficients)&&l(e.sphericalHarmonicCoefficients)&&!this._useDefaultSphericalHarmonics,a=!l(e.sphericalHarmonicCoefficients)&&this._useDefaultSphericalHarmonics;this._shouldRegenerateShaders=this._shouldRegenerateShaders||r||o||s||a,this._useDefaultSpecularMaps=!l(this._specularEnvironmentCubeMap)&&l(e.specularEnvironmentMaps),this._useDefaultSphericalHarmonics=!l(this._sphericalHarmonicCoefficients)&&l(e.sphericalHarmonicCoefficients)};HF.prototype.isDestroyed=function(){return!1};HF.prototype.destroy=function(){return this._specularEnvironmentCubeMap=this._specularEnvironmentCubeMap&&this._specularEnvironmentCubeMap.destroy(),this._removeErrorListener=this._removeErrorListener&&this._removeErrorListener(),le(this)};var LT=HF;var GF=`uniform sampler2D u_pointCloud_colorGBuffer; uniform sampler2D u_pointCloud_depthGBuffer; uniform vec2 u_distanceAndEdlStrength; in vec2 v_textureCoordinates; @@ -8198,7 +8068,7 @@ color.rgb *= shade; out_FragColor = vec4(color); gl_FragDepth = depthOrLogDepth; } -`;function wS(){this._framebuffer=new ai({colorAttachmentsLength:2,depth:!0,supportsDepthTexture:!0}),this._drawCommand=void 0,this._clearCommand=void 0,this._strength=1,this._radius=1}Object.defineProperties(wS.prototype,{framebuffer:{get:function(){return this._framebuffer.framebuffer}},colorGBuffer:{get:function(){return this._framebuffer.getColorTexture(0)}},depthGBuffer:{get:function(){return this._framebuffer.getColorTexture(1)}}});function Ftt(e){e._framebuffer.destroy(),e._drawCommand=void 0,e._clearCommand=void 0}var RJ=new U;function Btt(e,t){let n=new Ye({defines:["LOG_DEPTH_WRITE"],sources:[JL]}),i={u_pointCloud_colorGBuffer:function(){return e.colorGBuffer},u_pointCloud_depthGBuffer:function(){return e.depthGBuffer},u_distanceAndEdlStrength:function(){return RJ.x=e._radius,RJ.y=e._strength,RJ}},r=Ge.fromCache({blending:tn.ALPHA_BLEND,depthMask:!0,depthTest:{enabled:!0},stencilTest:Yt.setCesium3DTileBit(),stencilMask:Yt.CESIUM_3D_TILE_MASK});e._drawCommand=t.createViewportQuadCommand(n,{uniformMap:i,renderState:r,pass:Ie.CESIUM_3D_TILE,owner:e}),e._clearCommand=new li({framebuffer:e.framebuffer,color:new z(0,0,0,0),depth:1,renderState:Ge.fromCache(),pass:Ie.CESIUM_3D_TILE,owner:e})}function ktt(e,t){let n=t.drawingBufferWidth,i=t.drawingBufferHeight;e._framebuffer.update(t,n,i),Btt(e,t)}function fye(e){return e.drawBuffers&&e.fragmentDepth}wS.isSupported=fye;function Utt(e,t){let n=e.shaderCache.getDerivedShaderProgram(t,"EC");if(!l(n)){let i=t._attributeLocations,r=t.fragmentShaderSource.clone();r.sources.splice(0,0,`layout (location = 0) out vec4 out_FragData_0; +`;function tw(){this._framebuffer=new ai({colorAttachmentsLength:2,depth:!0,supportsDepthTexture:!0}),this._drawCommand=void 0,this._clearCommand=void 0,this._strength=1,this._radius=1}Object.defineProperties(tw.prototype,{framebuffer:{get:function(){return this._framebuffer.framebuffer}},colorGBuffer:{get:function(){return this._framebuffer.getColorTexture(0)}},depthGBuffer:{get:function(){return this._framebuffer.getColorTexture(1)}}});function Jrt(e){e._framebuffer.destroy(),e._drawCommand=void 0,e._clearCommand=void 0}var bZ=new U;function Zrt(e,t){let n=new Ye({defines:["LOG_DEPTH_WRITE"],sources:[GF]}),i={u_pointCloud_colorGBuffer:function(){return e.colorGBuffer},u_pointCloud_depthGBuffer:function(){return e.depthGBuffer},u_distanceAndEdlStrength:function(){return bZ.x=e._radius,bZ.y=e._strength,bZ}},r=Ge.fromCache({blending:tn.ALPHA_BLEND,depthMask:!0,depthTest:{enabled:!0},stencilTest:Yt.setCesium3DTileBit(),stencilMask:Yt.CESIUM_3D_TILE_MASK});e._drawCommand=t.createViewportQuadCommand(n,{uniformMap:i,renderState:r,pass:Ie.CESIUM_3D_TILE,owner:e}),e._clearCommand=new li({framebuffer:e.framebuffer,color:new z(0,0,0,0),depth:1,renderState:Ge.fromCache(),pass:Ie.CESIUM_3D_TILE,owner:e})}function Qrt(e,t){let n=t.drawingBufferWidth,i=t.drawingBufferHeight;e._framebuffer.update(t,n,i),Zrt(e,t)}function wxe(e){return e.drawBuffers&&e.fragmentDepth}tw.isSupported=wxe;function eot(e,t){let n=e.shaderCache.getDerivedShaderProgram(t,"EC");if(!l(n)){let i=t._attributeLocations,r=t.fragmentShaderSource.clone();r.sources.splice(0,0,`layout (location = 0) out vec4 out_FragData_0; layout (location = 1) out vec4 out_FragData_1;`),r.sources=r.sources.map(function(o){return o=Ye.replaceMain(o,"czm_point_cloud_post_process_main"),o=o.replaceAll(/out_FragColor/g,"out_FragData_0"),o}),r.sources.push(`void main() { czm_point_cloud_post_process_main(); @@ -8208,7 +8078,134 @@ layout (location = 1) out vec4 out_FragData_1;`),r.sources=r.sources.map(functio #else out_FragData_1 = czm_packDepth(gl_FragCoord.z); #endif -}`),n=e.shaderCache.createDerivedShaderProgram(t,"EC",{vertexShaderSource:t.vertexShaderSource,fragmentShaderSource:r,attributeLocations:i})}return n}wS.prototype.update=function(e,t,n,i){if(!fye(e.context))return;this._strength=n.eyeDomeLightingStrength,this._radius=n.eyeDomeLightingRadius*e.pixelRatio,ktt(this,e.context);let r,o=e.commandList,s=o.length;for(r=t;r<s;++r){let u=o[r];if(u.primitiveType!==Oe.POINTS||u.pass===Ie.TRANSLUCENT)continue;let f,d,p=u.derivedCommands.pointCloudProcessor;l(p)&&(f=p.command,d=p.originalShaderProgram),(!l(f)||u.dirty||d!==u.shaderProgram||f.framebuffer!==this.framebuffer)&&(f=at.shallowClone(u,f),f.framebuffer=this.framebuffer,f.shaderProgram=Utt(e.context,u.shaderProgram),f.castShadows=!1,f.receiveShadows=!1,l(p)||(p={command:f,originalShaderProgram:u.shaderProgram},u.derivedCommands.pointCloudProcessor=p),p.originalShaderProgram=u.shaderProgram),o[r]=f}let a=this._clearCommand,c=this._drawCommand;c.boundingVolume=i,o.push(c),o.push(a)};wS.prototype.isDestroyed=function(){return!1};wS.prototype.destroy=function(){return Ftt(this),le(this)};var Wg=wS;function dye(e){let t=e??{};this.attenuation=t.attenuation??!1,this.geometricErrorScale=t.geometricErrorScale??1,this.maximumAttenuation=t.maximumAttenuation,this.baseResolution=t.baseResolution,this.eyeDomeLighting=t.eyeDomeLighting??!0,this.eyeDomeLightingStrength=t.eyeDomeLightingStrength??1,this.eyeDomeLightingRadius=t.eyeDomeLightingRadius??1,this.backFaceCulling=t.backFaceCulling??!1,this.normalShading=t.normalShading??!0}dye.isSupported=function(e){return Wg.isSupported(e.context)};var Yp=dye;var Fc={},ztt=new se(0,0,0,1),fl=new se,Vtt=new et,OJ=new U,MJ=new U;Fc.worldToWindowCoordinates=function(e,t,n){return Fc.worldWithEyeOffsetToWindowCoordinates(e,t,h.ZERO,n)};var hye=new se,mye=new h;function ZL(e,t,n,i){let r=n.viewMatrix,o=N.multiplyByVector(r,se.fromElements(e.x,e.y,e.z,1,hye),hye),s=h.multiplyComponents(t,h.normalize(o,mye),mye);return o.x+=t.x+s.x,o.y+=t.y+s.y,o.z+=s.z,N.multiplyByVector(n.frustum.projectionMatrix,o,i)}var jtt=new he(Math.PI,D.PI_OVER_TWO),Htt=new h,Gtt=new h;Fc.worldWithEyeOffsetToWindowCoordinates=function(e,t,n,i){let r=e.frameState,o=Fc.computeActualEllipsoidPosition(r,t,ztt);if(!l(o))return;let s=e.canvas,a=Vtt;a.x=0,a.y=0,a.width=s.clientWidth,a.height=s.clientHeight;let c=e.camera,u=!1;if(r.mode===re.SCENE2D){let f=e.mapProjection,d=jtt,p=f.project(d,Htt),g=h.clone(c.position,Gtt),m=c.frustum.clone(),y=N.computeViewportTransformation(a,0,1,new N),A=c.frustum.projectionMatrix,b=c.positionWC.y,x=h.fromElements(D.sign(b)*p.x-b,0,-c.positionWC.x),T=At.pointToGLWindowCoordinates(A,y,x);if(b===0||T.x<=0||T.x>=s.clientWidth)u=!0;else{if(T.x>s.clientWidth*.5){a.width=T.x,c.frustum.right=p.x-b,fl=ZL(o,n,c,fl),Fc.clipToGLWindowCoordinates(a,fl,OJ),a.x+=T.x,c.position.x=-c.position.x;let E=c.frustum.right;c.frustum.right=-c.frustum.left,c.frustum.left=-E,fl=ZL(o,n,c,fl),Fc.clipToGLWindowCoordinates(a,fl,MJ)}else{a.x+=T.x,a.width-=T.x,c.frustum.left=-p.x-b,fl=ZL(o,n,c,fl),Fc.clipToGLWindowCoordinates(a,fl,OJ),a.x=a.x-a.width,c.position.x=-c.position.x;let E=c.frustum.left;c.frustum.left=-c.frustum.right,c.frustum.right=-E,fl=ZL(o,n,c,fl),Fc.clipToGLWindowCoordinates(a,fl,MJ)}h.clone(g,c.position),c.frustum=m.clone(),i=U.clone(OJ,i),(i.x<0||i.x>s.clientWidth)&&(i.x=MJ.x)}}if(r.mode!==re.SCENE2D||u){if(fl=ZL(o,n,c,fl),fl.z<0&&!(c.frustum instanceof gn)&&!(c.frustum instanceof ys))return;i=Fc.clipToGLWindowCoordinates(a,fl,i)}return i.y=s.clientHeight-i.y,i};Fc.worldToDrawingBufferCoordinates=function(e,t,n){if(n=Fc.worldToWindowCoordinates(e,t,n),!!l(n))return Fc.transformWindowToDrawingBuffer(e,n,n)};var qg=new h,Wtt=new he;Fc.computeActualEllipsoidPosition=function(e,t,n){let i=e.mode;if(i===re.SCENE3D)return h.clone(t,n);let r=e.mapProjection,o=r.ellipsoid.cartesianToCartographic(t,Wtt);if(!l(o))return;if(r.project(o,qg),i===re.COLUMBUS_VIEW)return h.fromElements(qg.z,qg.x,qg.y,n);if(i===re.SCENE2D)return h.fromElements(0,qg.x,qg.y,n);let s=e.morphTime;return h.fromElements(D.lerp(qg.z,t.x,s),D.lerp(qg.x,t.y,s),D.lerp(qg.y,t.z,s),n)};var pye=new h,gye=new h,_ye=new N;Fc.clipToGLWindowCoordinates=function(e,t,n){return h.divideByScalar(t,t.w,pye),N.computeViewportTransformation(e,0,1,_ye),N.multiplyByPoint(_ye,pye,gye),U.fromCartesian3(gye,n)};Fc.transformWindowToDrawingBuffer=function(e,t,n){let i=e.canvas,r=e.drawingBufferWidth/i.clientWidth,o=e.drawingBufferHeight/i.clientHeight;return U.fromElements(t.x*r,t.y*o,n)};var qtt=new se,yye=new se;Fc.drawingBufferToWorldCoordinates=function(e,t,n,i){let o=e.context.uniformState,s=o.currentFrustum,a=s.x,c=s.y;if(e.frameState.useLogDepth){let g=n*o.log2FarDepthFromNearPlusOne,m=Math.pow(2,g)-1;n=c*(1-a/(m+a))/(c-a)}let u=e.view.passState.viewport,f=se.clone(se.UNIT_W,qtt);f.x=(t.x-u.x)/u.width*2-1,f.y=(t.y-u.y)/u.height*2-1,f.z=n*2-1,f.w=1;let d,p=e.camera.frustum;if(l(p.fovy)){d=N.multiplyByVector(o.inverseViewProjection,f,yye);let g=1/d.w;h.multiplyByScalar(d,g,d)}else{let g=p.offCenterFrustum;l(g)&&(p=g),d=yye,d.x=(f.x*(p.right-p.left)+p.left+p.right)*.5,d.y=(f.y*(p.top-p.bottom)+p.bottom+p.top)*.5,d.z=(f.z*(a-c)-a-c)*.5,d.w=1,d=N.multiplyByVector(o.inverseView,d,d)}return h.fromCartesian4(d,i)};var dr=Fc;var IS={};IS._deprecationWarning=qr;var Yg=Uint32Array.BYTES_PER_ELEMENT;IS.parse=function(e,t){let n=t??0;t=n;let i=new Uint8Array(e),r=new DataView(e);t+=Yg;let o=r.getUint32(t,!0);if(o!==1)throw new oe(`Only Batched 3D Model version 1 is supported. Version ${o} is not.`);t+=Yg;let s=r.getUint32(t,!0);t+=Yg;let a=r.getUint32(t,!0);t+=Yg;let c=r.getUint32(t,!0);t+=Yg;let u=r.getUint32(t,!0);t+=Yg;let f=r.getUint32(t,!0);t+=Yg;let d;u>=570425344?(t-=Yg*2,d=a,u=c,f=0,a=0,c=0,IS._deprecationWarning("b3dm-legacy-header","This b3dm header is using the legacy format [batchLength] [batchTableByteLength]. The new format is [featureTableJsonByteLength] [featureTableBinaryByteLength] [batchTableJsonByteLength] [batchTableBinaryByteLength] from https://github.com/CesiumGS/3d-tiles/tree/main/specification/TileFormats/Batched3DModel.")):f>=570425344&&(t-=Yg,d=u,u=a,f=c,a=0,c=0,IS._deprecationWarning("b3dm-legacy-header","This b3dm header is using the legacy format [batchTableJsonByteLength] [batchTableBinaryByteLength] [batchLength]. The new format is [featureTableJsonByteLength] [featureTableBinaryByteLength] [batchTableJsonByteLength] [batchTableBinaryByteLength] from https://github.com/CesiumGS/3d-tiles/tree/main/specification/TileFormats/Batched3DModel."));let p;a===0?p={BATCH_LENGTH:d??0}:(p=Ro(i,t,a),t+=a);let g=new Uint8Array(e,t,c);t+=c;let m,y;u>0&&(m=Ro(i,t,u),t+=u,f>0&&(y=new Uint8Array(e,t,f),y=new Uint8Array(y),t+=f));let A=n+s-t;if(A===0)throw new oe("glTF byte length must be greater than 0.");let b;return t%4===0?b=new Uint8Array(e,t,A):(IS._deprecationWarning("b3dm-glb-unaligned","The embedded glb is not aligned to a 4-byte boundary."),b=new Uint8Array(i.subarray(t,t+A))),{batchLength:d,featureTableJson:p,featureTableBinary:g,batchTableJson:m,batchTableBinary:y,gltf:b}};var QL=IS;function eF(e,t){this.json=e,this.buffer=t,this._cachedTypedArrays={},this.featuresLength=0}function Aye(e,t,n,i,r,o){let s=e._cachedTypedArrays,a=s[t];return l(a)||(a=Y.createArrayBufferView(n,e.buffer.buffer,e.buffer.byteOffset+o,r*i),s[t]=a),a}function Ytt(e,t,n,i){let r=e._cachedTypedArrays,o=r[t];return l(o)||(o=Y.createTypedArray(n,i),r[t]=o),o}eF.prototype.getGlobalProperty=function(e,t,n){let i=this.json[e];if(l(i))return l(i.byteOffset)?(t=t??Y.UNSIGNED_INT,n=n??1,Aye(this,e,t,n,1,i.byteOffset)):i};eF.prototype.hasProperty=function(e){return l(this.json[e])};eF.prototype.getPropertyArray=function(e,t,n){let i=this.json[e];if(l(i))return l(i.byteOffset)?(l(i.componentType)&&(t=Y.fromName(i.componentType)),Aye(this,e,t,n,this.featuresLength,i.byteOffset)):Ytt(this,e,t,i)};eF.prototype.getProperty=function(e,t,n,i,r){let o=this.json[e];if(!l(o))return;let s=this.getPropertyArray(e,t,n);if(n===1)return s[i];for(let a=0;a<n;++a)r[a]=s[n*i+a];return r};var hm=eF;function tF(e){let t=e.count,n=e.batchTable,i=e.binaryBody,r=e.parseAsPropertyAttributes??!1,o=e.customAttributeOutput,s=Xtt(n),a;l(s.jsonProperties)&&(a=new Hg({count:t,properties:s.jsonProperties}));let c;l(s.hierarchy)&&(c=new Jx({extension:s.hierarchy,binaryBody:i}));let u=lm.BATCH_TABLE_CLASS_NAME,f=s.binaryProperties,d,p,g;if(r){let A=$tt(t,u,f,i,o);g=A.transcodedSchema,p=[new mT({propertyAttribute:A.propertyAttributeJson,class:A.transcodedClass})]}else{let A=Ktt(t,u,f,i);g=A.transcodedSchema;let b=A.featureTableJson;d=new kd({count:b.count,properties:b.properties,class:A.transcodedClass,bufferViews:A.bufferViewsTypedArrays}),p=[]}let m=[];if(l(d)||l(a)||l(c)){let A=new iu({id:0,name:"Batch Table",count:t,metadataTable:d,jsonMetadataTable:a,batchTableHierarchy:c});m.push(A)}let y={schema:g,propertyTables:m,propertyAttributes:p,extensions:s.extensions,extras:s.extras};return new Va(y)}function Xtt(e){let t=e.HIERARCHY,n=e.extras,i=e.extensions,r;l(t)?(tF._deprecationWarning("batchTableHierarchyExtension","The batch table HIERARCHY property has been moved to an extension. Use extensions.3DTILES_batch_table_hierarchy instead."),r=t):l(i)&&(r=i["3DTILES_batch_table_hierarchy"]);let o,s={};for(let a in e){if(!e.hasOwnProperty(a)||a==="HIERARCHY"||a==="extensions"||a==="extras")continue;let c=e[a];Array.isArray(c)?(o=l(o)?o:{},o[a]=c):s[a]=c}return{binaryProperties:s,jsonProperties:o,hierarchy:r,extras:n,extensions:i}}function Ktt(e,t,n,i){let r={},o={},s={},a=0;for(let d in n){if(!n.hasOwnProperty(d))continue;if(!l(i))throw new oe(`Property ${d} requires a batch table binary.`);let p=n[d],g=Fd(p);o[d]={bufferView:a},r[d]=bye(p),s[a]=g.createArrayBufferView(i.buffer,i.byteOffset+p.byteOffset,e),a++}let c={classes:{}};c.classes[t]={properties:r};let u=eu.fromJson(c);return{featureTableJson:{class:t,count:e,properties:o},bufferViewsTypedArrays:s,transcodedSchema:u,transcodedClass:u.classes[t]}}function $tt(e,t,n,i,r){let o={},s={},a=0;for(let d in n){if(!n.hasOwnProperty(d))continue;let p=n[d];if(!l(i)&&!l(p.typedArray))throw new oe(`Property ${d} requires a batch table binary.`);let g=xt.sanitizeGlslIdentifier(d);(g===""||o.hasOwnProperty(g))&&(g=`property_${a}`,a++);let m=bye(p);m.name=d,o[g]=m;let y=g.toUpperCase();y.startsWith("_")||(y=`_${y}`);let A=p.typedArray;l(A)||(A=Fd(p).createArrayBufferView(i.buffer,i.byteOffset+p.byteOffset,e));let b=new Cn.Attribute;b.name=y,b.count=e,b.type=p.type;let x=Y.fromTypedArray(A);(x===Y.INT||x===Y.UNSIGNED_INT||x===Y.DOUBLE)&&(tF._oneTimeWarning("Cast pnts property to floats",`Point cloud property "${y}" will be cast to a float array because INT, UNSIGNED_INT, and DOUBLE are not valid WebGL vertex attribute types. Some precision may be lost.`),A=new Float32Array(A)),b.componentDatatype=Y.fromTypedArray(A),b.typedArray=A,r.push(b),s[g]={attribute:y}}let c={classes:{}};c.classes[t]={properties:o};let u=eu.fromJson(c);return{class:t,propertyAttributeJson:{properties:s},transcodedSchema:u,transcodedClass:u.classes[t]}}function bye(e){let t=Jtt(e.componentType);return{type:e.type,componentType:t}}function Jtt(e){switch(e){case"BYTE":return"INT8";case"UNSIGNED_BYTE":return"UINT8";case"SHORT":return"INT16";case"UNSIGNED_SHORT":return"UINT16";case"INT":return"INT32";case"UNSIGNED_INT":return"UINT32";case"FLOAT":return"FLOAT32";case"DOUBLE":return"FLOAT64"}}tF._deprecationWarning=qr;tF._oneTimeWarning=_t;var Xg=tF;var yT={UNLOADED:0,LOADING:1,PROCESSING:2,READY:3,FAILED:4},Ztt=Cn.FeatureIdAttribute,NJ=class extends nr{constructor(t){super(),t=t??H.EMPTY_OBJECT;let n=t.b3dmResource,i=t.baseResource,r=t.arrayBuffer,o=t.byteOffset??0,s=t.releaseGltfJson??!1,a=t.asynchronous??!0,c=t.incrementallyLoadTextures??!0,u=t.upAxis??Hi.Y,f=t.forwardAxis??Hi.X,d=t.loadAttributesAsTypedArray??!1,p=t.loadAttributesFor2D??!1,g=t.enablePick??!1,m=t.loadIndicesForWireframe??!1,y=t.loadPrimitiveOutline??!0,A=t.loadForClassification??!1;i=l(i)?i:n.clone(),this._b3dmResource=n,this._baseResource=i,this._arrayBuffer=r,this._byteOffset=o,this._releaseGltfJson=s,this._asynchronous=a,this._incrementallyLoadTextures=c,this._upAxis=u,this._forwardAxis=f,this._loadAttributesAsTypedArray=d,this._loadAttributesFor2D=p,this._enablePick=g,this._loadIndicesForWireframe=m,this._loadPrimitiveOutline=y,this._loadForClassification=A,this._state=yT.UNLOADED,this._promise=void 0,this._gltfLoader=void 0,this._batchLength=0,this._propertyTable=void 0,this._batchTable=void 0,this._components=void 0,this._transform=N.IDENTITY}get texturesLoaded(){return this._gltfLoader?.texturesLoaded}get cacheKey(){}get components(){return this._components}load(){if(l(this._promise))return this._promise;let t=QL.parse(this._arrayBuffer,this._byteOffset),n=t.featureTableJson,i=t.featureTableBinary,r=t.batchTableJson,o=t.batchTableBinary,s=new hm(n,i),a=s.getGlobalProperty("BATCH_LENGTH");this._batchLength=a;let c=s.getGlobalProperty("RTC_CENTER",Y.FLOAT,3);l(c)&&(this._transform=N.fromTranslation(h.fromArray(c))),this._batchTable={json:r,binary:o};let u=new Bf({typedArray:t.gltf,upAxis:this._upAxis,forwardAxis:this._forwardAxis,gltfResource:this._b3dmResource,baseResource:this._baseResource,releaseGltfJson:this._releaseGltfJson,incrementallyLoadTextures:this._incrementallyLoadTextures,loadAttributesAsTypedArray:this._loadAttributesAsTypedArray,loadAttributesFor2D:this._loadAttributesFor2D,enablePick:this._enablePick,loadIndicesForWireframe:this._loadIndicesForWireframe,loadPrimitiveOutline:this._loadPrimitiveOutline,loadForClassification:this._loadForClassification,renameBatchIdSemantic:!0});this._gltfLoader=u,this._state=yT.LOADING;let f=this;return this._promise=u.load().then(function(){if(!f.isDestroyed())return f._state=yT.PROCESSING,f}).catch(function(d){if(!f.isDestroyed())return Qtt(f,d)}),this._promise}process(t){if(this._state===yT.READY)return!0;if(this._state!==yT.PROCESSING||!this._gltfLoader.process(t))return!1;let i=this._gltfLoader.components;return i.transform=N.multiplyTransformation(this._transform,i.transform,i.transform),ent(this,i),this._components=i,this._arrayBuffer=void 0,this._state=yT.READY,!0}unload(){l(this._gltfLoader)&&!this._gltfLoader.isDestroyed()&&this._gltfLoader.unload(),this._components=void 0,this._arrayBuffer=void 0}};function Qtt(e,t){return e.unload(),e._state=yT.FAILED,t=e.getError("Failed to load b3dm",t),Promise.reject(t)}function ent(e,t){let n=e._batchTable,i=e._batchLength;if(i===0)return;let r;if(l(n.json))r=Xg({count:i,batchTable:n.json,binaryBody:n.binary});else{let a=new iu({name:lm.BATCH_TABLE_CLASS_NAME,count:i});r=new Va({schema:{},propertyTables:[a]})}let o=t.scene.nodes,s=o.length;for(let a=0;a<s;a++)xye(o[a]);t.structuralMetadata=r}function xye(e){let t=e.children.length;for(let i=0;i<t;i++)xye(e.children[i]);let n=e.primitives.length;for(let i=0;i<n;i++){let r=e.primitives[i],o=xt.getAttributeBySemantic(r,ct.FEATURE_ID);if(l(o)){o.setIndex=0;let s=new Ztt;s.propertyTableId=0,s.setIndex=0,s.positionalLabel="featureId_0",r.featureIds.push(s)}}}var nF=NJ;var LJ=class extends nr{constructor(t){super(),t=t??H.EMPTY_OBJECT,this._geoJson=t.geoJson,this._components=void 0}get cacheKey(){}get components(){return this._components}load(){return Promise.resolve(this)}process(t){return l(this._components)||(this._components=hnt(this._geoJson,t),this._geoJson=void 0),!0}unload(){this._components=void 0}};function tnt(){this.lines=void 0,this.points=void 0,this.properties=void 0}function nnt(){this.features=[]}function FJ(e){let t=e[0],n=e[1],i=e[2]??0;return new h(t,n,i)}function BJ(e){let t=e.length,n=new Array(t);for(let r=0;r<t;r++)n[r]=FJ(e[r]);return[n]}function int(e){let t=e.length,n=new Array(t);for(let i=0;i<t;i++)n[i]=BJ(e[i])[0];return n}function Tye(e){let t=e.length,n=new Array(t);for(let i=0;i<t;i++)n[i]=BJ(e[i])[0];return n}function rnt(e){let t=e.length,n=[];for(let i=0;i<t;i++){let r=Tye(e[i]);Zn(n,r)}return n}function ont(e){return[FJ(e)]}function snt(e){let t=e.length,n=new Array(t);for(let i=0;i<t;i++)n[i]=FJ(e[i]);return n}var ant={LineString:BJ,MultiLineString:int,MultiPolygon:rnt,Polygon:Tye,MultiPoint:snt,Point:ont},cnt={LineString:Oe.LINES,MultiLineString:Oe.LINES,MultiPolygon:Oe.LINES,Polygon:Oe.LINES,MultiPoint:Oe.POINTS,Point:Oe.POINTS};function Eye(e,t){if(!l(e.geometry))return;let n=e.geometry.type,i=ant[n],r=cnt[n],o=e.geometry.coordinates;if(!l(i)||!l(o))return;let s=new tnt;r===Oe.LINES?s.lines=i(o):r===Oe.POINTS&&(s.points=i(o)),s.properties=e.properties,t.features.push(s)}function lnt(e,t){let n=e.features,i=n.length;for(let r=0;r<i;r++)Eye(n[r],t)}var unt={FeatureCollection:lnt,Feature:Eye},pH=new h;function fnt(e,t,n){let i=0,r=0,o=e.length;for(let O=0;O<o;O++){let L=e[O];if(l(L.lines)){let _=L.lines.length;for(let C=0;C<_;C++){let w=L.lines[C];i+=w.length,r+=(w.length-1)*2}}}let s=new Float32Array(i*3),a=new Float32Array(i),c=je.createTypedArray(i,r),u=je.fromTypedArray(c),f=new h(Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY),d=new h(Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY),p=0,g=0;for(let O=0;O<o;O++){let L=e[O];if(!l(L.lines))continue;let _=L.lines.length;for(let C=0;C<_;C++){let w=L.lines[C],P=w.length;for(let M=0;M<P;M++){let F=w[M],V=h.fromDegrees(F.x,F.y,F.z,ee.WGS84,pH),B=N.multiplyByPoint(t,V,pH);h.minimumByComponent(f,B,f),h.maximumByComponent(d,B,d),h.pack(B,s,p*3),a[p]=O,M<P-1&&(c[g*2]=p,c[g*2+1]=p+1,g++),p++}}}let m=tt.createVertexBuffer({typedArray:s,context:n.context,usage:Me.STATIC_DRAW});m.vertexArrayDestroyable=!1;let y=tt.createVertexBuffer({typedArray:a,context:n.context,usage:Me.STATIC_DRAW});y.vertexArrayDestroyable=!1;let A=tt.createIndexBuffer({typedArray:c,context:n.context,usage:Me.STATIC_DRAW,indexDatatype:u});A.vertexArrayDestroyable=!1;let b=new Cn.Attribute;b.semantic=ct.POSITION,b.componentDatatype=Y.FLOAT,b.type=Vt.VEC3,b.count=i,b.min=f,b.max=d,b.buffer=m;let x=new Cn.Attribute;x.semantic=ct.FEATURE_ID,x.setIndex=0,x.componentDatatype=Y.FLOAT,x.type=Vt.SCALAR,x.count=i,x.buffer=y;let T=[b,x],E=new Cn.Material;E.unlit=!0;let v=new Cn.Indices;v.indexDatatype=u,v.count=c.length,v.buffer=A;let S=new Cn.FeatureIdAttribute;S.featureCount=o,S.propertyTableId=0,S.setIndex=0,S.positionalLabel="featureId_0";let I=[S],R=new Cn.Primitive;return R.attributes=T,R.indices=v,R.featureIds=I,R.primitiveType=Oe.LINES,R.material=E,R}function dnt(e,t,n){let i=0,r=e.length;for(let T=0;T<r;T++){let E=e[T];l(E.points)&&(i+=E.points.length)}let o=new Float32Array(i*3),s=new Float32Array(i),a=new h(Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY),c=new h(Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY),u=0;for(let T=0;T<r;T++){let E=e[T];if(!l(E.points))continue;let v=E.points.length;for(let S=0;S<v;S++){let I=E.points[S],R=h.fromDegrees(I.x,I.y,I.z,ee.WGS84,pH),O=N.multiplyByPoint(t,R,pH);h.minimumByComponent(a,O,a),h.maximumByComponent(c,O,c),h.pack(O,o,u*3),s[u]=T,u++}}let f=tt.createVertexBuffer({typedArray:o,context:n.context,usage:Me.STATIC_DRAW});f.vertexArrayDestroyable=!1;let d=tt.createVertexBuffer({typedArray:s,context:n.context,usage:Me.STATIC_DRAW});d.vertexArrayDestroyable=!1;let p=new Cn.Attribute;p.semantic=ct.POSITION,p.componentDatatype=Y.FLOAT,p.type=Vt.VEC3,p.count=i,p.min=a,p.max=c,p.buffer=f;let g=new Cn.Attribute;g.semantic=ct.FEATURE_ID,g.setIndex=0,g.componentDatatype=Y.FLOAT,g.type=Vt.SCALAR,g.count=i,g.buffer=d;let m=[p,g],y=new Cn.Material;y.unlit=!0;let A=new Cn.FeatureIdAttribute;A.featureCount=r,A.propertyTableId=0,A.setIndex=0,A.positionalLabel="featureId_0";let b=[A],x=new Cn.Primitive;return x.attributes=m,x.featureIds=b,x.primitiveType=Oe.POINTS,x.material=y,x}function hnt(e,t){let n=new nnt,i=unt[e.type];l(i)&&i(e,n);let r=n.features,o=r.length;if(o===0)throw new oe("GeoJSON must have at least one feature");let s={};for(let O=0;O<o;O++){let _=r[O].properties??H.EMPTY_OBJECT;for(let C in _)_.hasOwnProperty(C)&&(l(s[C])||(s[C]=new Array(o)))}for(let O=0;O<o;O++){let L=r[O];for(let _ in s)if(s.hasOwnProperty(_)){let C=L.properties[_]??"";s[_][O]=C}}let a=new Hg({count:o,properties:s}),u=[new iu({id:0,count:o,jsonMetadataTable:a})],f=eu.fromJson({}),d=new Va({schema:f,propertyTables:u}),p=new h(Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY),g=new h(Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY),m=!1,y=!1;for(let O=0;O<o;O++){let L=r[O];if(l(L.lines)){m=!0;let _=L.lines.length;for(let C=0;C<_;C++){let w=L.lines[C],P=w.length;for(let M=0;M<P;M++)h.minimumByComponent(p,w[M],p),h.maximumByComponent(g,w[M],g)}}if(l(L.points)){y=!0;let _=L.points.length;for(let C=0;C<_;C++){let w=L.points[C];h.minimumByComponent(p,w,p),h.maximumByComponent(g,w,g)}}}let A=h.midpoint(p,g,new h),b=h.fromDegrees(A.x,A.y,A.z,ee.WGS84,new h),x=At.eastNorthUpToFixedFrame(b,ee.WGS84,new N),T=N.inverseTransformation(x,new N),E=[];m&&E.push(fnt(r,T,t)),y&&E.push(dnt(r,T,t));let v=new Cn.Node;v.index=0,v.primitives=E;let S=[v],I=new Cn.Scene;I.nodes=S;let R=new Cn.Components;return R.scene=I,R.nodes=S,R.transform=x,R.structuralMetadata=d,R}var iF=LJ;var gH={};gH._deprecationWarning=qr;var bA=Uint32Array.BYTES_PER_ELEMENT;gH.parse=function(e,t){let n=t??0;t=n;let i=new Uint8Array(e),r=new DataView(e);t+=bA;let o=r.getUint32(t,!0);if(o!==1)throw new oe(`Only Instanced 3D Model version 1 is supported. Version ${o} is not.`);t+=bA;let s=r.getUint32(t,!0);t+=bA;let a=r.getUint32(t,!0);if(a===0)throw new oe("featureTableJsonByteLength is zero, the feature table must be defined.");t+=bA;let c=r.getUint32(t,!0);t+=bA;let u=r.getUint32(t,!0);t+=bA;let f=r.getUint32(t,!0);t+=bA;let d=r.getUint32(t,!0);if(d!==1&&d!==0)throw new oe(`Only glTF format 0 (uri) or 1 (embedded) are supported. Format ${d} is not.`);t+=bA;let p=Ro(i,t,a);t+=a;let g=new Uint8Array(e,t,c);t+=c;let m,y;u>0&&(m=Ro(i,t,u),t+=u,f>0&&(y=new Uint8Array(e,t,f),y=new Uint8Array(y),t+=f));let A=n+s-t;if(A===0)throw new oe("glTF byte length must be greater than 0.");let b;return t%4===0?b=new Uint8Array(e,t,A):(gH._deprecationWarning("i3dm-glb-unaligned","The embedded glb is not aligned to a 4-byte boundary."),b=new Uint8Array(i.subarray(t,t+A))),{gltfFormat:d,featureTableJson:p,featureTableBinary:g,batchTableJson:m,batchTableBinary:y,gltf:b}};var rF=gH;var Kg={NOT_LOADED:0,LOADING:1,PROCESSING:2,POST_PROCESSING:3,READY:4,FAILED:5,UNLOADED:6},_H=Cn.Attribute,mnt=Cn.FeatureIdAttribute,vye=Cn.Instances,kJ=class extends nr{constructor(t){super(),t=t??H.EMPTY_OBJECT;let n=t.i3dmResource,i=t.arrayBuffer,r=t.baseResource,o=t.byteOffset??0,s=t.releaseGltfJson??!1,a=t.asynchronous??!0,c=t.incrementallyLoadTextures??!0,u=t.upAxis??Hi.Y,f=t.forwardAxis??Hi.X,d=t.loadAttributesAsTypedArray??!1,p=t.loadIndicesForWireframe??!1,g=t.loadPrimitiveOutline??!0,m=t.enablePick??!1;r=l(r)?r:n.clone(),this._i3dmResource=n,this._baseResource=r,this._arrayBuffer=i,this._byteOffset=o,this._releaseGltfJson=s,this._asynchronous=a,this._incrementallyLoadTextures=c,this._upAxis=u,this._forwardAxis=f,this._loadAttributesAsTypedArray=d,this._loadIndicesForWireframe=p,this._loadPrimitiveOutline=g,this._enablePick=m,this._state=Kg.NOT_LOADED,this._promise=void 0,this._gltfLoader=void 0,this._buffers=[],this._components=void 0,this._transform=N.IDENTITY,this._batchTable=void 0,this._featureTable=void 0,this._instancesLength=0}get texturesLoaded(){return this._gltfLoader?.texturesLoaded}get cacheKey(){}get components(){return this._components}load(){if(l(this._promise))return this._promise;let t=rF.parse(this._arrayBuffer,this._byteOffset),n=t.featureTableJson,i=t.featureTableBinary,r=t.batchTableJson,o=t.batchTableBinary,s=t.gltfFormat,a=new hm(n,i);this._featureTable=a;let c=a.getGlobalProperty("INSTANCES_LENGTH");if(a.featuresLength=c,!l(c))throw new oe("Feature table global property: INSTANCES_LENGTH must be defined");this._instancesLength=c;let u=a.getGlobalProperty("RTC_CENTER",Y.FLOAT,3);l(u)&&(this._transform=N.fromTranslation(h.fromArray(u))),this._batchTable={json:r,binary:o};let f={upAxis:this._upAxis,forwardAxis:this._forwardAxis,releaseGltfJson:this._releaseGltfJson,incrementallyLoadTextures:this._incrementallyLoadTextures,loadAttributesAsTypedArray:this._loadAttributesAsTypedArray,enablePick:this._enablePick,loadIndicesForWireframe:this._loadIndicesForWireframe,loadPrimitiveOutline:this._loadPrimitiveOutline};if(s===0){let p=Uu(t.gltf);p=p.replace(/[\s\0]+$/,"");let g=this._baseResource.getDerivedResource({url:p});f.gltfResource=g,f.baseResource=g}else f.gltfResource=this._i3dmResource,f.typedArray=t.gltf;let d=new Bf(f);return this._gltfLoader=d,this._state=Kg.LOADING,this._promise=d.load().then(()=>{if(!this.isDestroyed())return this._state=Kg.PROCESSING,this}).catch(p=>{if(!this.isDestroyed())throw pnt(this,p)}),this._promise}process(t){if(this._state===Kg.READY)return!0;let n=this._gltfLoader,i=!1;if(this._state===Kg.PROCESSING&&(i=n.process(t)),!i)return!1;let r=n.components;return r.transform=N.multiplyTransformation(this._transform,r.transform,r.transform),ynt(this,r,t),gnt(this,r),this._components=r,this._arrayBuffer=void 0,this._state=Kg.READY,!0}isUnloaded(){return this._state===Kg.UNLOADED}unload(){l(this._gltfLoader)&&!this._gltfLoader.isDestroyed()&&this._gltfLoader.unload(),Ent(this),this._components=void 0,this._arrayBuffer=void 0,this._state=Kg.UNLOADED}};function pnt(e,t){return e.unload(),e._state=Kg.FAILED,e.getError("Failed to load i3dm",t)}function gnt(e,t){let n=e._batchTable,i=e._instancesLength;if(i===0)return;let r;if(l(n.json))r=Xg({count:i,batchTable:n.json,binaryBody:n.binary});else{let o=new iu({name:lm.BATCH_TABLE_CLASS_NAME,count:i});r=new Va({schema:{},propertyTables:[o]})}t.structuralMetadata=r}var yH=new h,UJ=new Array(4),_nt=new N;function ynt(e,t,n){let i,r=e._featureTable,o=e._instancesLength;if(o===0)return;let s=r.getGlobalProperty("RTC_CENTER",Y.FLOAT,3),a=r.getGlobalProperty("EAST_NORTH_UP"),c=r.hasProperty("NORMAL_UP")||r.hasProperty("NORMAL_UP_OCT32P")||a,u=r.hasProperty("SCALE")||r.hasProperty("SCALE_NON_UNIFORM"),f=bnt(r,o),d;c&&(d=new Float32Array(4*o));let p;u&&(p=new Float32Array(3*o));let g=new Float32Array(o),m=h.unpackArray(f),y,A=new h,b=new h,x=new h,T=new $,E=new Le,v=new Array(4),S=new h,I=new Array(3),R=new N;if(!l(s)||h.equals(h.unpack(s),h.ZERO)){let B=ue.fromPoints(m);for(i=0;i<m.length;i++)h.subtract(m[i],B.center,yH),f[3*i+0]=yH.x,f[3*i+1]=yH.y,f[3*i+2]=yH.z;let j=N.fromTranslation(B.center,_nt);t.transform=N.multiplyTransformation(j,t.transform,t.transform)}for(i=0;i<o;i++){y=h.clone(m[i]),l(s)&&h.add(y,h.unpack(s),y),c&&(xnt(r,a,i,E,y,b,A,x,T,R),Le.pack(E,v,0),d[4*i+0]=v[0],d[4*i+1]=v[1],d[4*i+2]=v[2],d[4*i+3]=v[3]),u&&(Tnt(r,i,S),h.pack(S,I,0),p[3*i+0]=I[0],p[3*i+1]=I[1],p[3*i+2]=I[2]);let B=r.getProperty("BATCH_ID",Y.UNSIGNED_SHORT,1,i);l(B)||(B=i),g[i]=B}let O=new vye;O.transformInWorldSpace=!0;let L=e._buffers,_=new _H;if(_.name="Instance Translation",_.semantic=No.TRANSLATION,_.componentDatatype=Y.FLOAT,_.type=Vt.VEC3,_.count=o,_.typedArray=f,!c){let B=tt.createVertexBuffer({context:n.context,typedArray:f,usage:Me.STATIC_DRAW});B.vertexArrayDestroyable=!1,L.push(B),_.buffer=B}if(O.attributes.push(_),c){let B=new _H;B.name="Instance Rotation",B.semantic=No.ROTATION,B.componentDatatype=Y.FLOAT,B.type=Vt.VEC4,B.count=o,B.typedArray=d,O.attributes.push(B)}if(u){let B=new _H;if(B.name="Instance Scale",B.semantic=No.SCALE,B.componentDatatype=Y.FLOAT,B.type=Vt.VEC3,B.count=o,c)B.typedArray=p;else{let j=tt.createVertexBuffer({context:n.context,typedArray:p,usage:Me.STATIC_DRAW});j.vertexArrayDestroyable=!1,L.push(j),B.buffer=j}O.attributes.push(B)}let C=new _H;C.name="Instance Feature ID",C.setIndex=0,C.semantic=No.FEATURE_ID,C.componentDatatype=Y.FLOAT,C.type=Vt.SCALAR,C.count=o;let w=tt.createVertexBuffer({context:n.context,typedArray:g,usage:Me.STATIC_DRAW});w.vertexArrayDestroyable=!1,L.push(w),C.buffer=w,O.attributes.push(C);let P=new mnt;P.propertyTableId=0,P.setIndex=0,P.positionalLabel="instanceFeatureId_0",O.featureIds.push(P);let M=t.nodes,F=M.length,V=!1;for(i=0;i<F;i++){let B=M[i];B.primitives.length>0&&(B.instances=V?Ant(O):O,V=!0)}}function Ant(e){let t=new vye;t.transformInWorldSpace=e.transformInWorldSpace;let n=e.attributes,i=n.length;for(let r=0;r<i;r++){let o=Je(n[r],!1);t.attributes.push(o)}return t.featureIds=e.featureIds,t}function bnt(e,t){if(e.hasProperty("POSITION"))return e.getPropertyArray("POSITION",Y.FLOAT,3);if(e.hasProperty("POSITION_QUANTIZED")){let n=e.getPropertyArray("POSITION_QUANTIZED",Y.UNSIGNED_SHORT,3),i=e.getGlobalProperty("QUANTIZED_VOLUME_OFFSET",Y.FLOAT,3);if(!l(i))throw new oe("Global property: QUANTIZED_VOLUME_OFFSET must be defined for quantized positions.");let r=e.getGlobalProperty("QUANTIZED_VOLUME_SCALE",Y.FLOAT,3);if(!l(r))throw new oe("Global property: QUANTIZED_VOLUME_SCALE must be defined for quantized positions.");let o=new Float32Array(n.length);for(let s=0;s<n.length/3;s++)for(let a=0;a<3;a++){let c=3*s+a;o[c]=n[c]/65535*r[a]+i[a]}return o}else throw new oe("Either POSITION or POSITION_QUANTIZED must be defined for each instance.")}var Cye=new Array(4);function xnt(e,t,n,i,r,o,s,a,c,u){let f=e.getProperty("NORMAL_UP",Y.FLOAT,3,n,UJ),d=e.getProperty("NORMAL_RIGHT",Y.FLOAT,3,n,Cye),p=!1;if(l(f)){if(!l(d))throw new oe("To define a custom orientation, both NORMAL_UP and NORMAL_RIGHT must be defined.");h.unpack(f,0,o),h.unpack(d,0,s),p=!0}else{let g=e.getProperty("NORMAL_UP_OCT32P",Y.UNSIGNED_SHORT,2,n,UJ),m=e.getProperty("NORMAL_RIGHT_OCT32P",Y.UNSIGNED_SHORT,2,n,Cye);if(l(g)){if(!l(m))throw new oe("To define a custom orientation with oct-encoded vectors, both NORMAL_UP_OCT32P and NORMAL_RIGHT_OCT32P must be defined.");cn.octDecodeInRange(g[0],g[1],65535,o),cn.octDecodeInRange(m[0],m[1],65535,s),p=!0}else t?(At.eastNorthUpToFixedFrame(r,ee.WGS84,u),N.getMatrix3(u,c)):$.clone($.IDENTITY,c)}p&&(h.cross(s,o,a),h.normalize(a,a),$.setColumn(c,0,s,c),$.setColumn(c,1,o,c),$.setColumn(c,2,a,c)),Le.fromRotationMatrix(c,i)}function Tnt(e,t,n){n=h.fromElements(1,1,1,n);let i=e.getProperty("SCALE",Y.FLOAT,1,t);l(i)&&h.multiplyByScalar(n,i,n);let r=e.getProperty("SCALE_NON_UNIFORM",Y.FLOAT,3,t,UJ);l(r)&&(n.x*=r[0],n.y*=r[1],n.z*=r[2])}function Ent(e){let t=e._buffers,n=t.length;for(let i=0;i<n;i++){let r=t[i];r.isDestroyed()||r.destroy()}t.length=0}var oF=kJ;var Sye={STOPPED:0,ANIMATING:1};Object.freeze(Sye);var mm=Sye;function PS(){this.times=void 0,this.points=void 0,pe.throwInstantiationError()}PS.getPointType=function(e){if(typeof e=="number")return Number;if(e instanceof h)return h;if(e instanceof Le)return Le};PS.prototype.evaluate=pe.throwInstantiationError;PS.prototype.findTimeInterval=function(e,t){let n=this.times,i=n.length;if(t=t??0,e>=n[t]){if(t+1<i&&e<n[t+1])return t;if(t+2<i&&e<n[t+2])return t+1}else if(t-1>=0&&e>=n[t-1])return t-1;let r;if(e>n[t])for(r=t;r<i-1&&!(e>=n[r]&&e<n[r+1]);++r);else for(r=t-1;r>=0&&!(e>=n[r]&&e<n[r+1]);--r);return r===i-1&&(r=i-2),r};PS.prototype.wrapTime=function(e){let t=this.times,n=t[t.length-1],i=t[0],r=n-i,o;return e<i&&(o=Math.floor((i-e)/r)+1,e+=o*r),e>n&&(o=Math.floor((e-n)/r)+1,e-=o*r),e};PS.prototype.clampTime=function(e){let t=this.times;return D.clamp(e,t[0],t[t.length-1])};var Dr=PS;function DS(e){this._value=e,this._valueType=Dr.getPointType(e)}Object.defineProperties(DS.prototype,{value:{get:function(){return this._value}}});DS.prototype.findTimeInterval=function(e){};DS.prototype.wrapTime=function(e){return 0};DS.prototype.clampTime=function(e){return 0};DS.prototype.evaluate=function(e,t){let n=this._value,i=this._valueType;return i===Number?n:i.clone(n,t)};var sF=DS;function RS(e){e=e??H.EMPTY_OBJECT;let t=e.points,n=e.times;this._times=n,this._points=t,this._pointType=Dr.getPointType(t[0]),this._lastTimeIndex=0}Object.defineProperties(RS.prototype,{times:{get:function(){return this._times}},points:{get:function(){return this._points}}});RS.prototype.findTimeInterval=Dr.prototype.findTimeInterval;RS.prototype.wrapTime=Dr.prototype.wrapTime;RS.prototype.clampTime=Dr.prototype.clampTime;RS.prototype.evaluate=function(e,t){let n=this.points,i=this.times,r=this._lastTimeIndex=this.findTimeInterval(e,this._lastTimeIndex),o=(e-i[r])/(i[r+1]-i[r]);return this._pointType===Number?(1-o)*n[r]+o*n[r+1]:(l(t)||(t=new h),h.lerp(n[r],n[r+1],o,t))};var xA=RS;var wye={};wye.solve=function(e,t,n,i){let r=new Array(n.length),o=new Array(i.length),s=new Array(i.length),a;for(a=0;a<o.length;a++)o[a]=new h,s[a]=new h;r[0]=n[0]/t[0],o[0]=h.multiplyByScalar(i[0],1/t[0],o[0]);let c;for(a=1;a<r.length;++a)c=1/(t[a]-r[a-1]*e[a-1]),r[a]=n[a]*c,o[a]=h.subtract(i[a],h.multiplyByScalar(o[a-1],e[a-1],o[a]),o[a]),o[a]=h.multiplyByScalar(o[a],c,o[a]);for(c=1/(t[a]-r[a-1]*e[a-1]),o[a]=h.subtract(i[a],h.multiplyByScalar(o[a-1],e[a-1],o[a]),o[a]),o[a]=h.multiplyByScalar(o[a],c,o[a]),s[s.length-1]=o[o.length-1],a=s.length-2;a>=0;--a)s[a]=h.subtract(o[a],h.multiplyByScalar(s[a+1],r[a],s[a]),s[a]);return s};var OS=wye;var Iye=[],Pye=[],Dye=[],Rye=[];function Cnt(e,t,n){let i=Iye,r=Dye,o=Pye,s=Rye;i.length=r.length=e.length-1,o.length=s.length=e.length;let a;i[0]=o[0]=1,r[0]=0;let c=s[0];for(l(c)||(c=s[0]=new h),h.clone(t,c),a=1;a<i.length-1;++a)i[a]=r[a]=1,o[a]=4,c=s[a],l(c)||(c=s[a]=new h),h.subtract(e[a+1],e[a-1],c),h.multiplyByScalar(c,3,c);return i[a]=0,r[a]=1,o[a]=4,c=s[a],l(c)||(c=s[a]=new h),h.subtract(e[a+1],e[a-1],c),h.multiplyByScalar(c,3,c),o[a+1]=1,c=s[a+1],l(c)||(c=s[a+1]=new h),h.clone(n,c),OS.solve(i,o,r,s)}function vnt(e){let t=Iye,n=Dye,i=Pye,r=Rye;t.length=n.length=e.length-1,i.length=r.length=e.length;let o;t[0]=n[0]=1,i[0]=2;let s=r[0];for(l(s)||(s=r[0]=new h),h.subtract(e[1],e[0],s),h.multiplyByScalar(s,3,s),o=1;o<t.length;++o)t[o]=n[o]=1,i[o]=4,s=r[o],l(s)||(s=r[o]=new h),h.subtract(e[o+1],e[o-1],s),h.multiplyByScalar(s,3,s);return i[o]=2,s=r[o],l(s)||(s=r[o]=new h),h.subtract(e[o],e[o-1],s),h.multiplyByScalar(s,3,s),OS.solve(t,i,n,r)}function qu(e){e=e??H.EMPTY_OBJECT;let t=e.points,n=e.times,i=e.inTangents,r=e.outTangents;this._times=n,this._points=t,this._pointType=Dr.getPointType(t[0]),this._inTangents=i,this._outTangents=r,this._lastTimeIndex=0}Object.defineProperties(qu.prototype,{times:{get:function(){return this._times}},points:{get:function(){return this._points}},inTangents:{get:function(){return this._inTangents}},outTangents:{get:function(){return this._outTangents}}});qu.createC1=function(e){e=e??H.EMPTY_OBJECT;let t=e.times,n=e.points,i=e.tangents,r=i.slice(0,i.length-1),o=i.slice(1,i.length);return new qu({times:t,points:n,inTangents:o,outTangents:r})};qu.createNaturalCubic=function(e){e=e??H.EMPTY_OBJECT;let t=e.times,n=e.points;if(n.length<3)return new xA({points:n,times:t});let i=vnt(n),r=i.slice(0,i.length-1),o=i.slice(1,i.length);return new qu({times:t,points:n,inTangents:o,outTangents:r})};qu.createClampedCubic=function(e){e=e??H.EMPTY_OBJECT;let t=e.times,n=e.points,i=e.firstTangent,r=e.lastTangent,o=Dr.getPointType(n[0]);if(n.length<3)return new xA({points:n,times:t});let s=Cnt(n,i,r),a=s.slice(0,s.length-1),c=s.slice(1,s.length);return new qu({times:t,points:n,inTangents:c,outTangents:a})};qu.hermiteCoefficientMatrix=new N(2,-3,0,1,-2,3,0,0,1,-2,1,0,1,-1,0,0);qu.prototype.findTimeInterval=Dr.prototype.findTimeInterval;var Snt=new se,MS=new h;qu.prototype.wrapTime=Dr.prototype.wrapTime;qu.prototype.clampTime=Dr.prototype.clampTime;qu.prototype.evaluate=function(e,t){let n=this.points,i=this.times,r=this.inTangents,o=this.outTangents;this._lastTimeIndex=this.findTimeInterval(e,this._lastTimeIndex);let s=this._lastTimeIndex,a=i[s+1]-i[s],c=(e-i[s])/a,u=Snt;u.z=c,u.y=c*c,u.x=u.y*c,u.w=1;let f=N.multiplyByVector(qu.hermiteCoefficientMatrix,u,u);f.z*=a,f.w*=a;let d=this._pointType;return d===Number?n[s]*f.x+n[s+1]*f.y+o[s]*f.z+r[s]*f.w:(l(t)||(t=new d),t=d.multiplyByScalar(n[s],f.x,t),d.multiplyByScalar(n[s+1],f.y,MS),d.add(t,MS,t),d.multiplyByScalar(o[s],f.z,MS),d.add(t,MS,t),d.multiplyByScalar(r[s],f.w,MS),d.add(t,MS,t))};var TA=qu;function NS(e){e=e??H.EMPTY_OBJECT;let t=e.points,n=e.times;this._times=n,this._points=t,this._pointType=Dr.getPointType(t[0]),this._lastTimeIndex=0}Object.defineProperties(NS.prototype,{times:{get:function(){return this._times}},points:{get:function(){return this._points}}});NS.prototype.findTimeInterval=Dr.prototype.findTimeInterval;NS.prototype.wrapTime=Dr.prototype.wrapTime;NS.prototype.clampTime=Dr.prototype.clampTime;NS.prototype.evaluate=function(e,t){let n=this.points;this._lastTimeIndex=this.findTimeInterval(e,this._lastTimeIndex);let i=this._lastTimeIndex,r=this._pointType;return r===Number?n[i]:(l(t)||(t=new r),r.clone(n[i],t))};var aF=NS;function wnt(e){let t=e.points,n=e.times;return function(i,r){l(r)||(r=new Le);let o=e._lastTimeIndex=e.findTimeInterval(i,e._lastTimeIndex),s=(i-n[o])/(n[o+1]-n[o]),a=t[o],c=t[o+1];return Le.fastSlerp(a,c,s,r)}}function LS(e){e=e??H.EMPTY_OBJECT;let t=e.points,n=e.times;this._times=n,this._points=t,this._evaluateFunction=wnt(this),this._lastTimeIndex=0}Object.defineProperties(LS.prototype,{times:{get:function(){return this._times}},points:{get:function(){return this._points}}});LS.prototype.findTimeInterval=Dr.prototype.findTimeInterval;LS.prototype.wrapTime=Dr.prototype.wrapTime;LS.prototype.clampTime=Dr.prototype.clampTime;LS.prototype.evaluate=function(e,t){return this._evaluateFunction(e,t)};var cF=LS;var FS=Cn.AnimatedPropertyType;function zJ(e){e=e??H.EMPTY_OBJECT;let t=e.channel,n=e.runtimeAnimation,i=e.runtimeNode;this._channel=t,this._runtimeAnimation=n,this._runtimeNode=i,this._splines=[],this._path=void 0,Ont(this)}Object.defineProperties(zJ.prototype,{channel:{get:function(){return this._channel}},runtimeAnimation:{get:function(){return this._runtimeAnimation}},runtimeNode:{get:function(){return this._runtimeNode}},splines:{get:function(){return this._splines}}});function Int(e,t){let n=[],i=[],r=[],o=t.length;for(let s=0;s<o;s+=3)i.push(t[s]),n.push(t[s+1]),r.push(t[s+2]);return i.splice(0,1),r.length=r.length-1,new TA({times:e,points:n,inTangents:i,outTangents:r})}function Oye(e,t,n,i){if(e.length===1&&t.length===1)return new sF(t[0]);switch(n){case fm.STEP:return new aF({times:e,points:t});case fm.CUBICSPLINE:return Int(e,t);case fm.LINEAR:return i===FS.ROTATION?new cF({times:e,points:t}):new xA({times:e,points:t})}}function Pnt(e,t,n,i,r){let o=[];if(i===FS.WEIGHTS){let a=t.length/r,c,u;for(c=0;c<r;c++){let f=new Array(a),d=c;if(n===fm.CUBICSPLINE)for(u=0;u<a;u+=3)f[u]=t[d],f[u+1]=t[d+r],f[u+2]=t[d+2*r],d+=r*3;else for(u=0;u<a;u++)f[u]=t[d],d+=r;o.push(Oye(e,f,n,i))}}else o.push(Oye(e,t,n,i));return o}var Dnt=new h,Rnt=new Le;function Ont(e){let t=e._channel,n=t.sampler,i=n.input,r=n.output,o=n.interpolation,a=t.target.path,c=e._runtimeNode,u=l(c.morphWeights)?c.morphWeights.length:1,f=Pnt(i,r,o,a,u);e._splines=f,e._path=a}zJ.prototype.animate=function(e){let t=this._splines,n=this._path,i=this._runtimeAnimation.model,r=this._runtimeNode;if(n===FS.WEIGHTS){let o=r.morphWeights,s=o.length;for(let a=0;a<s;a++){let c=t[a],u=i.clampAnimations?c.clampTime(e):c.wrapTime(e);o[a]=c.evaluate(u)}}else{if(r.userAnimated)return;{let o=t[0],s=i.clampAnimations?o.clampTime(e):o.wrapTime(e);n===FS.TRANSLATION||n===FS.SCALE?r[n]=o.evaluate(s,Dnt):n===FS.ROTATION&&(r[n]=o.evaluate(s,Rnt))}}};var lF=zJ;function VJ(e,t,n){this._animation=t,this._name=t.name,this._runtimeChannels=void 0,this._startTime=K.clone(n.startTime),this._delay=n.delay??0,this._stopTime=K.clone(n.stopTime),this.removeOnStop=n.removeOnStop??!1,this._multiplier=n.multiplier??1,this._reverse=n.reverse??!1,this._loop=n.loop??Gu.NONE,this._startOffset=n.startOffset??0,this._animationTime=n.animationTime,this._prevAnimationDelta=void 0,this.start=new be,this.update=new be,this.stop=new be,this._state=mm.STOPPED,this._computedStartTime=void 0,this._duration=void 0;let i=this;this._raiseStartEvent=function(){i.start.raiseEvent(e,i)},this._updateEventTime=0,this._raiseUpdateEvent=function(){i.update.raiseEvent(e,i,i._updateEventTime)},this._raiseStopEvent=function(){i.stop.raiseEvent(e,i)},this._model=e,this._localStartTime=void 0,this._localStopTime=void 0,Mnt(this)}Object.defineProperties(VJ.prototype,{animation:{get:function(){return this._animation}},name:{get:function(){return this._name}},runtimeChannels:{get:function(){return this._runtimeChannels}},model:{get:function(){return this._model}},localStartTime:{get:function(){return this._localStartTime}},localStopTime:{get:function(){return this._localStopTime}},startTime:{get:function(){return this._startTime}},delay:{get:function(){return this._delay}},stopTime:{get:function(){return this._stopTime}},multiplier:{get:function(){return this._multiplier}},reverse:{get:function(){return this._reverse}},loop:{get:function(){return this._loop}},startOffset:{get:function(){return this._startOffset}},animationTime:{get:function(){return this._animationTime}}});function Mnt(e){let t=Number.MAX_VALUE,n=-Number.MAX_VALUE,i=e._model.sceneGraph,o=e._animation.channels,s=o.length,a=[];for(let c=0;c<s;c++){let u=o[c],f=u.target;if(!l(f))continue;let d=f.node.index,p=i._runtimeNodes[d],g=new lF({channel:u,runtimeAnimation:e,runtimeNode:p}),m=u.sampler.input;t=Math.min(t,m[0]),n=Math.max(n,m[m.length-1]),a.push(g)}e._runtimeChannels=a,e._localStartTime=t,e._localStopTime=n}VJ.prototype.animate=function(e){let t=this._runtimeChannels,n=t.length;for(let i=0;i<n;i++)t[i].animate(e)};var uF=VJ;function $g(e){this.animationAdded=new be,this.animationRemoved=new be,this.animateWhilePaused=!1,this._model=e,this._runtimeAnimations=[],this._previousTime=void 0}Object.defineProperties($g.prototype,{length:{get:function(){return this._runtimeAnimations.length}},model:{get:function(){return this._model}}});function jJ(e,t,n){let i=e._model,r=new uF(i,t,n);return e._runtimeAnimations.push(r),e.animationAdded.raiseEvent(i,r),r}$g.prototype.add=function(e){e=e??H.EMPTY_OBJECT;let n=this._model.sceneGraph.components.animations,i=e.index;if(l(i))return jJ(this,n[i],e);let r=n.length;for(let o=0;o<r;++o)if(n[o].name===e.name){i=o;break}return jJ(this,n[i],e)};$g.prototype.addAll=function(e){e=e??H.EMPTY_OBJECT;let n=this._model.sceneGraph.components.animations,i=[],r=n.length;for(let o=0;o<r;++o){let s=jJ(this,n[o],e);i.push(s)}return i};$g.prototype.remove=function(e){if(!l(e))return!1;let t=this._runtimeAnimations,n=t.indexOf(e);return n!==-1?(t.splice(n,1),this.animationRemoved.raiseEvent(this._model,e),!0):!1};$g.prototype.removeAll=function(){let e=this._model,t=this._runtimeAnimations,n=t.length;this._runtimeAnimations.length=0;for(let i=0;i<n;++i)this.animationRemoved.raiseEvent(e,t[i])};$g.prototype.contains=function(e){return l(e)?this._runtimeAnimations.indexOf(e)!==-1:!1};$g.prototype.get=function(e){return this._runtimeAnimations[e]};var AH=[];function Nnt(e,t,n){return function(){e.animationRemoved.raiseEvent(t,n)}}$g.prototype.update=function(e){let t=this._runtimeAnimations,n=t.length;if(n===0)return this._previousTime=void 0,!1;if(!this.animateWhilePaused&&K.equals(e.time,this._previousTime))return!1;this._previousTime=K.clone(e.time,this._previousTime);let i=!1,r=e.time,o=this._model;for(let s=0;s<n;++s){let a=t[s];l(a._computedStartTime)||(a._computedStartTime=K.addSeconds(a.startTime??r,a.delay,new K)),l(a._duration)||(a._duration=a.localStopTime*(1/a.multiplier));let c=a._computedStartTime,u=a._duration,f=a.stopTime,d=K.lessThanOrEquals(c,r),p=l(f)&&K.greaterThan(r,f),g=0;if(u!==0){let A=K.secondsDifference(p?f:r,c);g=l(a._animationTime)?a._animationTime(u,A):A/u}let m=a.loop===Gu.REPEAT||a.loop===Gu.MIRRORED_REPEAT,y=(d||m&&!l(a.startTime))&&(g<=1||m)&&!p;if(g===a._prevAnimationDelta){let A=a._state===mm.STOPPED;if(y!==A)continue}if(a._prevAnimationDelta=g,y||a._state===mm.ANIMATING){if(y&&a._state===mm.STOPPED&&(a._state=mm.ANIMATING,a.start.numberOfListeners>0&&e.afterRender.push(a._raiseStartEvent)),a.loop===Gu.REPEAT)g=g-Math.floor(g);else if(a.loop===Gu.MIRRORED_REPEAT){let x=Math.floor(g),T=g-x;g=x%2===1?1-T:T}let A=a.startOffset;a.reverse&&(g=1-g,A=-A);let b=g*u*a.multiplier+A;b=D.clamp(b,a.localStartTime,a.localStopTime),a.animate(b),a.update.numberOfListeners>0&&(a._updateEventTime=b,e.afterRender.push(a._raiseUpdateEvent)),i=!0,y||(a._state=mm.STOPPED,a.stop.numberOfListeners>0&&e.afterRender.push(a._raiseStopEvent),a.removeOnStop&&AH.push(a))}}n=AH.length;for(let s=0;s<n;++s){let a=AH[s];t.splice(t.indexOf(a),1),e.afterRender.push(Nnt(this,o,a))}return AH.length=0,i};var fF=$g;function AT(e){this._model=e.model,this._featureTable=e.featureTable,this._featureId=e.featureId,this._color=void 0}Object.defineProperties(AT.prototype,{show:{get:function(){return this._featureTable.getShow(this._featureId)},set:function(e){this._featureTable.setShow(this._featureId,e)}},color:{get:function(){return l(this._color)||(this._color=new z),this._featureTable.getColor(this._featureId,this._color)},set:function(e){this._featureTable.setColor(this._featureId,e)}},primitive:{get:function(){return this._model}},featureTable:{get:function(){return this._featureTable}},featureId:{get:function(){return this._featureId}}});AT.prototype.hasProperty=function(e){return this._featureTable.hasProperty(this._featureId,e)};AT.prototype.getProperty=function(e){return this._featureTable.getProperty(this._featureId,e)};AT.prototype.getPropertyInherited=function(e){return this._featureTable.hasPropertyBySemantic(this._featureId,e)?this._featureTable.getPropertyBySemantic(this._featureId,e):this._featureTable.getProperty(this._featureId,e)};AT.prototype.getPropertyIds=function(e){return this._featureTable.getPropertyIds(e)};AT.prototype.setProperty=function(e,t){return this._featureTable.setProperty(this._featureId,e,t)};var dF=AT;var BS={ALL_OPAQUE:0,ALL_TRANSLUCENT:1,OPAQUE_AND_TRANSLUCENT:2};BS.getStyleCommandsNeeded=function(e,t){return t===0?BS.ALL_OPAQUE:t===e?BS.ALL_TRANSLUCENT:BS.OPAQUE_AND_TRANSLUCENT};Object.freeze(BS);var pm=BS;var Jg={GLTF:"GLTF",TILE_GLTF:"TILE_GLTF",TILE_B3DM:"B3DM",TILE_I3DM:"I3DM",TILE_PNTS:"PNTS",TILE_GEOJSON:"TILE_GEOJSON"};Jg.is3DTiles=function(e){switch(e){case Jg.TILE_GLTF:case Jg.TILE_B3DM:case Jg.TILE_I3DM:case Jg.TILE_PNTS:case Jg.TILE_GEOJSON:return!0;case Jg.GLTF:return!1}};Object.freeze(Jg);var Wo=Jg;function Cs(e){let t=e.model,n=e.propertyTable;this._propertyTable=n,this._model=t,this._features=void 0,this._featuresLength=0,this._batchTexture=void 0,this._styleCommandsNeededDirty=!1,this._styleCommandsNeeded=pm.ALL_OPAQUE,Lnt(this)}Object.defineProperties(Cs.prototype,{batchTexture:{get:function(){return this._batchTexture}},featuresLength:{get:function(){return this._featuresLength}},batchTextureByteLength:{get:function(){return l(this._batchTexture)?this._batchTexture.byteLength:0}},styleCommandsNeededDirty:{get:function(){return this._styleCommandsNeededDirty}}});function Lnt(e){let t=e._model,n=Wo.is3DTiles(t.type),i=e._propertyTable.count;if(i===0)return;let r,o=new Array(i);if(n){let s=t.content;for(r=0;r<i;r++)o[r]=new na(s,r)}else for(r=0;r<i;r++)o[r]=new dF({model:t,featureId:r,featureTable:e});e._features=o,e._featuresLength=i,e._batchTexture=new Ql({featuresLength:i,owner:e,statistics:n?t.content.tileset.statistics:void 0})}Cs.prototype.update=function(e){this._styleCommandsNeededDirty=!1,this._batchTexture.update(void 0,e);let t=pm.getStyleCommandsNeeded(this._featuresLength,this._batchTexture.translucentFeaturesLength);this._styleCommandsNeeded!==t&&(this._styleCommandsNeededDirty=!0,this._styleCommandsNeeded=t)};Cs.prototype.setShow=function(e,t){this._batchTexture.setShow(e,t)};Cs.prototype.setAllShow=function(e){this._batchTexture.setAllShow(e)};Cs.prototype.getShow=function(e){return this._batchTexture.getShow(e)};Cs.prototype.setColor=function(e,t){this._batchTexture.setColor(e,t)};Cs.prototype.setAllColor=function(e){this._batchTexture.setAllColor(e)};Cs.prototype.getColor=function(e,t){return this._batchTexture.getColor(e,t)};Cs.prototype.getPickColor=function(e){return this._batchTexture.getPickColor(e)};Cs.prototype.getFeature=function(e){return this._features[e]};Cs.prototype.hasProperty=function(e,t){return this._propertyTable.hasProperty(e,t)};Cs.prototype.hasPropertyBySemantic=function(e,t){return this._propertyTable.hasPropertyBySemantic(e,t)};Cs.prototype.getProperty=function(e,t){return this._propertyTable.getProperty(e,t)};Cs.prototype.getPropertyBySemantic=function(e,t){return this._propertyTable.getPropertyBySemantic(e,t)};Cs.prototype.getPropertyIds=function(e){return this._propertyTable.getPropertyIds(e)};Cs.prototype.setProperty=function(e,t,n){return this._propertyTable.setProperty(e,t,n)};Cs.prototype.isClass=function(e,t){return this._propertyTable.isClass(e,t)};Cs.prototype.isExactClass=function(e,t){return this._propertyTable.isExactClass(e,t)};Cs.prototype.getExactClassName=function(e){return this._propertyTable.getExactClassName(e)};var Fnt=new z;Cs.prototype.applyStyle=function(e){if(!l(e)){this.setAllColor(Ql.DEFAULT_COLOR_VALUE),this.setAllShow(Ql.DEFAULT_SHOW_VALUE);return}for(let t=0;t<this._featuresLength;t++){let n=this.getFeature(t),i=l(e.color)?e.color.evaluateColor(n,Fnt)??Ql.DEFAULT_COLOR_VALUE:Ql.DEFAULT_COLOR_VALUE,r=l(e.show)?e.show.evaluate(n)??Ql.DEFAULT_SHOW_VALUE:Ql.DEFAULT_SHOW_VALUE;this.setColor(t,i),this.setShow(t,r)}};Cs.prototype.isDestroyed=function(){return!1};Cs.prototype.destroy=function(e){this._batchTexture=this._batchTexture&&this._batchTexture.destroy(),le(this)};var hF=Cs;var Mye={name:"TilesetPipelineStage"};Mye.process=function(e,t,n){if(t.hasSkipLevelOfDetail(n)){e.shaderBuilder.addDefine("POLYGON_OFFSET",void 0,de.FRAGMENT);let o={u_polygonOffset:function(){return U.ZERO}};e.uniformMap=Ot(o,e.uniformMap),e.hasSkipLevelOfDetail=!0}let i=e.renderStateOptions;i.stencilTest=Yt.setCesium3DTileBit(),i.stencilMask=Yt.CESIUM_3D_TILE_MASK};var mF=Mye;var pF=`vec2 nearestPointOnEllipseFast(vec2 pos, vec2 radii) { +}`),n=e.shaderCache.createDerivedShaderProgram(t,"EC",{vertexShaderSource:t.vertexShaderSource,fragmentShaderSource:r,attributeLocations:i})}return n}tw.prototype.update=function(e,t,n,i){if(!wxe(e.context))return;this._strength=n.eyeDomeLightingStrength,this._radius=n.eyeDomeLightingRadius*e.pixelRatio,Qrt(this,e.context);let r,o=e.commandList,s=o.length;for(r=t;r<s;++r){let u=o[r];if(u.primitiveType!==Oe.POINTS||u.pass===Ie.TRANSLUCENT)continue;let f,d,p=u.derivedCommands.pointCloudProcessor;l(p)&&(f=p.command,d=p.originalShaderProgram),(!l(f)||u.dirty||d!==u.shaderProgram||f.framebuffer!==this.framebuffer)&&(f=at.shallowClone(u,f),f.framebuffer=this.framebuffer,f.shaderProgram=eot(e.context,u.shaderProgram),f.castShadows=!1,f.receiveShadows=!1,l(p)||(p={command:f,originalShaderProgram:u.shaderProgram},u.derivedCommands.pointCloudProcessor=p),p.originalShaderProgram=u.shaderProgram),o[r]=f}let a=this._clearCommand,c=this._drawCommand;c.boundingVolume=i,o.push(c),o.push(a)};tw.prototype.isDestroyed=function(){return!1};tw.prototype.destroy=function(){return Jrt(this),le(this)};var Jg=tw;function Ixe(e){let t=e??{};this.attenuation=t.attenuation??!1,this.geometricErrorScale=t.geometricErrorScale??1,this.maximumAttenuation=t.maximumAttenuation,this.baseResolution=t.baseResolution,this.eyeDomeLighting=t.eyeDomeLighting??!0,this.eyeDomeLightingStrength=t.eyeDomeLightingStrength??1,this.eyeDomeLightingRadius=t.eyeDomeLightingRadius??1,this.backFaceCulling=t.backFaceCulling??!1,this.normalShading=t.normalShading??!0}Ixe.isSupported=function(e){return Jg.isSupported(e.context)};var t0=Ixe;var nw={};nw._deprecationWarning=qr;var Zg=Uint32Array.BYTES_PER_ELEMENT;nw.parse=function(e,t){let n=t??0;t=n;let i=new Uint8Array(e),r=new DataView(e);t+=Zg;let o=r.getUint32(t,!0);if(o!==1)throw new oe(`Only Batched 3D Model version 1 is supported. Version ${o} is not.`);t+=Zg;let s=r.getUint32(t,!0);t+=Zg;let a=r.getUint32(t,!0);t+=Zg;let c=r.getUint32(t,!0);t+=Zg;let u=r.getUint32(t,!0);t+=Zg;let f=r.getUint32(t,!0);t+=Zg;let d;u>=570425344?(t-=Zg*2,d=a,u=c,f=0,a=0,c=0,nw._deprecationWarning("b3dm-legacy-header","This b3dm header is using the legacy format [batchLength] [batchTableByteLength]. The new format is [featureTableJsonByteLength] [featureTableBinaryByteLength] [batchTableJsonByteLength] [batchTableBinaryByteLength] from https://github.com/CesiumGS/3d-tiles/tree/main/specification/TileFormats/Batched3DModel.")):f>=570425344&&(t-=Zg,d=u,u=a,f=c,a=0,c=0,nw._deprecationWarning("b3dm-legacy-header","This b3dm header is using the legacy format [batchTableJsonByteLength] [batchTableBinaryByteLength] [batchLength]. The new format is [featureTableJsonByteLength] [featureTableBinaryByteLength] [batchTableJsonByteLength] [batchTableBinaryByteLength] from https://github.com/CesiumGS/3d-tiles/tree/main/specification/TileFormats/Batched3DModel."));let p;a===0?p={BATCH_LENGTH:d??0}:(p=No(i,t,a),t+=a);let g=new Uint8Array(e,t,c);t+=c;let m,y;u>0&&(m=No(i,t,u),t+=u,f>0&&(y=new Uint8Array(e,t,f),y=new Uint8Array(y),t+=f));let A=n+s-t;if(A===0)throw new oe("glTF byte length must be greater than 0.");let b;return t%4===0?b=new Uint8Array(e,t,A):(nw._deprecationWarning("b3dm-glb-unaligned","The embedded glb is not aligned to a 4-byte boundary."),b=new Uint8Array(i.subarray(t,t+A))),{batchLength:d,featureTableJson:p,featureTableBinary:g,batchTableJson:m,batchTableBinary:y,gltf:b}};var WF=nw;function qF(e,t){this.json=e,this.buffer=t,this._cachedTypedArrays={},this.featuresLength=0}function Pxe(e,t,n,i,r,o){let s=e._cachedTypedArrays,a=s[t];return l(a)||(a=Y.createArrayBufferView(n,e.buffer.buffer,e.buffer.byteOffset+o,r*i),s[t]=a),a}function tot(e,t,n,i){let r=e._cachedTypedArrays,o=r[t];return l(o)||(o=Y.createTypedArray(n,i),r[t]=o),o}qF.prototype.getGlobalProperty=function(e,t,n){let i=this.json[e];if(l(i))return l(i.byteOffset)?(t=t??Y.UNSIGNED_INT,n=n??1,Pxe(this,e,t,n,1,i.byteOffset)):i};qF.prototype.hasProperty=function(e){return l(this.json[e])};qF.prototype.getPropertyArray=function(e,t,n){let i=this.json[e];if(l(i))return l(i.byteOffset)?(l(i.componentType)&&(t=Y.fromName(i.componentType)),Pxe(this,e,t,n,this.featuresLength,i.byteOffset)):tot(this,e,t,i)};qF.prototype.getProperty=function(e,t,n,i,r){let o=this.json[e];if(!l(o))return;let s=this.getPropertyArray(e,t,n);if(n===1)return s[i];for(let a=0;a<n;++a)r[a]=s[n*i+a];return r};var Cm=qF;var not={SCALAR:1,VEC2:2,VEC3:3,VEC4:4,MAT2:4,MAT3:9,MAT4:16},iot={SCALAR:void 0,VEC2:U,VEC3:h,VEC4:se,MAT2:Xi,MAT3:$,MAT4:N};function rot(e){let t=e.componentType,n;typeof t=="string"?n=Y.fromName(t):n=t;let i=not[e.type],r=iot[e.type];return{componentsPerAttribute:i,classType:r,createArrayBufferView:function(o,s,a){return Y.createArrayBufferView(n,o,s,i*a)}}}var Qd=rot;function hl(e){this._id=Kn();let t=e.featuresLength;this._showAlphaProperties=void 0,this._batchValues=void 0,this._batchValuesDirty=!1,this._batchTexture=void 0,this._defaultTexture=void 0,this._pickTexture=void 0,this._pickIds=[];let n,i;if(t>0){let r=Math.min(t,kt.maximumTextureSize),o=Math.ceil(t/kt.maximumTextureSize),s=1/r,a=s*.5,c=1/o,u=c*.5;n=new U(r,o),i=new se(s,a,c,u)}this._translucentFeaturesLength=0,this._featuresLength=t,this._textureDimensions=n,this._textureStep=i,this._owner=e.owner,this._statistics=e.statistics,this._colorChangedCallback=e.colorChangedCallback}Object.defineProperties(hl.prototype,{translucentFeaturesLength:{get:function(){return this._translucentFeaturesLength}},byteLength:{get:function(){let e=0;return l(this._pickTexture)&&(e+=this._pickTexture.sizeInBytes),l(this._batchTexture)&&(e+=this._batchTexture.sizeInBytes),e}},textureDimensions:{get:function(){return this._textureDimensions}},textureStep:{get:function(){return this._textureStep}},batchTexture:{get:function(){return this._batchTexture}},defaultTexture:{get:function(){return this._defaultTexture}},pickTexture:{get:function(){return this._pickTexture}}});hl.DEFAULT_COLOR_VALUE=z.WHITE;hl.DEFAULT_SHOW_VALUE=!0;function Dxe(e){let t=e._textureDimensions;return t.x*t.y*4}function Rxe(e){if(!l(e._batchValues)){let t=Dxe(e),n=new Uint8Array(t).fill(255);e._batchValues=n}return e._batchValues}function Oxe(e){if(!l(e._showAlphaProperties)){let t=2*e._featuresLength,n=new Uint8Array(t).fill(255);e._showAlphaProperties=n}return e._showAlphaProperties}hl.prototype.setShow=function(e,t){if(t&&!l(this._showAlphaProperties))return;let n=Oxe(this),i=e*2,r=t?255:0;if(n[i]!==r){n[i]=r;let o=Rxe(this),s=e*4+3;o[s]=t?n[i+1]:0,this._batchValuesDirty=!0}};hl.prototype.setAllShow=function(e){let t=this._featuresLength;for(let n=0;n<t;++n)this.setShow(n,e)};hl.prototype.getShow=function(e){if(!l(this._showAlphaProperties))return!0;let t=e*2;return this._showAlphaProperties[t]===255};var oot=new Array(4);hl.prototype.setColor=function(e,t){if(z.equals(t,hl.DEFAULT_COLOR_VALUE)&&!l(this._batchValues))return;let n=t.toBytes(oot),i=n[3],r=Rxe(this),o=e*4,s=Oxe(this),a=e*2;if(r[o]!==n[0]||r[o+1]!==n[1]||r[o+2]!==n[2]||s[a+1]!==i){r[o]=n[0],r[o+1]=n[1],r[o+2]=n[2];let c=s[a+1]!==255,u=s[a]!==0;r[o+3]=u?i:0,s[a+1]=i;let f=i!==255;f&&!c?++this._translucentFeaturesLength:!f&&c&&--this._translucentFeaturesLength,this._batchValuesDirty=!0,l(this._colorChangedCallback)&&this._colorChangedCallback(e,t)}};hl.prototype.setAllColor=function(e){let t=this._featuresLength;for(let n=0;n<t;++n)this.setColor(n,e)};hl.prototype.getColor=function(e,t){if(!l(this._batchValues))return z.clone(hl.DEFAULT_COLOR_VALUE,t);let n=this._batchValues,i=e*4,r=this._showAlphaProperties,o=e*2;return z.fromBytes(n[i],n[i+1],n[i+2],r[o+1],t)};hl.prototype.getPickColor=function(e){return this._pickIds[e]};function Mxe(e,t,n){let i=e._textureDimensions;return new Dt({context:t,pixelFormat:Ke.RGBA,pixelDatatype:ze.UNSIGNED_BYTE,source:{width:i.x,height:i.y,arrayBufferView:n},flipY:!1,sampler:jt.NEAREST})}function sot(e,t){let n=e._featuresLength;if(!l(e._pickTexture)&&n>0){let i=e._pickIds,r=Dxe(e),o=new Uint8Array(r),s=e._owner,a=e._statistics;for(let c=0;c<n;++c){let u=t.createPickId(s.getFeature(c));i.push(u);let f=u.color,d=c*4;o[d]=z.floatToByte(f.red),o[d+1]=z.floatToByte(f.green),o[d+2]=z.floatToByte(f.blue),o[d+3]=z.floatToByte(f.alpha)}e._pickTexture=Mxe(e,t,o),l(a)&&(a.batchTableByteLength+=e._pickTexture.sizeInBytes)}}function aot(e){let t=e._textureDimensions;e._batchTexture.copyFrom({source:{width:t.x,height:t.y,arrayBufferView:e._batchValues}})}hl.prototype.update=function(e,t){let n=t.context;this._defaultTexture=n.defaultTexture;let i=t.passes;(i.pick||i.postProcess)&&sot(this,n),this._batchValuesDirty&&(this._batchValuesDirty=!1,l(this._batchTexture)||(this._batchTexture=Mxe(this,n,this._batchValues),l(this._statistics)&&(this._statistics.batchTableByteLength+=this._batchTexture.sizeInBytes)),aot(this))};hl.prototype.isDestroyed=function(){return!1};hl.prototype.destroy=function(){this._batchTexture=this._batchTexture&&this._batchTexture.destroy(),this._pickTexture=this._pickTexture&&this._pickTexture.destroy();let e=this._pickIds,t=e.length;for(let n=0;n<t;++n)e[n].destroy();return le(this)};var cu=hl;var Nxe={HIGHLIGHT:0,REPLACE:1,MIX:2};Object.freeze(Nxe);var qu=Nxe;var xZ=cu.DEFAULT_COLOR_VALUE,TZ=cu.DEFAULT_SHOW_VALUE;function Yr(e,t,n,i,r){this.featuresLength=t;let o;l(n)&&(o=n.extensions),this._extensions=o??{};let s=cot(n);this._properties=s,this._batchTableHierarchy=lot(this,n,i);let a=Fxe(t,s,i);this._binaryPropertiesByteLength=uot(a),this._batchTableBinaryProperties=a,this._content=e,this._batchTexture=new cu({featuresLength:t,colorChangedCallback:r,owner:e,statistics:e.tileset.statistics})}Yr._deprecationWarning=qr;Object.defineProperties(Yr.prototype,{batchTableByteLength:{get:function(){let e=this._binaryPropertiesByteLength;return l(this._batchTableHierarchy)&&(e+=this._batchTableHierarchy.byteLength),e+=this._batchTexture.byteLength,e}}});function cot(e){let t={};if(!l(e))return t;for(let n in e)e.hasOwnProperty(n)&&n!=="HIERARCHY"&&n!=="extensions"&&n!=="extras"&&(t[n]=Je(e[n],!0));return t}function lot(e,t,n){if(!l(t))return;let i=e._extensions["3DTILES_batch_table_hierarchy"],r=t.HIERARCHY;if(l(r)&&(Yr._deprecationWarning("batchTableHierarchyExtension","The batch table HIERARCHY property has been moved to an extension. Use extensions.3DTILES_batch_table_hierarchy instead."),e._extensions["3DTILES_batch_table_hierarchy"]=r,i=r),!!l(i))return new FT({extension:i,binaryBody:n})}function Fxe(e,t,n){let i;for(let r in t)if(t.hasOwnProperty(r)){let o=t[r],s=o.byteOffset;if(l(s)){let a=o.componentType,c=o.type;if(!l(a))throw new oe("componentType is required.");if(!l(c))throw new oe("type is required.");if(!l(n))throw new oe(`Property ${r} requires a batch table binary.`);let u=Qd(o),f=u.componentsPerAttribute,d=u.classType,p=u.createArrayBufferView(n.buffer,n.byteOffset+s,e);l(i)||(i={}),i[r]={typedArray:p,componentCount:f,type:d}}}return i}function uot(e){if(!l(e))return 0;let t=0;for(let n in e)e.hasOwnProperty(n)&&(t+=e[n].typedArray.byteLength);return t}Yr.getBinaryProperties=function(e,t,n){return Fxe(e,t,n)};Yr.prototype.setShow=function(e,t){this._batchTexture.setShow(e,t)};Yr.prototype.setAllShow=function(e){this._batchTexture.setAllShow(e)};Yr.prototype.getShow=function(e){return this._batchTexture.getShow(e)};Yr.prototype.setColor=function(e,t){this._batchTexture.setColor(e,t)};Yr.prototype.setAllColor=function(e){this._batchTexture.setAllColor(e)};Yr.prototype.getColor=function(e,t){return this._batchTexture.getColor(e,t)};Yr.prototype.getPickColor=function(e){return this._batchTexture.getPickColor(e)};var fot=new z;Yr.prototype.applyStyle=function(e){if(!l(e)){this.setAllColor(xZ),this.setAllShow(TZ);return}let t=this._content,n=this.featuresLength;for(let i=0;i<n;++i){let r=t.getFeature(i),o=l(e.color)?e.color.evaluateColor(r,fot)??xZ:xZ,s=l(e.show)?e.show.evaluate(r)??TZ:TZ;this.setColor(i,o),this.setShow(i,s)}};function dot(e,t){let n=e.typedArray,i=e.componentCount;return i===1?n[t]:e.type.unpack(n,t*i)}function hot(e,t,n){let i=e.typedArray,r=e.componentCount;r===1?i[t]=n:e.type.pack(n,i,t*r)}Yr.prototype.isClass=function(e,t){let n=this._batchTableHierarchy;return l(n)?n.isClass(e,t):!1};Yr.prototype.isExactClass=function(e,t){return this.getExactClassName(e)===t};Yr.prototype.getExactClassName=function(e){let t=this._batchTableHierarchy;if(l(t))return t.getClassName(e)};Yr.prototype.hasProperty=function(e,t){return l(this._properties[t])||l(this._batchTableHierarchy)&&this._batchTableHierarchy.hasProperty(e,t)};Yr.prototype.hasPropertyBySemantic=function(){return!1};Yr.prototype.getPropertyIds=function(e,t){t=l(t)?t:[],t.length=0;let n=Object.keys(this._properties);if(Zn(t,n),l(this._batchTableHierarchy)){let i=this._batchTableHierarchy.getPropertyIds(e,n);Zn(t,i)}return t};Yr.prototype.getPropertyBySemantic=function(e,t){};Yr.prototype.getProperty=function(e,t){if(l(this._batchTableBinaryProperties)){let i=this._batchTableBinaryProperties[t];if(l(i))return dot(i,e)}let n=this._properties[t];if(l(n))return Je(n[e],!0);if(l(this._batchTableHierarchy)){let i=this._batchTableHierarchy.getProperty(e,t);if(l(i))return i}};Yr.prototype.setProperty=function(e,t,n){let i=this.featuresLength;if(l(this._batchTableBinaryProperties)){let o=this._batchTableBinaryProperties[t];if(l(o)){hot(o,e,n);return}}if(l(this._batchTableHierarchy)&&this._batchTableHierarchy.setProperty(e,t,n))return;let r=this._properties[t];l(r)||(this._properties[t]=new Array(i),r=this._properties[t]),r[e]=Je(n,!0)};function mot(e){return e._batchTexture.textureDimensions.y===1?`uniform vec4 tile_textureStep; +vec2 computeSt(float batchId) +{ + float stepX = tile_textureStep.x; + float centerX = tile_textureStep.y; + return vec2(centerX + (batchId * stepX), 0.5); +} +`:`uniform vec4 tile_textureStep; +uniform vec2 tile_textureDimensions; +vec2 computeSt(float batchId) +{ + float stepX = tile_textureStep.x; + float centerX = tile_textureStep.y; + float stepY = tile_textureStep.z; + float centerY = tile_textureStep.w; + float xId = mod(batchId, tile_textureDimensions.x); + float yId = floor(batchId / tile_textureDimensions.x); + return vec2(centerX + (xId * stepX), centerY + (yId * stepY)); +} +`}Yr.prototype.getVertexShaderCallback=function(e,t,n){if(this.featuresLength===0)return;let i=this;return function(r){let o=Bxe(r,n,!1),s;return kt.maximumVertexTextureImageUnits>0?(s="",e&&(s+=`uniform bool tile_translucentCommand; +`),s+=`uniform sampler2D tile_batchTexture; +out vec4 tile_featureColor; +out vec2 tile_featureSt; +void main() +{ + vec2 st = computeSt(${t}); + vec4 featureProperties = texture(tile_batchTexture, st); + tile_color(featureProperties); + float show = ceil(featureProperties.a); + gl_Position *= show; +`,e&&(s+=` bool isStyleTranslucent = (featureProperties.a != 1.0); + if (czm_pass == czm_passTranslucent) + { + if (!isStyleTranslucent && !tile_translucentCommand) + { + gl_Position *= 0.0; + } + } + else + { + if (isStyleTranslucent) + { + gl_Position *= 0.0; + } + } +`),s+=` tile_featureColor = featureProperties; + tile_featureSt = st; +}`):s=`out vec2 tile_featureSt; +void main() +{ + tile_color(vec4(1.0)); + tile_featureSt = computeSt(${t}); +}`,`${o} +${mot(i)}${s}`}};function Lxe(e,t){return e=Ye.replaceMain(e,"tile_main"),t?`${e}uniform float tile_colorBlend; +void tile_color(vec4 tile_featureColor) +{ + tile_main(); + tile_featureColor = czm_gammaCorrect(tile_featureColor); + out_FragColor.a *= tile_featureColor.a; + float highlight = ceil(tile_colorBlend); + out_FragColor.rgb *= mix(tile_featureColor.rgb, vec3(1.0), highlight); +} +`:`${e}void tile_color(vec4 tile_featureColor) +{ + tile_main(); +} +`}function pot(e,t){let n=`texture(${t}`,i=0,r=e.indexOf(n,i),o;for(;r>-1;){let s=0;for(let u=r;u<e.length;++u){let f=e.charAt(u);if(f==="(")++s;else if(f===")"&&(--s,s===0)){o=u+1;break}}let c=`tile_diffuse_final(${e.slice(r,o)}, tile_diffuse)`;e=e.slice(0,r)+c+e.slice(o),i=r+c.length,r=e.indexOf(n,i)}return e}function Bxe(e,t,n){if(!l(t))return Lxe(e,n);let i=new RegExp(`(uniform|attribute|in)\\s+(vec[34]|sampler2D)\\s+${t};`),r=e.match(i);if(!l(r))return Lxe(e,n);let o=r[0],s=r[2];e=Ye.replaceMain(e,"tile_main"),e=e.replace(o,"");let a=`bool isWhite(vec3 color) +{ + return all(greaterThan(color, vec3(1.0 - czm_epsilon3))); +} +vec4 tile_diffuse_final(vec4 sourceDiffuse, vec4 tileDiffuse) +{ + vec4 blendDiffuse = mix(sourceDiffuse, tileDiffuse, tile_colorBlend); + vec4 diffuse = isWhite(tileDiffuse.rgb) ? sourceDiffuse : blendDiffuse; + return vec4(diffuse.rgb, sourceDiffuse.a); +} +`,c=` tile_featureColor = czm_gammaCorrect(tile_featureColor); + out_FragColor.a *= tile_featureColor.a; + float highlight = ceil(tile_colorBlend); + out_FragColor.rgb *= mix(tile_featureColor.rgb, vec3(1.0), highlight); +`,u;if(s==="vec3"||s==="vec4"){let f=s==="vec3"?`vec4(${t}, 1.0)`:t,d=s==="vec3"?"tile_diffuse.xyz":"tile_diffuse";i=new RegExp(t,"g"),e=e.replace(i,d),u=` vec4 source = ${f}; + tile_diffuse = tile_diffuse_final(source, tile_featureColor); + tile_main(); +`}else s==="sampler2D"&&(e=pot(e,t),u=` tile_diffuse = tile_featureColor; + tile_main(); +`);return e=`uniform float tile_colorBlend; +vec4 tile_diffuse = vec4(1.0); +${a}${o} +${e} +void tile_color(vec4 tile_featureColor) +{ +${u}`,n&&(e+=c),e+=`} +`,e}Yr.prototype.getFragmentShaderCallback=function(e,t,n){if(this.featuresLength!==0)return function(i){return i=Bxe(i,t,!0),kt.maximumVertexTextureImageUnits>0?(i+=`uniform sampler2D tile_pickTexture; +in vec2 tile_featureSt; +in vec4 tile_featureColor; +void main() +{ + tile_color(tile_featureColor); +`,n&&(i+=` out_FragColor.rgb *= out_FragColor.a; +`),i+="}"):(e&&(i+=`uniform bool tile_translucentCommand; +`),i+=`uniform sampler2D tile_pickTexture; +uniform sampler2D tile_batchTexture; +in vec2 tile_featureSt; +void main() +{ + vec4 featureProperties = texture(tile_batchTexture, tile_featureSt); + if (featureProperties.a == 0.0) { + discard; + } +`,e&&(i+=` bool isStyleTranslucent = (featureProperties.a != 1.0); + if (czm_pass == czm_passTranslucent) + { + if (!isStyleTranslucent && !tile_translucentCommand) + { + discard; + } + } + else + { + if (isStyleTranslucent) + { + discard; + } + } +`),i+=` tile_color(featureProperties); +`,n&&(i+=` out_FragColor.rgb *= out_FragColor.a; +`),i+=`} +`),i}};function got(e){let t=e._content.tileset,n=t.colorBlendMode,i=t.colorBlendAmount;if(n===qu.HIGHLIGHT)return 0;if(n===qu.REPLACE)return 1;if(n===qu.MIX)return D.clamp(i,D.EPSILON4,1)}Yr.prototype.getUniformMapCallback=function(){if(this.featuresLength===0)return;let e=this;return function(t){return Ot(t,{tile_batchTexture:function(){return e._batchTexture.batchTexture??e._batchTexture.defaultTexture},tile_textureDimensions:function(){return e._batchTexture.textureDimensions},tile_textureStep:function(){return e._batchTexture.textureStep},tile_colorBlend:function(){return got(e)},tile_pickTexture:function(){return e._batchTexture.pickTexture}})}};Yr.prototype.getPickId=function(){return"texture(tile_pickTexture, tile_featureSt)"};var xA={ALL_OPAQUE:0,ALL_TRANSLUCENT:1,OPAQUE_AND_TRANSLUCENT:2};Yr.prototype.addDerivedCommands=function(e,t){let n=e.commandList,i=n.length,r=this._content._tile,o=r._finalResolution,s=r.tileset,a=s.isSkippingLevelOfDetail&&s.hasMixedContent&&e.context.stencilBuffer,c=_ot(this);for(let u=t;u<i;++u){let f=n[u];if(f.pass===Ie.COMPUTE)continue;let d=f.derivedCommands.tileset;(!l(d)||f.dirty)&&(d={},f.derivedCommands.tileset=d,d.originalCommand=yot(f),f.dirty=!1);let p=d.originalCommand;c!==xA.ALL_OPAQUE&&f.pass!==Ie.TRANSLUCENT&&(l(d.translucent)||(d.translucent=Aot(p))),c!==xA.ALL_TRANSLUCENT&&f.pass!==Ie.TRANSLUCENT&&(l(d.opaque)||(d.opaque=bot(p)),a&&(o||(l(d.zback)||(d.zback=Tot(e.context,p)),s._backfaceCommands.push(d.zback)),(!l(d.stencil)||r._selectionDepth!==Cot(d.stencil))&&(f.renderState.depthMask?d.stencil=Eot(p,r._selectionDepth):d.stencil=d.opaque)));let g=a?d.stencil:d.opaque,m=d.translucent;f.pass!==Ie.TRANSLUCENT?(c===xA.ALL_OPAQUE&&(n[u]=g),c===xA.ALL_TRANSLUCENT&&(n[u]=m),c===xA.OPAQUE_AND_TRANSLUCENT&&(n[u]=g,n.push(m))):n[u]=p}};function _ot(e){let t=e._batchTexture.translucentFeaturesLength;return t===0?xA.ALL_OPAQUE:t===e.featuresLength?xA.ALL_TRANSLUCENT:xA.OPAQUE_AND_TRANSLUCENT}function yot(e){let t=at.shallowClone(e),n=t.pass===Ie.TRANSLUCENT;return t.uniformMap=l(t.uniformMap)?t.uniformMap:{},t.uniformMap.tile_translucentCommand=function(){return n},t}function Aot(e){let t=at.shallowClone(e);return t.pass=Ie.TRANSLUCENT,t.renderState=vot(e.renderState),t}function bot(e){let t=at.shallowClone(e);return t.renderState=Sot(e.renderState),t}function xot(e,t){let n=e.shaderCache.getDerivedShaderProgram(t,"zBackfaceLogDepth");if(!l(n)){let i=t.fragmentShaderSource.clone();i.defines=l(i.defines)?i.defines.slice(0):[],i.defines.push("POLYGON_OFFSET"),n=e.shaderCache.createDerivedShaderProgram(t,"zBackfaceLogDepth",{vertexShaderSource:t.vertexShaderSource,fragmentShaderSource:i,attributeLocations:t._attributeLocations})}return n}function Tot(e,t){let n=at.shallowClone(t),i=Je(n.renderState,!0);i.cull.enabled=!0,i.cull.face=zi.FRONT,i.colorMask={red:!1,green:!1,blue:!1,alpha:!1},i.polygonOffset={enabled:!0,factor:5,units:5},i.stencilTest=Yt.setCesium3DTileBit(),i.stencilMask=Yt.CESIUM_3D_TILE_MASK,n.renderState=Ge.fromCache(i),n.castShadows=!1,n.receiveShadows=!1,n.uniformMap=Je(t.uniformMap);let r=new U(5,5);return n.uniformMap.u_polygonOffset=function(){return r},n.shaderProgram=xot(e,t.shaderProgram),n}function Eot(e,t){let n=at.shallowClone(e),i=Je(n.renderState,!0);return i.stencilTest.enabled=!0,i.stencilTest.mask=Yt.SKIP_LOD_MASK,i.stencilTest.reference=Yt.CESIUM_3D_TILE_MASK|t<<Yt.SKIP_LOD_BIT_SHIFT,i.stencilTest.frontFunction=ei.GREATER_OR_EQUAL,i.stencilTest.frontOperation.zPass=Rt.REPLACE,i.stencilTest.backFunction=ei.GREATER_OR_EQUAL,i.stencilTest.backOperation.zPass=Rt.REPLACE,i.stencilMask=Yt.CESIUM_3D_TILE_MASK|Yt.SKIP_LOD_MASK,n.renderState=Ge.fromCache(i),n}function Cot(e){return(e.renderState.stencilTest.reference&Yt.SKIP_LOD_MASK)>>>Yt.SKIP_LOD_BIT_SHIFT}function vot(e){let t=Je(e,!0);return t.cull.enabled=!1,t.depthTest.enabled=!0,t.depthMask=!1,t.blending=tn.ALPHA_BLEND,t.stencilTest=Yt.setCesium3DTileBit(),t.stencilMask=Yt.CESIUM_3D_TILE_MASK,Ge.fromCache(t)}function Sot(e){let t=Je(e,!0);return t.stencilTest=Yt.setCesium3DTileBit(),t.stencilMask=Yt.CESIUM_3D_TILE_MASK,Ge.fromCache(t)}Yr.prototype.update=function(e,t){this._batchTexture.update(e,t)};Yr.prototype.isDestroyed=function(){return!1};Yr.prototype.destroy=function(){return this._batchTexture=this._batchTexture&&this._batchTexture.destroy(),le(this)};var vm=Yr;function Qg(e){this._classes=void 0,this._classIds=void 0,this._classIndexes=void 0,this._parentCounts=void 0,this._parentIndexes=void 0,this._parentIds=void 0,this._byteLength=0,wot(this,e.extension,e.binaryBody)}Object.defineProperties(Qg.prototype,{byteLength:{get:function(){return this._byteLength}}});function wot(e,t,n){let i,r,o,s=t.instancesLength,a=t.classes,c=t.classIds,u=t.parentCounts,f=t.parentIds,d=s,p=0;l(c.byteOffset)&&(c.componentType=c.componentType??Y.UNSIGNED_SHORT,c.type=Vt.SCALAR,o=Qd(c),c=o.createArrayBufferView(n.buffer,n.byteOffset+c.byteOffset,s),p+=c.byteLength);let g;if(l(u)){for(l(u.byteOffset)&&(u.componentType=u.componentType??Y.UNSIGNED_SHORT,u.type=Vt.SCALAR,o=Qd(u),u=o.createArrayBufferView(n.buffer,n.byteOffset+u.byteOffset,s),p+=u.byteLength),g=new Uint16Array(s),d=0,i=0;i<s;++i)g[i]=d,d+=u[i];p+=g.byteLength}l(f)&&l(f.byteOffset)&&(f.componentType=f.componentType??Y.UNSIGNED_SHORT,f.type=Vt.SCALAR,o=Qd(f),f=o.createArrayBufferView(n.buffer,n.byteOffset+f.byteOffset,d),p+=f.byteLength);let m=a.length;for(i=0;i<m;++i){let b=a[i].length,x=a[i].instances,T=vm.getBinaryProperties(b,x,n);p+=Iot(T),a[i].instances=Ot(T,x)}let y=new Array(m).fill(0),A=new Uint16Array(s);for(i=0;i<s;++i)r=c[i],A[i]=y[r],++y[r];p+=A.byteLength,e._classes=a,e._classIds=c,e._classIndexes=A,e._parentCounts=u,e._parentIndexes=g,e._parentIds=f,e._byteLength=p}function Iot(e){let t=0;for(let n in e)e.hasOwnProperty(n)&&(t+=e[n].typedArray.byteLength);return t}var Pot=[],Dot=[],Rot=0;function Oot(e,t,n){let i=e._classIds,r=e._parentCounts,o=e._parentIds,s=e._parentIndexes,a=i.length,c=Pot;c.length=Math.max(c.length,a);let u=++Rot,f=Dot;for(f.length=0,f.push(t);f.length>0;){if(t=f.pop(),c[t]===u)continue;c[t]=u;let d=n(e,t);if(l(d))return d;let p=r[t],g=s[t];for(let m=0;m<p;++m){let y=o[g+m];y!==t&&f.push(y)}}}function Mot(e,t,n){let i=!0;for(;i;){let r=n(e,t);if(l(r))return r;let o=e._parentIds[t];i=o!==t,t=o}}function YF(e,t,n){let i=e._parentCounts,r=e._parentIds;if(l(r)){if(l(i))return Oot(e,t,n)}else return n(e,t);return Mot(e,t,n)}Qg.prototype.hasProperty=function(e,t){let n=YF(this,e,function(i,r){let o=i._classIds[r],s=i._classes[o].instances;if(l(s[t]))return!0});return l(n)};Qg.prototype.propertyExists=function(e){let t=this._classes,n=t.length;for(let i=0;i<n;++i){let r=t[i].instances;if(l(r[e]))return!0}return!1};Qg.prototype.getPropertyIds=function(e,t){return t=l(t)?t:[],t.length=0,YF(this,e,function(n,i){let r=n._classIds[i],o=n._classes[r].instances;for(let s in o)o.hasOwnProperty(s)&&t.indexOf(s)===-1&&t.push(s)}),t};Qg.prototype.getProperty=function(e,t){return YF(this,e,function(n,i){let r=n._classIds[i],o=n._classes[r],s=n._classIndexes[i],a=o.instances[t];if(l(a))return l(a.typedArray)?Not(a,s):Je(a[s],!0)})};function Not(e,t){let n=e.typedArray,i=e.componentCount;return i===1?n[t]:e.type.unpack(n,t*i)}Qg.prototype.setProperty=function(e,t,n){let i=YF(this,e,function(r,o){let s=r._classIds[o],a=r._classes[s],c=r._classIndexes[o],u=a.instances[t];if(l(u))return l(u.typedArray)?Lot(u,c,n):u[c]=Je(n,!0),!0});return l(i)};function Lot(e,t,n){let i=e.typedArray,r=e.componentCount;r===1?i[t]=n:e.type.pack(n,i,t*r)}Qg.prototype.isClass=function(e,t){let n=YF(this,e,function(i,r){let o=i._classIds[r];if(i._classes[o].name===t)return!0});return l(n)};Qg.prototype.getClassName=function(e){let t=this._classIds[e];return this._classes[t].name};var FT=Qg;function XF(e){let t=e.count,n=e.batchTable,i=e.binaryBody,r=e.parseAsPropertyAttributes??!1,o=e.customAttributeOutput,s=Fot(n),a;l(s.jsonProperties)&&(a=new Yg({count:t,properties:s.jsonProperties}));let c;l(s.hierarchy)&&(c=new FT({extension:s.hierarchy,binaryBody:i}));let u=xm.BATCH_TABLE_CLASS_NAME,f=s.binaryProperties,d,p,g;if(r){let A=kot(t,u,f,i,o);g=A.transcodedSchema,p=[new TT({propertyAttribute:A.propertyAttributeJson,class:A.transcodedClass})]}else{let A=Bot(t,u,f,i);g=A.transcodedSchema;let b=A.featureTableJson;d=new $d({count:b.count,properties:b.properties,class:A.transcodedClass,bufferViews:A.bufferViewsTypedArrays}),p=[]}let m=[];if(l(d)||l(a)||l(c)){let A=new ru({id:0,name:"Batch Table",count:t,metadataTable:d,jsonMetadataTable:a,batchTableHierarchy:c});m.push(A)}let y={schema:g,propertyTables:m,propertyAttributes:p,extensions:s.extensions,extras:s.extras};return new Ha(y)}function Fot(e){let t=e.HIERARCHY,n=e.extras,i=e.extensions,r;l(t)?(XF._deprecationWarning("batchTableHierarchyExtension","The batch table HIERARCHY property has been moved to an extension. Use extensions.3DTILES_batch_table_hierarchy instead."),r=t):l(i)&&(r=i["3DTILES_batch_table_hierarchy"]);let o,s={};for(let a in e){if(!e.hasOwnProperty(a)||a==="HIERARCHY"||a==="extensions"||a==="extras")continue;let c=e[a];Array.isArray(c)?(o=l(o)?o:{},o[a]=c):s[a]=c}return{binaryProperties:s,jsonProperties:o,hierarchy:r,extras:n,extensions:i}}function Bot(e,t,n,i){let r={},o={},s={},a=0;for(let d in n){if(!n.hasOwnProperty(d))continue;if(!l(i))throw new oe(`Property ${d} requires a batch table binary.`);let p=n[d],g=Qd(p);o[d]={bufferView:a},r[d]=kxe(p),s[a]=g.createArrayBufferView(i.buffer,i.byteOffset+p.byteOffset,e),a++}let c={classes:{}};c.classes[t]={properties:r};let u=ou.fromJson(c);return{featureTableJson:{class:t,count:e,properties:o},bufferViewsTypedArrays:s,transcodedSchema:u,transcodedClass:u.classes[t]}}function kot(e,t,n,i,r){let o={},s={},a=0;for(let d in n){if(!n.hasOwnProperty(d))continue;let p=n[d];if(!l(i)&&!l(p.typedArray))throw new oe(`Property ${d} requires a batch table binary.`);let g=xt.sanitizeGlslIdentifier(d);(g===""||o.hasOwnProperty(g))&&(g=`property_${a}`,a++);let m=kxe(p);m.name=d,o[g]=m;let y=g.toUpperCase();y.startsWith("_")||(y=`_${y}`);let A=p.typedArray;l(A)||(A=Qd(p).createArrayBufferView(i.buffer,i.byteOffset+p.byteOffset,e));let b=new Cn.Attribute;b.name=y,b.count=e,b.type=p.type;let x=Y.fromTypedArray(A);(x===Y.INT||x===Y.UNSIGNED_INT||x===Y.DOUBLE)&&(XF._oneTimeWarning("Cast pnts property to floats",`Point cloud property "${y}" will be cast to a float array because INT, UNSIGNED_INT, and DOUBLE are not valid WebGL vertex attribute types. Some precision may be lost.`),A=new Float32Array(A)),b.componentDatatype=Y.fromTypedArray(A),b.typedArray=A,r.push(b),s[g]={attribute:y}}let c={classes:{}};c.classes[t]={properties:o};let u=ou.fromJson(c);return{class:t,propertyAttributeJson:{properties:s},transcodedSchema:u,transcodedClass:u.classes[t]}}function kxe(e){let t=Uot(e.componentType);return{type:e.type,componentType:t}}function Uot(e){switch(e){case"BYTE":return"INT8";case"UNSIGNED_BYTE":return"UINT8";case"SHORT":return"INT16";case"UNSIGNED_SHORT":return"UINT16";case"INT":return"INT32";case"UNSIGNED_INT":return"UINT32";case"FLOAT":return"FLOAT32";case"DOUBLE":return"FLOAT64"}}XF._deprecationWarning=qr;XF._oneTimeWarning=_t;var e_=XF;var BT={UNLOADED:0,LOADING:1,PROCESSING:2,READY:3,FAILED:4},zot=Cn.FeatureIdAttribute,EZ=class extends ir{constructor(t){super(),t=t??H.EMPTY_OBJECT;let n=t.b3dmResource,i=t.baseResource,r=t.arrayBuffer,o=t.byteOffset??0,s=t.releaseGltfJson??!1,a=t.asynchronous??!0,c=t.incrementallyLoadTextures??!0,u=t.upAxis??Hi.Y,f=t.forwardAxis??Hi.X,d=t.loadAttributesAsTypedArray??!1,p=t.loadAttributesFor2D??!1,g=t.enablePick??!1,m=t.loadIndicesForWireframe??!1,y=t.loadPrimitiveOutline??!0,A=t.loadForClassification??!1;i=l(i)?i:n.clone(),this._b3dmResource=n,this._baseResource=i,this._arrayBuffer=r,this._byteOffset=o,this._releaseGltfJson=s,this._asynchronous=a,this._incrementallyLoadTextures=c,this._upAxis=u,this._forwardAxis=f,this._loadAttributesAsTypedArray=d,this._loadAttributesFor2D=p,this._enablePick=g,this._loadIndicesForWireframe=m,this._loadPrimitiveOutline=y,this._loadForClassification=A,this._state=BT.UNLOADED,this._promise=void 0,this._gltfLoader=void 0,this._batchLength=0,this._propertyTable=void 0,this._batchTable=void 0,this._components=void 0,this._transform=N.IDENTITY}get texturesLoaded(){return this._gltfLoader?.texturesLoaded}get cacheKey(){}get components(){return this._components}load(){if(l(this._promise))return this._promise;let t=WF.parse(this._arrayBuffer,this._byteOffset),n=t.featureTableJson,i=t.featureTableBinary,r=t.batchTableJson,o=t.batchTableBinary,s=new Cm(n,i),a=s.getGlobalProperty("BATCH_LENGTH");this._batchLength=a;let c=s.getGlobalProperty("RTC_CENTER",Y.FLOAT,3);l(c)&&(this._transform=N.fromTranslation(h.fromArray(c))),this._batchTable={json:r,binary:o};let u=new Gf({typedArray:t.gltf,upAxis:this._upAxis,forwardAxis:this._forwardAxis,gltfResource:this._b3dmResource,baseResource:this._baseResource,releaseGltfJson:this._releaseGltfJson,incrementallyLoadTextures:this._incrementallyLoadTextures,loadAttributesAsTypedArray:this._loadAttributesAsTypedArray,loadAttributesFor2D:this._loadAttributesFor2D,enablePick:this._enablePick,loadIndicesForWireframe:this._loadIndicesForWireframe,loadPrimitiveOutline:this._loadPrimitiveOutline,loadForClassification:this._loadForClassification,renameBatchIdSemantic:!0});this._gltfLoader=u,this._state=BT.LOADING;let f=this;return this._promise=u.load().then(function(){if(!f.isDestroyed())return f._state=BT.PROCESSING,f}).catch(function(d){if(!f.isDestroyed())return Vot(f,d)}),this._promise}process(t){if(this._state===BT.READY)return!0;if(this._state!==BT.PROCESSING||!this._gltfLoader.process(t))return!1;let i=this._gltfLoader.components;return i.transform=N.multiplyTransformation(this._transform,i.transform,i.transform),jot(this,i),this._components=i,this._arrayBuffer=void 0,this._state=BT.READY,!0}unload(){l(this._gltfLoader)&&!this._gltfLoader.isDestroyed()&&this._gltfLoader.unload(),this._components=void 0,this._arrayBuffer=void 0}};function Vot(e,t){return e.unload(),e._state=BT.FAILED,t=e.getError("Failed to load b3dm",t),Promise.reject(t)}function jot(e,t){let n=e._batchTable,i=e._batchLength;if(i===0)return;let r;if(l(n.json))r=e_({count:i,batchTable:n.json,binaryBody:n.binary});else{let a=new ru({name:xm.BATCH_TABLE_CLASS_NAME,count:i});r=new Ha({schema:{},propertyTables:[a]})}let o=t.scene.nodes,s=o.length;for(let a=0;a<s;a++)Uxe(o[a]);t.structuralMetadata=r}function Uxe(e){let t=e.children.length;for(let i=0;i<t;i++)Uxe(e.children[i]);let n=e.primitives.length;for(let i=0;i<n;i++){let r=e.primitives[i],o=xt.getAttributeBySemantic(r,ct.FEATURE_ID);if(l(o)){o.setIndex=0;let s=new zot;s.propertyTableId=0,s.setIndex=0,s.positionalLabel="featureId_0",r.featureIds.push(s)}}}var KF=EZ;var CZ=class extends ir{constructor(t){super(),t=t??H.EMPTY_OBJECT,this._geoJson=t.geoJson,this._components=void 0}get cacheKey(){}get components(){return this._components}load(){return Promise.resolve(this)}process(t){return l(this._components)||(this._components=tst(this._geoJson,t),this._geoJson=void 0),!0}unload(){this._components=void 0}};function Hot(){this.lines=void 0,this.points=void 0,this.properties=void 0}function Got(){this.features=[]}function vZ(e){let t=e[0],n=e[1],i=e[2]??0;return new h(t,n,i)}function SZ(e){let t=e.length,n=new Array(t);for(let r=0;r<t;r++)n[r]=vZ(e[r]);return[n]}function Wot(e){let t=e.length,n=new Array(t);for(let i=0;i<t;i++)n[i]=SZ(e[i])[0];return n}function zxe(e){let t=e.length,n=new Array(t);for(let i=0;i<t;i++)n[i]=SZ(e[i])[0];return n}function qot(e){let t=e.length,n=[];for(let i=0;i<t;i++){let r=zxe(e[i]);Zn(n,r)}return n}function Yot(e){return[vZ(e)]}function Xot(e){let t=e.length,n=new Array(t);for(let i=0;i<t;i++)n[i]=vZ(e[i]);return n}var Kot={LineString:SZ,MultiLineString:Wot,MultiPolygon:qot,Polygon:zxe,MultiPoint:Xot,Point:Yot},$ot={LineString:Oe.LINES,MultiLineString:Oe.LINES,MultiPolygon:Oe.LINES,Polygon:Oe.LINES,MultiPoint:Oe.POINTS,Point:Oe.POINTS};function Vxe(e,t){if(!l(e.geometry))return;let n=e.geometry.type,i=Kot[n],r=$ot[n],o=e.geometry.coordinates;if(!l(i)||!l(o))return;let s=new Hot;r===Oe.LINES?s.lines=i(o):r===Oe.POINTS&&(s.points=i(o)),s.properties=e.properties,t.features.push(s)}function Jot(e,t){let n=e.features,i=n.length;for(let r=0;r<i;r++)Vxe(n[r],t)}var Zot={FeatureCollection:Jot,Feature:Vxe},jH=new h;function Qot(e,t,n){let i=0,r=0,o=e.length;for(let O=0;O<o;O++){let L=e[O];if(l(L.lines)){let _=L.lines.length;for(let C=0;C<_;C++){let w=L.lines[C];i+=w.length,r+=(w.length-1)*2}}}let s=new Float32Array(i*3),a=new Float32Array(i),c=je.createTypedArray(i,r),u=je.fromTypedArray(c),f=new h(Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY),d=new h(Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY),p=0,g=0;for(let O=0;O<o;O++){let L=e[O];if(!l(L.lines))continue;let _=L.lines.length;for(let C=0;C<_;C++){let w=L.lines[C],P=w.length;for(let M=0;M<P;M++){let F=w[M],V=h.fromDegrees(F.x,F.y,F.z,ee.WGS84,jH),B=N.multiplyByPoint(t,V,jH);h.minimumByComponent(f,B,f),h.maximumByComponent(d,B,d),h.pack(B,s,p*3),a[p]=O,M<P-1&&(c[g*2]=p,c[g*2+1]=p+1,g++),p++}}}let m=tt.createVertexBuffer({typedArray:s,context:n.context,usage:Me.STATIC_DRAW});m.vertexArrayDestroyable=!1;let y=tt.createVertexBuffer({typedArray:a,context:n.context,usage:Me.STATIC_DRAW});y.vertexArrayDestroyable=!1;let A=tt.createIndexBuffer({typedArray:c,context:n.context,usage:Me.STATIC_DRAW,indexDatatype:u});A.vertexArrayDestroyable=!1;let b=new Cn.Attribute;b.semantic=ct.POSITION,b.componentDatatype=Y.FLOAT,b.type=Vt.VEC3,b.count=i,b.min=f,b.max=d,b.buffer=m;let x=new Cn.Attribute;x.semantic=ct.FEATURE_ID,x.setIndex=0,x.componentDatatype=Y.FLOAT,x.type=Vt.SCALAR,x.count=i,x.buffer=y;let T=[b,x],E=new Cn.Material;E.unlit=!0;let v=new Cn.Indices;v.indexDatatype=u,v.count=c.length,v.buffer=A;let S=new Cn.FeatureIdAttribute;S.featureCount=o,S.propertyTableId=0,S.setIndex=0,S.positionalLabel="featureId_0";let I=[S],R=new Cn.Primitive;return R.attributes=T,R.indices=v,R.featureIds=I,R.primitiveType=Oe.LINES,R.material=E,R}function est(e,t,n){let i=0,r=e.length;for(let T=0;T<r;T++){let E=e[T];l(E.points)&&(i+=E.points.length)}let o=new Float32Array(i*3),s=new Float32Array(i),a=new h(Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY),c=new h(Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY),u=0;for(let T=0;T<r;T++){let E=e[T];if(!l(E.points))continue;let v=E.points.length;for(let S=0;S<v;S++){let I=E.points[S],R=h.fromDegrees(I.x,I.y,I.z,ee.WGS84,jH),O=N.multiplyByPoint(t,R,jH);h.minimumByComponent(a,O,a),h.maximumByComponent(c,O,c),h.pack(O,o,u*3),s[u]=T,u++}}let f=tt.createVertexBuffer({typedArray:o,context:n.context,usage:Me.STATIC_DRAW});f.vertexArrayDestroyable=!1;let d=tt.createVertexBuffer({typedArray:s,context:n.context,usage:Me.STATIC_DRAW});d.vertexArrayDestroyable=!1;let p=new Cn.Attribute;p.semantic=ct.POSITION,p.componentDatatype=Y.FLOAT,p.type=Vt.VEC3,p.count=i,p.min=a,p.max=c,p.buffer=f;let g=new Cn.Attribute;g.semantic=ct.FEATURE_ID,g.setIndex=0,g.componentDatatype=Y.FLOAT,g.type=Vt.SCALAR,g.count=i,g.buffer=d;let m=[p,g],y=new Cn.Material;y.unlit=!0;let A=new Cn.FeatureIdAttribute;A.featureCount=r,A.propertyTableId=0,A.setIndex=0,A.positionalLabel="featureId_0";let b=[A],x=new Cn.Primitive;return x.attributes=m,x.featureIds=b,x.primitiveType=Oe.POINTS,x.material=y,x}function tst(e,t){let n=new Got,i=Zot[e.type];l(i)&&i(e,n);let r=n.features,o=r.length;if(o===0)throw new oe("GeoJSON must have at least one feature");let s={};for(let O=0;O<o;O++){let _=r[O].properties??H.EMPTY_OBJECT;for(let C in _)_.hasOwnProperty(C)&&(l(s[C])||(s[C]=new Array(o)))}for(let O=0;O<o;O++){let L=r[O];for(let _ in s)if(s.hasOwnProperty(_)){let C=L.properties[_]??"";s[_][O]=C}}let a=new Yg({count:o,properties:s}),u=[new ru({id:0,count:o,jsonMetadataTable:a})],f=ou.fromJson({}),d=new Ha({schema:f,propertyTables:u}),p=new h(Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY),g=new h(Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY),m=!1,y=!1;for(let O=0;O<o;O++){let L=r[O];if(l(L.lines)){m=!0;let _=L.lines.length;for(let C=0;C<_;C++){let w=L.lines[C],P=w.length;for(let M=0;M<P;M++)h.minimumByComponent(p,w[M],p),h.maximumByComponent(g,w[M],g)}}if(l(L.points)){y=!0;let _=L.points.length;for(let C=0;C<_;C++){let w=L.points[C];h.minimumByComponent(p,w,p),h.maximumByComponent(g,w,g)}}}let A=h.midpoint(p,g,new h),b=h.fromDegrees(A.x,A.y,A.z,ee.WGS84,new h),x=At.eastNorthUpToFixedFrame(b,ee.WGS84,new N),T=N.inverseTransformation(x,new N),E=[];m&&E.push(Qot(r,T,t)),y&&E.push(est(r,T,t));let v=new Cn.Node;v.index=0,v.primitives=E;let S=[v],I=new Cn.Scene;I.nodes=S;let R=new Cn.Components;return R.scene=I,R.nodes=S,R.transform=x,R.structuralMetadata=d,R}var $F=CZ;var HH={};HH._deprecationWarning=qr;var TA=Uint32Array.BYTES_PER_ELEMENT;HH.parse=function(e,t){let n=t??0;t=n;let i=new Uint8Array(e),r=new DataView(e);t+=TA;let o=r.getUint32(t,!0);if(o!==1)throw new oe(`Only Instanced 3D Model version 1 is supported. Version ${o} is not.`);t+=TA;let s=r.getUint32(t,!0);t+=TA;let a=r.getUint32(t,!0);if(a===0)throw new oe("featureTableJsonByteLength is zero, the feature table must be defined.");t+=TA;let c=r.getUint32(t,!0);t+=TA;let u=r.getUint32(t,!0);t+=TA;let f=r.getUint32(t,!0);t+=TA;let d=r.getUint32(t,!0);if(d!==1&&d!==0)throw new oe(`Only glTF format 0 (uri) or 1 (embedded) are supported. Format ${d} is not.`);t+=TA;let p=No(i,t,a);t+=a;let g=new Uint8Array(e,t,c);t+=c;let m,y;u>0&&(m=No(i,t,u),t+=u,f>0&&(y=new Uint8Array(e,t,f),y=new Uint8Array(y),t+=f));let A=n+s-t;if(A===0)throw new oe("glTF byte length must be greater than 0.");let b;return t%4===0?b=new Uint8Array(e,t,A):(HH._deprecationWarning("i3dm-glb-unaligned","The embedded glb is not aligned to a 4-byte boundary."),b=new Uint8Array(i.subarray(t,t+A))),{gltfFormat:d,featureTableJson:p,featureTableBinary:g,batchTableJson:m,batchTableBinary:y,gltf:b}};var JF=HH;var t_={NOT_LOADED:0,LOADING:1,PROCESSING:2,POST_PROCESSING:3,READY:4,FAILED:5,UNLOADED:6},GH=Cn.Attribute,nst=Cn.FeatureIdAttribute,Hxe=Cn.Instances,wZ=class extends ir{constructor(t){super(),t=t??H.EMPTY_OBJECT;let n=t.i3dmResource,i=t.arrayBuffer,r=t.baseResource,o=t.byteOffset??0,s=t.releaseGltfJson??!1,a=t.asynchronous??!0,c=t.incrementallyLoadTextures??!0,u=t.upAxis??Hi.Y,f=t.forwardAxis??Hi.X,d=t.loadAttributesAsTypedArray??!1,p=t.loadIndicesForWireframe??!1,g=t.loadPrimitiveOutline??!0,m=t.enablePick??!1;r=l(r)?r:n.clone(),this._i3dmResource=n,this._baseResource=r,this._arrayBuffer=i,this._byteOffset=o,this._releaseGltfJson=s,this._asynchronous=a,this._incrementallyLoadTextures=c,this._upAxis=u,this._forwardAxis=f,this._loadAttributesAsTypedArray=d,this._loadIndicesForWireframe=p,this._loadPrimitiveOutline=g,this._enablePick=m,this._state=t_.NOT_LOADED,this._promise=void 0,this._gltfLoader=void 0,this._buffers=[],this._components=void 0,this._transform=N.IDENTITY,this._batchTable=void 0,this._featureTable=void 0,this._instancesLength=0}get texturesLoaded(){return this._gltfLoader?.texturesLoaded}get cacheKey(){}get components(){return this._components}load(){if(l(this._promise))return this._promise;let t=JF.parse(this._arrayBuffer,this._byteOffset),n=t.featureTableJson,i=t.featureTableBinary,r=t.batchTableJson,o=t.batchTableBinary,s=t.gltfFormat,a=new Cm(n,i);this._featureTable=a;let c=a.getGlobalProperty("INSTANCES_LENGTH");if(a.featuresLength=c,!l(c))throw new oe("Feature table global property: INSTANCES_LENGTH must be defined");this._instancesLength=c;let u=a.getGlobalProperty("RTC_CENTER",Y.FLOAT,3);l(u)&&(this._transform=N.fromTranslation(h.fromArray(u))),this._batchTable={json:r,binary:o};let f={upAxis:this._upAxis,forwardAxis:this._forwardAxis,releaseGltfJson:this._releaseGltfJson,incrementallyLoadTextures:this._incrementallyLoadTextures,loadAttributesAsTypedArray:this._loadAttributesAsTypedArray,enablePick:this._enablePick,loadIndicesForWireframe:this._loadIndicesForWireframe,loadPrimitiveOutline:this._loadPrimitiveOutline};if(s===0){let p=Gu(t.gltf);p=p.replace(/[\s\0]+$/,"");let g=this._baseResource.getDerivedResource({url:p});f.gltfResource=g,f.baseResource=g}else f.gltfResource=this._i3dmResource,f.typedArray=t.gltf;let d=new Gf(f);return this._gltfLoader=d,this._state=t_.LOADING,this._promise=d.load().then(()=>{if(!this.isDestroyed())return this._state=t_.PROCESSING,this}).catch(p=>{if(!this.isDestroyed())throw ist(this,p)}),this._promise}process(t){if(this._state===t_.READY)return!0;let n=this._gltfLoader,i=!1;if(this._state===t_.PROCESSING&&(i=n.process(t)),!i)return!1;let r=n.components;return r.transform=N.multiplyTransformation(this._transform,r.transform,r.transform),sst(this,r,t),rst(this,r),this._components=r,this._arrayBuffer=void 0,this._state=t_.READY,!0}isUnloaded(){return this._state===t_.UNLOADED}unload(){l(this._gltfLoader)&&!this._gltfLoader.isDestroyed()&&this._gltfLoader.unload(),fst(this),this._components=void 0,this._arrayBuffer=void 0,this._state=t_.UNLOADED}};function ist(e,t){return e.unload(),e._state=t_.FAILED,e.getError("Failed to load i3dm",t)}function rst(e,t){let n=e._batchTable,i=e._instancesLength;if(i===0)return;let r;if(l(n.json))r=e_({count:i,batchTable:n.json,binaryBody:n.binary});else{let o=new ru({name:xm.BATCH_TABLE_CLASS_NAME,count:i});r=new Ha({schema:{},propertyTables:[o]})}t.structuralMetadata=r}var WH=new h,IZ=new Array(4),ost=new N;function sst(e,t,n){let i,r=e._featureTable,o=e._instancesLength;if(o===0)return;let s=r.getGlobalProperty("RTC_CENTER",Y.FLOAT,3),a=r.getGlobalProperty("EAST_NORTH_UP"),c=r.hasProperty("NORMAL_UP")||r.hasProperty("NORMAL_UP_OCT32P")||a,u=r.hasProperty("SCALE")||r.hasProperty("SCALE_NON_UNIFORM"),f=cst(r,o),d;c&&(d=new Float32Array(4*o));let p;u&&(p=new Float32Array(3*o));let g=new Float32Array(o),m=h.unpackArray(f),y,A=new h,b=new h,x=new h,T=new $,E=new Le,v=new Array(4),S=new h,I=new Array(3),R=new N;if(!l(s)||h.equals(h.unpack(s),h.ZERO)){let B=ue.fromPoints(m);for(i=0;i<m.length;i++)h.subtract(m[i],B.center,WH),f[3*i+0]=WH.x,f[3*i+1]=WH.y,f[3*i+2]=WH.z;let j=N.fromTranslation(B.center,ost);t.transform=N.multiplyTransformation(j,t.transform,t.transform)}for(i=0;i<o;i++){y=h.clone(m[i]),l(s)&&h.add(y,h.unpack(s),y),c&&(lst(r,a,i,E,y,b,A,x,T,R),Le.pack(E,v,0),d[4*i+0]=v[0],d[4*i+1]=v[1],d[4*i+2]=v[2],d[4*i+3]=v[3]),u&&(ust(r,i,S),h.pack(S,I,0),p[3*i+0]=I[0],p[3*i+1]=I[1],p[3*i+2]=I[2]);let B=r.getProperty("BATCH_ID",Y.UNSIGNED_SHORT,1,i);l(B)||(B=i),g[i]=B}let O=new Hxe;O.transformInWorldSpace=!0;let L=e._buffers,_=new GH;if(_.name="Instance Translation",_.semantic=Lo.TRANSLATION,_.componentDatatype=Y.FLOAT,_.type=Vt.VEC3,_.count=o,_.typedArray=f,!c){let B=tt.createVertexBuffer({context:n.context,typedArray:f,usage:Me.STATIC_DRAW});B.vertexArrayDestroyable=!1,L.push(B),_.buffer=B}if(O.attributes.push(_),c){let B=new GH;B.name="Instance Rotation",B.semantic=Lo.ROTATION,B.componentDatatype=Y.FLOAT,B.type=Vt.VEC4,B.count=o,B.typedArray=d,O.attributes.push(B)}if(u){let B=new GH;if(B.name="Instance Scale",B.semantic=Lo.SCALE,B.componentDatatype=Y.FLOAT,B.type=Vt.VEC3,B.count=o,c)B.typedArray=p;else{let j=tt.createVertexBuffer({context:n.context,typedArray:p,usage:Me.STATIC_DRAW});j.vertexArrayDestroyable=!1,L.push(j),B.buffer=j}O.attributes.push(B)}let C=new GH;C.name="Instance Feature ID",C.setIndex=0,C.semantic=Lo.FEATURE_ID,C.componentDatatype=Y.FLOAT,C.type=Vt.SCALAR,C.count=o;let w=tt.createVertexBuffer({context:n.context,typedArray:g,usage:Me.STATIC_DRAW});w.vertexArrayDestroyable=!1,L.push(w),C.buffer=w,O.attributes.push(C);let P=new nst;P.propertyTableId=0,P.setIndex=0,P.positionalLabel="instanceFeatureId_0",O.featureIds.push(P);let M=t.nodes,F=M.length,V=!1;for(i=0;i<F;i++){let B=M[i];B.primitives.length>0&&(B.instances=V?ast(O):O,V=!0)}}function ast(e){let t=new Hxe;t.transformInWorldSpace=e.transformInWorldSpace;let n=e.attributes,i=n.length;for(let r=0;r<i;r++){let o=Je(n[r],!1);t.attributes.push(o)}return t.featureIds=e.featureIds,t}function cst(e,t){if(e.hasProperty("POSITION"))return e.getPropertyArray("POSITION",Y.FLOAT,3);if(e.hasProperty("POSITION_QUANTIZED")){let n=e.getPropertyArray("POSITION_QUANTIZED",Y.UNSIGNED_SHORT,3),i=e.getGlobalProperty("QUANTIZED_VOLUME_OFFSET",Y.FLOAT,3);if(!l(i))throw new oe("Global property: QUANTIZED_VOLUME_OFFSET must be defined for quantized positions.");let r=e.getGlobalProperty("QUANTIZED_VOLUME_SCALE",Y.FLOAT,3);if(!l(r))throw new oe("Global property: QUANTIZED_VOLUME_SCALE must be defined for quantized positions.");let o=new Float32Array(n.length);for(let s=0;s<n.length/3;s++)for(let a=0;a<3;a++){let c=3*s+a;o[c]=n[c]/65535*r[a]+i[a]}return o}else throw new oe("Either POSITION or POSITION_QUANTIZED must be defined for each instance.")}var jxe=new Array(4);function lst(e,t,n,i,r,o,s,a,c,u){let f=e.getProperty("NORMAL_UP",Y.FLOAT,3,n,IZ),d=e.getProperty("NORMAL_RIGHT",Y.FLOAT,3,n,jxe),p=!1;if(l(f)){if(!l(d))throw new oe("To define a custom orientation, both NORMAL_UP and NORMAL_RIGHT must be defined.");h.unpack(f,0,o),h.unpack(d,0,s),p=!0}else{let g=e.getProperty("NORMAL_UP_OCT32P",Y.UNSIGNED_SHORT,2,n,IZ),m=e.getProperty("NORMAL_RIGHT_OCT32P",Y.UNSIGNED_SHORT,2,n,jxe);if(l(g)){if(!l(m))throw new oe("To define a custom orientation with oct-encoded vectors, both NORMAL_UP_OCT32P and NORMAL_RIGHT_OCT32P must be defined.");cn.octDecodeInRange(g[0],g[1],65535,o),cn.octDecodeInRange(m[0],m[1],65535,s),p=!0}else t?(At.eastNorthUpToFixedFrame(r,ee.WGS84,u),N.getMatrix3(u,c)):$.clone($.IDENTITY,c)}p&&(h.cross(s,o,a),h.normalize(a,a),$.setColumn(c,0,s,c),$.setColumn(c,1,o,c),$.setColumn(c,2,a,c)),Le.fromRotationMatrix(c,i)}function ust(e,t,n){n=h.fromElements(1,1,1,n);let i=e.getProperty("SCALE",Y.FLOAT,1,t);l(i)&&h.multiplyByScalar(n,i,n);let r=e.getProperty("SCALE_NON_UNIFORM",Y.FLOAT,3,t,IZ);l(r)&&(n.x*=r[0],n.y*=r[1],n.z*=r[2])}function fst(e){let t=e._buffers,n=t.length;for(let i=0;i<n;i++){let r=t[i];r.isDestroyed()||r.destroy()}t.length=0}var ZF=wZ;var Gxe={NONE:0,REPEAT:1,MIRRORED_REPEAT:2};Object.freeze(Gxe);var Yu=Gxe;var Wxe={STOPPED:0,ANIMATING:1};Object.freeze(Wxe);var Sm=Wxe;function iw(){this.times=void 0,this.points=void 0,pe.throwInstantiationError()}iw.getPointType=function(e){if(typeof e=="number")return Number;if(e instanceof h)return h;if(e instanceof Le)return Le};iw.prototype.evaluate=pe.throwInstantiationError;iw.prototype.findTimeInterval=function(e,t){let n=this.times,i=n.length;if(t=t??0,e>=n[t]){if(t+1<i&&e<n[t+1])return t;if(t+2<i&&e<n[t+2])return t+1}else if(t-1>=0&&e>=n[t-1])return t-1;let r;if(e>n[t])for(r=t;r<i-1&&!(e>=n[r]&&e<n[r+1]);++r);else for(r=t-1;r>=0&&!(e>=n[r]&&e<n[r+1]);--r);return r===i-1&&(r=i-2),r};iw.prototype.wrapTime=function(e){let t=this.times,n=t[t.length-1],i=t[0],r=n-i,o;return e<i&&(o=Math.floor((i-e)/r)+1,e+=o*r),e>n&&(o=Math.floor((e-n)/r)+1,e-=o*r),e};iw.prototype.clampTime=function(e){let t=this.times;return D.clamp(e,t[0],t[t.length-1])};var Dr=iw;function rw(e){this._value=e,this._valueType=Dr.getPointType(e)}Object.defineProperties(rw.prototype,{value:{get:function(){return this._value}}});rw.prototype.findTimeInterval=function(e){};rw.prototype.wrapTime=function(e){return 0};rw.prototype.clampTime=function(e){return 0};rw.prototype.evaluate=function(e,t){let n=this._value,i=this._valueType;return i===Number?n:i.clone(n,t)};var QF=rw;function ow(e){e=e??H.EMPTY_OBJECT;let t=e.points,n=e.times;this._times=n,this._points=t,this._pointType=Dr.getPointType(t[0]),this._lastTimeIndex=0}Object.defineProperties(ow.prototype,{times:{get:function(){return this._times}},points:{get:function(){return this._points}}});ow.prototype.findTimeInterval=Dr.prototype.findTimeInterval;ow.prototype.wrapTime=Dr.prototype.wrapTime;ow.prototype.clampTime=Dr.prototype.clampTime;ow.prototype.evaluate=function(e,t){let n=this.points,i=this.times,r=this._lastTimeIndex=this.findTimeInterval(e,this._lastTimeIndex),o=(e-i[r])/(i[r+1]-i[r]);return this._pointType===Number?(1-o)*n[r]+o*n[r+1]:(l(t)||(t=new h),h.lerp(n[r],n[r+1],o,t))};var EA=ow;var qxe={};qxe.solve=function(e,t,n,i){let r=new Array(n.length),o=new Array(i.length),s=new Array(i.length),a;for(a=0;a<o.length;a++)o[a]=new h,s[a]=new h;r[0]=n[0]/t[0],o[0]=h.multiplyByScalar(i[0],1/t[0],o[0]);let c;for(a=1;a<r.length;++a)c=1/(t[a]-r[a-1]*e[a-1]),r[a]=n[a]*c,o[a]=h.subtract(i[a],h.multiplyByScalar(o[a-1],e[a-1],o[a]),o[a]),o[a]=h.multiplyByScalar(o[a],c,o[a]);for(c=1/(t[a]-r[a-1]*e[a-1]),o[a]=h.subtract(i[a],h.multiplyByScalar(o[a-1],e[a-1],o[a]),o[a]),o[a]=h.multiplyByScalar(o[a],c,o[a]),s[s.length-1]=o[o.length-1],a=s.length-2;a>=0;--a)s[a]=h.subtract(o[a],h.multiplyByScalar(s[a+1],r[a],s[a]),s[a]);return s};var sw=qxe;var Yxe=[],Xxe=[],Kxe=[],$xe=[];function dst(e,t,n){let i=Yxe,r=Kxe,o=Xxe,s=$xe;i.length=r.length=e.length-1,o.length=s.length=e.length;let a;i[0]=o[0]=1,r[0]=0;let c=s[0];for(l(c)||(c=s[0]=new h),h.clone(t,c),a=1;a<i.length-1;++a)i[a]=r[a]=1,o[a]=4,c=s[a],l(c)||(c=s[a]=new h),h.subtract(e[a+1],e[a-1],c),h.multiplyByScalar(c,3,c);return i[a]=0,r[a]=1,o[a]=4,c=s[a],l(c)||(c=s[a]=new h),h.subtract(e[a+1],e[a-1],c),h.multiplyByScalar(c,3,c),o[a+1]=1,c=s[a+1],l(c)||(c=s[a+1]=new h),h.clone(n,c),sw.solve(i,o,r,s)}function hst(e){let t=Yxe,n=Kxe,i=Xxe,r=$xe;t.length=n.length=e.length-1,i.length=r.length=e.length;let o;t[0]=n[0]=1,i[0]=2;let s=r[0];for(l(s)||(s=r[0]=new h),h.subtract(e[1],e[0],s),h.multiplyByScalar(s,3,s),o=1;o<t.length;++o)t[o]=n[o]=1,i[o]=4,s=r[o],l(s)||(s=r[o]=new h),h.subtract(e[o+1],e[o-1],s),h.multiplyByScalar(s,3,s);return i[o]=2,s=r[o],l(s)||(s=r[o]=new h),h.subtract(e[o],e[o-1],s),h.multiplyByScalar(s,3,s),sw.solve(t,i,n,r)}function Xu(e){e=e??H.EMPTY_OBJECT;let t=e.points,n=e.times,i=e.inTangents,r=e.outTangents;this._times=n,this._points=t,this._pointType=Dr.getPointType(t[0]),this._inTangents=i,this._outTangents=r,this._lastTimeIndex=0}Object.defineProperties(Xu.prototype,{times:{get:function(){return this._times}},points:{get:function(){return this._points}},inTangents:{get:function(){return this._inTangents}},outTangents:{get:function(){return this._outTangents}}});Xu.createC1=function(e){e=e??H.EMPTY_OBJECT;let t=e.times,n=e.points,i=e.tangents,r=i.slice(0,i.length-1),o=i.slice(1,i.length);return new Xu({times:t,points:n,inTangents:o,outTangents:r})};Xu.createNaturalCubic=function(e){e=e??H.EMPTY_OBJECT;let t=e.times,n=e.points;if(n.length<3)return new EA({points:n,times:t});let i=hst(n),r=i.slice(0,i.length-1),o=i.slice(1,i.length);return new Xu({times:t,points:n,inTangents:o,outTangents:r})};Xu.createClampedCubic=function(e){e=e??H.EMPTY_OBJECT;let t=e.times,n=e.points,i=e.firstTangent,r=e.lastTangent,o=Dr.getPointType(n[0]);if(n.length<3)return new EA({points:n,times:t});let s=dst(n,i,r),a=s.slice(0,s.length-1),c=s.slice(1,s.length);return new Xu({times:t,points:n,inTangents:c,outTangents:a})};Xu.hermiteCoefficientMatrix=new N(2,-3,0,1,-2,3,0,0,1,-2,1,0,1,-1,0,0);Xu.prototype.findTimeInterval=Dr.prototype.findTimeInterval;var mst=new se,aw=new h;Xu.prototype.wrapTime=Dr.prototype.wrapTime;Xu.prototype.clampTime=Dr.prototype.clampTime;Xu.prototype.evaluate=function(e,t){let n=this.points,i=this.times,r=this.inTangents,o=this.outTangents;this._lastTimeIndex=this.findTimeInterval(e,this._lastTimeIndex);let s=this._lastTimeIndex,a=i[s+1]-i[s],c=(e-i[s])/a,u=mst;u.z=c,u.y=c*c,u.x=u.y*c,u.w=1;let f=N.multiplyByVector(Xu.hermiteCoefficientMatrix,u,u);f.z*=a,f.w*=a;let d=this._pointType;return d===Number?n[s]*f.x+n[s+1]*f.y+o[s]*f.z+r[s]*f.w:(l(t)||(t=new d),t=d.multiplyByScalar(n[s],f.x,t),d.multiplyByScalar(n[s+1],f.y,aw),d.add(t,aw,t),d.multiplyByScalar(o[s],f.z,aw),d.add(t,aw,t),d.multiplyByScalar(r[s],f.w,aw),d.add(t,aw,t))};var CA=Xu;function cw(e){e=e??H.EMPTY_OBJECT;let t=e.points,n=e.times;this._times=n,this._points=t,this._pointType=Dr.getPointType(t[0]),this._lastTimeIndex=0}Object.defineProperties(cw.prototype,{times:{get:function(){return this._times}},points:{get:function(){return this._points}}});cw.prototype.findTimeInterval=Dr.prototype.findTimeInterval;cw.prototype.wrapTime=Dr.prototype.wrapTime;cw.prototype.clampTime=Dr.prototype.clampTime;cw.prototype.evaluate=function(e,t){let n=this.points;this._lastTimeIndex=this.findTimeInterval(e,this._lastTimeIndex);let i=this._lastTimeIndex,r=this._pointType;return r===Number?n[i]:(l(t)||(t=new r),r.clone(n[i],t))};var eB=cw;function pst(e){let t=e.points,n=e.times;return function(i,r){l(r)||(r=new Le);let o=e._lastTimeIndex=e.findTimeInterval(i,e._lastTimeIndex),s=(i-n[o])/(n[o+1]-n[o]),a=t[o],c=t[o+1];return Le.fastSlerp(a,c,s,r)}}function lw(e){e=e??H.EMPTY_OBJECT;let t=e.points,n=e.times;this._times=n,this._points=t,this._evaluateFunction=pst(this),this._lastTimeIndex=0}Object.defineProperties(lw.prototype,{times:{get:function(){return this._times}},points:{get:function(){return this._points}}});lw.prototype.findTimeInterval=Dr.prototype.findTimeInterval;lw.prototype.wrapTime=Dr.prototype.wrapTime;lw.prototype.clampTime=Dr.prototype.clampTime;lw.prototype.evaluate=function(e,t){return this._evaluateFunction(e,t)};var tB=lw;var uw=Cn.AnimatedPropertyType;function PZ(e){e=e??H.EMPTY_OBJECT;let t=e.channel,n=e.runtimeAnimation,i=e.runtimeNode;this._channel=t,this._runtimeAnimation=n,this._runtimeNode=i,this._splines=[],this._path=void 0,bst(this)}Object.defineProperties(PZ.prototype,{channel:{get:function(){return this._channel}},runtimeAnimation:{get:function(){return this._runtimeAnimation}},runtimeNode:{get:function(){return this._runtimeNode}},splines:{get:function(){return this._splines}}});function gst(e,t){let n=[],i=[],r=[],o=t.length;for(let s=0;s<o;s+=3)i.push(t[s]),n.push(t[s+1]),r.push(t[s+2]);return i.splice(0,1),r.length=r.length-1,new CA({times:e,points:n,inTangents:i,outTangents:r})}function Jxe(e,t,n,i){if(e.length===1&&t.length===1)return new QF(t[0]);switch(n){case ym.STEP:return new eB({times:e,points:t});case ym.CUBICSPLINE:return gst(e,t);case ym.LINEAR:return i===uw.ROTATION?new tB({times:e,points:t}):new EA({times:e,points:t})}}function _st(e,t,n,i,r){let o=[];if(i===uw.WEIGHTS){let a=t.length/r,c,u;for(c=0;c<r;c++){let f=new Array(a),d=c;if(n===ym.CUBICSPLINE)for(u=0;u<a;u+=3)f[u]=t[d],f[u+1]=t[d+r],f[u+2]=t[d+2*r],d+=r*3;else for(u=0;u<a;u++)f[u]=t[d],d+=r;o.push(Jxe(e,f,n,i))}}else o.push(Jxe(e,t,n,i));return o}var yst=new h,Ast=new Le;function bst(e){let t=e._channel,n=t.sampler,i=n.input,r=n.output,o=n.interpolation,a=t.target.path,c=e._runtimeNode,u=l(c.morphWeights)?c.morphWeights.length:1,f=_st(i,r,o,a,u);e._splines=f,e._path=a}PZ.prototype.animate=function(e){let t=this._splines,n=this._path,i=this._runtimeAnimation.model,r=this._runtimeNode;if(n===uw.WEIGHTS){let o=r.morphWeights,s=o.length;for(let a=0;a<s;a++){let c=t[a],u=i.clampAnimations?c.clampTime(e):c.wrapTime(e);o[a]=c.evaluate(u)}}else{if(r.userAnimated)return;{let o=t[0],s=i.clampAnimations?o.clampTime(e):o.wrapTime(e);n===uw.TRANSLATION||n===uw.SCALE?r[n]=o.evaluate(s,yst):n===uw.ROTATION&&(r[n]=o.evaluate(s,Ast))}}};var nB=PZ;function DZ(e,t,n){this._animation=t,this._name=t.name,this._runtimeChannels=void 0,this._startTime=K.clone(n.startTime),this._delay=n.delay??0,this._stopTime=K.clone(n.stopTime),this.removeOnStop=n.removeOnStop??!1,this._multiplier=n.multiplier??1,this._reverse=n.reverse??!1,this._loop=n.loop??Yu.NONE,this._startOffset=n.startOffset??0,this._animationTime=n.animationTime,this._prevAnimationDelta=void 0,this.start=new be,this.update=new be,this.stop=new be,this._state=Sm.STOPPED,this._computedStartTime=void 0,this._duration=void 0;let i=this;this._raiseStartEvent=function(){i.start.raiseEvent(e,i)},this._updateEventTime=0,this._raiseUpdateEvent=function(){i.update.raiseEvent(e,i,i._updateEventTime)},this._raiseStopEvent=function(){i.stop.raiseEvent(e,i)},this._model=e,this._localStartTime=void 0,this._localStopTime=void 0,xst(this)}Object.defineProperties(DZ.prototype,{animation:{get:function(){return this._animation}},name:{get:function(){return this._name}},runtimeChannels:{get:function(){return this._runtimeChannels}},model:{get:function(){return this._model}},localStartTime:{get:function(){return this._localStartTime}},localStopTime:{get:function(){return this._localStopTime}},startTime:{get:function(){return this._startTime}},delay:{get:function(){return this._delay}},stopTime:{get:function(){return this._stopTime}},multiplier:{get:function(){return this._multiplier}},reverse:{get:function(){return this._reverse}},loop:{get:function(){return this._loop}},startOffset:{get:function(){return this._startOffset}},animationTime:{get:function(){return this._animationTime}}});function xst(e){let t=Number.MAX_VALUE,n=-Number.MAX_VALUE,i=e._model.sceneGraph,o=e._animation.channels,s=o.length,a=[];for(let c=0;c<s;c++){let u=o[c],f=u.target;if(!l(f))continue;let d=f.node.index,p=i._runtimeNodes[d],g=new nB({channel:u,runtimeAnimation:e,runtimeNode:p}),m=u.sampler.input;t=Math.min(t,m[0]),n=Math.max(n,m[m.length-1]),a.push(g)}e._runtimeChannels=a,e._localStartTime=t,e._localStopTime=n}DZ.prototype.animate=function(e){let t=this._runtimeChannels,n=t.length;for(let i=0;i<n;i++)t[i].animate(e)};var iB=DZ;function n_(e){this.animationAdded=new be,this.animationRemoved=new be,this.animateWhilePaused=!1,this._model=e,this._runtimeAnimations=[],this._previousTime=void 0}Object.defineProperties(n_.prototype,{length:{get:function(){return this._runtimeAnimations.length}},model:{get:function(){return this._model}}});function RZ(e,t,n){let i=e._model,r=new iB(i,t,n);return e._runtimeAnimations.push(r),e.animationAdded.raiseEvent(i,r),r}n_.prototype.add=function(e){e=e??H.EMPTY_OBJECT;let n=this._model.sceneGraph.components.animations,i=e.index;if(l(i))return RZ(this,n[i],e);let r=n.length;for(let o=0;o<r;++o)if(n[o].name===e.name){i=o;break}return RZ(this,n[i],e)};n_.prototype.addAll=function(e){e=e??H.EMPTY_OBJECT;let n=this._model.sceneGraph.components.animations,i=[],r=n.length;for(let o=0;o<r;++o){let s=RZ(this,n[o],e);i.push(s)}return i};n_.prototype.remove=function(e){if(!l(e))return!1;let t=this._runtimeAnimations,n=t.indexOf(e);return n!==-1?(t.splice(n,1),this.animationRemoved.raiseEvent(this._model,e),!0):!1};n_.prototype.removeAll=function(){let e=this._model,t=this._runtimeAnimations,n=t.length;this._runtimeAnimations.length=0;for(let i=0;i<n;++i)this.animationRemoved.raiseEvent(e,t[i])};n_.prototype.contains=function(e){return l(e)?this._runtimeAnimations.indexOf(e)!==-1:!1};n_.prototype.get=function(e){return this._runtimeAnimations[e]};var qH=[];function Tst(e,t,n){return function(){e.animationRemoved.raiseEvent(t,n)}}n_.prototype.update=function(e){let t=this._runtimeAnimations,n=t.length;if(n===0)return this._previousTime=void 0,!1;if(!this.animateWhilePaused&&K.equals(e.time,this._previousTime))return!1;this._previousTime=K.clone(e.time,this._previousTime);let i=!1,r=e.time,o=this._model;for(let s=0;s<n;++s){let a=t[s];l(a._computedStartTime)||(a._computedStartTime=K.addSeconds(a.startTime??r,a.delay,new K)),l(a._duration)||(a._duration=a.localStopTime*(1/a.multiplier));let c=a._computedStartTime,u=a._duration,f=a.stopTime,d=K.lessThanOrEquals(c,r),p=l(f)&&K.greaterThan(r,f),g=0;if(u!==0){let A=K.secondsDifference(p?f:r,c);g=l(a._animationTime)?a._animationTime(u,A):A/u}let m=a.loop===Yu.REPEAT||a.loop===Yu.MIRRORED_REPEAT,y=(d||m&&!l(a.startTime))&&(g<=1||m)&&!p;if(g===a._prevAnimationDelta){let A=a._state===Sm.STOPPED;if(y!==A)continue}if(a._prevAnimationDelta=g,y||a._state===Sm.ANIMATING){if(y&&a._state===Sm.STOPPED&&(a._state=Sm.ANIMATING,a.start.numberOfListeners>0&&e.afterRender.push(a._raiseStartEvent)),a.loop===Yu.REPEAT)g=g-Math.floor(g);else if(a.loop===Yu.MIRRORED_REPEAT){let x=Math.floor(g),T=g-x;g=x%2===1?1-T:T}let A=a.startOffset;a.reverse&&(g=1-g,A=-A);let b=g*u*a.multiplier+A;b=D.clamp(b,a.localStartTime,a.localStopTime),a.animate(b),a.update.numberOfListeners>0&&(a._updateEventTime=b,e.afterRender.push(a._raiseUpdateEvent)),i=!0,y||(a._state=Sm.STOPPED,a.stop.numberOfListeners>0&&e.afterRender.push(a._raiseStopEvent),a.removeOnStop&&qH.push(a))}}n=qH.length;for(let s=0;s<n;++s){let a=qH[s];t.splice(t.indexOf(a),1),e.afterRender.push(Tst(this,o,a))}return qH.length=0,i};var rB=n_;var OZ=class e{constructor(t,n){this._content=t,this._batchId=n,this._color=void 0}get show(){return this._content.batchTable.getShow(this._batchId)}set show(t){this._content.batchTable.setShow(this._batchId,t)}get color(){return l(this._color)||(this._color=new z),this._content.batchTable.getColor(this._batchId,this._color)}set color(t){this._content.batchTable.setColor(this._batchId,t)}get polylinePositions(){if(l(this._content.getPolylinePositions))return this._content.getPolylinePositions(this._batchId)}get content(){return this._content}get tileset(){return this._content.tileset}get primitive(){return this._content.tileset}get featureId(){return this._batchId}get pickId(){return this._content.batchTable.getPickColor(this._batchId)}hasProperty(t){return this._content.batchTable.hasProperty(this._batchId,t)}getPropertyIds(t){return this._content.batchTable.getPropertyIds(this._batchId,t)}getProperty(t){return this._content.batchTable.getProperty(this._batchId,t)}static getPropertyInherited(t,n,i,r=t.batchTable){if(l(r)){if(r.hasPropertyBySemantic(n,i))return r.getPropertyBySemantic(n,i);if(r.hasProperty(n,i))return r.getProperty(n,i)}let o=t.metadata;if(l(o)){if(o.hasPropertyBySemantic(i))return o.getPropertyBySemantic(i);if(o.hasProperty(i))return o.getProperty(i)}let s=t.tile,a=s.metadata;if(l(a)){if(a.hasPropertyBySemantic(i))return a.getPropertyBySemantic(i);if(a.hasProperty(i))return a.getProperty(i)}let c;if(l(s.implicitSubtree)&&(c=s.implicitSubtree.metadata),l(c)){if(c.hasPropertyBySemantic(i))return c.getPropertyBySemantic(i);if(c.hasProperty(i))return c.getProperty(i)}let u=l(t.group)?t.group.metadata:void 0;if(l(u)){if(u.hasPropertyBySemantic(i))return u.getPropertyBySemantic(i);if(u.hasProperty(i))return u.getProperty(i)}let f=t.tileset.metadata;if(l(f)){if(f.hasPropertyBySemantic(i))return f.getPropertyBySemantic(i);if(f.hasProperty(i))return f.getProperty(i)}}getPropertyInherited(t){return e.getPropertyInherited(this._content,this._batchId,t)}setProperty(t,n){this._content.batchTable.setProperty(this._batchId,t,n),this._content.featurePropertiesDirty=!0}isExactClass(t){return this._content.batchTable.isExactClass(this._batchId,t)}isClass(t){return this._content.batchTable.isClass(this._batchId,t)}getExactClassName(){return this._content.batchTable.getExactClassName(this._batchId)}},oa=OZ;function kT(e){this._model=e.model,this._featureTable=e.featureTable,this._featureId=e.featureId,this._color=void 0}Object.defineProperties(kT.prototype,{show:{get:function(){return this._featureTable.getShow(this._featureId)},set:function(e){this._featureTable.setShow(this._featureId,e)}},color:{get:function(){return l(this._color)||(this._color=new z),this._featureTable.getColor(this._featureId,this._color)},set:function(e){this._featureTable.setColor(this._featureId,e)}},primitive:{get:function(){return this._model}},featureTable:{get:function(){return this._featureTable}},featureId:{get:function(){return this._featureId}}});kT.prototype.hasProperty=function(e){return this._featureTable.hasProperty(this._featureId,e)};kT.prototype.getProperty=function(e){return this._featureTable.getProperty(this._featureId,e)};kT.prototype.getPropertyInherited=function(e){return this._featureTable.hasPropertyBySemantic(this._featureId,e)?this._featureTable.getPropertyBySemantic(this._featureId,e):this._featureTable.getProperty(this._featureId,e)};kT.prototype.getPropertyIds=function(e){return this._featureTable.getPropertyIds(e)};kT.prototype.setProperty=function(e,t){return this._featureTable.setProperty(this._featureId,e,t)};var oB=kT;var fw={ALL_OPAQUE:0,ALL_TRANSLUCENT:1,OPAQUE_AND_TRANSLUCENT:2};fw.getStyleCommandsNeeded=function(e,t){return t===0?fw.ALL_OPAQUE:t===e?fw.ALL_TRANSLUCENT:fw.OPAQUE_AND_TRANSLUCENT};Object.freeze(fw);var wm=fw;var i_={GLTF:"GLTF",TILE_GLTF:"TILE_GLTF",TILE_B3DM:"B3DM",TILE_I3DM:"I3DM",TILE_PNTS:"PNTS",TILE_GEOJSON:"TILE_GEOJSON"};i_.is3DTiles=function(e){switch(e){case i_.TILE_GLTF:case i_.TILE_B3DM:case i_.TILE_I3DM:case i_.TILE_PNTS:case i_.TILE_GEOJSON:return!0;case i_.GLTF:return!1}};Object.freeze(i_);var qo=i_;function Ss(e){let t=e.model,n=e.propertyTable;this._propertyTable=n,this._model=t,this._features=void 0,this._featuresLength=0,this._batchTexture=void 0,this._styleCommandsNeededDirty=!1,this._styleCommandsNeeded=wm.ALL_OPAQUE,Est(this)}Object.defineProperties(Ss.prototype,{batchTexture:{get:function(){return this._batchTexture}},featuresLength:{get:function(){return this._featuresLength}},batchTextureByteLength:{get:function(){return l(this._batchTexture)?this._batchTexture.byteLength:0}},styleCommandsNeededDirty:{get:function(){return this._styleCommandsNeededDirty}}});function Est(e){let t=e._model,n=qo.is3DTiles(t.type),i=e._propertyTable.count;if(i===0)return;let r,o=new Array(i);if(n){let s=t.content;for(r=0;r<i;r++)o[r]=new oa(s,r)}else for(r=0;r<i;r++)o[r]=new oB({model:t,featureId:r,featureTable:e});e._features=o,e._featuresLength=i,e._batchTexture=new cu({featuresLength:i,owner:e,statistics:n?t.content.tileset.statistics:void 0})}Ss.prototype.update=function(e){this._styleCommandsNeededDirty=!1,this._batchTexture.update(void 0,e);let t=wm.getStyleCommandsNeeded(this._featuresLength,this._batchTexture.translucentFeaturesLength);this._styleCommandsNeeded!==t&&(this._styleCommandsNeededDirty=!0,this._styleCommandsNeeded=t)};Ss.prototype.setShow=function(e,t){this._batchTexture.setShow(e,t)};Ss.prototype.setAllShow=function(e){this._batchTexture.setAllShow(e)};Ss.prototype.getShow=function(e){return this._batchTexture.getShow(e)};Ss.prototype.setColor=function(e,t){this._batchTexture.setColor(e,t)};Ss.prototype.setAllColor=function(e){this._batchTexture.setAllColor(e)};Ss.prototype.getColor=function(e,t){return this._batchTexture.getColor(e,t)};Ss.prototype.getPickColor=function(e){return this._batchTexture.getPickColor(e)};Ss.prototype.getFeature=function(e){return this._features[e]};Ss.prototype.hasProperty=function(e,t){return this._propertyTable.hasProperty(e,t)};Ss.prototype.hasPropertyBySemantic=function(e,t){return this._propertyTable.hasPropertyBySemantic(e,t)};Ss.prototype.getProperty=function(e,t){return this._propertyTable.getProperty(e,t)};Ss.prototype.getPropertyBySemantic=function(e,t){return this._propertyTable.getPropertyBySemantic(e,t)};Ss.prototype.getPropertyIds=function(e){return this._propertyTable.getPropertyIds(e)};Ss.prototype.setProperty=function(e,t,n){return this._propertyTable.setProperty(e,t,n)};Ss.prototype.isClass=function(e,t){return this._propertyTable.isClass(e,t)};Ss.prototype.isExactClass=function(e,t){return this._propertyTable.isExactClass(e,t)};Ss.prototype.getExactClassName=function(e){return this._propertyTable.getExactClassName(e)};var Cst=new z;Ss.prototype.applyStyle=function(e){if(!l(e)){this.setAllColor(cu.DEFAULT_COLOR_VALUE),this.setAllShow(cu.DEFAULT_SHOW_VALUE);return}for(let t=0;t<this._featuresLength;t++){let n=this.getFeature(t),i=l(e.color)?e.color.evaluateColor(n,Cst)??cu.DEFAULT_COLOR_VALUE:cu.DEFAULT_COLOR_VALUE,r=l(e.show)?e.show.evaluate(n)??cu.DEFAULT_SHOW_VALUE:cu.DEFAULT_SHOW_VALUE;this.setColor(t,i),this.setShow(t,r)}};Ss.prototype.isDestroyed=function(){return!1};Ss.prototype.destroy=function(e){this._batchTexture=this._batchTexture&&this._batchTexture.destroy(),le(this)};var sB=Ss;var Zxe={name:"TilesetPipelineStage"};Zxe.process=function(e,t,n){if(t.hasSkipLevelOfDetail(n)){e.shaderBuilder.addDefine("POLYGON_OFFSET",void 0,de.FRAGMENT);let o={u_polygonOffset:function(){return U.ZERO}};e.uniformMap=Ot(o,e.uniformMap),e.hasSkipLevelOfDetail=!0}let i=e.renderStateOptions;i.stencilTest=Yt.setCesium3DTileBit(),i.stencilMask=Yt.CESIUM_3D_TILE_MASK};var aB=Zxe;var cB=`vec2 nearestPointOnEllipseFast(vec2 pos, vec2 radii) { vec2 p = abs(pos); vec2 inverseRadii = 1.0 / radii; vec2 evoluteScale = (radii.x * radii.x - radii.y * radii.y) * vec2(1.0, -1.0) * inverseRadii; @@ -8274,7 +8271,7 @@ applyFog(color, groundAtmosphereColor, lightDirection, distanceToCamera); } else { } } -`;var gF=`void atmosphereStage(ProcessedAttributes attributes) { +`;var lB=`void atmosphereStage(ProcessedAttributes attributes) { vec3 lightDirection = czm_getDynamicAtmosphereLightDirection(v_positionWC, czm_atmosphereDynamicLighting); czm_computeGroundAtmosphereScattering( v_positionWC, @@ -8284,7 +8281,7 @@ v_atmosphereMieColor, v_atmosphereOpacity ); } -`;var Nye={name:"AtmospherePipelineStage"};Nye.process=function(e,t,n){let i=e.shaderBuilder;i.addDefine("HAS_ATMOSPHERE",void 0,de.BOTH),i.addDefine("COMPUTE_POSITION_WC_ATMOSPHERE",void 0,de.BOTH),i.addVarying("vec3","v_atmosphereRayleighColor"),i.addVarying("vec3","v_atmosphereMieColor"),i.addVarying("float","v_atmosphereOpacity"),i.addVertexLines([gF]),i.addFragmentLines([pF]),i.addUniform("bool","u_isInFog",de.FRAGMENT),e.uniformMap.u_isInFog=function(){let r=h.distance(n.camera.positionWC,t.boundingSphere.center);return D.fog(r,n.fog.density)>D.EPSILON3}};var _F=Nye;var yF=`#ifdef DIFFUSE_IBL +`;var Qxe={name:"AtmospherePipelineStage"};Qxe.process=function(e,t,n){let i=e.shaderBuilder;i.addDefine("HAS_ATMOSPHERE",void 0,de.BOTH),i.addDefine("COMPUTE_POSITION_WC_ATMOSPHERE",void 0,de.BOTH),i.addVarying("vec3","v_atmosphereRayleighColor"),i.addVarying("vec3","v_atmosphereMieColor"),i.addVarying("float","v_atmosphereOpacity"),i.addVertexLines([lB]),i.addFragmentLines([cB]),i.addUniform("bool","u_isInFog",de.FRAGMENT),e.uniformMap.u_isInFog=function(){let r=h.distance(n.camera.positionWC,t.boundingSphere.center);return D.fog(r,n.fog.density)>D.EPSILON3}};var uB=Qxe;var fB=`#ifdef DIFFUSE_IBL vec3 sampleDiffuseEnvironment(vec3 cubeDir) { #ifdef CUSTOM_SPHERICAL_HARMONICS @@ -8359,14 +8356,14 @@ vec3 specularContribution = vec3(0.0); return diffuseContribution + specularContribution; } #endif -`;var Lye={name:"ImageBasedLightingPipelineStage"},Bnt=new U;Lye.process=function(e,t,n){let i=t.imageBasedLighting,r=t.environmentMapManager,o=e.shaderBuilder,s;l(i.specularEnvironmentMaps)||(s=r.radianceCubeMap);let a=i.sphericalHarmonicCoefficients??r.sphericalHarmonicCoefficients;o.addDefine("USE_IBL_LIGHTING",void 0,de.FRAGMENT),o.addUniform("vec2","model_iblFactor",de.FRAGMENT),rm.isSupported(n.context)&&((i.useSphericalHarmonics||i.useSpecularEnvironmentMaps||i.enabled)&&o.addUniform("mat3","model_iblReferenceFrameMatrix",de.FRAGMENT),l(s)&&o.addDefine("COMPUTE_POSITION_WC_ATMOSPHERE",void 0,de.BOTH),l(a)&&l(a[0])?(o.addDefine("DIFFUSE_IBL",void 0,de.FRAGMENT),o.addDefine("CUSTOM_SPHERICAL_HARMONICS",void 0,de.FRAGMENT),o.addUniform("vec3","model_sphericalHarmonicCoefficients[9]",de.FRAGMENT)):i.useDefaultSphericalHarmonics&&o.addDefine("DIFFUSE_IBL",void 0,de.FRAGMENT),l(i.specularEnvironmentCubeMap)&&i.specularEnvironmentCubeMap.ready||l(s)?(o.addDefine("SPECULAR_IBL",void 0,de.FRAGMENT),o.addDefine("CUSTOM_SPECULAR_IBL",void 0,de.FRAGMENT),o.addUniform("samplerCube","model_specularEnvironmentMaps",de.FRAGMENT),o.addUniform("float","model_specularEnvironmentMapsMaximumLOD",de.FRAGMENT)):t.useDefaultSpecularMaps&&o.addDefine("SPECULAR_IBL",void 0,de.FRAGMENT)),o.addFragmentLines(yF);let c={model_iblFactor:function(){return U.multiplyByScalar(i.imageBasedLightingFactor,r?.intensity||1,Bnt)},model_iblReferenceFrameMatrix:function(){return t._iblReferenceFrameMatrix},model_sphericalHarmonicCoefficients:function(){return a},model_specularEnvironmentMaps:function(){return i.specularEnvironmentCubeMap.texture},model_specularEnvironmentMapsMaximumLOD:function(){return i.specularEnvironmentCubeMap.maximumMipmapLevel}};l(s)&&(c.model_specularEnvironmentMaps=function(){return s},c.model_specularEnvironmentMapsMaximumLOD=function(){return r.maximumMipmapLevel}),e.uniformMap=Ot(c,e.uniformMap)};var AF=Lye;var knt=D.EPSILON16;function GJ(e){e=e??H.EMPTY_OBJECT;let t=e.stage,n=e.runtimeArticulation;this._stage=t,this._runtimeArticulation=n,this._name=t.name,this._type=t.type,this._minimumValue=t.minimumValue,this._maximumValue=t.maximumValue,this._currentValue=t.initialValue}Object.defineProperties(GJ.prototype,{stage:{get:function(){return this._stage}},runtimeArticulation:{get:function(){return this._runtimeArticulation}},name:{get:function(){return this._name}},type:{get:function(){return this._type}},minimumValue:{get:function(){return this._minimumValue}},maximumValue:{get:function(){return this._maximumValue}},currentValue:{get:function(){return this._currentValue},set:function(e){e=D.clamp(e,this.minimumValue,this.maximumValue),D.equalsEpsilon(this._currentValue,e,knt)||(this._currentValue=e,this.runtimeArticulation._dirty=!0)}}});var Unt=new h,HJ=new $;GJ.prototype.applyStageToMatrix=function(e){let t=this.type,n=this.currentValue,i=Unt,r;switch(t){case ul.XROTATE:r=$.fromRotationX(D.toRadians(n),HJ),e=N.multiplyByMatrix3(e,r,e);break;case ul.YROTATE:r=$.fromRotationY(D.toRadians(n),HJ),e=N.multiplyByMatrix3(e,r,e);break;case ul.ZROTATE:r=$.fromRotationZ(D.toRadians(n),HJ),e=N.multiplyByMatrix3(e,r,e);break;case ul.XTRANSLATE:i.x=n,i.y=0,i.z=0,e=N.multiplyByTranslation(e,i,e);break;case ul.YTRANSLATE:i.x=0,i.y=n,i.z=0,e=N.multiplyByTranslation(e,i,e);break;case ul.ZTRANSLATE:i.x=0,i.y=0,i.z=n,e=N.multiplyByTranslation(e,i,e);break;case ul.XSCALE:i.x=n,i.y=1,i.z=1,e=N.multiplyByScale(e,i,e);break;case ul.YSCALE:i.x=1,i.y=n,i.z=1,e=N.multiplyByScale(e,i,e);break;case ul.ZSCALE:i.x=1,i.y=1,i.z=n,e=N.multiplyByScale(e,i,e);break;case ul.UNIFORMSCALE:e=N.multiplyByUniformScale(e,n,e);break;default:break}return e};var bF=GJ;function bH(e){e=e??H.EMPTY_OBJECT;let t=e.articulation,n=e.sceneGraph;this._articulation=t,this._sceneGraph=n,this._name=t.name,this._runtimeStages=[],this._runtimeStagesByName={},this._runtimeNodes=[],this._dirty=!0,znt(this)}Object.defineProperties(bH.prototype,{articulation:{get:function(){return this._articulation}},sceneGraph:{get:function(){return this._sceneGraph}},name:{get:function(){return this._name}},runtimeStages:{get:function(){return this._runtimeStages}},runtimeNodes:{get:function(){return this._runtimeNodes}}});function znt(e){let n=e.articulation.stages,i=n.length,r=e._runtimeStages,o=e._runtimeStagesByName;for(let s=0;s<i;s++){let a=n[s],c=new bF({stage:a,runtimeArticulation:e});r.push(c);let u=a.name;o[u]=c}}bH.prototype.setArticulationStage=function(e,t){let n=this._runtimeStagesByName[e];l(n)&&(n.currentValue=t)};var Vnt=new N,jnt=new N;bH.prototype.apply=function(){if(!this._dirty)return;this._dirty=!1;let e=N.clone(N.IDENTITY,Vnt),t,n=this._runtimeStages,i=n.length;for(t=0;t<i;t++)e=n[t].applyStageToMatrix(e);let r=this._runtimeNodes,o=r.length;for(t=0;t<o;t++){let s=r[t],a=N.multiplyTransformation(s.originalTransform,e,jnt);s.transform=a}};var xF=bH;var TF=`void modelColorStage(inout czm_modelMaterial material) +`;var eTe={name:"ImageBasedLightingPipelineStage"},vst=new U;eTe.process=function(e,t,n){let i=t.imageBasedLighting,r=t.environmentMapManager,o=e.shaderBuilder,s;l(i.specularEnvironmentMaps)||(s=r.radianceCubeMap);let a=i.sphericalHarmonicCoefficients??r.sphericalHarmonicCoefficients;o.addDefine("USE_IBL_LIGHTING",void 0,de.FRAGMENT),o.addUniform("vec2","model_iblFactor",de.FRAGMENT),Em.isSupported(n.context)&&((i.useSphericalHarmonics||i.useSpecularEnvironmentMaps||i.enabled)&&o.addUniform("mat3","model_iblReferenceFrameMatrix",de.FRAGMENT),l(s)&&o.addDefine("COMPUTE_POSITION_WC_ATMOSPHERE",void 0,de.BOTH),l(a)&&l(a[0])?(o.addDefine("DIFFUSE_IBL",void 0,de.FRAGMENT),o.addDefine("CUSTOM_SPHERICAL_HARMONICS",void 0,de.FRAGMENT),o.addUniform("vec3","model_sphericalHarmonicCoefficients[9]",de.FRAGMENT)):i.useDefaultSphericalHarmonics&&o.addDefine("DIFFUSE_IBL",void 0,de.FRAGMENT),l(i.specularEnvironmentCubeMap)&&i.specularEnvironmentCubeMap.ready||l(s)?(o.addDefine("SPECULAR_IBL",void 0,de.FRAGMENT),o.addDefine("CUSTOM_SPECULAR_IBL",void 0,de.FRAGMENT),o.addUniform("samplerCube","model_specularEnvironmentMaps",de.FRAGMENT),o.addUniform("float","model_specularEnvironmentMapsMaximumLOD",de.FRAGMENT)):t.useDefaultSpecularMaps&&o.addDefine("SPECULAR_IBL",void 0,de.FRAGMENT)),o.addFragmentLines(fB);let c={model_iblFactor:function(){return U.multiplyByScalar(i.imageBasedLightingFactor,r?.intensity||1,vst)},model_iblReferenceFrameMatrix:function(){return t._iblReferenceFrameMatrix},model_sphericalHarmonicCoefficients:function(){return a},model_specularEnvironmentMaps:function(){return i.specularEnvironmentCubeMap.texture},model_specularEnvironmentMapsMaximumLOD:function(){return i.specularEnvironmentCubeMap.maximumMipmapLevel}};l(s)&&(c.model_specularEnvironmentMaps=function(){return s},c.model_specularEnvironmentMapsMaximumLOD=function(){return r.maximumMipmapLevel}),e.uniformMap=Ot(c,e.uniformMap)};var dB=eTe;var Sst=D.EPSILON16;function NZ(e){e=e??H.EMPTY_OBJECT;let t=e.stage,n=e.runtimeArticulation;this._stage=t,this._runtimeArticulation=n,this._name=t.name,this._type=t.type,this._minimumValue=t.minimumValue,this._maximumValue=t.maximumValue,this._currentValue=t.initialValue}Object.defineProperties(NZ.prototype,{stage:{get:function(){return this._stage}},runtimeArticulation:{get:function(){return this._runtimeArticulation}},name:{get:function(){return this._name}},type:{get:function(){return this._type}},minimumValue:{get:function(){return this._minimumValue}},maximumValue:{get:function(){return this._maximumValue}},currentValue:{get:function(){return this._currentValue},set:function(e){e=D.clamp(e,this.minimumValue,this.maximumValue),D.equalsEpsilon(this._currentValue,e,Sst)||(this._currentValue=e,this.runtimeArticulation._dirty=!0)}}});var wst=new h,MZ=new $;NZ.prototype.applyStageToMatrix=function(e){let t=this.type,n=this.currentValue,i=wst,r;switch(t){case ul.XROTATE:r=$.fromRotationX(D.toRadians(n),MZ),e=N.multiplyByMatrix3(e,r,e);break;case ul.YROTATE:r=$.fromRotationY(D.toRadians(n),MZ),e=N.multiplyByMatrix3(e,r,e);break;case ul.ZROTATE:r=$.fromRotationZ(D.toRadians(n),MZ),e=N.multiplyByMatrix3(e,r,e);break;case ul.XTRANSLATE:i.x=n,i.y=0,i.z=0,e=N.multiplyByTranslation(e,i,e);break;case ul.YTRANSLATE:i.x=0,i.y=n,i.z=0,e=N.multiplyByTranslation(e,i,e);break;case ul.ZTRANSLATE:i.x=0,i.y=0,i.z=n,e=N.multiplyByTranslation(e,i,e);break;case ul.XSCALE:i.x=n,i.y=1,i.z=1,e=N.multiplyByScale(e,i,e);break;case ul.YSCALE:i.x=1,i.y=n,i.z=1,e=N.multiplyByScale(e,i,e);break;case ul.ZSCALE:i.x=1,i.y=1,i.z=n,e=N.multiplyByScale(e,i,e);break;case ul.UNIFORMSCALE:e=N.multiplyByUniformScale(e,n,e);break;default:break}return e};var hB=NZ;function YH(e){e=e??H.EMPTY_OBJECT;let t=e.articulation,n=e.sceneGraph;this._articulation=t,this._sceneGraph=n,this._name=t.name,this._runtimeStages=[],this._runtimeStagesByName={},this._runtimeNodes=[],this._dirty=!0,Ist(this)}Object.defineProperties(YH.prototype,{articulation:{get:function(){return this._articulation}},sceneGraph:{get:function(){return this._sceneGraph}},name:{get:function(){return this._name}},runtimeStages:{get:function(){return this._runtimeStages}},runtimeNodes:{get:function(){return this._runtimeNodes}}});function Ist(e){let n=e.articulation.stages,i=n.length,r=e._runtimeStages,o=e._runtimeStagesByName;for(let s=0;s<i;s++){let a=n[s],c=new hB({stage:a,runtimeArticulation:e});r.push(c);let u=a.name;o[u]=c}}YH.prototype.setArticulationStage=function(e,t){let n=this._runtimeStagesByName[e];l(n)&&(n.currentValue=t)};var Pst=new N,Dst=new N;YH.prototype.apply=function(){if(!this._dirty)return;this._dirty=!1;let e=N.clone(N.IDENTITY,Pst),t,n=this._runtimeStages,i=n.length;for(t=0;t<i;t++)e=n[t].applyStageToMatrix(e);let r=this._runtimeNodes,o=r.length;for(t=0;t<o;t++){let s=r[t],a=N.multiplyTransformation(s.originalTransform,e,Dst);s.transform=a}};var mB=YH;var pB=`void modelColorStage(inout czm_modelMaterial material) { material.diffuse = mix(material.diffuse, model_color.rgb, model_colorBlend); float highlight = ceil(model_colorBlend); material.diffuse *= mix(model_color.rgb, vec3(1.0), highlight); material.alpha *= model_color.a; } -`;var kS={name:"ModelColorPipelineStage",COLOR_UNIFORM_NAME:"model_color",COLOR_BLEND_UNIFORM_NAME:"model_colorBlend"};kS.process=function(e,t,n){let i=e.shaderBuilder;i.addDefine("HAS_MODEL_COLOR",void 0,de.FRAGMENT),i.addFragmentLines(TF);let r={},o=t.color;o.alpha===0&&!t.hasSilhouette(n)&&(e.renderStateOptions.colorMask={red:!1,green:!1,blue:!1,alpha:!1}),o.alpha<1&&(e.alphaOptions.pass=Ie.TRANSLUCENT),i.addUniform("vec4",kS.COLOR_UNIFORM_NAME,de.FRAGMENT),r[kS.COLOR_UNIFORM_NAME]=function(){return t.color},i.addUniform("float",kS.COLOR_BLEND_UNIFORM_NAME,de.FRAGMENT),r[kS.COLOR_BLEND_UNIFORM_NAME]=function(){return ll.getColorBlend(t.colorBlendMode,t.colorBlendAmount)},e.uniformMap=Ot(r,e.uniformMap)};var EA=kS;var EF=`#ifdef USE_CLIPPING_PLANES_FLOAT_TEXTURE +`;var dw={name:"ModelColorPipelineStage",COLOR_UNIFORM_NAME:"model_color",COLOR_BLEND_UNIFORM_NAME:"model_colorBlend"};dw.process=function(e,t,n){let i=e.shaderBuilder;i.addDefine("HAS_MODEL_COLOR",void 0,de.FRAGMENT),i.addFragmentLines(pB);let r={},o=t.color;o.alpha===0&&!t.hasSilhouette(n)&&(e.renderStateOptions.colorMask={red:!1,green:!1,blue:!1,alpha:!1}),o.alpha<1&&(e.alphaOptions.pass=Ie.TRANSLUCENT),i.addUniform("vec4",dw.COLOR_UNIFORM_NAME,de.FRAGMENT),r[dw.COLOR_UNIFORM_NAME]=function(){return t.color},i.addUniform("float",dw.COLOR_BLEND_UNIFORM_NAME,de.FRAGMENT),r[dw.COLOR_BLEND_UNIFORM_NAME]=function(){return sl.getColorBlend(t.colorBlendMode,t.colorBlendAmount)},e.uniformMap=Ot(r,e.uniformMap)};var vA=dw;var gB=`#ifdef USE_CLIPPING_PLANES_FLOAT_TEXTURE vec4 getClippingPlane( highp sampler2D packedClippingPlanes, int clippingPlaneNumber, @@ -8445,7 +8442,7 @@ if (clipDistance > 0.0 && clipDistance < clippingPlanesEdgeWidth) { color = clippingPlanesEdgeColor; } } -`;var Fye={name:"ModelClippingPlanesPipelineStage"},Hnt=new U,Gnt=new N,Wnt=new N;Fye.process=function(e,t,n){let i=t.clippingPlanes,r=n.context,o=e.shaderBuilder;o.addDefine("HAS_CLIPPING_PLANES",void 0,de.FRAGMENT),o.addDefine("CLIPPING_PLANES_LENGTH",i.length,de.FRAGMENT),i.unionClippingRegions&&o.addDefine("UNION_CLIPPING_REGIONS",void 0,de.FRAGMENT),bs.useFloatTexture(r)&&o.addDefine("USE_CLIPPING_PLANES_FLOAT_TEXTURE",void 0,de.FRAGMENT);let s=bs.getTextureResolution(i,r,Hnt);o.addDefine("CLIPPING_PLANES_TEXTURE_WIDTH",s.x,de.FRAGMENT),o.addDefine("CLIPPING_PLANES_TEXTURE_HEIGHT",s.y,de.FRAGMENT),o.addUniform("sampler2D","model_clippingPlanes",de.FRAGMENT),o.addUniform("vec4","model_clippingPlanesEdgeStyle",de.FRAGMENT),o.addUniform("mat4","model_clippingPlanesMatrix",de.FRAGMENT),o.addFragmentLines(EF);let a={model_clippingPlanes:function(){return i.texture},model_clippingPlanesEdgeStyle:function(){let c=z.clone(i.edgeColor);return c.alpha=i.edgeWidth,c},model_clippingPlanesMatrix:function(){let c=N.transpose(r.uniformState.inverseView3D,Gnt);return N.multiply(c,t._clippingPlanesMatrix,Wnt)}};e.uniformMap=Ot(a,e.uniformMap)};var CF=Fye;var vF=`void modelClippingPolygonsStage() +`;var tTe={name:"ModelClippingPlanesPipelineStage"},Rst=new U,Ost=new N,Mst=new N;tTe.process=function(e,t,n){let i=t.clippingPlanes,r=n.context,o=e.shaderBuilder;o.addDefine("HAS_CLIPPING_PLANES",void 0,de.FRAGMENT),o.addDefine("CLIPPING_PLANES_LENGTH",i.length,de.FRAGMENT),i.unionClippingRegions&&o.addDefine("UNION_CLIPPING_REGIONS",void 0,de.FRAGMENT),Cs.useFloatTexture(r)&&o.addDefine("USE_CLIPPING_PLANES_FLOAT_TEXTURE",void 0,de.FRAGMENT);let s=Cs.getTextureResolution(i,r,Rst);o.addDefine("CLIPPING_PLANES_TEXTURE_WIDTH",s.x,de.FRAGMENT),o.addDefine("CLIPPING_PLANES_TEXTURE_HEIGHT",s.y,de.FRAGMENT),o.addUniform("sampler2D","model_clippingPlanes",de.FRAGMENT),o.addUniform("vec4","model_clippingPlanesEdgeStyle",de.FRAGMENT),o.addUniform("mat4","model_clippingPlanesMatrix",de.FRAGMENT),o.addFragmentLines(gB);let a={model_clippingPlanes:function(){return i.texture},model_clippingPlanesEdgeStyle:function(){let c=z.clone(i.edgeColor);return c.alpha=i.edgeWidth,c},model_clippingPlanesMatrix:function(){let c=N.transpose(r.uniformState.inverseView3D,Ost);return N.multiply(c,t._clippingPlanesMatrix,Mst)}};e.uniformMap=Ot(a,e.uniformMap)};var _B=tTe;var yB=`void modelClippingPolygonsStage() { bool insideAny = vectorClip(v_clippingUv); #ifdef CLIPPING_INVERSE @@ -8460,22 +8457,22 @@ discard; } #endif } -`;var SF=`void modelClippingPolygonsStage() +`;var AB=`void modelClippingPolygonsStage() { vec2 delta = czm_eyeToCartographicDelta(v_positionEC).xy; v_clippingUv = u_clippingCameraUv + delta * u_clippingRectangleInverseSize; } -`;var kye={name:"ModelClippingPolygonsPipelineStage"},qnt=new U,Ynt=new U,Bye=ie.MAX_VALUE;kye.process=function(e,t,n){let i=t.clippingPolygons,r=e.shaderBuilder;r.addDefine("ENABLE_CLIPPING_POLYGONS",void 0,de.BOTH),i.inverse&&r.addDefine("CLIPPING_INVERSE",void 0,de.FRAGMENT),r.addVarying("vec2","v_clippingUv"),r.addUniform("vec2","u_clippingCameraUv",de.VERTEX),r.addUniform("vec2","u_clippingRectangleInverseSize",de.VERTEX),r.addVertexLines(SF),r.addFragmentLines(pg),r.addFragmentLines(vF);let o={u_clippingCameraUv:function(){let s=t._clippingPolygonData?.rectangle??Bye,a=s.width*.5,c=s.west+a,u=n.camera.positionCartographic,f=D.negativePiToPi(u.longitude-c)+a;return U.fromElements(f/s.width,(u.latitude-s.south)/s.height,qnt)},u_clippingRectangleInverseSize:function(){let s=t._clippingPolygonData?.rectangle??Bye;return U.fromElements(1/s.width,1/s.height,Ynt)},u_clippingEdgeTexture:function(){return t._clippingPolygonData?.polygonEdgeTexture??n.context.defaultTexture},u_clippingEdgePrimitiveIndicesTexture:function(){return t._clippingPolygonData?.polygonEdgePrimitiveIndicesTexture??n.context.defaultTexture},u_clippingGridCellIndicesTexture:function(){return t._clippingPolygonData?.polygonGridCellIndicesTexture??n.context.defaultTexture}};e.uniformMap=Ot(o,e.uniformMap)};var wF=kye;var IF=`void modelVectorLookupStage(ProcessedAttributes attributes) +`;var iTe={name:"ModelClippingPolygonsPipelineStage"},Nst=new U,Lst=new U,nTe=ie.MAX_VALUE;iTe.process=function(e,t,n){let i=t.clippingPolygons,r=e.shaderBuilder;r.addDefine("ENABLE_CLIPPING_POLYGONS",void 0,de.BOTH),i.inverse&&r.addDefine("CLIPPING_INVERSE",void 0,de.FRAGMENT),r.addVarying("vec2","v_clippingUv"),r.addUniform("vec2","u_clippingCameraUv",de.VERTEX),r.addUniform("vec2","u_clippingRectangleInverseSize",de.VERTEX),r.addVertexLines(AB),r.addFragmentLines(pg),r.addFragmentLines(yB);let o={u_clippingCameraUv:function(){let s=t._clippingPolygonData?.rectangle??nTe,a=s.width*.5,c=s.west+a,u=n.camera.positionCartographic,f=D.negativePiToPi(u.longitude-c)+a;return U.fromElements(f/s.width,(u.latitude-s.south)/s.height,Nst)},u_clippingRectangleInverseSize:function(){let s=t._clippingPolygonData?.rectangle??nTe;return U.fromElements(1/s.width,1/s.height,Lst)},u_clippingEdgeTexture:function(){return t._clippingPolygonData?.polygonEdgeTexture??n.context.defaultTexture},u_clippingEdgePrimitiveIndicesTexture:function(){return t._clippingPolygonData?.polygonEdgePrimitiveIndicesTexture??n.context.defaultTexture},u_clippingGridCellIndicesTexture:function(){return t._clippingPolygonData?.polygonGridCellIndicesTexture??n.context.defaultTexture}};e.uniformMap=Ot(o,e.uniformMap)};var bB=iTe;var xB=`void modelVectorLookupStage(ProcessedAttributes attributes) { vec2 delta = czm_eyeToCartographicDelta(v_positionEC).xy; v_vectorUv = u_vectorCameraUv + delta * u_vectorRectangleInverseSize; } -`;var PF=`void modelVectorLookupStage(inout vec4 color) +`;var TB=`void modelVectorLookupStage(inout vec4 color) { color = vectorPolygonRender(v_vectorUv, color); color = vectorPolylineRender(v_vectorUv, color); } -`;var Xnt={name:"ModelVectorLookupPipelineStage",process:Jnt},Knt=new U,$nt=new U;function Jnt(e,t,n){let i=e.shaderBuilder,r=t._vectorData,o=r.hasPolylines,s=r.hasPolygons;i.addDefine("HAS_VECTOR_LOOKUP",void 0,de.BOTH),o&&(i.addDefine("HAS_VECTOR_POLYLINES",void 0,de.FRAGMENT),r.hasMeterWidths&&(i.addDefine("VECTOR_WIDTH_IN_METERS",void 0,de.FRAGMENT),r.hasPixelWidths&&i.addDefine("VECTOR_WIDTH_MIXED_UNITS",void 0,de.FRAGMENT),i.addUniform("vec2","u_vectorMetersPerUv",de.FRAGMENT))),s&&i.addDefine("HAS_VECTOR_POLYGONS",void 0,de.FRAGMENT),i.addUniform("vec2","u_vectorCameraUv",de.VERTEX),i.addUniform("vec2","u_vectorRectangleInverseSize",de.VERTEX),i.addVarying("vec2","v_vectorUv"),i.addVertexLines(IF),i.addFragmentLines(pg),i.addFragmentLines(PF);let a=r.rectangle,c=function(){return n.context.defaultTexture},u={u_vectorCameraUv:function(){let f=t._vectorData?.rectangle??a,d=n.camera.positionCartographic,p=f.width*.5,g=f.west+p,m=D.negativePiToPi(d.longitude-g)+p;return U.fromElements(m/f.width,(d.latitude-f.south)/f.height,Knt)},u_vectorRectangleInverseSize:function(){let f=t._vectorData?.rectangle??a;return U.fromElements(1/f.width,1/f.height,$nt)},u_vectorColorTexture:function(){return t._vectorData?.colorTexture??c()},u_vectorPickColorTexture:function(){return t._vectorData?.pickColorTexture??c()}};o&&(u.u_vectorSegmentTexture=function(){return t._vectorData?.polylineSegmentTexture??c()},u.u_vectorWidthTexture=function(){return t._vectorData?.widthTexture??c()},u.u_vectorSegmentPrimitiveIndicesTexture=function(){return t._vectorData?.polylineSegmentPrimitiveIndicesTexture??c()},u.u_vectorGridCellIndicesTexture=function(){return t._vectorData?.polylineGridCellIndicesTexture??c()},r.hasMeterWidths&&(u.u_vectorMetersPerUv=function(){return t._vectorData.metersPerUv})),s&&(u.u_vectorPolygonEdgeTexture=function(){return t._vectorData?.polygonEdgeTexture??c()},u.u_vectorPolygonEdgePrimitiveIndicesTexture=function(){return t._vectorData?.polygonEdgePrimitiveIndicesTexture??c()},u.u_vectorPolygonGridCellIndicesTexture=function(){return t._vectorData?.polygonGridCellIndicesTexture??c()}),e.uniformMap=Ot(u,e.uniformMap)}var DF=Xnt;function Uye(e,t){this._model=e,this._runtimeNode=t}Object.defineProperties(Uye.prototype,{name:{get:function(){return this._runtimeNode._name}},id:{get:function(){return this._runtimeNode._id}},show:{get:function(){return this._runtimeNode.show},set:function(e){this._runtimeNode.show=e}},matrix:{get:function(){return this._runtimeNode.transform},set:function(e){l(e)?(this._runtimeNode.transform=e,this._runtimeNode.userAnimated=!0,this._model._userAnimationDirty=!0):(this._runtimeNode.transform=this.originalMatrix,this._runtimeNode.userAnimated=!1)}},originalMatrix:{get:function(){return this._runtimeNode.originalTransform}}});var RF=Uye;var OF=`mat4 getInstancingTransform() +`;var Fst={name:"ModelVectorLookupPipelineStage",process:Ust},Bst=new U,kst=new U;function Ust(e,t,n){let i=e.shaderBuilder,r=t._vectorData,o=r.hasPolylines,s=r.hasPolygons;i.addDefine("HAS_VECTOR_LOOKUP",void 0,de.BOTH),o&&(i.addDefine("HAS_VECTOR_POLYLINES",void 0,de.FRAGMENT),r.hasMeterWidths&&(i.addDefine("VECTOR_WIDTH_IN_METERS",void 0,de.FRAGMENT),r.hasPixelWidths&&i.addDefine("VECTOR_WIDTH_MIXED_UNITS",void 0,de.FRAGMENT),i.addUniform("vec2","u_vectorMetersPerUv",de.FRAGMENT))),s&&i.addDefine("HAS_VECTOR_POLYGONS",void 0,de.FRAGMENT),i.addUniform("vec2","u_vectorCameraUv",de.VERTEX),i.addUniform("vec2","u_vectorRectangleInverseSize",de.VERTEX),i.addVarying("vec2","v_vectorUv"),i.addVertexLines(xB),i.addFragmentLines(pg),i.addFragmentLines(TB);let a=r.rectangle,c=function(){return n.context.defaultTexture},u={u_vectorCameraUv:function(){let f=t._vectorData?.rectangle??a,d=n.camera.positionCartographic,p=f.width*.5,g=f.west+p,m=D.negativePiToPi(d.longitude-g)+p;return U.fromElements(m/f.width,(d.latitude-f.south)/f.height,Bst)},u_vectorRectangleInverseSize:function(){let f=t._vectorData?.rectangle??a;return U.fromElements(1/f.width,1/f.height,kst)},u_vectorColorTexture:function(){return t._vectorData?.colorTexture??c()},u_vectorPickColorTexture:function(){return t._vectorData?.pickColorTexture??c()}};o&&(u.u_vectorSegmentTexture=function(){return t._vectorData?.polylineSegmentTexture??c()},u.u_vectorWidthTexture=function(){return t._vectorData?.widthTexture??c()},u.u_vectorSegmentPrimitiveIndicesTexture=function(){return t._vectorData?.polylineSegmentPrimitiveIndicesTexture??c()},u.u_vectorGridCellIndicesTexture=function(){return t._vectorData?.polylineGridCellIndicesTexture??c()},r.hasMeterWidths&&(u.u_vectorMetersPerUv=function(){return t._vectorData.metersPerUv})),s&&(u.u_vectorPolygonEdgeTexture=function(){return t._vectorData?.polygonEdgeTexture??c()},u.u_vectorPolygonEdgePrimitiveIndicesTexture=function(){return t._vectorData?.polygonEdgePrimitiveIndicesTexture??c()},u.u_vectorPolygonGridCellIndicesTexture=function(){return t._vectorData?.polygonGridCellIndicesTexture??c()}),e.uniformMap=Ot(u,e.uniformMap)}var EB=Fst;function rTe(e,t){this._model=e,this._runtimeNode=t}Object.defineProperties(rTe.prototype,{name:{get:function(){return this._runtimeNode._name}},id:{get:function(){return this._runtimeNode._id}},show:{get:function(){return this._runtimeNode.show},set:function(e){this._runtimeNode.show=e}},matrix:{get:function(){return this._runtimeNode.transform},set:function(e){l(e)?(this._runtimeNode.transform=e,this._runtimeNode.userAnimated=!0,this._model._userAnimationDirty=!0):(this._runtimeNode.transform=this.originalMatrix,this._runtimeNode.userAnimated=!1)}},originalMatrix:{get:function(){return this._runtimeNode.originalTransform}}});var CB=rTe;var vB=`mat4 getInstancingTransform() { mat4 instancingTransform; #ifdef HAS_INSTANCE_MATRICES @@ -8533,7 +8530,7 @@ translation2D.x, translation2D.y, translation2D.z, 1.0 return instancingTransform2D; } #endif -`;var MF=`void instancingStage(inout ProcessedAttributes attributes) +`;var SB=`void instancingStage(inout ProcessedAttributes attributes) { vec3 positionMC = attributes.positionMC; mat4 instancingTransform = getInstancingTransform(); @@ -8547,7 +8544,7 @@ mat4 instancingTransform2D = getInstancingTransform2D(); attributes.position2D = (instancingTransform2D * vec4(positionMC, 1.0)).xyz; #endif } -`;var NF=`void legacyInstancingStage( +`;var wB=`void legacyInstancingStage( inout ProcessedAttributes attributes, out mat4 instanceModelView, out mat3 instanceModelViewInverseTranspose) @@ -8563,7 +8560,7 @@ mat4 instancingTransform2D = getInstancingTransform2D(); attributes.position2D = (instancingTransform2D * vec4(positionMC, 1.0)).xyz; #endif } -`;var xH=new N,Znt=new N,Qnt=new N,Vye={name:"InstancingPipelineStage",_getInstanceTransformsAsMatrices:qye,_transformsToTypedArray:qJ};Vye.process=function(e,t,n){let i=t.instances,r=i.attributes[0].count,o=e.shaderBuilder;o.addDefine("HAS_INSTANCING"),o.addVertexLines(OF);let s=e.model,a=s.sceneGraph,c=e.runtimeNode,u=n.mode!==re.SCENE3D&&!n.scene3DOnly&&s._projectTo2D,f=s._enablePick&&!n.context.webgl2,d=[];mit(e,n,i,d,u,f),_it(e,n,i,d);let p={};if(i.transformInWorldSpace?(o.addDefine("USE_LEGACY_INSTANCING",void 0,de.VERTEX),o.addUniform("mat4","u_instance_modifiedModelView",de.VERTEX),o.addUniform("mat4","u_instance_nodeTransform",de.VERTEX),p.u_instance_modifiedModelView=function(){let g=N.multiplyTransformation(s.modelMatrix,a.components.transform,xH);return u?N.multiplyTransformation(n.context.uniformState.view3D,g,xH):(n.mode!==re.SCENE3D&&(g=At.basisTo2D(n.mapProjection,g,xH)),N.multiplyTransformation(n.context.uniformState.view,g,xH))},p.u_instance_nodeTransform=function(){return N.multiplyTransformation(a.axisCorrectionMatrix,c.computedTransform,Znt)},o.addVertexLines(NF)):o.addVertexLines(MF),u){o.addDefine("USE_2D_INSTANCING",void 0,de.VERTEX),o.addUniform("mat4","u_modelView2D",de.VERTEX);let g=n.context,m=N.fromTranslation(c.instancingReferencePoint2D,new N);p.u_modelView2D=function(){return N.multiplyTransformation(g.uniformState.view,m,Qnt)}}e.uniformMap=Ot(p,e.uniformMap),e.instanceCount=r,Zn(e.attributes,d)};var LF=new N,eit=new h;function tit(e,t,n,i,r){let o=N.multiplyTransformation(t,e,LF);return o=N.multiplyTransformation(o,n,LF),r=At.basisTo2D(i.mapProjection,o,r),r}function nit(e,t,n,i,r){let o=N.fromTranslation(e,LF),s=N.multiplyTransformation(t,o,LF);s=N.multiplyTransformation(s,n,LF);let a=N.getTranslation(s,eit);return r=dr.computeActualEllipsoidPosition(i,a,r),r}function jye(e,t,n){let i=e.model,r=i.sceneGraph;e.runtimeNode.node.instances.transformInWorldSpace?(N.multiplyTransformation(i.modelMatrix,r.components.transform,t),N.multiplyTransformation(r.axisCorrectionMatrix,e.runtimeNode.computedTransform,n)):(t=N.clone(r.computedModelMatrix,t),N.multiplyTransformation(t,e.runtimeNode.computedTransform,t),N.clone(N.IDENTITY,n))}var Hye=new N,Gye=new N,iit=new N,rit=new h;function oit(e,t,n,i){let r=Hye,o=Gye;jye(t,r,o);let a=t.runtimeNode.instancingReferencePoint2D,c=e.length;for(let u=0;u<c;u++){let f=e[u],d=tit(f,r,o,n,iit),p=N.getTranslation(d,rit),g=h.subtract(p,a,p);i[u]=N.setTranslation(d,g,i[u])}return i}function sit(e,t,n,i){let r=Hye,o=Gye;jye(t,r,o);let a=t.runtimeNode.instancingReferencePoint2D,c=e.length;for(let u=0;u<c;u++){let f=e[u],d=nit(f,r,o,n,f);i[u]=h.subtract(d,a,i[u])}return i}var ait=new h,cit=new h;function Wye(e,t){let n=e.runtimeNode,i=e.model.sceneGraph.computedModelMatrix,r=N.multiplyByPoint(i,n.instancingTranslationMin,ait),o=dr.computeActualEllipsoidPosition(t,r,r),s=N.multiplyByPoint(i,n.instancingTranslationMax,cit),a=dr.computeActualEllipsoidPosition(t,s,s);n.instancingReferencePoint2D=h.lerp(o,a,.5,new h)}function qJ(e){let n=e.length,i=new Float32Array(n*12);for(let r=0;r<n;r++){let o=e[r],s=12*r;i[s+0]=o[0],i[s+1]=o[4],i[s+2]=o[8],i[s+3]=o[12],i[s+4]=o[1],i[s+5]=o[5],i[s+6]=o[9],i[s+7]=o[13],i[s+8]=o[2],i[s+9]=o[6],i[s+10]=o[10],i[s+11]=o[14]}return i}function lit(e){let n=e.length,i=new Float32Array(n*3);for(let r=0;r<n;r++){let o=e[r],s=3*r;i[s+0]=o[0],i[s+1]=o[4],i[s+2]=o[8]}return i}var uit=new h,fit=new Le,dit=new h;function qye(e,t,n){let i=new Array(t),r=xt.getAttributeBySemantic(e,No.TRANSLATION),o=xt.getAttributeBySemantic(e,No.ROTATION),s=xt.getAttributeBySemantic(e,No.SCALE),a=new h(-Number.MAX_VALUE,-Number.MAX_VALUE,-Number.MAX_VALUE),c=new h(Number.MAX_VALUE,Number.MAX_VALUE,Number.MAX_VALUE),u=l(r),f=l(o),d=l(s),p=u?r.typedArray:new Float32Array(t*3),g=f?o.typedArray:new Float32Array(t*4);f&&o.normalized&&(g=cn.dequantize(g,o.componentDatatype,o.type,t));let m;d?m=s.typedArray:(m=new Float32Array(t*3),m.fill(1));for(let A=0;A<t;A++){let b=new h(p[A*3],p[A*3+1],p[A*3+2],uit);h.maximumByComponent(a,b,a),h.minimumByComponent(c,b,c);let x=new Le(g[A*4],g[A*4+1],g[A*4+2],f?g[A*4+3]:1,fit),T=new h(m[A*3],m[A*3+1],m[A*3+2],dit),E=N.fromTranslationQuaternionRotationScale(b,x,T,new N);i[A]=E}let y=n.runtimeNode;return y.instancingTranslationMin=c,y.instancingTranslationMax=a,u&&(r.typedArray=void 0),f&&(o.typedArray=void 0),d&&(s.typedArray=void 0),i}function hit(e,t,n){let i=new Array(t),r=e.typedArray,o=new h(Number.MAX_VALUE,Number.MAX_VALUE,Number.MAX_VALUE),s=new h(-Number.MAX_VALUE,-Number.MAX_VALUE,-Number.MAX_VALUE);for(let c=0;c<t;c++){let u=new h(r[c*3],r[c*3+1],r[c*3+2]);i[c]=u,h.minimumByComponent(o,u,o),h.maximumByComponent(s,u,s)}let a=n.runtimeNode;return a.instancingTranslationMin=o,a.instancingTranslationMax=s,e.typedArray=void 0,i}function YJ(e,t){let n=tt.createVertexBuffer({context:t.context,typedArray:e,usage:Me.STATIC_DRAW});return n.vertexArrayDestroyable=!1,n}function mit(e,t,n,i,r,o){let s=xt.getAttributeBySemantic(n,No.ROTATION);l(s)||o?pit(e,n,i,t,r,o):git(e,n,i,t,r)}function pit(e,t,n,i,r,o){let s=e.shaderBuilder,a=t.attributes[0].count,c=e.model,u=e.runtimeNode;s.addDefine("HAS_INSTANCE_MATRICES");let f="Transform",d,p=u.instancingTransformsBuffer;if(!l(p)){d=qye(t,a,e);let A=qJ(d);p=YJ(A,i),c._modelResources.push(p),o&&(u.transformsTypedArray=A),u.instancingTransformsBuffer=p}if(zye(e,p,n,f),!r)return;let g=Je(i);g.mode=re.COLUMBUS_VIEW,Wye(e,g);let m=u.instancingTransformsBuffer2D;if(!l(m)){let A=oit(d,e,g,d),b=qJ(A);m=YJ(b,i),c._modelResources.push(m),u.instancingTransformsBuffer2D=m}zye(e,m,n,"Transform2D")}function git(e,t,n,i,r,o){let s=e.shaderBuilder,a=e.runtimeNode,c=xt.getAttributeBySemantic(t,No.TRANSLATION),u=xt.getAttributeBySemantic(t,No.SCALE);if(l(u)&&(s.addDefine("HAS_INSTANCE_SCALE"),WJ(e,u.buffer,u.byteOffset,u.byteStride,n,"Scale")),!l(c))return;let f,d=c.typedArray;if(l(d)?f=hit(c,c.count,e):l(a.instancingTranslationMin)||(a.instancingTranslationMin=c.min,a.instancingTranslationMax=c.max),s.addDefine("HAS_INSTANCE_TRANSLATION"),WJ(e,c.buffer,c.byteOffset,c.byteStride,n,"Translation"),!r&&!o)return;let g=Je(i);g.mode=re.COLUMBUS_VIEW,Wye(e,g);let m=a.instancingTranslationBuffer2D;if(!l(m)){let x=sit(f,e,g,f),T=lit(x);o&&(a.transformsTypedArray=T),m=YJ(T,i),e.model._modelResources.push(m),a.instancingTranslationBuffer2D=m}if(!r)return;WJ(e,m,0,void 0,n,"Translation2D")}function zye(e,t,n,i){let o=Y.getSizeInBytes(Y.FLOAT),s=o*12,a=[{index:e.attributeIndex++,vertexBuffer:t,componentsPerAttribute:4,componentDatatype:Y.FLOAT,normalize:!1,offsetInBytes:0,strideInBytes:s,instanceDivisor:1},{index:e.attributeIndex++,vertexBuffer:t,componentsPerAttribute:4,componentDatatype:Y.FLOAT,normalize:!1,offsetInBytes:o*4,strideInBytes:s,instanceDivisor:1},{index:e.attributeIndex++,vertexBuffer:t,componentsPerAttribute:4,componentDatatype:Y.FLOAT,normalize:!1,offsetInBytes:o*8,strideInBytes:s,instanceDivisor:1}],c=e.shaderBuilder;c.addAttribute("vec4",`a_instancing${i}Row0`),c.addAttribute("vec4",`a_instancing${i}Row1`),c.addAttribute("vec4",`a_instancing${i}Row2`),Zn(n,a)}function WJ(e,t,n,i,r,o){r.push({index:e.attributeIndex++,vertexBuffer:t,componentsPerAttribute:3,componentDatatype:Y.FLOAT,normalize:!1,offsetInBytes:n,strideInBytes:i,instanceDivisor:1}),e.shaderBuilder.addAttribute("vec3",`a_instance${o}`)}function _it(e,t,n,i){let r=n.attributes,o=e.shaderBuilder;for(let s=0;s<r.length;s++){let a=r[s];a.semantic===No.FEATURE_ID&&(a.setIndex>=e.featureIdVertexAttributeSetIndex&&(e.featureIdVertexAttributeSetIndex=a.setIndex+1),i.push({index:e.attributeIndex++,vertexBuffer:a.buffer,componentsPerAttribute:Vt.getNumberOfComponents(a.type),componentDatatype:a.componentDatatype,normalize:!1,offsetInBytes:a.byteOffset,strideInBytes:a.byteStride,instanceDivisor:1}),o.addAttribute("float",`a_instanceFeatureId_${a.setIndex}`))}}var FF=Vye;var Yye=[],XJ={};XJ.name="ModelMatrixUpdateStage";XJ.update=function(e,t,n){let i=n.mode!==re.SCENE3D;if(!(i&&t._model._projectTo2D)&&e._transformDirty){if(!e.show)return;let r=i?t._computedModelMatrix2D:t._computedModelMatrix;Xye(e,t,r,e.transformToRoot,0),e._transformDirty=!1}};function yit(e,t,n){e.modelMatrix=N.multiplyTransformation(t,n,e.modelMatrix),e.cullFace=xt.getCullFace(e.modelMatrix,e.primitiveType)}function Xye(e,t,n,i,r){let o,s=Yye[r];l(s)||(s=Yye[r]=new N),i=N.multiplyTransformation(i,e.transform,s),e.updateComputedTransform();let a=e.runtimePrimitives.length;for(o=0;o<a;o++){let u=e.runtimePrimitives[o];yit(u.drawCommand,n,i)}let c=e.children.length;for(o=0;o<c;o++){let u=t._runtimeNodes[e.children[o]];if(u._transformToRoot=N.clone(i,u._transformToRoot),!u.show){u._transformDirty=!0;continue}Xye(u,t,n,i,r+1),u._transformDirty=!1}}var BF=XJ;var Kye={name:"NodeStatisticsPipelineStage",_countInstancingAttributes:$ye,_countGeneratedBuffers:Jye};Kye.process=function(e,t,n){let i=e.model.statistics,r=t.instances,o=e.runtimeNode;$ye(i,r),Jye(i,o)};function $ye(e,t){if(!l(t))return;let n=t.attributes,i=n.length;for(let r=0;r<i;r++){let o=n[r];l(o.buffer)&&e.addBuffer(o.buffer,!1)}}function Jye(e,t){l(t.instancingTransformsBuffer)&&e.addBuffer(t.instancingTransformsBuffer,!1),l(t.instancingTransformsBuffer2D)&&e.addBuffer(t.instancingTransformsBuffer2D,!1),l(t.instancingTranslationBuffer2D)&&e.addBuffer(t.instancingTranslationBuffer2D,!1)}var kF=Kye;function US(e){e=e??H.EMPTY_OBJECT;let t=e.node,n=e.transform,i=e.transformToRoot,r=e.sceneGraph,o=e.children;this._node=t,this._name=t.name,this._id=t.index,this._sceneGraph=r,this._children=o,this._originalTransform=N.clone(n,this._originalTransform),this._transform=N.clone(n,this._transform),this._transformToRoot=N.clone(i,this._transformToRoot),this._computedTransform=new N,this._transformDirty=!1,this._transformParameters=void 0,this._morphWeights=[],this._runtimeSkin=void 0,this._computedJointMatrices=[],this.show=!0,this.userAnimated=!1,this.pipelineStages=[],this.runtimePrimitives=[],this.updateStages=[],this.instancingTranslationMin=void 0,this.instancingTranslationMax=void 0,this.instancingTransformsBuffer=void 0,this.instancingTransformsBuffer2D=void 0,this.instancingTranslationBuffer2D=void 0,this.instancingReferencePoint2D=void 0,Ait(this)}Object.defineProperties(US.prototype,{node:{get:function(){return this._node}},sceneGraph:{get:function(){return this._sceneGraph}},children:{get:function(){return this._children}},transform:{get:function(){return this._transform},set:function(e){this._transformDirty=!0,this._transform=N.clone(e,this._transform)}},transformToRoot:{get:function(){return this._transformToRoot}},computedTransform:{get:function(){return this._computedTransform}},originalTransform:{get:function(){return this._originalTransform}},translation:{get:function(){return l(this._transformParameters)?this._transformParameters.translation:void 0},set:function(e){let t=this._transformParameters,n=t.translation;h.equals(n,e)||(t.translation=h.clone(e,t.translation),KJ(this,t))}},rotation:{get:function(){return l(this._transformParameters)?this._transformParameters.rotation:void 0},set:function(e){let t=this._transformParameters,n=t.rotation;Le.equals(n,e)||(t.rotation=Le.clone(e,t.rotation),KJ(this,t))}},scale:{get:function(){return l(this._transformParameters)?this._transformParameters.scale:void 0},set:function(e){let t=this._transformParameters,n=t.scale;h.equals(n,e)||(t.scale=h.clone(e,t.scale),KJ(this,t))}},morphWeights:{get:function(){return this._morphWeights},set:function(e){let t=e.length;for(let n=0;n<t;n++)this._morphWeights[n]=e[n]}},runtimeSkin:{get:function(){return this._runtimeSkin}},computedJointMatrices:{get:function(){return this._computedJointMatrices}}});function Ait(e){let t=e.transform,n=e.transformToRoot,i=e._computedTransform;e._computedTransform=N.multiply(n,t,i);let r=e.node;l(r.matrix)||(e._transformParameters=new $y(r.translation,r.rotation,r.scale)),l(r.morphWeights)&&(e._morphWeights=r.morphWeights.slice());let o=r.articulationName;if(l(o)){let c=e.sceneGraph._runtimeArticulations[o];l(c)&&c.runtimeNodes.push(e)}}function KJ(e,t){e._transformDirty=!0,e._transform=N.fromTranslationRotationScale(t,e._transform)}US.prototype.getChild=function(e){return this.sceneGraph._runtimeNodes[this.children[e]]};US.prototype.configurePipeline=function(){let e=this.node,t=this.pipelineStages;t.length=0;let n=this.updateStages;n.length=0,l(e.instances)&&t.push(FF),t.push(kF),n.push(BF)};US.prototype.updateComputedTransform=function(){this._computedTransform=N.multiply(this._transformToRoot,this._transform,this._computedTransform)};US.prototype.updateJointMatrices=function(){let e=this._runtimeSkin;if(!l(e))return;e.updateJointMatrices();let t=this._computedJointMatrices,n=e.jointMatrices,i=n.length;for(let r=0;r<i;r++){l(t[r])||(t[r]=new N);let o=N.multiplyTransformation(this.transformToRoot,this.transform,t[r]),s=N.inverseTransformation(o,t[r]);t[r]=N.multiplyTransformation(s,n[r],t[r])}};var UF=US;var Zye={name:"AlphaPipelineStage"};Zye.process=function(e,t,n){let i=e.alphaOptions,r=e.model;i.pass=i.pass??r.opaquePass;let o=e.renderStateOptions;i.pass===Ie.TRANSLUCENT&&(o.cull.enabled=!1,o.depthMask=!1,o.blending=tn.ALPHA_BLEND);let s=e.shaderBuilder,a=e.uniformMap;l(i.alphaCutoff)&&(s.addDefine("ALPHA_MODE_MASK",void 0,de.FRAGMENT),s.addUniform("float","u_alphaCutoff",de.FRAGMENT),a.u_alphaCutoff=function(){return i.alphaCutoff})};var zF=Zye;var Qye={name:"BatchTexturePipelineStage"};Qye.process=function(e,t,n){let i=e.shaderBuilder,r={},o=e.model,s=o.featureTables[o.featureTableId],a=s.featuresLength;i.addUniform("int","model_featuresLength"),r.model_featuresLength=function(){return a};let c=s.batchTexture;i.addUniform("sampler2D","model_batchTexture"),r.model_batchTexture=function(){return c.batchTexture??c.defaultTexture},i.addUniform("vec4","model_textureStep"),r.model_textureStep=function(){return c.textureStep},c.textureDimensions.y>1&&(i.addDefine("MULTILINE_BATCH_TEXTURE"),i.addUniform("vec2","model_textureDimensions"),r.model_textureDimensions=function(){return c.textureDimensions}),e.uniformMap=Ot(r,e.uniformMap)};var VF=Qye;var eAe={name:"ClassificationPipelineStage"};eAe.process=function(e,t,n){e.shaderBuilder.addDefine("HAS_CLASSIFICATION",void 0,de.BOTH);let r=e.runtimePrimitive;l(r.batchLengths)||bit(t,r)};function bit(e,t){let n=xt.getAttributeBySemantic(e,ct.POSITION);if(!l(n))throw new oe("Primitives must have a position attribute to be used for classification.");let i,r=e.indices,o=l(r);o&&(i=r.typedArray,r.typedArray=void 0);let s=o?r.count:n.count,a=xt.getAttributeBySemantic(e,ct.FEATURE_ID,0);if(!l(a)){t.batchLengths=[s],t.batchOffsets=[0];return}let c=a.typedArray;a.typedArray=void 0;let u=[],f=[0],d=o?i[0]:0,p=c[d],g=0;for(let y=1;y<s;y++){let A=o?i[y]:y,b=c[A];if(b!==p){let x=y-g,T=y;u.push(x),f.push(T),g=T,p=b}}let m=s-g;u.push(m),t.batchLengths=u,t.batchOffsets=f}var jF=eAe;var HF=`void filterByPassType(inout vec3 positionMC, vec4 featureColor) +`;var XH=new N,zst=new N,Vst=new N,sTe={name:"InstancingPipelineStage",_getInstanceTransformsAsMatrices:fTe,_transformsToTypedArray:FZ};sTe.process=function(e,t,n){let i=t.instances,r=i.attributes[0].count,o=e.shaderBuilder;o.addDefine("HAS_INSTANCING"),o.addVertexLines(vB);let s=e.model,a=s.sceneGraph,c=e.runtimeNode,u=n.mode!==re.SCENE3D&&!n.scene3DOnly&&s._projectTo2D,f=s._enablePick&&!n.context.webgl2,d=[];nat(e,n,i,d,u,f),oat(e,n,i,d);let p={};if(i.transformInWorldSpace?(o.addDefine("USE_LEGACY_INSTANCING",void 0,de.VERTEX),o.addUniform("mat4","u_instance_modifiedModelView",de.VERTEX),o.addUniform("mat4","u_instance_nodeTransform",de.VERTEX),p.u_instance_modifiedModelView=function(){let g=N.multiplyTransformation(s.modelMatrix,a.components.transform,XH);return u?N.multiplyTransformation(n.context.uniformState.view3D,g,XH):(n.mode!==re.SCENE3D&&(g=At.basisTo2D(n.mapProjection,g,XH)),N.multiplyTransformation(n.context.uniformState.view,g,XH))},p.u_instance_nodeTransform=function(){return N.multiplyTransformation(a.axisCorrectionMatrix,c.computedTransform,zst)},o.addVertexLines(wB)):o.addVertexLines(SB),u){o.addDefine("USE_2D_INSTANCING",void 0,de.VERTEX),o.addUniform("mat4","u_modelView2D",de.VERTEX);let g=n.context,m=N.fromTranslation(c.instancingReferencePoint2D,new N);p.u_modelView2D=function(){return N.multiplyTransformation(g.uniformState.view,m,Vst)}}e.uniformMap=Ot(p,e.uniformMap),e.instanceCount=r,Zn(e.attributes,d)};var IB=new N,jst=new h;function Hst(e,t,n,i,r){let o=N.multiplyTransformation(t,e,IB);return o=N.multiplyTransformation(o,n,IB),r=At.basisTo2D(i.mapProjection,o,r),r}function Gst(e,t,n,i,r){let o=N.fromTranslation(e,IB),s=N.multiplyTransformation(t,o,IB);s=N.multiplyTransformation(s,n,IB);let a=N.getTranslation(s,jst);return r=dr.computeActualEllipsoidPosition(i,a,r),r}function aTe(e,t,n){let i=e.model,r=i.sceneGraph;e.runtimeNode.node.instances.transformInWorldSpace?(N.multiplyTransformation(i.modelMatrix,r.components.transform,t),N.multiplyTransformation(r.axisCorrectionMatrix,e.runtimeNode.computedTransform,n)):(t=N.clone(r.computedModelMatrix,t),N.multiplyTransformation(t,e.runtimeNode.computedTransform,t),N.clone(N.IDENTITY,n))}var cTe=new N,lTe=new N,Wst=new N,qst=new h;function Yst(e,t,n,i){let r=cTe,o=lTe;aTe(t,r,o);let a=t.runtimeNode.instancingReferencePoint2D,c=e.length;for(let u=0;u<c;u++){let f=e[u],d=Hst(f,r,o,n,Wst),p=N.getTranslation(d,qst),g=h.subtract(p,a,p);i[u]=N.setTranslation(d,g,i[u])}return i}function Xst(e,t,n,i){let r=cTe,o=lTe;aTe(t,r,o);let a=t.runtimeNode.instancingReferencePoint2D,c=e.length;for(let u=0;u<c;u++){let f=e[u],d=Gst(f,r,o,n,f);i[u]=h.subtract(d,a,i[u])}return i}var Kst=new h,$st=new h;function uTe(e,t){let n=e.runtimeNode,i=e.model.sceneGraph.computedModelMatrix,r=N.multiplyByPoint(i,n.instancingTranslationMin,Kst),o=dr.computeActualEllipsoidPosition(t,r,r),s=N.multiplyByPoint(i,n.instancingTranslationMax,$st),a=dr.computeActualEllipsoidPosition(t,s,s);n.instancingReferencePoint2D=h.lerp(o,a,.5,new h)}function FZ(e){let n=e.length,i=new Float32Array(n*12);for(let r=0;r<n;r++){let o=e[r],s=12*r;i[s+0]=o[0],i[s+1]=o[4],i[s+2]=o[8],i[s+3]=o[12],i[s+4]=o[1],i[s+5]=o[5],i[s+6]=o[9],i[s+7]=o[13],i[s+8]=o[2],i[s+9]=o[6],i[s+10]=o[10],i[s+11]=o[14]}return i}function Jst(e){let n=e.length,i=new Float32Array(n*3);for(let r=0;r<n;r++){let o=e[r],s=3*r;i[s+0]=o[0],i[s+1]=o[4],i[s+2]=o[8]}return i}var Zst=new h,Qst=new Le,eat=new h;function fTe(e,t,n){let i=new Array(t),r=xt.getAttributeBySemantic(e,Lo.TRANSLATION),o=xt.getAttributeBySemantic(e,Lo.ROTATION),s=xt.getAttributeBySemantic(e,Lo.SCALE),a=new h(-Number.MAX_VALUE,-Number.MAX_VALUE,-Number.MAX_VALUE),c=new h(Number.MAX_VALUE,Number.MAX_VALUE,Number.MAX_VALUE),u=l(r),f=l(o),d=l(s),p=u?r.typedArray:new Float32Array(t*3),g=f?o.typedArray:new Float32Array(t*4);f&&o.normalized&&(g=cn.dequantize(g,o.componentDatatype,o.type,t));let m;d?m=s.typedArray:(m=new Float32Array(t*3),m.fill(1));for(let A=0;A<t;A++){let b=new h(p[A*3],p[A*3+1],p[A*3+2],Zst);h.maximumByComponent(a,b,a),h.minimumByComponent(c,b,c);let x=new Le(g[A*4],g[A*4+1],g[A*4+2],f?g[A*4+3]:1,Qst),T=new h(m[A*3],m[A*3+1],m[A*3+2],eat),E=N.fromTranslationQuaternionRotationScale(b,x,T,new N);i[A]=E}let y=n.runtimeNode;return y.instancingTranslationMin=c,y.instancingTranslationMax=a,u&&(r.typedArray=void 0),f&&(o.typedArray=void 0),d&&(s.typedArray=void 0),i}function tat(e,t,n){let i=new Array(t),r=e.typedArray,o=new h(Number.MAX_VALUE,Number.MAX_VALUE,Number.MAX_VALUE),s=new h(-Number.MAX_VALUE,-Number.MAX_VALUE,-Number.MAX_VALUE);for(let c=0;c<t;c++){let u=new h(r[c*3],r[c*3+1],r[c*3+2]);i[c]=u,h.minimumByComponent(o,u,o),h.maximumByComponent(s,u,s)}let a=n.runtimeNode;return a.instancingTranslationMin=o,a.instancingTranslationMax=s,e.typedArray=void 0,i}function BZ(e,t){let n=tt.createVertexBuffer({context:t.context,typedArray:e,usage:Me.STATIC_DRAW});return n.vertexArrayDestroyable=!1,n}function nat(e,t,n,i,r,o){let s=xt.getAttributeBySemantic(n,Lo.ROTATION);l(s)||o?iat(e,n,i,t,r,o):rat(e,n,i,t,r)}function iat(e,t,n,i,r,o){let s=e.shaderBuilder,a=t.attributes[0].count,c=e.model,u=e.runtimeNode;s.addDefine("HAS_INSTANCE_MATRICES");let f="Transform",d,p=u.instancingTransformsBuffer;if(!l(p)){d=fTe(t,a,e);let A=FZ(d);p=BZ(A,i),c._modelResources.push(p),o&&(u.transformsTypedArray=A),u.instancingTransformsBuffer=p}if(oTe(e,p,n,f),!r)return;let g=Je(i);g.mode=re.COLUMBUS_VIEW,uTe(e,g);let m=u.instancingTransformsBuffer2D;if(!l(m)){let A=Yst(d,e,g,d),b=FZ(A);m=BZ(b,i),c._modelResources.push(m),u.instancingTransformsBuffer2D=m}oTe(e,m,n,"Transform2D")}function rat(e,t,n,i,r,o){let s=e.shaderBuilder,a=e.runtimeNode,c=xt.getAttributeBySemantic(t,Lo.TRANSLATION),u=xt.getAttributeBySemantic(t,Lo.SCALE);if(l(u)&&(s.addDefine("HAS_INSTANCE_SCALE"),LZ(e,u.buffer,u.byteOffset,u.byteStride,n,"Scale")),!l(c))return;let f,d=c.typedArray;if(l(d)?f=tat(c,c.count,e):l(a.instancingTranslationMin)||(a.instancingTranslationMin=c.min,a.instancingTranslationMax=c.max),s.addDefine("HAS_INSTANCE_TRANSLATION"),LZ(e,c.buffer,c.byteOffset,c.byteStride,n,"Translation"),!r&&!o)return;let g=Je(i);g.mode=re.COLUMBUS_VIEW,uTe(e,g);let m=a.instancingTranslationBuffer2D;if(!l(m)){let x=Xst(f,e,g,f),T=Jst(x);o&&(a.transformsTypedArray=T),m=BZ(T,i),e.model._modelResources.push(m),a.instancingTranslationBuffer2D=m}if(!r)return;LZ(e,m,0,void 0,n,"Translation2D")}function oTe(e,t,n,i){let o=Y.getSizeInBytes(Y.FLOAT),s=o*12,a=[{index:e.attributeIndex++,vertexBuffer:t,componentsPerAttribute:4,componentDatatype:Y.FLOAT,normalize:!1,offsetInBytes:0,strideInBytes:s,instanceDivisor:1},{index:e.attributeIndex++,vertexBuffer:t,componentsPerAttribute:4,componentDatatype:Y.FLOAT,normalize:!1,offsetInBytes:o*4,strideInBytes:s,instanceDivisor:1},{index:e.attributeIndex++,vertexBuffer:t,componentsPerAttribute:4,componentDatatype:Y.FLOAT,normalize:!1,offsetInBytes:o*8,strideInBytes:s,instanceDivisor:1}],c=e.shaderBuilder;c.addAttribute("vec4",`a_instancing${i}Row0`),c.addAttribute("vec4",`a_instancing${i}Row1`),c.addAttribute("vec4",`a_instancing${i}Row2`),Zn(n,a)}function LZ(e,t,n,i,r,o){r.push({index:e.attributeIndex++,vertexBuffer:t,componentsPerAttribute:3,componentDatatype:Y.FLOAT,normalize:!1,offsetInBytes:n,strideInBytes:i,instanceDivisor:1}),e.shaderBuilder.addAttribute("vec3",`a_instance${o}`)}function oat(e,t,n,i){let r=n.attributes,o=e.shaderBuilder;for(let s=0;s<r.length;s++){let a=r[s];a.semantic===Lo.FEATURE_ID&&(a.setIndex>=e.featureIdVertexAttributeSetIndex&&(e.featureIdVertexAttributeSetIndex=a.setIndex+1),i.push({index:e.attributeIndex++,vertexBuffer:a.buffer,componentsPerAttribute:Vt.getNumberOfComponents(a.type),componentDatatype:a.componentDatatype,normalize:!1,offsetInBytes:a.byteOffset,strideInBytes:a.byteStride,instanceDivisor:1}),o.addAttribute("float",`a_instanceFeatureId_${a.setIndex}`))}}var PB=sTe;var dTe=[],kZ={};kZ.name="ModelMatrixUpdateStage";kZ.update=function(e,t,n){let i=n.mode!==re.SCENE3D;if(!(i&&t._model._projectTo2D)&&e._transformDirty){if(!e.show)return;let r=i?t._computedModelMatrix2D:t._computedModelMatrix;hTe(e,t,r,e.transformToRoot,0),e._transformDirty=!1}};function sat(e,t,n){e.modelMatrix=N.multiplyTransformation(t,n,e.modelMatrix),e.cullFace=xt.getCullFace(e.modelMatrix,e.primitiveType)}function hTe(e,t,n,i,r){let o,s=dTe[r];l(s)||(s=dTe[r]=new N),i=N.multiplyTransformation(i,e.transform,s),e.updateComputedTransform();let a=e.runtimePrimitives.length;for(o=0;o<a;o++){let u=e.runtimePrimitives[o];sat(u.drawCommand,n,i)}let c=e.children.length;for(o=0;o<c;o++){let u=t._runtimeNodes[e.children[o]];if(u._transformToRoot=N.clone(i,u._transformToRoot),!u.show){u._transformDirty=!0;continue}hTe(u,t,n,i,r+1),u._transformDirty=!1}}var DB=kZ;var mTe={name:"NodeStatisticsPipelineStage",_countInstancingAttributes:pTe,_countGeneratedBuffers:gTe};mTe.process=function(e,t,n){let i=e.model.statistics,r=t.instances,o=e.runtimeNode;pTe(i,r),gTe(i,o)};function pTe(e,t){if(!l(t))return;let n=t.attributes,i=n.length;for(let r=0;r<i;r++){let o=n[r];l(o.buffer)&&e.addBuffer(o.buffer,!1)}}function gTe(e,t){l(t.instancingTransformsBuffer)&&e.addBuffer(t.instancingTransformsBuffer,!1),l(t.instancingTransformsBuffer2D)&&e.addBuffer(t.instancingTransformsBuffer2D,!1),l(t.instancingTranslationBuffer2D)&&e.addBuffer(t.instancingTranslationBuffer2D,!1)}var RB=mTe;function hw(e){e=e??H.EMPTY_OBJECT;let t=e.node,n=e.transform,i=e.transformToRoot,r=e.sceneGraph,o=e.children;this._node=t,this._name=t.name,this._id=t.index,this._sceneGraph=r,this._children=o,this._originalTransform=N.clone(n,this._originalTransform),this._transform=N.clone(n,this._transform),this._transformToRoot=N.clone(i,this._transformToRoot),this._computedTransform=new N,this._transformDirty=!1,this._transformParameters=void 0,this._morphWeights=[],this._runtimeSkin=void 0,this._computedJointMatrices=[],this.show=!0,this.userAnimated=!1,this.pipelineStages=[],this.runtimePrimitives=[],this.updateStages=[],this.instancingTranslationMin=void 0,this.instancingTranslationMax=void 0,this.instancingTransformsBuffer=void 0,this.instancingTransformsBuffer2D=void 0,this.instancingTranslationBuffer2D=void 0,this.instancingReferencePoint2D=void 0,aat(this)}Object.defineProperties(hw.prototype,{node:{get:function(){return this._node}},sceneGraph:{get:function(){return this._sceneGraph}},children:{get:function(){return this._children}},transform:{get:function(){return this._transform},set:function(e){this._transformDirty=!0,this._transform=N.clone(e,this._transform)}},transformToRoot:{get:function(){return this._transformToRoot}},computedTransform:{get:function(){return this._computedTransform}},originalTransform:{get:function(){return this._originalTransform}},translation:{get:function(){return l(this._transformParameters)?this._transformParameters.translation:void 0},set:function(e){let t=this._transformParameters,n=t.translation;h.equals(n,e)||(t.translation=h.clone(e,t.translation),UZ(this,t))}},rotation:{get:function(){return l(this._transformParameters)?this._transformParameters.rotation:void 0},set:function(e){let t=this._transformParameters,n=t.rotation;Le.equals(n,e)||(t.rotation=Le.clone(e,t.rotation),UZ(this,t))}},scale:{get:function(){return l(this._transformParameters)?this._transformParameters.scale:void 0},set:function(e){let t=this._transformParameters,n=t.scale;h.equals(n,e)||(t.scale=h.clone(e,t.scale),UZ(this,t))}},morphWeights:{get:function(){return this._morphWeights},set:function(e){let t=e.length;for(let n=0;n<t;n++)this._morphWeights[n]=e[n]}},runtimeSkin:{get:function(){return this._runtimeSkin}},computedJointMatrices:{get:function(){return this._computedJointMatrices}}});function aat(e){let t=e.transform,n=e.transformToRoot,i=e._computedTransform;e._computedTransform=N.multiply(n,t,i);let r=e.node;l(r.matrix)||(e._transformParameters=new Zy(r.translation,r.rotation,r.scale)),l(r.morphWeights)&&(e._morphWeights=r.morphWeights.slice());let o=r.articulationName;if(l(o)){let c=e.sceneGraph._runtimeArticulations[o];l(c)&&c.runtimeNodes.push(e)}}function UZ(e,t){e._transformDirty=!0,e._transform=N.fromTranslationRotationScale(t,e._transform)}hw.prototype.getChild=function(e){return this.sceneGraph._runtimeNodes[this.children[e]]};hw.prototype.configurePipeline=function(){let e=this.node,t=this.pipelineStages;t.length=0;let n=this.updateStages;n.length=0,l(e.instances)&&t.push(PB),t.push(RB),n.push(DB)};hw.prototype.updateComputedTransform=function(){this._computedTransform=N.multiply(this._transformToRoot,this._transform,this._computedTransform)};hw.prototype.updateJointMatrices=function(){let e=this._runtimeSkin;if(!l(e))return;e.updateJointMatrices();let t=this._computedJointMatrices,n=e.jointMatrices,i=n.length;for(let r=0;r<i;r++){l(t[r])||(t[r]=new N);let o=N.multiplyTransformation(this.transformToRoot,this.transform,t[r]),s=N.inverseTransformation(o,t[r]);t[r]=N.multiplyTransformation(s,n[r],t[r])}};var OB=hw;var _Te={name:"AlphaPipelineStage"};_Te.process=function(e,t,n){let i=e.alphaOptions,r=e.model;i.pass=i.pass??r.opaquePass;let o=e.renderStateOptions;i.pass===Ie.TRANSLUCENT&&(o.cull.enabled=!1,o.depthMask=!1,o.blending=tn.ALPHA_BLEND);let s=e.shaderBuilder,a=e.uniformMap;l(i.alphaCutoff)&&(s.addDefine("ALPHA_MODE_MASK",void 0,de.FRAGMENT),s.addUniform("float","u_alphaCutoff",de.FRAGMENT),a.u_alphaCutoff=function(){return i.alphaCutoff})};var MB=_Te;var yTe={name:"BatchTexturePipelineStage"};yTe.process=function(e,t,n){let i=e.shaderBuilder,r={},o=e.model,s=o.featureTables[o.featureTableId],a=s.featuresLength;i.addUniform("int","model_featuresLength"),r.model_featuresLength=function(){return a};let c=s.batchTexture;i.addUniform("sampler2D","model_batchTexture"),r.model_batchTexture=function(){return c.batchTexture??c.defaultTexture},i.addUniform("vec4","model_textureStep"),r.model_textureStep=function(){return c.textureStep},c.textureDimensions.y>1&&(i.addDefine("MULTILINE_BATCH_TEXTURE"),i.addUniform("vec2","model_textureDimensions"),r.model_textureDimensions=function(){return c.textureDimensions}),e.uniformMap=Ot(r,e.uniformMap)};var NB=yTe;var ATe={name:"ClassificationPipelineStage"};ATe.process=function(e,t,n){e.shaderBuilder.addDefine("HAS_CLASSIFICATION",void 0,de.BOTH);let r=e.runtimePrimitive;l(r.batchLengths)||cat(t,r)};function cat(e,t){let n=xt.getAttributeBySemantic(e,ct.POSITION);if(!l(n))throw new oe("Primitives must have a position attribute to be used for classification.");let i,r=e.indices,o=l(r);o&&(i=r.typedArray,r.typedArray=void 0);let s=o?r.count:n.count,a=xt.getAttributeBySemantic(e,ct.FEATURE_ID,0);if(!l(a)){t.batchLengths=[s],t.batchOffsets=[0];return}let c=a.typedArray;a.typedArray=void 0;let u=[],f=[0],d=o?i[0]:0,p=c[d],g=0;for(let y=1;y<s;y++){let A=o?i[y]:y,b=c[A];if(b!==p){let x=y-g,T=y;u.push(x),f.push(T),g=T,p=b}}let m=s-g;u.push(m),t.batchLengths=u,t.batchOffsets=f}var LB=ATe;var FB=`void filterByPassType(inout vec3 positionMC, vec4 featureColor) { bool styleTranslucent = (featureColor.a != 1.0); if (czm_pass == czm_passTranslucent && !styleTranslucent && !model_commandTranslucent) @@ -8587,7 +8584,7 @@ positionMC *= show; filterByPassType(positionMC, feature.color); #endif } -`;var GF=`void filterByPassType(vec4 featureColor) +`;var BB=`void filterByPassType(vec4 featureColor) { bool styleTranslucent = (featureColor.a != 1.0); if (czm_pass == czm_passTranslucent && !styleTranslucent && !model_commandTranslucent) @@ -8624,7 +8621,7 @@ material.diffuse *= mix(featureColor.rgb, vec3(1.0), highlight); #endif material.alpha *= featureColor.a; } -`;var tAe={name:"CPUStylingPipelineStage"};tAe.process=function(e,t,n){let i=e.model,r=e.shaderBuilder;r.addVertexLines(HF),r.addFragmentLines(GF),r.addDefine("USE_CPU_STYLING",void 0,de.BOTH),l(i.color)||(r.addUniform("float",EA.COLOR_BLEND_UNIFORM_NAME,de.FRAGMENT),e.uniformMap[EA.COLOR_BLEND_UNIFORM_NAME]=function(){return ll.getColorBlend(i.colorBlendMode,i.colorBlendAmount)}),r.addUniform("bool","model_commandTranslucent",de.BOTH),e.uniformMap.model_commandTranslucent=function(){return e.alphaOptions.pass===Ie.TRANSLUCENT}};var WF=tAe;var $J={MODIFY_MATERIAL:"MODIFY_MATERIAL",REPLACE_MATERIAL:"REPLACE_MATERIAL"};$J.getDefineName=function(e){return`CUSTOM_SHADER_${e}`};Object.freeze($J);var Zg=$J;var qF=`void customShaderStage( +`;var bTe={name:"CPUStylingPipelineStage"};bTe.process=function(e,t,n){let i=e.model,r=e.shaderBuilder;r.addVertexLines(FB),r.addFragmentLines(BB),r.addDefine("USE_CPU_STYLING",void 0,de.BOTH),l(i.color)||(r.addUniform("float",vA.COLOR_BLEND_UNIFORM_NAME,de.FRAGMENT),e.uniformMap[vA.COLOR_BLEND_UNIFORM_NAME]=function(){return sl.getColorBlend(i.colorBlendMode,i.colorBlendAmount)}),r.addUniform("bool","model_commandTranslucent",de.BOTH),e.uniformMap.model_commandTranslucent=function(){return e.alphaOptions.pass===Ie.TRANSLUCENT}};var kB=bTe;var zZ={MODIFY_MATERIAL:"MODIFY_MATERIAL",REPLACE_MATERIAL:"REPLACE_MATERIAL"};zZ.getDefineName=function(e){return`CUSTOM_SHADER_${e}`};Object.freeze(zZ);var r_=zZ;var UB=`void customShaderStage( inout czm_modelVertexOutput vsOutput, inout ProcessedAttributes attributes, FeatureIds featureIds, @@ -8641,7 +8638,7 @@ vsInput.metadataStatistics = metadataStatistics; vertexMain(vsInput, vsOutput); attributes.positionMC = vsOutput.positionMC; } -`;var YF=`void customShaderStage( +`;var zB=`void customShaderStage( inout czm_modelMaterial material, ProcessedAttributes attributes, FeatureIds featureIds, @@ -8657,17 +8654,17 @@ fsInput.metadataClass = metadataClass; fsInput.metadataStatistics = metadataStatistics; fragmentMain(fsInput, material); } -`;var XF=`void featureIdStage(out FeatureIds featureIds, ProcessedAttributes attributes) { +`;var VB=`void featureIdStage(out FeatureIds featureIds, ProcessedAttributes attributes) { initializeFeatureIds(featureIds, attributes); initializeFeatureIdAliases(featureIds); } -`;var KF=`void featureIdStage(out FeatureIds featureIds, ProcessedAttributes attributes) +`;var jB=`void featureIdStage(out FeatureIds featureIds, ProcessedAttributes attributes) { initializeFeatureIds(featureIds, attributes); initializeFeatureIdAliases(featureIds); setFeatureIdVaryings(); } -`;var hr={name:"FeatureIdPipelineStage",STRUCT_ID_FEATURE_IDS_VS:"FeatureIdsVS",STRUCT_ID_FEATURE_IDS_FS:"FeatureIdsFS",STRUCT_NAME_FEATURE_IDS:"FeatureIds",FUNCTION_ID_INITIALIZE_FEATURE_IDS_VS:"initializeFeatureIdsVS",FUNCTION_ID_INITIALIZE_FEATURE_IDS_FS:"initializeFeatureIdsFS",FUNCTION_ID_INITIALIZE_FEATURE_ID_ALIASES_VS:"initializeFeatureIdAliasesVS",FUNCTION_ID_INITIALIZE_FEATURE_ID_ALIASES_FS:"initializeFeatureIdAliasesFS",FUNCTION_SIGNATURE_INITIALIZE_FEATURE_IDS:"void initializeFeatureIds(out FeatureIds featureIds, ProcessedAttributes attributes)",FUNCTION_SIGNATURE_INITIALIZE_FEATURE_ID_ALIASES:"void initializeFeatureIdAliases(inout FeatureIds featureIds)",FUNCTION_ID_SET_FEATURE_ID_VARYINGS:"setFeatureIdVaryings",FUNCTION_SIGNATURE_SET_FEATURE_ID_VARYINGS:"void setFeatureIdVaryings()"};hr.process=function(e,t,n){let i=e.shaderBuilder;xit(i);let r=e.runtimeNode.node.instances;l(r)&&Tit(e,r,n),Eit(e,t,n),i.addVertexLines(KF),i.addFragmentLines(XF)};function xit(e){e.addStruct(hr.STRUCT_ID_FEATURE_IDS_VS,hr.STRUCT_NAME_FEATURE_IDS,de.VERTEX),e.addStruct(hr.STRUCT_ID_FEATURE_IDS_FS,hr.STRUCT_NAME_FEATURE_IDS,de.FRAGMENT),e.addFunction(hr.FUNCTION_ID_INITIALIZE_FEATURE_IDS_VS,hr.FUNCTION_SIGNATURE_INITIALIZE_FEATURE_IDS,de.VERTEX),e.addFunction(hr.FUNCTION_ID_INITIALIZE_FEATURE_IDS_FS,hr.FUNCTION_SIGNATURE_INITIALIZE_FEATURE_IDS,de.FRAGMENT),e.addFunction(hr.FUNCTION_ID_INITIALIZE_FEATURE_ID_ALIASES_VS,hr.FUNCTION_SIGNATURE_INITIALIZE_FEATURE_ID_ALIASES,de.VERTEX),e.addFunction(hr.FUNCTION_ID_INITIALIZE_FEATURE_ID_ALIASES_FS,hr.FUNCTION_SIGNATURE_INITIALIZE_FEATURE_ID_ALIASES,de.FRAGMENT),e.addFunction(hr.FUNCTION_ID_SET_FEATURE_ID_VARYINGS,hr.FUNCTION_SIGNATURE_SET_FEATURE_ID_VARYINGS,de.VERTEX)}function Tit(e,t,n){let i=t.featureIds,r=t.attributes[0].count;for(let o=0;o<i.length;o++){let s=i[o],a=s.positionalLabel;s instanceof Cn.FeatureIdAttribute?Cit(e,s,a):nAe(e,s,a,r,1,n);let c=s.label;l(c)&&iAe(e,a,c,de.BOTH)}}function Eit(e,t,n){let i=t.featureIds,o=xt.getAttributeBySemantic(t,ct.POSITION).count;for(let s=0;s<i.length;s++){let a=i[s],c=a.positionalLabel,u=de.BOTH;a instanceof Cn.FeatureIdAttribute?vit(e,a,c):a instanceof Cn.FeatureIdImplicitRange?nAe(e,a,c,o,void 0,n):(Sit(e,a,c,s,n),u=de.FRAGMENT);let f=a.label;l(f)&&iAe(e,c,f,u)}}function Cit(e,t,n){let i=e.shaderBuilder;i.addStructField(hr.STRUCT_ID_FEATURE_IDS_VS,"int",n),i.addStructField(hr.STRUCT_ID_FEATURE_IDS_FS,"int",n);let r=t.setIndex,o=n.replace(/_\d+$/,"_"),s=`a_${o}${r}`,a=`v_${o}${r}`,c=`featureIds.${n} = int(czm_round(${s}));`,u=`featureIds.${n} = int(czm_round(${a}));`;i.addFunctionLines(hr.FUNCTION_ID_INITIALIZE_FEATURE_IDS_VS,[c]),i.addFunctionLines(hr.FUNCTION_ID_INITIALIZE_FEATURE_IDS_FS,[u]),i.addVarying("float",a),i.addFunctionLines(hr.FUNCTION_ID_SET_FEATURE_ID_VARYINGS,[`${a} = ${s};`])}function vit(e,t,n){let i=e.shaderBuilder;i.addStructField(hr.STRUCT_ID_FEATURE_IDS_VS,"int",n),i.addStructField(hr.STRUCT_ID_FEATURE_IDS_FS,"int",n);let r=t.setIndex,o=n.replace(/_\d+$/,"_"),s=[`featureIds.${n} = int(czm_round(attributes.${o}${r}));`];i.addFunctionLines(hr.FUNCTION_ID_INITIALIZE_FEATURE_IDS_VS,s),i.addFunctionLines(hr.FUNCTION_ID_INITIALIZE_FEATURE_IDS_FS,s)}function nAe(e,t,n,i,r,o){wit(e,t,i,r,o);let s=e.shaderBuilder,a=`a_implicit_${n}`;s.addAttribute("float",a);let c=`v_implicit_${n}`;s.addVarying("float",c),s.addStructField(hr.STRUCT_ID_FEATURE_IDS_VS,"int",n),s.addStructField(hr.STRUCT_ID_FEATURE_IDS_FS,"int",n),s.addFunctionLines(hr.FUNCTION_ID_SET_FEATURE_ID_VARYINGS,[`${c} = ${a};`]),s.addFunctionLines(hr.FUNCTION_ID_INITIALIZE_FEATURE_IDS_VS,[`featureIds.${n} = int(czm_round(${a}));`]),s.addFunctionLines(hr.FUNCTION_ID_INITIALIZE_FEATURE_IDS_FS,[`featureIds.${n} = int(czm_round(${c}));`])}function Sit(e,t,n,i,r){let o=`u_featureIdTexture_${i}`,s=e.uniformMap,a=t.textureReader;s[o]=function(){return a.texture??r.context.defaultTexture};let c=a.channels,u=e.shaderBuilder;u.addStructField(hr.STRUCT_ID_FEATURE_IDS_FS,"int",n),u.addUniform("sampler2D",o,de.FRAGMENT);let d=`v_texCoord_${a.texCoord}`,p=d,g=a.transform;if(l(g)&&!$.equals(g,$.IDENTITY)){let A=`${o}Transform`;u.addUniform("mat3",A,de.FRAGMENT),s[A]=function(){return g},p=`vec2(${A} * vec3(${d}, 1.0))`}let m=`texture(${o}, ${p}).${c}`,y=`featureIds.${n} = czm_unpackUint(${m});`;u.addFunctionLines(hr.FUNCTION_ID_INITIALIZE_FEATURE_IDS_FS,[y])}function iAe(e,t,n,i){let r=e.shaderBuilder,o=de.includesVertexShader(i);o&&r.addStructField(hr.STRUCT_ID_FEATURE_IDS_VS,"int",n),r.addStructField(hr.STRUCT_ID_FEATURE_IDS_FS,"int",n);let s=[`featureIds.${n} = featureIds.${t};`];o&&r.addFunctionLines(hr.FUNCTION_ID_INITIALIZE_FEATURE_ID_ALIASES_VS,s),r.addFunctionLines(hr.FUNCTION_ID_INITIALIZE_FEATURE_ID_ALIASES_FS,s)}function wit(e,t,n,i,r){let o=e.model,s,a;if(l(t.repeat)){let u=Iit(t,n);s=tt.createVertexBuffer({context:r.context,typedArray:u,usage:Me.STATIC_DRAW}),s.vertexArrayDestroyable=!1,o._pipelineResources.push(s),o.statistics.addBuffer(s,!1)}else a=[t.offset];let c={index:e.attributeIndex++,instanceDivisor:i,value:a,vertexBuffer:s,normalize:!1,componentsPerAttribute:1,componentDatatype:Y.FLOAT,strideInBytes:Y.getSizeInBytes(Y.FLOAT),offsetInBytes:0};e.attributes.push(c)}function Iit(e,t){let n=e.offset,i=e.repeat,r=new Float32Array(t);for(let o=0;o<t;o++)r[o]=n+Math.floor(o/i);return r}var CA=hr;var $F=`void metadataStage( +`;var mr={name:"FeatureIdPipelineStage",STRUCT_ID_FEATURE_IDS_VS:"FeatureIdsVS",STRUCT_ID_FEATURE_IDS_FS:"FeatureIdsFS",STRUCT_NAME_FEATURE_IDS:"FeatureIds",FUNCTION_ID_INITIALIZE_FEATURE_IDS_VS:"initializeFeatureIdsVS",FUNCTION_ID_INITIALIZE_FEATURE_IDS_FS:"initializeFeatureIdsFS",FUNCTION_ID_INITIALIZE_FEATURE_ID_ALIASES_VS:"initializeFeatureIdAliasesVS",FUNCTION_ID_INITIALIZE_FEATURE_ID_ALIASES_FS:"initializeFeatureIdAliasesFS",FUNCTION_SIGNATURE_INITIALIZE_FEATURE_IDS:"void initializeFeatureIds(out FeatureIds featureIds, ProcessedAttributes attributes)",FUNCTION_SIGNATURE_INITIALIZE_FEATURE_ID_ALIASES:"void initializeFeatureIdAliases(inout FeatureIds featureIds)",FUNCTION_ID_SET_FEATURE_ID_VARYINGS:"setFeatureIdVaryings",FUNCTION_SIGNATURE_SET_FEATURE_ID_VARYINGS:"void setFeatureIdVaryings()"};mr.process=function(e,t,n){let i=e.shaderBuilder;lat(i);let r=e.runtimeNode.node.instances;l(r)&&uat(e,r,n),fat(e,t,n),i.addVertexLines(jB),i.addFragmentLines(VB)};function lat(e){e.addStruct(mr.STRUCT_ID_FEATURE_IDS_VS,mr.STRUCT_NAME_FEATURE_IDS,de.VERTEX),e.addStruct(mr.STRUCT_ID_FEATURE_IDS_FS,mr.STRUCT_NAME_FEATURE_IDS,de.FRAGMENT),e.addFunction(mr.FUNCTION_ID_INITIALIZE_FEATURE_IDS_VS,mr.FUNCTION_SIGNATURE_INITIALIZE_FEATURE_IDS,de.VERTEX),e.addFunction(mr.FUNCTION_ID_INITIALIZE_FEATURE_IDS_FS,mr.FUNCTION_SIGNATURE_INITIALIZE_FEATURE_IDS,de.FRAGMENT),e.addFunction(mr.FUNCTION_ID_INITIALIZE_FEATURE_ID_ALIASES_VS,mr.FUNCTION_SIGNATURE_INITIALIZE_FEATURE_ID_ALIASES,de.VERTEX),e.addFunction(mr.FUNCTION_ID_INITIALIZE_FEATURE_ID_ALIASES_FS,mr.FUNCTION_SIGNATURE_INITIALIZE_FEATURE_ID_ALIASES,de.FRAGMENT),e.addFunction(mr.FUNCTION_ID_SET_FEATURE_ID_VARYINGS,mr.FUNCTION_SIGNATURE_SET_FEATURE_ID_VARYINGS,de.VERTEX)}function uat(e,t,n){let i=t.featureIds,r=t.attributes[0].count;for(let o=0;o<i.length;o++){let s=i[o],a=s.positionalLabel;s instanceof Cn.FeatureIdAttribute?dat(e,s,a):xTe(e,s,a,r,1,n);let c=s.label;l(c)&&TTe(e,a,c,de.BOTH)}}function fat(e,t,n){let i=t.featureIds,o=xt.getAttributeBySemantic(t,ct.POSITION).count;for(let s=0;s<i.length;s++){let a=i[s],c=a.positionalLabel,u=de.BOTH;a instanceof Cn.FeatureIdAttribute?hat(e,a,c):a instanceof Cn.FeatureIdImplicitRange?xTe(e,a,c,o,void 0,n):(mat(e,a,c,s,n),u=de.FRAGMENT);let f=a.label;l(f)&&TTe(e,c,f,u)}}function dat(e,t,n){let i=e.shaderBuilder;i.addStructField(mr.STRUCT_ID_FEATURE_IDS_VS,"int",n),i.addStructField(mr.STRUCT_ID_FEATURE_IDS_FS,"int",n);let r=t.setIndex,o=n.replace(/_\d+$/,"_"),s=`a_${o}${r}`,a=`v_${o}${r}`,c=`featureIds.${n} = int(czm_round(${s}));`,u=`featureIds.${n} = int(czm_round(${a}));`;i.addFunctionLines(mr.FUNCTION_ID_INITIALIZE_FEATURE_IDS_VS,[c]),i.addFunctionLines(mr.FUNCTION_ID_INITIALIZE_FEATURE_IDS_FS,[u]),i.addVarying("float",a),i.addFunctionLines(mr.FUNCTION_ID_SET_FEATURE_ID_VARYINGS,[`${a} = ${s};`])}function hat(e,t,n){let i=e.shaderBuilder;i.addStructField(mr.STRUCT_ID_FEATURE_IDS_VS,"int",n),i.addStructField(mr.STRUCT_ID_FEATURE_IDS_FS,"int",n);let r=t.setIndex,o=n.replace(/_\d+$/,"_"),s=[`featureIds.${n} = int(czm_round(attributes.${o}${r}));`];i.addFunctionLines(mr.FUNCTION_ID_INITIALIZE_FEATURE_IDS_VS,s),i.addFunctionLines(mr.FUNCTION_ID_INITIALIZE_FEATURE_IDS_FS,s)}function xTe(e,t,n,i,r,o){pat(e,t,i,r,o);let s=e.shaderBuilder,a=`a_implicit_${n}`;s.addAttribute("float",a);let c=`v_implicit_${n}`;s.addVarying("float",c),s.addStructField(mr.STRUCT_ID_FEATURE_IDS_VS,"int",n),s.addStructField(mr.STRUCT_ID_FEATURE_IDS_FS,"int",n),s.addFunctionLines(mr.FUNCTION_ID_SET_FEATURE_ID_VARYINGS,[`${c} = ${a};`]),s.addFunctionLines(mr.FUNCTION_ID_INITIALIZE_FEATURE_IDS_VS,[`featureIds.${n} = int(czm_round(${a}));`]),s.addFunctionLines(mr.FUNCTION_ID_INITIALIZE_FEATURE_IDS_FS,[`featureIds.${n} = int(czm_round(${c}));`])}function mat(e,t,n,i,r){let o=`u_featureIdTexture_${i}`,s=e.uniformMap,a=t.textureReader;s[o]=function(){return a.texture??r.context.defaultTexture};let c=a.channels,u=e.shaderBuilder;u.addStructField(mr.STRUCT_ID_FEATURE_IDS_FS,"int",n),u.addUniform("sampler2D",o,de.FRAGMENT);let d=`v_texCoord_${a.texCoord}`,p=d,g=a.transform;if(l(g)&&!$.equals(g,$.IDENTITY)){let A=`${o}Transform`;u.addUniform("mat3",A,de.FRAGMENT),s[A]=function(){return g},p=`vec2(${A} * vec3(${d}, 1.0))`}let m=`texture(${o}, ${p}).${c}`,y=`featureIds.${n} = czm_unpackUint(${m});`;u.addFunctionLines(mr.FUNCTION_ID_INITIALIZE_FEATURE_IDS_FS,[y])}function TTe(e,t,n,i){let r=e.shaderBuilder,o=de.includesVertexShader(i);o&&r.addStructField(mr.STRUCT_ID_FEATURE_IDS_VS,"int",n),r.addStructField(mr.STRUCT_ID_FEATURE_IDS_FS,"int",n);let s=[`featureIds.${n} = featureIds.${t};`];o&&r.addFunctionLines(mr.FUNCTION_ID_INITIALIZE_FEATURE_ID_ALIASES_VS,s),r.addFunctionLines(mr.FUNCTION_ID_INITIALIZE_FEATURE_ID_ALIASES_FS,s)}function pat(e,t,n,i,r){let o=e.model,s,a;if(l(t.repeat)){let u=gat(t,n);s=tt.createVertexBuffer({context:r.context,typedArray:u,usage:Me.STATIC_DRAW}),s.vertexArrayDestroyable=!1,o._pipelineResources.push(s),o.statistics.addBuffer(s,!1)}else a=[t.offset];let c={index:e.attributeIndex++,instanceDivisor:i,value:a,vertexBuffer:s,normalize:!1,componentsPerAttribute:1,componentDatatype:Y.FLOAT,strideInBytes:Y.getSizeInBytes(Y.FLOAT),offsetInBytes:0};e.attributes.push(c)}function gat(e,t){let n=e.offset,i=e.repeat,r=new Float32Array(t);for(let o=0;o<t;o++)r[o]=n+Math.floor(o/i);return r}var SA=mr;var HB=`void metadataStage( FeatureIds featureIds, out Metadata metadata, out MetadataClass metadataClass, @@ -8677,7 +8674,7 @@ ProcessedAttributes attributes { initializeMetadata(featureIds, metadata, metadataClass, metadataStatistics, attributes); } -`;var JF=`void metadataStage( +`;var GB=`void metadataStage( FeatureIds featureIds, out Metadata metadata, out MetadataClass metadataClass, @@ -8688,7 +8685,7 @@ ProcessedAttributes attributes initializeMetadata(featureIds, metadata, metadataClass, metadataStatistics, attributes); setMetadataVaryings(); } -`;var Di={name:"MetadataPipelineStage",STRUCT_ID_METADATA_VS:"MetadataVS",STRUCT_ID_METADATA_FS:"MetadataFS",STRUCT_NAME_METADATA:"Metadata",STRUCT_ID_METADATA_CLASS_VS:"MetadataClassVS",STRUCT_ID_METADATA_CLASS_FS:"MetadataClassFS",STRUCT_NAME_METADATA_CLASS:"MetadataClass",STRUCT_ID_METADATA_STATISTICS_VS:"MetadataStatisticsVS",STRUCT_ID_METADATA_STATISTICS_FS:"MetadataStatisticsFS",STRUCT_NAME_METADATA_STATISTICS:"MetadataStatistics",FUNCTION_ID_INITIALIZE_METADATA_VS:"initializeMetadataVS",FUNCTION_ID_INITIALIZE_METADATA_FS:"initializeMetadataFS",FUNCTION_SIGNATURE_INITIALIZE_METADATA:"void initializeMetadata(FeatureIds featureIds, out Metadata metadata, out MetadataClass metadataClass, out MetadataStatistics metadataStatistics, ProcessedAttributes attributes)",FUNCTION_ID_SET_METADATA_VARYINGS:"setMetadataVaryings",FUNCTION_SIGNATURE_SET_METADATA_VARYINGS:"void setMetadataVaryings()",METADATA_CLASS_FIELDS:[{specName:"noData",shaderName:"noData"},{specName:"default",shaderName:"defaultValue"},{specName:"min",shaderName:"minValue"},{specName:"max",shaderName:"maxValue"}],METADATA_STATISTICS_FIELDS:[{specName:"min",shaderName:"minValue"},{specName:"max",shaderName:"maxValue"},{specName:"mean",shaderName:"mean",type:"float"},{specName:"median",shaderName:"median"},{specName:"standardDeviation",shaderName:"standardDeviation",type:"float"},{specName:"variance",shaderName:"variance",type:"float"},{specName:"sum",shaderName:"sum"}]};Di.process=function(e,t,n){let{shaderBuilder:i,model:r}=e,{structuralMetadata:o={},content:s}=r,a=s?.tileset.metadataExtension?.statistics,c=n.context.webgl2,u=Yit(r,t),f=Pit(o.propertyAttributes,t,a),d=Rit(o.propertyTextures,a),p=Nit(o.propertyTables,t,e,a,u),g=f.concat(d).concat(p);Bit(i,g),zit(i),i.addVertexLines(JF),i.addFragmentLines($F);for(let m=0;m<f.length;m++){let y=f[m];Vit(e,y)}for(let m=0;m<d.length;m++){let y=d[m];Hit(e,y,c)}for(let m=0;m<p.length;m++){let y=p[m];Wit(e,y,c)}};function Pit(e,t,n){return l(e)?e.flatMap(i=>Dit(i,t,n)):[]}function Dit(e,t,n){let{getAttributeByName:i,getAttributeInfo:r,sanitizeGlslIdentifier:o}=xt,s=e.class.id,a=n?.classes[s],c=Object.entries(e.properties),u=new Array(c.length);for(let f=0;f<c.length;f++){let[d,p]=c[f],g=i(t,p.attribute),{glslType:m,variableName:y}=r(g);u[f]={metadataVariable:o(d),property:p,classProperty:p.classProperty,type:p.classProperty.type,glslType:m,variableName:y,propertyStatistics:a?.properties[d],shaderDestination:de.BOTH}}return u}function Rit(e,t){return l(e)?e.flatMap(n=>Oit(n,t)):[]}function Oit(e,t){let{sanitizeGlslIdentifier:n}=xt,i=e.class.id,r=t?.classes[i],o=Object.entries(e.properties).filter(([a,c])=>{let u=c.textureReader.channels.length;return c.classProperty.isGpuCompatible(u)}),s=new Array(o.length);for(let a=0;a<o.length;a++){let[c,u]=o[a];s[a]={metadataVariable:n(c),property:u,classProperty:u.classProperty,type:u.classProperty.type,glslType:u.classProperty.getGlslType(),propertyStatistics:r?.properties[c],shaderDestination:de.FRAGMENT}}return s}var Mit=4;function Nit(e,t,n,i,r){if(!l(e))return[];let o=Fit(n,t);return e.filter(s=>l(s.class)&&o.has(String(s.id))).flatMap(s=>Lit(s,o,i,r))}function Lit(e,t,n,i){let{sanitizeGlslIdentifier:r}=xt,o=e.class,s=n?.classes[o.id],a=t.get(String(e.id))??{},c=a.shaderDestination??de.BOTH,u=e.properties,f=o.properties,d=[],p=0;for(let[g,m]of Object.entries(f)){if(!m.isGpuCompatible(Mit))continue;let y=u[g],A=de.intersection($it(g,i),c);if(A===de.NONE){p++;continue}d.push({metadataVariable:r(g),property:y,classProperty:m,type:m.type,glslType:m.getGlslType(),propertyStatistics:s?.properties[g],shaderDestination:A,propertyTable:e,featureIdVariableName:a.variableName,propertyInfoIndex:p}),p++}return d}function Fit(e,t){let n=new Map;function i(a,c){let u=a?.propertyTableId;if(!l(u))return;let f=String(u),d={variableName:a.positionalLabel,shaderDestination:c},p=n.get(f);l(p)&&console.warn(`Multiple feature ID sets reference the same property table ${u} in primitive. Only one will be used.`),n.set(f,d)}let r=t?.featureIds??[];for(let a=0;a<r.length;a++){let c=r[a],u=l(c?.textureReader);i(c,u?de.FRAGMENT:de.BOTH)}let s=e.runtimeNode?.node?.instances?.featureIds??[];for(let a=0;a<s.length;a++){let c=s[a];i(c,de.BOTH)}return n}function Bit(e,t){let n=new Set,i=new Set;for(let a=0;a<t.length;a++){let{type:c,glslType:u,propertyStatistics:f}=t[a];n.add(u),l(f)&&c!==bt.ENUM&&i.add(u)}let r=Di.METADATA_CLASS_FIELDS;for(let a of n){let c=`${a}MetadataClass`;s(c,a,r)}let o=Di.METADATA_STATISTICS_FIELDS;for(let a of i){let c=`${a}MetadataStatistics`;s(c,a,o)}function s(a,c,u){e.addStruct(a,a,de.BOTH);for(let f=0;f<u.length;f++){let{shaderName:d}=u[f],p=u[f].type==="float"?Uit(c):c;e.addStructField(a,p,d)}}}var kit={int:"float",ivec2:"vec2",ivec3:"vec3",ivec4:"vec4"};function Uit(e){let t=kit[e];return l(t)?t:e}function zit(e){e.addStruct(Di.STRUCT_ID_METADATA_VS,Di.STRUCT_NAME_METADATA,de.VERTEX),e.addStruct(Di.STRUCT_ID_METADATA_FS,Di.STRUCT_NAME_METADATA,de.FRAGMENT),e.addStruct(Di.STRUCT_ID_METADATA_CLASS_VS,Di.STRUCT_NAME_METADATA_CLASS,de.VERTEX),e.addStruct(Di.STRUCT_ID_METADATA_CLASS_FS,Di.STRUCT_NAME_METADATA_CLASS,de.FRAGMENT),e.addStruct(Di.STRUCT_ID_METADATA_STATISTICS_VS,Di.STRUCT_NAME_METADATA_STATISTICS,de.VERTEX),e.addStruct(Di.STRUCT_ID_METADATA_STATISTICS_FS,Di.STRUCT_NAME_METADATA_STATISTICS,de.FRAGMENT),e.addFunction(Di.FUNCTION_ID_INITIALIZE_METADATA_VS,Di.FUNCTION_SIGNATURE_INITIALIZE_METADATA,de.VERTEX),e.addFunction(Di.FUNCTION_ID_INITIALIZE_METADATA_FS,Di.FUNCTION_SIGNATURE_INITIALIZE_METADATA,de.FRAGMENT),e.addFunction(Di.FUNCTION_ID_SET_METADATA_VARYINGS,Di.FUNCTION_SIGNATURE_SET_METADATA_VARYINGS,de.VERTEX)}function Vit(e,t){jit(e,t),JJ(e.shaderBuilder,t),ZJ(e.shaderBuilder,t)}function jit(e,t){let{shaderBuilder:n}=e,{metadataVariable:i,property:r,glslType:o}=t,s=QJ({valueExpression:`attributes.${t.variableName}`,renderResources:e,glslType:o,metadataVariable:i,shaderDestination:de.BOTH,property:r});n.addStructField(Di.STRUCT_ID_METADATA_VS,o,i),n.addStructField(Di.STRUCT_ID_METADATA_FS,o,i);let a=`metadata.${i} = ${s};`;n.addFunctionLines(Di.FUNCTION_ID_INITIALIZE_METADATA_VS,[a]),n.addFunctionLines(Di.FUNCTION_ID_INITIALIZE_METADATA_FS,[a])}function Hit(e,t,n){Git(e,t,n),JJ(e.shaderBuilder,t),ZJ(e.shaderBuilder,t)}function Git(e,t,n){let{shaderBuilder:i,uniformMap:r}=e,{metadataVariable:o,glslType:s,property:a}=t,{texCoord:c,channels:u,index:f,texture:d,transform:p}=a.textureReader,g=`u_propertyTexture_${f}`,m=[];r.hasOwnProperty(g)||(i.addUniform("sampler2D",g,de.FRAGMENT),r[g]=()=>d),i.addStructField(Di.STRUCT_ID_METADATA_FS,s,o);let y=`attributes.texCoord_${c}`,A=y;if(l(p)&&!$.equals(p,$.IDENTITY)){let S=`${g}Transform`;i.addUniform("mat3",S,de.FRAGMENT),r[S]=function(){return p},A=`vec2(${S} * vec3(${y}, 1.0))`}let b=`texture(${g}, ${A}).${u}`,x=a.classProperty,T;n?T=x.unpackTextureInShader(b,u,o,m):T=x.unpackTextureInShaderWebGL1(b);let E=QJ({valueExpression:T,renderResources:e,glslType:s,metadataVariable:o,shaderDestination:de.FRAGMENT,property:a}),v=`metadata.${o} = ${E};`;m.push(v),i.addFunctionLines(Di.FUNCTION_ID_INITIALIZE_METADATA_FS,m)}function JJ(e,t){let n=t.classProperty,{metadataVariable:i,glslType:r,shaderDestination:o}=t,s=rAe(Di.METADATA_CLASS_FIELDS,n,`metadataClass.${i}`,r),a=`${r}MetadataClass`;e.addStructField(Di.STRUCT_ID_METADATA_CLASS_FS,a,i),e.addFunctionLines(Di.FUNCTION_ID_INITIALIZE_METADATA_FS,s),de.includesVertexShader(o)&&(e.addStructField(Di.STRUCT_ID_METADATA_CLASS_VS,a,i),e.addFunctionLines(Di.FUNCTION_ID_INITIALIZE_METADATA_VS,s))}function ZJ(e,t){let{propertyStatistics:n}=t;if(!l(n))return;let{metadataVariable:i,type:r,glslType:o}=t;if(r===bt.ENUM)return;let s=Di.METADATA_STATISTICS_FIELDS,a=`metadataStatistics.${i}`,c=rAe(s,n,a,o),u=`${o}MetadataStatistics`;e.addStructField(Di.STRUCT_ID_METADATA_STATISTICS_FS,u,i),e.addFunctionLines(Di.FUNCTION_ID_INITIALIZE_METADATA_FS,c),de.includesVertexShader(t.shaderDestination)&&(e.addStructField(Di.STRUCT_ID_METADATA_STATISTICS_VS,u,i),e.addFunctionLines(Di.FUNCTION_ID_INITIALIZE_METADATA_VS,c))}function Wit(e,t,n){qit(e,t,n),JJ(e.shaderBuilder,t),ZJ(e.shaderBuilder,t)}function qit(e,t,n){let{shaderBuilder:i,uniformMap:r}=e,{metadataVariable:o,glslType:s,property:a,featureIdVariableName:c,propertyTable:u,propertyInfoIndex:f}=t;if(!n){_t("PropertyTableCustomShader","Property table support for custom shaders requires WebGL2.");return}if(!l(c)||!l(u.texture))return;let d=`u_propertyTableTexture_${u.id}`,p=[];r.hasOwnProperty(d)||(i.addUniform("sampler2D",d,de.BOTH),r[d]=()=>u.texture);let g=t.shaderDestination;de.includesVertexShader(g)&&i.addStructField(Di.STRUCT_ID_METADATA_VS,s,o),de.includesFragmentShader(g)&&i.addStructField(Di.STRUCT_ID_METADATA_FS,s,o);let y=`ivec2(${`featureIds.${c}`}, ${f})`,A=`texelFetch(${d}, ${y}, 0)`,b=t.classProperty,x=b.unpackTextureInShader(A,"rgba",o,p),T=QJ({valueExpression:x,renderResources:e,glslType:s,metadataVariable:o,shaderDestination:g,property:a??b}),E=`metadata.${o} = ${T};`;p.push(E),de.includesVertexShader(g)&&i.addFunctionLines(Di.FUNCTION_ID_INITIALIZE_METADATA_VS,p),de.includesFragmentShader(g)&&i.addFunctionLines(Di.FUNCTION_ID_INITIALIZE_METADATA_FS,p)}function rAe(e,t,n,i){function r(o){let s=t[o.specName];if(l(s))return`${n}.${o.shaderName} = ${i}(${s});`}return l(t)?e.map(r).filter(l):[]}function QJ(e){let{valueExpression:t,property:n}=e;if(!n.hasValueTransform)return t;let i=e.metadataVariable,r=`u_${i}_offset`,o=`u_${i}_scale`,{shaderBuilder:s,uniformMap:a}=e.renderResources,{glslType:c,shaderDestination:u}=e;s.addUniform(c,r,u),s.addUniform(c,o,u);let{offset:f,scale:d}=n;return a[r]=()=>f,a[o]=()=>d,`czm_valueTransform(${r}, ${o}, ${t})`}function Yit(e,t){let n=new Set,i=new Set;return Xit(e,n,i),Kit(e,t,n,i),{usedInVertex:n,usedInFragment:i}}function Xit(e,t,n){let i=e.customShader;if(!l(i))return;let r=i.usedVariablesFragment?.metadataSet??{};for(let s in r)r.hasOwnProperty(s)&&n.add(s);let o=i.usedVariablesVertex?.metadataSet??{};for(let s in o)o.hasOwnProperty(s)&&t.add(s)}function Kit(e,t,n,i){let r=e.style;if(!(l(r)&&t.primitiveType===Oe.POINTS))return;let s=r.color?.getVariables?.()??[];for(let u of s)n.add(u),i.add(u);let a=r.show?.getVariables?.()??[];for(let u of a)n.add(u),i.add(u);let c=r.pointSize?.getVariables?.()??[];for(let u of c)n.add(u)}function $it(e,t){let n=t.usedInFragment.has(e)?de.FRAGMENT:de.NONE,i=t.usedInVertex.has(e)?de.VERTEX:de.NONE;return de.union(n,i)}var qd=Di;var oAe={INHERIT:0,OPAQUE:1,TRANSLUCENT:2};Object.freeze(oAe);var vA=oAe;var ja={name:"CustomShaderPipelineStage",STRUCT_ID_ATTRIBUTES_VS:"AttributesVS",STRUCT_ID_ATTRIBUTES_FS:"AttributesFS",STRUCT_NAME_ATTRIBUTES:"Attributes",STRUCT_ID_VERTEX_INPUT:"VertexInput",STRUCT_NAME_VERTEX_INPUT:"VertexInput",STRUCT_ID_FRAGMENT_INPUT:"FragmentInput",STRUCT_NAME_FRAGMENT_INPUT:"FragmentInput",FUNCTION_ID_INITIALIZE_INPUT_STRUCT_VS:"initializeInputStructVS",FUNCTION_SIGNATURE_INITIALIZE_INPUT_STRUCT_VS:"void initializeInputStruct(out VertexInput vsInput, ProcessedAttributes attributes)",FUNCTION_ID_INITIALIZE_INPUT_STRUCT_FS:"initializeInputStructFS",FUNCTION_SIGNATURE_INITIALIZE_INPUT_STRUCT_FS:"void initializeInputStruct(out FragmentInput fsInput, ProcessedAttributes attributes)",_oneTimeWarning:_t};ja.process=function(e,t,n){let{shaderBuilder:i,model:r,alphaOptions:o}=e,{customShader:s}=r,{lightingModel:a,translucencyMode:c}=s;l(a)&&(e.lightingOptions.lightingModel=a),c===vA.TRANSLUCENT?o.pass=Ie.TRANSLUCENT:c===vA.OPAQUE&&(o.pass=void 0);let u=rrt(s,t,e);if(!u.customShaderEnabled)return;if(crt(i,s,u),u.shouldComputePositionWC&&i.addDefine("COMPUTE_POSITION_WC_CUSTOM_SHADER",void 0,de.BOTH),l(s.vertexShaderText)&&i.addDefine("HAS_CUSTOM_VERTEX_SHADER",void 0,de.VERTEX),l(s.fragmentShaderText)){i.addDefine("HAS_CUSTOM_FRAGMENT_SHADER",void 0,de.FRAGMENT);let p=Zg.getDefineName(s.mode);i.addDefine(p,void 0,de.FRAGMENT)}let f=s.uniforms;for(let p in f)if(f.hasOwnProperty(p)){let g=f[p];i.addUniform(g.type,p)}let d=s.varyings;for(let p in d)if(d.hasOwnProperty(p)){let g=d[p];i.addVarying(g,p)}e.uniformMap=Ot(e.uniformMap,s.uniformMap)};function Jit(e){let t={};for(let n=0;n<e.length;n++){let i=xt.getAttributeInfo(e[n]);t[i.variableName]=i}return t}var Zit={position:"vec3",normal:"vec3",tangent:"vec3",bitangent:"vec3",texCoord:"vec2",color:"vec4",joints:"ivec4",weights:"vec4"},Qit={position:"vec3(0.0)",normal:"vec3(0.0, 0.0, 1.0)",tangent:"vec3(1.0, 0.0, 0.0)",bitangent:"vec3(0.0, 1.0, 0.0)",texCoord:"vec2(0.0)",color:"vec4(1.0)",joints:"ivec4(0)",weights:"vec4(0.0)"};function sAe(e){let t=e.replace(/_[0-9]+$/,"");t=t.replace(/(MC|EC)$/,"");let n=Zit[t],i=Qit[t];if(l(n))return{attributeField:[n,e],value:i}}function ert(e,t,n){if(!l(e.vertexShaderText))return{enabled:!1};let i=e.usedVariablesVertex;if(!lAe(i.metadataSet,n))return{enabled:!1};let r=i.attributeSet,o=aAe(t,r,!1),s=cAe(t,r,!1),a,c=[],u=[];for(let f in o){if(!o.hasOwnProperty(f))continue;let p=[o[f].glslType,f];c.push(p),a=`vsInput.attributes.${f} = attributes.${f};`,u.push(a)}for(let f=0;f<s.length;f++){let d=s[f],p=sAe(d);if(!l(p))return ja._oneTimeWarning("CustomShaderPipelineStage.incompatiblePrimitiveVS",`Primitive is missing attribute ${d}, disabling custom vertex shader`),{enabled:!1};c.push(p.attributeField),a=`vsInput.attributes.${d} = ${p.value};`,u.push(a)}return{enabled:!0,attributeFields:c,initializationLines:u}}function trt(e){let t=[],n=[],i=e.usedVariablesFragment.attributeSet;return i.hasOwnProperty("positionWC")&&(t.push(["vec3","positionWC"]),n.push("fsInput.attributes.positionWC = attributes.positionWC;")),i.hasOwnProperty("positionEC")&&(t.push(["vec3","positionEC"]),n.push("fsInput.attributes.positionEC = attributes.positionEC;")),{attributeFields:t,initializationLines:n}}function nrt(e,t,n){if(!l(e.fragmentShaderText))return{enabled:!1};let i=e.usedVariablesFragment;if(!lAe(i.metadataSet,n))return{enabled:!1};let r=i.attributeSet,o=aAe(t,r,!0),s=cAe(t,r,!0),a,c=[],u=[];for(let d in o){if(!o.hasOwnProperty(d))continue;let g=[o[d].glslType,d];c.push(g),a=`fsInput.attributes.${d} = attributes.${d};`,u.push(a)}for(let d=0;d<s.length;d++){let p=s[d],g=sAe(p);if(!l(g))return ja._oneTimeWarning("CustomShaderPipelineStage.incompatiblePrimitiveFS",`Primitive is missing attribute ${p}, disabling custom fragment shader.`),{enabled:!1};c.push(g.attributeField),a=`fsInput.attributes.${p} = ${g.value};`,u.push(a)}let f=trt(e);return{enabled:!0,attributeFields:c.concat(f.attributeFields),initializationLines:f.initializationLines.concat(u)}}var irt={positionWC:!0,positionEC:!0};function aAe(e,t,n){let i={};for(let r in e){if(!e.hasOwnProperty(r))continue;let o=e[r],s=r;n&&r==="normalMC"?s="normalEC":n&&r==="tangentMC"&&(s="tangentEC",o.glslType="vec3"),t.hasOwnProperty(s)&&(i[s]=o)}return i}function cAe(e,t,n){let i=[];for(let r in t){if(!t.hasOwnProperty(r)||irt.hasOwnProperty(r))continue;let o=r;n&&r==="normalEC"?o="normalMC":n&&r==="tangentEC"&&(o="tangentMC"),e.hasOwnProperty(o)||i.push(r)}return i}function rrt(e,t,n){let i=Jit(t.attributes),r=lrt(t,n.model.structuralMetadata),o=ert(e,i,r),s=nrt(e,i,r),c=e.usedVariablesFragment.attributeSet.hasOwnProperty("positionWC")&&s.enabled;return{vertexLines:o,fragmentLines:s,customShaderEnabled:o.enabled||s.enabled,shouldComputePositionWC:c}}function ort(e,t){let n=ja.STRUCT_ID_ATTRIBUTES_VS;e.addStruct(n,ja.STRUCT_NAME_ATTRIBUTES,de.VERTEX);let{attributeFields:i,initializationLines:r}=t;for(let s=0;s<i.length;s++){let[a,c]=i[s];e.addStructField(n,a,c)}n=ja.STRUCT_ID_VERTEX_INPUT,e.addStruct(n,ja.STRUCT_NAME_VERTEX_INPUT,de.VERTEX),e.addStructField(n,ja.STRUCT_NAME_ATTRIBUTES,"attributes"),e.addStructField(n,CA.STRUCT_NAME_FEATURE_IDS,"featureIds"),e.addStructField(n,qd.STRUCT_NAME_METADATA,"metadata"),e.addStructField(n,qd.STRUCT_NAME_METADATA_CLASS,"metadataClass"),e.addStructField(n,qd.STRUCT_NAME_METADATA_STATISTICS,"metadataStatistics");let o=ja.FUNCTION_ID_INITIALIZE_INPUT_STRUCT_VS;e.addFunction(o,ja.FUNCTION_SIGNATURE_INITIALIZE_INPUT_STRUCT_VS,de.VERTEX),e.addFunctionLines(o,r)}function srt(e,t){let n=ja.STRUCT_ID_ATTRIBUTES_FS;e.addStruct(n,ja.STRUCT_NAME_ATTRIBUTES,de.FRAGMENT);let{attributeFields:i,initializationLines:r}=t;for(let s=0;s<i.length;s++){let[a,c]=i[s];e.addStructField(n,a,c)}n=ja.STRUCT_ID_FRAGMENT_INPUT,e.addStruct(n,ja.STRUCT_NAME_FRAGMENT_INPUT,de.FRAGMENT),e.addStructField(n,ja.STRUCT_NAME_ATTRIBUTES,"attributes"),e.addStructField(n,CA.STRUCT_NAME_FEATURE_IDS,"featureIds"),e.addStructField(n,qd.STRUCT_NAME_METADATA,"metadata"),e.addStructField(n,qd.STRUCT_NAME_METADATA_CLASS,"metadataClass"),e.addStructField(n,qd.STRUCT_NAME_METADATA_STATISTICS,"metadataStatistics");let o=ja.FUNCTION_ID_INITIALIZE_INPUT_STRUCT_FS;e.addFunction(o,ja.FUNCTION_SIGNATURE_INITIALIZE_INPUT_STRUCT_FS,de.FRAGMENT),e.addFunctionLines(o,r)}var art=[];function crt(e,t,n){let{vertexLines:i,fragmentLines:r}=n,o=art;i.enabled&&(ort(e,i),o.length=0,o.push("#line 0",t.vertexShaderText,qF),e.addVertexLines(o)),r.enabled&&(srt(e,r),o.length=0,o.push("#line 0",t.fragmentShaderText,YF),e.addFragmentLines(o))}function lrt(e,t){if(!l(t))return new Set;let n=e.propertyTextureIds,i=e.propertyAttributeIds,r=l(e.featureIds)?e.featureIds.map(a=>a.propertyTableId):[],o=new Set;function s(a,c){for(let u of a){let d=c[u].class.properties;Object.keys(d).forEach(p=>o.add(p))}}return s(n,t.propertyTextures),s(i,t.propertyAttributes),s(r,t.propertyTables),o}function lAe(e,t){for(let n in e)if(e.hasOwnProperty(n)&&!t.has(n))return ja._oneTimeWarning("CustomShaderPipelineStage.checkMetadataCompatibility",`A custom shader uses metadata property "${n}" which is not present for all primitives in the tileset. Disabling the custom shader for these primitives.`),!1;return!0}var ZF=ja;var QF={name:"DequantizationPipelineStage",FUNCTION_ID_DEQUANTIZATION_STAGE_VS:"dequantizationStage",FUNCTION_SIGNATURE_DEQUANTIZATION_STAGE_VS:"void dequantizationStage(inout ProcessedAttributes attributes)"};QF.process=function(e,t,n){let i=e.shaderBuilder,r=e.model,o=l(r.classificationType);i.addDefine("USE_DEQUANTIZATION",void 0,de.VERTEX),i.addFunction(QF.FUNCTION_ID_DEQUANTIZATION_STAGE_VS,QF.FUNCTION_SIGNATURE_DEQUANTIZATION_STAGE_VS,de.VERTEX);let s=t.attributes;for(let a=0;a<s.length;a++){let c=s[a],u=c.quantization;if(!l(u))continue;let f=c.semantic===ct.POSITION,d=c.semantic===ct.TEXCOORD;if(o&&!f&&!d)continue;let p=xt.getAttributeInfo(c);frt(i,p),urt(e,p)}};function urt(e,t){let n=e.shaderBuilder,i=e.uniformMap,r=t.variableName,o=t.attribute.quantization;if(o.octEncoded){let s=`model_normalizationRange_${r}`;n.addUniform("float",s,de.VERTEX),i[s]=function(){return o.normalizationRange}}else{let s=`model_quantizedVolumeOffset_${r}`,a=`model_quantizedVolumeStepSize_${r}`,c=t.glslType;n.addUniform(c,s,de.VERTEX),n.addUniform(c,a,de.VERTEX);let u=o.quantizedVolumeOffset,f=o.quantizedVolumeStepSize;/^color_\d+$/.test(r)&&(u=uAe(u,0),f=uAe(f,1)),i[s]=function(){return u},i[a]=function(){return f}}}function uAe(e,t){return e instanceof se?e:new se(e.x,e.y,e.z,t)}function frt(e,t){let n=t.variableName,i=t.attribute.quantization,r;i.octEncoded?r=drt(n,i):r=hrt(n),e.addFunctionLines(QF.FUNCTION_ID_DEQUANTIZATION_STAGE_VS,[r])}function drt(e,t){let n=`attributes.${e}`,i=`a_quantized_${e}`,r=`model_normalizationRange_${e}`,o=t.octEncodedZXY?".zxy":".xyz";return`${n} = czm_octDecode(${i}, ${r})${o};`}function hrt(e){let t=`attributes.${e}`,n=`a_quantized_${e}`,i=`model_quantizedVolumeOffset_${e}`,r=`model_quantizedVolumeStepSize_${e}`;return`${t} = ${i} + ${n} * ${r};`}var eB=QF;var tB=`void edgeDetectionStage(inout vec4 color, inout FeatureIds featureIds) { +`;var Di={name:"MetadataPipelineStage",STRUCT_ID_METADATA_VS:"MetadataVS",STRUCT_ID_METADATA_FS:"MetadataFS",STRUCT_NAME_METADATA:"Metadata",STRUCT_ID_METADATA_CLASS_VS:"MetadataClassVS",STRUCT_ID_METADATA_CLASS_FS:"MetadataClassFS",STRUCT_NAME_METADATA_CLASS:"MetadataClass",STRUCT_ID_METADATA_STATISTICS_VS:"MetadataStatisticsVS",STRUCT_ID_METADATA_STATISTICS_FS:"MetadataStatisticsFS",STRUCT_NAME_METADATA_STATISTICS:"MetadataStatistics",FUNCTION_ID_INITIALIZE_METADATA_VS:"initializeMetadataVS",FUNCTION_ID_INITIALIZE_METADATA_FS:"initializeMetadataFS",FUNCTION_SIGNATURE_INITIALIZE_METADATA:"void initializeMetadata(FeatureIds featureIds, out Metadata metadata, out MetadataClass metadataClass, out MetadataStatistics metadataStatistics, ProcessedAttributes attributes)",FUNCTION_ID_SET_METADATA_VARYINGS:"setMetadataVaryings",FUNCTION_SIGNATURE_SET_METADATA_VARYINGS:"void setMetadataVaryings()",METADATA_CLASS_FIELDS:[{specName:"noData",shaderName:"noData"},{specName:"default",shaderName:"defaultValue"},{specName:"min",shaderName:"minValue"},{specName:"max",shaderName:"maxValue"}],METADATA_STATISTICS_FIELDS:[{specName:"min",shaderName:"minValue"},{specName:"max",shaderName:"maxValue"},{specName:"mean",shaderName:"mean",type:"float"},{specName:"median",shaderName:"median"},{specName:"standardDeviation",shaderName:"standardDeviation",type:"float"},{specName:"variance",shaderName:"variance",type:"float"},{specName:"sum",shaderName:"sum"}]};Di.process=function(e,t,n){let{shaderBuilder:i,model:r}=e,{structuralMetadata:o={},content:s}=r,a=s?.tileset.metadataExtension?.statistics,c=n.context.webgl2,u=Lat(r,t),f=_at(o.propertyAttributes,t,a),d=Aat(o.propertyTextures,a),p=Tat(o.propertyTables,t,e,a,u),g=f.concat(d).concat(p);vat(i,g),Iat(i),i.addVertexLines(GB),i.addFragmentLines(HB);for(let m=0;m<f.length;m++){let y=f[m];Pat(e,y)}for(let m=0;m<d.length;m++){let y=d[m];Rat(e,y,c)}for(let m=0;m<p.length;m++){let y=p[m];Mat(e,y,c)}};function _at(e,t,n){return l(e)?e.flatMap(i=>yat(i,t,n)):[]}function yat(e,t,n){let{getAttributeByName:i,getAttributeInfo:r,sanitizeGlslIdentifier:o}=xt,s=e.class.id,a=n?.classes[s],c=Object.entries(e.properties),u=new Array(c.length);for(let f=0;f<c.length;f++){let[d,p]=c[f],g=i(t,p.attribute),{glslType:m,variableName:y}=r(g);u[f]={metadataVariable:o(d),property:p,classProperty:p.classProperty,type:p.classProperty.type,glslType:m,variableName:y,propertyStatistics:a?.properties[d],shaderDestination:de.BOTH}}return u}function Aat(e,t){return l(e)?e.flatMap(n=>bat(n,t)):[]}function bat(e,t){let{sanitizeGlslIdentifier:n}=xt,i=e.class.id,r=t?.classes[i],o=Object.entries(e.properties).filter(([a,c])=>{let u=c.textureReader.channels.length;return c.classProperty.isGpuCompatible(u)}),s=new Array(o.length);for(let a=0;a<o.length;a++){let[c,u]=o[a];s[a]={metadataVariable:n(c),property:u,classProperty:u.classProperty,type:u.classProperty.type,glslType:u.classProperty.getGlslType(),propertyStatistics:r?.properties[c],shaderDestination:de.FRAGMENT}}return s}var xat=4;function Tat(e,t,n,i,r){if(!l(e))return[];let o=Cat(n,t);return e.filter(s=>l(s.class)&&o.has(String(s.id))).flatMap(s=>Eat(s,o,i,r))}function Eat(e,t,n,i){let{sanitizeGlslIdentifier:r}=xt,o=e.class,s=n?.classes[o.id],a=t.get(String(e.id))??{},c=a.shaderDestination??de.BOTH,u=e.properties,f=o.properties,d=[],p=0;for(let[g,m]of Object.entries(f)){if(!m.isGpuCompatible(xat))continue;let y=u[g],A=de.intersection(kat(g,i),c);if(A===de.NONE){p++;continue}d.push({metadataVariable:r(g),property:y,classProperty:m,type:m.type,glslType:m.getGlslType(),propertyStatistics:s?.properties[g],shaderDestination:A,propertyTable:e,featureIdVariableName:a.variableName,propertyInfoIndex:p}),p++}return d}function Cat(e,t){let n=new Map;function i(a,c){let u=a?.propertyTableId;if(!l(u))return;let f=String(u),d={variableName:a.positionalLabel,shaderDestination:c},p=n.get(f);l(p)&&console.warn(`Multiple feature ID sets reference the same property table ${u} in primitive. Only one will be used.`),n.set(f,d)}let r=t?.featureIds??[];for(let a=0;a<r.length;a++){let c=r[a],u=l(c?.textureReader);i(c,u?de.FRAGMENT:de.BOTH)}let s=e.runtimeNode?.node?.instances?.featureIds??[];for(let a=0;a<s.length;a++){let c=s[a];i(c,de.BOTH)}return n}function vat(e,t){let n=new Set,i=new Set;for(let a=0;a<t.length;a++){let{type:c,glslType:u,propertyStatistics:f}=t[a];n.add(u),l(f)&&c!==bt.ENUM&&i.add(u)}let r=Di.METADATA_CLASS_FIELDS;for(let a of n){let c=`${a}MetadataClass`;s(c,a,r)}let o=Di.METADATA_STATISTICS_FIELDS;for(let a of i){let c=`${a}MetadataStatistics`;s(c,a,o)}function s(a,c,u){e.addStruct(a,a,de.BOTH);for(let f=0;f<u.length;f++){let{shaderName:d}=u[f],p=u[f].type==="float"?wat(c):c;e.addStructField(a,p,d)}}}var Sat={int:"float",ivec2:"vec2",ivec3:"vec3",ivec4:"vec4"};function wat(e){let t=Sat[e];return l(t)?t:e}function Iat(e){e.addStruct(Di.STRUCT_ID_METADATA_VS,Di.STRUCT_NAME_METADATA,de.VERTEX),e.addStruct(Di.STRUCT_ID_METADATA_FS,Di.STRUCT_NAME_METADATA,de.FRAGMENT),e.addStruct(Di.STRUCT_ID_METADATA_CLASS_VS,Di.STRUCT_NAME_METADATA_CLASS,de.VERTEX),e.addStruct(Di.STRUCT_ID_METADATA_CLASS_FS,Di.STRUCT_NAME_METADATA_CLASS,de.FRAGMENT),e.addStruct(Di.STRUCT_ID_METADATA_STATISTICS_VS,Di.STRUCT_NAME_METADATA_STATISTICS,de.VERTEX),e.addStruct(Di.STRUCT_ID_METADATA_STATISTICS_FS,Di.STRUCT_NAME_METADATA_STATISTICS,de.FRAGMENT),e.addFunction(Di.FUNCTION_ID_INITIALIZE_METADATA_VS,Di.FUNCTION_SIGNATURE_INITIALIZE_METADATA,de.VERTEX),e.addFunction(Di.FUNCTION_ID_INITIALIZE_METADATA_FS,Di.FUNCTION_SIGNATURE_INITIALIZE_METADATA,de.FRAGMENT),e.addFunction(Di.FUNCTION_ID_SET_METADATA_VARYINGS,Di.FUNCTION_SIGNATURE_SET_METADATA_VARYINGS,de.VERTEX)}function Pat(e,t){Dat(e,t),VZ(e.shaderBuilder,t),jZ(e.shaderBuilder,t)}function Dat(e,t){let{shaderBuilder:n}=e,{metadataVariable:i,property:r,glslType:o}=t,s=HZ({valueExpression:`attributes.${t.variableName}`,renderResources:e,glslType:o,metadataVariable:i,shaderDestination:de.BOTH,property:r});n.addStructField(Di.STRUCT_ID_METADATA_VS,o,i),n.addStructField(Di.STRUCT_ID_METADATA_FS,o,i);let a=`metadata.${i} = ${s};`;n.addFunctionLines(Di.FUNCTION_ID_INITIALIZE_METADATA_VS,[a]),n.addFunctionLines(Di.FUNCTION_ID_INITIALIZE_METADATA_FS,[a])}function Rat(e,t,n){Oat(e,t,n),VZ(e.shaderBuilder,t),jZ(e.shaderBuilder,t)}function Oat(e,t,n){let{shaderBuilder:i,uniformMap:r}=e,{metadataVariable:o,glslType:s,property:a}=t,{texCoord:c,channels:u,index:f,texture:d,transform:p}=a.textureReader,g=`u_propertyTexture_${f}`,m=[];r.hasOwnProperty(g)||(i.addUniform("sampler2D",g,de.FRAGMENT),r[g]=()=>d),i.addStructField(Di.STRUCT_ID_METADATA_FS,s,o);let y=`attributes.texCoord_${c}`,A=y;if(l(p)&&!$.equals(p,$.IDENTITY)){let S=`${g}Transform`;i.addUniform("mat3",S,de.FRAGMENT),r[S]=function(){return p},A=`vec2(${S} * vec3(${y}, 1.0))`}let b=`texture(${g}, ${A}).${u}`,x=a.classProperty,T;n?T=x.unpackTextureInShader(b,u,o,m):T=x.unpackTextureInShaderWebGL1(b);let E=HZ({valueExpression:T,renderResources:e,glslType:s,metadataVariable:o,shaderDestination:de.FRAGMENT,property:a}),v=`metadata.${o} = ${E};`;m.push(v),i.addFunctionLines(Di.FUNCTION_ID_INITIALIZE_METADATA_FS,m)}function VZ(e,t){let n=t.classProperty,{metadataVariable:i,glslType:r,shaderDestination:o}=t,s=ETe(Di.METADATA_CLASS_FIELDS,n,`metadataClass.${i}`,r),a=`${r}MetadataClass`;e.addStructField(Di.STRUCT_ID_METADATA_CLASS_FS,a,i),e.addFunctionLines(Di.FUNCTION_ID_INITIALIZE_METADATA_FS,s),de.includesVertexShader(o)&&(e.addStructField(Di.STRUCT_ID_METADATA_CLASS_VS,a,i),e.addFunctionLines(Di.FUNCTION_ID_INITIALIZE_METADATA_VS,s))}function jZ(e,t){let{propertyStatistics:n}=t;if(!l(n))return;let{metadataVariable:i,type:r,glslType:o}=t;if(r===bt.ENUM)return;let s=Di.METADATA_STATISTICS_FIELDS,a=`metadataStatistics.${i}`,c=ETe(s,n,a,o),u=`${o}MetadataStatistics`;e.addStructField(Di.STRUCT_ID_METADATA_STATISTICS_FS,u,i),e.addFunctionLines(Di.FUNCTION_ID_INITIALIZE_METADATA_FS,c),de.includesVertexShader(t.shaderDestination)&&(e.addStructField(Di.STRUCT_ID_METADATA_STATISTICS_VS,u,i),e.addFunctionLines(Di.FUNCTION_ID_INITIALIZE_METADATA_VS,c))}function Mat(e,t,n){Nat(e,t,n),VZ(e.shaderBuilder,t),jZ(e.shaderBuilder,t)}function Nat(e,t,n){let{shaderBuilder:i,uniformMap:r}=e,{metadataVariable:o,glslType:s,property:a,featureIdVariableName:c,propertyTable:u,propertyInfoIndex:f}=t;if(!n){_t("PropertyTableCustomShader","Property table support for custom shaders requires WebGL2.");return}if(!l(c)||!l(u.texture))return;let d=`u_propertyTableTexture_${u.id}`,p=[];r.hasOwnProperty(d)||(i.addUniform("sampler2D",d,de.BOTH),r[d]=()=>u.texture);let g=t.shaderDestination;de.includesVertexShader(g)&&i.addStructField(Di.STRUCT_ID_METADATA_VS,s,o),de.includesFragmentShader(g)&&i.addStructField(Di.STRUCT_ID_METADATA_FS,s,o);let y=`ivec2(${`featureIds.${c}`}, ${f})`,A=`texelFetch(${d}, ${y}, 0)`,b=t.classProperty,x=b.unpackTextureInShader(A,"rgba",o,p),T=HZ({valueExpression:x,renderResources:e,glslType:s,metadataVariable:o,shaderDestination:g,property:a??b}),E=`metadata.${o} = ${T};`;p.push(E),de.includesVertexShader(g)&&i.addFunctionLines(Di.FUNCTION_ID_INITIALIZE_METADATA_VS,p),de.includesFragmentShader(g)&&i.addFunctionLines(Di.FUNCTION_ID_INITIALIZE_METADATA_FS,p)}function ETe(e,t,n,i){function r(o){let s=t[o.specName];if(l(s))return`${n}.${o.shaderName} = ${i}(${s});`}return l(t)?e.map(r).filter(l):[]}function HZ(e){let{valueExpression:t,property:n}=e;if(!n.hasValueTransform)return t;let i=e.metadataVariable,r=`u_${i}_offset`,o=`u_${i}_scale`,{shaderBuilder:s,uniformMap:a}=e.renderResources,{glslType:c,shaderDestination:u}=e;s.addUniform(c,r,u),s.addUniform(c,o,u);let{offset:f,scale:d}=n;return a[r]=()=>f,a[o]=()=>d,`czm_valueTransform(${r}, ${o}, ${t})`}function Lat(e,t){let n=new Set,i=new Set;return Fat(e,n,i),Bat(e,t,n,i),{usedInVertex:n,usedInFragment:i}}function Fat(e,t,n){let i=e.customShader;if(!l(i))return;let r=i.usedVariablesFragment?.metadataSet??{};for(let s in r)r.hasOwnProperty(s)&&n.add(s);let o=i.usedVariablesVertex?.metadataSet??{};for(let s in o)o.hasOwnProperty(s)&&t.add(s)}function Bat(e,t,n,i){let r=e.style;if(!(l(r)&&t.primitiveType===Oe.POINTS))return;let s=r.color?.getVariables?.()??[];for(let u of s)n.add(u),i.add(u);let a=r.show?.getVariables?.()??[];for(let u of a)n.add(u),i.add(u);let c=r.pointSize?.getVariables?.()??[];for(let u of c)n.add(u)}function kat(e,t){let n=t.usedInFragment.has(e)?de.FRAGMENT:de.NONE,i=t.usedInVertex.has(e)?de.VERTEX:de.NONE;return de.union(n,i)}var eh=Di;var CTe={INHERIT:0,OPAQUE:1,TRANSLUCENT:2};Object.freeze(CTe);var wA=CTe;var Ga={name:"CustomShaderPipelineStage",STRUCT_ID_ATTRIBUTES_VS:"AttributesVS",STRUCT_ID_ATTRIBUTES_FS:"AttributesFS",STRUCT_NAME_ATTRIBUTES:"Attributes",STRUCT_ID_VERTEX_INPUT:"VertexInput",STRUCT_NAME_VERTEX_INPUT:"VertexInput",STRUCT_ID_FRAGMENT_INPUT:"FragmentInput",STRUCT_NAME_FRAGMENT_INPUT:"FragmentInput",FUNCTION_ID_INITIALIZE_INPUT_STRUCT_VS:"initializeInputStructVS",FUNCTION_SIGNATURE_INITIALIZE_INPUT_STRUCT_VS:"void initializeInputStruct(out VertexInput vsInput, ProcessedAttributes attributes)",FUNCTION_ID_INITIALIZE_INPUT_STRUCT_FS:"initializeInputStructFS",FUNCTION_SIGNATURE_INITIALIZE_INPUT_STRUCT_FS:"void initializeInputStruct(out FragmentInput fsInput, ProcessedAttributes attributes)",_oneTimeWarning:_t};Ga.process=function(e,t,n){let{shaderBuilder:i,model:r,alphaOptions:o}=e,{customShader:s}=r,{lightingModel:a,translucencyMode:c}=s;l(a)&&(e.lightingOptions.lightingModel=a),c===wA.TRANSLUCENT?o.pass=Ie.TRANSLUCENT:c===wA.OPAQUE&&(o.pass=void 0);let u=qat(s,t,e);if(!u.customShaderEnabled)return;if($at(i,s,u),u.shouldComputePositionWC&&i.addDefine("COMPUTE_POSITION_WC_CUSTOM_SHADER",void 0,de.BOTH),l(s.vertexShaderText)&&i.addDefine("HAS_CUSTOM_VERTEX_SHADER",void 0,de.VERTEX),l(s.fragmentShaderText)){i.addDefine("HAS_CUSTOM_FRAGMENT_SHADER",void 0,de.FRAGMENT);let p=r_.getDefineName(s.mode);i.addDefine(p,void 0,de.FRAGMENT)}let f=s.uniforms;for(let p in f)if(f.hasOwnProperty(p)){let g=f[p];i.addUniform(g.type,p)}let d=s.varyings;for(let p in d)if(d.hasOwnProperty(p)){let g=d[p];i.addVarying(g,p)}e.uniformMap=Ot(e.uniformMap,s.uniformMap)};function Uat(e){let t={};for(let n=0;n<e.length;n++){let i=xt.getAttributeInfo(e[n]);t[i.variableName]=i}return t}var zat={position:"vec3",normal:"vec3",tangent:"vec3",bitangent:"vec3",texCoord:"vec2",color:"vec4",joints:"ivec4",weights:"vec4"},Vat={position:"vec3(0.0)",normal:"vec3(0.0, 0.0, 1.0)",tangent:"vec3(1.0, 0.0, 0.0)",bitangent:"vec3(0.0, 1.0, 0.0)",texCoord:"vec2(0.0)",color:"vec4(1.0)",joints:"ivec4(0)",weights:"vec4(0.0)"};function vTe(e){let t=e.replace(/_[0-9]+$/,"");t=t.replace(/(MC|EC)$/,"");let n=zat[t],i=Vat[t];if(l(n))return{attributeField:[n,e],value:i}}function jat(e,t,n){if(!l(e.vertexShaderText))return{enabled:!1};let i=e.usedVariablesVertex;if(!ITe(i.metadataSet,n))return{enabled:!1};let r=i.attributeSet,o=STe(t,r,!1),s=wTe(t,r,!1),a,c=[],u=[];for(let f in o){if(!o.hasOwnProperty(f))continue;let p=[o[f].glslType,f];c.push(p),a=`vsInput.attributes.${f} = attributes.${f};`,u.push(a)}for(let f=0;f<s.length;f++){let d=s[f],p=vTe(d);if(!l(p))return Ga._oneTimeWarning("CustomShaderPipelineStage.incompatiblePrimitiveVS",`Primitive is missing attribute ${d}, disabling custom vertex shader`),{enabled:!1};c.push(p.attributeField),a=`vsInput.attributes.${d} = ${p.value};`,u.push(a)}return{enabled:!0,attributeFields:c,initializationLines:u}}function Hat(e){let t=[],n=[],i=e.usedVariablesFragment.attributeSet;return i.hasOwnProperty("positionWC")&&(t.push(["vec3","positionWC"]),n.push("fsInput.attributes.positionWC = attributes.positionWC;")),i.hasOwnProperty("positionEC")&&(t.push(["vec3","positionEC"]),n.push("fsInput.attributes.positionEC = attributes.positionEC;")),{attributeFields:t,initializationLines:n}}function Gat(e,t,n){if(!l(e.fragmentShaderText))return{enabled:!1};let i=e.usedVariablesFragment;if(!ITe(i.metadataSet,n))return{enabled:!1};let r=i.attributeSet,o=STe(t,r,!0),s=wTe(t,r,!0),a,c=[],u=[];for(let d in o){if(!o.hasOwnProperty(d))continue;let g=[o[d].glslType,d];c.push(g),a=`fsInput.attributes.${d} = attributes.${d};`,u.push(a)}for(let d=0;d<s.length;d++){let p=s[d],g=vTe(p);if(!l(g))return Ga._oneTimeWarning("CustomShaderPipelineStage.incompatiblePrimitiveFS",`Primitive is missing attribute ${p}, disabling custom fragment shader.`),{enabled:!1};c.push(g.attributeField),a=`fsInput.attributes.${p} = ${g.value};`,u.push(a)}let f=Hat(e);return{enabled:!0,attributeFields:c.concat(f.attributeFields),initializationLines:f.initializationLines.concat(u)}}var Wat={positionWC:!0,positionEC:!0};function STe(e,t,n){let i={};for(let r in e){if(!e.hasOwnProperty(r))continue;let o=e[r],s=r;n&&r==="normalMC"?s="normalEC":n&&r==="tangentMC"&&(s="tangentEC",o.glslType="vec3"),t.hasOwnProperty(s)&&(i[s]=o)}return i}function wTe(e,t,n){let i=[];for(let r in t){if(!t.hasOwnProperty(r)||Wat.hasOwnProperty(r))continue;let o=r;n&&r==="normalEC"?o="normalMC":n&&r==="tangentEC"&&(o="tangentMC"),e.hasOwnProperty(o)||i.push(r)}return i}function qat(e,t,n){let i=Uat(t.attributes),r=Jat(t,n.model.structuralMetadata),o=jat(e,i,r),s=Gat(e,i,r),c=e.usedVariablesFragment.attributeSet.hasOwnProperty("positionWC")&&s.enabled;return{vertexLines:o,fragmentLines:s,customShaderEnabled:o.enabled||s.enabled,shouldComputePositionWC:c}}function Yat(e,t){let n=Ga.STRUCT_ID_ATTRIBUTES_VS;e.addStruct(n,Ga.STRUCT_NAME_ATTRIBUTES,de.VERTEX);let{attributeFields:i,initializationLines:r}=t;for(let s=0;s<i.length;s++){let[a,c]=i[s];e.addStructField(n,a,c)}n=Ga.STRUCT_ID_VERTEX_INPUT,e.addStruct(n,Ga.STRUCT_NAME_VERTEX_INPUT,de.VERTEX),e.addStructField(n,Ga.STRUCT_NAME_ATTRIBUTES,"attributes"),e.addStructField(n,SA.STRUCT_NAME_FEATURE_IDS,"featureIds"),e.addStructField(n,eh.STRUCT_NAME_METADATA,"metadata"),e.addStructField(n,eh.STRUCT_NAME_METADATA_CLASS,"metadataClass"),e.addStructField(n,eh.STRUCT_NAME_METADATA_STATISTICS,"metadataStatistics");let o=Ga.FUNCTION_ID_INITIALIZE_INPUT_STRUCT_VS;e.addFunction(o,Ga.FUNCTION_SIGNATURE_INITIALIZE_INPUT_STRUCT_VS,de.VERTEX),e.addFunctionLines(o,r)}function Xat(e,t){let n=Ga.STRUCT_ID_ATTRIBUTES_FS;e.addStruct(n,Ga.STRUCT_NAME_ATTRIBUTES,de.FRAGMENT);let{attributeFields:i,initializationLines:r}=t;for(let s=0;s<i.length;s++){let[a,c]=i[s];e.addStructField(n,a,c)}n=Ga.STRUCT_ID_FRAGMENT_INPUT,e.addStruct(n,Ga.STRUCT_NAME_FRAGMENT_INPUT,de.FRAGMENT),e.addStructField(n,Ga.STRUCT_NAME_ATTRIBUTES,"attributes"),e.addStructField(n,SA.STRUCT_NAME_FEATURE_IDS,"featureIds"),e.addStructField(n,eh.STRUCT_NAME_METADATA,"metadata"),e.addStructField(n,eh.STRUCT_NAME_METADATA_CLASS,"metadataClass"),e.addStructField(n,eh.STRUCT_NAME_METADATA_STATISTICS,"metadataStatistics");let o=Ga.FUNCTION_ID_INITIALIZE_INPUT_STRUCT_FS;e.addFunction(o,Ga.FUNCTION_SIGNATURE_INITIALIZE_INPUT_STRUCT_FS,de.FRAGMENT),e.addFunctionLines(o,r)}var Kat=[];function $at(e,t,n){let{vertexLines:i,fragmentLines:r}=n,o=Kat;i.enabled&&(Yat(e,i),o.length=0,o.push("#line 0",t.vertexShaderText,UB),e.addVertexLines(o)),r.enabled&&(Xat(e,r),o.length=0,o.push("#line 0",t.fragmentShaderText,zB),e.addFragmentLines(o))}function Jat(e,t){if(!l(t))return new Set;let n=e.propertyTextureIds,i=e.propertyAttributeIds,r=l(e.featureIds)?e.featureIds.map(a=>a.propertyTableId):[],o=new Set;function s(a,c){for(let u of a){let d=c[u].class.properties;Object.keys(d).forEach(p=>o.add(p))}}return s(n,t.propertyTextures),s(i,t.propertyAttributes),s(r,t.propertyTables),o}function ITe(e,t){for(let n in e)if(e.hasOwnProperty(n)&&!t.has(n))return Ga._oneTimeWarning("CustomShaderPipelineStage.checkMetadataCompatibility",`A custom shader uses metadata property "${n}" which is not present for all primitives in the tileset. Disabling the custom shader for these primitives.`),!1;return!0}var WB=Ga;var qB={name:"DequantizationPipelineStage",FUNCTION_ID_DEQUANTIZATION_STAGE_VS:"dequantizationStage",FUNCTION_SIGNATURE_DEQUANTIZATION_STAGE_VS:"void dequantizationStage(inout ProcessedAttributes attributes)"};qB.process=function(e,t,n){let i=e.shaderBuilder,r=e.model,o=l(r.classificationType);i.addDefine("USE_DEQUANTIZATION",void 0,de.VERTEX),i.addFunction(qB.FUNCTION_ID_DEQUANTIZATION_STAGE_VS,qB.FUNCTION_SIGNATURE_DEQUANTIZATION_STAGE_VS,de.VERTEX);let s=t.attributes;for(let a=0;a<s.length;a++){let c=s[a],u=c.quantization;if(!l(u))continue;let f=c.semantic===ct.POSITION,d=c.semantic===ct.TEXCOORD;if(o&&!f&&!d)continue;let p=xt.getAttributeInfo(c);Qat(i,p),Zat(e,p)}};function Zat(e,t){let n=e.shaderBuilder,i=e.uniformMap,r=t.variableName,o=t.attribute.quantization;if(o.octEncoded){let s=`model_normalizationRange_${r}`;n.addUniform("float",s,de.VERTEX),i[s]=function(){return o.normalizationRange}}else{let s=`model_quantizedVolumeOffset_${r}`,a=`model_quantizedVolumeStepSize_${r}`,c=t.glslType;n.addUniform(c,s,de.VERTEX),n.addUniform(c,a,de.VERTEX);let u=o.quantizedVolumeOffset,f=o.quantizedVolumeStepSize;/^color_\d+$/.test(r)&&(u=PTe(u,0),f=PTe(f,1)),i[s]=function(){return u},i[a]=function(){return f}}}function PTe(e,t){return e instanceof se?e:new se(e.x,e.y,e.z,t)}function Qat(e,t){let n=t.variableName,i=t.attribute.quantization,r;i.octEncoded?r=ect(n,i):r=tct(n),e.addFunctionLines(qB.FUNCTION_ID_DEQUANTIZATION_STAGE_VS,[r])}function ect(e,t){let n=`attributes.${e}`,i=`a_quantized_${e}`,r=`model_normalizationRange_${e}`,o=t.octEncodedZXY?".zxy":".xyz";return`${n} = czm_octDecode(${i}, ${r})${o};`}function tct(e){let t=`attributes.${e}`,n=`a_quantized_${e}`,i=`model_quantizedVolumeOffset_${e}`,r=`model_quantizedVolumeStepSize_${e}`;return`${t} = ${i} + ${n} * ${r};`}var YB=qB;var XB=`void edgeDetectionStage(inout vec4 color, inout FeatureIds featureIds) { if (u_isEdgePass) { return; } @@ -8727,7 +8724,7 @@ color = edgeColor; } } } -`;var fAe={name:"EdgeDetectionPipelineStage"};fAe.process=function(e){e.shaderBuilder.addFragmentLines([tB])};var nB=fAe;var iB=`#if defined(HAS_EDGE_VISIBILITY_MRT) && !defined(CESIUM_REDIRECTED_COLOR_OUTPUT) +`;var DTe={name:"EdgeDetectionPipelineStage"};DTe.process=function(e){e.shaderBuilder.addFragmentLines([XB])};var KB=DTe;var $B=`#if defined(HAS_EDGE_VISIBILITY_MRT) && !defined(CESIUM_REDIRECTED_COLOR_OUTPUT) layout(location = 1) out vec4 out_id; layout(location = 2) out vec4 out_edgeDepth; #endif @@ -8774,7 +8771,7 @@ out_edgeDepth = czm_packDepth(gl_FragCoord.z); #endif #endif } -`;var rB=`#ifdef HAS_EDGE_VISIBILITY +`;var JB=`#ifdef HAS_EDGE_VISIBILITY void edgeVisibilityStageVS() { if (!u_isEdgePass) { return; @@ -8845,7 +8842,7 @@ posClip.xy += offsetClip; gl_Position = posClip; } #endif -`;var eZ=class e{static readAttributeAsTypedArray(t){let n=e.readAttributeAsRawCompactTypedArray(t),i=t.normalized,r=t.quantization;if(!l(r)&&!i)return n;let o=t.type,s=t.count,a=n;return i&&(a=cn.dequantize(n,t.componentDatatype,o,s)),l(r)?e.dequantize(a,s,o,r):a}static readAttributeAsRawCompactTypedArray(t){let n=t.type,i=t.count,r=Vt.getNumberOfComponents(n),o=i*r,s=t.componentDatatype,a=t.quantization;l(a)&&(s=a.componentDatatype);let c=t.buffer,u=t.byteOffset,f=t.byteStride,d=Y.getSizeInBytes(s),p=r*d,g=!l(f)||f===p;if(l(t.typedArray))return t.typedArray;if(g){let v=Y.createTypedArray(s,o);return c.getBufferData(v,u),v}let y=new Uint8Array(c.sizeInBytes);c.getBufferData(y);let A=Y.createTypedArray(s,o),b=f??p,x=new DataView(y.buffer,y.byteOffset,y.byteLength),T=new Array(r),E=e.createComponentsReader(s);for(let v=0;v<i;++v){let S=u+v*b;E(x,S,r,T);for(let I=0;I<r;++I)A[v*r+I]=T[I]}return A}static dequantize(t,n,i,r){if(r.octEncoded){let a=e.octDecode(t,n,r.normalizationRange,void 0);return r.octEncodedZXY&&e.convertZxyToXyz(a,a),a}let o=r.quantizedVolumeStepSize,s=r.quantizedVolumeOffset;if(i===Vt.SCALAR)return e.dequantize1D(t,n,o,s,void 0);if(i===Vt.VEC2)return e.dequantize2D(t,n,o,s,void 0);if(i===Vt.VEC3)return e.dequantize3D(t,n,o,s,void 0);if(i===Vt.VEC4)return e.dequantize4D(t,n,o,s,void 0);throw new pe(`Element type for dequantization must be SCALAR, VEC2, VEC3, or VEC4, but is ${i}`)}static octDecode(t,n,i,r){l(r)||(r=new Float32Array(t.length));let o=new h;for(let s=0;s<n;s++)h.unpack(t,s*3,o),cn.octDecodeInRange(o.x,o.y,i,o),h.pack(o,r,s*3);return r}static convertZxyToXyz(t,n,i){l(i)||(i=new Float32Array(t.length));let r=0;for(let o=0;o<n;o++,r+=3){let s=t[r+0],a=t[r+1],c=t[r+2];i[r+0]=a,i[r+1]=c,i[r+2]=s}return i}static dequantize1D(t,n,i,r,o){l(o)||(o=new Float32Array(t.length));for(let s=0;s<n;s++){let c=t[s]*i+r;o[s]=c}return o}static dequantize2D(t,n,i,r,o){l(o)||(o=new Float32Array(t.length));let s=new U;for(let a=0;a<n;a++)U.unpack(t,a*2,s),U.multiplyComponents(s,i,s),U.add(s,r,s),U.pack(s,o,a*2);return o}static dequantize3D(t,n,i,r,o){l(o)||(o=new Float32Array(t.length));let s=new h;for(let a=0;a<n;a++)h.unpack(t,a*3,s),h.multiplyComponents(s,i,s),h.add(s,r,s),h.pack(s,o,a*3);return o}static dequantize4D(t,n,i,r,o){l(o)||(o=new Float32Array(t.length));let s=new se;for(let a=0;a<n;a++)se.unpack(t,a*4,s),se.multiplyComponents(s,i,s),se.add(s,r,s),se.pack(s,o,a*4);return o}static createComponentsReader(t){let n=e.createComponentReader(t),i=Y.getSizeInBytes(t);return function(r,o,s,a){let c=o;for(let u=0;u<s;++u)a[u]=n(r,c),c+=i}}static createComponentReader(t){switch(t){case Y.BYTE:return function(n,i){return n.getInt8(i)};case Y.UNSIGNED_BYTE:return function(n,i){return n.getUint8(i)};case Y.SHORT:return function(n,i){return n.getInt16(i,!0)};case Y.UNSIGNED_SHORT:return function(n,i){return n.getUint16(i,!0)};case Y.INT:return function(n,i){return n.getInt32(i,!0)};case Y.UNSIGNED_INT:return function(n,i){return n.getUint32(i,!0)};case Y.FLOAT:return function(n,i){return n.getFloat32(i,!0)};case Y.DOUBLE:return function(n,i){return n.getFloat64(i,!0)}}throw new pe(`The componentType must be a valid ComponentDatatype, but is ${t}`)}static transform3D(t,n,i){l(i)||(i=new Float32Array(t.length));let r=new h,o=t.length/3;for(let s=0;s<o;s++)h.unpack(t,s*3,r),N.multiplyByPoint(n,r,r),h.pack(r,i,s*3);return i}static readImplicitRangeAsTypedArray(t,n){let i=n.attributes[0]?.count??0,r=t.offset,o=t.repeat,s=new Float32Array(i);if(l(o))for(let a=0;a<i;a++)s[a]=r+Math.floor(a/o);else s.fill(r);return s}static readIndicesAsTypedArray(t){let n=t.typedArray;if(l(n))return n;let i=t.buffer,r=t.count,o=t.indexDatatype,s=e.createIndexTypedArray(o,r);return i.getBufferData(s),s}static readIndicesAsTriangleIndicesTypedArray(t,n){let i=e.readIndicesAsTypedArray(t);if(n===Oe.TRIANGLES)return i;if(n===Oe.TRIANGLE_STRIP)return e.convertTriangleStripToTriangleIndices(i);if(n===Oe.TRIANGLE_FAN)return e.convertTriangleFanToTriangleIndices(i);throw new pe(`The primitiveType must be TRIANGLES (${Oe.TRIANGLES}, TRIANGLE_STRIP (${Oe.TRIANGLE_STRIP}, or TRIANGLE_FAN (${Oe.TRIANGLE_FAN}, but is ${n}`)}static convertTriangleStripToTriangleIndices(t){let n=t.constructor((t.length-2)*3);for(let i=0;i<t.length-2;i++)i%2===1?(n[i*3+0]=t[i+0],n[i*3+1]=t[i+2],n[i*3+2]=t[i+1]):(n[i*3+0]=t[i+0],n[i*3+1]=t[i+1],n[i*3+2]=t[i+2]);return n}static convertTriangleFanToTriangleIndices(t){let n=t.constructor((t.length-2)*3);for(let i=0;i<t.length-2;i++)n[i*3+0]=t[i+0],n[i*3+1]=t[i+1],n[i*3+2]=t[i+2];return n}static createIndexTypedArray(t,n){switch(t){case je.UNSIGNED_BYTE:return new Uint8Array(n);case je.UNSIGNED_SHORT:return new Uint16Array(n);case je.UNSIGNED_INT:return new Uint32Array(n)}throw new pe(`The indexDatatype must be UNSIGNED_BYTE (${je.UNSIGNED_BYTE}, UNSIGNED_SHORT (${je.UNSIGNED_SHORT}, or UNSIGNED_INT (${je.UNSIGNED_INT}, but is ${t}`)}static forEachPrimitive(t,n,i){let r=n?.mapProjection,o=n?.instanceFeatureIdLabel,s=t.sceneGraph;if(!l(s))return;let a={nodeComputedTransform:new N,modelMatrix:new N,computedModelMatrix:new N},c=s._runtimeNodes,u=c.length;for(let f=0;f<u;f++){let d=c[f],p=e.computeNodeTransforms(d,s,t,a),g=p.computedModelMatrix;l(r)&&(g=At.basisTo2D(r,g,g));let m=e.computeInstanceTransforms(d,g,p.nodeComputedTransform,p.modelMatrix),y=l(o)?e.computeInstanceFeatureIds(d,o):void 0,A=[];for(let x=0;x<m.length;x++)A.push({transform:m[x],featureId:l(y)?y[x]:void 0});let b=d.runtimePrimitives.length;for(let x=0;x<b;x++){let T=d.runtimePrimitives[x];i(T,T.primitive,A,g)}}}static computeNodeTransforms(t,n,i,r){let o=t.node,s=N.clone(t.computedTransform,r.nodeComputedTransform),a=N.clone(n.computedModelMatrix,r.modelMatrix),c=o.instances;l(c)&&c.transformInWorldSpace&&(a=N.multiplyTransformation(i.modelMatrix,n.components.transform,a),s=N.multiplyTransformation(n.axisCorrectionMatrix,t.computedTransform,s));let u=N.multiplyTransformation(a,s,r.computedModelMatrix);return r.computedModelMatrix=u,r.nodeComputedTransform=s,r.modelMatrix=a,r}static computeInstanceTransforms(t,n,i,r){let o=[],a=t.node.instances;if(l(a)){let c=a.attributes[0].count,u=a.attributes[0].componentDatatype,f=12,d=t.transformsTypedArray;if(!l(d)){let p=t.instancingTransformsBuffer;l(p)&&(d=Y.createTypedArray(u,c*f),p.getBufferData(d))}l(d)?e.computeInstanceTransformsFromTypedArray(d,c,o):e.computeInstanceTransformsFromAttributes(a,c,o);for(let p=0;p<o.length;p++){let g=o[p];a.transformInWorldSpace?(N.multiplyTransformation(g,i,g),N.multiplyTransformation(r,g,g)):N.multiplyTransformation(n,g,g)}}return o.length===0&&o.push(n),o}static computeInstanceFeatureIds(t,n){let r=t.node.instances;if(!l(r))return;let o=xt.getFeatureIdsByLabel(r.featureIds,n);if(!l(o))return;let s;if("setIndex"in o){let c=xt.getAttributeBySemantic(r,ct.FEATURE_ID,o.setIndex);l(c)&&(s=e.readAttributeAsTypedArray(c))}if("offset"in o&&(s=e.readImplicitRangeAsTypedArray(o,r)),!l(s))return;let a=new Array(s.length);for(let c=0;c<s.length;c++)a[c]=s[c];return a}static computeInstanceTransformsFromTypedArray(t,n,i){for(let o=0;o<n;o++){let s=o*12,a=new N(t[s],t[s+1],t[s+2],t[s+3],t[s+4],t[s+5],t[s+6],t[s+7],t[s+8],t[s+9],t[s+10],t[s+11],0,0,0,1);i.push(a)}}static computeInstanceTransformsFromAttributes(t,n,i){let r=xt.getAttributeBySemantic(t,No.TRANSLATION),o=xt.getAttributeBySemantic(t,No.ROTATION),s=xt.getAttributeBySemantic(t,No.SCALE),a=l(r),c=l(o),u=l(s);if(!a&&!c&&!u)return;let f,d,p;a&&(f=e.readAttributeAsRawCompactTypedArray(r)),c&&(d=e.readAttributeAsRawCompactTypedArray(o)),u&&(p=e.readAttributeAsRawCompactTypedArray(s));for(let g=0;g<n;g++){let m=a?new h(f[g*3],f[g*3+1],f[g*3+2]):h.ZERO,y=c?new Le(d[g*4],d[g*4+1],d[g*4+2],d[g*4+3]):Le.IDENTITY,A=u?new h(p[g*3],p[g*3+1],p[g*3+2]):h.ONE,b=N.fromTranslationQuaternionRotationScale(m,y,A,new N);i.push(b)}}},ba=eZ;var zS=Object.freeze({HIDDEN:0,SILHOUETTE:1,HARD:2,REPEATED_HARD:3}),dAe={name:"EdgeVisibilityPipelineStage"};dAe.process=function(e,t,n){if(!l(t.edgeVisibility))return;n.edgeVisibilityRequested=!0;let i=e.shaderBuilder;i.addDefine("HAS_EDGE_VISIBILITY",void 0,de.BOTH),i.addDefine("HAS_EDGE_VISIBILITY_MRT",void 0,de.FRAGMENT),i.addFragmentLines(iB),i.addVertexLines(rB),i.addUniform("bool","u_isEdgePass",de.BOTH);let r=t.material,o=l(r)?r.lineStyle:void 0;(!l(o)||!l(o.width))&&i.addUniform("float","u_lineWidth",de.VERTEX);let s=i.addAttribute("float","a_edgeType");i.addVarying("float","v_edgeType","flat");let a=i.addAttribute("float","a_edgeFeatureId"),c=i.addAttribute("vec3","a_faceNormalA"),u=i.addAttribute("vec3","a_faceNormalB");i.addVarying("vec3","v_faceNormalAView","flat"),i.addVarying("vec3","v_faceNormalBView","flat"),i.addVarying("float","v_shouldDiscard","flat");let f=i.addAttribute("vec3","a_edgeOtherPos"),d=i.addAttribute("float","a_edgeOffset");i.addVarying("float","v_edgeOffset");let p=prt(t);if(!l(p)||!l(p.edgeIndices)||p.edgeIndices.length===0)return;let g=e.runtimePrimitive.primitive,m=grt(g),A=p.edgeData.some(function(R){return l(R.color)})||l(m),b;A&&(b=i.addAttribute("vec4","a_edgeColor"),i.addVarying("vec4","v_edgeColor","flat"),i.addDefine("HAS_EDGE_COLOR_ATTRIBUTE",void 0,de.BOTH));let x,T,E=xt.getAttributeBySemantic(t,"BENTLEY_materials_line_style:CUMULATIVE_DISTANCE");l(E)&&(x=E,T=i.addAttribute("float","a_edgeCumulativeDistance"),i.addDefine("HAS_EDGE_CUMULATIVE_DISTANCE",void 0,de.VERTEX));let v=mrt(p.edgeIndices,p.edgeData,t.edgeVisibility),S=_rt(p.edgeIndices,p.edgeData,e,n.context,s,c,u,a,b,f,d,m,t.edgeVisibility,v,x,T);if(!l(S))return;S.hasEdgeFeatureIds&&i.addDefine("HAS_EDGE_FEATURE_ID",void 0,de.BOTH),e.uniformMap.u_isEdgePass=function(){return!1},l(e.uniformMap.u_lineWidth)||(e.uniformMap.u_lineWidth=function(){return 1}),l(x)&&(l(e.uniformMap.u_pixelsPerWorld)||(e.uniformMap.u_pixelsPerWorld=function(){return 1}));let I=l(o)&&l(o.width)?o.width*n.pixelRatio:void 0;e.edgeGeometry={vertexArray:S.vertexArray,indexCount:S.indexCount,primitiveType:Oe.TRIANGLES,pass:Ie.CESIUM_3D_TILE_EDGES,lineWidth:I}};function mrt(e,t,n){let i=e.length/2,r=new Float32Array(i*6),o=n.silhouetteNormals;if(!l(o))return r;let s=o.length/3,a=new Float32Array(o.length),c=new h;for(let u=0;u<s;u++)c.x=o[u*3],c.y=o[u*3+1],c.z=o[u*3+2],h.magnitudeSquared(c)>0?h.normalize(c,c):(c.x=0,c.y=0,c.z=1),a[u*3]=c.x,a[u*3+1]=c.y,a[u*3+2]=c.z;for(let u=0;u<i;u++){let{edgeType:f,silhouetteEdgeIndex:d}=t[u];if(f!==zS.SILHOUETTE||d<0)continue;let p=d*2;if((p+1)*3+2>=a.length)continue;let g=p*3,m=(p+1)*3,y=u*6;r[y]=a[g],r[y+1]=a[g+1],r[y+2]=a[g+2],r[y+3]=a[m],r[y+4]=a[m+1],r[y+5]=a[m+2]}return r}function prt(e){let t=e.edgeVisibility;if(!l(t))return[];let n=t.visibility,i=e.indices,r=t.lineStrings,o=e.attributes,s=l(o)&&o.length>0?o[0].count:0,a=l(n)&&l(i)&&l(i.typedArray)&&i.typedArray.length>0,c=l(r)&&r.length>0;if(!a&&!c)return[];let u=a?i.typedArray:void 0,f=[],d=[],p=new Set,g=0,m=t.materialColor;if(a){let y=0,A=u.length,b=n;for(let x=0;x+2<A;x+=3){let T=u[x],E=u[x+1],v=u[x+2];for(let S=0;S<3;S++){let I,R;S===0?(I=T,R=E):S===1?(I=E,R=v):(I=v,R=T);let O=Math.floor(y/4),L=y%4*2;if(y++,O>=b.length)break;let C=b[O]>>L&3;if(C===zS.HIDDEN)continue;let w=Math.min(I,R),P=Math.max(I,R),M=`${w},${P}`;if(p.has(M))continue;p.add(M),f.push(I,R);let F=-1;C===zS.SILHOUETTE&&(F=g,g++),d.push({edgeType:C===zS.REPEATED_HARD?zS.HARD:C,silhouetteEdgeIndex:F,color:m})}}}if(c)for(let y=0;y<r.length;y++){let A=r[y];if(!l(A)||!l(A.indices))continue;let b=A.indices;if(!l(b)||b.length<2)continue;let x=A.restartIndex,T=l(A.materialColor)?A.materialColor:m,E;for(let v=0;v<b.length;v++){let S=b[v];if(l(x)&&S===x){E=void 0;continue}if(!l(E)){E=S;continue}let I=E,R=S;if(E=S,I===R||s>0&&(I<0||I>=s||R<0||R>=s))continue;let O=Math.min(I,R),L=Math.max(I,R),_=`${O},${L}`;p.has(_)||(p.add(_),f.push(I,R),d.push({edgeType:zS.HARD,silhouetteEdgeIndex:-1,color:l(T)?T:void 0}))}}return{edgeIndices:f,edgeData:d,silhouetteEdgeCount:g}}function grt(e){if(!l(e))return;let t=xt.getAttributeBySemantic(e,ct.COLOR);if(!l(t))return;let n=Vt.getNumberOfComponents(t.type);if(n!==3&&n!==4)return;let i=t.typedArray;if(l(i)||(i=ba.readAttributeAsTypedArray(t)),!l(i))return;let r=t.count;if(!l(r)||r===0||i.length<r*n)return;let o=i instanceof Float32Array||i instanceof Float64Array,s=i instanceof Uint8Array,a=i instanceof Uint16Array;if(!o&&!s&&!a)return;let c=new Float32Array(r*4),u=function(f){let d;return o?d=f:s?d=f/255:a&&(d=f/65535),Math.min(Math.max(d,0),1)};for(let f=0;f<r;f++){let d=f*n,p=f*4;c[p]=u(i[d]),c[p+1]=u(i[d+1]),c[p+2]=u(i[d+2]),n===4?c[p+3]=u(i[d+3]):c[p+3]=1}return{colors:c,count:r}}function _rt(e,t,n,i,r,o,s,a,c,u,f,d,p,g,m,y){if(!l(e)||e.length===0)return;let A=t.length,x=A*4,T=0,E=xt.getAttributeBySemantic(n.runtimePrimitive.primitive,ct.POSITION),v=l(E.typedArray)?E.typedArray:ba.readAttributeAsTypedArray(E),S=new Float32Array(x*3),I=new Float32Array(x),R=new Float32Array(x*3),O=new Float32Array(x*3),L=new Float32Array(x*3),_=new Float32Array(x),C=l(m),w=C?new Float32Array(x):void 0,P;C&&(P=l(m.typedArray)?m.typedArray:ba.readAttributeAsTypedArray(m));let M=l(c),F=M?new Float32Array(x*4):void 0,V=l(d)?d.colors:void 0,B=l(d)?d.count:0;function j($e){if(!M)return;let Pe=$e*4;F[Pe]=0,F[Pe+1]=0,F[Pe+2]=0,F[Pe+3]=-1}function k($e,Pe){if(!M)return;let qe=$e*4,st=l(Pe.x)?Pe.x:Pe[0],vt=l(Pe.y)?Pe.y:Pe[1],Gt=l(Pe.z)?Pe.z:Pe[2],lt=l(Pe.w)?Pe.w:l(Pe[3])?Pe[3]:1;F[qe]=st,F[qe+1]=vt,F[qe+2]=Gt,F[qe+3]=lt}function G($e,Pe){if(!M)return;if(Pe>=B){j($e);return}let qe=Pe*4,st=$e*4;F[st]=V[qe],F[st+1]=V[qe+1],F[st+2]=V[qe+2],F[st+3]=V[qe+3]}for(let $e=0;$e<A;$e++){let Pe=e[$e*2],qe=e[$e*2+1],vt=t[$e].edgeType/255,Gt=v[Pe*3],lt=v[Pe*3+1],mt=v[Pe*3+2],ft=v[qe*3],Xt=v[qe*3+1],rt=v[qe*3+2],ht=$e*4;S[ht*3]=Gt,S[ht*3+1]=lt,S[ht*3+2]=mt,L[ht*3]=ft,L[ht*3+1]=Xt,L[ht*3+2]=rt,_[ht]=-1,I[ht]=vt,S[(ht+1)*3]=Gt,S[(ht+1)*3+1]=lt,S[(ht+1)*3+2]=mt,L[(ht+1)*3]=ft,L[(ht+1)*3+1]=Xt,L[(ht+1)*3+2]=rt,_[ht+1]=1,I[ht+1]=vt,S[(ht+2)*3]=ft,S[(ht+2)*3+1]=Xt,S[(ht+2)*3+2]=rt,L[(ht+2)*3]=Gt,L[(ht+2)*3+1]=lt,L[(ht+2)*3+2]=mt,_[ht+2]=1,I[ht+2]=vt,S[(ht+3)*3]=ft,S[(ht+3)*3+1]=Xt,S[(ht+3)*3+2]=rt,L[(ht+3)*3]=Gt,L[(ht+3)*3+1]=lt,L[(ht+3)*3+2]=mt,_[ht+3]=-1,I[ht+3]=vt;let Bi=t[$e].color;if(l(Bi))for(let nn=0;nn<4;nn++)k(ht+nn,Bi);else if(l(V))for(let nn=0;nn<4;nn++)G(ht+nn,Pe);else for(let nn=0;nn<4;nn++)j(ht+nn);if(C){let nn=P[Pe],Wn=P[qe];w[ht]=nn,w[ht+1]=nn,w[ht+2]=Wn,w[ht+3]=Wn}let Xn=$e*6,bi=g[Xn],Wi=g[Xn+1],wi=g[Xn+2],hi=g[Xn+3],xi=g[Xn+4],jn=g[Xn+5];for(let nn=0;nn<4;nn++)R[(ht+nn)*3]=bi,R[(ht+nn)*3+1]=Wi,R[(ht+nn)*3+2]=wi,O[(ht+nn)*3]=hi,O[(ht+nn)*3+1]=xi,O[(ht+nn)*3+2]=jn}let q=tt.createVertexBuffer({context:i,typedArray:S,usage:Me.STATIC_DRAW}),Q=tt.createVertexBuffer({context:i,typedArray:I,usage:Me.STATIC_DRAW}),W=tt.createVertexBuffer({context:i,typedArray:R,usage:Me.STATIC_DRAW}),J=tt.createVertexBuffer({context:i,typedArray:O,usage:Me.STATIC_DRAW}),Z=tt.createVertexBuffer({context:i,typedArray:L,usage:Me.STATIC_DRAW}),ae=tt.createVertexBuffer({context:i,typedArray:_,usage:Me.STATIC_DRAW}),Ae=M?tt.createVertexBuffer({context:i,typedArray:F,usage:Me.STATIC_DRAW}):void 0,fe=C?tt.createVertexBuffer({context:i,typedArray:w,usage:Me.STATIC_DRAW}):void 0,ge=A*2*3,we=x>65534,Se=we?new Uint32Array(ge):new Uint16Array(ge);for(let $e=0;$e<A;$e++){let Pe=$e*4,qe=$e*6;Se[qe]=Pe,Se[qe+1]=Pe+1,Se[qe+2]=Pe+2,Se[qe+3]=Pe,Se[qe+4]=Pe+2,Se[qe+5]=Pe+3}let Re=tt.createIndexBuffer({context:i,typedArray:Se,usage:Me.STATIC_DRAW,indexDatatype:we?je.UNSIGNED_INT:je.UNSIGNED_SHORT}),Qe=[{index:T,vertexBuffer:q,componentsPerAttribute:3,componentDatatype:Y.FLOAT,normalize:!1},{index:r,vertexBuffer:Q,componentsPerAttribute:1,componentDatatype:Y.FLOAT,normalize:!1},{index:o,vertexBuffer:W,componentsPerAttribute:3,componentDatatype:Y.FLOAT,normalize:!1},{index:s,vertexBuffer:J,componentsPerAttribute:3,componentDatatype:Y.FLOAT,normalize:!1},{index:u,vertexBuffer:Z,componentsPerAttribute:3,componentDatatype:Y.FLOAT,normalize:!1},{index:f,vertexBuffer:ae,componentsPerAttribute:1,componentDatatype:Y.FLOAT,normalize:!1}];M&&Qe.push({index:c,vertexBuffer:Ae,componentsPerAttribute:4,componentDatatype:Y.FLOAT,normalize:!1}),C&&Qe.push({index:y,vertexBuffer:fe,componentsPerAttribute:1,componentDatatype:Y.FLOAT,normalize:!1});let He=n.runtimePrimitive.primitive;if(l(He.featureIds)&&He.featureIds.length>0){let $e=He.featureIds[0];if(l($e.setIndex)){let Pe=He.attributes.find(qe=>qe.semantic===ct.FEATURE_ID&&qe.setIndex===$e.setIndex);if(l(Pe)){let qe=l(Pe.typedArray)?Pe.typedArray:ba.readAttributeAsTypedArray(Pe),st=new Float32Array(x);for(let Gt=0;Gt<A;Gt++){let lt=e[Gt*2],mt=lt<qe.length?qe[lt]:0;for(let ft=0;ft<4;ft++)st[Gt*4+ft]=mt}let vt=tt.createVertexBuffer({context:i,typedArray:st,usage:Me.STATIC_DRAW});Qe.push({index:a,vertexBuffer:vt,componentsPerAttribute:1,componentDatatype:Y.FLOAT,normalize:!1})}}}return{vertexArray:new zn({context:i,attributes:Qe,indexBuffer:Re}),indexCount:ge,hasEdgeFeatureIds:l(He.featureIds)&&He.featureIds.length>0}}var oB=dAe;var sB=`void geometryStage(out ProcessedAttributes attributes) +`;var GZ=class e{static readAttributeAsTypedArray(t){let n=e.readAttributeAsRawCompactTypedArray(t),i=t.normalized,r=t.quantization;if(!l(r)&&!i)return n;let o=t.type,s=t.count,a=n;return i&&(a=cn.dequantize(n,t.componentDatatype,o,s)),l(r)?e.dequantize(a,s,o,r):a}static readAttributeAsRawCompactTypedArray(t){let n=t.type,i=t.count,r=Vt.getNumberOfComponents(n),o=i*r,s=t.componentDatatype,a=t.quantization;l(a)&&(s=a.componentDatatype);let c=t.buffer,u=t.byteOffset,f=t.byteStride,d=Y.getSizeInBytes(s),p=r*d,g=!l(f)||f===p;if(l(t.typedArray))return t.typedArray;if(g){let v=Y.createTypedArray(s,o);return c.getBufferData(v,u),v}let y=new Uint8Array(c.sizeInBytes);c.getBufferData(y);let A=Y.createTypedArray(s,o),b=f??p,x=new DataView(y.buffer,y.byteOffset,y.byteLength),T=new Array(r),E=e.createComponentsReader(s);for(let v=0;v<i;++v){let S=u+v*b;E(x,S,r,T);for(let I=0;I<r;++I)A[v*r+I]=T[I]}return A}static dequantize(t,n,i,r){if(r.octEncoded){let a=e.octDecode(t,n,r.normalizationRange,void 0);return r.octEncodedZXY&&e.convertZxyToXyz(a,a),a}let o=r.quantizedVolumeStepSize,s=r.quantizedVolumeOffset;if(i===Vt.SCALAR)return e.dequantize1D(t,n,o,s,void 0);if(i===Vt.VEC2)return e.dequantize2D(t,n,o,s,void 0);if(i===Vt.VEC3)return e.dequantize3D(t,n,o,s,void 0);if(i===Vt.VEC4)return e.dequantize4D(t,n,o,s,void 0);throw new pe(`Element type for dequantization must be SCALAR, VEC2, VEC3, or VEC4, but is ${i}`)}static octDecode(t,n,i,r){l(r)||(r=new Float32Array(t.length));let o=new h;for(let s=0;s<n;s++)h.unpack(t,s*3,o),cn.octDecodeInRange(o.x,o.y,i,o),h.pack(o,r,s*3);return r}static convertZxyToXyz(t,n,i){l(i)||(i=new Float32Array(t.length));let r=0;for(let o=0;o<n;o++,r+=3){let s=t[r+0],a=t[r+1],c=t[r+2];i[r+0]=a,i[r+1]=c,i[r+2]=s}return i}static dequantize1D(t,n,i,r,o){l(o)||(o=new Float32Array(t.length));for(let s=0;s<n;s++){let c=t[s]*i+r;o[s]=c}return o}static dequantize2D(t,n,i,r,o){l(o)||(o=new Float32Array(t.length));let s=new U;for(let a=0;a<n;a++)U.unpack(t,a*2,s),U.multiplyComponents(s,i,s),U.add(s,r,s),U.pack(s,o,a*2);return o}static dequantize3D(t,n,i,r,o){l(o)||(o=new Float32Array(t.length));let s=new h;for(let a=0;a<n;a++)h.unpack(t,a*3,s),h.multiplyComponents(s,i,s),h.add(s,r,s),h.pack(s,o,a*3);return o}static dequantize4D(t,n,i,r,o){l(o)||(o=new Float32Array(t.length));let s=new se;for(let a=0;a<n;a++)se.unpack(t,a*4,s),se.multiplyComponents(s,i,s),se.add(s,r,s),se.pack(s,o,a*4);return o}static createComponentsReader(t){let n=e.createComponentReader(t),i=Y.getSizeInBytes(t);return function(r,o,s,a){let c=o;for(let u=0;u<s;++u)a[u]=n(r,c),c+=i}}static createComponentReader(t){switch(t){case Y.BYTE:return function(n,i){return n.getInt8(i)};case Y.UNSIGNED_BYTE:return function(n,i){return n.getUint8(i)};case Y.SHORT:return function(n,i){return n.getInt16(i,!0)};case Y.UNSIGNED_SHORT:return function(n,i){return n.getUint16(i,!0)};case Y.INT:return function(n,i){return n.getInt32(i,!0)};case Y.UNSIGNED_INT:return function(n,i){return n.getUint32(i,!0)};case Y.FLOAT:return function(n,i){return n.getFloat32(i,!0)};case Y.DOUBLE:return function(n,i){return n.getFloat64(i,!0)}}throw new pe(`The componentType must be a valid ComponentDatatype, but is ${t}`)}static transform3D(t,n,i){l(i)||(i=new Float32Array(t.length));let r=new h,o=t.length/3;for(let s=0;s<o;s++)h.unpack(t,s*3,r),N.multiplyByPoint(n,r,r),h.pack(r,i,s*3);return i}static readImplicitRangeAsTypedArray(t,n){let i=n.attributes[0]?.count??0,r=t.offset,o=t.repeat,s=new Float32Array(i);if(l(o))for(let a=0;a<i;a++)s[a]=r+Math.floor(a/o);else s.fill(r);return s}static readIndicesAsTypedArray(t){let n=t.typedArray;if(l(n))return n;let i=t.buffer,r=t.count,o=t.indexDatatype,s=e.createIndexTypedArray(o,r);return i.getBufferData(s),s}static readIndicesAsTriangleIndicesTypedArray(t,n){let i=e.readIndicesAsTypedArray(t);if(n===Oe.TRIANGLES)return i;if(n===Oe.TRIANGLE_STRIP)return e.convertTriangleStripToTriangleIndices(i);if(n===Oe.TRIANGLE_FAN)return e.convertTriangleFanToTriangleIndices(i);throw new pe(`The primitiveType must be TRIANGLES (${Oe.TRIANGLES}, TRIANGLE_STRIP (${Oe.TRIANGLE_STRIP}, or TRIANGLE_FAN (${Oe.TRIANGLE_FAN}, but is ${n}`)}static convertTriangleStripToTriangleIndices(t){let n=t.constructor((t.length-2)*3);for(let i=0;i<t.length-2;i++)i%2===1?(n[i*3+0]=t[i+0],n[i*3+1]=t[i+2],n[i*3+2]=t[i+1]):(n[i*3+0]=t[i+0],n[i*3+1]=t[i+1],n[i*3+2]=t[i+2]);return n}static convertTriangleFanToTriangleIndices(t){let n=t.constructor((t.length-2)*3);for(let i=0;i<t.length-2;i++)n[i*3+0]=t[i+0],n[i*3+1]=t[i+1],n[i*3+2]=t[i+2];return n}static createIndexTypedArray(t,n){switch(t){case je.UNSIGNED_BYTE:return new Uint8Array(n);case je.UNSIGNED_SHORT:return new Uint16Array(n);case je.UNSIGNED_INT:return new Uint32Array(n)}throw new pe(`The indexDatatype must be UNSIGNED_BYTE (${je.UNSIGNED_BYTE}, UNSIGNED_SHORT (${je.UNSIGNED_SHORT}, or UNSIGNED_INT (${je.UNSIGNED_INT}, but is ${t}`)}static forEachPrimitive(t,n,i){let r=n?.mapProjection,o=n?.instanceFeatureIdLabel,s=t.sceneGraph;if(!l(s))return;let a={nodeComputedTransform:new N,modelMatrix:new N,computedModelMatrix:new N},c=s._runtimeNodes,u=c.length;for(let f=0;f<u;f++){let d=c[f],p=e.computeNodeTransforms(d,s,t,a),g=p.computedModelMatrix;l(r)&&(g=At.basisTo2D(r,g,g));let m=e.computeInstanceTransforms(d,g,p.nodeComputedTransform,p.modelMatrix),y=l(o)?e.computeInstanceFeatureIds(d,o):void 0,A=[];for(let x=0;x<m.length;x++)A.push({transform:m[x],featureId:l(y)?y[x]:void 0});let b=d.runtimePrimitives.length;for(let x=0;x<b;x++){let T=d.runtimePrimitives[x];i(T,T.primitive,A,g)}}}static computeNodeTransforms(t,n,i,r){let o=t.node,s=N.clone(t.computedTransform,r.nodeComputedTransform),a=N.clone(n.computedModelMatrix,r.modelMatrix),c=o.instances;l(c)&&c.transformInWorldSpace&&(a=N.multiplyTransformation(i.modelMatrix,n.components.transform,a),s=N.multiplyTransformation(n.axisCorrectionMatrix,t.computedTransform,s));let u=N.multiplyTransformation(a,s,r.computedModelMatrix);return r.computedModelMatrix=u,r.nodeComputedTransform=s,r.modelMatrix=a,r}static computeInstanceTransforms(t,n,i,r){let o=[],a=t.node.instances;if(l(a)){let c=a.attributes[0].count,u=a.attributes[0].componentDatatype,f=12,d=t.transformsTypedArray;if(!l(d)){let p=t.instancingTransformsBuffer;l(p)&&(d=Y.createTypedArray(u,c*f),p.getBufferData(d))}l(d)?e.computeInstanceTransformsFromTypedArray(d,c,o):e.computeInstanceTransformsFromAttributes(a,c,o);for(let p=0;p<o.length;p++){let g=o[p];a.transformInWorldSpace?(N.multiplyTransformation(g,i,g),N.multiplyTransformation(r,g,g)):N.multiplyTransformation(n,g,g)}}return o.length===0&&o.push(n),o}static computeInstanceFeatureIds(t,n){let r=t.node.instances;if(!l(r))return;let o=xt.getFeatureIdsByLabel(r.featureIds,n);if(!l(o))return;let s;if("setIndex"in o){let c=xt.getAttributeBySemantic(r,ct.FEATURE_ID,o.setIndex);l(c)&&(s=e.readAttributeAsTypedArray(c))}if("offset"in o&&(s=e.readImplicitRangeAsTypedArray(o,r)),!l(s))return;let a=new Array(s.length);for(let c=0;c<s.length;c++)a[c]=s[c];return a}static computeInstanceTransformsFromTypedArray(t,n,i){for(let o=0;o<n;o++){let s=o*12,a=new N(t[s],t[s+1],t[s+2],t[s+3],t[s+4],t[s+5],t[s+6],t[s+7],t[s+8],t[s+9],t[s+10],t[s+11],0,0,0,1);i.push(a)}}static computeInstanceTransformsFromAttributes(t,n,i){let r=xt.getAttributeBySemantic(t,Lo.TRANSLATION),o=xt.getAttributeBySemantic(t,Lo.ROTATION),s=xt.getAttributeBySemantic(t,Lo.SCALE),a=l(r),c=l(o),u=l(s);if(!a&&!c&&!u)return;let f,d,p;a&&(f=e.readAttributeAsRawCompactTypedArray(r)),c&&(d=e.readAttributeAsRawCompactTypedArray(o)),u&&(p=e.readAttributeAsRawCompactTypedArray(s));for(let g=0;g<n;g++){let m=a?new h(f[g*3],f[g*3+1],f[g*3+2]):h.ZERO,y=c?new Le(d[g*4],d[g*4+1],d[g*4+2],d[g*4+3]):Le.IDENTITY,A=u?new h(p[g*3],p[g*3+1],p[g*3+2]):h.ONE,b=N.fromTranslationQuaternionRotationScale(m,y,A,new N);i.push(b)}}},Ea=GZ;var mw=Object.freeze({HIDDEN:0,SILHOUETTE:1,HARD:2,REPEATED_HARD:3}),RTe={name:"EdgeVisibilityPipelineStage"};RTe.process=function(e,t,n){if(!l(t.edgeVisibility))return;n.edgeVisibilityRequested=!0;let i=e.shaderBuilder;i.addDefine("HAS_EDGE_VISIBILITY",void 0,de.BOTH),i.addDefine("HAS_EDGE_VISIBILITY_MRT",void 0,de.FRAGMENT),i.addFragmentLines($B),i.addVertexLines(JB),i.addUniform("bool","u_isEdgePass",de.BOTH);let r=t.material,o=l(r)?r.lineStyle:void 0;(!l(o)||!l(o.width))&&i.addUniform("float","u_lineWidth",de.VERTEX);let s=i.addAttribute("float","a_edgeType");i.addVarying("float","v_edgeType","flat");let a=i.addAttribute("float","a_edgeFeatureId"),c=i.addAttribute("vec3","a_faceNormalA"),u=i.addAttribute("vec3","a_faceNormalB");i.addVarying("vec3","v_faceNormalAView","flat"),i.addVarying("vec3","v_faceNormalBView","flat"),i.addVarying("float","v_shouldDiscard","flat");let f=i.addAttribute("vec3","a_edgeOtherPos"),d=i.addAttribute("float","a_edgeOffset");i.addVarying("float","v_edgeOffset");let p=ict(t);if(!l(p)||!l(p.edgeIndices)||p.edgeIndices.length===0)return;let g=e.runtimePrimitive.primitive,m=rct(g),A=p.edgeData.some(function(R){return l(R.color)})||l(m),b;A&&(b=i.addAttribute("vec4","a_edgeColor"),i.addVarying("vec4","v_edgeColor","flat"),i.addDefine("HAS_EDGE_COLOR_ATTRIBUTE",void 0,de.BOTH));let x,T,E=xt.getAttributeBySemantic(t,"BENTLEY_materials_line_style:CUMULATIVE_DISTANCE");l(E)&&(x=E,T=i.addAttribute("float","a_edgeCumulativeDistance"),i.addDefine("HAS_EDGE_CUMULATIVE_DISTANCE",void 0,de.VERTEX));let v=nct(p.edgeIndices,p.edgeData,t.edgeVisibility),S=oct(p.edgeIndices,p.edgeData,e,n.context,s,c,u,a,b,f,d,m,t.edgeVisibility,v,x,T);if(!l(S))return;S.hasEdgeFeatureIds&&i.addDefine("HAS_EDGE_FEATURE_ID",void 0,de.BOTH),e.uniformMap.u_isEdgePass=function(){return!1},l(e.uniformMap.u_lineWidth)||(e.uniformMap.u_lineWidth=function(){return 1}),l(x)&&(l(e.uniformMap.u_pixelsPerWorld)||(e.uniformMap.u_pixelsPerWorld=function(){return 1}));let I=l(o)&&l(o.width)?o.width*n.pixelRatio:void 0;e.edgeGeometry={vertexArray:S.vertexArray,indexCount:S.indexCount,primitiveType:Oe.TRIANGLES,pass:Ie.CESIUM_3D_TILE_EDGES,lineWidth:I}};function nct(e,t,n){let i=e.length/2,r=new Float32Array(i*6),o=n.silhouetteNormals;if(!l(o))return r;let s=o.length/3,a=new Float32Array(o.length),c=new h;for(let u=0;u<s;u++)c.x=o[u*3],c.y=o[u*3+1],c.z=o[u*3+2],h.magnitudeSquared(c)>0?h.normalize(c,c):(c.x=0,c.y=0,c.z=1),a[u*3]=c.x,a[u*3+1]=c.y,a[u*3+2]=c.z;for(let u=0;u<i;u++){let{edgeType:f,silhouetteEdgeIndex:d}=t[u];if(f!==mw.SILHOUETTE||d<0)continue;let p=d*2;if((p+1)*3+2>=a.length)continue;let g=p*3,m=(p+1)*3,y=u*6;r[y]=a[g],r[y+1]=a[g+1],r[y+2]=a[g+2],r[y+3]=a[m],r[y+4]=a[m+1],r[y+5]=a[m+2]}return r}function ict(e){let t=e.edgeVisibility;if(!l(t))return[];let n=t.visibility,i=e.indices,r=t.lineStrings,o=e.attributes,s=l(o)&&o.length>0?o[0].count:0,a=l(n)&&l(i)&&l(i.typedArray)&&i.typedArray.length>0,c=l(r)&&r.length>0;if(!a&&!c)return[];let u=a?i.typedArray:void 0,f=[],d=[],p=new Set,g=0,m=t.materialColor;if(a){let y=0,A=u.length,b=n;for(let x=0;x+2<A;x+=3){let T=u[x],E=u[x+1],v=u[x+2];for(let S=0;S<3;S++){let I,R;S===0?(I=T,R=E):S===1?(I=E,R=v):(I=v,R=T);let O=Math.floor(y/4),L=y%4*2;if(y++,O>=b.length)break;let C=b[O]>>L&3;if(C===mw.HIDDEN)continue;let w=Math.min(I,R),P=Math.max(I,R),M=`${w},${P}`;if(p.has(M))continue;p.add(M),f.push(I,R);let F=-1;C===mw.SILHOUETTE&&(F=g,g++),d.push({edgeType:C===mw.REPEATED_HARD?mw.HARD:C,silhouetteEdgeIndex:F,color:m})}}}if(c)for(let y=0;y<r.length;y++){let A=r[y];if(!l(A)||!l(A.indices))continue;let b=A.indices;if(!l(b)||b.length<2)continue;let x=A.restartIndex,T=l(A.materialColor)?A.materialColor:m,E;for(let v=0;v<b.length;v++){let S=b[v];if(l(x)&&S===x){E=void 0;continue}if(!l(E)){E=S;continue}let I=E,R=S;if(E=S,I===R||s>0&&(I<0||I>=s||R<0||R>=s))continue;let O=Math.min(I,R),L=Math.max(I,R),_=`${O},${L}`;p.has(_)||(p.add(_),f.push(I,R),d.push({edgeType:mw.HARD,silhouetteEdgeIndex:-1,color:l(T)?T:void 0}))}}return{edgeIndices:f,edgeData:d,silhouetteEdgeCount:g}}function rct(e){if(!l(e))return;let t=xt.getAttributeBySemantic(e,ct.COLOR);if(!l(t))return;let n=Vt.getNumberOfComponents(t.type);if(n!==3&&n!==4)return;let i=t.typedArray;if(l(i)||(i=Ea.readAttributeAsTypedArray(t)),!l(i))return;let r=t.count;if(!l(r)||r===0||i.length<r*n)return;let o=i instanceof Float32Array||i instanceof Float64Array,s=i instanceof Uint8Array,a=i instanceof Uint16Array;if(!o&&!s&&!a)return;let c=new Float32Array(r*4),u=function(f){let d;return o?d=f:s?d=f/255:a&&(d=f/65535),Math.min(Math.max(d,0),1)};for(let f=0;f<r;f++){let d=f*n,p=f*4;c[p]=u(i[d]),c[p+1]=u(i[d+1]),c[p+2]=u(i[d+2]),n===4?c[p+3]=u(i[d+3]):c[p+3]=1}return{colors:c,count:r}}function oct(e,t,n,i,r,o,s,a,c,u,f,d,p,g,m,y){if(!l(e)||e.length===0)return;let A=t.length,x=A*4,T=0,E=xt.getAttributeBySemantic(n.runtimePrimitive.primitive,ct.POSITION),v=l(E.typedArray)?E.typedArray:Ea.readAttributeAsTypedArray(E),S=new Float32Array(x*3),I=new Float32Array(x),R=new Float32Array(x*3),O=new Float32Array(x*3),L=new Float32Array(x*3),_=new Float32Array(x),C=l(m),w=C?new Float32Array(x):void 0,P;C&&(P=l(m.typedArray)?m.typedArray:Ea.readAttributeAsTypedArray(m));let M=l(c),F=M?new Float32Array(x*4):void 0,V=l(d)?d.colors:void 0,B=l(d)?d.count:0;function j($e){if(!M)return;let Pe=$e*4;F[Pe]=0,F[Pe+1]=0,F[Pe+2]=0,F[Pe+3]=-1}function k($e,Pe){if(!M)return;let qe=$e*4,st=l(Pe.x)?Pe.x:Pe[0],vt=l(Pe.y)?Pe.y:Pe[1],Gt=l(Pe.z)?Pe.z:Pe[2],lt=l(Pe.w)?Pe.w:l(Pe[3])?Pe[3]:1;F[qe]=st,F[qe+1]=vt,F[qe+2]=Gt,F[qe+3]=lt}function G($e,Pe){if(!M)return;if(Pe>=B){j($e);return}let qe=Pe*4,st=$e*4;F[st]=V[qe],F[st+1]=V[qe+1],F[st+2]=V[qe+2],F[st+3]=V[qe+3]}for(let $e=0;$e<A;$e++){let Pe=e[$e*2],qe=e[$e*2+1],vt=t[$e].edgeType/255,Gt=v[Pe*3],lt=v[Pe*3+1],mt=v[Pe*3+2],ft=v[qe*3],Xt=v[qe*3+1],rt=v[qe*3+2],ht=$e*4;S[ht*3]=Gt,S[ht*3+1]=lt,S[ht*3+2]=mt,L[ht*3]=ft,L[ht*3+1]=Xt,L[ht*3+2]=rt,_[ht]=-1,I[ht]=vt,S[(ht+1)*3]=Gt,S[(ht+1)*3+1]=lt,S[(ht+1)*3+2]=mt,L[(ht+1)*3]=ft,L[(ht+1)*3+1]=Xt,L[(ht+1)*3+2]=rt,_[ht+1]=1,I[ht+1]=vt,S[(ht+2)*3]=ft,S[(ht+2)*3+1]=Xt,S[(ht+2)*3+2]=rt,L[(ht+2)*3]=Gt,L[(ht+2)*3+1]=lt,L[(ht+2)*3+2]=mt,_[ht+2]=1,I[ht+2]=vt,S[(ht+3)*3]=ft,S[(ht+3)*3+1]=Xt,S[(ht+3)*3+2]=rt,L[(ht+3)*3]=Gt,L[(ht+3)*3+1]=lt,L[(ht+3)*3+2]=mt,_[ht+3]=-1,I[ht+3]=vt;let Bi=t[$e].color;if(l(Bi))for(let nn=0;nn<4;nn++)k(ht+nn,Bi);else if(l(V))for(let nn=0;nn<4;nn++)G(ht+nn,Pe);else for(let nn=0;nn<4;nn++)j(ht+nn);if(C){let nn=P[Pe],Wn=P[qe];w[ht]=nn,w[ht+1]=nn,w[ht+2]=Wn,w[ht+3]=Wn}let Xn=$e*6,bi=g[Xn],Wi=g[Xn+1],wi=g[Xn+2],hi=g[Xn+3],xi=g[Xn+4],jn=g[Xn+5];for(let nn=0;nn<4;nn++)R[(ht+nn)*3]=bi,R[(ht+nn)*3+1]=Wi,R[(ht+nn)*3+2]=wi,O[(ht+nn)*3]=hi,O[(ht+nn)*3+1]=xi,O[(ht+nn)*3+2]=jn}let q=tt.createVertexBuffer({context:i,typedArray:S,usage:Me.STATIC_DRAW}),Q=tt.createVertexBuffer({context:i,typedArray:I,usage:Me.STATIC_DRAW}),W=tt.createVertexBuffer({context:i,typedArray:R,usage:Me.STATIC_DRAW}),J=tt.createVertexBuffer({context:i,typedArray:O,usage:Me.STATIC_DRAW}),Z=tt.createVertexBuffer({context:i,typedArray:L,usage:Me.STATIC_DRAW}),ae=tt.createVertexBuffer({context:i,typedArray:_,usage:Me.STATIC_DRAW}),Ae=M?tt.createVertexBuffer({context:i,typedArray:F,usage:Me.STATIC_DRAW}):void 0,fe=C?tt.createVertexBuffer({context:i,typedArray:w,usage:Me.STATIC_DRAW}):void 0,ge=A*2*3,we=x>65534,Se=we?new Uint32Array(ge):new Uint16Array(ge);for(let $e=0;$e<A;$e++){let Pe=$e*4,qe=$e*6;Se[qe]=Pe,Se[qe+1]=Pe+1,Se[qe+2]=Pe+2,Se[qe+3]=Pe,Se[qe+4]=Pe+2,Se[qe+5]=Pe+3}let Re=tt.createIndexBuffer({context:i,typedArray:Se,usage:Me.STATIC_DRAW,indexDatatype:we?je.UNSIGNED_INT:je.UNSIGNED_SHORT}),Qe=[{index:T,vertexBuffer:q,componentsPerAttribute:3,componentDatatype:Y.FLOAT,normalize:!1},{index:r,vertexBuffer:Q,componentsPerAttribute:1,componentDatatype:Y.FLOAT,normalize:!1},{index:o,vertexBuffer:W,componentsPerAttribute:3,componentDatatype:Y.FLOAT,normalize:!1},{index:s,vertexBuffer:J,componentsPerAttribute:3,componentDatatype:Y.FLOAT,normalize:!1},{index:u,vertexBuffer:Z,componentsPerAttribute:3,componentDatatype:Y.FLOAT,normalize:!1},{index:f,vertexBuffer:ae,componentsPerAttribute:1,componentDatatype:Y.FLOAT,normalize:!1}];M&&Qe.push({index:c,vertexBuffer:Ae,componentsPerAttribute:4,componentDatatype:Y.FLOAT,normalize:!1}),C&&Qe.push({index:y,vertexBuffer:fe,componentsPerAttribute:1,componentDatatype:Y.FLOAT,normalize:!1});let He=n.runtimePrimitive.primitive;if(l(He.featureIds)&&He.featureIds.length>0){let $e=He.featureIds[0];if(l($e.setIndex)){let Pe=He.attributes.find(qe=>qe.semantic===ct.FEATURE_ID&&qe.setIndex===$e.setIndex);if(l(Pe)){let qe=l(Pe.typedArray)?Pe.typedArray:Ea.readAttributeAsTypedArray(Pe),st=new Float32Array(x);for(let Gt=0;Gt<A;Gt++){let lt=e[Gt*2],mt=lt<qe.length?qe[lt]:0;for(let ft=0;ft<4;ft++)st[Gt*4+ft]=mt}let vt=tt.createVertexBuffer({context:i,typedArray:st,usage:Me.STATIC_DRAW});Qe.push({index:a,vertexBuffer:vt,componentsPerAttribute:1,componentDatatype:Y.FLOAT,normalize:!1})}}}return{vertexArray:new zn({context:i,attributes:Qe,indexBuffer:Re}),indexCount:ge,hasEdgeFeatureIds:l(He.featureIds)&&He.featureIds.length>0}}var ZB=RTe;var QB=`void geometryStage(out ProcessedAttributes attributes) { attributes.positionMC = v_positionMC; attributes.positionEC = v_positionEC; @@ -8863,7 +8860,7 @@ attributes.bitangentEC = normalize(v_bitangentEC); #endif setDynamicVaryings(attributes); } -`;var aB=`vec4 geometryStage(inout ProcessedAttributes attributes, mat4 modelView, mat3 normal) +`;var e2=`vec4 geometryStage(inout ProcessedAttributes attributes, mat4 modelView, mat3 normal) { vec4 computedPosition; vec3 positionMC = attributes.positionMC; @@ -8891,7 +8888,7 @@ v_bitangentEC = normalize(normal * attributes.bitangentMC); setDynamicVaryings(attributes); return computedPosition; } -`;var VS=`vec2 computeSt(float featureId) +`;var pw=`vec2 computeSt(float featureId) { float stepX = model_textureStep.x; float centerX = model_textureStep.y; @@ -8929,8 +8926,7 @@ feature.color = vec4(1.0); } #endif } -`;var cB={name:"SelectedFeatureIdPipelineStage",STRUCT_ID_SELECTED_FEATURE:"SelectedFeature",STRUCT_NAME_SELECTED_FEATURE:"SelectedFeature"};cB.process=function(e,t,n){let i=e.shaderBuilder;e.hasPropertyTable=!0;let r=e.model,o=e.runtimeNode.node,s=yrt(r,o,t),a=s.shaderDestination;i.addDefine("HAS_SELECTED_FEATURE_ID",void 0,a),i.addDefine("SELECTED_FEATURE_ID",s.variableName,a),i.addDefine(s.featureIdDefine,void 0,a),Art(i);let c=s.featureIds.nullFeatureId,u=e.uniformMap;l(c)&&(i.addDefine("HAS_NULL_FEATURE_ID",void 0,a),i.addUniform("int","model_nullFeatureId",a),u.model_nullFeatureId=function(){return c}),s.shaderDestination===de.BOTH&&i.addVertexLines(VS),i.addFragmentLines(VS)};function hAe(e){return e instanceof Cn.FeatureIdTexture?"HAS_SELECTED_FEATURE_ID_TEXTURE":"HAS_SELECTED_FEATURE_ID_ATTRIBUTE"}function mAe(e){return e instanceof Cn.FeatureIdTexture?de.FRAGMENT:de.BOTH}function yrt(e,t,n){let i,r;return l(t.instances)&&(r=xt.getFeatureIdsByLabel(t.instances.featureIds,e.instanceFeatureIdLabel),l(r))?(i=r.label??r.positionalLabel,{featureIds:r,variableName:i,shaderDestination:mAe(r),featureIdDefine:hAe(r)}):(r=xt.getFeatureIdsByLabel(n.featureIds,e.featureIdLabel),i=r.label??r.positionalLabel,{featureIds:r,variableName:i,shaderDestination:mAe(r),featureIdDefine:hAe(r)})}function Art(e){e.addStructField(cB.STRUCT_ID_SELECTED_FEATURE,"int","id"),e.addStructField(cB.STRUCT_ID_SELECTED_FEATURE,"vec2","st"),e.addStructField(cB.STRUCT_ID_SELECTED_FEATURE,"vec4","color")}var SA=cB;var Ha={name:"GeometryPipelineStage",STRUCT_ID_PROCESSED_ATTRIBUTES_VS:"ProcessedAttributesVS",STRUCT_ID_PROCESSED_ATTRIBUTES_FS:"ProcessedAttributesFS",STRUCT_NAME_PROCESSED_ATTRIBUTES:"ProcessedAttributes",FUNCTION_ID_INITIALIZE_ATTRIBUTES:"initializeAttributes",FUNCTION_SIGNATURE_INITIALIZE_ATTRIBUTES:"void initializeAttributes(out ProcessedAttributes attributes)",FUNCTION_ID_SET_DYNAMIC_VARYINGS_VS:"setDynamicVaryingsVS",FUNCTION_ID_SET_DYNAMIC_VARYINGS_FS:"setDynamicVaryingsFS",FUNCTION_SIGNATURE_SET_DYNAMIC_VARYINGS:"void setDynamicVaryings(inout ProcessedAttributes attributes)"};Ha.process=function(e,t,n){let{shaderBuilder:i,model:r}=e;i.addStruct(Ha.STRUCT_ID_PROCESSED_ATTRIBUTES_VS,"ProcessedAttributes",de.VERTEX),i.addStruct(Ha.STRUCT_ID_PROCESSED_ATTRIBUTES_FS,"ProcessedAttributes",de.FRAGMENT),i.addStruct(SA.STRUCT_ID_SELECTED_FEATURE,SA.STRUCT_NAME_SELECTED_FEATURE,de.BOTH),i.addFunction(Ha.FUNCTION_ID_INITIALIZE_ATTRIBUTES,Ha.FUNCTION_SIGNATURE_INITIALIZE_ATTRIBUTES,de.VERTEX),i.addVarying("vec3","v_positionWC"),i.addVarying("vec3","v_positionEC"),i.addStructField(Ha.STRUCT_ID_PROCESSED_ATTRIBUTES_FS,"vec3","positionWC"),i.addStructField(Ha.STRUCT_ID_PROCESSED_ATTRIBUTES_FS,"vec3","positionEC"),i.addFunction(Ha.FUNCTION_ID_SET_DYNAMIC_VARYINGS_VS,Ha.FUNCTION_SIGNATURE_SET_DYNAMIC_VARYINGS,de.VERTEX),i.addFunction(Ha.FUNCTION_ID_SET_DYNAMIC_VARYINGS_FS,Ha.FUNCTION_SIGNATURE_SET_DYNAMIC_VARYINGS,de.FRAGMENT),r.type===Wo.TILE_PNTS&&i.addDefine("HAS_SRGB_COLOR",void 0,de.FRAGMENT);let o=n.mode!==re.SCENE3D&&!n.scene3DOnly&&r._projectTo2D,s=l(e.runtimeNode.node.instances),a=o&&!s,c=t.attributes.length;for(let u=0;u<c;u++){let f=t.attributes[u],d=Vt.getAttributeLocationCount(f.type),p=f.semantic===ct.POSITION,g;d>1?(g=e.attributeIndex,e.attributeIndex+=d):p&&!a?g=0:g=e.attributeIndex++;let m=!p&&t.primitiveType===Oe.POINTS&&n.context.webgl2?"flat":void 0;brt(e,f,g,d,o,s,m)}Prt(i,t.attributes),t.primitiveType===Oe.POINTS&&i.addDefine("PRIMITIVE_TYPE_POINTS"),i.addVertexLines(aB),i.addFragmentLines(sB)};function brt(e,t,n,i,r,o,s){let a=e.shaderBuilder,c=xt.getAttributeInfo(t),u=r&&!o;i>1?Ert(e,t,n,i):Trt(e,t,n,u),vrt(a,c,u),Crt(a,c,s),l(t.semantic)&&xrt(a,t),Srt(a,c,r),wrt(a,c,u),Irt(a,c)}function xrt(e,t){let{semantic:n,setIndex:i}=t;switch(n){case ct.NORMAL:e.addDefine("HAS_NORMALS");break;case ct.TANGENT:e.addDefine("HAS_TANGENTS");break;case ct.FEATURE_ID:e.addDefine(`HAS${n}_${i}`);break;case ct.TEXCOORD:case ct.COLOR:e.addDefine(`HAS_${n}_${i}`)}}function Trt(e,t,n,i){let{quantization:r,semantic:o,setIndex:s}=t,{type:a,componentDatatype:c}=l(r)?r:t;o===ct.FEATURE_ID&&s>=e.featureIdVertexAttributeSetIndex&&(e.featureIdVertexAttributeSetIndex=s+1);let u=o===ct.POSITION,f=u?0:n,d=Vt.getNumberOfComponents(a),p={index:f,value:l(t.buffer)?void 0:t.constant,vertexBuffer:t.buffer,count:t.count,componentsPerAttribute:d,componentDatatype:c,offsetInBytes:t.byteOffset,strideInBytes:t.byteStride,normalize:t.normalized};if(e.attributes.push(p),!u||!i)return;let g=e.runtimePrimitive.positionBuffer2D,m={index:n,vertexBuffer:g,count:t.count,componentsPerAttribute:d,componentDatatype:Y.FLOAT,offsetInBytes:0,strideInBytes:void 0,normalize:t.normalized};e.attributes.push(m)}function Ert(e,t,n,i){let{quantization:r,normalized:o}=t,{type:s,componentDatatype:a}=l(r)?r:t,u=Vt.getNumberOfComponents(s)/i,f=Y.getSizeInBytes(a),d=u*f,p=t.byteStride;for(let g=0;g<i;g++){let m=t.byteOffset+g*d,y={index:n+g,vertexBuffer:t.buffer,componentsPerAttribute:u,componentDatatype:a,offsetInBytes:m,strideInBytes:p,normalize:o};e.attributes.push(y)}}function Crt(e,t,n){let i=t.variableName,r=`v_${i}`,o;i==="normalMC"?(r="v_normalEC",o=t.glslType):i==="tangentMC"?(o="vec3",r="v_tangentEC"):o=t.glslType,e.addVarying(o,r,n)}function vrt(e,t,n){let i=t.attribute.semantic,r=t.variableName,o,s;t.isQuantized?(o=`a_quantized_${r}`,s=t.quantizedGlslType):(o=`a_${r}`,s=t.glslType);let a=i===ct.POSITION;a?e.setPositionAttribute(s,o):e.addAttribute(s,o),a&&n&&e.addAttribute("vec3","a_position2D")}function Srt(e,t,n){let i=Ha.STRUCT_ID_PROCESSED_ATTRIBUTES_VS,r=Ha.STRUCT_ID_PROCESSED_ATTRIBUTES_FS,{variableName:o,glslType:s}=t;o==="tangentMC"?(e.addStructField(i,"vec3","tangentMC"),e.addStructField(i,"float","tangentSignMC"),e.addStructField(r,"vec3","tangentEC")):o==="normalMC"?(e.addStructField(i,"vec3","normalMC"),e.addStructField(r,"vec3","normalEC")):(e.addStructField(i,s,o),e.addStructField(r,s,o)),o==="positionMC"&&n&&e.addStructField(i,"vec3","position2D")}function wrt(e,t,n){let i=Ha.FUNCTION_ID_INITIALIZE_ATTRIBUTES,r=t.variableName;if(r==="positionMC"&&n&&e.addFunctionLines(i,["attributes.position2D = a_position2D;"]),t.isQuantized)return;let s=[];r==="tangentMC"?(s.push("attributes.tangentMC = a_tangentMC.xyz;"),s.push("attributes.tangentSignMC = a_tangentMC.w;")):s.push(`attributes.${r} = a_${r};`),e.addFunctionLines(i,s)}function Irt(e,t){let{semantic:n,setIndex:i}=t.attribute;if(l(n)&&!l(i))return;let r=Ha.FUNCTION_ID_SET_DYNAMIC_VARYINGS_VS,o=t.variableName,s=`v_${o} = attributes.${o};`;e.addFunctionLines(r,[s]),r=Ha.FUNCTION_ID_SET_DYNAMIC_VARYINGS_FS,s=`attributes.${o} = v_${o};`,e.addFunctionLines(r,[s])}function Prt(e,t){let n=!1,i=!1;for(let r=0;r<t.length;r++){let o=t[r];o.semantic===ct.NORMAL?n=!0:o.semantic===ct.TANGENT&&(i=!0)}!n||!i||(e.addDefine("HAS_BITANGENTS"),e.addVarying("vec3","v_bitangentEC"),e.addStructField(Ha.STRUCT_ID_PROCESSED_ATTRIBUTES_VS,"vec3","bitangentMC"),e.addStructField(Ha.STRUCT_ID_PROCESSED_ATTRIBUTES_FS,"vec3","bitangentEC"))}var lB=Ha;var tZ=new he,nZ=new he,pAe=new h,gAe=new h,iZ=class{constructor(t){ut(this,"_rectangleSouthwestInMeters");ut(this,"_rectangleNortheastInMeters");if(t=t??H.EMPTY_OBJECT,this._ellipsoid=t.ellipsoid??ee.default,this._numberOfLevelZeroTilesX=t.numberOfLevelZeroTilesX??1,this._numberOfLevelZeroTilesY=t.numberOfLevelZeroTilesY??1,this._projection=new yi(this._ellipsoid),l(t.rectangleSouthwestInMeters)&&l(t.rectangleNortheastInMeters))this._rectangleSouthwestInMeters=t.rectangleSouthwestInMeters,this._rectangleNortheastInMeters=t.rectangleNortheastInMeters;else{let r=this._ellipsoid.maximumRadius*Math.PI;this._rectangleSouthwestInMeters=new U(-r,-r),this._rectangleNortheastInMeters=new U(r,r)}let{x:n,y:i}=this._rectangleSouthwestInMeters;h.fromElements(n,i,0,pAe),this._projection.unproject(pAe,tZ),{x:n,y:i}=this._rectangleNortheastInMeters,h.fromElements(n,i,0,gAe),this._projection.unproject(gAe,nZ),this._rectangle=new ie(tZ.longitude,tZ.latitude,nZ.longitude,nZ.latitude)}get ellipsoid(){return this._ellipsoid}get rectangle(){return this._rectangle}get projection(){return this._projection}getNumberOfXTilesAtLevel(t){return this._numberOfLevelZeroTilesX<<t}getNumberOfYTilesAtLevel(t){return this._numberOfLevelZeroTilesY<<t}rectangleToNativeRectangle(t,n){let i=this._projection,r=i.project(ie.southwest(t)),o=i.project(ie.northeast(t));return l(n)?(n.west=r.x,n.south=r.y,n.east=o.x,n.north=o.y,n):new ie(r.x,r.y,o.x,o.y)}tileXYToNativeRectangle(t,n,i,r){let o=this.getNumberOfXTilesAtLevel(i),s=this.getNumberOfYTilesAtLevel(i),a=(this._rectangleNortheastInMeters.x-this._rectangleSouthwestInMeters.x)/o,c=this._rectangleSouthwestInMeters.x+t*a,u=this._rectangleSouthwestInMeters.x+(t+1)*a,f=(this._rectangleNortheastInMeters.y-this._rectangleSouthwestInMeters.y)/s,d=this._rectangleNortheastInMeters.y-n*f,p=this._rectangleNortheastInMeters.y-(n+1)*f;return l(r)?(r.west=c,r.south=p,r.east=u,r.north=d,r):new ie(c,p,u,d)}tileXYToRectangle(t,n,i,r){let o=this.tileXYToNativeRectangle(t,n,i,r),s=this._projection,a=s.unproject(new h(o.west,o.south)),c=s.unproject(new h(o.east,o.north));return o.west=a.longitude,o.south=a.latitude,o.east=c.longitude,o.north=c.latitude,o}positionToTileXY(t,n,i){let r=this._rectangle;if(!ie.contains(r,t))return;let o=this.getNumberOfXTilesAtLevel(n),s=this.getNumberOfYTilesAtLevel(n),c=(this._rectangleNortheastInMeters.x-this._rectangleSouthwestInMeters.x)/o,f=(this._rectangleNortheastInMeters.y-this._rectangleSouthwestInMeters.y)/s,p=this._projection.project(t),g=p.x-this._rectangleSouthwestInMeters.x,m=this._rectangleNortheastInMeters.y-p.y,y=g/c|0;y>=o&&(y=o-1);let A=m/f|0;return A>=s&&(A=s-1),l(i)?(i.x=y,i.y=A,i):new U(y,A)}},Lo=iZ;var rZ,_Ae="AAPTaeRGM19PsTpo1ePVkJZk4Tg..zqn3rpU4kUaF-8QMW-oWZntlxvKhdUFXLBoo5dQwRNEKd1EoKJh-Ha2zxbrz2Nhz2tV_gLVZTQwFHLzJHKwsGDz4GTKV8jeUgb12Ci9CeU_9sOrauJYnGK2vHhtSSAQ-73rmKzNG_2lZ0zuCCEKslxCmXUw2mT1Cpk0RoCCtDheWByX1e7Lnb3LKCBDt9VhGFSGCOiaFfizFRLld8LWukKgxCgluTpKgUuUi4OytX84roEpm6mP7PE91AT1_5Uash6To",jS={};jS.defaultAccessToken=_Ae;jS.defaultWorldImageryServer=new De({url:"https://ibasemaps-api.arcgis.com/arcgis/rest/services/World_Imagery/MapServer"});jS.defaultWorldHillshadeServer=new De({url:"https://ibasemaps-api.arcgis.com/arcgis/rest/services/Elevation/World_Hillshade/MapServer"});jS.defaultWorldOceanServer=new De({url:"https://ibasemaps-api.arcgis.com/arcgis/rest/services/Ocean/World_Ocean_Base/MapServer"});jS.getDefaultTokenCredit=function(e){if(e===_Ae){if(!l(rZ)){let t='<b> This application is using a default ArcGIS access token. Please assign <i>Cesium.ArcGisMapService.defaultAccessToken</i> with an API key from your ArcGIS Developer account before using the ArcGIS tile services. You can sign up for a free ArcGIS Developer account at <a href="https://developers.arcgis.com/">https://developers.arcgis.com/</a>.</b>';rZ=new It(t,!0)}return rZ}};var kf=jS;function oZ(e){e=e??H.EMPTY_OBJECT,this._pixelsToCheck=e.pixelsToCheck,this._missingImagePixels=void 0,this._missingImageByteLength=void 0,this._isReady=!1;let t=De.createIfNeeded(e.missingImageUrl),n=this;function i(o){l(o.blob)&&(n._missingImageByteLength=o.blob.size);let s=kh(o);if(e.disableCheckIfAllPixelsAreTransparent){let a=!0,c=o.width,u=e.pixelsToCheck;for(let f=0,d=u.length;a&&f<d;++f){let p=u[f],g=p.x*4+p.y*c;s[g+3]>0&&(a=!1)}a&&(s=void 0)}n._missingImagePixels=s,n._isReady=!0}function r(){n._missingImagePixels=void 0,n._isReady=!0}t.fetchImage({preferBlob:!0,preferImageBitmap:!0,flipY:!0}).then(i).catch(r)}oZ.prototype.isReady=function(){return this._isReady};oZ.prototype.shouldDiscardImage=function(e){let t=this._pixelsToCheck,n=this._missingImagePixels;if(!l(n)||l(e.blob)&&e.blob.size!==this._missingImageByteLength)return!1;let i=kh(e),r=e.width;for(let o=0,s=t.length;o<s;++o){let a=t[o],c=a.x*4+a.y*r;for(let u=0;u<4;++u){let f=c+u;if(i[f]!==n[f])return!1}}return!0};var uB=oZ;function sZ(){this.name=void 0,this.description=void 0,this.position=void 0,this.data=void 0,this.imageryLayer=void 0}sZ.prototype.configureNameFromProperties=function(e){let t=10,n;for(let i in e)if(e.hasOwnProperty(i)&&e[i]){let r=i.toLowerCase();t>1&&r==="name"?(t=1,n=i):t>2&&r==="title"?(t=2,n=i):t>3&&/name/i.test(i)?(t=3,n=i):t>4&&/title/i.test(i)&&(t=4,n=i)}l(n)&&(this.name=e[n])};sZ.prototype.configureDescriptionFromProperties=function(e){function t(n){let i='<table class="cesium-infoBox-defaultTable">';for(let r in n)if(n.hasOwnProperty(r)){let o=n[r];l(o)&&(typeof o=="object"?i+=`<tr><td>${r}</td><td>${t(o)}</td></tr>`:i+=`<tr><td>${r}</td><td>${o}</td></tr>`)}return i+="</table>",i}this.description=t(e)};var gm=sZ;function HS(){pe.throwInstantiationError()}Object.defineProperties(HS.prototype,{rectangle:{get:pe.throwInstantiationError},tileWidth:{get:pe.throwInstantiationError},tileHeight:{get:pe.throwInstantiationError},maximumLevel:{get:pe.throwInstantiationError},minimumLevel:{get:pe.throwInstantiationError},tilingScheme:{get:pe.throwInstantiationError},tileDiscardPolicy:{get:pe.throwInstantiationError},errorEvent:{get:pe.throwInstantiationError},credit:{get:pe.throwInstantiationError},proxy:{get:pe.throwInstantiationError},hasAlphaChannel:{get:pe.throwInstantiationError}});HS.prototype.getTileCredits=function(e,t,n){pe.throwInstantiationError()};HS.prototype.requestImage=function(e,t,n,i){pe.throwInstantiationError()};HS.prototype.pickFeatures=function(e,t,n,i,r){pe.throwInstantiationError()};var Drt=/\.ktx2$/i;HS.loadImage=function(e,t){let n=De.createIfNeeded(t);return Drt.test(n.url)?Ou(n):l(e)&&l(e.tileDiscardPolicy)?n.fetchImage({preferBlob:!0,preferImageBitmap:!0,flipY:!0}):n.fetchImage({preferImageBitmap:!0,flipY:!0})};var Uf=HS;var yAe={SATELLITE:1,OCEANS:2,HILLSHADE:3};Object.freeze(yAe);var _m=yAe;function AAe(e){this.useTiles=e.usePreCachedTilesIfAvailable??!0;let t=e.ellipsoid;this.tilingScheme=e.tilingScheme??new er({ellipsoid:t}),this.rectangle=e.rectangle??this.tilingScheme.rectangle,this.ellipsoid=t;let n=e.credit;typeof n=="string"&&(n=new It(n)),this.credit=n,this.tileCredits=void 0,this.tileDiscardPolicy=e.tileDiscardPolicy,this.tileWidth=e.tileWidth??256,this.tileHeight=e.tileHeight??256,this.maximumLevel=e.maximumLevel}AAe.prototype.build=function(e){e._useTiles=this.useTiles,e._tilingScheme=this.tilingScheme,e._rectangle=this.rectangle,e._credit=this.credit,e._tileCredits=this.tileCredits,e._tileDiscardPolicy=this.tileDiscardPolicy,e._tileWidth=this.tileWidth,e._tileHeight=this.tileHeight,e._maximumLevel=this.maximumLevel,this.useTiles&&!l(this.tileDiscardPolicy)&&(e._tileDiscardPolicy=new uB({missingImageUrl:bAe(e,0,0,this.maximumLevel).url,pixelsToCheck:[new U(0,0),new U(200,20),new U(20,200),new U(80,110),new U(160,130)],disableCheckIfAllPixelsAreTransparent:!0}))};function Rrt(e,t){let n=e.tileInfo;if(!l(n))t.useTiles=!1;else{if(t.tileWidth=n.rows,t.tileHeight=n.cols,n.spatialReference.wkid===102100||n.spatialReference.wkid===102113)t.tilingScheme=new Lo({ellipsoid:t.ellipsoid});else if(e.tileInfo.spatialReference.wkid===4326)t.tilingScheme=new er({ellipsoid:t.ellipsoid});else{let i=`Tile spatial reference WKID ${e.tileInfo.spatialReference.wkid} is not supported.`;throw new oe(i)}if(t.maximumLevel=e.tileInfo.lods.length-1,l(e.fullExtent)){if(l(e.fullExtent.spatialReference)&&l(e.fullExtent.spatialReference.wkid))if(e.fullExtent.spatialReference.wkid===102100||e.fullExtent.spatialReference.wkid===102113){let i=new yi,r=e.fullExtent,o=i.unproject(new h(Math.max(r.xmin,-t.tilingScheme.ellipsoid.maximumRadius*Math.PI),Math.max(r.ymin,-t.tilingScheme.ellipsoid.maximumRadius*Math.PI),0)),s=i.unproject(new h(Math.min(r.xmax,t.tilingScheme.ellipsoid.maximumRadius*Math.PI),Math.min(r.ymax,t.tilingScheme.ellipsoid.maximumRadius*Math.PI),0));t.rectangle=new ie(o.longitude,o.latitude,s.longitude,s.latitude)}else if(e.fullExtent.spatialReference.wkid===4326)t.rectangle=ie.fromDegrees(e.fullExtent.xmin,e.fullExtent.ymin,e.fullExtent.xmax,e.fullExtent.ymax);else{let i=`fullExtent.spatialReference WKID ${e.fullExtent.spatialReference.wkid} is not supported.`;throw new oe(i)}}else t.rectangle=t.tilingScheme.rectangle;t.useTiles=!0}l(e.copyrightText)&&e.copyrightText.length>0&&(l(t.credit)?t.tileCredits=[new It(e.copyrightText)]:t.credit=new It(e.copyrightText))}function Ort(e,t){let n=`An error occurred while accessing ${e.url}`;throw l(t)&&l(t.message)&&(n+=`: ${t.message}`),new oe(n)}async function Mrt(e,t){let n=e.getDerivedResource({queryParameters:{f:"json"}});try{let i=await n.fetchJson();Rrt(i,t)}catch(i){Ort(e,i)}}function Xp(e){e=e??H.EMPTY_OBJECT,this._defaultAlpha=void 0,this._defaultNightAlpha=void 0,this._defaultDayAlpha=void 0,this._defaultBrightness=void 0,this._defaultContrast=void 0,this._defaultHue=void 0,this._defaultSaturation=void 0,this._defaultGamma=void 0,this._defaultMinificationFilter=void 0,this._defaultMagnificationFilter=void 0,this._tileDiscardPolicy=e.tileDiscardPolicy,this._tileWidth=e.tileWidth??256,this._tileHeight=e.tileHeight??256,this._maximumLevel=e.maximumLevel,this._tilingScheme=e.tilingScheme??new er({ellipsoid:e.ellipsoid}),this._useTiles=e.usePreCachedTilesIfAvailable??!0,this._rectangle=e.rectangle??this._tilingScheme.rectangle,this._layers=e.layers,this._credit=e.credit,this._tileCredits=void 0,this.enablePickFeatures=e.enablePickFeatures??!0,this._errorEvent=new be}Xp.fromBasemapType=async function(e,t){t=t??H.EMPTY_OBJECT;let n,i,r;switch(e){case _m.SATELLITE:{n=t.token??kf.defaultAccessToken,i=De.createIfNeeded(kf.defaultWorldImageryServer),i.appendForwardSlash();let o=kf.getDefaultTokenCredit(n);l(o)&&(r=It.clone(o))}break;case _m.OCEANS:{n=t.token??kf.defaultAccessToken,i=De.createIfNeeded(kf.defaultWorldOceanServer),i.appendForwardSlash();let o=kf.getDefaultTokenCredit(n);l(o)&&(r=It.clone(o))}break;case _m.HILLSHADE:{n=t.token??kf.defaultAccessToken,i=De.createIfNeeded(kf.defaultWorldHillshadeServer),i.appendForwardSlash();let o=kf.getDefaultTokenCredit(n);l(o)&&(r=It.clone(o))}break;default:}return Xp.fromUrl(i,{...t,token:n,credit:r,usePreCachedTilesIfAvailable:!0})};function bAe(e,t,n,i,r){let o;if(e._useTiles)o=e._resource.getDerivedResource({url:`tile/${i}/${n}/${t}`,request:r});else{let s=e._tilingScheme.tileXYToNativeRectangle(t,n,i),c={bbox:`${s.west},${s.south},${s.east},${s.north}`,size:`${e._tileWidth},${e._tileHeight}`,format:"png32",transparent:!0,f:"image"};e._tilingScheme.projection instanceof Ui?(c.bboxSR=4326,c.imageSR=4326):(c.bboxSR=3857,c.imageSR=3857),e.layers&&(c.layers=`show:${e.layers}`),o=e._resource.getDerivedResource({url:"export",request:r,queryParameters:c})}return o}Object.defineProperties(Xp.prototype,{url:{get:function(){return this._resource._url}},token:{get:function(){return this._resource.queryParameters.token}},proxy:{get:function(){return this._resource.proxy}},tileWidth:{get:function(){return this._tileWidth}},tileHeight:{get:function(){return this._tileHeight}},maximumLevel:{get:function(){return this._maximumLevel}},minimumLevel:{get:function(){return 0}},tilingScheme:{get:function(){return this._tilingScheme}},rectangle:{get:function(){return this._rectangle}},tileDiscardPolicy:{get:function(){return this._tileDiscardPolicy}},errorEvent:{get:function(){return this._errorEvent}},credit:{get:function(){return this._credit}},usingPrecachedTiles:{get:function(){return this._useTiles}},hasAlphaChannel:{get:function(){return!0}},layers:{get:function(){return this._layers}}});Xp.fromUrl=async function(e,t){t=t??H.EMPTY_OBJECT;let n=De.createIfNeeded(e);n.appendForwardSlash(),l(t.token)&&n.setQueryParameters({token:t.token});let i=new Xp(t);i._resource=n;let r=new AAe(t);return(t.usePreCachedTilesIfAvailable??!0)&&await Mrt(n,r),r.build(i),i};Xp.prototype.getTileCredits=function(e,t,n){return this._tileCredits};Xp.prototype.requestImage=function(e,t,n,i){return Uf.loadImage(this,bAe(this,e,t,n,i))};Xp.prototype.pickFeatures=function(e,t,n,i,r){if(!this.enablePickFeatures)return;let o=this._tilingScheme.tileXYToNativeRectangle(e,t,n),s,a,c;if(this._tilingScheme.projection instanceof Ui)s=D.toDegrees(i),a=D.toDegrees(r),c="4326";else{let p=this._tilingScheme.projection.project(new he(i,r,0));s=p.x,a=p.y,c="3857"}let u="visible";l(this._layers)&&(u+=`:${this._layers}`);let f={f:"json",tolerance:2,geometryType:"esriGeometryPoint",geometry:`${s},${a}`,mapExtent:`${o.west},${o.south},${o.east},${o.north}`,imageDisplay:`${this._tileWidth},${this._tileHeight},96`,sr:c,layers:u};return this._resource.getDerivedResource({url:"identify",queryParameters:f}).fetchJson().then(function(p){let g=[],m=p.results;if(!l(m))return g;for(let y=0;y<m.length;++y){let A=m[y],b=new gm;if(b.data=A,b.name=A.value,b.properties=A.attributes,b.configureDescriptionFromProperties(A.attributes),A.geometryType==="esriGeometryPoint"&&A.geometry){let x=A.geometry.spatialReference&&A.geometry.spatialReference.wkid?A.geometry.spatialReference.wkid:4326;if(x===4326||x===4283)b.position=he.fromDegrees(A.geometry.x,A.geometry.y,A.geometry.z);else if(x===102100||x===900913||x===3857){let T=new yi;b.position=T.unproject(new h(A.geometry.x,A.geometry.y,A.geometry.z))}}g.push(b)}return g})};Xp._metadataCache={};var Qg=Xp;function Nrt(e){let t,n=e.name,i=e.message;l(n)&&l(i)?t=`${n}: ${i}`:t=e.toString();let r=e.stack;return l(r)&&(t+=` -${r}`),t}var Kp=Nrt;function TH(e,t,n,i,r,o,s){this.provider=e,this.message=t,this.x=n,this.y=i,this.level=r,this.timesRetried=o??0,this.retry=!1,this.error=s}TH.reportError=function(e,t,n,i,r,o,s,a){let c=e;return l(e)?(c.provider=t,c.message=i,c.x=r,c.y=o,c.level=s,c.retry=!1,c.error=a,++c.timesRetried):c=new TH(t,i,r,o,s,0,a),l(n)&&n.numberOfListeners>0?n.raiseEvent(c):l(t)&&console.log(`An error occurred in "${t.constructor.name}": ${Kp(i)}`),c};TH.reportSuccess=function(e){l(e)&&(e.timesRetried=-1)};var Zr=TH;var xAe={AERIAL:"Aerial",AERIAL_WITH_LABELS:"AerialWithLabels",AERIAL_WITH_LABELS_ON_DEMAND:"AerialWithLabelsOnDemand",ROAD:"Road",ROAD_ON_DEMAND:"RoadOnDemand",CANVAS_DARK:"CanvasDark",CANVAS_LIGHT:"CanvasLight",CANVAS_GRAY:"CanvasGray",ORDNANCE_SURVEY:"OrdnanceSurvey",COLLINS_BART:"CollinsBart"};Object.freeze(xAe);var GS=xAe;function fB(e){}fB.prototype.isReady=function(){return!0};fB.prototype.shouldDiscardImage=function(e){return fB.EMPTY_IMAGE===e};var EH;Object.defineProperties(fB,{EMPTY_IMAGE:{get:function(){return l(EH)||(EH=new Image,EH.src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAQAAAC1HAwCAAAAC0lEQVR42mNkYAAAAAYAAjCB0C8AAAAASUVORK5CYII="),EH}}});var WS=fB;function TAe(e){this.tileWidth=void 0,this.tileHeight=void 0,this.maximumLevel=void 0,this.imageUrlSubdomains=void 0,this.imageUrlTemplate=void 0,this.attributionList=void 0}TAe.prototype.build=function(e){e._tileWidth=this.tileWidth,e._tileHeight=this.tileHeight,e._maximumLevel=this.maximumLevel,e._imageUrlSubdomains=this.imageUrlSubdomains,e._imageUrlTemplate=this.imageUrlTemplate;let t=e._attributionList=this.attributionList;t||(t=[]),e._attributionList=t;for(let n=0,i=t.length;n<i;++n){let r=t[n];if(r.credit instanceof It)break;r.credit=new It(r.attribution);let o=r.coverageAreas;for(let s=0,a=r.coverageAreas.length;s<a;++s){let c=o[s],u=c.bbox;c.bbox=new ie(D.toRadians(u[1]),D.toRadians(u[0]),D.toRadians(u[3]),D.toRadians(u[2]))}}};function Lrt(e,t){if(e.resourceSets.length!==1)throw new oe("metadata does not specify one resource in resourceSets");let n=e.resourceSets[0].resources[0];t.tileWidth=n.imageWidth,t.tileHeight=n.imageHeight,t.maximumLevel=n.zoomMax-1,t.imageUrlSubdomains=n.imageUrlSubdomains,t.imageUrlTemplate=n.imageUrl;let i=n.imageryProviders;l(n.imageryProviders)&&(i=n.imageryProviders.filter(r=>r.coverageAreas?.some(o=>l(o.bbox)))),t.attributionList=i}function Frt(e,t,n){let i=`An error occurred while accessing ${e.url}`;throw l(t)&&l(t.message)&&(i+=`: ${t.message}`),Zr.reportError(void 0,n,l(n)?n._errorEvent:void 0,i,void 0,void 0,void 0,t),new oe(i)}async function Brt(e,t,n){let i=e.url,r=xa._metadataCache[i];l(r)||(r=e.fetchJson(),xa._metadataCache[i]=r);try{let o=await r;return Lrt(o,t)}catch(o){Frt(e,o,n)}}function xa(e){e=e??H.EMPTY_OBJECT,this._defaultAlpha=void 0,this._defaultNightAlpha=void 0,this._defaultDayAlpha=void 0,this._defaultBrightness=void 0,this._defaultContrast=void 0,this._defaultHue=void 0,this._defaultSaturation=void 0,this._defaultGamma=1,this._defaultMinificationFilter=void 0,this._defaultMagnificationFilter=void 0,this._mapStyle=e.mapStyle??GS.AERIAL,this._mapLayer=e.mapLayer,this._culture=e.culture??"",this._key=e.key,this._tileDiscardPolicy=e.tileDiscardPolicy,l(this._tileDiscardPolicy)||(this._tileDiscardPolicy=new WS),this._proxy=e.proxy,this._credit=new It(`<a href="https://www.microsoft.com/en-us/maps/bing-maps/product"><img src="${xa.logoUrl}" title="Bing Imagery"/></a>`),this._tilingScheme=new Lo({numberOfLevelZeroTilesX:2,numberOfLevelZeroTilesY:2,ellipsoid:e.ellipsoid}),this._tileWidth=void 0,this._tileHeight=void 0,this._maximumLevel=void 0,this._imageUrlTemplate=void 0,this._imageUrlSubdomains=void 0,this._attributionList=void 0,this._errorEvent=new be}Object.defineProperties(xa.prototype,{url:{get:function(){return this._resource.url}},proxy:{get:function(){return this._resource.proxy}},key:{get:function(){return this._key}},mapStyle:{get:function(){return this._mapStyle}},mapLayer:{get:function(){return this._mapLayer}},culture:{get:function(){return this._culture}},tileWidth:{get:function(){return this._tileWidth}},tileHeight:{get:function(){return this._tileHeight}},maximumLevel:{get:function(){return this._maximumLevel}},minimumLevel:{get:function(){return 0}},tilingScheme:{get:function(){return this._tilingScheme}},rectangle:{get:function(){return this._tilingScheme.rectangle}},tileDiscardPolicy:{get:function(){return this._tileDiscardPolicy}},errorEvent:{get:function(){return this._errorEvent}},credit:{get:function(){return this._credit}},hasAlphaChannel:{get:function(){return l(this.mapLayer)}}});xa.fromUrl=async function(e,t){t=t??H.EMPTY_OBJECT;let n=t.tileProtocol;l(n)?n.length>0&&n[n.length-1]===":"&&(n=n.substr(0,n.length-1)):n=document.location.protocol==="http:"?"http":"https";let i=t.mapStyle??GS.AERIAL,r=De.createIfNeeded(e);r.appendForwardSlash();let o={incl:"ImageryProviders",key:t.key,uriScheme:n};l(t.mapLayer)&&(o.mapLayer=t.mapLayer),l(t.culture)&&(o.culture=t.culture);let s=r.getDerivedResource({url:`REST/v1/Imagery/Metadata/${i}`,queryParameters:o}),a=new xa(t);a._resource=r;let c=new TAe(t);return await Brt(s,c),c.build(a),a};var krt=new ie;xa.prototype.getTileCredits=function(e,t,n){let i=this._tilingScheme.tileXYToRectangle(e,t,n,krt);return Vrt(this._attributionList,n,i)};xa.prototype.requestImage=function(e,t,n,i){let r=Uf.loadImage(this,Urt(this,e,t,n,i));if(l(r))return r.catch(function(o){return l(o.blob)&&o.blob.size===0?WS.EMPTY_IMAGE:Promise.reject(o)})};xa.prototype.pickFeatures=function(e,t,n,i,r){};xa.tileXYToQuadKey=function(e,t,n){let i="";for(let r=n;r>=0;--r){let o=1<<r,s=0;(e&o)!==0&&(s|=1),(t&o)!==0&&(s|=2),i+=s}return i};xa.quadKeyToTileXY=function(e){let t=0,n=0,i=e.length-1;for(let r=i;r>=0;--r){let o=1<<r,s=+e[i-r];(s&1)!==0&&(t|=o),(s&2)!==0&&(n|=o)}return{x:t,y:n,level:i}};xa._logoUrl=void 0;Object.defineProperties(xa,{logoUrl:{get:function(){return l(xa._logoUrl)||(xa._logoUrl=Zt("Assets/Images/bing_maps_credit.png")),xa._logoUrl},set:function(e){xa._logoUrl=e}}});function Urt(e,t,n,i,r){let o=e._imageUrlTemplate,s=e._imageUrlSubdomains,a=(t+n+i)%s.length;return e._resource.getDerivedResource({url:o,request:r,templateValues:{quadkey:xa.tileXYToQuadKey(t,n,i),subdomain:s[a],culture:e._culture},queryParameters:{n:"z"}})}var zrt=new ie;function Vrt(e,t,n){++t;let i=[];for(let r=0,o=e.length;r<o;++r){let s=e[r],a=s.coverageAreas,c=!1;for(let u=0,f=s.coverageAreas.length;!c&&u<f;++u){let d=a[u];if(t>=d.zoomMin&&t<=d.zoomMax){let p=ie.intersection(n,d.bbox,zrt);l(p)&&(c=!0)}}c&&i.push(s.credit)}return i}xa._metadataCache={};var dB=xa;var EAe=/{[^}]+}/g,CAe={x:Wrt,y:Yrt,z:$rt,s:Jrt,reverseX:qrt,reverseY:Xrt,reverseZ:Krt,westDegrees:Zrt,southDegrees:Qrt,eastDegrees:eot,northDegrees:tot,westProjected:not,southProjected:iot,eastProjected:rot,northProjected:oot,width:sot,height:aot},jrt=Ot(CAe,{i:cot,j:lot,reverseI:uot,reverseJ:fot,longitudeDegrees:hot,latitudeDegrees:mot,longitudeProjected:pot,latitudeProjected:got,format:yot});function hB(e){e=e??H.EMPTY_OBJECT,this._errorEvent=new be;let t=De.createIfNeeded(e.url),n=De.createIfNeeded(e.pickFeaturesUrl);this._resource=t,this._urlSchemeZeroPadding=e.urlSchemeZeroPadding,this._getFeatureInfoFormats=e.getFeatureInfoFormats,this._pickFeaturesResource=n;let i=e.subdomains;Array.isArray(i)?i=i.slice():l(i)&&i.length>0?i=i.split(""):i=["a","b","c"],this._subdomains=i,this._tileWidth=e.tileWidth??256,this._tileHeight=e.tileHeight??256,this._minimumLevel=e.minimumLevel??0,this._maximumLevel=e.maximumLevel,this._tilingScheme=e.tilingScheme??new Lo({ellipsoid:e.ellipsoid}),this._rectangle=e.rectangle??this._tilingScheme.rectangle,this._rectangle=ie.intersection(this._rectangle,this._tilingScheme.rectangle),this._tileDiscardPolicy=e.tileDiscardPolicy;let r=e.credit;typeof r=="string"&&(r=new It(r)),this._credit=r,this._hasAlphaChannel=e.hasAlphaChannel??!0;let o=e.customTags,s=Ot(CAe,o),a=Ot(jrt,o);this._tags=s,this._pickFeaturesTags=a,this._defaultAlpha=void 0,this._defaultNightAlpha=void 0,this._defaultDayAlpha=void 0,this._defaultBrightness=void 0,this._defaultContrast=void 0,this._defaultHue=void 0,this._defaultSaturation=void 0,this._defaultGamma=void 0,this._defaultMinificationFilter=void 0,this._defaultMagnificationFilter=void 0,this.enablePickFeatures=e.enablePickFeatures??!0}Object.defineProperties(hB.prototype,{url:{get:function(){return this._resource.url}},urlSchemeZeroPadding:{get:function(){return this._urlSchemeZeroPadding}},pickFeaturesUrl:{get:function(){return this._pickFeaturesResource.url}},proxy:{get:function(){return this._resource.proxy}},tileWidth:{get:function(){return this._tileWidth}},tileHeight:{get:function(){return this._tileHeight}},maximumLevel:{get:function(){return this._maximumLevel}},minimumLevel:{get:function(){return this._minimumLevel}},tilingScheme:{get:function(){return this._tilingScheme}},rectangle:{get:function(){return this._rectangle}},tileDiscardPolicy:{get:function(){return this._tileDiscardPolicy}},errorEvent:{get:function(){return this._errorEvent}},credit:{get:function(){return this._credit}},hasAlphaChannel:{get:function(){return this._hasAlphaChannel}}});hB.prototype.getTileCredits=function(e,t,n){};hB.prototype.requestImage=function(e,t,n,i){return Uf.loadImage(this,Hrt(this,e,t,n,i))};hB.prototype.pickFeatures=function(e,t,n,i,r){if(!this.enablePickFeatures||!l(this._pickFeaturesResource)||this._getFeatureInfoFormats.length===0)return;let o=0,s=this;function a(u,f){return u.callback(f)}function c(){if(o>=s._getFeatureInfoFormats.length)return Promise.resolve([]);let u=s._getFeatureInfoFormats[o],f=Grt(s,e,t,n,i,r,u.format);return++o,u.type==="json"?f.fetchJson().then(u.callback).catch(c):u.type==="xml"?f.fetchXML().then(u.callback).catch(c):u.type==="text"||u.type==="html"?f.fetchText().then(u.callback).catch(c):f.fetch({responseType:u.format}).then(a.bind(void 0,u)).catch(c)}return c()};var CH=!1,zf=new ie,vH=!1,mB=new ie;function Hrt(e,t,n,i,r){CH=!1,vH=!1;let o=e._resource,s=o.getUrlComponent(!0),a=e._tags,c={},u=s.match(EAe);return l(u)&&u.forEach(function(f){let d=f.substring(1,f.length-1);l(a[d])&&(c[d]=a[d](e,t,n,i))}),o.getDerivedResource({request:r,templateValues:c})}var aZ=!1,YS=new U,cZ=!1;function Grt(e,t,n,i,r,o,s){CH=!1,vH=!1,aZ=!1,cZ=!1;let a=e._pickFeaturesResource,c=a.getUrlComponent(!0),u=e._pickFeaturesTags,f={},d=c.match(EAe);return l(d)&&d.forEach(function(p){let g=p.substring(1,p.length-1);l(u[g])&&(f[g]=u[g](e,t,n,i,r,o,s))}),a.getDerivedResource({templateValues:f})}function XS(e,t,n){if(e&&e.urlSchemeZeroPadding&&e.urlSchemeZeroPadding.hasOwnProperty(t)){let i=e.urlSchemeZeroPadding[t];if(typeof i=="string"){let r=i.length;r>1&&(n=n.length>=r?n:new Array(r-n.toString().length+1).join("0")+n)}}return n}function Wrt(e,t,n,i){return XS(e,"{x}",t)}function qrt(e,t,n,i){let r=e.tilingScheme.getNumberOfXTilesAtLevel(i)-t-1;return XS(e,"{reverseX}",r)}function Yrt(e,t,n,i){return XS(e,"{y}",n)}function Xrt(e,t,n,i){let r=e.tilingScheme.getNumberOfYTilesAtLevel(i)-n-1;return XS(e,"{reverseY}",r)}function Krt(e,t,n,i){let r=e.maximumLevel,o=l(r)&&i<r?r-i-1:i;return XS(e,"{reverseZ}",o)}function $rt(e,t,n,i){return XS(e,"{z}",i)}function Jrt(e,t,n,i){let r=(t+n+i)%e._subdomains.length;return e._subdomains[r]}function SH(e,t,n,i){CH||(e.tilingScheme.tileXYToRectangle(t,n,i,zf),zf.west=D.toDegrees(zf.west),zf.south=D.toDegrees(zf.south),zf.east=D.toDegrees(zf.east),zf.north=D.toDegrees(zf.north),CH=!0)}function Zrt(e,t,n,i){return SH(e,t,n,i),zf.west}function Qrt(e,t,n,i){return SH(e,t,n,i),zf.south}function eot(e,t,n,i){return SH(e,t,n,i),zf.east}function tot(e,t,n,i){return SH(e,t,n,i),zf.north}function wH(e,t,n,i){vH||(e.tilingScheme.tileXYToNativeRectangle(t,n,i,mB),vH=!0)}function not(e,t,n,i){return wH(e,t,n,i),mB.west}function iot(e,t,n,i){return wH(e,t,n,i),mB.south}function rot(e,t,n,i){return wH(e,t,n,i),mB.east}function oot(e,t,n,i){return wH(e,t,n,i),mB.north}function sot(e,t,n,i){return e.tileWidth}function aot(e,t,n,i){return e.tileHeight}function cot(e,t,n,i,r,o,s){return IH(e,t,n,i,r,o),YS.x}function lot(e,t,n,i,r,o,s){return IH(e,t,n,i,r,o),YS.y}function uot(e,t,n,i,r,o,s){return IH(e,t,n,i,r,o),e.tileWidth-YS.x-1}function fot(e,t,n,i,r,o,s){return IH(e,t,n,i,r,o),e.tileHeight-YS.y-1}var dot=new ie,qS=new h;function IH(e,t,n,i,r,o,s){if(aZ)return;lZ(e,t,n,i,r,o);let a=qS,c=e.tilingScheme.tileXYToNativeRectangle(t,n,i,dot);YS.x=e.tileWidth*(a.x-c.west)/c.width|0,YS.y=e.tileHeight*(c.north-a.y)/c.height|0,aZ=!0}function hot(e,t,n,i,r,o,s){return D.toDegrees(r)}function mot(e,t,n,i,r,o,s){return D.toDegrees(o)}function pot(e,t,n,i,r,o,s){return lZ(e,t,n,i,r,o),qS.x}function got(e,t,n,i,r,o,s){return lZ(e,t,n,i,r,o),qS.y}var _ot=new he;function lZ(e,t,n,i,r,o,s){if(!cZ){if(e.tilingScheme.projection instanceof Ui)qS.x=D.toDegrees(r),qS.y=D.toDegrees(o);else{let a=_ot;a.longitude=r,a.latitude=o,e.tilingScheme.projection.project(a,qS)}cZ=!0}}function yot(e,t,n,i,r,o,s){return s}var vs=hB;function Yd(e){vs.call(this,e)}Yd._requestMetadata=async function(e,t,n,i){try{let r=await n.fetchXML();return Yd._metadataSuccess(r,e,t,n,i)}catch(r){if(r instanceof wp)return Yd._metadataFailure(e,t);throw r}};Yd.fromUrl=async function(e,t){let n=De.createIfNeeded(e);n.appendForwardSlash();let i=n,r=n.getDerivedResource({url:"tilemapresource.xml"});t=t??H.EMPTY_OBJECT;let o=await Yd._requestMetadata(t,i,r);return new Yd(o)};l(Object.create)&&(Yd.prototype=Object.create(vs.prototype),Yd.prototype.constructor=Yd);function vAe(e,t){return e.west<t.rectangle.west&&(e.west=t.rectangle.west),e.east>t.rectangle.east&&(e.east=t.rectangle.east),e.south<t.rectangle.south&&(e.south=t.rectangle.south),e.north>t.rectangle.north&&(e.north=t.rectangle.north),e}function SAe(e,t,n){let i=e.positionToTileXY(ie.southwest(t),n),r=e.positionToTileXY(ie.northeast(t),n);return(Math.abs(r.x-i.x)+1)*(Math.abs(r.y-i.y)+1)>4?0:n}Yd._metadataSuccess=function(e,t,n,i,r){let o=/tileformat/i,s=/tileset/i,a=/tilesets/i,c=/boundingbox/i,u,f,d,p=[],g=e.childNodes[0].childNodes;for(let R=0;R<g.length;R++)if(o.test(g.item(R).nodeName))u=g.item(R);else if(a.test(g.item(R).nodeName)){d=g.item(R);let O=g.item(R).childNodes;for(let L=0;L<O.length;L++)s.test(O.item(L).nodeName)&&p.push(O.item(L))}else c.test(g.item(R).nodeName)&&(f=g.item(R));let m;if(!l(d)||!l(f))throw m=`Unable to find expected tilesets or bbox attributes in ${i.url}.`,l(r)&&Zr.reportError(void 0,r,r.errorEvent,m),new oe(m);let y=t.fileExtension??u.getAttribute("extension"),A=t.tileWidth??parseInt(u.getAttribute("width"),10),b=t.tileHeight??parseInt(u.getAttribute("height"),10),x=t.minimumLevel??parseInt(p[0].getAttribute("order"),10),T=t.maximumLevel??parseInt(p[p.length-1].getAttribute("order"),10),E=d.getAttribute("profile"),v=t.tilingScheme;if(!l(v))if(E==="geodetic"||E==="global-geodetic")v=new er({ellipsoid:t.ellipsoid});else if(E==="mercator"||E==="global-mercator")v=new Lo({ellipsoid:t.ellipsoid});else throw m=`${i.url} specifies an unsupported profile attribute, ${E}.`,l(r)&&Zr.reportError(void 0,r,r.errorEvent,m),new oe(m);let S=ie.clone(t.rectangle);if(!l(S)){let R,O,L,_;t.flipXY??!1?(L=new U(parseFloat(f.getAttribute("miny")),parseFloat(f.getAttribute("minx"))),_=new U(parseFloat(f.getAttribute("maxy")),parseFloat(f.getAttribute("maxx")))):(L=new U(parseFloat(f.getAttribute("minx")),parseFloat(f.getAttribute("miny"))),_=new U(parseFloat(f.getAttribute("maxx")),parseFloat(f.getAttribute("maxy"))));let w=E==="geodetic"||E==="mercator";if(v.projection instanceof Ui||w)R=he.fromDegrees(L.x,L.y),O=he.fromDegrees(_.x,_.y);else{let P=v.projection;R=P.unproject(L),O=P.unproject(_)}S=new ie(R.longitude,R.latitude,O.longitude,O.latitude)}return S=vAe(S,v),x=SAe(v,S,x),{url:n.getDerivedResource({url:`{z}/{x}/{reverseY}.${y}`}),tilingScheme:v,rectangle:S,tileWidth:A,tileHeight:b,minimumLevel:x,maximumLevel:T,tileDiscardPolicy:t.tileDiscardPolicy,credit:t.credit}};Yd._metadataFailure=function(e,t){let n=e.fileExtension??"png",i=e.tileWidth??256,r=e.tileHeight??256,o=e.maximumLevel,s=l(e.tilingScheme)?e.tilingScheme:new Lo({ellipsoid:e.ellipsoid}),a=e.rectangle??s.rectangle;a=vAe(a,s);let c=SAe(s,a,e.minimumLevel);return{url:t.getDerivedResource({url:`{z}/{x}/{reverseY}.${n}`}),tilingScheme:s,rectangle:a,tileWidth:i,tileHeight:r,minimumLevel:c,maximumLevel:o,tileDiscardPolicy:e.tileDiscardPolicy,credit:e.credit}};var wA=Yd;function wAe(e){this.channel=e.channel,this.ellipsoid=e.ellipsoid,this.tilingScheme=void 0,this.version=void 0}wAe.prototype.build=function(e){e._channel=this.channel,e._version=this.version,e._tilingScheme=this.tilingScheme};function Aot(e,t){let n;try{n=JSON.parse(e)}catch{n=JSON.parse(e.replace(/([\[\{,])[\n\r ]*([A-Za-z0-9]+)[\n\r ]*:/g,'$1"$2":'))}let i;for(let r=0;r<n.layers.length;r++)if(n.layers[r].id===t.channel){i=n.layers[r];break}if(!l(i)){let r=`Could not find layer with channel (id) of ${t.channel}.`;throw new oe(r)}if(!l(i.version)){let r=`Could not find a version in channel (id) ${t.channel}.`;throw new oe(r)}if(t.version=i.version,l(n.projection)&&n.projection==="flat")t.tilingScheme=new er({numberOfLevelZeroTilesX:2,numberOfLevelZeroTilesY:2,rectangle:new ie(-Math.PI,-Math.PI,Math.PI,Math.PI),ellipsoid:t.ellipsoid});else if(!l(n.projection)||n.projection==="mercator")t.tilingScheme=new Lo({numberOfLevelZeroTilesX:2,numberOfLevelZeroTilesY:2,ellipsoid:t.ellipsoid});else{let r=`Unsupported projection ${n.projection}.`;throw new oe(r)}return!0}function bot(e,t,n){let i=`An error occurred while accessing ${t.url}.`;throw l(e)&&l(e.message)&&(i+=`: ${e.message}`),Zr.reportError(void 0,n,l(n)?n._errorEvent:void 0,i),new oe(i)}async function xot(e,t,n){try{let i=await e.fetchText();Aot(i,t)}catch(i){bot(i,e,n)}}function Yu(e){e=e??{},this._defaultAlpha=void 0,this._defaultNightAlpha=void 0,this._defaultDayAlpha=void 0,this._defaultBrightness=void 0,this._defaultContrast=void 0,this._defaultHue=void 0,this._defaultSaturation=void 0,this._defaultGamma=1.9,this._defaultMinificationFilter=void 0,this._defaultMagnificationFilter=void 0,this._tileDiscardPolicy=e.tileDiscardPolicy,this._channel=e.channel,this._requestType="ImageryMaps",this._credit=new It(`<a href="http://www.google.com/enterprise/mapsearth/products/earthenterprise.html"><img src="${Yu.logoUrl}" title="Google Imagery"/></a>`),this._tilingScheme=void 0,this._version=void 0,this._tileWidth=256,this._tileHeight=256,this._maximumLevel=e.maximumLevel,this._errorEvent=new be}Object.defineProperties(Yu.prototype,{url:{get:function(){return this._url}},path:{get:function(){return this._path}},proxy:{get:function(){return this._resource.proxy}},channel:{get:function(){return this._channel}},tileWidth:{get:function(){return this._tileWidth}},tileHeight:{get:function(){return this._tileHeight}},maximumLevel:{get:function(){return this._maximumLevel}},minimumLevel:{get:function(){return 0}},tilingScheme:{get:function(){return this._tilingScheme}},version:{get:function(){return this._version}},requestType:{get:function(){return this._requestType}},rectangle:{get:function(){return this._tilingScheme.rectangle}},tileDiscardPolicy:{get:function(){return this._tileDiscardPolicy}},errorEvent:{get:function(){return this._errorEvent}},credit:{get:function(){return this._credit}},hasAlphaChannel:{get:function(){return!0}}});Yu.fromUrl=async function(e,t,n){n=n??{};let i=n.path??"/default_map",r=De.createIfNeeded(e).getDerivedResource({url:i[0]==="/"?i.substring(1):i});r.appendForwardSlash();let o=r.getDerivedResource({url:"query",queryParameters:{request:"Json",vars:"geeServerDefs",is2d:"t"}}),s=new wAe(n);s.channel=t,await xot(o,s);let a=new Yu(n);return s.build(a),a._resource=r,a._url=e,a._path=i,a};Yu.prototype.getTileCredits=function(e,t,n){};Yu.prototype.requestImage=function(e,t,n,i){let r=this._resource.getDerivedResource({url:"query",request:i,queryParameters:{request:this._requestType,channel:this._channel,version:this._version,x:e,y:t,z:n+1}});return Uf.loadImage(this,r)};Yu.prototype.pickFeatures=function(e,t,n,i,r){};Yu._logoUrl=void 0;Object.defineProperties(Yu,{logoUrl:{get:function(){return l(Yu._logoUrl)||(Yu._logoUrl=Zt("Assets/Images/google_earth_credit.png")),Yu._logoUrl},set:function(e){Yu._logoUrl=e}}});var pB=Yu;var Tot=/\/$/,IAe=new It('© <a href="https://www.mapbox.com/about/maps/">Mapbox</a> © <a href="http://www.openstreetmap.org/copyright">OpenStreetMap</a> <strong><a href="https://www.mapbox.com/map-feedback/">Improve this map</a></strong>');function KS(e){e=e??H.EMPTY_OBJECT;let t=e.mapId,n=e.accessToken;this._defaultAlpha=void 0,this._defaultNightAlpha=void 0,this._defaultDayAlpha=void 0,this._defaultBrightness=void 0,this._defaultContrast=void 0,this._defaultHue=void 0,this._defaultSaturation=void 0,this._defaultGamma=void 0,this._defaultMinificationFilter=void 0,this._defaultMagnificationFilter=void 0;let i=De.createIfNeeded(e.url??"https://{s}.tiles.mapbox.com/v4/");this._mapId=t,this._accessToken=n;let r=e.format??"png";/\./.test(r)||(r=`.${r}`),this._format=r;let o=i.getUrlComponent();Tot.test(o)||(o+="/"),o+=`${t}/{z}/{x}/{y}${this._format}`,i.url=o,i.setQueryParameters({access_token:n});let s;l(e.credit)?(s=e.credit,typeof s=="string"&&(s=new It(s))):s=IAe,this._resource=i,this._imageryProvider=new vs({url:i,credit:s,ellipsoid:e.ellipsoid,minimumLevel:e.minimumLevel,maximumLevel:e.maximumLevel,rectangle:e.rectangle})}Object.defineProperties(KS.prototype,{url:{get:function(){return this._imageryProvider.url}},rectangle:{get:function(){return this._imageryProvider.rectangle}},tileWidth:{get:function(){return this._imageryProvider.tileWidth}},tileHeight:{get:function(){return this._imageryProvider.tileHeight}},maximumLevel:{get:function(){return this._imageryProvider.maximumLevel}},minimumLevel:{get:function(){return this._imageryProvider.minimumLevel}},tilingScheme:{get:function(){return this._imageryProvider.tilingScheme}},tileDiscardPolicy:{get:function(){return this._imageryProvider.tileDiscardPolicy}},errorEvent:{get:function(){return this._imageryProvider.errorEvent}},credit:{get:function(){return this._imageryProvider.credit}},proxy:{get:function(){return this._imageryProvider.proxy}},hasAlphaChannel:{get:function(){return this._imageryProvider.hasAlphaChannel}}});KS.prototype.getTileCredits=function(e,t,n){};KS.prototype.requestImage=function(e,t,n,i){return this._imageryProvider.requestImage(e,t,n,i)};KS.prototype.pickFeatures=function(e,t,n,i,r){return this._imageryProvider.pickFeatures(e,t,n,i,r)};KS._defaultCredit=IAe;var gB=KS;function bT(e){e=e??H.EMPTY_OBJECT,this._defaultAlpha=void 0,this._defaultNightAlpha=void 0,this._defaultDayAlpha=void 0,this._defaultBrightness=void 0,this._defaultContrast=void 0,this._defaultHue=void 0,this._defaultSaturation=void 0,this._defaultGamma=void 0,this._defaultMinificationFilter=void 0,this._defaultMagnificationFilter=void 0;let t=e.rectangle??ie.MAX_VALUE,n=new er({rectangle:t,numberOfLevelZeroTilesX:1,numberOfLevelZeroTilesY:1,ellipsoid:e.ellipsoid});this._tilingScheme=n,this._image=void 0,this._texture=void 0,this._hasError=!1,this._errorEvent=new be;let i=e.credit;typeof i=="string"&&(i=new It(i)),this._credit=i;let r=De.createIfNeeded(e.url);this._resource=r,this._tileWidth=e.tileWidth,this._tileHeight=e.tileHeight}Object.defineProperties(bT.prototype,{url:{get:function(){return this._resource.url}},proxy:{get:function(){return this._resource.proxy}},tileWidth:{get:function(){return this._tileWidth}},tileHeight:{get:function(){return this._tileHeight}},maximumLevel:{get:function(){return 0}},minimumLevel:{get:function(){return 0}},tilingScheme:{get:function(){return this._tilingScheme}},rectangle:{get:function(){return this._tilingScheme.rectangle}},tileDiscardPolicy:{get:function(){}},errorEvent:{get:function(){return this._errorEvent}},credit:{get:function(){return this._credit}},hasAlphaChannel:{get:function(){return!0}}});function Eot(e,t,n,i){let r=`Failed to load image ${e.url}`;l(t)&&l(t.message)&&(r+=`: ${t.message}`);let o=Zr.reportError(i,n,l(n)?n._errorEvent:void 0,r,0,0,0,t);if(o.retry)return uZ(e,n,o);throw l(n)&&(n._hasError=!0),new oe(r)}async function uZ(e,t,n){try{return await Uf.loadImage(null,e)}catch(i){return Eot(e,i,t,n)}}bT.fromUrl=async function(e,t){let n=De.createIfNeeded(e),i=await uZ(n);t=t??H.EMPTY_OBJECT;let r=new bT({...t,url:e,tileWidth:i.width,tileHeight:i.height});return r._image=i,r};bT.prototype.getTileCredits=function(e,t,n){};bT.prototype.requestImage=async function(e,t,n,i){if(!this._hasError&&!l(this._image)){let r=await uZ(this._resource,this);return this._image=r,Zr.reportSuccess(this._errorEvent),r}return this._image};bT.prototype.pickFeatures=function(e,t,n,i,r){};var _B=bT;function Cot(e,t,n){this.type=e,l(t)||(e==="json"?t="application/json":e==="xml"?t="text/xml":e==="html"?t="text/html":e==="text"&&(t="text/plain")),this.format=t,l(n)||(e==="json"?n=vot:e==="xml"?n=Pot:(e==="html"||e==="text")&&(n=PAe)),this.callback=n}function vot(e){let t=[],n=e.features;for(let i=0;i<n.length;++i){let r=n[i],o=new gm;if(o.data=r,o.properties=r.properties,o.configureNameFromProperties(r.properties),o.configureDescriptionFromProperties(r.properties),l(r.geometry)&&r.geometry.type==="Point"){let s=r.geometry.coordinates[0],a=r.geometry.coordinates[1];o.position=he.fromDegrees(s,a)}t.push(o)}return t}var fZ="http://www.mapinfo.com/mxp",Sot="http://www.esri.com/wms",wot="http://www.opengis.net/wfs",Iot="http://www.opengis.net/gml";function Pot(e){let t=e.documentElement;if(t.localName==="MultiFeatureCollection"&&t.namespaceURI===fZ)return Dot(e);if(t.localName==="FeatureInfoResponse"&&t.namespaceURI===Sot)return Rot(e);if(t.localName==="FeatureCollection"&&t.namespaceURI===wot)return Oot(e);if(t.localName==="ServiceExceptionReport")throw new oe(new XMLSerializer().serializeToString(t));return t.localName==="msGMLOutput"?Mot(e):Not(e)}function Dot(e){let t=[],i=e.documentElement.getElementsByTagNameNS(fZ,"Feature");for(let r=0;r<i.length;++r){let o=i[r],s={},a=o.getElementsByTagNameNS(fZ,"Val");for(let u=0;u<a.length;++u){let f=a[u];if(f.hasAttribute("ref")){let d=f.getAttribute("ref"),p=f.textContent.trim();s[d]=p}}let c=new gm;c.data=o,c.properties=s,c.configureNameFromProperties(s),c.configureDescriptionFromProperties(s),t.push(c)}return t}function Rot(e){let t=e.documentElement,n=[],i,r=t.getElementsByTagNameNS("*","FIELDS");if(r.length>0)for(let o=0;o<r.length;++o){let s=r[o];i={};let a=s.attributes;for(let c=0;c<a.length;++c){let u=a[c];i[u.name]=u.value}n.push(PH(s,i))}else{let o=t.getElementsByTagNameNS("*","FeatureInfo");for(let s=0;s<o.length;++s){let a=o[s];i={};let c=a.childNodes;for(let u=0;u<c.length;++u){let f=c[u];f.nodeType===Node.ELEMENT_NODE&&(i[f.localName]=f.textContent)}n.push(PH(a,i))}}return n}function Oot(e){let t=[],i=e.documentElement.getElementsByTagNameNS(Iot,"featureMember");for(let r=0;r<i.length;++r){let o=i[r],s={};dZ(o,s),t.push(PH(o,s))}return t}function Mot(e){let t=[],n,i=e.documentElement.childNodes;for(let o=0;o<i.length;o++)if(i[o].nodeType===Node.ELEMENT_NODE){n=i[o];break}if(!l(n))throw new oe("Unable to find first child of the feature info xml document");let r=n.childNodes;for(let o=0;o<r.length;++o){let s=r[o];if(s.nodeType===Node.ELEMENT_NODE){let a={};dZ(s,a),t.push(PH(s,a))}}return t}function dZ(e,t){let n=!0;for(let i=0;i<e.childNodes.length;++i){let r=e.childNodes[i];r.nodeType===Node.ELEMENT_NODE&&(n=!1),!(r.localName==="Point"||r.localName==="LineString"||r.localName==="Polygon"||r.localName==="boundedBy")&&r.hasChildNodes()&&dZ(r,t)&&(t[r.localName]=r.textContent)}return n}function PH(e,t){let n=new gm;return n.data=e,n.properties=t,n.configureNameFromProperties(t),n.configureDescriptionFromProperties(t),n}function Not(e){let t=new XMLSerializer().serializeToString(e),n=document.createElement("div"),i=document.createElement("pre");i.textContent=t,n.appendChild(i);let r=new gm;return r.data=e,r.description=n.innerHTML,[r]}var Lot=/<body>\s*<\/body>/im,Fot=/<ServiceExceptionReport([\s\S]*)<\/ServiceExceptionReport>/im,Bot=/<title>([\s\S]*)<\/title>/im;function PAe(e){if(Lot.test(e)||Fot.test(e))return;let t,n=Bot.exec(e);n&&n.length>1&&(t=n[1]);let i=new gm;return i.name=t,i.description=e,i.data=e,[i]}var ym=Cot;function yB(e){e=e??H.EMPTY_OBJECT,this._tileCache={},this._tilesRequestedForInterval=[];let t=this._clock=e.clock;this._times=e.times,this._requestImageFunction=e.requestImageFunction,this._reloadFunction=e.reloadFunction,this._currentIntervalIndex=-1,t.onTick.addEventListener(this._clockOnTick,this),this._clockOnTick(t)}Object.defineProperties(yB.prototype,{clock:{get:function(){return this._clock},set:function(e){this._clock!==e&&(this._clock=e,this._clockOnTick(e),this._reloadFunction())}},times:{get:function(){return this._times},set:function(e){this._times!==e&&(this._times=e,this._clockOnTick(this._clock),this._reloadFunction())}},currentInterval:{get:function(){return this._times.get(this._currentIntervalIndex)}}});yB.prototype.getFromCache=function(e,t,n,i){let r=DAe(e,t,n),o,s=this._tileCache[this._currentIntervalIndex];if(l(s)&&l(s[r])){let a=s[r];o=a.promise.catch(function(c){throw i.state=a.request.state,c}),delete s[r]}return o};yB.prototype.checkApproachingInterval=function(e,t,n,i){let r=DAe(e,t,n),o=this._tilesRequestedForInterval,s=RAe(this),a={key:r,priorityFunction:i.priorityFunction};(!l(s)||!OAe(this,a,s))&&o.push(a),o.length>=512&&o.splice(0,256)};yB.prototype._clockOnTick=function(e){let t=e.currentTime,i=this._times.indexOf(t),r=this._currentIntervalIndex;if(i!==r){let s=this._tileCache[r];for(let a in s)s.hasOwnProperty(a)&&s[a].request.cancel();delete this._tileCache[r],this._tilesRequestedForInterval=[],this._currentIntervalIndex=i,this._reloadFunction();return}let o=RAe(this);if(l(o)){let s=this._tilesRequestedForInterval,a=!0;for(;a&&s.length!==0;){let c=s.pop();a=OAe(this,c,o),a||s.push(c)}}};function DAe(e,t,n){return`${e}-${t}-${n}`}function kot(e){let t=e.split("-");if(t.length===3)return{x:Number(t[0]),y:Number(t[1]),level:Number(t[2])}}function RAe(e){let t=e._times;if(!l(t))return;let n=e._clock,i=n.currentTime,r=n.canAnimate&&n.shouldAnimate,o=n.multiplier;if(!r&&o!==0)return;let s,a=t.indexOf(i);if(a<0)return;let c=t.get(a);return o>0?(s=K.secondsDifference(c.stop,i),++a):(s=K.secondsDifference(c.start,i),--a),s/=o,a>=0&&s<=5?t.get(a):void 0}function OAe(e,t,n){let i=e._times.indexOf(n.start),r=e._tileCache,o=r[i];l(o)||(o=r[i]={});let s=t.key;if(l(o[s]))return!0;let a=kot(s),c=new wo({throttle:!1,throttleByServer:!0,type:Zs.IMAGERY,priorityFunction:t.priorityFunction}),u=e._requestImageFunction(a.x,a.y,a.level,c,n);return l(u)?(o[s]={promise:u,request:c},!0):!1}var xT=yB;var Uot=[3034,3035,3042,3043,3044],zot=[4471,4559];function Am(e){if(e=e??H.EMPTY_OBJECT,l(e.times)&&!l(e.clock))throw new pe("options.times was specified, so options.clock is required.");this._defaultAlpha=void 0,this._defaultNightAlpha=void 0,this._defaultDayAlpha=void 0,this._defaultBrightness=void 0,this._defaultContrast=void 0,this._defaultHue=void 0,this._defaultSaturation=void 0,this._defaultGamma=void 0,this._defaultMinificationFilter=void 0,this._defaultMagnificationFilter=void 0,this._getFeatureInfoUrl=e.getFeatureInfoUrl??e.url;let t=De.createIfNeeded(e.url),n=De.createIfNeeded(this._getFeatureInfoUrl);t.setQueryParameters(Am.DefaultParameters,!0),n.setQueryParameters(Am.GetFeatureInfoDefaultParameters,!0),l(e.parameters)&&t.setQueryParameters(MAe(e.parameters)),l(e.getFeatureInfoParameters)&&n.setQueryParameters(MAe(e.getFeatureInfoParameters));let i=this;this._reload=void 0,l(e.times)&&(this._timeDynamicImagery=new xT({clock:e.clock,times:e.times,requestImageFunction:function(s,a,c,u,f){return NAe(i,s,a,c,u,f)},reloadFunction:function(){l(i._reload)&&i._reload()}}));let r={};if(r.layers=e.layers,r.bbox="{westProjected},{southProjected},{eastProjected},{northProjected}",r.width="{width}",r.height="{height}",parseFloat(t.queryParameters.version)>=1.3){r.crs=e.crs??(e.tilingScheme&&e.tilingScheme.projection instanceof yi?"EPSG:3857":"CRS:84");let s=r.crs.split(":");if(s[0]==="EPSG"&&s.length===2){let a=Number(s[1]);(a>=4e3&&a<5e3&&!zot.includes(a)||Uot.includes(a))&&(r.bbox="{southProjected},{westProjected},{northProjected},{eastProjected}")}}else r.srs=e.srs??(e.tilingScheme&&e.tilingScheme.projection instanceof yi?"EPSG:3857":"EPSG:4326");t.setQueryParameters(r,!0),n.setQueryParameters(r,!0);let o={query_layers:e.layers,info_format:"{format}"};parseFloat(n.queryParameters.version)>=1.3?(o.i="{i}",o.j="{j}"):(o.x="{i}",o.y="{j}"),n.setQueryParameters(o,!0),this._resource=t,this._pickFeaturesResource=n,this._layers=e.layers,this._tileProvider=new vs({url:t,pickFeaturesUrl:n,tilingScheme:e.tilingScheme??new er({ellipsoid:e.ellipsoid}),rectangle:e.rectangle,tileWidth:e.tileWidth,tileHeight:e.tileHeight,minimumLevel:e.minimumLevel,maximumLevel:e.maximumLevel,subdomains:e.subdomains,tileDiscardPolicy:e.tileDiscardPolicy,credit:e.credit,getFeatureInfoFormats:e.getFeatureInfoFormats??Am.DefaultGetFeatureInfoFormats,enablePickFeatures:e.enablePickFeatures})}function NAe(e,t,n,i,r,o){let s=l(o)?o.data:void 0,a=e._tileProvider;return l(s)&&a._resource.setQueryParameters(s),a.requestImage(t,n,i,r)}function Vot(e,t,n,i,r,o,s){let a=l(s)?s.data:void 0,c=e._tileProvider;return l(a)&&c._pickFeaturesResource.setQueryParameters(a),c.pickFeatures(t,n,i,r,o)}Object.defineProperties(Am.prototype,{url:{get:function(){return this._resource._url}},proxy:{get:function(){return this._resource.proxy}},layers:{get:function(){return this._layers}},tileWidth:{get:function(){return this._tileProvider.tileWidth}},tileHeight:{get:function(){return this._tileProvider.tileHeight}},maximumLevel:{get:function(){return this._tileProvider.maximumLevel}},minimumLevel:{get:function(){return this._tileProvider.minimumLevel}},tilingScheme:{get:function(){return this._tileProvider.tilingScheme}},rectangle:{get:function(){return this._tileProvider.rectangle}},tileDiscardPolicy:{get:function(){return this._tileProvider.tileDiscardPolicy}},errorEvent:{get:function(){return this._tileProvider.errorEvent}},credit:{get:function(){return this._tileProvider.credit}},hasAlphaChannel:{get:function(){return this._tileProvider.hasAlphaChannel}},enablePickFeatures:{get:function(){return this._tileProvider.enablePickFeatures},set:function(e){this._tileProvider.enablePickFeatures=e}},clock:{get:function(){return this._timeDynamicImagery.clock},set:function(e){this._timeDynamicImagery.clock=e}},times:{get:function(){return this._timeDynamicImagery.times},set:function(e){this._timeDynamicImagery.times=e}},getFeatureInfoUrl:{get:function(){return this._getFeatureInfoUrl}}});Am.prototype.getTileCredits=function(e,t,n){return this._tileProvider.getTileCredits(e,t,n)};Am.prototype.requestImage=function(e,t,n,i){let r,o=this._timeDynamicImagery,s;return l(o)&&(s=o.currentInterval,r=o.getFromCache(e,t,n,i)),l(r)||(r=NAe(this,e,t,n,i,s)),l(r)&&l(o)&&o.checkApproachingInterval(e,t,n,i),r};Am.prototype.pickFeatures=function(e,t,n,i,r){let o=this._timeDynamicImagery,s=l(o)?o.currentInterval:void 0;return Vot(this,e,t,n,i,r,s)};Am.DefaultParameters=Object.freeze({service:"WMS",version:"1.1.1",request:"GetMap",styles:"",format:"image/jpeg"});Am.GetFeatureInfoDefaultParameters=Object.freeze({service:"WMS",version:"1.1.1",request:"GetFeatureInfo"});Am.DefaultGetFeatureInfoFormats=Object.freeze([Object.freeze(new ym("json","application/json")),Object.freeze(new ym("xml","text/xml")),Object.freeze(new ym("text","text/html"))]);function MAe(e){let t={};for(let n in e)e.hasOwnProperty(n)&&(t[n.toLowerCase()]=e[n]);return t}var AB=Am;function Vf(e){e=e??H.EMPTY_OBJECT,this._defaultAlpha=void 0,this._defaultNightAlpha=void 0,this._defaultDayAlpha=void 0,this._defaultBrightness=void 0,this._defaultContrast=void 0,this._defaultHue=void 0,this._defaultSaturation=void 0,this._defaultGamma=void 0,this._defaultMinificationFilter=void 0,this._defaultMagnificationFilter=void 0,this._getFeatureInfoUrl=e.getFeatureInfoUrl??e.url;let t=De.createIfNeeded(e.url),n=De.createIfNeeded(this._getFeatureInfoUrl),i=e.style,r=e.tileMatrixSetID,o=t.url,s=e.format??"image/jpeg",a=o.match(/{/g);if(!l(a)||a.length===1&&/{s}/.test(o)?(t.setQueryParameters(Vf.DefaultParameters,!0),this._useKvp=!0):(t.setTemplateValues(Vf.DefaultParameters,!0),this._useKvp=!1),this._useKvp){n.setQueryParameters(Vf.GetFeatureInfoDefaultParameters,!0),l(e.getFeatureInfoParameters)&&n.setQueryParameters(LAe(e.getFeatureInfoParameters));let f={infoformat:"{format}",i:"{i}",j:"{j}"};n.setQueryParameters(f,!0)}else n.setTemplateValues(Vf.GetFeatureInfoDefaultParameters,!0),l(e.getFeatureInfoParameters)&&n.setTemplateValues(LAe(e.getFeatureInfoParameters));this._resource=t,this._tileMatrixLabels=e.tileMatrixLabels,this._format=s,this._dimensions=e.dimensions,this._tilematrixset=r;let c={};c.tilematrix="{TileMatrix}",c.layer=e.layer,c.style=i,c.tilerow="{TileRow}",c.tilecol="{TileCol}",c.tilematrixset=r,this._useKvp?(t.setQueryParameters(c,!0),t.setQueryParameters({format:s},!0),n.setQueryParameters({format:s},!0),n.setQueryParameters(c,!0)):(c.Style=i,t.setTemplateValues(c),t.setTemplateValues({format:s}),n.setTemplateValues(c));let u=this;this._reload=void 0,l(e.times)&&(this._timeDynamicImagery=new xT({clock:e.clock,times:e.times,requestImageFunction:function(f,d,p,g,m){return FAe(u,f,d,p,g,m)},reloadFunction:function(){l(u._reload)&&u._reload()}})),this._errorEvent=new be,this._tileProvider=new vs({url:t,pickFeaturesUrl:n,tilingScheme:e.tilingScheme??new Lo({ellipsoid:e.ellipsoid}),rectangle:e.rectangle,tileWidth:e.tileWidth,tileHeight:e.tileHeight,minimumLevel:e.minimumLevel,maximumLevel:e.maximumLevel,subdomains:e.subdomains,tileDiscardPolicy:e.tileDiscardPolicy,credit:e.credit,getFeatureInfoFormats:e.getFeatureInfoFormats??Vf.DefaultGetFeatureInfoFormats,enablePickFeatures:e.enablePickFeatures??(this._useKvp||l(e.getFeatureInfoUrl)),customTags:Hot(this)})}function FAe(e,t,n,i,r,o){let s=e._tileProvider;return BAe(e,s._resource,o),s.requestImage(t,n,i,r)}function jot(e,t,n,i,r,o,s){let a=e._tileProvider;return BAe(e,a._pickFeaturesResource,s),a.pickFeatures(t,n,i,r,o)}Object.defineProperties(Vf.prototype,{url:{get:function(){return this._resource.url}},proxy:{get:function(){return this._resource.proxy}},tileWidth:{get:function(){return this._tileProvider.tileWidth}},tileHeight:{get:function(){return this._tileProvider.tileHeight}},maximumLevel:{get:function(){return this._tileProvider.maximumLevel}},minimumLevel:{get:function(){return this._tileProvider.minimumLevel}},tilingScheme:{get:function(){return this._tileProvider.tilingScheme}},rectangle:{get:function(){return this._tileProvider.rectangle}},tileDiscardPolicy:{get:function(){return this._tileProvider.tileDiscardPolicy}},errorEvent:{get:function(){return this._tileProvider.errorEvent}},format:{get:function(){return this._format}},credit:{get:function(){return this._tileProvider.credit}},hasAlphaChannel:{get:function(){return!0}},enablePickFeatures:{get:function(){return this._tileProvider.enablePickFeatures},set:function(e){this._tileProvider.enablePickFeatures=e}},clock:{get:function(){return this._timeDynamicImagery.clock},set:function(e){this._timeDynamicImagery.clock=e}},times:{get:function(){return this._timeDynamicImagery.times},set:function(e){this._timeDynamicImagery.times=e}},dimensions:{get:function(){return this._dimensions},set:function(e){this._dimensions!==e&&(this._dimensions=e,l(this._reload)&&this._reload())}},getFeatureInfoUrl:{get:function(){return this._getFeatureInfoUrl}}});Vf.prototype.getTileCredits=function(e,t,n){return this._tileProvider.getTileCredits(e,t,n)};Vf.prototype.requestImage=function(e,t,n,i){let r,o=this._timeDynamicImagery,s;return l(o)&&(s=o.currentInterval,r=o.getFromCache(e,t,n,i)),l(r)||(r=FAe(this,e,t,n,i,s)),l(r)&&l(o)&&o.checkApproachingInterval(e,t,n,i),r};Vf.prototype.pickFeatures=function(e,t,n,i,r){let o=this._timeDynamicImagery,s=l(o)?o.currentInterval:void 0;return jot(this,e,t,n,i,r,s)};Vf.DefaultParameters=Object.freeze({service:"WMTS",version:"1.0.0",request:"GetTile"});Vf.GetFeatureInfoDefaultParameters=Object.freeze({service:"WMTS",version:"1.0.0",request:"GetFeatureInfo"});Vf.DefaultGetFeatureInfoFormats=Object.freeze([Object.freeze(new ym("json","application/json")),Object.freeze(new ym("xml","text/xml")),Object.freeze(new ym("text","text/html"))]);function BAe(e,t,n){let i=e._dimensions,r=l(n)?n.data:void 0;if(!e._useKvp)l(i)&&t.setTemplateValues(i),l(r)&&t.setTemplateValues(r);else{let o={};l(i)&&(o=Ot(o,i)),l(r)&&(o=Ot(o,r)),t.setQueryParameters(o)}}function Hot(e){function t(n){let i=e._tileMatrixLabels;return l(i)?i[n]:n.toString()}return{TileMatrix:function(n,i,r,o){return t(o)},tilematrix:function(n,i,r,o){return t(o)},TileRow:function(n,i,r){return r.toString()},tilerow:function(n,i,r){return r.toString()},TileCol:function(n,i,r){return i.toString()},tilecol:function(n,i,r){return i.toString()},TileMatrixSet:function(n){return e._tilematrixset},tilematrixset:function(n){return e._tilematrixset}}}function LAe(e){let t={};for(let n in e)e.hasOwnProperty(n)&&(t[n.toLowerCase()]=e[n]);return t}var bB=Vf;var $S={};$S.defaultApiKey=void 0;$S.mapTilesApiEndpoint=new De({url:"https://tile.googleapis.com/"});$S.defaultStreetViewStaticApiKey=void 0;$S.streetViewStaticApiEndpoint=new De({url:"https://maps.googleapis.com/maps/api/streetview"});$S.getDefaultCredit=function(){return new It('<img alt="Google" src="https://assets.ion.cesium.com/google-credit.png" style="vertical-align:-6px">',!0)};var Ta=$S;var kAe=/\/$/;function e_(e){e=e??H.EMPTY_OBJECT,this._maximumLevel=e.maximumLevel??22,this._minimumLevel=e.minimumLevel??0,this._session=e.session,this._key=e.key,this._tileWidth=e.tileWidth,this._tileHeight=e.tileHeight;let t=e.url instanceof Ho?e.url:De.createIfNeeded(e.url??Ta.mapTilesApiEndpoint),n=t.getUrlComponent();kAe.test(n)||(n+="/");let i=`${n}v1/2dtiles/{z}/{x}/{y}`;this._viewportUrl=`${n}tile/v1/viewport`,t.url=i,t.setQueryParameters({session:encodeURIComponent(e.session),key:encodeURIComponent(e.key)}),this._resource=t.clone();let r;l(e.credit)&&(r=e.credit,typeof r=="string"&&(r=new It(r)));let o=new vs({url:t,credit:r,tileWidth:e.tileWidth,tileHeight:e.tileHeight,ellipsoid:e.ellipsoid,rectangle:e.rectangle,maximumLevel:this._maximumLevel,minimumLevel:this._minimumLevel});o._resource=t,this._imageryProvider=o,this._tileCredits=t.credits,this._attributionsByLevel=void 0}Object.defineProperties(e_.prototype,{url:{get:function(){return this._imageryProvider.url}},rectangle:{get:function(){return this._imageryProvider.rectangle}},tileWidth:{get:function(){return this._imageryProvider.tileWidth}},tileHeight:{get:function(){return this._imageryProvider.tileHeight}},maximumLevel:{get:function(){return this._imageryProvider.maximumLevel}},minimumLevel:{get:function(){return this._imageryProvider.minimumLevel}},tilingScheme:{get:function(){return this._imageryProvider.tilingScheme}},tileDiscardPolicy:{get:function(){return this._imageryProvider.tileDiscardPolicy}},errorEvent:{get:function(){return this._imageryProvider.errorEvent}},credit:{get:function(){return this._imageryProvider.credit}},proxy:{get:function(){return this._imageryProvider.proxy}},hasAlphaChannel:{get:function(){return this._imageryProvider.hasAlphaChannel}}});e_.fromIonAssetId=async function(e){e=e??{},e.mapType=e.mapType??"satellite",e.language=e.language??"en_US",e.region=e.region??"US";let t=e.overlayLayerType,n=UAe(e),i=Ho._createEndpointResource(e.assetId,{queryParameters:{options:JSON.stringify(n)}}),r={language:e.language,region:e.region,ellipsoid:e.ellipsoid,minimumLevel:e.minimumLevel,maximumLevel:e.maximumLevel,rectangle:e.rectangle,credit:e.credit},o=await i.fetchJson(),s=o.options.url;return delete o.options.url,o.options={...o.options,...r},hZ(s,o,i)};e_.fromUrl=async function(e){e=e??{},e.mapType=e.mapType??"satellite",e.language=e.language??"en_US",e.region=e.region??"US",e.url=e.url??Ta.mapTilesApiEndpoint,e.key=e.key??Ta.defaultApiKey;let t=e.overlayLayerType,n=await Wot(e);return new e_({...n,...e,credit:e.credit??Ta.getDefaultCredit()})};e_.prototype.getTileCredits=function(e,t,n){if(!l(this._attributionsByLevel)||!l(this._tileCredits))return;let r=this._attributionsByLevel.get(n);return l(this._tileCredits)?this._tileCredits.concat(r):r};e_.prototype.requestImage=function(e,t,n,i){let r=this._imageryProvider.requestImage(e,t,n,i);if(l(r))return l(this._attributionsByLevel)?r:Promise.all([r,this.getViewportCredits()]).then(o=>o[0])};e_.prototype.pickFeatures=function(e,t,n,i,r){};e_.prototype.getViewportCredits=async function(){let e=this._maximumLevel,t=[];for(let r=0;r<e+1;r++)t.push(Got(this._resource,this._viewportUrl,r));let n=await Promise.all(t),i=new Map;for(let r=0;r<e+1;r++){let o=[],s=n[r];if(s){let a=new It(s);o.push(a)}i.set(r,o)}return this._attributionsByLevel=i,i};async function Got(e,t,n){return(await e.getDerivedResource({url:t,queryParameters:{zoom:n,north:90,south:-90,east:180,west:-180},data:JSON.stringify(H.EMPTY_OBJECT)}).fetchJson()).copyright}function UAe(e){let{mapType:t,overlayLayerType:n,styles:i}=e,r={mapType:t,overlay:!1};return t==="terrain"&&!l(n)&&(r.layerTypes=["layerRoadmap"]),l(n)&&(r.mapType="satellite",r.overlay=!0,r.layerTypes=[n]),l(i)&&(r.styles=i),r}async function Wot(e){let{language:t,region:n,key:i,url:r}=e,o=UAe(e),s=r.url??r;kAe.test(s)||(s+="/");let a=await De.post({url:`${s}v1/createSession`,queryParameters:{key:i},data:JSON.stringify({...o,language:t,region:n})});return JSON.parse(a)}var xB=e_;var qot=/\/$/;function JS(e){e=e??{};let t=e.tilesetId??"microsoft.imagery";this._maximumLevel=e.maximumLevel??22,this._minimumLevel=e.minimumLevel??0,this._subscriptionKey=e.subscriptionKey??e["subscription-key"],this._tilesetId=e.tilesetId;let n=e.url instanceof Ho?e.url:De.createIfNeeded(e.url??"https://atlas.microsoft.com/"),i=n.getUrlComponent();qot.test(i)||(i+="/");let r=`${i}map/tile`;this._viewportUrl=`${i}map/attribution`,n.url=r,n.setQueryParameters({"api-version":"2024-04-01",tilesetId:t,"subscription-key":this._subscriptionKey,zoom:"{z}",x:"{x}",y:"{y}"}),this._resource=n;let o;l(e.credit)&&(o=e.credit,typeof o=="string"&&(o=new It(o)));let s=new vs({...e,maximumLevel:this._maximumLevel,minimumLevel:this._minimumLevel,url:n,credit:o});s._resource=n,this._imageryProvider=s,this._tileCredits=n.credits,this._attributionsByLevel=void 0}Object.defineProperties(JS.prototype,{url:{get:function(){return this._imageryProvider.url}},rectangle:{get:function(){return this._imageryProvider.rectangle}},tileWidth:{get:function(){return this._imageryProvider.tileWidth}},tileHeight:{get:function(){return this._imageryProvider.tileHeight}},maximumLevel:{get:function(){return this._imageryProvider.maximumLevel}},minimumLevel:{get:function(){return this._imageryProvider.minimumLevel}},tilingScheme:{get:function(){return this._imageryProvider.tilingScheme}},tileDiscardPolicy:{get:function(){return this._imageryProvider.tileDiscardPolicy}},errorEvent:{get:function(){return this._imageryProvider.errorEvent}},credit:{get:function(){return this._imageryProvider.credit}},proxy:{get:function(){return this._imageryProvider.proxy}},hasAlphaChannel:{get:function(){return this._imageryProvider.hasAlphaChannel}}});JS.prototype.getTileCredits=function(e,t,n){if(!l(this._attributionsByLevel)||!l(this._tileCredits))return;let r=this._attributionsByLevel.get(n);return l(this._tileCredits)?this._tileCredits.concat(r):r};JS.prototype.requestImage=function(e,t,n,i){let r=this._imageryProvider.requestImage(e,t,n,i);if(l(r))return l(this._attributionsByLevel)?r:Promise.all([r,this.getViewportCredits()]).then(o=>o[0])};JS.prototype.pickFeatures=function(e,t,n,i,r){};JS.prototype.getViewportCredits=async function(){let e=this._maximumLevel,t=[];for(let r=0;r<e+1;r++)t.push(Yot(this._resource,this._viewportUrl,this._subscriptionKey,this._tilesetId,r));let n=await Promise.all(t),i=new Map;for(let r=0;r<e+1;r++){let o=[],s=n[r].join(",");if(s){let a=new It(s);o.push(a)}i.set(r,o)}return this._attributionsByLevel=i,i};async function Yot(e,t,n,i,r){return(await e.getDerivedResource({url:t,queryParameters:{zoom:r,bounds:"-180,-90,180,90"},data:JSON.stringify(H.EMPTY_OBJECT)}).fetchJson()).copyrights}var TB=JS;var Xot=async(e,t,n)=>wA.fromUrl(new Ho(t,n)),Kot=async(e,{options:t})=>Qg.fromUrl(e,t),$ot=async(e,{options:t})=>dB.fromUrl(e,t),Jot=async(e,{options:t})=>{let n=t.channel;return delete t.channel,pB.fromUrl(e,n,t)},Zot=async(e,{options:t})=>new gB({url:e,...t}),Qot=async(e,{options:t})=>_B.fromUrl(e,t),est=async(e,{options:t})=>wA.fromUrl(e,t),tst=async(e,{options:t})=>new vs({url:e,...t}),nst=async(e,{options:t})=>new AB({url:e,...t}),ist=async(e,{options:t})=>new bB({url:e,...t}),hZ=async(e,t,n)=>{delete t.externalType,t.url=e;let i=new Ho(t,n),r=(o,s)=>{delete s.externalType,s.url=e;let{options:a}=s;o.setQueryParameters({session:a.session,key:a.key})};return i.refreshCallback=r,new xB({...t.options,url:i})},rst=async(e,t,n)=>{delete t.externalType,t.url=e;let i=new Ho(t,n),r=(o,s)=>{delete s.externalType,s.url=e;let{options:a}=s;o.setQueryParameters({"subscription-key":a["subscription-key"]})};return i.refreshCallback=r,new TB({...t.options,url:i})},ost={ARCGIS_MAPSERVER:Kot,BING:$ot,GOOGLE_EARTH:Jot,MAPBOX:Zot,SINGLE_TILE:Qot,TMS:est,URL_TEMPLATE:tst,WMS:nst,WMTS:ist,GOOGLE_2D_MAPS:hZ,AZURE_MAPS:rst,defaultFactoryCallback:Xot},ZS=Object.freeze(ost);function $p(){this._defaultAlpha=void 0,this._defaultNightAlpha=void 0,this._defaultDayAlpha=void 0,this._defaultBrightness=void 0,this._defaultContrast=void 0,this._defaultHue=void 0,this._defaultSaturation=void 0,this._defaultGamma=void 0,this._defaultMinificationFilter=void 0,this._defaultMagnificationFilter=void 0,this._tileCredits=void 0,this._errorEvent=new be}Object.defineProperties($p.prototype,{rectangle:{get:function(){return this._imageryProvider.rectangle}},tileWidth:{get:function(){return this._imageryProvider.tileWidth}},tileHeight:{get:function(){return this._imageryProvider.tileHeight}},maximumLevel:{get:function(){return this._imageryProvider.maximumLevel}},minimumLevel:{get:function(){return this._imageryProvider.minimumLevel}},tilingScheme:{get:function(){return this._imageryProvider.tilingScheme}},tileDiscardPolicy:{get:function(){return this._imageryProvider.tileDiscardPolicy}},errorEvent:{get:function(){return this._errorEvent}},credit:{get:function(){return this._imageryProvider.credit}},hasAlphaChannel:{get:function(){return this._imageryProvider.hasAlphaChannel}},proxy:{get:function(){}}});$p.fromAssetId=async function(e,t){t=t??H.EMPTY_OBJECT;let n=Ho._createEndpointResource(e,t),i=e.toString()+t.accessToken+t.server,r=$p._endpointCache[i];l(r)||(r=n.fetchJson(),$p._endpointCache[i]=r);let o=await r;if(o.type!=="IMAGERY")throw new oe(`Cesium ion asset ${e} is not an imagery asset.`);let s=o.externalType,a=ZS.defaultFactoryCallback;o=Je(o,!0),o.options=o.options??{};let c=o.options?.url;if(delete t.url,l(s)&&(a=ZS[s],!l(a)))throw new oe(`Unrecognized Cesium ion imagery type: ${s}`);let u=await a(c,o,n),f=new $p(t);return u.errorEvent.addEventListener(function(d){d.provider=f,f._errorEvent.raiseEvent(d)}),f._tileCredits=Ho.getCreditsFromEndpoint(o,n),f._imageryProvider=u,f};$p.prototype.getTileCredits=function(e,t,n){let i=this._imageryProvider.getTileCredits(e,t,n);return l(i)?this._tileCredits.concat(i):this._tileCredits};$p.prototype.requestImage=function(e,t,n,i){return this._imageryProvider.requestImage(e,t,n,i)};$p.prototype.pickFeatures=function(e,t,n,i,r){return this._imageryProvider.pickFeatures(e,t,n,i,r)};$p._endpointCache={};var ou=$p;var zAe={AERIAL:2,AERIAL_WITH_LABELS:3,ROAD:4};Object.freeze(zAe);var t_=zAe;function sst(e){e=e??H.EMPTY_OBJECT;let t=e.style??t_.AERIAL;return ou.fromAssetId(t)}var n_=sst;function Ws(){pe.throwInstantiationError()}Object.defineProperties(Ws.prototype,{errorEvent:{get:pe.throwInstantiationError},credit:{get:pe.throwInstantiationError},tilingScheme:{get:pe.throwInstantiationError},hasWaterMask:{get:pe.throwInstantiationError},hasVertexNormals:{get:pe.throwInstantiationError},availability:{get:pe.throwInstantiationError}});var VAe=[];Ws.getRegularGridIndices=function(e,t){let n=VAe[e];l(n)||(VAe[e]=n=[]);let i=n[t];return l(i)||(e*t<D.SIXTY_FOUR_KILOBYTES?i=n[t]=new Uint16Array((e-1)*(t-1)*6):i=n[t]=new Uint32Array((e-1)*(t-1)*6),WAe(e,t,i,0)),i};var jAe=[];Ws.getRegularGridIndicesAndEdgeIndices=function(e,t){let n=jAe[e];l(n)||(jAe[e]=n=[]);let i=n[t];if(!l(i)){let r=Ws.getRegularGridIndices(e,t),o=GAe(e,t),s=o.westIndicesSouthToNorth,a=o.southIndicesEastToWest,c=o.eastIndicesNorthToSouth,u=o.northIndicesWestToEast;i=n[t]={indices:r,westIndicesSouthToNorth:s,southIndicesEastToWest:a,eastIndicesNorthToSouth:c,northIndicesWestToEast:u}}return i};var HAe=[];Ws.getRegularGridAndSkirtIndicesAndEdgeIndices=function(e,t){let n=HAe[e];l(n)||(HAe[e]=n=[]);let i=n[t];if(!l(i)){let r=e*t,o=(e-1)*(t-1)*6,s=e*2+t*2,a=Math.max(0,s-4)*6,c=r+s,u=o+a,f=GAe(e,t),d=f.westIndicesSouthToNorth,p=f.southIndicesEastToWest,g=f.eastIndicesNorthToSouth,m=f.northIndicesWestToEast,y=je.createTypedArray(c,u);WAe(e,t,y,0),Ws.addSkirtIndices(d,p,g,m,r,y,o),i=n[t]={indices:y,westIndicesSouthToNorth:d,southIndicesEastToWest:p,eastIndicesNorthToSouth:g,northIndicesWestToEast:m,indexCountWithoutSkirts:o}}return i};Ws.getSkirtVertexCount=function(e,t,n,i){return e.length+t.length+n.length+i.length};Ws.getSkirtIndexCount=function(e){return(e-4)*2*3};Ws.getSkirtIndexCountWithFilledCorners=function(e){return((e-4)*2+4)*3};Ws.addSkirtIndices=function(e,t,n,i,r,o,s){let a=r;s=DH(e,a,o,s),a+=e.length,s=DH(t,a,o,s),a+=t.length,s=DH(n,a,o,s),a+=n.length,DH(i,a,o,s)};Ws.addSkirtIndicesWithFilledCorners=function(e,t,n,i,r,o,s){Ws.addSkirtIndices(e,t,n,i,r,o,s);let a=Ws.getSkirtVertexCount(e,t,n,i),c=Ws.getSkirtIndexCount(a),u=s+c,f=e[0],d=i[0],p=n[0],g=t[0],m=r,y=m+e.length-1,A=y+1,b=A+t.length-1,x=b+1,T=x+n.length-1,E=T+1,v=E+i.length-1;o[u+0]=f,o[u+1]=m,o[u+2]=b,o[u+3]=g,o[u+4]=A,o[u+5]=T,o[u+6]=p,o[u+7]=x,o[u+8]=v,o[u+9]=d,o[u+10]=E,o[u+11]=y};function GAe(e,t){let n=new Array(t),i=new Array(e),r=new Array(t),o=new Array(e),s;for(s=0;s<e;++s)o[s]=s,i[s]=e*t-1-s;for(s=0;s<t;++s)r[s]=(s+1)*e-1,n[s]=(t-s-1)*e;return{westIndicesSouthToNorth:n,southIndicesEastToWest:i,eastIndicesNorthToSouth:r,northIndicesWestToEast:o}}function WAe(e,t,n,i){let r=0;for(let o=0;o<t-1;++o){for(let s=0;s<e-1;++s){let a=r,c=a+e,u=c+1,f=a+1;n[i++]=a,n[i++]=c,n[i++]=f,n[i++]=f,n[i++]=c,n[i++]=u,++r}++r}}function DH(e,t,n,i){let r=e[0],o=e.length;for(let s=1;s<o;++s){let a=e[s];n[i++]=r,n[i++]=a,n[i++]=t,n[i++]=t,n[i++]=a,n[i++]=t+1,r=a,++t}return i}Ws.heightmapTerrainQuality=.25;Ws.getEstimatedLevelZeroGeometricErrorForAHeightmap=function(e,t,n){return e.maximumRadius*2*Math.PI*Ws.heightmapTerrainQuality/(t*n)};Ws.prototype.requestTileGeometry=pe.throwInstantiationError;Ws.prototype.getLevelMaximumGeometricError=pe.throwInstantiationError;Ws.prototype.getTileDataAvailable=pe.throwInstantiationError;Ws.prototype.loadTileDataAvailability=pe.throwInstantiationError;var Xr=Ws;var qAe={UNLOADED:0,TRANSITIONING:1,RECEIVED:2,TEXTURE_LOADED:3,READY:4,FAILED:5,INVALID:6,PLACEHOLDER:7};Object.freeze(qAe);var Vn=qAe;function QS(e,t,n,i,r){if(this.imageryLayer=e,this.x=t,this.y=n,this.level=i,this.request=void 0,i!==0){let o=t/2|0,s=n/2|0,a=i-1;this.parent=e.getImageryFromCache(o,s,a)}this.state=Vn.UNLOADED,this.imageUrl=void 0,this.image=void 0,this.texture=void 0,this.textureWebMercator=void 0,this.credits=void 0,this.referenceCount=0,!l(r)&&e.ready&&(r=e.imageryProvider.tilingScheme.tileXYToRectangle(t,n,i)),this.rectangle=r}QS.createPlaceholder=function(e){let t=new QS(e,0,0,0);return t.addReference(),t.state=Vn.PLACEHOLDER,t};QS.prototype.addReference=function(){++this.referenceCount};QS.prototype.releaseReference=function(){return--this.referenceCount,this.referenceCount===0?(this.imageryLayer.removeImageryFromCache(this),l(this.parent)&&this.parent.releaseReference(),l(this.image)&&l(this.image.destroy)&&this.image.destroy(),l(this.texture)&&this.texture.destroy(),l(this.textureWebMercator)&&this.texture!==this.textureWebMercator&&this.textureWebMercator.destroy(),le(this),0):this.referenceCount};QS.prototype.processStateMachine=function(e,t,n){this.state===Vn.UNLOADED&&!n&&(this.state=Vn.TRANSITIONING,this.imageryLayer._requestImagery(this)),this.state===Vn.RECEIVED&&(this.state=Vn.TRANSITIONING,this.imageryLayer._createTexture(e.context,this));let i=this.state===Vn.READY&&t&&!this.texture;(this.state===Vn.TEXTURE_LOADED||i)&&(this.state=Vn.TRANSITIONING,this.imageryLayer._reprojectTexture(e,this,t))};var ew=QS;function mZ(e,t,n){this.readyImagery=void 0,this.loadingImagery=e,this.textureCoordinateRectangle=t,this.textureTranslationAndScale=void 0,this.useWebMercatorT=n}mZ.prototype.freeResources=function(){l(this.readyImagery)&&this.readyImagery.releaseReference(),l(this.loadingImagery)&&this.loadingImagery.releaseReference()};mZ.prototype.processStateMachine=function(e,t,n){let i=this.loadingImagery,r=i.imageryLayer;if(i.processStateMachine(t,!this.useWebMercatorT,n),i.state===Vn.READY)return l(this.readyImagery)&&this.readyImagery.releaseReference(),this.readyImagery=this.loadingImagery,this.loadingImagery=void 0,this.textureTranslationAndScale=r._calculateTextureTranslationAndScale(e,this),!0;let o=i.parent,s;for(;l(o)&&(o.state!==Vn.READY||!this.useWebMercatorT&&!l(o.texture));)o.state!==Vn.FAILED&&o.state!==Vn.INVALID&&(s=s||o),o=o.parent;return this.readyImagery!==o&&(l(this.readyImagery)&&this.readyImagery.releaseReference(),this.readyImagery=o,l(o)&&(o.addReference(),this.textureTranslationAndScale=r._calculateTextureTranslationAndScale(e,this))),i.state===Vn.FAILED||i.state===Vn.INVALID?l(s)?(s.processStateMachine(t,!this.useWebMercatorT,n),!1):!0:!1};var tw=mZ;function Gi(e,t){this._imageryProvider=e,this._readyEvent=new be,this._errorEvent=new be,t=t??H.EMPTY_OBJECT,e=e??H.EMPTY_OBJECT,this.alpha=t.alpha??e._defaultAlpha??1,this.nightAlpha=t.nightAlpha??e._defaultNightAlpha??1,this.dayAlpha=t.dayAlpha??e._defaultDayAlpha??1,this.brightness=t.brightness??e._defaultBrightness??Gi.DEFAULT_BRIGHTNESS,this.contrast=t.contrast??e._defaultContrast??Gi.DEFAULT_CONTRAST,this.hue=t.hue??e._defaultHue??Gi.DEFAULT_HUE,this.saturation=t.saturation??e._defaultSaturation??Gi.DEFAULT_SATURATION,this.gamma=t.gamma??e._defaultGamma??Gi.DEFAULT_GAMMA,this.splitDirection=t.splitDirection??Gi.DEFAULT_SPLIT,this.minificationFilter=t.minificationFilter??e._defaultMinificationFilter??Gi.DEFAULT_MINIFICATION_FILTER,this.magnificationFilter=t.magnificationFilter??e._defaultMagnificationFilter??Gi.DEFAULT_MAGNIFICATION_FILTER,this.show=t.show??!0,this._minimumTerrainLevel=t.minimumTerrainLevel,this._maximumTerrainLevel=t.maximumTerrainLevel,this._rectangle=t.rectangle??ie.MAX_VALUE,this._maximumAnisotropy=t.maximumAnisotropy,this._imageryCache={},this._skeletonPlaceholder=new tw(ew.createPlaceholder(this)),this._show=!0,this._layerIndex=-1,this._isBaseLayer=!1,this._requestImageError=void 0,this._reprojectComputeCommands=[],this.cutoutRectangle=t.cutoutRectangle,this.colorToAlpha=t.colorToAlpha,this.colorToAlphaThreshold=t.colorToAlphaThreshold??Gi.DEFAULT_APPLY_COLOR_TO_ALPHA_THRESHOLD}Object.defineProperties(Gi.prototype,{imageryProvider:{get:function(){return this._imageryProvider}},ready:{get:function(){return l(this._imageryProvider)}},errorEvent:{get:function(){return this._errorEvent}},readyEvent:{get:function(){return this._readyEvent}},rectangle:{get:function(){return this._rectangle}}});Gi.DEFAULT_BRIGHTNESS=1;Gi.DEFAULT_CONTRAST=1;Gi.DEFAULT_HUE=0;Gi.DEFAULT_SATURATION=1;Gi.DEFAULT_GAMMA=1;Gi.DEFAULT_SPLIT=jo.NONE;Gi.DEFAULT_MINIFICATION_FILTER=Wt.LINEAR;Gi.DEFAULT_MAGNIFICATION_FILTER=Jn.LINEAR;Gi.DEFAULT_APPLY_COLOR_TO_ALPHA_THRESHOLD=.004;Gi.fromProviderAsync=function(e,t){let n=new Gi(void 0,t);return fst(n,Promise.resolve(e)),n};Gi.fromWorldImagery=function(e){return e=e??H.EMPTY_OBJECT,Gi.fromProviderAsync(n_({style:e.style}),e)};Gi.prototype.isBaseLayer=function(){return this._isBaseLayer};Gi.prototype.isDestroyed=function(){return!1};Gi.prototype.destroy=function(){return le(this)};var KAe=new ie,YAe=new ie,pZ=new ie,$Ae=new ie;Gi.prototype.getImageryRectangle=function(){let e=this._imageryProvider,t=this._rectangle;return ie.intersection(e.rectangle,t)};Gi.prototype._createTileImagerySkeletons=function(e,t,n){let i=e.data;if(!l(t)||l(this._minimumTerrainLevel)&&e.level<this._minimumTerrainLevel||l(this._maximumTerrainLevel)&&e.level>this._maximumTerrainLevel)return!1;l(n)||(n=i.imagery.length);let r=this._imageryProvider;if(!this.ready)return this._skeletonPlaceholder.loadingImagery.addReference(),i.imagery.splice(n,0,this._skeletonPlaceholder),!0;let o=r.tilingScheme.projection instanceof yi&&e.rectangle.north<yi.MaximumLatitude&&e.rectangle.south>-yi.MaximumLatitude,s=ie.intersection(r.rectangle,this._rectangle,KAe),a=ie.intersection(e.rectangle,s,YAe);if(!l(a)){if(!this.isBaseLayer())return!1;let w=s,P=e.rectangle;a=YAe,P.south>=w.north?a.north=a.south=w.north:P.north<=w.south?a.north=a.south=w.south:(a.south=Math.max(P.south,w.south),a.north=Math.min(P.north,w.north)),P.west>=w.east?a.west=a.east=w.east:P.east<=w.west?a.west=a.east=w.west:(a.west=Math.max(P.west,w.west),a.east=Math.min(P.east,w.east))}let c=0;a.south>0?c=a.south:a.north<0&&(c=a.north);let f=1*t.getLevelMaximumGeometricError(e.level),d=lst(this,f,c);d=Math.max(0,d);let p=r.maximumLevel;if(d>p&&(d=p),l(r.minimumLevel)){let w=r.minimumLevel;d<w&&(d=w)}let g=r.tilingScheme,m=g.positionToTileXY(ie.northwest(a),d),y=g.positionToTileXY(ie.southeast(a),d),A=e.rectangle.width/512,b=e.rectangle.height/512,x=g.tileXYToRectangle(m.x,m.y,d);Math.abs(x.south-e.rectangle.north)<b&&m.y<y.y&&++m.y,Math.abs(x.east-e.rectangle.west)<A&&m.x<y.x&&++m.x;let T=g.tileXYToRectangle(y.x,y.y,d);Math.abs(T.north-e.rectangle.south)<b&&y.y>m.y&&--y.y,Math.abs(T.west-e.rectangle.east)<A&&y.x>m.x&&--y.x;let E=ie.clone(e.rectangle,$Ae),v=g.tileXYToRectangle(m.x,m.y,d),S=ie.intersection(v,s,pZ),I;o?(g.rectangleToNativeRectangle(E,E),g.rectangleToNativeRectangle(v,v),g.rectangleToNativeRectangle(S,S),g.rectangleToNativeRectangle(s,s),I=g.tileXYToNativeRectangle.bind(g),A=E.width/512,b=E.height/512):I=g.tileXYToRectangle.bind(g);let R,O=0,L=1,_;!this.isBaseLayer()&&Math.abs(S.west-E.west)>=A&&(O=Math.min(1,(S.west-E.west)/E.width)),!this.isBaseLayer()&&Math.abs(S.north-E.north)>=b&&(L=Math.max(0,(S.north-E.south)/E.height));let C=L;for(let w=m.x;w<=y.x;w++)if(R=O,v=I(w,m.y,d),S=ie.simpleIntersection(v,s,pZ),!!l(S)){O=Math.min(1,(S.east-E.west)/E.width),w===y.x&&(this.isBaseLayer()||Math.abs(S.east-E.east)<A)&&(O=1),L=C;for(let P=m.y;P<=y.y;P++){if(_=L,v=I(w,P,d),S=ie.simpleIntersection(v,s,pZ),!l(S))continue;L=Math.max(0,(S.south-E.south)/E.height),P===y.y&&(this.isBaseLayer()||Math.abs(S.south-E.south)<b)&&(L=0);let M=new se(R,L,O,_),F=this.getImageryFromCache(w,P,d);i.imagery.splice(n,0,new tw(F,M,o)),++n}}return!0};Gi.prototype._calculateTextureTranslationAndScale=function(e,t){let n=t.readyImagery.rectangle,i=e.rectangle;if(t.useWebMercatorT){let c=t.readyImagery.imageryLayer.imageryProvider.tilingScheme;n=c.rectangleToNativeRectangle(n,KAe),i=c.rectangleToNativeRectangle(i,$Ae)}let r=i.width,o=i.height,s=r/n.width,a=o/n.height;return new se(s*(i.west-n.west)/r,a*(i.south-n.south)/o,s,a)};Gi.prototype._requestImagery=function(e){let t=this._imageryProvider,n=this;function i(s){if(!l(s))return r();e.image=s,e.state=Vn.RECEIVED,e.request=void 0,Zr.reportSuccess(n._requestImageError)}function r(s){if(e.request.state===Ti.CANCELLED){e.state=Vn.UNLOADED,e.request=void 0;return}e.state=Vn.FAILED,e.request=void 0;let a=`Failed to obtain image tile X: ${e.x} Y: ${e.y} Level: ${e.level}.`;n._requestImageError=Zr.reportError(n._requestImageError,t,t.errorEvent,a,e.x,e.y,e.level,s),n._requestImageError.retry&&o()}function o(){let s=new wo({throttle:!1,throttleByServer:!0,type:Zs.IMAGERY});e.request=s,e.state=Vn.TRANSITIONING;let a=t.requestImage(e.x,e.y,e.level,s);if(!l(a)){e.state=Vn.UNLOADED,e.request=void 0;return}l(t.getTileCredits)&&(e.credits=t.getTileCredits(e.x,e.y,e.level)),a.then(function(c){i(c)}).catch(function(c){r(c)})}o()};Gi.prototype._createTextureWebGL=function(e,t){let n=new jt({minificationFilter:this.minificationFilter,magnificationFilter:this.magnificationFilter}),i=t.image;return l(i.internalFormat)?new Dt({context:e,pixelFormat:i.internalFormat,width:i.width,height:i.height,source:{arrayBufferView:i.bufferView},sampler:n}):new Dt({context:e,source:i,pixelFormat:this._imageryProvider.hasAlphaChannel?Ke.RGBA:Ke.RGB,sampler:n})};Gi.prototype._createTexture=function(e,t){let n=this._imageryProvider,i=t.image;if(l(n.tileDiscardPolicy)){let o=n.tileDiscardPolicy;if(l(o)){if(!o.isReady()){t.state=Vn.RECEIVED;return}if(o.shouldDiscardImage(i)){t.state=Vn.INVALID;return}}}let r=this._createTextureWebGL(e,t);n.tilingScheme.projection instanceof yi?t.textureWebMercator=r:t.texture=r,t.image=void 0,t.state=Vn.TEXTURE_LOADED};function XAe(e,t,n){return`${e}:${t}:${n}`}Gi.prototype._finalizeReprojectTexture=function(e,t){let n=this.minificationFilter,i=this.magnificationFilter;if(n===Wt.LINEAR&&i===Jn.LINEAR&&!Ke.isCompressedFormat(t.pixelFormat)&&D.isPowerOfTwo(t.width)&&D.isPowerOfTwo(t.height)){n=Wt.LINEAR_MIPMAP_LINEAR;let o=kt.maximumTextureFilterAnisotropy,s=Math.min(o,this._maximumAnisotropy??o),a=XAe(n,i,s),c=e.cache.imageryLayerMipmapSamplers;l(c)||(c={},e.cache.imageryLayerMipmapSamplers=c);let u=c[a];l(u)||(u=c[a]=new jt({wrapS:hn.CLAMP_TO_EDGE,wrapT:hn.CLAMP_TO_EDGE,minificationFilter:n,magnificationFilter:i,maximumAnisotropy:s})),t.generateMipmap(Pd.NICEST),t.sampler=u}else{let o=XAe(n,i,0),s=e.cache.imageryLayerNonMipmapSamplers;l(s)||(s={},e.cache.imageryLayerNonMipmapSamplers=s);let a=s[o];l(a)||(a=s[o]=new jt({wrapS:hn.CLAMP_TO_EDGE,wrapT:hn.CLAMP_TO_EDGE,minificationFilter:n,magnificationFilter:i})),t.sampler=a}};Gi.prototype._reprojectTexture=function(e,t,n){let i=t.textureWebMercator||t.texture,r=t.rectangle,o=e.context;if(n=n??!0,n&&!(this._imageryProvider.tilingScheme.projection instanceof Ui)&&r.width/i.width>1e-5){let s=this;t.addReference();let a=new xf({persists:!0,owner:this,preExecute:function(c){cst(c,o,i,t.rectangle)},postExecute:function(c){t.texture=c,s._finalizeReprojectTexture(o,c),t.state=Vn.READY,t.releaseReference()},canceled:function(){t.state=Vn.TEXTURE_LOADED,t.releaseReference()}});this._reprojectComputeCommands.push(a)}else n&&(t.texture=i),this._finalizeReprojectTexture(o,i),t.state=Vn.READY};Gi.prototype.queueReprojectionCommands=function(e){let t=this._reprojectComputeCommands,n=t.length;for(let i=0;i<n;++i)e.commandList.push(t[i]);t.length=0};Gi.prototype.cancelReprojections=function(){this._reprojectComputeCommands.forEach(function(e){l(e.canceled)&&e.canceled()}),this._reprojectComputeCommands.length=0};Gi.prototype.getImageryFromCache=function(e,t,n,i){let r=JAe(e,t,n),o=this._imageryCache[r];return l(o)||(o=new ew(this,e,t,n,i),this._imageryCache[r]=o),o.addReference(),o};Gi.prototype.removeImageryFromCache=function(e){let t=JAe(e.x,e.y,e.level);delete this._imageryCache[t]};function JAe(e,t,n){return JSON.stringify([e,t,n])}var RH={u_textureDimensions:function(){return this.textureDimensions},u_texture:function(){return this.texture},textureDimensions:new U,texture:void 0},ast=dn.supportsTypedArrays()?new Float32Array(128):void 0;function cst(e,t,n,i){let r=t.cache.imageryLayer_reproject;if(!l(r)){r=t.cache.imageryLayer_reproject={vertexArray:void 0,shaderProgram:void 0,sampler:void 0,destroy:function(){l(this.framebuffer)&&this.framebuffer.destroy(),l(this.vertexArray)&&this.vertexArray.destroy(),l(this.shaderProgram)&&this.shaderProgram.destroy()}};let A=new Float32Array(256),b=0;for(let S=0;S<64;++S){let I=S/63;A[b++]=0,A[b++]=I,A[b++]=1,A[b++]=I}let x={position:0,webMercatorT:1},T=Xr.getRegularGridIndices(2,64),E=tt.createIndexBuffer({context:t,typedArray:T,usage:Me.STATIC_DRAW,indexDatatype:je.UNSIGNED_SHORT});r.vertexArray=new zn({context:t,attributes:[{index:x.position,vertexBuffer:tt.createVertexBuffer({context:t,typedArray:A,usage:Me.STATIC_DRAW}),componentsPerAttribute:2},{index:x.webMercatorT,vertexBuffer:tt.createVertexBuffer({context:t,sizeInBytes:512,usage:Me.STREAM_DRAW}),componentsPerAttribute:1}],indexBuffer:E});let v=new Ye({sources:[_M]});r.shaderProgram=Qt.fromCache({context:t,vertexShaderSource:v,fragmentShaderSource:gM,attributeLocations:x}),r.sampler=new jt({wrapS:hn.CLAMP_TO_EDGE,wrapT:hn.CLAMP_TO_EDGE,minificationFilter:Wt.LINEAR,magnificationFilter:Jn.LINEAR})}n.sampler=r.sampler;let o=n.width,s=n.height;RH.textureDimensions.x=o,RH.textureDimensions.y=s,RH.texture=n;let a=Math.sin(i.south),c=.5*Math.log((1+a)/(1-a));a=Math.sin(i.north);let f=1/(.5*Math.log((1+a)/(1-a))-c),d=new Dt({context:t,width:o,height:s,pixelFormat:n.pixelFormat,pixelDatatype:n.pixelDatatype,preMultiplyAlpha:n.preMultiplyAlpha});D.isPowerOfTwo(o)&&D.isPowerOfTwo(s)&&d.generateMipmap(Pd.NICEST);let p=i.south,g=i.north,m=ast,y=0;for(let A=0;A<64;++A){let b=A/63,x=D.lerp(p,g,b);a=Math.sin(x);let E=(.5*Math.log((1+a)/(1-a))-c)*f;m[y++]=E,m[y++]=E}r.vertexArray.getAttribute(1).vertexBuffer.copyFromArrayView(m),e.shaderProgram=r.shaderProgram,e.outputTexture=d,e.uniformMap=RH,e.vertexArray=r.vertexArray}function lst(e,t,n){let i=e._imageryProvider,r=i.tilingScheme,o=r.ellipsoid,s=e._imageryProvider.tilingScheme.projection instanceof Ui?1:Math.cos(n),a=r.rectangle,u=o.maximumRadius*a.width*s/(i.tileWidth*r.getNumberOfXTilesAtLevel(0))/t,f=Math.log(u)/Math.log(2);return Math.round(f)|0}function ust(e,t){e.numberOfListeners>0?e.raiseEvent(t):console.error(t)}async function fst(e,t){let n;try{if(n=await Promise.resolve(t),e.isDestroyed())return;e._imageryProvider=n,e._readyEvent.raiseEvent(n)}catch(i){ust(e._errorEvent,i)}}var Ss=Gi;var gZ=class{constructor(){this.alpha=!1,this.brightness=!1,this.contrast=!1,this.hue=!1,this.saturation=!1,this.gamma=!1,this.colorToAlpha=!1}},EB=gZ;var _Z=class{constructor(t,n,i,r){this._minX=t??0,this._minY=n??0,this._maxX=i??0,this._maxY=r??0}get minX(){return this._minX}set minX(t){this._minX=t}get minY(){return this._minY}set minY(t){this._minY=t}get maxX(){return this._maxX}set maxX(t){this._maxX=t}get maxY(){return this._maxY}set maxY(t){this._maxY=t}contains(t,n){return t>=this.minX&&t<this.maxX&&n>=this.minY&&n<this.maxY}containsExclusive(t,n){return t>this.minX&&t<this.maxX&&n>this.minY&&n<this.maxY}containsInclusive(t,n){return t>=this.minX&&t<=this.maxX&&n>=this.minY&&n<=this.maxY}},nw=_Z;var dst=new ie,ZAe=new ie,hst=new ie,mst=new ie,pst=new ie,gst=new ie,yZ=class e{constructor(t,n,i,r,o){this._x=t,this._y=n,this._level=i,this._textureCoordinateRectangle=r,this._imagery=o}get x(){return this._x}get y(){return this._y}get level(){return this._level}get textureCoordinateRectangle(){return this._textureCoordinateRectangle}get imagery(){return this._imagery}static createImageryCoverages(t,n,i){if(!n.show)return[];let r=n.imageryProvider,o=e._clampImageryLevel(r,i),s=ie.intersection(r.rectangle,n.rectangle,dst),a=r.tilingScheme,c=e._computeImageryRange(t,s,a,o),u=mst;a.rectangleToNativeRectangle(t,u);let f=pst;a.rectangleToNativeRectangle(s,f);let d=(g,m,y)=>{let A=a.tileXYToRectangle(g,m,y),b=ie.intersection(A,s,hst);if(!l(b))return;let x=gst;return a.rectangleToNativeRectangle(b,x),x};return e._computeImageryCoverages(n,c,o,u,d)}static _clampImageryLevel(t,n){let i=t.minimumLevel??0,r=t.maximumLevel??Number.POSITIVE_INFINITY,o=Math.min(r-1,Math.max(i,n));return Math.floor(o)}static _computeImageryRange(t,n,i,r){let o=e._computeOverlappedRectangle(t,n),s=i.positionToTileXY(ie.northwest(o),r),a=i.positionToTileXY(ie.southeast(o),r),c=new nw;c.minX=s.x,c.minY=s.y,c.maxX=a.x,c.maxY=a.y;let u=t.width/512,f=t.height/512,d=i.tileXYToRectangle(c.minX,c.minY,r);Math.abs(d.south-t.north)<f&&c.minY<c.maxY&&++c.minY,Math.abs(d.east-t.west)<u&&c.minX<c.maxX&&++c.minX;let m=i.tileXYToRectangle(c.maxX,c.maxY,r);return Math.abs(m.north-t.south)<f&&c.maxY>c.minY&&--c.maxY,Math.abs(m.west-t.east)<u&&c.maxX>c.minX&&--c.maxX,c}static _clampRectangle(t,n,i){return l(i)||(i=new ie),t.south>=n.north?i.north=i.south=n.north:t.north<=n.south?i.north=i.south=n.south:(i.south=Math.max(t.south,n.south),i.north=Math.min(t.north,n.north)),t.west>=n.east?i.west=i.east=n.east:t.east<=n.west?i.west=i.east=n.west:(i.west=Math.max(t.west,n.west),i.east=Math.min(t.east,n.east)),i}static _computeOverlappedRectangle(t,n){let i=ie.intersection(t,n,ZAe);return l(i)?i:e._clampRectangle(t,n,ZAe)}static _computeImageryCoverages(t,n,i,r,o){let s=[];for(let a=n.minX;a<=n.maxX;a++){let c=o(a,n.maxY,i);if(l(c))for(let u=n.minY;u<=n.maxY;u++){let f=o(a,u,i);if(!l(f))continue;let d=e._localizeToCartesianRectangle(f,r,void 0),p=t.getImageryFromCache(a,u,i),g=new e(a,u,i,d,p);s.push(g)}}return s}static _localizeToCartesianRectangle(t,n,i){l(i)||(i=new nw);let r=1/n.width,o=1/n.height;return i.minX=(t.west-n.west)*r,i.minY=(t.south-n.south)*o,i.maxX=(t.east-n.west)*r,i.maxY=(t.north-n.south)*o,i}},iw=yZ;var AZ=class e{static createTextureCoordinatesForMappedPositions(t,n){let i=t.cartographicPositions,r=t.cartographicBoundingRectangle,o=t.numPositions;return e._createTextureCoordinates(i,o,r,n)}static _createTextureCoordinates(t,n,i,r){let o=new et;et.fromRectangle(i,r,o);let s=e.createProjectedPositions(t,r),a=e.computeTexCoords(s,o);return e.createTypedArrayFromCartesians2(n,a)}static createTextureCoordinatesAttributeForMappedPositions(t,n){let i=e.createTextureCoordinatesForMappedPositions(t,n);return e.createTexCoordAttribute(i)}static createCartographicPositions(t,n,i){let r=ba.readAttributeAsTypedArray(t),o=t.type,s=Vt.getNumberOfComponents(o),a=e.createIterableCartesian3FromTypedArray(r,s),c=e.transformCartesians3(a,n);return e.transformToCartographic(c,i)}static createIterableCartesian3FromTypedArray(t,n){let i=new h,r=t.length/n;return{[Symbol.iterator]:function*(){for(let s=0;s<r;s++)i.x=t[s*n+0],i.y=t[s*n+1],i.z=t[s*n+2],yield i}}}static map(t,n){return{[Symbol.iterator]:function*(){for(let r of t)yield n(r)}}}static computeCartographicBoundingRectangle(t,n){l(n)||(n=new ie);let i=Number.NEGATIVE_INFINITY,r=Number.POSITIVE_INFINITY,o=Number.NEGATIVE_INFINITY,s=Number.POSITIVE_INFINITY;for(let a of t)i=Math.max(i,a.latitude),r=Math.min(r,a.latitude),o=Math.max(o,a.longitude),s=Math.min(s,a.longitude);return n.north=i,n.south=r,n.east=o,n.west=s,n}static transformCartesians3(t,n){let i=new h;return e.map(t,o=>(N.multiplyByPoint(n,o,i),i))}static transformToCartographic(t,n){let i=new he;return e.map(t,o=>(n.cartesianToCartographic(o,i),i))}static createProjectedPositions(t,n){let i=new h;return e.map(t,o=>(n.project(o,i),i))}static computeTexCoords(t,n){let i=new U,r=1/n.width,o=1/n.height;return e.map(t,a=>{let c=(a.x-n.x)*r,u=(a.y-n.y)*o,f=Math.min(Math.max(c,0),1),d=Math.min(Math.max(u,0),1);return i.x=f,i.y=d,i})}static createTypedArrayFromCartesians2(t,n){let i=new Float32Array(t*2),r=0;for(let o of n)i[r*2+0]=o.x,i[r*2+1]=o.y,r++;return i}static createTexCoordAttribute(t){return{name:"Imagery Texture Coordinates",semantic:ct.TEXCOORD,setIndex:0,componentDatatype:Y.FLOAT,type:Vt.VEC2,normalized:!1,count:t.length/2,min:void 0,max:void 0,constant:new U(0,0),quantization:void 0,typedArray:t,byteOffset:0,byteStride:void 0}}},TT=AZ;var bZ=class{constructor(t,n,i,r){this._cartographicPositions=t,this._numPositions=n,this._cartographicBoundingRectangle=i,this._ellipsoid=r}get cartographicPositions(){return this._cartographicPositions}get numPositions(){return this._numPositions}get cartographicBoundingRectangle(){return this._cartographicBoundingRectangle}get ellipsoid(){return this._ellipsoid}},CB=bZ;var xZ=class e{constructor(t,n,i){this._model=t,this._runtimeNode=n,this._runtimePrimitive=i,this._mappedPositionsPerEllipsoid=void 0,this._mappedPositionsModelMatrix=new N,this._lastImageryLayersModificationCounter=0,this._imageryTexCoordAttributesPerProjection=void 0,this._currentImageryLayers=void 0,this._coveragesPerLayer=void 0,this._allImageriesReady=!1}coveragesForImageryLayer(t){let r=this._model.imageryLayers.indexOf(t);if(r===-1)throw new pe("Imagery layer is not part of the model");let o=this._coveragesPerLayer;if(!l(o))throw new pe("The coveragesPerLayer have not been computed yet");return o[r]}update(t){let n=this._model,o=n.content.tileset.imageryLayersModificationCounter;this._lastImageryLayersModificationCounter!==o&&(delete this._mappedPositionsPerEllipsoid,this._lastImageryLayersModificationCounter=o),this._mappedPositionsNeedUpdate&&(n.resetDrawCommands(),this._mappedPositionsPerEllipsoid=this._computeMappedPositionsPerEllipsoid(),this._deleteCoveragesPerLayer(),this._destroyImageryTexCoordAttributes()),l(this._imageryTexCoordAttributesPerProjection)||(this._imageryTexCoordAttributesPerProjection=this._computeImageryTexCoordsAttributesPerProjection(),this._uploadImageryTexCoordAttributes(t.context)),l(this._coveragesPerLayer)||(this._computeCoveragesPerLayer(),this._allImageriesReady=!1),this._allImageriesReady||this._updateImageries(t)}_deleteCoveragesPerLayer(){let t=this._coveragesPerLayer;if(!l(t))return;let n=this._currentImageryLayers,i=t.length;for(let r=0;r<i;r++){let o=n[r],s=t[r];this._deleteCoverages(o,s)}delete this._currentImageryLayers,delete this._coveragesPerLayer}_deleteCoverages(t,n){if(t.isDestroyed())return;let i=n.length;for(let r=0;r<i;r++)n[r].imagery.releaseReference()}_uploadImageryTexCoordAttributes(t){let n=this._imageryTexCoordAttributesPerProjection;if(!l(n))return;let i=n.length;for(let r=0;r<i;r++){let o=n[r],s=tt.createVertexBuffer({context:t,typedArray:o.typedArray,usage:Me.STATIC_DRAW});s.vertexArrayDestroyable=!1,o.buffer=s}}_destroyImageryTexCoordAttributes(){let t=this._imageryTexCoordAttributesPerProjection;if(!l(t))return;let n=t.length;for(let i=0;i<n;i++){let r=t[i];l(r)&&(l(r.buffer)&&(r.buffer.isDestroyed()||r.buffer.destroy()),t[i]=void 0)}delete this._imageryTexCoordAttributesPerProjection}get _mappedPositionsNeedUpdate(){if(!l(this._mappedPositionsPerEllipsoid))return!0;let t=this._model,n=this._mappedPositionsModelMatrix;return!N.equals(t.modelMatrix,n)}_computeMappedPositionsPerEllipsoid(){let t=this._model,n=this._runtimeNode,i=this._runtimePrimitive,r=e._obtainPrimitivePositionAttribute(i.primitive),o=r.count,s=e._computePrimitivePositionTransform(t,n,void 0),a=[],c=e._computeUniqueEllipsoids(t.imageryLayers),u=c.length;for(let f=0;f<u;f++){let d=c[f],p=TT.createCartographicPositions(r,s,d),g=TT.computeCartographicBoundingRectangle(p),m=new CB(p,o,g,d);a.push(m)}return N.clone(t.modelMatrix,this._mappedPositionsModelMatrix),a}static _computeUniqueEllipsoids(t){let n=new Set,i=t.length;for(let r=0;r<i;r++){let o=t.get(r),s=e._getEllipsoid(o);n.add(s)}return[...n]}_computeImageryTexCoordsAttributesPerProjection(){let n=this._model.imageryLayers,i=e._extractProjections(n),r=[...new Set(i)];return this._createImageryTexCoordAttributes(r)}static _extractProjections(t){let n=[],i=t.length;for(let r=0;r<i;r++){let o=t.get(r),s=e._getProjection(o);n.push(s)}return n}static _getProjection(t){return t.imageryProvider.tilingScheme.projection}_createImageryTexCoordAttributes(t){let n=[],i=t.length;for(let r=0;r<i;r++){let o=t[r],s=o.ellipsoid,a=this.mappedPositionsForEllipsoid(s),c=TT.createTextureCoordinatesAttributeForMappedPositions(a,o);n.push(c)}return n}_computeCoveragesPerLayer(){let t=[],n=[],r=this._model.imageryLayers,o=r.length;for(let s=0;s<o;s++){let a=r.get(s),c=this._computeCoverage(a);t.push(c),n.push(a)}this._coveragesPerLayer=t,this._currentImageryLayers=n}_computeCoverage(t){let i=this.mappedPositionsForImageryLayer(t).cartographicBoundingRectangle,r=this._computeImageryLevel(t,i);return iw.createImageryCoverages(i,t,r)}_computeImageryLevel(t,n){let i=t.imageryProvider,o=i.tilingScheme.rectangle,s=1,a=n.width,c=o.width;n.height>n.width&&(a=n.height,c=o.height);let u=Math.log2(s*c/a);return iw._clampImageryLevel(i,u)}_updateImageries(t){let n=this._model,i=this._coveragesPerLayer,r=i.length,o=!0;for(let s=0;s<r;s++){let a=i[s],c=a.length;for(let u=0;u<c;u++){let d=a[u].imagery;d.state===Vn.READY||d.state===Vn.FAILED||d.state===Vn.INVALID||(o=!1,d.processStateMachine(t,!1,!1))}}o&&n.resetDrawCommands(),this._allImageriesReady=o}mappedPositionsForImageryLayer(t){let n=e._getEllipsoid(t);return this.mappedPositionsForEllipsoid(n)}mappedPositionsForEllipsoid(t){let n=this._mappedPositionsPerEllipsoid;if(!l(n))throw new pe("The mappedPositions have not been computed yet");let i=n.length;for(let r=0;r<i;r++){let o=n[r];if(o.ellipsoid===t)return o}throw new pe(`Could not find mapped positions for ellipsoid ${t}`)}imageryTexCoordAttributesPerProjection(){let t=this._imageryTexCoordAttributesPerProjection;if(!l(t))throw new pe("The imagery texture coordinate attributes have not been computed yet");return this._imageryTexCoordAttributesPerProjection}get ready(){let t=this._coveragesPerLayer;return l(t)?this._allImageriesReady:!1}isDestroyed(){return!1}destroy(){if(!this.isDestroyed())return this._deleteCoveragesPerLayer(),this._destroyImageryTexCoordAttributes(),le(this)}static _computePrimitivePositionTransform(t,n,i){l(i)||(i=new N);let r=t.sceneGraph;return N.clone(N.IDENTITY,i),N.multiply(i,t.modelMatrix,i),N.multiply(i,r.components.transform,i),N.multiply(i,r.axisCorrectionMatrix,i),N.multiply(i,n.computedTransform,i),i}static _obtainPrimitivePositionAttribute(t){let n=xt.getAttributeBySemantic(t,"POSITION");if(!l(n))throw new pe("The primitive does not have a POSITION attribute");return n}static _getEllipsoid(t){return t.imageryProvider.tilingScheme.projection.ellipsoid}},ET=xZ;var TZ=class{constructor(t,n,i,r,o){this.imageryLayer=t,this.texture=n,this.textureTranslationAndScale=i,this.textureCoordinateRectangle=r,this.imageryTexCoordAttributeSetIndex=o}},vB=TZ;var _st=!1,yst=new ie,Ast=new ie,EZ=class e{static process(t,n,i){let r=t.model,o=n.modelPrimitiveImagery;if(!l(o)||!o.ready)return;let s=r.imageryLayers,a=ET._extractProjections(s),c=[...new Set(a)],u=e._computeIndexMapping(a,c),f=e._createImageryInputs(s,o,u);if(f.length===0)return;f.length>10&&(_t("imagery-texture-units",`Warning: Draped imagery requires ${f.length} texture units, truncating`),f.length=10),e._addImageryTexCoordAttributesToRenderResources(o,t);let d=[];for(let p=0;p<s.length;p++)d.push(s.get(p));e._processImageryInputs(d,t,f,c.length)}static _addImageryTexCoordAttributesToRenderResources(t,n){let i=t.imageryTexCoordAttributesPerProjection();for(let r of i)e._addImageryTexCoordAttributeToRenderResources(r,n)}static _addImageryTexCoordAttributeToRenderResources(t,n){let i=Vt.getNumberOfComponents(t.type),r={index:n.attributeIndex++,value:l(t.buffer)?void 0:t.constant,vertexBuffer:t.buffer,count:t.count,componentsPerAttribute:i,componentDatatype:t.componentDatatype,offsetInBytes:t.byteOffset,strideInBytes:t.byteStride,normalize:t.normalized};n.attributes.push(r)}static _processImageryInputs(t,n,i,r){let o=n.shaderBuilder,s=e._computeImageryFlags(t),a=i.length;o.addDefine("HAS_IMAGERY"),o.addDefine(`IMAGERY_TEXTURE_UNITS ${a}`),e._addAttributes(o,r),e._defineUniforms(o,s),e._buildSampleAndBlendFunction(o,s),e._createMainImageryShader(o,i,s);let c=n.uniformMap,u=e._createImageryUniforms(i);e._setImageryUniforms(c,u)}static _addAttributes(t,n){for(let o=0;o<n;o++)t.addAttribute("vec2",`a_imagery_texCoord_${o}`),t.addVarying("vec2",`v_imagery_texCoord_${o}`);let i="initializeImageryAttributes",r=`void ${i}()`;t.addFunction(i,r,de.VERTEX);for(let o=0;o<n;o++)t.addFunctionLines(i,[`v_imagery_texCoord_${o} = a_imagery_texCoord_${o};`])}static _computeImageryFlags(t){let n=new EB;for(let i=0;i<t.length;i++){let r=t[i];n.alpha|=r.alpha!==1,n.brightness|=r.brightness!==Ss.DEFAULT_BRIGHTNESS,n.contrast|=r.contrast!==Ss.DEFAULT_CONTRAST,n.hue|=r.hue!==Ss.DEFAULT_HUE,n.saturation|=r.saturation!==Ss.DEFAULT_SATURATION,n.gamma|=r.gamma!==Ss.DEFAULT_GAMMA;let o=l(r.colorToAlpha)&&r.colorToAlphaThreshold>0;n.colorToAlpha|=o}return n}static _defineUniforms(t,n){t.addUniform("sampler2D","u_imageryTextures[IMAGERY_TEXTURE_UNITS]",de.FRAGMENT),t.addUniform("vec4","u_imageryTextureCoordinateRectangle[IMAGERY_TEXTURE_UNITS]",de.FRAGMENT),t.addUniform("vec4","u_imageryTextureTranslationAndScale[IMAGERY_TEXTURE_UNITS]",de.FRAGMENT),n.alpha&&t.addUniform("float","u_imageryTextureAlpha[IMAGERY_TEXTURE_UNITS]",de.FRAGMENT),n.brightness&&t.addUniform("float","u_imageryTextureBrightness[IMAGERY_TEXTURE_UNITS]",de.FRAGMENT),n.contrast&&t.addUniform("float","u_imageryTextureContrast[IMAGERY_TEXTURE_UNITS]",de.FRAGMENT),n.hue&&t.addUniform("float","u_imageryTextureHue[IMAGERY_TEXTURE_UNITS]",de.FRAGMENT),n.saturation&&t.addUniform("float","u_imageryTextureSaturation[IMAGERY_TEXTURE_UNITS]",de.FRAGMENT),n.gamma&&t.addUniform("float","u_imageryTextureOneOverGamma[IMAGERY_TEXTURE_UNITS]",de.FRAGMENT),n.colorToAlpha&&t.addUniform("vec4","u_imageryTextureColorToAlpha[IMAGERY_TEXTURE_UNITS]",de.FRAGMENT)}static _createSampleAndBlendFunctionSignature(t){let n="sampleAndBlend",i=[];i.push("vec4 previousColor"),i.push("sampler2D textureToSample"),i.push("vec2 textureCoordinates"),i.push("vec4 textureCoordinateRectangle"),i.push("vec4 textureCoordinateTranslationAndScale"),t.alpha&&i.push("float textureAlpha"),t.brightness&&i.push("float textureBrightness"),t.contrast&&i.push("float textureContrast"),t.hue&&i.push("float textureHue"),t.saturation&&i.push("float textureSaturation"),t.gamma&&i.push("float textureOneOverGamma"),t.colorToAlpha&&i.push("vec4 colorToAlpha");let r=i.join(", ");return`vec4 ${n}(${r})`}static _buildSampleAndBlendFunction(t,n){let i="sampleAndBlend",r=e._createSampleAndBlendFunctionSignature(n);t.addFunction(i,r,de.FRAGMENT),t.addFunctionLines(i,["float effectiveAlpha = 1.0;"]),n.alpha&&t.addFunctionLines(i,["effectiveAlpha = textureAlpha;"]),t.addFunctionLines(i,["if (textureCoordinates.x < textureCoordinateRectangle.x) effectiveAlpha = 0.0;","if (textureCoordinates.x > textureCoordinateRectangle.z) effectiveAlpha = 0.0;","if (textureCoordinates.y < textureCoordinateRectangle.y) effectiveAlpha = 0.0;","if (textureCoordinates.y > textureCoordinateRectangle.w) effectiveAlpha = 0.0;","vec2 translation = textureCoordinateTranslationAndScale.xy;","vec2 scale = textureCoordinateTranslationAndScale.zw;","vec2 effectiveTextureCoordinates = textureCoordinates * scale + translation;","vec4 value = texture(textureToSample, effectiveTextureCoordinates);","value = czm_srgbToLinear(value);","vec3 color = value.rgb;","float alpha = value.a;"]),n.colorToAlpha&&t.addFunctionLines(i,["vec3 colorDiff = abs(color.rgb - colorToAlpha.rgb);","colorDiff.r = czm_maximumComponent(colorDiff);","alpha = czm_branchFreeTernary(colorDiff.r < colorToAlpha.a, 0.0, alpha);"]),n.gamma?t.addFunctionLines(i,["color = pow(color, vec3(textureOneOverGamma));"]):t.addFunctionLines(i,["vec4 tempColor = czm_gammaCorrect(vec4(color, alpha));","color = tempColor.rgb;","alpha = tempColor.a;"]),n.brightness&&t.addFunctionLines(i,["color = mix(vec3(0.0), color, textureBrightness);"]),n.contrast&&t.addFunctionLines(i,["color = mix(vec3(0.5), color, textureContrast);"]),n.hue&&t.addFunctionLines(i,["color = czm_hue(color, textureHue);"]),n.saturation&&t.addFunctionLines(i,["color = czm_saturation(color, textureSaturation);"]),t.addFunctionLines(i,["float sourceAlpha = alpha * effectiveAlpha;","float outAlpha = mix(previousColor.a, 1.0, sourceAlpha);","outAlpha += sign(outAlpha) - 1.0;","vec3 outColor = mix(previousColor.rgb * previousColor.a, color, sourceAlpha) / outAlpha;","vec4 result = vec4(outColor, max(outAlpha, 0.0));"]),_st&&t.addFunctionLines(i,["if (abs(textureCoordinates.x - textureCoordinateRectangle.x) < (1.0/256.0) || "," abs(textureCoordinates.x - textureCoordinateRectangle.z) < (1.0/256.0) || "," abs(textureCoordinates.y - textureCoordinateRectangle.y) < (1.0/256.0) || "," abs(textureCoordinates.y - textureCoordinateRectangle.w) < (1.0/256.0))","{"," result = vec4(1.0, 0.0, 0.0, effectiveAlpha);","}"]),t.addFunctionLines(i,["return result;"])}static _createSampleAndBlendCallArguments(t,n,i){let r=`v_imagery_texCoord_${n}`,o=[];return o.push("blendedBaseColor"),o.push(`u_imageryTextures[${i}]`),o.push(`${r}`),o.push(`u_imageryTextureCoordinateRectangle[${i}]`),o.push(`u_imageryTextureTranslationAndScale[${i}]`),t.alpha&&o.push(`u_imageryTextureAlpha[${i}]`),t.brightness&&o.push(`u_imageryTextureBrightness[${i}]`),t.contrast&&o.push(`u_imageryTextureContrast[${i}]`),t.hue&&o.push(`u_imageryTextureHue[${i}]`),t.saturation&&o.push(`u_imageryTextureSaturation[${i}]`),t.gamma&&o.push(`u_imageryTextureOneOverGamma[${i}]`),t.colorToAlpha&&o.push(`u_imageryTextureColorToAlpha[${i}]`),o.join(", ")}static _createMainImageryShader(t,n,i){let r="blendBaseColorWithImagery";t.addFunction(r,"vec4 blendBaseColorWithImagery(vec4 baseColorWithAlpha)",de.FRAGMENT),t.addFunctionLines(r,["vec4 blendedBaseColor = baseColorWithAlpha;"]);for(let o=0;o<n.length;o++){let a=n[o].imageryTexCoordAttributeSetIndex,c=e._createSampleAndBlendCallArguments(i,a,o);t.addFunctionLines(r,[`blendedBaseColor = sampleAndBlend(${c});`])}t.addFunctionLines(r,["return blendedBaseColor;"])}static _createImageryUniforms(t){let n=t.length,i={};i.imageryTextures=Array(n),i.imageryTextureCoordinateRectangle=Array(n),i.imageryTextureTranslationAndScale=Array(n),i.imageryTextureAlpha=Array(n),i.imageryTextureBrightness=Array(n),i.imageryTextureContrast=Array(n),i.imageryTextureHue=Array(n),i.imageryTextureSaturation=Array(n),i.imageryTextureOneOverGamma=Array(n),i.imageryTextureColorToAlpha=Array(n);for(let r=0;r<n;r++){let o=t[r],s=o.imageryLayer,a=o.texture,c=o.textureCoordinateRectangle,u=o.textureTranslationAndScale;i.imageryTextures[r]=a,i.imageryTextureTranslationAndScale[r]=u,i.imageryTextureCoordinateRectangle[r]=c,i.imageryTextureAlpha[r]=s.alpha,i.imageryTextureBrightness[r]=s.brightness,i.imageryTextureContrast[r]=s.contrast,i.imageryTextureHue[r]=s.hue,i.imageryTextureSaturation[r]=s.saturation,i.imageryTextureOneOverGamma[r]=1/s.gamma;let f=i.imageryTextureColorToAlpha[r];if(l(f)||(f=new se,i.imageryTextureColorToAlpha[r]=f),l(s.colorToAlpha)&&s.colorToAlphaThreshold>0){let p=s.colorToAlpha;f.x=p.red,f.y=p.green,f.z=p.blue,f.w=s.colorToAlphaThreshold}else f.w=-1}return i}static _setImageryUniforms(t,n){for(let i in n)if(n.hasOwnProperty(i)){let r=`u_${i}`;t[r]=function(){return n[i]}}}static _createImageryInputs(t,n,i){let r=[];for(let o=0;o<t.length;o++){let s=t.get(o);if(!s.show)continue;let a=i[o],u=n.mappedPositionsForImageryLayer(s).cartographicBoundingRectangle,f=n.coveragesForImageryLayer(s);for(let d=0;d<f.length;d++){let p=f[d],g=e._createImageryInput(s,p,u,a);l(g)&&r.push(g)}}return r}static _createImageryInput(t,n,i,r){let o=n.imagery;if(o.state===Vn.FAILED||o.state===Vn.INVALID)return;let s=o.textureWebMercator;if(!l(s)&&(s=o.texture,!l(s))){o.state===Vn.READY&&console.log(`Imagery at ${n.x}, ${n.y} (level ${n.level}) does not have any texture - state ${o.state}`);return}let a=e._computeTextureTranslationAndScale(t,i,o.rectangle),c=n.textureCoordinateRectangle,u=new se(c.minX,c.minY,c.maxX,c.maxY);return new vB(t,s,a,u,r)}static _computeTextureTranslationAndScale(t,n,i){let r=t.imageryProvider.tilingScheme,o=r.rectangleToNativeRectangle(n,yst),s=r.rectangleToNativeRectangle(i,Ast);return e._computeTextureTranslationAndScaleFromNative(o,s)}static _computeTextureTranslationAndScaleFromNative(t,n){let i=1/n.width,r=1/n.height,o=t.west-n.west,s=t.south-n.south,a=o*i,c=s*r,u=t.width*i,f=t.height*r;return new se(a,c,u,f)}static _computeIndexMapping(t,n){let i=[],r=t.length;for(let o=0;o<r;o++){let s=t[o],a=n.indexOf(s);i.push(a)}return i}},SB=EZ;var wB=`#ifdef USE_IBL_LIGHTING +`;var t2={name:"SelectedFeatureIdPipelineStage",STRUCT_ID_SELECTED_FEATURE:"SelectedFeature",STRUCT_NAME_SELECTED_FEATURE:"SelectedFeature"};t2.process=function(e,t,n){let i=e.shaderBuilder;e.hasPropertyTable=!0;let r=e.model,o=e.runtimeNode.node,s=sct(r,o,t),a=s.shaderDestination;i.addDefine("HAS_SELECTED_FEATURE_ID",void 0,a),i.addDefine("SELECTED_FEATURE_ID",s.variableName,a),i.addDefine(s.featureIdDefine,void 0,a),act(i);let c=s.featureIds.nullFeatureId,u=e.uniformMap;l(c)&&(i.addDefine("HAS_NULL_FEATURE_ID",void 0,a),i.addUniform("int","model_nullFeatureId",a),u.model_nullFeatureId=function(){return c}),s.shaderDestination===de.BOTH&&i.addVertexLines(pw),i.addFragmentLines(pw)};function OTe(e){return e instanceof Cn.FeatureIdTexture?"HAS_SELECTED_FEATURE_ID_TEXTURE":"HAS_SELECTED_FEATURE_ID_ATTRIBUTE"}function MTe(e){return e instanceof Cn.FeatureIdTexture?de.FRAGMENT:de.BOTH}function sct(e,t,n){let i,r;return l(t.instances)&&(r=xt.getFeatureIdsByLabel(t.instances.featureIds,e.instanceFeatureIdLabel),l(r))?(i=r.label??r.positionalLabel,{featureIds:r,variableName:i,shaderDestination:MTe(r),featureIdDefine:OTe(r)}):(r=xt.getFeatureIdsByLabel(n.featureIds,e.featureIdLabel),i=r.label??r.positionalLabel,{featureIds:r,variableName:i,shaderDestination:MTe(r),featureIdDefine:OTe(r)})}function act(e){e.addStructField(t2.STRUCT_ID_SELECTED_FEATURE,"int","id"),e.addStructField(t2.STRUCT_ID_SELECTED_FEATURE,"vec2","st"),e.addStructField(t2.STRUCT_ID_SELECTED_FEATURE,"vec4","color")}var IA=t2;var Wa={name:"GeometryPipelineStage",STRUCT_ID_PROCESSED_ATTRIBUTES_VS:"ProcessedAttributesVS",STRUCT_ID_PROCESSED_ATTRIBUTES_FS:"ProcessedAttributesFS",STRUCT_NAME_PROCESSED_ATTRIBUTES:"ProcessedAttributes",FUNCTION_ID_INITIALIZE_ATTRIBUTES:"initializeAttributes",FUNCTION_SIGNATURE_INITIALIZE_ATTRIBUTES:"void initializeAttributes(out ProcessedAttributes attributes)",FUNCTION_ID_SET_DYNAMIC_VARYINGS_VS:"setDynamicVaryingsVS",FUNCTION_ID_SET_DYNAMIC_VARYINGS_FS:"setDynamicVaryingsFS",FUNCTION_SIGNATURE_SET_DYNAMIC_VARYINGS:"void setDynamicVaryings(inout ProcessedAttributes attributes)"};Wa.process=function(e,t,n){let{shaderBuilder:i,model:r}=e;i.addStruct(Wa.STRUCT_ID_PROCESSED_ATTRIBUTES_VS,"ProcessedAttributes",de.VERTEX),i.addStruct(Wa.STRUCT_ID_PROCESSED_ATTRIBUTES_FS,"ProcessedAttributes",de.FRAGMENT),i.addStruct(IA.STRUCT_ID_SELECTED_FEATURE,IA.STRUCT_NAME_SELECTED_FEATURE,de.BOTH),i.addFunction(Wa.FUNCTION_ID_INITIALIZE_ATTRIBUTES,Wa.FUNCTION_SIGNATURE_INITIALIZE_ATTRIBUTES,de.VERTEX),i.addVarying("vec3","v_positionWC"),i.addVarying("vec3","v_positionEC"),i.addStructField(Wa.STRUCT_ID_PROCESSED_ATTRIBUTES_FS,"vec3","positionWC"),i.addStructField(Wa.STRUCT_ID_PROCESSED_ATTRIBUTES_FS,"vec3","positionEC"),i.addFunction(Wa.FUNCTION_ID_SET_DYNAMIC_VARYINGS_VS,Wa.FUNCTION_SIGNATURE_SET_DYNAMIC_VARYINGS,de.VERTEX),i.addFunction(Wa.FUNCTION_ID_SET_DYNAMIC_VARYINGS_FS,Wa.FUNCTION_SIGNATURE_SET_DYNAMIC_VARYINGS,de.FRAGMENT),r.type===qo.TILE_PNTS&&i.addDefine("HAS_SRGB_COLOR",void 0,de.FRAGMENT);let o=n.mode!==re.SCENE3D&&!n.scene3DOnly&&r._projectTo2D,s=l(e.runtimeNode.node.instances),a=o&&!s,c=t.attributes.length;for(let u=0;u<c;u++){let f=t.attributes[u],d=Vt.getAttributeLocationCount(f.type),p=f.semantic===ct.POSITION,g;d>1?(g=e.attributeIndex,e.attributeIndex+=d):p&&!a?g=0:g=e.attributeIndex++;let m=!p&&t.primitiveType===Oe.POINTS&&n.context.webgl2?"flat":void 0;cct(e,f,g,d,o,s,m)}_ct(i,t.attributes),t.primitiveType===Oe.POINTS&&i.addDefine("PRIMITIVE_TYPE_POINTS"),i.addVertexLines(e2),i.addFragmentLines(QB)};function cct(e,t,n,i,r,o,s){let a=e.shaderBuilder,c=xt.getAttributeInfo(t),u=r&&!o;i>1?fct(e,t,n,i):uct(e,t,n,u),hct(a,c,u),dct(a,c,s),l(t.semantic)&&lct(a,t),mct(a,c,r),pct(a,c,u),gct(a,c)}function lct(e,t){let{semantic:n,setIndex:i}=t;switch(n){case ct.NORMAL:e.addDefine("HAS_NORMALS");break;case ct.TANGENT:e.addDefine("HAS_TANGENTS");break;case ct.FEATURE_ID:e.addDefine(`HAS${n}_${i}`);break;case ct.TEXCOORD:case ct.COLOR:e.addDefine(`HAS_${n}_${i}`)}}function uct(e,t,n,i){let{quantization:r,semantic:o,setIndex:s}=t,{type:a,componentDatatype:c}=l(r)?r:t;o===ct.FEATURE_ID&&s>=e.featureIdVertexAttributeSetIndex&&(e.featureIdVertexAttributeSetIndex=s+1);let u=o===ct.POSITION,f=u?0:n,d=Vt.getNumberOfComponents(a),p={index:f,value:l(t.buffer)?void 0:t.constant,vertexBuffer:t.buffer,count:t.count,componentsPerAttribute:d,componentDatatype:c,offsetInBytes:t.byteOffset,strideInBytes:t.byteStride,normalize:t.normalized};if(e.attributes.push(p),!u||!i)return;let g=e.runtimePrimitive.positionBuffer2D,m={index:n,vertexBuffer:g,count:t.count,componentsPerAttribute:d,componentDatatype:Y.FLOAT,offsetInBytes:0,strideInBytes:void 0,normalize:t.normalized};e.attributes.push(m)}function fct(e,t,n,i){let{quantization:r,normalized:o}=t,{type:s,componentDatatype:a}=l(r)?r:t,u=Vt.getNumberOfComponents(s)/i,f=Y.getSizeInBytes(a),d=u*f,p=t.byteStride;for(let g=0;g<i;g++){let m=t.byteOffset+g*d,y={index:n+g,vertexBuffer:t.buffer,componentsPerAttribute:u,componentDatatype:a,offsetInBytes:m,strideInBytes:p,normalize:o};e.attributes.push(y)}}function dct(e,t,n){let i=t.variableName,r=`v_${i}`,o;i==="normalMC"?(r="v_normalEC",o=t.glslType):i==="tangentMC"?(o="vec3",r="v_tangentEC"):o=t.glslType,e.addVarying(o,r,n)}function hct(e,t,n){let i=t.attribute.semantic,r=t.variableName,o,s;t.isQuantized?(o=`a_quantized_${r}`,s=t.quantizedGlslType):(o=`a_${r}`,s=t.glslType);let a=i===ct.POSITION;a?e.setPositionAttribute(s,o):e.addAttribute(s,o),a&&n&&e.addAttribute("vec3","a_position2D")}function mct(e,t,n){let i=Wa.STRUCT_ID_PROCESSED_ATTRIBUTES_VS,r=Wa.STRUCT_ID_PROCESSED_ATTRIBUTES_FS,{variableName:o,glslType:s}=t;o==="tangentMC"?(e.addStructField(i,"vec3","tangentMC"),e.addStructField(i,"float","tangentSignMC"),e.addStructField(r,"vec3","tangentEC")):o==="normalMC"?(e.addStructField(i,"vec3","normalMC"),e.addStructField(r,"vec3","normalEC")):(e.addStructField(i,s,o),e.addStructField(r,s,o)),o==="positionMC"&&n&&e.addStructField(i,"vec3","position2D")}function pct(e,t,n){let i=Wa.FUNCTION_ID_INITIALIZE_ATTRIBUTES,r=t.variableName;if(r==="positionMC"&&n&&e.addFunctionLines(i,["attributes.position2D = a_position2D;"]),t.isQuantized)return;let s=[];r==="tangentMC"?(s.push("attributes.tangentMC = a_tangentMC.xyz;"),s.push("attributes.tangentSignMC = a_tangentMC.w;")):s.push(`attributes.${r} = a_${r};`),e.addFunctionLines(i,s)}function gct(e,t){let{semantic:n,setIndex:i}=t.attribute;if(l(n)&&!l(i))return;let r=Wa.FUNCTION_ID_SET_DYNAMIC_VARYINGS_VS,o=t.variableName,s=`v_${o} = attributes.${o};`;e.addFunctionLines(r,[s]),r=Wa.FUNCTION_ID_SET_DYNAMIC_VARYINGS_FS,s=`attributes.${o} = v_${o};`,e.addFunctionLines(r,[s])}function _ct(e,t){let n=!1,i=!1;for(let r=0;r<t.length;r++){let o=t[r];o.semantic===ct.NORMAL?n=!0:o.semantic===ct.TANGENT&&(i=!0)}!n||!i||(e.addDefine("HAS_BITANGENTS"),e.addVarying("vec3","v_bitangentEC"),e.addStructField(Wa.STRUCT_ID_PROCESSED_ATTRIBUTES_VS,"vec3","bitangentMC"),e.addStructField(Wa.STRUCT_ID_PROCESSED_ATTRIBUTES_FS,"vec3","bitangentEC"))}var n2=Wa;var qZ=Qo(Tf(),1);var WZ,NTe="eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJub25jZSI6ImwwendUTkl3UVk5Uk5XdEkiLCJqdGkiOiJjZGFkZDZlNC0wMDI5LTQ5OTMtYWIwMC01ZWY4ZDVlNTBhMzYiLCJpZCI6MjU5LCJzdWIiOiJDZXNpdW1KUyIsImlzcyI6Imh0dHBzOi8vYXBpLmNlc2l1bS5jb20iLCJhdWQiOiIxLjE0NSBSZWxlYXNlIC0gRGVsZXRlIG9uIE5vdmVtYmVyIDEsIDIwMjYiLCJpYXQiOjE3ODc2MzQ3NzV9.3SPieoGxEZ22pnWLETAIFZveR0xXTzvOh8G4NYTxDSo",KH={};KH.defaultAccessToken=NTe;KH.defaultServer=new De({url:"https://api.cesium.com/"});KH.getDefaultTokenCredit=function(e){if(e===NTe){if(!l(WZ)){let t=`<b> This application is using Cesium's default ion access token. Please assign <i>Cesium.Ion.defaultAccessToken</i> with an access token from your ion account before making any Cesium API calls. You can sign up for a free ion account at <a href="https://cesium.com">https://cesium.com</a>.</b>`;WZ=new It(t,!0)}return WZ}};var Ku=KH;function ml(e,t){let n,i=e.externalType,r=l(i);if(!r)n={url:e.url,retryAttempts:1,retryCallback:yct};else if(i==="3DTILES"||i==="STK_TERRAIN_SERVER")n={url:e.options.url};else throw new oe("Ion.createResource does not support external imagery assets; use IonImageryProvider instead.");De.call(this,n),this._ionEndpoint=e,this._ionEndpointDomain=r?void 0:new qZ.default(e.url).authority(),this._ionEndpointResource=t,this._ionRoot=void 0,this._pendingPromise=void 0,this._credits=void 0,this._isExternal=r,this.refreshCallback=void 0}l(Object.create)&&(ml.prototype=Object.create(De.prototype),ml.prototype.constructor=ml);ml.fromAssetId=function(e,t){let n=ml._createEndpointResource(e,t);return n.fetchJson().then(function(i){return new ml(i,n)})};Object.defineProperties(ml.prototype,{credits:{get:function(){return l(this._ionRoot)?this._ionRoot.credits:l(this._credits)?this._credits:(this._credits=ml.getCreditsFromEndpoint(this._ionEndpoint,this._ionEndpointResource),this._credits)}}});ml.getCreditsFromEndpoint=function(e,t){let n=e.attributions.map(It.getIonCredit),i=Ku.getDefaultTokenCredit(t.queryParameters.access_token);return l(i)&&n.push(It.clone(i)),n};ml.prototype.clone=function(e){let t=this._ionRoot??this;return l(e)||(e=Object.create(ml.prototype),De.call(e,{url:this._url,parseUrl:!1}),e._ionEndpoint=t._ionEndpoint,e._ionEndpointDomain=t._ionEndpointDomain,e._ionEndpointResource=t._ionEndpointResource,e._ionRoot=void 0,e._pendingPromise=void 0,e._credits=void 0,e._isExternal=this._isExternal,e.refreshCallback=void 0),e=De.prototype.clone.call(this,e),e._ionRoot=t,e._isExternal=this._isExternal,e};ml.prototype.fetchImage=function(e){if(!this._isExternal){let t=e;e={preferBlob:!0},l(t)&&(e.flipY=t.flipY,e.preferImageBitmap=t.preferImageBitmap)}return De.prototype.fetchImage.call(this,e)};ml.prototype._makeRequest=function(e){return this._isExternal||new qZ.default(this.url).authority()!==this._ionEndpointDomain?De.prototype._makeRequest.call(this,e):(e.headers=YZ(e.headers),e.headers.Authorization=`Bearer ${this._ionEndpoint.accessToken}`,De.prototype._makeRequest.call(this,e))};ml._createEndpointResource=function(e,t){t=t??H.EMPTY_OBJECT;let n=t.server??Ku.defaultServer,i=t.accessToken??Ku.defaultAccessToken;n=De.createIfNeeded(n);let r={url:`v1/assets/${e}/endpoint`};return l(i)&&(r.queryParameters={access_token:i}),l(t.queryParameters)&&(r.queryParameters={...r.queryParameters,...t.queryParameters}),r.headers=YZ(r.headers),n.getDerivedResource(r)};function YZ(e={}){return e["X-Cesium-Client"]="CesiumJS",typeof CESIUM_VERSION<"u"&&(e["X-Cesium-Client-Version"]=CESIUM_VERSION),e}ml._addClientHeaders=YZ;function yct(e,t){let n=e._ionRoot??e,i=n._ionEndpointResource,r=typeof Image<"u";return!l(t)||t.statusCode!==401&&!(r&&t.target instanceof Image)?Promise.resolve(!1):(l(n._pendingPromise)||(n._pendingPromise=i.fetchJson().then(function(o){let s=e.refreshCallback??n.refreshCallback;return l(s)&&s(n,o),n._ionEndpoint=o,n._ionEndpoint}).finally(function(o){return n._pendingPromise=void 0,o})),n._pendingPromise.then(function(o){return e._ionEndpoint=o,!0}))}var Yo=ml;var XZ=new he,KZ=new he,LTe=new h,FTe=new h,$Z=class{constructor(t){ut(this,"_rectangleSouthwestInMeters");ut(this,"_rectangleNortheastInMeters");if(t=t??H.EMPTY_OBJECT,this._ellipsoid=t.ellipsoid??ee.default,this._numberOfLevelZeroTilesX=t.numberOfLevelZeroTilesX??1,this._numberOfLevelZeroTilesY=t.numberOfLevelZeroTilesY??1,this._projection=new yi(this._ellipsoid),l(t.rectangleSouthwestInMeters)&&l(t.rectangleNortheastInMeters))this._rectangleSouthwestInMeters=t.rectangleSouthwestInMeters,this._rectangleNortheastInMeters=t.rectangleNortheastInMeters;else{let r=this._ellipsoid.maximumRadius*Math.PI;this._rectangleSouthwestInMeters=new U(-r,-r),this._rectangleNortheastInMeters=new U(r,r)}let{x:n,y:i}=this._rectangleSouthwestInMeters;h.fromElements(n,i,0,LTe),this._projection.unproject(LTe,XZ),{x:n,y:i}=this._rectangleNortheastInMeters,h.fromElements(n,i,0,FTe),this._projection.unproject(FTe,KZ),this._rectangle=new ie(XZ.longitude,XZ.latitude,KZ.longitude,KZ.latitude)}get ellipsoid(){return this._ellipsoid}get rectangle(){return this._rectangle}get projection(){return this._projection}getNumberOfXTilesAtLevel(t){return this._numberOfLevelZeroTilesX<<t}getNumberOfYTilesAtLevel(t){return this._numberOfLevelZeroTilesY<<t}rectangleToNativeRectangle(t,n){let i=this._projection,r=i.project(ie.southwest(t)),o=i.project(ie.northeast(t));return l(n)?(n.west=r.x,n.south=r.y,n.east=o.x,n.north=o.y,n):new ie(r.x,r.y,o.x,o.y)}tileXYToNativeRectangle(t,n,i,r){let o=this.getNumberOfXTilesAtLevel(i),s=this.getNumberOfYTilesAtLevel(i),a=(this._rectangleNortheastInMeters.x-this._rectangleSouthwestInMeters.x)/o,c=this._rectangleSouthwestInMeters.x+t*a,u=this._rectangleSouthwestInMeters.x+(t+1)*a,f=(this._rectangleNortheastInMeters.y-this._rectangleSouthwestInMeters.y)/s,d=this._rectangleNortheastInMeters.y-n*f,p=this._rectangleNortheastInMeters.y-(n+1)*f;return l(r)?(r.west=c,r.south=p,r.east=u,r.north=d,r):new ie(c,p,u,d)}tileXYToRectangle(t,n,i,r){let o=this.tileXYToNativeRectangle(t,n,i,r),s=this._projection,a=s.unproject(new h(o.west,o.south)),c=s.unproject(new h(o.east,o.north));return o.west=a.longitude,o.south=a.latitude,o.east=c.longitude,o.north=c.latitude,o}positionToTileXY(t,n,i){let r=this._rectangle;if(!ie.contains(r,t))return;let o=this.getNumberOfXTilesAtLevel(n),s=this.getNumberOfYTilesAtLevel(n),c=(this._rectangleNortheastInMeters.x-this._rectangleSouthwestInMeters.x)/o,f=(this._rectangleNortheastInMeters.y-this._rectangleSouthwestInMeters.y)/s,p=this._projection.project(t),g=p.x-this._rectangleSouthwestInMeters.x,m=this._rectangleNortheastInMeters.y-p.y,y=g/c|0;y>=o&&(y=o-1);let A=m/f|0;return A>=s&&(A=s-1),l(i)?(i.x=y,i.y=A,i):new U(y,A)}},Fo=$Z;var JZ,BTe="AAPTaeRGM19PsTpo1ePVkJZk4Tg..zqn3rpU4kUaF-8QMW-oWZntlxvKhdUFXLBoo5dQwRNEKd1EoKJh-Ha2zxbrz2Nhz2tV_gLVZTQwFHLzJHKwsGDz4GTKV8jeUgb12Ci9CeU_9sOrauJYnGK2vHhtSSAQ-73rmKzNG_2lZ0zuCCEKslxCmXUw2mT1Cpk0RoCCtDheWByX1e7Lnb3LKCBDt9VhGFSGCOiaFfizFRLld8LWukKgxCgluTpKgUuUi4OytX84roEpm6mP7PE91AT1_5Uash6To",gw={};gw.defaultAccessToken=BTe;gw.defaultWorldImageryServer=new De({url:"https://ibasemaps-api.arcgis.com/arcgis/rest/services/World_Imagery/MapServer"});gw.defaultWorldHillshadeServer=new De({url:"https://ibasemaps-api.arcgis.com/arcgis/rest/services/Elevation/World_Hillshade/MapServer"});gw.defaultWorldOceanServer=new De({url:"https://ibasemaps-api.arcgis.com/arcgis/rest/services/Ocean/World_Ocean_Base/MapServer"});gw.getDefaultTokenCredit=function(e){if(e===BTe){if(!l(JZ)){let t='<b> This application is using a default ArcGIS access token. Please assign <i>Cesium.ArcGisMapService.defaultAccessToken</i> with an API key from your ArcGIS Developer account before using the ArcGIS tile services. You can sign up for a free ArcGIS Developer account at <a href="https://developers.arcgis.com/">https://developers.arcgis.com/</a>.</b>';JZ=new It(t,!0)}return JZ}};var Wf=gw;function ZZ(e){e=e??H.EMPTY_OBJECT,this._pixelsToCheck=e.pixelsToCheck,this._missingImagePixels=void 0,this._missingImageByteLength=void 0,this._isReady=!1;let t=De.createIfNeeded(e.missingImageUrl),n=this;function i(o){l(o.blob)&&(n._missingImageByteLength=o.blob.size);let s=kh(o);if(e.disableCheckIfAllPixelsAreTransparent){let a=!0,c=o.width,u=e.pixelsToCheck;for(let f=0,d=u.length;a&&f<d;++f){let p=u[f],g=p.x*4+p.y*c;s[g+3]>0&&(a=!1)}a&&(s=void 0)}n._missingImagePixels=s,n._isReady=!0}function r(){n._missingImagePixels=void 0,n._isReady=!0}t.fetchImage({preferBlob:!0,preferImageBitmap:!0,flipY:!0}).then(i).catch(r)}ZZ.prototype.isReady=function(){return this._isReady};ZZ.prototype.shouldDiscardImage=function(e){let t=this._pixelsToCheck,n=this._missingImagePixels;if(!l(n)||l(e.blob)&&e.blob.size!==this._missingImageByteLength)return!1;let i=kh(e),r=e.width;for(let o=0,s=t.length;o<s;++o){let a=t[o],c=a.x*4+a.y*r;for(let u=0;u<4;++u){let f=c+u;if(i[f]!==n[f])return!1}}return!0};var i2=ZZ;function QZ(){this.name=void 0,this.description=void 0,this.position=void 0,this.data=void 0,this.imageryLayer=void 0}QZ.prototype.configureNameFromProperties=function(e){let t=10,n;for(let i in e)if(e.hasOwnProperty(i)&&e[i]){let r=i.toLowerCase();t>1&&r==="name"?(t=1,n=i):t>2&&r==="title"?(t=2,n=i):t>3&&/name/i.test(i)?(t=3,n=i):t>4&&/title/i.test(i)&&(t=4,n=i)}l(n)&&(this.name=e[n])};QZ.prototype.configureDescriptionFromProperties=function(e){function t(n){let i='<table class="cesium-infoBox-defaultTable">';for(let r in n)if(n.hasOwnProperty(r)){let o=n[r];l(o)&&(typeof o=="object"?i+=`<tr><td>${r}</td><td>${t(o)}</td></tr>`:i+=`<tr><td>${r}</td><td>${o}</td></tr>`)}return i+="</table>",i}this.description=t(e)};var Im=QZ;function _w(){pe.throwInstantiationError()}Object.defineProperties(_w.prototype,{rectangle:{get:pe.throwInstantiationError},tileWidth:{get:pe.throwInstantiationError},tileHeight:{get:pe.throwInstantiationError},maximumLevel:{get:pe.throwInstantiationError},minimumLevel:{get:pe.throwInstantiationError},tilingScheme:{get:pe.throwInstantiationError},tileDiscardPolicy:{get:pe.throwInstantiationError},errorEvent:{get:pe.throwInstantiationError},credit:{get:pe.throwInstantiationError},proxy:{get:pe.throwInstantiationError},hasAlphaChannel:{get:pe.throwInstantiationError}});_w.prototype.getTileCredits=function(e,t,n){pe.throwInstantiationError()};_w.prototype.requestImage=function(e,t,n,i){pe.throwInstantiationError()};_w.prototype.pickFeatures=function(e,t,n,i,r){pe.throwInstantiationError()};var Act=/\.ktx2$/i;_w.loadImage=function(e,t){let n=De.createIfNeeded(t);return Act.test(n.url)?Ou(n):l(e)&&l(e.tileDiscardPolicy)?n.fetchImage({preferBlob:!0,preferImageBitmap:!0,flipY:!0}):n.fetchImage({preferImageBitmap:!0,flipY:!0})};var qf=_w;var kTe={SATELLITE:1,OCEANS:2,HILLSHADE:3};Object.freeze(kTe);var Pm=kTe;function UTe(e){this.useTiles=e.usePreCachedTilesIfAvailable??!0;let t=e.ellipsoid;this.tilingScheme=e.tilingScheme??new Qi({ellipsoid:t}),this.rectangle=e.rectangle??this.tilingScheme.rectangle,this.ellipsoid=t;let n=e.credit;typeof n=="string"&&(n=new It(n)),this.credit=n,this.tileCredits=void 0,this.tileDiscardPolicy=e.tileDiscardPolicy,this.tileWidth=e.tileWidth??256,this.tileHeight=e.tileHeight??256,this.maximumLevel=e.maximumLevel}UTe.prototype.build=function(e){e._useTiles=this.useTiles,e._tilingScheme=this.tilingScheme,e._rectangle=this.rectangle,e._credit=this.credit,e._tileCredits=this.tileCredits,e._tileDiscardPolicy=this.tileDiscardPolicy,e._tileWidth=this.tileWidth,e._tileHeight=this.tileHeight,e._maximumLevel=this.maximumLevel,this.useTiles&&!l(this.tileDiscardPolicy)&&(e._tileDiscardPolicy=new i2({missingImageUrl:zTe(e,0,0,this.maximumLevel).url,pixelsToCheck:[new U(0,0),new U(200,20),new U(20,200),new U(80,110),new U(160,130)],disableCheckIfAllPixelsAreTransparent:!0}))};function bct(e,t){let n=e.tileInfo;if(!l(n))t.useTiles=!1;else{if(t.tileWidth=n.rows,t.tileHeight=n.cols,n.spatialReference.wkid===102100||n.spatialReference.wkid===102113)t.tilingScheme=new Fo({ellipsoid:t.ellipsoid});else if(e.tileInfo.spatialReference.wkid===4326)t.tilingScheme=new Qi({ellipsoid:t.ellipsoid});else{let i=`Tile spatial reference WKID ${e.tileInfo.spatialReference.wkid} is not supported.`;throw new oe(i)}if(t.maximumLevel=e.tileInfo.lods.length-1,l(e.fullExtent)){if(l(e.fullExtent.spatialReference)&&l(e.fullExtent.spatialReference.wkid))if(e.fullExtent.spatialReference.wkid===102100||e.fullExtent.spatialReference.wkid===102113){let i=new yi,r=e.fullExtent,o=i.unproject(new h(Math.max(r.xmin,-t.tilingScheme.ellipsoid.maximumRadius*Math.PI),Math.max(r.ymin,-t.tilingScheme.ellipsoid.maximumRadius*Math.PI),0)),s=i.unproject(new h(Math.min(r.xmax,t.tilingScheme.ellipsoid.maximumRadius*Math.PI),Math.min(r.ymax,t.tilingScheme.ellipsoid.maximumRadius*Math.PI),0));t.rectangle=new ie(o.longitude,o.latitude,s.longitude,s.latitude)}else if(e.fullExtent.spatialReference.wkid===4326)t.rectangle=ie.fromDegrees(e.fullExtent.xmin,e.fullExtent.ymin,e.fullExtent.xmax,e.fullExtent.ymax);else{let i=`fullExtent.spatialReference WKID ${e.fullExtent.spatialReference.wkid} is not supported.`;throw new oe(i)}}else t.rectangle=t.tilingScheme.rectangle;t.useTiles=!0}l(e.copyrightText)&&e.copyrightText.length>0&&(l(t.credit)?t.tileCredits=[new It(e.copyrightText)]:t.credit=new It(e.copyrightText))}function xct(e,t){let n=`An error occurred while accessing ${e.url}`;throw l(t)&&l(t.message)&&(n+=`: ${t.message}`),new oe(n)}async function Tct(e,t){let n=e.getDerivedResource({queryParameters:{f:"json"}});try{let i=await n.fetchJson();bct(i,t)}catch(i){xct(e,i)}}function n0(e){e=e??H.EMPTY_OBJECT,this._defaultAlpha=void 0,this._defaultNightAlpha=void 0,this._defaultDayAlpha=void 0,this._defaultBrightness=void 0,this._defaultContrast=void 0,this._defaultHue=void 0,this._defaultSaturation=void 0,this._defaultGamma=void 0,this._defaultMinificationFilter=void 0,this._defaultMagnificationFilter=void 0,this._tileDiscardPolicy=e.tileDiscardPolicy,this._tileWidth=e.tileWidth??256,this._tileHeight=e.tileHeight??256,this._maximumLevel=e.maximumLevel,this._tilingScheme=e.tilingScheme??new Qi({ellipsoid:e.ellipsoid}),this._useTiles=e.usePreCachedTilesIfAvailable??!0,this._rectangle=e.rectangle??this._tilingScheme.rectangle,this._layers=e.layers,this._credit=e.credit,this._tileCredits=void 0,this.enablePickFeatures=e.enablePickFeatures??!0,this._errorEvent=new be}n0.fromBasemapType=async function(e,t){t=t??H.EMPTY_OBJECT;let n,i,r;switch(e){case Pm.SATELLITE:{n=t.token??Wf.defaultAccessToken,i=De.createIfNeeded(Wf.defaultWorldImageryServer),i.appendForwardSlash();let o=Wf.getDefaultTokenCredit(n);l(o)&&(r=It.clone(o))}break;case Pm.OCEANS:{n=t.token??Wf.defaultAccessToken,i=De.createIfNeeded(Wf.defaultWorldOceanServer),i.appendForwardSlash();let o=Wf.getDefaultTokenCredit(n);l(o)&&(r=It.clone(o))}break;case Pm.HILLSHADE:{n=t.token??Wf.defaultAccessToken,i=De.createIfNeeded(Wf.defaultWorldHillshadeServer),i.appendForwardSlash();let o=Wf.getDefaultTokenCredit(n);l(o)&&(r=It.clone(o))}break;default:}return n0.fromUrl(i,{...t,token:n,credit:r,usePreCachedTilesIfAvailable:!0})};function zTe(e,t,n,i,r){let o;if(e._useTiles)o=e._resource.getDerivedResource({url:`tile/${i}/${n}/${t}`,request:r});else{let s=e._tilingScheme.tileXYToNativeRectangle(t,n,i),c={bbox:`${s.west},${s.south},${s.east},${s.north}`,size:`${e._tileWidth},${e._tileHeight}`,format:"png32",transparent:!0,f:"image"};e._tilingScheme.projection instanceof Ui?(c.bboxSR=4326,c.imageSR=4326):(c.bboxSR=3857,c.imageSR=3857),e.layers&&(c.layers=`show:${e.layers}`),o=e._resource.getDerivedResource({url:"export",request:r,queryParameters:c})}return o}Object.defineProperties(n0.prototype,{url:{get:function(){return this._resource._url}},token:{get:function(){return this._resource.queryParameters.token}},proxy:{get:function(){return this._resource.proxy}},tileWidth:{get:function(){return this._tileWidth}},tileHeight:{get:function(){return this._tileHeight}},maximumLevel:{get:function(){return this._maximumLevel}},minimumLevel:{get:function(){return 0}},tilingScheme:{get:function(){return this._tilingScheme}},rectangle:{get:function(){return this._rectangle}},tileDiscardPolicy:{get:function(){return this._tileDiscardPolicy}},errorEvent:{get:function(){return this._errorEvent}},credit:{get:function(){return this._credit}},usingPrecachedTiles:{get:function(){return this._useTiles}},hasAlphaChannel:{get:function(){return!0}},layers:{get:function(){return this._layers}}});n0.fromUrl=async function(e,t){t=t??H.EMPTY_OBJECT;let n=De.createIfNeeded(e);n.appendForwardSlash(),l(t.token)&&n.setQueryParameters({token:t.token});let i=new n0(t);i._resource=n;let r=new UTe(t);return(t.usePreCachedTilesIfAvailable??!0)&&await Tct(n,r),r.build(i),i};n0.prototype.getTileCredits=function(e,t,n){return this._tileCredits};n0.prototype.requestImage=function(e,t,n,i){return qf.loadImage(this,zTe(this,e,t,n,i))};n0.prototype.pickFeatures=function(e,t,n,i,r){if(!this.enablePickFeatures)return;let o=this._tilingScheme.tileXYToNativeRectangle(e,t,n),s,a,c;if(this._tilingScheme.projection instanceof Ui)s=D.toDegrees(i),a=D.toDegrees(r),c="4326";else{let p=this._tilingScheme.projection.project(new he(i,r,0));s=p.x,a=p.y,c="3857"}let u="visible";l(this._layers)&&(u+=`:${this._layers}`);let f={f:"json",tolerance:2,geometryType:"esriGeometryPoint",geometry:`${s},${a}`,mapExtent:`${o.west},${o.south},${o.east},${o.north}`,imageDisplay:`${this._tileWidth},${this._tileHeight},96`,sr:c,layers:u};return this._resource.getDerivedResource({url:"identify",queryParameters:f}).fetchJson().then(function(p){let g=[],m=p.results;if(!l(m))return g;for(let y=0;y<m.length;++y){let A=m[y],b=new Im;if(b.data=A,b.name=A.value,b.properties=A.attributes,b.configureDescriptionFromProperties(A.attributes),A.geometryType==="esriGeometryPoint"&&A.geometry){let x=A.geometry.spatialReference&&A.geometry.spatialReference.wkid?A.geometry.spatialReference.wkid:4326;if(x===4326||x===4283)b.position=he.fromDegrees(A.geometry.x,A.geometry.y,A.geometry.z);else if(x===102100||x===900913||x===3857){let T=new yi;b.position=T.unproject(new h(A.geometry.x,A.geometry.y,A.geometry.z))}}g.push(b)}return g})};n0._metadataCache={};var o_=n0;function $H(e,t,n,i,r,o,s){this.provider=e,this.message=t,this.x=n,this.y=i,this.level=r,this.timesRetried=o??0,this.retry=!1,this.error=s}$H.reportError=function(e,t,n,i,r,o,s,a){let c=e;return l(e)?(c.provider=t,c.message=i,c.x=r,c.y=o,c.level=s,c.retry=!1,c.error=a,++c.timesRetried):c=new $H(t,i,r,o,s,0,a),l(n)&&n.numberOfListeners>0?n.raiseEvent(c):l(t)&&console.log(`An error occurred in "${t.constructor.name}": ${Fp(i)}`),c};$H.reportSuccess=function(e){l(e)&&(e.timesRetried=-1)};var Zr=$H;var VTe={AERIAL:"Aerial",AERIAL_WITH_LABELS:"AerialWithLabels",AERIAL_WITH_LABELS_ON_DEMAND:"AerialWithLabelsOnDemand",ROAD:"Road",ROAD_ON_DEMAND:"RoadOnDemand",CANVAS_DARK:"CanvasDark",CANVAS_LIGHT:"CanvasLight",CANVAS_GRAY:"CanvasGray",ORDNANCE_SURVEY:"OrdnanceSurvey",COLLINS_BART:"CollinsBart"};Object.freeze(VTe);var yw=VTe;function r2(e){}r2.prototype.isReady=function(){return!0};r2.prototype.shouldDiscardImage=function(e){return r2.EMPTY_IMAGE===e};var JH;Object.defineProperties(r2,{EMPTY_IMAGE:{get:function(){return l(JH)||(JH=new Image,JH.src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAQAAAC1HAwCAAAAC0lEQVR42mNkYAAAAAYAAjCB0C8AAAAASUVORK5CYII="),JH}}});var Aw=r2;function jTe(e){this.tileWidth=void 0,this.tileHeight=void 0,this.maximumLevel=void 0,this.imageUrlSubdomains=void 0,this.imageUrlTemplate=void 0,this.attributionList=void 0}jTe.prototype.build=function(e){e._tileWidth=this.tileWidth,e._tileHeight=this.tileHeight,e._maximumLevel=this.maximumLevel,e._imageUrlSubdomains=this.imageUrlSubdomains,e._imageUrlTemplate=this.imageUrlTemplate;let t=e._attributionList=this.attributionList;t||(t=[]),e._attributionList=t;for(let n=0,i=t.length;n<i;++n){let r=t[n];if(r.credit instanceof It)break;r.credit=new It(r.attribution);let o=r.coverageAreas;for(let s=0,a=r.coverageAreas.length;s<a;++s){let c=o[s],u=c.bbox;c.bbox=new ie(D.toRadians(u[1]),D.toRadians(u[0]),D.toRadians(u[3]),D.toRadians(u[2]))}}};function Ect(e,t){if(e.resourceSets.length!==1)throw new oe("metadata does not specify one resource in resourceSets");let n=e.resourceSets[0].resources[0];t.tileWidth=n.imageWidth,t.tileHeight=n.imageHeight,t.maximumLevel=n.zoomMax-1,t.imageUrlSubdomains=n.imageUrlSubdomains,t.imageUrlTemplate=n.imageUrl;let i=n.imageryProviders;l(n.imageryProviders)&&(i=n.imageryProviders.filter(r=>r.coverageAreas?.some(o=>l(o.bbox)))),t.attributionList=i}function Cct(e,t,n){let i=`An error occurred while accessing ${e.url}`;throw l(t)&&l(t.message)&&(i+=`: ${t.message}`),Zr.reportError(void 0,n,l(n)?n._errorEvent:void 0,i,void 0,void 0,void 0,t),new oe(i)}async function vct(e,t,n){let i=e.url,r=Ca._metadataCache[i];l(r)||(r=e.fetchJson(),Ca._metadataCache[i]=r);try{let o=await r;return Ect(o,t)}catch(o){Cct(e,o,n)}}function Ca(e){e=e??H.EMPTY_OBJECT,this._defaultAlpha=void 0,this._defaultNightAlpha=void 0,this._defaultDayAlpha=void 0,this._defaultBrightness=void 0,this._defaultContrast=void 0,this._defaultHue=void 0,this._defaultSaturation=void 0,this._defaultGamma=1,this._defaultMinificationFilter=void 0,this._defaultMagnificationFilter=void 0,this._mapStyle=e.mapStyle??yw.AERIAL,this._mapLayer=e.mapLayer,this._culture=e.culture??"",this._key=e.key,this._tileDiscardPolicy=e.tileDiscardPolicy,l(this._tileDiscardPolicy)||(this._tileDiscardPolicy=new Aw),this._proxy=e.proxy,this._credit=new It(`<a href="https://www.microsoft.com/en-us/maps/bing-maps/product"><img src="${Ca.logoUrl}" title="Bing Imagery"/></a>`),this._tilingScheme=new Fo({numberOfLevelZeroTilesX:2,numberOfLevelZeroTilesY:2,ellipsoid:e.ellipsoid}),this._tileWidth=void 0,this._tileHeight=void 0,this._maximumLevel=void 0,this._imageUrlTemplate=void 0,this._imageUrlSubdomains=void 0,this._attributionList=void 0,this._errorEvent=new be}Object.defineProperties(Ca.prototype,{url:{get:function(){return this._resource.url}},proxy:{get:function(){return this._resource.proxy}},key:{get:function(){return this._key}},mapStyle:{get:function(){return this._mapStyle}},mapLayer:{get:function(){return this._mapLayer}},culture:{get:function(){return this._culture}},tileWidth:{get:function(){return this._tileWidth}},tileHeight:{get:function(){return this._tileHeight}},maximumLevel:{get:function(){return this._maximumLevel}},minimumLevel:{get:function(){return 0}},tilingScheme:{get:function(){return this._tilingScheme}},rectangle:{get:function(){return this._tilingScheme.rectangle}},tileDiscardPolicy:{get:function(){return this._tileDiscardPolicy}},errorEvent:{get:function(){return this._errorEvent}},credit:{get:function(){return this._credit}},hasAlphaChannel:{get:function(){return l(this.mapLayer)}}});Ca.fromUrl=async function(e,t){t=t??H.EMPTY_OBJECT;let n=t.tileProtocol;l(n)?n.length>0&&n[n.length-1]===":"&&(n=n.substr(0,n.length-1)):n=document.location.protocol==="http:"?"http":"https";let i=t.mapStyle??yw.AERIAL,r=De.createIfNeeded(e);r.appendForwardSlash();let o={incl:"ImageryProviders",key:t.key,uriScheme:n};l(t.mapLayer)&&(o.mapLayer=t.mapLayer),l(t.culture)&&(o.culture=t.culture);let s=r.getDerivedResource({url:`REST/v1/Imagery/Metadata/${i}`,queryParameters:o}),a=new Ca(t);a._resource=r;let c=new jTe(t);return await vct(s,c),c.build(a),a};var Sct=new ie;Ca.prototype.getTileCredits=function(e,t,n){let i=this._tilingScheme.tileXYToRectangle(e,t,n,Sct);return Pct(this._attributionList,n,i)};Ca.prototype.requestImage=function(e,t,n,i){let r=qf.loadImage(this,wct(this,e,t,n,i));if(l(r))return r.catch(function(o){return l(o.blob)&&o.blob.size===0?Aw.EMPTY_IMAGE:Promise.reject(o)})};Ca.prototype.pickFeatures=function(e,t,n,i,r){};Ca.tileXYToQuadKey=function(e,t,n){let i="";for(let r=n;r>=0;--r){let o=1<<r,s=0;(e&o)!==0&&(s|=1),(t&o)!==0&&(s|=2),i+=s}return i};Ca.quadKeyToTileXY=function(e){let t=0,n=0,i=e.length-1;for(let r=i;r>=0;--r){let o=1<<r,s=+e[i-r];(s&1)!==0&&(t|=o),(s&2)!==0&&(n|=o)}return{x:t,y:n,level:i}};Ca._logoUrl=void 0;Object.defineProperties(Ca,{logoUrl:{get:function(){return l(Ca._logoUrl)||(Ca._logoUrl=Zt("Assets/Images/bing_maps_credit.png")),Ca._logoUrl},set:function(e){Ca._logoUrl=e}}});function wct(e,t,n,i,r){let o=e._imageUrlTemplate,s=e._imageUrlSubdomains,a=(t+n+i)%s.length;return e._resource.getDerivedResource({url:o,request:r,templateValues:{quadkey:Ca.tileXYToQuadKey(t,n,i),subdomain:s[a],culture:e._culture},queryParameters:{n:"z"}})}var Ict=new ie;function Pct(e,t,n){++t;let i=[];for(let r=0,o=e.length;r<o;++r){let s=e[r],a=s.coverageAreas,c=!1;for(let u=0,f=s.coverageAreas.length;!c&&u<f;++u){let d=a[u];if(t>=d.zoomMin&&t<=d.zoomMax){let p=ie.intersection(n,d.bbox,Ict);l(p)&&(c=!0)}}c&&i.push(s.credit)}return i}Ca._metadataCache={};var o2=Ca;var HTe=/{[^}]+}/g,GTe={x:Mct,y:Lct,z:kct,s:Uct,reverseX:Nct,reverseY:Fct,reverseZ:Bct,westDegrees:zct,southDegrees:Vct,eastDegrees:jct,northDegrees:Hct,westProjected:Gct,southProjected:Wct,eastProjected:qct,northProjected:Yct,width:Xct,height:Kct},Dct=Ot(GTe,{i:$ct,j:Jct,reverseI:Zct,reverseJ:Qct,longitudeDegrees:tlt,latitudeDegrees:nlt,longitudeProjected:ilt,latitudeProjected:rlt,format:slt});function s2(e){e=e??H.EMPTY_OBJECT,this._errorEvent=new be;let t=De.createIfNeeded(e.url),n=De.createIfNeeded(e.pickFeaturesUrl);this._resource=t,this._urlSchemeZeroPadding=e.urlSchemeZeroPadding,this._getFeatureInfoFormats=e.getFeatureInfoFormats,this._pickFeaturesResource=n;let i=e.subdomains;Array.isArray(i)?i=i.slice():l(i)&&i.length>0?i=i.split(""):i=["a","b","c"],this._subdomains=i,this._tileWidth=e.tileWidth??256,this._tileHeight=e.tileHeight??256,this._minimumLevel=e.minimumLevel??0,this._maximumLevel=e.maximumLevel,this._tilingScheme=e.tilingScheme??new Fo({ellipsoid:e.ellipsoid}),this._rectangle=e.rectangle??this._tilingScheme.rectangle,this._rectangle=ie.intersection(this._rectangle,this._tilingScheme.rectangle),this._tileDiscardPolicy=e.tileDiscardPolicy;let r=e.credit;typeof r=="string"&&(r=new It(r)),this._credit=r,this._hasAlphaChannel=e.hasAlphaChannel??!0;let o=e.customTags,s=Ot(GTe,o),a=Ot(Dct,o);this._tags=s,this._pickFeaturesTags=a,this._defaultAlpha=void 0,this._defaultNightAlpha=void 0,this._defaultDayAlpha=void 0,this._defaultBrightness=void 0,this._defaultContrast=void 0,this._defaultHue=void 0,this._defaultSaturation=void 0,this._defaultGamma=void 0,this._defaultMinificationFilter=void 0,this._defaultMagnificationFilter=void 0,this.enablePickFeatures=e.enablePickFeatures??!0}Object.defineProperties(s2.prototype,{url:{get:function(){return this._resource.url}},urlSchemeZeroPadding:{get:function(){return this._urlSchemeZeroPadding}},pickFeaturesUrl:{get:function(){return this._pickFeaturesResource.url}},proxy:{get:function(){return this._resource.proxy}},tileWidth:{get:function(){return this._tileWidth}},tileHeight:{get:function(){return this._tileHeight}},maximumLevel:{get:function(){return this._maximumLevel}},minimumLevel:{get:function(){return this._minimumLevel}},tilingScheme:{get:function(){return this._tilingScheme}},rectangle:{get:function(){return this._rectangle}},tileDiscardPolicy:{get:function(){return this._tileDiscardPolicy}},errorEvent:{get:function(){return this._errorEvent}},credit:{get:function(){return this._credit}},hasAlphaChannel:{get:function(){return this._hasAlphaChannel}}});s2.prototype.getTileCredits=function(e,t,n){};s2.prototype.requestImage=function(e,t,n,i){return qf.loadImage(this,Rct(this,e,t,n,i))};s2.prototype.pickFeatures=function(e,t,n,i,r){if(!this.enablePickFeatures||!l(this._pickFeaturesResource)||this._getFeatureInfoFormats.length===0)return;let o=0,s=this;function a(u,f){return u.callback(f)}function c(){if(o>=s._getFeatureInfoFormats.length)return Promise.resolve([]);let u=s._getFeatureInfoFormats[o],f=Oct(s,e,t,n,i,r,u.format);return++o,u.type==="json"?f.fetchJson().then(u.callback).catch(c):u.type==="xml"?f.fetchXML().then(u.callback).catch(c):u.type==="text"||u.type==="html"?f.fetchText().then(u.callback).catch(c):f.fetch({responseType:u.format}).then(a.bind(void 0,u)).catch(c)}return c()};var ZH=!1,Yf=new ie,QH=!1,a2=new ie;function Rct(e,t,n,i,r){ZH=!1,QH=!1;let o=e._resource,s=o.getUrlComponent(!0),a=e._tags,c={},u=s.match(HTe);return l(u)&&u.forEach(function(f){let d=f.substring(1,f.length-1);l(a[d])&&(c[d]=a[d](e,t,n,i))}),o.getDerivedResource({request:r,templateValues:c})}var eQ=!1,xw=new U,tQ=!1;function Oct(e,t,n,i,r,o,s){ZH=!1,QH=!1,eQ=!1,tQ=!1;let a=e._pickFeaturesResource,c=a.getUrlComponent(!0),u=e._pickFeaturesTags,f={},d=c.match(HTe);return l(d)&&d.forEach(function(p){let g=p.substring(1,p.length-1);l(u[g])&&(f[g]=u[g](e,t,n,i,r,o,s))}),a.getDerivedResource({templateValues:f})}function Tw(e,t,n){if(e&&e.urlSchemeZeroPadding&&e.urlSchemeZeroPadding.hasOwnProperty(t)){let i=e.urlSchemeZeroPadding[t];if(typeof i=="string"){let r=i.length;r>1&&(n=n.length>=r?n:new Array(r-n.toString().length+1).join("0")+n)}}return n}function Mct(e,t,n,i){return Tw(e,"{x}",t)}function Nct(e,t,n,i){let r=e.tilingScheme.getNumberOfXTilesAtLevel(i)-t-1;return Tw(e,"{reverseX}",r)}function Lct(e,t,n,i){return Tw(e,"{y}",n)}function Fct(e,t,n,i){let r=e.tilingScheme.getNumberOfYTilesAtLevel(i)-n-1;return Tw(e,"{reverseY}",r)}function Bct(e,t,n,i){let r=e.maximumLevel,o=l(r)&&i<r?r-i-1:i;return Tw(e,"{reverseZ}",o)}function kct(e,t,n,i){return Tw(e,"{z}",i)}function Uct(e,t,n,i){let r=(t+n+i)%e._subdomains.length;return e._subdomains[r]}function eG(e,t,n,i){ZH||(e.tilingScheme.tileXYToRectangle(t,n,i,Yf),Yf.west=D.toDegrees(Yf.west),Yf.south=D.toDegrees(Yf.south),Yf.east=D.toDegrees(Yf.east),Yf.north=D.toDegrees(Yf.north),ZH=!0)}function zct(e,t,n,i){return eG(e,t,n,i),Yf.west}function Vct(e,t,n,i){return eG(e,t,n,i),Yf.south}function jct(e,t,n,i){return eG(e,t,n,i),Yf.east}function Hct(e,t,n,i){return eG(e,t,n,i),Yf.north}function tG(e,t,n,i){QH||(e.tilingScheme.tileXYToNativeRectangle(t,n,i,a2),QH=!0)}function Gct(e,t,n,i){return tG(e,t,n,i),a2.west}function Wct(e,t,n,i){return tG(e,t,n,i),a2.south}function qct(e,t,n,i){return tG(e,t,n,i),a2.east}function Yct(e,t,n,i){return tG(e,t,n,i),a2.north}function Xct(e,t,n,i){return e.tileWidth}function Kct(e,t,n,i){return e.tileHeight}function $ct(e,t,n,i,r,o,s){return nG(e,t,n,i,r,o),xw.x}function Jct(e,t,n,i,r,o,s){return nG(e,t,n,i,r,o),xw.y}function Zct(e,t,n,i,r,o,s){return nG(e,t,n,i,r,o),e.tileWidth-xw.x-1}function Qct(e,t,n,i,r,o,s){return nG(e,t,n,i,r,o),e.tileHeight-xw.y-1}var elt=new ie,bw=new h;function nG(e,t,n,i,r,o,s){if(eQ)return;nQ(e,t,n,i,r,o);let a=bw,c=e.tilingScheme.tileXYToNativeRectangle(t,n,i,elt);xw.x=e.tileWidth*(a.x-c.west)/c.width|0,xw.y=e.tileHeight*(c.north-a.y)/c.height|0,eQ=!0}function tlt(e,t,n,i,r,o,s){return D.toDegrees(r)}function nlt(e,t,n,i,r,o,s){return D.toDegrees(o)}function ilt(e,t,n,i,r,o,s){return nQ(e,t,n,i,r,o),bw.x}function rlt(e,t,n,i,r,o,s){return nQ(e,t,n,i,r,o),bw.y}var olt=new he;function nQ(e,t,n,i,r,o,s){if(!tQ){if(e.tilingScheme.projection instanceof Ui)bw.x=D.toDegrees(r),bw.y=D.toDegrees(o);else{let a=olt;a.longitude=r,a.latitude=o,e.tilingScheme.projection.project(a,bw)}tQ=!0}}function slt(e,t,n,i,r,o,s){return s}var ws=s2;function th(e){ws.call(this,e)}th._requestMetadata=async function(e,t,n,i){try{let r=await n.fetchXML();return th._metadataSuccess(r,e,t,n,i)}catch(r){if(r instanceof wp)return th._metadataFailure(e,t);throw r}};th.fromUrl=async function(e,t){let n=De.createIfNeeded(e);n.appendForwardSlash();let i=n,r=n.getDerivedResource({url:"tilemapresource.xml"});t=t??H.EMPTY_OBJECT;let o=await th._requestMetadata(t,i,r);return new th(o)};l(Object.create)&&(th.prototype=Object.create(ws.prototype),th.prototype.constructor=th);function WTe(e,t){return e.west<t.rectangle.west&&(e.west=t.rectangle.west),e.east>t.rectangle.east&&(e.east=t.rectangle.east),e.south<t.rectangle.south&&(e.south=t.rectangle.south),e.north>t.rectangle.north&&(e.north=t.rectangle.north),e}function qTe(e,t,n){let i=e.positionToTileXY(ie.southwest(t),n),r=e.positionToTileXY(ie.northeast(t),n);return(Math.abs(r.x-i.x)+1)*(Math.abs(r.y-i.y)+1)>4?0:n}th._metadataSuccess=function(e,t,n,i,r){let o=/tileformat/i,s=/tileset/i,a=/tilesets/i,c=/boundingbox/i,u,f,d,p=[],g=e.childNodes[0].childNodes;for(let R=0;R<g.length;R++)if(o.test(g.item(R).nodeName))u=g.item(R);else if(a.test(g.item(R).nodeName)){d=g.item(R);let O=g.item(R).childNodes;for(let L=0;L<O.length;L++)s.test(O.item(L).nodeName)&&p.push(O.item(L))}else c.test(g.item(R).nodeName)&&(f=g.item(R));let m;if(!l(d)||!l(f))throw m=`Unable to find expected tilesets or bbox attributes in ${i.url}.`,l(r)&&Zr.reportError(void 0,r,r.errorEvent,m),new oe(m);let y=t.fileExtension??u.getAttribute("extension"),A=t.tileWidth??parseInt(u.getAttribute("width"),10),b=t.tileHeight??parseInt(u.getAttribute("height"),10),x=t.minimumLevel??parseInt(p[0].getAttribute("order"),10),T=t.maximumLevel??parseInt(p[p.length-1].getAttribute("order"),10),E=d.getAttribute("profile"),v=t.tilingScheme;if(!l(v))if(E==="geodetic"||E==="global-geodetic")v=new Qi({ellipsoid:t.ellipsoid});else if(E==="mercator"||E==="global-mercator")v=new Fo({ellipsoid:t.ellipsoid});else throw m=`${i.url} specifies an unsupported profile attribute, ${E}.`,l(r)&&Zr.reportError(void 0,r,r.errorEvent,m),new oe(m);let S=ie.clone(t.rectangle);if(!l(S)){let R,O,L,_;t.flipXY??!1?(L=new U(parseFloat(f.getAttribute("miny")),parseFloat(f.getAttribute("minx"))),_=new U(parseFloat(f.getAttribute("maxy")),parseFloat(f.getAttribute("maxx")))):(L=new U(parseFloat(f.getAttribute("minx")),parseFloat(f.getAttribute("miny"))),_=new U(parseFloat(f.getAttribute("maxx")),parseFloat(f.getAttribute("maxy"))));let w=E==="geodetic"||E==="mercator";if(v.projection instanceof Ui||w)R=he.fromDegrees(L.x,L.y),O=he.fromDegrees(_.x,_.y);else{let P=v.projection;R=P.unproject(L),O=P.unproject(_)}S=new ie(R.longitude,R.latitude,O.longitude,O.latitude)}return S=WTe(S,v),x=qTe(v,S,x),{url:n.getDerivedResource({url:`{z}/{x}/{reverseY}.${y}`}),tilingScheme:v,rectangle:S,tileWidth:A,tileHeight:b,minimumLevel:x,maximumLevel:T,tileDiscardPolicy:t.tileDiscardPolicy,credit:t.credit}};th._metadataFailure=function(e,t){let n=e.fileExtension??"png",i=e.tileWidth??256,r=e.tileHeight??256,o=e.maximumLevel,s=l(e.tilingScheme)?e.tilingScheme:new Fo({ellipsoid:e.ellipsoid}),a=e.rectangle??s.rectangle;a=WTe(a,s);let c=qTe(s,a,e.minimumLevel);return{url:t.getDerivedResource({url:`{z}/{x}/{reverseY}.${n}`}),tilingScheme:s,rectangle:a,tileWidth:i,tileHeight:r,minimumLevel:c,maximumLevel:o,tileDiscardPolicy:e.tileDiscardPolicy,credit:e.credit}};var PA=th;function YTe(e){this.channel=e.channel,this.ellipsoid=e.ellipsoid,this.tilingScheme=void 0,this.version=void 0}YTe.prototype.build=function(e){e._channel=this.channel,e._version=this.version,e._tilingScheme=this.tilingScheme};function alt(e,t){let n;try{n=JSON.parse(e)}catch{n=JSON.parse(e.replace(/([\[\{,])[\n\r ]*([A-Za-z0-9]+)[\n\r ]*:/g,'$1"$2":'))}let i;for(let r=0;r<n.layers.length;r++)if(n.layers[r].id===t.channel){i=n.layers[r];break}if(!l(i)){let r=`Could not find layer with channel (id) of ${t.channel}.`;throw new oe(r)}if(!l(i.version)){let r=`Could not find a version in channel (id) ${t.channel}.`;throw new oe(r)}if(t.version=i.version,l(n.projection)&&n.projection==="flat")t.tilingScheme=new Qi({numberOfLevelZeroTilesX:2,numberOfLevelZeroTilesY:2,rectangle:new ie(-Math.PI,-Math.PI,Math.PI,Math.PI),ellipsoid:t.ellipsoid});else if(!l(n.projection)||n.projection==="mercator")t.tilingScheme=new Fo({numberOfLevelZeroTilesX:2,numberOfLevelZeroTilesY:2,ellipsoid:t.ellipsoid});else{let r=`Unsupported projection ${n.projection}.`;throw new oe(r)}return!0}function clt(e,t,n){let i=`An error occurred while accessing ${t.url}.`;throw l(e)&&l(e.message)&&(i+=`: ${e.message}`),Zr.reportError(void 0,n,l(n)?n._errorEvent:void 0,i),new oe(i)}async function llt(e,t,n){try{let i=await e.fetchText();alt(i,t)}catch(i){clt(i,e,n)}}function $u(e){e=e??{},this._defaultAlpha=void 0,this._defaultNightAlpha=void 0,this._defaultDayAlpha=void 0,this._defaultBrightness=void 0,this._defaultContrast=void 0,this._defaultHue=void 0,this._defaultSaturation=void 0,this._defaultGamma=1.9,this._defaultMinificationFilter=void 0,this._defaultMagnificationFilter=void 0,this._tileDiscardPolicy=e.tileDiscardPolicy,this._channel=e.channel,this._requestType="ImageryMaps",this._credit=new It(`<a href="http://www.google.com/enterprise/mapsearth/products/earthenterprise.html"><img src="${$u.logoUrl}" title="Google Imagery"/></a>`),this._tilingScheme=void 0,this._version=void 0,this._tileWidth=256,this._tileHeight=256,this._maximumLevel=e.maximumLevel,this._errorEvent=new be}Object.defineProperties($u.prototype,{url:{get:function(){return this._url}},path:{get:function(){return this._path}},proxy:{get:function(){return this._resource.proxy}},channel:{get:function(){return this._channel}},tileWidth:{get:function(){return this._tileWidth}},tileHeight:{get:function(){return this._tileHeight}},maximumLevel:{get:function(){return this._maximumLevel}},minimumLevel:{get:function(){return 0}},tilingScheme:{get:function(){return this._tilingScheme}},version:{get:function(){return this._version}},requestType:{get:function(){return this._requestType}},rectangle:{get:function(){return this._tilingScheme.rectangle}},tileDiscardPolicy:{get:function(){return this._tileDiscardPolicy}},errorEvent:{get:function(){return this._errorEvent}},credit:{get:function(){return this._credit}},hasAlphaChannel:{get:function(){return!0}}});$u.fromUrl=async function(e,t,n){n=n??{};let i=n.path??"/default_map",r=De.createIfNeeded(e).getDerivedResource({url:i[0]==="/"?i.substring(1):i});r.appendForwardSlash();let o=r.getDerivedResource({url:"query",queryParameters:{request:"Json",vars:"geeServerDefs",is2d:"t"}}),s=new YTe(n);s.channel=t,await llt(o,s);let a=new $u(n);return s.build(a),a._resource=r,a._url=e,a._path=i,a};$u.prototype.getTileCredits=function(e,t,n){};$u.prototype.requestImage=function(e,t,n,i){let r=this._resource.getDerivedResource({url:"query",request:i,queryParameters:{request:this._requestType,channel:this._channel,version:this._version,x:e,y:t,z:n+1}});return qf.loadImage(this,r)};$u.prototype.pickFeatures=function(e,t,n,i,r){};$u._logoUrl=void 0;Object.defineProperties($u,{logoUrl:{get:function(){return l($u._logoUrl)||($u._logoUrl=Zt("Assets/Images/google_earth_credit.png")),$u._logoUrl},set:function(e){$u._logoUrl=e}}});var c2=$u;var ult=/\/$/,XTe=new It('© <a href="https://www.mapbox.com/about/maps/">Mapbox</a> © <a href="http://www.openstreetmap.org/copyright">OpenStreetMap</a> <strong><a href="https://www.mapbox.com/map-feedback/">Improve this map</a></strong>');function Ew(e){e=e??H.EMPTY_OBJECT;let t=e.mapId,n=e.accessToken;this._defaultAlpha=void 0,this._defaultNightAlpha=void 0,this._defaultDayAlpha=void 0,this._defaultBrightness=void 0,this._defaultContrast=void 0,this._defaultHue=void 0,this._defaultSaturation=void 0,this._defaultGamma=void 0,this._defaultMinificationFilter=void 0,this._defaultMagnificationFilter=void 0;let i=De.createIfNeeded(e.url??"https://{s}.tiles.mapbox.com/v4/");this._mapId=t,this._accessToken=n;let r=e.format??"png";/\./.test(r)||(r=`.${r}`),this._format=r;let o=i.getUrlComponent();ult.test(o)||(o+="/"),o+=`${t}/{z}/{x}/{y}${this._format}`,i.url=o,i.setQueryParameters({access_token:n});let s;l(e.credit)?(s=e.credit,typeof s=="string"&&(s=new It(s))):s=XTe,this._resource=i,this._imageryProvider=new ws({url:i,credit:s,ellipsoid:e.ellipsoid,minimumLevel:e.minimumLevel,maximumLevel:e.maximumLevel,rectangle:e.rectangle})}Object.defineProperties(Ew.prototype,{url:{get:function(){return this._imageryProvider.url}},rectangle:{get:function(){return this._imageryProvider.rectangle}},tileWidth:{get:function(){return this._imageryProvider.tileWidth}},tileHeight:{get:function(){return this._imageryProvider.tileHeight}},maximumLevel:{get:function(){return this._imageryProvider.maximumLevel}},minimumLevel:{get:function(){return this._imageryProvider.minimumLevel}},tilingScheme:{get:function(){return this._imageryProvider.tilingScheme}},tileDiscardPolicy:{get:function(){return this._imageryProvider.tileDiscardPolicy}},errorEvent:{get:function(){return this._imageryProvider.errorEvent}},credit:{get:function(){return this._imageryProvider.credit}},proxy:{get:function(){return this._imageryProvider.proxy}},hasAlphaChannel:{get:function(){return this._imageryProvider.hasAlphaChannel}}});Ew.prototype.getTileCredits=function(e,t,n){};Ew.prototype.requestImage=function(e,t,n,i){return this._imageryProvider.requestImage(e,t,n,i)};Ew.prototype.pickFeatures=function(e,t,n,i,r){return this._imageryProvider.pickFeatures(e,t,n,i,r)};Ew._defaultCredit=XTe;var l2=Ew;function UT(e){e=e??H.EMPTY_OBJECT,this._defaultAlpha=void 0,this._defaultNightAlpha=void 0,this._defaultDayAlpha=void 0,this._defaultBrightness=void 0,this._defaultContrast=void 0,this._defaultHue=void 0,this._defaultSaturation=void 0,this._defaultGamma=void 0,this._defaultMinificationFilter=void 0,this._defaultMagnificationFilter=void 0;let t=e.rectangle??ie.MAX_VALUE,n=new Qi({rectangle:t,numberOfLevelZeroTilesX:1,numberOfLevelZeroTilesY:1,ellipsoid:e.ellipsoid});this._tilingScheme=n,this._image=void 0,this._texture=void 0,this._hasError=!1,this._errorEvent=new be;let i=e.credit;typeof i=="string"&&(i=new It(i)),this._credit=i;let r=De.createIfNeeded(e.url);this._resource=r,this._tileWidth=e.tileWidth,this._tileHeight=e.tileHeight}Object.defineProperties(UT.prototype,{url:{get:function(){return this._resource.url}},proxy:{get:function(){return this._resource.proxy}},tileWidth:{get:function(){return this._tileWidth}},tileHeight:{get:function(){return this._tileHeight}},maximumLevel:{get:function(){return 0}},minimumLevel:{get:function(){return 0}},tilingScheme:{get:function(){return this._tilingScheme}},rectangle:{get:function(){return this._tilingScheme.rectangle}},tileDiscardPolicy:{get:function(){}},errorEvent:{get:function(){return this._errorEvent}},credit:{get:function(){return this._credit}},hasAlphaChannel:{get:function(){return!0}}});function flt(e,t,n,i){let r=`Failed to load image ${e.url}`;l(t)&&l(t.message)&&(r+=`: ${t.message}`);let o=Zr.reportError(i,n,l(n)?n._errorEvent:void 0,r,0,0,0,t);if(o.retry)return iQ(e,n,o);throw l(n)&&(n._hasError=!0),new oe(r)}async function iQ(e,t,n){try{return await qf.loadImage(null,e)}catch(i){return flt(e,i,t,n)}}UT.fromUrl=async function(e,t){let n=De.createIfNeeded(e),i=await iQ(n);t=t??H.EMPTY_OBJECT;let r=new UT({...t,url:e,tileWidth:i.width,tileHeight:i.height});return r._image=i,r};UT.prototype.getTileCredits=function(e,t,n){};UT.prototype.requestImage=async function(e,t,n,i){if(!this._hasError&&!l(this._image)){let r=await iQ(this._resource,this);return this._image=r,Zr.reportSuccess(this._errorEvent),r}return this._image};UT.prototype.pickFeatures=function(e,t,n,i,r){};var u2=UT;function dlt(e,t,n){this.type=e,l(t)||(e==="json"?t="application/json":e==="xml"?t="text/xml":e==="html"?t="text/html":e==="text"&&(t="text/plain")),this.format=t,l(n)||(e==="json"?n=hlt:e==="xml"?n=_lt:(e==="html"||e==="text")&&(n=KTe)),this.callback=n}function hlt(e){let t=[],n=e.features;for(let i=0;i<n.length;++i){let r=n[i],o=new Im;if(o.data=r,o.properties=r.properties,o.configureNameFromProperties(r.properties),o.configureDescriptionFromProperties(r.properties),l(r.geometry)&&r.geometry.type==="Point"){let s=r.geometry.coordinates[0],a=r.geometry.coordinates[1];o.position=he.fromDegrees(s,a)}t.push(o)}return t}var rQ="http://www.mapinfo.com/mxp",mlt="http://www.esri.com/wms",plt="http://www.opengis.net/wfs",glt="http://www.opengis.net/gml";function _lt(e){let t=e.documentElement;if(t.localName==="MultiFeatureCollection"&&t.namespaceURI===rQ)return ylt(e);if(t.localName==="FeatureInfoResponse"&&t.namespaceURI===mlt)return Alt(e);if(t.localName==="FeatureCollection"&&t.namespaceURI===plt)return blt(e);if(t.localName==="ServiceExceptionReport")throw new oe(new XMLSerializer().serializeToString(t));return t.localName==="msGMLOutput"?xlt(e):Tlt(e)}function ylt(e){let t=[],i=e.documentElement.getElementsByTagNameNS(rQ,"Feature");for(let r=0;r<i.length;++r){let o=i[r],s={},a=o.getElementsByTagNameNS(rQ,"Val");for(let u=0;u<a.length;++u){let f=a[u];if(f.hasAttribute("ref")){let d=f.getAttribute("ref"),p=f.textContent.trim();s[d]=p}}let c=new Im;c.data=o,c.properties=s,c.configureNameFromProperties(s),c.configureDescriptionFromProperties(s),t.push(c)}return t}function Alt(e){let t=e.documentElement,n=[],i,r=t.getElementsByTagNameNS("*","FIELDS");if(r.length>0)for(let o=0;o<r.length;++o){let s=r[o];i={};let a=s.attributes;for(let c=0;c<a.length;++c){let u=a[c];i[u.name]=u.value}n.push(iG(s,i))}else{let o=t.getElementsByTagNameNS("*","FeatureInfo");for(let s=0;s<o.length;++s){let a=o[s];i={};let c=a.childNodes;for(let u=0;u<c.length;++u){let f=c[u];f.nodeType===Node.ELEMENT_NODE&&(i[f.localName]=f.textContent)}n.push(iG(a,i))}}return n}function blt(e){let t=[],i=e.documentElement.getElementsByTagNameNS(glt,"featureMember");for(let r=0;r<i.length;++r){let o=i[r],s={};oQ(o,s),t.push(iG(o,s))}return t}function xlt(e){let t=[],n,i=e.documentElement.childNodes;for(let o=0;o<i.length;o++)if(i[o].nodeType===Node.ELEMENT_NODE){n=i[o];break}if(!l(n))throw new oe("Unable to find first child of the feature info xml document");let r=n.childNodes;for(let o=0;o<r.length;++o){let s=r[o];if(s.nodeType===Node.ELEMENT_NODE){let a={};oQ(s,a),t.push(iG(s,a))}}return t}function oQ(e,t){let n=!0;for(let i=0;i<e.childNodes.length;++i){let r=e.childNodes[i];r.nodeType===Node.ELEMENT_NODE&&(n=!1),!(r.localName==="Point"||r.localName==="LineString"||r.localName==="Polygon"||r.localName==="boundedBy")&&r.hasChildNodes()&&oQ(r,t)&&(t[r.localName]=r.textContent)}return n}function iG(e,t){let n=new Im;return n.data=e,n.properties=t,n.configureNameFromProperties(t),n.configureDescriptionFromProperties(t),n}function Tlt(e){let t=new XMLSerializer().serializeToString(e),n=document.createElement("div"),i=document.createElement("pre");i.textContent=t,n.appendChild(i);let r=new Im;return r.data=e,r.description=n.innerHTML,[r]}var Elt=/<body>\s*<\/body>/im,Clt=/<ServiceExceptionReport([\s\S]*)<\/ServiceExceptionReport>/im,vlt=/<title>([\s\S]*)<\/title>/im;function KTe(e){if(Elt.test(e)||Clt.test(e))return;let t,n=vlt.exec(e);n&&n.length>1&&(t=n[1]);let i=new Im;return i.name=t,i.description=e,i.data=e,[i]}var Dm=dlt;function f2(e){e=e??H.EMPTY_OBJECT,this._tileCache={},this._tilesRequestedForInterval=[];let t=this._clock=e.clock;this._times=e.times,this._requestImageFunction=e.requestImageFunction,this._reloadFunction=e.reloadFunction,this._currentIntervalIndex=-1,t.onTick.addEventListener(this._clockOnTick,this),this._clockOnTick(t)}Object.defineProperties(f2.prototype,{clock:{get:function(){return this._clock},set:function(e){this._clock!==e&&(this._clock=e,this._clockOnTick(e),this._reloadFunction())}},times:{get:function(){return this._times},set:function(e){this._times!==e&&(this._times=e,this._clockOnTick(this._clock),this._reloadFunction())}},currentInterval:{get:function(){return this._times.get(this._currentIntervalIndex)}}});f2.prototype.getFromCache=function(e,t,n,i){let r=$Te(e,t,n),o,s=this._tileCache[this._currentIntervalIndex];if(l(s)&&l(s[r])){let a=s[r];o=a.promise.catch(function(c){throw i.state=a.request.state,c}),delete s[r]}return o};f2.prototype.checkApproachingInterval=function(e,t,n,i){let r=$Te(e,t,n),o=this._tilesRequestedForInterval,s=JTe(this),a={key:r,priorityFunction:i.priorityFunction};(!l(s)||!ZTe(this,a,s))&&o.push(a),o.length>=512&&o.splice(0,256)};f2.prototype._clockOnTick=function(e){let t=e.currentTime,i=this._times.indexOf(t),r=this._currentIntervalIndex;if(i!==r){let s=this._tileCache[r];for(let a in s)s.hasOwnProperty(a)&&s[a].request.cancel();delete this._tileCache[r],this._tilesRequestedForInterval=[],this._currentIntervalIndex=i,this._reloadFunction();return}let o=JTe(this);if(l(o)){let s=this._tilesRequestedForInterval,a=!0;for(;a&&s.length!==0;){let c=s.pop();a=ZTe(this,c,o),a||s.push(c)}}};function $Te(e,t,n){return`${e}-${t}-${n}`}function Slt(e){let t=e.split("-");if(t.length===3)return{x:Number(t[0]),y:Number(t[1]),level:Number(t[2])}}function JTe(e){let t=e._times;if(!l(t))return;let n=e._clock,i=n.currentTime,r=n.canAnimate&&n.shouldAnimate,o=n.multiplier;if(!r&&o!==0)return;let s,a=t.indexOf(i);if(a<0)return;let c=t.get(a);return o>0?(s=K.secondsDifference(c.stop,i),++a):(s=K.secondsDifference(c.start,i),--a),s/=o,a>=0&&s<=5?t.get(a):void 0}function ZTe(e,t,n){let i=e._times.indexOf(n.start),r=e._tileCache,o=r[i];l(o)||(o=r[i]={});let s=t.key;if(l(o[s]))return!0;let a=Slt(s),c=new wo({throttle:!1,throttleByServer:!0,type:Zs.IMAGERY,priorityFunction:t.priorityFunction}),u=e._requestImageFunction(a.x,a.y,a.level,c,n);return l(u)?(o[s]={promise:u,request:c},!0):!1}var zT=f2;var wlt=[3034,3035,3042,3043,3044],Ilt=[4471,4559];function Rm(e){if(e=e??H.EMPTY_OBJECT,l(e.times)&&!l(e.clock))throw new pe("options.times was specified, so options.clock is required.");this._defaultAlpha=void 0,this._defaultNightAlpha=void 0,this._defaultDayAlpha=void 0,this._defaultBrightness=void 0,this._defaultContrast=void 0,this._defaultHue=void 0,this._defaultSaturation=void 0,this._defaultGamma=void 0,this._defaultMinificationFilter=void 0,this._defaultMagnificationFilter=void 0,this._getFeatureInfoUrl=e.getFeatureInfoUrl??e.url;let t=De.createIfNeeded(e.url),n=De.createIfNeeded(this._getFeatureInfoUrl);t.setQueryParameters(Rm.DefaultParameters,!0),n.setQueryParameters(Rm.GetFeatureInfoDefaultParameters,!0),l(e.parameters)&&t.setQueryParameters(QTe(e.parameters)),l(e.getFeatureInfoParameters)&&n.setQueryParameters(QTe(e.getFeatureInfoParameters));let i=this;this._reload=void 0,l(e.times)&&(this._timeDynamicImagery=new zT({clock:e.clock,times:e.times,requestImageFunction:function(s,a,c,u,f){return eEe(i,s,a,c,u,f)},reloadFunction:function(){l(i._reload)&&i._reload()}}));let r={};if(r.layers=e.layers,r.bbox="{westProjected},{southProjected},{eastProjected},{northProjected}",r.width="{width}",r.height="{height}",parseFloat(t.queryParameters.version)>=1.3){r.crs=e.crs??(e.tilingScheme&&e.tilingScheme.projection instanceof yi?"EPSG:3857":"CRS:84");let s=r.crs.split(":");if(s[0]==="EPSG"&&s.length===2){let a=Number(s[1]);(a>=4e3&&a<5e3&&!Ilt.includes(a)||wlt.includes(a))&&(r.bbox="{southProjected},{westProjected},{northProjected},{eastProjected}")}}else r.srs=e.srs??(e.tilingScheme&&e.tilingScheme.projection instanceof yi?"EPSG:3857":"EPSG:4326");t.setQueryParameters(r,!0),n.setQueryParameters(r,!0);let o={query_layers:e.layers,info_format:"{format}"};parseFloat(n.queryParameters.version)>=1.3?(o.i="{i}",o.j="{j}"):(o.x="{i}",o.y="{j}"),n.setQueryParameters(o,!0),this._resource=t,this._pickFeaturesResource=n,this._layers=e.layers,this._tileProvider=new ws({url:t,pickFeaturesUrl:n,tilingScheme:e.tilingScheme??new Qi({ellipsoid:e.ellipsoid}),rectangle:e.rectangle,tileWidth:e.tileWidth,tileHeight:e.tileHeight,minimumLevel:e.minimumLevel,maximumLevel:e.maximumLevel,subdomains:e.subdomains,tileDiscardPolicy:e.tileDiscardPolicy,credit:e.credit,getFeatureInfoFormats:e.getFeatureInfoFormats??Rm.DefaultGetFeatureInfoFormats,enablePickFeatures:e.enablePickFeatures})}function eEe(e,t,n,i,r,o){let s=l(o)?o.data:void 0,a=e._tileProvider;return l(s)&&a._resource.setQueryParameters(s),a.requestImage(t,n,i,r)}function Plt(e,t,n,i,r,o,s){let a=l(s)?s.data:void 0,c=e._tileProvider;return l(a)&&c._pickFeaturesResource.setQueryParameters(a),c.pickFeatures(t,n,i,r,o)}Object.defineProperties(Rm.prototype,{url:{get:function(){return this._resource._url}},proxy:{get:function(){return this._resource.proxy}},layers:{get:function(){return this._layers}},tileWidth:{get:function(){return this._tileProvider.tileWidth}},tileHeight:{get:function(){return this._tileProvider.tileHeight}},maximumLevel:{get:function(){return this._tileProvider.maximumLevel}},minimumLevel:{get:function(){return this._tileProvider.minimumLevel}},tilingScheme:{get:function(){return this._tileProvider.tilingScheme}},rectangle:{get:function(){return this._tileProvider.rectangle}},tileDiscardPolicy:{get:function(){return this._tileProvider.tileDiscardPolicy}},errorEvent:{get:function(){return this._tileProvider.errorEvent}},credit:{get:function(){return this._tileProvider.credit}},hasAlphaChannel:{get:function(){return this._tileProvider.hasAlphaChannel}},enablePickFeatures:{get:function(){return this._tileProvider.enablePickFeatures},set:function(e){this._tileProvider.enablePickFeatures=e}},clock:{get:function(){return this._timeDynamicImagery.clock},set:function(e){this._timeDynamicImagery.clock=e}},times:{get:function(){return this._timeDynamicImagery.times},set:function(e){this._timeDynamicImagery.times=e}},getFeatureInfoUrl:{get:function(){return this._getFeatureInfoUrl}}});Rm.prototype.getTileCredits=function(e,t,n){return this._tileProvider.getTileCredits(e,t,n)};Rm.prototype.requestImage=function(e,t,n,i){let r,o=this._timeDynamicImagery,s;return l(o)&&(s=o.currentInterval,r=o.getFromCache(e,t,n,i)),l(r)||(r=eEe(this,e,t,n,i,s)),l(r)&&l(o)&&o.checkApproachingInterval(e,t,n,i),r};Rm.prototype.pickFeatures=function(e,t,n,i,r){let o=this._timeDynamicImagery,s=l(o)?o.currentInterval:void 0;return Plt(this,e,t,n,i,r,s)};Rm.DefaultParameters=Object.freeze({service:"WMS",version:"1.1.1",request:"GetMap",styles:"",format:"image/jpeg"});Rm.GetFeatureInfoDefaultParameters=Object.freeze({service:"WMS",version:"1.1.1",request:"GetFeatureInfo"});Rm.DefaultGetFeatureInfoFormats=Object.freeze([Object.freeze(new Dm("json","application/json")),Object.freeze(new Dm("xml","text/xml")),Object.freeze(new Dm("text","text/html"))]);function QTe(e){let t={};for(let n in e)e.hasOwnProperty(n)&&(t[n.toLowerCase()]=e[n]);return t}var d2=Rm;function Xf(e){e=e??H.EMPTY_OBJECT,this._defaultAlpha=void 0,this._defaultNightAlpha=void 0,this._defaultDayAlpha=void 0,this._defaultBrightness=void 0,this._defaultContrast=void 0,this._defaultHue=void 0,this._defaultSaturation=void 0,this._defaultGamma=void 0,this._defaultMinificationFilter=void 0,this._defaultMagnificationFilter=void 0,this._getFeatureInfoUrl=e.getFeatureInfoUrl??e.url;let t=De.createIfNeeded(e.url),n=De.createIfNeeded(this._getFeatureInfoUrl),i=e.style,r=e.tileMatrixSetID,o=t.url,s=e.format??"image/jpeg",a=o.match(/{/g);if(!l(a)||a.length===1&&/{s}/.test(o)?(t.setQueryParameters(Xf.DefaultParameters,!0),this._useKvp=!0):(t.setTemplateValues(Xf.DefaultParameters,!0),this._useKvp=!1),this._useKvp){n.setQueryParameters(Xf.GetFeatureInfoDefaultParameters,!0),l(e.getFeatureInfoParameters)&&n.setQueryParameters(tEe(e.getFeatureInfoParameters));let f={infoformat:"{format}",i:"{i}",j:"{j}"};n.setQueryParameters(f,!0)}else n.setTemplateValues(Xf.GetFeatureInfoDefaultParameters,!0),l(e.getFeatureInfoParameters)&&n.setTemplateValues(tEe(e.getFeatureInfoParameters));this._resource=t,this._tileMatrixLabels=e.tileMatrixLabels,this._format=s,this._dimensions=e.dimensions,this._tilematrixset=r;let c={};c.tilematrix="{TileMatrix}",c.layer=e.layer,c.style=i,c.tilerow="{TileRow}",c.tilecol="{TileCol}",c.tilematrixset=r,this._useKvp?(t.setQueryParameters(c,!0),t.setQueryParameters({format:s},!0),n.setQueryParameters({format:s},!0),n.setQueryParameters(c,!0)):(c.Style=i,t.setTemplateValues(c),t.setTemplateValues({format:s}),n.setTemplateValues(c));let u=this;this._reload=void 0,l(e.times)&&(this._timeDynamicImagery=new zT({clock:e.clock,times:e.times,requestImageFunction:function(f,d,p,g,m){return nEe(u,f,d,p,g,m)},reloadFunction:function(){l(u._reload)&&u._reload()}})),this._errorEvent=new be,this._tileProvider=new ws({url:t,pickFeaturesUrl:n,tilingScheme:e.tilingScheme??new Fo({ellipsoid:e.ellipsoid}),rectangle:e.rectangle,tileWidth:e.tileWidth,tileHeight:e.tileHeight,minimumLevel:e.minimumLevel,maximumLevel:e.maximumLevel,subdomains:e.subdomains,tileDiscardPolicy:e.tileDiscardPolicy,credit:e.credit,getFeatureInfoFormats:e.getFeatureInfoFormats??Xf.DefaultGetFeatureInfoFormats,enablePickFeatures:e.enablePickFeatures??(this._useKvp||l(e.getFeatureInfoUrl)),customTags:Rlt(this)})}function nEe(e,t,n,i,r,o){let s=e._tileProvider;return iEe(e,s._resource,o),s.requestImage(t,n,i,r)}function Dlt(e,t,n,i,r,o,s){let a=e._tileProvider;return iEe(e,a._pickFeaturesResource,s),a.pickFeatures(t,n,i,r,o)}Object.defineProperties(Xf.prototype,{url:{get:function(){return this._resource.url}},proxy:{get:function(){return this._resource.proxy}},tileWidth:{get:function(){return this._tileProvider.tileWidth}},tileHeight:{get:function(){return this._tileProvider.tileHeight}},maximumLevel:{get:function(){return this._tileProvider.maximumLevel}},minimumLevel:{get:function(){return this._tileProvider.minimumLevel}},tilingScheme:{get:function(){return this._tileProvider.tilingScheme}},rectangle:{get:function(){return this._tileProvider.rectangle}},tileDiscardPolicy:{get:function(){return this._tileProvider.tileDiscardPolicy}},errorEvent:{get:function(){return this._tileProvider.errorEvent}},format:{get:function(){return this._format}},credit:{get:function(){return this._tileProvider.credit}},hasAlphaChannel:{get:function(){return!0}},enablePickFeatures:{get:function(){return this._tileProvider.enablePickFeatures},set:function(e){this._tileProvider.enablePickFeatures=e}},clock:{get:function(){return this._timeDynamicImagery.clock},set:function(e){this._timeDynamicImagery.clock=e}},times:{get:function(){return this._timeDynamicImagery.times},set:function(e){this._timeDynamicImagery.times=e}},dimensions:{get:function(){return this._dimensions},set:function(e){this._dimensions!==e&&(this._dimensions=e,l(this._reload)&&this._reload())}},getFeatureInfoUrl:{get:function(){return this._getFeatureInfoUrl}}});Xf.prototype.getTileCredits=function(e,t,n){return this._tileProvider.getTileCredits(e,t,n)};Xf.prototype.requestImage=function(e,t,n,i){let r,o=this._timeDynamicImagery,s;return l(o)&&(s=o.currentInterval,r=o.getFromCache(e,t,n,i)),l(r)||(r=nEe(this,e,t,n,i,s)),l(r)&&l(o)&&o.checkApproachingInterval(e,t,n,i),r};Xf.prototype.pickFeatures=function(e,t,n,i,r){let o=this._timeDynamicImagery,s=l(o)?o.currentInterval:void 0;return Dlt(this,e,t,n,i,r,s)};Xf.DefaultParameters=Object.freeze({service:"WMTS",version:"1.0.0",request:"GetTile"});Xf.GetFeatureInfoDefaultParameters=Object.freeze({service:"WMTS",version:"1.0.0",request:"GetFeatureInfo"});Xf.DefaultGetFeatureInfoFormats=Object.freeze([Object.freeze(new Dm("json","application/json")),Object.freeze(new Dm("xml","text/xml")),Object.freeze(new Dm("text","text/html"))]);function iEe(e,t,n){let i=e._dimensions,r=l(n)?n.data:void 0;if(!e._useKvp)l(i)&&t.setTemplateValues(i),l(r)&&t.setTemplateValues(r);else{let o={};l(i)&&(o=Ot(o,i)),l(r)&&(o=Ot(o,r)),t.setQueryParameters(o)}}function Rlt(e){function t(n){let i=e._tileMatrixLabels;return l(i)?i[n]:n.toString()}return{TileMatrix:function(n,i,r,o){return t(o)},tilematrix:function(n,i,r,o){return t(o)},TileRow:function(n,i,r){return r.toString()},tilerow:function(n,i,r){return r.toString()},TileCol:function(n,i,r){return i.toString()},tilecol:function(n,i,r){return i.toString()},TileMatrixSet:function(n){return e._tilematrixset},tilematrixset:function(n){return e._tilematrixset}}}function tEe(e){let t={};for(let n in e)e.hasOwnProperty(n)&&(t[n.toLowerCase()]=e[n]);return t}var h2=Xf;var Cw={};Cw.defaultApiKey=void 0;Cw.mapTilesApiEndpoint=new De({url:"https://tile.googleapis.com/"});Cw.defaultStreetViewStaticApiKey=void 0;Cw.streetViewStaticApiEndpoint=new De({url:"https://maps.googleapis.com/maps/api/streetview"});Cw.getDefaultCredit=function(){return new It('<img alt="Google" src="https://assets.ion.cesium.com/google-credit.png" style="vertical-align:-6px">',!0)};var va=Cw;var rEe=/\/$/;function s_(e){e=e??H.EMPTY_OBJECT,this._maximumLevel=e.maximumLevel??22,this._minimumLevel=e.minimumLevel??0,this._session=e.session,this._key=e.key,this._tileWidth=e.tileWidth,this._tileHeight=e.tileHeight;let t=e.url instanceof Yo?e.url:De.createIfNeeded(e.url??va.mapTilesApiEndpoint),n=t.getUrlComponent();rEe.test(n)||(n+="/");let i=`${n}v1/2dtiles/{z}/{x}/{y}`;this._viewportUrl=`${n}tile/v1/viewport`,t.url=i,t.setQueryParameters({session:encodeURIComponent(e.session),key:encodeURIComponent(e.key)}),this._resource=t.clone();let r;l(e.credit)&&(r=e.credit,typeof r=="string"&&(r=new It(r)));let o=new ws({url:t,credit:r,tileWidth:e.tileWidth,tileHeight:e.tileHeight,ellipsoid:e.ellipsoid,rectangle:e.rectangle,maximumLevel:this._maximumLevel,minimumLevel:this._minimumLevel});o._resource=t,this._imageryProvider=o,this._tileCredits=t.credits,this._attributionsByLevel=void 0}Object.defineProperties(s_.prototype,{url:{get:function(){return this._imageryProvider.url}},rectangle:{get:function(){return this._imageryProvider.rectangle}},tileWidth:{get:function(){return this._imageryProvider.tileWidth}},tileHeight:{get:function(){return this._imageryProvider.tileHeight}},maximumLevel:{get:function(){return this._imageryProvider.maximumLevel}},minimumLevel:{get:function(){return this._imageryProvider.minimumLevel}},tilingScheme:{get:function(){return this._imageryProvider.tilingScheme}},tileDiscardPolicy:{get:function(){return this._imageryProvider.tileDiscardPolicy}},errorEvent:{get:function(){return this._imageryProvider.errorEvent}},credit:{get:function(){return this._imageryProvider.credit}},proxy:{get:function(){return this._imageryProvider.proxy}},hasAlphaChannel:{get:function(){return this._imageryProvider.hasAlphaChannel}}});s_.fromIonAssetId=async function(e){e=e??{},e.mapType=e.mapType??"satellite",e.language=e.language??"en_US",e.region=e.region??"US";let t=e.overlayLayerType,n=oEe(e),i=Yo._createEndpointResource(e.assetId,{queryParameters:{options:JSON.stringify(n)}}),r={language:e.language,region:e.region,ellipsoid:e.ellipsoid,minimumLevel:e.minimumLevel,maximumLevel:e.maximumLevel,rectangle:e.rectangle,credit:e.credit},o=await i.fetchJson(),s=o.options.url;return delete o.options.url,o.options={...o.options,...r},sQ(s,o,i)};s_.fromUrl=async function(e){e=e??{},e.mapType=e.mapType??"satellite",e.language=e.language??"en_US",e.region=e.region??"US",e.url=e.url??va.mapTilesApiEndpoint,e.key=e.key??va.defaultApiKey;let t=e.overlayLayerType,n=await Mlt(e);return new s_({...n,...e,credit:e.credit??va.getDefaultCredit()})};s_.prototype.getTileCredits=function(e,t,n){if(!l(this._attributionsByLevel)||!l(this._tileCredits))return;let r=this._attributionsByLevel.get(n);return l(this._tileCredits)?this._tileCredits.concat(r):r};s_.prototype.requestImage=function(e,t,n,i){let r=this._imageryProvider.requestImage(e,t,n,i);if(l(r))return l(this._attributionsByLevel)?r:Promise.all([r,this.getViewportCredits()]).then(o=>o[0])};s_.prototype.pickFeatures=function(e,t,n,i,r){};s_.prototype.getViewportCredits=async function(){let e=this._maximumLevel,t=[];for(let r=0;r<e+1;r++)t.push(Olt(this._resource,this._viewportUrl,r));let n=await Promise.all(t),i=new Map;for(let r=0;r<e+1;r++){let o=[],s=n[r];if(s){let a=new It(s);o.push(a)}i.set(r,o)}return this._attributionsByLevel=i,i};async function Olt(e,t,n){return(await e.getDerivedResource({url:t,queryParameters:{zoom:n,north:90,south:-90,east:180,west:-180},data:JSON.stringify(H.EMPTY_OBJECT)}).fetchJson()).copyright}function oEe(e){let{mapType:t,overlayLayerType:n,styles:i}=e,r={mapType:t,overlay:!1};return t==="terrain"&&!l(n)&&(r.layerTypes=["layerRoadmap"]),l(n)&&(r.mapType="satellite",r.overlay=!0,r.layerTypes=[n]),l(i)&&(r.styles=i),r}async function Mlt(e){let{language:t,region:n,key:i,url:r}=e,o=oEe(e),s=r.url??r;rEe.test(s)||(s+="/");let a=await De.post({url:`${s}v1/createSession`,queryParameters:{key:i},data:JSON.stringify({...o,language:t,region:n})});return JSON.parse(a)}var m2=s_;var Nlt=/\/$/;function vw(e){e=e??{};let t=e.tilesetId??"microsoft.imagery";this._maximumLevel=e.maximumLevel??22,this._minimumLevel=e.minimumLevel??0,this._subscriptionKey=e.subscriptionKey??e["subscription-key"],this._tilesetId=e.tilesetId;let n=e.url instanceof Yo?e.url:De.createIfNeeded(e.url??"https://atlas.microsoft.com/"),i=n.getUrlComponent();Nlt.test(i)||(i+="/");let r=`${i}map/tile`;this._viewportUrl=`${i}map/attribution`,n.url=r,n.setQueryParameters({"api-version":"2024-04-01",tilesetId:t,"subscription-key":this._subscriptionKey,zoom:"{z}",x:"{x}",y:"{y}"}),this._resource=n;let o;l(e.credit)&&(o=e.credit,typeof o=="string"&&(o=new It(o)));let s=new ws({...e,maximumLevel:this._maximumLevel,minimumLevel:this._minimumLevel,url:n,credit:o});s._resource=n,this._imageryProvider=s,this._tileCredits=n.credits,this._attributionsByLevel=void 0}Object.defineProperties(vw.prototype,{url:{get:function(){return this._imageryProvider.url}},rectangle:{get:function(){return this._imageryProvider.rectangle}},tileWidth:{get:function(){return this._imageryProvider.tileWidth}},tileHeight:{get:function(){return this._imageryProvider.tileHeight}},maximumLevel:{get:function(){return this._imageryProvider.maximumLevel}},minimumLevel:{get:function(){return this._imageryProvider.minimumLevel}},tilingScheme:{get:function(){return this._imageryProvider.tilingScheme}},tileDiscardPolicy:{get:function(){return this._imageryProvider.tileDiscardPolicy}},errorEvent:{get:function(){return this._imageryProvider.errorEvent}},credit:{get:function(){return this._imageryProvider.credit}},proxy:{get:function(){return this._imageryProvider.proxy}},hasAlphaChannel:{get:function(){return this._imageryProvider.hasAlphaChannel}}});vw.prototype.getTileCredits=function(e,t,n){if(!l(this._attributionsByLevel)||!l(this._tileCredits))return;let r=this._attributionsByLevel.get(n);return l(this._tileCredits)?this._tileCredits.concat(r):r};vw.prototype.requestImage=function(e,t,n,i){let r=this._imageryProvider.requestImage(e,t,n,i);if(l(r))return l(this._attributionsByLevel)?r:Promise.all([r,this.getViewportCredits()]).then(o=>o[0])};vw.prototype.pickFeatures=function(e,t,n,i,r){};vw.prototype.getViewportCredits=async function(){let e=this._maximumLevel,t=[];for(let r=0;r<e+1;r++)t.push(Llt(this._resource,this._viewportUrl,this._subscriptionKey,this._tilesetId,r));let n=await Promise.all(t),i=new Map;for(let r=0;r<e+1;r++){let o=[],s=n[r].join(",");if(s){let a=new It(s);o.push(a)}i.set(r,o)}return this._attributionsByLevel=i,i};async function Llt(e,t,n,i,r){return(await e.getDerivedResource({url:t,queryParameters:{zoom:r,bounds:"-180,-90,180,90"},data:JSON.stringify(H.EMPTY_OBJECT)}).fetchJson()).copyrights}var p2=vw;var Flt=async(e,t,n)=>PA.fromUrl(new Yo(t,n)),Blt=async(e,{options:t})=>o_.fromUrl(e,t),klt=async(e,{options:t})=>o2.fromUrl(e,t),Ult=async(e,{options:t})=>{let n=t.channel;return delete t.channel,c2.fromUrl(e,n,t)},zlt=async(e,{options:t})=>new l2({url:e,...t}),Vlt=async(e,{options:t})=>u2.fromUrl(e,t),jlt=async(e,{options:t})=>PA.fromUrl(e,t),Hlt=async(e,{options:t})=>new ws({url:e,...t}),Glt=async(e,{options:t})=>new d2({url:e,...t}),Wlt=async(e,{options:t})=>new h2({url:e,...t}),sQ=async(e,t,n)=>{delete t.externalType,t.url=e;let i=new Yo(t,n),r=(o,s)=>{delete s.externalType,s.url=e;let{options:a}=s;o.setQueryParameters({session:a.session,key:a.key})};return i.refreshCallback=r,new m2({...t.options,url:i})},qlt=async(e,t,n)=>{delete t.externalType,t.url=e;let i=new Yo(t,n),r=(o,s)=>{delete s.externalType,s.url=e;let{options:a}=s;o.setQueryParameters({"subscription-key":a["subscription-key"]})};return i.refreshCallback=r,new p2({...t.options,url:i})},Ylt={ARCGIS_MAPSERVER:Blt,BING:klt,GOOGLE_EARTH:Ult,MAPBOX:zlt,SINGLE_TILE:Vlt,TMS:jlt,URL_TEMPLATE:Hlt,WMS:Glt,WMTS:Wlt,GOOGLE_2D_MAPS:sQ,AZURE_MAPS:qlt,defaultFactoryCallback:Flt},Sw=Object.freeze(Ylt);function i0(){this._defaultAlpha=void 0,this._defaultNightAlpha=void 0,this._defaultDayAlpha=void 0,this._defaultBrightness=void 0,this._defaultContrast=void 0,this._defaultHue=void 0,this._defaultSaturation=void 0,this._defaultGamma=void 0,this._defaultMinificationFilter=void 0,this._defaultMagnificationFilter=void 0,this._tileCredits=void 0,this._errorEvent=new be}Object.defineProperties(i0.prototype,{rectangle:{get:function(){return this._imageryProvider.rectangle}},tileWidth:{get:function(){return this._imageryProvider.tileWidth}},tileHeight:{get:function(){return this._imageryProvider.tileHeight}},maximumLevel:{get:function(){return this._imageryProvider.maximumLevel}},minimumLevel:{get:function(){return this._imageryProvider.minimumLevel}},tilingScheme:{get:function(){return this._imageryProvider.tilingScheme}},tileDiscardPolicy:{get:function(){return this._imageryProvider.tileDiscardPolicy}},errorEvent:{get:function(){return this._errorEvent}},credit:{get:function(){return this._imageryProvider.credit}},hasAlphaChannel:{get:function(){return this._imageryProvider.hasAlphaChannel}},proxy:{get:function(){}}});i0.fromAssetId=async function(e,t){t=t??H.EMPTY_OBJECT;let n=Yo._createEndpointResource(e,t),i=e.toString()+t.accessToken+t.server,r=i0._endpointCache[i];l(r)||(r=n.fetchJson(),i0._endpointCache[i]=r);let o=await r;if(o.type!=="IMAGERY")throw new oe(`Cesium ion asset ${e} is not an imagery asset.`);let s=o.externalType,a=Sw.defaultFactoryCallback;o=Je(o,!0),o.options=o.options??{};let c=o.options?.url;if(delete t.url,l(s)&&(a=Sw[s],!l(a)))throw new oe(`Unrecognized Cesium ion imagery type: ${s}`);let u=await a(c,o,n),f=new i0(t);return u.errorEvent.addEventListener(function(d){d.provider=f,f._errorEvent.raiseEvent(d)}),f._tileCredits=Yo.getCreditsFromEndpoint(o,n),f._imageryProvider=u,f};i0.prototype.getTileCredits=function(e,t,n){let i=this._imageryProvider.getTileCredits(e,t,n);return l(i)?this._tileCredits.concat(i):this._tileCredits};i0.prototype.requestImage=function(e,t,n,i){return this._imageryProvider.requestImage(e,t,n,i)};i0.prototype.pickFeatures=function(e,t,n,i,r){return this._imageryProvider.pickFeatures(e,t,n,i,r)};i0._endpointCache={};var lu=i0;var sEe={AERIAL:2,AERIAL_WITH_LABELS:3,ROAD:4};Object.freeze(sEe);var a_=sEe;function Xlt(e){e=e??H.EMPTY_OBJECT;let t=e.style??a_.AERIAL;return lu.fromAssetId(t)}var c_=Xlt;function Gs(){pe.throwInstantiationError()}Object.defineProperties(Gs.prototype,{errorEvent:{get:pe.throwInstantiationError},credit:{get:pe.throwInstantiationError},tilingScheme:{get:pe.throwInstantiationError},hasWaterMask:{get:pe.throwInstantiationError},hasVertexNormals:{get:pe.throwInstantiationError},availability:{get:pe.throwInstantiationError}});var aEe=[];Gs.getRegularGridIndices=function(e,t){let n=aEe[e];l(n)||(aEe[e]=n=[]);let i=n[t];return l(i)||(e*t<D.SIXTY_FOUR_KILOBYTES?i=n[t]=new Uint16Array((e-1)*(t-1)*6):i=n[t]=new Uint32Array((e-1)*(t-1)*6),fEe(e,t,i,0)),i};var cEe=[];Gs.getRegularGridIndicesAndEdgeIndices=function(e,t){let n=cEe[e];l(n)||(cEe[e]=n=[]);let i=n[t];if(!l(i)){let r=Gs.getRegularGridIndices(e,t),o=uEe(e,t),s=o.westIndicesSouthToNorth,a=o.southIndicesEastToWest,c=o.eastIndicesNorthToSouth,u=o.northIndicesWestToEast;i=n[t]={indices:r,westIndicesSouthToNorth:s,southIndicesEastToWest:a,eastIndicesNorthToSouth:c,northIndicesWestToEast:u}}return i};var lEe=[];Gs.getRegularGridAndSkirtIndicesAndEdgeIndices=function(e,t){let n=lEe[e];l(n)||(lEe[e]=n=[]);let i=n[t];if(!l(i)){let r=e*t,o=(e-1)*(t-1)*6,s=e*2+t*2,a=Math.max(0,s-4)*6,c=r+s,u=o+a,f=uEe(e,t),d=f.westIndicesSouthToNorth,p=f.southIndicesEastToWest,g=f.eastIndicesNorthToSouth,m=f.northIndicesWestToEast,y=je.createTypedArray(c,u);fEe(e,t,y,0),Gs.addSkirtIndices(d,p,g,m,r,y,o),i=n[t]={indices:y,westIndicesSouthToNorth:d,southIndicesEastToWest:p,eastIndicesNorthToSouth:g,northIndicesWestToEast:m,indexCountWithoutSkirts:o}}return i};Gs.getSkirtVertexCount=function(e,t,n,i){return e.length+t.length+n.length+i.length};Gs.getSkirtIndexCount=function(e){return(e-4)*2*3};Gs.getSkirtIndexCountWithFilledCorners=function(e){return((e-4)*2+4)*3};Gs.addSkirtIndices=function(e,t,n,i,r,o,s){let a=r;s=rG(e,a,o,s),a+=e.length,s=rG(t,a,o,s),a+=t.length,s=rG(n,a,o,s),a+=n.length,rG(i,a,o,s)};Gs.addSkirtIndicesWithFilledCorners=function(e,t,n,i,r,o,s){Gs.addSkirtIndices(e,t,n,i,r,o,s);let a=Gs.getSkirtVertexCount(e,t,n,i),c=Gs.getSkirtIndexCount(a),u=s+c,f=e[0],d=i[0],p=n[0],g=t[0],m=r,y=m+e.length-1,A=y+1,b=A+t.length-1,x=b+1,T=x+n.length-1,E=T+1,v=E+i.length-1;o[u+0]=f,o[u+1]=m,o[u+2]=b,o[u+3]=g,o[u+4]=A,o[u+5]=T,o[u+6]=p,o[u+7]=x,o[u+8]=v,o[u+9]=d,o[u+10]=E,o[u+11]=y};function uEe(e,t){let n=new Array(t),i=new Array(e),r=new Array(t),o=new Array(e),s;for(s=0;s<e;++s)o[s]=s,i[s]=e*t-1-s;for(s=0;s<t;++s)r[s]=(s+1)*e-1,n[s]=(t-s-1)*e;return{westIndicesSouthToNorth:n,southIndicesEastToWest:i,eastIndicesNorthToSouth:r,northIndicesWestToEast:o}}function fEe(e,t,n,i){let r=0;for(let o=0;o<t-1;++o){for(let s=0;s<e-1;++s){let a=r,c=a+e,u=c+1,f=a+1;n[i++]=a,n[i++]=c,n[i++]=f,n[i++]=f,n[i++]=c,n[i++]=u,++r}++r}}function rG(e,t,n,i){let r=e[0],o=e.length;for(let s=1;s<o;++s){let a=e[s];n[i++]=r,n[i++]=a,n[i++]=t,n[i++]=t,n[i++]=a,n[i++]=t+1,r=a,++t}return i}Gs.heightmapTerrainQuality=.25;Gs.getEstimatedLevelZeroGeometricErrorForAHeightmap=function(e,t,n){return e.maximumRadius*2*Math.PI*Gs.heightmapTerrainQuality/(t*n)};Gs.prototype.requestTileGeometry=pe.throwInstantiationError;Gs.prototype.getLevelMaximumGeometricError=pe.throwInstantiationError;Gs.prototype.getTileDataAvailable=pe.throwInstantiationError;Gs.prototype.loadTileDataAvailability=pe.throwInstantiationError;var Xr=Gs;var dEe={UNLOADED:0,TRANSITIONING:1,RECEIVED:2,TEXTURE_LOADED:3,READY:4,FAILED:5,INVALID:6,PLACEHOLDER:7};Object.freeze(dEe);var Vn=dEe;function ww(e,t,n,i,r){if(this.imageryLayer=e,this.x=t,this.y=n,this.level=i,this.request=void 0,i!==0){let o=t/2|0,s=n/2|0,a=i-1;this.parent=e.getImageryFromCache(o,s,a)}this.state=Vn.UNLOADED,this.imageUrl=void 0,this.image=void 0,this.texture=void 0,this.textureWebMercator=void 0,this.credits=void 0,this.referenceCount=0,!l(r)&&e.ready&&(r=e.imageryProvider.tilingScheme.tileXYToRectangle(t,n,i)),this.rectangle=r}ww.createPlaceholder=function(e){let t=new ww(e,0,0,0);return t.addReference(),t.state=Vn.PLACEHOLDER,t};ww.prototype.addReference=function(){++this.referenceCount};ww.prototype.releaseReference=function(){return--this.referenceCount,this.referenceCount===0?(this.imageryLayer.removeImageryFromCache(this),l(this.parent)&&this.parent.releaseReference(),l(this.image)&&l(this.image.destroy)&&this.image.destroy(),l(this.texture)&&this.texture.destroy(),l(this.textureWebMercator)&&this.texture!==this.textureWebMercator&&this.textureWebMercator.destroy(),le(this),0):this.referenceCount};ww.prototype.processStateMachine=function(e,t,n){this.state===Vn.UNLOADED&&!n&&(this.state=Vn.TRANSITIONING,this.imageryLayer._requestImagery(this)),this.state===Vn.RECEIVED&&(this.state=Vn.TRANSITIONING,this.imageryLayer._createTexture(e.context,this));let i=this.state===Vn.READY&&t&&!this.texture;(this.state===Vn.TEXTURE_LOADED||i)&&(this.state=Vn.TRANSITIONING,this.imageryLayer._reprojectTexture(e,this,t))};var Iw=ww;function aQ(e,t,n){this.readyImagery=void 0,this.loadingImagery=e,this.textureCoordinateRectangle=t,this.textureTranslationAndScale=void 0,this.useWebMercatorT=n}aQ.prototype.freeResources=function(){l(this.readyImagery)&&this.readyImagery.releaseReference(),l(this.loadingImagery)&&this.loadingImagery.releaseReference()};aQ.prototype.processStateMachine=function(e,t,n){let i=this.loadingImagery,r=i.imageryLayer;if(i.processStateMachine(t,!this.useWebMercatorT,n),i.state===Vn.READY)return l(this.readyImagery)&&this.readyImagery.releaseReference(),this.readyImagery=this.loadingImagery,this.loadingImagery=void 0,this.textureTranslationAndScale=r._calculateTextureTranslationAndScale(e,this),!0;let o=i.parent,s;for(;l(o)&&(o.state!==Vn.READY||!this.useWebMercatorT&&!l(o.texture));)o.state!==Vn.FAILED&&o.state!==Vn.INVALID&&(s=s||o),o=o.parent;return this.readyImagery!==o&&(l(this.readyImagery)&&this.readyImagery.releaseReference(),this.readyImagery=o,l(o)&&(o.addReference(),this.textureTranslationAndScale=r._calculateTextureTranslationAndScale(e,this))),i.state===Vn.FAILED||i.state===Vn.INVALID?l(s)?(s.processStateMachine(t,!this.useWebMercatorT,n),!1):!0:!1};var Pw=aQ;function Gi(e,t){this._imageryProvider=e,this._readyEvent=new be,this._errorEvent=new be,t=t??H.EMPTY_OBJECT,e=e??H.EMPTY_OBJECT,this.alpha=t.alpha??e._defaultAlpha??1,this.nightAlpha=t.nightAlpha??e._defaultNightAlpha??1,this.dayAlpha=t.dayAlpha??e._defaultDayAlpha??1,this.brightness=t.brightness??e._defaultBrightness??Gi.DEFAULT_BRIGHTNESS,this.contrast=t.contrast??e._defaultContrast??Gi.DEFAULT_CONTRAST,this.hue=t.hue??e._defaultHue??Gi.DEFAULT_HUE,this.saturation=t.saturation??e._defaultSaturation??Gi.DEFAULT_SATURATION,this.gamma=t.gamma??e._defaultGamma??Gi.DEFAULT_GAMMA,this.splitDirection=t.splitDirection??Gi.DEFAULT_SPLIT,this.minificationFilter=t.minificationFilter??e._defaultMinificationFilter??Gi.DEFAULT_MINIFICATION_FILTER,this.magnificationFilter=t.magnificationFilter??e._defaultMagnificationFilter??Gi.DEFAULT_MAGNIFICATION_FILTER,this.show=t.show??!0,this._minimumTerrainLevel=t.minimumTerrainLevel,this._maximumTerrainLevel=t.maximumTerrainLevel,this._rectangle=t.rectangle??ie.MAX_VALUE,this._maximumAnisotropy=t.maximumAnisotropy,this._imageryCache={},this._skeletonPlaceholder=new Pw(Iw.createPlaceholder(this)),this._show=!0,this._layerIndex=-1,this._isBaseLayer=!1,this._requestImageError=void 0,this._reprojectComputeCommands=[],this.cutoutRectangle=t.cutoutRectangle,this.colorToAlpha=t.colorToAlpha,this.colorToAlphaThreshold=t.colorToAlphaThreshold??Gi.DEFAULT_APPLY_COLOR_TO_ALPHA_THRESHOLD}Object.defineProperties(Gi.prototype,{imageryProvider:{get:function(){return this._imageryProvider}},ready:{get:function(){return l(this._imageryProvider)}},errorEvent:{get:function(){return this._errorEvent}},readyEvent:{get:function(){return this._readyEvent}},rectangle:{get:function(){return this._rectangle}}});Gi.DEFAULT_BRIGHTNESS=1;Gi.DEFAULT_CONTRAST=1;Gi.DEFAULT_HUE=0;Gi.DEFAULT_SATURATION=1;Gi.DEFAULT_GAMMA=1;Gi.DEFAULT_SPLIT=Ho.NONE;Gi.DEFAULT_MINIFICATION_FILTER=Wt.LINEAR;Gi.DEFAULT_MAGNIFICATION_FILTER=Jn.LINEAR;Gi.DEFAULT_APPLY_COLOR_TO_ALPHA_THRESHOLD=.004;Gi.fromProviderAsync=function(e,t){let n=new Gi(void 0,t);return Qlt(n,Promise.resolve(e)),n};Gi.fromWorldImagery=function(e){return e=e??H.EMPTY_OBJECT,Gi.fromProviderAsync(c_({style:e.style}),e)};Gi.prototype.isBaseLayer=function(){return this._isBaseLayer};Gi.prototype.isDestroyed=function(){return!1};Gi.prototype.destroy=function(){return le(this)};var pEe=new ie,hEe=new ie,cQ=new ie,gEe=new ie;Gi.prototype.getImageryRectangle=function(){let e=this._imageryProvider,t=this._rectangle;return ie.intersection(e.rectangle,t)};Gi.prototype._createTileImagerySkeletons=function(e,t,n){let i=e.data;if(!l(t)||l(this._minimumTerrainLevel)&&e.level<this._minimumTerrainLevel||l(this._maximumTerrainLevel)&&e.level>this._maximumTerrainLevel)return!1;l(n)||(n=i.imagery.length);let r=this._imageryProvider;if(!this.ready)return this._skeletonPlaceholder.loadingImagery.addReference(),i.imagery.splice(n,0,this._skeletonPlaceholder),!0;let o=r.tilingScheme.projection instanceof yi&&e.rectangle.north<yi.MaximumLatitude&&e.rectangle.south>-yi.MaximumLatitude,s=ie.intersection(r.rectangle,this._rectangle,pEe),a=ie.intersection(e.rectangle,s,hEe);if(!l(a)){if(!this.isBaseLayer())return!1;let w=s,P=e.rectangle;a=hEe,P.south>=w.north?a.north=a.south=w.north:P.north<=w.south?a.north=a.south=w.south:(a.south=Math.max(P.south,w.south),a.north=Math.min(P.north,w.north)),P.west>=w.east?a.west=a.east=w.east:P.east<=w.west?a.west=a.east=w.west:(a.west=Math.max(P.west,w.west),a.east=Math.min(P.east,w.east))}let c=0;a.south>0?c=a.south:a.north<0&&(c=a.north);let f=1*t.getLevelMaximumGeometricError(e.level),d=Jlt(this,f,c);d=Math.max(0,d);let p=r.maximumLevel;if(d>p&&(d=p),l(r.minimumLevel)){let w=r.minimumLevel;d<w&&(d=w)}let g=r.tilingScheme,m=g.positionToTileXY(ie.northwest(a),d),y=g.positionToTileXY(ie.southeast(a),d),A=e.rectangle.width/512,b=e.rectangle.height/512,x=g.tileXYToRectangle(m.x,m.y,d);Math.abs(x.south-e.rectangle.north)<b&&m.y<y.y&&++m.y,Math.abs(x.east-e.rectangle.west)<A&&m.x<y.x&&++m.x;let T=g.tileXYToRectangle(y.x,y.y,d);Math.abs(T.north-e.rectangle.south)<b&&y.y>m.y&&--y.y,Math.abs(T.west-e.rectangle.east)<A&&y.x>m.x&&--y.x;let E=ie.clone(e.rectangle,gEe),v=g.tileXYToRectangle(m.x,m.y,d),S=ie.intersection(v,s,cQ),I;o?(g.rectangleToNativeRectangle(E,E),g.rectangleToNativeRectangle(v,v),g.rectangleToNativeRectangle(S,S),g.rectangleToNativeRectangle(s,s),I=g.tileXYToNativeRectangle.bind(g),A=E.width/512,b=E.height/512):I=g.tileXYToRectangle.bind(g);let R,O=0,L=1,_;!this.isBaseLayer()&&Math.abs(S.west-E.west)>=A&&(O=Math.min(1,(S.west-E.west)/E.width)),!this.isBaseLayer()&&Math.abs(S.north-E.north)>=b&&(L=Math.max(0,(S.north-E.south)/E.height));let C=L;for(let w=m.x;w<=y.x;w++)if(R=O,v=I(w,m.y,d),S=ie.simpleIntersection(v,s,cQ),!!l(S)){O=Math.min(1,(S.east-E.west)/E.width),w===y.x&&(this.isBaseLayer()||Math.abs(S.east-E.east)<A)&&(O=1),L=C;for(let P=m.y;P<=y.y;P++){if(_=L,v=I(w,P,d),S=ie.simpleIntersection(v,s,cQ),!l(S))continue;L=Math.max(0,(S.south-E.south)/E.height),P===y.y&&(this.isBaseLayer()||Math.abs(S.south-E.south)<b)&&(L=0);let M=new se(R,L,O,_),F=this.getImageryFromCache(w,P,d);i.imagery.splice(n,0,new Pw(F,M,o)),++n}}return!0};Gi.prototype._calculateTextureTranslationAndScale=function(e,t){let n=t.readyImagery.rectangle,i=e.rectangle;if(t.useWebMercatorT){let c=t.readyImagery.imageryLayer.imageryProvider.tilingScheme;n=c.rectangleToNativeRectangle(n,pEe),i=c.rectangleToNativeRectangle(i,gEe)}let r=i.width,o=i.height,s=r/n.width,a=o/n.height;return new se(s*(i.west-n.west)/r,a*(i.south-n.south)/o,s,a)};Gi.prototype._requestImagery=function(e){let t=this._imageryProvider,n=this;function i(s){if(!l(s))return r();e.image=s,e.state=Vn.RECEIVED,e.request=void 0,Zr.reportSuccess(n._requestImageError)}function r(s){if(e.request.state===Ti.CANCELLED){e.state=Vn.UNLOADED,e.request=void 0;return}e.state=Vn.FAILED,e.request=void 0;let a=`Failed to obtain image tile X: ${e.x} Y: ${e.y} Level: ${e.level}.`;n._requestImageError=Zr.reportError(n._requestImageError,t,t.errorEvent,a,e.x,e.y,e.level,s),n._requestImageError.retry&&o()}function o(){let s=new wo({throttle:!1,throttleByServer:!0,type:Zs.IMAGERY});e.request=s,e.state=Vn.TRANSITIONING;let a=t.requestImage(e.x,e.y,e.level,s);if(!l(a)){e.state=Vn.UNLOADED,e.request=void 0;return}l(t.getTileCredits)&&(e.credits=t.getTileCredits(e.x,e.y,e.level)),a.then(function(c){i(c)}).catch(function(c){r(c)})}o()};Gi.prototype._createTextureWebGL=function(e,t){let n=new jt({minificationFilter:this.minificationFilter,magnificationFilter:this.magnificationFilter}),i=t.image;return l(i.internalFormat)?new Dt({context:e,pixelFormat:i.internalFormat,width:i.width,height:i.height,source:{arrayBufferView:i.bufferView},sampler:n}):new Dt({context:e,source:i,pixelFormat:this._imageryProvider.hasAlphaChannel?Ke.RGBA:Ke.RGB,sampler:n})};Gi.prototype._createTexture=function(e,t){let n=this._imageryProvider,i=t.image;if(l(n.tileDiscardPolicy)){let o=n.tileDiscardPolicy;if(l(o)){if(!o.isReady()){t.state=Vn.RECEIVED;return}if(o.shouldDiscardImage(i)){t.state=Vn.INVALID;return}}}let r=this._createTextureWebGL(e,t);n.tilingScheme.projection instanceof yi?t.textureWebMercator=r:t.texture=r,t.image=void 0,t.state=Vn.TEXTURE_LOADED};function mEe(e,t,n){return`${e}:${t}:${n}`}Gi.prototype._finalizeReprojectTexture=function(e,t){let n=this.minificationFilter,i=this.magnificationFilter;if(n===Wt.LINEAR&&i===Jn.LINEAR&&!Ke.isCompressedFormat(t.pixelFormat)&&D.isPowerOfTwo(t.width)&&D.isPowerOfTwo(t.height)){n=Wt.LINEAR_MIPMAP_LINEAR;let o=kt.maximumTextureFilterAnisotropy,s=Math.min(o,this._maximumAnisotropy??o),a=mEe(n,i,s),c=e.cache.imageryLayerMipmapSamplers;l(c)||(c={},e.cache.imageryLayerMipmapSamplers=c);let u=c[a];l(u)||(u=c[a]=new jt({wrapS:hn.CLAMP_TO_EDGE,wrapT:hn.CLAMP_TO_EDGE,minificationFilter:n,magnificationFilter:i,maximumAnisotropy:s})),t.generateMipmap(Id.NICEST),t.sampler=u}else{let o=mEe(n,i,0),s=e.cache.imageryLayerNonMipmapSamplers;l(s)||(s={},e.cache.imageryLayerNonMipmapSamplers=s);let a=s[o];l(a)||(a=s[o]=new jt({wrapS:hn.CLAMP_TO_EDGE,wrapT:hn.CLAMP_TO_EDGE,minificationFilter:n,magnificationFilter:i})),t.sampler=a}};Gi.prototype._reprojectTexture=function(e,t,n){let i=t.textureWebMercator||t.texture,r=t.rectangle,o=e.context;if(n=n??!0,n&&!(this._imageryProvider.tilingScheme.projection instanceof Ui)&&r.width/i.width>1e-5){let s=this;t.addReference();let a=new xf({persists:!0,owner:this,preExecute:function(c){$lt(c,o,i,t.rectangle)},postExecute:function(c){t.texture=c,s._finalizeReprojectTexture(o,c),t.state=Vn.READY,t.releaseReference()},canceled:function(){t.state=Vn.TEXTURE_LOADED,t.releaseReference()}});this._reprojectComputeCommands.push(a)}else n&&(t.texture=i),this._finalizeReprojectTexture(o,i),t.state=Vn.READY};Gi.prototype.queueReprojectionCommands=function(e){let t=this._reprojectComputeCommands,n=t.length;for(let i=0;i<n;++i)e.commandList.push(t[i]);t.length=0};Gi.prototype.cancelReprojections=function(){this._reprojectComputeCommands.forEach(function(e){l(e.canceled)&&e.canceled()}),this._reprojectComputeCommands.length=0};Gi.prototype.getImageryFromCache=function(e,t,n,i){let r=_Ee(e,t,n),o=this._imageryCache[r];return l(o)||(o=new Iw(this,e,t,n,i),this._imageryCache[r]=o),o.addReference(),o};Gi.prototype.removeImageryFromCache=function(e){let t=_Ee(e.x,e.y,e.level);delete this._imageryCache[t]};function _Ee(e,t,n){return JSON.stringify([e,t,n])}var oG={u_textureDimensions:function(){return this.textureDimensions},u_texture:function(){return this.texture},textureDimensions:new U,texture:void 0},Klt=dn.supportsTypedArrays()?new Float32Array(128):void 0;function $lt(e,t,n,i){let r=t.cache.imageryLayer_reproject;if(!l(r)){r=t.cache.imageryLayer_reproject={vertexArray:void 0,shaderProgram:void 0,sampler:void 0,destroy:function(){l(this.framebuffer)&&this.framebuffer.destroy(),l(this.vertexArray)&&this.vertexArray.destroy(),l(this.shaderProgram)&&this.shaderProgram.destroy()}};let A=new Float32Array(256),b=0;for(let S=0;S<64;++S){let I=S/63;A[b++]=0,A[b++]=I,A[b++]=1,A[b++]=I}let x={position:0,webMercatorT:1},T=Xr.getRegularGridIndices(2,64),E=tt.createIndexBuffer({context:t,typedArray:T,usage:Me.STATIC_DRAW,indexDatatype:je.UNSIGNED_SHORT});r.vertexArray=new zn({context:t,attributes:[{index:x.position,vertexBuffer:tt.createVertexBuffer({context:t,typedArray:A,usage:Me.STATIC_DRAW}),componentsPerAttribute:2},{index:x.webMercatorT,vertexBuffer:tt.createVertexBuffer({context:t,sizeInBytes:512,usage:Me.STREAM_DRAW}),componentsPerAttribute:1}],indexBuffer:E});let v=new Ye({sources:[_M]});r.shaderProgram=Qt.fromCache({context:t,vertexShaderSource:v,fragmentShaderSource:gM,attributeLocations:x}),r.sampler=new jt({wrapS:hn.CLAMP_TO_EDGE,wrapT:hn.CLAMP_TO_EDGE,minificationFilter:Wt.LINEAR,magnificationFilter:Jn.LINEAR})}n.sampler=r.sampler;let o=n.width,s=n.height;oG.textureDimensions.x=o,oG.textureDimensions.y=s,oG.texture=n;let a=Math.sin(i.south),c=.5*Math.log((1+a)/(1-a));a=Math.sin(i.north);let f=1/(.5*Math.log((1+a)/(1-a))-c),d=new Dt({context:t,width:o,height:s,pixelFormat:n.pixelFormat,pixelDatatype:n.pixelDatatype,preMultiplyAlpha:n.preMultiplyAlpha});D.isPowerOfTwo(o)&&D.isPowerOfTwo(s)&&d.generateMipmap(Id.NICEST);let p=i.south,g=i.north,m=Klt,y=0;for(let A=0;A<64;++A){let b=A/63,x=D.lerp(p,g,b);a=Math.sin(x);let E=(.5*Math.log((1+a)/(1-a))-c)*f;m[y++]=E,m[y++]=E}r.vertexArray.getAttribute(1).vertexBuffer.copyFromArrayView(m),e.shaderProgram=r.shaderProgram,e.outputTexture=d,e.uniformMap=oG,e.vertexArray=r.vertexArray}function Jlt(e,t,n){let i=e._imageryProvider,r=i.tilingScheme,o=r.ellipsoid,s=e._imageryProvider.tilingScheme.projection instanceof Ui?1:Math.cos(n),a=r.rectangle,u=o.maximumRadius*a.width*s/(i.tileWidth*r.getNumberOfXTilesAtLevel(0))/t,f=Math.log(u)/Math.log(2);return Math.round(f)|0}function Zlt(e,t){e.numberOfListeners>0?e.raiseEvent(t):console.error(t)}async function Qlt(e,t){let n;try{if(n=await Promise.resolve(t),e.isDestroyed())return;e._imageryProvider=n,e._readyEvent.raiseEvent(n)}catch(i){Zlt(e._errorEvent,i)}}var Is=Gi;var lQ=class{constructor(){this.alpha=!1,this.brightness=!1,this.contrast=!1,this.hue=!1,this.saturation=!1,this.gamma=!1,this.colorToAlpha=!1}},g2=lQ;var uQ=class{constructor(t,n,i,r){this._minX=t??0,this._minY=n??0,this._maxX=i??0,this._maxY=r??0}get minX(){return this._minX}set minX(t){this._minX=t}get minY(){return this._minY}set minY(t){this._minY=t}get maxX(){return this._maxX}set maxX(t){this._maxX=t}get maxY(){return this._maxY}set maxY(t){this._maxY=t}contains(t,n){return t>=this.minX&&t<this.maxX&&n>=this.minY&&n<this.maxY}containsExclusive(t,n){return t>this.minX&&t<this.maxX&&n>this.minY&&n<this.maxY}containsInclusive(t,n){return t>=this.minX&&t<=this.maxX&&n>=this.minY&&n<=this.maxY}},Dw=uQ;var eut=new ie,yEe=new ie,tut=new ie,nut=new ie,iut=new ie,rut=new ie,fQ=class e{constructor(t,n,i,r,o){this._x=t,this._y=n,this._level=i,this._textureCoordinateRectangle=r,this._imagery=o}get x(){return this._x}get y(){return this._y}get level(){return this._level}get textureCoordinateRectangle(){return this._textureCoordinateRectangle}get imagery(){return this._imagery}static createImageryCoverages(t,n,i){if(!n.show)return[];let r=n.imageryProvider,o=e._clampImageryLevel(r,i),s=ie.intersection(r.rectangle,n.rectangle,eut),a=r.tilingScheme,c=e._computeImageryRange(t,s,a,o),u=nut;a.rectangleToNativeRectangle(t,u);let f=iut;a.rectangleToNativeRectangle(s,f);let d=(g,m,y)=>{let A=a.tileXYToRectangle(g,m,y),b=ie.intersection(A,s,tut);if(!l(b))return;let x=rut;return a.rectangleToNativeRectangle(b,x),x};return e._computeImageryCoverages(n,c,o,u,d)}static _clampImageryLevel(t,n){let i=t.minimumLevel??0,r=t.maximumLevel??Number.POSITIVE_INFINITY,o=Math.min(r-1,Math.max(i,n));return Math.floor(o)}static _computeImageryRange(t,n,i,r){let o=e._computeOverlappedRectangle(t,n),s=i.positionToTileXY(ie.northwest(o),r),a=i.positionToTileXY(ie.southeast(o),r),c=new Dw;c.minX=s.x,c.minY=s.y,c.maxX=a.x,c.maxY=a.y;let u=t.width/512,f=t.height/512,d=i.tileXYToRectangle(c.minX,c.minY,r);Math.abs(d.south-t.north)<f&&c.minY<c.maxY&&++c.minY,Math.abs(d.east-t.west)<u&&c.minX<c.maxX&&++c.minX;let m=i.tileXYToRectangle(c.maxX,c.maxY,r);return Math.abs(m.north-t.south)<f&&c.maxY>c.minY&&--c.maxY,Math.abs(m.west-t.east)<u&&c.maxX>c.minX&&--c.maxX,c}static _clampRectangle(t,n,i){return l(i)||(i=new ie),t.south>=n.north?i.north=i.south=n.north:t.north<=n.south?i.north=i.south=n.south:(i.south=Math.max(t.south,n.south),i.north=Math.min(t.north,n.north)),t.west>=n.east?i.west=i.east=n.east:t.east<=n.west?i.west=i.east=n.west:(i.west=Math.max(t.west,n.west),i.east=Math.min(t.east,n.east)),i}static _computeOverlappedRectangle(t,n){let i=ie.intersection(t,n,yEe);return l(i)?i:e._clampRectangle(t,n,yEe)}static _computeImageryCoverages(t,n,i,r,o){let s=[];for(let a=n.minX;a<=n.maxX;a++){let c=o(a,n.maxY,i);if(l(c))for(let u=n.minY;u<=n.maxY;u++){let f=o(a,u,i);if(!l(f))continue;let d=e._localizeToCartesianRectangle(f,r,void 0),p=t.getImageryFromCache(a,u,i),g=new e(a,u,i,d,p);s.push(g)}}return s}static _localizeToCartesianRectangle(t,n,i){l(i)||(i=new Dw);let r=1/n.width,o=1/n.height;return i.minX=(t.west-n.west)*r,i.minY=(t.south-n.south)*o,i.maxX=(t.east-n.west)*r,i.maxY=(t.north-n.south)*o,i}},Rw=fQ;var dQ=class e{static createTextureCoordinatesForMappedPositions(t,n){let i=t.cartographicPositions,r=t.cartographicBoundingRectangle,o=t.numPositions;return e._createTextureCoordinates(i,o,r,n)}static _createTextureCoordinates(t,n,i,r){let o=new et;et.fromRectangle(i,r,o);let s=e.createProjectedPositions(t,r),a=e.computeTexCoords(s,o);return e.createTypedArrayFromCartesians2(n,a)}static createTextureCoordinatesAttributeForMappedPositions(t,n){let i=e.createTextureCoordinatesForMappedPositions(t,n);return e.createTexCoordAttribute(i)}static createCartographicPositions(t,n,i){let r=Ea.readAttributeAsTypedArray(t),o=t.type,s=Vt.getNumberOfComponents(o),a=e.createIterableCartesian3FromTypedArray(r,s),c=e.transformCartesians3(a,n);return e.transformToCartographic(c,i)}static createIterableCartesian3FromTypedArray(t,n){let i=new h,r=t.length/n;return{[Symbol.iterator]:function*(){for(let s=0;s<r;s++)i.x=t[s*n+0],i.y=t[s*n+1],i.z=t[s*n+2],yield i}}}static map(t,n){return{[Symbol.iterator]:function*(){for(let r of t)yield n(r)}}}static computeCartographicBoundingRectangle(t,n){l(n)||(n=new ie);let i=Number.NEGATIVE_INFINITY,r=Number.POSITIVE_INFINITY,o=Number.NEGATIVE_INFINITY,s=Number.POSITIVE_INFINITY;for(let a of t)i=Math.max(i,a.latitude),r=Math.min(r,a.latitude),o=Math.max(o,a.longitude),s=Math.min(s,a.longitude);return n.north=i,n.south=r,n.east=o,n.west=s,n}static transformCartesians3(t,n){let i=new h;return e.map(t,o=>(N.multiplyByPoint(n,o,i),i))}static transformToCartographic(t,n){let i=new he;return e.map(t,o=>(n.cartesianToCartographic(o,i),i))}static createProjectedPositions(t,n){let i=new h;return e.map(t,o=>(n.project(o,i),i))}static computeTexCoords(t,n){let i=new U,r=1/n.width,o=1/n.height;return e.map(t,a=>{let c=(a.x-n.x)*r,u=(a.y-n.y)*o,f=Math.min(Math.max(c,0),1),d=Math.min(Math.max(u,0),1);return i.x=f,i.y=d,i})}static createTypedArrayFromCartesians2(t,n){let i=new Float32Array(t*2),r=0;for(let o of n)i[r*2+0]=o.x,i[r*2+1]=o.y,r++;return i}static createTexCoordAttribute(t){return{name:"Imagery Texture Coordinates",semantic:ct.TEXCOORD,setIndex:0,componentDatatype:Y.FLOAT,type:Vt.VEC2,normalized:!1,count:t.length/2,min:void 0,max:void 0,constant:new U(0,0),quantization:void 0,typedArray:t,byteOffset:0,byteStride:void 0}}},VT=dQ;var hQ=class{constructor(t,n,i,r){this._cartographicPositions=t,this._numPositions=n,this._cartographicBoundingRectangle=i,this._ellipsoid=r}get cartographicPositions(){return this._cartographicPositions}get numPositions(){return this._numPositions}get cartographicBoundingRectangle(){return this._cartographicBoundingRectangle}get ellipsoid(){return this._ellipsoid}},_2=hQ;var mQ=class e{constructor(t,n,i){this._model=t,this._runtimeNode=n,this._runtimePrimitive=i,this._mappedPositionsPerEllipsoid=void 0,this._mappedPositionsModelMatrix=new N,this._lastImageryLayersModificationCounter=0,this._imageryTexCoordAttributesPerProjection=void 0,this._currentImageryLayers=void 0,this._coveragesPerLayer=void 0,this._allImageriesReady=!1}coveragesForImageryLayer(t){let r=this._model.imageryLayers.indexOf(t);if(r===-1)throw new pe("Imagery layer is not part of the model");let o=this._coveragesPerLayer;if(!l(o))throw new pe("The coveragesPerLayer have not been computed yet");return o[r]}update(t){let n=this._model,o=n.content.tileset.imageryLayersModificationCounter;this._lastImageryLayersModificationCounter!==o&&(delete this._mappedPositionsPerEllipsoid,this._lastImageryLayersModificationCounter=o),this._mappedPositionsNeedUpdate&&(n.resetDrawCommands(),this._mappedPositionsPerEllipsoid=this._computeMappedPositionsPerEllipsoid(),this._deleteCoveragesPerLayer(),this._destroyImageryTexCoordAttributes()),l(this._imageryTexCoordAttributesPerProjection)||(this._imageryTexCoordAttributesPerProjection=this._computeImageryTexCoordsAttributesPerProjection(),this._uploadImageryTexCoordAttributes(t.context)),l(this._coveragesPerLayer)||(this._computeCoveragesPerLayer(),this._allImageriesReady=!1),this._allImageriesReady||this._updateImageries(t)}_deleteCoveragesPerLayer(){let t=this._coveragesPerLayer;if(!l(t))return;let n=this._currentImageryLayers,i=t.length;for(let r=0;r<i;r++){let o=n[r],s=t[r];this._deleteCoverages(o,s)}delete this._currentImageryLayers,delete this._coveragesPerLayer}_deleteCoverages(t,n){if(t.isDestroyed())return;let i=n.length;for(let r=0;r<i;r++)n[r].imagery.releaseReference()}_uploadImageryTexCoordAttributes(t){let n=this._imageryTexCoordAttributesPerProjection;if(!l(n))return;let i=n.length;for(let r=0;r<i;r++){let o=n[r],s=tt.createVertexBuffer({context:t,typedArray:o.typedArray,usage:Me.STATIC_DRAW});s.vertexArrayDestroyable=!1,o.buffer=s}}_destroyImageryTexCoordAttributes(){let t=this._imageryTexCoordAttributesPerProjection;if(!l(t))return;let n=t.length;for(let i=0;i<n;i++){let r=t[i];l(r)&&(l(r.buffer)&&(r.buffer.isDestroyed()||r.buffer.destroy()),t[i]=void 0)}delete this._imageryTexCoordAttributesPerProjection}get _mappedPositionsNeedUpdate(){if(!l(this._mappedPositionsPerEllipsoid))return!0;let t=this._model,n=this._mappedPositionsModelMatrix;return!N.equals(t.modelMatrix,n)}_computeMappedPositionsPerEllipsoid(){let t=this._model,n=this._runtimeNode,i=this._runtimePrimitive,r=e._obtainPrimitivePositionAttribute(i.primitive),o=r.count,s=e._computePrimitivePositionTransform(t,n,void 0),a=[],c=e._computeUniqueEllipsoids(t.imageryLayers),u=c.length;for(let f=0;f<u;f++){let d=c[f],p=VT.createCartographicPositions(r,s,d),g=VT.computeCartographicBoundingRectangle(p),m=new _2(p,o,g,d);a.push(m)}return N.clone(t.modelMatrix,this._mappedPositionsModelMatrix),a}static _computeUniqueEllipsoids(t){let n=new Set,i=t.length;for(let r=0;r<i;r++){let o=t.get(r),s=e._getEllipsoid(o);n.add(s)}return[...n]}_computeImageryTexCoordsAttributesPerProjection(){let n=this._model.imageryLayers,i=e._extractProjections(n),r=[...new Set(i)];return this._createImageryTexCoordAttributes(r)}static _extractProjections(t){let n=[],i=t.length;for(let r=0;r<i;r++){let o=t.get(r),s=e._getProjection(o);n.push(s)}return n}static _getProjection(t){return t.imageryProvider.tilingScheme.projection}_createImageryTexCoordAttributes(t){let n=[],i=t.length;for(let r=0;r<i;r++){let o=t[r],s=o.ellipsoid,a=this.mappedPositionsForEllipsoid(s),c=VT.createTextureCoordinatesAttributeForMappedPositions(a,o);n.push(c)}return n}_computeCoveragesPerLayer(){let t=[],n=[],r=this._model.imageryLayers,o=r.length;for(let s=0;s<o;s++){let a=r.get(s),c=this._computeCoverage(a);t.push(c),n.push(a)}this._coveragesPerLayer=t,this._currentImageryLayers=n}_computeCoverage(t){let i=this.mappedPositionsForImageryLayer(t).cartographicBoundingRectangle,r=this._computeImageryLevel(t,i);return Rw.createImageryCoverages(i,t,r)}_computeImageryLevel(t,n){let i=t.imageryProvider,o=i.tilingScheme.rectangle,s=1,a=n.width,c=o.width;n.height>n.width&&(a=n.height,c=o.height);let u=Math.log2(s*c/a);return Rw._clampImageryLevel(i,u)}_updateImageries(t){let n=this._model,i=this._coveragesPerLayer,r=i.length,o=!0;for(let s=0;s<r;s++){let a=i[s],c=a.length;for(let u=0;u<c;u++){let d=a[u].imagery;d.state===Vn.READY||d.state===Vn.FAILED||d.state===Vn.INVALID||(o=!1,d.processStateMachine(t,!1,!1))}}o&&n.resetDrawCommands(),this._allImageriesReady=o}mappedPositionsForImageryLayer(t){let n=e._getEllipsoid(t);return this.mappedPositionsForEllipsoid(n)}mappedPositionsForEllipsoid(t){let n=this._mappedPositionsPerEllipsoid;if(!l(n))throw new pe("The mappedPositions have not been computed yet");let i=n.length;for(let r=0;r<i;r++){let o=n[r];if(o.ellipsoid===t)return o}throw new pe(`Could not find mapped positions for ellipsoid ${t}`)}imageryTexCoordAttributesPerProjection(){let t=this._imageryTexCoordAttributesPerProjection;if(!l(t))throw new pe("The imagery texture coordinate attributes have not been computed yet");return this._imageryTexCoordAttributesPerProjection}get ready(){let t=this._coveragesPerLayer;return l(t)?this._allImageriesReady:!1}isDestroyed(){return!1}destroy(){if(!this.isDestroyed())return this._deleteCoveragesPerLayer(),this._destroyImageryTexCoordAttributes(),le(this)}static _computePrimitivePositionTransform(t,n,i){l(i)||(i=new N);let r=t.sceneGraph;return N.clone(N.IDENTITY,i),N.multiply(i,t.modelMatrix,i),N.multiply(i,r.components.transform,i),N.multiply(i,r.axisCorrectionMatrix,i),N.multiply(i,n.computedTransform,i),i}static _obtainPrimitivePositionAttribute(t){let n=xt.getAttributeBySemantic(t,"POSITION");if(!l(n))throw new pe("The primitive does not have a POSITION attribute");return n}static _getEllipsoid(t){return t.imageryProvider.tilingScheme.projection.ellipsoid}},jT=mQ;var pQ=class{constructor(t,n,i,r,o){this.imageryLayer=t,this.texture=n,this.textureTranslationAndScale=i,this.textureCoordinateRectangle=r,this.imageryTexCoordAttributeSetIndex=o}},y2=pQ;var out=!1,sut=new ie,aut=new ie,gQ=class e{static process(t,n,i){let r=t.model,o=n.modelPrimitiveImagery;if(!l(o)||!o.ready)return;let s=r.imageryLayers,a=jT._extractProjections(s),c=[...new Set(a)],u=e._computeIndexMapping(a,c),f=e._createImageryInputs(s,o,u);if(f.length===0)return;f.length>10&&(_t("imagery-texture-units",`Warning: Draped imagery requires ${f.length} texture units, truncating`),f.length=10),e._addImageryTexCoordAttributesToRenderResources(o,t);let d=[];for(let p=0;p<s.length;p++)d.push(s.get(p));e._processImageryInputs(d,t,f,c.length)}static _addImageryTexCoordAttributesToRenderResources(t,n){let i=t.imageryTexCoordAttributesPerProjection();for(let r of i)e._addImageryTexCoordAttributeToRenderResources(r,n)}static _addImageryTexCoordAttributeToRenderResources(t,n){let i=Vt.getNumberOfComponents(t.type),r={index:n.attributeIndex++,value:l(t.buffer)?void 0:t.constant,vertexBuffer:t.buffer,count:t.count,componentsPerAttribute:i,componentDatatype:t.componentDatatype,offsetInBytes:t.byteOffset,strideInBytes:t.byteStride,normalize:t.normalized};n.attributes.push(r)}static _processImageryInputs(t,n,i,r){let o=n.shaderBuilder,s=e._computeImageryFlags(t),a=i.length;o.addDefine("HAS_IMAGERY"),o.addDefine(`IMAGERY_TEXTURE_UNITS ${a}`),e._addAttributes(o,r),e._defineUniforms(o,s),e._buildSampleAndBlendFunction(o,s),e._createMainImageryShader(o,i,s);let c=n.uniformMap,u=e._createImageryUniforms(i);e._setImageryUniforms(c,u)}static _addAttributes(t,n){for(let o=0;o<n;o++)t.addAttribute("vec2",`a_imagery_texCoord_${o}`),t.addVarying("vec2",`v_imagery_texCoord_${o}`);let i="initializeImageryAttributes",r=`void ${i}()`;t.addFunction(i,r,de.VERTEX);for(let o=0;o<n;o++)t.addFunctionLines(i,[`v_imagery_texCoord_${o} = a_imagery_texCoord_${o};`])}static _computeImageryFlags(t){let n=new g2;for(let i=0;i<t.length;i++){let r=t[i];n.alpha|=r.alpha!==1,n.brightness|=r.brightness!==Is.DEFAULT_BRIGHTNESS,n.contrast|=r.contrast!==Is.DEFAULT_CONTRAST,n.hue|=r.hue!==Is.DEFAULT_HUE,n.saturation|=r.saturation!==Is.DEFAULT_SATURATION,n.gamma|=r.gamma!==Is.DEFAULT_GAMMA;let o=l(r.colorToAlpha)&&r.colorToAlphaThreshold>0;n.colorToAlpha|=o}return n}static _defineUniforms(t,n){t.addUniform("sampler2D","u_imageryTextures[IMAGERY_TEXTURE_UNITS]",de.FRAGMENT),t.addUniform("vec4","u_imageryTextureCoordinateRectangle[IMAGERY_TEXTURE_UNITS]",de.FRAGMENT),t.addUniform("vec4","u_imageryTextureTranslationAndScale[IMAGERY_TEXTURE_UNITS]",de.FRAGMENT),n.alpha&&t.addUniform("float","u_imageryTextureAlpha[IMAGERY_TEXTURE_UNITS]",de.FRAGMENT),n.brightness&&t.addUniform("float","u_imageryTextureBrightness[IMAGERY_TEXTURE_UNITS]",de.FRAGMENT),n.contrast&&t.addUniform("float","u_imageryTextureContrast[IMAGERY_TEXTURE_UNITS]",de.FRAGMENT),n.hue&&t.addUniform("float","u_imageryTextureHue[IMAGERY_TEXTURE_UNITS]",de.FRAGMENT),n.saturation&&t.addUniform("float","u_imageryTextureSaturation[IMAGERY_TEXTURE_UNITS]",de.FRAGMENT),n.gamma&&t.addUniform("float","u_imageryTextureOneOverGamma[IMAGERY_TEXTURE_UNITS]",de.FRAGMENT),n.colorToAlpha&&t.addUniform("vec4","u_imageryTextureColorToAlpha[IMAGERY_TEXTURE_UNITS]",de.FRAGMENT)}static _createSampleAndBlendFunctionSignature(t){let n="sampleAndBlend",i=[];i.push("vec4 previousColor"),i.push("sampler2D textureToSample"),i.push("vec2 textureCoordinates"),i.push("vec4 textureCoordinateRectangle"),i.push("vec4 textureCoordinateTranslationAndScale"),t.alpha&&i.push("float textureAlpha"),t.brightness&&i.push("float textureBrightness"),t.contrast&&i.push("float textureContrast"),t.hue&&i.push("float textureHue"),t.saturation&&i.push("float textureSaturation"),t.gamma&&i.push("float textureOneOverGamma"),t.colorToAlpha&&i.push("vec4 colorToAlpha");let r=i.join(", ");return`vec4 ${n}(${r})`}static _buildSampleAndBlendFunction(t,n){let i="sampleAndBlend",r=e._createSampleAndBlendFunctionSignature(n);t.addFunction(i,r,de.FRAGMENT),t.addFunctionLines(i,["float effectiveAlpha = 1.0;"]),n.alpha&&t.addFunctionLines(i,["effectiveAlpha = textureAlpha;"]),t.addFunctionLines(i,["if (textureCoordinates.x < textureCoordinateRectangle.x) effectiveAlpha = 0.0;","if (textureCoordinates.x > textureCoordinateRectangle.z) effectiveAlpha = 0.0;","if (textureCoordinates.y < textureCoordinateRectangle.y) effectiveAlpha = 0.0;","if (textureCoordinates.y > textureCoordinateRectangle.w) effectiveAlpha = 0.0;","vec2 translation = textureCoordinateTranslationAndScale.xy;","vec2 scale = textureCoordinateTranslationAndScale.zw;","vec2 effectiveTextureCoordinates = textureCoordinates * scale + translation;","vec4 value = texture(textureToSample, effectiveTextureCoordinates);","value = czm_srgbToLinear(value);","vec3 color = value.rgb;","float alpha = value.a;"]),n.colorToAlpha&&t.addFunctionLines(i,["vec3 colorDiff = abs(color.rgb - colorToAlpha.rgb);","colorDiff.r = czm_maximumComponent(colorDiff);","alpha = czm_branchFreeTernary(colorDiff.r < colorToAlpha.a, 0.0, alpha);"]),n.gamma?t.addFunctionLines(i,["color = pow(color, vec3(textureOneOverGamma));"]):t.addFunctionLines(i,["vec4 tempColor = czm_gammaCorrect(vec4(color, alpha));","color = tempColor.rgb;","alpha = tempColor.a;"]),n.brightness&&t.addFunctionLines(i,["color = mix(vec3(0.0), color, textureBrightness);"]),n.contrast&&t.addFunctionLines(i,["color = mix(vec3(0.5), color, textureContrast);"]),n.hue&&t.addFunctionLines(i,["color = czm_hue(color, textureHue);"]),n.saturation&&t.addFunctionLines(i,["color = czm_saturation(color, textureSaturation);"]),t.addFunctionLines(i,["float sourceAlpha = alpha * effectiveAlpha;","float outAlpha = mix(previousColor.a, 1.0, sourceAlpha);","outAlpha += sign(outAlpha) - 1.0;","vec3 outColor = mix(previousColor.rgb * previousColor.a, color, sourceAlpha) / outAlpha;","vec4 result = vec4(outColor, max(outAlpha, 0.0));"]),out&&t.addFunctionLines(i,["if (abs(textureCoordinates.x - textureCoordinateRectangle.x) < (1.0/256.0) || "," abs(textureCoordinates.x - textureCoordinateRectangle.z) < (1.0/256.0) || "," abs(textureCoordinates.y - textureCoordinateRectangle.y) < (1.0/256.0) || "," abs(textureCoordinates.y - textureCoordinateRectangle.w) < (1.0/256.0))","{"," result = vec4(1.0, 0.0, 0.0, effectiveAlpha);","}"]),t.addFunctionLines(i,["return result;"])}static _createSampleAndBlendCallArguments(t,n,i){let r=`v_imagery_texCoord_${n}`,o=[];return o.push("blendedBaseColor"),o.push(`u_imageryTextures[${i}]`),o.push(`${r}`),o.push(`u_imageryTextureCoordinateRectangle[${i}]`),o.push(`u_imageryTextureTranslationAndScale[${i}]`),t.alpha&&o.push(`u_imageryTextureAlpha[${i}]`),t.brightness&&o.push(`u_imageryTextureBrightness[${i}]`),t.contrast&&o.push(`u_imageryTextureContrast[${i}]`),t.hue&&o.push(`u_imageryTextureHue[${i}]`),t.saturation&&o.push(`u_imageryTextureSaturation[${i}]`),t.gamma&&o.push(`u_imageryTextureOneOverGamma[${i}]`),t.colorToAlpha&&o.push(`u_imageryTextureColorToAlpha[${i}]`),o.join(", ")}static _createMainImageryShader(t,n,i){let r="blendBaseColorWithImagery";t.addFunction(r,"vec4 blendBaseColorWithImagery(vec4 baseColorWithAlpha)",de.FRAGMENT),t.addFunctionLines(r,["vec4 blendedBaseColor = baseColorWithAlpha;"]);for(let o=0;o<n.length;o++){let a=n[o].imageryTexCoordAttributeSetIndex,c=e._createSampleAndBlendCallArguments(i,a,o);t.addFunctionLines(r,[`blendedBaseColor = sampleAndBlend(${c});`])}t.addFunctionLines(r,["return blendedBaseColor;"])}static _createImageryUniforms(t){let n=t.length,i={};i.imageryTextures=Array(n),i.imageryTextureCoordinateRectangle=Array(n),i.imageryTextureTranslationAndScale=Array(n),i.imageryTextureAlpha=Array(n),i.imageryTextureBrightness=Array(n),i.imageryTextureContrast=Array(n),i.imageryTextureHue=Array(n),i.imageryTextureSaturation=Array(n),i.imageryTextureOneOverGamma=Array(n),i.imageryTextureColorToAlpha=Array(n);for(let r=0;r<n;r++){let o=t[r],s=o.imageryLayer,a=o.texture,c=o.textureCoordinateRectangle,u=o.textureTranslationAndScale;i.imageryTextures[r]=a,i.imageryTextureTranslationAndScale[r]=u,i.imageryTextureCoordinateRectangle[r]=c,i.imageryTextureAlpha[r]=s.alpha,i.imageryTextureBrightness[r]=s.brightness,i.imageryTextureContrast[r]=s.contrast,i.imageryTextureHue[r]=s.hue,i.imageryTextureSaturation[r]=s.saturation,i.imageryTextureOneOverGamma[r]=1/s.gamma;let f=i.imageryTextureColorToAlpha[r];if(l(f)||(f=new se,i.imageryTextureColorToAlpha[r]=f),l(s.colorToAlpha)&&s.colorToAlphaThreshold>0){let p=s.colorToAlpha;f.x=p.red,f.y=p.green,f.z=p.blue,f.w=s.colorToAlphaThreshold}else f.w=-1}return i}static _setImageryUniforms(t,n){for(let i in n)if(n.hasOwnProperty(i)){let r=`u_${i}`;t[r]=function(){return n[i]}}}static _createImageryInputs(t,n,i){let r=[];for(let o=0;o<t.length;o++){let s=t.get(o);if(!s.show)continue;let a=i[o],u=n.mappedPositionsForImageryLayer(s).cartographicBoundingRectangle,f=n.coveragesForImageryLayer(s);for(let d=0;d<f.length;d++){let p=f[d],g=e._createImageryInput(s,p,u,a);l(g)&&r.push(g)}}return r}static _createImageryInput(t,n,i,r){let o=n.imagery;if(o.state===Vn.FAILED||o.state===Vn.INVALID)return;let s=o.textureWebMercator;if(!l(s)&&(s=o.texture,!l(s))){o.state===Vn.READY&&console.log(`Imagery at ${n.x}, ${n.y} (level ${n.level}) does not have any texture - state ${o.state}`);return}let a=e._computeTextureTranslationAndScale(t,i,o.rectangle),c=n.textureCoordinateRectangle,u=new se(c.minX,c.minY,c.maxX,c.maxY);return new y2(t,s,a,u,r)}static _computeTextureTranslationAndScale(t,n,i){let r=t.imageryProvider.tilingScheme,o=r.rectangleToNativeRectangle(n,sut),s=r.rectangleToNativeRectangle(i,aut);return e._computeTextureTranslationAndScaleFromNative(o,s)}static _computeTextureTranslationAndScaleFromNative(t,n){let i=1/n.width,r=1/n.height,o=t.west-n.west,s=t.south-n.south,a=o*i,c=s*r,u=t.width*i,f=t.height*r;return new se(a,c,u,f)}static _computeIndexMapping(t,n){let i=[],r=t.length;for(let o=0;o<r;o++){let s=t[o],a=n.indexOf(s);i.push(a)}return i}},A2=gQ;var b2=`#ifdef USE_IBL_LIGHTING vec3 computeIBL(vec3 position, vec3 normal, vec3 lightDirection, vec3 lightColorHdr, czm_modelMaterial material) { #if defined(DIFFUSE_IBL) || defined(SPECULAR_IBL) @@ -9011,7 +9007,7 @@ color = czm_linearToSrgb(color); #endif material.diffuse = color; } -`;var QAe={UNLIT:0,PBR:1};Object.freeze(QAe);var Jp=QAe;var ebe={name:"LightingPipelineStage"};ebe.process=function(e,t){let{model:n,lightingOptions:i,shaderBuilder:r}=e;if(l(n.lightColor)){r.addDefine("USE_CUSTOM_LIGHT_COLOR",void 0,de.FRAGMENT),r.addUniform("vec3","model_lightColorHdr",de.FRAGMENT);let s=e.uniformMap;s.model_lightColorHdr=function(){return n.lightColor}}let{lightingModel:o}=i;o===Jp.PBR?r.addDefine("LIGHTING_PBR",void 0,de.FRAGMENT):r.addDefine("LIGHTING_UNLIT",void 0,de.FRAGMENT),r.addFragmentLines(wB)};var IB=ebe;var PB=`bool isDefaultStyleColor(vec3 color) +`;var AEe={UNLIT:0,PBR:1};Object.freeze(AEe);var r0=AEe;var bEe={name:"LightingPipelineStage"};bEe.process=function(e,t){let{model:n,lightingOptions:i,shaderBuilder:r}=e;if(l(n.lightColor)){r.addDefine("USE_CUSTOM_LIGHT_COLOR",void 0,de.FRAGMENT),r.addUniform("vec3","model_lightColorHdr",de.FRAGMENT);let s=e.uniformMap;s.model_lightColorHdr=function(){return n.lightColor}}let{lightingModel:o}=i;o===r0.PBR?r.addDefine("LIGHTING_PBR",void 0,de.FRAGMENT):r.addDefine("LIGHTING_UNLIT",void 0,de.FRAGMENT),r.addFragmentLines(b2)};var x2=bEe;var T2=`bool isDefaultStyleColor(vec3 color) { return all(greaterThan(color, vec3(1.0 - czm_epsilon3))); } @@ -9460,7 +9456,7 @@ setClearcoat(material, attributes); #endif #endif } -`;var DB=`#ifdef HAS_CONSTANT_LOD +`;var E2=`#ifdef HAS_CONSTANT_LOD float modelScaleX = length(czm_model[0].xyz); float modelScaleY = length(czm_model[1].xyz); float modelScaleZ = length(czm_model[2].xyz); @@ -9469,7 +9465,7 @@ vec3 enuDir = (u_constantLodWorldToEnu * czm_model * vec4(v_positionMC, 0.0)).xy v_constantLodUvCustom.xy = (enuDir.yx + u_constantLodOffset) / modelScale; v_constantLodUvCustom.z = u_constantLodDistance / modelScale; #endif -`;var RB=`#ifdef HAS_CONSTANT_LOD +`;var C2=`#ifdef HAS_CONSTANT_LOD vec4 constantLodTextureLookup(sampler2D textureSampler, vec3 constantLodParams) { bool atMaxClamp = v_constantLodUvCustom.z >= constantLodParams.y; bool atMinClamp = v_constantLodUvCustom.z <= constantLodParams.x; @@ -9512,8 +9508,8 @@ tc2 = czm_computeTextureTransform(tc2, textureTransform); return mix(texture(textureSampler, tc1), texture(textureSampler, tc2), f); } #endif -`;var{Material:bst,MetallicRoughness:CZ,SpecularGlossiness:vZ,Specular:tbe,Clearcoat:nbe}=Cn,ibe={name:"MaterialPipelineStage",_processTexture:Xu,_processTextureTransform:rbe};ibe.process=function(e,t,n){let i=t.material,{model:r,uniformMap:o,shaderBuilder:s}=e;l(o.u_constantLodDistance)||(o.u_constantLodDistance=function(){let x=r.boundingSphere,T=n.camera;if(l(x)&&l(T)){let E=h.distance(T.positionWC,x.center);return Math.max(E,.1)}return 1});let a=l(r.classificationType),c=a,{defaultTexture:u,defaultNormalTexture:f,defaultEmissiveTexture:d}=n.context;vst(i,o,s,u,f,d,c,e),l(i.specularGlossiness)?Sst(i.specularGlossiness,o,s,u,c,e):(l(i.specular)&&xt.supportedExtensions.KHR_materials_specular&&wst(i.specular,o,s,u,c),l(i.anisotropy)&&xt.supportedExtensions.KHR_materials_anisotropy&&Pst(i.anisotropy,o,s,u,c),l(i.clearcoat)&&xt.supportedExtensions.KHR_materials_clearcoat&&Dst(i.clearcoat,o,s,u,c),Rst(i.metallicRoughness,o,s,u,c,e));let p=xt.getAttributeBySemantic(t,ct.NORMAL),g=l(r.pointCloudShading)&&!r.pointCloudShading.normalShading;l(i.planarFill)&&xst(i.planarFill,t,e,n);let m=l(i.planarFill)&&i.planarFill.backgroundFill,y=e.lightingOptions;i.unlit||!p||a||g||m?y.lightingModel=Jp.UNLIT:y.lightingModel=Jp.PBR;let A=r.backFaceCulling&&!i.doubleSided;e.renderStateOptions.cull.enabled=A;let b=e.alphaOptions;i.alphaMode===Gp.BLEND?b.pass=Ie.TRANSLUCENT:i.alphaMode===Gp.MASK&&(b.alphaCutoff=i.alphaCutoff),l(i.pointDiameter)&&(s.addDefine("HAS_POINT_DIAMETER",void 0,de.BOTH),s.addUniform("float","u_pointDiameter",de.VERTEX),o.u_pointDiameter=function(){return i.pointDiameter*n.pixelRatio}),l(i.lineStyle)&&Est(i.lineStyle,t,n,o,s),s.addFragmentLines(PB),i.doubleSided&&s.addDefine("HAS_DOUBLE_SIDED_MATERIAL",void 0,de.BOTH)};function xst(e,t,n,i){let{uniformMap:r,shaderBuilder:o}=n;if(i.planarFillRequested=!0,o.addDefine("HAS_PLANAR_FILL_DEPTH",void 0,de.FRAGMENT),e.backgroundFill&&o.addDefine("HAS_BACKGROUND_FILL",void 0,de.FRAGMENT),!(l(t.featureIds)&&t.featureIds.length>0))return;let a=t.featureIds[0].positionalLabel;o.addDefine("PLANAR_FILL_FEATURE_ID",a,de.FRAGMENT),e.behind?o.addDefine("HAS_PLANAR_FILL_BEHIND",void 0,de.FRAGMENT):(n.planarFillIdPass=!0,o.addDefine("HAS_PLANAR_FILL_ID_PASS",void 0,de.FRAGMENT),o.addUniform("bool","u_isPlanarFillIdPass",de.FRAGMENT),r.u_isPlanarFillIdPass=function(){return!1})}function Tst(e,t,n,i,r,o){let s=n.constantLod;if(!l(s)||!l(o))return;let a=`HAS_${r}_CONSTANT_LOD`;if(e.addDefine(a,void 0,de.BOTH),!l(t.u_constantLodOffset)){e.addDefine("HAS_CONSTANT_LOD",void 0,de.BOTH),e.addVarying("vec3","v_constantLodUvCustom"),e.addUniform("vec2","u_constantLodOffset",de.VERTEX),e.addUniform("float","u_constantLodDistance",de.VERTEX),e.addUniform("mat4","u_constantLodWorldToEnu",de.VERTEX),e.addFragmentLines(RB);let u=DB.split(` -`).filter(f=>!f.trim().startsWith("//")||f.includes("#"));e.addFunctionLines("setDynamicVaryingsVS",u)}let c=`${i}ConstantLodParams`;if(e.addUniform("vec3",c,de.FRAGMENT),t[c]=function(){return new h(s.minClampDistance,s.maxClampDistance,s.repetitions)},!l(t.u_constantLodOffset)){t.u_constantLodOffset=function(){return s.offset};let u=N.clone(N.IDENTITY),f=!1;t.u_constantLodWorldToEnu=function(){if(!f){let d=o.model.boundingSphere;if(l(d)){let p=d.center,g=At.eastNorthUpToFixedFrame(p);N.inverse(g,u),f=!0}}return f?u:N.IDENTITY}}}function Est(e,t,n,i,r){let{width:o,pattern:s}=e;l(o)&&(r.addUniform("float","u_lineWidth",de.VERTEX),i.u_lineWidth=function(){return o*n.pixelRatio}),l(s)&&(r.addDefine("HAS_LINE_PATTERN",void 0,de.BOTH),r.addUniform("float","u_linePattern",de.FRAGMENT),r.addVarying("float","v_lineCoord"),i.u_linePattern=function(){return s});let a=xt.getAttributeBySemantic(t,ct.CUMULATIVE_DISTANCE);if(l(s)&&l(a)&&(t.primitiveType===Oe.LINES||t.primitiveType===Oe.TRIANGLE_STRIP)){r.addDefine("HAS_LINE_CUMULATIVE_DISTANCE",void 0,de.VERTEX),a.normalized&&r.addDefine("LINE_CUM_DIST_NORMALIZED",void 0,de.VERTEX),r.addUniform("float","u_cumulativeDistanceMax",de.VERTEX),r.addUniform("float","u_pixelsPerWorld",de.VERTEX);let c=l(a.max)?a.max:1;i.u_cumulativeDistanceMax=function(){return c},i.u_pixelsPerWorld=function(){let f=n.camera.frustum,d=1,p;return l(f.right)&&l(f.left)?p=f.right-f.left:l(f.width)&&(p=f.width),l(p)&&p>0&&(d=n.context.drawingBufferWidth/p),d};let u=xt.getAttributeInfo(a).variableName;r.addVertexLines(` +`;var{Material:cut,MetallicRoughness:_Q,SpecularGlossiness:yQ,Specular:xEe,Clearcoat:TEe}=Cn,EEe={name:"MaterialPipelineStage",_processTexture:Ju,_processTextureTransform:CEe};EEe.process=function(e,t,n){let i=t.material,{model:r,uniformMap:o,shaderBuilder:s}=e;l(o.u_constantLodDistance)||(o.u_constantLodDistance=function(){let x=r.boundingSphere,T=n.camera;if(l(x)&&l(T)){let E=h.distance(T.positionWC,x.center);return Math.max(E,.1)}return 1});let a=l(r.classificationType),c=a,{defaultTexture:u,defaultNormalTexture:f,defaultEmissiveTexture:d}=n.context;hut(i,o,s,u,f,d,c,e),l(i.specularGlossiness)?mut(i.specularGlossiness,o,s,u,c,e):(l(i.specular)&&xt.supportedExtensions.KHR_materials_specular&&put(i.specular,o,s,u,c),l(i.anisotropy)&&xt.supportedExtensions.KHR_materials_anisotropy&&_ut(i.anisotropy,o,s,u,c),l(i.clearcoat)&&xt.supportedExtensions.KHR_materials_clearcoat&&yut(i.clearcoat,o,s,u,c),Aut(i.metallicRoughness,o,s,u,c,e));let p=xt.getAttributeBySemantic(t,ct.NORMAL),g=l(r.pointCloudShading)&&!r.pointCloudShading.normalShading;l(i.planarFill)&&lut(i.planarFill,t,e,n);let m=l(i.planarFill)&&i.planarFill.backgroundFill,y=e.lightingOptions;i.unlit||!p||a||g||m?y.lightingModel=r0.UNLIT:y.lightingModel=r0.PBR;let A=r.backFaceCulling&&!i.doubleSided;e.renderStateOptions.cull.enabled=A;let b=e.alphaOptions;i.alphaMode===$p.BLEND?b.pass=Ie.TRANSLUCENT:i.alphaMode===$p.MASK&&(b.alphaCutoff=i.alphaCutoff),l(i.pointDiameter)&&(s.addDefine("HAS_POINT_DIAMETER",void 0,de.BOTH),s.addUniform("float","u_pointDiameter",de.VERTEX),o.u_pointDiameter=function(){return i.pointDiameter*n.pixelRatio}),l(i.lineStyle)&&fut(i.lineStyle,t,n,o,s),s.addFragmentLines(T2),i.doubleSided&&s.addDefine("HAS_DOUBLE_SIDED_MATERIAL",void 0,de.BOTH)};function lut(e,t,n,i){let{uniformMap:r,shaderBuilder:o}=n;if(i.planarFillRequested=!0,o.addDefine("HAS_PLANAR_FILL_DEPTH",void 0,de.FRAGMENT),e.backgroundFill&&o.addDefine("HAS_BACKGROUND_FILL",void 0,de.FRAGMENT),!(l(t.featureIds)&&t.featureIds.length>0))return;let a=t.featureIds[0].positionalLabel;o.addDefine("PLANAR_FILL_FEATURE_ID",a,de.FRAGMENT),e.behind?o.addDefine("HAS_PLANAR_FILL_BEHIND",void 0,de.FRAGMENT):(n.planarFillIdPass=!0,o.addDefine("HAS_PLANAR_FILL_ID_PASS",void 0,de.FRAGMENT),o.addUniform("bool","u_isPlanarFillIdPass",de.FRAGMENT),r.u_isPlanarFillIdPass=function(){return!1})}function uut(e,t,n,i,r,o){let s=n.constantLod;if(!l(s)||!l(o))return;let a=`HAS_${r}_CONSTANT_LOD`;if(e.addDefine(a,void 0,de.BOTH),!l(t.u_constantLodOffset)){e.addDefine("HAS_CONSTANT_LOD",void 0,de.BOTH),e.addVarying("vec3","v_constantLodUvCustom"),e.addUniform("vec2","u_constantLodOffset",de.VERTEX),e.addUniform("float","u_constantLodDistance",de.VERTEX),e.addUniform("mat4","u_constantLodWorldToEnu",de.VERTEX),e.addFragmentLines(C2);let u=E2.split(` +`).filter(f=>!f.trim().startsWith("//")||f.includes("#"));e.addFunctionLines("setDynamicVaryingsVS",u)}let c=`${i}ConstantLodParams`;if(e.addUniform("vec3",c,de.FRAGMENT),t[c]=function(){return new h(s.minClampDistance,s.maxClampDistance,s.repetitions)},!l(t.u_constantLodOffset)){t.u_constantLodOffset=function(){return s.offset};let u=N.clone(N.IDENTITY),f=!1;t.u_constantLodWorldToEnu=function(){if(!f){let d=o.model.boundingSphere;if(l(d)){let p=d.center,g=At.eastNorthUpToFixedFrame(p);N.inverse(g,u),f=!0}}return f?u:N.IDENTITY}}}function fut(e,t,n,i,r){let{width:o,pattern:s}=e;l(o)&&(r.addUniform("float","u_lineWidth",de.VERTEX),i.u_lineWidth=function(){return o*n.pixelRatio}),l(s)&&(r.addDefine("HAS_LINE_PATTERN",void 0,de.BOTH),r.addUniform("float","u_linePattern",de.FRAGMENT),r.addVarying("float","v_lineCoord"),i.u_linePattern=function(){return s});let a=xt.getAttributeBySemantic(t,ct.CUMULATIVE_DISTANCE);if(l(s)&&l(a)&&(t.primitiveType===Oe.LINES||t.primitiveType===Oe.TRIANGLE_STRIP)){r.addDefine("HAS_LINE_CUMULATIVE_DISTANCE",void 0,de.VERTEX),a.normalized&&r.addDefine("LINE_CUM_DIST_NORMALIZED",void 0,de.VERTEX),r.addUniform("float","u_cumulativeDistanceMax",de.VERTEX),r.addUniform("float","u_pixelsPerWorld",de.VERTEX);let c=l(a.max)?a.max:1;i.u_cumulativeDistanceMax=function(){return c},i.u_pixelsPerWorld=function(){let f=n.camera.frustum,d=1,p;return l(f.right)&&l(f.left)?p=f.right-f.left:l(f.width)&&(p=f.width),l(p)&&p>0&&(d=n.context.drawingBufferWidth/p),d};let u=xt.getAttributeInfo(a).variableName;r.addVertexLines(` #ifdef HAS_LINE_CUMULATIVE_DISTANCE void lineStyleStageVS(in ProcessedAttributes attributes) { @@ -9540,7 +9536,7 @@ void lineStyleStageVS(in ProcessedAttributes attributes) } } #endif -`)}function rbe(e,t,n,i,r){let o=`HAS_${r}_TEXTURE_TRANSFORM`;e.addDefine(o,void 0,de.FRAGMENT);let s=`${i}Transform`;e.addUniform("mat3",s,de.FRAGMENT),t[s]=function(){return n.transform}}function Cst(e,t,n,i,r){let o=`HAS_${r}_TEXTURE_SCALE`;e.addDefine(o,void 0,de.FRAGMENT);let s=`${i}Scale`;e.addUniform("float",s,de.FRAGMENT),t[s]=function(){return n.scale}}function Xu(e,t,n,i,r,o,s){e.addUniform("sampler2D",i,de.FRAGMENT),t[i]=function(){return n.texture??o};let a=`HAS_${r}_TEXTURE`;e.addDefine(a,void 0,de.FRAGMENT);let u=`v_texCoord_${n.texCoord}`,f=`TEXCOORD_${r}`;e.addDefine(f,u,de.FRAGMENT);let d=n.transform;l(d)&&!$.equals(d,$.IDENTITY)&&rbe(e,t,n,i,r);let{scale:p}=n;l(p)&&p!==1&&Cst(e,t,n,i,r),Tst(e,t,n,i,r,s)}function vst(e,t,n,i,r,o,s,a){let{emissiveFactor:c,emissiveTexture:u,normalTexture:f,occlusionTexture:d}=e;l(c)&&!h.equals(c,bst.DEFAULT_EMISSIVE_FACTOR)&&(n.addUniform("vec3","u_emissiveFactor",de.FRAGMENT),t.u_emissiveFactor=function(){return e.emissiveFactor},n.addDefine("HAS_EMISSIVE_FACTOR",void 0,de.FRAGMENT),l(u)&&!s&&Xu(n,t,u,"u_emissiveTexture","EMISSIVE",o));let p;if(l(e.metallicRoughness)&&l(e.metallicRoughness.baseColorTexture)&&l(e.metallicRoughness.baseColorTexture.constantLod)?p=e.metallicRoughness.baseColorTexture.constantLod:l(e.specularGlossiness)&&l(e.specularGlossiness.diffuseTexture)&&l(e.specularGlossiness.diffuseTexture.constantLod)&&(p=e.specularGlossiness.diffuseTexture.constantLod),l(f)&&!s){let g=f;l(f.constantLod)&&l(p)&&(g=Object.create(Object.getPrototypeOf(f)),Object.assign(g,f),g.constantLod=p),Xu(n,t,g,"u_normalTexture","NORMAL",r,a)}l(d)&&!s&&Xu(n,t,d,"u_occlusionTexture","OCCLUSION",i)}function Sst(e,t,n,i,r,o){let{diffuseTexture:s,diffuseFactor:a,specularGlossinessTexture:c,specularFactor:u,glossinessFactor:f}=e;n.addDefine("USE_SPECULAR_GLOSSINESS",void 0,de.FRAGMENT),l(s)&&!r&&Xu(n,t,s,"u_diffuseTexture","DIFFUSE",i,o),l(a)&&!se.equals(a,vZ.DEFAULT_DIFFUSE_FACTOR)&&(n.addUniform("vec4","u_diffuseFactor",de.FRAGMENT),t.u_diffuseFactor=function(){return e.diffuseFactor},n.addDefine("HAS_DIFFUSE_FACTOR",void 0,de.FRAGMENT)),l(c)&&!r&&Xu(n,t,c,"u_specularGlossinessTexture","SPECULAR_GLOSSINESS",i),l(u)&&!h.equals(u,vZ.DEFAULT_SPECULAR_FACTOR)&&(n.addUniform("vec3","u_legacySpecularFactor",de.FRAGMENT),t.u_legacySpecularFactor=function(){return e.specularFactor},n.addDefine("HAS_LEGACY_SPECULAR_FACTOR",void 0,de.FRAGMENT)),l(f)&&f!==vZ.DEFAULT_GLOSSINESS_FACTOR&&(n.addUniform("float","u_glossinessFactor",de.FRAGMENT),t.u_glossinessFactor=function(){return e.glossinessFactor},n.addDefine("HAS_GLOSSINESS_FACTOR",void 0,de.FRAGMENT))}function wst(e,t,n,i,r){let{specularTexture:o,specularFactor:s,specularColorTexture:a,specularColorFactor:c}=e;n.addDefine("USE_SPECULAR",void 0,de.FRAGMENT),l(o)&&!r&&Xu(n,t,o,"u_specularTexture","SPECULAR",i),l(s)&&s!==tbe.DEFAULT_SPECULAR_FACTOR&&(n.addUniform("float","u_specularFactor",de.FRAGMENT),t.u_specularFactor=function(){return e.specularFactor},n.addDefine("HAS_SPECULAR_FACTOR",void 0,de.FRAGMENT)),l(a)&&!r&&Xu(n,t,a,"u_specularColorTexture","SPECULAR_COLOR",i),l(c)&&!h.equals(c,tbe.DEFAULT_SPECULAR_COLOR_FACTOR)&&(n.addUniform("vec3","u_specularColorFactor",de.FRAGMENT),t.u_specularColorFactor=function(){return e.specularColorFactor},n.addDefine("HAS_SPECULAR_COLOR_FACTOR",void 0,de.FRAGMENT))}var Ist=new h;function Pst(e,t,n,i,r){let{anisotropyStrength:o,anisotropyRotation:s,anisotropyTexture:a}=e;n.addDefine("USE_ANISOTROPY",void 0,de.FRAGMENT),l(a)&&!r&&Xu(n,t,a,"u_anisotropyTexture","ANISOTROPY",i);let c=Math.cos(s),u=Math.sin(s);n.addUniform("vec3","u_anisotropy",de.FRAGMENT),t.u_anisotropy=function(){return h.fromElements(c,u,o,Ist)}}function Dst(e,t,n,i,r){let{clearcoatFactor:o,clearcoatTexture:s,clearcoatRoughnessFactor:a,clearcoatRoughnessTexture:c,clearcoatNormalTexture:u}=e;n.addDefine("USE_CLEARCOAT",void 0,de.FRAGMENT),l(o)&&o!==nbe.DEFAULT_CLEARCOAT_FACTOR&&(n.addUniform("float","u_clearcoatFactor",de.FRAGMENT),t.u_clearcoatFactor=function(){return e.clearcoatFactor},n.addDefine("HAS_CLEARCOAT_FACTOR",void 0,de.FRAGMENT)),l(s)&&!r&&Xu(n,t,s,"u_clearcoatTexture","CLEARCOAT",i),l(a)&&o!==nbe.DEFAULT_CLEARCOAT_ROUGHNESS_FACTOR&&(n.addUniform("float","u_clearcoatRoughnessFactor",de.FRAGMENT),t.u_clearcoatRoughnessFactor=function(){return e.clearcoatRoughnessFactor},n.addDefine("HAS_CLEARCOAT_ROUGHNESS_FACTOR",void 0,de.FRAGMENT)),l(c)&&!r&&Xu(n,t,c,"u_clearcoatRoughnessTexture","CLEARCOAT_ROUGHNESS",i),l(u)&&!r&&Xu(n,t,u,"u_clearcoatNormalTexture","CLEARCOAT_NORMAL",i)}function Rst(e,t,n,i,r,o){n.addDefine("USE_METALLIC_ROUGHNESS",void 0,de.FRAGMENT);let s=e.baseColorTexture;l(s)&&!r&&Xu(n,t,s,"u_baseColorTexture","BASE_COLOR",i,o);let a=e.baseColorFactor;l(a)&&!se.equals(a,CZ.DEFAULT_BASE_COLOR_FACTOR)&&(n.addUniform("vec4","u_baseColorFactor",de.FRAGMENT),t.u_baseColorFactor=function(){return e.baseColorFactor},n.addDefine("HAS_BASE_COLOR_FACTOR",void 0,de.FRAGMENT));let c=e.metallicRoughnessTexture;l(c)&&!r&&Xu(n,t,c,"u_metallicRoughnessTexture","METALLIC_ROUGHNESS",i);let u=e.metallicFactor;l(u)&&u!==CZ.DEFAULT_METALLIC_FACTOR&&(n.addUniform("float","u_metallicFactor",de.FRAGMENT),t.u_metallicFactor=function(){return e.metallicFactor},n.addDefine("HAS_METALLIC_FACTOR",void 0,de.FRAGMENT));let f=e.roughnessFactor;l(f)&&f!==CZ.DEFAULT_ROUGHNESS_FACTOR&&(n.addUniform("float","u_roughnessFactor",de.FRAGMENT),t.u_roughnessFactor=function(){return e.roughnessFactor},n.addDefine("HAS_ROUGHNESS_FACTOR",void 0,de.FRAGMENT))}var OB=ibe;var su={name:"MetadataPickingPipelineStage",METADATA_PICKING_ENABLED:"METADATA_PICKING_ENABLED",METADATA_PICKING_VALUE_TYPE:"METADATA_PICKING_VALUE_TYPE",METADATA_PICKING_VALUE_STRING:"METADATA_PICKING_VALUE_STRING",METADATA_PICKING_VALUE_COMPONENT_X:"METADATA_PICKING_VALUE_COMPONENT_X",METADATA_PICKING_VALUE_COMPONENT_Y:"METADATA_PICKING_VALUE_COMPONENT_Y",METADATA_PICKING_VALUE_COMPONENT_Z:"METADATA_PICKING_VALUE_COMPONENT_Z",METADATA_PICKING_VALUE_COMPONENT_W:"METADATA_PICKING_VALUE_COMPONENT_W"};su.process=function(e,t,n){let i=e.shaderBuilder;i.addDefine(su.METADATA_PICKING_VALUE_TYPE,"float",de.FRAGMENT),i.addDefine(su.METADATA_PICKING_VALUE_STRING,"0.0",de.FRAGMENT),i.addDefine(su.METADATA_PICKING_VALUE_COMPONENT_X,"0.0",de.FRAGMENT),i.addDefine(su.METADATA_PICKING_VALUE_COMPONENT_Y,"0.0",de.FRAGMENT),i.addDefine(su.METADATA_PICKING_VALUE_COMPONENT_Z,"0.0",de.FRAGMENT),i.addDefine(su.METADATA_PICKING_VALUE_COMPONENT_W,"0.0",de.FRAGMENT),i.addFunction("metadataPickingStage","void metadataPickingStage(Metadata metadata, MetadataClass metadataClass, inout vec4 metadataValues)",de.FRAGMENT),i.addFunctionLines("metadataPickingStage",[`${su.METADATA_PICKING_VALUE_TYPE} value = ${su.METADATA_PICKING_VALUE_TYPE}(${su.METADATA_PICKING_VALUE_STRING});`,`metadataValues.x = ${su.METADATA_PICKING_VALUE_COMPONENT_X};`,`metadataValues.y = ${su.METADATA_PICKING_VALUE_COMPONENT_Y};`,`metadataValues.z = ${su.METADATA_PICKING_VALUE_COMPONENT_Z};`,`metadataValues.w = ${su.METADATA_PICKING_VALUE_COMPONENT_W};`],de.FRAGMENT)};var jf=su;var MB=`void morphTargetsStage(inout ProcessedAttributes attributes) +`)}function CEe(e,t,n,i,r){let o=`HAS_${r}_TEXTURE_TRANSFORM`;e.addDefine(o,void 0,de.FRAGMENT);let s=`${i}Transform`;e.addUniform("mat3",s,de.FRAGMENT),t[s]=function(){return n.transform}}function dut(e,t,n,i,r){let o=`HAS_${r}_TEXTURE_SCALE`;e.addDefine(o,void 0,de.FRAGMENT);let s=`${i}Scale`;e.addUniform("float",s,de.FRAGMENT),t[s]=function(){return n.scale}}function Ju(e,t,n,i,r,o,s){e.addUniform("sampler2D",i,de.FRAGMENT),t[i]=function(){return n.texture??o};let a=`HAS_${r}_TEXTURE`;e.addDefine(a,void 0,de.FRAGMENT);let u=`v_texCoord_${n.texCoord}`,f=`TEXCOORD_${r}`;e.addDefine(f,u,de.FRAGMENT);let d=n.transform;l(d)&&!$.equals(d,$.IDENTITY)&&CEe(e,t,n,i,r);let{scale:p}=n;l(p)&&p!==1&&dut(e,t,n,i,r),uut(e,t,n,i,r,s)}function hut(e,t,n,i,r,o,s,a){let{emissiveFactor:c,emissiveTexture:u,normalTexture:f,occlusionTexture:d}=e;l(c)&&!h.equals(c,cut.DEFAULT_EMISSIVE_FACTOR)&&(n.addUniform("vec3","u_emissiveFactor",de.FRAGMENT),t.u_emissiveFactor=function(){return e.emissiveFactor},n.addDefine("HAS_EMISSIVE_FACTOR",void 0,de.FRAGMENT),l(u)&&!s&&Ju(n,t,u,"u_emissiveTexture","EMISSIVE",o));let p;if(l(e.metallicRoughness)&&l(e.metallicRoughness.baseColorTexture)&&l(e.metallicRoughness.baseColorTexture.constantLod)?p=e.metallicRoughness.baseColorTexture.constantLod:l(e.specularGlossiness)&&l(e.specularGlossiness.diffuseTexture)&&l(e.specularGlossiness.diffuseTexture.constantLod)&&(p=e.specularGlossiness.diffuseTexture.constantLod),l(f)&&!s){let g=f;l(f.constantLod)&&l(p)&&(g=Object.create(Object.getPrototypeOf(f)),Object.assign(g,f),g.constantLod=p),Ju(n,t,g,"u_normalTexture","NORMAL",r,a)}l(d)&&!s&&Ju(n,t,d,"u_occlusionTexture","OCCLUSION",i)}function mut(e,t,n,i,r,o){let{diffuseTexture:s,diffuseFactor:a,specularGlossinessTexture:c,specularFactor:u,glossinessFactor:f}=e;n.addDefine("USE_SPECULAR_GLOSSINESS",void 0,de.FRAGMENT),l(s)&&!r&&Ju(n,t,s,"u_diffuseTexture","DIFFUSE",i,o),l(a)&&!se.equals(a,yQ.DEFAULT_DIFFUSE_FACTOR)&&(n.addUniform("vec4","u_diffuseFactor",de.FRAGMENT),t.u_diffuseFactor=function(){return e.diffuseFactor},n.addDefine("HAS_DIFFUSE_FACTOR",void 0,de.FRAGMENT)),l(c)&&!r&&Ju(n,t,c,"u_specularGlossinessTexture","SPECULAR_GLOSSINESS",i),l(u)&&!h.equals(u,yQ.DEFAULT_SPECULAR_FACTOR)&&(n.addUniform("vec3","u_legacySpecularFactor",de.FRAGMENT),t.u_legacySpecularFactor=function(){return e.specularFactor},n.addDefine("HAS_LEGACY_SPECULAR_FACTOR",void 0,de.FRAGMENT)),l(f)&&f!==yQ.DEFAULT_GLOSSINESS_FACTOR&&(n.addUniform("float","u_glossinessFactor",de.FRAGMENT),t.u_glossinessFactor=function(){return e.glossinessFactor},n.addDefine("HAS_GLOSSINESS_FACTOR",void 0,de.FRAGMENT))}function put(e,t,n,i,r){let{specularTexture:o,specularFactor:s,specularColorTexture:a,specularColorFactor:c}=e;n.addDefine("USE_SPECULAR",void 0,de.FRAGMENT),l(o)&&!r&&Ju(n,t,o,"u_specularTexture","SPECULAR",i),l(s)&&s!==xEe.DEFAULT_SPECULAR_FACTOR&&(n.addUniform("float","u_specularFactor",de.FRAGMENT),t.u_specularFactor=function(){return e.specularFactor},n.addDefine("HAS_SPECULAR_FACTOR",void 0,de.FRAGMENT)),l(a)&&!r&&Ju(n,t,a,"u_specularColorTexture","SPECULAR_COLOR",i),l(c)&&!h.equals(c,xEe.DEFAULT_SPECULAR_COLOR_FACTOR)&&(n.addUniform("vec3","u_specularColorFactor",de.FRAGMENT),t.u_specularColorFactor=function(){return e.specularColorFactor},n.addDefine("HAS_SPECULAR_COLOR_FACTOR",void 0,de.FRAGMENT))}var gut=new h;function _ut(e,t,n,i,r){let{anisotropyStrength:o,anisotropyRotation:s,anisotropyTexture:a}=e;n.addDefine("USE_ANISOTROPY",void 0,de.FRAGMENT),l(a)&&!r&&Ju(n,t,a,"u_anisotropyTexture","ANISOTROPY",i);let c=Math.cos(s),u=Math.sin(s);n.addUniform("vec3","u_anisotropy",de.FRAGMENT),t.u_anisotropy=function(){return h.fromElements(c,u,o,gut)}}function yut(e,t,n,i,r){let{clearcoatFactor:o,clearcoatTexture:s,clearcoatRoughnessFactor:a,clearcoatRoughnessTexture:c,clearcoatNormalTexture:u}=e;n.addDefine("USE_CLEARCOAT",void 0,de.FRAGMENT),l(o)&&o!==TEe.DEFAULT_CLEARCOAT_FACTOR&&(n.addUniform("float","u_clearcoatFactor",de.FRAGMENT),t.u_clearcoatFactor=function(){return e.clearcoatFactor},n.addDefine("HAS_CLEARCOAT_FACTOR",void 0,de.FRAGMENT)),l(s)&&!r&&Ju(n,t,s,"u_clearcoatTexture","CLEARCOAT",i),l(a)&&o!==TEe.DEFAULT_CLEARCOAT_ROUGHNESS_FACTOR&&(n.addUniform("float","u_clearcoatRoughnessFactor",de.FRAGMENT),t.u_clearcoatRoughnessFactor=function(){return e.clearcoatRoughnessFactor},n.addDefine("HAS_CLEARCOAT_ROUGHNESS_FACTOR",void 0,de.FRAGMENT)),l(c)&&!r&&Ju(n,t,c,"u_clearcoatRoughnessTexture","CLEARCOAT_ROUGHNESS",i),l(u)&&!r&&Ju(n,t,u,"u_clearcoatNormalTexture","CLEARCOAT_NORMAL",i)}function Aut(e,t,n,i,r,o){n.addDefine("USE_METALLIC_ROUGHNESS",void 0,de.FRAGMENT);let s=e.baseColorTexture;l(s)&&!r&&Ju(n,t,s,"u_baseColorTexture","BASE_COLOR",i,o);let a=e.baseColorFactor;l(a)&&!se.equals(a,_Q.DEFAULT_BASE_COLOR_FACTOR)&&(n.addUniform("vec4","u_baseColorFactor",de.FRAGMENT),t.u_baseColorFactor=function(){return e.baseColorFactor},n.addDefine("HAS_BASE_COLOR_FACTOR",void 0,de.FRAGMENT));let c=e.metallicRoughnessTexture;l(c)&&!r&&Ju(n,t,c,"u_metallicRoughnessTexture","METALLIC_ROUGHNESS",i);let u=e.metallicFactor;l(u)&&u!==_Q.DEFAULT_METALLIC_FACTOR&&(n.addUniform("float","u_metallicFactor",de.FRAGMENT),t.u_metallicFactor=function(){return e.metallicFactor},n.addDefine("HAS_METALLIC_FACTOR",void 0,de.FRAGMENT));let f=e.roughnessFactor;l(f)&&f!==_Q.DEFAULT_ROUGHNESS_FACTOR&&(n.addUniform("float","u_roughnessFactor",de.FRAGMENT),t.u_roughnessFactor=function(){return e.roughnessFactor},n.addDefine("HAS_ROUGHNESS_FACTOR",void 0,de.FRAGMENT))}var v2=EEe;var uu={name:"MetadataPickingPipelineStage",METADATA_PICKING_ENABLED:"METADATA_PICKING_ENABLED",METADATA_PICKING_VALUE_TYPE:"METADATA_PICKING_VALUE_TYPE",METADATA_PICKING_VALUE_STRING:"METADATA_PICKING_VALUE_STRING",METADATA_PICKING_VALUE_COMPONENT_X:"METADATA_PICKING_VALUE_COMPONENT_X",METADATA_PICKING_VALUE_COMPONENT_Y:"METADATA_PICKING_VALUE_COMPONENT_Y",METADATA_PICKING_VALUE_COMPONENT_Z:"METADATA_PICKING_VALUE_COMPONENT_Z",METADATA_PICKING_VALUE_COMPONENT_W:"METADATA_PICKING_VALUE_COMPONENT_W"};uu.process=function(e,t,n){let i=e.shaderBuilder;i.addDefine(uu.METADATA_PICKING_VALUE_TYPE,"float",de.FRAGMENT),i.addDefine(uu.METADATA_PICKING_VALUE_STRING,"0.0",de.FRAGMENT),i.addDefine(uu.METADATA_PICKING_VALUE_COMPONENT_X,"0.0",de.FRAGMENT),i.addDefine(uu.METADATA_PICKING_VALUE_COMPONENT_Y,"0.0",de.FRAGMENT),i.addDefine(uu.METADATA_PICKING_VALUE_COMPONENT_Z,"0.0",de.FRAGMENT),i.addDefine(uu.METADATA_PICKING_VALUE_COMPONENT_W,"0.0",de.FRAGMENT),i.addFunction("metadataPickingStage","void metadataPickingStage(Metadata metadata, MetadataClass metadataClass, inout vec4 metadataValues)",de.FRAGMENT),i.addFunctionLines("metadataPickingStage",[`${uu.METADATA_PICKING_VALUE_TYPE} value = ${uu.METADATA_PICKING_VALUE_TYPE}(${uu.METADATA_PICKING_VALUE_STRING});`,`metadataValues.x = ${uu.METADATA_PICKING_VALUE_COMPONENT_X};`,`metadataValues.y = ${uu.METADATA_PICKING_VALUE_COMPONENT_Y};`,`metadataValues.z = ${uu.METADATA_PICKING_VALUE_COMPONENT_Z};`,`metadataValues.w = ${uu.METADATA_PICKING_VALUE_COMPONENT_W};`],de.FRAGMENT)};var Kf=uu;var S2=`void morphTargetsStage(inout ProcessedAttributes attributes) { vec3 positionMC = attributes.positionMC; attributes.positionMC = getMorphedPosition(positionMC); @@ -9553,7 +9549,7 @@ vec3 tangentMC = attributes.tangentMC; attributes.tangentMC = getMorphedTangent(tangentMC); #endif } -`;var Bc={name:"MorphTargetsPipelineStage",FUNCTION_ID_GET_MORPHED_POSITION:"getMorphedPosition",FUNCTION_SIGNATURE_GET_MORPHED_POSITION:"vec3 getMorphedPosition(in vec3 position)",FUNCTION_ID_GET_MORPHED_NORMAL:"getMorphedNormal",FUNCTION_SIGNATURE_GET_MORPHED_NORMAL:"vec3 getMorphedNormal(in vec3 normal)",FUNCTION_ID_GET_MORPHED_TANGENT:"getMorphedTangent",FUNCTION_SIGNATURE_GET_MORPHED_TANGENT:"vec3 getMorphedTangent(in vec3 tangent)"};Bc.process=function(e,t){let n=e.shaderBuilder;n.addDefine("HAS_MORPH_TARGETS",void 0,de.VERTEX),Bst(n);let i=t.morphTargets.length;for(let a=0;a<i;a++){let c=t.morphTargets[a].attributes,u=c.length;for(let f=0;f<u;f++){let d=c[f],p=d.semantic;p!==ct.POSITION&&p!==ct.NORMAL&&p!==ct.TANGENT||(Mst(e,d,e.attributeIndex,a),e.attributeIndex++)}}kst(n);let o=e.runtimeNode.morphWeights.length;n.addUniform("float",`u_morphWeights[${o}]`,de.VERTEX),n.addVertexLines(MB);let s={u_morphWeights:function(){return e.runtimeNode.morphWeights}};e.uniformMap=Ot(s,e.uniformMap)};var Ost={attributeString:void 0,functionId:void 0};function Mst(e,t,n,i){let r=e.shaderBuilder;Nst(e,t,n);let o=Lst(t,Ost);Fst(r,o,i)}function Nst(e,t,n){let i={index:n,value:l(t.buffer)?void 0:t.constant,vertexBuffer:t.buffer,componentsPerAttribute:Vt.getNumberOfComponents(t.type),componentDatatype:t.componentDatatype,offsetInBytes:t.byteOffset,strideInBytes:t.byteStride,normalize:t.normalized};e.attributes.push(i)}function Lst(e,t){switch(e.semantic){case ct.POSITION:t.attributeString="Position",t.functionId=Bc.FUNCTION_ID_GET_MORPHED_POSITION;break;case ct.NORMAL:t.attributeString="Normal",t.functionId=Bc.FUNCTION_ID_GET_MORPHED_NORMAL;break;case ct.TANGENT:t.attributeString="Tangent",t.functionId=Bc.FUNCTION_ID_GET_MORPHED_TANGENT;break;default:break}return t}function Fst(e,t,n){let i=t.attributeString,r=`a_target${i}_${n}`,o=`morphed${i} += u_morphWeights[${n}] * a_target${i}_${n};`;e.addAttribute("vec3",r),e.addFunctionLines(t.functionId,[o])}function Bst(e){e.addFunction(Bc.FUNCTION_ID_GET_MORPHED_POSITION,Bc.FUNCTION_SIGNATURE_GET_MORPHED_POSITION,de.VERTEX),e.addFunctionLines(Bc.FUNCTION_ID_GET_MORPHED_POSITION,["vec3 morphedPosition = position;"]),e.addFunction(Bc.FUNCTION_ID_GET_MORPHED_NORMAL,Bc.FUNCTION_SIGNATURE_GET_MORPHED_NORMAL,de.VERTEX),e.addFunctionLines(Bc.FUNCTION_ID_GET_MORPHED_NORMAL,["vec3 morphedNormal = normal;"]),e.addFunction(Bc.FUNCTION_ID_GET_MORPHED_TANGENT,Bc.FUNCTION_SIGNATURE_GET_MORPHED_TANGENT,de.VERTEX),e.addFunctionLines(Bc.FUNCTION_ID_GET_MORPHED_TANGENT,["vec3 morphedTangent = tangent;"])}function kst(e){e.addFunctionLines(Bc.FUNCTION_ID_GET_MORPHED_POSITION,["return morphedPosition;"]),e.addFunctionLines(Bc.FUNCTION_ID_GET_MORPHED_NORMAL,["return morphedNormal;"]),e.addFunctionLines(Bc.FUNCTION_ID_GET_MORPHED_TANGENT,["return morphedTangent;"])}var NB=Bc;var obe={name:"PickingPipelineStage"};function SZ(e){return`vec4(rgba8UnormToUint32(${e}), isEdge ? 1.0 : 0.0, -v_positionEC.z, 0.0)`}obe.process=function(e,t,n){let i=n.context,r=e.runtimeNode,o=e.shaderBuilder,s=e.model,a=r.node.instances;if(e.hasPropertyTable)Ust(e,t,a,i);else if(l(a))zst(e,i);else{let c=sbe(e),u=i.createPickId(c);s._pipelineResources.push(u),s._pickIds.push(u),o.addUniform("vec4","czm_pickColor",de.FRAGMENT);let f=e.uniformMap;f.czm_pickColor=function(){return u.color},e.pickId="czm_pickColor",e.snapId=SZ(e.pickId)}!l(s.classificationType)&&s.hasDrapedVectors()&&(e.pickId=`vectorPickColorOver(${e.pickId})`)};function sbe(e,t){let n=e.model;if(l(n.pickObject))return n.pickObject;let i={model:n,node:e.runtimeNode,primitive:e.runtimePrimitive},r;if(Wo.is3DTiles(n.type)){let o=n.content;r={content:o,primitive:o.tileset,detail:i}}else r={primitive:n,detail:i};return r.id=n.id,l(t)&&(r.instanceId=t),r}function Ust(e,t,n){let i=e.model,r,o,s=i.featureIdLabel,a=i.instanceFeatureIdLabel;l(i.featureTableId)?r=i.featureTableId:l(n)?(o=xt.getFeatureIdsByLabel(n.featureIds,a),r=o.propertyTableId):(o=xt.getFeatureIdsByLabel(t.featureIds,s),r=o.propertyTableId);let c=i.featureTables[r];e.shaderBuilder.addUniform("sampler2D","model_pickTexture",de.FRAGMENT);let f=c.batchTexture;e.uniformMap.model_pickTexture=function(){return f.pickTexture??f.defaultTexture},e.pickId="((selectedFeature.id < int(model_featuresLength)) ? texture(model_pickTexture, selectedFeature.st) : vec4(0.0))",e.snapId=SZ(e.pickId)}function zst(e,t){let n=e.instanceCount,i=new Array(n),r=new Uint8Array(n*4),o=e.model,s=o._pipelineResources;for(let d=0;d<n;d++){let p=sbe(e,d),g=t.createPickId(p);s.push(g),i[d]=g;let m=g.color;r[d*4+0]=z.floatToByte(m.red),r[d*4+1]=z.floatToByte(m.green),r[d*4+2]=z.floatToByte(m.blue),r[d*4+3]=z.floatToByte(m.alpha)}o._pickIds=i;let a=tt.createVertexBuffer({context:t,typedArray:r,usage:Me.STATIC_DRAW});a.vertexArrayDestroyable=!1,o.statistics.addBuffer(a,!1),s.push(a);let u={index:e.attributeIndex++,vertexBuffer:a,componentsPerAttribute:4,componentDatatype:Y.UNSIGNED_BYTE,normalize:!0,offsetInBytes:0,strideInBytes:0,instanceDivisor:1};e.attributes.push(u);let f=e.shaderBuilder;f.addDefine("USE_PICKING",void 0,de.BOTH),f.addAttribute("vec4","a_pickColor"),f.addVarying("vec4","v_pickColor"),e.pickId="v_pickColor",e.snapId=SZ(e.pickId)}var LB=obe;var abe={ADD:0,REPLACE:1};Object.freeze(abe);var yo=abe;var FB=`float getPointSizeFromAttenuation(vec3 positionEC) { +`;var Bc={name:"MorphTargetsPipelineStage",FUNCTION_ID_GET_MORPHED_POSITION:"getMorphedPosition",FUNCTION_SIGNATURE_GET_MORPHED_POSITION:"vec3 getMorphedPosition(in vec3 position)",FUNCTION_ID_GET_MORPHED_NORMAL:"getMorphedNormal",FUNCTION_SIGNATURE_GET_MORPHED_NORMAL:"vec3 getMorphedNormal(in vec3 normal)",FUNCTION_ID_GET_MORPHED_TANGENT:"getMorphedTangent",FUNCTION_SIGNATURE_GET_MORPHED_TANGENT:"vec3 getMorphedTangent(in vec3 tangent)"};Bc.process=function(e,t){let n=e.shaderBuilder;n.addDefine("HAS_MORPH_TARGETS",void 0,de.VERTEX),vut(n);let i=t.morphTargets.length;for(let a=0;a<i;a++){let c=t.morphTargets[a].attributes,u=c.length;for(let f=0;f<u;f++){let d=c[f],p=d.semantic;p!==ct.POSITION&&p!==ct.NORMAL&&p!==ct.TANGENT||(xut(e,d,e.attributeIndex,a),e.attributeIndex++)}}Sut(n);let o=e.runtimeNode.morphWeights.length;n.addUniform("float",`u_morphWeights[${o}]`,de.VERTEX),n.addVertexLines(S2);let s={u_morphWeights:function(){return e.runtimeNode.morphWeights}};e.uniformMap=Ot(s,e.uniformMap)};var but={attributeString:void 0,functionId:void 0};function xut(e,t,n,i){let r=e.shaderBuilder;Tut(e,t,n);let o=Eut(t,but);Cut(r,o,i)}function Tut(e,t,n){let i={index:n,value:l(t.buffer)?void 0:t.constant,vertexBuffer:t.buffer,componentsPerAttribute:Vt.getNumberOfComponents(t.type),componentDatatype:t.componentDatatype,offsetInBytes:t.byteOffset,strideInBytes:t.byteStride,normalize:t.normalized};e.attributes.push(i)}function Eut(e,t){switch(e.semantic){case ct.POSITION:t.attributeString="Position",t.functionId=Bc.FUNCTION_ID_GET_MORPHED_POSITION;break;case ct.NORMAL:t.attributeString="Normal",t.functionId=Bc.FUNCTION_ID_GET_MORPHED_NORMAL;break;case ct.TANGENT:t.attributeString="Tangent",t.functionId=Bc.FUNCTION_ID_GET_MORPHED_TANGENT;break;default:break}return t}function Cut(e,t,n){let i=t.attributeString,r=`a_target${i}_${n}`,o=`morphed${i} += u_morphWeights[${n}] * a_target${i}_${n};`;e.addAttribute("vec3",r),e.addFunctionLines(t.functionId,[o])}function vut(e){e.addFunction(Bc.FUNCTION_ID_GET_MORPHED_POSITION,Bc.FUNCTION_SIGNATURE_GET_MORPHED_POSITION,de.VERTEX),e.addFunctionLines(Bc.FUNCTION_ID_GET_MORPHED_POSITION,["vec3 morphedPosition = position;"]),e.addFunction(Bc.FUNCTION_ID_GET_MORPHED_NORMAL,Bc.FUNCTION_SIGNATURE_GET_MORPHED_NORMAL,de.VERTEX),e.addFunctionLines(Bc.FUNCTION_ID_GET_MORPHED_NORMAL,["vec3 morphedNormal = normal;"]),e.addFunction(Bc.FUNCTION_ID_GET_MORPHED_TANGENT,Bc.FUNCTION_SIGNATURE_GET_MORPHED_TANGENT,de.VERTEX),e.addFunctionLines(Bc.FUNCTION_ID_GET_MORPHED_TANGENT,["vec3 morphedTangent = tangent;"])}function Sut(e){e.addFunctionLines(Bc.FUNCTION_ID_GET_MORPHED_POSITION,["return morphedPosition;"]),e.addFunctionLines(Bc.FUNCTION_ID_GET_MORPHED_NORMAL,["return morphedNormal;"]),e.addFunctionLines(Bc.FUNCTION_ID_GET_MORPHED_TANGENT,["return morphedTangent;"])}var w2=Bc;var vEe={name:"PickingPipelineStage"};function AQ(e){return`vec4(rgba8UnormToUint32(${e}), isEdge ? 1.0 : 0.0, -v_positionEC.z, 0.0)`}vEe.process=function(e,t,n){let i=n.context,r=e.runtimeNode,o=e.shaderBuilder,s=e.model,a=r.node.instances;if(e.hasPropertyTable)wut(e,t,a,i);else if(l(a))Iut(e,i);else{let c=SEe(e),u=i.createPickId(c);s._pipelineResources.push(u),s._pickIds.push(u),o.addUniform("vec4","czm_pickColor",de.FRAGMENT);let f=e.uniformMap;f.czm_pickColor=function(){return u.color},e.pickId="czm_pickColor",e.snapId=AQ(e.pickId)}!l(s.classificationType)&&s.hasDrapedVectors()&&(e.pickId=`vectorPickColorOver(${e.pickId})`)};function SEe(e,t){let n=e.model;if(l(n.pickObject))return n.pickObject;let i={model:n,node:e.runtimeNode,primitive:e.runtimePrimitive},r;if(qo.is3DTiles(n.type)){let o=n.content;r={content:o,primitive:o.tileset,detail:i}}else r={primitive:n,detail:i};return r.id=n.id,l(t)&&(r.instanceId=t),r}function wut(e,t,n){let i=e.model,r,o,s=i.featureIdLabel,a=i.instanceFeatureIdLabel;l(i.featureTableId)?r=i.featureTableId:l(n)?(o=xt.getFeatureIdsByLabel(n.featureIds,a),r=o.propertyTableId):(o=xt.getFeatureIdsByLabel(t.featureIds,s),r=o.propertyTableId);let c=i.featureTables[r];e.shaderBuilder.addUniform("sampler2D","model_pickTexture",de.FRAGMENT);let f=c.batchTexture;e.uniformMap.model_pickTexture=function(){return f.pickTexture??f.defaultTexture},e.pickId="((selectedFeature.id < int(model_featuresLength)) ? texture(model_pickTexture, selectedFeature.st) : vec4(0.0))",e.snapId=AQ(e.pickId)}function Iut(e,t){let n=e.instanceCount,i=new Array(n),r=new Uint8Array(n*4),o=e.model,s=o._pipelineResources;for(let d=0;d<n;d++){let p=SEe(e,d),g=t.createPickId(p);s.push(g),i[d]=g;let m=g.color;r[d*4+0]=z.floatToByte(m.red),r[d*4+1]=z.floatToByte(m.green),r[d*4+2]=z.floatToByte(m.blue),r[d*4+3]=z.floatToByte(m.alpha)}o._pickIds=i;let a=tt.createVertexBuffer({context:t,typedArray:r,usage:Me.STATIC_DRAW});a.vertexArrayDestroyable=!1,o.statistics.addBuffer(a,!1),s.push(a);let u={index:e.attributeIndex++,vertexBuffer:a,componentsPerAttribute:4,componentDatatype:Y.UNSIGNED_BYTE,normalize:!0,offsetInBytes:0,strideInBytes:0,instanceDivisor:1};e.attributes.push(u);let f=e.shaderBuilder;f.addDefine("USE_PICKING",void 0,de.BOTH),f.addAttribute("vec4","a_pickColor"),f.addVarying("vec4","v_pickColor"),e.pickId="v_pickColor",e.snapId=AQ(e.pickId)}var I2=vEe;var wEe={ADD:0,REPLACE:1};Object.freeze(wEe);var Ao=wEe;var P2=`float getPointSizeFromAttenuation(vec3 positionEC) { float pointSize = model_pointCloudParameters.x; float geometricError = model_pointCloudParameters.y; float depthMultiplier = model_pointCloudParameters.z; @@ -9591,10 +9587,10 @@ return 1.0; #endif } #endif -`;var Vst=new se,lbe={name:"PointCloudStylingPipelineStage"};lbe.process=function(e,t,n){let i=e.shaderBuilder,r=e.model,o=r.style,s=r.structuralMetadata,a=l(s)?s.propertyAttributes:void 0,c=l(r.featureTableId)&&r.featureTables[r.featureTableId].featuresLength>0,u=!l(a)&&c;if(l(o)&&!u){let y=Wst(a),A=qst(o,y);Yst(i,A);let x=Xst(A).indexOf("normalMC")>=0,T=xt.getAttributeBySemantic(t,ct.NORMAL);if(x&&!T)throw new oe("Style references the NORMAL semantic but the point cloud does not have normals");i.addDefine("COMPUTE_POSITION_WC_STYLE",void 0,de.VERTEX),A.styleTranslucent&&(e.alphaOptions.pass=Ie.TRANSLUCENT)}let f=r.pointCloudShading;f.attenuation&&i.addDefine("HAS_POINT_CLOUD_ATTENUATION",void 0,de.VERTEX),f.backFaceCulling&&i.addDefine("HAS_POINT_CLOUD_BACK_FACE_CULLING",void 0,de.VERTEX);let d,p,g;Wo.is3DTiles(r.type)&&(p=!0,d=r.content,g=d.tile.refine===yo.ADD),i.addUniform("vec4","model_pointCloudParameters",de.VERTEX),i.addVertexLines(FB);let m=e.uniformMap;m.model_pointCloudParameters=function(){let y=Vst,A=1;p&&(A=g?5:d.tileset.memoryAdjustedScreenSpaceError),y.x=f.maximumAttenuation??A,y.x*=n.pixelRatio;let b=jst(e,t,f,d);y.y=b*f.geometricErrorScale;let x=n.context,T=n.camera.frustum,E;return n.mode===re.SCENE2D||T instanceof gn?E=Number.POSITIVE_INFINITY:E=x.drawingBufferHeight/n.camera.frustum.sseDenominator,y.z=E,p&&(y.w=d.tileset.timeSinceLoad),y}};var cbe=new h;function jst(e,t,n,i){if(l(i)){let f=i.tile.geometricError;if(f>0)return f}if(l(n.baseResolution))return n.baseResolution;let r=xt.getAttributeBySemantic(t,ct.POSITION),o=r.count,s=e.runtimeNode.transform,a=h.subtract(r.max,r.min,cbe);a=N.multiplyByPointAsVector(s,a,cbe);let c=a.x*a.y*a.z;return D.cbrt(c/o)}var Hst={colorStyleFunction:void 0,showStyleFunction:void 0,pointSizeStyleFunction:void 0,styleTranslucent:!1},Gst={POSITION:"attributes.positionMC",POSITION_ABSOLUTE:"v_positionWC",COLOR:"attributes.color_0",NORMAL:"attributes.normalMC"};function Wst(e){let t=Je(Gst);if(!l(e))return t;for(let n=0;n<e.length;n++){let r=e[n].properties;for(let o in r)r.hasOwnProperty(o)&&(t[o]=`metadata.${o}`)}return t}var wZ="ProcessedAttributes attributes, Metadata metadata, float tiles3d_tileset_time";function qst(e,t){let n=Hst,i={translucent:!1};return n.colorStyleFunction=e.getColorShaderFunction(`getColorFromStyle(${wZ})`,t,i),n.showStyleFunction=e.getShowShaderFunction(`getShowFromStyle(${wZ})`,t,i),n.pointSizeStyleFunction=e.getPointSizeShaderFunction(`getPointSizeFromStyle(${wZ})`,t,i),n.styleTranslucent=l(n.colorStyleFunction)&&i.translucent,n}function Yst(e,t){let n=t.colorStyleFunction;l(n)&&(e.addDefine("HAS_POINT_CLOUD_COLOR_STYLE",void 0,de.BOTH),e.addVertexLines(n),e.addVarying("vec4","v_pointCloudColor"));let i=t.showStyleFunction;l(i)&&(e.addDefine("HAS_POINT_CLOUD_SHOW_STYLE",void 0,de.BOTH),e.addVertexLines(i),e.addVarying("float","v_pointCloudShow"));let r=t.pointSizeStyleFunction;l(r)&&(e.addDefine("HAS_POINT_CLOUD_POINT_SIZE_STYLE",void 0,de.VERTEX),e.addVertexLines(r))}function IZ(e,t){let n=/attributes\.(\w+)/g,i=n.exec(e);for(;i!==null;){let r=i[1];t.indexOf(r)===-1&&t.push(r),i=n.exec(e)}}function Xst(e){let t=e.colorStyleFunction,n=e.showStyleFunction,i=e.pointSizeStyleFunction,r=[];return l(t)&&IZ(t,r),l(n)&&IZ(n,r),l(i)&&IZ(i,r),r}var BB=lbe;var kB=`void primitiveOutlineStage() { +`;var Put=new se,PEe={name:"PointCloudStylingPipelineStage"};PEe.process=function(e,t,n){let i=e.shaderBuilder,r=e.model,o=r.style,s=r.structuralMetadata,a=l(s)?s.propertyAttributes:void 0,c=l(r.featureTableId)&&r.featureTables[r.featureTableId].featuresLength>0,u=!l(a)&&c;if(l(o)&&!u){let y=Mut(a),A=Nut(o,y);Lut(i,A);let x=Fut(A).indexOf("normalMC")>=0,T=xt.getAttributeBySemantic(t,ct.NORMAL);if(x&&!T)throw new oe("Style references the NORMAL semantic but the point cloud does not have normals");i.addDefine("COMPUTE_POSITION_WC_STYLE",void 0,de.VERTEX),A.styleTranslucent&&(e.alphaOptions.pass=Ie.TRANSLUCENT)}let f=r.pointCloudShading;f.attenuation&&i.addDefine("HAS_POINT_CLOUD_ATTENUATION",void 0,de.VERTEX),f.backFaceCulling&&i.addDefine("HAS_POINT_CLOUD_BACK_FACE_CULLING",void 0,de.VERTEX);let d,p,g;qo.is3DTiles(r.type)&&(p=!0,d=r.content,g=d.tile.refine===Ao.ADD),i.addUniform("vec4","model_pointCloudParameters",de.VERTEX),i.addVertexLines(P2);let m=e.uniformMap;m.model_pointCloudParameters=function(){let y=Put,A=1;p&&(A=g?5:d.tileset.memoryAdjustedScreenSpaceError),y.x=f.maximumAttenuation??A,y.x*=n.pixelRatio;let b=Dut(e,t,f,d);y.y=b*f.geometricErrorScale;let x=n.context,T=n.camera.frustum,E;return n.mode===re.SCENE2D||T instanceof gn?E=Number.POSITIVE_INFINITY:E=x.drawingBufferHeight/n.camera.frustum.sseDenominator,y.z=E,p&&(y.w=d.tileset.timeSinceLoad),y}};var IEe=new h;function Dut(e,t,n,i){if(l(i)){let f=i.tile.geometricError;if(f>0)return f}if(l(n.baseResolution))return n.baseResolution;let r=xt.getAttributeBySemantic(t,ct.POSITION),o=r.count,s=e.runtimeNode.transform,a=h.subtract(r.max,r.min,IEe);a=N.multiplyByPointAsVector(s,a,IEe);let c=a.x*a.y*a.z;return D.cbrt(c/o)}var Rut={colorStyleFunction:void 0,showStyleFunction:void 0,pointSizeStyleFunction:void 0,styleTranslucent:!1},Out={POSITION:"attributes.positionMC",POSITION_ABSOLUTE:"v_positionWC",COLOR:"attributes.color_0",NORMAL:"attributes.normalMC"};function Mut(e){let t=Je(Out);if(!l(e))return t;for(let n=0;n<e.length;n++){let r=e[n].properties;for(let o in r)r.hasOwnProperty(o)&&(t[o]=`metadata.${o}`)}return t}var bQ="ProcessedAttributes attributes, Metadata metadata, float tiles3d_tileset_time";function Nut(e,t){let n=Rut,i={translucent:!1};return n.colorStyleFunction=e.getColorShaderFunction(`getColorFromStyle(${bQ})`,t,i),n.showStyleFunction=e.getShowShaderFunction(`getShowFromStyle(${bQ})`,t,i),n.pointSizeStyleFunction=e.getPointSizeShaderFunction(`getPointSizeFromStyle(${bQ})`,t,i),n.styleTranslucent=l(n.colorStyleFunction)&&i.translucent,n}function Lut(e,t){let n=t.colorStyleFunction;l(n)&&(e.addDefine("HAS_POINT_CLOUD_COLOR_STYLE",void 0,de.BOTH),e.addVertexLines(n),e.addVarying("vec4","v_pointCloudColor"));let i=t.showStyleFunction;l(i)&&(e.addDefine("HAS_POINT_CLOUD_SHOW_STYLE",void 0,de.BOTH),e.addVertexLines(i),e.addVarying("float","v_pointCloudShow"));let r=t.pointSizeStyleFunction;l(r)&&(e.addDefine("HAS_POINT_CLOUD_POINT_SIZE_STYLE",void 0,de.VERTEX),e.addVertexLines(r))}function xQ(e,t){let n=/attributes\.(\w+)/g,i=n.exec(e);for(;i!==null;){let r=i[1];t.indexOf(r)===-1&&t.push(r),i=n.exec(e)}}function Fut(e){let t=e.colorStyleFunction,n=e.showStyleFunction,i=e.pointSizeStyleFunction,r=[];return l(t)&&xQ(t,r),l(n)&&xQ(n,r),l(i)&&xQ(i,r),r}var D2=PEe;var R2=`void primitiveOutlineStage() { v_outlineCoordinates = a_outlineCoordinates; } -`;var UB=`void primitiveOutlineStage(inout czm_modelMaterial material) { +`;var O2=`void primitiveOutlineStage(inout czm_modelMaterial material) { if (!model_showOutline) { return; } @@ -9607,7 +9603,7 @@ texture(model_outlineTexture, vec2(v_outlineCoordinates.z, 0.5)).r; float outlineness = max(outlineX, max(outlineY, outlineZ)); material.diffuse = mix(material.diffuse, model_outlineColor.rgb, model_outlineColor.a * outlineness); } -`;var ube={name:"PrimitiveOutlinePipelineStage"};ube.process=function(e,t,n){let i=e.shaderBuilder,r=e.uniformMap;i.addDefine("HAS_PRIMITIVE_OUTLINE",void 0,de.BOTH),i.addAttribute("vec3","a_outlineCoordinates"),i.addVarying("vec3","v_outlineCoordinates");let o=t.outlineCoordinates,s={index:e.attributeIndex++,vertexBuffer:o.buffer,componentsPerAttribute:Vt.getNumberOfComponents(o.type),componentDatatype:o.componentDatatype,offsetInBytes:o.byteOffset,strideInBytes:o.byteStride,normalize:o.normalized};e.attributes.push(s),i.addUniform("sampler2D","model_outlineTexture",de.FRAGMENT);let a=gT.createTexture(n.context);r.model_outlineTexture=function(){return a};let c=e.model;i.addUniform("vec4","model_outlineColor",de.FRAGMENT),r.model_outlineColor=function(){return c.outlineColor},i.addUniform("bool","model_showOutline",de.FRAGMENT),r.model_showOutline=function(){return c.showOutline},i.addVertexLines(kB),i.addFragmentLines(UB)};var zB=ube;var fbe={name:"PrimitiveStatisticsPipelineStage",_countGeometry:dbe,_count2DPositions:hbe,_countMorphTargetAttributes:mbe,_countMaterialTextures:pbe,_countFeatureIdTextures:gbe,_countBinaryMetadata:_be};fbe.process=function(e,t,n){let i=e.model,r=i.statistics;dbe(r,t),hbe(r,e.runtimePrimitive),mbe(r,t),pbe(r,t.material),gbe(r,t.featureIds),_be(r,i)};function dbe(e,t){let n=l(t.indices)?t.indices.count:xt.getAttributeBySemantic(t,"POSITION").count,i=t.primitiveType;i===Oe.POINTS?e.pointsLength+=n:Oe.isTriangles(i)&&(e.trianglesLength+=Kst(i,n));let r=t.attributes,o=r.length;for(let c=0;c<o;c++){let u=r[c];if(l(u.buffer)){let f=l(u.typedArray);e.addBuffer(u.buffer,f)}}let s=t.outlineCoordinates;l(s)&&l(s.buffer)&&e.addBuffer(s.buffer,!1);let a=t.indices;if(l(a)&&l(a.buffer)){let c=l(a.typedArray);e.addBuffer(a.buffer,c)}}function Kst(e,t){switch(e){case Oe.TRIANGLES:return t/3;case Oe.TRIANGLE_STRIP:case Oe.TRIANGLE_FAN:return Math.max(t-2,0);default:return 0}}function hbe(e,t){let n=t.positionBuffer2D;l(n)&&e.addBuffer(n,!0)}function mbe(e,t){let n=t.morphTargets;if(!l(n))return;let i=!1,r=n.length;for(let o=0;o<r;o++){let s=n[o].attributes,a=s.length;for(let c=0;c<a;c++){let u=s[c];l(u.buffer)&&e.addBuffer(u.buffer,i)}}}function pbe(e,t){let n=$st(t),i=n.length;for(let r=0;r<i;r++){let o=n[r];l(o)&&l(o.texture)&&e.addTexture(o.texture)}}function $st(e){let t=e.metallicRoughness,n=[e.emissiveTexture,e.normalTexture,e.occlusionTexture,t.baseColorTexture,t.metallicRoughnessTexture],i=e.specularGlossiness;return l(i)&&(n.push(i.diffuseTexture),n.push(i.specularGlossinessTexture)),n}function gbe(e,t){let n=t.length;for(let i=0;i<n;i++){let r=t[i];if(r instanceof Cn.FeatureIdTexture){let o=r.textureReader;l(o.texture)&&e.addTexture(o.texture)}}}function _be(e,t){let n=t.structuralMetadata;l(n)&&(Jst(e,n),e.propertyTablesByteLength+=n.propertyTablesByteLength);let i=t.featureTables;if(!l(i))return;let r=i.length;for(let o=0;o<r;o++){let s=i[o];e.addBatchTexture(s.batchTexture)}}function Jst(e,t){let n=t.propertyTextures;if(!l(n))return;let i=n.length;for(let r=0;r<i;r++){let s=n[r].properties;for(let a in s)if(s.hasOwnProperty(a)){let u=s[a].textureReader;l(u.texture)&&e.addTexture(u.texture)}}}var VB=fbe;var Zst=new N,Qst=new N,ybe={name:"SceneMode2DPipelineStage"};ybe.process=function(e,t,n){let i=xt.getAttributeBySemantic(t,ct.POSITION),r=e.shaderBuilder,o=e.model,s=o.sceneGraph.computedModelMatrix,a=e.runtimeNode.computedTransform,c=N.multiplyTransformation(s,a,Zst),u=nat(e,c,n),f=e.runtimePrimitive;f.boundingSphere2D=u;let d=e.runtimeNode.node.instances;if(l(d))return;if(l(i.typedArray)){let y=oat(i,c,u,n);f.positionBuffer2D=y,o._modelResources.push(y),i.typedArray=void 0}r.addDefine("USE_2D_POSITIONS",void 0,de.VERTEX),r.addUniform("mat4","u_modelView2D",de.VERTEX);let p=N.fromTranslation(u.center,new N),g=n.context,m={u_modelView2D:function(){return N.multiplyTransformation(g.uniformState.view,p,Qst)}};e.uniformMap=Ot(m,e.uniformMap)};var eat=new h,tat=new h;function nat(e,t,n){let i=N.multiplyByPoint(t,e.positionMin,eat),r=dr.computeActualEllipsoidPosition(n,i,i),o=N.multiplyByPoint(t,e.positionMax,tat),s=dr.computeActualEllipsoidPosition(n,o,o);return ue.fromCornerPoints(r,s,new ue)}var Abe=new h;function iat(e,t){let n=e.length,i=new Float32Array(n),r=t.quantizedVolumeOffset,o=t.quantizedVolumeStepSize;for(let s=0;s<n;s+=3){let a=h.fromArray(e,s,Abe),c=h.multiplyComponents(a,o,a),u=h.add(c,r,c);i[s]=u.x,i[s+1]=u.y,i[s+2]=u.z}return i}function rat(e,t,n,i){let r;l(e.quantization)?r=iat(e.typedArray,e.quantization):r=e.typedArray.slice();let o=e.byteOffset/Float32Array.BYTES_PER_ELEMENT,s=r.length,a=l(e.byteStride)?e.byteStride/Float32Array.BYTES_PER_ELEMENT:3;for(let c=o;c<s;c+=a){let u=h.fromArray(r,c,Abe);if(isNaN(u.x)||isNaN(u.y)||isNaN(u.z))continue;let f=N.multiplyByPoint(t,u,u),d=dr.computeActualEllipsoidPosition(i,f,f),p=h.subtract(d,n,d);r[c]=p.x,r[c+1]=p.y,r[c+2]=p.z}return r}function oat(e,t,n,i){let r=Je(i);r.mode=re.COLUMBUS_VIEW;let o=n.center,s=rat(e,t,o,r),a=tt.createVertexBuffer({context:i.context,typedArray:s,usage:Me.STATIC_DRAW});return a.vertexArrayDestroyable=!1,a}var jB=ybe;var HB=`void skinningStage(inout ProcessedAttributes attributes) +`;var DEe={name:"PrimitiveOutlinePipelineStage"};DEe.process=function(e,t,n){let i=e.shaderBuilder,r=e.uniformMap;i.addDefine("HAS_PRIMITIVE_OUTLINE",void 0,de.BOTH),i.addAttribute("vec3","a_outlineCoordinates"),i.addVarying("vec3","v_outlineCoordinates");let o=t.outlineCoordinates,s={index:e.attributeIndex++,vertexBuffer:o.buffer,componentsPerAttribute:Vt.getNumberOfComponents(o.type),componentDatatype:o.componentDatatype,offsetInBytes:o.byteOffset,strideInBytes:o.byteStride,normalize:o.normalized};e.attributes.push(s),i.addUniform("sampler2D","model_outlineTexture",de.FRAGMENT);let a=OT.createTexture(n.context);r.model_outlineTexture=function(){return a};let c=e.model;i.addUniform("vec4","model_outlineColor",de.FRAGMENT),r.model_outlineColor=function(){return c.outlineColor},i.addUniform("bool","model_showOutline",de.FRAGMENT),r.model_showOutline=function(){return c.showOutline},i.addVertexLines(R2),i.addFragmentLines(O2)};var M2=DEe;var REe={name:"PrimitiveStatisticsPipelineStage",_countGeometry:OEe,_count2DPositions:MEe,_countMorphTargetAttributes:NEe,_countMaterialTextures:LEe,_countFeatureIdTextures:FEe,_countBinaryMetadata:BEe};REe.process=function(e,t,n){let i=e.model,r=i.statistics;OEe(r,t),MEe(r,e.runtimePrimitive),NEe(r,t),LEe(r,t.material),FEe(r,t.featureIds),BEe(r,i)};function OEe(e,t){let n=l(t.indices)?t.indices.count:xt.getAttributeBySemantic(t,"POSITION").count,i=t.primitiveType;i===Oe.POINTS?e.pointsLength+=n:Oe.isTriangles(i)&&(e.trianglesLength+=But(i,n));let r=t.attributes,o=r.length;for(let c=0;c<o;c++){let u=r[c];if(l(u.buffer)){let f=l(u.typedArray);e.addBuffer(u.buffer,f)}}let s=t.outlineCoordinates;l(s)&&l(s.buffer)&&e.addBuffer(s.buffer,!1);let a=t.indices;if(l(a)&&l(a.buffer)){let c=l(a.typedArray);e.addBuffer(a.buffer,c)}}function But(e,t){switch(e){case Oe.TRIANGLES:return t/3;case Oe.TRIANGLE_STRIP:case Oe.TRIANGLE_FAN:return Math.max(t-2,0);default:return 0}}function MEe(e,t){let n=t.positionBuffer2D;l(n)&&e.addBuffer(n,!0)}function NEe(e,t){let n=t.morphTargets;if(!l(n))return;let i=!1,r=n.length;for(let o=0;o<r;o++){let s=n[o].attributes,a=s.length;for(let c=0;c<a;c++){let u=s[c];l(u.buffer)&&e.addBuffer(u.buffer,i)}}}function LEe(e,t){let n=kut(t),i=n.length;for(let r=0;r<i;r++){let o=n[r];l(o)&&l(o.texture)&&e.addTexture(o.texture)}}function kut(e){let t=e.metallicRoughness,n=[e.emissiveTexture,e.normalTexture,e.occlusionTexture,t.baseColorTexture,t.metallicRoughnessTexture],i=e.specularGlossiness;return l(i)&&(n.push(i.diffuseTexture),n.push(i.specularGlossinessTexture)),n}function FEe(e,t){let n=t.length;for(let i=0;i<n;i++){let r=t[i];if(r instanceof Cn.FeatureIdTexture){let o=r.textureReader;l(o.texture)&&e.addTexture(o.texture)}}}function BEe(e,t){let n=t.structuralMetadata;l(n)&&(Uut(e,n),e.propertyTablesByteLength+=n.propertyTablesByteLength);let i=t.featureTables;if(!l(i))return;let r=i.length;for(let o=0;o<r;o++){let s=i[o];e.addBatchTexture(s.batchTexture)}}function Uut(e,t){let n=t.propertyTextures;if(!l(n))return;let i=n.length;for(let r=0;r<i;r++){let s=n[r].properties;for(let a in s)if(s.hasOwnProperty(a)){let u=s[a].textureReader;l(u.texture)&&e.addTexture(u.texture)}}}var N2=REe;var zut=new N,Vut=new N,kEe={name:"SceneMode2DPipelineStage"};kEe.process=function(e,t,n){let i=xt.getAttributeBySemantic(t,ct.POSITION),r=e.shaderBuilder,o=e.model,s=o.sceneGraph.computedModelMatrix,a=e.runtimeNode.computedTransform,c=N.multiplyTransformation(s,a,zut),u=Gut(e,c,n),f=e.runtimePrimitive;f.boundingSphere2D=u;let d=e.runtimeNode.node.instances;if(l(d))return;if(l(i.typedArray)){let y=Yut(i,c,u,n);f.positionBuffer2D=y,o._modelResources.push(y),i.typedArray=void 0}r.addDefine("USE_2D_POSITIONS",void 0,de.VERTEX),r.addUniform("mat4","u_modelView2D",de.VERTEX);let p=N.fromTranslation(u.center,new N),g=n.context,m={u_modelView2D:function(){return N.multiplyTransformation(g.uniformState.view,p,Vut)}};e.uniformMap=Ot(m,e.uniformMap)};var jut=new h,Hut=new h;function Gut(e,t,n){let i=N.multiplyByPoint(t,e.positionMin,jut),r=dr.computeActualEllipsoidPosition(n,i,i),o=N.multiplyByPoint(t,e.positionMax,Hut),s=dr.computeActualEllipsoidPosition(n,o,o);return ue.fromCornerPoints(r,s,new ue)}var UEe=new h;function Wut(e,t){let n=e.length,i=new Float32Array(n),r=t.quantizedVolumeOffset,o=t.quantizedVolumeStepSize;for(let s=0;s<n;s+=3){let a=h.fromArray(e,s,UEe),c=h.multiplyComponents(a,o,a),u=h.add(c,r,c);i[s]=u.x,i[s+1]=u.y,i[s+2]=u.z}return i}function qut(e,t,n,i){let r;l(e.quantization)?r=Wut(e.typedArray,e.quantization):r=e.typedArray.slice();let o=e.byteOffset/Float32Array.BYTES_PER_ELEMENT,s=r.length,a=l(e.byteStride)?e.byteStride/Float32Array.BYTES_PER_ELEMENT:3;for(let c=o;c<s;c+=a){let u=h.fromArray(r,c,UEe);if(isNaN(u.x)||isNaN(u.y)||isNaN(u.z))continue;let f=N.multiplyByPoint(t,u,u),d=dr.computeActualEllipsoidPosition(i,f,f),p=h.subtract(d,n,d);r[c]=p.x,r[c+1]=p.y,r[c+2]=p.z}return r}function Yut(e,t,n,i){let r=Je(i);r.mode=re.COLUMBUS_VIEW;let o=n.center,s=qut(e,t,o,r),a=tt.createVertexBuffer({context:i.context,typedArray:s,usage:Me.STATIC_DRAW});return a.vertexArrayDestroyable=!1,a}var L2=kEe;var F2=`void skinningStage(inout ProcessedAttributes attributes) { mat4 skinningMatrix = getSkinningMatrix(); mat3 skinningMatrixMat3 = mat3(skinningMatrix); @@ -9622,7 +9618,7 @@ vec3 tangentMC = attributes.tangentMC; attributes.tangentMC = skinningMatrixMat3 * tangentMC; #endif } -`;var CT={name:"SkinningPipelineStage",FUNCTION_ID_GET_SKINNING_MATRIX:"getSkinningMatrix",FUNCTION_SIGNATURE_GET_SKINNING_MATRIX:"mat4 getSkinningMatrix()"};CT.process=function(e,t){let n=e.shaderBuilder;n.addDefine("HAS_SKINNING",void 0,de.VERTEX),aat(n,t);let i=e.runtimeNode,r=i.computedJointMatrices;n.addUniform("mat4",`u_jointMatrices[${r.length}]`,de.VERTEX),n.addVertexLines(HB);let o={u_jointMatrices:function(){return i.computedJointMatrices}};e.uniformMap=Ot(o,e.uniformMap)};function sat(e){let t=-1,n=e.attributes,i=n.length;for(let r=0;r<i;r++){let o=n[r];(o.semantic===ct.JOINTS||o.semantic===ct.WEIGHTS)&&(t=Math.max(t,o.setIndex))}return t}function aat(e,t){e.addFunction(CT.FUNCTION_ID_GET_SKINNING_MATRIX,CT.FUNCTION_SIGNATURE_GET_SKINNING_MATRIX,de.VERTEX),e.addFunctionLines(CT.FUNCTION_ID_GET_SKINNING_MATRIX,["mat4 skinnedMatrix = mat4(0);"]);let i,r,o=["x","y","z","w"],s=sat(t);for(i=0;i<=s;i++)for(r=0;r<=3;r++){let c=o[r],u=`skinnedMatrix += a_weights_${i}.${c} * u_jointMatrices[int(a_joints_${i}.${c})];`;e.addFunctionLines(CT.FUNCTION_ID_GET_SKINNING_MATRIX,[u])}e.addFunctionLines(CT.FUNCTION_ID_GET_SKINNING_MATRIX,["return skinnedMatrix;"])}var GB=CT;var WB=`void verticalExaggerationStage( +`;var HT={name:"SkinningPipelineStage",FUNCTION_ID_GET_SKINNING_MATRIX:"getSkinningMatrix",FUNCTION_SIGNATURE_GET_SKINNING_MATRIX:"mat4 getSkinningMatrix()"};HT.process=function(e,t){let n=e.shaderBuilder;n.addDefine("HAS_SKINNING",void 0,de.VERTEX),Kut(n,t);let i=e.runtimeNode,r=i.computedJointMatrices;n.addUniform("mat4",`u_jointMatrices[${r.length}]`,de.VERTEX),n.addVertexLines(F2);let o={u_jointMatrices:function(){return i.computedJointMatrices}};e.uniformMap=Ot(o,e.uniformMap)};function Xut(e){let t=-1,n=e.attributes,i=n.length;for(let r=0;r<i;r++){let o=n[r];(o.semantic===ct.JOINTS||o.semantic===ct.WEIGHTS)&&(t=Math.max(t,o.setIndex))}return t}function Kut(e,t){e.addFunction(HT.FUNCTION_ID_GET_SKINNING_MATRIX,HT.FUNCTION_SIGNATURE_GET_SKINNING_MATRIX,de.VERTEX),e.addFunctionLines(HT.FUNCTION_ID_GET_SKINNING_MATRIX,["mat4 skinnedMatrix = mat4(0);"]);let i,r,o=["x","y","z","w"],s=Xut(t);for(i=0;i<=s;i++)for(r=0;r<=3;r++){let c=o[r],u=`skinnedMatrix += a_weights_${i}.${c} * u_jointMatrices[int(a_joints_${i}.${c})];`;e.addFunctionLines(HT.FUNCTION_ID_GET_SKINNING_MATRIX,[u])}e.addFunctionLines(HT.FUNCTION_ID_GET_SKINNING_MATRIX,["return skinnedMatrix;"])}var B2=HT;var k2=`void verticalExaggerationStage( inout ProcessedAttributes attributes ) { vec4 vertexPositionENU = czm_modelToEnu * vec4(attributes.positionMC, 1.0); @@ -9647,12 +9643,12 @@ float shift = u_verticalExaggerationAndRelativeHeight.y; float exaggeration = (vertexHeight - shift) * (stretch - 1.0); attributes.positionMC += exaggeration * exaggerationDirectionScaledMC; } -`;var bbe={name:"VerticalExaggerationPipelineStage"},cat=new U;bbe.process=function(e,t,n){let{shaderBuilder:i,uniformMap:r}=e;i.addVertexLines(WB),i.addDefine("HAS_VERTICAL_EXAGGERATION",void 0,de.VERTEX),i.addUniform("vec2","u_verticalExaggerationAndRelativeHeight",de.VERTEX),r.u_verticalExaggerationAndRelativeHeight=function(){return U.fromElements(n.verticalExaggeration,n.verticalExaggerationRelativeHeight,cat)}};var qB=bbe;var PZ={};function lat(e){let t=je.createTypedArray(e,e*2),n=e,i=0;for(let r=0;r<n;r+=3)t[i++]=r,t[i++]=r+1,t[i++]=r+1,t[i++]=r+2,t[i++]=r+2,t[i++]=r;return t}function uat(e,t){let n=t.length,i=je.createTypedArray(e,n*2),r=0;for(let o=0;o<n;o+=3){let s=t[o],a=t[o+1],c=t[o+2];i[r++]=s,i[r++]=a,i[r++]=a,i[r++]=c,i[r++]=c,i[r++]=s}return i}function fat(e){let t=e-2,n=2+t*4,i=je.createTypedArray(e,n),r=0;i[r++]=0,i[r++]=1;for(let o=0;o<t;o++)i[r++]=o+1,i[r++]=o+2,i[r++]=o+2,i[r++]=o;return i}function dat(e,t){let i=t.length-2,r=2+i*4,o=je.createTypedArray(e,r),s=0;o[s++]=t[0],o[s++]=t[1];for(let a=0;a<i;a++){let c=t[a],u=t[a+1],f=t[a+2];o[s++]=u,o[s++]=f,o[s++]=f,o[s++]=c}return o}function hat(e){let t=e-2,n=2+t*4,i=je.createTypedArray(e,n),r=0;i[r++]=0,i[r++]=1;for(let o=0;o<t;o++)i[r++]=o+1,i[r++]=o+2,i[r++]=o+2,i[r++]=0;return i}function mat(e,t){let i=t.length-2,r=2+i*4,o=je.createTypedArray(e,r),s=0,a=t[0];o[s++]=a,o[s++]=t[1];for(let c=0;c<i;c++){let u=t[c+1],f=t[c+2];o[s++]=u,o[s++]=f,o[s++]=f,o[s++]=a}return o}PZ.createWireframeIndices=function(e,t,n){let i=l(n);if(e===Oe.TRIANGLES)return i?uat(t,n):lat(t);if(e===Oe.TRIANGLE_STRIP)return i?dat(t,n):fat(t);if(e===Oe.TRIANGLE_FAN)return i?mat(t,n):hat(t)};PZ.getWireframeIndicesCount=function(e,t){return e===Oe.TRIANGLES?t*2:e===Oe.TRIANGLE_STRIP||e===Oe.TRIANGLE_FAN?2+(t-2)*4:t};var rw=PZ;var xbe={name:"WireframePipelineStage"};xbe.process=function(e,t,n){e.shaderBuilder.addDefine("HAS_WIREFRAME",void 0,de.FRAGMENT);let r=e.model,o=pat(t,e.indices,n);r._pipelineResources.push(o),e.wireframeIndexBuffer=o,r.statistics.addBuffer(o,!1);let a=e.primitiveType,c=e.count;e.primitiveType=Oe.LINES,e.count=rw.getWireframeIndicesCount(a,c)};function pat(e,t,n){let r=xt.getAttributeBySemantic(e,ct.POSITION).count,o=n.context.webgl2,s;if(l(t)){let f=t.buffer,d=t.count;l(f)&&o?(s=f.sizeInBytes===d?new Uint8Array(d):je.createTypedArray(r,d),f.getBufferData(s)):s=t.typedArray}let a=e.primitiveType,c=rw.createWireframeIndices(a,r,s),u=je.fromSizeInBytes(c.BYTES_PER_ELEMENT);return tt.createIndexBuffer({context:n.context,typedArray:c,usage:Me.STATIC_DRAW,indexDatatype:u})}var YB=xbe;function Tbe(e){e=e??H.EMPTY_OBJECT;let t=e.primitive,n=e.node,i=e.model;this.primitive=t,this.node=n,this.model=i,this.pipelineStages=[],this.drawCommand=void 0,this.boundingSphere=void 0,this.boundingSphere2D=void 0,this.positionBuffer2D=void 0,this.batchLengths=void 0,this.batchOffsets=void 0,this.updateStages=[]}Tbe.prototype.configurePipeline=function(e){let t=this.pipelineStages;t.length=0;let n=this.primitive,i=this.node,r=this.model,o=r.customShader,s=r.style,a=e.context.webgl2,u=e.mode!==re.SCENE3D&&!e.scene3DOnly&&r._projectTo2D,f=e.verticalExaggeration!==1&&r.hasVerticalExaggeration,d=l(n.morphTargets)&&n.morphTargets.length>0,p=l(i.skin),g=l(r.imageryLayers)&&r.imageryLayers.length>0,m=l(o),A=!(m&&l(o.fragmentShaderText))||o.mode!==Zg.REPLACE_MATERIAL,b=xt.hasQuantizedAttributes(n.attributes),x=r.debugWireframe&&Oe.isTriangles(n.primitiveType)&&(r._enableDebugWireframe||a),T=r.pointCloudShading,E=l(T)&&T.attenuation,v=l(T)&&T.backFaceCulling,S=n.primitiveType===Oe.POINTS&&(l(s)||E||v),I=r._enableShowOutline&&l(n.outlineCoordinates),R=l(n.edgeVisibility),O=gat(r,i,n),L=l(r.classificationType);u&&t.push(jB),t.push(lB),x&&t.push(YB),L&&t.push(jF),d&&t.push(NB),p&&t.push(GB),S&&t.push(BB),b&&t.push(eB),g&&(I?_t("outlines-and-draping","Primitive outlines disable imagery draping"):t.push(SB)),A&&t.push(OB),t.push(CA),t.push(qd),t.push(jf),O.hasPropertyTable&&(t.push(SA),t.push(VF),t.push(WF)),f&&t.push(qB),m&&t.push(ZF),t.push(IB),r.allowPicking&&t.push(LB),I&&t.push(zB),R&&(e.edgeVisibilityRequested=!0,t.push(oB),t.push(nB)),t.push(zF),t.push(VB)};function gat(e,t,n){let i;return l(t.instances)&&(i=xt.getFeatureIdsByLabel(t.instances.featureIds,e.instanceFeatureIdLabel),l(i))?{hasFeatureIds:!0,hasPropertyTable:l(i.propertyTableId)}:(i=xt.getFeatureIdsByLabel(n.featureIds,e.featureIdLabel),l(i)?{hasFeatureIds:!0,hasPropertyTable:l(i.propertyTableId)}:{hasFeatureIds:!1,hasPropertyTable:!1})}var XB=Tbe;function DZ(e){e=e??H.EMPTY_OBJECT,this._sceneGraph=e.sceneGraph;let t=e.skin;this._skin=t,this._inverseBindMatrices=void 0,this._joints=[],this._jointMatrices=[],_at(this)}Object.defineProperties(DZ.prototype,{skin:{get:function(){return this._skin}},sceneGraph:{get:function(){return this._sceneGraph}},inverseBindMatrices:{get:function(){return this._inverseBindMatrices}},joints:{get:function(){return this._joints}},jointMatrices:{get:function(){return this._jointMatrices}}});function _at(e){let t=e.skin,n=t.inverseBindMatrices;e._inverseBindMatrices=n;let i=t.joints,r=i.length,o=e.sceneGraph._runtimeNodes,s=e.joints,a=e._jointMatrices;for(let c=0;c<r;c++){let u=i[c].index,f=o[u];s.push(f);let d=n[c],p=Ebe(f,d,new N);a.push(p)}}function Ebe(e,t,n){let i=N.multiplyTransformation(e.transformToRoot,e.transform,n);return n=N.multiplyTransformation(i,t,n),n}DZ.prototype.updateJointMatrices=function(){let e=this._jointMatrices,t=e.length;for(let n=0;n<t;n++){let i=this.joints[n],r=this.inverseBindMatrices[n];e[n]=Ebe(i,r,e[n])}};var KB=DZ;function yat(){this.pass=void 0,this.alphaCutoff=void 0}var vT=yat;function Aat(e){this.shaderBuilder=new hg,this.model=e,this.uniformMap={},this.alphaOptions=new vT,this.renderStateOptions=Ge.getState(Ge.fromCache({depthTest:{enabled:!0,func:cc.LESS_OR_EQUAL}})),this.hasSilhouette=!1,this.hasSkipLevelOfDetail=!1,this.nodeRenderResources=[]}var $B=Aat;var JB=`void silhouetteStage(inout vec4 color) { +`;var zEe={name:"VerticalExaggerationPipelineStage"},$ut=new U;zEe.process=function(e,t,n){let{shaderBuilder:i,uniformMap:r}=e;i.addVertexLines(k2),i.addDefine("HAS_VERTICAL_EXAGGERATION",void 0,de.VERTEX),i.addUniform("vec2","u_verticalExaggerationAndRelativeHeight",de.VERTEX),r.u_verticalExaggerationAndRelativeHeight=function(){return U.fromElements(n.verticalExaggeration,n.verticalExaggerationRelativeHeight,$ut)}};var U2=zEe;var TQ={};function Jut(e){let t=je.createTypedArray(e,e*2),n=e,i=0;for(let r=0;r<n;r+=3)t[i++]=r,t[i++]=r+1,t[i++]=r+1,t[i++]=r+2,t[i++]=r+2,t[i++]=r;return t}function Zut(e,t){let n=t.length,i=je.createTypedArray(e,n*2),r=0;for(let o=0;o<n;o+=3){let s=t[o],a=t[o+1],c=t[o+2];i[r++]=s,i[r++]=a,i[r++]=a,i[r++]=c,i[r++]=c,i[r++]=s}return i}function Qut(e){let t=e-2,n=2+t*4,i=je.createTypedArray(e,n),r=0;i[r++]=0,i[r++]=1;for(let o=0;o<t;o++)i[r++]=o+1,i[r++]=o+2,i[r++]=o+2,i[r++]=o;return i}function eft(e,t){let i=t.length-2,r=2+i*4,o=je.createTypedArray(e,r),s=0;o[s++]=t[0],o[s++]=t[1];for(let a=0;a<i;a++){let c=t[a],u=t[a+1],f=t[a+2];o[s++]=u,o[s++]=f,o[s++]=f,o[s++]=c}return o}function tft(e){let t=e-2,n=2+t*4,i=je.createTypedArray(e,n),r=0;i[r++]=0,i[r++]=1;for(let o=0;o<t;o++)i[r++]=o+1,i[r++]=o+2,i[r++]=o+2,i[r++]=0;return i}function nft(e,t){let i=t.length-2,r=2+i*4,o=je.createTypedArray(e,r),s=0,a=t[0];o[s++]=a,o[s++]=t[1];for(let c=0;c<i;c++){let u=t[c+1],f=t[c+2];o[s++]=u,o[s++]=f,o[s++]=f,o[s++]=a}return o}TQ.createWireframeIndices=function(e,t,n){let i=l(n);if(e===Oe.TRIANGLES)return i?Zut(t,n):Jut(t);if(e===Oe.TRIANGLE_STRIP)return i?eft(t,n):Qut(t);if(e===Oe.TRIANGLE_FAN)return i?nft(t,n):tft(t)};TQ.getWireframeIndicesCount=function(e,t){return e===Oe.TRIANGLES?t*2:e===Oe.TRIANGLE_STRIP||e===Oe.TRIANGLE_FAN?2+(t-2)*4:t};var Ow=TQ;var VEe={name:"WireframePipelineStage"};VEe.process=function(e,t,n){e.shaderBuilder.addDefine("HAS_WIREFRAME",void 0,de.FRAGMENT);let r=e.model,o=ift(t,e.indices,n);r._pipelineResources.push(o),e.wireframeIndexBuffer=o,r.statistics.addBuffer(o,!1);let a=e.primitiveType,c=e.count;e.primitiveType=Oe.LINES,e.count=Ow.getWireframeIndicesCount(a,c)};function ift(e,t,n){let r=xt.getAttributeBySemantic(e,ct.POSITION).count,o=n.context.webgl2,s;if(l(t)){let f=t.buffer,d=t.count;l(f)&&o?(s=f.sizeInBytes===d?new Uint8Array(d):je.createTypedArray(r,d),f.getBufferData(s)):s=t.typedArray}let a=e.primitiveType,c=Ow.createWireframeIndices(a,r,s),u=je.fromSizeInBytes(c.BYTES_PER_ELEMENT);return tt.createIndexBuffer({context:n.context,typedArray:c,usage:Me.STATIC_DRAW,indexDatatype:u})}var z2=VEe;function jEe(e){e=e??H.EMPTY_OBJECT;let t=e.primitive,n=e.node,i=e.model;this.primitive=t,this.node=n,this.model=i,this.pipelineStages=[],this.drawCommand=void 0,this.boundingSphere=void 0,this.boundingSphere2D=void 0,this.positionBuffer2D=void 0,this.batchLengths=void 0,this.batchOffsets=void 0,this.updateStages=[]}jEe.prototype.configurePipeline=function(e){let t=this.pipelineStages;t.length=0;let n=this.primitive,i=this.node,r=this.model,o=r.customShader,s=r.style,a=e.context.webgl2,u=e.mode!==re.SCENE3D&&!e.scene3DOnly&&r._projectTo2D,f=e.verticalExaggeration!==1&&r.hasVerticalExaggeration,d=l(n.morphTargets)&&n.morphTargets.length>0,p=l(i.skin),g=l(r.imageryLayers)&&r.imageryLayers.length>0,m=l(o),A=!(m&&l(o.fragmentShaderText))||o.mode!==r_.REPLACE_MATERIAL,b=xt.hasQuantizedAttributes(n.attributes),x=r.debugWireframe&&Oe.isTriangles(n.primitiveType)&&(r._enableDebugWireframe||a),T=r.pointCloudShading,E=l(T)&&T.attenuation,v=l(T)&&T.backFaceCulling,S=n.primitiveType===Oe.POINTS&&(l(s)||E||v),I=r._enableShowOutline&&l(n.outlineCoordinates),R=l(n.edgeVisibility),O=rft(r,i,n),L=l(r.classificationType);u&&t.push(L2),t.push(n2),x&&t.push(z2),L&&t.push(LB),d&&t.push(w2),p&&t.push(B2),S&&t.push(D2),b&&t.push(YB),g&&(I?_t("outlines-and-draping","Primitive outlines disable imagery draping"):t.push(A2)),A&&t.push(v2),t.push(SA),t.push(eh),t.push(Kf),O.hasPropertyTable&&(t.push(IA),t.push(NB),t.push(kB)),f&&t.push(U2),m&&t.push(WB),t.push(x2),r.allowPicking&&t.push(I2),I&&t.push(M2),R&&(e.edgeVisibilityRequested=!0,t.push(ZB),t.push(KB)),t.push(MB),t.push(N2)};function rft(e,t,n){let i;return l(t.instances)&&(i=xt.getFeatureIdsByLabel(t.instances.featureIds,e.instanceFeatureIdLabel),l(i))?{hasFeatureIds:!0,hasPropertyTable:l(i.propertyTableId)}:(i=xt.getFeatureIdsByLabel(n.featureIds,e.featureIdLabel),l(i)?{hasFeatureIds:!0,hasPropertyTable:l(i.propertyTableId)}:{hasFeatureIds:!1,hasPropertyTable:!1})}var V2=jEe;function EQ(e){e=e??H.EMPTY_OBJECT,this._sceneGraph=e.sceneGraph;let t=e.skin;this._skin=t,this._inverseBindMatrices=void 0,this._joints=[],this._jointMatrices=[],oft(this)}Object.defineProperties(EQ.prototype,{skin:{get:function(){return this._skin}},sceneGraph:{get:function(){return this._sceneGraph}},inverseBindMatrices:{get:function(){return this._inverseBindMatrices}},joints:{get:function(){return this._joints}},jointMatrices:{get:function(){return this._jointMatrices}}});function oft(e){let t=e.skin,n=t.inverseBindMatrices;e._inverseBindMatrices=n;let i=t.joints,r=i.length,o=e.sceneGraph._runtimeNodes,s=e.joints,a=e._jointMatrices;for(let c=0;c<r;c++){let u=i[c].index,f=o[u];s.push(f);let d=n[c],p=HEe(f,d,new N);a.push(p)}}function HEe(e,t,n){let i=N.multiplyTransformation(e.transformToRoot,e.transform,n);return n=N.multiplyTransformation(i,t,n),n}EQ.prototype.updateJointMatrices=function(){let e=this._jointMatrices,t=e.length;for(let n=0;n<t;n++){let i=this.joints[n],r=this.inverseBindMatrices[n];e[n]=HEe(i,r,e[n])}};var j2=EQ;function sft(){this.pass=void 0,this.alphaCutoff=void 0}var GT=sft;function aft(e){this.shaderBuilder=new hg,this.model=e,this.uniformMap={},this.alphaOptions=new GT,this.renderStateOptions=Ge.getState(Ge.fromCache({depthTest:{enabled:!0,func:cc.LESS_OR_EQUAL}})),this.hasSilhouette=!1,this.hasSkipLevelOfDetail=!1,this.nodeRenderResources=[]}var H2=aft;var G2=`void silhouetteStage(inout vec4 color) { if(model_silhouettePass) { color = czm_gammaCorrect(model_silhouetteColor); } } -`;var ZB=`void silhouetteStage(in ProcessedAttributes attributes, inout vec4 positionClip) { +`;var W2=`void silhouetteStage(in ProcessedAttributes attributes, inout vec4 positionClip) { #ifdef HAS_NORMALS if(model_silhouettePass) { vec3 normal = normalize(czm_normal3D * attributes.normalMC); @@ -9662,14 +9658,14 @@ positionClip.xy += normal.xy * positionClip.w * model_silhouetteSize * czm_pixel } #endif } -`;var OH={name:"ModelSilhouettePipelineStage"};OH.silhouettesLength=0;OH.process=function(e,t,n){l(t._silhouetteId)||(t._silhouetteId=++OH.silhouettesLength);let i=e.shaderBuilder;i.addDefine("HAS_SILHOUETTE",void 0,de.BOTH),i.addVertexLines(ZB),i.addFragmentLines(JB),i.addUniform("vec4","model_silhouetteColor",de.FRAGMENT),i.addUniform("float","model_silhouetteSize",de.VERTEX),i.addUniform("bool","model_silhouettePass",de.BOTH);let r={model_silhouetteColor:function(){return t.silhouetteColor},model_silhouetteSize:function(){return t.silhouetteSize},model_silhouettePass:function(){return!1}};e.uniformMap=Ot(r,e.uniformMap),e.hasSilhouette=!0};var QB=OH;var e2=`void modelSplitterStage() +`;var sG={name:"ModelSilhouettePipelineStage"};sG.silhouettesLength=0;sG.process=function(e,t,n){l(t._silhouetteId)||(t._silhouetteId=++sG.silhouettesLength);let i=e.shaderBuilder;i.addDefine("HAS_SILHOUETTE",void 0,de.BOTH),i.addVertexLines(W2),i.addFragmentLines(G2),i.addUniform("vec4","model_silhouetteColor",de.FRAGMENT),i.addUniform("float","model_silhouetteSize",de.VERTEX),i.addUniform("bool","model_silhouettePass",de.BOTH);let r={model_silhouetteColor:function(){return t.silhouetteColor},model_silhouetteSize:function(){return t.silhouetteSize},model_silhouettePass:function(){return!1}};e.uniformMap=Ot(r,e.uniformMap),e.hasSilhouette=!0};var q2=sG;var Y2=`void modelSplitterStage() { #ifndef SHADOW_MAP if (model_splitDirection < 0.0 && gl_FragCoord.x > czm_splitPosition) discard; if (model_splitDirection > 0.0 && gl_FragCoord.x < czm_splitPosition) discard; #endif } -`;var MH={name:"ModelSplitterPipelineStage",SPLIT_DIRECTION_UNIFORM_NAME:"model_splitDirection"};MH.process=function(e,t,n){let i=e.shaderBuilder;i.addDefine("HAS_MODEL_SPLITTER",void 0,de.FRAGMENT),i.addFragmentLines(e2);let r={};i.addUniform("float",MH.SPLIT_DIRECTION_UNIFORM_NAME,de.FRAGMENT),r[MH.SPLIT_DIRECTION_UNIFORM_NAME]=function(){return t.splitDirection},e.uniformMap=Ot(r,e.uniformMap)};var t2=MH;function bat(e,t){this.model=e.model,this.shaderBuilder=e.shaderBuilder.clone(),this.uniformMap=Je(e.uniformMap),this.alphaOptions=Je(e.alphaOptions),this.renderStateOptions=Je(e.renderStateOptions,!0),this.hasSilhouette=e.hasSilhouette,this.hasSkipLevelOfDetail=e.hasSkipLevelOfDetail,this.runtimeNode=t,this.attributes=[],this.attributeIndex=1,this.featureIdVertexAttributeSetIndex=0,this.instanceCount=0,this.primitiveRenderResources=[]}var n2=bat;function xat(e){e=e??H.EMPTY_OBJECT,this.lightingModel=e.lightingModel??Jp.UNLIT}var i2=xat;function Tat(e,t){this.model=e.model,this.runtimeNode=e.runtimeNode,this.attributes=e.attributes.slice(),this.attributeIndex=e.attributeIndex,this.featureIdVertexAttributeSetIndex=e.featureIdVertexAttributeSetIndex,this.uniformMap=Je(e.uniformMap),this.alphaOptions=Je(e.alphaOptions),this.renderStateOptions=Je(e.renderStateOptions,!0),this.hasSilhouette=e.hasSilhouette,this.hasSkipLevelOfDetail=e.hasSkipLevelOfDetail,this.planarFillIdPass=!1,this.shaderBuilder=e.shaderBuilder.clone(),this.instanceCount=e.instanceCount,this.runtimePrimitive=t;let n=t.primitive;this.count=l(n.indices)?n.indices.count:xt.getAttributeBySemantic(n,"POSITION").count,this.hasPropertyTable=!1,this.indices=n.indices,this.wireframeIndexBuffer=void 0,this.primitiveType=n.primitiveType;let i=xt.getPositionMinMax(n,this.runtimeNode.instancingTranslationMin,this.runtimeNode.instancingTranslationMax);this.positionMin=h.clone(i.min,new h),this.positionMax=h.clone(i.max,new h),this.boundingSphere=ue.fromCornerPoints(this.positionMin,this.positionMax,new ue),this.lightingOptions=new i2,this.pickId=void 0,this.snapId=void 0}var r2=Tat;function OZ(e){e=e??H.EMPTY_OBJECT;let t=e.command,n=e.primitiveRenderResources,i=n.model;this._command=t,this._model=i,this._runtimePrimitive=n.runtimePrimitive,this._modelMatrix=t.modelMatrix,this._boundingVolume=t.boundingVolume,this._cullFace=t.renderState.cull.face;let r=i.classificationType;this._classificationType=r,this._classifiesTerrain=r!==ei.CESIUM_3D_TILE,this._classifies3DTiles=r!==ei.TERRAIN,this._useDebugWireframe=i._enableDebugWireframe&&i.debugWireframe,this._pickId=n.pickId,this._commandListTerrain=[],this._commandList3DTiles=[],this._commandListIgnoreShow=[],this._commandListDebugWireframe=[],this._commandListTerrainPicking=[],this._commandList3DTilesPicking=[],Sat(this)}function Eat(e){return{colorMask:{red:!1,green:!1,blue:!1,alpha:!1},stencilTest:{enabled:!0,frontFunction:e,frontOperation:{fail:Rt.KEEP,zFail:Rt.DECREMENT_WRAP,zPass:Rt.KEEP},backFunction:e,backOperation:{fail:Rt.KEEP,zFail:Rt.INCREMENT_WRAP,zPass:Rt.KEEP},reference:Yt.CESIUM_3D_TILE_MASK,mask:Yt.CESIUM_3D_TILE_MASK},stencilMask:Yt.CLASSIFICATION_MASK,depthTest:{enabled:!0,func:cc.LESS_OR_EQUAL},depthMask:!1}}var Cat={stencilTest:{enabled:!0,frontFunction:ti.NOT_EQUAL,frontOperation:{fail:Rt.ZERO,zFail:Rt.ZERO,zPass:Rt.ZERO},backFunction:ti.NOT_EQUAL,backOperation:{fail:Rt.ZERO,zFail:Rt.ZERO,zPass:Rt.ZERO},reference:0,mask:Yt.CLASSIFICATION_MASK},stencilMask:Yt.CLASSIFICATION_MASK,depthTest:{enabled:!1},depthMask:!1,blending:tn.PRE_MULTIPLIED_ALPHA_BLEND},vat={stencilTest:{enabled:!0,frontFunction:ti.NOT_EQUAL,frontOperation:{fail:Rt.ZERO,zFail:Rt.ZERO,zPass:Rt.ZERO},backFunction:ti.NOT_EQUAL,backOperation:{fail:Rt.ZERO,zFail:Rt.ZERO,zPass:Rt.ZERO},reference:0,mask:Yt.CLASSIFICATION_MASK},stencilMask:Yt.CLASSIFICATION_MASK,depthTest:{enabled:!1},depthMask:!1},Sbe=[];function Sat(e){let t=e._command,n=Sbe;if(e._useDebugWireframe){t.pass=Ie.OPAQUE,n.length=0,n.push(t),e._commandListDebugWireframe=o2(e,n,e._commandListDebugWireframe);let o=e._commandListDebugWireframe,s=o.length;for(let a=0;a<s;a++){let c=o[a];c.count*=2,c.offset*=2}return}let r=e.model.allowPicking;if(e._classifiesTerrain){let o=Ie.TERRAIN_CLASSIFICATION,s=RZ(t,o),a=Cbe(t,o);n.length=0,n.push(s,a),e._commandListTerrain=o2(e,n,e._commandListTerrain),r&&(e._commandListTerrainPicking=vbe(e,n,e._commandListTerrainPicking))}if(e._classifies3DTiles){let o=Ie.CESIUM_3D_TILE_CLASSIFICATION,s=RZ(t,o),a=Cbe(t,o);n.length=0,n.push(s,a),e._commandList3DTiles=o2(e,n,e._commandList3DTiles),r&&(e._commandList3DTilesPicking=vbe(e,n,e._commandList3DTilesPicking))}}function o2(e,t,n){let i=e._runtimePrimitive,r=i.batchLengths,o=i.batchOffsets,s=r.length,a=t.length;for(let c=0;c<s;c++){let u=r[c],f=o[c];for(let d=0;d<a;d++){let p=t[d],g=at.shallowClone(p);g.count=u,g.offset=f,n.push(g)}}return n}function RZ(e,t){let n=at.shallowClone(e);n.cull=!1,n.pass=t;let i=t===Ie.TERRAIN_CLASSIFICATION?ti.ALWAYS:ti.EQUAL,r=Eat(i);return n.renderState=Ge.fromCache(r),n}function Cbe(e,t){let n=at.shallowClone(e);return n.cull=!1,n.pass=t,n.renderState=Ge.fromCache(Cat),n}var wat=[];function vbe(e,t,n){let i=Ge.fromCache(vat),r=t[0],o=t[1],s=at.shallowClone(r);s.cull=!0,s.pickOnly=!0;let a=at.shallowClone(o);a.cull=!0,a.pickOnly=!0,a.renderState=i,a.pickId=e._pickId;let c=wat;return c.length=0,c.push(s,a),o2(e,c,n)}Object.defineProperties(OZ.prototype,{command:{get:function(){return this._command}},runtimePrimitive:{get:function(){return this._runtimePrimitive}},batchLengths:{get:function(){return this._runtimePrimitive.batchLengths}},batchOffsets:{get:function(){return this._runtimePrimitive.batchOffsets}},model:{get:function(){return this._model}},classificationType:{get:function(){return this._classificationType}},modelMatrix:{get:function(){return this._modelMatrix},set:function(e){this._modelMatrix=N.clone(e,this._modelMatrix);let t=this._runtimePrimitive.boundingSphere;this._boundingVolume=ue.transform(t,this._modelMatrix,this._boundingVolume)}},boundingVolume:{get:function(){return this._boundingVolume}},cullFace:{get:function(){return this._cullFace},set:function(e){this._cullFace=e}}});OZ.prototype.pushCommands=function(e,t){let n=e.passes;if(n.render){if(this._useDebugWireframe){Zn(t,this._commandListDebugWireframe);return}if(this._classifiesTerrain&&Zn(t,this._commandListTerrain),this._classifies3DTiles&&Zn(t,this._commandList3DTiles),e.invertClassification&&this._classifies3DTiles){if(this._commandListIgnoreShow.length===0){let r=Ie.CESIUM_3D_TILE_CLASSIFICATION_IGNORE_SHOW,o=RZ(this._command,r),s=Sbe;s.length=0,s.push(o),this._commandListIgnoreShow=o2(this,s,this._commandListIgnoreShow)}Zn(t,this._commandListIgnoreShow)}}return n.pick&&(this._classifiesTerrain&&Zn(t,this._commandListTerrainPicking),this._classifies3DTiles&&Zn(t,this._commandList3DTilesPicking)),t};var s2=OZ;function ow(e){e=e??H.EMPTY_OBJECT;let t=e.command,n=e.primitiveRenderResources,i=n.model;this._model=i;let r=n.runtimePrimitive;this._runtimePrimitive=r,this._primitiveRenderResources=n;let o=t.pass===Ie.TRANSLUCENT,a=!r.primitive.material.doubleSided&&!o,c=n.hasSilhouette,u=!o&&!c,f=n.hasSkipLevelOfDetail&&!o,d=c,p=l(n.edgeGeometry);this._command=t,this._modelMatrix=N.clone(t.modelMatrix),this._boundingVolume=ue.clone(t.boundingVolume),this._modelMatrix2D=new N,this._boundingVolume2D=new ue,this._modelMatrix2DDirty=!1,this._backFaceCulling=t.renderState.cull.enabled,this._cullFace=t.renderState.cull.face,this._shadows=i.shadows,this._debugShowBoundingVolume=t.debugShowBoundingVolume,this._usesBackFaceCulling=a,this._needsTranslucentCommand=u,this._needsSkipLevelOfDetailCommands=f,this._needsSilhouetteCommands=d,this._needsEdgeCommands=p,this._needsPlanarFillIdCommand=n.planarFillIdPass,this._originalCommand=void 0,this._translucentCommand=void 0,this._skipLodBackfaceCommand=void 0,this._skipLodStencilCommand=void 0,this._silhouetteModelCommand=void 0,this._silhouetteColorCommand=void 0,this._edgeCommand=void 0,this._edgeSnapCommand=void 0,this._planarFillIdCommand=void 0,this._derivedCommands=[],this._has2DCommands=!1,Iat(this)}function Xd(e){this.command=e.command,this.updateShadows=e.updateShadows,this.updateBackFaceCulling=e.updateBackFaceCulling,this.updateCullFace=e.updateCullFace,this.updateDebugShowBoundingVolume=e.updateDebugShowBoundingVolume,this.is2D=e.is2D??!1,this.derivedCommand2D=void 0}Xd.clone=function(e){return new Xd({command:e.command,updateShadows:e.updateShadows,updateBackFaceCulling:e.updateBackFaceCulling,updateCullFace:e.updateCullFace,updateDebugShowBoundingVolume:e.updateDebugShowBoundingVolume,is2D:e.is2D,derivedCommand2D:e.derivedCommand2D})};function Iat(e){let t=e._command;t.modelMatrix=e._modelMatrix,t.boundingVolume=e._boundingVolume;let n=e._model,i=e._usesBackFaceCulling,r=e._derivedCommands;if(e._originalCommand=new Xd({command:t,updateShadows:!0,updateBackFaceCulling:i,updateCullFace:i,updateDebugShowBoundingVolume:!0,is2D:!1}),r.push(e._originalCommand),e._needsTranslucentCommand&&(e._translucentCommand=new Xd({command:Lat(t),updateShadows:!0,updateBackFaceCulling:!1,updateCullFace:!1,updateDebugShowBoundingVolume:!0}),r.push(e._translucentCommand)),e._needsSkipLevelOfDetailCommands&&(e._skipLodBackfaceCommand=new Xd({command:jat(t),updateShadows:!1,updateBackFaceCulling:!1,updateCullFace:i,updateDebugShowBoundingVolume:!1}),e._skipLodStencilCommand=new Xd({command:Hat(t,n),updateShadows:!0,updateBackFaceCulling:i,updateCullFace:i,updateDebugShowBoundingVolume:!0}),r.push(e._skipLodBackfaceCommand),r.push(e._skipLodStencilCommand)),e._needsSilhouetteCommands&&(e._silhouetteModelCommand=new Xd({command:Fat(t,n),updateShadows:!0,updateBackFaceCulling:i,updateCullFace:i,updateDebugShowBoundingVolume:!0}),e._silhouetteColorCommand=new Xd({command:Bat(t,n),updateShadows:!1,updateBackFaceCulling:!1,updateCullFace:!1,updateDebugShowBoundingVolume:!1}),r.push(e._silhouetteModelCommand),r.push(e._silhouetteColorCommand)),e._needsEdgeCommands){let o=e._primitiveRenderResources,s=o.edgeGeometry,a=l(s.lineWidth)?s.lineWidth:1,c=1;e._edgeCommand=new Xd({command:wbe(t,o,a),updateShadows:!1,updateBackFaceCulling:!1,updateCullFace:!1,updateDebugShowBoundingVolume:!1}),e._edgeSnapCommand=new Xd({command:wbe(t,o,c),updateShadows:!1,updateBackFaceCulling:!1,updateCullFace:!1,updateDebugShowBoundingVolume:!1}),r.push(e._edgeCommand),r.push(e._edgeSnapCommand)}e._needsPlanarFillIdCommand&&(e._planarFillIdCommand=new Xd({command:kat(t),updateShadows:!1,updateBackFaceCulling:!1,updateCullFace:!1,updateDebugShowBoundingVolume:!1}),r.push(e._planarFillIdCommand)),e._primitiveRenderResources=void 0}Object.defineProperties(ow.prototype,{command:{get:function(){return this._command}},runtimePrimitive:{get:function(){return this._runtimePrimitive}},model:{get:function(){return this._model}},primitiveType:{get:function(){return this._command.primitiveType}},modelMatrix:{get:function(){return this._modelMatrix},set:function(e){this._modelMatrix=N.clone(e,this._modelMatrix),this._modelMatrix2DDirty=!0,this._boundingVolume=ue.transform(this.runtimePrimitive.boundingSphere,this._modelMatrix,this._boundingVolume)}},boundingVolume:{get:function(){return this._boundingVolume}},shadows:{get:function(){return this._shadows},set:function(e){this._shadows=e,Dat(this)}},backFaceCulling:{get:function(){return this._backFaceCulling},set:function(e){this._backFaceCulling!==e&&(this._backFaceCulling=e,Rat(this))}},cullFace:{get:function(){return this._cullFace},set:function(e){this._cullFace!==e&&(this._cullFace=e,Oat(this))}},debugShowBoundingVolume:{get:function(){return this._debugShowBoundingVolume},set:function(e){this._debugShowBoundingVolume!==e&&(this._debugShowBoundingVolume=e,Mat(this))}}});function Pat(e,t){let n=e._modelMatrix;e._modelMatrix2D=N.clone(n,e._modelMatrix2D),e._modelMatrix2D[13]-=D.sign(n[13])*2*D.PI*t.mapProjection.ellipsoid.maximumRadius,e._boundingVolume2D=ue.transform(e.runtimePrimitive.boundingSphere,e._modelMatrix2D,e._boundingVolume2D)}function Dat(e){let t=e.shadows,n=Dn.castShadows(t),i=Dn.receiveShadows(t),r=e._derivedCommands;for(let o=0;o<r.length;++o){let s=r[o];if(s.updateShadows){let a=s.command;a.castShadows=n,a.receiveShadows=i}}}function Rat(e){let t=e.backFaceCulling,n=e._derivedCommands;for(let i=0;i<n.length;++i){let r=n[i];if(r.updateBackFaceCulling){let o=r.command,s=Je(o.renderState,!0);s.cull.enabled=t,o.renderState=Ge.fromCache(s)}}}function Oat(e){let t=e.cullFace,n=e._derivedCommands;for(let i=0;i<n.length;++i){let r=n[i];if(r.updateCullFace){let o=r.command,s=Je(o.renderState,!0);s.cull.face=t,o.renderState=Ge.fromCache(s)}}}function Mat(e){let t=e.debugShowBoundingVolume,n=e._derivedCommands;for(let i=0;i<n.length;++i){let r=n[i];if(r.updateDebugShowBoundingVolume){let o=r.command;o.debugShowBoundingVolume=t}}}ow.prototype.pushCommands=function(e,t){let n=NH(this,e);n&&!this._has2DCommands&&(Nat(this),this._has2DCommands=!0,this._modelMatrix2DDirty=!0),this._modelMatrix2DDirty&&(Pat(this,e),this._modelMatrix2DDirty=!1);let i=this.model.styleCommandsNeeded;if(!(this._needsTranslucentCommand&&l(i)&&(i!==pm.ALL_OPAQUE&&Zp(t,this._translucentCommand,n),i===pm.ALL_TRANSLUCENT))){if(this._needsSkipLevelOfDetailCommands){let{tileset:r,tile:o}=this._model.content;if(r.hasMixedContent){o._finalResolution||Zp(r._backfaceCommands,this._skipLodBackfaceCommand,n),Uat(this,o,n),Zp(t,this._skipLodStencilCommand,n);return}}if(this._needsSilhouetteCommands){Zp(t,this._silhouetteModelCommand,n);return}return this._model.edgeDisplayMode===Wd.EDGES_ONLY&&this._needsEdgeCommands||Zp(t,this._originalCommand,n),t}};ow.prototype.pushSilhouetteCommands=function(e,t){let n=NH(this,e);return Zp(t,this._silhouetteColorCommand,n),t};ow.prototype.pushEdgeCommands=function(e,t){if(!l(this._edgeCommand))return t;let n=this._model.edgeDisplayMode,i=e.passes,r=NH(this,e);if(i.snap){let s=this._edgeSnapCommand;return s.command.pass=Ie.CESIUM_3D_TILE_EDGES_DIRECT,l(s.derivedCommand2D)&&(s.derivedCommand2D.command.pass=Ie.CESIUM_3D_TILE_EDGES_DIRECT),Zp(t,s,r),t}if(i.pick){if(n!==Wd.EDGES_ONLY)return t;let s=this._edgeCommand;return s.command.pass=Ie.CESIUM_3D_TILE_EDGES_DIRECT,l(s.derivedCommand2D)&&(s.derivedCommand2D.command.pass=Ie.CESIUM_3D_TILE_EDGES_DIRECT),Zp(t,s,r),t}if(n===Wd.SURFACES_ONLY)return t;let o=n===Wd.EDGES_ONLY?Ie.CESIUM_3D_TILE_EDGES_DIRECT:Ie.CESIUM_3D_TILE_EDGES;return this._edgeCommand.command.pass=o,l(this._edgeCommand.derivedCommand2D)&&(this._edgeCommand.derivedCommand2D.command.pass=o),Zp(t,this._edgeCommand,r),t};ow.prototype.pushPlanarFillIdCommands=function(e,t){if(!l(this._planarFillIdCommand))return t;let n=NH(this,e);return Zp(t,this._planarFillIdCommand,n),t};function Zp(e,t,n){e.push(t.command),n&&e.push(t.derivedCommand2D.command)}function NH(e,t){if(t.mode!==re.SCENE2D||e.model._projectTo2D)return!1;let i=e.model.sceneGraph._boundingSphere2D,r=i.center.y-i.radius,o=i.center.y+i.radius,s=t.mapProjection.ellipsoid.maximumRadius*D.PI;return r<s&&o>s||r<-s&&o>-s}function i_(e,t){if(!l(t))return;let n=Xd.clone(t),i=at.shallowClone(t.command);return i.modelMatrix=e._modelMatrix2D,i.boundingVolume=e._boundingVolume2D,n.command=i,n.updateShadows=!1,n.is2D=!0,t.derivedCommand2D=n,e._derivedCommands.push(n),n}function Nat(e){i_(e,e._originalCommand),i_(e,e._translucentCommand),i_(e,e._skipLodBackfaceCommand),i_(e,e._skipLodStencilCommand),i_(e,e._silhouetteModelCommand),i_(e,e._silhouetteColorCommand),i_(e,e._edgeCommand),i_(e,e._edgeSnapCommand),i_(e,e._planarFillIdCommand)}function Lat(e){let t=at.shallowClone(e);t.pass=Ie.TRANSLUCENT;let n=Je(e.renderState,!0);return n.cull.enabled=!1,n.depthMask=!1,n.blending=tn.ALPHA_BLEND,t.renderState=Ge.fromCache(n),t}function Fat(e,t){let n=t._silhouetteId%255,i=at.shallowClone(e),r=Je(e.renderState,!0);return r.stencilTest={enabled:!0,frontFunction:te.ALWAYS,backFunction:te.ALWAYS,reference:n,mask:-1,frontOperation:{fail:te.KEEP,zFail:te.KEEP,zPass:te.REPLACE},backOperation:{fail:te.KEEP,zFail:te.KEEP,zPass:te.REPLACE}},t.isInvisible()&&(r.colorMask={red:!1,green:!1,blue:!1,alpha:!1}),i.renderState=Ge.fromCache(r),i}function Bat(e,t){let n=t._silhouetteId%255,i=at.shallowClone(e),r=Je(e.renderState,!0);r.cull.enabled=!1,(e.pass===Ie.TRANSLUCENT||t.silhouetteColor.alpha<1)&&(i.pass=Ie.TRANSLUCENT,r.depthMask=!1,r.blending=tn.ALPHA_BLEND),r.stencilTest={enabled:!0,frontFunction:te.NOTEQUAL,backFunction:te.NOTEQUAL,reference:n,mask:-1,frontOperation:{fail:te.KEEP,zFail:te.KEEP,zPass:te.KEEP},backOperation:{fail:te.KEEP,zFail:te.KEEP,zPass:te.KEEP}};let s=Je(e.uniformMap);return s.model_silhouettePass=function(){return!0},i.renderState=Ge.fromCache(r),i.uniformMap=s,i.castShadows=!1,i.receiveShadows=!1,i}function wbe(e,t,n){let i=t.edgeGeometry,r=at.shallowClone(e);r.vertexArray=i.vertexArray,r.primitiveType=i.primitiveType,r.count=i.indexCount,l(i.shaderProgram)&&(r.shaderProgram=i.shaderProgram),r.pass=i.pass;let o=Je(e.uniformMap);return o.u_isEdgePass=function(){return!0},o.u_lineWidth=function(){return n},r.uniformMap=o,r.castShadows=!1,r.receiveShadows=!1,r}function kat(e){let t=at.shallowClone(e);t.pass=Ie.CESIUM_3D_TILE_PLANAR_FILL_ID,t.castShadows=!1,t.receiveShadows=!1;let n=Je(e.renderState,!0);n.blending.enabled=!1,t.renderState=Ge.fromCache(n);let i=Je(e.uniformMap);return i.u_isPlanarFillIdPass=function(){return!0},t.uniformMap=i,t}function Uat(e,t,n){let i=e._skipLodStencilCommand,r=i.command,o=t._selectionDepth,s=zat(r);if(o!==s){let a=Vat(o),c=Je(r.renderState,!0);c.stencilTest.reference=a,r.renderState=Ge.fromCache(c),n&&(i.derivedCommand2D.renderState=c)}}function zat(e){return(e.renderState.stencilTest.reference&Yt.SKIP_LOD_MASK)>>>Yt.SKIP_LOD_BIT_SHIFT}function Vat(e){return Yt.CESIUM_3D_TILE_MASK|e<<Yt.SKIP_LOD_BIT_SHIFT}function jat(e){let t=at.shallowClone(e),n=Je(e.renderState,!0);n.cull.enabled=!0,n.cull.face=Vi.FRONT,n.colorMask={red:!1,green:!1,blue:!1,alpha:!1},n.polygonOffset={enabled:!0,factor:5,units:5};let i=Je(t.uniformMap),r=new U(5,5);return i.u_polygonOffset=function(){return r},t.renderState=Ge.fromCache(n),t.uniformMap=i,t.castShadows=!1,t.receiveShadows=!1,t}function Hat(e){let t=at.shallowClone(e),n=Je(e.renderState,!0),{stencilTest:i}=n;return i.enabled=!0,i.mask=Yt.SKIP_LOD_MASK,i.reference=Yt.CESIUM_3D_TILE_MASK,i.frontFunction=ti.GREATER_OR_EQUAL,i.frontOperation.zPass=Rt.REPLACE,i.backFunction=ti.GREATER_OR_EQUAL,i.backOperation.zPass=Rt.REPLACE,n.stencilMask=Yt.CESIUM_3D_TILE_MASK|Yt.SKIP_LOD_MASK,t.renderState=Ge.fromCache(n),t}var a2=ow;var c2=`precision highp float; +`;var aG={name:"ModelSplitterPipelineStage",SPLIT_DIRECTION_UNIFORM_NAME:"model_splitDirection"};aG.process=function(e,t,n){let i=e.shaderBuilder;i.addDefine("HAS_MODEL_SPLITTER",void 0,de.FRAGMENT),i.addFragmentLines(Y2);let r={};i.addUniform("float",aG.SPLIT_DIRECTION_UNIFORM_NAME,de.FRAGMENT),r[aG.SPLIT_DIRECTION_UNIFORM_NAME]=function(){return t.splitDirection},e.uniformMap=Ot(r,e.uniformMap)};var X2=aG;function cft(e,t){this.model=e.model,this.shaderBuilder=e.shaderBuilder.clone(),this.uniformMap=Je(e.uniformMap),this.alphaOptions=Je(e.alphaOptions),this.renderStateOptions=Je(e.renderStateOptions,!0),this.hasSilhouette=e.hasSilhouette,this.hasSkipLevelOfDetail=e.hasSkipLevelOfDetail,this.runtimeNode=t,this.attributes=[],this.attributeIndex=1,this.featureIdVertexAttributeSetIndex=0,this.instanceCount=0,this.primitiveRenderResources=[]}var K2=cft;function lft(e){e=e??H.EMPTY_OBJECT,this.lightingModel=e.lightingModel??r0.UNLIT}var $2=lft;function uft(e,t){this.model=e.model,this.runtimeNode=e.runtimeNode,this.attributes=e.attributes.slice(),this.attributeIndex=e.attributeIndex,this.featureIdVertexAttributeSetIndex=e.featureIdVertexAttributeSetIndex,this.uniformMap=Je(e.uniformMap),this.alphaOptions=Je(e.alphaOptions),this.renderStateOptions=Je(e.renderStateOptions,!0),this.hasSilhouette=e.hasSilhouette,this.hasSkipLevelOfDetail=e.hasSkipLevelOfDetail,this.planarFillIdPass=!1,this.shaderBuilder=e.shaderBuilder.clone(),this.instanceCount=e.instanceCount,this.runtimePrimitive=t;let n=t.primitive;this.count=l(n.indices)?n.indices.count:xt.getAttributeBySemantic(n,"POSITION").count,this.hasPropertyTable=!1,this.indices=n.indices,this.wireframeIndexBuffer=void 0,this.primitiveType=n.primitiveType;let i=xt.getPositionMinMax(n,this.runtimeNode.instancingTranslationMin,this.runtimeNode.instancingTranslationMax);this.positionMin=h.clone(i.min,new h),this.positionMax=h.clone(i.max,new h),this.boundingSphere=ue.fromCornerPoints(this.positionMin,this.positionMax,new ue),this.lightingOptions=new $2,this.pickId=void 0,this.snapId=void 0}var J2=uft;function vQ(e){e=e??H.EMPTY_OBJECT;let t=e.command,n=e.primitiveRenderResources,i=n.model;this._command=t,this._model=i,this._runtimePrimitive=n.runtimePrimitive,this._modelMatrix=t.modelMatrix,this._boundingVolume=t.boundingVolume,this._cullFace=t.renderState.cull.face;let r=i.classificationType;this._classificationType=r,this._classifiesTerrain=r!==Qn.CESIUM_3D_TILE,this._classifies3DTiles=r!==Qn.TERRAIN,this._useDebugWireframe=i._enableDebugWireframe&&i.debugWireframe,this._pickId=n.pickId,this._commandListTerrain=[],this._commandList3DTiles=[],this._commandListIgnoreShow=[],this._commandListDebugWireframe=[],this._commandListTerrainPicking=[],this._commandList3DTilesPicking=[],mft(this)}function fft(e){return{colorMask:{red:!1,green:!1,blue:!1,alpha:!1},stencilTest:{enabled:!0,frontFunction:e,frontOperation:{fail:Rt.KEEP,zFail:Rt.DECREMENT_WRAP,zPass:Rt.KEEP},backFunction:e,backOperation:{fail:Rt.KEEP,zFail:Rt.INCREMENT_WRAP,zPass:Rt.KEEP},reference:Yt.CESIUM_3D_TILE_MASK,mask:Yt.CESIUM_3D_TILE_MASK},stencilMask:Yt.CLASSIFICATION_MASK,depthTest:{enabled:!0,func:cc.LESS_OR_EQUAL},depthMask:!1}}var dft={stencilTest:{enabled:!0,frontFunction:ei.NOT_EQUAL,frontOperation:{fail:Rt.ZERO,zFail:Rt.ZERO,zPass:Rt.ZERO},backFunction:ei.NOT_EQUAL,backOperation:{fail:Rt.ZERO,zFail:Rt.ZERO,zPass:Rt.ZERO},reference:0,mask:Yt.CLASSIFICATION_MASK},stencilMask:Yt.CLASSIFICATION_MASK,depthTest:{enabled:!1},depthMask:!1,blending:tn.PRE_MULTIPLIED_ALPHA_BLEND},hft={stencilTest:{enabled:!0,frontFunction:ei.NOT_EQUAL,frontOperation:{fail:Rt.ZERO,zFail:Rt.ZERO,zPass:Rt.ZERO},backFunction:ei.NOT_EQUAL,backOperation:{fail:Rt.ZERO,zFail:Rt.ZERO,zPass:Rt.ZERO},reference:0,mask:Yt.CLASSIFICATION_MASK},stencilMask:Yt.CLASSIFICATION_MASK,depthTest:{enabled:!1},depthMask:!1},qEe=[];function mft(e){let t=e._command,n=qEe;if(e._useDebugWireframe){t.pass=Ie.OPAQUE,n.length=0,n.push(t),e._commandListDebugWireframe=Z2(e,n,e._commandListDebugWireframe);let o=e._commandListDebugWireframe,s=o.length;for(let a=0;a<s;a++){let c=o[a];c.count*=2,c.offset*=2}return}let r=e.model.allowPicking;if(e._classifiesTerrain){let o=Ie.TERRAIN_CLASSIFICATION,s=CQ(t,o),a=GEe(t,o);n.length=0,n.push(s,a),e._commandListTerrain=Z2(e,n,e._commandListTerrain),r&&(e._commandListTerrainPicking=WEe(e,n,e._commandListTerrainPicking))}if(e._classifies3DTiles){let o=Ie.CESIUM_3D_TILE_CLASSIFICATION,s=CQ(t,o),a=GEe(t,o);n.length=0,n.push(s,a),e._commandList3DTiles=Z2(e,n,e._commandList3DTiles),r&&(e._commandList3DTilesPicking=WEe(e,n,e._commandList3DTilesPicking))}}function Z2(e,t,n){let i=e._runtimePrimitive,r=i.batchLengths,o=i.batchOffsets,s=r.length,a=t.length;for(let c=0;c<s;c++){let u=r[c],f=o[c];for(let d=0;d<a;d++){let p=t[d],g=at.shallowClone(p);g.count=u,g.offset=f,n.push(g)}}return n}function CQ(e,t){let n=at.shallowClone(e);n.cull=!1,n.pass=t;let i=t===Ie.TERRAIN_CLASSIFICATION?ei.ALWAYS:ei.EQUAL,r=fft(i);return n.renderState=Ge.fromCache(r),n}function GEe(e,t){let n=at.shallowClone(e);return n.cull=!1,n.pass=t,n.renderState=Ge.fromCache(dft),n}var pft=[];function WEe(e,t,n){let i=Ge.fromCache(hft),r=t[0],o=t[1],s=at.shallowClone(r);s.cull=!0,s.pickOnly=!0;let a=at.shallowClone(o);a.cull=!0,a.pickOnly=!0,a.renderState=i,a.pickId=e._pickId;let c=pft;return c.length=0,c.push(s,a),Z2(e,c,n)}Object.defineProperties(vQ.prototype,{command:{get:function(){return this._command}},runtimePrimitive:{get:function(){return this._runtimePrimitive}},batchLengths:{get:function(){return this._runtimePrimitive.batchLengths}},batchOffsets:{get:function(){return this._runtimePrimitive.batchOffsets}},model:{get:function(){return this._model}},classificationType:{get:function(){return this._classificationType}},modelMatrix:{get:function(){return this._modelMatrix},set:function(e){this._modelMatrix=N.clone(e,this._modelMatrix);let t=this._runtimePrimitive.boundingSphere;this._boundingVolume=ue.transform(t,this._modelMatrix,this._boundingVolume)}},boundingVolume:{get:function(){return this._boundingVolume}},cullFace:{get:function(){return this._cullFace},set:function(e){this._cullFace=e}}});vQ.prototype.pushCommands=function(e,t){let n=e.passes;if(n.render){if(this._useDebugWireframe){Zn(t,this._commandListDebugWireframe);return}if(this._classifiesTerrain&&Zn(t,this._commandListTerrain),this._classifies3DTiles&&Zn(t,this._commandList3DTiles),e.invertClassification&&this._classifies3DTiles){if(this._commandListIgnoreShow.length===0){let r=Ie.CESIUM_3D_TILE_CLASSIFICATION_IGNORE_SHOW,o=CQ(this._command,r),s=qEe;s.length=0,s.push(o),this._commandListIgnoreShow=Z2(this,s,this._commandListIgnoreShow)}Zn(t,this._commandListIgnoreShow)}}return n.pick&&(this._classifiesTerrain&&Zn(t,this._commandListTerrainPicking),this._classifies3DTiles&&Zn(t,this._commandList3DTilesPicking)),t};var Q2=vQ;function Mw(e){e=e??H.EMPTY_OBJECT;let t=e.command,n=e.primitiveRenderResources,i=n.model;this._model=i;let r=n.runtimePrimitive;this._runtimePrimitive=r,this._primitiveRenderResources=n;let o=t.pass===Ie.TRANSLUCENT,a=!r.primitive.material.doubleSided&&!o,c=n.hasSilhouette,u=!o&&!c,f=n.hasSkipLevelOfDetail&&!o,d=c,p=l(n.edgeGeometry);this._command=t,this._modelMatrix=N.clone(t.modelMatrix),this._boundingVolume=ue.clone(t.boundingVolume),this._modelMatrix2D=new N,this._boundingVolume2D=new ue,this._modelMatrix2DDirty=!1,this._backFaceCulling=t.renderState.cull.enabled,this._cullFace=t.renderState.cull.face,this._shadows=i.shadows,this._debugShowBoundingVolume=t.debugShowBoundingVolume,this._usesBackFaceCulling=a,this._needsTranslucentCommand=u,this._needsSkipLevelOfDetailCommands=f,this._needsSilhouetteCommands=d,this._needsEdgeCommands=p,this._needsPlanarFillIdCommand=n.planarFillIdPass,this._originalCommand=void 0,this._translucentCommand=void 0,this._skipLodBackfaceCommand=void 0,this._skipLodStencilCommand=void 0,this._silhouetteModelCommand=void 0,this._silhouetteColorCommand=void 0,this._edgeCommand=void 0,this._edgeSnapCommand=void 0,this._planarFillIdCommand=void 0,this._derivedCommands=[],this._has2DCommands=!1,gft(this)}function nh(e){this.command=e.command,this.updateShadows=e.updateShadows,this.updateBackFaceCulling=e.updateBackFaceCulling,this.updateCullFace=e.updateCullFace,this.updateDebugShowBoundingVolume=e.updateDebugShowBoundingVolume,this.is2D=e.is2D??!1,this.derivedCommand2D=void 0}nh.clone=function(e){return new nh({command:e.command,updateShadows:e.updateShadows,updateBackFaceCulling:e.updateBackFaceCulling,updateCullFace:e.updateCullFace,updateDebugShowBoundingVolume:e.updateDebugShowBoundingVolume,is2D:e.is2D,derivedCommand2D:e.derivedCommand2D})};function gft(e){let t=e._command;t.modelMatrix=e._modelMatrix,t.boundingVolume=e._boundingVolume;let n=e._model,i=e._usesBackFaceCulling,r=e._derivedCommands;if(e._originalCommand=new nh({command:t,updateShadows:!0,updateBackFaceCulling:i,updateCullFace:i,updateDebugShowBoundingVolume:!0,is2D:!1}),r.push(e._originalCommand),e._needsTranslucentCommand&&(e._translucentCommand=new nh({command:Eft(t),updateShadows:!0,updateBackFaceCulling:!1,updateCullFace:!1,updateDebugShowBoundingVolume:!0}),r.push(e._translucentCommand)),e._needsSkipLevelOfDetailCommands&&(e._skipLodBackfaceCommand=new nh({command:Dft(t),updateShadows:!1,updateBackFaceCulling:!1,updateCullFace:i,updateDebugShowBoundingVolume:!1}),e._skipLodStencilCommand=new nh({command:Rft(t,n),updateShadows:!0,updateBackFaceCulling:i,updateCullFace:i,updateDebugShowBoundingVolume:!0}),r.push(e._skipLodBackfaceCommand),r.push(e._skipLodStencilCommand)),e._needsSilhouetteCommands&&(e._silhouetteModelCommand=new nh({command:Cft(t,n),updateShadows:!0,updateBackFaceCulling:i,updateCullFace:i,updateDebugShowBoundingVolume:!0}),e._silhouetteColorCommand=new nh({command:vft(t,n),updateShadows:!1,updateBackFaceCulling:!1,updateCullFace:!1,updateDebugShowBoundingVolume:!1}),r.push(e._silhouetteModelCommand),r.push(e._silhouetteColorCommand)),e._needsEdgeCommands){let o=e._primitiveRenderResources,s=o.edgeGeometry,a=l(s.lineWidth)?s.lineWidth:1,c=1;e._edgeCommand=new nh({command:YEe(t,o,a),updateShadows:!1,updateBackFaceCulling:!1,updateCullFace:!1,updateDebugShowBoundingVolume:!1}),e._edgeSnapCommand=new nh({command:YEe(t,o,c),updateShadows:!1,updateBackFaceCulling:!1,updateCullFace:!1,updateDebugShowBoundingVolume:!1}),r.push(e._edgeCommand),r.push(e._edgeSnapCommand)}e._needsPlanarFillIdCommand&&(e._planarFillIdCommand=new nh({command:Sft(t),updateShadows:!1,updateBackFaceCulling:!1,updateCullFace:!1,updateDebugShowBoundingVolume:!1}),r.push(e._planarFillIdCommand)),e._primitiveRenderResources=void 0}Object.defineProperties(Mw.prototype,{command:{get:function(){return this._command}},runtimePrimitive:{get:function(){return this._runtimePrimitive}},model:{get:function(){return this._model}},primitiveType:{get:function(){return this._command.primitiveType}},modelMatrix:{get:function(){return this._modelMatrix},set:function(e){this._modelMatrix=N.clone(e,this._modelMatrix),this._modelMatrix2DDirty=!0,this._boundingVolume=ue.transform(this.runtimePrimitive.boundingSphere,this._modelMatrix,this._boundingVolume)}},boundingVolume:{get:function(){return this._boundingVolume}},shadows:{get:function(){return this._shadows},set:function(e){this._shadows=e,yft(this)}},backFaceCulling:{get:function(){return this._backFaceCulling},set:function(e){this._backFaceCulling!==e&&(this._backFaceCulling=e,Aft(this))}},cullFace:{get:function(){return this._cullFace},set:function(e){this._cullFace!==e&&(this._cullFace=e,bft(this))}},debugShowBoundingVolume:{get:function(){return this._debugShowBoundingVolume},set:function(e){this._debugShowBoundingVolume!==e&&(this._debugShowBoundingVolume=e,xft(this))}}});function _ft(e,t){let n=e._modelMatrix;e._modelMatrix2D=N.clone(n,e._modelMatrix2D),e._modelMatrix2D[13]-=D.sign(n[13])*2*D.PI*t.mapProjection.ellipsoid.maximumRadius,e._boundingVolume2D=ue.transform(e.runtimePrimitive.boundingSphere,e._modelMatrix2D,e._boundingVolume2D)}function yft(e){let t=e.shadows,n=Pn.castShadows(t),i=Pn.receiveShadows(t),r=e._derivedCommands;for(let o=0;o<r.length;++o){let s=r[o];if(s.updateShadows){let a=s.command;a.castShadows=n,a.receiveShadows=i}}}function Aft(e){let t=e.backFaceCulling,n=e._derivedCommands;for(let i=0;i<n.length;++i){let r=n[i];if(r.updateBackFaceCulling){let o=r.command,s=Je(o.renderState,!0);s.cull.enabled=t,o.renderState=Ge.fromCache(s)}}}function bft(e){let t=e.cullFace,n=e._derivedCommands;for(let i=0;i<n.length;++i){let r=n[i];if(r.updateCullFace){let o=r.command,s=Je(o.renderState,!0);s.cull.face=t,o.renderState=Ge.fromCache(s)}}}function xft(e){let t=e.debugShowBoundingVolume,n=e._derivedCommands;for(let i=0;i<n.length;++i){let r=n[i];if(r.updateDebugShowBoundingVolume){let o=r.command;o.debugShowBoundingVolume=t}}}Mw.prototype.pushCommands=function(e,t){let n=cG(this,e);n&&!this._has2DCommands&&(Tft(this),this._has2DCommands=!0,this._modelMatrix2DDirty=!0),this._modelMatrix2DDirty&&(_ft(this,e),this._modelMatrix2DDirty=!1);let i=this.model.styleCommandsNeeded;if(!(this._needsTranslucentCommand&&l(i)&&(i!==wm.ALL_OPAQUE&&o0(t,this._translucentCommand,n),i===wm.ALL_TRANSLUCENT))){if(this._needsSkipLevelOfDetailCommands){let{tileset:r,tile:o}=this._model.content;if(r.hasMixedContent){o._finalResolution||o0(r._backfaceCommands,this._skipLodBackfaceCommand,n),wft(this,o,n),o0(t,this._skipLodStencilCommand,n);return}}if(this._needsSilhouetteCommands){o0(t,this._silhouetteModelCommand,n);return}return this._model.edgeDisplayMode===Kd.EDGES_ONLY&&this._needsEdgeCommands||o0(t,this._originalCommand,n),t}};Mw.prototype.pushSilhouetteCommands=function(e,t){let n=cG(this,e);return o0(t,this._silhouetteColorCommand,n),t};Mw.prototype.pushEdgeCommands=function(e,t){if(!l(this._edgeCommand))return t;let n=this._model.edgeDisplayMode,i=e.passes,r=cG(this,e);if(i.snap){let s=this._edgeSnapCommand;return s.command.pass=Ie.CESIUM_3D_TILE_EDGES_DIRECT,l(s.derivedCommand2D)&&(s.derivedCommand2D.command.pass=Ie.CESIUM_3D_TILE_EDGES_DIRECT),o0(t,s,r),t}if(i.pick){if(n!==Kd.EDGES_ONLY)return t;let s=this._edgeCommand;return s.command.pass=Ie.CESIUM_3D_TILE_EDGES_DIRECT,l(s.derivedCommand2D)&&(s.derivedCommand2D.command.pass=Ie.CESIUM_3D_TILE_EDGES_DIRECT),o0(t,s,r),t}if(n===Kd.SURFACES_ONLY)return t;let o=n===Kd.EDGES_ONLY?Ie.CESIUM_3D_TILE_EDGES_DIRECT:Ie.CESIUM_3D_TILE_EDGES;return this._edgeCommand.command.pass=o,l(this._edgeCommand.derivedCommand2D)&&(this._edgeCommand.derivedCommand2D.command.pass=o),o0(t,this._edgeCommand,r),t};Mw.prototype.pushPlanarFillIdCommands=function(e,t){if(!l(this._planarFillIdCommand))return t;let n=cG(this,e);return o0(t,this._planarFillIdCommand,n),t};function o0(e,t,n){e.push(t.command),n&&e.push(t.derivedCommand2D.command)}function cG(e,t){if(t.mode!==re.SCENE2D||e.model._projectTo2D)return!1;let i=e.model.sceneGraph._boundingSphere2D,r=i.center.y-i.radius,o=i.center.y+i.radius,s=t.mapProjection.ellipsoid.maximumRadius*D.PI;return r<s&&o>s||r<-s&&o>-s}function l_(e,t){if(!l(t))return;let n=nh.clone(t),i=at.shallowClone(t.command);return i.modelMatrix=e._modelMatrix2D,i.boundingVolume=e._boundingVolume2D,n.command=i,n.updateShadows=!1,n.is2D=!0,t.derivedCommand2D=n,e._derivedCommands.push(n),n}function Tft(e){l_(e,e._originalCommand),l_(e,e._translucentCommand),l_(e,e._skipLodBackfaceCommand),l_(e,e._skipLodStencilCommand),l_(e,e._silhouetteModelCommand),l_(e,e._silhouetteColorCommand),l_(e,e._edgeCommand),l_(e,e._edgeSnapCommand),l_(e,e._planarFillIdCommand)}function Eft(e){let t=at.shallowClone(e);t.pass=Ie.TRANSLUCENT;let n=Je(e.renderState,!0);return n.cull.enabled=!1,n.depthMask=!1,n.blending=tn.ALPHA_BLEND,t.renderState=Ge.fromCache(n),t}function Cft(e,t){let n=t._silhouetteId%255,i=at.shallowClone(e),r=Je(e.renderState,!0);return r.stencilTest={enabled:!0,frontFunction:te.ALWAYS,backFunction:te.ALWAYS,reference:n,mask:-1,frontOperation:{fail:te.KEEP,zFail:te.KEEP,zPass:te.REPLACE},backOperation:{fail:te.KEEP,zFail:te.KEEP,zPass:te.REPLACE}},t.isInvisible()&&(r.colorMask={red:!1,green:!1,blue:!1,alpha:!1}),i.renderState=Ge.fromCache(r),i}function vft(e,t){let n=t._silhouetteId%255,i=at.shallowClone(e),r=Je(e.renderState,!0);r.cull.enabled=!1,(e.pass===Ie.TRANSLUCENT||t.silhouetteColor.alpha<1)&&(i.pass=Ie.TRANSLUCENT,r.depthMask=!1,r.blending=tn.ALPHA_BLEND),r.stencilTest={enabled:!0,frontFunction:te.NOTEQUAL,backFunction:te.NOTEQUAL,reference:n,mask:-1,frontOperation:{fail:te.KEEP,zFail:te.KEEP,zPass:te.KEEP},backOperation:{fail:te.KEEP,zFail:te.KEEP,zPass:te.KEEP}};let s=Je(e.uniformMap);return s.model_silhouettePass=function(){return!0},i.renderState=Ge.fromCache(r),i.uniformMap=s,i.castShadows=!1,i.receiveShadows=!1,i}function YEe(e,t,n){let i=t.edgeGeometry,r=at.shallowClone(e);r.vertexArray=i.vertexArray,r.primitiveType=i.primitiveType,r.count=i.indexCount,l(i.shaderProgram)&&(r.shaderProgram=i.shaderProgram),r.pass=i.pass;let o=Je(e.uniformMap);return o.u_isEdgePass=function(){return!0},o.u_lineWidth=function(){return n},r.uniformMap=o,r.castShadows=!1,r.receiveShadows=!1,r}function Sft(e){let t=at.shallowClone(e);t.pass=Ie.CESIUM_3D_TILE_PLANAR_FILL_ID,t.castShadows=!1,t.receiveShadows=!1;let n=Je(e.renderState,!0);n.blending.enabled=!1,t.renderState=Ge.fromCache(n);let i=Je(e.uniformMap);return i.u_isPlanarFillIdPass=function(){return!0},t.uniformMap=i,t}function wft(e,t,n){let i=e._skipLodStencilCommand,r=i.command,o=t._selectionDepth,s=Ift(r);if(o!==s){let a=Pft(o),c=Je(r.renderState,!0);c.stencilTest.reference=a,r.renderState=Ge.fromCache(c),n&&(i.derivedCommand2D.renderState=c)}}function Ift(e){return(e.renderState.stencilTest.reference&Yt.SKIP_LOD_MASK)>>>Yt.SKIP_LOD_BIT_SHIFT}function Pft(e){return Yt.CESIUM_3D_TILE_MASK|e<<Yt.SKIP_LOD_BIT_SHIFT}function Dft(e){let t=at.shallowClone(e),n=Je(e.renderState,!0);n.cull.enabled=!0,n.cull.face=zi.FRONT,n.colorMask={red:!1,green:!1,blue:!1,alpha:!1},n.polygonOffset={enabled:!0,factor:5,units:5};let i=Je(t.uniformMap),r=new U(5,5);return i.u_polygonOffset=function(){return r},t.renderState=Ge.fromCache(n),t.uniformMap=i,t.castShadows=!1,t.receiveShadows=!1,t}function Rft(e){let t=at.shallowClone(e),n=Je(e.renderState,!0),{stencilTest:i}=n;return i.enabled=!0,i.mask=Yt.SKIP_LOD_MASK,i.reference=Yt.CESIUM_3D_TILE_MASK,i.frontFunction=ei.GREATER_OR_EQUAL,i.frontOperation.zPass=Rt.REPLACE,i.backFunction=ei.GREATER_OR_EQUAL,i.backOperation.zPass=Rt.REPLACE,n.stencilMask=Yt.CESIUM_3D_TILE_MASK|Yt.SKIP_LOD_MASK,t.renderState=Ge.fromCache(n),t}var ek=Mw;var tk=`precision highp float; czm_modelVertexOutput defaultVertexOutput(vec3 positionMC) { czm_modelVertexOutput vsOutput; vsOutput.positionMC = positionMC; @@ -9784,7 +9780,7 @@ edgeVisibilityStageVS(); v_pointCloudShow = show; #endif } -`;var l2=`precision highp float; +`;var nk=`precision highp float; const float PLANAR_DEPTH_PULL = 0.9995; const float BEHIND_DEPTH_PUSH = 1.0002; const float FEATURE_ID_TOLERANCE = 0.5; @@ -9930,25 +9926,29 @@ gl_FragDepth *= BEHIND_DEPTH_PUSH; } #endif } -`;function Ibe(){}Ibe.buildModelDrawCommand=function(e,t){let n=e.shaderBuilder,i=Gat(e,n,t),r=Wat(e,i,t),o=e.model;return l(o.classificationType)?new s2({primitiveRenderResources:e,command:r}):new a2({primitiveRenderResources:e,command:r})};function Gat(e,t,n){t.addVertexLines(c2),t.addFragmentLines(l2);let i=e.model,r=t.buildShaderProgram(n.context);return i._pipelineResources.push(r),r}function Wat(e,t,n){let i=qat(e),r=new zn({context:n.context,indexBuffer:i,attributes:e.attributes}),o=e.model;o._pipelineResources.push(r);let s=e.alphaOptions.pass,a=o.sceneGraph,c=n.mode===re.SCENE3D,u,f;if(!c&&!n.scene3DOnly&&o._projectTo2D)u=N.multiplyTransformation(a._computedModelMatrix,e.runtimeNode.computedTransform,new N),f=e.runtimePrimitive.boundingSphere2D;else{let x=c?a._computedModelMatrix:a._computedModelMatrix2D;u=N.multiplyTransformation(x,e.runtimeNode.computedTransform,new N),f=ue.transform(e.boundingSphere,u)}let d=Je(Ge.fromCache(e.renderStateOptions),!0);d.cull.face=xt.getCullFace(u,e.primitiveType),d=Ge.fromCache(d);let p=l(o.classificationType),g=p?!1:Dn.castShadows(o.shadows),m=p?!1:Dn.receiveShadows(o.shadows),y=p?void 0:e.pickId,A=p?void 0:e.snapId;return new at({boundingVolume:f,modelMatrix:u,uniformMap:e.uniformMap,renderState:d,vertexArray:r,shaderProgram:t,cull:o.cull,pass:s,count:e.count,owner:o,pickId:y,snapId:A,pickMetadataAllowed:!0,instanceCount:e.instanceCount,primitiveType:e.primitiveType,debugShowBoundingVolume:o.debugShowBoundingVolume,castShadows:g,receiveShadows:m})}function qat(e){let t=e.wireframeIndexBuffer;if(l(t))return t;let n=e.indices;if(l(n))return n.buffer}var u2=Ibe;function dl(e){e=e??H.EMPTY_OBJECT;let t=e.modelComponents;this._model=e.model,this._components=t,this._pipelineStages=[],this._updateStages=[],this._runtimeNodes=[],this._rootNodes=[],this._skinnedNodes=[],this._runtimeSkins=[],this.modelPipelineStages=[],this._boundingSphere=void 0,this._positionMin=void 0,this._positionMax=void 0,this._boundingSphere2D=void 0,this._computedModelMatrix=N.clone(N.IDENTITY),this._computedModelMatrix2D=N.clone(N.IDENTITY),this._axisCorrectionMatrix=xt.getAxisCorrectionMatrix(t.upAxis,t.forwardAxis,new N),this._runtimeArticulations={},Yat(this)}Object.defineProperties(dl.prototype,{components:{get:function(){return this._components}},computedModelMatrix:{get:function(){return this._computedModelMatrix}},axisCorrectionMatrix:{get:function(){return this._axisCorrectionMatrix}},boundingSphere:{get:function(){return this._boundingSphere}}});function Yat(e){let t=e._components,n=t.scene,r=e._model.modelMatrix;Pbe(e,r);let o=t.articulations,s=o.length,a=e._runtimeArticulations;for(let x=0;x<s;x++){let T=o[x],E=new xF({articulation:T,sceneGraph:e}),v=E.name;a[v]=E}let c=t.nodes,u=c.length;e._runtimeNodes=new Array(u);let d=n.nodes.length,p=N.IDENTITY;for(let x=0;x<d;x++){let T=n.nodes[x],E=Dbe(e,T,p);e._rootNodes.push(E)}let g=t.skins,m=e._runtimeSkins,y=g.length;for(let x=0;x<y;x++){let T=g[x];m.push(new KB({skin:T,sceneGraph:e}))}let A=e._skinnedNodes,b=A.length;for(let x=0;x<b;x++){let T=A[x],E=e._runtimeNodes[T],S=c[T].skin.index;E._runtimeSkin=m[S],E.updateJointMatrices()}e.applyArticulations()}function Pbe(e,t){let n=e._components,i=e._model;e._computedModelMatrix=N.multiplyTransformation(t,n.transform,e._computedModelMatrix),e._computedModelMatrix=N.multiplyTransformation(e._computedModelMatrix,e._axisCorrectionMatrix,e._computedModelMatrix),e._computedModelMatrix=N.multiplyByUniformScale(e._computedModelMatrix,i.computedScale,e._computedModelMatrix)}var Xat=new h;function Kat(e,t){let n=e._computedModelMatrix,i=N.getTranslation(n,Xat);if(!h.equals(i,h.ZERO))e._computedModelMatrix2D=At.basisTo2D(t.mapProjection,n,e._computedModelMatrix2D);else{let r=e.boundingSphere.center,o=At.ellipsoidTo2DModelMatrix(t.mapProjection,r,e._computedModelMatrix2D);e._computedModelMatrix2D=N.multiply(o,n,e._computedModelMatrix2D)}e._boundingSphere2D=ue.transform(e._boundingSphere,e._computedModelMatrix2D,e._boundingSphere2D)}function Dbe(e,t,n){let i=[],r=xt.getNodeTransform(t),o=t.children.length;for(let f=0;f<o;f++){let d=t.children[f],p=N.multiplyTransformation(n,r,new N),g=Dbe(e,d,p);i.push(g)}let s=new UF({node:t,transform:r,transformToRoot:n,children:i,sceneGraph:e}),a=t.primitives.length;for(let f=0;f<a;f++)s.runtimePrimitives.push(new XB({primitive:t.primitives[f],node:t,model:e._model}));let c=t.index;e._runtimeNodes[c]=s,l(t.skin)&&e._skinnedNodes.push(c);let u=t.name;if(l(u)){let f=e._model,d=new RF(f,s);f._nodesByName[u]=d}return c}var $at=new h,Jat=new h,Zat=new h,Qat=new h;dl.prototype.buildDrawCommands=function(e){let t=this.buildRenderResources(e);this.computeBoundingVolumes(t),this.createDrawCommands(t,e)};dl.prototype.buildRenderResources=function(e){let t=this._model,n=new $B(t);t.statistics.clear(),this.configurePipeline(e);let i=this.modelPipelineStages;for(let r=0;r<i.length;r++)i[r].process(n,t,e);for(let r=0;r<this._runtimeNodes.length;r++){let o=this._runtimeNodes[r];if(!l(o))continue;o.configurePipeline();let s=o.pipelineStages,a=new n2(n,o);n.nodeRenderResources[r]=a;for(let c=0;c<s.length;c++)s[c].process(a,o.node,e);for(let c=0;c<o.runtimePrimitives.length;c++){let u=o.runtimePrimitives[c];u.configurePipeline(e);let f=u.pipelineStages,d=new r2(a,u);a.primitiveRenderResources[c]=d;for(let p=0;p<f.length;p++)f[p].process(d,u.primitive,e)}}return n};dl.prototype.computeBoundingVolumes=function(e){let t=this._model,n=h.fromElements(Number.MAX_VALUE,Number.MAX_VALUE,Number.MAX_VALUE,$at),i=h.fromElements(-Number.MAX_VALUE,-Number.MAX_VALUE,-Number.MAX_VALUE,Jat);for(let r=0;r<this._runtimeNodes.length;r++){let o=this._runtimeNodes[r];if(!l(o))continue;let s=e.nodeRenderResources[r],a=o.computedTransform;for(let c=0;c<o.runtimePrimitives.length;c++){let u=o.runtimePrimitives[c],f=s.primitiveRenderResources[c];u.boundingSphere=ue.clone(f.boundingSphere,new ue);let d=N.multiplyByPoint(a,f.positionMin,Zat),p=N.multiplyByPoint(a,f.positionMax,Qat);h.minimumByComponent(n,d,n),h.minimumByComponent(n,p,n),h.maximumByComponent(i,p,i),h.maximumByComponent(i,d,i)}}this._positionMin=h.clone(n,this._positionMin),this._positionMax=h.clone(i,this._positionMax),this._boundingSphere=ue.fromCornerPoints(n,i,new ue),this._boundingSphere=ue.transformWithoutScale(this._boundingSphere,this._axisCorrectionMatrix,this._boundingSphere),this._boundingSphere=ue.transform(this._boundingSphere,this._components.transform,this._boundingSphere),t._boundingSphere=ue.transform(this._boundingSphere,t.modelMatrix,t._boundingSphere),t._initialRadius=t._boundingSphere.radius,t._boundingSphere.radius*=t._clampedScale};dl.prototype.createDrawCommands=function(e,t){for(let n=0;n<this._runtimeNodes.length;n++){let i=this._runtimeNodes[n];if(!l(i))continue;let r=e.nodeRenderResources[n];for(let o=0;o<i.runtimePrimitives.length;o++){let s=i.runtimePrimitives[o],a=r.primitiveRenderResources[o],c=u2.buildModelDrawCommand(a,t);s.drawCommand=c}}};dl.prototype.configurePipeline=function(e){let t=this.modelPipelineStages;t.length=0;let n=this._model,i=e.fog.enabled&&e.fog.renderable;if(l(n.color)&&t.push(EA),l(n.classificationType))return;n.imageBasedLighting.enabled&&t.push(AF),n.isClippingEnabled()&&t.push(CF);let r=(n._clippingPolygonData?.polygonRings.length??0)>0;n.isClippingPolygonsEnabled()&&r&&t.push(wF),n.hasDrapedVectors()&&t.push(DF),n.hasSilhouette(e)&&t.push(QB),l(n.splitDirection)&&n.splitDirection!==jo.NONE&&t.push(t2),Wo.is3DTiles(n.type)&&t.push(mF),i&&t.push(_F)};dl.prototype.update=function(e,t){let n,i,r;for(n=0;n<this._runtimeNodes.length;n++){let o=this._runtimeNodes[n];if(!l(o))continue;for(i=0;i<o.updateStages.length;i++)o.updateStages[i].update(o,this,e);let s=e.mode!==re.SCENE3D&&this._model._projectTo2D;for(t&&!s&&this.updateJointMatrices(),i=0;i<o.runtimePrimitives.length;i++){let a=o.runtimePrimitives[i];for(r=0;r<a.updateStages.length;r++)a.updateStages[r].update(a,this)}}};dl.prototype.updateModelMatrix=function(e,t){Pbe(this,e),t.mode!==re.SCENE3D&&Kat(this,t);let n=this._rootNodes;for(let i=0;i<n.length;i++){let r=this._runtimeNodes[n[i]];r._transformDirty=!0}};dl.prototype.updateJointMatrices=function(){let e=this._skinnedNodes,t=e.length;for(let n=0;n<t;n++){let i=e[n];this._runtimeNodes[i].updateJointMatrices()}};function Rbe(e,t,n,i,r){if(n&&!t.show)return;let o=t.children.length;for(let c=0;c<o;c++){let u=t.getChild(c);Rbe(e,u,n,i,r)}let s=t.runtimePrimitives,a=s.length;for(let c=0;c<a;c++){let u=s[c];i(u,r)}}function LH(e,t,n,i){let r=e._rootNodes,o=r.length;for(let s=0;s<o;s++){let a=r[s],c=e._runtimeNodes[a];Rbe(e,c,t,n,i)}}var ect={backFaceCulling:void 0};dl.prototype.updateBackFaceCulling=function(e){let t=ect;t.backFaceCulling=e,LH(this,!1,tct,t)};function tct(e,t){let n=e.drawCommand;n.backFaceCulling=t.backFaceCulling}var nct={shadowMode:void 0};dl.prototype.updateShadows=function(e){let t=nct;t.shadowMode=e,LH(this,!1,ict,t)};function ict(e,t){let n=e.drawCommand;n.shadows=t.shadowMode}var rct={debugShowBoundingVolume:void 0};dl.prototype.updateShowBoundingVolume=function(e){let t=rct;t.debugShowBoundingVolume=e,LH(this,!1,oct,t)};function oct(e,t){let n=e.drawCommand;n.debugShowBoundingVolume=t.debugShowBoundingVolume}var Obe=[],Mbe=[],Nbe=[],sct={frameState:void 0,hasSilhouette:void 0};dl.prototype.pushDrawCommands=function(e){let t=Obe;t.length=0;let n=Mbe;n.length=0;let i=Nbe;i.length=0;let r=sct;r.hasSilhouette=this._model.hasSilhouette(e),r.frameState=e,LH(this,!0,act,r),Zn(e.commandList,t),Zn(e.commandList,n),Zn(e.commandList,i)};function act(e,t){let n=t.frameState,i=t.hasSilhouette,r=n.passes,o=Obe,s=Mbe,a=Nbe,c=e.drawCommand;c.pushCommands(n,n.commandList);let u=e.primitive.material;l(u)&&l(u.planarFill)&&(n.planarFillRequested=!0),i&&!r.pick&&c.pushSilhouetteCommands(n,o),l(c.pushEdgeCommands)&&c.pushEdgeCommands(n,s),l(c.pushPlanarFillIdCommands)&&c.pushPlanarFillIdCommands(n,a)}dl.prototype.setArticulationStage=function(e,t){let n=e.split(" ");if(n.length!==2)return;let i=n[0],r=n[1],o=this._runtimeArticulations[i];l(o)&&o.setArticulationStage(r,t)};dl.prototype.applyArticulations=function(){let e=this._runtimeArticulations;for(let t in e)e.hasOwnProperty(t)&&e[t].apply()};var f2=dl;function IA(){this.pointsLength=0,this.trianglesLength=0,this.geometryByteLength=0,this.texturesByteLength=0,this.propertyTablesByteLength=0,this._bufferIdSet={},this._textureIdByteLengths={},this._batchTextureIdMap=new Ut}Object.defineProperties(IA.prototype,{batchTexturesByteLength:{get:function(){let e=this._batchTextureIdMap.length,t=this._batchTextureIdMap.values,n=0;for(let i=0;i<e;i++)n+=t[i].byteLength;return n}}});IA.prototype.clear=function(){this.pointsLength=0,this.trianglesLength=0,this.geometryByteLength=0,this.texturesByteLength=0,this.propertyTablesByteLength=0,this._bufferIdSet={},this._textureIdByteLengths={},this._batchTextureIdMap.removeAll()};IA.prototype.addBuffer=function(e,t){if(!this._bufferIdSet.hasOwnProperty(e._id)){let n=t?2:1;this.geometryByteLength+=e.sizeInBytes*n}this._bufferIdSet[e._id]=!0};IA.prototype.addTexture=function(e){this._textureIdByteLengths.hasOwnProperty(e._id)||(this.texturesByteLength+=e.sizeInBytes,this._textureIdByteLengths[e._id]=e.sizeInBytes)};IA.prototype.getTextureIds=function(){return Object.keys(this._textureIdByteLengths)};IA.prototype.getTextureByteLengthById=function(e){return this._textureIdByteLengths[e]};IA.prototype.addBatchTexture=function(e){this._batchTextureIdMap.contains(e._id)||this._batchTextureIdMap.set(e._id,e)};var d2=IA;var kbe=Qo(mj(),1);var Lbe={},ST=Uint32Array.BYTES_PER_ELEMENT;Lbe.parse=function(e,t){t=t??0;let n=new Uint8Array(e),i=new DataView(e);t+=ST;let r=i.getUint32(t,!0);if(r!==1)throw new oe(`Only Point Cloud tile version 1 is supported. Version ${r} is not.`);t+=ST,t+=ST;let o=i.getUint32(t,!0);if(o===0)throw new oe("Feature table must have a byte length greater than zero");t+=ST;let s=i.getUint32(t,!0);t+=ST;let a=i.getUint32(t,!0);t+=ST;let c=i.getUint32(t,!0);t+=ST;let u=Ro(n,t,o);t+=o;let f=new Uint8Array(e,t,s);t+=s;let d,p;a>0&&(d=Ro(n,t,a),Object.keys(d).length===0&&(d=void 0),t+=a,c>0&&(p=new Uint8Array(e,t,c),p=new Uint8Array(p)));let g=new hm(u,f),m=g.getGlobalProperty("POINTS_LENGTH");if(g.featuresLength=m,!l(m))throw new oe("Feature table global property: POINTS_LENGTH must be defined");let y=g.getGlobalProperty("RTC_CENTER",Y.FLOAT,3);l(y)&&(y=h.unpack(y));let A=lct(g,d);if(A.rtcCenter=y,A.pointsLength=m,!A.hasPositions){let b=uct(g);A.positions=b,A.hasPositions=A.hasPositions||l(b)}if(!A.hasPositions)throw new oe("Either POSITION or POSITION_QUANTIZED must be defined.");if(!A.hasNormals){let b=dct(g);A.normals=b,A.hasNormals=A.hasNormals||l(b)}if(!A.hasColors){let b=fct(g);A.colors=b,A.hasColors=A.hasColors||l(b),A.hasConstantColor=l(A.constantColor),A.isTranslucent=l(b)&&b.isTranslucent}if(!A.hasBatchIds){let b=hct(g);A.batchIds=b,A.hasBatchIds=A.hasBatchIds||l(b)}if(A.hasBatchIds){let b=g.getGlobalProperty("BATCH_LENGTH");if(!l(b))throw new oe("Global property: BATCH_LENGTH must be defined when BATCH_ID is defined.");A.batchLength=b}return(l(d)||l(p))&&(A.batchTableJson=d,A.batchTableBinary=p),cct(A),A};function cct(e){let t=e.batchTableJson;if(!l(t))return;let n=e.batchTableBinary;if(l(n))return;let i=Object.keys(e.draco?.batchTableProperties??{}),r=[];for(let o of Object.keys(t)){let a=t[o].byteOffset;l(a)&&(i.includes(o)||r.push(o))}for(let o of r)_t("PntsParser-invalidBinaryBodyReference",`The point cloud data contained a binary property ${o} that could not be resolved - skipping`),delete t[o]}function lct(e,t){let n=e.json,i,r,o,s=l(n.extensions)?n.extensions["3DTILES_draco_point_compression"]:void 0,a=l(t)&&l(t.extensions)?t.extensions["3DTILES_draco_point_compression"]:void 0;l(a)&&(o=a.properties);let c,u,f,d,p;if(l(s)){r=s.properties;let m=s.byteOffset,y=s.byteLength;if(!l(r)||!l(m)||!l(y))throw new oe("Draco properties, byteOffset, and byteLength must be defined");i=e.buffer.slice(m,m+y),c=l(r.POSITION),u=l(r.RGB)||l(r.RGBA),f=l(r.NORMAL),d=l(r.BATCH_ID),p=l(r.RGBA)}let g;return l(i)&&(g={buffer:i,featureTableProperties:r,batchTableProperties:o,properties:Ot(r,o),dequantizeInShader:!0}),{draco:g,hasPositions:c,hasColors:u,isTranslucent:p,hasNormals:f,hasBatchIds:d}}function uct(e){let t=e.json,n;if(l(t.POSITION))return n=e.getPropertyArray("POSITION",Y.FLOAT,3),{name:ct.POSITION,semantic:ct.POSITION,typedArray:n,isQuantized:!1,componentDatatype:Y.FLOAT,type:Vt.VEC3};if(l(t.POSITION_QUANTIZED)){n=e.getPropertyArray("POSITION_QUANTIZED",Y.UNSIGNED_SHORT,3);let i=e.getGlobalProperty("QUANTIZED_VOLUME_SCALE",Y.FLOAT,3);if(!l(i))throw new oe("Global property: QUANTIZED_VOLUME_SCALE must be defined for quantized positions.");let r=65535,o=e.getGlobalProperty("QUANTIZED_VOLUME_OFFSET",Y.FLOAT,3);if(!l(o))throw new oe("Global property: QUANTIZED_VOLUME_OFFSET must be defined for quantized positions.");return{name:ct.POSITION,semantic:ct.POSITION,typedArray:n,isQuantized:!0,componentDatatype:Y.FLOAT,type:Vt.VEC3,quantizedRange:r,quantizedVolumeOffset:h.unpack(o),quantizedVolumeScale:h.unpack(i),quantizedComponentDatatype:Y.UNSIGNED_SHORT,quantizedType:Vt.VEC3}}}function fct(e){let t=e.json,n;if(l(t.RGBA))return n=e.getPropertyArray("RGBA",Y.UNSIGNED_BYTE,4),{name:ct.COLOR,semantic:ct.COLOR,setIndex:0,typedArray:n,componentDatatype:Y.UNSIGNED_BYTE,type:Vt.VEC4,normalized:!0,isRGB565:!1,isTranslucent:!0};if(l(t.RGB))return n=e.getPropertyArray("RGB",Y.UNSIGNED_BYTE,3),{name:"COLOR",semantic:ct.COLOR,setIndex:0,typedArray:n,componentDatatype:Y.UNSIGNED_BYTE,type:Vt.VEC3,normalized:!0,isRGB565:!1,isTranslucent:!1};if(l(t.RGB565))return n=e.getPropertyArray("RGB565",Y.UNSIGNED_SHORT,1),{name:"COLOR",semantic:ct.COLOR,setIndex:0,typedArray:n,componentDatatype:Y.FLOAT,type:Vt.VEC3,normalized:!1,isRGB565:!0,isTranslucent:!1};if(l(t.CONSTANT_RGBA)){let i=e.getGlobalProperty("CONSTANT_RGBA",Y.UNSIGNED_BYTE,4),r=i[3],o=z.fromBytes(i[0],i[1],i[2],r),s=r<255;return{name:ct.COLOR,semantic:ct.COLOR,setIndex:0,constantColor:o,componentDatatype:Y.FLOAT,type:Vt.VEC4,isQuantized:!1,isTranslucent:s}}}function dct(e){let t=e.json,n;if(l(t.NORMAL))return n=e.getPropertyArray("NORMAL",Y.FLOAT,3),{name:ct.NORMAL,semantic:ct.NORMAL,typedArray:n,octEncoded:!1,octEncodedZXY:!1,componentDatatype:Y.FLOAT,type:Vt.VEC3};if(l(t.NORMAL_OCT16P))return n=e.getPropertyArray("NORMAL_OCT16P",Y.UNSIGNED_BYTE,2),{name:ct.NORMAL,semantic:ct.NORMAL,typedArray:n,octEncoded:!0,octEncodedZXY:!1,quantizedRange:(1<<8)-1,quantizedType:Vt.VEC2,quantizedComponentDatatype:Y.UNSIGNED_BYTE,componentDatatype:Y.FLOAT,type:Vt.VEC3}}function hct(e){let t=e.json;if(l(t.BATCH_ID)){let n=e.getPropertyArray("BATCH_ID",Y.UNSIGNED_SHORT,1);return{name:ct.FEATURE_ID,semantic:ct.FEATURE_ID,setIndex:0,typedArray:n,componentDatatype:Y.fromTypedArray(n),type:Vt.SCALAR}}}var wT=Lbe;var mct=Cn.Components,pct=Cn.Scene,gct=Cn.Node,_ct=Cn.Primitive,yct=Cn.Attribute,Fbe=Cn.Quantization,Act=Cn.FeatureIdAttribute,bct=Cn.Material,xct=Cn.MetallicRoughness,MZ=class extends nr{constructor(t){super(),t=t??H.EMPTY_OBJECT;let n=t.arrayBuffer,i=t.byteOffset??0;this._arrayBuffer=n,this._byteOffset=i,this._loadAttributesFor2D=t.loadAttributesFor2D??!1,this._parsedContent=void 0,this._decodePromise=void 0,this._decodedAttributes=void 0,this._promise=void 0,this._error=void 0,this._state=Tt.UNLOADED,this._buffers=[],this._components=void 0,this._transform=N.IDENTITY}get cacheKey(){}get components(){return this._components}get transform(){return this._transform}load(){if(l(this._promise))return this._promise;this._parsedContent=wT.parse(this._arrayBuffer,this._byteOffset),this._state=Tt.PROCESSING,this._promise=Promise.resolve(this)}process(t){if(l(this._error)){let n=this._error;throw this._error=void 0,n}if(this._state===Tt.READY)return!0;if(this._state===Tt.PROCESSING){if(l(this._decodePromise))return!1;this._decodePromise=Tct(this,t.context)}return!1}unload(){let t=this._buffers;for(let n=0;n<t.length;n++)t[n].destroy();t.length=0,this._components=void 0,this._parsedContent=void 0,this._arrayBuffer=void 0}};function Tct(e,t){let i=e._parsedContent.draco,r;if(l(i)?r=Fg.decodePointCloud(i,t):r=Promise.resolve(),!!l(r))return e._decodePromise=r,r.then(function(o){if(!e.isDestroyed())return l(o)&&Ect(e,i,o),Nct(e,t),e._state=Tt.READY,e}).catch(function(o){e.unload(),e._state=Tt.FAILED;let s="Failed to load Draco pnts";e._error=e.getError(s,o)})}function Ect(e,t,n){e._state=Tt.READY;let i=e._parsedContent,r;if(l(n.POSITION)){if(r={name:"POSITION",semantic:ct.POSITION,typedArray:n.POSITION.array,componentDatatype:Y.FLOAT,type:Vt.VEC3,isQuantized:!1},l(n.POSITION.data.quantization)){let a=n.POSITION.data.quantization,c=a.range,u=h.fromElements(c,c,c),f=h.unpack(a.minValues),d=(1<<a.quantizationBits)-1;r.isQuantized=!0,r.quantizedRange=d,r.quantizedVolumeOffset=f,r.quantizedVolumeScale=u,r.quantizedComponentDatatype=d<=255?Y.UNSIGNED_BYTE:Y.UNSIGNED_SHORT,r.quantizedType=Vt.VEC3}i.positions=r}if(l(n.NORMAL)){if(r={name:"NORMAL",semantic:ct.NORMAL,typedArray:n.NORMAL.array,componentDatatype:Y.FLOAT,type:Vt.VEC3,isQuantized:!1,octEncoded:!1,octEncodedZXY:!1},l(n.NORMAL.data.quantization)){let a=(1<<n.NORMAL.data.quantization.quantizationBits)-1;r.quantizedRange=a,r.octEncoded=!0,r.octEncodedZXY=!0,r.quantizedComponentDatatype=Y.UNSIGNED_BYTE,r.quantizedType=Vt.VEC2}i.normals=r}if(l(n.RGBA)?i.colors={name:"COLOR",semantic:ct.COLOR,setIndex:0,typedArray:n.RGBA.array,componentDatatype:Y.UNSIGNED_BYTE,type:Vt.VEC4,normalized:!0,isTranslucent:!0}:l(n.RGB)&&(i.colors={name:"COLOR",semantic:ct.COLOR,setIndex:0,typedArray:n.RGB.array,componentDatatype:Y.UNSIGNED_BYTE,type:Vt.VEC3,normalized:!0,isTranslucent:!1}),l(n.BATCH_ID)){let a=n.BATCH_ID.array;i.batchIds={name:"_FEATURE_ID",semantic:ct.FEATURE_ID,setIndex:0,typedArray:a,componentDatatype:Y.fromTypedArray(a),type:Vt.SCALAR}}let o=i.batchTableJson,s=t.batchTableProperties;for(let a in s)if(s.hasOwnProperty(a)){let c=n[a];l(o)||(o={}),i.hasDracoBatchTable=!0;let u=c.data;o[a]={byteOffset:u.byteOffset,type:Cct(u.componentsPerAttribute),componentType:vct(u.componentDatatype),typedArray:c.array}}i.batchTableJson=o}function Cct(e){switch(e){case 1:return"SCALAR";case 2:return"VEC2";case 3:return"VEC3";case 4:return"VEC4"}}function vct(e){switch(e){case te.BYTE:return"BYTE";case te.UNSIGNED_BYTE:return"UNSIGNED_BYTE";case te.SHORT:return"SHORT";case te.UNSIGNED_SHORT:return"UNSIGNED_SHORT";case te.INT:return"INT";case te.UNSIGNED_INT:return"UNSIGNED_INT";case te.DOUBLE:return"DOUBLE";case te.FLOAT:return"FLOAT"}}function h2(e,t,n){let i=t.typedArray,r;if(t.octEncoded&&(r=new Fbe,r.octEncoded=t.octEncoded,r.octEncodedZXY=t.octEncodedZXY,r.normalizationRange=t.quantizedRange,r.type=t.quantizedType,r.componentDatatype=t.quantizedComponentDatatype),t.isQuantized){r=new Fbe;let a=t.quantizedRange;r.normalizationRange=a,r.quantizedVolumeOffset=h.ZERO;let c=t.quantizedVolumeScale;r.quantizedVolumeDimensions=c,r.quantizedVolumeStepSize=h.divideByScalar(c,a,new h),r.componentDatatype=t.quantizedComponentDatatype,r.type=t.quantizedType}let o=new yct;if(o.name=t.name,o.semantic=t.semantic,o.setIndex=t.setIndex,o.componentDatatype=t.componentDatatype,o.type=t.type,o.normalized=t.normalized??!1,o.min=t.min,o.max=t.max,o.quantization=r,t.isRGB565&&(i=cn.decodeRGB565(i)),l(t.constantColor)){let a=new Array(4);o.constant=z.pack(t.constantColor,a)}else{let a=tt.createVertexBuffer({typedArray:i,context:n,usage:Me.STATIC_DRAW});a.vertexArrayDestroyable=!1,e._buffers.push(a),o.buffer=a}let s=e._loadAttributesFor2D;return o.semantic===ct.POSITION&&s&&(o.typedArray=i),o}var Bbe,FH;function Sct(e){if(!l(FH)){Bbe=new kbe.default(0),FH=new Array(e);for(let t=0;t<e;++t)FH[t]=Bbe.random()}return FH}var wct=new h,Ict=new h,Pct=new h;function Dct(e){let t=e.typedArray,n=20,i=t.length/3,r=Math.min(i,n),o=Sct(n),s=Number.MAX_VALUE,a=-Number.MAX_VALUE,c=h.fromElements(s,s,s,wct),u=h.fromElements(a,a,a,Ict),f,d,p;if(e.isQuantized)c=h.ZERO,u=e.quantizedVolumeScale;else for(f=0;f<r;++f)d=Math.floor(o[f]*i),p=h.unpack(t,d*3,Pct),h.minimumByComponent(c,p,c),h.maximumByComponent(u,p,u);e.min=h.clone(c),e.max=h.clone(u)}var Rct={name:ct.COLOR,semantic:ct.COLOR,setIndex:0,constantColor:z.DARKGRAY,componentDatatype:Y.FLOAT,type:Vt.VEC4,isQuantized:!1,isTranslucent:!1};function Oct(e,t,n){let i=[],r,o=t.positions;return l(o)&&(Dct(o),r=h2(e,o,n),r.count=t.pointsLength,i.push(r)),l(t.normals)&&(r=h2(e,t.normals,n),r.count=t.pointsLength,i.push(r)),l(t.colors)?(r=h2(e,t.colors,n),r.count=t.pointsLength,i.push(r)):(r=h2(e,Rct,n),r.count=t.pointsLength,i.push(r)),l(t.batchIds)&&(r=h2(e,t.batchIds,n),r.count=t.pointsLength,i.push(r)),i}function Mct(e,t){let n=e.batchLength,i=e.pointsLength,r=e.batchTableJson,o=e.batchTableBinary,s=!l(e.batchIds);return l(o)||l(r)||e.hasDracoBatchTable?Xg({count:n??i,batchTable:r,binaryBody:o,parseAsPropertyAttributes:s,customAttributeOutput:t}):new Va({schema:{},propertyTables:[]})}function Nct(e,t){let n=e._parsedContent,i=new xct;i.metallicFactor=0,i.roughnessFactor=.9;let r=new bct;r.metallicRoughness=i;let o=n.colors;l(o)&&o.isTranslucent&&(r.alphaMode=Gp.BLEND);let s=!l(n.normals);r.unlit=s;let a=new _ct;if(a.attributes=Oct(e,n,t),a.primitiveType=Oe.POINTS,a.material=r,l(n.batchIds)){let g=new Act;g.propertyTableId=0,g.setIndex=0,g.positionalLabel="featureId_0",a.featureIds.push(g)}let c=new gct;c.index=0,c.primitives=[a];let u=new pct;u.nodes=[c],u.upAxis=Hi.Z,u.forwardAxis=Hi.X;let f=new mct;f.scene=u,f.nodes=[c];let d=[];f.structuralMetadata=Mct(n,d),d.length>0&&Lct(e,a,d,t),l(n.rtcCenter)&&(f.transform=N.multiplyByTranslation(f.transform,n.rtcCenter,f.transform));let p=n.positions;l(p)&&p.isQuantized&&(f.transform=N.multiplyByTranslation(f.transform,p.quantizedVolumeOffset,f.transform)),e._components=f,e._parsedContent=void 0,e._arrayBuffer=void 0}function Lct(e,t,n,i){let r=t.attributes,o=n.length;for(let s=0;s<o;s++){let a=n[s],c=tt.createVertexBuffer({typedArray:a.typedArray,context:i,usage:Me.STATIC_DRAW});c.vertexArrayDestroyable=!1,e._buffers.push(c),a.buffer=c,a.typedArray=void 0,r.push(a)}t.propertyAttributeIds=[0]}var m2=MZ;var BH=new h,Ube=new h,zbe=new h,p2=new h,Fct=new h,Bct=new h,kct=new he,Uct=new ue;function kH(e,t,n,i){let r=t*n;return i.x=e[r],i.y=e[r+1],i.z=e[r+2],i}var zct=32,NZ=new Map,LZ=[];function Vct(e,t,n,i,r,o){let s=e.origin.x,a=e.origin.y,c=e.origin.z,u=e.direction.x,f=e.direction.y,d=e.direction.z,p=D.EPSILON6;for(let g=0;g<i;g+=3){let m=n[g]*3,y=n[g+1]*3,A=n[g+2]*3,b=t[m],x=t[m+1],T=t[m+2],E=t[y]-b,v=t[y+1]-x,S=t[y+2]-T,I=t[A]-b,R=t[A+1]-x,O=t[A+2]-T,L=f*O-d*R,_=d*I-u*O,C=u*R-f*I,w=E*L+v*_+S*C,P=s-b,M=a-x,F=c-T,V;if(r){if(w<p)continue;let B=P*L+M*_+F*C;if(B<0||B>w)continue;let j=M*S-F*v,k=F*E-P*S,G=P*v-M*E,q=u*j+f*k+d*G;if(q<0||B+q>w)continue;V=(I*j+R*k+O*G)/w}else{if(Math.abs(w)<p)continue;let B=1/w,j=(P*L+M*_+F*C)*B;if(j<0||j>1)continue;let k=M*S-F*v,G=F*E-P*S,q=P*v-M*E,Q=(u*k+f*G+d*q)*B;if(Q<0||j+Q>1)continue;V=(I*k+R*G+O*q)*B}V>=0&&V<o&&(o=V)}return o}function sw(e,t,n,i,r,o,s){if(!e._ready||n.mode===re.MORPHING)return;let a=Number.MAX_VALUE;o=o??ee.default,i=i??1,r=r??0;let c=n.mode!==re.SCENE3D?n.mapProjection:void 0;if(ba.forEachPrimitive(e,{mapProjection:c},function(u,f,d,p){if(l(u.boundingSphere)&&d.length===1){let T=ue.transform(u.boundingSphere,p,Uct),E=_i.raySphere(t,T);if(!l(E))return}if(!l(f.indices))return;let g,m,y=xt.getAttributeBySemantic(f,ct.POSITION),A=NZ.get(f);l(A)||(A={},l(y)&&(A.vertices=ba.readAttributeAsTypedArray(y)),l(f.indices)&&(A.indices=ba.readIndicesAsTypedArray(f.indices)),NZ.set(f,A),LZ.push(f),LZ.length>zct&&NZ.delete(LZ.shift())),l(y)&&(m=Vt.getNumberOfComponents(y.type),g=A.vertices);let b=A.indices;if(!l(b)||!l(g))return;let x=b.length;if(d.length===1&&i===1){let T=d[0].transform;if(!l(A.world)||!N.equals(A.worldTransform,T)){let I=g.length/m,R=new Float64Array(I*3);for(let O=0;O<I;O++)kH(g,O,m,BH),N.multiplyByPoint(T,BH,p2),R[O*3]=p2.x,R[O*3+1]=p2.y,R[O*3+2]=p2.z;A.world=R,A.worldTransform=N.clone(T,A.worldTransform)}let E=A.world,v=e.backFaceCulling??!0,S=Vct(t,E,b,x,v,a);S<a&&(a=S);return}for(let T=0;T<x;T+=3){let E=b[T],v=b[T+1],S=b[T+2];kH(g,E,m,BH),kH(g,v,m,Ube),kH(g,S,m,zbe);for(let I of d){let R=N.multiplyByPoint(I.transform,BH,p2),O=N.multiplyByPoint(I.transform,Ube,Fct),L=N.multiplyByPoint(I.transform,zbe,Bct);i!==1&&(Ar.getPosition(R,o,i,r,R),Ar.getPosition(O,o,i,r,O),Ar.getPosition(L,o,i,r,L));let _=_i.rayTriangleParametric(t,R,O,L,e.backFaceCulling??!0);l(_)&&_<a&&_>=0&&(a=_)}}}),a!==Number.MAX_VALUE){if(s=pn.getPoint(t,a,s),n.mode!==re.SCENE3D){h.fromElements(s.y,s.z,s.x,s);let u=n.mapProjection,f=u.ellipsoid,d=u.unproject(s,kct);f.cartographicToCartesian(d,s)}return s}}var FZ=class{constructor(t){this.show=t.show,this.alpha=t.alpha,this.brightness=t.brightness,this.contrast=t.contrast,this.hue=t.hue,this.saturation=t.saturation,this.gamma=t.gamma,this.colorToAlpha=t.colorToAlpha}},g2=FZ;var BZ=class{constructor(t){this._model=t,this._modelPrimitiveImageries=void 0,this._imageryConfigurations=[]}update(t){if(!this._hasImagery){this._deleteModelPrimitiveImageries();return}this._allImageryLayersReady&&(l(this._modelPrimitiveImageries)||(this._modelPrimitiveImageries=this._createModelPrimitiveImageries()),this._updateModelPrimitiveImageries(t),this._checkForModifiedImageryConfigurations())}_createModelPrimitiveImageries(){let t=this._model,n=this._collectRuntimeNodesAndPrimitives(),i=[],r=n.length;for(let o=0;o<r;o++){let s=n[o],a=s.runtimeNode,c=s.runtimePrimitive,u=new ET(t,a,c);c.primitive.modelPrimitiveImagery=u,i.push(u)}return i}_collectRuntimeNodesAndPrimitives(){let i=this._model.sceneGraph._runtimeNodes,r=[];for(let o=0;o<i.length;o++){let s=i[o];if(l(s))for(let a=0;a<s.runtimePrimitives.length;a++){let c=s.runtimePrimitives[a];r.push({runtimeNode:s,runtimePrimitive:c})}}return r}_updateModelPrimitiveImageries(t){if(!l(this._modelPrimitiveImageries))throw new pe("The modelPrimitiveImageries have not been created");let n=this._modelPrimitiveImageries,i=n.length;for(let r=0;r<i;r++)n[r].update(t)}_deleteModelPrimitiveImageries(){let t=this._modelPrimitiveImageries;if(!l(t))return;let n=t.length;for(let i=0;i<n;i++)t[i].destroy();delete this._modelPrimitiveImageries,this._model.resetDrawCommands()}get ready(){return this._hasImagery?!(!this._allImageryLayersReady||!this._allModelPrimitiveImageriesReady):!0}get _hasImagery(){let n=this._model.imageryLayers;return l(n)&&n.length>0}get _allImageryLayersReady(){if(!this._hasImagery)return!0;let t=this._model.imageryLayers,n=t.length;for(let i=0;i<n;i++)if(!t.get(i).ready)return!1;return!0}get _allModelPrimitiveImageriesReady(){let t=this._modelPrimitiveImageries;if(!l(t))return!1;let n=t.length;for(let i=0;i<n;i++)if(!t[i].ready)return!1;return!0}_checkForModifiedImageryConfigurations(){this._imageryConfigurationsModified()&&(this._updateImageryConfigurations(),this._model.resetDrawCommands())}_imageryConfigurationsModified(){let n=this._model.imageryLayers,i=this._imageryConfigurations;if(n.length!==i.length)return!0;for(let r=0;r<n.length;r++){let o=n.get(r),s=i[r];if(o.show!==s.show||o.alpha!==s.alpha||o.brightness!==s.brightness||o.contrast!==s.contrast||o.hue!==s.hue||o.saturation!==s.saturation||o.gamma!==s.gamma||o.colorToAlpha!==s.colorToAlpha)return!0}return!1}_updateImageryConfigurations(){let n=this._model.imageryLayers,i=this._imageryConfigurations;i.length=n.length;for(let r=0;r<n.length;r++){let o=n.get(r);i[r]=new g2(o)}}isDestroyed(){return!1}destroy(){if(!this.isDestroyed())return this._deleteModelPrimitiveImageries(),le(this)}},_2=BZ;function Cr(e){e=e??H.EMPTY_OBJECT,this._loader=e.loader,this._resource=e.resource,this.type=e.type??Wo.GLTF,this.modelMatrix=N.clone(e.modelMatrix??N.IDENTITY),this._modelMatrix=N.clone(this.modelMatrix),this._scale=e.scale??1,this._minimumPixelSize=e.minimumPixelSize??0,this._maximumScale=e.maximumScale,this._clampedScale=l(this._maximumScale)?Math.min(this._scale,this._maximumScale):this._scale,this._computedScale=this._clampedScale,this._updateModelMatrix=!1,this.referenceMatrix=void 0,this._iblReferenceFrameMatrix=$.clone($.IDENTITY),this._clippingPlanesMatrix=N.clone(N.IDENTITY),this._resourcesLoaded=!1,this._drawCommandsBuilt=!1,this._ready=!1,this._customShader=e.customShader,this._content=e.content,this._texturesLoaded=!1,this._defaultTexture=void 0,this._activeAnimations=new fF(this),this._clampAnimations=e.clampAnimations??!0,this._userAnimationDirty=!1,this._id=e.id,this._idDirty=!1,this._color=z.clone(e.color),this._colorBlendMode=e.colorBlendMode??ll.HIGHLIGHT,this._colorBlendAmount=e.colorBlendAmount??.5;let t=e.silhouetteColor??z.RED;this._silhouetteColor=z.clone(t),this._silhouetteSize=e.silhouetteSize??0,this._silhouetteDirty=!1,this._silhouetteId=void 0,this._cull=e.cull??!0,this._opaquePass=e.opaquePass??Ie.OPAQUE,this._allowPicking=e.allowPicking??!0,this._show=e.show??!0,this._style=void 0,this._styleDirty=!1,this._styleCommandsNeeded=void 0;let n=e.featureIdLabel??"featureId_0";typeof n=="number"&&(n=`featureId_${n}`),this._featureIdLabel=n;let i=e.instanceFeatureIdLabel??"instanceFeatureId_0";typeof i=="number"&&(i=`instanceFeatureId_${i}`),this._instanceFeatureIdLabel=i,this._featureTables=[],this._featureTableId=void 0,this._featureTableIdDirty=!0,this._pipelineResources=[],this._modelResources=[],this._pickIds=[],this._boundingSphere=new ue,this._initialRadius=void 0,this._heightReference=e.heightReference??We.NONE,this._heightDirty=this._heightReference!==We.NONE,this._removeUpdateHeightCallback=void 0,this._enableVerticalExaggeration=e.enableVerticalExaggeration??!0,this._hasVerticalExaggeration=!1,this._clampedModelMatrix=void 0,this._heightAboveSurface=void 0,this._lastSurfaceHeight=void 0,this._lastSurfaceQueryFrame=-1,this._lastSurfaceQueryMissed=!1;let r=e.scene;l(r)&&l(r.terrainProviderChanged)&&(this._terrainProviderChangedCallback=r.terrainProviderChanged.addEventListener(()=>{this._heightDirty=!0})),this._scene=r,this._distanceDisplayCondition=e.distanceDisplayCondition;let o=new Yp(e.pointCloudShading);this._pointCloudShading=o,this._attenuation=o.attenuation,this._pointCloudBackFaceCulling=o.backFaceCulling;let s=e.clippingPlanes;l(s)&&s.owner===void 0?bs.setOwner(s,this,"_clippingPlanes"):this._clippingPlanes=s,this._clippingPlanesState=0;let a=e.clippingPolygons;l(a)&&a.owner===void 0?Nc.setOwner(a,this,"_clippingPolygons"):this._clippingPolygons=a,this._clippingPolygonsState=0,this._clippingPolygonsNeedRebake=!1,this._removeClippingPolygonAdded=void 0,this._removeClippingPolygonRemoved=void 0,Hbe(this),this._vectorData=void 0,this._vectorLookupFlags=0,this._clippingPolygonData=void 0,this._rectangle=new ie,this._modelImagery=new _2(this),this._lightColor=h.clone(e.lightColor),this._imageBasedLighting=l(e.imageBasedLighting)?e.imageBasedLighting:new Kx,this._shouldDestroyImageBasedLighting=!l(e.imageBasedLighting),this._environmentMapManager=void 0;let c=new jg(e.environmentMapOptions);jg.setOwner(c,this,"_environmentMapManager"),this._backFaceCulling=e.backFaceCulling??!0,this._backFaceCullingDirty=!1,this._shadows=e.shadows??Dn.ENABLED,this._shadowsDirty=!1,this._debugShowBoundingVolumeDirty=!1,this._debugShowBoundingVolume=e.debugShowBoundingVolume??!1,this._enableDebugWireframe=e.enableDebugWireframe??!1,this._enableShowOutline=e.enableShowOutline??!0,this._debugWireframe=e.debugWireframe??!1,this._edgeDisplayMode=e.edgeDisplayMode??Wd.SURFACES_ONLY,this._debugWireframe===!0&&this._enableDebugWireframe===!1&&this.type===Wo.GLTF&&_t("model-debug-wireframe-ignored","enableDebugWireframe must be set to true in Model.fromGltf, otherwise debugWireframe will be ignored.");let u=e.credit;typeof u=="string"&&(u=new It(u)),this._credits=[],this._credit=u,this._resourceCredits=[],this._gltfCredits=[],this._showCreditsOnScreen=e.showCreditsOnScreen??!1,this._showCreditsOnScreenDirty=!0,this._splitDirection=e.splitDirection??jo.NONE,this._enableShowOutline=e.enableShowOutline??!0,this.showOutline=e.showOutline??!0,this.outlineColor=e.outlineColor??z.BLACK,this._classificationType=e.classificationType,this._statistics=new d2,this._sceneMode=void 0,this._projectTo2D=e.projectTo2D??!1,this._enablePick=e.enablePick??!1,this._fogRenderable=void 0,this._skipLevelOfDetail=!1,this._ignoreCommands=e.ignoreCommands??!1,this._errorEvent=new be,this._readyEvent=new be,this._texturesReadyEvent=new be,this._sceneGraph=void 0,this._nodesByName={},this.pickObject=e.pickObject}function kZ(e,t){if(e._errorEvent.numberOfListeners>0){e._errorEvent.raiseEvent(t);return}console.log(t)}function jct(e,t){let n=e._featureTables,i=t.propertyTables,r=i.length;for(let o=0;o<r;o++){let s=i[o],a=new hF({model:e,propertyTable:s});n.push(a)}return n}function Hct(e,t){let n=t._featureIdLabel,i=t._instanceFeatureIdLabel,r,o,s,a;for(r=0;r<e.nodes.length;r++)if(a=e.nodes[r],l(a.instances)&&(s=xt.getFeatureIdsByLabel(a.instances.featureIds,i),l(s)&&l(s.propertyTableId)))return s.propertyTableId;for(r=0;r<e.nodes.length;r++)for(a=e.nodes[r],o=0;o<a.primitives.length;o++){let c=a.primitives[o],u=xt.getFeatureIdsByLabel(c.featureIds,n);if(l(u))return u.propertyTableId}if(t._featureTables.length===1)return 0}function VZ(e,t){if(!l(e)&&!l(t))return!1;if(l(e)!==l(t))return!0;let n=e.alpha,i=t.alpha;return Math.floor(n)!==Math.floor(i)||Math.ceil(n)!==Math.ceil(i)}Object.defineProperties(Cr.prototype,{ready:{get:function(){return this._ready}},errorEvent:{get:function(){return this._errorEvent}},readyEvent:{get:function(){return this._readyEvent}},incrementallyLoadTextures:{get:function(){return this._loader.incrementallyLoadTextures??!1}},texturesReadyEvent:{get:function(){return this._texturesReadyEvent}},loader:{get:function(){return this._loader}},statistics:{get:function(){return this._statistics}},activeAnimations:{get:function(){return this._activeAnimations}},clampAnimations:{get:function(){return this._clampAnimations},set:function(e){this._clampAnimations=e}},cull:{get:function(){return this._cull}},opaquePass:{get:function(){return this._opaquePass}},pointCloudShading:{get:function(){return this._pointCloudShading},set:function(e){e!==this._pointCloudShading&&this.resetDrawCommands(),this._pointCloudShading=e}},customShader:{get:function(){return this._customShader},set:function(e){e!==this._customShader&&this.resetDrawCommands(),this._customShader=e}},sceneGraph:{get:function(){return this._sceneGraph}},content:{get:function(){return this._content}},heightReference:{get:function(){return this._heightReference},set:function(e){e!==this._heightReference&&(this._heightDirty=!0),this._heightReference=e}},distanceDisplayCondition:{get:function(){return this._distanceDisplayCondition},set:function(e){this._distanceDisplayCondition=Ht.clone(e,this._distanceDisplayCondition)}},structuralMetadata:{get:function(){return this._sceneGraph.components.structuralMetadata}},featureTableId:{get:function(){return this._featureTableId},set:function(e){this._featureTableId=e}},featureTables:{get:function(){return this._featureTables},set:function(e){this._featureTables=e}},id:{get:function(){return this._id},set:function(e){e!==this._id&&(this._idDirty=!0),this._id=e}},allowPicking:{get:function(){return this._allowPicking}},style:{get:function(){return this._style},set:function(e){this._style=e,this._styleDirty=!0}},color:{get:function(){return this._color},set:function(e){VZ(e,this._color)&&this.resetDrawCommands(),this._color=z.clone(e,this._color)}},colorBlendMode:{get:function(){return this._colorBlendMode},set:function(e){this._colorBlendMode=e}},colorBlendAmount:{get:function(){return this._colorBlendAmount},set:function(e){this._colorBlendAmount=e}},silhouetteColor:{get:function(){return this._silhouetteColor},set:function(e){if(!z.equals(e,this._silhouetteColor)){let t=VZ(e,this._silhouetteColor);this._silhouetteDirty=this._silhouetteDirty||t}this._silhouetteColor=z.clone(e,this._silhouetteColor)}},silhouetteSize:{get:function(){return this._silhouetteSize},set:function(e){if(e!==this._silhouetteSize){let t=this._silhouetteSize,n=e>0&&t===0||e===0&&t>0;this._silhouetteDirty=this._silhouetteDirty||n,this._backFaceCullingDirty=this._backFaceCullingDirty||n}this._silhouetteSize=e}},heightAboveSurface:{get:function(){return this._heightAboveSurface}},boundingSphere:{get:function(){let e=l(this._clampedModelMatrix)?this._clampedModelMatrix:this.modelMatrix;return Wbe(this,e),this._boundingSphere}},debugShowBoundingVolume:{get:function(){return this._debugShowBoundingVolume},set:function(e){this._debugShowBoundingVolume!==e&&(this._debugShowBoundingVolumeDirty=!0),this._debugShowBoundingVolume=e}},debugWireframe:{get:function(){return this._debugWireframe},set:function(e){this._debugWireframe!==e&&this.resetDrawCommands(),this._debugWireframe=e,this._debugWireframe===!0&&this._enableDebugWireframe===!1&&this.type===Wo.GLTF&&_t("model-debug-wireframe-ignored","enableDebugWireframe must be set to true in Model.fromGltfAsync, otherwise debugWireframe will be ignored.")}},edgeDisplayMode:{get:function(){return this._edgeDisplayMode},set:function(e){this._edgeDisplayMode=e}},show:{get:function(){return this._show},set:function(e){this._show=e}},featureIdLabel:{get:function(){return this._featureIdLabel},set:function(e){typeof e=="number"&&(e=`featureId_${e}`),e!==this._featureIdLabel&&(this._featureTableIdDirty=!0),this._featureIdLabel=e}},instanceFeatureIdLabel:{get:function(){return this._instanceFeatureIdLabel},set:function(e){typeof e=="number"&&(e=`instanceFeatureId_${e}`),e!==this._instanceFeatureIdLabel&&(this._featureTableIdDirty=!0),this._instanceFeatureIdLabel=e}},clippingPlanes:{get:function(){return this._clippingPlanes},set:function(e){e!==this._clippingPlanes&&(bs.setOwner(e,this,"_clippingPlanes"),this.resetDrawCommands())}},clippingPolygons:{get:function(){return this._clippingPolygons},set:function(e){e!==this._clippingPolygons&&(Nc.setOwner(e,this,"_clippingPolygons"),Hbe(this),this.resetDrawCommands(),this._clippingPolygonsState=0,this._clippingPolygonsNeedRebake=!0,l(this._clippingPolygonData)&&(Nc.releaseRectangleData(this._clippingPolygonData),this._clippingPolygonData=void 0))}},enableVerticalExaggeration:{get:function(){return this._enableVerticalExaggeration},set:function(e){e!==this._enableVerticalExaggeration&&this.resetDrawCommands(),this._enableVerticalExaggeration=e}},hasVerticalExaggeration:{get:function(){return this._hasVerticalExaggeration}},imageryLayers:{get:function(){if(l(this._content)){let e=this._content.tileset;if(l(e))return e.imageryLayers}}},lightColor:{get:function(){return this._lightColor},set:function(e){l(e)!==l(this._lightColor)&&this.resetDrawCommands(),this._lightColor=h.clone(e,this._lightColor)}},imageBasedLighting:{get:function(){return this._imageBasedLighting},set:function(e){e!==this._imageBasedLighting&&(this._shouldDestroyImageBasedLighting&&!this._imageBasedLighting.isDestroyed()&&this._imageBasedLighting.destroy(),this._imageBasedLighting=e,this._shouldDestroyImageBasedLighting=!1,this.resetDrawCommands())}},environmentMapManager:{get:function(){return this._environmentMapManager},set:function(e){e!==this.environmentMapManager&&(jg.setOwner(e,this,"_environmentMapManager"),this.resetDrawCommands())}},backFaceCulling:{get:function(){return this._backFaceCulling},set:function(e){e!==this._backFaceCulling&&(this._backFaceCullingDirty=!0),this._backFaceCulling=e}},scale:{get:function(){return this._scale},set:function(e){e!==this._scale&&(this._updateModelMatrix=!0),this._scale=e}},computedScale:{get:function(){return this._computedScale}},minimumPixelSize:{get:function(){return this._minimumPixelSize},set:function(e){e!==this._minimumPixelSize&&(this._updateModelMatrix=!0),this._minimumPixelSize=e}},maximumScale:{get:function(){return this._maximumScale},set:function(e){e!==this._maximumScale&&(this._updateModelMatrix=!0),this._maximumScale=e}},shadows:{get:function(){return this._shadows},set:function(e){e!==this._shadows&&(this._shadowsDirty=!0),this._shadows=e}},credit:{get:function(){return this._credit}},showCreditsOnScreen:{get:function(){return this._showCreditsOnScreen},set:function(e){this._showCreditsOnScreen!==e&&(this._showCreditsOnScreenDirty=!0),this._showCreditsOnScreen=e}},splitDirection:{get:function(){return this._splitDirection},set:function(e){this._splitDirection!==e&&this.resetDrawCommands(),this._splitDirection=e}},classificationType:{get:function(){return this._classificationType}},pickIds:{get:function(){return this._pickIds}},styleCommandsNeeded:{get:function(){return this._styleCommandsNeeded}}});Cr.prototype.getRectangle=function(e){let t=this._content?.tile?.contentBoundingVolume;return l(t?.rectangle)?t.rectangle:(e=e??this._scene?.ellipsoid??ee.default,ie.fromBoundingSphere(this.boundingSphere,e,this._rectangle))};Cr.prototype.getNode=function(e){return this._nodesByName[e]};Cr.prototype.setArticulationStage=function(e,t){this._sceneGraph.setArticulationStage(e,t)};Cr.prototype.applyArticulations=function(){this._sceneGraph.applyArticulations()};Cr.prototype.getExtension=function(e){return this._loader.components.extensions[e]};Cr.prototype.makeStyleDirty=function(){this._styleDirty=!0};Cr.prototype.resetDrawCommands=function(){this._drawCommandsBuilt=!1};var Gct=new N,Wct=new $,qct=new N;Cr.prototype.update=function(e){let t=!1;try{t=Yct(this,e)}catch(i){if(!this._loader.incrementallyLoadTextures&&i.name==="TextureError")kZ(this,i);else{let r=xt.getError("model",this._resource,i);kZ(this,r)}}if(Xct(this,e),Kct(this,e),$ct(this,e),!this._resourcesLoaded&&t){this._resourcesLoaded=!0;let i=this._loader.components;if(!l(i)){if(this._loader.isUnloaded())return;let s=xt.getError("model",this._resource,new oe("Failed to load model."));kZ(s),this._rejectLoad=this._rejectLoad&&this._rejectLoad(s)}let r=i.structuralMetadata;l(r)&&r.propertyTableCount>0&&jct(this,r);let o=new f2({model:this,modelComponents:i});this._sceneGraph=o,this._gltfCredits=o.components.asset.credits}if(!this._resourcesLoaded||e.mode===re.MORPHING)return;let n=this._modelImagery;if(n.update(e),!(!n.ready&&!(this._content?.tileset?._asynchronouslyLoadImagery??!1))){if(Jct(this),Zct(this),Qct(this,e),elt(this),tlt(this,e),nlt(this,e),ilt(this,e),rlt(this,e),alt(this,e),clt(this,e),llt(this,e),ult(this,e),this._defaultTexture=e.context.defaultTexture,flt(this,e),hlt(this,e),glt(this),_lt(this,e),xlt(this,e),!this._ready){e.afterRender.push(()=>{this._ready=!0,this._readyEvent.raiseEvent(this)});return}this._loader.incrementallyLoadTextures&&!this._texturesLoaded&&this._loader.texturesLoaded&&(this.resetDrawCommands(),this._texturesLoaded=!0,this._texturesReadyEvent.raiseEvent(this)),Alt(this),Tlt(this,e),Elt(this),vlt(this,e)}};function Yct(e,t){return!e._resourcesLoaded||e._loader.incrementallyLoadTextures&&!e._texturesLoaded?(t.afterRender.push(()=>!0),e._loader.process(t)):!0}function Xct(e,t){l(e._customShader)&&e._customShader.update(t)}function Kct(e,t){let n=e._environmentMapManager,i=t.passes.pick||t.passes.pickVoxel;e._ready&&n.owner===e&&!i&&(n.position=e._boundingSphere.center,n.shouldUpdate=!l(e._imageBasedLighting.sphericalHarmonicCoefficients)||!l(e._imageBasedLighting.specularEnvironmentMaps),n.update(t),n.shouldRegenerateShaders&&e.resetDrawCommands())}function $ct(e,t){e._imageBasedLighting.update(t),e._imageBasedLighting.shouldRegenerateShaders&&e.resetDrawCommands()}function Jct(e){if(!e._featureTableIdDirty)return;e._featureTableIdDirty=!1;let t=e._sceneGraph.components,n=t.structuralMetadata;l(n)&&n.propertyTableCount>0&&(e.featureTableId=Hct(t,e),e._styleDirty=!0,e.resetDrawCommands())}function Zct(e){e._styleDirty&&(e.applyStyle(e._style),e._styleDirty=!1)}function Qct(e,t){let n=e._featureTables,i=n.length,r=!1;for(let o=0;o<i;o++)n[o].update(t),n[o].styleCommandsNeededDirty&&(r=!0);r&&jbe(e)}function jbe(e){let t=e.featureTables[e.featureTableId];e._styleCommandsNeeded=pm.getStyleCommandsNeeded(t.featuresLength,t.batchTexture.translucentFeaturesLength)}function elt(e){let t=e.pointCloudShading;t.attenuation!==e._attenuation&&(e.resetDrawCommands(),e._attenuation=t.attenuation),t.backFaceCulling!==e._pointCloudBackFaceCulling&&(e.resetDrawCommands(),e._pointCloudBackFaceCulling=t.backFaceCulling)}function tlt(e,t){e._silhouetteDirty&&(Ybe(t)&&e.resetDrawCommands(),e._silhouetteDirty=!1)}function nlt(e,t){let n=e.hasSkipLevelOfDetail(t);n!==e._skipLevelOfDetail&&(e.resetDrawCommands(),e._skipLevelOfDetail=n)}function ilt(e,t){let n=0;e.isClippingEnabled()&&(e._clippingPlanes.owner===e&&e._clippingPlanes.update(t),n=e._clippingPlanes.clippingPlanesState),n!==e._clippingPlanesState&&(e.resetDrawCommands(),e._clippingPlanesState=n)}function Hbe(e){e._removeClippingPolygonAdded=e._removeClippingPolygonAdded&&e._removeClippingPolygonAdded(),e._removeClippingPolygonRemoved=e._removeClippingPolygonRemoved&&e._removeClippingPolygonRemoved();let t=e._clippingPolygons;if(!l(t)||t.owner!==e)return;let n=()=>{e._clippingPolygonsNeedRebake=!0};e._removeClippingPolygonAdded=t.polygonAdded.addEventListener(n),e._removeClippingPolygonRemoved=t.polygonRemoved.addEventListener(n)}function rlt(e,t){let n=e._clippingPolygons,i=e.isClippingPolygonsEnabled(),r=0;i&&(n.owner===e&&n.update(t),r=n.clippingPolygonsState),r!==e._clippingPolygonsState&&(e.resetDrawCommands(),e._clippingPolygonsState=r);let o=(e._clippingPolygonData?.polygonRings.length??0)>0;if(e._clippingPolygonsNeedRebake&&(e._clippingPolygonsNeedRebake=!1,l(e._clippingPolygonData)&&(Nc.releaseRectangleData(e._clippingPolygonData),e._clippingPolygonData=void 0)),!i||!e._ready)return;l(e._clippingPolygonData)||(e._clippingPolygonData=n.requestRectangleData(e.getRectangle(n.ellipsoid),t.context));let s=(e._clippingPolygonData?.polygonRings.length??0)>0;o!==s&&e.resetDrawCommands()}var olt=new ie;function Gbe(e){l(e._vectorData)&&(e._scene?.vectorProvider?.releaseTileData(e._vectorData),e._vectorData=void 0)}function slt(e){if(e?.show!==!0)return 0;let t=1;return t|=e.hasPolylines?2:0,t|=e.hasPolygons?4:0,t}function alt(e,t){let n=e._scene?.vectorProvider;if(l(n)&&l(e._content)&&e.ready&&t.mode===re.SCENE3D){let o=e._content?.tile?.contentBoundingVolume.rectangle??ie.fromBoundingSphere(e.boundingSphere,n.ellipsoid,olt);e._vectorData=l(e._vectorData)?n.updateDataForRectangle(o,t.context,e._vectorData,We.CLAMP_TO_3D_TILE):n.requestDataForRectangle(o,t.context,We.CLAMP_TO_3D_TILE)}else Gbe(e);let r=slt(e._vectorData);r!==e._vectorLookupFlags&&(e.resetDrawCommands(),e._vectorLookupFlags=r)}function clt(e,t){t.mode!==e._sceneMode&&(e._projectTo2D?e.resetDrawCommands():e._updateModelMatrix=!0,e._sceneMode=t.mode)}function llt(e,t){let n=t.fog.enabled&&t.fog.renderable;n!==e._fogRenderable&&(e.resetDrawCommands(),e._fogRenderable=n)}function ult(e,t){if(e.enableVerticalExaggeration){let n=t.verticalExaggeration!==1;e.hasVerticalExaggeration!==n&&(e.resetDrawCommands(),e._hasVerticalExaggeration=n)}else e.hasVerticalExaggeration&&(e.resetDrawCommands(),e._hasVerticalExaggeration=!1)}function flt(e,t){e._drawCommandsBuilt||(e.destroyPipelineResources(),e._sceneGraph.buildDrawCommands(t),e._drawCommandsBuilt=!0)}function dlt(e,t){if(e===t)return!0;if(!l(e)||!l(t))return!1;for(let n=0;n<16;n++)if(e[n]!==t[n])return!1;return!0}function jZ(e,t){if(!l(e)||!l(t))return N.clone(e,t);for(let n=0;n<16;n++)t[n]=e[n];return t}function hlt(e,t){dlt(e.modelMatrix,e._modelMatrix)||(e._updateModelMatrix=!0,e._modelMatrix=jZ(e.modelMatrix,e._modelMatrix))}var PA=new h,UZ=new he,mlt=new he,plt=200,Vbe=30;function glt(e){let t=e.heightReference!==We.NONE&&l(e._scene)&&e._scene.frameState.frameNumber-e._lastSurfaceQueryFrame>=Vbe;if(!e._updateModelMatrix&&!e._heightDirty&&e._minimumPixelSize===0&&!t)return;if(!e._updateModelMatrix&&!e._heightDirty&&l(e._removeUpdateHeightCallback)&&!t){e._updateModelMatrix=!0;return}let n=e._scene;if(!l(n)||e.heightReference===We.NONE){l(e._removeUpdateHeightCallback)&&(e._removeUpdateHeightCallback(),e._removeUpdateHeightCallback=void 0),e._clampedModelMatrix=void 0;return}let i=n.ellipsoid??ee.default,r=e.modelMatrix;PA.x=r[12],PA.y=r[13],PA.z=r[14];let o=i.cartesianToCartographic(PA,mlt);l(e._clampedModelMatrix)||(e._clampedModelMatrix=N.clone(r,new N));let s=n.frameState.frameNumber,a=e.heightReference===We.CLIP_TO_GROUND,c=s-e._lastSurfaceQueryFrame<Vbe,u=a&&l(e._lastSurfaceHeight)&&o.height>e._lastSurfaceHeight+plt,f=u&&c,d=a&&c&&e._lastSurfaceQueryMissed;if(!((a&&e._lastSurfaceQueryMissed||u)&&l(e._removeUpdateHeightCallback))){l(e._removeUpdateHeightCallback)&&e._removeUpdateHeightCallback();let y=he.clone(o),A=Rlt(e,i,y);e._removeUpdateHeightCallback=n.updateHeight(y,b=>{let x=n.getHeight(y,e.heightReference);l(x)&&(b.height=x,e._lastSurfaceQueryFrame=n.frameState.frameNumber,e._lastSurfaceQueryMissed=!1),e._lastSurfaceHeight=b.height,A(b)},e.heightReference)}let m;f||d?m=e._lastSurfaceHeight:(e._lastSurfaceQueryFrame=s,m=n.getHeight(o,e.heightReference),e._lastSurfaceQueryMissed=!l(m),l(m)?e._lastSurfaceHeight=m:m=e._lastSurfaceHeight),l(m)?(he.clone(o,UZ),UZ.height=m,qbe(e,i,o,UZ)):jZ(r,e._clampedModelMatrix),e._heightDirty=!1,e._updateModelMatrix=!0}function _lt(e,t){if(!e._updateModelMatrix&&e._minimumPixelSize===0)return;let n=l(e._clampedModelMatrix)?e._clampedModelMatrix:e.modelMatrix;Wbe(e,n),ylt(e,n,t)}function Wbe(e,t){e._clampedScale=l(e._maximumScale)?Math.min(e._scale,e._maximumScale):e._scale,e._boundingSphere.center=h.multiplyByScalar(e._sceneGraph.boundingSphere.center,e._clampedScale,e._boundingSphere.center),e._boundingSphere.radius=e._initialRadius*e._clampedScale,e._boundingSphere=ue.transform(e._boundingSphere,t,e._boundingSphere)}function ylt(e,t,n){let i=e.scale;if(e.minimumPixelSize!==0&&!e._projectTo2D){let r=n.context,o=Math.max(r.drawingBufferWidth,r.drawingBufferHeight);N.getTranslation(t,PA),e._sceneMode!==re.SCENE3D&&dr.computeActualEllipsoidPosition(n,PA,PA);let s=e._boundingSphere.radius,a=Slt(PA,s,n),c=1/a;Math.min(c*(2*s),o)<e.minimumPixelSize&&(i=e.minimumPixelSize*a/(2*e._initialRadius))}e._computedScale=l(e.maximumScale)?Math.min(e.maximumScale,i):i}function Alt(e){if(!e._idDirty)return;e._idDirty=!1;let t=e._id,n=e._pickIds,i=n.length;for(let r=0;r<i;++r)n[r].object.id=t}var blt=new $(1,0,0,0,0,1,0,-1,0);function xlt(e,t){let n=l(e._clampedModelMatrix)?e._clampedModelMatrix:e.modelMatrix,i=e.referenceMatrix??n,r=t.context,o=Wct,s=Gct;if(s=N.multiply(r.uniformState.view3D,i,s),o=N.getRotation(s,o),o=$.transpose(o,o),e._iblReferenceFrameMatrix=$.multiply(blt,o,e._iblReferenceFrameMatrix),e.isClippingEnabled()){let a=N.multiply(i,e._clippingPlanes.modelMatrix,qct);e._clippingPlanesMatrix=N.inverseTranspose(a,e._clippingPlanesMatrix)}}function Tlt(e,t){let n=e._sceneGraph;if(e._updateModelMatrix||e._minimumPixelSize!==0){let r=l(e._clampedModelMatrix)?e._clampedModelMatrix:e.modelMatrix;n.updateModelMatrix(r,t),e._updateModelMatrix&&(e._clippingPolygonsNeedRebake=!0),e._updateModelMatrix=!1}e._backFaceCullingDirty&&(n.updateBackFaceCulling(e._backFaceCulling),e._backFaceCullingDirty=!1),e._shadowsDirty&&(n.updateShadows(e._shadows),e._shadowsDirty=!1),e._debugShowBoundingVolumeDirty&&(n.updateShowBoundingVolume(e._debugShowBoundingVolume),e._debugShowBoundingVolumeDirty=!1);let i=!1;!l(e.classificationType)&&e._show&&(i=e._userAnimationDirty||e._activeAnimations.update(t)),n.update(t,i),e._userAnimationDirty=!1}function Elt(e){if(!e._showCreditsOnScreenDirty)return;e._showCreditsOnScreenDirty=!1,e._credits.length=0;let t=e._showCreditsOnScreen;if(l(e._credit)){let s=It.clone(e._credit);s.showOnScreen=s.showOnScreen||t,e._credits.push(s)}let n=e._resourceCredits,i=n.length;for(let s=0;s<i;s++){let a=It.clone(n[s]);a.showOnScreen=a.showOnScreen||t,e._credits.push(a)}let r=e._gltfCredits,o=r.length;for(let s=0;s<o;s++){let a=It.clone(r[s]);a.showOnScreen=a.showOnScreen||t,e._credits.push(a)}}function Clt(e){return e.isClippingPolygonsEnabled()&&e._clippingPolygons.inverse&&(e._clippingPolygonData?.polygonRings.length??0)===0}function vlt(e,t){let n=Mlt(e,t),i=e.isInvisible(),r=e.hasSilhouette(t),o=e._show&&e._computedScale!==0&&n&&(!i||r)&&!Clt(e),s=t.passes,a=s.render||s.pick&&e.allowPicking;o&&!e._ignoreCommands&&a&&(Nlt(e,t),e._sceneGraph.pushDrawCommands(t))}var zZ=new ue;function Slt(e,t,n){return zZ.center=e,zZ.radius=t,n.camera.getPixelSize(zZ,n.context.drawingBufferWidth,n.context.drawingBufferHeight)}var UH=new h,wlt=new h,zH=new h,Ilt=new h,Plt=new N;function Dlt(e,t,n){let i=e._sceneGraph;if(!l(i)||!l(i._positionMin))return 0;let r=i._positionMin,o=i._positionMax,s=t.geodeticSurfaceNormalCartographic(n,Ilt),a=N.multiplyTransformation(i._components.transform,i._axisCorrectionMatrix,Plt),c=e.scale,u=e.modelMatrix,f=0;for(let d=0;d<8;d++){let p=h.fromElements(d&1?o.x:r.x,d&2?o.y:r.y,d&4?o.z:r.z,wlt);h.multiplyByScalar(p,c,p),N.multiplyByPoint(a,p,zH),N.multiplyByPointAsVector(u,zH,zH);let g=h.dot(zH,s);g<f&&(f=g)}return-f}function qbe(e,t,n,i){if(e.heightReference===We.CLIP_TO_GROUND){let o=i.height+Dlt(e,t,i);e._heightAboveSurface=Math.max(0,n.height-o),i.height=Math.max(n.height,o)}else Wy(e.heightReference)&&(i.height+=n.height);t.cartographicToCartesian(i,UH);let r=e._clampedModelMatrix;jZ(e.modelMatrix,r),r[12]=UH.x,r[13]=UH.y,r[14]=UH.z,e._heightDirty=!0}function Rlt(e,t,n){return function(i){qbe(e,t,n,i)}}var Olt=new h;function Mlt(e,t){let n=e.distanceDisplayCondition;if(!l(n))return!0;let i=n.near*n.near,r=n.far*n.far,o;if(t.mode===re.SCENE2D){let a=(t.camera.frustum.right-t.camera.frustum.left)*.5;o=a*a}else{let s=N.getTranslation(e.modelMatrix,Olt);dr.computeActualEllipsoidPosition(t,s,s),o=h.distanceSquared(s,t.camera.positionWC)}return o>=i&&o<=r}function Nlt(e,t){let n=t.creditDisplay,i=e._credits,r=i.length;for(let o=0;o<r;o++)n.addCreditToNextFrame(i[o])}Cr.prototype.isTranslucent=function(){let e=this.color;return l(e)&&e.alpha>0&&e.alpha<1};Cr.prototype.isInvisible=function(){let e=this.color;return l(e)&&e.alpha===0};function Ybe(e){return e.context.stencilBuffer}Cr.prototype.hasSilhouette=function(e){return Ybe(e)&&this._silhouetteSize>0&&this._silhouetteColor.alpha>0&&!l(this._classificationType)};Cr.prototype.hasSkipLevelOfDetail=function(e){if(!Wo.is3DTiles(this.type))return!1;let t=e.context.stencilBuffer,n=this._content.tileset;return t&&n.isSkippingLevelOfDetail};Cr.prototype.isClippingEnabled=function(){let e=this._clippingPlanes;return l(e)&&e.enabled&&e.length!==0};Cr.prototype.pick=function(e,t,n,i,r){return sw(this,e,t,n,i,r)};Cr.prototype.isClippingPolygonsEnabled=function(){let e=this._clippingPolygons;return l(e)&&e.enabled&&e.length!==0};Cr.prototype.hasDrapedVectors=function(){return this._vectorData?.show===!0};Cr.prototype.isDestroyed=function(){return!1};Cr.prototype.destroy=function(){let e=this._loader;l(e)&&e.destroy();let t=this._featureTables;if(l(t)){let r=t.length;for(let o=0;o<r;o++)t[o].destroy()}this.destroyPipelineResources(),this.destroyModelResources(),Gbe(this),l(this._removeUpdateHeightCallback)&&(this._removeUpdateHeightCallback(),this._removeUpdateHeightCallback=void 0),l(this._terrainProviderChangedCallback)&&(this._terrainProviderChangedCallback(),this._terrainProviderChangedCallback=void 0),this._removeClippingPolygonAdded=this._removeClippingPolygonAdded&&this._removeClippingPolygonAdded(),this._removeClippingPolygonRemoved=this._removeClippingPolygonRemoved&&this._removeClippingPolygonRemoved();let n=this._clippingPlanes;l(n)&&!n.isDestroyed()&&n.owner===this&&n.destroy(),this._clippingPlanes=void 0,l(this._clippingPolygonData)&&Nc.releaseRectangleData(this._clippingPolygonData),this._clippingPolygonData=void 0,this._clippingPolygons=void 0,this._shouldDestroyImageBasedLighting&&!this._imageBasedLighting.isDestroyed()&&this._imageBasedLighting.destroy(),this._imageBasedLighting=void 0;let i=this._environmentMapManager;!i.isDestroyed()&&i.owner===this&&i.destroy(),this._environmentMapManager=void 0,le(this)};Cr.prototype.destroyPipelineResources=function(){let e=this._pipelineResources;for(let t=0;t<e.length;t++)e[t].destroy();this._pipelineResources.length=0,this._pickIds.length=0};Cr.prototype.destroyModelResources=function(){let e=this._modelResources;for(let t=0;t<e.length;t++)e[t].destroy();this._modelResources.length=0};Cr.fromGltfAsync=async function(e){e=e??H.EMPTY_OBJECT;let t=e.url??e.gltf,n={releaseGltfJson:e.releaseGltfJson,asynchronous:e.asynchronous,incrementallyLoadTextures:e.incrementallyLoadTextures,upAxis:e.upAxis,forwardAxis:e.forwardAxis,loadAttributesFor2D:e.projectTo2D,enablePick:e.enablePick,loadIndicesForWireframe:e.enableDebugWireframe,loadPrimitiveOutline:e.enableShowOutline,loadForClassification:l(e.classificationType)},i=e.basePath??"",r=De.createIfNeeded(i);l(t.asset)?(n.gltfJson=t,n.baseResource=r,n.gltfResource=r):t instanceof Uint8Array?(n.typedArray=t,n.baseResource=r,n.gltfResource=r):n.gltfResource=De.createIfNeeded(t);let o=new Bf(n),a=l(e.content)?Wo.TILE_GLTF:Wo.GLTF,c=n.gltfResource,u=y2(o,a,e);u.resource=c,u.environmentMapOptions=e.environmentMapOptions;try{await o.load()}catch(g){throw o.destroy(),xt.getError("model",c,g)}let f=e.gltfCallback;l(f)&&f(o.gltfJson);let d=new Cr(u),p=d._resource.credits;if(l(p)){let g=p.length;for(let m=0;m<g;m++)d._resourceCredits.push(It.clone(p[m]))}return d};Cr.fromB3dm=async function(e){let t={b3dmResource:e.resource,arrayBuffer:e.arrayBuffer,byteOffset:e.byteOffset,releaseGltfJson:e.releaseGltfJson,asynchronous:e.asynchronous,incrementallyLoadTextures:e.incrementallyLoadTextures,upAxis:e.upAxis,forwardAxis:e.forwardAxis,loadAttributesFor2D:e.projectTo2D,enablePick:e.enablePick,loadIndicesForWireframe:e.enableDebugWireframe,loadPrimitiveOutline:e.enableShowOutline,loadForClassification:l(e.classificationType)},n=new nF(t);try{await n.load();let i=y2(n,Wo.TILE_B3DM,e);return new Cr(i)}catch(i){throw n.destroy(),i}};Cr.fromPnts=async function(e){let t={arrayBuffer:e.arrayBuffer,byteOffset:e.byteOffset,loadAttributesFor2D:e.projectTo2D},n=new m2(t);try{await n.load();let i=y2(n,Wo.TILE_PNTS,e);return new Cr(i)}catch(i){throw n.destroy(),i}};Cr.fromI3dm=async function(e){let t={i3dmResource:e.resource,arrayBuffer:e.arrayBuffer,byteOffset:e.byteOffset,releaseGltfJson:e.releaseGltfJson,asynchronous:e.asynchronous,incrementallyLoadTextures:e.incrementallyLoadTextures,upAxis:e.upAxis,forwardAxis:e.forwardAxis,loadAttributesFor2D:e.projectTo2D,enablePick:e.enablePick,loadIndicesForWireframe:e.enableDebugWireframe,loadPrimitiveOutline:e.enableShowOutline},n=new oF(t);try{await n.load();let i=y2(n,Wo.TILE_I3DM,e);return new Cr(i)}catch(i){throw n.destroy(),i}};Cr.fromGeoJson=async function(e){let t={geoJson:e.geoJson},n=new iF(t),i=y2(n,Wo.TILE_GEOJSON,e);return new Cr(i)};var Llt=new z;Cr.prototype.applyColorAndShow=function(e){let t=z.clone(this._color,Llt),n=l(e)&&l(e.color),i=l(e)&&l(e.show);this._color=n?e.color.evaluateColor(void 0,this._color):z.clone(z.WHITE,this._color),this._show=i?e.show.evaluate(void 0):!0,VZ(t,this._color)&&this.resetDrawCommands()};Cr.prototype.applyStyle=function(e){let t=this.type===Wo.TILE_PNTS,n=l(this.featureTableId)&&this.featureTables[this.featureTableId].featuresLength>0,i=l(this.structuralMetadata)?this.structuralMetadata.propertyAttributes:void 0,r=l(i)&&l(i[0]);if(t&&(!n||r)){this.resetDrawCommands();return}n?(this.featureTables[this.featureTableId].applyStyle(e),jbe(this,e)):(this.applyColorAndShow(e),this._styleCommandsNeeded=void 0)};function y2(e,t,n){return{loader:e,type:t,resource:n.resource,show:n.show,modelMatrix:n.modelMatrix,scale:n.scale,enableVerticalExaggeration:n.enableVerticalExaggeration,minimumPixelSize:n.minimumPixelSize,maximumScale:n.maximumScale,id:n.id,allowPicking:n.allowPicking,clampAnimations:n.clampAnimations,shadows:n.shadows,debugShowBoundingVolume:n.debugShowBoundingVolume,enableDebugWireframe:n.enableDebugWireframe,debugWireframe:n.debugWireframe,cull:n.cull,opaquePass:n.opaquePass,customShader:n.customShader,content:n.content,heightReference:n.heightReference,scene:n.scene,distanceDisplayCondition:n.distanceDisplayCondition,color:n.color,colorBlendAmount:n.colorBlendAmount,colorBlendMode:n.colorBlendMode,edgeDisplayMode:n.edgeDisplayMode,silhouetteColor:n.silhouetteColor,silhouetteSize:n.silhouetteSize,enableShowOutline:n.enableShowOutline,showOutline:n.showOutline,outlineColor:n.outlineColor,clippingPlanes:n.clippingPlanes,clippingPolygons:n.clippingPolygons,lightColor:n.lightColor,imageBasedLighting:n.imageBasedLighting,backFaceCulling:n.backFaceCulling,credit:n.credit,showCreditsOnScreen:n.showCreditsOnScreen,splitDirection:n.splitDirection,projectTo2D:n.projectTo2D,enablePick:n.enablePick,featureIdLabel:n.featureIdLabel,instanceFeatureIdLabel:n.instanceFeatureIdLabel,pointCloudShading:n.pointCloudShading,classificationType:n.classificationType,pickObject:n.pickObject}}var Hf=Cr;var HZ=class e{constructor(t,n,i){this._tileset=t,this._tile=n,this._resource=i,this._model=void 0,this._metadata=void 0,this._group=void 0,this._ready=!1}get featuresLength(){let t=this._model,n=t.featureTables,i=t.featureTableId;return l(n)&&l(n[i])?n[i].featuresLength:0}get pointsLength(){return this._model.statistics.pointsLength}get trianglesLength(){return this._model.statistics.trianglesLength}get geometryByteLength(){return this._model.statistics.geometryByteLength}get texturesByteLength(){return this._model.statistics.texturesByteLength}get batchTableByteLength(){let t=this._model.statistics;return t.propertyTablesByteLength+t.batchTexturesByteLength}get innerContents(){}get ready(){return this._ready}get tileset(){return this._tileset}get tile(){return this._tile}get url(){return this._resource.getUrlComponent(!0)}get batchTable(){let t=this._model,n=t.featureTables,i=t.featureTableId;if(l(n)&&l(n[i]))return n[i]}get metadata(){return this._metadata}set metadata(t){this._metadata=t}get group(){return this._group}set group(t){this._group=t}getTextureIds(){return this._model.statistics.getTextureIds()}getTextureByteLengthById(t){return this._model.statistics.getTextureByteLengthById(t)}getExtension(t){return this._model.getExtension(t)}getFeature(t){let n=this._model,i=n.featureTableId;return n.featureTables[i].getFeature(t)}hasProperty(t,n){let i=this._model,r=i.featureTableId;return l(r)?i.featureTables[r].hasProperty(t,n):!1}applyDebugSettings(t,n){n=t?n:z.WHITE,this.featuresLength===0?this._model.color=n:l(this.batchTable)&&this.batchTable.setAllColor(n)}applyStyle(t){this._model.style=t}update(t,n){let i=this._model,r=this._tile;i.colorBlendAmount=t.colorBlendAmount,i.colorBlendMode=t.colorBlendMode,i.modelMatrix=r.computedTransform,i.customShader=t.customShader,i.featureIdLabel=t.featureIdLabel,i.instanceFeatureIdLabel=t.instanceFeatureIdLabel,i.lightColor=t.lightColor,i.imageBasedLighting=t.imageBasedLighting,i.backFaceCulling=t.backFaceCulling,i.shadows=t.shadows,i.showCreditsOnScreen=t.showCreditsOnScreen,i.splitDirection=t.splitDirection,i.debugWireframe=t.debugWireframe,i.edgeDisplayMode=t.edgeDisplayMode,i.showOutline=t.showOutline,i.outlineColor=t.outlineColor,i.pointCloudShading=t.pointCloudShading;let o=t.clippingPlanes;i.referenceMatrix=t.clippingPlanesOriginMatrix,l(o)&&r.clippingPlanesDirty&&(i._clippingPlanes=o.enabled&&r._isClipped?o:void 0);let s=t.environmentMapManager;i.environmentMapManager!==o&&(i._environmentMapManager=s),l(o)&&l(i._clippingPlanes)&&i._clippingPlanes!==o&&(i._clippingPlanes=o,i._clippingPlanesState=0);let a=t.clippingPolygons;l(a)&&r.clippingPolygonsDirty&&(i._clippingPolygons=a.enabled&&r._isClippedByPolygon?a:void 0),l(a)&&l(i._clippingPolygons)&&i._clippingPolygons!==a&&(i._clippingPolygons=a,i._clippingPolygonsState=0),r.clippingPolygonsNeedRebake&&(i._clippingPolygonsNeedRebake=!0),i.update(n),!this._ready&&i.ready&&(i.activeAnimations.addAll({loop:Gu.REPEAT}),this._ready=!0)}isDestroyed(){return!1}destroy(){return this._model=this._model&&this._model.destroy(),le(this)}static async fromGltf(t,n,i,r){let o=new e(t,n,i),a=A2(t,n,o,{gltf:r,basePath:i}),c=t.vectorClassificationOnly?void 0:t.classificationType;a.classificationType=c;let u=await Hf.fromGltfAsync(a);return o._model=u,o}static async fromB3dm(t,n,i,r,o){let s=new e(t,n,i),c=A2(t,n,s,{arrayBuffer:r,byteOffset:o,resource:i}),u=t.vectorClassificationOnly?void 0:t.classificationType;c.classificationType=u;let f=await Hf.fromB3dm(c);return s._model=f,s}static async fromI3dm(t,n,i,r,o){let s=new e(t,n,i),c=A2(t,n,s,{arrayBuffer:r,byteOffset:o,resource:i}),u=await Hf.fromI3dm(c);return s._model=u,s}static async fromPnts(t,n,i,r,o){let s=new e(t,n,i),c=A2(t,n,s,{arrayBuffer:r,byteOffset:o,resource:i}),u=await Hf.fromPnts(c);return s._model=u,s}static async fromGeoJson(t,n,i,r){let o=new e(t,n,i),a=A2(t,n,o,{geoJson:r,resource:i}),c=await Hf.fromGeoJson(a);return o._model=c,o}pick(t,n,i){if(!l(this._model)||!this._ready)return;let r=n.verticalExaggeration,o=n.verticalExaggerationRelativeHeight;return this._model.pick(t,n,r,o,ee.WGS84,i)}};function A2(e,t,n,i){let r={cull:!1,releaseGltfJson:!0,opaquePass:Ie.CESIUM_3D_TILE,modelMatrix:t.computedTransform,upAxis:e._modelUpAxis,forwardAxis:e._modelForwardAxis,incrementallyLoadTextures:!1,customShader:e.customShader,content:n,scene:e._scene,colorBlendMode:e.colorBlendMode,colorBlendAmount:e.colorBlendAmount,lightColor:e.lightColor,imageBasedLighting:e.imageBasedLighting,featureIdLabel:e.featureIdLabel,instanceFeatureIdLabel:e.instanceFeatureIdLabel,pointCloudShading:e.pointCloudShading,clippingPlanes:e.clippingPlanes,backFaceCulling:e.backFaceCulling,shadows:e.shadows,showCreditsOnScreen:e.showCreditsOnScreen,splitDirection:e.splitDirection,enableDebugWireframe:e._enableDebugWireframe,debugWireframe:e.debugWireframe,projectTo2D:e._projectTo2D,enablePick:e._enablePick,enableShowOutline:e._enableShowOutline,showOutline:e.showOutline,outlineColor:e.outlineColor};return Ot(i,r)}var Gf=HZ;var GZ=class e{constructor(t,n,i){this._tileset=t,this._tile=n,this._resource=i,this.featurePropertiesDirty=!1,this._metadata=void 0,this._group=void 0,this._ready=!1}get featuresLength(){return 0}get pointsLength(){return 0}get trianglesLength(){return 0}get geometryByteLength(){return 0}get texturesByteLength(){return 0}get batchTableByteLength(){return 0}get innerContents(){}get ready(){return this._ready}get tileset(){return this._tileset}get tile(){return this._tile}get url(){return this._resource.getUrlComponent(!0)}get batchTable(){}get metadata(){return this._metadata}set metadata(t){this._metadata=t}get group(){return this._group}set group(t){this._group=t}static fromJson(t,n,i,r){let o=new e(t,n,i);return o._tileset.loadTileset(o._resource,r,o._tile),o._ready=!0,o}hasProperty(t,n){return!1}getFeature(t){}applyDebugSettings(t,n){}applyStyle(t){}update(t,n){}pick(t,n,i){}isDestroyed(){return!1}destroy(){return le(this)}},b2=GZ;var Flt=Object.freeze({NONE:0,LOADING:2,LOADED:3,ERROR:4,FAILED:5}),qs=Flt;function bm(e){this._billboardCollection=e,this._id=void 0,this._loadState=qs.NONE,this._loadError=void 0,this._index=-1,this._width=void 0,this._height=void 0,this._hasSubregion=!1,this.dirty=!1}Object.defineProperties(bm.prototype,{loadError:{get:function(){return this._loadError}},loadState:{get:function(){return this._loadState}},ready:{get:function(){return this._loadState===qs.LOADED}},hasImage:{get:function(){return this._loadState!==qs.NONE}},id:{get:function(){return this._id}},width:{get:function(){return this._width}},height:{get:function(){return this._height}}});bm.prototype.unload=async function(){this._loadState!==qs.NONE&&(this._id=void 0,this._loadError=void 0,this._loadState=qs.NONE,this._index=-1,this._width=void 0,this._height=void 0,this.dirty=!0)};bm.prototype.loadImage=async function(e,t,n,i){if(this._id===e)return;let r=this._billboardCollection,o=r.billboardTextureCache,s=o.get(e);if(l(s)&&t.loadState===qs.LOADING||t.loadState===qs.LOADED){bm.clone(s,this);return}l(s)||(s=new bm(r),o.set(e,s)),s._id=this._id=e,s._loadState=this._loadState=qs.LOADING,s._loadError=this._loadError=void 0;let a,c=this._billboardCollection.textureAtlas;try{let f=c.addImage(e,t,n,i);typeof f=="number"?a=f:a=await f}catch(f){if(s._loadState=qs.ERROR,s._loadError=f,this._id!==e)return;this._loadState=qs.ERROR,this._loadError=f;return}if(!l(a)||a===-1){if(s._loadState=qs.FAILED,s._index=-1,this._id!==e)return;this._loadState=qs.FAILED,this._index=-1;return}s._index=a,s._loadState=qs.LOADED;let u=c.rectangles[a];s._width=u.width,s._height=u.height,this._id===e&&(this._index=a,this._loadState=qs.LOADED,this._width=u.width,this._height=u.height,this.dirty=!0)};bm.prototype.addImageSubRegion=function(e,t){this._id=e,this._loadError=void 0,this._hasSubregion=!0;let i=this._billboardCollection.textureAtlas.addImageSubRegion(e,t);if(typeof i=="number"){this.setImageSubRegion(i,t);return}this.loadImageSubRegion(e,t,i)};bm.prototype.loadImageSubRegion=async function(e,t,n){let i;try{this._loadState=qs.LOADING,i=await n}catch(r){this._loadState=qs.ERROR,this._loadError=r;return}this._id===e&&(this._loadState=qs.LOADED,this.setImageSubRegion(i,t))};bm.prototype.setImageSubRegion=function(e,t){if(this._index!==e){if(!l(e)||e===-1){this._loadState=qs.FAILED,this._index=-1,this._width=void 0,this._height=void 0;return}this._width=t.width,this._height=t.height,this._index=e,this.dirty=!0}};bm.prototype.computeTextureCoordinates=function(e){return this._billboardCollection.textureAtlas.computeTextureCoordinates(this._index,e)};bm.clone=function(e,t){if(t._id=e._id,t._loadState=e._loadState,t._loadError=void 0,t._index=e._index,t._width=e._width,t._height=e._height,t._hasSubregion=e._hasSubregion,e.ready){t.dirty=!0;return}return(async()=>{let i=e._id;await e._billboardCollection.textureAtlas._indexPromiseById.get(i),t._id===i&&(e._hasSubregion&&await Promise.resolve(),t._id=i,t._loadState=e._loadState,t._loadError=e._loadError,t._index=e._index,t._width=e._width,t._height=e._height,t.dirty=!0)})(),t};var r_=bm;function Ni(e,t){e=e??H.EMPTY_OBJECT;let n=e.translucencyByDistance,i=e.pixelOffsetScaleByDistance,r=e.scaleByDistance,o=e.distanceDisplayCondition;l(n)&&(n=qt.clone(n)),l(i)&&(i=qt.clone(i)),l(r)&&(r=qt.clone(r)),l(o)&&(o=Ht.clone(o)),this._show=e.show??!0,this._position=h.clone(e.position??h.ZERO),this._actualPosition=h.clone(this._position),this._pixelOffset=U.clone(e.pixelOffset??U.ZERO),this._translate=new U(0,0),this._eyeOffset=h.clone(e.eyeOffset??h.ZERO),this._heightReference=e.heightReference??We.NONE,this._verticalOrigin=e.verticalOrigin??Gn.CENTER,this._horizontalOrigin=e.horizontalOrigin??zi.CENTER,this._scale=e.scale??1,this._color=z.clone(e.color??z.WHITE),this._rotation=e.rotation??0,this._alignedAxis=h.clone(e.alignedAxis??h.ZERO),this._width=e.width,this._height=e.height,this._scaleByDistance=r,this._translucencyByDistance=n,this._pixelOffsetScaleByDistance=i,this._sizeInMeters=e.sizeInMeters??!1,this._distanceDisplayCondition=o,this._disableDepthTestDistance=e.disableDepthTestDistance,this._id=e.id,this._collection=e.collection??t,this._pickId=void 0,this._pickPrimitive=e._pickPrimitive??this,this._billboardCollection=t,this._dirty=!1,this._index=-1,this._batchIndex=void 0,this._imageTexture=new r_(t),this._imageId=e.imageId,this._imageWidth=void 0,this._imageHeight=void 0,this._labelDimensions=void 0,this._labelHorizontalOrigin=void 0,this._labelTranslate=void 0;let s=e.image;l(s)&&(this._computeImageTextureProperties(e.imageId,s),this._imageTexture.loadImage(this._imageId,s,this._imageWidth,this._imageHeight)),l(e.imageSubRegion)&&this._imageTexture.addImageSubRegion(this._imageId,e.imageSubRegion),this._actualClampedPosition=void 0,this._removeCallbackFunc=void 0,this._lastSurfaceHeight=void 0,this._lastSurfaceQueryFrame=-1,this._lastSurfaceQueryMissed=!1,this._clampedToSurface=!1,this._clampingCartesian=void 0,this._clampingHeight=0,this._clampingHeightValid=!1,this._mode=re.SCENE3D,this._clusterShow=!0,this._outlineColor=z.clone(e.outlineColor??z.BLACK),this._outlineWidth=e.outlineWidth??0,this._updateClamping(),this._splitDirection=e.splitDirection??jo.NONE,this._positionFromParent=!1}var Xbe=Ni.SHOW_INDEX=0,jH=Ni.POSITION_INDEX=1,ixe=Ni.PIXEL_OFFSET_INDEX=2,Blt=Ni.EYE_OFFSET_INDEX=3,klt=Ni.HORIZONTAL_ORIGIN_INDEX=4,Ult=Ni.VERTICAL_ORIGIN_INDEX=5,zlt=Ni.SCALE_INDEX=6,Kbe=Ni.IMAGE_INDEX_INDEX=7,$be=Ni.COLOR_INDEX=8,Vlt=Ni.ROTATION_INDEX=9,jlt=Ni.ALIGNED_AXIS_INDEX=10,Hlt=Ni.SCALE_BY_DISTANCE_INDEX=11,Glt=Ni.TRANSLUCENCY_BY_DISTANCE_INDEX=12,Wlt=Ni.PIXEL_OFFSET_SCALE_BY_DISTANCE_INDEX=13,qlt=Ni.DISTANCE_DISPLAY_CONDITION=14,Ylt=Ni.DISABLE_DEPTH_DISTANCE=15;Ni.TEXTURE_COORDINATE_BOUNDS=16;var Jbe=Ni.SDF_INDEX=17,Xlt=Ni.SPLIT_DIRECTION_INDEX=18;Ni.NUMBER_OF_PROPERTIES=19;function Fo(e,t){let n=e._billboardCollection;l(n)&&(n._updateBillboard(e,t),e._dirty=!0)}function WZ(e,t){return e===t||l(e)&&l(t)&&e.x===t.x&&e.y===t.y&&e.z===t.z}function IT(e,t){if(l(e))return l(t)?(t.x=e.x,t.y=e.y,t.z=e.z,t):new h(e.x,e.y,e.z)}Object.defineProperties(Ni.prototype,{show:{get:function(){return this._show},set:function(e){this._show!==e&&(this._show=e,Fo(this,Xbe))}},position:{get:function(){return this._position},set:function(e){let t=this._position;WZ(t,e)||(IT(e,t),IT(e,this._actualPosition),this._updateClamping(),Fo(this,jH))}},heightReference:{get:function(){return this._heightReference},set:function(e){let t=this._heightReference;e!==t&&(this._heightReference=e,this._updateClamping(),Fo(this,jH))}},pixelOffset:{get:function(){return this._pixelOffset},set:function(e){let t=this._pixelOffset;U.equals(t,e)||(U.clone(e,t),Fo(this,ixe))}},scaleByDistance:{get:function(){return this._scaleByDistance},set:function(e){let t=this._scaleByDistance;qt.equals(t,e)||(this._scaleByDistance=qt.clone(e,t),Fo(this,Hlt))}},translucencyByDistance:{get:function(){return this._translucencyByDistance},set:function(e){let t=this._translucencyByDistance;qt.equals(t,e)||(this._translucencyByDistance=qt.clone(e,t),Fo(this,Glt))}},pixelOffsetScaleByDistance:{get:function(){return this._pixelOffsetScaleByDistance},set:function(e){let t=this._pixelOffsetScaleByDistance;qt.equals(t,e)||(this._pixelOffsetScaleByDistance=qt.clone(e,t),Fo(this,Wlt))}},eyeOffset:{get:function(){return this._eyeOffset},set:function(e){let t=this._eyeOffset;h.equals(t,e)||(h.clone(e,t),Fo(this,Blt))}},horizontalOrigin:{get:function(){return this._horizontalOrigin},set:function(e){this._horizontalOrigin!==e&&(this._horizontalOrigin=e,Fo(this,klt))}},verticalOrigin:{get:function(){return this._verticalOrigin},set:function(e){this._verticalOrigin!==e&&(this._verticalOrigin=e,Fo(this,Ult))}},scale:{get:function(){return this._scale},set:function(e){this._scale!==e&&(this._scale=e,Fo(this,zlt))}},color:{get:function(){return this._color},set:function(e){let t=this._color;z.equals(t,e)||(z.clone(e,t),Fo(this,$be))}},rotation:{get:function(){return this._rotation},set:function(e){this._rotation!==e&&(this._rotation=e,Fo(this,Vlt))}},alignedAxis:{get:function(){return this._alignedAxis},set:function(e){let t=this._alignedAxis;h.equals(t,e)||(h.clone(e,t),Fo(this,jlt))}},width:{get:function(){return this._width??this._imageTexture.width},set:function(e){this._width!==e&&(this._width=e,Fo(this,Kbe))}},height:{get:function(){return this._height??this._imageTexture.height},set:function(e){this._height!==e&&(this._height=e,Fo(this,Kbe))}},sizeInMeters:{get:function(){return this._sizeInMeters},set:function(e){this._sizeInMeters!==e&&(this._sizeInMeters=e,Fo(this,$be))}},distanceDisplayCondition:{get:function(){return this._distanceDisplayCondition},set:function(e){Ht.equals(e,this._distanceDisplayCondition)||(this._distanceDisplayCondition=Ht.clone(e,this._distanceDisplayCondition),Fo(this,qlt))}},disableDepthTestDistance:{get:function(){return this._disableDepthTestDistance},set:function(e){this._disableDepthTestDistance!==e&&(this._disableDepthTestDistance=e,Fo(this,Ylt))}},id:{get:function(){return this._id},set:function(e){this._id=e,l(this._pickId)&&(this._pickId.object.id=e)}},pickPrimitive:{get:function(){return this._pickPrimitive},set:function(e){this._pickPrimitive=e,l(this._pickId)&&(this._pickId.object.primitive=e)}},pickId:{get:function(){return this._pickId}},image:{get:function(){return this._imageTexture.id},set:function(e){if(!l(e)){this._imageTexture.unload();return}this._computeImageTextureProperties(void 0,e),this._imageTexture.loadImage(this._imageId,e,this._imageWidth,this._imageHeight)}},ready:{get:function(){return this._imageTexture.ready}},loadError:{get:function(){return this._imageTexture.loadError}},textureDirty:{get:function(){return this._imageTexture.dirty},set:function(e){this._imageTexture.dirty=e}},_clampedPosition:{get:function(){return this._actualClampedPosition},set:function(e){this._actualClampedPosition=IT(e,this._actualClampedPosition),Fo(this,jH)}},clusterShow:{get:function(){return this._clusterShow},set:function(e){this._clusterShow!==e&&(this._clusterShow=e,Fo(this,Xbe))}},outlineColor:{get:function(){return this._outlineColor},set:function(e){let t=this._outlineColor;z.equals(t,e)||(z.clone(e,t),Fo(this,Jbe))}},outlineWidth:{get:function(){return this._outlineWidth},set:function(e){this._outlineWidth!==e&&(this._outlineWidth=e,Fo(this,Jbe))}},splitDirection:{get:function(){return this._splitDirection},set:function(e){this._splitDirection!==e&&(this._splitDirection=e,Fo(this,Xlt))}}});Ni.prototype.getPickId=function(e){return l(this._pickId)||(this._pickId=e.createPickId({primitive:this._pickPrimitive,collection:this._collection,id:this._id})),this._pickId};Ni.prototype._updateClamping=function(){Ni._updateClamping(this._billboardCollection,this)};var HH=new he,Klt=new he,Zbe=200,Qbe=30;function exe(e,t,n,i){let r=t.cartographicToCartesian(i,e._clampedPosition);Wy(e._heightReference)?e._mode===re.SCENE3D?(i.height+=n.height,t.cartographicToCartesian(i,r)):r.x+=n.height:e._heightReference===We.CLIP_TO_GROUND&&n.height>i.height&&(e._mode===re.SCENE3D?(i.height=n.height,t.cartographicToCartesian(i,r)):r.x=n.height),e._clampedPosition=r}Ni._updateClamping=function(e,t){if(!l(e)||!l(e._scene))return;let n=e._scene,i=n.ellipsoid??ee.default,r=n.frameState.mode,o=r!==t._mode;if(t._mode=r,(t._heightReference===We.NONE||o)&&l(t._removeCallbackFunc)&&(t._removeCallbackFunc(),t._removeCallbackFunc=void 0,t._clampedPosition=void 0,t._lastSurfaceHeight=void 0,t._clampedToSurface=!1),t._heightReference===We.NONE||t._positionFromParent||!l(t._position))return;let s=n.frameState.frameNumber;if(t._clampingHeightValid&&t._heightReference===We.CLIP_TO_GROUND&&r===re.SCENE3D&&l(t._removeCallbackFunc)&&l(t._lastSurfaceHeight)&&s-t._lastSurfaceQueryFrame<Qbe){let A=t._position,b=t._clampingCartesian,x=A.x-b.x,T=A.y-b.y,E=A.z-b.z,v=Math.sqrt(x*x+T*T+E*E);if(t._clampingHeight-v>t._lastSurfaceHeight+Zbe){t._clampedToSurface=!0,t._clampedPosition=A;return}}let a=i.cartesianToCartographic(t._position,Klt);if(!l(a)){t._actualClampedPosition=void 0,t._clampingHeightValid=!1;return}t._clampingCartesian=IT(t._position,t._clampingCartesian),t._clampingHeight=a.height,t._clampingHeightValid=!0;let c=t._heightReference===We.CLIP_TO_GROUND,u=s-t._lastSurfaceQueryFrame<Qbe,f=c&&l(t._lastSurfaceHeight)&&a.height>t._lastSurfaceHeight+Zbe,d=f&&u,p=c&&u&&t._lastSurfaceQueryMissed;if(!((c&&t._lastSurfaceQueryMissed||f)&&l(t._removeCallbackFunc))){l(t._removeCallbackFunc)&&t._removeCallbackFunc();let A=he.clone(a);t._removeCallbackFunc=n.updateHeight(A,b=>{let x=n.getHeight(A,t._heightReference);l(x)&&(b.height=x,t._lastSurfaceQueryFrame=n.frameState.frameNumber,t._lastSurfaceQueryMissed=!1),t._lastSurfaceHeight=b.height,t._clampedToSurface=!0,exe(t,i,A,b)},t._heightReference)}he.clone(a,HH);let y;d||p?y=t._lastSurfaceHeight:(t._lastSurfaceQueryFrame=s,y=n.getHeight(a,t._heightReference),t._lastSurfaceQueryMissed=!l(y),l(y)?t._lastSurfaceHeight=y:y=t._lastSurfaceHeight),t._clampedToSurface=l(y),l(y)&&(HH.height=y),exe(t,i,a,HH)};Ni.prototype.computeTextureCoordinates=function(e){return this._imageTexture.computeTextureCoordinates(e)};Ni.prototype.setImage=function(e,t){this._computeImageTextureProperties(e,t),this._imageTexture.loadImage(this._imageId,t,this._imageWidth,this._imageHeight)};Ni.prototype.setImageTexture=function(e){r_.clone(e,this._imageTexture)};var txe=512;Ni.prototype._computeImageTextureProperties=function(e,t){if(this._imageWidth=void 0,this._imageHeight=void 0,!l(t)){this._imageId=Kn();return}let n;typeof t=="string"?n=t:t instanceof De?n=t._url:l(t.src)&&(n=t.src),this._imageId=e??n??Kn(),l(this._width)&&l(this._height)&&!this._sizeInMeters&&$lt(n)&&(this._imageWidth=Math.min(this._width,txe),this._imageHeight=Math.min(this._height,txe))};function $lt(e){return l(e)?Uh(e)?e.startsWith("data:image/svg+xml"):rg(e)==="svg":!1}Ni.prototype.setImageSubRegion=function(e,t){this._imageTexture.addImageSubRegion(e,t)};Ni.prototype._setTranslate=function(e){let t=this._translate;U.equals(t,e)||(U.clone(e,t),Fo(this,ixe))};Ni.prototype._getActualPosition=function(){return l(this._clampedPosition)?this._clampedPosition:this._actualPosition};Ni.prototype._setActualPosition=function(e){l(this._clampedPosition)||h.clone(e,this._actualPosition),Fo(this,jH)};var nxe=new se;Ni._computeActualPosition=function(e,t,n,i){return l(e._clampedPosition)?(n.mode!==e._mode&&e._updateClamping(),e._clampedPosition):n.mode===re.SCENE3D?t:(N.multiplyByPoint(i,t,nxe),dr.computeActualEllipsoidPosition(n,nxe))};var rxe=new h;Ni._computeScreenSpacePosition=function(e,t,n,i,r,o){let s=N.multiplyByPoint(e,t,rxe),a=dr.worldWithEyeOffsetToWindowCoordinates(r,s,n,o);if(l(a))return U.add(a,i,a),a};var VH=new U(0,0);Ni.prototype.computeScreenSpacePosition=function(e,t){let n=this._billboardCollection;l(t)||(t=new U),U.clone(this._pixelOffset,VH),U.add(VH,this._translate,VH);let i=n.modelMatrix,r=this._position;if(l(this._clampedPosition)&&(r=this._clampedPosition,e.mode!==re.SCENE3D)){let s=e.mapProjection,a=s.ellipsoid,c=s.unproject(r,HH);r=a.cartographicToCartesian(c,rxe),i=N.IDENTITY}return Ni._computeScreenSpacePosition(i,r,this._eyeOffset,VH,e,t)};Ni.getScreenSpaceBoundingBox=function(e,t,n){let i=e.width,r=e.height,o=e.scale;i*=o,r*=o;let s=t.x;e.horizontalOrigin===zi.RIGHT?s-=i:e.horizontalOrigin===zi.CENTER&&(s-=i*.5);let a=t.y;return e.verticalOrigin===Gn.BOTTOM||e.verticalOrigin===Gn.BASELINE?a-=r:e.verticalOrigin===Gn.CENTER&&(a-=r*.5),l(n)||(n=new et),n.x=s,n.y=a,n.width=i,n.height=r,n};Ni.prototype.equals=function(e){return this===e||l(e)&&this._id===e._id&&h.equals(this._position,e._position)&&this.image===e.image&&this._show===e._show&&this._scale===e._scale&&this._verticalOrigin===e._verticalOrigin&&this._horizontalOrigin===e._horizontalOrigin&&this._heightReference===e._heightReference&&z.equals(this._color,e._color)&&U.equals(this._pixelOffset,e._pixelOffset)&&U.equals(this._translate,e._translate)&&h.equals(this._eyeOffset,e._eyeOffset)&&qt.equals(this._scaleByDistance,e._scaleByDistance)&&qt.equals(this._translucencyByDistance,e._translucencyByDistance)&&qt.equals(this._pixelOffsetScaleByDistance,e._pixelOffsetScaleByDistance)&&Ht.equals(this._distanceDisplayCondition,e._distanceDisplayCondition)&&this._disableDepthTestDistance===e._disableDepthTestDistance&&this._splitDirection===e._splitDirection};Ni.prototype._destroy=function(){l(this._customData)&&(this._billboardCollection._scene.globe._surface.removeTileCustomData(this._customData),this._customData=void 0),l(this._removeCallbackFunc)&&(this._removeCallbackFunc(),this._removeCallbackFunc=void 0),this.image=void 0,this._pickId=this._pickId&&this._pickId.destroy(),this._billboardCollection=void 0};var Br=Ni;var Jlt={FONT_SIZE:48,PADDING:10,RADIUS:8,CUTOFF:.25},Ga=Object.freeze(Jlt);var Zlt=Br.SHOW_INDEX,x2=Br.POSITION_INDEX,sxe=Br.PIXEL_OFFSET_INDEX,axe=Br.EYE_OFFSET_INDEX,Qlt=Br.HORIZONTAL_ORIGIN_INDEX,eut=Br.VERTICAL_ORIGIN_INDEX,tut=Br.SCALE_INDEX,PT=Br.IMAGE_INDEX_INDEX,cxe=Br.COLOR_INDEX,nut=Br.ROTATION_INDEX,iut=Br.ALIGNED_AXIS_INDEX,lxe=Br.SCALE_BY_DISTANCE_INDEX,uxe=Br.TRANSLUCENCY_BY_DISTANCE_INDEX,fxe=Br.PIXEL_OFFSET_SCALE_BY_DISTANCE_INDEX,dxe=Br.DISTANCE_DISPLAY_CONDITION,rut=Br.DISABLE_DEPTH_DISTANCE,out=Br.TEXTURE_COORDINATE_BOUNDS,hxe=Br.SDF_INDEX,mxe=Br.SPLIT_DIRECTION_INDEX,JZ=Br.NUMBER_OF_PROPERTIES,zr={direction:0,positionHighAndScale:1,positionLowAndRotation:2,compressedAttribute0:3,compressedAttribute1:4,compressedAttribute2:5,eyeOffset:6,scaleByDistance:7,pixelOffsetScaleByDistance:8,compressedAttribute3:9,textureCoordinateBoundsOrLabelTranslate:10,a_batchId:11,sdf:12,splitDirection:13};function $d(e){e=e??H.EMPTY_OBJECT,this._scene=e.scene,this._batchTable=e.batchTable;let t=e.textureAtlas;l(t)||(t=new Ex),this._textureAtlas=t,this._textureAtlasGUID=t.guid,this._destroyTextureAtlas=!0,this._billboardTextureCache=new Map,this._sp=void 0,this._spTranslucent=void 0,this._rsOpaque=void 0,this._rsTranslucent=void 0,this._vaf=void 0,this._billboards=[],this._billboardsToUpdate=[],this._billboardsToUpdateIndex=0,this._billboardsRemoved=!1,this._createVertexArray=!1,this._shaderRotation=!1,this._compiledShaderRotation=!1,this._shaderAlignedAxis=!1,this._compiledShaderAlignedAxis=!1,this._shaderScaleByDistance=!1,this._compiledShaderScaleByDistance=!1,this._shaderTranslucencyByDistance=!1,this._compiledShaderTranslucencyByDistance=!1,this._shaderPixelOffsetScaleByDistance=!1,this._compiledShaderPixelOffsetScaleByDistance=!1,this._shaderDistanceDisplayCondition=!1,this._compiledShaderDistanceDisplayCondition=!1,this._shaderDisableDepthDistance=!1,this._compiledShaderDisableDepthDistance=!1,this._shaderClampToGround=!1,this._compiledShaderClampToGround=!1,this._propertiesChanged=new Uint32Array(JZ),this._maxSize=0,this._maxEyeOffset=0,this._maxScale=1,this._maxPixelOffset=0,this._allHorizontalCenter=!0,this._allVerticalCenter=!0,this._allSizedInMeters=!0,this._baseVolume=new ue,this._baseVolumeWC=new ue,this._baseVolume2D=new ue,this._boundingVolume=new ue,this._boundingVolumeDirty=!1,this._colorCommands=[],this._allBillboardsReady=!1,this.show=e.show??!0,this.modelMatrix=N.clone(e.modelMatrix??N.IDENTITY),this._modelMatrix=N.clone(N.IDENTITY),this.debugShowBoundingVolume=e.debugShowBoundingVolume??!1,this.debugShowTextureAtlas=e.debugShowTextureAtlas??!1,this.blendOption=e.blendOption??Fi.OPAQUE_AND_TRANSLUCENT,this._blendOption=void 0,this._mode=re.SCENE3D,this._buffersUsage=[Me.STATIC_DRAW,Me.STATIC_DRAW,Me.STATIC_DRAW,Me.STATIC_DRAW,Me.STATIC_DRAW,Me.STATIC_DRAW,Me.STATIC_DRAW,Me.STATIC_DRAW,Me.STATIC_DRAW,Me.STATIC_DRAW,Me.STATIC_DRAW,Me.STATIC_DRAW,Me.STATIC_DRAW,Me.STATIC_DRAW,Me.STATIC_DRAW,Me.STATIC_DRAW,Me.STATIC_DRAW],this._highlightColor=z.clone(z.WHITE),this._coarseDepthTestDistance=e.coarseDepthTestDistance??ee.default.minimumRadius/10,this._threePointDepthTestDistance=e.threePointDepthTestDistance??ee.default.minimumRadius/1e3,this._uniforms={u_atlas:()=>this.textureAtlas.texture,u_highlightColor:()=>this._highlightColor,u_coarseDepthTestDistance:()=>this._coarseDepthTestDistance,u_threePointDepthTestDistance:()=>this._threePointDepthTestDistance};let n=this._scene;l(n)&&l(n.terrainProviderChanged)&&(this._removeCallbackFunc=n.terrainProviderChanged.addEventListener(function(){let i=this._billboards,r=i.length;for(let o=0;o<r;++o)l(i[o])&&i[o]._updateClamping()},this))}Object.defineProperties($d.prototype,{length:{get:function(){return ZZ(this),this._billboards.length}},textureAtlas:{get:function(){return this._textureAtlas},set:function(e){this._textureAtlas!==e&&(this._textureAtlas=this._destroyTextureAtlas&&this._textureAtlas&&this._textureAtlas.destroy(),this._textureAtlas=e)}},destroyTextureAtlas:{get:function(){return this._destroyTextureAtlas},set:function(e){this._destroyTextureAtlas=e}},sizeInBytes:{get:function(){return this._textureAtlas.sizeInBytes}},ready:{get:function(){return this._allBillboardsReady}},billboardTextureCache:{get:function(){return this._billboardTextureCache}},coarseDepthTestDistance:{get:function(){return this._coarseDepthTestDistance},set:function(e){this._coarseDepthTestDistance=e}},threePointDepthTestDistance:{get:function(){return this._threePointDepthTestDistance},set:function(e){this._threePointDepthTestDistance=e}}});function pxe(e){let t=e.length;for(let n=0;n<t;++n)e[n]&&e[n]._destroy()}$d.prototype.add=function(e){let t=new Br(e,this);return t._index=this._billboards.length,this._billboards.push(t),this._createVertexArray=!0,t};$d.prototype.remove=function(e){return this.contains(e)?(this._billboards[e._index]=void 0,this._billboardsRemoved=!0,this._createVertexArray=!0,e._destroy(),!0):!1};$d.prototype.removeAll=function(){pxe(this._billboards),this._billboards=[],this._billboardsToUpdate=[],this._billboardsToUpdateIndex=0,this._billboardsRemoved=!1,this._createVertexArray=!0};function ZZ(e){if(e._billboardsRemoved){e._billboardsRemoved=!1;let t=[],n=e._billboards,i=n.length;for(let r=0,o=0;r<i;++r){let s=n[r];l(s)&&(s._index=o++,t.push(s))}e._billboards=t}}$d.prototype._updateBillboard=function(e,t){e._dirty||(this._billboardsToUpdate[this._billboardsToUpdateIndex++]=e),++this._propertiesChanged[t]};$d.prototype.contains=function(e){return l(e)&&e._billboardCollection===this};$d.prototype.get=function(e){return ZZ(this),this._billboards[e]};function oxe(e){let t=e.cache.billboardCollection_indexBufferInstanced;return l(t)||(t=tt.createIndexBuffer({context:e,typedArray:new Uint16Array([0,1,2,0,2,3]),usage:Me.STATIC_DRAW,indexDatatype:je.UNSIGNED_SHORT}),t.vertexArrayDestroyable=!1,e.cache.billboardCollection_indexBufferInstanced=t),t}function sut(e){let t=e.cache.billboardCollection_vertexBufferInstanced;return l(t)||(t=tt.createVertexBuffer({context:e,typedArray:new Float32Array([0,0,1,0,1,1,0,1]),usage:Me.STATIC_DRAW}),t.vertexArrayDestroyable=!1,e.cache.billboardCollection_vertexBufferInstanced=t),t}$d.prototype.computeNewBuffersUsage=function(){let e=this._buffersUsage,t=!1,n=this._propertiesChanged;for(let i=0;i<JZ;++i){let r=n[i]===0?Me.STATIC_DRAW:Me.STREAM_DRAW;t=t||e[i]!==r,e[i]=r}return t};function aut(e,t,n,i,r){let o=[{index:zr.positionHighAndScale,componentsPerAttribute:4,componentDatatype:Y.FLOAT,usage:n[x2]},{index:zr.positionLowAndRotation,componentsPerAttribute:4,componentDatatype:Y.FLOAT,usage:n[x2]},{index:zr.compressedAttribute0,componentsPerAttribute:4,componentDatatype:Y.FLOAT,usage:n[sxe]},{index:zr.compressedAttribute1,componentsPerAttribute:4,componentDatatype:Y.FLOAT,usage:n[uxe]},{index:zr.compressedAttribute2,componentsPerAttribute:4,componentDatatype:Y.FLOAT,usage:n[cxe]},{index:zr.eyeOffset,componentsPerAttribute:4,componentDatatype:Y.FLOAT,usage:n[axe]},{index:zr.scaleByDistance,componentsPerAttribute:4,componentDatatype:Y.FLOAT,usage:n[lxe]},{index:zr.pixelOffsetScaleByDistance,componentsPerAttribute:4,componentDatatype:Y.FLOAT,usage:n[fxe]},{index:zr.compressedAttribute3,componentsPerAttribute:4,componentDatatype:Y.FLOAT,usage:n[dxe]},{index:zr.textureCoordinateBoundsOrLabelTranslate,componentsPerAttribute:4,componentDatatype:Y.FLOAT,usage:n[out]},{index:zr.splitDirection,componentsPerAttribute:1,componentDatatype:Y.FLOAT,usage:n[mxe]},{index:zr.direction,componentsPerAttribute:2,componentDatatype:Y.FLOAT,vertexBuffer:sut(e)}];return l(i)&&o.push({index:zr.a_batchId,componentsPerAttribute:1,componentDatatype:Y.FLOAT,bufferUsage:Me.STATIC_DRAW}),r&&o.push({index:zr.sdf,componentsPerAttribute:2,componentDatatype:Y.FLOAT,usage:n[hxe]}),new mg(e,o,t,!0)}var qZ=new Sn;function gxe(e,t){let n=e.center,i=t.x-n.x,r=t.y-n.y,o=t.z-n.z,s=Math.sqrt(i*i+r*r+o*o);s>e.radius&&(e.radius=s)}function _xe(e,t,n,i){let r=n[zr.positionHighAndScale],o=n[zr.positionLowAndRotation],s=i._getActualPosition();e._mode===re.SCENE3D&&(gxe(e._baseVolume,s),e._boundingVolumeDirty=!0),Sn.fromCartesian(s,qZ);let a=i.scale,c=i.rotation;c!==0&&(e._shaderRotation=!0),e._maxScale=Math.max(e._maxScale,a);let u=qZ.high,f=qZ.low;r(i._index,u.x,u.y,u.z,a),o(i._index,f.x,f.y,f.z,c)}var DA=new U,Kd=32768,QZ=65536,YZ=4096,DT=256,cut=128,lut=32,uut=8,GH=4,fut=1/256,yxe=new et;function Axe(e,t,n,i){let r=n[zr.compressedAttribute0],o=i.pixelOffset,s=o.x,a=o.y,c=i._translate,u=c.x,f=c.y;e._maxPixelOffset=Math.max(e._maxPixelOffset,Math.abs(s+u),Math.abs(-a+f));let d=i.horizontalOrigin,p=i._verticalOrigin,g=i.show&&i.clusterShow;i.color.alpha===0&&(g=!1),p===Gn.BASELINE&&(p=Gn.BOTTOM),e._allHorizontalCenter=e._allHorizontalCenter&&d===zi.CENTER,e._allVerticalCenter=e._allVerticalCenter&&p===Gn.CENTER;let m=0,y=0;if(i.ready){let I=i.computeTextureCoordinates(yxe);m=I.x,y=I.y}let A=Math.floor(D.clamp(s,-Kd,Kd)+Kd)*cut;A+=(d+1)*lut,A+=(p+1)*uut,A+=(g?1:0)*GH;let b=Math.floor(D.clamp(a,-Kd,Kd)+Kd)*DT,x=Math.floor(D.clamp(u*GH,-Kd,Kd)+Kd)*DT,T=(D.clamp(f*GH,-Kd,Kd)+Kd)*fut,E=Math.floor(T),v=Math.floor((T-E)*DT);b+=E,x+=v,DA.x=m,DA.y=y;let S=cn.compressTextureCoordinates(DA);r(i._index,A,b,x,S)}function bxe(e,t,n,i){let r=n[zr.compressedAttribute1],o=i.alignedAxis;h.equals(o,h.ZERO)||(o=h.normalize(o,new h),e._shaderAlignedAxis=!0);let s=0,a=1,c=1,u=1,f=i.translucencyByDistance;l(f)&&(s=f.near,a=f.nearValue,c=f.far,u=f.farValue,(a!==1||u!==1)&&(e._shaderTranslucencyByDistance=!0));let d=Math.round(i.width??0);e._maxSize=Math.max(e._maxSize,d);let p=D.clamp(d,0,QZ),g=0;Math.abs(h.magnitudeSquared(o)-1)<D.EPSILON6&&(g=cn.octEncodeFloat(o)),a=D.clamp(a,0,1),a=a===1?255:a*255|0,p=p*DT+a,u=D.clamp(u,0,1),u=u===1?255:u*255|0,g=g*DT+u,r(i._index,p,g,s,c)}function KZ(e,t,n,i){let r=n[zr.compressedAttribute2],o=i.color,s=l(e._batchTable)?z.WHITE:i.getPickId(t.context).color,a=i.sizeInMeters?1:0,c=i.alignedAxis,u=h.equals(c,h.ZERO)?c:h.normalize(c,new h),f=Math.abs(h.magnitudeSquared(u)-1)<D.EPSILON6?1:0;e._allSizedInMeters=e._allSizedInMeters&&a===1;let d=i.height??0;e._maxSize=Math.max(e._maxSize,d);let p=i._labelHorizontalOrigin??-2;p+=2;let g=cn.encodeRGB8(o),m=cn.encodeRGB8(s),y=z.floatToByte(o.alpha)*QZ+z.floatToByte(s.alpha)*DT+(a*2+f),A=d*GH+p;r(i._index,g,m,y,A)}function $Z(e,t,n,i){let r=n[zr.eyeOffset],o=i.eyeOffset,s=o.z;if(i._heightReference!==We.NONE&&(s*=1.005),e._maxEyeOffset=Math.max(e._maxEyeOffset,Math.abs(o.x),Math.abs(o.y),Math.abs(s)),DA.x=0,DA.y=0,i.ready){let c=i.computeTextureCoordinates(yxe);DA.x=c.width,DA.y=c.height}let a=cn.compressTextureCoordinates(DA);r(i._index,o.x,o.y,s,a)}function xxe(e,t,n,i){let r=n[zr.scaleByDistance],o=0,s=1,a=1,c=1,u=i.scaleByDistance;l(u)&&(o=u.near,s=u.nearValue,a=u.far,c=u.farValue,(s!==1||c!==1)&&(e._shaderScaleByDistance=!0)),r(i._index,o,s,a,c)}function Txe(e,t,n,i){let r=n[zr.pixelOffsetScaleByDistance],o=0,s=1,a=1,c=1,u=i.pixelOffsetScaleByDistance;l(u)&&(o=u.near,s=u.nearValue,a=u.far,c=u.farValue,(s!==1||c!==1)&&(e._shaderPixelOffsetScaleByDistance=!0)),r(i._index,o,s,a,c)}function Exe(e,t,n,i){let r=n[zr.compressedAttribute3],o=0,s=Number.MAX_VALUE,a=i.distanceDisplayCondition;l(a)&&(o=a.near,s=a.far,o*=o,s*=s,e._shaderDistanceDisplayCondition=!0);let c=i.disableDepthTestDistance,u=As(i.heightReference)&&t.context.depthTexture;c*=c,(u||c>0)&&(e._shaderDisableDepthDistance=!0,c===Number.POSITIVE_INFINITY&&(c=-1));let f,d;l(i._labelDimensions)?(d=i._labelDimensions.x,f=i._labelDimensions.y):(d=i.width??0,f=i.height??0);let p=Math.floor(D.clamp(d,0,YZ)),g=Math.floor(D.clamp(f,0,YZ)),m=p*YZ+g;r(i._index,o,s,c,m)}function Cxe(e,t,n,i){if(As(i.heightReference)){let a=e._scene,c=t.context,u=t.globeTranslucencyState.translucent,f=l(a.globe)&&a.globe.depthTestAgainstTerrain;e._shaderClampToGround=c.depthTexture&&!u&&f}let r=n[zr.textureCoordinateBoundsOrLabelTranslate],o=0,s=0;l(i._labelTranslate)&&(o=i._labelTranslate.x,s=i._labelTranslate.y),r(i._index,o,s,0,0)}function dut(e,t,n,i){if(!l(e._batchTable))return;let r=n[zr.a_batchId],o=i._batchIndex;r(i._index,o)}function vxe(e,t,n,i){if(!e._sdf)return;let r=n[zr.sdf],o=i.outlineColor,s=i.outlineWidth,a=cn.encodeRGB8(o),c=s/Ga.RADIUS,u=z.floatToByte(o.alpha)*QZ+z.floatToByte(c)*DT;r(i._index,a,u)}function Sxe(e,t,n,i){let r=n[zr.splitDirection],o=0,s=i.splitDirection;l(s)&&(o=s),r(i._index,o)}function hut(e,t,n,i){_xe(e,t,n,i),Axe(e,t,n,i),bxe(e,t,n,i),KZ(e,t,n,i),$Z(e,t,n,i),xxe(e,t,n,i),Txe(e,t,n,i),Exe(e,t,n,i),Cxe(e,t,n,i),dut(e,t,n,i),vxe(e,t,n,i),Sxe(e,t,n,i)}function XZ(e,t,n,i,r,o){let s;i.mode===re.SCENE3D?(s=e._baseVolume,e._boundingVolumeDirty=!0):s=e._baseVolume2D;let a=[];for(let c=0;c<n;++c){let u=t[c],f=u.position,d=Br._computeActualPosition(u,f,i,r);l(d)&&(u._setActualPosition(d),o?a.push(d):gxe(s,d))}o&&ue.fromPoints(a,s)}function mut(e,t){let n=t.mode,i=e._billboards,r=e._billboardsToUpdate,o=e._modelMatrix;e._createVertexArray||e._mode!==n||n!==re.SCENE3D&&!N.equals(o,e.modelMatrix)?(e._mode=n,N.clone(e.modelMatrix,o),e._createVertexArray=!0,(n===re.SCENE3D||n===re.SCENE2D||n===re.COLUMBUS_VIEW)&&XZ(e,i,i.length,t,o,!0)):n===re.MORPHING?XZ(e,i,i.length,t,o,!0):(n===re.SCENE2D||n===re.COLUMBUS_VIEW)&&XZ(e,r,e._billboardsToUpdateIndex,t,o,!1)}function put(e,t,n){let i=1;(!e._allSizedInMeters||e._maxPixelOffset!==0)&&(i=t.camera.getPixelSize(n,t.context.drawingBufferWidth,t.context.drawingBufferHeight));let r=i*e._maxScale*e._maxSize*2;e._allHorizontalCenter&&e._allVerticalCenter&&(r*=.5);let o=i*e._maxPixelOffset+e._maxEyeOffset;n.radius+=r+o}function gut(e,t){let i=t.createViewportQuadCommand(`uniform sampler2D billboard_texture; -in vec2 v_textureCoordinates; +`;function XEe(){}XEe.buildModelDrawCommand=function(e,t){let n=e.shaderBuilder,i=Oft(e,n,t),r=Mft(e,i,t),o=e.model;return l(o.classificationType)?new Q2({primitiveRenderResources:e,command:r}):new ek({primitiveRenderResources:e,command:r})};function Oft(e,t,n){t.addVertexLines(tk),t.addFragmentLines(nk);let i=e.model,r=t.buildShaderProgram(n.context);return i._pipelineResources.push(r),r}function Mft(e,t,n){let i=Nft(e),r=new zn({context:n.context,indexBuffer:i,attributes:e.attributes}),o=e.model;o._pipelineResources.push(r);let s=e.alphaOptions.pass,a=o.sceneGraph,c=n.mode===re.SCENE3D,u,f;if(!c&&!n.scene3DOnly&&o._projectTo2D)u=N.multiplyTransformation(a._computedModelMatrix,e.runtimeNode.computedTransform,new N),f=e.runtimePrimitive.boundingSphere2D;else{let x=c?a._computedModelMatrix:a._computedModelMatrix2D;u=N.multiplyTransformation(x,e.runtimeNode.computedTransform,new N),f=ue.transform(e.boundingSphere,u)}let d=Je(Ge.fromCache(e.renderStateOptions),!0);d.cull.face=xt.getCullFace(u,e.primitiveType),d=Ge.fromCache(d);let p=l(o.classificationType),g=p?!1:Pn.castShadows(o.shadows),m=p?!1:Pn.receiveShadows(o.shadows),y=p?void 0:e.pickId,A=p?void 0:e.snapId;return new at({boundingVolume:f,modelMatrix:u,uniformMap:e.uniformMap,renderState:d,vertexArray:r,shaderProgram:t,cull:o.cull,pass:s,count:e.count,owner:o,pickId:y,snapId:A,pickMetadataAllowed:!0,instanceCount:e.instanceCount,primitiveType:e.primitiveType,debugShowBoundingVolume:o.debugShowBoundingVolume,castShadows:g,receiveShadows:m})}function Nft(e){let t=e.wireframeIndexBuffer;if(l(t))return t;let n=e.indices;if(l(n))return n.buffer}var ik=XEe;function pl(e){e=e??H.EMPTY_OBJECT;let t=e.modelComponents;this._model=e.model,this._components=t,this._pipelineStages=[],this._updateStages=[],this._runtimeNodes=[],this._rootNodes=[],this._skinnedNodes=[],this._runtimeSkins=[],this.modelPipelineStages=[],this._boundingSphere=void 0,this._positionMin=void 0,this._positionMax=void 0,this._boundingSphere2D=void 0,this._computedModelMatrix=N.clone(N.IDENTITY),this._computedModelMatrix2D=N.clone(N.IDENTITY),this._axisCorrectionMatrix=xt.getAxisCorrectionMatrix(t.upAxis,t.forwardAxis,new N),this._runtimeArticulations={},Lft(this)}Object.defineProperties(pl.prototype,{components:{get:function(){return this._components}},computedModelMatrix:{get:function(){return this._computedModelMatrix}},axisCorrectionMatrix:{get:function(){return this._axisCorrectionMatrix}},boundingSphere:{get:function(){return this._boundingSphere}}});function Lft(e){let t=e._components,n=t.scene,r=e._model.modelMatrix;KEe(e,r);let o=t.articulations,s=o.length,a=e._runtimeArticulations;for(let x=0;x<s;x++){let T=o[x],E=new mB({articulation:T,sceneGraph:e}),v=E.name;a[v]=E}let c=t.nodes,u=c.length;e._runtimeNodes=new Array(u);let d=n.nodes.length,p=N.IDENTITY;for(let x=0;x<d;x++){let T=n.nodes[x],E=$Ee(e,T,p);e._rootNodes.push(E)}let g=t.skins,m=e._runtimeSkins,y=g.length;for(let x=0;x<y;x++){let T=g[x];m.push(new j2({skin:T,sceneGraph:e}))}let A=e._skinnedNodes,b=A.length;for(let x=0;x<b;x++){let T=A[x],E=e._runtimeNodes[T],S=c[T].skin.index;E._runtimeSkin=m[S],E.updateJointMatrices()}e.applyArticulations()}function KEe(e,t){let n=e._components,i=e._model;e._computedModelMatrix=N.multiplyTransformation(t,n.transform,e._computedModelMatrix),e._computedModelMatrix=N.multiplyTransformation(e._computedModelMatrix,e._axisCorrectionMatrix,e._computedModelMatrix),e._computedModelMatrix=N.multiplyByUniformScale(e._computedModelMatrix,i.computedScale,e._computedModelMatrix)}var Fft=new h;function Bft(e,t){let n=e._computedModelMatrix,i=N.getTranslation(n,Fft);if(!h.equals(i,h.ZERO))e._computedModelMatrix2D=At.basisTo2D(t.mapProjection,n,e._computedModelMatrix2D);else{let r=e.boundingSphere.center,o=At.ellipsoidTo2DModelMatrix(t.mapProjection,r,e._computedModelMatrix2D);e._computedModelMatrix2D=N.multiply(o,n,e._computedModelMatrix2D)}e._boundingSphere2D=ue.transform(e._boundingSphere,e._computedModelMatrix2D,e._boundingSphere2D)}function $Ee(e,t,n){let i=[],r=xt.getNodeTransform(t),o=t.children.length;for(let f=0;f<o;f++){let d=t.children[f],p=N.multiplyTransformation(n,r,new N),g=$Ee(e,d,p);i.push(g)}let s=new OB({node:t,transform:r,transformToRoot:n,children:i,sceneGraph:e}),a=t.primitives.length;for(let f=0;f<a;f++)s.runtimePrimitives.push(new V2({primitive:t.primitives[f],node:t,model:e._model}));let c=t.index;e._runtimeNodes[c]=s,l(t.skin)&&e._skinnedNodes.push(c);let u=t.name;if(l(u)){let f=e._model,d=new CB(f,s);f._nodesByName[u]=d}return c}var kft=new h,Uft=new h,zft=new h,Vft=new h;pl.prototype.buildDrawCommands=function(e){let t=this.buildRenderResources(e);this.computeBoundingVolumes(t),this.createDrawCommands(t,e)};pl.prototype.buildRenderResources=function(e){let t=this._model,n=new H2(t);t.statistics.clear(),this.configurePipeline(e);let i=this.modelPipelineStages;for(let r=0;r<i.length;r++)i[r].process(n,t,e);for(let r=0;r<this._runtimeNodes.length;r++){let o=this._runtimeNodes[r];if(!l(o))continue;o.configurePipeline();let s=o.pipelineStages,a=new K2(n,o);n.nodeRenderResources[r]=a;for(let c=0;c<s.length;c++)s[c].process(a,o.node,e);for(let c=0;c<o.runtimePrimitives.length;c++){let u=o.runtimePrimitives[c];u.configurePipeline(e);let f=u.pipelineStages,d=new J2(a,u);a.primitiveRenderResources[c]=d;for(let p=0;p<f.length;p++)f[p].process(d,u.primitive,e)}}return n};pl.prototype.computeBoundingVolumes=function(e){let t=this._model,n=h.fromElements(Number.MAX_VALUE,Number.MAX_VALUE,Number.MAX_VALUE,kft),i=h.fromElements(-Number.MAX_VALUE,-Number.MAX_VALUE,-Number.MAX_VALUE,Uft);for(let r=0;r<this._runtimeNodes.length;r++){let o=this._runtimeNodes[r];if(!l(o))continue;let s=e.nodeRenderResources[r],a=o.computedTransform;for(let c=0;c<o.runtimePrimitives.length;c++){let u=o.runtimePrimitives[c],f=s.primitiveRenderResources[c];u.boundingSphere=ue.clone(f.boundingSphere,new ue);let d=N.multiplyByPoint(a,f.positionMin,zft),p=N.multiplyByPoint(a,f.positionMax,Vft);h.minimumByComponent(n,d,n),h.minimumByComponent(n,p,n),h.maximumByComponent(i,p,i),h.maximumByComponent(i,d,i)}}this._positionMin=h.clone(n,this._positionMin),this._positionMax=h.clone(i,this._positionMax),this._boundingSphere=ue.fromCornerPoints(n,i,new ue),this._boundingSphere=ue.transformWithoutScale(this._boundingSphere,this._axisCorrectionMatrix,this._boundingSphere),this._boundingSphere=ue.transform(this._boundingSphere,this._components.transform,this._boundingSphere),t._boundingSphere=ue.transform(this._boundingSphere,t.modelMatrix,t._boundingSphere),t._initialRadius=t._boundingSphere.radius,t._boundingSphere.radius*=t._clampedScale};pl.prototype.createDrawCommands=function(e,t){for(let n=0;n<this._runtimeNodes.length;n++){let i=this._runtimeNodes[n];if(!l(i))continue;let r=e.nodeRenderResources[n];for(let o=0;o<i.runtimePrimitives.length;o++){let s=i.runtimePrimitives[o],a=r.primitiveRenderResources[o],c=ik.buildModelDrawCommand(a,t);s.drawCommand=c}}};pl.prototype.configurePipeline=function(e){let t=this.modelPipelineStages;t.length=0;let n=this._model,i=e.fog.enabled&&e.fog.renderable;if(l(n.color)&&t.push(vA),l(n.classificationType))return;n.imageBasedLighting.enabled&&t.push(dB),n.isClippingEnabled()&&t.push(_B);let r=(n._clippingPolygonData?.polygonRings.length??0)>0;n.isClippingPolygonsEnabled()&&r&&t.push(bB),n.hasDrapedVectors()&&t.push(EB),n.hasSilhouette(e)&&t.push(q2),l(n.splitDirection)&&n.splitDirection!==Ho.NONE&&t.push(X2),qo.is3DTiles(n.type)&&t.push(aB),i&&t.push(uB)};pl.prototype.update=function(e,t){let n,i,r;for(n=0;n<this._runtimeNodes.length;n++){let o=this._runtimeNodes[n];if(!l(o))continue;for(i=0;i<o.updateStages.length;i++)o.updateStages[i].update(o,this,e);let s=e.mode!==re.SCENE3D&&this._model._projectTo2D;for(t&&!s&&this.updateJointMatrices(),i=0;i<o.runtimePrimitives.length;i++){let a=o.runtimePrimitives[i];for(r=0;r<a.updateStages.length;r++)a.updateStages[r].update(a,this)}}};pl.prototype.updateModelMatrix=function(e,t){KEe(this,e),t.mode!==re.SCENE3D&&Bft(this,t);let n=this._rootNodes;for(let i=0;i<n.length;i++){let r=this._runtimeNodes[n[i]];r._transformDirty=!0}};pl.prototype.updateJointMatrices=function(){let e=this._skinnedNodes,t=e.length;for(let n=0;n<t;n++){let i=e[n];this._runtimeNodes[i].updateJointMatrices()}};function JEe(e,t,n,i,r){if(n&&!t.show)return;let o=t.children.length;for(let c=0;c<o;c++){let u=t.getChild(c);JEe(e,u,n,i,r)}let s=t.runtimePrimitives,a=s.length;for(let c=0;c<a;c++){let u=s[c];i(u,r)}}function lG(e,t,n,i){let r=e._rootNodes,o=r.length;for(let s=0;s<o;s++){let a=r[s],c=e._runtimeNodes[a];JEe(e,c,t,n,i)}}var jft={backFaceCulling:void 0};pl.prototype.updateBackFaceCulling=function(e){let t=jft;t.backFaceCulling=e,lG(this,!1,Hft,t)};function Hft(e,t){let n=e.drawCommand;n.backFaceCulling=t.backFaceCulling}var Gft={shadowMode:void 0};pl.prototype.updateShadows=function(e){let t=Gft;t.shadowMode=e,lG(this,!1,Wft,t)};function Wft(e,t){let n=e.drawCommand;n.shadows=t.shadowMode}var qft={debugShowBoundingVolume:void 0};pl.prototype.updateShowBoundingVolume=function(e){let t=qft;t.debugShowBoundingVolume=e,lG(this,!1,Yft,t)};function Yft(e,t){let n=e.drawCommand;n.debugShowBoundingVolume=t.debugShowBoundingVolume}var ZEe=[],QEe=[],eCe=[],Xft={frameState:void 0,hasSilhouette:void 0};pl.prototype.pushDrawCommands=function(e){let t=ZEe;t.length=0;let n=QEe;n.length=0;let i=eCe;i.length=0;let r=Xft;r.hasSilhouette=this._model.hasSilhouette(e),r.frameState=e,lG(this,!0,Kft,r),Zn(e.commandList,t),Zn(e.commandList,n),Zn(e.commandList,i)};function Kft(e,t){let n=t.frameState,i=t.hasSilhouette,r=n.passes,o=ZEe,s=QEe,a=eCe,c=e.drawCommand;c.pushCommands(n,n.commandList);let u=e.primitive.material;l(u)&&l(u.planarFill)&&(n.planarFillRequested=!0),i&&!r.pick&&c.pushSilhouetteCommands(n,o),l(c.pushEdgeCommands)&&c.pushEdgeCommands(n,s),l(c.pushPlanarFillIdCommands)&&c.pushPlanarFillIdCommands(n,a)}pl.prototype.setArticulationStage=function(e,t){let n=e.split(" ");if(n.length!==2)return;let i=n[0],r=n[1],o=this._runtimeArticulations[i];l(o)&&o.setArticulationStage(r,t)};pl.prototype.applyArticulations=function(){let e=this._runtimeArticulations;for(let t in e)e.hasOwnProperty(t)&&e[t].apply()};var rk=pl;function DA(){this.pointsLength=0,this.trianglesLength=0,this.geometryByteLength=0,this.texturesByteLength=0,this.propertyTablesByteLength=0,this._bufferIdSet={},this._textureIdByteLengths={},this._batchTextureIdMap=new Ut}Object.defineProperties(DA.prototype,{batchTexturesByteLength:{get:function(){let e=this._batchTextureIdMap.length,t=this._batchTextureIdMap.values,n=0;for(let i=0;i<e;i++)n+=t[i].byteLength;return n}}});DA.prototype.clear=function(){this.pointsLength=0,this.trianglesLength=0,this.geometryByteLength=0,this.texturesByteLength=0,this.propertyTablesByteLength=0,this._bufferIdSet={},this._textureIdByteLengths={},this._batchTextureIdMap.removeAll()};DA.prototype.addBuffer=function(e,t){if(!this._bufferIdSet.hasOwnProperty(e._id)){let n=t?2:1;this.geometryByteLength+=e.sizeInBytes*n}this._bufferIdSet[e._id]=!0};DA.prototype.addTexture=function(e){this._textureIdByteLengths.hasOwnProperty(e._id)||(this.texturesByteLength+=e.sizeInBytes,this._textureIdByteLengths[e._id]=e.sizeInBytes)};DA.prototype.getTextureIds=function(){return Object.keys(this._textureIdByteLengths)};DA.prototype.getTextureByteLengthById=function(e){return this._textureIdByteLengths[e]};DA.prototype.addBatchTexture=function(e){this._batchTextureIdMap.contains(e._id)||this._batchTextureIdMap.set(e._id,e)};var ok=DA;var rCe=Qo(mj(),1);var tCe={},WT=Uint32Array.BYTES_PER_ELEMENT;tCe.parse=function(e,t){t=t??0;let n=new Uint8Array(e),i=new DataView(e);t+=WT;let r=i.getUint32(t,!0);if(r!==1)throw new oe(`Only Point Cloud tile version 1 is supported. Version ${r} is not.`);t+=WT,t+=WT;let o=i.getUint32(t,!0);if(o===0)throw new oe("Feature table must have a byte length greater than zero");t+=WT;let s=i.getUint32(t,!0);t+=WT;let a=i.getUint32(t,!0);t+=WT;let c=i.getUint32(t,!0);t+=WT;let u=No(n,t,o);t+=o;let f=new Uint8Array(e,t,s);t+=s;let d,p;a>0&&(d=No(n,t,a),Object.keys(d).length===0&&(d=void 0),t+=a,c>0&&(p=new Uint8Array(e,t,c),p=new Uint8Array(p)));let g=new Cm(u,f),m=g.getGlobalProperty("POINTS_LENGTH");if(g.featuresLength=m,!l(m))throw new oe("Feature table global property: POINTS_LENGTH must be defined");let y=g.getGlobalProperty("RTC_CENTER",Y.FLOAT,3);l(y)&&(y=h.unpack(y));let A=Jft(g,d);if(A.rtcCenter=y,A.pointsLength=m,!A.hasPositions){let b=Zft(g);A.positions=b,A.hasPositions=A.hasPositions||l(b)}if(!A.hasPositions)throw new oe("Either POSITION or POSITION_QUANTIZED must be defined.");if(!A.hasNormals){let b=edt(g);A.normals=b,A.hasNormals=A.hasNormals||l(b)}if(!A.hasColors){let b=Qft(g);A.colors=b,A.hasColors=A.hasColors||l(b),A.hasConstantColor=l(A.constantColor),A.isTranslucent=l(b)&&b.isTranslucent}if(!A.hasBatchIds){let b=tdt(g);A.batchIds=b,A.hasBatchIds=A.hasBatchIds||l(b)}if(A.hasBatchIds){let b=g.getGlobalProperty("BATCH_LENGTH");if(!l(b))throw new oe("Global property: BATCH_LENGTH must be defined when BATCH_ID is defined.");A.batchLength=b}return(l(d)||l(p))&&(A.batchTableJson=d,A.batchTableBinary=p),$ft(A),A};function $ft(e){let t=e.batchTableJson;if(!l(t))return;let n=e.batchTableBinary;if(l(n))return;let i=Object.keys(e.draco?.batchTableProperties??{}),r=[];for(let o of Object.keys(t)){let a=t[o].byteOffset;l(a)&&(i.includes(o)||r.push(o))}for(let o of r)_t("PntsParser-invalidBinaryBodyReference",`The point cloud data contained a binary property ${o} that could not be resolved - skipping`),delete t[o]}function Jft(e,t){let n=e.json,i,r,o,s=l(n.extensions)?n.extensions["3DTILES_draco_point_compression"]:void 0,a=l(t)&&l(t.extensions)?t.extensions["3DTILES_draco_point_compression"]:void 0;l(a)&&(o=a.properties);let c,u,f,d,p;if(l(s)){r=s.properties;let m=s.byteOffset,y=s.byteLength;if(!l(r)||!l(m)||!l(y))throw new oe("Draco properties, byteOffset, and byteLength must be defined");i=e.buffer.slice(m,m+y),c=l(r.POSITION),u=l(r.RGB)||l(r.RGBA),f=l(r.NORMAL),d=l(r.BATCH_ID),p=l(r.RGBA)}let g;return l(i)&&(g={buffer:i,featureTableProperties:r,batchTableProperties:o,properties:Ot(r,o),dequantizeInShader:!0}),{draco:g,hasPositions:c,hasColors:u,isTranslucent:p,hasNormals:f,hasBatchIds:d}}function Zft(e){let t=e.json,n;if(l(t.POSITION))return n=e.getPropertyArray("POSITION",Y.FLOAT,3),{name:ct.POSITION,semantic:ct.POSITION,typedArray:n,isQuantized:!1,componentDatatype:Y.FLOAT,type:Vt.VEC3};if(l(t.POSITION_QUANTIZED)){n=e.getPropertyArray("POSITION_QUANTIZED",Y.UNSIGNED_SHORT,3);let i=e.getGlobalProperty("QUANTIZED_VOLUME_SCALE",Y.FLOAT,3);if(!l(i))throw new oe("Global property: QUANTIZED_VOLUME_SCALE must be defined for quantized positions.");let r=65535,o=e.getGlobalProperty("QUANTIZED_VOLUME_OFFSET",Y.FLOAT,3);if(!l(o))throw new oe("Global property: QUANTIZED_VOLUME_OFFSET must be defined for quantized positions.");return{name:ct.POSITION,semantic:ct.POSITION,typedArray:n,isQuantized:!0,componentDatatype:Y.FLOAT,type:Vt.VEC3,quantizedRange:r,quantizedVolumeOffset:h.unpack(o),quantizedVolumeScale:h.unpack(i),quantizedComponentDatatype:Y.UNSIGNED_SHORT,quantizedType:Vt.VEC3}}}function Qft(e){let t=e.json,n;if(l(t.RGBA))return n=e.getPropertyArray("RGBA",Y.UNSIGNED_BYTE,4),{name:ct.COLOR,semantic:ct.COLOR,setIndex:0,typedArray:n,componentDatatype:Y.UNSIGNED_BYTE,type:Vt.VEC4,normalized:!0,isRGB565:!1,isTranslucent:!0};if(l(t.RGB))return n=e.getPropertyArray("RGB",Y.UNSIGNED_BYTE,3),{name:"COLOR",semantic:ct.COLOR,setIndex:0,typedArray:n,componentDatatype:Y.UNSIGNED_BYTE,type:Vt.VEC3,normalized:!0,isRGB565:!1,isTranslucent:!1};if(l(t.RGB565))return n=e.getPropertyArray("RGB565",Y.UNSIGNED_SHORT,1),{name:"COLOR",semantic:ct.COLOR,setIndex:0,typedArray:n,componentDatatype:Y.FLOAT,type:Vt.VEC3,normalized:!1,isRGB565:!0,isTranslucent:!1};if(l(t.CONSTANT_RGBA)){let i=e.getGlobalProperty("CONSTANT_RGBA",Y.UNSIGNED_BYTE,4),r=i[3],o=z.fromBytes(i[0],i[1],i[2],r),s=r<255;return{name:ct.COLOR,semantic:ct.COLOR,setIndex:0,constantColor:o,componentDatatype:Y.FLOAT,type:Vt.VEC4,isQuantized:!1,isTranslucent:s}}}function edt(e){let t=e.json,n;if(l(t.NORMAL))return n=e.getPropertyArray("NORMAL",Y.FLOAT,3),{name:ct.NORMAL,semantic:ct.NORMAL,typedArray:n,octEncoded:!1,octEncodedZXY:!1,componentDatatype:Y.FLOAT,type:Vt.VEC3};if(l(t.NORMAL_OCT16P))return n=e.getPropertyArray("NORMAL_OCT16P",Y.UNSIGNED_BYTE,2),{name:ct.NORMAL,semantic:ct.NORMAL,typedArray:n,octEncoded:!0,octEncodedZXY:!1,quantizedRange:(1<<8)-1,quantizedType:Vt.VEC2,quantizedComponentDatatype:Y.UNSIGNED_BYTE,componentDatatype:Y.FLOAT,type:Vt.VEC3}}function tdt(e){let t=e.json;if(l(t.BATCH_ID)){let n=e.getPropertyArray("BATCH_ID",Y.UNSIGNED_SHORT,1);return{name:ct.FEATURE_ID,semantic:ct.FEATURE_ID,setIndex:0,typedArray:n,componentDatatype:Y.fromTypedArray(n),type:Vt.SCALAR}}}var qT=tCe;var ndt=Cn.Components,idt=Cn.Scene,rdt=Cn.Node,odt=Cn.Primitive,sdt=Cn.Attribute,nCe=Cn.Quantization,adt=Cn.FeatureIdAttribute,cdt=Cn.Material,ldt=Cn.MetallicRoughness,SQ=class extends ir{constructor(t){super(),t=t??H.EMPTY_OBJECT;let n=t.arrayBuffer,i=t.byteOffset??0;this._arrayBuffer=n,this._byteOffset=i,this._loadAttributesFor2D=t.loadAttributesFor2D??!1,this._parsedContent=void 0,this._decodePromise=void 0,this._decodedAttributes=void 0,this._promise=void 0,this._error=void 0,this._state=Tt.UNLOADED,this._buffers=[],this._components=void 0,this._transform=N.IDENTITY}get cacheKey(){}get components(){return this._components}get transform(){return this._transform}load(){if(l(this._promise))return this._promise;this._parsedContent=qT.parse(this._arrayBuffer,this._byteOffset),this._state=Tt.PROCESSING,this._promise=Promise.resolve(this)}process(t){if(l(this._error)){let n=this._error;throw this._error=void 0,n}if(this._state===Tt.READY)return!0;if(this._state===Tt.PROCESSING){if(l(this._decodePromise))return!1;this._decodePromise=udt(this,t.context)}return!1}unload(){let t=this._buffers;for(let n=0;n<t.length;n++)t[n].destroy();t.length=0,this._components=void 0,this._parsedContent=void 0,this._arrayBuffer=void 0}};function udt(e,t){let i=e._parsedContent.draco,r;if(l(i)?r=Kg.decodePointCloud(i,t):r=Promise.resolve(),!!l(r))return e._decodePromise=r,r.then(function(o){if(!e.isDestroyed())return l(o)&&fdt(e,i,o),Tdt(e,t),e._state=Tt.READY,e}).catch(function(o){e.unload(),e._state=Tt.FAILED;let s="Failed to load Draco pnts";e._error=e.getError(s,o)})}function fdt(e,t,n){e._state=Tt.READY;let i=e._parsedContent,r;if(l(n.POSITION)){if(r={name:"POSITION",semantic:ct.POSITION,typedArray:n.POSITION.array,componentDatatype:Y.FLOAT,type:Vt.VEC3,isQuantized:!1},l(n.POSITION.data.quantization)){let a=n.POSITION.data.quantization,c=a.range,u=h.fromElements(c,c,c),f=h.unpack(a.minValues),d=(1<<a.quantizationBits)-1;r.isQuantized=!0,r.quantizedRange=d,r.quantizedVolumeOffset=f,r.quantizedVolumeScale=u,r.quantizedComponentDatatype=d<=255?Y.UNSIGNED_BYTE:Y.UNSIGNED_SHORT,r.quantizedType=Vt.VEC3}i.positions=r}if(l(n.NORMAL)){if(r={name:"NORMAL",semantic:ct.NORMAL,typedArray:n.NORMAL.array,componentDatatype:Y.FLOAT,type:Vt.VEC3,isQuantized:!1,octEncoded:!1,octEncodedZXY:!1},l(n.NORMAL.data.quantization)){let a=(1<<n.NORMAL.data.quantization.quantizationBits)-1;r.quantizedRange=a,r.octEncoded=!0,r.octEncodedZXY=!0,r.quantizedComponentDatatype=Y.UNSIGNED_BYTE,r.quantizedType=Vt.VEC2}i.normals=r}if(l(n.RGBA)?i.colors={name:"COLOR",semantic:ct.COLOR,setIndex:0,typedArray:n.RGBA.array,componentDatatype:Y.UNSIGNED_BYTE,type:Vt.VEC4,normalized:!0,isTranslucent:!0}:l(n.RGB)&&(i.colors={name:"COLOR",semantic:ct.COLOR,setIndex:0,typedArray:n.RGB.array,componentDatatype:Y.UNSIGNED_BYTE,type:Vt.VEC3,normalized:!0,isTranslucent:!1}),l(n.BATCH_ID)){let a=n.BATCH_ID.array;i.batchIds={name:"_FEATURE_ID",semantic:ct.FEATURE_ID,setIndex:0,typedArray:a,componentDatatype:Y.fromTypedArray(a),type:Vt.SCALAR}}let o=i.batchTableJson,s=t.batchTableProperties;for(let a in s)if(s.hasOwnProperty(a)){let c=n[a];l(o)||(o={}),i.hasDracoBatchTable=!0;let u=c.data;o[a]={byteOffset:u.byteOffset,type:ddt(u.componentsPerAttribute),componentType:hdt(u.componentDatatype),typedArray:c.array}}i.batchTableJson=o}function ddt(e){switch(e){case 1:return"SCALAR";case 2:return"VEC2";case 3:return"VEC3";case 4:return"VEC4"}}function hdt(e){switch(e){case te.BYTE:return"BYTE";case te.UNSIGNED_BYTE:return"UNSIGNED_BYTE";case te.SHORT:return"SHORT";case te.UNSIGNED_SHORT:return"UNSIGNED_SHORT";case te.INT:return"INT";case te.UNSIGNED_INT:return"UNSIGNED_INT";case te.DOUBLE:return"DOUBLE";case te.FLOAT:return"FLOAT"}}function sk(e,t,n){let i=t.typedArray,r;if(t.octEncoded&&(r=new nCe,r.octEncoded=t.octEncoded,r.octEncodedZXY=t.octEncodedZXY,r.normalizationRange=t.quantizedRange,r.type=t.quantizedType,r.componentDatatype=t.quantizedComponentDatatype),t.isQuantized){r=new nCe;let a=t.quantizedRange;r.normalizationRange=a,r.quantizedVolumeOffset=h.ZERO;let c=t.quantizedVolumeScale;r.quantizedVolumeDimensions=c,r.quantizedVolumeStepSize=h.divideByScalar(c,a,new h),r.componentDatatype=t.quantizedComponentDatatype,r.type=t.quantizedType}let o=new sdt;if(o.name=t.name,o.semantic=t.semantic,o.setIndex=t.setIndex,o.componentDatatype=t.componentDatatype,o.type=t.type,o.normalized=t.normalized??!1,o.min=t.min,o.max=t.max,o.quantization=r,t.isRGB565&&(i=cn.decodeRGB565(i)),l(t.constantColor)){let a=new Array(4);o.constant=z.pack(t.constantColor,a)}else{let a=tt.createVertexBuffer({typedArray:i,context:n,usage:Me.STATIC_DRAW});a.vertexArrayDestroyable=!1,e._buffers.push(a),o.buffer=a}let s=e._loadAttributesFor2D;return o.semantic===ct.POSITION&&s&&(o.typedArray=i),o}var iCe,uG;function mdt(e){if(!l(uG)){iCe=new rCe.default(0),uG=new Array(e);for(let t=0;t<e;++t)uG[t]=iCe.random()}return uG}var pdt=new h,gdt=new h,_dt=new h;function ydt(e){let t=e.typedArray,n=20,i=t.length/3,r=Math.min(i,n),o=mdt(n),s=Number.MAX_VALUE,a=-Number.MAX_VALUE,c=h.fromElements(s,s,s,pdt),u=h.fromElements(a,a,a,gdt),f,d,p;if(e.isQuantized)c=h.ZERO,u=e.quantizedVolumeScale;else for(f=0;f<r;++f)d=Math.floor(o[f]*i),p=h.unpack(t,d*3,_dt),h.minimumByComponent(c,p,c),h.maximumByComponent(u,p,u);e.min=h.clone(c),e.max=h.clone(u)}var Adt={name:ct.COLOR,semantic:ct.COLOR,setIndex:0,constantColor:z.DARKGRAY,componentDatatype:Y.FLOAT,type:Vt.VEC4,isQuantized:!1,isTranslucent:!1};function bdt(e,t,n){let i=[],r,o=t.positions;return l(o)&&(ydt(o),r=sk(e,o,n),r.count=t.pointsLength,i.push(r)),l(t.normals)&&(r=sk(e,t.normals,n),r.count=t.pointsLength,i.push(r)),l(t.colors)?(r=sk(e,t.colors,n),r.count=t.pointsLength,i.push(r)):(r=sk(e,Adt,n),r.count=t.pointsLength,i.push(r)),l(t.batchIds)&&(r=sk(e,t.batchIds,n),r.count=t.pointsLength,i.push(r)),i}function xdt(e,t){let n=e.batchLength,i=e.pointsLength,r=e.batchTableJson,o=e.batchTableBinary,s=!l(e.batchIds);return l(o)||l(r)||e.hasDracoBatchTable?e_({count:n??i,batchTable:r,binaryBody:o,parseAsPropertyAttributes:s,customAttributeOutput:t}):new Ha({schema:{},propertyTables:[]})}function Tdt(e,t){let n=e._parsedContent,i=new ldt;i.metallicFactor=0,i.roughnessFactor=.9;let r=new cdt;r.metallicRoughness=i;let o=n.colors;l(o)&&o.isTranslucent&&(r.alphaMode=$p.BLEND);let s=!l(n.normals);r.unlit=s;let a=new odt;if(a.attributes=bdt(e,n,t),a.primitiveType=Oe.POINTS,a.material=r,l(n.batchIds)){let g=new adt;g.propertyTableId=0,g.setIndex=0,g.positionalLabel="featureId_0",a.featureIds.push(g)}let c=new rdt;c.index=0,c.primitives=[a];let u=new idt;u.nodes=[c],u.upAxis=Hi.Z,u.forwardAxis=Hi.X;let f=new ndt;f.scene=u,f.nodes=[c];let d=[];f.structuralMetadata=xdt(n,d),d.length>0&&Edt(e,a,d,t),l(n.rtcCenter)&&(f.transform=N.multiplyByTranslation(f.transform,n.rtcCenter,f.transform));let p=n.positions;l(p)&&p.isQuantized&&(f.transform=N.multiplyByTranslation(f.transform,p.quantizedVolumeOffset,f.transform)),e._components=f,e._parsedContent=void 0,e._arrayBuffer=void 0}function Edt(e,t,n,i){let r=t.attributes,o=n.length;for(let s=0;s<o;s++){let a=n[s],c=tt.createVertexBuffer({typedArray:a.typedArray,context:i,usage:Me.STATIC_DRAW});c.vertexArrayDestroyable=!1,e._buffers.push(c),a.buffer=c,a.typedArray=void 0,r.push(a)}t.propertyAttributeIds=[0]}var ak=SQ;var fG=new h,oCe=new h,sCe=new h,ck=new h,Cdt=new h,vdt=new h,Sdt=new he,wdt=new ue;function dG(e,t,n,i){let r=t*n;return i.x=e[r],i.y=e[r+1],i.z=e[r+2],i}var Idt=32,wQ=new Map,IQ=[];function Pdt(e,t,n,i,r,o){let s=e.origin.x,a=e.origin.y,c=e.origin.z,u=e.direction.x,f=e.direction.y,d=e.direction.z,p=D.EPSILON6;for(let g=0;g<i;g+=3){let m=n[g]*3,y=n[g+1]*3,A=n[g+2]*3,b=t[m],x=t[m+1],T=t[m+2],E=t[y]-b,v=t[y+1]-x,S=t[y+2]-T,I=t[A]-b,R=t[A+1]-x,O=t[A+2]-T,L=f*O-d*R,_=d*I-u*O,C=u*R-f*I,w=E*L+v*_+S*C,P=s-b,M=a-x,F=c-T,V;if(r){if(w<p)continue;let B=P*L+M*_+F*C;if(B<0||B>w)continue;let j=M*S-F*v,k=F*E-P*S,G=P*v-M*E,q=u*j+f*k+d*G;if(q<0||B+q>w)continue;V=(I*j+R*k+O*G)/w}else{if(Math.abs(w)<p)continue;let B=1/w,j=(P*L+M*_+F*C)*B;if(j<0||j>1)continue;let k=M*S-F*v,G=F*E-P*S,q=P*v-M*E,Q=(u*k+f*G+d*q)*B;if(Q<0||j+Q>1)continue;V=(I*k+R*G+O*q)*B}V>=0&&V<o&&(o=V)}return o}function Nw(e,t,n,i,r,o,s){if(!e._ready||n.mode===re.MORPHING)return;let a=Number.MAX_VALUE;o=o??ee.default,i=i??1,r=r??0;let c=n.mode!==re.SCENE3D?n.mapProjection:void 0;if(Ea.forEachPrimitive(e,{mapProjection:c},function(u,f,d,p){if(l(u.boundingSphere)&&d.length===1){let T=ue.transform(u.boundingSphere,p,wdt),E=_i.raySphere(t,T);if(!l(E))return}if(!l(f.indices))return;let g,m,y=xt.getAttributeBySemantic(f,ct.POSITION),A=wQ.get(f);l(A)||(A={},l(y)&&(A.vertices=Ea.readAttributeAsTypedArray(y)),l(f.indices)&&(A.indices=Ea.readIndicesAsTypedArray(f.indices)),wQ.set(f,A),IQ.push(f),IQ.length>Idt&&wQ.delete(IQ.shift())),l(y)&&(m=Vt.getNumberOfComponents(y.type),g=A.vertices);let b=A.indices;if(!l(b)||!l(g))return;let x=b.length;if(d.length===1&&i===1){let T=d[0].transform;if(!l(A.world)||!N.equals(A.worldTransform,T)){let I=g.length/m,R=new Float64Array(I*3);for(let O=0;O<I;O++)dG(g,O,m,fG),N.multiplyByPoint(T,fG,ck),R[O*3]=ck.x,R[O*3+1]=ck.y,R[O*3+2]=ck.z;A.world=R,A.worldTransform=N.clone(T,A.worldTransform)}let E=A.world,v=e.backFaceCulling??!0,S=Pdt(t,E,b,x,v,a);S<a&&(a=S);return}for(let T=0;T<x;T+=3){let E=b[T],v=b[T+1],S=b[T+2];dG(g,E,m,fG),dG(g,v,m,oCe),dG(g,S,m,sCe);for(let I of d){let R=N.multiplyByPoint(I.transform,fG,ck),O=N.multiplyByPoint(I.transform,oCe,Cdt),L=N.multiplyByPoint(I.transform,sCe,vdt);i!==1&&(Ar.getPosition(R,o,i,r,R),Ar.getPosition(O,o,i,r,O),Ar.getPosition(L,o,i,r,L));let _=_i.rayTriangleParametric(t,R,O,L,e.backFaceCulling??!0);l(_)&&_<a&&_>=0&&(a=_)}}}),a!==Number.MAX_VALUE){if(s=pn.getPoint(t,a,s),n.mode!==re.SCENE3D){h.fromElements(s.y,s.z,s.x,s);let u=n.mapProjection,f=u.ellipsoid,d=u.unproject(s,Sdt);f.cartographicToCartesian(d,s)}return s}}var PQ=class{constructor(t){this.show=t.show,this.alpha=t.alpha,this.brightness=t.brightness,this.contrast=t.contrast,this.hue=t.hue,this.saturation=t.saturation,this.gamma=t.gamma,this.colorToAlpha=t.colorToAlpha}},lk=PQ;var DQ=class{constructor(t){this._model=t,this._modelPrimitiveImageries=void 0,this._imageryConfigurations=[]}update(t){if(!this._hasImagery){this._deleteModelPrimitiveImageries();return}this._allImageryLayersReady&&(l(this._modelPrimitiveImageries)||(this._modelPrimitiveImageries=this._createModelPrimitiveImageries()),this._updateModelPrimitiveImageries(t),this._checkForModifiedImageryConfigurations())}_createModelPrimitiveImageries(){let t=this._model,n=this._collectRuntimeNodesAndPrimitives(),i=[],r=n.length;for(let o=0;o<r;o++){let s=n[o],a=s.runtimeNode,c=s.runtimePrimitive,u=new jT(t,a,c);c.primitive.modelPrimitiveImagery=u,i.push(u)}return i}_collectRuntimeNodesAndPrimitives(){let i=this._model.sceneGraph._runtimeNodes,r=[];for(let o=0;o<i.length;o++){let s=i[o];if(l(s))for(let a=0;a<s.runtimePrimitives.length;a++){let c=s.runtimePrimitives[a];r.push({runtimeNode:s,runtimePrimitive:c})}}return r}_updateModelPrimitiveImageries(t){if(!l(this._modelPrimitiveImageries))throw new pe("The modelPrimitiveImageries have not been created");let n=this._modelPrimitiveImageries,i=n.length;for(let r=0;r<i;r++)n[r].update(t)}_deleteModelPrimitiveImageries(){let t=this._modelPrimitiveImageries;if(!l(t))return;let n=t.length;for(let i=0;i<n;i++)t[i].destroy();delete this._modelPrimitiveImageries,this._model.resetDrawCommands()}get ready(){return this._hasImagery?!(!this._allImageryLayersReady||!this._allModelPrimitiveImageriesReady):!0}get _hasImagery(){let n=this._model.imageryLayers;return l(n)&&n.length>0}get _allImageryLayersReady(){if(!this._hasImagery)return!0;let t=this._model.imageryLayers,n=t.length;for(let i=0;i<n;i++)if(!t.get(i).ready)return!1;return!0}get _allModelPrimitiveImageriesReady(){let t=this._modelPrimitiveImageries;if(!l(t))return!1;let n=t.length;for(let i=0;i<n;i++)if(!t[i].ready)return!1;return!0}_checkForModifiedImageryConfigurations(){this._imageryConfigurationsModified()&&(this._updateImageryConfigurations(),this._model.resetDrawCommands())}_imageryConfigurationsModified(){let n=this._model.imageryLayers,i=this._imageryConfigurations;if(n.length!==i.length)return!0;for(let r=0;r<n.length;r++){let o=n.get(r),s=i[r];if(o.show!==s.show||o.alpha!==s.alpha||o.brightness!==s.brightness||o.contrast!==s.contrast||o.hue!==s.hue||o.saturation!==s.saturation||o.gamma!==s.gamma||o.colorToAlpha!==s.colorToAlpha)return!0}return!1}_updateImageryConfigurations(){let n=this._model.imageryLayers,i=this._imageryConfigurations;i.length=n.length;for(let r=0;r<n.length;r++){let o=n.get(r);i[r]=new lk(o)}}isDestroyed(){return!1}destroy(){if(!this.isDestroyed())return this._deleteModelPrimitiveImageries(),le(this)}},uk=DQ;function Cr(e){e=e??H.EMPTY_OBJECT,this._loader=e.loader,this._resource=e.resource,this.type=e.type??qo.GLTF,this.modelMatrix=N.clone(e.modelMatrix??N.IDENTITY),this._modelMatrix=N.clone(this.modelMatrix),this._scale=e.scale??1,this._minimumPixelSize=e.minimumPixelSize??0,this._maximumScale=e.maximumScale,this._clampedScale=l(this._maximumScale)?Math.min(this._scale,this._maximumScale):this._scale,this._computedScale=this._clampedScale,this._updateModelMatrix=!1,this.referenceMatrix=void 0,this._iblReferenceFrameMatrix=$.clone($.IDENTITY),this._clippingPlanesMatrix=N.clone(N.IDENTITY),this._resourcesLoaded=!1,this._drawCommandsBuilt=!1,this._ready=!1,this._customShader=e.customShader,this._content=e.content,this._texturesLoaded=!1,this._defaultTexture=void 0,this._activeAnimations=new rB(this),this._clampAnimations=e.clampAnimations??!0,this._userAnimationDirty=!1,this._id=e.id,this._idDirty=!1,this._color=z.clone(e.color),this._colorBlendMode=e.colorBlendMode??sl.HIGHLIGHT,this._colorBlendAmount=e.colorBlendAmount??.5;let t=e.silhouetteColor??z.RED;this._silhouetteColor=z.clone(t),this._silhouetteSize=e.silhouetteSize??0,this._silhouetteDirty=!1,this._silhouetteId=void 0,this._cull=e.cull??!0,this._opaquePass=e.opaquePass??Ie.OPAQUE,this._allowPicking=e.allowPicking??!0,this._show=e.show??!0,this._style=void 0,this._styleDirty=!1,this._styleCommandsNeeded=void 0;let n=e.featureIdLabel??"featureId_0";typeof n=="number"&&(n=`featureId_${n}`),this._featureIdLabel=n;let i=e.instanceFeatureIdLabel??"instanceFeatureId_0";typeof i=="number"&&(i=`instanceFeatureId_${i}`),this._instanceFeatureIdLabel=i,this._featureTables=[],this._featureTableId=void 0,this._featureTableIdDirty=!0,this._pipelineResources=[],this._modelResources=[],this._pickIds=[],this._boundingSphere=new ue,this._initialRadius=void 0,this._heightReference=e.heightReference??We.NONE,this._heightDirty=this._heightReference!==We.NONE,this._removeUpdateHeightCallback=void 0,this._enableVerticalExaggeration=e.enableVerticalExaggeration??!0,this._hasVerticalExaggeration=!1,this._clampedModelMatrix=void 0,this._heightAboveSurface=void 0,this._lastSurfaceHeight=void 0,this._lastSurfaceQueryFrame=-1,this._lastSurfaceQueryMissed=!1;let r=e.scene;l(r)&&l(r.terrainProviderChanged)&&(this._terrainProviderChangedCallback=r.terrainProviderChanged.addEventListener(()=>{this._heightDirty=!0})),this._scene=r,this._distanceDisplayCondition=e.distanceDisplayCondition;let o=new t0(e.pointCloudShading);this._pointCloudShading=o,this._attenuation=o.attenuation,this._pointCloudBackFaceCulling=o.backFaceCulling;let s=e.clippingPlanes;l(s)&&s.owner===void 0?Cs.setOwner(s,this,"_clippingPlanes"):this._clippingPlanes=s,this._clippingPlanesState=0;let a=e.clippingPolygons;l(a)&&a.owner===void 0?Nc.setOwner(a,this,"_clippingPolygons"):this._clippingPolygons=a,this._clippingPolygonsState=0,this._clippingPolygonsNeedRebake=!1,this._removeClippingPolygonAdded=void 0,this._removeClippingPolygonRemoved=void 0,lCe(this),this._vectorData=void 0,this._vectorLookupFlags=0,this._clippingPolygonData=void 0,this._rectangle=new ie,this._modelImagery=new uk(this),this._lightColor=h.clone(e.lightColor),this._imageBasedLighting=l(e.imageBasedLighting)?e.imageBasedLighting:new LT,this._shouldDestroyImageBasedLighting=!l(e.imageBasedLighting),this._environmentMapManager=void 0;let c=new Wg(e.environmentMapOptions);Wg.setOwner(c,this,"_environmentMapManager"),this._backFaceCulling=e.backFaceCulling??!0,this._backFaceCullingDirty=!1,this._shadows=e.shadows??Pn.ENABLED,this._shadowsDirty=!1,this._debugShowBoundingVolumeDirty=!1,this._debugShowBoundingVolume=e.debugShowBoundingVolume??!1,this._enableDebugWireframe=e.enableDebugWireframe??!1,this._enableShowOutline=e.enableShowOutline??!0,this._debugWireframe=e.debugWireframe??!1,this._edgeDisplayMode=e.edgeDisplayMode??Kd.SURFACES_ONLY,this._debugWireframe===!0&&this._enableDebugWireframe===!1&&this.type===qo.GLTF&&_t("model-debug-wireframe-ignored","enableDebugWireframe must be set to true in Model.fromGltf, otherwise debugWireframe will be ignored.");let u=e.credit;typeof u=="string"&&(u=new It(u)),this._credits=[],this._credit=u,this._resourceCredits=[],this._gltfCredits=[],this._showCreditsOnScreen=e.showCreditsOnScreen??!1,this._showCreditsOnScreenDirty=!0,this._splitDirection=e.splitDirection??Ho.NONE,this._enableShowOutline=e.enableShowOutline??!0,this.showOutline=e.showOutline??!0,this.outlineColor=e.outlineColor??z.BLACK,this._classificationType=e.classificationType,this._statistics=new ok,this._sceneMode=void 0,this._projectTo2D=e.projectTo2D??!1,this._enablePick=e.enablePick??!1,this._fogRenderable=void 0,this._skipLevelOfDetail=!1,this._ignoreCommands=e.ignoreCommands??!1,this._errorEvent=new be,this._readyEvent=new be,this._texturesReadyEvent=new be,this._sceneGraph=void 0,this._nodesByName={},this.pickObject=e.pickObject}function RQ(e,t){if(e._errorEvent.numberOfListeners>0){e._errorEvent.raiseEvent(t);return}console.log(t)}function Ddt(e,t){let n=e._featureTables,i=t.propertyTables,r=i.length;for(let o=0;o<r;o++){let s=i[o],a=new sB({model:e,propertyTable:s});n.push(a)}return n}function Rdt(e,t){let n=t._featureIdLabel,i=t._instanceFeatureIdLabel,r,o,s,a;for(r=0;r<e.nodes.length;r++)if(a=e.nodes[r],l(a.instances)&&(s=xt.getFeatureIdsByLabel(a.instances.featureIds,i),l(s)&&l(s.propertyTableId)))return s.propertyTableId;for(r=0;r<e.nodes.length;r++)for(a=e.nodes[r],o=0;o<a.primitives.length;o++){let c=a.primitives[o],u=xt.getFeatureIdsByLabel(c.featureIds,n);if(l(u))return u.propertyTableId}if(t._featureTables.length===1)return 0}function NQ(e,t){if(!l(e)&&!l(t))return!1;if(l(e)!==l(t))return!0;let n=e.alpha,i=t.alpha;return Math.floor(n)!==Math.floor(i)||Math.ceil(n)!==Math.ceil(i)}Object.defineProperties(Cr.prototype,{ready:{get:function(){return this._ready}},errorEvent:{get:function(){return this._errorEvent}},readyEvent:{get:function(){return this._readyEvent}},incrementallyLoadTextures:{get:function(){return this._loader.incrementallyLoadTextures??!1}},texturesReadyEvent:{get:function(){return this._texturesReadyEvent}},loader:{get:function(){return this._loader}},statistics:{get:function(){return this._statistics}},activeAnimations:{get:function(){return this._activeAnimations}},clampAnimations:{get:function(){return this._clampAnimations},set:function(e){this._clampAnimations=e}},cull:{get:function(){return this._cull}},opaquePass:{get:function(){return this._opaquePass}},pointCloudShading:{get:function(){return this._pointCloudShading},set:function(e){e!==this._pointCloudShading&&this.resetDrawCommands(),this._pointCloudShading=e}},customShader:{get:function(){return this._customShader},set:function(e){e!==this._customShader&&this.resetDrawCommands(),this._customShader=e}},sceneGraph:{get:function(){return this._sceneGraph}},content:{get:function(){return this._content}},heightReference:{get:function(){return this._heightReference},set:function(e){e!==this._heightReference&&(this._heightDirty=!0),this._heightReference=e}},distanceDisplayCondition:{get:function(){return this._distanceDisplayCondition},set:function(e){this._distanceDisplayCondition=Ht.clone(e,this._distanceDisplayCondition)}},structuralMetadata:{get:function(){return this._sceneGraph.components.structuralMetadata}},featureTableId:{get:function(){return this._featureTableId},set:function(e){this._featureTableId=e}},featureTables:{get:function(){return this._featureTables},set:function(e){this._featureTables=e}},id:{get:function(){return this._id},set:function(e){e!==this._id&&(this._idDirty=!0),this._id=e}},allowPicking:{get:function(){return this._allowPicking}},style:{get:function(){return this._style},set:function(e){this._style=e,this._styleDirty=!0}},color:{get:function(){return this._color},set:function(e){NQ(e,this._color)&&this.resetDrawCommands(),this._color=z.clone(e,this._color)}},colorBlendMode:{get:function(){return this._colorBlendMode},set:function(e){this._colorBlendMode=e}},colorBlendAmount:{get:function(){return this._colorBlendAmount},set:function(e){this._colorBlendAmount=e}},silhouetteColor:{get:function(){return this._silhouetteColor},set:function(e){if(!z.equals(e,this._silhouetteColor)){let t=NQ(e,this._silhouetteColor);this._silhouetteDirty=this._silhouetteDirty||t}this._silhouetteColor=z.clone(e,this._silhouetteColor)}},silhouetteSize:{get:function(){return this._silhouetteSize},set:function(e){if(e!==this._silhouetteSize){let t=this._silhouetteSize,n=e>0&&t===0||e===0&&t>0;this._silhouetteDirty=this._silhouetteDirty||n,this._backFaceCullingDirty=this._backFaceCullingDirty||n}this._silhouetteSize=e}},heightAboveSurface:{get:function(){return this._heightAboveSurface}},boundingSphere:{get:function(){let e=l(this._clampedModelMatrix)?this._clampedModelMatrix:this.modelMatrix;return fCe(this,e),this._boundingSphere}},debugShowBoundingVolume:{get:function(){return this._debugShowBoundingVolume},set:function(e){this._debugShowBoundingVolume!==e&&(this._debugShowBoundingVolumeDirty=!0),this._debugShowBoundingVolume=e}},debugWireframe:{get:function(){return this._debugWireframe},set:function(e){this._debugWireframe!==e&&this.resetDrawCommands(),this._debugWireframe=e,this._debugWireframe===!0&&this._enableDebugWireframe===!1&&this.type===qo.GLTF&&_t("model-debug-wireframe-ignored","enableDebugWireframe must be set to true in Model.fromGltfAsync, otherwise debugWireframe will be ignored.")}},edgeDisplayMode:{get:function(){return this._edgeDisplayMode},set:function(e){this._edgeDisplayMode=e}},show:{get:function(){return this._show},set:function(e){this._show=e}},featureIdLabel:{get:function(){return this._featureIdLabel},set:function(e){typeof e=="number"&&(e=`featureId_${e}`),e!==this._featureIdLabel&&(this._featureTableIdDirty=!0),this._featureIdLabel=e}},instanceFeatureIdLabel:{get:function(){return this._instanceFeatureIdLabel},set:function(e){typeof e=="number"&&(e=`instanceFeatureId_${e}`),e!==this._instanceFeatureIdLabel&&(this._featureTableIdDirty=!0),this._instanceFeatureIdLabel=e}},clippingPlanes:{get:function(){return this._clippingPlanes},set:function(e){e!==this._clippingPlanes&&(Cs.setOwner(e,this,"_clippingPlanes"),this.resetDrawCommands())}},clippingPolygons:{get:function(){return this._clippingPolygons},set:function(e){e!==this._clippingPolygons&&(Nc.setOwner(e,this,"_clippingPolygons"),lCe(this),this.resetDrawCommands(),this._clippingPolygonsState=0,this._clippingPolygonsNeedRebake=!0,l(this._clippingPolygonData)&&(Nc.releaseRectangleData(this._clippingPolygonData),this._clippingPolygonData=void 0))}},enableVerticalExaggeration:{get:function(){return this._enableVerticalExaggeration},set:function(e){e!==this._enableVerticalExaggeration&&this.resetDrawCommands(),this._enableVerticalExaggeration=e}},hasVerticalExaggeration:{get:function(){return this._hasVerticalExaggeration}},imageryLayers:{get:function(){if(l(this._content)){let e=this._content.tileset;if(l(e))return e.imageryLayers}}},lightColor:{get:function(){return this._lightColor},set:function(e){l(e)!==l(this._lightColor)&&this.resetDrawCommands(),this._lightColor=h.clone(e,this._lightColor)}},imageBasedLighting:{get:function(){return this._imageBasedLighting},set:function(e){e!==this._imageBasedLighting&&(this._shouldDestroyImageBasedLighting&&!this._imageBasedLighting.isDestroyed()&&this._imageBasedLighting.destroy(),this._imageBasedLighting=e,this._shouldDestroyImageBasedLighting=!1,this.resetDrawCommands())}},environmentMapManager:{get:function(){return this._environmentMapManager},set:function(e){e!==this.environmentMapManager&&(Wg.setOwner(e,this,"_environmentMapManager"),this.resetDrawCommands())}},backFaceCulling:{get:function(){return this._backFaceCulling},set:function(e){e!==this._backFaceCulling&&(this._backFaceCullingDirty=!0),this._backFaceCulling=e}},scale:{get:function(){return this._scale},set:function(e){e!==this._scale&&(this._updateModelMatrix=!0),this._scale=e}},computedScale:{get:function(){return this._computedScale}},minimumPixelSize:{get:function(){return this._minimumPixelSize},set:function(e){e!==this._minimumPixelSize&&(this._updateModelMatrix=!0),this._minimumPixelSize=e}},maximumScale:{get:function(){return this._maximumScale},set:function(e){e!==this._maximumScale&&(this._updateModelMatrix=!0),this._maximumScale=e}},shadows:{get:function(){return this._shadows},set:function(e){e!==this._shadows&&(this._shadowsDirty=!0),this._shadows=e}},credit:{get:function(){return this._credit}},showCreditsOnScreen:{get:function(){return this._showCreditsOnScreen},set:function(e){this._showCreditsOnScreen!==e&&(this._showCreditsOnScreenDirty=!0),this._showCreditsOnScreen=e}},splitDirection:{get:function(){return this._splitDirection},set:function(e){this._splitDirection!==e&&this.resetDrawCommands(),this._splitDirection=e}},classificationType:{get:function(){return this._classificationType}},pickIds:{get:function(){return this._pickIds}},styleCommandsNeeded:{get:function(){return this._styleCommandsNeeded}}});Cr.prototype.getRectangle=function(e){let t=this._content?.tile?.contentBoundingVolume;return l(t?.rectangle)?t.rectangle:(e=e??this._scene?.ellipsoid??ee.default,ie.fromBoundingSphere(this.boundingSphere,e,this._rectangle))};Cr.prototype.getNode=function(e){return this._nodesByName[e]};Cr.prototype.setArticulationStage=function(e,t){this._sceneGraph.setArticulationStage(e,t)};Cr.prototype.applyArticulations=function(){this._sceneGraph.applyArticulations()};Cr.prototype.getExtension=function(e){return this._loader.components.extensions[e]};Cr.prototype.makeStyleDirty=function(){this._styleDirty=!0};Cr.prototype.resetDrawCommands=function(){this._drawCommandsBuilt=!1};var Odt=new N,Mdt=new $,Ndt=new N;Cr.prototype.update=function(e){let t=!1;try{t=Ldt(this,e)}catch(i){if(!this._loader.incrementallyLoadTextures&&i.name==="TextureError")RQ(this,i);else{let r=xt.getError("model",this._resource,i);RQ(this,r)}}if(Fdt(this,e),Bdt(this,e),kdt(this,e),!this._resourcesLoaded&&t){this._resourcesLoaded=!0;let i=this._loader.components;if(!l(i)){if(this._loader.isUnloaded())return;let s=xt.getError("model",this._resource,new oe("Failed to load model."));RQ(s),this._rejectLoad=this._rejectLoad&&this._rejectLoad(s)}let r=i.structuralMetadata;l(r)&&r.propertyTableCount>0&&Ddt(this,r);let o=new rk({model:this,modelComponents:i});this._sceneGraph=o,this._gltfCredits=o.components.asset.credits}if(!this._resourcesLoaded||e.mode===re.MORPHING)return;let n=this._modelImagery;if(n.update(e),!(!n.ready&&!(this._content?.tileset?._asynchronouslyLoadImagery??!1))){if(Udt(this),zdt(this),Vdt(this,e),jdt(this),Hdt(this,e),Gdt(this,e),Wdt(this,e),qdt(this,e),Kdt(this,e),$dt(this,e),Jdt(this,e),Zdt(this,e),this._defaultTexture=e.context.defaultTexture,Qdt(this,e),tht(this,e),rht(this),oht(this,e),lht(this,e),!this._ready){e.afterRender.push(()=>{this._ready=!0,this._readyEvent.raiseEvent(this)});return}this._loader.incrementallyLoadTextures&&!this._texturesLoaded&&this._loader.texturesLoaded&&(this.resetDrawCommands(),this._texturesLoaded=!0,this._texturesReadyEvent.raiseEvent(this)),aht(this),uht(this,e),fht(this),hht(this,e)}};function Ldt(e,t){return!e._resourcesLoaded||e._loader.incrementallyLoadTextures&&!e._texturesLoaded?(t.afterRender.push(()=>!0),e._loader.process(t)):!0}function Fdt(e,t){l(e._customShader)&&e._customShader.update(t)}function Bdt(e,t){let n=e._environmentMapManager,i=t.passes.pick||t.passes.pickVoxel;e._ready&&n.owner===e&&!i&&(n.position=e._boundingSphere.center,n.shouldUpdate=!l(e._imageBasedLighting.sphericalHarmonicCoefficients)||!l(e._imageBasedLighting.specularEnvironmentMaps),n.update(t),n.shouldRegenerateShaders&&e.resetDrawCommands())}function kdt(e,t){e._imageBasedLighting.update(t),e._imageBasedLighting.shouldRegenerateShaders&&e.resetDrawCommands()}function Udt(e){if(!e._featureTableIdDirty)return;e._featureTableIdDirty=!1;let t=e._sceneGraph.components,n=t.structuralMetadata;l(n)&&n.propertyTableCount>0&&(e.featureTableId=Rdt(t,e),e._styleDirty=!0,e.resetDrawCommands())}function zdt(e){e._styleDirty&&(e.applyStyle(e._style),e._styleDirty=!1)}function Vdt(e,t){let n=e._featureTables,i=n.length,r=!1;for(let o=0;o<i;o++)n[o].update(t),n[o].styleCommandsNeededDirty&&(r=!0);r&&cCe(e)}function cCe(e){let t=e.featureTables[e.featureTableId];e._styleCommandsNeeded=wm.getStyleCommandsNeeded(t.featuresLength,t.batchTexture.translucentFeaturesLength)}function jdt(e){let t=e.pointCloudShading;t.attenuation!==e._attenuation&&(e.resetDrawCommands(),e._attenuation=t.attenuation),t.backFaceCulling!==e._pointCloudBackFaceCulling&&(e.resetDrawCommands(),e._pointCloudBackFaceCulling=t.backFaceCulling)}function Hdt(e,t){e._silhouetteDirty&&(hCe(t)&&e.resetDrawCommands(),e._silhouetteDirty=!1)}function Gdt(e,t){let n=e.hasSkipLevelOfDetail(t);n!==e._skipLevelOfDetail&&(e.resetDrawCommands(),e._skipLevelOfDetail=n)}function Wdt(e,t){let n=0;e.isClippingEnabled()&&(e._clippingPlanes.owner===e&&e._clippingPlanes.update(t),n=e._clippingPlanes.clippingPlanesState),n!==e._clippingPlanesState&&(e.resetDrawCommands(),e._clippingPlanesState=n)}function lCe(e){e._removeClippingPolygonAdded=e._removeClippingPolygonAdded&&e._removeClippingPolygonAdded(),e._removeClippingPolygonRemoved=e._removeClippingPolygonRemoved&&e._removeClippingPolygonRemoved();let t=e._clippingPolygons;if(!l(t)||t.owner!==e)return;let n=()=>{e._clippingPolygonsNeedRebake=!0};e._removeClippingPolygonAdded=t.polygonAdded.addEventListener(n),e._removeClippingPolygonRemoved=t.polygonRemoved.addEventListener(n)}function qdt(e,t){let n=e._clippingPolygons,i=e.isClippingPolygonsEnabled(),r=0;i&&(n.owner===e&&n.update(t),r=n.clippingPolygonsState),r!==e._clippingPolygonsState&&(e.resetDrawCommands(),e._clippingPolygonsState=r);let o=(e._clippingPolygonData?.polygonRings.length??0)>0;if(e._clippingPolygonsNeedRebake&&(e._clippingPolygonsNeedRebake=!1,l(e._clippingPolygonData)&&(Nc.releaseRectangleData(e._clippingPolygonData),e._clippingPolygonData=void 0)),!i||!e._ready)return;l(e._clippingPolygonData)||(e._clippingPolygonData=n.requestRectangleData(e.getRectangle(n.ellipsoid),t.context));let s=(e._clippingPolygonData?.polygonRings.length??0)>0;o!==s&&e.resetDrawCommands()}var Ydt=new ie;function uCe(e){l(e._vectorData)&&(e._scene?.vectorProvider?.releaseTileData(e._vectorData),e._vectorData=void 0)}function Xdt(e){if(e?.show!==!0)return 0;let t=1;return t|=e.hasPolylines?2:0,t|=e.hasPolygons?4:0,t}function Kdt(e,t){let n=e._scene?.vectorProvider;if(l(n)&&l(e._content)&&e.ready&&t.mode===re.SCENE3D){let o=e._content?.tile?.contentBoundingVolume.rectangle??ie.fromBoundingSphere(e.boundingSphere,n.ellipsoid,Ydt);e._vectorData=l(e._vectorData)?n.updateDataForRectangle(o,t.context,e._vectorData,We.CLAMP_TO_3D_TILE):n.requestDataForRectangle(o,t.context,We.CLAMP_TO_3D_TILE)}else uCe(e);let r=Xdt(e._vectorData);r!==e._vectorLookupFlags&&(e.resetDrawCommands(),e._vectorLookupFlags=r)}function $dt(e,t){t.mode!==e._sceneMode&&(e._projectTo2D?e.resetDrawCommands():e._updateModelMatrix=!0,e._sceneMode=t.mode)}function Jdt(e,t){let n=t.fog.enabled&&t.fog.renderable;n!==e._fogRenderable&&(e.resetDrawCommands(),e._fogRenderable=n)}function Zdt(e,t){if(e.enableVerticalExaggeration){let n=t.verticalExaggeration!==1;e.hasVerticalExaggeration!==n&&(e.resetDrawCommands(),e._hasVerticalExaggeration=n)}else e.hasVerticalExaggeration&&(e.resetDrawCommands(),e._hasVerticalExaggeration=!1)}function Qdt(e,t){e._drawCommandsBuilt||(e.destroyPipelineResources(),e._sceneGraph.buildDrawCommands(t),e._drawCommandsBuilt=!0)}function eht(e,t){if(e===t)return!0;if(!l(e)||!l(t))return!1;for(let n=0;n<16;n++)if(e[n]!==t[n])return!1;return!0}function LQ(e,t){if(!l(e)||!l(t))return N.clone(e,t);for(let n=0;n<16;n++)t[n]=e[n];return t}function tht(e,t){eht(e.modelMatrix,e._modelMatrix)||(e._updateModelMatrix=!0,e._modelMatrix=LQ(e.modelMatrix,e._modelMatrix))}var RA=new h,OQ=new he,nht=new he,iht=200,aCe=30;function rht(e){let t=e.heightReference!==We.NONE&&l(e._scene)&&e._scene.frameState.frameNumber-e._lastSurfaceQueryFrame>=aCe;if(!e._updateModelMatrix&&!e._heightDirty&&e._minimumPixelSize===0&&!t)return;if(!e._updateModelMatrix&&!e._heightDirty&&l(e._removeUpdateHeightCallback)&&!t){e._updateModelMatrix=!0;return}let n=e._scene;if(!l(n)||e.heightReference===We.NONE){l(e._removeUpdateHeightCallback)&&(e._removeUpdateHeightCallback(),e._removeUpdateHeightCallback=void 0),e._clampedModelMatrix=void 0;return}let i=n.ellipsoid??ee.default,r=e.modelMatrix;RA.x=r[12],RA.y=r[13],RA.z=r[14];let o=i.cartesianToCartographic(RA,nht);l(e._clampedModelMatrix)||(e._clampedModelMatrix=N.clone(r,new N));let s=n.frameState.frameNumber,a=e.heightReference===We.CLIP_TO_GROUND,c=s-e._lastSurfaceQueryFrame<aCe,u=a&&l(e._lastSurfaceHeight)&&o.height>e._lastSurfaceHeight+iht,f=u&&c,d=a&&c&&e._lastSurfaceQueryMissed;if(!((a&&e._lastSurfaceQueryMissed||u)&&l(e._removeUpdateHeightCallback))){l(e._removeUpdateHeightCallback)&&e._removeUpdateHeightCallback();let y=he.clone(o),A=Aht(e,i,y);e._removeUpdateHeightCallback=n.updateHeight(y,b=>{let x=n.getHeight(y,e.heightReference);l(x)&&(b.height=x,e._lastSurfaceQueryFrame=n.frameState.frameNumber,e._lastSurfaceQueryMissed=!1),e._lastSurfaceHeight=b.height,A(b)},e.heightReference)}let m;f||d?m=e._lastSurfaceHeight:(e._lastSurfaceQueryFrame=s,m=n.getHeight(o,e.heightReference),e._lastSurfaceQueryMissed=!l(m),l(m)?e._lastSurfaceHeight=m:m=e._lastSurfaceHeight),l(m)?(he.clone(o,OQ),OQ.height=m,dCe(e,i,o,OQ)):LQ(r,e._clampedModelMatrix),e._heightDirty=!1,e._updateModelMatrix=!0}function oht(e,t){if(!e._updateModelMatrix&&e._minimumPixelSize===0)return;let n=l(e._clampedModelMatrix)?e._clampedModelMatrix:e.modelMatrix;fCe(e,n),sht(e,n,t)}function fCe(e,t){e._clampedScale=l(e._maximumScale)?Math.min(e._scale,e._maximumScale):e._scale,e._boundingSphere.center=h.multiplyByScalar(e._sceneGraph.boundingSphere.center,e._clampedScale,e._boundingSphere.center),e._boundingSphere.radius=e._initialRadius*e._clampedScale,e._boundingSphere=ue.transform(e._boundingSphere,t,e._boundingSphere)}function sht(e,t,n){let i=e.scale;if(e.minimumPixelSize!==0&&!e._projectTo2D){let r=n.context,o=Math.max(r.drawingBufferWidth,r.drawingBufferHeight);N.getTranslation(t,RA),e._sceneMode!==re.SCENE3D&&dr.computeActualEllipsoidPosition(n,RA,RA);let s=e._boundingSphere.radius,a=mht(RA,s,n),c=1/a;Math.min(c*(2*s),o)<e.minimumPixelSize&&(i=e.minimumPixelSize*a/(2*e._initialRadius))}e._computedScale=l(e.maximumScale)?Math.min(e.maximumScale,i):i}function aht(e){if(!e._idDirty)return;e._idDirty=!1;let t=e._id,n=e._pickIds,i=n.length;for(let r=0;r<i;++r)n[r].object.id=t}var cht=new $(1,0,0,0,0,1,0,-1,0);function lht(e,t){let n=l(e._clampedModelMatrix)?e._clampedModelMatrix:e.modelMatrix,i=e.referenceMatrix??n,r=t.context,o=Mdt,s=Odt;if(s=N.multiply(r.uniformState.view3D,i,s),o=N.getRotation(s,o),o=$.transpose(o,o),e._iblReferenceFrameMatrix=$.multiply(cht,o,e._iblReferenceFrameMatrix),e.isClippingEnabled()){let a=N.multiply(i,e._clippingPlanes.modelMatrix,Ndt);e._clippingPlanesMatrix=N.inverseTranspose(a,e._clippingPlanesMatrix)}}function uht(e,t){let n=e._sceneGraph;if(e._updateModelMatrix||e._minimumPixelSize!==0){let r=l(e._clampedModelMatrix)?e._clampedModelMatrix:e.modelMatrix;n.updateModelMatrix(r,t),e._updateModelMatrix&&(e._clippingPolygonsNeedRebake=!0),e._updateModelMatrix=!1}e._backFaceCullingDirty&&(n.updateBackFaceCulling(e._backFaceCulling),e._backFaceCullingDirty=!1),e._shadowsDirty&&(n.updateShadows(e._shadows),e._shadowsDirty=!1),e._debugShowBoundingVolumeDirty&&(n.updateShowBoundingVolume(e._debugShowBoundingVolume),e._debugShowBoundingVolumeDirty=!1);let i=!1;!l(e.classificationType)&&e._show&&(i=e._userAnimationDirty||e._activeAnimations.update(t)),n.update(t,i),e._userAnimationDirty=!1}function fht(e){if(!e._showCreditsOnScreenDirty)return;e._showCreditsOnScreenDirty=!1,e._credits.length=0;let t=e._showCreditsOnScreen;if(l(e._credit)){let s=It.clone(e._credit);s.showOnScreen=s.showOnScreen||t,e._credits.push(s)}let n=e._resourceCredits,i=n.length;for(let s=0;s<i;s++){let a=It.clone(n[s]);a.showOnScreen=a.showOnScreen||t,e._credits.push(a)}let r=e._gltfCredits,o=r.length;for(let s=0;s<o;s++){let a=It.clone(r[s]);a.showOnScreen=a.showOnScreen||t,e._credits.push(a)}}function dht(e){return e.isClippingPolygonsEnabled()&&e._clippingPolygons.inverse&&(e._clippingPolygonData?.polygonRings.length??0)===0}function hht(e,t){let n=xht(e,t),i=e.isInvisible(),r=e.hasSilhouette(t),o=e._show&&e._computedScale!==0&&n&&(!i||r)&&!dht(e),s=t.passes,a=s.render||s.pick&&e.allowPicking;o&&!e._ignoreCommands&&a&&(Tht(e,t),e._sceneGraph.pushDrawCommands(t))}var MQ=new ue;function mht(e,t,n){return MQ.center=e,MQ.radius=t,n.camera.getPixelSize(MQ,n.context.drawingBufferWidth,n.context.drawingBufferHeight)}var hG=new h,pht=new h,mG=new h,ght=new h,_ht=new N;function yht(e,t,n){let i=e._sceneGraph;if(!l(i)||!l(i._positionMin))return 0;let r=i._positionMin,o=i._positionMax,s=t.geodeticSurfaceNormalCartographic(n,ght),a=N.multiplyTransformation(i._components.transform,i._axisCorrectionMatrix,_ht),c=e.scale,u=e.modelMatrix,f=0;for(let d=0;d<8;d++){let p=h.fromElements(d&1?o.x:r.x,d&2?o.y:r.y,d&4?o.z:r.z,pht);h.multiplyByScalar(p,c,p),N.multiplyByPoint(a,p,mG),N.multiplyByPointAsVector(u,mG,mG);let g=h.dot(mG,s);g<f&&(f=g)}return-f}function dCe(e,t,n,i){if(e.heightReference===We.CLIP_TO_GROUND){let o=i.height+yht(e,t,i);e._heightAboveSurface=Math.max(0,n.height-o),i.height=Math.max(n.height,o)}else qy(e.heightReference)&&(i.height+=n.height);t.cartographicToCartesian(i,hG);let r=e._clampedModelMatrix;LQ(e.modelMatrix,r),r[12]=hG.x,r[13]=hG.y,r[14]=hG.z,e._heightDirty=!0}function Aht(e,t,n){return function(i){dCe(e,t,n,i)}}var bht=new h;function xht(e,t){let n=e.distanceDisplayCondition;if(!l(n))return!0;let i=n.near*n.near,r=n.far*n.far,o;if(t.mode===re.SCENE2D){let a=(t.camera.frustum.right-t.camera.frustum.left)*.5;o=a*a}else{let s=N.getTranslation(e.modelMatrix,bht);dr.computeActualEllipsoidPosition(t,s,s),o=h.distanceSquared(s,t.camera.positionWC)}return o>=i&&o<=r}function Tht(e,t){let n=t.creditDisplay,i=e._credits,r=i.length;for(let o=0;o<r;o++)n.addCreditToNextFrame(i[o])}Cr.prototype.isTranslucent=function(){let e=this.color;return l(e)&&e.alpha>0&&e.alpha<1};Cr.prototype.isInvisible=function(){let e=this.color;return l(e)&&e.alpha===0};function hCe(e){return e.context.stencilBuffer}Cr.prototype.hasSilhouette=function(e){return hCe(e)&&this._silhouetteSize>0&&this._silhouetteColor.alpha>0&&!l(this._classificationType)};Cr.prototype.hasSkipLevelOfDetail=function(e){if(!qo.is3DTiles(this.type))return!1;let t=e.context.stencilBuffer,n=this._content.tileset;return t&&n.isSkippingLevelOfDetail};Cr.prototype.isClippingEnabled=function(){let e=this._clippingPlanes;return l(e)&&e.enabled&&e.length!==0};Cr.prototype.pick=function(e,t,n,i,r){return Nw(this,e,t,n,i,r)};Cr.prototype.isClippingPolygonsEnabled=function(){let e=this._clippingPolygons;return l(e)&&e.enabled&&e.length!==0};Cr.prototype.hasDrapedVectors=function(){return this._vectorData?.show===!0};Cr.prototype.isDestroyed=function(){return!1};Cr.prototype.destroy=function(){let e=this._loader;l(e)&&e.destroy();let t=this._featureTables;if(l(t)){let r=t.length;for(let o=0;o<r;o++)t[o].destroy()}this.destroyPipelineResources(),this.destroyModelResources(),uCe(this),l(this._removeUpdateHeightCallback)&&(this._removeUpdateHeightCallback(),this._removeUpdateHeightCallback=void 0),l(this._terrainProviderChangedCallback)&&(this._terrainProviderChangedCallback(),this._terrainProviderChangedCallback=void 0),this._removeClippingPolygonAdded=this._removeClippingPolygonAdded&&this._removeClippingPolygonAdded(),this._removeClippingPolygonRemoved=this._removeClippingPolygonRemoved&&this._removeClippingPolygonRemoved();let n=this._clippingPlanes;l(n)&&!n.isDestroyed()&&n.owner===this&&n.destroy(),this._clippingPlanes=void 0,l(this._clippingPolygonData)&&Nc.releaseRectangleData(this._clippingPolygonData),this._clippingPolygonData=void 0,this._clippingPolygons=void 0,this._shouldDestroyImageBasedLighting&&!this._imageBasedLighting.isDestroyed()&&this._imageBasedLighting.destroy(),this._imageBasedLighting=void 0;let i=this._environmentMapManager;!i.isDestroyed()&&i.owner===this&&i.destroy(),this._environmentMapManager=void 0,le(this)};Cr.prototype.destroyPipelineResources=function(){let e=this._pipelineResources;for(let t=0;t<e.length;t++)e[t].destroy();this._pipelineResources.length=0,this._pickIds.length=0};Cr.prototype.destroyModelResources=function(){let e=this._modelResources;for(let t=0;t<e.length;t++)e[t].destroy();this._modelResources.length=0};Cr.fromGltfAsync=async function(e){e=e??H.EMPTY_OBJECT;let t=e.url??e.gltf,n={releaseGltfJson:e.releaseGltfJson,asynchronous:e.asynchronous,incrementallyLoadTextures:e.incrementallyLoadTextures,upAxis:e.upAxis,forwardAxis:e.forwardAxis,loadAttributesFor2D:e.projectTo2D,enablePick:e.enablePick,loadIndicesForWireframe:e.enableDebugWireframe,loadPrimitiveOutline:e.enableShowOutline,loadForClassification:l(e.classificationType)},i=e.basePath??"",r=De.createIfNeeded(i);l(t.asset)?(n.gltfJson=t,n.baseResource=r,n.gltfResource=r):t instanceof Uint8Array?(n.typedArray=t,n.baseResource=r,n.gltfResource=r):n.gltfResource=De.createIfNeeded(t);let o=new Gf(n),a=l(e.content)?qo.TILE_GLTF:qo.GLTF,c=n.gltfResource,u=fk(o,a,e);u.resource=c,u.environmentMapOptions=e.environmentMapOptions;try{await o.load()}catch(g){throw o.destroy(),xt.getError("model",c,g)}let f=e.gltfCallback;l(f)&&f(o.gltfJson);let d=new Cr(u),p=d._resource.credits;if(l(p)){let g=p.length;for(let m=0;m<g;m++)d._resourceCredits.push(It.clone(p[m]))}return d};Cr.fromB3dm=async function(e){let t={b3dmResource:e.resource,arrayBuffer:e.arrayBuffer,byteOffset:e.byteOffset,releaseGltfJson:e.releaseGltfJson,asynchronous:e.asynchronous,incrementallyLoadTextures:e.incrementallyLoadTextures,upAxis:e.upAxis,forwardAxis:e.forwardAxis,loadAttributesFor2D:e.projectTo2D,enablePick:e.enablePick,loadIndicesForWireframe:e.enableDebugWireframe,loadPrimitiveOutline:e.enableShowOutline,loadForClassification:l(e.classificationType)},n=new KF(t);try{await n.load();let i=fk(n,qo.TILE_B3DM,e);return new Cr(i)}catch(i){throw n.destroy(),i}};Cr.fromPnts=async function(e){let t={arrayBuffer:e.arrayBuffer,byteOffset:e.byteOffset,loadAttributesFor2D:e.projectTo2D},n=new ak(t);try{await n.load();let i=fk(n,qo.TILE_PNTS,e);return new Cr(i)}catch(i){throw n.destroy(),i}};Cr.fromI3dm=async function(e){let t={i3dmResource:e.resource,arrayBuffer:e.arrayBuffer,byteOffset:e.byteOffset,releaseGltfJson:e.releaseGltfJson,asynchronous:e.asynchronous,incrementallyLoadTextures:e.incrementallyLoadTextures,upAxis:e.upAxis,forwardAxis:e.forwardAxis,loadAttributesFor2D:e.projectTo2D,enablePick:e.enablePick,loadIndicesForWireframe:e.enableDebugWireframe,loadPrimitiveOutline:e.enableShowOutline},n=new ZF(t);try{await n.load();let i=fk(n,qo.TILE_I3DM,e);return new Cr(i)}catch(i){throw n.destroy(),i}};Cr.fromGeoJson=async function(e){let t={geoJson:e.geoJson},n=new $F(t),i=fk(n,qo.TILE_GEOJSON,e);return new Cr(i)};var Eht=new z;Cr.prototype.applyColorAndShow=function(e){let t=z.clone(this._color,Eht),n=l(e)&&l(e.color),i=l(e)&&l(e.show);this._color=n?e.color.evaluateColor(void 0,this._color):z.clone(z.WHITE,this._color),this._show=i?e.show.evaluate(void 0):!0,NQ(t,this._color)&&this.resetDrawCommands()};Cr.prototype.applyStyle=function(e){let t=this.type===qo.TILE_PNTS,n=l(this.featureTableId)&&this.featureTables[this.featureTableId].featuresLength>0,i=l(this.structuralMetadata)?this.structuralMetadata.propertyAttributes:void 0,r=l(i)&&l(i[0]);if(t&&(!n||r)){this.resetDrawCommands();return}n?(this.featureTables[this.featureTableId].applyStyle(e),cCe(this,e)):(this.applyColorAndShow(e),this._styleCommandsNeeded=void 0)};function fk(e,t,n){return{loader:e,type:t,resource:n.resource,show:n.show,modelMatrix:n.modelMatrix,scale:n.scale,enableVerticalExaggeration:n.enableVerticalExaggeration,minimumPixelSize:n.minimumPixelSize,maximumScale:n.maximumScale,id:n.id,allowPicking:n.allowPicking,clampAnimations:n.clampAnimations,shadows:n.shadows,debugShowBoundingVolume:n.debugShowBoundingVolume,enableDebugWireframe:n.enableDebugWireframe,debugWireframe:n.debugWireframe,cull:n.cull,opaquePass:n.opaquePass,customShader:n.customShader,content:n.content,heightReference:n.heightReference,scene:n.scene,distanceDisplayCondition:n.distanceDisplayCondition,color:n.color,colorBlendAmount:n.colorBlendAmount,colorBlendMode:n.colorBlendMode,edgeDisplayMode:n.edgeDisplayMode,silhouetteColor:n.silhouetteColor,silhouetteSize:n.silhouetteSize,enableShowOutline:n.enableShowOutline,showOutline:n.showOutline,outlineColor:n.outlineColor,clippingPlanes:n.clippingPlanes,clippingPolygons:n.clippingPolygons,lightColor:n.lightColor,imageBasedLighting:n.imageBasedLighting,backFaceCulling:n.backFaceCulling,credit:n.credit,showCreditsOnScreen:n.showCreditsOnScreen,splitDirection:n.splitDirection,projectTo2D:n.projectTo2D,enablePick:n.enablePick,featureIdLabel:n.featureIdLabel,instanceFeatureIdLabel:n.instanceFeatureIdLabel,pointCloudShading:n.pointCloudShading,classificationType:n.classificationType,pickObject:n.pickObject}}var $f=Cr;var Cht=1,vht=!0,Sht=0,wht=!0,Iht=!0,Pht=Pn.ENABLED,Dht=We.NONE,Rht=z.RED,Oht=0,Mht=z.WHITE,Nht=sl.HIGHLIGHT,Lht=.5,Fht=new U(1,1),mCe={maximumPositionEpsilon:Number.POSITIVE_INFINITY},Bht=new N,kht=new N,pCe=new z,gCe=new Array(4),Uht=new h;function OA(e,t){t.collectionChanged.addEventListener(OA.prototype._onCollectionChanged,this),this._scene=e,this._primitives=e.primitives,this._entityCollection=t,this._modelHash={},this._entitiesToVisualize=new Ut,this._onCollectionChanged(t,t.values,[],[])}function zht(e,t){return e instanceof ui?e.valueOf():X.getValueOrUndefined(e,t)}function Vht(e,t){return t!==e.uri?!1:t instanceof De?t._url===e.uriUrl&&t._queryParameters===e.uriQueryParameters&&t._templateValues===e.uriTemplateValues:!0}function _Ce(e,t){e.uri=t,t instanceof De&&(e.uriUrl=t._url,e.uriQueryParameters=t._queryParameters,e.uriTemplateValues=t._templateValues)}function jht(e,t){if(!l(t))return N.clone(e);for(let n=0;n<16;n++)t[n]=e[n];return t}async function Hht(e,t,n,i,r){let o=e._primitives,s=e._modelHash;try{let a=await $f.fromGltfAsync({url:n,incrementallyLoadTextures:i,scene:e._scene,environmentMapOptions:r});if(e.isDestroyed()||!l(s[t.id]))return;a.id=t,o.add(a),s[t.id].modelPrimitive=a,a.errorEvent.addEventListener(c=>{l(s[t.id])&&(console.log(c),c.name!=="TextureError"&&a.incrementallyLoadTextures&&(s[t.id].loadFailed=!0))})}catch(a){if(e.isDestroyed()||!l(s[t.id]))return;console.log(a),s[t.id].loadFailed=!0}}OA.prototype.update=function(e){let t=this._entitiesToVisualize.values,n=this._modelHash,i=this._primitives;for(let r=0,o=t.length;r<o;r++){let s=t[r],a=s._model,c,u=n[s.id],f=s.isShowing&&s.isAvailable(e)&&X.getValueOrDefault(a._show,e,!0),d,p;if(f&&(d=s.computeModelMatrix(e,Bht),p=zht(a._uri,e),f=l(d)&&l(p)),!f){l(u)&&u.modelPrimitive&&(u.modelPrimitive.show=!1);continue}if((!l(u)||!Vht(u,p))&&(c=De.createIfNeeded(p),l(u)&&c.url===u.url&&(_Ce(u,p),c=void 0)),l(c)){l(u?.modelPrimitive)&&(i.removeAndDestroy(u.modelPrimitive),delete n[s.id]),u={modelPrimitive:void 0,url:c.url,uri:void 0,uriUrl:void 0,uriQueryParameters:void 0,uriTemplateValues:void 0,animationsRunning:!1,nodeTransformationsScratch:{},articulationsScratch:{},loadFailed:!1,modelUpdated:!1,environmentMapOptionsScratch:{...mCe}},n[s.id]=u,_Ce(u,p);let y=X.getValueOrDefault(a._incrementallyLoadTextures,e,wht),A=X.getValueOrDefault(a._environmentMapOptions,e,mCe,u.environmentMapOptionsScratch);Hht(this,s,c,y,A)}let g=u.modelPrimitive;if(!l(g))continue;g.show=!0,g.scale=X.getValueOrDefault(a._scale,e,Cht),g.enableVerticalExaggeration=X.getValueOrDefault(a._enableVerticalExaggeration,e,vht),g.minimumPixelSize=X.getValueOrDefault(a._minimumPixelSize,e,Sht),g.maximumScale=X.getValueOrUndefined(a._maximumScale,e),g.modelMatrix=jht(d,g.modelMatrix),g.shadows=X.getValueOrDefault(a._shadows,e,Pht),g.heightReference=X.getValueOrDefault(a._heightReference,e,Dht),g.distanceDisplayCondition=X.getValueOrUndefined(a._distanceDisplayCondition,e),g.silhouetteColor=X.getValueOrDefault(a._silhouetteColor,e,Rht,pCe),g.silhouetteSize=X.getValueOrDefault(a._silhouetteSize,e,Oht),g.color=X.getValueOrDefault(a._color,e,Mht,pCe),g.colorBlendMode=X.getValueOrDefault(a._colorBlendMode,e,Nht),g.colorBlendAmount=X.getValueOrDefault(a._colorBlendAmount,e,Lht),g.clippingPlanes=X.getValueOrUndefined(a._clippingPlanes,e),g.clampAnimations=X.getValueOrDefault(a._clampAnimations,e,Iht),g.imageBasedLighting.imageBasedLightingFactor=X.getValueOrDefault(a._imageBasedLightingFactor,e,Fht);let m=X.getValueOrUndefined(a._lightColor,e);if(l(m)&&(z.pack(m,gCe,0),m=h.unpack(gCe,0,Uht)),g.lightColor=m,g.customShader=X.getValueOrUndefined(a._customShader,e),n[s.id].modelUpdated=!0,g.ready){let y=X.getValueOrDefault(a._runAnimations,e,!0);u.animationsRunning!==y&&(y?g.activeAnimations.addAll({loop:Yu.REPEAT}):g.activeAnimations.removeAll(),u.animationsRunning=y);let A=X.getValueOrUndefined(a._nodeTransformations,e,u.nodeTransformationsScratch);if(l(A)){let T=Object.keys(A);for(let E=0,v=T.length;E<v;++E){let S=T[E],I=A[S];if(!l(I))continue;let R=g.getNode(S);if(!l(R))continue;let O=N.fromTranslationRotationScale(I,kht);R.matrix=N.multiply(R.originalMatrix,O,O)}}let b=!1,x=X.getValueOrUndefined(a._articulations,e,u.articulationsScratch);if(l(x)){let T=Object.keys(x);for(let E=0,v=T.length;E<v;++E){let S=T[E],I=x[S];l(I)&&(b=!0,g.setArticulationStage(S,I))}}b&&g.applyArticulations()}}return!0};OA.prototype.isDestroyed=function(){return!1};OA.prototype.destroy=function(){this._entityCollection.collectionChanged.removeEventListener(OA.prototype._onCollectionChanged,this);let e=this._entitiesToVisualize.values,t=this._modelHash,n=this._primitives;for(let i=e.length-1;i>-1;i--)FQ(this,e[i],t,n);return le(this)};var dk=new h,Ght=new he;OA.prototype.getBoundingSphere=function(e,t){let n=this._modelHash[e.id];if(!l(n))return Pt.FAILED;if(n.loadFailed)return Pt.FAILED;let i=n.modelPrimitive;if(!l(i)||!i.show)return Pt.PENDING;if(!i.ready||!n.modelUpdated)return Pt.PENDING;let r=this._scene,o=r.ellipsoid??ee.default;if(i.heightReference!==We.NONE){let a=i.modelMatrix;dk.x=a[12],dk.y=a[13],dk.z=a[14];let c=o.cartesianToCartographic(dk,Ght),u=r.getHeight(c,i.heightReference);if(l(u)||(u=i._lastSurfaceHeight),!l(u)){let f=this._modelHash,d=Jh(r,n,dk,[i],()=>f[e.id]===n);if(d===void 0)return Pt.PENDING;d!==null&&(u=d)}return l(u)&&(i.heightReference===We.CLIP_TO_GROUND?c.height<u&&(c.height=u):bs(i.heightReference)?c.height=u:c.height+=u),ue.clone(i.boundingSphere,t),t.center=o.cartographicToCartesian(c),Pt.DONE}return ue.clone(i.boundingSphere,t),Pt.DONE};OA.prototype._onCollectionChanged=function(e,t,n,i){let r,o,s=this._entitiesToVisualize,a=this._modelHash,c=this._primitives;for(r=t.length-1;r>-1;r--)o=t[r],l(o._model)&&l(o._position)&&s.set(o.id,o);for(r=i.length-1;r>-1;r--)o=i[r],l(o._model)&&l(o._position)?(Wht(o,a),s.set(o.id,o)):(FQ(this,o,a,c),s.remove(o.id));for(r=n.length-1;r>-1;r--)o=n[r],FQ(this,o,a,c),s.remove(o.id)};function FQ(e,t,n,i){let r=n[t.id];l(r)&&(i.removeAndDestroy(r.modelPrimitive),delete n[t.id])}function Wht(e,t){let n=t[e.id];l(n)&&(n.nodeTransformationsScratch={},n.articulationsScratch={})}var hk=OA;function s0(e){e=e??0,this._array=new Array(e),this._length=e}Object.defineProperties(s0.prototype,{length:{get:function(){return this._length},set:function(e){let t=this._array,n=this._length;if(e<n)for(let i=e;i<n;++i)t[i]=void 0;else e>t.length&&(t.length=e);this._length=e}},values:{get:function(){return this._array}}});s0.prototype.get=function(e){return this._array[e]};s0.prototype.set=function(e,t){e>=this._length&&(this.length=e+1),this._array[e]=t};s0.prototype.peek=function(){return this._array[this._length-1]};s0.prototype.push=function(e){let t=this.length++;this._array[t]=e};s0.prototype.pop=function(){if(this._length===0)return;let e=this._array[this._length-1];return--this.length,e};s0.prototype.reserve=function(e){e>this._array.length&&(this._array.length=e)};s0.prototype.resize=function(e){this.length=e};s0.prototype.trim=function(e){e=e??this._length,this._array.length=e};var fu=s0;function yCe(e){e=e??H.EMPTY_OBJECT,this._metadata=e.metadata}Object.defineProperties(yCe.prototype,{metadata:{get:function(){return this._metadata}}});var YT=yCe;var BQ=class e{constructor(t,n,i,r){this._tileset=t,this._tile=n,this._resource=i,l(r)||(r=[]),this._contents=r,this._metadata=void 0,this._group=void 0,this._ready=!1}get featurePropertiesDirty(){let t=this._contents,n=t.length;for(let i=0;i<n;++i)if(t[i].featurePropertiesDirty)return!0;return!1}set featurePropertiesDirty(t){let n=this._contents,i=n.length;for(let r=0;r<i;++r)n[r].featurePropertiesDirty=t}get featuresLength(){return 0}get pointsLength(){return 0}get trianglesLength(){return 0}get geometryByteLength(){return 0}get texturesByteLength(){return 0}get batchTableByteLength(){return 0}get innerContents(){return this._contents}get ready(){return this._ready}get tileset(){return this._tileset}get tile(){return this._tile}get url(){return this._resource.getUrlComponent(!0)}get metadata(){return this._metadata}set metadata(t){this._metadata=t;let n=this._contents,i=n.length;for(let r=0;r<i;++r)n[r].metadata=t}get batchTable(){}get group(){return this._group}set group(t){this._group=t;let n=this._contents,i=n.length;for(let r=0;r<i;++r)n[r].group=t}static async fromTileType(t,n,i,r,o,s){o=o??0;let a=new Uint8Array(r),c=new DataView(r);o+=mk;let u=c.getUint32(o,!0);if(u!==1)throw new oe(`Only Composite Tile version 1 is supported. Version ${u} is not.`);o+=mk,o+=mk;let f=c.getUint32(o,!0);o+=mk;let d=i.queryParameters.compositeIndex;l(d)?d=`${d}_`:d="";let p=[];p.length=f;for(let y=0;y<f;++y){let A=bm(a,o),b=c.getUint32(o+mk*2,!0),x=s[A],T=`${d}${y}`,E=i.getDerivedResource({queryParameters:{compositeIndex:T}});if(l(x))p[y]=Promise.resolve(x(t,n,E,r,o));else throw new oe(`Unknown tile content type, ${A}, inside Composite tile`);o+=b}let g=await Promise.all(p);return new e(t,n,i,g)}hasProperty(t,n){return!1}getFeature(t){}applyDebugSettings(t,n){let i=this._contents,r=i.length;for(let o=0;o<r;++o)i[o].applyDebugSettings(t,n)}applyStyle(t){let n=this._contents,i=n.length;for(let r=0;r<i;++r)n[r].applyStyle(t)}update(t,n){let i=this._contents,r=i.length,o=!0;for(let s=0;s<r;++s)i[s].update(t,n),o=o&&i[s].ready;!this._ready&&o&&(this._ready=!0)}pick(t,n,i){if(!this._ready)return;let r,o=Number.POSITIVE_INFINITY,s=this._contents,a=s.length;for(let c=0;c<a;++c){let u=s[c].pick(t,n,i);if(!l(u))continue;let f=h.distance(t.origin,u);f<o&&(r=u,o=f)}if(l(r))return i}isDestroyed(){return!1}destroy(){let t=this._contents,n=t.length;for(let i=0;i<n;++i)t[i].destroy();return le(this)}},mk=Uint32Array.BYTES_PER_ELEMENT,pk=BQ;function qht(e){this.offset=e.offset,this.count=e.count,this.color=e.color,this.batchIds=e.batchIds}var a0=qht;var kQ=class{add(t,n,i){if(typeof arguments[0]!="string")for(let r in arguments[0])this.add(r,arguments[0][r],arguments[1]);else(Array.isArray(t)?t:[t]).forEach(function(r){this[r]=this[r]||[],n&&this[r][i?"unshift":"push"](n)},this)}run(t,n){this[t]=this[t]||[],this[t].forEach(function(i){i.call(n&&n.context?n.context:n,n)})}},UQ=class{constructor(t){this.jsep=t,this.registered={}}register(...t){t.forEach(n=>{if(typeof n!="object"||!n.name||!n.init)throw new Error("Invalid JSEP plugin format");this.registered[n.name]||(n.init(this.jsep),this.registered[n.name]=n)})}},Zu=class e{static get version(){return"1.4.0"}static toString(){return"JavaScript Expression Parser (JSEP) v"+e.version}static addUnaryOp(t){return e.max_unop_len=Math.max(t.length,e.max_unop_len),e.unary_ops[t]=1,e}static addBinaryOp(t,n,i){return e.max_binop_len=Math.max(t.length,e.max_binop_len),e.binary_ops[t]=n,i?e.right_associative.add(t):e.right_associative.delete(t),e}static addIdentifierChar(t){return e.additional_identifier_chars.add(t),e}static addLiteral(t,n){return e.literals[t]=n,e}static removeUnaryOp(t){return delete e.unary_ops[t],t.length===e.max_unop_len&&(e.max_unop_len=e.getMaxKeyLen(e.unary_ops)),e}static removeAllUnaryOps(){return e.unary_ops={},e.max_unop_len=0,e}static removeIdentifierChar(t){return e.additional_identifier_chars.delete(t),e}static removeBinaryOp(t){return delete e.binary_ops[t],t.length===e.max_binop_len&&(e.max_binop_len=e.getMaxKeyLen(e.binary_ops)),e.right_associative.delete(t),e}static removeAllBinaryOps(){return e.binary_ops={},e.max_binop_len=0,e}static removeLiteral(t){return delete e.literals[t],e}static removeAllLiterals(){return e.literals={},e}get char(){return this.expr.charAt(this.index)}get code(){return this.expr.charCodeAt(this.index)}constructor(t){this.expr=t,this.index=0}static parse(t){return new e(t).parse()}static getMaxKeyLen(t){return Math.max(0,...Object.keys(t).map(n=>n.length))}static isDecimalDigit(t){return t>=48&&t<=57}static binaryPrecedence(t){return e.binary_ops[t]||0}static isIdentifierStart(t){return t>=65&&t<=90||t>=97&&t<=122||t>=128&&!e.binary_ops[String.fromCharCode(t)]||e.additional_identifier_chars.has(String.fromCharCode(t))}static isIdentifierPart(t){return e.isIdentifierStart(t)||e.isDecimalDigit(t)}throwError(t){let n=new Error(t+" at character "+this.index);throw n.index=this.index,n.description=t,n}runHook(t,n){if(e.hooks[t]){let i={context:this,node:n};return e.hooks.run(t,i),i.node}return n}searchHook(t){if(e.hooks[t]){let n={context:this};return e.hooks[t].find(function(i){return i.call(n.context,n),n.node}),n.node}}gobbleSpaces(){let t=this.code;for(;t===e.SPACE_CODE||t===e.TAB_CODE||t===e.LF_CODE||t===e.CR_CODE;)t=this.expr.charCodeAt(++this.index);this.runHook("gobble-spaces")}parse(){this.runHook("before-all");let t=this.gobbleExpressions(),n=t.length===1?t[0]:{type:e.COMPOUND,body:t};return this.runHook("after-all",n)}gobbleExpressions(t){let n=[],i,r;for(;this.index<this.expr.length;)if(i=this.code,i===e.SEMCOL_CODE||i===e.COMMA_CODE)this.index++;else if(r=this.gobbleExpression())n.push(r);else if(this.index<this.expr.length){if(i===t)break;this.throwError('Unexpected "'+this.char+'"')}return n}gobbleExpression(){let t=this.searchHook("gobble-expression")||this.gobbleBinaryExpression();return this.gobbleSpaces(),this.runHook("after-expression",t)}gobbleBinaryOp(){this.gobbleSpaces();let t=this.expr.substr(this.index,e.max_binop_len),n=t.length;for(;n>0;){if(e.binary_ops.hasOwnProperty(t)&&(!e.isIdentifierStart(this.code)||this.index+t.length<this.expr.length&&!e.isIdentifierPart(this.expr.charCodeAt(this.index+t.length))))return this.index+=n,t;t=t.substr(0,--n)}return!1}gobbleBinaryExpression(){let t,n,i,r,o,s,a,c,u;if(s=this.gobbleToken(),!s||(n=this.gobbleBinaryOp(),!n))return s;for(o={value:n,prec:e.binaryPrecedence(n),right_a:e.right_associative.has(n)},a=this.gobbleToken(),a||this.throwError("Expected expression after "+n),r=[s,o,a];n=this.gobbleBinaryOp();){if(i=e.binaryPrecedence(n),i===0){this.index-=n.length;break}o={value:n,prec:i,right_a:e.right_associative.has(n)},u=n;let f=d=>o.right_a&&d.right_a?i>d.prec:i<=d.prec;for(;r.length>2&&f(r[r.length-2]);)a=r.pop(),n=r.pop().value,s=r.pop(),t={type:e.BINARY_EXP,operator:n,left:s,right:a},r.push(t);t=this.gobbleToken(),t||this.throwError("Expected expression after "+u),r.push(o,t)}for(c=r.length-1,t=r[c];c>1;)t={type:e.BINARY_EXP,operator:r[c-1].value,left:r[c-2],right:t},c-=2;return t}gobbleToken(){let t,n,i,r;if(this.gobbleSpaces(),r=this.searchHook("gobble-token"),r)return this.runHook("after-token",r);if(t=this.code,e.isDecimalDigit(t)||t===e.PERIOD_CODE)return this.gobbleNumericLiteral();if(t===e.SQUOTE_CODE||t===e.DQUOTE_CODE)r=this.gobbleStringLiteral();else if(t===e.OBRACK_CODE)r=this.gobbleArray();else{for(n=this.expr.substr(this.index,e.max_unop_len),i=n.length;i>0;){if(e.unary_ops.hasOwnProperty(n)&&(!e.isIdentifierStart(this.code)||this.index+n.length<this.expr.length&&!e.isIdentifierPart(this.expr.charCodeAt(this.index+n.length)))){this.index+=i;let o=this.gobbleToken();return o||this.throwError("missing unaryOp argument"),this.runHook("after-token",{type:e.UNARY_EXP,operator:n,argument:o,prefix:!0})}n=n.substr(0,--i)}e.isIdentifierStart(t)?(r=this.gobbleIdentifier(),e.literals.hasOwnProperty(r.name)?r={type:e.LITERAL,value:e.literals[r.name],raw:r.name}:r.name===e.this_str&&(r={type:e.THIS_EXP})):t===e.OPAREN_CODE&&(r=this.gobbleGroup())}return r?(r=this.gobbleTokenProperty(r),this.runHook("after-token",r)):this.runHook("after-token",!1)}gobbleTokenProperty(t){this.gobbleSpaces();let n=this.code;for(;n===e.PERIOD_CODE||n===e.OBRACK_CODE||n===e.OPAREN_CODE||n===e.QUMARK_CODE;){let i;if(n===e.QUMARK_CODE){if(this.expr.charCodeAt(this.index+1)!==e.PERIOD_CODE)break;i=!0,this.index+=2,this.gobbleSpaces(),n=this.code}this.index++,n===e.OBRACK_CODE?(t={type:e.MEMBER_EXP,computed:!0,object:t,property:this.gobbleExpression()},t.property||this.throwError('Unexpected "'+this.char+'"'),this.gobbleSpaces(),n=this.code,n!==e.CBRACK_CODE&&this.throwError("Unclosed ["),this.index++):n===e.OPAREN_CODE?t={type:e.CALL_EXP,arguments:this.gobbleArguments(e.CPAREN_CODE),callee:t}:(n===e.PERIOD_CODE||i)&&(i&&this.index--,this.gobbleSpaces(),t={type:e.MEMBER_EXP,computed:!1,object:t,property:this.gobbleIdentifier()}),i&&(t.optional=!0),this.gobbleSpaces(),n=this.code}return t}gobbleNumericLiteral(){let t="",n,i;for(;e.isDecimalDigit(this.code);)t+=this.expr.charAt(this.index++);if(this.code===e.PERIOD_CODE)for(t+=this.expr.charAt(this.index++);e.isDecimalDigit(this.code);)t+=this.expr.charAt(this.index++);if(n=this.char,n==="e"||n==="E"){for(t+=this.expr.charAt(this.index++),n=this.char,(n==="+"||n==="-")&&(t+=this.expr.charAt(this.index++));e.isDecimalDigit(this.code);)t+=this.expr.charAt(this.index++);e.isDecimalDigit(this.expr.charCodeAt(this.index-1))||this.throwError("Expected exponent ("+t+this.char+")")}return i=this.code,e.isIdentifierStart(i)?this.throwError("Variable names cannot start with a number ("+t+this.char+")"):(i===e.PERIOD_CODE||t.length===1&&t.charCodeAt(0)===e.PERIOD_CODE)&&this.throwError("Unexpected period"),{type:e.LITERAL,value:parseFloat(t),raw:t}}gobbleStringLiteral(){let t="",n=this.index,i=this.expr.charAt(this.index++),r=!1;for(;this.index<this.expr.length;){let o=this.expr.charAt(this.index++);if(o===i){r=!0;break}else if(o==="\\")switch(o=this.expr.charAt(this.index++),o){case"n":t+=` +`;break;case"r":t+="\r";break;case"t":t+=" ";break;case"b":t+="\b";break;case"f":t+="\f";break;case"v":t+="\v";break;default:t+=o}else t+=o}return r||this.throwError('Unclosed quote after "'+t+'"'),{type:e.LITERAL,value:t,raw:this.expr.substring(n,this.index)}}gobbleIdentifier(){let t=this.code,n=this.index;for(e.isIdentifierStart(t)?this.index++:this.throwError("Unexpected "+this.char);this.index<this.expr.length&&(t=this.code,e.isIdentifierPart(t));)this.index++;return{type:e.IDENTIFIER,name:this.expr.slice(n,this.index)}}gobbleArguments(t){let n=[],i=!1,r=0;for(;this.index<this.expr.length;){this.gobbleSpaces();let o=this.code;if(o===t){i=!0,this.index++,t===e.CPAREN_CODE&&r&&r>=n.length&&this.throwError("Unexpected token "+String.fromCharCode(t));break}else if(o===e.COMMA_CODE){if(this.index++,r++,r!==n.length){if(t===e.CPAREN_CODE)this.throwError("Unexpected token ,");else if(t===e.CBRACK_CODE)for(let s=n.length;s<r;s++)n.push(null)}}else if(n.length!==r&&r!==0)this.throwError("Expected comma");else{let s=this.gobbleExpression();(!s||s.type===e.COMPOUND)&&this.throwError("Expected comma"),n.push(s)}}return i||this.throwError("Expected "+String.fromCharCode(t)),n}gobbleGroup(){this.index++;let t=this.gobbleExpressions(e.CPAREN_CODE);if(this.code===e.CPAREN_CODE)return this.index++,t.length===1?t[0]:t.length?{type:e.SEQUENCE_EXP,expressions:t}:!1;this.throwError("Unclosed (")}gobbleArray(){return this.index++,{type:e.ARRAY_EXP,elements:this.gobbleArguments(e.CBRACK_CODE)}}},Yht=new kQ;Object.assign(Zu,{hooks:Yht,plugins:new UQ(Zu),COMPOUND:"Compound",SEQUENCE_EXP:"SequenceExpression",IDENTIFIER:"Identifier",MEMBER_EXP:"MemberExpression",LITERAL:"Literal",THIS_EXP:"ThisExpression",CALL_EXP:"CallExpression",UNARY_EXP:"UnaryExpression",BINARY_EXP:"BinaryExpression",ARRAY_EXP:"ArrayExpression",TAB_CODE:9,LF_CODE:10,CR_CODE:13,SPACE_CODE:32,PERIOD_CODE:46,COMMA_CODE:44,SQUOTE_CODE:39,DQUOTE_CODE:34,OPAREN_CODE:40,CPAREN_CODE:41,OBRACK_CODE:91,CBRACK_CODE:93,QUMARK_CODE:63,SEMCOL_CODE:59,COLON_CODE:58,unary_ops:{"-":1,"!":1,"~":1,"+":1},binary_ops:{"||":1,"??":1,"&&":2,"|":3,"^":4,"&":5,"==":6,"!=":6,"===":6,"!==":6,"<":7,">":7,"<=":7,">=":7,"<<":8,">>":8,">>>":8,"+":9,"-":9,"*":10,"/":10,"%":10,"**":11},right_associative:new Set(["**"]),additional_identifier_chars:new Set(["$","_"]),literals:{true:!0,false:!1,null:null},this_str:"this"});Zu.max_unop_len=Zu.getMaxKeyLen(Zu.unary_ops);Zu.max_binop_len=Zu.getMaxKeyLen(Zu.binary_ops);var MA=e=>new Zu(e).parse(),Xht=Object.getOwnPropertyNames(class{});Object.getOwnPropertyNames(Zu).filter(e=>!Xht.includes(e)&&MA[e]===void 0).forEach(e=>{MA[e]=Zu[e]});MA.Jsep=Zu;var Kht="ConditionalExpression",$ht={name:"ternary",init(e){e.hooks.add("after-expression",function(n){if(n.node&&this.code===e.QUMARK_CODE){this.index++;let i=n.node,r=this.gobbleExpression();if(r||this.throwError("Expected expression"),this.gobbleSpaces(),this.code===e.COLON_CODE){this.index++;let o=this.gobbleExpression();if(o||this.throwError("Expected expression"),n.node={type:Kht,test:i,consequent:r,alternate:o},i.operator&&e.binary_ops[i.operator]<=.9){let s=i;for(;s.right.operator&&e.binary_ops[s.right.operator]<=.9;)s=s.right;n.node.test=s.right,s.right=n.node,n.node=i}}else this.throwError("Expected :")}})}};MA.plugins.register($ht);var ACe={VARIABLE:0,UNARY:1,BINARY:2,TERNARY:3,CONDITIONAL:4,MEMBER:5,FUNCTION_CALL:6,ARRAY:7,REGEX:8,VARIABLE_IN_STRING:9,LITERAL_NULL:10,LITERAL_BOOLEAN:11,LITERAL_NUMBER:12,LITERAL_STRING:13,LITERAL_COLOR:14,LITERAL_VECTOR:15,LITERAL_REGEX:16,LITERAL_UNDEFINED:17,BUILTIN_VARIABLE:18};Object.freeze(ACe);var Mt=ACe;function Om(e,t){this._expression=e,e=lmt(e,t),e=fmt(umt(e)),MA.addBinaryOp("=~",0),MA.addBinaryOp("!~",0);let n;try{n=MA(e)}catch(i){throw new oe(i)}this._runtimeAst=Ki(this,n)}Object.defineProperties(Om.prototype,{expression:{get:function(){return this._expression}}});var Un={arrayIndex:0,arrayArray:[[]],cartesian2Index:0,cartesian3Index:0,cartesian4Index:0,cartesian2Array:[new U],cartesian3Array:[new h],cartesian4Array:[new se],reset:function(){this.arrayIndex=0,this.cartesian2Index=0,this.cartesian3Index=0,this.cartesian4Index=0},getArray:function(){this.arrayIndex>=this.arrayArray.length&&this.arrayArray.push([]);let e=this.arrayArray[this.arrayIndex++];return e.length=0,e},getCartesian2:function(){return this.cartesian2Index>=this.cartesian2Array.length&&this.cartesian2Array.push(new U),this.cartesian2Array[this.cartesian2Index++]},getCartesian3:function(){return this.cartesian3Index>=this.cartesian3Array.length&&this.cartesian3Array.push(new h),this.cartesian3Array[this.cartesian3Index++]},getCartesian4:function(){return this.cartesian4Index>=this.cartesian4Array.length&&this.cartesian4Array.push(new se),this.cartesian4Array[this.cartesian4Index++]}};Om.prototype.evaluate=function(e,t){Un.reset();let n=this._runtimeAst.evaluate(e);return t instanceof z&&n instanceof se?z.fromCartesian4(n,t):n instanceof U||n instanceof h||n instanceof se?n.clone(t):n};Om.prototype.evaluateColor=function(e,t){Un.reset();let n=this._runtimeAst.evaluate(e);return z.fromCartesian4(n,t)};Om.prototype.getShaderFunction=function(e,t,n,i){let r=this.getShaderExpression(t,n);return r=`${i} ${e} +{ + return ${r}; +} +`,r};Om.prototype.getShaderExpression=function(e,t){return this._runtimeAst.getShaderExpression(e,t)};Om.prototype.getVariables=function(){let e=[];return this._runtimeAst.getVariables(e),e=e.filter(function(t,n,i){return i.indexOf(t)===n}),e};var Jht=["!","-","+"],bCe=["+","-","*","/","%","===","!==",">",">=","<","<=","&&","||","!~","=~"],gk=/\${(.*?)}/g,Zht=/\\/g,Qht="@#%",emt=/@#%/g,_G=new z,yG={abs:qa(Math.abs),sqrt:qa(Math.sqrt),cos:qa(Math.cos),sin:qa(Math.sin),tan:qa(Math.tan),acos:qa(Math.acos),asin:qa(Math.asin),atan:qa(Math.atan),radians:qa(D.toRadians),degrees:qa(D.toDegrees),sign:qa(D.sign),floor:qa(Math.floor),ceil:qa(Math.ceil),round:qa(Math.round),exp:qa(Math.exp),exp2:qa(nmt),log:qa(Math.log),log2:qa(imt),fract:qa(tmt),length:rmt,normalize:omt},AG={atan2:pG(Math.atan2,!1),pow:pG(Math.pow,!1),min:pG(Math.min,!0),max:pG(Math.max,!0),distance:smt,dot:amt,cross:cmt},jQ={clamp:xCe(D.clamp,!0),mix:xCe(D.lerp,!0)};function tmt(e){return e-Math.floor(e)}function nmt(e){return Math.pow(2,e)}function imt(e){return D.log2(e)}function qa(e){return function(t,n){if(typeof n=="number")return e(n);if(n instanceof U)return U.fromElements(e(n.x),e(n.y),Un.getCartesian2());if(n instanceof h)return h.fromElements(e(n.x),e(n.y),e(n.z),Un.getCartesian3());if(n instanceof se)return se.fromElements(e(n.x),e(n.y),e(n.z),e(n.w),Un.getCartesian4());throw new oe(`Function "${t}" requires a vector or number argument. Argument is ${n}.`)}}function pG(e,t){return function(n,i,r){if(t&&typeof r=="number"){if(typeof i=="number")return e(i,r);if(i instanceof U)return U.fromElements(e(i.x,r),e(i.y,r),Un.getCartesian2());if(i instanceof h)return h.fromElements(e(i.x,r),e(i.y,r),e(i.z,r),Un.getCartesian3());if(i instanceof se)return se.fromElements(e(i.x,r),e(i.y,r),e(i.z,r),e(i.w,r),Un.getCartesian4())}if(typeof i=="number"&&typeof r=="number")return e(i,r);if(i instanceof U&&r instanceof U)return U.fromElements(e(i.x,r.x),e(i.y,r.y),Un.getCartesian2());if(i instanceof h&&r instanceof h)return h.fromElements(e(i.x,r.x),e(i.y,r.y),e(i.z,r.z),Un.getCartesian3());if(i instanceof se&&r instanceof se)return se.fromElements(e(i.x,r.x),e(i.y,r.y),e(i.z,r.z),e(i.w,r.w),Un.getCartesian4());throw new oe(`Function "${n}" requires vector or number arguments of matching types. Arguments are ${i} and ${r}.`)}}function xCe(e,t){return function(n,i,r,o){if(t&&typeof o=="number"){if(typeof i=="number"&&typeof r=="number")return e(i,r,o);if(i instanceof U&&r instanceof U)return U.fromElements(e(i.x,r.x,o),e(i.y,r.y,o),Un.getCartesian2());if(i instanceof h&&r instanceof h)return h.fromElements(e(i.x,r.x,o),e(i.y,r.y,o),e(i.z,r.z,o),Un.getCartesian3());if(i instanceof se&&r instanceof se)return se.fromElements(e(i.x,r.x,o),e(i.y,r.y,o),e(i.z,r.z,o),e(i.w,r.w,o),Un.getCartesian4())}if(typeof i=="number"&&typeof r=="number"&&typeof o=="number")return e(i,r,o);if(i instanceof U&&r instanceof U&&o instanceof U)return U.fromElements(e(i.x,r.x,o.x),e(i.y,r.y,o.y),Un.getCartesian2());if(i instanceof h&&r instanceof h&&o instanceof h)return h.fromElements(e(i.x,r.x,o.x),e(i.y,r.y,o.y),e(i.z,r.z,o.z),Un.getCartesian3());if(i instanceof se&&r instanceof se&&o instanceof se)return se.fromElements(e(i.x,r.x,o.x),e(i.y,r.y,o.y),e(i.z,r.z,o.z),e(i.w,r.w,o.w),Un.getCartesian4());throw new oe(`Function "${n}" requires vector or number arguments of matching types. Arguments are ${i}, ${r}, and ${o}.`)}}function rmt(e,t){if(typeof t=="number")return Math.abs(t);if(t instanceof U)return U.magnitude(t);if(t instanceof h)return h.magnitude(t);if(t instanceof se)return se.magnitude(t);throw new oe(`Function "${e}" requires a vector or number argument. Argument is ${t}.`)}function omt(e,t){if(typeof t=="number")return 1;if(t instanceof U)return U.normalize(t,Un.getCartesian2());if(t instanceof h)return h.normalize(t,Un.getCartesian3());if(t instanceof se)return se.normalize(t,Un.getCartesian4());throw new oe(`Function "${e}" requires a vector or number argument. Argument is ${t}.`)}function smt(e,t,n){if(typeof t=="number"&&typeof n=="number")return Math.abs(t-n);if(t instanceof U&&n instanceof U)return U.distance(t,n);if(t instanceof h&&n instanceof h)return h.distance(t,n);if(t instanceof se&&n instanceof se)return se.distance(t,n);throw new oe(`Function "${e}" requires vector or number arguments of matching types. Arguments are ${t} and ${n}.`)}function amt(e,t,n){if(typeof t=="number"&&typeof n=="number")return t*n;if(t instanceof U&&n instanceof U)return U.dot(t,n);if(t instanceof h&&n instanceof h)return h.dot(t,n);if(t instanceof se&&n instanceof se)return se.dot(t,n);throw new oe(`Function "${e}" requires vector or number arguments of matching types. Arguments are ${t} and ${n}.`)}function cmt(e,t,n){if(t instanceof h&&n instanceof h)return h.cross(t,n,Un.getCartesian3());throw new oe(`Function "${e}" requires vec3 arguments. Arguments are ${t} and ${n}.`)}function Bt(e,t,n,i,r){this._type=e,this._value=t,this._left=n,this._right=i,this._test=r,this.evaluate=void 0,xmt(this)}function lmt(e,t){if(!l(t))return e;for(let n in t)if(t.hasOwnProperty(n)){let i=new RegExp(`\\$\\{${n}\\}`,"g"),r=`(${t[n]})`;l(r)&&(e=e.replace(i,r))}return e}function umt(e){return e.replace(Zht,Qht)}function VQ(e){return e.replace(emt,"\\")}function fmt(e){let t=e,n="",i=t.indexOf("${");for(;i>=0;){let r=t.indexOf("'"),o=t.indexOf('"'),s;if(r>=0&&r<i)s=t.indexOf("'",r+1),n+=t.substr(0,s+1),t=t.substr(s+1),i=t.indexOf("${");else if(o>=0&&o<i)s=t.indexOf('"',o+1),n+=t.substr(0,s+1),t=t.substr(s+1),i=t.indexOf("${");else{n+=t.substr(0,i);let a=t.indexOf("}");if(a<0)throw new oe("Unmatched {.");n+=`czm_${t.substr(i+2,a-(i+2))}`,t=t.substr(a+1),i=t.indexOf("${")}}return n+=t,n}function dmt(e){let t=typeof e.value;if(e.value===null)return new Bt(Mt.LITERAL_NULL,null);if(t==="boolean")return new Bt(Mt.LITERAL_BOOLEAN,e.value);if(t==="number")return new Bt(Mt.LITERAL_NUMBER,e.value);if(t==="string")return e.value.indexOf("${")>=0?new Bt(Mt.VARIABLE_IN_STRING,e.value):new Bt(Mt.LITERAL_STRING,VQ(e.value))}function hmt(e,t){let n=t.arguments,i=n.length,r,o,s,a;if(t.callee.type==="MemberExpression"){r=t.callee.property.name;let c=t.callee.object;if(r==="test"||r==="exec"){if(!l(c.callee)||c.callee.name!=="regExp")throw new oe(`${r} is not a function.`);return i===0?r==="test"?new Bt(Mt.LITERAL_BOOLEAN,!1):new Bt(Mt.LITERAL_NULL,null):(s=Ki(e,c),a=Ki(e,n[0]),new Bt(Mt.FUNCTION_CALL,r,s,a))}else if(r==="toString")return o=Ki(e,c),new Bt(Mt.FUNCTION_CALL,r,o);throw new oe(`Unexpected function call "${r}".`)}if(r=t.callee.name,r==="color"){if(i===0)return new Bt(Mt.LITERAL_COLOR,r);if(o=Ki(e,n[0]),l(n[1])){let c=Ki(e,n[1]);return new Bt(Mt.LITERAL_COLOR,r,[o,c])}return new Bt(Mt.LITERAL_COLOR,r,[o])}else if(r==="rgb"||r==="hsl"){if(i<3)throw new oe(`${r} requires three arguments.`);return o=[Ki(e,n[0]),Ki(e,n[1]),Ki(e,n[2])],new Bt(Mt.LITERAL_COLOR,r,o)}else if(r==="rgba"||r==="hsla"){if(i<4)throw new oe(`${r} requires four arguments.`);return o=[Ki(e,n[0]),Ki(e,n[1]),Ki(e,n[2]),Ki(e,n[3])],new Bt(Mt.LITERAL_COLOR,r,o)}else if(r==="vec2"||r==="vec3"||r==="vec4"){o=new Array(i);for(let c=0;c<i;++c)o[c]=Ki(e,n[c]);return new Bt(Mt.LITERAL_VECTOR,r,o)}else{if(r==="isNaN"||r==="isFinite")return i===0?r==="isNaN"?new Bt(Mt.LITERAL_BOOLEAN,!0):new Bt(Mt.LITERAL_BOOLEAN,!1):(o=Ki(e,n[0]),new Bt(Mt.UNARY,r,o));if(r==="isExactClass"||r==="isClass"){if(i<1||i>1)throw new oe(`${r} requires exactly one argument.`);return o=Ki(e,n[0]),new Bt(Mt.UNARY,r,o)}else if(r==="getExactClassName"){if(i>0)throw new oe(`${r} does not take any argument.`);return new Bt(Mt.UNARY,r)}else if(l(yG[r])){if(i!==1)throw new oe(`${r} requires exactly one argument.`);return o=Ki(e,n[0]),new Bt(Mt.UNARY,r,o)}else if(l(AG[r])){if(i!==2)throw new oe(`${r} requires exactly two arguments.`);return s=Ki(e,n[0]),a=Ki(e,n[1]),new Bt(Mt.BINARY,r,s,a)}else if(l(jQ[r])){if(i!==3)throw new oe(`${r} requires exactly three arguments.`);s=Ki(e,n[0]),a=Ki(e,n[1]);let c=Ki(e,n[2]);return new Bt(Mt.TERNARY,r,s,a,c)}else{if(r==="Boolean")return i===0?new Bt(Mt.LITERAL_BOOLEAN,!1):(o=Ki(e,n[0]),new Bt(Mt.UNARY,r,o));if(r==="Number")return i===0?new Bt(Mt.LITERAL_NUMBER,0):(o=Ki(e,n[0]),new Bt(Mt.UNARY,r,o));if(r==="String")return i===0?new Bt(Mt.LITERAL_STRING,""):(o=Ki(e,n[0]),new Bt(Mt.UNARY,r,o));if(r==="regExp")return mmt(e,t)}}throw new oe(`Unexpected function call "${r}".`)}function mmt(e,t){let n=t.arguments;if(n.length===0)return new Bt(Mt.LITERAL_REGEX,new RegExp);let i=Ki(e,n[0]),r;if(n.length>1){let o=Ki(e,n[1]);if(zQ(i)&&zQ(o)){try{r=new RegExp(VQ(String(i._value)),o._value)}catch(s){throw new oe(s)}return new Bt(Mt.LITERAL_REGEX,r)}return new Bt(Mt.REGEX,i,o)}if(zQ(i)){try{r=new RegExp(VQ(String(i._value)))}catch(o){throw new oe(o)}return new Bt(Mt.LITERAL_REGEX,r)}return new Bt(Mt.REGEX,i)}function pmt(e){if(Amt(e.name)){let t=bmt(e.name);return t.substr(0,8)==="tiles3d_"?new Bt(Mt.BUILTIN_VARIABLE,t):new Bt(Mt.VARIABLE,t)}else{if(e.name==="NaN")return new Bt(Mt.LITERAL_NUMBER,NaN);if(e.name==="Infinity")return new Bt(Mt.LITERAL_NUMBER,1/0);if(e.name==="undefined")return new Bt(Mt.LITERAL_UNDEFINED,void 0)}throw new oe(`${e.name} is not defined.`)}function gmt(e){let t=e.property.name;if(t==="PI")return new Bt(Mt.LITERAL_NUMBER,Math.PI);if(t==="E")return new Bt(Mt.LITERAL_NUMBER,Math.E)}function _mt(e){if(e.property.name==="POSITIVE_INFINITY")return new Bt(Mt.LITERAL_NUMBER,Number.POSITIVE_INFINITY)}function ymt(e,t){if(t.object.name==="Math")return gmt(t);if(t.object.name==="Number")return _mt(t);let n,i=Ki(e,t.object);return t.computed?(n=Ki(e,t.property),new Bt(Mt.MEMBER,"brackets",i,n)):(n=new Bt(Mt.LITERAL_STRING,t.property.name),new Bt(Mt.MEMBER,"dot",i,n))}function zQ(e){return e._type>=Mt.LITERAL_NULL}function Amt(e){return e.substr(0,4)==="czm_"}function bmt(e){return e.substr(4)}function Ki(e,t){let n,i,r,o;if(t.type==="Literal")n=dmt(t);else if(t.type==="CallExpression")n=hmt(e,t);else if(t.type==="Identifier")n=pmt(t);else if(t.type==="UnaryExpression"){i=t.operator;let s=Ki(e,t.argument);if(Jht.indexOf(i)>-1)n=new Bt(Mt.UNARY,i,s);else throw new oe(`Unexpected operator "${i}".`)}else if(t.type==="BinaryExpression")if(i=t.operator,r=Ki(e,t.left),o=Ki(e,t.right),bCe.indexOf(i)>-1)n=new Bt(Mt.BINARY,i,r,o);else throw new oe(`Unexpected operator "${i}".`);else if(t.type==="LogicalExpression")i=t.operator,r=Ki(e,t.left),o=Ki(e,t.right),bCe.indexOf(i)>-1&&(n=new Bt(Mt.BINARY,i,r,o));else if(t.type==="ConditionalExpression"){let s=Ki(e,t.test);r=Ki(e,t.consequent),o=Ki(e,t.alternate),n=new Bt(Mt.CONDITIONAL,"?",r,o,s)}else if(t.type==="MemberExpression")n=ymt(e,t);else if(t.type==="ArrayExpression"){let s=[];for(let a=0;a<t.elements.length;a++)s[a]=Ki(e,t.elements[a]);n=new Bt(Mt.ARRAY,s)}else throw t.type==="Compound"?new oe("Provide exactly one expression."):new oe("Cannot parse expression.");return n}function xmt(e){e._type===Mt.CONDITIONAL?e.evaluate=e._evaluateConditional:e._type===Mt.FUNCTION_CALL?e._value==="test"?e.evaluate=e._evaluateRegExpTest:e._value==="exec"?e.evaluate=e._evaluateRegExpExec:e._value==="toString"&&(e.evaluate=e._evaluateToString):e._type===Mt.UNARY?e._value==="!"?e.evaluate=e._evaluateNot:e._value==="-"?e.evaluate=e._evaluateNegative:e._value==="+"?e.evaluate=e._evaluatePositive:e._value==="isNaN"?e.evaluate=e._evaluateNaN:e._value==="isFinite"?e.evaluate=e._evaluateIsFinite:e._value==="isExactClass"?e.evaluate=e._evaluateIsExactClass:e._value==="isClass"?e.evaluate=e._evaluateIsClass:e._value==="getExactClassName"?e.evaluate=e._evaluateGetExactClassName:e._value==="Boolean"?e.evaluate=e._evaluateBooleanConversion:e._value==="Number"?e.evaluate=e._evaluateNumberConversion:e._value==="String"?e.evaluate=e._evaluateStringConversion:l(yG[e._value])&&(e.evaluate=Emt(e._value)):e._type===Mt.BINARY?e._value==="+"?e.evaluate=e._evaluatePlus:e._value==="-"?e.evaluate=e._evaluateMinus:e._value==="*"?e.evaluate=e._evaluateTimes:e._value==="/"?e.evaluate=e._evaluateDivide:e._value==="%"?e.evaluate=e._evaluateMod:e._value==="==="?e.evaluate=e._evaluateEqualsStrict:e._value==="!=="?e.evaluate=e._evaluateNotEqualsStrict:e._value==="<"?e.evaluate=e._evaluateLessThan:e._value==="<="?e.evaluate=e._evaluateLessThanOrEquals:e._value===">"?e.evaluate=e._evaluateGreaterThan:e._value===">="?e.evaluate=e._evaluateGreaterThanOrEquals:e._value==="&&"?e.evaluate=e._evaluateAnd:e._value==="||"?e.evaluate=e._evaluateOr:e._value==="=~"?e.evaluate=e._evaluateRegExpMatch:e._value==="!~"?e.evaluate=e._evaluateRegExpNotMatch:l(AG[e._value])&&(e.evaluate=Cmt(e._value)):e._type===Mt.TERNARY?e.evaluate=vmt(e._value):e._type===Mt.MEMBER?e._value==="brackets"?e.evaluate=e._evaluateMemberBrackets:e.evaluate=e._evaluateMemberDot:e._type===Mt.ARRAY?e.evaluate=e._evaluateArray:e._type===Mt.VARIABLE?e.evaluate=e._evaluateVariable:e._type===Mt.VARIABLE_IN_STRING?e.evaluate=e._evaluateVariableString:e._type===Mt.LITERAL_COLOR?e.evaluate=e._evaluateLiteralColor:e._type===Mt.LITERAL_VECTOR?e.evaluate=e._evaluateLiteralVector:e._type===Mt.LITERAL_STRING?e.evaluate=e._evaluateLiteralString:e._type===Mt.REGEX?e.evaluate=e._evaluateRegExp:e._type===Mt.BUILTIN_VARIABLE?e._value==="tiles3d_tileset_time"&&(e.evaluate=Tmt):e.evaluate=e._evaluateLiteral}function Tmt(e){return l(e)?e.content.tileset.timeSinceLoad:0}function Emt(e){let t=yG[e];return function(n){let i=this._left.evaluate(n);return t(e,i)}}function Cmt(e){let t=AG[e];return function(n){let i=this._left.evaluate(n),r=this._right.evaluate(n);return t(e,i,r)}}function vmt(e){let t=jQ[e];return function(n){let i=this._left.evaluate(n),r=this._right.evaluate(n),o=this._test.evaluate(n);return t(e,i,r,o)}}function bG(e,t){if(l(e))return e.getPropertyInherited(t)}Bt.prototype._evaluateLiteral=function(){return this._value};Bt.prototype._evaluateLiteralColor=function(e){let t=_G,n=this._left;if(this._value==="color")l(n)?n.length>1?(z.fromCssColorString(n[0].evaluate(e),t),t.alpha=n[1].evaluate(e)):z.fromCssColorString(n[0].evaluate(e),t):z.fromBytes(255,255,255,255,t);else if(this._value==="rgb")z.fromBytes(n[0].evaluate(e),n[1].evaluate(e),n[2].evaluate(e),255,t);else if(this._value==="rgba"){let i=n[3].evaluate(e)*255;z.fromBytes(n[0].evaluate(e),n[1].evaluate(e),n[2].evaluate(e),i,t)}else this._value==="hsl"?z.fromHsl(n[0].evaluate(e),n[1].evaluate(e),n[2].evaluate(e),1,t):this._value==="hsla"&&z.fromHsl(n[0].evaluate(e),n[1].evaluate(e),n[2].evaluate(e),n[3].evaluate(e),t);return se.fromColor(t,Un.getCartesian4())};Bt.prototype._evaluateLiteralVector=function(e){let t=Un.getArray(),n=this._value,i=this._left,r=i.length;for(let a=0;a<r;++a){let c=i[a].evaluate(e);if(typeof c=="number")t.push(c);else if(c instanceof U)t.push(c.x,c.y);else if(c instanceof h)t.push(c.x,c.y,c.z);else if(c instanceof se)t.push(c.x,c.y,c.z,c.w);else throw new oe(`${n} argument must be a vector or number. Argument is ${c}.`)}let o=t.length,s=parseInt(n.charAt(3));if(o===0)throw new oe(`Invalid ${n} constructor. No valid arguments.`);if(o<s&&o>1)throw new oe(`Invalid ${n} constructor. Not enough arguments.`);if(o>s&&r>1)throw new oe(`Invalid ${n} constructor. Too many arguments.`);if(o===1){let a=t[0];t.push(a,a,a)}if(n==="vec2")return U.fromArray(t,0,Un.getCartesian2());if(n==="vec3")return h.fromArray(t,0,Un.getCartesian3());if(n==="vec4")return se.fromArray(t,0,Un.getCartesian4())};Bt.prototype._evaluateLiteralString=function(){return this._value};Bt.prototype._evaluateVariableString=function(e){let t=this._value,n=gk.exec(t);for(;n!==null;){let i=n[0],r=n[1],o=bG(e,r);l(o)||(o=""),t=t.replace(i,o),gk.lastIndex+=o.length-i.length,n=gk.exec(t)}return t};Bt.prototype._evaluateVariable=function(e){return bG(e,this._value)};function XT(e){return e._value==="feature"}Bt.prototype._evaluateMemberDot=function(e){if(XT(this._left))return bG(e,this._right.evaluate(e));let t=this._left.evaluate(e);if(!l(t))return;let n=this._right.evaluate(e);if(t instanceof U||t instanceof h||t instanceof se){if(n==="r")return t.x;if(n==="g")return t.y;if(n==="b")return t.z;if(n==="a")return t.w}return t[n]};Bt.prototype._evaluateMemberBrackets=function(e){if(XT(this._left))return bG(e,this._right.evaluate(e));let t=this._left.evaluate(e);if(!l(t))return;let n=this._right.evaluate(e);if(t instanceof U||t instanceof h||t instanceof se){if(n===0||n==="r")return t.x;if(n===1||n==="g")return t.y;if(n===2||n==="b")return t.z;if(n===3||n==="a")return t.w}return t[n]};Bt.prototype._evaluateArray=function(e){let t=[];for(let n=0;n<this._value.length;n++)t[n]=this._value[n].evaluate(e);return t};Bt.prototype._evaluateNot=function(e){let t=this._left.evaluate(e);if(typeof t!="boolean")throw new oe(`Operator "!" requires a boolean argument. Argument is ${t}.`);return!t};Bt.prototype._evaluateNegative=function(e){let t=this._left.evaluate(e);if(t instanceof U)return U.negate(t,Un.getCartesian2());if(t instanceof h)return h.negate(t,Un.getCartesian3());if(t instanceof se)return se.negate(t,Un.getCartesian4());if(typeof t=="number")return-t;throw new oe(`Operator "-" requires a vector or number argument. Argument is ${t}.`)};Bt.prototype._evaluatePositive=function(e){let t=this._left.evaluate(e);if(!(t instanceof U||t instanceof h||t instanceof se||typeof t=="number"))throw new oe(`Operator "+" requires a vector or number argument. Argument is ${t}.`);return t};Bt.prototype._evaluateLessThan=function(e){let t=this._left.evaluate(e),n=this._right.evaluate(e);if(typeof t!="number"||typeof n!="number")throw new oe(`Operator "<" requires number arguments. Arguments are ${t} and ${n}.`);return t<n};Bt.prototype._evaluateLessThanOrEquals=function(e){let t=this._left.evaluate(e),n=this._right.evaluate(e);if(typeof t!="number"||typeof n!="number")throw new oe(`Operator "<=" requires number arguments. Arguments are ${t} and ${n}.`);return t<=n};Bt.prototype._evaluateGreaterThan=function(e){let t=this._left.evaluate(e),n=this._right.evaluate(e);if(typeof t!="number"||typeof n!="number")throw new oe(`Operator ">" requires number arguments. Arguments are ${t} and ${n}.`);return t>n};Bt.prototype._evaluateGreaterThanOrEquals=function(e){let t=this._left.evaluate(e),n=this._right.evaluate(e);if(typeof t!="number"||typeof n!="number")throw new oe(`Operator ">=" requires number arguments. Arguments are ${t} and ${n}.`);return t>=n};Bt.prototype._evaluateOr=function(e){let t=this._left.evaluate(e);if(typeof t!="boolean")throw new oe(`Operator "||" requires boolean arguments. First argument is ${t}.`);if(t)return!0;let n=this._right.evaluate(e);if(typeof n!="boolean")throw new oe(`Operator "||" requires boolean arguments. Second argument is ${n}.`);return t||n};Bt.prototype._evaluateAnd=function(e){let t=this._left.evaluate(e);if(typeof t!="boolean")throw new oe(`Operator "&&" requires boolean arguments. First argument is ${t}.`);if(!t)return!1;let n=this._right.evaluate(e);if(typeof n!="boolean")throw new oe(`Operator "&&" requires boolean arguments. Second argument is ${n}.`);return t&&n};Bt.prototype._evaluatePlus=function(e){let t=this._left.evaluate(e),n=this._right.evaluate(e);if(n instanceof U&&t instanceof U)return U.add(t,n,Un.getCartesian2());if(n instanceof h&&t instanceof h)return h.add(t,n,Un.getCartesian3());if(n instanceof se&&t instanceof se)return se.add(t,n,Un.getCartesian4());if(typeof t=="string"||typeof n=="string")return t+n;if(typeof t=="number"&&typeof n=="number")return t+n;throw new oe(`Operator "+" requires vector or number arguments of matching types, or at least one string argument. Arguments are ${t} and ${n}.`)};Bt.prototype._evaluateMinus=function(e){let t=this._left.evaluate(e),n=this._right.evaluate(e);if(n instanceof U&&t instanceof U)return U.subtract(t,n,Un.getCartesian2());if(n instanceof h&&t instanceof h)return h.subtract(t,n,Un.getCartesian3());if(n instanceof se&&t instanceof se)return se.subtract(t,n,Un.getCartesian4());if(typeof t=="number"&&typeof n=="number")return t-n;throw new oe(`Operator "-" requires vector or number arguments of matching types. Arguments are ${t} and ${n}.`)};Bt.prototype._evaluateTimes=function(e){let t=this._left.evaluate(e),n=this._right.evaluate(e);if(n instanceof U&&t instanceof U)return U.multiplyComponents(t,n,Un.getCartesian2());if(n instanceof U&&typeof t=="number")return U.multiplyByScalar(n,t,Un.getCartesian2());if(t instanceof U&&typeof n=="number")return U.multiplyByScalar(t,n,Un.getCartesian2());if(n instanceof h&&t instanceof h)return h.multiplyComponents(t,n,Un.getCartesian3());if(n instanceof h&&typeof t=="number")return h.multiplyByScalar(n,t,Un.getCartesian3());if(t instanceof h&&typeof n=="number")return h.multiplyByScalar(t,n,Un.getCartesian3());if(n instanceof se&&t instanceof se)return se.multiplyComponents(t,n,Un.getCartesian4());if(n instanceof se&&typeof t=="number")return se.multiplyByScalar(n,t,Un.getCartesian4());if(t instanceof se&&typeof n=="number")return se.multiplyByScalar(t,n,Un.getCartesian4());if(typeof t=="number"&&typeof n=="number")return t*n;throw new oe(`Operator "*" requires vector or number arguments. If both arguments are vectors they must be matching types. Arguments are ${t} and ${n}.`)};Bt.prototype._evaluateDivide=function(e){let t=this._left.evaluate(e),n=this._right.evaluate(e);if(n instanceof U&&t instanceof U)return U.divideComponents(t,n,Un.getCartesian2());if(t instanceof U&&typeof n=="number")return U.divideByScalar(t,n,Un.getCartesian2());if(n instanceof h&&t instanceof h)return h.divideComponents(t,n,Un.getCartesian3());if(t instanceof h&&typeof n=="number")return h.divideByScalar(t,n,Un.getCartesian3());if(n instanceof se&&t instanceof se)return se.divideComponents(t,n,Un.getCartesian4());if(t instanceof se&&typeof n=="number")return se.divideByScalar(t,n,Un.getCartesian4());if(typeof t=="number"&&typeof n=="number")return t/n;throw new oe(`Operator "/" requires vector or number arguments of matching types, or a number as the second argument. Arguments are ${t} and ${n}.`)};Bt.prototype._evaluateMod=function(e){let t=this._left.evaluate(e),n=this._right.evaluate(e);if(n instanceof U&&t instanceof U)return U.fromElements(t.x%n.x,t.y%n.y,Un.getCartesian2());if(n instanceof h&&t instanceof h)return h.fromElements(t.x%n.x,t.y%n.y,t.z%n.z,Un.getCartesian3());if(n instanceof se&&t instanceof se)return se.fromElements(t.x%n.x,t.y%n.y,t.z%n.z,t.w%n.w,Un.getCartesian4());if(typeof t=="number"&&typeof n=="number")return t%n;throw new oe(`Operator "%" requires vector or number arguments of matching types. Arguments are ${t} and ${n}.`)};Bt.prototype._evaluateEqualsStrict=function(e){let t=this._left.evaluate(e),n=this._right.evaluate(e);return n instanceof U&&t instanceof U||n instanceof h&&t instanceof h||n instanceof se&&t instanceof se?t.equals(n):t===n};Bt.prototype._evaluateNotEqualsStrict=function(e){let t=this._left.evaluate(e),n=this._right.evaluate(e);return n instanceof U&&t instanceof U||n instanceof h&&t instanceof h||n instanceof se&&t instanceof se?!t.equals(n):t!==n};Bt.prototype._evaluateConditional=function(e){let t=this._test.evaluate(e);if(typeof t!="boolean")throw new oe(`Conditional argument of conditional expression must be a boolean. Argument is ${t}.`);return t?this._left.evaluate(e):this._right.evaluate(e)};Bt.prototype._evaluateNaN=function(e){return isNaN(this._left.evaluate(e))};Bt.prototype._evaluateIsFinite=function(e){return isFinite(this._left.evaluate(e))};Bt.prototype._evaluateIsExactClass=function(e){return l(e)?e.isExactClass(this._left.evaluate(e)):!1};Bt.prototype._evaluateIsClass=function(e){return l(e)?e.isClass(this._left.evaluate(e)):!1};Bt.prototype._evaluateGetExactClassName=function(e){if(l(e))return e.getExactClassName()};Bt.prototype._evaluateBooleanConversion=function(e){return!!this._left.evaluate(e)};Bt.prototype._evaluateNumberConversion=function(e){return Number(this._left.evaluate(e))};Bt.prototype._evaluateStringConversion=function(e){return String(this._left.evaluate(e))};Bt.prototype._evaluateRegExp=function(e){let t=this._value.evaluate(e),n="";l(this._left)&&(n=this._left.evaluate(e));let i;try{i=new RegExp(t,n)}catch(r){throw new oe(r)}return i};Bt.prototype._evaluateRegExpTest=function(e){let t=this._left.evaluate(e),n=this._right.evaluate(e);if(!(t instanceof RegExp&&typeof n=="string"))throw new oe(`RegExp.test requires the first argument to be a RegExp and the second argument to be a string. Arguments are ${t} and ${n}.`);return t.test(n)};Bt.prototype._evaluateRegExpMatch=function(e){let t=this._left.evaluate(e),n=this._right.evaluate(e);if(t instanceof RegExp&&typeof n=="string")return t.test(n);if(n instanceof RegExp&&typeof t=="string")return n.test(t);throw new oe(`Operator "=~" requires one RegExp argument and one string argument. Arguments are ${t} and ${n}.`)};Bt.prototype._evaluateRegExpNotMatch=function(e){let t=this._left.evaluate(e),n=this._right.evaluate(e);if(t instanceof RegExp&&typeof n=="string")return!t.test(n);if(n instanceof RegExp&&typeof t=="string")return!n.test(t);throw new oe(`Operator "!~" requires one RegExp argument and one string argument. Arguments are ${t} and ${n}.`)};Bt.prototype._evaluateRegExpExec=function(e){let t=this._left.evaluate(e),n=this._right.evaluate(e);if(!(t instanceof RegExp&&typeof n=="string"))throw new oe(`RegExp.exec requires the first argument to be a RegExp and the second argument to be a string. Arguments are ${t} and ${n}.`);let i=t.exec(n);return l(i)?i[1]:null};Bt.prototype._evaluateToString=function(e){let t=this._left.evaluate(e);if(t instanceof RegExp||t instanceof U||t instanceof h||t instanceof se)return String(t);throw new oe(`Unexpected function call "${this._value}".`)};function TCe(e){let t=e._left,n=t.length;for(let a=0;a<n;++a)if(t[a]._type!==Mt.LITERAL_NUMBER)return;let i=t[0]._value,r=t[1]._value,o=t[2]._value,s=n===4?t[3]._value:1;return z.fromHsl(i,r,o,s,_G)}function ECe(e){let t=e._left,n=t.length;for(let r=0;r<n;++r)if(t[r]._type!==Mt.LITERAL_NUMBER)return;let i=_G;return i.red=t[0]._value/255,i.green=t[1]._value/255,i.blue=t[2]._value/255,i.alpha=n===4?t[3]._value:1,i}function NA(e){return e%1===0?e.toFixed(1):e.toString()}function Smt(e){let t=NA(e.red),n=NA(e.green),i=NA(e.blue);return`vec3(${t}, ${n}, ${i})`}function gG(e){let t=NA(e.red),n=NA(e.green),i=NA(e.blue),r=NA(e.alpha);return`vec4(${t}, ${n}, ${i}, ${r})`}function CCe(e,t,n,i){let r=e.length,o=new Array(r);for(let s=0;s<r;++s)o[s]=e[s].getShaderExpression(t,n,i);return o}function vCe(e,t){return l(t[e])?t[e]:Om.NULL_SENTINEL}Om.NULL_SENTINEL="czm_infinity";Bt.prototype.getShaderExpression=function(e,t,n){let i,r,o,s,a=this._type,c=this._value;l(this._left)&&(Array.isArray(this._left)?r=CCe(this._left,e,t,this):r=this._left.getShaderExpression(e,t,this)),l(this._right)&&(o=this._right.getShaderExpression(e,t,this)),l(this._test)&&(s=this._test.getShaderExpression(e,t,this)),Array.isArray(this._value)&&(c=CCe(this._value,e,t,this));let u,f,d;switch(a){case Mt.VARIABLE:return XT(this)?void 0:vCe(c,e);case Mt.UNARY:if(c==="Boolean")return`bool(${r})`;if(c==="Number")return`float(${r})`;if(c==="round")return`floor(${r} + 0.5)`;if(l(yG[c]))return`${c}(${r})`;if(c==="isNaN")return`(${r} != ${r})`;if(c==="isFinite")return`(abs(${r}) < czm_infinity)`;if(c==="String"||c==="isExactClass"||c==="isClass"||c==="getExactClassName")throw new oe(`Error generating style shader: "${c}" is not supported.`);return c+r;case Mt.BINARY:return c==="%"?`mod(${r}, ${o})`:c==="==="?`(${r} == ${o})`:c==="!=="?`(${r} != ${o})`:c==="atan2"?`atan(${r}, ${o})`:l(AG[c])?`${c}(${r}, ${o})`:`(${r} ${c} ${o})`;case Mt.TERNARY:if(l(jQ[c]))return`${c}(${r}, ${o}, ${s})`;break;case Mt.CONDITIONAL:return`(${s} ? ${r} : ${o})`;case Mt.MEMBER:return XT(this._left)?vCe(o,e):o==="r"||o==="x"||o==="0.0"?`${r}[0]`:o==="g"||o==="y"||o==="1.0"?`${r}[1]`:o==="b"||o==="z"||o==="2.0"?`${r}[2]`:o==="a"||o==="w"||o==="3.0"?`${r}[3]`:`${r}[int(${o})]`;case Mt.FUNCTION_CALL:throw new oe(`Error generating style shader: "${c}" is not supported.`);case Mt.ARRAY:if(c.length===4)return`vec4(${c[0]}, ${c[1]}, ${c[2]}, ${c[3]})`;if(c.length===3)return`vec3(${c[0]}, ${c[1]}, ${c[2]})`;if(c.length===2)return`vec2(${c[0]}, ${c[1]})`;throw new oe("Error generating style shader: Invalid array length. Array length should be 2, 3, or 4.");case Mt.REGEX:throw new oe("Error generating style shader: Regular expressions are not supported.");case Mt.VARIABLE_IN_STRING:throw new oe("Error generating style shader: Converting a variable to a string is not supported.");case Mt.LITERAL_NULL:return Om.NULL_SENTINEL;case Mt.LITERAL_BOOLEAN:return c?"true":"false";case Mt.LITERAL_NUMBER:return NA(c);case Mt.LITERAL_STRING:if(l(n)&&n._type===Mt.MEMBER&&(c==="r"||c==="g"||c==="b"||c==="a"||c==="x"||c==="y"||c==="z"||c==="w"||XT(n._left)))return c;if(i=z.fromCssColorString(c,_G),l(i))return Smt(i);throw new oe("Error generating style shader: String literals are not supported.");case Mt.LITERAL_COLOR:if(u=r,c==="color"){if(l(u)){if(u.length>1){let p=u[0],g=u[1];return g!=="1.0"&&(t.translucent=!0),`vec4(${p}, ${g})`}}else return"vec4(1.0)";return`vec4(${u[0]}, 1.0)`}else{if(c==="rgb")return i=ECe(this),l(i)?gG(i):`vec4(${u[0]} / 255.0, ${u[1]} / 255.0, ${u[2]} / 255.0, 1.0)`;if(c==="rgba")return u[3]!=="1.0"&&(t.translucent=!0),i=ECe(this),l(i)?gG(i):`vec4(${u[0]} / 255.0, ${u[1]} / 255.0, ${u[2]} / 255.0, ${u[3]})`;if(c==="hsl")return i=TCe(this),l(i)?gG(i):`vec4(czm_HSLToRGB(vec3(${u[0]}, ${u[1]}, ${u[2]})), 1.0)`;if(c==="hsla")return i=TCe(this),l(i)?(i.alpha!==1&&(t.translucent=!0),gG(i)):(u[3]!=="1.0"&&(t.translucent=!0),`vec4(czm_HSLToRGB(vec3(${u[0]}, ${u[1]}, ${u[2]})), ${u[3]})`)}break;case Mt.LITERAL_VECTOR:f=r.length,d=`${c}(`;for(let p=0;p<f;++p)d+=r[p],p<f-1&&(d+=", ");return d+=")",d;case Mt.LITERAL_REGEX:throw new oe("Error generating style shader: Regular expressions are not supported.");case Mt.LITERAL_UNDEFINED:return Om.NULL_SENTINEL;case Mt.BUILTIN_VARIABLE:if(c==="tiles3d_tileset_time")return c}};Bt.prototype.getVariables=function(e,t){let n,i,r,o=this._type,s=this._value;if(l(this._left))if(Array.isArray(this._left))for(n=this._left,i=n.length,r=0;r<i;++r)n[r].getVariables(e,this);else this._left.getVariables(e,this);if(l(this._right)&&this._right.getVariables(e,this),l(this._test)&&this._test.getVariables(e,this),Array.isArray(this._value))for(n=this._value,i=n.length,r=0;r<i;++r)n[r].getVariables(e,this);let a;switch(o){case Mt.VARIABLE:XT(this)||e.push(s);break;case Mt.VARIABLE_IN_STRING:for(a=gk.exec(s);a!==null;)e.push(a[1]),a=gk.exec(s);break;case Mt.LITERAL_STRING:l(t)&&t._type===Mt.MEMBER&&XT(t._left)&&e.push(s);break}};var ih=Om;function u_(e){e=e??H.EMPTY_OBJECT,this._batchTable=e.batchTable,this._batchIds=e.batchIds,this._positions=e.positions,this._vertexBatchIds=e.vertexBatchIds,this._indices=e.indices,this._indexCounts=e.indexCounts,this._indexOffsets=e.indexOffsets,this._batchedIndices=e.batchedIndices,this._boundingVolume=e.boundingVolume,this._boundingVolumes=e.boundingVolumes,this._center=e.center??h.ZERO,this._va=void 0,this._sp=void 0,this._spStencil=void 0,this._spPick=void 0,this._uniformMap=void 0,this._vaSwap=void 0,this._rsStencilDepthPass=void 0,this._rsStencilDepthPass3DTiles=void 0,this._rsColorPass=void 0,this._rsPickPass=void 0,this._rsWireframe=void 0,this._commands=[],this._commandsIgnoreShow=[],this._pickCommands=[],this._constantColor=z.clone(z.WHITE),this._highlightColor=this._constantColor,this._batchDirty=!0,this._pickCommandsDirty=!0,this._framesSinceLastRebatch=0,this._updatingAllCommands=!1,this._trianglesLength=this._indices.length/3,this._geometryByteLength=this._indices.byteLength+this._positions.byteLength+this._vertexBatchIds.byteLength,this.debugWireframe=!1,this._debugWireframe=this.debugWireframe,this._wireframeDirty=!1,this.forceRebatch=!1,this.classificationType=e.classificationType??Qn.BOTH,this._vertexShaderSource=e._vertexShaderSource,this._fragmentShaderSource=e._fragmentShaderSource,this._attributeLocations=e._attributeLocations,this._uniformMap=e._uniformMap,this._pickId=e._pickId,this._modelMatrix=e._modelMatrix,this._boundingSphere=e._boundingSphere,this._batchIdLookUp={};let t=this._batchIds.length;for(let n=0;n<t;++n){let i=this._batchIds[n];this._batchIdLookUp[i]=n}}Object.defineProperties(u_.prototype,{trianglesLength:{get:function(){return this._trianglesLength}},geometryByteLength:{get:function(){return this._geometryByteLength}}});var wmt={position:0,a_batchId:1};function Imt(e,t){if(l(e._va))return;let n=tt.createVertexBuffer({context:t,typedArray:e._positions,usage:Me.STATIC_DRAW}),i=tt.createVertexBuffer({context:t,typedArray:e._vertexBatchIds,usage:Me.STATIC_DRAW}),r=tt.createIndexBuffer({context:t,typedArray:e._indices,usage:Me.DYNAMIC_DRAW,indexDatatype:e._indices.BYTES_PER_ELEMENT===2?je.UNSIGNED_SHORT:je.UNSIGNED_INT}),o=[{index:0,vertexBuffer:n,componentDatatype:Y.fromTypedArray(e._positions),componentsPerAttribute:3},{index:1,vertexBuffer:i,componentDatatype:Y.fromTypedArray(e._vertexBatchIds),componentsPerAttribute:1}];e._va=new zn({context:t,attributes:o,indexBuffer:r}),t.webgl2&&(e._vaSwap=new zn({context:t,attributes:o,indexBuffer:tt.createIndexBuffer({context:t,sizeInBytes:r.sizeInBytes,usage:Me.DYNAMIC_DRAW,indexDatatype:r.indexDatatype})})),e._batchedPositions=void 0,e._transferrableBatchIds=void 0,e._vertexBatchIds=void 0}function Pmt(e,t){if(l(e._sp))return;let n=e._batchTable,i=e._attributeLocations??wmt,r=e._pickId,o=e._vertexShaderSource,s=e._fragmentShaderSource;if(l(o)){e._sp=Qt.fromCache({context:t,vertexShaderSource:o,fragmentShaderSource:s,attributeLocations:i}),e._spStencil=e._sp,s=Ye.replaceMain(s,"czm_non_pick_main"),s=`${s}void main() +{ + czm_non_pick_main(); + out_FragColor = ${r}; +} +`,e._spPick=Qt.fromCache({context:t,vertexShaderSource:o,fragmentShaderSource:s,attributeLocations:i});return}let a=n.getVertexShaderCallback(!1,"a_batchId",void 0)(Ov),c=n.getFragmentShaderCallback(!1,void 0,!0)(jy);r=n.getPickId();let u=new Ye({sources:[a]}),f=new Ye({defines:["VECTOR_TILE"],sources:[c]});e._sp=Qt.fromCache({context:t,vertexShaderSource:u,fragmentShaderSource:f,attributeLocations:i}),u=new Ye({sources:[Ov]}),f=new Ye({defines:["VECTOR_TILE"],sources:[jy]}),e._spStencil=Qt.fromCache({context:t,vertexShaderSource:u,fragmentShaderSource:f,attributeLocations:i}),c=Ye.replaceMain(c,"czm_non_pick_main"),c=`${c} void main() { - out_FragColor = texture(billboard_texture, v_textureCoordinates); + czm_non_pick_main(); + out_FragColor = ${r}; } -`,{uniformMap:{billboard_texture:function(){return e.textureAtlas.texture}}});return i.pass=Ie.OVERLAY,i}var _ut=[];$d.prototype.update=function(e){if(ZZ(this),!this.show)return;let t=e.context;if(!t.instancedArrays||!(kt.maximumVertexTextureImageUnits>0))throw new pe("Beginning in CesiumJS 1.140, billboards and labels require device support for WebGL 2, or WebGL 1 with ANGLE_instanced_arrays and MAX_VERTEX_TEXTURE_IMAGE_UNITS > 0. For more information or to share feedback, see: https://github.com/CesiumGS/cesium/issues/13053");let n=this._billboards,i=n.length,r=!0;for(let I=0;I<i;++I){let R=n[I];l(R.loadError)&&(console.error(`Error loading image for billboard: ${R.loadError}`),R.image=void 0),R.textureDirty&&this._updateBillboard(R,PT),R.show&&(r=r&&R.ready)}let o=this._textureAtlas;if(e.afterRender.push(()=>{if(!this.isDestroyed())return o.update(e.context)}),!l(o.texture))return;mut(this,e),n=this._billboards,i=n.length;let s=this._billboardsToUpdate,a=this._billboardsToUpdateIndex,c=this._propertiesChanged,u=o.guid,f=this._createVertexArray||this._textureAtlasGUID!==u;this._textureAtlasGUID=u;let d,p=e.passes,g=p.pick;if(f||!g&&this.computeNewBuffersUsage()){this._createVertexArray=!1;for(let I=0;I<JZ;++I)c[I]=0;if(this._vaf=this._vaf&&this._vaf.destroy(),i>0){this._vaf=aut(t,i,this._buffersUsage,this._batchTable,this._sdf),d=this._vaf.writers;for(let I=0;I<i;++I){let R=this._billboards[I];R._dirty=!1,R.textureDirty=!1,hut(this,e,d,R)}this._vaf.commit(oxe(t))}this._billboardsToUpdateIndex=0}else if(a>0){let I=_ut;I.length=0,(c[x2]||c[nut]||c[tut])&&I.push(_xe),(c[PT]||c[sxe]||c[Qlt]||c[eut]||c[Zlt])&&(I.push(Axe),I.push($Z)),(c[PT]||c[iut]||c[uxe])&&(I.push(bxe),I.push(KZ)),(c[PT]||c[cxe])&&I.push(KZ),(c[PT]||c[axe])&&I.push($Z),c[lxe]&&I.push(xxe),c[fxe]&&I.push(Txe),(c[dxe]||c[rut]||c[PT]||c[x2])&&I.push(Exe),(c[PT]||c[x2])&&I.push(Cxe),c[hxe]&&I.push(vxe),c[mxe]&&I.push(Sxe);let R=I.length;if(d=this._vaf.writers,a/i>.1){for(let O=0;O<a;++O){let L=s[O];L._dirty=!1,L.textureDirty=!1;for(let _=0;_<R;++_)I[_](this,e,d,L)}this._vaf.commit(oxe(t))}else{for(let O=0;O<a;++O){let L=s[O];L._dirty=!1,L.textureDirty=!1;for(let _=0;_<R;++_)I[_](this,e,d,L);this._vaf.subCommit(L._index,1)}this._vaf.endSubCommits()}this._billboardsToUpdateIndex=0}if(a>i*1.5&&(s.length=i),!l(this._vaf)||!l(this._vaf.va))return;this._boundingVolumeDirty&&(this._boundingVolumeDirty=!1,ue.transform(this._baseVolume,this.modelMatrix,this._baseVolumeWC));let m,y=N.IDENTITY;e.mode===re.SCENE3D?(y=this.modelMatrix,m=ue.clone(this._baseVolumeWC,this._boundingVolume)):m=ue.clone(this._baseVolume2D,this._boundingVolume),put(this,e,m);let A=this._blendOption!==this.blendOption;if(this._blendOption=this.blendOption,A){this._blendOption===Fi.OPAQUE||this._blendOption===Fi.OPAQUE_AND_TRANSLUCENT?this._rsOpaque=Ge.fromCache({depthTest:{enabled:!0,func:te.LESS},depthMask:!0}):this._rsOpaque=void 0;let I=this._blendOption===Fi.TRANSLUCENT;this._blendOption===Fi.TRANSLUCENT||this._blendOption===Fi.OPAQUE_AND_TRANSLUCENT?this._rsTranslucent=Ge.fromCache({depthTest:{enabled:!0,func:I?te.LEQUAL:te.LESS},depthMask:I,blending:tn.ALPHA_BLEND}):this._rsTranslucent=void 0}this._shaderDisableDepthDistance=this._shaderDisableDepthDistance||e.minimumDisableDepthTestDistance!==0;let b,x,T,E,v;if(A||this._shaderRotation!==this._compiledShaderRotation||this._shaderAlignedAxis!==this._compiledShaderAlignedAxis||this._shaderScaleByDistance!==this._compiledShaderScaleByDistance||this._shaderTranslucencyByDistance!==this._compiledShaderTranslucencyByDistance||this._shaderPixelOffsetScaleByDistance!==this._compiledShaderPixelOffsetScaleByDistance||this._shaderDistanceDisplayCondition!==this._compiledShaderDistanceDisplayCondition||this._shaderDisableDepthDistance!==this._compiledShaderDisableDepthDistance||this._shaderClampToGround!==this._compiledShaderClampToGround||this._sdf!==this._compiledSDF){b=kO,x=BO,v=["INSTANCED"],l(this._batchTable)&&(v.push("VECTOR_TILE"),b=this._batchTable.getVertexShaderCallback(!1,"a_batchId",void 0)(b),x=this._batchTable.getFragmentShaderCallback(!1,void 0)(x)),T=new Ye({defines:v,sources:[b]}),this._shaderRotation&&T.defines.push("ROTATION"),this._shaderAlignedAxis&&T.defines.push("ALIGNED_AXIS"),this._shaderScaleByDistance&&T.defines.push("EYE_DISTANCE_SCALING"),this._shaderTranslucencyByDistance&&T.defines.push("EYE_DISTANCE_TRANSLUCENCY"),this._shaderPixelOffsetScaleByDistance&&T.defines.push("EYE_DISTANCE_PIXEL_OFFSET"),this._shaderDistanceDisplayCondition&&T.defines.push("DISTANCE_DISPLAY_CONDITION"),this._shaderDisableDepthDistance&&T.defines.push("DISABLE_DEPTH_DISTANCE"),this._shaderClampToGround&&T.defines.push("VS_THREE_POINT_DEPTH_CHECK");let I=1-Ga.CUTOFF;this._sdf&&T.defines.push("SDF");let R=l(this._batchTable)?"VECTOR_TILE":"";this._blendOption===Fi.OPAQUE_AND_TRANSLUCENT&&(E=new Ye({defines:["OPAQUE",R],sources:[x]}),this._shaderClampToGround&&E.defines.push("VS_THREE_POINT_DEPTH_CHECK"),this._sdf&&(E.defines.push("SDF"),E.defines.push(`SDF_EDGE ${I}`)),this._sp=Qt.replaceCache({context:t,shaderProgram:this._sp,vertexShaderSource:T,fragmentShaderSource:E,attributeLocations:zr}),E=new Ye({defines:["TRANSLUCENT",R],sources:[x]}),this._shaderClampToGround&&E.defines.push("VS_THREE_POINT_DEPTH_CHECK"),this._sdf&&(E.defines.push("SDF"),E.defines.push(`SDF_EDGE ${I}`)),this._spTranslucent=Qt.replaceCache({context:t,shaderProgram:this._spTranslucent,vertexShaderSource:T,fragmentShaderSource:E,attributeLocations:zr})),this._blendOption===Fi.OPAQUE&&(E=new Ye({defines:[R],sources:[x]}),this._shaderClampToGround&&E.defines.push("VS_THREE_POINT_DEPTH_CHECK"),this._sdf&&(E.defines.push("SDF"),E.defines.push(`SDF_EDGE ${I}`)),this._sp=Qt.replaceCache({context:t,shaderProgram:this._sp,vertexShaderSource:T,fragmentShaderSource:E,attributeLocations:zr})),this._blendOption===Fi.TRANSLUCENT&&(E=new Ye({defines:[R],sources:[x]}),this._shaderClampToGround&&E.defines.push("VS_THREE_POINT_DEPTH_CHECK"),this._sdf&&(E.defines.push("SDF"),E.defines.push(`SDF_EDGE ${I}`)),this._spTranslucent=Qt.replaceCache({context:t,shaderProgram:this._spTranslucent,vertexShaderSource:T,fragmentShaderSource:E,attributeLocations:zr})),this._compiledShaderRotation=this._shaderRotation,this._compiledShaderAlignedAxis=this._shaderAlignedAxis,this._compiledShaderScaleByDistance=this._shaderScaleByDistance,this._compiledShaderTranslucencyByDistance=this._shaderTranslucencyByDistance,this._compiledShaderPixelOffsetScaleByDistance=this._shaderPixelOffsetScaleByDistance,this._compiledShaderDistanceDisplayCondition=this._shaderDistanceDisplayCondition,this._compiledShaderDisableDepthDistance=this._shaderDisableDepthDistance,this._compiledShaderClampToGround=this._shaderClampToGround,this._compiledSDF=this._sdf}let S=e.commandList;if(p.render||p.pick){let I=this._colorCommands,R=this._blendOption===Fi.OPAQUE,O=this._blendOption===Fi.OPAQUE_AND_TRANSLUCENT,L=this._vaf.va,_=L.length,C=this._uniforms,w;l(this._batchTable)?(C=this._batchTable.getUniformMapCallback()(C),w=this._batchTable.getPickId()):w="v_pickColor",I.length=_;let P=O?_*2:_;for(let M=0;M<P;++M){let F=I[M];l(F)||(F=I[M]=new at);let V=R||O&&M%2===0;F.pass=V||!O?Ie.OPAQUE:Ie.TRANSLUCENT,F.owner=this;let B=O?Math.floor(M/2):M;F.boundingVolume=m,F.modelMatrix=y,F.count=L[B].indicesCount,F.shaderProgram=V?this._sp:this._spTranslucent,F.uniformMap=C,F.vertexArray=L[B].va,F.renderState=V?this._rsOpaque:this._rsTranslucent,F.debugShowBoundingVolume=this.debugShowBoundingVolume,F.pickId=w,F.count=6,F.instanceCount=i,S.push(F)}this.debugShowTextureAtlas&&(l(this.debugCommand)||(this.debugCommand=gut(this,e.context)),S.push(this.debugCommand))}this._allBillboardsReady=r};$d.prototype.isDestroyed=function(){return!1};$d.prototype.destroy=function(){return l(this._removeCallbackFunc)&&(this._removeCallbackFunc(),this._removeCallbackFunc=void 0),this._textureAtlas=this._destroyTextureAtlas&&this._textureAtlas&&this._textureAtlas.destroy(),this._sp=this._sp&&this._sp.destroy(),this._spTranslucent=this._spTranslucent&&this._spTranslucent.destroy(),this._vaf=this._vaf&&this._vaf.destroy(),pxe(this._billboards),le(this)};var Wf=$d;function yut(e,t,n,i,r){return function(){let o=document.createElement("canvas"),s=r+2*i;o.height=o.width=s;let a=o.getContext("2d");return a.clearRect(0,0,s,s),i!==0&&(a.beginPath(),a.arc(s/2,s/2,s/2,0,2*Math.PI,!0),a.closePath(),a.fillStyle=n,a.fill(),e<1&&(a.save(),a.globalCompositeOperation="destination-out",a.beginPath(),a.arc(s/2,s/2,r/2,0,2*Math.PI,!0),a.closePath(),a.fillStyle="black",a.fill(),a.restore())),a.beginPath(),a.arc(s/2,s/2,r/2,0,2*Math.PI,!0),a.closePath(),a.fillStyle=t,a.fill(),o}}var RT=yut;var Aut=new he,xm=class{constructor(t,n,i,r,o){this._content=t,this._billboard=i,this._label=r,this._polyline=o,this._batchId=n,this._billboardImage=void 0,this._billboardColor=void 0,this._billboardOutlineColor=void 0,this._billboardOutlineWidth=void 0,this._billboardSize=void 0,this._pointSize=void 0,this._color=void 0,this._pointSize=void 0,this._pointOutlineColor=void 0,this._pointOutlineWidth=void 0,this._heightOffset=void 0,this._pickIds=new Array(3),aw(this)}get show(){return this._label.show}set show(t){this._label.show=t,this._billboard.show=t,this._polyline.show=t}get color(){return this._color}set color(t){this._color=z.clone(t,this._color),aw(this)}get pointSize(){return this._pointSize}set pointSize(t){this._pointSize=t,aw(this)}get pointOutlineColor(){return this._pointOutlineColor}set pointOutlineColor(t){this._pointOutlineColor=z.clone(t,this._pointOutlineColor),aw(this)}get pointOutlineWidth(){return this._pointOutlineWidth}set pointOutlineWidth(t){this._pointOutlineWidth=t,aw(this)}get labelColor(){return this._label.fillColor}set labelColor(t){this._label.fillColor=t,this._polyline.show=this._label.show&&t.alpha>0}get labelOutlineColor(){return this._label.outlineColor}set labelOutlineColor(t){this._label.outlineColor=t}get labelOutlineWidth(){return this._label.outlineWidth}set labelOutlineWidth(t){this._label.outlineWidth=t}get font(){return this._label.font}set font(t){this._label.font=t}get labelStyle(){return this._label.style}set labelStyle(t){this._label.style=t}get labelText(){return this._label.text}set labelText(t){l(t)||(t=""),this._label.text=t}get backgroundColor(){return this._label.backgroundColor}set backgroundColor(t){this._label.backgroundColor=t}get backgroundPadding(){return this._label.backgroundPadding}set backgroundPadding(t){this._label.backgroundPadding=t}get backgroundEnabled(){return this._label.showBackground}set backgroundEnabled(t){this._label.showBackground=t}get scaleByDistance(){return this._label.scaleByDistance}set scaleByDistance(t){this._label.scaleByDistance=t,this._billboard.scaleByDistance=t}get translucencyByDistance(){return this._label.translucencyByDistance}set translucencyByDistance(t){this._label.translucencyByDistance=t,this._billboard.translucencyByDistance=t}get distanceDisplayCondition(){return this._label.distanceDisplayCondition}set distanceDisplayCondition(t){this._label.distanceDisplayCondition=t,this._polyline.distanceDisplayCondition=t,this._billboard.distanceDisplayCondition=t}get heightOffset(){return this._heightOffset}set heightOffset(t){let n=this._heightOffset??0,i=this._content.tileset.ellipsoid,r=i.cartesianToCartographic(this._billboard.position,Aut);r.height=r.height-n+t;let o=i.cartographicToCartesian(r);this._billboard.position=o,this._label.position=this._billboard.position,this._polyline.positions=[this._polyline.positions[0],o],this._heightOffset=t}get anchorLineEnabled(){return this._polyline.show}set anchorLineEnabled(t){this._polyline.show=t}get anchorLineColor(){return this._polyline.material.uniforms.color}set anchorLineColor(t){this._polyline.material.uniforms.color=z.clone(t,this._polyline.material.uniforms.color)}get image(){return this._billboardImage}set image(t){let n=this._billboardImage!==t;this._billboardImage=t,n&&aw(this)}get disableDepthTestDistance(){return this._label.disableDepthTestDistance}set disableDepthTestDistance(t){this._label.disableDepthTestDistance=t,this._billboard.disableDepthTestDistance=t}get horizontalOrigin(){return this._billboard.horizontalOrigin}set horizontalOrigin(t){this._billboard.horizontalOrigin=t}get verticalOrigin(){return this._billboard.verticalOrigin}set verticalOrigin(t){this._billboard.verticalOrigin=t}get labelHorizontalOrigin(){return this._label.horizontalOrigin}set labelHorizontalOrigin(t){this._label.horizontalOrigin=t}get labelVerticalOrigin(){return this._label.verticalOrigin}set labelVerticalOrigin(t){this._label.verticalOrigin=t}get content(){return this._content}get tileset(){return this._content.tileset}get primitive(){return this._content.tileset}get pickIds(){let t=this._pickIds;return t[0]=this._billboard.pickId,t[1]=this._label.pickId,t[2]=this._polyline.pickId,t}hasProperty(t){return this._content.batchTable.hasProperty(this._batchId,t)}getPropertyIds(t){return this._content.batchTable.getPropertyIds(this._batchId,t)}getProperty(t){return this._content.batchTable.getProperty(this._batchId,t)}getPropertyInherited(t){return na.getPropertyInherited(this._content,this._batchId,t)}setProperty(t,n){this._content.batchTable.setProperty(this._batchId,t,n),this._content.featurePropertiesDirty=!0}isExactClass(t){return this._content.batchTable.isExactClass(this._batchId,t)}isClass(t){return this._content.batchTable.isClass(this._batchId,t)}getExactClassName(){return this._content.batchTable.getExactClassName(this._batchId)}};ut(xm,"defaultColor",z.WHITE),ut(xm,"defaultPointOutlineColor",z.BLACK),ut(xm,"defaultPointOutlineWidth",0),ut(xm,"defaultPointSize",8);function aw(e){let t=e._billboard;if(l(e._billboardImage)&&e._billboardImage!==t.image){t.image=e._billboardImage;return}if(l(e._billboardImage))return;let n=e._color??xm.defaultColor,i=e._pointOutlineColor??xm.defaultPointOutlineColor,r=e._pointOutlineWidth??xm.defaultPointOutlineWidth,o=e._pointSize??xm.defaultPointSize,s=e._billboardColor,a=e._billboardOutlineColor,c=e._billboardOutlineWidth,u=e._billboardSize;if(z.equals(n,s)&&z.equals(i,a)&&r===c&&o===u)return;e._billboardColor=z.clone(n,e._billboardColor),e._billboardOutlineColor=z.clone(i,e._billboardOutlineColor),e._billboardOutlineWidth=r,e._billboardSize=o;let f=n.alpha,d=n.toCssColorString(),p=i.toCssColorString(),g=JSON.stringify([d,o,p,r]);t.setImage(g,RT(f,d,p,r,o))}var o_=xm;function but(e,t){let n=e.measureText(t);if(!/\S/.test(t))return{width:n.width,height:0,ascent:0,descent:0,minx:0};let r=Math.round(n.actualBoundingBoxAscent),o=Math.round(n.actualBoundingBoxDescent),s=Math.max(r+o,1);return{width:n.width,height:s,ascent:r,descent:o,minx:-Math.round(n.actualBoundingBoxLeft)}}var OT;function xut(e,t){if(e==="")return;t=t??H.EMPTY_OBJECT;let n=t.font??"10px sans-serif",i=t.stroke??!1,r=t.fill??!0,o=t.strokeWidth??1,s=t.backgroundColor??z.TRANSPARENT,a=t.padding??0,c=a*2,u=document.createElement("canvas");u.width=1,u.height=1,u.style.font=n;let f=u.getContext("2d",{willReadFrequently:!0});l(OT)||(l(f.imageSmoothingEnabled)?OT="imageSmoothingEnabled":l(f.mozImageSmoothingEnabled)?OT="mozImageSmoothingEnabled":l(f.webkitImageSmoothingEnabled)?OT="webkitImageSmoothingEnabled":l(f.msImageSmoothingEnabled)&&(OT="msImageSmoothingEnabled")),f.font=n,f.lineJoin="round",f.lineWidth=o,f[OT]=!1,u.style.visibility="hidden",document.body.appendChild(u);let d=but(f,e);u.dimensions=d,document.body.removeChild(u),u.style.visibility="";let p=!/\S/.test(e),g=i&&!p?Math.ceil(o/2):0,m=g*2,y=-d.minx+g,A=Math.ceil(d.width)+y+c+g,b=d.height+c+m,x=d.ascent+a+g;if(u.width=A,u.height=b,f.font=n,f.lineJoin="round",f.lineWidth=o,f[OT]=!1,s!==z.TRANSPARENT&&(f.fillStyle=s.toCssColorString(),f.fillRect(0,0,u.width,u.height)),i){let T=t.strokeColor??z.BLACK;f.strokeStyle=T.toCssColorString(),f.strokeText(e,y+a,x)}if(r){let T=t.fillColor??z.WHITE;f.fillStyle=T.toCssColorString(),f.fillText(e,y+a,x)}return u}var MT=xut;var Uxe=Qo(Dxe(),1);var Rxe={FILL:0,OUTLINE:1,FILL_AND_OUTLINE:2};Object.freeze(Rxe);var Ao=Rxe;var Oxe={},Mxe=0,Eut=256,Cut=new z(.165,.165,.165,.8),vut=new U(7,5),oa=Object.freeze({LTR:0,RTL:1,WEAK:2,BRACKETS:3});function NT(e){!e._rebindAllGlyphs&&!e._repositionAllGlyphs&&e._labelCollection._labelsToUpdate.push(e),e._rebindAllGlyphs=!0}function E2(e){!e._rebindAllGlyphs&&!e._repositionAllGlyphs&&e._labelCollection._labelsToUpdate.push(e),e._repositionAllGlyphs=!0}function C2(e,t){return document.defaultView.getComputedStyle(e,null).getPropertyValue(t)}function Lxe(e){let t=Oxe[e._font];if(!l(t)){let n=document.createElement("div");n.style.position="absolute",n.style.opacity=0,n.style.font=e._font,document.body.appendChild(n);let i=parseFloat(C2(n,"line-height"));isNaN(i)&&(i=void 0),t={family:C2(n,"font-family"),size:C2(n,"font-size").replace("px",""),style:C2(n,"font-style"),weight:C2(n,"font-weight"),lineHeight:i},document.body.removeChild(n),Mxe<Eut&&(Oxe[e._font]=t,Mxe++)}e._fontFamily=t.family,e._fontSize=t.size,e._fontStyle=t.style,e._fontWeight=t.weight,e._lineHeight=t.lineHeight}function Tm(e,t){e=e??H.EMPTY_OBJECT;let n=e.translucencyByDistance,i=e.pixelOffsetScaleByDistance,r=e.scaleByDistance,o=e.distanceDisplayCondition;l(n)&&(n=qt.clone(n)),l(i)&&(i=qt.clone(i)),l(r)&&(r=qt.clone(r)),l(o)&&(o=Ht.clone(o)),this._renderedText=void 0,this._text=void 0,this._show=e.show??!0,this._font=e.font??"30px sans-serif",this._fillColor=z.clone(e.fillColor??z.WHITE),this._outlineColor=z.clone(e.outlineColor??z.BLACK),this._outlineWidth=e.outlineWidth??1,this._showBackground=e.showBackground??!1,this._backgroundColor=z.clone(e.backgroundColor??Cut),this._backgroundPadding=U.clone(e.backgroundPadding??vut),this._style=e.style??Ao.FILL,this._verticalOrigin=e.verticalOrigin??Gn.BASELINE,this._horizontalOrigin=e.horizontalOrigin??zi.LEFT,this._pixelOffset=U.clone(e.pixelOffset??U.ZERO),this._eyeOffset=h.clone(e.eyeOffset??h.ZERO),this._position=h.clone(e.position??h.ZERO),this._scale=e.scale??1,this._id=e.id,this._translucencyByDistance=n,this._pixelOffsetScaleByDistance=i,this._scaleByDistance=r,this._heightReference=e.heightReference??We.NONE,this._distanceDisplayCondition=o,this._disableDepthTestDistance=e.disableDepthTestDistance,this._labelCollection=t,this._glyphs=[],this._backgroundBillboard=void 0,this._batchIndex=void 0,this._rebindAllGlyphs=!0,this._repositionAllGlyphs=!0,this._actualClampedPosition=void 0,this._removeCallbackFunc=void 0,this._lastSurfaceHeight=void 0,this._lastSurfaceQueryFrame=-1,this._lastSurfaceQueryMissed=!1,this._clampedToSurface=!1,this._clampingCartesian=void 0,this._clampingHeight=0,this._clampingHeightValid=!1,this._mode=void 0,this._clusterShow=!0,this.text=e.text??"",this._relativeSize=1,Lxe(this),this._updateClamping()}Object.defineProperties(Tm.prototype,{show:{get:function(){return this._show},set:function(e){if(this._show!==e){this._show=e;let t=this._glyphs;for(let i=0,r=t.length;i<r;i++){let o=t[i].billboard;l(o)&&(o.show=e)}let n=this._backgroundBillboard;l(n)&&(n.show=e)}}},position:{get:function(){return this._position},set:function(e){let t=this._position;if(!WZ(t,e)){IT(e,t);let n=this._glyphs;for(let r=0,o=n.length;r<o;r++){let s=n[r].billboard;l(s)&&(s.position=e)}let i=this._backgroundBillboard;l(i)&&(i.position=e),this._updateClamping()}}},heightReference:{get:function(){return this._heightReference},set:function(e){if(e!==this._heightReference){this._heightReference=e;let t=this._glyphs;for(let i=0,r=t.length;i<r;i++){let o=t[i].billboard;l(o)&&(o.heightReference=e)}let n=this._backgroundBillboard;l(n)&&(n.heightReference=e),E2(this),this._updateClamping()}}},text:{get:function(){return this._text},set:function(e){if(this._text!==e){this._text=e;let t=Tm.filterUnsupportedCharacters(e);this._renderedText=Tm.enableRightToLeftDetection?Rut(t):t,NT(this)}}},font:{get:function(){return this._font},set:function(e){this._font!==e&&(this._font=e,NT(this),Lxe(this))}},fillColor:{get:function(){return this._fillColor},set:function(e){let t=this._fillColor;z.equals(t,e)||(z.clone(e,t),NT(this))}},outlineColor:{get:function(){return this._outlineColor},set:function(e){let t=this._outlineColor;z.equals(t,e)||(z.clone(e,t),NT(this))}},outlineWidth:{get:function(){return this._outlineWidth},set:function(e){this._outlineWidth!==e&&(this._outlineWidth=e,NT(this))}},showBackground:{get:function(){return this._showBackground},set:function(e){this._showBackground!==e&&(this._showBackground=e,NT(this))}},backgroundColor:{get:function(){return this._backgroundColor},set:function(e){let t=this._backgroundColor;if(!z.equals(t,e)){z.clone(e,t);let n=this._backgroundBillboard;l(n)&&(n.color=t)}}},backgroundPadding:{get:function(){return this._backgroundPadding},set:function(e){let t=this._backgroundPadding;U.equals(t,e)||(U.clone(e,t),E2(this))}},style:{get:function(){return this._style},set:function(e){this._style!==e&&(this._style=e,NT(this))}},pixelOffset:{get:function(){return this._pixelOffset},set:function(e){let t=this._pixelOffset;if(!U.equals(t,e)){U.clone(e,t);let n=this._glyphs;for(let r=0,o=n.length;r<o;r++){let s=n[r];l(s.billboard)&&(s.billboard.pixelOffset=e)}let i=this._backgroundBillboard;l(i)&&(i.pixelOffset=e)}}},translucencyByDistance:{get:function(){return this._translucencyByDistance},set:function(e){let t=this._translucencyByDistance;if(!qt.equals(t,e)){this._translucencyByDistance=qt.clone(e,t);let n=this._glyphs;for(let r=0,o=n.length;r<o;r++){let s=n[r];l(s.billboard)&&(s.billboard.translucencyByDistance=e)}let i=this._backgroundBillboard;l(i)&&(i.translucencyByDistance=e)}}},pixelOffsetScaleByDistance:{get:function(){return this._pixelOffsetScaleByDistance},set:function(e){let t=this._pixelOffsetScaleByDistance;if(!qt.equals(t,e)){this._pixelOffsetScaleByDistance=qt.clone(e,t);let n=this._glyphs;for(let r=0,o=n.length;r<o;r++){let s=n[r];l(s.billboard)&&(s.billboard.pixelOffsetScaleByDistance=e)}let i=this._backgroundBillboard;l(i)&&(i.pixelOffsetScaleByDistance=e)}}},scaleByDistance:{get:function(){return this._scaleByDistance},set:function(e){let t=this._scaleByDistance;if(!qt.equals(t,e)){this._scaleByDistance=qt.clone(e,t);let n=this._glyphs;for(let r=0,o=n.length;r<o;r++){let s=n[r];l(s.billboard)&&(s.billboard.scaleByDistance=e)}let i=this._backgroundBillboard;l(i)&&(i.scaleByDistance=e)}}},eyeOffset:{get:function(){return this._eyeOffset},set:function(e){let t=this._eyeOffset;if(!h.equals(t,e)){h.clone(e,t);let n=this._glyphs;for(let r=0,o=n.length;r<o;r++){let s=n[r];l(s.billboard)&&(s.billboard.eyeOffset=e)}let i=this._backgroundBillboard;l(i)&&(i.eyeOffset=e)}}},horizontalOrigin:{get:function(){return this._horizontalOrigin},set:function(e){this._horizontalOrigin!==e&&(this._horizontalOrigin=e,E2(this))}},verticalOrigin:{get:function(){return this._verticalOrigin},set:function(e){if(this._verticalOrigin!==e){this._verticalOrigin=e;let t=this._glyphs;for(let i=0,r=t.length;i<r;i++){let o=t[i];l(o.billboard)&&(o.billboard.verticalOrigin=e)}let n=this._backgroundBillboard;l(n)&&(n.verticalOrigin=e),E2(this)}}},scale:{get:function(){return this._scale},set:function(e){if(this._scale!==e){this._scale=e;let t=this._glyphs;for(let i=0,r=t.length;i<r;i++){let o=t[i];l(o.billboard)&&(o.billboard.scale=e*this._relativeSize)}let n=this._backgroundBillboard;l(n)&&(n.scale=e*this._relativeSize),E2(this)}}},totalScale:{get:function(){return this._scale*this._relativeSize}},distanceDisplayCondition:{get:function(){return this._distanceDisplayCondition},set:function(e){if(!Ht.equals(e,this._distanceDisplayCondition)){this._distanceDisplayCondition=Ht.clone(e,this._distanceDisplayCondition);let t=this._glyphs;for(let i=0,r=t.length;i<r;i++){let o=t[i];l(o.billboard)&&(o.billboard.distanceDisplayCondition=e)}let n=this._backgroundBillboard;l(n)&&(n.distanceDisplayCondition=e)}}},disableDepthTestDistance:{get:function(){return this._disableDepthTestDistance},set:function(e){if(this._disableDepthTestDistance!==e){this._disableDepthTestDistance=e;let t=this._glyphs;for(let i=0,r=t.length;i<r;i++){let o=t[i];l(o.billboard)&&(o.billboard.disableDepthTestDistance=e)}let n=this._backgroundBillboard;l(n)&&(n.disableDepthTestDistance=e)}}},id:{get:function(){return this._id},set:function(e){if(this._id!==e){this._id=e;let t=this._glyphs;for(let i=0,r=t.length;i<r;i++){let o=t[i];l(o.billboard)&&(o.billboard.id=e)}let n=this._backgroundBillboard;l(n)&&(n.id=e)}}},pickId:{get:function(){if(!(this._glyphs.length===0||!l(this._glyphs[0].billboard)))return this._glyphs[0].billboard.pickId}},_clampedPosition:{get:function(){return this._actualClampedPosition},set:function(e){this._actualClampedPosition=IT(e,this._actualClampedPosition);let t=this._glyphs;for(let i=0,r=t.length;i<r;i++){let o=t[i];l(o.billboard)&&(o.billboard._clampedPosition=e)}let n=this._backgroundBillboard;l(n)&&(n._clampedPosition=e)}},clusterShow:{get:function(){return this._clusterShow},set:function(e){if(this._clusterShow!==e){this._clusterShow=e;let t=this._glyphs;for(let i=0,r=t.length;i<r;i++){let o=t[i];l(o.billboard)&&(o.billboard.clusterShow=e)}let n=this._backgroundBillboard;l(n)&&(n.clusterShow=e)}}},ready:{get:function(){if(this._rebindAllGlyphs||this._repositionAllGlyphs||l(this._backgroundBillboard)&&!this._backgroundBillboard.ready)return!1;let e=this._glyphs;for(let t=0,n=e.length;t<n;t++){let i=e[t];if(l(i.billboard)&&!i.billboard.ready)return!1}return!0}}});Tm.prototype._updateClamping=function(){Br._updateClamping(this._labelCollection,this)};Tm.prototype.computeScreenSpacePosition=function(e,t){l(t)||(t=new U);let i=this._labelCollection.modelMatrix,r=l(this._actualClampedPosition)?this._actualClampedPosition:this._position;return Br._computeScreenSpacePosition(i,r,this._eyeOffset,this._pixelOffset,e,t)};Tm.getScreenSpaceBoundingBox=function(e,t,n){let i,r,o,s,a=e.totalScale,c=e._backgroundBillboard;if(l(c))i=t.x+c._translate.x,r=t.y-c._translate.y,o=c.width*a,s=c.height*a,e.verticalOrigin===Gn.BOTTOM||e.verticalOrigin===Gn.BASELINE?r-=s:e.verticalOrigin===Gn.CENTER&&(r-=s*.5);else{i=Number.POSITIVE_INFINITY,r=Number.POSITIVE_INFINITY;let u=0,f=0,d=e._glyphs,p=d.length;for(let g=0;g<p;++g){let m=d[g],y=m.billboard;if(!l(y))continue;let A=t.x+y._translate.x,b=t.y-y._translate.y,x=m.dimensions.width*a,T=m.dimensions.height*a;e.verticalOrigin===Gn.BOTTOM||e.verticalOrigin===Gn.BASELINE?b-=T:e.verticalOrigin===Gn.CENTER&&(b-=T*.5),e._verticalOrigin===Gn.TOP?b+=Ga.PADDING*a:(e._verticalOrigin===Gn.BOTTOM||e._verticalOrigin===Gn.BASELINE)&&(b-=Ga.PADDING*a),i=Math.min(i,A),r=Math.min(r,b),u=Math.max(u,A+x),f=Math.max(f,b+T)}o=u-i,s=f-r}return l(n)||(n=new et),n.x=i,n.y=r,n.width=o,n.height=s,n};Tm.filterUnsupportedCharacters=function(e){let t=new RegExp(/[\u0000-\u0008\u000E-\u001F\u00ad\u202a-\u206f\u200b-\u200f]/,"g");return e.replace(t,"")};Tm.prototype.equals=function(e){return this===e||l(e)&&this._show===e._show&&this._scale===e._scale&&this._outlineWidth===e._outlineWidth&&this._showBackground===e._showBackground&&this._style===e._style&&this._verticalOrigin===e._verticalOrigin&&this._horizontalOrigin===e._horizontalOrigin&&this._heightReference===e._heightReference&&this._renderedText===e._renderedText&&this._font===e._font&&h.equals(this._position,e._position)&&z.equals(this._fillColor,e._fillColor)&&z.equals(this._outlineColor,e._outlineColor)&&z.equals(this._backgroundColor,e._backgroundColor)&&U.equals(this._backgroundPadding,e._backgroundPadding)&&U.equals(this._pixelOffset,e._pixelOffset)&&h.equals(this._eyeOffset,e._eyeOffset)&&qt.equals(this._translucencyByDistance,e._translucencyByDistance)&&qt.equals(this._pixelOffsetScaleByDistance,e._pixelOffsetScaleByDistance)&&qt.equals(this._scaleByDistance,e._scaleByDistance)&&Ht.equals(this._distanceDisplayCondition,e._distanceDisplayCondition)&&this._disableDepthTestDistance===e._disableDepthTestDistance&&this._id===e._id};Tm.prototype.isDestroyed=function(){return!1};Tm.enableRightToLeftDetection=!1;function Sut(e,t){let n=/[a-zA-Z0-9]/,i=/[()[\]{}<>]/,r=[],o="",s=oa.LTR,a="",c=e.length;for(let u=0;u<c;++u){let f=e.charAt(u);t.test(f)?a=oa.RTL:n.test(f)?a=oa.LTR:i.test(f)?a=oa.BRACKETS:a=oa.WEAK,u===0&&(s=a),s===a&&a!==oa.BRACKETS?o+=f:(o!==""&&r.push({Type:s,Word:o}),s=a,o=f)}return r.push({Type:a,Word:o}),r}function wut(e){return e.split("").reverse().join("")}function v2(e,t,n){return e.slice(0,t)+n+e.slice(t)}function Iut(e){switch(e){case"(":return")";case")":return"(";case"[":return"]";case"]":return"[";case"{":return"}";case"}":return"{";case"<":return">";case">":return"<"}}var Put="\u05D0-\u05EA",Dut="\u0600-\u06FF\u0750-\u077F\u08A0-\u08FF",Nxe=new RegExp(`[${Put}${Dut}]`);function Rut(e){let t=e.split(` -`),n="";for(let i=0;i<t.length;i++){let r=t[i],o=Nxe.test(r.charAt(0)),s=Sut(r,Nxe),a=0,c="";for(let u=0;u<s.length;++u){let f=s[u],d=f.Type===oa.BRACKETS?Iut(f.Word):wut(f.Word);o?f.Type===oa.RTL?(c=d+c,a=0):f.Type===oa.LTR?(c=v2(c,a,f.Word),a+=f.Word.length):(f.Type===oa.WEAK||f.Type===oa.BRACKETS)&&(f.Type===oa.WEAK&&s[u-1].Type===oa.BRACKETS?c=d+c:s[u-1].Type===oa.RTL?(c=d+c,a=0):s.length>u+1?s[u+1].Type===oa.RTL?(c=d+c,a=0):(c=v2(c,a,f.Word),a+=f.Word.length):c=v2(c,0,d)):f.Type===oa.RTL?c=v2(c,a,d):f.Type===oa.LTR?(c+=f.Word,a=c.length):(f.Type===oa.WEAK||f.Type===oa.BRACKETS)&&(u>0&&s[u-1].Type===oa.RTL?s.length>u+1?s[u+1].Type===oa.RTL?c=v2(c,a,d):(c+=f.Word,a=c.length):c+=f.Word:(c+=f.Word,a=c.length))}n+=c,i<t.length-1&&(n+=` -`)}return n}var RA=Tm;var zxe=Qo(Fxe(),1);function Mut(){this.dimensions=void 0,this.billboardTexture=void 0,this.billboard=void 0}var Nut=1.2,Bxe="ID_WHITE_PIXEL",eQ=new U(4,4),Lut=new et(1,1,1,1);function Fut(e,t){let n=t._backgroundBillboardTexture;if(!n.hasImage){let r=document.createElement("canvas");r.width=eQ.x,r.height=eQ.y;let o=r.getContext("2d");o.fillStyle="#fff",o.fillRect(0,0,r.width,r.height),n.loadImage(Bxe,r),n.addImageSubRegion(Bxe,Lut)}let i=e.add({collection:t});return i.setImageTexture(n),i._positionFromParent=!0,i._labelTranslate=new U,i}var s_={};function But(e,t,n,i,r,o){return s_.font=t,s_.fillColor=n,s_.strokeColor=i,s_.strokeWidth=r,s_.padding=Ga.PADDING,s_.fill=o===Ao.FILL||o===Ao.FILL_AND_OUTLINE,s_.stroke=o===Ao.OUTLINE||o===Ao.FILL_AND_OUTLINE,s_.backgroundColor=z.BLACK,MT(e,s_)}function tQ(e,t){let n=t.billboard;l(n)&&(n.show=!1,n._clampedPosition=void 0,l(n._removeCallbackFunc)&&(n._removeCallbackFunc(),n._removeCallbackFunc=void 0),e._spareBillboards.push(n),t.billboard=void 0)}var kut=new zxe.default,Uut=/\s/;function zut(e,t){let n=t._renderedText,i=kut.splitGraphemes(n),r=i.length,o=t._glyphs,s=o.length;if(t._relativeSize=t._fontSize/Ga.FONT_SIZE,r<s)for(let p=r;p<s;++p)tQ(e,o[p]);o.length=r;let a=t._backgroundBillboard,c=e._backgroundBillboardCollection;t._showBackground&&!l(a)&&(a=Fut(c,e),t._backgroundBillboard=a),Vut(c,t,a);let u=e._glyphBillboardCollection,f=u.billboardTextureCache,d=e._textDimensionsCache;for(let p=0;p<r;++p){let g=i[p],m=t._verticalOrigin,y=JSON.stringify([g,t._fontFamily,t._fontStyle,t._fontWeight,+m]),A=d[y],b=f.get(y);if(!l(b)||!l(A)){b=new r_(u),f.set(y,b);let v=`${t._fontStyle} ${t._fontWeight} ${Ga.FONT_SIZE}px ${t._fontFamily}`,S=But(g,v,z.WHITE,z.WHITE,0,Ao.FILL);if(A=S.dimensions,d[y]=A,S.width>0&&S.height>0&&!Uut.test(g)){let I=(0,Uxe.default)(S,{cutoff:Ga.CUTOFF,radius:Ga.RADIUS}),R=S.getContext("2d"),O=S.width,L=S.height,_=R.getImageData(0,0,O,L);for(let C=0;C<O;C++)for(let w=0;w<L;w++){let P=w*O+C,M=I[P]*255,F=P*4;_.data[F+0]=M,_.data[F+1]=M,_.data[F+2]=M,_.data[F+3]=M}R.putImageData(_,0,0),b.loadImage(y,S)}}let x=o[p];if(l(x)||(x=new Mut,x.dimensions=A,x.billboardTexture=b,o[p]=x),x.billboardTexture.id!==y&&(x.billboardTexture=b,x.dimensions=A),!b.hasImage){tQ(e,x);continue}let T=x.billboard,E=e._spareBillboards;l(T)||(E.length>0?T=E.pop():(T=u.add({collection:e}),T._labelDimensions=new U,T._labelTranslate=new U,T._positionFromParent=!0),x.billboard=T),T.setImageTexture(b),T.show=t._show,T.position=t._position,T.eyeOffset=t._eyeOffset,T.pixelOffset=t._pixelOffset,T.horizontalOrigin=zi.LEFT,T.verticalOrigin=t._verticalOrigin,T.heightReference=t._heightReference,l(t._clampedPosition)&&(T._clampedPosition=t._clampedPosition),T.scale=t.totalScale,T.pickPrimitive=t,T.id=t._id,T.translucencyByDistance=t._translucencyByDistance,T.pixelOffsetScaleByDistance=t._pixelOffsetScaleByDistance,T.scaleByDistance=t._scaleByDistance,T.distanceDisplayCondition=t._distanceDisplayCondition,T.disableDepthTestDistance=t._disableDepthTestDistance,T._batchIndex=t._batchIndex,T.outlineColor=t.outlineColor,t.style===Ao.FILL_AND_OUTLINE?(T.color=t._fillColor,T.outlineWidth=t.outlineWidth):t.style===Ao.FILL?(T.color=t._fillColor,T.outlineWidth=0):t.style===Ao.OUTLINE&&(T.color=z.TRANSPARENT,T.outlineWidth=t.outlineWidth)}t._repositionAllGlyphs=!0}function Vut(e,t,n){if(!l(n))return;let i=t.show&&t._showBackground&&t._renderedText.split(` -`).join("").length>0;if(t.show&&!i){e.remove(n),t._backgroundBillboard=void 0;return}n.color=t._backgroundColor,n.show=t._show,n.position=t._position,n.eyeOffset=t._eyeOffset,n.pixelOffset=t._pixelOffset,n.horizontalOrigin=zi.LEFT,n.verticalOrigin=t._verticalOrigin,n.heightReference=t._heightReference,l(t._clampedPosition)&&(n._clampedPosition=t._clampedPosition),n.scale=t.totalScale,n.pickPrimitive=t,n.id=t._id,n.translucencyByDistance=t._translucencyByDistance,n.pixelOffsetScaleByDistance=t._pixelOffsetScaleByDistance,n.scaleByDistance=t._scaleByDistance,n.distanceDisplayCondition=t._distanceDisplayCondition,n.disableDepthTestDistance=t._disableDepthTestDistance,n.clusterShow=t.clusterShow}function kxe(e,t,n){return t===zi.CENTER?-e/2:t===zi.RIGHT?-(e+n.x):n.x}var qo=new U,jut=new U;function Hut(e){let t=e._glyphs,n=e._renderedText,i=0,r=0,o=[],s=Number.NEGATIVE_INFINITY,a=0,c=1,u=t.length,f=e._backgroundBillboard,d=U.clone(l(f)?e._backgroundPadding:U.ZERO,jut);d.x/=e._relativeSize,d.y/=e._relativeSize;for(let O=0;O<u;++O){if(n.charAt(O)===` -`){o.push(i),++c,i=0;continue}let _=t[O].dimensions;l(_)&&(a=Math.max(a,_.height-_.descent),s=Math.max(s,_.descent),i+=_.width-_.minx,O<u-1&&(i+=t[O+1].dimensions.minx),r=Math.max(r,i))}o.push(i);let p=a+s,g=e.totalScale,m=e._horizontalOrigin,y=e._verticalOrigin,A=0,b=o[A],x=kxe(b,m,d),T=(l(e._lineHeight)?e._lineHeight:Nut*e._fontSize)/e._relativeSize,E=T*(c-1),v=r,S=p+E;l(f)&&(v+=d.x*2,S+=d.y*2,f._labelHorizontalOrigin=m),qo.x=x*g,qo.y=0;let I=!0,R=0;for(let O=0;O<u;++O){if(n.charAt(O)===` -`){++A,R+=T,b=o[A],x=kxe(b,m,d),qo.x=x*g,I=!0;continue}let L=t[O],_=L.dimensions;if(l(_)&&(y===Gn.TOP?(qo.y=_.height-a-d.y,qo.y+=Ga.PADDING):y===Gn.CENTER?qo.y=(E+_.height-a)/2:y===Gn.BASELINE?(qo.y=E,qo.y-=Ga.PADDING):(qo.y=E+s+d.y,qo.y-=Ga.PADDING),qo.y=(qo.y-_.descent-R)*g,I&&(qo.x-=Ga.PADDING*g,I=!1),l(L.billboard)&&(L.billboard._setTranslate(qo),L.billboard._labelDimensions.x=v,L.billboard._labelDimensions.y=S,L.billboard._labelHorizontalOrigin=m,As(e.heightReference)&&(L.billboard._labelTranslate=U.clone(qo,L.billboard._labelTranslate))),O<u-1)){let C=t[O+1];qo.x+=(_.width-_.minx+C.dimensions.minx)*g}}l(f)&&n.split(` -`).join("").length>0&&(m===zi.CENTER?x=-r/2-d.x:m===zi.RIGHT?x=-(r+d.x*2):x=0,qo.x=x*g,y===Gn.TOP?qo.y=p-a-s:y===Gn.CENTER?qo.y=(p-a)/2-s:y===Gn.BASELINE?qo.y=-d.y-s:qo.y=0,qo.y=qo.y*g,f.width=v,f.height=S,f._setTranslate(qo),f._labelTranslate=U.clone(qo,f._labelTranslate))}function Vxe(e,t){let n=t._glyphs;for(let i=0,r=n.length;i<r;++i)tQ(e,n[i]);l(t._backgroundBillboard)&&(e._backgroundBillboardCollection.remove(t._backgroundBillboard),t._backgroundBillboard=void 0),t._labelCollection=void 0,l(t._removeCallbackFunc)&&t._removeCallbackFunc(),le(t)}function Qp(e){e=e??H.EMPTY_OBJECT,this._scene=e.scene,this._batchTable=e.batchTable;let t=new Wf({scene:this._scene,textureAtlas:new Ex({initialSize:eQ}),coarseDepthTestDistance:e.coarseDepthTestDistance,threePointDepthTestDistance:e.threePointDepthTestDistance});this._backgroundBillboardCollection=t,this._backgroundBillboardTexture=new r_(t),this._glyphBillboardCollection=new Wf({scene:this._scene,batchTable:this._batchTable,coarseDepthTestDistance:e.coarseDepthTestDistance,threePointDepthTestDistance:e.threePointDepthTestDistance}),this._glyphBillboardCollection._sdf=!0,this._spareBillboards=[],this._textDimensionsCache={},this._labels=[],this._labelsToUpdate=[],this._totalGlyphCount=0,this._highlightColor=z.clone(z.WHITE),this.show=e.show??!0,this.modelMatrix=N.clone(e.modelMatrix??N.IDENTITY),this.debugShowBoundingVolume=e.debugShowBoundingVolume??!1,this.blendOption=e.blendOption??Fi.OPAQUE_AND_TRANSLUCENT}Object.defineProperties(Qp.prototype,{length:{get:function(){return this._labels.length}},sizeInBytes:{get:function(){return this._glyphBillboardCollection.sizeInBytes+this._backgroundBillboardCollection.sizeInBytes}},ready:{get:function(){let e=this._backgroundBillboardCollection.get(0);return l(e)&&!e.ready?!1:this._glyphBillboardCollection.ready}},coarseDepthTestDistance:{get:function(){return this._backgroundBillboardCollection.coarseDepthTestDistance},set:function(e){this._backgroundBillboardCollection.coarseDepthTestDistance=e,this._glyphBillboardCollection.coarseDepthTestDistance=e}},threePointDepthTestDistance:{get:function(){return this._backgroundBillboardCollection.threePointDepthTestDistance},set:function(e){this._backgroundBillboardCollection.threePointDepthTestDistance=e,this._glyphBillboardCollection.threePointDepthTestDistance=e}}});Qp.prototype.add=function(e){let t=new RA(e,this);return this._labels.push(t),this._labelsToUpdate.push(t),t};Qp.prototype.remove=function(e){if(l(e)&&e._labelCollection===this){let t=this._labels.indexOf(e);if(t!==-1)return this._labels.splice(t,1),Vxe(this,e),!0}return!1};Qp.prototype.removeAll=function(){let e=this._labels;for(let t=0,n=e.length;t<n;++t)Vxe(this,e[t]);e.length=0};Qp.prototype.contains=function(e){return l(e)&&e._labelCollection===this};Qp.prototype.get=function(e){return this._labels[e]};Qp.prototype.update=function(e){if(!this.show)return;let t=this._glyphBillboardCollection,n=this._backgroundBillboardCollection;t.modelMatrix=this.modelMatrix,t.debugShowBoundingVolume=this.debugShowBoundingVolume,n.modelMatrix=this.modelMatrix,n.debugShowBoundingVolume=this.debugShowBoundingVolume;let i=this._labelsToUpdate.length;for(let o=0;o<i;++o){let s=this._labelsToUpdate[o];if(s.isDestroyed())continue;let a=s._glyphs.length;s._rebindAllGlyphs&&(zut(this,s),s._rebindAllGlyphs=!1),s._repositionAllGlyphs&&(Hut(s),s._repositionAllGlyphs=!1);let c=s._glyphs.length-a;this._totalGlyphCount+=c}let r=n.length>0?Fi.TRANSLUCENT:this.blendOption;t.blendOption=r,n.blendOption=r,t._highlightColor=this._highlightColor,n._highlightColor=this._highlightColor,this._labelsToUpdate.length=0,n.update(e),t.update(e)};Qp.prototype.isDestroyed=function(){return!1};Qp.prototype.destroy=function(){return this.removeAll(),this._glyphBillboardCollection=this._glyphBillboardCollection.destroy(),this._backgroundBillboardCollection=this._backgroundBillboardCollection.destroy(),le(this)};var e0=Qp;var au={};au.numberOfPoints=function(e,t,n){let i=h.distance(e,t);return Math.ceil(i/n)};au.numberOfPointsRhumbLine=function(e,t,n){let i=Math.pow(e.longitude-t.longitude,2)+Math.pow(e.latitude-t.latitude,2);return Math.max(1,Math.ceil(Math.sqrt(i/(n*n))))};var Gut=new he;au.extractHeights=function(e,t){let n=e.length,i=new Array(n);for(let r=0;r<n;r++){let o=e[r];i[r]=t.cartesianToCartographic(o,Gut).height}return i};var Wut=new N,qut=new h,jxe=new h,Yut=new sn(h.UNIT_X,0),Hxe=new h,Xut=new sn(h.UNIT_X,0),Kut=new h,$ut=new h,iQ=[];function Wxe(e,t,n){let i=iQ;i.length=e;let r;if(t===n){for(r=0;r<e;r++)i[r]=t;return i}let s=(n-t)/e;for(r=0;r<e;r++){let a=t+r*s;i[r]=a}return i}var YH=new he,qH=new he,OA=new h,rQ=new h,Jut=new h,nQ=new xg,S2=new Rc;function Zut(e,t,n,i,r,o,s,a){let c=i.scaleToGeodeticSurface(e,rQ),u=i.scaleToGeodeticSurface(t,Jut),f=au.numberOfPoints(e,t,n),d=i.cartesianToCartographic(c,YH),p=i.cartesianToCartographic(u,qH),g=Wxe(f,r,o);nQ.setEndPoints(d,p);let m=nQ.surfaceDistance/f,y=a;d.height=r;let A=i.cartographicToCartesian(d,OA);h.pack(A,s,y),y+=3;for(let b=1;b<f;b++){let x=nQ.interpolateUsingSurfaceDistance(b*m,qH);x.height=g[b],A=i.cartographicToCartesian(x,OA),h.pack(A,s,y),y+=3}return y}function Qut(e,t,n,i,r,o,s,a){let c=i.cartesianToCartographic(e,YH),u=i.cartesianToCartographic(t,qH),f=au.numberOfPointsRhumbLine(c,u,n);c.height=0,u.height=0;let d=Wxe(f,r,o);S2.ellipsoid.equals(i)||(S2=new Rc(void 0,void 0,i)),S2.setEndPoints(c,u);let p=S2.surfaceDistance/f,g=a;c.height=r;let m=i.cartographicToCartesian(c,OA);h.pack(m,s,g),g+=3;for(let y=1;y<f;y++){let A=S2.interpolateUsingSurfaceDistance(y*p,qH);A.height=d[y],m=i.cartographicToCartesian(A,OA),h.pack(m,s,g),g+=3}return g}au.wrapLongitude=function(e,t){let n=[],i=[];if(l(e)&&e.length>0){t=t??N.IDENTITY;let r=N.inverseTransformation(t,Wut),o=N.multiplyByPoint(r,h.ZERO,qut),s=h.normalize(N.multiplyByPointAsVector(r,h.UNIT_Y,jxe),jxe),a=sn.fromPointNormal(o,s,Yut),c=h.normalize(N.multiplyByPointAsVector(r,h.UNIT_X,Hxe),Hxe),u=sn.fromPointNormal(o,c,Xut),f=1;n.push(h.clone(e[0]));let d=n[0],p=e.length;for(let g=1;g<p;++g){let m=e[g];if(sn.getPointDistance(u,d)<0||sn.getPointDistance(u,m)<0){let y=_i.lineSegmentPlane(d,m,a,Kut);if(l(y)){let A=h.multiplyByScalar(s,5e-9,$ut);sn.getPointDistance(a,d)<0&&h.negate(A,A),n.push(h.add(y,A,new h)),i.push(f+1),h.negate(A,A),n.push(h.add(y,A,new h)),f=1}}n.push(h.clone(e[g])),f++,d=m}i.push(f)}return{positions:n,lengths:i}};au.generateArc=function(e){l(e)||(e={});let t=e.positions,n=t.length,i=e.ellipsoid??ee.default,r=e.height??0,o=Array.isArray(r);if(n<1)return[];if(n===1){let y=i.scaleToGeodeticSurface(t[0],rQ);if(r=o?r[0]:r,r!==0){let A=i.geodeticSurfaceNormal(y,OA);h.multiplyByScalar(A,r,A),h.add(y,A,y)}return[y.x,y.y,y.z]}let s=e.minDistance;if(!l(s)){let y=e.granularity??D.RADIANS_PER_DEGREE;s=D.chordLength(y,i.maximumRadius)}let a=0,c;for(c=0;c<n-1;c++)a+=au.numberOfPoints(t[c],t[c+1],s);let u=(a+1)*3,f=new Array(u),d=0;for(c=0;c<n-1;c++){let y=t[c],A=t[c+1],b=o?r[c]:r,x=o?r[c+1]:r;d=Zut(y,A,s,i,b,x,f,d)}iQ.length=0;let p=t[n-1],g=i.cartesianToCartographic(p,YH);g.height=o?r[n-1]:r;let m=i.cartographicToCartesian(g,OA);return h.pack(m,f,u-3),f};var Gxe=new he,eft=new he;au.generateRhumbArc=function(e){l(e)||(e={});let t=e.positions,n=t.length,i=e.ellipsoid??ee.default,r=e.height??0,o=Array.isArray(r);if(n<1)return[];if(n===1){let b=i.scaleToGeodeticSurface(t[0],rQ);if(r=o?r[0]:r,r!==0){let x=i.geodeticSurfaceNormal(b,OA);h.multiplyByScalar(x,r,x),h.add(b,x,b)}return[b.x,b.y,b.z]}let s=e.granularity??D.RADIANS_PER_DEGREE,a=0,c,u=i.cartesianToCartographic(t[0],Gxe),f;for(c=0;c<n-1;c++)f=i.cartesianToCartographic(t[c+1],eft),a+=au.numberOfPointsRhumbLine(u,f,s),u=he.clone(f,Gxe);let d=(a+1)*3,p=new Array(d),g=0;for(c=0;c<n-1;c++){let b=t[c],x=t[c+1],T=o?r[c]:r,E=o?r[c+1]:r;g=Qut(b,x,s,i,T,E,p,g)}iQ.length=0;let m=t[n-1],y=i.cartesianToCartographic(m,YH);y.height=o?r[n-1]:r;let A=i.cartographicToCartesian(y,OA);return h.pack(A,p,d-3),p};au.generateCartesianArc=function(e){let t=au.generateArc(e),n=t.length/3,i=new Array(n);for(let r=0;r<n;r++)i[r]=h.unpack(t,r*3);return i};au.generateCartesianRhumbArc=function(e){let t=au.generateRhumbArc(e),n=t.length/3,i=new Array(n);for(let r=0;r<n;r++)i[r]=h.unpack(t,r*3);return i};var ir=au;function qf(e,t){e=e??H.EMPTY_OBJECT,this._show=e.show??!0,this._width=e.width??1,this._loop=e.loop??!1,this._distanceDisplayCondition=e.distanceDisplayCondition,this._material=e.material,l(this._material)||(this._material=Qi.fromType(Qi.ColorType,{color:new z(1,1,1,1)}));let n=e.positions;l(n)||(n=[]),this._positions=n,this._actualPositions=Fr(n,h.equalsEpsilon),this._loop&&this._actualPositions.length>2&&(this._actualPositions===this._positions&&(this._actualPositions=n.slice()),this._actualPositions.push(h.clone(this._actualPositions[0]))),this._length=this._actualPositions.length,this._id=e.id;let i;l(t)&&(i=N.clone(t.modelMatrix)),this._modelMatrix=i,this._segments=ir.wrapLongitude(this._actualPositions,i),this._actualLength=void 0,this._propertiesChanged=new Uint32Array(Yxe),this._polylineCollection=t,this._dirty=!1,this._pickId=void 0,this._boundingVolume=ue.fromPoints(this._actualPositions),this._boundingVolumeWC=ue.transform(this._boundingVolume,this._modelMatrix),this._boundingVolume2D=new ue}var qxe=qf.POSITION_INDEX=0,tft=qf.SHOW_INDEX=1,nft=qf.WIDTH_INDEX=2,ift=qf.MATERIAL_INDEX=3,w2=qf.POSITION_SIZE_INDEX=4,rft=qf.DISTANCE_DISPLAY_CONDITION=5,Yxe=qf.NUMBER_OF_PROPERTIES=6;function a_(e,t){++e._propertiesChanged[t];let n=e._polylineCollection;l(n)&&(n._updatePolyline(e,t),e._dirty=!0)}Object.defineProperties(qf.prototype,{show:{get:function(){return this._show},set:function(e){e!==this._show&&(this._show=e,a_(this,tft))}},positions:{get:function(){return this._positions},set:function(e){let t=Fr(e,h.equalsEpsilon);this._loop&&t.length>2&&(t===e&&(t=e.slice()),t.push(h.clone(t[0]))),(this._actualPositions.length!==t.length||this._actualPositions.length!==this._length)&&a_(this,w2),this._positions=e,this._actualPositions=t,this._length=t.length,this._boundingVolume=ue.fromPoints(this._actualPositions,this._boundingVolume),this._boundingVolumeWC=ue.transform(this._boundingVolume,this._modelMatrix,this._boundingVolumeWC),a_(this,qxe),this.update()}},material:{get:function(){return this._material},set:function(e){this._material!==e&&(this._material=e,a_(this,ift))}},width:{get:function(){return this._width},set:function(e){let t=this._width;e!==t&&(this._width=e,a_(this,nft))}},loop:{get:function(){return this._loop},set:function(e){if(e!==this._loop){let t=this._actualPositions;e?t.length>2&&!h.equals(t[0],t[t.length-1])&&(t.length===this._positions.length&&(this._actualPositions=t=this._positions.slice()),t.push(h.clone(t[0]))):t.length>2&&h.equals(t[0],t[t.length-1])&&(t.length-1===this._positions.length?this._actualPositions=this._positions:t.pop()),this._loop=e,a_(this,w2)}}},id:{get:function(){return this._id},set:function(e){this._id=e,l(this._pickId)&&(this._pickId.object.id=e)}},pickId:{get:function(){return this._pickId}},isDestroyed:{get:function(){return!l(this._polylineCollection)}},distanceDisplayCondition:{get:function(){return this._distanceDisplayCondition},set:function(e){Ht.equals(e,this._distanceDisplayCondition)||(this._distanceDisplayCondition=Ht.clone(e,this._distanceDisplayCondition),a_(this,rft))}}});qf.prototype.update=function(){let e=N.IDENTITY;l(this._polylineCollection)&&(e=this._polylineCollection.modelMatrix);let t=this._segments.positions.length,n=this._segments.lengths,i=this._propertiesChanged[qxe]>0||this._propertiesChanged[w2]>0;if((!N.equals(e,this._modelMatrix)||i)&&(this._segments=ir.wrapLongitude(this._actualPositions,e),this._boundingVolumeWC=ue.transform(this._boundingVolume,e,this._boundingVolumeWC)),this._modelMatrix=N.clone(e,this._modelMatrix),this._segments.positions.length!==t)a_(this,w2);else{let r=n.length;for(let o=0;o<r;++o)if(n[o]!==this._segments.lengths[o]){a_(this,w2);break}}};qf.prototype.getPickId=function(e){return l(this._pickId)||(this._pickId=e.createPickId({primitive:this,collection:this._polylineCollection,id:this._id})),this._pickId};qf.prototype._clean=function(){this._dirty=!1;let e=this._propertiesChanged;for(let t=0;t<Yxe-1;++t)e[t]=0};qf.prototype._destroy=function(){this._pickId=this._pickId&&this._pickId.destroy(),this._material=this._material&&this._material.destroy(),this._polylineCollection=void 0};var Jd=qf;var oft=Jd.SHOW_INDEX,sft=Jd.WIDTH_INDEX,sQ=Jd.POSITION_INDEX,aft=Jd.MATERIAL_INDEX,Xxe=Jd.POSITION_SIZE_INDEX,cft=Jd.DISTANCE_DISPLAY_CONDITION,tTe=Jd.NUMBER_OF_PROPERTIES,Ku={texCoordExpandAndBatchIndex:0,position3DHigh:1,position3DLow:2,position2DHigh:3,position2DLow:4,prevPosition3DHigh:5,prevPosition3DLow:6,prevPosition2DHigh:7,prevPosition2DLow:8,nextPosition3DHigh:9,nextPosition3DLow:10,nextPosition2DHigh:11,nextPosition2DLow:12};function Em(e){e=e??H.EMPTY_OBJECT,this.show=e.show??!0,this.modelMatrix=N.clone(e.modelMatrix??N.IDENTITY),this._modelMatrix=N.clone(N.IDENTITY),this.debugShowBoundingVolume=e.debugShowBoundingVolume??!1,this._opaqueRS=void 0,this._translucentRS=void 0,this._colorCommands=[],this._polylinesUpdated=!1,this._polylinesRemoved=!1,this._createVertexArray=!1,this._propertiesChanged=new Uint32Array(tTe),this._polylines=[],this._polylineBuckets={},this._positionBufferUsage={bufferUsage:Me.STATIC_DRAW,frameCount:0},this._mode=void 0,this._polylinesToUpdate=[],this._vertexArrays=[],this._positionBuffer=void 0,this._texCoordExpandAndBatchIndexBuffer=void 0,this._batchTable=void 0,this._createBatchTable=!1,this._useHighlightColor=!1,this._highlightColor=z.clone(z.WHITE);let t=this;this._uniformMap={u_highlightColor:function(){return t._highlightColor}}}Object.defineProperties(Em.prototype,{length:{get:function(){return aQ(this),this._polylines.length}}});Em.prototype.add=function(e){let t=new Jd(e,this);return t._index=this._polylines.length,this._polylines.push(t),this._createVertexArray=!0,this._createBatchTable=!0,t};Em.prototype.remove=function(e){if(this.contains(e)){if(this._polylinesRemoved=!0,this._createVertexArray=!0,this._createBatchTable=!0,l(e._bucket)){let t=e._bucket;t.shaderProgram=t.shaderProgram&&t.shaderProgram.destroy()}return e._destroy(),!0}return!1};Em.prototype.removeAll=function(){cQ(this),sTe(this),this._polylineBuckets={},this._polylinesRemoved=!1,this._polylines.length=0,this._polylinesToUpdate.length=0,this._createVertexArray=!0};Em.prototype.contains=function(e){return l(e)&&e._polylineCollection===this};Em.prototype.get=function(e){return aQ(this),this._polylines[e]};function lft(e,t){l(e._batchTable)&&e._batchTable.destroy();let n=[{functionName:"batchTable_getWidthAndShow",componentDatatype:Y.UNSIGNED_BYTE,componentsPerAttribute:2},{functionName:"batchTable_getPickColor",componentDatatype:Y.UNSIGNED_BYTE,componentsPerAttribute:4,normalize:!0},{functionName:"batchTable_getCenterHigh",componentDatatype:Y.FLOAT,componentsPerAttribute:3},{functionName:"batchTable_getCenterLowAndRadius",componentDatatype:Y.FLOAT,componentsPerAttribute:4},{functionName:"batchTable_getDistanceDisplayCondition",componentDatatype:Y.FLOAT,componentsPerAttribute:2}];e._batchTable=new wx(t,n,e._polylines.length)}var nTe=new Sn,iTe=new se,rTe=new U;Em.prototype.update=function(e){if(aQ(this),this._polylines.length===0||!this.show)return;pft(this,e);let t=e.context,n=e.mapProjection,i,r=this._propertiesChanged;if(this._createBatchTable){if(kt.maximumVertexTextureImageUnits===0)throw new oe("Vertex texture fetch support is required to render polylines. The maximum number of vertex texture image units must be greater than zero.");lft(this,t),this._createBatchTable=!1}if(this._createVertexArray||fft(this))Jxe(this,t,n);else if(this._polylinesUpdated){let c=this._polylinesToUpdate;if(this._mode!==re.SCENE3D){let u=c.length;for(let f=0;f<u;++f)i=c[f],i.update()}if(r[Xxe]||r[aft])Jxe(this,t,n);else{let u=c.length,f=this._polylineBuckets;for(let d=0;d<u;++d){i=c[d],r=i._propertiesChanged;let p=i._bucket,g=0;for(let m in f)if(f.hasOwnProperty(m)){if(f[m]===p){r[sQ]&&p.writeUpdate(g,i,this._positionBuffer,n);break}g+=f[m].lengthOfPositions}if((r[oft]||r[sft])&&this._batchTable.setBatchedAttribute(i._index,0,new U(i._width,i._show)),this._batchTable.attributes.length>2){if(r[sQ]||r[Xxe]){let m=e.mode===re.SCENE2D?i._boundingVolume2D:i._boundingVolumeWC,y=Sn.fromCartesian(m.center,nTe),A=se.fromElements(y.low.x,y.low.y,y.low.z,m.radius,iTe);this._batchTable.setBatchedAttribute(i._index,2,y.high),this._batchTable.setBatchedAttribute(i._index,3,A)}if(r[cft]){let m=rTe;m.x=0,m.y=Number.MAX_VALUE;let y=i.distanceDisplayCondition;l(y)&&(m.x=y.near,m.y=y.far),this._batchTable.setBatchedAttribute(i._index,4,m)}}i._clean()}}c.length=0,this._polylinesUpdated=!1}r=this._propertiesChanged;for(let c=0;c<tTe;++c)r[c]=0;let o=N.IDENTITY;e.mode===re.SCENE3D&&(o=this.modelMatrix);let s=e.passes,a=e.morphTime!==0;if((!l(this._opaqueRS)||this._opaqueRS.depthTest.enabled!==a)&&(this._opaqueRS=Ge.fromCache({depthMask:a,depthTest:{enabled:a}})),(!l(this._translucentRS)||this._translucentRS.depthTest.enabled!==a)&&(this._translucentRS=Ge.fromCache({blending:tn.ALPHA_BLEND,depthMask:!a,depthTest:{enabled:a}})),this._batchTable.update(e),s.render||s.pick){let c=this._colorCommands;uft(this,e,c,o)}};var I2=new ue,Kxe=new ue;function uft(e,t,n,i){let r=t.context,o=t.commandList,s=n.length,a=0,c=!0,u=e._vertexArrays,f=e.debugShowBoundingVolume,p=e._batchTable.getUniformMapCallback(),g=u.length;for(let m=0;m<g;++m){let y=u[m],A=y.buckets,b=A.length;for(let x=0;x<b;++x){let T=A[x],E=T.offset,v=T.bucket.shaderProgram,S=T.bucket.polylines,I=S.length,R,O,L=0,_,C;for(let w=0;w<I;++w){let P=S[w],M=hft(P._material);if(M!==R){if(l(R)&&L>0){let j=O.isTranslucent();a>=s?(_=new at({owner:e}),n.push(_)):_=n[a],++a,C=Ot(p(O._uniforms),e._uniformMap),_.boundingVolume=ue.clone(I2,_.boundingVolume),_.modelMatrix=i,_.shaderProgram=v,_.vertexArray=y.va,_.renderState=j?e._translucentRS:e._opaqueRS,_.pass=j?Ie.TRANSLUCENT:Ie.OPAQUE,_.debugShowBoundingVolume=f,_.pickId="v_pickColor",_.uniformMap=C,_.count=L,_.offset=E,E+=L,L=0,c=!0,o.push(_)}O=P._material,O.update(r),R=M}let F=P._locatorBuckets,V=F.length;for(let j=0;j<V;++j){let k=F[j];k.locator===T&&(L+=k.count)}let B;t.mode===re.SCENE3D?B=P._boundingVolumeWC:t.mode===re.COLUMBUS_VIEW?B=P._boundingVolume2D:t.mode===re.SCENE2D?l(P._boundingVolume2D)&&(B=ue.clone(P._boundingVolume2D,Kxe),B.center.x=0):l(P._boundingVolumeWC)&&l(P._boundingVolume2D)&&(B=ue.union(P._boundingVolumeWC,P._boundingVolume2D,Kxe)),c?(c=!1,ue.clone(B,I2)):ue.union(B,I2,I2)}l(R)&&L>0&&(a>=s?(_=new at({owner:e}),n.push(_)):_=n[a],++a,C=Ot(p(O._uniforms),e._uniformMap),_.boundingVolume=ue.clone(I2,_.boundingVolume),_.modelMatrix=i,_.shaderProgram=v,_.vertexArray=y.va,_.renderState=O.isTranslucent()?e._translucentRS:e._opaqueRS,_.pass=O.isTranslucent()?Ie.TRANSLUCENT:Ie.OPAQUE,_.debugShowBoundingVolume=f,_.pickId="v_pickColor",_.uniformMap=C,_.count=L,_.offset=E,c=!0,o.push(_)),R=void 0}}n.length=a}Em.prototype.isDestroyed=function(){return!1};Em.prototype.destroy=function(){return oTe(this),cQ(this),sTe(this),this._batchTable=this._batchTable&&this._batchTable.destroy(),le(this)};function fft(e){let t=!1,n=e._propertiesChanged,i=e._positionBufferUsage;return n[sQ]?(i.bufferUsage!==Me.STREAM_DRAW&&(t=!0,i.bufferUsage=Me.STREAM_DRAW),i.frameCount=100):i.bufferUsage!==Me.STATIC_DRAW&&(i.frameCount===0?(t=!0,i.bufferUsage=Me.STATIC_DRAW):i.frameCount--),t}var $xe=[0,0,0];function Jxe(e,t,n){e._createVertexArray=!1,cQ(e),oTe(e),mft(e);let i=[[]],r,o=e._batchTable,s=e._useHighlightColor,a=[0],c=0,u=[[]],f=0,d=e._polylineBuckets,p,g;for(p in d)d.hasOwnProperty(p)&&(g=d[p],g.updateShader(t,o,s),f+=g.lengthOfPositions);if(f>0){let m=e._mode,y=new Float32Array(6*f*3),A=new Float32Array(f*4),b,x=0,T=0,E=0;for(p in d)if(d.hasOwnProperty(p)){g=d[p],g.write(y,A,x,T,E,o,t,n),m===re.MORPHING&&(l(b)||(b=new Float32Array(6*f*3)),g.writeForMorph(b,x));let C=g.lengthOfPositions;x+=6*C*3,T+=C*4,E+=C*4,c=g.updateIndices(i,a,u,c)}let v=e._positionBufferUsage.bufferUsage,S=Me.STATIC_DRAW;e._positionBuffer=tt.createVertexBuffer({context:t,typedArray:y,usage:v});let I;l(b)&&(I=tt.createVertexBuffer({context:t,typedArray:b,usage:v})),e._texCoordExpandAndBatchIndexBuffer=tt.createVertexBuffer({context:t,typedArray:A,usage:S});let R=3*Float32Array.BYTES_PER_ELEMENT,O=4*Float32Array.BYTES_PER_ELEMENT,L=0,_=i.length;for(let C=0;C<_;++C)if(r=i[C],r.length>0){let w=new Uint16Array(r),P=tt.createIndexBuffer({context:t,typedArray:w,usage:Me.STATIC_DRAW,indexDatatype:je.UNSIGNED_SHORT});L+=a[C];let M=6*(C*(R*D.SIXTY_FOUR_KILOBYTES)-L*R),F=R+M,V=R+F,B=R+V,j=R+B,k=R+j,G=C*(O*D.SIXTY_FOUR_KILOBYTES)-L*O,q=[{index:Ku.position3DHigh,componentsPerAttribute:3,componentDatatype:Y.FLOAT,offsetInBytes:M,strideInBytes:6*R},{index:Ku.position3DLow,componentsPerAttribute:3,componentDatatype:Y.FLOAT,offsetInBytes:F,strideInBytes:6*R},{index:Ku.position2DHigh,componentsPerAttribute:3,componentDatatype:Y.FLOAT,offsetInBytes:M,strideInBytes:6*R},{index:Ku.position2DLow,componentsPerAttribute:3,componentDatatype:Y.FLOAT,offsetInBytes:F,strideInBytes:6*R},{index:Ku.prevPosition3DHigh,componentsPerAttribute:3,componentDatatype:Y.FLOAT,offsetInBytes:V,strideInBytes:6*R},{index:Ku.prevPosition3DLow,componentsPerAttribute:3,componentDatatype:Y.FLOAT,offsetInBytes:B,strideInBytes:6*R},{index:Ku.prevPosition2DHigh,componentsPerAttribute:3,componentDatatype:Y.FLOAT,offsetInBytes:V,strideInBytes:6*R},{index:Ku.prevPosition2DLow,componentsPerAttribute:3,componentDatatype:Y.FLOAT,offsetInBytes:B,strideInBytes:6*R},{index:Ku.nextPosition3DHigh,componentsPerAttribute:3,componentDatatype:Y.FLOAT,offsetInBytes:j,strideInBytes:6*R},{index:Ku.nextPosition3DLow,componentsPerAttribute:3,componentDatatype:Y.FLOAT,offsetInBytes:k,strideInBytes:6*R},{index:Ku.nextPosition2DHigh,componentsPerAttribute:3,componentDatatype:Y.FLOAT,offsetInBytes:j,strideInBytes:6*R},{index:Ku.nextPosition2DLow,componentsPerAttribute:3,componentDatatype:Y.FLOAT,offsetInBytes:k,strideInBytes:6*R},{index:Ku.texCoordExpandAndBatchIndex,componentsPerAttribute:4,componentDatatype:Y.FLOAT,vertexBuffer:e._texCoordExpandAndBatchIndexBuffer,offsetInBytes:G}],Q,W,J,Z;m===re.SCENE3D?(W=e._positionBuffer,Q="vertexBuffer",J=$xe,Z="value"):m===re.SCENE2D||m===re.COLUMBUS_VIEW?(W=$xe,Q="value",J=e._positionBuffer,Z="vertexBuffer"):(W=I,Q="vertexBuffer",J=e._positionBuffer,Z="vertexBuffer"),q[0][Q]=W,q[1][Q]=W,q[2][Z]=J,q[3][Z]=J,q[4][Q]=W,q[5][Q]=W,q[6][Z]=J,q[7][Z]=J,q[8][Q]=W,q[9][Q]=W,q[10][Z]=J,q[11][Z]=J;let ae=new zn({context:t,attributes:q,indexBuffer:P});e._vertexArrays.push({va:ae,buckets:u[C]})}}}function dft(e,t){return t instanceof Dt?t.id:t}var XH=[];function hft(e){let t=Qi._uniformList[e.type],n=t.length;XH.length=2*n;let i=0;for(let r=0;r<n;++r){let o=t[r];XH[i]=o,XH[i+1]=e._uniforms[o](),i+=2}return`${e.type}:${JSON.stringify(XH,dft)}`}function mft(e){let t=e._mode,n=e._modelMatrix,i=e._polylineBuckets={},r=e._polylines,o=r.length;for(let s=0;s<o;++s){let a=r[s];if(a._actualPositions.length>1){a.update();let c=a.material,u=i[c.type];l(u)||(u=i[c.type]=new t0(c,t,n)),u.addPolyline(a)}}}function pft(e,t){let n=t.mode;(e._mode!==n||!N.equals(e._modelMatrix,e.modelMatrix))&&(e._mode=n,e._modelMatrix=N.clone(e.modelMatrix),e._createVertexArray=!0)}function aQ(e){if(e._polylinesRemoved){e._polylinesRemoved=!1;let t=[],n=[],i=0,r,o=e._polylines.length;for(let s=0;s<o;++s)r=e._polylines[s],r.isDestroyed||(r._index=i++,n.push(r),t.push(r));e._polylines=t,e._polylinesToUpdate=n}}function cQ(e){let t=e._polylines,n=t.length;for(let i=0;i<n;++i)if(!t[i].isDestroyed){let r=t[i]._bucket;l(r)&&(r.shaderProgram=r.shaderProgram&&r.shaderProgram.destroy())}}function oTe(e){let t=e._vertexArrays.length;for(let n=0;n<t;++n)e._vertexArrays[n].va.destroy();e._vertexArrays.length=0}Em.prototype._updatePolyline=function(e,t){this._polylinesUpdated=!0,e._dirty||this._polylinesToUpdate.push(e),++this._propertiesChanged[t]};function sTe(e){let t=e._polylines,n=t.length;for(let i=0;i<n;++i)t[i].isDestroyed||t[i]._destroy()}function oQ(e,t,n){this.count=e,this.offset=t,this.bucket=n}function t0(e,t,n){this.polylines=[],this.lengthOfPositions=0,this.material=e,this.shaderProgram=void 0,this.mode=t,this.modelMatrix=n}t0.prototype.addPolyline=function(e){this.polylines.push(e),e._actualLength=this.getPolylinePositionsLength(e),this.lengthOfPositions+=e._actualLength,e._bucket=this};t0.prototype.updateShader=function(e,t,n){if(l(this.shaderProgram))return;let i=["DISTANCE_DISPLAY_CONDITION"];n&&i.push("VECTOR_TILE"),this.material.shaderSource.search(/in\s+float\s+v_polylineAngle;/g)!==-1&&i.push("POLYLINE_DASH"),i.push("CLIP_POLYLINE");let r=new Ye({defines:i,sources:[`in vec4 v_pickColor; -`,this.material.shaderSource,Cx]}),o=t.getVertexShaderCallback()(hM),s=new Ye({defines:i,sources:[Wl,o]});this.shaderProgram=Qt.fromCache({context:e,vertexShaderSource:s,fragmentShaderSource:r,attributeLocations:Ku})};function aTe(e){return h.dot(h.UNIT_X,e._boundingVolume.center)<0||e._boundingVolume.intersectPlane(sn.ORIGIN_ZX_PLANE)===$t.INTERSECTING}t0.prototype.getPolylinePositionsLength=function(e){let t;if(this.mode===re.SCENE3D||!aTe(e))return t=e._actualPositions.length,t*4-4;let n=0,i=e._segments.lengths;t=i.length;for(let r=0;r<t;++r)n+=i[r]*4-4;return n};var Ea=new h,Zd=new h,Qd=new h,KH=new h,gft=new se,_ft=new U;t0.prototype.write=function(e,t,n,i,r,o,s,a){let c=this.mode,u=a.ellipsoid.maximumRadius*D.PI,f=this.polylines,d=f.length;for(let p=0;p<d;++p){let g=f[p],m=g.width,y=g.show&&m>0,A=g._index,b=this.getSegments(g,a),x=b.positions,T=b.lengths,E=x.length,v=g.getPickId(s).color,S=0,I=0,R;for(let V=0;V<E;++V){V===0?g._loop?R=x[E-2]:(R=KH,h.subtract(x[0],x[1],R),h.add(x[0],R,R)):R=x[V-1],h.clone(R,Zd),h.clone(x[V],Ea),V===E-1?g._loop?R=x[1]:(R=KH,h.subtract(x[E-1],x[E-2],R),h.add(x[E-1],R,R)):R=x[V+1],h.clone(R,Qd);let B=T[S];V===I+B&&(I+=B,++S);let j=V-I===0,k=V===I+T[S]-1;c===re.SCENE2D&&(Zd.z=0,Ea.z=0,Qd.z=0),(c===re.SCENE2D||c===re.MORPHING)&&(j||k)&&u-Math.abs(Ea.x)<1&&((Ea.x<0&&Zd.x>0||Ea.x>0&&Zd.x<0)&&h.clone(Ea,Zd),(Ea.x<0&&Qd.x>0||Ea.x>0&&Qd.x<0)&&h.clone(Ea,Qd));let G=j?2:0,q=k?2:4;for(let Q=G;Q<q;++Q){Sn.writeElements(Ea,e,n),Sn.writeElements(Zd,e,n+6),Sn.writeElements(Qd,e,n+12);let W=Q-2<0?-1:1;t[r]=V/(E-1),t[r+1]=2*(Q%2)-1,t[r+2]=W,t[r+3]=A,n+=18,r+=4}}let O=gft;O.x=z.floatToByte(v.red),O.y=z.floatToByte(v.green),O.z=z.floatToByte(v.blue),O.w=z.floatToByte(v.alpha);let L=_ft;L.x=m,L.y=y?1:0;let _=c===re.SCENE2D?g._boundingVolume2D:g._boundingVolumeWC,C=Sn.fromCartesian(_.center,nTe),w=C.high,P=se.fromElements(C.low.x,C.low.y,C.low.z,_.radius,iTe),M=rTe;M.x=0,M.y=Number.MAX_VALUE;let F=g.distanceDisplayCondition;l(F)&&(M.x=F.near,M.y=F.far),o.setBatchedAttribute(A,0,L),o.setBatchedAttribute(A,1,O),o.attributes.length>2&&(o.setBatchedAttribute(A,2,w),o.setBatchedAttribute(A,3,P),o.setBatchedAttribute(A,4,M))}};var yft=new h,Aft=new h,bft=new h,Zxe=new h;t0.prototype.writeForMorph=function(e,t){let n=this.modelMatrix,i=this.polylines,r=i.length;for(let o=0;o<r;++o){let s=i[o],a=s._segments.positions,c=s._segments.lengths,u=a.length,f=0,d=0;for(let p=0;p<u;++p){let g;p===0?s._loop?g=a[u-2]:(g=Zxe,h.subtract(a[0],a[1],g),h.add(a[0],g,g)):g=a[p-1],g=N.multiplyByPoint(n,g,Aft);let m=N.multiplyByPoint(n,a[p],yft),y;p===u-1?s._loop?y=a[1]:(y=Zxe,h.subtract(a[u-1],a[u-2],y),h.add(a[u-1],y,y)):y=a[p+1],y=N.multiplyByPoint(n,y,bft);let A=c[f];p===d+A&&(d+=A,++f);let b=p-d===0,x=p===d+c[f]-1,T=b?2:0,E=x?2:4;for(let v=T;v<E;++v)Sn.writeElements(m,e,t),Sn.writeElements(g,e,t+6),Sn.writeElements(y,e,t+12),t+=18}}};var xft=new Array(1);t0.prototype.updateIndices=function(e,t,n,i){let r=n.length-1,o=new oQ(0,i,this);n[r].push(o);let s=0,a=e[e.length-1],c=0;a.length>0&&(c=a[a.length-1]+1);let u=this.polylines,f=u.length;for(let d=0;d<f;++d){let p=u[d];p._locatorBuckets=[];let g;if(this.mode===re.SCENE3D){g=xft;let y=p._actualPositions.length;if(y>0)g[0]=y;else continue}else g=p._segments.lengths;let m=g.length;if(m>0){let y=0;for(let A=0;A<m;++A){let b=g[A]-1;for(let x=0;x<b;++x)c+4>D.SIXTY_FOUR_KILOBYTES&&(p._locatorBuckets.push({locator:o,count:y}),y=0,t.push(4),a=[],e.push(a),c=0,o.count=s,s=0,i=0,o=new oQ(0,0,this),n[++r]=[o]),a.push(c,c+2,c+1),a.push(c+1,c+2,c+3),y+=6,s+=6,i+=6,c+=4}p._locatorBuckets.push({locator:o,count:y}),c+4>D.SIXTY_FOUR_KILOBYTES&&(t.push(0),a=[],e.push(a),c=0,o.count=s,i=0,s=0,o=new oQ(0,0,this),n[++r]=[o])}p._clean()}return o.count=s,i};t0.prototype.getPolylineStartIndex=function(e){let t=this.polylines,n=0,i=t.length;for(let r=0;r<i;++r){let o=t[r];if(o===e)break;n+=o._actualLength}return n};var cw={positions:void 0,lengths:void 0},Qxe=new Array(1),Tft=new h,Eft=new he;t0.prototype.getSegments=function(e,t){let n=e._actualPositions;if(this.mode===re.SCENE3D)return Qxe[0]=n.length,cw.positions=n,cw.lengths=Qxe,cw;aTe(e)&&(n=e._segments.positions);let i=t.ellipsoid,r=[],o=this.modelMatrix,s=n.length,a,c=Tft;for(let u=0;u<s;++u)a=n[u],c=N.multiplyByPoint(o,a,c),r.push(t.project(i.cartesianToCartographic(c,Eft)));if(r.length>0){e._boundingVolume2D=ue.fromPoints(r,e._boundingVolume2D);let u=e._boundingVolume2D.center;e._boundingVolume2D.center=new h(u.z,u.x,u.y)}return cw.positions=r,cw.lengths=e._segments.lengths,cw};var eTe;t0.prototype.writeUpdate=function(e,t,n,i){let r=this.mode,o=i.ellipsoid.maximumRadius*D.PI,s=t._actualLength;if(s){e+=this.getPolylineStartIndex(t);let a=eTe,c=6*s*3;!l(a)||a.length<c?a=eTe=new Float32Array(c):a.length>c&&(a=new Float32Array(a.buffer,0,c));let u=this.getSegments(t,i),f=u.positions,d=u.lengths,p=0,g=0,m=0,y;s=f.length;for(let A=0;A<s;++A){A===0?t._loop?y=f[s-2]:(y=KH,h.subtract(f[0],f[1],y),h.add(f[0],y,y)):y=f[A-1],h.clone(y,Zd),h.clone(f[A],Ea),A===s-1?t._loop?y=f[1]:(y=KH,h.subtract(f[s-1],f[s-2],y),h.add(f[s-1],y,y)):y=f[A+1],h.clone(y,Qd);let b=d[g];A===m+b&&(m+=b,++g);let x=A-m===0,T=A===m+d[g]-1;r===re.SCENE2D&&(Zd.z=0,Ea.z=0,Qd.z=0),(r===re.SCENE2D||r===re.MORPHING)&&(x||T)&&o-Math.abs(Ea.x)<1&&((Ea.x<0&&Zd.x>0||Ea.x>0&&Zd.x<0)&&h.clone(Ea,Zd),(Ea.x<0&&Qd.x>0||Ea.x>0&&Qd.x<0)&&h.clone(Ea,Qd));let E=x?2:0,v=T?2:4;for(let S=E;S<v;++S)Sn.writeElements(Ea,a,p),Sn.writeElements(Zd,a,p+6),Sn.writeElements(Qd,a,p+12),p+=18}n.copyFromArrayView(a,18*Float32Array.BYTES_PER_ELEMENT*e)}};var Cm=Em;function MA(e){this._positions=e.positions,this._batchTable=e.batchTable,this._batchIds=e.batchIds,this._rectangle=e.rectangle,this._minHeight=e.minimumHeight,this._maxHeight=e.maximumHeight,this._heightReference=e.heightReference,this._billboardCollection=new Wf({batchTable:e.batchTable,scene:e.scene}),this._labelCollection=new e0({batchTable:e.batchTable,scene:e.scene}),this._polylineCollection=new Cm,this._polylineCollection._useHighlightColor=!0,this._packedBuffer=void 0,this._ready=!1,this._promise=void 0,this._error=void 0}Object.defineProperties(MA.prototype,{ready:{get:function(){return this._ready}},pointsLength:{get:function(){return this._billboardCollection.length}},texturesByteLength:{get:function(){let e=this._billboardCollection.sizeInBytes,t=this._labelCollection.sizeInBytes;return e+t}}});function Cft(e,t){let n=e._rectangle,i=e._minHeight,r=e._maxHeight,o=2+ie.packedLength+ee.packedLength,s=new Float64Array(o),a=0;return s[a++]=i,s[a++]=r,ie.pack(n,s,a),a+=ie.packedLength,ee.pack(t,s,a),s}var vft=new $n("createVectorTilePoints",5),Sft=new h;function wft(e,t){let n=e._positions,i=e._packedBuffer;l(i)||(n=e._positions=n.slice(),e._batchIds=e._batchIds.slice(),i=e._packedBuffer=Cft(e,t));let r=[n.buffer,i.buffer],o={positions:n.buffer,packedBuffer:i.buffer},s=vft.scheduleTask(o,r);if(l(s))return s.then(a=>{if(e.isDestroyed())return;e._positions=new Float64Array(a.positions);let c=e._billboardCollection,u=e._labelCollection,f=e._polylineCollection;n=e._positions;let d=e._batchIds,p=n.length/3,g=e._heightReference??We.NONE;for(let m=0;m<p;++m){let y=d[m],A=h.unpack(n,m*3,Sft),b=c.add();b.position=A,b._batchIndex=y,b.heightReference=g;let x=u.add();x.text=" ",x.position=A,x._batchIndex=y,x.heightReference=g;let T=f.add();T.positions=[h.clone(A),h.clone(A)]}e._positions=void 0,e._packedBuffer=void 0,e._ready=!0}).catch(a=>{e.isDestroyed()||(e._error=a)})}MA.prototype.createFeatures=function(e,t){let n=this._billboardCollection,i=this._labelCollection,r=this._polylineCollection,o=this._batchIds,s=o.length;for(let a=0;a<s;++a){let c=o[a],u=n.get(a),f=i.get(a),d=r.get(a);t[c]=new o_(e,c,u,f,d)}};MA.prototype.applyDebugSettings=function(e,t){e?(z.clone(t,this._billboardCollection._highlightColor),z.clone(t,this._labelCollection._highlightColor),z.clone(t,this._polylineCollection._highlightColor)):(z.clone(z.WHITE,this._billboardCollection._highlightColor),z.clone(z.WHITE,this._labelCollection._highlightColor),z.clone(z.WHITE,this._polylineCollection._highlightColor))};function Ift(e,t){let n=e._batchIds,i=n.length;for(let r=0;r<i;++r){let o=n[r],s=t[o];s.show=!0,s.pointSize=o_.defaultPointSize,s.color=o_.defaultColor,s.pointOutlineColor=o_.defaultPointOutlineColor,s.pointOutlineWidth=o_.defaultPointOutlineWidth,s.labelColor=z.WHITE,s.labelOutlineColor=z.WHITE,s.labelOutlineWidth=1,s.font="30px sans-serif",s.labelStyle=Ao.FILL,s.labelText=void 0,s.backgroundColor=new z(.165,.165,.165,.8),s.backgroundPadding=new U(7,5),s.backgroundEnabled=!1,s.scaleByDistance=void 0,s.translucencyByDistance=void 0,s.distanceDisplayCondition=void 0,s.heightOffset=0,s.anchorLineEnabled=!1,s.anchorLineColor=z.WHITE,s.image=void 0,s.disableDepthTestDistance=0,s.horizontalOrigin=zi.CENTER,s.verticalOrigin=Gn.CENTER,s.labelHorizontalOrigin=zi.RIGHT,s.labelVerticalOrigin=Gn.BASELINE}}var Pft=new z,Dft=new z,Rft=new z,Oft=new z,Mft=new z,Nft=new z,P2=new qt,D2=new qt,lQ=new Ht;MA.prototype.applyStyle=function(e,t){if(!l(e)){Ift(this,t);return}let n=this._batchIds,i=n.length;for(let r=0;r<i;++r){let o=n[r],s=t[o];if(l(e.show)&&(s.show=e.show.evaluate(s)),l(e.pointSize)&&(s.pointSize=e.pointSize.evaluate(s)),l(e.color)&&(s.color=e.color.evaluateColor(s,Pft)),l(e.pointOutlineColor)&&(s.pointOutlineColor=e.pointOutlineColor.evaluateColor(s,Dft)),l(e.pointOutlineWidth)&&(s.pointOutlineWidth=e.pointOutlineWidth.evaluate(s)),l(e.labelColor)&&(s.labelColor=e.labelColor.evaluateColor(s,Rft)),l(e.labelOutlineColor)&&(s.labelOutlineColor=e.labelOutlineColor.evaluateColor(s,Oft)),l(e.labelOutlineWidth)&&(s.labelOutlineWidth=e.labelOutlineWidth.evaluate(s)),l(e.font)&&(s.font=e.font.evaluate(s)),l(e.labelStyle)&&(s.labelStyle=e.labelStyle.evaluate(s)),l(e.labelText)?s.labelText=e.labelText.evaluate(s):s.labelText=void 0,l(e.backgroundColor)&&(s.backgroundColor=e.backgroundColor.evaluateColor(s,Mft)),l(e.backgroundPadding)&&(s.backgroundPadding=e.backgroundPadding.evaluate(s)),l(e.backgroundEnabled)&&(s.backgroundEnabled=e.backgroundEnabled.evaluate(s)),l(e.scaleByDistance)){let a=e.scaleByDistance.evaluate(s);l(a)?(P2.near=a.x,P2.nearValue=a.y,P2.far=a.z,P2.farValue=a.w,s.scaleByDistance=P2):s.scaleByDistance=void 0}else s.scaleByDistance=void 0;if(l(e.translucencyByDistance)){let a=e.translucencyByDistance.evaluate(s);l(a)?(D2.near=a.x,D2.nearValue=a.y,D2.far=a.z,D2.farValue=a.w,s.translucencyByDistance=D2):s.translucencyByDistance=void 0}else s.translucencyByDistance=void 0;if(l(e.distanceDisplayCondition)){let a=e.distanceDisplayCondition.evaluate(s);l(a)?(lQ.near=a.x,lQ.far=a.y,s.distanceDisplayCondition=lQ):s.distanceDisplayCondition=void 0}else s.distanceDisplayCondition=void 0;l(e.heightOffset)&&(s.heightOffset=e.heightOffset.evaluate(s)),l(e.anchorLineEnabled)&&(s.anchorLineEnabled=e.anchorLineEnabled.evaluate(s)),l(e.anchorLineColor)&&(s.anchorLineColor=e.anchorLineColor.evaluateColor(s,Nft)),l(e.image)?s.image=e.image.evaluate(s):s.image=void 0,l(e.disableDepthTestDistance)&&(s.disableDepthTestDistance=e.disableDepthTestDistance.evaluate(s)),l(e.horizontalOrigin)&&(s.horizontalOrigin=e.horizontalOrigin.evaluate(s)),l(e.verticalOrigin)&&(s.verticalOrigin=e.verticalOrigin.evaluate(s)),l(e.labelHorizontalOrigin)&&(s.labelHorizontalOrigin=e.labelHorizontalOrigin.evaluate(s)),l(e.labelVerticalOrigin)&&(s.labelVerticalOrigin=e.labelVerticalOrigin.evaluate(s))}};MA.prototype.update=function(e){if(!this._ready&&(l(this._promise)||(this._promise=wft(this,e.mapProjection.ellipsoid)),l(this._error))){let t=this._error;throw this._error=void 0,t}this._polylineCollection.update(e),this._billboardCollection.update(e),this._labelCollection.update(e)};MA.prototype.isDestroyed=function(){return!1};MA.prototype.destroy=function(){return this._billboardCollection=this._billboardCollection&&this._billboardCollection.destroy(),this._labelCollection=this._labelCollection&&this._labelCollection.destroy(),this._polylineCollection=this._polylineCollection&&this._polylineCollection.destroy(),le(this)};var R2=MA;function c_(e){this._batchTable=e.batchTable,this._batchIds=e.batchIds,this._positions=e.positions,this._counts=e.counts,this._indices=e.indices,this._indexCounts=e.indexCounts,this._indexOffsets=void 0,this._batchTableColors=void 0,this._packedBuffer=void 0,this._batchedPositions=void 0,this._transferrableBatchIds=void 0,this._vertexBatchIds=void 0,this._ellipsoid=e.ellipsoid??ee.WGS84,this._minimumHeight=e.minimumHeight,this._maximumHeight=e.maximumHeight,this._polygonMinimumHeights=e.polygonMinimumHeights,this._polygonMaximumHeights=e.polygonMaximumHeights,this._center=e.center??h.ZERO,this._rectangle=e.rectangle,this._center=void 0,this._boundingVolume=e.boundingVolume,this._boundingVolumes=void 0,this._batchedIndices=void 0,this._ready=!1,this._promise=void 0,this._error=void 0,this._primitive=void 0,this.debugWireframe=!1,this.forceRebatch=!1,this.classificationType=ei.BOTH}Object.defineProperties(c_.prototype,{trianglesLength:{get:function(){return l(this._primitive)?this._primitive.trianglesLength:0}},geometryByteLength:{get:function(){return l(this._primitive)?this._primitive.geometryByteLength:0}},ready:{get:function(){return this._ready}}});function Lft(e){let t=new Float64Array(3+h.packedLength+ee.packedLength+ie.packedLength),n=0;return t[n++]=e._indices.BYTES_PER_ELEMENT,t[n++]=e._minimumHeight,t[n++]=e._maximumHeight,h.pack(e._center,t,n),n+=h.packedLength,ee.pack(e._ellipsoid,t,n),n+=ee.packedLength,ie.pack(e._rectangle,t,n),t}function Fft(e,t){let n=1,i=t[n++],r=e._boundingVolumes=new Array(i);for(let a=0;a<i;++a)r[a]=en.unpack(t,n),n+=en.packedLength;let o=t[n++],s=e._batchedIndices=new Array(o);for(let a=0;a<o;++a){let c=z.unpack(t,n);n+=z.packedLength;let u=t[n++],f=t[n++],d=t[n++],p=new Array(d);for(let g=0;g<d;++g)p[g]=t[n++];s[a]=new zp({color:c,offset:u,count:f,batchIds:p})}}var Bft=new $n("createVectorTilePolygons",5),kft=new z;function Uft(e){if(l(e._primitive))return;let t=e._positions,n=e._counts,i=e._indexCounts,r=e._indices,o=e._transferrableBatchIds,s=e._batchTableColors,a=e._packedBuffer;if(!l(s)){t=e._positions=e._positions.slice(),n=e._counts=e._counts.slice(),i=e._indexCounts=e._indexCounts.slice(),r=e._indices=e._indices.slice(),e._center=e._ellipsoid.cartographicToCartesian(ie.center(e._rectangle)),o=e._transferrableBatchIds=new Uint32Array(e._batchIds),s=e._batchTableColors=new Uint32Array(o.length);let g=e._batchTable,m=s.length;for(let y=0;y<m;++y){let A=g.getColor(y,kft);s[y]=A.toRgba()}a=e._packedBuffer=Lft(e)}let c=[t.buffer,n.buffer,i.buffer,r.buffer,o.buffer,s.buffer,a.buffer],u={packedBuffer:a.buffer,positions:t.buffer,counts:n.buffer,indexCounts:i.buffer,indices:r.buffer,batchIds:o.buffer,batchTableColors:s.buffer},f=e._polygonMinimumHeights,d=e._polygonMaximumHeights;l(f)&&l(d)&&(f=f.slice(),d=d.slice(),c.push(f.buffer,d.buffer),u.minimumHeights=f,u.maximumHeights=d);let p=Bft.scheduleTask(u,c);if(l(p))return p.then(g=>{if(e.isDestroyed())return;e._positions=void 0,e._counts=void 0,e._polygonMinimumHeights=void 0,e._polygonMaximumHeights=void 0;let m=new Float64Array(g.packedBuffer),y=m[0];Fft(e,m),e._indices=je.getSizeInBytes(y)===2?new Uint16Array(g.indices):new Uint32Array(g.indices),e._indexOffsets=new Uint32Array(g.indexOffsets),e._indexCounts=new Uint32Array(g.indexCounts),e._batchedPositions=new Float32Array(g.positions),e._vertexBatchIds=new Uint16Array(g.batchIds),zft(e),e._ready=!0}).catch(g=>{e.isDestroyed()||(e._error=g)})}function zft(e){l(e._primitive)||(e._primitive=new eT({batchTable:e._batchTable,positions:e._batchedPositions,batchIds:e._batchIds,vertexBatchIds:e._vertexBatchIds,indices:e._indices,indexOffsets:e._indexOffsets,indexCounts:e._indexCounts,batchedIndices:e._batchedIndices,boundingVolume:e._boundingVolume,boundingVolumes:e._boundingVolumes,center:e._center}),e._batchTable=void 0,e._batchIds=void 0,e._positions=void 0,e._counts=void 0,e._indices=void 0,e._indexCounts=void 0,e._indexOffsets=void 0,e._batchTableColors=void 0,e._packedBuffer=void 0,e._batchedPositions=void 0,e._transferrableBatchIds=void 0,e._vertexBatchIds=void 0,e._ellipsoid=void 0,e._minimumHeight=void 0,e._maximumHeight=void 0,e._polygonMinimumHeights=void 0,e._polygonMaximumHeights=void 0,e._center=void 0,e._rectangle=void 0,e._boundingVolume=void 0,e._boundingVolumes=void 0,e._batchedIndices=void 0)}c_.prototype.createFeatures=function(e,t){this._primitive.createFeatures(e,t)};c_.prototype.applyDebugSettings=function(e,t){this._primitive.applyDebugSettings(e,t)};c_.prototype.applyStyle=function(e,t){this._primitive.applyStyle(e,t)};c_.prototype.updateCommands=function(e,t){this._primitive.updateCommands(e,t)};c_.prototype.update=function(e){if(!this._ready){if(l(this._promise)||(this._promise=Uft(this)),l(this._error)){let t=this._error;throw this._error=void 0,t}return}this._primitive.debugWireframe=this.debugWireframe,this._primitive.forceRebatch=this.forceRebatch,this._primitive.classificationType=this.classificationType,this._primitive.update(e)};c_.prototype.isDestroyed=function(){return!1};c_.prototype.destroy=function(){return this._primitive=this._primitive&&this._primitive.destroy(),le(this)};var O2=c_;function vm(e){this._positions=e.positions,this._widths=e.widths,this._counts=e.counts,this._batchIds=e.batchIds,this._ellipsoid=e.ellipsoid??ee.WGS84,this._minimumHeight=e.minimumHeight,this._maximumHeight=e.maximumHeight,this._center=e.center,this._rectangle=e.rectangle,this._boundingVolume=e.boundingVolume,this._batchTable=e.batchTable,this._va=void 0,this._sp=void 0,this._rs=void 0,this._uniformMap=void 0,this._command=void 0,this._transferrableBatchIds=void 0,this._packedBuffer=void 0,this._keepDecodedPositions=e.keepDecodedPositions,this._decodedPositions=void 0,this._decodedPositionOffsets=void 0,this._currentPositions=void 0,this._previousPositions=void 0,this._nextPositions=void 0,this._expandAndWidth=void 0,this._vertexBatchIds=void 0,this._indices=void 0,this._constantColor=z.clone(z.WHITE),this._highlightColor=this._constantColor,this._trianglesLength=0,this._geometryByteLength=0,this._ready=!1,this._promise=void 0,this._error=void 0}Object.defineProperties(vm.prototype,{trianglesLength:{get:function(){return this._trianglesLength}},geometryByteLength:{get:function(){return this._geometryByteLength}},ready:{get:function(){return this._ready}}});function Vft(e){let t=e._rectangle,n=e._minimumHeight,i=e._maximumHeight,r=e._ellipsoid,o=e._center,s=2+ie.packedLength+ee.packedLength+h.packedLength,a=new Float64Array(s),c=0;return a[c++]=n,a[c++]=i,ie.pack(t,a,c),c+=ie.packedLength,ee.pack(r,a,c),c+=ee.packedLength,h.pack(o,a,c),a}var jft=new $n("createVectorTilePolylines",5),lw={previousPosition:0,currentPosition:1,nextPosition:2,expandAndWidth:3,a_batchId:4};function Hft(e,t){if(l(e._va))return;let n=e._positions,i=e._widths,r=e._counts,o=e._transferrableBatchIds,s=e._packedBuffer;l(s)||(n=e._positions=n.slice(),i=e._widths=i.slice(),r=e._counts=r.slice(),o=e._transferrableBatchIds=e._batchIds.slice(),s=e._packedBuffer=Vft(e));let a=[n.buffer,i.buffer,r.buffer,o.buffer,s.buffer],c={positions:n.buffer,widths:i.buffer,counts:r.buffer,batchIds:o.buffer,packedBuffer:s.buffer,keepDecodedPositions:e._keepDecodedPositions},u=jft.scheduleTask(c,a);if(l(u))return u.then(function(f){if(e.isDestroyed())return;e._keepDecodedPositions&&(e._decodedPositions=new Float64Array(f.decodedPositions),e._decodedPositionOffsets=new Uint32Array(f.decodedPositionOffsets)),e._currentPositions=new Float32Array(f.currentPositions),e._previousPositions=new Float32Array(f.previousPositions),e._nextPositions=new Float32Array(f.nextPositions),e._expandAndWidth=new Float32Array(f.expandAndWidth),e._vertexBatchIds=new Uint16Array(f.batchIds);let d=f.indexDatatype;e._indices=d===je.UNSIGNED_SHORT?new Uint16Array(f.indices):new Uint32Array(f.indices),Gft(e,t),e._ready=!0}).catch(f=>{e.isDestroyed()||(e._error=f)})}function Gft(e,t){if(!l(e._va)){let n=e._currentPositions,i=e._previousPositions,r=e._nextPositions,o=e._expandAndWidth,s=e._vertexBatchIds,a=e._indices,c=i.byteLength+n.byteLength+r.byteLength;c+=o.byteLength+s.byteLength+a.byteLength,e._trianglesLength=a.length/3,e._geometryByteLength=c;let u=tt.createVertexBuffer({context:t,typedArray:i,usage:Me.STATIC_DRAW}),f=tt.createVertexBuffer({context:t,typedArray:n,usage:Me.STATIC_DRAW}),d=tt.createVertexBuffer({context:t,typedArray:r,usage:Me.STATIC_DRAW}),p=tt.createVertexBuffer({context:t,typedArray:o,usage:Me.STATIC_DRAW}),g=tt.createVertexBuffer({context:t,typedArray:s,usage:Me.STATIC_DRAW}),m=tt.createIndexBuffer({context:t,typedArray:a,usage:Me.STATIC_DRAW,indexDatatype:a.BYTES_PER_ELEMENT===2?je.UNSIGNED_SHORT:je.UNSIGNED_INT}),y=[{index:lw.previousPosition,vertexBuffer:u,componentDatatype:Y.FLOAT,componentsPerAttribute:3},{index:lw.currentPosition,vertexBuffer:f,componentDatatype:Y.FLOAT,componentsPerAttribute:3},{index:lw.nextPosition,vertexBuffer:d,componentDatatype:Y.FLOAT,componentsPerAttribute:3},{index:lw.expandAndWidth,vertexBuffer:p,componentDatatype:Y.FLOAT,componentsPerAttribute:2},{index:lw.a_batchId,vertexBuffer:g,componentDatatype:Y.UNSIGNED_SHORT,componentsPerAttribute:1}];e._va=new zn({context:t,attributes:y,indexBuffer:m}),e._positions=void 0,e._widths=void 0,e._counts=void 0,e._ellipsoid=void 0,e._minimumHeight=void 0,e._maximumHeight=void 0,e._rectangle=void 0,e._transferrableBatchIds=void 0,e._packedBuffer=void 0,e._currentPositions=void 0,e._previousPositions=void 0,e._nextPositions=void 0,e._expandAndWidth=void 0,e._vertexBatchIds=void 0,e._indices=void 0}}var M2=new N,cTe=new h;function Wft(e,t){l(e._uniformMap)||(e._uniformMap={u_modifiedModelView:function(){let n=t.uniformState.view;return N.clone(n,M2),N.multiplyByPoint(M2,e._center,cTe),N.setTranslation(M2,cTe,M2),M2},u_highlightColor:function(){return e._highlightColor}})}function qft(e){if(l(e._rs))return;let t={enabled:!0,factor:-5,units:-5};e._rs=Ge.fromCache({blending:tn.ALPHA_BLEND,depthMask:!1,depthTest:{enabled:!0},polygonOffset:t})}var Yft=`uniform vec4 u_highlightColor; +`;let d=new Ye({sources:[a]}),p=new Ye({defines:["VECTOR_TILE"],sources:[c]});e._spPick=Qt.fromCache({context:t,vertexShaderSource:d,fragmentShaderSource:p,attributeLocations:i})}function SCe(e){let t=e?ei.EQUAL:ei.ALWAYS;return{colorMask:{red:!1,green:!1,blue:!1,alpha:!1},stencilTest:{enabled:!0,frontFunction:t,frontOperation:{fail:Rt.KEEP,zFail:Rt.DECREMENT_WRAP,zPass:Rt.KEEP},backFunction:t,backOperation:{fail:Rt.KEEP,zFail:Rt.INCREMENT_WRAP,zPass:Rt.KEEP},reference:Yt.CESIUM_3D_TILE_MASK,mask:Yt.CESIUM_3D_TILE_MASK},stencilMask:Yt.CLASSIFICATION_MASK,depthTest:{enabled:!0,func:cc.LESS_OR_EQUAL},depthMask:!1}}var Dmt={stencilTest:{enabled:!0,frontFunction:ei.NOT_EQUAL,frontOperation:{fail:Rt.ZERO,zFail:Rt.ZERO,zPass:Rt.ZERO},backFunction:ei.NOT_EQUAL,backOperation:{fail:Rt.ZERO,zFail:Rt.ZERO,zPass:Rt.ZERO},reference:0,mask:Yt.CLASSIFICATION_MASK},stencilMask:Yt.CLASSIFICATION_MASK,depthTest:{enabled:!1},depthMask:!1,blending:tn.PRE_MULTIPLIED_ALPHA_BLEND},Rmt={stencilTest:{enabled:!0,frontFunction:ei.NOT_EQUAL,frontOperation:{fail:Rt.ZERO,zFail:Rt.ZERO,zPass:Rt.ZERO},backFunction:ei.NOT_EQUAL,backOperation:{fail:Rt.ZERO,zFail:Rt.ZERO,zPass:Rt.ZERO},reference:0,mask:Yt.CLASSIFICATION_MASK},stencilMask:Yt.CLASSIFICATION_MASK,depthTest:{enabled:!1},depthMask:!1};function Omt(e){l(e._rsStencilDepthPass)||(e._rsStencilDepthPass=Ge.fromCache(SCe(!1)),e._rsStencilDepthPass3DTiles=Ge.fromCache(SCe(!0)),e._rsColorPass=Ge.fromCache(Dmt),e._rsPickPass=Ge.fromCache(Rmt))}var KT=new N,wCe=new h;function Mmt(e,t){if(l(e._uniformMap))return;let n={u_modifiedModelViewProjection:function(){let i=t.uniformState.view,r=t.uniformState.projection;return N.clone(i,KT),N.multiplyByPoint(KT,e._center,wCe),N.setTranslation(KT,wCe,KT),N.multiply(r,KT,KT),KT},u_highlightColor:function(){return e._highlightColor}};e._uniformMap=e._batchTable.getUniformMapCallback()(n)}function HQ(e,t,n,i,r,o,s){let a=e.constructor.BYTES_PER_ELEMENT,c=o.length;for(let u=0;u<c;++u){let f=o[u],d=s[f],p=i[d],g=r[d],m=new e.constructor(e.buffer,a*p,g);t.set(m,n),i[d]=n,n+=g}return n}function Nmt(e,t){let n=e._indices,i=e._indexOffsets,r=e._indexCounts,o=e._batchIdLookUp,s=new n.constructor(n.length),a=t.pop(),c=[a],u=HQ(n,s,0,i,r,a.batchIds,o);for(a.offset=0,a.count=u;t.length>0;){let f=t.pop();if(z.equals(f.color,a.color))u=HQ(n,s,u,i,r,f.batchIds,o),a.batchIds=a.batchIds.concat(f.batchIds),a.count=u-a.offset;else{let d=u;u=HQ(n,s,u,i,r,f.batchIds,o),f.offset=d,f.count=u-d,c.push(f),a=f}}e._va.indexBuffer.copyFromArrayView(s),e._indices=s,e._batchedIndices=c}function GQ(e,t,n,i,r,o,s){let a=e.bytesPerIndex,c=o.length;for(let u=0;u<c;++u){let f=o[u],d=s[f],p=i[d],g=r[d];t.copyFromBuffer(e,p*a,n*a,g*a),i[d]=n,n+=g}return n}function Lmt(e,t){let n=e._indexOffsets,i=e._indexCounts,r=e._batchIdLookUp,o=t.pop(),s=[o],a=e._va.indexBuffer,c=e._vaSwap.indexBuffer,u=GQ(a,c,0,n,i,o.batchIds,r);for(o.offset=0,o.count=u;t.length>0;){let d=t.pop();if(z.equals(d.color,o.color))u=GQ(a,c,u,n,i,d.batchIds,r),o.batchIds=o.batchIds.concat(d.batchIds),o.count=u-o.offset;else{let p=u;u=GQ(a,c,u,n,i,d.batchIds,r),d.offset=p,d.count=u-p,s.push(d),o=d}}let f=e._va;e._va=e._vaSwap,e._vaSwap=f,e._batchedIndices=s}function Fmt(e,t){return t.color.toRgba()-e.color.toRgba()}function Bmt(e,t){if(!e._batchDirty)return!1;let n=e._batchedIndices,i=n.length,r=!1,o={};for(let s=0;s<i;++s){let c=n[s].color.toRgba();if(l(o[c])){r=!0;break}else o[c]=!0}if(!r)return e._batchDirty=!1,!1;if(r&&!e.forceRebatch&&e._framesSinceLastRebatch<120){++e._framesSinceLastRebatch;return}return n.sort(Fmt),t.webgl2?Lmt(e,n):Nmt(e,n),e._framesSinceLastRebatch=0,e._batchDirty=!1,e._pickCommandsDirty=!0,e._wireframeDirty=!0,!0}function kmt(e,t){let n=Bmt(e,t),i=e._commands,r=e._batchedIndices,o=r.length,s=o*2;if(l(i)&&!n&&i.length===s)return;i.length=s;let a=e._va,c=e._sp,u=e._modelMatrix??N.IDENTITY,f=e._uniformMap,d=e._boundingVolume;for(let p=0;p<o;++p){let g=r[p].offset,m=r[p].count,y=i[p*2];l(y)||(y=i[p*2]=new at({owner:e})),y.vertexArray=a,y.modelMatrix=u,y.offset=g,y.count=m,y.renderState=e._rsStencilDepthPass,y.shaderProgram=c,y.uniformMap=f,y.boundingVolume=d,y.cull=!1,y.pass=Ie.TERRAIN_CLASSIFICATION;let A=at.shallowClone(y,y.derivedCommands.tileset);A.renderState=e._rsStencilDepthPass3DTiles,A.pass=Ie.CESIUM_3D_TILE_CLASSIFICATION,y.derivedCommands.tileset=A;let b=i[p*2+1];l(b)||(b=i[p*2+1]=new at({owner:e})),b.vertexArray=a,b.modelMatrix=u,b.offset=g,b.count=m,b.renderState=e._rsColorPass,b.shaderProgram=c,b.uniformMap=f,b.boundingVolume=d,b.cull=!1,b.pass=Ie.TERRAIN_CLASSIFICATION;let x=at.shallowClone(b,b.derivedCommands.tileset);x.pass=Ie.CESIUM_3D_TILE_CLASSIFICATION,b.derivedCommands.tileset=x}e._commandsDirty=!0}function Umt(e,t){if(e.classificationType===Qn.TERRAIN||!t.invertClassification||l(e._commandsIgnoreShow)&&!e._commandsDirty)return;let n=e._commands,i=e._commandsIgnoreShow,r=e._spStencil,o=n.length,s=i.length=o/2,a=0;for(let c=0;c<s;++c){let u=i[c]=at.shallowClone(n[a],i[c]);u.shaderProgram=r,u.pass=Ie.CESIUM_3D_TILE_CLASSIFICATION_IGNORE_SHOW,a+=2}e._commandsDirty=!1}function zmt(e){if(!e._pickCommandsDirty)return;let t=e._indexOffsets.length,n=e._pickCommands;n.length=t*2;let i=e._va,r=e._spStencil,o=e._spPick,s=e._modelMatrix??N.IDENTITY,a=e._uniformMap;for(let c=0;c<t;++c){let u=e._indexOffsets[c],f=e._indexCounts[c],d=l(e._boundingVolumes)?e._boundingVolumes[c]:e.boundingVolume,p=n[c*2];l(p)||(p=n[c*2]=new at({owner:e,pickOnly:!0})),p.vertexArray=i,p.modelMatrix=s,p.offset=u,p.count=f,p.renderState=e._rsStencilDepthPass,p.shaderProgram=r,p.uniformMap=a,p.boundingVolume=d,p.pass=Ie.TERRAIN_CLASSIFICATION;let g=at.shallowClone(p,p.derivedCommands.tileset);g.renderState=e._rsStencilDepthPass3DTiles,g.pass=Ie.CESIUM_3D_TILE_CLASSIFICATION,p.derivedCommands.tileset=g;let m=n[c*2+1];l(m)||(m=n[c*2+1]=new at({owner:e,pickOnly:!0})),m.vertexArray=i,m.modelMatrix=s,m.offset=u,m.count=f,m.renderState=e._rsPickPass,m.shaderProgram=o,m.uniformMap=a,m.boundingVolume=d,m.pass=Ie.TERRAIN_CLASSIFICATION;let y=at.shallowClone(m,m.derivedCommands.tileset);y.pass=Ie.CESIUM_3D_TILE_CLASSIFICATION,m.derivedCommands.tileset=y}e._pickCommandsDirty=!1}u_.prototype.createFeatures=function(e,t){let n=this._batchIds,i=n.length;for(let r=0;r<i;++r){let o=n[r];t[o]=new oa(e,o)}};u_.prototype.applyDebugSettings=function(e,t){this._highlightColor=e?t:this._constantColor};function Vmt(e,t){e._updatingAllCommands=!0;let n=e._batchIds,i=n.length,r;for(r=0;r<i;++r){let s=n[r],a=t[s];a.show=!0,a.color=z.WHITE}let o=e._batchedIndices;for(i=o.length,r=0;r<i;++r)o[r].color=z.clone(z.WHITE);e._updatingAllCommands=!1,e._batchDirty=!0}var jmt=new z,Hmt=z.WHITE,Gmt=!0,Wmt=/\$/;u_.prototype.applyStyle=function(e,t){if(!l(e)){Vmt(this,t);return}let n=e.color,i=n instanceof ih&&!Wmt.test(n.expression);this._updatingAllCommands=i;let r=this._batchIds,o=r.length,s;for(s=0;s<o;++s){let a=r[s],c=t[a];c.color=l(e.color)?e.color.evaluateColor(c,jmt):Hmt,c.show=l(e.show)?e.show.evaluate(c):Gmt}if(i){let a=this._batchedIndices;for(o=a.length,s=0;s<o;++s)a[s].color=z.clone(z.WHITE);this._updatingAllCommands=!1,this._batchDirty=!0}};u_.prototype.updateCommands=function(e,t){if(this._updatingAllCommands)return;let n=this._batchIdLookUp,i=n[e];if(!l(i))return;let r=this._indexOffsets,o=this._indexCounts,s=r[i],a=o[i],c=this._batchedIndices,u=c.length,f;for(f=0;f<u;++f){let y=c[f].offset,A=c[f].count;if(s>=y&&s<y+A)break}c.push(new a0({color:z.clone(t),offset:s,count:a,batchIds:[e]}));let d=[],p=[],g=c[f].batchIds,m=g.length;for(let y=0;y<m;++y){let A=g[y];if(A===e)continue;let b=n[A];r[b]<s?d.push(A):p.push(A)}p.length!==0&&c.push(new a0({color:z.clone(c[f].color),offset:s+a,count:c[f].offset+c[f].count-(s+a),batchIds:p})),d.length!==0?(c[f].count=s-c[f].offset,c[f].batchIds=d):c.splice(f,1),this._batchDirty=!0};function ICe(e,t,n,i){let r=e.classificationType,o=r!==Qn.CESIUM_3D_TILE,s=r!==Qn.TERRAIN,a=t.commandList,c=n.length,u,f;for(f=0;f<c;++f)o&&(u=n[f],u.pass=Ie.TERRAIN_CLASSIFICATION,a.push(u)),s&&(u=n[f].derivedCommands.tileset,u.pass=Ie.CESIUM_3D_TILE_CLASSIFICATION,a.push(u));if(!(!t.invertClassification||!l(i)))for(c=i.length,f=0;f<c;++f)a.push(i[f])}function qmt(e,t){let n=e.commandList,i=t.length;for(let r=0;r<i;r+=2){let o=t[r+1];o.pass=Ie.OPAQUE,n.push(o)}}function Ymt(e){let t=e.debugWireframe===e._debugWireframe;if(t=t&&!(e.debugWireframe&&e._wireframeDirty),t)return;l(e._rsWireframe)||(e._rsWireframe=Ge.fromCache({}));let n,i;e.debugWireframe?(n=e._rsWireframe,i=Oe.LINES):(n=e._rsColorPass,i=Oe.TRIANGLES);let r=e._commands,o=r.length;for(let s=0;s<o;s+=2){let a=r[s+1];a.renderState=n,a.primitiveType=i}e._debugWireframe=e.debugWireframe,e._wireframeDirty=!1}u_.prototype.update=function(e){let t=e.context;Imt(this,t),Pmt(this,t),Omt(this),Mmt(this,t);let n=e.passes;n.render&&(kmt(this,t),Umt(this,e),Ymt(this),this._debugWireframe?qmt(e,this._commands):ICe(this,e,this._commands,this._commandsIgnoreShow)),n.pick&&(zmt(this),ICe(this,e,this._pickCommands))};u_.prototype.isDestroyed=function(){return!1};u_.prototype.destroy=function(){return this._va=this._va&&this._va.destroy(),this._sp=this._sp&&this._sp.destroy(),this._spPick=this._spPick&&this._spPick.destroy(),this._vaSwap=this._vaSwap&&this._vaSwap.destroy(),le(this)};var $T=u_;function Jf(e){this._boxes=e.boxes,this._boxBatchIds=e.boxBatchIds,this._cylinders=e.cylinders,this._cylinderBatchIds=e.cylinderBatchIds,this._ellipsoids=e.ellipsoids,this._ellipsoidBatchIds=e.ellipsoidBatchIds,this._spheres=e.spheres,this._sphereBatchIds=e.sphereBatchIds,this._modelMatrix=e.modelMatrix,this._batchTable=e.batchTable,this._boundingVolume=e.boundingVolume,this._center=e.center,l(this._center)||(l(this._boundingVolume)?this._center=h.clone(this._boundingVolume.center):this._center=h.clone(h.ZERO)),this._boundingVolumes=void 0,this._batchedIndices=void 0,this._indices=void 0,this._indexOffsets=void 0,this._indexCounts=void 0,this._positions=void 0,this._vertexBatchIds=void 0,this._batchIds=void 0,this._batchTableColors=void 0,this._packedBuffer=void 0,this._ready=!1,this._promise=void 0,this._error=void 0,this._verticesPromise=void 0,this._primitive=void 0,this.debugWireframe=!1,this.forceRebatch=!1,this.classificationType=Qn.BOTH}Object.defineProperties(Jf.prototype,{trianglesLength:{get:function(){return l(this._primitive)?this._primitive.trianglesLength:0}},geometryByteLength:{get:function(){return l(this._primitive)?this._primitive.geometryByteLength:0}},ready:{get:function(){return this._ready}}});Jf.packedBoxLength=N.packedLength+h.packedLength;Jf.packedCylinderLength=N.packedLength+2;Jf.packedEllipsoidLength=N.packedLength+h.packedLength;Jf.packedSphereLength=h.packedLength+1;function Xmt(e){let t=new Float64Array(N.packedLength+h.packedLength),n=0;return h.pack(e._center,t,n),n+=h.packedLength,N.pack(e._modelMatrix,t,n),t}function Kmt(e,t){let n=0,i=t[n++],r=t[n++],o=e._boundingVolumes=new Array(r);for(let c=0;c<r;++c)o[c]=ue.unpack(t,n),n+=ue.packedLength;let s=t[n++],a=e._batchedIndices=new Array(s);for(let c=0;c<s;++c){let u=z.unpack(t,n);n+=z.packedLength;let f=t[n++],d=t[n++],p=t[n++],g=new Array(p);for(let m=0;m<p;++m)g[m]=t[n++];a[c]=new a0({color:u,offset:f,count:d,batchIds:g})}return i}var $mt=new $n("createVectorTileGeometries",5),Jmt=new z;function Zmt(e){if(!l(e._primitive)&&!l(e._verticesPromise)){let t=e._boxes,n=e._boxBatchIds,i=e._cylinders,r=e._cylinderBatchIds,o=e._ellipsoids,s=e._ellipsoidBatchIds,a=e._spheres,c=e._sphereBatchIds,u=e._batchTableColors,f=e._packedBuffer;if(!l(u)){let m=0;l(e._boxes)&&(t=e._boxes=t.slice(),n=e._boxBatchIds=n.slice(),m+=n.length),l(e._cylinders)&&(i=e._cylinders=i.slice(),r=e._cylinderBatchIds=r.slice(),m+=r.length),l(e._ellipsoids)&&(o=e._ellipsoids=o.slice(),s=e._ellipsoidBatchIds=s.slice(),m+=s.length),l(e._spheres)&&(a=e._sphere=a.slice(),c=e._sphereBatchIds=c.slice(),m+=c.length),u=e._batchTableColors=new Uint32Array(m);let y=e._batchTable;for(let A=0;A<m;++A){let b=y.getColor(A,Jmt);u[A]=b.toRgba()}f=e._packedBuffer=Xmt(e)}let d=[];l(t)&&d.push(t.buffer,n.buffer),l(i)&&d.push(i.buffer,r.buffer),l(o)&&d.push(o.buffer,s.buffer),l(a)&&d.push(a.buffer,c.buffer),d.push(u.buffer,f.buffer);let p={boxes:l(t)?t.buffer:void 0,boxBatchIds:l(t)?n.buffer:void 0,cylinders:l(i)?i.buffer:void 0,cylinderBatchIds:l(i)?r.buffer:void 0,ellipsoids:l(o)?o.buffer:void 0,ellipsoidBatchIds:l(o)?s.buffer:void 0,spheres:l(a)?a.buffer:void 0,sphereBatchIds:l(a)?c.buffer:void 0,batchTableColors:u.buffer,packedBuffer:f.buffer},g=e._verticesPromise=$mt.scheduleTask(p,d);return l(g)?g.then(function(m){if(e.isDestroyed())return;let y=new Float64Array(m.packedBuffer);Kmt(e,y)===2?e._indices=new Uint16Array(m.indices):e._indices=new Uint32Array(m.indices),e._indexOffsets=new Uint32Array(m.indexOffsets),e._indexCounts=new Uint32Array(m.indexCounts),e._positions=new Float32Array(m.positions),e._vertexBatchIds=new Uint16Array(m.vertexBatchIds),e._batchIds=new Uint16Array(m.batchIds),Qmt(e),e._ready=!0}).catch(m=>{e.isDestroyed()||(e._error=m)}):void 0}}function Qmt(e){l(e._primitive)||(e._primitive=new $T({batchTable:e._batchTable,positions:e._positions,batchIds:e._batchIds,vertexBatchIds:e._vertexBatchIds,indices:e._indices,indexOffsets:e._indexOffsets,indexCounts:e._indexCounts,batchedIndices:e._batchedIndices,boundingVolume:e._boundingVolume,boundingVolumes:e._boundingVolumes,center:e._center,pickObject:e._pickObject??e}),e._boxes=void 0,e._boxBatchIds=void 0,e._cylinders=void 0,e._cylinderBatchIds=void 0,e._ellipsoids=void 0,e._ellipsoidBatchIds=void 0,e._spheres=void 0,e._sphereBatchIds=void 0,e._center=void 0,e._modelMatrix=void 0,e._batchTable=void 0,e._boundingVolume=void 0,e._boundingVolumes=void 0,e._batchedIndices=void 0,e._indices=void 0,e._indexOffsets=void 0,e._indexCounts=void 0,e._positions=void 0,e._vertexBatchIds=void 0,e._batchIds=void 0,e._batchTableColors=void 0,e._packedBuffer=void 0,e._verticesPromise=void 0)}Jf.prototype.createFeatures=function(e,t){this._primitive.createFeatures(e,t)};Jf.prototype.applyDebugSettings=function(e,t){this._primitive.applyDebugSettings(e,t)};Jf.prototype.applyStyle=function(e,t){this._primitive.applyStyle(e,t)};Jf.prototype.updateCommands=function(e,t){this._primitive.updateCommands(e,t)};Jf.prototype.update=function(e){if(!this._ready){if(l(this._promise)||(this._promise=Zmt(this)),l(this._error)){let t=this._error;throw this._error=void 0,t}return}this._primitive.debugWireframe=this.debugWireframe,this._primitive.forceRebatch=this.forceRebatch,this._primitive.classificationType=this.classificationType,this._primitive.update(e)};Jf.prototype.isDestroyed=function(){return!1};Jf.prototype.destroy=function(){return this._primitive=this._primitive&&this._primitive.destroy(),le(this)};var f_=Jf;var WQ=class{constructor(t,n,i,r,o){this._tileset=t,this._tile=n,this._resource=i,this._geometries=void 0,this._metadata=void 0,this._batchTable=void 0,this._features=void 0,this.featurePropertiesDirty=!1,this._group=void 0,this._ready=!1,npt(this,r,o)}get featuresLength(){return l(this._batchTable)?this._batchTable.featuresLength:0}get pointsLength(){return 0}get trianglesLength(){return l(this._geometries)?this._geometries.trianglesLength:0}get geometryByteLength(){return l(this._geometries)?this._geometries.geometryByteLength:0}get texturesByteLength(){return 0}get batchTableByteLength(){return l(this._batchTable)?this._batchTable.batchTableByteLength:0}get innerContents(){}get ready(){return this._ready}get tileset(){return this._tileset}get tile(){return this._tile}get url(){return this._resource.getUrlComponent(!0)}get metadata(){return this._metadata}set metadata(t){this._metadata=t}get batchTable(){return this._batchTable}get group(){return this._group}set group(t){this._group=t}hasProperty(t,n){return this._batchTable.hasProperty(t,n)}getFeature(t){return PCe(this),this._features[t]}applyDebugSettings(t,n){l(this._geometries)&&this._geometries.applyDebugSettings(t,n)}applyStyle(t){PCe(this),l(this._geometries)&&this._geometries.applyStyle(t,this._features)}update(t,n){l(this._geometries)&&(this._geometries.classificationType=this._tileset.classificationType,this._geometries.debugWireframe=this._tileset.debugWireframe,this._geometries.update(n)),l(this._batchTable)&&this._geometries.ready&&(this._batchTable.update(t,n),this._ready=!0)}pick(t,n,i){}isDestroyed(){return!1}destroy(){return this._geometries=this._geometries&&this._geometries.destroy(),this._batchTable=this._batchTable&&this._batchTable.destroy(),le(this)}};function ept(e){return function(t,n){l(e._geometries)&&e._geometries.updateCommands(t,n)}}function tpt(e,t){let n,i,r,o,s,a=e.BOXES_LENGTH??0,c=e.CYLINDERS_LENGTH??0,u=e.ELLIPSOIDS_LENGTH??0,f=e.SPHERES_LENGTH??0;if(a>0&&l(e.BOX_BATCH_IDS)){let m=t.byteOffset+e.BOX_BATCH_IDS.byteOffset;n=new Uint16Array(t.buffer,m,a)}if(c>0&&l(e.CYLINDER_BATCH_IDS)){let m=t.byteOffset+e.CYLINDER_BATCH_IDS.byteOffset;i=new Uint16Array(t.buffer,m,c)}if(u>0&&l(e.ELLIPSOID_BATCH_IDS)){let m=t.byteOffset+e.ELLIPSOID_BATCH_IDS.byteOffset;r=new Uint16Array(t.buffer,m,u)}if(f>0&&l(e.SPHERE_BATCH_IDS)){let m=t.byteOffset+e.SPHERE_BATCH_IDS.byteOffset;o=new Uint16Array(t.buffer,m,f)}let d=l(n)||l(i)||l(r)||l(o),p=a>0&&!l(n)||c>0&&!l(i)||u>0&&!l(r)||f>0&&!l(o);if(d&&p)throw new oe("If one group of batch ids is defined, then all batch ids must be defined");if(!l(n)&&!l(i)&&!l(r)&&!l(o)){let m=0;if(!l(n)&&a>0)for(n=new Uint16Array(a),s=0;s<a;++s)n[s]=m++;if(!l(i)&&c>0)for(i=new Uint16Array(c),s=0;s<c;++s)i[s]=m++;if(!l(r)&&u>0)for(r=new Uint16Array(u),s=0;s<u;++s)r[s]=m++;if(!l(o)&&f>0)for(o=new Uint16Array(f),s=0;s<f;++s)o[s]=m++}return{boxes:n,cylinders:i,ellipsoids:r,spheres:o}}var JT=Uint32Array.BYTES_PER_ELEMENT;function npt(e,t,n){n=n??0;let i=new Uint8Array(t),r=new DataView(t);n+=JT;let o=r.getUint32(n,!0);if(o!==1)throw new oe(`Only Geometry tile version 1 is supported. Version ${o} is not.`);n+=JT;let s=r.getUint32(n,!0);if(n+=JT,s===0){e._ready=!0;return}let a=r.getUint32(n,!0);if(n+=JT,a===0)throw new oe("Feature table must have a byte length greater than zero");let c=r.getUint32(n,!0);n+=JT;let u=r.getUint32(n,!0);n+=JT;let f=r.getUint32(n,!0);n+=JT;let d=No(i,n,a);n+=a;let p=new Uint8Array(t,n,c);n+=c;let g,m;u>0&&(g=No(i,n,u),n+=u,f>0&&(m=new Uint8Array(t,n,f),m=new Uint8Array(m)));let y=d.BOXES_LENGTH??0,A=d.CYLINDERS_LENGTH??0,b=d.ELLIPSOIDS_LENGTH??0,x=d.SPHERES_LENGTH??0,T=y+A+b+x,E=new vm(e,T,g,m,ept(e));if(e._batchTable=E,T===0)return;let v=e.tile.computedTransform,S;l(d.RTC_CENTER)&&(S=h.unpack(d.RTC_CENTER),N.multiplyByPoint(v,S,S));let I=tpt(d,p);if(y>0||A>0||b>0||x>0){let R,O,L,_;if(y>0){let C=p.byteOffset+d.BOXES.byteOffset;R=new Float32Array(p.buffer,C,f_.packedBoxLength*y)}if(A>0){let C=p.byteOffset+d.CYLINDERS.byteOffset;O=new Float32Array(p.buffer,C,f_.packedCylinderLength*A)}if(b>0){let C=p.byteOffset+d.ELLIPSOIDS.byteOffset;L=new Float32Array(p.buffer,C,f_.packedEllipsoidLength*b)}if(x>0){let C=p.byteOffset+d.SPHERES.byteOffset;_=new Float32Array(p.buffer,C,f_.packedSphereLength*x)}return e._geometries=new f_({boxes:R,boxBatchIds:I.boxes,cylinders:O,cylinderBatchIds:I.cylinders,ellipsoids:L,ellipsoidBatchIds:I.ellipsoids,spheres:_,sphereBatchIds:I.spheres,center:S,modelMatrix:v,batchTable:E,boundingVolume:e.tile.boundingVolume.boundingVolume}),e}return Promise.resolve(e)}function PCe(e){let t=e.featuresLength;if(!l(e._features)&&t>0){let n=new Array(t);l(e._geometries)&&e._geometries.createFeatures(e,n),e._features=n}}var _k=WQ;var qQ={};qQ.encode2D=function(e,t,n){let i=Math.pow(2,e),r={x:t,y:n},o,s,a,c=BigInt(0);for(a=i/2;a>0;a/=2)o=(r.x&a)>0?1:0,s=(r.y&a)>0?1:0,c+=BigInt((3*o^s)*a*a),DCe(i,r,o,s);return c};qQ.decode2D=function(e,t){let n=Math.pow(2,e),i={x:0,y:0},r,o,s,a;for(s=1,a=t;s<n;s*=2)r=1&Number(a/BigInt(2)),o=1&Number(a^BigInt(r)),DCe(s,i,r,o),i.x+=s*r,i.y+=s*o,a/=BigInt(4);return[i.x,i.y]};function DCe(e,t,n,i){if(i!==0)return;n===1&&(t.x=e-1-t.x,t.y=e-1-t.y);let r=t.x;t.x=t.y,t.y=r}var Lw=qQ;var ZT=30,ipt=1<<ZT,rpt=1<<ZT+1>>>0,YQ=2*ZT+1,LA=4,MCe=[],NCe=[],opt=[[0,1,3,2],[0,2,3,1],[3,2,0,1],[3,1,0,2]],FA=1,Fw=2,xG=[FA,0,0,FA|Fw];function Ws(e){if(!dn.supportsBigInt())throw new oe("S2 required BigInt support");this._cellId=e,this._level=Ws.getLevel(e)}Ws.fromToken=function(e){return new Ws(Ws.getIdFromToken(e))};Ws.isValidId=function(e){return!(e<=0||e>>BigInt(YQ)>5||!(e&~e+BigInt(1)&BigInt("0x1555555555555555")))};Ws.isValidToken=function(e){return/^[0-9a-fA-F]{1,16}$/.test(e)?Ws.isValidId(Ws.getIdFromToken(e)):!1};Ws.getIdFromToken=function(e){return BigInt("0x"+e+"0".repeat(16-e.length))};Ws.getTokenFromId=function(e){let t=Math.floor(ppt(e)/4),n=e.toString(16).replace(/0*$/,"");return Array(17-t-n.length).join("0")+n};Ws.getLevel=function(e){let t=0;for(;e!==BigInt(0)&&!(e&BigInt(1));)t++,e=e>>BigInt(1);return ZT-(t>>1)};Ws.prototype.getChild=function(e){let t=BCe(this._cellId)>>BigInt(2),n=this._cellId+BigInt(2*e+1-4)*t;return new Ws(n)};Ws.prototype.getParent=function(){let e=BCe(this._cellId)<<BigInt(2);return new Ws(this._cellId&~e+BigInt(1)|e)};Ws.prototype.getParentAtLevel=function(e){let t=hpt(e);return new Ws(this._cellId&-t|t)};Ws.prototype.getCenter=function(e){e=e??ee.WGS84;let t=spt(this._cellId,this._level);t=h.normalize(t,t);let n=he.fromCartesian(t,ee.UNIT_SPHERE);return he.toCartesian(n,e,new h)};Ws.prototype.getVertex=function(e,t){t=t??ee.WGS84;let n=apt(this._cellId,this._level,e);n=h.normalize(n,n);let i=he.fromCartesian(n,ee.UNIT_SPHERE);return he.toCartesian(i,t,new h)};Ws.fromFacePositionLevel=function(e,t,n){let i=(e<4?"0":"")+(e<2?"0":"")+e.toString(2),r=t.toString(2),o=Array(2*n-r.length+1).join("0"),s=Array(YQ-2*n).join("0"),a=BigInt(`0b${i}${o}${r}1${s}`);return new Ws(a)};function spt(e,t){let n=cpt(e,t);return lpt(n[0],n[1],n[2])}function apt(e,t,n){let i=LCe(e,t),r=upt([i[1],i[2]],t),o=n>>1&1;return FCe(i[0],r[0][o^n&1],r[1][o])}function cpt(e,t){let n=LCe(e),i=n[0],r=n[1],o=n[2],s=t===30,a=!s&&(BigInt(r)^e>>BigInt(2))&BigInt(1),c=s?1:a?2:0,u=(r<<1)+c,f=(o<<1)+c;return[i,u,f]}function LCe(e){MCe.length===0&&dpt();let t=Number(e>>BigInt(YQ)),n=t&FA,i=(1<<LA)-1,r=0,o=0;for(let s=7;s>=0;s--){let c=(1<<2*(s===7?ZT-7*LA:LA))-1;n+=Number(e>>BigInt(s*2*LA+1)&BigInt(c))<<2,n=NCe[n];let u=s*LA;r+=n>>LA+2<<u,o+=(n>>2&i)<<u,n&=FA|Fw}return[t,r,o]}function lpt(e,t,n){let i=RCe(t),r=RCe(n),o=TG(i),s=TG(r);return FCe(e,o,s)}function FCe(e,t,n){switch(e){case 0:return new h(1,t,n);case 1:return new h(-t,1,n);case 2:return new h(-t,-n,1);case 3:return new h(-1,-n,-t);case 4:return new h(n,-1,-t);default:return new h(n,t,-1)}}function TG(e){return e>=.5?1/3*(4*e*e-1):1/3*(1-4*(1-e)*(1-e))}function RCe(e){return 1/rpt*e}function upt(e,t){let n=[[],[]],i=fpt(t);for(let r=0;r<2;++r){let o=e[r]&-i,s=o+i;n[r][0]=TG(OCe(o)),n[r][1]=TG(OCe(s))}return n}function fpt(e){return 1<<ZT-e>>>0}function OCe(e){return 1/ipt*e}function BA(e,t,n,i,r,o){if(e===LA){let s=(t<<LA)+n;MCe[(s<<2)+i]=(r<<2)+o,NCe[(r<<2)+i]=(s<<2)+o}else{e++,t<<=1,n<<=1,r<<=2;let s=opt[o];BA(e,t+(s[0]>>1),n+(s[0]&1),i,r,o^xG[0]),BA(e,t+(s[1]>>1),n+(s[1]&1),i,r+1,o^xG[1]),BA(e,t+(s[2]>>1),n+(s[2]&1),i,r+2,o^xG[2]),BA(e,t+(s[3]>>1),n+(s[3]&1),i,r+3,o^xG[3])}}function dpt(){BA(0,0,0,0,0,0),BA(0,0,0,FA,0,FA),BA(0,0,0,Fw,0,Fw),BA(0,0,0,FA|Fw,0,FA|Fw)}function BCe(e){return e&~e+BigInt(1)}function hpt(e){return BigInt(1)<<BigInt(2*(ZT-e))}var mpt=[64,0,1,39,2,15,40,23,3,12,16,59,41,19,24,54,4,64,13,10,17,62,60,28,42,30,20,51,25,44,55,47,5,32,65,38,14,22,11,58,18,53,63,9,61,27,29,50,43,46,31,37,21,57,52,8,26,49,45,36,56,7,48,35,6,34,33,0];function ppt(e){return mpt[(-e&e)%BigInt(67)]}var d_=Ws;function XQ(e){let t=e.lengthBits,n=e.availableCount,i=e.constant,r=e.bitstream;if(l(i))n=t;else{let o=Math.ceil(t/8);if(r.length!==o)throw new oe(`Availability bitstream must be exactly ${o} bytes long to store ${t} bits. Actual bitstream was ${r.length} bytes long.`);let s=e.computeAvailableCountEnabled??!1;!l(n)&&s&&(n=gpt(r,t))}this._lengthBits=t,this._availableCount=n,this._constant=i,this._bitstream=r}function gpt(e,t){let n=0;for(let i=0;i<t;i++){let r=i>>3,o=i%8;n+=e[r]>>o&1}return n}Object.defineProperties(XQ.prototype,{lengthBits:{get:function(){return this._lengthBits}},availableCount:{get:function(){return this._availableCount}}});XQ.prototype.getBit=function(e){if(l(this._constant))return this._constant;let t=e>>3,n=e%8;return(this._bitstream[t]>>n&1)===1};var Bw=XQ;function h_(e){e=e??H.EMPTY_OBJECT;let t=e.metadataTable,n=e.class,i=e.entityId,r=e.propertyTableJson;this._class=n,this._metadataTable=t,this._entityId=i,this._extensions=r.extensions,this._extras=r.extras}Object.defineProperties(h_.prototype,{class:{get:function(){return this._class}},extras:{get:function(){return this._extras}},extensions:{get:function(){return this._extensions}}});h_.prototype.hasProperty=function(e){return this._metadataTable.hasProperty(e)};h_.prototype.hasPropertyBySemantic=function(e){return this._metadataTable.hasPropertyBySemantic(e)};h_.prototype.getPropertyIds=function(e){return this._metadataTable.getPropertyIds(e)};h_.prototype.getProperty=function(e){return this._metadataTable.getProperty(this._entityId,e)};h_.prototype.setProperty=function(e,t){return this._metadataTable.setProperty(this._entityId,e,t)};h_.prototype.getPropertyBySemantic=function(e){return this._metadataTable.getPropertyBySemantic(this._entityId,e)};h_.prototype.setPropertyBySemantic=function(e,t){return this._metadataTable.setPropertyBySemantic(this._entityId,e,t)};var kw=h_;var yk={QUADTREE:"QUADTREE",OCTREE:"OCTREE"};yk.getBranchingFactor=function(e){switch(e){case yk.OCTREE:return 8;case yk.QUADTREE:return 4}};Object.freeze(yk);var qs=yk;function m_(e){e=e??H.EMPTY_OBJECT;let t=e.subtreeMetadata,n=e.class,i=l(t.properties)?t.properties:{};this._class=n,this._properties=i,this._extras=t.extras,this._extensions=t.extensions}Object.defineProperties(m_.prototype,{class:{get:function(){return this._class}},extras:{get:function(){return this._extras}},extensions:{get:function(){return this._extensions}}});m_.prototype.hasProperty=function(e){return Yn.hasProperty(e,this._properties,this._class)};m_.prototype.hasPropertyBySemantic=function(e){return Yn.hasPropertyBySemantic(e,this._properties,this._class)};m_.prototype.getPropertyIds=function(e){return Yn.getPropertyIds(this._properties,this._class,e)};m_.prototype.getProperty=function(e){return Yn.getProperty(e,this._properties,this._class)};m_.prototype.setProperty=function(e,t){return Yn.setProperty(e,t,this._properties,this._class)};m_.prototype.getPropertyBySemantic=function(e){return Yn.getPropertyBySemantic(e,this._properties,this._class)};m_.prototype.setPropertyBySemantic=function(e,t){return Yn.setPropertyBySemantic(e,t,this._properties,this._class)};var Ak=m_;function mc(e,t,n){this._resource=e,this._subtreeJson=void 0,this._bufferLoader=void 0,this._tileAvailability=void 0,this._contentAvailabilityBitstreams=[],this._childSubtreeAvailability=void 0,this._implicitCoordinates=n,this._subtreeLevels=t.subtreeLevels,this._subdivisionScheme=t.subdivisionScheme,this._branchingFactor=t.branchingFactor,this._metadata=void 0,this._tileMetadataTable=void 0,this._tilePropertyTableJson=void 0,this._contentMetadataTables=[],this._contentPropertyTableJsons=[],this._tileJumpBuffer=void 0,this._contentJumpBuffers=[],this._ready=!1}Object.defineProperties(mc.prototype,{ready:{get:function(){return this._ready}},metadata:{get:function(){return this._metadata}},tileMetadataTable:{get:function(){return this._tileMetadataTable}},tilePropertyTableJson:{get:function(){return this._tilePropertyTableJson}},contentMetadataTables:{get:function(){return this._contentMetadataTables}},contentPropertyTableJsons:{get:function(){return this._contentPropertyTableJsons}},implicitCoordinates:{get:function(){return this._implicitCoordinates}}});mc.prototype.tileIsAvailableAtIndex=function(e){return this._tileAvailability.getBit(e)};mc.prototype.tileIsAvailableAtCoordinates=function(e){let t=this.getTileIndex(e);return this.tileIsAvailableAtIndex(t)};mc.prototype.contentIsAvailableAtIndex=function(e,t){return t=t??0,this._contentAvailabilityBitstreams[t].getBit(e)};mc.prototype.contentIsAvailableAtCoordinates=function(e,t){let n=this.getTileIndex(e);return this.contentIsAvailableAtIndex(n,t)};mc.prototype.childSubtreeIsAvailableAtIndex=function(e){return this._childSubtreeAvailability.getBit(e)};mc.prototype.childSubtreeIsAvailableAtCoordinates=function(e){let t=this.getChildSubtreeIndex(e);return this.childSubtreeIsAvailableAtIndex(t)};mc.prototype.getLevelOffset=function(e){let t=this._branchingFactor;return(Math.pow(t,e)-1)/(t-1)};mc.prototype.getParentMortonIndex=function(e){let t=2;return this._subdivisionScheme===qs.OCTREE&&(t=3),e>>t};mc.fromSubtreeJson=async function(e,t,n,i,r){let o=new mc(e,i,r),s;l(t)?s={json:t,binary:void 0}:s=_pt(n);let a=s.json;o._subtreeJson=a;let c;if(rr(a,"3DTILES_metadata"))c=a.extensions["3DTILES_metadata"];else if(l(a.tileMetadata)){let x=a.tileMetadata;c=a.propertyTables[x]}let u=[];if(l(a.contentMetadata)){let x=a.contentMetadata.length;for(let T=0;T<x;T++){let E=a.contentMetadata[T];u.push(a.propertyTables[E])}}let f,d=i.metadataSchema,p=a.subtreeMetadata;if(l(p)){let x=p.class,T=d.classes[x];f=new Ak({subtreeMetadata:p,class:T})}o._metadata=f,o._tilePropertyTableJson=c,o._contentPropertyTableJsons=u;let g={constant:0};a.contentAvailabilityHeaders=[],rr(a,"3DTILES_multiple_contents")?a.contentAvailabilityHeaders=a.extensions["3DTILES_multiple_contents"].contentAvailability:Array.isArray(a.contentAvailability)?a.contentAvailabilityHeaders=a.contentAvailability:a.contentAvailabilityHeaders.push(a.contentAvailability??g);let m=ypt(a.buffers),y=Apt(a.bufferViews,m);bpt(a,y),l(c)&&kCe(c,y);for(let x=0;x<u.length;x++){let T=u[x];kCe(T,y)}let A=await xpt(o,m,s.binary),b=Ept(y,A);return Cpt(o,a,i,b),l(c)&&(vpt(o,i,b),wpt(o)),Spt(o,i,b),Ipt(o),o._ready=!0,o};function _pt(e){let n=new DataView(e.buffer,e.byteOffset),i=8,r=n.getUint32(i,!0);i+=8;let o=n.getUint32(i,!0);i+=8;let s=No(e,i,r);i+=r;let a=e.subarray(i,i+o);return{json:s,binary:a}}function ypt(e){e=l(e)?e:[];for(let t=0;t<e.length;t++){let n=e[t];n.isExternal=l(n.uri),n.isActive=!1}return e}function Apt(e,t){e=l(e)?e:[];for(let n=0;n<e.length;n++){let i=e[n],r=t[i.buffer];i.bufferHeader=r,i.isActive=!1}return e}function bpt(e,t){let n,i=e.tileAvailability;l(i.bitstream)?n=t[i.bitstream]:l(i.bufferView)&&(n=t[i.bufferView]),l(n)&&(n.isActive=!0,n.bufferHeader.isActive=!0);let r=e.contentAvailabilityHeaders;for(let s=0;s<r.length;s++)n=void 0,l(r[s].bitstream)?n=t[r[s].bitstream]:l(r[s].bufferView)&&(n=t[r[s].bufferView]),l(n)&&(n.isActive=!0,n.bufferHeader.isActive=!0);n=void 0;let o=e.childSubtreeAvailability;l(o.bitstream)?n=t[o.bitstream]:l(o.bufferView)&&(n=t[o.bufferView]),l(n)&&(n.isActive=!0,n.bufferHeader.isActive=!0)}function kCe(e,t){let n=e.properties,i;for(let r in n)if(n.hasOwnProperty(r)){let o=n[r],s=o.values??o.bufferView;i=t[s],i.isActive=!0,i.bufferHeader.isActive=!0;let a=o.stringOffsets??o.stringOffsetBufferView;l(a)&&(i=t[a],i.isActive=!0,i.bufferHeader.isActive=!0);let c=o.arrayOffsets??o.arrayOffsetBufferView;l(c)&&(i=t[c],i.isActive=!0,i.bufferHeader.isActive=!0)}}function xpt(e,t,n){let i=[];for(let r=0;r<t.length;r++){let o=t[r];if(!o.isActive)i.push(Promise.resolve(void 0));else if(o.isExternal){let s=Tpt(e,o);i.push(s)}else i.push(Promise.resolve(n))}return Promise.all(i).then(function(r){let o={};for(let s=0;s<r.length;s++){let a=r[s];l(a)&&(o[s]=a)}return o})}async function Tpt(e,t){let i=e._resource.getDerivedResource({url:t.uri}),r=Fi.getExternalBufferLoader({resource:i});e._bufferLoader=r;try{await r.load()}catch(o){if(r.isDestroyed())return;throw o}return r.typedArray}function Ept(e,t){let n={};for(let i=0;i<e.length;i++){let r=e[i];if(!r.isActive)continue;let o=r.byteOffset,s=o+r.byteLength,c=t[r.buffer].subarray(o,s);n[i]=c}return n}function Cpt(e,t,n,i){let r=n.branchingFactor,o=n.subtreeLevels,s=(Math.pow(r,o)-1)/(r-1),a=Math.pow(r,o),c=rr(t,"3DTILES_metadata"),u=l(e._tilePropertyTableJson),f=c||u;e._tileAvailability=KQ(t.tileAvailability,i,s,f);let d=e._contentPropertyTableJsons.length>0;f=f||d;for(let p=0;p<t.contentAvailabilityHeaders.length;p++){let g=KQ(t.contentAvailabilityHeaders[p],i,s,f);e._contentAvailabilityBitstreams.push(g)}e._childSubtreeAvailability=KQ(t.childSubtreeAvailability,i,a)}function KQ(e,t,n,i){if(l(e.constant))return new Bw({constant:!!e.constant,lengthBits:n,availableCount:e.availableCount});let r;return l(e.bitstream)?r=t[e.bitstream]:l(e.bufferView)&&(r=t[e.bufferView]),new Bw({bitstream:r,lengthBits:n,availableCount:e.availableCount,computeAvailableCountEnabled:i})}function vpt(e,t,n){let i=e._tilePropertyTableJson,r=e._tileAvailability.availableCount,o=t.metadataSchema,s=i.class,a=o.classes[s];e._tileMetadataTable=new $d({class:a,count:r,properties:i.properties,bufferViews:n})}function Spt(e,t,n){let i=e._contentPropertyTableJsons,r=e._contentAvailabilityBitstreams,o=t.metadataSchema,s=e._contentMetadataTables;for(let a=0;a<i.length;a++){let c=i[a],f=r[a].availableCount,d=c.class,p=o.classes[d],g=new $d({class:p,count:f,properties:c.properties,bufferViews:n});s.push(g)}}function UCe(e){let t=0,n=e.lengthBits,i=e.availableCount,r;i<256?r=new Uint8Array(n):i<65536?r=new Uint16Array(n):r=new Uint32Array(n);for(let o=0;o<e.lengthBits;o++)e.getBit(o)&&(r[o]=t,t++);return r}function wpt(e){let t=UCe(e._tileAvailability);e._tileJumpBuffer=t}function Ipt(e){let t=e._contentJumpBuffers,n=e._contentAvailabilityBitstreams;for(let i=0;i<n.length;i++){let r=n[i],o=UCe(r);t.push(o)}}mc.prototype.getTileIndex=function(e){let t=e.level-this._implicitCoordinates.level;if(t<0||this._subtreeLevels<=t)throw new oe("level is out of bounds for this subtree");return e.getSubtreeCoordinates().getOffsetCoordinates(e).tileIndex};mc.prototype.getChildSubtreeIndex=function(e){if(e.level-this._implicitCoordinates.level!==this._implicitCoordinates.subtreeLevels)throw new oe("level is out of bounds for this subtree");return e.getParentSubtreeCoordinates().getOffsetCoordinates(e).mortonIndex};function Ppt(e,t){if(!l(e._tileMetadataTable))return;let n=e.getTileIndex(t);if(e._tileAvailability.getBit(n))return e._tileJumpBuffer[n]}function Dpt(e,t,n){let i=e._contentMetadataTables;if(!l(i))return;let r=i[n];if(!l(r))return;let o=e._contentAvailabilityBitstreams[n],s=e.getTileIndex(t);if(o.getBit(s))return e._contentJumpBuffers[n][s]}mc.prototype.getTileMetadataView=function(e){let t=Ppt(this,e);if(!l(t))return;let n=this._tileMetadataTable;return new kw({class:n.class,metadataTable:n,entityId:t,propertyTableJson:this._tilePropertyTableJson})};mc.prototype.getContentMetadataView=function(e,t){let n=Dpt(this,e,t);if(!l(n))return;let i=this._contentMetadataTables[t],r=this._contentPropertyTableJsons[t];return new kw({class:i.class,metadataTable:i,entityId:n,contentIndex:t,propertyTableJson:r})};mc.prototype.isDestroyed=function(){return!1};mc.prototype.destroy=function(){return l(this._bufferLoader)&&Fi.unload(this._bufferLoader),le(this)};var p_=mc;var zCe={ID:"ID",NAME:"NAME",DESCRIPTION:"DESCRIPTION",TILESET_TILE_COUNT:"TILESET_TILE_COUNT",TILE_BOUNDING_BOX:"TILE_BOUNDING_BOX",TILE_BOUNDING_REGION:"TILE_BOUNDING_REGION",TILE_BOUNDING_SPHERE:"TILE_BOUNDING_SPHERE",TILE_MINIMUM_HEIGHT:"TILE_MINIMUM_HEIGHT",TILE_MAXIMUM_HEIGHT:"TILE_MAXIMUM_HEIGHT",TILE_HORIZON_OCCLUSION_POINT:"TILE_HORIZON_OCCLUSION_POINT",TILE_GEOMETRIC_ERROR:"TILE_GEOMETRIC_ERROR",CONTENT_BOUNDING_BOX:"CONTENT_BOUNDING_BOX",CONTENT_BOUNDING_REGION:"CONTENT_BOUNDING_REGION",CONTENT_BOUNDING_SPHERE:"CONTENT_BOUNDING_SPHERE",CONTENT_MINIMUM_HEIGHT:"CONTENT_MINIMUM_HEIGHT",CONTENT_MAXIMUM_HEIGHT:"CONTENT_MAXIMUM_HEIGHT",CONTENT_HORIZON_OCCLUSION_POINT:"CONTENT_HORIZON_OCCLUSION_POINT"};Object.freeze(zCe);var rh=zCe;var kA={};kA.parseAllBoundingVolumeSemantics=function(e,t){return{boundingVolume:kA.parseBoundingVolumeSemantic(e,t),minimumHeight:kA._parseMinimumHeight(e,t),maximumHeight:kA._parseMaximumHeight(e,t)}};kA.parseBoundingVolumeSemantic=function(e,t){let n=`${e}_BOUNDING_BOX`,i=t.getPropertyBySemantic(n);if(l(i))return{box:i};let r=`${e}_BOUNDING_REGION`,o=t.getPropertyBySemantic(r);if(l(o))return{region:o};let s=`${e}_BOUNDING_SPHERE`,a=t.getPropertyBySemantic(s);if(l(a))return{sphere:a}};kA._parseMinimumHeight=function(e,t){let n=`${e}_MINIMUM_HEIGHT`;return t.getPropertyBySemantic(n)};kA._parseMaximumHeight=function(e,t){let n=`${e}_MAXIMUM_HEIGHT`;return t.getPropertyBySemantic(n)};var UA=kA;var Uw=class e{constructor(t,n,i){let r=n.implicitTileset,o=n.implicitCoordinates;this._implicitTileset=r,this._implicitCoordinates=o,this._implicitSubtree=void 0,this._tileset=t,this._tile=n,this._resource=i,this._metadata=void 0,this.featurePropertiesDirty=!1,this._group=void 0;let s=o.getTemplateValues(),a=r.subtreeUriTemplate.getDerivedResource({templateValues:s});this._url=a.getUrlComponent(!0),this._ready=!1}get featuresLength(){return 0}get pointsLength(){return 0}get trianglesLength(){return 0}get geometryByteLength(){return 0}get texturesByteLength(){return 0}get batchTableByteLength(){return 0}get innerContents(){}get ready(){return this._ready}get tileset(){return this._tileset}get tile(){return this._tile}get url(){return this._url}get metadata(){}set metadata(t){}get batchTable(){}get group(){return this._group}set group(t){this._group=t}static async fromSubtreeJson(t,n,i,r,o,s){s=s??0;let a;l(o)&&(a=new Uint8Array(o,s));let c=n.implicitTileset,u=n.implicitCoordinates,f=await p_.fromSubtreeJson(i,r,a,c,u),d=new e(t,n,i);return d._implicitSubtree=f,Rpt(d,f),d._ready=!0,d}hasProperty(t,n){return!1}getFeature(t){}applyDebugSettings(t,n){}applyStyle(t){}update(t,n){}pick(t,n,i){}isDestroyed(){return!1}destroy(){return this._implicitSubtree=this._implicitSubtree&&this._implicitSubtree.destroy(),le(this)}};function Rpt(e,t){let n=e._tile,i=e._implicitCoordinates.childIndex,r=Mpt(e,t,n,i),o=e._tileset.statistics;n.children.push(r.rootTile),o.numberOfTilesTotal++;let s=Opt(e,t,r.bottomRow);for(let a=0;a<s.length;a++){let c=s[a],u=c.tile,f=jpt(e,u,c.childIndex);u.children.push(f),o.numberOfTilesTotal++}}function Opt(e,t,n){let i=[],r=e._implicitTileset.branchingFactor;for(let o=0;o<n.length;o++){let s=n[o];if(l(s))for(let a=0;a<r;a++){let c=o*r+a;t.childSubtreeIsAvailableAtIndex(c)&&i.push({tile:s,childIndex:a})}}return i}function Mpt(e,t,n,i){let s=VCe(e,t,n,i,0,!0),a=e._tileset.statistics,c=[s],u=[],f=e._implicitTileset;for(let d=1;d<f.subtreeLevels;d++){let p=t.getLevelOffset(d),g=f.branchingFactor*c.length;for(let m=0;m<g;m++){let y=p+m;if(!t.tileIsAvailableAtIndex(y)){u.push(void 0);continue}let A=t.getParentMortonIndex(m),b=c[A],x=m%f.branchingFactor,T=VCe(e,t,b,x,y);b.children.push(T),a.numberOfTilesTotal++,u.push(T)}c=u,u=[]}return{rootTile:s,bottomRow:c}}function jCe(e,t,n){let i=rh.TILE_GEOMETRIC_ERROR;return l(e)&&e.hasPropertyBySemantic(i)?e.getPropertyBySemantic(i):t.geometricError/Math.pow(2,n.level)}function VCe(e,t,n,i,r,o){let s=e._implicitTileset,a;o??!1?a=n.implicitCoordinates:a=n.implicitCoordinates.getChildCoordinates(i);let c,u;l(t.tilePropertyTableJson)&&(c=t.getTileMetadataView(a),u=UA.parseAllBoundingVolumeSemantics("TILE",c));let d=t.contentPropertyTableJsons.length,p=!1;for(let v=0;v<d;v++)if(t.contentIsAvailableAtCoordinates(a,v)){p=!0;break}let g=Fpt(s,a,i,o,n,u),m=[];for(let v=0;v<s.contentCount;v++){if(!t.contentIsAvailableAtIndex(r,v))continue;let R={uri:s.contentUriTemplates[v].getDerivedResource({templateValues:a.getTemplateValues()}).url},O;if(t.contentPropertyTableJsons.length>0){let _=t.getContentMetadataView(a,v);O=UA.parseAllBoundingVolumeSemantics("CONTENT",_)}let L=Bpt(g,O);l(L)&&(R.boundingVolume=L),m.push(Ot(R,s.contentHeaders[v]))}let y=jCe(c,s,a),A={boundingVolume:g,geometricError:y,refine:s.refine,contents:m},b=!0,x=Je(s.tileHeader,b);delete x.boundingVolume,delete x.transform,delete x.metadata;let T=Ot(A,x,b),E=YCe(e,s.baseResource,T,n);return E.implicitCoordinates=a,E.implicitSubtree=t,E.metadata=c,E.hasImplicitContentMetadata=p,E}function EG(e,t){return l(e)&&l(t)&&(l(t.minimumHeight)||l(t.maximumHeight))&&(rr(e,"3DTILES_bounding_volume_S2")||l(e.region))}function JQ(e,t){l(t)&&(rr(e,"3DTILES_bounding_volume_S2")?Lpt(e.extensions["3DTILES_bounding_volume_S2"],t.minimumHeight,t.maximumHeight):l(e.region)&&Npt(e.region,t.minimumHeight,t.maximumHeight))}function Npt(e,t,n){l(t)&&(e[4]=t),l(n)&&(e[5]=n)}function Lpt(e,t,n){l(t)&&(e.minimumHeight=t),l(n)&&(e.maximumHeight=n)}function Fpt(e,t,n,i,r,o){let s;return!l(o)||!l(o.boundingVolume)||!EG(o.boundingVolume,o)&&EG(e.boundingVolume,o)?s=HCe(e,t,n,i??!1,r):s=o.boundingVolume,JQ(s,o),s}function Bpt(e,t){let n;return l(t)&&(n=t.boundingVolume),EG(n,t)?JQ(n,t):EG(e,t)&&(n=Je(e,!0),JQ(n,t)),n}function HCe(e,t,n,i,r){let o=e.boundingVolume;return rr(o,"3DTILES_bounding_volume_S2")?GCe(i,r,n,t.level,t.x,t.y,t.z):l(o.region)?{region:qCe(o.region,t.level,t.x,t.y,t.z)}:{box:WCe(o.box,t.level,t.x,t.y,t.z)}}function GCe(e,t,n,i,r,o,s){let a=t._boundingVolume;if(e)return{extensions:{"3DTILES_bounding_volume_S2":{token:d_.getTokenFromId(a.s2Cell._cellId),minimumHeight:a.minimumHeight,maximumHeight:a.maximumHeight}}};let c=Number(t._boundingVolume.s2Cell._cellId>>BigInt(61)),u=c%2===0?Lw.encode2D(i,r,o):Lw.encode2D(i,o,r),f=d_.fromFacePositionLevel(c,BigInt(u),i),d,p;if(l(s)){let g=(a.maximumHeight+a.minimumHeight)/2;d=n<4?a.minimumHeight:g,p=n<4?g:a.maximumHeight}else d=a.minimumHeight,p=a.maximumHeight;return{extensions:{"3DTILES_bounding_volume_S2":{token:d_.getTokenFromId(f._cellId),minimumHeight:d,maximumHeight:p}}}}var kpt=new h,Upt=new h,$Q=new h,zpt=new $;function WCe(e,t,n,i,r){if(t===0)return e;let o=h.unpack(e,0,Upt),s=$.unpack(e,3,zpt),a=Math.pow(2,-t),c=-1+(2*n+1)*a,u=-1+(2*i+1)*a,f=0,d=h.fromElements(a,a,1,kpt);l(r)&&(f=-1+(2*r+1)*a,d.z=a);let p=h.fromElements(c,u,f,$Q);p=$.multiplyByVector(s,p,$Q),p=h.add(p,o,$Q);let g=$.clone(s);g=$.multiplyByScale(g,d,g);let m=new Array(12);return h.pack(p,m),$.pack(g,m,3),m}var Vpt=new ie;function qCe(e,t,n,i,r){if(t===0)return e.slice();let o=ie.unpack(e,0,Vpt),s=e[4],a=e[5],c=Math.pow(2,-t),u=c*o.width,f=D.negativePiToPi(o.west+n*u),d=D.negativePiToPi(f+u),p=c*o.height,g=D.negativePiToPi(o.south+i*p),m=D.negativePiToPi(g+p),y=s,A=a;if(l(r)){let b=c*(a-s);y+=r*b,A=y+b}return[f,g,d,m,y,A]}function jpt(e,t,n){let i=e._implicitTileset,r=t.implicitCoordinates.getChildCoordinates(n),o=HCe(i,r,n,!1,t),s=jCe(void 0,i,r),a=i.subtreeUriTemplate.getDerivedResource({templateValues:r.getTemplateValues()}).url,c={boundingVolume:o,geometricError:s,refine:i.refine,contents:[{uri:a}]},u=YCe(e,i.baseResource,c,t);return u.implicitTileset=i,u.implicitCoordinates=r,u}function YCe(e,t,n,i){let r=e._tile.constructor;return new r(e._tileset,t,n,i)}Uw._deriveBoundingBox=WCe;Uw._deriveBoundingRegion=qCe;Uw._deriveBoundingVolumeS2=GCe;var zw=Uw;var ZQ=class e{constructor(t,n,i){this._tileset=t,this._tile=n,this._resource=i,this._model=void 0,this._metadata=void 0,this._group=void 0,this._ready=!1}get featuresLength(){let t=this._model,n=t.featureTables,i=t.featureTableId;return l(n)&&l(n[i])?n[i].featuresLength:0}get pointsLength(){return this._model.statistics.pointsLength}get trianglesLength(){return this._model.statistics.trianglesLength}get geometryByteLength(){return this._model.statistics.geometryByteLength}get texturesByteLength(){return this._model.statistics.texturesByteLength}get batchTableByteLength(){let t=this._model.statistics;return t.propertyTablesByteLength+t.batchTexturesByteLength}get innerContents(){}get ready(){return this._ready}get tileset(){return this._tileset}get tile(){return this._tile}get url(){return this._resource.getUrlComponent(!0)}get batchTable(){let t=this._model,n=t.featureTables,i=t.featureTableId;if(l(n)&&l(n[i]))return n[i]}get metadata(){return this._metadata}set metadata(t){this._metadata=t}get group(){return this._group}set group(t){this._group=t}getTextureIds(){return this._model.statistics.getTextureIds()}getTextureByteLengthById(t){return this._model.statistics.getTextureByteLengthById(t)}getExtension(t){return this._model.getExtension(t)}getFeature(t){let n=this._model,i=n.featureTableId;return n.featureTables[i].getFeature(t)}hasProperty(t,n){let i=this._model,r=i.featureTableId;return l(r)?i.featureTables[r].hasProperty(t,n):!1}applyDebugSettings(t,n){n=t?n:z.WHITE,this.featuresLength===0?this._model.color=n:l(this.batchTable)&&this.batchTable.setAllColor(n)}applyStyle(t){this._model.style=t}update(t,n){let i=this._model,r=this._tile;i.colorBlendAmount=t.colorBlendAmount,i.colorBlendMode=t.colorBlendMode,i.modelMatrix=r.computedTransform,i.customShader=t.customShader,i.featureIdLabel=t.featureIdLabel,i.instanceFeatureIdLabel=t.instanceFeatureIdLabel,i.lightColor=t.lightColor,i.imageBasedLighting=t.imageBasedLighting,i.backFaceCulling=t.backFaceCulling,i.shadows=t.shadows,i.showCreditsOnScreen=t.showCreditsOnScreen,i.splitDirection=t.splitDirection,i.debugWireframe=t.debugWireframe,i.edgeDisplayMode=t.edgeDisplayMode,i.showOutline=t.showOutline,i.outlineColor=t.outlineColor,i.pointCloudShading=t.pointCloudShading;let o=t.clippingPlanes;i.referenceMatrix=t.clippingPlanesOriginMatrix,l(o)&&r.clippingPlanesDirty&&(i._clippingPlanes=o.enabled&&r._isClipped?o:void 0);let s=t.environmentMapManager;i.environmentMapManager!==o&&(i._environmentMapManager=s),l(o)&&l(i._clippingPlanes)&&i._clippingPlanes!==o&&(i._clippingPlanes=o,i._clippingPlanesState=0);let a=t.clippingPolygons;l(a)&&r.clippingPolygonsDirty&&(i._clippingPolygons=a.enabled&&r._isClippedByPolygon?a:void 0),l(a)&&l(i._clippingPolygons)&&i._clippingPolygons!==a&&(i._clippingPolygons=a,i._clippingPolygonsState=0),r.clippingPolygonsNeedRebake&&(i._clippingPolygonsNeedRebake=!0),i.update(n),!this._ready&&i.ready&&(i.activeAnimations.addAll({loop:Yu.REPEAT}),this._ready=!0)}isDestroyed(){return!1}destroy(){return this._model=this._model&&this._model.destroy(),le(this)}static async fromGltf(t,n,i,r){let o=new e(t,n,i),a=bk(t,n,o,{gltf:r,basePath:i}),c=t.vectorClassificationOnly?void 0:t.classificationType;a.classificationType=c;let u=await $f.fromGltfAsync(a);return o._model=u,o}static async fromB3dm(t,n,i,r,o){let s=new e(t,n,i),c=bk(t,n,s,{arrayBuffer:r,byteOffset:o,resource:i}),u=t.vectorClassificationOnly?void 0:t.classificationType;c.classificationType=u;let f=await $f.fromB3dm(c);return s._model=f,s}static async fromI3dm(t,n,i,r,o){let s=new e(t,n,i),c=bk(t,n,s,{arrayBuffer:r,byteOffset:o,resource:i}),u=await $f.fromI3dm(c);return s._model=u,s}static async fromPnts(t,n,i,r,o){let s=new e(t,n,i),c=bk(t,n,s,{arrayBuffer:r,byteOffset:o,resource:i}),u=await $f.fromPnts(c);return s._model=u,s}static async fromGeoJson(t,n,i,r){let o=new e(t,n,i),a=bk(t,n,o,{geoJson:r,resource:i}),c=await $f.fromGeoJson(a);return o._model=c,o}pick(t,n,i){if(!l(this._model)||!this._ready)return;let r=n.verticalExaggeration,o=n.verticalExaggerationRelativeHeight;return this._model.pick(t,n,r,o,ee.WGS84,i)}};function bk(e,t,n,i){let r={cull:!1,releaseGltfJson:!0,opaquePass:Ie.CESIUM_3D_TILE,modelMatrix:t.computedTransform,upAxis:e._modelUpAxis,forwardAxis:e._modelForwardAxis,incrementallyLoadTextures:!1,customShader:e.customShader,content:n,scene:e._scene,colorBlendMode:e.colorBlendMode,colorBlendAmount:e.colorBlendAmount,lightColor:e.lightColor,imageBasedLighting:e.imageBasedLighting,featureIdLabel:e.featureIdLabel,instanceFeatureIdLabel:e.instanceFeatureIdLabel,pointCloudShading:e.pointCloudShading,clippingPlanes:e.clippingPlanes,backFaceCulling:e.backFaceCulling,shadows:e.shadows,showCreditsOnScreen:e.showCreditsOnScreen,splitDirection:e.splitDirection,enableDebugWireframe:e._enableDebugWireframe,debugWireframe:e.debugWireframe,projectTo2D:e._projectTo2D,enablePick:e._enablePick,enableShowOutline:e._enableShowOutline,showOutline:e.showOutline,outlineColor:e.outlineColor};return Ot(i,r)}var Zf=ZQ;var QQ=class e{constructor(t,n,i){this._tileset=t,this._tile=n,this._resource=i,this.featurePropertiesDirty=!1,this._metadata=void 0,this._group=void 0,this._ready=!1}get featuresLength(){return 0}get pointsLength(){return 0}get trianglesLength(){return 0}get geometryByteLength(){return 0}get texturesByteLength(){return 0}get batchTableByteLength(){return 0}get innerContents(){}get ready(){return this._ready}get tileset(){return this._tileset}get tile(){return this._tile}get url(){return this._resource.getUrlComponent(!0)}get batchTable(){}get metadata(){return this._metadata}set metadata(t){this._metadata=t}get group(){return this._group}set group(t){this._group=t}static fromJson(t,n,i,r){let o=new e(t,n,i);return o._tileset.loadTileset(o._resource,r,o._tile),o._ready=!0,o}hasProperty(t,n){return!1}getFeature(t){}applyDebugSettings(t,n){}applyStyle(t){}update(t,n){}pick(t,n,i){}isDestroyed(){return!1}destroy(){return le(this)}},xk=QQ;function Hpt(e,t,n,i,r){return function(){let o=document.createElement("canvas"),s=r+2*i;o.height=o.width=s;let a=o.getContext("2d");return a.clearRect(0,0,s,s),i!==0&&(a.beginPath(),a.arc(s/2,s/2,s/2,0,2*Math.PI,!0),a.closePath(),a.fillStyle=n,a.fill(),e<1&&(a.save(),a.globalCompositeOperation="destination-out",a.beginPath(),a.arc(s/2,s/2,r/2,0,2*Math.PI,!0),a.closePath(),a.fillStyle="black",a.fill(),a.restore())),a.beginPath(),a.arc(s/2,s/2,r/2,0,2*Math.PI,!0),a.closePath(),a.fillStyle=t,a.fill(),o}}var QT=Hpt;var Gpt=new he,Mm=class{constructor(t,n,i,r,o){this._content=t,this._billboard=i,this._label=r,this._polyline=o,this._batchId=n,this._billboardImage=void 0,this._billboardColor=void 0,this._billboardOutlineColor=void 0,this._billboardOutlineWidth=void 0,this._billboardSize=void 0,this._pointSize=void 0,this._color=void 0,this._pointSize=void 0,this._pointOutlineColor=void 0,this._pointOutlineWidth=void 0,this._heightOffset=void 0,this._pickIds=new Array(3),Vw(this)}get show(){return this._label.show}set show(t){this._label.show=t,this._billboard.show=t,this._polyline.show=t}get color(){return this._color}set color(t){this._color=z.clone(t,this._color),Vw(this)}get pointSize(){return this._pointSize}set pointSize(t){this._pointSize=t,Vw(this)}get pointOutlineColor(){return this._pointOutlineColor}set pointOutlineColor(t){this._pointOutlineColor=z.clone(t,this._pointOutlineColor),Vw(this)}get pointOutlineWidth(){return this._pointOutlineWidth}set pointOutlineWidth(t){this._pointOutlineWidth=t,Vw(this)}get labelColor(){return this._label.fillColor}set labelColor(t){this._label.fillColor=t,this._polyline.show=this._label.show&&t.alpha>0}get labelOutlineColor(){return this._label.outlineColor}set labelOutlineColor(t){this._label.outlineColor=t}get labelOutlineWidth(){return this._label.outlineWidth}set labelOutlineWidth(t){this._label.outlineWidth=t}get font(){return this._label.font}set font(t){this._label.font=t}get labelStyle(){return this._label.style}set labelStyle(t){this._label.style=t}get labelText(){return this._label.text}set labelText(t){l(t)||(t=""),this._label.text=t}get backgroundColor(){return this._label.backgroundColor}set backgroundColor(t){this._label.backgroundColor=t}get backgroundPadding(){return this._label.backgroundPadding}set backgroundPadding(t){this._label.backgroundPadding=t}get backgroundEnabled(){return this._label.showBackground}set backgroundEnabled(t){this._label.showBackground=t}get scaleByDistance(){return this._label.scaleByDistance}set scaleByDistance(t){this._label.scaleByDistance=t,this._billboard.scaleByDistance=t}get translucencyByDistance(){return this._label.translucencyByDistance}set translucencyByDistance(t){this._label.translucencyByDistance=t,this._billboard.translucencyByDistance=t}get distanceDisplayCondition(){return this._label.distanceDisplayCondition}set distanceDisplayCondition(t){this._label.distanceDisplayCondition=t,this._polyline.distanceDisplayCondition=t,this._billboard.distanceDisplayCondition=t}get heightOffset(){return this._heightOffset}set heightOffset(t){let n=this._heightOffset??0,i=this._content.tileset.ellipsoid,r=i.cartesianToCartographic(this._billboard.position,Gpt);r.height=r.height-n+t;let o=i.cartographicToCartesian(r);this._billboard.position=o,this._label.position=this._billboard.position,this._polyline.positions=[this._polyline.positions[0],o],this._heightOffset=t}get anchorLineEnabled(){return this._polyline.show}set anchorLineEnabled(t){this._polyline.show=t}get anchorLineColor(){return this._polyline.material.uniforms.color}set anchorLineColor(t){this._polyline.material.uniforms.color=z.clone(t,this._polyline.material.uniforms.color)}get image(){return this._billboardImage}set image(t){let n=this._billboardImage!==t;this._billboardImage=t,n&&Vw(this)}get disableDepthTestDistance(){return this._label.disableDepthTestDistance}set disableDepthTestDistance(t){this._label.disableDepthTestDistance=t,this._billboard.disableDepthTestDistance=t}get horizontalOrigin(){return this._billboard.horizontalOrigin}set horizontalOrigin(t){this._billboard.horizontalOrigin=t}get verticalOrigin(){return this._billboard.verticalOrigin}set verticalOrigin(t){this._billboard.verticalOrigin=t}get labelHorizontalOrigin(){return this._label.horizontalOrigin}set labelHorizontalOrigin(t){this._label.horizontalOrigin=t}get labelVerticalOrigin(){return this._label.verticalOrigin}set labelVerticalOrigin(t){this._label.verticalOrigin=t}get content(){return this._content}get tileset(){return this._content.tileset}get primitive(){return this._content.tileset}get pickIds(){let t=this._pickIds;return t[0]=this._billboard.pickId,t[1]=this._label.pickId,t[2]=this._polyline.pickId,t}hasProperty(t){return this._content.batchTable.hasProperty(this._batchId,t)}getPropertyIds(t){return this._content.batchTable.getPropertyIds(this._batchId,t)}getProperty(t){return this._content.batchTable.getProperty(this._batchId,t)}getPropertyInherited(t){return oa.getPropertyInherited(this._content,this._batchId,t)}setProperty(t,n){this._content.batchTable.setProperty(this._batchId,t,n),this._content.featurePropertiesDirty=!0}isExactClass(t){return this._content.batchTable.isExactClass(this._batchId,t)}isClass(t){return this._content.batchTable.isClass(this._batchId,t)}getExactClassName(){return this._content.batchTable.getExactClassName(this._batchId)}};ut(Mm,"defaultColor",z.WHITE),ut(Mm,"defaultPointOutlineColor",z.BLACK),ut(Mm,"defaultPointOutlineWidth",0),ut(Mm,"defaultPointSize",8);function Vw(e){let t=e._billboard;if(l(e._billboardImage)&&e._billboardImage!==t.image){t.image=e._billboardImage;return}if(l(e._billboardImage))return;let n=e._color??Mm.defaultColor,i=e._pointOutlineColor??Mm.defaultPointOutlineColor,r=e._pointOutlineWidth??Mm.defaultPointOutlineWidth,o=e._pointSize??Mm.defaultPointSize,s=e._billboardColor,a=e._billboardOutlineColor,c=e._billboardOutlineWidth,u=e._billboardSize;if(z.equals(n,s)&&z.equals(i,a)&&r===c&&o===u)return;e._billboardColor=z.clone(n,e._billboardColor),e._billboardOutlineColor=z.clone(i,e._billboardOutlineColor),e._billboardOutlineWidth=r,e._billboardSize=o;let f=n.alpha,d=n.toCssColorString(),p=i.toCssColorString(),g=JSON.stringify([d,o,p,r]);t.setImage(g,QT(f,d,p,r,o))}var g_=Mm;function Qf(e,t){e=e??H.EMPTY_OBJECT,this._show=e.show??!0,this._width=e.width??1,this._loop=e.loop??!1,this._distanceDisplayCondition=e.distanceDisplayCondition,this._material=e.material,l(this._material)||(this._material=er.fromType(er.ColorType,{color:new z(1,1,1,1)}));let n=e.positions;l(n)||(n=[]),this._positions=n,this._actualPositions=Fr(n,h.equalsEpsilon),this._loop&&this._actualPositions.length>2&&(this._actualPositions===this._positions&&(this._actualPositions=n.slice()),this._actualPositions.push(h.clone(this._actualPositions[0]))),this._length=this._actualPositions.length,this._id=e.id;let i;l(t)&&(i=N.clone(t.modelMatrix)),this._modelMatrix=i,this._segments=nr.wrapLongitude(this._actualPositions,i),this._actualLength=void 0,this._propertiesChanged=new Uint32Array(KCe),this._polylineCollection=t,this._dirty=!1,this._pickId=void 0,this._boundingVolume=ue.fromPoints(this._actualPositions),this._boundingVolumeWC=ue.transform(this._boundingVolume,this._modelMatrix),this._boundingVolume2D=new ue}var XCe=Qf.POSITION_INDEX=0,Wpt=Qf.SHOW_INDEX=1,qpt=Qf.WIDTH_INDEX=2,Ypt=Qf.MATERIAL_INDEX=3,Tk=Qf.POSITION_SIZE_INDEX=4,Xpt=Qf.DISTANCE_DISPLAY_CONDITION=5,KCe=Qf.NUMBER_OF_PROPERTIES=6;function __(e,t){++e._propertiesChanged[t];let n=e._polylineCollection;l(n)&&(n._updatePolyline(e,t),e._dirty=!0)}Object.defineProperties(Qf.prototype,{show:{get:function(){return this._show},set:function(e){e!==this._show&&(this._show=e,__(this,Wpt))}},positions:{get:function(){return this._positions},set:function(e){let t=Fr(e,h.equalsEpsilon);this._loop&&t.length>2&&(t===e&&(t=e.slice()),t.push(h.clone(t[0]))),(this._actualPositions.length!==t.length||this._actualPositions.length!==this._length)&&__(this,Tk),this._positions=e,this._actualPositions=t,this._length=t.length,this._boundingVolume=ue.fromPoints(this._actualPositions,this._boundingVolume),this._boundingVolumeWC=ue.transform(this._boundingVolume,this._modelMatrix,this._boundingVolumeWC),__(this,XCe),this.update()}},material:{get:function(){return this._material},set:function(e){this._material!==e&&(this._material=e,__(this,Ypt))}},width:{get:function(){return this._width},set:function(e){let t=this._width;e!==t&&(this._width=e,__(this,qpt))}},loop:{get:function(){return this._loop},set:function(e){if(e!==this._loop){let t=this._actualPositions;e?t.length>2&&!h.equals(t[0],t[t.length-1])&&(t.length===this._positions.length&&(this._actualPositions=t=this._positions.slice()),t.push(h.clone(t[0]))):t.length>2&&h.equals(t[0],t[t.length-1])&&(t.length-1===this._positions.length?this._actualPositions=this._positions:t.pop()),this._loop=e,__(this,Tk)}}},id:{get:function(){return this._id},set:function(e){this._id=e,l(this._pickId)&&(this._pickId.object.id=e)}},pickId:{get:function(){return this._pickId}},isDestroyed:{get:function(){return!l(this._polylineCollection)}},distanceDisplayCondition:{get:function(){return this._distanceDisplayCondition},set:function(e){Ht.equals(e,this._distanceDisplayCondition)||(this._distanceDisplayCondition=Ht.clone(e,this._distanceDisplayCondition),__(this,Xpt))}}});Qf.prototype.update=function(){let e=N.IDENTITY;l(this._polylineCollection)&&(e=this._polylineCollection.modelMatrix);let t=this._segments.positions.length,n=this._segments.lengths,i=this._propertiesChanged[XCe]>0||this._propertiesChanged[Tk]>0;if((!N.equals(e,this._modelMatrix)||i)&&(this._segments=nr.wrapLongitude(this._actualPositions,e),this._boundingVolumeWC=ue.transform(this._boundingVolume,e,this._boundingVolumeWC)),this._modelMatrix=N.clone(e,this._modelMatrix),this._segments.positions.length!==t)__(this,Tk);else{let r=n.length;for(let o=0;o<r;++o)if(n[o]!==this._segments.lengths[o]){__(this,Tk);break}}};Qf.prototype.getPickId=function(e){return l(this._pickId)||(this._pickId=e.createPickId({primitive:this,collection:this._polylineCollection,id:this._id})),this._pickId};Qf.prototype._clean=function(){this._dirty=!1;let e=this._propertiesChanged;for(let t=0;t<KCe-1;++t)e[t]=0};Qf.prototype._destroy=function(){this._pickId=this._pickId&&this._pickId.destroy(),this._material=this._material&&this._material.destroy(),this._polylineCollection=void 0};var oh=Qf;var Kpt=oh.SHOW_INDEX,$pt=oh.WIDTH_INDEX,tee=oh.POSITION_INDEX,Jpt=oh.MATERIAL_INDEX,$Ce=oh.POSITION_SIZE_INDEX,Zpt=oh.DISTANCE_DISPLAY_CONDITION,ive=oh.NUMBER_OF_PROPERTIES,Qu={texCoordExpandAndBatchIndex:0,position3DHigh:1,position3DLow:2,position2DHigh:3,position2DLow:4,prevPosition3DHigh:5,prevPosition3DLow:6,prevPosition2DHigh:7,prevPosition2DLow:8,nextPosition3DHigh:9,nextPosition3DLow:10,nextPosition2DHigh:11,nextPosition2DLow:12};function Nm(e){e=e??H.EMPTY_OBJECT,this.show=e.show??!0,this.modelMatrix=N.clone(e.modelMatrix??N.IDENTITY),this._modelMatrix=N.clone(N.IDENTITY),this.debugShowBoundingVolume=e.debugShowBoundingVolume??!1,this._opaqueRS=void 0,this._translucentRS=void 0,this._colorCommands=[],this._polylinesUpdated=!1,this._polylinesRemoved=!1,this._createVertexArray=!1,this._propertiesChanged=new Uint32Array(ive),this._polylines=[],this._polylineBuckets={},this._positionBufferUsage={bufferUsage:Me.STATIC_DRAW,frameCount:0},this._mode=void 0,this._polylinesToUpdate=[],this._vertexArrays=[],this._positionBuffer=void 0,this._texCoordExpandAndBatchIndexBuffer=void 0,this._batchTable=void 0,this._createBatchTable=!1,this._useHighlightColor=!1,this._highlightColor=z.clone(z.WHITE);let t=this;this._uniformMap={u_highlightColor:function(){return t._highlightColor}}}Object.defineProperties(Nm.prototype,{length:{get:function(){return nee(this),this._polylines.length}}});Nm.prototype.add=function(e){let t=new oh(e,this);return t._index=this._polylines.length,this._polylines.push(t),this._createVertexArray=!0,this._createBatchTable=!0,t};Nm.prototype.remove=function(e){if(this.contains(e)){if(this._polylinesRemoved=!0,this._createVertexArray=!0,this._createBatchTable=!0,l(e._bucket)){let t=e._bucket;t.shaderProgram=t.shaderProgram&&t.shaderProgram.destroy()}return e._destroy(),!0}return!1};Nm.prototype.removeAll=function(){iee(this),cve(this),this._polylineBuckets={},this._polylinesRemoved=!1,this._polylines.length=0,this._polylinesToUpdate.length=0,this._createVertexArray=!0};Nm.prototype.contains=function(e){return l(e)&&e._polylineCollection===this};Nm.prototype.get=function(e){return nee(this),this._polylines[e]};function Qpt(e,t){l(e._batchTable)&&e._batchTable.destroy();let n=[{functionName:"batchTable_getWidthAndShow",componentDatatype:Y.UNSIGNED_BYTE,componentsPerAttribute:2},{functionName:"batchTable_getPickColor",componentDatatype:Y.UNSIGNED_BYTE,componentsPerAttribute:4,normalize:!0},{functionName:"batchTable_getCenterHigh",componentDatatype:Y.FLOAT,componentsPerAttribute:3},{functionName:"batchTable_getCenterLowAndRadius",componentDatatype:Y.FLOAT,componentsPerAttribute:4},{functionName:"batchTable_getDistanceDisplayCondition",componentDatatype:Y.FLOAT,componentsPerAttribute:2}];e._batchTable=new Px(t,n,e._polylines.length)}var rve=new Sn,ove=new se,sve=new U;Nm.prototype.update=function(e){if(nee(this),this._polylines.length===0||!this.show)return;o0t(this,e);let t=e.context,n=e.mapProjection,i,r=this._propertiesChanged;if(this._createBatchTable){if(kt.maximumVertexTextureImageUnits===0)throw new oe("Vertex texture fetch support is required to render polylines. The maximum number of vertex texture image units must be greater than zero.");Qpt(this,t),this._createBatchTable=!1}if(this._createVertexArray||t0t(this))QCe(this,t,n);else if(this._polylinesUpdated){let c=this._polylinesToUpdate;if(this._mode!==re.SCENE3D){let u=c.length;for(let f=0;f<u;++f)i=c[f],i.update()}if(r[$Ce]||r[Jpt])QCe(this,t,n);else{let u=c.length,f=this._polylineBuckets;for(let d=0;d<u;++d){i=c[d],r=i._propertiesChanged;let p=i._bucket,g=0;for(let m in f)if(f.hasOwnProperty(m)){if(f[m]===p){r[tee]&&p.writeUpdate(g,i,this._positionBuffer,n);break}g+=f[m].lengthOfPositions}if((r[Kpt]||r[$pt])&&this._batchTable.setBatchedAttribute(i._index,0,new U(i._width,i._show)),this._batchTable.attributes.length>2){if(r[tee]||r[$Ce]){let m=e.mode===re.SCENE2D?i._boundingVolume2D:i._boundingVolumeWC,y=Sn.fromCartesian(m.center,rve),A=se.fromElements(y.low.x,y.low.y,y.low.z,m.radius,ove);this._batchTable.setBatchedAttribute(i._index,2,y.high),this._batchTable.setBatchedAttribute(i._index,3,A)}if(r[Zpt]){let m=sve;m.x=0,m.y=Number.MAX_VALUE;let y=i.distanceDisplayCondition;l(y)&&(m.x=y.near,m.y=y.far),this._batchTable.setBatchedAttribute(i._index,4,m)}}i._clean()}}c.length=0,this._polylinesUpdated=!1}r=this._propertiesChanged;for(let c=0;c<ive;++c)r[c]=0;let o=N.IDENTITY;e.mode===re.SCENE3D&&(o=this.modelMatrix);let s=e.passes,a=e.morphTime!==0;if((!l(this._opaqueRS)||this._opaqueRS.depthTest.enabled!==a)&&(this._opaqueRS=Ge.fromCache({depthMask:a,depthTest:{enabled:a}})),(!l(this._translucentRS)||this._translucentRS.depthTest.enabled!==a)&&(this._translucentRS=Ge.fromCache({blending:tn.ALPHA_BLEND,depthMask:!a,depthTest:{enabled:a}})),this._batchTable.update(e),s.render||s.pick){let c=this._colorCommands;e0t(this,e,c,o)}};var Ek=new ue,JCe=new ue;function e0t(e,t,n,i){let r=t.context,o=t.commandList,s=n.length,a=0,c=!0,u=e._vertexArrays,f=e.debugShowBoundingVolume,p=e._batchTable.getUniformMapCallback(),g=u.length;for(let m=0;m<g;++m){let y=u[m],A=y.buckets,b=A.length;for(let x=0;x<b;++x){let T=A[x],E=T.offset,v=T.bucket.shaderProgram,S=T.bucket.polylines,I=S.length,R,O,L=0,_,C;for(let w=0;w<I;++w){let P=S[w],M=i0t(P._material);if(M!==R){if(l(R)&&L>0){let j=O.isTranslucent();a>=s?(_=new at({owner:e}),n.push(_)):_=n[a],++a,C=Ot(p(O._uniforms),e._uniformMap),_.boundingVolume=ue.clone(Ek,_.boundingVolume),_.modelMatrix=i,_.shaderProgram=v,_.vertexArray=y.va,_.renderState=j?e._translucentRS:e._opaqueRS,_.pass=j?Ie.TRANSLUCENT:Ie.OPAQUE,_.debugShowBoundingVolume=f,_.pickId="v_pickColor",_.uniformMap=C,_.count=L,_.offset=E,E+=L,L=0,c=!0,o.push(_)}O=P._material,O.update(r),R=M}let F=P._locatorBuckets,V=F.length;for(let j=0;j<V;++j){let k=F[j];k.locator===T&&(L+=k.count)}let B;t.mode===re.SCENE3D?B=P._boundingVolumeWC:t.mode===re.COLUMBUS_VIEW?B=P._boundingVolume2D:t.mode===re.SCENE2D?l(P._boundingVolume2D)&&(B=ue.clone(P._boundingVolume2D,JCe),B.center.x=0):l(P._boundingVolumeWC)&&l(P._boundingVolume2D)&&(B=ue.union(P._boundingVolumeWC,P._boundingVolume2D,JCe)),c?(c=!1,ue.clone(B,Ek)):ue.union(B,Ek,Ek)}l(R)&&L>0&&(a>=s?(_=new at({owner:e}),n.push(_)):_=n[a],++a,C=Ot(p(O._uniforms),e._uniformMap),_.boundingVolume=ue.clone(Ek,_.boundingVolume),_.modelMatrix=i,_.shaderProgram=v,_.vertexArray=y.va,_.renderState=O.isTranslucent()?e._translucentRS:e._opaqueRS,_.pass=O.isTranslucent()?Ie.TRANSLUCENT:Ie.OPAQUE,_.debugShowBoundingVolume=f,_.pickId="v_pickColor",_.uniformMap=C,_.count=L,_.offset=E,c=!0,o.push(_)),R=void 0}}n.length=a}Nm.prototype.isDestroyed=function(){return!1};Nm.prototype.destroy=function(){return ave(this),iee(this),cve(this),this._batchTable=this._batchTable&&this._batchTable.destroy(),le(this)};function t0t(e){let t=!1,n=e._propertiesChanged,i=e._positionBufferUsage;return n[tee]?(i.bufferUsage!==Me.STREAM_DRAW&&(t=!0,i.bufferUsage=Me.STREAM_DRAW),i.frameCount=100):i.bufferUsage!==Me.STATIC_DRAW&&(i.frameCount===0?(t=!0,i.bufferUsage=Me.STATIC_DRAW):i.frameCount--),t}var ZCe=[0,0,0];function QCe(e,t,n){e._createVertexArray=!1,iee(e),ave(e),r0t(e);let i=[[]],r,o=e._batchTable,s=e._useHighlightColor,a=[0],c=0,u=[[]],f=0,d=e._polylineBuckets,p,g;for(p in d)d.hasOwnProperty(p)&&(g=d[p],g.updateShader(t,o,s),f+=g.lengthOfPositions);if(f>0){let m=e._mode,y=new Float32Array(6*f*3),A=new Float32Array(f*4),b,x=0,T=0,E=0;for(p in d)if(d.hasOwnProperty(p)){g=d[p],g.write(y,A,x,T,E,o,t,n),m===re.MORPHING&&(l(b)||(b=new Float32Array(6*f*3)),g.writeForMorph(b,x));let C=g.lengthOfPositions;x+=6*C*3,T+=C*4,E+=C*4,c=g.updateIndices(i,a,u,c)}let v=e._positionBufferUsage.bufferUsage,S=Me.STATIC_DRAW;e._positionBuffer=tt.createVertexBuffer({context:t,typedArray:y,usage:v});let I;l(b)&&(I=tt.createVertexBuffer({context:t,typedArray:b,usage:v})),e._texCoordExpandAndBatchIndexBuffer=tt.createVertexBuffer({context:t,typedArray:A,usage:S});let R=3*Float32Array.BYTES_PER_ELEMENT,O=4*Float32Array.BYTES_PER_ELEMENT,L=0,_=i.length;for(let C=0;C<_;++C)if(r=i[C],r.length>0){let w=new Uint16Array(r),P=tt.createIndexBuffer({context:t,typedArray:w,usage:Me.STATIC_DRAW,indexDatatype:je.UNSIGNED_SHORT});L+=a[C];let M=6*(C*(R*D.SIXTY_FOUR_KILOBYTES)-L*R),F=R+M,V=R+F,B=R+V,j=R+B,k=R+j,G=C*(O*D.SIXTY_FOUR_KILOBYTES)-L*O,q=[{index:Qu.position3DHigh,componentsPerAttribute:3,componentDatatype:Y.FLOAT,offsetInBytes:M,strideInBytes:6*R},{index:Qu.position3DLow,componentsPerAttribute:3,componentDatatype:Y.FLOAT,offsetInBytes:F,strideInBytes:6*R},{index:Qu.position2DHigh,componentsPerAttribute:3,componentDatatype:Y.FLOAT,offsetInBytes:M,strideInBytes:6*R},{index:Qu.position2DLow,componentsPerAttribute:3,componentDatatype:Y.FLOAT,offsetInBytes:F,strideInBytes:6*R},{index:Qu.prevPosition3DHigh,componentsPerAttribute:3,componentDatatype:Y.FLOAT,offsetInBytes:V,strideInBytes:6*R},{index:Qu.prevPosition3DLow,componentsPerAttribute:3,componentDatatype:Y.FLOAT,offsetInBytes:B,strideInBytes:6*R},{index:Qu.prevPosition2DHigh,componentsPerAttribute:3,componentDatatype:Y.FLOAT,offsetInBytes:V,strideInBytes:6*R},{index:Qu.prevPosition2DLow,componentsPerAttribute:3,componentDatatype:Y.FLOAT,offsetInBytes:B,strideInBytes:6*R},{index:Qu.nextPosition3DHigh,componentsPerAttribute:3,componentDatatype:Y.FLOAT,offsetInBytes:j,strideInBytes:6*R},{index:Qu.nextPosition3DLow,componentsPerAttribute:3,componentDatatype:Y.FLOAT,offsetInBytes:k,strideInBytes:6*R},{index:Qu.nextPosition2DHigh,componentsPerAttribute:3,componentDatatype:Y.FLOAT,offsetInBytes:j,strideInBytes:6*R},{index:Qu.nextPosition2DLow,componentsPerAttribute:3,componentDatatype:Y.FLOAT,offsetInBytes:k,strideInBytes:6*R},{index:Qu.texCoordExpandAndBatchIndex,componentsPerAttribute:4,componentDatatype:Y.FLOAT,vertexBuffer:e._texCoordExpandAndBatchIndexBuffer,offsetInBytes:G}],Q,W,J,Z;m===re.SCENE3D?(W=e._positionBuffer,Q="vertexBuffer",J=ZCe,Z="value"):m===re.SCENE2D||m===re.COLUMBUS_VIEW?(W=ZCe,Q="value",J=e._positionBuffer,Z="vertexBuffer"):(W=I,Q="vertexBuffer",J=e._positionBuffer,Z="vertexBuffer"),q[0][Q]=W,q[1][Q]=W,q[2][Z]=J,q[3][Z]=J,q[4][Q]=W,q[5][Q]=W,q[6][Z]=J,q[7][Z]=J,q[8][Q]=W,q[9][Q]=W,q[10][Z]=J,q[11][Z]=J;let ae=new zn({context:t,attributes:q,indexBuffer:P});e._vertexArrays.push({va:ae,buckets:u[C]})}}}function n0t(e,t){return t instanceof Dt?t.id:t}var CG=[];function i0t(e){let t=er._uniformList[e.type],n=t.length;CG.length=2*n;let i=0;for(let r=0;r<n;++r){let o=t[r];CG[i]=o,CG[i+1]=e._uniforms[o](),i+=2}return`${e.type}:${JSON.stringify(CG,n0t)}`}function r0t(e){let t=e._mode,n=e._modelMatrix,i=e._polylineBuckets={},r=e._polylines,o=r.length;for(let s=0;s<o;++s){let a=r[s];if(a._actualPositions.length>1){a.update();let c=a.material,u=i[c.type];l(u)||(u=i[c.type]=new c0(c,t,n)),u.addPolyline(a)}}}function o0t(e,t){let n=t.mode;(e._mode!==n||!N.equals(e._modelMatrix,e.modelMatrix))&&(e._mode=n,e._modelMatrix=N.clone(e.modelMatrix),e._createVertexArray=!0)}function nee(e){if(e._polylinesRemoved){e._polylinesRemoved=!1;let t=[],n=[],i=0,r,o=e._polylines.length;for(let s=0;s<o;++s)r=e._polylines[s],r.isDestroyed||(r._index=i++,n.push(r),t.push(r));e._polylines=t,e._polylinesToUpdate=n}}function iee(e){let t=e._polylines,n=t.length;for(let i=0;i<n;++i)if(!t[i].isDestroyed){let r=t[i]._bucket;l(r)&&(r.shaderProgram=r.shaderProgram&&r.shaderProgram.destroy())}}function ave(e){let t=e._vertexArrays.length;for(let n=0;n<t;++n)e._vertexArrays[n].va.destroy();e._vertexArrays.length=0}Nm.prototype._updatePolyline=function(e,t){this._polylinesUpdated=!0,e._dirty||this._polylinesToUpdate.push(e),++this._propertiesChanged[t]};function cve(e){let t=e._polylines,n=t.length;for(let i=0;i<n;++i)t[i].isDestroyed||t[i]._destroy()}function eee(e,t,n){this.count=e,this.offset=t,this.bucket=n}function c0(e,t,n){this.polylines=[],this.lengthOfPositions=0,this.material=e,this.shaderProgram=void 0,this.mode=t,this.modelMatrix=n}c0.prototype.addPolyline=function(e){this.polylines.push(e),e._actualLength=this.getPolylinePositionsLength(e),this.lengthOfPositions+=e._actualLength,e._bucket=this};c0.prototype.updateShader=function(e,t,n){if(l(this.shaderProgram))return;let i=["DISTANCE_DISPLAY_CONDITION"];n&&i.push("VECTOR_TILE"),this.material.shaderSource.search(/in\s+float\s+v_polylineAngle;/g)!==-1&&i.push("POLYLINE_DASH"),i.push("CLIP_POLYLINE");let r=new Ye({defines:i,sources:[`in vec4 v_pickColor; +`,this.material.shaderSource,Cx]}),o=t.getVertexShaderCallback()(hM),s=new Ye({defines:i,sources:[Wl,o]});this.shaderProgram=Qt.fromCache({context:e,vertexShaderSource:s,fragmentShaderSource:r,attributeLocations:Qu})};function lve(e){return h.dot(h.UNIT_X,e._boundingVolume.center)<0||e._boundingVolume.intersectPlane(sn.ORIGIN_ZX_PLANE)===$t.INTERSECTING}c0.prototype.getPolylinePositionsLength=function(e){let t;if(this.mode===re.SCENE3D||!lve(e))return t=e._actualPositions.length,t*4-4;let n=0,i=e._segments.lengths;t=i.length;for(let r=0;r<t;++r)n+=i[r]*4-4;return n};var Sa=new h,sh=new h,ah=new h,vG=new h,s0t=new se,a0t=new U;c0.prototype.write=function(e,t,n,i,r,o,s,a){let c=this.mode,u=a.ellipsoid.maximumRadius*D.PI,f=this.polylines,d=f.length;for(let p=0;p<d;++p){let g=f[p],m=g.width,y=g.show&&m>0,A=g._index,b=this.getSegments(g,a),x=b.positions,T=b.lengths,E=x.length,v=g.getPickId(s).color,S=0,I=0,R;for(let V=0;V<E;++V){V===0?g._loop?R=x[E-2]:(R=vG,h.subtract(x[0],x[1],R),h.add(x[0],R,R)):R=x[V-1],h.clone(R,sh),h.clone(x[V],Sa),V===E-1?g._loop?R=x[1]:(R=vG,h.subtract(x[E-1],x[E-2],R),h.add(x[E-1],R,R)):R=x[V+1],h.clone(R,ah);let B=T[S];V===I+B&&(I+=B,++S);let j=V-I===0,k=V===I+T[S]-1;c===re.SCENE2D&&(sh.z=0,Sa.z=0,ah.z=0),(c===re.SCENE2D||c===re.MORPHING)&&(j||k)&&u-Math.abs(Sa.x)<1&&((Sa.x<0&&sh.x>0||Sa.x>0&&sh.x<0)&&h.clone(Sa,sh),(Sa.x<0&&ah.x>0||Sa.x>0&&ah.x<0)&&h.clone(Sa,ah));let G=j?2:0,q=k?2:4;for(let Q=G;Q<q;++Q){Sn.writeElements(Sa,e,n),Sn.writeElements(sh,e,n+6),Sn.writeElements(ah,e,n+12);let W=Q-2<0?-1:1;t[r]=V/(E-1),t[r+1]=2*(Q%2)-1,t[r+2]=W,t[r+3]=A,n+=18,r+=4}}let O=s0t;O.x=z.floatToByte(v.red),O.y=z.floatToByte(v.green),O.z=z.floatToByte(v.blue),O.w=z.floatToByte(v.alpha);let L=a0t;L.x=m,L.y=y?1:0;let _=c===re.SCENE2D?g._boundingVolume2D:g._boundingVolumeWC,C=Sn.fromCartesian(_.center,rve),w=C.high,P=se.fromElements(C.low.x,C.low.y,C.low.z,_.radius,ove),M=sve;M.x=0,M.y=Number.MAX_VALUE;let F=g.distanceDisplayCondition;l(F)&&(M.x=F.near,M.y=F.far),o.setBatchedAttribute(A,0,L),o.setBatchedAttribute(A,1,O),o.attributes.length>2&&(o.setBatchedAttribute(A,2,w),o.setBatchedAttribute(A,3,P),o.setBatchedAttribute(A,4,M))}};var c0t=new h,l0t=new h,u0t=new h,eve=new h;c0.prototype.writeForMorph=function(e,t){let n=this.modelMatrix,i=this.polylines,r=i.length;for(let o=0;o<r;++o){let s=i[o],a=s._segments.positions,c=s._segments.lengths,u=a.length,f=0,d=0;for(let p=0;p<u;++p){let g;p===0?s._loop?g=a[u-2]:(g=eve,h.subtract(a[0],a[1],g),h.add(a[0],g,g)):g=a[p-1],g=N.multiplyByPoint(n,g,l0t);let m=N.multiplyByPoint(n,a[p],c0t),y;p===u-1?s._loop?y=a[1]:(y=eve,h.subtract(a[u-1],a[u-2],y),h.add(a[u-1],y,y)):y=a[p+1],y=N.multiplyByPoint(n,y,u0t);let A=c[f];p===d+A&&(d+=A,++f);let b=p-d===0,x=p===d+c[f]-1,T=b?2:0,E=x?2:4;for(let v=T;v<E;++v)Sn.writeElements(m,e,t),Sn.writeElements(g,e,t+6),Sn.writeElements(y,e,t+12),t+=18}}};var f0t=new Array(1);c0.prototype.updateIndices=function(e,t,n,i){let r=n.length-1,o=new eee(0,i,this);n[r].push(o);let s=0,a=e[e.length-1],c=0;a.length>0&&(c=a[a.length-1]+1);let u=this.polylines,f=u.length;for(let d=0;d<f;++d){let p=u[d];p._locatorBuckets=[];let g;if(this.mode===re.SCENE3D){g=f0t;let y=p._actualPositions.length;if(y>0)g[0]=y;else continue}else g=p._segments.lengths;let m=g.length;if(m>0){let y=0;for(let A=0;A<m;++A){let b=g[A]-1;for(let x=0;x<b;++x)c+4>D.SIXTY_FOUR_KILOBYTES&&(p._locatorBuckets.push({locator:o,count:y}),y=0,t.push(4),a=[],e.push(a),c=0,o.count=s,s=0,i=0,o=new eee(0,0,this),n[++r]=[o]),a.push(c,c+2,c+1),a.push(c+1,c+2,c+3),y+=6,s+=6,i+=6,c+=4}p._locatorBuckets.push({locator:o,count:y}),c+4>D.SIXTY_FOUR_KILOBYTES&&(t.push(0),a=[],e.push(a),c=0,o.count=s,i=0,s=0,o=new eee(0,0,this),n[++r]=[o])}p._clean()}return o.count=s,i};c0.prototype.getPolylineStartIndex=function(e){let t=this.polylines,n=0,i=t.length;for(let r=0;r<i;++r){let o=t[r];if(o===e)break;n+=o._actualLength}return n};var jw={positions:void 0,lengths:void 0},tve=new Array(1),d0t=new h,h0t=new he;c0.prototype.getSegments=function(e,t){let n=e._actualPositions;if(this.mode===re.SCENE3D)return tve[0]=n.length,jw.positions=n,jw.lengths=tve,jw;lve(e)&&(n=e._segments.positions);let i=t.ellipsoid,r=[],o=this.modelMatrix,s=n.length,a,c=d0t;for(let u=0;u<s;++u)a=n[u],c=N.multiplyByPoint(o,a,c),r.push(t.project(i.cartesianToCartographic(c,h0t)));if(r.length>0){e._boundingVolume2D=ue.fromPoints(r,e._boundingVolume2D);let u=e._boundingVolume2D.center;e._boundingVolume2D.center=new h(u.z,u.x,u.y)}return jw.positions=r,jw.lengths=e._segments.lengths,jw};var nve;c0.prototype.writeUpdate=function(e,t,n,i){let r=this.mode,o=i.ellipsoid.maximumRadius*D.PI,s=t._actualLength;if(s){e+=this.getPolylineStartIndex(t);let a=nve,c=6*s*3;!l(a)||a.length<c?a=nve=new Float32Array(c):a.length>c&&(a=new Float32Array(a.buffer,0,c));let u=this.getSegments(t,i),f=u.positions,d=u.lengths,p=0,g=0,m=0,y;s=f.length;for(let A=0;A<s;++A){A===0?t._loop?y=f[s-2]:(y=vG,h.subtract(f[0],f[1],y),h.add(f[0],y,y)):y=f[A-1],h.clone(y,sh),h.clone(f[A],Sa),A===s-1?t._loop?y=f[1]:(y=vG,h.subtract(f[s-1],f[s-2],y),h.add(f[s-1],y,y)):y=f[A+1],h.clone(y,ah);let b=d[g];A===m+b&&(m+=b,++g);let x=A-m===0,T=A===m+d[g]-1;r===re.SCENE2D&&(sh.z=0,Sa.z=0,ah.z=0),(r===re.SCENE2D||r===re.MORPHING)&&(x||T)&&o-Math.abs(Sa.x)<1&&((Sa.x<0&&sh.x>0||Sa.x>0&&sh.x<0)&&h.clone(Sa,sh),(Sa.x<0&&ah.x>0||Sa.x>0&&ah.x<0)&&h.clone(Sa,ah));let E=x?2:0,v=T?2:4;for(let S=E;S<v;++S)Sn.writeElements(Sa,a,p),Sn.writeElements(sh,a,p+6),Sn.writeElements(ah,a,p+12),p+=18}n.copyFromArrayView(a,18*Float32Array.BYTES_PER_ELEMENT*e)}};var Lm=Nm;function zA(e){this._positions=e.positions,this._batchTable=e.batchTable,this._batchIds=e.batchIds,this._rectangle=e.rectangle,this._minHeight=e.minimumHeight,this._maxHeight=e.maximumHeight,this._heightReference=e.heightReference,this._billboardCollection=new Df({batchTable:e.batchTable,scene:e.scene}),this._labelCollection=new Vp({batchTable:e.batchTable,scene:e.scene}),this._polylineCollection=new Lm,this._polylineCollection._useHighlightColor=!0,this._packedBuffer=void 0,this._ready=!1,this._promise=void 0,this._error=void 0}Object.defineProperties(zA.prototype,{ready:{get:function(){return this._ready}},pointsLength:{get:function(){return this._billboardCollection.length}},texturesByteLength:{get:function(){let e=this._billboardCollection.sizeInBytes,t=this._labelCollection.sizeInBytes;return e+t}}});function m0t(e,t){let n=e._rectangle,i=e._minHeight,r=e._maxHeight,o=2+ie.packedLength+ee.packedLength,s=new Float64Array(o),a=0;return s[a++]=i,s[a++]=r,ie.pack(n,s,a),a+=ie.packedLength,ee.pack(t,s,a),s}var p0t=new $n("createVectorTilePoints",5),g0t=new h;function _0t(e,t){let n=e._positions,i=e._packedBuffer;l(i)||(n=e._positions=n.slice(),e._batchIds=e._batchIds.slice(),i=e._packedBuffer=m0t(e,t));let r=[n.buffer,i.buffer],o={positions:n.buffer,packedBuffer:i.buffer},s=p0t.scheduleTask(o,r);if(l(s))return s.then(a=>{if(e.isDestroyed())return;e._positions=new Float64Array(a.positions);let c=e._billboardCollection,u=e._labelCollection,f=e._polylineCollection;n=e._positions;let d=e._batchIds,p=n.length/3,g=e._heightReference??We.NONE;for(let m=0;m<p;++m){let y=d[m],A=h.unpack(n,m*3,g0t),b=c.add();b.position=A,b._batchIndex=y,b.heightReference=g;let x=u.add();x.text=" ",x.position=A,x._batchIndex=y,x.heightReference=g;let T=f.add();T.positions=[h.clone(A),h.clone(A)]}e._positions=void 0,e._packedBuffer=void 0,e._ready=!0}).catch(a=>{e.isDestroyed()||(e._error=a)})}zA.prototype.createFeatures=function(e,t){let n=this._billboardCollection,i=this._labelCollection,r=this._polylineCollection,o=this._batchIds,s=o.length;for(let a=0;a<s;++a){let c=o[a],u=n.get(a),f=i.get(a),d=r.get(a);t[c]=new g_(e,c,u,f,d)}};zA.prototype.applyDebugSettings=function(e,t){e?(z.clone(t,this._billboardCollection._highlightColor),z.clone(t,this._labelCollection._highlightColor),z.clone(t,this._polylineCollection._highlightColor)):(z.clone(z.WHITE,this._billboardCollection._highlightColor),z.clone(z.WHITE,this._labelCollection._highlightColor),z.clone(z.WHITE,this._polylineCollection._highlightColor))};function y0t(e,t){let n=e._batchIds,i=n.length;for(let r=0;r<i;++r){let o=n[r],s=t[o];s.show=!0,s.pointSize=g_.defaultPointSize,s.color=g_.defaultColor,s.pointOutlineColor=g_.defaultPointOutlineColor,s.pointOutlineWidth=g_.defaultPointOutlineWidth,s.labelColor=z.WHITE,s.labelOutlineColor=z.WHITE,s.labelOutlineWidth=1,s.font="30px sans-serif",s.labelStyle=_o.FILL,s.labelText=void 0,s.backgroundColor=new z(.165,.165,.165,.8),s.backgroundPadding=new U(7,5),s.backgroundEnabled=!1,s.scaleByDistance=void 0,s.translucencyByDistance=void 0,s.distanceDisplayCondition=void 0,s.heightOffset=0,s.anchorLineEnabled=!1,s.anchorLineColor=z.WHITE,s.image=void 0,s.disableDepthTestDistance=0,s.horizontalOrigin=Vi.CENTER,s.verticalOrigin=Gn.CENTER,s.labelHorizontalOrigin=Vi.RIGHT,s.labelVerticalOrigin=Gn.BASELINE}}var A0t=new z,b0t=new z,x0t=new z,T0t=new z,E0t=new z,C0t=new z,Ck=new qt,vk=new qt,ree=new Ht;zA.prototype.applyStyle=function(e,t){if(!l(e)){y0t(this,t);return}let n=this._batchIds,i=n.length;for(let r=0;r<i;++r){let o=n[r],s=t[o];if(l(e.show)&&(s.show=e.show.evaluate(s)),l(e.pointSize)&&(s.pointSize=e.pointSize.evaluate(s)),l(e.color)&&(s.color=e.color.evaluateColor(s,A0t)),l(e.pointOutlineColor)&&(s.pointOutlineColor=e.pointOutlineColor.evaluateColor(s,b0t)),l(e.pointOutlineWidth)&&(s.pointOutlineWidth=e.pointOutlineWidth.evaluate(s)),l(e.labelColor)&&(s.labelColor=e.labelColor.evaluateColor(s,x0t)),l(e.labelOutlineColor)&&(s.labelOutlineColor=e.labelOutlineColor.evaluateColor(s,T0t)),l(e.labelOutlineWidth)&&(s.labelOutlineWidth=e.labelOutlineWidth.evaluate(s)),l(e.font)&&(s.font=e.font.evaluate(s)),l(e.labelStyle)&&(s.labelStyle=e.labelStyle.evaluate(s)),l(e.labelText)?s.labelText=e.labelText.evaluate(s):s.labelText=void 0,l(e.backgroundColor)&&(s.backgroundColor=e.backgroundColor.evaluateColor(s,E0t)),l(e.backgroundPadding)&&(s.backgroundPadding=e.backgroundPadding.evaluate(s)),l(e.backgroundEnabled)&&(s.backgroundEnabled=e.backgroundEnabled.evaluate(s)),l(e.scaleByDistance)){let a=e.scaleByDistance.evaluate(s);l(a)?(Ck.near=a.x,Ck.nearValue=a.y,Ck.far=a.z,Ck.farValue=a.w,s.scaleByDistance=Ck):s.scaleByDistance=void 0}else s.scaleByDistance=void 0;if(l(e.translucencyByDistance)){let a=e.translucencyByDistance.evaluate(s);l(a)?(vk.near=a.x,vk.nearValue=a.y,vk.far=a.z,vk.farValue=a.w,s.translucencyByDistance=vk):s.translucencyByDistance=void 0}else s.translucencyByDistance=void 0;if(l(e.distanceDisplayCondition)){let a=e.distanceDisplayCondition.evaluate(s);l(a)?(ree.near=a.x,ree.far=a.y,s.distanceDisplayCondition=ree):s.distanceDisplayCondition=void 0}else s.distanceDisplayCondition=void 0;l(e.heightOffset)&&(s.heightOffset=e.heightOffset.evaluate(s)),l(e.anchorLineEnabled)&&(s.anchorLineEnabled=e.anchorLineEnabled.evaluate(s)),l(e.anchorLineColor)&&(s.anchorLineColor=e.anchorLineColor.evaluateColor(s,C0t)),l(e.image)?s.image=e.image.evaluate(s):s.image=void 0,l(e.disableDepthTestDistance)&&(s.disableDepthTestDistance=e.disableDepthTestDistance.evaluate(s)),l(e.horizontalOrigin)&&(s.horizontalOrigin=e.horizontalOrigin.evaluate(s)),l(e.verticalOrigin)&&(s.verticalOrigin=e.verticalOrigin.evaluate(s)),l(e.labelHorizontalOrigin)&&(s.labelHorizontalOrigin=e.labelHorizontalOrigin.evaluate(s)),l(e.labelVerticalOrigin)&&(s.labelVerticalOrigin=e.labelVerticalOrigin.evaluate(s))}};zA.prototype.update=function(e){if(!this._ready&&(l(this._promise)||(this._promise=_0t(this,e.mapProjection.ellipsoid)),l(this._error))){let t=this._error;throw this._error=void 0,t}this._polylineCollection.update(e),this._billboardCollection.update(e),this._labelCollection.update(e)};zA.prototype.isDestroyed=function(){return!1};zA.prototype.destroy=function(){return this._billboardCollection=this._billboardCollection&&this._billboardCollection.destroy(),this._labelCollection=this._labelCollection&&this._labelCollection.destroy(),this._polylineCollection=this._polylineCollection&&this._polylineCollection.destroy(),le(this)};var Sk=zA;function y_(e){this._batchTable=e.batchTable,this._batchIds=e.batchIds,this._positions=e.positions,this._counts=e.counts,this._indices=e.indices,this._indexCounts=e.indexCounts,this._indexOffsets=void 0,this._batchTableColors=void 0,this._packedBuffer=void 0,this._batchedPositions=void 0,this._transferrableBatchIds=void 0,this._vertexBatchIds=void 0,this._ellipsoid=e.ellipsoid??ee.WGS84,this._minimumHeight=e.minimumHeight,this._maximumHeight=e.maximumHeight,this._polygonMinimumHeights=e.polygonMinimumHeights,this._polygonMaximumHeights=e.polygonMaximumHeights,this._center=e.center??h.ZERO,this._rectangle=e.rectangle,this._center=void 0,this._boundingVolume=e.boundingVolume,this._boundingVolumes=void 0,this._batchedIndices=void 0,this._ready=!1,this._promise=void 0,this._error=void 0,this._primitive=void 0,this.debugWireframe=!1,this.forceRebatch=!1,this.classificationType=Qn.BOTH}Object.defineProperties(y_.prototype,{trianglesLength:{get:function(){return l(this._primitive)?this._primitive.trianglesLength:0}},geometryByteLength:{get:function(){return l(this._primitive)?this._primitive.geometryByteLength:0}},ready:{get:function(){return this._ready}}});function v0t(e){let t=new Float64Array(3+h.packedLength+ee.packedLength+ie.packedLength),n=0;return t[n++]=e._indices.BYTES_PER_ELEMENT,t[n++]=e._minimumHeight,t[n++]=e._maximumHeight,h.pack(e._center,t,n),n+=h.packedLength,ee.pack(e._ellipsoid,t,n),n+=ee.packedLength,ie.pack(e._rectangle,t,n),t}function S0t(e,t){let n=1,i=t[n++],r=e._boundingVolumes=new Array(i);for(let a=0;a<i;++a)r[a]=en.unpack(t,n),n+=en.packedLength;let o=t[n++],s=e._batchedIndices=new Array(o);for(let a=0;a<o;++a){let c=z.unpack(t,n);n+=z.packedLength;let u=t[n++],f=t[n++],d=t[n++],p=new Array(d);for(let g=0;g<d;++g)p[g]=t[n++];s[a]=new a0({color:c,offset:u,count:f,batchIds:p})}}var w0t=new $n("createVectorTilePolygons",5),I0t=new z;function P0t(e){if(l(e._primitive))return;let t=e._positions,n=e._counts,i=e._indexCounts,r=e._indices,o=e._transferrableBatchIds,s=e._batchTableColors,a=e._packedBuffer;if(!l(s)){t=e._positions=e._positions.slice(),n=e._counts=e._counts.slice(),i=e._indexCounts=e._indexCounts.slice(),r=e._indices=e._indices.slice(),e._center=e._ellipsoid.cartographicToCartesian(ie.center(e._rectangle)),o=e._transferrableBatchIds=new Uint32Array(e._batchIds),s=e._batchTableColors=new Uint32Array(o.length);let g=e._batchTable,m=s.length;for(let y=0;y<m;++y){let A=g.getColor(y,I0t);s[y]=A.toRgba()}a=e._packedBuffer=v0t(e)}let c=[t.buffer,n.buffer,i.buffer,r.buffer,o.buffer,s.buffer,a.buffer],u={packedBuffer:a.buffer,positions:t.buffer,counts:n.buffer,indexCounts:i.buffer,indices:r.buffer,batchIds:o.buffer,batchTableColors:s.buffer},f=e._polygonMinimumHeights,d=e._polygonMaximumHeights;l(f)&&l(d)&&(f=f.slice(),d=d.slice(),c.push(f.buffer,d.buffer),u.minimumHeights=f,u.maximumHeights=d);let p=w0t.scheduleTask(u,c);if(l(p))return p.then(g=>{if(e.isDestroyed())return;e._positions=void 0,e._counts=void 0,e._polygonMinimumHeights=void 0,e._polygonMaximumHeights=void 0;let m=new Float64Array(g.packedBuffer),y=m[0];S0t(e,m),e._indices=je.getSizeInBytes(y)===2?new Uint16Array(g.indices):new Uint32Array(g.indices),e._indexOffsets=new Uint32Array(g.indexOffsets),e._indexCounts=new Uint32Array(g.indexCounts),e._batchedPositions=new Float32Array(g.positions),e._vertexBatchIds=new Uint16Array(g.batchIds),D0t(e),e._ready=!0}).catch(g=>{e.isDestroyed()||(e._error=g)})}function D0t(e){l(e._primitive)||(e._primitive=new $T({batchTable:e._batchTable,positions:e._batchedPositions,batchIds:e._batchIds,vertexBatchIds:e._vertexBatchIds,indices:e._indices,indexOffsets:e._indexOffsets,indexCounts:e._indexCounts,batchedIndices:e._batchedIndices,boundingVolume:e._boundingVolume,boundingVolumes:e._boundingVolumes,center:e._center}),e._batchTable=void 0,e._batchIds=void 0,e._positions=void 0,e._counts=void 0,e._indices=void 0,e._indexCounts=void 0,e._indexOffsets=void 0,e._batchTableColors=void 0,e._packedBuffer=void 0,e._batchedPositions=void 0,e._transferrableBatchIds=void 0,e._vertexBatchIds=void 0,e._ellipsoid=void 0,e._minimumHeight=void 0,e._maximumHeight=void 0,e._polygonMinimumHeights=void 0,e._polygonMaximumHeights=void 0,e._center=void 0,e._rectangle=void 0,e._boundingVolume=void 0,e._boundingVolumes=void 0,e._batchedIndices=void 0)}y_.prototype.createFeatures=function(e,t){this._primitive.createFeatures(e,t)};y_.prototype.applyDebugSettings=function(e,t){this._primitive.applyDebugSettings(e,t)};y_.prototype.applyStyle=function(e,t){this._primitive.applyStyle(e,t)};y_.prototype.updateCommands=function(e,t){this._primitive.updateCommands(e,t)};y_.prototype.update=function(e){if(!this._ready){if(l(this._promise)||(this._promise=P0t(this)),l(this._error)){let t=this._error;throw this._error=void 0,t}return}this._primitive.debugWireframe=this.debugWireframe,this._primitive.forceRebatch=this.forceRebatch,this._primitive.classificationType=this.classificationType,this._primitive.update(e)};y_.prototype.isDestroyed=function(){return!1};y_.prototype.destroy=function(){return this._primitive=this._primitive&&this._primitive.destroy(),le(this)};var wk=y_;function Fm(e){this._positions=e.positions,this._widths=e.widths,this._counts=e.counts,this._batchIds=e.batchIds,this._ellipsoid=e.ellipsoid??ee.WGS84,this._minimumHeight=e.minimumHeight,this._maximumHeight=e.maximumHeight,this._center=e.center,this._rectangle=e.rectangle,this._boundingVolume=e.boundingVolume,this._batchTable=e.batchTable,this._va=void 0,this._sp=void 0,this._rs=void 0,this._uniformMap=void 0,this._command=void 0,this._transferrableBatchIds=void 0,this._packedBuffer=void 0,this._keepDecodedPositions=e.keepDecodedPositions,this._decodedPositions=void 0,this._decodedPositionOffsets=void 0,this._currentPositions=void 0,this._previousPositions=void 0,this._nextPositions=void 0,this._expandAndWidth=void 0,this._vertexBatchIds=void 0,this._indices=void 0,this._constantColor=z.clone(z.WHITE),this._highlightColor=this._constantColor,this._trianglesLength=0,this._geometryByteLength=0,this._ready=!1,this._promise=void 0,this._error=void 0}Object.defineProperties(Fm.prototype,{trianglesLength:{get:function(){return this._trianglesLength}},geometryByteLength:{get:function(){return this._geometryByteLength}},ready:{get:function(){return this._ready}}});function R0t(e){let t=e._rectangle,n=e._minimumHeight,i=e._maximumHeight,r=e._ellipsoid,o=e._center,s=2+ie.packedLength+ee.packedLength+h.packedLength,a=new Float64Array(s),c=0;return a[c++]=n,a[c++]=i,ie.pack(t,a,c),c+=ie.packedLength,ee.pack(r,a,c),c+=ee.packedLength,h.pack(o,a,c),a}var O0t=new $n("createVectorTilePolylines",5),Hw={previousPosition:0,currentPosition:1,nextPosition:2,expandAndWidth:3,a_batchId:4};function M0t(e,t){if(l(e._va))return;let n=e._positions,i=e._widths,r=e._counts,o=e._transferrableBatchIds,s=e._packedBuffer;l(s)||(n=e._positions=n.slice(),i=e._widths=i.slice(),r=e._counts=r.slice(),o=e._transferrableBatchIds=e._batchIds.slice(),s=e._packedBuffer=R0t(e));let a=[n.buffer,i.buffer,r.buffer,o.buffer,s.buffer],c={positions:n.buffer,widths:i.buffer,counts:r.buffer,batchIds:o.buffer,packedBuffer:s.buffer,keepDecodedPositions:e._keepDecodedPositions},u=O0t.scheduleTask(c,a);if(l(u))return u.then(function(f){if(e.isDestroyed())return;e._keepDecodedPositions&&(e._decodedPositions=new Float64Array(f.decodedPositions),e._decodedPositionOffsets=new Uint32Array(f.decodedPositionOffsets)),e._currentPositions=new Float32Array(f.currentPositions),e._previousPositions=new Float32Array(f.previousPositions),e._nextPositions=new Float32Array(f.nextPositions),e._expandAndWidth=new Float32Array(f.expandAndWidth),e._vertexBatchIds=new Uint16Array(f.batchIds);let d=f.indexDatatype;e._indices=d===je.UNSIGNED_SHORT?new Uint16Array(f.indices):new Uint32Array(f.indices),N0t(e,t),e._ready=!0}).catch(f=>{e.isDestroyed()||(e._error=f)})}function N0t(e,t){if(!l(e._va)){let n=e._currentPositions,i=e._previousPositions,r=e._nextPositions,o=e._expandAndWidth,s=e._vertexBatchIds,a=e._indices,c=i.byteLength+n.byteLength+r.byteLength;c+=o.byteLength+s.byteLength+a.byteLength,e._trianglesLength=a.length/3,e._geometryByteLength=c;let u=tt.createVertexBuffer({context:t,typedArray:i,usage:Me.STATIC_DRAW}),f=tt.createVertexBuffer({context:t,typedArray:n,usage:Me.STATIC_DRAW}),d=tt.createVertexBuffer({context:t,typedArray:r,usage:Me.STATIC_DRAW}),p=tt.createVertexBuffer({context:t,typedArray:o,usage:Me.STATIC_DRAW}),g=tt.createVertexBuffer({context:t,typedArray:s,usage:Me.STATIC_DRAW}),m=tt.createIndexBuffer({context:t,typedArray:a,usage:Me.STATIC_DRAW,indexDatatype:a.BYTES_PER_ELEMENT===2?je.UNSIGNED_SHORT:je.UNSIGNED_INT}),y=[{index:Hw.previousPosition,vertexBuffer:u,componentDatatype:Y.FLOAT,componentsPerAttribute:3},{index:Hw.currentPosition,vertexBuffer:f,componentDatatype:Y.FLOAT,componentsPerAttribute:3},{index:Hw.nextPosition,vertexBuffer:d,componentDatatype:Y.FLOAT,componentsPerAttribute:3},{index:Hw.expandAndWidth,vertexBuffer:p,componentDatatype:Y.FLOAT,componentsPerAttribute:2},{index:Hw.a_batchId,vertexBuffer:g,componentDatatype:Y.UNSIGNED_SHORT,componentsPerAttribute:1}];e._va=new zn({context:t,attributes:y,indexBuffer:m}),e._positions=void 0,e._widths=void 0,e._counts=void 0,e._ellipsoid=void 0,e._minimumHeight=void 0,e._maximumHeight=void 0,e._rectangle=void 0,e._transferrableBatchIds=void 0,e._packedBuffer=void 0,e._currentPositions=void 0,e._previousPositions=void 0,e._nextPositions=void 0,e._expandAndWidth=void 0,e._vertexBatchIds=void 0,e._indices=void 0}}var Ik=new N,uve=new h;function L0t(e,t){l(e._uniformMap)||(e._uniformMap={u_modifiedModelView:function(){let n=t.uniformState.view;return N.clone(n,Ik),N.multiplyByPoint(Ik,e._center,uve),N.setTranslation(Ik,uve,Ik),Ik},u_highlightColor:function(){return e._highlightColor}})}function F0t(e){if(l(e._rs))return;let t={enabled:!0,factor:-5,units:-5};e._rs=Ge.fromCache({blending:tn.ALPHA_BLEND,depthMask:!1,depthTest:{enabled:!0},polygonOffset:t})}var B0t=`uniform vec4 u_highlightColor; void main() { out_FragColor = u_highlightColor; } -`;function Xft(e,t){if(l(e._sp))return;let n=e._batchTable,i=n.getVertexShaderCallback(!1,"a_batchId",void 0)(IM),r=n.getFragmentShaderCallback(!1,void 0,!1)(Yft),o=new Ye({defines:["VECTOR_TILE","CLIP_POLYLINE"],sources:[Wl,i]}),s=new Ye({defines:["VECTOR_TILE"],sources:[r]});e._sp=Qt.fromCache({context:t,vertexShaderSource:o,fragmentShaderSource:s,attributeLocations:lw})}function Kft(e,t){if(!l(e._command)){let n=e._batchTable.getUniformMapCallback()(e._uniformMap);e._command=new at({owner:e,vertexArray:e._va,renderState:e._rs,shaderProgram:e._sp,uniformMap:n,boundingVolume:e._boundingVolume,pass:Ie.TRANSLUCENT,pickId:e._batchTable.getPickId()})}t.commandList.push(e._command)}vm.getPolylinePositions=function(e,t){let n=e._batchIds,i=e._decodedPositions,r=e._decodedPositionOffsets;if(!l(n)||!l(i))return;let o,s,a=n.length,c=0,u=0;for(o=0;o<a;++o)n[o]===t&&(c+=r[o+1]-r[o]);if(c===0)return;let f=new Float64Array(c*3);for(o=0;o<a;++o)if(n[o]===t){let d=r[o],p=r[o+1]-d;for(s=0;s<p;++s){let g=(d+s)*3;f[u++]=i[g],f[u++]=i[g+1],f[u++]=i[g+2]}}return f};vm.prototype.getPositions=function(e){return vm.getPolylinePositions(this,e)};vm.prototype.createFeatures=function(e,t){let n=this._batchIds,i=n.length;for(let r=0;r<i;++r){let o=n[r];t[o]=new na(e,o)}};vm.prototype.applyDebugSettings=function(e,t){this._highlightColor=e?t:this._constantColor};function $ft(e,t){let n=e._batchIds,i=n.length;for(let r=0;r<i;++r){let o=n[r],s=t[o];s.show=!0,s.color=z.WHITE}}var Jft=new z,Zft=z.WHITE,Qft=!0;vm.prototype.applyStyle=function(e,t){if(!l(e)){$ft(this,t);return}let n=this._batchIds,i=n.length;for(let r=0;r<i;++r){let o=n[r],s=t[o];s.color=l(e.color)?e.color.evaluateColor(s,Jft):Zft,s.show=l(e.show)?e.show.evaluate(s):Qft}};vm.prototype.update=function(e){let t=e.context;if(!this._ready){if(l(this._promise)||(this._promise=Hft(this,t)),l(this._error)){let i=this._error;throw this._error=void 0,i}return}Wft(this,t),Xft(this,t),qft(this);let n=e.passes;(n.render||n.pick)&&Kft(this,e)};vm.prototype.isDestroyed=function(){return!1};vm.prototype.destroy=function(){return this._va=this._va&&this._va.destroy(),this._sp=this._sp&&this._sp.destroy(),le(this)};var LT=vm;function l_(e){this._positions=e.positions,this._widths=e.widths,this._counts=e.counts,this._batchIds=e.batchIds,this._ellipsoid=e.ellipsoid??ee.WGS84,this._minimumHeight=e.minimumHeight,this._maximumHeight=e.maximumHeight,this._center=e.center,this._rectangle=e.rectangle,this._batchTable=e.batchTable,this._va=void 0,this._sp=void 0,this._rs=void 0,this._uniformMap=void 0,this._command=void 0,this._transferrableBatchIds=void 0,this._packedBuffer=void 0,this._minimumMaximumVectorHeights=new U(Mi._defaultMinTerrainHeight,Mi._defaultMaxTerrainHeight),this._boundingVolume=en.fromRectangle(e.rectangle,Mi._defaultMinTerrainHeight,Mi._defaultMaxTerrainHeight,this._ellipsoid),this._classificationType=e.classificationType,this._keepDecodedPositions=e.keepDecodedPositions,this._decodedPositions=void 0,this._decodedPositionOffsets=void 0,this._startEllipsoidNormals=void 0,this._endEllipsoidNormals=void 0,this._startPositionAndHeights=void 0,this._startFaceNormalAndVertexCornerIds=void 0,this._endPositionAndHeights=void 0,this._endFaceNormalAndHalfWidths=void 0,this._vertexBatchIds=void 0,this._indices=void 0,this._constantColor=z.clone(z.WHITE),this._highlightColor=this._constantColor,this._trianglesLength=0,this._geometryByteLength=0,this._ready=!1,this._promise=void 0,this._error=void 0}Object.defineProperties(l_.prototype,{trianglesLength:{get:function(){return this._trianglesLength}},geometryByteLength:{get:function(){return this._geometryByteLength}},ready:{get:function(){return this._ready}}});function edt(e,t,n){let i=Mi.getMinimumMaximumHeights(t,n),r=i.minimumTerrainHeight,o=i.maximumTerrainHeight,s=e._minimumMaximumVectorHeights;s.x=r,s.y=o;let a=e._boundingVolume,c=e._rectangle;en.fromRectangle(c,r,o,n,a)}function tdt(e){let t=e._rectangle,n=e._minimumHeight,i=e._maximumHeight,r=e._ellipsoid,o=e._center,s=2+ie.packedLength+ee.packedLength+h.packedLength,a=new Float64Array(s),c=0;return a[c++]=n,a[c++]=i,ie.pack(t,a,c),c+=ie.packedLength,ee.pack(r,a,c),c+=ee.packedLength,h.pack(o,a,c),a}var ndt=new $n("createVectorTileClampedPolylines"),NA={startEllipsoidNormal:0,endEllipsoidNormal:1,startPositionAndHeight:2,endPositionAndHeight:3,startFaceNormalAndVertexCorner:4,endFaceNormalAndHalfWidth:5,a_batchId:6};function idt(e,t){if(l(e._va))return;let n=e._positions,i=e._widths,r=e._counts,o=e._transferrableBatchIds,s=e._packedBuffer;l(s)||(n=e._positions=n.slice(),i=e._widths=i.slice(),r=e._counts=r.slice(),o=e._transferrableBatchIds=e._batchIds.slice(),s=e._packedBuffer=tdt(e));let a=[n.buffer,i.buffer,r.buffer,o.buffer,s.buffer],c={positions:n.buffer,widths:i.buffer,counts:r.buffer,batchIds:o.buffer,packedBuffer:s.buffer,keepDecodedPositions:e._keepDecodedPositions},u=ndt.scheduleTask(c,a);if(l(u))return u.then(function(f){if(e.isDestroyed())return;e._keepDecodedPositions&&(e._decodedPositions=new Float64Array(f.decodedPositions),e._decodedPositionOffsets=new Uint32Array(f.decodedPositionOffsets)),e._startEllipsoidNormals=new Float32Array(f.startEllipsoidNormals),e._endEllipsoidNormals=new Float32Array(f.endEllipsoidNormals),e._startPositionAndHeights=new Float32Array(f.startPositionAndHeights),e._startFaceNormalAndVertexCornerIds=new Float32Array(f.startFaceNormalAndVertexCornerIds),e._endPositionAndHeights=new Float32Array(f.endPositionAndHeights),e._endFaceNormalAndHalfWidths=new Float32Array(f.endFaceNormalAndHalfWidths),e._vertexBatchIds=new Uint16Array(f.vertexBatchIds);let d=f.indexDatatype;e._indices=d===je.UNSIGNED_SHORT?new Uint16Array(f.indices):new Uint32Array(f.indices),rdt(e,t),e._ready=!0}).catch(f=>{e.isDestroyed()||(e._error=f)})}function rdt(e,t){if(!l(e._va)){let n=e._startEllipsoidNormals,i=e._endEllipsoidNormals,r=e._startPositionAndHeights,o=e._endPositionAndHeights,s=e._startFaceNormalAndVertexCornerIds,a=e._endFaceNormalAndHalfWidths,c=e._vertexBatchIds,u=e._indices,f=n.byteLength+i.byteLength;f+=r.byteLength+o.byteLength,f+=s.byteLength+a.byteLength,f+=c.byteLength+u.byteLength,e._trianglesLength=u.length/3,e._geometryByteLength=f;let d=tt.createVertexBuffer({context:t,typedArray:n,usage:Me.STATIC_DRAW}),p=tt.createVertexBuffer({context:t,typedArray:i,usage:Me.STATIC_DRAW}),g=tt.createVertexBuffer({context:t,typedArray:r,usage:Me.STATIC_DRAW}),m=tt.createVertexBuffer({context:t,typedArray:o,usage:Me.STATIC_DRAW}),y=tt.createVertexBuffer({context:t,typedArray:s,usage:Me.STATIC_DRAW}),A=tt.createVertexBuffer({context:t,typedArray:a,usage:Me.STATIC_DRAW}),b=tt.createVertexBuffer({context:t,typedArray:c,usage:Me.STATIC_DRAW}),x=tt.createIndexBuffer({context:t,typedArray:u,usage:Me.STATIC_DRAW,indexDatatype:u.BYTES_PER_ELEMENT===2?je.UNSIGNED_SHORT:je.UNSIGNED_INT}),T=[{index:NA.startEllipsoidNormal,vertexBuffer:d,componentDatatype:Y.FLOAT,componentsPerAttribute:3},{index:NA.endEllipsoidNormal,vertexBuffer:p,componentDatatype:Y.FLOAT,componentsPerAttribute:3},{index:NA.startPositionAndHeight,vertexBuffer:g,componentDatatype:Y.FLOAT,componentsPerAttribute:4},{index:NA.endPositionAndHeight,vertexBuffer:m,componentDatatype:Y.FLOAT,componentsPerAttribute:4},{index:NA.startFaceNormalAndVertexCorner,vertexBuffer:y,componentDatatype:Y.FLOAT,componentsPerAttribute:4},{index:NA.endFaceNormalAndHalfWidth,vertexBuffer:A,componentDatatype:Y.FLOAT,componentsPerAttribute:4},{index:NA.a_batchId,vertexBuffer:b,componentDatatype:Y.UNSIGNED_SHORT,componentsPerAttribute:1}];e._va=new zn({context:t,attributes:T,indexBuffer:x}),e._positions=void 0,e._widths=void 0,e._counts=void 0,e._ellipsoid=void 0,e._minimumHeight=void 0,e._maximumHeight=void 0,e._rectangle=void 0,e._transferrableBatchIds=void 0,e._packedBuffer=void 0,e._startEllipsoidNormals=void 0,e._endEllipsoidNormals=void 0,e._startPositionAndHeights=void 0,e._startFaceNormalAndVertexCornerIds=void 0,e._endPositionAndHeights=void 0,e._endFaceNormalAndHalfWidths=void 0,e._vertexBatchIds=void 0,e._indices=void 0}}var N2=new N,lTe=new h;function odt(e,t){l(e._uniformMap)||(e._uniformMap={u_modifiedModelView:function(){let n=t.uniformState.view;return N.clone(n,N2),N.multiplyByPoint(N2,e._center,lTe),N.setTranslation(N2,lTe,N2),N2},u_highlightColor:function(){return e._highlightColor},u_minimumMaximumVectorHeights:function(){return e._minimumMaximumVectorHeights}})}function uTe(e){return Ge.fromCache({cull:{enabled:!0,face:Vi.FRONT},blending:tn.PRE_MULTIPLIED_ALPHA_BLEND,depthMask:!1,stencilTest:{enabled:e,frontFunction:ti.EQUAL,frontOperation:{fail:Rt.KEEP,zFail:Rt.KEEP,zPass:Rt.KEEP},backFunction:ti.EQUAL,backOperation:{fail:Rt.KEEP,zFail:Rt.KEEP,zPass:Rt.KEEP},reference:Yt.CESIUM_3D_TILE_MASK,mask:Yt.CESIUM_3D_TILE_MASK}})}function sdt(e){l(e._rs)||(e._rs=uTe(!1),e._rs3DTiles=uTe(!0))}function adt(e,t){if(l(e._sp))return;let n=e._batchTable,i=n.getVertexShaderCallback(!1,"a_batchId",void 0)(wM),r=n.getFragmentShaderCallback(!1,void 0,!0)(SM),o=new Ye({defines:["VECTOR_TILE","CLIP_POLYLINE"],sources:[Wl,i]}),s=new Ye({defines:["VECTOR_TILE"],sources:[r]});e._sp=Qt.fromCache({context:t,vertexShaderSource:o,fragmentShaderSource:s,attributeLocations:NA})}function cdt(e,t){let n=e._command;if(!l(e._command)){let r=e._batchTable.getUniformMapCallback()(e._uniformMap);n=e._command=new at({owner:e,vertexArray:e._va,renderState:e._rs,shaderProgram:e._sp,uniformMap:r,boundingVolume:e._boundingVolume,pass:Ie.TERRAIN_CLASSIFICATION,pickId:e._batchTable.getPickId()});let o=at.shallowClone(n,n.derivedCommands.tileset);o.renderState=e._rs3DTiles,o.pass=Ie.CESIUM_3D_TILE_CLASSIFICATION,n.derivedCommands.tileset=o}let i=e._classificationType;(i===ei.TERRAIN||i===ei.BOTH)&&t.commandList.push(n),(i===ei.CESIUM_3D_TILE||i===ei.BOTH)&&t.commandList.push(n.derivedCommands.tileset)}l_.prototype.getPositions=function(e){return LT.getPolylinePositions(this,e)};l_.prototype.createFeatures=function(e,t){let n=this._batchIds,i=n.length;for(let r=0;r<i;++r){let o=n[r];t[o]=new na(e,o)}};l_.prototype.applyDebugSettings=function(e,t){this._highlightColor=e?t:this._constantColor};function ldt(e,t){let n=e._batchIds,i=n.length;for(let r=0;r<i;++r){let o=n[r],s=t[o];s.show=!0,s.color=z.WHITE}}var udt=new z,fdt=z.WHITE,ddt=!0;l_.prototype.applyStyle=function(e,t){if(!l(e)){ldt(this,t);return}let n=this._batchIds,i=n.length;for(let r=0;r<i;++r){let o=n[r],s=t[o];s.color=l(e.color)?e.color.evaluateColor(s,udt):fdt,s.show=l(e.show)?e.show.evaluate(s):ddt}};function hdt(e){return Mi.initialize().then(function(){edt(e,e._rectangle,e._ellipsoid)}).catch(t=>{e.isDestroyed()||(e._error=t)})}l_.prototype.update=function(e){let t=e.context;if(!this._ready){if(l(this._promise)||(this._promise=hdt(this).then(idt(this,t))),l(this._error)){let i=this._error;throw this._error=void 0,i}return}odt(this,t),adt(this,t),sdt(this);let n=e.passes;(n.render||n.pick)&&cdt(this,e)};l_.prototype.isDestroyed=function(){return!1};l_.prototype.destroy=function(){return this._va=this._va&&this._va.destroy(),this._sp=this._sp&&this._sp.destroy(),le(this)};var L2=l_;var uQ=32767,mdt=new he,pdt=new h;function gdt(e,t,n,i,r){let o=e.length/3,s=e.subarray(0,o),a=e.subarray(o,2*o),c=e.subarray(2*o,3*o);cn.zigZagDeltaDecode(s,a,c);let u=new Float64Array(e.length);for(let f=0;f<o;++f){let d=s[f],p=a[f],g=c[f],m=D.lerp(t.west,t.east,d/uQ),y=D.lerp(t.south,t.north,p/uQ),A=D.lerp(n,i,g/uQ),b=he.fromRadians(m,y,A,mdt),x=r.cartographicToCartesian(b,pdt);h.pack(x,u,f*3)}return u}var F2=gdt;var dQ=class{constructor(t,n,i,r,o){this._tileset=t,this._tile=n,this._resource=i,this._polygons=void 0,this._polylines=void 0,this._points=void 0,this._metadata=void 0,this._batchTable=void 0,this._features=void 0,this.featurePropertiesDirty=!1,this._group=void 0,this._ready=!1,xdt(this,r,o)}get featuresLength(){return l(this._batchTable)?this._batchTable.featuresLength:0}get pointsLength(){return l(this._points)?this._points.pointsLength:0}get trianglesLength(){let t=0;return l(this._polygons)&&(t+=this._polygons.trianglesLength),l(this._polylines)&&(t+=this._polylines.trianglesLength),t}get geometryByteLength(){let t=0;return l(this._polygons)&&(t+=this._polygons.geometryByteLength),l(this._polylines)&&(t+=this._polylines.geometryByteLength),t}get texturesByteLength(){return l(this._points)?this._points.texturesByteLength:0}get batchTableByteLength(){return l(this._batchTable)?this._batchTable.batchTableByteLength:0}get innerContents(){}get ready(){return this._ready}get tileset(){return this._tileset}get tile(){return this._tile}get url(){return this._resource.getUrlComponent(!0)}get metadata(){return this._metadata}set metadata(t){this._metadata=t}get batchTable(){return this._batchTable}get group(){return this._group}set group(t){this._group=t}hasProperty(t,n){return this._batchTable.hasProperty(t,n)}getFeature(t){return l(this._features)||fQ(this),this._features[t]}applyDebugSettings(t,n){l(this._polygons)&&this._polygons.applyDebugSettings(t,n),l(this._polylines)&&this._polylines.applyDebugSettings(t,n),l(this._points)&&this._points.applyDebugSettings(t,n)}applyStyle(t){l(this._features)||fQ(this),l(this._polygons)&&this._polygons.applyStyle(t,this._features),l(this._polylines)&&this._polylines.applyStyle(t,this._features),l(this._points)&&this._points.applyStyle(t,this._features)}update(t,n){let i=!0;l(this._polygons)&&(this._polygons.classificationType=this._tileset.classificationType,this._polygons.debugWireframe=this._tileset.debugWireframe,this._polygons.update(n),i=i&&this._polygons.ready),l(this._polylines)&&(this._polylines.update(n),i=i&&this._polylines.ready),l(this._points)&&(this._points.update(n),i=i&&this._points.ready),l(this._batchTable)&&i&&(l(this._features)||fQ(this),this._batchTable.update(t,n),this._ready=!0)}pick(t,n,i){}getPolylinePositions(t){let n=this._polylines;if(l(n))return n.getPositions(t)}isDestroyed(){return!1}destroy(){return this._polygons=this._polygons&&this._polygons.destroy(),this._polylines=this._polylines&&this._polylines.destroy(),this._points=this._points&&this._points.destroy(),this._batchTable=this._batchTable&&this._batchTable.destroy(),le(this)}};function _dt(e){return function(t,n){l(e._polygons)&&e._polygons.updateCommands(t,n)}}function ydt(e,t){let n,i,r,o,s=e.POLYGONS_LENGTH??0,a=e.POLYLINES_LENGTH??0,c=e.POINTS_LENGTH??0;if(s>0&&l(e.POLYGON_BATCH_IDS)){let p=t.byteOffset+e.POLYGON_BATCH_IDS.byteOffset;n=new Uint16Array(t.buffer,p,s)}if(a>0&&l(e.POLYLINE_BATCH_IDS)){let p=t.byteOffset+e.POLYLINE_BATCH_IDS.byteOffset;i=new Uint16Array(t.buffer,p,a)}if(c>0&&l(e.POINT_BATCH_IDS)){let p=t.byteOffset+e.POINT_BATCH_IDS.byteOffset;r=new Uint16Array(t.buffer,p,c)}let u=l(n)||l(i)||l(r),f=s>0&&!l(n)||a>0&&!l(i)||c>0&&!l(r);if(u&&f)throw new oe("If one group of batch ids is defined, then all batch ids must be defined");if(!l(n)&&!l(i)&&!l(r)){let p=0;if(!l(n)&&s>0)for(n=new Uint16Array(s),o=0;o<s;++o)n[o]=p++;if(!l(i)&&a>0)for(i=new Uint16Array(a),o=0;o<a;++o)i[o]=p++;if(!l(r)&&c>0)for(r=new Uint16Array(c),o=0;o<c;++o)r[o]=p++}return{polygons:n,polylines:i,points:r}}var Sm=Uint32Array.BYTES_PER_ELEMENT;function Adt(e){return new LT(e)}function bdt(e){return new L2(e)}function xdt(e,t,n){n=n??0;let i=new Uint8Array(t),r=new DataView(t);n+=Sm;let o=r.getUint32(n,!0);if(o!==1)throw new oe(`Only Vector tile version 1 is supported. Version ${o} is not.`);n+=Sm;let s=r.getUint32(n,!0);if(n+=Sm,s===0){e._ready=!0;return}let a=r.getUint32(n,!0);if(n+=Sm,a===0)throw new oe("Feature table must have a byte length greater than zero");let c=r.getUint32(n,!0);n+=Sm;let u=r.getUint32(n,!0);n+=Sm;let f=r.getUint32(n,!0);n+=Sm;let d=r.getUint32(n,!0);n+=Sm;let p=r.getUint32(n,!0);n+=Sm;let g=r.getUint32(n,!0);n+=Sm,n+=Sm;let m=Ro(i,n,a);n+=a;let y=new Uint8Array(t,n,c);n+=c;let A,b;u>0&&(A=Ro(i,n,u),n+=u,f>0&&(b=new Uint8Array(t,n,f),b=new Uint8Array(b),n+=f));let x=m.POLYGONS_LENGTH??0,T=m.POLYLINES_LENGTH??0,E=m.POINTS_LENGTH??0,v=x+T+E,S=new sm(e,v,A,b,_dt(e));if(e._batchTable=S,v===0)return;let I=new hm(m,y),R=I.getGlobalProperty("REGION");if(!l(R))throw new oe("Feature table global property: REGION must be defined");let O=ie.unpack(R),L=R[4],_=R[5],C=e._tile.computedTransform,w=I.getGlobalProperty("RTC_CENTER",Y.FLOAT,3);l(w)?(w=h.unpack(w),N.multiplyByPoint(C,w,w)):(w=ie.center(O),w.height=D.lerp(L,_,.5),w=ee.WGS84.cartographicToCartesian(w));let P=ydt(m,y);if(n+=(4-n%4)%4,x>0){I.featuresLength=x;let F=I.getPropertyArray("POLYGON_COUNTS",Y.UNSIGNED_INT,1)??I.getPropertyArray("POLYGON_COUNT",Y.UNSIGNED_INT,1);if(!l(F))throw new oe("Feature table property: POLYGON_COUNTS must be defined when POLYGONS_LENGTH is greater than 0");let V=I.getPropertyArray("POLYGON_INDEX_COUNTS",Y.UNSIGNED_INT,1)??I.getPropertyArray("POLYGON_INDEX_COUNT",Y.UNSIGNED_INT,1);if(!l(V))throw new oe("Feature table property: POLYGON_INDEX_COUNTS must be defined when POLYGONS_LENGTH is greater than 0");let B=F.reduce(function(W,J){return W+J*2},0),j=V.reduce(function(W,J){return W+J},0),k=new Uint32Array(t,n,j);n+=d;let G=new Uint16Array(t,n,B);n+=p;let q,Q;l(m.POLYGON_MINIMUM_HEIGHTS)&&l(m.POLYGON_MAXIMUM_HEIGHTS)&&(q=I.getPropertyArray("POLYGON_MINIMUM_HEIGHTS",Y.FLOAT,1),Q=I.getPropertyArray("POLYGON_MAXIMUM_HEIGHTS",Y.FLOAT,1)),e._polygons=new O2({positions:G,counts:F,indexCounts:V,indices:k,minimumHeight:L,maximumHeight:_,polygonMinimumHeights:q,polygonMaximumHeights:Q,center:w,rectangle:O,boundingVolume:e.tile.boundingVolume.boundingVolume,batchTable:S,batchIds:P.polygons,modelMatrix:C})}let M=e._tileset;if(T>0){I.featuresLength=T;let F=I.getPropertyArray("POLYLINE_COUNTS",Y.UNSIGNED_INT,1)??I.getPropertyArray("POLYLINE_COUNT",Y.UNSIGNED_INT,1);if(!l(F))throw new oe("Feature table property: POLYLINE_COUNTS must be defined when POLYLINES_LENGTH is greater than 0");let V=I.getPropertyArray("POLYLINE_WIDTHS",Y.UNSIGNED_SHORT,1);if(!l(V)){V=new Uint16Array(T);for(let q=0;q<T;++q)V[q]=2}let B=F.reduce(function(q,Q){return q+Q*3},0),j=new Uint16Array(t,n,B);n+=g;let k=M.examineVectorLinesFunction;if(l(k)){let q=F2(new Uint16Array(j),O,L,_,ee.WGS84);Tdt(q,F,P.polylines,S,e.url,k)}let G=Adt;l(M.classificationType)&&(G=bdt),e._polylines=G({positions:j,widths:V,counts:F,batchIds:P.polylines,minimumHeight:L,maximumHeight:_,center:w,rectangle:O,boundingVolume:e.tile.boundingVolume.boundingVolume,batchTable:S,classificationType:M.classificationType,keepDecodedPositions:M.vectorKeepDecodedPositions})}if(E>0){let F=new Uint16Array(t,n,E*3);e._points=new R2({positions:F,batchIds:P.points,minimumHeight:L,maximumHeight:_,rectangle:O,batchTable:S,heightReference:M.heightReference,scene:M.scene})}}function fQ(e){let t=e.featuresLength;if(!l(e._features)&&t>0){let n=new Array(t);l(e._polygons)&&e._polygons.createFeatures(e,n),l(e._polylines)&&e._polylines.createFeatures(e,n),l(e._points)&&e._points.createFeatures(e,n),e._features=n}}function Tdt(e,t,n,i,r,o){let s=t.length,a=0;for(let c=0;c<s;c++){let u=t[c]*3,f=e.slice(a,a+u);a+=u,o(f,n[c],r,i)}}var B2=dQ;var{ERR_CAPACITY:ori}=ra.Error,Edt=new h,$H=class $H extends as{constructor(){super(...arguments);ut(this,"_collection",null)}static clone(n,i){return super.clone(n,i),i.setPosition(n.getPosition(Edt)),i}get vertexOffset(){return this._getUint32($H.Layout.POSITION_OFFSET_U32)}get vertexCount(){return 1}getPosition(n){let i=this._collection._positionView;return h.fromArray(i,this.vertexOffset*3,n)}setPosition(n){let i=this._collection,r=this.vertexOffset;i._positionView[r*3]=n.x,i._positionView[r*3+1]=n.y,i._positionView[r*3+2]=n.z,this._dirty=!0,i._makeDirtyBoundingVolume()}toJSON(){return{...super.toJSON(),position:h.pack(this.getPosition(),[])}}};ut($H,"Layout",{...as.Layout,POSITION_OFFSET_U32:as.Layout.__BYTE_LENGTH,__BYTE_LENGTH:as.Layout.__BYTE_LENGTH+4});var hQ=$H,kc=hQ;var k2=class k2 extends nu{constructor(t=H.EMPTY_OBJECT){super(t),this.size=t.size??1}static pack(t,n,i){super.pack(t,n,i),n.setUint8(this.Layout.SIZE_U8+i,t.size)}static unpack(t,n,i){return super.unpack(t,n,i),i.size=t.getUint8(this.Layout.SIZE_U8+n),i}toJSON(){return{...super.toJSON(),size:this.size}}};ut(k2,"Layout",{...nu.Layout,SIZE_U8:nu.Layout.__BYTE_LENGTH,__BYTE_LENGTH:nu.Layout.__BYTE_LENGTH+4}),ut(k2,"DEFAULT_MATERIAL",Object.freeze(new k2));var mQ=k2,wm=mQ;var pQ={positionHigh:0,positionLow:1,pickColor:2,showSizeColorAlpha:3,outlineWidthColorAlpha:4},fTe={position:0,pickColor:1,showSizeColorAlpha:2,outlineWidthColorAlpha:3},FT=new kc,Im=new wm,U2=new z,dTe=new h,gQ=new Sn;function Cdt(e,t,n){let i=t.context;n=n||{destroy:vdt};let r=e._positionDatatype===Y.DOUBLE,o=r?pQ:fTe;if(!l(n.attributeArrays)){let a=e.primitiveCountMax;n.attributeArrays={...r?{positionHigh:new Float32Array(a*3),positionLow:new Float32Array(a*3)}:{position:e._positionView},pickColor:new Uint8Array(a*4),showSizeColorAlpha:new Float32Array(a*4),outlineWidthColorAlpha:new Float32Array(a*3)}}if(e._dirtyCount>0){let{attributeArrays:a}=n,c=a.positionHigh,u=a.positionLow,f=a.pickColor,d=a.showSizeColorAlpha,p=a.outlineWidthColorAlpha,{_dirtyOffset:g,_dirtyCount:m}=e;for(let y=g,A=g+m;y<A;y++)e.get(y,FT),FT._dirty&&(r&&(FT.getPosition(dTe),Sn.fromCartesian(dTe,gQ),h.pack(gQ.high,c,y*3),h.pack(gQ.low,u,y*3)),FT.getMaterial(Im),z.fromRgba(FT._pickId,U2),f[y*4]=z.floatToByte(U2.red),f[y*4+1]=z.floatToByte(U2.green),f[y*4+2]=z.floatToByte(U2.blue),f[y*4+3]=z.floatToByte(U2.alpha),d[y*4]=FT.show?1:0,d[y*4+1]=Im.size,d[y*4+2]=cn.encodeRGB8(Im.color),d[y*4+3]=Im.color.alpha,p[y*3]=Im.outlineWidth,p[y*3+1]=cn.encodeRGB8(Im.outlineWidth>0?Im.outlineColor:Im.color),p[y*3+2]=Im.outlineWidth>0?Im.outlineColor.alpha:Im.color.alpha,FT._dirty=!1)}if(l(n.vertexArray)){if(e._dirtyCount>0){for(let a in o)if(Object.hasOwn(o,a)){let c=a;n.vertexArray.copyAttributeFromRange(o[c],n.attributeArrays[c],e._dirtyOffset,e._dirtyCount)}}}else{let{attributeArrays:a}=n;n.vertexArray=new zn({context:i,attributes:[...r?[{index:pQ.positionHigh,componentDatatype:Y.FLOAT,componentsPerAttribute:3,vertexBuffer:tt.createVertexBuffer({typedArray:a.positionHigh,context:i,usage:Me.STATIC_DRAW})},{index:pQ.positionLow,componentDatatype:Y.FLOAT,componentsPerAttribute:3,vertexBuffer:tt.createVertexBuffer({typedArray:a.positionLow,context:i,usage:Me.STATIC_DRAW})}]:[{index:fTe.position,componentDatatype:e._positionDatatype,componentsPerAttribute:3,normalize:e._positionNormalized,vertexBuffer:tt.createVertexBuffer({typedArray:e._positionView,context:i,usage:Me.STATIC_DRAW})}],{index:o.pickColor,componentDatatype:Y.UNSIGNED_BYTE,componentsPerAttribute:4,vertexBuffer:tt.createVertexBuffer({typedArray:a.pickColor,context:i,usage:Me.STATIC_DRAW})},{index:o.showSizeColorAlpha,componentDatatype:Y.FLOAT,componentsPerAttribute:4,vertexBuffer:tt.createVertexBuffer({typedArray:a.showSizeColorAlpha,context:i,usage:Me.STATIC_DRAW})},{index:o.outlineWidthColorAlpha,componentDatatype:Y.FLOAT,componentsPerAttribute:3,vertexBuffer:tt.createVertexBuffer({typedArray:a.outlineWidthColorAlpha,context:i,usage:Me.STATIC_DRAW})}]})}l(n.renderState)||(n.renderState=Ge.fromCache({blending:e._blendOption===Fi.OPAQUE?tn.DISABLED:tn.ALPHA_BLEND,depthTest:{enabled:!0}})),l(n.shaderProgram)||(n.shaderProgram=Qt.fromCache({context:i,vertexShaderSource:new Ye({sources:[VO],defines:r?["USE_FLOAT64"]:[]}),fragmentShaderSource:new Ye({sources:[zO]}),attributeLocations:o})),l(n.command)||(n.command=new at({vertexArray:n.vertexArray,renderState:n.renderState,shaderProgram:n.shaderProgram,primitiveType:Oe.POINTS,pass:e._blendOption===Fi.OPAQUE?Ie.OPAQUE:Ie.TRANSLUCENT,pickId:e._allowPicking?"v_pickColor":void 0,owner:e,count:e.primitiveCount,modelMatrix:e.modelMatrix,boundingVolume:e.boundingVolume,debugShowBoundingVolume:e.debugShowBoundingVolume}));let s=n.command;return s.count!==e.primitiveCount&&(s.count=e.primitiveCount),s.debugShowBoundingVolume!==e.debugShowBoundingVolume&&(s.debugShowBoundingVolume=e.debugShowBoundingVolume),t.commandList.push(s),e._makeClean(),n}function vdt(){let e=this;l(e.vertexArray)&&e.vertexArray.destroy(),l(e.shaderProgram)&&e.shaderProgram.destroy(),l(e.renderState)&&Ge.removeFromCache(e.renderState)}var z2=Cdt;var _Q=class e extends ra{constructor(t=H.EMPTY_OBJECT){super({...t,vertexCountMax:t.primitiveCountMax})}_getCollectionClass(){return e}_getPrimitiveClass(){return kc}_getMaterialClass(){return wm}_cloneEmpty(t=H.EMPTY_OBJECT){return new e(this._cloneEmptyBaseArgs(t))}add(t,n=new kc){return super.add(t,n),n._setUint32(kc.Layout.POSITION_OFFSET_U32,this._positionCount++),n.setPosition(t.position??h.ZERO),n}update(t){super.update(t);let n=t.passes;this.show&&(n.render||n.pick)&&(this._renderContext=z2(this,t,this._renderContext))}},$u=_Q;var BT={positionHigh:0,positionLow:1,prevPositionHigh:2,prevPositionLow:3,nextPositionHigh:4,nextPositionLow:5,pickColor:6,showColorWidthAndTexCoord:7,alpha:8},JH={position:0,prevPosition:1,nextPosition:2,pickColor:3,showColorWidthAndTexCoord:4,alpha:5},hl=new Aa,V2=new Ff,j2=new z,hTe=new h,mTe=new h,pTe=new h,yQ=new Sn,AQ=new Sn,bQ=new Sn;function Sdt(e,t,n){let i=t.context;n=n||{destroy:Pdt};let r=e._positionDatatype===Y.DOUBLE,o=r?BT:JH;if(!l(n.attributeArrays)||!l(n.indexArray)){let c=e.vertexCountMax-e.primitiveCount,u=e.vertexCountMax*2;n.indexArray=je.createTypedArray(u,c*6),n.attributeArrays={...r?{positionHigh:new Float32Array(u*3),positionLow:new Float32Array(u*3),prevPositionHigh:new Float32Array(u*3),prevPositionLow:new Float32Array(u*3),nextPositionHigh:new Float32Array(u*3),nextPositionLow:new Float32Array(u*3)}:{position:Y.createTypedArray(e._positionDatatype,u*3),prevPosition:Y.createTypedArray(e._positionDatatype,u*3),nextPosition:Y.createTypedArray(e._positionDatatype,u*3)},pickColor:new Uint8Array(u*4),showColorWidthAndTexCoord:new Float32Array(u*4),alpha:new Uint8Array(u)}}if(e._dirtyCount>0){let{_dirtyOffset:c,_dirtyCount:u}=e,f=e.widthUnits==="meters",d=n.indexArray,{pickColor:p,showColorWidthAndTexCoord:g,alpha:m,position:y,prevPosition:A,nextPosition:b,positionHigh:x,positionLow:T,prevPositionHigh:E,prevPositionLow:v,nextPositionHigh:S,nextPositionLow:I}=n.attributeArrays;for(let R=c,O=c+u;R<O;R++){if(e.get(R,hl),!hl._dirty)continue;hl.getMaterial(V2);let L=cn.encodeRGB8(V2.color),_=V2.color.alpha,C=f?-V2.width:V2.width;z.fromRgba(hl._pickId,j2);let w=hl.show,P=hl.vertexOffset*2,M=(hl.vertexOffset-R)*6,F=e._positionView,V=hl.vertexOffset*3;for(let B=0,j=hl.vertexCount;B<j;B++){let k=B===0,G=B===j-1,q=F[V+B*3],Q=F[V+B*3+1],W=F[V+B*3+2],J,Z,ae,Ae,fe,xe;k?(Ae=F[V+3],fe=F[V+3+1],xe=F[V+3+2],J=2*q-Ae,Z=2*Q-fe,ae=2*W-xe):G?(J=F[V+(B-1)*3],Z=F[V+(B-1)*3+1],ae=F[V+(B-1)*3+2],Ae=2*q-J,fe=2*Q-Z,xe=2*W-ae):(J=F[V+(B-1)*3],Z=F[V+(B-1)*3+1],ae=F[V+(B-1)*3+2],Ae=F[V+(B+1)*3],fe=F[V+(B+1)*3+1],xe=F[V+(B+1)*3+2]),G||(d[M]=P,d[M+1]=P+1,d[M+2]=P+2,d[M+3]=P+2,d[M+4]=P+1,d[M+5]=P+3,M+=6),r&&(h.fromElements(q,Q,W,hTe),h.fromElements(J,Z,ae,mTe),h.fromElements(Ae,fe,xe,pTe),Sn.fromCartesian(hTe,yQ),Sn.fromCartesian(mTe,AQ),Sn.fromCartesian(pTe,bQ));for(let ge=0;ge<2;ge++)r?(h.pack(yQ.high,x,P*3),h.pack(yQ.low,T,P*3),h.pack(AQ.high,E,P*3),h.pack(AQ.low,v,P*3),h.pack(bQ.high,S,P*3),h.pack(bQ.low,I,P*3)):(y[P*3]=q,y[P*3+1]=Q,y[P*3+2]=W,A[P*3]=J,A[P*3+1]=Z,A[P*3+2]=ae,b[P*3]=Ae,b[P*3+1]=fe,b[P*3+2]=xe),p[P*4]=z.floatToByte(j2.red),p[P*4+1]=z.floatToByte(j2.green),p[P*4+2]=z.floatToByte(j2.blue),p[P*4+3]=z.floatToByte(j2.alpha),g[P*4]=w?1:0,g[P*4+1]=L,g[P*4+2]=C,g[P*4+3]=B/(j-1),m[P]=_*255,P++}hl._dirty=!1}}if(l(n.vertexArray)){if(e._dirtyCount>0){let{indexOffset:c,indexCount:u,vertexOffset:f,vertexCount:d}=Idt(e);n.vertexArray.copyIndexFromRange(n.indexArray,c,u);for(let p in o)if(Object.hasOwn(o,p)){let g=p;n.vertexArray.copyAttributeFromRange(o[g],n.attributeArrays[g],f,d)}}}else{let c=n.attributeArrays;n.vertexArray=new zn({context:i,indexBuffer:tt.createIndexBuffer({context:i,typedArray:n.indexArray,usage:Me.STATIC_DRAW,indexDatatype:je.fromTypedArray(n.indexArray)}),attributes:[...r?[{index:BT.positionHigh,componentDatatype:Y.FLOAT,componentsPerAttribute:3,vertexBuffer:tt.createVertexBuffer({typedArray:c.positionHigh,context:i,usage:Me.STATIC_DRAW})},{index:BT.positionLow,componentDatatype:Y.FLOAT,componentsPerAttribute:3,vertexBuffer:tt.createVertexBuffer({typedArray:c.positionLow,context:i,usage:Me.STATIC_DRAW})},{index:BT.prevPositionHigh,componentDatatype:Y.FLOAT,componentsPerAttribute:3,vertexBuffer:tt.createVertexBuffer({typedArray:c.prevPositionHigh,context:i,usage:Me.STATIC_DRAW})},{index:BT.prevPositionLow,componentDatatype:Y.FLOAT,componentsPerAttribute:3,vertexBuffer:tt.createVertexBuffer({typedArray:c.prevPositionLow,context:i,usage:Me.STATIC_DRAW})},{index:BT.nextPositionHigh,componentDatatype:Y.FLOAT,componentsPerAttribute:3,vertexBuffer:tt.createVertexBuffer({typedArray:c.nextPositionHigh,context:i,usage:Me.STATIC_DRAW})},{index:BT.nextPositionLow,componentDatatype:Y.FLOAT,componentsPerAttribute:3,vertexBuffer:tt.createVertexBuffer({typedArray:c.nextPositionLow,context:i,usage:Me.STATIC_DRAW})}]:[{index:JH.position,componentDatatype:e._positionDatatype,componentsPerAttribute:3,normalize:e._positionNormalized,vertexBuffer:tt.createVertexBuffer({typedArray:c.position,context:i,usage:Me.STATIC_DRAW})},{index:JH.prevPosition,componentDatatype:e._positionDatatype,componentsPerAttribute:3,normalize:e._positionNormalized,vertexBuffer:tt.createVertexBuffer({typedArray:c.prevPosition,context:i,usage:Me.STATIC_DRAW})},{index:JH.nextPosition,componentDatatype:e._positionDatatype,componentsPerAttribute:3,normalize:e._positionNormalized,vertexBuffer:tt.createVertexBuffer({typedArray:c.nextPosition,context:i,usage:Me.STATIC_DRAW})}],{index:o.pickColor,componentDatatype:Y.UNSIGNED_BYTE,componentsPerAttribute:4,vertexBuffer:tt.createVertexBuffer({typedArray:c.pickColor,context:i,usage:Me.STATIC_DRAW})},{index:o.showColorWidthAndTexCoord,componentDatatype:Y.FLOAT,componentsPerAttribute:4,vertexBuffer:tt.createVertexBuffer({typedArray:c.showColorWidthAndTexCoord,context:i,usage:Me.STATIC_DRAW})},{index:o.alpha,componentDatatype:Y.UNSIGNED_BYTE,componentsPerAttribute:1,vertexBuffer:tt.createVertexBuffer({typedArray:c.alpha,context:i,usage:Me.STATIC_DRAW})}]})}l(n.renderState)||(n.renderState=Ge.fromCache({blending:e._blendOption===Fi.OPAQUE?tn.DISABLED:tn.ALPHA_BLEND,depthTest:{enabled:!0}})),l(n.shaderProgram)||(n.shaderProgram=Qt.fromCache({context:i,vertexShaderSource:new Ye({sources:[Wl,WO],defines:r?["USE_FLOAT64"]:[]}),fragmentShaderSource:new Ye({sources:[GO]}),attributeLocations:o}));let s=wdt(e);l(n.command)||(n.command=new at({vertexArray:n.vertexArray,renderState:n.renderState,shaderProgram:n.shaderProgram,primitiveType:Oe.TRIANGLES,pass:e._blendOption===Fi.OPAQUE?Ie.OPAQUE:Ie.TRANSLUCENT,pickId:e._allowPicking?"v_pickColor":void 0,owner:e,count:s,modelMatrix:e.modelMatrix,boundingVolume:e.boundingVolume,debugShowBoundingVolume:e.debugShowBoundingVolume}));let a=n.command;return a.count!==s&&(a.count=s),a.debugShowBoundingVolume!==e.debugShowBoundingVolume&&(a.debugShowBoundingVolume=e.debugShowBoundingVolume),t.commandList.push(a),e._makeClean(),n}function wdt(e){return(e.vertexCount-e.primitiveCount)*6}function Idt(e){let{_dirtyOffset:t,_dirtyCount:n}=e;e.get(t,hl);let i=hl.vertexOffset*2,o=(hl.vertexOffset-t)*6;e.get(t+n-1,hl);let s=(hl.vertexOffset+hl.vertexCount)*2-i,c=(s/2-n)*6;return{indexOffset:o,indexCount:c,vertexOffset:i,vertexCount:s}}function Pdt(){let e=this;l(e.vertexArray)&&e.vertexArray.destroy(),l(e.shaderProgram)&&e.shaderProgram.destroy(),l(e.renderState)&&Ge.removeFromCache(e.renderState)}var H2=Sdt;var xQ=class e extends ra{constructor(t=H.EMPTY_OBJECT){super(t);let n=t.widthUnits??"pixels";this._widthUnits=n}get widthUnits(){return this._widthUnits}_getCollectionClass(){return e}_getPrimitiveClass(){return Aa}_getMaterialClass(){return Ff}_cloneEmpty(t=H.EMPTY_OBJECT){return new e({widthUnits:this._widthUnits,...this._cloneEmptyBaseArgs(t)})}add(t,n=new Aa){super.add(t,n);let i=this._positionCount;return n._setUint32(Aa.Layout.POSITION_OFFSET_U32,i),n._setUint32(Aa.Layout.POSITION_COUNT_U32,0),l(t.positions)&&n.setPositions(t.positions),n}update(t){super.update(t),this._isRendered(t)&&(this._renderContext=H2(this,t,this._renderContext))}},ml=xQ;function uw(e,t){this._conditionsExpression=Je(e,!0),this._conditions=e.conditions,this._runtimeConditions=void 0,Rdt(this,t)}Object.defineProperties(uw.prototype,{conditionsExpression:{get:function(){return this._conditionsExpression}}});function Ddt(e,t){this.condition=e,this.expression=t}function Rdt(e,t){let n=[],i=e._conditions;if(!l(i))return;let r=i.length;for(let o=0;o<r;++o){let s=i[o],a=String(s[0]),c=String(s[1]);n.push(new Ddt(new Bd(a,t),new Bd(c,t)))}e._runtimeConditions=n}uw.prototype.evaluate=function(e,t){let n=this._runtimeConditions;if(!l(n))return;let i=n.length;for(let r=0;r<i;++r){let o=n[r];if(o.condition.evaluate(e))return o.expression.evaluate(e,t)}};uw.prototype.evaluateColor=function(e,t){let n=this._runtimeConditions;if(!l(n))return;let i=n.length;for(let r=0;r<i;++r){let o=n[r];if(o.condition.evaluate(e))return o.expression.evaluateColor(e,t)}};uw.prototype.getShaderFunction=function(e,t,n,i){let r=this._runtimeConditions;if(!l(r)||r.length===0)return;let o="",s=r.length;for(let a=0;a<s;++a){let c=r[a],u=c.condition.getShaderExpression(t,n),f=c.expression.getShaderExpression(t,n);o+=` ${a===0?"if":"else if"} (${u}) +`;function k0t(e,t){if(l(e._sp))return;let n=e._batchTable,i=n.getVertexShaderCallback(!1,"a_batchId",void 0)(IM),r=n.getFragmentShaderCallback(!1,void 0,!1)(B0t),o=new Ye({defines:["VECTOR_TILE","CLIP_POLYLINE"],sources:[Wl,i]}),s=new Ye({defines:["VECTOR_TILE"],sources:[r]});e._sp=Qt.fromCache({context:t,vertexShaderSource:o,fragmentShaderSource:s,attributeLocations:Hw})}function U0t(e,t){if(!l(e._command)){let n=e._batchTable.getUniformMapCallback()(e._uniformMap);e._command=new at({owner:e,vertexArray:e._va,renderState:e._rs,shaderProgram:e._sp,uniformMap:n,boundingVolume:e._boundingVolume,pass:Ie.TRANSLUCENT,pickId:e._batchTable.getPickId()})}t.commandList.push(e._command)}Fm.getPolylinePositions=function(e,t){let n=e._batchIds,i=e._decodedPositions,r=e._decodedPositionOffsets;if(!l(n)||!l(i))return;let o,s,a=n.length,c=0,u=0;for(o=0;o<a;++o)n[o]===t&&(c+=r[o+1]-r[o]);if(c===0)return;let f=new Float64Array(c*3);for(o=0;o<a;++o)if(n[o]===t){let d=r[o],p=r[o+1]-d;for(s=0;s<p;++s){let g=(d+s)*3;f[u++]=i[g],f[u++]=i[g+1],f[u++]=i[g+2]}}return f};Fm.prototype.getPositions=function(e){return Fm.getPolylinePositions(this,e)};Fm.prototype.createFeatures=function(e,t){let n=this._batchIds,i=n.length;for(let r=0;r<i;++r){let o=n[r];t[o]=new oa(e,o)}};Fm.prototype.applyDebugSettings=function(e,t){this._highlightColor=e?t:this._constantColor};function z0t(e,t){let n=e._batchIds,i=n.length;for(let r=0;r<i;++r){let o=n[r],s=t[o];s.show=!0,s.color=z.WHITE}}var V0t=new z,j0t=z.WHITE,H0t=!0;Fm.prototype.applyStyle=function(e,t){if(!l(e)){z0t(this,t);return}let n=this._batchIds,i=n.length;for(let r=0;r<i;++r){let o=n[r],s=t[o];s.color=l(e.color)?e.color.evaluateColor(s,V0t):j0t,s.show=l(e.show)?e.show.evaluate(s):H0t}};Fm.prototype.update=function(e){let t=e.context;if(!this._ready){if(l(this._promise)||(this._promise=M0t(this,t)),l(this._error)){let i=this._error;throw this._error=void 0,i}return}L0t(this,t),k0t(this,t),F0t(this);let n=e.passes;(n.render||n.pick)&&U0t(this,e)};Fm.prototype.isDestroyed=function(){return!1};Fm.prototype.destroy=function(){return this._va=this._va&&this._va.destroy(),this._sp=this._sp&&this._sp.destroy(),le(this)};var eE=Fm;function A_(e){this._positions=e.positions,this._widths=e.widths,this._counts=e.counts,this._batchIds=e.batchIds,this._ellipsoid=e.ellipsoid??ee.WGS84,this._minimumHeight=e.minimumHeight,this._maximumHeight=e.maximumHeight,this._center=e.center,this._rectangle=e.rectangle,this._batchTable=e.batchTable,this._va=void 0,this._sp=void 0,this._rs=void 0,this._uniformMap=void 0,this._command=void 0,this._transferrableBatchIds=void 0,this._packedBuffer=void 0,this._minimumMaximumVectorHeights=new U(Mi._defaultMinTerrainHeight,Mi._defaultMaxTerrainHeight),this._boundingVolume=en.fromRectangle(e.rectangle,Mi._defaultMinTerrainHeight,Mi._defaultMaxTerrainHeight,this._ellipsoid),this._classificationType=e.classificationType,this._keepDecodedPositions=e.keepDecodedPositions,this._decodedPositions=void 0,this._decodedPositionOffsets=void 0,this._startEllipsoidNormals=void 0,this._endEllipsoidNormals=void 0,this._startPositionAndHeights=void 0,this._startFaceNormalAndVertexCornerIds=void 0,this._endPositionAndHeights=void 0,this._endFaceNormalAndHalfWidths=void 0,this._vertexBatchIds=void 0,this._indices=void 0,this._constantColor=z.clone(z.WHITE),this._highlightColor=this._constantColor,this._trianglesLength=0,this._geometryByteLength=0,this._ready=!1,this._promise=void 0,this._error=void 0}Object.defineProperties(A_.prototype,{trianglesLength:{get:function(){return this._trianglesLength}},geometryByteLength:{get:function(){return this._geometryByteLength}},ready:{get:function(){return this._ready}}});function G0t(e,t,n){let i=Mi.getMinimumMaximumHeights(t,n),r=i.minimumTerrainHeight,o=i.maximumTerrainHeight,s=e._minimumMaximumVectorHeights;s.x=r,s.y=o;let a=e._boundingVolume,c=e._rectangle;en.fromRectangle(c,r,o,n,a)}function W0t(e){let t=e._rectangle,n=e._minimumHeight,i=e._maximumHeight,r=e._ellipsoid,o=e._center,s=2+ie.packedLength+ee.packedLength+h.packedLength,a=new Float64Array(s),c=0;return a[c++]=n,a[c++]=i,ie.pack(t,a,c),c+=ie.packedLength,ee.pack(r,a,c),c+=ee.packedLength,h.pack(o,a,c),a}var q0t=new $n("createVectorTileClampedPolylines"),VA={startEllipsoidNormal:0,endEllipsoidNormal:1,startPositionAndHeight:2,endPositionAndHeight:3,startFaceNormalAndVertexCorner:4,endFaceNormalAndHalfWidth:5,a_batchId:6};function Y0t(e,t){if(l(e._va))return;let n=e._positions,i=e._widths,r=e._counts,o=e._transferrableBatchIds,s=e._packedBuffer;l(s)||(n=e._positions=n.slice(),i=e._widths=i.slice(),r=e._counts=r.slice(),o=e._transferrableBatchIds=e._batchIds.slice(),s=e._packedBuffer=W0t(e));let a=[n.buffer,i.buffer,r.buffer,o.buffer,s.buffer],c={positions:n.buffer,widths:i.buffer,counts:r.buffer,batchIds:o.buffer,packedBuffer:s.buffer,keepDecodedPositions:e._keepDecodedPositions},u=q0t.scheduleTask(c,a);if(l(u))return u.then(function(f){if(e.isDestroyed())return;e._keepDecodedPositions&&(e._decodedPositions=new Float64Array(f.decodedPositions),e._decodedPositionOffsets=new Uint32Array(f.decodedPositionOffsets)),e._startEllipsoidNormals=new Float32Array(f.startEllipsoidNormals),e._endEllipsoidNormals=new Float32Array(f.endEllipsoidNormals),e._startPositionAndHeights=new Float32Array(f.startPositionAndHeights),e._startFaceNormalAndVertexCornerIds=new Float32Array(f.startFaceNormalAndVertexCornerIds),e._endPositionAndHeights=new Float32Array(f.endPositionAndHeights),e._endFaceNormalAndHalfWidths=new Float32Array(f.endFaceNormalAndHalfWidths),e._vertexBatchIds=new Uint16Array(f.vertexBatchIds);let d=f.indexDatatype;e._indices=d===je.UNSIGNED_SHORT?new Uint16Array(f.indices):new Uint32Array(f.indices),X0t(e,t),e._ready=!0}).catch(f=>{e.isDestroyed()||(e._error=f)})}function X0t(e,t){if(!l(e._va)){let n=e._startEllipsoidNormals,i=e._endEllipsoidNormals,r=e._startPositionAndHeights,o=e._endPositionAndHeights,s=e._startFaceNormalAndVertexCornerIds,a=e._endFaceNormalAndHalfWidths,c=e._vertexBatchIds,u=e._indices,f=n.byteLength+i.byteLength;f+=r.byteLength+o.byteLength,f+=s.byteLength+a.byteLength,f+=c.byteLength+u.byteLength,e._trianglesLength=u.length/3,e._geometryByteLength=f;let d=tt.createVertexBuffer({context:t,typedArray:n,usage:Me.STATIC_DRAW}),p=tt.createVertexBuffer({context:t,typedArray:i,usage:Me.STATIC_DRAW}),g=tt.createVertexBuffer({context:t,typedArray:r,usage:Me.STATIC_DRAW}),m=tt.createVertexBuffer({context:t,typedArray:o,usage:Me.STATIC_DRAW}),y=tt.createVertexBuffer({context:t,typedArray:s,usage:Me.STATIC_DRAW}),A=tt.createVertexBuffer({context:t,typedArray:a,usage:Me.STATIC_DRAW}),b=tt.createVertexBuffer({context:t,typedArray:c,usage:Me.STATIC_DRAW}),x=tt.createIndexBuffer({context:t,typedArray:u,usage:Me.STATIC_DRAW,indexDatatype:u.BYTES_PER_ELEMENT===2?je.UNSIGNED_SHORT:je.UNSIGNED_INT}),T=[{index:VA.startEllipsoidNormal,vertexBuffer:d,componentDatatype:Y.FLOAT,componentsPerAttribute:3},{index:VA.endEllipsoidNormal,vertexBuffer:p,componentDatatype:Y.FLOAT,componentsPerAttribute:3},{index:VA.startPositionAndHeight,vertexBuffer:g,componentDatatype:Y.FLOAT,componentsPerAttribute:4},{index:VA.endPositionAndHeight,vertexBuffer:m,componentDatatype:Y.FLOAT,componentsPerAttribute:4},{index:VA.startFaceNormalAndVertexCorner,vertexBuffer:y,componentDatatype:Y.FLOAT,componentsPerAttribute:4},{index:VA.endFaceNormalAndHalfWidth,vertexBuffer:A,componentDatatype:Y.FLOAT,componentsPerAttribute:4},{index:VA.a_batchId,vertexBuffer:b,componentDatatype:Y.UNSIGNED_SHORT,componentsPerAttribute:1}];e._va=new zn({context:t,attributes:T,indexBuffer:x}),e._positions=void 0,e._widths=void 0,e._counts=void 0,e._ellipsoid=void 0,e._minimumHeight=void 0,e._maximumHeight=void 0,e._rectangle=void 0,e._transferrableBatchIds=void 0,e._packedBuffer=void 0,e._startEllipsoidNormals=void 0,e._endEllipsoidNormals=void 0,e._startPositionAndHeights=void 0,e._startFaceNormalAndVertexCornerIds=void 0,e._endPositionAndHeights=void 0,e._endFaceNormalAndHalfWidths=void 0,e._vertexBatchIds=void 0,e._indices=void 0}}var Pk=new N,fve=new h;function K0t(e,t){l(e._uniformMap)||(e._uniformMap={u_modifiedModelView:function(){let n=t.uniformState.view;return N.clone(n,Pk),N.multiplyByPoint(Pk,e._center,fve),N.setTranslation(Pk,fve,Pk),Pk},u_highlightColor:function(){return e._highlightColor},u_minimumMaximumVectorHeights:function(){return e._minimumMaximumVectorHeights}})}function dve(e){return Ge.fromCache({cull:{enabled:!0,face:zi.FRONT},blending:tn.PRE_MULTIPLIED_ALPHA_BLEND,depthMask:!1,stencilTest:{enabled:e,frontFunction:ei.EQUAL,frontOperation:{fail:Rt.KEEP,zFail:Rt.KEEP,zPass:Rt.KEEP},backFunction:ei.EQUAL,backOperation:{fail:Rt.KEEP,zFail:Rt.KEEP,zPass:Rt.KEEP},reference:Yt.CESIUM_3D_TILE_MASK,mask:Yt.CESIUM_3D_TILE_MASK}})}function $0t(e){l(e._rs)||(e._rs=dve(!1),e._rs3DTiles=dve(!0))}function J0t(e,t){if(l(e._sp))return;let n=e._batchTable,i=n.getVertexShaderCallback(!1,"a_batchId",void 0)(wM),r=n.getFragmentShaderCallback(!1,void 0,!0)(SM),o=new Ye({defines:["VECTOR_TILE","CLIP_POLYLINE"],sources:[Wl,i]}),s=new Ye({defines:["VECTOR_TILE"],sources:[r]});e._sp=Qt.fromCache({context:t,vertexShaderSource:o,fragmentShaderSource:s,attributeLocations:VA})}function Z0t(e,t){let n=e._command;if(!l(e._command)){let r=e._batchTable.getUniformMapCallback()(e._uniformMap);n=e._command=new at({owner:e,vertexArray:e._va,renderState:e._rs,shaderProgram:e._sp,uniformMap:r,boundingVolume:e._boundingVolume,pass:Ie.TERRAIN_CLASSIFICATION,pickId:e._batchTable.getPickId()});let o=at.shallowClone(n,n.derivedCommands.tileset);o.renderState=e._rs3DTiles,o.pass=Ie.CESIUM_3D_TILE_CLASSIFICATION,n.derivedCommands.tileset=o}let i=e._classificationType;(i===Qn.TERRAIN||i===Qn.BOTH)&&t.commandList.push(n),(i===Qn.CESIUM_3D_TILE||i===Qn.BOTH)&&t.commandList.push(n.derivedCommands.tileset)}A_.prototype.getPositions=function(e){return eE.getPolylinePositions(this,e)};A_.prototype.createFeatures=function(e,t){let n=this._batchIds,i=n.length;for(let r=0;r<i;++r){let o=n[r];t[o]=new oa(e,o)}};A_.prototype.applyDebugSettings=function(e,t){this._highlightColor=e?t:this._constantColor};function Q0t(e,t){let n=e._batchIds,i=n.length;for(let r=0;r<i;++r){let o=n[r],s=t[o];s.show=!0,s.color=z.WHITE}}var egt=new z,tgt=z.WHITE,ngt=!0;A_.prototype.applyStyle=function(e,t){if(!l(e)){Q0t(this,t);return}let n=this._batchIds,i=n.length;for(let r=0;r<i;++r){let o=n[r],s=t[o];s.color=l(e.color)?e.color.evaluateColor(s,egt):tgt,s.show=l(e.show)?e.show.evaluate(s):ngt}};function igt(e){return Mi.initialize().then(function(){G0t(e,e._rectangle,e._ellipsoid)}).catch(t=>{e.isDestroyed()||(e._error=t)})}A_.prototype.update=function(e){let t=e.context;if(!this._ready){if(l(this._promise)||(this._promise=igt(this).then(Y0t(this,t))),l(this._error)){let i=this._error;throw this._error=void 0,i}return}K0t(this,t),J0t(this,t),$0t(this);let n=e.passes;(n.render||n.pick)&&Z0t(this,e)};A_.prototype.isDestroyed=function(){return!1};A_.prototype.destroy=function(){return this._va=this._va&&this._va.destroy(),this._sp=this._sp&&this._sp.destroy(),le(this)};var Dk=A_;var oee=32767,rgt=new he,ogt=new h;function sgt(e,t,n,i,r){let o=e.length/3,s=e.subarray(0,o),a=e.subarray(o,2*o),c=e.subarray(2*o,3*o);cn.zigZagDeltaDecode(s,a,c);let u=new Float64Array(e.length);for(let f=0;f<o;++f){let d=s[f],p=a[f],g=c[f],m=D.lerp(t.west,t.east,d/oee),y=D.lerp(t.south,t.north,p/oee),A=D.lerp(n,i,g/oee),b=he.fromRadians(m,y,A,rgt),x=r.cartographicToCartesian(b,ogt);h.pack(x,u,f*3)}return u}var Rk=sgt;var aee=class{constructor(t,n,i,r,o){this._tileset=t,this._tile=n,this._resource=i,this._polygons=void 0,this._polylines=void 0,this._points=void 0,this._metadata=void 0,this._batchTable=void 0,this._features=void 0,this.featurePropertiesDirty=!1,this._group=void 0,this._ready=!1,fgt(this,r,o)}get featuresLength(){return l(this._batchTable)?this._batchTable.featuresLength:0}get pointsLength(){return l(this._points)?this._points.pointsLength:0}get trianglesLength(){let t=0;return l(this._polygons)&&(t+=this._polygons.trianglesLength),l(this._polylines)&&(t+=this._polylines.trianglesLength),t}get geometryByteLength(){let t=0;return l(this._polygons)&&(t+=this._polygons.geometryByteLength),l(this._polylines)&&(t+=this._polylines.geometryByteLength),t}get texturesByteLength(){return l(this._points)?this._points.texturesByteLength:0}get batchTableByteLength(){return l(this._batchTable)?this._batchTable.batchTableByteLength:0}get innerContents(){}get ready(){return this._ready}get tileset(){return this._tileset}get tile(){return this._tile}get url(){return this._resource.getUrlComponent(!0)}get metadata(){return this._metadata}set metadata(t){this._metadata=t}get batchTable(){return this._batchTable}get group(){return this._group}set group(t){this._group=t}hasProperty(t,n){return this._batchTable.hasProperty(t,n)}getFeature(t){return l(this._features)||see(this),this._features[t]}applyDebugSettings(t,n){l(this._polygons)&&this._polygons.applyDebugSettings(t,n),l(this._polylines)&&this._polylines.applyDebugSettings(t,n),l(this._points)&&this._points.applyDebugSettings(t,n)}applyStyle(t){l(this._features)||see(this),l(this._polygons)&&this._polygons.applyStyle(t,this._features),l(this._polylines)&&this._polylines.applyStyle(t,this._features),l(this._points)&&this._points.applyStyle(t,this._features)}update(t,n){let i=!0;l(this._polygons)&&(this._polygons.classificationType=this._tileset.classificationType,this._polygons.debugWireframe=this._tileset.debugWireframe,this._polygons.update(n),i=i&&this._polygons.ready),l(this._polylines)&&(this._polylines.update(n),i=i&&this._polylines.ready),l(this._points)&&(this._points.update(n),i=i&&this._points.ready),l(this._batchTable)&&i&&(l(this._features)||see(this),this._batchTable.update(t,n),this._ready=!0)}pick(t,n,i){}getPolylinePositions(t){let n=this._polylines;if(l(n))return n.getPositions(t)}isDestroyed(){return!1}destroy(){return this._polygons=this._polygons&&this._polygons.destroy(),this._polylines=this._polylines&&this._polylines.destroy(),this._points=this._points&&this._points.destroy(),this._batchTable=this._batchTable&&this._batchTable.destroy(),le(this)}};function agt(e){return function(t,n){l(e._polygons)&&e._polygons.updateCommands(t,n)}}function cgt(e,t){let n,i,r,o,s=e.POLYGONS_LENGTH??0,a=e.POLYLINES_LENGTH??0,c=e.POINTS_LENGTH??0;if(s>0&&l(e.POLYGON_BATCH_IDS)){let p=t.byteOffset+e.POLYGON_BATCH_IDS.byteOffset;n=new Uint16Array(t.buffer,p,s)}if(a>0&&l(e.POLYLINE_BATCH_IDS)){let p=t.byteOffset+e.POLYLINE_BATCH_IDS.byteOffset;i=new Uint16Array(t.buffer,p,a)}if(c>0&&l(e.POINT_BATCH_IDS)){let p=t.byteOffset+e.POINT_BATCH_IDS.byteOffset;r=new Uint16Array(t.buffer,p,c)}let u=l(n)||l(i)||l(r),f=s>0&&!l(n)||a>0&&!l(i)||c>0&&!l(r);if(u&&f)throw new oe("If one group of batch ids is defined, then all batch ids must be defined");if(!l(n)&&!l(i)&&!l(r)){let p=0;if(!l(n)&&s>0)for(n=new Uint16Array(s),o=0;o<s;++o)n[o]=p++;if(!l(i)&&a>0)for(i=new Uint16Array(a),o=0;o<a;++o)i[o]=p++;if(!l(r)&&c>0)for(r=new Uint16Array(c),o=0;o<c;++o)r[o]=p++}return{polygons:n,polylines:i,points:r}}var Bm=Uint32Array.BYTES_PER_ELEMENT;function lgt(e){return new eE(e)}function ugt(e){return new Dk(e)}function fgt(e,t,n){n=n??0;let i=new Uint8Array(t),r=new DataView(t);n+=Bm;let o=r.getUint32(n,!0);if(o!==1)throw new oe(`Only Vector tile version 1 is supported. Version ${o} is not.`);n+=Bm;let s=r.getUint32(n,!0);if(n+=Bm,s===0){e._ready=!0;return}let a=r.getUint32(n,!0);if(n+=Bm,a===0)throw new oe("Feature table must have a byte length greater than zero");let c=r.getUint32(n,!0);n+=Bm;let u=r.getUint32(n,!0);n+=Bm;let f=r.getUint32(n,!0);n+=Bm;let d=r.getUint32(n,!0);n+=Bm;let p=r.getUint32(n,!0);n+=Bm;let g=r.getUint32(n,!0);n+=Bm,n+=Bm;let m=No(i,n,a);n+=a;let y=new Uint8Array(t,n,c);n+=c;let A,b;u>0&&(A=No(i,n,u),n+=u,f>0&&(b=new Uint8Array(t,n,f),b=new Uint8Array(b),n+=f));let x=m.POLYGONS_LENGTH??0,T=m.POLYLINES_LENGTH??0,E=m.POINTS_LENGTH??0,v=x+T+E,S=new vm(e,v,A,b,agt(e));if(e._batchTable=S,v===0)return;let I=new Cm(m,y),R=I.getGlobalProperty("REGION");if(!l(R))throw new oe("Feature table global property: REGION must be defined");let O=ie.unpack(R),L=R[4],_=R[5],C=e._tile.computedTransform,w=I.getGlobalProperty("RTC_CENTER",Y.FLOAT,3);l(w)?(w=h.unpack(w),N.multiplyByPoint(C,w,w)):(w=ie.center(O),w.height=D.lerp(L,_,.5),w=ee.WGS84.cartographicToCartesian(w));let P=cgt(m,y);if(n+=(4-n%4)%4,x>0){I.featuresLength=x;let F=I.getPropertyArray("POLYGON_COUNTS",Y.UNSIGNED_INT,1)??I.getPropertyArray("POLYGON_COUNT",Y.UNSIGNED_INT,1);if(!l(F))throw new oe("Feature table property: POLYGON_COUNTS must be defined when POLYGONS_LENGTH is greater than 0");let V=I.getPropertyArray("POLYGON_INDEX_COUNTS",Y.UNSIGNED_INT,1)??I.getPropertyArray("POLYGON_INDEX_COUNT",Y.UNSIGNED_INT,1);if(!l(V))throw new oe("Feature table property: POLYGON_INDEX_COUNTS must be defined when POLYGONS_LENGTH is greater than 0");let B=F.reduce(function(W,J){return W+J*2},0),j=V.reduce(function(W,J){return W+J},0),k=new Uint32Array(t,n,j);n+=d;let G=new Uint16Array(t,n,B);n+=p;let q,Q;l(m.POLYGON_MINIMUM_HEIGHTS)&&l(m.POLYGON_MAXIMUM_HEIGHTS)&&(q=I.getPropertyArray("POLYGON_MINIMUM_HEIGHTS",Y.FLOAT,1),Q=I.getPropertyArray("POLYGON_MAXIMUM_HEIGHTS",Y.FLOAT,1)),e._polygons=new wk({positions:G,counts:F,indexCounts:V,indices:k,minimumHeight:L,maximumHeight:_,polygonMinimumHeights:q,polygonMaximumHeights:Q,center:w,rectangle:O,boundingVolume:e.tile.boundingVolume.boundingVolume,batchTable:S,batchIds:P.polygons,modelMatrix:C})}let M=e._tileset;if(T>0){I.featuresLength=T;let F=I.getPropertyArray("POLYLINE_COUNTS",Y.UNSIGNED_INT,1)??I.getPropertyArray("POLYLINE_COUNT",Y.UNSIGNED_INT,1);if(!l(F))throw new oe("Feature table property: POLYLINE_COUNTS must be defined when POLYLINES_LENGTH is greater than 0");let V=I.getPropertyArray("POLYLINE_WIDTHS",Y.UNSIGNED_SHORT,1);if(!l(V)){V=new Uint16Array(T);for(let q=0;q<T;++q)V[q]=2}let B=F.reduce(function(q,Q){return q+Q*3},0),j=new Uint16Array(t,n,B);n+=g;let k=M.examineVectorLinesFunction;if(l(k)){let q=Rk(new Uint16Array(j),O,L,_,ee.WGS84);dgt(q,F,P.polylines,S,e.url,k)}let G=lgt;l(M.classificationType)&&(G=ugt),e._polylines=G({positions:j,widths:V,counts:F,batchIds:P.polylines,minimumHeight:L,maximumHeight:_,center:w,rectangle:O,boundingVolume:e.tile.boundingVolume.boundingVolume,batchTable:S,classificationType:M.classificationType,keepDecodedPositions:M.vectorKeepDecodedPositions})}if(E>0){let F=new Uint16Array(t,n,E*3);e._points=new Sk({positions:F,batchIds:P.points,minimumHeight:L,maximumHeight:_,rectangle:O,batchTable:S,heightReference:M.heightReference,scene:M.scene})}}function see(e){let t=e.featuresLength;if(!l(e._features)&&t>0){let n=new Array(t);l(e._polygons)&&e._polygons.createFeatures(e,n),l(e._polylines)&&e._polylines.createFeatures(e,n),l(e._points)&&e._points.createFeatures(e,n),e._features=n}}function dgt(e,t,n,i,r,o){let s=t.length,a=0;for(let c=0;c<s;c++){let u=t[c]*3,f=e.slice(a,a+u);a+=u,o(f,n[c],r,i)}}var Ok=aee;var{ERR_CAPACITY:jyi}=ra.Error,hgt=new h,SG=class SG extends cs{constructor(){super(...arguments);ut(this,"_collection",null)}static clone(n,i){return super.clone(n,i),i.setPosition(n.getPosition(hgt)),i}get vertexOffset(){return this._getUint32(SG.Layout.POSITION_OFFSET_U32)}get vertexCount(){return 1}getPosition(n){let i=this._collection._positionView;return h.fromArray(i,this.vertexOffset*3,n)}setPosition(n){let i=this._collection,r=this.vertexOffset;i._positionView[r*3]=n.x,i._positionView[r*3+1]=n.y,i._positionView[r*3+2]=n.z,this._dirty=!0,i._makeDirtyBoundingVolume()}toJSON(){return{...super.toJSON(),position:h.pack(this.getPosition(),[])}}};ut(SG,"Layout",{...cs.Layout,POSITION_OFFSET_U32:cs.Layout.__BYTE_LENGTH,__BYTE_LENGTH:cs.Layout.__BYTE_LENGTH+4});var cee=SG,kc=cee;var Mk=class Mk extends iu{constructor(t=H.EMPTY_OBJECT){super(t),this.size=t.size??1}static pack(t,n,i){super.pack(t,n,i),n.setUint8(this.Layout.SIZE_U8+i,t.size)}static unpack(t,n,i){return super.unpack(t,n,i),i.size=t.getUint8(this.Layout.SIZE_U8+n),i}toJSON(){return{...super.toJSON(),size:this.size}}};ut(Mk,"Layout",{...iu.Layout,SIZE_U8:iu.Layout.__BYTE_LENGTH,__BYTE_LENGTH:iu.Layout.__BYTE_LENGTH+4}),ut(Mk,"DEFAULT_MATERIAL",Object.freeze(new Mk));var lee=Mk,km=lee;var uee={positionHigh:0,positionLow:1,pickColor:2,showSizeColorAlpha:3,outlineWidthColorAlpha:4},hve={position:0,pickColor:1,showSizeColorAlpha:2,outlineWidthColorAlpha:3},tE=new kc,Um=new km,Nk=new z,mve=new h,fee=new Sn;function mgt(e,t,n){let i=t.context;n=n||{destroy:pgt};let r=e._positionDatatype===Y.DOUBLE,o=r?uee:hve;if(!l(n.attributeArrays)){let a=e.primitiveCountMax;n.attributeArrays={...r?{positionHigh:new Float32Array(a*3),positionLow:new Float32Array(a*3)}:{position:e._positionView},pickColor:new Uint8Array(a*4),showSizeColorAlpha:new Float32Array(a*4),outlineWidthColorAlpha:new Float32Array(a*3)}}if(e._dirtyCount>0){let{attributeArrays:a}=n,c=a.positionHigh,u=a.positionLow,f=a.pickColor,d=a.showSizeColorAlpha,p=a.outlineWidthColorAlpha,{_dirtyOffset:g,_dirtyCount:m}=e;for(let y=g,A=g+m;y<A;y++)e.get(y,tE),tE._dirty&&(r&&(tE.getPosition(mve),Sn.fromCartesian(mve,fee),h.pack(fee.high,c,y*3),h.pack(fee.low,u,y*3)),tE.getMaterial(Um),z.fromRgba(tE._pickId,Nk),f[y*4]=z.floatToByte(Nk.red),f[y*4+1]=z.floatToByte(Nk.green),f[y*4+2]=z.floatToByte(Nk.blue),f[y*4+3]=z.floatToByte(Nk.alpha),d[y*4]=tE.show?1:0,d[y*4+1]=Um.size,d[y*4+2]=cn.encodeRGB8(Um.color),d[y*4+3]=Um.color.alpha,p[y*3]=Um.outlineWidth,p[y*3+1]=cn.encodeRGB8(Um.outlineWidth>0?Um.outlineColor:Um.color),p[y*3+2]=Um.outlineWidth>0?Um.outlineColor.alpha:Um.color.alpha,tE._dirty=!1)}if(l(n.vertexArray)){if(e._dirtyCount>0){for(let a in o)if(Object.hasOwn(o,a)){let c=a;n.vertexArray.copyAttributeFromRange(o[c],n.attributeArrays[c],e._dirtyOffset,e._dirtyCount)}}}else{let{attributeArrays:a}=n;n.vertexArray=new zn({context:i,attributes:[...r?[{index:uee.positionHigh,componentDatatype:Y.FLOAT,componentsPerAttribute:3,vertexBuffer:tt.createVertexBuffer({typedArray:a.positionHigh,context:i,usage:Me.STATIC_DRAW})},{index:uee.positionLow,componentDatatype:Y.FLOAT,componentsPerAttribute:3,vertexBuffer:tt.createVertexBuffer({typedArray:a.positionLow,context:i,usage:Me.STATIC_DRAW})}]:[{index:hve.position,componentDatatype:e._positionDatatype,componentsPerAttribute:3,normalize:e._positionNormalized,vertexBuffer:tt.createVertexBuffer({typedArray:e._positionView,context:i,usage:Me.STATIC_DRAW})}],{index:o.pickColor,componentDatatype:Y.UNSIGNED_BYTE,componentsPerAttribute:4,vertexBuffer:tt.createVertexBuffer({typedArray:a.pickColor,context:i,usage:Me.STATIC_DRAW})},{index:o.showSizeColorAlpha,componentDatatype:Y.FLOAT,componentsPerAttribute:4,vertexBuffer:tt.createVertexBuffer({typedArray:a.showSizeColorAlpha,context:i,usage:Me.STATIC_DRAW})},{index:o.outlineWidthColorAlpha,componentDatatype:Y.FLOAT,componentsPerAttribute:3,vertexBuffer:tt.createVertexBuffer({typedArray:a.outlineWidthColorAlpha,context:i,usage:Me.STATIC_DRAW})}]})}l(n.renderState)||(n.renderState=Ge.fromCache({blending:e._blendOption===Li.OPAQUE?tn.DISABLED:tn.ALPHA_BLEND,depthTest:{enabled:!0}})),l(n.shaderProgram)||(n.shaderProgram=Qt.fromCache({context:i,vertexShaderSource:new Ye({sources:[VO],defines:r?["USE_FLOAT64"]:[]}),fragmentShaderSource:new Ye({sources:[zO]}),attributeLocations:o})),l(n.command)||(n.command=new at({vertexArray:n.vertexArray,renderState:n.renderState,shaderProgram:n.shaderProgram,primitiveType:Oe.POINTS,pass:e._blendOption===Li.OPAQUE?Ie.OPAQUE:Ie.TRANSLUCENT,pickId:e._allowPicking?"v_pickColor":void 0,owner:e,count:e.primitiveCount,modelMatrix:e.modelMatrix,boundingVolume:e.boundingVolume,debugShowBoundingVolume:e.debugShowBoundingVolume}));let s=n.command;return s.count!==e.primitiveCount&&(s.count=e.primitiveCount),s.debugShowBoundingVolume!==e.debugShowBoundingVolume&&(s.debugShowBoundingVolume=e.debugShowBoundingVolume),t.commandList.push(s),e._makeClean(),n}function pgt(){let e=this;l(e.vertexArray)&&e.vertexArray.destroy(),l(e.shaderProgram)&&e.shaderProgram.destroy(),l(e.renderState)&&Ge.removeFromCache(e.renderState)}var Lk=mgt;var dee=class e extends ra{constructor(t=H.EMPTY_OBJECT){super({...t,vertexCountMax:t.primitiveCountMax})}_getCollectionClass(){return e}_getPrimitiveClass(){return kc}_getMaterialClass(){return km}_cloneEmpty(t=H.EMPTY_OBJECT){return new e(this._cloneEmptyBaseArgs(t))}add(t,n=new kc){return super.add(t,n),n._setUint32(kc.Layout.POSITION_OFFSET_U32,this._positionCount++),n.setPosition(t.position??h.ZERO),n}update(t){super.update(t);let n=t.passes;this.show&&(n.render||n.pick)&&(this._renderContext=Lk(this,t,this._renderContext))}},ef=dee;var nE={positionHigh:0,positionLow:1,prevPositionHigh:2,prevPositionLow:3,nextPositionHigh:4,nextPositionLow:5,pickColor:6,showColorWidthAndTexCoord:7,alpha:8},wG={position:0,prevPosition:1,nextPosition:2,pickColor:3,showColorWidthAndTexCoord:4,alpha:5},gl=new xa,Fk=new jf,Bk=new z,pve=new h,gve=new h,_ve=new h,hee=new Sn,mee=new Sn,pee=new Sn;function ggt(e,t,n){let i=t.context;n=n||{destroy:Agt};let r=e._positionDatatype===Y.DOUBLE,o=r?nE:wG;if(!l(n.attributeArrays)||!l(n.indexArray)){let c=e.vertexCountMax-e.primitiveCount,u=e.vertexCountMax*2;n.indexArray=je.createTypedArray(u,c*6),n.attributeArrays={...r?{positionHigh:new Float32Array(u*3),positionLow:new Float32Array(u*3),prevPositionHigh:new Float32Array(u*3),prevPositionLow:new Float32Array(u*3),nextPositionHigh:new Float32Array(u*3),nextPositionLow:new Float32Array(u*3)}:{position:Y.createTypedArray(e._positionDatatype,u*3),prevPosition:Y.createTypedArray(e._positionDatatype,u*3),nextPosition:Y.createTypedArray(e._positionDatatype,u*3)},pickColor:new Uint8Array(u*4),showColorWidthAndTexCoord:new Float32Array(u*4),alpha:new Uint8Array(u)}}if(e._dirtyCount>0){let{_dirtyOffset:c,_dirtyCount:u}=e,f=e.widthUnits==="meters",d=n.indexArray,{pickColor:p,showColorWidthAndTexCoord:g,alpha:m,position:y,prevPosition:A,nextPosition:b,positionHigh:x,positionLow:T,prevPositionHigh:E,prevPositionLow:v,nextPositionHigh:S,nextPositionLow:I}=n.attributeArrays;for(let R=c,O=c+u;R<O;R++){if(e.get(R,gl),!gl._dirty)continue;gl.getMaterial(Fk);let L=cn.encodeRGB8(Fk.color),_=Fk.color.alpha,C=f?-Fk.width:Fk.width;z.fromRgba(gl._pickId,Bk);let w=gl.show,P=gl.vertexOffset*2,M=(gl.vertexOffset-R)*6,F=e._positionView,V=gl.vertexOffset*3;for(let B=0,j=gl.vertexCount;B<j;B++){let k=B===0,G=B===j-1,q=F[V+B*3],Q=F[V+B*3+1],W=F[V+B*3+2],J,Z,ae,Ae,fe,xe;k?(Ae=F[V+3],fe=F[V+3+1],xe=F[V+3+2],J=2*q-Ae,Z=2*Q-fe,ae=2*W-xe):G?(J=F[V+(B-1)*3],Z=F[V+(B-1)*3+1],ae=F[V+(B-1)*3+2],Ae=2*q-J,fe=2*Q-Z,xe=2*W-ae):(J=F[V+(B-1)*3],Z=F[V+(B-1)*3+1],ae=F[V+(B-1)*3+2],Ae=F[V+(B+1)*3],fe=F[V+(B+1)*3+1],xe=F[V+(B+1)*3+2]),G||(d[M]=P,d[M+1]=P+1,d[M+2]=P+2,d[M+3]=P+2,d[M+4]=P+1,d[M+5]=P+3,M+=6),r&&(h.fromElements(q,Q,W,pve),h.fromElements(J,Z,ae,gve),h.fromElements(Ae,fe,xe,_ve),Sn.fromCartesian(pve,hee),Sn.fromCartesian(gve,mee),Sn.fromCartesian(_ve,pee));for(let ge=0;ge<2;ge++)r?(h.pack(hee.high,x,P*3),h.pack(hee.low,T,P*3),h.pack(mee.high,E,P*3),h.pack(mee.low,v,P*3),h.pack(pee.high,S,P*3),h.pack(pee.low,I,P*3)):(y[P*3]=q,y[P*3+1]=Q,y[P*3+2]=W,A[P*3]=J,A[P*3+1]=Z,A[P*3+2]=ae,b[P*3]=Ae,b[P*3+1]=fe,b[P*3+2]=xe),p[P*4]=z.floatToByte(Bk.red),p[P*4+1]=z.floatToByte(Bk.green),p[P*4+2]=z.floatToByte(Bk.blue),p[P*4+3]=z.floatToByte(Bk.alpha),g[P*4]=w?1:0,g[P*4+1]=L,g[P*4+2]=C,g[P*4+3]=B/(j-1),m[P]=_*255,P++}gl._dirty=!1}}if(l(n.vertexArray)){if(e._dirtyCount>0){let{indexOffset:c,indexCount:u,vertexOffset:f,vertexCount:d}=ygt(e);n.vertexArray.copyIndexFromRange(n.indexArray,c,u);for(let p in o)if(Object.hasOwn(o,p)){let g=p;n.vertexArray.copyAttributeFromRange(o[g],n.attributeArrays[g],f,d)}}}else{let c=n.attributeArrays;n.vertexArray=new zn({context:i,indexBuffer:tt.createIndexBuffer({context:i,typedArray:n.indexArray,usage:Me.STATIC_DRAW,indexDatatype:je.fromTypedArray(n.indexArray)}),attributes:[...r?[{index:nE.positionHigh,componentDatatype:Y.FLOAT,componentsPerAttribute:3,vertexBuffer:tt.createVertexBuffer({typedArray:c.positionHigh,context:i,usage:Me.STATIC_DRAW})},{index:nE.positionLow,componentDatatype:Y.FLOAT,componentsPerAttribute:3,vertexBuffer:tt.createVertexBuffer({typedArray:c.positionLow,context:i,usage:Me.STATIC_DRAW})},{index:nE.prevPositionHigh,componentDatatype:Y.FLOAT,componentsPerAttribute:3,vertexBuffer:tt.createVertexBuffer({typedArray:c.prevPositionHigh,context:i,usage:Me.STATIC_DRAW})},{index:nE.prevPositionLow,componentDatatype:Y.FLOAT,componentsPerAttribute:3,vertexBuffer:tt.createVertexBuffer({typedArray:c.prevPositionLow,context:i,usage:Me.STATIC_DRAW})},{index:nE.nextPositionHigh,componentDatatype:Y.FLOAT,componentsPerAttribute:3,vertexBuffer:tt.createVertexBuffer({typedArray:c.nextPositionHigh,context:i,usage:Me.STATIC_DRAW})},{index:nE.nextPositionLow,componentDatatype:Y.FLOAT,componentsPerAttribute:3,vertexBuffer:tt.createVertexBuffer({typedArray:c.nextPositionLow,context:i,usage:Me.STATIC_DRAW})}]:[{index:wG.position,componentDatatype:e._positionDatatype,componentsPerAttribute:3,normalize:e._positionNormalized,vertexBuffer:tt.createVertexBuffer({typedArray:c.position,context:i,usage:Me.STATIC_DRAW})},{index:wG.prevPosition,componentDatatype:e._positionDatatype,componentsPerAttribute:3,normalize:e._positionNormalized,vertexBuffer:tt.createVertexBuffer({typedArray:c.prevPosition,context:i,usage:Me.STATIC_DRAW})},{index:wG.nextPosition,componentDatatype:e._positionDatatype,componentsPerAttribute:3,normalize:e._positionNormalized,vertexBuffer:tt.createVertexBuffer({typedArray:c.nextPosition,context:i,usage:Me.STATIC_DRAW})}],{index:o.pickColor,componentDatatype:Y.UNSIGNED_BYTE,componentsPerAttribute:4,vertexBuffer:tt.createVertexBuffer({typedArray:c.pickColor,context:i,usage:Me.STATIC_DRAW})},{index:o.showColorWidthAndTexCoord,componentDatatype:Y.FLOAT,componentsPerAttribute:4,vertexBuffer:tt.createVertexBuffer({typedArray:c.showColorWidthAndTexCoord,context:i,usage:Me.STATIC_DRAW})},{index:o.alpha,componentDatatype:Y.UNSIGNED_BYTE,componentsPerAttribute:1,vertexBuffer:tt.createVertexBuffer({typedArray:c.alpha,context:i,usage:Me.STATIC_DRAW})}]})}l(n.renderState)||(n.renderState=Ge.fromCache({blending:e._blendOption===Li.OPAQUE?tn.DISABLED:tn.ALPHA_BLEND,depthTest:{enabled:!0}})),l(n.shaderProgram)||(n.shaderProgram=Qt.fromCache({context:i,vertexShaderSource:new Ye({sources:[Wl,WO],defines:r?["USE_FLOAT64"]:[]}),fragmentShaderSource:new Ye({sources:[GO]}),attributeLocations:o}));let s=_gt(e);l(n.command)||(n.command=new at({vertexArray:n.vertexArray,renderState:n.renderState,shaderProgram:n.shaderProgram,primitiveType:Oe.TRIANGLES,pass:e._blendOption===Li.OPAQUE?Ie.OPAQUE:Ie.TRANSLUCENT,pickId:e._allowPicking?"v_pickColor":void 0,owner:e,count:s,modelMatrix:e.modelMatrix,boundingVolume:e.boundingVolume,debugShowBoundingVolume:e.debugShowBoundingVolume}));let a=n.command;return a.count!==s&&(a.count=s),a.debugShowBoundingVolume!==e.debugShowBoundingVolume&&(a.debugShowBoundingVolume=e.debugShowBoundingVolume),t.commandList.push(a),e._makeClean(),n}function _gt(e){return(e.vertexCount-e.primitiveCount)*6}function ygt(e){let{_dirtyOffset:t,_dirtyCount:n}=e;e.get(t,gl);let i=gl.vertexOffset*2,o=(gl.vertexOffset-t)*6;e.get(t+n-1,gl);let s=(gl.vertexOffset+gl.vertexCount)*2-i,c=(s/2-n)*6;return{indexOffset:o,indexCount:c,vertexOffset:i,vertexCount:s}}function Agt(){let e=this;l(e.vertexArray)&&e.vertexArray.destroy(),l(e.shaderProgram)&&e.shaderProgram.destroy(),l(e.renderState)&&Ge.removeFromCache(e.renderState)}var kk=ggt;var gee=class e extends ra{constructor(t=H.EMPTY_OBJECT){super(t);let n=t.widthUnits??"pixels";this._widthUnits=n}get widthUnits(){return this._widthUnits}_getCollectionClass(){return e}_getPrimitiveClass(){return xa}_getMaterialClass(){return jf}_cloneEmpty(t=H.EMPTY_OBJECT){return new e({widthUnits:this._widthUnits,...this._cloneEmptyBaseArgs(t)})}add(t,n=new xa){super.add(t,n);let i=this._positionCount;return n._setUint32(xa.Layout.POSITION_OFFSET_U32,i),n._setUint32(xa.Layout.POSITION_COUNT_U32,0),l(t.positions)&&n.setPositions(t.positions),n}update(t){super.update(t),this._isRendered(t)&&(this._renderContext=kk(this,t,this._renderContext))}},_l=gee;function Gw(e,t){this._conditionsExpression=Je(e,!0),this._conditions=e.conditions,this._runtimeConditions=void 0,xgt(this,t)}Object.defineProperties(Gw.prototype,{conditionsExpression:{get:function(){return this._conditionsExpression}}});function bgt(e,t){this.condition=e,this.expression=t}function xgt(e,t){let n=[],i=e._conditions;if(!l(i))return;let r=i.length;for(let o=0;o<r;++o){let s=i[o],a=String(s[0]),c=String(s[1]);n.push(new bgt(new ih(a,t),new ih(c,t)))}e._runtimeConditions=n}Gw.prototype.evaluate=function(e,t){let n=this._runtimeConditions;if(!l(n))return;let i=n.length;for(let r=0;r<i;++r){let o=n[r];if(o.condition.evaluate(e))return o.expression.evaluate(e,t)}};Gw.prototype.evaluateColor=function(e,t){let n=this._runtimeConditions;if(!l(n))return;let i=n.length;for(let r=0;r<i;++r){let o=n[r];if(o.condition.evaluate(e))return o.expression.evaluateColor(e,t)}};Gw.prototype.getShaderFunction=function(e,t,n,i){let r=this._runtimeConditions;if(!l(r)||r.length===0)return;let o="",s=r.length;for(let a=0;a<s;++a){let c=r[a],u=c.condition.getShaderExpression(t,n),f=c.expression.getShaderExpression(t,n);o+=` ${a===0?"if":"else if"} (${u}) { return ${f}; } @@ -9956,20 +9956,20 @@ void main() { ${o} return ${i}(1.0); } -`,o};uw.prototype.getVariables=function(){let e=[],t=this._runtimeConditions;if(!l(t)||t.length===0)return e;let n=t.length;for(let i=0;i<n;++i){let r=t[i];Zn(e,r.condition.getVariables()),Zn(e,r.expression.getVariables())}return e=e.filter(function(i,r,o){return o.indexOf(i)===r}),e};var G2=uw;function LA(e){this._style={},this._ready=!1,this._show=void 0,this._color=void 0,this._pointSize=void 0,this._pointOutlineColor=void 0,this._pointOutlineWidth=void 0,this._labelColor=void 0,this._labelOutlineColor=void 0,this._labelOutlineWidth=void 0,this._font=void 0,this._labelStyle=void 0,this._labelText=void 0,this._backgroundColor=void 0,this._backgroundPadding=void 0,this._backgroundEnabled=void 0,this._scaleByDistance=void 0,this._translucencyByDistance=void 0,this._distanceDisplayCondition=void 0,this._heightOffset=void 0,this._anchorLineEnabled=void 0,this._anchorLineColor=void 0,this._image=void 0,this._disableDepthTestDistance=void 0,this._horizontalOrigin=void 0,this._verticalOrigin=void 0,this._labelHorizontalOrigin=void 0,this._labelVerticalOrigin=void 0,this._meta=void 0,this._lineWidth=void 0,this._colorShaderFunction=void 0,this._showShaderFunction=void 0,this._pointSizeShaderFunction=void 0,this._colorShaderFunctionReady=!1,this._showShaderFunctionReady=!1,this._pointSizeShaderFunctionReady=!1,this._colorShaderTranslucent=!1,Odt(this,e)}function Odt(e,t){t=Je(t,!0)??e._style,e._style=t,e.show=t.show,e.color=t.color,e.pointSize=t.pointSize,e.pointOutlineColor=t.pointOutlineColor,e.pointOutlineWidth=t.pointOutlineWidth,e.labelColor=t.labelColor,e.labelOutlineColor=t.labelOutlineColor,e.labelOutlineWidth=t.labelOutlineWidth,e.labelStyle=t.labelStyle,e.font=t.font,e.labelText=t.labelText,e.backgroundColor=t.backgroundColor,e.backgroundPadding=t.backgroundPadding,e.backgroundEnabled=t.backgroundEnabled,e.scaleByDistance=t.scaleByDistance,e.translucencyByDistance=t.translucencyByDistance,e.distanceDisplayCondition=t.distanceDisplayCondition,e.heightOffset=t.heightOffset,e.anchorLineEnabled=t.anchorLineEnabled,e.anchorLineColor=t.anchorLineColor,e.image=t.image,e.disableDepthTestDistance=t.disableDepthTestDistance,e.horizontalOrigin=t.horizontalOrigin,e.verticalOrigin=t.verticalOrigin,e.labelHorizontalOrigin=t.labelHorizontalOrigin,e.labelVerticalOrigin=t.labelVerticalOrigin,e.lineWidth=t.lineWidth;let n={};if(l(t.meta)){let i=t.defines,r=t.meta??H.EMPTY_OBJECT;for(let o in r)r.hasOwnProperty(o)&&(n[o]=new Bd(r[o],i))}e._meta=n,e._ready=!0}function bo(e,t){let n=(e._style??H.EMPTY_OBJECT).defines;if(l(t)){if(typeof t=="boolean"||typeof t=="number")return new Bd(String(t));if(typeof t=="string")return new Bd(t,n);if(l(t.conditions))return new G2(t,n)}else return;return t}function xo(e){if(l(e)){if(l(e.expression))return e.expression;if(l(e.conditionsExpression))return Je(e.conditionsExpression,!0)}else return;return e}Object.defineProperties(LA.prototype,{style:{get:function(){return this._style}},show:{get:function(){return this._show},set:function(e){this._show=bo(this,e),this._style.show=xo(this._show),this._showShaderFunctionReady=!1}},color:{get:function(){return this._color},set:function(e){this._color=bo(this,e),this._style.color=xo(this._color),this._colorShaderFunctionReady=!1}},pointSize:{get:function(){return this._pointSize},set:function(e){this._pointSize=bo(this,e),this._style.pointSize=xo(this._pointSize),this._pointSizeShaderFunctionReady=!1}},pointOutlineColor:{get:function(){return this._pointOutlineColor},set:function(e){this._pointOutlineColor=bo(this,e),this._style.pointOutlineColor=xo(this._pointOutlineColor)}},pointOutlineWidth:{get:function(){return this._pointOutlineWidth},set:function(e){this._pointOutlineWidth=bo(this,e),this._style.pointOutlineWidth=xo(this._pointOutlineWidth)}},labelColor:{get:function(){return this._labelColor},set:function(e){this._labelColor=bo(this,e),this._style.labelColor=xo(this._labelColor)}},labelOutlineColor:{get:function(){return this._labelOutlineColor},set:function(e){this._labelOutlineColor=bo(this,e),this._style.labelOutlineColor=xo(this._labelOutlineColor)}},labelOutlineWidth:{get:function(){return this._labelOutlineWidth},set:function(e){this._labelOutlineWidth=bo(this,e),this._style.labelOutlineWidth=xo(this._labelOutlineWidth)}},font:{get:function(){return this._font},set:function(e){this._font=bo(this,e),this._style.font=xo(this._font)}},labelStyle:{get:function(){return this._labelStyle},set:function(e){this._labelStyle=bo(this,e),this._style.labelStyle=xo(this._labelStyle)}},labelText:{get:function(){return this._labelText},set:function(e){this._labelText=bo(this,e),this._style.labelText=xo(this._labelText)}},backgroundColor:{get:function(){return this._backgroundColor},set:function(e){this._backgroundColor=bo(this,e),this._style.backgroundColor=xo(this._backgroundColor)}},backgroundPadding:{get:function(){return this._backgroundPadding},set:function(e){this._backgroundPadding=bo(this,e),this._style.backgroundPadding=xo(this._backgroundPadding)}},backgroundEnabled:{get:function(){return this._backgroundEnabled},set:function(e){this._backgroundEnabled=bo(this,e),this._style.backgroundEnabled=xo(this._backgroundEnabled)}},scaleByDistance:{get:function(){return this._scaleByDistance},set:function(e){this._scaleByDistance=bo(this,e),this._style.scaleByDistance=xo(this._scaleByDistance)}},translucencyByDistance:{get:function(){return this._translucencyByDistance},set:function(e){this._translucencyByDistance=bo(this,e),this._style.translucencyByDistance=xo(this._translucencyByDistance)}},distanceDisplayCondition:{get:function(){return this._distanceDisplayCondition},set:function(e){this._distanceDisplayCondition=bo(this,e),this._style.distanceDisplayCondition=xo(this._distanceDisplayCondition)}},heightOffset:{get:function(){return this._heightOffset},set:function(e){this._heightOffset=bo(this,e),this._style.heightOffset=xo(this._heightOffset)}},anchorLineEnabled:{get:function(){return this._anchorLineEnabled},set:function(e){this._anchorLineEnabled=bo(this,e),this._style.anchorLineEnabled=xo(this._anchorLineEnabled)}},anchorLineColor:{get:function(){return this._anchorLineColor},set:function(e){this._anchorLineColor=bo(this,e),this._style.anchorLineColor=xo(this._anchorLineColor)}},image:{get:function(){return this._image},set:function(e){this._image=bo(this,e),this._style.image=xo(this._image)}},disableDepthTestDistance:{get:function(){return this._disableDepthTestDistance},set:function(e){this._disableDepthTestDistance=bo(this,e),this._style.disableDepthTestDistance=xo(this._disableDepthTestDistance)}},horizontalOrigin:{get:function(){return this._horizontalOrigin},set:function(e){this._horizontalOrigin=bo(this,e),this._style.horizontalOrigin=xo(this._horizontalOrigin)}},verticalOrigin:{get:function(){return this._verticalOrigin},set:function(e){this._verticalOrigin=bo(this,e),this._style.verticalOrigin=xo(this._verticalOrigin)}},labelHorizontalOrigin:{get:function(){return this._labelHorizontalOrigin},set:function(e){this._labelHorizontalOrigin=bo(this,e),this._style.labelHorizontalOrigin=xo(this._labelHorizontalOrigin)}},labelVerticalOrigin:{get:function(){return this._labelVerticalOrigin},set:function(e){this._labelVerticalOrigin=bo(this,e),this._style.labelVerticalOrigin=xo(this._labelVerticalOrigin)}},lineWidth:{get:function(){return this._lineWidth},set:function(e){this._lineWidth=bo(this,e),this._style.lineWidth=xo(this._lineWidth)}},meta:{get:function(){return this._meta},set:function(e){this._meta=e}}});LA.fromUrl=function(e){return De.createIfNeeded(e).fetchJson(e).then(function(n){return new LA(n)})};LA.prototype.getColorShaderFunction=function(e,t,n){return this._colorShaderFunctionReady?(n.translucent=this._colorShaderTranslucent,this._colorShaderFunction):(this._colorShaderFunctionReady=!0,l(this.color)&&l(this.color.getShaderFunction)?this._colorShaderFunction=this.color.getShaderFunction(e,t,n,"vec4"):this._colorShaderFunction=void 0,this._colorShaderTranslucent=n.translucent,this._colorShaderFunction)};LA.prototype.getShowShaderFunction=function(e,t,n){return this._showShaderFunctionReady?this._showShaderFunction:(this._showShaderFunctionReady=!0,l(this.show)&&l(this.show.getShaderFunction)?this._showShaderFunction=this.show.getShaderFunction(e,t,n,"bool"):this._showShaderFunction=void 0,this._showShaderFunction)};LA.prototype.getPointSizeShaderFunction=function(e,t,n){return this._pointSizeShaderFunctionReady?this._pointSizeShaderFunction:(this._pointSizeShaderFunctionReady=!0,l(this.pointSize)&&l(this.pointSize.getShaderFunction)?this._pointSizeShaderFunction=this.pointSize.getShaderFunction(e,t,n,"float"):this._pointSizeShaderFunction=void 0,this._pointSizeShaderFunction)};LA.prototype.getVariables=function(){let e=[];return l(this.color)&&l(this.color.getVariables)&&Zn(e,this.color.getVariables()),l(this.show)&&l(this.show.getVariables)&&Zn(e,this.show.getVariables()),l(this.pointSize)&&l(this.pointSize.getVariables)&&Zn(e,this.pointSize.getVariables()),e=e.filter(function(t,n,i){return i.indexOf(t)===n}),e};var u_=LA;var yTe=new ie,gTe=new ie,TQ=new ie,ZH=new Map;ZH.set(ml,{packCollectionData:Es.packPolylineCollectionData,packTilePrimitives:Es.packPolylineSegments});ZH.set(za,{packCollectionData:Es.packPolygonCollectionData,packTilePrimitives:Es.packPolygonRings});var EQ=class{constructor(t){this._tilingScheme=t.tilingScheme,this.antialias=t.antialias??!0,this.minimumTileScreenPixels=t.minimumTileScreenPixels??256,this._heightReferenceByCollection=new Map,this._collectionDataCache=new WeakMap,this._markedThisFrame=new Set,this._markedFrameNumber=-1,this._dirtyRectangles=[]}get tilingScheme(){return this._tilingScheme}set tilingScheme(t){this._tilingScheme=t}get ellipsoid(){return this._tilingScheme.ellipsoid}remove(t){this._markedThisFrame.delete(t),this._heightReferenceByCollection.delete(t)&&this._markCollectionRegionDirty(t)}has(t){return this._heightReferenceByCollection.has(t)}static isSupported(t){return ZH.has(t.constructor)}markForFrame(t,n,i){this._beginFrame(n),this._markedThisFrame.add(t),this._heightReferenceByCollection.has(t)||this._markCollectionRegionDirty(t),this._heightReferenceByCollection.set(t,i)}_beginFrame(t){if(t!==this._markedFrameNumber){for(let n of this._heightReferenceByCollection.keys())this._markedThisFrame.has(n)||(this._heightReferenceByCollection.delete(n),this._markCollectionRegionDirty(n));this._markedThisFrame.clear(),this._markedFrameNumber=t}}_markCollectionRegionDirty(t){let n=ie.fromBoundingSphere(t.boundingVolume,this._tilingScheme.ellipsoid,new ie);this._dirtyRectangles.push(n)}requestTileData(t,n,i,r,o){let s=this._tilingScheme.tileXYToRectangle(t,n,i,yTe);return this.requestDataForRectangle(s,r,o)}requestDataForRectangle(t,n,i){let r=this._tilingScheme,o=this._heightReferenceByCollection,s={show:!0,hasPolylines:!1,hasPolygons:!1,rectangle:ie.clone(t),collectionVersions:new Map,minimumTileScreenPixels:this.minimumTileScreenPixels,metersPerUv:Mdt(t,r.ellipsoid)};for(let[u,f]of o){if(!_Te(f,i))continue;let d=ie.fromBoundingSphere(u.boundingVolume,r.ellipsoid,gTe);if(!!!ie.intersection(t,d,TQ))continue;let g=ZH.get(u.constructor),m=this._getCollectionDataCached(u,g.packCollectionData);s.collectionVersions.set(u,m.version),g.packTilePrimitives(u,m,t,s)}let a=l(s.polylineSegments)&&s.polylineSegments.length>0,c=l(s.polygonRings)&&s.polygonRings.length>0;return s.hasPolylines=a,s.hasPolygons=c,!a&&!c?(s.show=!1,s):(a&&(Es.packPolylineGrid(s),Es.packPolylineTextures(n,s)),c&&(Es.packPolygonGrid(s),Es.packPolygonTextures(n,s)),Es.packPrimitiveTextures(n,s),s)}releaseTileData(t){Es.freeResources(t)}updateTileData(t,n,i,r,o,s){let a=this._dirtyRectangles,c=this._tilingScheme;return Ndt(t,n,i,a,c)?(this.releaseTileData(o),this.requestTileData(t,n,i,r,s)):o}updateDataForRectangle(t,n,i,r){return this._isStale(i,t,r)?(this.releaseTileData(i),this.requestDataForRectangle(t,n,r)):i}_isStale(t,n,i){if(!ie.equals(t.rectangle,n))return!0;let r=t.collectionVersions,o=this._heightReferenceByCollection,s=0;for(let[a,c]of o){if(!_Te(c,i))continue;let u=ie.fromBoundingSphere(a.boundingVolume,this._tilingScheme.ellipsoid,gTe),f=!!ie.intersection(n,u,TQ),d=r.get(a);if(!f){if(l(d))return!0;continue}if(!l(d)||(s++,a._dirtyCount>0||d!==a._version))return!0}return s!==r.size}makeClean(){this._dirtyRectangles.length=0}update(t){l(t)&&this._beginFrame(t);for(let n of this._heightReferenceByCollection.keys()){let i=this._collectionDataCache.get(n);!l(i)||!(n._dirtyCount>0||i.version!==n._version)||(l(i.rectangle)&&this._dirtyRectangles.push(ie.clone(i.rectangle)),this._markCollectionRegionDirty(n))}}_getCollectionDataCached(t,n){let i=this._collectionDataCache.get(t),r=t._dirtyCount>0,o=i?.version!==t._version;if(l(i)&&!r&&!o)return i;let s=this.ellipsoid,a=n(t,s,i);return a.version=t._version+(r?1:0),a.rectangle=ie.fromBoundingSphere(t.boundingVolume,s,a.rectangle),this._collectionDataCache.set(t,a),t._makeClean(),a}};function _Te(e,t){return e===We.CLAMP_TO_GROUND||e===t}function Mdt(e,t){let n=t.maximumRadius,i=(e.south+e.north)*.5;return new U(e.width*n*Math.cos(i),e.height*n)}function Ndt(e,t,n,i,r){if(i.length===0)return!1;let o=r.tileXYToRectangle(e,t,n,yTe);for(let s=0;s<i.length;s++)if(ie.intersection(o,i[s],TQ))return!0;return!1}var f_=EQ;var ATe=new kc,bTe=new Aa,xTe=new Mo,Ldt=new wm,Fdt=new Ff,Bdt=new Lf,CQ=class{constructor(t,n,i=0){ut(this,"_color",new z);ut(this,"_outlineColor",new z);this._content=t,this._batchId=n,this._batchTableId=i,this._primitivesByCollection=new Map}addPrimitiveByCollection(t,n){let i=this._primitivesByCollection.get(t);i||(i=[],this._primitivesByCollection.set(t,i)),i.push(n)}get show(){for(let t of this._iteratePrimitives())if(t.show)return!0;return!1}set show(t){for(let n of this._iteratePrimitives())n.show=t}get color(){for(let t of this._iterateMaterials())return z.clone(t.color,this._color);return z.clone(z.WHITE,this._color)}set color(t){for(let n of this._iterateMaterials())z.clone(t,n.color)}get pointSize(){for(let t of this._iteratePointMaterials())return t.size;return 1}set pointSize(t){for(let n of this._iteratePointMaterials())n.size=t}get pointOutlineColor(){for(let t of this._iteratePointMaterials())return z.clone(t.outlineColor,this._outlineColor);return z.clone(z.WHITE,this._outlineColor)}set pointOutlineColor(t){for(let n of this._iteratePointMaterials())z.clone(t,n.outlineColor)}get pointOutlineWidth(){for(let t of this._iteratePointMaterials())return t.outlineWidth;return 0}set pointOutlineWidth(t){for(let n of this._iteratePointMaterials())n.outlineWidth=t}get lineWidth(){for(let t of this._iteratePolylineMaterials())return t.width;return 1}set lineWidth(t){for(let n of this._iteratePolylineMaterials())n.width=t}get lineOutlineColor(){for(let t of this._iteratePolylineMaterials())return z.clone(t.outlineColor,this._outlineColor);return z.clone(z.WHITE,this._outlineColor)}set lineOutlineColor(t){for(let n of this._iteratePolylineMaterials())z.clone(t,n.outlineColor)}get lineOutlineWidth(){for(let t of this._iteratePolylineMaterials())return t.outlineWidth;return 0}set lineOutlineWidth(t){for(let n of this._iteratePolylineMaterials())n.outlineWidth=t}get polygonOutlineColor(){for(let t of this._iteratePolygonMaterials())return z.clone(t.outlineColor,this._outlineColor);return z.clone(z.WHITE,this._outlineColor)}set polygonOutlineColor(t){for(let n of this._iteratePolygonMaterials())z.clone(t,n.outlineColor)}get polygonOutlineWidth(){for(let t of this._iteratePolygonMaterials())return t.outlineWidth;return 0}set polygonOutlineWidth(t){for(let n of this._iteratePolygonMaterials())n.outlineWidth=t}get content(){return this._content}get tileset(){return this._content.tileset}get primitive(){return this._content.tileset}get featureId(){return this._batchId}get _batchTable(){return this._content.batchTables[this._batchTableId]}get pickIds(){let t=[];for(let n of this._iteratePrimitives())t.push(n._pickId);return t}hasProperty(t){return l(this._batchTable)?this._batchTable.hasProperty(this._batchId,t):!1}getPropertyIds(t){return l(this._batchTable)?this._batchTable.getPropertyIds(this._batchId,t):[]}getProperty(t){if(l(this._batchTable))return this._batchTable.getProperty(this._batchId,t)}getPropertyInherited(t){return na.getPropertyInherited(this._content,this._batchId,t,this._batchTable)}setProperty(t,n){throw new pe("Not implemented")}isExactClass(t){return l(this._batchTable)?this._batchTable.isExactClass(this._batchId,t):!1}isClass(t){return l(this._batchTable)?this._batchTable.isClass(this._batchId,t):!1}getExactClassName(){if(l(this._batchTable))return this._batchTable.getExactClassName(this._batchId)}*_iteratePrimitives(){yield*this._iteratePrimitivesWith($u,ATe),yield*this._iteratePrimitivesWith(ml,bTe),yield*this._iteratePrimitivesWith(za,xTe)}*_iteratePrimitivesWith(t,n){let i=this._content._collections;for(let r=0;r<i.length;r++){let o=i[r],s=this._primitivesByCollection.get(r);if(s&&o instanceof t)for(let a of s)o.get(a,n),yield n}}*_iterateMaterials(){yield*this._iteratePointMaterials(),yield*this._iteratePolylineMaterials(),yield*this._iteratePolygonMaterials()}*_iteratePointMaterials(){yield*this._iterateMaterialsWith($u,ATe,Ldt)}*_iteratePolylineMaterials(){yield*this._iterateMaterialsWith(ml,bTe,Fdt)}*_iteratePolygonMaterials(){yield*this._iterateMaterialsWith(za,xTe,Bdt)}*_iterateMaterialsWith(t,n,i){for(let r of this._iteratePrimitivesWith(t,n))r.getMaterial(i),yield i,r.setMaterial(i)}},kT=CQ;var TTe=new h,kdt=new kc,Udt=new Aa,CTe=new Mo;function zdt(e,t){let n=t.scene.nodes,i={collections:[],collectionLocalMatrices:[],collectionFeatureTableIds:new Map,featuresByTableId:new Map};for(let r=0;r<n.length;r++)vTe(e,n[r],N.IDENTITY,i);return i}function QH(e){let t=e.BYTES_PER_ELEMENT*8;return Math.pow(2,t)-1}function Vdt(e){let t={pointPrimitiveCount:0,pointVertexCount:0,polylinePrimitiveCount:0,polylineVertexCount:0,polygonPrimitiveCount:0,polygonVertexCount:0,polygonHoleCount:0,polygonTriangleCount:0},n=e.vector,i=e.polygon,r=e.primitiveType,s=xt.getAttributeBySemantic(e,ct.POSITION).count,a=e.indices?ba.readIndicesAsTypedArray(e.indices):void 0;if(r===Oe.POINTS)t.pointPrimitiveCount+=s,t.pointVertexCount+=s;else if(r===Oe.LINE_STRIP){let c=n?n.count:ETe(a);t.polylinePrimitiveCount+=c,t.polylineVertexCount+=a.length-c+1}else if(r===Oe.TRIANGLES||r===Oe.LINE_LOOP)if(n){t.polygonPrimitiveCount+=n.count,t.polygonVertexCount+=s,t.polygonTriangleCount+=a.length/3;let c=n.polygonHoleCounts;if(c)for(let u=0;u<c.length;u++)t.polygonHoleCount+=c[u]}else{let c=ETe(i.loopIndices);t.polygonPrimitiveCount+=i.count,t.polygonVertexCount+=i.loopIndices.length-c+1,t.polygonTriangleCount+=i.triangleIndices.length,t.polygonHoleCount+=c-i.count}else throw new oe(`Unexpected primitive type: ${r}`);return t}function ETe(e){let t=QH(e),n=0;for(let i=0;i<e.length;i++)e[i]===t&&i+1<e.length&&n++;return n+1}function jdt(e,t,n,i,r){let o=xt.getAttributeBySemantic(t,ct.POSITION),s=o.typedArray??(n.positionNormalized?ba.readAttributeAsRawCompactTypedArray(o):ba.readAttributeAsTypedArray(o)),a=t.indices?ba.readIndicesAsTypedArray(t.indices):void 0,c=Hdt(e,t,r);n instanceof $u?Gdt(n,i,s,a,c):n instanceof ml?Wdt(n,i,s,a,c):n instanceof za&&(l(t.vector)?qdt(n,i,s,a,c,t.vector):Ydt(n,i,s,c,t.polygon))}function Hdt(e,t,n){let i=e.tileset.featureIdLabel,r=xt.getFeatureIdsByLabel(t.featureIds,i);if(!(r instanceof Cn.FeatureIdAttribute))return()=>{};let o=xt.getAttributeBySemantic(t,ct.FEATURE_ID,r.setIndex),s=o.typedArray??ba.readAttributeAsTypedArray(o);for(let a=0;a<s.length;a++){let c=s[a];if(!n.has(c)){let u=new kT(e,c,r.propertyTableId);n.set(c,u)}}return function(c){let u=s[c];if(u!==r.nullFeatureId)return n.get(u)}}function Gdt(e,t,n,i,r){let o=n.length/3;for(let s=0,a=i?i.length:o;s<a;s++){let c=i?i[s]:s;h.fromArray(n,c*3,TTe);let u=r(c);u&&u.addPrimitiveByCollection(t,s),e.add({position:TTe,pickObject:u,featureId:u?.featureId},kdt)}}function Wdt(e,t,n,i,r){let o=QH(i),s=0,a=0,c=0;for(let u=0;u<i.length;u++){if(i[u]===o?a=u-s:u+1===i.length&&(a=u+1-s),a===0)continue;let d=s+a,p=i.subarray(s,d),g=STe(n,p,3),m=r(i[s]);m&&m.addPrimitiveByCollection(t,c),e.add({positions:g,pickObject:m,featureId:m?.featureId},Udt),s=u+1,a=0,c++}}function qdt(e,t,n,i,r,o){let s=o.polygonAttributeOffsets,a=o.polygonIndicesOffsets,c=o.polygonHoleCounts,u=o.polygonHoleOffsets,f=n.length/3,d=s.length;for(let p=0;p<d;p++){let g=s[p],m=p+1<d?s[p+1]:f,y=n.subarray(g*3,m*3),A;if(l(c)&&c[p]>0){let v=c[p];A=u.slice(p,p+v);for(let S=0;S<v;S++)A[S]-=g}let b=a[p],x=p+1<d?a[p+1]:i.length,T=i.slice(b,x);for(let v=0;v<T.length;v++)T[v]-=g;let E=r(g);E&&E.addPrimitiveByCollection(t,p),e.add({positions:y,triangles:T,holes:A,pickObject:E,featureId:E?.featureId},CTe)}}function Ydt(e,t,n,i,r){let o=r.loopIndices.constructor,s=new o(r.loopIndices.length),a=QH(r.loopIndices);for(let c=0;c<r.count;c++){let u=c+1===r.count,f=r.loopIndicesOffsets[c],d=u?r.loopIndices.length:r.loopIndicesOffsets[c+1],p=r.loopIndices.subarray(f,d),g=STe(n,p,3,s),m=[];for(let x=0;x<p.length;x++){let T=x+1===p.length;p[x]===a&&!T&&m.push(x)}let y=new o(m),A;if(l(r.triangleIndices)){let x=r.triangleIndicesOffsets[c],T=u?r.triangleIndices.length:r.triangleIndicesOffsets[c+1];A=r.triangleIndices.subarray(x,T);for(let E=0;E<A.length;E++)A[E]=s[A[E]]}else throw new Error("Runtime triangulation not yet supported.");let b=i(p[0]);b&&b.addPrimitiveByCollection(t,c),e.add({positions:g,triangles:A,holes:y,pickObject:b,featureId:b?.featureId},CTe)}}function vTe(e,t,n,i){let r=xt.getNodeTransform(t),o=N.multiplyTransformation(n,r,new N),s=t.primitives;for(let c=0;c<s.length;c++){let u=s[c],f=u.primitiveType,d,p=Vdt(u),g=xt.getAttributeBySemantic(u,ct.POSITION),m=g.normalized??!1,y=g.componentDatatype;f===Oe.POINTS?d=new $u({primitiveCountMax:p.pointPrimitiveCount,allowPicking:!0,positionNormalized:m,positionDatatype:y}):f===Oe.LINE_STRIP?d=new ml({primitiveCountMax:p.polylinePrimitiveCount,vertexCountMax:p.polylineVertexCount,allowPicking:!0,positionNormalized:m,positionDatatype:y}):(f===Oe.TRIANGLES||f===Oe.LINE_LOOP)&&(d=new za({primitiveCountMax:p.polygonPrimitiveCount,vertexCountMax:p.polygonVertexCount,holeCountMax:p.polygonHoleCount,triangleCountMax:p.polygonTriangleCount,allowPicking:!0,positionNormalized:m,positionDatatype:y}));let b=u.featureIds?.[0]?.propertyTableId;i.featuresByTableId.has(b)||i.featuresByTableId.set(b,new Map),i.collections.push(d),i.collectionLocalMatrices.push(N.clone(o)),i.collectionFeatureTableIds.set(d,b),jdt(e,u,d,i.collections.length-1,i.featuresByTableId.get(b))}let a=t.children;for(let c=0;c<a.length;c++)vTe(e,a[c],o,i)}function STe(e,t,n,i){let r=QH(t),o=0;for(let u=0;u<t.length;u++)t[u]!==r&&o++;let s=e.constructor,a=new s(o*n),c=0;for(let u=0;u<t.length;u++){let f=t[u];if(i&&(i[f]=f===r?r:c),f!==r){for(let d=0;d<n;d++)a[c*n+d]=e[f*n+d];c++}}return a}var W2=zdt;var eG=new kc,tG=new Aa,nG=new Mo,q2=new wm,vQ=new Ff,wTe=new Lf,ITe=new N,SQ=class e{constructor(t,n,i){this._tileset=t,this._tile=n,this._resource=i,this._model=void 0,this._collections=[],this._collectionLocalMatrices=[],this._collectionFeatureTableIds=new Map,this._featuresByTableId=new Map,this._metadata=void 0,this._group=void 0,this.featurePropertiesDirty=!1,this._ready=!1,this._modelMatrix=N.clone(N.IDENTITY)}get featuresLength(){return this.batchTables.reduce((t,n)=>t+n.featuresLength,0)}get pointsLength(){return this._collections.filter(t=>t instanceof $u).reduce((t,n)=>t+n.primitiveCount,0)}get trianglesLength(){return this._collections.reduce((t,n)=>n instanceof za?t+n.triangleCount:n instanceof ml?t+(n.vertexCount-n.primitiveCount)*2:t,0)}get geometryByteLength(){return this._collections.reduce((t,n)=>t+n.byteLength,0)}get texturesByteLength(){return 0}get batchTableByteLength(){return this.batchTables.reduce((t,n)=>t+n.batchTableByteLength,0)}get innerContents(){}get ready(){return this._ready}get tileset(){return this._tileset}get tile(){return this._tile}get url(){return this._resource.getUrlComponent(!0)}get batchTables(){return this._model._featureTables}get batchTable(){throw new pe("Deprecated: Use `content.batchTables`.")}get metadata(){return this._metadata}set metadata(t){this._metadata=t}get group(){return this._group}set group(t){this._group=t}getFeature(t,n){return this._featuresByTableId.get(n)?.get(t)}hasProperty(t,n,i){let r=this.getFeature(t,i);return r?r.hasProperty(n):!1}applyDebugSettings(t,n){let i=t?`color("${n.toCssHexString()}", 1.0)`:'color("white", 1.0)';this.applyStyle(new u_({color:i}))}applyStyle(t){let n=o=>o instanceof $u,i=o=>o instanceof ml,r=o=>o instanceof za;for(let o of this._collections.filter(n)){let s=this._collectionFeatureTableIds.get(o);for(let a=0,c=o.primitiveCount;a<c;a++){o.get(a,eG);let u=this.getFeature(eG.featureId,s);l(t.show)&&(eG.show=t.show.evaluate(u)),l(t.color)&&t.color.evaluate(u,q2.color),l(t.pointSize)&&(q2.size=t.pointSize.evaluate(u)),l(t.pointOutlineWidth)&&(q2.outlineWidth=t.pointOutlineWidth.evaluate(u)),l(t.pointOutlineColor)&&t.pointOutlineColor.evaluate(u,q2.outlineColor),eG.setMaterial(q2)}}for(let o of this._collections.filter(i)){let s=this._collectionFeatureTableIds.get(o);for(let a=0,c=o.primitiveCount;a<c;a++){o.get(a,tG);let u=this.getFeature(tG.featureId,s);l(t.show)&&(tG.show=t.show.evaluate(u)),l(t.color)&&t.color.evaluate(u,vQ.color),l(t.lineWidth)&&(vQ.width=t.lineWidth.evaluate(u)),tG.setMaterial(vQ)}}for(let o of this._collections.filter(r)){let s=this._collectionFeatureTableIds.get(o);for(let a=0,c=o.primitiveCount;a<c;a++){o.get(a,nG);let u=this.getFeature(nG.featureId,s);l(t.show)&&(nG.show=t.show.evaluate(u)),l(t.color)&&t.color.evaluate(u,wTe.color),nG.setMaterial(wTe)}}}update(t,n){let i=this._tileset,r=i._scene?.vectorProvider;if(l(this._model)&&!this._ready){let s=this._model;s.modelMatrix=this._tile.computedTransform,s.update(n),s.ready&&(Kdt(this),this._ready=!0)}N.multiplyTransformation(this._tile.computedTransform,this._modelMatrix,ITe);let o=l(r)&&this._tile._selectedFrame===n.frameNumber;for(let s=0;s<this._collections.length;s++){let a=this._collections[s];N.multiplyTransformation(ITe,this._collectionLocalMatrices[s],a.modelMatrix),!As(i._heightReference)||!f_.isSupported(a)?a.update(n):o&&r.markForFrame(a,n.frameNumber,i._heightReference)}}pick(t,n,i){}isDestroyed(){return!1}destroy(){let t=this._tileset._scene?.vectorProvider;this._model?.destroy(),this._model=void 0;for(let n of this._collections)t?.remove(n),n.destroy();return this._collections.length=0,le(this)}static async fromGltf(t,n,i,r){let o=new e(t,n,i),s=Xdt(t,n,o,r),a=await Hf.fromGltfAsync(s);return a.show=!1,o._model=a,o}};function Xdt(e,t,n,i){return{gltf:i,basePath:n._resource,cull:!1,releaseGltfJson:!0,opaquePass:Ie.CESIUM_3D_TILE,modelMatrix:t.computedTransform,upAxis:e._modelUpAxis,forwardAxis:e._modelForwardAxis,incrementallyLoadTextures:!1,content:n,featureIdLabel:e.featureIdLabel,instanceFeatureIdLabel:e.instanceFeatureIdLabel,projectTo2D:e._projectTo2D,enablePick:e._enablePick,enableDebugWireframe:e._enableDebugWireframe,enableShowOutline:!1}}function Kdt(e){let t=e._model.sceneGraph.components,n=xt.getAxisCorrectionMatrix(t.upAxis,t.forwardAxis,new N);N.multiplyTransformation(t.transform,n,e._modelMatrix);let i=W2(e,t);e._collections=i.collections,e._collectionLocalMatrices=i.collectionLocalMatrices,e._collectionFeatureTableIds=i.collectionFeatureTableIds,e._featuresByTableId=i.featuresByTableId}var FA=SQ;function hc(){}hc._maxSortingConcurrency=Math.max(dn.hardwareConcurrency-1,1);hc._sorterTaskProcessor=void 0;hc._taskProcessorReady=!1;hc._error=void 0;hc._getSorterTaskProcessor=function(){if(!l(hc._sorterTaskProcessor)){let e=new $n("gaussianSplatSorter",hc._maxSortingConcurrency);e.initWebAssemblyModule({wasmBinaryFile:"ThirdParty/wasm_splats_bg.wasm"}).then(function(t){t?hc._taskProcessorReady=!0:hc._error=new oe("Gaussian splat sorter could not be initialized.")}).catch(t=>{hc._error=t}),hc._sorterTaskProcessor=e}return hc._sorterTaskProcessor};hc.radixSortIndexes=function(e){let t=hc._getSorterTaskProcessor();if(l(hc._error))throw hc._error;if(hc._taskProcessorReady)return t.scheduleTask(e,[e.primitive.positions.buffer])};var UT=hc;function mc(){}mc._maxSortingConcurrency=Math.max(dn.hardwareConcurrency-1,1);mc._textureTaskProcessor=void 0;mc._taskProcessorReady=!1;mc._error=void 0;mc._getTextureTaskProcessor=function(){if(!l(mc._textureTaskProcessor)){let e=new $n("gaussianSplatTextureGenerator",mc._maxSortingConcurrency);e.initWebAssemblyModule({wasmBinaryFile:"ThirdParty/wasm_splats_bg.wasm"}).then(function(t){t?mc._taskProcessorReady=!0:mc._error=new oe("Gaussian splat sorter could not be initialized.")}).catch(t=>{mc._error=t}),mc._textureTaskProcessor=e}return mc._textureTaskProcessor};mc.generateFromAttributes=function(e){let t=mc._getTextureTaskProcessor();if(l(mc._error))throw mc._error;if(!mc._taskProcessorReady)return;let{attributes:n}=e;return t.scheduleTask(e,[n.positions.buffer,n.scales.buffer,n.rotations.buffer,n.colors.buffer])};var Y2=mc;function $dt(e){let t=new hg;this.shaderBuilder=t,this.uniformMap={},this.renderStateOptions=Ge.getState(Ge.fromCache({depthTest:{enabled:!0,func:cc.LESS_OR_EQUAL}})),this.alphaOptions=new vT,this.hasSkipLevelOfDetail=!1,e._useLogDepth&&t.addDefine("LOG_DEPTH_READ_ONLY",void 0,de.FRAGMENT)}var X2=$dt;var zT=new N,NTe=new N,K2=new N,vi=new $,$2=new Le,Jdt=new h,Zdt=new Le,Qdt=new h,eht=1e-12,iG=1e-5,wQ=1e-7,Wa={IDLE:0,WAITING:1,SORTING:2,SORTED:3,ERROR:4},Ys={BUILDING:"BUILDING",TEXTURE_PENDING:"TEXTURE_PENDING",TEXTURE_READY:"TEXTURE_READY",SORTING:"SORTING",READY:"READY"},tht=2,nht=30,iht=3,rht=.008726646259971648,oht=1;function sht(e,t){let n=e._lastSteadySortFrameNumber>=0?t.frameNumber-e._lastSteadySortFrameNumber:Number.POSITIVE_INFINITY;if(e._lastSteadySortFrameNumber>=0&&n<iht)return!1;let i=t.camera;return l(i)?!e._hasLastSteadySortCameraPosition||!e._hasLastSteadySortCameraDirection||h.distance(i.positionWC,e._lastSteadySortCameraPosition)>=oht?!0:h.angleBetween(i.directionWC,e._lastSteadySortCameraDirection)>=rht:!1}function PTe(e,t){e._lastSteadySortFrameNumber=t.frameNumber;let n=t.camera;l(n)&&(h.clone(n.positionWC,e._lastSteadySortCameraPosition),e._hasLastSteadySortCameraPosition=!0,h.clone(n.directionWC,e._lastSteadySortCameraDirection),e._hasLastSteadySortCameraDirection=!0)}function aht(e,t){let n=e._selectedTileSet;if(!l(n)||n.size!==t.length)return!0;for(let i=0;i<t.length;i++)if(!n.has(t[i]))return!0;return!1}function DTe(e,t){return l(t)&&t.requestId===e._sortRequestId&&t.dataGeneration===e._splatDataGeneration}function IQ(e){l(e)&&(l(e.gaussianSplatTexture)&&(e.gaussianSplatTexture.destroy(),e.gaussianSplatTexture=void 0),l(e.sphericalHarmonicsTexture)&&(e.sphericalHarmonicsTexture.destroy(),e.sphericalHarmonicsTexture=void 0))}function RTe(e,t,n){if(!l(t))return;e._retiredTextures.push({texture:t,frameNumber:n})}function cht(e,t){let n=e._retiredTextures;if(!l(n)||n.length===0)return;let i=[];for(let r=0;r<n.length;r++){let o=n[r];t-o.frameNumber>0?o.texture.destroy():i.push(o)}e._retiredTextures=i}function lht(e,t){let n=e?.[t];return l(n)?n.buffer:void 0}function uht(e,t,n,i){let r=e._aggregateScratchBuffers[t];l(r)||(r=[],e._aggregateScratchBuffers[t]=r);let o=lht(e._snapshot,t);for(let a=0;a<r.length;a++){let c=r[a];if(c.length>=i&&c.buffer!==o)return c}let s=Y.createTypedArray(n,i);return r.push(s),s}function fht(e,t){return e.length===t?e:e.subarray(0,t)}function dht(e,t,n){if(!l(t.indexes)||t.state!==Ys.READY)throw new pe("Committing snapshot before it is READY.");let i=n.frameNumber,r=e._snapshot,o=l(r)?r.gaussianSplatTexture:e.gaussianSplatTexture;l(o)&&o!==t.gaussianSplatTexture&&RTe(e,o,i);let s=l(r)?r.sphericalHarmonicsTexture:e.sphericalHarmonicsTexture;l(s)&&s!==t.sphericalHarmonicsTexture&&RTe(e,s,i),e._snapshot=t,e._positions=t.positions,e._rotations=t.rotations,e._scales=t.scales,e._colors=t.colors,e._shData=t.shData,e._sphericalHarmonicsDegree=t.sphericalHarmonicsDegree,e._numSplats=t.numSplats,e._indexes=t.indexes,e.gaussianSplatTexture=t.gaussianSplatTexture,e.sphericalHarmonicsTexture=t.sphericalHarmonicsTexture,e._lastTextureWidth=t.lastTextureWidth,e._lastTextureHeight=t.lastTextureHeight,e._splatRowMask=t.splatRowMask,e._splatRowShift=t.splatRowShift,e._splatBudgetSSEScale=t.splatBudgetSSEScale??1,e._hasGaussianSplatTexture=l(t.gaussianSplatTexture),e._needsGaussianSplatTexture=!1,e._gaussianSplatTexturePending=!1,e._vertexArray=void 0,e._vertexArrayLen=-1,e._drawCommand=void 0,e._sorterPromise=void 0,e._activeSort=void 0,e._sorterState=Wa.IDLE,e._dirty=!1}async function hht(e,t,n,i){try{let r=await i,o=kt.maximumTextureSize,s=o,a=Math.ceil(n.numSplats/(o/2)),c=Math.log2(o/2),u=o/2-1;if(a>o){let g=n.numSplats;a=o;let m=s/2;if(n.numSplats=o*m,n.positions=n.positions.subarray(0,n.numSplats*3),n.rotations=n.rotations.subarray(0,n.numSplats*4),n.scales=n.scales.subarray(0,n.numSplats*3),n.colors=n.colors.subarray(0,n.numSplats*4),l(n.shData)){let y=n.shData.length/g;n.shData=n.shData.subarray(0,Math.floor(n.numSplats*y))}n.splatBudgetSSEScale=g/n.numSplats,console.warn(`[GaussianSplat][HARD CAP] ${g} splats exceed the maximum texture capacity (${o}\xD7${m} = ${n.numSplats} splats at width=${s}). Rendering only the first ${n.numSplats} splats to avoid a WebGL crash. Increasing maximumScreenSpaceError by ${n.splatBudgetSSEScale.toFixed(2)}x next frame.`)}else n.splatBudgetSSEScale=1;let f=s*a*4,d;f<=r.data.length?d=r.data.subarray(0,f):(d=new Uint32Array(f),d.set(r.data));let p={width:s,height:a,data:d};if(n.splatRowMask=u,n.splatRowShift=c,e._pendingSnapshot!==n){n.state=Ys.BUILDING;return}if(!l(n.gaussianSplatTexture))n.gaussianSplatTexture=MTe(t.context,p);else if(n.lastTextureHeight!==p.height||n.lastTextureWidth!==p.width){let g=n.gaussianSplatTexture;n.gaussianSplatTexture=MTe(t.context,p),g.destroy()}else n.gaussianSplatTexture.copyFrom({source:{width:p.width,height:p.height,arrayBufferView:p.data}});if(n.lastTextureHeight=p.height,n.lastTextureWidth=p.width,l(n.shData)&&n.sphericalHarmonicsDegree>0){let g=n.sphericalHarmonicsTexture,m=kt.maximumTextureSize,y=n.shCoefficientCount/3,A=Math.floor(m/y),b=A*(y*2),x=Math.ceil(n.numSplats/A);if(x>m)console.warn(`[GaussianSplat][SHTexture] ${n.numSplats} splats require SH height ${x} > maxTex ${m}. Disabling spherical harmonics for this snapshot (color-only fallback).`),n.sphericalHarmonicsDegree=0,l(g)&&g.destroy(),n.sphericalHarmonicsTexture=void 0;else{let T=new Uint32Array(m*x*2),E=0;for(let v=0;E<n.shData.length;v+=m*2)T.set(n.shData.subarray(E,E+b),v),E+=b;n.sphericalHarmonicsTexture=pht(t.context,{data:T,width:m,height:x}),l(g)&&g.destroy()}}n.state=Ys.TEXTURE_READY}catch(r){console.error("Error generating Gaussian splat texture:",r),n.state=Ys.BUILDING}}async function mht(e,t,n,i){try{let r=await i;if(!l(n)||n.snapshot!==e._pendingSnapshot)return;let o=n.expectedCount,s=o,a=r?.length;if(o!==s||a!==o){e._pendingSortPromise=void 0,e._pendingSort=void 0,n.snapshot.state===Ys.SORTING&&(n.snapshot.state=Ys.TEXTURE_READY);return}let c=n.snapshot;c.indexes=r,c.state=Ys.READY,e._pendingSortPromise=void 0,e._pendingSort=void 0,dht(e,c,t),e._pendingSnapshot=void 0,cu.buildGSplatDrawCommand(e,t)}catch(r){if(!l(n)||n.snapshot!==e._pendingSnapshot)return;e._pendingSortPromise=void 0,e._pendingSort=void 0,n.snapshot.state===Ys.SORTING&&(n.snapshot.state=Ys.TEXTURE_READY),e._sorterState=Wa.ERROR,e._sorterError=r}}async function OTe(e,t,n){try{let i=await n,r=DTe(e,t),o=t?.expectedCount,s=o,a=i?.length;if(!r||(o!==s||a!==o)){r&&(e._sorterPromise=void 0,e._sorterState=Wa.IDLE);return}e._indexes=i,e._sorterState=Wa.SORTED}catch(i){if(!DTe(e,t))return;e._sorterState=Wa.ERROR,e._sorterError=i}}function pht(e,t){return new Dt({context:e,source:{width:t.width,height:t.height,arrayBufferView:t.data},preMultiplyAlpha:!1,skipColorSpaceConversion:!0,pixelFormat:Ke.RG_INTEGER,pixelDatatype:ze.UNSIGNED_INT,flipY:!1,sampler:jt.NEAREST})}function MTe(e,t){return new Dt({context:e,source:{width:t.width,height:t.height,arrayBufferView:t.data},preMultiplyAlpha:!1,skipColorSpaceConversion:!0,pixelFormat:Ke.RGBA_INTEGER,pixelDatatype:ze.UNSIGNED_INT,flipY:!1,sampler:jt.NEAREST})}function cu(e){e=e??H.EMPTY_OBJECT,this._positions=void 0,this._rotations=void 0,this._scales=void 0,this._colors=void 0,this._indexes=void 0,this._numSplats=0,this._needsGaussianSplatTexture=!0,this._snapshot=void 0,this._pendingSnapshot=void 0,this._retiredTextures=[],this._aggregateScratchBuffers={positions:[],scales:[],rotations:[],colors:[]},this._scratchAggregateShBuffer=void 0,this._selectedTilesStableFrames=0,this._needsSnapshotRebuild=!1,this._snapshotRebuildStallFrames=0,this._prevViewMatrix=new N,this._debugShowBoundingVolume=e.debugShowBoundingVolume??!1,this.gaussianSplatTexture=void 0,this.sphericalHarmonicsTexture=void 0,this._lastTextureWidth=0,this._lastTextureHeight=0,this._vertexArray=void 0,this._vertexArrayLen=-1,this._splitDirection=jo.NONE,this._dirty=!1,this._tileset=e.tileset,this._baseTilesetUpdate=this._tileset.update,this._tileset.update=this._wrappedUpdate.bind(this),this._tileset.tileLoad.addEventListener(this.onTileLoad,this),this._tileset.tileVisible.addEventListener(this.onTileVisible,this),this.selectedTileLength=0,this._selectedTileSet=new Set,this._ready=!1,this._hasGaussianSplatTexture=!1,this._gaussianSplatTexturePending=!1,this._drawCommand=void 0,this._drawCommandModelMatrix=new N,this._rootTransform=void 0,this._axisCorrectionMatrix=xt.getAxisCorrectionMatrix(Hi.Y,Hi.X,new N),this._shInverseRotation=new $,this._isDestroyed=!1,this._sorterState=Wa.IDLE,this._sorterPromise=void 0,this._splatDataGeneration=0,this._sortRequestId=0,this._activeSort=void 0,this._pendingSortPromise=void 0,this._pendingSort=void 0,this._lastSteadySortFrameNumber=-1,this._lastSteadySortCameraPosition=new h,this._hasLastSteadySortCameraPosition=!1,this._lastSteadySortCameraDirection=new h,this._hasLastSteadySortCameraDirection=!1,this._sorterError=void 0,this._splatRowMask=0,this._splatRowShift=0,this._splatBudgetSSEScale=1}Object.defineProperties(cu.prototype,{ready:{get:function(){return this._ready}},isStable:{get:function(){return!this._dirty&&(!l(this._pendingSnapshot)||this._pendingSnapshot.state===Ys.READY)}},splitDirection:{get:function(){return this._splitDirection},set:function(e){this._splitDirection!==e&&(this._splitDirection=e,this._dirty=!0)}}});cu.prototype._wrappedUpdate=function(e){let t=this._tileset;if(this._splatBudgetSSEScale!==1){let n=t.maximumScreenSpaceError;t.maximumScreenSpaceError*=this._splatBudgetSSEScale,this._baseTilesetUpdate.call(t,e),t.maximumScreenSpaceError=n}else this._baseTilesetUpdate.call(t,e);this.update(e)};cu.prototype.destroy=function(){if(this._positions=void 0,this._rotations=void 0,this._scales=void 0,this._colors=void 0,this._indexes=void 0,IQ(this._pendingSnapshot),IQ(this._snapshot),l(this._retiredTextures))for(let t=0;t<this._retiredTextures.length;t++)this._retiredTextures[t].texture.destroy();this._retiredTextures=[],this._pendingSnapshot=void 0,this._snapshot=void 0,this._aggregateScratchBuffers=void 0,this.gaussianSplatTexture=void 0,this.sphericalHarmonicsTexture=void 0;let e=this._drawCommand;return l(e)&&(e.shaderProgram=e.shaderProgram&&e.shaderProgram.destroy()),l(this._vertexArray)&&(this._vertexArray.destroy(),this._vertexArray=void 0),this._tileset.update=this._baseTilesetUpdate.bind(this._tileset),le(this)};cu.prototype.isDestroyed=function(){return this._isDestroyed};cu.prototype.onTileLoad=function(e){this._dirty=!0};cu.prototype.onTileVisible=function(e){};cu.transformTile=function(e){let t=e.computedTransform,n=e.content.gltfPrimitive,i=e.tileset.gaussianSplatPrimitive;i._rootTransform===void 0&&(i._rootTransform=At.eastNorthUpToFixedFrame(e.tileset.boundingSphere.center));let r=i._rootTransform,o=N.multiplyTransformation(t,i._axisCorrectionMatrix,zT);N.multiplyTransformation(o,e.content.worldTransform,o);let s=N.inverse(r,NTe),a=N.multiplyTransformation(s,o,zT),c=e.content._lastSplatTransform;if(e.content._transformed&&l(c)&&N.equalsEpsilon(a,c,eht))return;let u=e.content.positions,f=e.content.rotations,d=e.content.scales,p=Math.sqrt(a[0]*a[0]+a[1]*a[1]+a[2]*a[2]),g=Math.sqrt(a[4]*a[4]+a[5]*a[5]+a[6]*a[6]),m=Math.sqrt(a[8]*a[8]+a[9]*a[9]+a[10]*a[10]);vi[0]=a[0]/p,vi[1]=a[1]/p,vi[2]=a[2]/p,vi[3]=a[4]/g,vi[4]=a[5]/g,vi[5]=a[6]/g,vi[6]=a[8]/m,vi[7]=a[9]/m,vi[8]=a[10]/m;let y=vi[0]*vi[3]+vi[1]*vi[4]+vi[2]*vi[5],A=vi[0]*vi[6]+vi[1]*vi[7]+vi[2]*vi[8],b=vi[3]*vi[6]+vi[4]*vi[7]+vi[5]*vi[8],x=Math.abs(p-1)<=wQ&&Math.abs(g-1)<=wQ&&Math.abs(m-1)<=wQ,T=Math.abs(y)<=iG&&Math.abs(A)<=iG&&Math.abs(b)<=iG,E=vi[0]*(vi[4]*vi[8]-vi[5]*vi[7])-vi[3]*(vi[1]*vi[8]-vi[2]*vi[7])+vi[6]*(vi[1]*vi[5]-vi[2]*vi[4]),v=x&&T&&Math.abs(E-1)<=iG;Le.fromRotationMatrix(vi,$2),Le.normalize($2,$2);let S=xt.getAttributeBySemantic(n,ct.POSITION).typedArray,I=xt.getAttributeBySemantic(n,ct.ROTATION).typedArray,R=xt.getAttributeBySemantic(n,ct.SCALE).typedArray,O=Jdt,L=Zdt,_=Qdt;for(let C=0;C<S.length/3;++C)O.x=S[C*3],O.y=S[C*3+1],O.z=S[C*3+2],L.x=I[C*4],L.y=I[C*4+1],L.z=I[C*4+2],L.w=I[C*4+3],_.x=R[C*3],_.y=R[C*3+1],_.z=R[C*3+2],v?(N.multiplyByPoint(a,O,O),Le.multiply($2,L,L),Le.normalize(L,L)):(N.fromTranslationQuaternionRotationScale(O,L,_,K2),N.multiplyTransformation(a,K2,K2),N.getTranslation(K2,O),N.getScale(K2,_),Le.multiply($2,L,L),Le.normalize(L,L)),u[C*3]=O.x,u[C*3+1]=O.y,u[C*3+2]=O.z,f[C*4]=L.x,f[C*4+1]=L.y,f[C*4+2]=L.z,f[C*4+3]=L.w,d[C*3]=_.x,d[C*3+1]=_.y,d[C*3+2]=_.z;e.content._lastSplatTransform=N.clone(a,e.content._lastSplatTransform),e.content._transformed=!0};cu.generateSplatTexture=function(e,t,n){if(!l(n)||n.state!==Ys.BUILDING)return;n.state=Ys.TEXTURE_PENDING;let i=Y2.generateFromAttributes({attributes:{positions:new Float32Array(n.positions),scales:new Float32Array(n.scales),rotations:new Float32Array(n.rotations),colors:new Uint8Array(n.colors)},count:n.numSplats});if(!l(i)){n.state=Ys.BUILDING;return}hht(e,t,n,i)};cu.buildGSplatDrawCommand=function(e,t){let n=e._tileset,i=new X2(e),{shaderBuilder:r}=i,o=i.renderStateOptions;o.cull.enabled=!1,o.depthMask=!1,o.depthTest.enabled=!0,o.blending=tn.PRE_MULTIPLIED_ALPHA_BLEND,i.alphaOptions.pass=Ie.GAUSSIAN_SPLATS,r.addAttribute("vec2","a_screenQuadPosition"),r.addAttribute("float","a_splatIndex"),r.addVarying("vec4","v_splatColor"),r.addVarying("vec2","v_vertPos"),r.addUniform("float","u_splitDirection",de.VERTEX),r.addVarying("float","v_splitDirection"),r.addUniform("highp usampler2D","u_splatAttributeTexture",de.VERTEX),r.addUniform("float","u_sphericalHarmonicsDegree",de.VERTEX),r.addUniform("float","u_splatScale",de.VERTEX),r.addUniform("vec3","u_cameraPositionWC",de.VERTEX),r.addUniform("mat3","u_inverseModelRotation",de.VERTEX);let s=i.uniformMap;r.addUniform("int","u_splatRowMask",de.VERTEX),r.addUniform("int","u_splatRowShift",de.VERTEX);let a=e.gaussianSplatTexture;s.u_splatAttributeTexture=function(){return a},s.u_splatRowMask=function(){return e._splatRowMask},s.u_splatRowShift=function(){return e._splatRowShift},e._sphericalHarmonicsDegree>0&&(r.addDefine("HAS_SPHERICAL_HARMONICS","1",de.VERTEX),r.addUniform("highp usampler2D","u_sphericalHarmonicsTexture",de.VERTEX),s.u_sphericalHarmonicsTexture=function(){return e.sphericalHarmonicsTexture}),s.u_sphericalHarmonicsDegree=function(){return e._sphericalHarmonicsDegree},s.u_cameraPositionWC=function(){return h.clone(t.camera.positionWC)},s.u_inverseModelRotation=function(){return e._shInverseRotation},s.u_splitDirection=function(){return e.splitDirection};let c=l(e._indexes)?e._indexes.length:e._numSplats;i.instanceCount=c,i.count=4,i.primitiveType=Oe.TRIANGLE_STRIP,r.addVertexLines(pM),r.addFragmentLines(mM);let u=r.buildShaderProgram(t.context),f=Je(Ge.fromCache(i.renderStateOptions),!0);f.cull.face=xt.getCullFace(n.modelMatrix,Oe.TRIANGLE_STRIP),f=Ge.fromCache(f);let d={screenQuadPosition:0,splatIndex:2},p=new Cn.Attribute;if(p.name="_SPLAT_INDEXES",p.typedArray=e._indexes,p.componentDatatype=Y.UNSIGNED_INT,p.type=Vt.SCALAR,p.normalized=!1,p.count=i.instanceCount,p.constant=0,p.instanceDivisor=1,!l(e._vertexArray)||e._indexes.length>e._vertexArrayLen){let b=new St({attributes:{screenQuadPosition:new Ne({componentDatatype:Y.FLOAT,componentsPerAttribute:2,values:[-1,-1,1,-1,1,1,-1,1],name:"_SCREEN_QUAD_POS",variableName:"screenQuadPosition"}),splatIndex:{...p,variableName:"splatIndex"}},primitiveType:Oe.TRIANGLE_STRIP});e._vertexArray=zn.fromGeometry({context:t.context,geometry:b,attributeLocations:d,bufferUsage:Me.DYNAMIC_DRAW,interleave:!1})}else e._vertexArray.getAttribute(1).vertexBuffer.copyFromArrayView(e._indexes);e._vertexArrayLen=e._indexes.length;let m=N.clone(e._rootTransform,e._drawCommandModelMatrix),y=e._vertexArray,A=new at({boundingVolume:n.boundingSphere,modelMatrix:m,uniformMap:s,renderState:f,vertexArray:y,shaderProgram:u,cull:o.cull.enabled,pass:Ie.GAUSSIAN_SPLATS,count:i.count,owner:e,instanceCount:i.instanceCount,primitiveType:Oe.TRIANGLE_STRIP,debugShowBoundingVolume:n.debugShowBoundingVolume,castShadows:!1,receiveShadows:!1});e._drawCommand=A};cu.prototype.update=function(e){let t=this._tileset;if(cht(this,e.frameNumber),!t.show)return;if(this._drawCommand&&e.commandList.push(this._drawCommand),t._modelMatrixChanged){this._dirty=!0;return}let n=l(this._rootTransform);if(e.passes.pick===!0)return;this.splitDirection!==t.splitDirection&&(this.splitDirection=t.splitDirection);let i=e.camera;if(l(i)){if(this._sorterState===Wa.IDLE){let r=t._selectedTiles.length!==0&&aht(this,t._selectedTiles);t._selectedTiles.length===0?(this._selectedTilesStableFrames=0,this._needsSnapshotRebuild=!1,this._snapshotRebuildStallFrames=0):r?this._selectedTilesStableFrames=0:this._selectedTilesStableFrames++,(r||this._dirty)&&(this._needsSnapshotRebuild=!0);let o=this._selectedTilesStableFrames>=tht,s=!l(this._snapshot)&&!l(this._pendingSnapshot)&&!l(this._drawCommand);this._needsSnapshotRebuild&&t._selectedTiles.length!==0?this._snapshotRebuildStallFrames++:this._snapshotRebuildStallFrames=0;let a=o||s||this._snapshotRebuildStallFrames>=nht;if(!(this._dirty||this._needsSnapshotRebuild||r||l(this._pendingSnapshot)||l(this._pendingSortPromise)||!l(this._drawCommand))&&N.equals(i.viewMatrix,this._prevViewMatrix))return;if(t._selectedTiles.length!==0&&this._needsSnapshotRebuild&&a){this._splatDataGeneration++,this._activeSort=void 0,this._sorterPromise=void 0,this._sorterState=Wa.IDLE,this._pendingSortPromise=void 0,this._pendingSort=void 0,l(this._pendingSnapshot)&&IQ(this._pendingSnapshot);let u=t._selectedTiles;this._rootTransform=At.eastNorthUpToFixedFrame(t.boundingSphere.center);{let E=u[0],v=N.multiplyTransformation(E.computedTransform,this._axisCorrectionMatrix,NTe);N.multiplyTransformation(v,E.content.worldTransform??N.IDENTITY,v),N.getRotation(N.inverse(v,v),this._shInverseRotation)}for(let E of u)cu.transformTile(E);let f=u.reduce((E,v)=>E+v.content.pointsLength,0),d=(E,v,S,I)=>{let R,O=0,L=0;for(let _ of u){let C=S(_.content),w=l(I)?I:Vt.getNumberOfComponents(C.type),P=l(C.typedArray)?C.typedArray:C;L+=P.length,l(R)||(R=uht(this,E,v,f*w))}if(!l(R))return Y.createTypedArray(v,0);for(let _ of u){let C=_.content,w=S(C),P=l(w.typedArray)?w.typedArray:w;R.set(P,O),O+=P.length}return fht(R,L)},p=()=>{let E=0;for(let R of u)if(R.content.sphericalHarmonicsDegree>0){switch(R.content.sphericalHarmonicsDegree){case 1:E=9;break;case 2:E=24;break;case 3:E=45;break}break}if(E===0)return;let v=f*(E*(2/3));(!l(this._scratchAggregateShBuffer)||this._scratchAggregateShBuffer.length<v)&&(this._scratchAggregateShBuffer=new Uint32Array(v));let S=this._scratchAggregateShBuffer,I=0;for(let R of u){let O=R.content.packedSphericalHarmonicsData;R.content.sphericalHarmonicsDegree>0&&(S.set(O,I),I+=O.length)}return I<S.length?S.subarray(0,I):S},g=d("positions",Y.FLOAT,E=>E.positions,3),m=d("scales",Y.FLOAT,E=>E.scales,3),y=d("rotations",Y.FLOAT,E=>E.rotations,4),A=d("colors",Y.UNSIGNED_BYTE,E=>xt.getAttributeBySemantic(E.gltfPrimitive,ct.COLOR)),b=u[0].content.sphericalHarmonicsDegree,x=b>0?u[0].content.sphericalHarmonicsCoefficientCount:0,T=p();this._pendingSnapshot={generation:this._splatDataGeneration,positions:g,rotations:y,scales:m,colors:A,shData:T,sphericalHarmonicsDegree:b,shCoefficientCount:x,numSplats:f,indexes:void 0,gaussianSplatTexture:void 0,sphericalHarmonicsTexture:void 0,lastTextureWidth:0,lastTextureHeight:0,splatRowMask:0,splatRowShift:0,state:Ys.BUILDING},this.selectedTileLength=t._selectedTiles.length,this._selectedTileSet=new Set(t._selectedTiles),this._dirty=!1,this._needsSnapshotRebuild=!1,this._snapshotRebuildStallFrames=0}if(l(this._pendingSnapshot)){let u=this._pendingSnapshot;if(u.state===Ys.BUILDING){cu.generateSplatTexture(this,e,u);return}if(u.state===Ys.TEXTURE_PENDING||u.state===Ys.TEXTURE_READY&&!l(u.gaussianSplatTexture)||!n)return;if(N.clone(i.viewMatrix,this._prevViewMatrix),N.multiply(i.viewMatrix,this._rootTransform,zT),u.state===Ys.TEXTURE_READY&&!l(this._pendingSortPromise)){let f=++this._sortRequestId,d=this._splatDataGeneration;this._pendingSort={requestId:f,dataGeneration:d,expectedCount:u.numSplats,snapshot:u};let p=UT.radixSortIndexes({primitive:{positions:new Float32Array(u.positions),modelView:Float32Array.from(zT),count:u.numSplats},sortType:"Index"});if(!l(p)){this._pendingSortPromise=void 0,this._pendingSort=void 0,u.state=Ys.TEXTURE_READY;return}this._pendingSortPromise=p,u.state=Ys.SORTING;let g=this._pendingSort;mht(this,e,g,p);return}if(!l(this._pendingSortPromise)){u.state===Ys.SORTING&&(u.state=Ys.TEXTURE_READY);return}return}if(this._numSplats===0||!n)return;if(N.clone(i.viewMatrix,this._prevViewMatrix),N.multiply(i.viewMatrix,this._rootTransform,zT),!l(this._sorterPromise)){if(!sht(this,e))return;let u=++this._sortRequestId,f=this._splatDataGeneration,d=this._numSplats;this._activeSort={requestId:u,dataGeneration:f,expectedCount:d};let p=UT.radixSortIndexes({primitive:{positions:new Float32Array(this._positions),modelView:Float32Array.from(zT),count:this._numSplats},sortType:"Index"});if(this._sorterPromise=p,l(p)){PTe(this,e);let g=this._activeSort;this._sorterState=Wa.SORTING,OTe(this,g,p);return}}if(!l(this._sorterPromise)){this._sorterState=Wa.WAITING;return}this._sorterState=Wa.SORTING;return}else if(this._sorterState===Wa.WAITING){if(!l(this._sorterPromise)){let r=++this._sortRequestId,o=this._splatDataGeneration,s=this._numSplats;this._activeSort={requestId:r,dataGeneration:o,expectedCount:s};let a=UT.radixSortIndexes({primitive:{positions:new Float32Array(this._positions),modelView:Float32Array.from(zT),count:this._numSplats},sortType:"Index"});if(this._sorterPromise=a,l(a)){PTe(this,e);let c=this._activeSort;this._sorterState=Wa.SORTING,OTe(this,c,a);return}}if(!l(this._sorterPromise)){this._sorterState=Wa.WAITING;return}this._sorterState=Wa.SORTING;return}else{if(this._sorterState===Wa.SORTING)return;if(this._sorterState===Wa.SORTED)cu.buildGSplatDrawCommand(this,e),this._sorterState=Wa.IDLE,this._dirty=!1,this._sorterPromise=void 0,this._activeSort=void 0;else if(this._sorterState===Wa.ERROR)throw this._sorterError}this._dirty=!1}};var J2=cu;var DQ=class e{constructor(t,n,i,r){this._tileset=n,this._tile=i,this._resource=r,this._loader=t,l(this._tileset.gaussianSplatPrimitive)||(this._tileset.gaussianSplatPrimitive=new J2({tileset:this._tileset})),this._positions=void 0,this._rotations=void 0,this._scales=void 0,this.gltfPrimitive=void 0,this.worldTransform=void 0,this.featurePropertiesDirty=!1,this._metadata=void 0,this._group=void 0,this._ready=!1,this._transformed=!1,this._sphericalHarmonicsDegree=0,this._sphericalHarmonicsCoefficientCount=0,this._packedSphericalHarmonicsData=void 0,this._lastSplatTransform=void 0}static tilesetRequiresGaussianSplattingExt(t){let n=!1;return t.isGltfExtensionRequired instanceof Function&&(n=t.isGltfExtensionRequired("KHR_gaussian_splatting")&&t.isGltfExtensionRequired("KHR_gaussian_splatting_compression_spz_2"),t.isGltfExtensionRequired("KHR_spz_gaussian_splats_compression")&&qr("KHR_spz_gaussian_splats_compression",`Support for the original KHR_spz_gaussian_splats_compression extension has been removed in favor of the up to date KHR_gaussian_splatting and KHR_gaussian_splatting_compression_spz_2 extensions +`,o};Gw.prototype.getVariables=function(){let e=[],t=this._runtimeConditions;if(!l(t)||t.length===0)return e;let n=t.length;for(let i=0;i<n;++i){let r=t[i];Zn(e,r.condition.getVariables()),Zn(e,r.expression.getVariables())}return e=e.filter(function(i,r,o){return o.indexOf(i)===r}),e};var Uk=Gw;function jA(e){this._style={},this._ready=!1,this._show=void 0,this._color=void 0,this._pointSize=void 0,this._pointOutlineColor=void 0,this._pointOutlineWidth=void 0,this._labelColor=void 0,this._labelOutlineColor=void 0,this._labelOutlineWidth=void 0,this._font=void 0,this._labelStyle=void 0,this._labelText=void 0,this._backgroundColor=void 0,this._backgroundPadding=void 0,this._backgroundEnabled=void 0,this._scaleByDistance=void 0,this._translucencyByDistance=void 0,this._distanceDisplayCondition=void 0,this._heightOffset=void 0,this._anchorLineEnabled=void 0,this._anchorLineColor=void 0,this._image=void 0,this._disableDepthTestDistance=void 0,this._horizontalOrigin=void 0,this._verticalOrigin=void 0,this._labelHorizontalOrigin=void 0,this._labelVerticalOrigin=void 0,this._meta=void 0,this._lineWidth=void 0,this._colorShaderFunction=void 0,this._showShaderFunction=void 0,this._pointSizeShaderFunction=void 0,this._colorShaderFunctionReady=!1,this._showShaderFunctionReady=!1,this._pointSizeShaderFunctionReady=!1,this._colorShaderTranslucent=!1,Tgt(this,e)}function Tgt(e,t){t=Je(t,!0)??e._style,e._style=t,e.show=t.show,e.color=t.color,e.pointSize=t.pointSize,e.pointOutlineColor=t.pointOutlineColor,e.pointOutlineWidth=t.pointOutlineWidth,e.labelColor=t.labelColor,e.labelOutlineColor=t.labelOutlineColor,e.labelOutlineWidth=t.labelOutlineWidth,e.labelStyle=t.labelStyle,e.font=t.font,e.labelText=t.labelText,e.backgroundColor=t.backgroundColor,e.backgroundPadding=t.backgroundPadding,e.backgroundEnabled=t.backgroundEnabled,e.scaleByDistance=t.scaleByDistance,e.translucencyByDistance=t.translucencyByDistance,e.distanceDisplayCondition=t.distanceDisplayCondition,e.heightOffset=t.heightOffset,e.anchorLineEnabled=t.anchorLineEnabled,e.anchorLineColor=t.anchorLineColor,e.image=t.image,e.disableDepthTestDistance=t.disableDepthTestDistance,e.horizontalOrigin=t.horizontalOrigin,e.verticalOrigin=t.verticalOrigin,e.labelHorizontalOrigin=t.labelHorizontalOrigin,e.labelVerticalOrigin=t.labelVerticalOrigin,e.lineWidth=t.lineWidth;let n={};if(l(t.meta)){let i=t.defines,r=t.meta??H.EMPTY_OBJECT;for(let o in r)r.hasOwnProperty(o)&&(n[o]=new ih(r[o],i))}e._meta=n,e._ready=!0}function bo(e,t){let n=(e._style??H.EMPTY_OBJECT).defines;if(l(t)){if(typeof t=="boolean"||typeof t=="number")return new ih(String(t));if(typeof t=="string")return new ih(t,n);if(l(t.conditions))return new Uk(t,n)}else return;return t}function xo(e){if(l(e)){if(l(e.expression))return e.expression;if(l(e.conditionsExpression))return Je(e.conditionsExpression,!0)}else return;return e}Object.defineProperties(jA.prototype,{style:{get:function(){return this._style}},show:{get:function(){return this._show},set:function(e){this._show=bo(this,e),this._style.show=xo(this._show),this._showShaderFunctionReady=!1}},color:{get:function(){return this._color},set:function(e){this._color=bo(this,e),this._style.color=xo(this._color),this._colorShaderFunctionReady=!1}},pointSize:{get:function(){return this._pointSize},set:function(e){this._pointSize=bo(this,e),this._style.pointSize=xo(this._pointSize),this._pointSizeShaderFunctionReady=!1}},pointOutlineColor:{get:function(){return this._pointOutlineColor},set:function(e){this._pointOutlineColor=bo(this,e),this._style.pointOutlineColor=xo(this._pointOutlineColor)}},pointOutlineWidth:{get:function(){return this._pointOutlineWidth},set:function(e){this._pointOutlineWidth=bo(this,e),this._style.pointOutlineWidth=xo(this._pointOutlineWidth)}},labelColor:{get:function(){return this._labelColor},set:function(e){this._labelColor=bo(this,e),this._style.labelColor=xo(this._labelColor)}},labelOutlineColor:{get:function(){return this._labelOutlineColor},set:function(e){this._labelOutlineColor=bo(this,e),this._style.labelOutlineColor=xo(this._labelOutlineColor)}},labelOutlineWidth:{get:function(){return this._labelOutlineWidth},set:function(e){this._labelOutlineWidth=bo(this,e),this._style.labelOutlineWidth=xo(this._labelOutlineWidth)}},font:{get:function(){return this._font},set:function(e){this._font=bo(this,e),this._style.font=xo(this._font)}},labelStyle:{get:function(){return this._labelStyle},set:function(e){this._labelStyle=bo(this,e),this._style.labelStyle=xo(this._labelStyle)}},labelText:{get:function(){return this._labelText},set:function(e){this._labelText=bo(this,e),this._style.labelText=xo(this._labelText)}},backgroundColor:{get:function(){return this._backgroundColor},set:function(e){this._backgroundColor=bo(this,e),this._style.backgroundColor=xo(this._backgroundColor)}},backgroundPadding:{get:function(){return this._backgroundPadding},set:function(e){this._backgroundPadding=bo(this,e),this._style.backgroundPadding=xo(this._backgroundPadding)}},backgroundEnabled:{get:function(){return this._backgroundEnabled},set:function(e){this._backgroundEnabled=bo(this,e),this._style.backgroundEnabled=xo(this._backgroundEnabled)}},scaleByDistance:{get:function(){return this._scaleByDistance},set:function(e){this._scaleByDistance=bo(this,e),this._style.scaleByDistance=xo(this._scaleByDistance)}},translucencyByDistance:{get:function(){return this._translucencyByDistance},set:function(e){this._translucencyByDistance=bo(this,e),this._style.translucencyByDistance=xo(this._translucencyByDistance)}},distanceDisplayCondition:{get:function(){return this._distanceDisplayCondition},set:function(e){this._distanceDisplayCondition=bo(this,e),this._style.distanceDisplayCondition=xo(this._distanceDisplayCondition)}},heightOffset:{get:function(){return this._heightOffset},set:function(e){this._heightOffset=bo(this,e),this._style.heightOffset=xo(this._heightOffset)}},anchorLineEnabled:{get:function(){return this._anchorLineEnabled},set:function(e){this._anchorLineEnabled=bo(this,e),this._style.anchorLineEnabled=xo(this._anchorLineEnabled)}},anchorLineColor:{get:function(){return this._anchorLineColor},set:function(e){this._anchorLineColor=bo(this,e),this._style.anchorLineColor=xo(this._anchorLineColor)}},image:{get:function(){return this._image},set:function(e){this._image=bo(this,e),this._style.image=xo(this._image)}},disableDepthTestDistance:{get:function(){return this._disableDepthTestDistance},set:function(e){this._disableDepthTestDistance=bo(this,e),this._style.disableDepthTestDistance=xo(this._disableDepthTestDistance)}},horizontalOrigin:{get:function(){return this._horizontalOrigin},set:function(e){this._horizontalOrigin=bo(this,e),this._style.horizontalOrigin=xo(this._horizontalOrigin)}},verticalOrigin:{get:function(){return this._verticalOrigin},set:function(e){this._verticalOrigin=bo(this,e),this._style.verticalOrigin=xo(this._verticalOrigin)}},labelHorizontalOrigin:{get:function(){return this._labelHorizontalOrigin},set:function(e){this._labelHorizontalOrigin=bo(this,e),this._style.labelHorizontalOrigin=xo(this._labelHorizontalOrigin)}},labelVerticalOrigin:{get:function(){return this._labelVerticalOrigin},set:function(e){this._labelVerticalOrigin=bo(this,e),this._style.labelVerticalOrigin=xo(this._labelVerticalOrigin)}},lineWidth:{get:function(){return this._lineWidth},set:function(e){this._lineWidth=bo(this,e),this._style.lineWidth=xo(this._lineWidth)}},meta:{get:function(){return this._meta},set:function(e){this._meta=e}}});jA.fromUrl=function(e){return De.createIfNeeded(e).fetchJson(e).then(function(n){return new jA(n)})};jA.prototype.getColorShaderFunction=function(e,t,n){return this._colorShaderFunctionReady?(n.translucent=this._colorShaderTranslucent,this._colorShaderFunction):(this._colorShaderFunctionReady=!0,l(this.color)&&l(this.color.getShaderFunction)?this._colorShaderFunction=this.color.getShaderFunction(e,t,n,"vec4"):this._colorShaderFunction=void 0,this._colorShaderTranslucent=n.translucent,this._colorShaderFunction)};jA.prototype.getShowShaderFunction=function(e,t,n){return this._showShaderFunctionReady?this._showShaderFunction:(this._showShaderFunctionReady=!0,l(this.show)&&l(this.show.getShaderFunction)?this._showShaderFunction=this.show.getShaderFunction(e,t,n,"bool"):this._showShaderFunction=void 0,this._showShaderFunction)};jA.prototype.getPointSizeShaderFunction=function(e,t,n){return this._pointSizeShaderFunctionReady?this._pointSizeShaderFunction:(this._pointSizeShaderFunctionReady=!0,l(this.pointSize)&&l(this.pointSize.getShaderFunction)?this._pointSizeShaderFunction=this.pointSize.getShaderFunction(e,t,n,"float"):this._pointSizeShaderFunction=void 0,this._pointSizeShaderFunction)};jA.prototype.getVariables=function(){let e=[];return l(this.color)&&l(this.color.getVariables)&&Zn(e,this.color.getVariables()),l(this.show)&&l(this.show.getVariables)&&Zn(e,this.show.getVariables()),l(this.pointSize)&&l(this.pointSize.getVariables)&&Zn(e,this.pointSize.getVariables()),e=e.filter(function(t,n,i){return i.indexOf(t)===n}),e};var b_=jA;var bve=new ie,yve=new ie,_ee=new ie,IG=new Map;IG.set(_l,{packCollectionData:vs.packPolylineCollectionData,packTilePrimitives:vs.packPolylineSegments});IG.set(ja,{packCollectionData:vs.packPolygonCollectionData,packTilePrimitives:vs.packPolygonRings});var yee=class{constructor(t){this._tilingScheme=t.tilingScheme,this.antialias=t.antialias??!0,this.minimumTileScreenPixels=t.minimumTileScreenPixels??256,this._heightReferenceByCollection=new Map,this._collectionDataCache=new WeakMap,this._markedThisFrame=new Set,this._markedFrameNumber=-1,this._dirtyRectangles=[]}get tilingScheme(){return this._tilingScheme}set tilingScheme(t){this._tilingScheme=t}get ellipsoid(){return this._tilingScheme.ellipsoid}remove(t){this._markedThisFrame.delete(t),this._heightReferenceByCollection.delete(t)&&this._markCollectionRegionDirty(t)}has(t){return this._heightReferenceByCollection.has(t)}static isSupported(t){return IG.has(t.constructor)}markForFrame(t,n,i){this._beginFrame(n),this._markedThisFrame.add(t),this._heightReferenceByCollection.has(t)||this._markCollectionRegionDirty(t),this._heightReferenceByCollection.set(t,i)}_beginFrame(t){if(t!==this._markedFrameNumber){for(let n of this._heightReferenceByCollection.keys())this._markedThisFrame.has(n)||(this._heightReferenceByCollection.delete(n),this._markCollectionRegionDirty(n));this._markedThisFrame.clear(),this._markedFrameNumber=t}}_markCollectionRegionDirty(t){let n=ie.fromBoundingSphere(t.boundingVolume,this._tilingScheme.ellipsoid,new ie);this._dirtyRectangles.push(n)}requestTileData(t,n,i,r,o){let s=this._tilingScheme.tileXYToRectangle(t,n,i,bve);return this.requestDataForRectangle(s,r,o)}requestDataForRectangle(t,n,i){let r=this._tilingScheme,o=this._heightReferenceByCollection,s={show:!0,hasPolylines:!1,hasPolygons:!1,rectangle:ie.clone(t),collectionVersions:new Map,minimumTileScreenPixels:this.minimumTileScreenPixels,metersPerUv:Egt(t,r.ellipsoid)};for(let[u,f]of o){if(!Ave(f,i))continue;let d=ie.fromBoundingSphere(u.boundingVolume,r.ellipsoid,yve);if(!!!ie.intersection(t,d,_ee))continue;let g=IG.get(u.constructor),m=this._getCollectionDataCached(u,g.packCollectionData);s.collectionVersions.set(u,m.version),g.packTilePrimitives(u,m,t,s)}let a=l(s.polylineSegments)&&s.polylineSegments.length>0,c=l(s.polygonRings)&&s.polygonRings.length>0;return s.hasPolylines=a,s.hasPolygons=c,!a&&!c?(s.show=!1,s):(a&&(vs.packPolylineGrid(s),vs.packPolylineTextures(n,s)),c&&(vs.packPolygonGrid(s),vs.packPolygonTextures(n,s)),vs.packPrimitiveTextures(n,s),s)}releaseTileData(t){vs.freeResources(t)}updateTileData(t,n,i,r,o,s){let a=this._dirtyRectangles,c=this._tilingScheme;return Cgt(t,n,i,a,c)?(this.releaseTileData(o),this.requestTileData(t,n,i,r,s)):o}updateDataForRectangle(t,n,i,r){return this._isStale(i,t,r)?(this.releaseTileData(i),this.requestDataForRectangle(t,n,r)):i}_isStale(t,n,i){if(!ie.equals(t.rectangle,n))return!0;let r=t.collectionVersions,o=this._heightReferenceByCollection,s=0;for(let[a,c]of o){if(!Ave(c,i))continue;let u=ie.fromBoundingSphere(a.boundingVolume,this._tilingScheme.ellipsoid,yve),f=!!ie.intersection(n,u,_ee),d=r.get(a);if(!f){if(l(d))return!0;continue}if(!l(d)||(s++,a._dirtyCount>0||d!==a._version))return!0}return s!==r.size}makeClean(){this._dirtyRectangles.length=0}update(t){l(t)&&this._beginFrame(t);for(let n of this._heightReferenceByCollection.keys()){let i=this._collectionDataCache.get(n);!l(i)||!(n._dirtyCount>0||i.version!==n._version)||(l(i.rectangle)&&this._dirtyRectangles.push(ie.clone(i.rectangle)),this._markCollectionRegionDirty(n))}}_getCollectionDataCached(t,n){let i=this._collectionDataCache.get(t),r=t._dirtyCount>0,o=i?.version!==t._version;if(l(i)&&!r&&!o)return i;let s=this.ellipsoid,a=n(t,s,i);return a.version=t._version+(r?1:0),a.rectangle=ie.fromBoundingSphere(t.boundingVolume,s,a.rectangle),this._collectionDataCache.set(t,a),t._makeClean(),a}};function Ave(e,t){return e===We.CLAMP_TO_GROUND||e===t}function Egt(e,t){let n=t.maximumRadius,i=(e.south+e.north)*.5;return new U(e.width*n*Math.cos(i),e.height*n)}function Cgt(e,t,n,i,r){if(i.length===0)return!1;let o=r.tileXYToRectangle(e,t,n,bve);for(let s=0;s<i.length;s++)if(ie.intersection(o,i[s],_ee))return!0;return!1}var x_=yee;var xve=new kc,Tve=new xa,Eve=new Mo,vgt=new km,Sgt=new jf,wgt=new Vf,Aee=class{constructor(t,n,i=0){ut(this,"_color",new z);ut(this,"_outlineColor",new z);this._content=t,this._batchId=n,this._batchTableId=i,this._primitivesByCollection=new Map}addPrimitiveByCollection(t,n){let i=this._primitivesByCollection.get(t);i||(i=[],this._primitivesByCollection.set(t,i)),i.push(n)}get show(){for(let t of this._iteratePrimitives())if(t.show)return!0;return!1}set show(t){for(let n of this._iteratePrimitives())n.show=t}get color(){for(let t of this._iterateMaterials())return z.clone(t.color,this._color);return z.clone(z.WHITE,this._color)}set color(t){for(let n of this._iterateMaterials())z.clone(t,n.color)}get pointSize(){for(let t of this._iteratePointMaterials())return t.size;return 1}set pointSize(t){for(let n of this._iteratePointMaterials())n.size=t}get pointOutlineColor(){for(let t of this._iteratePointMaterials())return z.clone(t.outlineColor,this._outlineColor);return z.clone(z.WHITE,this._outlineColor)}set pointOutlineColor(t){for(let n of this._iteratePointMaterials())z.clone(t,n.outlineColor)}get pointOutlineWidth(){for(let t of this._iteratePointMaterials())return t.outlineWidth;return 0}set pointOutlineWidth(t){for(let n of this._iteratePointMaterials())n.outlineWidth=t}get lineWidth(){for(let t of this._iteratePolylineMaterials())return t.width;return 1}set lineWidth(t){for(let n of this._iteratePolylineMaterials())n.width=t}get lineOutlineColor(){for(let t of this._iteratePolylineMaterials())return z.clone(t.outlineColor,this._outlineColor);return z.clone(z.WHITE,this._outlineColor)}set lineOutlineColor(t){for(let n of this._iteratePolylineMaterials())z.clone(t,n.outlineColor)}get lineOutlineWidth(){for(let t of this._iteratePolylineMaterials())return t.outlineWidth;return 0}set lineOutlineWidth(t){for(let n of this._iteratePolylineMaterials())n.outlineWidth=t}get polygonOutlineColor(){for(let t of this._iteratePolygonMaterials())return z.clone(t.outlineColor,this._outlineColor);return z.clone(z.WHITE,this._outlineColor)}set polygonOutlineColor(t){for(let n of this._iteratePolygonMaterials())z.clone(t,n.outlineColor)}get polygonOutlineWidth(){for(let t of this._iteratePolygonMaterials())return t.outlineWidth;return 0}set polygonOutlineWidth(t){for(let n of this._iteratePolygonMaterials())n.outlineWidth=t}get content(){return this._content}get tileset(){return this._content.tileset}get primitive(){return this._content.tileset}get featureId(){return this._batchId}get _batchTable(){return this._content.batchTables[this._batchTableId]}get pickIds(){let t=[];for(let n of this._iteratePrimitives())t.push(n._pickId);return t}hasProperty(t){return l(this._batchTable)?this._batchTable.hasProperty(this._batchId,t):!1}getPropertyIds(t){return l(this._batchTable)?this._batchTable.getPropertyIds(this._batchId,t):[]}getProperty(t){if(l(this._batchTable))return this._batchTable.getProperty(this._batchId,t)}getPropertyInherited(t){return oa.getPropertyInherited(this._content,this._batchId,t,this._batchTable)}setProperty(t,n){throw new pe("Not implemented")}isExactClass(t){return l(this._batchTable)?this._batchTable.isExactClass(this._batchId,t):!1}isClass(t){return l(this._batchTable)?this._batchTable.isClass(this._batchId,t):!1}getExactClassName(){if(l(this._batchTable))return this._batchTable.getExactClassName(this._batchId)}*_iteratePrimitives(){yield*this._iteratePrimitivesWith(ef,xve),yield*this._iteratePrimitivesWith(_l,Tve),yield*this._iteratePrimitivesWith(ja,Eve)}*_iteratePrimitivesWith(t,n){let i=this._content._collections;for(let r=0;r<i.length;r++){let o=i[r],s=this._primitivesByCollection.get(r);if(s&&o instanceof t)for(let a of s)o.get(a,n),yield n}}*_iterateMaterials(){yield*this._iteratePointMaterials(),yield*this._iteratePolylineMaterials(),yield*this._iteratePolygonMaterials()}*_iteratePointMaterials(){yield*this._iterateMaterialsWith(ef,xve,vgt)}*_iteratePolylineMaterials(){yield*this._iterateMaterialsWith(_l,Tve,Sgt)}*_iteratePolygonMaterials(){yield*this._iterateMaterialsWith(ja,Eve,wgt)}*_iterateMaterialsWith(t,n,i){for(let r of this._iteratePrimitivesWith(t,n))r.getMaterial(i),yield i,r.setMaterial(i)}},iE=Aee;var Cve=new h,Igt=new kc,Pgt=new xa,Sve=new Mo;function Dgt(e,t){let n=t.scene.nodes,i={collections:[],collectionLocalMatrices:[],collectionFeatureTableIds:new Map,featuresByTableId:new Map};for(let r=0;r<n.length;r++)wve(e,n[r],N.IDENTITY,i);return i}function PG(e){let t=e.BYTES_PER_ELEMENT*8;return Math.pow(2,t)-1}function Rgt(e){let t={pointPrimitiveCount:0,pointVertexCount:0,polylinePrimitiveCount:0,polylineVertexCount:0,polygonPrimitiveCount:0,polygonVertexCount:0,polygonHoleCount:0,polygonTriangleCount:0},n=e.vector,i=e.polygon,r=e.primitiveType,s=xt.getAttributeBySemantic(e,ct.POSITION).count,a=e.indices?Ea.readIndicesAsTypedArray(e.indices):void 0;if(r===Oe.POINTS)t.pointPrimitiveCount+=s,t.pointVertexCount+=s;else if(r===Oe.LINE_STRIP){let c=n?n.count:vve(a);t.polylinePrimitiveCount+=c,t.polylineVertexCount+=a.length-c+1}else if(r===Oe.TRIANGLES||r===Oe.LINE_LOOP)if(n){t.polygonPrimitiveCount+=n.count,t.polygonVertexCount+=s,t.polygonTriangleCount+=a.length/3;let c=n.polygonHoleCounts;if(c)for(let u=0;u<c.length;u++)t.polygonHoleCount+=c[u]}else{let c=vve(i.loopIndices);t.polygonPrimitiveCount+=i.count,t.polygonVertexCount+=i.loopIndices.length-c+1,t.polygonTriangleCount+=i.triangleIndices.length,t.polygonHoleCount+=c-i.count}else throw new oe(`Unexpected primitive type: ${r}`);return t}function vve(e){let t=PG(e),n=0;for(let i=0;i<e.length;i++)e[i]===t&&i+1<e.length&&n++;return n+1}function Ogt(e,t,n,i,r){let o=xt.getAttributeBySemantic(t,ct.POSITION),s=o.typedArray??(n.positionNormalized?Ea.readAttributeAsRawCompactTypedArray(o):Ea.readAttributeAsTypedArray(o)),a=t.indices?Ea.readIndicesAsTypedArray(t.indices):void 0,c=Mgt(e,t,r);n instanceof ef?Ngt(n,i,s,a,c):n instanceof _l?Lgt(n,i,s,a,c):n instanceof ja&&(l(t.vector)?Fgt(n,i,s,a,c,t.vector):Bgt(n,i,s,c,t.polygon))}function Mgt(e,t,n){let i=e.tileset.featureIdLabel,r=xt.getFeatureIdsByLabel(t.featureIds,i);if(!(r instanceof Cn.FeatureIdAttribute))return()=>{};let o=xt.getAttributeBySemantic(t,ct.FEATURE_ID,r.setIndex),s=o.typedArray??Ea.readAttributeAsTypedArray(o);for(let a=0;a<s.length;a++){let c=s[a];if(!n.has(c)){let u=new iE(e,c,r.propertyTableId);n.set(c,u)}}return function(c){let u=s[c];if(u!==r.nullFeatureId)return n.get(u)}}function Ngt(e,t,n,i,r){let o=n.length/3;for(let s=0,a=i?i.length:o;s<a;s++){let c=i?i[s]:s;h.fromArray(n,c*3,Cve);let u=r(c);u&&u.addPrimitiveByCollection(t,s),e.add({position:Cve,pickObject:u,featureId:u?.featureId},Igt)}}function Lgt(e,t,n,i,r){let o=PG(i),s=0,a=0,c=0;for(let u=0;u<i.length;u++){if(i[u]===o?a=u-s:u+1===i.length&&(a=u+1-s),a===0)continue;let d=s+a,p=i.subarray(s,d),g=Ive(n,p,3),m=r(i[s]);m&&m.addPrimitiveByCollection(t,c),e.add({positions:g,pickObject:m,featureId:m?.featureId},Pgt),s=u+1,a=0,c++}}function Fgt(e,t,n,i,r,o){let s=o.polygonAttributeOffsets,a=o.polygonIndicesOffsets,c=o.polygonHoleCounts,u=o.polygonHoleOffsets,f=n.length/3,d=s.length;for(let p=0;p<d;p++){let g=s[p],m=p+1<d?s[p+1]:f,y=n.subarray(g*3,m*3),A;if(l(c)&&c[p]>0){let v=c[p];A=u.slice(p,p+v);for(let S=0;S<v;S++)A[S]-=g}let b=a[p],x=p+1<d?a[p+1]:i.length,T=i.slice(b,x);for(let v=0;v<T.length;v++)T[v]-=g;let E=r(g);E&&E.addPrimitiveByCollection(t,p),e.add({positions:y,triangles:T,holes:A,pickObject:E,featureId:E?.featureId},Sve)}}function Bgt(e,t,n,i,r){let o=r.loopIndices.constructor,s=new o(r.loopIndices.length),a=PG(r.loopIndices);for(let c=0;c<r.count;c++){let u=c+1===r.count,f=r.loopIndicesOffsets[c],d=u?r.loopIndices.length:r.loopIndicesOffsets[c+1],p=r.loopIndices.subarray(f,d),g=Ive(n,p,3,s),m=[];for(let x=0;x<p.length;x++){let T=x+1===p.length;p[x]===a&&!T&&m.push(x)}let y=new o(m),A;if(l(r.triangleIndices)){let x=r.triangleIndicesOffsets[c],T=u?r.triangleIndices.length:r.triangleIndicesOffsets[c+1];A=r.triangleIndices.subarray(x,T);for(let E=0;E<A.length;E++)A[E]=s[A[E]]}else throw new Error("Runtime triangulation not yet supported.");let b=i(p[0]);b&&b.addPrimitiveByCollection(t,c),e.add({positions:g,triangles:A,holes:y,pickObject:b,featureId:b?.featureId},Sve)}}function wve(e,t,n,i){let r=xt.getNodeTransform(t),o=N.multiplyTransformation(n,r,new N),s=t.primitives;for(let c=0;c<s.length;c++){let u=s[c],f=u.primitiveType,d,p=Rgt(u),g=xt.getAttributeBySemantic(u,ct.POSITION),m=g.normalized??!1,y=g.componentDatatype;f===Oe.POINTS?d=new ef({primitiveCountMax:p.pointPrimitiveCount,allowPicking:!0,positionNormalized:m,positionDatatype:y}):f===Oe.LINE_STRIP?d=new _l({primitiveCountMax:p.polylinePrimitiveCount,vertexCountMax:p.polylineVertexCount,allowPicking:!0,positionNormalized:m,positionDatatype:y}):(f===Oe.TRIANGLES||f===Oe.LINE_LOOP)&&(d=new ja({primitiveCountMax:p.polygonPrimitiveCount,vertexCountMax:p.polygonVertexCount,holeCountMax:p.polygonHoleCount,triangleCountMax:p.polygonTriangleCount,allowPicking:!0,positionNormalized:m,positionDatatype:y}));let b=u.featureIds?.[0]?.propertyTableId;i.featuresByTableId.has(b)||i.featuresByTableId.set(b,new Map),i.collections.push(d),i.collectionLocalMatrices.push(N.clone(o)),i.collectionFeatureTableIds.set(d,b),Ogt(e,u,d,i.collections.length-1,i.featuresByTableId.get(b))}let a=t.children;for(let c=0;c<a.length;c++)wve(e,a[c],o,i)}function Ive(e,t,n,i){let r=PG(t),o=0;for(let u=0;u<t.length;u++)t[u]!==r&&o++;let s=e.constructor,a=new s(o*n),c=0;for(let u=0;u<t.length;u++){let f=t[u];if(i&&(i[f]=f===r?r:c),f!==r){for(let d=0;d<n;d++)a[c*n+d]=e[f*n+d];c++}}return a}var zk=Dgt;var DG=new kc,RG=new xa,OG=new Mo,Vk=new km,bee=new jf,Pve=new Vf,Dve=new N,xee=class e{constructor(t,n,i){this._tileset=t,this._tile=n,this._resource=i,this._model=void 0,this._collections=[],this._collectionLocalMatrices=[],this._collectionFeatureTableIds=new Map,this._featuresByTableId=new Map,this._metadata=void 0,this._group=void 0,this.featurePropertiesDirty=!1,this._ready=!1,this._modelMatrix=N.clone(N.IDENTITY)}get featuresLength(){return this.batchTables.reduce((t,n)=>t+n.featuresLength,0)}get pointsLength(){return this._collections.filter(t=>t instanceof ef).reduce((t,n)=>t+n.primitiveCount,0)}get trianglesLength(){return this._collections.reduce((t,n)=>n instanceof ja?t+n.triangleCount:n instanceof _l?t+(n.vertexCount-n.primitiveCount)*2:t,0)}get geometryByteLength(){return this._collections.reduce((t,n)=>t+n.byteLength,0)}get texturesByteLength(){return 0}get batchTableByteLength(){return this.batchTables.reduce((t,n)=>t+n.batchTableByteLength,0)}get innerContents(){}get ready(){return this._ready}get tileset(){return this._tileset}get tile(){return this._tile}get url(){return this._resource.getUrlComponent(!0)}get batchTables(){return this._model._featureTables}get batchTable(){throw new pe("Deprecated: Use `content.batchTables`.")}get metadata(){return this._metadata}set metadata(t){this._metadata=t}get group(){return this._group}set group(t){this._group=t}getFeature(t,n){return this._featuresByTableId.get(n)?.get(t)}hasProperty(t,n,i){let r=this.getFeature(t,i);return r?r.hasProperty(n):!1}applyDebugSettings(t,n){let i=t?`color("${n.toCssHexString()}", 1.0)`:'color("white", 1.0)';this.applyStyle(new b_({color:i}))}applyStyle(t){let n=o=>o instanceof ef,i=o=>o instanceof _l,r=o=>o instanceof ja;for(let o of this._collections.filter(n)){let s=this._collectionFeatureTableIds.get(o);for(let a=0,c=o.primitiveCount;a<c;a++){o.get(a,DG);let u=this.getFeature(DG.featureId,s);l(t.show)&&(DG.show=t.show.evaluate(u)),l(t.color)&&t.color.evaluate(u,Vk.color),l(t.pointSize)&&(Vk.size=t.pointSize.evaluate(u)),l(t.pointOutlineWidth)&&(Vk.outlineWidth=t.pointOutlineWidth.evaluate(u)),l(t.pointOutlineColor)&&t.pointOutlineColor.evaluate(u,Vk.outlineColor),DG.setMaterial(Vk)}}for(let o of this._collections.filter(i)){let s=this._collectionFeatureTableIds.get(o);for(let a=0,c=o.primitiveCount;a<c;a++){o.get(a,RG);let u=this.getFeature(RG.featureId,s);l(t.show)&&(RG.show=t.show.evaluate(u)),l(t.color)&&t.color.evaluate(u,bee.color),l(t.lineWidth)&&(bee.width=t.lineWidth.evaluate(u)),RG.setMaterial(bee)}}for(let o of this._collections.filter(r)){let s=this._collectionFeatureTableIds.get(o);for(let a=0,c=o.primitiveCount;a<c;a++){o.get(a,OG);let u=this.getFeature(OG.featureId,s);l(t.show)&&(OG.show=t.show.evaluate(u)),l(t.color)&&t.color.evaluate(u,Pve.color),OG.setMaterial(Pve)}}}update(t,n){let i=this._tileset,r=i._scene?.vectorProvider;if(l(this._model)&&!this._ready){let s=this._model;s.modelMatrix=this._tile.computedTransform,s.update(n),s.ready&&(Ugt(this),this._ready=!0)}N.multiplyTransformation(this._tile.computedTransform,this._modelMatrix,Dve);let o=l(r)&&this._tile._selectedFrame===n.frameNumber;for(let s=0;s<this._collections.length;s++){let a=this._collections[s];N.multiplyTransformation(Dve,this._collectionLocalMatrices[s],a.modelMatrix),!bs(i._heightReference)||!x_.isSupported(a)?a.update(n):o&&r.markForFrame(a,n.frameNumber,i._heightReference)}}pick(t,n,i){}isDestroyed(){return!1}destroy(){let t=this._tileset._scene?.vectorProvider;this._model?.destroy(),this._model=void 0;for(let n of this._collections)t?.remove(n),n.destroy();return this._collections.length=0,le(this)}static async fromGltf(t,n,i,r){let o=new e(t,n,i),s=kgt(t,n,o,r),a=await $f.fromGltfAsync(s);return a.show=!1,o._model=a,o}};function kgt(e,t,n,i){return{gltf:i,basePath:n._resource,cull:!1,releaseGltfJson:!0,opaquePass:Ie.CESIUM_3D_TILE,modelMatrix:t.computedTransform,upAxis:e._modelUpAxis,forwardAxis:e._modelForwardAxis,incrementallyLoadTextures:!1,content:n,featureIdLabel:e.featureIdLabel,instanceFeatureIdLabel:e.instanceFeatureIdLabel,projectTo2D:e._projectTo2D,enablePick:e._enablePick,enableDebugWireframe:e._enableDebugWireframe,enableShowOutline:!1}}function Ugt(e){let t=e._model.sceneGraph.components,n=xt.getAxisCorrectionMatrix(t.upAxis,t.forwardAxis,new N);N.multiplyTransformation(t.transform,n,e._modelMatrix);let i=zk(e,t);e._collections=i.collections,e._collectionLocalMatrices=i.collectionLocalMatrices,e._collectionFeatureTableIds=i.collectionFeatureTableIds,e._featuresByTableId=i.featuresByTableId}var HA=xee;function pc(){}pc._maxSortingConcurrency=Math.max(dn.hardwareConcurrency-1,1);pc._sorterTaskProcessor=void 0;pc._taskProcessorReady=!1;pc._error=void 0;pc._getSorterTaskProcessor=function(){if(!l(pc._sorterTaskProcessor)){let e=new $n("gaussianSplatSorter",pc._maxSortingConcurrency);e.initWebAssemblyModule({wasmBinaryFile:"ThirdParty/wasm_splats_bg.wasm"}).then(function(t){t?pc._taskProcessorReady=!0:pc._error=new oe("Gaussian splat sorter could not be initialized.")}).catch(t=>{pc._error=t}),pc._sorterTaskProcessor=e}return pc._sorterTaskProcessor};pc.radixSortIndexes=function(e){let t=pc._getSorterTaskProcessor();if(l(pc._error))throw pc._error;if(pc._taskProcessorReady)return t.scheduleTask(e,[e.primitive.positions.buffer])};var rE=pc;function gc(){}gc._maxSortingConcurrency=Math.max(dn.hardwareConcurrency-1,1);gc._textureTaskProcessor=void 0;gc._taskProcessorReady=!1;gc._error=void 0;gc._getTextureTaskProcessor=function(){if(!l(gc._textureTaskProcessor)){let e=new $n("gaussianSplatTextureGenerator",gc._maxSortingConcurrency);e.initWebAssemblyModule({wasmBinaryFile:"ThirdParty/wasm_splats_bg.wasm"}).then(function(t){t?gc._taskProcessorReady=!0:gc._error=new oe("Gaussian splat sorter could not be initialized.")}).catch(t=>{gc._error=t}),gc._textureTaskProcessor=e}return gc._textureTaskProcessor};gc.generateFromAttributes=function(e){let t=gc._getTextureTaskProcessor();if(l(gc._error))throw gc._error;if(!gc._taskProcessorReady)return;let{attributes:n}=e;return t.scheduleTask(e,[n.positions.buffer,n.scales.buffer,n.rotations.buffer,n.colors.buffer])};var jk=gc;function zgt(e){let t=new hg;this.shaderBuilder=t,this.uniformMap={},this.renderStateOptions=Ge.getState(Ge.fromCache({depthTest:{enabled:!0,func:cc.LESS_OR_EQUAL}})),this.alphaOptions=new GT,this.hasSkipLevelOfDetail=!1,e._useLogDepth&&t.addDefine("LOG_DEPTH_READ_ONLY",void 0,de.FRAGMENT)}var Hk=zgt;var oE=new N,Fve=new N,Gk=new N,vi=new $,Wk=new Le,Vgt=new h,jgt=new Le,Hgt=new h,Ggt=1e-12,MG=1e-5,Tee=1e-7,Ya={IDLE:0,WAITING:1,SORTING:2,SORTED:3,ERROR:4},Ys={BUILDING:"BUILDING",TEXTURE_PENDING:"TEXTURE_PENDING",TEXTURE_READY:"TEXTURE_READY",SORTING:"SORTING",READY:"READY"},Wgt=2,qgt=30,Ygt=3,Xgt=.008726646259971648,Kgt=1;function $gt(e,t){let n=e._lastSteadySortFrameNumber>=0?t.frameNumber-e._lastSteadySortFrameNumber:Number.POSITIVE_INFINITY;if(e._lastSteadySortFrameNumber>=0&&n<Ygt)return!1;let i=t.camera;return l(i)?!e._hasLastSteadySortCameraPosition||!e._hasLastSteadySortCameraDirection||h.distance(i.positionWC,e._lastSteadySortCameraPosition)>=Kgt?!0:h.angleBetween(i.directionWC,e._lastSteadySortCameraDirection)>=Xgt:!1}function Rve(e,t){e._lastSteadySortFrameNumber=t.frameNumber;let n=t.camera;l(n)&&(h.clone(n.positionWC,e._lastSteadySortCameraPosition),e._hasLastSteadySortCameraPosition=!0,h.clone(n.directionWC,e._lastSteadySortCameraDirection),e._hasLastSteadySortCameraDirection=!0)}function Jgt(e,t){let n=e._selectedTileSet;if(!l(n)||n.size!==t.length)return!0;for(let i=0;i<t.length;i++)if(!n.has(t[i]))return!0;return!1}function Ove(e,t){return l(t)&&t.requestId===e._sortRequestId&&t.dataGeneration===e._splatDataGeneration}function Eee(e){l(e)&&(l(e.gaussianSplatTexture)&&(e.gaussianSplatTexture.destroy(),e.gaussianSplatTexture=void 0),l(e.sphericalHarmonicsTexture)&&(e.sphericalHarmonicsTexture.destroy(),e.sphericalHarmonicsTexture=void 0))}function Mve(e,t,n){if(!l(t))return;e._retiredTextures.push({texture:t,frameNumber:n})}function Zgt(e,t){let n=e._retiredTextures;if(!l(n)||n.length===0)return;let i=[];for(let r=0;r<n.length;r++){let o=n[r];t-o.frameNumber>0?o.texture.destroy():i.push(o)}e._retiredTextures=i}function Qgt(e,t){let n=e?.[t];return l(n)?n.buffer:void 0}function e_t(e,t,n,i){let r=e._aggregateScratchBuffers[t];l(r)||(r=[],e._aggregateScratchBuffers[t]=r);let o=Qgt(e._snapshot,t);for(let a=0;a<r.length;a++){let c=r[a];if(c.length>=i&&c.buffer!==o)return c}let s=Y.createTypedArray(n,i);return r.push(s),s}function t_t(e,t){return e.length===t?e:e.subarray(0,t)}function n_t(e,t,n){if(!l(t.indexes)||t.state!==Ys.READY)throw new pe("Committing snapshot before it is READY.");let i=n.frameNumber,r=e._snapshot,o=l(r)?r.gaussianSplatTexture:e.gaussianSplatTexture;l(o)&&o!==t.gaussianSplatTexture&&Mve(e,o,i);let s=l(r)?r.sphericalHarmonicsTexture:e.sphericalHarmonicsTexture;l(s)&&s!==t.sphericalHarmonicsTexture&&Mve(e,s,i),e._snapshot=t,e._positions=t.positions,e._rotations=t.rotations,e._scales=t.scales,e._colors=t.colors,e._shData=t.shData,e._sphericalHarmonicsDegree=t.sphericalHarmonicsDegree,e._numSplats=t.numSplats,e._indexes=t.indexes,e.gaussianSplatTexture=t.gaussianSplatTexture,e.sphericalHarmonicsTexture=t.sphericalHarmonicsTexture,e._lastTextureWidth=t.lastTextureWidth,e._lastTextureHeight=t.lastTextureHeight,e._splatRowMask=t.splatRowMask,e._splatRowShift=t.splatRowShift,e._splatBudgetSSEScale=t.splatBudgetSSEScale??1,e._hasGaussianSplatTexture=l(t.gaussianSplatTexture),e._needsGaussianSplatTexture=!1,e._gaussianSplatTexturePending=!1,e._vertexArray=void 0,e._vertexArrayLen=-1,e._drawCommand=void 0,e._sorterPromise=void 0,e._activeSort=void 0,e._sorterState=Ya.IDLE,e._dirty=!1}async function i_t(e,t,n,i){try{let r=await i,o=kt.maximumTextureSize,s=o,a=Math.ceil(n.numSplats/(o/2)),c=Math.log2(o/2),u=o/2-1;if(a>o){let g=n.numSplats;a=o;let m=s/2;if(n.numSplats=o*m,n.positions=n.positions.subarray(0,n.numSplats*3),n.rotations=n.rotations.subarray(0,n.numSplats*4),n.scales=n.scales.subarray(0,n.numSplats*3),n.colors=n.colors.subarray(0,n.numSplats*4),l(n.shData)){let y=n.shData.length/g;n.shData=n.shData.subarray(0,Math.floor(n.numSplats*y))}n.splatBudgetSSEScale=g/n.numSplats,console.warn(`[GaussianSplat][HARD CAP] ${g} splats exceed the maximum texture capacity (${o}\xD7${m} = ${n.numSplats} splats at width=${s}). Rendering only the first ${n.numSplats} splats to avoid a WebGL crash. Increasing maximumScreenSpaceError by ${n.splatBudgetSSEScale.toFixed(2)}x next frame.`)}else n.splatBudgetSSEScale=1;let f=s*a*4,d;f<=r.data.length?d=r.data.subarray(0,f):(d=new Uint32Array(f),d.set(r.data));let p={width:s,height:a,data:d};if(n.splatRowMask=u,n.splatRowShift=c,e._pendingSnapshot!==n){n.state=Ys.BUILDING;return}if(!l(n.gaussianSplatTexture))n.gaussianSplatTexture=Lve(t.context,p);else if(n.lastTextureHeight!==p.height||n.lastTextureWidth!==p.width){let g=n.gaussianSplatTexture;n.gaussianSplatTexture=Lve(t.context,p),g.destroy()}else n.gaussianSplatTexture.copyFrom({source:{width:p.width,height:p.height,arrayBufferView:p.data}});if(n.lastTextureHeight=p.height,n.lastTextureWidth=p.width,l(n.shData)&&n.sphericalHarmonicsDegree>0){let g=n.sphericalHarmonicsTexture,m=kt.maximumTextureSize,y=n.shCoefficientCount/3,A=Math.floor(m/y),b=A*(y*2),x=Math.ceil(n.numSplats/A);if(x>m)console.warn(`[GaussianSplat][SHTexture] ${n.numSplats} splats require SH height ${x} > maxTex ${m}. Disabling spherical harmonics for this snapshot (color-only fallback).`),n.sphericalHarmonicsDegree=0,l(g)&&g.destroy(),n.sphericalHarmonicsTexture=void 0;else{let T=new Uint32Array(m*x*2),E=0;for(let v=0;E<n.shData.length;v+=m*2)T.set(n.shData.subarray(E,E+b),v),E+=b;n.sphericalHarmonicsTexture=o_t(t.context,{data:T,width:m,height:x}),l(g)&&g.destroy()}}n.state=Ys.TEXTURE_READY}catch(r){console.error("Error generating Gaussian splat texture:",r),n.state=Ys.BUILDING}}async function r_t(e,t,n,i){try{let r=await i;if(!l(n)||n.snapshot!==e._pendingSnapshot)return;let o=n.expectedCount,s=o,a=r?.length;if(o!==s||a!==o){e._pendingSortPromise=void 0,e._pendingSort=void 0,n.snapshot.state===Ys.SORTING&&(n.snapshot.state=Ys.TEXTURE_READY);return}let c=n.snapshot;c.indexes=r,c.state=Ys.READY,e._pendingSortPromise=void 0,e._pendingSort=void 0,n_t(e,c,t),e._pendingSnapshot=void 0,du.buildGSplatDrawCommand(e,t)}catch(r){if(!l(n)||n.snapshot!==e._pendingSnapshot)return;e._pendingSortPromise=void 0,e._pendingSort=void 0,n.snapshot.state===Ys.SORTING&&(n.snapshot.state=Ys.TEXTURE_READY),e._sorterState=Ya.ERROR,e._sorterError=r}}async function Nve(e,t,n){try{let i=await n,r=Ove(e,t),o=t?.expectedCount,s=o,a=i?.length;if(!r||(o!==s||a!==o)){r&&(e._sorterPromise=void 0,e._sorterState=Ya.IDLE);return}e._indexes=i,e._sorterState=Ya.SORTED}catch(i){if(!Ove(e,t))return;e._sorterState=Ya.ERROR,e._sorterError=i}}function o_t(e,t){return new Dt({context:e,source:{width:t.width,height:t.height,arrayBufferView:t.data},preMultiplyAlpha:!1,skipColorSpaceConversion:!0,pixelFormat:Ke.RG_INTEGER,pixelDatatype:ze.UNSIGNED_INT,flipY:!1,sampler:jt.NEAREST})}function Lve(e,t){return new Dt({context:e,source:{width:t.width,height:t.height,arrayBufferView:t.data},preMultiplyAlpha:!1,skipColorSpaceConversion:!0,pixelFormat:Ke.RGBA_INTEGER,pixelDatatype:ze.UNSIGNED_INT,flipY:!1,sampler:jt.NEAREST})}function du(e){e=e??H.EMPTY_OBJECT,this._positions=void 0,this._rotations=void 0,this._scales=void 0,this._colors=void 0,this._indexes=void 0,this._numSplats=0,this._needsGaussianSplatTexture=!0,this._snapshot=void 0,this._pendingSnapshot=void 0,this._retiredTextures=[],this._aggregateScratchBuffers={positions:[],scales:[],rotations:[],colors:[]},this._scratchAggregateShBuffer=void 0,this._selectedTilesStableFrames=0,this._needsSnapshotRebuild=!1,this._snapshotRebuildStallFrames=0,this._prevViewMatrix=new N,this._debugShowBoundingVolume=e.debugShowBoundingVolume??!1,this.gaussianSplatTexture=void 0,this.sphericalHarmonicsTexture=void 0,this._lastTextureWidth=0,this._lastTextureHeight=0,this._vertexArray=void 0,this._vertexArrayLen=-1,this._splitDirection=Ho.NONE,this._dirty=!1,this._tileset=e.tileset,this._baseTilesetUpdate=this._tileset.update,this._tileset.update=this._wrappedUpdate.bind(this),this._tileset.tileLoad.addEventListener(this.onTileLoad,this),this._tileset.tileVisible.addEventListener(this.onTileVisible,this),this.selectedTileLength=0,this._selectedTileSet=new Set,this._ready=!1,this._hasGaussianSplatTexture=!1,this._gaussianSplatTexturePending=!1,this._drawCommand=void 0,this._drawCommandModelMatrix=new N,this._rootTransform=void 0,this._axisCorrectionMatrix=xt.getAxisCorrectionMatrix(Hi.Y,Hi.X,new N),this._shInverseRotation=new $,this._isDestroyed=!1,this._sorterState=Ya.IDLE,this._sorterPromise=void 0,this._splatDataGeneration=0,this._sortRequestId=0,this._activeSort=void 0,this._pendingSortPromise=void 0,this._pendingSort=void 0,this._lastSteadySortFrameNumber=-1,this._lastSteadySortCameraPosition=new h,this._hasLastSteadySortCameraPosition=!1,this._lastSteadySortCameraDirection=new h,this._hasLastSteadySortCameraDirection=!1,this._sorterError=void 0,this._splatRowMask=0,this._splatRowShift=0,this._splatBudgetSSEScale=1}Object.defineProperties(du.prototype,{ready:{get:function(){return this._ready}},isStable:{get:function(){return!this._dirty&&(!l(this._pendingSnapshot)||this._pendingSnapshot.state===Ys.READY)}},splitDirection:{get:function(){return this._splitDirection},set:function(e){this._splitDirection!==e&&(this._splitDirection=e,this._dirty=!0)}}});du.prototype._wrappedUpdate=function(e){let t=this._tileset;if(this._splatBudgetSSEScale!==1){let n=t.maximumScreenSpaceError;t.maximumScreenSpaceError*=this._splatBudgetSSEScale,this._baseTilesetUpdate.call(t,e),t.maximumScreenSpaceError=n}else this._baseTilesetUpdate.call(t,e);this.update(e)};du.prototype.destroy=function(){if(this._positions=void 0,this._rotations=void 0,this._scales=void 0,this._colors=void 0,this._indexes=void 0,Eee(this._pendingSnapshot),Eee(this._snapshot),l(this._retiredTextures))for(let t=0;t<this._retiredTextures.length;t++)this._retiredTextures[t].texture.destroy();this._retiredTextures=[],this._pendingSnapshot=void 0,this._snapshot=void 0,this._aggregateScratchBuffers=void 0,this.gaussianSplatTexture=void 0,this.sphericalHarmonicsTexture=void 0;let e=this._drawCommand;return l(e)&&(e.shaderProgram=e.shaderProgram&&e.shaderProgram.destroy()),l(this._vertexArray)&&(this._vertexArray.destroy(),this._vertexArray=void 0),this._tileset.update=this._baseTilesetUpdate.bind(this._tileset),le(this)};du.prototype.isDestroyed=function(){return this._isDestroyed};du.prototype.onTileLoad=function(e){this._dirty=!0};du.prototype.onTileVisible=function(e){};du.transformTile=function(e){let t=e.computedTransform,n=e.content.gltfPrimitive,i=e.tileset.gaussianSplatPrimitive;i._rootTransform===void 0&&(i._rootTransform=At.eastNorthUpToFixedFrame(e.tileset.boundingSphere.center));let r=i._rootTransform,o=N.multiplyTransformation(t,i._axisCorrectionMatrix,oE);N.multiplyTransformation(o,e.content.worldTransform,o);let s=N.inverse(r,Fve),a=N.multiplyTransformation(s,o,oE),c=e.content._lastSplatTransform;if(e.content._transformed&&l(c)&&N.equalsEpsilon(a,c,Ggt))return;let u=e.content.positions,f=e.content.rotations,d=e.content.scales,p=Math.sqrt(a[0]*a[0]+a[1]*a[1]+a[2]*a[2]),g=Math.sqrt(a[4]*a[4]+a[5]*a[5]+a[6]*a[6]),m=Math.sqrt(a[8]*a[8]+a[9]*a[9]+a[10]*a[10]);vi[0]=a[0]/p,vi[1]=a[1]/p,vi[2]=a[2]/p,vi[3]=a[4]/g,vi[4]=a[5]/g,vi[5]=a[6]/g,vi[6]=a[8]/m,vi[7]=a[9]/m,vi[8]=a[10]/m;let y=vi[0]*vi[3]+vi[1]*vi[4]+vi[2]*vi[5],A=vi[0]*vi[6]+vi[1]*vi[7]+vi[2]*vi[8],b=vi[3]*vi[6]+vi[4]*vi[7]+vi[5]*vi[8],x=Math.abs(p-1)<=Tee&&Math.abs(g-1)<=Tee&&Math.abs(m-1)<=Tee,T=Math.abs(y)<=MG&&Math.abs(A)<=MG&&Math.abs(b)<=MG,E=vi[0]*(vi[4]*vi[8]-vi[5]*vi[7])-vi[3]*(vi[1]*vi[8]-vi[2]*vi[7])+vi[6]*(vi[1]*vi[5]-vi[2]*vi[4]),v=x&&T&&Math.abs(E-1)<=MG;Le.fromRotationMatrix(vi,Wk),Le.normalize(Wk,Wk);let S=xt.getAttributeBySemantic(n,ct.POSITION).typedArray,I=xt.getAttributeBySemantic(n,ct.ROTATION).typedArray,R=xt.getAttributeBySemantic(n,ct.SCALE).typedArray,O=Vgt,L=jgt,_=Hgt;for(let C=0;C<S.length/3;++C)O.x=S[C*3],O.y=S[C*3+1],O.z=S[C*3+2],L.x=I[C*4],L.y=I[C*4+1],L.z=I[C*4+2],L.w=I[C*4+3],_.x=R[C*3],_.y=R[C*3+1],_.z=R[C*3+2],v?(N.multiplyByPoint(a,O,O),Le.multiply(Wk,L,L),Le.normalize(L,L)):(N.fromTranslationQuaternionRotationScale(O,L,_,Gk),N.multiplyTransformation(a,Gk,Gk),N.getTranslation(Gk,O),N.getScale(Gk,_),Le.multiply(Wk,L,L),Le.normalize(L,L)),u[C*3]=O.x,u[C*3+1]=O.y,u[C*3+2]=O.z,f[C*4]=L.x,f[C*4+1]=L.y,f[C*4+2]=L.z,f[C*4+3]=L.w,d[C*3]=_.x,d[C*3+1]=_.y,d[C*3+2]=_.z;e.content._lastSplatTransform=N.clone(a,e.content._lastSplatTransform),e.content._transformed=!0};du.generateSplatTexture=function(e,t,n){if(!l(n)||n.state!==Ys.BUILDING)return;n.state=Ys.TEXTURE_PENDING;let i=jk.generateFromAttributes({attributes:{positions:new Float32Array(n.positions),scales:new Float32Array(n.scales),rotations:new Float32Array(n.rotations),colors:new Uint8Array(n.colors)},count:n.numSplats});if(!l(i)){n.state=Ys.BUILDING;return}i_t(e,t,n,i)};du.buildGSplatDrawCommand=function(e,t){let n=e._tileset,i=new Hk(e),{shaderBuilder:r}=i,o=i.renderStateOptions;o.cull.enabled=!1,o.depthMask=!1,o.depthTest.enabled=!0,o.blending=tn.PRE_MULTIPLIED_ALPHA_BLEND,i.alphaOptions.pass=Ie.GAUSSIAN_SPLATS,r.addAttribute("vec2","a_screenQuadPosition"),r.addAttribute("float","a_splatIndex"),r.addVarying("vec4","v_splatColor"),r.addVarying("vec2","v_vertPos"),r.addUniform("float","u_splitDirection",de.VERTEX),r.addVarying("float","v_splitDirection"),r.addUniform("highp usampler2D","u_splatAttributeTexture",de.VERTEX),r.addUniform("float","u_sphericalHarmonicsDegree",de.VERTEX),r.addUniform("float","u_splatScale",de.VERTEX),r.addUniform("vec3","u_cameraPositionWC",de.VERTEX),r.addUniform("mat3","u_inverseModelRotation",de.VERTEX);let s=i.uniformMap;r.addUniform("int","u_splatRowMask",de.VERTEX),r.addUniform("int","u_splatRowShift",de.VERTEX);let a=e.gaussianSplatTexture;s.u_splatAttributeTexture=function(){return a},s.u_splatRowMask=function(){return e._splatRowMask},s.u_splatRowShift=function(){return e._splatRowShift},e._sphericalHarmonicsDegree>0&&(r.addDefine("HAS_SPHERICAL_HARMONICS","1",de.VERTEX),r.addUniform("highp usampler2D","u_sphericalHarmonicsTexture",de.VERTEX),s.u_sphericalHarmonicsTexture=function(){return e.sphericalHarmonicsTexture}),s.u_sphericalHarmonicsDegree=function(){return e._sphericalHarmonicsDegree},s.u_cameraPositionWC=function(){return h.clone(t.camera.positionWC)},s.u_inverseModelRotation=function(){return e._shInverseRotation},s.u_splitDirection=function(){return e.splitDirection};let c=l(e._indexes)?e._indexes.length:e._numSplats;i.instanceCount=c,i.count=4,i.primitiveType=Oe.TRIANGLE_STRIP,r.addVertexLines(pM),r.addFragmentLines(mM);let u=r.buildShaderProgram(t.context),f=Je(Ge.fromCache(i.renderStateOptions),!0);f.cull.face=xt.getCullFace(n.modelMatrix,Oe.TRIANGLE_STRIP),f=Ge.fromCache(f);let d={screenQuadPosition:0,splatIndex:2},p=new Cn.Attribute;if(p.name="_SPLAT_INDEXES",p.typedArray=e._indexes,p.componentDatatype=Y.UNSIGNED_INT,p.type=Vt.SCALAR,p.normalized=!1,p.count=i.instanceCount,p.constant=0,p.instanceDivisor=1,!l(e._vertexArray)||e._indexes.length>e._vertexArrayLen){let b=new St({attributes:{screenQuadPosition:new Ne({componentDatatype:Y.FLOAT,componentsPerAttribute:2,values:[-1,-1,1,-1,1,1,-1,1],name:"_SCREEN_QUAD_POS",variableName:"screenQuadPosition"}),splatIndex:{...p,variableName:"splatIndex"}},primitiveType:Oe.TRIANGLE_STRIP});e._vertexArray=zn.fromGeometry({context:t.context,geometry:b,attributeLocations:d,bufferUsage:Me.DYNAMIC_DRAW,interleave:!1})}else e._vertexArray.getAttribute(1).vertexBuffer.copyFromArrayView(e._indexes);e._vertexArrayLen=e._indexes.length;let m=N.clone(e._rootTransform,e._drawCommandModelMatrix),y=e._vertexArray,A=new at({boundingVolume:n.boundingSphere,modelMatrix:m,uniformMap:s,renderState:f,vertexArray:y,shaderProgram:u,cull:o.cull.enabled,pass:Ie.GAUSSIAN_SPLATS,count:i.count,owner:e,instanceCount:i.instanceCount,primitiveType:Oe.TRIANGLE_STRIP,debugShowBoundingVolume:n.debugShowBoundingVolume,castShadows:!1,receiveShadows:!1});e._drawCommand=A};du.prototype.update=function(e){let t=this._tileset;if(Zgt(this,e.frameNumber),!t.show)return;if(this._drawCommand&&e.commandList.push(this._drawCommand),t._modelMatrixChanged){this._dirty=!0;return}let n=l(this._rootTransform);if(e.passes.pick===!0)return;this.splitDirection!==t.splitDirection&&(this.splitDirection=t.splitDirection);let i=e.camera;if(l(i)){if(this._sorterState===Ya.IDLE){let r=t._selectedTiles.length!==0&&Jgt(this,t._selectedTiles);t._selectedTiles.length===0?(this._selectedTilesStableFrames=0,this._needsSnapshotRebuild=!1,this._snapshotRebuildStallFrames=0):r?this._selectedTilesStableFrames=0:this._selectedTilesStableFrames++,(r||this._dirty)&&(this._needsSnapshotRebuild=!0);let o=this._selectedTilesStableFrames>=Wgt,s=!l(this._snapshot)&&!l(this._pendingSnapshot)&&!l(this._drawCommand);this._needsSnapshotRebuild&&t._selectedTiles.length!==0?this._snapshotRebuildStallFrames++:this._snapshotRebuildStallFrames=0;let a=o||s||this._snapshotRebuildStallFrames>=qgt;if(!(this._dirty||this._needsSnapshotRebuild||r||l(this._pendingSnapshot)||l(this._pendingSortPromise)||!l(this._drawCommand))&&N.equals(i.viewMatrix,this._prevViewMatrix))return;if(t._selectedTiles.length!==0&&this._needsSnapshotRebuild&&a){this._splatDataGeneration++,this._activeSort=void 0,this._sorterPromise=void 0,this._sorterState=Ya.IDLE,this._pendingSortPromise=void 0,this._pendingSort=void 0,l(this._pendingSnapshot)&&Eee(this._pendingSnapshot);let u=t._selectedTiles;this._rootTransform=At.eastNorthUpToFixedFrame(t.boundingSphere.center);{let E=u[0],v=N.multiplyTransformation(E.computedTransform,this._axisCorrectionMatrix,Fve);N.multiplyTransformation(v,E.content.worldTransform??N.IDENTITY,v),N.getRotation(N.inverse(v,v),this._shInverseRotation)}for(let E of u)du.transformTile(E);let f=u.reduce((E,v)=>E+v.content.pointsLength,0),d=(E,v,S,I)=>{let R,O=0,L=0;for(let _ of u){let C=S(_.content),w=l(I)?I:Vt.getNumberOfComponents(C.type),P=l(C.typedArray)?C.typedArray:C;L+=P.length,l(R)||(R=e_t(this,E,v,f*w))}if(!l(R))return Y.createTypedArray(v,0);for(let _ of u){let C=_.content,w=S(C),P=l(w.typedArray)?w.typedArray:w;R.set(P,O),O+=P.length}return t_t(R,L)},p=()=>{let E=0;for(let R of u)if(R.content.sphericalHarmonicsDegree>0){switch(R.content.sphericalHarmonicsDegree){case 1:E=9;break;case 2:E=24;break;case 3:E=45;break}break}if(E===0)return;let v=f*(E*(2/3));(!l(this._scratchAggregateShBuffer)||this._scratchAggregateShBuffer.length<v)&&(this._scratchAggregateShBuffer=new Uint32Array(v));let S=this._scratchAggregateShBuffer,I=0;for(let R of u){let O=R.content.packedSphericalHarmonicsData;R.content.sphericalHarmonicsDegree>0&&(S.set(O,I),I+=O.length)}return I<S.length?S.subarray(0,I):S},g=d("positions",Y.FLOAT,E=>E.positions,3),m=d("scales",Y.FLOAT,E=>E.scales,3),y=d("rotations",Y.FLOAT,E=>E.rotations,4),A=d("colors",Y.UNSIGNED_BYTE,E=>xt.getAttributeBySemantic(E.gltfPrimitive,ct.COLOR)),b=u[0].content.sphericalHarmonicsDegree,x=b>0?u[0].content.sphericalHarmonicsCoefficientCount:0,T=p();this._pendingSnapshot={generation:this._splatDataGeneration,positions:g,rotations:y,scales:m,colors:A,shData:T,sphericalHarmonicsDegree:b,shCoefficientCount:x,numSplats:f,indexes:void 0,gaussianSplatTexture:void 0,sphericalHarmonicsTexture:void 0,lastTextureWidth:0,lastTextureHeight:0,splatRowMask:0,splatRowShift:0,state:Ys.BUILDING},this.selectedTileLength=t._selectedTiles.length,this._selectedTileSet=new Set(t._selectedTiles),this._dirty=!1,this._needsSnapshotRebuild=!1,this._snapshotRebuildStallFrames=0}if(l(this._pendingSnapshot)){let u=this._pendingSnapshot;if(u.state===Ys.BUILDING){du.generateSplatTexture(this,e,u);return}if(u.state===Ys.TEXTURE_PENDING||u.state===Ys.TEXTURE_READY&&!l(u.gaussianSplatTexture)||!n)return;if(N.clone(i.viewMatrix,this._prevViewMatrix),N.multiply(i.viewMatrix,this._rootTransform,oE),u.state===Ys.TEXTURE_READY&&!l(this._pendingSortPromise)){let f=++this._sortRequestId,d=this._splatDataGeneration;this._pendingSort={requestId:f,dataGeneration:d,expectedCount:u.numSplats,snapshot:u};let p=rE.radixSortIndexes({primitive:{positions:new Float32Array(u.positions),modelView:Float32Array.from(oE),count:u.numSplats},sortType:"Index"});if(!l(p)){this._pendingSortPromise=void 0,this._pendingSort=void 0,u.state=Ys.TEXTURE_READY;return}this._pendingSortPromise=p,u.state=Ys.SORTING;let g=this._pendingSort;r_t(this,e,g,p);return}if(!l(this._pendingSortPromise)){u.state===Ys.SORTING&&(u.state=Ys.TEXTURE_READY);return}return}if(this._numSplats===0||!n)return;if(N.clone(i.viewMatrix,this._prevViewMatrix),N.multiply(i.viewMatrix,this._rootTransform,oE),!l(this._sorterPromise)){if(!$gt(this,e))return;let u=++this._sortRequestId,f=this._splatDataGeneration,d=this._numSplats;this._activeSort={requestId:u,dataGeneration:f,expectedCount:d};let p=rE.radixSortIndexes({primitive:{positions:new Float32Array(this._positions),modelView:Float32Array.from(oE),count:this._numSplats},sortType:"Index"});if(this._sorterPromise=p,l(p)){Rve(this,e);let g=this._activeSort;this._sorterState=Ya.SORTING,Nve(this,g,p);return}}if(!l(this._sorterPromise)){this._sorterState=Ya.WAITING;return}this._sorterState=Ya.SORTING;return}else if(this._sorterState===Ya.WAITING){if(!l(this._sorterPromise)){let r=++this._sortRequestId,o=this._splatDataGeneration,s=this._numSplats;this._activeSort={requestId:r,dataGeneration:o,expectedCount:s};let a=rE.radixSortIndexes({primitive:{positions:new Float32Array(this._positions),modelView:Float32Array.from(oE),count:this._numSplats},sortType:"Index"});if(this._sorterPromise=a,l(a)){Rve(this,e);let c=this._activeSort;this._sorterState=Ya.SORTING,Nve(this,c,a);return}}if(!l(this._sorterPromise)){this._sorterState=Ya.WAITING;return}this._sorterState=Ya.SORTING;return}else{if(this._sorterState===Ya.SORTING)return;if(this._sorterState===Ya.SORTED)du.buildGSplatDrawCommand(this,e),this._sorterState=Ya.IDLE,this._dirty=!1,this._sorterPromise=void 0,this._activeSort=void 0;else if(this._sorterState===Ya.ERROR)throw this._sorterError}this._dirty=!1}};var qk=du;var vee=class e{constructor(t,n,i,r){this._tileset=n,this._tile=i,this._resource=r,this._loader=t,l(this._tileset.gaussianSplatPrimitive)||(this._tileset.gaussianSplatPrimitive=new qk({tileset:this._tileset})),this._positions=void 0,this._rotations=void 0,this._scales=void 0,this.gltfPrimitive=void 0,this.worldTransform=void 0,this.featurePropertiesDirty=!1,this._metadata=void 0,this._group=void 0,this._ready=!1,this._transformed=!1,this._sphericalHarmonicsDegree=0,this._sphericalHarmonicsCoefficientCount=0,this._packedSphericalHarmonicsData=void 0,this._lastSplatTransform=void 0}static tilesetRequiresGaussianSplattingExt(t){let n=!1;return t.isGltfExtensionRequired instanceof Function&&(n=t.isGltfExtensionRequired("KHR_gaussian_splatting")&&t.isGltfExtensionRequired("KHR_gaussian_splatting_compression_spz_2"),t.isGltfExtensionRequired("KHR_spz_gaussian_splats_compression")&&qr("KHR_spz_gaussian_splats_compression",`Support for the original KHR_spz_gaussian_splats_compression extension has been removed in favor of the up to date KHR_gaussian_splatting and KHR_gaussian_splatting_compression_spz_2 extensions -Please retile your tileset with the KHR_gaussian_splatting and KHR_gaussian_splatting_compression_spz_2 extensions.`)),n}get featuresLength(){return 0}get pointsLength(){return this.gltfPrimitive.attributes[0].count}get trianglesLength(){return 0}get geometryByteLength(){return 0}get texturesByteLength(){let t=this._tileset?.gaussianSplatPrimitive;if(!l(t))return 0;let n=t.gaussianSplatTexture,i=t.selectedTileLength;return!l(n)||i===0?0:n.sizeInBytes/i}get batchTableByteLength(){return 0}get innerContents(){}get ready(){return this._ready}get transformed(){return this._transformed}get tileset(){return this._tileset}get tile(){return this._tile}get url(){return this._resource.getUrlComponent(!0)}get batchTable(){}get metadata(){return this._metadata}set metadata(t){this._metadata=t}get group(){return this._group}set group(t){this._group=t}get positions(){return this._positions}get rotations(){return this._rotations}get scales(){return this._scales}get sphericalHarmonicsCoefficientCount(){return this._sphericalHarmonicsCoefficientCount}get sphericalHarmonicsDegree(){return this._sphericalHarmonicsDegree}get packedSphericalHarmonicsData(){return this._packedSphericalHarmonicsData}static async fromGltf(t,n,i,r){let o=i,s=De.createIfNeeded(o),a={releaseGltfJson:!1,upAxis:Hi.Y,forwardAxis:Hi.Z};l(r.asset)?(a.gltfJson=r,a.baseResource=s,a.gltfResource=s):r instanceof Uint8Array?(a.typedArray=r,a.baseResource=s,a.gltfResource=s):a.gltfResource=De.createIfNeeded(r);let c=new Bf(a);try{await c.load()}catch(u){throw c.destroy(),new oe(`Failed to load glTF: ${u.message}`)}return new e(c,t,n,i)}update(t,n){let i=this._loader;if(!this._ready){if(n.afterRender.push(()=>!0),!l(i)){this._ready=!0;return}if(this._resourcesLoaded){this.gltfPrimitive=i.components.scene.nodes[0].primitives[0],this.worldTransform=i.components.scene.nodes[0].matrix,this._ready=!0,this._positions=xt.getAttributeBySemantic(this.gltfPrimitive,ct.POSITION).typedArray.slice(),this._rotations=xt.getAttributeBySemantic(this.gltfPrimitive,ct.ROTATION).typedArray.slice(),this._scales=xt.getAttributeBySemantic(this.gltfPrimitive,ct.SCALE).typedArray.slice();let{l:r,n:o}=_ht(this.gltfPrimitive.attributes);this._sphericalHarmonicsDegree=r,this._sphericalHarmonicsCoefficientCount=o,this._packedSphericalHarmonicsData=xht(this);return}this._resourcesLoaded=i.process(n)}}hasProperty(t,n){return!1}getFeature(t){}applyDebugSettings(t,n){}applyStyle(t){}pick(t,n,i){}isDestroyed(){return this.isDestroyed}destroy(){return this.splatPrimitive=void 0,this._tile=void 0,this._tileset=void 0,this._resource=void 0,this._ready=!1,this._group=void 0,this._metadata=void 0,this._resourcesLoaded=!1,this._lastSplatTransform=void 0,l(this._loader)&&(this._loader.destroy(),this._loader=void 0),le(this)}};function ght(e){return`${e.startsWith("KHR_gaussian_splatting:")?"KHR_gaussian_splatting:":"_"}SH_DEGREE_`}function _ht(e){switch(e.filter(n=>n.name.includes("SH_DEGREE_")).length){default:case 0:return{l:0,n:0};case 3:return{l:1,n:9};case 8:return{l:2,n:24};case 15:return{l:3,n:45}}}var LTe=new ArrayBuffer(4),yht=new Float32Array(LTe),Aht=new Uint32Array(LTe);function PQ(e){yht[0]=e;let t=Aht[0],n=t>>31&1,i=t>>23&255,r=t&8388607,o;if(i===255)o=n<<15|31744|(r?512:0);else if(i===0)o=n<<15;else{let s=i-127+15;s>=31?o=n<<15|31744:s<=0?o=n<<15:o=n<<15|s<<10|r>>>13}return o}function bht(e){let t=ght(e),n="_COEF_",i=t.length,r=e.indexOf(n,i),o=parseInt(e.slice(i,r),10),s=parseInt(e.slice(r+n.length),10);return{l:o,n:s}}function xht(e){let t=e.sphericalHarmonicsDegree,n=e.sphericalHarmonicsCoefficientCount,i=e.pointsLength*(n*(2/3)),r=new Uint32Array(i),o=e.gltfPrimitive.attributes.filter(u=>u.name.includes("SH_DEGREE_")),s=0,a=[0,9,24];switch(t){case 1:s=9;break;case 2:s=24;break;case 3:s=45;break}o.sort((u,f)=>u.name<f.name?-1:u.name>f.name?1:0);let c=s*(2/3);for(let u=0;u<o.length;u++){let{l:f,n:d}=bht(o[u].name);for(let p=0;p<e.pointsLength;p++){let g=a[f-1]*2/3,m=p*c+g+d*2,y=p*3;r[m]=PQ(o[u].typedArray[y])|PQ(o[u].typedArray[y+1])<<16,r[m+1]=PQ(o[u].typedArray[y+2])}}return r}var BA=DQ;var FTe={b3dm:function(e,t,n,i,r){return Gf.fromB3dm(e,t,n,i,r)},pnts:function(e,t,n,i,r){return Gf.fromPnts(e,t,n,i,r)},i3dm:function(e,t,n,i,r){return Gf.fromI3dm(e,t,n,i,r)},cmpt:function(e,t,n,i,r){return XN.fromTileType(e,t,n,i,r,FTe)},externalTileset:function(e,t,n,i){return b2.fromJson(e,t,n,i)},geom:function(e,t,n,i,r){return new JN(e,t,n,i,r)},vctr:function(e,t,n,i,r){return new B2(e,t,n,i,r)},subt:function(e,t,n,i,r){return hS.fromSubtreeJson(e,t,n,void 0,i,r)},subtreeJson:function(e,t,n,i){return hS.fromSubtreeJson(e,t,n,i)},glb:function(e,t,n,i,r){if(i.byteLength<12)throw new oe("Invalid glb content");let a=new DataView(i,r).getUint32(8,!0),c=new Uint8Array(i,r,a);return BA.tilesetRequiresGaussianSplattingExt(e)?BA.fromGltf(e,t,n,c):e.hasExtension("3DTILES_content_gltf_vector")||e.isGltfExtensionUsed("CESIUM_mesh_vector")?FA.fromGltf(e,t,n,c):Gf.fromGltf(e,t,n,c)},gltf:function(e,t,n,i){return BA.tilesetRequiresGaussianSplattingExt(e)?BA.fromGltf(e,t,n,i):e.hasExtension("3DTILES_content_gltf_vector")||e.isGltfExtensionUsed("CESIUM_mesh_vector")?FA.fromGltf(e,t,n,i):Gf.fromGltf(e,t,n,i)},geoJson:function(e,t,n,i){return Gf.fromGeoJson(e,t,n,i)}},VT=FTe;var BTe={UNLOADED:0,LOADING:1,PROCESSING:2,READY:3,EXPIRED:4,FAILED:5};Object.freeze(BTe);var Rr=BTe;var eh={BATCHED_3D_MODEL:"b3dm",INSTANCED_3D_MODEL:"i3dm",COMPOSITE:"cmpt",POINT_CLOUD:"pnts",VECTOR:"vctr",GEOMETRY:"geom",GLTF:"gltf",GLTF_BINARY:"glb",IMPLICIT_SUBTREE:"subt",IMPLICIT_SUBTREE_JSON:"subtreeJson",EXTERNAL_TILESET:"externalTileset",MULTIPLE_CONTENT:"multipleContent",GEOJSON:"geoJson",VOXEL_BINARY:"voxl",VOXEL_JSON:"voxelJson"};eh.isBinaryFormat=function(e){switch(e){case eh.BATCHED_3D_MODEL:case eh.INSTANCED_3D_MODEL:case eh.COMPOSITE:case eh.POINT_CLOUD:case eh.VECTOR:case eh.GEOMETRY:case eh.IMPLICIT_SUBTREE:case eh.VOXEL_BINARY:case eh.GLTF_BINARY:return!0;default:return!1}};Object.freeze(eh);var Ca=eh;var kTe={NOT_COMPUTED:-1,USE_OPTIMIZATION:1,SKIP_OPTIMIZATION:0};Object.freeze(kTe);var th=kTe;var va={RENDER:0,PICK:1,SHADOW:2,PRELOAD:3,PRELOAD_FLIGHT:4,REQUEST_RENDER_MODE_DEFER_CHECK:5,MOST_DETAILED_PRELOAD:6,MOST_DETAILED_PICK:7,NUMBER_OF_PASSES:8},d_=new Array(va.NUMBER_OF_PASSES);d_[va.RENDER]=Object.freeze({pass:va.RENDER,isRender:!0,requestTiles:!0,ignoreCommands:!1});d_[va.PICK]=Object.freeze({pass:va.PICK,isRender:!1,requestTiles:!1,ignoreCommands:!1});d_[va.SHADOW]=Object.freeze({pass:va.SHADOW,isRender:!1,requestTiles:!0,ignoreCommands:!1});d_[va.PRELOAD]=Object.freeze({pass:va.PRELOAD,isRender:!1,requestTiles:!0,ignoreCommands:!0});d_[va.PRELOAD_FLIGHT]=Object.freeze({pass:va.PRELOAD_FLIGHT,isRender:!1,requestTiles:!0,ignoreCommands:!0});d_[va.REQUEST_RENDER_MODE_DEFER_CHECK]=Object.freeze({pass:va.REQUEST_RENDER_MODE_DEFER_CHECK,isRender:!1,requestTiles:!0,ignoreCommands:!0});d_[va.MOST_DETAILED_PRELOAD]=Object.freeze({pass:va.MOST_DETAILED_PRELOAD,isRender:!1,requestTiles:!0,ignoreCommands:!0});d_[va.MOST_DETAILED_PICK]=Object.freeze({pass:va.MOST_DETAILED_PICK,isRender:!1,requestTiles:!1,ignoreCommands:!1});va.getPassOptions=function(e){return d_[e]};Object.freeze(va);var ao=va;var RQ=class{constructor(t,n){this._tileset=t,this._tile=n,this.featurePropertiesDirty=!1}get featuresLength(){return 0}get pointsLength(){return 0}get trianglesLength(){return 0}get geometryByteLength(){return 0}get texturesByteLength(){return 0}get batchTableByteLength(){return 0}get innerContents(){}get ready(){return!0}get tileset(){return this._tileset}get tile(){return this._tile}get url(){}get metadata(){}set metadata(t){}get batchTable(){}get group(){}set group(t){}hasProperty(t,n){return!1}getFeature(t){}applyDebugSettings(t,n){}applyStyle(t){}update(t,n){}pick(t,n,i){}isDestroyed(){return!1}destroy(){return le(this)}},n0=RQ;function h_(e){e=e??H.EMPTY_OBJECT;let t=e.content,n=e.class;this._class=n,this._properties=t.properties,this._extensions=t.extensions,this._extras=t.extras}Object.defineProperties(h_.prototype,{class:{get:function(){return this._class}},extras:{get:function(){return this._extras}},extensions:{get:function(){return this._extensions}}});h_.prototype.hasProperty=function(e){return Yn.hasProperty(e,this._properties,this._class)};h_.prototype.hasPropertyBySemantic=function(e){return Yn.hasPropertyBySemantic(e,this._properties,this._class)};h_.prototype.getPropertyIds=function(e){return Yn.getPropertyIds(this._properties,this._class,e)};h_.prototype.getProperty=function(e){return Yn.getProperty(e,this._properties,this._class)};h_.prototype.setProperty=function(e,t){return Yn.setProperty(e,t,this._properties,this._class)};h_.prototype.getPropertyBySemantic=function(e){return Yn.getPropertyBySemantic(e,this._properties,this._class)};h_.prototype.setPropertyBySemantic=function(e,t){return Yn.setPropertyBySemantic(e,t,this._properties,this._class)};var Z2=h_;function OQ(e,t){let n=tr(t,"3DTILES_metadata")?t.extensions["3DTILES_metadata"]:t.metadata;if(!l(n))return;if(!l(e.schema)){OQ._oneTimeWarning("findContentMetadata-missing-root-schema","Could not find a metadata schema for content metadata. For tilesets that contain external tilesets, make sure the schema is added to the root tileset.json.");return}let i=e.schema.classes??H.EMPTY_OBJECT;if(l(n.class)){let r=i[n.class];return new Z2({content:n,class:r})}}OQ._oneTimeWarning=_t;var jT=OQ;function Tht(e,t){let n=e.metadataExtension;if(!l(n))return;let i=n.groups,r=tr(t,"3DTILES_metadata")?t.extensions["3DTILES_metadata"].group:t.group;if(typeof r=="number")return i[r];let o=n.groupIds.findIndex(function(s){return s===r});return o>=0?i[o]:void 0}var HT=Tht;function m_(e){e=e??H.EMPTY_OBJECT;let t=e.tile,n=e.class;this._class=n,this._properties=t.properties,this._extensions=t.extensions,this._extras=t.extras}Object.defineProperties(m_.prototype,{class:{get:function(){return this._class}},extras:{get:function(){return this._extras}},extensions:{get:function(){return this._extensions}}});m_.prototype.hasProperty=function(e){return Yn.hasProperty(e,this._properties,this._class)};m_.prototype.hasPropertyBySemantic=function(e){return Yn.hasPropertyBySemantic(e,this._properties,this._class)};m_.prototype.getPropertyIds=function(e){return Yn.getPropertyIds(this._properties,this._class,e)};m_.prototype.getProperty=function(e){return Yn.getProperty(e,this._properties,this._class)};m_.prototype.setProperty=function(e,t){return Yn.setProperty(e,t,this._properties,this._class)};m_.prototype.getPropertyBySemantic=function(e){return Yn.getPropertyBySemantic(e,this._properties,this._class)};m_.prototype.setPropertyBySemantic=function(e,t){return Yn.setPropertyBySemantic(e,t,this._properties,this._class)};var Q2=m_;function MQ(e,t){let n=tr(t,"3DTILES_metadata")?t.extensions["3DTILES_metadata"]:t.metadata;if(!l(n))return;if(!l(e.schema)){MQ._oneTimeWarning("findTileMetadata-missing-root-schema","Could not find a metadata schema for tile metadata. For tilesets that contain external tilesets, make sure the schema is added to the root tileset.json.");return}let i=e.schema.classes??H.EMPTY_OBJECT;if(l(n.class)){let r=i[n.class];return new Q2({tile:n,class:r})}}MQ._oneTimeWarning=_t;var ek=MQ;function Eht(e){let t=new Uint8Array(e),n=om(t);if(n==="glTF"&&(n="glb"),Ca.isBinaryFormat(n))return{contentType:n,binaryPayload:t};let i=Cht(t);if(l(i.root))return{contentType:Ca.EXTERNAL_TILESET,jsonPayload:i};if(l(i.asset))return{contentType:Ca.GLTF,jsonPayload:i};if(l(i.tileAvailability))return{contentType:Ca.IMPLICIT_SUBTREE_JSON,jsonPayload:i};if(l(i.type))return{contentType:Ca.GEOJSON,jsonPayload:i};if(l(i.voxelTable))return{contentType:Ca.VOXEL_JSON,jsonPayload:i};throw new oe("Invalid tile content.")}function Cht(e){let t;try{t=Ro(e)}catch{throw new oe("Invalid tile content.")}return t}var p_=Eht;var NQ=class{constructor(t,n,i,r){this._tileset=t,this._tile=n,this._tilesetResource=i,this._contents=[],this._contentsCreated=!1;let o=l(r.contents)?r.contents:r.content;this._innerContentHeaders=o,this._requestsInFlight=0,this._cancelCount=0,this._externalTilesetCount=0;let s=this._innerContentHeaders.length;this._arrayFetchPromises=new Array(s),this._requests=new Array(s),this._ready=!1,this._innerContentResources=new Array(s),this._serverKeys=new Array(s);for(let a=0;a<s;a++){let c=i.getDerivedResource({url:o[a].uri}),u=Kc.getServerKey(c.getUrlComponent());this._innerContentResources[a]=c,this._serverKeys[a]=u}}get featurePropertiesDirty(){let t=this._contents,n=t.length;for(let i=0;i<n;++i)if(t[i].featurePropertiesDirty)return!0;return!1}set featurePropertiesDirty(t){let n=this._contents,i=n.length;for(let r=0;r<i;++r)n[r].featurePropertiesDirty=t}get featuresLength(){return 0}get pointsLength(){return 0}get trianglesLength(){return 0}get geometryByteLength(){return 0}get texturesByteLength(){return 0}get batchTableByteLength(){return 0}get innerContents(){return this._contents}get ready(){return this._contentsCreated?this._ready:!1}get tileset(){return this._tileset}get tile(){return this._tile}get url(){}get metadata(){}set metadata(t){}get batchTable(){}get group(){}set group(t){}get innerContentUrls(){return this._innerContentHeaders.map(function(t){return t.uri})}requestInnerContents(){if(!vht(this._serverKeys)){this.tileset.statistics.numberOfAttemptedRequests+=this._serverKeys.length;return}let t=this._innerContentHeaders;LQ(this,t.length);let n=this._cancelCount;for(let i=0;i<t.length;i++)this._arrayFetchPromises[i]=Sht(this,i,n,this._tile._contentState);return wht(this)}cancelRequests(){for(let t=0;t<this._requests.length;t++){let n=this._requests[t];l(n)&&n.cancel()}}hasProperty(t,n){return!1}getFeature(t){}applyDebugSettings(t,n){let i=this._contents,r=i.length;for(let o=0;o<r;++o)i[o].applyDebugSettings(t,n)}applyStyle(t){let n=this._contents,i=n.length;for(let r=0;r<i;++r)n[r].applyStyle(t)}update(t,n){let i=this._contents,r=i.length,o=!0;for(let s=0;s<r;++s)i[s].update(t,n),o=o&&i[s].ready;!this._ready&&o&&(this._ready=!0)}pick(t,n,i){if(!this._ready)return;let r,o=Number.POSITIVE_INFINITY,s=this._contents,a=s.length;for(let c=0;c<a;++c){let u=s[c].pick(t,n,i);if(!l(u))continue;let f=h.distance(t.origin,u);f<o&&(r=u,o=f)}if(l(r))return i}isDestroyed(){return!1}destroy(){let t=this._contents,n=t.length;for(let i=0;i<n;++i)t[i].destroy();return le(this)}};function LQ(e,t){e._requestsInFlight+=t,e.tileset.statistics.numberOfPendingRequests+=t}function UTe(e,t){e._cancelCount++,e._tile._contentState=t;let n=e.tileset.statistics;n.numberOfPendingRequests-=e._requestsInFlight,n.numberOfAttemptedRequests+=e._requestsInFlight,e._requestsInFlight=0;let i=e._innerContentHeaders.length;e._arrayFetchPromises=new Array(i)}function vht(e){let t={};for(let n=0;n<e.length;n++){let i=e[n];l(t[i])?t[i]++:t[i]=1}for(let n in t)if(t.hasOwnProperty(n)&&!Kc.serverHasOpenSlots(n,t[n]))return!1;return Kc.heapHasOpenSlots(e.length)}function Sht(e,t,n,i){let r=e._innerContentResources[t].clone(),o=e.tile,s=function(){return o._priority},a=e._serverKeys[t],c=new wo({throttle:!0,throttleByServer:!0,type:Zs.TILES3D,priorityFunction:s,serverKey:a});r.request=c,e._requests[t]=c;let u=r.fetchArrayBuffer();if(l(u))return u.then(function(f){if(!(n<e._cancelCount)){if(r.request.cancelled||r.request.state===Ti.CANCELLED){UTe(e,i);return}return LQ(e,-1),f}}).catch(function(f){if(!(n<e._cancelCount)){if(r.request.cancelled||r.request.state===Ti.CANCELLED){UTe(e,i);return}LQ(e,-1),zTe(e,t,f)}})}async function wht(e){let t=e._cancelCount,n=await Promise.all(e._arrayFetchPromises);if(t<e._cancelCount)return;let i=n.map((o,s)=>Iht(e,o,s)),r=await Promise.all(i);if(e._contentsCreated=!0,e._contents=r.filter(l),e._externalTilesetCount===e._contents.length){let o=e._tile;o.hasRenderableContent=!1}return r}async function Iht(e,t,n){if(l(t))try{let i=p_(t),r=e._tileset,o=e._innerContentResources[n],s=e._tile;i.contentType===Ca.EXTERNAL_TILESET&&(e._externalTilesetCount++,s.hasTilesetContent=!0),e._disableSkipLevelOfDetail=e._disableSkipLevelOfDetail||i.contentType===Ca.GEOMETRY||i.contentType===Ca.VECTOR;let a,c=VT[i.contentType];l(i.binaryPayload)?a=await Promise.resolve(c(r,s,o,i.binaryPayload.buffer,0)):a=await Promise.resolve(c(r,s,o,i.jsonPayload));let u=e._innerContentHeaders[n];if(s.hasImplicitContentMetadata){let d=s.implicitSubtree,p=s.implicitCoordinates;a.metadata=d.getContentMetadataView(p,n)}else s.hasImplicitContent||(a.metadata=jT(r,u));let f=HT(r,u);return l(f)&&(a.group=new $x({metadata:f})),a}catch(i){zTe(e,n,i)}}function zTe(e,t,n){let i=e._tileset,r=e._innerContentResources[t].url,o=l(n.message)?n.message:n.toString();i.tileFailed.numberOfListeners>0?i.tileFailed.raiseEvent({url:r,message:o}):(console.log(`A content failed to load: ${r}`),console.log(`Error: ${o}`))}var tk=NQ;var VTe=Math.cos,jTe=Math.sin,Pht=Math.sqrt,FQ={};FQ.computePosition=function(e,t,n,i,r,o,s){let a=t.radiiSquared,c=e.nwCorner,u=e.boundingRectangle,f=c.latitude-e.granYCos*i+r*e.granXSin,d=VTe(f),p=jTe(f),g=a.z*p,m=c.longitude+i*e.granYSin+r*e.granXCos,y=d*VTe(m),A=d*jTe(m),b=a.x*y,x=a.y*A,T=Pht(b*y+x*A+g*p);if(o.x=b/T,o.y=x/T,o.z=g/T,n){let E=e.stNwCorner;l(E)?(f=E.latitude-e.stGranYCos*i+r*e.stGranXSin,m=E.longitude+i*e.stGranYSin+r*e.stGranXCos,s.x=(m-e.stWest)*e.lonScalar,s.y=(f-e.stSouth)*e.latScalar):(s.x=(m-u.west)*e.lonScalar,s.y=(f-u.south)*e.latScalar)}};var Dht=new Xi,nh=new h,Rht=new he,rG=new h,nk=new Ui;function HTe(e,t,n,i,r,o,s){let a=Math.cos(t),c=i*a,u=n*a,f=Math.sin(t),d=i*f,p=n*f;nk._ellipsoid=ee.default,nh=nk.project(e,nh),nh=h.subtract(nh,rG,nh);let g=Xi.fromRotation(t,Dht);nh=Xi.multiplyByVector(g,nh,nh),nh=h.add(nh,rG,nh),e=nk.unproject(nh,e),o-=1,s-=1;let m=e.latitude,y=m+o*p,A=m-c*s,b=m-c*s+o*p,x=Math.max(m,y,A,b),T=Math.min(m,y,A,b),E=e.longitude,v=E+o*u,S=E+s*d,I=E+s*d+o*u,R=Math.max(E,v,S,I),O=Math.min(E,v,S,I);return{north:x,south:T,east:R,west:O,granYCos:c,granYSin:d,granXCos:u,granXSin:p,nwCorner:e}}FQ.computeOptions=function(e,t,n,i,r,o,s){let a=e.east,c=e.west,u=e.north,f=e.south,d=!1,p=!1;u===D.PI_OVER_TWO&&(d=!0),f===-D.PI_OVER_TWO&&(p=!0);let g,m=u-f;c>a?g=D.TWO_PI-c+a:g=a-c;let y=Math.ceil(g/t)+1,A=Math.ceil(m/t)+1,b=g/(y-1),x=m/(A-1),T=ie.northwest(e,o),E=ie.center(e,Rht);(n!==0||i!==0)&&(E.longitude<T.longitude&&(E.longitude+=D.TWO_PI),nk._ellipsoid=ee.default,rG=nk.project(E,rG));let v=x,S=b,I=0,R=0,O=ie.clone(e,r),L={granYCos:v,granYSin:I,granXCos:S,granXSin:R,nwCorner:T,boundingRectangle:O,width:y,height:A,northCap:d,southCap:p};if(n!==0){let _=HTe(T,n,b,x,E,y,A);u=_.north,f=_.south,a=_.east,c=_.west,L.granYCos=_.granYCos,L.granYSin=_.granYSin,L.granXCos=_.granXCos,L.granXSin=_.granXSin,O.north=u,O.south=f,O.east=a,O.west=c}if(i!==0){n=n-i;let _=ie.northwest(O,s),C=HTe(_,n,b,x,E,y,A);L.stGranYCos=C.granYCos,L.stGranXCos=C.granXCos,L.stGranYSin=C.granYSin,L.stGranXSin=C.granXSin,L.stNwCorner=_,L.stWest=C.west,L.stSouth=C.south}return L};var Sa=FQ;var Oht=new ue,Mht=new ue,Nht=new h,Lht=new ie;function GTe(e,t){let n=e._ellipsoid,i=t.height,r=t.width,o=t.northCap,s=t.southCap,a=i,c=2,u=0,f=4;o&&(c-=1,a-=1,u+=1,f-=2),s&&(c-=1,a-=1,u+=1,f-=2),u+=c*r+2*a-f;let d=new Float64Array(u*3),p=0,g=0,m,y=Nht;if(o)Sa.computePosition(t,n,!1,g,0,y),d[p++]=y.x,d[p++]=y.y,d[p++]=y.z;else for(m=0;m<r;m++)Sa.computePosition(t,n,!1,g,m,y),d[p++]=y.x,d[p++]=y.y,d[p++]=y.z;for(m=r-1,g=1;g<i;g++)Sa.computePosition(t,n,!1,g,m,y),d[p++]=y.x,d[p++]=y.y,d[p++]=y.z;if(g=i-1,!s)for(m=r-2;m>=0;m--)Sa.computePosition(t,n,!1,g,m,y),d[p++]=y.x,d[p++]=y.y,d[p++]=y.z;for(m=0,g=i-2;g>0;g--)Sa.computePosition(t,n,!1,g,m,y),d[p++]=y.x,d[p++]=y.y,d[p++]=y.z;let A=d.length/3*2,b=je.createTypedArray(d.length/3,A),x=0;for(let E=0;E<d.length/3-1;E++)b[x++]=E,b[x++]=E+1;b[x++]=d.length/3-1,b[x]=0;let T=new St({attributes:new Tn,primitiveType:Oe.LINES});return T.attributes.position=new Ne({componentDatatype:Y.DOUBLE,componentsPerAttribute:3,values:d}),T.indices=b,T}function Fht(e,t){let n=e._surfaceHeight,i=e._extrudedHeight,r=e._ellipsoid,o=GTe(e,t),s=t.height,a=t.width,c=fi.scaleToGeodeticHeight(o.attributes.position.values,n,r,!1),u=c.length,f=new Float64Array(u*2);f.set(c);let d=fi.scaleToGeodeticHeight(o.attributes.position.values,i,r);f.set(d,u),o.attributes.position.values=f;let p=t.northCap,g=t.southCap,m=4;p&&(m-=1),g&&(m-=1);let y=(f.length/3+m)*2,A=je.createTypedArray(f.length/3,y);u=f.length/6;let b=0;for(let T=0;T<u-1;T++)A[b++]=T,A[b++]=T+1,A[b++]=T+u,A[b++]=T+u+1;A[b++]=u-1,A[b++]=0,A[b++]=u+u-1,A[b++]=u,A[b++]=0,A[b++]=u;let x;if(p)x=s-1;else{let T=a-1;A[b++]=T,A[b++]=T+u,x=a+s-2}if(A[b++]=x,A[b++]=x+u,!g){let T=a+x-1;A[b++]=T,A[b]=T+u}return o.indices=A,o}function dw(e){e=e??H.EMPTY_OBJECT;let t=e.rectangle,n=e.granularity??D.RADIANS_PER_DEGREE,i=e.ellipsoid??ee.default,r=e.rotation??0,o=e.height??0,s=e.extrudedHeight??o;this._rectangle=ie.clone(t),this._granularity=n,this._ellipsoid=i,this._surfaceHeight=Math.max(o,s),this._rotation=r,this._extrudedHeight=Math.min(o,s),this._offsetAttribute=e.offsetAttribute,this._workerName="createRectangleOutlineGeometry"}dw.packedLength=ie.packedLength+ee.packedLength+5;dw.pack=function(e,t,n){return n=n??0,ie.pack(e._rectangle,t,n),n+=ie.packedLength,ee.pack(e._ellipsoid,t,n),n+=ee.packedLength,t[n++]=e._granularity,t[n++]=e._surfaceHeight,t[n++]=e._rotation,t[n++]=e._extrudedHeight,t[n]=e._offsetAttribute??-1,t};var WTe=new ie,qTe=ee.clone(ee.UNIT_SPHERE),fw={rectangle:WTe,ellipsoid:qTe,granularity:void 0,height:void 0,rotation:void 0,extrudedHeight:void 0,offsetAttribute:void 0};dw.unpack=function(e,t,n){t=t??0;let i=ie.unpack(e,t,WTe);t+=ie.packedLength;let r=ee.unpack(e,t,qTe);t+=ee.packedLength;let o=e[t++],s=e[t++],a=e[t++],c=e[t++],u=e[t];return l(n)?(n._rectangle=ie.clone(i,n._rectangle),n._ellipsoid=ee.clone(r,n._ellipsoid),n._surfaceHeight=s,n._rotation=a,n._extrudedHeight=c,n._offsetAttribute=u===-1?void 0:u,n):(fw.granularity=o,fw.height=s,fw.rotation=a,fw.extrudedHeight=c,fw.offsetAttribute=u===-1?void 0:u,new dw(fw))};var Bht=new he;dw.createGeometry=function(e){let t=e._rectangle,n=e._ellipsoid,i=Sa.computeOptions(t,e._granularity,e._rotation,0,Lht,Bht),r,o;if(D.equalsEpsilon(t.north,t.south,D.EPSILON10)||D.equalsEpsilon(t.east,t.west,D.EPSILON10))return;let s=e._surfaceHeight,a=e._extrudedHeight,c=!D.equalsEpsilon(s,a,0,D.EPSILON2),u;if(c){if(r=Fht(e,i),l(e._offsetAttribute)){let p=r.attributes.position.values.length/3,g=new Uint8Array(p);e._offsetAttribute===mn.TOP?g=g.fill(1,0,p/2):(u=e._offsetAttribute===mn.NONE?0:1,g=g.fill(u)),r.attributes.applyOffset=new Ne({componentDatatype:Y.UNSIGNED_BYTE,componentsPerAttribute:1,values:g})}let f=ue.fromRectangle3D(t,n,s,Mht),d=ue.fromRectangle3D(t,n,a,Oht);o=ue.union(f,d)}else{if(r=GTe(e,i),r.attributes.position.values=fi.scaleToGeodeticHeight(r.attributes.position.values,s,n,!1),l(e._offsetAttribute)){let f=r.attributes.position.values.length;u=e._offsetAttribute===mn.NONE?0:1;let d=new Uint8Array(f/3).fill(u);r.attributes.applyOffset=new Ne({componentDatatype:Y.UNSIGNED_BYTE,componentsPerAttribute:1,values:d})}o=ue.fromRectangle3D(t,n,s)}return new St({attributes:r.attributes,indices:r.indices,primitiveType:Oe.LINES,boundingSphere:o,offsetAttribute:e._offsetAttribute})};var GT=dw;function mw(e){this.rectangle=ie.clone(e.rectangle),this.minimumHeight=e.minimumHeight??0,this.maximumHeight=e.maximumHeight??0,this.southwestCornerCartesian=new h,this.northeastCornerCartesian=new h,this.westNormal=new h,this.southNormal=new h,this.eastNormal=new h,this.northNormal=new h;let t=e.ellipsoid??ee.WGS84;jht(this,e.rectangle,t),this._orientedBoundingBox=void 0,this._boundingSphere=void 0,(e.computeBoundingVolumes??!0)&&this.computeBoundingVolumes(t)}Object.defineProperties(mw.prototype,{boundingVolume:{get:function(){return this._orientedBoundingBox}},boundingSphere:{get:function(){return this._boundingSphere}}});mw.prototype.computeBoundingVolumes=function(e){this._orientedBoundingBox=en.fromRectangle(this.rectangle,this.minimumHeight,this.maximumHeight,e),this._boundingSphere=ue.fromOrientedBoundingBox(this._orientedBoundingBox)};var YTe=new h,oG=new h,XTe=new h,kht=new h,Uht=new h,zht=new h,Vht=new h,ih=new he,KTe=new sn(h.UNIT_X,0),hw=new pn;function jht(e,t,n){n.cartographicToCartesian(ie.southwest(t),e.southwestCornerCartesian),n.cartographicToCartesian(ie.northeast(t),e.northeastCornerCartesian),ih.longitude=t.west,ih.latitude=(t.south+t.north)*.5,ih.height=0;let i=n.cartographicToCartesian(ih,zht),r=h.cross(i,h.UNIT_Z,kht);h.normalize(r,e.westNormal),ih.longitude=t.east;let o=n.cartographicToCartesian(ih,Vht),s=h.cross(h.UNIT_Z,o,YTe);h.normalize(s,e.eastNormal);let a=h.subtract(i,o,YTe);h.magnitude(a)===0&&(a=h.clone(r,a));let c=h.normalize(a,Uht),u=t.south,f;if(u>0){ih.longitude=(t.west+t.east)*.5,ih.latitude=u;let y=n.cartographicToCartesian(ih,hw.origin);h.clone(c,hw.direction);let A=sn.fromPointNormal(e.southwestCornerCartesian,e.westNormal,KTe);_i.rayPlane(hw,A,e.southwestCornerCartesian),f=n.geodeticSurfaceNormal(y,oG)}else f=n.geodeticSurfaceNormalCartographic(ie.southeast(t),oG);let d=h.cross(f,a,XTe);h.normalize(d,e.southNormal);let p=t.north,g;if(p<0){ih.longitude=(t.west+t.east)*.5,ih.latitude=p;let y=n.cartographicToCartesian(ih,hw.origin);h.negate(c,hw.direction);let A=sn.fromPointNormal(e.northeastCornerCartesian,e.eastNormal,KTe);_i.rayPlane(hw,A,e.northeastCornerCartesian),g=n.geodeticSurfaceNormal(y,oG)}else g=n.geodeticSurfaceNormalCartographic(ie.northwest(t),oG);let m=h.cross(a,g,XTe);h.normalize(m,e.northNormal)}var Hht=new h,Ght=new h,Wht=new h(0,-1,0),qht=new h(0,0,-1),$Te=new h;function Yht(e,t){let n=t.camera,i=n.positionWC,r=n.positionCartographic,o=0;if(!ie.contains(e.rectangle,r)){let u=e.southwestCornerCartesian,f=e.northeastCornerCartesian,d=e.westNormal,p=e.southNormal,g=e.eastNormal,m=e.northNormal;t.mode!==re.SCENE3D&&(u=t.mapProjection.project(ie.southwest(e.rectangle),Hht),u.z=u.y,u.y=u.x,u.x=0,f=t.mapProjection.project(ie.northeast(e.rectangle),Ght),f.z=f.y,f.y=f.x,f.x=0,d=Wht,g=h.UNIT_Y,p=qht,m=h.UNIT_Z);let y=h.subtract(i,u,$Te),A=h.dot(y,d),b=h.dot(y,p),x=h.subtract(i,f,$Te),T=h.dot(x,g),E=h.dot(x,m);A>0?o+=A*A:T>0&&(o+=T*T),b>0?o+=b*b:E>0&&(o+=E*E)}let s,a,c;if(t.mode===re.SCENE3D?(s=r.height,a=e.minimumHeight,c=e.maximumHeight):(s=i.x,a=0,c=0),s>c){let u=s-c;o+=u*u}else if(s<a){let u=a-s;o+=u*u}return Math.sqrt(o)}mw.prototype.distanceToCamera=function(e){let t=Yht(this,e);if(e.mode===re.SCENE3D&&l(this._orientedBoundingBox)){let n=Math.sqrt(this._orientedBoundingBox.distanceSquaredTo(e.camera.positionWC));return Math.max(t,n)}return t};mw.prototype.intersectPlane=function(e){return this._orientedBoundingBox.intersectPlane(e)};mw.prototype.createDebugVolume=function(e){let t=N.clone(N.IDENTITY),n=new GT({rectangle:this.rectangle,height:this.minimumHeight,extrudedHeight:this.maximumHeight}),i=new Ft({geometry:n,id:"outline",modelMatrix:t,attributes:{color:Jt.fromColor(e)}});return new On({geometryInstances:i,appearance:new yn({translucent:!1,flat:!0}),asynchronous:!1})};var Yf=mw;var ik={},Xht=new h,JTe=new h,ZTe=new h,QTe=new h,eEe=new en;ik.validOutline=function(e){let n=en.fromPoints(e,eEe).halfAxes,i=$.getColumn(n,0,JTe),r=$.getColumn(n,1,ZTe),o=$.getColumn(n,2,QTe),s=h.magnitude(i),a=h.magnitude(r),c=h.magnitude(o);return!(s===0&&(a===0||c===0)||a===0&&c===0)};ik.computeProjectTo2DArguments=function(e,t,n,i){let r=en.fromPoints(e,eEe),o=r.halfAxes,s=$.getColumn(o,0,JTe),a=$.getColumn(o,1,ZTe),c=$.getColumn(o,2,QTe),u=h.magnitude(s),f=h.magnitude(a),d=h.magnitude(c),p=Math.min(u,f,d);if(u===0&&(f===0||d===0)||f===0&&d===0)return!1;let g,m;return(p===f||p===d)&&(g=s),p===u?g=a:p===d&&(m=a),(p===u||p===f)&&(m=c),h.normalize(g,n),h.normalize(m,i),h.clone(r.center,t),!0};function tEe(e,t,n,i,r){let o=h.subtract(e,t,Xht),s=h.dot(n,o),a=h.dot(i,o);return U.fromElements(s,a,r)}ik.createProjectPointsTo2DFunction=function(e,t,n){return function(i){let r=new Array(i.length);for(let o=0;o<i.length;o++)r[o]=tEe(i[o],e,t,n);return r}};ik.createProjectPointTo2DFunction=function(e,t,n){return function(i,r){return tEe(i,e,t,n,r)}};var g_=ik;function Kht(e){let t=e.length,n=new Float64Array(t*3),i=je.createTypedArray(t,t*2),r=0,o=0;for(let a=0;a<t;a++){let c=e[a];n[r++]=c.x,n[r++]=c.y,n[r++]=c.z,i[o++]=a,i[o++]=(a+1)%t}let s=new Tn({position:new Ne({componentDatatype:Y.DOUBLE,componentsPerAttribute:3,values:n})});return new St({attributes:s,indices:i,primitiveType:Oe.LINES})}function WT(e){e=e??H.EMPTY_OBJECT;let t=e.polygonHierarchy;this._polygonHierarchy=t,this._workerName="createCoplanarPolygonOutlineGeometry",this.packedLength=ni.computeHierarchyPackedLength(t,h)+1}WT.fromPositions=function(e){e=e??H.EMPTY_OBJECT;let t={polygonHierarchy:{positions:e.positions}};return new WT(t)};WT.pack=function(e,t,n){return n=n??0,n=ni.packPolygonHierarchy(e._polygonHierarchy,t,n,h),t[n]=e.packedLength,t};var $ht={polygonHierarchy:{}};WT.unpack=function(e,t,n){t=t??0;let i=ni.unpackPolygonHierarchy(e,t,h);t=i.startingIndex,delete i.startingIndex;let r=e[t];return l(n)||(n=new WT($ht)),n._polygonHierarchy=i,n.packedLength=r,n};WT.createGeometry=function(e){let t=e._polygonHierarchy,n=t.positions;if(n=Fr(n,h.equalsEpsilon,!0),n.length<3||!g_.validOutline(n))return;let r=ni.polygonOutlinesFromHierarchy(t,!1);if(r.length===0)return;let o=[];for(let c=0;c<r.length;c++){let u=new Ft({geometry:Kht(r[c])});o.push(u)}let s=Hn.combineInstances(o)[0],a=ue.fromPoints(t.positions);return new St({attributes:s.attributes,indices:s.indices,primitiveType:s.primitiveType,boundingSphere:a})};var rh=WT;var sG=new he;function rk(e){let t=Mg.fromToken(e.token),n=e.minimumHeight??0,i=e.maximumHeight??0,r=e.ellipsoid??ee.WGS84;this.s2Cell=t,this.minimumHeight=n,this.maximumHeight=i,this.ellipsoid=r;let o=omt(t,n,i,r);this._boundingPlanes=o;let s=lmt(o);this._vertices=s,this._edgeNormals=new Array(6),this._edgeNormals[0]=GQ(o[0],s.slice(0,4));let a;for(a=0;a<4;a++)this._edgeNormals[0][a]=h.negate(this._edgeNormals[0][a],this._edgeNormals[0][a]);for(this._edgeNormals[1]=GQ(o[1],s.slice(4,8)),a=0;a<4;a++)this._edgeNormals[2+a]=GQ(o[2+a],[s[a%4],s[(a+1)%4],s[4+(a+1)%4],s[4+a]]);for(this._planeVertices=[this._vertices.slice(0,4),this._vertices.slice(4,8)],a=0;a<4;a++)this._planeVertices.push([this._vertices[a%4],this._vertices[(a+1)%4],this._vertices[4+(a+1)%4],this._vertices[4+a]]);let c=t.getCenter();sG=r.cartesianToCartographic(c,sG),sG.height=(i+n)/2,this.center=r.cartographicToCartesian(sG,c),this._boundingSphere=ue.fromPoints(s)}var Jht=new h,Zht=new he,Qht=new h,emt=new he,tmt=new h,nmt=new h,imt=new h,rmt=new h;function omt(e,t,n,i){let r=new Array(6),o=e.getCenter(),s=i.geodeticSurfaceNormal(o,Jht),a=i.cartesianToCartographic(o,Zht);a.height=n;let c=i.cartographicToCartesian(a,Qht),u=sn.fromPointNormal(c,s);r[0]=u;let f=0,d,p=[],g,m;for(d=0;d<4;d++){g=e.getVertex(d),p[d]=g,m=i.cartesianToCartographic(g,emt),m.height=t;let A=sn.getPointDistance(u,i.cartographicToCartesian(m,tmt));A<f&&(f=A)}let y=sn.clone(u);for(y.normal=h.negate(y.normal,y.normal),y.distance=y.distance*-1+f,r[1]=y,d=0;d<4;d++){g=p[d];let A=p[(d+1)%4],b=i.geodeticSurfaceNormal(g,nmt),x=h.subtract(A,g,rmt),T=h.cross(x,b,imt);T=h.normalize(T,T),r[2+d]=sn.fromPointNormal(g,T)}return r}var qT=new h,YT=new h,XT=new h,BQ=new h,kQ=new h,UQ=new h,smt=new h,amt=new h,cmt=new h,zQ=new h,VQ=new h,jQ=new h,kA=new h,i0=new $;function nEe(e,t,n){qT=e.normal,YT=t.normal,XT=n.normal,BQ=h.multiplyByScalar(e.normal,-e.distance,BQ),kQ=h.multiplyByScalar(t.normal,-t.distance,kQ),UQ=h.multiplyByScalar(n.normal,-n.distance,UQ),zQ=h.multiplyByScalar(h.cross(YT,XT,smt),h.dot(BQ,qT),zQ),VQ=h.multiplyByScalar(h.cross(XT,qT,amt),h.dot(kQ,YT),VQ),jQ=h.multiplyByScalar(h.cross(qT,YT,cmt),h.dot(UQ,XT),jQ),i0[0]=qT.x,i0[1]=YT.x,i0[2]=XT.x,i0[3]=qT.y,i0[4]=YT.y,i0[5]=XT.y,i0[6]=qT.z,i0[7]=YT.z,i0[8]=XT.z;let i=$.determinant(i0);return kA=h.add(zQ,VQ,kA),kA=h.add(kA,jQ,kA),new h(kA.x/i,kA.y/i,kA.z/i)}function lmt(e){let t=new Array(8);for(let n=0;n<4;n++)t[n]=nEe(e[0],e[2+(n+3)%4],e[2+n%4]),t[n+4]=nEe(e[1],e[2+(n+3)%4],e[2+n%4]);return t}var HQ=new h,pw=new h;function GQ(e,t){let n=[];for(let i=0;i<4;i++)HQ=h.subtract(t[(i+1)%4],t[i],HQ),pw=h.cross(e.normal,HQ,pw),pw=h.normalize(pw,pw),n[i]=h.clone(pw);return n}Object.defineProperties(rk.prototype,{boundingVolume:{get:function(){return this}},boundingSphere:{get:function(){return this._boundingSphere}}});var WQ=new h;rk.prototype.distanceToCamera=function(e){let t=e.camera.positionWC,n=[],i=[],r;sn.getPointDistance(this._boundingPlanes[0],t)>0?(n.push(0),i.push(this._planeVertices[0]),r=this._edgeNormals[0]):sn.getPointDistance(this._boundingPlanes[1],t)>0&&(n.push(1),i.push(this._planeVertices[1]),r=this._edgeNormals[1]);let o,s;for(o=0;o<4;o++)s=2+o,sn.getPointDistance(this._boundingPlanes[s],t)>0&&(n.push(s),i.push(this._planeVertices[s]),r=this._edgeNormals[s]);if(n.length===0)return 0;let a,c;if(n.length===1)return c=this._boundingPlanes[n[0]],a=qQ(sn.projectPointOntoPlane(c,t,WQ),i[0],c,r),h.distance(a,t);if(n.length===2){if(n[0]===0){let p=[this._vertices[4*n[0]+(n[1]-2)],this._vertices[4*n[0]+(n[1]-2+1)%4]];return a=iEe(t,p[0],p[1]),h.distance(a,t)}let f=Number.MAX_VALUE,d;for(o=0;o<2;o++)c=this._boundingPlanes[n[o]],a=qQ(sn.projectPointOntoPlane(c,t,WQ),i[o],c,this._edgeNormals[n[o]]),d=h.distanceSquared(a,t),d<f&&(f=d);return Math.sqrt(f)}else if(n.length>3)return a=qQ(sn.projectPointOntoPlane(this._boundingPlanes[1],t,WQ),this._planeVertices[1],this._boundingPlanes[1],this._edgeNormals[1]),h.distance(a,t);let u=n[1]===2&&n[2]===5?0:1;return n[0]===0?h.distance(t,this._vertices[(n[1]-2+u)%4]):h.distance(t,this._vertices[4+(n[1]-2+u)%4])};var umt=new h,fmt=new h;function iEe(e,t,n){let i=h.subtract(n,t,umt),r=h.subtract(e,t,fmt),o=h.dot(i,r);if(o<=0)return t;let s=h.dot(i,i);return o>=s?n:(o=o/s,new h((1-o)*t.x+o*n.x,(1-o)*t.y+o*n.y,(1-o)*t.z+o*n.z))}var dmt=new sn(h.UNIT_X,0);function qQ(e,t,n,i){let r=Number.MAX_VALUE,o,s,a;for(let c=0;c<t.length;c++){let u=sn.fromPointNormal(t[c],i[c],dmt);sn.getPointDistance(u,e)<0||(a=iEe(e,t[c],t[(c+1)%4]),o=h.distance(e,a),o<r&&(r=o,s=a))}return l(s)?s:e}rk.prototype.intersectPlane=function(e){let t=0,n=0;for(let i=0;i<this._vertices.length;i++)h.dot(e.normal,this._vertices[i])+e.distance<0?n++:t++;return t===this._vertices.length?$t.INSIDE:n===this._vertices.length?$t.OUTSIDE:$t.INTERSECTING};rk.prototype.createDebugVolume=function(e){let t=N.clone(N.IDENTITY),n=new rh({polygonHierarchy:{positions:this._planeVertices[0]}}),i=rh.createGeometry(n),r=new Ft({geometry:i,id:"outline",modelMatrix:t,attributes:{color:Jt.fromColor(e)}}),o=new rh({polygonHierarchy:{positions:this._planeVertices[1]}}),s=rh.createGeometry(o),a=new Ft({geometry:s,id:"outline",modelMatrix:t,attributes:{color:Jt.fromColor(e)}}),c=[];for(let u=0;u<4;u++){let f=new rh({polygonHierarchy:{positions:this._planeVertices[2+u]}}),d=rh.createGeometry(f);c[u]=new Ft({geometry:d,id:"outline",modelMatrix:t,attributes:{color:Jt.fromColor(e)}})}return new On({geometryInstances:[c[0],c[1],c[2],c[3],a,r],appearance:new yn({translucent:!1,flat:!0}),asynchronous:!1})};var ok=rk;var hmt=new h(1,1,1),aG=Math.cos,cG=Math.sin;function gw(e){e=e??H.EMPTY_OBJECT;let t=e.radii??hmt,n=e.innerRadii??t,i=e.minimumClock??0,r=e.maximumClock??D.TWO_PI,o=e.minimumCone??0,s=e.maximumCone??D.PI,a=Math.round(e.stackPartitions??10),c=Math.round(e.slicePartitions??8),u=Math.round(e.subdivisions??128);this._radii=h.clone(t),this._innerRadii=h.clone(n),this._minimumClock=i,this._maximumClock=r,this._minimumCone=o,this._maximumCone=s,this._stackPartitions=a,this._slicePartitions=c,this._subdivisions=u,this._offsetAttribute=e.offsetAttribute,this._workerName="createEllipsoidOutlineGeometry"}gw.packedLength=2*h.packedLength+8;gw.pack=function(e,t,n){return n=n??0,h.pack(e._radii,t,n),n+=h.packedLength,h.pack(e._innerRadii,t,n),n+=h.packedLength,t[n++]=e._minimumClock,t[n++]=e._maximumClock,t[n++]=e._minimumCone,t[n++]=e._maximumCone,t[n++]=e._stackPartitions,t[n++]=e._slicePartitions,t[n++]=e._subdivisions,t[n]=e._offsetAttribute??-1,t};var rEe=new h,oEe=new h,__={radii:rEe,innerRadii:oEe,minimumClock:void 0,maximumClock:void 0,minimumCone:void 0,maximumCone:void 0,stackPartitions:void 0,slicePartitions:void 0,subdivisions:void 0,offsetAttribute:void 0};gw.unpack=function(e,t,n){t=t??0;let i=h.unpack(e,t,rEe);t+=h.packedLength;let r=h.unpack(e,t,oEe);t+=h.packedLength;let o=e[t++],s=e[t++],a=e[t++],c=e[t++],u=e[t++],f=e[t++],d=e[t++],p=e[t];return l(n)?(n._radii=h.clone(i,n._radii),n._innerRadii=h.clone(r,n._innerRadii),n._minimumClock=o,n._maximumClock=s,n._minimumCone=a,n._maximumCone=c,n._stackPartitions=u,n._slicePartitions=f,n._subdivisions=d,n._offsetAttribute=p===-1?void 0:p,n):(__.minimumClock=o,__.maximumClock=s,__.minimumCone=a,__.maximumCone=c,__.stackPartitions=u,__.slicePartitions=f,__.subdivisions=d,__.offsetAttribute=p===-1?void 0:p,new gw(__))};gw.createGeometry=function(e){let t=e._radii;if(t.x<=0||t.y<=0||t.z<=0)return;let n=e._innerRadii;if(n.x<=0||n.y<=0||n.z<=0)return;let i=e._minimumClock,r=e._maximumClock,o=e._minimumCone,s=e._maximumCone,a=e._subdivisions,c=ee.fromCartesian3(t),u=e._slicePartitions+1,f=e._stackPartitions+1;u=Math.round(u*Math.abs(r-i)/D.TWO_PI),f=Math.round(f*Math.abs(s-o)/D.PI),u<2&&(u=2),f<2&&(f=2);let d=0,p=1,g=n.x!==t.x||n.y!==t.y||n.z!==t.z,m=!1,y=!1;g&&(p=2,o>0&&(m=!0,d+=u),s<Math.PI&&(y=!0,d+=u));let A=a*p*(f+u),b=new Float64Array(A*3),x=2*(A+d-(u+f)*p),T=je.createTypedArray(A,x),E,v,S,I,R=0,O=new Array(f),L=new Array(f);for(E=0;E<f;E++)I=o+E*(s-o)/(f-1),O[E]=cG(I),L[E]=aG(I);let _=new Array(a),C=new Array(a);for(E=0;E<a;E++)S=i+E*(r-i)/(a-1),_[E]=cG(S),C[E]=aG(S);for(E=0;E<f;E++)for(v=0;v<a;v++)b[R++]=t.x*O[E]*C[v],b[R++]=t.y*O[E]*_[v],b[R++]=t.z*L[E];if(g)for(E=0;E<f;E++)for(v=0;v<a;v++)b[R++]=n.x*O[E]*C[v],b[R++]=n.y*O[E]*_[v],b[R++]=n.z*L[E];for(O.length=a,L.length=a,E=0;E<a;E++)I=o+E*(s-o)/(a-1),O[E]=cG(I),L[E]=aG(I);for(_.length=u,C.length=u,E=0;E<u;E++)S=i+E*(r-i)/(u-1),_[E]=cG(S),C[E]=aG(S);for(E=0;E<a;E++)for(v=0;v<u;v++)b[R++]=t.x*O[E]*C[v],b[R++]=t.y*O[E]*_[v],b[R++]=t.z*L[E];if(g)for(E=0;E<a;E++)for(v=0;v<u;v++)b[R++]=n.x*O[E]*C[v],b[R++]=n.y*O[E]*_[v],b[R++]=n.z*L[E];for(R=0,E=0;E<f*p;E++){let M=E*a;for(v=0;v<a-1;v++)T[R++]=M+v,T[R++]=M+v+1}let w=f*a*p;for(E=0;E<u;E++)for(v=0;v<a-1;v++)T[R++]=w+E+v*u,T[R++]=w+E+(v+1)*u;if(g)for(w=f*a*p+u*a,E=0;E<u;E++)for(v=0;v<a-1;v++)T[R++]=w+E+v*u,T[R++]=w+E+(v+1)*u;if(g){let M=f*a*p,F=M+a*u;if(m)for(E=0;E<u;E++)T[R++]=M+E,T[R++]=F+E;if(y)for(M+=a*u-u,F+=a*u-u,E=0;E<u;E++)T[R++]=M+E,T[R++]=F+E}let P=new Tn({position:new Ne({componentDatatype:Y.DOUBLE,componentsPerAttribute:3,values:b})});if(l(e._offsetAttribute)){let M=b.length,F=e._offsetAttribute===mn.NONE?0:1,V=new Uint8Array(M/3).fill(F);P.applyOffset=new Ne({componentDatatype:Y.UNSIGNED_BYTE,componentsPerAttribute:1,values:V})}return new St({attributes:P,indices:T,primitiveType:Oe.LINES,boundingSphere:ue.fromEllipsoid(c),offsetAttribute:e._offsetAttribute})};var Xf=gw;function _w(e){let t=e.radius??1,i={radii:new h(t,t,t),stackPartitions:e.stackPartitions,slicePartitions:e.slicePartitions,subdivisions:e.subdivisions};this._ellipsoidGeometry=new Xf(i),this._workerName="createSphereOutlineGeometry"}_w.packedLength=Xf.packedLength;_w.pack=function(e,t,n){return Xf.pack(e._ellipsoidGeometry,t,n)};var mmt=new Xf,KT={radius:void 0,radii:new h,stackPartitions:void 0,slicePartitions:void 0,subdivisions:void 0};_w.unpack=function(e,t,n){let i=Xf.unpack(e,t,mmt);return KT.stackPartitions=i._stackPartitions,KT.slicePartitions=i._slicePartitions,KT.subdivisions=i._subdivisions,l(n)?(h.clone(i._radii,KT.radii),n._ellipsoidGeometry=new Xf(KT),n):(KT.radius=i._radii.x,new _w(KT))};_w.createGeometry=function(e){return Xf.createGeometry(e._ellipsoidGeometry)};var y_=_w;function yw(e,t){t===0&&(t=D.EPSILON7),this._boundingSphere=new ue(e,t)}Object.defineProperties(yw.prototype,{center:{get:function(){return this._boundingSphere.center}},radius:{get:function(){return this._boundingSphere.radius}},boundingVolume:{get:function(){return this._boundingSphere}},boundingSphere:{get:function(){return this._boundingSphere}}});yw.prototype.distanceToCamera=function(e){let t=this._boundingSphere;return Math.max(0,h.distance(t.center,e.camera.positionWC)-t.radius)};yw.prototype.intersectPlane=function(e){return ue.intersectPlane(this._boundingSphere,e)};yw.prototype.update=function(e,t){h.clone(e,this._boundingSphere.center),this._boundingSphere.radius=t};yw.prototype.createDebugVolume=function(e){let t=new y_({radius:this.radius}),n=N.fromTranslation(this.center,N.clone(N.IDENTITY)),i=new Ft({geometry:t,id:"outline",modelMatrix:n,attributes:{color:Jt.fromColor(e)}});return new On({geometryInstances:i,appearance:new yn({translucent:!1,flat:!0}),asynchronous:!1})};var A_=yw;var pmt=new h,gmt=new h,_mt=new h,ymt=new h;function $T(e,t,n){n=h.cross(e,t,n);let i=h.magnitude(n);return h.multiplyByScalar(n,D.EPSILON7/i,n)}function YQ(e,t){let n=h.normalize(e,ymt),i=h.equalsEpsilon(n,h.UNIT_X,D.EPSILON6)?h.UNIT_Y:h.UNIT_X;return $T(e,i,t)}function sEe(e){let t=$.getColumn(e,0,pmt),n=$.getColumn(e,1,gmt),i=$.getColumn(e,2,_mt),r=h.equals(t,h.ZERO),o=h.equals(n,h.ZERO),s=h.equals(i,h.ZERO);return!r&&!o&&!s?e:r&&o&&s?(e[0]=D.EPSILON7,e[4]=D.EPSILON7,e[8]=D.EPSILON7,e):(r&&!o&&!s?t=$T(n,i,t):!r&&o&&!s?n=$T(t,i,n):!r&&!o&&s?i=$T(n,t,i):r?o?s||(t=YQ(i,t),n=$T(i,t,n)):(t=YQ(n,t),i=$T(n,t,i)):(n=YQ(t,n),i=$T(n,t,i)),$.setColumn(e,0,t,e),$.setColumn(e,1,n,e),$.setColumn(e,2,i,e),e)}function Aw(e,t){t=sEe(t),this._orientedBoundingBox=new en(e,t),this._boundingSphere=ue.fromOrientedBoundingBox(this._orientedBoundingBox)}Object.defineProperties(Aw.prototype,{boundingVolume:{get:function(){return this._orientedBoundingBox}},boundingSphere:{get:function(){return this._boundingSphere}}});Aw.prototype.distanceToCamera=function(e){return Math.sqrt(this._orientedBoundingBox.distanceSquaredTo(e.camera.positionWC))};Aw.prototype.intersectPlane=function(e){return this._orientedBoundingBox.intersectPlane(e)};Aw.prototype.update=function(e,t){h.clone(e,this._orientedBoundingBox.center),t=sEe(t),$.clone(t,this._orientedBoundingBox.halfAxes),ue.fromOrientedBoundingBox(this._orientedBoundingBox,this._boundingSphere)};Aw.prototype.createDebugVolume=function(e){let t=new $h({minimum:new h(-1,-1,-1),maximum:new h(1,1,1)}),n=N.fromRotationTranslation(this.boundingVolume.halfAxes,this.boundingVolume.center),i=new Ft({geometry:t,id:"outline",modelMatrix:n,attributes:{color:Jt.fromColor(e)}});return new On({geometryInstances:i,appearance:new yn({translucent:!1,flat:!0}),asynchronous:!1})};var Ju=Aw;function co(e,t,n,i){this._tileset=e,this._header=n;let r=l(n.contents),o=r&&n.contents.length>1||tr(n,"3DTILES_multiple_contents"),s=r&&!o?n.contents[0]:n.content;this._contentHeader=s,this.transform=l(n.transform)?N.unpack(n.transform):N.clone(N.IDENTITY);let a=l(i)?i.computedTransform:e.modelMatrix,c=N.multiply(a,this.transform,new N),u=l(i)?i._initialTransform:N.IDENTITY;this._initialTransform=N.multiply(u,this.transform,new N),this.computedTransform=c,this.metadata=ek(e,n),this._verticalExaggeration=1,this._verticalExaggerationRelativeHeight=0,this._boundingVolume=this.createBoundingVolume(n.boundingVolume,c),this._boundingVolume2D=void 0;let f;l(s)&&l(s.boundingVolume)&&(f=this.createBoundingVolume(s.boundingVolume,c)),this._contentBoundingVolume=f,this._contentBoundingVolume2D=void 0;let d;l(n.viewerRequestVolume)&&(d=this.createBoundingVolume(n.viewerRequestVolume,c)),this._viewerRequestVolume=d,this.geometricError=n.geometricError,this._geometricError=n.geometricError,l(this._geometricError)||(this._geometricError=l(i)?i._geometricError:e._geometricError,co._deprecationWarning("geometricErrorUndefined","Required property geometricError is undefined for this tile. Using parent's geometric error instead.")),this.updateGeometricErrorScale();let p;l(n.refine)?((n.refine==="replace"||n.refine==="add")&&co._deprecationWarning("lowercase-refine",`This tile uses a lowercase refine "${n.refine}". Instead use "${n.refine.toUpperCase()}".`),p=n.refine.toUpperCase()==="REPLACE"?yo.REPLACE:yo.ADD):l(i)?p=i.refine:p=yo.REPLACE,this.refine=p,this.children=[],this.parent=i;let g,m=!1,y,A,b;if(t=De.createIfNeeded(t),o)y=Rr.UNLOADED,A=t.clone();else if(l(s)){let v=s.uri;l(s.url)&&(co._deprecationWarning("contentUrl",'This tileset JSON uses the "content.url" property which has been deprecated. Use "content.uri" instead.'),v=s.url),v===""?(co._deprecationWarning("contentUriEmpty","content.uri property is an empty string, which creates a circular dependency, making this tileset invalid. Omit the content property instead"),g=new n0(e,this),m=!0,y=Rr.READY):(y=Rr.UNLOADED,A=t.getDerivedResource({url:v}),b=Kc.getServerKey(A.getUrlComponent()))}else g=new n0(e,this),m=!0,y=Rr.READY;this._content=g,this._contentResource=A,this._contentState=y,this._expiredContent=void 0,this._serverKey=b,this.hasEmptyContent=m,this.hasTilesetContent=!1,this.hasImplicitContent=!1,this.hasRenderableContent=!m,this.hasImplicitContentMetadata=!1,this.hasMultipleContents=o,this.cacheNode=void 0;let x=n.expire,T,E;l(x)&&(T=x.duration,l(x.date)&&(E=K.fromIso8601(x.date))),this.expireDuration=T,this.expireDate=E,this.lastStyleTime=0,this._optimChildrenWithinParent=th.NOT_COMPUTED,this.clippingPlanesDirty=!1,this.clippingPolygonsDirty=!1,this.clippingPolygonsNeedRebake=!1,this.priorityDeferred=!1,this.implicitTileset=void 0,this.implicitCoordinates=void 0,this.implicitSubtree=void 0,this._distanceToCamera=0,this._centerZDepth=0,this._screenSpaceError=0,this._screenSpaceErrorProgressiveResolution=0,this._visibilityPlaneMask=0,this._visible=!1,this._inRequestVolume=!1,this._finalResolution=!0,this._depth=0,this._stackLength=0,this._selectionDepth=0,this._updatedVisibilityFrame=0,this._touchedFrame=0,this._visitedFrame=0,this._selectedFrame=0,this._wasSelectedLastFrame=!1,this._requestedFrame=0,this._ancestorWithContent=void 0,this._ancestorWithContentAvailable=void 0,this._refines=!1,this._shouldSelect=!1,this._isClipped=!0,this._isClippedByPolygon=!1,this._clippingPlanesState=0,this._clippingPolygonsState=0,this._debugBoundingVolume=void 0,this._debugContentBoundingVolume=void 0,this._debugViewerRequestVolume=void 0,this._debugColor=z.fromRandom({alpha:1}),this._debugColorizeTiles=!1,this._priority=0,this._priorityHolder=this,this._priorityProgressiveResolution=!1,this._priorityProgressiveResolutionScreenSpaceErrorLeaf=!1,this._priorityReverseScreenSpaceError=0,this._foveatedFactor=0,this._wasMinPriorityChild=!1,this._loadTimestamp=new K,this._commandsLength=0,this._color=void 0,this._colorDirty=!1,this._request=void 0}co._deprecationWarning=qr;Object.defineProperties(co.prototype,{tileset:{get:function(){return this._tileset}},content:{get:function(){return this._content}},boundingVolume:{get:function(){return this._boundingVolume}},contentBoundingVolume:{get:function(){return this._contentBoundingVolume??this._boundingVolume}},boundingSphere:{get:function(){return this._boundingVolume.boundingSphere}},isVisible:{get:function(){return this._visible&&this._inRequestVolume}},extras:{get:function(){return this._header.extras}},color:{get:function(){return l(this._color)||(this._color=new z),z.clone(this._color)},set:function(e){this._color=z.clone(e,this._color),this._colorDirty=!0}},contentAvailable:{get:function(){return this.contentReady&&this.hasRenderableContent||l(this._expiredContent)&&!this.contentFailed}},contentReady:{get:function(){return this._contentState===Rr.READY}},contentUnloaded:{get:function(){return this._contentState===Rr.UNLOADED}},hasUnloadedRenderableContent:{get:function(){return this.hasRenderableContent&&this.contentUnloaded}},contentExpired:{get:function(){return this._contentState===Rr.EXPIRED}},contentFailed:{get:function(){return this._contentState===Rr.FAILED}},commandsLength:{get:function(){return this._commandsLength}}});var UA=new h;function Amt(e,t){let{tileset:n,boundingSphere:i}=e,{radius:r,center:o}=i,{camera:s}=t,a=h.multiplyByScalar(s.directionWC,e._centerZDepth,UA),c=h.add(s.positionWC,a,UA),u=h.subtract(c,o,UA);if(h.magnitude(u)>r){let E=h.normalize(u,UA),v=h.multiplyByScalar(E,r,UA),S=h.add(o,v,UA),I=h.subtract(S,s.positionWC,UA),R=h.normalize(I,UA);e._foveatedFactor=1-Math.abs(h.dot(s.directionWC,R))}else e._foveatedFactor=0;let p=e.refine===yo.REPLACE,g=n.isSkippingLevelOfDetail;if(p&&!g||!n.foveatedScreenSpaceError||n.foveatedConeSize===1||e._priorityProgressiveResolution&&p&&g||n._pass===ao.PRELOAD_FLIGHT||n._pass===ao.PRELOAD)return!1;let m=1-Math.cos(s.frustum.fov*.5),y=n.foveatedConeSize*m;if(e._foveatedFactor<=y)return!1;let A=m-y,b=D.clamp((e._foveatedFactor-y)/A,0,1),x=n.foveatedInterpolationCallback(n.foveatedMinimumScreenSpaceErrorRelaxation,n.memoryAdjustedScreenSpaceError,b),T=e._screenSpaceError===0&&l(e.parent)?e.parent._screenSpaceError*.5:e._screenSpaceError;return n.memoryAdjustedScreenSpaceError-x<=T}var dEe=new K;co.prototype.getScreenSpaceError=function(e,t,n){let i=this._tileset,r=n??1,o=l(this.parent)?this.parent.geometricError:i._scaledGeometricError,s=t?o:this.geometricError;if(s===0)return 0;let{camera:a,context:c}=e,u=a.frustum,f=c.drawingBufferWidth,d=c.drawingBufferHeight*r,p;if(e.mode===re.SCENE2D||u instanceof gn){let g=u.offCenterFrustum;l(g)&&(u=g);let m=Math.max(u.top-u.bottom,u.right-u.left)/Math.max(f,d);p=s/m}else{let g=Math.max(this._distanceToCamera,D.EPSILON7),m=u.sseDenominator;if(p=s*d/(g*m),i.dynamicScreenSpaceError){let y=i._dynamicScreenSpaceErrorComputedDensity,A=i.dynamicScreenSpaceErrorFactor,b=D.fog(g,y)*A;p-=b}}return p/=e.pixelRatio,p};function bmt(e,t){if(e.progressiveResolutionHeightFraction<=0||e.progressiveResolutionHeightFraction>.5)return!1;let n=e.memoryAdjustedScreenSpaceError,i=t._screenSpaceErrorProgressiveResolution>n;t._priorityProgressiveResolutionScreenSpaceErrorLeaf=!1;let r=t.parent,o=t._screenSpaceErrorProgressiveResolution<=n,s=l(r)&&r._screenSpaceErrorProgressiveResolution>n;return o&&s&&(t._priorityProgressiveResolutionScreenSpaceErrorLeaf=!0,i=!0),i}function xmt(e,t){let n=t.parent,r=l(n)&&(!e.isSkippingLevelOfDetail||t._screenSpaceError===0||n.hasTilesetContent||n.hasImplicitContent)?n._screenSpaceError:t._screenSpaceError;return e.root._screenSpaceError-r}co.prototype.updateVisibility=function(e){let{parent:t,tileset:n}=this;if(this._updatedVisibilityFrame===n._updatedVisibilityFrame)return;let i=l(t)?t.computedTransform:n.modelMatrix,r=l(t)?t._visibilityPlaneMask:ta.MASK_INDETERMINATE;this.updateTransform(i,e),this._distanceToCamera=this.distanceToTile(e),this._centerZDepth=this.distanceToTileCenter(e),this._screenSpaceError=this.getScreenSpaceError(e,!1),this._screenSpaceErrorProgressiveResolution=this.getScreenSpaceError(e,!1,n.progressiveResolutionHeightFraction),this._visibilityPlaneMask=this.visibility(e,r),this._visible=this._visibilityPlaneMask!==ta.MASK_OUTSIDE,this._inRequestVolume=this.insideViewerRequestVolume(e),this._priorityReverseScreenSpaceError=xmt(n,this),this._priorityProgressiveResolution=bmt(n,this),this.priorityDeferred=Amt(this,e),this._updatedVisibilityFrame=n._updatedVisibilityFrame};co.prototype.updateExpiration=function(){if(l(this.expireDate)&&this.contentReady&&!this.hasEmptyContent&&!this.hasMultipleContents){let e=K.now(dEe);K.lessThan(this.expireDate,e)&&(this._contentState=Rr.EXPIRED,this._expiredContent=this._content)}};function Tmt(e){if(!l(e.expireDuration))return;let t=K.now(dEe);K.addSeconds(t,e.expireDuration,t),l(e.expireDate)?K.lessThan(e.expireDate,t)&&K.clone(t,e.expireDate):e.expireDate=K.clone(t)}function Emt(e){return function(){return e._priority}}co.prototype.requestContent=function(){if(!this.hasEmptyContent)return this.hasMultipleContents?Cmt(this):Smt(this)};function Cmt(e){let t=e._content,n=e._tileset;if(!l(t)){let r=tr(e._header,"3DTILES_multiple_contents")?e._header.extensions["3DTILES_multiple_contents"]:e._header;t=new tk(n,e,e._contentResource.clone(),r),e._content=t}let i=t.requestInnerContents();if(l(i))return e._contentState=Rr.LOADING,i.then(r=>{if(!e.isDestroyed()&&l(r))return e._contentState=Rr.PROCESSING,t}).catch(r=>{if(!e.isDestroyed())throw e._contentState=Rr.FAILED,r})}async function vmt(e,t,n,i,r){let o=e._contentState;e._contentState=Rr.LOADING,++t.statistics.numberOfPendingRequests;let s;try{s=await r}catch(a){if(--t.statistics.numberOfPendingRequests,e.isDestroyed())return;if(n.cancelled||n.state===Ti.CANCELLED){e._contentState=o,++t.statistics.numberOfAttemptedRequests;return}if(hEe(e,a))return i&&(e.expireDate=void 0),e._content=new n0(t,e),aEe(e),e._contentState=Rr.PROCESSING,e._content;throw e._contentState=Rr.FAILED,a}if(e.isDestroyed()){--t.statistics.numberOfPendingRequests;return}if(n.cancelled||n.state===Ti.CANCELLED){e._contentState=o,--t.statistics.numberOfPendingRequests,++t.statistics.numberOfAttemptedRequests;return}try{let a=await wmt(e,s);return--t.statistics.numberOfPendingRequests,e.isDestroyed()?void 0:(i&&(e.expireDate=void 0),e._content=a,a instanceof n0&&aEe(e),e._contentState=Rr.PROCESSING,a)}catch(a){if(--t.statistics.numberOfPendingRequests,e.isDestroyed())return;throw e._contentState=Rr.FAILED,a}}function Smt(e){let t=e._contentResource.clone(),n=e.contentExpired;n&&t.setQueryParameters({expired:e.expireDate.toString()});let i=new wo({throttle:!0,throttleByServer:!0,type:Zs.TILES3D,priorityFunction:Emt(e),serverKey:e._serverKey});e._request=i,t.request=i;let r=e._tileset,o=t.fetchArrayBuffer();if(!l(o)){++r.statistics.numberOfAttemptedRequests;return}return vmt(e,r,i,n,o)}function hEe(e,t){let i=e._tileset?._runtimeContentCodec?.missingTilePolicy;return!l(i)||!l(t.statusCode)?!1:i.statusCodes.includes(t.statusCode)}function aEe(e){e.hasEmptyContent=!0,e.hasRenderableContent=!1}co._isEmptyTile=hEe;async function wmt(e,t){let n=e._tileset,i=n?._runtimeContentCodec;if(l(i)&&typeof i.createContent=="function"){let u=await Promise.resolve(i.createContent(n,e,e._contentResource,t));return e.isDestroyed()?void 0:u}let r=p_(t);n._disableSkipLevelOfDetail=n._disableSkipLevelOfDetail||r.contentType===Ca.GEOMETRY||r.contentType===Ca.VECTOR,(r.contentType===Ca.IMPLICIT_SUBTREE||r.contentType===Ca.IMPLICIT_SUBTREE_JSON)&&(e.hasImplicitContent=!0,e.hasRenderableContent=!1),r.contentType===Ca.EXTERNAL_TILESET&&(e.hasTilesetContent=!0,e.hasRenderableContent=!1);let o,s=VT[r.contentType];if(e.isDestroyed())return;l(r.binaryPayload)?o=await Promise.resolve(s(n,e,e._contentResource,r.binaryPayload.buffer,0)):o=await Promise.resolve(s(n,e,e._contentResource,r.jsonPayload));let a=e._contentHeader;if(e.hasImplicitContentMetadata){let u=e.implicitSubtree,f=e.implicitCoordinates;o.metadata=u.getContentMetadataView(f,0)}else e.hasImplicitContent||(o.metadata=jT(n,a));let c=HT(n,a);return l(c)&&(o.group=new $x({metadata:c})),o}co.prototype.cancelRequests=function(){this.hasMultipleContents?this._content.cancelRequests():this._request.cancel()};co.prototype.unloadTilesetContent=function(){this.hasTilesetContent&&(this._content=this._content&&this._content.destroy(),this._contentState=Rr.UNLOADED,this._expiredContent=void 0,this.expireDate=void 0,this.hasTilesetContent=!1,this.hasRenderableContent=!0,this._selectedFrame=0,this.lastStyleTime=0)};co.prototype.unloadContent=function(){this.hasRenderableContent&&(this._content=this._content&&this._content.destroy(),this._contentState=Rr.UNLOADED,this.lastStyleTime=0,this.clippingPlanesDirty=this._clippingPlanesState===0,this._clippingPlanesState=0,this.clippingPolygonsDirty=this._clippingPolygonsState===0,this._clippingPolygonsState=0,this.clippingPolygonsNeedRebake=!1,this._debugColorizeTiles=!1,this._debugBoundingVolume=this._debugBoundingVolume&&this._debugBoundingVolume.destroy(),this._debugContentBoundingVolume=this._debugContentBoundingVolume&&this._debugContentBoundingVolume.destroy(),this._debugViewerRequestVolume=this._debugViewerRequestVolume&&this._debugViewerRequestVolume.destroy())};var mEe=new ue;function KQ(e,t){if(t.mode!==re.SCENE3D&&!l(e._boundingVolume2D)){let n=e._boundingVolume.boundingSphere,i=ue.projectTo2D(n,t.mapProjection,mEe);e._boundingVolume2D=new A_(i.center,i.radius)}return t.mode!==re.SCENE3D?e._boundingVolume2D:e._boundingVolume}function Imt(e,t){if(t.mode!==re.SCENE3D&&!l(e._contentBoundingVolume2D)){let n=e._contentBoundingVolume.boundingSphere,i=ue.projectTo2D(n,t.mapProjection,mEe);e._contentBoundingVolume2D=new A_(i.center,i.radius)}return t.mode!==re.SCENE3D?e._contentBoundingVolume2D:e._contentBoundingVolume}co.prototype.visibility=function(e,t){let n=e.cullingVolume,i=KQ(this,e),r=this._tileset,o=r.clippingPlanes;if(l(o)&&o.enabled){let a=o.computeIntersectionWithBoundingVolume(i,r.clippingPlanesOriginMatrix);if(this._isClipped=a!==$t.INSIDE,a===$t.OUTSIDE)return ta.MASK_OUTSIDE}let s=r.clippingPolygons;if(l(s)&&s.enabled){let a=s.computeIntersectionWithBoundingVolume(i);this._isClippedByPolygon=a!==$t.OUTSIDE}return n.computeVisibilityWithPlaneMask(i,t)};co.prototype.contentVisibility=function(e){if(!l(this._contentBoundingVolume))return $t.INSIDE;if(this._visibilityPlaneMask===ta.MASK_INSIDE)return $t.INSIDE;let t=e.cullingVolume,n=Imt(this,e),i=this._tileset,r=i.clippingPlanes;if(l(r)&&r.enabled){let s=r.computeIntersectionWithBoundingVolume(n,i.clippingPlanesOriginMatrix);if(this._isClipped=s!==$t.INSIDE,s===$t.OUTSIDE)return $t.OUTSIDE}let o=i.clippingPolygons;if(l(o)&&o.enabled){let s=o.computeIntersectionWithBoundingVolume(n);if(this._isClippedByPolygon=s!==$t.OUTSIDE,s===$t.INSIDE)return $t.OUTSIDE}return t.computeVisibility(n)};co.prototype.distanceToTile=function(e){return KQ(this,e).distanceToCamera(e)};var Pmt=new h;co.prototype.distanceToTileCenter=function(e){let n=KQ(this,e).boundingVolume,i=h.subtract(n.center,e.camera.positionWC,Pmt);return h.dot(e.camera.directionWC,i)};co.prototype.insideViewerRequestVolume=function(e){let t=this._viewerRequestVolume;return!l(t)||t.distanceToCamera(e)===0};var pEe=new $,gEe=new h,Dmt=new $,$Q=new h,_Ee=new ie,yEe=new en,XQ=new N;function Rmt(e,t,n){let i=h.fromElements(e[0],e[1],e[2],$Q),r=$.fromArray(e,3,Dmt);i=N.multiplyByPoint(t,i,i);let o=N.getMatrix3(t,pEe);return r=$.multiply(o,r,r),l(n)?(n.update(i,r),n):new Ju(i,r)}function cEe(e,t,n,i){let r=ie.unpack(e,0,_Ee),o=e[4],s=e[5],a=en.fromRectangle(r,o,s,ee.WGS84,yEe),c=a.center,u=a.halfAxes;t=N.multiplyTransformation(t,N.inverseTransformation(n,XQ),XQ),c=N.multiplyByPoint(t,c,c);let f=N.getMatrix3(t,pEe);return u=$.multiply(f,u,u),l(i)&&i instanceof Ju?(i.update(c,u),i):new Ju(c,u)}function Omt(e,t,n,i){if(!N.equalsEpsilon(t,n,D.EPSILON8))return i instanceof Ju?cEe(e,t,n,i):cEe(e,t,n,void 0);let r=ie.unpack(e,0,_Ee);return i instanceof Yf?(i.rectangle=ie.clone(r,i.rectangle),i.minimumHeight=e[4],i.maximumHeight=e[5],i.computeBoundingVolumes(ee.WGS84),i):new Yf({rectangle:r,minimumHeight:e[4],maximumHeight:e[5]})}function Mmt(e,t,n){let i=h.fromElements(e[0],e[1],e[2],$Q),r=e[3];i=N.multiplyByPoint(t,i,i);let o=N.getScale(t,gEe),s=h.maximumComponent(o);return r*=s,l(n)?(n.update(i,r),n):new A_(i,r)}co.prototype.createBoundingVolume=function(e,t,n){let i=this.metadata,r;if(l(i)&&(r=hA.parseBoundingVolumeSemantic("TILE",i)),l(r)&&(e=r),!l(e))throw new oe("boundingVolume must be defined");if(tr(e,"3DTILES_bounding_volume_S2"))return new ok(e.extensions["3DTILES_bounding_volume_S2"]);let{box:o,region:s,sphere:a}=e;if(l(o)){let c=Rmt(o,t,n);return this._verticalExaggeration!==1&&lEe(c,this._verticalExaggeration,this._verticalExaggerationRelativeHeight),c}if(l(s)){let c=Omt(s,t,this._initialTransform,n);return this._verticalExaggeration===1||(c instanceof Ju?lEe(c,this._verticalExaggeration,this._verticalExaggerationRelativeHeight):(c.minimumHeight=Ar.getHeight(c.minimumHeight,this._verticalExaggeration,this._verticalExaggerationRelativeHeight),c.maximumHeight=Ar.getHeight(c.maximumHeight,this._verticalExaggeration,this._verticalExaggerationRelativeHeight),c.computeBoundingVolumes(ee.WGS84))),c}if(l(a)){let c=Mmt(a,t,n);if(this._verticalExaggeration!==1){let u=Ar.getPosition(c.center,ee.WGS84,this._verticalExaggeration,this._verticalExaggerationRelativeHeight,$Q),f=c.radius*this._verticalExaggeration;c.update(u,f)}return c}throw new oe("boundingVolume must contain a sphere, region, or box")};var Nmt=h.unpackArray(new Array(24).fill(0));function lEe(e,t,n){let i=e.boundingVolume.computeCorners(Nmt).map(o=>Ar.getPosition(o,ee.WGS84,t,n,o)),r=en.fromPoints(i,yEe);e.update(r.center,r.halfAxes)}co.prototype.updateTransform=function(e,t){e=e??N.IDENTITY;let n=N.multiplyTransformation(e,this.transform,XQ),i=!N.equals(n,this.computedTransform),r=l(t)&&(this._verticalExaggeration!==t.verticalExaggeration||this._verticalExaggerationRelativeHeight!==t.verticalExaggerationRelativeHeight);if(!i&&!r)return;i&&N.clone(n,this.computedTransform),r&&(this._verticalExaggeration=t.verticalExaggeration,this._verticalExaggerationRelativeHeight=t.verticalExaggerationRelativeHeight);let o=this._header,s=this._contentHeader;this._boundingVolume=this.createBoundingVolume(o.boundingVolume,this.computedTransform,this._boundingVolume),l(this._contentBoundingVolume)&&(this._contentBoundingVolume=this.createBoundingVolume(s.boundingVolume,this.computedTransform,this._contentBoundingVolume)),l(this._viewerRequestVolume)&&(this._viewerRequestVolume=this.createBoundingVolume(o.viewerRequestVolume,this.computedTransform,this._viewerRequestVolume)),this.updateGeometricErrorScale(),this._debugBoundingVolume=this._debugBoundingVolume&&this._debugBoundingVolume.destroy(),this._debugContentBoundingVolume=this._debugContentBoundingVolume&&this._debugContentBoundingVolume.destroy(),this._debugViewerRequestVolume=this._debugViewerRequestVolume&&this._debugViewerRequestVolume.destroy()};co.prototype.updateGeometricErrorScale=function(){let e=N.getScale(this.computedTransform,gEe),t=h.maximumComponent(e);if(this.geometricError=this._geometricError*t,!l(this.parent)){let n=this._tileset;n._scaledGeometricError=n._geometricError*t}};function Lmt(e,t,n,i){if(!i.isRender)return;let r=l(e._contentHeader)&&l(e._contentHeader.boundingVolume),o=t.debugShowBoundingVolume||t.debugShowContentBoundingVolume&&!r;if(o){let c;e._finalResolution?e.hasRenderableContent?c=z.WHITE:c=z.DARKGRAY:c=z.YELLOW,l(e._debugBoundingVolume)||(e._debugBoundingVolume=e._boundingVolume.createDebugVolume(c)),e._debugBoundingVolume.update(n);let u=e._debugBoundingVolume.getGeometryInstanceAttributes("outline");u.color=Jt.toValue(c,u.color)}else!o&&l(e._debugBoundingVolume)&&(e._debugBoundingVolume=e._debugBoundingVolume.destroy());t.debugShowContentBoundingVolume&&r?(l(e._debugContentBoundingVolume)||(e._debugContentBoundingVolume=e._contentBoundingVolume.createDebugVolume(z.BLUE)),e._debugContentBoundingVolume.update(n)):!t.debugShowContentBoundingVolume&&l(e._debugContentBoundingVolume)&&(e._debugContentBoundingVolume=e._debugContentBoundingVolume.destroy()),t.debugShowViewerRequestVolume&&l(e._viewerRequestVolume)?(l(e._debugViewerRequestVolume)||(e._debugViewerRequestVolume=e._viewerRequestVolume.createDebugVolume(z.YELLOW)),e._debugViewerRequestVolume.update(n)):!t.debugShowViewerRequestVolume&&l(e._debugViewerRequestVolume)&&(e._debugViewerRequestVolume=e._debugViewerRequestVolume.destroy());let s=t.debugColorizeTiles&&!e._debugColorizeTiles||l(t._heatmap.tilePropertyName),a=!t.debugColorizeTiles&&e._debugColorizeTiles;s?(t._heatmap.colorize(e,n),e._debugColorizeTiles=!0,e.color=e._debugColor):a&&(e._debugColorizeTiles=!1,e.color=z.WHITE),e._colorDirty&&(e._colorDirty=!1,e._content.applyDebugSettings(!0,e._color)),a&&t.makeStyleDirty()}function Fmt(e,t,n){let i=e._expiredContent;if(!e.hasMultipleContents&&l(i)){if(!e.contentReady){try{i.update(t,n)}catch{}return}e._expiredContent.destroy(),e._expiredContent=void 0}if(l(e.content))try{e.content.update(t,n)}catch(r){throw e._contentState=Rr.FAILED,r}}function Bmt(e,t){let n=t.clippingPlanes,i=0;l(n)&&e._isClipped&&n.enabled&&(i=n.clippingPlanesState),i!==e._clippingPlanesState&&(e._clippingPlanesState=i,e.clippingPlanesDirty=!0)}function kmt(e,t){let n=t.clippingPolygons,i=0;l(n)&&e._isClippedByPolygon&&n.enabled&&(i=n.clippingPolygonsState),i!==e._clippingPolygonsState&&(e._clippingPolygonsState=i,e.clippingPolygonsDirty=!0)}co.prototype.update=function(e,t,n){let{commandList:i}=t,r=i.length;Bmt(this,e),kmt(this,e),Lmt(this,e,t,n),Fmt(this,e,t);let o=i.length;this._commandsLength=o-r;for(let s=r;s<o;++s){let a=i[s],c=a.pass===Ie.TRANSLUCENT;a.depthForTranslucentClassification=c}this.clippingPlanesDirty=!1,this.clippingPolygonsDirty=!1,this.clippingPolygonsNeedRebake=!1};var uEe=[];co.prototype.process=function(e,t){!this.contentExpired&&!this.contentReady&&this._content.ready&&(Tmt(this),this._selectedFrame=0,this.lastStyleTime=0,K.now(this._loadTimestamp),this._contentState=Rr.READY,!this.hasTilesetContent&&!this.hasImplicitContent&&(e._statistics.incrementLoadCounts(this.content),++e._statistics.numberOfTilesWithContentReady,++e._statistics.numberOfLoadedTilesTotal,e._cache.add(this)));let n=t.commandList;t.commandList=uEe;try{this._content.update(e,t)}catch(i){throw this._contentState=Rr.FAILED,i}uEe.length=0,t.commandList=n};function fEe(e,t,n){let i=e*Math.pow(10,t);return parseInt(i)*Math.pow(10,n)}function lG(e,t,n){return Math.max(D.normalize(e,t,n)-D.EPSILON7,0)}co.prototype.updatePriority=function(){let e=this.tileset,t=e.preferLeaves,n=e._minimumPriority,i=e._maximumPriority,r=4,o=1,s=0,a=r,c=s+a,u=r,f=c+u,d=o,p=Math.pow(10,f),g=f+d,m=o,y=Math.pow(10,g),A=g+m,b=Math.pow(10,A),x=lG(this._depth,n.depth,i.depth);x=t?1-x:x;let E=!e.isSkippingLevelOfDetail&&this.refine===yo.REPLACE?lG(this._priorityHolder._distanceToCamera,n.distance,i.distance):lG(this._priorityReverseScreenSpaceError,n.reverseScreenSpaceError,i.reverseScreenSpaceError),v=fEe(E,a,s),S=this._priorityProgressiveResolution?0:p,I=lG(this._priorityHolder._foveatedFactor,n.foveatedFactor,i.foveatedFactor),R=fEe(I,u,c),O=this.priorityDeferred?y:0,L=e._pass===ao.PRELOAD_FLIGHT?0:b;this._priority=x+v+S+R+O+L};co.prototype.isDestroyed=function(){return!1};co.prototype.destroy=function(){return this._content=this._content&&this._content.destroy(),this._expiredContent=this._expiredContent&&!this._expiredContent.isDestroyed()&&this._expiredContent.destroy(),this._debugBoundingVolume=this._debugBoundingVolume&&this._debugBoundingVolume.destroy(),this._debugContentBoundingVolume=this._debugContentBoundingVolume&&this._debugContentBoundingVolume.destroy(),this._debugViewerRequestVolume=this._debugViewerRequestVolume&&this._debugViewerRequestVolume.destroy(),le(this)};var oh=co;function b_(e){e=e??H.EMPTY_OBJECT;let t=e.id,n=e.group,i=e.class,r=l(n.properties)?n.properties:{};this._class=i,this._properties=r,this._id=t,this._extras=n.extras,this._extensions=n.extensions}Object.defineProperties(b_.prototype,{class:{get:function(){return this._class}},id:{get:function(){return this._id}},extras:{get:function(){return this._extras}},extensions:{get:function(){return this._extensions}}});b_.prototype.hasProperty=function(e){return Yn.hasProperty(e,this._properties,this._class)};b_.prototype.hasPropertyBySemantic=function(e){return Yn.hasPropertyBySemantic(e,this._properties,this._class)};b_.prototype.getPropertyIds=function(e){return Yn.getPropertyIds(this._properties,this._class,e)};b_.prototype.getProperty=function(e){return Yn.getProperty(e,this._properties,this._class)};b_.prototype.setProperty=function(e,t){return Yn.setProperty(e,t,this._properties,this._class)};b_.prototype.getPropertyBySemantic=function(e){return Yn.getPropertyBySemantic(e,this._properties,this._class)};b_.prototype.setPropertyBySemantic=function(e,t){return Yn.setPropertyBySemantic(e,t,this._properties,this._class)};var bw=b_;function x_(e){e=e??H.EMPTY_OBJECT;let t=e.tileset,n=e.class,i=l(t.properties)?t.properties:{};this._class=n,this._properties=i,this._extras=t.extras,this._extensions=t.extensions}Object.defineProperties(x_.prototype,{class:{get:function(){return this._class}},extras:{get:function(){return this._extras}},extensions:{get:function(){return this._extensions}}});x_.prototype.hasProperty=function(e){return Yn.hasProperty(e,this._properties,this._class)};x_.prototype.hasPropertyBySemantic=function(e){return Yn.hasPropertyBySemantic(e,this._properties,this._class)};x_.prototype.getPropertyIds=function(e){return Yn.getPropertyIds(this._properties,this._class,e)};x_.prototype.getProperty=function(e){return Yn.getProperty(e,this._properties,this._class)};x_.prototype.setProperty=function(e,t){return Yn.setProperty(e,t,this._properties,this._class)};x_.prototype.getPropertyBySemantic=function(e){return Yn.getPropertyBySemantic(e,this._properties,this._class)};x_.prototype.setPropertyBySemantic=function(e,t){return Yn.setPropertyBySemantic(e,t,this._properties,this._class)};var sk=x_;function AEe(e){e=e??H.EMPTY_OBJECT;let t=e.metadataJson,n=e.schema,i=t.metadata??t.tileset,r;l(i)&&(r=new sk({tileset:i,class:n.classes[i.class]}));let o=[],s=[],a=t.groups;if(Array.isArray(a)){let c=a.length;for(let u=0;u<c;u++){let f=a[u];s.push(new bw({group:f,class:n.classes[f.class]}))}}else if(l(a)){o=Object.keys(a).sort();let c=o.length;for(let u=0;u<c;u++){let f=o[u];if(a.hasOwnProperty(f)){let d=a[f];s.push(new bw({id:f,group:a[f],class:n.classes[d.class]}))}}}this._schema=n,this._groups=s,this._groupIds=o,this._tileset=r,this._statistics=t.statistics,this._extras=t.extras,this._extensions=t.extensions}Object.defineProperties(AEe.prototype,{schema:{get:function(){return this._schema}},groups:{get:function(){return this._groups}},groupIds:{get:function(){return this._groupIds}},tileset:{get:function(){return this._tileset}},statistics:{get:function(){return this._statistics}},extras:{get:function(){return this._extras}},extensions:{get:function(){return this._extensions}}});var JT=AEe;var bEe={},Umt=new h;bEe.checkChildrenWithinParent=function(e){let t=e.children,n=t.length,i=e.boundingVolume;if(i instanceof Ju||i instanceof Yf){let r=i._orientedBoundingBox;e._optimChildrenWithinParent=th.USE_OPTIMIZATION;for(let o=0;o<n;++o){let a=t[o].boundingVolume;if(!(a instanceof Ju||a instanceof Yf)){e._optimChildrenWithinParent=th.SKIP_OPTIMIZATION;break}let c=a._orientedBoundingBox,u=h.subtract(c.center,r.center,Umt),f=h.magnitude(u);h.divideByScalar(u,f,u);let d=Math.abs(r.halfAxes[0]*u.x)+Math.abs(r.halfAxes[1]*u.y)+Math.abs(r.halfAxes[2]*u.z)+Math.abs(r.halfAxes[3]*u.x)+Math.abs(r.halfAxes[4]*u.y)+Math.abs(r.halfAxes[5]*u.z)+Math.abs(r.halfAxes[6]*u.x)+Math.abs(r.halfAxes[7]*u.y)+Math.abs(r.halfAxes[8]*u.z),p=Math.abs(c.halfAxes[0]*u.x)+Math.abs(c.halfAxes[1]*u.y)+Math.abs(c.halfAxes[2]*u.z)+Math.abs(c.halfAxes[3]*u.x)+Math.abs(c.halfAxes[4]*u.y)+Math.abs(c.halfAxes[5]*u.z)+Math.abs(c.halfAxes[6]*u.x)+Math.abs(c.halfAxes[7]*u.y)+Math.abs(c.halfAxes[8]*u.z);if(d<=p+f){e._optimChildrenWithinParent=th.SKIP_OPTIMIZATION;break}}}return e._optimChildrenWithinParent===th.USE_OPTIMIZATION};var ak=bEe;function ck(){this.head=void 0,this.tail=void 0,this._length=0}Object.defineProperties(ck.prototype,{length:{get:function(){return this._length}}});function zmt(e,t,n){this.item=e,this.previous=t,this.next=n}ck.prototype.add=function(e){let t=new zmt(e,this.tail,void 0);return l(this.tail)?(this.tail.next=t,this.tail=t):(this.head=t,this.tail=t),++this._length,t};function xEe(e,t){l(t.previous)&&l(t.next)?(t.previous.next=t.next,t.next.previous=t.previous):l(t.previous)?(t.previous.next=void 0,e.tail=t.previous):l(t.next)?(t.next.previous=void 0,e.head=t.next):(e.head=void 0,e.tail=void 0),t.next=void 0,t.previous=void 0}ck.prototype.remove=function(e){l(e)&&(xEe(this,e),--this._length)};ck.prototype.splice=function(e,t){if(e===t)return;xEe(this,t);let n=e.next;e.next=t,this.tail===e?this.tail=t:n.previous=t,t.next=n,t.previous=e};var lk=ck;function zA(){this._list=new lk,this._sentinel=this._list.add(),this._trimTiles=!1}zA.prototype.reset=function(){this._list.splice(this._list.tail,this._sentinel)};zA.prototype.touch=function(e){let t=e.cacheNode;l(t)&&this._list.splice(this._sentinel,t)};zA.prototype.add=function(e){l(e.cacheNode)||(e.cacheNode=this._list.add(e))};zA.prototype.forEachLoadedTile=function(e){for(let t=this._list.head;l(t);t=t.next)l(t.item)&&e(t.item)};zA.prototype.unloadTile=function(e,t,n){let i=t.cacheNode;l(i)&&(this._list.remove(i),t.cacheNode=void 0,n(e,t))};zA.prototype.unloadTiles=function(e,t){let n=this._trimTiles;this._trimTiles=!1;let i=this._list,r=this._sentinel,o=i.head;for(;o!==r&&(e.totalMemoryUsageInBytes>e.cacheBytes||n);){let s=o.item;o=o.next,this.unloadTile(e,s,t)}};zA.prototype.trim=function(){this._trimTiles=!0};var uk=zA;function uG(e){this.tilePropertyName=e,this._minimum=Number.MAX_VALUE,this._maximum=-Number.MAX_VALUE,this._previousMinimum=Number.MAX_VALUE,this._previousMaximum=-Number.MAX_VALUE,this._referenceMinimum={},this._referenceMaximum={}}function ZQ(e,t){let n;return t==="_loadTimestamp"?n=K.toDate(e).getTime():n=e,n}uG.prototype.setReferenceMinimumMaximum=function(e,t,n){this._referenceMinimum[n]=ZQ(e,n),this._referenceMaximum[n]=ZQ(t,n)};function Vmt(e,t){let n=e.tilePropertyName;if(l(n)){let i=ZQ(t[n],n);return l(i)?(e._maximum=Math.max(i,e._maximum),e._minimum=Math.min(i,e._minimum),i):(e.tilePropertyName=void 0,i)}}var JQ=[new z(.1,.1,.1,1),new z(.153,.278,.878,1),new z(.827,.231,.49,1),new z(.827,.188,.22,1),new z(1,.592,.259,1),new z(1,.843,0,1)];uG.prototype.colorize=function(e,t){let n=this.tilePropertyName;if(!l(n)||!e.contentAvailable||e._selectedFrame!==t.frameNumber)return;let i=Vmt(this,e),r=this._previousMinimum,o=this._previousMaximum;if(r===Number.MAX_VALUE||o===-Number.MAX_VALUE)return;let s=o-r+D.EPSILON7,c=D.clamp(i-r,0,s)/s,u=JQ.length-1,f=c*u,d=Math.floor(f),p=Math.ceil(f),g=f-d,m=JQ[d],y=JQ[p],A=z.clone(z.WHITE);A.red=D.lerp(m.red,y.red,g),A.green=D.lerp(m.green,y.green,g),A.blue=D.lerp(m.blue,y.blue,g),e._debugColor=A};uG.prototype.resetMinimumMaximum=function(){let e=this.tilePropertyName;if(l(e)){let t=this._referenceMinimum[e],n=this._referenceMaximum[e],i=l(t)&&l(n);this._previousMinimum=i?t:this._minimum,this._previousMaximum=i?n:this._maximum,this._minimum=Number.MAX_VALUE,this._maximum=-Number.MAX_VALUE}};var fk=uG;function xw(){this.selected=0,this.visited=0,this.numberOfCommands=0,this.numberOfAttemptedRequests=0,this.numberOfPendingRequests=0,this.numberOfTilesProcessing=0,this.numberOfTilesWithContentReady=0,this.numberOfTilesTotal=0,this.numberOfLoadedTilesTotal=0,this.numberOfFeaturesSelected=0,this.numberOfFeaturesLoaded=0,this.numberOfPointsSelected=0,this.numberOfPointsLoaded=0,this.numberOfTrianglesSelected=0,this.numberOfTilesStyled=0,this.numberOfFeaturesStyled=0,this.numberOfTilesCulledWithChildrenUnion=0,this.geometryByteLength=0,this.texturesByteLength=0,this.texturesReferenceCounterById={},this.batchTableByteLength=0}xw.prototype.clear=function(){this.selected=0,this.visited=0,this.numberOfCommands=0,this.numberOfAttemptedRequests=0,this.numberOfFeaturesSelected=0,this.numberOfPointsSelected=0,this.numberOfTrianglesSelected=0,this.numberOfTilesStyled=0,this.numberOfFeaturesStyled=0,this.numberOfTilesCulledWithChildrenUnion=0};xw.prototype.incrementSelectionCounts=function(e){this.numberOfFeaturesSelected+=e.featuresLength,this.numberOfPointsSelected+=e.pointsLength,this.numberOfTrianglesSelected+=e.trianglesLength;let t=e.innerContents;if(l(t)){let n=t.length;for(let i=0;i<n;++i)this.incrementSelectionCounts(t[i])}};xw.prototype.incrementLoadCounts=function(e){if(this.numberOfFeaturesLoaded+=e.featuresLength,this.numberOfPointsLoaded+=e.pointsLength,this.geometryByteLength+=e.geometryByteLength,this.batchTableByteLength+=e.batchTableByteLength,!(e instanceof Gf))this.texturesByteLength+=e.texturesByteLength;else{let n=e.getTextureIds();for(let i of n){let r=this.texturesReferenceCounterById[i]??0;if(r===0){let o=e.getTextureByteLengthById(i);this.texturesByteLength+=o}this.texturesReferenceCounterById[i]=r+1}}let t=e.innerContents;if(l(t)){let n=t.length;for(let i=0;i<n;++i)this.incrementLoadCounts(t[i])}};xw.prototype.decrementLoadCounts=function(e){if(this.numberOfFeaturesLoaded-=e.featuresLength,this.numberOfPointsLoaded-=e.pointsLength,this.geometryByteLength-=e.geometryByteLength,this.batchTableByteLength-=e.batchTableByteLength,!(e instanceof Gf))this.texturesByteLength-=e.texturesByteLength;else{let n=e.getTextureIds();for(let i of n){let r=this.texturesReferenceCounterById[i];if(r===1){delete this.texturesReferenceCounterById[i];let o=e.getTextureByteLengthById(i);this.texturesByteLength-=o}else this.texturesReferenceCounterById[i]=r-1}}let t=e.innerContents;if(l(t)){let n=t.length;for(let i=0;i<n;++i)this.decrementLoadCounts(t[i])}};xw.clone=function(e,t){t.selected=e.selected,t.visited=e.visited,t.numberOfCommands=e.numberOfCommands,t.numberOfAttemptedRequests=e.numberOfAttemptedRequests,t.numberOfPendingRequests=e.numberOfPendingRequests,t.numberOfTilesProcessing=e.numberOfTilesProcessing,t.numberOfTilesWithContentReady=e.numberOfTilesWithContentReady,t.numberOfTilesTotal=e.numberOfTilesTotal,t.numberOfFeaturesSelected=e.numberOfFeaturesSelected,t.numberOfFeaturesLoaded=e.numberOfFeaturesLoaded,t.numberOfPointsSelected=e.numberOfPointsSelected,t.numberOfPointsLoaded=e.numberOfPointsLoaded,t.numberOfTrianglesSelected=e.numberOfTrianglesSelected,t.numberOfTilesStyled=e.numberOfTilesStyled,t.numberOfFeaturesStyled=e.numberOfFeaturesStyled,t.numberOfTilesCulledWithChildrenUnion=e.numberOfTilesCulledWithChildrenUnion,t.geometryByteLength=e.geometryByteLength,t.texturesByteLength=e.texturesByteLength,t.batchTableByteLength=e.batchTableByteLength};var Pm=xw;function dk(){this._style=void 0,this._styleDirty=!1,this._lastStyleTime=0}Object.defineProperties(dk.prototype,{style:{get:function(){return this._style},set:function(e){e!==this._style&&(this._style=e,this._styleDirty=!0)}}});dk.prototype.makeDirty=function(){this._styleDirty=!0};dk.prototype.resetDirty=function(){this._styleDirty=!1};dk.prototype.applyStyle=function(e){if(!l(e.root)||l(this._style)&&!this._style._ready)return;let t=this._styleDirty;t&&++this._lastStyleTime;let n=this._lastStyleTime,i=e._statistics,r=t?e._selectedTiles:e._selectedTilesToStyle,o=r.length;for(let s=0;s<o;++s){let a=r[s];if(a.lastStyleTime!==n){let c=a.content;a.lastStyleTime=n,c.applyStyle(this._style),i.numberOfFeaturesStyled+=c.featuresLength,++i.numberOfTilesStyled}}};var hk=dk;function TEe(e,t,n){this.context=e,this.commandList=[],this.panoramaCommandList=[],this.shadowMaps=[],this.brdfLutGenerator=void 0,this.environmentMap=void 0,this.sphericalHarmonicCoefficients=void 0,this.specularEnvironmentMaps=void 0,this.specularEnvironmentMapsMaximumLOD=void 0,this.mode=re.SCENE3D,this.morphTime=re.getMorphTime(re.SCENE3D),this.frameNumber=0,this.newFrame=!1,this.time=void 0,this.jobScheduler=n,this.mapProjection=void 0,this.camera=void 0,this.cameraUnderground=!1,this.globeTranslucencyState=void 0,this.cullingVolume=void 0,this.occluder=void 0,this.maximumScreenSpaceError=void 0,this.pixelRatio=1,this.passes={render:!1,pick:!1,pickVoxel:!1,snap:!1,depth:!1,postProcess:!1,offscreen:!1},this.creditDisplay=t,this.afterRender=[],this.scene3DOnly=!1,this.fog={enabled:!1,renderable:!1,density:void 0,visualDensityScalar:void 0,sse:void 0,minimumBrightness:void 0},this.atmosphere=void 0,this.verticalExaggeration=1,this.verticalExaggerationRelativeHeight=0,this.shadowState={shadowsEnabled:!0,shadowMaps:[],lightShadowMaps:[],nearPlane:1,farPlane:5e3,closestObjectSize:1e3,lastDirtyTime:0,outOfView:!0},this.splitPosition=0,this.frustumSplits=[],this.backgroundColor=void 0,this.light=void 0,this.minimumDisableDepthTestDistance=void 0,this.invertClassification=!1,this.invertClassificationColor=void 0,this.useLogDepth=!1,this.tilesetPassState=void 0,this.minimumTerrainHeight=0,this.pickingMetadata=!1,this.pickedMetadataInfo=void 0,this.edgeVisibilityRequested=!1,this.planarFillRequested=!1}TEe.maximumFrameNumber=15e6;var VA=TEe;function jmt(e,t,n){let i=tr(t,"3DTILES_implicit_tiling")?t.extensions["3DTILES_implicit_tiling"]:t.implicitTiling;this.baseResource=e,this.geometricError=t.geometricError,this.metadataSchema=n;let r=t.boundingVolume;if(!l(r.box)&&!l(r.region)&&!tr(r,"3DTILES_bounding_volume_S2")&&!tr(r,"3DTILES_bounding_volume_cylinder"))throw new oe("Only box, region, 3DTILES_bounding_volume_S2, and 3DTILES_bounding_volume_cylinder are supported for implicit tiling");this.boundingVolume=r,this.refine=t.refine,this.subtreeUriTemplate=new De({url:i.subtrees.uri}),this.contentUriTemplates=[],this.contentHeaders=[];let o=Hmt(t);for(let s=0;s<o.length;s++){let a=o[s];this.contentHeaders.push(Je(a,!0));let c=new De({url:a.uri});this.contentUriTemplates.push(c)}this.contentCount=this.contentHeaders.length,this.tileHeader=Gmt(t),this.subdivisionScheme=Gs[i.subdivisionScheme],this.branchingFactor=Gs.getBranchingFactor(this.subdivisionScheme),this.subtreeLevels=i.subtreeLevels,l(i.availableLevels)?this.availableLevels=i.availableLevels:this.availableLevels=i.maximumLevel+1}function Hmt(e){if(tr(e,"3DTILES_multiple_contents")){let t=e.extensions["3DTILES_multiple_contents"];return l(t.contents)?t.contents:t.content}return l(e.contents)?e.contents:l(e.content)?[e.content]:[]}function Gmt(e){let t=Je(e,!0);return l(t.extensions)&&(delete t.extensions["3DTILES_implicit_tiling"],delete t.extensions["3DTILES_multiple_contents"],Object.keys(t.extensions).length===0&&delete t.extensions),delete t.implicitTiling,delete t.contents,delete t.content,t}var r0=jmt;var mk={};function EEe(e){return e=(e^e<<8)&16711935,e=(e^e<<4)&252645135,e=(e^e<<2)&858993459,e=(e^e<<1)&1431655765,e}function QQ(e){return e=(e^e<<16)&50331903,e=(e^e<<8)&50393103,e=(e^e<<4)&51130563,e=(e^e<<2)&153391689,e}function CEe(e){return e&=1431655765,e=(e^e>>1)&858993459,e=(e^e>>2)&252645135,e=(e^e>>4)&16711935,e=(e^e>>8)&65535,e}function eee(e){return e&=153391689,e=(e^e>>2)&51130563,e=(e^e>>4)&50393103,e=(e^e>>8)&4278190335,e=(e^e>>16)&1023,e}mk.encode2D=function(e,t){return(EEe(e)|EEe(t)<<1)>>>0};mk.decode2D=function(e,t){return l(t)||(t=new Array(2)),t[0]=CEe(e),t[1]=CEe(e>>1),t};mk.encode3D=function(e,t,n){return QQ(e)|QQ(t)<<1|QQ(n)<<2};mk.decode3D=function(e,t){return l(t)||(t=new Array(3)),t[0]=eee(e),t[1]=eee(e>>1),t[2]=eee(e>>2),t};var jA=mk;function To(e){this.subdivisionScheme=e.subdivisionScheme,this.subtreeLevels=e.subtreeLevels,this.level=e.level,this.x=e.x,this.y=e.y,this.z=void 0,e.subdivisionScheme===Gs.OCTREE&&(this.z=e.z)}Object.defineProperties(To.prototype,{childIndex:{get:function(){let e=0;return e|=this.x&1,e|=(this.y&1)<<1,this.subdivisionScheme===Gs.OCTREE&&(e|=(this.z&1)<<2),e}},mortonIndex:{get:function(){return this.subdivisionScheme===Gs.OCTREE?jA.encode3D(this.x,this.y,this.z):jA.encode2D(this.x,this.y)}},tileIndex:{get:function(){let e=this.subdivisionScheme===Gs.OCTREE?((1<<3*this.level)-1)/7:((1<<2*this.level)-1)/3,t=this.mortonIndex;return e+t}}});To.prototype.getDescendantCoordinates=function(e){let t=this.level+e.level,n=(this.x<<e.level)+e.x,i=(this.y<<e.level)+e.y;if(this.subdivisionScheme===Gs.OCTREE){let r=(this.z<<e.level)+e.z;return new To({subdivisionScheme:this.subdivisionScheme,subtreeLevels:this.subtreeLevels,level:t,x:n,y:i,z:r})}return new To({subdivisionScheme:this.subdivisionScheme,subtreeLevels:this.subtreeLevels,level:t,x:n,y:i})};To.prototype.getAncestorCoordinates=function(e){let t=1<<e,n=this.level-e,i=Math.floor(this.x/t),r=Math.floor(this.y/t);if(this.subdivisionScheme===Gs.OCTREE){let o=Math.floor(this.z/t);return new To({subdivisionScheme:this.subdivisionScheme,subtreeLevels:this.subtreeLevels,level:n,x:i,y:r,z:o})}return new To({subdivisionScheme:this.subdivisionScheme,subtreeLevels:this.subtreeLevels,level:n,x:i,y:r})};To.prototype.getOffsetCoordinates=function(e){let t=e.level-this.level,n=1<<t,i=e.x%n,r=e.y%n;if(this.subdivisionScheme===Gs.OCTREE){let o=e.z%n;return new To({subdivisionScheme:this.subdivisionScheme,subtreeLevels:this.subtreeLevels,level:t,x:i,y:r,z:o})}return new To({subdivisionScheme:this.subdivisionScheme,subtreeLevels:this.subtreeLevels,level:t,x:i,y:r})};To.prototype.getChildCoordinates=function(e){let t=this.level+1,n=2*this.x+e%2,i=2*this.y+Math.floor(e/2)%2;if(this.subdivisionScheme===Gs.OCTREE){let r=2*this.z+Math.floor(e/4)%2;return new To({subdivisionScheme:this.subdivisionScheme,subtreeLevels:this.subtreeLevels,level:t,x:n,y:i,z:r})}return new To({subdivisionScheme:this.subdivisionScheme,subtreeLevels:this.subtreeLevels,level:t,x:n,y:i})};To.prototype.getSubtreeCoordinates=function(){return this.getAncestorCoordinates(this.level%this.subtreeLevels)};To.prototype.getParentSubtreeCoordinates=function(){return this.getAncestorCoordinates(this.level%this.subtreeLevels+this.subtreeLevels)};To.prototype.isAncestor=function(e){let t=e.level-this.level;if(t<=0)return!1;let n=e.x>>t,i=e.y>>t,r=this.x===n,o=this.y===i;if(this.subdivisionScheme===Gs.OCTREE){let s=e.z>>t,a=this.z===s;return r&&o&&a}return r&&o};To.prototype.isEqual=function(e){return this.subdivisionScheme===e.subdivisionScheme&&this.subtreeLevels===e.subtreeLevels&&this.level===e.level&&this.x===e.x&&this.y===e.y&&(this.subdivisionScheme===Gs.OCTREE?this.z===e.z:!0)};To.prototype.isImplicitTilesetRoot=function(){return this.level===0};To.prototype.isSubtreeRoot=function(){return this.level%this.subtreeLevels===0};To.prototype.isBottomOfSubtree=function(){return this.level%this.subtreeLevels===this.subtreeLevels-1};To.prototype.getTemplateValues=function(){let e={level:this.level,x:this.x,y:this.y};return this.subdivisionScheme===Gs.OCTREE&&(e.z=this.z),e};var vEe=[0,0,0];To.fromMortonIndex=function(e,t,n,i){let r;return e===Gs.OCTREE?(r=jA.decode3D(i,vEe),new To({subdivisionScheme:e,subtreeLevels:t,level:n,x:r[0],y:r[1],z:r[2]})):(r=jA.decode2D(i,vEe),new To({subdivisionScheme:e,subtreeLevels:t,level:n,x:r[0],y:r[1]}))};To.fromTileIndex=function(e,t,n){let i,r,o;return e===Gs.OCTREE?(i=Math.floor(D.log2(7*n+1)/3),r=((1<<3*i)-1)/7,o=n-r):(i=Math.floor(D.log2(3*n+1)/2),r=((1<<2*i)-1)/3,o=n-r),To.fromMortonIndex(e,t,i,o)};var o0=To;function T_(){}T_.selectTiles=function(e,t){pe.throwInstantiationError()};T_.sortChildrenByDistanceToCamera=function(e,t){return t._distanceToCamera===0&&e._distanceToCamera===0?t._centerZDepth-e._centerZDepth:t._distanceToCamera-e._distanceToCamera};T_.canTraverse=function(e){return e.children.length===0?!1:e.hasTilesetContent||e.hasImplicitContent?!e.contentExpired:e._screenSpaceError>e.tileset.memoryAdjustedScreenSpaceError};T_.selectTile=function(e,t){if(e.contentVisibility(t)===$t.OUTSIDE)return;e._wasSelectedLastFrame=!0;let{content:n,tileset:i}=e;n.featurePropertiesDirty?(n.featurePropertiesDirty=!1,e.lastStyleTime=0,i._selectedTilesToStyle.push(e)):e._selectedFrame<t.frameNumber-1&&(i._selectedTilesToStyle.push(e),e._wasSelectedLastFrame=!1),e._selectedFrame=t.frameNumber,i._selectedTiles.push(e)};T_.visitTile=function(e,t){++e.tileset._statistics.visited,e._visitedFrame=t.frameNumber};T_.touchTile=function(e,t){e._touchedFrame!==t.frameNumber&&(e.tileset._cache.touch(e),e._touchedFrame=t.frameNumber)};T_.loadTile=function(e,t){let{tileset:n}=e;if(e._requestedFrame===t.frameNumber||!e.hasUnloadedRenderableContent&&!e.contentExpired||!Wmt(e,t))return;let i=t.camera.timeSinceMoved<n.foveatedTimeDelay;e.priorityDeferred&&i||(e._requestedFrame=t.frameNumber,n._requestedTiles.push(e))};function Wmt(e,t){let{tileset:n}=e;if(!n._cullRequestsWhileMoving)return!0;let{positionWCDeltaMagnitude:i,positionWCDeltaMagnitudeLastFrame:r}=t.camera,o=i!==0?i:r,s=Math.max(e.boundingSphere.radius*2,1);return n.cullRequestsWhileMovingMultiplier*o/s<1}T_.updateTile=function(e,t){SEe(e,t),e.updateExpiration(),e._wasMinPriorityChild=!1,e._priorityHolder=e,Xmt(e),e._shouldSelect=!1,e._finalResolution=!0};function SEe(e,t){if(e.updateVisibility(t),!e.isVisible)return;let n=e.children.length>0;if((e.hasTilesetContent||e.hasImplicitContent)&&n){let o=e.children[0];SEe(o,t),e._visible=o._visible;return}if(qmt(e,t)){e._visible=!1;return}let i=e.refine===yo.REPLACE,r=e._optimChildrenWithinParent===th.USE_OPTIMIZATION;if(i&&r&&n&&!Ymt(e,t)){++e.tileset._statistics.numberOfTilesCulledWithChildrenUnion,e._visible=!1;return}}function qmt(e,t){let{parent:n,tileset:i}=e;return!l(n)||n.hasTilesetContent||n.hasImplicitContent||n.refine!==yo.ADD?!1:e.getScreenSpaceError(t,!0)<=i.memoryAdjustedScreenSpaceError}function Ymt(e,t){let n=!1,i=e.children;for(let r=0;r<i.length;++r){let o=i[r];o.updateVisibility(t),n=n||o.isVisible}return n}function Xmt(e){let t=e.tileset._minimumPriority,n=e.tileset._maximumPriority,i=e._priorityHolder;n.distance=Math.max(i._distanceToCamera,n.distance),t.distance=Math.min(i._distanceToCamera,t.distance),n.depth=Math.max(e._depth,n.depth),t.depth=Math.min(e._depth,t.depth),n.foveatedFactor=Math.max(i._foveatedFactor,n.foveatedFactor),t.foveatedFactor=Math.min(i._foveatedFactor,t.foveatedFactor),n.reverseScreenSpaceError=Math.max(e._priorityReverseScreenSpaceError,n.reverseScreenSpaceError),t.reverseScreenSpaceError=Math.min(e._priorityReverseScreenSpaceError,t.reverseScreenSpaceError)}var qa=T_;function wEe(){}var pk={stack:new Zl,stackMaximumLength:0};wEe.selectTiles=function(e,t){e._selectedTiles.length=0,e._requestedTiles.length=0,e.hasMixedContent=!1;let n=!0,i=e.root;if(i.updateVisibility(t),!i.isVisible)return n;let{touchTile:r,visitTile:o}=qa,s=pk.stack;for(s.push(i);s.length>0;){pk.stackMaximumLength=Math.max(pk.stackMaximumLength,s.length);let a=s.pop(),c=a.refine===yo.ADD,u=a.refine===yo.REPLACE,f=Kmt(a);f&&$mt(a,s,t),(c||u&&!f)&&(Jmt(e,a),r(a,t),Zmt(a,t),a.hasRenderableContent&&!a.contentAvailable&&(n=!1)),o(a,t)}return pk.stack.trim(pk.stackMaximumLength),n};function Kmt(e){return e.children.length===0?!1:e.hasTilesetContent||e.hasImplicitContent?!e.contentExpired:(e.hasEmptyContent,!0)}function $mt(e,t,n){let{children:i}=e;for(let r=0;r<i.length;++r){let o=i[r];o.updateVisibility(n),o.isVisible&&t.push(o)}}function Jmt(e,t){(t.hasUnloadedRenderableContent||t.contentExpired)&&(t._priority=0,e._requestedTiles.push(t))}function Zmt(e,t){e.contentAvailable&&e.contentVisibility(t)!==$t.OUTSIDE&&e.tileset._selectedTiles.push(e)}var gk=wEe;function IEe(){}var _k={stack:new Zl,stackMaximumLength:0},yk={stack:new Zl,stackMaximumLength:0};IEe.selectTiles=function(e,t){if(e._requestedTiles.length=0,e.debugFreezeFrame)return;e._selectedTiles.length=0,e._selectedTilesToStyle.length=0,e._emptyTiles.length=0,e.hasMixedContent=!1;let n=e.root;if(qa.updateTile(n,t),!n.isVisible||n.getScreenSpaceError(t,!0)<=e.memoryAdjustedScreenSpaceError)return;ept(n,t),_k.stack.trim(_k.stackMaximumLength),yk.stack.trim(yk.stackMaximumLength);let i=e._requestedTiles;for(let r=0;r<i.length;++r)i[r].updatePriority()};function tee(e,t){e.contentAvailable&&qa.selectTile(e,t)}function Qmt(e,t,n){let i=e.refine===yo.REPLACE,{tileset:r,children:o}=e,{updateTile:s,loadTile:a,touchTile:c}=qa;for(let m=0;m<o.length;++m)s(o[m],n);o.sort(qa.sortChildrenByDistanceToCamera);let u=i&&e.hasRenderableContent,f=!0,d=!1,p=-1,g=Number.MAX_VALUE;for(let m=0;m<o.length;++m){let y=o[m];if(y.isVisible?(t.push(y),y._foveatedFactor<g&&(p=m,g=y._foveatedFactor),d=!0):(u||r.loadSiblings)&&(y._foveatedFactor<g&&(p=m,g=y._foveatedFactor),a(y,n),c(y,n)),u){let A;y._inRequestVolume?y.hasRenderableContent?A=y.contentAvailable:A=tpt(y,n):A=!1,f=f&&A}}if(d||(f=!1),p!==-1&&i){let m=o[p];m._wasMinPriorityChild=!0;let y=(e._wasMinPriorityChild||e===r.root)&&g<=e._priorityHolder._foveatedFactor?e._priorityHolder:e;y._foveatedFactor=Math.min(m._foveatedFactor,y._foveatedFactor),y._distanceToCamera=Math.min(m._distanceToCamera,y._distanceToCamera);for(let A=0;A<o.length;++A)o[A]._priorityHolder=y}return f}function ept(e,t){let{tileset:n}=e,{canTraverse:i,loadTile:r,visitTile:o,touchTile:s}=qa,a=_k.stack;for(a.push(e);a.length>0;){_k.stackMaximumLength=Math.max(_k.stackMaximumLength,a.length);let c=a.pop(),u=c.parent,f=!l(u)||u._refines;c._refines=i(c)?Qmt(c,a,t)&&f:!1;let d=!c._refines&&f;c.hasRenderableContent?c.refine===yo.ADD?(tee(c,t),r(c,t)):c.refine===yo.REPLACE&&(r(c,t),d&&tee(c,t)):(n._emptyTiles.push(c),r(c,t),d&&tee(c,t)),o(c,t),s(c,t)}}function tpt(e,t){let{canTraverse:n,updateTile:i,loadTile:r,touchTile:o}=qa,s=e.tileset.hasExtension("3DTILES_content_gltf_vector"),a=!0,c=yk.stack;for(c.push(e);c.length>0;){yk.stackMaximumLength=Math.max(yk.stackMaximumLength,c.length);let u=c.pop(),f=u.children,d=f.length,p=!u.hasRenderableContent&&n(u);if((s?u.hasRenderableContent:!p)&&!u.contentAvailable&&(a=!1),i(u,t),u.isVisible||(r(u,t),o(u,t)),p)for(let m=0;m<d;++m){let y=f[m];c.push(y)}}return e.hasEmptyContent||a}var Ak=IEe;function PEe(){}var bk={stack:new Zl,stackMaximumLength:0},xk={stack:new Zl,stackMaximumLength:0},E_={stack:new Zl,stackMaximumLength:0,ancestorStack:new Zl,ancestorStackMaximumLength:0},npt=2;PEe.selectTiles=function(e,t){if(e._requestedTiles.length=0,e.debugFreezeFrame)return;e._selectedTiles.length=0,e._selectedTilesToStyle.length=0,e._emptyTiles.length=0,e.hasMixedContent=!1;let n=e.root;if(qa.updateTile(n,t),!n.isVisible||n.getScreenSpaceError(t,!0)<=e.memoryAdjustedScreenSpaceError)return;cpt(n,t),lpt(n,t),bk.stack.trim(bk.stackMaximumLength),xk.stack.trim(xk.stackMaximumLength),E_.stack.trim(E_.stackMaximumLength),E_.ancestorStack.trim(E_.ancestorStackMaximumLength);let i=e._requestedTiles;for(let r=0;r<i.length;++r)i[r].updatePriority()};function ipt(e,t){let{updateTile:n,touchTile:i,selectTile:r}=qa,o=xk.stack;for(o.push(e);o.length>0;){xk.stackMaximumLength=Math.max(xk.stackMaximumLength,o.length);let a=o.pop().children;for(let c=0;c<a.length;++c){let u=a[c];u.isVisible&&(u.contentAvailable?(n(u,t),i(u,t),r(u,t)):u._depth-e._depth<npt&&o.push(u))}}}function fG(e,t){let n=e.contentAvailable?e:e._ancestorWithContentAvailable;l(n)?n._shouldSelect=!0:ipt(e,t)}function rpt(e,t){e._ancestorWithContent=void 0,e._ancestorWithContentAvailable=void 0;let{parent:n}=e;if(!l(n))return;let i=!n.hasUnloadedRenderableContent||n._requestedFrame===t.frameNumber;e._ancestorWithContent=i?n:n._ancestorWithContent,e._ancestorWithContentAvailable=n.contentAvailable?n:n._ancestorWithContentAvailable}function opt(e,t){let n=t._ancestorWithContent;return!e.immediatelyLoadDesiredLevelOfDetail&&(t._priorityProgressiveResolutionScreenSpaceErrorLeaf||l(n)&&t._screenSpaceError<n._screenSpaceError/e.skipScreenSpaceErrorFactor&&t._depth>n._depth+e.skipLevels)}function spt(e,t,n){let{tileset:i,children:r}=e,{updateTile:o,loadTile:s,touchTile:a}=qa;for(let u=0;u<r.length;++u)o(r[u],n);r.sort(qa.sortChildrenByDistanceToCamera);let c=!1;for(let u=0;u<r.length;++u){let f=r[u];f.isVisible?(t.push(f),c=!0):i.loadSiblings&&(s(f,n),a(f,n))}return c}function apt(e,t){let{tileset:n}=e;return n.immediatelyLoadDesiredLevelOfDetail?!1:l(e._ancestorWithContent)?e._screenSpaceError===0?e.parent._screenSpaceError>t:e._screenSpaceError>t:!0}function cpt(e,t){let{tileset:n}=e,i=n.immediatelyLoadDesiredLevelOfDetail?Number.MAX_VALUE:Math.max(n.baseScreenSpaceError,n.memoryAdjustedScreenSpaceError),{canTraverse:r,loadTile:o,visitTile:s,touchTile:a}=qa,c=bk.stack;for(c.push(e);c.length>0;){bk.stackMaximumLength=Math.max(bk.stackMaximumLength,c.length);let u=c.pop();rpt(u,t);let f=u.parent,d=!l(f)||f._refines;u._refines=r(u)?spt(u,c,t)&&d:!1;let p=!u._refines&&d;u.hasRenderableContent?u.refine===yo.ADD?(fG(u,t),o(u,t)):u.refine===yo.REPLACE&&(apt(u,i)?(o(u,t),p&&fG(u,t)):p?(fG(u,t),o(u,t)):opt(n,u)&&o(u,t)):(n._emptyTiles.push(u),o(u,t),p&&fG(u,t)),s(u,t),a(u,t)}}function lpt(e,t){let{selectTile:n,canTraverse:i}=qa,{stack:r,ancestorStack:o}=E_,s;for(r.push(e);r.length>0||o.length>0;){if(E_.stackMaximumLength=Math.max(E_.stackMaximumLength,r.length),E_.ancestorStackMaximumLength=Math.max(E_.ancestorStackMaximumLength,o.length),o.length>0){let u=o.peek();if(u._stackLength===r.length){o.pop(),u!==s&&(u._finalResolution=!1),n(u,t);continue}}let a=r.pop();if(!l(a))continue;let c=i(a);if(a._shouldSelect)if(a.refine===yo.ADD)n(a,t);else{if(a._selectionDepth=o.length,a._selectionDepth>0&&(a.tileset.hasMixedContent=!0),s=a,!c){n(a,t);continue}o.push(a),a._stackLength=r.length}if(c){let u=a.children;for(let f=0;f<u.length;++f){let d=u[f];d.isVisible&&r.push(d)}}}}var Tk=PEe;function wa(){this._layers=[],this.layerAdded=new be,this.layerRemoved=new be,this.layerMoved=new be,this.layerShownOrHidden=new be}Object.defineProperties(wa.prototype,{length:{get:function(){return this._layers.length}}});wa.prototype.add=function(e,t){l(t)?this._layers.splice(t,0,e):(t=this._layers.length,this._layers.push(e)),this._update(),this.layerAdded.raiseEvent(e,t);let i=e.readyEvent.addEventListener(()=>{this.layerShownOrHidden.raiseEvent(e,e._layerIndex,e.show),i()})};wa.prototype.addImageryProvider=function(e,t){let n=new Ss(e);return this.add(n,t),n};wa.prototype.remove=function(e,t){t=t??!0;let n=this._layers.indexOf(e);return n!==-1?(this._layers.splice(n,1),this._update(),this.layerRemoved.raiseEvent(e,n),t&&e.destroy(),!0):!1};wa.prototype.removeAll=function(e){e=e??!0;let t=this._layers;for(let n=0,i=t.length;n<i;n++){let r=t[n];this.layerRemoved.raiseEvent(r,n),e&&r.destroy()}this._layers=[]};wa.prototype.contains=function(e){return this.indexOf(e)!==-1};wa.prototype.indexOf=function(e){return this._layers.indexOf(e)};wa.prototype.get=function(e){return this._layers[e]};function dG(e,t){return e.indexOf(t)}function DEe(e,t,n){let i=e._layers;if(t=D.clamp(t,0,i.length-1),n=D.clamp(n,0,i.length-1),t===n)return;let r=i[t];i[t]=i[n],i[n]=r,e._update(),e.layerMoved.raiseEvent(r,n,t)}wa.prototype.raise=function(e){let t=dG(this._layers,e);DEe(this,t,t+1)};wa.prototype.lower=function(e){let t=dG(this._layers,e);DEe(this,t,t-1)};wa.prototype.raiseToTop=function(e){let t=dG(this._layers,e);t!==this._layers.length-1&&(this._layers.splice(t,1),this._layers.push(e),this._update(),this.layerMoved.raiseEvent(e,this._layers.length-1,t))};wa.prototype.lowerToBottom=function(e){let t=dG(this._layers,e);t!==0&&(this._layers.splice(t,1),this._layers.splice(0,0,e),this._update(),this.layerMoved.raiseEvent(e,0,t))};var REe=new ie;function OEe(e,t,n,i){let r=e.globe._surface._tilesToRender,o;for(let a=0;!l(o)&&a<r.length;++a){let c=r[a];ie.contains(c.rectangle,t)&&(o=c)}if(!l(o))return;let s=o.data.imagery;for(let a=s.length-1;a>=0;--a){let c=s[a],u=c.readyImagery;if(!l(u)||!u.imageryLayer.ready)continue;let f=u.imageryLayer.imageryProvider;if(n&&!l(f.pickFeatures)||!ie.contains(u.rectangle,t))continue;let d=REe,p=1/1024;d.west=D.lerp(o.rectangle.west,o.rectangle.east,c.textureCoordinateRectangle.x-p),d.east=D.lerp(o.rectangle.west,o.rectangle.east,c.textureCoordinateRectangle.z+p),d.south=D.lerp(o.rectangle.south,o.rectangle.north,c.textureCoordinateRectangle.y-p),d.north=D.lerp(o.rectangle.south,o.rectangle.north,c.textureCoordinateRectangle.w+p),ie.contains(d,t)&&i(u)}}wa.prototype.pickImageryLayers=function(e,t){let n=t.globe.pick(e,t);if(!l(n))return;let i=t.ellipsoid.cartesianToCartographic(n),r=[];if(OEe(t,i,!1,function(o){r.push(o.imageryLayer)}),r.length!==0)return r};var upt=new ie,fpt=new ie,nee=new U,iee=new U,dpt=new he,hpt=new he;function mpt(e,t,n,i){let r=n.imageryProvider.tilingScheme,o=r.rectangleToNativeRectangle(e,upt),s=1/1024,a=fpt;a.west=D.lerp(o.west,o.east,t.minX-s),a.east=D.lerp(o.west,o.east,t.maxX+s),a.south=D.lerp(o.south,o.north,t.minY-s),a.north=D.lerp(o.south,o.north,t.maxY+s),l(i)||(i=new ie);let c=r.projection;if(c instanceof Ui)return i.west=D.toRadians(a.west),i.south=D.toRadians(a.south),i.east=D.toRadians(a.east),i.north=D.toRadians(a.north),i;nee.x=a.west,nee.y=a.south,iee.x=a.east,iee.y=a.north;let u=c.unproject(nee,dpt),f=c.unproject(iee,hpt);return i.west=u.longitude,i.south=u.latitude,i.east=f.longitude,i.north=f.latitude,i}function ppt(e,t,n){let i=e._modelImagery;if(!l(i))return;let r=i._modelPrimitiveImageries;if(l(r))for(let o=0;o<r.length;o++){let s=r[o],a=s._coveragesPerLayer;if(l(a))for(let c=a.length-1;c>=0;--c){let u=a[c];for(let f=0;f<u.length;f++){let d=u[f],p=d.imagery,g=p.imageryLayer,m=g.imageryProvider;if(!l(m.pickFeatures)||!l(p)||p.state!==Vn.READY||!ie.contains(p.rectangle,t))continue;let A=s.mappedPositionsForImageryLayer(g).cartographicBoundingRectangle,b=mpt(A,d.textureCoordinateRectangle,g,REe);ie.contains(b,t)&&n(p)}}}}wa.prototype.pickImageryLayerFeatures=function(e,t){let n;l(t.globe)&&(n=t.globe.pick(e,t));let i;if(!l(n)){let c=t.pickFromRay(e);if(!l(c)||(n=c.position,!l(n)))return;l(c.object)&&l(c.object.detail)&&(i=c.object.detail.model)}let r=t.ellipsoid.cartesianToCartographic(n),o=[],s=[];function a(c){if(!c.imageryLayer.ready)return;let f=c.imageryLayer.imageryProvider.pickFeatures(c.x,c.y,c.level,r.longitude,r.latitude);l(f)&&(o.push(f),s.push(c.imageryLayer))}if(l(t.globe)&&OEe(t,r,!0,function(c){a(c)}),l(i)&&ppt(i,r,function(c){a(c)}),o.length!==0)return Promise.all(o).then(function(c){let u=[];for(let f=0;f<c.length;++f){let d=c[f],p=s[f];if(l(d)&&d.length>0)for(let g=0;g<d.length;++g){let m=d[g];m.imageryLayer=p,l(m.position)||(m.position=r),u.push(m)}}return u})};wa.prototype.queueReprojectionCommands=function(e){let t=this._layers;for(let n=0,i=t.length;n<i;++n)t[n].queueReprojectionCommands(e)};wa.prototype.cancelReprojections=function(){let e=this._layers;for(let t=0,n=e.length;t<n;++t)e[t].cancelReprojections()};wa.prototype.isDestroyed=function(){return!1};wa.prototype.destroy=function(){return this.removeAll(!0),le(this)};wa.prototype._update=function(){let e=!0,t=this._layers,n,i,r,o;for(r=0,o=t.length;r<o;++r)i=t[r],i._layerIndex=r,i.show?(i._isBaseLayer=e,e=!1):i._isBaseLayer=!1,i.show!==i._show&&(l(i._show)&&(l(n)||(n=[]),n.push(i)),i._show=i.show);if(l(n))for(r=0,o=n.length;r<o;++r)i=n[r],this.layerShownOrHidden.raiseEvent(i,i._layerIndex,i.show)};var ZT=wa;function lo(e){e=e??H.EMPTY_OBJECT,this._url=void 0,this._basePath=void 0,this._root=void 0,this._resource=void 0,this._asset=void 0,this._properties=void 0,this._geometricError=void 0,this._scaledGeometricError=void 0,this._extensionsUsed=void 0,this._extensions=void 0,this._modelUpAxis=void 0,this._modelForwardAxis=void 0,this._cache=new uk,this._externalTilesetTiles=[],this._externalTilesetSweepIndex=0,this._externalTilesetSweepCount=8,this._externalTilesetIdleFrames=e.externalTilesetIdleFrames??120,this._processingQueue=[],this._selectedTiles=[],this._emptyTiles=[],this._requestedTiles=[],this._selectedTilesToStyle=[],this._loadTimestamp=void 0,this._timeSinceLoad=0,this._updatedVisibilityFrame=0,this._updatedModelMatrixFrame=0,this._modelMatrixChanged=!1,this._previousModelMatrix=void 0,this._extras=void 0,this._credits=void 0,this._showCreditsOnScreen=e.showCreditsOnScreen??!1,this._cullWithChildrenBounds=e.cullWithChildrenBounds??!0,this._allTilesAdditive=!0,this._hasMixedContent=!1,this._stencilClearCommand=void 0,this._backfaceCommands=new Zl,this._maximumScreenSpaceError=e.maximumScreenSpaceError??16,this._memoryAdjustedScreenSpaceError=this._maximumScreenSpaceError,this._cacheBytes=e.cacheBytes??512*1024*1024;let t=e.maximumCacheOverflowBytes??512*1024*1024;this._maximumCacheOverflowBytes=t,this._styleEngine=new hk,this._styleApplied=!1,this._modelMatrix=l(e.modelMatrix)?N.clone(e.modelMatrix):N.clone(N.IDENTITY),this._addHeightCallbacks=[],this._statistics=new Pm,this._statisticsLast=new Pm,this._statisticsPerPass=new Array(ao.NUMBER_OF_PASSES);for(let r=0;r<ao.NUMBER_OF_PASSES;++r)this._statisticsPerPass[r]=new Pm;this._requestedTilesInFlight=[],this._maximumPriority={foveatedFactor:-Number.MAX_VALUE,depth:-Number.MAX_VALUE,distance:-Number.MAX_VALUE,reverseScreenSpaceError:-Number.MAX_VALUE},this._minimumPriority={foveatedFactor:Number.MAX_VALUE,depth:Number.MAX_VALUE,distance:Number.MAX_VALUE,reverseScreenSpaceError:Number.MAX_VALUE},this._heatmap=new fk(e.debugHeatmapTilePropertyName),this.cullRequestsWhileMoving=e.cullRequestsWhileMoving??!0,this._cullRequestsWhileMoving=!1,this.cullRequestsWhileMovingMultiplier=e.cullRequestsWhileMovingMultiplier??60,this.progressiveResolutionHeightFraction=D.clamp(e.progressiveResolutionHeightFraction??.3,0,.5),this.preferLeaves=e.preferLeaves??!1,this._tilesLoaded=!1,this._initialTilesLoaded=!1,this._tileDebugLabels=void 0,this._classificationType=e.classificationType,this._heightReference=e.heightReference,this._scene=e.scene,this._ellipsoid=e.ellipsoid??ee.WGS84,this._initialClippingPlanesOriginMatrix=N.IDENTITY,this._clippingPlanesOriginMatrix=void 0,this._clippingPlanesOriginMatrixDirty=!0,this._vectorClassificationOnly=e.vectorClassificationOnly??!1,this._vectorKeepDecodedPositions=e.vectorKeepDecodedPositions??!1,this._imageryLayers=new ZT(this),this._imageryLayersModificationCounter=0,this._imageryLayersListener=()=>{this._imageryLayersModificationCounter++},this.imageryLayers.layerAdded.addEventListener(this._imageryLayersListener),this.imageryLayers.layerRemoved.addEventListener(this._imageryLayersListener),this.imageryLayers.layerMoved.addEventListener(this._imageryLayersListener),this.imageryLayers.layerShownOrHidden.addEventListener(this._imageryLayersListener),this._asynchronouslyLoadImagery=e.asynchronouslyLoadImagery??!1,this.preloadWhenHidden=e.preloadWhenHidden??!1,this.preloadFlightDestinations=e.preloadFlightDestinations??!0,this._pass=void 0,this.dynamicScreenSpaceError=e.dynamicScreenSpaceError??!0,this.foveatedScreenSpaceError=e.foveatedScreenSpaceError??!0,this._foveatedConeSize=e.foveatedConeSize??.1,this._foveatedMinimumScreenSpaceErrorRelaxation=e.foveatedMinimumScreenSpaceErrorRelaxation??0,this.foveatedInterpolationCallback=e.foveatedInterpolationCallback??D.lerp,this.foveatedTimeDelay=e.foveatedTimeDelay??.2,this.dynamicScreenSpaceErrorDensity=e.dynamicScreenSpaceErrorDensity??2e-4,this.dynamicScreenSpaceErrorFactor=e.dynamicScreenSpaceErrorFactor??24,this.dynamicScreenSpaceErrorHeightFalloff=e.dynamicScreenSpaceErrorHeightFalloff??.25,this._dynamicScreenSpaceErrorComputedDensity=0,this.shadows=e.shadows??Dn.ENABLED,this.show=e.show??!0,this.colorBlendMode=zu.HIGHLIGHT,this.colorBlendAmount=.5,this._pointCloudShading=new Yp(e.pointCloudShading),this._pointCloudEyeDomeLighting=new Wg,this.loadProgress=new be,this.allTilesLoaded=new be,this.initialTilesLoaded=new be,this.tileLoad=new be,this.tileUnload=new be,this.tileFailed=new be,this.tileVisible=new be,this.skipLevelOfDetail=e.skipLevelOfDetail??!1,this._disableSkipLevelOfDetail=!1,this._runtimeContentCodec=void 0,this.baseScreenSpaceError=e.baseScreenSpaceError??1024,this.skipScreenSpaceErrorFactor=e.skipScreenSpaceErrorFactor??16,this.skipLevels=e.skipLevels??1,this.immediatelyLoadDesiredLevelOfDetail=e.immediatelyLoadDesiredLevelOfDetail??!1,this.loadSiblings=e.loadSiblings??!1,this._clippingPlanes=void 0,l(e.clippingPlanes)&&bs.setOwner(e.clippingPlanes,this,"_clippingPlanes"),this._clippingPolygons=void 0,this._clippingPolygonsNeedRebake=!1,this._removeClippingPolygonAdded=void 0,this._removeClippingPolygonRemoved=void 0,l(e.clippingPolygons)&&(Nc.setOwner(e.clippingPolygons,this,"_clippingPolygons"),BEe(this)),l(e.imageBasedLighting)?(this._imageBasedLighting=e.imageBasedLighting,this._shouldDestroyImageBasedLighting=!1):(this._imageBasedLighting=new Kx,this._shouldDestroyImageBasedLighting=!0),this._environmentMapManager=new jg(e.environmentMapOptions),this.lightColor=e.lightColor,this.backFaceCulling=e.backFaceCulling??!0,this._enableShowOutline=e.enableShowOutline??!0,this.showOutline=e.showOutline??!0,this.outlineColor=e.outlineColor??z.BLACK,this.splitDirection=e.splitDirection??jo.NONE,this.enableCollision=e.enableCollision??!1,this.maximumHeightQueryGeometricError=e.maximumHeightQueryGeometricError??500,this._projectTo2D=e.projectTo2D??!1,this._enablePick=e.enablePick??!1,this.debugFreezeFrame=e.debugFreezeFrame??!1,this.debugColorizeTiles=e.debugColorizeTiles??!1,this._enableDebugWireframe=e.enableDebugWireframe??!1,this.debugWireframe=e.debugWireframe??!1,this.debugWireframe===!0&&this._enableDebugWireframe===!1&&_t("tileset-debug-wireframe-ignored","enableDebugWireframe must be set to true in the Cesium3DTileset constructor, otherwise debugWireframe will be ignored."),this.edgeDisplayMode=e.edgeDisplayMode??Wd.SURFACES_ONLY,this.debugShowBoundingVolume=e.debugShowBoundingVolume??!1,this.debugShowContentBoundingVolume=e.debugShowContentBoundingVolume??!1,this.debugShowViewerRequestVolume=e.debugShowViewerRequestVolume??!1,this._tileDebugLabels=void 0,this.debugPickedTileLabelOnly=!1,this.debugPickedTile=void 0,this.debugPickPosition=void 0,this.debugShowGeometricError=e.debugShowGeometricError??!1,this.debugShowRenderingStatistics=e.debugShowRenderingStatistics??!1,this.debugShowMemoryUsage=e.debugShowMemoryUsage??!1,this.debugShowUrl=e.debugShowUrl??!1,this.examineVectorLinesFunction=void 0,this._metadataExtension=void 0,this._customShader=e.customShader;let n=e.featureIdLabel??"featureId_0";typeof n=="number"&&(n=`featureId_${n}`),this._featureIdLabel=n;let i=e.instanceFeatureIdLabel??"instanceFeatureId_0";typeof i=="number"&&(i=`instanceFeatureId_${i}`),this._instanceFeatureIdLabel=i}Object.defineProperties(lo.prototype,{isCesium3DTileset:{get:function(){return!0}},asset:{get:function(){return this._asset}},extensions:{get:function(){return this._extensions}},clippingPlanes:{get:function(){return this._clippingPlanes},set:function(e){bs.setOwner(e,this,"_clippingPlanes")}},clippingPolygons:{get:function(){return this._clippingPolygons},set:function(e){Nc.setOwner(e,this,"_clippingPolygons"),BEe(this),this._clippingPolygonsNeedRebake=!0}},imageryLayers:{get:function(){return this._imageryLayers}},imageryLayersModificationCounter:{get:function(){return this._imageryLayersModificationCounter}},asynchronouslyLoadImagery:{get:function(){return this._asynchronouslyLoadImagery}},properties:{get:function(){return this._properties}},tilesLoaded:{get:function(){return this._tilesLoaded}},resource:{get:function(){return this._resource}},basePath:{get:function(){return qr("Cesium3DTileset.basePath","Cesium3DTileset.basePath has been deprecated. All tiles are relative to the url of the tileset JSON file that contains them. Use the url property instead."),this._basePath}},style:{get:function(){return this._styleEngine.style},set:function(e){this._styleEngine.style=e}},customShader:{get:function(){return this._customShader},set:function(e){this._customShader=e}},hasMixedContent:{get:function(){return this._hasMixedContent},set:function(e){this._hasMixedContent=e}},isSkippingLevelOfDetail:{get:function(){return this.skipLevelOfDetail&&!l(this._classificationType)&&!this._disableSkipLevelOfDetail&&!this._allTilesAdditive}},metadataExtension:{get:function(){return this._metadataExtension}},metadata:{get:function(){if(l(this._metadataExtension))return this._metadataExtension.tileset}},schema:{get:function(){if(l(this._metadataExtension))return this._metadataExtension.schema}},maximumScreenSpaceError:{get:function(){return this._maximumScreenSpaceError},set:function(e){this._maximumScreenSpaceError=e,this._memoryAdjustedScreenSpaceError=e}},cacheBytes:{get:function(){return this._cacheBytes},set:function(e){this._cacheBytes=e}},maximumCacheOverflowBytes:{get:function(){return this._maximumCacheOverflowBytes},set:function(e){this._maximumCacheOverflowBytes=e}},externalTilesetIdleFrames:{get:function(){return this._externalTilesetIdleFrames},set:function(e){this._externalTilesetIdleFrames=e}},memoryAdjustedScreenSpaceError:{get:function(){return this._memoryAdjustedScreenSpaceError}},pointCloudShading:{get:function(){return this._pointCloudShading},set:function(e){this._pointCloudShading=e}},root:{get:function(){return this._root}},boundingSphere:{get:function(){return this._root.updateTransform(this._modelMatrix),this._root.boundingSphere}},modelMatrix:{get:function(){return this._modelMatrix},set:function(e){this._modelMatrix=N.clone(e,this._modelMatrix)}},timeSinceLoad:{get:function(){return this._timeSinceLoad}},totalMemoryUsageInBytes:{get:function(){let e=this._statistics;return e.texturesByteLength+e.geometryByteLength+e.batchTableByteLength}},clippingPlanesOriginMatrix:{get:function(){return l(this._clippingPlanesOriginMatrix)?(this._clippingPlanesOriginMatrixDirty&&(N.multiply(this.root.computedTransform,this._initialClippingPlanesOriginMatrix,this._clippingPlanesOriginMatrix),this._clippingPlanesOriginMatrixDirty=!1),this._clippingPlanesOriginMatrix):N.IDENTITY}},styleEngine:{get:function(){return this._styleEngine}},statistics:{get:function(){return this._statistics}},classificationType:{get:function(){return this._classificationType}},heightReference:{get:function(){return this._heightReference}},scene:{get:function(){return this._scene}},ellipsoid:{get:function(){return this._ellipsoid}},foveatedConeSize:{get:function(){return this._foveatedConeSize},set:function(e){this._foveatedConeSize=e}},foveatedMinimumScreenSpaceErrorRelaxation:{get:function(){return this._foveatedMinimumScreenSpaceErrorRelaxation},set:function(e){this._foveatedMinimumScreenSpaceErrorRelaxation=e}},extras:{get:function(){return this._extras}},imageBasedLighting:{get:function(){return this._imageBasedLighting},set:function(e){e!==this._imageBasedLighting&&(this._shouldDestroyImageBasedLighting&&!this._imageBasedLighting.isDestroyed()&&this._imageBasedLighting.destroy(),this._imageBasedLighting=e,this._shouldDestroyImageBasedLighting=!1)}},environmentMapManager:{get:function(){return this._environmentMapManager}},vectorClassificationOnly:{get:function(){return this._vectorClassificationOnly}},vectorKeepDecodedPositions:{get:function(){return this._vectorKeepDecodedPositions}},showCreditsOnScreen:{get:function(){return this._showCreditsOnScreen},set:function(e){this._showCreditsOnScreen=e,jEe(this)}},featureIdLabel:{get:function(){return this._featureIdLabel},set:function(e){typeof e=="number"&&(e=`featureId_${e}`),this._featureIdLabel=e}},instanceFeatureIdLabel:{get:function(){return this._instanceFeatureIdLabel},set:function(e){typeof e=="number"&&(e=`instanceFeatureId_${e}`),this._instanceFeatureIdLabel=e}}});lo.fromIonAssetId=async function(e,t){let n=await Ho.fromAssetId(e);return lo.fromUrl(n,t)};lo.fromUrl=async function(e,t){t=t??H.EMPTY_OBJECT;let n=De.createIfNeeded(e),i;n.extension==="json"?i=n.getBaseUri(!0):n.isDataUri&&(i="");let r=await lo.loadJson(n),o=await gpt(n,r),s=new lo(t);s._resource=n,s._url=n.url,s._basePath=i,s._metadataExtension=o,s._geometricError=r.geometricError,s._scaledGeometricError=r.geometricError;let a=r.asset;s._asset=a,s._extras=r.extras,jEe(s);let c=l(r.asset.gltfUpAxis)?Hi.fromName(r.asset.gltfUpAxis):Hi.Y,u=t.modelUpAxis??c,f=t.modelForwardAxis??Hi.X;s._properties=r.properties,s._extensionsUsed=r.extensionsUsed,s._extensions=r.extensions,s._modelUpAxis=u,s._modelForwardAxis=f,s._root=s.loadTileset(n,r);let p=s._root.createBoundingVolume(r.root.boundingVolume,N.IDENTITY).boundingSphere.center,g=s._ellipsoid.cartesianToCartographic(p);return l(g)&&g.height>Mi._defaultMinTerrainHeight&&(s._initialClippingPlanesOriginMatrix=At.eastNorthUpToFixedFrame(p)),s._clippingPlanesOriginMatrix=N.clone(s._initialClippingPlanesOriginMatrix),s};lo.loadJson=function(e){return De.createIfNeeded(e).fetchJson()};lo.prototype.makeStyleDirty=function(){this._styleEngine.makeDirty()};lo.prototype.loadTileset=function(e,t,n){let i=t.asset;if(!l(i))throw new oe("Tileset must have an asset property.");if(i.version!=="0.0"&&i.version!=="1.0"&&i.version!=="1.1")throw new oe("The tileset must be 3D Tiles version 0.0, 1.0, or 1.1");l(t.extensionsRequired)&&lo.checkSupportedExtensions(t.extensionsRequired);let r=this._statistics;l(n)&&this._externalTilesetTiles.push(n);let o=i.tilesetVersion;l(o)&&(this._basePath+=`?v=${o}`,e=e.clone(),e.setQueryParameters({v:o}));let s=MEe(this,e,t.root,n);l(n)&&(n.children.push(s),s._depth=n._depth+1);let a=[];for(a.push(s);a.length>0;){let c=a.pop();++r.numberOfTilesTotal,this._allTilesAdditive=this._allTilesAdditive&&c.refine===yo.ADD;let u=c._header.children;if(l(u))for(let f=0;f<u.length;++f){let d=u[f],p=MEe(this,e,d,c);c.children.push(p),p._depth=c._depth+1,a.push(p)}this._cullWithChildrenBounds&&ak.checkChildrenWithinParent(c)}return s};function MEe(e,t,n,i){if(!(l(n.implicitTiling)||tr(n,"3DTILES_implicit_tiling")))return new oh(e,t,n,i);let o=e.schema,s=new r0(t,n,o),a=new o0({subdivisionScheme:s.subdivisionScheme,subtreeLevels:s.subtreeLevels,level:0,x:0,y:0,z:0}),c=s.subtreeUriTemplate.getDerivedResource({templateValues:a.getTemplateValues()}).url,f=Je(n,!0);f.contents=[{uri:c}],delete f.content,delete f.extensions;let d=new oh(e,t,f,i);return d.implicitTileset=s,d.implicitCoordinates=a,d}async function gpt(e,t){let n=tr(t,"3DTILES_metadata")?t.extensions["3DTILES_metadata"]:t,i;if(l(n.schemaUri))e=e.getDerivedResource({url:n.schemaUri}),i=Li.getSchemaLoader({resource:e});else if(l(n.schema))i=Li.getSchemaLoader({schema:n.schema});else return;await i.load();let r=new JT({schema:i.schema,metadataJson:n});return Li.unload(i),r}var NEe=new h,_pt=new he,ypt=new N,Apt=new h,bpt=new h,xpt=new h,Tpt=new h;function Ept(e,t){let n,i,r,o,s,a=t.camera,c=e._root,u=c.contentBoundingVolume;if(u instanceof Yf)n=h.normalize(a.positionWC,NEe),i=a.directionWC,r=a.positionCartographic.height,o=u.minimumHeight,s=u.maximumHeight;else{let y=N.inverseTransformation(c.computedTransform,ypt),A=t.mapProjection.ellipsoid,b=u.boundingVolume,x=N.multiplyByPoint(y,b.center,Apt);if(h.magnitude(x)>A.minimumRadius){let T=he.fromCartesian(x,A,_pt);n=h.normalize(a.positionWC,NEe),i=a.directionWC,r=a.positionCartographic.height,o=0,s=T.height*2}else{let T=N.multiplyByPoint(y,a.positionWC,bpt);if(n=h.UNIT_Z,i=N.multiplyByPointAsVector(y,a.directionWC,xpt),i=h.normalize(i,i),r=T.z,u instanceof Ju){let E=$.getColumn(b.halfAxes,2,Tpt),v=h.magnitude(E);o=x.z-v,s=x.z+v}else if(u instanceof A_){let E=b.radius;o=x.z-E,s=x.z+E}}}let f=e.dynamicScreenSpaceErrorHeightFalloff,d=o+(s-o)*f,p=s,g=D.clamp((r-d)/(p-d),0,1),m=1-Math.abs(h.dot(i,n));m=m*(1-g),e._dynamicScreenSpaceErrorComputedDensity=e.dynamicScreenSpaceErrorDensity*m}function Cpt(e,t){if(t.hasEmptyContent)return;let{statistics:n}=e,i=t.contentExpired,r=t.requestContent();l(r)&&(r.then(o=>{!l(o)||t.isDestroyed()||e.isDestroyed()||(e._processingQueue.push(t),++n.numberOfTilesProcessing)}).catch(o=>{kEe(o,e,t)}),i&&(t.hasTilesetContent||t.hasImplicitContent?zEe(e,t):(n.decrementLoadCounts(t.content),--n.numberOfTilesWithContentReady)),e._requestedTilesInFlight.push(t))}function FEe(e,t){return e._priority-t._priority}lo.prototype.postPassesUpdate=function(e){l(this._root)&&(vpt(this,e),Hpt(this,e),this._cache.unloadTiles(this,VEe),Vpt(this,e),this._styleApplied&&this._styleEngine.resetDirty(),this._styleApplied=!1)};function BEe(e){e._removeClippingPolygonAdded=e._removeClippingPolygonAdded&&e._removeClippingPolygonAdded(),e._removeClippingPolygonRemoved=e._removeClippingPolygonRemoved&&e._removeClippingPolygonRemoved();let t=e._clippingPolygons;if(!l(t))return;let n=()=>{e._clippingPolygonsNeedRebake=!0};e._removeClippingPolygonAdded=t.polygonAdded.addEventListener(n),e._removeClippingPolygonRemoved=t.polygonRemoved.addEventListener(n)}lo.prototype.prePassesUpdate=function(e){if(!l(this._root))return;Opt(this,e);let t=this._clippingPlanes;this._clippingPlanesOriginMatrixDirty=!0,l(t)&&t.enabled&&t.update(e);let n=this._clippingPolygons;l(n)&&n.enabled&&n.update(e),this._clippingPolygonsNeedRebake&&(this._clippingPolygonsNeedRebake=!1,this._cache.forEachLoadedTile(i=>{i.clippingPolygonsNeedRebake=!0})),l(this._loadTimestamp)||(this._loadTimestamp=K.clone(e.time)),this._timeSinceLoad=Math.max(K.secondsDifference(e.time,this._loadTimestamp)*1e3,0),this.dynamicScreenSpaceError&&Ept(this,e),e.newFrame&&this._cache.reset()};function vpt(e,t){let n=e._requestedTilesInFlight,i=0;for(let r=0;r<n.length;++r){let o=n[r],s=t.frameNumber-o._touchedFrame>=1;if(o._contentState!==Rr.LOADING){++i;continue}else if(s){o.cancelRequests(),++i;continue}i>0&&(n[r-i]=o)}n.length-=i}function Spt(e){let t=e._requestedTiles;t.sort(FEe);for(let n=0;n<t.length;++n)Cpt(e,t[n])}function kEe(e,t,n){if(t.isDestroyed())return;let i;n.isDestroyed()||(i=n._contentResource.url);let r=l(e.message)?e.message:e.toString();t.tileFailed.numberOfListeners>0?t.tileFailed.raiseEvent({url:i,message:r}):(console.log(`A 3D tile failed to load: ${i}`),console.log(`Error: ${r}`),console.log(e.stack))}function wpt(e){let t=e._processingQueue,n=0;for(let i=0;i<t.length;++i){let r=t[i];if(r.isDestroyed()||r._contentState!==Rr.PROCESSING){++n;continue}n>0&&(t[i-n]=r)}t.length-=n}var Ipt=new he,Ppt=new he,Dpt=new h;function Rpt(e,t,n){if(!e.enableCollision||!e.show||t._wasSelectedLastFrame)return;let i=e._addHeightCallbacks,r=t.boundingSphere,o=i.length;for(let s=0;s<o;++s){let a=i[s];if(a.invoked)continue;let c=a.ellipsoid,u=he.clone(a.positionCartographic,Ipt),f=he.fromCartesian(r.center,c,Ppt);l(f)&&(u.height=f.height);let d=he.toCartesian(u,c,Dpt);h.distance(d,r.center)<=r.radius&&(a.invoked=!0,n.afterRender.push(()=>{l(a.callback)&&a.callback(),a.invoked=!1}))}}function Opt(e,t){wpt(e);let n=e._processingQueue,{cacheBytes:i,maximumCacheOverflowBytes:r,statistics:o}=e,s=i+r,a=!1;for(let c=0;c<n.length;++c){if(e.totalMemoryUsageInBytes>s){a=!0;break}let u=n[c];try{u.process(e,t),u.contentReady&&(--o.numberOfTilesProcessing,e.tileLoad.raiseEvent(u))}catch(f){--o.numberOfTilesProcessing,kEe(f,e,u)}}e.totalMemoryUsageInBytes<i?Npt(e):a&&n.length>0&&Mpt(e)}function Mpt(e){e._memoryAdjustedScreenSpaceError*=1.02;let t=e._processingQueue;for(let n=0;n<t.length;++n)t[n].updatePriority();t.sort(FEe)}function Npt(e){e._memoryAdjustedScreenSpaceError=Math.max(e.memoryAdjustedScreenSpaceError/1.02,e.maximumScreenSpaceError)}var hG=new h,Lpt={maximumFractionDigits:3};function LEe(e){let t=e/1048576;return t<1?t.toLocaleString(void 0,Lpt):Math.round(t).toLocaleString()}function ree(e){let{halfAxes:t,radius:n,center:i}=e.boundingVolume.boundingVolume,r=h.clone(i,hG);if(l(t))r.x+=.75*(t[0]+t[3]+t[6]),r.y+=.75*(t[1]+t[4]+t[7]),r.z+=.75*(t[2]+t[5]+t[8]);else if(l(n)){let o=h.normalize(i,hG);o=h.multiplyByScalar(o,.75*n,hG),r=h.add(o,i,hG)}return r}function oee(e,t,n){let i="",r=0;if(t.debugShowGeometricError&&(i+=` +Please retile your tileset with the KHR_gaussian_splatting and KHR_gaussian_splatting_compression_spz_2 extensions.`)),n}get featuresLength(){return 0}get pointsLength(){return this.gltfPrimitive.attributes[0].count}get trianglesLength(){return 0}get geometryByteLength(){return 0}get texturesByteLength(){let t=this._tileset?.gaussianSplatPrimitive;if(!l(t))return 0;let n=t.gaussianSplatTexture,i=t.selectedTileLength;return!l(n)||i===0?0:n.sizeInBytes/i}get batchTableByteLength(){return 0}get innerContents(){}get ready(){return this._ready}get transformed(){return this._transformed}get tileset(){return this._tileset}get tile(){return this._tile}get url(){return this._resource.getUrlComponent(!0)}get batchTable(){}get metadata(){return this._metadata}set metadata(t){this._metadata=t}get group(){return this._group}set group(t){this._group=t}get positions(){return this._positions}get rotations(){return this._rotations}get scales(){return this._scales}get sphericalHarmonicsCoefficientCount(){return this._sphericalHarmonicsCoefficientCount}get sphericalHarmonicsDegree(){return this._sphericalHarmonicsDegree}get packedSphericalHarmonicsData(){return this._packedSphericalHarmonicsData}static async fromGltf(t,n,i,r){let o=i,s=De.createIfNeeded(o),a={releaseGltfJson:!1,upAxis:Hi.Y,forwardAxis:Hi.Z};l(r.asset)?(a.gltfJson=r,a.baseResource=s,a.gltfResource=s):r instanceof Uint8Array?(a.typedArray=r,a.baseResource=s,a.gltfResource=s):a.gltfResource=De.createIfNeeded(r);let c=new Gf(a);try{await c.load()}catch(u){throw c.destroy(),new oe(`Failed to load glTF: ${u.message}`)}return new e(c,t,n,i)}update(t,n){let i=this._loader;if(!this._ready){if(n.afterRender.push(()=>!0),!l(i)){this._ready=!0;return}if(this._resourcesLoaded){this.gltfPrimitive=i.components.scene.nodes[0].primitives[0],this.worldTransform=i.components.scene.nodes[0].matrix,this._ready=!0,this._positions=xt.getAttributeBySemantic(this.gltfPrimitive,ct.POSITION).typedArray.slice(),this._rotations=xt.getAttributeBySemantic(this.gltfPrimitive,ct.ROTATION).typedArray.slice(),this._scales=xt.getAttributeBySemantic(this.gltfPrimitive,ct.SCALE).typedArray.slice();let{l:r,n:o}=a_t(this.gltfPrimitive.attributes);this._sphericalHarmonicsDegree=r,this._sphericalHarmonicsCoefficientCount=o,this._packedSphericalHarmonicsData=f_t(this);return}this._resourcesLoaded=i.process(n)}}hasProperty(t,n){return!1}getFeature(t){}applyDebugSettings(t,n){}applyStyle(t){}pick(t,n,i){}isDestroyed(){return this.isDestroyed}destroy(){return this.splatPrimitive=void 0,this._tile=void 0,this._tileset=void 0,this._resource=void 0,this._ready=!1,this._group=void 0,this._metadata=void 0,this._resourcesLoaded=!1,this._lastSplatTransform=void 0,l(this._loader)&&(this._loader.destroy(),this._loader=void 0),le(this)}};function s_t(e){return`${e.startsWith("KHR_gaussian_splatting:")?"KHR_gaussian_splatting:":"_"}SH_DEGREE_`}function a_t(e){switch(e.filter(n=>n.name.includes("SH_DEGREE_")).length){default:case 0:return{l:0,n:0};case 3:return{l:1,n:9};case 8:return{l:2,n:24};case 15:return{l:3,n:45}}}var Bve=new ArrayBuffer(4),c_t=new Float32Array(Bve),l_t=new Uint32Array(Bve);function Cee(e){c_t[0]=e;let t=l_t[0],n=t>>31&1,i=t>>23&255,r=t&8388607,o;if(i===255)o=n<<15|31744|(r?512:0);else if(i===0)o=n<<15;else{let s=i-127+15;s>=31?o=n<<15|31744:s<=0?o=n<<15:o=n<<15|s<<10|r>>>13}return o}function u_t(e){let t=s_t(e),n="_COEF_",i=t.length,r=e.indexOf(n,i),o=parseInt(e.slice(i,r),10),s=parseInt(e.slice(r+n.length),10);return{l:o,n:s}}function f_t(e){let t=e.sphericalHarmonicsDegree,n=e.sphericalHarmonicsCoefficientCount,i=e.pointsLength*(n*(2/3)),r=new Uint32Array(i),o=e.gltfPrimitive.attributes.filter(u=>u.name.includes("SH_DEGREE_")),s=0,a=[0,9,24];switch(t){case 1:s=9;break;case 2:s=24;break;case 3:s=45;break}o.sort((u,f)=>u.name<f.name?-1:u.name>f.name?1:0);let c=s*(2/3);for(let u=0;u<o.length;u++){let{l:f,n:d}=u_t(o[u].name);for(let p=0;p<e.pointsLength;p++){let g=a[f-1]*2/3,m=p*c+g+d*2,y=p*3;r[m]=Cee(o[u].typedArray[y])|Cee(o[u].typedArray[y+1])<<16,r[m+1]=Cee(o[u].typedArray[y+2])}}return r}var GA=vee;var kve={b3dm:function(e,t,n,i,r){return Zf.fromB3dm(e,t,n,i,r)},pnts:function(e,t,n,i,r){return Zf.fromPnts(e,t,n,i,r)},i3dm:function(e,t,n,i,r){return Zf.fromI3dm(e,t,n,i,r)},cmpt:function(e,t,n,i,r){return pk.fromTileType(e,t,n,i,r,kve)},externalTileset:function(e,t,n,i){return xk.fromJson(e,t,n,i)},geom:function(e,t,n,i,r){return new _k(e,t,n,i,r)},vctr:function(e,t,n,i,r){return new Ok(e,t,n,i,r)},subt:function(e,t,n,i,r){return zw.fromSubtreeJson(e,t,n,void 0,i,r)},subtreeJson:function(e,t,n,i){return zw.fromSubtreeJson(e,t,n,i)},glb:function(e,t,n,i,r){if(i.byteLength<12)throw new oe("Invalid glb content");let a=new DataView(i,r).getUint32(8,!0),c=new Uint8Array(i,r,a);return GA.tilesetRequiresGaussianSplattingExt(e)?GA.fromGltf(e,t,n,c):e.hasExtension("3DTILES_content_gltf_vector")||e.isGltfExtensionUsed("CESIUM_mesh_vector")?HA.fromGltf(e,t,n,c):Zf.fromGltf(e,t,n,c)},gltf:function(e,t,n,i){return GA.tilesetRequiresGaussianSplattingExt(e)?GA.fromGltf(e,t,n,i):e.hasExtension("3DTILES_content_gltf_vector")||e.isGltfExtensionUsed("CESIUM_mesh_vector")?HA.fromGltf(e,t,n,i):Zf.fromGltf(e,t,n,i)},geoJson:function(e,t,n,i){return Zf.fromGeoJson(e,t,n,i)}},sE=kve;var Uve={UNLOADED:0,LOADING:1,PROCESSING:2,READY:3,EXPIRED:4,FAILED:5};Object.freeze(Uve);var Rr=Uve;var ch={BATCHED_3D_MODEL:"b3dm",INSTANCED_3D_MODEL:"i3dm",COMPOSITE:"cmpt",POINT_CLOUD:"pnts",VECTOR:"vctr",GEOMETRY:"geom",GLTF:"gltf",GLTF_BINARY:"glb",IMPLICIT_SUBTREE:"subt",IMPLICIT_SUBTREE_JSON:"subtreeJson",EXTERNAL_TILESET:"externalTileset",MULTIPLE_CONTENT:"multipleContent",GEOJSON:"geoJson",VOXEL_BINARY:"voxl",VOXEL_JSON:"voxelJson"};ch.isBinaryFormat=function(e){switch(e){case ch.BATCHED_3D_MODEL:case ch.INSTANCED_3D_MODEL:case ch.COMPOSITE:case ch.POINT_CLOUD:case ch.VECTOR:case ch.GEOMETRY:case ch.IMPLICIT_SUBTREE:case ch.VOXEL_BINARY:case ch.GLTF_BINARY:return!0;default:return!1}};Object.freeze(ch);var wa=ch;var zve={NOT_COMPUTED:-1,USE_OPTIMIZATION:1,SKIP_OPTIMIZATION:0};Object.freeze(zve);var lh=zve;var Ia={RENDER:0,PICK:1,SHADOW:2,PRELOAD:3,PRELOAD_FLIGHT:4,REQUEST_RENDER_MODE_DEFER_CHECK:5,MOST_DETAILED_PRELOAD:6,MOST_DETAILED_PICK:7,NUMBER_OF_PASSES:8},T_=new Array(Ia.NUMBER_OF_PASSES);T_[Ia.RENDER]=Object.freeze({pass:Ia.RENDER,isRender:!0,requestTiles:!0,ignoreCommands:!1});T_[Ia.PICK]=Object.freeze({pass:Ia.PICK,isRender:!1,requestTiles:!1,ignoreCommands:!1});T_[Ia.SHADOW]=Object.freeze({pass:Ia.SHADOW,isRender:!1,requestTiles:!0,ignoreCommands:!1});T_[Ia.PRELOAD]=Object.freeze({pass:Ia.PRELOAD,isRender:!1,requestTiles:!0,ignoreCommands:!0});T_[Ia.PRELOAD_FLIGHT]=Object.freeze({pass:Ia.PRELOAD_FLIGHT,isRender:!1,requestTiles:!0,ignoreCommands:!0});T_[Ia.REQUEST_RENDER_MODE_DEFER_CHECK]=Object.freeze({pass:Ia.REQUEST_RENDER_MODE_DEFER_CHECK,isRender:!1,requestTiles:!0,ignoreCommands:!0});T_[Ia.MOST_DETAILED_PRELOAD]=Object.freeze({pass:Ia.MOST_DETAILED_PRELOAD,isRender:!1,requestTiles:!0,ignoreCommands:!0});T_[Ia.MOST_DETAILED_PICK]=Object.freeze({pass:Ia.MOST_DETAILED_PICK,isRender:!1,requestTiles:!1,ignoreCommands:!1});Ia.getPassOptions=function(e){return T_[e]};Object.freeze(Ia);var ao=Ia;var See=class{constructor(t,n){this._tileset=t,this._tile=n,this.featurePropertiesDirty=!1}get featuresLength(){return 0}get pointsLength(){return 0}get trianglesLength(){return 0}get geometryByteLength(){return 0}get texturesByteLength(){return 0}get batchTableByteLength(){return 0}get innerContents(){}get ready(){return!0}get tileset(){return this._tileset}get tile(){return this._tile}get url(){}get metadata(){}set metadata(t){}get batchTable(){}get group(){}set group(t){}hasProperty(t,n){return!1}getFeature(t){}applyDebugSettings(t,n){}applyStyle(t){}update(t,n){}pick(t,n,i){}isDestroyed(){return!1}destroy(){return le(this)}},l0=See;function E_(e){e=e??H.EMPTY_OBJECT;let t=e.content,n=e.class;this._class=n,this._properties=t.properties,this._extensions=t.extensions,this._extras=t.extras}Object.defineProperties(E_.prototype,{class:{get:function(){return this._class}},extras:{get:function(){return this._extras}},extensions:{get:function(){return this._extensions}}});E_.prototype.hasProperty=function(e){return Yn.hasProperty(e,this._properties,this._class)};E_.prototype.hasPropertyBySemantic=function(e){return Yn.hasPropertyBySemantic(e,this._properties,this._class)};E_.prototype.getPropertyIds=function(e){return Yn.getPropertyIds(this._properties,this._class,e)};E_.prototype.getProperty=function(e){return Yn.getProperty(e,this._properties,this._class)};E_.prototype.setProperty=function(e,t){return Yn.setProperty(e,t,this._properties,this._class)};E_.prototype.getPropertyBySemantic=function(e){return Yn.getPropertyBySemantic(e,this._properties,this._class)};E_.prototype.setPropertyBySemantic=function(e,t){return Yn.setPropertyBySemantic(e,t,this._properties,this._class)};var Yk=E_;function wee(e,t){let n=rr(t,"3DTILES_metadata")?t.extensions["3DTILES_metadata"]:t.metadata;if(!l(n))return;if(!l(e.schema)){wee._oneTimeWarning("findContentMetadata-missing-root-schema","Could not find a metadata schema for content metadata. For tilesets that contain external tilesets, make sure the schema is added to the root tileset.json.");return}let i=e.schema.classes??H.EMPTY_OBJECT;if(l(n.class)){let r=i[n.class];return new Yk({content:n,class:r})}}wee._oneTimeWarning=_t;var aE=wee;function d_t(e,t){let n=e.metadataExtension;if(!l(n))return;let i=n.groups,r=rr(t,"3DTILES_metadata")?t.extensions["3DTILES_metadata"].group:t.group;if(typeof r=="number")return i[r];let o=n.groupIds.findIndex(function(s){return s===r});return o>=0?i[o]:void 0}var cE=d_t;function C_(e){e=e??H.EMPTY_OBJECT;let t=e.tile,n=e.class;this._class=n,this._properties=t.properties,this._extensions=t.extensions,this._extras=t.extras}Object.defineProperties(C_.prototype,{class:{get:function(){return this._class}},extras:{get:function(){return this._extras}},extensions:{get:function(){return this._extensions}}});C_.prototype.hasProperty=function(e){return Yn.hasProperty(e,this._properties,this._class)};C_.prototype.hasPropertyBySemantic=function(e){return Yn.hasPropertyBySemantic(e,this._properties,this._class)};C_.prototype.getPropertyIds=function(e){return Yn.getPropertyIds(this._properties,this._class,e)};C_.prototype.getProperty=function(e){return Yn.getProperty(e,this._properties,this._class)};C_.prototype.setProperty=function(e,t){return Yn.setProperty(e,t,this._properties,this._class)};C_.prototype.getPropertyBySemantic=function(e){return Yn.getPropertyBySemantic(e,this._properties,this._class)};C_.prototype.setPropertyBySemantic=function(e,t){return Yn.setPropertyBySemantic(e,t,this._properties,this._class)};var Xk=C_;function Iee(e,t){let n=rr(t,"3DTILES_metadata")?t.extensions["3DTILES_metadata"]:t.metadata;if(!l(n))return;if(!l(e.schema)){Iee._oneTimeWarning("findTileMetadata-missing-root-schema","Could not find a metadata schema for tile metadata. For tilesets that contain external tilesets, make sure the schema is added to the root tileset.json.");return}let i=e.schema.classes??H.EMPTY_OBJECT;if(l(n.class)){let r=i[n.class];return new Xk({tile:n,class:r})}}Iee._oneTimeWarning=_t;var Kk=Iee;function h_t(e){let t=new Uint8Array(e),n=bm(t);if(n==="glTF"&&(n="glb"),wa.isBinaryFormat(n))return{contentType:n,binaryPayload:t};let i=m_t(t);if(l(i.root))return{contentType:wa.EXTERNAL_TILESET,jsonPayload:i};if(l(i.asset))return{contentType:wa.GLTF,jsonPayload:i};if(l(i.tileAvailability))return{contentType:wa.IMPLICIT_SUBTREE_JSON,jsonPayload:i};if(l(i.type))return{contentType:wa.GEOJSON,jsonPayload:i};if(l(i.voxelTable))return{contentType:wa.VOXEL_JSON,jsonPayload:i};throw new oe("Invalid tile content.")}function m_t(e){let t;try{t=No(e)}catch{throw new oe("Invalid tile content.")}return t}var v_=h_t;var Pee=class{constructor(t,n,i,r){this._tileset=t,this._tile=n,this._tilesetResource=i,this._contents=[],this._contentsCreated=!1;let o=l(r.contents)?r.contents:r.content;this._innerContentHeaders=o,this._requestsInFlight=0,this._cancelCount=0,this._externalTilesetCount=0;let s=this._innerContentHeaders.length;this._arrayFetchPromises=new Array(s),this._requests=new Array(s),this._ready=!1,this._innerContentResources=new Array(s),this._serverKeys=new Array(s);for(let a=0;a<s;a++){let c=i.getDerivedResource({url:o[a].uri}),u=Kc.getServerKey(c.getUrlComponent());this._innerContentResources[a]=c,this._serverKeys[a]=u}}get featurePropertiesDirty(){let t=this._contents,n=t.length;for(let i=0;i<n;++i)if(t[i].featurePropertiesDirty)return!0;return!1}set featurePropertiesDirty(t){let n=this._contents,i=n.length;for(let r=0;r<i;++r)n[r].featurePropertiesDirty=t}get featuresLength(){return 0}get pointsLength(){return 0}get trianglesLength(){return 0}get geometryByteLength(){return 0}get texturesByteLength(){return 0}get batchTableByteLength(){return 0}get innerContents(){return this._contents}get ready(){return this._contentsCreated?this._ready:!1}get tileset(){return this._tileset}get tile(){return this._tile}get url(){}get metadata(){}set metadata(t){}get batchTable(){}get group(){}set group(t){}get innerContentUrls(){return this._innerContentHeaders.map(function(t){return t.uri})}requestInnerContents(){if(!p_t(this._serverKeys)){this.tileset.statistics.numberOfAttemptedRequests+=this._serverKeys.length;return}let t=this._innerContentHeaders;Dee(this,t.length);let n=this._cancelCount;for(let i=0;i<t.length;i++)this._arrayFetchPromises[i]=g_t(this,i,n,this._tile._contentState);return __t(this)}cancelRequests(){for(let t=0;t<this._requests.length;t++){let n=this._requests[t];l(n)&&n.cancel()}}hasProperty(t,n){return!1}getFeature(t){}applyDebugSettings(t,n){let i=this._contents,r=i.length;for(let o=0;o<r;++o)i[o].applyDebugSettings(t,n)}applyStyle(t){let n=this._contents,i=n.length;for(let r=0;r<i;++r)n[r].applyStyle(t)}update(t,n){let i=this._contents,r=i.length,o=!0;for(let s=0;s<r;++s)i[s].update(t,n),o=o&&i[s].ready;!this._ready&&o&&(this._ready=!0)}pick(t,n,i){if(!this._ready)return;let r,o=Number.POSITIVE_INFINITY,s=this._contents,a=s.length;for(let c=0;c<a;++c){let u=s[c].pick(t,n,i);if(!l(u))continue;let f=h.distance(t.origin,u);f<o&&(r=u,o=f)}if(l(r))return i}isDestroyed(){return!1}destroy(){let t=this._contents,n=t.length;for(let i=0;i<n;++i)t[i].destroy();return le(this)}};function Dee(e,t){e._requestsInFlight+=t,e.tileset.statistics.numberOfPendingRequests+=t}function Vve(e,t){e._cancelCount++,e._tile._contentState=t;let n=e.tileset.statistics;n.numberOfPendingRequests-=e._requestsInFlight,n.numberOfAttemptedRequests+=e._requestsInFlight,e._requestsInFlight=0;let i=e._innerContentHeaders.length;e._arrayFetchPromises=new Array(i)}function p_t(e){let t={};for(let n=0;n<e.length;n++){let i=e[n];l(t[i])?t[i]++:t[i]=1}for(let n in t)if(t.hasOwnProperty(n)&&!Kc.serverHasOpenSlots(n,t[n]))return!1;return Kc.heapHasOpenSlots(e.length)}function g_t(e,t,n,i){let r=e._innerContentResources[t].clone(),o=e.tile,s=function(){return o._priority},a=e._serverKeys[t],c=new wo({throttle:!0,throttleByServer:!0,type:Zs.TILES3D,priorityFunction:s,serverKey:a});r.request=c,e._requests[t]=c;let u=r.fetchArrayBuffer();if(l(u))return u.then(function(f){if(!(n<e._cancelCount)){if(r.request.cancelled||r.request.state===Ti.CANCELLED){Vve(e,i);return}return Dee(e,-1),f}}).catch(function(f){if(!(n<e._cancelCount)){if(r.request.cancelled||r.request.state===Ti.CANCELLED){Vve(e,i);return}Dee(e,-1),jve(e,t,f)}})}async function __t(e){let t=e._cancelCount,n=await Promise.all(e._arrayFetchPromises);if(t<e._cancelCount)return;let i=n.map((o,s)=>y_t(e,o,s)),r=await Promise.all(i);if(e._contentsCreated=!0,e._contents=r.filter(l),e._externalTilesetCount===e._contents.length){let o=e._tile;o.hasRenderableContent=!1}return r}async function y_t(e,t,n){if(l(t))try{let i=v_(t),r=e._tileset,o=e._innerContentResources[n],s=e._tile;i.contentType===wa.EXTERNAL_TILESET&&(e._externalTilesetCount++,s.hasTilesetContent=!0),e._disableSkipLevelOfDetail=e._disableSkipLevelOfDetail||i.contentType===wa.GEOMETRY||i.contentType===wa.VECTOR;let a,c=sE[i.contentType];l(i.binaryPayload)?a=await Promise.resolve(c(r,s,o,i.binaryPayload.buffer,0)):a=await Promise.resolve(c(r,s,o,i.jsonPayload));let u=e._innerContentHeaders[n];if(s.hasImplicitContentMetadata){let d=s.implicitSubtree,p=s.implicitCoordinates;a.metadata=d.getContentMetadataView(p,n)}else s.hasImplicitContent||(a.metadata=aE(r,u));let f=cE(r,u);return l(f)&&(a.group=new YT({metadata:f})),a}catch(i){jve(e,n,i)}}function jve(e,t,n){let i=e._tileset,r=e._innerContentResources[t].url,o=l(n.message)?n.message:n.toString();i.tileFailed.numberOfListeners>0?i.tileFailed.raiseEvent({url:r,message:o}):(console.log(`A content failed to load: ${r}`),console.log(`Error: ${o}`))}var $k=Pee;function qw(e){this.rectangle=ie.clone(e.rectangle),this.minimumHeight=e.minimumHeight??0,this.maximumHeight=e.maximumHeight??0,this.southwestCornerCartesian=new h,this.northeastCornerCartesian=new h,this.westNormal=new h,this.southNormal=new h,this.eastNormal=new h,this.northNormal=new h;let t=e.ellipsoid??ee.WGS84;E_t(this,e.rectangle,t),this._orientedBoundingBox=void 0,this._boundingSphere=void 0,(e.computeBoundingVolumes??!0)&&this.computeBoundingVolumes(t)}Object.defineProperties(qw.prototype,{boundingVolume:{get:function(){return this._orientedBoundingBox}},boundingSphere:{get:function(){return this._boundingSphere}}});qw.prototype.computeBoundingVolumes=function(e){this._orientedBoundingBox=en.fromRectangle(this.rectangle,this.minimumHeight,this.maximumHeight,e),this._boundingSphere=ue.fromOrientedBoundingBox(this._orientedBoundingBox)};var Hve=new h,NG=new h,Gve=new h,A_t=new h,b_t=new h,x_t=new h,T_t=new h,uh=new he,Wve=new sn(h.UNIT_X,0),Ww=new pn;function E_t(e,t,n){n.cartographicToCartesian(ie.southwest(t),e.southwestCornerCartesian),n.cartographicToCartesian(ie.northeast(t),e.northeastCornerCartesian),uh.longitude=t.west,uh.latitude=(t.south+t.north)*.5,uh.height=0;let i=n.cartographicToCartesian(uh,x_t),r=h.cross(i,h.UNIT_Z,A_t);h.normalize(r,e.westNormal),uh.longitude=t.east;let o=n.cartographicToCartesian(uh,T_t),s=h.cross(h.UNIT_Z,o,Hve);h.normalize(s,e.eastNormal);let a=h.subtract(i,o,Hve);h.magnitude(a)===0&&(a=h.clone(r,a));let c=h.normalize(a,b_t),u=t.south,f;if(u>0){uh.longitude=(t.west+t.east)*.5,uh.latitude=u;let y=n.cartographicToCartesian(uh,Ww.origin);h.clone(c,Ww.direction);let A=sn.fromPointNormal(e.southwestCornerCartesian,e.westNormal,Wve);_i.rayPlane(Ww,A,e.southwestCornerCartesian),f=n.geodeticSurfaceNormal(y,NG)}else f=n.geodeticSurfaceNormalCartographic(ie.southeast(t),NG);let d=h.cross(f,a,Gve);h.normalize(d,e.southNormal);let p=t.north,g;if(p<0){uh.longitude=(t.west+t.east)*.5,uh.latitude=p;let y=n.cartographicToCartesian(uh,Ww.origin);h.negate(c,Ww.direction);let A=sn.fromPointNormal(e.northeastCornerCartesian,e.eastNormal,Wve);_i.rayPlane(Ww,A,e.northeastCornerCartesian),g=n.geodeticSurfaceNormal(y,NG)}else g=n.geodeticSurfaceNormalCartographic(ie.northwest(t),NG);let m=h.cross(a,g,Gve);h.normalize(m,e.northNormal)}var C_t=new h,v_t=new h,S_t=new h(0,-1,0),w_t=new h(0,0,-1),qve=new h;function I_t(e,t){let n=t.camera,i=n.positionWC,r=n.positionCartographic,o=0;if(!ie.contains(e.rectangle,r)){let u=e.southwestCornerCartesian,f=e.northeastCornerCartesian,d=e.westNormal,p=e.southNormal,g=e.eastNormal,m=e.northNormal;t.mode!==re.SCENE3D&&(u=t.mapProjection.project(ie.southwest(e.rectangle),C_t),u.z=u.y,u.y=u.x,u.x=0,f=t.mapProjection.project(ie.northeast(e.rectangle),v_t),f.z=f.y,f.y=f.x,f.x=0,d=S_t,g=h.UNIT_Y,p=w_t,m=h.UNIT_Z);let y=h.subtract(i,u,qve),A=h.dot(y,d),b=h.dot(y,p),x=h.subtract(i,f,qve),T=h.dot(x,g),E=h.dot(x,m);A>0?o+=A*A:T>0&&(o+=T*T),b>0?o+=b*b:E>0&&(o+=E*E)}let s,a,c;if(t.mode===re.SCENE3D?(s=r.height,a=e.minimumHeight,c=e.maximumHeight):(s=i.x,a=0,c=0),s>c){let u=s-c;o+=u*u}else if(s<a){let u=a-s;o+=u*u}return Math.sqrt(o)}qw.prototype.distanceToCamera=function(e){let t=I_t(this,e);if(e.mode===re.SCENE3D&&l(this._orientedBoundingBox)){let n=Math.sqrt(this._orientedBoundingBox.distanceSquaredTo(e.camera.positionWC));return Math.max(t,n)}return t};qw.prototype.intersectPlane=function(e){return this._orientedBoundingBox.intersectPlane(e)};qw.prototype.createDebugVolume=function(e){let t=N.clone(N.IDENTITY),n=new uT({rectangle:this.rectangle,height:this.minimumHeight,extrudedHeight:this.maximumHeight}),i=new Ft({geometry:n,id:"outline",modelMatrix:t,attributes:{color:Jt.fromColor(e)}});return new On({geometryInstances:i,appearance:new yn({translucent:!1,flat:!0}),asynchronous:!1})};var ed=qw;var LG=new he;function Jk(e){let t=d_.fromToken(e.token),n=e.minimumHeight??0,i=e.maximumHeight??0,r=e.ellipsoid??ee.WGS84;this.s2Cell=t,this.minimumHeight=n,this.maximumHeight=i,this.ellipsoid=r;let o=B_t(t,n,i,r);this._boundingPlanes=o;let s=V_t(o);this._vertices=s,this._edgeNormals=new Array(6),this._edgeNormals[0]=kee(o[0],s.slice(0,4));let a;for(a=0;a<4;a++)this._edgeNormals[0][a]=h.negate(this._edgeNormals[0][a],this._edgeNormals[0][a]);for(this._edgeNormals[1]=kee(o[1],s.slice(4,8)),a=0;a<4;a++)this._edgeNormals[2+a]=kee(o[2+a],[s[a%4],s[(a+1)%4],s[4+(a+1)%4],s[4+a]]);for(this._planeVertices=[this._vertices.slice(0,4),this._vertices.slice(4,8)],a=0;a<4;a++)this._planeVertices.push([this._vertices[a%4],this._vertices[(a+1)%4],this._vertices[4+(a+1)%4],this._vertices[4+a]]);let c=t.getCenter();LG=r.cartesianToCartographic(c,LG),LG.height=(i+n)/2,this.center=r.cartographicToCartesian(LG,c),this._boundingSphere=ue.fromPoints(s)}var P_t=new h,D_t=new he,R_t=new h,O_t=new he,M_t=new h,N_t=new h,L_t=new h,F_t=new h;function B_t(e,t,n,i){let r=new Array(6),o=e.getCenter(),s=i.geodeticSurfaceNormal(o,P_t),a=i.cartesianToCartographic(o,D_t);a.height=n;let c=i.cartographicToCartesian(a,R_t),u=sn.fromPointNormal(c,s);r[0]=u;let f=0,d,p=[],g,m;for(d=0;d<4;d++){g=e.getVertex(d),p[d]=g,m=i.cartesianToCartographic(g,O_t),m.height=t;let A=sn.getPointDistance(u,i.cartographicToCartesian(m,M_t));A<f&&(f=A)}let y=sn.clone(u);for(y.normal=h.negate(y.normal,y.normal),y.distance=y.distance*-1+f,r[1]=y,d=0;d<4;d++){g=p[d];let A=p[(d+1)%4],b=i.geodeticSurfaceNormal(g,N_t),x=h.subtract(A,g,F_t),T=h.cross(x,b,L_t);T=h.normalize(T,T),r[2+d]=sn.fromPointNormal(g,T)}return r}var lE=new h,uE=new h,fE=new h,Ree=new h,Oee=new h,Mee=new h,k_t=new h,U_t=new h,z_t=new h,Nee=new h,Lee=new h,Fee=new h,WA=new h,u0=new $;function Yve(e,t,n){lE=e.normal,uE=t.normal,fE=n.normal,Ree=h.multiplyByScalar(e.normal,-e.distance,Ree),Oee=h.multiplyByScalar(t.normal,-t.distance,Oee),Mee=h.multiplyByScalar(n.normal,-n.distance,Mee),Nee=h.multiplyByScalar(h.cross(uE,fE,k_t),h.dot(Ree,lE),Nee),Lee=h.multiplyByScalar(h.cross(fE,lE,U_t),h.dot(Oee,uE),Lee),Fee=h.multiplyByScalar(h.cross(lE,uE,z_t),h.dot(Mee,fE),Fee),u0[0]=lE.x,u0[1]=uE.x,u0[2]=fE.x,u0[3]=lE.y,u0[4]=uE.y,u0[5]=fE.y,u0[6]=lE.z,u0[7]=uE.z,u0[8]=fE.z;let i=$.determinant(u0);return WA=h.add(Nee,Lee,WA),WA=h.add(WA,Fee,WA),new h(WA.x/i,WA.y/i,WA.z/i)}function V_t(e){let t=new Array(8);for(let n=0;n<4;n++)t[n]=Yve(e[0],e[2+(n+3)%4],e[2+n%4]),t[n+4]=Yve(e[1],e[2+(n+3)%4],e[2+n%4]);return t}var Bee=new h,Yw=new h;function kee(e,t){let n=[];for(let i=0;i<4;i++)Bee=h.subtract(t[(i+1)%4],t[i],Bee),Yw=h.cross(e.normal,Bee,Yw),Yw=h.normalize(Yw,Yw),n[i]=h.clone(Yw);return n}Object.defineProperties(Jk.prototype,{boundingVolume:{get:function(){return this}},boundingSphere:{get:function(){return this._boundingSphere}}});var Uee=new h;Jk.prototype.distanceToCamera=function(e){let t=e.camera.positionWC,n=[],i=[],r;sn.getPointDistance(this._boundingPlanes[0],t)>0?(n.push(0),i.push(this._planeVertices[0]),r=this._edgeNormals[0]):sn.getPointDistance(this._boundingPlanes[1],t)>0&&(n.push(1),i.push(this._planeVertices[1]),r=this._edgeNormals[1]);let o,s;for(o=0;o<4;o++)s=2+o,sn.getPointDistance(this._boundingPlanes[s],t)>0&&(n.push(s),i.push(this._planeVertices[s]),r=this._edgeNormals[s]);if(n.length===0)return 0;let a,c;if(n.length===1)return c=this._boundingPlanes[n[0]],a=zee(sn.projectPointOntoPlane(c,t,Uee),i[0],c,r),h.distance(a,t);if(n.length===2){if(n[0]===0){let p=[this._vertices[4*n[0]+(n[1]-2)],this._vertices[4*n[0]+(n[1]-2+1)%4]];return a=Xve(t,p[0],p[1]),h.distance(a,t)}let f=Number.MAX_VALUE,d;for(o=0;o<2;o++)c=this._boundingPlanes[n[o]],a=zee(sn.projectPointOntoPlane(c,t,Uee),i[o],c,this._edgeNormals[n[o]]),d=h.distanceSquared(a,t),d<f&&(f=d);return Math.sqrt(f)}else if(n.length>3)return a=zee(sn.projectPointOntoPlane(this._boundingPlanes[1],t,Uee),this._planeVertices[1],this._boundingPlanes[1],this._edgeNormals[1]),h.distance(a,t);let u=n[1]===2&&n[2]===5?0:1;return n[0]===0?h.distance(t,this._vertices[(n[1]-2+u)%4]):h.distance(t,this._vertices[4+(n[1]-2+u)%4])};var j_t=new h,H_t=new h;function Xve(e,t,n){let i=h.subtract(n,t,j_t),r=h.subtract(e,t,H_t),o=h.dot(i,r);if(o<=0)return t;let s=h.dot(i,i);return o>=s?n:(o=o/s,new h((1-o)*t.x+o*n.x,(1-o)*t.y+o*n.y,(1-o)*t.z+o*n.z))}var G_t=new sn(h.UNIT_X,0);function zee(e,t,n,i){let r=Number.MAX_VALUE,o,s,a;for(let c=0;c<t.length;c++){let u=sn.fromPointNormal(t[c],i[c],G_t);sn.getPointDistance(u,e)<0||(a=Xve(e,t[c],t[(c+1)%4]),o=h.distance(e,a),o<r&&(r=o,s=a))}return l(s)?s:e}Jk.prototype.intersectPlane=function(e){let t=0,n=0;for(let i=0;i<this._vertices.length;i++)h.dot(e.normal,this._vertices[i])+e.distance<0?n++:t++;return t===this._vertices.length?$t.INSIDE:n===this._vertices.length?$t.OUTSIDE:$t.INTERSECTING};Jk.prototype.createDebugVolume=function(e){let t=N.clone(N.IDENTITY),n=new jd({polygonHierarchy:{positions:this._planeVertices[0]}}),i=jd.createGeometry(n),r=new Ft({geometry:i,id:"outline",modelMatrix:t,attributes:{color:Jt.fromColor(e)}}),o=new jd({polygonHierarchy:{positions:this._planeVertices[1]}}),s=jd.createGeometry(o),a=new Ft({geometry:s,id:"outline",modelMatrix:t,attributes:{color:Jt.fromColor(e)}}),c=[];for(let u=0;u<4;u++){let f=new jd({polygonHierarchy:{positions:this._planeVertices[2+u]}}),d=jd.createGeometry(f);c[u]=new Ft({geometry:d,id:"outline",modelMatrix:t,attributes:{color:Jt.fromColor(e)}})}return new On({geometryInstances:[c[0],c[1],c[2],c[3],a,r],appearance:new yn({translucent:!1,flat:!0}),asynchronous:!1})};var Zk=Jk;function Xw(e){let t=e.radius??1,i={radii:new h(t,t,t),stackPartitions:e.stackPartitions,slicePartitions:e.slicePartitions,subdivisions:e.subdivisions};this._ellipsoidGeometry=new Ff(i),this._workerName="createSphereOutlineGeometry"}Xw.packedLength=Ff.packedLength;Xw.pack=function(e,t,n){return Ff.pack(e._ellipsoidGeometry,t,n)};var W_t=new Ff,dE={radius:void 0,radii:new h,stackPartitions:void 0,slicePartitions:void 0,subdivisions:void 0};Xw.unpack=function(e,t,n){let i=Ff.unpack(e,t,W_t);return dE.stackPartitions=i._stackPartitions,dE.slicePartitions=i._slicePartitions,dE.subdivisions=i._subdivisions,l(n)?(h.clone(i._radii,dE.radii),n._ellipsoidGeometry=new Ff(dE),n):(dE.radius=i._radii.x,new Xw(dE))};Xw.createGeometry=function(e){return Ff.createGeometry(e._ellipsoidGeometry)};var S_=Xw;function Kw(e,t){t===0&&(t=D.EPSILON7),this._boundingSphere=new ue(e,t)}Object.defineProperties(Kw.prototype,{center:{get:function(){return this._boundingSphere.center}},radius:{get:function(){return this._boundingSphere.radius}},boundingVolume:{get:function(){return this._boundingSphere}},boundingSphere:{get:function(){return this._boundingSphere}}});Kw.prototype.distanceToCamera=function(e){let t=this._boundingSphere;return Math.max(0,h.distance(t.center,e.camera.positionWC)-t.radius)};Kw.prototype.intersectPlane=function(e){return ue.intersectPlane(this._boundingSphere,e)};Kw.prototype.update=function(e,t){h.clone(e,this._boundingSphere.center),this._boundingSphere.radius=t};Kw.prototype.createDebugVolume=function(e){let t=new S_({radius:this.radius}),n=N.fromTranslation(this.center,N.clone(N.IDENTITY)),i=new Ft({geometry:t,id:"outline",modelMatrix:n,attributes:{color:Jt.fromColor(e)}});return new On({geometryInstances:i,appearance:new yn({translucent:!1,flat:!0}),asynchronous:!1})};var w_=Kw;var q_t=new h,Y_t=new h,X_t=new h,K_t=new h;function hE(e,t,n){n=h.cross(e,t,n);let i=h.magnitude(n);return h.multiplyByScalar(n,D.EPSILON7/i,n)}function Vee(e,t){let n=h.normalize(e,K_t),i=h.equalsEpsilon(n,h.UNIT_X,D.EPSILON6)?h.UNIT_Y:h.UNIT_X;return hE(e,i,t)}function Kve(e){let t=$.getColumn(e,0,q_t),n=$.getColumn(e,1,Y_t),i=$.getColumn(e,2,X_t),r=h.equals(t,h.ZERO),o=h.equals(n,h.ZERO),s=h.equals(i,h.ZERO);return!r&&!o&&!s?e:r&&o&&s?(e[0]=D.EPSILON7,e[4]=D.EPSILON7,e[8]=D.EPSILON7,e):(r&&!o&&!s?t=hE(n,i,t):!r&&o&&!s?n=hE(t,i,n):!r&&!o&&s?i=hE(n,t,i):r?o?s||(t=Vee(i,t),n=hE(i,t,n)):(t=Vee(n,t),i=hE(n,t,i)):(n=Vee(t,n),i=hE(n,t,i)),$.setColumn(e,0,t,e),$.setColumn(e,1,n,e),$.setColumn(e,2,i,e),e)}function $w(e,t){t=Kve(t),this._orientedBoundingBox=new en(e,t),this._boundingSphere=ue.fromOrientedBoundingBox(this._orientedBoundingBox)}Object.defineProperties($w.prototype,{boundingVolume:{get:function(){return this._orientedBoundingBox}},boundingSphere:{get:function(){return this._boundingSphere}}});$w.prototype.distanceToCamera=function(e){return Math.sqrt(this._orientedBoundingBox.distanceSquaredTo(e.camera.positionWC))};$w.prototype.intersectPlane=function(e){return this._orientedBoundingBox.intersectPlane(e)};$w.prototype.update=function(e,t){h.clone(e,this._orientedBoundingBox.center),t=Kve(t),$.clone(t,this._orientedBoundingBox.halfAxes),ue.fromOrientedBoundingBox(this._orientedBoundingBox,this._boundingSphere)};$w.prototype.createDebugVolume=function(e){let t=new sm({minimum:new h(-1,-1,-1),maximum:new h(1,1,1)}),n=N.fromRotationTranslation(this.boundingVolume.halfAxes,this.boundingVolume.center),i=new Ft({geometry:t,id:"outline",modelMatrix:n,attributes:{color:Jt.fromColor(e)}});return new On({geometryInstances:i,appearance:new yn({translucent:!1,flat:!0}),asynchronous:!1})};var tf=$w;function co(e,t,n,i){this._tileset=e,this._header=n;let r=l(n.contents),o=r&&n.contents.length>1||rr(n,"3DTILES_multiple_contents"),s=r&&!o?n.contents[0]:n.content;this._contentHeader=s,this.transform=l(n.transform)?N.unpack(n.transform):N.clone(N.IDENTITY);let a=l(i)?i.computedTransform:e.modelMatrix,c=N.multiply(a,this.transform,new N),u=l(i)?i._initialTransform:N.IDENTITY;this._initialTransform=N.multiply(u,this.transform,new N),this.computedTransform=c,this.metadata=Kk(e,n),this._verticalExaggeration=1,this._verticalExaggerationRelativeHeight=0,this._boundingVolume=this.createBoundingVolume(n.boundingVolume,c),this._boundingVolume2D=void 0;let f;l(s)&&l(s.boundingVolume)&&(f=this.createBoundingVolume(s.boundingVolume,c)),this._contentBoundingVolume=f,this._contentBoundingVolume2D=void 0;let d;l(n.viewerRequestVolume)&&(d=this.createBoundingVolume(n.viewerRequestVolume,c)),this._viewerRequestVolume=d,this.geometricError=n.geometricError,this._geometricError=n.geometricError,l(this._geometricError)||(this._geometricError=l(i)?i._geometricError:e._geometricError,co._deprecationWarning("geometricErrorUndefined","Required property geometricError is undefined for this tile. Using parent's geometric error instead.")),this.updateGeometricErrorScale();let p;l(n.refine)?((n.refine==="replace"||n.refine==="add")&&co._deprecationWarning("lowercase-refine",`This tile uses a lowercase refine "${n.refine}". Instead use "${n.refine.toUpperCase()}".`),p=n.refine.toUpperCase()==="REPLACE"?Ao.REPLACE:Ao.ADD):l(i)?p=i.refine:p=Ao.REPLACE,this.refine=p,this.children=[],this.parent=i;let g,m=!1,y,A,b;if(t=De.createIfNeeded(t),o)y=Rr.UNLOADED,A=t.clone();else if(l(s)){let v=s.uri;l(s.url)&&(co._deprecationWarning("contentUrl",'This tileset JSON uses the "content.url" property which has been deprecated. Use "content.uri" instead.'),v=s.url),v===""?(co._deprecationWarning("contentUriEmpty","content.uri property is an empty string, which creates a circular dependency, making this tileset invalid. Omit the content property instead"),g=new l0(e,this),m=!0,y=Rr.READY):(y=Rr.UNLOADED,A=t.getDerivedResource({url:v}),b=Kc.getServerKey(A.getUrlComponent()))}else g=new l0(e,this),m=!0,y=Rr.READY;this._content=g,this._contentResource=A,this._contentState=y,this._expiredContent=void 0,this._serverKey=b,this.hasEmptyContent=m,this.hasTilesetContent=!1,this.hasImplicitContent=!1,this.hasRenderableContent=!m,this.hasImplicitContentMetadata=!1,this.hasMultipleContents=o,this.cacheNode=void 0;let x=n.expire,T,E;l(x)&&(T=x.duration,l(x.date)&&(E=K.fromIso8601(x.date))),this.expireDuration=T,this.expireDate=E,this.lastStyleTime=0,this._optimChildrenWithinParent=lh.NOT_COMPUTED,this.clippingPlanesDirty=!1,this.clippingPolygonsDirty=!1,this.clippingPolygonsNeedRebake=!1,this.priorityDeferred=!1,this.implicitTileset=void 0,this.implicitCoordinates=void 0,this.implicitSubtree=void 0,this._distanceToCamera=0,this._centerZDepth=0,this._screenSpaceError=0,this._screenSpaceErrorProgressiveResolution=0,this._visibilityPlaneMask=0,this._visible=!1,this._inRequestVolume=!1,this._finalResolution=!0,this._depth=0,this._stackLength=0,this._selectionDepth=0,this._updatedVisibilityFrame=0,this._touchedFrame=0,this._visitedFrame=0,this._selectedFrame=0,this._wasSelectedLastFrame=!1,this._requestedFrame=0,this._ancestorWithContent=void 0,this._ancestorWithContentAvailable=void 0,this._refines=!1,this._shouldSelect=!1,this._isClipped=!0,this._isClippedByPolygon=!1,this._clippingPlanesState=0,this._clippingPolygonsState=0,this._debugBoundingVolume=void 0,this._debugContentBoundingVolume=void 0,this._debugViewerRequestVolume=void 0,this._debugColor=z.fromRandom({alpha:1}),this._debugColorizeTiles=!1,this._priority=0,this._priorityHolder=this,this._priorityProgressiveResolution=!1,this._priorityProgressiveResolutionScreenSpaceErrorLeaf=!1,this._priorityReverseScreenSpaceError=0,this._foveatedFactor=0,this._wasMinPriorityChild=!1,this._loadTimestamp=new K,this._commandsLength=0,this._color=void 0,this._colorDirty=!1,this._request=void 0}co._deprecationWarning=qr;Object.defineProperties(co.prototype,{tileset:{get:function(){return this._tileset}},content:{get:function(){return this._content}},boundingVolume:{get:function(){return this._boundingVolume}},contentBoundingVolume:{get:function(){return this._contentBoundingVolume??this._boundingVolume}},boundingSphere:{get:function(){return this._boundingVolume.boundingSphere}},isVisible:{get:function(){return this._visible&&this._inRequestVolume}},extras:{get:function(){return this._header.extras}},color:{get:function(){return l(this._color)||(this._color=new z),z.clone(this._color)},set:function(e){this._color=z.clone(e,this._color),this._colorDirty=!0}},contentAvailable:{get:function(){return this.contentReady&&this.hasRenderableContent||l(this._expiredContent)&&!this.contentFailed}},contentReady:{get:function(){return this._contentState===Rr.READY}},contentUnloaded:{get:function(){return this._contentState===Rr.UNLOADED}},hasUnloadedRenderableContent:{get:function(){return this.hasRenderableContent&&this.contentUnloaded}},contentExpired:{get:function(){return this._contentState===Rr.EXPIRED}},contentFailed:{get:function(){return this._contentState===Rr.FAILED}},commandsLength:{get:function(){return this._commandsLength}}});var qA=new h;function $_t(e,t){let{tileset:n,boundingSphere:i}=e,{radius:r,center:o}=i,{camera:s}=t,a=h.multiplyByScalar(s.directionWC,e._centerZDepth,qA),c=h.add(s.positionWC,a,qA),u=h.subtract(c,o,qA);if(h.magnitude(u)>r){let E=h.normalize(u,qA),v=h.multiplyByScalar(E,r,qA),S=h.add(o,v,qA),I=h.subtract(S,s.positionWC,qA),R=h.normalize(I,qA);e._foveatedFactor=1-Math.abs(h.dot(s.directionWC,R))}else e._foveatedFactor=0;let p=e.refine===Ao.REPLACE,g=n.isSkippingLevelOfDetail;if(p&&!g||!n.foveatedScreenSpaceError||n.foveatedConeSize===1||e._priorityProgressiveResolution&&p&&g||n._pass===ao.PRELOAD_FLIGHT||n._pass===ao.PRELOAD)return!1;let m=1-Math.cos(s.frustum.fov*.5),y=n.foveatedConeSize*m;if(e._foveatedFactor<=y)return!1;let A=m-y,b=D.clamp((e._foveatedFactor-y)/A,0,1),x=n.foveatedInterpolationCallback(n.foveatedMinimumScreenSpaceErrorRelaxation,n.memoryAdjustedScreenSpaceError,b),T=e._screenSpaceError===0&&l(e.parent)?e.parent._screenSpaceError*.5:e._screenSpaceError;return n.memoryAdjustedScreenSpaceError-x<=T}var tSe=new K;co.prototype.getScreenSpaceError=function(e,t,n){let i=this._tileset,r=n??1,o=l(this.parent)?this.parent.geometricError:i._scaledGeometricError,s=t?o:this.geometricError;if(s===0)return 0;let{camera:a,context:c}=e,u=a.frustum,f=c.drawingBufferWidth,d=c.drawingBufferHeight*r,p;if(e.mode===re.SCENE2D||u instanceof gn){let g=u.offCenterFrustum;l(g)&&(u=g);let m=Math.max(u.top-u.bottom,u.right-u.left)/Math.max(f,d);p=s/m}else{let g=Math.max(this._distanceToCamera,D.EPSILON7),m=u.sseDenominator;if(p=s*d/(g*m),i.dynamicScreenSpaceError){let y=i._dynamicScreenSpaceErrorComputedDensity,A=i.dynamicScreenSpaceErrorFactor,b=D.fog(g,y)*A;p-=b}}return p/=e.pixelRatio,p};function J_t(e,t){if(e.progressiveResolutionHeightFraction<=0||e.progressiveResolutionHeightFraction>.5)return!1;let n=e.memoryAdjustedScreenSpaceError,i=t._screenSpaceErrorProgressiveResolution>n;t._priorityProgressiveResolutionScreenSpaceErrorLeaf=!1;let r=t.parent,o=t._screenSpaceErrorProgressiveResolution<=n,s=l(r)&&r._screenSpaceErrorProgressiveResolution>n;return o&&s&&(t._priorityProgressiveResolutionScreenSpaceErrorLeaf=!0,i=!0),i}function Z_t(e,t){let n=t.parent,r=l(n)&&(!e.isSkippingLevelOfDetail||t._screenSpaceError===0||n.hasTilesetContent||n.hasImplicitContent)?n._screenSpaceError:t._screenSpaceError;return e.root._screenSpaceError-r}co.prototype.updateVisibility=function(e){let{parent:t,tileset:n}=this;if(this._updatedVisibilityFrame===n._updatedVisibilityFrame)return;let i=l(t)?t.computedTransform:n.modelMatrix,r=l(t)?t._visibilityPlaneMask:ta.MASK_INDETERMINATE;this.updateTransform(i,e),this._distanceToCamera=this.distanceToTile(e),this._centerZDepth=this.distanceToTileCenter(e),this._screenSpaceError=this.getScreenSpaceError(e,!1),this._screenSpaceErrorProgressiveResolution=this.getScreenSpaceError(e,!1,n.progressiveResolutionHeightFraction),this._visibilityPlaneMask=this.visibility(e,r),this._visible=this._visibilityPlaneMask!==ta.MASK_OUTSIDE,this._inRequestVolume=this.insideViewerRequestVolume(e),this._priorityReverseScreenSpaceError=Z_t(n,this),this._priorityProgressiveResolution=J_t(n,this),this.priorityDeferred=$_t(this,e),this._updatedVisibilityFrame=n._updatedVisibilityFrame};co.prototype.updateExpiration=function(){if(l(this.expireDate)&&this.contentReady&&!this.hasEmptyContent&&!this.hasMultipleContents){let e=K.now(tSe);K.lessThan(this.expireDate,e)&&(this._contentState=Rr.EXPIRED,this._expiredContent=this._content)}};function Q_t(e){if(!l(e.expireDuration))return;let t=K.now(tSe);K.addSeconds(t,e.expireDuration,t),l(e.expireDate)?K.lessThan(e.expireDate,t)&&K.clone(t,e.expireDate):e.expireDate=K.clone(t)}function eyt(e){return function(){return e._priority}}co.prototype.requestContent=function(){if(!this.hasEmptyContent)return this.hasMultipleContents?tyt(this):iyt(this)};function tyt(e){let t=e._content,n=e._tileset;if(!l(t)){let r=rr(e._header,"3DTILES_multiple_contents")?e._header.extensions["3DTILES_multiple_contents"]:e._header;t=new $k(n,e,e._contentResource.clone(),r),e._content=t}let i=t.requestInnerContents();if(l(i))return e._contentState=Rr.LOADING,i.then(r=>{if(!e.isDestroyed()&&l(r))return e._contentState=Rr.PROCESSING,t}).catch(r=>{if(!e.isDestroyed())throw e._contentState=Rr.FAILED,r})}async function nyt(e,t,n,i,r){let o=e._contentState;e._contentState=Rr.LOADING,++t.statistics.numberOfPendingRequests;let s;try{s=await r}catch(a){if(--t.statistics.numberOfPendingRequests,e.isDestroyed())return;if(n.cancelled||n.state===Ti.CANCELLED){e._contentState=o,++t.statistics.numberOfAttemptedRequests;return}if(nSe(e,a))return i&&(e.expireDate=void 0),e._content=new l0(t,e),$ve(e),e._contentState=Rr.PROCESSING,e._content;throw e._contentState=Rr.FAILED,a}if(e.isDestroyed()){--t.statistics.numberOfPendingRequests;return}if(n.cancelled||n.state===Ti.CANCELLED){e._contentState=o,--t.statistics.numberOfPendingRequests,++t.statistics.numberOfAttemptedRequests;return}try{let a=await ryt(e,s);return--t.statistics.numberOfPendingRequests,e.isDestroyed()?void 0:(i&&(e.expireDate=void 0),e._content=a,a instanceof l0&&$ve(e),e._contentState=Rr.PROCESSING,a)}catch(a){if(--t.statistics.numberOfPendingRequests,e.isDestroyed())return;throw e._contentState=Rr.FAILED,a}}function iyt(e){let t=e._contentResource.clone(),n=e.contentExpired;n&&t.setQueryParameters({expired:e.expireDate.toString()});let i=new wo({throttle:!0,throttleByServer:!0,type:Zs.TILES3D,priorityFunction:eyt(e),serverKey:e._serverKey});e._request=i,t.request=i;let r=e._tileset,o=t.fetchArrayBuffer();if(!l(o)){++r.statistics.numberOfAttemptedRequests;return}return nyt(e,r,i,n,o)}function nSe(e,t){let i=e._tileset?._runtimeContentCodec?.missingTilePolicy;return!l(i)||!l(t.statusCode)?!1:i.statusCodes.includes(t.statusCode)}function $ve(e){e.hasEmptyContent=!0,e.hasRenderableContent=!1}co._isEmptyTile=nSe;async function ryt(e,t){let n=e._tileset,i=n?._runtimeContentCodec;if(l(i)&&typeof i.createContent=="function"){let u=await Promise.resolve(i.createContent(n,e,e._contentResource,t));return e.isDestroyed()?void 0:u}let r=v_(t);n._disableSkipLevelOfDetail=n._disableSkipLevelOfDetail||r.contentType===wa.GEOMETRY||r.contentType===wa.VECTOR,(r.contentType===wa.IMPLICIT_SUBTREE||r.contentType===wa.IMPLICIT_SUBTREE_JSON)&&(e.hasImplicitContent=!0,e.hasRenderableContent=!1),r.contentType===wa.EXTERNAL_TILESET&&(e.hasTilesetContent=!0,e.hasRenderableContent=!1);let o,s=sE[r.contentType];if(e.isDestroyed())return;l(r.binaryPayload)?o=await Promise.resolve(s(n,e,e._contentResource,r.binaryPayload.buffer,0)):o=await Promise.resolve(s(n,e,e._contentResource,r.jsonPayload));let a=e._contentHeader;if(e.hasImplicitContentMetadata){let u=e.implicitSubtree,f=e.implicitCoordinates;o.metadata=u.getContentMetadataView(f,0)}else e.hasImplicitContent||(o.metadata=aE(n,a));let c=cE(n,a);return l(c)&&(o.group=new YT({metadata:c})),o}co.prototype.cancelRequests=function(){this.hasMultipleContents?this._content.cancelRequests():this._request.cancel()};co.prototype.unloadTilesetContent=function(){this.hasTilesetContent&&(this._content=this._content&&this._content.destroy(),this._contentState=Rr.UNLOADED,this._expiredContent=void 0,this.expireDate=void 0,this.hasTilesetContent=!1,this.hasRenderableContent=!0,this._selectedFrame=0,this.lastStyleTime=0)};co.prototype.unloadContent=function(){this.hasRenderableContent&&(this._content=this._content&&this._content.destroy(),this._contentState=Rr.UNLOADED,this.lastStyleTime=0,this.clippingPlanesDirty=this._clippingPlanesState===0,this._clippingPlanesState=0,this.clippingPolygonsDirty=this._clippingPolygonsState===0,this._clippingPolygonsState=0,this.clippingPolygonsNeedRebake=!1,this._debugColorizeTiles=!1,this._debugBoundingVolume=this._debugBoundingVolume&&this._debugBoundingVolume.destroy(),this._debugContentBoundingVolume=this._debugContentBoundingVolume&&this._debugContentBoundingVolume.destroy(),this._debugViewerRequestVolume=this._debugViewerRequestVolume&&this._debugViewerRequestVolume.destroy())};var iSe=new ue;function Hee(e,t){if(t.mode!==re.SCENE3D&&!l(e._boundingVolume2D)){let n=e._boundingVolume.boundingSphere,i=ue.projectTo2D(n,t.mapProjection,iSe);e._boundingVolume2D=new w_(i.center,i.radius)}return t.mode!==re.SCENE3D?e._boundingVolume2D:e._boundingVolume}function oyt(e,t){if(t.mode!==re.SCENE3D&&!l(e._contentBoundingVolume2D)){let n=e._contentBoundingVolume.boundingSphere,i=ue.projectTo2D(n,t.mapProjection,iSe);e._contentBoundingVolume2D=new w_(i.center,i.radius)}return t.mode!==re.SCENE3D?e._contentBoundingVolume2D:e._contentBoundingVolume}co.prototype.visibility=function(e,t){let n=e.cullingVolume,i=Hee(this,e),r=this._tileset,o=r.clippingPlanes;if(l(o)&&o.enabled){let a=o.computeIntersectionWithBoundingVolume(i,r.clippingPlanesOriginMatrix);if(this._isClipped=a!==$t.INSIDE,a===$t.OUTSIDE)return ta.MASK_OUTSIDE}let s=r.clippingPolygons;if(l(s)&&s.enabled){let a=s.computeIntersectionWithBoundingVolume(i);this._isClippedByPolygon=a!==$t.OUTSIDE}return n.computeVisibilityWithPlaneMask(i,t)};co.prototype.contentVisibility=function(e){if(!l(this._contentBoundingVolume))return $t.INSIDE;if(this._visibilityPlaneMask===ta.MASK_INSIDE)return $t.INSIDE;let t=e.cullingVolume,n=oyt(this,e),i=this._tileset,r=i.clippingPlanes;if(l(r)&&r.enabled){let s=r.computeIntersectionWithBoundingVolume(n,i.clippingPlanesOriginMatrix);if(this._isClipped=s!==$t.INSIDE,s===$t.OUTSIDE)return $t.OUTSIDE}let o=i.clippingPolygons;if(l(o)&&o.enabled){let s=o.computeIntersectionWithBoundingVolume(n);if(this._isClippedByPolygon=s!==$t.OUTSIDE,s===$t.INSIDE)return $t.OUTSIDE}return t.computeVisibility(n)};co.prototype.distanceToTile=function(e){return Hee(this,e).distanceToCamera(e)};var syt=new h;co.prototype.distanceToTileCenter=function(e){let n=Hee(this,e).boundingVolume,i=h.subtract(n.center,e.camera.positionWC,syt);return h.dot(e.camera.directionWC,i)};co.prototype.insideViewerRequestVolume=function(e){let t=this._viewerRequestVolume;return!l(t)||t.distanceToCamera(e)===0};var rSe=new $,oSe=new h,ayt=new $,Gee=new h,sSe=new ie,aSe=new en,jee=new N;function cyt(e,t,n){let i=h.fromElements(e[0],e[1],e[2],Gee),r=$.fromArray(e,3,ayt);i=N.multiplyByPoint(t,i,i);let o=N.getMatrix3(t,rSe);return r=$.multiply(o,r,r),l(n)?(n.update(i,r),n):new tf(i,r)}function Jve(e,t,n,i){let r=ie.unpack(e,0,sSe),o=e[4],s=e[5],a=en.fromRectangle(r,o,s,ee.WGS84,aSe),c=a.center,u=a.halfAxes;t=N.multiplyTransformation(t,N.inverseTransformation(n,jee),jee),c=N.multiplyByPoint(t,c,c);let f=N.getMatrix3(t,rSe);return u=$.multiply(f,u,u),l(i)&&i instanceof tf?(i.update(c,u),i):new tf(c,u)}function lyt(e,t,n,i){if(!N.equalsEpsilon(t,n,D.EPSILON8))return i instanceof tf?Jve(e,t,n,i):Jve(e,t,n,void 0);let r=ie.unpack(e,0,sSe);return i instanceof ed?(i.rectangle=ie.clone(r,i.rectangle),i.minimumHeight=e[4],i.maximumHeight=e[5],i.computeBoundingVolumes(ee.WGS84),i):new ed({rectangle:r,minimumHeight:e[4],maximumHeight:e[5]})}function uyt(e,t,n){let i=h.fromElements(e[0],e[1],e[2],Gee),r=e[3];i=N.multiplyByPoint(t,i,i);let o=N.getScale(t,oSe),s=h.maximumComponent(o);return r*=s,l(n)?(n.update(i,r),n):new w_(i,r)}co.prototype.createBoundingVolume=function(e,t,n){let i=this.metadata,r;if(l(i)&&(r=UA.parseBoundingVolumeSemantic("TILE",i)),l(r)&&(e=r),!l(e))throw new oe("boundingVolume must be defined");if(rr(e,"3DTILES_bounding_volume_S2"))return new Zk(e.extensions["3DTILES_bounding_volume_S2"]);let{box:o,region:s,sphere:a}=e;if(l(o)){let c=cyt(o,t,n);return this._verticalExaggeration!==1&&Zve(c,this._verticalExaggeration,this._verticalExaggerationRelativeHeight),c}if(l(s)){let c=lyt(s,t,this._initialTransform,n);return this._verticalExaggeration===1||(c instanceof tf?Zve(c,this._verticalExaggeration,this._verticalExaggerationRelativeHeight):(c.minimumHeight=Ar.getHeight(c.minimumHeight,this._verticalExaggeration,this._verticalExaggerationRelativeHeight),c.maximumHeight=Ar.getHeight(c.maximumHeight,this._verticalExaggeration,this._verticalExaggerationRelativeHeight),c.computeBoundingVolumes(ee.WGS84))),c}if(l(a)){let c=uyt(a,t,n);if(this._verticalExaggeration!==1){let u=Ar.getPosition(c.center,ee.WGS84,this._verticalExaggeration,this._verticalExaggerationRelativeHeight,Gee),f=c.radius*this._verticalExaggeration;c.update(u,f)}return c}throw new oe("boundingVolume must contain a sphere, region, or box")};var fyt=h.unpackArray(new Array(24).fill(0));function Zve(e,t,n){let i=e.boundingVolume.computeCorners(fyt).map(o=>Ar.getPosition(o,ee.WGS84,t,n,o)),r=en.fromPoints(i,aSe);e.update(r.center,r.halfAxes)}co.prototype.updateTransform=function(e,t){e=e??N.IDENTITY;let n=N.multiplyTransformation(e,this.transform,jee),i=!N.equals(n,this.computedTransform),r=l(t)&&(this._verticalExaggeration!==t.verticalExaggeration||this._verticalExaggerationRelativeHeight!==t.verticalExaggerationRelativeHeight);if(!i&&!r)return;i&&N.clone(n,this.computedTransform),r&&(this._verticalExaggeration=t.verticalExaggeration,this._verticalExaggerationRelativeHeight=t.verticalExaggerationRelativeHeight);let o=this._header,s=this._contentHeader;this._boundingVolume=this.createBoundingVolume(o.boundingVolume,this.computedTransform,this._boundingVolume),l(this._contentBoundingVolume)&&(this._contentBoundingVolume=this.createBoundingVolume(s.boundingVolume,this.computedTransform,this._contentBoundingVolume)),l(this._viewerRequestVolume)&&(this._viewerRequestVolume=this.createBoundingVolume(o.viewerRequestVolume,this.computedTransform,this._viewerRequestVolume)),this.updateGeometricErrorScale(),this._debugBoundingVolume=this._debugBoundingVolume&&this._debugBoundingVolume.destroy(),this._debugContentBoundingVolume=this._debugContentBoundingVolume&&this._debugContentBoundingVolume.destroy(),this._debugViewerRequestVolume=this._debugViewerRequestVolume&&this._debugViewerRequestVolume.destroy()};co.prototype.updateGeometricErrorScale=function(){let e=N.getScale(this.computedTransform,oSe),t=h.maximumComponent(e);if(this.geometricError=this._geometricError*t,!l(this.parent)){let n=this._tileset;n._scaledGeometricError=n._geometricError*t}};function dyt(e,t,n,i){if(!i.isRender)return;let r=l(e._contentHeader)&&l(e._contentHeader.boundingVolume),o=t.debugShowBoundingVolume||t.debugShowContentBoundingVolume&&!r;if(o){let c;e._finalResolution?e.hasRenderableContent?c=z.WHITE:c=z.DARKGRAY:c=z.YELLOW,l(e._debugBoundingVolume)||(e._debugBoundingVolume=e._boundingVolume.createDebugVolume(c)),e._debugBoundingVolume.update(n);let u=e._debugBoundingVolume.getGeometryInstanceAttributes("outline");u.color=Jt.toValue(c,u.color)}else!o&&l(e._debugBoundingVolume)&&(e._debugBoundingVolume=e._debugBoundingVolume.destroy());t.debugShowContentBoundingVolume&&r?(l(e._debugContentBoundingVolume)||(e._debugContentBoundingVolume=e._contentBoundingVolume.createDebugVolume(z.BLUE)),e._debugContentBoundingVolume.update(n)):!t.debugShowContentBoundingVolume&&l(e._debugContentBoundingVolume)&&(e._debugContentBoundingVolume=e._debugContentBoundingVolume.destroy()),t.debugShowViewerRequestVolume&&l(e._viewerRequestVolume)?(l(e._debugViewerRequestVolume)||(e._debugViewerRequestVolume=e._viewerRequestVolume.createDebugVolume(z.YELLOW)),e._debugViewerRequestVolume.update(n)):!t.debugShowViewerRequestVolume&&l(e._debugViewerRequestVolume)&&(e._debugViewerRequestVolume=e._debugViewerRequestVolume.destroy());let s=t.debugColorizeTiles&&!e._debugColorizeTiles||l(t._heatmap.tilePropertyName),a=!t.debugColorizeTiles&&e._debugColorizeTiles;s?(t._heatmap.colorize(e,n),e._debugColorizeTiles=!0,e.color=e._debugColor):a&&(e._debugColorizeTiles=!1,e.color=z.WHITE),e._colorDirty&&(e._colorDirty=!1,e._content.applyDebugSettings(!0,e._color)),a&&t.makeStyleDirty()}function hyt(e,t,n){let i=e._expiredContent;if(!e.hasMultipleContents&&l(i)){if(!e.contentReady){try{i.update(t,n)}catch{}return}e._expiredContent.destroy(),e._expiredContent=void 0}if(l(e.content))try{e.content.update(t,n)}catch(r){throw e._contentState=Rr.FAILED,r}}function myt(e,t){let n=t.clippingPlanes,i=0;l(n)&&e._isClipped&&n.enabled&&(i=n.clippingPlanesState),i!==e._clippingPlanesState&&(e._clippingPlanesState=i,e.clippingPlanesDirty=!0)}function pyt(e,t){let n=t.clippingPolygons,i=0;l(n)&&e._isClippedByPolygon&&n.enabled&&(i=n.clippingPolygonsState),i!==e._clippingPolygonsState&&(e._clippingPolygonsState=i,e.clippingPolygonsDirty=!0)}co.prototype.update=function(e,t,n){let{commandList:i}=t,r=i.length;myt(this,e),pyt(this,e),dyt(this,e,t,n),hyt(this,e,t);let o=i.length;this._commandsLength=o-r;for(let s=r;s<o;++s){let a=i[s],c=a.pass===Ie.TRANSLUCENT;a.depthForTranslucentClassification=c}this.clippingPlanesDirty=!1,this.clippingPolygonsDirty=!1,this.clippingPolygonsNeedRebake=!1};var Qve=[];co.prototype.process=function(e,t){!this.contentExpired&&!this.contentReady&&this._content.ready&&(Q_t(this),this._selectedFrame=0,this.lastStyleTime=0,K.now(this._loadTimestamp),this._contentState=Rr.READY,!this.hasTilesetContent&&!this.hasImplicitContent&&(e._statistics.incrementLoadCounts(this.content),++e._statistics.numberOfTilesWithContentReady,++e._statistics.numberOfLoadedTilesTotal,e._cache.add(this)));let n=t.commandList;t.commandList=Qve;try{this._content.update(e,t)}catch(i){throw this._contentState=Rr.FAILED,i}Qve.length=0,t.commandList=n};function eSe(e,t,n){let i=e*Math.pow(10,t);return parseInt(i)*Math.pow(10,n)}function FG(e,t,n){return Math.max(D.normalize(e,t,n)-D.EPSILON7,0)}co.prototype.updatePriority=function(){let e=this.tileset,t=e.preferLeaves,n=e._minimumPriority,i=e._maximumPriority,r=4,o=1,s=0,a=r,c=s+a,u=r,f=c+u,d=o,p=Math.pow(10,f),g=f+d,m=o,y=Math.pow(10,g),A=g+m,b=Math.pow(10,A),x=FG(this._depth,n.depth,i.depth);x=t?1-x:x;let E=!e.isSkippingLevelOfDetail&&this.refine===Ao.REPLACE?FG(this._priorityHolder._distanceToCamera,n.distance,i.distance):FG(this._priorityReverseScreenSpaceError,n.reverseScreenSpaceError,i.reverseScreenSpaceError),v=eSe(E,a,s),S=this._priorityProgressiveResolution?0:p,I=FG(this._priorityHolder._foveatedFactor,n.foveatedFactor,i.foveatedFactor),R=eSe(I,u,c),O=this.priorityDeferred?y:0,L=e._pass===ao.PRELOAD_FLIGHT?0:b;this._priority=x+v+S+R+O+L};co.prototype.isDestroyed=function(){return!1};co.prototype.destroy=function(){return this._content=this._content&&this._content.destroy(),this._expiredContent=this._expiredContent&&!this._expiredContent.isDestroyed()&&this._expiredContent.destroy(),this._debugBoundingVolume=this._debugBoundingVolume&&this._debugBoundingVolume.destroy(),this._debugContentBoundingVolume=this._debugContentBoundingVolume&&this._debugContentBoundingVolume.destroy(),this._debugViewerRequestVolume=this._debugViewerRequestVolume&&this._debugViewerRequestVolume.destroy(),le(this)};var fh=co;function I_(e){e=e??H.EMPTY_OBJECT;let t=e.id,n=e.group,i=e.class,r=l(n.properties)?n.properties:{};this._class=i,this._properties=r,this._id=t,this._extras=n.extras,this._extensions=n.extensions}Object.defineProperties(I_.prototype,{class:{get:function(){return this._class}},id:{get:function(){return this._id}},extras:{get:function(){return this._extras}},extensions:{get:function(){return this._extensions}}});I_.prototype.hasProperty=function(e){return Yn.hasProperty(e,this._properties,this._class)};I_.prototype.hasPropertyBySemantic=function(e){return Yn.hasPropertyBySemantic(e,this._properties,this._class)};I_.prototype.getPropertyIds=function(e){return Yn.getPropertyIds(this._properties,this._class,e)};I_.prototype.getProperty=function(e){return Yn.getProperty(e,this._properties,this._class)};I_.prototype.setProperty=function(e,t){return Yn.setProperty(e,t,this._properties,this._class)};I_.prototype.getPropertyBySemantic=function(e){return Yn.getPropertyBySemantic(e,this._properties,this._class)};I_.prototype.setPropertyBySemantic=function(e,t){return Yn.setPropertyBySemantic(e,t,this._properties,this._class)};var Jw=I_;function P_(e){e=e??H.EMPTY_OBJECT;let t=e.tileset,n=e.class,i=l(t.properties)?t.properties:{};this._class=n,this._properties=i,this._extras=t.extras,this._extensions=t.extensions}Object.defineProperties(P_.prototype,{class:{get:function(){return this._class}},extras:{get:function(){return this._extras}},extensions:{get:function(){return this._extensions}}});P_.prototype.hasProperty=function(e){return Yn.hasProperty(e,this._properties,this._class)};P_.prototype.hasPropertyBySemantic=function(e){return Yn.hasPropertyBySemantic(e,this._properties,this._class)};P_.prototype.getPropertyIds=function(e){return Yn.getPropertyIds(this._properties,this._class,e)};P_.prototype.getProperty=function(e){return Yn.getProperty(e,this._properties,this._class)};P_.prototype.setProperty=function(e,t){return Yn.setProperty(e,t,this._properties,this._class)};P_.prototype.getPropertyBySemantic=function(e){return Yn.getPropertyBySemantic(e,this._properties,this._class)};P_.prototype.setPropertyBySemantic=function(e,t){return Yn.setPropertyBySemantic(e,t,this._properties,this._class)};var Qk=P_;function cSe(e){e=e??H.EMPTY_OBJECT;let t=e.metadataJson,n=e.schema,i=t.metadata??t.tileset,r;l(i)&&(r=new Qk({tileset:i,class:n.classes[i.class]}));let o=[],s=[],a=t.groups;if(Array.isArray(a)){let c=a.length;for(let u=0;u<c;u++){let f=a[u];s.push(new Jw({group:f,class:n.classes[f.class]}))}}else if(l(a)){o=Object.keys(a).sort();let c=o.length;for(let u=0;u<c;u++){let f=o[u];if(a.hasOwnProperty(f)){let d=a[f];s.push(new Jw({id:f,group:a[f],class:n.classes[d.class]}))}}}this._schema=n,this._groups=s,this._groupIds=o,this._tileset=r,this._statistics=t.statistics,this._extras=t.extras,this._extensions=t.extensions}Object.defineProperties(cSe.prototype,{schema:{get:function(){return this._schema}},groups:{get:function(){return this._groups}},groupIds:{get:function(){return this._groupIds}},tileset:{get:function(){return this._tileset}},statistics:{get:function(){return this._statistics}},extras:{get:function(){return this._extras}},extensions:{get:function(){return this._extensions}}});var mE=cSe;var lSe={},gyt=new h;lSe.checkChildrenWithinParent=function(e){let t=e.children,n=t.length,i=e.boundingVolume;if(i instanceof tf||i instanceof ed){let r=i._orientedBoundingBox;e._optimChildrenWithinParent=lh.USE_OPTIMIZATION;for(let o=0;o<n;++o){let a=t[o].boundingVolume;if(!(a instanceof tf||a instanceof ed)){e._optimChildrenWithinParent=lh.SKIP_OPTIMIZATION;break}let c=a._orientedBoundingBox,u=h.subtract(c.center,r.center,gyt),f=h.magnitude(u);h.divideByScalar(u,f,u);let d=Math.abs(r.halfAxes[0]*u.x)+Math.abs(r.halfAxes[1]*u.y)+Math.abs(r.halfAxes[2]*u.z)+Math.abs(r.halfAxes[3]*u.x)+Math.abs(r.halfAxes[4]*u.y)+Math.abs(r.halfAxes[5]*u.z)+Math.abs(r.halfAxes[6]*u.x)+Math.abs(r.halfAxes[7]*u.y)+Math.abs(r.halfAxes[8]*u.z),p=Math.abs(c.halfAxes[0]*u.x)+Math.abs(c.halfAxes[1]*u.y)+Math.abs(c.halfAxes[2]*u.z)+Math.abs(c.halfAxes[3]*u.x)+Math.abs(c.halfAxes[4]*u.y)+Math.abs(c.halfAxes[5]*u.z)+Math.abs(c.halfAxes[6]*u.x)+Math.abs(c.halfAxes[7]*u.y)+Math.abs(c.halfAxes[8]*u.z);if(d<=p+f){e._optimChildrenWithinParent=lh.SKIP_OPTIMIZATION;break}}}return e._optimChildrenWithinParent===lh.USE_OPTIMIZATION};var e3=lSe;function t3(){this.head=void 0,this.tail=void 0,this._length=0}Object.defineProperties(t3.prototype,{length:{get:function(){return this._length}}});function _yt(e,t,n){this.item=e,this.previous=t,this.next=n}t3.prototype.add=function(e){let t=new _yt(e,this.tail,void 0);return l(this.tail)?(this.tail.next=t,this.tail=t):(this.head=t,this.tail=t),++this._length,t};function uSe(e,t){l(t.previous)&&l(t.next)?(t.previous.next=t.next,t.next.previous=t.previous):l(t.previous)?(t.previous.next=void 0,e.tail=t.previous):l(t.next)?(t.next.previous=void 0,e.head=t.next):(e.head=void 0,e.tail=void 0),t.next=void 0,t.previous=void 0}t3.prototype.remove=function(e){l(e)&&(uSe(this,e),--this._length)};t3.prototype.splice=function(e,t){if(e===t)return;uSe(this,t);let n=e.next;e.next=t,this.tail===e?this.tail=t:n.previous=t,t.next=n,t.previous=e};var n3=t3;function YA(){this._list=new n3,this._sentinel=this._list.add(),this._trimTiles=!1}YA.prototype.reset=function(){this._list.splice(this._list.tail,this._sentinel)};YA.prototype.touch=function(e){let t=e.cacheNode;l(t)&&this._list.splice(this._sentinel,t)};YA.prototype.add=function(e){l(e.cacheNode)||(e.cacheNode=this._list.add(e))};YA.prototype.forEachLoadedTile=function(e){for(let t=this._list.head;l(t);t=t.next)l(t.item)&&e(t.item)};YA.prototype.unloadTile=function(e,t,n){let i=t.cacheNode;l(i)&&(this._list.remove(i),t.cacheNode=void 0,n(e,t))};YA.prototype.unloadTiles=function(e,t){let n=this._trimTiles;this._trimTiles=!1;let i=this._list,r=this._sentinel,o=i.head;for(;o!==r&&(e.totalMemoryUsageInBytes>e.cacheBytes||n);){let s=o.item;o=o.next,this.unloadTile(e,s,t)}};YA.prototype.trim=function(){this._trimTiles=!0};var i3=YA;function BG(e){this.tilePropertyName=e,this._minimum=Number.MAX_VALUE,this._maximum=-Number.MAX_VALUE,this._previousMinimum=Number.MAX_VALUE,this._previousMaximum=-Number.MAX_VALUE,this._referenceMinimum={},this._referenceMaximum={}}function qee(e,t){let n;return t==="_loadTimestamp"?n=K.toDate(e).getTime():n=e,n}BG.prototype.setReferenceMinimumMaximum=function(e,t,n){this._referenceMinimum[n]=qee(e,n),this._referenceMaximum[n]=qee(t,n)};function yyt(e,t){let n=e.tilePropertyName;if(l(n)){let i=qee(t[n],n);return l(i)?(e._maximum=Math.max(i,e._maximum),e._minimum=Math.min(i,e._minimum),i):(e.tilePropertyName=void 0,i)}}var Wee=[new z(.1,.1,.1,1),new z(.153,.278,.878,1),new z(.827,.231,.49,1),new z(.827,.188,.22,1),new z(1,.592,.259,1),new z(1,.843,0,1)];BG.prototype.colorize=function(e,t){let n=this.tilePropertyName;if(!l(n)||!e.contentAvailable||e._selectedFrame!==t.frameNumber)return;let i=yyt(this,e),r=this._previousMinimum,o=this._previousMaximum;if(r===Number.MAX_VALUE||o===-Number.MAX_VALUE)return;let s=o-r+D.EPSILON7,c=D.clamp(i-r,0,s)/s,u=Wee.length-1,f=c*u,d=Math.floor(f),p=Math.ceil(f),g=f-d,m=Wee[d],y=Wee[p],A=z.clone(z.WHITE);A.red=D.lerp(m.red,y.red,g),A.green=D.lerp(m.green,y.green,g),A.blue=D.lerp(m.blue,y.blue,g),e._debugColor=A};BG.prototype.resetMinimumMaximum=function(){let e=this.tilePropertyName;if(l(e)){let t=this._referenceMinimum[e],n=this._referenceMaximum[e],i=l(t)&&l(n);this._previousMinimum=i?t:this._minimum,this._previousMaximum=i?n:this._maximum,this._minimum=Number.MAX_VALUE,this._maximum=-Number.MAX_VALUE}};var r3=BG;function Zw(){this.selected=0,this.visited=0,this.numberOfCommands=0,this.numberOfAttemptedRequests=0,this.numberOfPendingRequests=0,this.numberOfTilesProcessing=0,this.numberOfTilesWithContentReady=0,this.numberOfTilesTotal=0,this.numberOfLoadedTilesTotal=0,this.numberOfFeaturesSelected=0,this.numberOfFeaturesLoaded=0,this.numberOfPointsSelected=0,this.numberOfPointsLoaded=0,this.numberOfTrianglesSelected=0,this.numberOfTilesStyled=0,this.numberOfFeaturesStyled=0,this.numberOfTilesCulledWithChildrenUnion=0,this.geometryByteLength=0,this.texturesByteLength=0,this.texturesReferenceCounterById={},this.batchTableByteLength=0}Zw.prototype.clear=function(){this.selected=0,this.visited=0,this.numberOfCommands=0,this.numberOfAttemptedRequests=0,this.numberOfFeaturesSelected=0,this.numberOfPointsSelected=0,this.numberOfTrianglesSelected=0,this.numberOfTilesStyled=0,this.numberOfFeaturesStyled=0,this.numberOfTilesCulledWithChildrenUnion=0};Zw.prototype.incrementSelectionCounts=function(e){this.numberOfFeaturesSelected+=e.featuresLength,this.numberOfPointsSelected+=e.pointsLength,this.numberOfTrianglesSelected+=e.trianglesLength;let t=e.innerContents;if(l(t)){let n=t.length;for(let i=0;i<n;++i)this.incrementSelectionCounts(t[i])}};Zw.prototype.incrementLoadCounts=function(e){if(this.numberOfFeaturesLoaded+=e.featuresLength,this.numberOfPointsLoaded+=e.pointsLength,this.geometryByteLength+=e.geometryByteLength,this.batchTableByteLength+=e.batchTableByteLength,!(e instanceof Zf))this.texturesByteLength+=e.texturesByteLength;else{let n=e.getTextureIds();for(let i of n){let r=this.texturesReferenceCounterById[i]??0;if(r===0){let o=e.getTextureByteLengthById(i);this.texturesByteLength+=o}this.texturesReferenceCounterById[i]=r+1}}let t=e.innerContents;if(l(t)){let n=t.length;for(let i=0;i<n;++i)this.incrementLoadCounts(t[i])}};Zw.prototype.decrementLoadCounts=function(e){if(this.numberOfFeaturesLoaded-=e.featuresLength,this.numberOfPointsLoaded-=e.pointsLength,this.geometryByteLength-=e.geometryByteLength,this.batchTableByteLength-=e.batchTableByteLength,!(e instanceof Zf))this.texturesByteLength-=e.texturesByteLength;else{let n=e.getTextureIds();for(let i of n){let r=this.texturesReferenceCounterById[i];if(r===1){delete this.texturesReferenceCounterById[i];let o=e.getTextureByteLengthById(i);this.texturesByteLength-=o}else this.texturesReferenceCounterById[i]=r-1}}let t=e.innerContents;if(l(t)){let n=t.length;for(let i=0;i<n;++i)this.decrementLoadCounts(t[i])}};Zw.clone=function(e,t){t.selected=e.selected,t.visited=e.visited,t.numberOfCommands=e.numberOfCommands,t.numberOfAttemptedRequests=e.numberOfAttemptedRequests,t.numberOfPendingRequests=e.numberOfPendingRequests,t.numberOfTilesProcessing=e.numberOfTilesProcessing,t.numberOfTilesWithContentReady=e.numberOfTilesWithContentReady,t.numberOfTilesTotal=e.numberOfTilesTotal,t.numberOfFeaturesSelected=e.numberOfFeaturesSelected,t.numberOfFeaturesLoaded=e.numberOfFeaturesLoaded,t.numberOfPointsSelected=e.numberOfPointsSelected,t.numberOfPointsLoaded=e.numberOfPointsLoaded,t.numberOfTrianglesSelected=e.numberOfTrianglesSelected,t.numberOfTilesStyled=e.numberOfTilesStyled,t.numberOfFeaturesStyled=e.numberOfFeaturesStyled,t.numberOfTilesCulledWithChildrenUnion=e.numberOfTilesCulledWithChildrenUnion,t.geometryByteLength=e.geometryByteLength,t.texturesByteLength=e.texturesByteLength,t.batchTableByteLength=e.batchTableByteLength};var zm=Zw;function o3(){this._style=void 0,this._styleDirty=!1,this._lastStyleTime=0}Object.defineProperties(o3.prototype,{style:{get:function(){return this._style},set:function(e){e!==this._style&&(this._style=e,this._styleDirty=!0)}}});o3.prototype.makeDirty=function(){this._styleDirty=!0};o3.prototype.resetDirty=function(){this._styleDirty=!1};o3.prototype.applyStyle=function(e){if(!l(e.root)||l(this._style)&&!this._style._ready)return;let t=this._styleDirty;t&&++this._lastStyleTime;let n=this._lastStyleTime,i=e._statistics,r=t?e._selectedTiles:e._selectedTilesToStyle,o=r.length;for(let s=0;s<o;++s){let a=r[s];if(a.lastStyleTime!==n){let c=a.content;a.lastStyleTime=n,c.applyStyle(this._style),i.numberOfFeaturesStyled+=c.featuresLength,++i.numberOfTilesStyled}}};var s3=o3;function fSe(e,t,n){this.context=e,this.commandList=[],this.panoramaCommandList=[],this.shadowMaps=[],this.brdfLutGenerator=void 0,this.environmentMap=void 0,this.sphericalHarmonicCoefficients=void 0,this.specularEnvironmentMaps=void 0,this.specularEnvironmentMapsMaximumLOD=void 0,this.mode=re.SCENE3D,this.morphTime=re.getMorphTime(re.SCENE3D),this.frameNumber=0,this.newFrame=!1,this.time=void 0,this.jobScheduler=n,this.mapProjection=void 0,this.camera=void 0,this.cameraUnderground=!1,this.globeTranslucencyState=void 0,this.cullingVolume=void 0,this.occluder=void 0,this.maximumScreenSpaceError=void 0,this.pixelRatio=1,this.passes={render:!1,pick:!1,pickVoxel:!1,snap:!1,depth:!1,postProcess:!1,offscreen:!1},this.creditDisplay=t,this.afterRender=[],this.scene3DOnly=!1,this.fog={enabled:!1,renderable:!1,density:void 0,visualDensityScalar:void 0,sse:void 0,minimumBrightness:void 0},this.atmosphere=void 0,this.verticalExaggeration=1,this.verticalExaggerationRelativeHeight=0,this.shadowState={shadowsEnabled:!0,shadowMaps:[],lightShadowMaps:[],nearPlane:1,farPlane:5e3,closestObjectSize:1e3,lastDirtyTime:0,outOfView:!0},this.splitPosition=0,this.frustumSplits=[],this.backgroundColor=void 0,this.light=void 0,this.minimumDisableDepthTestDistance=void 0,this.invertClassification=!1,this.invertClassificationColor=void 0,this.useLogDepth=!1,this.tilesetPassState=void 0,this.minimumTerrainHeight=0,this.pickingMetadata=!1,this.pickedMetadataInfo=void 0,this.edgeVisibilityRequested=!1,this.planarFillRequested=!1}fSe.maximumFrameNumber=15e6;var XA=fSe;function Ayt(e,t,n){let i=rr(t,"3DTILES_implicit_tiling")?t.extensions["3DTILES_implicit_tiling"]:t.implicitTiling;this.baseResource=e,this.geometricError=t.geometricError,this.metadataSchema=n;let r=t.boundingVolume;if(!l(r.box)&&!l(r.region)&&!rr(r,"3DTILES_bounding_volume_S2")&&!rr(r,"3DTILES_bounding_volume_cylinder"))throw new oe("Only box, region, 3DTILES_bounding_volume_S2, and 3DTILES_bounding_volume_cylinder are supported for implicit tiling");this.boundingVolume=r,this.refine=t.refine,this.subtreeUriTemplate=new De({url:i.subtrees.uri}),this.contentUriTemplates=[],this.contentHeaders=[];let o=byt(t);for(let s=0;s<o.length;s++){let a=o[s];this.contentHeaders.push(Je(a,!0));let c=new De({url:a.uri});this.contentUriTemplates.push(c)}this.contentCount=this.contentHeaders.length,this.tileHeader=xyt(t),this.subdivisionScheme=qs[i.subdivisionScheme],this.branchingFactor=qs.getBranchingFactor(this.subdivisionScheme),this.subtreeLevels=i.subtreeLevels,l(i.availableLevels)?this.availableLevels=i.availableLevels:this.availableLevels=i.maximumLevel+1}function byt(e){if(rr(e,"3DTILES_multiple_contents")){let t=e.extensions["3DTILES_multiple_contents"];return l(t.contents)?t.contents:t.content}return l(e.contents)?e.contents:l(e.content)?[e.content]:[]}function xyt(e){let t=Je(e,!0);return l(t.extensions)&&(delete t.extensions["3DTILES_implicit_tiling"],delete t.extensions["3DTILES_multiple_contents"],Object.keys(t.extensions).length===0&&delete t.extensions),delete t.implicitTiling,delete t.contents,delete t.content,t}var f0=Ayt;var a3={};function dSe(e){return e=(e^e<<8)&16711935,e=(e^e<<4)&252645135,e=(e^e<<2)&858993459,e=(e^e<<1)&1431655765,e}function Yee(e){return e=(e^e<<16)&50331903,e=(e^e<<8)&50393103,e=(e^e<<4)&51130563,e=(e^e<<2)&153391689,e}function hSe(e){return e&=1431655765,e=(e^e>>1)&858993459,e=(e^e>>2)&252645135,e=(e^e>>4)&16711935,e=(e^e>>8)&65535,e}function Xee(e){return e&=153391689,e=(e^e>>2)&51130563,e=(e^e>>4)&50393103,e=(e^e>>8)&4278190335,e=(e^e>>16)&1023,e}a3.encode2D=function(e,t){return(dSe(e)|dSe(t)<<1)>>>0};a3.decode2D=function(e,t){return l(t)||(t=new Array(2)),t[0]=hSe(e),t[1]=hSe(e>>1),t};a3.encode3D=function(e,t,n){return Yee(e)|Yee(t)<<1|Yee(n)<<2};a3.decode3D=function(e,t){return l(t)||(t=new Array(3)),t[0]=Xee(e),t[1]=Xee(e>>1),t[2]=Xee(e>>2),t};var KA=a3;function To(e){this.subdivisionScheme=e.subdivisionScheme,this.subtreeLevels=e.subtreeLevels,this.level=e.level,this.x=e.x,this.y=e.y,this.z=void 0,e.subdivisionScheme===qs.OCTREE&&(this.z=e.z)}Object.defineProperties(To.prototype,{childIndex:{get:function(){let e=0;return e|=this.x&1,e|=(this.y&1)<<1,this.subdivisionScheme===qs.OCTREE&&(e|=(this.z&1)<<2),e}},mortonIndex:{get:function(){return this.subdivisionScheme===qs.OCTREE?KA.encode3D(this.x,this.y,this.z):KA.encode2D(this.x,this.y)}},tileIndex:{get:function(){let e=this.subdivisionScheme===qs.OCTREE?((1<<3*this.level)-1)/7:((1<<2*this.level)-1)/3,t=this.mortonIndex;return e+t}}});To.prototype.getDescendantCoordinates=function(e){let t=this.level+e.level,n=(this.x<<e.level)+e.x,i=(this.y<<e.level)+e.y;if(this.subdivisionScheme===qs.OCTREE){let r=(this.z<<e.level)+e.z;return new To({subdivisionScheme:this.subdivisionScheme,subtreeLevels:this.subtreeLevels,level:t,x:n,y:i,z:r})}return new To({subdivisionScheme:this.subdivisionScheme,subtreeLevels:this.subtreeLevels,level:t,x:n,y:i})};To.prototype.getAncestorCoordinates=function(e){let t=1<<e,n=this.level-e,i=Math.floor(this.x/t),r=Math.floor(this.y/t);if(this.subdivisionScheme===qs.OCTREE){let o=Math.floor(this.z/t);return new To({subdivisionScheme:this.subdivisionScheme,subtreeLevels:this.subtreeLevels,level:n,x:i,y:r,z:o})}return new To({subdivisionScheme:this.subdivisionScheme,subtreeLevels:this.subtreeLevels,level:n,x:i,y:r})};To.prototype.getOffsetCoordinates=function(e){let t=e.level-this.level,n=1<<t,i=e.x%n,r=e.y%n;if(this.subdivisionScheme===qs.OCTREE){let o=e.z%n;return new To({subdivisionScheme:this.subdivisionScheme,subtreeLevels:this.subtreeLevels,level:t,x:i,y:r,z:o})}return new To({subdivisionScheme:this.subdivisionScheme,subtreeLevels:this.subtreeLevels,level:t,x:i,y:r})};To.prototype.getChildCoordinates=function(e){let t=this.level+1,n=2*this.x+e%2,i=2*this.y+Math.floor(e/2)%2;if(this.subdivisionScheme===qs.OCTREE){let r=2*this.z+Math.floor(e/4)%2;return new To({subdivisionScheme:this.subdivisionScheme,subtreeLevels:this.subtreeLevels,level:t,x:n,y:i,z:r})}return new To({subdivisionScheme:this.subdivisionScheme,subtreeLevels:this.subtreeLevels,level:t,x:n,y:i})};To.prototype.getSubtreeCoordinates=function(){return this.getAncestorCoordinates(this.level%this.subtreeLevels)};To.prototype.getParentSubtreeCoordinates=function(){return this.getAncestorCoordinates(this.level%this.subtreeLevels+this.subtreeLevels)};To.prototype.isAncestor=function(e){let t=e.level-this.level;if(t<=0)return!1;let n=e.x>>t,i=e.y>>t,r=this.x===n,o=this.y===i;if(this.subdivisionScheme===qs.OCTREE){let s=e.z>>t,a=this.z===s;return r&&o&&a}return r&&o};To.prototype.isEqual=function(e){return this.subdivisionScheme===e.subdivisionScheme&&this.subtreeLevels===e.subtreeLevels&&this.level===e.level&&this.x===e.x&&this.y===e.y&&(this.subdivisionScheme===qs.OCTREE?this.z===e.z:!0)};To.prototype.isImplicitTilesetRoot=function(){return this.level===0};To.prototype.isSubtreeRoot=function(){return this.level%this.subtreeLevels===0};To.prototype.isBottomOfSubtree=function(){return this.level%this.subtreeLevels===this.subtreeLevels-1};To.prototype.getTemplateValues=function(){let e={level:this.level,x:this.x,y:this.y};return this.subdivisionScheme===qs.OCTREE&&(e.z=this.z),e};var mSe=[0,0,0];To.fromMortonIndex=function(e,t,n,i){let r;return e===qs.OCTREE?(r=KA.decode3D(i,mSe),new To({subdivisionScheme:e,subtreeLevels:t,level:n,x:r[0],y:r[1],z:r[2]})):(r=KA.decode2D(i,mSe),new To({subdivisionScheme:e,subtreeLevels:t,level:n,x:r[0],y:r[1]}))};To.fromTileIndex=function(e,t,n){let i,r,o;return e===qs.OCTREE?(i=Math.floor(D.log2(7*n+1)/3),r=((1<<3*i)-1)/7,o=n-r):(i=Math.floor(D.log2(3*n+1)/2),r=((1<<2*i)-1)/3,o=n-r),To.fromMortonIndex(e,t,i,o)};var d0=To;function D_(){}D_.selectTiles=function(e,t){pe.throwInstantiationError()};D_.sortChildrenByDistanceToCamera=function(e,t){return t._distanceToCamera===0&&e._distanceToCamera===0?t._centerZDepth-e._centerZDepth:t._distanceToCamera-e._distanceToCamera};D_.canTraverse=function(e){return e.children.length===0?!1:e.hasTilesetContent||e.hasImplicitContent?!e.contentExpired:e._screenSpaceError>e.tileset.memoryAdjustedScreenSpaceError};D_.selectTile=function(e,t){if(e.contentVisibility(t)===$t.OUTSIDE)return;e._wasSelectedLastFrame=!0;let{content:n,tileset:i}=e;n.featurePropertiesDirty?(n.featurePropertiesDirty=!1,e.lastStyleTime=0,i._selectedTilesToStyle.push(e)):e._selectedFrame<t.frameNumber-1&&(i._selectedTilesToStyle.push(e),e._wasSelectedLastFrame=!1),e._selectedFrame=t.frameNumber,i._selectedTiles.push(e)};D_.visitTile=function(e,t){++e.tileset._statistics.visited,e._visitedFrame=t.frameNumber};D_.touchTile=function(e,t){e._touchedFrame!==t.frameNumber&&(e.tileset._cache.touch(e),e._touchedFrame=t.frameNumber)};D_.loadTile=function(e,t){let{tileset:n}=e;if(e._requestedFrame===t.frameNumber||!e.hasUnloadedRenderableContent&&!e.contentExpired||!Tyt(e,t))return;let i=t.camera.timeSinceMoved<n.foveatedTimeDelay;e.priorityDeferred&&i||(e._requestedFrame=t.frameNumber,n._requestedTiles.push(e))};function Tyt(e,t){let{tileset:n}=e;if(!n._cullRequestsWhileMoving)return!0;let{positionWCDeltaMagnitude:i,positionWCDeltaMagnitudeLastFrame:r}=t.camera,o=i!==0?i:r,s=Math.max(e.boundingSphere.radius*2,1);return n.cullRequestsWhileMovingMultiplier*o/s<1}D_.updateTile=function(e,t){pSe(e,t),e.updateExpiration(),e._wasMinPriorityChild=!1,e._priorityHolder=e,vyt(e),e._shouldSelect=!1,e._finalResolution=!0};function pSe(e,t){if(e.updateVisibility(t),!e.isVisible)return;let n=e.children.length>0;if((e.hasTilesetContent||e.hasImplicitContent)&&n){let o=e.children[0];pSe(o,t),e._visible=o._visible;return}if(Eyt(e,t)){e._visible=!1;return}let i=e.refine===Ao.REPLACE,r=e._optimChildrenWithinParent===lh.USE_OPTIMIZATION;if(i&&r&&n&&!Cyt(e,t)){++e.tileset._statistics.numberOfTilesCulledWithChildrenUnion,e._visible=!1;return}}function Eyt(e,t){let{parent:n,tileset:i}=e;return!l(n)||n.hasTilesetContent||n.hasImplicitContent||n.refine!==Ao.ADD?!1:e.getScreenSpaceError(t,!0)<=i.memoryAdjustedScreenSpaceError}function Cyt(e,t){let n=!1,i=e.children;for(let r=0;r<i.length;++r){let o=i[r];o.updateVisibility(t),n=n||o.isVisible}return n}function vyt(e){let t=e.tileset._minimumPriority,n=e.tileset._maximumPriority,i=e._priorityHolder;n.distance=Math.max(i._distanceToCamera,n.distance),t.distance=Math.min(i._distanceToCamera,t.distance),n.depth=Math.max(e._depth,n.depth),t.depth=Math.min(e._depth,t.depth),n.foveatedFactor=Math.max(i._foveatedFactor,n.foveatedFactor),t.foveatedFactor=Math.min(i._foveatedFactor,t.foveatedFactor),n.reverseScreenSpaceError=Math.max(e._priorityReverseScreenSpaceError,n.reverseScreenSpaceError),t.reverseScreenSpaceError=Math.min(e._priorityReverseScreenSpaceError,t.reverseScreenSpaceError)}var Xa=D_;function gSe(){}var c3={stack:new fu,stackMaximumLength:0};gSe.selectTiles=function(e,t){e._selectedTiles.length=0,e._requestedTiles.length=0,e.hasMixedContent=!1;let n=!0,i=e.root;if(i.updateVisibility(t),!i.isVisible)return n;let{touchTile:r,visitTile:o}=Xa,s=c3.stack;for(s.push(i);s.length>0;){c3.stackMaximumLength=Math.max(c3.stackMaximumLength,s.length);let a=s.pop(),c=a.refine===Ao.ADD,u=a.refine===Ao.REPLACE,f=Syt(a);f&&wyt(a,s,t),(c||u&&!f)&&(Iyt(e,a),r(a,t),Pyt(a,t),a.hasRenderableContent&&!a.contentAvailable&&(n=!1)),o(a,t)}return c3.stack.trim(c3.stackMaximumLength),n};function Syt(e){return e.children.length===0?!1:e.hasTilesetContent||e.hasImplicitContent?!e.contentExpired:(e.hasEmptyContent,!0)}function wyt(e,t,n){let{children:i}=e;for(let r=0;r<i.length;++r){let o=i[r];o.updateVisibility(n),o.isVisible&&t.push(o)}}function Iyt(e,t){(t.hasUnloadedRenderableContent||t.contentExpired)&&(t._priority=0,e._requestedTiles.push(t))}function Pyt(e,t){e.contentAvailable&&e.contentVisibility(t)!==$t.OUTSIDE&&e.tileset._selectedTiles.push(e)}var l3=gSe;function _Se(){}var u3={stack:new fu,stackMaximumLength:0},f3={stack:new fu,stackMaximumLength:0};_Se.selectTiles=function(e,t){if(e._requestedTiles.length=0,e.debugFreezeFrame)return;e._selectedTiles.length=0,e._selectedTilesToStyle.length=0,e._emptyTiles.length=0,e.hasMixedContent=!1;let n=e.root;if(Xa.updateTile(n,t),!n.isVisible||n.getScreenSpaceError(t,!0)<=e.memoryAdjustedScreenSpaceError)return;Ryt(n,t),u3.stack.trim(u3.stackMaximumLength),f3.stack.trim(f3.stackMaximumLength);let i=e._requestedTiles;for(let r=0;r<i.length;++r)i[r].updatePriority()};function Kee(e,t){e.contentAvailable&&Xa.selectTile(e,t)}function Dyt(e,t,n){let i=e.refine===Ao.REPLACE,{tileset:r,children:o}=e,{updateTile:s,loadTile:a,touchTile:c}=Xa;for(let m=0;m<o.length;++m)s(o[m],n);o.sort(Xa.sortChildrenByDistanceToCamera);let u=i&&e.hasRenderableContent,f=!0,d=!1,p=-1,g=Number.MAX_VALUE;for(let m=0;m<o.length;++m){let y=o[m];if(y.isVisible?(t.push(y),y._foveatedFactor<g&&(p=m,g=y._foveatedFactor),d=!0):(u||r.loadSiblings)&&(y._foveatedFactor<g&&(p=m,g=y._foveatedFactor),a(y,n),c(y,n)),u){let A;y._inRequestVolume?y.hasRenderableContent?A=y.contentAvailable:A=Oyt(y,n):A=!1,f=f&&A}}if(d||(f=!1),p!==-1&&i){let m=o[p];m._wasMinPriorityChild=!0;let y=(e._wasMinPriorityChild||e===r.root)&&g<=e._priorityHolder._foveatedFactor?e._priorityHolder:e;y._foveatedFactor=Math.min(m._foveatedFactor,y._foveatedFactor),y._distanceToCamera=Math.min(m._distanceToCamera,y._distanceToCamera);for(let A=0;A<o.length;++A)o[A]._priorityHolder=y}return f}function Ryt(e,t){let{tileset:n}=e,{canTraverse:i,loadTile:r,visitTile:o,touchTile:s}=Xa,a=u3.stack;for(a.push(e);a.length>0;){u3.stackMaximumLength=Math.max(u3.stackMaximumLength,a.length);let c=a.pop(),u=c.parent,f=!l(u)||u._refines;c._refines=i(c)?Dyt(c,a,t)&&f:!1;let d=!c._refines&&f;c.hasRenderableContent?c.refine===Ao.ADD?(Kee(c,t),r(c,t)):c.refine===Ao.REPLACE&&(r(c,t),d&&Kee(c,t)):(n._emptyTiles.push(c),r(c,t),d&&Kee(c,t)),o(c,t),s(c,t)}}function Oyt(e,t){let{canTraverse:n,updateTile:i,loadTile:r,touchTile:o}=Xa,s=e.tileset.hasExtension("3DTILES_content_gltf_vector"),a=!0,c=f3.stack;for(c.push(e);c.length>0;){f3.stackMaximumLength=Math.max(f3.stackMaximumLength,c.length);let u=c.pop(),f=u.children,d=f.length,p=!u.hasRenderableContent&&n(u);if((s?u.hasRenderableContent:!p)&&!u.contentAvailable&&(a=!1),i(u,t),u.isVisible||(r(u,t),o(u,t)),p)for(let m=0;m<d;++m){let y=f[m];c.push(y)}}return e.hasEmptyContent||a}var d3=_Se;function ySe(){}var h3={stack:new fu,stackMaximumLength:0},m3={stack:new fu,stackMaximumLength:0},R_={stack:new fu,stackMaximumLength:0,ancestorStack:new fu,ancestorStackMaximumLength:0},Myt=2;ySe.selectTiles=function(e,t){if(e._requestedTiles.length=0,e.debugFreezeFrame)return;e._selectedTiles.length=0,e._selectedTilesToStyle.length=0,e._emptyTiles.length=0,e.hasMixedContent=!1;let n=e.root;if(Xa.updateTile(n,t),!n.isVisible||n.getScreenSpaceError(t,!0)<=e.memoryAdjustedScreenSpaceError)return;Uyt(n,t),zyt(n,t),h3.stack.trim(h3.stackMaximumLength),m3.stack.trim(m3.stackMaximumLength),R_.stack.trim(R_.stackMaximumLength),R_.ancestorStack.trim(R_.ancestorStackMaximumLength);let i=e._requestedTiles;for(let r=0;r<i.length;++r)i[r].updatePriority()};function Nyt(e,t){let{updateTile:n,touchTile:i,selectTile:r}=Xa,o=m3.stack;for(o.push(e);o.length>0;){m3.stackMaximumLength=Math.max(m3.stackMaximumLength,o.length);let a=o.pop().children;for(let c=0;c<a.length;++c){let u=a[c];u.isVisible&&(u.contentAvailable?(n(u,t),i(u,t),r(u,t)):u._depth-e._depth<Myt&&o.push(u))}}}function kG(e,t){let n=e.contentAvailable?e:e._ancestorWithContentAvailable;l(n)?n._shouldSelect=!0:Nyt(e,t)}function Lyt(e,t){e._ancestorWithContent=void 0,e._ancestorWithContentAvailable=void 0;let{parent:n}=e;if(!l(n))return;let i=!n.hasUnloadedRenderableContent||n._requestedFrame===t.frameNumber;e._ancestorWithContent=i?n:n._ancestorWithContent,e._ancestorWithContentAvailable=n.contentAvailable?n:n._ancestorWithContentAvailable}function Fyt(e,t){let n=t._ancestorWithContent;return!e.immediatelyLoadDesiredLevelOfDetail&&(t._priorityProgressiveResolutionScreenSpaceErrorLeaf||l(n)&&t._screenSpaceError<n._screenSpaceError/e.skipScreenSpaceErrorFactor&&t._depth>n._depth+e.skipLevels)}function Byt(e,t,n){let{tileset:i,children:r}=e,{updateTile:o,loadTile:s,touchTile:a}=Xa;for(let u=0;u<r.length;++u)o(r[u],n);r.sort(Xa.sortChildrenByDistanceToCamera);let c=!1;for(let u=0;u<r.length;++u){let f=r[u];f.isVisible?(t.push(f),c=!0):i.loadSiblings&&(s(f,n),a(f,n))}return c}function kyt(e,t){let{tileset:n}=e;return n.immediatelyLoadDesiredLevelOfDetail?!1:l(e._ancestorWithContent)?e._screenSpaceError===0?e.parent._screenSpaceError>t:e._screenSpaceError>t:!0}function Uyt(e,t){let{tileset:n}=e,i=n.immediatelyLoadDesiredLevelOfDetail?Number.MAX_VALUE:Math.max(n.baseScreenSpaceError,n.memoryAdjustedScreenSpaceError),{canTraverse:r,loadTile:o,visitTile:s,touchTile:a}=Xa,c=h3.stack;for(c.push(e);c.length>0;){h3.stackMaximumLength=Math.max(h3.stackMaximumLength,c.length);let u=c.pop();Lyt(u,t);let f=u.parent,d=!l(f)||f._refines;u._refines=r(u)?Byt(u,c,t)&&d:!1;let p=!u._refines&&d;u.hasRenderableContent?u.refine===Ao.ADD?(kG(u,t),o(u,t)):u.refine===Ao.REPLACE&&(kyt(u,i)?(o(u,t),p&&kG(u,t)):p?(kG(u,t),o(u,t)):Fyt(n,u)&&o(u,t)):(n._emptyTiles.push(u),o(u,t),p&&kG(u,t)),s(u,t),a(u,t)}}function zyt(e,t){let{selectTile:n,canTraverse:i}=Xa,{stack:r,ancestorStack:o}=R_,s;for(r.push(e);r.length>0||o.length>0;){if(R_.stackMaximumLength=Math.max(R_.stackMaximumLength,r.length),R_.ancestorStackMaximumLength=Math.max(R_.ancestorStackMaximumLength,o.length),o.length>0){let u=o.peek();if(u._stackLength===r.length){o.pop(),u!==s&&(u._finalResolution=!1),n(u,t);continue}}let a=r.pop();if(!l(a))continue;let c=i(a);if(a._shouldSelect)if(a.refine===Ao.ADD)n(a,t);else{if(a._selectionDepth=o.length,a._selectionDepth>0&&(a.tileset.hasMixedContent=!0),s=a,!c){n(a,t);continue}o.push(a),a._stackLength=r.length}if(c){let u=a.children;for(let f=0;f<u.length;++f){let d=u[f];d.isVisible&&r.push(d)}}}}var p3=ySe;function Pa(){this._layers=[],this.layerAdded=new be,this.layerRemoved=new be,this.layerMoved=new be,this.layerShownOrHidden=new be}Object.defineProperties(Pa.prototype,{length:{get:function(){return this._layers.length}}});Pa.prototype.add=function(e,t){l(t)?this._layers.splice(t,0,e):(t=this._layers.length,this._layers.push(e)),this._update(),this.layerAdded.raiseEvent(e,t);let i=e.readyEvent.addEventListener(()=>{this.layerShownOrHidden.raiseEvent(e,e._layerIndex,e.show),i()})};Pa.prototype.addImageryProvider=function(e,t){let n=new Is(e);return this.add(n,t),n};Pa.prototype.remove=function(e,t){t=t??!0;let n=this._layers.indexOf(e);return n!==-1?(this._layers.splice(n,1),this._update(),this.layerRemoved.raiseEvent(e,n),t&&e.destroy(),!0):!1};Pa.prototype.removeAll=function(e){e=e??!0;let t=this._layers;for(let n=0,i=t.length;n<i;n++){let r=t[n];this.layerRemoved.raiseEvent(r,n),e&&r.destroy()}this._layers=[]};Pa.prototype.contains=function(e){return this.indexOf(e)!==-1};Pa.prototype.indexOf=function(e){return this._layers.indexOf(e)};Pa.prototype.get=function(e){return this._layers[e]};function UG(e,t){return e.indexOf(t)}function ASe(e,t,n){let i=e._layers;if(t=D.clamp(t,0,i.length-1),n=D.clamp(n,0,i.length-1),t===n)return;let r=i[t];i[t]=i[n],i[n]=r,e._update(),e.layerMoved.raiseEvent(r,n,t)}Pa.prototype.raise=function(e){let t=UG(this._layers,e);ASe(this,t,t+1)};Pa.prototype.lower=function(e){let t=UG(this._layers,e);ASe(this,t,t-1)};Pa.prototype.raiseToTop=function(e){let t=UG(this._layers,e);t!==this._layers.length-1&&(this._layers.splice(t,1),this._layers.push(e),this._update(),this.layerMoved.raiseEvent(e,this._layers.length-1,t))};Pa.prototype.lowerToBottom=function(e){let t=UG(this._layers,e);t!==0&&(this._layers.splice(t,1),this._layers.splice(0,0,e),this._update(),this.layerMoved.raiseEvent(e,0,t))};var bSe=new ie;function xSe(e,t,n,i){let r=e.globe._surface._tilesToRender,o;for(let a=0;!l(o)&&a<r.length;++a){let c=r[a];ie.contains(c.rectangle,t)&&(o=c)}if(!l(o))return;let s=o.data.imagery;for(let a=s.length-1;a>=0;--a){let c=s[a],u=c.readyImagery;if(!l(u)||!u.imageryLayer.ready)continue;let f=u.imageryLayer.imageryProvider;if(n&&!l(f.pickFeatures)||!ie.contains(u.rectangle,t))continue;let d=bSe,p=1/1024;d.west=D.lerp(o.rectangle.west,o.rectangle.east,c.textureCoordinateRectangle.x-p),d.east=D.lerp(o.rectangle.west,o.rectangle.east,c.textureCoordinateRectangle.z+p),d.south=D.lerp(o.rectangle.south,o.rectangle.north,c.textureCoordinateRectangle.y-p),d.north=D.lerp(o.rectangle.south,o.rectangle.north,c.textureCoordinateRectangle.w+p),ie.contains(d,t)&&i(u)}}Pa.prototype.pickImageryLayers=function(e,t){let n=t.globe.pick(e,t);if(!l(n))return;let i=t.ellipsoid.cartesianToCartographic(n),r=[];if(xSe(t,i,!1,function(o){r.push(o.imageryLayer)}),r.length!==0)return r};var Vyt=new ie,jyt=new ie,$ee=new U,Jee=new U,Hyt=new he,Gyt=new he;function Wyt(e,t,n,i){let r=n.imageryProvider.tilingScheme,o=r.rectangleToNativeRectangle(e,Vyt),s=1/1024,a=jyt;a.west=D.lerp(o.west,o.east,t.minX-s),a.east=D.lerp(o.west,o.east,t.maxX+s),a.south=D.lerp(o.south,o.north,t.minY-s),a.north=D.lerp(o.south,o.north,t.maxY+s),l(i)||(i=new ie);let c=r.projection;if(c instanceof Ui)return i.west=D.toRadians(a.west),i.south=D.toRadians(a.south),i.east=D.toRadians(a.east),i.north=D.toRadians(a.north),i;$ee.x=a.west,$ee.y=a.south,Jee.x=a.east,Jee.y=a.north;let u=c.unproject($ee,Hyt),f=c.unproject(Jee,Gyt);return i.west=u.longitude,i.south=u.latitude,i.east=f.longitude,i.north=f.latitude,i}function qyt(e,t,n){let i=e._modelImagery;if(!l(i))return;let r=i._modelPrimitiveImageries;if(l(r))for(let o=0;o<r.length;o++){let s=r[o],a=s._coveragesPerLayer;if(l(a))for(let c=a.length-1;c>=0;--c){let u=a[c];for(let f=0;f<u.length;f++){let d=u[f],p=d.imagery,g=p.imageryLayer,m=g.imageryProvider;if(!l(m.pickFeatures)||!l(p)||p.state!==Vn.READY||!ie.contains(p.rectangle,t))continue;let A=s.mappedPositionsForImageryLayer(g).cartographicBoundingRectangle,b=Wyt(A,d.textureCoordinateRectangle,g,bSe);ie.contains(b,t)&&n(p)}}}}Pa.prototype.pickImageryLayerFeatures=function(e,t){let n;l(t.globe)&&(n=t.globe.pick(e,t));let i;if(!l(n)){let c=t.pickFromRay(e);if(!l(c)||(n=c.position,!l(n)))return;l(c.object)&&l(c.object.detail)&&(i=c.object.detail.model)}let r=t.ellipsoid.cartesianToCartographic(n),o=[],s=[];function a(c){if(!c.imageryLayer.ready)return;let f=c.imageryLayer.imageryProvider.pickFeatures(c.x,c.y,c.level,r.longitude,r.latitude);l(f)&&(o.push(f),s.push(c.imageryLayer))}if(l(t.globe)&&xSe(t,r,!0,function(c){a(c)}),l(i)&&qyt(i,r,function(c){a(c)}),o.length!==0)return Promise.all(o).then(function(c){let u=[];for(let f=0;f<c.length;++f){let d=c[f],p=s[f];if(l(d)&&d.length>0)for(let g=0;g<d.length;++g){let m=d[g];m.imageryLayer=p,l(m.position)||(m.position=r),u.push(m)}}return u})};Pa.prototype.queueReprojectionCommands=function(e){let t=this._layers;for(let n=0,i=t.length;n<i;++n)t[n].queueReprojectionCommands(e)};Pa.prototype.cancelReprojections=function(){let e=this._layers;for(let t=0,n=e.length;t<n;++t)e[t].cancelReprojections()};Pa.prototype.isDestroyed=function(){return!1};Pa.prototype.destroy=function(){return this.removeAll(!0),le(this)};Pa.prototype._update=function(){let e=!0,t=this._layers,n,i,r,o;for(r=0,o=t.length;r<o;++r)i=t[r],i._layerIndex=r,i.show?(i._isBaseLayer=e,e=!1):i._isBaseLayer=!1,i.show!==i._show&&(l(i._show)&&(l(n)||(n=[]),n.push(i)),i._show=i.show);if(l(n))for(r=0,o=n.length;r<o;++r)i=n[r],this.layerShownOrHidden.raiseEvent(i,i._layerIndex,i.show)};var pE=Pa;function lo(e){e=e??H.EMPTY_OBJECT,this._url=void 0,this._basePath=void 0,this._root=void 0,this._resource=void 0,this._asset=void 0,this._properties=void 0,this._geometricError=void 0,this._scaledGeometricError=void 0,this._extensionsUsed=void 0,this._extensions=void 0,this._modelUpAxis=void 0,this._modelForwardAxis=void 0,this._cache=new i3,this._externalTilesetTiles=[],this._externalTilesetSweepIndex=0,this._externalTilesetSweepCount=8,this._externalTilesetIdleFrames=e.externalTilesetIdleFrames??120,this._processingQueue=[],this._selectedTiles=[],this._emptyTiles=[],this._requestedTiles=[],this._selectedTilesToStyle=[],this._loadTimestamp=void 0,this._timeSinceLoad=0,this._updatedVisibilityFrame=0,this._updatedModelMatrixFrame=0,this._modelMatrixChanged=!1,this._previousModelMatrix=void 0,this._extras=void 0,this._credits=void 0,this._showCreditsOnScreen=e.showCreditsOnScreen??!1,this._cullWithChildrenBounds=e.cullWithChildrenBounds??!0,this._allTilesAdditive=!0,this._hasMixedContent=!1,this._stencilClearCommand=void 0,this._backfaceCommands=new fu,this._maximumScreenSpaceError=e.maximumScreenSpaceError??16,this._memoryAdjustedScreenSpaceError=this._maximumScreenSpaceError,this._cacheBytes=e.cacheBytes??512*1024*1024;let t=e.maximumCacheOverflowBytes??512*1024*1024;this._maximumCacheOverflowBytes=t,this._styleEngine=new s3,this._styleApplied=!1,this._modelMatrix=l(e.modelMatrix)?N.clone(e.modelMatrix):N.clone(N.IDENTITY),this._addHeightCallbacks=[],this._statistics=new zm,this._statisticsLast=new zm,this._statisticsPerPass=new Array(ao.NUMBER_OF_PASSES);for(let r=0;r<ao.NUMBER_OF_PASSES;++r)this._statisticsPerPass[r]=new zm;this._requestedTilesInFlight=[],this._maximumPriority={foveatedFactor:-Number.MAX_VALUE,depth:-Number.MAX_VALUE,distance:-Number.MAX_VALUE,reverseScreenSpaceError:-Number.MAX_VALUE},this._minimumPriority={foveatedFactor:Number.MAX_VALUE,depth:Number.MAX_VALUE,distance:Number.MAX_VALUE,reverseScreenSpaceError:Number.MAX_VALUE},this._heatmap=new r3(e.debugHeatmapTilePropertyName),this.cullRequestsWhileMoving=e.cullRequestsWhileMoving??!0,this._cullRequestsWhileMoving=!1,this.cullRequestsWhileMovingMultiplier=e.cullRequestsWhileMovingMultiplier??60,this.progressiveResolutionHeightFraction=D.clamp(e.progressiveResolutionHeightFraction??.3,0,.5),this.preferLeaves=e.preferLeaves??!1,this._tilesLoaded=!1,this._initialTilesLoaded=!1,this._tileDebugLabels=void 0,this._classificationType=e.classificationType,this._heightReference=e.heightReference,this._scene=e.scene,this._ellipsoid=e.ellipsoid??ee.WGS84,this._initialClippingPlanesOriginMatrix=N.IDENTITY,this._clippingPlanesOriginMatrix=void 0,this._clippingPlanesOriginMatrixDirty=!0,this._vectorClassificationOnly=e.vectorClassificationOnly??!1,this._vectorKeepDecodedPositions=e.vectorKeepDecodedPositions??!1,this._imageryLayers=new pE(this),this._imageryLayersModificationCounter=0,this._imageryLayersListener=()=>{this._imageryLayersModificationCounter++},this.imageryLayers.layerAdded.addEventListener(this._imageryLayersListener),this.imageryLayers.layerRemoved.addEventListener(this._imageryLayersListener),this.imageryLayers.layerMoved.addEventListener(this._imageryLayersListener),this.imageryLayers.layerShownOrHidden.addEventListener(this._imageryLayersListener),this._asynchronouslyLoadImagery=e.asynchronouslyLoadImagery??!1,this.preloadWhenHidden=e.preloadWhenHidden??!1,this.preloadFlightDestinations=e.preloadFlightDestinations??!0,this._pass=void 0,this.dynamicScreenSpaceError=e.dynamicScreenSpaceError??!0,this.foveatedScreenSpaceError=e.foveatedScreenSpaceError??!0,this._foveatedConeSize=e.foveatedConeSize??.1,this._foveatedMinimumScreenSpaceErrorRelaxation=e.foveatedMinimumScreenSpaceErrorRelaxation??0,this.foveatedInterpolationCallback=e.foveatedInterpolationCallback??D.lerp,this.foveatedTimeDelay=e.foveatedTimeDelay??.2,this.dynamicScreenSpaceErrorDensity=e.dynamicScreenSpaceErrorDensity??2e-4,this.dynamicScreenSpaceErrorFactor=e.dynamicScreenSpaceErrorFactor??24,this.dynamicScreenSpaceErrorHeightFalloff=e.dynamicScreenSpaceErrorHeightFalloff??.25,this._dynamicScreenSpaceErrorComputedDensity=0,this.shadows=e.shadows??Pn.ENABLED,this.show=e.show??!0,this.colorBlendMode=qu.HIGHLIGHT,this.colorBlendAmount=.5,this._pointCloudShading=new t0(e.pointCloudShading),this._pointCloudEyeDomeLighting=new Jg,this.loadProgress=new be,this.allTilesLoaded=new be,this.initialTilesLoaded=new be,this.tileLoad=new be,this.tileUnload=new be,this.tileFailed=new be,this.tileVisible=new be,this.skipLevelOfDetail=e.skipLevelOfDetail??!1,this._disableSkipLevelOfDetail=!1,this._runtimeContentCodec=void 0,this.baseScreenSpaceError=e.baseScreenSpaceError??1024,this.skipScreenSpaceErrorFactor=e.skipScreenSpaceErrorFactor??16,this.skipLevels=e.skipLevels??1,this.immediatelyLoadDesiredLevelOfDetail=e.immediatelyLoadDesiredLevelOfDetail??!1,this.loadSiblings=e.loadSiblings??!1,this._clippingPlanes=void 0,l(e.clippingPlanes)&&Cs.setOwner(e.clippingPlanes,this,"_clippingPlanes"),this._clippingPolygons=void 0,this._clippingPolygonsNeedRebake=!1,this._removeClippingPolygonAdded=void 0,this._removeClippingPolygonRemoved=void 0,l(e.clippingPolygons)&&(Nc.setOwner(e.clippingPolygons,this,"_clippingPolygons"),SSe(this)),l(e.imageBasedLighting)?(this._imageBasedLighting=e.imageBasedLighting,this._shouldDestroyImageBasedLighting=!1):(this._imageBasedLighting=new LT,this._shouldDestroyImageBasedLighting=!0),this._environmentMapManager=new Wg(e.environmentMapOptions),this.lightColor=e.lightColor,this.backFaceCulling=e.backFaceCulling??!0,this._enableShowOutline=e.enableShowOutline??!0,this.showOutline=e.showOutline??!0,this.outlineColor=e.outlineColor??z.BLACK,this.splitDirection=e.splitDirection??Ho.NONE,this.enableCollision=e.enableCollision??!1,this.maximumHeightQueryGeometricError=e.maximumHeightQueryGeometricError??500,this._projectTo2D=e.projectTo2D??!1,this._enablePick=e.enablePick??!1,this.debugFreezeFrame=e.debugFreezeFrame??!1,this.debugColorizeTiles=e.debugColorizeTiles??!1,this._enableDebugWireframe=e.enableDebugWireframe??!1,this.debugWireframe=e.debugWireframe??!1,this.debugWireframe===!0&&this._enableDebugWireframe===!1&&_t("tileset-debug-wireframe-ignored","enableDebugWireframe must be set to true in the Cesium3DTileset constructor, otherwise debugWireframe will be ignored."),this.edgeDisplayMode=e.edgeDisplayMode??Kd.SURFACES_ONLY,this.debugShowBoundingVolume=e.debugShowBoundingVolume??!1,this.debugShowContentBoundingVolume=e.debugShowContentBoundingVolume??!1,this.debugShowViewerRequestVolume=e.debugShowViewerRequestVolume??!1,this._tileDebugLabels=void 0,this.debugPickedTileLabelOnly=!1,this.debugPickedTile=void 0,this.debugPickPosition=void 0,this.debugShowGeometricError=e.debugShowGeometricError??!1,this.debugShowRenderingStatistics=e.debugShowRenderingStatistics??!1,this.debugShowMemoryUsage=e.debugShowMemoryUsage??!1,this.debugShowUrl=e.debugShowUrl??!1,this.examineVectorLinesFunction=void 0,this._metadataExtension=void 0,this._customShader=e.customShader;let n=e.featureIdLabel??"featureId_0";typeof n=="number"&&(n=`featureId_${n}`),this._featureIdLabel=n;let i=e.instanceFeatureIdLabel??"instanceFeatureId_0";typeof i=="number"&&(i=`instanceFeatureId_${i}`),this._instanceFeatureIdLabel=i}Object.defineProperties(lo.prototype,{isCesium3DTileset:{get:function(){return!0}},asset:{get:function(){return this._asset}},extensions:{get:function(){return this._extensions}},clippingPlanes:{get:function(){return this._clippingPlanes},set:function(e){Cs.setOwner(e,this,"_clippingPlanes")}},clippingPolygons:{get:function(){return this._clippingPolygons},set:function(e){Nc.setOwner(e,this,"_clippingPolygons"),SSe(this),this._clippingPolygonsNeedRebake=!0}},imageryLayers:{get:function(){return this._imageryLayers}},imageryLayersModificationCounter:{get:function(){return this._imageryLayersModificationCounter}},asynchronouslyLoadImagery:{get:function(){return this._asynchronouslyLoadImagery}},properties:{get:function(){return this._properties}},tilesLoaded:{get:function(){return this._tilesLoaded}},resource:{get:function(){return this._resource}},basePath:{get:function(){return qr("Cesium3DTileset.basePath","Cesium3DTileset.basePath has been deprecated. All tiles are relative to the url of the tileset JSON file that contains them. Use the url property instead."),this._basePath}},style:{get:function(){return this._styleEngine.style},set:function(e){this._styleEngine.style=e}},customShader:{get:function(){return this._customShader},set:function(e){this._customShader=e}},hasMixedContent:{get:function(){return this._hasMixedContent},set:function(e){this._hasMixedContent=e}},isSkippingLevelOfDetail:{get:function(){return this.skipLevelOfDetail&&!l(this._classificationType)&&!this._disableSkipLevelOfDetail&&!this._allTilesAdditive}},metadataExtension:{get:function(){return this._metadataExtension}},metadata:{get:function(){if(l(this._metadataExtension))return this._metadataExtension.tileset}},schema:{get:function(){if(l(this._metadataExtension))return this._metadataExtension.schema}},maximumScreenSpaceError:{get:function(){return this._maximumScreenSpaceError},set:function(e){this._maximumScreenSpaceError=e,this._memoryAdjustedScreenSpaceError=e}},cacheBytes:{get:function(){return this._cacheBytes},set:function(e){this._cacheBytes=e}},maximumCacheOverflowBytes:{get:function(){return this._maximumCacheOverflowBytes},set:function(e){this._maximumCacheOverflowBytes=e}},externalTilesetIdleFrames:{get:function(){return this._externalTilesetIdleFrames},set:function(e){this._externalTilesetIdleFrames=e}},memoryAdjustedScreenSpaceError:{get:function(){return this._memoryAdjustedScreenSpaceError}},pointCloudShading:{get:function(){return this._pointCloudShading},set:function(e){this._pointCloudShading=e}},root:{get:function(){return this._root}},boundingSphere:{get:function(){return this._root.updateTransform(this._modelMatrix),this._root.boundingSphere}},modelMatrix:{get:function(){return this._modelMatrix},set:function(e){this._modelMatrix=N.clone(e,this._modelMatrix)}},timeSinceLoad:{get:function(){return this._timeSinceLoad}},totalMemoryUsageInBytes:{get:function(){let e=this._statistics;return e.texturesByteLength+e.geometryByteLength+e.batchTableByteLength}},clippingPlanesOriginMatrix:{get:function(){return l(this._clippingPlanesOriginMatrix)?(this._clippingPlanesOriginMatrixDirty&&(N.multiply(this.root.computedTransform,this._initialClippingPlanesOriginMatrix,this._clippingPlanesOriginMatrix),this._clippingPlanesOriginMatrixDirty=!1),this._clippingPlanesOriginMatrix):N.IDENTITY}},styleEngine:{get:function(){return this._styleEngine}},statistics:{get:function(){return this._statistics}},classificationType:{get:function(){return this._classificationType}},heightReference:{get:function(){return this._heightReference}},scene:{get:function(){return this._scene}},ellipsoid:{get:function(){return this._ellipsoid}},foveatedConeSize:{get:function(){return this._foveatedConeSize},set:function(e){this._foveatedConeSize=e}},foveatedMinimumScreenSpaceErrorRelaxation:{get:function(){return this._foveatedMinimumScreenSpaceErrorRelaxation},set:function(e){this._foveatedMinimumScreenSpaceErrorRelaxation=e}},extras:{get:function(){return this._extras}},imageBasedLighting:{get:function(){return this._imageBasedLighting},set:function(e){e!==this._imageBasedLighting&&(this._shouldDestroyImageBasedLighting&&!this._imageBasedLighting.isDestroyed()&&this._imageBasedLighting.destroy(),this._imageBasedLighting=e,this._shouldDestroyImageBasedLighting=!1)}},environmentMapManager:{get:function(){return this._environmentMapManager}},vectorClassificationOnly:{get:function(){return this._vectorClassificationOnly}},vectorKeepDecodedPositions:{get:function(){return this._vectorKeepDecodedPositions}},showCreditsOnScreen:{get:function(){return this._showCreditsOnScreen},set:function(e){this._showCreditsOnScreen=e,RSe(this)}},featureIdLabel:{get:function(){return this._featureIdLabel},set:function(e){typeof e=="number"&&(e=`featureId_${e}`),this._featureIdLabel=e}},instanceFeatureIdLabel:{get:function(){return this._instanceFeatureIdLabel},set:function(e){typeof e=="number"&&(e=`instanceFeatureId_${e}`),this._instanceFeatureIdLabel=e}}});lo.fromIonAssetId=async function(e,t){let n=await Yo.fromAssetId(e);return lo.fromUrl(n,t)};lo.fromUrl=async function(e,t){t=t??H.EMPTY_OBJECT;let n=De.createIfNeeded(e),i;n.extension==="json"?i=n.getBaseUri(!0):n.isDataUri&&(i="");let r=await lo.loadJson(n),o=await Yyt(n,r),s=new lo(t);s._resource=n,s._url=n.url,s._basePath=i,s._metadataExtension=o,s._geometricError=r.geometricError,s._scaledGeometricError=r.geometricError;let a=r.asset;s._asset=a,s._extras=r.extras,RSe(s);let c=l(r.asset.gltfUpAxis)?Hi.fromName(r.asset.gltfUpAxis):Hi.Y,u=t.modelUpAxis??c,f=t.modelForwardAxis??Hi.X;s._properties=r.properties,s._extensionsUsed=r.extensionsUsed,s._extensions=r.extensions,s._modelUpAxis=u,s._modelForwardAxis=f,s._root=s.loadTileset(n,r);let p=s._root.createBoundingVolume(r.root.boundingVolume,N.IDENTITY).boundingSphere.center,g=s._ellipsoid.cartesianToCartographic(p);return l(g)&&g.height>Mi._defaultMinTerrainHeight&&(s._initialClippingPlanesOriginMatrix=At.eastNorthUpToFixedFrame(p)),s._clippingPlanesOriginMatrix=N.clone(s._initialClippingPlanesOriginMatrix),s};lo.loadJson=function(e){return De.createIfNeeded(e).fetchJson()};lo.prototype.makeStyleDirty=function(){this._styleEngine.makeDirty()};lo.prototype.loadTileset=function(e,t,n){let i=t.asset;if(!l(i))throw new oe("Tileset must have an asset property.");if(i.version!=="0.0"&&i.version!=="1.0"&&i.version!=="1.1")throw new oe("The tileset must be 3D Tiles version 0.0, 1.0, or 1.1");l(t.extensionsRequired)&&lo.checkSupportedExtensions(t.extensionsRequired);let r=this._statistics;l(n)&&this._externalTilesetTiles.push(n);let o=i.tilesetVersion;l(o)&&(this._basePath+=`?v=${o}`,e=e.clone(),e.setQueryParameters({v:o}));let s=TSe(this,e,t.root,n);l(n)&&(n.children.push(s),s._depth=n._depth+1);let a=[];for(a.push(s);a.length>0;){let c=a.pop();++r.numberOfTilesTotal,this._allTilesAdditive=this._allTilesAdditive&&c.refine===Ao.ADD;let u=c._header.children;if(l(u))for(let f=0;f<u.length;++f){let d=u[f],p=TSe(this,e,d,c);c.children.push(p),p._depth=c._depth+1,a.push(p)}this._cullWithChildrenBounds&&e3.checkChildrenWithinParent(c)}return s};function TSe(e,t,n,i){if(!(l(n.implicitTiling)||rr(n,"3DTILES_implicit_tiling")))return new fh(e,t,n,i);let o=e.schema,s=new f0(t,n,o),a=new d0({subdivisionScheme:s.subdivisionScheme,subtreeLevels:s.subtreeLevels,level:0,x:0,y:0,z:0}),c=s.subtreeUriTemplate.getDerivedResource({templateValues:a.getTemplateValues()}).url,f=Je(n,!0);f.contents=[{uri:c}],delete f.content,delete f.extensions;let d=new fh(e,t,f,i);return d.implicitTileset=s,d.implicitCoordinates=a,d}async function Yyt(e,t){let n=rr(t,"3DTILES_metadata")?t.extensions["3DTILES_metadata"]:t,i;if(l(n.schemaUri))e=e.getDerivedResource({url:n.schemaUri}),i=Fi.getSchemaLoader({resource:e});else if(l(n.schema))i=Fi.getSchemaLoader({schema:n.schema});else return;await i.load();let r=new mE({schema:i.schema,metadataJson:n});return Fi.unload(i),r}var ESe=new h,Xyt=new he,Kyt=new N,$yt=new h,Jyt=new h,Zyt=new h,Qyt=new h;function eAt(e,t){let n,i,r,o,s,a=t.camera,c=e._root,u=c.contentBoundingVolume;if(u instanceof ed)n=h.normalize(a.positionWC,ESe),i=a.directionWC,r=a.positionCartographic.height,o=u.minimumHeight,s=u.maximumHeight;else{let y=N.inverseTransformation(c.computedTransform,Kyt),A=t.mapProjection.ellipsoid,b=u.boundingVolume,x=N.multiplyByPoint(y,b.center,$yt);if(h.magnitude(x)>A.minimumRadius){let T=he.fromCartesian(x,A,Xyt);n=h.normalize(a.positionWC,ESe),i=a.directionWC,r=a.positionCartographic.height,o=0,s=T.height*2}else{let T=N.multiplyByPoint(y,a.positionWC,Jyt);if(n=h.UNIT_Z,i=N.multiplyByPointAsVector(y,a.directionWC,Zyt),i=h.normalize(i,i),r=T.z,u instanceof tf){let E=$.getColumn(b.halfAxes,2,Qyt),v=h.magnitude(E);o=x.z-v,s=x.z+v}else if(u instanceof w_){let E=b.radius;o=x.z-E,s=x.z+E}}}let f=e.dynamicScreenSpaceErrorHeightFalloff,d=o+(s-o)*f,p=s,g=D.clamp((r-d)/(p-d),0,1),m=1-Math.abs(h.dot(i,n));m=m*(1-g),e._dynamicScreenSpaceErrorComputedDensity=e.dynamicScreenSpaceErrorDensity*m}function tAt(e,t){if(t.hasEmptyContent)return;let{statistics:n}=e,i=t.contentExpired,r=t.requestContent();l(r)&&(r.then(o=>{!l(o)||t.isDestroyed()||e.isDestroyed()||(e._processingQueue.push(t),++n.numberOfTilesProcessing)}).catch(o=>{wSe(o,e,t)}),i&&(t.hasTilesetContent||t.hasImplicitContent?PSe(e,t):(n.decrementLoadCounts(t.content),--n.numberOfTilesWithContentReady)),e._requestedTilesInFlight.push(t))}function vSe(e,t){return e._priority-t._priority}lo.prototype.postPassesUpdate=function(e){l(this._root)&&(nAt(this,e),bAt(this,e),this._cache.unloadTiles(this,DSe),yAt(this,e),this._styleApplied&&this._styleEngine.resetDirty(),this._styleApplied=!1)};function SSe(e){e._removeClippingPolygonAdded=e._removeClippingPolygonAdded&&e._removeClippingPolygonAdded(),e._removeClippingPolygonRemoved=e._removeClippingPolygonRemoved&&e._removeClippingPolygonRemoved();let t=e._clippingPolygons;if(!l(t))return;let n=()=>{e._clippingPolygonsNeedRebake=!0};e._removeClippingPolygonAdded=t.polygonAdded.addEventListener(n),e._removeClippingPolygonRemoved=t.polygonRemoved.addEventListener(n)}lo.prototype.prePassesUpdate=function(e){if(!l(this._root))return;lAt(this,e);let t=this._clippingPlanes;this._clippingPlanesOriginMatrixDirty=!0,l(t)&&t.enabled&&t.update(e);let n=this._clippingPolygons;l(n)&&n.enabled&&n.update(e),this._clippingPolygonsNeedRebake&&(this._clippingPolygonsNeedRebake=!1,this._cache.forEachLoadedTile(i=>{i.clippingPolygonsNeedRebake=!0})),l(this._loadTimestamp)||(this._loadTimestamp=K.clone(e.time)),this._timeSinceLoad=Math.max(K.secondsDifference(e.time,this._loadTimestamp)*1e3,0),this.dynamicScreenSpaceError&&eAt(this,e),e.newFrame&&this._cache.reset()};function nAt(e,t){let n=e._requestedTilesInFlight,i=0;for(let r=0;r<n.length;++r){let o=n[r],s=t.frameNumber-o._touchedFrame>=1;if(o._contentState!==Rr.LOADING){++i;continue}else if(s){o.cancelRequests(),++i;continue}i>0&&(n[r-i]=o)}n.length-=i}function iAt(e){let t=e._requestedTiles;t.sort(vSe);for(let n=0;n<t.length;++n)tAt(e,t[n])}function wSe(e,t,n){if(t.isDestroyed())return;let i;n.isDestroyed()||(i=n._contentResource.url);let r=l(e.message)?e.message:e.toString();t.tileFailed.numberOfListeners>0?t.tileFailed.raiseEvent({url:i,message:r}):(console.log(`A 3D tile failed to load: ${i}`),console.log(`Error: ${r}`),console.log(e.stack))}function rAt(e){let t=e._processingQueue,n=0;for(let i=0;i<t.length;++i){let r=t[i];if(r.isDestroyed()||r._contentState!==Rr.PROCESSING){++n;continue}n>0&&(t[i-n]=r)}t.length-=n}var oAt=new he,sAt=new he,aAt=new h;function cAt(e,t,n){if(!e.enableCollision||!e.show||t._wasSelectedLastFrame)return;let i=e._addHeightCallbacks,r=t.boundingSphere,o=i.length;for(let s=0;s<o;++s){let a=i[s];if(a.invoked)continue;let c=a.ellipsoid,u=he.clone(a.positionCartographic,oAt),f=he.fromCartesian(r.center,c,sAt);l(f)&&(u.height=f.height);let d=he.toCartesian(u,c,aAt);h.distance(d,r.center)<=r.radius&&(a.invoked=!0,n.afterRender.push(()=>{l(a.callback)&&a.callback(),a.invoked=!1}))}}function lAt(e,t){rAt(e);let n=e._processingQueue,{cacheBytes:i,maximumCacheOverflowBytes:r,statistics:o}=e,s=i+r,a=!1;for(let c=0;c<n.length;++c){if(e.totalMemoryUsageInBytes>s){a=!0;break}let u=n[c];try{u.process(e,t),u.contentReady&&(--o.numberOfTilesProcessing,e.tileLoad.raiseEvent(u))}catch(f){--o.numberOfTilesProcessing,wSe(f,e,u)}}e.totalMemoryUsageInBytes<i?fAt(e):a&&n.length>0&&uAt(e)}function uAt(e){e._memoryAdjustedScreenSpaceError*=1.02;let t=e._processingQueue;for(let n=0;n<t.length;++n)t[n].updatePriority();t.sort(vSe)}function fAt(e){e._memoryAdjustedScreenSpaceError=Math.max(e.memoryAdjustedScreenSpaceError/1.02,e.maximumScreenSpaceError)}var zG=new h,dAt={maximumFractionDigits:3};function CSe(e){let t=e/1048576;return t<1?t.toLocaleString(void 0,dAt):Math.round(t).toLocaleString()}function Zee(e){let{halfAxes:t,radius:n,center:i}=e.boundingVolume.boundingVolume,r=h.clone(i,zG);if(l(t))r.x+=.75*(t[0]+t[3]+t[6]),r.y+=.75*(t[1]+t[4]+t[7]),r.z+=.75*(t[2]+t[5]+t[8]);else if(l(n)){let o=h.normalize(i,zG);o=h.multiplyByScalar(o,.75*n,zG),r=h.add(o,i,zG)}return r}function Qee(e,t,n){let i="",r=0;if(t.debugShowGeometricError&&(i+=` Geometric error: ${e.geometricError}`,r++),t.debugShowRenderingStatistics&&(i+=` Commands: ${e.commandsLength}`,r++,e.content.pointsLength>0&&(i+=` Points: ${e.content.pointsLength}`,r++),e.content.trianglesLength>0&&(i+=` Triangles: ${e.content.trianglesLength}`,r++),i+=` Features: ${e.content.featuresLength}`,r++),t.debugShowMemoryUsage&&(i+=` -Texture Memory: ${LEe(e.content.texturesByteLength)}`,i+=` -Geometry Memory: ${LEe(e.content.geometryByteLength)}`,r+=2),t.debugShowUrl)if(e.hasMultipleContents){i+=` +Texture Memory: ${CSe(e.content.texturesByteLength)}`,i+=` +Geometry Memory: ${CSe(e.content.geometryByteLength)}`,r+=2),t.debugShowUrl)if(e.hasMultipleContents){i+=` Urls:`;let s=e.content.innerContentUrls;for(let a=0;a<s.length;a++)i+=` - ${s[a]}`;r+=s.length}else i+=` -Url: ${e._contentHeader.uri}`,r++;let o={text:i.substring(1),position:n,font:`${19-r}px sans-serif`,showBackground:!0,disableDepthTestDistance:Number.POSITIVE_INFINITY};return t._tileDebugLabels.add(o)}function Fpt(e,t){let n=e._selectedTiles,i=n.length,r=e._emptyTiles,o=r.length;if(e._tileDebugLabels.removeAll(),e.debugPickedTileLabelOnly){if(l(e.debugPickedTile)){let s=l(e.debugPickPosition)?e.debugPickPosition:ree(e.debugPickedTile),a=oee(e.debugPickedTile,e,s);a.pixelOffset=new U(15,-15)}}else{for(let s=0;s<i;++s){let a=n[s];oee(a,e,ree(a))}for(let s=0;s<o;++s){let a=r[s];(a.hasTilesetContent||a.hasImplicitContent)&&oee(a,e,ree(a))}}e._tileDebugLabels.update(t)}function Bpt(e,t,n){e._styleEngine.applyStyle(e),e._styleApplied=!0;let{commandList:i,context:r}=t,o=i.length,s=e._selectedTiles,a=e.isSkippingLevelOfDetail&&e._hasMixedContent&&r.stencilBuffer&&s.length>0;e._backfaceCommands.length=0,a&&(l(e._stencilClearCommand)||(e._stencilClearCommand=new li({stencil:0,pass:Ie.CESIUM_3D_TILE,renderState:Ge.fromCache({stencilMask:Yt.SKIP_LOD_MASK})})),i.push(e._stencilClearCommand));let{statistics:c,tileVisible:u}=e,f=n.isRender,d=i.length;for(let m=0;m<s.length;++m){let y=s[m];f&&u.raiseEvent(y),Rpt(e,y,t),y.update(e,t,n),c.incrementSelectionCounts(y.content),++c.selected}let p=e._emptyTiles;for(let m=0;m<p.length;++m)p[m].update(e,t,n);let g=i.length-d;if(e._backfaceCommands.trim(),a){let m=e._backfaceCommands.values,y=m.length;i.length+=y;for(let A=g-1;A>=0;--A)i[d+y+A]=i[d+A];for(let A=0;A<y;++A)i[d+A]=m[A]}g=i.length-o,c.numberOfCommands=g,f&&(e.pointCloudShading.attenuation&&e.pointCloudShading.eyeDomeLighting&&g>0&&e._pointCloudEyeDomeLighting.update(t,o,e.pointCloudShading,e.boundingSphere),e.debugShowGeometricError||e.debugShowRenderingStatistics||e.debugShowMemoryUsage||e.debugShowUrl?(l(e._tileDebugLabels)||(e._tileDebugLabels=new e0),Fpt(e,t)):e._tileDebugLabels=e._tileDebugLabels&&e._tileDebugLabels.destroy())}var UEe=[],kpt=[];function zEe(e,t){let n=t,i=UEe;for(i.push(t);i.length>0;){t=i.pop();let r=t.children;for(let o=0;o<r.length;++o)i.push(r[o]);t!==n&&(jpt(e,t),--e._statistics.numberOfTilesTotal)}n.children=[]}function VEe(e,t){e.tileUnload.raiseEvent(t),e._statistics.decrementLoadCounts(t.content),--e._statistics.numberOfTilesWithContentReady,t.unloadContent()}function mG(e,t){let n=e-t;return n<0?n+VA.maximumFrameNumber:n}var Upt=64;function zpt(e,t,n){let i=kpt;for(i.length=0,i.push(e);i.length>0;){let r=i.pop(),o=r._contentState;if(o===Rr.LOADING||o===Rr.PROCESSING||!r.hasEmptyContent&&!r.hasTilesetContent&&o!==Rr.UNLOADED&&o!==Rr.FAILED||l(r.cacheNode)||Math.min(mG(t,r._visitedFrame),mG(t,r._touchedFrame),mG(t,r._selectedFrame),mG(t,r._requestedFrame))<n)return i.length=0,!0;let c=r.children;for(let u=0;u<c.length;++u)i.push(c[u])}return!1}function Vpt(e,t){let n=e._externalTilesetTiles,i=t.frameNumber,r=e._externalTilesetIdleFrames,o=e._externalTilesetSweepCount,s=0,a=0;for(;s<o&&a<Upt&&n.length>0;){++a,e._externalTilesetSweepIndex>=n.length&&(e._externalTilesetSweepIndex=0);let c=e._externalTilesetSweepIndex,u=n[c];if(u.isDestroyed()||!u.hasTilesetContent||u.children.length===0){n.splice(c,1);continue}++e._externalTilesetSweepIndex,++s,!zpt(u,i,r)&&(zEe(e,u),u.unloadTilesetContent(),n.splice(c,1),e._externalTilesetSweepIndex=c)}}function jpt(e,t){e._cache.unloadTile(e,t,VEe),t.destroy()}lo.prototype.trimLoadedTiles=function(){this._cache.trim()};function Hpt(e,t){let n=e._statistics,i=e._statisticsLast,r=n.numberOfPendingRequests,o=n.numberOfTilesProcessing,s=i.numberOfPendingRequests,a=i.numberOfTilesProcessing;Pm.clone(n,i);let c=r!==s||o!==a;c&&t.afterRender.push(function(){return e.loadProgress.raiseEvent(r,o),!0}),e._tilesLoaded=n.numberOfPendingRequests===0&&n.numberOfTilesProcessing===0&&n.numberOfAttemptedRequests===0,c&&e._tilesLoaded&&(t.afterRender.push(function(){return e.allTilesLoaded.raiseEvent(),!0}),e._initialTilesLoaded||(e._initialTilesLoaded=!0,t.afterRender.push(function(){return e.initialTilesLoaded.raiseEvent(),!0})))}function Gpt(e){e._heatmap.resetMinimumMaximum(),e._minimumPriority.depth=Number.MAX_VALUE,e._maximumPriority.depth=-Number.MAX_VALUE,e._minimumPriority.foveatedFactor=Number.MAX_VALUE,e._maximumPriority.foveatedFactor=-Number.MAX_VALUE,e._minimumPriority.distance=Number.MAX_VALUE,e._maximumPriority.distance=-Number.MAX_VALUE,e._minimumPriority.reverseScreenSpaceError=Number.MAX_VALUE,e._maximumPriority.reverseScreenSpaceError=-Number.MAX_VALUE}function Wpt(e,t){t.frameNumber===e._updatedModelMatrixFrame&&l(e._previousModelMatrix)||(e._updatedModelMatrixFrame=t.frameNumber,e._modelMatrixChanged=!N.equals(e.modelMatrix,e._previousModelMatrix),e._modelMatrixChanged&&(e._previousModelMatrix=N.clone(e.modelMatrix,e._previousModelMatrix)))}function qpt(e,t,n,i){if(t.mode===re.MORPHING||!l(e._root))return!1;let r=e._statistics;r.clear(),++e._updatedVisibilityFrame,Gpt(e),Wpt(e,t),e._cullRequestsWhileMoving=e.cullRequestsWhileMoving&&!e._modelMatrixChanged;let o=e.getTraversal(i).selectTiles(e,t);if(i.requestTiles&&Spt(e),Bpt(e,t,i),Pm.clone(r,n),i.isRender){let s=e._credits;if(l(s)&&r.selected!==0)for(let a=0;a<s.length;++a){let c=s[a];t.creditDisplay.addCreditToNextFrame(c)}}return o}function jEe(e){let t=e._credits;l(t)||(t=[]),t.length=0,l(e.resource.credits)&&e.resource.credits.forEach(i=>{t.push(It.clone(i))});let n=e.asset.extras;if(l(n)&&l(n.cesium)&&l(n.cesium.credits)){let i=n.cesium.credits;for(let r=0;r<i.length;++r){let o=i[r];t.push(new It(o.html))}}t.forEach(i=>i.showOnScreen=i.showOnScreen||e._showCreditsOnScreen),e._credits=t}lo.prototype.getTraversal=function(e){let{pass:t}=e;return t===ao.MOST_DETAILED_PRELOAD||t===ao.MOST_DETAILED_PICK?gk:this.isSkippingLevelOfDetail?Tk:Ak};lo.prototype.update=function(e){this.updateForPass(e,e.tilesetPassState)};lo.prototype.updateForPass=function(e,t){this.imageryLayers._update();let n=t.pass;if(n===ao.PRELOAD&&(!this.preloadWhenHidden||this.show)||n===ao.PRELOAD_FLIGHT&&(!this.preloadFlightDestinations||!this.show&&!this.preloadWhenHidden)||n===ao.REQUEST_RENDER_MODE_DEFER_CHECK&&(!this._cullRequestsWhileMoving&&this.foveatedTimeDelay<=0||!this.show))return;let i=e.commandList,r=e.camera,o=e.cullingVolume;t.ready=!1;let s=ao.getPassOptions(n),a=s.ignoreCommands,c=t.commandList??i,u=c.length;if(e.commandList=c,e.camera=t.camera??r,e.cullingVolume=t.cullingVolume??o,s.isRender){let d=this._environmentMapManager;l(this._root)&&(d.position=this.boundingSphere.center),d.update(e)}let f=this._statisticsPerPass[n];(this.show||a)&&(this._pass=n,t.ready=qpt(this,e,f,s)),a&&(c.length=u),e.commandList=i,e.camera=r,e.cullingVolume=o};lo.prototype.hasExtension=function(e){return l(this._extensionsUsed)?this._extensionsUsed.indexOf(e)>-1:!1};lo.prototype.isDestroyed=function(){return!1};lo.prototype.destroy=function(){if(this._tileDebugLabels=this._tileDebugLabels&&this._tileDebugLabels.destroy(),this._removeClippingPolygonAdded=this._removeClippingPolygonAdded&&this._removeClippingPolygonAdded(),this._removeClippingPolygonRemoved=this._removeClippingPolygonRemoved&&this._removeClippingPolygonRemoved(),this._clippingPlanes=this._clippingPlanes&&this._clippingPlanes.destroy(),this._clippingPolygons=void 0,l(this._root)){let e=UEe;for(e.push(this._root);e.length>0;){let t=e.pop();t.destroy();let n=t.children;for(let i=0;i<n.length;++i)e.push(n[i])}}return this._root=void 0,this._shouldDestroyImageBasedLighting&&!this._imageBasedLighting.isDestroyed()&&this._imageBasedLighting.destroy(),this._imageBasedLighting=void 0,this._environmentMapManager.isDestroyed()||this._environmentMapManager.destroy(),this._environmentMapManager=void 0,this._imageryLayers.isDestroyed()||(this.imageryLayers.layerAdded.removeEventListener(this._imageryLayersListener),this.imageryLayers.layerRemoved.removeEventListener(this._imageryLayersListener),this.imageryLayers.layerMoved.removeEventListener(this._imageryLayersListener),this.imageryLayers.layerShownOrHidden.removeEventListener(this._imageryLayersListener),this._imageryLayers.destroy()),this._imageryLayers=void 0,le(this)};lo.supportedExtensions={"3DTILES_metadata":!0,"3DTILES_implicit_tiling":!0,"3DTILES_content_gltf":!0,"3DTILES_content_gltf_vector":!0,"3DTILES_multiple_contents":!0,"3DTILES_bounding_volume_S2":!0,"3DTILES_batch_table_hierarchy":!0,"3DTILES_draco_point_compression":!0,MAXAR_content_geojson:!0};lo.checkSupportedExtensions=function(e){for(let t=0;t<e.length;t++)if(!lo.supportedExtensions[e[t]])throw new oe(`Unsupported 3D Tiles Extension: ${e[t]}`)};var Ypt=new pn,Xpt=new h,Kpt=new h,$pt=new he;lo.prototype.getHeight=function(e,t){let n=t.ellipsoid;l(n)||(n=ee.WGS84);let i=Ypt,r=n.cartographicToCartesian(e,Xpt),o=n.geodeticSurfaceNormal(r,i.direction);i.origin=h.add(r,h.multiplyByScalar(o,2*n.maximumRadius,i.origin),i.origin),i.direction=h.negate(o,i.direction);let s=this.pick(i,t.frameState,Kpt,this.maximumHeightQueryGeometricError);if(l(s))return n.cartesianToCartographic(s,$pt)?.height};lo.prototype.updateHeight=function(e,t,n){n=n??ee.WGS84;let i={positionCartographic:e,ellipsoid:n,callback:t,invoked:!1},r=()=>{let o=this._addHeightCallbacks,s=o.length;for(let a=0;a<s;++a)if(o[a]===i){o.splice(a,1);break}i.callback&&(i.callback=void 0)};return this._addHeightCallbacks.push(i),r};var Jpt=new h;lo.prototype.pick=function(e,t,n,i){if(!t.context.webgl2&&!this._enablePick)return;let r=this._selectedTiles,o=r.length,s=[],a=e.origin.x,c=e.origin.y,u=e.origin.z,f=e.direction.x,d=e.direction.y,p=e.direction.z,g=f*f+d*d+p*p;for(let b=0;b<o;++b){let x=r[b];if(l(i)&&x.geometricError>i||!l(x.content))continue;let T=x.contentBoundingVolume.boundingSphere,E=T.center,v=a-E.x,S=c-E.y,I=u-E.z,R=2*(f*v+d*S+p*I),O=v*v+S*S+I*I-T.radius*T.radius;R*R-4*g*O<0||s.push(x)}let m=s.length,y,A=Number.POSITIVE_INFINITY;for(let b=0;b<m;++b){let T=s[b].content.pick(e,t,Jpt);if(l(T)){let E=h.distanceSquared(T,e.origin);E<A&&(A=E,y=h.clone(T,n))}}return y};lo.prototype.isGltfExtensionUsed=function(e){if(this.hasExtension("3DTILES_content_gltf")){if(!l(this.extensions))return!1;let t=this.extensions["3DTILES_content_gltf"]?.extensionsUsed;return l(t)?t.indexOf(e)>-1:!1}return!1};lo.prototype.isGltfExtensionRequired=function(e){if(this.isGltfExtensionUsed(e)){let t=this.extensions["3DTILES_content_gltf"].extensionsRequired;return l(t)?t.indexOf(e)>-1:!1}return!1};var Yo=lo;var Zpt=new N;function HA(e,t){t.collectionChanged.addEventListener(HA.prototype._onCollectionChanged,this),this._scene=e,this._primitives=e.primitives,this._entityCollection=t,this._tilesetHash={},this._entitiesToVisualize=new Ut,this._onCollectionChanged(t,t.values,[],[])}HA.prototype.update=function(e){let t=this._entitiesToVisualize.values,n=this._tilesetHash,i=this._primitives;for(let r=0,o=t.length;r<o;r++){let s=t[r],a=s._tileset,c,u=n[s.id],f=s.isShowing&&s.isAvailable(e)&&X.getValueOrDefault(a._show,e,!0),d;f&&(d=s.computeModelMatrix(e,Zpt),c=De.createIfNeeded(X.getValueOrUndefined(a._uri,e)));let p=l(u)?u.tilesetPrimitive:void 0;if(!f){l(p)&&(p.show=!1);continue}(!l(u)||c.url!==u.url)&&(l(p)&&i.removeAndDestroy(p),delete n[s.id],Qpt(c,n,s,i)),l(p)&&(p.show=!0,l(d)&&(p.modelMatrix=d),p.maximumScreenSpaceError=X.getValueOrDefault(a.maximumScreenSpaceError,e,p.maximumScreenSpaceError))}return!0};HA.prototype.isDestroyed=function(){return!1};HA.prototype.destroy=function(){this._entityCollection.collectionChanged.removeEventListener(HA.prototype._onCollectionChanged,this);let e=this._entitiesToVisualize.values,t=this._tilesetHash,n=this._primitives;for(let i=e.length-1;i>-1;i--)see(this,e[i],t,n);return le(this)};HA.prototype.getBoundingSphere=function(e,t){let n=this._tilesetHash[e.id];if(!l(n)||n.loadFail)return Pt.FAILED;let i=n.tilesetPrimitive;return l(i)?i.show?(ue.clone(i.boundingSphere,t),Pt.DONE):Pt.FAILED:Pt.PENDING};HA.prototype._onCollectionChanged=function(e,t,n,i){let r,o,s=this._entitiesToVisualize,a=this._tilesetHash,c=this._primitives;for(r=t.length-1;r>-1;r--)o=t[r],l(o._tileset)&&s.set(o.id,o);for(r=i.length-1;r>-1;r--)o=i[r],l(o._tileset)?s.set(o.id,o):(see(this,o,a,c),s.remove(o.id));for(r=n.length-1;r>-1;r--)o=n[r],see(this,o,a,c),s.remove(o.id)};function see(e,t,n,i){let r=n[t.id];l(r)&&(l(r.tilesetPrimitive)&&i.removeAndDestroy(r.tilesetPrimitive),delete n[t.id])}async function Qpt(e,t,n,i){t[n.id]={url:e.url,loadFail:!1};try{let r=await Yo.fromUrl(e);if(r.id=n,i.add(r),!l(t[n.id]))return;t[n.id].tilesetPrimitive=r}catch(r){console.error(r),t[n.id].loadFail=!0}}var Ek=HA;var e0t=z.WHITE,t0t=z.BLACK,n0t=new U(2,2);function Tw(e){e=e??H.EMPTY_OBJECT,this._definitionChanged=new be,this._evenColor=void 0,this._evenColorSubscription=void 0,this._oddColor=void 0,this._oddColorSubscription=void 0,this._repeat=void 0,this._repeatSubscription=void 0,this.evenColor=e.evenColor,this.oddColor=e.oddColor,this.repeat=e.repeat}Object.defineProperties(Tw.prototype,{isConstant:{get:function(){return X.isConstant(this._evenColor)&&X.isConstant(this._oddColor)&&X.isConstant(this._repeat)}},definitionChanged:{get:function(){return this._definitionChanged}},evenColor:me("evenColor"),oddColor:me("oddColor"),repeat:me("repeat")});Tw.prototype.getType=function(e){return"Checkerboard"};var i0t=new K;Tw.prototype.getValue=function(e,t){return l(e)||(e=K.now(i0t)),l(t)||(t={}),t.lightColor=X.getValueOrClonedDefault(this._evenColor,e,e0t,t.lightColor),t.darkColor=X.getValueOrClonedDefault(this._oddColor,e,t0t,t.darkColor),t.repeat=X.getValueOrDefault(this._repeat,e,n0t),t};Tw.prototype.equals=function(e){return this===e||e instanceof Tw&&X.equals(this._evenColor,e._evenColor)&&X.equals(this._oddColor,e._oddColor)&&X.equals(this._repeat,e._repeat)};var Ew=Tw;var HEe={id:void 0};function Ck(e){if(e._firing){e._refire=!0;return}if(e._suspendCount===0){let t=e._addedEntities,n=e._removedEntities,i=e._changedEntities;if(i.length!==0||t.length!==0||n.length!==0){e._firing=!0;do{e._refire=!1;let r=t.values.slice(0),o=n.values.slice(0),s=i.values.slice(0);t.removeAll(),n.removeAll(),i.removeAll(),e._collectionChanged.raiseEvent(e,r,o,s)}while(e._refire);e._firing=!1}}}function pl(e){this._owner=e,this._entities=new Ut,this._addedEntities=new Ut,this._removedEntities=new Ut,this._changedEntities=new Ut,this._suspendCount=0,this._collectionChanged=new be,this._id=Kn(),this._show=!0,this._firing=!1,this._refire=!1}pl.prototype.suspendEvents=function(){this._suspendCount++};pl.prototype.resumeEvents=function(){this._suspendCount--,Ck(this)};Object.defineProperties(pl.prototype,{collectionChanged:{get:function(){return this._collectionChanged}},id:{get:function(){return this._id}},values:{get:function(){return this._entities.values}},show:{get:function(){return this._show},set:function(e){if(e===this._show)return;this.suspendEvents();let t,n=[],i=this._entities.values,r=i.length;for(t=0;t<r;t++)n.push(i[t].isShowing);for(this._show=e,t=0;t<r;t++){let o=n[t],s=i[t];o!==s.isShowing&&s.definitionChanged.raiseEvent(s,"isShowing",s.isShowing,o)}this.resumeEvents()}},owner:{get:function(){return this._owner}}});pl.prototype.computeAvailability=function(){let e=nt.MAXIMUM_VALUE,t=nt.MINIMUM_VALUE,n=this._entities.values;for(let i=0,r=n.length;i<r;i++){let s=n[i].availability;if(l(s)){let a=s.start,c=s.stop;K.lessThan(a,e)&&!a.equals(nt.MINIMUM_VALUE)&&(e=a),K.greaterThan(c,t)&&!c.equals(nt.MAXIMUM_VALUE)&&(t=c)}}return nt.MAXIMUM_VALUE.equals(e)&&(e=nt.MINIMUM_VALUE),nt.MINIMUM_VALUE.equals(t)&&(t=nt.MAXIMUM_VALUE),new En({start:e,stop:t})};pl.prototype.add=function(e){e instanceof Jr||(e=new Jr(e));let t=e.id,n=this._entities;if(n.contains(t))throw new pe(`An entity with id ${t} already exists in this collection.`);return e.entityCollection=this,n.set(t,e),this._removedEntities.remove(t)||this._addedEntities.set(t,e),e.definitionChanged.addEventListener(pl.prototype._onEntityDefinitionChanged,this),Ck(this),e};pl.prototype.remove=function(e){return l(e)?this.removeById(e.id):!1};pl.prototype.contains=function(e){return this._entities.get(e.id)===e};pl.prototype.removeById=function(e){if(!l(e))return!1;let n=this._entities.get(e);return this._entities.remove(e)?(this._addedEntities.remove(e)||(this._removedEntities.set(e,n),this._changedEntities.remove(e)),this._entities.remove(e),n.definitionChanged.removeEventListener(pl.prototype._onEntityDefinitionChanged,this),Ck(this),!0):!1};pl.prototype.removeAll=function(){let e=this._entities,t=e.length,n=e.values,i=this._addedEntities,r=this._removedEntities;for(let o=0;o<t;o++){let s=n[o],a=s.id,c=i.get(a);l(c)||(s.definitionChanged.removeEventListener(pl.prototype._onEntityDefinitionChanged,this),r.set(a,s))}e.removeAll(),i.removeAll(),this._changedEntities.removeAll(),Ck(this)};pl.prototype.getById=function(e){return this._entities.get(e)};pl.prototype.getOrCreateEntity=function(e){let t=this._entities.get(e);return l(t)||(HEe.id=e,t=new Jr(HEe),this.add(t)),t};pl.prototype._onEntityDefinitionChanged=function(e){let t=e.id;this._addedEntities.contains(t)||this._changedEntities.set(t,e),Ck(this)};var Ya=pl;var pG={id:void 0},Cw=new Array(2);function aee(e){let t=e.propertyNames,n=t.length;for(let i=0;i<n;i++)e[t[i]]=void 0;e._name=void 0,e._availability=void 0}function GEe(e,t,n,i){Cw[0]=n,Cw[1]=i.id,t[JSON.stringify(Cw)]=i.definitionChanged.addEventListener(ws.prototype._onDefinitionChanged,e)}function WEe(e,t,n,i){Cw[0]=n,Cw[1]=i.id;let r=JSON.stringify(Cw);t[r](),t[r]=void 0}function GA(e){if(e._shouldRecomposite=!0,e._suspendCount!==0)return;let t=e._collections,n=t.length,i=e._collectionsCopy,r=i.length,o,s,a,c,u,f=e._composite,d=new Ya(e),p=e._eventHash,g;for(o=0;o<r;o++)for(u=i[o],u.collectionChanged.removeEventListener(ws.prototype._onCollectionChanged,e),a=u.values,g=u.id,c=a.length-1;c>-1;c--)s=a[c],WEe(e,p,g,s);for(o=n-1;o>=0;o--)for(u=t[o],u.collectionChanged.addEventListener(ws.prototype._onCollectionChanged,e),a=u.values,g=u.id,c=a.length-1;c>-1;c--){s=a[c],GEe(e,p,g,s);let y=d.getById(s.id);l(y)||(y=f.getById(s.id),l(y)?aee(y):(pG.id=s.id,y=new Jr(pG)),d.add(y)),y.merge(s)}e._collectionsCopy=t.slice(0),f.suspendEvents(),f.removeAll();let m=d.values;for(o=0;o<m.length;o++)f.add(m[o]);f.resumeEvents()}function ws(e,t){this._owner=t,this._composite=new Ya(this),this._suspendCount=0,this._collections=l(e)?e.slice():[],this._collectionsCopy=[],this._id=Kn(),this._eventHash={},GA(this),this._shouldRecomposite=!1}Object.defineProperties(ws.prototype,{collectionChanged:{get:function(){return this._composite._collectionChanged}},id:{get:function(){return this._id}},values:{get:function(){return this._composite.values}},owner:{get:function(){return this._owner}}});ws.prototype.addCollection=function(e,t){l(t)?this._collections.splice(t,0,e):this._collections.push(e),GA(this)};ws.prototype.removeCollection=function(e){let t=this._collections.indexOf(e);return t!==-1?(this._collections.splice(t,1),GA(this),!0):!1};ws.prototype.removeAllCollections=function(){this._collections.length=0,GA(this)};ws.prototype.containsCollection=function(e){return this._collections.indexOf(e)!==-1};ws.prototype.contains=function(e){return this._composite.contains(e)};ws.prototype.indexOfCollection=function(e){return this._collections.indexOf(e)};ws.prototype.getCollection=function(e){return this._collections[e]};ws.prototype.getCollectionsLength=function(){return this._collections.length};function gG(e,t){return e.indexOf(t)}function qEe(e,t,n){let i=e._collections;if(t=D.clamp(t,0,i.length-1),n=D.clamp(n,0,i.length-1),t===n)return;let r=i[t];i[t]=i[n],i[n]=r,GA(e)}ws.prototype.raiseCollection=function(e){let t=gG(this._collections,e);qEe(this,t,t+1)};ws.prototype.lowerCollection=function(e){let t=gG(this._collections,e);qEe(this,t,t-1)};ws.prototype.raiseCollectionToTop=function(e){let t=gG(this._collections,e);t!==this._collections.length-1&&(this._collections.splice(t,1),this._collections.push(e),GA(this))};ws.prototype.lowerCollectionToBottom=function(e){let t=gG(this._collections,e);t!==0&&(this._collections.splice(t,1),this._collections.splice(0,0,e),GA(this))};ws.prototype.suspendEvents=function(){this._suspendCount++,this._composite.suspendEvents()};ws.prototype.resumeEvents=function(){this._suspendCount--,this._shouldRecomposite&&this._suspendCount===0&&(GA(this),this._shouldRecomposite=!1),this._composite.resumeEvents()};ws.prototype.computeAvailability=function(){return this._composite.computeAvailability()};ws.prototype.getById=function(e){return this._composite.getById(e)};ws.prototype._onCollectionChanged=function(e,t,n){let i=this._collectionsCopy,r=i.length,o=this._composite;o.suspendEvents();let s,a,c,u,f=n.length,d=this._eventHash,p=e.id;for(s=0;s<f;s++){let m=n[s];WEe(this,d,p,m);let y=m.id;for(a=r-1;a>=0;a--)c=i[a].getById(y),l(c)&&(l(u)||(u=o.getById(y),aee(u)),u.merge(c));l(u)||o.removeById(y),u=void 0}let g=t.length;for(s=0;s<g;s++){let m=t[s];GEe(this,d,p,m);let y=m.id;for(a=r-1;a>=0;a--)c=i[a].getById(y),l(c)&&(l(u)||(u=o.getById(y),l(u)?aee(u):(pG.id=y,u=new Jr(pG),o.add(u))),u.merge(c));u=void 0}o.resumeEvents()};ws.prototype._onDefinitionChanged=function(e,t,n,i){let r=this._collections,o=this._composite,s=r.length,a=e.id,c=o.getById(a),u=c[t],f=!l(u),d=!0;for(let p=s-1;p>=0;p--){let g=r[p].getById(e.id);if(l(g)){let m=g[t];if(l(m)){if(d)if(d=!1,l(m.merge)&&l(m.clone))u=m.clone(u);else{u=m;break}u.merge(m)}}}f&&c.propertyNames.indexOf(t)===-1&&c.addProperty(t),c[t]=u};var cee=ws;function lee(){this._removalFunctions=[]}lee.prototype.add=function(e,t,n){let i=e.addEventListener(t,n);this._removalFunctions.push(i);let r=this;return function(){i();let o=r._removalFunctions;o.splice(o.indexOf(i),1)}};lee.prototype.removeAll=function(){let e=this._removalFunctions;for(let t=0,n=e.length;t<n;++t)e[t]();e.length=0};var Xo=lee;function dee(e,t){return K.compare(e.start,t.start)}function Is(e){if(this._intervals=[],this._changedEvent=new be,l(e)){let t=e.length;for(let n=0;n<t;n++)this.addInterval(e[n])}}Object.defineProperties(Is.prototype,{changedEvent:{get:function(){return this._changedEvent}},start:{get:function(){let e=this._intervals;return e.length===0?void 0:e[0].start}},isStartIncluded:{get:function(){let e=this._intervals;return e.length===0?!1:e[0].isStartIncluded}},stop:{get:function(){let e=this._intervals,t=e.length;return t===0?void 0:e[t-1].stop}},isStopIncluded:{get:function(){let e=this._intervals,t=e.length;return t===0?!1:e[t-1].isStopIncluded}},length:{get:function(){return this._intervals.length}},isEmpty:{get:function(){return this._intervals.length===0}}});Is.prototype.equals=function(e,t){if(this===e)return!0;if(!(e instanceof Is))return!1;let n=this._intervals,i=e._intervals,r=n.length;if(r!==i.length)return!1;for(let o=0;o<r;o++)if(!En.equals(n[o],i[o],t))return!1;return!0};Is.prototype.get=function(e){return this._intervals[e]};Is.prototype.removeAll=function(){this._intervals.length>0&&(this._intervals.length=0,this._changedEvent.raiseEvent(this))};Is.prototype.findIntervalContainingDate=function(e){let t=this.indexOf(e);return t>=0?this._intervals[t]:void 0};Is.prototype.findDataForIntervalContainingDate=function(e){let t=this.indexOf(e);return t>=0?this._intervals[t].data:void 0};Is.prototype.contains=function(e){return this.indexOf(e)>=0};var uee=new En;Is.prototype.indexOf=function(e){let t=this._intervals;uee.start=e,uee.stop=e;let n=vr(t,uee,dee);return n>=0?t[n].isStartIncluded?n:n>0&&t[n-1].stop.equals(e)&&t[n-1].isStopIncluded?n-1:~n:(n=~n,n>0&&n-1<t.length&&En.contains(t[n-1],e)?n-1:~n)};Is.prototype.findInterval=function(e){e=e??H.EMPTY_OBJECT;let t=e.start,n=e.stop,i=e.isStartIncluded,r=e.isStopIncluded,o=this._intervals;for(let s=0,a=o.length;s<a;s++){let c=o[s];if((!l(t)||c.start.equals(t))&&(!l(n)||c.stop.equals(n))&&(!l(i)||c.isStartIncluded===i)&&(!l(r)||c.isStopIncluded===r))return o[s]}};Is.prototype.addInterval=function(e,t){if(e.isEmpty)return;let n=this._intervals;if(n.length===0||K.greaterThan(e.start,n[n.length-1].stop)){n.push(e),this._changedEvent.raiseEvent(this);return}let i=vr(n,e,dee);i<0?i=~i:i>0&&e.isStartIncluded&&n[i-1].isStartIncluded&&n[i-1].start.equals(e.start)?--i:i<n.length&&!e.isStartIncluded&&n[i].isStartIncluded&&n[i].start.equals(e.start)&&++i;let r;for(i>0&&(r=K.compare(n[i-1].stop,e.start),(r>0||r===0&&(n[i-1].isStopIncluded||e.isStartIncluded))&&((l(t)?t(n[i-1].data,e.data):n[i-1].data===e.data)?(K.greaterThan(e.stop,n[i-1].stop)?e=new En({start:n[i-1].start,stop:e.stop,isStartIncluded:n[i-1].isStartIncluded,isStopIncluded:e.isStopIncluded,data:e.data}):e=new En({start:n[i-1].start,stop:n[i-1].stop,isStartIncluded:n[i-1].isStartIncluded,isStopIncluded:n[i-1].isStopIncluded||e.stop.equals(n[i-1].stop)&&e.isStopIncluded,data:e.data}),n.splice(i-1,1),--i):(r=K.compare(n[i-1].stop,e.stop),(r>0||r===0&&n[i-1].isStopIncluded&&!e.isStopIncluded)&&n.splice(i,0,new En({start:e.stop,stop:n[i-1].stop,isStartIncluded:!e.isStopIncluded,isStopIncluded:n[i-1].isStopIncluded,data:n[i-1].data})),n[i-1]=new En({start:n[i-1].start,stop:e.start,isStartIncluded:n[i-1].isStartIncluded,isStopIncluded:!e.isStartIncluded,data:n[i-1].data}))));i<n.length&&(r=K.compare(e.stop,n[i].start),r>0||r===0&&(e.isStopIncluded||n[i].isStartIncluded));)if(l(t)?t(n[i].data,e.data):n[i].data===e.data)e=new En({start:e.start,stop:K.greaterThan(n[i].stop,e.stop)?n[i].stop:e.stop,isStartIncluded:e.isStartIncluded,isStopIncluded:K.greaterThan(n[i].stop,e.stop)?n[i].isStopIncluded:e.isStopIncluded,data:e.data}),n.splice(i,1);else if(n[i]=new En({start:e.stop,stop:n[i].stop,isStartIncluded:!e.isStopIncluded,isStopIncluded:n[i].isStopIncluded,data:n[i].data}),n[i].isEmpty)n.splice(i,1);else break;n.splice(i,0,e),this._changedEvent.raiseEvent(this)};Is.prototype.removeInterval=function(e){if(e.isEmpty)return!1;let t=this._intervals,n=vr(t,e,dee);n<0&&(n=~n);let i=!1;for(n>0&&(K.greaterThan(t[n-1].stop,e.start)||t[n-1].stop.equals(e.start)&&t[n-1].isStopIncluded&&e.isStartIncluded)&&(i=!0,(K.greaterThan(t[n-1].stop,e.stop)||t[n-1].isStopIncluded&&!e.isStopIncluded&&t[n-1].stop.equals(e.stop))&&t.splice(n,0,new En({start:e.stop,stop:t[n-1].stop,isStartIncluded:!e.isStopIncluded,isStopIncluded:t[n-1].isStopIncluded,data:t[n-1].data})),t[n-1]=new En({start:t[n-1].start,stop:e.start,isStartIncluded:t[n-1].isStartIncluded,isStopIncluded:!e.isStartIncluded,data:t[n-1].data})),n<t.length&&!e.isStartIncluded&&t[n].isStartIncluded&&e.start.equals(t[n].start)&&(i=!0,t.splice(n,0,new En({start:t[n].start,stop:t[n].start,isStartIncluded:!0,isStopIncluded:!0,data:t[n].data})),++n);n<t.length&&K.greaterThan(e.stop,t[n].stop);)i=!0,t.splice(n,1);return n<t.length&&e.stop.equals(t[n].stop)&&(i=!0,!e.isStopIncluded&&t[n].isStopIncluded?n+1<t.length&&t[n+1].start.equals(e.stop)&&t[n].data===t[n+1].data?(t.splice(n,1),t[n]=new En({start:t[n].start,stop:t[n].stop,isStartIncluded:!0,isStopIncluded:t[n].isStopIncluded,data:t[n].data})):t[n]=new En({start:e.stop,stop:e.stop,isStartIncluded:!0,isStopIncluded:!0,data:t[n].data}):t.splice(n,1)),n<t.length&&(K.greaterThan(e.stop,t[n].start)||e.stop.equals(t[n].start)&&e.isStopIncluded&&t[n].isStartIncluded)&&(i=!0,t[n]=new En({start:e.stop,stop:t[n].stop,isStartIncluded:!e.isStopIncluded,isStopIncluded:t[n].isStopIncluded,data:t[n].data})),i&&this._changedEvent.raiseEvent(this),i};Is.prototype.intersect=function(e,t,n){let i=new Is,r=0,o=0,s=this._intervals,a=e._intervals;for(;r<s.length&&o<a.length;){let c=s[r],u=a[o];if(K.lessThan(c.stop,u.start))++r;else if(K.lessThan(u.stop,c.start))++o;else{if(l(n)||l(t)&&t(c.data,u.data)||!l(t)&&u.data===c.data){let f=En.intersect(c,u,new En,n);f.isEmpty||i.addInterval(f,t)}K.lessThan(c.stop,u.stop)||c.stop.equals(u.stop)&&!c.isStopIncluded&&u.isStopIncluded?++r:++o}}return i};Is.fromJulianDateArray=function(e,t){l(t)||(t=new Is);let n=e.julianDates,i=n.length,r=e.dataCallback,o=e.isStartIncluded??!0,s=e.isStopIncluded??!0,a=e.leadingInterval??!1,c=e.trailingInterval??!1,u,f=0;a&&(++f,u=new En({start:nt.MINIMUM_VALUE,stop:n[0],isStartIncluded:!0,isStopIncluded:!o}),u.data=l(r)?r(u,t.length):t.length,t.addInterval(u));for(let d=0;d<i-1;++d){let p=n[d],g=n[d+1];u=new En({start:p,stop:g,isStartIncluded:t.length===f?o:!0,isStopIncluded:d===i-2?s:!1}),u.data=l(r)?r(u,t.length):t.length,t.addInterval(u)}return c&&(u=new En({start:n[i-1],stop:nt.MAXIMUM_VALUE,isStartIncluded:!s,isStopIncluded:!0}),u.data=l(r)?r(u,t.length):t.length,t.addInterval(u)),t};var gl=new Bh,vk=[0,31,28,31,30,31,30,31,31,30,31,30,31];function fee(e,t,n){l(n)||(n=new K),K.toGregorianDate(e,gl);let i=gl.millisecond+t.millisecond,r=gl.second+t.second,o=gl.minute+t.minute,s=gl.hour+t.hour,a=gl.day+t.day,c=gl.month+t.month,u=gl.year+t.year;for(i>=1e3&&(r+=Math.floor(i/1e3),i=i%1e3),r>=60&&(o+=Math.floor(r/60),r=r%60),o>=60&&(s+=Math.floor(o/60),o=o%60),s>=24&&(a+=Math.floor(s/24),s=s%24),vk[2]=kl(u)?29:28;a>vk[c]||c>=13;)a>vk[c]&&(a-=vk[c],++c),c>=13&&(--c,u+=Math.floor(c/12),c=c%12,++c),vk[2]=kl(u)?29:28;return gl.millisecond=i,gl.second=r,gl.minute=o,gl.hour=s,gl.day=a,gl.month=c,gl.year=u,K.fromGregorianDate(gl,n)}var r0t=new K,o0t=/P(?:([\d.,]+)Y)?(?:([\d.,]+)M)?(?:([\d.,]+)W)?(?:([\d.,]+)D)?(?:T(?:([\d.,]+)H)?(?:([\d.,]+)M)?(?:([\d.,]+)S)?)?/;function YEe(e,t){if(!l(e)||e.length===0)return!1;if(t.year=0,t.month=0,t.day=0,t.hour=0,t.minute=0,t.second=0,t.millisecond=0,e[0]==="P"){let n=e.match(o0t);if(!l(n))return!1;if(l(n[1])&&(t.year=Number(n[1].replace(",","."))),l(n[2])&&(t.month=Number(n[2].replace(",","."))),l(n[3])&&(t.day=Number(n[3].replace(",","."))*7),l(n[4])&&(t.day+=Number(n[4].replace(",","."))),l(n[5])&&(t.hour=Number(n[5].replace(",","."))),l(n[6])&&(t.minute=Number(n[6].replace(",","."))),l(n[7])){let i=Number(n[7].replace(",","."));t.second=Math.floor(i),t.millisecond=i%1*1e3}}else e[e.length-1]!=="Z"&&(e+="Z"),K.toGregorianDate(K.fromIso8601(e,r0t),t);return t.year||t.month||t.day||t.hour||t.minute||t.second||t.millisecond}var Sk=new Bh;Is.fromIso8601=function(e,t){let n=e.iso8601.split("/"),i=K.fromIso8601(n[0]),r=K.fromIso8601(n[1]),o=[];if(!YEe(n[2],Sk))o.push(i,r);else{let s=K.clone(i);for(o.push(s);K.compare(s,r)<0;)s=fee(s,Sk),K.compare(r,s)<=0&&K.clone(r,s),o.push(s)}return Is.fromJulianDateArray({julianDates:o,isStartIncluded:e.isStartIncluded,isStopIncluded:e.isStopIncluded,leadingInterval:e.leadingInterval,trailingInterval:e.trailingInterval,dataCallback:e.dataCallback},t)};Is.fromIso8601DateArray=function(e,t){return Is.fromJulianDateArray({julianDates:e.iso8601Dates.map(function(n){return K.fromIso8601(n)}),isStartIncluded:e.isStartIncluded,isStopIncluded:e.isStopIncluded,leadingInterval:e.leadingInterval,trailingInterval:e.trailingInterval,dataCallback:e.dataCallback},t)};Is.fromIso8601DurationArray=function(e,t){let n=e.epoch,i=e.iso8601Durations,r=e.relativeToPrevious??!1,o=[],s,a,c=i.length;for(let u=0;u<c;++u)(YEe(i[u],Sk)||u===0)&&(r&&l(a)?s=fee(a,Sk):s=fee(n,Sk),o.push(s),a=s);return Is.fromJulianDateArray({julianDates:o,isStartIncluded:e.isStartIncluded,isStopIncluded:e.isStopIncluded,leadingInterval:e.leadingInterval,trailingInterval:e.trailingInterval,dataCallback:e.dataCallback},t)};var Ps=Is;function s0t(e,t,n,i){function r(){n.raiseEvent(e)}let o=[];t.removeAll();let s=i.length;for(let a=0;a<s;a++){let c=i.get(a);l(c.data)&&o.indexOf(c.data)===-1&&t.add(c.data.definitionChanged,r)}}function QT(){this._eventHelper=new Xo,this._definitionChanged=new be,this._intervals=new Ps,this._intervals.changedEvent.addEventListener(QT.prototype._intervalsChanged,this)}Object.defineProperties(QT.prototype,{isConstant:{get:function(){return this._intervals.isEmpty}},definitionChanged:{get:function(){return this._definitionChanged}},intervals:{get:function(){return this._intervals}}});var a0t=new K;QT.prototype.getValue=function(e,t){l(e)||(e=K.now(a0t));let n=this._intervals.findDataForIntervalContainingDate(e);if(l(n))return n.getValue(e,t)};QT.prototype.equals=function(e){return this===e||e instanceof QT&&this._intervals.equals(e._intervals,X.equals)};QT.prototype._intervalsChanged=function(){s0t(this,this._eventHelper,this._definitionChanged,this._intervals),this._definitionChanged.raiseEvent(this)};var _l=QT;function WA(){this._definitionChanged=new be,this._composite=new _l,this._composite.definitionChanged.addEventListener(WA.prototype._raiseDefinitionChanged,this)}Object.defineProperties(WA.prototype,{isConstant:{get:function(){return this._composite.isConstant}},definitionChanged:{get:function(){return this._definitionChanged}},intervals:{get:function(){return this._composite._intervals}}});WA.prototype.getType=function(e){let t=this._composite._intervals.findDataForIntervalContainingDate(e);if(l(t))return t.getType(e)};var c0t=new K;WA.prototype.getValue=function(e,t){l(e)||(e=K.now(c0t));let n=this._composite._intervals.findDataForIntervalContainingDate(e);if(l(n))return n.getValue(e,t)};WA.prototype.equals=function(e){return this===e||e instanceof WA&&this._composite.equals(e._composite,X.equals)};WA.prototype._raiseDefinitionChanged=function(){this._definitionChanged.raiseEvent(this)};var vw=WA;function qA(e){this._referenceFrame=e??ji.FIXED,this._definitionChanged=new be,this._composite=new _l,this._composite.definitionChanged.addEventListener(qA.prototype._raiseDefinitionChanged,this)}Object.defineProperties(qA.prototype,{isConstant:{get:function(){return this._composite.isConstant}},definitionChanged:{get:function(){return this._definitionChanged}},intervals:{get:function(){return this._composite.intervals}},referenceFrame:{get:function(){return this._referenceFrame},set:function(e){this._referenceFrame=e}}});var l0t=new K;qA.prototype.getValue=function(e,t){return l(e)||(e=K.now(l0t)),this.getValueInReferenceFrame(e,ji.FIXED,t)};qA.prototype.getValueInReferenceFrame=function(e,t,n){let i=this._composite._intervals.findDataForIntervalContainingDate(e);if(l(i))return i.getValueInReferenceFrame(e,t,n)};qA.prototype.equals=function(e){return this===e||e instanceof qA&&this._referenceFrame===e._referenceFrame&&this._composite.equals(e._composite,X.equals)};qA.prototype._raiseDefinitionChanged=function(){this._definitionChanged.raiseEvent(this)};var pc=qA;var XEe={ROUNDED:0,MITERED:1,BEVELED:2};Object.freeze(XEe);var rr=XEe;var gc=[new h,new h],u0t=new h,f0t=new h,d0t=new h,h0t=new h,m0t=new h,p0t=new h,g0t=new h,_0t=new h,y0t=new h,Sw=new h,_G=new h,wk={},hee=new he;function A0t(e,t){let n=new Array(e.length);for(let i=0;i<e.length;i++){let r=e[i];hee=t.cartesianToCartographic(r,hee),n[i]=hee.height,e[i]=t.scaleToGeodeticSurface(r,r)}return n}function mee(e,t,n,i){let r=e[0],o=e[1],s=h.angleBetween(r,o),a=Math.ceil(s/i),c=new Array(a),u;if(t===n){for(u=0;u<a;u++)c[u]=t;return c.push(n),c}let d=(n-t)/a;for(u=1;u<a;u++){let p=t+u*d;c[u]=p}return c[0]=t,c.push(n),c}var yG=new h,AG=new h;function b0t(e,t,n,i){let r=new Vs(n,i),o=r.projectPointOntoPlane(h.add(n,e,yG),yG),s=r.projectPointOntoPlane(h.add(n,t,AG),AG),a=U.angleBetween(o,s);return s.x*o.y-s.y*o.x>=0?-a:a}var x0t=new h(-1,0,0),eE=new N,T0t=new N,pee=new $,E0t=$.IDENTITY.clone(),C0t=new h,v0t=new se,KEe=new h;function C_(e,t,n,i,r,o,s,a){let c=C0t,u=v0t;eE=At.eastNorthUpToFixedFrame(e,r,eE),c=N.multiplyByPointAsVector(eE,x0t,c),c=h.normalize(c,c);let f=b0t(c,t,e,r);pee=$.fromRotationZ(f,pee),KEe.z=o,eE=N.multiplyTransformation(eE,N.fromRotationTranslation(pee,KEe,T0t),eE);let d=E0t;d[0]=s;for(let p=0;p<a;p++)for(let g=0;g<n.length;g+=3)u=h.fromArray(n,g,u),u=$.multiplyByVector(d,u,u),u=N.multiplyByPoint(eE,u,u),i.push(u.x,u.y,u.z);return i}var S0t=new h;function gee(e,t,n,i,r,o,s){for(let a=0;a<e.length;a+=3){let c=h.fromArray(e,a,S0t);i=C_(c,t,n,i,r,o[a/3],s,1)}return i}function w0t(e,t){let n=e.length,i=new Array(n*6),r=0,o=t.x+t.width/2,s=t.y+t.height/2,a=e[0];i[r++]=a.x-o,i[r++]=0,i[r++]=a.y-s;for(let c=1;c<n;c++){a=e[c];let u=a.x-o,f=a.y-s;i[r++]=u,i[r++]=0,i[r++]=f,i[r++]=u,i[r++]=0,i[r++]=f}return a=e[0],i[r++]=a.x-o,i[r++]=0,i[r]=a.y-s,i}function $Ee(e,t){let n=e.length,i=new Array(n*3),r=0,o=t.x+t.width/2,s=t.y+t.height/2;for(let a=0;a<n;a++)i[r++]=e[a].x-o,i[r++]=0,i[r++]=e[a].y-s;return i}var JEe=new Le,ZEe=new h,QEe=new $;function eCe(e,t,n,i,r,o,s,a,c,u){let f=h.angleBetween(h.subtract(t,e,Sw),h.subtract(n,e,_G)),d=i===rr.BEVELED?0:Math.ceil(f/D.toRadians(5)),p;r?p=$.fromQuaternion(Le.fromAxisAngle(h.negate(e,Sw),f/(d+1),JEe),QEe):p=$.fromQuaternion(Le.fromAxisAngle(e,f/(d+1),JEe),QEe);let g,m;if(t=h.clone(t,ZEe),d>0){let y=u?2:1;for(let A=0;A<d;A++)t=$.multiplyByVector(p,t,t),g=h.subtract(t,e,Sw),g=h.normalize(g,g),r||(g=h.negate(g,g)),m=o.scaleToGeodeticSurface(t,_G),s=C_(m,g,a,s,o,c,1,y)}else g=h.subtract(t,e,Sw),g=h.normalize(g,g),r||(g=h.negate(g,g)),m=o.scaleToGeodeticSurface(t,_G),s=C_(m,g,a,s,o,c,1,1),n=h.clone(n,ZEe),g=h.subtract(n,e,Sw),g=h.normalize(g,g),r||(g=h.negate(g,g)),m=o.scaleToGeodeticSurface(n,_G),s=C_(m,g,a,s,o,c,1,1);return s}wk.removeDuplicatesFromShape=function(e){let t=e.length,n=[];for(let i=t-1,r=0;r<t;i=r++){let o=e[i],s=e[r];U.equals(o,s)||n.push(s)}return n};wk.angleIsGreaterThanPi=function(e,t,n,i){let r=new Vs(n,i),o=r.projectPointOntoPlane(h.add(n,e,yG),yG),s=r.projectPointOntoPlane(h.add(n,t,AG),AG);return s.x*o.y-s.y*o.x>=0};var I0t=new h,P0t=new h;wk.computePositions=function(e,t,n,i,r){let o=i._ellipsoid,s=A0t(e,o),a=i._granularity,c=i._cornerType,u=r?w0t(t,n):$Ee(t,n),f=r?$Ee(t,n):void 0,d=n.height/2,p=n.width/2,g=e.length,m=[],y=r?[]:void 0,A=u0t,b=f0t,x=d0t,T=h0t,E=m0t,v=p0t,S=g0t,I=_0t,R=y0t,O=e[0],L=e[1];T=o.geodeticSurfaceNormal(O,T),A=h.subtract(L,O,A),A=h.normalize(A,A),I=h.cross(T,A,I),I=h.normalize(I,I);let _=s[0],C=s[1];r&&(y=C_(O,I,f,y,o,_+d,1,1)),R=h.clone(O,R),O=L,b=h.negate(A,b);let w,P;for(let V=1;V<g-1;V++){let B=r?2:1;if(L=e[V+1],O.equals(L)){_t("Positions are too close and are considered equivalent with rounding error.");continue}A=h.subtract(L,O,A),A=h.normalize(A,A),T=o.geodeticSurfaceNormal(O,T);let j=h.multiplyByScalar(T,h.dot(A,T),I0t);h.subtract(A,j,j),h.normalize(j,j);let k=h.multiplyByScalar(T,h.dot(b,T),P0t);if(h.subtract(b,k,k),h.normalize(k,k),!D.equalsEpsilon(Math.abs(h.dot(j,k)),1,D.EPSILON7)){x=h.add(A,b,x),x=h.normalize(x,x),x=h.cross(x,T,x),x=h.cross(T,x,x),x=h.normalize(x,x);let q=1/Math.max(.25,h.magnitude(h.cross(x,b,Sw))),Q=wk.angleIsGreaterThanPi(A,b,O,o);Q?(E=h.add(O,h.multiplyByScalar(x,q*p,x),E),v=h.add(E,h.multiplyByScalar(I,p,v),v),gc[0]=h.clone(R,gc[0]),gc[1]=h.clone(v,gc[1]),w=mee(gc,_+d,C+d,a),P=ir.generateArc({positions:gc,granularity:a,ellipsoid:o}),m=gee(P,I,u,m,o,w,1),I=h.cross(T,A,I),I=h.normalize(I,I),S=h.add(E,h.multiplyByScalar(I,p,S),S),c===rr.ROUNDED||c===rr.BEVELED?eCe(E,v,S,c,Q,o,m,u,C+d,r):(x=h.negate(x,x),m=C_(O,x,u,m,o,C+d,q,B)),R=h.clone(S,R)):(E=h.add(O,h.multiplyByScalar(x,q*p,x),E),v=h.add(E,h.multiplyByScalar(I,-p,v),v),gc[0]=h.clone(R,gc[0]),gc[1]=h.clone(v,gc[1]),w=mee(gc,_+d,C+d,a),P=ir.generateArc({positions:gc,granularity:a,ellipsoid:o}),m=gee(P,I,u,m,o,w,1),I=h.cross(T,A,I),I=h.normalize(I,I),S=h.add(E,h.multiplyByScalar(I,-p,S),S),c===rr.ROUNDED||c===rr.BEVELED?eCe(E,v,S,c,Q,o,m,u,C+d,r):m=C_(O,x,u,m,o,C+d,q,B),R=h.clone(S,R)),b=h.negate(A,b)}else m=C_(R,I,u,m,o,_+d,1,1),R=O;_=C,C=s[V+1],O=L}gc[0]=h.clone(R,gc[0]),gc[1]=h.clone(O,gc[1]),w=mee(gc,_+d,C+d,a),P=ir.generateArc({positions:gc,granularity:a,ellipsoid:o}),m=gee(P,I,u,m,o,w,1),r&&(y=C_(O,I,f,y,o,C+d,1,1)),g=m.length;let M=r?g+y.length:g,F=new Float64Array(M);return F.set(m),r&&F.set(y,g),F};var Dm=wk;var yee={},ww=new h,oCe=new h,D0t=new h,tCe=new h,lu=[new h,new h],sCe=new h,aCe=new h,cCe=new h,R0t=new h,O0t=new h,M0t=new h,N0t=new h,L0t=new h,F0t=new h,B0t=new h,nCe=new Le,iCe=new $;function bG(e,t,n,i,r){let o=h.angleBetween(h.subtract(t,e,ww),h.subtract(n,e,oCe)),s=i===rr.BEVELED?1:Math.ceil(o/D.toRadians(5))+1,a=s*3,c=new Array(a);c[a-3]=n.x,c[a-2]=n.y,c[a-1]=n.z;let u;r?u=$.fromQuaternion(Le.fromAxisAngle(h.negate(e,ww),o/s,nCe),iCe):u=$.fromQuaternion(Le.fromAxisAngle(e,o/s,nCe),iCe);let f=0;t=h.clone(t,ww);for(let d=0;d<s;d++)t=$.multiplyByVector(u,t,t),c[f++]=t.x,c[f++]=t.y,c[f++]=t.z;return c}function k0t(e){let t=sCe,n=aCe,i=cCe,r=e[1];n=h.fromArray(e[1],r.length-3,n),i=h.fromArray(e[0],0,i),t=h.midpoint(n,i,t);let o=bG(t,n,i,rr.ROUNDED,!1),s=e.length-1,a=e[s-1];r=e[s],n=h.fromArray(a,a.length-3,n),i=h.fromArray(r,0,i),t=h.midpoint(n,i,t);let c=bG(t,n,i,rr.ROUNDED,!1);return[o,c]}function rCe(e,t,n,i){let r=ww;return i?r=h.add(e,t,r):(t=h.negate(t,t),r=h.add(e,t,r)),[r.x,r.y,r.z,n.x,n.y,n.z]}function _ee(e,t,n,i){let r=new Array(e.length),o=new Array(e.length),s=h.multiplyByScalar(t,n,ww),a=h.negate(s,oCe),c=0,u=e.length-1;for(let f=0;f<e.length;f+=3){let d=h.fromArray(e,f,D0t),p=h.add(d,a,tCe);r[c++]=p.x,r[c++]=p.y,r[c++]=p.z;let g=h.add(d,s,tCe);o[u--]=g.z,o[u--]=g.y,o[u--]=g.x}return i.push(r,o),i}yee.addAttribute=function(e,t,n,i){let r=t.x,o=t.y,s=t.z;l(n)&&(e[n]=r,e[n+1]=o,e[n+2]=s),l(i)&&(e[i]=s,e[i-1]=o,e[i-2]=r)};var U0t=new h,z0t=new h;yee.computePositions=function(e){let t=e.granularity,n=e.positions,i=e.ellipsoid,r=e.width/2,o=e.cornerType,s=e.saveAttributes,a=sCe,c=aCe,u=cCe,f=R0t,d=O0t,p=M0t,g=N0t,m=L0t,y=F0t,A=B0t,b=[],x=s?[]:void 0,T=s?[]:void 0,E=n[0],v=n[1];c=h.normalize(h.subtract(v,E,c),c),a=i.geodeticSurfaceNormal(E,a),f=h.normalize(h.cross(a,c,f),f),s&&(x.push(f.x,f.y,f.z),T.push(a.x,a.y,a.z)),g=h.clone(E,g),E=v,u=h.negate(c,u);let S,I=[],R,O=n.length;for(R=1;R<O-1;R++){a=i.geodeticSurfaceNormal(E,a),v=n[R+1],c=h.normalize(h.subtract(v,E,c),c);let _=h.multiplyByScalar(a,h.dot(c,a),U0t);h.subtract(c,_,_),h.normalize(_,_);let C=h.multiplyByScalar(a,h.dot(u,a),z0t);if(h.subtract(u,C,C),h.normalize(C,C),!D.equalsEpsilon(Math.abs(h.dot(_,C)),1,D.EPSILON7)){d=h.normalize(h.add(c,u,d),d),d=h.cross(d,a,d),d=h.cross(a,d,d),d=h.normalize(d,d);let P=r/Math.max(.25,h.magnitude(h.cross(d,u,ww))),M=Dm.angleIsGreaterThanPi(c,u,E,i);d=h.multiplyByScalar(d,P,d),M?(m=h.add(E,d,m),A=h.add(m,h.multiplyByScalar(f,r,A),A),y=h.add(m,h.multiplyByScalar(f,r*2,y),y),lu[0]=h.clone(g,lu[0]),lu[1]=h.clone(A,lu[1]),S=ir.generateArc({positions:lu,granularity:t,ellipsoid:i}),b=_ee(S,f,r,b),s&&(x.push(f.x,f.y,f.z),T.push(a.x,a.y,a.z)),p=h.clone(y,p),f=h.normalize(h.cross(a,c,f),f),y=h.add(m,h.multiplyByScalar(f,r*2,y),y),g=h.add(m,h.multiplyByScalar(f,r,g),g),o===rr.ROUNDED||o===rr.BEVELED?I.push({leftPositions:bG(m,p,y,o,M)}):I.push({leftPositions:rCe(E,h.negate(d,d),y,M)})):(y=h.add(E,d,y),A=h.add(y,h.negate(h.multiplyByScalar(f,r,A),A),A),m=h.add(y,h.negate(h.multiplyByScalar(f,r*2,m),m),m),lu[0]=h.clone(g,lu[0]),lu[1]=h.clone(A,lu[1]),S=ir.generateArc({positions:lu,granularity:t,ellipsoid:i}),b=_ee(S,f,r,b),s&&(x.push(f.x,f.y,f.z),T.push(a.x,a.y,a.z)),p=h.clone(m,p),f=h.normalize(h.cross(a,c,f),f),m=h.add(y,h.negate(h.multiplyByScalar(f,r*2,m),m),m),g=h.add(y,h.negate(h.multiplyByScalar(f,r,g),g),g),o===rr.ROUNDED||o===rr.BEVELED?I.push({rightPositions:bG(y,p,m,o,M)}):I.push({rightPositions:rCe(E,d,m,M)})),u=h.negate(c,u)}E=v}a=i.geodeticSurfaceNormal(E,a),lu[0]=h.clone(g,lu[0]),lu[1]=h.clone(E,lu[1]),S=ir.generateArc({positions:lu,granularity:t,ellipsoid:i}),b=_ee(S,f,r,b),s&&(x.push(f.x,f.y,f.z),T.push(a.x,a.y,a.z));let L;return o===rr.ROUNDED&&(L=k0t(b)),{positions:b,corners:I,lefts:x,normals:T,endPositions:L}};var mr=yee;var fCe=new h,dCe=new h,xG=new h,TG=new h,V0t=new h,hCe=new h,YA=new h,Iw=new h;function mCe(e,t){for(let n=0;n<e.length;n++)e[n]=t.scaleToGeodeticSurface(e[n],e[n]);return e}function Rm(e,t,n,i,r,o){let s=e.normals,a=e.tangents,c=e.bitangents,u=h.normalize(h.cross(n,t,YA),YA);o.normal&&mr.addAttribute(s,t,i,r),o.tangent&&mr.addAttribute(a,u,i,r),o.bitangent&&mr.addAttribute(c,n,i,r)}function pCe(e,t,n){let i=e.positions,r=e.corners,o=e.endPositions,s=e.lefts,a=e.normals,c=new Tn,u=0,f=0,d,p=0,g;for(d=0;d<i.length;d+=2)g=i[d].length-3,u+=g,p+=g*2,f+=i[d+1].length-3;for(u+=3,f+=3,d=0;d<r.length;d++){let J=r[d].leftPositions;l(J)?(g=J.length,u+=g,p+=g):(g=r[d].rightPositions.length,f+=g,p+=g)}let m=l(o),y;m&&(y=o[0].length-3,u+=y,f+=y,y/=3,p+=y*6);let A=u+f,b=new Float64Array(A),x=t.normal?new Float32Array(A):void 0,T=t.tangent?new Float32Array(A):void 0,E=t.bitangent?new Float32Array(A):void 0,v={normals:x,tangents:T,bitangents:E},S=0,I=A-1,R,O,L,_,C=fCe,w=dCe,P,M,F=y/2,V=je.createTypedArray(A/3,p),B=0;if(m){M=xG,P=TG;let J=o[0];for(C=h.fromArray(a,0,C),w=h.fromArray(s,0,w),d=0;d<F;d++)M=h.fromArray(J,(F-1-d)*3,M),P=h.fromArray(J,(F+d)*3,P),mr.addAttribute(b,P,S),mr.addAttribute(b,M,void 0,I),Rm(v,C,w,S,I,t),O=S/3,_=O+1,R=(I-2)/3,L=R-1,V[B++]=R,V[B++]=O,V[B++]=L,V[B++]=L,V[B++]=O,V[B++]=_,S+=3,I-=3}let j=0,k=0,G=i[j++],q=i[j++];b.set(G,S),b.set(q,I-q.length+1),w=h.fromArray(s,k,w);let Q,W;for(g=q.length-3,d=0;d<g;d+=3)Q=n.geodeticSurfaceNormal(h.fromArray(G,d,YA),YA),W=n.geodeticSurfaceNormal(h.fromArray(q,g-d,Iw),Iw),C=h.normalize(h.add(Q,W,C),C),Rm(v,C,w,S,I,t),O=S/3,_=O+1,R=(I-2)/3,L=R-1,V[B++]=R,V[B++]=O,V[B++]=L,V[B++]=L,V[B++]=O,V[B++]=_,S+=3,I-=3;for(Q=n.geodeticSurfaceNormal(h.fromArray(G,g,YA),YA),W=n.geodeticSurfaceNormal(h.fromArray(q,g,Iw),Iw),C=h.normalize(h.add(Q,W,C),C),k+=3,d=0;d<r.length;d++){let J,Z=r[d],ae=Z.leftPositions,Ae=Z.rightPositions,fe,xe,ge=hCe,we=xG,Se=TG;if(C=h.fromArray(a,k,C),l(ae)){for(Rm(v,C,w,void 0,I,t),I-=3,fe=_,xe=L,J=0;J<ae.length/3;J++)ge=h.fromArray(ae,J*3,ge),V[B++]=fe,V[B++]=xe-J-1,V[B++]=xe-J,mr.addAttribute(b,ge,void 0,I),we=h.fromArray(b,(xe-J-1)*3,we),Se=h.fromArray(b,fe*3,Se),w=h.normalize(h.subtract(we,Se,w),w),Rm(v,C,w,void 0,I,t),I-=3;ge=h.fromArray(b,fe*3,ge),we=h.subtract(h.fromArray(b,xe*3,we),ge,we),Se=h.subtract(h.fromArray(b,(xe-J)*3,Se),ge,Se),w=h.normalize(h.add(we,Se,w),w),Rm(v,C,w,S,void 0,t),S+=3}else{for(Rm(v,C,w,S,void 0,t),S+=3,fe=L,xe=_,J=0;J<Ae.length/3;J++)ge=h.fromArray(Ae,J*3,ge),V[B++]=fe,V[B++]=xe+J,V[B++]=xe+J+1,mr.addAttribute(b,ge,S),we=h.fromArray(b,fe*3,we),Se=h.fromArray(b,(xe+J)*3,Se),w=h.normalize(h.subtract(we,Se,w),w),Rm(v,C,w,S,void 0,t),S+=3;ge=h.fromArray(b,fe*3,ge),we=h.subtract(h.fromArray(b,(xe+J)*3,we),ge,we),Se=h.subtract(h.fromArray(b,xe*3,Se),ge,Se),w=h.normalize(h.negate(h.add(Se,we,w),w),w),Rm(v,C,w,void 0,I,t),I-=3}for(G=i[j++],q=i[j++],G.splice(0,3),q.splice(q.length-3,3),b.set(G,S),b.set(q,I-q.length+1),g=q.length-3,k+=3,w=h.fromArray(s,k,w),J=0;J<q.length;J+=3)Q=n.geodeticSurfaceNormal(h.fromArray(G,J,YA),YA),W=n.geodeticSurfaceNormal(h.fromArray(q,g-J,Iw),Iw),C=h.normalize(h.add(Q,W,C),C),Rm(v,C,w,S,I,t),_=S/3,O=_-1,L=(I-2)/3,R=L+1,V[B++]=R,V[B++]=O,V[B++]=L,V[B++]=L,V[B++]=O,V[B++]=_,S+=3,I-=3;S-=3,I+=3}if(C=h.fromArray(a,a.length-3,C),Rm(v,C,w,S,I,t),m){S+=3,I-=3,M=xG,P=TG;let J=o[1];for(d=0;d<F;d++)M=h.fromArray(J,(y-d-1)*3,M),P=h.fromArray(J,d*3,P),mr.addAttribute(b,M,void 0,I),mr.addAttribute(b,P,S),Rm(v,C,w,S,I,t),_=S/3,O=_-1,L=(I-2)/3,R=L+1,V[B++]=R,V[B++]=O,V[B++]=L,V[B++]=L,V[B++]=O,V[B++]=_,S+=3,I-=3}if(c.position=new Ne({componentDatatype:Y.DOUBLE,componentsPerAttribute:3,values:b}),t.st){let J=new Float32Array(A/3*2),Z,ae,Ae=0;if(m){u/=3,f/=3;let fe=Math.PI/(y+1);ae=1/(u-y+1),Z=1/(f-y+1);let xe,ge=y/2;for(d=ge+1;d<y+1;d++)xe=D.PI_OVER_TWO+fe*d,J[Ae++]=Z*(1+Math.cos(xe)),J[Ae++]=.5*(1+Math.sin(xe));for(d=1;d<f-y+1;d++)J[Ae++]=d*Z,J[Ae++]=0;for(d=y;d>ge;d--)xe=D.PI_OVER_TWO-d*fe,J[Ae++]=1-Z*(1+Math.cos(xe)),J[Ae++]=.5*(1+Math.sin(xe));for(d=ge;d>0;d--)xe=D.PI_OVER_TWO-fe*d,J[Ae++]=1-ae*(1+Math.cos(xe)),J[Ae++]=.5*(1+Math.sin(xe));for(d=u-y;d>0;d--)J[Ae++]=d*ae,J[Ae++]=1;for(d=1;d<ge+1;d++)xe=D.PI_OVER_TWO+fe*d,J[Ae++]=ae*(1+Math.cos(xe)),J[Ae++]=.5*(1+Math.sin(xe))}else{for(u/=3,f/=3,ae=1/(u-1),Z=1/(f-1),d=0;d<f;d++)J[Ae++]=d*Z,J[Ae++]=0;for(d=u;d>0;d--)J[Ae++]=(d-1)*ae,J[Ae++]=1}c.st=new Ne({componentDatatype:Y.FLOAT,componentsPerAttribute:2,values:J})}return t.normal&&(c.normal=new Ne({componentDatatype:Y.FLOAT,componentsPerAttribute:3,values:v.normals})),t.tangent&&(c.tangent=new Ne({componentDatatype:Y.FLOAT,componentsPerAttribute:3,values:v.tangents})),t.bitangent&&(c.bitangent=new Ne({componentDatatype:Y.FLOAT,componentsPerAttribute:3,values:v.bitangents})),{attributes:c,indices:V}}function j0t(e,t){if(!t.normal&&!t.tangent&&!t.bitangent&&!t.st)return e;let n=e.position.values,i,r;(t.normal||t.bitangent)&&(i=e.normal.values,r=e.bitangent.values);let o=e.position.values.length/18,s=o*3,a=o*2,c=s*2,u;if(t.normal||t.bitangent||t.tangent){let f=t.normal?new Float32Array(s*6):void 0,d=t.tangent?new Float32Array(s*6):void 0,p=t.bitangent?new Float32Array(s*6):void 0,g=fCe,m=dCe,y=xG,A=TG,b=V0t,x=hCe,T=c;for(u=0;u<s;u+=3){let E=T+c;g=h.fromArray(n,u,g),m=h.fromArray(n,u+s,m),y=h.fromArray(n,(u+3)%s,y),m=h.subtract(m,g,m),y=h.subtract(y,g,y),A=h.normalize(h.cross(m,y,A),A),t.normal&&(mr.addAttribute(f,A,E),mr.addAttribute(f,A,E+3),mr.addAttribute(f,A,T),mr.addAttribute(f,A,T+3)),(t.tangent||t.bitangent)&&(x=h.fromArray(i,u,x),t.bitangent&&(mr.addAttribute(p,x,E),mr.addAttribute(p,x,E+3),mr.addAttribute(p,x,T),mr.addAttribute(p,x,T+3)),t.tangent&&(b=h.normalize(h.cross(x,A,b),b),mr.addAttribute(d,b,E),mr.addAttribute(d,b,E+3),mr.addAttribute(d,b,T),mr.addAttribute(d,b,T+3))),T+=6}if(t.normal){for(f.set(i),u=0;u<s;u+=3)f[u+s]=-i[u],f[u+s+1]=-i[u+1],f[u+s+2]=-i[u+2];e.normal.values=f}else e.normal=void 0;if(t.bitangent?(p.set(r),p.set(r,s),e.bitangent.values=p):e.bitangent=void 0,t.tangent){let E=e.tangent.values;d.set(E),d.set(E,s),e.tangent.values=d}}if(t.st){let f=e.st.values,d=new Float32Array(a*6);d.set(f),d.set(f,a);let p=a*2;for(let g=0;g<2;g++){for(d[p++]=f[0],d[p++]=f[1],u=2;u<a;u+=2){let m=f[u],y=f[u+1];d[p++]=m,d[p++]=y,d[p++]=m,d[p++]=y}d[p++]=f[0],d[p++]=f[1]}e.st.values=d}return e}function Aee(e,t,n){n[t++]=e[0],n[t++]=e[1],n[t++]=e[2];for(let i=3;i<e.length;i+=3){let r=e[i],o=e[i+1],s=e[i+2];n[t++]=r,n[t++]=o,n[t++]=s,n[t++]=r,n[t++]=o,n[t++]=s}return n[t++]=e[0],n[t++]=e[1],n[t]=e[2],n}function H0t(e,t){let n=new Be({position:t.position,normal:t.normal||t.bitangent||e.shadowVolume,tangent:t.tangent,bitangent:t.normal||t.bitangent,st:t.st}),i=e.ellipsoid,r=mr.computePositions(e),o=pCe(r,n,i),s=e.height,a=e.extrudedHeight,c=o.attributes,u=o.indices,f=c.position.values,d=f.length,p=new Float64Array(d*6),g=new Float64Array(d);g.set(f);let m=new Float64Array(d*4);f=fi.scaleToGeodeticHeight(f,s,i),m=Aee(f,0,m),g=fi.scaleToGeodeticHeight(g,a,i),m=Aee(g,d*2,m),p.set(f),p.set(g,d),p.set(m,d*2),c.position.values=p,c=j0t(c,t);let y,A=d/3;if(e.shadowVolume){let O=c.normal.values;d=O.length;let L=new Float32Array(d*6);for(y=0;y<d;y++)O[y]=-O[y];L.set(O,d),L=Aee(O,d*4,L),c.extrudeDirection=new Ne({componentDatatype:Y.FLOAT,componentsPerAttribute:3,values:L}),t.normal||(c.normal=void 0)}if(l(e.offsetAttribute)){let O=new Uint8Array(A*6);if(e.offsetAttribute===mn.TOP)O=O.fill(1,0,A).fill(1,A*2,A*4);else{let L=e.offsetAttribute===mn.NONE?0:1;O=O.fill(L)}c.applyOffset=new Ne({componentDatatype:Y.UNSIGNED_BYTE,componentsPerAttribute:1,values:O})}let b=u.length,x=A+A,T=je.createTypedArray(p.length/3,b*2+x*3);T.set(u);let E=b;for(y=0;y<b;y+=3){let O=u[y],L=u[y+1],_=u[y+2];T[E++]=_+A,T[E++]=L+A,T[E++]=O+A}let v,S,I,R;for(y=0;y<x;y+=2)v=y+x,S=v+x,I=v+1,R=S+1,T[E++]=v,T[E++]=S,T[E++]=I,T[E++]=I,T[E++]=S,T[E++]=R;return{attributes:c,indices:T}}var lCe=new h,Ik=new h,ah=new he;function uCe(e,t,n,i,r,o){let s=h.subtract(t,e,lCe);h.normalize(s,s);let a=n.geodeticSurfaceNormal(e,Ik),c=h.cross(s,a,lCe);h.multiplyByScalar(c,i,c);let u=r.latitude,f=r.longitude,d=o.latitude,p=o.longitude;h.add(e,c,Ik),n.cartesianToCartographic(Ik,ah);let g=ah.latitude,m=ah.longitude;u=Math.min(u,g),f=Math.min(f,m),d=Math.max(d,g),p=Math.max(p,m),h.subtract(e,c,Ik),n.cartesianToCartographic(Ik,ah),g=ah.latitude,m=ah.longitude,u=Math.min(u,g),f=Math.min(f,m),d=Math.max(d,g),p=Math.max(p,m),r.latitude=u,r.longitude=f,o.latitude=d,o.longitude=p}var sh=new h,Pk=new h,Zu=new he,Qu=new he;function gCe(e,t,n,i,r){e=mCe(e,t);let o=Fr(e,h.equalsEpsilon),s=o.length;if(s<2||n<=0)return new ie;let a=n*.5;Zu.latitude=Number.POSITIVE_INFINITY,Zu.longitude=Number.POSITIVE_INFINITY,Qu.latitude=Number.NEGATIVE_INFINITY,Qu.longitude=Number.NEGATIVE_INFINITY;let c,u;if(i===rr.ROUNDED){let p=o[0];h.subtract(p,o[1],sh),h.normalize(sh,sh),h.multiplyByScalar(sh,a,sh),h.add(p,sh,Pk),t.cartesianToCartographic(Pk,ah),c=ah.latitude,u=ah.longitude,Zu.latitude=Math.min(Zu.latitude,c),Zu.longitude=Math.min(Zu.longitude,u),Qu.latitude=Math.max(Qu.latitude,c),Qu.longitude=Math.max(Qu.longitude,u)}for(let p=0;p<s-1;++p)uCe(o[p],o[p+1],t,a,Zu,Qu);let f=o[s-1];h.subtract(f,o[s-2],sh),h.normalize(sh,sh),h.multiplyByScalar(sh,a,sh),h.add(f,sh,Pk),uCe(f,Pk,t,a,Zu,Qu),i===rr.ROUNDED&&(t.cartesianToCartographic(Pk,ah),c=ah.latitude,u=ah.longitude,Zu.latitude=Math.min(Zu.latitude,c),Zu.longitude=Math.min(Zu.longitude,u),Qu.latitude=Math.max(Qu.latitude,c),Qu.longitude=Math.max(Qu.longitude,u));let d=l(r)?r:new ie;return d.north=Qu.latitude,d.south=Zu.latitude,d.east=Qu.longitude,d.west=Zu.longitude,d}function S_(e){e=e??H.EMPTY_OBJECT;let t=e.positions,n=e.width,i=e.height??0,r=e.extrudedHeight??i;this._positions=t,this._ellipsoid=ee.clone(e.ellipsoid??ee.default),this._vertexFormat=Be.clone(e.vertexFormat??Be.DEFAULT),this._width=n,this._height=Math.max(i,r),this._extrudedHeight=Math.min(i,r),this._cornerType=e.cornerType??rr.ROUNDED,this._granularity=e.granularity??D.RADIANS_PER_DEGREE,this._shadowVolume=e.shadowVolume??!1,this._workerName="createCorridorGeometry",this._offsetAttribute=e.offsetAttribute,this._rectangle=void 0,this.packedLength=1+t.length*h.packedLength+ee.packedLength+Be.packedLength+7}S_.pack=function(e,t,n){n=n??0;let i=e._positions,r=i.length;t[n++]=r;for(let o=0;o<r;++o,n+=h.packedLength)h.pack(i[o],t,n);return ee.pack(e._ellipsoid,t,n),n+=ee.packedLength,Be.pack(e._vertexFormat,t,n),n+=Be.packedLength,t[n++]=e._width,t[n++]=e._height,t[n++]=e._extrudedHeight,t[n++]=e._cornerType,t[n++]=e._granularity,t[n++]=e._shadowVolume?1:0,t[n]=e._offsetAttribute??-1,t};var _Ce=ee.clone(ee.UNIT_SPHERE),yCe=new Be,v_={positions:void 0,ellipsoid:_Ce,vertexFormat:yCe,width:void 0,height:void 0,extrudedHeight:void 0,cornerType:void 0,granularity:void 0,shadowVolume:void 0,offsetAttribute:void 0};S_.unpack=function(e,t,n){t=t??0;let i=e[t++],r=new Array(i);for(let m=0;m<i;++m,t+=h.packedLength)r[m]=h.unpack(e,t);let o=ee.unpack(e,t,_Ce);t+=ee.packedLength;let s=Be.unpack(e,t,yCe);t+=Be.packedLength;let a=e[t++],c=e[t++],u=e[t++],f=e[t++],d=e[t++],p=e[t++]===1,g=e[t];return l(n)?(n._positions=r,n._ellipsoid=ee.clone(o,n._ellipsoid),n._vertexFormat=Be.clone(s,n._vertexFormat),n._width=a,n._height=c,n._extrudedHeight=u,n._cornerType=f,n._granularity=d,n._shadowVolume=p,n._offsetAttribute=g===-1?void 0:g,n):(v_.positions=r,v_.width=a,v_.height=c,v_.extrudedHeight=u,v_.cornerType=f,v_.granularity=d,v_.shadowVolume=p,v_.offsetAttribute=g===-1?void 0:g,new S_(v_))};S_.computeRectangle=function(e,t){e=e??H.EMPTY_OBJECT;let n=e.positions,i=e.width,r=e.ellipsoid??ee.default,o=e.cornerType??rr.ROUNDED;return gCe(n,r,i,o,t)};S_.createGeometry=function(e){let t=e._positions,n=e._width,i=e._ellipsoid;t=mCe(t,i);let r=Fr(t,h.equalsEpsilon);if(r.length<2||n<=0)return;let o=e._height,s=e._extrudedHeight,a=!D.equalsEpsilon(o,s,0,D.EPSILON2),c=e._vertexFormat,u={ellipsoid:i,positions:r,width:n,cornerType:e._cornerType,granularity:e._granularity,saveAttributes:!0},f;if(a)u.height=o,u.extrudedHeight=s,u.shadowVolume=e._shadowVolume,u.offsetAttribute=e._offsetAttribute,f=H0t(u,c);else{let g=mr.computePositions(u);if(f=pCe(g,c,i),f.attributes.position.values=fi.scaleToGeodeticHeight(f.attributes.position.values,o,i),l(e._offsetAttribute)){let m=e._offsetAttribute===mn.NONE?0:1,y=f.attributes.position.values.length,A=new Uint8Array(y/3).fill(m);f.attributes.applyOffset=new Ne({componentDatatype:Y.UNSIGNED_BYTE,componentsPerAttribute:1,values:A})}}let d=f.attributes,p=ue.fromVertices(d.position.values,void 0,3);return c.position||(f.attributes.position.values=void 0),new St({attributes:d,indices:f.indices,primitiveType:Oe.TRIANGLES,boundingSphere:p,offsetAttribute:e._offsetAttribute})};S_.createShadowVolume=function(e,t,n){let i=e._granularity,r=e._ellipsoid,o=t(i,r),s=n(i,r);return new S_({positions:e._positions,width:e._width,cornerType:e._cornerType,ellipsoid:r,granularity:i,extrudedHeight:o,height:s,vertexFormat:Be.POSITION_ONLY,shadowVolume:!0})};Object.defineProperties(S_.prototype,{rectangle:{get:function(){return l(this._rectangle)||(this._rectangle=gCe(this._positions,this._ellipsoid,this._width,this._cornerType)),this._rectangle}},textureCoordinateRotationPoints:{get:function(){return[0,0,0,1,1,0]}}});var tE=S_;var ACe=new h,bCe=new h,G0t=new h;function W0t(e,t){for(let n=0;n<e.length;n++)e[n]=t.scaleToGeodeticSurface(e[n],e[n]);return e}function xCe(e,t){let n=[],i=e.positions,r=e.corners,o=e.endPositions,s=new Tn,a,c=0,u=0,f,d=0,p;for(f=0;f<i.length;f+=2)p=i[f].length-3,c+=p,d+=p/3*4,u+=i[f+1].length-3;for(c+=3,u+=3,f=0;f<r.length;f++){let M=r[f].leftPositions;l(M)?(p=M.length,c+=p,d+=p/3*2):(p=r[f].rightPositions.length,u+=p,d+=p/3*2)}let g=l(o),m;g&&(m=o[0].length-3,c+=m,u+=m,m/=3,d+=m*4);let y=c+u,A=new Float64Array(y),b=0,x=y-1,T,E,v,S,I,R,O=m/2,L=je.createTypedArray(y/3,d+4),_=0;if(L[_++]=b/3,L[_++]=(x-2)/3,g){n.push(b/3),R=ACe,I=bCe;let M=o[0];for(f=0;f<O;f++)R=h.fromArray(M,(O-1-f)*3,R),I=h.fromArray(M,(O+f)*3,I),mr.addAttribute(A,I,b),mr.addAttribute(A,R,void 0,x),E=b/3,S=E+1,T=(x-2)/3,v=T-1,L[_++]=T,L[_++]=v,L[_++]=E,L[_++]=S,b+=3,x-=3}let C=0,w=i[C++],P=i[C++];for(A.set(w,b),A.set(P,x-P.length+1),p=P.length-3,n.push(b/3,(x-2)/3),f=0;f<p;f+=3)E=b/3,S=E+1,T=(x-2)/3,v=T-1,L[_++]=T,L[_++]=v,L[_++]=E,L[_++]=S,b+=3,x-=3;for(f=0;f<r.length;f++){let M;a=r[f];let F=a.leftPositions,V=a.rightPositions,B,j=G0t;if(l(F)){for(x-=3,B=v,n.push(S),M=0;M<F.length/3;M++)j=h.fromArray(F,M*3,j),L[_++]=B-M-1,L[_++]=B-M,mr.addAttribute(A,j,void 0,x),x-=3;n.push(B-Math.floor(F.length/6)),t===rr.BEVELED&&n.push((x-2)/3+1),b+=3}else{for(b+=3,B=S,n.push(v),M=0;M<V.length/3;M++)j=h.fromArray(V,M*3,j),L[_++]=B+M,L[_++]=B+M+1,mr.addAttribute(A,j,b),b+=3;n.push(B+Math.floor(V.length/6)),t===rr.BEVELED&&n.push(b/3-1),x-=3}for(w=i[C++],P=i[C++],w.splice(0,3),P.splice(P.length-3,3),A.set(w,b),A.set(P,x-P.length+1),M=0;M<P.length;M+=3)S=b/3,E=S-1,v=(x-2)/3,T=v+1,L[_++]=T,L[_++]=v,L[_++]=E,L[_++]=S,b+=3,x-=3;b-=3,x+=3,n.push(b/3,(x-2)/3)}if(g){b+=3,x-=3,R=ACe,I=bCe;let M=o[1];for(f=0;f<O;f++)R=h.fromArray(M,(m-f-1)*3,R),I=h.fromArray(M,f*3,I),mr.addAttribute(A,R,void 0,x),mr.addAttribute(A,I,b),S=b/3,E=S-1,v=(x-2)/3,T=v+1,L[_++]=T,L[_++]=v,L[_++]=E,L[_++]=S,b+=3,x-=3;n.push(b/3)}else n.push(b/3,(x-2)/3);return L[_++]=b/3,L[_]=(x-2)/3,s.position=new Ne({componentDatatype:Y.DOUBLE,componentsPerAttribute:3,values:A}),{attributes:s,indices:L,wallIndices:n}}function q0t(e){let t=e.ellipsoid,n=mr.computePositions(e),i=xCe(n,e.cornerType),r=i.wallIndices,o=e.height,s=e.extrudedHeight,a=i.attributes,c=i.indices,u=a.position.values,f=u.length,d=new Float64Array(f);d.set(u);let p=new Float64Array(f*2);if(u=fi.scaleToGeodeticHeight(u,o,t),d=fi.scaleToGeodeticHeight(d,s,t),p.set(u),p.set(d,f),a.position.values=p,f/=3,l(e.offsetAttribute)){let T=new Uint8Array(f*2);if(e.offsetAttribute===mn.TOP)T=T.fill(1,0,f);else{let E=e.offsetAttribute===mn.NONE?0:1;T=T.fill(E)}a.applyOffset=new Ne({componentDatatype:Y.UNSIGNED_BYTE,componentsPerAttribute:1,values:T})}let g,m=c.length,y=je.createTypedArray(p.length/3,(m+r.length)*2);y.set(c);let A=m;for(g=0;g<m;g+=2){let T=c[g],E=c[g+1];y[A++]=T+f,y[A++]=E+f}let b,x;for(g=0;g<r.length;g++)b=r[g],x=b+f,y[A++]=b,y[A++]=x;return{attributes:a,indices:y}}function Dk(e){e=e??H.EMPTY_OBJECT;let t=e.positions,n=e.width,i=e.height??0,r=e.extrudedHeight??i;this._positions=t,this._ellipsoid=ee.clone(e.ellipsoid??ee.default),this._width=n,this._height=Math.max(i,r),this._extrudedHeight=Math.min(i,r),this._cornerType=e.cornerType??rr.ROUNDED,this._granularity=e.granularity??D.RADIANS_PER_DEGREE,this._offsetAttribute=e.offsetAttribute,this._workerName="createCorridorOutlineGeometry",this.packedLength=1+t.length*h.packedLength+ee.packedLength+6}Dk.pack=function(e,t,n){n=n??0;let i=e._positions,r=i.length;t[n++]=r;for(let o=0;o<r;++o,n+=h.packedLength)h.pack(i[o],t,n);return ee.pack(e._ellipsoid,t,n),n+=ee.packedLength,t[n++]=e._width,t[n++]=e._height,t[n++]=e._extrudedHeight,t[n++]=e._cornerType,t[n++]=e._granularity,t[n]=e._offsetAttribute??-1,t};var TCe=ee.clone(ee.UNIT_SPHERE),XA={positions:void 0,ellipsoid:TCe,width:void 0,height:void 0,extrudedHeight:void 0,cornerType:void 0,granularity:void 0,offsetAttribute:void 0};Dk.unpack=function(e,t,n){t=t??0;let i=e[t++],r=new Array(i);for(let p=0;p<i;++p,t+=h.packedLength)r[p]=h.unpack(e,t);let o=ee.unpack(e,t,TCe);t+=ee.packedLength;let s=e[t++],a=e[t++],c=e[t++],u=e[t++],f=e[t++],d=e[t];return l(n)?(n._positions=r,n._ellipsoid=ee.clone(o,n._ellipsoid),n._width=s,n._height=a,n._extrudedHeight=c,n._cornerType=u,n._granularity=f,n._offsetAttribute=d===-1?void 0:d,n):(XA.positions=r,XA.width=s,XA.height=a,XA.extrudedHeight=c,XA.cornerType=u,XA.granularity=f,XA.offsetAttribute=d===-1?void 0:d,new Dk(XA))};Dk.createGeometry=function(e){let t=e._positions,n=e._width,i=e._ellipsoid;t=W0t(t,i);let r=Fr(t,h.equalsEpsilon);if(r.length<2||n<=0)return;let o=e._height,s=e._extrudedHeight,a=!D.equalsEpsilon(o,s,0,D.EPSILON2),c={ellipsoid:i,positions:r,width:n,cornerType:e._cornerType,granularity:e._granularity,saveAttributes:!1},u;if(a)c.height=o,c.extrudedHeight=s,c.offsetAttribute=e._offsetAttribute,u=q0t(c);else{let p=mr.computePositions(c);if(u=xCe(p,c.cornerType),u.attributes.position.values=fi.scaleToGeodeticHeight(u.attributes.position.values,o,i),l(e._offsetAttribute)){let g=u.attributes.position.values.length,m=e._offsetAttribute===mn.NONE?0:1,y=new Uint8Array(g/3).fill(m);u.attributes.applyOffset=new Ne({componentDatatype:Y.UNSIGNED_BYTE,componentsPerAttribute:1,values:y})}}let f=u.attributes,d=ue.fromVertices(f.position.values,void 0,3);return new St({attributes:f,indices:u.indices,primitiveType:Oe.LINES,boundingSphere:d,offsetAttribute:e._offsetAttribute})};var Rk=Dk;var Y0t=new ui(0);function uu(e){Pi.call(this,e),this._zIndex=0,this._terrainOffsetProperty=void 0}l(Object.create)&&(uu.prototype=Object.create(Pi.prototype),uu.prototype.constructor=uu);Object.defineProperties(uu.prototype,{zIndex:{get:function(){return this._zIndex}},terrainOffsetProperty:{get:function(){return this._terrainOffsetProperty}}});uu.prototype._isOnTerrain=function(e,t){return this._fillEnabled&&!l(t.height)&&!l(t.extrudedHeight)&&ql.isSupported(this._scene)};uu.prototype._getIsClosed=function(e){let t=e.height,n=e.extrudedHeight;return t===0||l(n)&&n!==t};uu.prototype._computeCenter=pe.throwInstantiationError;uu.prototype._onEntityPropertyChanged=function(e,t,n,i){if(Pi.prototype._onEntityPropertyChanged.call(this,e,t,n,i),this._observedPropertyNames.indexOf(t)===-1)return;let r=this._entity[this._geometryPropertyName];if(!l(r))return;l(r.zIndex)&&(l(r.height)||l(r.extrudedHeight))&&_t(_t.geometryZIndex),this._zIndex=r.zIndex??Y0t,l(this._terrainOffsetProperty)&&(this._terrainOffsetProperty.destroy(),this._terrainOffsetProperty=void 0);let o=r.heightReference,s=r.extrudedHeightReference;if(l(o)||l(s)){let a=new nm(this._computeCenter.bind(this),!this._dynamic);this._terrainOffsetProperty=new Gx(this._scene,a,o,s)}};uu.prototype.destroy=function(){l(this._terrainOffsetProperty)&&(this._terrainOffsetProperty.destroy(),this._terrainOffsetProperty=void 0),Pi.prototype.destroy.call(this)};uu.getGeometryHeight=function(e,t){if(!l(e)){t!==We.NONE&&_t(_t.geometryHeightReference);return}return As(t)?0:e};uu.getGeometryExtrudedHeight=function(e,t){if(!l(e)){t!==We.NONE&&_t(_t.geometryExtrudedHeightReference);return}return As(t)?uu.CLAMP_TO_GROUND:e};uu.CLAMP_TO_GROUND="clamp";uu.computeGeometryOffsetAttribute=function(e,t,n,i){(!l(e)||!l(t))&&(t=We.NONE),(!l(n)||!l(i))&&(i=We.NONE);let r=0;if(t!==We.NONE&&r++,i===We.RELATIVE_TO_GROUND&&r++,r===2)return mn.ALL;if(r===1)return mn.TOP};var ii=uu;var ECe=new z,CCe=h.ZERO,vCe=new h,SCe=new ie;function X0t(e){this.id=e,this.vertexFormat=void 0,this.positions=void 0,this.width=void 0,this.cornerType=void 0,this.height=void 0,this.extrudedHeight=void 0,this.granularity=void 0,this.offsetAttribute=void 0}function Om(e,t){ii.call(this,{entity:e,scene:t,geometryOptions:new X0t(e),geometryPropertyName:"corridor",observedPropertyNames:["availability","corridor"]}),this._onEntityPropertyChanged(e,"corridor",e.corridor,void 0)}l(Object.create)&&(Om.prototype=Object.create(ii.prototype),Om.prototype.constructor=Om);Om.prototype.createFillGeometryInstance=function(e){let t=this._entity,n=t.isAvailable(e),i={show:new Pn(n&&t.isShowing&&this._showProperty.getValue(e)&&this._fillProperty.getValue(e)),distanceDisplayCondition:Qn.fromDistanceDisplayCondition(this._distanceDisplayConditionProperty.getValue(e)),offset:void 0,color:void 0};if(this._materialProperty instanceof Kt){let r;l(this._materialProperty.color)&&(this._materialProperty.color.isConstant||n)&&(r=this._materialProperty.color.getValue(e,ECe)),l(r)||(r=z.WHITE),i.color=Jt.fromColor(r)}return l(this._options.offsetAttribute)&&(i.offset=Tr.fromCartesian3(X.getValueOrDefault(this._terrainOffsetProperty,e,CCe,vCe))),new Ft({id:t,geometry:new tE(this._options),attributes:i})};Om.prototype.createOutlineGeometryInstance=function(e){let t=this._entity,n=t.isAvailable(e),i=X.getValueOrDefault(this._outlineColorProperty,e,z.BLACK,ECe),r={show:new Pn(n&&t.isShowing&&this._showProperty.getValue(e)&&this._showOutlineProperty.getValue(e)),color:Jt.fromColor(i),distanceDisplayCondition:Qn.fromDistanceDisplayCondition(this._distanceDisplayConditionProperty.getValue(e)),offset:void 0};return l(this._options.offsetAttribute)&&(r.offset=Tr.fromCartesian3(X.getValueOrDefault(this._terrainOffsetProperty,e,CCe,vCe))),new Ft({id:t,geometry:new Rk(this._options),attributes:r})};Om.prototype._computeCenter=function(e,t){let n=X.getValueOrUndefined(this._entity.corridor.positions,e);if(!(!l(n)||n.length===0))return h.clone(n[Math.floor(n.length/2)],t)};Om.prototype._isHidden=function(e,t){return!l(t.positions)||!l(t.width)||Pi.prototype._isHidden.call(this,e,t)};Om.prototype._isDynamic=function(e,t){return!t.positions.isConstant||!X.isConstant(t.height)||!X.isConstant(t.extrudedHeight)||!X.isConstant(t.granularity)||!X.isConstant(t.width)||!X.isConstant(t.outlineWidth)||!X.isConstant(t.cornerType)||!X.isConstant(t.zIndex)||this._onTerrain&&!X.isConstant(this._materialProperty)&&!(this._materialProperty instanceof Kt)};Om.prototype._setStaticOptions=function(e,t){let n=X.getValueOrUndefined(t.height,nt.MINIMUM_VALUE),i=X.getValueOrDefault(t.heightReference,nt.MINIMUM_VALUE,We.NONE),r=X.getValueOrUndefined(t.extrudedHeight,nt.MINIMUM_VALUE),o=X.getValueOrDefault(t.extrudedHeightReference,nt.MINIMUM_VALUE,We.NONE);l(r)&&!l(n)&&(n=0);let s=this._options;s.vertexFormat=this._materialProperty instanceof Kt?yn.VERTEX_FORMAT:Er.MaterialSupport.TEXTURED.vertexFormat,s.positions=t.positions.getValue(nt.MINIMUM_VALUE,s.positions),s.width=t.width.getValue(nt.MINIMUM_VALUE),s.granularity=X.getValueOrUndefined(t.granularity,nt.MINIMUM_VALUE),s.cornerType=X.getValueOrUndefined(t.cornerType,nt.MINIMUM_VALUE),s.offsetAttribute=ii.computeGeometryOffsetAttribute(n,i,r,o),s.height=ii.getGeometryHeight(n,i),r=ii.getGeometryExtrudedHeight(r,o),r===ii.CLAMP_TO_GROUND&&(r=Mi.getMinimumMaximumHeights(tE.computeRectangle(s,SCe)).minimumTerrainHeight),s.extrudedHeight=r};Om.DynamicGeometryUpdater=Pw;function Pw(e,t,n){Ii.call(this,e,t,n)}l(Object.create)&&(Pw.prototype=Object.create(Ii.prototype),Pw.prototype.constructor=Pw);Pw.prototype._isHidden=function(e,t,n){let i=this._options;return!l(i.positions)||!l(i.width)||Ii.prototype._isHidden.call(this,e,t,n)};Pw.prototype._setOptions=function(e,t,n){let i=this._options,r=X.getValueOrUndefined(t.height,n),o=X.getValueOrDefault(t.heightReference,n,We.NONE),s=X.getValueOrUndefined(t.extrudedHeight,n),a=X.getValueOrDefault(t.extrudedHeightReference,n,We.NONE);l(s)&&!l(r)&&(r=0),i.positions=X.getValueOrUndefined(t.positions,n),i.width=X.getValueOrUndefined(t.width,n),i.granularity=X.getValueOrUndefined(t.granularity,n),i.cornerType=X.getValueOrUndefined(t.cornerType,n),i.offsetAttribute=ii.computeGeometryOffsetAttribute(r,o,s,a),i.height=ii.getGeometryHeight(r,o),s=ii.getGeometryExtrudedHeight(s,a),s===ii.CLAMP_TO_GROUND&&(s=Mi.getMinimumMaximumHeights(tE.computeRectangle(i,SCe)).minimumTerrainHeight),i.extrudedHeight=s};var Ok=Om;function EG(){pe.throwInstantiationError()}Object.defineProperties(EG.prototype,{name:{get:pe.throwInstantiationError},clock:{get:pe.throwInstantiationError},entities:{get:pe.throwInstantiationError},isLoading:{get:pe.throwInstantiationError},changedEvent:{get:pe.throwInstantiationError},errorEvent:{get:pe.throwInstantiationError},loadingEvent:{get:pe.throwInstantiationError},show:{get:pe.throwInstantiationError},clustering:{get:pe.throwInstantiationError}});EG.prototype.update=function(e){pe.throwInstantiationError()};EG.setLoading=function(e,t){e._isLoading!==t&&(t?e._entityCollection.suspendEvents():e._entityCollection.resumeEvents(),e._isLoading=t,e._loading.raiseEvent(e,t))};var Ds=EG;function s0(e,t){this._ellipsoid=e,this._cameraPosition=new h,this._cameraPositionInScaledSpace=new h,this._distanceToLimbInScaledSpaceSquared=0,l(t)&&(this.cameraPosition=t)}Object.defineProperties(s0.prototype,{ellipsoid:{get:function(){return this._ellipsoid}},cameraPosition:{get:function(){return this._cameraPosition},set:function(e){let n=this._ellipsoid.transformPositionToScaledSpace(e,this._cameraPositionInScaledSpace),i=h.magnitudeSquared(n)-1;h.clone(e,this._cameraPosition),this._cameraPositionInScaledSpace=n,this._distanceToLimbInScaledSpaceSquared=i}}});var wCe=new h;s0.prototype.isPointVisible=function(e){let n=this._ellipsoid.transformPositionToScaledSpace(e,wCe);return xee(n,this._cameraPositionInScaledSpace,this._distanceToLimbInScaledSpaceSquared)};s0.prototype.isScaledSpacePointVisible=function(e){return xee(e,this._cameraPositionInScaledSpace,this._distanceToLimbInScaledSpaceSquared)};var K0t=new h;s0.prototype.isScaledSpacePointVisiblePossiblyUnderEllipsoid=function(e,t){let n=this._ellipsoid,i,r;return l(t)&&t<0&&n.minimumRadius>-t?(r=K0t,r.x=this._cameraPosition.x/(n.radii.x+t),r.y=this._cameraPosition.y/(n.radii.y+t),r.z=this._cameraPosition.z/(n.radii.z+t),i=r.x*r.x+r.y*r.y+r.z*r.z-1):(r=this._cameraPositionInScaledSpace,i=this._distanceToLimbInScaledSpaceSquared),xee(e,r,i)};s0.prototype.computeHorizonCullingPoint=function(e,t,n){return DCe(this._ellipsoid,e,t,n)};var ICe=ee.clone(ee.UNIT_SPHERE);s0.prototype.computeHorizonCullingPointPossiblyUnderEllipsoid=function(e,t,n,i){let r=PCe(this._ellipsoid,n,ICe);return DCe(r,e,t,i)};s0.prototype.computeHorizonCullingPointFromVertices=function(e,t,n,i,r){return RCe(this._ellipsoid,e,t,n,i,r)};s0.prototype.computeHorizonCullingPointFromVerticesPossiblyUnderEllipsoid=function(e,t,n,i,r,o){let s=PCe(this._ellipsoid,r,ICe);return RCe(s,e,t,n,i,o)};var $0t=[];s0.prototype.computeHorizonCullingPointFromRectangle=function(e,t,n){let i=ie.subsample(e,t,0,$0t),r=ue.fromPoints(i);if(!(h.magnitude(r.center)<.1*t.minimumRadius))return this.computeHorizonCullingPoint(r.center,i,n)};var J0t=new h;function PCe(e,t,n){if(l(t)&&t<0&&e.minimumRadius>-t){let i=h.fromElements(e.radii.x+t,e.radii.y+t,e.radii.z+t,J0t);e=ee.fromCartesian3(i,n)}return e}function DCe(e,t,n,i){l(i)||(i=new h);let r=NCe(e,t),o=0;for(let s=0,a=n.length;s<a;++s){let c=n[s],u=OCe(e,c,r);if(u<0)return;o=Math.max(o,u)}return MCe(r,o,i)}var CG=new h;function RCe(e,t,n,i,r,o){l(o)||(o=new h),i=i??3,r=r??h.ZERO;let s=NCe(e,t),a=0;for(let c=0,u=n.length;c<u;c+=i){CG.x=n[c]+r.x,CG.y=n[c+1]+r.y,CG.z=n[c+2]+r.z;let f=OCe(e,CG,s);if(f<0)return;a=Math.max(a,f)}return MCe(s,a,o)}function xee(e,t,n){let i=t,r=n,o=h.subtract(e,i,wCe),s=-h.dot(o,i);return!(r<0?s>0:s>r&&s*s/h.magnitudeSquared(o)>r)}var Z0t=new h,Q0t=new h;function OCe(e,t,n){let i=e.transformPositionToScaledSpace(t,Z0t),r=h.magnitudeSquared(i),o=Math.sqrt(r),s=h.divideByScalar(i,o,Q0t);r=Math.max(1,r),o=Math.max(1,o);let a=h.dot(s,n),c=h.magnitude(h.cross(s,n,s)),u=1/o,f=Math.sqrt(r-1)*u;return 1/(a*u-c*f)}function MCe(e,t,n){if(!(t<=0||t===1/0||t!==t))return h.multiplyByScalar(e,t,n)}var bee=new h;function NCe(e,t){return h.equals(t,h.ZERO)?t:(e.transformPositionToScaledSpace(t,bee),h.normalize(bee,bee))}var Mm=s0;function ls(e,t){e=e??H.EMPTY_OBJECT;let n=e.translucencyByDistance,i=e.scaleByDistance,r=e.distanceDisplayCondition;l(n)&&(n=qt.clone(n)),l(i)&&(i=qt.clone(i)),l(r)&&(r=Ht.clone(r)),this._show=e.show??!0,this._position=h.clone(e.position??h.ZERO),this._actualPosition=h.clone(this._position),this._color=z.clone(e.color??z.WHITE),this._outlineColor=z.clone(e.outlineColor??z.TRANSPARENT),this._outlineWidth=e.outlineWidth??0,this._pixelSize=e.pixelSize??10,this._scaleByDistance=i,this._translucencyByDistance=n,this._distanceDisplayCondition=r,this._disableDepthTestDistance=e.disableDepthTestDistance??0,this._id=e.id,this._collection=e.collection??t,this._clusterShow=!0,this._pickId=void 0,this._pointPrimitiveCollection=t,this._dirty=!1,this._index=-1,this._splitDirection=e.splitDirection??jo.NONE}var LCe=ls.SHOW_INDEX=0,kCe=ls.POSITION_INDEX=1,egt=ls.COLOR_INDEX=2,tgt=ls.OUTLINE_COLOR_INDEX=3,ngt=ls.OUTLINE_WIDTH_INDEX=4,igt=ls.PIXEL_SIZE_INDEX=5,rgt=ls.SCALE_BY_DISTANCE_INDEX=6,ogt=ls.TRANSLUCENCY_BY_DISTANCE_INDEX=7,sgt=ls.DISTANCE_DISPLAY_CONDITION_INDEX=8,agt=ls.DISABLE_DEPTH_DISTANCE_INDEX=9,cgt=ls.SPLIT_DIRECTION_INDEX=10;ls.NUMBER_OF_PROPERTIES=11;function Kf(e,t){let n=e._pointPrimitiveCollection;l(n)&&(n._updatePointPrimitive(e,t),e._dirty=!0)}Object.defineProperties(ls.prototype,{show:{get:function(){return this._show},set:function(e){this._show!==e&&(this._show=e,Kf(this,LCe))}},position:{get:function(){return this._position},set:function(e){let t=this._position;h.equals(t,e)||(h.clone(e,t),h.clone(e,this._actualPosition),Kf(this,kCe))}},scaleByDistance:{get:function(){return this._scaleByDistance},set:function(e){let t=this._scaleByDistance;qt.equals(t,e)||(this._scaleByDistance=qt.clone(e,t),Kf(this,rgt))}},translucencyByDistance:{get:function(){return this._translucencyByDistance},set:function(e){let t=this._translucencyByDistance;qt.equals(t,e)||(this._translucencyByDistance=qt.clone(e,t),Kf(this,ogt))}},pixelSize:{get:function(){return this._pixelSize},set:function(e){this._pixelSize!==e&&(this._pixelSize=e,Kf(this,igt))}},color:{get:function(){return this._color},set:function(e){let t=this._color;z.equals(t,e)||(z.clone(e,t),Kf(this,egt))}},outlineColor:{get:function(){return this._outlineColor},set:function(e){let t=this._outlineColor;z.equals(t,e)||(z.clone(e,t),Kf(this,tgt))}},outlineWidth:{get:function(){return this._outlineWidth},set:function(e){this._outlineWidth!==e&&(this._outlineWidth=e,Kf(this,ngt))}},distanceDisplayCondition:{get:function(){return this._distanceDisplayCondition},set:function(e){Ht.equals(this._distanceDisplayCondition,e)||(this._distanceDisplayCondition=Ht.clone(e,this._distanceDisplayCondition),Kf(this,sgt))}},disableDepthTestDistance:{get:function(){return this._disableDepthTestDistance},set:function(e){this._disableDepthTestDistance!==e&&(this._disableDepthTestDistance=e,Kf(this,agt))}},id:{get:function(){return this._id},set:function(e){this._id=e,l(this._pickId)&&(this._pickId.object.id=e)}},pickId:{get:function(){return this._pickId}},clusterShow:{get:function(){return this._clusterShow},set:function(e){this._clusterShow!==e&&(this._clusterShow=e,Kf(this,LCe))}},splitDirection:{get:function(){return this._splitDirection},set:function(e){this._splitDirection!==e&&(this._splitDirection=e,Kf(this,cgt))}}});ls.prototype.getPickId=function(e){return l(this._pickId)||(this._pickId=e.createPickId({primitive:this,collection:this._collection,id:this._id})),this._pickId};ls.prototype._getActualPosition=function(){return this._actualPosition};ls.prototype._setActualPosition=function(e){h.clone(e,this._actualPosition),Kf(this,kCe)};var FCe=new se;ls._computeActualPosition=function(e,t,n){return t.mode===re.SCENE3D?e:(N.multiplyByPoint(n,e,FCe),dr.computeActualEllipsoidPosition(t,FCe))};var BCe=new se;ls._computeScreenSpacePosition=function(e,t,n,i){let r=N.multiplyByVector(e,se.fromElements(t.x,t.y,t.z,1,BCe),BCe);return dr.worldToWindowCoordinates(n,r,i)};ls.prototype.computeScreenSpacePosition=function(e,t){let n=this._pointPrimitiveCollection;l(t)||(t=new U);let i=n.modelMatrix,r=ls._computeScreenSpacePosition(i,this._actualPosition,e,t);if(l(r))return r.y=e.canvas.clientHeight-r.y,r};ls.getScreenSpaceBoundingBox=function(e,t,n){let i=e.pixelSize,r=i*.5,o=t.x-r,s=t.y-r,a=i,c=i;return l(n)||(n=new et),n.x=o,n.y=s,n.width=a,n.height=c,n};ls.prototype.equals=function(e){return this===e||l(e)&&this._id===e._id&&h.equals(this._position,e._position)&&z.equals(this._color,e._color)&&this._pixelSize===e._pixelSize&&this._outlineWidth===e._outlineWidth&&this._show===e._show&&z.equals(this._outlineColor,e._outlineColor)&&qt.equals(this._scaleByDistance,e._scaleByDistance)&&qt.equals(this._translucencyByDistance,e._translucencyByDistance)&&Ht.equals(this._distanceDisplayCondition,e._distanceDisplayCondition)&&this._disableDepthTestDistance===e._disableDepthTestDistance&&this._splitDirection===e._splitDirection};ls.prototype._destroy=function(){this._pickId=this._pickId&&this._pickId.destroy(),this._pointPrimitiveCollection=void 0};var Ia=ls;var lgt=Ia.SHOW_INDEX,Cee=Ia.POSITION_INDEX,UCe=Ia.COLOR_INDEX,ugt=Ia.OUTLINE_COLOR_INDEX,fgt=Ia.OUTLINE_WIDTH_INDEX,dgt=Ia.PIXEL_SIZE_INDEX,zCe=Ia.SCALE_BY_DISTANCE_INDEX,VCe=Ia.TRANSLUCENCY_BY_DISTANCE_INDEX,jCe=Ia.DISTANCE_DISPLAY_CONDITION_INDEX,hgt=Ia.DISABLE_DEPTH_DISTANCE_INDEX,mgt=Ia.SPLIT_DIRECTION_INDEX,vee=Ia.NUMBER_OF_PROPERTIES,yl={positionHighAndSize:0,positionLowAndOutline:1,compressedAttribute0:2,compressedAttribute1:3,scaleByDistance:4,distanceDisplayConditionAndDisableDepthAndSplitDirection:5};function ch(e){e=e??H.EMPTY_OBJECT,this._sp=void 0,this._spTranslucent=void 0,this._rsOpaque=void 0,this._rsTranslucent=void 0,this._vaf=void 0,this._pointPrimitives=[],this._pointPrimitivesToUpdate=[],this._pointPrimitivesToUpdateIndex=0,this._pointPrimitivesRemoved=!1,this._createVertexArray=!1,this._shaderScaleByDistance=!1,this._compiledShaderScaleByDistance=!1,this._shaderTranslucencyByDistance=!1,this._compiledShaderTranslucencyByDistance=!1,this._shaderDistanceDisplayCondition=!1,this._compiledShaderDistanceDisplayCondition=!1,this._shaderDisableDepthDistance=!1,this._compiledShaderDisableDepthDistance=!1,this._propertiesChanged=new Uint32Array(vee),this._maxPixelSize=1,this._baseVolume=new ue,this._baseVolumeWC=new ue,this._baseVolume2D=new ue,this._boundingVolume=new ue,this._boundingVolumeDirty=!1,this._colorCommands=[],this.show=e.show??!0,this.modelMatrix=N.clone(e.modelMatrix??N.IDENTITY),this._modelMatrix=N.clone(N.IDENTITY),this.debugShowBoundingVolume=e.debugShowBoundingVolume??!1,this.blendOption=e.blendOption??Fi.OPAQUE_AND_TRANSLUCENT,this._blendOption=void 0,this._mode=re.SCENE3D,this._maxTotalPointSize=1,this._buffersUsage=[Me.STATIC_DRAW,Me.STATIC_DRAW,Me.STATIC_DRAW,Me.STATIC_DRAW,Me.STATIC_DRAW,Me.STATIC_DRAW,Me.STATIC_DRAW,Me.STATIC_DRAW,Me.STATIC_DRAW];let t=this;this._uniforms={u_maxTotalPointSize:function(){return t._maxTotalPointSize}}}Object.defineProperties(ch.prototype,{length:{get:function(){return See(this),this._pointPrimitives.length}}});function HCe(e){let t=e.length;for(let n=0;n<t;++n)e[n]&&e[n]._destroy()}ch.prototype.add=function(e){let t=new Ia(e,this);return t._index=this._pointPrimitives.length,this._pointPrimitives.push(t),this._createVertexArray=!0,t};ch.prototype.remove=function(e){return this.contains(e)?(this._pointPrimitives[e._index]=null,this._pointPrimitivesRemoved=!0,this._createVertexArray=!0,e._destroy(),!0):!1};ch.prototype.removeAll=function(){HCe(this._pointPrimitives),this._pointPrimitives=[],this._pointPrimitivesToUpdate=[],this._pointPrimitivesToUpdateIndex=0,this._pointPrimitivesRemoved=!1,this._createVertexArray=!0};function See(e){if(e._pointPrimitivesRemoved){e._pointPrimitivesRemoved=!1;let t=[],n=e._pointPrimitives,i=n.length;for(let r=0,o=0;r<i;++r){let s=n[r];s&&(s._index=o++,t.push(s))}e._pointPrimitives=t}}ch.prototype._updatePointPrimitive=function(e,t){e._dirty||(this._pointPrimitivesToUpdate[this._pointPrimitivesToUpdateIndex++]=e),++this._propertiesChanged[t]};ch.prototype.contains=function(e){return l(e)&&e._pointPrimitiveCollection===this};ch.prototype.get=function(e){return See(this),this._pointPrimitives[e]};ch.prototype.computeNewBuffersUsage=function(){let e=this._buffersUsage,t=!1,n=this._propertiesChanged;for(let i=0;i<vee;++i){let r=n[i]===0?Me.STATIC_DRAW:Me.STREAM_DRAW;t=t||e[i]!==r,e[i]=r}return t};function pgt(e,t,n){return new mg(e,[{index:yl.positionHighAndSize,componentsPerAttribute:4,componentDatatype:Y.FLOAT,usage:n[Cee]},{index:yl.positionLowAndShow,componentsPerAttribute:4,componentDatatype:Y.FLOAT,usage:n[Cee]},{index:yl.compressedAttribute0,componentsPerAttribute:4,componentDatatype:Y.FLOAT,usage:n[UCe]},{index:yl.compressedAttribute1,componentsPerAttribute:4,componentDatatype:Y.FLOAT,usage:n[VCe]},{index:yl.scaleByDistance,componentsPerAttribute:4,componentDatatype:Y.FLOAT,usage:n[zCe]},{index:yl.distanceDisplayConditionAndDisableDepthAndSplitDirection,componentsPerAttribute:4,componentDatatype:Y.FLOAT,usage:n[jCe]}],t)}var Tee=new Sn,vG=new z;function GCe(e,t,n,i){let r=i._index,o=i._getActualPosition();e._mode===re.SCENE3D&&(ue.expand(e._baseVolume,o,e._baseVolume),e._boundingVolumeDirty=!0),Sn.fromCartesian(o,Tee);let s=i.pixelSize,a=i.outlineWidth;e._maxPixelSize=Math.max(e._maxPixelSize,s+a);let c=n[yl.positionHighAndSize],u=Tee.high;c(r,u.x,u.y,u.z,s);let f=n[yl.positionLowAndOutline],d=Tee.low;f(r,d.x,d.y,d.z,a)}var ggt=256;function WCe(e,t,n,i){let r=i._index,o=i.color,s=i.outlineColor,a=i.getPickId(t).color;vG.red=o.alpha,vG.green=s.alpha,vG.blue=a.alpha;let c=n[yl.compressedAttribute0];c(r,cn.encodeRGB8(o),cn.encodeRGB8(s),cn.encodeRGB8(a),cn.encodeRGB8(vG))}function qCe(e,t,n,i){let r=i._index,o=0,s=1,a=1,c=1,u=i.translucencyByDistance;l(u)&&(o=u.near,s=u.nearValue,a=u.far,c=u.farValue,(s!==1||c!==1)&&(e._shaderTranslucencyByDistance=!0));let f=i.show&&i.clusterShow;i.color.alpha===0&&i.outlineColor.alpha===0&&(f=!1),s=D.clamp(s,0,1),s=s===1?255:s*255|0;let d=(f?1:0)*ggt+s;c=D.clamp(c,0,1),c=c===1?255:c*255|0;let p=c,g=n[yl.compressedAttribute1];g(r,d,p,o,a)}function YCe(e,t,n,i){let r=i._index,o=n[yl.scaleByDistance],s=0,a=1,c=1,u=1,f=i.scaleByDistance;l(f)&&(s=f.near,a=f.nearValue,c=f.far,u=f.farValue,(a!==1||u!==1)&&(e._shaderScaleByDistance=!0)),o(r,s,a,c,u)}function XCe(e,t,n,i){let r=i._index,o=n[yl.distanceDisplayConditionAndDisableDepthAndSplitDirection],s=0,a=Number.MAX_VALUE,c=i.distanceDisplayCondition;l(c)&&(s=c.near,a=c.far,s*=s,a*=a,e._shaderDistanceDisplayCondition=!0);let u=i.disableDepthTestDistance;u*=u,u>0&&(e._shaderDisableDepthDistance=!0,u===Number.POSITIVE_INFINITY&&(u=-1));let f=0,d=i.splitDirection;l(d)&&(f=d),o(r,s,a,u,f)}function _gt(e,t,n,i){GCe(e,t,n,i),WCe(e,t,n,i),qCe(e,t,n,i),YCe(e,t,n,i),XCe(e,t,n,i)}function Eee(e,t,n,i,r,o){let s;i.mode===re.SCENE3D?(s=e._baseVolume,e._boundingVolumeDirty=!0):s=e._baseVolume2D;let a=[];for(let c=0;c<n;++c){let u=t[c],f=u.position,d=Ia._computeActualPosition(f,i,r);l(d)&&(u._setActualPosition(d),o?a.push(d):ue.expand(s,d,s))}o&&ue.fromPoints(a,s)}function ygt(e,t){let n=t.mode,i=e._pointPrimitives,r=e._pointPrimitivesToUpdate,o=e._modelMatrix;e._createVertexArray||e._mode!==n||n!==re.SCENE3D&&!N.equals(o,e.modelMatrix)?(e._mode=n,N.clone(e.modelMatrix,o),e._createVertexArray=!0,(n===re.SCENE3D||n===re.SCENE2D||n===re.COLUMBUS_VIEW)&&Eee(e,i,i.length,t,o,!0)):n===re.MORPHING?Eee(e,i,i.length,t,o,!0):(n===re.SCENE2D||n===re.COLUMBUS_VIEW)&&Eee(e,r,e._pointPrimitivesToUpdateIndex,t,o,!1)}function Agt(e,t,n){let r=t.camera.getPixelSize(n,t.context.drawingBufferWidth,t.context.drawingBufferHeight)*e._maxPixelSize;n.radius+=r}var bgt=[];ch.prototype.update=function(e){if(See(this),!this.show)return;this._maxTotalPointSize=kt.maximumAliasedPointSize,ygt(this,e);let n=this._pointPrimitives.length,i=this._pointPrimitivesToUpdate,r=this._pointPrimitivesToUpdateIndex,o=this._propertiesChanged,s=this._createVertexArray,a,c=e.context,u=e.passes,f=u.pick;if(s||!f&&this.computeNewBuffersUsage()){this._createVertexArray=!1;for(let v=0;v<vee;++v)o[v]=0;if(this._vaf=this._vaf&&this._vaf.destroy(),n>0){this._vaf=pgt(c,n,this._buffersUsage),a=this._vaf.writers;for(let v=0;v<n;++v){let S=this._pointPrimitives[v];S._dirty=!1,_gt(this,c,a,S)}this._vaf.commit()}this._pointPrimitivesToUpdateIndex=0}else if(r>0){let v=bgt;v.length=0,(o[Cee]||o[fgt]||o[dgt])&&v.push(GCe),(o[UCe]||o[ugt])&&v.push(WCe),(o[lgt]||o[VCe])&&v.push(qCe),o[zCe]&&v.push(YCe),(o[jCe]||o[hgt]||o[mgt])&&v.push(XCe);let S=v.length;if(a=this._vaf.writers,r/n>.1){for(let I=0;I<r;++I){let R=i[I];R._dirty=!1;for(let O=0;O<S;++O)v[O](this,c,a,R)}this._vaf.commit()}else{for(let I=0;I<r;++I){let R=i[I];R._dirty=!1;for(let O=0;O<S;++O)v[O](this,c,a,R);this._vaf.subCommit(R._index,1)}this._vaf.endSubCommits()}this._pointPrimitivesToUpdateIndex=0}if(r>n*1.5&&(i.length=n),!l(this._vaf)||!l(this._vaf.va))return;this._boundingVolumeDirty&&(this._boundingVolumeDirty=!1,ue.transform(this._baseVolume,this.modelMatrix,this._baseVolumeWC));let d,p=N.IDENTITY;e.mode===re.SCENE3D?(p=this.modelMatrix,d=ue.clone(this._baseVolumeWC,this._boundingVolume)):d=ue.clone(this._baseVolume2D,this._boundingVolume),Agt(this,e,d);let g=this._blendOption!==this.blendOption;this._blendOption=this.blendOption,g&&(this._blendOption===Fi.OPAQUE||this._blendOption===Fi.OPAQUE_AND_TRANSLUCENT?this._rsOpaque=Ge.fromCache({depthTest:{enabled:!0,func:te.LEQUAL},depthMask:!0}):this._rsOpaque=void 0,this._blendOption===Fi.TRANSLUCENT||this._blendOption===Fi.OPAQUE_AND_TRANSLUCENT?this._rsTranslucent=Ge.fromCache({depthTest:{enabled:!0,func:te.LEQUAL},depthMask:!1,blending:tn.ALPHA_BLEND}):this._rsTranslucent=void 0),this._shaderDisableDepthDistance=this._shaderDisableDepthDistance||e.minimumDisableDepthTestDistance!==0;let m,y;(g||this._shaderScaleByDistance&&!this._compiledShaderScaleByDistance||this._shaderTranslucencyByDistance&&!this._compiledShaderTranslucencyByDistance||this._shaderDistanceDisplayCondition&&!this._compiledShaderDistanceDisplayCondition||this._shaderDisableDepthDistance!==this._compiledShaderDisableDepthDistance)&&(m=new Ye({sources:[cM]}),this._shaderScaleByDistance&&m.defines.push("EYE_DISTANCE_SCALING"),this._shaderTranslucencyByDistance&&m.defines.push("EYE_DISTANCE_TRANSLUCENCY"),this._shaderDistanceDisplayCondition&&m.defines.push("DISTANCE_DISPLAY_CONDITION"),this._shaderDisableDepthDistance&&m.defines.push("DISABLE_DEPTH_DISTANCE"),this._blendOption===Fi.OPAQUE_AND_TRANSLUCENT&&(y=new Ye({defines:["OPAQUE"],sources:[Vy]}),this._sp=Qt.replaceCache({context:c,shaderProgram:this._sp,vertexShaderSource:m,fragmentShaderSource:y,attributeLocations:yl}),y=new Ye({defines:["TRANSLUCENT"],sources:[Vy]}),this._spTranslucent=Qt.replaceCache({context:c,shaderProgram:this._spTranslucent,vertexShaderSource:m,fragmentShaderSource:y,attributeLocations:yl})),this._blendOption===Fi.OPAQUE&&(y=new Ye({sources:[Vy]}),this._sp=Qt.replaceCache({context:c,shaderProgram:this._sp,vertexShaderSource:m,fragmentShaderSource:y,attributeLocations:yl})),this._blendOption===Fi.TRANSLUCENT&&(y=new Ye({sources:[Vy]}),this._spTranslucent=Qt.replaceCache({context:c,shaderProgram:this._spTranslucent,vertexShaderSource:m,fragmentShaderSource:y,attributeLocations:yl})),this._compiledShaderScaleByDistance=this._shaderScaleByDistance,this._compiledShaderTranslucencyByDistance=this._shaderTranslucencyByDistance,this._compiledShaderDistanceDisplayCondition=this._shaderDistanceDisplayCondition,this._compiledShaderDisableDepthDistance=this._shaderDisableDepthDistance);let A,b,x,T,E=e.commandList;if(u.render||f){let v=this._colorCommands,S=this._blendOption===Fi.OPAQUE,I=this._blendOption===Fi.OPAQUE_AND_TRANSLUCENT;A=this._vaf.va,b=A.length,v.length=b;let R=I?b*2:b;for(T=0;T<R;++T){let O=S||I&&T%2===0;x=v[T],l(x)||(x=v[T]=new at),x.primitiveType=Oe.POINTS,x.pass=O||!I?Ie.OPAQUE:Ie.TRANSLUCENT,x.owner=this;let L=I?Math.floor(T/2):T;x.boundingVolume=d,x.modelMatrix=p,x.shaderProgram=O?this._sp:this._spTranslucent,x.uniformMap=this._uniforms,x.vertexArray=A[L].va,x.renderState=O?this._rsOpaque:this._rsTranslucent,x.debugShowBoundingVolume=this.debugShowBoundingVolume,x.pickId="v_pickColor",E.push(x)}}};ch.prototype.isDestroyed=function(){return!1};ch.prototype.destroy=function(){return this._sp=this._sp&&this._sp.destroy(),this._spTranslucent=this._spTranslucent&&this._spTranslucent.destroy(),this._spPick=this._spPick&&this._spPick.destroy(),this._vaf=this._vaf&&this._vaf.destroy(),HCe(this._pointPrimitives),le(this)};var Dw=ch;var KCe=[Int8Array,Uint8Array,Uint8ClampedArray,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array],wee=1,Mk=8,us=new Uint32Array(96),Lk=class e{static from(t){if(!t||t.byteLength===void 0||t.buffer)throw new Error("Data must be an instance of ArrayBuffer or SharedArrayBuffer.");let[n,i]=new Uint8Array(t,0,2);if(n!==219)throw new Error("Data does not appear to be in a KDBush format.");let r=i>>4;if(r!==wee)throw new Error(`Got v${r} data when expected v${wee}.`);let o=KCe[i&15];if(!o)throw new Error("Unrecognized array type.");let[s]=new Uint16Array(t,2,1),[a]=new Uint32Array(t,4,1);return new e(a,s,o,void 0,t)}constructor(t,n=64,i=Float64Array,r=ArrayBuffer,o){if(isNaN(t)||t<0)throw new Error(`Unexpected numItems value: ${t}.`);this.numItems=+t,this.nodeSize=Math.min(Math.max(+n,2),65535),this.ArrayType=i,this.IndexArrayType=t<65536?Uint16Array:Uint32Array;let s=KCe.indexOf(this.ArrayType),a=t*2*this.ArrayType.BYTES_PER_ELEMENT,c=t*this.IndexArrayType.BYTES_PER_ELEMENT,u=(8-c%8)%8;if(s<0)throw new Error(`Unexpected typed array class: ${i}.`);if(o)this.data=o,this.ids=new this.IndexArrayType(o,Mk,t),this.coords=new i(o,Mk+c+u,t*2),this._pos=t*2,this._finished=!0;else{let f=this.data=new r(Mk+a+c+u);this.ids=new this.IndexArrayType(f,Mk,t),this.coords=new i(f,Mk+c+u,t*2),this._pos=0,this._finished=!1,new Uint8Array(f,0,2).set([219,(wee<<4)+s]),new Uint16Array(f,2,1)[0]=n,new Uint32Array(f,4,1)[0]=t}}add(t,n){let i=this._pos>>1;return this.ids[i]=i,this.coords[this._pos++]=t,this.coords[this._pos++]=n,i}finish(){let t=this._pos>>1;if(t!==this.numItems)throw new Error(`Added ${t} items when expected ${this.numItems}.`);return Pee(this.ids,this.coords,this.nodeSize,0,this.numItems-1,0),this._finished=!0,this}range(t,n,i,r){if(!this._finished)throw new Error("Data not yet indexed - call index.finish().");let{ids:o,coords:s,nodeSize:a}=this;us[0]=0,us[1]=o.length-1,us[2]=0;let c=3,u=[];for(;c>0;){let f=us[--c],d=us[--c],p=us[--c];if(d-p<=a){for(let A=p;A<=d;A++){let b=s[2*A],x=s[2*A+1];b>=t&&b<=i&&x>=n&&x<=r&&u.push(o[A])}continue}let g=p+d>>1,m=s[2*g],y=s[2*g+1];m>=t&&m<=i&&y>=n&&y<=r&&u.push(o[g]),(f===0?t<=m:n<=y)&&(us[c++]=p,us[c++]=g-1,us[c++]=1-f),(f===0?i>=m:r>=y)&&(us[c++]=g+1,us[c++]=d,us[c++]=1-f)}return u}within(t,n,i){let r=[];return this.withinInto(t,n,i,r),r}withinInto(t,n,i,r){if(!this._finished)throw new Error("Data not yet indexed - call index.finish().");let{ids:o,coords:s,nodeSize:a}=this;us[0]=0,us[1]=o.length-1,us[2]=0;let c=3,u=0,f=i*i;for(;c>0;){let d=us[--c],p=us[--c],g=us[--c];if(p-g<=a){for(let b=g;b<=p;b++)$Ce(s[2*b],s[2*b+1],t,n)<=f&&(r[u++]=o[b]);continue}let m=g+p>>1,y=s[2*m],A=s[2*m+1];$Ce(y,A,t,n)<=f&&(r[u++]=o[m]),(d===0?t-i<=y:n-i<=A)&&(us[c++]=g,us[c++]=m-1,us[c++]=1-d),(d===0?t+i>=y:n+i>=A)&&(us[c++]=m+1,us[c++]=p,us[c++]=1-d)}return u}};function Pee(e,t,n,i,r,o){if(r-i<=n)return;let s=i+r>>1;JCe(e,t,s,i,r,o),Pee(e,t,n,i,s-1,1-o),Pee(e,t,n,s+1,r,1-o)}function JCe(e,t,n,i,r,o){for(;r>i;){if(r-i>600){let u=r-i+1,f=n-i+1,d=Math.log(u),p=.5*Math.exp(2*d/3),g=.5*Math.sqrt(d*p*(u-p)/u)*(f-u/2<0?-1:1),m=Math.max(i,Math.floor(n-f*p/u+g)),y=Math.min(r,Math.floor(n+(u-f)*p/u+g));JCe(e,t,n,m,y,o)}let s=t[2*n+o],a=i,c=r;for(Nk(e,t,i,n),t[2*r+o]>s&&Nk(e,t,i,r);a<c;){for(Nk(e,t,a,c),a++,c--;t[2*a+o]<s;)a++;for(;t[2*c+o]>s;)c--}t[2*i+o]===s?Nk(e,t,i,c):(c++,Nk(e,t,c,r)),c<=n&&(i=c+1),n<=c&&(r=c-1)}}function Nk(e,t,n,i){Iee(e,n,i),Iee(t,2*n,2*i),Iee(t,2*n+1,2*i+1)}function Iee(e,t,n){let i=e[t];e[t]=e[n],e[n]=i}function $Ce(e,t,n,i){let r=e-n,o=t-i;return r*r+o*o}function Nm(e){e=e??H.EMPTY_OBJECT,this._enabled=e.enabled??!1,this._pixelRange=e.pixelRange??80,this._minimumClusterSize=e.minimumClusterSize??2,this._clusterBillboards=e.clusterBillboards??!0,this._clusterLabels=e.clusterLabels??!0,this._clusterPoints=e.clusterPoints??!0,this._labelCollection=void 0,this._billboardCollection=void 0,this._pointCollection=void 0,this._clusterBillboardCollection=void 0,this._clusterLabelCollection=void 0,this._clusterPointCollection=void 0,this._collectionIndicesByEntity={},this._unusedLabelIndices=[],this._unusedBillboardIndices=[],this._unusedPointIndices=[],this._previousClusters=[],this._previousHeight=void 0,this._enabledDirty=!1,this._clusterDirty=!1,this._cluster=void 0,this._removeEventListener=void 0,this._clusterEvent=new be,this.show=e.show??!0}function ZCe(e,t){e.x-=t,e.y-=t,e.width+=t*2,e.height+=t*2}var xgt=new et;function QCe(e,t,n,i,r){if(l(e._labelCollection)&&i._clusterLabels?r=RA.getScreenSpaceBoundingBox(e,t,r):l(e._billboardCollection)&&i._clusterBillboards?r=Br.getScreenSpaceBoundingBox(e,t,r):l(e._pointPrimitiveCollection)&&i._clusterPoints&&(r=Ia.getScreenSpaceBoundingBox(e,t,r)),ZCe(r,n),i._clusterLabels&&!l(e._labelCollection)&&l(e.id)&&tve(i,e.id.id)&&l(e.id._label)){let o=i._collectionIndicesByEntity[e.id.id].labelIndex,s=i._labelCollection.get(o),a=RA.getScreenSpaceBoundingBox(s,t,xgt);ZCe(a,n),r=et.union(r,a,r)}return r}function Tgt(e,t){if(e.clusterShow=!0,!l(e._labelCollection)&&l(e.id)&&tve(t,e.id.id)&&l(e.id._label)){let n=t._collectionIndicesByEntity[e.id.id].labelIndex,i=t._labelCollection.get(n);i.clusterShow=!0}}function eve(e,t,n,i){let r={billboard:i._clusterBillboardCollection.add(),label:i._clusterLabelCollection.add(),point:i._clusterPointCollection.add()};r.billboard.show=!1,r.point.show=!1,r.label.show=!0,r.label.text=t.toLocaleString(),r.label.id=n,r.billboard.position=r.label.position=r.point.position=e,i._clusterEvent.raiseEvent(n,r)}function tve(e,t){return l(e)&&l(e._collectionIndicesByEntity[t])&&l(e._collectionIndicesByEntity[t].labelIndex)}function Dee(e,t,n,i,r){if(!l(e))return;let o=e.length;for(let s=0;s<o;++s){let a=e.get(s);if(a.clusterShow=!1,!a.show||r._scene.mode===re.SCENE3D&&!i.isPointVisible(a.position))continue;let c=r._clusterLabels&&l(a._labelCollection),u=r._clusterBillboards&&l(a.id._billboard),f=r._clusterPoints&&l(a.id._point);if(c&&(f||u))continue;let d=a.computeScreenSpacePosition(n);l(d)&&t.push({index:s,collection:e,clustered:!1,coord:d})}}var Egt=new et,Cgt=new et,vgt=new et;function Sgt(e){return function(t){if(l(t)&&t<.05||!e.enabled)return;let n=e._scene,i=e._labelCollection,r=e._billboardCollection,o=e._pointCollection;if(!l(i)&&!l(r)&&!l(o)||!e._clusterBillboards&&!e._clusterLabels&&!e._clusterPoints)return;let s=e._clusterLabelCollection,a=e._clusterBillboardCollection,c=e._clusterPointCollection;l(s)?s.removeAll():s=e._clusterLabelCollection=new e0({scene:n}),l(a)?a.removeAll():a=e._clusterBillboardCollection=new Wf({scene:n}),l(c)?c.removeAll():c=e._clusterPointCollection=new Dw;let u=e._pixelRange,f=e._minimumClusterSize,d=e._previousClusters,p=[],g=e._previousHeight,m=n.camera.positionCartographic.height,y=n.ellipsoid,A=n.camera.positionWC,b=new Mm(y,A),x=[];e._clusterLabels&&Dee(i,x,n,b,e),e._clusterBillboards&&Dee(r,x,n,b,e),e._clusterPoints&&Dee(o,x,n,b,e);let T,E,v,S,I,R,O,L,_,C,w,P;if(x.length>0){let M=new Lk(x.length,64,Float64Array);for(let F=0;F<x.length;++F)M.add(x[F].coord.x,x[F].coord.y);if(M.finish(),m<g)for(v=d.length,T=0;T<v;++T){let F=d[T];if(!b.isPointVisible(F.position))continue;let V=Br._computeScreenSpacePosition(N.IDENTITY,F.position,h.ZERO,U.ZERO,n);if(!l(V))continue;let B=1-m/g,j=F.width=F.width*B,k=F.height=F.height*B;j=Math.max(j,F.minimumWidth),k=Math.max(k,F.minimumHeight);let G=V.x-j*.5,q=V.y-k*.5,Q=V.x+j,W=V.y+k;for(I=M.range(G,q,Q,W),R=I.length,C=0,_=[],E=0;E<R;++E)O=I[E],L=x[O],L.clustered||(++C,w=L.collection,P=L.index,_.push(w.get(P).id));if(C>=f)for(eve(F.position,C,_,e),p.push(F),E=0;E<R;++E)x[I[E]].clustered=!0}for(v=x.length,T=0;T<v;++T){let F=x[T];if(F.clustered)continue;F.clustered=!0,w=F.collection,P=F.index;let V=w.get(P);S=QCe(V,F.coord,u,e,Egt);let B=et.clone(S,Cgt);I=M.range(S.x,S.y,S.x+S.width,S.y+S.height),R=I.length;let j=h.clone(V.position);for(C=1,_=[V.id],E=0;E<R;++E)if(O=I[E],L=x[O],!L.clustered){let k=L.collection.get(L.index),G=QCe(k,L.coord,u,e,vgt);h.add(k.position,j,j),et.union(B,G,B),++C,_.push(k.id)}if(C>=f){let k=h.multiplyByScalar(j,1/C,j);for(eve(k,C,_,e),p.push({position:k,width:B.width,height:B.height,minimumWidth:S.width,minimumHeight:S.height}),E=0;E<R;++E)x[I[E]].clustered=!0}else Tgt(V,e)}}s.length===0&&(s.destroy(),e._clusterLabelCollection=void 0),a.length===0&&(a.destroy(),e._clusterBillboardCollection=void 0),c.length===0&&(c.destroy(),e._clusterPointCollection=void 0),e._previousClusters=p,e._previousHeight=m}}Nm.prototype._initialize=function(e){this._scene=e;let t=Sgt(this);this._cluster=t,this._removeEventListener=e.camera.changed.addEventListener(t)};Object.defineProperties(Nm.prototype,{enabled:{get:function(){return this._enabled},set:function(e){this._enabledDirty=e!==this._enabled,this._enabled=e}},pixelRange:{get:function(){return this._pixelRange},set:function(e){this._clusterDirty=this._clusterDirty||e!==this._pixelRange,this._pixelRange=e}},minimumClusterSize:{get:function(){return this._minimumClusterSize},set:function(e){this._clusterDirty=this._clusterDirty||e!==this._minimumClusterSize,this._minimumClusterSize=e}},clusterEvent:{get:function(){return this._clusterEvent}},clusterBillboards:{get:function(){return this._clusterBillboards},set:function(e){this._clusterDirty=this._clusterDirty||e!==this._clusterBillboards,this._clusterBillboards=e}},clusterLabels:{get:function(){return this._clusterLabels},set:function(e){this._clusterDirty=this._clusterDirty||e!==this._clusterLabels,this._clusterLabels=e}},clusterPoints:{get:function(){return this._clusterPoints},set:function(e){this._clusterDirty=this._clusterDirty||e!==this._clusterPoints,this._clusterPoints=e}},ready:{get:function(){return!this._enabledDirty&&!this._clusterDirty&&(!l(this._billboardCollection)||this._billboardCollection.ready)&&(!l(this._labelCollection)||this._labelCollection.ready)}}});function Oee(e,t,n,i){return function(r){let o=this[e];l(this._collectionIndicesByEntity)||(this._collectionIndicesByEntity={});let s=this._collectionIndicesByEntity[r.id];if(l(s)||(s=this._collectionIndicesByEntity[r.id]={billboardIndex:void 0,labelIndex:void 0,pointIndex:void 0}),l(o)&&l(s[i]))return o.get(s[i]);l(o)||(o=this[e]=new t({scene:this._scene}));let a,c,u=this[n];u.length>0?(a=u.shift(),c=o.get(a)):(c=o.add(),a=o.length-1),s[i]=a;let f=this;return Promise.resolve().then(function(){f._clusterDirty=!0}),c}}function Mee(e,t){let n=e._collectionIndicesByEntity[t];!l(n.billboardIndex)&&!l(n.labelIndex)&&!l(n.pointIndex)&&delete e._collectionIndicesByEntity[t]}Nm.prototype.getLabel=Oee("_labelCollection",e0,"_unusedLabelIndices","labelIndex");Nm.prototype.removeLabel=function(e){let t=this._collectionIndicesByEntity&&this._collectionIndicesByEntity[e.id];if(!l(this._labelCollection)||!l(t)||!l(t.labelIndex))return;let n=t.labelIndex;t.labelIndex=void 0,Mee(this,e.id);let i=this._labelCollection.get(n);i.show=!1,i.text="",i.id=void 0,this._unusedLabelIndices.push(n),this._clusterDirty=!0};Nm.prototype.getBillboard=Oee("_billboardCollection",Wf,"_unusedBillboardIndices","billboardIndex");Nm.prototype.removeBillboard=function(e){let t=this._collectionIndicesByEntity&&this._collectionIndicesByEntity[e.id];if(!l(this._billboardCollection)||!l(t)||!l(t.billboardIndex))return;let n=t.billboardIndex;t.billboardIndex=void 0,Mee(this,e.id);let i=this._billboardCollection.get(n);i.id=void 0,i.show=!1,i.image=void 0,this._unusedBillboardIndices.push(n),this._clusterDirty=!0};Nm.prototype.getPoint=Oee("_pointCollection",Dw,"_unusedPointIndices","pointIndex");Nm.prototype.removePoint=function(e){let t=this._collectionIndicesByEntity&&this._collectionIndicesByEntity[e.id];if(!l(this._pointCollection)||!l(t)||!l(t.pointIndex))return;let n=t.pointIndex;t.pointIndex=void 0,Mee(this,e.id);let i=this._pointCollection.get(n);i.show=!1,i.id=void 0,this._unusedPointIndices.push(n),this._clusterDirty=!0};function Ree(e){if(!l(e))return;let t=e.length;for(let n=0;n<t;++n)e.get(n).clusterShow=!0}function wgt(e){e.enabled||(l(e._clusterLabelCollection)&&e._clusterLabelCollection.destroy(),l(e._clusterBillboardCollection)&&e._clusterBillboardCollection.destroy(),l(e._clusterPointCollection)&&e._clusterPointCollection.destroy(),e._clusterLabelCollection=void 0,e._clusterBillboardCollection=void 0,e._clusterPointCollection=void 0,Ree(e._labelCollection),Ree(e._billboardCollection),Ree(e._pointCollection))}Nm.prototype.update=function(e){if(!this.show)return;let t,n=this._labelCollection;l(n)&&n.length>0&&!n.ready&&(t=e.commandList,e.commandList=[],n.update(e),e.commandList=t);let i=this._billboardCollection;l(i)&&i.length>0&&!i.ready&&(t=e.commandList,e.commandList=[],i.update(e),e.commandList=t),this._enabledDirty&&(this._enabledDirty=!1,wgt(this),this._clusterDirty=!0),this._clusterDirty&&(this._cluster(),this._clusterDirty=l(n)&&!n.ready||l(i)&&!i.ready),l(this._clusterLabelCollection)&&this._clusterLabelCollection.update(e),l(this._clusterBillboardCollection)&&this._clusterBillboardCollection.update(e),l(this._clusterPointCollection)&&this._clusterPointCollection.update(e),l(n)&&n.update(e),l(i)&&i.update(e),l(this._pointCollection)&&this._pointCollection.update(e)};Nm.prototype.destroy=function(){l(this._removeEventListener)&&(this._removeEventListener(),this._removeEventListener=void 0),this._labelCollection=this._labelCollection&&this._labelCollection.destroy(),this._billboardCollection=this._billboardCollection&&this._billboardCollection.destroy(),this._pointCollection=this._pointCollection&&this._pointCollection.destroy(),this._clusterLabelCollection=this._clusterLabelCollection&&this._clusterLabelCollection.destroy(),this._clusterBillboardCollection=this._clusterBillboardCollection&&this._clusterBillboardCollection.destroy(),this._clusterPointCollection=this._clusterPointCollection&&this._clusterPointCollection.destroy(),this._labelCollection=void 0,this._billboardCollection=void 0,this._pointCollection=void 0,this._clusterBillboardCollection=void 0,this._clusterLabelCollection=void 0,this._clusterPointCollection=void 0,this._collectionIndicesByEntity=void 0,this._unusedLabelIndices=[],this._unusedBillboardIndices=[],this._unusedPointIndices=[],this._previousClusters=[],this._previousHeight=void 0,this._enabledDirty=!1,this._pixelRangeDirty=!1,this._minimumClusterSizeDirty=!1};var $f=Nm;function Nee(e){this._name=e,this._clock=void 0,this._changed=new be,this._error=new be,this._isLoading=!1,this._loading=new be,this._entityCollection=new Ya(this),this._entityCluster=new $f}Object.defineProperties(Nee.prototype,{name:{get:function(){return this._name},set:function(e){this._name!==e&&(this._name=e,this._changed.raiseEvent(this))}},clock:{get:function(){return this._clock},set:function(e){this._clock!==e&&(this._clock=e,this._changed.raiseEvent(this))}},entities:{get:function(){return this._entityCollection}},isLoading:{get:function(){return this._isLoading},set:function(e){Ds.setLoading(this,e)}},changedEvent:{get:function(){return this._changed}},errorEvent:{get:function(){return this._error}},loadingEvent:{get:function(){return this._loading}},show:{get:function(){return this._entityCollection.show},set:function(e){this._entityCollection.show=e}},clustering:{get:function(){return this._entityCluster},set:function(e){this._entityCluster=e}}});Nee.prototype.update=function(e){return!0};var Fk=Nee;var nve={};nve.computePositions=function(e,t,n,i,r){let o=e*.5,s=-o,a=i+i,c=r?2*a:a,u=new Float64Array(c*3),f,d=0,p=0,g=r?a*3:0,m=r?(a+i)*3:i*3;for(f=0;f<i;f++){let y=f/i*D.TWO_PI,A=Math.cos(y),b=Math.sin(y),x=A*n,T=b*n,E=A*t,v=b*t;u[p+g]=x,u[p+g+1]=T,u[p+g+2]=s,u[p+m]=E,u[p+m+1]=v,u[p+m+2]=o,p+=3,r&&(u[d++]=x,u[d++]=T,u[d++]=s,u[d++]=E,u[d++]=v,u[d++]=o)}return u};var nE=nve;var Lee=new U,Igt=new h,Pgt=new h,Dgt=new h,Rgt=new h;function w_(e){e=e??H.EMPTY_OBJECT;let t=e.length,n=e.topRadius,i=e.bottomRadius,r=e.vertexFormat??Be.DEFAULT,o=e.slices??128;this._length=t,this._topRadius=n,this._bottomRadius=i,this._vertexFormat=Be.clone(r),this._slices=o,this._offsetAttribute=e.offsetAttribute,this._workerName="createCylinderGeometry"}w_.packedLength=Be.packedLength+5;w_.pack=function(e,t,n){return n=n??0,Be.pack(e._vertexFormat,t,n),n+=Be.packedLength,t[n++]=e._length,t[n++]=e._topRadius,t[n++]=e._bottomRadius,t[n++]=e._slices,t[n]=e._offsetAttribute??-1,t};var ive=new Be,Rw={vertexFormat:ive,length:void 0,topRadius:void 0,bottomRadius:void 0,slices:void 0,offsetAttribute:void 0};w_.unpack=function(e,t,n){t=t??0;let i=Be.unpack(e,t,ive);t+=Be.packedLength;let r=e[t++],o=e[t++],s=e[t++],a=e[t++],c=e[t];return l(n)?(n._vertexFormat=Be.clone(i,n._vertexFormat),n._length=r,n._topRadius=o,n._bottomRadius=s,n._slices=a,n._offsetAttribute=c===-1?void 0:c,n):(Rw.length=r,Rw.topRadius=o,Rw.bottomRadius=s,Rw.slices=a,Rw.offsetAttribute=c===-1?void 0:c,new w_(Rw))};w_.createGeometry=function(e){let t=e._length,n=e._topRadius,i=e._bottomRadius,r=e._vertexFormat,o=e._slices;if(t<=0||n<0||i<0||n===0&&i===0)return;let s=o+o,a=o+s,c=s+s,u=nE.computePositions(t,n,i,o,!0),f=r.st?new Float32Array(c*2):void 0,d=r.normal?new Float32Array(c*3):void 0,p=r.tangent?new Float32Array(c*3):void 0,g=r.bitangent?new Float32Array(c*3):void 0,m,y=r.normal||r.tangent||r.bitangent;if(y){let I=r.tangent||r.bitangent,R=0,O=0,L=0,_=Math.atan2(i-n,t),C=Igt;C.z=Math.sin(_);let w=Math.cos(_),P=Dgt,M=Pgt;for(m=0;m<o;m++){let F=m/o*D.TWO_PI,V=w*Math.cos(F),B=w*Math.sin(F);y&&(C.x=V,C.y=B,I&&(P=h.normalize(h.cross(h.UNIT_Z,C,P),P)),r.normal&&(d[R++]=C.x,d[R++]=C.y,d[R++]=C.z,d[R++]=C.x,d[R++]=C.y,d[R++]=C.z),r.tangent&&(p[O++]=P.x,p[O++]=P.y,p[O++]=P.z,p[O++]=P.x,p[O++]=P.y,p[O++]=P.z),r.bitangent&&(M=h.normalize(h.cross(C,P,M),M),g[L++]=M.x,g[L++]=M.y,g[L++]=M.z,g[L++]=M.x,g[L++]=M.y,g[L++]=M.z))}for(m=0;m<o;m++)r.normal&&(d[R++]=0,d[R++]=0,d[R++]=-1),r.tangent&&(p[O++]=1,p[O++]=0,p[O++]=0),r.bitangent&&(g[L++]=0,g[L++]=-1,g[L++]=0);for(m=0;m<o;m++)r.normal&&(d[R++]=0,d[R++]=0,d[R++]=1),r.tangent&&(p[O++]=1,p[O++]=0,p[O++]=0),r.bitangent&&(g[L++]=0,g[L++]=1,g[L++]=0)}let A=12*o-12,b=je.createTypedArray(c,A),x=0,T=0;for(m=0;m<o-1;m++)b[x++]=T,b[x++]=T+2,b[x++]=T+3,b[x++]=T,b[x++]=T+3,b[x++]=T+1,T+=2;for(b[x++]=s-2,b[x++]=0,b[x++]=1,b[x++]=s-2,b[x++]=1,b[x++]=s-1,m=1;m<o-1;m++)b[x++]=s+m+1,b[x++]=s+m,b[x++]=s;for(m=1;m<o-1;m++)b[x++]=a,b[x++]=a+m,b[x++]=a+m+1;let E=0;if(r.st){let I=Math.max(n,i);for(m=0;m<c;m++){let R=h.fromArray(u,m*3,Rgt);f[E++]=(R.x+I)/(2*I),f[E++]=(R.y+I)/(2*I)}}let v=new Tn;r.position&&(v.position=new Ne({componentDatatype:Y.DOUBLE,componentsPerAttribute:3,values:u})),r.normal&&(v.normal=new Ne({componentDatatype:Y.FLOAT,componentsPerAttribute:3,values:d})),r.tangent&&(v.tangent=new Ne({componentDatatype:Y.FLOAT,componentsPerAttribute:3,values:p})),r.bitangent&&(v.bitangent=new Ne({componentDatatype:Y.FLOAT,componentsPerAttribute:3,values:g})),r.st&&(v.st=new Ne({componentDatatype:Y.FLOAT,componentsPerAttribute:2,values:f})),Lee.x=t*.5,Lee.y=Math.max(i,n);let S=new ue(h.ZERO,U.magnitude(Lee));if(l(e._offsetAttribute)){t=u.length;let I=e._offsetAttribute===mn.NONE?0:1,R=new Uint8Array(t/3).fill(I);v.applyOffset=new Ne({componentDatatype:Y.UNSIGNED_BYTE,componentsPerAttribute:1,values:R})}return new St({attributes:v,indices:b,primitiveType:Oe.TRIANGLES,boundingSphere:S,offsetAttribute:e._offsetAttribute})};var Fee;w_.getUnitCylinder=function(){return l(Fee)||(Fee=w_.createGeometry(new w_({topRadius:1,bottomRadius:1,length:1,vertexFormat:Be.POSITION_ONLY}))),Fee};var Bk=w_;var Bee=new U;function Ow(e){e=e??H.EMPTY_OBJECT;let t=e.length,n=e.topRadius,i=e.bottomRadius,r=e.slices??128,o=Math.max(e.numberOfVerticalLines??16,0);this._length=t,this._topRadius=n,this._bottomRadius=i,this._slices=r,this._numberOfVerticalLines=o,this._offsetAttribute=e.offsetAttribute,this._workerName="createCylinderOutlineGeometry"}Ow.packedLength=6;Ow.pack=function(e,t,n){return n=n??0,t[n++]=e._length,t[n++]=e._topRadius,t[n++]=e._bottomRadius,t[n++]=e._slices,t[n++]=e._numberOfVerticalLines,t[n]=e._offsetAttribute??-1,t};var iE={length:void 0,topRadius:void 0,bottomRadius:void 0,slices:void 0,numberOfVerticalLines:void 0,offsetAttribute:void 0};Ow.unpack=function(e,t,n){t=t??0;let i=e[t++],r=e[t++],o=e[t++],s=e[t++],a=e[t++],c=e[t];return l(n)?(n._length=i,n._topRadius=r,n._bottomRadius=o,n._slices=s,n._numberOfVerticalLines=a,n._offsetAttribute=c===-1?void 0:c,n):(iE.length=i,iE.topRadius=r,iE.bottomRadius=o,iE.slices=s,iE.numberOfVerticalLines=a,iE.offsetAttribute=c===-1?void 0:c,new Ow(iE))};Ow.createGeometry=function(e){let t=e._length,n=e._topRadius,i=e._bottomRadius,r=e._slices,o=e._numberOfVerticalLines;if(t<=0||n<0||i<0||n===0&&i===0)return;let s=r*2,a=nE.computePositions(t,n,i,r,!1),c=r*2,u;if(o>0){let y=Math.min(o,r);u=Math.round(r/y),c+=y}let f=je.createTypedArray(s,c*2),d=0,p;for(p=0;p<r-1;p++)f[d++]=p,f[d++]=p+1,f[d++]=p+r,f[d++]=p+1+r;if(f[d++]=r-1,f[d++]=0,f[d++]=r+r-1,f[d++]=r,o>0)for(p=0;p<r;p+=u)f[d++]=p,f[d++]=p+r;let g=new Tn;g.position=new Ne({componentDatatype:Y.DOUBLE,componentsPerAttribute:3,values:a}),Bee.x=t*.5,Bee.y=Math.max(i,n);let m=new ue(h.ZERO,U.magnitude(Bee));if(l(e._offsetAttribute)){t=a.length;let y=e._offsetAttribute===mn.NONE?0:1,A=new Uint8Array(t/3).fill(y);g.applyOffset=new Ne({componentDatatype:Y.UNSIGNED_BYTE,componentsPerAttribute:1,values:A})}return new St({attributes:g,indices:f,primitiveType:Oe.LINES,boundingSphere:m,offsetAttribute:e._offsetAttribute})};var kk=Ow;var rve=h.ZERO,ove=new h,Ogt=new h,sve=new z;function Mgt(e){this.id=e,this.vertexFormat=void 0,this.length=void 0,this.topRadius=void 0,this.bottomRadius=void 0,this.slices=void 0,this.numberOfVerticalLines=void 0,this.offsetAttribute=void 0}function Jf(e,t){Pi.call(this,{entity:e,scene:t,geometryOptions:new Mgt(e),geometryPropertyName:"cylinder",observedPropertyNames:["availability","position","orientation","cylinder"]}),this._onEntityPropertyChanged(e,"cylinder",e.cylinder,void 0)}l(Object.create)&&(Jf.prototype=Object.create(Pi.prototype),Jf.prototype.constructor=Jf);Object.defineProperties(Jf.prototype,{terrainOffsetProperty:{get:function(){return this._terrainOffsetProperty}}});Jf.prototype.createFillGeometryInstance=function(e){let t=this._entity,n=t.isAvailable(e),i=new Pn(n&&t.isShowing&&this._showProperty.getValue(e)&&this._fillProperty.getValue(e)),r=this._distanceDisplayConditionProperty.getValue(e),o=Qn.fromDistanceDisplayCondition(r),s={show:i,distanceDisplayCondition:o,color:void 0,offset:void 0};if(this._materialProperty instanceof Kt){let a;l(this._materialProperty.color)&&(this._materialProperty.color.isConstant||n)&&(a=this._materialProperty.color.getValue(e,sve)),l(a)||(a=z.WHITE),s.color=Jt.fromColor(a)}return l(this._options.offsetAttribute)&&(s.offset=Tr.fromCartesian3(X.getValueOrDefault(this._terrainOffsetProperty,e,rve,ove))),new Ft({id:t,geometry:new Bk(this._options),modelMatrix:t.computeModelMatrixForHeightReference(e,t.cylinder.heightReference,this._options.length*.5,this._scene.ellipsoid),attributes:s})};Jf.prototype.createOutlineGeometryInstance=function(e){let t=this._entity,n=t.isAvailable(e),i=X.getValueOrDefault(this._outlineColorProperty,e,z.BLACK,sve),r=this._distanceDisplayConditionProperty.getValue(e),o={show:new Pn(n&&t.isShowing&&this._showProperty.getValue(e)&&this._showOutlineProperty.getValue(e)),color:Jt.fromColor(i),distanceDisplayCondition:Qn.fromDistanceDisplayCondition(r),offset:void 0};return l(this._options.offsetAttribute)&&(o.offset=Tr.fromCartesian3(X.getValueOrDefault(this._terrainOffsetProperty,e,rve,ove))),new Ft({id:t,geometry:new kk(this._options),modelMatrix:t.computeModelMatrixForHeightReference(e,t.cylinder.heightReference,this._options.length*.5,this._scene.ellipsoid),attributes:o})};Jf.prototype._computeCenter=function(e,t){return X.getValueOrUndefined(this._entity.position,e,t)};Jf.prototype._isHidden=function(e,t){return!l(e.position)||!l(t.length)||!l(t.topRadius)||!l(t.bottomRadius)||Pi.prototype._isHidden.call(this,e,t)};Jf.prototype._isDynamic=function(e,t){return!e.position.isConstant||!X.isConstant(e.orientation)||!t.length.isConstant||!t.topRadius.isConstant||!t.bottomRadius.isConstant||!X.isConstant(t.slices)||!X.isConstant(t.outlineWidth)||!X.isConstant(t.numberOfVerticalLines)};Jf.prototype._setStaticOptions=function(e,t){let n=X.getValueOrDefault(t.heightReference,nt.MINIMUM_VALUE,We.NONE),i=this._options;i.vertexFormat=this._materialProperty instanceof Kt?yn.VERTEX_FORMAT:Er.MaterialSupport.TEXTURED.vertexFormat,i.length=t.length.getValue(nt.MINIMUM_VALUE),i.topRadius=t.topRadius.getValue(nt.MINIMUM_VALUE),i.bottomRadius=t.bottomRadius.getValue(nt.MINIMUM_VALUE),i.slices=X.getValueOrUndefined(t.slices,nt.MINIMUM_VALUE),i.numberOfVerticalLines=X.getValueOrUndefined(t.numberOfVerticalLines,nt.MINIMUM_VALUE),i.offsetAttribute=n!==We.NONE?mn.ALL:void 0};Jf.prototype._onEntityPropertyChanged=Pg;Jf.DynamicGeometryUpdater=Mw;function Mw(e,t,n){Ii.call(this,e,t,n)}l(Object.create)&&(Mw.prototype=Object.create(Ii.prototype),Mw.prototype.constructor=Mw);Mw.prototype._isHidden=function(e,t,n){let i=this._options,r=X.getValueOrUndefined(e.position,n,Ogt);return!l(r)||!l(i.length)||!l(i.topRadius)||!l(i.bottomRadius)||Ii.prototype._isHidden.call(this,e,t,n)};Mw.prototype._setOptions=function(e,t,n){let i=X.getValueOrDefault(t.heightReference,n,We.NONE),r=this._options;r.length=X.getValueOrUndefined(t.length,n),r.topRadius=X.getValueOrUndefined(t.topRadius,n),r.bottomRadius=X.getValueOrUndefined(t.bottomRadius,n),r.slices=X.getValueOrUndefined(t.slices,n),r.numberOfVerticalLines=X.getValueOrUndefined(t.numberOfVerticalLines,n),r.offsetAttribute=i!==We.NONE?mn.ALL:void 0};var Uk=Jf;var ave={UNBOUNDED:0,CLAMPED:1,LOOP_STOP:2};Object.freeze(ave);var Rs=ave;var cve={TICK_DEPENDENT:0,SYSTEM_CLOCK_MULTIPLIER:1,SYSTEM_CLOCK:2};Object.freeze(cve);var Vr=cve;var lve={NONE:0,HOLD:1,EXTRAPOLATE:2,LINEAR_EXTRAPOLATE:3};Object.freeze(lve);var fu=lve;var uve=Qo(Tf(),1);function Ngt(e){let t=new uve.default(e);t.normalize();let n=t.path(),i=n.lastIndexOf("/");return i!==-1&&(n=n.substr(i+1)),n}var I_=Ngt;var Lgt=D.factorial;function kee(e,t,n,i,r,o){let s=0,a,c,u;if(i>0){for(c=0;c<r;c++){for(a=!1,u=0;u<o.length&&!a;u++)c===o[u]&&(a=!0);a||(o.push(c),s+=kee(e,t,n,i-1,r,o),o.splice(o.length-1,1))}return s}for(s=1,c=0;c<r;c++){for(a=!1,u=0;u<o.length&&!a;u++)c===o[u]&&(a=!0);a||(s*=e-n[t[c]])}return s}var Fgt=[],Uee=class{static get type(){return"Hermite"}static getRequiredDataPoints(t,n){return n=n??0,Math.max(Math.floor((t+1)/(n+1)),2)}static interpolateOrderZero(t,n,i,r,o){l(o)||(o=new Array(r));let s,a,c,u,f,d,p=n.length,g=new Array(r);for(s=0;s<r;s++){o[s]=0;let b=new Array(p);for(g[s]=b,a=0;a<p;a++)b[a]=[]}let m=p,y=new Array(m);for(s=0;s<m;s++)y[s]=s;let A=p-1;for(u=0;u<r;u++){for(a=0;a<m;a++)d=y[a]*r+u,g[u][0].push(i[d]);for(s=1;s<m;s++){let b=!1;for(a=0;a<m-s;a++){let x=n[y[a]],T=n[y[a+s]],E;T-x<=0?(d=y[a]*r+r*s+u,E=i[d],g[u][s].push(E/Lgt(s))):(E=g[u][s-1][a+1]-g[u][s-1][a],g[u][s].push(E/(T-x))),b=b||E!==0}b||(A=s-1)}}for(c=0,f=0;c<=f;c++)for(s=c;s<=A;s++){let b=kee(t,y,n,c,s,[]);for(u=0;u<r;u++){let x=g[u][s][0];o[u+c*r]+=x*b}}return o}static interpolate(t,n,i,r,o,s,a){let c=r*(s+1);l(a)||(a=new Array(c));for(let x=0;x<c;x++)a[x]=0;let u=n.length,f=new Array(u*(o+1)),d;for(d=0;d<u;d++)for(let x=0;x<o+1;x++)f[d*(o+1)+x]=d;let p=f.length,g=Fgt,m=Bgt(g,f,n,i,r,o),y=[],A=p*(p+1)/2,b=Math.min(m,s);for(let x=0;x<=b;x++)for(d=x;d<=m;d++){y.length=0;let T=kee(t,f,n,x,d,y),E=Math.floor(d*(1-d)/2)+p*d;for(let v=0;v<r;v++){let S=Math.floor(v*A),I=g[S+E];a[v+x*r]+=I*T}}return a}};function Bgt(e,t,n,i,r,o){let s,a,c=-1,u=t.length,f=u*(u+1)/2;for(let d=0;d<r;d++){let p=Math.floor(d*f);for(s=0;s<u;s++)a=t[s]*r*(o+1)+d,e[p+s]=i[a];for(let g=1;g<u;g++){let m=0,y=Math.floor(g*(1-g)/2)+u*g,A=!1;for(s=0;s<u-g;s++){let b=n[t[s]],x=n[t[s+g]],T,E;if(x-b<=0)a=t[s]*r*(o+1)+r*g+d,T=i[a],E=T/D.factorial(g),e[p+y+m]=E,m++;else{let v=Math.floor((g-1)*(2-g)/2)+u*(g-1);T=e[p+v+s+1]-e[p+v+s],E=T/(x-b),e[p+y+m]=E,m++}A=A||T!==0}A&&(c=Math.max(c,g))}}return c}var zk=Uee;var zee=class{static get type(){return"Lagrange"}static getRequiredDataPoints(t){return Math.max(t+1,2)}static interpolateOrderZero(t,n,i,r,o){l(o)||(o=new Array(r));let s,a,c=n.length;for(s=0;s<r;s++)o[s]=0;for(s=0;s<c;s++){let u=1;for(a=0;a<c;a++)if(a!==s){let f=n[s]-n[a];u*=(t-n[a])/f}for(a=0;a<r;a++)o[a]+=u*i[s*r+a]}return o}},Vk=zee;var Vee=class{static get type(){return"Linear"}static getRequiredDataPoints(t){return 2}static interpolateOrderZero(t,n,i,r,o){l(o)||(o=new Array(r));let s,a,c,u=n[0],f=n[1];for(s=0;s<r;s++)a=i[s],c=i[s+r],o[s]=((c-a)*t+f*a-u*c)/(f-u);return o}},KA=Vee;function Al(e,t,n){this.clock=e??0,this.cone=t??0,this.magnitude=n??1}Al.fromCartesian3=function(e,t){let n=e.x,i=e.y,r=e.z,o=n*n+i*i;return l(t)||(t=new Al),t.clock=Math.atan2(i,n),t.cone=Math.atan2(Math.sqrt(o),r),t.magnitude=Math.sqrt(o+r*r),t};Al.clone=function(e,t){if(l(e))return l(t)?(t.clock=e.clock,t.cone=e.cone,t.magnitude=e.magnitude,t):new Al(e.clock,e.cone,e.magnitude)};Al.normalize=function(e,t){return l(t)?(t.clock=e.clock,t.cone=e.cone,t.magnitude=1,t):new Al(e.clock,e.cone,1)};Al.equals=function(e,t){return e===t||l(e)&&l(t)&&e.clock===t.clock&&e.cone===t.cone&&e.magnitude===t.magnitude};Al.equalsEpsilon=function(e,t,n){return n=n??0,e===t||l(e)&&l(t)&&Math.abs(e.clock-t.clock)<=n&&Math.abs(e.cone-t.cone)<=n&&Math.abs(e.magnitude-t.magnitude)<=n};Al.prototype.equals=function(e){return Al.equals(this,e)};Al.prototype.clone=function(e){return Al.clone(this,e)};Al.prototype.equalsEpsilon=function(e,t){return Al.equalsEpsilon(this,e,t)};Al.prototype.toString=function(){return`(${this.clock}, ${this.cone}, ${this.magnitude})`};var jk=Al;var Yk=Qo(Tf(),1);var jee;typeof performance<"u"&&typeof performance.now=="function"&&isFinite(performance.now())?jee=function(){return performance.now()}:jee=function(){return Date.now()};var xn=jee;function Hee(e){e=e??H.EMPTY_OBJECT;let t=e.currentTime,n=e.startTime,i=e.stopTime;l(t)?t=K.clone(t):l(n)?t=K.clone(n):l(i)?t=K.addDays(i,-1,new K):t=K.now(),l(n)?n=K.clone(n):n=K.clone(t),l(i)?i=K.clone(i):i=K.addDays(n,1,new K),this.startTime=n,this.stopTime=i,this.clockRange=e.clockRange??Rs.UNBOUNDED,this.canAnimate=e.canAnimate??!0,this.onTick=new be,this.onStop=new be,this._currentTime=void 0,this._multiplier=void 0,this._clockStep=void 0,this._shouldAnimate=void 0,this._lastSystemTime=xn(),this.currentTime=t,this.multiplier=e.multiplier??1,this.shouldAnimate=e.shouldAnimate??!1,this.clockStep=e.clockStep??Vr.SYSTEM_CLOCK_MULTIPLIER}Object.defineProperties(Hee.prototype,{currentTime:{get:function(){return this._currentTime},set:function(e){K.equals(this._currentTime,e)||(this._clockStep===Vr.SYSTEM_CLOCK&&(this._clockStep=Vr.SYSTEM_CLOCK_MULTIPLIER),this._currentTime=e)}},multiplier:{get:function(){return this._multiplier},set:function(e){this._multiplier!==e&&(this._clockStep===Vr.SYSTEM_CLOCK&&(this._clockStep=Vr.SYSTEM_CLOCK_MULTIPLIER),this._multiplier=e)}},clockStep:{get:function(){return this._clockStep},set:function(e){e===Vr.SYSTEM_CLOCK&&(this._multiplier=1,this._shouldAnimate=!0,this._currentTime=K.now()),this._clockStep=e}},shouldAnimate:{get:function(){return this._shouldAnimate},set:function(e){this._shouldAnimate!==e&&(this._clockStep===Vr.SYSTEM_CLOCK&&(this._clockStep=Vr.SYSTEM_CLOCK_MULTIPLIER),this._shouldAnimate=e)}}});Hee.prototype.tick=function(){let e=xn(),t=K.clone(this._currentTime);if(this.canAnimate&&this._shouldAnimate){let n=this._clockStep;if(n===Vr.SYSTEM_CLOCK)t=K.now(t);else{let i=this._multiplier;if(n===Vr.TICK_DEPENDENT)t=K.addSeconds(t,i,t);else{let a=e-this._lastSystemTime;t=K.addSeconds(t,i*(a/1e3),t)}let r=this.clockRange,o=this.startTime,s=this.stopTime;if(r===Rs.CLAMPED)K.lessThan(t,o)?t=K.clone(o,t):K.greaterThan(t,s)&&(t=K.clone(s,t),this.onStop.raiseEvent(this));else if(r===Rs.LOOP_STOP)for(K.lessThan(t,o)&&(t=K.clone(o,t));K.greaterThan(t,s);)t=K.addSeconds(o,K.secondsDifference(t,s),t),this.onStop.raiseEvent(this)}}return this._currentTime=t,this._lastSystemTime=e,this.onTick.raiseEvent(this),t};var Lm=Hee;function rE(){this._definitionChanged=new be,this._startTime=void 0,this._stopTime=void 0,this._currentTime=void 0,this._clockRange=void 0,this._clockStep=void 0,this._multiplier=void 0}Object.defineProperties(rE.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},startTime:Kl("startTime"),stopTime:Kl("stopTime"),currentTime:Kl("currentTime"),clockRange:Kl("clockRange"),clockStep:Kl("clockStep"),multiplier:Kl("multiplier")});rE.prototype.clone=function(e){return l(e)||(e=new rE),e.startTime=this.startTime,e.stopTime=this.stopTime,e.currentTime=this.currentTime,e.clockRange=this.clockRange,e.clockStep=this.clockStep,e.multiplier=this.multiplier,e};rE.prototype.equals=function(e){return this===e||l(e)&&K.equals(this.startTime,e.startTime)&&K.equals(this.stopTime,e.stopTime)&&K.equals(this.currentTime,e.currentTime)&&this.clockRange===e.clockRange&&this.clockStep===e.clockStep&&this.multiplier===e.multiplier};rE.prototype.merge=function(e){this.startTime=this.startTime??e.startTime,this.stopTime=this.stopTime??e.stopTime,this.currentTime=this.currentTime??e.currentTime,this.clockRange=this.clockRange??e.clockRange,this.clockStep=this.clockStep??e.clockStep,this.multiplier=this.multiplier??e.multiplier};rE.prototype.getValue=function(e){return l(e)||(e=new Lm),e.startTime=this.startTime??e.startTime,e.stopTime=this.stopTime??e.stopTime,e.currentTime=this.currentTime??e.currentTime,e.clockRange=this.clockRange??e.clockRange,e.multiplier=this.multiplier??e.multiplier,e.clockStep=this.clockStep??e.clockStep,e};var Fm=rE;var kgt=z.WHITE,Ugt=.1,zgt=new U(8,8),Vgt=new U(0,0),jgt=new U(1,1);function Nw(e){e=e??H.EMPTY_OBJECT,this._definitionChanged=new be,this._color=void 0,this._colorSubscription=void 0,this._cellAlpha=void 0,this._cellAlphaSubscription=void 0,this._lineCount=void 0,this._lineCountSubscription=void 0,this._lineThickness=void 0,this._lineThicknessSubscription=void 0,this._lineOffset=void 0,this._lineOffsetSubscription=void 0,this.color=e.color,this.cellAlpha=e.cellAlpha,this.lineCount=e.lineCount,this.lineThickness=e.lineThickness,this.lineOffset=e.lineOffset}Object.defineProperties(Nw.prototype,{isConstant:{get:function(){return X.isConstant(this._color)&&X.isConstant(this._cellAlpha)&&X.isConstant(this._lineCount)&&X.isConstant(this._lineThickness)&&X.isConstant(this._lineOffset)}},definitionChanged:{get:function(){return this._definitionChanged}},color:me("color"),cellAlpha:me("cellAlpha"),lineCount:me("lineCount"),lineThickness:me("lineThickness"),lineOffset:me("lineOffset")});Nw.prototype.getType=function(e){return"Grid"};var Hgt=new K;Nw.prototype.getValue=function(e,t){return l(e)||(e=K.now(Hgt)),l(t)||(t={}),t.color=X.getValueOrClonedDefault(this._color,e,kgt,t.color),t.cellAlpha=X.getValueOrDefault(this._cellAlpha,e,Ugt),t.lineCount=X.getValueOrClonedDefault(this._lineCount,e,zgt,t.lineCount),t.lineThickness=X.getValueOrClonedDefault(this._lineThickness,e,jgt,t.lineThickness),t.lineOffset=X.getValueOrClonedDefault(this._lineOffset,e,Vgt,t.lineOffset),t};Nw.prototype.equals=function(e){return this===e||e instanceof Nw&&X.equals(this._color,e._color)&&X.equals(this._cellAlpha,e._cellAlpha)&&X.equals(this._lineCount,e._lineCount)&&X.equals(this._lineThickness,e._lineThickness)&&X.equals(this._lineOffset,e._lineOffset)};var Lw=Nw;var fve={WHOLE:0,PORTIONS:1};Object.freeze(fve);var a0=fve;function Fw(e){this._definitionChanged=new be,this._color=void 0,this._colorSubscription=void 0,this.color=e}Object.defineProperties(Fw.prototype,{isConstant:{get:function(){return X.isConstant(this._color)}},definitionChanged:{get:function(){return this._definitionChanged}},color:me("color")});Fw.prototype.getType=function(e){return"PolylineArrow"};var Ggt=new K;Fw.prototype.getValue=function(e,t){return l(e)||(e=K.now(Ggt)),l(t)||(t={}),t.color=X.getValueOrClonedDefault(this._color,e,z.WHITE,t.color),t};Fw.prototype.equals=function(e){return this===e||e instanceof Fw&&X.equals(this._color,e._color)};var Bw=Fw;var Wgt=z.WHITE,qgt=z.TRANSPARENT,Ygt=16,Xgt=255;function kw(e){e=e??H.EMPTY_OBJECT,this._definitionChanged=new be,this._color=void 0,this._colorSubscription=void 0,this._gapColor=void 0,this._gapColorSubscription=void 0,this._dashLength=void 0,this._dashLengthSubscription=void 0,this._dashPattern=void 0,this._dashPatternSubscription=void 0,this.color=e.color,this.gapColor=e.gapColor,this.dashLength=e.dashLength,this.dashPattern=e.dashPattern}Object.defineProperties(kw.prototype,{isConstant:{get:function(){return X.isConstant(this._color)&&X.isConstant(this._gapColor)&&X.isConstant(this._dashLength)&&X.isConstant(this._dashPattern)}},definitionChanged:{get:function(){return this._definitionChanged}},color:me("color"),gapColor:me("gapColor"),dashLength:me("dashLength"),dashPattern:me("dashPattern")});kw.prototype.getType=function(e){return"PolylineDash"};var Kgt=new K;kw.prototype.getValue=function(e,t){return l(e)||(e=K.now(Kgt)),l(t)||(t={}),t.color=X.getValueOrClonedDefault(this._color,e,Wgt,t.color),t.gapColor=X.getValueOrClonedDefault(this._gapColor,e,qgt,t.gapColor),t.dashLength=X.getValueOrDefault(this._dashLength,e,Ygt,t.dashLength),t.dashPattern=X.getValueOrDefault(this._dashPattern,e,Xgt,t.dashPattern),t};kw.prototype.equals=function(e){return this===e||e instanceof kw&&X.equals(this._color,e._color)&&X.equals(this._gapColor,e._gapColor)&&X.equals(this._dashLength,e._dashLength)&&X.equals(this._dashPattern,e._dashPattern)};var Uw=kw;var $gt=z.WHITE,Jgt=.25,Zgt=1;function zw(e){e=e??H.EMPTY_OBJECT,this._definitionChanged=new be,this._color=void 0,this._colorSubscription=void 0,this._glowPower=void 0,this._glowPowerSubscription=void 0,this._taperPower=void 0,this._taperPowerSubscription=void 0,this.color=e.color,this.glowPower=e.glowPower,this.taperPower=e.taperPower}Object.defineProperties(zw.prototype,{isConstant:{get:function(){return X.isConstant(this._color)&&X.isConstant(this._glow)}},definitionChanged:{get:function(){return this._definitionChanged}},color:me("color"),glowPower:me("glowPower"),taperPower:me("taperPower")});zw.prototype.getType=function(e){return"PolylineGlow"};var Qgt=new K;zw.prototype.getValue=function(e,t){return l(e)||(e=K.now(Qgt)),l(t)||(t={}),t.color=X.getValueOrClonedDefault(this._color,e,$gt,t.color),t.glowPower=X.getValueOrDefault(this._glowPower,e,Jgt,t.glowPower),t.taperPower=X.getValueOrDefault(this._taperPower,e,Zgt,t.taperPower),t};zw.prototype.equals=function(e){return this===e||e instanceof zw&&X.equals(this._color,e._color)&&X.equals(this._glowPower,e._glowPower)&&X.equals(this._taperPower,e._taperPower)};var Vw=zw;var e_t=z.WHITE,t_t=z.BLACK,n_t=1;function jw(e){e=e??H.EMPTY_OBJECT,this._definitionChanged=new be,this._color=void 0,this._colorSubscription=void 0,this._outlineColor=void 0,this._outlineColorSubscription=void 0,this._outlineWidth=void 0,this._outlineWidthSubscription=void 0,this.color=e.color,this.outlineColor=e.outlineColor,this.outlineWidth=e.outlineWidth}Object.defineProperties(jw.prototype,{isConstant:{get:function(){return X.isConstant(this._color)&&X.isConstant(this._outlineColor)&&X.isConstant(this._outlineWidth)}},definitionChanged:{get:function(){return this._definitionChanged}},color:me("color"),outlineColor:me("outlineColor"),outlineWidth:me("outlineWidth")});jw.prototype.getType=function(e){return"PolylineOutline"};var i_t=new K;jw.prototype.getValue=function(e,t){return l(e)||(e=K.now(i_t)),l(t)||(t={}),t.color=X.getValueOrClonedDefault(this._color,e,e_t,t.color),t.outlineColor=X.getValueOrClonedDefault(this._outlineColor,e,t_t,t.outlineColor),t.outlineWidth=X.getValueOrDefault(this._outlineWidth,e,n_t),t};jw.prototype.equals=function(e){return this===e||e instanceof jw&&X.equals(this._color,e._color)&&X.equals(this._outlineColor,e._outlineColor)&&X.equals(this._outlineWidth,e._outlineWidth)};var $A=jw;function P_(e,t){this._value=void 0,this._definitionChanged=new be,this._eventHelper=new Xo,this._referenceFrame=t??ji.FIXED,this.setValue(e)}Object.defineProperties(P_.prototype,{isConstant:{get:function(){let e=this._value;if(!l(e))return!0;let t=e.length;for(let n=0;n<t;n++)if(!X.isConstant(e[n]))return!1;return!0}},definitionChanged:{get:function(){return this._definitionChanged}},referenceFrame:{get:function(){return this._referenceFrame}}});var r_t=new K;P_.prototype.getValue=function(e,t){return l(e)||(e=K.now(r_t)),this.getValueInReferenceFrame(e,ji.FIXED,t)};P_.prototype.getValueInReferenceFrame=function(e,t,n){let i=this._value;if(!l(i))return;let r=i.length;l(n)||(n=new Array(r));let o=0,s=0;for(;o<r;){let c=i[o].getValueInReferenceFrame(e,t,n[o]);l(c)&&(n[s]=c,s++),o++}return n.length=s,n};P_.prototype.setValue=function(e){let t=this._eventHelper;if(t.removeAll(),l(e)){this._value=e.slice();let n=e.length;for(let i=0;i<n;i++){let r=e[i];l(r)&&t.add(r.definitionChanged,P_.prototype._raiseDefinitionChanged,this)}}else this._value=void 0;this._definitionChanged.raiseEvent(this)};P_.prototype.equals=function(e){return this===e||e instanceof P_&&this._referenceFrame===e._referenceFrame&&X.arrayEquals(this._value,e._value)};P_.prototype._raiseDefinitionChanged=function(){this._definitionChanged.raiseEvent(this)};var D_=P_;function JA(e){this._value=void 0,this._definitionChanged=new be,this._eventHelper=new Xo,this.setValue(e)}Object.defineProperties(JA.prototype,{isConstant:{get:function(){let e=this._value;if(!l(e))return!0;let t=e.length;for(let n=0;n<t;n++)if(!X.isConstant(e[n]))return!1;return!0}},definitionChanged:{get:function(){return this._definitionChanged}}});var o_t=new K;JA.prototype.getValue=function(e,t){l(e)||(e=K.now(o_t));let n=this._value;if(!l(n))return;let i=n.length;l(t)||(t=new Array(i));let r=0,o=0;for(;r<i;){let a=this._value[r].getValue(e,t[r]);l(a)&&(t[o]=a,o++),r++}return t.length=o,t};JA.prototype.setValue=function(e){let t=this._eventHelper;if(t.removeAll(),l(e)){this._value=e.slice();let n=e.length;for(let i=0;i<n;i++){let r=e[i];l(r)&&t.add(r.definitionChanged,JA.prototype._raiseDefinitionChanged,this)}}else this._value=void 0;this._definitionChanged.raiseEvent(this)};JA.prototype.equals=function(e){return this===e||e instanceof JA&&X.arrayEquals(this._value,e._value)};JA.prototype._raiseDefinitionChanged=function(){this._definitionChanged.raiseEvent(this)};var Hw=JA;function oE(e){let t=e._targetProperty;if(!l(t)){let n=e._targetEntity;if(!l(n)){if(n=e._targetCollection.getById(e._targetId),!l(n)){e._targetEntity=e._targetProperty=void 0;return}n.definitionChanged.addEventListener(Zf.prototype._onTargetEntityDefinitionChanged,e),e._targetEntity=n}let i=e._targetPropertyNames;t=e._targetEntity;for(let r=0,o=i.length;r<o&&l(t);++r)t=t[i[r]];e._targetProperty=t}return t}function Zf(e,t,n){this._targetCollection=e,this._targetId=t,this._targetPropertyNames=n,this._targetProperty=void 0,this._targetEntity=void 0,this._definitionChanged=new be,e.collectionChanged.addEventListener(Zf.prototype._onCollectionChanged,this)}Object.defineProperties(Zf.prototype,{isConstant:{get:function(){return X.isConstant(oE(this))}},definitionChanged:{get:function(){return this._definitionChanged}},referenceFrame:{get:function(){let e=oE(this);return l(e)?e.referenceFrame:void 0}},targetId:{get:function(){return this._targetId}},targetCollection:{get:function(){return this._targetCollection}},targetPropertyNames:{get:function(){return this._targetPropertyNames}},resolvedProperty:{get:function(){return oE(this)}}});Zf.fromString=function(e,t){let n,i=[],r=!0,o=!1,s="";for(let a=0;a<t.length;++a){let c=t.charAt(a);o?(s+=c,o=!1):c==="\\"?o=!0:r&&c==="#"?(n=s,r=!1,s=""):!r&&c==="."?(i.push(s),s=""):s+=c}return i.push(s),new Zf(e,n,i)};var s_t=new K;Zf.prototype.getValue=function(e,t){let n=oE(this);return l(e)||(e=K.now(s_t)),l(n)?n.getValue(e,t):void 0};Zf.prototype.getValueInReferenceFrame=function(e,t,n){let i=oE(this);return l(i)?i.getValueInReferenceFrame(e,t,n):void 0};Zf.prototype.getType=function(e){let t=oE(this);return l(t)?t.getType(e):void 0};Zf.prototype.equals=function(e){if(this===e)return!0;let t=this._targetPropertyNames,n=e._targetPropertyNames;if(this._targetCollection!==e._targetCollection||this._targetId!==e._targetId||t.length!==n.length)return!1;let i=this._targetPropertyNames.length;for(let r=0;r<i;r++)if(t[r]!==n[r])return!1;return!0};Zf.prototype._onTargetEntityDefinitionChanged=function(e,t,n,i){l(this._targetProperty)&&this._targetPropertyNames[0]===t&&(this._targetProperty=void 0,this._definitionChanged.raiseEvent(this))};Zf.prototype._onCollectionChanged=function(e,t,n){let i=this._targetEntity;l(i)&&n.indexOf(i)!==-1?(i.definitionChanged.removeEventListener(Zf.prototype._onTargetEntityDefinitionChanged,this),this._targetEntity=this._targetProperty=void 0):l(i)||(i=oE(this),l(i)&&this._definitionChanged.raiseEvent(this))};var R_=Zf;var a_t={packedLength:1,pack:function(e,t,n){return n=n??0,t[n]=e,t},unpack:function(e,t,n){return t=t??0,e[t]},convertPackedArrayForInterpolation:function(e,t,n,i){l(i)||(i=[]),t=t??0,n=n??e.length;let r;for(let o=0,s=n-t+1;o<s;o++){let a=e[t+o];o===0||Math.abs(r-a)<Math.PI?i[o]=a:i[o]=a-D.TWO_PI,r=a}},unpackInterpolationResult:function(e,t,n,i,r){return r=e[0],r<0?r+D.TWO_PI:r}},lh=a_t;var dve={packedLength:1,pack:function(e,t,n){n=n??0,t[n]=e},unpack:function(e,t,n){return t=t??0,e[t]}};function hve(e,t,n){let i,r=e.length,o=n.length,s=r+o;if(e.length=s,r!==t){let a=r-1;for(i=s-1;i>=t;i--)e[i]=e[a--]}for(i=0;i<o;i++)e[t++]=n[i]}function mve(e,t){return e instanceof K?e:typeof e=="string"?K.fromIso8601(e):K.addSeconds(t,e,new K)}var Gee=[],Wee=[];function SG(e,t,n,i,r){let o=0,s,a,c,u,f,d;for(;o<i.length;){f=mve(i[o],e),c=vr(t,f,K.compare);let p=0,g=0;if(c<0){for(c=~c,u=c*r,a=void 0,d=t[c];o<i.length&&(f=mve(i[o],e),!(l(a)&&K.compare(a,f)>=0||l(d)&&K.compare(f,d)>=0));){for(Gee[p++]=f,o=o+1,s=0;s<r;s++)Wee[g++]=i[o],o=o+1;a=f}p>0&&(Wee.length=g,hve(n,u,Wee),Gee.length=p,hve(t,c,Gee))}else{for(s=0;s<r;s++)o++,n[c*r+s]=i[o];o++}}}function uh(e,t){let n=e;n===Number&&(n=dve);let i=n.packedLength,r=n.packedInterpolationLength??i,o=0,s;if(l(t)){let a=t.length;s=new Array(a);for(let c=0;c<a;c++){let u=t[c];u===Number&&(u=dve);let f=u.packedLength;i+=f,r+=u.packedInterpolationLength??f,s[c]=u}o=a}this._type=e,this._innerType=n,this._interpolationDegree=1,this._interpolationAlgorithm=KA,this._lastInterpolationAlgorithm=KA,this._numberOfPoints=0,this._times=[],this._values=[],this._xTable=[],this._yTable=[],this._packedLength=i,this._packedInterpolationLength=r,this._updateTableLength=!0,this._interpolationResult=new Array(r),this._definitionChanged=new be,this._derivativeTypes=t,this._innerDerivativeTypes=s,this._inputOrder=o,this._forwardExtrapolationType=fu.NONE,this._forwardExtrapolationDuration=0,this._backwardExtrapolationType=fu.NONE,this._backwardExtrapolationDuration=0}Object.defineProperties(uh.prototype,{isConstant:{get:function(){return this._values.length===0}},definitionChanged:{get:function(){return this._definitionChanged}},type:{get:function(){return this._type}},derivativeTypes:{get:function(){return this._derivativeTypes}},interpolationDegree:{get:function(){return this._interpolationDegree}},interpolationAlgorithm:{get:function(){return this._interpolationAlgorithm}},forwardExtrapolationType:{get:function(){return this._forwardExtrapolationType},set:function(e){this._forwardExtrapolationType!==e&&(this._forwardExtrapolationType=e,this._definitionChanged.raiseEvent(this))}},forwardExtrapolationDuration:{get:function(){return this._forwardExtrapolationDuration},set:function(e){this._forwardExtrapolationDuration!==e&&(this._forwardExtrapolationDuration=e,this._definitionChanged.raiseEvent(this))}},backwardExtrapolationType:{get:function(){return this._backwardExtrapolationType},set:function(e){this._backwardExtrapolationType!==e&&(this._backwardExtrapolationType=e,this._definitionChanged.raiseEvent(this))}},backwardExtrapolationDuration:{get:function(){return this._backwardExtrapolationDuration},set:function(e){this._backwardExtrapolationDuration!==e&&(this._backwardExtrapolationDuration=e,this._definitionChanged.raiseEvent(this))}}});var c_t=new K;uh.prototype.getValue=function(e,t){l(e)||(e=K.now(c_t));let n=this._times,i=n.length;if(i===0)return;let r,o=this._innerType,s=this._values,a=vr(n,e,K.compare);var c=!1;if(a<0){if(a=~a,a===0){let S=n[a];if(r=this._backwardExtrapolationDuration,this._backwardExtrapolationType===fu.NONE||r!==0&&K.secondsDifference(S,e)>r)return;if(this._backwardExtrapolationType===fu.HOLD)return o.unpack(s,0,t);c=this._backwardExtrapolationType===fu.LINEAR_EXTRAPOLATE}if(a>=i){a=i-1;let S=n[a];if(r=this._forwardExtrapolationDuration,this._forwardExtrapolationType===fu.NONE||r!==0&&K.secondsDifference(e,S)>r)return;if(this._forwardExtrapolationType===fu.HOLD)return a=i-1,o.unpack(s,a*o.packedLength,t);c=this._forwardExtrapolationType===fu.LINEAR_EXTRAPOLATE}let d=this._xTable,p=this._yTable;var u,f;c?(u=Cesium.LinearApproximation,f=1):(u=this._interpolationAlgorithm,f=this._interpolationDegree),this._lastInterpolationAlgorithm!=u&&(this._lastInterpolationAlgorithm=u,this._updateTableLength=!0);let g=this._packedInterpolationLength,m=this._inputOrder;if(this._updateTableLength){this._updateTableLength=!1;let S=Math.min(u.getRequiredDataPoints(f,m),i);S!==this._numberOfPoints&&(this._numberOfPoints=S,d.length=S,p.length=S*g)}let y=this._numberOfPoints-1;if(y<1)return;let A=0,b=i-1;if(b-A+1>=y+1){let S=a-(y/2|0)-1;S<A&&(S=A);let I=S+y;I>b&&(I=b,S=I-y,S<A&&(S=A)),A=S,b=I}let T=b-A+1;for(let S=0;S<T;++S)d[S]=K.secondsDifference(n[A+S],n[b]);if(l(o.convertPackedArrayForInterpolation))o.convertPackedArrayForInterpolation(s,A,b,p);else{let S=0,I=this._packedLength,R=A*I,O=(b+1)*I;for(;R<O;)p[S]=s[R],R++,S++}let E=K.secondsDifference(e,n[b]),v;if(m===0||!l(u.interpolate))v=u.interpolateOrderZero(E,d,p,g,this._interpolationResult);else{let S=Math.floor(g/(m+1));v=u.interpolate(E,d,p,S,m,m,this._interpolationResult)}return l(o.unpackInterpolationResult)?o.unpackInterpolationResult(v,s,A,b,t):o.unpack(v,0,t)}return o.unpack(s,a*this._packedLength,t)};uh.prototype.setInterpolationOptions=function(e){if(!l(e))return;let t=!1,n=e.interpolationAlgorithm,i=e.interpolationDegree;l(n)&&this._interpolationAlgorithm!==n&&(this._interpolationAlgorithm=n,t=!0),l(i)&&this._interpolationDegree!==i&&(this._interpolationDegree=i,t=!0),t&&(this._updateTableLength=!0,this._definitionChanged.raiseEvent(this))};uh.prototype.addSample=function(e,t,n){let i=this._innerDerivativeTypes,r=l(i),o=this._innerType,s=[];if(s.push(e),o.pack(t,s,s.length),r){let a=i.length;for(let c=0;c<a;c++)i[c].pack(n[c],s,s.length)}SG(void 0,this._times,this._values,s,this._packedLength),this._updateTableLength=!0,this._definitionChanged.raiseEvent(this)};uh.prototype.addSamples=function(e,t,n){let i=this._innerDerivativeTypes,r=l(i),o=this._innerType,s=e.length,a=[];for(let c=0;c<s;c++)if(a.push(e[c]),o.pack(t[c],a,a.length),r){let u=n[c],f=i.length;for(let d=0;d<f;d++)i[d].pack(u[d],a,a.length)}SG(void 0,this._times,this._values,a,this._packedLength),this._updateTableLength=!0,this._definitionChanged.raiseEvent(this)};uh.prototype.getSample=function(e){let t=this._times,n=t.length;if(l(n))return e<0&&(e+=n),t[e]};uh.prototype.addSamplesPackedArray=function(e,t){SG(t,this._times,this._values,e,this._packedLength),this._updateTableLength=!0,this._definitionChanged.raiseEvent(this)};uh.prototype.removeSample=function(e){let t=vr(this._times,e,K.compare);return t<0?!1:(pve(this,t,1),!0)};function pve(e,t,n){let i=e._packedLength;e._times.splice(t,n),e._values.splice(t*i,n*i),e._updateTableLength=!0,e._definitionChanged.raiseEvent(e)}uh.prototype.removeSamples=function(e){let t=this._times,n=vr(t,e.start,K.compare);n<0?n=~n:e.isStartIncluded||++n;let i=vr(t,e.stop,K.compare);i<0?i=~i:e.isStopIncluded&&++i,pve(this,n,i-n)};uh.prototype.equals=function(e){if(this===e)return!0;if(!l(e)||this._type!==e._type||this._interpolationDegree!==e._interpolationDegree||this._interpolationAlgorithm!==e._interpolationAlgorithm)return!1;let t=this._derivativeTypes,n=l(t),i=e._derivativeTypes,r=l(i);if(n!==r)return!1;let o,s;if(n){if(s=t.length,s!==i.length)return!1;for(o=0;o<s;o++)if(t[o]!==i[o])return!1}let a=this._times,c=e._times;if(s=a.length,s!==c.length)return!1;for(o=0;o<s;o++)if(!K.equals(a[o],c[o]))return!1;let u=this._values,f=e._values;for(s=u.length,o=0;o<s;o++)if(u[o]!==f[o])return!1;return!0};uh._mergeNewSamples=SG;var Qf=uh;function fh(e,t){t=t??0;let n;if(t>0){n=new Array(t);for(let i=0;i<t;i++)n[i]=h}this._numberOfDerivatives=t,this._property=new Qf(h,n),this._definitionChanged=new be,this._referenceFrame=e??ji.FIXED,this._property._definitionChanged.addEventListener(function(){this._definitionChanged.raiseEvent(this)},this)}Object.defineProperties(fh.prototype,{isConstant:{get:function(){return this._property.isConstant}},definitionChanged:{get:function(){return this._definitionChanged}},referenceFrame:{get:function(){return this._referenceFrame}},interpolationDegree:{get:function(){return this._property.interpolationDegree}},interpolationAlgorithm:{get:function(){return this._property.interpolationAlgorithm}},numberOfDerivatives:{get:function(){return this._numberOfDerivatives}},forwardExtrapolationType:{get:function(){return this._property.forwardExtrapolationType},set:function(e){this._property.forwardExtrapolationType=e}},forwardExtrapolationDuration:{get:function(){return this._property.forwardExtrapolationDuration},set:function(e){this._property.forwardExtrapolationDuration=e}},backwardExtrapolationType:{get:function(){return this._property.backwardExtrapolationType},set:function(e){this._property.backwardExtrapolationType=e}},backwardExtrapolationDuration:{get:function(){return this._property.backwardExtrapolationDuration},set:function(e){this._property.backwardExtrapolationDuration=e}}});var l_t=new K;fh.prototype.getValue=function(e,t){return l(e)||(e=K.now(l_t)),this.getValueInReferenceFrame(e,ji.FIXED,t)};fh.prototype.getValueInReferenceFrame=function(e,t,n){if(n=this._property.getValue(e,n),l(n))return Zh.convertToReferenceFrame(e,n,this._referenceFrame,t,n)};fh.prototype.setInterpolationOptions=function(e){this._property.setInterpolationOptions(e)};fh.prototype.addSample=function(e,t,n){let i=this._numberOfDerivatives;this._property.addSample(e,t,n)};fh.prototype.addSamples=function(e,t,n){this._property.addSamples(e,t,n)};fh.prototype.addSamplesPackedArray=function(e,t){this._property.addSamplesPackedArray(e,t)};fh.prototype.removeSample=function(e){return this._property.removeSample(e)};fh.prototype.removeSamples=function(e){this._property.removeSamples(e)};fh.prototype.equals=function(e){return this===e||e instanceof fh&&X.equals(this._property,e._property)&&this._referenceFrame===e._referenceFrame};var _c=fh;var gve={HORIZONTAL:0,VERTICAL:1};Object.freeze(gve);var Bm=gve;var u_t=Bm.HORIZONTAL,f_t=z.WHITE,d_t=z.BLACK,h_t=0,m_t=1;function Gw(e){e=e??H.EMPTY_OBJECT,this._definitionChanged=new be,this._orientation=void 0,this._orientationSubscription=void 0,this._evenColor=void 0,this._evenColorSubscription=void 0,this._oddColor=void 0,this._oddColorSubscription=void 0,this._offset=void 0,this._offsetSubscription=void 0,this._repeat=void 0,this._repeatSubscription=void 0,this.orientation=e.orientation,this.evenColor=e.evenColor,this.oddColor=e.oddColor,this.offset=e.offset,this.repeat=e.repeat}Object.defineProperties(Gw.prototype,{isConstant:{get:function(){return X.isConstant(this._orientation)&&X.isConstant(this._evenColor)&&X.isConstant(this._oddColor)&&X.isConstant(this._offset)&&X.isConstant(this._repeat)}},definitionChanged:{get:function(){return this._definitionChanged}},orientation:me("orientation"),evenColor:me("evenColor"),oddColor:me("oddColor"),offset:me("offset"),repeat:me("repeat")});Gw.prototype.getType=function(e){return"Stripe"};var p_t=new K;Gw.prototype.getValue=function(e,t){return l(e)||(e=K.now(p_t)),l(t)||(t={}),t.horizontal=X.getValueOrDefault(this._orientation,e,u_t)===Bm.HORIZONTAL,t.evenColor=X.getValueOrClonedDefault(this._evenColor,e,f_t,t.evenColor),t.oddColor=X.getValueOrClonedDefault(this._oddColor,e,d_t,t.oddColor),t.offset=X.getValueOrDefault(this._offset,e,h_t),t.repeat=X.getValueOrDefault(this._repeat,e,m_t),t};Gw.prototype.equals=function(e){return this===e||e instanceof Gw&&X.equals(this._orientation,e._orientation)&&X.equals(this._evenColor,e._evenColor)&&X.equals(this._oddColor,e._oddColor)&&X.equals(this._offset,e._offset)&&X.equals(this._repeat,e._repeat)};var Ww=Gw;function ZA(e){this._definitionChanged=new be,this._intervals=new Ps,this._intervals.changedEvent.addEventListener(ZA.prototype._intervalsChanged,this),this._referenceFrame=e??ji.FIXED}Object.defineProperties(ZA.prototype,{isConstant:{get:function(){return this._intervals.isEmpty}},definitionChanged:{get:function(){return this._definitionChanged}},intervals:{get:function(){return this._intervals}},referenceFrame:{get:function(){return this._referenceFrame}}});var g_t=new K;ZA.prototype.getValue=function(e,t){return l(e)||(e=K.now(g_t)),this.getValueInReferenceFrame(e,ji.FIXED,t)};ZA.prototype.getValueInReferenceFrame=function(e,t,n){let i=this._intervals.findDataForIntervalContainingDate(e);if(l(i))return Zh.convertToReferenceFrame(e,i,this._referenceFrame,t,n)};ZA.prototype.equals=function(e){return this===e||e instanceof ZA&&this._intervals.equals(e._intervals,X.equals)&&this._referenceFrame===e._referenceFrame};ZA.prototype._intervalsChanged=function(){this._definitionChanged.raiseEvent(this)};var O_=ZA;function sE(){this._definitionChanged=new be,this._intervals=new Ps,this._intervals.changedEvent.addEventListener(sE.prototype._intervalsChanged,this)}Object.defineProperties(sE.prototype,{isConstant:{get:function(){return this._intervals.isEmpty}},definitionChanged:{get:function(){return this._definitionChanged}},intervals:{get:function(){return this._intervals}}});var __t=new K;sE.prototype.getValue=function(e,t){l(e)||(e=K.now(__t));let n=this._intervals.findDataForIntervalContainingDate(e);return l(n)&&typeof n.clone=="function"?n.clone(t):n};sE.prototype.equals=function(e){return this===e||e instanceof sE&&this._intervals.equals(e._intervals,X.equals)};sE.prototype._intervalsChanged=function(){this._definitionChanged.raiseEvent(this)};var M_=sE;function qw(e,t){this._position=void 0,this._subscription=void 0,this._definitionChanged=new be,this._normalize=t??!0,this.position=e}Object.defineProperties(qw.prototype,{isConstant:{get:function(){return X.isConstant(this._position)}},definitionChanged:{get:function(){return this._definitionChanged}},position:{get:function(){return this._position},set:function(e){let t=this._position;t!==e&&(l(t)&&this._subscription(),this._position=e,l(e)&&(this._subscription=e._definitionChanged.addEventListener(function(){this._definitionChanged.raiseEvent(this)},this)),this._definitionChanged.raiseEvent(this))}},normalize:{get:function(){return this._normalize},set:function(e){this._normalize!==e&&(this._normalize=e,this._definitionChanged.raiseEvent(this))}}});var y_t=new h,_ve=new h,yve=new K,A_t=new K,qee=1/60;qw.prototype.getValue=function(e,t){return this._getValue(e,t)};qw.prototype._getValue=function(e,t,n){l(e)||(e=K.now(A_t)),l(t)||(t=new h);let i=this._position;if(X.isConstant(i))return this._normalize?void 0:h.clone(h.ZERO,t);let r=i.getValue(e,y_t),o=i.getValue(K.addSeconds(e,qee,yve),_ve);if(!l(r)||!l(o)&&(o=r,r=i.getValue(K.addSeconds(e,-qee,yve),_ve),!l(r)))return;if(h.equals(r,o))return this._normalize?void 0:h.clone(h.ZERO,t);l(n)&&r.clone(n);let s=h.subtract(o,r,t);return this._normalize?h.normalize(s,t):h.divideByScalar(s,qee,t)};qw.prototype.equals=function(e){return this===e||e instanceof qw&&X.equals(this._position,e._position)};var N_=qw;function Hk(e,t){this._velocityVectorProperty=new N_(e,!0),this._subscription=void 0,this._ellipsoid=void 0,this._definitionChanged=new be,this.ellipsoid=t??ee.default;let n=this;this._velocityVectorProperty.definitionChanged.addEventListener(function(){n._definitionChanged.raiseEvent(n)})}Object.defineProperties(Hk.prototype,{isConstant:{get:function(){return X.isConstant(this._velocityVectorProperty)}},definitionChanged:{get:function(){return this._definitionChanged}},position:{get:function(){return this._velocityVectorProperty.position},set:function(e){this._velocityVectorProperty.position=e}},ellipsoid:{get:function(){return this._ellipsoid},set:function(e){this._ellipsoid!==e&&(this._ellipsoid=e,this._definitionChanged.raiseEvent(this))}}});var Ave=new h,b_t=new h,bve=new $,x_t=new K;Hk.prototype.getValue=function(e,t){l(e)||(e=K.now(x_t));let n=this._velocityVectorProperty._getValue(e,b_t,Ave);if(l(n))return At.rotationMatrixFromPositionVelocity(Ave,n,this._ellipsoid,bve),Le.fromRotationMatrix(bve,t)};Hk.prototype.equals=function(e){return this===e||e instanceof Hk&&X.equals(this._velocityVectorProperty,e._velocityVectorProperty)&&(this._ellipsoid===e._ellipsoid||this._ellipsoid.equals(e._ellipsoid))};var Gk=Hk;var L_={COMPLETE:0,BELOW_ELLIPSOID_HORIZON:1,ABOVE_ELLIPSOID_HORIZON:2};L_.validate=function(e){return e===L_.COMPLETE||e===L_.BELOW_ELLIPSOID_HORIZON||e===L_.ABOVE_ELLIPSOID_HORIZON};L_.toString=function(e){switch(e){case L_.COMPLETE:return"COMPLETE";case L_.BELOW_ELLIPSOID_HORIZON:return"BELOW_ELLIPSOID_HORIZON";case L_.ABOVE_ELLIPSOID_HORIZON:return"ABOVE_ELLIPSOID_HORIZON";default:throw new pe("SensorVolumePortionToDisplay value is not valid and cannot be converted to a String.")}};var Yw=L_;function QA(){}QA.packedLength=h.packedLength;QA.unpack=h.unpack;QA.pack=h.pack;var Yee;function Wk(e,t){return t[0]==="#"&&(t=Yee+t),R_.fromString(e,t)}function xve(e,t,n){if(l(n.reference))return Wk(t,n.reference);if(l(n.velocityReference)){let i=Wk(t,n.velocityReference);switch(e){case h:case QA:return new N_(i,e===QA);case Le:return new Gk(i)}}throw new oe(`${JSON.stringify(n)} is not valid CZML.`)}function T_t(e,t){return new nm(function(n,i){return t(e.getValue(n,i))},e.isConstant)}var pr=new h,du=new jk,bl=new he,aE=new En,wG=new Le;function E_t(e){let t=e.rgbaf;if(l(t))return t;let n=e.rgba;if(!l(n))return;let i=n.length;if(i===z.packedLength)return[z.byteToFloat(n[0]),z.byteToFloat(n[1]),z.byteToFloat(n[2]),z.byteToFloat(n[3])];t=new Array(i);for(let r=0;r<i;r+=5)t[r]=n[r],t[r+1]=z.byteToFloat(n[r+1]),t[r+2]=z.byteToFloat(n[r+2]),t[r+3]=z.byteToFloat(n[r+3]),t[r+4]=z.byteToFloat(n[r+4]);return t}function Tve(e,t){let n=e.uri??e;return l(t)?t.getDerivedResource({url:n}):De.createIfNeeded(n)}function C_t(e){let t=e.wsen;if(l(t))return t;let n=e.wsenDegrees;if(!l(n))return;let i=n.length;if(i===ie.packedLength)return[D.toRadians(n[0]),D.toRadians(n[1]),D.toRadians(n[2]),D.toRadians(n[3])];t=new Array(i);for(let r=0;r<i;r+=5)t[r]=n[r],t[r+1]=D.toRadians(n[r+1]),t[r+2]=D.toRadians(n[r+2]),t[r+3]=D.toRadians(n[r+3]),t[r+4]=D.toRadians(n[r+4]);return t}function v_t(e){let t=e.length;if(du.magnitude=1,t===2)return du.clock=e[0],du.cone=e[1],h.fromSpherical(du,pr),[pr.x,pr.y,pr.z];let n=new Array(t/3*4);for(let i=0,r=0;i<t;i+=3,r+=4)n[r]=e[i],du.clock=e[i+1],du.cone=e[i+2],h.fromSpherical(du,pr),n[r+1]=pr.x,n[r+2]=pr.y,n[r+3]=pr.z;return n}function S_t(e){let t=e.length;if(t===3)return du.clock=e[0],du.cone=e[1],du.magnitude=e[2],h.fromSpherical(du,pr),[pr.x,pr.y,pr.z];let n=new Array(t);for(let i=0;i<t;i+=4)n[i]=e[i],du.clock=e[i+1],du.cone=e[i+2],du.magnitude=e[i+3],h.fromSpherical(du,pr),n[i+1]=pr.x,n[i+2]=pr.y,n[i+3]=pr.z;return n}function w_t(e){let t=e.length;if(t===3)return bl.longitude=e[0],bl.latitude=e[1],bl.height=e[2],ee.default.cartographicToCartesian(bl,pr),[pr.x,pr.y,pr.z];let n=new Array(t);for(let i=0;i<t;i+=4)n[i]=e[i],bl.longitude=e[i+1],bl.latitude=e[i+2],bl.height=e[i+3],ee.default.cartographicToCartesian(bl,pr),n[i+1]=pr.x,n[i+2]=pr.y,n[i+3]=pr.z;return n}function I_t(e){let t=e.length;if(t===3)return bl.longitude=D.toRadians(e[0]),bl.latitude=D.toRadians(e[1]),bl.height=e[2],ee.default.cartographicToCartesian(bl,pr),[pr.x,pr.y,pr.z];let n=new Array(t);for(let i=0;i<t;i+=4)n[i]=e[i],bl.longitude=D.toRadians(e[i+1]),bl.latitude=D.toRadians(e[i+2]),bl.height=e[i+3],ee.default.cartographicToCartesian(bl,pr),n[i+1]=pr.x,n[i+2]=pr.y,n[i+3]=pr.z;return n}function Xee(e){let t=e.cartesian;if(l(t))return t;let n=e.cartesianVelocity;if(l(n))return n;let i=e.unitCartesian;if(l(i))return i;let r=e.unitSpherical;if(l(r))return v_t(r);let o=e.spherical;if(l(o))return S_t(o);let s=e.cartographicRadians;if(l(s))return w_t(s);let a=e.cartographicDegrees;if(l(a))return I_t(a);throw new oe(`${JSON.stringify(e)} is not a valid CZML interval.`)}function Eve(e,t){h.unpack(e,t,pr),h.normalize(pr,pr),h.pack(pr,e,t)}function P_t(e){let t=Xee(e);if(t.length===3)return Eve(t,0),t;for(let n=1;n<t.length;n+=4)Eve(t,n);return t}function Cve(e,t){Le.unpack(e,t,wG),Le.normalize(wG,wG),Le.pack(wG,e,t)}function D_t(e){let t=e.unitQuaternion;if(l(t)){if(t.length===4)return Cve(t,0),t;for(let n=1;n<t.length;n+=5)Cve(t,n)}return t}function vve(e){return typeof e=="boolean"?Boolean:typeof e=="number"?Number:typeof e=="string"?String:e.hasOwnProperty("array")?Array:e.hasOwnProperty("boolean")?Boolean:e.hasOwnProperty("boundingRectangle")?et:e.hasOwnProperty("cartesian2")?U:e.hasOwnProperty("cartesian")||e.hasOwnProperty("spherical")||e.hasOwnProperty("cartographicRadians")||e.hasOwnProperty("cartographicDegrees")?h:e.hasOwnProperty("unitCartesian")||e.hasOwnProperty("unitSpherical")?QA:e.hasOwnProperty("rgba")||e.hasOwnProperty("rgbaf")?z:e.hasOwnProperty("arcType")?ln:e.hasOwnProperty("classificationType")?ei:e.hasOwnProperty("colorBlendMode")?ll:e.hasOwnProperty("cornerType")?rr:e.hasOwnProperty("heightReference")?We:e.hasOwnProperty("horizontalOrigin")?zi:e.hasOwnProperty("date")?K:e.hasOwnProperty("labelStyle")?Ao:e.hasOwnProperty("number")?Number:e.hasOwnProperty("nearFarScalar")?qt:e.hasOwnProperty("distanceDisplayCondition")?Ht:e.hasOwnProperty("object")||e.hasOwnProperty("value")?Object:e.hasOwnProperty("unitQuaternion")?Le:e.hasOwnProperty("pathMode")?a0:e.hasOwnProperty("shadowMode")?Dn:e.hasOwnProperty("string")?String:e.hasOwnProperty("stripeOrientation")?Bm:e.hasOwnProperty("wsen")||e.hasOwnProperty("wsenDegrees")?ie:e.hasOwnProperty("uri")?Yk.default:e.hasOwnProperty("verticalOrigin")?Gn:Object}function R_t(e,t,n){switch(e){case ln:return ln[t.arcType??t];case Array:return t.array;case Boolean:return t.boolean??t;case et:return t.boundingRectangle;case U:return t.cartesian2;case h:return Xee(t);case QA:return P_t(t);case z:return E_t(t);case ei:return ei[t.classificationType??t];case ll:return ll[t.colorBlendMode??t];case rr:return rr[t.cornerType??t];case We:return We[t.heightReference??t];case zi:return zi[t.horizontalOrigin??t];case Image:return Tve(t,n);case K:return K.fromIso8601(t.date??t);case Ao:return Ao[t.labelStyle??t];case Number:return t.number??t;case qt:return t.nearFarScalar;case Ht:return t.distanceDisplayCondition;case Object:return t.object??t.value??t;case a0:return a0[t.pathMode??t];case Le:return D_t(t);case lh:return t.number??t;case Yw:return Yw[t.portionToDisplay??t];case Dn:return Dn[t.shadowMode??t.shadows??t];case String:return t.string??t;case Bm:return Bm[t.stripeOrientation??t];case ie:return C_t(t);case Yk.default:return Tve(t,n);case Gn:return Gn[t.verticalOrigin??t];default:throw new oe(`Unknown CzmlDataSource interval type: ${e}`)}}var O_t={HERMITE:zk,LAGRANGE:Vk,LINEAR:KA};function IG(e,t){let n=e.interpolationAlgorithm,i=e.interpolationDegree;(l(n)||l(i))&&t.setInterpolationOptions({interpolationAlgorithm:O_t[n],interpolationDegree:i});let r=e.forwardExtrapolationType;l(r)&&(t.forwardExtrapolationType=fu[r]);let o=e.forwardExtrapolationDuration;l(o)&&(t.forwardExtrapolationDuration=o);let s=e.backwardExtrapolationType;l(s)&&(t.backwardExtrapolationType=fu[s]);let a=e.backwardExtrapolationDuration;l(a)&&(t.backwardExtrapolationDuration=a)}var Sve={iso8601:void 0};function Ko(e){if(l(e))return Sve.iso8601=e,En.fromIso8601(Sve)}function Kee(e){let t=nt.MAXIMUM_INTERVAL.clone();return t.data=e,t}function wve(e){let t=new _l;return t.intervals.addInterval(Kee(e)),t}function Ive(e){let t=new pc(e.referenceFrame);return t.intervals.addInterval(Kee(e)),t}function PG(e,t,n,i,r,o,s){let a=Ko(i.interval);l(r)&&(l(a)?a=En.intersect(a,r,aE):a=r);let c,u,f,d=!l(i.reference)&&!l(i.velocityReference),p=l(a)&&!a.equals(nt.MAXIMUM_INTERVAL);if(i.delete===!0){if(!p){t[n]=void 0;return}return Uve(t[n],a)}let g=!1;if(d){if(u=R_t(e,i,o),!l(u))return;c=e.packedLength??1,f=u.length??1,g=!l(i.array)&&typeof u!="string"&&f>c&&e!==Object}let m=typeof e.unpack=="function"&&e!==lh;if(!g&&!p){d?t[n]=new ui(m?e.unpack(u,0):u):t[n]=xve(e,s,i);return}let y=t[n],A,b=i.epoch;if(l(b)&&(A=K.fromIso8601(b)),g&&!p){y instanceof Qf||(t[n]=y=new Qf(e)),y.addSamplesPackedArray(u,A),IG(i,y);return}let x;if(!g&&p){a=a.clone(),d?a.data=m?e.unpack(u,0):u:a.data=xve(e,s,i),l(y)||(t[n]=y=d?new M_:new _l),d&&y instanceof M_?y.intervals.addInterval(a):y instanceof _l?(d&&(a.data=new ui(a.data)),y.intervals.addInterval(a)):(t[n]=y=wve(y),d&&(a.data=new ui(a.data)),y.intervals.addInterval(a));return}l(y)||(t[n]=y=new _l),y instanceof _l||(t[n]=y=wve(y));let T=y.intervals;x=T.findInterval(a),(!l(x)||!(x.data instanceof Qf))&&(x=a.clone(),x.data=new Qf(e),T.addInterval(x)),x.data.addSamplesPackedArray(u,A),IG(i,x.data)}function Uve(e,t){if(e instanceof Qf){e.removeSamples(t);return}else if(e instanceof M_){e.intervals.removeInterval(t);return}else if(e instanceof _l){let n=e.intervals;for(let i=0;i<n.length;++i){let r=En.intersect(n.get(i),t,aE);r.isEmpty||Uve(r.data,t)}n.removeInterval(t);return}}function Ee(e,t,n,i,r,o,s){if(l(i))if(Array.isArray(i))for(let a=0,c=i.length;a<c;++a)PG(e,t,n,i[a],r,o,s);else PG(e,t,n,i,r,o,s)}function Pve(e,t,n,i,r,o){let s=Ko(n.interval);l(i)&&(l(s)?s=En.intersect(s,i,aE):s=i);let a=l(n.cartesianVelocity)?1:0,c=h.packedLength*(a+1),u,f,d=!l(n.reference),p=l(s)&&!s.equals(nt.MAXIMUM_INTERVAL);if(n.delete===!0){if(!p){e[t]=void 0;return}return zve(e[t],s)}let g,m=!1;if(d&&(l(n.referenceFrame)&&(g=ji[n.referenceFrame]),g=g??ji.FIXED,u=Xee(n),f=u.length??1,m=f>c),!m&&!p){d?e[t]=new Xl(h.unpack(u),g):e[t]=Wk(o,n.reference);return}let y=e[t],A,b=n.epoch;if(l(b)&&(A=K.fromIso8601(b)),m&&!p){(!(y instanceof _c)||l(g)&&y.referenceFrame!==g)&&(e[t]=y=new _c(g,a)),y.addSamplesPackedArray(u,A),IG(n,y);return}let x;if(!m&&p){s=s.clone(),d?s.data=h.unpack(u):s.data=Wk(o,n.reference),l(y)||(d?y=new O_(g):y=new pc(g),e[t]=y),d&&y instanceof O_&&l(g)&&y.referenceFrame===g?y.intervals.addInterval(s):y instanceof pc?(d&&(s.data=new Xl(s.data,g)),y.intervals.addInterval(s)):(e[t]=y=Ive(y),d&&(s.data=new Xl(s.data,g)),y.intervals.addInterval(s));return}l(y)?y instanceof pc||(e[t]=y=Ive(y)):e[t]=y=new pc(g);let T=y.intervals;x=T.findInterval(s),(!l(x)||!(x.data instanceof _c)||l(g)&&x.data.referenceFrame!==g)&&(x=s.clone(),x.data=new _c(g,a),T.addInterval(x)),x.data.addSamplesPackedArray(u,A),IG(n,x.data)}function zve(e,t){if(e instanceof _c){e.removeSamples(t);return}else if(e instanceof O_){e.intervals.removeInterval(t);return}else if(e instanceof pc){let n=e.intervals;for(let i=0;i<n.length;++i){let r=En.intersect(n.get(i),t,aE);r.isEmpty||zve(r.data,t)}n.removeInterval(t);return}}function Vve(e,t,n,i,r,o){if(l(n))if(Array.isArray(n))for(let s=0,a=n.length;s<a;++s)Pve(e,t,n[s],i,r,o);else Pve(e,t,n,i,r,o)}function Dve(e,t,n,i){l(n.references)?DG(e,t,n.references,n.interval,i,Hw,_l):(l(n.cartesian2)?n.array=U.unpackArray(n.cartesian2):l(n.cartesian)&&(n.array=U.unpackArray(n.cartesian)),l(n.array)&&Ee(Array,e,t,n,void 0,void 0,i))}function Rve(e,t,n,i,r,o){let s=Ko(n.interval);l(i)&&(l(s)?s=En.intersect(s,i,aE):s=i);let a=e[t],c,u;if(l(s)){a instanceof vw||(a=new vw,e[t]=a);let d=a.intervals;u=d.findInterval({start:s.start,stop:s.stop}),l(u)?c=u.data:(u=s.clone(),d.addInterval(u))}else c=a;let f;l(n.solidColor)?(c instanceof Kt||(c=new Kt),f=n.solidColor,Ee(z,c,"color",f.color,void 0,void 0,o)):l(n.grid)?(c instanceof Lw||(c=new Lw),f=n.grid,Ee(z,c,"color",f.color,void 0,r,o),Ee(Number,c,"cellAlpha",f.cellAlpha,void 0,r,o),Ee(U,c,"lineCount",f.lineCount,void 0,r,o),Ee(U,c,"lineThickness",f.lineThickness,void 0,r,o),Ee(U,c,"lineOffset",f.lineOffset,void 0,r,o)):l(n.image)?(c instanceof Ky||(c=new Ky),f=n.image,Ee(Image,c,"image",f.image,void 0,r,o),Ee(U,c,"repeat",f.repeat,void 0,r,o),Ee(z,c,"color",f.color,void 0,r,o),Ee(Boolean,c,"transparent",f.transparent,void 0,r,o)):l(n.stripe)?(c instanceof Ww||(c=new Ww),f=n.stripe,Ee(Bm,c,"orientation",f.orientation,void 0,r,o),Ee(z,c,"evenColor",f.evenColor,void 0,r,o),Ee(z,c,"oddColor",f.oddColor,void 0,r,o),Ee(Number,c,"offset",f.offset,void 0,r,o),Ee(Number,c,"repeat",f.repeat,void 0,r,o)):l(n.polylineOutline)?(c instanceof $A||(c=new $A),f=n.polylineOutline,Ee(z,c,"color",f.color,void 0,r,o),Ee(z,c,"outlineColor",f.outlineColor,void 0,r,o),Ee(Number,c,"outlineWidth",f.outlineWidth,void 0,r,o)):l(n.polylineGlow)?(c instanceof Vw||(c=new Vw),f=n.polylineGlow,Ee(z,c,"color",f.color,void 0,r,o),Ee(Number,c,"glowPower",f.glowPower,void 0,r,o),Ee(Number,c,"taperPower",f.taperPower,void 0,r,o)):l(n.polylineArrow)?(c instanceof Bw||(c=new Bw),f=n.polylineArrow,Ee(z,c,"color",f.color,void 0,void 0,o)):l(n.polylineDash)?(c instanceof Uw||(c=new Uw),f=n.polylineDash,Ee(z,c,"color",f.color,void 0,void 0,o),Ee(z,c,"gapColor",f.gapColor,void 0,void 0,o),Ee(Number,c,"dashLength",f.dashLength,void 0,r,o),Ee(Number,c,"dashPattern",f.dashPattern,void 0,r,o)):l(n.checkerboard)&&(c instanceof Ew||(c=new Ew),f=n.checkerboard,Ee(z,c,"evenColor",f.evenColor,void 0,r,o),Ee(z,c,"oddColor",f.oddColor,void 0,r,o),Ee(U,c,"repeat",f.repeat,void 0,r,o)),l(u)?u.data=c:e[t]=c}function ed(e,t,n,i,r,o){if(l(n))if(Array.isArray(n))for(let s=0,a=n.length;s<a;++s)Rve(e,t,n[s],i,r,o);else Rve(e,t,n,i,r,o)}function M_t(e,t,n,i){let r=t.name;l(r)&&(e.name=t.name)}function N_t(e,t,n,i){let r=t.description;l(r)&&Ee(String,e,"description",r,void 0,i,n)}function L_t(e,t,n,i){let r=t.position;l(r)&&Vve(e,"position",r,void 0,i,n)}function F_t(e,t,n,i){let r=t.viewFrom;l(r)&&Ee(h,e,"viewFrom",r,void 0,i,n)}function B_t(e,t,n,i){let r=t.orientation;l(r)&&Ee(Le,e,"orientation",r,void 0,i,n)}function k_t(e,t,n,i){let r=t.properties;if(l(r)){l(e.properties)||(e.properties=new $l);for(let o in r)if(r.hasOwnProperty(o)){e.properties.hasProperty(o)||e.properties.addProperty(o);let s=r[o];if(Array.isArray(s))for(let a=0,c=s.length;a<c;++a)PG(vve(s[a]),e.properties,o,s[a],void 0,i,n);else PG(vve(s),e.properties,o,s,void 0,i,n)}}}function DG(e,t,n,i,r,o,s){let a=n.map(function(c){return Wk(r,c)});if(l(i)){i=Ko(i);let c=e[t];if(!(c instanceof s)){let u=new s;u.intervals.addInterval(Kee(c)),e[t]=c=u}i.data=new o(a),c.intervals.addInterval(i)}else e[t]=new o(a)}function Ove(e,t,n,i){let r=n.references;l(r)?DG(e,t,r,n.interval,i,Hw,_l):Ee(Array,e,t,n,void 0,void 0,i)}function Mve(e,t,n,i){if(l(n))if(Array.isArray(n))for(let r=0,o=n.length;r<o;++r)Ove(e,t,n[r],i);else Ove(e,t,n,i)}function Nve(e,t,n,i){let r=n.references;l(r)?DG(e,t,r,n.interval,i,D_,pc):(l(n.cartesian)?n.array=h.unpackArray(n.cartesian):l(n.cartographicRadians)?n.array=h.fromRadiansArrayHeights(n.cartographicRadians,ee.default):l(n.cartographicDegrees)&&(n.array=h.fromDegreesArrayHeights(n.cartographicDegrees,ee.default)),l(n.array)&&Ee(Array,e,t,n,void 0,void 0,i))}function Xk(e,t,n,i){if(l(n))if(Array.isArray(n))for(let r=0,o=n.length;r<o;++r)Nve(e,t,n[r],i);else Nve(e,t,n,i)}function U_t(e){return h.unpackArray(e)}function z_t(e){return h.fromRadiansArrayHeights(e,ee.default)}function V_t(e){return h.fromDegreesArrayHeights(e,ee.default)}function Lve(e,t,n,i){let r=n.references;if(l(r)){let o=r.map(function(s){let a={};return DG(a,"positions",s,n.interval,i,D_,pc),a.positions});e[t]=new D_(o)}else l(n.cartesian)?n.array=n.cartesian.map(U_t):l(n.cartographicRadians)?n.array=n.cartographicRadians.map(z_t):l(n.cartographicDegrees)&&(n.array=n.cartographicDegrees.map(V_t)),l(n.array)&&Ee(Array,e,t,n,void 0,void 0,i)}function j_t(e,t,n,i){if(l(n))if(Array.isArray(n))for(let r=0,o=n.length;r<o;++r)Lve(e,t,n[r],i);else Lve(e,t,n,i)}function H_t(e,t,n,i){if(l(n))if(Array.isArray(n))for(let r=0,o=n.length;r<o;r++)Dve(e,t,n[r],i);else Dve(e,t,n,i)}function G_t(e,t,n,i){let r=t.availability;if(!l(r))return;let o;if(Array.isArray(r))for(let s=0,a=r.length;s<a;++s)l(o)||(o=new Ps),o.addInterval(Ko(r[s]));else o=new Ps,o.addInterval(Ko(r));e.availability=o}function W_t(e,t,n,i,r){l(t)&&Ee(QA,e,"alignedAxis",t,n,i,r)}function q_t(e,t,n,i){let r=t.billboard;if(!l(r))return;let o=Ko(r.interval),s=e.billboard;l(s)||(e.billboard=s=new Zc),Ee(Boolean,s,"show",r.show,o,i,n),Ee(Image,s,"image",r.image,o,i,n),Ee(Number,s,"scale",r.scale,o,i,n),Ee(U,s,"pixelOffset",r.pixelOffset,o,i,n),Ee(h,s,"eyeOffset",r.eyeOffset,o,i,n),Ee(zi,s,"horizontalOrigin",r.horizontalOrigin,o,i,n),Ee(Gn,s,"verticalOrigin",r.verticalOrigin,o,i,n),Ee(We,s,"heightReference",r.heightReference,o,i,n),Ee(z,s,"color",r.color,o,i,n),Ee(lh,s,"rotation",r.rotation,o,i,n),W_t(s,r.alignedAxis,o,i,n),Ee(Boolean,s,"sizeInMeters",r.sizeInMeters,o,i,n),Ee(Number,s,"width",r.width,o,i,n),Ee(Number,s,"height",r.height,o,i,n),Ee(qt,s,"scaleByDistance",r.scaleByDistance,o,i,n),Ee(qt,s,"translucencyByDistance",r.translucencyByDistance,o,i,n),Ee(qt,s,"pixelOffsetScaleByDistance",r.pixelOffsetScaleByDistance,o,i,n),Ee(et,s,"imageSubRegion",r.imageSubRegion,o,i,n),Ee(Ht,s,"distanceDisplayCondition",r.distanceDisplayCondition,o,i,n),Ee(Number,s,"disableDepthTestDistance",r.disableDepthTestDistance,o,i,n)}function Y_t(e,t,n,i){let r=t.box;if(!l(r))return;let o=Ko(r.interval),s=e.box;l(s)||(e.box=s=new Nx),Ee(Boolean,s,"show",r.show,o,i,n),Ee(h,s,"dimensions",r.dimensions,o,i,n),Ee(We,s,"heightReference",r.heightReference,o,i,n),Ee(Boolean,s,"fill",r.fill,o,i,n),ed(s,"material",r.material,o,i,n),Ee(Boolean,s,"outline",r.outline,o,i,n),Ee(z,s,"outlineColor",r.outlineColor,o,i,n),Ee(Number,s,"outlineWidth",r.outlineWidth,o,i,n),Ee(Dn,s,"shadows",r.shadows,o,i,n),Ee(Ht,s,"distanceDisplayCondition",r.distanceDisplayCondition,o,i,n)}function X_t(e,t,n,i){let r=t.corridor;if(!l(r))return;let o=Ko(r.interval),s=e.corridor;l(s)||(e.corridor=s=new Fx),Ee(Boolean,s,"show",r.show,o,i,n),Xk(s,"positions",r.positions,n),Ee(Number,s,"width",r.width,o,i,n),Ee(Number,s,"height",r.height,o,i,n),Ee(We,s,"heightReference",r.heightReference,o,i,n),Ee(Number,s,"extrudedHeight",r.extrudedHeight,o,i,n),Ee(We,s,"extrudedHeightReference",r.extrudedHeightReference,o,i,n),Ee(rr,s,"cornerType",r.cornerType,o,i,n),Ee(Number,s,"granularity",r.granularity,o,i,n),Ee(Boolean,s,"fill",r.fill,o,i,n),ed(s,"material",r.material,o,i,n),Ee(Boolean,s,"outline",r.outline,o,i,n),Ee(z,s,"outlineColor",r.outlineColor,o,i,n),Ee(Number,s,"outlineWidth",r.outlineWidth,o,i,n),Ee(Dn,s,"shadows",r.shadows,o,i,n),Ee(Ht,s,"distanceDisplayCondition",r.distanceDisplayCondition,o,i,n),Ee(ei,s,"classificationType",r.classificationType,o,i,n),Ee(Number,s,"zIndex",r.zIndex,o,i,n)}function K_t(e,t,n,i){let r=t.cylinder;if(!l(r))return;let o=Ko(r.interval),s=e.cylinder;l(s)||(e.cylinder=s=new Bx),Ee(Boolean,s,"show",r.show,o,i,n),Ee(Number,s,"length",r.length,o,i,n),Ee(Number,s,"topRadius",r.topRadius,o,i,n),Ee(Number,s,"bottomRadius",r.bottomRadius,o,i,n),Ee(We,s,"heightReference",r.heightReference,o,i,n),Ee(Boolean,s,"fill",r.fill,o,i,n),ed(s,"material",r.material,o,i,n),Ee(Boolean,s,"outline",r.outline,o,i,n),Ee(z,s,"outlineColor",r.outlineColor,o,i,n),Ee(Number,s,"outlineWidth",r.outlineWidth,o,i,n),Ee(Number,s,"numberOfVerticalLines",r.numberOfVerticalLines,o,i,n),Ee(Number,s,"slices",r.slices,o,i,n),Ee(Dn,s,"shadows",r.shadows,o,i,n),Ee(Ht,s,"distanceDisplayCondition",r.distanceDisplayCondition,o,i,n)}function $_t(e,t){let n=e.version;if(l(n)&&typeof n=="string"){let o=n.split(".");if(o.length===2){if(o[0]!=="1")throw new oe("Cesium only supports CZML version 1.");t._version=n}}if(!l(t._version))throw new oe("CZML version information invalid. It is expected to be a property on the document object in the <Major>.<Minor> version format.");let i=t._documentPacket;l(e.name)&&(i.name=e.name);let r=e.clock;if(l(r)){let o=i.clock;l(o)?(o.interval=r.interval??o.interval,o.currentTime=r.currentTime??o.currentTime,o.range=r.range??o.range,o.step=r.step??o.step,o.multiplier=r.multiplier??o.multiplier):i.clock={interval:r.interval,currentTime:r.currentTime,range:r.range,step:r.step,multiplier:r.multiplier}}}function J_t(e,t,n,i){let r=t.ellipse;if(!l(r))return;let o=Ko(r.interval),s=e.ellipse;l(s)||(e.ellipse=s=new kx),Ee(Boolean,s,"show",r.show,o,i,n),Ee(Number,s,"semiMajorAxis",r.semiMajorAxis,o,i,n),Ee(Number,s,"semiMinorAxis",r.semiMinorAxis,o,i,n),Ee(Number,s,"height",r.height,o,i,n),Ee(We,s,"heightReference",r.heightReference,o,i,n),Ee(Number,s,"extrudedHeight",r.extrudedHeight,o,i,n),Ee(We,s,"extrudedHeightReference",r.extrudedHeightReference,o,i,n),Ee(lh,s,"rotation",r.rotation,o,i,n),Ee(lh,s,"stRotation",r.stRotation,o,i,n),Ee(Number,s,"granularity",r.granularity,o,i,n),Ee(Boolean,s,"fill",r.fill,o,i,n),ed(s,"material",r.material,o,i,n),Ee(Boolean,s,"outline",r.outline,o,i,n),Ee(z,s,"outlineColor",r.outlineColor,o,i,n),Ee(Number,s,"outlineWidth",r.outlineWidth,o,i,n),Ee(Number,s,"numberOfVerticalLines",r.numberOfVerticalLines,o,i,n),Ee(Dn,s,"shadows",r.shadows,o,i,n),Ee(Ht,s,"distanceDisplayCondition",r.distanceDisplayCondition,o,i,n),Ee(ei,s,"classificationType",r.classificationType,o,i,n),Ee(Number,s,"zIndex",r.zIndex,o,i,n)}function Z_t(e,t,n,i){let r=t.ellipsoid;if(!l(r))return;let o=Ko(r.interval),s=e.ellipsoid;l(s)||(e.ellipsoid=s=new Ux),Ee(Boolean,s,"show",r.show,o,i,n),Ee(h,s,"radii",r.radii,o,i,n),Ee(h,s,"innerRadii",r.innerRadii,o,i,n),Ee(Number,s,"minimumClock",r.minimumClock,o,i,n),Ee(Number,s,"maximumClock",r.maximumClock,o,i,n),Ee(Number,s,"minimumCone",r.minimumCone,o,i,n),Ee(Number,s,"maximumCone",r.maximumCone,o,i,n),Ee(We,s,"heightReference",r.heightReference,o,i,n),Ee(Boolean,s,"fill",r.fill,o,i,n),ed(s,"material",r.material,o,i,n),Ee(Boolean,s,"outline",r.outline,o,i,n),Ee(z,s,"outlineColor",r.outlineColor,o,i,n),Ee(Number,s,"outlineWidth",r.outlineWidth,o,i,n),Ee(Number,s,"stackPartitions",r.stackPartitions,o,i,n),Ee(Number,s,"slicePartitions",r.slicePartitions,o,i,n),Ee(Number,s,"subdivisions",r.subdivisions,o,i,n),Ee(Dn,s,"shadows",r.shadows,o,i,n),Ee(Ht,s,"distanceDisplayCondition",r.distanceDisplayCondition,o,i,n)}function Q_t(e,t,n,i){let r=t.label;if(!l(r))return;let o=Ko(r.interval),s=e.label;l(s)||(e.label=s=new Qh),Ee(Boolean,s,"show",r.show,o,i,n),Ee(String,s,"text",r.text,o,i,n),Ee(String,s,"font",r.font,o,i,n),Ee(Ao,s,"style",r.style,o,i,n),Ee(Number,s,"scale",r.scale,o,i,n),Ee(Boolean,s,"showBackground",r.showBackground,o,i,n),Ee(z,s,"backgroundColor",r.backgroundColor,o,i,n),Ee(U,s,"backgroundPadding",r.backgroundPadding,o,i,n),Ee(U,s,"pixelOffset",r.pixelOffset,o,i,n),Ee(h,s,"eyeOffset",r.eyeOffset,o,i,n),Ee(zi,s,"horizontalOrigin",r.horizontalOrigin,o,i,n),Ee(Gn,s,"verticalOrigin",r.verticalOrigin,o,i,n),Ee(We,s,"heightReference",r.heightReference,o,i,n),Ee(z,s,"fillColor",r.fillColor,o,i,n),Ee(z,s,"outlineColor",r.outlineColor,o,i,n),Ee(Number,s,"outlineWidth",r.outlineWidth,o,i,n),Ee(qt,s,"translucencyByDistance",r.translucencyByDistance,o,i,n),Ee(qt,s,"pixelOffsetScaleByDistance",r.pixelOffsetScaleByDistance,o,i,n),Ee(qt,s,"scaleByDistance",r.scaleByDistance,o,i,n),Ee(Ht,s,"distanceDisplayCondition",r.distanceDisplayCondition,o,i,n),Ee(Number,s,"disableDepthTestDistance",r.disableDepthTestDistance,o,i,n)}function eyt(e,t,n,i){let r=t.model;if(!l(r))return;let o=Ko(r.interval),s=e.model;l(s)||(e.model=s=new Sg),Ee(Boolean,s,"show",r.show,o,i,n),Ee(Yk.default,s,"uri",r.gltf,o,i,n),Ee(Number,s,"scale",r.scale,o,i,n),Ee(Number,s,"minimumPixelSize",r.minimumPixelSize,o,i,n),Ee(Number,s,"maximumScale",r.maximumScale,o,i,n),Ee(Boolean,s,"incrementallyLoadTextures",r.incrementallyLoadTextures,o,i,n),Ee(Boolean,s,"runAnimations",r.runAnimations,o,i,n),Ee(Boolean,s,"clampAnimations",r.clampAnimations,o,i,n),Ee(Dn,s,"shadows",r.shadows,o,i,n),Ee(We,s,"heightReference",r.heightReference,o,i,n),Ee(z,s,"silhouetteColor",r.silhouetteColor,o,i,n),Ee(Number,s,"silhouetteSize",r.silhouetteSize,o,i,n),Ee(z,s,"color",r.color,o,i,n),Ee(ll,s,"colorBlendMode",r.colorBlendMode,o,i,n),Ee(Number,s,"colorBlendAmount",r.colorBlendAmount,o,i,n),Ee(Ht,s,"distanceDisplayCondition",r.distanceDisplayCondition,o,i,n);let a,c,u=r.nodeTransformations;if(l(u))if(Array.isArray(u))for(a=0,c=u.length;a<c;++a)Fve(s,u[a],o,i,n);else Fve(s,u,o,i,n);let f=r.articulations;if(l(f))if(Array.isArray(f))for(a=0,c=f.length;a<c;++a)Bve(s,f[a],o,i,n);else Bve(s,f,o,i,n)}function Fve(e,t,n,i,r){let o=Ko(t.interval);l(n)&&(l(o)?o=En.intersect(o,n,aE):o=n);let s=e.nodeTransformations,a=Object.keys(t);for(let c=0,u=a.length;c<u;++c){let f=a[c];if(f==="interval")continue;let d=t[f];if(!l(d))continue;l(s)||(e.nodeTransformations=s=new $l),s.hasProperty(f)||s.addProperty(f);let p=s[f];l(p)||(s[f]=p=new zx),Ee(h,p,"translation",d.translation,o,i,r),Ee(Le,p,"rotation",d.rotation,o,i,r),Ee(h,p,"scale",d.scale,o,i,r)}}function Bve(e,t,n,i,r){let o=Ko(t.interval);l(n)&&(l(o)?o=En.intersect(o,n,aE):o=n);let s=e.articulations,a=Object.keys(t);for(let c=0,u=a.length;c<u;++c){let f=a[c];if(f==="interval")continue;let d=t[f];l(d)&&(l(s)||(e.articulations=s=new $l),s.hasProperty(f)||s.addProperty(f),Ee(Number,s,f,d,o,i,r))}}function tyt(e,t,n,i){let r=t.path;if(!l(r))return;let o=Ko(r.interval),s=e.path;l(s)||(e.path=s=new wg),Ee(Boolean,s,"show",r.show,o,i,n),Ee(Number,s,"leadTime",r.leadTime,o,i,n),Ee(Number,s,"trailTime",r.trailTime,o,i,n),Ee(Number,s,"width",r.width,o,i,n),Ee(Number,s,"resolution",r.resolution,o,i,n),ed(s,"material",r.material,o,i,n),Ee(Ht,s,"distanceDisplayCondition",r.distanceDisplayCondition,o,i,n),Ee(String,s,"relativeTo",r.relativeTo,o,i,n),Ee(a0,s,"materialMode",r.materialMode,o,i,n)}function nyt(e,t,n,i){let r=t.point;if(!l(r))return;let o=Ko(r.interval),s=e.point;l(s)||(e.point=s=new jx),Ee(Boolean,s,"show",r.show,o,i,n),Ee(Number,s,"pixelSize",r.pixelSize,o,i,n),Ee(We,s,"heightReference",r.heightReference,o,i,n),Ee(z,s,"color",r.color,o,i,n),Ee(z,s,"outlineColor",r.outlineColor,o,i,n),Ee(Number,s,"outlineWidth",r.outlineWidth,o,i,n),Ee(qt,s,"scaleByDistance",r.scaleByDistance,o,i,n),Ee(qt,s,"translucencyByDistance",r.translucencyByDistance,o,i,n),Ee(Ht,s,"distanceDisplayCondition",r.distanceDisplayCondition,o,i,n),Ee(Number,s,"disableDepthTestDistance",r.disableDepthTestDistance,o,i,n)}function qk(e){this.polygon=e,this._definitionChanged=new be}Object.defineProperties(qk.prototype,{isConstant:{get:function(){let e=this.polygon._positions,t=this.polygon._holes;return(!l(e)||e.isConstant)&&(!l(t)||t.isConstant)}},definitionChanged:{get:function(){return this._definitionChanged}}});qk.prototype.getValue=function(e,t){let n;l(this.polygon._positions)&&(n=this.polygon._positions.getValue(e));let i;return l(this.polygon._holes)&&(i=this.polygon._holes.getValue(e),l(i)&&(i=i.map(function(r){return new Oc(r)}))),l(t)?(t.positions=n,t.holes=i,t):new Oc(n,i)};qk.prototype.equals=function(e){return this===e||e instanceof qk&&X.equals(this.polygon._positions,e.polygon._positions)&&X.equals(this.polygon._holes,e.polygon._holes)};function iyt(e,t,n,i){let r=t.polygon;if(!l(r))return;let o=Ko(r.interval),s=e.polygon;l(s)||(e.polygon=s=new em),Ee(Boolean,s,"show",r.show,o,i,n),Xk(s,"_positions",r.positions,n),j_t(s,"_holes",r.holes,n),(l(s._positions)||l(s._holes))&&(s.hierarchy=new qk(s)),Ee(Number,s,"height",r.height,o,i,n),Ee(We,s,"heightReference",r.heightReference,o,i,n),Ee(Number,s,"extrudedHeight",r.extrudedHeight,o,i,n),Ee(We,s,"extrudedHeightReference",r.extrudedHeightReference,o,i,n),Ee(lh,s,"stRotation",r.stRotation,o,i,n),Ee(Number,s,"granularity",r.granularity,o,i,n),Ee(Boolean,s,"fill",r.fill,o,i,n),ed(s,"material",r.material,o,i,n),Ee(Boolean,s,"outline",r.outline,o,i,n),Ee(z,s,"outlineColor",r.outlineColor,o,i,n),Ee(Number,s,"outlineWidth",r.outlineWidth,o,i,n),Ee(Boolean,s,"perPositionHeight",r.perPositionHeight,o,i,n),Ee(Boolean,s,"closeTop",r.closeTop,o,i,n),Ee(Boolean,s,"closeBottom",r.closeBottom,o,i,n),Ee(ln,s,"arcType",r.arcType,o,i,n),Ee(Dn,s,"shadows",r.shadows,o,i,n),Ee(Ht,s,"distanceDisplayCondition",r.distanceDisplayCondition,o,i,n),Ee(ei,s,"classificationType",r.classificationType,o,i,n),Ee(Number,s,"zIndex",r.zIndex,o,i,n)}function ryt(e){return e?ln.GEODESIC:ln.NONE}function oyt(e,t,n,i){let r=t.polyline;if(!l(r))return;let o=Ko(r.interval),s=e.polyline;if(l(s)||(e.polyline=s=new el),Ee(Boolean,s,"show",r.show,o,i,n),Xk(s,"positions",r.positions,n),Ee(Number,s,"width",r.width,o,i,n),Ee(Number,s,"granularity",r.granularity,o,i,n),ed(s,"material",r.material,o,i,n),ed(s,"depthFailMaterial",r.depthFailMaterial,o,i,n),Ee(ln,s,"arcType",r.arcType,o,i,n),Ee(Boolean,s,"clampToGround",r.clampToGround,o,i,n),Ee(Dn,s,"shadows",r.shadows,o,i,n),Ee(Ht,s,"distanceDisplayCondition",r.distanceDisplayCondition,o,i,n),Ee(ei,s,"classificationType",r.classificationType,o,i,n),Ee(Number,s,"zIndex",r.zIndex,o,i,n),l(r.followSurface)&&!l(r.arcType)){let a={};Ee(Boolean,a,"followSurface",r.followSurface,o,i,n),s.arcType=T_t(a.followSurface,ryt)}}function syt(e,t,n,i){let r=t.polylineVolume;if(!l(r))return;let o=Ko(r.interval),s=e.polylineVolume;l(s)||(e.polylineVolume=s=new Hx),Xk(s,"positions",r.positions,n),H_t(s,"shape",r.shape,n),Ee(Boolean,s,"show",r.show,o,i,n),Ee(rr,s,"cornerType",r.cornerType,o,i,n),Ee(Boolean,s,"fill",r.fill,o,i,n),ed(s,"material",r.material,o,i,n),Ee(Boolean,s,"outline",r.outline,o,i,n),Ee(z,s,"outlineColor",r.outlineColor,o,i,n),Ee(Number,s,"outlineWidth",r.outlineWidth,o,i,n),Ee(Number,s,"granularity",r.granularity,o,i,n),Ee(Dn,s,"shadows",r.shadows,o,i,n),Ee(Ht,s,"distanceDisplayCondition",r.distanceDisplayCondition,o,i,n)}function ayt(e,t,n,i){let r=t.rectangle;if(!l(r))return;let o=Ko(r.interval),s=e.rectangle;l(s)||(e.rectangle=s=new tm),Ee(Boolean,s,"show",r.show,o,i,n),Ee(ie,s,"coordinates",r.coordinates,o,i,n),Ee(Number,s,"height",r.height,o,i,n),Ee(We,s,"heightReference",r.heightReference,o,i,n),Ee(Number,s,"extrudedHeight",r.extrudedHeight,o,i,n),Ee(We,s,"extrudedHeightReference",r.extrudedHeightReference,o,i,n),Ee(lh,s,"rotation",r.rotation,o,i,n),Ee(lh,s,"stRotation",r.stRotation,o,i,n),Ee(Number,s,"granularity",r.granularity,o,i,n),Ee(Boolean,s,"fill",r.fill,o,i,n),ed(s,"material",r.material,o,i,n),Ee(Boolean,s,"outline",r.outline,o,i,n),Ee(z,s,"outlineColor",r.outlineColor,o,i,n),Ee(Number,s,"outlineWidth",r.outlineWidth,o,i,n),Ee(Dn,s,"shadows",r.shadows,o,i,n),Ee(Ht,s,"distanceDisplayCondition",r.distanceDisplayCondition,o,i,n),Ee(ei,s,"classificationType",r.classificationType,o,i,n),Ee(Number,s,"zIndex",r.zIndex,o,i,n)}function cyt(e,t,n,i){let r=t.tileset;if(!l(r))return;let o=Ko(r.interval),s=e.tileset;l(s)||(e.tileset=s=new Vx),Ee(Boolean,s,"show",r.show,o,i,n),Ee(Yk.default,s,"uri",r.uri,o,i,n),Ee(Number,s,"maximumScreenSpaceError",r.maximumScreenSpaceError,o,i,n)}function lyt(e,t,n,i){let r=t.wall;if(!l(r))return;let o=Ko(r.interval),s=e.wall;l(s)||(e.wall=s=new Ig),Ee(Boolean,s,"show",r.show,o,i,n),Xk(s,"positions",r.positions,n),Mve(s,"minimumHeights",r.minimumHeights,n),Mve(s,"maximumHeights",r.maximumHeights,n),Ee(Number,s,"granularity",r.granularity,o,i,n),Ee(Boolean,s,"fill",r.fill,o,i,n),ed(s,"material",r.material,o,i,n),Ee(Boolean,s,"outline",r.outline,o,i,n),Ee(z,s,"outlineColor",r.outlineColor,o,i,n),Ee(Number,s,"outlineWidth",r.outlineWidth,o,i,n),Ee(Dn,s,"shadows",r.shadows,o,i,n),Ee(Ht,s,"distanceDisplayCondition",r.distanceDisplayCondition,o,i,n)}function kve(e,t,n,i,r){let o=e.id;if(l(o)||(o=Kn()),Yee=o,!l(r._version)&&o!=="document")throw new oe("The first CZML packet is required to be the document object.");if(e.delete===!0)t.removeById(o);else if(o==="document")$_t(e,r);else{let s=t.getOrCreateEntity(o),a=e.parent;l(a)&&(s.parent=t.getOrCreateEntity(a));for(let c=n.length-1;c>-1;c--)n[c](s,e,t,i)}Yee=void 0}function uyt(e){let t,n=e._documentPacket.clock;if(!l(n)){if(!l(e._clock)){let r=e._entityCollection.computeAvailability();if(!r.start.equals(nt.MINIMUM_VALUE)){let o=r.start,s=r.stop,a=K.secondsDifference(s,o),c=Math.round(a/120);return t=new Fm,t.startTime=K.clone(o),t.stopTime=K.clone(s),t.clockRange=Rs.LOOP_STOP,t.multiplier=c,t.currentTime=K.clone(o),t.clockStep=Vr.SYSTEM_CLOCK_MULTIPLIER,e._clock=t,!0}}return!1}l(e._clock)?t=e._clock.clone():(t=new Fm,t.startTime=nt.MINIMUM_VALUE.clone(),t.stopTime=nt.MAXIMUM_VALUE.clone(),t.currentTime=nt.MINIMUM_VALUE.clone(),t.clockRange=Rs.LOOP_STOP,t.clockStep=Vr.SYSTEM_CLOCK_MULTIPLIER,t.multiplier=1);let i=Ko(n.interval);return l(i)&&(t.startTime=i.start,t.stopTime=i.stop),l(n.currentTime)&&(t.currentTime=K.fromIso8601(n.currentTime)),l(n.range)&&(t.clockRange=Rs[n.range]??Rs.LOOP_STOP),l(n.step)&&(t.clockStep=Vr[n.step]??Vr.SYSTEM_CLOCK_MULTIPLIER),l(n.multiplier)&&(t.multiplier=n.multiplier),t.equals(e._clock)?!1:(e._clock=t.clone(e._clock),!0)}function jve(e,t,n,i){n=n??H.EMPTY_OBJECT;let r=t,o=n.sourceUri,s=n.credit;if(typeof s=="string"&&(s=new It(s)),e._credit=s,typeof t=="string"||t instanceof De){t=De.createIfNeeded(t),r=t.fetchJson(),o=o??t.clone();let a=e._resourceCredits,c=t.credits;if(l(c)){let u=c.length;for(let f=0;f<u;f++)a.push(c[f])}}return o=De.createIfNeeded(o),Ds.setLoading(e,!0),Promise.resolve(r).then(function(a){return fyt(e,a,o,i)}).catch(function(a){return Ds.setLoading(e,!1),e._error.raiseEvent(e,a),console.log(a),Promise.reject(a)})}function fyt(e,t,n,i){Ds.setLoading(e,!0);let r=e._entityCollection;i&&(e._version=void 0,e._documentPacket=new Hve,r.removeAll()),sa._processCzml(t,r,n,void 0,e);let o=uyt(e),s=e._documentPacket;return l(s.name)&&e._name!==s.name?(e._name=s.name,o=!0):!l(e._name)&&l(n)&&(e._name=I_(n.getUrlComponent()),o=!0),Ds.setLoading(e,!1),o&&e._changed.raiseEvent(e),e}function Hve(){this.name=void 0,this.clock=void 0}function sa(e){this._name=e,this._changed=new be,this._error=new be,this._isLoading=!1,this._loading=new be,this._clock=void 0,this._documentPacket=new Hve,this._version=void 0,this._entityCollection=new Ya(this),this._entityCluster=new $f,this._credit=void 0,this._resourceCredits=[]}sa.load=function(e,t){return new sa().load(e,t)};Object.defineProperties(sa.prototype,{name:{get:function(){return this._name}},clock:{get:function(){return this._clock}},entities:{get:function(){return this._entityCollection}},isLoading:{get:function(){return this._isLoading}},changedEvent:{get:function(){return this._changed}},errorEvent:{get:function(){return this._error}},loadingEvent:{get:function(){return this._loading}},show:{get:function(){return this._entityCollection.show},set:function(e){this._entityCollection.show=e}},clustering:{get:function(){return this._entityCluster},set:function(e){this._entityCluster=e}},credit:{get:function(){return this._credit}}});sa.updaters=[q_t,Y_t,X_t,K_t,J_t,Z_t,Q_t,eyt,M_t,N_t,tyt,nyt,iyt,oyt,syt,k_t,ayt,L_t,cyt,F_t,lyt,B_t,G_t];sa.registerUpdater=function(e){sa.updaters.includes(e)||sa.updaters.push(e)};sa.unregisterUpdater=function(e){if(sa.updaters.includes(e)){let t=sa.updaters.indexOf(e);sa.updaters.splice(t,1)}};sa.prototype.process=function(e,t){return jve(this,e,t,!1)};sa.prototype.load=function(e,t){return jve(this,e,t,!0)};sa.prototype.update=function(e){return!0};sa.processPacketData=Ee;sa.processPositionPacketData=Vve;sa.processMaterialPacketData=ed;sa._processCzml=function(e,t,n,i,r){if(i=i??sa.updaters,Array.isArray(e))for(let o=0,s=e.length;o<s;++o)kve(e[o],t,i,n,r);else kve(e,t,i,n,r)};var Kk=sa;function hu(){this._dataSources=[],this._dataSourceAdded=new be,this._dataSourceRemoved=new be,this._dataSourceMoved=new be}Object.defineProperties(hu.prototype,{length:{get:function(){return this._dataSources.length}},dataSourceAdded:{get:function(){return this._dataSourceAdded}},dataSourceRemoved:{get:function(){return this._dataSourceRemoved}},dataSourceMoved:{get:function(){return this._dataSourceMoved}}});hu.prototype.add=function(e){let t=this,n=this._dataSources;return Promise.resolve(e).then(function(i){return n===t._dataSources&&(t._dataSources.push(i),t._dataSourceAdded.raiseEvent(t,i)),i})};hu.prototype.remove=function(e,t){t=t??!1;let n=this._dataSources.indexOf(e);return n!==-1?(this._dataSources.splice(n,1),this._dataSourceRemoved.raiseEvent(this,e),t&&typeof e.destroy=="function"&&e.destroy(),!0):!1};hu.prototype.removeAll=function(e){e=e??!1;let t=this._dataSources;for(let n=0,i=t.length;n<i;++n){let r=t[n];this._dataSourceRemoved.raiseEvent(this,r),e&&typeof r.destroy=="function"&&r.destroy()}this._dataSources=[]};hu.prototype.contains=function(e){return this.indexOf(e)!==-1};hu.prototype.indexOf=function(e){return this._dataSources.indexOf(e)};hu.prototype.get=function(e){return this._dataSources[e]};hu.prototype.getByName=function(e){return this._dataSources.filter(function(t){return t.name===e})};function RG(e,t){return e.indexOf(t)}function Gve(e,t,n){let i=e._dataSources,r=i.length-1;if(t=D.clamp(t,0,r),n=D.clamp(n,0,r),t===n)return;let o=i[t];i[t]=i[n],i[n]=o,e.dataSourceMoved.raiseEvent(o,n,t)}hu.prototype.raise=function(e){let t=RG(this._dataSources,e);Gve(this,t,t+1)};hu.prototype.lower=function(e){let t=RG(this._dataSources,e);Gve(this,t,t-1)};hu.prototype.raiseToTop=function(e){let t=RG(this._dataSources,e);t!==this._dataSources.length-1&&(this._dataSources.splice(t,1),this._dataSources.push(e),this.dataSourceMoved.raiseEvent(e,this._dataSources.length-1,t))};hu.prototype.lowerToBottom=function(e){let t=RG(this._dataSources,e);t!==0&&(this._dataSources.splice(t,1),this._dataSources.splice(0,0,e),this.dataSourceMoved.raiseEvent(e,0,t))};hu.prototype.isDestroyed=function(){return!1};hu.prototype.destroy=function(){return this.removeAll(!0),le(this)};var $k=hu;function yc(e){e=e??H.EMPTY_OBJECT,this._primitives=[],this._guid=Kn(),this._primitiveAdded=new be,this._primitiveRemoved=new be,this._zIndex=void 0,this.show=e.show??!0,this.destroyPrimitives=e.destroyPrimitives??!0,this._countReferences=e.countReferences??!1}Object.defineProperties(yc.prototype,{length:{get:function(){return this._primitives.length}},primitiveAdded:{get:function(){return this._primitiveAdded}},primitiveRemoved:{get:function(){return this._primitiveRemoved}}});yc.prototype.add=function(e,t){let n=l(t),i=e._external=e._external||{},r=i._composites=i._composites||{};return r[this._guid]={collection:this},n?this._primitives.splice(t,0,e):this._primitives.push(e),this._countReferences&&(l(i._referenceCount)?++i._referenceCount:i._referenceCount=1),this._primitiveAdded.raiseEvent(e),e};yc.prototype.remove=function(e){if(this.contains(e)){let t=this._primitives.indexOf(e);if(t!==-1)return this._primitives.splice(t,1),delete e._external._composites[this._guid],this._countReferences&&e._external._referenceCount--,this.destroyPrimitives&&(!this._countReferences||e._external._referenceCount<=0)&&e.destroy(),this._primitiveRemoved.raiseEvent(e),!0}return!1};yc.prototype.removeAndDestroy=function(e){let t=this.remove(e);return t&&!this.destroyPrimitives&&e.destroy(),t};yc.prototype.removeAll=function(){let e=this._primitives,t=e.length;for(let n=0;n<t;++n){let i=e[n];delete i._external._composites[this._guid],this._countReferences&&i._external._referenceCount--,this.destroyPrimitives&&(!this._countReferences||i._external._referenceCount<=0)&&i.destroy(),this._primitiveRemoved.raiseEvent(i)}this._primitives=[]};yc.prototype.contains=function(e){return!!(l(e)&&e._external&&e._external._composites&&e._external._composites[this._guid])};function OG(e,t){return e._primitives.indexOf(t)}yc.prototype.raise=function(e){if(l(e)){let t=OG(this,e),n=this._primitives;if(t!==n.length-1){let i=n[t];n[t]=n[t+1],n[t+1]=i}}};yc.prototype.raiseToTop=function(e){if(l(e)){let t=OG(this,e),n=this._primitives;t!==n.length-1&&(n.splice(t,1),n.push(e))}};yc.prototype.lower=function(e){if(l(e)){let t=OG(this,e),n=this._primitives;if(t!==0){let i=n[t];n[t]=n[t-1],n[t-1]=i}}};yc.prototype.lowerToBottom=function(e){if(l(e)){let t=OG(this,e),n=this._primitives;t!==0&&(n.splice(t,1),n.unshift(e))}};yc.prototype.get=function(e){return this._primitives[e]};yc.prototype.update=function(e){if(!this.show)return;let t=this._primitives;for(let n=0;n<t.length;++n)t[n].update(e)};yc.prototype.prePassesUpdate=function(e){let t=this._primitives;for(let n=0;n<t.length;++n){let i=t[n];l(i.prePassesUpdate)&&i.prePassesUpdate(e)}};yc.prototype.updateForPass=function(e,t){let n=this._primitives;for(let i=0;i<n.length;++i){let r=n[i];l(r.updateForPass)&&r.updateForPass(e,t)}};yc.prototype.postPassesUpdate=function(e){let t=this._primitives;for(let n=0;n<t.length;++n){let i=t[n];l(i.postPassesUpdate)&&i.postPassesUpdate(e)}};yc.prototype.isDestroyed=function(){return!1};yc.prototype.destroy=function(){return this.removeAll(),le(this)};var xl=yc;function c0(){this._length=0,this._collections={},this._collectionsArray=[],this.show=!0}Object.defineProperties(c0.prototype,{length:{get:function(){return this._length}}});c0.prototype.add=function(e,t){t=t??0;let n=this._collections[t];if(!l(n)){n=new xl({destroyPrimitives:!1}),n._zIndex=t,this._collections[t]=n;let i=this._collectionsArray,r=0;for(;r<i.length&&i[r]._zIndex<t;)r++;i.splice(r,0,n)}return n.add(e),this._length++,e._zIndex=t,e};c0.prototype.set=function(e,t){return t===e._zIndex||(this.remove(e,!0),this.add(e,t)),e};c0.prototype.remove=function(e,t){if(this.contains(e)){let n=e._zIndex,i=this._collections[n],r;return t?r=i.remove(e):r=i.removeAndDestroy(e),r&&this._length--,i.length===0&&(this._collectionsArray.splice(this._collectionsArray.indexOf(i),1),this._collections[n]=void 0,i.destroy()),r}return!1};c0.prototype.removeAll=function(){let e=this._collectionsArray;for(let t=0;t<e.length;t++){let n=e[t];n.destroyPrimitives=!0,n.destroy()}this._collections={},this._collectionsArray=[],this._length=0};c0.prototype.contains=function(e){if(!l(e))return!1;let t=this._collections[e._zIndex];return l(t)&&t.contains(e)};c0.prototype.update=function(e){if(!this.show)return;let t=this._collectionsArray;for(let n=0;n<t.length;n++)t[n].update(e)};c0.prototype.isDestroyed=function(){return!1};c0.prototype.destroy=function(){return this.removeAll(),le(this)};var Jk=c0;function Xw(e,t){this._primitives=e,this._orderedGroundPrimitives=t,this._dynamicUpdaters=new Ut}Xw.prototype.add=function(e,t){this._dynamicUpdaters.set(t.id,t.createDynamicUpdater(this._primitives,this._orderedGroundPrimitives))};Xw.prototype.remove=function(e){let t=e.id,n=this._dynamicUpdaters.get(t);l(n)&&(this._dynamicUpdaters.remove(t),n.destroy())};Xw.prototype.update=function(e){let t=this._dynamicUpdaters.values;for(let n=0,i=t.length;n<i;n++)t[n].update(e);return!0};Xw.prototype.removeAllPrimitives=function(){let e=this._dynamicUpdaters.values;for(let t=0,n=e.length;t<n;t++)e[t].destroy();this._dynamicUpdaters.removeAll()};Xw.prototype.getBoundingSphere=function(e,t){return e=this._dynamicUpdaters.get(e.id),l(e)&&l(e.getBoundingSphere)?e.getBoundingSphere(t):Pt.FAILED};var cE=Xw;var Jee={},MG=new h,Wve=new h,qve=new Le,Yve=new $;function Kw(e,t,n,i,r,o,s,a,c,u){let f=e+t;h.multiplyByScalar(i,Math.cos(f),MG),h.multiplyByScalar(n,Math.sin(f),Wve),h.add(MG,Wve,MG);let d=Math.cos(e);d=d*d;let p=Math.sin(e);p=p*p;let m=o/Math.sqrt(s*d+r*p)/a;return Le.fromAxisAngle(MG,m,qve),$.fromQuaternion(qve,Yve),$.multiplyByVector(Yve,c,u),h.normalize(u,u),h.multiplyByScalar(u,a,u),u}var Xve=new h,Kve=new h,$ee=new h,dyt=new h;Jee.raisePositionsToHeight=function(e,t,n){let i=t.ellipsoid,r=t.height,o=t.extrudedHeight,s=n?e.length/3*2:e.length/3,a=new Float64Array(s*3),c=e.length,u=n?c:0;for(let f=0;f<c;f+=3){let d=f+1,p=f+2,g=h.fromArray(e,f,Xve);i.scaleToGeodeticSurface(g,g);let m=h.clone(g,Kve),y=i.geodeticSurfaceNormal(g,dyt),A=h.multiplyByScalar(y,r,$ee);h.add(g,A,g),n&&(h.multiplyByScalar(y,o,A),h.add(m,A,m),a[f+u]=m.x,a[d+u]=m.y,a[p+u]=m.z),a[f]=g.x,a[d]=g.y,a[p]=g.z}return a};var hyt=new h,myt=new h,pyt=new h;Jee.computeEllipsePositions=function(e,t,n){let i=e.semiMinorAxis,r=e.semiMajorAxis,o=e.rotation,s=e.center,a=e.granularity*8,c=i*i,u=r*r,f=r*i,d=h.magnitude(s),p=h.normalize(s,hyt),g=h.cross(h.UNIT_Z,s,myt);g=h.normalize(g,g);let m=h.cross(p,g,pyt),y=1+Math.ceil(D.PI_OVER_TWO/a),A=D.PI_OVER_TWO/(y-1),b=D.PI_OVER_TWO-y*A;b<0&&(y-=Math.ceil(Math.abs(b)/A));let x=2*(y*(y+2)),T=t?new Array(x*3):void 0,E=0,v=Xve,S=Kve,I=y*4*3,R=I-1,O=0,L=n?new Array(I):void 0,_,C,w,P,M;for(b=D.PI_OVER_TWO,v=Kw(b,o,m,g,c,f,u,d,p,v),t&&(T[E++]=v.x,T[E++]=v.y,T[E++]=v.z),n&&(L[R--]=v.z,L[R--]=v.y,L[R--]=v.x),b=D.PI_OVER_TWO-A,_=1;_<y+1;++_){if(v=Kw(b,o,m,g,c,f,u,d,p,v),S=Kw(Math.PI-b,o,m,g,c,f,u,d,p,S),t){for(T[E++]=v.x,T[E++]=v.y,T[E++]=v.z,w=2*_+2,C=1;C<w-1;++C)P=C/(w-1),M=h.lerp(v,S,P,$ee),T[E++]=M.x,T[E++]=M.y,T[E++]=M.z;T[E++]=S.x,T[E++]=S.y,T[E++]=S.z}n&&(L[R--]=v.z,L[R--]=v.y,L[R--]=v.x,L[O++]=S.x,L[O++]=S.y,L[O++]=S.z),b=D.PI_OVER_TWO-(_+1)*A}for(_=y;_>1;--_){if(b=D.PI_OVER_TWO-(_-1)*A,v=Kw(-b,o,m,g,c,f,u,d,p,v),S=Kw(b+Math.PI,o,m,g,c,f,u,d,p,S),t){for(T[E++]=v.x,T[E++]=v.y,T[E++]=v.z,w=2*(_-1)+2,C=1;C<w-1;++C)P=C/(w-1),M=h.lerp(v,S,P,$ee),T[E++]=M.x,T[E++]=M.y,T[E++]=M.z;T[E++]=S.x,T[E++]=S.y,T[E++]=S.z}n&&(L[R--]=v.z,L[R--]=v.y,L[R--]=v.x,L[O++]=S.x,L[O++]=S.y,L[O++]=S.z)}b=D.PI_OVER_TWO,v=Kw(-b,o,m,g,c,f,u,d,p,v);let F={};return t&&(T[E++]=v.x,T[E++]=v.y,T[E]=v.z,F.positions=T,F.numPts=y),n&&(L[R--]=v.z,L[R--]=v.y,L[R]=v.x,F.outerPositions=L),F};var ef=Jee;var $w=new h,Zee=new h,Qee=new h,$ve=new h,Pa=new U,Jve=new $,gyt=new $,ete=new Le,Zve=new h,Qve=new h,eSe=new h,FG=new he,tSe=new h,nSe=new U,iSe=new U;function rSe(e,t,n){let i=t.vertexFormat,r=t.center,o=t.semiMajorAxis,s=t.semiMinorAxis,a=t.ellipsoid,c=t.stRotation,u=n?e.length/3*2:e.length/3,f=t.shadowVolume,d=i.st?new Float32Array(u*2):void 0,p=i.normal?new Float32Array(u*3):void 0,g=i.tangent?new Float32Array(u*3):void 0,m=i.bitangent?new Float32Array(u*3):void 0,y=f?new Float32Array(u*3):void 0,A=0,b=Zve,x=Qve,T=eSe,E=new Ui(a),v=E.project(a.cartesianToCartographic(r,FG),tSe),S=a.scaleToGeodeticSurface(r,$w);a.geodeticSurfaceNormal(S,S);let I=Jve,R=gyt;if(c!==0){let M=Le.fromAxisAngle(S,c,ete);I=$.fromQuaternion(M,I),M=Le.fromAxisAngle(S,-c,ete),R=$.fromQuaternion(M,R)}else I=$.clone($.IDENTITY,I),R=$.clone($.IDENTITY,R);let O=U.fromElements(Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY,nSe),L=U.fromElements(Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY,iSe),_=e.length,C=n?_:0,w=C/3*2;for(let M=0;M<_;M+=3){let F=M+1,V=M+2,B=h.fromArray(e,M,$w);if(i.st){let j=$.multiplyByVector(I,B,Zee),k=E.project(a.cartesianToCartographic(j,FG),Qee);h.subtract(k,v,k),Pa.x=(k.x+o)/(2*o),Pa.y=(k.y+s)/(2*s),O.x=Math.min(Pa.x,O.x),O.y=Math.min(Pa.y,O.y),L.x=Math.max(Pa.x,L.x),L.y=Math.max(Pa.y,L.y),n&&(d[A+w]=Pa.x,d[A+1+w]=Pa.y),d[A++]=Pa.x,d[A++]=Pa.y}(i.normal||i.tangent||i.bitangent||f)&&(b=a.geodeticSurfaceNormal(B,b),f&&(y[M+C]=-b.x,y[F+C]=-b.y,y[V+C]=-b.z),(i.normal||i.tangent||i.bitangent)&&((i.tangent||i.bitangent)&&(x=h.normalize(h.cross(h.UNIT_Z,b,x),x),$.multiplyByVector(R,x,x)),i.normal&&(p[M]=b.x,p[F]=b.y,p[V]=b.z,n&&(p[M+C]=-b.x,p[F+C]=-b.y,p[V+C]=-b.z)),i.tangent&&(g[M]=x.x,g[F]=x.y,g[V]=x.z,n&&(g[M+C]=-x.x,g[F+C]=-x.y,g[V+C]=-x.z)),i.bitangent&&(T=h.normalize(h.cross(b,x,T),T),m[M]=T.x,m[F]=T.y,m[V]=T.z,n&&(m[M+C]=T.x,m[F+C]=T.y,m[V+C]=T.z))))}if(i.st){_=d.length;for(let M=0;M<_;M+=2)d[M]=(d[M]-O.x)/(L.x-O.x),d[M+1]=(d[M+1]-O.y)/(L.y-O.y)}let P=new Tn;if(i.position){let M=ef.raisePositionsToHeight(e,t,n);P.position=new Ne({componentDatatype:Y.DOUBLE,componentsPerAttribute:3,values:M})}if(i.st&&(P.st=new Ne({componentDatatype:Y.FLOAT,componentsPerAttribute:2,values:d})),i.normal&&(P.normal=new Ne({componentDatatype:Y.FLOAT,componentsPerAttribute:3,values:p})),i.tangent&&(P.tangent=new Ne({componentDatatype:Y.FLOAT,componentsPerAttribute:3,values:g})),i.bitangent&&(P.bitangent=new Ne({componentDatatype:Y.FLOAT,componentsPerAttribute:3,values:m})),f&&(P.extrudeDirection=new Ne({componentDatatype:Y.FLOAT,componentsPerAttribute:3,values:y})),n&&l(t.offsetAttribute)){let M=new Uint8Array(u);if(t.offsetAttribute===mn.TOP)M=M.fill(1,0,u/2);else{let F=t.offsetAttribute===mn.NONE?0:1;M=M.fill(F)}P.applyOffset=new Ne({componentDatatype:Y.UNSIGNED_BYTE,componentsPerAttribute:1,values:M})}return P}function oSe(e){let t=new Array(12*(e*(e+1))-6),n=0,i,r,o,s,a;for(i=0,o=1,s=0;s<3;s++)t[n++]=o++,t[n++]=i,t[n++]=o;for(s=2;s<e+1;++s){for(o=s*(s+1)-1,i=(s-1)*s-1,t[n++]=o++,t[n++]=i,t[n++]=o,r=2*s,a=0;a<r-1;++a)t[n++]=o,t[n++]=i++,t[n++]=i,t[n++]=o++,t[n++]=i,t[n++]=o;t[n++]=o++,t[n++]=i,t[n++]=o}for(r=e*2,++o,++i,s=0;s<r-1;++s)t[n++]=o,t[n++]=i++,t[n++]=i,t[n++]=o++,t[n++]=i,t[n++]=o;for(t[n++]=o,t[n++]=i++,t[n++]=i,t[n++]=o++,t[n++]=i++,t[n++]=i,++i,s=e-1;s>1;--s){for(t[n++]=i++,t[n++]=i,t[n++]=o,r=2*s,a=0;a<r-1;++a)t[n++]=o,t[n++]=i++,t[n++]=i,t[n++]=o++,t[n++]=i,t[n++]=o;t[n++]=i++,t[n++]=i++,t[n++]=o++}for(s=0;s<3;s++)t[n++]=i++,t[n++]=i,t[n++]=o;return t}var lE=new h;function _yt(e){let t=e.center;lE=h.multiplyByScalar(e.ellipsoid.geodeticSurfaceNormal(t,lE),e.height,lE),lE=h.add(t,lE,lE);let n=new ue(lE,e.semiMajorAxis),i=ef.computeEllipsePositions(e,!0,!1),r=i.positions,o=i.numPts,s=rSe(r,e,!1),a=oSe(o);return a=je.createTypedArray(r.length/3,a),{boundingSphere:n,attributes:s,indices:a}}function yyt(e,t){let n=t.vertexFormat,i=t.center,r=t.semiMajorAxis,o=t.semiMinorAxis,s=t.ellipsoid,a=t.height,c=t.extrudedHeight,u=t.stRotation,f=e.length/3*2,d=new Float64Array(f*3),p=n.st?new Float32Array(f*2):void 0,g=n.normal?new Float32Array(f*3):void 0,m=n.tangent?new Float32Array(f*3):void 0,y=n.bitangent?new Float32Array(f*3):void 0,A=t.shadowVolume,b=A?new Float32Array(f*3):void 0,x=0,T=Zve,E=Qve,v=eSe,S=new Ui(s),I=S.project(s.cartesianToCartographic(i,FG),tSe),R=s.scaleToGeodeticSurface(i,$w);s.geodeticSurfaceNormal(R,R);let O=Le.fromAxisAngle(R,u,ete),L=$.fromQuaternion(O,Jve),_=U.fromElements(Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY,nSe),C=U.fromElements(Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY,iSe),w=e.length,P=w/3*2;for(let F=0;F<w;F+=3){let V=F+1,B=F+2,j=h.fromArray(e,F,$w),k;if(n.st){let q=$.multiplyByVector(L,j,Zee),Q=S.project(s.cartesianToCartographic(q,FG),Qee);h.subtract(Q,I,Q),Pa.x=(Q.x+r)/(2*r),Pa.y=(Q.y+o)/(2*o),_.x=Math.min(Pa.x,_.x),_.y=Math.min(Pa.y,_.y),C.x=Math.max(Pa.x,C.x),C.y=Math.max(Pa.y,C.y),p[x+P]=Pa.x,p[x+1+P]=Pa.y,p[x++]=Pa.x,p[x++]=Pa.y}j=s.scaleToGeodeticSurface(j,j),k=h.clone(j,Zee),T=s.geodeticSurfaceNormal(j,T),A&&(b[F+w]=-T.x,b[V+w]=-T.y,b[B+w]=-T.z);let G=h.multiplyByScalar(T,a,$ve);if(j=h.add(j,G,j),G=h.multiplyByScalar(T,c,G),k=h.add(k,G,k),n.position&&(d[F+w]=k.x,d[V+w]=k.y,d[B+w]=k.z,d[F]=j.x,d[V]=j.y,d[B]=j.z),n.normal||n.tangent||n.bitangent){v=h.clone(T,v);let q=h.fromArray(e,(F+3)%w,$ve);h.subtract(q,j,q);let Q=h.subtract(k,j,Qee);T=h.normalize(h.cross(Q,q,T),T),n.normal&&(g[F]=T.x,g[V]=T.y,g[B]=T.z,g[F+w]=T.x,g[V+w]=T.y,g[B+w]=T.z),n.tangent&&(E=h.normalize(h.cross(v,T,E),E),m[F]=E.x,m[V]=E.y,m[B]=E.z,m[F+w]=E.x,m[F+1+w]=E.y,m[F+2+w]=E.z),n.bitangent&&(y[F]=v.x,y[V]=v.y,y[B]=v.z,y[F+w]=v.x,y[V+w]=v.y,y[B+w]=v.z)}}if(n.st){w=p.length;for(let F=0;F<w;F+=2)p[F]=(p[F]-_.x)/(C.x-_.x),p[F+1]=(p[F+1]-_.y)/(C.y-_.y)}let M=new Tn;if(n.position&&(M.position=new Ne({componentDatatype:Y.DOUBLE,componentsPerAttribute:3,values:d})),n.st&&(M.st=new Ne({componentDatatype:Y.FLOAT,componentsPerAttribute:2,values:p})),n.normal&&(M.normal=new Ne({componentDatatype:Y.FLOAT,componentsPerAttribute:3,values:g})),n.tangent&&(M.tangent=new Ne({componentDatatype:Y.FLOAT,componentsPerAttribute:3,values:m})),n.bitangent&&(M.bitangent=new Ne({componentDatatype:Y.FLOAT,componentsPerAttribute:3,values:y})),A&&(M.extrudeDirection=new Ne({componentDatatype:Y.FLOAT,componentsPerAttribute:3,values:b})),l(t.offsetAttribute)){let F=new Uint8Array(f);if(t.offsetAttribute===mn.TOP)F=F.fill(1,0,f/2);else{let V=t.offsetAttribute===mn.NONE?0:1;F=F.fill(V)}M.applyOffset=new Ne({componentDatatype:Y.UNSIGNED_BYTE,componentsPerAttribute:1,values:F})}return M}function Ayt(e){let t=e.length/3,n=je.createTypedArray(t,t*6),i=0;for(let r=0;r<t;r++){let o=r,s=r+t,a=(o+1)%t,c=a+t;n[i++]=o,n[i++]=s,n[i++]=a,n[i++]=a,n[i++]=s,n[i++]=c}return n}var NG=new ue,LG=new ue;function byt(e){let t=e.center,n=e.ellipsoid,i=e.semiMajorAxis,r=h.multiplyByScalar(n.geodeticSurfaceNormal(t,$w),e.height,$w);NG.center=h.add(t,r,NG.center),NG.radius=i,r=h.multiplyByScalar(n.geodeticSurfaceNormal(t,r),e.extrudedHeight,r),LG.center=h.add(t,r,LG.center),LG.radius=i;let o=ef.computeEllipsePositions(e,!0,!0),s=o.positions,a=o.numPts,c=o.outerPositions,u=ue.union(NG,LG),f=rSe(s,e,!0),d=oSe(a),p=d.length;d.length=p*2;let g=s.length/3;for(let E=0;E<p;E+=3)d[E+p]=d[E+2]+g,d[E+1+p]=d[E+1]+g,d[E+2+p]=d[E]+g;let m=je.createTypedArray(g*2/3,d),y=new St({attributes:f,indices:m,primitiveType:Oe.TRIANGLES}),A=yyt(c,e);d=Ayt(c);let b=je.createTypedArray(c.length*2/3,d),x=new St({attributes:A,indices:b,primitiveType:Oe.TRIANGLES}),T=Hn.combineInstances([new Ft({geometry:y}),new Ft({geometry:x})]);return{boundingSphere:u,attributes:T[0].attributes,indices:T[0].indices}}function sSe(e,t,n,i,r,o,s){let c=ef.computeEllipsePositions({center:e,semiMajorAxis:t,semiMinorAxis:n,rotation:i,granularity:r},!1,!0).outerPositions,u=c.length/3,f=new Array(u);for(let p=0;p<u;++p)f[p]=h.fromArray(c,p*3);let d=ie.fromCartesianArray(f,o,s);return d.width>D.PI&&(d.north=d.north>0?D.PI_OVER_TWO-D.EPSILON7:d.north,d.south=d.south<0?D.EPSILON7-D.PI_OVER_TWO:d.south,d.east=D.PI,d.west=-D.PI),d}function u0(e){e=e??H.EMPTY_OBJECT;let t=e.center,n=e.ellipsoid??ee.default,i=e.semiMajorAxis,r=e.semiMinorAxis,o=e.granularity??D.RADIANS_PER_DEGREE,s=e.vertexFormat??Be.DEFAULT,a=e.height??0,c=e.extrudedHeight??a;this._center=h.clone(t),this._semiMajorAxis=i,this._semiMinorAxis=r,this._ellipsoid=ee.clone(n),this._rotation=e.rotation??0,this._stRotation=e.stRotation??0,this._height=Math.max(c,a),this._granularity=o,this._vertexFormat=Be.clone(s),this._extrudedHeight=Math.min(c,a),this._shadowVolume=e.shadowVolume??!1,this._workerName="createEllipseGeometry",this._offsetAttribute=e.offsetAttribute,this._rectangle=void 0,this._textureCoordinateRotationPoints=void 0}u0.packedLength=h.packedLength+ee.packedLength+Be.packedLength+9;u0.pack=function(e,t,n){return n=n??0,h.pack(e._center,t,n),n+=h.packedLength,ee.pack(e._ellipsoid,t,n),n+=ee.packedLength,Be.pack(e._vertexFormat,t,n),n+=Be.packedLength,t[n++]=e._semiMajorAxis,t[n++]=e._semiMinorAxis,t[n++]=e._rotation,t[n++]=e._stRotation,t[n++]=e._height,t[n++]=e._granularity,t[n++]=e._extrudedHeight,t[n++]=e._shadowVolume?1:0,t[n]=e._offsetAttribute??-1,t};var aSe=new h,cSe=new ee,lSe=new Be,l0={center:aSe,ellipsoid:cSe,vertexFormat:lSe,semiMajorAxis:void 0,semiMinorAxis:void 0,rotation:void 0,stRotation:void 0,height:void 0,granularity:void 0,extrudedHeight:void 0,shadowVolume:void 0,offsetAttribute:void 0};u0.unpack=function(e,t,n){t=t??0;let i=h.unpack(e,t,aSe);t+=h.packedLength;let r=ee.unpack(e,t,cSe);t+=ee.packedLength;let o=Be.unpack(e,t,lSe);t+=Be.packedLength;let s=e[t++],a=e[t++],c=e[t++],u=e[t++],f=e[t++],d=e[t++],p=e[t++],g=e[t++]===1,m=e[t];return l(n)?(n._center=h.clone(i,n._center),n._ellipsoid=ee.clone(r,n._ellipsoid),n._vertexFormat=Be.clone(o,n._vertexFormat),n._semiMajorAxis=s,n._semiMinorAxis=a,n._rotation=c,n._stRotation=u,n._height=f,n._granularity=d,n._extrudedHeight=p,n._shadowVolume=g,n._offsetAttribute=m===-1?void 0:m,n):(l0.height=f,l0.extrudedHeight=p,l0.granularity=d,l0.stRotation=u,l0.rotation=c,l0.semiMajorAxis=s,l0.semiMinorAxis=a,l0.shadowVolume=g,l0.offsetAttribute=m===-1?void 0:m,new u0(l0))};u0.computeRectangle=function(e,t){e=e??H.EMPTY_OBJECT;let n=e.center,i=e.ellipsoid??ee.default,r=e.semiMajorAxis,o=e.semiMinorAxis,s=e.granularity??D.RADIANS_PER_DEGREE,a=e.rotation??0;return sSe(n,r,o,a,s,i,t)};u0.createGeometry=function(e){if(e._semiMajorAxis<=0||e._semiMinorAxis<=0)return;let t=e._height,n=e._extrudedHeight,i=!D.equalsEpsilon(t,n,0,D.EPSILON2);e._center=e._ellipsoid.scaleToGeodeticSurface(e._center,e._center);let r={center:e._center,semiMajorAxis:e._semiMajorAxis,semiMinorAxis:e._semiMinorAxis,ellipsoid:e._ellipsoid,rotation:e._rotation,height:t,granularity:e._granularity,vertexFormat:e._vertexFormat,stRotation:e._stRotation},o;if(i)r.extrudedHeight=n,r.shadowVolume=e._shadowVolume,r.offsetAttribute=e._offsetAttribute,o=byt(r);else if(o=_yt(r),l(e._offsetAttribute)){let s=o.attributes.position.values.length,a=e._offsetAttribute===mn.NONE?0:1,c=new Uint8Array(s/3).fill(a);o.attributes.applyOffset=new Ne({componentDatatype:Y.UNSIGNED_BYTE,componentsPerAttribute:1,values:c})}return new St({attributes:o.attributes,indices:o.indices,primitiveType:Oe.TRIANGLES,boundingSphere:o.boundingSphere,offsetAttribute:e._offsetAttribute})};u0.createShadowVolume=function(e,t,n){let i=e._granularity,r=e._ellipsoid,o=t(i,r),s=n(i,r);return new u0({center:e._center,semiMajorAxis:e._semiMajorAxis,semiMinorAxis:e._semiMinorAxis,ellipsoid:r,rotation:e._rotation,stRotation:e._stRotation,granularity:i,extrudedHeight:o,height:s,vertexFormat:Be.POSITION_ONLY,shadowVolume:!0})};function xyt(e){let t=-e._stRotation;if(t===0)return[0,0,0,1,1,0];let i=ef.computeEllipsePositions({center:e._center,semiMajorAxis:e._semiMajorAxis,semiMinorAxis:e._semiMinorAxis,rotation:e._rotation,granularity:e._granularity},!1,!0).outerPositions,r=i.length/3,o=new Array(r);for(let c=0;c<r;++c)o[c]=h.fromArray(i,c*3);let s=e._ellipsoid,a=e.rectangle;return St._textureCoordinateRotationPoints(o,t,s,a)}Object.defineProperties(u0.prototype,{rectangle:{get:function(){return l(this._rectangle)||(this._rectangle=sSe(this._center,this._semiMajorAxis,this._semiMinorAxis,this._rotation,this._granularity,this._ellipsoid)),this._rectangle}},textureCoordinateRotationPoints:{get:function(){return l(this._textureCoordinateRotationPoints)||(this._textureCoordinateRotationPoints=xyt(this)),this._textureCoordinateRotationPoints}}});var mu=u0;var uSe=new h,uE=new h;function Tyt(e){let t=e.center;uE=h.multiplyByScalar(e.ellipsoid.geodeticSurfaceNormal(t,uE),e.height,uE),uE=h.add(t,uE,uE);let n=new ue(uE,e.semiMajorAxis),i=ef.computeEllipsePositions(e,!1,!0).outerPositions,r=new Tn({position:new Ne({componentDatatype:Y.DOUBLE,componentsPerAttribute:3,values:ef.raisePositionsToHeight(i,e,!1)})}),o=i.length/3,s=je.createTypedArray(o,o*2),a=0;for(let c=0;c<o;++c)s[a++]=c,s[a++]=(c+1)%o;return{boundingSphere:n,attributes:r,indices:s}}var BG=new ue,kG=new ue;function Eyt(e){let t=e.center,n=e.ellipsoid,i=e.semiMajorAxis,r=h.multiplyByScalar(n.geodeticSurfaceNormal(t,uSe),e.height,uSe);BG.center=h.add(t,r,BG.center),BG.radius=i,r=h.multiplyByScalar(n.geodeticSurfaceNormal(t,r),e.extrudedHeight,r),kG.center=h.add(t,r,kG.center),kG.radius=i;let o=ef.computeEllipsePositions(e,!1,!0).outerPositions,s=new Tn({position:new Ne({componentDatatype:Y.DOUBLE,componentsPerAttribute:3,values:ef.raisePositionsToHeight(o,e,!0)})});o=s.position.values;let a=ue.union(BG,kG),c=o.length/3;if(l(e.offsetAttribute)){let m=new Uint8Array(c);if(e.offsetAttribute===mn.TOP)m=m.fill(1,0,c/2);else{let y=e.offsetAttribute===mn.NONE?0:1;m=m.fill(y)}s.applyOffset=new Ne({componentDatatype:Y.UNSIGNED_BYTE,componentsPerAttribute:1,values:m})}let u=e.numberOfVerticalLines??16;u=D.clamp(u,0,c/2);let f=je.createTypedArray(c,c*2+u*2);c/=2;let d=0,p;for(p=0;p<c;++p)f[d++]=p,f[d++]=(p+1)%c,f[d++]=p+c,f[d++]=(p+1)%c+c;let g;if(u>0){let m=Math.min(u,c);g=Math.round(c/m);let y=Math.min(g*u,c);for(p=0;p<y;p+=g)f[d++]=p,f[d++]=p+c}return{boundingSphere:a,attributes:s,indices:f}}function Jw(e){e=e??H.EMPTY_OBJECT;let t=e.center,n=e.ellipsoid??ee.default,i=e.semiMajorAxis,r=e.semiMinorAxis,o=e.granularity??D.RADIANS_PER_DEGREE,s=e.height??0,a=e.extrudedHeight??s;this._center=h.clone(t),this._semiMajorAxis=i,this._semiMinorAxis=r,this._ellipsoid=ee.clone(n),this._rotation=e.rotation??0,this._height=Math.max(a,s),this._granularity=o,this._extrudedHeight=Math.min(a,s),this._numberOfVerticalLines=Math.max(e.numberOfVerticalLines??16,0),this._offsetAttribute=e.offsetAttribute,this._workerName="createEllipseOutlineGeometry"}Jw.packedLength=h.packedLength+ee.packedLength+8;Jw.pack=function(e,t,n){return n=n??0,h.pack(e._center,t,n),n+=h.packedLength,ee.pack(e._ellipsoid,t,n),n+=ee.packedLength,t[n++]=e._semiMajorAxis,t[n++]=e._semiMinorAxis,t[n++]=e._rotation,t[n++]=e._height,t[n++]=e._granularity,t[n++]=e._extrudedHeight,t[n++]=e._numberOfVerticalLines,t[n]=e._offsetAttribute??-1,t};var fSe=new h,dSe=new ee,F_={center:fSe,ellipsoid:dSe,semiMajorAxis:void 0,semiMinorAxis:void 0,rotation:void 0,height:void 0,granularity:void 0,extrudedHeight:void 0,numberOfVerticalLines:void 0,offsetAttribute:void 0};Jw.unpack=function(e,t,n){t=t??0;let i=h.unpack(e,t,fSe);t+=h.packedLength;let r=ee.unpack(e,t,dSe);t+=ee.packedLength;let o=e[t++],s=e[t++],a=e[t++],c=e[t++],u=e[t++],f=e[t++],d=e[t++],p=e[t];return l(n)?(n._center=h.clone(i,n._center),n._ellipsoid=ee.clone(r,n._ellipsoid),n._semiMajorAxis=o,n._semiMinorAxis=s,n._rotation=a,n._height=c,n._granularity=u,n._extrudedHeight=f,n._numberOfVerticalLines=d,n._offsetAttribute=p===-1?void 0:p,n):(F_.height=c,F_.extrudedHeight=f,F_.granularity=u,F_.rotation=a,F_.semiMajorAxis=o,F_.semiMinorAxis=s,F_.numberOfVerticalLines=d,F_.offsetAttribute=p===-1?void 0:p,new Jw(F_))};Jw.createGeometry=function(e){if(e._semiMajorAxis<=0||e._semiMinorAxis<=0)return;let t=e._height,n=e._extrudedHeight,i=!D.equalsEpsilon(t,n,0,D.EPSILON2);e._center=e._ellipsoid.scaleToGeodeticSurface(e._center,e._center);let r={center:e._center,semiMajorAxis:e._semiMajorAxis,semiMinorAxis:e._semiMinorAxis,ellipsoid:e._ellipsoid,rotation:e._rotation,height:t,granularity:e._granularity,numberOfVerticalLines:e._numberOfVerticalLines},o;if(i)r.extrudedHeight=n,r.offsetAttribute=e._offsetAttribute,o=Eyt(r);else if(o=Tyt(r),l(e._offsetAttribute)){let s=o.attributes.position.values.length,a=e._offsetAttribute===mn.NONE?0:1,c=new Uint8Array(s/3).fill(a);o.attributes.applyOffset=new Ne({componentDatatype:Y.UNSIGNED_BYTE,componentsPerAttribute:1,values:c})}return new St({attributes:o.attributes,indices:o.indices,primitiveType:Oe.LINES,boundingSphere:o.boundingSphere,offsetAttribute:e._offsetAttribute})};var td=Jw;var hSe=new z,mSe=h.ZERO,pSe=new h,gSe=new ie;function Cyt(e){this.id=e,this.vertexFormat=void 0,this.center=void 0,this.semiMajorAxis=void 0,this.semiMinorAxis=void 0,this.rotation=void 0,this.height=void 0,this.extrudedHeight=void 0,this.granularity=void 0,this.stRotation=void 0,this.numberOfVerticalLines=void 0,this.offsetAttribute=void 0}function km(e,t){ii.call(this,{entity:e,scene:t,geometryOptions:new Cyt(e),geometryPropertyName:"ellipse",observedPropertyNames:["availability","position","ellipse"]}),this._onEntityPropertyChanged(e,"ellipse",e.ellipse,void 0)}l(Object.create)&&(km.prototype=Object.create(ii.prototype),km.prototype.constructor=km);km.prototype.createFillGeometryInstance=function(e){let t=this._entity,n=t.isAvailable(e),i={show:new Pn(n&&t.isShowing&&this._showProperty.getValue(e)&&this._fillProperty.getValue(e)),distanceDisplayCondition:Qn.fromDistanceDisplayCondition(this._distanceDisplayConditionProperty.getValue(e)),offset:void 0,color:void 0};if(this._materialProperty instanceof Kt){let r;l(this._materialProperty.color)&&(this._materialProperty.color.isConstant||n)&&(r=this._materialProperty.color.getValue(e,hSe)),l(r)||(r=z.WHITE),i.color=Jt.fromColor(r)}return l(this._options.offsetAttribute)&&(i.offset=Tr.fromCartesian3(X.getValueOrDefault(this._terrainOffsetProperty,e,mSe,pSe))),new Ft({id:t,geometry:new mu(this._options),attributes:i})};km.prototype.createOutlineGeometryInstance=function(e){let t=this._entity,n=t.isAvailable(e),i=X.getValueOrDefault(this._outlineColorProperty,e,z.BLACK,hSe),r=this._distanceDisplayConditionProperty.getValue(e),o={show:new Pn(n&&t.isShowing&&this._showProperty.getValue(e)&&this._showOutlineProperty.getValue(e)),color:Jt.fromColor(i),distanceDisplayCondition:Qn.fromDistanceDisplayCondition(r),offset:void 0};return l(this._options.offsetAttribute)&&(o.offset=Tr.fromCartesian3(X.getValueOrDefault(this._terrainOffsetProperty,e,mSe,pSe))),new Ft({id:t,geometry:new td(this._options),attributes:o})};km.prototype._computeCenter=function(e,t){return X.getValueOrUndefined(this._entity.position,e,t)};km.prototype._isHidden=function(e,t){let n=e.position;return!l(n)||!l(t.semiMajorAxis)||!l(t.semiMinorAxis)||Pi.prototype._isHidden.call(this,e,t)};km.prototype._isDynamic=function(e,t){return!e.position.isConstant||!t.semiMajorAxis.isConstant||!t.semiMinorAxis.isConstant||!X.isConstant(t.rotation)||!X.isConstant(t.height)||!X.isConstant(t.extrudedHeight)||!X.isConstant(t.granularity)||!X.isConstant(t.stRotation)||!X.isConstant(t.outlineWidth)||!X.isConstant(t.numberOfVerticalLines)||!X.isConstant(t.zIndex)||this._onTerrain&&!X.isConstant(this._materialProperty)&&!(this._materialProperty instanceof Kt)};km.prototype._setStaticOptions=function(e,t){let n=X.getValueOrUndefined(t.height,nt.MINIMUM_VALUE),i=X.getValueOrDefault(t.heightReference,nt.MINIMUM_VALUE,We.NONE),r=X.getValueOrUndefined(t.extrudedHeight,nt.MINIMUM_VALUE),o=X.getValueOrDefault(t.extrudedHeightReference,nt.MINIMUM_VALUE,We.NONE);l(r)&&!l(n)&&(n=0);let s=this._options;s.vertexFormat=this._materialProperty instanceof Kt?yn.VERTEX_FORMAT:Er.MaterialSupport.TEXTURED.vertexFormat,s.center=e.position.getValue(nt.MINIMUM_VALUE,s.center),s.semiMajorAxis=t.semiMajorAxis.getValue(nt.MINIMUM_VALUE,s.semiMajorAxis),s.semiMinorAxis=t.semiMinorAxis.getValue(nt.MINIMUM_VALUE,s.semiMinorAxis),s.rotation=X.getValueOrUndefined(t.rotation,nt.MINIMUM_VALUE),s.granularity=X.getValueOrUndefined(t.granularity,nt.MINIMUM_VALUE),s.stRotation=X.getValueOrUndefined(t.stRotation,nt.MINIMUM_VALUE),s.numberOfVerticalLines=X.getValueOrUndefined(t.numberOfVerticalLines,nt.MINIMUM_VALUE),s.offsetAttribute=ii.computeGeometryOffsetAttribute(n,i,r,o),s.height=ii.getGeometryHeight(n,i),r=ii.getGeometryExtrudedHeight(r,o),r===ii.CLAMP_TO_GROUND&&(r=Mi.getMinimumMaximumHeights(mu.computeRectangle(s,gSe)).minimumTerrainHeight),s.extrudedHeight=r};km.DynamicGeometryUpdater=Zw;function Zw(e,t,n){Ii.call(this,e,t,n)}l(Object.create)&&(Zw.prototype=Object.create(Ii.prototype),Zw.prototype.constructor=Zw);Zw.prototype._isHidden=function(e,t,n){let i=this._options;return!l(i.center)||!l(i.semiMajorAxis)||!l(i.semiMinorAxis)||Ii.prototype._isHidden.call(this,e,t,n)};Zw.prototype._setOptions=function(e,t,n){let i=this._options,r=X.getValueOrUndefined(t.height,n),o=X.getValueOrDefault(t.heightReference,n,We.NONE),s=X.getValueOrUndefined(t.extrudedHeight,n),a=X.getValueOrDefault(t.extrudedHeightReference,n,We.NONE);l(s)&&!l(r)&&(r=0),i.center=X.getValueOrUndefined(e.position,n,i.center),i.semiMajorAxis=X.getValueOrUndefined(t.semiMajorAxis,n),i.semiMinorAxis=X.getValueOrUndefined(t.semiMinorAxis,n),i.rotation=X.getValueOrUndefined(t.rotation,n),i.granularity=X.getValueOrUndefined(t.granularity,n),i.stRotation=X.getValueOrUndefined(t.stRotation,n),i.numberOfVerticalLines=X.getValueOrUndefined(t.numberOfVerticalLines,n),i.offsetAttribute=ii.computeGeometryOffsetAttribute(r,o,s,a),i.height=ii.getGeometryHeight(r,o),s=ii.getGeometryExtrudedHeight(s,a),s===ii.CLAMP_TO_GROUND&&(s=Mi.getMinimumMaximumHeights(mu.computeRectangle(i,gSe)).minimumTerrainHeight),i.extrudedHeight=s};var Zk=km;var vyt=new h,Syt=new h,wyt=new h,Iyt=new h,Pyt=new h,Dyt=new h(1,1,1),_Se=Math.cos,ySe=Math.sin;function B_(e){e=e??H.EMPTY_OBJECT;let t=e.radii??Dyt,n=e.innerRadii??t,i=e.minimumClock??0,r=e.maximumClock??D.TWO_PI,o=e.minimumCone??0,s=e.maximumCone??D.PI,a=Math.round(e.stackPartitions??64),c=Math.round(e.slicePartitions??64),u=e.vertexFormat??Be.DEFAULT;this._radii=h.clone(t),this._innerRadii=h.clone(n),this._minimumClock=i,this._maximumClock=r,this._minimumCone=o,this._maximumCone=s,this._stackPartitions=a,this._slicePartitions=c,this._vertexFormat=Be.clone(u),this._offsetAttribute=e.offsetAttribute,this._workerName="createEllipsoidGeometry"}B_.packedLength=2*h.packedLength+Be.packedLength+7;B_.pack=function(e,t,n){return n=n??0,h.pack(e._radii,t,n),n+=h.packedLength,h.pack(e._innerRadii,t,n),n+=h.packedLength,Be.pack(e._vertexFormat,t,n),n+=Be.packedLength,t[n++]=e._minimumClock,t[n++]=e._maximumClock,t[n++]=e._minimumCone,t[n++]=e._maximumCone,t[n++]=e._stackPartitions,t[n++]=e._slicePartitions,t[n]=e._offsetAttribute??-1,t};var ASe=new h,bSe=new h,xSe=new Be,eb={radii:ASe,innerRadii:bSe,vertexFormat:xSe,minimumClock:void 0,maximumClock:void 0,minimumCone:void 0,maximumCone:void 0,stackPartitions:void 0,slicePartitions:void 0,offsetAttribute:void 0};B_.unpack=function(e,t,n){t=t??0;let i=h.unpack(e,t,ASe);t+=h.packedLength;let r=h.unpack(e,t,bSe);t+=h.packedLength;let o=Be.unpack(e,t,xSe);t+=Be.packedLength;let s=e[t++],a=e[t++],c=e[t++],u=e[t++],f=e[t++],d=e[t++],p=e[t];return l(n)?(n._radii=h.clone(i,n._radii),n._innerRadii=h.clone(r,n._innerRadii),n._vertexFormat=Be.clone(o,n._vertexFormat),n._minimumClock=s,n._maximumClock=a,n._minimumCone=c,n._maximumCone=u,n._stackPartitions=f,n._slicePartitions=d,n._offsetAttribute=p===-1?void 0:p,n):(eb.minimumClock=s,eb.maximumClock=a,eb.minimumCone=c,eb.maximumCone=u,eb.stackPartitions=f,eb.slicePartitions=d,eb.offsetAttribute=p===-1?void 0:p,new B_(eb))};B_.createGeometry=function(e){let t=e._radii;if(t.x<=0||t.y<=0||t.z<=0)return;let n=e._innerRadii;if(n.x<=0||n.y<=0||n.z<=0)return;let i=e._minimumClock,r=e._maximumClock,o=e._minimumCone,s=e._maximumCone,a=e._vertexFormat,c=e._slicePartitions+1,u=e._stackPartitions+1;c=Math.round(c*Math.abs(r-i)/D.TWO_PI),u=Math.round(u*Math.abs(s-o)/D.PI),c<2&&(c=2),u<2&&(u=2);let f,d,p=0,g=[o],m=[i];for(f=0;f<u;f++)g.push(o+f*(s-o)/(u-1));for(g.push(s),d=0;d<c;d++)m.push(i+d*(r-i)/(c-1));m.push(r);let y=g.length,A=m.length,b=0,x=1,T=n.x!==t.x||n.y!==t.y||n.z!==t.z,E=!1,v=!1,S=!1;T&&(x=2,o>0&&(E=!0,b+=c-1),s<Math.PI&&(v=!0,b+=c-1),(r-i)%D.TWO_PI?(S=!0,b+=(u-1)*2+1):b+=1);let I=A*y*x,R=new Float64Array(I*3),O=new Array(I).fill(!1),L=new Array(I).fill(!1),_=c*u*x,C=6*(_+b+1-(c+u)*x),w=je.createTypedArray(_,C),P=a.normal?new Float32Array(I*3):void 0,M=a.tangent?new Float32Array(I*3):void 0,F=a.bitangent?new Float32Array(I*3):void 0,V=a.st?new Float32Array(I*2):void 0,B=new Array(y),j=new Array(y);for(f=0;f<y;f++)B[f]=ySe(g[f]),j[f]=_Se(g[f]);let k=new Array(A),G=new Array(A);for(d=0;d<A;d++)G[d]=_Se(m[d]),k[d]=ySe(m[d]);for(f=0;f<y;f++)for(d=0;d<A;d++)R[p++]=t.x*B[f]*G[d],R[p++]=t.y*B[f]*k[d],R[p++]=t.z*j[f];let q=I/2;if(T)for(f=0;f<y;f++)for(d=0;d<A;d++)R[p++]=n.x*B[f]*G[d],R[p++]=n.y*B[f]*k[d],R[p++]=n.z*j[f],O[q]=!0,f>0&&f!==y-1&&d!==0&&d!==A-1&&(L[q]=!0),q++;p=0;let Q,W;for(f=1;f<y-2;f++)for(Q=f*A,W=(f+1)*A,d=1;d<A-2;d++)w[p++]=W+d,w[p++]=W+d+1,w[p++]=Q+d+1,w[p++]=W+d,w[p++]=Q+d+1,w[p++]=Q+d;if(T){let He=y*A;for(f=1;f<y-2;f++)for(Q=He+f*A,W=He+(f+1)*A,d=1;d<A-2;d++)w[p++]=W+d,w[p++]=Q+d,w[p++]=Q+d+1,w[p++]=W+d,w[p++]=Q+d+1,w[p++]=W+d+1}let J,Z;if(T){if(E)for(Z=y*A,f=1;f<A-2;f++)w[p++]=f,w[p++]=f+1,w[p++]=Z+f+1,w[p++]=f,w[p++]=Z+f+1,w[p++]=Z+f;if(v)for(J=y*A-A,Z=y*A*x-A,f=1;f<A-2;f++)w[p++]=J+f+1,w[p++]=J+f,w[p++]=Z+f,w[p++]=J+f+1,w[p++]=Z+f,w[p++]=Z+f+1}if(S){for(f=1;f<y-2;f++)Z=A*y+A*f,J=A*f,w[p++]=Z,w[p++]=J+A,w[p++]=J,w[p++]=Z,w[p++]=Z+A,w[p++]=J+A;for(f=1;f<y-2;f++)Z=A*y+A*(f+1)-1,J=A*(f+1)-1,w[p++]=J+A,w[p++]=Z,w[p++]=J,w[p++]=J+A,w[p++]=Z+A,w[p++]=Z}let ae=new Tn;a.position&&(ae.position=new Ne({componentDatatype:Y.DOUBLE,componentsPerAttribute:3,values:R}));let Ae=0,fe=0,xe=0,ge=0,we=I/2,Se,Re=ee.fromCartesian3(t),Qe=ee.fromCartesian3(n);if(a.st||a.normal||a.tangent||a.bitangent){for(f=0;f<I;f++){Se=O[f]?Qe:Re;let He=h.fromArray(R,f*3,vyt),Xe=Se.geodeticSurfaceNormal(He,Syt);if(L[f]&&h.negate(Xe,Xe),a.st){let $e=U.negate(Xe,Pyt);V[Ae++]=Math.atan2($e.y,$e.x)/D.TWO_PI+.5,V[Ae++]=Math.asin(Xe.z)/Math.PI+.5}if(a.normal&&(P[fe++]=Xe.x,P[fe++]=Xe.y,P[fe++]=Xe.z),a.tangent||a.bitangent){let $e=wyt,Pe=0,qe;if(O[f]&&(Pe=we),!E&&f>=Pe&&f<Pe+A*2?qe=h.UNIT_X:qe=h.UNIT_Z,h.cross(qe,Xe,$e),h.normalize($e,$e),a.tangent&&(M[xe++]=$e.x,M[xe++]=$e.y,M[xe++]=$e.z),a.bitangent){let st=h.cross(Xe,$e,Iyt);h.normalize(st,st),F[ge++]=st.x,F[ge++]=st.y,F[ge++]=st.z}}}a.st&&(ae.st=new Ne({componentDatatype:Y.FLOAT,componentsPerAttribute:2,values:V})),a.normal&&(ae.normal=new Ne({componentDatatype:Y.FLOAT,componentsPerAttribute:3,values:P})),a.tangent&&(ae.tangent=new Ne({componentDatatype:Y.FLOAT,componentsPerAttribute:3,values:M})),a.bitangent&&(ae.bitangent=new Ne({componentDatatype:Y.FLOAT,componentsPerAttribute:3,values:F}))}if(l(e._offsetAttribute)){let He=R.length,Xe=e._offsetAttribute===mn.NONE?0:1,$e=new Uint8Array(He/3).fill(Xe);ae.applyOffset=new Ne({componentDatatype:Y.UNSIGNED_BYTE,componentsPerAttribute:1,values:$e})}return new St({attributes:ae,indices:w,primitiveType:Oe.TRIANGLES,boundingSphere:ue.fromEllipsoid(Re),offsetAttribute:e._offsetAttribute})};var tte;B_.getUnitEllipsoid=function(){return l(tte)||(tte=B_.createGeometry(new B_({radii:new h(1,1,1),vertexFormat:Be.POSITION_ONLY}))),tte};var Xa=B_;var Ryt=new Kt(z.WHITE),nte=h.ZERO,ite=new h,Oyt=new h,Myt=new h,rte=new z,Nyt=new h(1,1,1);function Lyt(e){this.id=e,this.vertexFormat=void 0,this.radii=void 0,this.innerRadii=void 0,this.minimumClock=void 0,this.maximumClock=void 0,this.minimumCone=void 0,this.maximumCone=void 0,this.stackPartitions=void 0,this.slicePartitions=void 0,this.subdivisions=void 0,this.offsetAttribute=void 0}function nd(e,t){Pi.call(this,{entity:e,scene:t,geometryOptions:new Lyt(e),geometryPropertyName:"ellipsoid",observedPropertyNames:["availability","position","orientation","ellipsoid"]}),this._onEntityPropertyChanged(e,"ellipsoid",e.ellipsoid,void 0)}l(Object.create)&&(nd.prototype=Object.create(Pi.prototype),nd.prototype.constructor=nd);Object.defineProperties(nd.prototype,{terrainOffsetProperty:{get:function(){return this._terrainOffsetProperty}}});nd.prototype.createFillGeometryInstance=function(e,t,n){let i=this._entity,r=i.isAvailable(e),o,s=new Pn(r&&i.isShowing&&this._showProperty.getValue(e)&&this._fillProperty.getValue(e)),a=this._distanceDisplayConditionProperty.getValue(e),c=Qn.fromDistanceDisplayCondition(a),u={show:s,distanceDisplayCondition:c,color:void 0,offset:void 0};if(this._materialProperty instanceof Kt){let f;l(this._materialProperty.color)&&(this._materialProperty.color.isConstant||r)&&(f=this._materialProperty.color.getValue(e,rte)),l(f)||(f=z.WHITE),o=Jt.fromColor(f),u.color=o}return l(this._options.offsetAttribute)&&(u.offset=Tr.fromCartesian3(X.getValueOrDefault(this._terrainOffsetProperty,e,nte,ite))),new Ft({id:i,geometry:new Xa(this._options),modelMatrix:t?void 0:i.computeModelMatrixForHeightReference(e,i.ellipsoid.heightReference,this._options.radii.z*.5,this._scene.ellipsoid,n),attributes:u})};nd.prototype.createOutlineGeometryInstance=function(e,t,n){let i=this._entity,r=i.isAvailable(e),o=X.getValueOrDefault(this._outlineColorProperty,e,z.BLACK,rte),s=this._distanceDisplayConditionProperty.getValue(e),a={show:new Pn(r&&i.isShowing&&this._showProperty.getValue(e)&&this._showOutlineProperty.getValue(e)),color:Jt.fromColor(o),distanceDisplayCondition:Qn.fromDistanceDisplayCondition(s),offset:void 0};return l(this._options.offsetAttribute)&&(a.offset=Tr.fromCartesian3(X.getValueOrDefault(this._terrainOffsetProperty,e,nte,ite))),new Ft({id:i,geometry:new Xf(this._options),modelMatrix:t?void 0:i.computeModelMatrixForHeightReference(e,i.ellipsoid.heightReference,this._options.radii.z*.5,this._scene.ellipsoid,n),attributes:a})};nd.prototype._computeCenter=function(e,t){return X.getValueOrUndefined(this._entity.position,e,t)};nd.prototype._isHidden=function(e,t){return!l(e.position)||!l(t.radii)||Pi.prototype._isHidden.call(this,e,t)};nd.prototype._isDynamic=function(e,t){return!e.position.isConstant||!X.isConstant(e.orientation)||!t.radii.isConstant||!X.isConstant(t.innerRadii)||!X.isConstant(t.stackPartitions)||!X.isConstant(t.slicePartitions)||!X.isConstant(t.outlineWidth)||!X.isConstant(t.minimumClock)||!X.isConstant(t.maximumClock)||!X.isConstant(t.minimumCone)||!X.isConstant(t.maximumCone)||!X.isConstant(t.subdivisions)};nd.prototype._setStaticOptions=function(e,t){let n=X.getValueOrDefault(t.heightReference,nt.MINIMUM_VALUE,We.NONE),i=this._options;i.vertexFormat=this._materialProperty instanceof Kt?yn.VERTEX_FORMAT:Er.MaterialSupport.TEXTURED.vertexFormat,i.radii=t.radii.getValue(nt.MINIMUM_VALUE,i.radii),i.innerRadii=X.getValueOrUndefined(t.innerRadii,i.radii),i.minimumClock=X.getValueOrUndefined(t.minimumClock,nt.MINIMUM_VALUE),i.maximumClock=X.getValueOrUndefined(t.maximumClock,nt.MINIMUM_VALUE),i.minimumCone=X.getValueOrUndefined(t.minimumCone,nt.MINIMUM_VALUE),i.maximumCone=X.getValueOrUndefined(t.maximumCone,nt.MINIMUM_VALUE),i.stackPartitions=X.getValueOrUndefined(t.stackPartitions,nt.MINIMUM_VALUE),i.slicePartitions=X.getValueOrUndefined(t.slicePartitions,nt.MINIMUM_VALUE),i.subdivisions=X.getValueOrUndefined(t.subdivisions,nt.MINIMUM_VALUE),i.offsetAttribute=n!==We.NONE?mn.ALL:void 0};nd.prototype._onEntityPropertyChanged=Pg;nd.DynamicGeometryUpdater=Qk;function Qk(e,t,n){Ii.call(this,e,t,n),this._scene=e._scene,this._modelMatrix=new N,this._attributes=void 0,this._outlineAttributes=void 0,this._lastSceneMode=void 0,this._lastShow=void 0,this._lastOutlineShow=void 0,this._lastOutlineWidth=void 0,this._lastOutlineColor=void 0,this._lastOffset=new h,this._material={}}l(Object.create)&&(Qk.prototype=Object.create(Ii.prototype),Qk.prototype.constructor=Qk);Qk.prototype.update=function(e){let t=this._entity,n=t.ellipsoid;if(!t.isShowing||!t.isAvailable(e)||!X.getValueOrDefault(n.show,e,!0)){l(this._primitive)&&(this._primitive.show=!1),l(this._outlinePrimitive)&&(this._outlinePrimitive.show=!1);return}let i=X.getValueOrUndefined(n.radii,e,Oyt),r=l(i)?t.computeModelMatrixForHeightReference(e,n.heightReference,i.z*.5,this._scene.ellipsoid,this._modelMatrix):void 0;if(!l(r)||!l(i)){l(this._primitive)&&(this._primitive.show=!1),l(this._outlinePrimitive)&&(this._outlinePrimitive.show=!1);return}let o=X.getValueOrDefault(n.fill,e,!0),s=X.getValueOrDefault(n.outline,e,!1),a=X.getValueOrClonedDefault(n.outlineColor,e,z.BLACK,rte),c=_o.getValue(e,n.material??Ryt,this._material),u=X.getValueOrUndefined(n.innerRadii,e,Myt),f=X.getValueOrUndefined(n.minimumClock,e),d=X.getValueOrUndefined(n.maximumClock,e),p=X.getValueOrUndefined(n.minimumCone,e),g=X.getValueOrUndefined(n.maximumCone,e),m=X.getValueOrUndefined(n.stackPartitions,e),y=X.getValueOrUndefined(n.slicePartitions,e),A=X.getValueOrUndefined(n.subdivisions,e),b=X.getValueOrDefault(n.outlineWidth,e,1),x=X.getValueOrDefault(n.heightReference,e,We.NONE),T=x!==We.NONE?mn.ALL:void 0,E=this._scene.mode,v=E===re.SCENE3D&&x===We.NONE,S=this._options,I=this._geometryUpdater.shadowsProperty.getValue(e),O=this._geometryUpdater.distanceDisplayConditionProperty.getValue(e),L=X.getValueOrDefault(this._geometryUpdater.terrainOffsetProperty,e,nte,ite);if(!v||this._lastSceneMode!==E||!l(this._primitive)||S.stackPartitions!==m||S.slicePartitions!==y||l(u)&&!h.equals(S.innerRadii!==u)||S.minimumClock!==f||S.maximumClock!==d||S.minimumCone!==p||S.maximumCone!==g||S.subdivisions!==A||this._lastOutlineWidth!==b||S.offsetAttribute!==T){let C=this._primitives;C.removeAndDestroy(this._primitive),C.removeAndDestroy(this._outlinePrimitive),this._primitive=void 0,this._outlinePrimitive=void 0,this._lastSceneMode=E,this._lastOutlineWidth=b,S.stackPartitions=m,S.slicePartitions=y,S.subdivisions=A,S.offsetAttribute=T,S.radii=h.clone(v?Nyt:i,S.radii),l(u)?v?S.innerRadii=h.fromElements(u.x/i.x,u.y/i.y,u.z/i.z,S.innerRadii):S.innerRadii=h.clone(u,S.innerRadii):S.innerRadii=void 0,S.minimumClock=f,S.maximumClock=d,S.minimumCone=p,S.maximumCone=g;let w=new Er({material:c,translucent:c.isTranslucent(),closed:!0});S.vertexFormat=w.vertexFormat;let P=this._geometryUpdater.createFillGeometryInstance(e,v,this._modelMatrix);this._primitive=C.add(new On({geometryInstances:P,appearance:w,asynchronous:!1,shadows:I}));let M=this._geometryUpdater.createOutlineGeometryInstance(e,v,this._modelMatrix);this._outlinePrimitive=C.add(new On({geometryInstances:M,appearance:new yn({flat:!0,translucent:M.attributes.color.value[3]!==255,renderState:{lineWidth:this._geometryUpdater._scene.clampLineWidth(b)}}),asynchronous:!1,shadows:I})),this._lastShow=o,this._lastOutlineShow=s,this._lastOutlineColor=z.clone(a,this._lastOutlineColor),this._lastDistanceDisplayCondition=O,this._lastOffset=h.clone(L,this._lastOffset)}else if(this._primitive.ready){let C=this._primitive,w=this._outlinePrimitive;C.show=!0,w.show=!0,C.appearance.material=c;let P=this._attributes;l(P)||(P=C.getGeometryInstanceAttributes(t),this._attributes=P),o!==this._lastShow&&(P.show=Pn.toValue(o,P.show),this._lastShow=o);let M=this._outlineAttributes;l(M)||(M=w.getGeometryInstanceAttributes(t),this._outlineAttributes=M),s!==this._lastOutlineShow&&(M.show=Pn.toValue(s,M.show),this._lastOutlineShow=s),z.equals(a,this._lastOutlineColor)||(M.color=Jt.toValue(a,M.color),z.clone(a,this._lastOutlineColor)),Ht.equals(O,this._lastDistanceDisplayCondition)||(P.distanceDisplayCondition=Qn.toValue(O,P.distanceDisplayCondition),M.distanceDisplayCondition=Qn.toValue(O,M.distanceDisplayCondition),Ht.clone(O,this._lastDistanceDisplayCondition)),h.equals(L,this._lastOffset)||(P.offset=Tr.toValue(L,P.offset),M.offset=Tr.toValue(L,P.offset),h.clone(L,this._lastOffset))}v&&(i.x=Math.max(i.x,.001),i.y=Math.max(i.y,.001),i.z=Math.max(i.z,.001),r=N.multiplyByScale(r,i,r),this._primitive.modelMatrix=r,this._outlinePrimitive.modelMatrix=r)};var e3=nd;function Qw(e){e=e??H.EMPTY_OBJECT;let t=e.vertexFormat??Be.DEFAULT;this._vertexFormat=t,this._workerName="createPlaneGeometry"}Qw.packedLength=Be.packedLength;Qw.pack=function(e,t,n){return n=n??0,Be.pack(e._vertexFormat,t,n),t};var TSe=new Be,Fyt={vertexFormat:TSe};Qw.unpack=function(e,t,n){t=t??0;let i=Be.unpack(e,t,TSe);return l(n)?(n._vertexFormat=Be.clone(i,n._vertexFormat),n):new Qw(Fyt)};var UG=new h(-.5,-.5,0),zG=new h(.5,.5,0);Qw.createGeometry=function(e){let t=e._vertexFormat,n=new Tn,i,r;if(t.position){if(r=new Float64Array(12),r[0]=UG.x,r[1]=UG.y,r[2]=0,r[3]=zG.x,r[4]=UG.y,r[5]=0,r[6]=zG.x,r[7]=zG.y,r[8]=0,r[9]=UG.x,r[10]=zG.y,r[11]=0,n.position=new Ne({componentDatatype:Y.DOUBLE,componentsPerAttribute:3,values:r}),t.normal){let o=new Float32Array(12);o[0]=0,o[1]=0,o[2]=1,o[3]=0,o[4]=0,o[5]=1,o[6]=0,o[7]=0,o[8]=1,o[9]=0,o[10]=0,o[11]=1,n.normal=new Ne({componentDatatype:Y.FLOAT,componentsPerAttribute:3,values:o})}if(t.st){let o=new Float32Array(8);o[0]=0,o[1]=0,o[2]=1,o[3]=0,o[4]=1,o[5]=1,o[6]=0,o[7]=1,n.st=new Ne({componentDatatype:Y.FLOAT,componentsPerAttribute:2,values:o})}if(t.tangent){let o=new Float32Array(12);o[0]=1,o[1]=0,o[2]=0,o[3]=1,o[4]=0,o[5]=0,o[6]=1,o[7]=0,o[8]=0,o[9]=1,o[10]=0,o[11]=0,n.tangent=new Ne({componentDatatype:Y.FLOAT,componentsPerAttribute:3,values:o})}if(t.bitangent){let o=new Float32Array(12);o[0]=0,o[1]=1,o[2]=0,o[3]=0,o[4]=1,o[5]=0,o[6]=0,o[7]=1,o[8]=0,o[9]=0,o[10]=1,o[11]=0,n.bitangent=new Ne({componentDatatype:Y.FLOAT,componentsPerAttribute:3,values:o})}i=new Uint16Array(6),i[0]=0,i[1]=1,i[2]=2,i[3]=0,i[4]=2,i[5]=3}return new St({attributes:n,indices:i,primitiveType:Oe.TRIANGLES,boundingSphere:new ue(h.ZERO,Math.sqrt(2))})};var t3=Qw;function eI(){this._workerName="createPlaneOutlineGeometry"}eI.packedLength=0;eI.pack=function(e,t){return t};eI.unpack=function(e,t,n){return l(n)?n:new eI};var tb=new h(-.5,-.5,0),VG=new h(.5,.5,0);eI.createGeometry=function(){let e=new Tn,t=new Uint16Array(8),n=new Float64Array(12);return n[0]=tb.x,n[1]=tb.y,n[2]=tb.z,n[3]=VG.x,n[4]=tb.y,n[5]=tb.z,n[6]=VG.x,n[7]=VG.y,n[8]=tb.z,n[9]=tb.x,n[10]=VG.y,n[11]=tb.z,e.position=new Ne({componentDatatype:Y.DOUBLE,componentsPerAttribute:3,values:n}),t[0]=0,t[1]=1,t[2]=1,t[3]=2,t[4]=2,t[5]=3,t[6]=3,t[7]=0,new St({attributes:e,indices:t,primitiveType:Oe.LINES,boundingSphere:new ue(h.ZERO,Math.sqrt(2))})};var n3=eI;var Byt=new h,ESe=new z;function kyt(e){this.id=e,this.vertexFormat=void 0,this.plane=void 0,this.dimensions=void 0}function dh(e,t){Pi.call(this,{entity:e,scene:t,geometryOptions:new kyt(e),geometryPropertyName:"plane",observedPropertyNames:["availability","position","orientation","plane"]}),this._onEntityPropertyChanged(e,"plane",e.plane,void 0)}l(Object.create)&&(dh.prototype=Object.create(Pi.prototype),dh.prototype.constructor=dh);dh.prototype.createFillGeometryInstance=function(e){let t=this._entity,n=t.isAvailable(e),i,r,o=new Pn(n&&t.isShowing&&this._showProperty.getValue(e)&&this._fillProperty.getValue(e)),s=this._distanceDisplayConditionProperty.getValue(e),a=Qn.fromDistanceDisplayCondition(s);if(this._materialProperty instanceof Kt){let g;l(this._materialProperty.color)&&(this._materialProperty.color.isConstant||n)&&(g=this._materialProperty.color.getValue(e,ESe)),l(g)||(g=z.WHITE),r=Jt.fromColor(g),i={show:o,distanceDisplayCondition:a,color:r}}else i={show:o,distanceDisplayCondition:a};let c=t.plane,u=this._options,f=t.computeModelMatrix(e),d=X.getValueOrDefault(c.plane,e,u.plane),p=X.getValueOrUndefined(c.dimensions,e,u.dimensions);return u.plane=d,u.dimensions=p,f=ote(d,p,f,f),new Ft({id:t,geometry:new t3(this._options),modelMatrix:f,attributes:i})};dh.prototype.createOutlineGeometryInstance=function(e){let t=this._entity,n=t.isAvailable(e),i=X.getValueOrDefault(this._outlineColorProperty,e,z.BLACK,ESe),r=this._distanceDisplayConditionProperty.getValue(e),o=t.plane,s=this._options,a=t.computeModelMatrix(e),c=X.getValueOrDefault(o.plane,e,s.plane),u=X.getValueOrUndefined(o.dimensions,e,s.dimensions);return s.plane=c,s.dimensions=u,a=ote(c,u,a,a),new Ft({id:t,geometry:new n3,modelMatrix:a,attributes:{show:new Pn(n&&t.isShowing&&this._showProperty.getValue(e)&&this._showOutlineProperty.getValue(e)),color:Jt.fromColor(i),distanceDisplayCondition:Qn.fromDistanceDisplayCondition(r)}})};dh.prototype._isHidden=function(e,t){return!l(t.plane)||!l(t.dimensions)||!l(e.position)||Pi.prototype._isHidden.call(this,e,t)};dh.prototype._getIsClosed=function(e){return!1};dh.prototype._isDynamic=function(e,t){return!e.position.isConstant||!X.isConstant(e.orientation)||!t.plane.isConstant||!t.dimensions.isConstant||!X.isConstant(t.outlineWidth)};dh.prototype._setStaticOptions=function(e,t){let n=this._materialProperty instanceof Kt,i=this._options;i.vertexFormat=n?yn.VERTEX_FORMAT:Er.MaterialSupport.TEXTURED.vertexFormat,i.plane=t.plane.getValue(nt.MINIMUM_VALUE,i.plane),i.dimensions=t.dimensions.getValue(nt.MINIMUM_VALUE,i.dimensions)};dh.DynamicGeometryUpdater=tI;function tI(e,t,n){Ii.call(this,e,t,n)}l(Object.create)&&(tI.prototype=Object.create(Ii.prototype),tI.prototype.constructor=tI);tI.prototype._isHidden=function(e,t,n){let i=this._options,r=X.getValueOrUndefined(e.position,n,Byt);return!l(r)||!l(i.plane)||!l(i.dimensions)||Ii.prototype._isHidden.call(this,e,t,n)};tI.prototype._setOptions=function(e,t,n){let i=this._options;i.plane=X.getValueOrDefault(t.plane,n,i.plane),i.dimensions=X.getValueOrUndefined(t.dimensions,n,i.dimensions)};var Uyt=new h,zyt=new h,Vyt=new h,jyt=new h,Hyt=new $,Gyt=new $,Wyt=new N;function ote(e,t,n,i){let r=e.normal,o=e.distance,s=h.multiplyByScalar(r,-o,Vyt),a=h.clone(h.UNIT_Z,zyt);D.equalsEpsilon(Math.abs(h.dot(a,r)),1,D.EPSILON8)&&(a=h.clone(h.UNIT_Y,a));let c=h.cross(a,r,Uyt);a=h.cross(r,c,a),h.normalize(c,c),h.normalize(a,a);let u=Hyt;$.setColumn(u,0,c,u),$.setColumn(u,1,a,u),$.setColumn(u,2,r,u);let f=h.fromElements(t.x,t.y,1,jyt),d=$.multiplyByScale(u,f,Gyt),p=N.fromRotationTranslation(d,s,Wyt);return N.multiplyTransformation(n,p,i)}dh.createPrimitiveMatrix=ote;var i3=dh;var qyt=new h,Yyt=new et,Xyt=new U,Kyt=new U,$yt=new h,Jyt=new h,Zyt=new h,r3=new h,Qyt=new h,eAt=new h,CSe=new Le,tAt=new $,nAt=new $,iAt=new h;function rAt(e,t,n,i,r,o,s,a,c){let u=e.positions,f=fi.triangulate(e.positions2D,e.holes);f.length<3&&(f=[0,1,2]);let d=je.createTypedArray(u.length,f.length);d.set(f);let p=tAt;if(i!==0){let _=Le.fromAxisAngle(s,i,CSe);if(p=$.fromQuaternion(_,p),t.tangent||t.bitangent){_=Le.fromAxisAngle(s,-i,CSe);let C=$.fromQuaternion(_,nAt);a=h.normalize($.multiplyByVector(C,a,a),a),t.bitangent&&(c=h.normalize(h.cross(s,a,c),c))}}else p=$.clone($.IDENTITY,p);let g=Kyt;t.st&&(g.x=n.x,g.y=n.y);let m=u.length,y=m*3,A=new Float64Array(y),b=t.normal?new Float32Array(y):void 0,x=t.tangent?new Float32Array(y):void 0,T=t.bitangent?new Float32Array(y):void 0,E=t.st?new Float32Array(m*2):void 0,v=0,S=0,I=0,R=0,O=0;for(let _=0;_<m;_++){let C=u[_];if(A[v++]=C.x,A[v++]=C.y,A[v++]=C.z,t.st)if(l(r)&&r.positions.length===m)E[O++]=r.positions[_].x,E[O++]=r.positions[_].y;else{let w=$.multiplyByVector(p,C,qyt),P=o(w,Xyt);U.subtract(P,g,P);let M=D.clamp(P.x/n.width,0,1),F=D.clamp(P.y/n.height,0,1);E[O++]=M,E[O++]=F}t.normal&&(b[S++]=s.x,b[S++]=s.y,b[S++]=s.z),t.tangent&&(x[R++]=a.x,x[R++]=a.y,x[R++]=a.z),t.bitangent&&(T[I++]=c.x,T[I++]=c.y,T[I++]=c.z)}let L=new Tn;return t.position&&(L.position=new Ne({componentDatatype:Y.DOUBLE,componentsPerAttribute:3,values:A})),t.normal&&(L.normal=new Ne({componentDatatype:Y.FLOAT,componentsPerAttribute:3,values:b})),t.tangent&&(L.tangent=new Ne({componentDatatype:Y.FLOAT,componentsPerAttribute:3,values:x})),t.bitangent&&(L.bitangent=new Ne({componentDatatype:Y.FLOAT,componentsPerAttribute:3,values:T})),t.st&&(L.st=new Ne({componentDatatype:Y.FLOAT,componentsPerAttribute:2,values:E})),new St({attributes:L,indices:d,primitiveType:Oe.TRIANGLES})}function fE(e){e=e??H.EMPTY_OBJECT;let t=e.polygonHierarchy,n=e.textureCoordinates,i=e.vertexFormat??Be.DEFAULT;this._vertexFormat=Be.clone(i),this._polygonHierarchy=t,this._stRotation=e.stRotation??0,this._ellipsoid=ee.clone(e.ellipsoid??ee.default),this._workerName="createCoplanarPolygonGeometry",this._textureCoordinates=n,this.packedLength=ni.computeHierarchyPackedLength(t,h)+Be.packedLength+ee.packedLength+(l(n)?ni.computeHierarchyPackedLength(n,U):1)+2}fE.fromPositions=function(e){e=e??H.EMPTY_OBJECT;let t={polygonHierarchy:{positions:e.positions},vertexFormat:e.vertexFormat,stRotation:e.stRotation,ellipsoid:e.ellipsoid,textureCoordinates:e.textureCoordinates};return new fE(t)};fE.pack=function(e,t,n){return n=n??0,n=ni.packPolygonHierarchy(e._polygonHierarchy,t,n,h),ee.pack(e._ellipsoid,t,n),n+=ee.packedLength,Be.pack(e._vertexFormat,t,n),n+=Be.packedLength,t[n++]=e._stRotation,l(e._textureCoordinates)?n=ni.packPolygonHierarchy(e._textureCoordinates,t,n,U):t[n++]=-1,t[n]=e.packedLength,t};var oAt=ee.clone(ee.UNIT_SPHERE),sAt=new Be,aAt={polygonHierarchy:{}};fE.unpack=function(e,t,n){t=t??0;let i=ni.unpackPolygonHierarchy(e,t,h);t=i.startingIndex,delete i.startingIndex;let r=ee.unpack(e,t,oAt);t+=ee.packedLength;let o=Be.unpack(e,t,sAt);t+=Be.packedLength;let s=e[t++],a=e[t]===-1?void 0:ni.unpackPolygonHierarchy(e,t,U);l(a)?(t=a.startingIndex,delete a.startingIndex):t++;let c=e[t];return l(n)||(n=new fE(aAt)),n._polygonHierarchy=i,n._ellipsoid=ee.clone(r,n._ellipsoid),n._vertexFormat=Be.clone(o,n._vertexFormat),n._stRotation=s,n._textureCoordinates=a,n.packedLength=c,n};fE.createGeometry=function(e){let t=e._vertexFormat,n=e._polygonHierarchy,i=e._stRotation,r=e._textureCoordinates,o=l(r),s=n.positions;if(s=Fr(s,h.equalsEpsilon,!0),s.length<3)return;let a=$yt,c=Jyt,u=Zyt,f=Qyt,d=eAt;if(!g_.computeProjectTo2DArguments(s,r3,f,d))return;if(a=h.cross(f,d,a),a=h.normalize(a,a),!h.equalsEpsilon(r3,h.ZERO,D.EPSILON6)){let O=e._ellipsoid.geodeticSurfaceNormal(r3,iAt);h.dot(a,O)<0&&(a=h.negate(a,a),f=h.negate(f,f))}let g=g_.createProjectPointsTo2DFunction(r3,f,d),m=g_.createProjectPointTo2DFunction(r3,f,d);t.tangent&&(c=h.clone(f,c)),t.bitangent&&(u=h.clone(d,u));let y=ni.polygonsFromHierarchy(n,o,g,!1),A=y.hierarchy,b=y.polygons,x=function(O){return O},T=o?ni.polygonsFromHierarchy(r,!0,x,!1).polygons:void 0;if(A.length===0)return;s=A[0].outerRing;let E=ue.fromPoints(s),v=ni.computeBoundingRectangle(a,m,s,i,Yyt),S=[];for(let O=0;O<b.length;O++){let L=new Ft({geometry:rAt(b[O],t,v,i,o?T[O]:void 0,m,a,c,u)});S.push(L)}let I=Hn.combineInstances(S)[0];I.attributes.position.values=new Float64Array(I.attributes.position.values),I.indices=je.createTypedArray(I.attributes.position.values.length/3,I.indices);let R=I.attributes;return t.position||delete R.position,new St({attributes:R,indices:I.indices,primitiveType:I.primitiveType,boundingSphere:E})};var o3=fE;var vSe=[],jG=[];function cAt(e,t,n,i,r){let s=Vs.fromPoints(t,e).projectPointsOntoPlane(t,vSe);fi.computeWindingOrder2D(s)===Qs.CLOCKWISE&&(s.reverse(),t=t.slice().reverse());let c,u,f=t.length,d=0;if(i)for(c=new Float64Array(f*2*3),u=0;u<f;u++){let m=t[u],y=t[(u+1)%f];c[d++]=m.x,c[d++]=m.y,c[d++]=m.z,c[d++]=y.x,c[d++]=y.y,c[d++]=y.z}else{let m=0;if(r===ln.GEODESIC)for(u=0;u<f;u++)m+=ni.subdivideLineCount(t[u],t[(u+1)%f],n);else if(r===ln.RHUMB)for(u=0;u<f;u++)m+=ni.subdivideRhumbLineCount(e,t[u],t[(u+1)%f],n);for(c=new Float64Array(m*3),u=0;u<f;u++){let y;r===ln.GEODESIC?y=ni.subdivideLine(t[u],t[(u+1)%f],n,jG):r===ln.RHUMB&&(y=ni.subdivideRhumbLine(e,t[u],t[(u+1)%f],n,jG));let A=y.length;for(let b=0;b<A;++b)c[d++]=y[b]}}f=c.length/3;let p=f*2,g=je.createTypedArray(f,p);for(d=0,u=0;u<f-1;u++)g[d++]=u,g[d++]=u+1;return g[d++]=f-1,g[d]=0,new Ft({geometry:new St({attributes:new Tn({position:new Ne({componentDatatype:Y.DOUBLE,componentsPerAttribute:3,values:c})}),indices:g,primitiveType:Oe.LINES})})}function lAt(e,t,n,i,r){let s=Vs.fromPoints(t,e).projectPointsOntoPlane(t,vSe);fi.computeWindingOrder2D(s)===Qs.CLOCKWISE&&(s.reverse(),t=t.slice().reverse());let c,u,f=t.length,d=new Array(f),p=0;if(i)for(c=new Float64Array(f*2*3*2),u=0;u<f;++u){d[u]=p/3;let A=t[u],b=t[(u+1)%f];c[p++]=A.x,c[p++]=A.y,c[p++]=A.z,c[p++]=b.x,c[p++]=b.y,c[p++]=b.z}else{let A=0;if(r===ln.GEODESIC)for(u=0;u<f;u++)A+=ni.subdivideLineCount(t[u],t[(u+1)%f],n);else if(r===ln.RHUMB)for(u=0;u<f;u++)A+=ni.subdivideRhumbLineCount(e,t[u],t[(u+1)%f],n);for(c=new Float64Array(A*3*2),u=0;u<f;++u){d[u]=p/3;let b;r===ln.GEODESIC?b=ni.subdivideLine(t[u],t[(u+1)%f],n,jG):r===ln.RHUMB&&(b=ni.subdivideRhumbLine(e,t[u],t[(u+1)%f],n,jG));let x=b.length;for(let T=0;T<x;++T)c[p++]=b[T]}}f=c.length/6;let g=d.length,m=(f*2+g)*2,y=je.createTypedArray(f+g,m);for(p=0,u=0;u<f;++u)y[p++]=u,y[p++]=(u+1)%f,y[p++]=u+f,y[p++]=(u+1)%f+f;for(u=0;u<g;u++){let A=d[u];y[p++]=A,y[p++]=A+f}return new Ft({geometry:new St({attributes:new Tn({position:new Ne({componentDatatype:Y.DOUBLE,componentsPerAttribute:3,values:c})}),indices:y,primitiveType:Oe.LINES})})}function dE(e){let t=e.polygonHierarchy,n=e.ellipsoid??ee.default,i=e.granularity??D.RADIANS_PER_DEGREE,r=e.perPositionHeight??!1,o=r&&l(e.extrudedHeight),s=e.arcType??ln.GEODESIC,a=e.height??0,c=e.extrudedHeight??a;if(!o){let u=Math.max(a,c);c=Math.min(a,c),a=u}this._ellipsoid=ee.clone(n),this._granularity=i,this._height=a,this._extrudedHeight=c,this._arcType=s,this._polygonHierarchy=t,this._perPositionHeight=r,this._perPositionHeightExtrude=o,this._offsetAttribute=e.offsetAttribute,this._workerName="createPolygonOutlineGeometry",this.packedLength=ni.computeHierarchyPackedLength(t,h)+ee.packedLength+8}dE.pack=function(e,t,n){return n=n??0,n=ni.packPolygonHierarchy(e._polygonHierarchy,t,n,h),ee.pack(e._ellipsoid,t,n),n+=ee.packedLength,t[n++]=e._height,t[n++]=e._extrudedHeight,t[n++]=e._granularity,t[n++]=e._perPositionHeightExtrude?1:0,t[n++]=e._perPositionHeight?1:0,t[n++]=e._arcType,t[n++]=e._offsetAttribute??-1,t[n]=e.packedLength,t};var uAt=ee.clone(ee.UNIT_SPHERE),fAt={polygonHierarchy:{}};dE.unpack=function(e,t,n){t=t??0;let i=ni.unpackPolygonHierarchy(e,t,h);t=i.startingIndex,delete i.startingIndex;let r=ee.unpack(e,t,uAt);t+=ee.packedLength;let o=e[t++],s=e[t++],a=e[t++],c=e[t++]===1,u=e[t++]===1,f=e[t++],d=e[t++],p=e[t];return l(n)||(n=new dE(fAt)),n._polygonHierarchy=i,n._ellipsoid=ee.clone(r,n._ellipsoid),n._height=o,n._extrudedHeight=s,n._granularity=a,n._perPositionHeight=u,n._perPositionHeightExtrude=c,n._arcType=f,n._offsetAttribute=d===-1?void 0:d,n.packedLength=p,n};dE.fromPositions=function(e){e=e??H.EMPTY_OBJECT;let t={polygonHierarchy:{positions:e.positions},height:e.height,extrudedHeight:e.extrudedHeight,ellipsoid:e.ellipsoid,granularity:e.granularity,perPositionHeight:e.perPositionHeight,arcType:e.arcType,offsetAttribute:e.offsetAttribute};return new dE(t)};dE.createGeometry=function(e){let t=e._ellipsoid,n=e._granularity,i=e._polygonHierarchy,r=e._perPositionHeight,o=e._arcType,s=ni.polygonOutlinesFromHierarchy(i,!r,t);if(s.length===0)return;let a,c=[],u=D.chordLength(n,t.maximumRadius),f=e._height,d=e._extrudedHeight,p=e._perPositionHeightExtrude||!D.equalsEpsilon(f,d,0,D.EPSILON2),g,m;if(p)for(m=0;m<s.length;m++){if(a=lAt(t,s[m],u,r,o),a.geometry=ni.scaleToGeodeticHeightExtruded(a.geometry,f,d,t,r),l(e._offsetAttribute)){let b=a.geometry.attributes.position.values.length/3,x=new Uint8Array(b);e._offsetAttribute===mn.TOP?x=x.fill(1,0,b/2):(g=e._offsetAttribute===mn.NONE?0:1,x=x.fill(g)),a.geometry.attributes.applyOffset=new Ne({componentDatatype:Y.UNSIGNED_BYTE,componentsPerAttribute:1,values:x})}c.push(a)}else for(m=0;m<s.length;m++){if(a=cAt(t,s[m],u,r,o),a.geometry.attributes.position.values=fi.scaleToGeodeticHeight(a.geometry.attributes.position.values,f,t,!r),l(e._offsetAttribute)){let b=a.geometry.attributes.position.values.length;g=e._offsetAttribute===mn.NONE?0:1;let x=new Uint8Array(b/3).fill(g);a.geometry.attributes.applyOffset=new Ne({componentDatatype:Y.UNSIGNED_BYTE,componentsPerAttribute:1,values:x})}c.push(a)}let y=Hn.combineInstances(c)[0],A=ue.fromVertices(y.attributes.position.values);return new St({attributes:y.attributes,indices:y.indices,primitiveType:y.primitiveType,boundingSphere:A,offsetAttribute:e._offsetAttribute})};var s3=dE;var SSe="Entity polygons cannot have both height and perPositionHeight. height will be ignored",wSe="heightReference is not supported for entity polygons with perPositionHeight. heightReference will be ignored",ISe=new z,PSe=h.ZERO,DSe=new h,RSe=new ie,dAt=[],hAt=new U;function mAt(e){this.id=e,this.vertexFormat=void 0,this.polygonHierarchy=void 0,this.perPositionHeight=void 0,this.closeTop=void 0,this.closeBottom=void 0,this.height=void 0,this.extrudedHeight=void 0,this.granularity=void 0,this.stRotation=void 0,this.offsetAttribute=void 0,this.arcType=void 0,this.textureCoordinates=void 0}function id(e,t){ii.call(this,{entity:e,scene:t,geometryOptions:new mAt(e),geometryPropertyName:"polygon",observedPropertyNames:["availability","polygon"]}),this._onEntityPropertyChanged(e,"polygon",e.polygon,void 0)}l(Object.create)&&(id.prototype=Object.create(ii.prototype),id.prototype.constructor=id);id.prototype.createFillGeometryInstance=function(e){let t=this._entity,n=t.isAvailable(e),i=this._options,r={show:new Pn(n&&t.isShowing&&this._showProperty.getValue(e)&&this._fillProperty.getValue(e)),distanceDisplayCondition:Qn.fromDistanceDisplayCondition(this._distanceDisplayConditionProperty.getValue(e)),offset:void 0,color:void 0};if(this._materialProperty instanceof Kt){let s;l(this._materialProperty.color)&&(this._materialProperty.color.isConstant||n)&&(s=this._materialProperty.color.getValue(e,ISe)),l(s)||(s=z.WHITE),r.color=Jt.fromColor(s)}l(i.offsetAttribute)&&(r.offset=Tr.fromCartesian3(X.getValueOrDefault(this._terrainOffsetProperty,e,PSe,DSe)));let o;return i.perPositionHeight&&!l(i.extrudedHeight)?o=new o3(i):o=new qp(i),new Ft({id:t,geometry:o,attributes:r})};id.prototype.createOutlineGeometryInstance=function(e){let t=this._entity,n=t.isAvailable(e),i=this._options,r=X.getValueOrDefault(this._outlineColorProperty,e,z.BLACK,ISe),o=this._distanceDisplayConditionProperty.getValue(e),s={show:new Pn(n&&t.isShowing&&this._showProperty.getValue(e)&&this._showOutlineProperty.getValue(e)),color:Jt.fromColor(r),distanceDisplayCondition:Qn.fromDistanceDisplayCondition(o),offset:void 0};l(i.offsetAttribute)&&(s.offset=Tr.fromCartesian3(X.getValueOrDefault(this._terrainOffsetProperty,e,PSe,DSe)));let a;return i.perPositionHeight&&!l(i.extrudedHeight)?a=new rh(i):a=new s3(i),new Ft({id:t,geometry:a,attributes:s})};id.prototype._computeCenter=function(e,t){let n=X.getValueOrUndefined(this._entity.polygon.hierarchy,e);if(!l(n))return;let i=n.positions;if(i.length===0)return;let r=this._scene.ellipsoid,o=Vs.fromPoints(i,r),s=o.projectPointsOntoPlane(i,dAt),a=s.length,c=0,u=a-1,f=new U;for(let p=0;p<a;u=p++){let g=s[p],m=s[u],y=g.x*m.y-m.x*g.y,A=U.add(g,m,hAt);A=U.multiplyByScalar(A,y,A),f=U.add(f,A,f),c+=y}let d=1/(c*3);return f=U.multiplyByScalar(f,d,f),o.projectPointOntoEllipsoid(f,t)};id.prototype._isHidden=function(e,t){return!l(t.hierarchy)||Pi.prototype._isHidden.call(this,e,t)};id.prototype._isOnTerrain=function(e,t){let n=ii.prototype._isOnTerrain.call(this,e,t),i=t.perPositionHeight,r=l(i)&&(i.isConstant?i.getValue(nt.MINIMUM_VALUE):!0);return n&&!r};id.prototype._isDynamic=function(e,t){return!t.hierarchy.isConstant||!X.isConstant(t.height)||!X.isConstant(t.extrudedHeight)||!X.isConstant(t.granularity)||!X.isConstant(t.stRotation)||!X.isConstant(t.textureCoordinates)||!X.isConstant(t.outlineWidth)||!X.isConstant(t.perPositionHeight)||!X.isConstant(t.closeTop)||!X.isConstant(t.closeBottom)||!X.isConstant(t.zIndex)||!X.isConstant(t.arcType)||this._onTerrain&&!X.isConstant(this._materialProperty)&&!(this._materialProperty instanceof Kt)};id.prototype._setStaticOptions=function(e,t){let n=this._materialProperty instanceof Kt,i=this._options;i.vertexFormat=n?yn.VERTEX_FORMAT:Er.MaterialSupport.TEXTURED.vertexFormat;let r=t.hierarchy.getValue(nt.MINIMUM_VALUE),o=X.getValueOrUndefined(t.height,nt.MINIMUM_VALUE),s=X.getValueOrDefault(t.heightReference,nt.MINIMUM_VALUE,We.NONE),a=X.getValueOrUndefined(t.extrudedHeight,nt.MINIMUM_VALUE),c=X.getValueOrDefault(t.extrudedHeightReference,nt.MINIMUM_VALUE,We.NONE),u=X.getValueOrDefault(t.perPositionHeight,nt.MINIMUM_VALUE,!1);o=ii.getGeometryHeight(o,s);let f;if(u?(l(o)&&(o=void 0,_t(SSe)),s!==We.NONE&&u&&(o=void 0,_t(wSe))):(l(a)&&!l(o)&&(o=0),f=ii.computeGeometryOffsetAttribute(o,s,a,c)),i.polygonHierarchy=r,i.granularity=X.getValueOrUndefined(t.granularity,nt.MINIMUM_VALUE),i.stRotation=X.getValueOrUndefined(t.stRotation,nt.MINIMUM_VALUE),i.perPositionHeight=u,i.closeTop=X.getValueOrDefault(t.closeTop,nt.MINIMUM_VALUE,!0),i.closeBottom=X.getValueOrDefault(t.closeBottom,nt.MINIMUM_VALUE,!0),i.offsetAttribute=f,i.height=o,i.arcType=X.getValueOrDefault(t.arcType,nt.MINIMUM_VALUE,ln.GEODESIC),i.textureCoordinates=X.getValueOrUndefined(t.textureCoordinates,nt.MINIMUM_VALUE),a=ii.getGeometryExtrudedHeight(a,c),a===ii.CLAMP_TO_GROUND){let d=qp.computeRectangleFromPositions(i.polygonHierarchy.positions,i.ellipsoid,i.arcType,RSe);a=Mi.getMinimumMaximumHeights(d).minimumTerrainHeight}i.extrudedHeight=a};id.prototype._getIsClosed=function(e){let t=e.height,n=e.extrudedHeight,i=l(n)&&n!==t;return!e.perPositionHeight&&(!i&&t===0||i&&e.closeTop&&e.closeBottom)};id.DynamicGeometryUpdater=nI;function nI(e,t,n){Ii.call(this,e,t,n)}l(Object.create)&&(nI.prototype=Object.create(Ii.prototype),nI.prototype.constructor=nI);nI.prototype._isHidden=function(e,t,n){return!l(this._options.polygonHierarchy)||Ii.prototype._isHidden.call(this,e,t,n)};nI.prototype._setOptions=function(e,t,n){let i=this._options;i.polygonHierarchy=X.getValueOrUndefined(t.hierarchy,n);let r=X.getValueOrUndefined(t.height,n),o=X.getValueOrDefault(t.heightReference,n,We.NONE),s=X.getValueOrDefault(t.extrudedHeightReference,n,We.NONE),a=X.getValueOrUndefined(t.extrudedHeight,n),c=X.getValueOrUndefined(t.perPositionHeight,n);r=ii.getGeometryHeight(r,s);let u;if(c?(l(r)&&(r=void 0,_t(SSe)),o!==We.NONE&&c&&(r=void 0,_t(wSe))):(l(a)&&!l(r)&&(r=0),u=ii.computeGeometryOffsetAttribute(r,o,a,s)),i.granularity=X.getValueOrUndefined(t.granularity,n),i.stRotation=X.getValueOrUndefined(t.stRotation,n),i.textureCoordinates=X.getValueOrUndefined(t.textureCoordinates,n),i.perPositionHeight=X.getValueOrUndefined(t.perPositionHeight,n),i.closeTop=X.getValueOrDefault(t.closeTop,n,!0),i.closeBottom=X.getValueOrDefault(t.closeBottom,n,!0),i.offsetAttribute=u,i.height=r,i.arcType=X.getValueOrDefault(t.arcType,n,ln.GEODESIC),a=ii.getGeometryExtrudedHeight(a,s),a===ii.CLAMP_TO_GROUND){let f=qp.computeRectangleFromPositions(i.polygonHierarchy.positions,i.ellipsoid,i.arcType,RSe);a=Mi.getMinimumMaximumHeights(f).minimumTerrainHeight}i.extrudedHeight=a};var a3=id;function pAt(e,t,n,i){let r=new Tn;i.position&&(r.position=new Ne({componentDatatype:Y.DOUBLE,componentsPerAttribute:3,values:e}));let o=t.length,s=e.length/3,a=(s-o*2)/(o*2),c=fi.triangulate(t),u=(a-1)*o*6+c.length*2,f=je.createTypedArray(s,u),d,p,g,m,y,A,b=o*2,x=0;for(d=0;d<a-1;d++){for(p=0;p<o-1;p++)g=p*2+d*o*2,A=g+b,m=g+1,y=m+b,f[x++]=m,f[x++]=g,f[x++]=y,f[x++]=y,f[x++]=g,f[x++]=A;g=o*2-2+d*o*2,m=g+1,y=m+b,A=g+b,f[x++]=m,f[x++]=g,f[x++]=y,f[x++]=y,f[x++]=g,f[x++]=A}if(i.st||i.tangent||i.bitangent){let v=new Float32Array(s*2),S=1/(a-1),I=1/n.height,R=n.height/2,O,L,_=0;for(d=0;d<a;d++){for(O=d*S,L=I*(t[0].y+R),v[_++]=O,v[_++]=L,p=1;p<o;p++)L=I*(t[p].y+R),v[_++]=O,v[_++]=L,v[_++]=O,v[_++]=L;L=I*(t[0].y+R),v[_++]=O,v[_++]=L}for(p=0;p<o;p++)O=0,L=I*(t[p].y+R),v[_++]=O,v[_++]=L;for(p=0;p<o;p++)O=(a-1)*S,L=I*(t[p].y+R),v[_++]=O,v[_++]=L;r.st=new Ne({componentDatatype:Y.FLOAT,componentsPerAttribute:2,values:new Float32Array(v)})}let T=s-o*2;for(d=0;d<c.length;d+=3){let v=c[d]+T,S=c[d+1]+T,I=c[d+2]+T;f[x++]=v,f[x++]=S,f[x++]=I,f[x++]=I+o,f[x++]=S+o,f[x++]=v+o}let E=new St({attributes:r,indices:f,boundingSphere:ue.fromVertices(e),primitiveType:Oe.TRIANGLES});if(i.normal&&(E=Hn.computeNormal(E)),i.tangent||i.bitangent){try{E=Hn.computeTangentAndBitangent(E)}catch{_t("polyline-volume-tangent-bitangent","Unable to compute tangents and bitangents for polyline volume geometry")}i.tangent||(E.attributes.tangent=void 0),i.bitangent||(E.attributes.bitangent=void 0),i.st||(E.attributes.st=void 0)}return E}function l3(e){e=e??H.EMPTY_OBJECT;let t=e.polylinePositions,n=e.shapePositions;this._positions=t,this._shape=n,this._ellipsoid=ee.clone(e.ellipsoid??ee.default),this._cornerType=e.cornerType??rr.ROUNDED,this._vertexFormat=Be.clone(e.vertexFormat??Be.DEFAULT),this._granularity=e.granularity??D.RADIANS_PER_DEGREE,this._workerName="createPolylineVolumeGeometry";let i=1+t.length*h.packedLength;i+=1+n.length*U.packedLength,this.packedLength=i+ee.packedLength+Be.packedLength+2}l3.pack=function(e,t,n){n=n??0;let i,r=e._positions,o=r.length;for(t[n++]=o,i=0;i<o;++i,n+=h.packedLength)h.pack(r[i],t,n);let s=e._shape;for(o=s.length,t[n++]=o,i=0;i<o;++i,n+=U.packedLength)U.pack(s[i],t,n);return ee.pack(e._ellipsoid,t,n),n+=ee.packedLength,Be.pack(e._vertexFormat,t,n),n+=Be.packedLength,t[n++]=e._cornerType,t[n]=e._granularity,t};var OSe=ee.clone(ee.UNIT_SPHERE),MSe=new Be,c3={polylinePositions:void 0,shapePositions:void 0,ellipsoid:OSe,vertexFormat:MSe,cornerType:void 0,granularity:void 0};l3.unpack=function(e,t,n){t=t??0;let i,r=e[t++],o=new Array(r);for(i=0;i<r;++i,t+=h.packedLength)o[i]=h.unpack(e,t);r=e[t++];let s=new Array(r);for(i=0;i<r;++i,t+=U.packedLength)s[i]=U.unpack(e,t);let a=ee.unpack(e,t,OSe);t+=ee.packedLength;let c=Be.unpack(e,t,MSe);t+=Be.packedLength;let u=e[t++],f=e[t];return l(n)?(n._positions=o,n._shape=s,n._ellipsoid=ee.clone(a,n._ellipsoid),n._vertexFormat=Be.clone(c,n._vertexFormat),n._cornerType=u,n._granularity=f,n):(c3.polylinePositions=o,c3.shapePositions=s,c3.cornerType=u,c3.granularity=f,new l3(c3))};var gAt=new et;l3.createGeometry=function(e){let t=e._positions,n=Fr(t,h.equalsEpsilon),i=e._shape;if(i=Dm.removeDuplicatesFromShape(i),n.length<2||i.length<3)return;fi.computeWindingOrder2D(i)===Qs.CLOCKWISE&&i.reverse();let r=et.fromPoints(i,gAt),o=Dm.computePositions(n,i,r,e,!0);return pAt(o,i,r,e._vertexFormat)};var u3=l3;function _At(e,t){let n=new Tn;n.position=new Ne({componentDatatype:Y.DOUBLE,componentsPerAttribute:3,values:e});let i=t.length,r=n.position.values.length/3,s=e.length/3/i,a=je.createTypedArray(r,2*i*(s+1)),c,u,f=0;c=0;let d=c*i;for(u=0;u<i-1;u++)a[f++]=u+d,a[f++]=u+d+1;for(a[f++]=i-1+d,a[f++]=d,c=s-1,d=c*i,u=0;u<i-1;u++)a[f++]=u+d,a[f++]=u+d+1;for(a[f++]=i-1+d,a[f++]=d,c=0;c<s-1;c++){let g=i*c,m=g+i;for(u=0;u<i;u++)a[f++]=u+g,a[f++]=u+m}return new St({attributes:n,indices:je.createTypedArray(r,a),boundingSphere:ue.fromVertices(e),primitiveType:Oe.LINES})}function d3(e){e=e??H.EMPTY_OBJECT;let t=e.polylinePositions,n=e.shapePositions;this._positions=t,this._shape=n,this._ellipsoid=ee.clone(e.ellipsoid??ee.default),this._cornerType=e.cornerType??rr.ROUNDED,this._granularity=e.granularity??D.RADIANS_PER_DEGREE,this._workerName="createPolylineVolumeOutlineGeometry";let i=1+t.length*h.packedLength;i+=1+n.length*U.packedLength,this.packedLength=i+ee.packedLength+2}d3.pack=function(e,t,n){n=n??0;let i,r=e._positions,o=r.length;for(t[n++]=o,i=0;i<o;++i,n+=h.packedLength)h.pack(r[i],t,n);let s=e._shape;for(o=s.length,t[n++]=o,i=0;i<o;++i,n+=U.packedLength)U.pack(s[i],t,n);return ee.pack(e._ellipsoid,t,n),n+=ee.packedLength,t[n++]=e._cornerType,t[n]=e._granularity,t};var NSe=ee.clone(ee.UNIT_SPHERE),f3={polylinePositions:void 0,shapePositions:void 0,ellipsoid:NSe,height:void 0,cornerType:void 0,granularity:void 0};d3.unpack=function(e,t,n){t=t??0;let i,r=e[t++],o=new Array(r);for(i=0;i<r;++i,t+=h.packedLength)o[i]=h.unpack(e,t);r=e[t++];let s=new Array(r);for(i=0;i<r;++i,t+=U.packedLength)s[i]=U.unpack(e,t);let a=ee.unpack(e,t,NSe);t+=ee.packedLength;let c=e[t++],u=e[t];return l(n)?(n._positions=o,n._shape=s,n._ellipsoid=ee.clone(a,n._ellipsoid),n._cornerType=c,n._granularity=u,n):(f3.polylinePositions=o,f3.shapePositions=s,f3.cornerType=c,f3.granularity=u,new d3(f3))};var yAt=new et;d3.createGeometry=function(e){let t=e._positions,n=Fr(t,h.equalsEpsilon),i=e._shape;if(i=Dm.removeDuplicatesFromShape(i),n.length<2||i.length<3)return;fi.computeWindingOrder2D(i)===Qs.CLOCKWISE&&i.reverse();let r=et.fromPoints(i,yAt),o=Dm.computePositions(n,i,r,e,!1);return _At(o,i)};var h3=d3;var LSe=new z;function AAt(e){this.id=e,this.vertexFormat=void 0,this.polylinePositions=void 0,this.shapePositions=void 0,this.cornerType=void 0,this.granularity=void 0}function f0(e,t){Pi.call(this,{entity:e,scene:t,geometryOptions:new AAt(e),geometryPropertyName:"polylineVolume",observedPropertyNames:["availability","polylineVolume"]}),this._onEntityPropertyChanged(e,"polylineVolume",e.polylineVolume,void 0)}l(Object.create)&&(f0.prototype=Object.create(Pi.prototype),f0.prototype.constructor=f0);f0.prototype.createFillGeometryInstance=function(e){let t=this._entity,n=t.isAvailable(e),i,r,o=new Pn(n&&t.isShowing&&this._showProperty.getValue(e)&&this._fillProperty.getValue(e)),s=this._distanceDisplayConditionProperty.getValue(e),a=Qn.fromDistanceDisplayCondition(s);if(this._materialProperty instanceof Kt){let c;l(this._materialProperty.color)&&(this._materialProperty.color.isConstant||n)&&(c=this._materialProperty.color.getValue(e,LSe)),l(c)||(c=z.WHITE),r=Jt.fromColor(c),i={show:o,distanceDisplayCondition:a,color:r}}else i={show:o,distanceDisplayCondition:a};return new Ft({id:t,geometry:new u3(this._options),attributes:i})};f0.prototype.createOutlineGeometryInstance=function(e){let t=this._entity,n=t.isAvailable(e),i=X.getValueOrDefault(this._outlineColorProperty,e,z.BLACK,LSe),r=this._distanceDisplayConditionProperty.getValue(e);return new Ft({id:t,geometry:new h3(this._options),attributes:{show:new Pn(n&&t.isShowing&&this._showProperty.getValue(e)&&this._showOutlineProperty.getValue(e)),color:Jt.fromColor(i),distanceDisplayCondition:Qn.fromDistanceDisplayCondition(r)}})};f0.prototype._isHidden=function(e,t){return!l(t.positions)||!l(t.shape)||Pi.prototype._isHidden.call(this,e,t)};f0.prototype._isDynamic=function(e,t){return!t.positions.isConstant||!t.shape.isConstant||!X.isConstant(t.granularity)||!X.isConstant(t.outlineWidth)||!X.isConstant(t.cornerType)};f0.prototype._setStaticOptions=function(e,t){let n=t.granularity,i=t.cornerType,r=this._options,o=this._materialProperty instanceof Kt;r.vertexFormat=o?yn.VERTEX_FORMAT:Er.MaterialSupport.TEXTURED.vertexFormat,r.polylinePositions=t.positions.getValue(nt.MINIMUM_VALUE,r.polylinePositions),r.shapePositions=t.shape.getValue(nt.MINIMUM_VALUE,r.shape),r.granularity=l(n)?n.getValue(nt.MINIMUM_VALUE):void 0,r.cornerType=l(i)?i.getValue(nt.MINIMUM_VALUE):void 0};f0.DynamicGeometryUpdater=iI;function iI(e,t,n){Ii.call(this,e,t,n)}l(Object.create)&&(iI.prototype=Object.create(Ii.prototype),iI.prototype.constructor=iI);iI.prototype._isHidden=function(e,t,n){let i=this._options;return!l(i.polylinePositions)||!l(i.shapePositions)||Ii.prototype._isHidden.call(this,e,t,n)};iI.prototype._setOptions=function(e,t,n){let i=this._options;i.polylinePositions=X.getValueOrUndefined(t.positions,n,i.polylinePositions),i.shapePositions=X.getValueOrUndefined(t.shape,n),i.granularity=X.getValueOrUndefined(t.granularity,n),i.cornerType=X.getValueOrUndefined(t.cornerType,n)};var m3=f0;var ste=new h,kSe=new h,USe=new h,zSe=new h,VSe=new ie,bAt=new U,xAt=new ue,TAt=new ue;function jSe(e,t){let n=new St({attributes:new Tn,primitiveType:Oe.TRIANGLES});return n.attributes.position=new Ne({componentDatatype:Y.DOUBLE,componentsPerAttribute:3,values:t.positions}),e.normal&&(n.attributes.normal=new Ne({componentDatatype:Y.FLOAT,componentsPerAttribute:3,values:t.normals})),e.tangent&&(n.attributes.tangent=new Ne({componentDatatype:Y.FLOAT,componentsPerAttribute:3,values:t.tangents})),e.bitangent&&(n.attributes.bitangent=new Ne({componentDatatype:Y.FLOAT,componentsPerAttribute:3,values:t.bitangents})),n}function EAt(e,t,n,i){let r=e.length,o=t.normal?new Float32Array(r):void 0,s=t.tangent?new Float32Array(r):void 0,a=t.bitangent?new Float32Array(r):void 0,c=0,u=zSe,f=USe,d=kSe;if(t.normal||t.tangent||t.bitangent)for(let p=0;p<r;p+=3){let g=h.fromArray(e,p,ste),m=c+1,y=c+2;d=n.geodeticSurfaceNormal(g,d),(t.tangent||t.bitangent)&&(h.cross(h.UNIT_Z,d,f),$.multiplyByVector(i,f,f),h.normalize(f,f),t.bitangent&&h.normalize(h.cross(d,f,u),u)),t.normal&&(o[c]=d.x,o[m]=d.y,o[y]=d.z),t.tangent&&(s[c]=f.x,s[m]=f.y,s[y]=f.z),t.bitangent&&(a[c]=u.x,a[m]=u.y,a[y]=u.z),c+=3}return jSe(t,{positions:e,normals:o,tangents:s,bitangents:a})}var ate=new h,HSe=new h;function CAt(e,t,n){let i=e.length,r=t.normal?new Float32Array(i):void 0,o=t.tangent?new Float32Array(i):void 0,s=t.bitangent?new Float32Array(i):void 0,a=0,c=0,u=0,f=!0,d=zSe,p=USe,g=kSe;if(t.normal||t.tangent||t.bitangent)for(let m=0;m<i;m+=6){let y=h.fromArray(e,m,ste),A=h.fromArray(e,(m+6)%i,ate);if(f){let b=h.fromArray(e,(m+3)%i,HSe);h.subtract(A,y,A),h.subtract(b,y,b),g=h.normalize(h.cross(b,A,g),g),f=!1}h.equalsEpsilon(A,y,D.EPSILON10)&&(f=!0),(t.tangent||t.bitangent)&&(d=n.geodeticSurfaceNormal(y,d),t.tangent&&(p=h.normalize(h.cross(d,g,p),p))),t.normal&&(r[a++]=g.x,r[a++]=g.y,r[a++]=g.z,r[a++]=g.x,r[a++]=g.y,r[a++]=g.z),t.tangent&&(o[c++]=p.x,o[c++]=p.y,o[c++]=p.z,o[c++]=p.x,o[c++]=p.y,o[c++]=p.z),t.bitangent&&(s[u++]=d.x,s[u++]=d.y,s[u++]=d.z,s[u++]=d.x,s[u++]=d.y,s[u++]=d.z)}return jSe(t,{positions:e,normals:r,tangents:o,bitangents:s})}function GSe(e,t){let n=e._vertexFormat,i=e._ellipsoid,r=t.height,o=t.width,s=t.northCap,a=t.southCap,c=0,u=r,f=r,d=0;s&&(c=1,f-=1,d+=1),a&&(u-=1,f-=1,d+=1),d+=o*f;let p=n.position?new Float64Array(d*3):void 0,g=n.st?new Float32Array(d*2):void 0,m=0,y=0,A=ste,b=bAt,x=Number.MAX_VALUE,T=Number.MAX_VALUE,E=-Number.MAX_VALUE,v=-Number.MAX_VALUE;for(let C=c;C<u;++C)for(let w=0;w<o;++w)Sa.computePosition(t,i,n.st,C,w,A,b),p[m++]=A.x,p[m++]=A.y,p[m++]=A.z,n.st&&(g[y++]=b.x,g[y++]=b.y,x=Math.min(x,b.x),T=Math.min(T,b.y),E=Math.max(E,b.x),v=Math.max(v,b.y));if(s&&(Sa.computePosition(t,i,n.st,0,0,A,b),p[m++]=A.x,p[m++]=A.y,p[m++]=A.z,n.st&&(g[y++]=b.x,g[y++]=b.y,x=b.x,T=b.y,E=b.x,v=b.y)),a&&(Sa.computePosition(t,i,n.st,r-1,0,A,b),p[m++]=A.x,p[m++]=A.y,p[m]=A.z,n.st&&(g[y++]=b.x,g[y]=b.y,x=Math.min(x,b.x),T=Math.min(T,b.y),E=Math.max(E,b.x),v=Math.max(v,b.y))),n.st&&(x<0||T<0||E>1||v>1))for(let C=0;C<g.length;C+=2)g[C]=(g[C]-x)/(E-x),g[C+1]=(g[C+1]-T)/(v-T);let S=EAt(p,n,i,t.tangentRotationMatrix),I=6*(o-1)*(f-1);s&&(I+=3*(o-1)),a&&(I+=3*(o-1));let R=je.createTypedArray(d,I),O=0,L=0,_;for(_=0;_<f-1;++_){for(let C=0;C<o-1;++C){let w=O,P=w+o,M=P+1,F=w+1;R[L++]=w,R[L++]=P,R[L++]=F,R[L++]=F,R[L++]=P,R[L++]=M,++O}++O}if(s||a){let C=d-1,w=d-1;s&&a&&(C=d-2);let P,M;if(O=0,s)for(_=0;_<o-1;_++)P=O,M=P+1,R[L++]=C,R[L++]=P,R[L++]=M,++O;if(a)for(O=(f-1)*o,_=0;_<o-1;_++)P=O,M=P+1,R[L++]=P,R[L++]=w,R[L++]=M,++O}return S.indices=R,n.st&&(S.attributes.st=new Ne({componentDatatype:Y.FLOAT,componentsPerAttribute:2,values:g})),S}function rI(e,t,n,i,r){return e[t++]=i[n],e[t++]=i[n+1],e[t++]=i[n+2],e[t++]=r[n],e[t++]=r[n+1],e[t]=r[n+2],e}function oI(e,t,n,i){return e[t++]=i[n],e[t++]=i[n+1],e[t++]=i[n],e[t]=i[n+1],e}var cte=new Be;function vAt(e,t){let n=e._shadowVolume,i=e._offsetAttribute,r=e._vertexFormat,o=e._extrudedHeight,s=e._surfaceHeight,a=e._ellipsoid,c=t.height,u=t.width,f;if(n){let Pe=Be.clone(r,cte);Pe.normal=!0,e._vertexFormat=Pe}let d=GSe(e,t);n&&(e._vertexFormat=r);let p=fi.scaleToGeodeticHeight(d.attributes.position.values,s,a,!1);p=new Float64Array(p);let g=p.length,m=g*2,y=new Float64Array(m);y.set(p);let A=fi.scaleToGeodeticHeight(d.attributes.position.values,o,a);y.set(A,g),d.attributes.position.values=y;let b=r.normal?new Float32Array(m):void 0,x=r.tangent?new Float32Array(m):void 0,T=r.bitangent?new Float32Array(m):void 0,E=r.st?new Float32Array(m/3*2):void 0,v,S;if(r.normal){for(S=d.attributes.normal.values,b.set(S),f=0;f<g;f++)S[f]=-S[f];b.set(S,g),d.attributes.normal.values=b}if(n){S=d.attributes.normal.values,r.normal||(d.attributes.normal=void 0);let Pe=new Float32Array(m);for(f=0;f<g;f++)S[f]=-S[f];Pe.set(S,g),d.attributes.extrudeDirection=new Ne({componentDatatype:Y.FLOAT,componentsPerAttribute:3,values:Pe})}let I,R=l(i);if(R){let Pe=g/3*2,qe=new Uint8Array(Pe);i===mn.TOP?qe=qe.fill(1,0,Pe/2):(I=i===mn.NONE?0:1,qe=qe.fill(I)),d.attributes.applyOffset=new Ne({componentDatatype:Y.UNSIGNED_BYTE,componentsPerAttribute:1,values:qe})}if(r.tangent){let Pe=d.attributes.tangent.values;for(x.set(Pe),f=0;f<g;f++)Pe[f]=-Pe[f];x.set(Pe,g),d.attributes.tangent.values=x}if(r.bitangent){let Pe=d.attributes.bitangent.values;T.set(Pe),T.set(Pe,g),d.attributes.bitangent.values=T}r.st&&(v=d.attributes.st.values,E.set(v),E.set(v,g/3*2),d.attributes.st.values=E);let O=d.indices,L=O.length,_=g/3,C=je.createTypedArray(m/3,L*2);for(C.set(O),f=0;f<L;f+=3)C[f+L]=O[f+2]+_,C[f+1+L]=O[f+1]+_,C[f+2+L]=O[f]+_;d.indices=C;let w=t.northCap,P=t.southCap,M=c,F=2,V=0,B=4,j=4;w&&(F-=1,M-=1,V+=1,B-=2,j-=1),P&&(F-=1,M-=1,V+=1,B-=2,j-=1),V+=F*u+2*M-B;let k=(V+j)*2,G=new Float64Array(k*3),q=n?new Float32Array(k*3):void 0,Q=R?new Uint8Array(k):void 0,W=r.st?new Float32Array(k*2):void 0,J=i===mn.TOP;R&&!J&&(I=i===mn.ALL?1:0,Q=Q.fill(I));let Z=0,ae=0,Ae=0,fe=0,xe=u*M,ge;for(f=0;f<xe;f+=u)ge=f*3,G=rI(G,Z,ge,p,A),Z+=6,r.st&&(W=oI(W,ae,f*2,v),ae+=4),n&&(Ae+=3,q[Ae++]=S[ge],q[Ae++]=S[ge+1],q[Ae++]=S[ge+2]),J&&(Q[fe++]=1,fe+=1);if(P){let Pe=w?xe+1:xe;for(ge=Pe*3,f=0;f<2;f++)G=rI(G,Z,ge,p,A),Z+=6,r.st&&(W=oI(W,ae,Pe*2,v),ae+=4),n&&(Ae+=3,q[Ae++]=S[ge],q[Ae++]=S[ge+1],q[Ae++]=S[ge+2]),J&&(Q[fe++]=1,fe+=1)}else for(f=xe-u;f<xe;f++)ge=f*3,G=rI(G,Z,ge,p,A),Z+=6,r.st&&(W=oI(W,ae,f*2,v),ae+=4),n&&(Ae+=3,q[Ae++]=S[ge],q[Ae++]=S[ge+1],q[Ae++]=S[ge+2]),J&&(Q[fe++]=1,fe+=1);for(f=xe-1;f>0;f-=u)ge=f*3,G=rI(G,Z,ge,p,A),Z+=6,r.st&&(W=oI(W,ae,f*2,v),ae+=4),n&&(Ae+=3,q[Ae++]=S[ge],q[Ae++]=S[ge+1],q[Ae++]=S[ge+2]),J&&(Q[fe++]=1,fe+=1);if(w){let Pe=xe;for(ge=Pe*3,f=0;f<2;f++)G=rI(G,Z,ge,p,A),Z+=6,r.st&&(W=oI(W,ae,Pe*2,v),ae+=4),n&&(Ae+=3,q[Ae++]=S[ge],q[Ae++]=S[ge+1],q[Ae++]=S[ge+2]),J&&(Q[fe++]=1,fe+=1)}else for(f=u-1;f>=0;f--)ge=f*3,G=rI(G,Z,ge,p,A),Z+=6,r.st&&(W=oI(W,ae,f*2,v),ae+=4),n&&(Ae+=3,q[Ae++]=S[ge],q[Ae++]=S[ge+1],q[Ae++]=S[ge+2]),J&&(Q[fe++]=1,fe+=1);let we=CAt(G,r,a);r.st&&(we.attributes.st=new Ne({componentDatatype:Y.FLOAT,componentsPerAttribute:2,values:W})),n&&(we.attributes.extrudeDirection=new Ne({componentDatatype:Y.FLOAT,componentsPerAttribute:3,values:q})),R&&(we.attributes.applyOffset=new Ne({componentDatatype:Y.UNSIGNED_BYTE,componentsPerAttribute:1,values:Q}));let Se=je.createTypedArray(k,V*6),Re,Qe,He,Xe;g=G.length/3;let $e=0;for(f=0;f<g-1;f+=2){Re=f,Xe=(Re+2)%g;let Pe=h.fromArray(G,Re*3,ate),qe=h.fromArray(G,Xe*3,HSe);h.equalsEpsilon(Pe,qe,D.EPSILON10)||(Qe=(Re+1)%g,He=(Qe+2)%g,Se[$e++]=Re,Se[$e++]=Qe,Se[$e++]=Xe,Se[$e++]=Xe,Se[$e++]=Qe,Se[$e++]=He)}return we.indices=Se,we=Hn.combineInstances([new Ft({geometry:d}),new Ft({geometry:we})]),we[0]}var SAt=[new h,new h,new h,new h],WSe=new he,wAt=new he;function lte(e,t,n,i,r){if(n===0)return ie.clone(e,r);let o=Sa.computeOptions(e,t,n,0,VSe,WSe),s=o.height,a=o.width,c=SAt;return Sa.computePosition(o,i,!1,0,0,c[0]),Sa.computePosition(o,i,!1,0,a-1,c[1]),Sa.computePosition(o,i,!1,s-1,0,c[2]),Sa.computePosition(o,i,!1,s-1,a-1,c[3]),ie.fromCartesianArray(c,i,r)}function d0(e){e=e??H.EMPTY_OBJECT;let t=e.rectangle,n=e.height??0,i=e.extrudedHeight??n;this._rectangle=ie.clone(t),this._granularity=e.granularity??D.RADIANS_PER_DEGREE,this._ellipsoid=ee.clone(e.ellipsoid??ee.default),this._surfaceHeight=Math.max(n,i),this._rotation=e.rotation??0,this._stRotation=e.stRotation??0,this._vertexFormat=Be.clone(e.vertexFormat??Be.DEFAULT),this._extrudedHeight=Math.min(n,i),this._shadowVolume=e.shadowVolume??!1,this._workerName="createRectangleGeometry",this._offsetAttribute=e.offsetAttribute,this._rotatedRectangle=void 0,this._textureCoordinateRotationPoints=void 0}d0.packedLength=ie.packedLength+ee.packedLength+Be.packedLength+7;d0.pack=function(e,t,n){return n=n??0,ie.pack(e._rectangle,t,n),n+=ie.packedLength,ee.pack(e._ellipsoid,t,n),n+=ee.packedLength,Be.pack(e._vertexFormat,t,n),n+=Be.packedLength,t[n++]=e._granularity,t[n++]=e._surfaceHeight,t[n++]=e._rotation,t[n++]=e._stRotation,t[n++]=e._extrudedHeight,t[n++]=e._shadowVolume?1:0,t[n]=e._offsetAttribute??-1,t};var qSe=new ie,YSe=ee.clone(ee.UNIT_SPHERE),nb={rectangle:qSe,ellipsoid:YSe,vertexFormat:cte,granularity:void 0,height:void 0,rotation:void 0,stRotation:void 0,extrudedHeight:void 0,shadowVolume:void 0,offsetAttribute:void 0};d0.unpack=function(e,t,n){t=t??0;let i=ie.unpack(e,t,qSe);t+=ie.packedLength;let r=ee.unpack(e,t,YSe);t+=ee.packedLength;let o=Be.unpack(e,t,cte);t+=Be.packedLength;let s=e[t++],a=e[t++],c=e[t++],u=e[t++],f=e[t++],d=e[t++]===1,p=e[t];return l(n)?(n._rectangle=ie.clone(i,n._rectangle),n._ellipsoid=ee.clone(r,n._ellipsoid),n._vertexFormat=Be.clone(o,n._vertexFormat),n._granularity=s,n._surfaceHeight=a,n._rotation=c,n._stRotation=u,n._extrudedHeight=f,n._shadowVolume=d,n._offsetAttribute=p===-1?void 0:p,n):(nb.granularity=s,nb.height=a,nb.rotation=c,nb.stRotation=u,nb.extrudedHeight=f,nb.shadowVolume=d,nb.offsetAttribute=p===-1?void 0:p,new d0(nb))};d0.computeRectangle=function(e,t){e=e??H.EMPTY_OBJECT;let n=e.rectangle,i=e.granularity??D.RADIANS_PER_DEGREE,r=e.ellipsoid??ee.default,o=e.rotation??0;return lte(n,i,o,r,t)};var IAt=new $,FSe=new Le,PAt=new he;d0.createGeometry=function(e){if(D.equalsEpsilon(e._rectangle.north,e._rectangle.south,D.EPSILON10)||D.equalsEpsilon(e._rectangle.east,e._rectangle.west,D.EPSILON10))return;let t=e._rectangle,n=e._ellipsoid,i=e._rotation,r=e._stRotation,o=e._vertexFormat,s=Sa.computeOptions(t,e._granularity,i,r,VSe,WSe,wAt),a=IAt;if(r!==0||i!==0){let g=ie.center(t,PAt),m=n.geodeticSurfaceNormalCartographic(g,ate);Le.fromAxisAngle(m,-r,FSe),$.fromQuaternion(FSe,a)}else $.clone($.IDENTITY,a);let c=e._surfaceHeight,u=e._extrudedHeight,f=!D.equalsEpsilon(c,u,0,D.EPSILON2);s.lonScalar=1/e._rectangle.width,s.latScalar=1/e._rectangle.height,s.tangentRotationMatrix=a;let d,p;if(t=e._rectangle,f){d=vAt(e,s);let g=ue.fromRectangle3D(t,n,c,TAt),m=ue.fromRectangle3D(t,n,u,xAt);p=ue.union(g,m)}else{if(d=GSe(e,s),d.attributes.position.values=fi.scaleToGeodeticHeight(d.attributes.position.values,c,n,!1),l(e._offsetAttribute)){let g=d.attributes.position.values.length,m=e._offsetAttribute===mn.NONE?0:1,y=new Uint8Array(g/3).fill(m);d.attributes.applyOffset=new Ne({componentDatatype:Y.UNSIGNED_BYTE,componentsPerAttribute:1,values:y})}p=ue.fromRectangle3D(t,n,c)}return o.position||delete d.attributes.position,new St({attributes:d.attributes,indices:d.indices,primitiveType:d.primitiveType,boundingSphere:p,offsetAttribute:e._offsetAttribute})};d0.createShadowVolume=function(e,t,n){let i=e._granularity,r=e._ellipsoid,o=t(i,r),s=n(i,r);return new d0({rectangle:e._rectangle,rotation:e._rotation,ellipsoid:r,stRotation:e._stRotation,granularity:i,extrudedHeight:s,height:o,vertexFormat:Be.POSITION_ONLY,shadowVolume:!0})};var BSe=new ie,DAt=[new U,new U,new U],RAt=new Xi,OAt=new he;function MAt(e){if(e._stRotation===0)return[0,0,0,1,1,0];let t=ie.clone(e._rectangle,BSe),n=e._granularity,i=e._ellipsoid,r=e._rotation-e._stRotation,o=lte(t,n,r,i,BSe),s=DAt;s[0].x=o.west,s[0].y=o.south,s[1].x=o.west,s[1].y=o.north,s[2].x=o.east,s[2].y=o.south;let a=e.rectangle,c=Xi.fromRotation(e._stRotation,RAt),u=ie.center(a,OAt);for(let m=0;m<3;++m){let y=s[m];y.x-=u.longitude,y.y-=u.latitude,Xi.multiplyByVector(c,y,y),y.x+=u.longitude,y.y+=u.latitude,y.x=(y.x-a.west)/a.width,y.y=(y.y-a.south)/a.height}let f=s[0],d=s[1],p=s[2],g=new Array(6);return U.pack(f,g),U.pack(d,g,2),U.pack(p,g,4),g}Object.defineProperties(d0.prototype,{rectangle:{get:function(){return l(this._rotatedRectangle)||(this._rotatedRectangle=lte(this._rectangle,this._granularity,this._rotation,this._ellipsoid)),this._rotatedRectangle}},textureCoordinateRotationPoints:{get:function(){return l(this._textureCoordinateRotationPoints)||(this._textureCoordinateRotationPoints=MAt(this)),this._textureCoordinateRotationPoints}}});var hE=d0;var XSe=new z,KSe=h.ZERO,$Se=new h,JSe=new ie,NAt=new ie,LAt=new he;function FAt(e){this.id=e,this.vertexFormat=void 0,this.rectangle=void 0,this.height=void 0,this.extrudedHeight=void 0,this.granularity=void 0,this.stRotation=void 0,this.rotation=void 0,this.offsetAttribute=void 0}function Um(e,t){ii.call(this,{entity:e,scene:t,geometryOptions:new FAt(e),geometryPropertyName:"rectangle",observedPropertyNames:["availability","rectangle"]}),this._onEntityPropertyChanged(e,"rectangle",e.rectangle,void 0)}l(Object.create)&&(Um.prototype=Object.create(ii.prototype),Um.prototype.constructor=Um);Um.prototype.createFillGeometryInstance=function(e){let t=this._entity,n=t.isAvailable(e),i={show:new Pn(n&&t.isShowing&&this._showProperty.getValue(e)&&this._fillProperty.getValue(e)),distanceDisplayCondition:Qn.fromDistanceDisplayCondition(this._distanceDisplayConditionProperty.getValue(e)),offset:void 0,color:void 0};if(this._materialProperty instanceof Kt){let r;l(this._materialProperty.color)&&(this._materialProperty.color.isConstant||n)&&(r=this._materialProperty.color.getValue(e,XSe)),l(r)||(r=z.WHITE),i.color=Jt.fromColor(r)}return l(this._options.offsetAttribute)&&(i.offset=Tr.fromCartesian3(X.getValueOrDefault(this._terrainOffsetProperty,e,KSe,$Se))),new Ft({id:t,geometry:new hE(this._options),attributes:i})};Um.prototype.createOutlineGeometryInstance=function(e){let t=this._entity,n=t.isAvailable(e),i=X.getValueOrDefault(this._outlineColorProperty,e,z.BLACK,XSe),r=this._distanceDisplayConditionProperty.getValue(e),o={show:new Pn(n&&t.isShowing&&this._showProperty.getValue(e)&&this._showOutlineProperty.getValue(e)),color:Jt.fromColor(i),distanceDisplayCondition:Qn.fromDistanceDisplayCondition(r),offset:void 0};return l(this._options.offsetAttribute)&&(o.offset=Tr.fromCartesian3(X.getValueOrDefault(this._terrainOffsetProperty,e,KSe,$Se))),new Ft({id:t,geometry:new GT(this._options),attributes:o})};Um.prototype._computeCenter=function(e,t){let n=X.getValueOrUndefined(this._entity.rectangle.coordinates,e,NAt);if(!l(n))return;let i=ie.center(n,LAt);return he.toCartesian(i,ee.default,t)};Um.prototype._isHidden=function(e,t){return!l(t.coordinates)||Pi.prototype._isHidden.call(this,e,t)};Um.prototype._isDynamic=function(e,t){return!t.coordinates.isConstant||!X.isConstant(t.height)||!X.isConstant(t.extrudedHeight)||!X.isConstant(t.granularity)||!X.isConstant(t.stRotation)||!X.isConstant(t.rotation)||!X.isConstant(t.outlineWidth)||!X.isConstant(t.zIndex)||this._onTerrain&&!X.isConstant(this._materialProperty)&&!(this._materialProperty instanceof Kt)};Um.prototype._setStaticOptions=function(e,t){let n=this._materialProperty instanceof Kt,i=X.getValueOrUndefined(t.height,nt.MINIMUM_VALUE),r=X.getValueOrDefault(t.heightReference,nt.MINIMUM_VALUE,We.NONE),o=X.getValueOrUndefined(t.extrudedHeight,nt.MINIMUM_VALUE),s=X.getValueOrDefault(t.extrudedHeightReference,nt.MINIMUM_VALUE,We.NONE);l(o)&&!l(i)&&(i=0);let a=this._options;a.vertexFormat=n?yn.VERTEX_FORMAT:Er.MaterialSupport.TEXTURED.vertexFormat,a.rectangle=t.coordinates.getValue(nt.MINIMUM_VALUE,a.rectangle),a.granularity=X.getValueOrUndefined(t.granularity,nt.MINIMUM_VALUE),a.stRotation=X.getValueOrUndefined(t.stRotation,nt.MINIMUM_VALUE),a.rotation=X.getValueOrUndefined(t.rotation,nt.MINIMUM_VALUE),a.offsetAttribute=ii.computeGeometryOffsetAttribute(i,r,o,s),a.height=ii.getGeometryHeight(i,r),o=ii.getGeometryExtrudedHeight(o,s),o===ii.CLAMP_TO_GROUND&&(o=Mi.getMinimumMaximumHeights(hE.computeRectangle(a,JSe)).minimumTerrainHeight),a.extrudedHeight=o};Um.DynamicGeometryUpdater=sI;function sI(e,t,n){Ii.call(this,e,t,n)}l(Object.create)&&(sI.prototype=Object.create(Ii.prototype),sI.prototype.constructor=sI);sI.prototype._isHidden=function(e,t,n){return!l(this._options.rectangle)||Ii.prototype._isHidden.call(this,e,t,n)};sI.prototype._setOptions=function(e,t,n){let i=this._options,r=X.getValueOrUndefined(t.height,n),o=X.getValueOrDefault(t.heightReference,n,We.NONE),s=X.getValueOrUndefined(t.extrudedHeight,n),a=X.getValueOrDefault(t.extrudedHeightReference,n,We.NONE);l(s)&&!l(r)&&(r=0),i.rectangle=X.getValueOrUndefined(t.coordinates,n,i.rectangle),i.granularity=X.getValueOrUndefined(t.granularity,n),i.stRotation=X.getValueOrUndefined(t.stRotation,n),i.rotation=X.getValueOrUndefined(t.rotation,n),i.offsetAttribute=ii.computeGeometryOffsetAttribute(r,o,s,a),i.height=ii.getGeometryHeight(r,o),s=ii.getGeometryExtrudedHeight(s,a),s===ii.CLAMP_TO_GROUND&&(s=Mi.getMinimumMaximumHeights(hE.computeRectangle(i,JSe)).minimumTerrainHeight),i.extrudedHeight=s};var p3=Um;var ZSe={};function BAt(e,t){return D.equalsEpsilon(e.latitude,t.latitude,D.EPSILON10)&&D.equalsEpsilon(e.longitude,t.longitude,D.EPSILON10)}var kAt=new he,UAt=new he;function zAt(e,t,n,i){t=Fr(t,h.equalsEpsilon);let r=t.length;if(r<2)return;let o=l(i),s=l(n),a=new Array(r),c=new Array(r),u=new Array(r),f=t[0];a[0]=f;let d=e.cartesianToCartographic(f,kAt);s&&(d.height=n[0]),c[0]=d.height,o?u[0]=i[0]:u[0]=0;let p=c[0],g=u[0],m=p===g,y=1;for(let A=1;A<r;++A){let b=t[A],x=e.cartesianToCartographic(b,UAt);s&&(x.height=n[A]),m=m&&x.height===0,BAt(d,x)?d.height<x.height&&(c[y-1]=x.height):(a[y]=b,c[y]=x.height,o?u[y]=i[A]:u[y]=0,m=m&&c[y]===u[y],he.clone(x,d),++y)}if(!(m||y<2))return a.length=y,c.length=y,u.length=y,{positions:a,topHeights:c,bottomHeights:u}}var VAt=new Array(2),jAt=new Array(2),HAt={positions:void 0,height:void 0,granularity:void 0,ellipsoid:void 0};ZSe.computePositions=function(e,t,n,i,r,o){let s=zAt(e,t,n,i);if(!l(s))return;t=s.positions,n=s.topHeights,i=s.bottomHeights;let a=t.length,c=a-2,u,f,d=D.chordLength(r,e.maximumRadius),p=HAt;if(p.minDistance=d,p.ellipsoid=e,o){let g=0,m;for(m=0;m<a-1;m++)g+=ir.numberOfPoints(t[m],t[m+1],d)+1;u=new Float64Array(g*3),f=new Float64Array(g*3);let y=VAt,A=jAt;p.positions=y,p.height=A;let b=0;for(m=0;m<a-1;m++){y[0]=t[m],y[1]=t[m+1],A[0]=n[m],A[1]=n[m+1];let x=ir.generateArc(p);u.set(x,b),A[0]=i[m],A[1]=i[m+1],f.set(ir.generateArc(p),b),b+=x.length}}else p.positions=t,p.height=n,u=new Float64Array(ir.generateArc(p)),p.height=i,f=new Float64Array(ir.generateArc(p));return{bottomPositions:f,topPositions:u,numCorners:c}};var mE=ZSe;var ute=new h,HG=new h,GAt=new h,QSe=new h,WAt=new h,qAt=new h,YAt=new h;function pE(e){e=e??H.EMPTY_OBJECT;let t=e.positions,n=e.maximumHeights,i=e.minimumHeights,r=e.vertexFormat??Be.DEFAULT,o=e.granularity??D.RADIANS_PER_DEGREE,s=e.ellipsoid??ee.default;this._positions=t,this._minimumHeights=i,this._maximumHeights=n,this._vertexFormat=Be.clone(r),this._granularity=o,this._ellipsoid=ee.clone(s),this._workerName="createWallGeometry";let a=1+t.length*h.packedLength+2;l(i)&&(a+=i.length),l(n)&&(a+=n.length),this.packedLength=a+ee.packedLength+Be.packedLength+1}pE.pack=function(e,t,n){n=n??0;let i,r=e._positions,o=r.length;for(t[n++]=o,i=0;i<o;++i,n+=h.packedLength)h.pack(r[i],t,n);let s=e._minimumHeights;if(o=l(s)?s.length:0,t[n++]=o,l(s))for(i=0;i<o;++i)t[n++]=s[i];let a=e._maximumHeights;if(o=l(a)?a.length:0,t[n++]=o,l(a))for(i=0;i<o;++i)t[n++]=a[i];return ee.pack(e._ellipsoid,t,n),n+=ee.packedLength,Be.pack(e._vertexFormat,t,n),n+=Be.packedLength,t[n]=e._granularity,t};var ewe=ee.clone(ee.UNIT_SPHERE),twe=new Be,g3={positions:void 0,minimumHeights:void 0,maximumHeights:void 0,ellipsoid:ewe,vertexFormat:twe,granularity:void 0};pE.unpack=function(e,t,n){t=t??0;let i,r=e[t++],o=new Array(r);for(i=0;i<r;++i,t+=h.packedLength)o[i]=h.unpack(e,t);r=e[t++];let s;if(r>0)for(s=new Array(r),i=0;i<r;++i)s[i]=e[t++];r=e[t++];let a;if(r>0)for(a=new Array(r),i=0;i<r;++i)a[i]=e[t++];let c=ee.unpack(e,t,ewe);t+=ee.packedLength;let u=Be.unpack(e,t,twe);t+=Be.packedLength;let f=e[t];return l(n)?(n._positions=o,n._minimumHeights=s,n._maximumHeights=a,n._ellipsoid=ee.clone(c,n._ellipsoid),n._vertexFormat=Be.clone(u,n._vertexFormat),n._granularity=f,n):(g3.positions=o,g3.minimumHeights=s,g3.maximumHeights=a,g3.granularity=f,new pE(g3))};pE.fromConstantHeights=function(e){e=e??H.EMPTY_OBJECT;let t=e.positions,n,i,r=e.minimumHeight,o=e.maximumHeight,s=l(r),a=l(o);if(s||a){let u=t.length;n=s?new Array(u):void 0,i=a?new Array(u):void 0;for(let f=0;f<u;++f)s&&(n[f]=r),a&&(i[f]=o)}let c={positions:t,maximumHeights:i,minimumHeights:n,ellipsoid:e.ellipsoid,vertexFormat:e.vertexFormat};return new pE(c)};pE.createGeometry=function(e){let t=e._positions,n=e._minimumHeights,i=e._maximumHeights,r=e._vertexFormat,o=e._granularity,s=e._ellipsoid,a=mE.computePositions(s,t,i,n,o,!0);if(!l(a))return;let c=a.bottomPositions,u=a.topPositions,f=a.numCorners,d=u.length,p=d*2,g=r.position?new Float64Array(p):void 0,m=r.normal?new Float32Array(p):void 0,y=r.tangent?new Float32Array(p):void 0,A=r.bitangent?new Float32Array(p):void 0,b=r.st?new Float32Array(p/3*2):void 0,x=0,T=0,E=0,v=0,S=0,I=YAt,R=qAt,O=WAt,L=!0;d/=3;let _,C=0,w=1/(d-f-1);for(_=0;_<d;++_){let B=_*3,j=h.fromArray(u,B,ute),k=h.fromArray(c,B,HG);if(r.position&&(g[x++]=k.x,g[x++]=k.y,g[x++]=k.z,g[x++]=j.x,g[x++]=j.y,g[x++]=j.z),r.st&&(b[S++]=C,b[S++]=0,b[S++]=C,b[S++]=1),r.normal||r.tangent||r.bitangent){let G=h.clone(h.ZERO,QSe),q=h.subtract(j,s.geodeticSurfaceNormal(j,HG),HG);if(_+1<d&&(G=h.fromArray(u,B+3,QSe)),L){let Q=h.subtract(G,j,GAt),W=h.subtract(q,j,ute);I=h.normalize(h.cross(W,Q,I),I),L=!1}h.equalsEpsilon(j,G,D.EPSILON10)?L=!0:(C+=w,r.tangent&&(R=h.normalize(h.subtract(G,j,R),R)),r.bitangent&&(O=h.normalize(h.cross(I,R,O),O))),r.normal&&(m[T++]=I.x,m[T++]=I.y,m[T++]=I.z,m[T++]=I.x,m[T++]=I.y,m[T++]=I.z),r.tangent&&(y[v++]=R.x,y[v++]=R.y,y[v++]=R.z,y[v++]=R.x,y[v++]=R.y,y[v++]=R.z),r.bitangent&&(A[E++]=O.x,A[E++]=O.y,A[E++]=O.z,A[E++]=O.x,A[E++]=O.y,A[E++]=O.z)}}let P=new Tn;r.position&&(P.position=new Ne({componentDatatype:Y.DOUBLE,componentsPerAttribute:3,values:g})),r.normal&&(P.normal=new Ne({componentDatatype:Y.FLOAT,componentsPerAttribute:3,values:m})),r.tangent&&(P.tangent=new Ne({componentDatatype:Y.FLOAT,componentsPerAttribute:3,values:y})),r.bitangent&&(P.bitangent=new Ne({componentDatatype:Y.FLOAT,componentsPerAttribute:3,values:A})),r.st&&(P.st=new Ne({componentDatatype:Y.FLOAT,componentsPerAttribute:2,values:b}));let M=p/3;p-=6*(f+1);let F=je.createTypedArray(M,p),V=0;for(_=0;_<M-2;_+=2){let B=_,j=_+2,k=h.fromArray(g,B*3,ute),G=h.fromArray(g,j*3,HG);if(h.equalsEpsilon(k,G,D.EPSILON10))continue;let q=_+1,Q=_+3;F[V++]=q,F[V++]=B,F[V++]=Q,F[V++]=Q,F[V++]=B,F[V++]=j}return new St({attributes:P,indices:F,primitiveType:Oe.TRIANGLES,boundingSphere:ue.fromVertices(g)})};var _3=pE;var nwe=new h,iwe=new h;function gE(e){e=e??H.EMPTY_OBJECT;let t=e.positions,n=e.maximumHeights,i=e.minimumHeights,r=e.granularity??D.RADIANS_PER_DEGREE,o=e.ellipsoid??ee.default;this._positions=t,this._minimumHeights=i,this._maximumHeights=n,this._granularity=r,this._ellipsoid=ee.clone(o),this._workerName="createWallOutlineGeometry";let s=1+t.length*h.packedLength+2;l(i)&&(s+=i.length),l(n)&&(s+=n.length),this.packedLength=s+ee.packedLength+1}gE.pack=function(e,t,n){n=n??0;let i,r=e._positions,o=r.length;for(t[n++]=o,i=0;i<o;++i,n+=h.packedLength)h.pack(r[i],t,n);let s=e._minimumHeights;if(o=l(s)?s.length:0,t[n++]=o,l(s))for(i=0;i<o;++i)t[n++]=s[i];let a=e._maximumHeights;if(o=l(a)?a.length:0,t[n++]=o,l(a))for(i=0;i<o;++i)t[n++]=a[i];return ee.pack(e._ellipsoid,t,n),n+=ee.packedLength,t[n]=e._granularity,t};var rwe=ee.clone(ee.UNIT_SPHERE),y3={positions:void 0,minimumHeights:void 0,maximumHeights:void 0,ellipsoid:rwe,granularity:void 0};gE.unpack=function(e,t,n){t=t??0;let i,r=e[t++],o=new Array(r);for(i=0;i<r;++i,t+=h.packedLength)o[i]=h.unpack(e,t);r=e[t++];let s;if(r>0)for(s=new Array(r),i=0;i<r;++i)s[i]=e[t++];r=e[t++];let a;if(r>0)for(a=new Array(r),i=0;i<r;++i)a[i]=e[t++];let c=ee.unpack(e,t,rwe);t+=ee.packedLength;let u=e[t];return l(n)?(n._positions=o,n._minimumHeights=s,n._maximumHeights=a,n._ellipsoid=ee.clone(c,n._ellipsoid),n._granularity=u,n):(y3.positions=o,y3.minimumHeights=s,y3.maximumHeights=a,y3.granularity=u,new gE(y3))};gE.fromConstantHeights=function(e){e=e??H.EMPTY_OBJECT;let t=e.positions,n,i,r=e.minimumHeight,o=e.maximumHeight,s=l(r),a=l(o);if(s||a){let u=t.length;n=s?new Array(u):void 0,i=a?new Array(u):void 0;for(let f=0;f<u;++f)s&&(n[f]=r),a&&(i[f]=o)}let c={positions:t,maximumHeights:i,minimumHeights:n,ellipsoid:e.ellipsoid};return new gE(c)};gE.createGeometry=function(e){let t=e._positions,n=e._minimumHeights,i=e._maximumHeights,r=e._granularity,o=e._ellipsoid,s=mE.computePositions(o,t,i,n,r,!1);if(!l(s))return;let a=s.bottomPositions,c=s.topPositions,u=c.length,f=u*2,d=new Float64Array(f),p=0;u/=3;let g;for(g=0;g<u;++g){let x=g*3,T=h.fromArray(c,x,nwe),E=h.fromArray(a,x,iwe);d[p++]=E.x,d[p++]=E.y,d[p++]=E.z,d[p++]=T.x,d[p++]=T.y,d[p++]=T.z}let m=new Tn({position:new Ne({componentDatatype:Y.DOUBLE,componentsPerAttribute:3,values:d})}),y=f/3;f=2*y-4+y;let A=je.createTypedArray(y,f),b=0;for(g=0;g<y-2;g+=2){let x=g,T=g+2,E=h.fromArray(d,x*3,nwe),v=h.fromArray(d,T*3,iwe);if(h.equalsEpsilon(E,v,D.EPSILON10))continue;let S=g+1,I=g+3;A[b++]=S,A[b++]=x,A[b++]=S,A[b++]=I,A[b++]=x,A[b++]=T}return A[b++]=y-2,A[b]=y-1,new St({attributes:m,indices:A,primitiveType:Oe.LINES,boundingSphere:ue.fromVertices(d)})};var A3=gE;var owe=new z;function XAt(e){this.id=e,this.vertexFormat=void 0,this.positions=void 0,this.minimumHeights=void 0,this.maximumHeights=void 0,this.granularity=void 0}function zm(e,t){Pi.call(this,{entity:e,scene:t,geometryOptions:new XAt(e),geometryPropertyName:"wall",observedPropertyNames:["availability","wall"]}),this._onEntityPropertyChanged(e,"wall",e.wall,void 0)}l(Object.create)&&(zm.prototype=Object.create(Pi.prototype),zm.prototype.constructor=zm);zm.prototype.createFillGeometryInstance=function(e){let t=this._entity,n=t.isAvailable(e),i,r,o=new Pn(n&&t.isShowing&&this._showProperty.getValue(e)&&this._fillProperty.getValue(e)),s=this._distanceDisplayConditionProperty.getValue(e),a=Qn.fromDistanceDisplayCondition(s);if(this._materialProperty instanceof Kt){let c;l(this._materialProperty.color)&&(this._materialProperty.color.isConstant||n)&&(c=this._materialProperty.color.getValue(e,owe)),l(c)||(c=z.WHITE),r=Jt.fromColor(c),i={show:o,distanceDisplayCondition:a,color:r}}else i={show:o,distanceDisplayCondition:a};return new Ft({id:t,geometry:new _3(this._options),attributes:i})};zm.prototype.createOutlineGeometryInstance=function(e){let t=this._entity,n=t.isAvailable(e),i=X.getValueOrDefault(this._outlineColorProperty,e,z.BLACK,owe),r=this._distanceDisplayConditionProperty.getValue(e);return new Ft({id:t,geometry:new A3(this._options),attributes:{show:new Pn(n&&t.isShowing&&this._showProperty.getValue(e)&&this._showOutlineProperty.getValue(e)),color:Jt.fromColor(i),distanceDisplayCondition:Qn.fromDistanceDisplayCondition(r)}})};zm.prototype._isHidden=function(e,t){return!l(t.positions)||Pi.prototype._isHidden.call(this,e,t)};zm.prototype._getIsClosed=function(e){return!1};zm.prototype._isDynamic=function(e,t){return!t.positions.isConstant||!X.isConstant(t.minimumHeights)||!X.isConstant(t.maximumHeights)||!X.isConstant(t.outlineWidth)||!X.isConstant(t.granularity)};zm.prototype._setStaticOptions=function(e,t){let n=t.minimumHeights,i=t.maximumHeights,r=t.granularity,o=this._materialProperty instanceof Kt,s=this._options;s.vertexFormat=o?yn.VERTEX_FORMAT:Er.MaterialSupport.TEXTURED.vertexFormat,s.positions=t.positions.getValue(nt.MINIMUM_VALUE,s.positions),s.minimumHeights=l(n)?n.getValue(nt.MINIMUM_VALUE,s.minimumHeights):void 0,s.maximumHeights=l(i)?i.getValue(nt.MINIMUM_VALUE,s.maximumHeights):void 0,s.granularity=l(r)?r.getValue(nt.MINIMUM_VALUE):void 0};zm.DynamicGeometryUpdater=aI;function aI(e,t,n){Ii.call(this,e,t,n)}l(Object.create)&&(aI.prototype=Object.create(Ii.prototype),aI.prototype.constructor=aI);aI.prototype._isHidden=function(e,t,n){return!l(this._options.positions)||Ii.prototype._isHidden.call(this,e,t,n)};aI.prototype._setOptions=function(e,t,n){let i=this._options;i.positions=X.getValueOrUndefined(t.positions,n,i.positions),i.minimumHeights=X.getValueOrUndefined(t.minimumHeights,n,i.minimumHeights),i.maximumHeights=X.getValueOrUndefined(t.maximumHeights,n,i.maximumHeights),i.granularity=X.getValueOrUndefined(t.granularity,n)};var b3=zm;var _E=[UN,Uk,Ok,Zk,e3,i3,a3,m3,p3,b3];function yE(e,t){this.entity=e,this.scene=t;let n=new Array(_E.length),i=new be,r=new Xo;for(let o=0;o<n.length;o++){let s=new _E[o](e,t);r.add(s.geometryChanged,a=>{i.raiseEvent(a)}),n[o]=s}this.updaters=n,this.geometryChanged=i,this.eventHelper=r,this._removeEntitySubscription=e.definitionChanged.addEventListener(yE.prototype._onEntityPropertyChanged,this)}yE.prototype._onEntityPropertyChanged=function(e,t,n,i){let r=this.updaters;for(let o=0;o<r.length;o++)r[o]._onEntityPropertyChanged(e,t,n,i)};yE.prototype.forEach=function(e){let t=this.updaters;for(let n=0;n<t.length;n++)e(t[n])};yE.prototype.destroy=function(){this.eventHelper.removeAll();let e=this.updaters;for(let t=0;t<e.length;t++)e[t].destroy();this._removeEntitySubscription(),le(this)};yE.registerUpdater=function(e){_E.includes(e)||_E.push(e)};yE.unregisterUpdater=function(e){if(_E.includes(e)){let t=_E.indexOf(e);_E.splice(t,1)}};var AE=yE;var swe=new z,KAt=new Ht,$At=new Ht,JAt=h.ZERO,ZAt=new h;function Vm(e,t,n,i,r,o,s){this.translucent=t,this.appearanceType=n,this.depthFailAppearanceType=i,this.depthFailMaterialProperty=r,this.depthFailMaterial=void 0,this.closed=o,this.shadows=s,this.primitives=e,this.createPrimitive=!1,this.waitingOnCreate=!1,this.primitive=void 0,this.oldPrimitive=void 0,this.geometry=new Ut,this.updaters=new Ut,this.updatersWithAttributes=new Ut,this.attributes=new Ut,this.subscriptions=new Ut,this.showsUpdated=new Ut,this.itemsToRemove=[],this.invalidated=!1;let a;l(r)&&(a=r.definitionChanged.addEventListener(Vm.prototype.onMaterialChanged,this)),this.removeMaterialSubscription=a}Vm.prototype.onMaterialChanged=function(){this.invalidated=!0};Vm.prototype.isMaterial=function(e){let t=this.depthFailMaterialProperty,n=e.depthFailMaterialProperty;return n===t?!0:l(t)?t.equals(n):!1};Vm.prototype.add=function(e,t){let n=e.id;if(this.createPrimitive=!0,this.geometry.set(n,t),this.updaters.set(n,e),!e.hasConstantFill||!e.fillMaterialProperty.isConstant||!X.isConstant(e.distanceDisplayConditionProperty)||!X.isConstant(e.terrainOffsetProperty))this.updatersWithAttributes.set(n,e);else{let i=this;this.subscriptions.set(n,e.entity.definitionChanged.addEventListener(function(r,o,s,a){o==="isShowing"&&i.showsUpdated.set(e.id,e)}))}};Vm.prototype.remove=function(e){let t=e.id;if(this.createPrimitive=this.geometry.remove(t)||this.createPrimitive,this.updaters.remove(t)){this.updatersWithAttributes.remove(t);let n=this.subscriptions.get(t);return l(n)&&(n(),this.subscriptions.remove(t),this.showsUpdated.remove(t)),!0}return!1};Vm.prototype.update=function(e){let t=!0,n=0,i=this.primitive,r=this.primitives,o;if(this.createPrimitive){let s=this.geometry.values;if(s.length>0){l(i)&&(l(this.oldPrimitive)?r.remove(i):this.oldPrimitive=i);let c;if(l(this.depthFailAppearanceType)){l(this.depthFailMaterialProperty)&&(this.depthFailMaterial=_o.getValue(e,this.depthFailMaterialProperty,this.depthFailMaterial));let f=this.depthFailAppearanceType;c=new f({material:this.depthFailMaterial,translucent:this.translucent,closed:this.closed})}let u=this.appearanceType;i=new On({show:!1,asynchronous:!0,geometryInstances:s.slice(),appearance:new u({translucent:this.translucent,closed:this.closed}),depthFailAppearance:c,shadows:this.shadows}),r.add(i),t=!1}else{l(i)&&(r.remove(i),i=void 0);let c=this.oldPrimitive;l(c)&&(r.remove(c),this.oldPrimitive=void 0)}this.attributes.removeAll(),this.primitive=i,this.createPrimitive=!1,this.waitingOnCreate=!0}else if(l(i)&&i.ready){i.show=!0,l(this.oldPrimitive)&&(r.remove(this.oldPrimitive),this.oldPrimitive=void 0),l(this.depthFailAppearanceType)&&!(this.depthFailMaterialProperty instanceof Kt)&&(this.depthFailMaterial=_o.getValue(e,this.depthFailMaterialProperty,this.depthFailMaterial),this.primitive.depthFailAppearance.material=this.depthFailMaterial);let s=this.updatersWithAttributes.values,a=s.length,c=this.waitingOnCreate;for(o=0;o<a;o++){let u=s[o],f=this.geometry.get(u.id),d=this.attributes.get(f.id.id);if(l(d)||(d=i.getGeometryInstanceAttributes(f.id),this.attributes.set(f.id.id,d)),!u.fillMaterialProperty.isConstant||c){let A=u.fillMaterialProperty.color,b=X.getValueOrDefault(A,e,z.WHITE,swe);z.equals(d._lastColor,b)||(d._lastColor=z.clone(b,d._lastColor),d.color=Jt.toValue(b,d.color),(this.translucent&&d.color[3]===255||!this.translucent&&d.color[3]!==255)&&(this.itemsToRemove[n++]=u))}if(l(this.depthFailAppearanceType)&&u.depthFailMaterialProperty instanceof Kt&&(!u.depthFailMaterialProperty.isConstant||c)){let A=u.depthFailMaterialProperty.color,b=X.getValueOrDefault(A,e,z.WHITE,swe);z.equals(d._lastDepthFailColor,b)||(d._lastDepthFailColor=z.clone(b,d._lastDepthFailColor),d.depthFailColor=Jt.toValue(b,d.depthFailColor))}let p=u.entity.isShowing&&(u.hasConstantFill||u.isFilled(e)),g=d.show[0]===1;p!==g&&(d.show=Pn.toValue(p,d.show));let m=u.distanceDisplayConditionProperty;if(!X.isConstant(m)){let A=X.getValueOrDefault(m,e,$At,KAt);Ht.equals(A,d._lastDistanceDisplayCondition)||(d._lastDistanceDisplayCondition=Ht.clone(A,d._lastDistanceDisplayCondition),d.distanceDisplayCondition=Qn.toValue(A,d.distanceDisplayCondition))}let y=u.terrainOffsetProperty;if(!X.isConstant(y)){let A=X.getValueOrDefault(y,e,JAt,ZAt);h.equals(A,d._lastOffset)||(d._lastOffset=h.clone(A,d._lastOffset),d.offset=Tr.toValue(A,d.offset))}}this.updateShows(i),this.waitingOnCreate=!1}else l(i)&&!i.ready&&(t=!1);return this.itemsToRemove.length=n,t};Vm.prototype.updateShows=function(e){let t=this.showsUpdated.values,n=t.length;for(let i=0;i<n;i++){let r=t[i],o=this.geometry.get(r.id),s=this.attributes.get(o.id.id);l(s)||(s=e.getGeometryInstanceAttributes(o.id),this.attributes.set(o.id.id,s));let a=r.entity.isShowing,c=s.show[0]===1;a!==c&&(s.show=Pn.toValue(a,s.show),o.attributes.show.value[0]=s.show[0])}this.showsUpdated.removeAll()};Vm.prototype.contains=function(e){return this.updaters.contains(e.id)};Vm.prototype.getBoundingSphere=function(e,t){let n=this.primitive;if(!n.ready)return Pt.PENDING;let i=n.getGeometryInstanceAttributes(e.entity);return!l(i)||!l(i.boundingSphere)||l(i.show)&&i.show[0]===0?Pt.FAILED:(i.boundingSphere.clone(t),Pt.DONE)};Vm.prototype.destroy=function(){let e=this.primitive,t=this.primitives;l(e)&&t.remove(e);let n=this.oldPrimitive;l(n)&&t.remove(n),l(this.removeMaterialSubscription)&&this.removeMaterialSubscription()};function cI(e,t,n,i,r){this._solidItems=[],this._translucentItems=[],this._primitives=e,this._appearanceType=t,this._depthFailAppearanceType=n,this._closed=i,this._shadows=r}cI.prototype.add=function(e,t){let n,i,r=t.createFillGeometryInstance(e);r.attributes.color.value[3]===255?(n=this._solidItems,i=!1):(n=this._translucentItems,i=!0);let o=n.length;for(let a=0;a<o;a++){let c=n[a];if(c.isMaterial(t)){c.add(t,r);return}}let s=new Vm(this._primitives,i,this._appearanceType,this._depthFailAppearanceType,t.depthFailMaterialProperty,this._closed,this._shadows);s.add(t,r),n.push(s)};function awe(e,t){let n=e.length;for(let i=n-1;i>=0;i--){let r=e[i];if(r.remove(t))return r.updaters.length===0&&(e.splice(i,1),r.destroy()),!0}return!1}cI.prototype.remove=function(e){awe(this._solidItems,e)||awe(this._translucentItems,e)};function cwe(e,t,n){let i=!1,r=t.length;for(let o=0;o<r;++o){let s=t[o],a=s.itemsToRemove,c=a.length;if(c>0)for(o=0;o<c;o++){let u=a[o];s.remove(u),e.add(n,u),i=!0}}return i}function GG(e,t,n,i){let r=t.length,o;for(o=r-1;o>=0;o--){let s=t[o];if(s.invalidated){t.splice(o,1);let a=s.updaters.values,c=a.length;for(let u=0;u<c;u++)e.add(n,a[u]);s.destroy()}}for(r=t.length,o=0;o<r;++o)i=t[o].update(n)&&i;return i}cI.prototype.update=function(e){let t=GG(this,this._solidItems,e,!0);t=GG(this,this._translucentItems,e,t)&&t;let n=cwe(this,this._solidItems,e),i=cwe(this,this._translucentItems,e);return(n||i)&&(t=GG(this,this._solidItems,e,t)&&t,t=GG(this,this._translucentItems,e,t)&&t),t};function lwe(e,t,n){let i=e.length;for(let r=0;r<i;r++){let o=e[r];if(o.contains(t))return o.getBoundingSphere(t,n)}return Pt.FAILED}cI.prototype.getBoundingSphere=function(e,t){let n=lwe(this._solidItems,e,t);return n===Pt.FAILED?lwe(this._translucentItems,e,t):n};function uwe(e){let t=e.length;for(let n=0;n<t;n++)e[n].destroy();e.length=0}cI.prototype.removeAllPrimitives=function(){uwe(this._solidItems),uwe(this._translucentItems)};var hh=cI;var QAt=new Ht,ebt=new Ht,tbt=h.ZERO,nbt=new h;function jm(e,t,n,i,r,o,s){this.primitives=e,this.appearanceType=t,this.materialProperty=n,this.depthFailAppearanceType=i,this.depthFailMaterialProperty=r,this.closed=o,this.shadows=s,this.updaters=new Ut,this.createPrimitive=!0,this.primitive=void 0,this.oldPrimitive=void 0,this.geometry=new Ut,this.material=void 0,this.depthFailMaterial=void 0,this.updatersWithAttributes=new Ut,this.attributes=new Ut,this.invalidated=!1,this.removeMaterialSubscription=n.definitionChanged.addEventListener(jm.prototype.onMaterialChanged,this),this.subscriptions=new Ut,this.showsUpdated=new Ut}jm.prototype.onMaterialChanged=function(){this.invalidated=!0};jm.prototype.isMaterial=function(e){let t=this.materialProperty,n=e.fillMaterialProperty,i=this.depthFailMaterialProperty,r=e.depthFailMaterialProperty;if(n===t&&r===i)return!0;let o=l(t)&&t.equals(n);return o=(!l(i)&&!l(r)||l(i)&&i.equals(r))&&o,o};jm.prototype.add=function(e,t){let n=t.id;if(this.updaters.set(n,t),this.geometry.set(n,t.createFillGeometryInstance(e)),!t.hasConstantFill||!t.fillMaterialProperty.isConstant||!X.isConstant(t.distanceDisplayConditionProperty)||!X.isConstant(t.terrainOffsetProperty))this.updatersWithAttributes.set(n,t);else{let i=this;this.subscriptions.set(n,t.entity.definitionChanged.addEventListener(function(r,o,s,a){o==="isShowing"&&i.showsUpdated.set(t.id,t)}))}this.createPrimitive=!0};jm.prototype.remove=function(e){let t=e.id;if(this.createPrimitive=this.geometry.remove(t)||this.createPrimitive,this.updaters.remove(t)){this.updatersWithAttributes.remove(t);let n=this.subscriptions.get(t);return l(n)&&(n(),this.subscriptions.remove(t),this.showsUpdated.remove(t)),!0}return!1};var ibt=new z;jm.prototype.update=function(e){let t=!0,n=this.primitive,i=this.primitives,r=this.geometry.values,o;if(this.createPrimitive){if(r.length>0){l(n)&&(l(this.oldPrimitive)?i.remove(n):this.oldPrimitive=n),this.material=_o.getValue(e,this.materialProperty,this.material);let a;if(l(this.depthFailMaterialProperty)){this.depthFailMaterial=_o.getValue(e,this.depthFailMaterialProperty,this.depthFailMaterial);let u=this.depthFailAppearanceType;a=new u({material:this.depthFailMaterial,translucent:this.depthFailMaterial.isTranslucent(),closed:this.closed})}let c=this.appearanceType;n=new On({show:!1,asynchronous:!0,geometryInstances:r.slice(),appearance:new c({material:this.material,translucent:this.material.isTranslucent(),closed:this.closed}),depthFailAppearance:a,shadows:this.shadows}),i.add(n),t=!1}else{l(n)&&(i.remove(n),n=void 0);let a=this.oldPrimitive;l(a)&&(i.remove(a),this.oldPrimitive=void 0)}this.attributes.removeAll(),this.primitive=n,this.createPrimitive=!1}else if(l(n)&&n.ready){n.show=!0,l(this.oldPrimitive)&&(i.remove(this.oldPrimitive),this.oldPrimitive=void 0),this.material=_o.getValue(e,this.materialProperty,this.material),this.primitive.appearance.material=this.material,l(this.depthFailAppearanceType)&&!(this.depthFailMaterialProperty instanceof Kt)&&(this.depthFailMaterial=_o.getValue(e,this.depthFailMaterialProperty,this.depthFailMaterial),this.primitive.depthFailAppearance.material=this.depthFailMaterial);let s=this.updatersWithAttributes.values,a=s.length;for(o=0;o<a;o++){let c=s[o],u=c.entity,f=this.geometry.get(c.id),d=this.attributes.get(f.id.id);if(l(d)||(d=n.getGeometryInstanceAttributes(f.id),this.attributes.set(f.id.id,d)),l(this.depthFailAppearanceType)&&this.depthFailMaterialProperty instanceof Kt&&!c.depthFailMaterialProperty.isConstant){let A=c.depthFailMaterialProperty.color,b=X.getValueOrDefault(A,e,z.WHITE,ibt);z.equals(d._lastDepthFailColor,b)||(d._lastDepthFailColor=z.clone(b,d._lastDepthFailColor),d.depthFailColor=Jt.toValue(b,d.depthFailColor))}let p=u.isShowing&&(c.hasConstantFill||c.isFilled(e)),g=d.show[0]===1;p!==g&&(d.show=Pn.toValue(p,d.show));let m=c.distanceDisplayConditionProperty;if(!X.isConstant(m)){let A=X.getValueOrDefault(m,e,ebt,QAt);Ht.equals(A,d._lastDistanceDisplayCondition)||(d._lastDistanceDisplayCondition=Ht.clone(A,d._lastDistanceDisplayCondition),d.distanceDisplayCondition=Qn.toValue(A,d.distanceDisplayCondition))}let y=c.terrainOffsetProperty;if(!X.isConstant(y)){let A=X.getValueOrDefault(y,e,tbt,nbt);h.equals(A,d._lastOffset)||(d._lastOffset=h.clone(A,d._lastOffset),d.offset=Tr.toValue(A,d.offset))}}this.updateShows(n)}else l(n)&&!n.ready&&(t=!1);return t};jm.prototype.updateShows=function(e){let t=this.showsUpdated.values,n=t.length;for(let i=0;i<n;i++){let r=t[i],o=r.entity,s=this.geometry.get(r.id),a=this.attributes.get(s.id.id);l(a)||(a=e.getGeometryInstanceAttributes(s.id),this.attributes.set(s.id.id,a));let c=o.isShowing,u=a.show[0]===1;c!==u&&(a.show=Pn.toValue(c,a.show),s.attributes.show.value[0]=a.show[0])}this.showsUpdated.removeAll()};jm.prototype.contains=function(e){return this.updaters.contains(e.id)};jm.prototype.getBoundingSphere=function(e,t){let n=this.primitive;if(!n.ready)return Pt.PENDING;let i=n.getGeometryInstanceAttributes(e.entity);return!l(i)||!l(i.boundingSphere)||l(i.show)&&i.show[0]===0?Pt.FAILED:(i.boundingSphere.clone(t),Pt.DONE)};jm.prototype.destroy=function(){let e=this.primitive,t=this.primitives;l(e)&&t.remove(e);let n=this.oldPrimitive;l(n)&&t.remove(n),this.removeMaterialSubscription()};function lI(e,t,n,i,r){this._items=[],this._primitives=e,this._appearanceType=t,this._depthFailAppearanceType=n,this._closed=i,this._shadows=r}lI.prototype.add=function(e,t){let n=this._items,i=n.length;for(let o=0;o<i;o++){let s=n[o];if(s.isMaterial(t)){s.add(e,t);return}}let r=new jm(this._primitives,this._appearanceType,t.fillMaterialProperty,this._depthFailAppearanceType,t.depthFailMaterialProperty,this._closed,this._shadows);r.add(e,t),n.push(r)};lI.prototype.remove=function(e){let t=this._items,n=t.length;for(let i=n-1;i>=0;i--){let r=t[i];if(r.remove(e)){r.updaters.length===0&&(t.splice(i,1),r.destroy());break}}};lI.prototype.update=function(e){let t,n=this._items,i=n.length;for(t=i-1;t>=0;t--){let o=n[t];if(o.invalidated){n.splice(t,1);let s=o.updaters.values,a=s.length;for(let c=0;c<a;c++)this.add(e,s[c]);o.destroy()}}let r=!0;for(t=0;t<n.length;t++)r=n[t].update(e)&&r;return r};lI.prototype.getBoundingSphere=function(e,t){let n=this._items,i=n.length;for(let r=0;r<i;r++){let o=n[r];if(o.contains(e))return o.getBoundingSphere(e,t)}return Pt.FAILED};lI.prototype.removeAllPrimitives=function(){let e=this._items,t=e.length;for(let n=0;n<t;n++)e[n].destroy();this._items.length=0};var mh=lI;function WG(e,t,n=0,i=e.length-1,r=rbt){for(;i>n;){if(i-n>600){let c=i-n+1,u=t-n+1,f=Math.log(c),d=.5*Math.exp(2*f/3),p=.5*Math.sqrt(f*d*(c-d)/c)*(u-c/2<0?-1:1),g=Math.max(n,Math.floor(t-u*d/c+p)),m=Math.min(i,Math.floor(t+(c-u)*d/c+p));WG(e,t,g,m,r)}let o=e[t],s=n,a=i;for(x3(e,n,t),r(e[i],o)>0&&x3(e,n,i);s<a;){for(x3(e,s,a),s++,a--;r(e[s],o)<0;)s++;for(;r(e[a],o)>0;)a--}r(e[n],o)===0?x3(e,n,a):(a++,x3(e,a,i)),a<=t&&(n=a+1),t<=a&&(i=a-1)}}function x3(e,t,n){let i=e[t];e[t]=e[n],e[n]=i}function rbt(e,t){return e<t?-1:e>t?1:0}var C3=class{constructor(t=9){this._maxEntries=Math.max(4,t),this._minEntries=Math.max(2,Math.ceil(this._maxEntries*.4)),this.clear()}all(){return this._all(this.data,[])}search(t){let n=this.data,i=[];if(!YG(t,n))return i;let r=this.toBBox,o=[];for(;n;){for(let s=0;s<n.children.length;s++){let a=n.children[s],c=n.leaf?r(a):a;YG(t,c)&&(n.leaf?i.push(a):dte(t,c)?this._all(a,i):o.push(a))}n=o.pop()}return i}collides(t){let n=this.data;if(!YG(t,n))return!1;let i=[];for(;n;){for(let r=0;r<n.children.length;r++){let o=n.children[r],s=n.leaf?this.toBBox(o):o;if(YG(t,s)){if(n.leaf||dte(t,s))return!0;i.push(o)}}n=i.pop()}return!1}load(t){if(!(t&&t.length))return this;if(t.length<this._minEntries){for(let i=0;i<t.length;i++)this.insert(t[i]);return this}let n=this._build(t.slice(),0,t.length-1,0);if(!this.data.children.length)this.data=n;else if(this.data.height===n.height)this._splitRoot(this.data,n);else{if(this.data.height<n.height){let i=this.data;this.data=n,n=i}this._insert(n,this.data.height-n.height-1,!0)}return this}insert(t){return t&&this._insert(t,this.data.height-1),this}clear(){return this.data=fI([]),this}remove(t,n){if(!t)return this;let i=this.data,r=this.toBBox(t),o=[],s=[],a,c,u;for(;i||o.length;){if(i||(i=o.pop(),c=o[o.length-1],a=s.pop(),u=!0),i.leaf){let f=obt(t,i.children,n);if(f!==-1)return i.children.splice(f,1),o.push(i),this._condense(o),this}!u&&!i.leaf&&dte(i,r)?(o.push(i),s.push(a),a=0,c=i,i=i.children[0]):c?(a++,i=c.children[a],u=!1):i=null}return this}toBBox(t){return t}compareMinX(t,n){return t.minX-n.minX}compareMinY(t,n){return t.minY-n.minY}toJSON(){return this.data}fromJSON(t){return this.data=t,this}_all(t,n){let i=[];for(;t;)t.leaf?n.push(...t.children):i.push(...t.children),t=i.pop();return n}_build(t,n,i,r){let o=i-n+1,s=this._maxEntries,a;if(o<=s)return a=fI(t.slice(n,i+1)),uI(a,this.toBBox),a;r||(r=Math.ceil(Math.log(o)/Math.log(s)),s=Math.ceil(o/Math.pow(s,r-1))),a=fI([]),a.leaf=!1,a.height=r;let c=Math.ceil(o/s),u=c*Math.ceil(Math.sqrt(s));fwe(t,n,i,u,this.compareMinX);for(let f=n;f<=i;f+=u){let d=Math.min(f+u-1,i);fwe(t,f,d,c,this.compareMinY);for(let p=f;p<=d;p+=c){let g=Math.min(p+c-1,d);a.children.push(this._build(t,p,g,r-1))}}return uI(a,this.toBBox),a}_chooseSubtree(t,n,i,r){for(;r.push(n),!(n.leaf||r.length-1===i);){let o=1/0,s=1/0,a;for(let c=0;c<n.children.length;c++){let u=n.children[c],f=fte(u),d=cbt(t,u)-f;d<s?(s=d,o=f<o?f:o,a=u):d===s&&f<o&&(o=f,a=u)}n=a||n.children[0]}return n}_insert(t,n,i){let r=i?t:this.toBBox(t),o=[],s=this._chooseSubtree(r,this.data,n,o);for(s.children.push(t),E3(s,r);n>=0&&o[n].children.length>this._maxEntries;)this._split(o,n),n--;this._adjustParentBBoxes(r,o,n)}_split(t,n){let i=t[n],r=i.children.length,o=this._minEntries;this._chooseSplitAxis(i,o,r);let s=this._chooseSplitIndex(i,o,r),a=fI(i.children.splice(s,i.children.length-s));a.height=i.height,a.leaf=i.leaf,uI(i,this.toBBox),uI(a,this.toBBox),n?t[n-1].children.push(a):this._splitRoot(i,a)}_splitRoot(t,n){this.data=fI([t,n]),this.data.height=t.height+1,this.data.leaf=!1,uI(this.data,this.toBBox)}_chooseSplitIndex(t,n,i){let r,o=1/0,s=1/0;for(let a=n;a<=i-n;a++){let c=T3(t,0,a,this.toBBox),u=T3(t,a,i,this.toBBox),f=lbt(c,u),d=fte(c)+fte(u);f<o?(o=f,r=a,s=d<s?d:s):f===o&&d<s&&(s=d,r=a)}return r||i-n}_chooseSplitAxis(t,n,i){let r=t.leaf?this.compareMinX:sbt,o=t.leaf?this.compareMinY:abt,s=this._allDistMargin(t,n,i,r),a=this._allDistMargin(t,n,i,o);s<a&&t.children.sort(r)}_allDistMargin(t,n,i,r){t.children.sort(r);let o=this.toBBox,s=T3(t,0,n,o),a=T3(t,i-n,i,o),c=qG(s)+qG(a);for(let u=n;u<i-n;u++){let f=t.children[u];E3(s,t.leaf?o(f):f),c+=qG(s)}for(let u=i-n-1;u>=n;u--){let f=t.children[u];E3(a,t.leaf?o(f):f),c+=qG(a)}return c}_adjustParentBBoxes(t,n,i){for(let r=i;r>=0;r--)E3(n[r],t)}_condense(t){for(let n=t.length-1,i;n>=0;n--)t[n].children.length===0?n>0?(i=t[n-1].children,i.splice(i.indexOf(t[n]),1)):this.clear():uI(t[n],this.toBBox)}};function obt(e,t,n){if(!n)return t.indexOf(e);for(let i=0;i<t.length;i++)if(n(e,t[i]))return i;return-1}function uI(e,t){T3(e,0,e.children.length,t,e)}function T3(e,t,n,i,r){r||(r=fI(null)),r.minX=1/0,r.minY=1/0,r.maxX=-1/0,r.maxY=-1/0;for(let o=t;o<n;o++){let s=e.children[o];E3(r,e.leaf?i(s):s)}return r}function E3(e,t){return e.minX=Math.min(e.minX,t.minX),e.minY=Math.min(e.minY,t.minY),e.maxX=Math.max(e.maxX,t.maxX),e.maxY=Math.max(e.maxY,t.maxY),e}function sbt(e,t){return e.minX-t.minX}function abt(e,t){return e.minY-t.minY}function fte(e){return(e.maxX-e.minX)*(e.maxY-e.minY)}function qG(e){return e.maxX-e.minX+(e.maxY-e.minY)}function cbt(e,t){return(Math.max(t.maxX,e.maxX)-Math.min(t.minX,e.minX))*(Math.max(t.maxY,e.maxY)-Math.min(t.minY,e.minY))}function lbt(e,t){let n=Math.max(e.minX,t.minX),i=Math.max(e.minY,t.minY),r=Math.min(e.maxX,t.maxX),o=Math.min(e.maxY,t.maxY);return Math.max(0,r-n)*Math.max(0,o-i)}function dte(e,t){return e.minX<=t.minX&&e.minY<=t.minY&&t.maxX<=e.maxX&&t.maxY<=e.maxY}function YG(e,t){return t.minX<=e.maxX&&t.minY<=e.maxY&&t.maxX>=e.minX&&t.maxY>=e.minY}function fI(e){return{children:e,height:1,leaf:!0,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0}}function fwe(e,t,n,i,r){let o=[t,n];for(;o.length;){if(n=o.pop(),t=o.pop(),n-t<=i)continue;let s=t+Math.ceil((n-t)/i/2)*i;WG(e,s,t,n,r),o.push(t,s,s,n)}}function XG(){this._tree=new C3}function bE(){this.minX=0,this.minY=0,this.maxX=0,this.maxY=0,this.id=""}bE.fromRectangleAndId=function(e,t,n){return n.minX=t.west,n.minY=t.south,n.maxX=t.east,n.maxY=t.north,n.id=e,n};XG.prototype.insert=function(e,t){let n=bE.fromRectangleAndId(e,t,new bE);this._tree.insert(n)};function ubt(e,t){return e.id===t.id}var fbt=new bE;XG.prototype.remove=function(e,t){let n=bE.fromRectangleAndId(e,t,fbt);this._tree.remove(n,ubt)};var dbt=new bE;XG.prototype.collides=function(e){let t=bE.fromRectangleAndId("",e,dbt);return this._tree.collides(t)};var xE=XG;var hbt=new z,mbt=new Ht,pbt=new Ht;function k_(e,t,n,i){this.primitives=e,this.zIndex=i,this.classificationType=t,this.color=n,this.createPrimitive=!1,this.waitingOnCreate=!1,this.primitive=void 0,this.oldPrimitive=void 0,this.geometry=new Ut,this.updaters=new Ut,this.updatersWithAttributes=new Ut,this.attributes=new Ut,this.subscriptions=new Ut,this.showsUpdated=new Ut,this.itemsToRemove=[],this.isDirty=!1,this.rectangleCollisionCheck=new xE}k_.prototype.overlapping=function(e){return this.rectangleCollisionCheck.collides(e)};k_.prototype.add=function(e,t){let n=e.id;if(this.createPrimitive=!0,this.geometry.set(n,t),this.updaters.set(n,e),this.rectangleCollisionCheck.insert(n,t.geometry.rectangle),!e.hasConstantFill||!e.fillMaterialProperty.isConstant||!X.isConstant(e.distanceDisplayConditionProperty))this.updatersWithAttributes.set(n,e);else{let i=this;this.subscriptions.set(n,e.entity.definitionChanged.addEventListener(function(r,o,s,a){o==="isShowing"&&i.showsUpdated.set(e.id,e)}))}};k_.prototype.remove=function(e){let t=e.id,n=this.geometry.get(t);if(this.createPrimitive=this.geometry.remove(t)||this.createPrimitive,this.updaters.remove(t)){this.rectangleCollisionCheck.remove(t,n.geometry.rectangle),this.updatersWithAttributes.remove(t);let i=this.subscriptions.get(t);return l(i)&&(i(),this.subscriptions.remove(t),this.showsUpdated.remove(t)),!0}return!1};k_.prototype.update=function(e){let t=!0,n=0,i=this.primitive,r=this.primitives,o;if(this.createPrimitive){let s=this.geometry.values;if(s.length>0)l(i)&&(l(this.oldPrimitive)?r.remove(i):this.oldPrimitive=i),i=new ql({show:!1,asynchronous:!0,geometryInstances:s.slice(),classificationType:this.classificationType}),r.add(i,this.zIndex),t=!1;else{l(i)&&(r.remove(i),i=void 0);let c=this.oldPrimitive;l(c)&&(r.remove(c),this.oldPrimitive=void 0)}this.attributes.removeAll(),this.primitive=i,this.createPrimitive=!1,this.waitingOnCreate=!0}else if(l(i)&&i.ready){i.show=!0,l(this.oldPrimitive)&&(r.remove(this.oldPrimitive),this.oldPrimitive=void 0);let s=this.updatersWithAttributes.values,a=s.length,c=this.waitingOnCreate;for(o=0;o<a;o++){let u=s[o],f=this.geometry.get(u.id),d=this.attributes.get(f.id.id);if(l(d)||(d=i.getGeometryInstanceAttributes(f.id),this.attributes.set(f.id.id,d)),!u.fillMaterialProperty.isConstant||c){let y=u.fillMaterialProperty.color,A=X.getValueOrDefault(y,e,z.WHITE,hbt);z.equals(d._lastColor,A)||(d._lastColor=z.clone(A,d._lastColor),d.color=Jt.toValue(A,d.color))}let p=u.entity.isShowing&&(u.hasConstantFill||u.isFilled(e)),g=d.show[0]===1;p!==g&&(d.show=Pn.toValue(p,d.show));let m=u.distanceDisplayConditionProperty;if(!X.isConstant(m)){let y=X.getValueOrDefault(m,e,pbt,mbt);Ht.equals(y,d._lastDistanceDisplayCondition)||(d._lastDistanceDisplayCondition=Ht.clone(y,d._lastDistanceDisplayCondition),d.distanceDisplayCondition=Qn.toValue(y,d.distanceDisplayCondition))}}this.updateShows(i),this.waitingOnCreate=!1}else l(i)&&!i.ready&&(t=!1);return this.itemsToRemove.length=n,t};k_.prototype.updateShows=function(e){let t=this.showsUpdated.values,n=t.length;for(let i=0;i<n;i++){let r=t[i],o=this.geometry.get(r.id),s=this.attributes.get(o.id.id);l(s)||(s=e.getGeometryInstanceAttributes(o.id),this.attributes.set(o.id.id,s));let a=r.entity.isShowing,c=s.show[0]===1;a!==c&&(s.show=Pn.toValue(a,s.show),o.attributes.show.value[0]=s.show[0])}this.showsUpdated.removeAll()};k_.prototype.contains=function(e){return this.updaters.contains(e.id)};k_.prototype.getBoundingSphere=function(e,t){let n=this.primitive;if(!n.ready)return Pt.PENDING;let i=n.getBoundingSphere(e.entity);return l(i)?(i.clone(t),Pt.DONE):Pt.FAILED};k_.prototype.removeAllPrimitives=function(){let e=this.primitives,t=this.primitive;l(t)&&(e.remove(t),this.primitive=void 0,this.geometry.removeAll(),this.updaters.removeAll());let n=this.oldPrimitive;l(n)&&(e.remove(n),this.oldPrimitive=void 0)};function dI(e,t){this._batches=[],this._primitives=e,this._classificationType=t}dI.prototype.add=function(e,t){let n=t.createFillGeometryInstance(e),i=this._batches,r=X.getValueOrDefault(t.zIndex,0),o,s=i.length;for(let a=0;a<s;++a){let c=i[a];if(c.zIndex===r&&!c.overlapping(n.geometry.rectangle)){o=c;break}}return l(o)||(o=new k_(this._primitives,this._classificationType,n.attributes.color.value,r),i.push(o)),o.add(t,n),o};dI.prototype.remove=function(e){let t=this._batches,n=t.length;for(let i=0;i<n;++i)if(t[i].remove(e))return};dI.prototype.update=function(e){let t,n,i=!0,r=this._batches,o=r.length;for(t=0;t<o;++t)i=r[t].update(e)&&i;for(t=0;t<o;++t){let s=r[t],a=s.itemsToRemove,c=a.length;for(let u=0;u<c;u++){n=a[u],s.remove(n);let f=this.add(e,n);s.isDirty=!0,f.isDirty=!0}}for(t=o-1;t>=0;--t){let s=r[t];s.isDirty&&(i=r[t].update(e)&&i,s.isDirty=!1),s.geometry.length===0&&r.splice(t,1)}return i};dI.prototype.getBoundingSphere=function(e,t){let n=this._batches,i=n.length;for(let r=0;r<i;++r){let o=n[r];if(o.contains(e))return o.getBoundingSphere(e,t)}return Pt.FAILED};dI.prototype.removeAllPrimitives=function(){let e=this._batches,t=e.length;for(let n=0;n<t;++n)e[n].removeAllPrimitives()};var hI=dI;var gbt=new Ht,_bt=new Ht;function h0(e,t,n,i,r,o){this.primitives=e,this.classificationType=t,this.appearanceType=n,this.materialProperty=i,this.updaters=new Ut,this.createPrimitive=!0,this.primitive=void 0,this.oldPrimitive=void 0,this.geometry=new Ut,this.material=void 0,this.updatersWithAttributes=new Ut,this.attributes=new Ut,this.subscriptions=new Ut,this.showsUpdated=new Ut,this.usingSphericalTextureCoordinates=r,this.zIndex=o,this.rectangleCollisionCheck=new xE}h0.prototype.overlapping=function(e){return this.rectangleCollisionCheck.collides(e)};h0.prototype.isMaterial=function(e){let t=this.materialProperty,n=e.fillMaterialProperty;return n===t||n instanceof Kt&&t instanceof Kt?!0:l(t)&&t.equals(n)};h0.prototype.add=function(e,t,n){let i=t.id;if(this.updaters.set(i,t),this.geometry.set(i,n),this.rectangleCollisionCheck.insert(i,n.geometry.rectangle),!t.hasConstantFill||!t.fillMaterialProperty.isConstant||!X.isConstant(t.distanceDisplayConditionProperty))this.updatersWithAttributes.set(i,t);else{let r=this;this.subscriptions.set(i,t.entity.definitionChanged.addEventListener(function(o,s,a,c){s==="isShowing"&&r.showsUpdated.set(t.id,t)}))}this.createPrimitive=!0};h0.prototype.remove=function(e){let t=e.id,n=this.geometry.get(t);if(this.createPrimitive=this.geometry.remove(t)||this.createPrimitive,this.updaters.remove(t)){this.rectangleCollisionCheck.remove(t,n.geometry.rectangle),this.updatersWithAttributes.remove(t);let i=this.subscriptions.get(t);return l(i)&&(i(),this.subscriptions.remove(t),this.showsUpdated.remove(t)),!0}return!1};h0.prototype.update=function(e){let t=!0,n=this.primitive,i=this.primitives,r=this.geometry.values,o;if(this.createPrimitive){if(r.length>0){l(n)&&(l(this.oldPrimitive)?i.remove(n):this.oldPrimitive=n),this.material=_o.getValue(e,this.materialProperty,this.material);let a=this.appearanceType;n=new ql({show:!1,asynchronous:!0,geometryInstances:r.slice(),appearance:new a({material:this.material}),classificationType:this.classificationType}),i.add(n,this.zIndex),t=!1}else{l(n)&&(i.remove(n),n=void 0);let a=this.oldPrimitive;l(a)&&(i.remove(a),this.oldPrimitive=void 0)}this.attributes.removeAll(),this.primitive=n,this.createPrimitive=!1}else if(l(n)&&n.ready){n.show=!0,l(this.oldPrimitive)&&(i.remove(this.oldPrimitive),this.oldPrimitive=void 0),this.material=_o.getValue(e,this.materialProperty,this.material),this.primitive.appearance.material=this.material;let s=this.updatersWithAttributes.values,a=s.length;for(o=0;o<a;o++){let c=s[o],u=c.entity,f=this.geometry.get(c.id),d=this.attributes.get(f.id.id);l(d)||(d=n.getGeometryInstanceAttributes(f.id),this.attributes.set(f.id.id,d));let p=u.isShowing&&(c.hasConstantFill||c.isFilled(e)),g=d.show[0]===1;p!==g&&(d.show=Pn.toValue(p,d.show));let m=c.distanceDisplayConditionProperty;if(!X.isConstant(m)){let y=X.getValueOrDefault(m,e,_bt,gbt);Ht.equals(y,d._lastDistanceDisplayCondition)||(d._lastDistanceDisplayCondition=Ht.clone(y,d._lastDistanceDisplayCondition),d.distanceDisplayCondition=Qn.toValue(y,d.distanceDisplayCondition))}}this.updateShows(n)}else l(n)&&!n.ready&&(t=!1);return t};h0.prototype.updateShows=function(e){let t=this.showsUpdated.values,n=t.length;for(let i=0;i<n;i++){let r=t[i],o=r.entity,s=this.geometry.get(r.id),a=this.attributes.get(s.id.id);l(a)||(a=e.getGeometryInstanceAttributes(s.id),this.attributes.set(s.id.id,a));let c=o.isShowing,u=a.show[0]===1;c!==u&&(a.show=Pn.toValue(c,a.show),s.attributes.show.value[0]=a.show[0])}this.showsUpdated.removeAll()};h0.prototype.contains=function(e){return this.updaters.contains(e.id)};h0.prototype.getBoundingSphere=function(e,t){let n=this.primitive;if(!n.ready)return Pt.PENDING;let i=n.getGeometryInstanceAttributes(e.entity);return!l(i)||!l(i.boundingSphere)||l(i.show)&&i.show[0]===0?Pt.FAILED:(i.boundingSphere.clone(t),Pt.DONE)};h0.prototype.destroy=function(){let e=this.primitive,t=this.primitives;l(e)&&t.remove(e);let n=this.oldPrimitive;l(n)&&t.remove(n)};function mI(e,t,n){this._items=[],this._primitives=e,this._classificationType=t,this._appearanceType=n}mI.prototype.add=function(e,t){let n=this._items,i=n.length,r=t.createFillGeometryInstance(e),o=Pf.shouldUseSphericalCoordinates(r.geometry.rectangle),s=X.getValueOrDefault(t.zIndex,0);for(let c=0;c<i;++c){let u=n[c];if(u.isMaterial(t)&&u.usingSphericalTextureCoordinates===o&&u.zIndex===s&&!u.overlapping(r.geometry.rectangle)){u.add(e,t,r);return}}let a=new h0(this._primitives,this._classificationType,this._appearanceType,t.fillMaterialProperty,o,s);a.add(e,t,r),n.push(a)};mI.prototype.remove=function(e){let t=this._items,n=t.length;for(let i=n-1;i>=0&&!t[i].remove(e);i--);};mI.prototype.update=function(e){let t,n=this._items,i=n.length;for(t=i-1;t>=0;t--){let o=n[t];o.updaters.length===0&&(n.splice(t,1),o.destroy())}let r=!0;for(t=0;t<n.length;t++)r=n[t].update(e)&&r;return r};mI.prototype.getBoundingSphere=function(e,t){let n=this._items,i=n.length;for(let r=0;r<i;r++){let o=n[r];if(o.contains(e))return o.getBoundingSphere(e,t)}return Pt.FAILED};mI.prototype.removeAllPrimitives=function(){let e=this._items,t=e.length;for(let n=0;n<t;n++)e[n].destroy();this._items.length=0};var v3=mI;var ybt=new z,Abt=new Ht,bbt=new Ht,xbt=h.ZERO,Tbt=new h;function U_(e,t,n,i){this.translucent=t,this.width=n,this.shadows=i,this.primitives=e,this.createPrimitive=!1,this.waitingOnCreate=!1,this.primitive=void 0,this.oldPrimitive=void 0,this.geometry=new Ut,this.updaters=new Ut,this.updatersWithAttributes=new Ut,this.attributes=new Ut,this.itemsToRemove=[],this.subscriptions=new Ut,this.showsUpdated=new Ut}U_.prototype.add=function(e,t){let n=e.id;if(this.createPrimitive=!0,this.geometry.set(n,t),this.updaters.set(n,e),!e.hasConstantOutline||!e.outlineColorProperty.isConstant||!X.isConstant(e.distanceDisplayConditionProperty)||!X.isConstant(e.terrainOffsetProperty))this.updatersWithAttributes.set(n,e);else{let i=this;this.subscriptions.set(n,e.entity.definitionChanged.addEventListener(function(r,o,s,a){o==="isShowing"&&i.showsUpdated.set(e.id,e)}))}};U_.prototype.remove=function(e){let t=e.id;if(this.createPrimitive=this.geometry.remove(t)||this.createPrimitive,this.updaters.remove(t)){this.updatersWithAttributes.remove(t);let n=this.subscriptions.get(t);return l(n)&&(n(),this.subscriptions.remove(t),this.showsUpdated.remove(t)),!0}return!1};U_.prototype.update=function(e){let t=!0,n=0,i=this.primitive,r=this.primitives,o;if(this.createPrimitive){let s=this.geometry.values;if(s.length>0)l(i)&&(l(this.oldPrimitive)?r.remove(i):this.oldPrimitive=i),i=new On({show:!1,asynchronous:!0,geometryInstances:s.slice(),appearance:new yn({flat:!0,translucent:this.translucent,renderState:{lineWidth:this.width}}),shadows:this.shadows}),r.add(i),t=!1;else{l(i)&&(r.remove(i),i=void 0);let c=this.oldPrimitive;l(c)&&(r.remove(c),this.oldPrimitive=void 0)}this.attributes.removeAll(),this.primitive=i,this.createPrimitive=!1,this.waitingOnCreate=!0}else if(l(i)&&i.ready){i.show=!0,l(this.oldPrimitive)&&(r.remove(this.oldPrimitive),this.oldPrimitive=void 0);let s=this.updatersWithAttributes.values,a=s.length,c=this.waitingOnCreate;for(o=0;o<a;o++){let u=s[o],f=this.geometry.get(u.id),d=this.attributes.get(f.id.id);if(l(d)||(d=i.getGeometryInstanceAttributes(f.id),this.attributes.set(f.id.id,d)),!u.outlineColorProperty.isConstant||c){let A=u.outlineColorProperty,b=X.getValueOrDefault(A,e,z.WHITE,ybt);z.equals(d._lastColor,b)||(d._lastColor=z.clone(b,d._lastColor),d.color=Jt.toValue(b,d.color),(this.translucent&&d.color[3]===255||!this.translucent&&d.color[3]!==255)&&(this.itemsToRemove[n++]=u))}let p=u.entity.isShowing&&(u.hasConstantOutline||u.isOutlineVisible(e)),g=d.show[0]===1;p!==g&&(d.show=Pn.toValue(p,d.show));let m=u.distanceDisplayConditionProperty;if(!X.isConstant(m)){let A=X.getValueOrDefault(m,e,bbt,Abt);Ht.equals(A,d._lastDistanceDisplayCondition)||(d._lastDistanceDisplayCondition=Ht.clone(A,d._lastDistanceDisplayCondition),d.distanceDisplayCondition=Qn.toValue(A,d.distanceDisplayCondition))}let y=u.terrainOffsetProperty;if(!X.isConstant(y)){let A=X.getValueOrDefault(y,e,xbt,Tbt);h.equals(A,d._lastOffset)||(d._lastOffset=h.clone(A,d._lastOffset),d.offset=Tr.toValue(A,d.offset))}}this.updateShows(i),this.waitingOnCreate=!1}else l(i)&&!i.ready&&(t=!1);return this.itemsToRemove.length=n,t};U_.prototype.updateShows=function(e){let t=this.showsUpdated.values,n=t.length;for(let i=0;i<n;i++){let r=t[i],o=this.geometry.get(r.id),s=this.attributes.get(o.id.id);l(s)||(s=e.getGeometryInstanceAttributes(o.id),this.attributes.set(o.id.id,s));let a=r.entity.isShowing,c=s.show[0]===1;a!==c&&(s.show=Pn.toValue(a,s.show),o.attributes.show.value[0]=s.show[0])}this.showsUpdated.removeAll()};U_.prototype.contains=function(e){return this.updaters.contains(e.id)};U_.prototype.getBoundingSphere=function(e,t){let n=this.primitive;if(!n.ready)return Pt.PENDING;let i=n.getGeometryInstanceAttributes(e.entity);return!l(i)||!l(i.boundingSphere)||l(i.show)&&i.show[0]===0?Pt.FAILED:(i.boundingSphere.clone(t),Pt.DONE)};U_.prototype.removeAllPrimitives=function(){let e=this.primitives,t=this.primitive;l(t)&&(e.remove(t),this.primitive=void 0,this.geometry.removeAll(),this.updaters.removeAll());let n=this.oldPrimitive;l(n)&&(e.remove(n),this.oldPrimitive=void 0)};function pI(e,t,n){this._primitives=e,this._scene=t,this._shadows=n,this._solidBatches=new Ut,this._translucentBatches=new Ut}pI.prototype.add=function(e,t){let n=t.createOutlineGeometryInstance(e),i=this._scene.clampLineWidth(t.outlineWidth),r,o;n.attributes.color.value[3]===255?(r=this._solidBatches,o=r.get(i),l(o)||(o=new U_(this._primitives,!1,i,this._shadows),r.set(i,o)),o.add(t,n)):(r=this._translucentBatches,o=r.get(i),l(o)||(o=new U_(this._primitives,!0,i,this._shadows),r.set(i,o)),o.add(t,n))};pI.prototype.remove=function(e){let t,n=this._solidBatches.values,i=n.length;for(t=0;t<i;t++)if(n[t].remove(e))return;let r=this._translucentBatches.values,o=r.length;for(t=0;t<o;t++)if(r[t].remove(e))return};pI.prototype.update=function(e){let t,n,i,r,o=this._solidBatches.values,s=o.length,a=this._translucentBatches.values,c=a.length,u,f=!0,d;do{for(d=!1,n=0;n<s;n++){r=o[n],f=r.update(e),u=r.itemsToRemove;let p=u.length;if(p>0)for(d=!0,t=0;t<p;t++)i=u[t],r.remove(i),this.add(e,i)}for(n=0;n<c;n++){r=a[n],f=r.update(e),u=r.itemsToRemove;let p=u.length;if(p>0)for(d=!0,t=0;t<p;t++)i=u[t],r.remove(i),this.add(e,i)}}while(d);return f};pI.prototype.getBoundingSphere=function(e,t){let n,i=this._solidBatches.values,r=i.length;for(n=0;n<r;n++){let a=i[n];if(a.contains(e))return a.getBoundingSphere(e,t)}let o=this._translucentBatches.values,s=o.length;for(n=0;n<s;n++){let a=o[n];if(a.contains(e))return a.getBoundingSphere(e,t)}return Pt.FAILED};pI.prototype.removeAllPrimitives=function(){let e,t=this._solidBatches.values,n=t.length;for(e=0;e<n;e++)t[e].removeAllPrimitives();let i=this._translucentBatches.values,r=i.length;for(e=0;e<r;e++)i[e].removeAllPrimitives()};var gI=pI;var Ebt=[];function tf(e,t,n,i){n=n??e.primitives,i=i??e.groundPrimitives,this._scene=e,this._primitives=n,this._groundPrimitives=i,this._entityCollection=void 0,this._addedObjects=new Ut,this._removedObjects=new Ut,this._changedObjects=new Ut;let r=Dn.NUMBER_OF_SHADOW_MODES;this._outlineBatches=new Array(r*2),this._closedColorBatches=new Array(r*2),this._closedMaterialBatches=new Array(r*2),this._openColorBatches=new Array(r*2),this._openMaterialBatches=new Array(r*2);let o=Jr.supportsMaterialsforEntitiesOnTerrain(e);this._supportsMaterialsforEntitiesOnTerrain=o;let s;for(s=0;s<r;++s)this._outlineBatches[s]=new gI(n,e,s,!1),this._outlineBatches[r+s]=new gI(n,e,s,!0),this._closedColorBatches[s]=new hh(n,yn,void 0,!0,s,!0),this._closedColorBatches[r+s]=new hh(n,yn,void 0,!0,s,!1),this._closedMaterialBatches[s]=new mh(n,Er,void 0,!0,s,!0),this._closedMaterialBatches[r+s]=new mh(n,Er,void 0,!0,s,!1),this._openColorBatches[s]=new hh(n,yn,void 0,!1,s,!0),this._openColorBatches[r+s]=new hh(n,yn,void 0,!1,s,!1),this._openMaterialBatches[s]=new mh(n,Er,void 0,!1,s,!0),this._openMaterialBatches[r+s]=new mh(n,Er,void 0,!1,s,!1);let a=ei.NUMBER_OF_CLASSIFICATION_TYPES,c=new Array(a),u=[];if(o)for(s=0;s<a;++s)u.push(new v3(i,s,Er)),c[s]=new hI(i,s);else for(s=0;s<a;++s)c[s]=new hI(i,s);this._groundColorBatches=c,this._groundMaterialBatches=u,this._dynamicBatch=new cE(n,i),this._batches=this._outlineBatches.concat(this._closedColorBatches,this._closedMaterialBatches,this._openColorBatches,this._openMaterialBatches,this._groundColorBatches,this._groundMaterialBatches,this._dynamicBatch),this._subscriptions=new Ut,this._updaterSets=new Ut,this._entityCollection=t,t.collectionChanged.addEventListener(tf.prototype._onCollectionChanged,this),this._onCollectionChanged(t,t.values,Ebt)}tf.registerUpdater=function(e){AE.registerUpdater(e)};tf.unregisterUpdater=function(e){AE.unregisterUpdater(e)};tf.prototype.update=function(e){let t=this._addedObjects,n=t.values,i=this._removedObjects,r=i.values,o=this._changedObjects,s=o.values,a,c,u,f,d=this;for(a=s.length-1;a>-1;a--)c=s[a],u=c.id,f=this._updaterSets.get(u),f.entity===c?f.forEach(function(y){d._removeUpdater(y),d._insertUpdaterIntoBatch(e,y)}):(r.push(c),n.push(c));for(a=r.length-1;a>-1;a--)c=r[a],u=c.id,f=this._updaterSets.get(u),f.forEach(this._removeUpdater.bind(this)),f.destroy(),this._updaterSets.remove(u),this._subscriptions.get(u)(),this._subscriptions.remove(u);for(a=n.length-1;a>-1;a--)c=n[a],u=c.id,f=new AE(c,this._scene),this._updaterSets.set(u,f),f.forEach(function(y){d._insertUpdaterIntoBatch(e,y)}),this._subscriptions.set(u,f.geometryChanged.addEventListener(tf._onGeometryChanged,this));t.removeAll(),i.removeAll(),o.removeAll();let p=!0,g=this._batches,m=g.length;for(a=0;a<m;a++)p=g[a].update(e)&&p;return p};var Cbt=[],vbt=new ue;tf.prototype.getBoundingSphere=function(e,t){let n=Cbt,i=vbt,r=0,o,s=this._batches,a=s.length,c=e.id,u=this._updaterSets.get(c).updaters;for(let f=0;f<u.length;f++){let d=u[f];for(let p=0;p<a;p++){if(o=s[p].getBoundingSphere(d,i),o===Pt.PENDING)return Pt.PENDING;o===Pt.DONE&&(n[r]=ue.clone(i,n[r]),r++)}}return r===0?Pt.FAILED:(n.length=r,ue.fromBoundingSpheres(n,t),Pt.DONE)};tf.prototype.isDestroyed=function(){return!1};tf.prototype.destroy=function(){this._entityCollection.collectionChanged.removeEventListener(tf.prototype._onCollectionChanged,this),this._addedObjects.removeAll(),this._removedObjects.removeAll();let e,t=this._batches,n=t.length;for(e=0;e<n;e++)t[e].removeAllPrimitives();let i=this._subscriptions.values;for(n=i.length,e=0;e<n;e++)i[e]();this._subscriptions.removeAll();let r=this._updaterSets.values;for(n=r.length,e=0;e<n;e++)r[e].destroy();return this._updaterSets.removeAll(),le(this)};tf.prototype._removeUpdater=function(e){let t=this._batches,n=t.length;for(let i=0;i<n;i++)t[i].remove(e)};tf.prototype._insertUpdaterIntoBatch=function(e,t){if(t.isDynamic){this._dynamicBatch.add(e,t);return}let n;(t.outlineEnabled||t.fillEnabled)&&(n=t.shadowsProperty.getValue(e));let i=Dn.NUMBER_OF_SHADOW_MODES;if(t.outlineEnabled&&(l(t.terrainOffsetProperty)?this._outlineBatches[i+n].add(e,t):this._outlineBatches[n].add(e,t)),t.fillEnabled)if(t.onTerrain){let r=t.classificationTypeProperty.getValue(e);t.fillMaterialProperty instanceof Kt?this._groundColorBatches[r].add(e,t):this._groundMaterialBatches[r].add(e,t)}else t.isClosed?t.fillMaterialProperty instanceof Kt?l(t.terrainOffsetProperty)?this._closedColorBatches[i+n].add(e,t):this._closedColorBatches[n].add(e,t):l(t.terrainOffsetProperty)?this._closedMaterialBatches[i+n].add(e,t):this._closedMaterialBatches[n].add(e,t):t.fillMaterialProperty instanceof Kt?l(t.terrainOffsetProperty)?this._openColorBatches[i+n].add(e,t):this._openColorBatches[n].add(e,t):l(t.terrainOffsetProperty)?this._openMaterialBatches[i+n].add(e,t):this._openMaterialBatches[n].add(e,t)};tf._onGeometryChanged=function(e){let t=this._removedObjects,n=this._changedObjects,i=e.entity,r=i.id;!l(t.get(r))&&!l(n.get(r))&&n.set(r,i)};tf.prototype._onCollectionChanged=function(e,t,n){let i=this._addedObjects,r=this._removedObjects,o=this._changedObjects,s,a,c;for(s=n.length-1;s>-1;s--)c=n[s],a=c.id,i.remove(a)||(r.set(a,c),o.remove(a));for(s=t.length-1;s>-1;s--)c=t[s],a=c.id,r.remove(a)?o.set(a,c):i.set(a,c)};var S3=tf;var Sbt=1,wbt="30px sans-serif",Ibt=Ao.FILL,Pbt=z.WHITE,Dbt=z.BLACK,Rbt=1,Obt=!1,Mbt=new z(.165,.165,.165,.8),Nbt=new U(7,5),Lbt=U.ZERO,Fbt=h.ZERO,Bbt=We.NONE,kbt=zi.CENTER,Ubt=Gn.CENTER,zbt=new h,Vbt=new z,jbt=new z,Hbt=new z,Gbt=new U,Wbt=new h,qbt=new U,Ybt=new qt,Xbt=new qt,Kbt=new qt,$bt=new Ht;function dwe(e){this.entity=e,this.label=void 0,this.index=void 0}function ib(e,t){t.collectionChanged.addEventListener(ib.prototype._onCollectionChanged,this),this._cluster=e,this._entityCollection=t,this._items=new Ut,this._onCollectionChanged(t,t.values,[],[])}ib.prototype.update=function(e){let t=this._items.values,n=this._cluster;for(let i=0,r=t.length;i<r;i++){let o=t[i],s=o.entity,a=s._label,c,u=o.label,f=s.isShowing&&s.isAvailable(e)&&X.getValueOrDefault(a._show,e,!0),d;if(f&&(d=X.getValueOrUndefined(s._position,e,zbt),c=X.getValueOrUndefined(a._text,e),f=l(d)&&l(c)),!f){hte(o,s,n);continue}X.isConstant(s._position)||(n._clusterDirty=!0);let p=!1,g=X.getValueOrDefault(a._heightReference,e,Bbt);l(u)||(u=n.getLabel(s),u.id=s,o.label=u,p=h.equals(u.position,d)&&u.heightReference===g),u.show=!0,u.position=d,u.text=c,u.scale=X.getValueOrDefault(a._scale,e,Sbt),u.font=X.getValueOrDefault(a._font,e,wbt),u.style=X.getValueOrDefault(a._style,e,Ibt),u.fillColor=X.getValueOrDefault(a._fillColor,e,Pbt,Vbt),u.outlineColor=X.getValueOrDefault(a._outlineColor,e,Dbt,jbt),u.outlineWidth=X.getValueOrDefault(a._outlineWidth,e,Rbt),u.showBackground=X.getValueOrDefault(a._showBackground,e,Obt),u.backgroundColor=X.getValueOrDefault(a._backgroundColor,e,Mbt,Hbt),u.backgroundPadding=X.getValueOrDefault(a._backgroundPadding,e,Nbt,Gbt),u.pixelOffset=X.getValueOrDefault(a._pixelOffset,e,Lbt,qbt),u.eyeOffset=X.getValueOrDefault(a._eyeOffset,e,Fbt,Wbt),u.heightReference=g,u.horizontalOrigin=X.getValueOrDefault(a._horizontalOrigin,e,kbt),u.verticalOrigin=X.getValueOrDefault(a._verticalOrigin,e,Ubt),u.translucencyByDistance=X.getValueOrUndefined(a._translucencyByDistance,e,Ybt),u.pixelOffsetScaleByDistance=X.getValueOrUndefined(a._pixelOffsetScaleByDistance,e,Xbt),u.scaleByDistance=X.getValueOrUndefined(a._scaleByDistance,e,Kbt),u.distanceDisplayCondition=X.getValueOrUndefined(a._distanceDisplayCondition,e,$bt),u.disableDepthTestDistance=X.getValueOrUndefined(a._disableDepthTestDistance,e),p&&u._updateClamping()}return!0};ib.prototype.getBoundingSphere=function(e,t){let n=this._items.get(e.id);if(!l(n)||!l(n.label))return Pt.FAILED;let i=n.label;if(i.heightReference===We.NONE)t.center=h.clone(i.position,t.center);else if(i._clampedToSurface)t.center=h.clone(i._clampedPosition,t.center);else{let r=this._cluster._scene,o=this._items,s=Kh(r,n,i.position,[i],()=>o.get(e.id)===n);if(s===void 0)return Pt.PENDING;s===null?t.center=h.clone(i.position,t.center):t.center=gg(i.position,s,i.heightReference,r.ellipsoid??ee.default,t.center)}return t.radius=0,Pt.DONE};ib.prototype.isDestroyed=function(){return!1};ib.prototype.destroy=function(){this._entityCollection.collectionChanged.removeEventListener(ib.prototype._onCollectionChanged,this);let e=this._entityCollection.values;for(let t=0;t<e.length;t++)this._cluster.removeLabel(e[t]);return le(this)};ib.prototype._onCollectionChanged=function(e,t,n,i){let r,o,s=this._items,a=this._cluster;for(r=t.length-1;r>-1;r--)o=t[r],l(o._label)&&l(o._position)&&s.set(o.id,new dwe(o));for(r=i.length-1;r>-1;r--)o=i[r],l(o._label)&&l(o._position)?s.contains(o.id)||s.set(o.id,new dwe(o)):(hte(s.get(o.id),o,a),s.remove(o.id));for(r=n.length-1;r>-1;r--)o=n[r],hte(s.get(o.id),o,a),s.remove(o.id)};function hte(e,t,n){l(e)&&(e.label=void 0,n.removeLabel(t))}var w3=ib;var Jbt=1,Zbt=!0,Qbt=0,ext=!0,txt=!0,nxt=Dn.ENABLED,ixt=We.NONE,rxt=z.RED,oxt=0,sxt=z.WHITE,axt=ll.HIGHLIGHT,cxt=.5,lxt=new U(1,1),hwe={maximumPositionEpsilon:Number.POSITIVE_INFINITY},uxt=new N,fxt=new N,mwe=new z,pwe=new Array(4),dxt=new h;function rb(e,t){t.collectionChanged.addEventListener(rb.prototype._onCollectionChanged,this),this._scene=e,this._primitives=e.primitives,this._entityCollection=t,this._modelHash={},this._entitiesToVisualize=new Ut,this._onCollectionChanged(t,t.values,[],[])}function hxt(e,t){return e instanceof ui?e.valueOf():X.getValueOrUndefined(e,t)}function mxt(e,t){return t!==e.uri?!1:t instanceof De?t._url===e.uriUrl&&t._queryParameters===e.uriQueryParameters&&t._templateValues===e.uriTemplateValues:!0}function gwe(e,t){e.uri=t,t instanceof De&&(e.uriUrl=t._url,e.uriQueryParameters=t._queryParameters,e.uriTemplateValues=t._templateValues)}function pxt(e,t){if(!l(t))return N.clone(e);for(let n=0;n<16;n++)t[n]=e[n];return t}async function gxt(e,t,n,i,r){let o=e._primitives,s=e._modelHash;try{let a=await Hf.fromGltfAsync({url:n,incrementallyLoadTextures:i,scene:e._scene,environmentMapOptions:r});if(e.isDestroyed()||!l(s[t.id]))return;a.id=t,o.add(a),s[t.id].modelPrimitive=a,a.errorEvent.addEventListener(c=>{l(s[t.id])&&(console.log(c),c.name!=="TextureError"&&a.incrementallyLoadTextures&&(s[t.id].loadFailed=!0))})}catch(a){if(e.isDestroyed()||!l(s[t.id]))return;console.log(a),s[t.id].loadFailed=!0}}rb.prototype.update=function(e){let t=this._entitiesToVisualize.values,n=this._modelHash,i=this._primitives;for(let r=0,o=t.length;r<o;r++){let s=t[r],a=s._model,c,u=n[s.id],f=s.isShowing&&s.isAvailable(e)&&X.getValueOrDefault(a._show,e,!0),d,p;if(f&&(d=s.computeModelMatrix(e,uxt),p=hxt(a._uri,e),f=l(d)&&l(p)),!f){l(u)&&u.modelPrimitive&&(u.modelPrimitive.show=!1);continue}if((!l(u)||!mxt(u,p))&&(c=De.createIfNeeded(p),l(u)&&c.url===u.url&&(gwe(u,p),c=void 0)),l(c)){l(u?.modelPrimitive)&&(i.removeAndDestroy(u.modelPrimitive),delete n[s.id]),u={modelPrimitive:void 0,url:c.url,uri:void 0,uriUrl:void 0,uriQueryParameters:void 0,uriTemplateValues:void 0,animationsRunning:!1,nodeTransformationsScratch:{},articulationsScratch:{},loadFailed:!1,modelUpdated:!1,environmentMapOptionsScratch:{...hwe}},n[s.id]=u,gwe(u,p);let y=X.getValueOrDefault(a._incrementallyLoadTextures,e,ext),A=X.getValueOrDefault(a._environmentMapOptions,e,hwe,u.environmentMapOptionsScratch);gxt(this,s,c,y,A)}let g=u.modelPrimitive;if(!l(g))continue;g.show=!0,g.scale=X.getValueOrDefault(a._scale,e,Jbt),g.enableVerticalExaggeration=X.getValueOrDefault(a._enableVerticalExaggeration,e,Zbt),g.minimumPixelSize=X.getValueOrDefault(a._minimumPixelSize,e,Qbt),g.maximumScale=X.getValueOrUndefined(a._maximumScale,e),g.modelMatrix=pxt(d,g.modelMatrix),g.shadows=X.getValueOrDefault(a._shadows,e,nxt),g.heightReference=X.getValueOrDefault(a._heightReference,e,ixt),g.distanceDisplayCondition=X.getValueOrUndefined(a._distanceDisplayCondition,e),g.silhouetteColor=X.getValueOrDefault(a._silhouetteColor,e,rxt,mwe),g.silhouetteSize=X.getValueOrDefault(a._silhouetteSize,e,oxt),g.color=X.getValueOrDefault(a._color,e,sxt,mwe),g.colorBlendMode=X.getValueOrDefault(a._colorBlendMode,e,axt),g.colorBlendAmount=X.getValueOrDefault(a._colorBlendAmount,e,cxt),g.clippingPlanes=X.getValueOrUndefined(a._clippingPlanes,e),g.clampAnimations=X.getValueOrDefault(a._clampAnimations,e,txt),g.imageBasedLighting.imageBasedLightingFactor=X.getValueOrDefault(a._imageBasedLightingFactor,e,lxt);let m=X.getValueOrUndefined(a._lightColor,e);if(l(m)&&(z.pack(m,pwe,0),m=h.unpack(pwe,0,dxt)),g.lightColor=m,g.customShader=X.getValueOrUndefined(a._customShader,e),n[s.id].modelUpdated=!0,g.ready){let y=X.getValueOrDefault(a._runAnimations,e,!0);u.animationsRunning!==y&&(y?g.activeAnimations.addAll({loop:Gu.REPEAT}):g.activeAnimations.removeAll(),u.animationsRunning=y);let A=X.getValueOrUndefined(a._nodeTransformations,e,u.nodeTransformationsScratch);if(l(A)){let T=Object.keys(A);for(let E=0,v=T.length;E<v;++E){let S=T[E],I=A[S];if(!l(I))continue;let R=g.getNode(S);if(!l(R))continue;let O=N.fromTranslationRotationScale(I,fxt);R.matrix=N.multiply(R.originalMatrix,O,O)}}let b=!1,x=X.getValueOrUndefined(a._articulations,e,u.articulationsScratch);if(l(x)){let T=Object.keys(x);for(let E=0,v=T.length;E<v;++E){let S=T[E],I=x[S];l(I)&&(b=!0,g.setArticulationStage(S,I))}}b&&g.applyArticulations()}}return!0};rb.prototype.isDestroyed=function(){return!1};rb.prototype.destroy=function(){this._entityCollection.collectionChanged.removeEventListener(rb.prototype._onCollectionChanged,this);let e=this._entitiesToVisualize.values,t=this._modelHash,n=this._primitives;for(let i=e.length-1;i>-1;i--)mte(this,e[i],t,n);return le(this)};var I3=new h,_xt=new he;rb.prototype.getBoundingSphere=function(e,t){let n=this._modelHash[e.id];if(!l(n))return Pt.FAILED;if(n.loadFailed)return Pt.FAILED;let i=n.modelPrimitive;if(!l(i)||!i.show)return Pt.PENDING;if(!i.ready||!n.modelUpdated)return Pt.PENDING;let r=this._scene,o=r.ellipsoid??ee.default;if(i.heightReference!==We.NONE){let a=i.modelMatrix;I3.x=a[12],I3.y=a[13],I3.z=a[14];let c=o.cartesianToCartographic(I3,_xt),u=r.getHeight(c,i.heightReference);if(l(u)||(u=i._lastSurfaceHeight),!l(u)){let f=this._modelHash,d=Kh(r,n,I3,[i],()=>f[e.id]===n);if(d===void 0)return Pt.PENDING;d!==null&&(u=d)}return l(u)&&(i.heightReference===We.CLIP_TO_GROUND?c.height<u&&(c.height=u):As(i.heightReference)?c.height=u:c.height+=u),ue.clone(i.boundingSphere,t),t.center=o.cartographicToCartesian(c),Pt.DONE}return ue.clone(i.boundingSphere,t),Pt.DONE};rb.prototype._onCollectionChanged=function(e,t,n,i){let r,o,s=this._entitiesToVisualize,a=this._modelHash,c=this._primitives;for(r=t.length-1;r>-1;r--)o=t[r],l(o._model)&&l(o._position)&&s.set(o.id,o);for(r=i.length-1;r>-1;r--)o=i[r],l(o._model)&&l(o._position)?(yxt(o,a),s.set(o.id,o)):(mte(this,o,a,c),s.remove(o.id));for(r=n.length-1;r>-1;r--)o=n[r],mte(this,o,a,c),s.remove(o.id)};function mte(e,t,n,i){let r=n[t.id];l(r)&&(i.removeAndDestroy(r.modelPrimitive),delete n[t.id])}function yxt(e,t){let n=t[e.id];l(n)&&(n.nodeTransformationsScratch={},n.articulationsScratch={})}var P3=rb;function ob(e){this._definitionChanged=new be,this._value=void 0,this._removeSubscription=void 0,this.setValue(e)}Object.defineProperties(ob.prototype,{isConstant:{get:function(){return X.isConstant(this._value)}},definitionChanged:{get:function(){return this._definitionChanged}},referenceFrame:{get:function(){return l(this._value)?this._value.referenceFrame:ji.FIXED}}});var Axt=new K;ob.prototype.getValue=function(e,t){return l(e)||(e=K.now(Axt)),this.getValueInReferenceFrame(e,ji.FIXED,t)};ob.prototype.setValue=function(e){this._value!==e&&(this._value=e,l(this._removeSubscription)&&(this._removeSubscription(),this._removeSubscription=void 0),l(e)&&(this._removeSubscription=e.definitionChanged.addEventListener(this._raiseDefinitionChanged,this)),this._definitionChanged.raiseEvent(this))};ob.prototype.getValueInReferenceFrame=function(e,t,n){if(l(this._value))return n=this._value.getValueInReferenceFrame(e,t,n),l(n)?ee.default.scaleToGeodeticSurface(n,n):void 0};ob.prototype.equals=function(e){return this===e||e instanceof ob&&this._value===e._value};ob.prototype._raiseDefinitionChanged=function(){this._definitionChanged.raiseEvent(this)};var m0=ob;var _we=new $,ywe=new $,Awe=new $,bxt=new h,bwe=new h,xxt=new h,Txt=new h,KG=new Le,$G=new N,JG=new $;function R3(e,t,n,i,r){if(!(!l(t)||!l(n))){if(h.subtract(t,n,r),l(i.orientation))i.orientation.getValue(e,KG)&&(Le.conjugate(KG,KG),$.fromQuaternion(KG,JG),$.multiplyByVector(JG,r,r));else if(l(_te(e,i.position,$G)))N.inverse($G,$G),N.getRotation($G,JG),$.multiplyByVector(JG,r,r);else return;return r}}function _te(e,t,n){let i=t.getValue(e,bxt);if(l(i)){let r=K.addSeconds(e,.01,new K),o=t.getValue(r,bwe);if(l(o)&&!h.equalsEpsilon(i,o,D.EPSILON16)){let s=At.computeFixedToIcrfMatrix(e,_we),a=At.computeFixedToIcrfMatrix(r,ywe),c;!l(s)||!l(a)?(c=At.computeTemeToPseudoFixedMatrix(e,Awe),s=$.transpose(c,_we),a=At.computeTemeToPseudoFixedMatrix(r,ywe),$.transpose(a,a)):c=$.transpose(s,Awe);let u=xxt;h.normalize(i,u),h.normalize(o,o),$.multiplyByVector(s,u,u),$.multiplyByVector(a,o,o);let f=h.cross(u,o,Txt);if(!h.equalsEpsilon(f,h.ZERO,D.EPSILON16)){let d=h.cross(f,u,bwe);return $.multiplyByVector(c,d,d),$.multiplyByVector(c,f,f),$.multiplyByVector(c,u,u),h.normalize(d,d),h.normalize(f,f),h.normalize(u,u),l(n)||(n=new N),n[0]=d.x,n[1]=d.y,n[2]=d.z,n[3]=0,n[4]=f.x,n[5]=f.y,n[6]=f.z,n[7]=0,n[8]=u.x,n[9]=u.y,n[10]=u.z,n[11]=0,n[12]=i.x,n[13]=i.y,n[14]=i.z,n[15]=1,n}}}}var xwe=60,wwe=1,Iwe=new En,pte=new En,gte=new En;function Twe(e){this.entity=e,this.polyline=void 0,this.segmentPolylines=[],this.index=void 0,this.updater=void 0}var ZG=new h;function Ext(e,t,n,i,r,o,s,a,c){let u,f,d=!1;o instanceof Jr&&(u=o,f=u.position,o=ji.FIXED,d=!0);let p=a,g,m;g=e.getValueInReferenceFrame(t,o,c[p]),d?(m=f.getValueInReferenceFrame(t,o,ZG),g=R3(t,g,m,u,g),l(g)&&(c[p++]=g)):l(g)&&(c[p++]=g);let y=!l(r)||K.lessThanOrEquals(r,t)||K.greaterThanOrEquals(r,n),A=0,b=i.length,x=i[A],T=n,E=!1,v,S,I;for(;A<b;){if(!y&&K.greaterThanOrEquals(x,r)&&(g=e.getValueInReferenceFrame(r,o,c[p]),d?(m=f.getValueInReferenceFrame(r,o,ZG),l(g)&&l(m)&&(g=R3(r,g,m,u,g),l(g)&&(c[p++]=g))):l(g)&&(c[p++]=g),y=!0),K.greaterThan(x,t)&&K.lessThan(x,T)&&!x.equals(r)&&(g=e.getValueInReferenceFrame(x,o,c[p]),d?(m=f.getValueInReferenceFrame(x,o,ZG),l(g)&&l(m)&&(g=R3(x,g,m,u,g),l(g)&&(c[p++]=g))):l(g)&&(c[p++]=g)),A<b-1){if(s>0&&!E){let R=i[A+1],O=K.secondsDifference(R,x);E=O>s,E&&(v=Math.ceil(O/s),S=0,I=O/Math.max(v,2),v=Math.max(v-1,1))}if(E&&S<v){x=K.addSeconds(x,I,new K),S++;continue}}E=!1,A++,x=i[A]}return g=e.getValueInReferenceFrame(n,o,c[p]),d?(m=f.getValueInReferenceFrame(n,o,ZG),l(g)&&l(m)&&(g=R3(n,g,m,u,g),l(g)&&(c[p++]=g))):l(g)&&(c[p++]=g),p}function Cxt(e,t,n,i,r,o,s,a){let c,u=0,f=s,d=t,p=!l(i)||K.lessThanOrEquals(i,t)||K.greaterThanOrEquals(i,n);for(;K.lessThan(d,n);)!p&&K.greaterThanOrEquals(d,i)&&(p=!0,c=e.getValueInReferenceFrame(i,r,a[f]),l(c)&&(a[f]=c,f++)),c=e.getValueInReferenceFrame(d,r,a[f]),l(c)&&(a[f]=c,f++),u++,d=K.addSeconds(t,o*u,new K);return c=e.getValueInReferenceFrame(n,r,a[f]),l(c)&&(a[f]=c,f++),f}function vxt(e,t,n,i,r,o,s,a){let c,u=0,f=s,d=t,p=Math.max(o,60),g=!l(i)||K.lessThanOrEquals(i,t)||K.greaterThanOrEquals(i,n);for(;K.lessThan(d,n);)!g&&K.greaterThanOrEquals(d,i)&&(g=!0,c=e.getValueInReferenceFrame(i,r,a[f]),l(c)&&(a[f]=c,f++)),c=e.getValueInReferenceFrame(d,r,a[f]),l(c)&&(a[f]=c,f++),u++,d=K.addSeconds(t,p*u,new K);return c=e.getValueInReferenceFrame(n,r,a[f]),l(c)&&(a[f]=c,f++),f}function Sxt(e,t,n,i,r,o,s,a){gte.start=t,gte.stop=n;let c=s,u=e.intervals;for(let f=0;f<u.length;f++){let d=u.get(f);if(!En.intersect(d,gte,Iwe).isEmpty){let p=d.start;d.isStartIncluded||(d.isStopIncluded?p=d.stop:p=K.addSeconds(d.start,K.secondsDifference(d.stop,d.start)/2,new K));let g=e.getValueInReferenceFrame(p,r,a[c]);l(g)&&(a[c]=g,c++)}}return c}function wxt(e,t,n,i,r,o,s,a){let c=e.getValueInReferenceFrame(t,r,a[s]);return l(c)&&(a[s++]=c),s}function Ixt(e,t,n,i,r,o,s,a){pte.start=t,pte.stop=n;let c=s,u=e.intervals;for(let f=0;f<u.length;f++){let d=u.get(f);if(!En.intersect(d,pte,Iwe).isEmpty){let p=d.start,g=d.stop,m=t;K.greaterThan(p,m)&&(m=p);let y=n;K.lessThan(g,y)&&(y=g),c=Pwe(d.data,m,y,i,r,o,c,a)}}return c}function Pwe(e,t,n,i,r,o,s,a){for(;e instanceof R_;)e=e.resolvedProperty;if(e instanceof _c){let c=e._property._times;s=Ext(e,t,n,c,i,r,o,s,a)}else e instanceof zN?s=Cxt(e,t,n,i,r,o,s,a):e instanceof pc?s=Ixt(e,t,n,i,r,o,s,a):e instanceof O_?s=Sxt(e,t,n,i,r,o,s,a):e instanceof Xl||e instanceof m0&&X.isConstant(e)?s=wxt(e,t,n,i,r,o,s,a):s=vxt(e,t,n,i,r,o,s,a);return s}function yte(e,t,n,i,r,o,s){l(s)||(s=[]);let a=Pwe(e,t,n,i,r,o,0,s);return s.length=a,s}var Ewe=new $,Cwe=new Le,vwe=new $,D3=new En,QG=new En,TE=new En;function Pxt(e){let t=[];if(!l(e))return t;for(let n in e){if(n[0]!=="_"||n==="_definitionChanged"||n.endsWith("Subscription"))continue;let i=e[n];l(i)&&typeof i.getValue=="function"&&!X.isConstant(i)&&t.push(i)}return t}function Swe(e,t,n,i,r,o,s,a,c,u,f){e.sort(K.compare),e=Fr(e,K.equalsEpsilon);let d=f;for(let p=0;p<e.length-1;p++){let g=e[p],m=e[p+1];if(!K.lessThan(g,m))continue;let y=K.addSeconds(g,K.secondsDifference(m,g)/2,new K),A=yte(t,g,m,n,c,a,[]);if(A.length<2)continue;let b=o.segmentPolylines[d];l(b)||(b=s.add(),b.id=r,o.segmentPolylines[d]=b),b.show=!0,b.positions=A,b.material=_o.getValue(y,u,b.material),b.width=X.getValueOrDefault(i._width,n,wwe),d++}return d}function O3(e,t){this._unusedIndexes=[],this._polylineCollection=new Cm,this._scene=e,this._referenceFrame=t,e.primitives.add(this._polylineCollection)}O3.prototype.update=function(e){let t=this._referenceFrame;if(t===ji.INERTIAL){let n=At.computeIcrfToFixedMatrix(e,Ewe);l(n)||(n=At.computeTemeToPseudoFixedMatrix(e,Ewe)),N.fromRotationTranslation(n,h.ZERO,this._polylineCollection.modelMatrix)}else if(t instanceof Jr){let n=t.position.getValue(e);l(t.orientation)?l(t.orientation.getValue(e,Cwe))&&($.fromQuaternion(Cwe,vwe),N.fromRotationTranslation(vwe,n,this._polylineCollection.modelMatrix)):_te(e,t.position,this._polylineCollection.modelMatrix)}};O3.prototype.updateObject=function(e,t){let n=t.entity,i=n._path,r=n._position,o,s,a=i._show,c=t.polyline,u=n.isShowing&&n.isAvailable(e)&&(!l(a)||a.getValue(e));if(u){let m=X.getValueOrUndefined(i._leadTime,e),y=X.getValueOrUndefined(i._trailTime,e),A=n._availability,b=l(A),x=l(m),T=l(y);if(u=b||x&&T,u){if(T&&(o=K.addSeconds(e,-y,new K)),x&&(s=K.addSeconds(e,m,new K)),b){let E=A.start,v=A.stop;(!T||K.greaterThan(E,o))&&(o=E),(!x||K.lessThan(v,s))&&(s=v)}u=K.lessThan(o,s)}}if(!u){l(c)&&(this._unusedIndexes.push(t.index),t.polyline=void 0,c.show=!1,t.index=void 0);for(let m=0;m<t.segmentPolylines.length;m++)t.segmentPolylines[m].show=!1;return}if(!l(c)){let m=this._unusedIndexes;if(m.length>0){let A=m.pop();c=this._polylineCollection.get(A),t.index=A}else t.index=this._polylineCollection.length,c=this._polylineCollection.add();c.id=n,t.polyline=c}let f=X.getValueOrDefault(i._resolution,e,xwe),d=yte(r,o,s,e,this._referenceFrame,f,c.positions.slice());if(d.length<2){c.show=!1;for(let m=0;m<t.segmentPolylines.length;m++)t.segmentPolylines[m].show=!1;return}c.show=!0,c.positions=d,c.material=_o.getValue(e,i.material,c.material);let p=X.getValueOrUndefined(i.materialMode,e),g=i.material;if(p===a0.PORTIONS&&!g.isConstant){l(c)&&(c.show=!1);let m=f>0?f:xwe,y=g.intervals,A=0;if(l(y)){D3.start=o,D3.stop=s,D3.isStartIncluded=!0,D3.isStopIncluded=!0;for(let b=0;b<y.length;b++){let x=y.get(b);if(!En.intersect(x,D3,QG))continue;let T=QG.start,E=QG.stop;if(K.greaterThanOrEquals(T,E))continue;let v=Pxt(x.data),S=[K.clone(T),K.clone(E)];for(let I=0;I<v.length;I++){let R=v[I],O=R.intervals;if(l(O))for(let L=0;L<O.length;L++){let _=O.get(L);En.intersect(_,QG,TE)&&(K.greaterThan(TE.start,T)&&K.lessThan(TE.start,E)&&S.push(K.clone(TE.start)),K.greaterThan(TE.stop,T)&&K.lessThan(TE.stop,E)&&S.push(K.clone(TE.stop)))}else if(!X.isConstant(R)){let L=K.clone(T);for(;K.lessThan(L,E);)S.push(K.clone(L)),L=K.addSeconds(L,m,new K)}}A=Swe(S,r,e,i,n,t,this._polylineCollection,m,this._referenceFrame,x.data,A)}}else{let b=[K.clone(o),K.clone(s)],x=K.addSeconds(o,m,new K);for(;K.lessThan(x,s);)b.push(K.clone(x)),x=K.addSeconds(x,m,new K);A=Swe(b,r,e,i,n,t,this._polylineCollection,m,this._referenceFrame,i.material,A)}for(let b=A;b<t.segmentPolylines.length;b++)l(t.segmentPolylines[b])&&(t.segmentPolylines[b].show=!1)}else for(let m=0;m<t.segmentPolylines.length;m++)t.segmentPolylines[m].show=!1;c.width=X.getValueOrDefault(i._width,e,wwe),c.distanceDisplayCondition=X.getValueOrUndefined(i._distanceDisplayCondition,e,c.distanceDisplayCondition)};O3.prototype.removeObject=function(e){let t=e.polyline;l(t)&&(this._unusedIndexes.push(e.index),e.polyline=void 0,t.show=!1,t.id=void 0,e.index=void 0);for(let n=0;n<e.segmentPolylines.length;n++)e.segmentPolylines[n].show=!1;e.segmentPolylines.length=0};O3.prototype.destroy=function(){return this._scene.primitives.remove(this._polylineCollection),le(this)};function p0(e,t){t.collectionChanged.addEventListener(p0.prototype._onCollectionChanged,this),this._scene=e,this._updaters={},this._entityCollection=t,this._items=new Ut,this._onCollectionChanged(t,t.values,[],[])}p0.prototype.update=function(e){let t=this._updaters;for(let i in t)t.hasOwnProperty(i)&&t[i].update(e);let n=this._items.values;if(n.length===0&&l(this._updaters)&&Object.keys(this._updaters).length>0){for(let i in t)t.hasOwnProperty(i)&&t[i].destroy();this._updaters={}}for(let i=0,r=n.length;i<r;i++){let o=n[i],s=o.entity,a=s._position,c=s._path,u=o.updater,f=!1,d=ji.FIXED,p=d.toString();if(this._scene.mode===re.SCENE3D){let m=X.getValueOrUndefined(c.relativeTo,e);l(m)?m==="FIXED"?(d=ji.FIXED,p=d.toString()):m==="INERTIAL"?(d=ji.INERTIAL,p=d.toString()):(f=!0,d=this._entityCollection.getById(m),p=m):(d=a.referenceFrame,p=d.toString())}let g=this._updaters[p];if(u===g&&l(g)){g.updateObject(e,o);continue}l(u)&&u.removeObject(o),!(f&&!l(d))&&(l(g)||(g=new O3(this._scene,d),g.update(e),this._updaters[p]=g),o.updater=g,l(g)&&g.updateObject(e,o))}return!0};p0.prototype.isDestroyed=function(){return!1};p0.prototype.destroy=function(){this._entityCollection.collectionChanged.removeEventListener(p0.prototype._onCollectionChanged,this);let e=this._updaters;for(let t in e)e.hasOwnProperty(t)&&e[t].destroy();return le(this)};p0.prototype._onCollectionChanged=function(e,t,n,i){let r,o,s,a=this._items;for(r=t.length-1;r>-1;r--)o=t[r],l(o._path)&&l(o._position)&&a.set(o.id,new Twe(o));for(r=i.length-1;r>-1;r--)o=i[r],l(o._path)&&l(o._position)?a.contains(o.id)||a.set(o.id,new Twe(o)):(s=a.get(o.id),l(s)&&(l(s.updater)&&s.updater.removeObject(s),a.remove(o.id)));for(r=n.length-1;r>-1;r--)o=n[r],s=a.get(o.id),l(s)&&(l(s.updater)&&s.updater.removeObject(s),a.remove(o.id))};p0._subSample=yte;p0._computeVvlhTransform=_te;p0._transformToEntityFrame=R3;var M3=p0;var Dwe=z.WHITE,Rwe=z.BLACK,Owe=0,Mwe=1,Nwe=0,Lwe=jo.NONE,Fwe=new z,Dxt=new h,Bwe=new z,kwe=new qt,Uwe=new qt,zwe=new Ht;function Vwe(e){this.entity=e,this.pointPrimitive=void 0,this.billboard=void 0,this.color=void 0,this.outlineColor=void 0,this.pixelSize=void 0,this.outlineWidth=void 0}function sb(e,t){t.collectionChanged.addEventListener(sb.prototype._onCollectionChanged,this),this._cluster=e,this._entityCollection=t,this._items=new Ut,this._onCollectionChanged(t,t.values,[],[])}sb.prototype.update=function(e){let t=this._items.values,n=this._cluster;for(let i=0,r=t.length;i<r;i++){let o=t[i],s=o.entity,a=s._point,c=o.pointPrimitive,u=o.billboard,f=X.getValueOrDefault(a._heightReference,e,We.NONE),d=s.isShowing&&s.isAvailable(e)&&X.getValueOrDefault(a._show,e,!0),p;if(d&&(p=X.getValueOrUndefined(s._position,e,Dxt),d=l(p)),!d){N3(o,s,n);continue}X.isConstant(s._position)||(n._clusterDirty=!0);let g=!1,m=!1;if(f!==We.NONE&&!l(u)?(l(c)&&(N3(o,s,n),c=void 0),u=n.getBillboard(s),u.id=s,u.image=void 0,o.billboard=u,g=!0,m=h.equals(u.position,p)&&u.heightReference===f):f===We.NONE&&!l(c)&&(l(u)&&(N3(o,s,n),u=void 0),c=n.getPoint(s),c.id=s,o.pointPrimitive=c),l(c))c.show=!0,c.position=p,c.scaleByDistance=X.getValueOrUndefined(a._scaleByDistance,e,kwe),c.translucencyByDistance=X.getValueOrUndefined(a._translucencyByDistance,e,Uwe),c.color=X.getValueOrDefault(a._color,e,Dwe,Fwe),c.outlineColor=X.getValueOrDefault(a._outlineColor,e,Rwe,Bwe),c.outlineWidth=X.getValueOrDefault(a._outlineWidth,e,Owe),c.pixelSize=X.getValueOrDefault(a._pixelSize,e,Mwe),c.distanceDisplayCondition=X.getValueOrUndefined(a._distanceDisplayCondition,e,zwe),c.disableDepthTestDistance=X.getValueOrDefault(a._disableDepthTestDistance,e,Nwe),c.splitDirection=X.getValueOrDefault(a._splitDirection,e,Lwe);else if(l(u)){u.show=!0,u.position=p,u.scaleByDistance=X.getValueOrUndefined(a._scaleByDistance,e,kwe),u.translucencyByDistance=X.getValueOrUndefined(a._translucencyByDistance,e,Uwe),u.distanceDisplayCondition=X.getValueOrUndefined(a._distanceDisplayCondition,e,zwe),u.disableDepthTestDistance=X.getValueOrDefault(a._disableDepthTestDistance,e,Nwe),u.splitDirection=X.getValueOrDefault(a._splitDirection,e,Lwe),u.heightReference=f;let y=X.getValueOrDefault(a._color,e,Dwe,Fwe),A=X.getValueOrDefault(a._outlineColor,e,Rwe,Bwe),b=Math.round(X.getValueOrDefault(a._outlineWidth,e,Owe)),x=Math.max(1,Math.round(X.getValueOrDefault(a._pixelSize,e,Mwe)));if(b>0?(u.scale=1,g=g||b!==o.outlineWidth||x!==o.pixelSize||!z.equals(y,o.color)||!z.equals(A,o.outlineColor)):(u.scale=x/50,x=50,g=g||b!==o.outlineWidth||!z.equals(y,o.color)||!z.equals(A,o.outlineColor)),g){o.color=z.clone(y,o.color),o.outlineColor=z.clone(A,o.outlineColor),o.pixelSize=x,o.outlineWidth=b;let T=y.alpha,E=y.toCssColorString(),v=A.toCssColorString(),S=JSON.stringify([E,x,v,b]);u.setImage(S,RT(T,E,v,b,x))}m&&u._updateClamping()}}return!0};sb.prototype.getBoundingSphere=function(e,t){let n=this._items.get(e.id);if(!l(n)||!(l(n.pointPrimitive)||l(n.billboard)))return Pt.FAILED;if(l(n.pointPrimitive))t.center=h.clone(n.pointPrimitive.position,t.center);else{let i=n.billboard;if(i._clampedToSurface)t.center=h.clone(i._clampedPosition,t.center);else{let r=this._cluster._scene,o=this._items,s=Kh(r,n,i.position,[i],()=>o.get(e.id)===n);if(s===void 0)return Pt.PENDING;s===null?t.center=h.clone(i.position,t.center):t.center=gg(i.position,s,i.heightReference,r.ellipsoid??ee.default,t.center)}}return t.radius=0,Pt.DONE};sb.prototype.isDestroyed=function(){return!1};sb.prototype.destroy=function(){this._entityCollection.collectionChanged.removeEventListener(sb.prototype._onCollectionChanged,this);let e=this._entityCollection.values;for(let t=0;t<e.length;t++)this._cluster.removePoint(e[t]);return le(this)};sb.prototype._onCollectionChanged=function(e,t,n,i){let r,o,s=this._items,a=this._cluster;for(r=t.length-1;r>-1;r--)o=t[r],l(o._point)&&l(o._position)&&s.set(o.id,new Vwe(o));for(r=i.length-1;r>-1;r--)o=i[r],l(o._point)&&l(o._position)?s.contains(o.id)||s.set(o.id,new Vwe(o)):(N3(s.get(o.id),o,a),s.remove(o.id));for(r=n.length-1;r>-1;r--)o=n[r],N3(s.get(o.id),o,a),s.remove(o.id)};function N3(e,t,n){if(l(e)){let i=e.pointPrimitive;if(l(i)){e.pointPrimitive=void 0,n.removePoint(t);return}let r=e.billboard;l(r)&&(e.billboard=void 0,n.removeBillboard(t))}}var L3=sb;var qwe=[];function Rxt(e,t,n,i,r){let o=qwe;o.length=r;let s,a=n.red,c=n.green,u=n.blue,f=n.alpha,d=i.red,p=i.green,g=i.blue,m=i.alpha;if(z.equals(n,i)){for(s=0;s<r;s++)o[s]=z.clone(n);return o}let y=(d-a)/r,A=(p-c)/r,b=(g-u)/r,x=(m-f)/r;for(s=0;s<r;s++)o[s]=new z(a+s*y,c+s*A,u+s*b,f+s*x);return o}function F3(e){e=e??H.EMPTY_OBJECT;let t=e.positions,n=e.colors,i=e.width??1,r=e.colorsPerVertex??!1;this._positions=t,this._colors=n,this._width=i,this._colorsPerVertex=r,this._vertexFormat=Be.clone(e.vertexFormat??Be.DEFAULT),this._arcType=e.arcType??ln.GEODESIC,this._granularity=e.granularity??D.RADIANS_PER_DEGREE,this._ellipsoid=ee.clone(e.ellipsoid??ee.default),this._workerName="createPolylineGeometry";let o=1+t.length*h.packedLength;o+=l(n)?1+n.length*z.packedLength:1,this.packedLength=o+ee.packedLength+Be.packedLength+4}F3.pack=function(e,t,n){n=n??0;let i,r=e._positions,o=r.length;for(t[n++]=o,i=0;i<o;++i,n+=h.packedLength)h.pack(r[i],t,n);let s=e._colors;for(o=l(s)?s.length:0,t[n++]=o,i=0;i<o;++i,n+=z.packedLength)z.pack(s[i],t,n);return ee.pack(e._ellipsoid,t,n),n+=ee.packedLength,Be.pack(e._vertexFormat,t,n),n+=Be.packedLength,t[n++]=e._width,t[n++]=e._colorsPerVertex?1:0,t[n++]=e._arcType,t[n]=e._granularity,t};var Ywe=ee.clone(ee.UNIT_SPHERE),Xwe=new Be,EE={positions:void 0,colors:void 0,ellipsoid:Ywe,vertexFormat:Xwe,width:void 0,colorsPerVertex:void 0,arcType:void 0,granularity:void 0};F3.unpack=function(e,t,n){t=t??0;let i,r=e[t++],o=new Array(r);for(i=0;i<r;++i,t+=h.packedLength)o[i]=h.unpack(e,t);r=e[t++];let s=r>0?new Array(r):void 0;for(i=0;i<r;++i,t+=z.packedLength)s[i]=z.unpack(e,t);let a=ee.unpack(e,t,Ywe);t+=ee.packedLength;let c=Be.unpack(e,t,Xwe);t+=Be.packedLength;let u=e[t++],f=e[t++]===1,d=e[t++],p=e[t];return l(n)?(n._positions=o,n._colors=s,n._ellipsoid=ee.clone(a,n._ellipsoid),n._vertexFormat=Be.clone(c,n._vertexFormat),n._width=u,n._colorsPerVertex=f,n._arcType=d,n._granularity=p,n):(EE.positions=o,EE.colors=s,EE.width=u,EE.colorsPerVertex=f,EE.arcType=d,EE.granularity=p,new F3(EE))};var jwe=new h,Hwe=new h,Gwe=new h,Wwe=new h;F3.createGeometry=function(e){let t=e._width,n=e._vertexFormat,i=e._colors,r=e._colorsPerVertex,o=e._arcType,s=e._granularity,a=e._ellipsoid,c,u,f,d=[],p=Fr(e._positions,h.equalsEpsilon,!1,d);if(l(i)&&d.length>0){let M=0,F=d[0];i=i.filter(function(V,B){let j;return r?j=B===F||B===0&&F===1:j=B+1===F,j?(M++,F=d[M],!1):!0})}let g=p.length;if(g<2||t<=0)return;if(o===ln.GEODESIC||o===ln.RHUMB){let M,F;o===ln.GEODESIC?(M=D.chordLength(s,a.maximumRadius),F=ir.numberOfPoints):(M=s,F=ir.numberOfPointsRhumbLine);let V=ir.extractHeights(p,a);if(l(i)){let B=1;for(c=0;c<g-1;++c)B+=F(p[c],p[c+1],M);let j=new Array(B),k=0;for(c=0;c<g-1;++c){let G=p[c],q=p[c+1],Q=i[c],W=F(G,q,M);if(r&&c<B){let J=i[c+1],Z=Rxt(G,q,Q,J,W),ae=Z.length;for(u=0;u<ae;++u)j[k++]=Z[u]}else for(u=0;u<W;++u)j[k++]=z.clone(Q)}j[k]=z.clone(i[i.length-1]),i=j,qwe.length=0}o===ln.GEODESIC?p=ir.generateCartesianArc({positions:p,minDistance:M,ellipsoid:a,height:V}):p=ir.generateCartesianRhumbArc({positions:p,granularity:M,ellipsoid:a,height:V})}g=p.length;let m=g*4-4,y=new Float64Array(m*3),A=new Float64Array(m*3),b=new Float64Array(m*3),x=new Float32Array(m*2),T=n.st?new Float32Array(m*2):void 0,E=l(i)?new Uint8Array(m*4):void 0,v=0,S=0,I=0,R=0,O;for(u=0;u<g;++u){u===0?(O=jwe,h.subtract(p[0],p[1],O),h.add(p[0],O,O)):O=p[u-1],h.clone(O,Gwe),h.clone(p[u],Hwe),u===g-1?(O=jwe,h.subtract(p[g-1],p[g-2],O),h.add(p[g-1],O,O)):O=p[u+1],h.clone(O,Wwe);let M,F;l(E)&&(u!==0&&!r?M=i[u-1]:M=i[u],u!==g-1&&(F=i[u]));let V=u===0?2:0,B=u===g-1?2:4;for(f=V;f<B;++f){h.pack(Hwe,y,v),h.pack(Gwe,A,v),h.pack(Wwe,b,v),v+=3;let j=f-2<0?-1:1;if(x[S++]=2*(f%2)-1,x[S++]=j*t,n.st&&(T[I++]=u/(g-1),T[I++]=Math.max(x[S-2],0)),l(E)){let k=f<2?M:F;E[R++]=z.floatToByte(k.red),E[R++]=z.floatToByte(k.green),E[R++]=z.floatToByte(k.blue),E[R++]=z.floatToByte(k.alpha)}}}let L=new Tn;L.position=new Ne({componentDatatype:Y.DOUBLE,componentsPerAttribute:3,values:y}),L.prevPosition=new Ne({componentDatatype:Y.DOUBLE,componentsPerAttribute:3,values:A}),L.nextPosition=new Ne({componentDatatype:Y.DOUBLE,componentsPerAttribute:3,values:b}),L.expandAndWidth=new Ne({componentDatatype:Y.FLOAT,componentsPerAttribute:2,values:x}),n.st&&(L.st=new Ne({componentDatatype:Y.FLOAT,componentsPerAttribute:2,values:T})),l(E)&&(L.color=new Ne({componentDatatype:Y.UNSIGNED_BYTE,componentsPerAttribute:4,values:E,normalize:!0}));let _=je.createTypedArray(m,g*6-6),C=0,w=0,P=g-1;for(u=0;u<P;++u)_[w++]=C,_[w++]=C+2,_[w++]=C+1,_[w++]=C+1,_[w++]=C+2,_[w++]=C+3,C+=4;return new St({attributes:L,indices:_,primitiveType:Oe.TRIANGLES,boundingSphere:ue.fromPoints(p),geometryType:Sd.POLYLINES})};var z_=F3;var Oxt=new ui(0),e5={},Kwe=new z,Mxt=new Kt(z.WHITE),Nxt=new ui(!0),Lxt=new ui(Dn.DISABLED),Fxt=new ui(new Ht),Bxt=new ui(ei.BOTH);function kxt(){this.vertexFormat=void 0,this.positions=void 0,this.width=void 0,this.arcType=void 0,this.granularity=void 0}function Uxt(){this.positions=void 0,this.width=void 0,this.arcType=void 0,this.granularity=void 0}function Hm(e,t){this._entity=e,this._scene=t,this._entitySubscription=e.definitionChanged.addEventListener(Hm.prototype._onEntityPropertyChanged,this),this._fillEnabled=!1,this._dynamic=!1,this._geometryChanged=new be,this._showProperty=void 0,this._materialProperty=void 0,this._shadowsProperty=void 0,this._distanceDisplayConditionProperty=void 0,this._classificationTypeProperty=void 0,this._depthFailMaterialProperty=void 0,this._geometryOptions=new kxt,this._groundGeometryOptions=new Uxt,this._id=`polyline-${e.id}`,this._clampToGround=!1,this._supportsPolylinesOnTerrain=Jr.supportsPolylinesOnTerrain(t),this._zIndex=0,this._onEntityPropertyChanged(e,"polyline",e.polyline,void 0)}Object.defineProperties(Hm.prototype,{id:{get:function(){return this._id}},entity:{get:function(){return this._entity}},fillEnabled:{get:function(){return this._fillEnabled}},hasConstantFill:{get:function(){return!this._fillEnabled||!l(this._entity.availability)&&X.isConstant(this._showProperty)}},fillMaterialProperty:{get:function(){return this._materialProperty}},depthFailMaterialProperty:{get:function(){return this._depthFailMaterialProperty}},outlineEnabled:{value:!1},hasConstantOutline:{value:!0},outlineColorProperty:{value:void 0},shadowsProperty:{get:function(){return this._shadowsProperty}},distanceDisplayConditionProperty:{get:function(){return this._distanceDisplayConditionProperty}},classificationTypeProperty:{get:function(){return this._classificationTypeProperty}},isDynamic:{get:function(){return this._dynamic}},isClosed:{value:!1},geometryChanged:{get:function(){return this._geometryChanged}},arcType:{get:function(){return this._arcType}},clampToGround:{get:function(){return this._clampToGround&&this._supportsPolylinesOnTerrain}},zIndex:{get:function(){return this._zIndex}}});Hm.prototype.isOutlineVisible=function(e){return!1};Hm.prototype.isFilled=function(e){let t=this._entity;return(this._fillEnabled&&t.isAvailable(e)&&this._showProperty.getValue(e))??!1};Hm.prototype.createFillGeometryInstance=function(e){let t=this._entity,n=t.isAvailable(e),i=new Pn(n&&t.isShowing&&this._showProperty.getValue(e)),r=this._distanceDisplayConditionProperty.getValue(e),o=Qn.fromDistanceDisplayCondition(r),s={show:i,distanceDisplayCondition:o},a;return this._materialProperty instanceof Kt&&(l(this._materialProperty.color)&&(this._materialProperty.color.isConstant||n)&&(a=this._materialProperty.color.getValue(e,Kwe)),l(a)||(a=z.WHITE),s.color=Jt.fromColor(a)),this.clampToGround?new Ft({id:t,geometry:new Rx(this._groundGeometryOptions),attributes:s}):(l(this._depthFailMaterialProperty)&&this._depthFailMaterialProperty instanceof Kt&&(l(this._depthFailMaterialProperty.color)&&(this._depthFailMaterialProperty.color.isConstant||n)&&(a=this._depthFailMaterialProperty.color.getValue(e,Kwe)),l(a)||(a=z.WHITE),s.depthFailColor=Jt.fromColor(a)),new Ft({id:t,geometry:new z_(this._geometryOptions),attributes:s}))};Hm.prototype.createOutlineGeometryInstance=function(e){};Hm.prototype.isDestroyed=function(){return!1};Hm.prototype.destroy=function(){this._entitySubscription(),le(this)};Hm.prototype._onEntityPropertyChanged=function(e,t,n,i){if(!(t==="availability"||t==="polyline"))return;let r=this._entity.polyline;if(!l(r)){this._fillEnabled&&(this._fillEnabled=!1,this._geometryChanged.raiseEvent(this));return}let o=r.positions,s=r.show;if(l(s)&&s.isConstant&&!s.getValue(nt.MINIMUM_VALUE)||!l(o)){this._fillEnabled&&(this._fillEnabled=!1,this._geometryChanged.raiseEvent(this));return}let a=r.zIndex,c=r.material??Mxt,u=c instanceof Kt;this._materialProperty=c,this._depthFailMaterialProperty=r.depthFailMaterial,this._showProperty=s??Nxt,this._shadowsProperty=r.shadows??Lxt,this._distanceDisplayConditionProperty=r.distanceDisplayCondition??Fxt,this._classificationTypeProperty=r.classificationType??Bxt,this._fillEnabled=!0,this._zIndex=a??Oxt;let f=r.width,d=r.arcType,p=r.clampToGround,g=r.granularity;if(!o.isConstant||!X.isConstant(f)||!X.isConstant(d)||!X.isConstant(g)||!X.isConstant(p)||!X.isConstant(a))this._dynamic||(this._dynamic=!0,this._geometryChanged.raiseEvent(this));else{let m=this._geometryOptions,y=o.getValue(nt.MINIMUM_VALUE,m.positions);if(!l(y)||y.length<2){this._fillEnabled&&(this._fillEnabled=!1,this._geometryChanged.raiseEvent(this));return}let A;u&&(!l(this._depthFailMaterialProperty)||this._depthFailMaterialProperty instanceof Kt)?A=js.VERTEX_FORMAT:A=lc.VERTEX_FORMAT,m.vertexFormat=A,m.positions=y,m.width=l(f)?f.getValue(nt.MINIMUM_VALUE):void 0,m.arcType=l(d)?d.getValue(nt.MINIMUM_VALUE):void 0,m.granularity=l(g)?g.getValue(nt.MINIMUM_VALUE):void 0;let b=this._groundGeometryOptions;b.positions=y,b.width=m.width,b.arcType=m.arcType,b.granularity=m.granularity,this._clampToGround=l(p)?p.getValue(nt.MINIMUM_VALUE):!1,!this._clampToGround&&l(a)&&_t("Entity polylines must have clampToGround: true when using zIndex. zIndex will be ignored."),this._dynamic=!1,this._geometryChanged.raiseEvent(this)}};Hm.prototype.createDynamicUpdater=function(e,t){return new B3(e,t,this)};var _I={positions:void 0,granularity:void 0,height:void 0,ellipsoid:void 0};function B3(e,t,n){this._line=void 0,this._primitives=e,this._groundPrimitives=t,this._groundPolylinePrimitive=void 0,this._material=void 0,this._geometryUpdater=n,this._positions=[]}function $we(e){if(l(e._line))return e._line;let t=e._primitives,n=e._geometryUpdater._scene.id+t._guid,i=e5[n];!l(i)||i.isDestroyed()?(i=new Cm,e5[n]=i,t.add(i)):t.contains(i)||t.add(i);let r=i.add();return r.id=e._geometryUpdater._entity,e._line=r,r}B3.prototype.update=function(e){let t=this._geometryUpdater,n=t._entity,i=n.polyline,r=i.positions,o=X.getValueOrUndefined(r,e,this._positions);t._clampToGround=X.getValueOrDefault(i._clampToGround,e,!1),t._groundGeometryOptions.positions=o,t._groundGeometryOptions.width=X.getValueOrDefault(i._width,e,1),t._groundGeometryOptions.arcType=X.getValueOrDefault(i._arcType,e,ln.GEODESIC),t._groundGeometryOptions.granularity=X.getValueOrDefault(i._granularity,e,9999);let s=this._groundPrimitives;if(l(this._groundPolylinePrimitive)&&(s.remove(this._groundPolylinePrimitive),this._groundPolylinePrimitive=void 0),t.clampToGround){if(!n.isShowing||!n.isAvailable(e)||!X.getValueOrDefault(i._show,e,!0)||!l(o)||o.length<2)return;let d=t.fillMaterialProperty,p;if(d instanceof Kt)p=new js;else{let g=_o.getValue(e,d,this._material);p=new lc({material:g,translucent:g.isTranslucent()}),this._material=g}this._groundPolylinePrimitive=s.add(new Jh({geometryInstances:t.createFillGeometryInstance(e),appearance:p,classificationType:t.classificationTypeProperty.getValue(e),asynchronous:!1}),X.getValueOrUndefined(t.zIndex,e)),l(this._line)&&(this._line.show=!1);return}let a=$we(this);if(!n.isShowing||!n.isAvailable(e)||!X.getValueOrDefault(i._show,e,!0)){a.show=!1;return}if(!l(o)||o.length<2){a.show=!1;return}let c=ln.GEODESIC;c=X.getValueOrDefault(i._arcType,e,c);let u=t._scene.globe,f=t._scene.ellipsoid;c!==ln.NONE&&l(u)&&(_I.ellipsoid=f,_I.positions=o,_I.granularity=X.getValueOrUndefined(i._granularity,e),_I.height=ir.extractHeights(o,f),c===ln.GEODESIC?o=ir.generateCartesianArc(_I):o=ir.generateCartesianRhumbArc(_I)),a.show=!0,a.positions=o.slice(),a.material=_o.getValue(e,t.fillMaterialProperty,a.material),a.width=X.getValueOrDefault(i._width,e,1),a.distanceDisplayCondition=X.getValueOrUndefined(i._distanceDisplayCondition,e,a.distanceDisplayCondition)};B3.prototype.getBoundingSphere=function(e){if(this._geometryUpdater.clampToGround){let t=this._groundPolylinePrimitive;if(l(t)&&t.show&&t.ready){let n=t.getGeometryInstanceAttributes(this._geometryUpdater._entity);if(l(n)&&l(n.boundingSphere))return ue.clone(n.boundingSphere,e),Pt.DONE}return l(t)&&!t.ready?Pt.PENDING:Pt.DONE}else{let t=$we(this);if(t.show&&t.positions.length>0)return ue.fromPoints(t.positions,e),Pt.DONE}return Pt.FAILED};B3.prototype.isDestroyed=function(){return!1};B3.prototype.destroy=function(){let t=this._geometryUpdater._scene.id+this._primitives._guid,n=e5[t];l(n)&&(n.remove(this._line),n.length===0&&(this._primitives.removeAndDestroy(n),delete e5[t])),l(this._groundPolylinePrimitive)&&this._groundPrimitives.remove(this._groundPolylinePrimitive),le(this)};var k3=Hm;var zxt=new z,Vxt=new Ht,jxt=new Ht;function Gm(e,t,n,i,r){let o;n instanceof Kt?o=js:o=lc,this.orderedGroundPrimitives=e,this.classificationType=t,this.appearanceType=o,this.materialProperty=n,this.updaters=new Ut,this.createPrimitive=!0,this.primitive=void 0,this.oldPrimitive=void 0,this.geometry=new Ut,this.material=void 0,this.updatersWithAttributes=new Ut,this.attributes=new Ut,this.invalidated=!1,this.removeMaterialSubscription=n.definitionChanged.addEventListener(Gm.prototype.onMaterialChanged,this),this.subscriptions=new Ut,this.showsUpdated=new Ut,this.zIndex=i,this._asynchronous=r}Gm.prototype.onMaterialChanged=function(){this.invalidated=!0};Gm.prototype.isMaterial=function(e){let t=this.materialProperty,n=e.fillMaterialProperty;return n===t||n instanceof Kt&&t instanceof Kt?!0:l(t)&&t.equals(n)};Gm.prototype.add=function(e,t,n){let i=t.id;if(this.updaters.set(i,t),this.geometry.set(i,n),!t.hasConstantFill||!t.fillMaterialProperty.isConstant||!X.isConstant(t.distanceDisplayConditionProperty))this.updatersWithAttributes.set(i,t);else{let r=this;this.subscriptions.set(i,t.entity.definitionChanged.addEventListener(function(o,s,a,c){s==="isShowing"&&r.showsUpdated.set(t.id,t)}))}this.createPrimitive=!0};Gm.prototype.remove=function(e){let t=e.id;if(this.createPrimitive=this.geometry.remove(t)||this.createPrimitive,this.updaters.remove(t)){this.updatersWithAttributes.remove(t);let n=this.subscriptions.get(t);return l(n)&&(n(),this.subscriptions.remove(t),this.showsUpdated.remove(t)),!0}return!1};Gm.prototype.update=function(e){let t=!0,n=this.primitive,i=this.orderedGroundPrimitives,r=this.geometry.values,o;if(this.createPrimitive){if(r.length>0){l(n)&&(l(this.oldPrimitive)?i.remove(n):this.oldPrimitive=n);let a=this.appearanceType;n=new Jh({show:!1,asynchronous:this._asynchronous,geometryInstances:r.slice(),appearance:new a,classificationType:this.classificationType}),this.appearanceType===lc&&(this.material=_o.getValue(e,this.materialProperty,this.material),n.appearance.material=this.material),i.add(n,this.zIndex),t=!1}else{l(n)&&(i.remove(n),n=void 0);let a=this.oldPrimitive;l(a)&&(i.remove(a),this.oldPrimitive=void 0)}this.attributes.removeAll(),this.primitive=n,this.createPrimitive=!1}else if(l(n)&&n.ready){n.show=!0,l(this.oldPrimitive)&&(i.remove(this.oldPrimitive),this.oldPrimitive=void 0),this.appearanceType===lc&&(this.material=_o.getValue(e,this.materialProperty,this.material),this.primitive.appearance.material=this.material);let s=this.updatersWithAttributes.values,a=s.length;for(o=0;o<a;o++){let c=s[o],u=c.entity,f=this.geometry.get(c.id),d=this.attributes.get(f.id.id);if(l(d)||(d=n.getGeometryInstanceAttributes(f.id),this.attributes.set(f.id.id,d)),!c.fillMaterialProperty.isConstant){let y=c.fillMaterialProperty.color,A=X.getValueOrDefault(y,e,z.WHITE,zxt);z.equals(d._lastColor,A)||(d._lastColor=z.clone(A,d._lastColor),d.color=Jt.toValue(A,d.color))}let p=u.isShowing&&(c.hasConstantFill||c.isFilled(e)),g=d.show[0]===1;p!==g&&(d.show=Pn.toValue(p,d.show));let m=c.distanceDisplayConditionProperty;if(!X.isConstant(m)){let y=X.getValueOrDefault(m,e,jxt,Vxt);Ht.equals(y,d._lastDistanceDisplayCondition)||(d._lastDistanceDisplayCondition=Ht.clone(y,d._lastDistanceDisplayCondition),d.distanceDisplayCondition=Qn.toValue(y,d.distanceDisplayCondition))}}this.updateShows(n)}else l(n)&&!n.ready&&(t=!1);return t};Gm.prototype.updateShows=function(e){let t=this.showsUpdated.values,n=t.length;for(let i=0;i<n;i++){let r=t[i],o=r.entity,s=this.geometry.get(r.id),a=this.attributes.get(s.id.id);l(a)||(a=e.getGeometryInstanceAttributes(s.id),this.attributes.set(s.id.id,a));let c=o.isShowing,u=a.show[0]===1;c!==u&&(a.show=Pn.toValue(c,a.show),s.attributes.show.value[0]=a.show[0])}this.showsUpdated.removeAll()};Gm.prototype.contains=function(e){return this.updaters.contains(e.id)};Gm.prototype.getBoundingSphere=function(e,t){let n=this.primitive;if(!n.ready)return Pt.PENDING;let i=n.getGeometryInstanceAttributes(e.entity);return!l(i)||!l(i.boundingSphere)||l(i.show)&&i.show[0]===0?Pt.FAILED:(i.boundingSphere.clone(t),Pt.DONE)};Gm.prototype.destroy=function(){let e=this.primitive,t=this.orderedGroundPrimitives;l(e)&&t.remove(e);let n=this.oldPrimitive;l(n)&&t.remove(n),this.removeMaterialSubscription()};function yI(e,t,n){this._items=[],this._orderedGroundPrimitives=e,this._classificationType=t,this._asynchronous=n??!0}yI.prototype.add=function(e,t){let n=this._items,i=n.length,r=t.createFillGeometryInstance(e),o=X.getValueOrDefault(t.zIndex,0);for(let a=0;a<i;++a){let c=n[a];if(c.isMaterial(t)&&c.zIndex===o){c.add(e,t,r);return}}let s=new Gm(this._orderedGroundPrimitives,this._classificationType,t.fillMaterialProperty,o,this._asynchronous);s.add(e,t,r),n.push(s)};yI.prototype.remove=function(e){let t=this._items,n=t.length;for(let i=n-1;i>=0;i--){let r=t[i];if(r.remove(e)){r.updaters.length===0&&(t.splice(i,1),r.destroy());break}}};yI.prototype.update=function(e){let t,n=this._items,i=n.length;for(t=i-1;t>=0;t--){let o=n[t];if(o.invalidated){n.splice(t,1);let s=o.updaters.values,a=s.length;for(let c=0;c<a;c++)this.add(e,s[c]);o.destroy()}}let r=!0;for(t=0;t<n.length;t++)r=n[t].update(e)&&r;return r};yI.prototype.getBoundingSphere=function(e,t){let n=this._items,i=n.length;for(let r=0;r<i;r++){let o=n[r];if(o.contains(e))return o.getBoundingSphere(e,t)}return Pt.FAILED};yI.prototype.removeAllPrimitives=function(){let e=this._items,t=e.length;for(let n=0;n<t;n++)e[n].destroy();this._items.length=0};var U3=yI;var Hxt=[];function Jwe(e,t){let n=e._batches,i=n.length;for(let r=0;r<i;r++)n[r].remove(t)}function Zwe(e,t,n){if(n.isDynamic){e._dynamicBatch.add(t,n);return}if(n.clampToGround&&n.fillEnabled){let s=n.classificationTypeProperty.getValue(t);e._groundBatches[s].add(t,n);return}let i;n.fillEnabled&&(i=n.shadowsProperty.getValue(t));let r=0;l(n.depthFailMaterialProperty)&&(r=n.depthFailMaterialProperty instanceof Kt?1:2);let o;l(i)&&(o=i+r*Dn.NUMBER_OF_SHADOW_MODES),n.fillEnabled&&(n.fillMaterialProperty instanceof Kt?e._colorBatches[o].add(t,n):e._materialBatches[o].add(t,n))}function g0(e,t,n,i){i=i??e.groundPrimitives,n=n??e.primitives,this._scene=e,this._primitives=n,this._entityCollection=void 0,this._addedObjects=new Ut,this._removedObjects=new Ut,this._changedObjects=new Ut;let r,o=Dn.NUMBER_OF_SHADOW_MODES;for(this._colorBatches=new Array(o*3),this._materialBatches=new Array(o*3),r=0;r<o;++r)this._colorBatches[r]=new hh(n,js,void 0,!1,r),this._materialBatches[r]=new mh(n,lc,void 0,!1,r),this._colorBatches[r+o]=new hh(n,js,js,!1,r),this._materialBatches[r+o]=new mh(n,lc,js,!1,r),this._colorBatches[r+o*2]=new hh(n,js,lc,!1,r),this._materialBatches[r+o*2]=new mh(n,lc,lc,!1,r);this._dynamicBatch=new cE(n,i);let s=ei.NUMBER_OF_CLASSIFICATION_TYPES;for(this._groundBatches=new Array(s),r=0;r<s;++r)this._groundBatches[r]=new U3(i,r);this._batches=this._colorBatches.concat(this._materialBatches,this._dynamicBatch,this._groundBatches),this._subscriptions=new Ut,this._updaters=new Ut,this._entityCollection=t,t.collectionChanged.addEventListener(g0.prototype._onCollectionChanged,this),this._onCollectionChanged(t,t.values,Hxt)}g0.prototype.update=function(e){let t=this._addedObjects,n=t.values,i=this._removedObjects,r=i.values,o=this._changedObjects,s=o.values,a,c,u,f;for(a=s.length-1;a>-1;a--)c=s[a],u=c.id,f=this._updaters.get(u),f.entity===c?(Jwe(this,f),Zwe(this,e,f)):(r.push(c),n.push(c));for(a=r.length-1;a>-1;a--)c=r[a],u=c.id,f=this._updaters.get(u),Jwe(this,f),f.destroy(),this._updaters.remove(u),this._subscriptions.get(u)(),this._subscriptions.remove(u);for(a=n.length-1;a>-1;a--)c=n[a],u=c.id,f=new k3(c,this._scene),this._updaters.set(u,f),Zwe(this,e,f),this._subscriptions.set(u,f.geometryChanged.addEventListener(g0._onGeometryChanged,this));t.removeAll(),i.removeAll(),o.removeAll();let d=!0,p=this._batches,g=p.length;for(a=0;a<g;a++)d=p[a].update(e)&&d;return d};var Gxt=[],Wxt=new ue;g0.prototype.getBoundingSphere=function(e,t){let n=Gxt,i=Wxt,r=0,o,s=this._batches,a=s.length,c=this._updaters.get(e.id);for(let u=0;u<a;u++){if(o=s[u].getBoundingSphere(c,i),o===Pt.PENDING)return Pt.PENDING;o===Pt.DONE&&(n[r]=ue.clone(i,n[r]),r++)}return r===0?Pt.FAILED:(n.length=r,ue.fromBoundingSpheres(n,t),Pt.DONE)};g0.prototype.isDestroyed=function(){return!1};g0.prototype.destroy=function(){this._entityCollection.collectionChanged.removeEventListener(g0.prototype._onCollectionChanged,this),this._addedObjects.removeAll(),this._removedObjects.removeAll();let e,t=this._batches,n=t.length;for(e=0;e<n;e++)t[e].removeAllPrimitives();let i=this._subscriptions.values;for(n=i.length,e=0;e<n;e++)i[e]();return this._subscriptions.removeAll(),le(this)};g0._onGeometryChanged=function(e){let t=this._removedObjects,n=this._changedObjects,i=e.entity,r=i.id;!l(t.get(r))&&!l(n.get(r))&&n.set(r,i)};g0.prototype._onCollectionChanged=function(e,t,n){let i=this._addedObjects,r=this._removedObjects,o=this._changedObjects,s,a,c;for(s=n.length-1;s>-1;s--)c=n[s],a=c.id,i.remove(a)||(r.set(a,c),o.remove(a));for(s=t.length-1;s>-1;s--)c=t[s],a=c.id,r.remove(a)?o.set(a,c):i.set(a,c)};var z3=g0;function nf(e){ql.initializeTerrainHeights(),Jh.initializeTerrainHeights();let t=e.scene,n=e.dataSourceCollection;this._eventHelper=new Xo,this._eventHelper.add(n.dataSourceAdded,this._onDataSourceAdded,this),this._eventHelper.add(n.dataSourceRemoved,this._onDataSourceRemoved,this),this._eventHelper.add(n.dataSourceMoved,this._onDataSourceMoved,this),this._eventHelper.add(t.postRender,this._postRender,this),this._dataSourceCollection=n,this._scene=t,this._visualizersCallback=e.visualizersCallback??nf.defaultVisualizersCallback;let i=!1,r=new xl,o=new xl;n.length>0&&(t.primitives.add(r),t.groundPrimitives.add(o),i=!0),this._primitives=r,this._groundPrimitives=o;for(let u=0,f=n.length;u<f;u++)this._onDataSourceAdded(n,n.get(u));let s=new Fk;this._onDataSourceAdded(void 0,s),this._defaultDataSource=s;let a,c;if(!i){let u=this,f=function(){t.primitives.add(r),t.groundPrimitives.add(o),a(),c(),u._removeDefaultDataSourceListener=void 0,u._removeDataSourceCollectionListener=void 0};a=s.entities.collectionChanged.addEventListener(f),c=n.dataSourceAdded.addEventListener(f)}this._removeDefaultDataSourceListener=a,this._removeDataSourceCollectionListener=c,this._ready=!1}var AI=[];nf.registerVisualizer=function(e){AI.includes(e)||AI.push(e)};nf.unregisterVisualizer=function(e){if(AI.includes(e)){let t=AI.indexOf(e);AI.splice(t,1)}};nf.defaultVisualizersCallback=function(e,t,n){let i=n.entities;return[new RM(t,i),new S3(e,i,n._primitives,n._groundPrimitives),new w3(t,i),new P3(e,i),new Ek(e,i),new L3(t,i),new M3(e,i),new z3(e,i,n._primitives,n._groundPrimitives),...AI.map(r=>new r(e,i))]};Object.defineProperties(nf.prototype,{scene:{get:function(){return this._scene}},dataSources:{get:function(){return this._dataSourceCollection}},defaultDataSource:{get:function(){return this._defaultDataSource}},ready:{get:function(){return this._ready}}});nf.prototype.isDestroyed=function(){return!1};nf.prototype.destroy=function(){this._eventHelper.removeAll();let e=this._dataSourceCollection;for(let t=0,n=e.length;t<n;++t)this._onDataSourceRemoved(this._dataSourceCollection,e.get(t));return this._onDataSourceRemoved(void 0,this._defaultDataSource),l(this._removeDefaultDataSourceListener)?(this._removeDefaultDataSourceListener(),this._removeDataSourceCollectionListener()):(this._scene.primitives.remove(this._primitives),this._scene.groundPrimitives.remove(this._groundPrimitives)),le(this)};nf.prototype.update=function(e){if(!Mi.initialized)return this._ready=!1,!1;let t=!0,n,i,r,o,s=this._dataSourceCollection,a=s.length;for(n=0;n<a;n++){let c=s.get(n);for(l(c.update)&&(t=c.update(e)&&t),r=c._visualizers,o=r.length,i=0;i<o;i++)t=r[i].update(e)&&t}for(r=this._defaultDataSource._visualizers,o=r.length,i=0;i<o;i++)t=r[i].update(e)&&t;return!this._ready&&t&&this._scene.requestRender(),this._ready=this._ready||t,t};nf.prototype._postRender=function(){let e=this._scene.frameState,t=this._dataSourceCollection,n=t.length;for(let i=0;i<n;i++){let r=t.get(i),o=r.credit;l(o)&&e.creditDisplay.addCreditToNextFrame(o);let s=r._resourceCredits;if(l(s)){let a=s.length;for(let c=0;c<a;c++)e.creditDisplay.addCreditToNextFrame(s[c])}}};var qxt=[],Yxt=new ue;nf.prototype.getBoundingSphere=function(e,t,n){if(!this._ready)return Pt.PENDING;let i,r,o=this._defaultDataSource;if(!o.entities.contains(e)){o=void 0;let p=this._dataSourceCollection;for(r=p.length,i=0;i<r;i++){let g=p.get(i);if(g.entities.contains(e)){o=g;break}}}if(!l(o))return Pt.FAILED;let s=qxt,a=Yxt,c=0,u,f=o._visualizers,d=f.length;for(i=0;i<d;i++){let p=f[i];if(l(p.getBoundingSphere)){if(u=f[i].getBoundingSphere(e,a),!t&&u===Pt.PENDING)return Pt.PENDING;u===Pt.DONE&&(s[c]=ue.clone(a,s[c]),c++)}}return c===0?Pt.FAILED:(s.length=c,ue.fromBoundingSpheres(s,n),Pt.DONE)};nf.prototype._onDataSourceAdded=function(e,t){let n=this._scene,i=this._primitives,r=this._groundPrimitives,o=i.add(new xl),s=r.add(new Jk);t._primitives=o,t._groundPrimitives=s;let a=t.clustering;a._initialize(n),o.add(a),t._visualizers=this._visualizersCallback(n,a,t)};nf.prototype._onDataSourceRemoved=function(e,t){let n=this._primitives,i=this._groundPrimitives,r=t._primitives,o=t._groundPrimitives,s=t.clustering;r.remove(s);let a=t._visualizers,c=a.length;for(let u=0;u<c;u++)a[u].destroy();n.remove(r),i.remove(o),t._visualizers=void 0};nf.prototype._onDataSourceMoved=function(e,t,n){let i=this._primitives,r=this._groundPrimitives,o=e._primitives,s=e._groundPrimitives;t===n+1?(i.raise(o),r.raise(s)):t===n-1?(i.lower(o),r.lower(s)):t===0?(i.lowerToBottom(o),r.lowerToBottom(s),i.raise(o),r.raise(s)):(i.raiseToTop(o),r.raiseToTop(s))};var V3=nf;function Ate(e,t,n){this.heading=e??0,this.pitch=t??0,this.range=n??0}Ate.clone=function(e,t){if(l(e))return l(t)||(t=new Ate),t.heading=e.heading,t.pitch=e.pitch,t.range=e.range,t};var ph=Ate;var Qwe=new $,eIe=new $,tIe=new $,Xxt=new N,t5=new h,nIe=new h,bte=new h,xte=new h,iIe=new h,rIe=new h,Kxt=new Le,$xt=new h,Jxt=new $,bI=new K,Zxt=1.25;function Qxt(e,t,n,i,r,o,s,a,c,u){let f=e.scene.mode,d=r.getValue(c,e._lastCartesian);if(l(d)){let p=!1,g=!1,m,y,A;if(f===re.SCENE3D){K.addSeconds(c,.001,bI);let I=r.getValue(bI,t5);if(l(I)||(K.addSeconds(c,-.001,bI),I=r.getValue(bI,t5),g=!0),l(I)){let R=At.computeFixedToIcrfMatrix(c,Qwe),O=At.computeFixedToIcrfMatrix(bI,eIe),L;!l(R)||!l(O)?(L=At.computeTemeToPseudoFixedMatrix(c,tIe),R=$.transpose(L,Qwe),O=At.computeTemeToPseudoFixedMatrix(bI,eIe),$.transpose(O,O)):L=$.transpose(R,tIe);let _=$.multiplyByVector(R,d,iIe),C=$.multiplyByVector(O,I,rIe);h.subtract(_,C,xte);let w=h.magnitude(xte)*1e3,P=D.GRAVITATIONALPARAMETER,M=-P/(w*w-2*P/h.magnitude(_));M<0||M>Zxt*u.maximumRadius?(m=nIe,h.normalize(d,m),h.negate(m,m),A=h.clone(h.UNIT_Z,bte),y=h.cross(A,m,t5),h.magnitude(y)>D.EPSILON7&&(h.normalize(m,m),h.normalize(y,y),A=h.cross(m,y,bte),h.normalize(A,A),p=!0)):h.equalsEpsilon(d,I,D.EPSILON7)||(A=nIe,h.normalize(_,A),h.normalize(C,C),y=h.cross(A,C,bte),g&&(y=h.multiplyByScalar(y,-1,y)),h.equalsEpsilon(y,h.ZERO,D.EPSILON7)||(m=h.cross(y,A,t5),$.multiplyByVector(L,m,m),$.multiplyByVector(L,y,y),$.multiplyByVector(L,A,A),h.normalize(m,m),h.normalize(y,y),h.normalize(A,A),p=!0))}}l(e.boundingSphere)&&(d=e.boundingSphere.center);let b,x,T;i&&(b=h.clone(t.position,xte),x=h.clone(t.direction,iIe),T=h.clone(t.up,rIe));let E=Xxt,v;l(s)&&(v=s.getValue(c,Kxt));let S=o.getValue(c,$xt);if(a===bg.INERTIAL&&l(v))N.fromTranslationQuaternionRotationScale(d,v,h.ONE,E);else if(a===bg.VELOCITY&&l(S)){let I=At.rotationMatrixFromPositionVelocity(d,S,u,Jxt);N.fromRotationTranslation(I,d,E)}else a===bg.ENU||!p?At.eastNorthUpToFixedFrame(d,u,E):(E[0]=m.x,E[1]=m.y,E[2]=m.z,E[3]=0,E[4]=y.x,E[5]=y.y,E[6]=y.z,E[7]=0,E[8]=A.x,E[9]=A.y,E[10]=A.z,E[11]=0,E[12]=d.x,E[13]=d.y,E[14]=d.z,E[15]=0);t._setTransform(E),i&&(h.clone(b,t.position),h.clone(x,t.direction),h.clone(T,t.up),h.cross(x,T,t.right))}if(n){let p=f===re.SCENE2D||h.equals(e._offset3D,h.ZERO)?void 0:e._offset3D;t.lookAtTransform(t.transform,p)}}function j3(e,t,n){this.entity=e,this.scene=t,this.ellipsoid=n??ee.default,this.boundingSphere=void 0,this._lastEntity=void 0,this._mode=void 0,this._lastCartesian=new h,this._defaultOffset3D=void 0,this._velocityProperty=new N_(e.position,!0),this._offset3D=new h}Object.defineProperties(j3,{defaultOffset3D:{get:function(){return this._defaultOffset3D},set:function(e){this._defaultOffset3D=h.clone(e,new h)}}});j3.defaultOffset3D=new h(-14e3,3500,3500);var n5=new ph,eTt=new h;j3.prototype.update=function(e,t){let n=this.scene,i=this.ellipsoid,r=n.mode;if(r===re.MORPHING)return;let o=this.entity,s=o.trackingReferenceFrame,a=o.position;if(!l(a))return;let c=this._velocityProperty,u=o.orientation,f=o!==this._lastEntity,d=r!==this._mode,p=n.camera,g=f||d,m=!0;if(f){let y=o.viewFrom,A=l(y);if(!A&&l(t)){n5.pitch=-D.PI_OVER_FOUR,n5.range=0;let b=a.getValue(e,eTt);if(l(b)){let x=2-1/Math.max(1,h.magnitude(b)/i.maximumRadius);n5.pitch*=x}p.viewBoundingSphere(t,n5),this.boundingSphere=t,g=!1,m=!1}else(!A||!l(y.getValue(e,this._offset3D)))&&h.clone(j3._defaultOffset3D,this._offset3D)}else!d&&this._mode!==re.SCENE2D&&h.clone(p.position,this._offset3D);this._lastEntity=o,this._mode=r,Qxt(this,p,g,m,a,c,u,s,e,i)};var H3=j3;_0();Ac();wE();M5();sU();var LPe={type:"module"},qte="error",VTt="messageerror",FPe,Wte,BPe,Yte=!0;try{Yte=typeof structuredClone==Bo&&structuredClone(new DOMException("","AbortError")).code!==Ue}catch{}MPe(jTt);function jTt(e,t){let{baseURI:n,chunkSize:i,workerStartupTimeout:r}=t,{wasmURI:o}=t;if(!e.interface){typeof o==Bo&&(o=o());let s;try{s=B5(e.workerURI,n,e)}catch{return Hte(e),Gte(e,t)}Object.assign(e,{worker:s,workerAlive:!1,terminated:!1,startupError:null,interface:{run:async()=>{try{return await HTt(e,{chunkSize:i,wasmURI:o,baseURI:n,workerStartupTimeout:r})}catch(a){if(a&&a.workerStartupFailed)return Hte(e),kPe(e),F5(e,t);if(a&&a.codecImportFailed){if(e.reader)return kPe(e),F5(e,t);e.onTaskFinished()}throw a}}}})}return e.interface}async function HTt(e,t){if(!e.worker){let{startupError:g}=e;e.startupError=null;let m=g||new Error(RE);throw m.workerStartupFailed=!0,m}let n,i,r=new Promise((g,m)=>{n=g,i=m});Object.assign(e,{reader:null,writer:null,resolveResult:n,rejectResult:i,result:r});let{readable:o,options:s}=e,{writable:a,closed:c,abortPipe:u}=GTt(e.writable),f;try{f=Xte({type:wPe,options:s,config:t,readable:o,writable:a},e)}catch(g){u();try{await c}catch{}throw e.onTaskFinished(),g}f||Object.assign(e,{reader:o.getReader(),writer:a.getWriter()});let{workerStartupTimeout:d}=t;!e.workerAlive&&Number.isFinite(d)&&d>=0&&(e.startupTimeout=setTimeout(()=>WTt(e),d));try{let g=await r;return await p(),await c,g}catch(g){await p(),u();try{await c}catch{}throw g}async function p(){if(!f&&!a.locked)try{await a.getWriter().close()}catch{}}}function GTt(e){let t=new AbortController,{writable:n,readable:i}=new null,r=i.pipeTo(e,{preventClose:!0,preventAbort:!0,signal:t.signal});return r.catch(()=>{}),{writable:n,closed:r,abortPipe:()=>t.abort()}}function kPe(e){let{reader:t}=e;t&&t.releaseLock(),e.reader=null,e.writer=null}function Kte(e){let{worker:t}=e;if(t)try{t.terminate()}catch{}e.interface=null}function B5(e,t,n,i,r=!0){let{createWorker:o}=n,s,a,c;if(o)s=o();else if(Wte===Ue||FPe!==e){let u=typeof e==Bo;u?a=e(r):a=e;let f=a.startsWith("data:"),d=a.startsWith("blob:");if(f||d){i===Ue&&(i=!1),i&&(c=LPe);try{s=new Worker(a,c)}catch(p){if(d)try{URL.revokeObjectURL(a)}catch{}if(u&&d)return B5(e,t,n,i,!1);if(i)throw p;return B5(e,t,n,!0,!1)}}else{i===Ue&&(i=!0),i&&(c=LPe);try{a=new URL(a,t)}catch{}try{s=new Worker(a,c)}catch(p){if(i)return B5(e,t,n,!1,r);throw p}}FPe=e,Wte=a,BPe=c}else s=new Worker(Wte,BPe);return s.addEventListener(SPe,u=>{n.workerAlive=!0,zPe(n),qTt(u,n)}),s.addEventListener(qte,u=>UPe(u,n)),s.addEventListener(VTt,u=>UPe(u,n)),s}function WTt(e){if(e.startupTimeout=null,e.workerAlive)return;let{rejectResult:t,writer:n}=e;if(Kte(e),e.worker=null,t){let i=new Error(RE);i.workerStartupFailed=!0,t(i),n&&n.releaseLock()}}function zPe(e){let{startupTimeout:t}=e;t&&(clearTimeout(t),e.startupTimeout=null)}function UPe(e,t){e.preventDefault&&e.preventDefault(),zPe(t);let{workerAlive:n,rejectResult:i,writer:r,onTaskFinished:o}=t;Kte(t),n||(t.worker=null);let s=e.error||new Error(e.message||qte);n||(s=Object.assign(new Error(s.message||qte),{workerStartupFailed:!0}),t.startupError=s),i&&(i(s),r&&r.releaseLock(),n&&o())}function Xte(e,{worker:t,writer:n,transferStreams:i,workerAlive:r}){try{let{value:o,readable:s,writable:a}=e,c=[];if(o&&(e.value=g5(o),c.push(e.value.buffer)),i&&Yte&&r?(s&&c.push(s),a&&c.push(a)):e.readable=e.writable=null,c.length)try{return t.postMessage(e,c),!0}catch{Yte=!1,e.readable=e.writable=null,t.postMessage(e)}else t.postMessage(e)}catch(o){throw n&&n.releaseLock(),o}}async function qTt({data:e},t){let{type:n,value:i,messageId:r,result:o,error:s}=e,{reader:a,writer:c,resolveResult:u,rejectResult:f,onTaskFinished:d,generation:p}=t,g=()=>t.generation!=p;try{if(s){let{message:y,stack:A,code:b,name:x,outputSize:T,cause:E,codecImportFailed:v}=s,S=new Error(y);Object.assign(S,{stack:A,code:b,name:x,outputSize:T}),E&&(S.cause=Object.assign(new Error(E.message),{name:E.name})),v&&(S.codecImportFailed=!0),m(S)}else{if(n==IPe){let{value:y,done:A}=await a.read();g()||Xte({type:Ute,value:y,done:A,messageId:r},t)}n==Ute&&(await c.ready,await c.write(new Uint8Array(i)),g()||Xte({type:PPe,messageId:r},t)),n==DPe&&m(null,o)}}catch(y){g()||(Kte(t),m(y))}function m(y,A){g()||(y?f(y):u(A),c&&c.releaseLock(),y&&y.codecImportFailed||d())}}gie();Ac();_0();PE();sU();V5();q5();Pte();wE();DI();Ene();W3();var Iie="File already exists",Pie="Zip file comment exceeds 64KB",zDe="Invalid zip file comment (must be a Uint8Array)",VDe="File entry comment exceeds 64KB",jDe="Invalid file entry comment (must be a string)",HDe="Invalid date (must be a valid Date instance)",GDe="File entry name exceeds 64KB",Die="Version exceeds 65535",WDe="The strength must equal 1, 2, or 3",qDe="Encryption is not supported in USDZ files",YDe="Encryption is not supported when the 'passThrough' option is set",XDe="Invalid extra field (must be a Map)",KDe="Invalid extra field type (must be integer 0..65535)",$De="Invalid extra field data (must be a Uint8Array)",T9="Extra field data exceeds 64KB",fCt="Compression method not supported",JDe=-2147483648,ZDe=2147483647,DDe=BigInt(0),RDe=BigInt("0x7fffffffffffffff"),E9="Zip64 is not supported (set the 'zip64' option to 'true')",QDe="Undefined uncompressed size",e1e="Undefined compression method";var t1e="Undefined reader",n1e="Zip file not empty",i1e="Invalid uid (must be integer 0..2^32-1)",r1e="Invalid gid (must be integer 0..2^32-1)",o1e="Invalid UNIX mode (must be integer 0..65535)",s1e="Invalid unixExtraFieldType (must be 'infozip' or 'unix')",a1e="uid/gid must be 0..65535 for unixExtraFieldType 'unix' (use 'infozip' for larger ids)",c1e="Invalid msdosAttributesRaw (must be integer 0..255)",l1e="Invalid msdosAttributes (must be an object with boolean flags)",u1e="Invalid level (must be integer 0..9)",f1e="Signature data exceeds 64KB",ODe=new Uint8Array([7,0,2,0,65,69,3,0,0]),dCt=4,hCt=9,mCt=67,pCt=1,Eie="infozip",Cie="unix",gCt=9,_ie=0,MDe=[],TU=class{constructor(t,n={}){t=new VI(t);let{availableSize:i=CE,maxSize:r=CE}=t,o=i>0&&i!==CE&&r>0&&r!==CE;Object.assign(this,{writer:t,addSplitZipSignature:o,options:n,fileEntries:new Map,filenames:new Set,offset:n[G3]===Ue?t.size||t.writable.size||0:n[G3],initialOffset:n[G3]===Ue?0:n[G3]-(t.size||t.writable.size||0),pendingAddFileCalls:new Set,pendingErrors:[],bufferedWrites:0,lastFileEntry:Ue})}prependZip(t){return yie(this,_Ct(this,t))}appendZip(t){return yie(this,this.appendZipEntries(t))}async appendZipEntries(t){let n=this,{pendingAddFileCalls:i,filenames:r,fileEntries:o}=n;for(;i.size;)await Promise.allSettled(Array.from(i));let s,a=new Promise(f=>s=f);i.add(a);let c=[],u;try{t=new W_(t),await Uc(t),(t.size===Ue||!t.readUint8Array)&&(t=new of(await b0(t.readable)),await Uc(t));let{ZipReader:f}=await Promise.resolve().then(()=>(gie(),SDe)),d=new f(t),p=await d.getEntries();await d.close(),await Uc(n.writer);let{directoryOffset:g}=d;p.forEach(({filename:A})=>{if(r.has(A))throw new Error(Iie);r.add(A),c.push(A)}),n.writerLocked=!0;let{lockWriter:m}=n;n.lockWriter=new Promise(A=>u=()=>{n.writerLocked=!1,A()}),await m,n.addSplitZipSignature&&(delete n.addSplitZipSignature,await FCt(t)||(await v0(n.writer,h1e()),n.offset+=4));let y=await BCt(n,t,p,g);p.forEach(A=>{let{version:b,rawLastModDate:x,rawFilename:T,bitFlag:E,encrypted:v,uncompressedSize:S,compressedSize:I,extraFieldZip64:R}=A,{compressionMethod:O,rawExtraField:L}=A,{level:_,languageEncodingFlag:C,dataDescriptor:w}=E;L=d1e(L||gr),A.extraFieldAES&&(O=99);let P=or(L),M=!!R&&R.uncompressedSize!==Ue,F=!!R&&R.compressedSize!==Ue,V=y1e(_,C,w,v,O)&-7|_<<1,{headerArray:B,headerView:j}=_1e({version:b,bitFlag:V,compressionMethod:O,uncompressedSize:S,compressedSize:I,rawLastModDate:x,rawFilename:T,zip64CompressedSize:F,zip64UncompressedSize:M,extraFieldLength:P}),{crc32:k}=A;k!==Ue&&zc(j,10,k);let{offset:G,diskNumberStart:q}=y.get(A);Object.assign(A,{zip64UncompressedSize:M,zip64CompressedSize:F,offset:G,diskNumberStart:q,zip64DiskNumberStart:!1,rawExtraFieldZip64:gr,rawExtraFieldAES:gr,rawExtraFieldExtendedTimestamp:gr,rawExtraFieldNTFS:gr,rawExtraFieldUnix:gr,rawExtraField:L,rawCentralExtraField:gr,extendedTimestamp:!1,headerArray:B,headerView:j}),o.set(A.filename,A)})}catch(f){throw c.forEach(d=>r.delete(d)),f}finally{s(),i.delete(a),u&&u()}}add(t="",n,i={}){let r=this,{pendingAddFileCalls:o}=r,s=yCt(r,t,n,i);o.add(s);let a=()=>o.delete(s);return Promise.prototype.then.call(s,a,a),yie(r,s)}remove(t){let{filenames:n,fileEntries:i}=this;if(typeof t==vE&&(t=i.get(t)),t&&t.filename!==Ue){let{filename:r}=t;if(n.has(r)&&i.has(r))return n.delete(r),i.delete(r),!0}return!1}async close(t=gr,n={}){let i=this,{pendingAddFileCalls:r,writer:o}=this,{writable:s}=o;if(!(t instanceof Uint8Array))throw new Error(zDe);if(or(t)>65535)throw new Error(Pie);for(;r.size;)await Promise.allSettled(Array.from(r));await Promise.allSettled(i.pendingErrors.map(u=>u.recorded));let a=i.pendingErrors.filter(u=>u.error&&!u.observed);if(a.length){let u=a.map(d=>d.error);a.forEach(d=>d.observed=!0);let[f]=u;try{f.entryErrors=u}catch{}throw f}return await RCt(i,t,n),!W5(o)&&$i(i,n,u5)||await s.getWriter().close(),o.getData?o.getData():s}};var vie=class extends Promise{then(t,n){let{watcher:i}=this;return i&&(i.observed=!0),super.then(t,n)}};function yie(e,t){let n=new vie((r,o)=>Promise.prototype.then.call(t,r,o)),i={};return n.watcher=i,i.recorded=Promise.prototype.then.call(n,Ue,r=>i.error=r),e.pendingErrors.push(i),n}async function _Ct(e,t){if(e.filenames.size)throw new Error(n1e);await e.appendZipEntries(t)}async function yCt(e,t,n,i){if(i=Object.assign({},i),$i(e,i,ME)&&!t.endsWith("/")&&(t+="/"),e.filenames.has(t))throw new Error(Iie);e.filenames.add(t),_ie<j_().maxWorkers?_ie++:await new Promise(r=>MDe.push(r));try{return await ACt(e,t,n,i)}catch(r){throw e.filenames.delete(t),r}finally{let r=MDe.shift();r?r():_ie--}}async function ACt(e,t,n,i){let r=bCt(e,t,i);({name:t}=r);let o=xCt(e,t,i),{comment:s}=o,a=i[J5];e.fileEntries.set(t,Ue);let c=e.lastFileEntry,u={},f;o.resolvedOptions.keepOrder&&(u.lockFileEntry=new Promise(p=>f=p)),e.lastFileEntry=u;let d;try{let{resolvedOptions:p}=o;p.level!=0&&p.compressionMethod===Ue&&!p.passThrough&&!await NPe(j_())&&(p.level=0);let g=await TCt(e,n,o,i);({reader:n}=g);let m=EU(e.writer),y=X_(e.writer);i=Object.assign({},i,r.resolvedOptions,o.resolvedOptions,g.resolvedOptions,{signature:i[$5],crc32:i.crc32===Ue?i[$5]:i.crc32,offset:e.offset-m,diskNumberStart:y,[TI]:e.options[TI]});let A=SCt(i),b=ICt(i),x=or(A.localHeaderArray,b.dataDescriptorArray);d=await CCt(e,t,n,{headerInfo:A,dataDescriptorInfo:b,metadataSize:x,fileEntry:u,previousFileEntry:c,releaseLockFileEntry:f},i)}catch(p){throw e.fileEntries.delete(t),p}finally{f&&f(c&&c.lockFileEntry)}return Object.assign(d,{name:t,comment:s,extraField:a,[Y5]:d.internalFileAttributes,[X5]:d.externalFileAttributes}),new db(d)}function bCt(e,t,n){let i=$i(e,n,dne),r=$i(e,n,pne,i?20:768),o=$i(e,n,_ne),s=ZI(e,n,"uid"),a=ZI(e,n,"gid"),c=ZI(e,n,Ane),u=$i(e,n,OIe),f=$i(e,n,bne),d=$i(e,n,xne),p=$i(e,n,Tne);if(CI(s,4294967295,i1e),CI(a,4294967295,r1e),CI(c,65535,o1e),u!==Ue&&u!==Eie&&u!==Cie)throw new Error(s1e);if(u===Cie&&(s!==Ue&&s>65535||a!==Ue&&a>65535))throw new Error(a1e);u===Ue&&(s!==Ue||a!==Ue)&&(u=Eie);let g=ZI(e,n,une),m=$i(e,n,fne),y=s!==Ue||a!==Ue||c!==Ue||u||o,A=g!==Ue||m!==Ue;if(y?(i=!1,r=r&255|768):A&&(i=!0,r=r&255),CI(g,255,c1e),m&&(typeof m!==oIe||Array.isArray(m)))throw new Error(l1e);if(r>65535)throw new Error(Die);let b=g1e(e,n,lne,X5),x=b!==Ue;x||(b=0),!n[ME]&&t.endsWith("/")&&(n[ME]=!0);let T=$i(e,n,ME);if(T?(t.endsWith("/")||(t+="/"),x||(b=16,i||(b|=16877<<16))):!i&&!x&&(o?b=493<<16:b=420<<16),!i){let S=c!==Ue||!!(f||d||p),I=b>>16&65535;c=c===Ue?I:c&65535,f?c|=2048:f=!!(c&2048),d?c|=1024:d=!!(c&1024),p?c|=512:p=!!(c&512),(!x||S)&&(T?c=c&-61441|16384:c&61440||(c|=32768),b=(c&65535)<<16|b&65535)}({msdosAttributesRaw:g,msdosAttributes:m}=wCt(g,m)),A&&(b=b&4294967295|g&255);let E=b>>16&65535,v=c!==Ue&&(c&61440)==40960;return{name:t,resolvedOptions:{versionMadeBy:r,msDosCompatible:!!i,externalFileAttributes:b,unixExternalUpper:E,uid:s,gid:a,unixMode:c,unixExtraFieldType:u,symlink:v,setuid:f,setgid:d,sticky:p,msdosAttributesRaw:g,msdosAttributes:m}}}function xCt(e,t,n){let i=Sie(e,n,RIe)||SI,r=i(t,f5);if(r===Ue&&(r=SI(t)),or(r)>65535)throw new Error(GDe);let o=n[fU]||"";if(typeof o!=vE)throw new Error(jDe);let s=i(o,d5);if(s===Ue&&(s=SI(o)),or(s)>65535)throw new Error(VDe);let a=$i(e,n,mne);if(a!==Ue&&a>65535)throw new Error(Die);let c=Tie(e,n,jI,new Date),u=$i(e,n,HI),f=Tie(e,n,hU),d=Tie(e,n,mU),p=g1e(e,n,cne,Y5,0),g=$i(e,n,o5),m=$i(e,n,i5),y=$i(e,n,r5);p5(m,y);let A=ZI(e,n,xIe,3),b=$i(e,n,gne),x=$i(e,n,TIe,!0),T=$i(e,n,EIe),E=$i(e,n,CIe,!0),v=$i(e,n,a5),S=$i(e,n,l5),I=$i(e,n,SIe),R=Sie(e,n,wIe),O=$i(e,n,IIe,!0),L=m5($i(e,n,s5)),_=$i(e,n,PIe,!0),C=$i(e,n,yne),w=g||C===Ue?Ue:v5(C);if(!g&&C!==Ue&&C!==0&&C!==8&&!w)throw new Error(fCt);let P=ZI(e,n,vIe);if(CI(P,gCt,u1e),e.options[TI]){if(m!==Ue||y!==Ue)throw new Error(qDe);P===Ue&&C===Ue&&(P=0)}g&&(P=Ue);let M=$i(e,n,c5),F=$i(e,n,Ete);I&&F===Ue&&(F=!1),(F===Ue||b&&!g)&&(F=!0),P!==Ue&&P!=6&&(M=!1);let V=$i(e,n,K5);if(!b&&(m!==Ue||y!==Ue)&&!(Number.isInteger(A)&&A>=1&&A<=3))throw new Error(WDe);let B=Aie(n[J5]),j=Aie(n[MIe]),k=Aie(n[NIe]);return{comment:o,resolvedOptions:{rawFilename:r,rawComment:s,version:a,lastModDate:c,rawLastModDate:u,lastAccessDate:f,creationDate:d,internalFileAttributes:p,passThrough:g,password:m,rawPassword:y,encryptionStrength:A,zipCrypto:b,extendedTimestamp:x,ntfsTimestamp:T,keepOrder:E,useWebWorkers:v,transferStreams:S,bufferedWrite:I,createTempStream:R,dataDescriptorSignature:O,signal:L,useUnicodeFileNames:_,compressionMethod:C,format:w?w.format:Ue,codecURI:w?w.codecURI:Ue,codecVersionNeeded:w?w.versionNeeded:Ue,level:P,useCompressionStream:M,dataDescriptor:F,zip64:V,rawExtraField:B,rawLocalExtraField:j,rawCentralExtraField:k}}}function Aie(e){if(!e)return gr;if(!(e instanceof Map))throw new Error(XDe);let t=0,n=0;e.forEach((o,s)=>{if(Ste(s,65535,KDe),!(o instanceof Uint8Array))throw new Error($De);if(or(o)>65535)throw new Error(T9);t+=4+or(o)});let i=new Uint8Array(t),r=di(i);return e.forEach((o,s)=>{C0(r,n,s),C0(r,n+2,or(o)),SU(i,o,n+4),n+=4+or(o)}),i}async function TCt(e,t,{resolvedOptions:n},i){if(n.passThrough&&!t&&!$i(e,i,ME))throw new Error(t1e);let r;return t&&(t=new W_(t),await Uc(t),{size:r}=t),Object.assign({reader:t},ECt(e,!!t,r,n,i))}function ECt(e,t,n,i,r){let{passThrough:o,zipCrypto:s,password:a,rawPassword:c,encryptionStrength:u}=i,{dataDescriptor:f,zip64:d,level:p,compressionMethod:g}=i,m=0,y=0;if(o&&t){if(y=r[dU],y===Ue)throw new Error(QDe);if(g===Ue)throw new Error(e1e)}let A=d===!0,b=$i(e,r,hne);if(t&&o&&!b&&or(a,c))throw new Error(YDe);let x=t&&(!!(a&&or(a)||c&&or(c))||o&&b);t||(p=0,g=0);let T=x?s?12:16+u*4:0;t&&(o?(r.uncompressedSize=y,m=n===Ue?UDe(y)+T:n):n===Ue?(f=!0,(d||d===Ue)&&(d=!0,y=m=4294967296)):(r.uncompressedSize=y=n,m=(wie(g,p)?UDe(y):y)+T));let E=!x&&(!t||n===0&&!o)&&!wie(g,p);E&&!s&&$i(e,r,Ete)===Ue&&(f=!1);let v=A||y>=4294967295,S=A||m>=4294967295;if(v||S){if(d===!1)throw new Error(E9);d=!0}return d=d||!1,{maximumCompressedSize:m,resolvedOptions:{dataDescriptor:f,emptyEntry:E,zip64:d,zip64UncompressedSize:v,zip64CompressedSize:S,uncompressedSize:y,level:p,compressionMethod:g,encrypted:x}}}async function CCt(e,t,n,i,r){let{fileEntries:o,writer:s}=e,{keepOrder:a,dataDescriptor:c,emptyEntry:u,signal:f}=r,{headerInfo:d,fileEntry:p,previousFileEntry:g,releaseLockFileEntry:m}=i,y=e.options[TI],A=p,b,x,T,E,v,S=0,I,R=a&&g?g.lockFileEntry:Ue;o.set(t,A);try{r.bufferedWrite||!a||e.writerLocked||e.bufferedWrites||!c&&!u?(b=!0,e.bufferedWrites++,r.createTempStream?I=await r.createTempStream():I=new null(Ue,Ue,{highWaterMark:CE}),I.size=0,await Uc(s)):(I=s,await R,await O()),await Uc(I);let _=EU(s);e.addSplitZipSignature&&!b&&await FDe(e,s),y&&!b&&NDe(i,e.offset-_);let{localHeaderArray:C}=d;b||await L();let w=X_(s),P=CU(e,s);if(A.diskNumberStart=w,b||(E=!0,v=s.size,await v0(I,C)),A=await vCt(n,I,A,i,j_(),r),b||(E=!1),o.set(t,A),A.filename=t,b){if(await Promise.all([I.writable.getWriter().close(),R]),await O(),e.addSplitZipSignature&&await FDe(e,s),T=!0,v=s.size,await L(),A.diskNumberStart=X_(s),A.offset=CU(e,s),y){let M=i.metadataSize;NDe(i,e.offset-EU(s)),A.size+=i.metadataSize-M}DCt(A,d.localHeaderView,r),await v0(s,d.localHeaderArray),await m1e(I.readable,s,f,M=>S+=M),s.size+=I.size,T=!1}else A.diskNumberStart=w,A.offset=P;return e.offset+=A.size,A}catch(_){if(T||E){if(e.hasCorruptedEntries=!0,_)try{_.corruptedEntry=!0}catch{}e.offset+=s.size-v,b&&(e.offset+=S)}throw o.delete(t),_}finally{if(b&&e.bufferedWrites--,m&&m(R),x&&x(),b&&I&&I.dispose)try{await I.dispose()}catch{}}async function O(){e.writerLocked=!0;let{lockWriter:_}=e;e.lockWriter=new Promise(C=>x=()=>{e.writerLocked=!1,C()}),await _}async function L(){QI(s,or(d.localHeaderArray))&&await s.closeDisk()}}async function vCt(e,t,{diskNumberStart:n,lockFileEntry:i},r,o,s){let{headerInfo:a,dataDescriptorInfo:c,metadataSize:u}=r,{headerArray:f,headerView:d,lastModDate:p,rawLastModDate:g,encrypted:m,compressed:y,version:A,compressionMethod:b,rawExtraFieldZip64:x,localExtraFieldZip64Length:T,rawExtraFieldExtendedTimestamp:E,extraFieldExtendedTimestampFlag:v,rawExtraFieldNTFS:S,rawExtraFieldUnix:I,rawExtraFieldAES:R}=a,{dataDescriptorArray:O}=c,{rawFilename:L,lastAccessDate:_,creationDate:C,password:w,rawPassword:P,level:M,zip64:F,zip64UncompressedSize:V,zip64CompressedSize:B,zipCrypto:j,dataDescriptor:k,directory:G,executable:q,versionMadeBy:Q,rawComment:W,rawExtraField:J,rawCentralExtraField:Z,useWebWorkers:ae,transferStreams:Ae,onstart:fe,onprogress:xe,onend:ge,signal:we,encryptionStrength:Se,extendedTimestamp:Re,msDosCompatible:Qe,internalFileAttributes:He,externalFileAttributes:Xe,uid:$e,gid:Pe,unixMode:qe,symlink:st,setuid:vt,setgid:Gt,sticky:lt,unixExternalUpper:mt,msdosAttributesRaw:ft,msdosAttributes:Xt,useCompressionStream:rt,passThrough:ht,format:Bi,codecURI:Xn}=s,bi={lockFileEntry:i,versionMadeBy:Q,zip64:F,directory:!!G,executable:!!q,filenameUTF8:!0,rawFilename:L,commentUTF8:!0,rawComment:W,rawExtraFieldZip64:x,localExtraFieldZip64Length:T,rawExtraFieldExtendedTimestamp:E,rawExtraFieldNTFS:S,rawExtraFieldUnix:I,rawExtraFieldAES:R,rawExtraField:J,rawCentralExtraField:Z,extendedTimestamp:Re,msDosCompatible:Qe,internalFileAttributes:He,externalFileAttributes:Xe,diskNumberStart:n,uid:$e,gid:Pe,unixMode:qe,symlink:!!st,setuid:vt,setgid:Gt,sticky:lt,unixExternalUpper:mt,msdosAttributesRaw:ft,msdosAttributes:Xt},{crc32:Wi,uncompressedSize:wi}=s,hi=0;ht||(wi=0);let{writable:xi}=t;if(e){let jn=qm(Qte(e)),nn=e.size,Wn={options:{codecType:LI,inputSize:nn,level:M,rawPassword:P,password:w,encryptionStrength:Se,zipCrypto:m&&j,passwordVerification:m&&j&&g>>8&255,computeCrc32:!ht,compressed:y&&!ht,encrypted:m&&!ht,useWebWorkers:ae,useCompressionStream:rt,transferStreams:Ae,format:Bi,codecURI:Xn,compressionMethod:b},config:o,streamOptions:{signal:we,size:nn,onstart:fe,onprogress:xe,onend:ge}};try{let Zi=await z5({readable:jn,writable:xi},Wn);if(hi=Zi.outputSize,t.size+=hi,ht||(wi=Zi.inputSize,(!m||j)&&(Wi=Zi.crc32)),!B&&hi>=4294967295||!V&&wi>=4294967295)throw new Error(E9)}catch(Zi){throw Zi.outputSize!==Ue&&(t.size+=Zi.outputSize),Zi}}return PCt({crc32:Wi,compressedSize:hi,uncompressedSize:wi,headerInfo:a,dataDescriptorInfo:c},s),k&&await v0(t,O),Object.assign(bi,{uncompressedSize:wi,compressedSize:hi,lastModDate:p,rawLastModDate:g,creationDate:C,lastAccessDate:_,encrypted:!!m,zipCrypto:!!j,size:u+hi,compressionMethod:b,version:A,headerArray:f,headerView:d,signature:Wi,crc32:m&&!j&&!ht?Ue:Wi,extraFieldExtendedTimestampFlag:v,zip64UncompressedSize:V,zip64CompressedSize:B}),bi}function SCt(e){let{rawFilename:t,lastModDate:n,rawLastModDate:i,lastAccessDate:r,creationDate:o,level:s,zip64:a,zipCrypto:c,useUnicodeFileNames:u,dataDescriptor:f,directory:d,rawExtraField:p,rawLocalExtraField:g,encryptionStrength:m,extendedTimestamp:y,ntfsTimestamp:A,passThrough:b,encrypted:x,zip64UncompressedSize:T,zip64CompressedSize:E,uncompressedSize:v,crc32:S}=e,{version:I,compressionMethod:R}=e,O=!d&&wie(R,s),L,_=b||!O,C=a&&(e.bufferedWrite||!f||!T&&!E||_),w=C||a&&f&&(T||E);if(a&&(T||E)){let ge=od(20);if(ge.writeUint16(1),ge.writeUint16(16),L=ge.array,C&&(ge.writeUint64(v),_)){let we=x?c?12:16+m*4:0;ge.writeUint64(b?0:v+we)}}else L=gr;let P;if(x&&!c){let xe=od(or(ODe)+2);xe.writeUint16(39169),xe.writeBytes(ODe),P=xe.array,P[8]=m}else P=gr;let M,F,V;if(y){let xe=A9(n),ge=p1e(xe);if(ge){let Se=9+(r?4:0)+(o?4:0),Re=od(Se);V=1+(r?2:0)+(o?4:0),Re.writeUint16(21589),Re.writeUint16(Se-4),Re.writeUint8(V),Re.writeUint32(xe),r&&Re.writeUint32(BDe(A9(r))),o&&Re.writeUint32(BDe(A9(o))),F=Re.array}else F=gr;if(A===Ue?!ge||!!(r||o):A)try{let Se=xie(n),Re=od(36);Re.writeUint16(10),Re.writeUint16(32),Re.skip(4),Re.writeUint16(1),Re.writeUint16(24),Re.writeUint64(Se),Re.writeUint64(r?xie(r):Se),Re.writeUint64(o?xie(o):Se),M=Re.array}catch{M=gr}else M=gr}else M=F=gr;let B;try{let{uid:xe,gid:ge,unixExtraFieldType:we}=e;if(we==Eie&&(xe!==Ue||ge!==Ue)){let Se=LDe(xe===Ue?0:xe),Re=LDe(ge===Ue?0:ge),Qe=3+Se.length+Re.length,He=od(4+Qe);He.writeUint16(30837),He.writeUint16(Qe),He.writeUint8(1),He.writeUint8(Se.length),He.writeBytes(Se),He.writeUint8(Re.length),He.writeBytes(Re),B=He.array}else if(we==Cie&&(xe!==Ue||ge!==Ue)){let Se=od(8);Se.writeUint16(30805),Se.writeUint16(4),Se.writeUint16((xe===Ue?0:xe)&65535),Se.writeUint16((ge===Ue?0:ge)&65535),B=Se.array}else B=gr}catch{B=gr}R===Ue&&(R=O?8:0),I===Ue&&(I=R==0&&!d&&!x?10:20);let{codecVersionNeeded:j}=e;O&&j!==Ue&&(I=I>j?I:j),a&&(I=I>45?I:45),x&&!c&&(I=I>51?I:51,b&&S!==Ue&&(P[dCt]=pCt),C0(di(P),hCt,R),R=99);let k=w?or(L):0,G=k+or(P,F,M,B,p,g),q=e[TI]?mCt:0;if(G+q>65535)throw new Error(T9);let Q=new Date(Math.ceil(Math.floor(n.getTime()/1e3)/2)*2e3),{headerArray:W,headerView:J,rawLastModDate:Z}=_1e({version:I,bitFlag:y1e(s,u,f,x,R),compressionMethod:R,uncompressedSize:v,lastModDate:Q<xI?xI:Q>Tte?Tte:Q,rawLastModDate:i,rawFilename:t,zip64CompressedSize:E,zip64UncompressedSize:T,extraFieldLength:G}),ae=od(30+or(t)+G),Ae=ae.array,fe=di(Ae);return ae.writeUint32(67324752),ae.writeBytes(W),ae.writeBytes(t),w&&ae.writeBytes(L),ae.writeBytes(P),ae.writeBytes(F),ae.writeBytes(M),ae.writeBytes(B),ae.writeBytes(p),ae.writeBytes(g),f&&(E||zc(fe,18,0),T||zc(fe,22,0)),{localHeaderArray:Ae,localHeaderView:fe,headerArray:W,headerView:J,lastModDate:n,rawLastModDate:Z,encrypted:x,compressed:O,version:I,compressionMethod:R,extraFieldExtendedTimestampFlag:V,rawExtraFieldZip64:gr,localExtraFieldZip64Length:k,rawExtraFieldExtendedTimestamp:F,rawExtraFieldNTFS:M,rawExtraFieldUnix:B,rawExtraFieldAES:P,extraFieldLength:G}}function NDe(e,t){let{headerInfo:n}=e,{localHeaderArray:i,extraFieldLength:r}=n,o=64-(t+or(i))%64;o<4&&(o+=64);let s=new Uint8Array(o),a=di(s);C0(a,0,6534),C0(a,2,o-4);let c=i;n.localHeaderArray=i=new Uint8Array(or(c)+o),SU(i,c),SU(i,s,or(c));let u=di(i);C0(u,28,r+o),n.localHeaderView=u,e.metadataSize+=o}function LDe(e){let t=new Uint8Array(4);di(t).setUint32(0,e,!0);let i=4;for(;i>1&&t[i-1]===0;)i--;return t.subarray(0,i)}function wCt(e,t){if(e!==Ue)e=e&255;else if(t!==Ue){let{readOnly:n,hidden:i,system:r,directory:o,archive:s}=t,a=0;n&&(a|=1),i&&(a|=2),r&&(a|=4),o&&(a|=16),s&&(a|=32),e=a&255}return t===Ue&&(t={readOnly:!!(e&1),hidden:!!(e&2),system:!!(e&4),directory:!!(e&16),archive:!!(e&32)}),{msdosAttributesRaw:e,msdosAttributes:t}}function ICt({zip64:e,dataDescriptor:t,dataDescriptorSignature:n}){let i=gr,r,o=0,s=e?20:12;return n&&(s+=4),t&&(i=new Uint8Array(s),r=di(i),n&&(o=4,zc(r,0,134695760))),{dataDescriptorArray:i,dataDescriptorView:r,dataDescriptorOffset:o}}function PCt({crc32:e,compressedSize:t,uncompressedSize:n,headerInfo:i,dataDescriptorInfo:r},{zip64:o,zipCrypto:s,passThrough:a,dataDescriptor:c}){let{headerView:u,encrypted:f}=i,{dataDescriptorView:d,dataDescriptorOffset:p}=r;(!f||s||a)&&e!==Ue&&(zc(u,10,e),c&&zc(d,p,e)),o?c&&(vU(d,p+4,BigInt(t)),vU(d,p+12,BigInt(n))):(zc(u,14,t),zc(u,18,n),c&&(zc(d,p+4,t),zc(d,p+8,n)))}function DCt({rawFilename:e,encrypted:t,zip64:n,localExtraFieldZip64Length:i,crc32:r,compressedSize:o,uncompressedSize:s,zip64UncompressedSize:a,zip64CompressedSize:c},u,{dataDescriptor:f,passThrough:d}){if(f||((!t||d&&r!==Ue)&&zc(u,14,r),c||zc(u,18,o),a||zc(u,22,s)),n&&i){let p=30+or(e)+4;vU(u,p,BigInt(s)),vU(u,p+8,BigInt(o))}}async function RCt(e,t,n){let i=OCt(e.fileEntries),{directoryStart:r,directoryEnd:o,directoryArray:s}=await MCt(e,i,n),a=await NCt(e,s,n);await LCt(e,t,n,{directoryStart:r,directoryEnd:o,directoryDataLength:i,signatureLength:a})}function OCt(e){let t=0;for(let[,n]of e){let{rawFilename:i,rawExtraFieldAES:r,rawComment:o,rawExtraFieldNTFS:s,rawExtraFieldUnix:a,rawExtraField:c,rawCentralExtraField:u,extendedTimestamp:f,extraFieldExtendedTimestampFlag:d,lastModDate:p,zip64UncompressedSize:g,zip64CompressedSize:m,uncompressedSize:y,compressedSize:A}=n,b=n.offset>=4294967295,x=n.diskNumberStart>=65535,T;if(b||x||g||m){let I=4+(g?8:0)+(m?8:0)+(b?8:0)+(x?4:0),R=od(I);R.writeUint16(1),R.writeUint16(I-4),g&&R.writeUint64(y),m&&R.writeUint64(A),b&&R.writeUint64(n.offset),x&&R.writeUint32(n.diskNumberStart),T=R.array}else T=gr;n.rawExtraFieldZip64=T,n.zip64Offset=b,n.zip64DiskNumberStart=x;let E,v=A9(p);if(f&&p1e(v)){let I=od(9);I.writeUint16(21589),I.writeUint16(5),I.writeUint8(d),I.writeUint32(v),E=I.array}else E=gr;n.rawExtraFieldExtendedTimestamp=E;let S=or(T,r,s,a,E,c,u);if(S>65535)throw new Error(T9);t+=46+or(i,o)+S}return t}async function MCt(e,t,n){let{fileEntries:i,writer:r}=e,o=new Uint8Array(t);await Uc(r);let s=0,a=0,c=X_(r),u=EU(r),f=0;for(let[d,p]of Array.from(i.values()).entries()){let{offset:g,rawFilename:m,rawExtraFieldZip64:y,rawExtraFieldAES:A,rawExtraFieldExtendedTimestamp:b,rawExtraFieldNTFS:x,rawExtraFieldUnix:T,rawExtraField:E,rawCentralExtraField:v,rawComment:S,versionMadeBy:I,headerArray:R,headerView:O,zip64UncompressedSize:L,zip64CompressedSize:_,zip64DiskNumberStart:C,zip64Offset:w,internalFileAttributes:P,externalFileAttributes:M,diskNumberStart:F,uncompressedSize:V,compressedSize:B}=p,j=or(y,A,b,x,T,E,v),k=46+or(m,S)+j;QI(r,s+k-a)&&(await v0(r,o.slice(a,s)),a=s,f=0,await r.closeDisk()),d==0&&(c=X_(r),u=EU(r)),L||zc(O,18,V),_||zc(O,14,B),(w||C)&&p.version<45&&C0(O,0,45);let G=od(k);if(G.writeUint32(33639248),G.writeUint16(I),G.writeBytes(R.subarray(0,24)),G.writeUint16(j),G.writeUint16(or(S)),G.writeUint16(C?65535:F),G.writeUint16(P),G.writeUint32(M),G.writeUint32(w?4294967295:g),G.writeBytes(m),G.writeBytes(y),G.writeBytes(A),G.writeBytes(b),G.writeBytes(x),G.writeBytes(T),G.writeBytes(E),G.writeBytes(v),G.writeBytes(S),SU(o,G.array,s),s+=k,f++,n.onprogress)try{await n.onprogress(d+1,i.size,new db(p))}catch{}}return await v0(r,a?o.slice(a):o),{directoryStart:{diskNumber:c,diskOffset:u},directoryEnd:{diskNumber:X_(r),entriesLength:f},directoryArray:o}}async function NCt(e,t,n){let i=Sie(e,n,UIe);if(i){let r=await i(t),o=or(r);if(o>65535)throw new Error(f1e);let s=od(6+o);s.writeUint32(84233040),s.writeUint16(o),s.writeBytes(r);let{writer:a}=e;return QI(a,or(s.array))&&await a.closeDisk(),await v0(a,s.array),6+o}return 0}async function LCt(e,t,n,i){let{writer:r}=e,{directoryStart:o,directoryEnd:s,signatureLength:a}=i,{directoryDataLength:c}=i,u=e.fileEntries.size,f=o.diskNumber,d=CU(e,o),p=or(t);if(p>65535)throw new Error(Pie);let g=$i(e,n,K5),m=X_(r);if(QI(r,(g?98:22)+p)&&m++,d>=4294967295||c>=4294967295||u>=65535||m>=65535){if(g===!1)throw new Error(E9);g=!0}let y=od(g?98:22);QI(r,or(y.array)+p)&&await r.closeDisk(),m=X_(r);let A=m==s.diskNumber?s.entriesLength:0;g&&(y.writeUint32(101075792),y.writeUint64(44),y.writeUint16(45),y.writeUint16(45),y.writeUint32(m),y.writeUint32(f),y.writeUint64(A),y.writeUint64(u),y.writeUint64(c),y.writeUint64(d),y.writeUint32(117853008),y.writeUint32(m),y.writeUint64(BigInt(CU(e,r))+BigInt(c)+BigInt(a)),y.writeUint32(m+1),$i(e,n,DIe,!0)&&(m=65535,f=65535),A=65535,u=65535,d=4294967295,c=4294967295),y.writeUint32(101010256),y.writeUint16(m),y.writeUint16(f),y.writeUint16(A),y.writeUint16(u),y.writeUint32(c),y.writeUint32(d),y.writeUint16(p),await v0(r,y.array),p&&await v0(r,t)}function od(e){let t=new Uint8Array(e),n=di(t),i=0;return{array:t,writeUint8:r=>{zCt(n,i,r),i+=1},writeUint16:r=>{C0(n,i,r),i+=2},writeUint32:r=>{zc(n,i,r),i+=4},writeUint64:r=>{vU(n,i,BigInt(r)),i+=8},writeBytes:r=>{SU(t,r,i),i+=or(r)},skip:r=>i+=r}}function X_(e){let{diskNumber:t=0}=e;return t}function EU(e){let{diskOffset:t=0}=e;return t}function QI(e,t){let{availableSize:n=CE}=e;return t>n}function CU(e,{diskNumber:t=0,diskOffset:n=0}){return e.offset-n-(t?e.initialOffset:0)}async function FCt(e){let t=await Uo(e,0,4);return UCt(di(t),0)==134695760}function d1e(e){let t=di(e),n=0;for(;n+4<=or(e);){let i=4+x9(t,n+2);if(x9(t,n)==1)return d1e(gh(e.subarray(0,n),e.subarray(Math.min(n+i,or(e)))));n+=i}return e}async function BCt(e,t,n,i){let{writer:r}=e,o=new Map;if(r.closeDisk){let s=Array.from(n).sort((c,u)=>y9(t,c)-y9(t,u)),a=0;for(let c of s){let u=y9(t,c);await bie(e,t,a,u-a),QI(r,await kCt(t,u))&&await r.closeDisk(),o.set(c,{offset:CU(e,r),diskNumberStart:X_(r)}),a=u}await bie(e,t,a,i-a)}else{let s=e.offset;await bie(e,t,0,i),n.forEach(a=>o.set(a,{offset:s+y9(t,a),diskNumberStart:0}))}return o}async function bie(e,t,n,i){if(i>0){let{writer:r}=e,o=0;try{await m1e(Qte(t,{offset:n,size:i}),r,Ue,s=>o+=s)}catch(s){e.hasCorruptedEntries=!0;try{s.corruptedEntry=!0}catch{}throw s}finally{r.size+=o,e.offset+=o}}}async function kCt(e,t){let n=await Uo(e,t,30);if(or(n)<30)return 30;let i=di(n);return 30+x9(i,26)+x9(i,28)}function y9(e,{offset:t,diskNumberStart:n}){return t+(e.getDiskOffset?e.getDiskOffset(n):0)}function h1e(){let e=new Uint8Array(4);return zc(di(e),0,134695760),e}async function FDe(e,t){delete e.addSplitZipSignature,await v0(t,h1e()),e.offset+=4}async function v0(e,t){let{writable:n}=e,i=n.getWriter();try{await i.ready,e.size+=or(t),await i.write(t)}finally{i.releaseLock()}}async function m1e(e,t,n,i){let r=t.writable.getWriter();try{await e.pipeTo(new WritableStream({async write(o){await r.ready,await r.write(o),i(or(o))}}),{preventClose:!0,preventAbort:!0,signal:n})}finally{r.releaseLock()}}function xie(e){if(e){let t=(BigInt(e.getTime())+BigInt(116444736e5))*BigInt(1e4);return t<DDe?DDe:t>RDe?RDe:t}}function A9(e){return Math.floor(e.getTime()/1e3)}function p1e(e){return e>=JDe&&e<=ZDe}function BDe(e){return Math.min(ZDe,Math.max(JDe,e))}function $i(e,t,n,i){let r=t[n]===Ue?e.options[n]:t[n];return r===Ue?i:r}function Tie(e,t,n,i){let r=$i(e,t,n,i);if(r===null)return i;if(r!==Ue&&(typeof r.getTime!=Bo||Number.isNaN(r.getTime())))throw new Error(HDe);return r}function Sie(e,t,n){return EI($i(e,t,n))}function g1e(e,t,n,i,r){let o=kDe(t,n,i),s=o===Ue?kDe(e.options,n,i):o;return s===Ue?r:s}function kDe(e,t,n){return e[t]===Ue?e[n]:e[t]}function ZI(e,t,n,i){return SE($i(e,t,n,i))}function UDe(e){return e+5*(Math.floor(e/16383)+1)}function wie(e,t){return e===Ue?t===Ue||t>0:e!==0}function x9(e,t){return e.getUint16(t,!0)}function UCt(e,t){return e.getUint32(t,!0)}function zCt(e,t,n){e.setUint8(t,n)}function C0(e,t,n){e.setUint16(t,n,!0)}function zc(e,t,n){e.setUint32(t,n,!0)}function vU(e,t,n){e.setBigUint64(t,n,!0)}function SU(e,t,n){e.set(t,n)}function or(...e){let t=0;return e.forEach(n=>n&&(t+=n.length)),t}function _1e({version:e,bitFlag:t,compressionMethod:n,uncompressedSize:i,compressedSize:r,lastModDate:o,rawLastModDate:s,rawFilename:a,zip64CompressedSize:c,zip64UncompressedSize:u,extraFieldLength:f}){let d=od(26),p=d.array,g=di(p);if(d.writeUint16(e),d.writeUint16(t),d.writeUint16(n),s===Ue){let m=new Uint32Array(1),y=di(m);C0(y,0,(o.getHours()<<6|o.getMinutes())<<5|o.getSeconds()/2),C0(y,2,(o.getFullYear()-1980<<4|o.getMonth()+1)<<5|o.getDate()),s=m[0]}return d.writeUint32(s),d.skip(4),c||r!==Ue?d.writeUint32(c?4294967295:r):d.skip(4),u||i!==Ue?d.writeUint32(u?4294967295:i):d.skip(4),d.writeUint16(or(a)),d.writeUint16(f),{headerArray:p,headerView:g,rawLastModDate:s}}function y1e(e,t,n,i,r){let o=0;return t&&(o=o|2048),n&&(o=o|8),(r==8||r==9)&&(e>=0&&e<=3&&(o=o|6),e>3&&e<=5&&(o=o|4),e==9&&(o=o|2)),i&&(o=o|1),o}q5();W3();_0();PE();Ac();_0();PE();kte();var UBi=1024*1024;DI();var jBi=1024*1024;var GBi=1024*1024;var WBi=512*1024;var jCt={};try{vI({baseURI:jCt.url})}catch{}_0();var HCt=[3,4,5,6,7,8,9,10,11,13,15,17,19,23,27,31,35,43,51,59,67,83,99,115,131,163,195,227,258],GCt=[0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0],WCt=[1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577],qCt=[0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13],YCt=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15],IU=new Uint8Array(288);IU.fill(8,0,144),IU.fill(9,144,256),IU.fill(7,256,280),IU.fill(8,280,288);var XCt=new Uint8Array(30).fill(5);function wU(e){let t=new Uint16Array(16);for(let r of e)t[r]++;t[0]=0;let n=new Uint16Array(17);for(let r=1;r<=15;r++)n[r+1]=n[r]+t[r];let i=new Uint16Array(e.length);for(let r=0;r<e.length;r++)e[r]&&(i[n[e[r]]++]=r);return{l:t,symbols:i}}var sd="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";function A1e(e){let t;e({wasmURI:()=>(t||(t="data:application/wasm;base64,"+(function(n){let i="",r=n.length,o=0;for(;o+2<r;o+=3){let a=n[o]<<16|n[o+1]<<8|n[o+2];i+=sd[a>>18&63]+sd[a>>12&63]+sd[a>>6&63]+sd[63&a]}let s=r-o;if(s===1){let a=n[o]<<16;i+=sd[a>>18&63]+sd[a>>12&63]+"=="}else if(s===2){let a=n[o]<<16|n[o+1]<<8;i+=sd[a>>18&63]+sd[a>>12&63]+sd[a>>6&63]+"="}return i})((function(n){let i=0,r=0,o=0,s=new Uint8Array(1024),a=0,c=0;for(;!c;){c=f(1);let A=f(2);if(A==0)d();else if(A==1)p(wU(IU),wU(XCt));else{if(A!=2)throw new Error("invalid deflate block type");p(...g())}}return s.subarray(0,a);function u(){if(i>=n.length)throw new Error("unexpected end of deflate data");return n[i++]}function f(A){for(;o<A;)r|=u()<<o,o+=8;let b=r&(1<<A)-1;return r>>>=A,o-=A,b}function d(){r=0,o=0;let A=u()|u()<<8;i+=2,y(a+A);for(let b=0;b<A;b++)s[a++]=u()}function p(A,b){let x=m(A);for(;x!=256;){if(x<256)y(a+1),s[a++]=x;else{let T=x-257,E=HCt[T]+f(GCt[T]),v=m(b),S=WCt[v]+f(qCt[v]);y(a+E);let I=a-S;for(let R=0;R<E;R++)s[a++]=s[I+R]}x=m(A)}}function g(){let A=f(5)+257,b=f(5)+1,x=f(4)+4,T=new Uint8Array(19);for(let I=0;I<x;I++)T[YCt[I]]=f(3);let E=wU(T),v=new Uint8Array(A+b),S=0;for(;S<v.length;){let I=m(E);if(I<16)v[S++]=I;else if(I==16){let R=v[S-1],O=f(2)+3;for(;O--;)v[S++]=R}else S+=I==17?f(3)+3:f(7)+11}return[wU(v.subarray(0,A)),wU(v.subarray(A))]}function m(A){let{l:b,symbols:x}=A,T=0,E=0,v=0;for(let S=1;S<=15;S++){T|=f(1);let I=b[S];if(T-E<I)return x[v+(T-E)];v+=I,E=E+I<<1,T<<=1}throw new Error("invalid huffman code")}function y(A){if(s.length<A){let b=2*s.length;for(;b<A;)b*=2;let x=new Uint8Array(b);x.set(s.subarray(0,a)),s=x}}})((function(n){let i=(n=String(n).replace(/[^A-Za-z0-9+/=]/g,"")).length,r=[];for(let o=0;o<i;o+=4){let s=sd.indexOf(n[o])<<18|sd.indexOf(n[o+1])<<12|(63&sd.indexOf(n[o+2]))<<6|63&sd.indexOf(n[o+3]);r.push(s>>16&255),n[o+2]!=="="&&r.push(s>>8&255),n[o+3]!=="="&&r.push(255&s)}return new Uint8Array(r)})("zb19kF3XcSd2vu7He/fdmTvAABzigUTfK0gaSxiBkqghRarWc2jODIcgBCXRH/6DVSQEDkXcBwJ8M08Q5ZX5hp+mbUnLcqlcjEsbY72qWOVIFVWFu6GztEXb9Fq70Wa5iVKljVUp1WYrqz82tXJKteVKKUT46z73fQwGIEhq7XAKfOd+ndOnT5/uPn26+6jT249qpZS+t/OgGQ718EGN/5nhUD1oh+GGFNWDSj2o9PDBeMj/6eGDyXBUdEN+RT+hh/YTd8baGe2SRCudqpbGf0qpVGltrLa2FWUqUq7tXNtEURRp5axyShkXWxfpx3S7HcVaP2WeMnGqh9pf+u0oS37DHY4f3Xz0wtYXjOqcPf/wudODzY8/cH7z8yq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YNaUAvqRnWjOqQOqa7qqsPqsLpJ3aRW1Ip6p/23Adc7u/6eDH9Phb+nw98z4e/Z8PfCz6H/eke/Otlu017TznPqOfVr6tfU8+p59evq19VvqN9Qv6l+U31JfUl9WX1ZfUV9RdFdSu2kSmmt1M1aqVml1KU1pVRL+nezknvc13Bvv1IqUf7SXHZSNj/H/8yuf3bXP7frXzT1z7+wL9vcXdXuT5vX4/AvCf/S8K8V/rXDvyz864R/Of/zr+7P3tNUnzQTZ26fSpNW3I4y17G5mdGzyv/1/uzRhNt2KuV/iserUGkox6zVp+EdUGOLYSn4flPGKEmZ3iwrjTJKRisnZaONVkVL+R/PZy06oQWr/x8=")))),t)})}Ac();_0();sU();V5();var S9="deflate",C9="deflate-raw",b1e="deflate64-raw",v9="gzip",Ms,eP,K_,PU,x1e;function T1e(e){if(Ms=e,{malloc:eP,free:K_,memory:PU}=Ms,typeof eP!="function"||typeof K_!="function"||!PU)throw Ms=eP=K_=PU=null,new Error("Invalid WASM module")}function E1e(e){x1e=e}function C1e(e,t,n={}){if(!Ms){let a=new Error("WASM module not loaded");throw a.cause=x1e,a}let i=typeof n.level=="number"?n.level:-1,r=typeof n.outBuffer=="number"?n.outBuffer:64*1024,o=typeof n.inBufferSize=="number"?n.inBufferSize:64*1024;return new null({start(){try{let a;if(this.out=eP(r),this.in=eP(o),this.inBufferSize=o,!this.out||!this.in)throw new Error("allocation failed");if(this._scratch=new Uint8Array(r),e?(this._process=Ms.deflate_process,this._last_consumed=Ms.deflate_last_consumed,this._end=Ms.deflate_end,this.streamHandle=Ms.deflate_new(),t===v9?a=Ms.deflate_init_gzip(this.streamHandle,i):t===C9?a=Ms.deflate_init_raw(this.streamHandle,i):a=Ms.deflate_init(this.streamHandle,i)):t===b1e?(this._process=Ms.inflate9_process,this._last_consumed=Ms.inflate9_last_consumed,this._end=Ms.inflate9_end,this.streamHandle=Ms.inflate9_new(),a=Ms.inflate9_init_raw(this.streamHandle)):(this._process=Ms.inflate_process,this._last_consumed=Ms.inflate_last_consumed,this._end=Ms.inflate_end,this.streamHandle=Ms.inflate_new(),t===C9?a=Ms.inflate_init_raw(this.streamHandle):t===v9?a=Ms.inflate_init_gzip(this.streamHandle):a=Ms.inflate_init(this.streamHandle)),a!==0)throw new Error("init failed:"+a)}catch(a){throw s(this),a}},transform(a,c){try{let u=a,f=new Uint8Array(PU.buffer),d=this._process,p=this._last_consumed,g=this.out,m=this._scratch,y=0;for(;y<u.length;){let A=Math.min(u.length-y,32768);if((!this.in||this.inBufferSize<A)&&(this.in&&K_&&(K_(this.in),this.in=0),this.in=eP(A),this.inBufferSize=A,!this.in))throw new Error("allocation failed");f.set(u.subarray(y,y+A),this.in);let b=d(this.streamHandle,this.in,A,g,r,0),x=b&16777215;if(x&&(m.set(f.subarray(g,g+x),0),c.enqueue(m.slice(0,x))),!e){let E=b>>24&255,v=E&128?E-256:E;if(v<0)throw new Error("process error:"+v)}let T=p(this.streamHandle);if(T===0)break;y+=T}}catch(u){s(this),c.error(u)}},flush(a){try{let c=new Uint8Array(PU.buffer),u=this._process,f=this.out,d=this._scratch;for(;;){let p=u(this.streamHandle,0,0,f,r,4),g=p&16777215,m=p>>24&255;if(!e){let y=m&128?m-256:m;if(y<0)throw new Error("process error:"+y)}if(g&&(d.set(c.subarray(f,f+g),0),a.enqueue(d.slice(0,g))),m===1||g===0)break}}catch(c){a.error(c)}finally{let c=s(this);c!==0&&a.error(new Error("end error:"+c))}},cancel(){s(this)}});function s(a){let c=0;return a.streamHandle&&a._end&&(c=a._end(a.streamHandle)),a.streamHandle=0,a.in&&K_&&K_(a.in),a.in=0,a.out&&K_&&K_(a.out),a.out=0,c}}var zE=class{constructor(t=S9,n){return C1e(!0,t,n)}},VE=class{constructor(t=S9,n){return C1e(!1,t,n)}};zE.requiresModule=!0;VE.requiresModule=!0;zE.supportedFormats=[S9,C9,v9];VE.supportedFormats=[S9,C9,v9,b1e];var v1e=!1;async function S1e(e,{baseURI:t}){if(!v1e)try{await KCt(e,t),v1e=!0}catch(n){throw E1e(n),n}}async function KCt(e,t){let n,i;try{try{i=new URL(e,t)}catch{}n=await(await fetch(i)).arrayBuffer()}catch(o){if(e.startsWith("data:application/wasm;base64,"))n=$Ct(e);else throw o}let r=await WebAssembly.instantiate(n);T1e(r.instance.exports)}function $Ct(e){let t=e.split(",")[1],n=atob(t),i=n.length,r=new Uint8Array(i);for(let o=0;o<i;++o)r[o]=n.charCodeAt(o);return r.buffer}var w9;OPe({initModule:e=>{if(!w9){let{wasmURI:t}=e;typeof t==Bo&&(t=t()),w9=S1e(t,e).catch(n=>{throw w9=null,n})}return w9}});vI({CompressionStreamFallback:zE,DecompressionStreamFallback:VE});A1e(vI);var Rie=32,JCt="http://www.opengis.net/kml/2.2",Km="http://www.google.com/kml/ext/2.2",ZCt="http://www.w3.org/2000/xmlns/";function I9(e){this._files={},this._promises=[],this._count=0,this._modelCallback=e}var QCt=/^data:image\/([^,;]+)/;I9.prototype.texture=function(e){let t=this,n;if(typeof e=="string"||e instanceof De){if(e=De.createIfNeeded(e),!e.isDataUri)return e.url;let i=e.url.match(QCt);n=`texture_${++this._count}`,l(i)&&(n+=`.${i[1]}`);let r=e.fetchBlob().then(function(o){t._files[n]=o});return this._promises.push(r),n}if(e instanceof HTMLCanvasElement){n=`texture_${++this._count}.png`;let i=new Promise(r=>{e.toBlob(function(o){t._files[n]=o,r()})});return this._promises.push(i),n}return""};function evt(e,t){return function(n){e._files[t]=n}}I9.prototype.model=function(e,t){let n=this._modelCallback;if(!l(n))throw new oe("Encountered a model entity while exporting to KML, but no model callback was supplied.");let i={},r=n(e,t,i);for(let o in i)if(i.hasOwnProperty(o)){let s=Promise.resolve(i[o]);this._promises.push(s),s.then(evt(this,o))}return r};Object.defineProperties(I9.prototype,{promise:{get:function(){return Promise.all(this._promises)}},files:{get:function(){return this._files}}});function P9(e){this._time=e}P9.prototype.get=function(e,t,n){let i;return l(e)&&(i=l(e.getValue)?e.getValue(this._time,n):e),i??t};P9.prototype.getColor=function(e,t){let n=this.get(e,t);if(l(n))return HE(n)};P9.prototype.getMaterialType=function(e){if(l(e))return e.getType(this._time)};function Oie(){this._ids={},this._styles={},this._count=0}Oie.prototype.get=function(e){let t=this._ids,n=e.innerHTML;if(l(t[n]))return t[n];let i=`style-${++this._count}`;return e.setAttribute("id",i),i=`#${i}`,t[n]=i,this._styles[n]=e,i};Oie.prototype.save=function(e){let t=this._styles,n=e.childNodes[0];for(let i in t)t.hasOwnProperty(i)&&e.insertBefore(t[i],n)};function P1e(){this._ids={}}P1e.prototype.get=function(e){if(!l(e))return this.get(Kn());let t=this._ids;return l(t[e])?`${e.toString()}-${++t[e]}`:(t[e]=0,e)};function Mie(e){e=e??H.EMPTY_OBJECT;let t=e.entities,n=e.kmz??!1,i=Mie._createState(e),r=t.values.filter(function(u){return!l(u.parent)}),o=i.kmlDoc,s=o.documentElement;s.setAttributeNS(ZCt,"xmlns:gx",Km);let a=o.createElement("Document");s.appendChild(a),R1e(i,a,r),i.styleCache.save(a);let c=i.externalFileHandler;return c.promise.then(function(){let f=new XMLSerializer().serializeToString(i.kmlDoc);return n?tvt(f,c.files):{kml:f,externalFiles:c.files}})}async function tvt(e,t){let n=Zt("ThirdParty/Workers/zip-web-worker.js"),i=Zt("ThirdParty/zip-module.wasm");Y3({workerURI:n,wasmURI:i});let r=new zI("application/vnd.google-earth.kmz"),o=new TU(r);await o.add("doc.kml",new lU(e));let s=Object.keys(t);return await D1e(o,s,t,0),await o.close(),{kmz:await r.getData()}}async function D1e(e,t,n,i){if(t.length===i)return;let r=t[i];return await e.add(r,new of(n[r])),D1e(e,t,n,i+1)}Mie._createState=function(e){let t=e.entities,n=new Oie,i=t.computeAvailability(),r=l(e.time)?e.time:i.start,o=e.defaultAvailability??i,s=e.sampleDuration??60;o.start===nt.MINIMUM_VALUE?o.stop===nt.MAXIMUM_VALUE?o=new En:K.addSeconds(o.stop,-10*s,o.start):o.stop===nt.MAXIMUM_VALUE&&K.addSeconds(o.start,10*s,o.stop);let a=new I9(e.modelCallback);return{kmlDoc:document.implementation.createDocument(JCt,"kml"),ellipsoid:e.ellipsoid??ee.default,idManager:new P1e,styleCache:n,externalFileHandler:a,time:r,valueGetter:new P9(r),sampleDuration:s,defaultAvailability:new Ps([o])}};function R1e(e,t,n){let i=e.kmlDoc,r=e.styleCache,o=e.valueGetter,s=e.idManager,a=n.length,c,u,f;for(let d=0;d<a;++d){let p=n[d];c=[],u=[],f=[],nvt(e,p,u,f),ivt(e,p.polyline,u,f),I1e(e,p.rectangle,u,f,c),I1e(e,p.polygon,u,f,c),avt(e,p,p.model,u,f);let g,m=p.availability;l(m)&&(g=i.createElement("TimeSpan"),K.equals(m.start,nt.MINIMUM_VALUE)||g.appendChild(vn(i,"begin",K.toIso8601(m.start))),K.equals(m.stop,nt.MAXIMUM_VALUE)||g.appendChild(vn(i,"end",K.toIso8601(m.stop))));for(let b=0;b<c.length;++b){let x=c[b];x.setAttribute("id",s.get(p.id)),x.appendChild(vn(i,"name",p.name)),x.appendChild(vn(i,"visibility",p.show)),x.appendChild(vn(i,"description",p.description)),l(g)&&x.appendChild(g),t.appendChild(x)}let y=u.length;if(y>0){let b=i.createElement("Placemark");b.setAttribute("id",s.get(p.id));let x=p.name,T=p.label;if(l(T)){let v=i.createElement("LabelStyle"),S=o.get(T.text);x=l(S)&&S.length>0?S:x;let I=o.getColor(T.fillColor);l(I)&&(v.appendChild(vn(i,"color",I)),v.appendChild(vn(i,"colorMode","normal")));let R=o.get(T.scale);l(R)&&v.appendChild(vn(i,"scale",R)),f.push(v)}b.appendChild(vn(i,"name",x)),b.appendChild(vn(i,"visibility",p.show)),b.appendChild(vn(i,"description",p.description)),l(g)&&b.appendChild(g),t.appendChild(b);let E=f.length;if(E>0){let v=i.createElement("Style");for(let S=0;S<E;++S)v.appendChild(f[S]);b.appendChild(vn(i,"styleUrl",r.get(v)))}if(u.length===1)b.appendChild(u[0]);else if(u.length>1){let v=i.createElement("MultiGeometry");for(let S=0;S<y;++S)v.appendChild(u[S]);b.appendChild(v)}}let A=p._children;if(A.length>0){let b=i.createElement("Folder");b.setAttribute("id",s.get(p.id)),b.appendChild(vn(i,"name",p.name)),b.appendChild(vn(i,"visibility",p.show)),b.appendChild(vn(i,"description",p.description)),t.appendChild(b),R1e(e,b,A)}}}var af=new h,gu=new he,Xm=new K;function nvt(e,t,n,i){let r=e.kmlDoc,o=e.ellipsoid,s=e.valueGetter,a=t.billboard??t.point;if(!l(a)&&!l(t.path))return;let c=t.position;if(!c.isConstant){O1e(e,t,a,n,i);return}s.get(c,void 0,af);let u=vn(r,"coordinates",jE(af,o)),f=r.createElement("Point"),d=r.createElement("altitudeMode");d.appendChild(GE(e,a.heightReference)),f.appendChild(d),f.appendChild(u),n.push(f);let p=a instanceof Zc?N1e(e,a):M1e(e,a);i.push(p)}function O1e(e,t,n,i,r){let o=e.kmlDoc,s=e.ellipsoid,a=e.valueGetter,c,u=t.position,f=!0;u instanceof pc?(c=u.intervals,f=!1):c=t.availability??e.defaultAvailability;let d=n instanceof Sg,p,g,m,y=[];for(p=0;p<c.length;++p){let b=c.get(p),x=f?u:b.data,T=o.createElement("altitudeMode");x instanceof m0?(x=x._value,T.appendChild(GE(e,We.CLAMP_TO_GROUND))):l(n)?T.appendChild(GE(e,n.heightReference)):T.appendChild(GE(e,We.NONE));let E=[],v=[];if(x.isConstant){a.get(x,void 0,af);let I=vn(o,"coordinates",jE(af,s));E.push(K.toIso8601(b.start)),v.push(I),E.push(K.toIso8601(b.stop)),v.push(I)}else if(x instanceof _c)for(m=x._property._times,g=0;g<m.length;++g)E.push(K.toIso8601(m[g])),x.getValueInReferenceFrame(m[g],ji.FIXED,af),v.push(jE(af,s));else if(x instanceof Qf){m=x._times;let I=x._values;for(g=0;g<m.length;++g)E.push(K.toIso8601(m[g])),h.fromArray(I,g*3,af),v.push(jE(af,s))}else{let I=e.sampleDuration;b.start.clone(Xm),b.isStartIncluded||K.addSeconds(Xm,I,Xm);let R=b.stop;for(;K.lessThan(Xm,R);)x.getValue(Xm,af),E.push(K.toIso8601(Xm)),v.push(jE(af,s)),K.addSeconds(Xm,I,Xm);b.isStopIncluded&&K.equals(Xm,R)&&(x.getValue(Xm,af),E.push(K.toIso8601(Xm)),v.push(jE(af,s)))}let S=o.createElementNS(Km,"Track");S.appendChild(T);for(let I=0;I<E.length;++I){let R=vn(o,"when",E[I]),O=vn(o,"coord",v[I],Km);S.appendChild(R),S.appendChild(O)}d&&S.appendChild(L1e(e,n)),y.push(S)}if(y.length===1)i.push(y[0]);else if(y.length>1){let b=o.createElementNS(Km,"MultiTrack");for(p=0;p<y.length;++p)b.appendChild(y[p]);i.push(b)}if(l(n)&&!d){let b=n instanceof Zc?N1e(e,n):M1e(e,n);r.push(b)}let A=t.path;if(l(A)){let b=a.get(A.width),x=A.material;if(l(x)||l(b)){let T=o.createElement("LineStyle");l(b)&&T.appendChild(vn(o,"width",b)),Nie(e,x,T),r.push(T)}}}function M1e(e,t){let n=e.kmlDoc,i=e.valueGetter,r=n.createElement("IconStyle"),o=i.getColor(t.color);l(o)&&(r.appendChild(vn(n,"color",o)),r.appendChild(vn(n,"colorMode","normal")));let s=i.get(t.pixelSize);return l(s)&&r.appendChild(vn(n,"scale",s/Rie)),r}function N1e(e,t){let n=e.kmlDoc,i=e.valueGetter,r=e.externalFileHandler,o=n.createElement("IconStyle"),s=i.get(t.image);if(l(s)){s=r.texture(s);let p=n.createElement("Icon");p.appendChild(vn(n,"href",s));let g=i.get(t.imageSubRegion);l(g)&&(p.appendChild(vn(n,"x",g.x,Km)),p.appendChild(vn(n,"y",g.y,Km)),p.appendChild(vn(n,"w",g.width,Km)),p.appendChild(vn(n,"h",g.height,Km))),o.appendChild(p)}let a=i.getColor(t.color);l(a)&&(o.appendChild(vn(n,"color",a)),o.appendChild(vn(n,"colorMode","normal")));let c=i.get(t.scale);l(c)&&o.appendChild(vn(n,"scale",c));let u=i.get(t.pixelOffset);if(l(u)){c=c??1,U.divideByScalar(u,c,u);let p=i.get(t.width,Rie),g=i.get(t.height,Rie),m=i.get(t.horizontalOrigin,zi.CENTER);m===zi.CENTER?u.x-=p*.5:m===zi.RIGHT&&(u.x-=p);let y=i.get(t.verticalOrigin,Gn.CENTER);y===Gn.TOP?u.y+=g:y===Gn.CENTER&&(u.y+=g*.5);let A=n.createElement("hotSpot");A.setAttribute("x",-u.x),A.setAttribute("y",u.y),A.setAttribute("xunits","pixels"),A.setAttribute("yunits","pixels"),o.appendChild(A)}let f=i.get(t.rotation),d=i.get(t.alignedAxis);return l(f)&&h.equals(h.UNIT_Z,d)&&(f=D.toDegrees(-f),f===0&&(f=360),o.appendChild(vn(n,"heading",f))),o}function ivt(e,t,n,i){let r=e.kmlDoc,o=e.ellipsoid,s=e.valueGetter;if(!l(t))return;let a=r.createElement("LineString"),c=r.createElement("altitudeMode"),u=s.get(t.clampToGround,!1),f;u?(a.appendChild(vn(r,"tessellate",!0)),f=r.createTextNode("clampToGround")):f=r.createTextNode("absolute"),c.appendChild(f),a.appendChild(c);let d=t.positions,p=s.get(d),g=vn(r,"coordinates",jE(p,o));a.appendChild(g);let m=s.get(t.zIndex);u&&l(m)&&a.appendChild(vn(r,"drawOrder",m,Km)),n.push(a);let y=r.createElement("LineStyle"),A=s.get(t.width);l(A)&&y.appendChild(vn(r,"width",A)),Nie(e,t.material,y),i.push(y)}function rvt(e,t,n){let i=e.kmlDoc,r=e.valueGetter,o=r.get(t.height,0);n>0&&(o=n);let s=t.coordinates,a=r.get(s),c=[],u=[ie.northeast,ie.southeast,ie.southwest,ie.northwest];for(let g=0;g<4;++g)u[g](a,gu),c.push(`${D.toDegrees(gu.longitude)},${D.toDegrees(gu.latitude)},${o}`);let f=vn(i,"coordinates",c.join(" ")),d=i.createElement("outerBoundaryIs"),p=i.createElement("LinearRing");return p.appendChild(f),d.appendChild(p),[d]}function w1e(e,t,n,i){let r=e.kmlDoc,o=e.ellipsoid,s=[],a=t.length;for(let f=0;f<a;++f)he.fromCartesian(t[f],o,gu),s.push(`${D.toDegrees(gu.longitude)},${D.toDegrees(gu.latitude)},${i?gu.height:n}`);let c=vn(r,"coordinates",s.join(" ")),u=r.createElement("LinearRing");return u.appendChild(c),u}function ovt(e,t,n){let i=e.kmlDoc,r=e.valueGetter,o=r.get(t.height,0),s=r.get(t.perPositionHeight,!1);!s&&n>0&&(o=n);let a=[],c=t.hierarchy,u=r.get(c),f=Array.isArray(u)?u:u.positions,d=i.createElement("outerBoundaryIs");d.appendChild(w1e(e,f,o,s)),a.push(d);let p=u.holes;if(l(p)){let g=p.length;for(let m=0;m<g;++m){let y=i.createElement("innerBoundaryIs");y.appendChild(w1e(e,p[m].positions,o,s)),a.push(y)}}return a}function I1e(e,t,n,i,r){let o=e.kmlDoc,s=e.valueGetter;if(!l(t))return;let a=t instanceof tm;if(a&&s.getMaterialType(t.material)==="Image"){svt(e,t,r);return}let c=o.createElement("Polygon"),u=s.get(t.extrudedHeight,0);u>0&&c.appendChild(vn(o,"extrude",!0));let f=a?rvt(e,t,u):ovt(e,t,u),d=f.length;for(let A=0;A<d;++A)c.appendChild(f[A]);let p=o.createElement("altitudeMode");p.appendChild(GE(e,t.heightReference)),c.appendChild(p),n.push(c);let g=o.createElement("PolyStyle"),m=s.get(t.fill,!1);m&&g.appendChild(vn(o,"fill",m)),Nie(e,t.material,g);let y=s.get(t.outline,!1);if(y){g.appendChild(vn(o,"outline",y));let A=o.createElement("LineStyle"),b=s.get(t.outlineWidth,1);A.appendChild(vn(o,"width",b));let x=s.getColor(t.outlineColor,z.BLACK);A.appendChild(vn(o,"color",x)),A.appendChild(vn(o,"colorMode","normal")),i.push(A)}i.push(g)}function svt(e,t,n){let i=e.kmlDoc,r=e.valueGetter,o=e.externalFileHandler,s=i.createElement("GroundOverlay"),a=i.createElement("altitudeMode");a.appendChild(GE(e,t.heightReference)),s.appendChild(a);let c=r.get(t.height);l(c)&&s.appendChild(vn(i,"altitude",c));let u=r.get(t.coordinates),f=i.createElement("LatLonBox");f.appendChild(vn(i,"north",D.toDegrees(u.north))),f.appendChild(vn(i,"south",D.toDegrees(u.south))),f.appendChild(vn(i,"east",D.toDegrees(u.east))),f.appendChild(vn(i,"west",D.toDegrees(u.west))),s.appendChild(f);let d=r.get(t.material),p=o.texture(d.image),g=i.createElement("Icon");g.appendChild(vn(i,"href",p)),s.appendChild(g);let m=d.color;l(m)&&s.appendChild(vn(i,"color",HE(d.color))),n.push(s)}function L1e(e,t){let n=e.kmlDoc,i=e.valueGetter,r=e.externalFileHandler,o=n.createElement("Model"),s=i.get(t.scale);if(l(s)){let u=n.createElement("scale");u.appendChild(vn(n,"x",s)),u.appendChild(vn(n,"y",s)),u.appendChild(vn(n,"z",s)),o.appendChild(u)}let a=n.createElement("Link"),c=r.model(t,e.time);return a.appendChild(vn(n,"href",c)),o.appendChild(a),o}function avt(e,t,n,i,r){let o=e.kmlDoc,s=e.ellipsoid,a=e.valueGetter;if(!l(n))return;let c=t.position;if(!c.isConstant){O1e(e,t,n,i,r);return}let u=L1e(e,n),f=o.createElement("altitudeMode");f.appendChild(GE(e,n.heightReference)),u.appendChild(f),a.get(c,void 0,af),he.fromCartesian(af,s,gu);let d=o.createElement("Location");d.appendChild(vn(o,"longitude",D.toDegrees(gu.longitude))),d.appendChild(vn(o,"latitude",D.toDegrees(gu.latitude))),d.appendChild(vn(o,"altitude",gu.height)),u.appendChild(d),i.push(u)}function Nie(e,t,n){let i=e.kmlDoc,r=e.valueGetter;if(!l(t))return;let o=r.get(t);if(!l(o))return;let s,a=r.getMaterialType(t),c,u;switch(a){case"Image":s=HE(z.WHITE);break;case"Color":case"Grid":case"PolylineGlow":case"PolylineArrow":case"PolylineDash":s=HE(o.color);break;case"PolylineOutline":s=HE(o.color),c=HE(o.outlineColor),u=o.outlineWidth,n.appendChild(vn(i,"outerColor",c,Km)),n.appendChild(vn(i,"outerWidth",u,Km));break;case"Stripe":s=HE(o.oddColor);break}l(s)&&(n.appendChild(vn(i,"color",s)),n.appendChild(vn(i,"colorMode","normal")))}function GE(e,t){let n=e.kmlDoc,r=e.valueGetter.get(t,We.NONE),o;switch(r){case We.NONE:o=n.createTextNode("absolute");break;case We.CLAMP_TO_GROUND:o=n.createTextNode("clampToGround");break;case We.RELATIVE_TO_GROUND:o=n.createTextNode("relativeToGround");break}return o}function jE(e,t){Array.isArray(e)||(e=[e]);let n=e.length,i=[];for(let r=0;r<n;++r)he.fromCartesian(e[r],t,gu),i.push(`${D.toDegrees(gu.longitude)},${D.toDegrees(gu.latitude)},${gu.height}`);return i.join(" ")}function vn(e,t,n,i){n=n??"",typeof n=="boolean"&&(n=n?"1":"0");let r=l(i)?e.createElementNS(i,t):e.createElement(t),o=n==="string"&&n.indexOf("<")!==-1?e.createCDATASection(n):e.createTextNode(n);return r.appendChild(o),r}function HE(e){let t="",n=e.toBytes();for(let i=3;i>=0;--i)t+=n[i]<16?`0${n[i].toString(16)}`:n[i].toString(16);return t}var Lie=Mie;function RU(){this._cache={}}RU.prototype.fromColor=function(e,t){return D9(void 0,void 0,e,t,this._cache)};RU.prototype.fromUrl=function(e,t,n){return D9(e,void 0,t,n,this._cache)};RU.prototype.fromMakiIconId=function(e,t,n){return D9(Zt(`Assets/Textures/maki/${encodeURIComponent(e)}.png`),void 0,t,n,this._cache)};RU.prototype.fromText=function(e,t,n){return D9(void 0,e,t,n,this._cache)};var cvt=new z;function lvt(e,t,n){e.save(),e.scale(n/24,n/24),e.fillStyle=t.toCssColorString(),e.strokeStyle=t.brighten(.6,cvt).toCssColorString(),e.lineWidth=.846,e.beginPath(),e.moveTo(6.72,.422),e.lineTo(17.28,.422),e.bezierCurveTo(18.553,.422,19.577,1.758,19.577,3.415),e.lineTo(19.577,10.973),e.bezierCurveTo(19.577,12.63,18.553,13.966,17.282,13.966),e.lineTo(14.386,14.008),e.lineTo(11.826,23.578),e.lineTo(9.614,14.008),e.lineTo(6.719,13.965),e.bezierCurveTo(5.446,13.983,4.422,12.629,4.422,10.972),e.lineTo(4.422,3.416),e.bezierCurveTo(4.423,1.76,5.447,.423,6.718,.423),e.closePath(),e.fill(),e.stroke(),e.restore()}function F1e(e,t,n){let i=n/2.5,r=i,o=i;t.width>t.height?o=i*(t.height/t.width):t.width<t.height&&(r=i*(t.width/t.height));let s=Math.round((n-r)/2),a=Math.round(7/24*n-o/2);e.globalCompositeOperation="destination-out",e.drawImage(t,s-1,a,r,o),e.drawImage(t,s,a-1,r,o),e.drawImage(t,s+1,a,r,o),e.drawImage(t,s,a+1,r,o),e.globalCompositeOperation="destination-over",e.fillStyle=z.BLACK.toCssColorString(),e.fillRect(s-1,a-1,r+2,o+2),e.globalCompositeOperation="destination-out",e.drawImage(t,s,a,r,o),e.globalCompositeOperation="destination-over",e.fillStyle=z.WHITE.toCssColorString(),e.fillRect(s-1,a-2,r+2,o+2)}var DU=new Array(4);function D9(e,t,n,i,r){DU[0]=e,DU[1]=t,DU[2]=n,DU[3]=i;let o=JSON.stringify(DU),s=r[o];if(l(s))return s;let a=document.createElement("canvas");a.width=i,a.height=i;let c=a.getContext("2d");if(lvt(c,n,i),l(e)){let f=De.createIfNeeded(e).fetchImage().then(function(d){return F1e(c,d,i),r[o]=a,a});return r[o]=f,f}else if(l(t)){let u=MT(t,{font:`bold ${i}px sans-serif`});F1e(c,u,i)}return r[o]=a,a}var $_=RU;var U1e=Qo(k1e(),1);function O9(e){return h.fromDegrees(e[0],e[1],e[2])}var Fie={"urn:ogc:def:crs:OGC:1.3:CRS84":O9,"EPSG:4326":O9,"urn:ogc:def:crs:EPSG::4326":O9},z1e={},V1e={},Bie=48,kie,Uie=z.ROYALBLUE,zie=z.YELLOW,Vie=2,jie=z.fromBytes(255,255,0,100),Hie=!1,uvt={small:24,medium:48,large:64},fvt=["title","description","marker-size","marker-symbol","marker-color","stroke","stroke-opacity","stroke-width","fill","fill-opacity"];function j1e(e,t){let n="";for(let i in e)if(e.hasOwnProperty(i)){if(i===t||fvt.indexOf(i)!==-1)continue;let r=e[i];l(r)&&(typeof r=="object"?n+=`<tr><th>${i}</th><td>${j1e(r)}</td></tr>`:n+=`<tr><th>${i}</th><td>${r}</td></tr>`)}return n.length>0&&(n=`<table class="cesium-infoBox-defaultTable"><tbody>${n}</tbody></table>`),n}function dvt(e,t,n){let i;return function(r,o){return l(i)||(i=e(t,n)),i}}function hvt(e,t){return new nm(dvt(j1e,e,t),!0)}function M9(e,t,n){let i=e.id;if(!l(i)||e.type!=="Feature")i=Kn();else{let s=2,a=i;for(;l(t.getById(a));)a=`${i}_${s}`,s++;i=a}let r=t.getOrCreateEntity(i),o=e.properties;if(l(o)){r.properties=o;let s,a=o.title;if(l(a))r.name=a,s="title";else{let u=Number.MAX_VALUE;for(let f in o)if(o.hasOwnProperty(f)&&o[f]){let d=f.toLowerCase();if(u>1&&d==="title"){s=f;break}else u>2&&d==="name"?(u=2,s=f):u>3&&/title/i.test(f)?(u=3,s=f):u>4&&/name/i.test(f)&&(u=4,s=f)}l(s)&&(r.name=o[s])}let c=o.description;c!==null&&(r.description=l(c)?new ui(c):n(o,s))}return r}function Gie(e,t){let n=new Array(e.length);for(let i=0;i<e.length;i++)n[i]=t(e[i]);return n}var H1e={Feature:W1e,FeatureCollection:mvt,GeometryCollection:q1e,LineString:J1e,MultiLineString:Z1e,MultiPoint:K1e,MultiPolygon:tRe,Point:X1e,Polygon:eRe,Topology:nRe},G1e={GeometryCollection:q1e,LineString:J1e,MultiLineString:Z1e,MultiPoint:K1e,MultiPolygon:tRe,Point:X1e,Polygon:eRe,Topology:nRe};function W1e(e,t,n,i,r){if(t.geometry===null){M9(t,e._entityCollection,r.describe);return}if(!l(t.geometry))throw new oe("feature.geometry is required.");let o=t.geometry.type,s=G1e[o];if(!l(s))throw new oe(`Unknown geometry type: ${o}`);s(e,t,t.geometry,i,r)}function mvt(e,t,n,i,r){let o=t.features;for(let s=0,a=o.length;s<a;s++)W1e(e,o[s],void 0,i,r)}function q1e(e,t,n,i,r){let o=n.geometries;for(let s=0,a=o.length;s<a;s++){let c=o[s],u=c.type,f=G1e[u];if(!l(f))throw new oe(`Unknown geometry type: ${u}`);f(e,t,c,i,r)}}function Y1e(e,t,n,i,r){let o=r.markerSymbol,s=r.markerColor,a=r.markerSize,c=t.properties;if(l(c)){let g=c["marker-color"];l(g)&&(s=z.fromCssColorString(g)),a=uvt[c["marker-size"]]??a;let m=c["marker-symbol"];l(m)&&(o=m)}let u;l(o)?o.length===1?u=e._pinBuilder.fromText(o.toUpperCase(),s,a):u=e._pinBuilder.fromMakiIconId(o,s,a):u=e._pinBuilder.fromColor(s,a);let f=new Zc;f.verticalOrigin=new ui(Gn.BOTTOM),i.length===2&&r.clampToGround&&(f.heightReference=We.CLAMP_TO_GROUND);let d=M9(t,e._entityCollection,r.describe);d.billboard=f,d.position=new Xl(n(i));let p=Promise.resolve(u).then(function(g){f.image=new ui(g)}).catch(function(){f.image=new ui(e._pinBuilder.fromColor(s,a))});e._promises.push(p)}function X1e(e,t,n,i,r){Y1e(e,t,i,n.coordinates,r)}function K1e(e,t,n,i,r){let o=n.coordinates;for(let s=0;s<o.length;s++)Y1e(e,t,i,o[s],r)}function $1e(e,t,n,i,r){let o=r.strokeMaterialProperty,s=r.strokeWidthProperty,a=t.properties;if(l(a)){let f=a["stroke-width"];l(f)&&(s=new ui(f));let d,p=a.stroke;l(p)&&(d=z.fromCssColorString(p));let g=a["stroke-opacity"];l(g)&&g!==1&&(l(d)||(d=o.color.getValue().clone()),d.alpha=g),l(d)&&(o=new Kt(d))}let c=M9(t,e._entityCollection,r.describe),u=new el;c.polyline=u,u.clampToGround=r.clampToGround,u.material=o,u.width=s,u.positions=new ui(Gie(i,n)),u.arcType=ln.RHUMB}function J1e(e,t,n,i,r){$1e(e,t,i,n.coordinates,r)}function Z1e(e,t,n,i,r){let o=n.coordinates;for(let s=0;s<o.length;s++)$1e(e,t,i,o[s],r)}function Q1e(e,t,n,i,r){if(i.length===0||i[0].length===0)return;let o=r.strokeMaterialProperty.color,s=r.fillMaterialProperty,a=r.strokeWidthProperty,c=t.properties;if(l(c)){let g=c["stroke-width"];l(g)&&(a=new ui(g));let m,y=c.stroke;l(y)&&(m=z.fromCssColorString(y));let A=c["stroke-opacity"];l(A)&&A!==1&&(l(m)||(m=o.getValue().clone()),m.alpha=A),l(m)&&(o=new ui(m));let b,x=c.fill,T=s.color.getValue();l(x)&&(b=z.fromCssColorString(x),b.alpha=T.alpha),A=c["fill-opacity"],l(A)&&A!==T.alpha&&(l(b)||(b=T.clone()),b.alpha=A),l(b)&&(s=new Kt(b))}let u=new em;u.outline=new ui(!0),u.outlineColor=o,u.outlineWidth=a,u.material=s,u.arcType=ln.RHUMB;let f=[];for(let g=1,m=i.length;g<m;g++)f.push(new Oc(Gie(i[g],n)));let d=i[0];u.hierarchy=new ui(new Oc(Gie(d,n),f)),d[0].length>2?u.perPositionHeight=new ui(!0):r.clampToGround||(u.height=0);let p=M9(t,e._entityCollection,r.describe);p.polygon=u}function eRe(e,t,n,i,r){Q1e(e,t,i,n.coordinates,r)}function tRe(e,t,n,i,r){let o=n.coordinates;for(let s=0;s<o.length;s++)Q1e(e,t,i,o[s],r)}function nRe(e,t,n,i,r){for(let o in n.objects)if(n.objects.hasOwnProperty(o)){let s=U1e.feature(n,n.objects[o]),a=H1e[s.type];a(e,s,s,i,r)}}function pb(e){this._name=e,this._changed=new be,this._error=new be,this._isLoading=!1,this._loading=new be,this._entityCollection=new Ya(this),this._promises=[],this._pinBuilder=new $_,this._entityCluster=new $f,this._credit=void 0,this._resourceCredits=[]}pb.load=function(e,t){return new pb().load(e,t)};Object.defineProperties(pb,{markerSize:{get:function(){return Bie},set:function(e){Bie=e}},markerSymbol:{get:function(){return kie},set:function(e){kie=e}},markerColor:{get:function(){return Uie},set:function(e){Uie=e}},stroke:{get:function(){return zie},set:function(e){zie=e}},strokeWidth:{get:function(){return Vie},set:function(e){Vie=e}},fill:{get:function(){return jie},set:function(e){jie=e}},clampToGround:{get:function(){return Hie},set:function(e){Hie=e}},crsNames:{get:function(){return Fie}},crsLinkHrefs:{get:function(){return z1e}},crsLinkTypes:{get:function(){return V1e}}});Object.defineProperties(pb.prototype,{name:{get:function(){return this._name},set:function(e){this._name!==e&&(this._name=e,this._changed.raiseEvent(this))}},clock:{value:void 0,writable:!1},entities:{get:function(){return this._entityCollection}},isLoading:{get:function(){return this._isLoading}},changedEvent:{get:function(){return this._changed}},errorEvent:{get:function(){return this._error}},loadingEvent:{get:function(){return this._loading}},show:{get:function(){return this._entityCollection.show},set:function(e){this._entityCollection.show=e}},clustering:{get:function(){return this._entityCluster},set:function(e){this._entityCluster=e}},credit:{get:function(){return this._credit}}});pb.prototype.load=function(e,t){return iRe(this,e,t,!0)};pb.prototype.process=function(e,t){return iRe(this,e,t,!1)};function iRe(e,t,n,i){Ds.setLoading(e,!0),n=n??H.EMPTY_OBJECT;let r=n.credit;typeof r=="string"&&(r=new It(r)),e._credit=r;let o=t,s=n.sourceUri;if(typeof t=="string"||t instanceof De){t=De.createIfNeeded(t),o=t.fetchJson(),s=s??t.getUrlComponent();let a=e._resourceCredits,c=t.credits;if(l(c)){let u=c.length;for(let f=0;f<u;f++)a.push(c[f])}}return n={describe:n.describe??hvt,markerSize:n.markerSize??Bie,markerSymbol:n.markerSymbol??kie,markerColor:n.markerColor??Uie,strokeWidthProperty:new ui(n.strokeWidth??Vie),strokeMaterialProperty:new Kt(n.stroke??zie),fillMaterialProperty:new Kt(n.fill??jie),clampToGround:n.clampToGround??Hie},Promise.resolve(o).then(function(a){return pvt(e,a,n,s,i)}).catch(function(a){throw Ds.setLoading(e,!1),e._error.raiseEvent(e,a),a})}pb.prototype.update=function(e){return!0};function pvt(e,t,n,i,r){let o;l(i)&&(o=I_(i)),l(o)&&e._name!==o&&(e._name=o,e._changed.raiseEvent(e));let s=H1e[t.type];if(!l(s))throw new oe(`Unsupported GeoJSON object type: ${t.type}`);let a=t.crs,c=a!==null?O9:null;if(l(a)){if(!l(a.properties))throw new oe("crs.properties is undefined.");let u=a.properties;if(a.type==="name"){if(c=Fie[u.name],!l(c))throw new oe(`Unknown crs name: ${u.name}`)}else if(a.type==="link"){let f=z1e[u.href];if(l(f)||(f=V1e[u.type]),!l(f))throw new oe(`Unable to resolve crs link: ${JSON.stringify(u)}`);c=f(u)}else if(a.type==="EPSG"){if(c=Fie[`EPSG:${u.code}`],!l(c))throw new oe(`Unknown crs EPSG code: ${u.code}`)}else throw new oe(`Unknown crs type: ${a.type}`)}return Promise.resolve(c).then(function(u){return r&&e._entityCollection.removeAll(),u!==null&&s(e,t,t,u,n),Promise.all(e._promises).then(function(){return e._promises.length=0,Ds.setLoading(e,!1),e})})}var gb=pb;function gvt(e){return typeof e=="string"&&(e=document.getElementById(e)),e}var Ln=gvt;var sOe=Qo(_re(),1);var aOe;typeof DOMParser<"u"&&(aOe=new DOMParser);var PIt=new sOe.default({stripPrefix:!1,email:!1,replaceFn:function(e,t){return t.urlMatchType==="scheme"||t.urlMatchType==="www"}}),Q9=32,ZRe=2414016,QRe=1,eOe=16093e3,tOe=.1,DIt=[null,void 0,"http://www.topografix.com/GPX/1/1"],eo={gpx:DIt};function RIt(e){return new Promise((t,n)=>{let i=new FileReader;i.addEventListener("load",function(){t(i.result)}),i.addEventListener("error",function(){n(i.error)}),i.readAsText(e)})}function yre(e,t){let n=LU(e,"id");return n=l(n)?n:Kn(),t.getOrCreateEntity(n)}function Are(e){let t=nOe(e,"lon"),n=nOe(e,"lat"),i=MU(e,"ele",eo.gpx);return h.fromDegrees(t,n,i)}function nOe(e,t){if(!l(e))return;let n=e.getAttribute(t);if(n!==null){let i=parseFloat(n);return isNaN(i)?void 0:i}}function LU(e,t){if(!l(e))return;let n=e.getAttribute(t);return n!==null?n:void 0}function Ab(e,t,n){if(!l(e))return;let i=e.childNodes,r=i.length;for(let o=0;o<r;o++){let s=i[o];if(s.localName===t&&n.indexOf(s.namespaceURI)!==-1)return s}}function bre(e,t,n){if(!l(e))return;let i=[],r=e.getElementsByTagName(t),o=r.length;for(let s=0;s<o;s++){let a=r[s];a.localName===t&&n.indexOf(a.namespaceURI)!==-1&&i.push(a)}return i}function MU(e,t,n){let i=Ab(e,t,n);if(l(i)){let r=parseFloat(i.textContent);return isNaN(r)?void 0:r}}function cf(e,t,n){let i=Ab(e,t,n);if(l(i))return i.textContent.trim()}function cOe(e){let t=new Zc;return t.width=Q9,t.height=Q9,t.scaleByDistance=new qt(ZRe,QRe,eOe,tOe),t.pixelOffsetScaleByDistance=new qt(ZRe,QRe,eOe,tOe),t.verticalOrigin=new ui(Gn.BOTTOM),t.image=e,t}function OIt(){let e=new Qh;return e.translucencyByDistance=new qt(3e6,1,5e6,0),e.pixelOffset=new U(17,0),e.horizontalOrigin=zi.LEFT,e.font="16px sans-serif",e.style=Ao.FILL_AND_OUTLINE,e}function lOe(e){let t=new el;return t.width=4,t.material=new $A,t.material.color=l(e)?e:z.RED,t.material.outlineWidth=2,t.material.outlineColor=z.BLACK,t}var iOe={time:{text:"Time",tag:"time"},comment:{text:"Comment",tag:"cmt"},description:{text:"Description",tag:"desc"},source:{text:"Source",tag:"src"},number:{text:"GPS track/route number",tag:"number"},type:{text:"Type",tag:"type"}},NU;typeof document<"u"&&(NU=document.createElement("div"));function xre(e,t){let n,i="",r=Object.keys(iOe),o=r.length;for(n=0;n<o;n++){let f=r[n],d=iOe[f];d.value=cf(e,d.tag,eo.gpx)??"",l(d.value)&&d.value!==""&&(i=`${i}<p>${d.text}: ${d.value}</p>`)}if(!l(i)||i==="")return;i=PIt.link(i),NU.innerHTML=i;let s=NU.querySelectorAll("a");for(n=0;n<s.length;n++)s[n].setAttribute("target","_blank");let a=z.WHITE,c=z.BLACK,u='<div class="cesium-infoBox-description-lighter" style="';return u+="overflow:auto;",u+="word-wrap:break-word;",u+=`background-color:${a.toCssColorString()};`,u+=`color:${c.toCssColorString()};`,u+='">',u+=`${NU.innerHTML}</div>`,NU.innerHTML="",u}function uOe(e,t,n,i){let r=Are(t),o=yre(t,n);o.position=r;let s=l(i.waypointImage)?i.waypointImage:e._pinBuilder.fromMakiIconId("marker",z.RED,Q9);o.billboard=cOe(s);let a=cf(t,"name",eo.gpx);o.name=a,o.label=OIt(),o.label.text=a,o.description=xre(t,o),i.clampToGround&&(o.billboard.heightReference=We.CLAMP_TO_GROUND,o.label.heightReference=We.CLAMP_TO_GROUND)}function MIt(e,t,n,i){let r=yre(t,n);r.description=xre(t,r);let o=bre(t,"rtept",eo.gpx),s=new Array(o.length);for(let a=0;a<o.length;a++)uOe(e,o[a],n,i),s[a]=Are(o[a]);r.polyline=lOe(i.routeColor),i.clampToGround&&(r.polyline.clampToGround=!0),r.polyline.positions=s}function NIt(e,t,n,i){let r=yre(t,n);r.description=xre(t,r);let o=bre(t,"trkseg",eo.gpx),s=[],a=[],c,u=!0,f=new _c;for(let d=0;d<o.length;d++)c=LIt(o[d]),s=s.concat(c.positions),c.times.length>0?(a=a.concat(c.times),f.addSamples(a,s),u=u&&!0):u=!1;if(u){let d=l(i.waypointImage)?i.waypointImage:e._pinBuilder.fromMakiIconId("marker",z.RED,Q9);r.billboard=cOe(d),r.position=f,i.clampToGround&&(r.billboard.heightReference=We.CLAMP_TO_GROUND),r.availability=new Ps,r.availability.addInterval(new En({start:a[0],stop:a[a.length-1]}))}r.polyline=lOe(i.trackColor),r.polyline.positions=s,i.clampToGround&&(r.polyline.clampToGround=!0)}function LIt(e){let t={positions:[],times:[]},n=bre(e,"trkpt",eo.gpx),i;for(let r=0;r<n.length;r++){let o=Are(n[r]);t.positions.push(o),i=cf(n[r],"time",eo.gpx),l(i)&&t.times.push(K.fromIso8601(i))}return t}function FIt(e){let t=Ab(e,"metadata",eo.gpx);if(l(t)){let n={name:cf(t,"name",eo.gpx),desc:cf(t,"desc",eo.gpx),author:BIt(t),copyright:UIt(t),link:fOe(t),time:cf(t,"time",eo.gpx),keywords:cf(t,"keywords",eo.gpx),bounds:zIt(t)};if(l(n.name)||l(n.desc)||l(n.author)||l(n.copyright)||l(n.link)||l(n.time)||l(n.keywords)||l(n.bounds))return n}}function BIt(e){let t=Ab(e,"author",eo.gpx);if(l(t)){let n={name:cf(t,"name",eo.gpx),email:kIt(t),link:fOe(t)};if(l(n.name)||l(n.email)||l(n.link))return n}}function kIt(e){let t=Ab(e,"email",eo.gpx);if(l(t)){let n=cf(t,"id",eo.gpx),i=cf(t,"domain",eo.gpx);return`${n}@${i}`}}function fOe(e){let t=Ab(e,"link",eo.gpx);if(l(t)){let n={href:LU(t,"href"),text:cf(t,"text",eo.gpx),mimeType:cf(t,"type",eo.gpx)};if(l(n.href)||l(n.text)||l(n.mimeType))return n}}function UIt(e){let t=Ab(e,"copyright",eo.gpx);if(l(t)){let n={author:LU(t,"author"),year:cf(t,"year",eo.gpx),license:cf(t,"license",eo.gpx)};if(l(n.author)||l(n.year)||l(n.license))return n}}function zIt(e){let t=Ab(e,"bounds",eo.gpx);if(l(t)){let n={minLat:MU(t,"minlat",eo.gpx),maxLat:MU(t,"maxlat",eo.gpx),minLon:MU(t,"minlon",eo.gpx),maxLon:MU(t,"maxlon",eo.gpx)};if(l(n.minLat)||l(n.maxLat)||l(n.minLon)||l(n.maxLon))return n}}var rOe={wpt:uOe,rte:MIt,trk:NIt};function VIt(e,t,n,i){let r=Object.keys(rOe),o=r.length;for(let s=0;s<o;s++){let a=r[s],c=rOe[a],u=t.childNodes,f=u.length;for(let d=0;d<f;d++){let p=u[d];p.localName===a&&eo.gpx.indexOf(p.namespaceURI)!==-1&&c(e,p,n,i)}}}function oOe(e,t,n){let i=e._entityCollection;i.removeAll();let r=t.documentElement,o=LU(r,"version"),s=LU(r,"creator"),a,c=FIt(r);l(c)&&(a=c.name),r.localName==="gpx"?VIt(e,r,i,n):console.log(`GPX - Unsupported node: ${r.localName}`);let u,f=i.computeAvailability(),d=f.start,p=f.stop,g=K.equals(d,nt.MINIMUM_VALUE),m=K.equals(p,nt.MAXIMUM_VALUE);if(!g||!m){let A;g&&(A=new Date,A.setHours(0,0,0,0),d=K.fromDate(A)),m&&(A=new Date,A.setHours(24,0,0,0),p=K.fromDate(A)),u=new Fm,u.startTime=d,u.stopTime=p,u.currentTime=K.clone(d),u.clockRange=Rs.LOOP_STOP,u.clockStep=Vr.SYSTEM_CLOCK_MULTIPLIER,u.multiplier=Math.round(Math.min(Math.max(K.secondsDifference(p,d)/60,1),31556900))}let y=!1;return e._name!==a&&(e._name=a,y=!0),e._creator!==s&&(e._creator=s,y=!0),jIt(e._metadata,c)&&(e._metadata=c,y=!0),e._version!==o&&(e._version=o,y=!0),u!==e._clock&&(y=!0,e._clock=u),y&&e._changed.raiseEvent(e),Ds.setLoading(e,!1),e}function jIt(e,t){return!l(e)&&!l(t)?!1:l(e)&&l(t)?e.name!==t.name||e.dec!==t.desc||e.src!==t.src||e.author!==t.author||e.copyright!==t.copyright||e.link!==t.link||e.time!==t.time||e.bounds!==t.bounds:!0}function HIt(e,t,n,i){i=i??H.EMPTY_OBJECT;let r=n;if(typeof n=="string"||n instanceof De){n=De.createIfNeeded(n),r=n.fetchBlob();let o=e._resourceCredits,s=n.credits;if(l(s)){let a=s.length;for(let c=0;c<a;c++)o.push(s[c])}}return Promise.resolve(r).then(function(o){return o instanceof Blob?RIt(o).then(function(s){let a,c;try{a=aOe.parseFromString(s,"application/xml")}catch(u){c=u.toString()}if(l(c)||a.body||a.documentElement.tagName==="parsererror"){let u=l(c)?c:a.documentElement.firstChild.nodeValue;throw u||(u=a.body.innerText),new oe(u)}return oOe(e,a,i)}):oOe(e,o,i)}).catch(function(o){return e._error.raiseEvent(e,o),console.log(o),Promise.reject(o)})}function aP(){this._changed=new be,this._error=new be,this._loading=new be,this._clock=void 0,this._entityCollection=new Ya(this),this._entityCluster=new $f,this._name=void 0,this._version=void 0,this._creator=void 0,this._metadata=void 0,this._isLoading=!1,this._pinBuilder=new $_}aP.load=function(e,t){return new aP().load(e,t)};Object.defineProperties(aP.prototype,{name:{get:function(){return this._name}},version:{get:function(){return this._version}},creator:{get:function(){return this._creator}},metadata:{get:function(){return this._metadata}},clock:{get:function(){return this._clock}},entities:{get:function(){return this._entityCollection}},isLoading:{get:function(){return this._isLoading}},changedEvent:{get:function(){return this._changed}},errorEvent:{get:function(){return this._error}},loadingEvent:{get:function(){return this._loading}},show:{get:function(){return this._entityCollection.show},set:function(e){this._entityCollection.show=e}},clustering:{get:function(){return this._entityCluster},set:function(e){this._entityCluster=e}}});aP.prototype.update=function(e){return!0};aP.prototype.load=function(e,t){if(!l(e))throw new pe("data is required.");t=t??H.EMPTY_OBJECT,Ds.setLoading(this,!0);let n=this._name,i=this;return HIt(this,this._entityCollection,e,t).then(function(){let r,o=i._entityCollection.computeAvailability(),s=o.start,a=o.stop,c=K.equals(s,nt.MINIMUM_VALUE),u=K.equals(a,nt.MAXIMUM_VALUE);if(!c||!u){let d;c&&(d=new Date,d.setHours(0,0,0,0),s=K.fromDate(d)),u&&(d=new Date,d.setHours(24,0,0,0),a=K.fromDate(d)),r=new Fm,r.startTime=s,r.stopTime=a,r.currentTime=K.clone(s),r.clockRange=Rs.LOOP_STOP,r.clockStep=Vr.SYSTEM_CLOCK_MULTIPLIER,r.multiplier=Math.round(Math.min(Math.max(K.secondsDifference(a,s)/60,1),31556900))}let f=!1;return r!==i._clock&&(i._clock=r,f=!0),n!==i._name&&(f=!0),f&&i._changed.raiseEvent(i),Ds.setLoading(i,!1),i}).catch(function(r){return Ds.setLoading(i,!1),i._error.raiseEvent(i,r),console.log(r),Promise.reject(r)})};var FU=aP;function GIt(e,t){this.position=e,this.headingPitchRoll=t}var BU=GIt;var vOe=Qo(_re(),1),HU=Qo(Tf(),1);function WIt(e,t){this.position=e,this.headingPitchRange=t}var kU=WIt;function e7(e,t){this.id=t,this.name=e,this.playlistIndex=0,this.playlist=[],this.tourStart=new be,this.tourEnd=new be,this.entryStart=new be,this.entryEnd=new be,this._activeEntries=[]}e7.prototype.addPlaylistEntry=function(e){this.playlist.push(e)};e7.prototype.play=function(e,t){this.tourStart.raiseEvent();let n=this;hOe.call(this,e,t,function(i){n.playlistIndex=0,i||dOe(n._activeEntries),n.tourEnd.raiseEvent(i)})};e7.prototype.stop=function(){dOe(this._activeEntries)};function dOe(e){for(let t=e.pop();t!==void 0;t=e.pop())t.stop()}function hOe(e,t,n){let i=this.playlist[this.playlistIndex];if(i){let r=qIt.bind(this,e,t,n);if(this._activeEntries.push(i),this.entryStart.raiseEvent(i),i.blocking)i.play(r,e.scene.camera,t);else{let o=this;i.play(function(){o.entryEnd.raiseEvent(i);let s=o._activeEntries.indexOf(i);s>=0&&o._activeEntries.splice(s,1)}),r(e,t,n)}}else l(n)&&n(!1)}function qIt(e,t,n,i){let r=this.playlist[this.playlistIndex];if(this.entryEnd.raiseEvent(r,i),i)n(i);else{let o=this._activeEntries.indexOf(r);o>=0&&this._activeEntries.splice(o,1),this.playlistIndex++,hOe.call(this,e,t,n)}}var UU=e7;var sr=Object.freeze({Linear:Object.freeze({None:function(e){return e},In:function(e){return e},Out:function(e){return e},InOut:function(e){return e}}),Quadratic:Object.freeze({In:function(e){return e*e},Out:function(e){return e*(2-e)},InOut:function(e){return(e*=2)<1?.5*e*e:-.5*(--e*(e-2)-1)}}),Cubic:Object.freeze({In:function(e){return e*e*e},Out:function(e){return--e*e*e+1},InOut:function(e){return(e*=2)<1?.5*e*e*e:.5*((e-=2)*e*e+2)}}),Quartic:Object.freeze({In:function(e){return e*e*e*e},Out:function(e){return 1- --e*e*e*e},InOut:function(e){return(e*=2)<1?.5*e*e*e*e:-.5*((e-=2)*e*e*e-2)}}),Quintic:Object.freeze({In:function(e){return e*e*e*e*e},Out:function(e){return--e*e*e*e*e+1},InOut:function(e){return(e*=2)<1?.5*e*e*e*e*e:.5*((e-=2)*e*e*e*e+2)}}),Sinusoidal:Object.freeze({In:function(e){return 1-Math.sin((1-e)*Math.PI/2)},Out:function(e){return Math.sin(e*Math.PI/2)},InOut:function(e){return .5*(1-Math.sin(Math.PI*(.5-e)))}}),Exponential:Object.freeze({In:function(e){return e===0?0:Math.pow(1024,e-1)},Out:function(e){return e===1?1:1-Math.pow(2,-10*e)},InOut:function(e){return e===0?0:e===1?1:(e*=2)<1?.5*Math.pow(1024,e-1):.5*(-Math.pow(2,-10*(e-1))+2)}}),Circular:Object.freeze({In:function(e){return 1-Math.sqrt(1-e*e)},Out:function(e){return Math.sqrt(1- --e*e)},InOut:function(e){return(e*=2)<1?-.5*(Math.sqrt(1-e*e)-1):.5*(Math.sqrt(1-(e-=2)*e)+1)}}),Elastic:Object.freeze({In:function(e){return e===0?0:e===1?1:-Math.pow(2,10*(e-1))*Math.sin((e-1.1)*5*Math.PI)},Out:function(e){return e===0?0:e===1?1:Math.pow(2,-10*e)*Math.sin((e-.1)*5*Math.PI)+1},InOut:function(e){return e===0?0:e===1?1:(e*=2,e<1?-.5*Math.pow(2,10*(e-1))*Math.sin((e-1.1)*5*Math.PI):.5*Math.pow(2,-10*(e-1))*Math.sin((e-1.1)*5*Math.PI)+1)}}),Back:Object.freeze({In:function(e){var t=1.70158;return e===1?1:e*e*((t+1)*e-t)},Out:function(e){var t=1.70158;return e===0?0:--e*e*((t+1)*e+t)+1},InOut:function(e){var t=2.5949095;return(e*=2)<1?.5*(e*e*((t+1)*e-t)):.5*((e-=2)*e*((t+1)*e+t)+2)}}),Bounce:Object.freeze({In:function(e){return 1-sr.Bounce.Out(1-e)},Out:function(e){return e<.36363636363636365?7.5625*e*e:e<.7272727272727273?7.5625*(e-=.5454545454545454)*e+.75:e<.9090909090909091?7.5625*(e-=.8181818181818182)*e+.9375:7.5625*(e-=.9545454545454546)*e+.984375},InOut:function(e){return e<.5?sr.Bounce.In(e*2)*.5:sr.Bounce.Out(e*2-1)*.5+.5}}),generatePow:function(e){return e===void 0&&(e=4),e=e<Number.EPSILON?Number.EPSILON:e,e=e>1e4?1e4:e,{In:function(t){return Math.pow(t,e)},Out:function(t){return 1-Math.pow(1-t,e)},InOut:function(t){return t<.5?Math.pow(t*2,e)/2:(1-Math.pow(2-t*2,e))/2+.5}}}}),zU=function(){return performance.now()},YIt=(function(){function e(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];this._tweens={},this._tweensAddedDuringUpdate={},this.add.apply(this,t)}return e.prototype.getAll=function(){var t=this;return Object.keys(this._tweens).map(function(n){return t._tweens[n]})},e.prototype.removeAll=function(){this._tweens={}},e.prototype.add=function(){for(var t,n=[],i=0;i<arguments.length;i++)n[i]=arguments[i];for(var r=0,o=n;r<o.length;r++){var s=o[r];(t=s._group)===null||t===void 0||t.remove(s),s._group=this,this._tweens[s.getId()]=s,this._tweensAddedDuringUpdate[s.getId()]=s}},e.prototype.remove=function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];for(var i=0,r=t;i<r.length;i++){var o=r[i];o._group=void 0,delete this._tweens[o.getId()],delete this._tweensAddedDuringUpdate[o.getId()]}},e.prototype.allStopped=function(){return this.getAll().every(function(t){return!t.isPlaying()})},e.prototype.update=function(t,n){t===void 0&&(t=zU()),n===void 0&&(n=!0);var i=Object.keys(this._tweens);if(i.length!==0)for(;i.length>0;){this._tweensAddedDuringUpdate={};for(var r=0;r<i.length;r++){var o=this._tweens[i[r]],s=!n;o&&o.update(t,s)===!1&&!n&&this.remove(o)}i=Object.keys(this._tweensAddedDuringUpdate)}},e})(),cP={Linear:function(e,t){var n=e.length-1,i=n*t,r=Math.floor(i),o=cP.Utils.Linear;return t<0?o(e[0],e[1],i):t>1?o(e[n],e[n-1],n-i):o(e[r],e[r+1>n?n:r+1],i-r)},Bezier:function(e,t){for(var n=0,i=e.length-1,r=Math.pow,o=cP.Utils.Bernstein,s=0;s<=i;s++)n+=r(1-t,i-s)*r(t,s)*e[s]*o(i,s);return n},CatmullRom:function(e,t){var n=e.length-1,i=n*t,r=Math.floor(i),o=cP.Utils.CatmullRom;return e[0]===e[n]?(t<0&&(r=Math.floor(i=n*(1+t))),o(e[(r-1+n)%n],e[r],e[(r+1)%n],e[(r+2)%n],i-r)):t<0?e[0]-(o(e[0],e[0],e[1],e[1],-i)-e[0]):t>1?e[n]-(o(e[n],e[n],e[n-1],e[n-1],i-n)-e[n]):o(e[r?r-1:0],e[r],e[n<r+1?n:r+1],e[n<r+2?n:r+2],i-r)},Utils:{Linear:function(e,t,n){return(t-e)*n+e},Bernstein:function(e,t){var n=cP.Utils.Factorial;return n(e)/n(t)/n(e-t)},Factorial:(function(){var e=[1];return function(t){var n=1;if(e[t])return e[t];for(var i=t;i>1;i--)n*=i;return e[t]=n,n}})(),CatmullRom:function(e,t,n,i,r){var o=(n-e)*.5,s=(i-t)*.5,a=r*r,c=r*a;return(2*t-2*n+o+s)*c+(-3*t+3*n-2*o-s)*a+o*r+t}}},mOe=(function(){function e(){}return e.nextId=function(){return e._nextId++},e._nextId=0,e})(),Tre=new YIt,pOe=(function(){function e(t,n){this._isPaused=!1,this._pauseStart=0,this._valuesStart={},this._valuesEnd={},this._valuesStartRepeat={},this._duration=1e3,this._isDynamic=!1,this._initialRepeat=0,this._repeat=0,this._yoyo=!1,this._isPlaying=!1,this._reversed=!1,this._delayTime=0,this._startTime=0,this._easingFunction=sr.Linear.None,this._interpolationFunction=cP.Linear,this._chainedTweens=[],this._onStartCallbackFired=!1,this._onEveryStartCallbackFired=!1,this._id=mOe.nextId(),this._isChainStopped=!1,this._propertiesAreSetUp=!1,this._goToEnd=!1,this._object=t,typeof n=="object"?(this._group=n,n.add(this)):n===!0&&(this._group=Tre,Tre.add(this))}return e.prototype.getId=function(){return this._id},e.prototype.isPlaying=function(){return this._isPlaying},e.prototype.isPaused=function(){return this._isPaused},e.prototype.getDuration=function(){return this._duration},e.prototype.to=function(t,n){if(n===void 0&&(n=1e3),this._isPlaying)throw new Error("Can not call Tween.to() while Tween is already started or paused. Stop the Tween first.");return this._valuesEnd=t,this._propertiesAreSetUp=!1,this._duration=n<0?0:n,this},e.prototype.duration=function(t){return t===void 0&&(t=1e3),this._duration=t<0?0:t,this},e.prototype.dynamic=function(t){return t===void 0&&(t=!1),this._isDynamic=t,this},e.prototype.start=function(t,n){if(t===void 0&&(t=zU()),n===void 0&&(n=!1),this._isPlaying)return this;if(this._repeat=this._initialRepeat,this._reversed){this._reversed=!1;for(var i in this._valuesStartRepeat)this._swapEndStartRepeatValues(i),this._valuesStart[i]=this._valuesStartRepeat[i]}if(this._isPlaying=!0,this._isPaused=!1,this._onStartCallbackFired=!1,this._onEveryStartCallbackFired=!1,this._isChainStopped=!1,this._startTime=t,this._startTime+=this._delayTime,!this._propertiesAreSetUp||n){if(this._propertiesAreSetUp=!0,!this._isDynamic){var r={};for(var o in this._valuesEnd)r[o]=this._valuesEnd[o];this._valuesEnd=r}this._setupProperties(this._object,this._valuesStart,this._valuesEnd,this._valuesStartRepeat,n)}return this},e.prototype.startFromCurrentValues=function(t){return this.start(t,!0)},e.prototype._setupProperties=function(t,n,i,r,o){for(var s in i){var a=t[s],c=Array.isArray(a),u=c?"array":typeof a,f=!c&&Array.isArray(i[s]);if(!(u==="undefined"||u==="function")){if(f){var d=i[s];if(d.length===0)continue;for(var p=[a],g=0,m=d.length;g<m;g+=1){var y=this._handleRelativeValue(a,d[g]);if(isNaN(y)){f=!1,console.warn("Found invalid interpolation list. Skipping.");break}p.push(y)}f&&(i[s]=p)}if((u==="object"||c)&&a&&!f){n[s]=c?[]:{};var A=a;for(var b in A)n[s][b]=A[b];r[s]=c?[]:{};var d=i[s];if(!this._isDynamic){var x={};for(var b in d)x[b]=d[b];i[s]=d=x}this._setupProperties(A,n[s],d,r[s],o)}else(typeof n[s]>"u"||o)&&(n[s]=a),c||(n[s]*=1),f?r[s]=i[s].slice().reverse():r[s]=n[s]||0}}},e.prototype.stop=function(){return this._isChainStopped||(this._isChainStopped=!0,this.stopChainedTweens()),this._isPlaying?(this._isPlaying=!1,this._isPaused=!1,this._onStopCallback&&this._onStopCallback(this._object),this):this},e.prototype.end=function(){return this._goToEnd=!0,this.update(this._startTime+this._duration),this},e.prototype.pause=function(t){return t===void 0&&(t=zU()),this._isPaused||!this._isPlaying?this:(this._isPaused=!0,this._pauseStart=t,this)},e.prototype.resume=function(t){return t===void 0&&(t=zU()),!this._isPaused||!this._isPlaying?this:(this._isPaused=!1,this._startTime+=t-this._pauseStart,this._pauseStart=0,this)},e.prototype.stopChainedTweens=function(){for(var t=0,n=this._chainedTweens.length;t<n;t++)this._chainedTweens[t].stop();return this},e.prototype.group=function(t){return t?(t.add(this),this):(console.warn("tween.group() without args has been removed, use group.add(tween) instead."),this)},e.prototype.remove=function(){var t;return(t=this._group)===null||t===void 0||t.remove(this),this},e.prototype.delay=function(t){return t===void 0&&(t=0),this._delayTime=t,this},e.prototype.repeat=function(t){return t===void 0&&(t=0),this._initialRepeat=t,this._repeat=t,this},e.prototype.repeatDelay=function(t){return this._repeatDelayTime=t,this},e.prototype.yoyo=function(t){return t===void 0&&(t=!1),this._yoyo=t,this},e.prototype.easing=function(t){return t===void 0&&(t=sr.Linear.None),this._easingFunction=t,this},e.prototype.interpolation=function(t){return t===void 0&&(t=cP.Linear),this._interpolationFunction=t,this},e.prototype.chain=function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];return this._chainedTweens=t,this},e.prototype.onStart=function(t){return this._onStartCallback=t,this},e.prototype.onEveryStart=function(t){return this._onEveryStartCallback=t,this},e.prototype.onUpdate=function(t){return this._onUpdateCallback=t,this},e.prototype.onRepeat=function(t){return this._onRepeatCallback=t,this},e.prototype.onComplete=function(t){return this._onCompleteCallback=t,this},e.prototype.onStop=function(t){return this._onStopCallback=t,this},e.prototype.update=function(t,n){var i=this,r;if(t===void 0&&(t=zU()),n===void 0&&(n=e.autoStartOnUpdate),this._isPaused)return!0;var o;if(!this._goToEnd&&!this._isPlaying)if(n)this.start(t,!0);else return!1;if(this._goToEnd=!1,t<this._startTime)return!0;this._onStartCallbackFired===!1&&(this._onStartCallback&&this._onStartCallback(this._object),this._onStartCallbackFired=!0),this._onEveryStartCallbackFired===!1&&(this._onEveryStartCallback&&this._onEveryStartCallback(this._object),this._onEveryStartCallbackFired=!0);var s=t-this._startTime,a=this._duration+((r=this._repeatDelayTime)!==null&&r!==void 0?r:this._delayTime),c=this._duration+this._repeat*a,u=function(){if(i._duration===0||s>c)return 1;var y=Math.trunc(s/a),A=s-y*a,b=Math.min(A/i._duration,1);return b===0&&s===i._duration?1:b},f=u(),d=this._easingFunction(f);if(this._updateProperties(this._object,this._valuesStart,this._valuesEnd,d),this._onUpdateCallback&&this._onUpdateCallback(this._object,f),this._duration===0||s>=this._duration)if(this._repeat>0){var p=Math.min(Math.trunc((s-this._duration)/a)+1,this._repeat);isFinite(this._repeat)&&(this._repeat-=p);for(o in this._valuesStartRepeat)!this._yoyo&&typeof this._valuesEnd[o]=="string"&&(this._valuesStartRepeat[o]=this._valuesStartRepeat[o]+parseFloat(this._valuesEnd[o])),this._yoyo&&this._swapEndStartRepeatValues(o),this._valuesStart[o]=this._valuesStartRepeat[o];return this._yoyo&&(this._reversed=!this._reversed),this._startTime+=a*p,this._onRepeatCallback&&this._onRepeatCallback(this._object),this._onEveryStartCallbackFired=!1,!0}else{this._onCompleteCallback&&this._onCompleteCallback(this._object);for(var g=0,m=this._chainedTweens.length;g<m;g++)this._chainedTweens[g].start(this._startTime+this._duration,!1);return this._isPlaying=!1,!1}return!0},e.prototype._updateProperties=function(t,n,i,r){for(var o in i)if(n[o]!==void 0){var s=n[o]||0,a=i[o],c=Array.isArray(t[o]),u=Array.isArray(a),f=!c&&u;f?t[o]=this._interpolationFunction(a,r):typeof a=="object"&&a?this._updateProperties(t[o],s,a,r):(a=this._handleRelativeValue(s,a),typeof a=="number"&&(t[o]=s+(a-s)*r))}},e.prototype._handleRelativeValue=function(t,n){return typeof n!="string"?n:n.charAt(0)==="+"||n.charAt(0)==="-"?t+parseFloat(n):parseFloat(n)},e.prototype._swapEndStartRepeatValues=function(t){var n=this._valuesStartRepeat[t],i=this._valuesEnd[t];typeof i=="string"?this._valuesStartRepeat[t]=this._valuesStartRepeat[t]+parseFloat(i):this._valuesStartRepeat[t]=this._valuesEnd[t],this._valuesEnd[t]=n},e.autoStartOnUpdate=!1,e})();var dUi=mOe.nextId,D0=Tre,hUi=D0.getAll.bind(D0),mUi=D0.removeAll.bind(D0),pUi=D0.add.bind(D0),gUi=D0.remove.bind(D0),_Ui=D0.update.bind(D0);var XIt={LINEAR_NONE:sr.Linear.None,QUADRATIC_IN:sr.Quadratic.In,QUADRATIC_OUT:sr.Quadratic.Out,QUADRATIC_IN_OUT:sr.Quadratic.InOut,CUBIC_IN:sr.Cubic.In,CUBIC_OUT:sr.Cubic.Out,CUBIC_IN_OUT:sr.Cubic.InOut,QUARTIC_IN:sr.Quartic.In,QUARTIC_OUT:sr.Quartic.Out,QUARTIC_IN_OUT:sr.Quartic.InOut,QUINTIC_IN:sr.Quintic.In,QUINTIC_OUT:sr.Quintic.Out,QUINTIC_IN_OUT:sr.Quintic.InOut,SINUSOIDAL_IN:sr.Sinusoidal.In,SINUSOIDAL_OUT:sr.Sinusoidal.Out,SINUSOIDAL_IN_OUT:sr.Sinusoidal.InOut,EXPONENTIAL_IN:sr.Exponential.In,EXPONENTIAL_OUT:sr.Exponential.Out,EXPONENTIAL_IN_OUT:sr.Exponential.InOut,CIRCULAR_IN:sr.Circular.In,CIRCULAR_OUT:sr.Circular.Out,CIRCULAR_IN_OUT:sr.Circular.InOut,ELASTIC_IN:sr.Elastic.In,ELASTIC_OUT:sr.Elastic.Out,ELASTIC_IN_OUT:sr.Elastic.InOut,BACK_IN:sr.Back.In,BACK_OUT:sr.Back.Out,BACK_IN_OUT:sr.Back.InOut,BOUNCE_IN:sr.Bounce.In,BOUNCE_OUT:sr.Bounce.Out,BOUNCE_IN_OUT:sr.Bounce.InOut},Ls=Object.freeze(XIt);function t7(e,t,n){this.type="KmlTourFlyTo",this.blocking=!0,this.activeCamera=null,this.activeCallback=null,this.duration=e,this.view=n,this.flyToMode=t}t7.prototype.play=function(e,t,n){if(this.activeCamera=t,l(e)&&e!==null){let r=this;this.activeCallback=function(o){delete r.activeCallback,delete r.activeCamera,e(l(o)?!1:o)}}let i=this.getCameraOptions(n);if(this.view.headingPitchRoll)t.flyTo(i);else if(this.view.headingPitchRange){let r=new ue(this.view.position);t.flyToBoundingSphere(r,i)}};t7.prototype.stop=function(){l(this.activeCamera)&&this.activeCamera.cancelFlight(),l(this.activeCallback)&&this.activeCallback(!0)};t7.prototype.getCameraOptions=function(e){let t={duration:this.duration};return l(this.activeCallback)&&(t.complete=this.activeCallback),this.flyToMode==="smooth"&&(t.easingFunction=Ls.LINEAR_NONE),this.view.headingPitchRoll?(t.destination=this.view.position,t.orientation=this.view.headingPitchRoll):this.view.headingPitchRange&&(t.offset=this.view.headingPitchRange),l(e)&&(t=Ot(t,e)),t};var VU=t7;function Ere(e){this.type="KmlTourWait",this.blocking=!0,this.duration=e,this.timeout=null}Ere.prototype.play=function(e){let t=this;this.activeCallback=e,this.timeout=setTimeout(function(){delete t.activeCallback,e(!1)},this.duration*1e3)};Ere.prototype.stop=function(){clearTimeout(this.timeout),l(this.activeCallback)&&this.activeCallback(!0)};var jU=Ere;var SOe={avi:"video/x-msvideo",bmp:"image/bmp",bz2:"application/x-bzip2",chm:"application/vnd.ms-htmlhelp",css:"text/css",csv:"text/csv",doc:"application/msword",dvi:"application/x-dvi",eps:"application/postscript",flv:"video/x-flv",gif:"image/gif",gz:"application/x-gzip",htm:"text/html",html:"text/html",ico:"image/vnd.microsoft.icon",jnlp:"application/x-java-jnlp-file",jpeg:"image/jpeg",jpg:"image/jpeg",m3u:"audio/x-mpegurl",m4v:"video/mp4",mathml:"application/mathml+xml",mid:"audio/midi",midi:"audio/midi",mov:"video/quicktime",mp3:"audio/mpeg",mp4:"video/mp4",mp4v:"video/mp4",mpeg:"video/mpeg",mpg:"video/mpeg",odp:"application/vnd.oasis.opendocument.presentation",ods:"application/vnd.oasis.opendocument.spreadsheet",odt:"application/vnd.oasis.opendocument.text",ogg:"application/ogg",pdf:"application/pdf",png:"image/png",pps:"application/vnd.ms-powerpoint",ppt:"application/vnd.ms-powerpoint",ps:"application/postscript",qt:"video/quicktime",rdf:"application/rdf+xml",rss:"application/rss+xml",rtf:"application/rtf",svg:"image/svg+xml",swf:"application/x-shockwave-flash",text:"text/plain",tif:"image/tiff",tiff:"image/tiff",txt:"text/plain",wav:"audio/x-wav",wma:"audio/x-ms-wma",wmv:"video/x-ms-wmv",xml:"application/xml",zip:"application/zip",detectFromFilename:function(e){let t=e.toLowerCase();return t=rg(t),SOe[t]}},Mre;typeof DOMParser<"u"&&(Mre=new DOMParser);var KIt=new vOe.default({stripPrefix:!1,email:!1,replaceFn:function(e){return e.urlMatchType==="scheme"||e.urlMatchType==="www"}}),bb=32,gOe=2414016,_Oe=1,yOe=16093e3,AOe=.1,bOe=[null,void 0,"http://www.opengis.net/kml/2.2","http://earth.google.com/kml/2.2","http://earth.google.com/kml/2.1","http://earth.google.com/kml/2.0"],xOe=["http://www.google.com/kml/ext/2.2"],$It=["http://www.w3.org/2005/Atom"],Ve={kml:bOe,gx:xOe,atom:$It,kmlgx:bOe.concat(xOe)},Nre={Document:FOe,Folder:pPt,Placemark:gPt,NetworkLink:vPt,GroundOverlay:TPt,PhotoOverlay:UOe,ScreenOverlay:xPt,Tour:yPt},Ire=class{constructor(t){this._dataSource=t,this._deferred=Pu(),this._stack=[],this._promises=[],this._timeoutSet=!1,this._used=!1,this._started=0,this._timeThreshold=1e3}get dataSource(){return this._dataSource}addNodes(t,n){this._stack.push({nodes:t,index:0,processingData:n}),this._used=!0}addPromise(t){this._promises.push(t)}wait(){let t=this._deferred;return this._used||t.resolve(),Promise.all([t.promise,Promise.all(this._promises)])}process(){let t=this._stack.length===1;return t&&(this._started=Q_._getTimestamp()),this._process(t)}_giveUpTime(){if(this._timeoutSet)return;this._timeoutSet=!0,this._timeThreshold=50;let t=this;setTimeout(function(){t._timeoutSet=!1,t._started=Q_._getTimestamp(),t._process(!0)},0)}_nextNode(){let t=this._stack,n=t[t.length-1],i=n.index,r=n.nodes;if(i!==r.length)return++n.index,r[i]}_pop(){let t=this._stack;return t.pop(),t.length===0?(this._deferred.resolve(),!1):!0}_process(t){let n=this.dataSource,i=this._stack[this._stack.length-1].processingData,r=this._nextNode();for(;l(r);){let o=Nre[r.localName];if(l(o)&&(Ve.kml.indexOf(r.namespaceURI)!==-1||Ve.gx.indexOf(r.namespaceURI)!==-1)&&(o(n,r,i,this),this._timeoutSet||Q_._getTimestamp()>this._started+this._timeThreshold)){this._giveUpTime();return}r=this._nextNode()}this._pop()&&t&&this._process(!0)}};function JIt(e){let t=e.slice(0,Math.min(4,e.size)),n=Pu(),i=new FileReader;return i.addEventListener("load",function(){n.resolve(new DataView(i.result).getUint32(0,!1)===1347093252)}),i.addEventListener("error",function(){n.reject(i.error)}),i.readAsArrayBuffer(t),n.promise}function ZIt(e){let t=Pu(),n=new FileReader;return n.addEventListener("load",function(){t.resolve(n.result)}),n.addEventListener("error",function(){t.reject(n.error)}),n.readAsText(e),t.promise}function wOe(e){let t={xsi:"http://www.w3.org/2001/XMLSchema-instance"},n,i,r,o;for(let s in t)t.hasOwnProperty(s)&&(r=RegExp(`[< ]${s}:`),o=`xmlns:${s}=`,r.test(e)&&e.indexOf(o)===-1&&(l(n)||(n=e.substr(0,e.indexOf("<kml")+4),i=e.substr(n.length)),n+=` ${o}"${t[s]}"`));return l(n)&&(e=n+i),e}function IOe(e){let t=e.indexOf("xmlns:"),n=e.indexOf(">",t),i,r,o;for(;t!==-1&&t<n;)i=e.slice(t,e.indexOf('"',t)),r=t,t=e.indexOf(i,t+1),t!==-1?(o=e.indexOf('"',e.indexOf('"',t)+1),e=e.slice(0,t-1)+e.slice(o+1,e.length),t=e.indexOf("xmlns:",r-1)):t=e.indexOf("xmlns:",r+1);return e}async function QIt(e,t){let n=await e.getData(new uU);n=wOe(n),n=IOe(n),t.kml=Mre.parseFromString(n,"application/xml")}async function Cre(e,t){let n=SOe.detectFromFilename(e.filename)??"application/octet-stream",i=await e.getData(new cU(n));t[e.filename]=i}function cd(e,t,n,i){let r=i.keys,o=new HU.default("."),s=e.querySelectorAll(t);for(let a=0;a<s.length;a++){let c=s[a],u=c.getAttribute(n);if(l(u)){let d=new HU.default(u).absoluteTo(o).toString(),p=r.indexOf(d);if(p!==-1){let g=r[p];c.setAttribute(n,i[g]),t==="a"&&c.getAttribute("download")===null&&c.setAttribute("download",g)}}}}function ld(e,t,n,i){let r=e.querySelectorAll(t);for(let o=0;o<r.length;o++){let s=r[o],a=s.getAttribute(n),c=Lre(a,i);l(c)&&s.setAttribute(n,c.url)}}function POe(e,t,n){let i=Da(e,"id");i=l(i)&&i.length!==0?i:Kn(),l(n)&&(i=n+i);let r=t.getById(i);return l(r)&&(i=Kn(),l(n)&&(i=n+i)),r=t.add(new Jr({id:i})),l(r.kml)||(r.addProperty("kml"),r.kml=new Ore),r}function GU(e,t){return e==="absolute"||e==="relativeToGround"||t==="relativeToSeaFloor"}function o7(e,t){if(!l(e))return h.fromDegrees(0,0,0,t);let n=e.match(/[^\s,\n]+/g);if(!l(n))return h.fromDegrees(0,0,0,t);let i=parseFloat(n[0]),r=parseFloat(n[1]),o=parseFloat(n[2]);return i=isNaN(i)?0:i,r=isNaN(r)?0:r,o=isNaN(o)?0:o,h.fromDegrees(i,r,o,t)}function n7(e,t){if(!l(e))return;let n=e.textContent.match(/[^\s\n]+/g);if(!l(n))return;let i=n.length,r=new Array(i),o=0;for(let s=0;s<i;s++)r[o++]=o7(n[s],t);return r}function xb(e,t){if(!l(e))return;let n=e.getAttribute(t);if(n!==null){let i=parseFloat(n);return isNaN(i)?void 0:i}}function Da(e,t){if(!l(e))return;let n=e.getAttribute(t);return n!==null?n:void 0}function ar(e,t,n){if(!l(e))return;let i=e.childNodes,r=i.length;for(let o=0;o<r;o++){let s=i[o];if(s.localName===t&&n.indexOf(s.namespaceURI)!==-1)return s}}function TOe(e,t,n){if(!l(e))return;let i=[],r=e.getElementsByTagNameNS("*",t),o=r.length;for(let s=0;s<o;s++){let a=r[s];a.localName===t&&n.indexOf(a.namespaceURI)!==-1&&i.push(a)}return i}function Qm(e,t,n){if(!l(e))return[];let i=[],r=e.childNodes,o=r.length;for(let s=0;s<o;s++){let a=r[s];a.localName===t&&n.indexOf(a.namespaceURI)!==-1&&i.push(a)}return i}function Si(e,t,n){let i=ar(e,t,n);if(l(i)){let r=parseFloat(i.textContent);return isNaN(r)?void 0:r}}function Fn(e,t,n){let i=ar(e,t,n);if(l(i))return i.textContent.trim()}function ep(e,t,n){let i=ar(e,t,n);if(l(i)){let r=i.textContent.trim();return r==="1"||/^true$/i.test(r)}}function Lre(e,t,n){if(!l(e))return;let i;if(l(n)){e=e.replace(/\\/g,"/");let r=n[e];if(l(r))i=new De({url:r});else{let o=new HU.default(t.getUrlComponent()),s=new HU.default(e);r=n[s.absoluteTo(o)],l(r)&&(i=new De({url:r}))}}return l(i)||(i=t.getDerivedResource({url:e})),i}var lf={maximumRed:void 0,red:void 0,maximumGreen:void 0,green:void 0,maximumBlue:void 0,blue:void 0};function Pre(e,t){if(!l(e)||/^\s*$/gm.test(e))return;e[0]==="#"&&(e=e.substring(1));let n=parseInt(e.substring(0,2),16)/255,i=parseInt(e.substring(2,4),16)/255,r=parseInt(e.substring(4,6),16)/255,o=parseInt(e.substring(6,8),16)/255;return t?(o>0?(lf.maximumRed=o,lf.red=void 0):(lf.maximumRed=void 0,lf.red=0),r>0?(lf.maximumGreen=r,lf.green=void 0):(lf.maximumGreen=void 0,lf.green=0),i>0?(lf.maximumBlue=i,lf.blue=void 0):(lf.maximumBlue=void 0,lf.blue=0),lf.alpha=n,z.fromRandom(lf)):new z(o,r,i,n)}function $E(e,t,n){let i=Fn(e,t,n);if(l(i))return Pre(i,Fn(e,"colorMode",n)==="random")}function ePt(e){let t=ar(e,"TimeStamp",Ve.kmlgx),n=Fn(t,"when",Ve.kmlgx);if(!l(t)||!l(n)||n.length===0)return;let i=K.fromIso8601(n),r=new Ps;return r.addInterval(new En({start:i,stop:nt.MAXIMUM_VALUE})),r}function tPt(e){let t=ar(e,"TimeSpan",Ve.kmlgx);if(!l(t))return;let n,i=ar(t,"begin",Ve.kmlgx),r=l(i)?K.fromIso8601(i.textContent):void 0,o=ar(t,"end",Ve.kmlgx),s=l(o)?K.fromIso8601(o.textContent):void 0;if(l(r)&&l(s)){if(K.lessThan(s,r)){let a=r;r=s,s=a}n=new Ps,n.addInterval(new En({start:r,stop:s}))}else l(r)?(n=new Ps,n.addInterval(new En({start:r,stop:nt.MAXIMUM_VALUE}))):l(s)&&(n=new Ps,n.addInterval(new En({start:nt.MINIMUM_VALUE,stop:s})));return n}function DOe(){let e=new Zc;return e.width=bb,e.height=bb,e.scaleByDistance=new qt(gOe,_Oe,yOe,AOe),e.pixelOffsetScaleByDistance=new qt(gOe,_Oe,yOe,AOe),e}function Fre(){let e=new em;return e.outline=!0,e.outlineColor=z.WHITE,e}function ROe(){let e=new Qh;return e.translucencyByDistance=new qt(3e6,1,5e6,0),e.pixelOffset=new U(17,0),e.horizontalOrigin=zi.LEFT,e.font="16px sans-serif",e.style=Ao.FILL_AND_OUTLINE,e}function Bre(e,t,n,i,r){let o=Fn(e,"href",Ve.kml);if(!l(o)||o.length===0)return;if(o.indexOf("root://icons/palette-")===0){let a=o.charAt(21),c=Si(e,"x",Ve.gx)??0,u=Si(e,"y",Ve.gx)??0;c=Math.min(c/32,7),u=7-Math.min(u/32,7);let f=8*u+c;o=`https://maps.google.com/mapfiles/kml/pal${a}/icon${f}.png`}let s=Lre(o,n,i);if(r){let a=Fn(e,"refreshMode",Ve.kml),c=Fn(e,"viewRefreshMode",Ve.kml);a==="onInterval"||a==="onExpire"?_t(`kml-refreshMode-${a}`,`KML - Unsupported Icon refreshMode: ${a}`):(c==="onStop"||c==="onRegion")&&_t(`kml-refreshMode-${c}`,`KML - Unsupported Icon viewRefreshMode: ${c}`);let u=Fn(e,"viewBoundScale",Ve.kml)??1,f=c==="onStop"?"BBOX=[bboxWest],[bboxSouth],[bboxEast],[bboxNorth]":"",d=Fn(e,"viewFormat",Ve.kml)??f,p=Fn(e,"httpQuery",Ve.kml);l(d)&&s.setQueryParameters(Ef(r7(d))),l(p)&&s.setQueryParameters(Ef(r7(p)));let g=t._ellipsoid;return Ure(s,t.camera,t.canvas,u,t._lastCameraView.bbox,g),s}return s}function nPt(e,t,n,i,r){let o=Si(t,"scale",Ve.kml),s=Si(t,"heading",Ve.kml),a=$E(t,"color",Ve.kml),c=ar(t,"Icon",Ve.kml),u=Bre(c,e,i,r,!1);l(c)&&!l(u)&&(u=!1);let f=Si(c,"x",Ve.gx),d=Si(c,"y",Ve.gx),p=Si(c,"w",Ve.gx),g=Si(c,"h",Ve.gx),m=ar(t,"hotSpot",Ve.kml),y=xb(m,"x"),A=xb(m,"y"),b=Da(m,"xunits"),x=Da(m,"yunits"),T=n.billboard;l(T)||(T=DOe(),n.billboard=T),T.image=u,T.scale=o,T.color=a,(l(f)||l(d)||l(p)||l(g))&&(T.imageSubRegion=new et(f,d,p,g)),l(s)&&s!==0&&(T.rotation=D.toRadians(-s),T.alignedAxis=h.UNIT_Z),o=o??1;let E,v;l(y)&&(b==="pixels"?E=-y*o:b==="insetPixels"?E=(y-bb)*o:b==="fraction"&&(E=-y*bb*o),E+=bb*.5*o),l(A)&&(x==="pixels"?v=A*o:x==="insetPixels"?v=(-A+bb)*o:x==="fraction"&&(v=A*bb*o),v-=bb*.5*o),(l(E)||l(v))&&(T.pixelOffset=new U(E,v))}function i7(e,t,n,i,r){for(let o=0,s=t.childNodes.length;o<s;o++){let a=t.childNodes.item(o);if(a.localName==="IconStyle")nPt(e,a,n,i,r);else if(a.localName==="LabelStyle"){let c=n.label;l(c)||(c=ROe(),n.label=c),c.scale=Si(a,"scale",Ve.kml)??c.scale,c.fillColor=$E(a,"color",Ve.kml)??c.fillColor,c.text=n.name}else if(a.localName==="LineStyle"){let c=n.polyline;l(c)||(c=new el,n.polyline=c),c.width=Si(a,"width",Ve.kml),c.material=$E(a,"color",Ve.kml),l($E(a,"outerColor",Ve.gx))&&_t("kml-gx:outerColor","KML - gx:outerColor is not supported in a LineStyle"),l(Si(a,"outerWidth",Ve.gx))&&_t("kml-gx:outerWidth","KML - gx:outerWidth is not supported in a LineStyle"),l(Si(a,"physicalWidth",Ve.gx))&&_t("kml-gx:physicalWidth","KML - gx:physicalWidth is not supported in a LineStyle"),l(ep(a,"labelVisibility",Ve.gx))&&_t("kml-gx:labelVisibility","KML - gx:labelVisibility is not supported in a LineStyle")}else if(a.localName==="PolyStyle"){let c=n.polygon;l(c)||(c=Fre(),n.polygon=c),c.material=$E(a,"color",Ve.kml)??c.material,c.fill=ep(a,"fill",Ve.kml)??c.fill,c.outline=ep(a,"outline",Ve.kml)??c.outline}else if(a.localName==="BalloonStyle"){let c=Pre(Fn(a,"bgColor",Ve.kml))??z.WHITE,u=Pre(Fn(a,"textColor",Ve.kml))??z.BLACK,f=Fn(a,"text",Ve.kml);n.addProperty("balloonStyle"),n.balloonStyle={bgColor:c,textColor:u,text:f}}else if(a.localName==="ListStyle"){let c=Fn(a,"listItemType",Ve.kml);(c==="radioFolder"||c==="checkOffOnly")&&_t(`kml-listStyle-${c}`,`KML - Unsupported ListStyle with listItemType: ${c}`)}}}function iPt(e,t,n,i,r){let o=new Jr,s,a=-1,c=t.childNodes,u=c.length;for(let d=0;d<u;d++){let p=c[d];(p.localName==="Style"||p.localName==="StyleMap")&&(a=d)}if(a!==-1){let d=c[a];if(d.localName==="Style")i7(e,d,o,i,r);else{let p=Qm(d,"Pair",Ve.kml);for(let g=0;g<p.length;g++){let m=p[g],y=Fn(m,"key",Ve.kml);if(y==="normal"){let A=Fn(m,"styleUrl",Ve.kml);if(l(A))s=n.getById(A),l(s)||(s=n.getById(`#${A}`)),l(s)&&o.merge(s);else{let b=ar(m,"Style",Ve.kml);i7(e,b,o,i,r)}}else _t(`kml-styleMap-${y}`,`KML - Unsupported StyleMap key: ${y}`)}}}let f=Fn(t,"styleUrl",Ve.kml);if(l(f)){let d=f;if(f[0]!=="#"&&f.indexOf("#")!==-1){let p=f.split("#"),g=p[0];d=`${i.getDerivedResource({url:g}).getUrlComponent()}#${p[1]}`}s=n.getById(d),l(s)||(s=n.getById(`#${d}`)),l(s)&&o.merge(s)}return o}function rPt(e,t,n){return t.fetchXML().then(function(i){return OOe(e,i,n,t,!0)})}function OOe(e,t,n,i,r,o){let s,a,c,u,f=TOe(t,"Style",Ve.kml);if(l(f)){let y=f.length;for(s=0;s<y;s++)u=f[s],a=Da(u,"id"),l(a)&&(a=`#${a}`,r&&l(i)&&(a=i.getUrlComponent()+a),l(n.getById(a))||(c=new Jr({id:a}),n.add(c),i7(e,u,c,i,o)))}let d=TOe(t,"StyleMap",Ve.kml);if(l(d)){let y=d.length;for(s=0;s<y;s++){let A=d[s];if(a=Da(A,"id"),l(a)){let b=Qm(A,"Pair",Ve.kml);for(let x=0;x<b.length;x++){let T=b[x],E=Fn(T,"key",Ve.kml);if(E==="normal"){if(a=`#${a}`,r&&l(i)&&(a=i.getUrlComponent()+a),!l(n.getById(a))){c=n.getOrCreateEntity(a);let v=Fn(T,"styleUrl",Ve.kml);if(l(v)){v[0]!=="#"&&(v=`#${v}`),r&&l(i)&&(v=i.getUrlComponent()+v);let S=n.getById(v);l(S)&&c.merge(S)}else u=ar(T,"Style",Ve.kml),i7(e,u,c,i,o)}}else _t(`kml-styleMap-${E}`,`KML - Unsupported StyleMap key: ${E}`)}}}}let p=[],g=t.getElementsByTagName("styleUrl"),m=g.length;for(s=0;s<m;s++){let y=g[s].textContent;if(y[0]!=="#"){let A=y.split("#");if(A.length===2){let b=A[0],x=i.getDerivedResource({url:b});p.push(rPt(e,x,n))}}}return p}function kre(e,t,n){let i=new R_(e,t.id,["position"]),r=new m0(t.position);t.polyline=l(n.polyline)?n.polyline.clone():new el,t.polyline.positions=new D_([i,r])}function MOe(e,t){return!l(e)&&!l(t)||e==="clampToGround"?We.CLAMP_TO_GROUND:e==="relativeToGround"?We.RELATIVE_TO_GROUND:e==="absolute"?We.NONE:t==="clampToSeaFloor"?(_t("kml-gx:altitudeMode-clampToSeaFloor","KML - <gx:altitudeMode>:clampToSeaFloor is currently not supported, using <kml:altitudeMode>:clampToGround."),We.CLAMP_TO_GROUND):t==="relativeToSeaFloor"?(_t("kml-gx:altitudeMode-relativeToSeaFloor","KML - <gx:altitudeMode>:relativeToSeaFloor is currently not supported, using <kml:altitudeMode>:relativeToGround."),We.RELATIVE_TO_GROUND):(l(e)?_t("kml-altitudeMode-unknown",`KML - Unknown <kml:altitudeMode>:${e}, using <kml:altitudeMode>:CLAMP_TO_GROUND.`):_t("kml-gx:altitudeMode-unknown",`KML - Unknown <gx:altitudeMode>:${t}, using <kml:altitudeMode>:CLAMP_TO_GROUND.`),We.CLAMP_TO_GROUND)}function oPt(e,t,n){return n==="relativeToSeaFloor"||t==="absolute"||t==="relativeToGround"?e:((l(t)&&t!=="clampToGround"||l(n)&&n!=="clampToSeaFloor")&&_t("kml-altitudeMode-unknown",`KML - Unknown altitudeMode: ${t??n}`),new m0(e))}function sPt(e,t,n,i){if(!l(e))return;if(n==="relativeToSeaFloor"||t==="absolute"||t==="relativeToGround")return e;(l(t)&&t!=="clampToGround"||l(n)&&n!=="clampToSeaFloor")&&_t("kml-altitudeMode-unknown",`KML - Unknown altitudeMode: ${t??n}`);let r=e.length;for(let o=0;o<r;o++){let s=e[o];i.scaleToGeodeticSurface(s,s)}return e}function s7(e,t,n,i){let r=t.label;l(r)||(r=l(n.label)?n.label.clone():ROe(),t.label=r),r.text=t.name;let o=t.billboard;if(l(o)||(o=l(n.billboard)?n.billboard.clone():DOe(),t.billboard=o),l(o.image)?o.image.getValue()||(o.image=void 0):o.image=e._pinBuilder.fromColor(z.YELLOW,64),l(o.scale)){let s=o.scale.getValue();s!==0?r.pixelOffset=new U(s*16+1,0):(r.pixelOffset=void 0,r.horizontalOrigin=void 0)}l(i)&&e._clampToGround&&(o.heightReference=i,r.heightReference=i)}function NOe(e,t){let n=e.path;l(n)||(n=new wg,n.leadTime=0,e.path=n);let i=t.polyline;l(i)&&(n.material=i.material,n.width=i.width)}function aPt(e,t,n,i,r){let o=Fn(n,"coordinates",Ve.kml),s=Fn(n,"altitudeMode",Ve.kml),a=Fn(n,"altitudeMode",Ve.gx),c=ep(n,"extrude",Ve.kml),u=e._ellipsoid,f=o7(o,u);return i.position=f,s7(e,i,r,MOe(s,a)),c&&GU(s,a)&&kre(t,i,r),!0}function EOe(e,t,n,i,r){let o=ar(n,"coordinates",Ve.kml),s=Fn(n,"altitudeMode",Ve.kml),a=Fn(n,"altitudeMode",Ve.gx),c=ep(n,"extrude",Ve.kml),u=ep(n,"tessellate",Ve.kml),f=GU(s,a),d=Si(n,"drawOrder",Ve.gx),p=e._ellipsoid,g=n7(o,p),m=r.polyline;if(f&&c){let y=new Ig;i.wall=y,y.positions=g;let A=r.polygon;l(A)&&(y.fill=A.fill,y.material=A.material),y.outline=!0,l(m)?(y.outlineColor=l(m.material)?m.material.color:z.WHITE,y.outlineWidth=m.width):l(A)&&(y.outlineColor=l(A.material)?A.material.color:z.WHITE)}else if(e._clampToGround&&!f&&u){let y=new el;y.clampToGround=!0,i.polyline=y,y.positions=g,l(m)?(y.material=l(m.material)?m.material.color.getValue(nt.MINIMUM_VALUE):z.WHITE,y.width=m.width??1):(y.material=z.WHITE,y.width=1),y.zIndex=d}else l(d)&&_t("kml-gx:drawOrder","KML - gx:drawOrder is not supported in LineStrings when clampToGround is false"),e._clampToGround&&!u&&_t("kml-line-tesselate","Ignoring clampToGround for KML lines without the tessellate flag."),m=l(m)?m.clone():new el,i.polyline=m,m.positions=sPt(g,s,a,p),(!u||f)&&(m.arcType=ln.NONE);return!0}function cPt(e,t,n,i,r){let o=ar(n,"outerBoundaryIs",Ve.kml),s=ar(o,"LinearRing",Ve.kml),a=ar(s,"coordinates",Ve.kml),c=e._ellipsoid,u=n7(a,c),f=ep(n,"extrude",Ve.kml),d=Fn(n,"altitudeMode",Ve.kml),p=Fn(n,"altitudeMode",Ve.gx),g=GU(d,p),m=l(r.polygon)?r.polygon.clone():Fre(),y=r.polyline;if(l(y)&&(m.outlineColor=l(y.material)?y.material.color:z.WHITE,m.outlineWidth=y.width),i.polygon=m,g?(m.perPositionHeight=!0,m.extrudedHeight=f?0:void 0):e._clampToGround||(m.height=0),l(u)){let A=new Oc(u),b=Qm(n,"innerBoundaryIs",Ve.kml);for(let x=0;x<b.length;x++){s=Qm(b[x],"LinearRing",Ve.kml);for(let T=0;T<s.length;T++)a=ar(s[T],"coordinates",Ve.kml),u=n7(a,c),l(u)&&A.holes.push(new Oc(u))}m.hierarchy=A}return!0}function lPt(e,t,n,i,r){let o=Fn(n,"altitudeMode",Ve.kml),s=Fn(n,"altitudeMode",Ve.gx),a=Qm(n,"coord",Ve.gx),c=Qm(n,"angles",Ve.gx),u=Qm(n,"when",Ve.kml),f=ep(n,"extrude",Ve.kml),d=GU(o,s),p=e._ellipsoid;c.length>0&&_t("kml-gx:angles","KML - gx:angles are not supported in gx:Tracks");let g=Math.min(a.length,u.length),m=[],y=[];for(let b=0;b<g;b++){let x=o7(a[b].textContent,p);m.push(x),y.push(K.fromIso8601(u[b].textContent))}let A=new _c;return A.addSamples(y,m),i.position=A,s7(e,i,r,MOe(o,s)),NOe(i,r),i.availability=new Ps,u.length>0&&i.availability.addInterval(new En({start:y[0],stop:y[y.length-1]})),d&&f&&kre(t,i,r),!0}function COe(e,t,n,i,r,o,s,a,c){let u=e[0],f=e[e.length-1],d=new _c;d.addSamples(e,t),n.intervals.addInterval(new En({start:u,stop:f,isStartIncluded:c,isStopIncluded:c,data:oPt(d,s,a)})),i.addInterval(new En({start:u,stop:f,isStartIncluded:c,isStopIncluded:c})),r.intervals.addInterval(new En({start:u,stop:f,isStartIncluded:c,isStopIncluded:c,data:o}))}function uPt(e,t,n,i,r){let o=ep(n,"interpolate",Ve.gx),s=Qm(n,"Track",Ve.gx),a,c,u,f=!1,d=new M_,p=new Ps,g=new pc,m=e._ellipsoid;for(let y=0,A=s.length;y<A;y++){let b=s[y],x=Qm(b,"when",Ve.kml),T=Qm(b,"coord",Ve.gx),E=Fn(b,"altitudeMode",Ve.kml),v=Fn(b,"altitudeMode",Ve.gx),S=GU(E,v),I=ep(b,"extrude",Ve.kml),R=Math.min(T.length,x.length),O=[];a=[];for(let L=0;L<R;L++){let _=o7(T[L].textContent,m);O.push(_),a.push(K.fromIso8601(x[L].textContent))}o&&(l(c)&&COe([c,a[0]],[u,O[0]],g,p,d,!1,"absolute",void 0,!1),c=a[R-1],u=O[O.length-1]),COe(a,O,g,p,d,S&&I,E,v,!0),f=f||S&&I}return i.availability=p,i.position=g,s7(e,i,r),NOe(i,r),f&&(kre(t,i,r),i.polyline.show=d),!0}var LOe={Point:aPt,LineString:EOe,LinearRing:EOe,Polygon:cPt,Track:lPt,MultiTrack:uPt,MultiGeometry:fPt,Model:dPt};function fPt(e,t,n,i,r,o){let s=n.childNodes,a=!1;for(let c=0,u=s.length;c<u;c++){let f=s.item(c),d=LOe[f.localName];if(l(d)){let p=POe(f,t,o);p.parent=i,p.name=i.name,p.availability=i.availability,p.description=i.description,p.kml=i.kml,d(e,t,f,p,r)&&(a=!0)}}return a}function dPt(e,t,n,i,r){return _t("kml-unsupportedGeometry",`KML - Unsupported geometry: ${n.localName}`),!1}function hPt(e,t){let n=ar(e,"ExtendedData",Ve.kml);if(!l(n))return;l(ar(n,"SchemaData",Ve.kml))&&_t("kml-schemaData","KML - SchemaData is unsupported"),l(Da(n,"xmlns:prefix"))&&_t("kml-extendedData","KML - ExtendedData with xmlns:prefix is unsupported");let i={},r=Qm(n,"Data",Ve.kml);if(l(r)){let o=r.length;for(let s=0;s<o;s++){let a=r[s],c=Da(a,"name");l(c)&&(i[c]={displayName:Fn(a,"displayName",Ve.kml),value:Fn(a,"value",Ve.kml)})}}t.kml.extendedData=i}var jr;typeof document<"u"&&(jr=document.createElement("div"));function mPt(e,t,n,i,r){let o,s,a,c=t.kml,u=c.extendedData,f=Fn(e,"description",Ve.kml),d=t.balloonStyle??n.balloonStyle,p=z.WHITE,g=z.BLACK,m=f;l(d)&&(p=d.bgColor??z.WHITE,g=d.textColor??z.BLACK,m=d.text??f);let y;if(l(m)){if(m=m.replace("$[name]",t.name??""),m=m.replace("$[description]",f??""),m=m.replace("$[address]",c.address??""),m=m.replace("$[Snippet]",c.snippet??""),m=m.replace("$[id]",t.id),m=m.replace("$[geDirections]",""),l(u)){let x=m.match(/\$\[.+?\]/g);if(x!==null)for(o=0;o<x.length;o++){let T=x[o],E=T.substr(2,T.length-3),v=/\/displayName$/.test(E);E=E.replace(/\/displayName$/,""),y=u[E],l(y)&&(y=v?y.displayName:y.value),l(y)&&(m=m.replace(T,y??""))}}}else if(l(u)&&(a=Object.keys(u),a.length>0)){for(m='<table class="cesium-infoBox-defaultTable cesium-infoBox-defaultTable-lighter"><tbody>',o=0;o<a.length;o++)s=a[o],y=u[s],m+=`<tr><th>${y.displayName??s}</th><td>${y.value??""}</td></tr>`;m+="</tbody></table>"}if(!l(m))return;m=KIt.link(m),jr.innerHTML=m;let A=jr.querySelectorAll("a");for(o=0;o<A.length;o++)A[o].setAttribute("target","_blank");l(i)&&i.keys.length>1&&(cd(jr,"a","href",i),cd(jr,"link","href",i),cd(jr,"area","href",i),cd(jr,"img","src",i),cd(jr,"iframe","src",i),cd(jr,"video","src",i),cd(jr,"audio","src",i),cd(jr,"source","src",i),cd(jr,"track","src",i),cd(jr,"input","src",i),cd(jr,"embed","src",i),cd(jr,"script","src",i),cd(jr,"video","poster",i)),ld(jr,"a","href",r),ld(jr,"link","href",r),ld(jr,"area","href",r),ld(jr,"img","src",r),ld(jr,"iframe","src",r),ld(jr,"video","src",r),ld(jr,"audio","src",r),ld(jr,"source","src",r),ld(jr,"track","src",r),ld(jr,"input","src",r),ld(jr,"embed","src",r),ld(jr,"script","src",r),ld(jr,"video","poster",r);let b='<div class="cesium-infoBox-description-lighter" style="';b+="overflow:auto;",b+="word-wrap:break-word;",b+=`background-color:${p.toCssColorString()};`,b+=`color:${g.toCssColorString()};`,b+='">',b+=`${jr.innerHTML}</div>`,jr.innerHTML="",t.description=b}function a7(e,t,n){let i=n.entityCollection,r=n.parentEntity,o=n.sourceResource,s=n.uriResolver,a=POe(t,i,n.context),c=a.kml,u=iPt(e,t,n.styleCollection,o,s),f=Fn(t,"name",Ve.kml);a.name=f,a.parent=r;let d=tPt(t);l(d)||(d=ePt(t)),a.availability=d,zre(a);function p(T){return T?T.show&&p(T.parent):!0}let g=ep(t,"visibility",Ve.kml);a.show=p(r)&&(g??!0);let m=ar(t,"author",Ve.atom),y=c.author;y.name=Fn(m,"name",Ve.atom),y.uri=Fn(m,"uri",Ve.atom),y.email=Fn(m,"email",Ve.atom);let A=ar(t,"link",Ve.atom),b=c.link;b.href=Da(A,"href"),b.hreflang=Da(A,"hreflang"),b.rel=Da(A,"rel"),b.type=Da(A,"type"),b.title=Da(A,"title"),b.length=Da(A,"length"),c.address=Fn(t,"address",Ve.kml),c.phoneNumber=Fn(t,"phoneNumber",Ve.kml),c.snippet=Fn(t,"Snippet",Ve.kml),hPt(t,a),mPt(t,a,u,s,o);let x=e._ellipsoid;return kOe(t,a,x),BOe(t,a,x),l(ar(t,"Region",Ve.kml))&&_t("kml-region","KML - Placemark Regions are unsupported"),{entity:a,styleEntity:u}}function FOe(e,t,n,i){i.addNodes(t.childNodes,n),i.process()}function pPt(e,t,n,i){let r=a7(e,t,n),o=Je(n);o.parentEntity=r.entity,FOe(e,t,o,i)}function gPt(e,t,n,i){let r=a7(e,t,n),o=r.entity,s=r.styleEntity,a=!1,c=t.childNodes;for(let u=0,f=c.length;u<f&&!a;u++){let d=c.item(u),p=LOe[d.localName];l(p)&&(p(e,n.entityCollection,d,o,s,o.id),a=!0)}a||(o.merge(s),s7(e,o,s))}var _Pt={FlyTo:bPt,Wait:APt,SoundCue:vre,AnimatedUpdate:vre,TourControl:vre};function yPt(e,t,n,i){let r=Fn(t,"name",Ve.kml),o=Da(t,"id"),s=new UU(r,o),a=ar(t,"Playlist",Ve.gx);if(a){let c=e._ellipsoid,u=a.childNodes;for(let f=0;f<u.length;f++){let d=u[f];if(d.localName){let p=_Pt[d.localName];p?p(s,d,c):console.log(`Unknown KML Tour playlist entry type ${d.localName}`)}}}e._kmlTours.push(s)}function vre(e,t){_t(`KML Tour unsupported node ${t.localName}`)}function APt(e,t){let n=Si(t,"duration",Ve.gx);e.addPlaylistEntry(new jU(n))}function bPt(e,t,n){let i=Si(t,"duration",Ve.gx),r=Fn(t,"flyToMode",Ve.gx),o={kml:{}};kOe(t,o,n),BOe(t,o,n);let s=o.kml.lookAt||o.kml.camera,a=new VU(i,r,s);e.addPlaylistEntry(a)}function BOe(e,t,n){let i=ar(e,"Camera",Ve.kml);if(l(i)){let r=Si(i,"longitude",Ve.kml)??0,o=Si(i,"latitude",Ve.kml)??0,s=Si(i,"altitude",Ve.kml)??0,a=Si(i,"heading",Ve.kml)??0,c=Si(i,"tilt",Ve.kml)??0,u=Si(i,"roll",Ve.kml)??0,f=h.fromDegrees(r,o,s,n),d=wc.fromDegrees(a,c-90,u);t.kml.camera=new BU(f,d)}}function kOe(e,t,n){let i=ar(e,"LookAt",Ve.kml);if(l(i)){let r=Si(i,"longitude",Ve.kml)??0,o=Si(i,"latitude",Ve.kml)??0,s=Si(i,"altitude",Ve.kml)??0,a=Si(i,"heading",Ve.kml),c=Si(i,"tilt",Ve.kml),u=Si(i,"range",Ve.kml)??0;c=D.toRadians(c??0),a=D.toRadians(a??0);let f=new ph(a,c-D.PI_OVER_TWO,u),d=h.fromDegrees(r,o,s,n);t.kml.lookAt=new kU(d,f)}}function xPt(e,t,n,i){let r=n.screenOverlayContainer;if(!l(r))return;let o=n.sourceResource,s=n.uriResolver,a=ar(t,"Icon",Ve.kml),c=Bre(a,e,o,s,!1);if(!l(c))return;let u=document.createElement("img");e._screenOverlays.push(u),u.src=c.url,u.onload=function(){let f=["position: absolute"],d=ar(t,"screenXY",Ve.kml),p=ar(t,"overlayXY",Ve.kml),g=ar(t,"size",Ve.kml),m,y,A,b,x,T;l(g)&&(m=xb(g,"x"),y=xb(g,"y"),A=Da(g,"xunits"),b=Da(g,"yunits"),l(m)&&m!==-1&&m!==0&&(A==="fraction"?x=`width: ${Math.floor(m*100)}%`:A==="pixels"&&(x=`width: ${m}px`),f.push(x)),l(y)&&y!==-1&&y!==0&&(b==="fraction"?T=`height: ${Math.floor(y*100)}%`:b==="pixels"&&(T=`height: ${y}px`),f.push(T))),u.style=f.join(";");let E=0,v=u.height;l(p)&&(m=xb(p,"x"),y=xb(p,"y"),A=Da(p,"xunits"),b=Da(p,"yunits"),l(m)&&(A==="fraction"?E=m*u.width:(A==="pixels"||A==="insetPixels")&&(E=m)),l(y)&&(b==="fraction"?v=y*u.height:(b==="pixels"||b==="insetPixels")&&(v=y))),l(d)&&(m=xb(d,"x"),y=xb(d,"y"),A=Da(d,"xunits"),b=Da(d,"yunits"),l(m)&&(A==="fraction"?x=`left: calc(${Math.floor(m*100)}% - ${E}px)`:A==="pixels"?x=`left: ${m-E}px`:A==="insetPixels"&&(x=`right: ${m-E}px`),f.push(x)),l(y)&&(b==="fraction"?T=`bottom: calc(${Math.floor(y*100)}% - ${v}px)`:b==="pixels"?T=`bottom: ${y-v}px`:b==="insetPixels"&&(T=`top: ${y-v}px`),f.push(T))),u.style=f.join(";")},r.appendChild(u)}function TPt(e,t,n,i){let o=a7(e,t,n).entity,s,a=!1,c=e._ellipsoid,u=n7(ar(t,"LatLonQuad",Ve.gx),c),f=Si(t,"drawOrder",Ve.kml);if(l(u))s=Fre(),s.hierarchy=new Oc(u),s.zIndex=f,o.polygon=s,a=!0;else{s=new tm,s.zIndex=f,o.rectangle=s;let m=ar(t,"LatLonBox",Ve.kml);if(l(m)){let y=Si(m,"west",Ve.kml),A=Si(m,"south",Ve.kml),b=Si(m,"east",Ve.kml),x=Si(m,"north",Ve.kml);l(y)&&(y=D.negativePiToPi(D.toRadians(y))),l(A)&&(A=D.clampToLatitudeRange(D.toRadians(A))),l(b)&&(b=D.negativePiToPi(D.toRadians(b))),l(x)&&(x=D.clampToLatitudeRange(D.toRadians(x))),s.coordinates=new ie(y,A,b,x);let T=Si(m,"rotation",Ve.kml);if(l(T)){let E=D.toRadians(T);s.rotation=E,s.stRotation=E}}}let d=ar(t,"Icon",Ve.kml),p=Bre(d,e,n.sourceResource,n.uriResolver,!0);if(l(p)){a&&_t("kml-gx:LatLonQuad","KML - gx:LatLonQuad Icon does not support texture projection.");let m=Si(d,"x",Ve.gx),y=Si(d,"y",Ve.gx),A=Si(d,"w",Ve.gx),b=Si(d,"h",Ve.gx);(l(m)||l(y)||l(A)||l(b))&&_t("kml-groundOverlay-xywh","KML - gx:x, gx:y, gx:w, gx:h aren't supported for GroundOverlays"),s.material=p,s.material.color=$E(t,"color",Ve.kml),s.material.transparent=!0}else s.material=$E(t,"color",Ve.kml);let g=Fn(t,"altitudeMode",Ve.kml);l(g)?g==="absolute"?(s.height=Si(t,"altitude",Ve.kml),s.zIndex=void 0):g!=="clampToGround"&&_t("kml-altitudeMode-unknown",`KML - Unknown altitudeMode: ${g}`):(g=Fn(t,"altitudeMode",Ve.gx),g==="relativeToSeaFloor"?(_t("kml-altitudeMode-relativeToSeaFloor","KML - altitudeMode relativeToSeaFloor is currently not supported, treating as absolute."),s.height=Si(t,"altitude",Ve.kml),s.zIndex=void 0):g==="clampToSeaFloor"?_t("kml-altitudeMode-clampToSeaFloor","KML - altitudeMode clampToSeaFloor is currently not supported, treating as clampToGround."):l(g)&&_t("kml-altitudeMode-unknown",`KML - Unknown altitudeMode: ${g}`))}function UOe(e,t,n,i){e._unsupportedNode.raiseEvent(e,n.parentEntity,t,n.entityCollection,n.styleCollection,n.sourceResource,n.uriResolver),_t(`kml-unsupportedFeature-${t.nodeName}`,`KML - Unsupported feature: ${t.nodeName}`)}var Tb={INTERVAL:0,EXPIRE:1,STOP:2};function r7(e){if(!l(e)||e.length===0)return"";let t=e[0];return(t==="&"||t==="?")&&(e=e.substring(1)),e}var EPt=new ie,lP=new he,Sre=new U,CPt=new h;function Ure(e,t,n,i,r,o){function s(u){return u<-D.PI_OVER_TWO?-D.PI_OVER_TWO:u>D.PI_OVER_TWO?D.PI_OVER_TWO:u}function a(u){return u>D.PI?u-D.TWO_PI:u<-D.PI?u+D.TWO_PI:u}let c=rx(e.queryParameters);if(c=c.replace(/%5B/g,"[").replace(/%5D/g,"]"),l(t)&&t._mode!==re.MORPHING){let u,f;if(r=r??EPt,l(n)&&(Sre.x=n.clientWidth*.5,Sre.y=n.clientHeight*.5,u=t.pickEllipsoid(Sre,o,CPt)),l(u)?f=o.cartesianToCartographic(u,lP):(f=ie.center(r,lP),u=o.cartographicToCartesian(f)),l(i)&&!D.equalsEpsilon(i,1,D.EPSILON9)){let b=r.width*i*.5,x=r.height*i*.5;r=new ie(a(f.longitude-b),s(f.latitude-x),a(f.longitude+b),s(f.latitude+x))}c=c.replace("[bboxWest]",D.toDegrees(r.west).toString()),c=c.replace("[bboxSouth]",D.toDegrees(r.south).toString()),c=c.replace("[bboxEast]",D.toDegrees(r.east).toString()),c=c.replace("[bboxNorth]",D.toDegrees(r.north).toString());let d=D.toDegrees(f.longitude).toString(),p=D.toDegrees(f.latitude).toString();c=c.replace("[lookatLon]",d),c=c.replace("[lookatLat]",p),c=c.replace("[lookatTilt]",D.toDegrees(t.pitch).toString()),c=c.replace("[lookatHeading]",D.toDegrees(t.heading).toString()),c=c.replace("[lookatRange]",h.distance(t.positionWC,u)),c=c.replace("[lookatTerrainLon]",d),c=c.replace("[lookatTerrainLat]",p),c=c.replace("[lookatTerrainAlt]",f.height.toString()),o.cartesianToCartographic(t.positionWC,lP),c=c.replace("[cameraLon]",D.toDegrees(lP.longitude).toString()),c=c.replace("[cameraLat]",D.toDegrees(lP.latitude).toString()),c=c.replace("[cameraAlt]",D.toDegrees(lP.height).toString());let g=t.frustum,m=g.aspectRatio,y="",A="";if(l(m)){let b=D.toDegrees(g.fov);m>1?(y=b,A=b/m):(A=b,y=b*m)}c=c.replace("[horizFov]",y.toString()),c=c.replace("[vertFov]",A.toString())}else c=c.replace("[bboxWest]","-180"),c=c.replace("[bboxSouth]","-90"),c=c.replace("[bboxEast]","180"),c=c.replace("[bboxNorth]","90"),c=c.replace("[lookatLon]",""),c=c.replace("[lookatLat]",""),c=c.replace("[lookatRange]",""),c=c.replace("[lookatTilt]",""),c=c.replace("[lookatHeading]",""),c=c.replace("[lookatTerrainLon]",""),c=c.replace("[lookatTerrainLat]",""),c=c.replace("[lookatTerrainAlt]",""),c=c.replace("[cameraLon]",""),c=c.replace("[cameraLat]",""),c=c.replace("[cameraAlt]",""),c=c.replace("[horizFov]",""),c=c.replace("[vertFov]","");l(n)?(c=c.replace("[horizPixels]",n.clientWidth),c=c.replace("[vertPixels]",n.clientHeight)):(c=c.replace("[horizPixels]",""),c=c.replace("[vertPixels]","")),c=c.replace("[terrainEnabled]","1"),c=c.replace("[clientVersion]","1"),c=c.replace("[kmlVersion]","2.2"),c=c.replace("[clientName]","Cesium"),c=c.replace("[language]","English"),e.setQueryParameters(Ef(c))}function vPt(e,t,n,i){let o=a7(e,t,n).entity,s=n.sourceResource,a=n.uriResolver,c=ar(t,"Link",Ve.kml);if(l(c)||(c=ar(t,"Url",Ve.kml)),l(c)){let u=Fn(c,"href",Ve.kml),f,d;if(l(u)){let p=u;if(u=Lre(u,s,n.uriResolver),/^data:/.test(u.getUrlComponent()))/\.kmz/i.test(s.getUrlComponent())||(p=s.getDerivedResource({url:p}));else{if(p=u.clone(),f=Fn(c,"viewRefreshMode",Ve.kml),f==="onRegion"){_t("kml-refrehMode-onRegion","KML - Unsupported viewRefreshMode: onRegion");return}d=Fn(c,"viewBoundScale",Ve.kml)??1;let A=f==="onStop"?"BBOX=[bboxWest],[bboxSouth],[bboxEast],[bboxNorth]":"",b=Fn(c,"viewFormat",Ve.kml)??A,x=Fn(c,"httpQuery",Ve.kml);l(b)&&u.setQueryParameters(Ef(r7(b))),l(x)&&u.setQueryParameters(Ef(r7(x)));let T=e._ellipsoid;Ure(u,e.camera,e.canvas,d,e._lastCameraView.bbox,T)}let g={sourceUri:p,uriResolver:a,context:o.id,screenOverlayContainer:n.screenOverlayContainer},m=new Ya,y=Rre(e,m,u,g).then(function(A){let b=e._entityCollection,x=m.values;b.suspendEvents();for(let v=0;v<x.length;v++){let S=x[v];l(S.parent)||(S.parent=o,zre(S)),b.add(S)}b.resumeEvents();let T=Fn(c,"refreshMode",Ve.kml),E=Si(c,"refreshInterval",Ve.kml)??0;if(T==="onInterval"&&E>0||T==="onExpire"||f==="onStop"){let v=ar(A,"NetworkLinkControl",Ve.kml),S=l(v),I=K.now(),R={id:Kn(),href:u,cookie:{},lastUpdated:I,updating:!1,entity:o,viewBoundScale:d,needsUpdate:!1,cameraUpdateTime:I},O=0;if(S&&(R.cookie=Ef(Fn(v,"cookie",Ve.kml)??""),O=Si(v,"minRefreshPeriod",Ve.kml)??0),T==="onInterval")S&&(E=Math.max(O,E)),R.refreshMode=Tb.INTERVAL,R.time=E;else if(T==="onExpire"){let L;if(S&&(L=Fn(v,"expires",Ve.kml)),l(L))try{let _=K.fromIso8601(L),C=K.secondsDifference(_,I);C>0&&C<O&&K.addSeconds(I,O,_),R.refreshMode=Tb.EXPIRE,R.time=_}catch{_t("kml-refreshMode-onInterval-onExpire","KML - NetworkLinkControl expires is not a valid date")}else _t("kml-refreshMode-onExpire","KML - refreshMode of onExpire requires the NetworkLinkControl to have an expires element")}else l(e.camera)?(R.refreshMode=Tb.STOP,R.time=Si(c,"viewRefreshTime",Ve.kml)??0):_t("kml-refrehMode-onStop-noCamera","A NetworkLink with viewRefreshMode=onStop requires the `camera` property to be defined.");l(R.refreshMode)&&e._networkLinks.set(R.id,R)}}).catch(function(A){_t(`An error occured during loading ${u.url}`),e._error.raiseEvent(e,A)});i.addPromise(y)}}}function SPt(e,t,n,i){let r=Nre[t.localName];return l(r)?r(e,t,n,i):UOe(e,t,n,i)}function Dre(e,t,n,i,r,o,s){t.removeAll();let a=n.documentElement,c=a.localName==="Document"?a:ar(a,"Document",Ve.kml),u=Fn(c,"name",Ve.kml);l(u)||(u=I_(i.getUrlComponent())),l(e._name)||(e._name=u);let f=new Q_._DeferredLoading(e),d=new Ya(e);return Promise.all(OOe(e,n,d,i,!1,r)).then(function(){let p=n.documentElement;if(p.localName==="kml"){let m=p.childNodes;for(let y=0;y<m.length;y++){let A=m[y];if(l(Nre[A.localName])){p=A;break}}}let g={parentEntity:void 0,entityCollection:t,styleCollection:d,sourceResource:i,uriResolver:r,context:s,screenOverlayContainer:o};return t.suspendEvents(),SPt(e,p,g,f),t.resumeEvents(),f.wait().then(function(){return n.documentElement})})}async function wPt(e,t,n,i,r){let o=Zt("ThirdParty/Workers/zip-web-worker.js"),s=Zt("ThirdParty/zip-module.wasm");Y3({workerURI:o,wasmURI:s});let a=new BE(new of(n)),c=await a.getEntries(),u=[],f={},d;for(let p=0;p<c.length;p++){let g=c[p];g.directory||(/\.kml$/i.test(g.filename)&&(!l(d)||!/\//i.test(g.filename))?(l(d)&&u.push(Cre(d,f)),d=g):u.push(Cre(g,f)))}if(l(d)&&u.push(QIt(d,f)),await Promise.all(u),a.close(),!l(f.kml))throw new oe("KMZ file does not contain a KML document.");return f.keys=Object.keys(f),Dre(e,t,f.kml,i,f,r)}function Rre(e,t,n,i){i=i??H.EMPTY_OBJECT;let r=i.sourceUri,o=i.uriResolver,s=i.context,a=i.screenOverlayContainer,c=n;if(typeof n=="string"||n instanceof De){n=De.createIfNeeded(n),c=n.fetchBlob(),r=r??n.clone();let u=e._resourceCredits,f=n.credits;if(l(f)){let d=f.length;for(let p=0;p<d;p++)u.push(f[p])}}else r=r??De.DEFAULT.clone();return r=De.createIfNeeded(r),l(a)&&(a=Ln(a)),Promise.resolve(c).then(function(u){return u instanceof Blob?JIt(u).then(function(f){return f?wPt(e,t,u,r,a):ZIt(u).then(function(d){d=wOe(d),d=IOe(d);let p,g;try{p=Mre.parseFromString(d,"application/xml")}catch(m){g=m.toString()}if(l(g)||p.body||p.documentElement.tagName==="parsererror"){let m=l(g)?g:p.documentElement.firstChild.nodeValue;throw m||(m=p.body.innerText),new oe(m)}return Dre(e,t,p,r,o,a,s)})}):Dre(e,t,u,r,o,a,s)}).catch(function(u){return e._error.raiseEvent(e,u),console.log(u),Promise.reject(u)})}var Q_=class e{constructor(t){t=t??H.EMPTY_OBJECT;let n=t.camera,i=t.canvas;this._changed=new be,this._error=new be,this._loading=new be,this._refresh=new be,this._unsupportedNode=new be,this._clock=void 0,this._entityCollection=new Ya(this),this._name=void 0,this._isLoading=!1,this._pinBuilder=new $_,this._networkLinks=new Ut,this._entityCluster=new $f,this.canvas=i,this.camera=n,this._lastCameraView={position:l(n)?h.clone(n.positionWC):void 0,direction:l(n)?h.clone(n.directionWC):void 0,up:l(n)?h.clone(n.upWC):void 0,bbox:l(n)?n.computeViewRectangle():ie.clone(ie.MAX_VALUE)},this._ellipsoid=t.ellipsoid??ee.default;let r=t.credit;typeof r=="string"&&(r=new It(r)),this._credit=r,this._resourceCredits=[],this._kmlTours=[],this._screenOverlays=[]}static load(t,n){return n=n??H.EMPTY_OBJECT,new e(n).load(t,n)}get name(){return this._name}set name(t){this._name!==t&&(this._name=t,this._changed.raiseEvent(this))}get clock(){return this._clock}get entities(){return this._entityCollection}get isLoading(){return this._isLoading}get changedEvent(){return this._changed}get errorEvent(){return this._error}get loadingEvent(){return this._loading}get refreshEvent(){return this._refresh}get unsupportedNodeEvent(){return this._unsupportedNode}get show(){return this._entityCollection.show}set show(t){this._entityCollection.show=t}get clustering(){return this._entityCluster}set clustering(t){this._entityCluster=t}get credit(){return this._credit}get kmlTours(){return this._kmlTours}load(t,n){n=n??H.EMPTY_OBJECT,Ds.setLoading(this,!0);let i=this._name;this._name=void 0,this._clampToGround=n.clampToGround??!1;let r=this;return Rre(this,this._entityCollection,t,n).then(function(){let o,s=r._entityCollection.computeAvailability(),a=s.start,c=s.stop,u=K.equals(a,nt.MINIMUM_VALUE),f=K.equals(c,nt.MAXIMUM_VALUE);if(!u||!f){let p;u&&(p=new Date,p.setHours(0,0,0,0),a=K.fromDate(p)),f&&(p=new Date,p.setHours(24,0,0,0),c=K.fromDate(p)),o=new Fm,o.startTime=a,o.stopTime=c,o.currentTime=K.clone(a),o.clockRange=Rs.LOOP_STOP,o.clockStep=Vr.SYSTEM_CLOCK_MULTIPLIER,o.multiplier=Math.round(Math.min(Math.max(K.secondsDifference(c,a)/60,1),31556900))}let d=!1;return o!==r._clock&&(r._clock=o,d=!0),i!==r._name&&(d=!0),d&&r._changed.raiseEvent(r),Ds.setLoading(r,!1),r}).catch(function(o){return Ds.setLoading(r,!1),r._error.raiseEvent(r,o),console.log(o),Promise.reject(o)})}destroy(){for(;this._screenOverlays.length>0;)this._screenOverlays.pop().remove()}update(t){let n=this._networkLinks;if(n.length===0)return!0;let i=K.now(),r=this;wre.removeAll();function o(d){let p=d._children,g=p.length;for(let m=0;m<g;++m){let y=p[m];wre.set(y.id,y),o(y)}}let s=!1,a=this._lastCameraView,c=this.camera;l(c)&&!(c.positionWC.equalsEpsilon(a.position,D.EPSILON7)&&c.directionWC.equalsEpsilon(a.direction,D.EPSILON7)&&c.upWC.equalsEpsilon(a.up,D.EPSILON7))&&(a.position=h.clone(c.positionWC),a.direction=h.clone(c.directionWC),a.up=h.clone(c.upWC),a.bbox=c.computeViewRectangle(),s=!0);let u=new Ut,f=!1;return n.values.forEach(function(d){let p=d.entity;if(!wre.contains(p.id)){if(!d.updating){let g=!1;if(d.refreshMode===Tb.INTERVAL?K.secondsDifference(i,d.lastUpdated)>d.time&&(g=!0):d.refreshMode===Tb.EXPIRE?K.greaterThan(i,d.time)&&(g=!0):d.refreshMode===Tb.STOP&&(s&&(d.needsUpdate=!0,d.cameraUpdateTime=i),d.needsUpdate&&K.secondsDifference(i,d.cameraUpdateTime)>=d.time&&(g=!0)),g){o(p),d.updating=!0;let m=new Ya,y=d.href.clone();y.setQueryParameters(d.cookie);let A=r._ellipsoid??ee.default;Ure(y,r.camera,r.canvas,d.viewBoundScale,a.bbox,A),Rre(r,m,y,{context:p.id}).then(IPt(r,d,m,u,y)).catch(function(b){let x=`NetworkLink ${d.href} refresh failed: ${b}`;console.log(x),r._error.raiseEvent(r,x)}),f=!0}}u.set(d.id,d)}}),f&&(this._networkLinks=u,this._changed.raiseEvent(this)),!0}};function zre(e){let t=e.parent;if(l(t)){let n=t.availability;if(l(n)){let i=e.availability;l(i)?i.intersect(n):e.availability=n}}}function IPt(e,t,n,i,r){return function(o){if(!i.contains(t.id))return;let s=!1,a=ar(o,"NetworkLinkControl",Ve.kml),c=l(a),u=0;if(c){if(l(ar(a,"Update",Ve.kml))){_t("kml-networkLinkControl-update","KML - NetworkLinkControl updates aren't supported."),t.updating=!1,i.remove(t.id);return}t.cookie=Ef(Fn(a,"cookie",Ve.kml)??""),u=Si(a,"minRefreshPeriod",Ve.kml)??0}let f=K.now(),d=t.refreshMode;if(d===Tb.INTERVAL)l(a)&&(t.time=Math.max(u,t.time));else if(d===Tb.EXPIRE){let I;if(l(a)&&(I=Fn(a,"expires",Ve.kml)),l(I))try{let R=K.fromIso8601(I),O=K.secondsDifference(R,f);O>0&&O<u&&K.addSeconds(f,u,R),t.time=R}catch{_t("kml-networkLinkControl-expires","KML - NetworkLinkControl expires is not a valid date"),s=!0}else _t("kml-refreshMode-onExpire","KML - refreshMode of onExpire requires the NetworkLinkControl to have an expires element"),s=!0}let p=t.entity,g=e._entityCollection,m=n.values;function y(I){g.remove(I);let R=I._children,O=R.length;for(let L=0;L<O;++L)y(R[L])}g.suspendEvents();let A=g.values.slice(),b;for(b=0;b<A.length;++b){let I=A[b];I.parent===p&&(I.parent=void 0,y(I))}for(g.resumeEvents(),g.suspendEvents(),b=0;b<m.length;b++){let I=m[b];l(I.parent)||(I.parent=p,zre(I)),g.add(I)}g.resumeEvents(),s?i.remove(t.id):t.lastUpdated=f;let x=g.computeAvailability(),T=x.start,E=x.stop,v=K.equals(T,nt.MINIMUM_VALUE),S=K.equals(E,nt.MAXIMUM_VALUE);if(!v||!S){let I=e._clock;(I.startTime!==T||I.stopTime!==E)&&(I.startTime=T,I.stopTime=E,e._changed.raiseEvent(e))}t.updating=!1,t.needsUpdate=!1,e._refresh.raiseEvent(e,r.getUrlComponent(!0))}}var wre=new Ut,Ore=class{constructor(){this.author={name:void 0,uri:void 0,email:void 0},this.link={href:void 0,hreflang:void 0,rel:void 0,type:void 0,title:void 0,length:void 0},this.address=void 0,this.phoneNumber=void 0,this.snippet=void 0,this.extendedData=void 0}};Q_._DeferredLoading=Ire;Q_._getTimestamp=xn;var JE=Q_;function WU(){pe.throwInstantiationError()}WU.prototype.update=pe.throwInstantiationError;WU.prototype.getBoundingSphere=pe.throwInstantiationError;WU.prototype.isDestroyed=pe.throwInstantiationError;WU.prototype.destroy=pe.throwInstantiationError;var Vre=WU;async function PPt(e,t,n,i){return l(i)||(i=!1),OPt(e,t,n,i)}function DPt(e,t,n){let i=e[0],r=i.terrainProvider.requestTileGeometry(i.x,i.y,i.level);if(!r)return!1;let o;return n?o=r.then(VOe(i)):o=r.then(VOe(i)).catch(MPt(i)),e.shift(),t.push(o),!0}function RPt(e){return new Promise(function(t){setTimeout(t,e)})}function jre(e,t,n){return e.length?DPt(e,t,n)?jre(e,t,n):RPt(100).then(()=>jre(e,t,n)):Promise.resolve()}function OPt(e,t,n,i){let r=e.tilingScheme,o,s=[],a={};for(o=0;o<n.length;++o){let u=r.positionToTileXY(n[o],t);if(!l(u))continue;let f=u.toString();if(!a.hasOwnProperty(f)){let d={x:u.x,y:u.y,level:t,tilingScheme:r,terrainProvider:e,positions:[]};a[f]=d,s.push(d)}a[f].positions.push(n[o])}let c=[];return jre(s,c,i).then(function(){return Promise.all(c).then(function(){return n})})}function zOe(e,t,n){let i=t.interpolateHeight(n,e.longitude,e.latitude);return i===void 0?!1:(e.height=i,!0)}function VOe(e){let t=e.positions,n=e.tilingScheme.tileXYToRectangle(e.x,e.y,e.level);return function(i){let r=!1;for(let o=0;o<t.length;++o){let s=t[o];if(!zOe(s,i,n)){r=!0;break}}return r?i.createMesh({tilingScheme:e.tilingScheme,x:e.x,y:e.y,level:e.level,throttle:!1}).then(function(){for(let o=0;o<t.length;++o){let s=t[o];zOe(s,i,n)}}):Promise.resolve()}}function MPt(e){let t=e.positions;return function(){for(let n=0;n<t.length;++n){let i=t[n];i.height=void 0}}}var qU=PPt;var Hre=new U;async function jOe(e,t,n){l(n)||(n=!1);let i=[],r=[],o=e.availability,s=[];for(let c=0;c<t.length;++c){let u=t[c],f=o.computeMaximumLevelAtPosition(u);if(r[c]=f,f===0){e.tilingScheme.positionToTileXY(u,1,Hre);let p=e.loadTileDataAvailability(Hre.x,Hre.y,1);l(p)&&s.push(p)}let d=i[f];l(d)||(i[f]=d=[]),d.push(u)}await Promise.all(s),await Promise.all(i.map(function(c,u){if(l(c))return qU(e,u,c,n)}));let a=[];for(let c=0;c<t.length;++c){let u=t[c];o.computeMaximumLevelAtPosition(u)!==r[c]&&a.push(u)}return a.length>0&&await jOe(e,a,n),t}var ZE=jOe;async function Gre(e,t){let n=t.terrainProvider,i=t.mapProjection,r=i.ellipsoid,o,s=t.camera.getRectangleCameraCoordinates(e);if(t.mode===re.SCENE3D?o=r.cartesianToCartographic(s):o=i.unproject(s),!l(n))return o;let a=n.availability;if(!l(a)||t.mode===re.SCENE2D)return o;let c=[ie.center(e),ie.southeast(e),ie.southwest(e),ie.northeast(e),ie.northwest(e)],u=await Gre._sampleTerrainMostDetailed(n,c),f=!1,d=u.reduce(function(g,m){return l(m.height)?(f=!0,Math.max(m.height,g)):g},-Number.MAX_VALUE),p=o;return f&&(p.height+=d),p}Gre._sampleTerrainMostDetailed=ZE;var QE=Gre;var HOe={NONE:0,LERC:1};Object.freeze(HOe);var xh=HOe;var GOe={NONE:0,BITS12:1};Object.freeze(GOe);var $a=GOe;var YU=new h,NPt=new h,Th=new U,LPt=new N,FPt=new N,BPt=Math.pow(2,12);function Vc(e,t,n,i,r,o,s,a,c,u){let f=$a.NONE,d,p;if(l(t)&&l(n)&&l(i)&&l(r)){let g=t.minimum,m=t.maximum,y=h.subtract(m,g,NPt),A=i-n;Math.max(h.maximumComponent(y),A)<BPt-1?f=$a.BITS12:f=$a.NONE;let x=N.fromScale(y,LPt);x=N.setTranslation(x,g,x);let T=N.fromScale(h.fromElements(1/y.x,1/y.y,1/y.z,YU),FPt);T=N.multiplyByTranslation(T,h.negate(g,YU),T),p=N.clone(r,new N);let E=N.getTranslation(r,YU);E=h.subtract(E,e,YU),p=N.setTranslation(p,E,p),p=N.multiply(p,x,p),d=N.inverseTransformation(r,new N),d=N.multiply(T,d,d),r=N.multiply(r,x,new N)}this.quantization=f,this.minimumHeight=n,this.maximumHeight=i,this.center=h.clone(e),this.toScaledENU=d,this.fromScaledENU=r,this.matrix=p,this.hasVertexNormals=o??!1,this.hasWebMercatorT=s??!1,this.hasGeodeticSurfaceNormals=a??!1,this.exaggeration=c??1,this.exaggerationRelativeHeight=u??0,this.stride=0,this._offsetGeodeticSurfaceNormal=0,this._offsetVertexNormal=0,this._calculateStrideAndOffsets()}Vc.prototype.encode=function(e,t,n,i,r,o,s,a){let c=i.x,u=i.y;if(this.quantization===$a.BITS12){n=N.multiplyByPoint(this.toScaledENU,n,YU),n.x=D.clamp(n.x,0,1),n.y=D.clamp(n.y,0,1),n.z=D.clamp(n.z,0,1);let f=this.maximumHeight-this.minimumHeight,d=D.clamp((r-this.minimumHeight)/f,0,1);U.fromElements(n.x,n.y,Th);let p=cn.compressTextureCoordinates(Th);U.fromElements(n.z,d,Th);let g=cn.compressTextureCoordinates(Th);U.fromElements(c,u,Th);let m=cn.compressTextureCoordinates(Th);if(e[t++]=p,e[t++]=g,e[t++]=m,this.hasWebMercatorT){U.fromElements(s,0,Th);let y=cn.compressTextureCoordinates(Th);e[t++]=y}}else e[t++]=n.x-this.center.x,e[t++]=n.y-this.center.y,e[t++]=n.z-this.center.z,e[t++]=r,e[t++]=c,e[t++]=u,this.hasWebMercatorT&&(e[t++]=s);return this.hasVertexNormals&&(e[t++]=cn.octPackFloat(o)),this.hasGeodeticSurfaceNormals&&(e[t++]=a.x,e[t++]=a.y,e[t++]=a.z),t};var kPt=new h,WOe=new h;Vc.prototype.addGeodeticSurfaceNormals=function(e,t,n){if(this.hasGeodeticSurfaceNormals)return;let i=this.stride,r=e.length/i;this.hasGeodeticSurfaceNormals=!0,this._calculateStrideAndOffsets();let o=this.stride;for(let s=0;s<r;s++){for(let f=0;f<i;f++){let d=s*i+f,p=s*o+f;t[p]=e[d]}let a=this.decodePosition(t,s,kPt),c=n.geodeticSurfaceNormal(a,WOe),u=s*o+this._offsetGeodeticSurfaceNormal;t[u]=c.x,t[u+1]=c.y,t[u+2]=c.z}};Vc.prototype.removeGeodeticSurfaceNormals=function(e,t){if(!this.hasGeodeticSurfaceNormals)return;let n=this.stride,i=e.length/n;this.hasGeodeticSurfaceNormals=!1,this._calculateStrideAndOffsets();let r=this.stride;for(let o=0;o<i;o++)for(let s=0;s<r;s++){let a=o*n+s,c=o*r+s;t[c]=e[a]}};Vc.prototype.decodePosition=function(e,t,n){if(l(n)||(n=new h),t*=this.stride,this.quantization===$a.BITS12){let i=cn.decompressTextureCoordinates(e[t],Th);n.x=i.x,n.y=i.y;let r=cn.decompressTextureCoordinates(e[t+1],Th);return n.z=r.x,N.multiplyByPoint(this.fromScaledENU,n,n)}return n.x=e[t],n.y=e[t+1],n.z=e[t+2],h.add(n,this.center,n)};Vc.prototype.getExaggeratedPosition=function(e,t,n){n=this.decodePosition(e,t,n);let i=this.exaggeration,r=this.exaggerationRelativeHeight;if(i!==1&&this.hasGeodeticSurfaceNormals){let s=this.decodeGeodeticSurfaceNormal(e,t,WOe),a=this.decodeHeight(e,t),c=Ar.getHeight(a,i,r)-a;n.x+=s.x*c,n.y+=s.y*c,n.z+=s.z*c}return n};Vc.prototype.decodeTextureCoordinates=function(e,t,n){return l(n)||(n=new U),t*=this.stride,this.quantization===$a.BITS12?cn.decompressTextureCoordinates(e[t+2],n):U.fromElements(e[t+4],e[t+5],n)};Vc.prototype.decodeHeight=function(e,t){return t*=this.stride,this.quantization===$a.BITS12?cn.decompressTextureCoordinates(e[t+1],Th).y*(this.maximumHeight-this.minimumHeight)+this.minimumHeight:e[t+3]};Vc.prototype.decodeWebMercatorT=function(e,t){return t*=this.stride,this.quantization===$a.BITS12?cn.decompressTextureCoordinates(e[t+3],Th).x:e[t+6]};Vc.prototype.getOctEncodedNormal=function(e,t,n){t=t*this.stride+this._offsetVertexNormal;let i=e[t]/256,r=Math.floor(i),o=(i-r)*256;return U.fromElements(r,o,n)};Vc.prototype.decodeNormal=function(e,t,n){let i=t*this.stride+this._offsetVertexNormal;return cn.octDecodeFloat(e[i],n)};Vc.prototype.decodeGeodeticSurfaceNormal=function(e,t,n){return t=t*this.stride+this._offsetGeodeticSurfaceNormal,n.x=e[t],n.y=e[t+1],n.z=e[t+2],n};Vc.prototype._calculateStrideAndOffsets=function(){let e=0;this.quantization===$a.BITS12?e+=3:e+=6,this.hasWebMercatorT&&(e+=1),this.hasVertexNormals&&(this._offsetVertexNormal=e,e+=1),this.hasGeodeticSurfaceNormals&&(this._offsetGeodeticSurfaceNormal=e,e+=3),this.stride=e};var c7={position3DAndHeight:0,textureCoordAndEncodedNormals:1,geodeticSurfaceNormal:2},l7={compressed0:0,compressed1:1,geodeticSurfaceNormal:2};Vc.prototype.getAttributes=function(e){let t=Y.FLOAT,n=Y.getSizeInBytes(t),i=this.stride*n,r=0,o=[];function s(a,c){o.push({index:a,vertexBuffer:e,componentDatatype:t,componentsPerAttribute:c,offsetInBytes:r,strideInBytes:i}),r+=c*n}if(this.quantization===$a.NONE){s(c7.position3DAndHeight,4);let a=2;a+=this.hasWebMercatorT?1:0,a+=this.hasVertexNormals?1:0,s(c7.textureCoordAndEncodedNormals,a),this.hasGeodeticSurfaceNormals&&s(c7.geodeticSurfaceNormal,3)}else{let a=this.hasWebMercatorT||this.hasVertexNormals,c=this.hasWebMercatorT&&this.hasVertexNormals;s(l7.compressed0,a?4:3),c&&s(l7.compressed1,1),this.hasGeodeticSurfaceNormals&&s(l7.geodeticSurfaceNormal,3)}return o};Vc.prototype.getAttributeLocations=function(){return this.quantization===$a.NONE?c7:l7};Vc.clone=function(e,t){if(l(e))return l(t)||(t=new Vc),t.quantization=e.quantization,t.minimumHeight=e.minimumHeight,t.maximumHeight=e.maximumHeight,t.center=h.clone(e.center),t.toScaledENU=N.clone(e.toScaledENU),t.fromScaledENU=N.clone(e.fromScaledENU),t.matrix=N.clone(e.matrix),t.hasVertexNormals=e.hasVertexNormals,t.hasWebMercatorT=e.hasWebMercatorT,t.hasGeodeticSurfaceNormals=e.hasGeodeticSurfaceNormals,t.exaggeration=e.exaggeration,t.exaggerationRelativeHeight=e.exaggerationRelativeHeight,t._calculateStrideAndOffsets(),t};var Co=Vc;var R0={};R0.DEFAULT_STRUCTURE=Object.freeze({heightScale:1,heightOffset:0,elementsPerHeight:1,stride:1,elementMultiplier:256,isBigEndian:!1});var Wre=new h,UPt=new N,zPt=new h,VPt=new h;R0.computeVertices=function(e){let t=Math.cos,n=Math.sin,i=Math.sqrt,r=Math.atan,o=Math.exp,s=D.PI_OVER_TWO,a=D.toRadians,c=e.heightmap,u=e.width,f=e.height,d=e.skirtHeight,p=d>0,g=e.isGeographic??!0,m=e.ellipsoid??ee.default,y=1/m.maximumRadius,A=ie.clone(e.nativeRectangle),b=ie.clone(e.rectangle),x,T,E,v;l(b)?(x=b.west,T=b.south,E=b.east,v=b.north):g?(x=a(A.west),T=a(A.south),E=a(A.east),v=a(A.north)):(x=A.west*y,T=s-2*r(o(-A.south*y)),E=A.east*y,v=s-2*r(o(-A.north*y)));let S=e.relativeToCenter,I=l(S);S=I?S:h.ZERO;let R=e.includeWebMercatorT??!1,O=e.exaggeration??1,L=e.exaggerationRelativeHeight??0,C=O!==1,w=e.structure??R0.DEFAULT_STRUCTURE,P=w.heightScale??R0.DEFAULT_STRUCTURE.heightScale,M=w.heightOffset??R0.DEFAULT_STRUCTURE.heightOffset,F=w.elementsPerHeight??R0.DEFAULT_STRUCTURE.elementsPerHeight,V=w.stride??R0.DEFAULT_STRUCTURE.stride,B=w.elementMultiplier??R0.DEFAULT_STRUCTURE.elementMultiplier,j=w.isBigEndian??R0.DEFAULT_STRUCTURE.isBigEndian,k=ie.computeWidth(A),G=ie.computeHeight(A),q=k/(u-1),Q=G/(f-1);g||(k*=y,G*=y);let W=m.radiiSquared,J=W.x,Z=W.y,ae=W.z,Ae=65536,fe=-65536,xe=At.eastNorthUpToFixedFrame(S,m),ge=N.inverseTransformation(xe,UPt),we,Se;R&&(we=yi.geodeticLatitudeToMercatorAngle(T),Se=1/(yi.geodeticLatitudeToMercatorAngle(v)-we));let Re=zPt;Re.x=Number.POSITIVE_INFINITY,Re.y=Number.POSITIVE_INFINITY,Re.z=Number.POSITIVE_INFINITY;let Qe=VPt;Qe.x=Number.NEGATIVE_INFINITY,Qe.y=Number.NEGATIVE_INFINITY,Qe.z=Number.NEGATIVE_INFINITY;let He=Number.POSITIVE_INFINITY,Xe=u*f,$e=d>0?u*2+f*2:0,Pe=Xe+$e,qe=new Array(Pe),st=new Array(Pe),vt=new Array(Pe),Gt=R?new Array(Pe):[],lt=C?new Array(Pe):[],mt=0,ft=f,Xt=0,rt=u;p&&(--mt,++ft,--Xt,++rt);let ht=1e-5;for(let jn=mt;jn<ft;++jn){let nn=jn;nn<0&&(nn=0),nn>=f&&(nn=f-1);let Wn=A.north-Q*nn;g?Wn=a(Wn):Wn=s-2*r(o(-Wn*y));let Zi=(Wn-T)/(v-T);Zi=D.clamp(Zi,0,1);let Mr=jn===mt,fo=jn===ft-1;d>0&&(Mr?Wn+=ht*G:fo&&(Wn-=ht*G));let Bs=t(Wn),Ks=n(Wn),no=ae*Ks,gi;R&&(gi=(yi.geodeticLatitudeToMercatorAngle(Wn)-we)*Se);for(let ho=Xt;ho<rt;++ho){let ur=ho;ur<0&&(ur=0),ur>=u&&(ur=u-1);let Zo=nn*(u*V)+ur*V,Bn;if(F===1)Bn=c[Zo];else{Bn=0;let Kr;if(j)for(Kr=0;Kr<F;++Kr)Bn=Bn*B+c[Zo+Kr];else for(Kr=F-1;Kr>=0;--Kr)Bn=Bn*B+c[Zo+Kr]}Bn=Bn*P+M,fe=Math.max(fe,Bn),Ae=Math.min(Ae,Bn);let qi=A.west+q*ur;g?qi=a(qi):qi=qi*y;let ki=(qi-x)/(E-x);ki=D.clamp(ki,0,1);let Nr=nn*u+ur;if(d>0){let Kr=ho===Xt,Ol=ho===rt-1,Z0=Mr||fo||Kr||Ol;if((Mr||fo)&&(Kr||Ol))continue;Z0&&(Bn-=d,Kr?(Nr=Xe+(f-nn-1),qi-=ht*k):fo?Nr=Xe+f+(u-ur-1):Ol?(Nr=Xe+f+u+nn,qi+=ht*k):Mr&&(Nr=Xe+f+u+f+ur))}let Wc=Bs*t(qi),xd=Bs*n(qi),xp=J*Wc,Nh=Z*xd,Tp=1/i(xp*Wc+Nh*xd+no*Ks),ks=xp*Tp,tc=Nh*Tp,Kb=no*Tp,ri=new h;ri.x=ks+Wc*Bn,ri.y=tc+xd*Bn,ri.z=Kb+Ks*Bn,N.multiplyByPoint(ge,ri,Wre),h.minimumByComponent(Wre,Re,Re),h.maximumByComponent(Wre,Qe,Qe),He=Math.min(He,Bn),qe[Nr]=ri,vt[Nr]=new U(ki,Zi),st[Nr]=Bn,R&&(Gt[Nr]=gi),C&&(lt[Nr]=m.geodeticSurfaceNormal(ri))}}let Bi=ue.fromPoints(qe),Xn;l(b)&&(Xn=en.fromRectangle(b,Ae,fe,m));let bi;I&&(bi=new Mm(m).computeHorizonCullingPointPossiblyUnderEllipsoid(S,qe,Ae));let Wi=new If(Re,Qe,S),wi=new Co(S,Wi,He,fe,xe,!1,R,C,O,L),hi=new Float32Array(Pe*wi.stride),xi=0;for(let jn=0;jn<Pe;++jn)xi=wi.encode(hi,xi,qe[jn],vt[jn],st[jn],void 0,Gt[jn],lt[jn]);return{vertices:hi,maximumHeight:fe,minimumHeight:Ae,encoding:wi,boundingSphere3D:Bi,orientedBoundingBox:Xn,occludeePointInScaledSpace:bi}};var uP=R0;function Eb(){pe.throwInstantiationError()}Object.defineProperties(Eb.prototype,{credits:{get:pe.throwInstantiationError},waterMask:{get:pe.throwInstantiationError}});Eb.prototype.interpolateHeight=pe.throwInstantiationError;Eb.prototype.isChildAvailable=pe.throwInstantiationError;Eb.prototype.createMesh=pe.throwInstantiationError;Eb.prototype.upsample=pe.throwInstantiationError;Eb.prototype.wasCreatedByUpsampling=pe.throwInstantiationError;Eb.maximumAsynchronousTasks=5;var uf=Eb;var jPt=3,Yre=class{constructor(t,n,i){this._vertices=t,this._indices=n,this._encoding=i,this._inverseTransform=new N,this._needsRebuild=!0,this._rootNode=new Xre}get needsRebuild(){return this._needsRebuild}set needsRebuild(t){this._needsRebuild=t}rayIntersect(t,n,i,r,o){this._needsRebuild&&WPt(this,n);let s=this._inverseTransform,a=GPt;a.origin=N.multiplyByPoint(s,t.origin,a.origin),a.direction=N.multiplyByPointAsVector(s,t.direction,a.direction);let c=[];return YOe(this._rootNode,a,c),$Pt(this,c,t,i,r,o)}},HPt=new $n("incrementallyBuildTerrainPicker"),Xre=class e{constructor(){this.x=0,this.y=0,this.level=0,this.aabb=qOe(this.x,this.y,this.level),this.intersectingTriangles=new Uint32Array(0),this.children=[],this.buildingChildren=!1}addChild(t){let n=new e;n.x=this.x*2+(t&1),n.y=this.y*2+(t>>1&1),n.level=this.level+1,n.aabb=qOe(n.x,n.y,n.level),this.children[t]=n}},GPt=new pn,u7=[new h,new h,new h];function WPt(e,t){N.inverse(t,e._inverseTransform),e._needsRebuild=!1;let n=e._indices.length/3,i=new Uint32Array(n);for(let r=0;r<n;++r)i[r]=r;e._rootNode.intersectingTriangles=i,e._rootNode.children.length=0}var qPt=new h,YPt=new h;function qOe(e,t,n){let i=1/Math.pow(2,n),r=h.fromElements(e*i-.5,t*i-.5,-.5,qPt),o=h.fromElements((e+1)*i-.5,(t+1)*i-.5,.5,YPt);return If.fromCorners(r,o)}function XPt(e,t,n,i,r){h.pack(n[0],e,9*r),h.pack(n[1],e,9*r+3),h.pack(n[2],e,9*r+6),t[r]=i}var KPt=new Us;function YOe(e,t,n){let i=_i.rayAxisAlignedBoundingBox(t,e.aabb,KPt);if(!l(i))return;if(!e.children.length||e.buildingChildren){n.push({node:e,interval:new Us(i.start,i.stop)});return}for(let o=0;o<e.children.length;o++)YOe(e.children[o],t,n)}function $Pt(e,t,n,i,r,o){let s=t.sort(function(c,u){return c.interval.start-u.interval.start}),a=Number.MAX_VALUE;for(let c=0;c<s.length;c++){let u=s[c],f=JPt(e,n,u.node,i,r,o);if(a=Math.min(f,a),a!==Number.MAX_VALUE)break}if(a!==Number.MAX_VALUE)return pn.getPoint(n,a)}function JPt(e,t,n,i,r,o){let s=Number.MAX_VALUE,a=e._encoding,c=e._indices,u=e._vertices,f=n.intersectingTriangles.length,p=!(n.level>=jPt)&&!n.buildingChildren,g,m;p&&(g=new Float64Array(f*9),m=new Uint32Array(f));for(let y=0;y<f;y++){let A=n.intersectingTriangles[y],b=qre(a,r,o,t,u,c[3*A],u7[0]),x=qre(a,r,o,t,u,c[3*A+1],u7[1]),T=qre(a,r,o,t,u,c[3*A+2],u7[2]),E=_i.rayTriangleParametric(t,b,x,T,i);l(E)&&E<s&&E>=0&&(s=E),p&&XPt(g,m,u7,A,y)}if(p){for(let y=0;y<4;y++)n.addChild(y);QPt(e._inverseTransform,n,m,g)}return s}var ZPt=new he;function qre(e,t,n,i,r,o,s){let a=e.getExaggeratedPosition(r,o,s);if(t===re.SCENE3D)return a;let u=n.ellipsoid.cartesianToCartographic(a,ZPt);a=n.project(u,s),a=h.fromElements(a.z,a.x,a.y,s);let f=D.TWO_PI*n.ellipsoid.maximumRadius,d=Math.round((i.origin.y-a.y)/f);return a.y+=d*f,a}async function QPt(e,t,n,i){t.buildingChildren=!0;let r=new Float64Array(16);N.pack(e,r,0);let o=new Float64Array(24);for(let f=0;f<4;f++)h.pack(t.children[f].aabb.minimum,o,f*6),h.pack(t.children[f].aabb.maximum,o,f*6+3);let s={aabbs:o,inverseTransform:r,triangleIndices:n,trianglePositions:i},a=[o.buffer,r.buffer,n.buffer,i.buffer],c=HPt.scheduleTask(s,a);if(!l(c)){t.buildingChildren=!1;return}(await c).intersectingTrianglesArrays.forEach((f,d)=>{l(t.children[d])&&(t.children[d].intersectingTriangles=new Uint32Array(f))}),t.intersectingTriangles=new Uint32Array(0),t.buildingChildren=!1}var XU=Yre;function KU(e,t,n,i,r,o,s,a,c,u,f,d,p,g,m,y,A){this.center=e,this.vertices=t,this.stride=f??6,this.indices=n,this.indexCountWithoutSkirts=i,this.vertexCountWithoutSkirts=r,this.minimumHeight=o,this.maximumHeight=s,this.rectangle=a,this.boundingSphere3D=c,this.occludeePointInScaledSpace=u,this.orientedBoundingBox=d,this.encoding=p,this.westIndicesSouthToNorth=g,this.southIndicesEastToWest=m,this.eastIndicesNorthToSouth=y,this.northIndicesWestToEast=A,this._transform=new N,this._lastPickSceneMode=void 0,this._terrainPicker=new XU(t,n,p)}KU.prototype.getTransform=function(e,t){return this._lastPickSceneMode===e?this._transform:(this._terrainPicker.needsRebuild=!0,!l(e)||e===re.SCENE3D?eDt(this,this._transform):aDt(this,t,this._transform))};function eDt(e,t){let n=e.encoding.exaggeration,i=e.encoding.exaggerationRelativeHeight,r=Ar.getHeight(e.minimumHeight,n,i),o=Ar.getHeight(e.maximumHeight,n,i),s=en.fromRectangle(e.rectangle,r,o,ee.default,e.orientedBoundingBox);return en.computeTransformation(s,t),N.getScale(t,Kre).z<=D.EPSILON16&&(Kre.z=1,N.setScale(t,Kre,t)),t}var tDt=new h,nDt=new h,iDt=new he,rDt=new he,oDt=new h,sDt=new h,Kre=new h;function aDt(e,t,n){let i=e.encoding.exaggeration,r=e.encoding.exaggerationRelativeHeight,o=Ar.getHeight(e.minimumHeight,i,r),s=Ar.getHeight(e.maximumHeight,i,r),a=t.project(he.fromRadians(e.rectangle.west,e.rectangle.south,0,iDt),tDt),c=t.project(he.fromRadians(e.rectangle.east,e.rectangle.north,0,rDt),nDt),u=s-o,f=h.fromElements(c.x-a.x,c.y-a.y,u>0?u:1,oDt),d=h.fromElements(a.x+f.x*.5,a.y+f.y*.5,o+f.z*.5,sDt);return N.fromTranslation(d,n),N.setScale(n,f,n),N.multiply(At.SWIZZLE_3D_TO_2D_MATRIX,n,n),n}KU.prototype.pick=function(e,t,n,i){let r=this._terrainPicker.rayIntersect(e,this.getTransform(n,i),t,n,i);return this._lastPickSceneMode=n,r};KU.prototype.updateExaggeration=function(e,t){this._terrainPicker._vertices=this.vertices,this._terrainPicker.needsRebuild=!0,this._lastPickSceneMode=void 0};KU.prototype.updateSceneMode=function(e){this._terrainPicker.needsRebuild=!0,this._lastPickSceneMode=void 0};var bc=KU;function ey(e){e=e??H.EMPTY_OBJECT,this._buffer=e.buffer,this._width=e.width,this._height=e.height,this._childTileMask=e.childTileMask??15,this._encoding=e.encoding??xh.NONE;let t=uP.DEFAULT_STRUCTURE,n=e.structure;l(n)?n!==t&&(n.heightScale=n.heightScale??t.heightScale,n.heightOffset=n.heightOffset??t.heightOffset,n.elementsPerHeight=n.elementsPerHeight??t.elementsPerHeight,n.stride=n.stride??t.stride,n.elementMultiplier=n.elementMultiplier??t.elementMultiplier,n.isBigEndian=n.isBigEndian??t.isBigEndian):n=t,this._structure=n,this._createdByUpsampling=e.createdByUpsampling??!1,this._waterMask=e.waterMask,this._skirtHeight=void 0,this._bufferType=this._encoding===xh.LERC?Float32Array:this._buffer.constructor,this._mesh=void 0}Object.defineProperties(ey.prototype,{credits:{get:function(){}},waterMask:{get:function(){return this._waterMask}},childTileMask:{get:function(){return this._childTileMask}}});var XOe="createVerticesFromHeightmap",cDt=new $n(XOe),lDt=new $n(XOe,uf.maximumAsynchronousTasks);ey.prototype.createMesh=function(e){e=e??H.EMPTY_OBJECT;let t=e.tilingScheme,n=e.x,i=e.y,r=e.level,o=e.exaggeration??1,s=e.exaggerationRelativeHeight??0,a=e.throttle??!0,c=t.ellipsoid,u=t.tileXYToNativeRectangle(n,i,r),f=t.tileXYToRectangle(n,i,r),d=c.cartographicToCartesian(ie.center(f)),p=this._structure,m=Xr.getEstimatedLevelZeroGeometricErrorForAHeightmap(c,this._width,t.getNumberOfXTilesAtLevel(0))/(1<<r);this._skirtHeight=Math.min(m*4,1e3);let A=(a?lDt:cDt).scheduleTask({heightmap:this._buffer,structure:p,includeWebMercatorT:!0,width:this._width,height:this._height,nativeRectangle:u,rectangle:f,relativeToCenter:d,ellipsoid:c,skirtHeight:this._skirtHeight,isGeographic:t.projection instanceof Ui,exaggeration:o,exaggerationRelativeHeight:s,encoding:this._encoding});if(!l(A))return;let b=this;return Promise.resolve(A).then(function(x){let T;b._skirtHeight>0?T=Xr.getRegularGridAndSkirtIndicesAndEdgeIndices(x.gridWidth,x.gridHeight):T=Xr.getRegularGridIndicesAndEdgeIndices(x.gridWidth,x.gridHeight);let E=x.gridWidth*x.gridHeight;return b._mesh=new bc(d,new Float32Array(x.vertices),T.indices,T.indexCountWithoutSkirts,E,x.minimumHeight,x.maximumHeight,f,ue.clone(x.boundingSphere3D),h.clone(x.occludeePointInScaledSpace),x.numberOfAttributes,en.clone(x.orientedBoundingBox),Co.clone(x.encoding),T.westIndicesSouthToNorth,T.southIndicesEastToWest,T.eastIndicesNorthToSouth,T.northIndicesWestToEast),b._buffer=void 0,b._mesh})};ey.prototype._createMeshSync=function(e){let t=e.tilingScheme,n=e.x,i=e.y,r=e.level,o=e.exaggeration??1,s=e.exaggerationRelativeHeight??0,a=t.ellipsoid,c=t.tileXYToNativeRectangle(n,i,r),u=t.tileXYToRectangle(n,i,r),f=a.cartographicToCartesian(ie.center(u)),d=this._structure,g=Xr.getEstimatedLevelZeroGeometricErrorForAHeightmap(a,this._width,t.getNumberOfXTilesAtLevel(0))/(1<<r);this._skirtHeight=Math.min(g*4,1e3);let m=uP.computeVertices({heightmap:this._buffer,structure:d,includeWebMercatorT:!0,width:this._width,height:this._height,nativeRectangle:c,rectangle:u,relativeToCenter:f,ellipsoid:a,skirtHeight:this._skirtHeight,isGeographic:t.projection instanceof Ui,exaggeration:o,exaggerationRelativeHeight:s});this._buffer=void 0;let y;this._skirtHeight>0?y=Xr.getRegularGridAndSkirtIndicesAndEdgeIndices(this._width,this._height):y=Xr.getRegularGridIndicesAndEdgeIndices(this._width,this._height);let A=m.gridWidth*m.gridHeight;return this._mesh=new bc(f,m.vertices,y.indices,y.indexCountWithoutSkirts,A,m.minimumHeight,m.maximumHeight,u,m.boundingSphere3D,m.occludeePointInScaledSpace,m.encoding.stride,m.orientedBoundingBox,m.encoding,y.westIndicesSouthToNorth,y.southIndicesEastToWest,y.eastIndicesNorthToSouth,y.northIndicesWestToEast),this._mesh};ey.prototype.interpolateHeight=function(e,t,n){let i=this._width,r=this._height,o=this._structure,s=o.stride,a=o.elementsPerHeight,c=o.elementMultiplier,u=o.isBigEndian,f=o.heightOffset,d=o.heightScale,p=l(this._mesh),g=this._encoding===xh.LERC;if(!p&&g)return;let y;if(p){let A=this._mesh.vertices,b=this._mesh.encoding;y=KOe(A,b,f,d,e,i,r,t,n)}else y=uDt(this._buffer,a,c,s,u,e,i,r,t,n),y=y*d+f;return y};ey.prototype.upsample=function(e,t,n,i,r,o,s){let a=this._mesh;if(!l(a))return;let c=this._width,u=this._height,f=this._structure,d=f.stride,p=new this._bufferType(c*u*d),g=a.vertices,m=a.encoding,y=e.tileXYToRectangle(t,n,i),A=e.tileXYToRectangle(r,o,s),b=f.heightOffset,x=f.heightScale,T=f.elementsPerHeight,E=f.elementMultiplier,v=f.isBigEndian,S=Math.pow(E,T-1);for(let I=0;I<u;++I){let R=D.lerp(A.north,A.south,I/(u-1));for(let O=0;O<c;++O){let L=D.lerp(A.west,A.east,O/(c-1)),_=KOe(g,m,b,x,y,c,u,L,R);_=_<f.lowestEncodedHeight?f.lowestEncodedHeight:_,_=_>f.highestEncodedHeight?f.highestEncodedHeight:_,fDt(p,T,E,S,d,v,I*c+O,_)}}return Promise.resolve(new ey({buffer:p,width:c,height:u,childTileMask:0,structure:this._structure,createdByUpsampling:!0}))};ey.prototype.isChildAvailable=function(e,t,n,i){let r=2;return n!==e*2&&++r,i!==t*2&&(r-=2),(this._childTileMask&1<<r)!==0};ey.prototype.wasCreatedByUpsampling=function(){return this._createdByUpsampling};function uDt(e,t,n,i,r,o,s,a,c,u){let f=(c-o.west)*(s-1)/(o.east-o.west),d=(u-o.south)*(a-1)/(o.north-o.south),p=f|0,g=p+1;g>=s&&(g=s-1,p=s-2);let m=d|0,y=m+1;y>=a&&(y=a-1,m=a-2);let A=f-p,b=d-m;m=a-1-m,y=a-1-y;let x=f7(e,t,n,i,r,m*s+p),T=f7(e,t,n,i,r,m*s+g),E=f7(e,t,n,i,r,y*s+p),v=f7(e,t,n,i,r,y*s+g);return $Oe(A,b,x,T,E,v)}function KOe(e,t,n,i,r,o,s,a,c){let u=(a-r.west)*(o-1)/(r.east-r.west),f=(c-r.south)*(s-1)/(r.north-r.south),d=u|0,p=d+1;p>=o&&(p=o-1,d=o-2);let g=f|0,m=g+1;m>=s&&(m=s-1,g=s-2);let y=u-d,A=f-g;g=s-1-g,m=s-1-m;let b=(t.decodeHeight(e,g*o+d)-n)/i,x=(t.decodeHeight(e,g*o+p)-n)/i,T=(t.decodeHeight(e,m*o+d)-n)/i,E=(t.decodeHeight(e,m*o+p)-n)/i;return $Oe(y,A,b,x,T,E)}function $Oe(e,t,n,i,r,o){return t<e?n+e*(i-n)+t*(o-i):n+e*(o-r)+t*(r-n)}function f7(e,t,n,i,r,o){o*=i;let s=0,a;if(r)for(a=0;a<t;++a)s=s*n+e[o+a];else for(a=t-1;a>=0;--a)s=s*n+e[o+a];return s}function fDt(e,t,n,i,r,o,s,a){s*=r;let c;if(o)for(c=0;c<t-1;++c)e[s+c]=a/i|0,a-=e[s+c]*i,i/=n;else for(c=t-1;c>0;--c)e[s+c]=a/i|0,a-=e[s+c]*i,i/=n;e[s+c]=a}var jc=ey;function fP(e){e=e??H.EMPTY_OBJECT,this._tilingScheme=e.tilingScheme,l(this._tilingScheme)||(this._tilingScheme=new er({ellipsoid:e.ellipsoid??ee.default})),this._levelZeroMaximumGeometricError=Xr.getEstimatedLevelZeroGeometricErrorForAHeightmap(this._tilingScheme.ellipsoid,64,this._tilingScheme.getNumberOfXTilesAtLevel(0)),this._errorEvent=new be}Object.defineProperties(fP.prototype,{errorEvent:{get:function(){return this._errorEvent}},credit:{get:function(){}},tilingScheme:{get:function(){return this._tilingScheme}},hasWaterMask:{get:function(){return!1}},hasVertexNormals:{get:function(){return!1}},availability:{get:function(){}}});fP.prototype.requestTileGeometry=function(e,t,n,i){return Promise.resolve(new jc({buffer:new Uint8Array(256),width:16,height:16}))};fP.prototype.getLevelMaximumGeometricError=function(e){return this._levelZeroMaximumGeometricError/(1<<e)};fP.prototype.getTileDataAvailable=function(e,t,n){};fP.prototype.loadTileDataAvailability=function(e,t,n){};var O0=fP;var dDt=new U;function hDt(e,t){let n=e.unionClippingRegions,i=e.length,r=bs.useFloatTexture(t),o=bs.getTextureResolution(e,t,dDt),s=o.x,a=o.y,c=r?gDt(s,a):_Dt(s,a);return c+=` -`,c+=n?mDt(i):pDt(i),c}function mDt(e){return`float clip(vec4 fragCoord, sampler2D clippingPlanes, mat4 clippingPlanesMatrix) +Url: ${e._contentHeader.uri}`,r++;let o={text:i.substring(1),position:n,font:`${19-r}px sans-serif`,showBackground:!0,disableDepthTestDistance:Number.POSITIVE_INFINITY};return t._tileDebugLabels.add(o)}function hAt(e,t){let n=e._selectedTiles,i=n.length,r=e._emptyTiles,o=r.length;if(e._tileDebugLabels.removeAll(),e.debugPickedTileLabelOnly){if(l(e.debugPickedTile)){let s=l(e.debugPickPosition)?e.debugPickPosition:Zee(e.debugPickedTile),a=Qee(e.debugPickedTile,e,s);a.pixelOffset=new U(15,-15)}}else{for(let s=0;s<i;++s){let a=n[s];Qee(a,e,Zee(a))}for(let s=0;s<o;++s){let a=r[s];(a.hasTilesetContent||a.hasImplicitContent)&&Qee(a,e,Zee(a))}}e._tileDebugLabels.update(t)}function mAt(e,t,n){e._styleEngine.applyStyle(e),e._styleApplied=!0;let{commandList:i,context:r}=t,o=i.length,s=e._selectedTiles,a=e.isSkippingLevelOfDetail&&e._hasMixedContent&&r.stencilBuffer&&s.length>0;e._backfaceCommands.length=0,a&&(l(e._stencilClearCommand)||(e._stencilClearCommand=new li({stencil:0,pass:Ie.CESIUM_3D_TILE,renderState:Ge.fromCache({stencilMask:Yt.SKIP_LOD_MASK})})),i.push(e._stencilClearCommand));let{statistics:c,tileVisible:u}=e,f=n.isRender,d=i.length;for(let m=0;m<s.length;++m){let y=s[m];f&&u.raiseEvent(y),cAt(e,y,t),y.update(e,t,n),c.incrementSelectionCounts(y.content),++c.selected}let p=e._emptyTiles;for(let m=0;m<p.length;++m)p[m].update(e,t,n);let g=i.length-d;if(e._backfaceCommands.trim(),a){let m=e._backfaceCommands.values,y=m.length;i.length+=y;for(let A=g-1;A>=0;--A)i[d+y+A]=i[d+A];for(let A=0;A<y;++A)i[d+A]=m[A]}g=i.length-o,c.numberOfCommands=g,f&&(e.pointCloudShading.attenuation&&e.pointCloudShading.eyeDomeLighting&&g>0&&e._pointCloudEyeDomeLighting.update(t,o,e.pointCloudShading,e.boundingSphere),e.debugShowGeometricError||e.debugShowRenderingStatistics||e.debugShowMemoryUsage||e.debugShowUrl?(l(e._tileDebugLabels)||(e._tileDebugLabels=new Vp),hAt(e,t)):e._tileDebugLabels=e._tileDebugLabels&&e._tileDebugLabels.destroy())}var ISe=[],pAt=[];function PSe(e,t){let n=t,i=ISe;for(i.push(t);i.length>0;){t=i.pop();let r=t.children;for(let o=0;o<r.length;++o)i.push(r[o]);t!==n&&(AAt(e,t),--e._statistics.numberOfTilesTotal)}n.children=[]}function DSe(e,t){e.tileUnload.raiseEvent(t),e._statistics.decrementLoadCounts(t.content),--e._statistics.numberOfTilesWithContentReady,t.unloadContent()}function VG(e,t){let n=e-t;return n<0?n+XA.maximumFrameNumber:n}var gAt=64;function _At(e,t,n){let i=pAt;for(i.length=0,i.push(e);i.length>0;){let r=i.pop(),o=r._contentState;if(o===Rr.LOADING||o===Rr.PROCESSING||!r.hasEmptyContent&&!r.hasTilesetContent&&o!==Rr.UNLOADED&&o!==Rr.FAILED||l(r.cacheNode)||Math.min(VG(t,r._visitedFrame),VG(t,r._touchedFrame),VG(t,r._selectedFrame),VG(t,r._requestedFrame))<n)return i.length=0,!0;let c=r.children;for(let u=0;u<c.length;++u)i.push(c[u])}return!1}function yAt(e,t){let n=e._externalTilesetTiles,i=t.frameNumber,r=e._externalTilesetIdleFrames,o=e._externalTilesetSweepCount,s=0,a=0;for(;s<o&&a<gAt&&n.length>0;){++a,e._externalTilesetSweepIndex>=n.length&&(e._externalTilesetSweepIndex=0);let c=e._externalTilesetSweepIndex,u=n[c];if(u.isDestroyed()||!u.hasTilesetContent||u.children.length===0){n.splice(c,1);continue}++e._externalTilesetSweepIndex,++s,!_At(u,i,r)&&(PSe(e,u),u.unloadTilesetContent(),n.splice(c,1),e._externalTilesetSweepIndex=c)}}function AAt(e,t){e._cache.unloadTile(e,t,DSe),t.destroy()}lo.prototype.trimLoadedTiles=function(){this._cache.trim()};function bAt(e,t){let n=e._statistics,i=e._statisticsLast,r=n.numberOfPendingRequests,o=n.numberOfTilesProcessing,s=i.numberOfPendingRequests,a=i.numberOfTilesProcessing;zm.clone(n,i);let c=r!==s||o!==a;c&&t.afterRender.push(function(){return e.loadProgress.raiseEvent(r,o),!0}),e._tilesLoaded=n.numberOfPendingRequests===0&&n.numberOfTilesProcessing===0&&n.numberOfAttemptedRequests===0,c&&e._tilesLoaded&&(t.afterRender.push(function(){return e.allTilesLoaded.raiseEvent(),!0}),e._initialTilesLoaded||(e._initialTilesLoaded=!0,t.afterRender.push(function(){return e.initialTilesLoaded.raiseEvent(),!0})))}function xAt(e){e._heatmap.resetMinimumMaximum(),e._minimumPriority.depth=Number.MAX_VALUE,e._maximumPriority.depth=-Number.MAX_VALUE,e._minimumPriority.foveatedFactor=Number.MAX_VALUE,e._maximumPriority.foveatedFactor=-Number.MAX_VALUE,e._minimumPriority.distance=Number.MAX_VALUE,e._maximumPriority.distance=-Number.MAX_VALUE,e._minimumPriority.reverseScreenSpaceError=Number.MAX_VALUE,e._maximumPriority.reverseScreenSpaceError=-Number.MAX_VALUE}function TAt(e,t){t.frameNumber===e._updatedModelMatrixFrame&&l(e._previousModelMatrix)||(e._updatedModelMatrixFrame=t.frameNumber,e._modelMatrixChanged=!N.equals(e.modelMatrix,e._previousModelMatrix),e._modelMatrixChanged&&(e._previousModelMatrix=N.clone(e.modelMatrix,e._previousModelMatrix)))}function EAt(e,t,n,i){if(t.mode===re.MORPHING||!l(e._root))return!1;let r=e._statistics;r.clear(),++e._updatedVisibilityFrame,xAt(e),TAt(e,t),e._cullRequestsWhileMoving=e.cullRequestsWhileMoving&&!e._modelMatrixChanged;let o=e.getTraversal(i).selectTiles(e,t);if(i.requestTiles&&iAt(e),mAt(e,t,i),zm.clone(r,n),i.isRender){let s=e._credits;if(l(s)&&r.selected!==0)for(let a=0;a<s.length;++a){let c=s[a];t.creditDisplay.addCreditToNextFrame(c)}}return o}function RSe(e){let t=e._credits;l(t)||(t=[]),t.length=0,l(e.resource.credits)&&e.resource.credits.forEach(i=>{t.push(It.clone(i))});let n=e.asset.extras;if(l(n)&&l(n.cesium)&&l(n.cesium.credits)){let i=n.cesium.credits;for(let r=0;r<i.length;++r){let o=i[r];t.push(new It(o.html))}}t.forEach(i=>i.showOnScreen=i.showOnScreen||e._showCreditsOnScreen),e._credits=t}lo.prototype.getTraversal=function(e){let{pass:t}=e;return t===ao.MOST_DETAILED_PRELOAD||t===ao.MOST_DETAILED_PICK?l3:this.isSkippingLevelOfDetail?p3:d3};lo.prototype.update=function(e){this.updateForPass(e,e.tilesetPassState)};lo.prototype.updateForPass=function(e,t){this.imageryLayers._update();let n=t.pass;if(n===ao.PRELOAD&&(!this.preloadWhenHidden||this.show)||n===ao.PRELOAD_FLIGHT&&(!this.preloadFlightDestinations||!this.show&&!this.preloadWhenHidden)||n===ao.REQUEST_RENDER_MODE_DEFER_CHECK&&(!this._cullRequestsWhileMoving&&this.foveatedTimeDelay<=0||!this.show))return;let i=e.commandList,r=e.camera,o=e.cullingVolume;t.ready=!1;let s=ao.getPassOptions(n),a=s.ignoreCommands,c=t.commandList??i,u=c.length;if(e.commandList=c,e.camera=t.camera??r,e.cullingVolume=t.cullingVolume??o,s.isRender){let d=this._environmentMapManager;l(this._root)&&(d.position=this.boundingSphere.center),d.update(e)}let f=this._statisticsPerPass[n];(this.show||a)&&(this._pass=n,t.ready=EAt(this,e,f,s)),a&&(c.length=u),e.commandList=i,e.camera=r,e.cullingVolume=o};lo.prototype.hasExtension=function(e){return l(this._extensionsUsed)?this._extensionsUsed.indexOf(e)>-1:!1};lo.prototype.isDestroyed=function(){return!1};lo.prototype.destroy=function(){if(this._tileDebugLabels=this._tileDebugLabels&&this._tileDebugLabels.destroy(),this._removeClippingPolygonAdded=this._removeClippingPolygonAdded&&this._removeClippingPolygonAdded(),this._removeClippingPolygonRemoved=this._removeClippingPolygonRemoved&&this._removeClippingPolygonRemoved(),this._clippingPlanes=this._clippingPlanes&&this._clippingPlanes.destroy(),this._clippingPolygons=void 0,l(this._root)){let e=ISe;for(e.push(this._root);e.length>0;){let t=e.pop();t.destroy();let n=t.children;for(let i=0;i<n.length;++i)e.push(n[i])}}return this._root=void 0,this._shouldDestroyImageBasedLighting&&!this._imageBasedLighting.isDestroyed()&&this._imageBasedLighting.destroy(),this._imageBasedLighting=void 0,this._environmentMapManager.isDestroyed()||this._environmentMapManager.destroy(),this._environmentMapManager=void 0,this._imageryLayers.isDestroyed()||(this.imageryLayers.layerAdded.removeEventListener(this._imageryLayersListener),this.imageryLayers.layerRemoved.removeEventListener(this._imageryLayersListener),this.imageryLayers.layerMoved.removeEventListener(this._imageryLayersListener),this.imageryLayers.layerShownOrHidden.removeEventListener(this._imageryLayersListener),this._imageryLayers.destroy()),this._imageryLayers=void 0,le(this)};lo.supportedExtensions={"3DTILES_metadata":!0,"3DTILES_implicit_tiling":!0,"3DTILES_content_gltf":!0,"3DTILES_content_gltf_vector":!0,"3DTILES_multiple_contents":!0,"3DTILES_bounding_volume_S2":!0,"3DTILES_batch_table_hierarchy":!0,"3DTILES_draco_point_compression":!0,MAXAR_content_geojson:!0};lo.checkSupportedExtensions=function(e){for(let t=0;t<e.length;t++)if(!lo.supportedExtensions[e[t]])throw new oe(`Unsupported 3D Tiles Extension: ${e[t]}`)};var CAt=new pn,vAt=new h,SAt=new h,wAt=new he;lo.prototype.getHeight=function(e,t){let n=t.ellipsoid;l(n)||(n=ee.WGS84);let i=CAt,r=n.cartographicToCartesian(e,vAt),o=n.geodeticSurfaceNormal(r,i.direction);i.origin=h.add(r,h.multiplyByScalar(o,2*n.maximumRadius,i.origin),i.origin),i.direction=h.negate(o,i.direction);let s=this.pick(i,t.frameState,SAt,this.maximumHeightQueryGeometricError);if(l(s))return n.cartesianToCartographic(s,wAt)?.height};lo.prototype.updateHeight=function(e,t,n){n=n??ee.WGS84;let i={positionCartographic:e,ellipsoid:n,callback:t,invoked:!1},r=()=>{let o=this._addHeightCallbacks,s=o.length;for(let a=0;a<s;++a)if(o[a]===i){o.splice(a,1);break}i.callback&&(i.callback=void 0)};return this._addHeightCallbacks.push(i),r};var IAt=new h;lo.prototype.pick=function(e,t,n,i){if(!t.context.webgl2&&!this._enablePick)return;let r=this._selectedTiles,o=r.length,s=[],a=e.origin.x,c=e.origin.y,u=e.origin.z,f=e.direction.x,d=e.direction.y,p=e.direction.z,g=f*f+d*d+p*p;for(let b=0;b<o;++b){let x=r[b];if(l(i)&&x.geometricError>i||!l(x.content))continue;let T=x.contentBoundingVolume.boundingSphere,E=T.center,v=a-E.x,S=c-E.y,I=u-E.z,R=2*(f*v+d*S+p*I),O=v*v+S*S+I*I-T.radius*T.radius;R*R-4*g*O<0||s.push(x)}let m=s.length,y,A=Number.POSITIVE_INFINITY;for(let b=0;b<m;++b){let T=s[b].content.pick(e,t,IAt);if(l(T)){let E=h.distanceSquared(T,e.origin);E<A&&(A=E,y=h.clone(T,n))}}return y};lo.prototype.isGltfExtensionUsed=function(e){if(this.hasExtension("3DTILES_content_gltf")){if(!l(this.extensions))return!1;let t=this.extensions["3DTILES_content_gltf"]?.extensionsUsed;return l(t)?t.indexOf(e)>-1:!1}return!1};lo.prototype.isGltfExtensionRequired=function(e){if(this.isGltfExtensionUsed(e)){let t=this.extensions["3DTILES_content_gltf"].extensionsRequired;return l(t)?t.indexOf(e)>-1:!1}return!1};var Xo=lo;var PAt=new N;function $A(e,t){t.collectionChanged.addEventListener($A.prototype._onCollectionChanged,this),this._scene=e,this._primitives=e.primitives,this._entityCollection=t,this._tilesetHash={},this._entitiesToVisualize=new Ut,this._onCollectionChanged(t,t.values,[],[])}$A.prototype.update=function(e){let t=this._entitiesToVisualize.values,n=this._tilesetHash,i=this._primitives;for(let r=0,o=t.length;r<o;r++){let s=t[r],a=s._tileset,c,u=n[s.id],f=s.isShowing&&s.isAvailable(e)&&X.getValueOrDefault(a._show,e,!0),d;f&&(d=s.computeModelMatrix(e,PAt),c=De.createIfNeeded(X.getValueOrUndefined(a._uri,e)));let p=l(u)?u.tilesetPrimitive:void 0;if(!f){l(p)&&(p.show=!1);continue}(!l(u)||c.url!==u.url)&&(l(p)&&i.removeAndDestroy(p),delete n[s.id],DAt(c,n,s,i)),l(p)&&(p.show=!0,l(d)&&(p.modelMatrix=d),p.maximumScreenSpaceError=X.getValueOrDefault(a.maximumScreenSpaceError,e,p.maximumScreenSpaceError))}return!0};$A.prototype.isDestroyed=function(){return!1};$A.prototype.destroy=function(){this._entityCollection.collectionChanged.removeEventListener($A.prototype._onCollectionChanged,this);let e=this._entitiesToVisualize.values,t=this._tilesetHash,n=this._primitives;for(let i=e.length-1;i>-1;i--)ete(this,e[i],t,n);return le(this)};$A.prototype.getBoundingSphere=function(e,t){let n=this._tilesetHash[e.id];if(!l(n)||n.loadFail)return Pt.FAILED;let i=n.tilesetPrimitive;return l(i)?i.show?(ue.clone(i.boundingSphere,t),Pt.DONE):Pt.FAILED:Pt.PENDING};$A.prototype._onCollectionChanged=function(e,t,n,i){let r,o,s=this._entitiesToVisualize,a=this._tilesetHash,c=this._primitives;for(r=t.length-1;r>-1;r--)o=t[r],l(o._tileset)&&s.set(o.id,o);for(r=i.length-1;r>-1;r--)o=i[r],l(o._tileset)?s.set(o.id,o):(ete(this,o,a,c),s.remove(o.id));for(r=n.length-1;r>-1;r--)o=n[r],ete(this,o,a,c),s.remove(o.id)};function ete(e,t,n,i){let r=n[t.id];l(r)&&(l(r.tilesetPrimitive)&&i.removeAndDestroy(r.tilesetPrimitive),delete n[t.id])}async function DAt(e,t,n,i){t[n.id]={url:e.url,loadFail:!1};try{let r=await Xo.fromUrl(e);if(r.id=n,i.add(r),!l(t[n.id]))return;t[n.id].tilesetPrimitive=r}catch(r){console.error(r),t[n.id].loadFail=!0}}var g3=$A;function gE(e,t,n){this._callback=void 0,this._isConstant=void 0,this._referenceFrame=n??ji.FIXED,this._definitionChanged=new be,this.setCallback(e,t)}Object.defineProperties(gE.prototype,{isConstant:{get:function(){return this._isConstant}},definitionChanged:{get:function(){return this._definitionChanged}},referenceFrame:{get:function(){return this._referenceFrame}}});var RAt=new K;gE.prototype.getValue=function(e,t){return l(e)||(e=K.now(RAt)),this.getValueInReferenceFrame(e,ji.FIXED,t)};gE.prototype.setCallback=function(e,t){let n=this._callback!==e||this._isConstant!==t;this._callback=e,this._isConstant=t,n&&this._definitionChanged.raiseEvent(this)};gE.prototype.getValueInReferenceFrame=function(e,t,n){let i=this._callback(e,n);return nm.convertToReferenceFrame(e,i,this._referenceFrame,t,n)};gE.prototype.equals=function(e){return this===e||e instanceof gE&&this._callback===e._callback&&this._isConstant===e._isConstant&&this._referenceFrame===e._referenceFrame};var _3=gE;function ite(e,t){return K.compare(e.start,t.start)}function Ps(e){if(this._intervals=[],this._changedEvent=new be,l(e)){let t=e.length;for(let n=0;n<t;n++)this.addInterval(e[n])}}Object.defineProperties(Ps.prototype,{changedEvent:{get:function(){return this._changedEvent}},start:{get:function(){let e=this._intervals;return e.length===0?void 0:e[0].start}},isStartIncluded:{get:function(){let e=this._intervals;return e.length===0?!1:e[0].isStartIncluded}},stop:{get:function(){let e=this._intervals,t=e.length;return t===0?void 0:e[t-1].stop}},isStopIncluded:{get:function(){let e=this._intervals,t=e.length;return t===0?!1:e[t-1].isStopIncluded}},length:{get:function(){return this._intervals.length}},isEmpty:{get:function(){return this._intervals.length===0}}});Ps.prototype.equals=function(e,t){if(this===e)return!0;if(!(e instanceof Ps))return!1;let n=this._intervals,i=e._intervals,r=n.length;if(r!==i.length)return!1;for(let o=0;o<r;o++)if(!En.equals(n[o],i[o],t))return!1;return!0};Ps.prototype.get=function(e){return this._intervals[e]};Ps.prototype.removeAll=function(){this._intervals.length>0&&(this._intervals.length=0,this._changedEvent.raiseEvent(this))};Ps.prototype.findIntervalContainingDate=function(e){let t=this.indexOf(e);return t>=0?this._intervals[t]:void 0};Ps.prototype.findDataForIntervalContainingDate=function(e){let t=this.indexOf(e);return t>=0?this._intervals[t].data:void 0};Ps.prototype.contains=function(e){return this.indexOf(e)>=0};var tte=new En;Ps.prototype.indexOf=function(e){let t=this._intervals;tte.start=e,tte.stop=e;let n=vr(t,tte,ite);return n>=0?t[n].isStartIncluded?n:n>0&&t[n-1].stop.equals(e)&&t[n-1].isStopIncluded?n-1:~n:(n=~n,n>0&&n-1<t.length&&En.contains(t[n-1],e)?n-1:~n)};Ps.prototype.findInterval=function(e){e=e??H.EMPTY_OBJECT;let t=e.start,n=e.stop,i=e.isStartIncluded,r=e.isStopIncluded,o=this._intervals;for(let s=0,a=o.length;s<a;s++){let c=o[s];if((!l(t)||c.start.equals(t))&&(!l(n)||c.stop.equals(n))&&(!l(i)||c.isStartIncluded===i)&&(!l(r)||c.isStopIncluded===r))return o[s]}};Ps.prototype.addInterval=function(e,t){if(e.isEmpty)return;let n=this._intervals;if(n.length===0||K.greaterThan(e.start,n[n.length-1].stop)){n.push(e),this._changedEvent.raiseEvent(this);return}let i=vr(n,e,ite);i<0?i=~i:i>0&&e.isStartIncluded&&n[i-1].isStartIncluded&&n[i-1].start.equals(e.start)?--i:i<n.length&&!e.isStartIncluded&&n[i].isStartIncluded&&n[i].start.equals(e.start)&&++i;let r;for(i>0&&(r=K.compare(n[i-1].stop,e.start),(r>0||r===0&&(n[i-1].isStopIncluded||e.isStartIncluded))&&((l(t)?t(n[i-1].data,e.data):n[i-1].data===e.data)?(K.greaterThan(e.stop,n[i-1].stop)?e=new En({start:n[i-1].start,stop:e.stop,isStartIncluded:n[i-1].isStartIncluded,isStopIncluded:e.isStopIncluded,data:e.data}):e=new En({start:n[i-1].start,stop:n[i-1].stop,isStartIncluded:n[i-1].isStartIncluded,isStopIncluded:n[i-1].isStopIncluded||e.stop.equals(n[i-1].stop)&&e.isStopIncluded,data:e.data}),n.splice(i-1,1),--i):(r=K.compare(n[i-1].stop,e.stop),(r>0||r===0&&n[i-1].isStopIncluded&&!e.isStopIncluded)&&n.splice(i,0,new En({start:e.stop,stop:n[i-1].stop,isStartIncluded:!e.isStopIncluded,isStopIncluded:n[i-1].isStopIncluded,data:n[i-1].data})),n[i-1]=new En({start:n[i-1].start,stop:e.start,isStartIncluded:n[i-1].isStartIncluded,isStopIncluded:!e.isStartIncluded,data:n[i-1].data}))));i<n.length&&(r=K.compare(e.stop,n[i].start),r>0||r===0&&(e.isStopIncluded||n[i].isStartIncluded));)if(l(t)?t(n[i].data,e.data):n[i].data===e.data)e=new En({start:e.start,stop:K.greaterThan(n[i].stop,e.stop)?n[i].stop:e.stop,isStartIncluded:e.isStartIncluded,isStopIncluded:K.greaterThan(n[i].stop,e.stop)?n[i].isStopIncluded:e.isStopIncluded,data:e.data}),n.splice(i,1);else if(n[i]=new En({start:e.stop,stop:n[i].stop,isStartIncluded:!e.isStopIncluded,isStopIncluded:n[i].isStopIncluded,data:n[i].data}),n[i].isEmpty)n.splice(i,1);else break;n.splice(i,0,e),this._changedEvent.raiseEvent(this)};Ps.prototype.removeInterval=function(e){if(e.isEmpty)return!1;let t=this._intervals,n=vr(t,e,ite);n<0&&(n=~n);let i=!1;for(n>0&&(K.greaterThan(t[n-1].stop,e.start)||t[n-1].stop.equals(e.start)&&t[n-1].isStopIncluded&&e.isStartIncluded)&&(i=!0,(K.greaterThan(t[n-1].stop,e.stop)||t[n-1].isStopIncluded&&!e.isStopIncluded&&t[n-1].stop.equals(e.stop))&&t.splice(n,0,new En({start:e.stop,stop:t[n-1].stop,isStartIncluded:!e.isStopIncluded,isStopIncluded:t[n-1].isStopIncluded,data:t[n-1].data})),t[n-1]=new En({start:t[n-1].start,stop:e.start,isStartIncluded:t[n-1].isStartIncluded,isStopIncluded:!e.isStartIncluded,data:t[n-1].data})),n<t.length&&!e.isStartIncluded&&t[n].isStartIncluded&&e.start.equals(t[n].start)&&(i=!0,t.splice(n,0,new En({start:t[n].start,stop:t[n].start,isStartIncluded:!0,isStopIncluded:!0,data:t[n].data})),++n);n<t.length&&K.greaterThan(e.stop,t[n].stop);)i=!0,t.splice(n,1);return n<t.length&&e.stop.equals(t[n].stop)&&(i=!0,!e.isStopIncluded&&t[n].isStopIncluded?n+1<t.length&&t[n+1].start.equals(e.stop)&&t[n].data===t[n+1].data?(t.splice(n,1),t[n]=new En({start:t[n].start,stop:t[n].stop,isStartIncluded:!0,isStopIncluded:t[n].isStopIncluded,data:t[n].data})):t[n]=new En({start:e.stop,stop:e.stop,isStartIncluded:!0,isStopIncluded:!0,data:t[n].data}):t.splice(n,1)),n<t.length&&(K.greaterThan(e.stop,t[n].start)||e.stop.equals(t[n].start)&&e.isStopIncluded&&t[n].isStartIncluded)&&(i=!0,t[n]=new En({start:e.stop,stop:t[n].stop,isStartIncluded:!e.isStopIncluded,isStopIncluded:t[n].isStopIncluded,data:t[n].data})),i&&this._changedEvent.raiseEvent(this),i};Ps.prototype.intersect=function(e,t,n){let i=new Ps,r=0,o=0,s=this._intervals,a=e._intervals;for(;r<s.length&&o<a.length;){let c=s[r],u=a[o];if(K.lessThan(c.stop,u.start))++r;else if(K.lessThan(u.stop,c.start))++o;else{if(l(n)||l(t)&&t(c.data,u.data)||!l(t)&&u.data===c.data){let f=En.intersect(c,u,new En,n);f.isEmpty||i.addInterval(f,t)}K.lessThan(c.stop,u.stop)||c.stop.equals(u.stop)&&!c.isStopIncluded&&u.isStopIncluded?++r:++o}}return i};Ps.fromJulianDateArray=function(e,t){l(t)||(t=new Ps);let n=e.julianDates,i=n.length,r=e.dataCallback,o=e.isStartIncluded??!0,s=e.isStopIncluded??!0,a=e.leadingInterval??!1,c=e.trailingInterval??!1,u,f=0;a&&(++f,u=new En({start:nt.MINIMUM_VALUE,stop:n[0],isStartIncluded:!0,isStopIncluded:!o}),u.data=l(r)?r(u,t.length):t.length,t.addInterval(u));for(let d=0;d<i-1;++d){let p=n[d],g=n[d+1];u=new En({start:p,stop:g,isStartIncluded:t.length===f?o:!0,isStopIncluded:d===i-2?s:!1}),u.data=l(r)?r(u,t.length):t.length,t.addInterval(u)}return c&&(u=new En({start:n[i-1],stop:nt.MAXIMUM_VALUE,isStartIncluded:!s,isStopIncluded:!0}),u.data=l(r)?r(u,t.length):t.length,t.addInterval(u)),t};var yl=new Bh,y3=[0,31,28,31,30,31,30,31,31,30,31,30,31];function nte(e,t,n){l(n)||(n=new K),K.toGregorianDate(e,yl);let i=yl.millisecond+t.millisecond,r=yl.second+t.second,o=yl.minute+t.minute,s=yl.hour+t.hour,a=yl.day+t.day,c=yl.month+t.month,u=yl.year+t.year;for(i>=1e3&&(r+=Math.floor(i/1e3),i=i%1e3),r>=60&&(o+=Math.floor(r/60),r=r%60),o>=60&&(s+=Math.floor(o/60),o=o%60),s>=24&&(a+=Math.floor(s/24),s=s%24),y3[2]=kl(u)?29:28;a>y3[c]||c>=13;)a>y3[c]&&(a-=y3[c],++c),c>=13&&(--c,u+=Math.floor(c/12),c=c%12,++c),y3[2]=kl(u)?29:28;return yl.millisecond=i,yl.second=r,yl.minute=o,yl.hour=s,yl.day=a,yl.month=c,yl.year=u,K.fromGregorianDate(yl,n)}var OAt=new K,MAt=/P(?:([\d.,]+)Y)?(?:([\d.,]+)M)?(?:([\d.,]+)W)?(?:([\d.,]+)D)?(?:T(?:([\d.,]+)H)?(?:([\d.,]+)M)?(?:([\d.,]+)S)?)?/;function OSe(e,t){if(!l(e)||e.length===0)return!1;if(t.year=0,t.month=0,t.day=0,t.hour=0,t.minute=0,t.second=0,t.millisecond=0,e[0]==="P"){let n=e.match(MAt);if(!l(n))return!1;if(l(n[1])&&(t.year=Number(n[1].replace(",","."))),l(n[2])&&(t.month=Number(n[2].replace(",","."))),l(n[3])&&(t.day=Number(n[3].replace(",","."))*7),l(n[4])&&(t.day+=Number(n[4].replace(",","."))),l(n[5])&&(t.hour=Number(n[5].replace(",","."))),l(n[6])&&(t.minute=Number(n[6].replace(",","."))),l(n[7])){let i=Number(n[7].replace(",","."));t.second=Math.floor(i),t.millisecond=i%1*1e3}}else e[e.length-1]!=="Z"&&(e+="Z"),K.toGregorianDate(K.fromIso8601(e,OAt),t);return t.year||t.month||t.day||t.hour||t.minute||t.second||t.millisecond}var A3=new Bh;Ps.fromIso8601=function(e,t){let n=e.iso8601.split("/"),i=K.fromIso8601(n[0]),r=K.fromIso8601(n[1]),o=[];if(!OSe(n[2],A3))o.push(i,r);else{let s=K.clone(i);for(o.push(s);K.compare(s,r)<0;)s=nte(s,A3),K.compare(r,s)<=0&&K.clone(r,s),o.push(s)}return Ps.fromJulianDateArray({julianDates:o,isStartIncluded:e.isStartIncluded,isStopIncluded:e.isStopIncluded,leadingInterval:e.leadingInterval,trailingInterval:e.trailingInterval,dataCallback:e.dataCallback},t)};Ps.fromIso8601DateArray=function(e,t){return Ps.fromJulianDateArray({julianDates:e.iso8601Dates.map(function(n){return K.fromIso8601(n)}),isStartIncluded:e.isStartIncluded,isStopIncluded:e.isStopIncluded,leadingInterval:e.leadingInterval,trailingInterval:e.trailingInterval,dataCallback:e.dataCallback},t)};Ps.fromIso8601DurationArray=function(e,t){let n=e.epoch,i=e.iso8601Durations,r=e.relativeToPrevious??!1,o=[],s,a,c=i.length;for(let u=0;u<c;++u)(OSe(i[u],A3)||u===0)&&(r&&l(a)?s=nte(a,A3):s=nte(n,A3),o.push(s),a=s);return Ps.fromJulianDateArray({julianDates:o,isStartIncluded:e.isStartIncluded,isStopIncluded:e.isStopIncluded,leadingInterval:e.leadingInterval,trailingInterval:e.trailingInterval,dataCallback:e.dataCallback},t)};var Ds=Ps;function NAt(e,t,n,i){function r(){n.raiseEvent(e)}let o=[];t.removeAll();let s=i.length;for(let a=0;a<s;a++){let c=i.get(a);l(c.data)&&o.indexOf(c.data)===-1&&t.add(c.data.definitionChanged,r)}}function _E(){this._eventHelper=new jo,this._definitionChanged=new be,this._intervals=new Ds,this._intervals.changedEvent.addEventListener(_E.prototype._intervalsChanged,this)}Object.defineProperties(_E.prototype,{isConstant:{get:function(){return this._intervals.isEmpty}},definitionChanged:{get:function(){return this._definitionChanged}},intervals:{get:function(){return this._intervals}}});var LAt=new K;_E.prototype.getValue=function(e,t){l(e)||(e=K.now(LAt));let n=this._intervals.findDataForIntervalContainingDate(e);if(l(n))return n.getValue(e,t)};_E.prototype.equals=function(e){return this===e||e instanceof _E&&this._intervals.equals(e._intervals,X.equals)};_E.prototype._intervalsChanged=function(){NAt(this,this._eventHelper,this._definitionChanged,this._intervals),this._definitionChanged.raiseEvent(this)};var Al=_E;function JA(e){this._referenceFrame=e??ji.FIXED,this._definitionChanged=new be,this._composite=new Al,this._composite.definitionChanged.addEventListener(JA.prototype._raiseDefinitionChanged,this)}Object.defineProperties(JA.prototype,{isConstant:{get:function(){return this._composite.isConstant}},definitionChanged:{get:function(){return this._definitionChanged}},intervals:{get:function(){return this._composite.intervals}},referenceFrame:{get:function(){return this._referenceFrame},set:function(e){this._referenceFrame=e}}});var FAt=new K;JA.prototype.getValue=function(e,t){return l(e)||(e=K.now(FAt)),this.getValueInReferenceFrame(e,ji.FIXED,t)};JA.prototype.getValueInReferenceFrame=function(e,t,n){let i=this._composite._intervals.findDataForIntervalContainingDate(e);if(l(i))return i.getValueInReferenceFrame(e,t,n)};JA.prototype.equals=function(e){return this===e||e instanceof JA&&this._referenceFrame===e._referenceFrame&&this._composite.equals(e._composite,X.equals)};JA.prototype._raiseDefinitionChanged=function(){this._definitionChanged.raiseEvent(this)};var _c=JA;var MSe={WHOLE:0,PORTIONS:1};Object.freeze(MSe);var h0=MSe;function NSe(e,t,n){let i=new WeakRef(t),r=e.addEventListener(function(){let o=i.deref();l(o)?n.apply(o,arguments):r()});return r}function yE(e){let t=e._targetProperty;if(!l(t)){let n=e._targetEntity;if(!l(n)){if(n=e._targetCollection.getById(e._targetId),!l(n)){e._targetEntity=e._targetProperty=void 0;return}e._removeTargetListener=NSe(n.definitionChanged,e,dh.prototype._onTargetEntityDefinitionChanged),e._targetEntity=n}let i=e._targetPropertyNames;t=e._targetEntity;for(let r=0,o=i.length;r<o&&l(t);++r)t=t[i[r]];e._targetProperty=t}return t}function dh(e,t,n){this._targetCollection=e,this._targetId=t,this._targetPropertyNames=n,this._targetProperty=void 0,this._targetEntity=void 0,this._definitionChanged=new be,this._removeTargetListener=void 0,NSe(e.collectionChanged,this,dh.prototype._onCollectionChanged)}Object.defineProperties(dh.prototype,{isConstant:{get:function(){return X.isConstant(yE(this))}},definitionChanged:{get:function(){return this._definitionChanged}},referenceFrame:{get:function(){let e=yE(this);return l(e)?e.referenceFrame:void 0}},targetId:{get:function(){return this._targetId}},targetCollection:{get:function(){return this._targetCollection}},targetPropertyNames:{get:function(){return this._targetPropertyNames}},resolvedProperty:{get:function(){return yE(this)}}});dh.fromString=function(e,t){let n,i=[],r=!0,o=!1,s="";for(let a=0;a<t.length;++a){let c=t.charAt(a);o?(s+=c,o=!1):c==="\\"?o=!0:r&&c==="#"?(n=s,r=!1,s=""):!r&&c==="."?(i.push(s),s=""):s+=c}return i.push(s),new dh(e,n,i)};var BAt=new K;dh.prototype.getValue=function(e,t){let n=yE(this);return l(e)||(e=K.now(BAt)),l(n)?n.getValue(e,t):void 0};dh.prototype.getValueInReferenceFrame=function(e,t,n){let i=yE(this);return l(i)?i.getValueInReferenceFrame(e,t,n):void 0};dh.prototype.getType=function(e){let t=yE(this);return l(t)?t.getType(e):void 0};dh.prototype.equals=function(e){if(this===e)return!0;let t=this._targetPropertyNames,n=e._targetPropertyNames;if(this._targetCollection!==e._targetCollection||this._targetId!==e._targetId||t.length!==n.length)return!1;let i=this._targetPropertyNames.length;for(let r=0;r<i;r++)if(t[r]!==n[r])return!1;return!0};dh.prototype._onTargetEntityDefinitionChanged=function(e,t,n,i){l(this._targetProperty)&&this._targetPropertyNames[0]===t&&(this._targetProperty=void 0,this._definitionChanged.raiseEvent(this))};dh.prototype._onCollectionChanged=function(e,t,n){let i=this._targetEntity;l(i)&&n.indexOf(i)!==-1?(this._removeTargetListener(),this._removeTargetListener=void 0,this._targetEntity=this._targetProperty=void 0):l(i)||(i=yE(this),l(i)&&this._definitionChanged.raiseEvent(this))};var O_=dh;var LSe={NONE:0,HOLD:1,EXTRAPOLATE:2,LINEAR_EXTRAPOLATE:3};Object.freeze(LSe);var hu=LSe;var rte=class{static get type(){return"Linear"}static getRequiredDataPoints(t){return 2}static interpolateOrderZero(t,n,i,r,o){l(o)||(o=new Array(r));let s,a,c,u=n[0],f=n[1];for(s=0;s<r;s++)a=i[s],c=i[s+r],o[s]=((c-a)*t+f*a-u*c)/(f-u);return o}},ZA=rte;var FSe={packedLength:1,pack:function(e,t,n){n=n??0,t[n]=e},unpack:function(e,t,n){return t=t??0,e[t]}};function BSe(e,t,n){let i,r=e.length,o=n.length,s=r+o;if(e.length=s,r!==t){let a=r-1;for(i=s-1;i>=t;i--)e[i]=e[a--]}for(i=0;i<o;i++)e[t++]=n[i]}function kSe(e,t){return e instanceof K?e:typeof e=="string"?K.fromIso8601(e):K.addSeconds(t,e,new K)}var ote=[],ste=[];function jG(e,t,n,i,r){let o=0,s,a,c,u,f,d;for(;o<i.length;){f=kSe(i[o],e),c=vr(t,f,K.compare);let p=0,g=0;if(c<0){for(c=~c,u=c*r,a=void 0,d=t[c];o<i.length&&(f=kSe(i[o],e),!(l(a)&&K.compare(a,f)>=0||l(d)&&K.compare(f,d)>=0));){for(ote[p++]=f,o=o+1,s=0;s<r;s++)ste[g++]=i[o],o=o+1;a=f}p>0&&(ste.length=g,BSe(n,u,ste),ote.length=p,BSe(t,c,ote))}else{for(s=0;s<r;s++)o++,n[c*r+s]=i[o];o++}}}function hh(e,t){let n=e;n===Number&&(n=FSe);let i=n.packedLength,r=n.packedInterpolationLength??i,o=0,s;if(l(t)){let a=t.length;s=new Array(a);for(let c=0;c<a;c++){let u=t[c];u===Number&&(u=FSe);let f=u.packedLength;i+=f,r+=u.packedInterpolationLength??f,s[c]=u}o=a}this._type=e,this._innerType=n,this._interpolationDegree=1,this._interpolationAlgorithm=ZA,this._lastInterpolationAlgorithm=ZA,this._numberOfPoints=0,this._times=[],this._values=[],this._xTable=[],this._yTable=[],this._packedLength=i,this._packedInterpolationLength=r,this._updateTableLength=!0,this._interpolationResult=new Array(r),this._definitionChanged=new be,this._derivativeTypes=t,this._innerDerivativeTypes=s,this._inputOrder=o,this._forwardExtrapolationType=hu.NONE,this._forwardExtrapolationDuration=0,this._backwardExtrapolationType=hu.NONE,this._backwardExtrapolationDuration=0}Object.defineProperties(hh.prototype,{isConstant:{get:function(){return this._values.length===0}},definitionChanged:{get:function(){return this._definitionChanged}},type:{get:function(){return this._type}},derivativeTypes:{get:function(){return this._derivativeTypes}},interpolationDegree:{get:function(){return this._interpolationDegree}},interpolationAlgorithm:{get:function(){return this._interpolationAlgorithm}},forwardExtrapolationType:{get:function(){return this._forwardExtrapolationType},set:function(e){this._forwardExtrapolationType!==e&&(this._forwardExtrapolationType=e,this._definitionChanged.raiseEvent(this))}},forwardExtrapolationDuration:{get:function(){return this._forwardExtrapolationDuration},set:function(e){this._forwardExtrapolationDuration!==e&&(this._forwardExtrapolationDuration=e,this._definitionChanged.raiseEvent(this))}},backwardExtrapolationType:{get:function(){return this._backwardExtrapolationType},set:function(e){this._backwardExtrapolationType!==e&&(this._backwardExtrapolationType=e,this._definitionChanged.raiseEvent(this))}},backwardExtrapolationDuration:{get:function(){return this._backwardExtrapolationDuration},set:function(e){this._backwardExtrapolationDuration!==e&&(this._backwardExtrapolationDuration=e,this._definitionChanged.raiseEvent(this))}}});var kAt=new K;hh.prototype.getValue=function(e,t){l(e)||(e=K.now(kAt));let n=this._times,i=n.length;if(i===0)return;let r,o=this._innerType,s=this._values,a=vr(n,e,K.compare);var c=!1;if(a<0){if(a=~a,a===0){let S=n[a];if(r=this._backwardExtrapolationDuration,this._backwardExtrapolationType===hu.NONE||r!==0&&K.secondsDifference(S,e)>r)return;if(this._backwardExtrapolationType===hu.HOLD)return o.unpack(s,0,t);c=this._backwardExtrapolationType===hu.LINEAR_EXTRAPOLATE}if(a>=i){a=i-1;let S=n[a];if(r=this._forwardExtrapolationDuration,this._forwardExtrapolationType===hu.NONE||r!==0&&K.secondsDifference(e,S)>r)return;if(this._forwardExtrapolationType===hu.HOLD)return a=i-1,o.unpack(s,a*o.packedLength,t);c=this._forwardExtrapolationType===hu.LINEAR_EXTRAPOLATE}let d=this._xTable,p=this._yTable;var u,f;c?(u=Cesium.LinearApproximation,f=1):(u=this._interpolationAlgorithm,f=this._interpolationDegree),this._lastInterpolationAlgorithm!=u&&(this._lastInterpolationAlgorithm=u,this._updateTableLength=!0);let g=this._packedInterpolationLength,m=this._inputOrder;if(this._updateTableLength){this._updateTableLength=!1;let S=Math.min(u.getRequiredDataPoints(f,m),i);S!==this._numberOfPoints&&(this._numberOfPoints=S,d.length=S,p.length=S*g)}let y=this._numberOfPoints-1;if(y<1)return;let A=0,b=i-1;if(b-A+1>=y+1){let S=a-(y/2|0)-1;S<A&&(S=A);let I=S+y;I>b&&(I=b,S=I-y,S<A&&(S=A)),A=S,b=I}let T=b-A+1;for(let S=0;S<T;++S)d[S]=K.secondsDifference(n[A+S],n[b]);if(l(o.convertPackedArrayForInterpolation))o.convertPackedArrayForInterpolation(s,A,b,p);else{let S=0,I=this._packedLength,R=A*I,O=(b+1)*I;for(;R<O;)p[S]=s[R],R++,S++}let E=K.secondsDifference(e,n[b]),v;if(m===0||!l(u.interpolate))v=u.interpolateOrderZero(E,d,p,g,this._interpolationResult);else{let S=Math.floor(g/(m+1));v=u.interpolate(E,d,p,S,m,m,this._interpolationResult)}return l(o.unpackInterpolationResult)?o.unpackInterpolationResult(v,s,A,b,t):o.unpack(v,0,t)}return o.unpack(s,a*this._packedLength,t)};hh.prototype.setInterpolationOptions=function(e){if(!l(e))return;let t=!1,n=e.interpolationAlgorithm,i=e.interpolationDegree;l(n)&&this._interpolationAlgorithm!==n&&(this._interpolationAlgorithm=n,t=!0),l(i)&&this._interpolationDegree!==i&&(this._interpolationDegree=i,t=!0),t&&(this._updateTableLength=!0,this._definitionChanged.raiseEvent(this))};hh.prototype.addSample=function(e,t,n){let i=this._innerDerivativeTypes,r=l(i),o=this._innerType,s=[];if(s.push(e),o.pack(t,s,s.length),r){let a=i.length;for(let c=0;c<a;c++)i[c].pack(n[c],s,s.length)}jG(void 0,this._times,this._values,s,this._packedLength),this._updateTableLength=!0,this._definitionChanged.raiseEvent(this)};hh.prototype.addSamples=function(e,t,n){let i=this._innerDerivativeTypes,r=l(i),o=this._innerType,s=e.length,a=[];for(let c=0;c<s;c++)if(a.push(e[c]),o.pack(t[c],a,a.length),r){let u=n[c],f=i.length;for(let d=0;d<f;d++)i[d].pack(u[d],a,a.length)}jG(void 0,this._times,this._values,a,this._packedLength),this._updateTableLength=!0,this._definitionChanged.raiseEvent(this)};hh.prototype.getSample=function(e){let t=this._times,n=t.length;if(l(n))return e<0&&(e+=n),t[e]};hh.prototype.addSamplesPackedArray=function(e,t){jG(t,this._times,this._values,e,this._packedLength),this._updateTableLength=!0,this._definitionChanged.raiseEvent(this)};hh.prototype.removeSample=function(e){let t=vr(this._times,e,K.compare);return t<0?!1:(USe(this,t,1),!0)};function USe(e,t,n){let i=e._packedLength;e._times.splice(t,n),e._values.splice(t*i,n*i),e._updateTableLength=!0,e._definitionChanged.raiseEvent(e)}hh.prototype.removeSamples=function(e){let t=this._times,n=vr(t,e.start,K.compare);n<0?n=~n:e.isStartIncluded||++n;let i=vr(t,e.stop,K.compare);i<0?i=~i:e.isStopIncluded&&++i,USe(this,n,i-n)};hh.prototype.equals=function(e){if(this===e)return!0;if(!l(e)||this._type!==e._type||this._interpolationDegree!==e._interpolationDegree||this._interpolationAlgorithm!==e._interpolationAlgorithm)return!1;let t=this._derivativeTypes,n=l(t),i=e._derivativeTypes,r=l(i);if(n!==r)return!1;let o,s;if(n){if(s=t.length,s!==i.length)return!1;for(o=0;o<s;o++)if(t[o]!==i[o])return!1}let a=this._times,c=e._times;if(s=a.length,s!==c.length)return!1;for(o=0;o<s;o++)if(!K.equals(a[o],c[o]))return!1;let u=this._values,f=e._values;for(s=u.length,o=0;o<s;o++)if(u[o]!==f[o])return!1;return!0};hh._mergeNewSamples=jG;var td=hh;function mh(e,t){t=t??0;let n;if(t>0){n=new Array(t);for(let i=0;i<t;i++)n[i]=h}this._numberOfDerivatives=t,this._property=new td(h,n),this._definitionChanged=new be,this._referenceFrame=e??ji.FIXED,this._property._definitionChanged.addEventListener(function(){this._definitionChanged.raiseEvent(this)},this)}Object.defineProperties(mh.prototype,{isConstant:{get:function(){return this._property.isConstant}},definitionChanged:{get:function(){return this._definitionChanged}},referenceFrame:{get:function(){return this._referenceFrame}},interpolationDegree:{get:function(){return this._property.interpolationDegree}},interpolationAlgorithm:{get:function(){return this._property.interpolationAlgorithm}},numberOfDerivatives:{get:function(){return this._numberOfDerivatives}},forwardExtrapolationType:{get:function(){return this._property.forwardExtrapolationType},set:function(e){this._property.forwardExtrapolationType=e}},forwardExtrapolationDuration:{get:function(){return this._property.forwardExtrapolationDuration},set:function(e){this._property.forwardExtrapolationDuration=e}},backwardExtrapolationType:{get:function(){return this._property.backwardExtrapolationType},set:function(e){this._property.backwardExtrapolationType=e}},backwardExtrapolationDuration:{get:function(){return this._property.backwardExtrapolationDuration},set:function(e){this._property.backwardExtrapolationDuration=e}}});var UAt=new K;mh.prototype.getValue=function(e,t){return l(e)||(e=K.now(UAt)),this.getValueInReferenceFrame(e,ji.FIXED,t)};mh.prototype.getValueInReferenceFrame=function(e,t,n){if(n=this._property.getValue(e,n),l(n))return nm.convertToReferenceFrame(e,n,this._referenceFrame,t,n)};mh.prototype.setInterpolationOptions=function(e){this._property.setInterpolationOptions(e)};mh.prototype.addSample=function(e,t,n){let i=this._numberOfDerivatives;this._property.addSample(e,t,n)};mh.prototype.addSamples=function(e,t,n){this._property.addSamples(e,t,n)};mh.prototype.addSamplesPackedArray=function(e,t){this._property.addSamplesPackedArray(e,t)};mh.prototype.removeSample=function(e){return this._property.removeSample(e)};mh.prototype.removeSamples=function(e){this._property.removeSamples(e)};mh.prototype.equals=function(e){return this===e||e instanceof mh&&X.equals(this._property,e._property)&&this._referenceFrame===e._referenceFrame};var yc=mh;function QA(e){this._definitionChanged=new be,this._value=void 0,this._removeSubscription=void 0,this.setValue(e)}Object.defineProperties(QA.prototype,{isConstant:{get:function(){return X.isConstant(this._value)}},definitionChanged:{get:function(){return this._definitionChanged}},referenceFrame:{get:function(){return l(this._value)?this._value.referenceFrame:ji.FIXED}}});var zAt=new K;QA.prototype.getValue=function(e,t){return l(e)||(e=K.now(zAt)),this.getValueInReferenceFrame(e,ji.FIXED,t)};QA.prototype.setValue=function(e){this._value!==e&&(this._value=e,l(this._removeSubscription)&&(this._removeSubscription(),this._removeSubscription=void 0),l(e)&&(this._removeSubscription=e.definitionChanged.addEventListener(this._raiseDefinitionChanged,this)),this._definitionChanged.raiseEvent(this))};QA.prototype.getValueInReferenceFrame=function(e,t,n){if(l(this._value))return n=this._value.getValueInReferenceFrame(e,t,n),l(n)?ee.default.scaleToGeodeticSurface(n,n):void 0};QA.prototype.equals=function(e){return this===e||e instanceof QA&&this._value===e._value};QA.prototype._raiseDefinitionChanged=function(){this._definitionChanged.raiseEvent(this)};var m0=QA;function eb(e){this._definitionChanged=new be,this._intervals=new Ds,this._intervals.changedEvent.addEventListener(eb.prototype._intervalsChanged,this),this._referenceFrame=e??ji.FIXED}Object.defineProperties(eb.prototype,{isConstant:{get:function(){return this._intervals.isEmpty}},definitionChanged:{get:function(){return this._definitionChanged}},intervals:{get:function(){return this._intervals}},referenceFrame:{get:function(){return this._referenceFrame}}});var VAt=new K;eb.prototype.getValue=function(e,t){return l(e)||(e=K.now(VAt)),this.getValueInReferenceFrame(e,ji.FIXED,t)};eb.prototype.getValueInReferenceFrame=function(e,t,n){let i=this._intervals.findDataForIntervalContainingDate(e);if(l(i))return nm.convertToReferenceFrame(e,i,this._referenceFrame,t,n)};eb.prototype.equals=function(e){return this===e||e instanceof eb&&this._intervals.equals(e._intervals,X.equals)&&this._referenceFrame===e._referenceFrame};eb.prototype._intervalsChanged=function(){this._definitionChanged.raiseEvent(this)};var M_=eb;var zSe=new $,VSe=new $,jSe=new $,jAt=new h,HSe=new h,HAt=new h,GAt=new h,HG=new Le,GG=new N,WG=new $;function x3(e,t,n,i,r){if(!(!l(t)||!l(n))){if(h.subtract(t,n,r),l(i.orientation))i.orientation.getValue(e,HG)&&(Le.conjugate(HG,HG),$.fromQuaternion(HG,WG),$.multiplyByVector(WG,r,r));else if(l(lte(e,i.position,GG)))N.inverse(GG,GG),N.getRotation(GG,WG),$.multiplyByVector(WG,r,r);else return;return r}}function lte(e,t,n){let i=t.getValue(e,jAt);if(l(i)){let r=K.addSeconds(e,.01,new K),o=t.getValue(r,HSe);if(l(o)&&!h.equalsEpsilon(i,o,D.EPSILON16)){let s=At.computeFixedToIcrfMatrix(e,zSe),a=At.computeFixedToIcrfMatrix(r,VSe),c;!l(s)||!l(a)?(c=At.computeTemeToPseudoFixedMatrix(e,jSe),s=$.transpose(c,zSe),a=At.computeTemeToPseudoFixedMatrix(r,VSe),$.transpose(a,a)):c=$.transpose(s,jSe);let u=HAt;h.normalize(i,u),h.normalize(o,o),$.multiplyByVector(s,u,u),$.multiplyByVector(a,o,o);let f=h.cross(u,o,GAt);if(!h.equalsEpsilon(f,h.ZERO,D.EPSILON16)){let d=h.cross(f,u,HSe);return $.multiplyByVector(c,d,d),$.multiplyByVector(c,f,f),$.multiplyByVector(c,u,u),h.normalize(d,d),h.normalize(f,f),h.normalize(u,u),l(n)||(n=new N),n[0]=d.x,n[1]=d.y,n[2]=d.z,n[3]=0,n[4]=f.x,n[5]=f.y,n[6]=f.z,n[7]=0,n[8]=u.x,n[9]=u.y,n[10]=u.z,n[11]=0,n[12]=i.x,n[13]=i.y,n[14]=i.z,n[15]=1,n}}}}var GSe=60,$Se=1,JSe=new En,ate=new En,cte=new En;function WSe(e){this.entity=e,this.polyline=void 0,this.segmentPolylines=[],this.index=void 0,this.updater=void 0}var qG=new h;function WAt(e,t,n,i,r,o,s,a,c){let u,f,d=!1;o instanceof Jr&&(u=o,f=u.position,o=ji.FIXED,d=!0);let p=a,g,m;g=e.getValueInReferenceFrame(t,o,c[p]),d?(m=f.getValueInReferenceFrame(t,o,qG),g=x3(t,g,m,u,g),l(g)&&(c[p++]=g)):l(g)&&(c[p++]=g);let y=!l(r)||K.lessThanOrEquals(r,t)||K.greaterThanOrEquals(r,n),A=0,b=i.length,x=i[A],T=n,E=!1,v,S,I;for(;A<b;){if(!y&&K.greaterThanOrEquals(x,r)&&(g=e.getValueInReferenceFrame(r,o,c[p]),d?(m=f.getValueInReferenceFrame(r,o,qG),l(g)&&l(m)&&(g=x3(r,g,m,u,g),l(g)&&(c[p++]=g))):l(g)&&(c[p++]=g),y=!0),K.greaterThan(x,t)&&K.lessThan(x,T)&&!x.equals(r)&&(g=e.getValueInReferenceFrame(x,o,c[p]),d?(m=f.getValueInReferenceFrame(x,o,qG),l(g)&&l(m)&&(g=x3(x,g,m,u,g),l(g)&&(c[p++]=g))):l(g)&&(c[p++]=g)),A<b-1){if(s>0&&!E){let R=i[A+1],O=K.secondsDifference(R,x);E=O>s,E&&(v=Math.ceil(O/s),S=0,I=O/Math.max(v,2),v=Math.max(v-1,1))}if(E&&S<v){x=K.addSeconds(x,I,new K),S++;continue}}E=!1,A++,x=i[A]}return g=e.getValueInReferenceFrame(n,o,c[p]),d?(m=f.getValueInReferenceFrame(n,o,qG),l(g)&&l(m)&&(g=x3(n,g,m,u,g),l(g)&&(c[p++]=g))):l(g)&&(c[p++]=g),p}function qAt(e,t,n,i,r,o,s,a){let c,u=0,f=s,d=t,p=!l(i)||K.lessThanOrEquals(i,t)||K.greaterThanOrEquals(i,n);for(;K.lessThan(d,n);)!p&&K.greaterThanOrEquals(d,i)&&(p=!0,c=e.getValueInReferenceFrame(i,r,a[f]),l(c)&&(a[f]=c,f++)),c=e.getValueInReferenceFrame(d,r,a[f]),l(c)&&(a[f]=c,f++),u++,d=K.addSeconds(t,o*u,new K);return c=e.getValueInReferenceFrame(n,r,a[f]),l(c)&&(a[f]=c,f++),f}function YAt(e,t,n,i,r,o,s,a){let c,u=0,f=s,d=t,p=Math.max(o,60),g=!l(i)||K.lessThanOrEquals(i,t)||K.greaterThanOrEquals(i,n);for(;K.lessThan(d,n);)!g&&K.greaterThanOrEquals(d,i)&&(g=!0,c=e.getValueInReferenceFrame(i,r,a[f]),l(c)&&(a[f]=c,f++)),c=e.getValueInReferenceFrame(d,r,a[f]),l(c)&&(a[f]=c,f++),u++,d=K.addSeconds(t,p*u,new K);return c=e.getValueInReferenceFrame(n,r,a[f]),l(c)&&(a[f]=c,f++),f}function XAt(e,t,n,i,r,o,s,a){cte.start=t,cte.stop=n;let c=s,u=e.intervals;for(let f=0;f<u.length;f++){let d=u.get(f);if(!En.intersect(d,cte,JSe).isEmpty){let p=d.start;d.isStartIncluded||(d.isStopIncluded?p=d.stop:p=K.addSeconds(d.start,K.secondsDifference(d.stop,d.start)/2,new K));let g=e.getValueInReferenceFrame(p,r,a[c]);l(g)&&(a[c]=g,c++)}}return c}function KAt(e,t,n,i,r,o,s,a){let c=e.getValueInReferenceFrame(t,r,a[s]);return l(c)&&(a[s++]=c),s}function $At(e,t,n,i,r,o,s,a){ate.start=t,ate.stop=n;let c=s,u=e.intervals;for(let f=0;f<u.length;f++){let d=u.get(f);if(!En.intersect(d,ate,JSe).isEmpty){let p=d.start,g=d.stop,m=t;K.greaterThan(p,m)&&(m=p);let y=n;K.lessThan(g,y)&&(y=g),c=ZSe(d.data,m,y,i,r,o,c,a)}}return c}function ZSe(e,t,n,i,r,o,s,a){for(;e instanceof O_;)e=e.resolvedProperty;if(e instanceof yc){let c=e._property._times;s=WAt(e,t,n,c,i,r,o,s,a)}else e instanceof _3?s=qAt(e,t,n,i,r,o,s,a):e instanceof _c?s=$At(e,t,n,i,r,o,s,a):e instanceof M_?s=XAt(e,t,n,i,r,o,s,a):e instanceof Kl||e instanceof m0&&X.isConstant(e)?s=KAt(e,t,n,i,r,o,s,a):s=YAt(e,t,n,i,r,o,s,a);return s}function ute(e,t,n,i,r,o,s){l(s)||(s=[]);let a=ZSe(e,t,n,i,r,o,0,s);return s.length=a,s}var qSe=new $,YSe=new Le,XSe=new $,b3=new En,YG=new En,AE=new En;function JAt(e){let t=[];if(!l(e))return t;for(let n in e){if(n[0]!=="_"||n==="_definitionChanged"||n.endsWith("Subscription"))continue;let i=e[n];l(i)&&typeof i.getValue=="function"&&!X.isConstant(i)&&t.push(i)}return t}function KSe(e,t,n,i,r,o,s,a,c,u,f){e.sort(K.compare),e=Fr(e,K.equalsEpsilon);let d=f;for(let p=0;p<e.length-1;p++){let g=e[p],m=e[p+1];if(!K.lessThan(g,m))continue;let y=K.addSeconds(g,K.secondsDifference(m,g)/2,new K),A=ute(t,g,m,n,c,a,[]);if(A.length<2)continue;let b=o.segmentPolylines[d];l(b)||(b=s.add(),b.id=r,o.segmentPolylines[d]=b),b.show=!0,b.positions=A,b.material=yo.getValue(y,u,b.material),b.width=X.getValueOrDefault(i._width,n,$Se),d++}return d}function T3(e,t){this._unusedIndexes=[],this._polylineCollection=new Lm,this._scene=e,this._referenceFrame=t,e.primitives.add(this._polylineCollection)}T3.prototype.update=function(e){let t=this._referenceFrame;if(t===ji.INERTIAL){let n=At.computeIcrfToFixedMatrix(e,qSe);l(n)||(n=At.computeTemeToPseudoFixedMatrix(e,qSe)),N.fromRotationTranslation(n,h.ZERO,this._polylineCollection.modelMatrix)}else if(t instanceof Jr){let n=t.position.getValue(e);l(t.orientation)?l(t.orientation.getValue(e,YSe))&&($.fromQuaternion(YSe,XSe),N.fromRotationTranslation(XSe,n,this._polylineCollection.modelMatrix)):lte(e,t.position,this._polylineCollection.modelMatrix)}};T3.prototype.updateObject=function(e,t){let n=t.entity,i=n._path,r=n._position,o,s,a=i._show,c=t.polyline,u=n.isShowing&&n.isAvailable(e)&&(!l(a)||a.getValue(e));if(u){let m=X.getValueOrUndefined(i._leadTime,e),y=X.getValueOrUndefined(i._trailTime,e),A=n._availability,b=l(A),x=l(m),T=l(y);if(u=b||x&&T,u){if(T&&(o=K.addSeconds(e,-y,new K)),x&&(s=K.addSeconds(e,m,new K)),b){let E=A.start,v=A.stop;(!T||K.greaterThan(E,o))&&(o=E),(!x||K.lessThan(v,s))&&(s=v)}u=K.lessThan(o,s)}}if(!u){l(c)&&(this._unusedIndexes.push(t.index),t.polyline=void 0,c.show=!1,t.index=void 0);for(let m=0;m<t.segmentPolylines.length;m++)t.segmentPolylines[m].show=!1;return}if(!l(c)){let m=this._unusedIndexes;if(m.length>0){let A=m.pop();c=this._polylineCollection.get(A),t.index=A}else t.index=this._polylineCollection.length,c=this._polylineCollection.add();c.id=n,t.polyline=c}let f=X.getValueOrDefault(i._resolution,e,GSe),d=ute(r,o,s,e,this._referenceFrame,f,c.positions.slice());if(d.length<2){c.show=!1;for(let m=0;m<t.segmentPolylines.length;m++)t.segmentPolylines[m].show=!1;return}c.show=!0,c.positions=d,c.material=yo.getValue(e,i.material,c.material);let p=X.getValueOrUndefined(i.materialMode,e),g=i.material;if(p===h0.PORTIONS&&!g.isConstant){l(c)&&(c.show=!1);let m=f>0?f:GSe,y=g.intervals,A=0;if(l(y)){b3.start=o,b3.stop=s,b3.isStartIncluded=!0,b3.isStopIncluded=!0;for(let b=0;b<y.length;b++){let x=y.get(b);if(!En.intersect(x,b3,YG))continue;let T=YG.start,E=YG.stop;if(K.greaterThanOrEquals(T,E))continue;let v=JAt(x.data),S=[K.clone(T),K.clone(E)];for(let I=0;I<v.length;I++){let R=v[I],O=R.intervals;if(l(O))for(let L=0;L<O.length;L++){let _=O.get(L);En.intersect(_,YG,AE)&&(K.greaterThan(AE.start,T)&&K.lessThan(AE.start,E)&&S.push(K.clone(AE.start)),K.greaterThan(AE.stop,T)&&K.lessThan(AE.stop,E)&&S.push(K.clone(AE.stop)))}else if(!X.isConstant(R)){let L=K.clone(T);for(;K.lessThan(L,E);)S.push(K.clone(L)),L=K.addSeconds(L,m,new K)}}A=KSe(S,r,e,i,n,t,this._polylineCollection,m,this._referenceFrame,x.data,A)}}else{let b=[K.clone(o),K.clone(s)],x=K.addSeconds(o,m,new K);for(;K.lessThan(x,s);)b.push(K.clone(x)),x=K.addSeconds(x,m,new K);A=KSe(b,r,e,i,n,t,this._polylineCollection,m,this._referenceFrame,i.material,A)}for(let b=A;b<t.segmentPolylines.length;b++)l(t.segmentPolylines[b])&&(t.segmentPolylines[b].show=!1)}else for(let m=0;m<t.segmentPolylines.length;m++)t.segmentPolylines[m].show=!1;c.width=X.getValueOrDefault(i._width,e,$Se),c.distanceDisplayCondition=X.getValueOrUndefined(i._distanceDisplayCondition,e,c.distanceDisplayCondition)};T3.prototype.removeObject=function(e){let t=e.polyline;l(t)&&(this._unusedIndexes.push(e.index),e.polyline=void 0,t.show=!1,t.id=void 0,e.index=void 0);for(let n=0;n<e.segmentPolylines.length;n++)e.segmentPolylines[n].show=!1;e.segmentPolylines.length=0};T3.prototype.destroy=function(){return this._scene.primitives.remove(this._polylineCollection),le(this)};function p0(e,t){t.collectionChanged.addEventListener(p0.prototype._onCollectionChanged,this),this._scene=e,this._updaters={},this._entityCollection=t,this._items=new Ut,this._onCollectionChanged(t,t.values,[],[])}p0.prototype.update=function(e){let t=this._updaters;for(let i in t)t.hasOwnProperty(i)&&t[i].update(e);let n=this._items.values;if(n.length===0&&l(this._updaters)&&Object.keys(this._updaters).length>0){for(let i in t)t.hasOwnProperty(i)&&t[i].destroy();this._updaters={}}for(let i=0,r=n.length;i<r;i++){let o=n[i],s=o.entity,a=s._position,c=s._path,u=o.updater,f=!1,d=ji.FIXED,p=d.toString();if(this._scene.mode===re.SCENE3D){let m=X.getValueOrUndefined(c.relativeTo,e);l(m)?m==="FIXED"?(d=ji.FIXED,p=d.toString()):m==="INERTIAL"?(d=ji.INERTIAL,p=d.toString()):(f=!0,d=this._entityCollection.getById(m),p=m):(d=a.referenceFrame,p=d.toString())}let g=this._updaters[p];if(u===g&&l(g)){g.updateObject(e,o);continue}l(u)&&u.removeObject(o),!(f&&!l(d))&&(l(g)||(g=new T3(this._scene,d),g.update(e),this._updaters[p]=g),o.updater=g,l(g)&&g.updateObject(e,o))}return!0};p0.prototype.isDestroyed=function(){return!1};p0.prototype.destroy=function(){this._entityCollection.collectionChanged.removeEventListener(p0.prototype._onCollectionChanged,this);let e=this._updaters;for(let t in e)e.hasOwnProperty(t)&&e[t].destroy();return le(this)};p0.prototype._onCollectionChanged=function(e,t,n,i){let r,o,s,a=this._items;for(r=t.length-1;r>-1;r--)o=t[r],l(o._path)&&l(o._position)&&a.set(o.id,new WSe(o));for(r=i.length-1;r>-1;r--)o=i[r],l(o._path)&&l(o._position)?a.contains(o.id)||a.set(o.id,new WSe(o)):(s=a.get(o.id),l(s)&&(l(s.updater)&&s.updater.removeObject(s),a.remove(o.id)));for(r=n.length-1;r>-1;r--)o=n[r],s=a.get(o.id),l(s)&&(l(s.updater)&&s.updater.removeObject(s),a.remove(o.id))};p0._subSample=ute;p0._computeVvlhTransform=lte;p0._transformToEntityFrame=x3;var E3=p0;var QSe=z.WHITE,ewe=z.BLACK,twe=0,nwe=1,iwe=0,rwe=Ho.NONE,owe=new z,ZAt=new h,swe=new z,awe=new qt,cwe=new qt,lwe=new Ht;function uwe(e){this.entity=e,this.pointPrimitive=void 0,this.billboard=void 0,this.color=void 0,this.outlineColor=void 0,this.pixelSize=void 0,this.outlineWidth=void 0}function tb(e,t){t.collectionChanged.addEventListener(tb.prototype._onCollectionChanged,this),this._cluster=e,this._entityCollection=t,this._items=new Ut,this._onCollectionChanged(t,t.values,[],[])}tb.prototype.update=function(e){let t=this._items.values,n=this._cluster;for(let i=0,r=t.length;i<r;i++){let o=t[i],s=o.entity,a=s._point,c=o.pointPrimitive,u=o.billboard,f=X.getValueOrDefault(a._heightReference,e,We.NONE),d=s.isShowing&&s.isAvailable(e)&&X.getValueOrDefault(a._show,e,!0),p;if(d&&(p=X.getValueOrUndefined(s._position,e,ZAt),d=l(p)),!d){C3(o,s,n);continue}X.isConstant(s._position)||(n._clusterDirty=!0);let g=!1,m=!1;if(f!==We.NONE&&!l(u)?(l(c)&&(C3(o,s,n),c=void 0),u=n.getBillboard(s),u.id=s,u.image=void 0,o.billboard=u,g=!0,m=h.equals(u.position,p)&&u.heightReference===f):f===We.NONE&&!l(c)&&(l(u)&&(C3(o,s,n),u=void 0),c=n.getPoint(s),c.id=s,o.pointPrimitive=c),l(c))c.show=!0,c.position=p,c.scaleByDistance=X.getValueOrUndefined(a._scaleByDistance,e,awe),c.translucencyByDistance=X.getValueOrUndefined(a._translucencyByDistance,e,cwe),c.color=X.getValueOrDefault(a._color,e,QSe,owe),c.outlineColor=X.getValueOrDefault(a._outlineColor,e,ewe,swe),c.outlineWidth=X.getValueOrDefault(a._outlineWidth,e,twe),c.pixelSize=X.getValueOrDefault(a._pixelSize,e,nwe),c.distanceDisplayCondition=X.getValueOrUndefined(a._distanceDisplayCondition,e,lwe),c.disableDepthTestDistance=X.getValueOrDefault(a._disableDepthTestDistance,e,iwe),c.splitDirection=X.getValueOrDefault(a._splitDirection,e,rwe);else if(l(u)){u.show=!0,u.position=p,u.scaleByDistance=X.getValueOrUndefined(a._scaleByDistance,e,awe),u.translucencyByDistance=X.getValueOrUndefined(a._translucencyByDistance,e,cwe),u.distanceDisplayCondition=X.getValueOrUndefined(a._distanceDisplayCondition,e,lwe),u.disableDepthTestDistance=X.getValueOrDefault(a._disableDepthTestDistance,e,iwe),u.splitDirection=X.getValueOrDefault(a._splitDirection,e,rwe),u.heightReference=f;let y=X.getValueOrDefault(a._color,e,QSe,owe),A=X.getValueOrDefault(a._outlineColor,e,ewe,swe),b=Math.round(X.getValueOrDefault(a._outlineWidth,e,twe)),x=Math.max(1,Math.round(X.getValueOrDefault(a._pixelSize,e,nwe)));if(b>0?(u.scale=1,g=g||b!==o.outlineWidth||x!==o.pixelSize||!z.equals(y,o.color)||!z.equals(A,o.outlineColor)):(u.scale=x/50,x=50,g=g||b!==o.outlineWidth||!z.equals(y,o.color)||!z.equals(A,o.outlineColor)),g){o.color=z.clone(y,o.color),o.outlineColor=z.clone(A,o.outlineColor),o.pixelSize=x,o.outlineWidth=b;let T=y.alpha,E=y.toCssColorString(),v=A.toCssColorString(),S=JSON.stringify([E,x,v,b]);u.setImage(S,QT(T,E,v,b,x))}m&&u._updateClamping()}}return!0};tb.prototype.getBoundingSphere=function(e,t){let n=this._items.get(e.id);if(!l(n)||!(l(n.pointPrimitive)||l(n.billboard)))return Pt.FAILED;if(l(n.pointPrimitive))t.center=h.clone(n.pointPrimitive.position,t.center);else{let i=n.billboard;if(i._clampedToSurface)t.center=h.clone(i._clampedPosition,t.center);else{let r=this._cluster._scene,o=this._items,s=Jh(r,n,i.position,[i],()=>o.get(e.id)===n);if(s===void 0)return Pt.PENDING;s===null?t.center=h.clone(i.position,t.center):t.center=Eg(i.position,s,i.heightReference,r.ellipsoid??ee.default,t.center)}}return t.radius=0,Pt.DONE};tb.prototype.isDestroyed=function(){return!1};tb.prototype.destroy=function(){this._entityCollection.collectionChanged.removeEventListener(tb.prototype._onCollectionChanged,this);let e=this._entityCollection.values;for(let t=0;t<e.length;t++)this._cluster.removePoint(e[t]);return le(this)};tb.prototype._onCollectionChanged=function(e,t,n,i){let r,o,s=this._items,a=this._cluster;for(r=t.length-1;r>-1;r--)o=t[r],l(o._point)&&l(o._position)&&s.set(o.id,new uwe(o));for(r=i.length-1;r>-1;r--)o=i[r],l(o._point)&&l(o._position)?s.contains(o.id)||s.set(o.id,new uwe(o)):(C3(s.get(o.id),o,a),s.remove(o.id));for(r=n.length-1;r>-1;r--)o=n[r],C3(s.get(o.id),o,a),s.remove(o.id)};function C3(e,t,n){if(l(e)){let i=e.pointPrimitive;if(l(i)){e.pointPrimitive=void 0,n.removePoint(t);return}let r=e.billboard;l(r)&&(e.billboard=void 0,n.removeBillboard(t))}}var v3=tb;var pwe=[];function QAt(e,t,n,i,r){let o=pwe;o.length=r;let s,a=n.red,c=n.green,u=n.blue,f=n.alpha,d=i.red,p=i.green,g=i.blue,m=i.alpha;if(z.equals(n,i)){for(s=0;s<r;s++)o[s]=z.clone(n);return o}let y=(d-a)/r,A=(p-c)/r,b=(g-u)/r,x=(m-f)/r;for(s=0;s<r;s++)o[s]=new z(a+s*y,c+s*A,u+s*b,f+s*x);return o}function S3(e){e=e??H.EMPTY_OBJECT;let t=e.positions,n=e.colors,i=e.width??1,r=e.colorsPerVertex??!1;this._positions=t,this._colors=n,this._width=i,this._colorsPerVertex=r,this._vertexFormat=Be.clone(e.vertexFormat??Be.DEFAULT),this._arcType=e.arcType??ln.GEODESIC,this._granularity=e.granularity??D.RADIANS_PER_DEGREE,this._ellipsoid=ee.clone(e.ellipsoid??ee.default),this._workerName="createPolylineGeometry";let o=1+t.length*h.packedLength;o+=l(n)?1+n.length*z.packedLength:1,this.packedLength=o+ee.packedLength+Be.packedLength+4}S3.pack=function(e,t,n){n=n??0;let i,r=e._positions,o=r.length;for(t[n++]=o,i=0;i<o;++i,n+=h.packedLength)h.pack(r[i],t,n);let s=e._colors;for(o=l(s)?s.length:0,t[n++]=o,i=0;i<o;++i,n+=z.packedLength)z.pack(s[i],t,n);return ee.pack(e._ellipsoid,t,n),n+=ee.packedLength,Be.pack(e._vertexFormat,t,n),n+=Be.packedLength,t[n++]=e._width,t[n++]=e._colorsPerVertex?1:0,t[n++]=e._arcType,t[n]=e._granularity,t};var gwe=ee.clone(ee.UNIT_SPHERE),_we=new Be,bE={positions:void 0,colors:void 0,ellipsoid:gwe,vertexFormat:_we,width:void 0,colorsPerVertex:void 0,arcType:void 0,granularity:void 0};S3.unpack=function(e,t,n){t=t??0;let i,r=e[t++],o=new Array(r);for(i=0;i<r;++i,t+=h.packedLength)o[i]=h.unpack(e,t);r=e[t++];let s=r>0?new Array(r):void 0;for(i=0;i<r;++i,t+=z.packedLength)s[i]=z.unpack(e,t);let a=ee.unpack(e,t,gwe);t+=ee.packedLength;let c=Be.unpack(e,t,_we);t+=Be.packedLength;let u=e[t++],f=e[t++]===1,d=e[t++],p=e[t];return l(n)?(n._positions=o,n._colors=s,n._ellipsoid=ee.clone(a,n._ellipsoid),n._vertexFormat=Be.clone(c,n._vertexFormat),n._width=u,n._colorsPerVertex=f,n._arcType=d,n._granularity=p,n):(bE.positions=o,bE.colors=s,bE.width=u,bE.colorsPerVertex=f,bE.arcType=d,bE.granularity=p,new S3(bE))};var fwe=new h,dwe=new h,hwe=new h,mwe=new h;S3.createGeometry=function(e){let t=e._width,n=e._vertexFormat,i=e._colors,r=e._colorsPerVertex,o=e._arcType,s=e._granularity,a=e._ellipsoid,c,u,f,d=[],p=Fr(e._positions,h.equalsEpsilon,!1,d);if(l(i)&&d.length>0){let M=0,F=d[0];i=i.filter(function(V,B){let j;return r?j=B===F||B===0&&F===1:j=B+1===F,j?(M++,F=d[M],!1):!0})}let g=p.length;if(g<2||t<=0)return;if(o===ln.GEODESIC||o===ln.RHUMB){let M,F;o===ln.GEODESIC?(M=D.chordLength(s,a.maximumRadius),F=nr.numberOfPoints):(M=s,F=nr.numberOfPointsRhumbLine);let V=nr.extractHeights(p,a);if(l(i)){let B=1;for(c=0;c<g-1;++c)B+=F(p[c],p[c+1],M);let j=new Array(B),k=0;for(c=0;c<g-1;++c){let G=p[c],q=p[c+1],Q=i[c],W=F(G,q,M);if(r&&c<B){let J=i[c+1],Z=QAt(G,q,Q,J,W),ae=Z.length;for(u=0;u<ae;++u)j[k++]=Z[u]}else for(u=0;u<W;++u)j[k++]=z.clone(Q)}j[k]=z.clone(i[i.length-1]),i=j,pwe.length=0}o===ln.GEODESIC?p=nr.generateCartesianArc({positions:p,minDistance:M,ellipsoid:a,height:V}):p=nr.generateCartesianRhumbArc({positions:p,granularity:M,ellipsoid:a,height:V})}g=p.length;let m=g*4-4,y=new Float64Array(m*3),A=new Float64Array(m*3),b=new Float64Array(m*3),x=new Float32Array(m*2),T=n.st?new Float32Array(m*2):void 0,E=l(i)?new Uint8Array(m*4):void 0,v=0,S=0,I=0,R=0,O;for(u=0;u<g;++u){u===0?(O=fwe,h.subtract(p[0],p[1],O),h.add(p[0],O,O)):O=p[u-1],h.clone(O,hwe),h.clone(p[u],dwe),u===g-1?(O=fwe,h.subtract(p[g-1],p[g-2],O),h.add(p[g-1],O,O)):O=p[u+1],h.clone(O,mwe);let M,F;l(E)&&(u!==0&&!r?M=i[u-1]:M=i[u],u!==g-1&&(F=i[u]));let V=u===0?2:0,B=u===g-1?2:4;for(f=V;f<B;++f){h.pack(dwe,y,v),h.pack(hwe,A,v),h.pack(mwe,b,v),v+=3;let j=f-2<0?-1:1;if(x[S++]=2*(f%2)-1,x[S++]=j*t,n.st&&(T[I++]=u/(g-1),T[I++]=Math.max(x[S-2],0)),l(E)){let k=f<2?M:F;E[R++]=z.floatToByte(k.red),E[R++]=z.floatToByte(k.green),E[R++]=z.floatToByte(k.blue),E[R++]=z.floatToByte(k.alpha)}}}let L=new Tn;L.position=new Ne({componentDatatype:Y.DOUBLE,componentsPerAttribute:3,values:y}),L.prevPosition=new Ne({componentDatatype:Y.DOUBLE,componentsPerAttribute:3,values:A}),L.nextPosition=new Ne({componentDatatype:Y.DOUBLE,componentsPerAttribute:3,values:b}),L.expandAndWidth=new Ne({componentDatatype:Y.FLOAT,componentsPerAttribute:2,values:x}),n.st&&(L.st=new Ne({componentDatatype:Y.FLOAT,componentsPerAttribute:2,values:T})),l(E)&&(L.color=new Ne({componentDatatype:Y.UNSIGNED_BYTE,componentsPerAttribute:4,values:E,normalize:!0}));let _=je.createTypedArray(m,g*6-6),C=0,w=0,P=g-1;for(u=0;u<P;++u)_[w++]=C,_[w++]=C+2,_[w++]=C+1,_[w++]=C+1,_[w++]=C+2,_[w++]=C+3,C+=4;return new St({attributes:L,indices:_,primitiveType:Oe.TRIANGLES,boundingSphere:ue.fromPoints(p),geometryType:vd.POLYLINES})};var N_=S3;var ebt=new ui(0),XG={},ywe=new z,tbt=new Kt(z.WHITE),nbt=new ui(!0),ibt=new ui(Pn.DISABLED),rbt=new ui(new Ht),obt=new ui(Qn.BOTH);function sbt(){this.vertexFormat=void 0,this.positions=void 0,this.width=void 0,this.arcType=void 0,this.granularity=void 0}function abt(){this.positions=void 0,this.width=void 0,this.arcType=void 0,this.granularity=void 0}function Vm(e,t){this._entity=e,this._scene=t,this._entitySubscription=e.definitionChanged.addEventListener(Vm.prototype._onEntityPropertyChanged,this),this._fillEnabled=!1,this._dynamic=!1,this._geometryChanged=new be,this._showProperty=void 0,this._materialProperty=void 0,this._shadowsProperty=void 0,this._distanceDisplayConditionProperty=void 0,this._classificationTypeProperty=void 0,this._depthFailMaterialProperty=void 0,this._geometryOptions=new sbt,this._groundGeometryOptions=new abt,this._id=`polyline-${e.id}`,this._clampToGround=!1,this._supportsPolylinesOnTerrain=Jr.supportsPolylinesOnTerrain(t),this._zIndex=0,this._onEntityPropertyChanged(e,"polyline",e.polyline,void 0)}Object.defineProperties(Vm.prototype,{id:{get:function(){return this._id}},entity:{get:function(){return this._entity}},fillEnabled:{get:function(){return this._fillEnabled}},hasConstantFill:{get:function(){return!this._fillEnabled||!l(this._entity.availability)&&X.isConstant(this._showProperty)}},fillMaterialProperty:{get:function(){return this._materialProperty}},depthFailMaterialProperty:{get:function(){return this._depthFailMaterialProperty}},outlineEnabled:{value:!1},hasConstantOutline:{value:!0},outlineColorProperty:{value:void 0},shadowsProperty:{get:function(){return this._shadowsProperty}},distanceDisplayConditionProperty:{get:function(){return this._distanceDisplayConditionProperty}},classificationTypeProperty:{get:function(){return this._classificationTypeProperty}},isDynamic:{get:function(){return this._dynamic}},isClosed:{value:!1},geometryChanged:{get:function(){return this._geometryChanged}},arcType:{get:function(){return this._arcType}},clampToGround:{get:function(){return this._clampToGround&&this._supportsPolylinesOnTerrain}},zIndex:{get:function(){return this._zIndex}}});Vm.prototype.isOutlineVisible=function(e){return!1};Vm.prototype.isFilled=function(e){let t=this._entity;return(this._fillEnabled&&t.isAvailable(e)&&this._showProperty.getValue(e))??!1};Vm.prototype.createFillGeometryInstance=function(e){let t=this._entity,n=t.isAvailable(e),i=new Dn(n&&t.isShowing&&this._showProperty.getValue(e)),r=this._distanceDisplayConditionProperty.getValue(e),o=ti.fromDistanceDisplayCondition(r),s={show:i,distanceDisplayCondition:o},a;return this._materialProperty instanceof Kt&&(l(this._materialProperty.color)&&(this._materialProperty.color.isConstant||n)&&(a=this._materialProperty.color.getValue(e,ywe)),l(a)||(a=z.WHITE),s.color=Jt.fromColor(a)),this.clampToGround?new Ft({id:t,geometry:new vx(this._groundGeometryOptions),attributes:s}):(l(this._depthFailMaterialProperty)&&this._depthFailMaterialProperty instanceof Kt&&(l(this._depthFailMaterialProperty.color)&&(this._depthFailMaterialProperty.color.isConstant||n)&&(a=this._depthFailMaterialProperty.color.getValue(e,ywe)),l(a)||(a=z.WHITE),s.depthFailColor=Jt.fromColor(a)),new Ft({id:t,geometry:new N_(this._geometryOptions),attributes:s}))};Vm.prototype.createOutlineGeometryInstance=function(e){};Vm.prototype.isDestroyed=function(){return!1};Vm.prototype.destroy=function(){this._entitySubscription(),le(this)};Vm.prototype._onEntityPropertyChanged=function(e,t,n,i){if(!(t==="availability"||t==="polyline"))return;let r=this._entity.polyline;if(!l(r)){this._fillEnabled&&(this._fillEnabled=!1,this._geometryChanged.raiseEvent(this));return}let o=r.positions,s=r.show;if(l(s)&&s.isConstant&&!s.getValue(nt.MINIMUM_VALUE)||!l(o)){this._fillEnabled&&(this._fillEnabled=!1,this._geometryChanged.raiseEvent(this));return}let a=r.zIndex,c=r.material??tbt,u=c instanceof Kt;this._materialProperty=c,this._depthFailMaterialProperty=r.depthFailMaterial,this._showProperty=s??nbt,this._shadowsProperty=r.shadows??ibt,this._distanceDisplayConditionProperty=r.distanceDisplayCondition??rbt,this._classificationTypeProperty=r.classificationType??obt,this._fillEnabled=!0,this._zIndex=a??ebt;let f=r.width,d=r.arcType,p=r.clampToGround,g=r.granularity;if(!o.isConstant||!X.isConstant(f)||!X.isConstant(d)||!X.isConstant(g)||!X.isConstant(p)||!X.isConstant(a))this._dynamic||(this._dynamic=!0,this._geometryChanged.raiseEvent(this));else{let m=this._geometryOptions,y=o.getValue(nt.MINIMUM_VALUE,m.positions);if(!l(y)||y.length<2){this._fillEnabled&&(this._fillEnabled=!1,this._geometryChanged.raiseEvent(this));return}let A;u&&(!l(this._depthFailMaterialProperty)||this._depthFailMaterialProperty instanceof Kt)?A=Vs.VERTEX_FORMAT:A=ac.VERTEX_FORMAT,m.vertexFormat=A,m.positions=y,m.width=l(f)?f.getValue(nt.MINIMUM_VALUE):void 0,m.arcType=l(d)?d.getValue(nt.MINIMUM_VALUE):void 0,m.granularity=l(g)?g.getValue(nt.MINIMUM_VALUE):void 0;let b=this._groundGeometryOptions;b.positions=y,b.width=m.width,b.arcType=m.arcType,b.granularity=m.granularity,this._clampToGround=l(p)?p.getValue(nt.MINIMUM_VALUE):!1,!this._clampToGround&&l(a)&&_t("Entity polylines must have clampToGround: true when using zIndex. zIndex will be ignored."),this._dynamic=!1,this._geometryChanged.raiseEvent(this)}};Vm.prototype.createDynamicUpdater=function(e,t){return new w3(e,t,this)};var Qw={positions:void 0,granularity:void 0,height:void 0,ellipsoid:void 0};function w3(e,t,n){this._line=void 0,this._primitives=e,this._groundPrimitives=t,this._groundPolylinePrimitive=void 0,this._material=void 0,this._geometryUpdater=n,this._positions=[]}function Awe(e){if(l(e._line))return e._line;let t=e._primitives,n=e._geometryUpdater._scene.id+t._guid,i=XG[n];!l(i)||i.isDestroyed()?(i=new Lm,XG[n]=i,t.add(i)):t.contains(i)||t.add(i);let r=i.add();return r.id=e._geometryUpdater._entity,e._line=r,r}w3.prototype.update=function(e){let t=this._geometryUpdater,n=t._entity,i=n.polyline,r=i.positions,o=X.getValueOrUndefined(r,e,this._positions);t._clampToGround=X.getValueOrDefault(i._clampToGround,e,!1),t._groundGeometryOptions.positions=o,t._groundGeometryOptions.width=X.getValueOrDefault(i._width,e,1),t._groundGeometryOptions.arcType=X.getValueOrDefault(i._arcType,e,ln.GEODESIC),t._groundGeometryOptions.granularity=X.getValueOrDefault(i._granularity,e,9999);let s=this._groundPrimitives;if(l(this._groundPolylinePrimitive)&&(s.remove(this._groundPolylinePrimitive),this._groundPolylinePrimitive=void 0),t.clampToGround){if(!n.isShowing||!n.isAvailable(e)||!X.getValueOrDefault(i._show,e,!0)||!l(o)||o.length<2)return;let d=t.fillMaterialProperty,p;if(d instanceof Kt)p=new Vs;else{let g=yo.getValue(e,d,this._material);p=new ac({material:g,translucent:g.isTranslucent()}),this._material=g}this._groundPolylinePrimitive=s.add(new Kh({geometryInstances:t.createFillGeometryInstance(e),appearance:p,classificationType:t.classificationTypeProperty.getValue(e),asynchronous:!1}),X.getValueOrUndefined(t.zIndex,e)),l(this._line)&&(this._line.show=!1);return}let a=Awe(this);if(!n.isShowing||!n.isAvailable(e)||!X.getValueOrDefault(i._show,e,!0)){a.show=!1;return}if(!l(o)||o.length<2){a.show=!1;return}let c=ln.GEODESIC;c=X.getValueOrDefault(i._arcType,e,c);let u=t._scene.globe,f=t._scene.ellipsoid;c!==ln.NONE&&l(u)&&(Qw.ellipsoid=f,Qw.positions=o,Qw.granularity=X.getValueOrUndefined(i._granularity,e),Qw.height=nr.extractHeights(o,f),c===ln.GEODESIC?o=nr.generateCartesianArc(Qw):o=nr.generateCartesianRhumbArc(Qw)),a.show=!0,a.positions=o.slice(),a.material=yo.getValue(e,t.fillMaterialProperty,a.material),a.width=X.getValueOrDefault(i._width,e,1),a.distanceDisplayCondition=X.getValueOrUndefined(i._distanceDisplayCondition,e,a.distanceDisplayCondition)};w3.prototype.getBoundingSphere=function(e){if(this._geometryUpdater.clampToGround){let t=this._groundPolylinePrimitive;if(l(t)&&t.show&&t.ready){let n=t.getGeometryInstanceAttributes(this._geometryUpdater._entity);if(l(n)&&l(n.boundingSphere))return ue.clone(n.boundingSphere,e),Pt.DONE}return l(t)&&!t.ready?Pt.PENDING:Pt.DONE}else{let t=Awe(this);if(t.show&&t.positions.length>0)return ue.fromPoints(t.positions,e),Pt.DONE}return Pt.FAILED};w3.prototype.isDestroyed=function(){return!1};w3.prototype.destroy=function(){let t=this._geometryUpdater._scene.id+this._primitives._guid,n=XG[t];l(n)&&(n.remove(this._line),n.length===0&&(this._primitives.removeAndDestroy(n),delete XG[t])),l(this._groundPolylinePrimitive)&&this._groundPrimitives.remove(this._groundPolylinePrimitive),le(this)};var I3=Vm;var cbt=new z,lbt=new Ht,ubt=new Ht;function jm(e,t,n,i,r){let o;n instanceof Kt?o=Vs:o=ac,this.orderedGroundPrimitives=e,this.classificationType=t,this.appearanceType=o,this.materialProperty=n,this.updaters=new Ut,this.createPrimitive=!0,this.primitive=void 0,this.oldPrimitive=void 0,this.geometry=new Ut,this.material=void 0,this.updatersWithAttributes=new Ut,this.attributes=new Ut,this.invalidated=!1,this.removeMaterialSubscription=n.definitionChanged.addEventListener(jm.prototype.onMaterialChanged,this),this.subscriptions=new Ut,this.showsUpdated=new Ut,this.zIndex=i,this._asynchronous=r}jm.prototype.onMaterialChanged=function(){this.invalidated=!0};jm.prototype.isMaterial=function(e){let t=this.materialProperty,n=e.fillMaterialProperty;return n===t||n instanceof Kt&&t instanceof Kt?!0:l(t)&&t.equals(n)};jm.prototype.add=function(e,t,n){let i=t.id;if(this.updaters.set(i,t),this.geometry.set(i,n),!t.hasConstantFill||!t.fillMaterialProperty.isConstant||!X.isConstant(t.distanceDisplayConditionProperty))this.updatersWithAttributes.set(i,t);else{let r=this;this.subscriptions.set(i,t.entity.definitionChanged.addEventListener(function(o,s,a,c){s==="isShowing"&&r.showsUpdated.set(t.id,t)}))}this.createPrimitive=!0};jm.prototype.remove=function(e){let t=e.id;if(this.createPrimitive=this.geometry.remove(t)||this.createPrimitive,this.updaters.remove(t)){this.updatersWithAttributes.remove(t);let n=this.subscriptions.get(t);return l(n)&&(n(),this.subscriptions.remove(t),this.showsUpdated.remove(t)),!0}return!1};jm.prototype.update=function(e){let t=!0,n=this.primitive,i=this.orderedGroundPrimitives,r=this.geometry.values,o;if(this.createPrimitive){if(r.length>0){l(n)&&(l(this.oldPrimitive)?i.remove(n):this.oldPrimitive=n);let a=this.appearanceType;n=new Kh({show:!1,asynchronous:this._asynchronous,geometryInstances:r.slice(),appearance:new a,classificationType:this.classificationType}),this.appearanceType===ac&&(this.material=yo.getValue(e,this.materialProperty,this.material),n.appearance.material=this.material),i.add(n,this.zIndex),t=!1}else{l(n)&&(i.remove(n),n=void 0);let a=this.oldPrimitive;l(a)&&(i.remove(a),this.oldPrimitive=void 0)}this.attributes.removeAll(),this.primitive=n,this.createPrimitive=!1}else if(l(n)&&n.ready){n.show=!0,l(this.oldPrimitive)&&(i.remove(this.oldPrimitive),this.oldPrimitive=void 0),this.appearanceType===ac&&(this.material=yo.getValue(e,this.materialProperty,this.material),this.primitive.appearance.material=this.material);let s=this.updatersWithAttributes.values,a=s.length;for(o=0;o<a;o++){let c=s[o],u=c.entity,f=this.geometry.get(c.id),d=this.attributes.get(f.id.id);if(l(d)||(d=n.getGeometryInstanceAttributes(f.id),this.attributes.set(f.id.id,d)),!c.fillMaterialProperty.isConstant){let y=c.fillMaterialProperty.color,A=X.getValueOrDefault(y,e,z.WHITE,cbt);z.equals(d._lastColor,A)||(d._lastColor=z.clone(A,d._lastColor),d.color=Jt.toValue(A,d.color))}let p=u.isShowing&&(c.hasConstantFill||c.isFilled(e)),g=d.show[0]===1;p!==g&&(d.show=Dn.toValue(p,d.show));let m=c.distanceDisplayConditionProperty;if(!X.isConstant(m)){let y=X.getValueOrDefault(m,e,ubt,lbt);Ht.equals(y,d._lastDistanceDisplayCondition)||(d._lastDistanceDisplayCondition=Ht.clone(y,d._lastDistanceDisplayCondition),d.distanceDisplayCondition=ti.toValue(y,d.distanceDisplayCondition))}}this.updateShows(n)}else l(n)&&!n.ready&&(t=!1);return t};jm.prototype.updateShows=function(e){let t=this.showsUpdated.values,n=t.length;for(let i=0;i<n;i++){let r=t[i],o=r.entity,s=this.geometry.get(r.id),a=this.attributes.get(s.id.id);l(a)||(a=e.getGeometryInstanceAttributes(s.id),this.attributes.set(s.id.id,a));let c=o.isShowing,u=a.show[0]===1;c!==u&&(a.show=Dn.toValue(c,a.show),s.attributes.show.value[0]=a.show[0])}this.showsUpdated.removeAll()};jm.prototype.contains=function(e){return this.updaters.contains(e.id)};jm.prototype.getBoundingSphere=function(e,t){let n=this.primitive;if(!n.ready)return Pt.PENDING;let i=n.getGeometryInstanceAttributes(e.entity);return!l(i)||!l(i.boundingSphere)||l(i.show)&&i.show[0]===0?Pt.FAILED:(i.boundingSphere.clone(t),Pt.DONE)};jm.prototype.destroy=function(){let e=this.primitive,t=this.orderedGroundPrimitives;l(e)&&t.remove(e);let n=this.oldPrimitive;l(n)&&t.remove(n),this.removeMaterialSubscription()};function eI(e,t,n){this._items=[],this._orderedGroundPrimitives=e,this._classificationType=t,this._asynchronous=n??!0}eI.prototype.add=function(e,t){let n=this._items,i=n.length,r=t.createFillGeometryInstance(e),o=X.getValueOrDefault(t.zIndex,0);for(let a=0;a<i;++a){let c=n[a];if(c.isMaterial(t)&&c.zIndex===o){c.add(e,t,r);return}}let s=new jm(this._orderedGroundPrimitives,this._classificationType,t.fillMaterialProperty,o,this._asynchronous);s.add(e,t,r),n.push(s)};eI.prototype.remove=function(e){let t=this._items,n=t.length;for(let i=n-1;i>=0;i--){let r=t[i];if(r.remove(e)){r.updaters.length===0&&(t.splice(i,1),r.destroy());break}}};eI.prototype.update=function(e){let t,n=this._items,i=n.length;for(t=i-1;t>=0;t--){let o=n[t];if(o.invalidated){n.splice(t,1);let s=o.updaters.values,a=s.length;for(let c=0;c<a;c++)this.add(e,s[c]);o.destroy()}}let r=!0;for(t=0;t<n.length;t++)r=n[t].update(e)&&r;return r};eI.prototype.getBoundingSphere=function(e,t){let n=this._items,i=n.length;for(let r=0;r<i;r++){let o=n[r];if(o.contains(e))return o.getBoundingSphere(e,t)}return Pt.FAILED};eI.prototype.removeAllPrimitives=function(){let e=this._items,t=e.length;for(let n=0;n<t;n++)e[n].destroy();this._items.length=0};var P3=eI;var fbt=[];function bwe(e,t){let n=e._batches,i=n.length;for(let r=0;r<i;r++)n[r].remove(t)}function xwe(e,t,n){if(n.isDynamic){e._dynamicBatch.add(t,n);return}if(n.clampToGround&&n.fillEnabled){let s=n.classificationTypeProperty.getValue(t);e._groundBatches[s].add(t,n);return}let i;n.fillEnabled&&(i=n.shadowsProperty.getValue(t));let r=0;l(n.depthFailMaterialProperty)&&(r=n.depthFailMaterialProperty instanceof Kt?1:2);let o;l(i)&&(o=i+r*Pn.NUMBER_OF_SHADOW_MODES),n.fillEnabled&&(n.fillMaterialProperty instanceof Kt?e._colorBatches[o].add(t,n):e._materialBatches[o].add(t,n))}function g0(e,t,n,i){i=i??e.groundPrimitives,n=n??e.primitives,this._scene=e,this._primitives=n,this._entityCollection=void 0,this._addedObjects=new Ut,this._removedObjects=new Ut,this._changedObjects=new Ut;let r,o=Pn.NUMBER_OF_SHADOW_MODES;for(this._colorBatches=new Array(o*3),this._materialBatches=new Array(o*3),r=0;r<o;++r)this._colorBatches[r]=new qd(n,Vs,void 0,!1,r),this._materialBatches[r]=new Yd(n,ac,void 0,!1,r),this._colorBatches[r+o]=new qd(n,Vs,Vs,!1,r),this._materialBatches[r+o]=new Yd(n,ac,Vs,!1,r),this._colorBatches[r+o*2]=new qd(n,Vs,ac,!1,r),this._materialBatches[r+o*2]=new Yd(n,ac,ac,!1,r);this._dynamicBatch=new Kx(n,i);let s=Qn.NUMBER_OF_CLASSIFICATION_TYPES;for(this._groundBatches=new Array(s),r=0;r<s;++r)this._groundBatches[r]=new P3(i,r);this._batches=this._colorBatches.concat(this._materialBatches,this._dynamicBatch,this._groundBatches),this._subscriptions=new Ut,this._updaters=new Ut,this._entityCollection=t,t.collectionChanged.addEventListener(g0.prototype._onCollectionChanged,this),this._onCollectionChanged(t,t.values,fbt)}g0.prototype.update=function(e){let t=this._addedObjects,n=t.values,i=this._removedObjects,r=i.values,o=this._changedObjects,s=o.values,a,c,u,f;for(a=s.length-1;a>-1;a--)c=s[a],u=c.id,f=this._updaters.get(u),f.entity===c?(bwe(this,f),xwe(this,e,f)):(r.push(c),n.push(c));for(a=r.length-1;a>-1;a--)c=r[a],u=c.id,f=this._updaters.get(u),bwe(this,f),f.destroy(),this._updaters.remove(u),this._subscriptions.get(u)(),this._subscriptions.remove(u);for(a=n.length-1;a>-1;a--)c=n[a],u=c.id,f=new I3(c,this._scene),this._updaters.set(u,f),xwe(this,e,f),this._subscriptions.set(u,f.geometryChanged.addEventListener(g0._onGeometryChanged,this));t.removeAll(),i.removeAll(),o.removeAll();let d=!0,p=this._batches,g=p.length;for(a=0;a<g;a++)d=p[a].update(e)&&d;return d};var dbt=[],hbt=new ue;g0.prototype.getBoundingSphere=function(e,t){let n=dbt,i=hbt,r=0,o,s=this._batches,a=s.length,c=this._updaters.get(e.id);for(let u=0;u<a;u++){if(o=s[u].getBoundingSphere(c,i),o===Pt.PENDING)return Pt.PENDING;o===Pt.DONE&&(n[r]=ue.clone(i,n[r]),r++)}return r===0?Pt.FAILED:(n.length=r,ue.fromBoundingSpheres(n,t),Pt.DONE)};g0.prototype.isDestroyed=function(){return!1};g0.prototype.destroy=function(){this._entityCollection.collectionChanged.removeEventListener(g0.prototype._onCollectionChanged,this),this._addedObjects.removeAll(),this._removedObjects.removeAll();let e,t=this._batches,n=t.length;for(e=0;e<n;e++)t[e].removeAllPrimitives();let i=this._subscriptions.values;for(n=i.length,e=0;e<n;e++)i[e]();return this._subscriptions.removeAll(),le(this)};g0._onGeometryChanged=function(e){let t=this._removedObjects,n=this._changedObjects,i=e.entity,r=i.id;!l(t.get(r))&&!l(n.get(r))&&n.set(r,i)};g0.prototype._onCollectionChanged=function(e,t,n){let i=this._addedObjects,r=this._removedObjects,o=this._changedObjects,s,a,c;for(s=n.length-1;s>-1;s--)c=n[s],a=c.id,i.remove(a)||(r.set(a,c),o.remove(a));for(s=t.length-1;s>-1;s--)c=t[s],a=c.id,r.remove(a)?o.set(a,c):i.set(a,c)};var D3=g0;function nf(e){Xl.initializeTerrainHeights(),Kh.initializeTerrainHeights();let t=e.scene,n=e.dataSourceCollection;this._eventHelper=new jo,this._eventHelper.add(n.dataSourceAdded,this._onDataSourceAdded,this),this._eventHelper.add(n.dataSourceRemoved,this._onDataSourceRemoved,this),this._eventHelper.add(n.dataSourceMoved,this._onDataSourceMoved,this),this._eventHelper.add(t.postRender,this._postRender,this),this._dataSourceCollection=n,this._scene=t,this._visualizersCallback=e.visualizersCallback??nf.defaultVisualizersCallback;let i=!1,r=new Qc,o=new Qc;n.length>0&&(t.primitives.add(r),t.groundPrimitives.add(o),i=!0),this._primitives=r,this._groundPrimitives=o;for(let u=0,f=n.length;u<f;u++)this._onDataSourceAdded(n,n.get(u));let s=new HN;this._onDataSourceAdded(void 0,s),this._defaultDataSource=s;let a,c;if(!i){let u=this,f=function(){t.primitives.add(r),t.groundPrimitives.add(o),a(),c(),u._removeDefaultDataSourceListener=void 0,u._removeDataSourceCollectionListener=void 0};a=s.entities.collectionChanged.addEventListener(f),c=n.dataSourceAdded.addEventListener(f)}this._removeDefaultDataSourceListener=a,this._removeDataSourceCollectionListener=c,this._ready=!1}var tI=[];nf.registerVisualizer=function(e){tI.includes(e)||tI.push(e)};nf.unregisterVisualizer=function(e){if(tI.includes(e)){let t=tI.indexOf(e);tI.splice(t,1)}};nf.defaultVisualizersCallback=function(e,t,n){let i=n.entities;return[new hN(t,i),new HL(e,i,n._primitives,n._groundPrimitives),new GL(t,i),new hk(e,i),new g3(e,i),new v3(t,i),new E3(e,i),new D3(e,i,n._primitives,n._groundPrimitives),...tI.map(r=>new r(e,i))]};Object.defineProperties(nf.prototype,{scene:{get:function(){return this._scene}},dataSources:{get:function(){return this._dataSourceCollection}},defaultDataSource:{get:function(){return this._defaultDataSource}},ready:{get:function(){return this._ready}}});nf.prototype.isDestroyed=function(){return!1};nf.prototype.destroy=function(){this._eventHelper.removeAll();let e=this._dataSourceCollection;for(let t=0,n=e.length;t<n;++t)this._onDataSourceRemoved(this._dataSourceCollection,e.get(t));return this._onDataSourceRemoved(void 0,this._defaultDataSource),l(this._removeDefaultDataSourceListener)?(this._removeDefaultDataSourceListener(),this._removeDataSourceCollectionListener()):(this._scene.primitives.remove(this._primitives),this._scene.groundPrimitives.remove(this._groundPrimitives)),le(this)};nf.prototype.update=function(e){if(!Mi.initialized)return this._ready=!1,!1;let t=!0,n,i,r,o,s=this._dataSourceCollection,a=s.length;for(n=0;n<a;n++){let c=s.get(n);for(l(c.update)&&(t=c.update(e)&&t),r=c._visualizers,o=r.length,i=0;i<o;i++)t=r[i].update(e)&&t}for(r=this._defaultDataSource._visualizers,o=r.length,i=0;i<o;i++)t=r[i].update(e)&&t;return!this._ready&&t&&this._scene.requestRender(),this._ready=this._ready||t,t};nf.prototype._postRender=function(){let e=this._scene.frameState,t=this._dataSourceCollection,n=t.length;for(let i=0;i<n;i++){let r=t.get(i),o=r.credit;l(o)&&e.creditDisplay.addCreditToNextFrame(o);let s=r._resourceCredits;if(l(s)){let a=s.length;for(let c=0;c<a;c++)e.creditDisplay.addCreditToNextFrame(s[c])}}};var mbt=[],pbt=new ue;nf.prototype.getBoundingSphere=function(e,t,n){if(!this._ready)return Pt.PENDING;let i,r,o=this._defaultDataSource;if(!o.entities.contains(e)){o=void 0;let p=this._dataSourceCollection;for(r=p.length,i=0;i<r;i++){let g=p.get(i);if(g.entities.contains(e)){o=g;break}}}if(!l(o))return Pt.FAILED;let s=mbt,a=pbt,c=0,u,f=o._visualizers,d=f.length;for(i=0;i<d;i++){let p=f[i];if(l(p.getBoundingSphere)){if(u=f[i].getBoundingSphere(e,a),!t&&u===Pt.PENDING)return Pt.PENDING;u===Pt.DONE&&(s[c]=ue.clone(a,s[c]),c++)}}return c===0?Pt.FAILED:(s.length=c,ue.fromBoundingSpheres(s,n),Pt.DONE)};nf.prototype._onDataSourceAdded=function(e,t){let n=this._scene,i=this._primitives,r=this._groundPrimitives,o=i.add(new Qc),s=r.add(new dN);t._primitives=o,t._groundPrimitives=s;let a=t.clustering;a._initialize(n),o.add(a),t._visualizers=this._visualizersCallback(n,a,t)};nf.prototype._onDataSourceRemoved=function(e,t){let n=this._primitives,i=this._groundPrimitives,r=t._primitives,o=t._groundPrimitives,s=t.clustering;r.remove(s);let a=t._visualizers,c=a.length;for(let u=0;u<c;u++)a[u].destroy();n.remove(r),i.remove(o),t._visualizers=void 0};nf.prototype._onDataSourceMoved=function(e,t,n){let i=this._primitives,r=this._groundPrimitives,o=e._primitives,s=e._groundPrimitives;t===n+1?(i.raise(o),r.raise(s)):t===n-1?(i.lower(o),r.lower(s)):t===0?(i.lowerToBottom(o),r.lowerToBottom(s),i.raise(o),r.raise(s)):(i.raiseToTop(o),r.raiseToTop(s))};var R3=nf;function nI(e,t){this._position=void 0,this._subscription=void 0,this._definitionChanged=new be,this._normalize=t??!0,this.position=e}Object.defineProperties(nI.prototype,{isConstant:{get:function(){return X.isConstant(this._position)}},definitionChanged:{get:function(){return this._definitionChanged}},position:{get:function(){return this._position},set:function(e){let t=this._position;t!==e&&(l(t)&&this._subscription(),this._position=e,l(e)&&(this._subscription=e._definitionChanged.addEventListener(function(){this._definitionChanged.raiseEvent(this)},this)),this._definitionChanged.raiseEvent(this))}},normalize:{get:function(){return this._normalize},set:function(e){this._normalize!==e&&(this._normalize=e,this._definitionChanged.raiseEvent(this))}}});var gbt=new h,Twe=new h,Ewe=new K,_bt=new K,fte=1/60;nI.prototype.getValue=function(e,t){return this._getValue(e,t)};nI.prototype._getValue=function(e,t,n){l(e)||(e=K.now(_bt)),l(t)||(t=new h);let i=this._position;if(X.isConstant(i))return this._normalize?void 0:h.clone(h.ZERO,t);let r=i.getValue(e,gbt),o=i.getValue(K.addSeconds(e,fte,Ewe),Twe);if(!l(r)||!l(o)&&(o=r,r=i.getValue(K.addSeconds(e,-fte,Ewe),Twe),!l(r)))return;if(h.equals(r,o))return this._normalize?void 0:h.clone(h.ZERO,t);l(n)&&r.clone(n);let s=h.subtract(o,r,t);return this._normalize?h.normalize(s,t):h.divideByScalar(s,fte,t)};nI.prototype.equals=function(e){return this===e||e instanceof nI&&X.equals(this._position,e._position)};var L_=nI;var Cwe=new $,vwe=new $,Swe=new $,ybt=new N,KG=new h,wwe=new h,dte=new h,hte=new h,Iwe=new h,Pwe=new h,Abt=new Le,bbt=new h,xbt=new $,iI=new K,Tbt=1.25;function Ebt(e,t,n,i,r,o,s,a,c,u){let f=e.scene.mode,d=r.getValue(c,e._lastCartesian);if(l(d)){let p=!1,g=!1,m,y,A;if(f===re.SCENE3D){K.addSeconds(c,.001,iI);let I=r.getValue(iI,KG);if(l(I)||(K.addSeconds(c,-.001,iI),I=r.getValue(iI,KG),g=!0),l(I)){let R=At.computeFixedToIcrfMatrix(c,Cwe),O=At.computeFixedToIcrfMatrix(iI,vwe),L;!l(R)||!l(O)?(L=At.computeTemeToPseudoFixedMatrix(c,Swe),R=$.transpose(L,Cwe),O=At.computeTemeToPseudoFixedMatrix(iI,vwe),$.transpose(O,O)):L=$.transpose(R,Swe);let _=$.multiplyByVector(R,d,Iwe),C=$.multiplyByVector(O,I,Pwe);h.subtract(_,C,hte);let w=h.magnitude(hte)*1e3,P=D.GRAVITATIONALPARAMETER,M=-P/(w*w-2*P/h.magnitude(_));M<0||M>Tbt*u.maximumRadius?(m=wwe,h.normalize(d,m),h.negate(m,m),A=h.clone(h.UNIT_Z,dte),y=h.cross(A,m,KG),h.magnitude(y)>D.EPSILON7&&(h.normalize(m,m),h.normalize(y,y),A=h.cross(m,y,dte),h.normalize(A,A),p=!0)):h.equalsEpsilon(d,I,D.EPSILON7)||(A=wwe,h.normalize(_,A),h.normalize(C,C),y=h.cross(A,C,dte),g&&(y=h.multiplyByScalar(y,-1,y)),h.equalsEpsilon(y,h.ZERO,D.EPSILON7)||(m=h.cross(y,A,KG),$.multiplyByVector(L,m,m),$.multiplyByVector(L,y,y),$.multiplyByVector(L,A,A),h.normalize(m,m),h.normalize(y,y),h.normalize(A,A),p=!0))}}l(e.boundingSphere)&&(d=e.boundingSphere.center);let b,x,T;i&&(b=h.clone(t.position,hte),x=h.clone(t.direction,Iwe),T=h.clone(t.up,Pwe));let E=ybt,v;l(s)&&(v=s.getValue(c,Abt));let S=o.getValue(c,bbt);if(a===wg.INERTIAL&&l(v))N.fromTranslationQuaternionRotationScale(d,v,h.ONE,E);else if(a===wg.VELOCITY&&l(S)){let I=At.rotationMatrixFromPositionVelocity(d,S,u,xbt);N.fromRotationTranslation(I,d,E)}else a===wg.ENU||!p?At.eastNorthUpToFixedFrame(d,u,E):(E[0]=m.x,E[1]=m.y,E[2]=m.z,E[3]=0,E[4]=y.x,E[5]=y.y,E[6]=y.z,E[7]=0,E[8]=A.x,E[9]=A.y,E[10]=A.z,E[11]=0,E[12]=d.x,E[13]=d.y,E[14]=d.z,E[15]=0);t._setTransform(E),i&&(h.clone(b,t.position),h.clone(x,t.direction),h.clone(T,t.up),h.cross(x,T,t.right))}if(n){let p=f===re.SCENE2D||h.equals(e._offset3D,h.ZERO)?void 0:e._offset3D;t.lookAtTransform(t.transform,p)}}function O3(e,t,n){this.entity=e,this.scene=t,this.ellipsoid=n??ee.default,this.boundingSphere=void 0,this._lastEntity=void 0,this._mode=void 0,this._lastCartesian=new h,this._defaultOffset3D=void 0,this._velocityProperty=new L_(e.position,!0),this._offset3D=new h}Object.defineProperties(O3,{defaultOffset3D:{get:function(){return this._defaultOffset3D},set:function(e){this._defaultOffset3D=h.clone(e,new h)}}});O3.defaultOffset3D=new h(-14e3,3500,3500);var $G=new Od,Cbt=new h;O3.prototype.update=function(e,t){let n=this.scene,i=this.ellipsoid,r=n.mode;if(r===re.MORPHING)return;let o=this.entity,s=o.trackingReferenceFrame,a=o.position;if(!l(a))return;let c=this._velocityProperty,u=o.orientation,f=o!==this._lastEntity,d=r!==this._mode,p=n.camera,g=f||d,m=!0;if(f){let y=o.viewFrom,A=l(y);if(!A&&l(t)){$G.pitch=-D.PI_OVER_FOUR,$G.range=0;let b=a.getValue(e,Cbt);if(l(b)){let x=2-1/Math.max(1,h.magnitude(b)/i.maximumRadius);$G.pitch*=x}p.viewBoundingSphere(t,$G),this.boundingSphere=t,g=!1,m=!1}else(!A||!l(y.getValue(e,this._offset3D)))&&h.clone(O3._defaultOffset3D,this._offset3D)}else!d&&this._mode!==re.SCENE2D&&h.clone(p.position,this._offset3D);this._lastEntity=o,this._mode=r,Ebt(this,p,g,m,a,c,u,s,e,i)};var M3=O3;function vbt(e){return typeof e=="string"&&(e=document.getElementById(e)),e}var Ln=vbt;async function Sbt(e,t,n,i){return l(i)||(i=!1),Pbt(e,t,n,i)}function wbt(e,t,n){let i=e[0],r=i.terrainProvider.requestTileGeometry(i.x,i.y,i.level);if(!r)return!1;let o;return n?o=r.then(Rwe(i)):o=r.then(Rwe(i)).catch(Dbt(i)),e.shift(),t.push(o),!0}function Ibt(e){return new Promise(function(t){setTimeout(t,e)})}function mte(e,t,n){return e.length?wbt(e,t,n)?mte(e,t,n):Ibt(100).then(()=>mte(e,t,n)):Promise.resolve()}function Pbt(e,t,n,i){let r=e.tilingScheme,o,s=[],a={};for(o=0;o<n.length;++o){let u=r.positionToTileXY(n[o],t);if(!l(u))continue;let f=u.toString();if(!a.hasOwnProperty(f)){let d={x:u.x,y:u.y,level:t,tilingScheme:r,terrainProvider:e,positions:[]};a[f]=d,s.push(d)}a[f].positions.push(n[o])}let c=[];return mte(s,c,i).then(function(){return Promise.all(c).then(function(){return n})})}function Dwe(e,t,n){let i=t.interpolateHeight(n,e.longitude,e.latitude);return i===void 0?!1:(e.height=i,!0)}function Rwe(e){let t=e.positions,n=e.tilingScheme.tileXYToRectangle(e.x,e.y,e.level);return function(i){let r=!1;for(let o=0;o<t.length;++o){let s=t[o];if(!Dwe(s,i,n)){r=!0;break}}return r?i.createMesh({tilingScheme:e.tilingScheme,x:e.x,y:e.y,level:e.level,throttle:!1}).then(function(){for(let o=0;o<t.length;++o){let s=t[o];Dwe(s,i,n)}}):Promise.resolve()}}function Dbt(e){let t=e.positions;return function(){for(let n=0;n<t.length;++n){let i=t[n];i.height=void 0}}}var N3=Sbt;var pte=new U;async function Owe(e,t,n){l(n)||(n=!1);let i=[],r=[],o=e.availability,s=[];for(let c=0;c<t.length;++c){let u=t[c],f=o.computeMaximumLevelAtPosition(u);if(r[c]=f,f===0){e.tilingScheme.positionToTileXY(u,1,pte);let p=e.loadTileDataAvailability(pte.x,pte.y,1);l(p)&&s.push(p)}let d=i[f];l(d)||(i[f]=d=[]),d.push(u)}await Promise.all(s),await Promise.all(i.map(function(c,u){if(l(c))return N3(e,u,c,n)}));let a=[];for(let c=0;c<t.length;++c){let u=t[c];o.computeMaximumLevelAtPosition(u)!==r[c]&&a.push(u)}return a.length>0&&await Owe(e,a,n),t}var xE=Owe;async function gte(e,t){let n=t.terrainProvider,i=t.mapProjection,r=i.ellipsoid,o,s=t.camera.getRectangleCameraCoordinates(e);if(t.mode===re.SCENE3D?o=r.cartesianToCartographic(s):o=i.unproject(s),!l(n))return o;let a=n.availability;if(!l(a)||t.mode===re.SCENE2D)return o;let c=[ie.center(e),ie.southeast(e),ie.southwest(e),ie.northeast(e),ie.northwest(e)],u=await gte._sampleTerrainMostDetailed(n,c),f=!1,d=u.reduce(function(g,m){return l(m.height)?(f=!0,Math.max(m.height,g)):g},-Number.MAX_VALUE),p=o;return f&&(p.height+=d),p}gte._sampleTerrainMostDetailed=xE;var TE=gte;var Mwe={NONE:0,LERC:1};Object.freeze(Mwe);var ph=Mwe;var Nwe={NONE:0,BITS12:1};Object.freeze(Nwe);var Ka=Nwe;var L3=new h,Rbt=new h,gh=new U,Obt=new N,Mbt=new N,Nbt=Math.pow(2,12);function Uc(e,t,n,i,r,o,s,a,c,u){let f=Ka.NONE,d,p;if(l(t)&&l(n)&&l(i)&&l(r)){let g=t.minimum,m=t.maximum,y=h.subtract(m,g,Rbt),A=i-n;Math.max(h.maximumComponent(y),A)<Nbt-1?f=Ka.BITS12:f=Ka.NONE;let x=N.fromScale(y,Obt);x=N.setTranslation(x,g,x);let T=N.fromScale(h.fromElements(1/y.x,1/y.y,1/y.z,L3),Mbt);T=N.multiplyByTranslation(T,h.negate(g,L3),T),p=N.clone(r,new N);let E=N.getTranslation(r,L3);E=h.subtract(E,e,L3),p=N.setTranslation(p,E,p),p=N.multiply(p,x,p),d=N.inverseTransformation(r,new N),d=N.multiply(T,d,d),r=N.multiply(r,x,new N)}this.quantization=f,this.minimumHeight=n,this.maximumHeight=i,this.center=h.clone(e),this.toScaledENU=d,this.fromScaledENU=r,this.matrix=p,this.hasVertexNormals=o??!1,this.hasWebMercatorT=s??!1,this.hasGeodeticSurfaceNormals=a??!1,this.exaggeration=c??1,this.exaggerationRelativeHeight=u??0,this.stride=0,this._offsetGeodeticSurfaceNormal=0,this._offsetVertexNormal=0,this._calculateStrideAndOffsets()}Uc.prototype.encode=function(e,t,n,i,r,o,s,a){let c=i.x,u=i.y;if(this.quantization===Ka.BITS12){n=N.multiplyByPoint(this.toScaledENU,n,L3),n.x=D.clamp(n.x,0,1),n.y=D.clamp(n.y,0,1),n.z=D.clamp(n.z,0,1);let f=this.maximumHeight-this.minimumHeight,d=D.clamp((r-this.minimumHeight)/f,0,1);U.fromElements(n.x,n.y,gh);let p=cn.compressTextureCoordinates(gh);U.fromElements(n.z,d,gh);let g=cn.compressTextureCoordinates(gh);U.fromElements(c,u,gh);let m=cn.compressTextureCoordinates(gh);if(e[t++]=p,e[t++]=g,e[t++]=m,this.hasWebMercatorT){U.fromElements(s,0,gh);let y=cn.compressTextureCoordinates(gh);e[t++]=y}}else e[t++]=n.x-this.center.x,e[t++]=n.y-this.center.y,e[t++]=n.z-this.center.z,e[t++]=r,e[t++]=c,e[t++]=u,this.hasWebMercatorT&&(e[t++]=s);return this.hasVertexNormals&&(e[t++]=cn.octPackFloat(o)),this.hasGeodeticSurfaceNormals&&(e[t++]=a.x,e[t++]=a.y,e[t++]=a.z),t};var Lbt=new h,Lwe=new h;Uc.prototype.addGeodeticSurfaceNormals=function(e,t,n){if(this.hasGeodeticSurfaceNormals)return;let i=this.stride,r=e.length/i;this.hasGeodeticSurfaceNormals=!0,this._calculateStrideAndOffsets();let o=this.stride;for(let s=0;s<r;s++){for(let f=0;f<i;f++){let d=s*i+f,p=s*o+f;t[p]=e[d]}let a=this.decodePosition(t,s,Lbt),c=n.geodeticSurfaceNormal(a,Lwe),u=s*o+this._offsetGeodeticSurfaceNormal;t[u]=c.x,t[u+1]=c.y,t[u+2]=c.z}};Uc.prototype.removeGeodeticSurfaceNormals=function(e,t){if(!this.hasGeodeticSurfaceNormals)return;let n=this.stride,i=e.length/n;this.hasGeodeticSurfaceNormals=!1,this._calculateStrideAndOffsets();let r=this.stride;for(let o=0;o<i;o++)for(let s=0;s<r;s++){let a=o*n+s,c=o*r+s;t[c]=e[a]}};Uc.prototype.decodePosition=function(e,t,n){if(l(n)||(n=new h),t*=this.stride,this.quantization===Ka.BITS12){let i=cn.decompressTextureCoordinates(e[t],gh);n.x=i.x,n.y=i.y;let r=cn.decompressTextureCoordinates(e[t+1],gh);return n.z=r.x,N.multiplyByPoint(this.fromScaledENU,n,n)}return n.x=e[t],n.y=e[t+1],n.z=e[t+2],h.add(n,this.center,n)};Uc.prototype.getExaggeratedPosition=function(e,t,n){n=this.decodePosition(e,t,n);let i=this.exaggeration,r=this.exaggerationRelativeHeight;if(i!==1&&this.hasGeodeticSurfaceNormals){let s=this.decodeGeodeticSurfaceNormal(e,t,Lwe),a=this.decodeHeight(e,t),c=Ar.getHeight(a,i,r)-a;n.x+=s.x*c,n.y+=s.y*c,n.z+=s.z*c}return n};Uc.prototype.decodeTextureCoordinates=function(e,t,n){return l(n)||(n=new U),t*=this.stride,this.quantization===Ka.BITS12?cn.decompressTextureCoordinates(e[t+2],n):U.fromElements(e[t+4],e[t+5],n)};Uc.prototype.decodeHeight=function(e,t){return t*=this.stride,this.quantization===Ka.BITS12?cn.decompressTextureCoordinates(e[t+1],gh).y*(this.maximumHeight-this.minimumHeight)+this.minimumHeight:e[t+3]};Uc.prototype.decodeWebMercatorT=function(e,t){return t*=this.stride,this.quantization===Ka.BITS12?cn.decompressTextureCoordinates(e[t+3],gh).x:e[t+6]};Uc.prototype.getOctEncodedNormal=function(e,t,n){t=t*this.stride+this._offsetVertexNormal;let i=e[t]/256,r=Math.floor(i),o=(i-r)*256;return U.fromElements(r,o,n)};Uc.prototype.decodeNormal=function(e,t,n){let i=t*this.stride+this._offsetVertexNormal;return cn.octDecodeFloat(e[i],n)};Uc.prototype.decodeGeodeticSurfaceNormal=function(e,t,n){return t=t*this.stride+this._offsetGeodeticSurfaceNormal,n.x=e[t],n.y=e[t+1],n.z=e[t+2],n};Uc.prototype._calculateStrideAndOffsets=function(){let e=0;this.quantization===Ka.BITS12?e+=3:e+=6,this.hasWebMercatorT&&(e+=1),this.hasVertexNormals&&(this._offsetVertexNormal=e,e+=1),this.hasGeodeticSurfaceNormals&&(this._offsetGeodeticSurfaceNormal=e,e+=3),this.stride=e};var JG={position3DAndHeight:0,textureCoordAndEncodedNormals:1,geodeticSurfaceNormal:2},ZG={compressed0:0,compressed1:1,geodeticSurfaceNormal:2};Uc.prototype.getAttributes=function(e){let t=Y.FLOAT,n=Y.getSizeInBytes(t),i=this.stride*n,r=0,o=[];function s(a,c){o.push({index:a,vertexBuffer:e,componentDatatype:t,componentsPerAttribute:c,offsetInBytes:r,strideInBytes:i}),r+=c*n}if(this.quantization===Ka.NONE){s(JG.position3DAndHeight,4);let a=2;a+=this.hasWebMercatorT?1:0,a+=this.hasVertexNormals?1:0,s(JG.textureCoordAndEncodedNormals,a),this.hasGeodeticSurfaceNormals&&s(JG.geodeticSurfaceNormal,3)}else{let a=this.hasWebMercatorT||this.hasVertexNormals,c=this.hasWebMercatorT&&this.hasVertexNormals;s(ZG.compressed0,a?4:3),c&&s(ZG.compressed1,1),this.hasGeodeticSurfaceNormals&&s(ZG.geodeticSurfaceNormal,3)}return o};Uc.prototype.getAttributeLocations=function(){return this.quantization===Ka.NONE?JG:ZG};Uc.clone=function(e,t){if(l(e))return l(t)||(t=new Uc),t.quantization=e.quantization,t.minimumHeight=e.minimumHeight,t.maximumHeight=e.maximumHeight,t.center=h.clone(e.center),t.toScaledENU=N.clone(e.toScaledENU),t.fromScaledENU=N.clone(e.fromScaledENU),t.matrix=N.clone(e.matrix),t.hasVertexNormals=e.hasVertexNormals,t.hasWebMercatorT=e.hasWebMercatorT,t.hasGeodeticSurfaceNormals=e.hasGeodeticSurfaceNormals,t.exaggeration=e.exaggeration,t.exaggerationRelativeHeight=e.exaggerationRelativeHeight,t._calculateStrideAndOffsets(),t};var Eo=Uc;var _0={};_0.DEFAULT_STRUCTURE=Object.freeze({heightScale:1,heightOffset:0,elementsPerHeight:1,stride:1,elementMultiplier:256,isBigEndian:!1});var _te=new h,Fbt=new N,Bbt=new h,kbt=new h;_0.computeVertices=function(e){let t=Math.cos,n=Math.sin,i=Math.sqrt,r=Math.atan,o=Math.exp,s=D.PI_OVER_TWO,a=D.toRadians,c=e.heightmap,u=e.width,f=e.height,d=e.skirtHeight,p=d>0,g=e.isGeographic??!0,m=e.ellipsoid??ee.default,y=1/m.maximumRadius,A=ie.clone(e.nativeRectangle),b=ie.clone(e.rectangle),x,T,E,v;l(b)?(x=b.west,T=b.south,E=b.east,v=b.north):g?(x=a(A.west),T=a(A.south),E=a(A.east),v=a(A.north)):(x=A.west*y,T=s-2*r(o(-A.south*y)),E=A.east*y,v=s-2*r(o(-A.north*y)));let S=e.relativeToCenter,I=l(S);S=I?S:h.ZERO;let R=e.includeWebMercatorT??!1,O=e.exaggeration??1,L=e.exaggerationRelativeHeight??0,C=O!==1,w=e.structure??_0.DEFAULT_STRUCTURE,P=w.heightScale??_0.DEFAULT_STRUCTURE.heightScale,M=w.heightOffset??_0.DEFAULT_STRUCTURE.heightOffset,F=w.elementsPerHeight??_0.DEFAULT_STRUCTURE.elementsPerHeight,V=w.stride??_0.DEFAULT_STRUCTURE.stride,B=w.elementMultiplier??_0.DEFAULT_STRUCTURE.elementMultiplier,j=w.isBigEndian??_0.DEFAULT_STRUCTURE.isBigEndian,k=ie.computeWidth(A),G=ie.computeHeight(A),q=k/(u-1),Q=G/(f-1);g||(k*=y,G*=y);let W=m.radiiSquared,J=W.x,Z=W.y,ae=W.z,Ae=65536,fe=-65536,xe=At.eastNorthUpToFixedFrame(S,m),ge=N.inverseTransformation(xe,Fbt),we,Se;R&&(we=yi.geodeticLatitudeToMercatorAngle(T),Se=1/(yi.geodeticLatitudeToMercatorAngle(v)-we));let Re=Bbt;Re.x=Number.POSITIVE_INFINITY,Re.y=Number.POSITIVE_INFINITY,Re.z=Number.POSITIVE_INFINITY;let Qe=kbt;Qe.x=Number.NEGATIVE_INFINITY,Qe.y=Number.NEGATIVE_INFINITY,Qe.z=Number.NEGATIVE_INFINITY;let He=Number.POSITIVE_INFINITY,Xe=u*f,$e=d>0?u*2+f*2:0,Pe=Xe+$e,qe=new Array(Pe),st=new Array(Pe),vt=new Array(Pe),Gt=R?new Array(Pe):[],lt=C?new Array(Pe):[],mt=0,ft=f,Xt=0,rt=u;p&&(--mt,++ft,--Xt,++rt);let ht=1e-5;for(let jn=mt;jn<ft;++jn){let nn=jn;nn<0&&(nn=0),nn>=f&&(nn=f-1);let Wn=A.north-Q*nn;g?Wn=a(Wn):Wn=s-2*r(o(-Wn*y));let Zi=(Wn-T)/(v-T);Zi=D.clamp(Zi,0,1);let Mr=jn===mt,fo=jn===ft-1;d>0&&(Mr?Wn+=ht*G:fo&&(Wn-=ht*G));let Bs=t(Wn),Ks=n(Wn),no=ae*Ks,gi;R&&(gi=(yi.geodeticLatitudeToMercatorAngle(Wn)-we)*Se);for(let ho=Xt;ho<rt;++ho){let ur=ho;ur<0&&(ur=0),ur>=u&&(ur=u-1);let Zo=nn*(u*V)+ur*V,Bn;if(F===1)Bn=c[Zo];else{Bn=0;let Kr;if(j)for(Kr=0;Kr<F;++Kr)Bn=Bn*B+c[Zo+Kr];else for(Kr=F-1;Kr>=0;--Kr)Bn=Bn*B+c[Zo+Kr]}Bn=Bn*P+M,fe=Math.max(fe,Bn),Ae=Math.min(Ae,Bn);let qi=A.west+q*ur;g?qi=a(qi):qi=qi*y;let ki=(qi-x)/(E-x);ki=D.clamp(ki,0,1);let Nr=nn*u+ur;if(d>0){let Kr=ho===Xt,Ol=ho===rt-1,Z0=Mr||fo||Kr||Ol;if((Mr||fo)&&(Kr||Ol))continue;Z0&&(Bn-=d,Kr?(Nr=Xe+(f-nn-1),qi-=ht*k):fo?Nr=Xe+f+(u-ur-1):Ol?(Nr=Xe+f+u+nn,qi+=ht*k):Mr&&(Nr=Xe+f+u+f+ur))}let Wc=Bs*t(qi),bd=Bs*n(qi),xp=J*Wc,Nh=Z*bd,Tp=1/i(xp*Wc+Nh*bd+no*Ks),ks=xp*Tp,tc=Nh*Tp,Kb=no*Tp,ri=new h;ri.x=ks+Wc*Bn,ri.y=tc+bd*Bn,ri.z=Kb+Ks*Bn,N.multiplyByPoint(ge,ri,_te),h.minimumByComponent(_te,Re,Re),h.maximumByComponent(_te,Qe,Qe),He=Math.min(He,Bn),qe[Nr]=ri,vt[Nr]=new U(ki,Zi),st[Nr]=Bn,R&&(Gt[Nr]=gi),C&&(lt[Nr]=m.geodeticSurfaceNormal(ri))}}let Bi=ue.fromPoints(qe),Xn;l(b)&&(Xn=en.fromRectangle(b,Ae,fe,m));let bi;I&&(bi=new Zh(m).computeHorizonCullingPointPossiblyUnderEllipsoid(S,qe,Ae));let Wi=new wf(Re,Qe,S),wi=new Eo(S,Wi,He,fe,xe,!1,R,C,O,L),hi=new Float32Array(Pe*wi.stride),xi=0;for(let jn=0;jn<Pe;++jn)xi=wi.encode(hi,xi,qe[jn],vt[jn],st[jn],void 0,Gt[jn],lt[jn]);return{vertices:hi,maximumHeight:fe,minimumHeight:Ae,encoding:wi,boundingSphere3D:Bi,orientedBoundingBox:Xn,occludeePointInScaledSpace:bi}};var rI=_0;function nb(){pe.throwInstantiationError()}Object.defineProperties(nb.prototype,{credits:{get:pe.throwInstantiationError},waterMask:{get:pe.throwInstantiationError}});nb.prototype.interpolateHeight=pe.throwInstantiationError;nb.prototype.isChildAvailable=pe.throwInstantiationError;nb.prototype.createMesh=pe.throwInstantiationError;nb.prototype.upsample=pe.throwInstantiationError;nb.prototype.wasCreatedByUpsampling=pe.throwInstantiationError;nb.maximumAsynchronousTasks=5;var rf=nb;var Ubt=3,Ate=class{constructor(t,n,i){this._vertices=t,this._indices=n,this._encoding=i,this._inverseTransform=new N,this._needsRebuild=!0,this._rootNode=new bte}get needsRebuild(){return this._needsRebuild}set needsRebuild(t){this._needsRebuild=t}rayIntersect(t,n,i,r,o){this._needsRebuild&&jbt(this,n);let s=this._inverseTransform,a=Vbt;a.origin=N.multiplyByPoint(s,t.origin,a.origin),a.direction=N.multiplyByPointAsVector(s,t.direction,a.direction);let c=[];return Bwe(this._rootNode,a,c),Ybt(this,c,t,i,r,o)}},zbt=new $n("incrementallyBuildTerrainPicker"),bte=class e{constructor(){this.x=0,this.y=0,this.level=0,this.aabb=Fwe(this.x,this.y,this.level),this.intersectingTriangles=new Uint32Array(0),this.children=[],this.buildingChildren=!1}addChild(t){let n=new e;n.x=this.x*2+(t&1),n.y=this.y*2+(t>>1&1),n.level=this.level+1,n.aabb=Fwe(n.x,n.y,n.level),this.children[t]=n}},Vbt=new pn,QG=[new h,new h,new h];function jbt(e,t){N.inverse(t,e._inverseTransform),e._needsRebuild=!1;let n=e._indices.length/3,i=new Uint32Array(n);for(let r=0;r<n;++r)i[r]=r;e._rootNode.intersectingTriangles=i,e._rootNode.children.length=0}var Hbt=new h,Gbt=new h;function Fwe(e,t,n){let i=1/Math.pow(2,n),r=h.fromElements(e*i-.5,t*i-.5,-.5,Hbt),o=h.fromElements((e+1)*i-.5,(t+1)*i-.5,.5,Gbt);return wf.fromCorners(r,o)}function Wbt(e,t,n,i,r){h.pack(n[0],e,9*r),h.pack(n[1],e,9*r+3),h.pack(n[2],e,9*r+6),t[r]=i}var qbt=new Us;function Bwe(e,t,n){let i=_i.rayAxisAlignedBoundingBox(t,e.aabb,qbt);if(!l(i))return;if(!e.children.length||e.buildingChildren){n.push({node:e,interval:new Us(i.start,i.stop)});return}for(let o=0;o<e.children.length;o++)Bwe(e.children[o],t,n)}function Ybt(e,t,n,i,r,o){let s=t.sort(function(c,u){return c.interval.start-u.interval.start}),a=Number.MAX_VALUE;for(let c=0;c<s.length;c++){let u=s[c],f=Xbt(e,n,u.node,i,r,o);if(a=Math.min(f,a),a!==Number.MAX_VALUE)break}if(a!==Number.MAX_VALUE)return pn.getPoint(n,a)}function Xbt(e,t,n,i,r,o){let s=Number.MAX_VALUE,a=e._encoding,c=e._indices,u=e._vertices,f=n.intersectingTriangles.length,p=!(n.level>=Ubt)&&!n.buildingChildren,g,m;p&&(g=new Float64Array(f*9),m=new Uint32Array(f));for(let y=0;y<f;y++){let A=n.intersectingTriangles[y],b=yte(a,r,o,t,u,c[3*A],QG[0]),x=yte(a,r,o,t,u,c[3*A+1],QG[1]),T=yte(a,r,o,t,u,c[3*A+2],QG[2]),E=_i.rayTriangleParametric(t,b,x,T,i);l(E)&&E<s&&E>=0&&(s=E),p&&Wbt(g,m,QG,A,y)}if(p){for(let y=0;y<4;y++)n.addChild(y);$bt(e._inverseTransform,n,m,g)}return s}var Kbt=new he;function yte(e,t,n,i,r,o,s){let a=e.getExaggeratedPosition(r,o,s);if(t===re.SCENE3D)return a;let u=n.ellipsoid.cartesianToCartographic(a,Kbt);a=n.project(u,s),a=h.fromElements(a.z,a.x,a.y,s);let f=D.TWO_PI*n.ellipsoid.maximumRadius,d=Math.round((i.origin.y-a.y)/f);return a.y+=d*f,a}async function $bt(e,t,n,i){t.buildingChildren=!0;let r=new Float64Array(16);N.pack(e,r,0);let o=new Float64Array(24);for(let f=0;f<4;f++)h.pack(t.children[f].aabb.minimum,o,f*6),h.pack(t.children[f].aabb.maximum,o,f*6+3);let s={aabbs:o,inverseTransform:r,triangleIndices:n,trianglePositions:i},a=[o.buffer,r.buffer,n.buffer,i.buffer],c=zbt.scheduleTask(s,a);if(!l(c)){t.buildingChildren=!1;return}(await c).intersectingTrianglesArrays.forEach((f,d)=>{l(t.children[d])&&(t.children[d].intersectingTriangles=new Uint32Array(f))}),t.intersectingTriangles=new Uint32Array(0),t.buildingChildren=!1}var F3=Ate;function B3(e,t,n,i,r,o,s,a,c,u,f,d,p,g,m,y,A){this.center=e,this.vertices=t,this.stride=f??6,this.indices=n,this.indexCountWithoutSkirts=i,this.vertexCountWithoutSkirts=r,this.minimumHeight=o,this.maximumHeight=s,this.rectangle=a,this.boundingSphere3D=c,this.occludeePointInScaledSpace=u,this.orientedBoundingBox=d,this.encoding=p,this.westIndicesSouthToNorth=g,this.southIndicesEastToWest=m,this.eastIndicesNorthToSouth=y,this.northIndicesWestToEast=A,this._transform=new N,this._lastPickSceneMode=void 0,this._terrainPicker=new F3(t,n,p)}B3.prototype.getTransform=function(e,t){return this._lastPickSceneMode===e?this._transform:(this._terrainPicker.needsRebuild=!0,!l(e)||e===re.SCENE3D?Jbt(this,this._transform):rxt(this,t,this._transform))};function Jbt(e,t){let n=e.encoding.exaggeration,i=e.encoding.exaggerationRelativeHeight,r=Ar.getHeight(e.minimumHeight,n,i),o=Ar.getHeight(e.maximumHeight,n,i),s=en.fromRectangle(e.rectangle,r,o,ee.default,e.orientedBoundingBox);return en.computeTransformation(s,t),N.getScale(t,xte).z<=D.EPSILON16&&(xte.z=1,N.setScale(t,xte,t)),t}var Zbt=new h,Qbt=new h,ext=new he,txt=new he,nxt=new h,ixt=new h,xte=new h;function rxt(e,t,n){let i=e.encoding.exaggeration,r=e.encoding.exaggerationRelativeHeight,o=Ar.getHeight(e.minimumHeight,i,r),s=Ar.getHeight(e.maximumHeight,i,r),a=t.project(he.fromRadians(e.rectangle.west,e.rectangle.south,0,ext),Zbt),c=t.project(he.fromRadians(e.rectangle.east,e.rectangle.north,0,txt),Qbt),u=s-o,f=h.fromElements(c.x-a.x,c.y-a.y,u>0?u:1,nxt),d=h.fromElements(a.x+f.x*.5,a.y+f.y*.5,o+f.z*.5,ixt);return N.fromTranslation(d,n),N.setScale(n,f,n),N.multiply(At.SWIZZLE_3D_TO_2D_MATRIX,n,n),n}B3.prototype.pick=function(e,t,n,i){let r=this._terrainPicker.rayIntersect(e,this.getTransform(n,i),t,n,i);return this._lastPickSceneMode=n,r};B3.prototype.updateExaggeration=function(e,t){this._terrainPicker._vertices=this.vertices,this._terrainPicker.needsRebuild=!0,this._lastPickSceneMode=void 0};B3.prototype.updateSceneMode=function(e){this._terrainPicker.needsRebuild=!0,this._lastPickSceneMode=void 0};var Ac=B3;function F_(e){e=e??H.EMPTY_OBJECT,this._buffer=e.buffer,this._width=e.width,this._height=e.height,this._childTileMask=e.childTileMask??15,this._encoding=e.encoding??ph.NONE;let t=rI.DEFAULT_STRUCTURE,n=e.structure;l(n)?n!==t&&(n.heightScale=n.heightScale??t.heightScale,n.heightOffset=n.heightOffset??t.heightOffset,n.elementsPerHeight=n.elementsPerHeight??t.elementsPerHeight,n.stride=n.stride??t.stride,n.elementMultiplier=n.elementMultiplier??t.elementMultiplier,n.isBigEndian=n.isBigEndian??t.isBigEndian):n=t,this._structure=n,this._createdByUpsampling=e.createdByUpsampling??!1,this._waterMask=e.waterMask,this._skirtHeight=void 0,this._bufferType=this._encoding===ph.LERC?Float32Array:this._buffer.constructor,this._mesh=void 0}Object.defineProperties(F_.prototype,{credits:{get:function(){}},waterMask:{get:function(){return this._waterMask}},childTileMask:{get:function(){return this._childTileMask}}});var kwe="createVerticesFromHeightmap",oxt=new $n(kwe),sxt=new $n(kwe,rf.maximumAsynchronousTasks);F_.prototype.createMesh=function(e){e=e??H.EMPTY_OBJECT;let t=e.tilingScheme,n=e.x,i=e.y,r=e.level,o=e.exaggeration??1,s=e.exaggerationRelativeHeight??0,a=e.throttle??!0,c=t.ellipsoid,u=t.tileXYToNativeRectangle(n,i,r),f=t.tileXYToRectangle(n,i,r),d=c.cartographicToCartesian(ie.center(f)),p=this._structure,m=Xr.getEstimatedLevelZeroGeometricErrorForAHeightmap(c,this._width,t.getNumberOfXTilesAtLevel(0))/(1<<r);this._skirtHeight=Math.min(m*4,1e3);let A=(a?sxt:oxt).scheduleTask({heightmap:this._buffer,structure:p,includeWebMercatorT:!0,width:this._width,height:this._height,nativeRectangle:u,rectangle:f,relativeToCenter:d,ellipsoid:c,skirtHeight:this._skirtHeight,isGeographic:t.projection instanceof Ui,exaggeration:o,exaggerationRelativeHeight:s,encoding:this._encoding});if(!l(A))return;let b=this;return Promise.resolve(A).then(function(x){let T;b._skirtHeight>0?T=Xr.getRegularGridAndSkirtIndicesAndEdgeIndices(x.gridWidth,x.gridHeight):T=Xr.getRegularGridIndicesAndEdgeIndices(x.gridWidth,x.gridHeight);let E=x.gridWidth*x.gridHeight;return b._mesh=new Ac(d,new Float32Array(x.vertices),T.indices,T.indexCountWithoutSkirts,E,x.minimumHeight,x.maximumHeight,f,ue.clone(x.boundingSphere3D),h.clone(x.occludeePointInScaledSpace),x.numberOfAttributes,en.clone(x.orientedBoundingBox),Eo.clone(x.encoding),T.westIndicesSouthToNorth,T.southIndicesEastToWest,T.eastIndicesNorthToSouth,T.northIndicesWestToEast),b._buffer=void 0,b._mesh})};F_.prototype._createMeshSync=function(e){let t=e.tilingScheme,n=e.x,i=e.y,r=e.level,o=e.exaggeration??1,s=e.exaggerationRelativeHeight??0,a=t.ellipsoid,c=t.tileXYToNativeRectangle(n,i,r),u=t.tileXYToRectangle(n,i,r),f=a.cartographicToCartesian(ie.center(u)),d=this._structure,g=Xr.getEstimatedLevelZeroGeometricErrorForAHeightmap(a,this._width,t.getNumberOfXTilesAtLevel(0))/(1<<r);this._skirtHeight=Math.min(g*4,1e3);let m=rI.computeVertices({heightmap:this._buffer,structure:d,includeWebMercatorT:!0,width:this._width,height:this._height,nativeRectangle:c,rectangle:u,relativeToCenter:f,ellipsoid:a,skirtHeight:this._skirtHeight,isGeographic:t.projection instanceof Ui,exaggeration:o,exaggerationRelativeHeight:s});this._buffer=void 0;let y;this._skirtHeight>0?y=Xr.getRegularGridAndSkirtIndicesAndEdgeIndices(this._width,this._height):y=Xr.getRegularGridIndicesAndEdgeIndices(this._width,this._height);let A=m.gridWidth*m.gridHeight;return this._mesh=new Ac(f,m.vertices,y.indices,y.indexCountWithoutSkirts,A,m.minimumHeight,m.maximumHeight,u,m.boundingSphere3D,m.occludeePointInScaledSpace,m.encoding.stride,m.orientedBoundingBox,m.encoding,y.westIndicesSouthToNorth,y.southIndicesEastToWest,y.eastIndicesNorthToSouth,y.northIndicesWestToEast),this._mesh};F_.prototype.interpolateHeight=function(e,t,n){let i=this._width,r=this._height,o=this._structure,s=o.stride,a=o.elementsPerHeight,c=o.elementMultiplier,u=o.isBigEndian,f=o.heightOffset,d=o.heightScale,p=l(this._mesh),g=this._encoding===ph.LERC;if(!p&&g)return;let y;if(p){let A=this._mesh.vertices,b=this._mesh.encoding;y=Uwe(A,b,f,d,e,i,r,t,n)}else y=axt(this._buffer,a,c,s,u,e,i,r,t,n),y=y*d+f;return y};F_.prototype.upsample=function(e,t,n,i,r,o,s){let a=this._mesh;if(!l(a))return;let c=this._width,u=this._height,f=this._structure,d=f.stride,p=new this._bufferType(c*u*d),g=a.vertices,m=a.encoding,y=e.tileXYToRectangle(t,n,i),A=e.tileXYToRectangle(r,o,s),b=f.heightOffset,x=f.heightScale,T=f.elementsPerHeight,E=f.elementMultiplier,v=f.isBigEndian,S=Math.pow(E,T-1);for(let I=0;I<u;++I){let R=D.lerp(A.north,A.south,I/(u-1));for(let O=0;O<c;++O){let L=D.lerp(A.west,A.east,O/(c-1)),_=Uwe(g,m,b,x,y,c,u,L,R);_=_<f.lowestEncodedHeight?f.lowestEncodedHeight:_,_=_>f.highestEncodedHeight?f.highestEncodedHeight:_,cxt(p,T,E,S,d,v,I*c+O,_)}}return Promise.resolve(new F_({buffer:p,width:c,height:u,childTileMask:0,structure:this._structure,createdByUpsampling:!0}))};F_.prototype.isChildAvailable=function(e,t,n,i){let r=2;return n!==e*2&&++r,i!==t*2&&(r-=2),(this._childTileMask&1<<r)!==0};F_.prototype.wasCreatedByUpsampling=function(){return this._createdByUpsampling};function axt(e,t,n,i,r,o,s,a,c,u){let f=(c-o.west)*(s-1)/(o.east-o.west),d=(u-o.south)*(a-1)/(o.north-o.south),p=f|0,g=p+1;g>=s&&(g=s-1,p=s-2);let m=d|0,y=m+1;y>=a&&(y=a-1,m=a-2);let A=f-p,b=d-m;m=a-1-m,y=a-1-y;let x=e5(e,t,n,i,r,m*s+p),T=e5(e,t,n,i,r,m*s+g),E=e5(e,t,n,i,r,y*s+p),v=e5(e,t,n,i,r,y*s+g);return zwe(A,b,x,T,E,v)}function Uwe(e,t,n,i,r,o,s,a,c){let u=(a-r.west)*(o-1)/(r.east-r.west),f=(c-r.south)*(s-1)/(r.north-r.south),d=u|0,p=d+1;p>=o&&(p=o-1,d=o-2);let g=f|0,m=g+1;m>=s&&(m=s-1,g=s-2);let y=u-d,A=f-g;g=s-1-g,m=s-1-m;let b=(t.decodeHeight(e,g*o+d)-n)/i,x=(t.decodeHeight(e,g*o+p)-n)/i,T=(t.decodeHeight(e,m*o+d)-n)/i,E=(t.decodeHeight(e,m*o+p)-n)/i;return zwe(y,A,b,x,T,E)}function zwe(e,t,n,i,r,o){return t<e?n+e*(i-n)+t*(o-i):n+e*(o-r)+t*(r-n)}function e5(e,t,n,i,r,o){o*=i;let s=0,a;if(r)for(a=0;a<t;++a)s=s*n+e[o+a];else for(a=t-1;a>=0;--a)s=s*n+e[o+a];return s}function cxt(e,t,n,i,r,o,s,a){s*=r;let c;if(o)for(c=0;c<t-1;++c)e[s+c]=a/i|0,a-=e[s+c]*i,i/=n;else for(c=t-1;c>0;--c)e[s+c]=a/i|0,a-=e[s+c]*i,i/=n;e[s+c]=a}var zc=F_;function oI(e){e=e??H.EMPTY_OBJECT,this._tilingScheme=e.tilingScheme,l(this._tilingScheme)||(this._tilingScheme=new Qi({ellipsoid:e.ellipsoid??ee.default})),this._levelZeroMaximumGeometricError=Xr.getEstimatedLevelZeroGeometricErrorForAHeightmap(this._tilingScheme.ellipsoid,64,this._tilingScheme.getNumberOfXTilesAtLevel(0)),this._errorEvent=new be}Object.defineProperties(oI.prototype,{errorEvent:{get:function(){return this._errorEvent}},credit:{get:function(){}},tilingScheme:{get:function(){return this._tilingScheme}},hasWaterMask:{get:function(){return!1}},hasVertexNormals:{get:function(){return!1}},availability:{get:function(){}}});oI.prototype.requestTileGeometry=function(e,t,n,i){return Promise.resolve(new zc({buffer:new Uint8Array(256),width:16,height:16}))};oI.prototype.getLevelMaximumGeometricError=function(e){return this._levelZeroMaximumGeometricError/(1<<e)};oI.prototype.getTileDataAvailable=function(e,t,n){};oI.prototype.loadTileDataAvailability=function(e,t,n){};var y0=oI;var lxt=new U;function uxt(e,t){let n=e.unionClippingRegions,i=e.length,r=Cs.useFloatTexture(t),o=Cs.getTextureResolution(e,t,lxt),s=o.x,a=o.y,c=r?hxt(s,a):mxt(s,a);return c+=` +`,c+=n?fxt(i):dxt(i),c}function fxt(e){return`float clip(vec4 fragCoord, sampler2D clippingPlanes, mat4 clippingPlanesMatrix) { vec4 position = czm_windowToEyeCoordinates(fragCoord); vec3 clipNormal = vec3(0.0); @@ -9996,7 +9996,7 @@ Url: ${e._contentHeader.uri}`,r++;let o={text:i.substring(1),position:n,font:`${ } return clipAmount; } -`}function pDt(e){return`float clip(vec4 fragCoord, sampler2D clippingPlanes, mat4 clippingPlanesMatrix) +`}function dxt(e){return`float clip(vec4 fragCoord, sampler2D clippingPlanes, mat4 clippingPlanesMatrix) { bool clipped = true; vec4 position = czm_windowToEyeCoordinates(fragCoord); @@ -10019,7 +10019,7 @@ Url: ${e._contentHeader.uri}`,r++;let o={text:i.substring(1),position:n,font:`${ } return clipAmount; } -`}function gDt(e,t){let n=1/e,i=1/t,r=`${n}`;r.indexOf(".")===-1&&(r+=".0");let o=`${i}`;return o.indexOf(".")===-1&&(o+=".0"),`vec4 getClippingPlane(highp sampler2D packedClippingPlanes, int clippingPlaneNumber, mat4 transform) +`}function hxt(e,t){let n=1/e,i=1/t,r=`${n}`;r.indexOf(".")===-1&&(r+=".0");let o=`${i}`;return o.indexOf(".")===-1&&(o+=".0"),`vec4 getClippingPlane(highp sampler2D packedClippingPlanes, int clippingPlaneNumber, mat4 transform) { int pixY = clippingPlaneNumber / ${e}; int pixX = clippingPlaneNumber - (pixY * ${e}); @@ -10029,7 +10029,7 @@ Url: ${e._contentHeader.uri}`,r++;let o={text:i.substring(1),position:n,font:`${ vec4 plane = texture(packedClippingPlanes, vec2(u, v)); return czm_transformPlane(plane, transform); } -`}function _Dt(e,t){let n=1/e,i=1/t,r=`${n}`;r.indexOf(".")===-1&&(r+=".0");let o=`${i}`;return o.indexOf(".")===-1&&(o+=".0"),`vec4 getClippingPlane(highp sampler2D packedClippingPlanes, int clippingPlaneNumber, mat4 transform) +`}function mxt(e,t){let n=1/e,i=1/t,r=`${n}`;r.indexOf(".")===-1&&(r+=".0");let o=`${i}`;return o.indexOf(".")===-1&&(o+=".0"),`vec4 getClippingPlane(highp sampler2D packedClippingPlanes, int clippingPlaneNumber, mat4 transform) { int clippingPlaneStartIndex = clippingPlaneNumber * 2; int pixY = clippingPlaneStartIndex / ${e}; @@ -10044,7 +10044,7 @@ Url: ${e._contentHeader.uri}`,r++;let o={text:i.substring(1),position:n,font:`${ plane.w = czm_unpackFloat(texture(packedClippingPlanes, vec2(u + ${r}, v))); return czm_transformPlane(plane, transform); } -`}var eC=hDt;var $re=class{constructor(t,n,i,r,o,s){this.numberOfDayTextures=t,this.flags=n,this.material=i,this.shaderProgram=r,this.clippingShaderState=o,this.clippingPolygonShaderState=s}},Jre=class{constructor(){this.baseVertexShaderSource=void 0,this.baseFragmentShaderSource=void 0,this._shadersByTexturesFlags=[],this.material=void 0}getShaderProgram(t){let n=t.frameState,i=t.surfaceTile,r=t.numberOfDayTextures,o=t.applyBrightness,s=t.applyContrast,a=t.applyHue,c=t.applySaturation,u=t.applyGamma,f=t.applyAlpha,d=t.applyDayNightAlpha,p=t.applySplit,g=t.hasWaterMask,m=t.showReflectiveOcean,y=t.showOceanWaves,A=t.enableLighting,b=t.dynamicAtmosphereLighting,x=t.dynamicAtmosphereLightingFromSun,T=t.showGroundAtmosphere,E=t.perFragmentGroundAtmosphere,v=t.hasVertexNormals,S=t.useWebMercatorProjection,I=t.enableFog,R=t.enableClippingPlanes,O=t.clippingPlanes,L=t.enableClippingPolygons,_=t.clippingPolygons,C=t.clippedByBoundaries,w=t.hasImageryLayerCutout,P=t.colorCorrect,M=t.highlightFillTile,F=t.colorToAlpha,V=t.hasGeodeticSurfaceNormals,B=t.hasExaggeration,j=t.showUndergroundColor,k=t.translucent,G=i.vectorData,q=G?.show,Q=q&&G.hasPolylines,W=q&&G.hasPolygons,J=q&&t.vectorAntialias,Z=Q&&G.hasMeterWidths,ae=Z&&G.hasPixelWidths,Ae=0,fe="",ge=i.renderedMesh.encoding;ge.quantization===$a.BITS12&&(Ae=1,fe="QUANTIZATION_BITS12");let Se=0,Re="";C&&(Se=1,Re="TILE_LIMIT_RECTANGLE");let Qe=0,He="";w&&(Qe=1,He="APPLY_IMAGERY_CUTOUT");let Xe=n.mode,$e=((Xe|+o<<2|+s<<3|+a<<4|+c<<5|+u<<6|+f<<7|+g<<8|+m<<9|+y<<10|+A<<11|+b<<12|+x<<13|+T<<14|+E<<15|+v<<16|+S<<17|+I<<18|Ae<<19|+p<<20|+R<<21|+L<<22|Se<<23|Qe<<24|+P<<25|+M<<26|+F<<27|+V<<28|+B<<29|+j<<30|+k<<31)>>>0)+(d?4294967296:0)+(q?8589934592:0)+(Q?17179869184:0)+(W?34359738368:0)+(J?68719476736:0)+(Z?137438953472:0)+(ae?274877906944:0),Pe=0;l(O)&&O.length>0&&(Pe=R?O.clippingPlanesState:0);let qe=0;l(_)&&_.length>0&&(qe=L?_.clippingPolygonsState:0);let st=i.surfaceShader;if(l(st)&&st.numberOfDayTextures===r&&st.flags===$e&&st.material===this.material&&st.clippingShaderState===Pe&&st.clippingPolygonShaderState===qe)return st.shaderProgram;let vt=this._shadersByTexturesFlags[r];if(l(vt)||(vt=this._shadersByTexturesFlags[r]=[]),st=vt[$e],!l(st)||st.material!==this.material||st.clippingShaderState!==Pe||st.clippingPolygonShaderState!==qe){let Gt=this.baseVertexShaderSource.clone(),lt=this.baseFragmentShaderSource.clone();Pe!==0&<.sources.unshift(eC(O,n.context)),Gt.defines.push(fe),lt.defines.push(`TEXTURE_UNITS ${r}`,Re,He),o&<.defines.push("APPLY_BRIGHTNESS"),s&<.defines.push("APPLY_CONTRAST"),a&<.defines.push("APPLY_HUE"),c&<.defines.push("APPLY_SATURATION"),u&<.defines.push("APPLY_GAMMA"),f&<.defines.push("APPLY_ALPHA"),d&<.defines.push("APPLY_DAY_NIGHT_ALPHA"),g&<.defines.push("HAS_WATER_MASK"),m&&(lt.defines.push("SHOW_REFLECTIVE_OCEAN"),Gt.defines.push("SHOW_REFLECTIVE_OCEAN")),y&<.defines.push("SHOW_OCEAN_WAVES"),F&<.defines.push("APPLY_COLOR_TO_ALPHA"),j&&(Gt.defines.push("UNDERGROUND_COLOR"),lt.defines.push("UNDERGROUND_COLOR")),k&&(Gt.defines.push("TRANSLUCENT"),lt.defines.push("TRANSLUCENT")),A&&(v?(Gt.defines.push("ENABLE_VERTEX_LIGHTING"),lt.defines.push("ENABLE_VERTEX_LIGHTING")):(Gt.defines.push("ENABLE_DAYNIGHT_SHADING"),lt.defines.push("ENABLE_DAYNIGHT_SHADING"))),b&&(Gt.defines.push("DYNAMIC_ATMOSPHERE_LIGHTING"),lt.defines.push("DYNAMIC_ATMOSPHERE_LIGHTING"),x&&(Gt.defines.push("DYNAMIC_ATMOSPHERE_LIGHTING_FROM_SUN"),lt.defines.push("DYNAMIC_ATMOSPHERE_LIGHTING_FROM_SUN"))),T&&(Gt.defines.push("GROUND_ATMOSPHERE"),lt.defines.push("GROUND_ATMOSPHERE"),E&&(Gt.defines.push("PER_FRAGMENT_GROUND_ATMOSPHERE"),lt.defines.push("PER_FRAGMENT_GROUND_ATMOSPHERE"))),Gt.defines.push("INCLUDE_WEB_MERCATOR_Y"),lt.defines.push("INCLUDE_WEB_MERCATOR_Y"),I&&(Gt.defines.push("FOG"),lt.defines.push("FOG")),p&<.defines.push("APPLY_SPLIT"),R&<.defines.push("ENABLE_CLIPPING_PLANES"),L&&(lt.defines.push("ENABLE_CLIPPING_POLYGONS"),_.inverse&<.defines.push("CLIPPING_INVERSE")),P&<.defines.push("COLOR_CORRECT"),M&<.defines.push("HIGHLIGHT_FILL_TILE"),V&&Gt.defines.push("GEODETIC_SURFACE_NORMALS"),B&&Gt.defines.push("EXAGGERATION"),q&&(lt.defines.push("HAS_VECTOR_LAYER"),Q&<.defines.push("HAS_VECTOR_POLYLINES"),W&<.defines.push("HAS_VECTOR_POLYGONS"),J&<.defines.push("VECTOR_ANTIALIAS"),Z&<.defines.push("VECTOR_WIDTH_IN_METERS"),ae&<.defines.push("VECTOR_WIDTH_MIXED_UNITS")),(q||L)&<.sources.unshift(pg);let mt=` vec4 computeDayColor(vec4 initialColor, vec3 textureCoordinates, float nightBlend) +`}var EE=uxt;var Tte=class{constructor(t,n,i,r,o,s){this.numberOfDayTextures=t,this.flags=n,this.material=i,this.shaderProgram=r,this.clippingShaderState=o,this.clippingPolygonShaderState=s}},Ete=class{constructor(){this.baseVertexShaderSource=void 0,this.baseFragmentShaderSource=void 0,this._shadersByTexturesFlags=[],this.material=void 0}getShaderProgram(t){let n=t.frameState,i=t.surfaceTile,r=t.numberOfDayTextures,o=t.applyBrightness,s=t.applyContrast,a=t.applyHue,c=t.applySaturation,u=t.applyGamma,f=t.applyAlpha,d=t.applyDayNightAlpha,p=t.applySplit,g=t.hasWaterMask,m=t.showReflectiveOcean,y=t.showOceanWaves,A=t.enableLighting,b=t.dynamicAtmosphereLighting,x=t.dynamicAtmosphereLightingFromSun,T=t.showGroundAtmosphere,E=t.perFragmentGroundAtmosphere,v=t.hasVertexNormals,S=t.useWebMercatorProjection,I=t.enableFog,R=t.enableClippingPlanes,O=t.clippingPlanes,L=t.enableClippingPolygons,_=t.clippingPolygons,C=t.clippedByBoundaries,w=t.hasImageryLayerCutout,P=t.colorCorrect,M=t.highlightFillTile,F=t.colorToAlpha,V=t.hasGeodeticSurfaceNormals,B=t.hasExaggeration,j=t.showUndergroundColor,k=t.translucent,G=i.vectorData,q=G?.show,Q=q&&G.hasPolylines,W=q&&G.hasPolygons,J=q&&t.vectorAntialias,Z=Q&&G.hasMeterWidths,ae=Z&&G.hasPixelWidths,Ae=0,fe="",ge=i.renderedMesh.encoding;ge.quantization===Ka.BITS12&&(Ae=1,fe="QUANTIZATION_BITS12");let Se=0,Re="";C&&(Se=1,Re="TILE_LIMIT_RECTANGLE");let Qe=0,He="";w&&(Qe=1,He="APPLY_IMAGERY_CUTOUT");let Xe=n.mode,$e=((Xe|+o<<2|+s<<3|+a<<4|+c<<5|+u<<6|+f<<7|+g<<8|+m<<9|+y<<10|+A<<11|+b<<12|+x<<13|+T<<14|+E<<15|+v<<16|+S<<17|+I<<18|Ae<<19|+p<<20|+R<<21|+L<<22|Se<<23|Qe<<24|+P<<25|+M<<26|+F<<27|+V<<28|+B<<29|+j<<30|+k<<31)>>>0)+(d?4294967296:0)+(q?8589934592:0)+(Q?17179869184:0)+(W?34359738368:0)+(J?68719476736:0)+(Z?137438953472:0)+(ae?274877906944:0),Pe=0;l(O)&&O.length>0&&(Pe=R?O.clippingPlanesState:0);let qe=0;l(_)&&_.length>0&&(qe=L?_.clippingPolygonsState:0);let st=i.surfaceShader;if(l(st)&&st.numberOfDayTextures===r&&st.flags===$e&&st.material===this.material&&st.clippingShaderState===Pe&&st.clippingPolygonShaderState===qe)return st.shaderProgram;let vt=this._shadersByTexturesFlags[r];if(l(vt)||(vt=this._shadersByTexturesFlags[r]=[]),st=vt[$e],!l(st)||st.material!==this.material||st.clippingShaderState!==Pe||st.clippingPolygonShaderState!==qe){let Gt=this.baseVertexShaderSource.clone(),lt=this.baseFragmentShaderSource.clone();Pe!==0&<.sources.unshift(EE(O,n.context)),Gt.defines.push(fe),lt.defines.push(`TEXTURE_UNITS ${r}`,Re,He),o&<.defines.push("APPLY_BRIGHTNESS"),s&<.defines.push("APPLY_CONTRAST"),a&<.defines.push("APPLY_HUE"),c&<.defines.push("APPLY_SATURATION"),u&<.defines.push("APPLY_GAMMA"),f&<.defines.push("APPLY_ALPHA"),d&<.defines.push("APPLY_DAY_NIGHT_ALPHA"),g&<.defines.push("HAS_WATER_MASK"),m&&(lt.defines.push("SHOW_REFLECTIVE_OCEAN"),Gt.defines.push("SHOW_REFLECTIVE_OCEAN")),y&<.defines.push("SHOW_OCEAN_WAVES"),F&<.defines.push("APPLY_COLOR_TO_ALPHA"),j&&(Gt.defines.push("UNDERGROUND_COLOR"),lt.defines.push("UNDERGROUND_COLOR")),k&&(Gt.defines.push("TRANSLUCENT"),lt.defines.push("TRANSLUCENT")),A&&(v?(Gt.defines.push("ENABLE_VERTEX_LIGHTING"),lt.defines.push("ENABLE_VERTEX_LIGHTING")):(Gt.defines.push("ENABLE_DAYNIGHT_SHADING"),lt.defines.push("ENABLE_DAYNIGHT_SHADING"))),b&&(Gt.defines.push("DYNAMIC_ATMOSPHERE_LIGHTING"),lt.defines.push("DYNAMIC_ATMOSPHERE_LIGHTING"),x&&(Gt.defines.push("DYNAMIC_ATMOSPHERE_LIGHTING_FROM_SUN"),lt.defines.push("DYNAMIC_ATMOSPHERE_LIGHTING_FROM_SUN"))),T&&(Gt.defines.push("GROUND_ATMOSPHERE"),lt.defines.push("GROUND_ATMOSPHERE"),E&&(Gt.defines.push("PER_FRAGMENT_GROUND_ATMOSPHERE"),lt.defines.push("PER_FRAGMENT_GROUND_ATMOSPHERE"))),Gt.defines.push("INCLUDE_WEB_MERCATOR_Y"),lt.defines.push("INCLUDE_WEB_MERCATOR_Y"),I&&(Gt.defines.push("FOG"),lt.defines.push("FOG")),p&<.defines.push("APPLY_SPLIT"),R&<.defines.push("ENABLE_CLIPPING_PLANES"),L&&(lt.defines.push("ENABLE_CLIPPING_POLYGONS"),_.inverse&<.defines.push("CLIPPING_INVERSE")),P&<.defines.push("COLOR_CORRECT"),M&<.defines.push("HIGHLIGHT_FILL_TILE"),V&&Gt.defines.push("GEODETIC_SURFACE_NORMALS"),B&&Gt.defines.push("EXAGGERATION"),q&&(lt.defines.push("HAS_VECTOR_LAYER"),Q&<.defines.push("HAS_VECTOR_POLYLINES"),W&<.defines.push("HAS_VECTOR_POLYGONS"),J&<.defines.push("VECTOR_ANTIALIAS"),Z&<.defines.push("VECTOR_WIDTH_IN_METERS"),ae&<.defines.push("VECTOR_WIDTH_MIXED_UNITS")),(q||L)&<.sources.unshift(pg);let mt=` vec4 computeDayColor(vec4 initialColor, vec3 textureCoordinates, float nightBlend) { vec4 color = initialColor; `;w&&(mt+=` vec4 cutoutAndColorResult; @@ -10071,7 +10071,7 @@ Url: ${e._contentHeader.uri}`,r++;let o={text:i.substring(1),position:n,font:`${ nightBlend); `,w&&(mt+=` color = czm_branchFreeTernary(texelUnclipped, cutoutAndColorResult, color); `);mt+=` return color; - }`,lt.sources.push(mt),Gt.sources.push(yDt(Xe)),Gt.sources.push(ADt(S));let ft=Qt.fromCache({context:n.context,vertexShaderSource:Gt,fragmentShaderSource:lt,attributeLocations:ge.getAttributeLocations()});st=vt[$e]=new $re(r,$e,this.material,ft,Pe,qe)}return i.surfaceShader=st,st.shaderProgram}destroy(){let t,n,i=this._shadersByTexturesFlags;for(let r in i)if(i.hasOwnProperty(r)){let o=i[r];if(!l(o))continue;for(t in o)o.hasOwnProperty(t)&&(n=o[t],l(n)&&n.shaderProgram.destroy())}return le(this)}};function yDt(e){let t="vec4 getPosition(vec3 position, float height, vec2 textureCoordinates) { return getPosition3DMode(position, height, textureCoordinates); }",n="vec4 getPosition(vec3 position, float height, vec2 textureCoordinates) { return getPositionColumbusViewMode(position, height, textureCoordinates); }",i="vec4 getPosition(vec3 position, float height, vec2 textureCoordinates) { return getPositionMorphingMode(position, height, textureCoordinates); }",r;switch(e){case re.SCENE3D:r=t;break;case re.SCENE2D:case re.COLUMBUS_VIEW:r=n;break;case re.MORPHING:r=i;break}return r}function ADt(e){return e?"float get2DYPositionFraction(vec2 textureCoordinates) { return get2DMercatorYPositionFraction(textureCoordinates); }":"float get2DYPositionFraction(vec2 textureCoordinates) { return get2DGeographicYPositionFraction(textureCoordinates); }"}var $U=Jre;var JOe={NONE:-1,PARTIAL:0,FULL:1};Object.freeze(JOe);var $o=JOe;var ZOe={START:0,LOADING:1,DONE:2,FAILED:3};Object.freeze(ZOe);var Ja=ZOe;var QOe={FAILED:0,UNLOADED:1,RECEIVING:2,RECEIVED:3,TRANSFORMING:4,TRANSFORMED:5,READY:6};Object.freeze(QOe);var kr=QOe;var M0=class e{constructor(){ut(this,"request");this.imagery=[],this.waterMaskTexture=void 0,this.waterMaskTranslationAndScale=new se(0,0,1,1),this.terrainData=void 0,this.vectorData=void 0,this.clippingPolygonData=void 0,this.vertexArray=void 0,this.tileBoundingRegion=void 0,this.occludeePointInScaledSpace=new h,this.boundingVolumeSourceTile=void 0,this.boundingVolumeIsFromMesh=!1,this.terrainState=kr.UNLOADED,this.mesh=void 0,this.fill=void 0,this.pickBoundingSphere=new ue,this.surfaceShader=void 0,this.isClipped=!0,this.clippedByBoundaries=!1}get eligibleForUnloading(){let t=this.terrainState,i=!(t===kr.RECEIVING||t===kr.TRANSFORMING),r=this.imagery;for(let o=0,s=r.length;i&&o<s;++o){let a=r[o];i=!l(a.loadingImagery)||a.loadingImagery.state!==Vn.TRANSITIONING}return i}get renderedMesh(){if(l(this.vertexArray))return this.mesh;if(l(this.fill))return this.fill.mesh}pick(t,n,i,r,o){if(!l(this.renderedMesh))return;let s=this.renderedMesh.pick(t,r,n,i);return h.clone(s,o)}freeResources(){l(this.waterMaskTexture)&&(--this.waterMaskTexture.referenceCount,this.waterMaskTexture.referenceCount===0&&this.waterMaskTexture.destroy(),this.waterMaskTexture=void 0),l(this.vectorData)&&(Es.freeResources(this.vectorData),this.vectorData=void 0),l(this.clippingPolygonData)&&(Nc.releaseRectangleData(this.clippingPolygonData),this.clippingPolygonData=void 0),this.terrainData=void 0,this.terrainState=kr.UNLOADED,this.mesh=void 0,this.fill=this.fill&&this.fill.destroy();let t=this.imagery;for(let n=0,i=t.length;n<i;++n)t[n].freeResources();this.imagery.length=0,this.freeVertexArray()}freeVertexArray(){e._freeVertexArray(this.vertexArray),this.vertexArray=void 0,e._freeVertexArray(this.wireframeVertexArray),this.wireframeVertexArray=void 0}static initialize(t,n,i,r){l(t.data)||(t.data=new e),t.state===Ja.START&&(bDt(t,n,i,r),t.state=Ja.LOADING)}static processStateMachine(t,n,i,r,o,s,a,c){e.initialize(t,i,r,o);let u=t.data;if(t.state===Ja.LOADING&&xDt(t,n,i,r,o,s,a),c)return;let f=t.renderable;t.renderable=l(u.vertexArray);let d=u.terrainState===kr.READY;t.upsampledFromParent=l(u.terrainData)&&u.terrainData.wasCreatedByUpsampling();let p=u.processImagery(t,i,n);if(d&&p){let g=t._loadedCallbacks,m={};for(let y in g)g.hasOwnProperty(y)&&(g[y](t)||(m[y]=g[y]));t._loadedCallbacks=m,t.state=Ja.DONE}f&&(t.renderable=!0)}processImagery(t,n,i,r){let o=t.data,s=t.upsampledFromParent,a=!1,c=!0,u=o.imagery,f,d;for(f=0,d=u.length;f<d;++f){let p=u[f];if(!l(p.loadingImagery)){s=!1;continue}if(p.loadingImagery.state===Vn.PLACEHOLDER){let m=p.loadingImagery.imageryLayer;if(m.ready){p.freeResources(),u.splice(f,1),m._createTileImagerySkeletons(t,n,f),--f,d=u.length;continue}else s=!1}let g=p.processStateMachine(t,i,r);c=c&&g,a=a||g||l(p.readyImagery),s=s&&l(p.loadingImagery)&&(p.loadingImagery.state===Vn.FAILED||p.loadingImagery.state===Vn.INVALID)}return t.upsampledFromParent=s,t.renderable=t.renderable&&(a||c),c}addGeodeticSurfaceNormals(t,n){eMe(this,!0,t,n)}removeGeodeticSurfaceNormals(t){eMe(this,!1,void 0,t)}updateExaggeration(t,n,i){let r=this,o=r.renderedMesh;if(o===void 0)return;let s=n.verticalExaggeration,a=n.verticalExaggerationRelativeHeight,c=s!==1,u=o.encoding,f=u.exaggeration!==s,d=u.exaggerationRelativeHeight!==a;if(f||d){if(f)if(c&&!u.hasGeodeticSurfaceNormals){let g=t.tilingScheme.ellipsoid;r.addGeodeticSurfaceNormals(g,n)}else!c&&u.hasGeodeticSurfaceNormals&&r.removeGeodeticSurfaceNormals(n);if(u.exaggeration=s,u.exaggerationRelativeHeight=a,i!==void 0){i._tileToUpdateHeights.push(t);let g=t.customData;for(let m of g)m.level=-1}o.updateExaggeration(s,a)}}updateSceneMode(t){let i=this.renderedMesh;i!==void 0&&i.updateSceneMode(t)}static _createVertexArrayForMesh(t,n){let i=n.vertices,r=tt.createVertexBuffer({context:t,typedArray:i,usage:Me.STATIC_DRAW}),o=n.encoding.getAttributes(r),s=n.indices.indexBuffers||{},a=s[t.id];if(!l(a)||a.isDestroyed()){let c=n.indices;a=tt.createIndexBuffer({context:t,typedArray:c,usage:Me.STATIC_DRAW,indexDatatype:je.fromSizeInBytes(c.BYTES_PER_ELEMENT)}),a.vertexArrayDestroyable=!1,a.referenceCount=1,s[t.id]=a,n.indices.indexBuffers=s}else++a.referenceCount;return new zn({context:t,attributes:o,indexBuffer:a})}static _freeVertexArray(t){if(l(t)){let n=t.indexBuffer;t.isDestroyed()||t.destroy(),l(n)&&!n.isDestroyed()&&l(n.referenceCount)&&(--n.referenceCount,n.referenceCount===0&&n.destroy())}}_findAncestorTileWithTerrainData(t){let n=t.parent;for(;l(n)&&(!l(n.data)||!l(n.data.terrainData)||n.data.terrainData.wasCreatedByUpsampling());)n=n.parent;return n}_computeWaterMaskTranslationAndScale(t,n,i){let r=n.rectangle,o=t.rectangle,s=o.width,a=o.height,c=s/r.width,u=a/r.height;return i.x=c*(o.west-r.west)/s,i.y=u*(o.south-r.south)/a,i.z=c,i.w=u,i}};function eMe(e,t,n,i){let r=e.renderedMesh,o=r.vertices,s=r.encoding,a=o.length/s.stride,c=Co.clone(s);c.hasGeodeticSurfaceNormals=t,c=Co.clone(c);let u=c.stride,f=new Float32Array(a*u);t?s.addGeodeticSurfaceNormals(o,f,n):s.removeGeodeticSurfaceNormals(o,f),r.vertices=f,r.stride=u,r!==e.mesh?(M0._freeVertexArray(e.fill.vertexArray),e.fill.vertexArray=M0._createVertexArrayForMesh(i.context,r)):(M0._freeVertexArray(e.vertexArray),e.vertexArray=M0._createVertexArrayForMesh(i.context,r)),M0._freeVertexArray(e.wireframeVertexArray),e.wireframeVertexArray=void 0}function bDt(e,t,n,i){let r=t.getTileDataAvailable(e.x,e.y,e.level);if(!l(r)&&l(e.parent)){let s=e.parent,a=s.data;l(a)&&l(a.terrainData)&&(r=a.terrainData.isChildAvailable(s.x,s.y,e.x,e.y))}let o=e.data;r===!1&&(o.terrainState=kr.FAILED);for(let s=0,a=i.length;s<a;++s){let c=i.get(s);c.show&&c._createTileImagerySkeletons(e,t)}}function xDt(e,t,n,i,r,o,s){let a=e.data,c=e.parent;if(a.terrainState===kr.FAILED&&c!==void 0){let u=c.data;u!==void 0&&u.terrainData!==void 0&&u.terrainData.canUpsample!==!1||M0.processStateMachine(c,t,n,i,r,o,s,!0)}if(a.terrainState===kr.FAILED&&TDt(a,e,t,n,e.x,e.y,e.level),a.terrainState===kr.UNLOADED&&EDt(a,n,e.x,e.y,e.level),a.terrainState===kr.RECEIVED&&vDt(a,t,n,e.x,e.y,e.level),a.terrainState===kr.TRANSFORMED&&(SDt(a,t.context,n,e.x,e.y,e.level,s),a.updateExaggeration(e,t,o)),a.terrainState>=kr.RECEIVED&&a.waterMaskTexture===void 0&&n.hasWaterMask)if(a.terrainData.waterMask!==void 0)IDt(t.context,a);else{let f=a._findAncestorTileWithTerrainData(e),d=f?.data;l(f)&&l(d.waterMaskTexture)&&(a.waterMaskTexture=d.waterMaskTexture,++a.waterMaskTexture.referenceCount,a._computeWaterMaskTranslationAndScale(e,f,a.waterMaskTranslationAndScale))}}function TDt(e,t,n,i,r,o,s){let a=t.parent;if(!a){t.state=Ja.FAILED;return}let u=a.data.terrainData,f=a.x,d=a.y,p=a.level;if(!l(u))return;let g=u.upsample(i.tilingScheme,f,d,p,r,o,s);l(g)&&(e.terrainState=kr.RECEIVING,Promise.resolve(g).then(function(m){l(m)&&(e.terrainData=m,e.terrainState=kr.RECEIVED)}).catch(function(){e.terrainState=kr.FAILED}))}function EDt(e,t,n,i,r){function o(c){if(!l(c)){e.terrainState=kr.UNLOADED,e.request=void 0;return}e.terrainData=c,e.terrainState=kr.RECEIVED,e.request=void 0}function s(c){if(e.request.state===Ti.CANCELLED){e.terrainData=void 0,e.terrainState=kr.UNLOADED,e.request=void 0;return}e.terrainState=kr.FAILED,e.request=void 0;let u=`Failed to obtain terrain tile X: ${n} Y: ${i} Level: ${r}. Error message: "${c}"`;t._requestError=Zr.reportError(t._requestError,t,t.errorEvent,u,n,i,r),t._requestError.retry&&a()}function a(){let c=new wo({throttle:!1,throttleByServer:!0,type:Zs.TERRAIN});e.request=c;let u=t.requestTileGeometry(n,i,r,c);l(u)?(e.terrainState=kr.RECEIVING,Promise.resolve(u).then(function(f){o(f)}).catch(function(f){s(f)})):(e.terrainState=kr.UNLOADED,e.request=void 0)}a()}var CDt={tilingScheme:void 0,x:0,y:0,level:0,exaggeration:1,exaggerationRelativeHeight:0,throttle:!0};function vDt(e,t,n,i,r,o){let s=n.tilingScheme,a=CDt;a.tilingScheme=s,a.x=i,a.y=r,a.level=o,a.exaggeration=t.verticalExaggeration,a.exaggerationRelativeHeight=t.verticalExaggerationRelativeHeight,a.throttle=!0;let u=e.terrainData.createMesh(a);l(u)&&(e.terrainState=kr.TRANSFORMING,Promise.resolve(u).then(function(f){e.mesh=f,e.terrainState=kr.TRANSFORMED}).catch(function(){e.terrainState=kr.FAILED}))}function SDt(e,t,n,i,r,o,s){e.vertexArray=M0._createVertexArrayForMesh(t,e.mesh),e.terrainState=kr.READY,e.fill=e.fill&&e.fill.destroy(s)}function wDt(e){let t=e.cache.tile_waterMaskData;if(!l(t)){let n=Dt.create({context:e,pixelFormat:Ke.LUMINANCE,pixelDatatype:ze.UNSIGNED_BYTE,source:{arrayBufferView:new Uint8Array([255]),width:1,height:1}});n.referenceCount=1;let i=new jt({wrapS:hn.CLAMP_TO_EDGE,wrapT:hn.CLAMP_TO_EDGE,minificationFilter:Wt.LINEAR,magnificationFilter:Jn.LINEAR});t={allWaterTexture:n,sampler:i,destroy:function(){this.allWaterTexture.destroy()}},e.cache.tile_waterMaskData=t}return t}function IDt(e,t){let n=t.terrainData.waterMask,i=wDt(e),r,o=n.length;if(n instanceof ImageBitmap)r=Dt.create({context:e,source:n,sampler:i.sampler,flipY:!1,skipColorSpaceConversion:!0});else if(o===1)if(n[0]!==0)r=i.allWaterTexture;else return;else{let s=Math.sqrt(o);r=Dt.create({context:e,pixelFormat:Ke.LUMINANCE,pixelDatatype:ze.UNSIGNED_BYTE,source:{width:s,height:s,arrayBufferView:n},sampler:i.sampler,flipY:!1}),r.referenceCount=0}++r.referenceCount,t.waterMaskTexture=r,se.fromElements(0,0,1,1,t.waterMaskTranslationAndScale)}var Eh=M0;var PDt={WEST:0,NORTH:1,EAST:2,SOUTH:3,NORTHWEST:4,NORTHEAST:5,SOUTHWEST:6,SOUTHEAST:7},wn=PDt;var tMe={NONE:0,CULLED:1,RENDERED:2,REFINED:3,RENDERED_AND_KICKED:6,REFINED_AND_KICKED:7,CULLED_BUT_NEEDED:9,wasKicked:function(e){return e>=tMe.RENDERED_AND_KICKED},originalResult:function(e){return e&3},kick:function(e){return e|4}},pi=tMe;function hP(e){this.tile=e,this.frameLastUpdated=void 0,this.westMeshes=[],this.westTiles=[],this.southMeshes=[],this.southTiles=[],this.eastMeshes=[],this.eastTiles=[],this.northMeshes=[],this.northTiles=[],this.southwestMesh=void 0,this.southwestTile=void 0,this.southeastMesh=void 0,this.southeastTile=void 0,this.northwestMesh=void 0,this.northwestTile=void 0,this.northeastMesh=void 0,this.northeastTile=void 0,this.changedThisFrame=!0,this.visitedFrame=void 0,this.enqueuedFrame=void 0,this.mesh=void 0,this.vertexArray=void 0,this.waterMaskTexture=void 0,this.waterMaskTranslationAndScale=new se}hP.prototype.update=function(e,t,n){this.changedThisFrame&&(cMe(e,t,this.tile,n),this.changedThisFrame=!1)};hP.prototype.destroy=function(e){this._destroyVertexArray(e),l(this.waterMaskTexture)&&(--this.waterMaskTexture.referenceCount,this.waterMaskTexture.referenceCount===0&&this.waterMaskTexture.destroy(),this.waterMaskTexture=void 0)};hP.prototype._destroyVertexArray=function(e){l(this.vertexArray)&&(l(e)?e.push(this.vertexArray):Eh._freeVertexArray(this.vertexArray),this.vertexArray=void 0)};var DDt=new gA;hP.updateFillTiles=function(e,t,n,i){let r=e._quadtree,o=r._levelZeroTiles,s=r._lastSelectionFrameNumber,a=DDt;a.clear();for(let u=0;u<t.length;++u){let f=t[u];l(f.data.vertexArray)&&a.enqueue(t[u])}let c=a.dequeue();for(;c!==void 0;){let u=c.findTileToWest(o),f=c.findTileToSouth(o),d=c.findTileToEast(o),p=c.findTileToNorth(o);Ra(e,n,c,u,s,wn.EAST,!1,a,i),Ra(e,n,c,f,s,wn.NORTH,!1,a,i),Ra(e,n,c,d,s,wn.WEST,!1,a,i),Ra(e,n,c,p,s,wn.SOUTH,!1,a,i);let g=u.findTileToNorth(o),m=u.findTileToSouth(o),y=d.findTileToNorth(o),A=d.findTileToSouth(o);Ra(e,n,c,g,s,wn.SOUTHEAST,!1,a,i),Ra(e,n,c,y,s,wn.SOUTHWEST,!1,a,i),Ra(e,n,c,m,s,wn.NORTHEAST,!1,a,i),Ra(e,n,c,A,s,wn.NORTHWEST,!1,a,i),c=a.dequeue()}};function Ra(e,t,n,i,r,o,s,a,c){if(i===void 0)return;let u=i;for(;u&&(u._lastSelectionResultFrame!==r||pi.wasKicked(u._lastSelectionResult)||pi.originalResult(u._lastSelectionResult)===pi.CULLED);){if(s)return;let f=u.parent;if(o>=wn.NORTHWEST&&f!==void 0)switch(o){case wn.NORTHWEST:u=u===f.northwestChild?f:void 0;break;case wn.NORTHEAST:u=u===f.northeastChild?f:void 0;break;case wn.SOUTHWEST:u=u===f.southwestChild?f:void 0;break;case wn.SOUTHEAST:u=u===f.southeastChild?f:void 0;break}else u=f}if(u!==void 0){if(u._lastSelectionResult===pi.RENDERED){if(l(u.data.vertexArray))return;RDt(e,t,n,u,o,r,a,c);return}if(pi.originalResult(i._lastSelectionResult)!==pi.CULLED)switch(o){case wn.WEST:Ra(e,t,n,i.northwestChild,r,o,!0,a,c),Ra(e,t,n,i.southwestChild,r,o,!0,a,c);break;case wn.EAST:Ra(e,t,n,i.southeastChild,r,o,!0,a,c),Ra(e,t,n,i.northeastChild,r,o,!0,a,c);break;case wn.SOUTH:Ra(e,t,n,i.southwestChild,r,o,!0,a,c),Ra(e,t,n,i.southeastChild,r,o,!0,a,c);break;case wn.NORTH:Ra(e,t,n,i.northeastChild,r,o,!0,a,c),Ra(e,t,n,i.northwestChild,r,o,!0,a,c);break;case wn.NORTHWEST:Ra(e,t,n,i.northwestChild,r,o,!0,a,c);break;case wn.NORTHEAST:Ra(e,t,n,i.northeastChild,r,o,!0,a,c);break;case wn.SOUTHWEST:Ra(e,t,n,i.southwestChild,r,o,!0,a,c);break;case wn.SOUTHEAST:Ra(e,t,n,i.southeastChild,r,o,!0,a,c);break;default:throw new pe("Invalid edge")}}}function RDt(e,t,n,i,r,o,s,a){let c=i.data;if(c.fill===void 0)c.fill=new hP(i);else if(c.fill.visitedFrame===o)return;c.fill.enqueuedFrame!==o&&(c.fill.enqueuedFrame=o,c.fill.changedThisFrame=!1,s.enqueue(i)),ODt(e,t,n,i,r,a)}function ODt(e,t,n,i,r,o){let s=i.data.fill,a,c=n.data.fill;l(c)?(c.visitedFrame=t.frameNumber,c.changedThisFrame&&(cMe(e,t,n,o),c.changedThisFrame=!1),a=n.data.fill.mesh):a=n.data.mesh;let u,f;switch(r){case wn.WEST:u=s.westMeshes,f=s.westTiles;break;case wn.SOUTH:u=s.southMeshes,f=s.southTiles;break;case wn.EAST:u=s.eastMeshes,f=s.eastTiles;break;case wn.NORTH:u=s.northMeshes,f=s.northTiles;break;case wn.NORTHWEST:s.changedThisFrame=s.changedThisFrame||s.northwestMesh!==a,s.northwestMesh=a,s.northwestTile=n;return;case wn.NORTHEAST:s.changedThisFrame=s.changedThisFrame||s.northeastMesh!==a,s.northeastMesh=a,s.northeastTile=n;return;case wn.SOUTHWEST:s.changedThisFrame=s.changedThisFrame||s.southwestMesh!==a,s.southwestMesh=a,s.southwestTile=n;return;case wn.SOUTHEAST:s.changedThisFrame=s.changedThisFrame||s.southeastMesh!==a,s.southeastMesh=a,s.southeastTile=n;return}if(n.level<=i.level){s.changedThisFrame=s.changedThisFrame||u[0]!==a||u.length!==1,u[0]=a,f[0]=n,u.length=1,f.length=1;return}let d,p,g,m,y=n.rectangle,A,b=i.rectangle;switch(r){case wn.WEST:for(A=(b.north-b.south)*D.EPSILON5,d=0;d<f.length&&(g=f[d],m=g.rectangle,!D.greaterThan(y.north,m.south,A));++d);for(p=d;p<f.length&&(g=f[p],m=g.rectangle,!D.greaterThanOrEquals(y.south,m.north,A));++p);break;case wn.SOUTH:for(A=(b.east-b.west)*D.EPSILON5,d=0;d<f.length&&(g=f[d],m=g.rectangle,!D.lessThan(y.west,m.east,A));++d);for(p=d;p<f.length&&(g=f[p],m=g.rectangle,!D.lessThanOrEquals(y.east,m.west,A));++p);break;case wn.EAST:for(A=(b.north-b.south)*D.EPSILON5,d=0;d<f.length&&(g=f[d],m=g.rectangle,!D.lessThan(y.south,m.north,A));++d);for(p=d;p<f.length&&(g=f[p],m=g.rectangle,!D.lessThanOrEquals(y.north,m.south,A));++p);break;case wn.NORTH:for(A=(b.east-b.west)*D.EPSILON5,d=0;d<f.length&&(g=f[d],m=g.rectangle,!D.greaterThan(y.east,m.west,A));++d);for(p=d;p<f.length&&(g=f[p],m=g.rectangle,!D.greaterThanOrEquals(y.west,m.east,A));++p);break}p-d===1?(s.changedThisFrame=s.changedThisFrame||u[d]!==a,u[d]=a,f[d]=n):(s.changedThisFrame=!0,u.splice(d,p-d,a),f.splice(d,p-d,n))}var tC=new he,MDt=new he,dP=new h,toe=new h,Zre=new U,Qre=new U,ud=new U;function y7(){this.height=0,this.encodedNormal=new U}function d7(e,t,n,i,r,o,s,a,c){if(l(r))return r;let u;if(l(o)&&l(s))u=(o.height+s.height)*.5;else if(l(o))u=o.height;else if(l(s))u=s.height;else if(l(a))u=a.height;else{let d=e.tile.data.tileBoundingRegion,p=0,g=0;l(d)&&(p=d.minimumHeight,g=d.maximumHeight),u=(p+g)*.5}return lMe(e,t,n,i,u,c),c}var NDt={minimumHeight:0,maximumHeight:0},LDt=new h,nMe=new y7,iMe=new y7,rMe=new y7,oMe=new y7,FDt=typeof Uint8Array<"u"?new Uint8Array(81):void 0,BDt={tilingScheme:void 0,x:0,y:0,level:0,exaggeration:1,exaggerationRelativeHeight:0};function cMe(e,t,n,i){Eh.initialize(n,e.terrainProvider,e.vectorProvider,e._imageryLayers);let r=n.data,o=r.fill,s=n.rectangle,a=t.verticalExaggeration,c=t.verticalExaggerationRelativeHeight,u=a!==1,f=n.tilingScheme.ellipsoid,d=m7(o,f,0,1,o.northwestTile,o.northwestMesh,o.northTiles,o.northMeshes,o.westTiles,o.westMeshes,rMe),p=m7(o,f,0,0,o.southwestTile,o.southwestMesh,o.westTiles,o.westMeshes,o.southTiles,o.southMeshes,nMe),g=m7(o,f,1,0,o.southeastTile,o.southeastMesh,o.southTiles,o.southMeshes,o.eastTiles,o.eastMeshes,iMe),m=m7(o,f,1,1,o.northeastTile,o.northeastMesh,o.eastTiles,o.eastMeshes,o.northTiles,o.northMeshes,oMe);d=d7(o,f,0,1,d,p,m,g,rMe),p=d7(o,f,0,0,p,d,g,m,nMe),g=d7(o,f,1,1,g,p,m,d,iMe),m=d7(o,f,1,1,m,g,d,p,oMe);let y=p.height,A=g.height,b=d.height,x=m.height,T=Math.min(y,A,b,x),E=Math.max(y,A,b,x),v=(T+E)*.5,S,I,R=e.getLevelMaximumGeometricError(n.level),O=f.maximumRadius-R,L=Math.acos(O/f.maximumRadius)*4;if(L*=1.5,s.width>L&&E-T<=R){let w=new jc({width:9,height:9,buffer:FDt,structure:{heightOffset:E}}),P=BDt;P.tilingScheme=n.tilingScheme,P.x=n.x,P.y=n.y,P.level=n.level,P.exaggeration=a,P.exaggerationRelativeHeight=c,o.mesh=w._createMeshSync(P)}else{let w=u,P=ie.center(s,MDt);P.height=v;let M=f.cartographicToCartesian(P,LDt),F=new Co(M,void 0,void 0,void 0,void 0,!0,!0,w,a,c),V=5,B;for(B=o.westMeshes,S=0,I=B.length;S<I;++S)V+=B[S].eastIndicesNorthToSouth.length;for(B=o.southMeshes,S=0,I=B.length;S<I;++S)V+=B[S].northIndicesWestToEast.length;for(B=o.eastMeshes,S=0,I=B.length;S<I;++S)V+=B[S].westIndicesSouthToNorth.length;for(B=o.northMeshes,S=0,I=B.length;S<I;++S)V+=B[S].southIndicesEastToWest.length;let j=NDt;j.minimumHeight=T,j.maximumHeight=E;let k=F.stride,G=new Float32Array(V*k),q=0,Q=q;q=h7(f,s,F,G,q,0,1,d.height,d.encodedNormal,1,j),q=g7(o,f,F,G,q,o.westTiles,o.westMeshes,wn.EAST,j);let W=q;q=h7(f,s,F,G,q,0,0,p.height,p.encodedNormal,0,j),q=g7(o,f,F,G,q,o.southTiles,o.southMeshes,wn.NORTH,j);let J=q;q=h7(f,s,F,G,q,1,0,g.height,g.encodedNormal,0,j),q=g7(o,f,F,G,q,o.eastTiles,o.eastMeshes,wn.WEST,j);let Z=q;q=h7(f,s,F,G,q,1,1,m.height,m.encodedNormal,1,j),q=g7(o,f,F,G,q,o.northTiles,o.northMeshes,wn.SOUTH,j),T=j.minimumHeight,E=j.maximumHeight;let ae=en.fromRectangle(s,T,E,n.tilingScheme.ellipsoid),Ae=yi.geodeticLatitudeToMercatorAngle(s.south),fe=1/(yi.geodeticLatitudeToMercatorAngle(s.north)-Ae),xe=(yi.geodeticLatitudeToMercatorAngle(P.latitude)-Ae)*fe,ge=f.geodeticSurfaceNormalCartographic(tC,toe),we=cn.octEncode(ge,Zre),Se=q;F.encode(G,q*k,ae.center,U.fromElements(.5,.5,ud),v,we,xe,ge),++q;let Re=q,Qe=Re<256?1:2,He=(Re-1)*3,Xe=He*Qe,$e=(G.length-Re*k)*Float32Array.BYTES_PER_ELEMENT,Pe;if($e>=Xe){let mt=Re*k*Float32Array.BYTES_PER_ELEMENT;Pe=Re<256?new Uint8Array(G.buffer,mt,He):new Uint16Array(G.buffer,mt,He)}else Pe=Re<256?new Uint8Array(He):new Uint16Array(He);G=new Float32Array(G.buffer,0,Re*k);let qe=0;for(S=0;S<Re-2;++S)Pe[qe++]=Se,Pe[qe++]=S,Pe[qe++]=S+1;Pe[qe++]=Se,Pe[qe++]=S,Pe[qe]=0;let st=[];for(S=W;S>=Q;--S)st.push(S);let vt=[];for(S=J;S>=W;--S)vt.push(S);let Gt=[];for(S=Z;S>=J;--S)Gt.push(S);let lt=[];for(lt.push(0),S=Se-1;S>=Z;--S)lt.push(S);o.mesh=new bc(F.center,G,Pe,He,Re,T,E,s,ue.fromOrientedBoundingBox(ae),GDt(e,ae.center,s,T,E),F.stride,ae,F,st,vt,Gt,lt)}let _=t.context;o._destroyVertexArray(i),o.vertexArray=Eh._createVertexArrayForMesh(_,o.mesh),r.processImagery(n,e.terrainProvider,t,!0);let C=o.waterMaskTexture;if(o.waterMaskTexture=void 0,e.terrainProvider.hasWaterMask){let w=r._findAncestorTileWithTerrainData(n);l(w)&&l(w.data.waterMaskTexture)&&(o.waterMaskTexture=w.data.waterMaskTexture,++o.waterMaskTexture.referenceCount,r._computeWaterMaskTranslationAndScale(n,w,o.waterMaskTranslationAndScale))}l(C)&&(--C.referenceCount,C.referenceCount===0&&C.destroy())}function h7(e,t,n,i,r,o,s,a,c,u,f){let d=tC;d.longitude=D.lerp(t.west,t.east,o),d.latitude=D.lerp(t.south,t.north,s),d.height=a;let p=e.cartographicToCartesian(d,dP),g;n.hasGeodeticSurfaceNormals&&(g=e.geodeticSurfaceNormal(p,toe));let m=Qre;return m.x=o,m.y=s,n.encode(i,r*n.stride,p,m,a,c,u,g),f.minimumHeight=Math.min(f.minimumHeight,a),f.maximumHeight=Math.max(f.maximumHeight,a),r+1}var _7=new ie;function JU(e,t,n,i){let r=e.rectangle,o=t.rectangle;t.x===0&&n.x===1&&e.x===e.tilingScheme.getNumberOfXTilesAtLevel(e.level)-1?(r=ie.clone(e.rectangle,_7),r.west-=D.TWO_PI,r.east-=D.TWO_PI):e.x===0&&n.x===0&&t.x===t.tilingScheme.getNumberOfXTilesAtLevel(t.level)-1&&(r=ie.clone(e.rectangle,_7),r.west+=D.TWO_PI,r.east+=D.TWO_PI);let s=r.east-r.west,a=(o.west-r.west)/s,c=(o.east-r.west)/s,u=r.north-r.south,f=(o.south-r.south)/u,d=(o.north-r.south)/u,p=(n.x-a)/(c-a),g=(n.y-f)/(d-f);return Math.abs(p)<Math.EPSILON5?p=0:Math.abs(p-1)<Math.EPSILON5&&(p=1),Math.abs(g)<Math.EPSILON5?g=0:Math.abs(g-1)<Math.EPSILON5&&(g=1),i.x=p,i.y=g,i}var kDt=new U;function eoe(e,t,n,i,r){let o=e.encoding,s=e.vertices;if(r.height=o.decodeHeight(s,t),o.hasVertexNormals)o.getOctEncodedNormal(s,t,r.encodedNormal);else{let a=r.encodedNormal;a.x=0,a.y=0}}var UDt=new U,zDt=new h;function VDt(e,t,n,i,r,o,s,a,c,u){let f=i.encoding,d=i.vertices,p=JU(t,n,f.decodeTextureCoordinates(d,r,ud),ud),g=JU(t,n,f.decodeTextureCoordinates(d,o,Qre),Qre),m;c?m=(s-p.x)/(g.x-p.x):m=(a-p.y)/(g.y-p.y);let y=f.decodeHeight(d,r),A=f.decodeHeight(d,o),b=n.rectangle;tC.longitude=D.lerp(b.west,b.east,s),tC.latitude=D.lerp(b.south,b.north,a),u.height=tC.height=D.lerp(y,A,m);let x;if(f.hasVertexNormals){let T=f.getOctEncodedNormal(d,r,kDt),E=f.getOctEncodedNormal(d,o,UDt),v=cn.octDecode(T.x,T.y,dP),S=cn.octDecode(E.x,E.y,zDt);x=h.lerp(v,S,m,dP),h.normalize(x,x),cn.octEncode(x,u.encodedNormal)}else x=e.geodeticSurfaceNormalCartographic(tC,dP),cn.octEncode(x,u.encodedNormal)}function lMe(e,t,n,i,r,o){o.height=r;let s=t.geodeticSurfaceNormalCartographic(tC,dP);cn.octEncode(s,o.encodedNormal)}function m7(e,t,n,i,r,o,s,a,c,u,f){if(aMe(e,t,a,s,!1,n,i,f)||aMe(e,t,u,c,!0,n,i,f))return f;let p;if(noe(r,o))return n===0?i===0?p=o.eastIndicesNorthToSouth[0]:p=o.southIndicesEastToWest[0]:i===0?p=o.northIndicesWestToEast[0]:p=o.westIndicesSouthToNorth[0],eoe(o,p,n,i,f),f;let g;if(n===0?i===0?g=p7(e.westMeshes,e.westTiles,wn.EAST,e.southMeshes,e.southTiles,wn.NORTH,n,i):g=p7(e.northMeshes,e.northTiles,wn.SOUTH,e.westMeshes,e.westTiles,wn.EAST,n,i):i===0?g=p7(e.southMeshes,e.southTiles,wn.NORTH,e.eastMeshes,e.eastTiles,wn.WEST,n,i):g=p7(e.eastMeshes,e.eastTiles,wn.WEST,e.northMeshes,e.northTiles,wn.SOUTH,n,i),l(g))return lMe(e,t,n,i,g,f),f}function p7(e,t,n,i,r,o,s,a){let c=sMe(e,t,!1,n,s,a),u=sMe(i,r,!0,o,s,a);return l(c)&&l(u)?(c+u)*.5:l(c)?c:u}function g7(e,t,n,i,r,o,s,a,c){for(let u=0;u<o.length;++u)r=jDt(e,t,n,i,r,o[u],s[u],a,c);return r}function jDt(e,t,n,i,r,o,s,a,c){let u;a===wn.EAST&&e.tile.x===0?(u=ie.clone(o.rectangle,_7),u.west-=D.TWO_PI,u.east-=D.TWO_PI):a===wn.WEST&&o.x===0&&(u=ie.clone(o.rectangle,_7),u.west+=D.TWO_PI,u.east+=D.TWO_PI);let f=e.tile.rectangle,d,p;r>0&&(n.decodeTextureCoordinates(i,r-1,ud),d=ud.x,p=ud.y);let g,m;switch(a){case wn.WEST:g=s.westIndicesSouthToNorth,m=!1;break;case wn.NORTH:g=s.northIndicesWestToEast,m=!0;break;case wn.EAST:g=s.eastIndicesNorthToSouth,m=!1;break;case wn.SOUTH:g=s.southIndicesEastToWest,m=!0;break}let y=o,A=e.tile,b=s.encoding,x=s.vertices,T=n.stride,E,v;b.hasWebMercatorT&&(E=yi.geodeticLatitudeToMercatorAngle(f.south),v=1/(yi.geodeticLatitudeToMercatorAngle(f.north)-E));for(let S=0;S<g.length;++S){let I=g[S],R=b.decodeTextureCoordinates(x,I,ud);JU(y,A,R,R);let O=R.x,L=R.y,_=m?O:L;if(_<0||_>1||Math.abs(O-d)<D.EPSILON5&&Math.abs(L-p)<D.EPSILON5)continue;let C=Math.abs(O)<D.EPSILON5||Math.abs(O-1)<D.EPSILON5,w=Math.abs(L)<D.EPSILON5||Math.abs(L-1)<D.EPSILON5;if(C&&w)continue;let P=b.decodePosition(x,I,dP),M=b.decodeHeight(x,I),F;b.hasVertexNormals?F=b.getOctEncodedNormal(x,I,Zre):(F=Zre,F.x=0,F.y=0);let V=L;if(b.hasWebMercatorT){let j=D.lerp(f.south,f.north,L);V=(yi.geodeticLatitudeToMercatorAngle(j)-E)*v}let B;n.hasGeodeticSurfaceNormals&&(B=t.geodeticSurfaceNormal(P,toe)),n.encode(i,r*T,P,R,M,F,V,B),c.minimumHeight=Math.min(c.minimumHeight,M),c.maximumHeight=Math.max(c.maximumHeight,M),++r}return r}function sMe(e,t,n,i,r,o){let s,a,c;n?(s=0,a=e.length,c=1):(s=e.length-1,a=-1,c=-1);for(let u=s;u!==a;u+=c){let f=e[u],d=t[u];if(!noe(d,f))continue;let p;switch(i){case wn.WEST:p=f.westIndicesSouthToNorth;break;case wn.SOUTH:p=f.southIndicesEastToWest;break;case wn.EAST:p=f.eastIndicesNorthToSouth;break;case wn.NORTH:p=f.northIndicesWestToEast;break}let g=p[n?0:p.length-1];if(l(g))return f.encoding.decodeHeight(f.vertices,g)}}function noe(e,t){return l(t)&&(!l(e.data.fill)||!e.data.fill.changedThisFrame)}function aMe(e,t,n,i,r,o,s,a){let c,u,f,d,p,g=i[r?0:n.length-1],m=n[r?0:n.length-1];if(noe(g,m)&&(o===0?s===0?(c=r?m.northIndicesWestToEast:m.eastIndicesNorthToSouth,u=r,f=r):(c=r?m.eastIndicesNorthToSouth:m.southIndicesEastToWest,u=!r,f=!1):s===0?(c=r?m.westIndicesSouthToNorth:m.northIndicesWestToEast,u=!r,f=!0):(c=r?m.southIndicesEastToWest:m.westIndicesSouthToNorth,u=r,f=!r),c.length>0)){d=r?0:c.length-1,p=c[d],m.encoding.decodeTextureCoordinates(m.vertices,p,ud);let y=JU(g,e.tile,ud,ud);if(y.x===o&&y.y===s)return eoe(m,p,o,s,a),!0;if(d=vr(c,u?o:s,function(A,b){m.encoding.decodeTextureCoordinates(m.vertices,A,ud);let x=JU(g,e.tile,ud,ud);return f?u?x.x-o:x.y-s:u?o-x.x:s-x.y}),d<0){if(d=~d,d>0&&d<c.length)return VDt(t,g,e.tile,m,c[d-1],c[d],o,s,u,a),!0}else return eoe(m,c[d],o,s,a),!0}return!1}var HDt=[new h,new h,new h,new h];function GDt(e,t,n,i,r,o){let s=e.quadtree._occluders.ellipsoid,a=s.ellipsoid,c=HDt;return h.fromRadians(n.west,n.south,r,a,c[0]),h.fromRadians(n.east,n.south,r,a,c[1]),h.fromRadians(n.west,n.north,r,a,c[2]),h.fromRadians(n.east,n.north,r,a,c[3]),s.computeHorizonCullingPointPossiblyUnderEllipsoid(t,c,i,o)}var mP=hP;var ioe=class e{constructor(t){this.lightingFadeOutDistance=65e5,this.lightingFadeInDistance=9e6,this.hasWaterMask=!1,this.showWaterEffect=!1,this.oceanNormalMap=void 0,this.zoomedOutOceanSpecularIntensity=.5,this.enableLighting=!1,this.dynamicAtmosphereLighting=!1,this.dynamicAtmosphereLightingFromSun=!1,this.showGroundAtmosphere=!1,this.shadows=Dn.RECEIVE_ONLY,this.vertexShadowDarkness=.3,this.fillHighlightColor=void 0,this.hueShift=0,this.saturationShift=0,this.brightnessShift=0,this.showSkirts=!0,this.backFaceCulling=!0,this.undergroundColor=void 0,this.undergroundColorAlphaByDistance=void 0,this.lambertDiffuseMultiplier=0,this.materialUniformMap=void 0,this._materialUniformMap=void 0,this._quadtree=void 0,this._terrainProvider=t.terrainProvider,this._vectorProvider=t.vectorProvider,this._imageryLayers=t.imageryLayers,this._surfaceShaderSet=t.surfaceShaderSet,this._renderState=void 0,this._blendRenderState=void 0,this._disableCullingRenderState=void 0,this._disableCullingBlendRenderState=void 0,this._errorEvent=new be,this._removeLayerAddedListener=this._imageryLayers.layerAdded.addEventListener(e.prototype._onLayerAdded,this),this._removeLayerRemovedListener=this._imageryLayers.layerRemoved.addEventListener(e.prototype._onLayerRemoved,this),this._removeLayerMovedListener=this._imageryLayers.layerMoved.addEventListener(e.prototype._onLayerMoved,this),this._removeLayerShownListener=this._imageryLayers.layerShownOrHidden.addEventListener(e.prototype._onLayerShownOrHidden,this),this._imageryLayersUpdatedEvent=new be,this._layerOrderChanged=!1,this._tilesToRenderByTextureCount=[],this._drawCommands=[],this._uniformMaps=[],this._usedDrawCommands=0,this._vertexArraysToDestroy=[],this._debug={wireframe:!1,boundingSphereTile:void 0,tilesRendered:0,texturesRendered:0},this._baseColor=void 0,this._firstPassInitialColor=void 0,this.baseColor=new z(0,0,.5,1),this._clippingPlanes=void 0,this._clippingPolygons=void 0,this._clippingPolygonsDirty=!1,this._removeClippingPolygonAdded=void 0,this._removeClippingPolygonRemoved=void 0,this.cartographicLimitRectangle=ie.clone(ie.MAX_VALUE),this._hasLoadedTilesThisFrame=!1,this._hasFillTilesThisFrame=!1,this._oldVerticalExaggeration=void 0,this._oldVerticalExaggerationRelativeHeight=void 0,this._oldSceneMode=re.SCENE3D}get baseColor(){return this._baseColor}set baseColor(t){this._baseColor=t,this._firstPassInitialColor=se.fromColor(t,this._firstPassInitialColor)}get quadtree(){return this._quadtree}set quadtree(t){this._quadtree=t}get tilingScheme(){if(l(this._terrainProvider))return this._terrainProvider.tilingScheme}get errorEvent(){return this._errorEvent}get imageryLayersUpdatedEvent(){return this._imageryLayersUpdatedEvent}get terrainProvider(){return this._terrainProvider}set terrainProvider(t){this._terrainProvider!==t&&(this._terrainProvider=t,l(this._quadtree)&&this._quadtree.invalidateAllTiles())}get vectorProvider(){return this._vectorProvider}get clippingPlanes(){return this._clippingPlanes}set clippingPlanes(t){bs.setOwner(t,this,"_clippingPlanes")}get clippingPolygons(){return this._clippingPolygons}set clippingPolygons(t){if(t===this._clippingPolygons||(Nc.setOwner(t,this,"_clippingPolygons"),this._removeClippingPolygonAdded=this._removeClippingPolygonAdded&&this._removeClippingPolygonAdded(),this._removeClippingPolygonRemoved=this._removeClippingPolygonRemoved&&this._removeClippingPolygonRemoved(),this._clippingPolygonsDirty=!0,!l(t)))return;let n=()=>{this._clippingPolygonsDirty=!0};this._removeClippingPolygonAdded=t.polygonAdded.addEventListener(n),this._removeClippingPolygonRemoved=t.polygonRemoved.addEventListener(n)}update(t){this._imageryLayers._update()}initialize(t){this._imageryLayers.queueReprojectionCommands(t),this._layerOrderChanged&&(this._layerOrderChanged=!1,this._quadtree.forEachLoadedTile(function(o){o.data.imagery.sort(YDt)}));let n=this._vectorProvider;n.minimumTileScreenPixels=qDt(this),n.update(t.frameNumber),this._quadtree.forEachRenderedTile(o=>{let s=o.data;l(s.vectorData)?s.vectorData=n.updateTileData(o.x,o.y,o.level,t.context,s.vectorData,We.CLAMP_TO_TERRAIN):s.vectorData=n.requestTileData(o.x,o.y,o.level,t.context,We.CLAMP_TO_TERRAIN)}),n.makeClean(),JDt(this,t);let i=this._vertexArraysToDestroy,r=i.length;for(let o=0;o<r;++o)Eh._freeVertexArray(i[o]);i.length=0}beginUpdate(t){let n=this._tilesToRenderByTextureCount;for(let o=0,s=n.length;o<s;++o){let a=n[o];l(a)&&(a.length=0)}let i=this._clippingPlanes;l(i)&&i.enabled&&i.update(t);let r=this._clippingPolygons;l(r)&&r.enabled&&r.update(t),this._usedDrawCommands=0,this._hasLoadedTilesThisFrame=!1,this._hasFillTilesThisFrame=!1}endUpdate(t){if(!l(this._renderState)){this._renderState=Ge.fromCache({cull:{enabled:!0},depthTest:{enabled:!0,func:cc.LESS}}),this._blendRenderState=Ge.fromCache({cull:{enabled:!0},depthTest:{enabled:!0,func:cc.LESS_OR_EQUAL},blending:tn.ALPHA_BLEND});let c=Je(this._renderState,!0);c.cull.enabled=!1,this._disableCullingRenderState=Ge.fromCache(c),c=Je(this._blendRenderState,!0),c.cull.enabled=!1,this._disableCullingBlendRenderState=Ge.fromCache(c)}this._hasFillTilesThisFrame&&this._hasLoadedTilesThisFrame&&mP.updateFillTiles(this,this._quadtree._tilesToRender,t,this._vertexArraysToDestroy);let n=this.quadtree,i=t.verticalExaggeration,r=t.verticalExaggerationRelativeHeight,o=this._oldVerticalExaggeration!==i||this._oldVerticalExaggerationRelativeHeight!==r;this._oldVerticalExaggeration=i,this._oldVerticalExaggerationRelativeHeight=r,o&&n.forEachLoadedTile(function(c){c.data.updateExaggeration(c,t,n)});let s=this._oldSceneMode!==t.mode;this._oldSceneMode=t.mode,s&&n.forEachLoadedTile(function(c){c.data.updateSceneMode(t.mode)}),this._clippingPolygonsDirty&&XDt(this);let a=this._tilesToRenderByTextureCount;for(let c=0,u=a.length;c<u;++c){let f=a[c];if(l(f))for(let d=0,p=f.length;d<p;++d){let g=f[d],m=g.data;KDt(this,g,m,t);let y=m.tileBoundingRegion;x1t(this,g,t),t.minimumTerrainHeight=Math.min(t.minimumTerrainHeight,y.minimumHeight)}}}updateForPick(t){let n=this._drawCommands;for(let i=0,r=this._usedDrawCommands;i<r;++i){let o=n[i];o.dirty=!0,o.derivedCommands.picking=void 0;let s=o.derivedCommands.logDepth?.command;l(s)&&(s.derivedCommands.picking=void 0),mMe(o,t)}}cancelReprojections(){this._imageryLayers.cancelReprojections()}getLevelMaximumGeometricError(t){return l(this._terrainProvider)?this._terrainProvider.getLevelMaximumGeometricError(t):0}loadTile(t,n){let i=n.data,r=!0,o;l(i)&&(r=i.boundingVolumeSourceTile!==n||n._lastSelectionResult===pi.CULLED_BUT_NEEDED,o=i.terrainState),Eh.processStateMachine(n,t,this.terrainProvider,this.vectorProvider,this._imageryLayers,this.quadtree,this._vertexArraysToDestroy,r),i=n.data,r&&o!==i.terrainState&&this.computeTileVisibility(n,t,this.quadtree.occluders)!==$o.NONE&&i.boundingVolumeSourceTile===n&&(r=!1,Eh.processStateMachine(n,t,this.terrainProvider,this.vectorProvider,this._imageryLayers,this.quadtree,this._vertexArraysToDestroy,r))}computeTileVisibility(t,n,i){let r=this.computeDistanceToTile(t,n);t._distance=r;let o=gMe(this,n);if(n.fog.enabled&&!o&&D.fog(r,n.fog.density)>=1)return $o.NONE;let s=t.data,a=s.tileBoundingRegion;if(s.boundingVolumeSourceTile===void 0)return $o.PARTIAL;let c=n.cullingVolume,u=a.boundingVolume;l(u)||(u=a.boundingSphere),s.clippedByBoundaries=!1;let f=b7(t.rectangle,this.cartographicLimitRectangle),d=ie.simpleIntersection(f,t.rectangle,pMe);if(!l(d))return $o.NONE;if(ie.equals(d,t.rectangle)||(s.clippedByBoundaries=!0),n.mode!==re.SCENE3D&&(u=ZDt,ue.fromRectangleWithHeights2D(t.rectangle,n.mapProjection,a.minimumHeight,a.maximumHeight,u),h.fromElements(u.center.z,u.center.x,u.center.y,u.center),n.mode===re.MORPHING&&l(s.renderedMesh)&&(u=ue.union(a.boundingSphere,u,u))),!l(u))return $o.PARTIAL;let p=this._clippingPlanes;if(l(p)&&p.enabled){let b=p.computeIntersectionWithBoundingVolume(u);if(t.isClipped=b!==$t.INSIDE,b===$t.OUTSIDE)return $o.NONE}let g=this._clippingPolygons;if(l(g)&&g.enabled){let b=g.computeIntersectionWithBoundingVolume(a);t.isClipped=b!==$t.OUTSIDE}let m,y=c.computeVisibility(u);if(y===$t.OUTSIDE?m=$o.NONE:y===$t.INTERSECTING?m=$o.PARTIAL:y===$t.INSIDE&&(m=$o.FULL),m===$o.NONE)return m;let A=n.mode===re.SCENE3D&&n.camera.frustum instanceof gn;if(n.mode===re.SCENE3D&&!A&&l(i)&&!o){let b=s.occludeePointInScaledSpace;return!l(b)||i.ellipsoid.isScaledSpacePointVisiblePossiblyUnderEllipsoid(b,a.minimumHeight)?m:$o.NONE}return m}canRefine(t){let n=t.data;return l(n.terrainData)?!0:this.terrainProvider.getTileDataAvailable(t.x*2,t.y*2,t.level+1)!==void 0}canRenderWithoutLosingDetail(t){let n=t.data,i=t1t;i.length=this._imageryLayers.length;let r=!1,o=!1,s;l(n)&&(r=n.terrainState===kr.READY,o=!0,s=n.imagery);let a,c;for(a=0,c=i.length;a<c;++a)i[a]=o;if(l(s))for(a=0,c=s.length;a<c;++a){let d=s[a],p=d.loadingImagery,g=!l(p)||p.state===Vn.FAILED||p.state===Vn.INVALID,m=(d.loadingImagery||d.readyImagery).imageryLayer._layerIndex;i[m]=g&&i[m]}let u=this.quadtree._lastSelectionFrameNumber,f=n1t;for(f.length=0,f.push(t.southwestChild,t.southeastChild,t.northwestChild,t.northeastChild);f.length>0;){let d=f.pop(),p=d._lastSelectionResultFrame===u?d._lastSelectionResult:pi.NONE;if(p===pi.RENDERED){let g=d.data;if(!l(g))continue;if(!r&&d.data.terrainState===kr.READY)return!1;let m=d.data.imagery;for(a=0,c=m.length;a<c;++a){let y=m[a],A=y.loadingImagery,b=!l(A)||A.state===Vn.FAILED||A.state===Vn.INVALID,x=(y.loadingImagery||y.readyImagery).imageryLayer._layerIndex;if(b&&!i[x])return!1}}else p===pi.REFINED&&f.push(d.southwestChild,d.southeastChild,d.northwestChild,d.northeastChild)}return!0}computeTileLoadPriority(t,n){let i=t.data;if(i===void 0)return 0;let r=i.tileBoundingRegion.boundingVolume;if(r===void 0)return 0;let o=n.camera.positionWC,s=n.camera.directionWC,a=h.subtract(r.center,o,i1t),c=h.magnitude(a);return c<D.EPSILON5?0:(h.divideByScalar(a,c,a),(1-h.dot(a,s))*t._distance)}showTileThisFrame(t,n){let i=0,r=t.data,o=r.imagery;for(let c=0,u=o.length;c<u;++c){let f=o[c];l(f.readyImagery)&&f.readyImagery.imageryLayer.alpha!==0&&++i}let s=this._tilesToRenderByTextureCount[i];l(s)||(s=[],this._tilesToRenderByTextureCount[i]=s),s.push(t),l(r.vertexArray)?this._hasLoadedTilesThisFrame=!0:this._hasFillTilesThisFrame=!0;let a=this._debug;++a.tilesRendered,a.texturesRendered+=i}computeDistanceToTile(t,n){f1t(t,this,n);let i=t.data;if(i.boundingVolumeSourceTile===void 0)return 9999999999;let o=i.tileBoundingRegion,s=o.minimumHeight,a=o.maximumHeight;if(i.boundingVolumeSourceTile!==t){let u=n.camera.positionCartographic.height,f=Math.abs(u-s),d=Math.abs(u-a);f>d?(o.minimumHeight=s,o.maximumHeight=s):(o.minimumHeight=a,o.maximumHeight=a)}let c=o.distanceToCamera(n);return o.minimumHeight=s,o.maximumHeight=a,c}isDestroyed(){return!1}destroy(){return this._tileProvider=this._tileProvider&&this._tileProvider.destroy(),this._clippingPlanes=this._clippingPlanes&&this._clippingPlanes.destroy(),this._clippingPolygons=void 0,this._removeLayerAddedListener=this._removeLayerAddedListener&&this._removeLayerAddedListener(),this._removeLayerRemovedListener=this._removeLayerRemovedListener&&this._removeLayerRemovedListener(),this._removeLayerMovedListener=this._removeLayerMovedListener&&this._removeLayerMovedListener(),this._removeLayerShownListener=this._removeLayerShownListener&&this._removeLayerShownListener(),this._removeClippingPolygonAdded=this._removeClippingPolygonAdded&&this._removeClippingPolygonAdded(),this._removeClippingPolygonRemoved=this._removeClippingPolygonRemoved&&this._removeClippingPolygonRemoved(),le(this)}_onLayerAdded(t,n){if(!this.isDestroyed()&&t.show){let i=this._terrainProvider,r=this,o=this._imageryLayersUpdatedEvent,s=function(){t._imageryCache={},r._quadtree.forEachLoadedTile(function(a){if(l(a._loadedCallbacks[t._layerIndex]))return;let c,u=a.data.imagery,f=u.length,d=-1,p=0;for(c=0;c<f;++c){let m=u[c];if((m.readyImagery??m.loadingImagery).imageryLayer===t)d===-1&&(d=c),++p;else if(d!==-1)break}if(d===-1)return;let g=d+p;t._createTileImagerySkeletons(a,i,g)&&(a._loadedCallbacks[t._layerIndex]=d1t(p,t,i),a.state=Ja.LOADING)})};if(t.ready){let a=t.imageryProvider;a._reload=s}this._quadtree.forEachLoadedTile(function(a){t._createTileImagerySkeletons(a,i)&&(a.state=Ja.LOADING,a.level!==0&&(a._lastSelectionResultFrame!==r.quadtree._lastSelectionFrameNumber||a._lastSelectionResult!==pi.RENDERED)&&(a.renderable=!1))}),this._layerOrderChanged=!0,o.raiseEvent()}}_onLayerRemoved(t,n){this._quadtree.forEachLoadedTile(function(i){let r=i.data.imagery,o=-1,s=0;for(let a=0,c=r.length;a<c;++a){let u=r[a],f=u.loadingImagery;if(l(f)||(f=u.readyImagery),f.imageryLayer===t)o===-1&&(o=a),u.freeResources(),++s;else if(o!==-1)break}o!==-1&&r.splice(o,s)}),l(t.imageryProvider)&&(t.imageryProvider._reload=void 0),this._imageryLayersUpdatedEvent.raiseEvent()}_onLayerMoved(t,n,i){this._layerOrderChanged=!0,this._imageryLayersUpdatedEvent.raiseEvent()}_onLayerShownOrHidden(t,n,i){i?this._onLayerAdded(t,n):this._onLayerRemoved(t,n)}},WDt=new ie;function qDt(e){let t=e.getLevelMaximumGeometricError(0);if(t<=0)return e._vectorProvider.minimumTileScreenPixels;let n=e.tilingScheme;return n.tileXYToRectangle(0,0,0,WDt).width*n.ellipsoid.maximumRadius/t*e._quadtree.maximumScreenSpaceError/2}function YDt(e,t){let n=e.loadingImagery;l(n)||(n=e.readyImagery);let i=t.loadingImagery;return l(i)||(i=t.readyImagery),n.imageryLayer._layerIndex-i.imageryLayer._layerIndex}function XDt(e){e._quadtree.forEachLoadedTile(function(t){let n=t.data;l(n?.clippingPolygonData)&&(Nc.releaseRectangleData(n.clippingPolygonData),n.clippingPolygonData=void 0)}),e._clippingPolygonsDirty=!1}function KDt(e,t,n,i){let r=e._clippingPolygons;!l(r)||!r.enabled||!t.isClipped||l(n.clippingPolygonData)||(n.clippingPolygonData=r.requestRectangleData(t.rectangle,i.context))}function $Dt(e,t){let n=e._clippingPolygons;return l(n)&&n.enabled&&n.length>0&&n.inverse&&(t.clippingPolygonData?.polygonRings.length??0)===0}function JDt(e,t){let n=t.creditDisplay,i=e._terrainProvider;l(i)&&l(i.credit)&&n.addCreditToNextFrame(i.credit);let r=e._imageryLayers;for(let o=0,s=r.length;o<s;++o){let a=r.get(o);a.ready&&a.show&&l(a.imageryProvider.credit)&&n.addCreditToNextFrame(a.imageryProvider.credit)}}function mMe(e,t){let n=t.globeTranslucencyState;if(n.translucent){let i=e.renderState.blending.enabled;n.pushDerivedCommands(e,i,t)}else t.commandList.push(e)}var ZDt=new ue,pMe=new ie,QDt=new ie,e1t=new he;function b7(e,t){if(t.west<t.east)return t;let n=ie.clone(t,QDt);return ie.center(e,e1t).longitude>0?n.east=D.PI:n.west=-D.PI,n}function gMe(e,t){if(t.cameraUnderground||t.globeTranslucencyState.translucent)return!0;if(e.backFaceCulling)return!1;let n=e._clippingPlanes;if(l(n)&&n.enabled)return!0;let i=e._clippingPolygons;return!!(l(i)&&i.enabled||!ie.equals(e.cartographicLimitRectangle,ie.MAX_VALUE))}var t1t=[],n1t=[],i1t=new h,uMe=new N,A7=new N,r1t=new se,o1t=new se,s1t=new se,a1t=new h,fMe=new h,c1t=new h,l1t=new h,u1t=[new h,new h,new h,new h];function dMe(e,t,n,i,r,o){let s=e.quadtree._occluders.ellipsoid,a=s.ellipsoid,c=u1t;return h.fromRadians(n.west,n.south,r,a,c[0]),h.fromRadians(n.east,n.south,r,a,c[1]),h.fromRadians(n.west,n.north,r,a,c[2]),h.fromRadians(n.east,n.north,r,a,c[3]),s.computeHorizonCullingPointPossiblyUnderEllipsoid(t,c,i,o)}function f1t(e,t,n){let i=e.data;i===void 0&&(i=e.data=new Eh);let r=e.tilingScheme.ellipsoid;i.tileBoundingRegion===void 0&&(i.tileBoundingRegion=new Yf({computeBoundingVolumes:!1,rectangle:e.rectangle,ellipsoid:r,minimumHeight:0,maximumHeight:0}));let o=i.tileBoundingRegion,s=o.minimumHeight,a=o.maximumHeight,c=!1,u=e,f=i.mesh,d=i.terrainData;if(f!==void 0&&f.minimumHeight!==void 0&&f.maximumHeight!==void 0)o.minimumHeight=f.minimumHeight,o.maximumHeight=f.maximumHeight,c=!0;else if(d!==void 0&&d._minimumHeight!==void 0&&d._maximumHeight!==void 0)o.minimumHeight=d._minimumHeight,o.maximumHeight=d._maximumHeight;else{o.minimumHeight=Number.NaN,o.maximumHeight=Number.NaN;let p=e.parent;for(;p!==void 0;){let g=p.data;if(g!==void 0){let m=g.mesh,y=g.terrainData;if(m!==void 0&&m.minimumHeight!==void 0&&m.maximumHeight!==void 0){o.minimumHeight=m.minimumHeight,o.maximumHeight=m.maximumHeight;break}else if(y!==void 0&&y._minimumHeight!==void 0&&y._maximumHeight!==void 0){o.minimumHeight=y._minimumHeight,o.maximumHeight=y._maximumHeight;break}}p=p.parent}u=p}if(u!==void 0){let p=n.verticalExaggeration,g=n.verticalExaggerationRelativeHeight;if(p!==1&&(c=!1,o.minimumHeight=Ar.getHeight(o.minimumHeight,p,g),o.maximumHeight=Ar.getHeight(o.maximumHeight,p,g)),c)i.boundingVolumeIsFromMesh||(o._orientedBoundingBox=en.clone(f.orientedBoundingBox,o._orientedBoundingBox),o._boundingSphere=ue.clone(f.boundingSphere3D,o._boundingSphere),i.occludeePointInScaledSpace=h.clone(f.occludeePointInScaledSpace,i.occludeePointInScaledSpace),l(i.occludeePointInScaledSpace)||(i.occludeePointInScaledSpace=dMe(t,o._orientedBoundingBox.center,e.rectangle,o.minimumHeight,o.maximumHeight,i.occludeePointInScaledSpace)));else{let y=o._orientedBoundingBox===void 0||o._boundingSphere===void 0;(o.minimumHeight!==s||o.maximumHeight!==a||y)&&(o.computeBoundingVolumes(r),i.occludeePointInScaledSpace=dMe(t,o._orientedBoundingBox.center,e.rectangle,o.minimumHeight,o.maximumHeight,i.occludeePointInScaledSpace))}i.boundingVolumeSourceTile=u,i.boundingVolumeIsFromMesh=c}else i.boundingVolumeSourceTile=void 0,i.boundingVolumeIsFromMesh=!1}function d1t(e,t,n){return function(i){let r,o,s=-1,a=i.data.imagery,c=a.length,u;for(u=0;u<c;++u)if(r=a[u],o=r.readyImagery??r.loadingImagery,o.imageryLayer===t){s=u;break}if(s!==-1){let f=s+e;if(r=a[f],o=l(r)?r.readyImagery??r.loadingImagery:void 0,!l(o)||o.imageryLayer!==t)return!t._createTileImagerySkeletons(i,n,f);for(u=s;u<f;++u)a[u].freeResources();a.splice(s,e)}return!0}}var h1t=new N,m1t=new N;function hMe(e,t){let n={u_initialColor:function(){return this.properties.initialColor},u_fillHighlightColor:function(){return this.properties.fillHighlightColor},u_zoomedOutOceanSpecularIntensity:function(){return this.properties.zoomedOutOceanSpecularIntensity},u_oceanNormalMap:function(){return this.properties.oceanNormalMap},u_atmosphereLightIntensity:function(){return this.properties.atmosphereLightIntensity},u_atmosphereRayleighCoefficient:function(){return this.properties.atmosphereRayleighCoefficient},u_atmosphereMieCoefficient:function(){return this.properties.atmosphereMieCoefficient},u_atmosphereRayleighScaleHeight:function(){return this.properties.atmosphereRayleighScaleHeight},u_atmosphereMieScaleHeight:function(){return this.properties.atmosphereMieScaleHeight},u_atmosphereMieAnisotropy:function(){return this.properties.atmosphereMieAnisotropy},u_lightingFadeDistance:function(){return this.properties.lightingFadeDistance},u_nightFadeDistance:function(){return this.properties.nightFadeDistance},u_center3D:function(){return this.properties.center3D},u_verticalExaggerationAndRelativeHeight:function(){return this.properties.verticalExaggerationAndRelativeHeight},u_tileRectangle:function(){return this.properties.tileRectangle},u_modifiedModelView:function(){let i=e.context.uniformState.view,r=N.multiplyByPoint(i,this.properties.rtc,fMe);return N.setTranslation(i,r,uMe),uMe},u_modifiedModelViewProjection:function(){let i=e.context.uniformState.view,r=e.context.uniformState.projection,o=N.multiplyByPoint(i,this.properties.rtc,fMe);return N.setTranslation(i,o,A7),N.multiply(r,A7,A7),A7},u_dayTextures:function(){return this.properties.dayTextures},u_dayTextureTranslationAndScale:function(){return this.properties.dayTextureTranslationAndScale},u_dayTextureTexCoordsRectangle:function(){return this.properties.dayTextureTexCoordsRectangle},u_dayTextureUseWebMercatorT:function(){return this.properties.dayTextureUseWebMercatorT},u_dayTextureAlpha:function(){return this.properties.dayTextureAlpha},u_dayTextureNightAlpha:function(){return this.properties.dayTextureNightAlpha},u_dayTextureDayAlpha:function(){return this.properties.dayTextureDayAlpha},u_dayTextureBrightness:function(){return this.properties.dayTextureBrightness},u_dayTextureContrast:function(){return this.properties.dayTextureContrast},u_dayTextureHue:function(){return this.properties.dayTextureHue},u_dayTextureSaturation:function(){return this.properties.dayTextureSaturation},u_dayTextureOneOverGamma:function(){return this.properties.dayTextureOneOverGamma},u_dayIntensity:function(){return this.properties.dayIntensity},u_southAndNorthLatitude:function(){return this.properties.southAndNorthLatitude},u_southMercatorYAndOneOverHeight:function(){return this.properties.southMercatorYAndOneOverHeight},u_waterMask:function(){return this.properties.waterMask},u_waterMaskTranslationAndScale:function(){return this.properties.waterMaskTranslationAndScale},u_minMaxHeight:function(){return this.properties.minMaxHeight},u_scaleAndBias:function(){return this.properties.scaleAndBias},u_dayTextureSplit:function(){return this.properties.dayTextureSplit},u_dayTextureCutoutRectangles:function(){return this.properties.dayTextureCutoutRectangles},u_clippingPlanes:function(){let i=t._clippingPlanes;return l(i)&&l(i.texture)?i.texture:e.context.defaultTexture},u_cartographicLimitRectangle:function(){return this.properties.localizedCartographicLimitRectangle},u_clippingPlanesMatrix:function(){let i=t._clippingPlanes,r=l(i)?N.multiply(e.context.uniformState.view,i.modelMatrix,h1t):N.IDENTITY;return N.inverseTranspose(r,m1t)},u_clippingPlanesEdgeStyle:function(){let i=this.properties.clippingPlanesEdgeColor;return i.alpha=this.properties.clippingPlanesEdgeWidth,i},u_minimumBrightness:function(){return e.fog.minimumBrightness},u_hsbShift:function(){return this.properties.hsbShift},u_colorsToAlpha:function(){return this.properties.colorsToAlpha},u_frontFaceAlphaByDistance:function(){return this.properties.frontFaceAlphaByDistance},u_backFaceAlphaByDistance:function(){return this.properties.backFaceAlphaByDistance},u_translucencyRectangle:function(){return this.properties.localizedTranslucencyRectangle},u_undergroundColor:function(){return this.properties.undergroundColor},u_undergroundColorAlphaByDistance:function(){return this.properties.undergroundColorAlphaByDistance},u_lambertDiffuseMultiplier:function(){return this.properties.lambertDiffuseMultiplier},u_vertexShadowDarkness:function(){return this.properties.vertexShadowDarkness},u_vectorSegmentTexture:function(){return this.properties.vectorSegmentTexture??e.context.defaultTexture},u_vectorWidthTexture:function(){return this.properties.vectorWidthTexture??e.context.defaultTexture},u_vectorColorTexture:function(){return this.properties.vectorColorTexture??e.context.defaultTexture},u_vectorPickColorTexture:function(){return this.properties.vectorPickColorTexture??e.context.defaultTexture},u_vectorSegmentPrimitiveIndicesTexture:function(){return this.properties.vectorSegmentPrimitiveIndicesTexture??e.context.defaultTexture},u_vectorGridCellIndicesTexture:function(){return this.properties.vectorGridCellIndicesTexture??e.context.defaultTexture},u_vectorPolygonEdgeTexture:function(){return this.properties.vectorPolygonEdgeTexture??e.context.defaultTexture},u_vectorPolygonEdgePrimitiveIndicesTexture:function(){return this.properties.vectorPolygonEdgePrimitiveIndicesTexture??e.context.defaultTexture},u_vectorPolygonGridCellIndicesTexture:function(){return this.properties.vectorPolygonGridCellIndicesTexture??e.context.defaultTexture},u_vectorMetersPerUv:function(){return this.properties.vectorMetersPerUv},u_clippingEdgeTexture:function(){return this.properties.clippingEdgeTexture??e.context.defaultTexture},u_clippingEdgePrimitiveIndicesTexture:function(){return this.properties.clippingEdgePrimitiveIndicesTexture??e.context.defaultTexture},u_clippingGridCellIndicesTexture:function(){return this.properties.clippingGridCellIndicesTexture??e.context.defaultTexture},properties:{initialColor:new se(0,0,.5,1),fillHighlightColor:new z(0,0,0,0),zoomedOutOceanSpecularIntensity:.5,oceanNormalMap:void 0,lightingFadeDistance:new U(65e5,9e6),nightFadeDistance:new U(1e7,4e7),atmosphereLightIntensity:10,atmosphereRayleighCoefficient:new h(55e-7,13e-6,284e-7),atmosphereMieCoefficient:new h(21e-6,21e-6,21e-6),atmosphereRayleighScaleHeight:1e4,atmosphereMieScaleHeight:3200,atmosphereMieAnisotropy:.9,hsbShift:new h,center3D:void 0,rtc:new h,modifiedModelView:new N,tileRectangle:new se,verticalExaggerationAndRelativeHeight:new U(1,0),dayTextures:[],dayTextureTranslationAndScale:[],dayTextureTexCoordsRectangle:[],dayTextureUseWebMercatorT:[],dayTextureAlpha:[],dayTextureNightAlpha:[],dayTextureDayAlpha:[],dayTextureBrightness:[],dayTextureContrast:[],dayTextureHue:[],dayTextureSaturation:[],dayTextureOneOverGamma:[],dayTextureSplit:[],dayTextureCutoutRectangles:[],dayIntensity:0,colorsToAlpha:[],southAndNorthLatitude:new U,southMercatorYAndOneOverHeight:new U,waterMask:void 0,waterMaskTranslationAndScale:new se,minMaxHeight:new U,scaleAndBias:new N,clippingPlanesEdgeColor:z.clone(z.WHITE),clippingPlanesEdgeWidth:0,localizedCartographicLimitRectangle:new se,frontFaceAlphaByDistance:new se,backFaceAlphaByDistance:new se,localizedTranslucencyRectangle:new se,undergroundColor:z.clone(z.TRANSPARENT),undergroundColorAlphaByDistance:new se,lambertDiffuseMultiplier:0,vertexShadowDarkness:0,vectorSegmentTexture:void 0,vectorWidthTexture:void 0,vectorColorTexture:void 0,vectorPickColorTexture:void 0,vectorSegmentPrimitiveIndicesTexture:void 0,vectorGridCellIndicesTexture:void 0,vectorPolygonEdgeTexture:void 0,vectorPolygonEdgePrimitiveIndicesTexture:void 0,vectorPolygonGridCellIndicesTexture:void 0,vectorMetersPerUv:new U,clippingEdgeTexture:void 0,clippingEdgePrimitiveIndicesTexture:void 0,clippingGridCellIndicesTexture:void 0}};return l(t.materialUniformMap)?Ot(n,t.materialUniformMap):n}function p1t(e,t){let n=t.data,i,r;if(l(n.vertexArray)?(i=n.mesh,r=n.vertexArray):l(n.fill)&&l(n.fill.vertexArray)&&(i=n.fill.mesh,r=n.fill.vertexArray),!(!l(i)||!l(r))){if(l(n.wireframeVertexArray)){if(n.wireframeVertexArray.mesh===i)return;n.wireframeVertexArray.destroy(),n.wireframeVertexArray=void 0}n.wireframeVertexArray=g1t(e,r,i),n.wireframeVertexArray.mesh=i}}function g1t(e,t,n){let r={indices:n.indices,primitiveType:Oe.TRIANGLES};Hn.toWireframe(r);let o=r.indices,s=tt.createIndexBuffer({context:e,typedArray:o,usage:Me.STATIC_DRAW,indexDatatype:je.fromSizeInBytes(o.BYTES_PER_ELEMENT)});return new zn({context:e,attributes:t._attributes,indexBuffer:s})}var _Me,yMe,x7;(function(){let e=new Ft({geometry:$h.fromDimensions({dimensions:new h(2,2,2)})}),t=new Ft({geometry:new y_({radius:1})}),n=new N,i,r;function o(s){return new On({geometryInstances:s,appearance:new yn({translucent:!1,flat:!0}),asynchronous:!1})}_Me=function(s,a){return s===i||(x7(),i=s,n=N.fromRotationTranslation(s.halfAxes,s.center,n),e.modelMatrix=n,e.attributes.color=Jt.fromColor(a),r=o(e)),r},yMe=function(s,a){return s===i||(x7(),i=s,n=N.fromTranslation(s.center,n),n=N.multiplyByUniformScale(n,s.radius,n),t.modelMatrix=n,t.attributes.color=Jt.fromColor(a),r=o(t)),r},x7=function(){l(r)&&(r.destroy(),r=void 0,i=void 0)}})();var _1t=new se(0,0,0,0),y1t={frameState:void 0,surfaceTile:void 0,numberOfDayTextures:void 0,applyBrightness:void 0,applyContrast:void 0,applyHue:void 0,applySaturation:void 0,applyGamma:void 0,applyAlpha:void 0,applyDayNightAlpha:void 0,applySplit:void 0,showReflectiveOcean:void 0,showOceanWaves:void 0,enableLighting:void 0,dynamicAtmosphereLighting:void 0,dynamicAtmosphereLightingFromSun:void 0,showGroundAtmosphere:void 0,perFragmentGroundAtmosphere:void 0,hasVertexNormals:void 0,useWebMercatorProjection:void 0,enableFog:void 0,enableClippingPlanes:void 0,clippingPlanes:void 0,enableClippingPolygons:void 0,clippingPolygons:void 0,clippedByBoundaries:void 0,hasImageryLayerCutout:void 0,colorCorrect:void 0,colorToAlpha:void 0,hasGeodeticSurfaceNormals:void 0,hasExaggeration:void 0,vectorAntialias:void 0},A1t=z.TRANSPARENT,b1t=new qt;function x1t(e,t,n){let i=t.data;if($Dt(e,i))return;l(i.vertexArray)||(i.fill===void 0&&(i.fill=new mP(t)),i.fill.update(e,n));let r=n.creditDisplay,o=i.terrainData;if(l(o)&&l(o.credits)){let mt=o.credits;for(let ft=0,Xt=mt.length;ft<Xt;++ft)r.addCreditToNextFrame(mt[ft])}let s=kt.maximumTextureImageUnits,a=i.waterMaskTexture,c=i.waterMaskTranslationAndScale;!l(a)&&l(i.fill)&&(a=i.fill.waterMaskTexture,c=i.fill.waterMaskTranslationAndScale);let u=n.cameraUnderground,f=n.globeTranslucencyState,d=f.translucent,p=f.frontFaceAlphaByDistance,g=f.backFaceAlphaByDistance,m=f.rectangle,y=e.undergroundColor??A1t,A=e.undergroundColorAlphaByDistance??b1t,b=gMe(e,n)&&n.mode===re.SCENE3D&&y.alpha>0&&(A.nearValue>0||A.farValue>0),x=e.lambertDiffuseMultiplier,T=e.vertexShadowDarkness,E=e.hasWaterMask&&l(a),v=E&&e.showWaterEffect,S=e.oceanNormalMap,I=v&&l(S),R=e.terrainProvider,O=l(R)&&e.terrainProvider.hasVertexNormals,L=n.fog.enabled&&n.fog.renderable&&!u,_=e.showGroundAtmosphere&&n.mode===re.SCENE3D,C=Dn.castShadows(e.shadows)&&!d,w=Dn.receiveShadows(e.shadows)&&!d,P=e.hueShift,M=e.saturationShift,F=e.brightnessShift,V=!(D.equalsEpsilon(P,0,D.EPSILON7)&&D.equalsEpsilon(M,0,D.EPSILON7)&&D.equalsEpsilon(F,0,D.EPSILON7)),B=!1;if(_){let mt=h.magnitude(n.camera.positionWC),ft=e.nightFadeOutDistance;B=mt>ft}E&&--s,I&&--s,l(n.shadowState)&&n.shadowState.shadowsEnabled&&--s,l(e.clippingPlanes)&&e.clippingPlanes.enabled&&--s,l(e.clippingPolygons)&&e.clippingPolygons.enabled&&(s-=3),s-=f.numberOfTextureUniforms;let j=i.renderedMesh,k=j.center,G=j.encoding,q=i.tileBoundingRegion,Q=n.verticalExaggeration,W=n.verticalExaggerationRelativeHeight,J=Q!==1,Z=G.hasGeodeticSurfaceNormals,ae=r1t,Ae=0,fe=0,xe=0,ge=0,we=!1;if(n.mode!==re.SCENE3D){let mt=n.mapProjection,ft=mt.project(ie.southwest(t.rectangle),c1t),Xt=mt.project(ie.northeast(t.rectangle),l1t);if(ae.x=ft.x,ae.y=ft.y,ae.z=Xt.x,ae.w=Xt.y,n.mode!==re.MORPHING&&(k=a1t,k.x=0,k.y=(ae.z+ae.x)*.5,k.z=(ae.w+ae.y)*.5,ae.x-=k.y,ae.y-=k.z,ae.z-=k.y,ae.w-=k.z),n.mode===re.SCENE2D&&G.quantization===$a.BITS12){let rt=1/(Math.pow(2,12)-1)*.5,ht=(ae.z-ae.x)*rt,Bi=(ae.w-ae.y)*rt;ae.x-=ht,ae.y-=Bi,ae.z+=ht,ae.w+=Bi}mt instanceof yi&&(Ae=t.rectangle.south,fe=t.rectangle.north,xe=yi.geodeticLatitudeToMercatorAngle(Ae),ge=1/(yi.geodeticLatitudeToMercatorAngle(fe)-xe),we=!0)}let Se=y1t;Se.frameState=n,Se.surfaceTile=i,Se.hasWaterMask=E,Se.showReflectiveOcean=v,Se.showOceanWaves=I,Se.enableLighting=e.enableLighting,Se.dynamicAtmosphereLighting=e.dynamicAtmosphereLighting,Se.dynamicAtmosphereLightingFromSun=e.dynamicAtmosphereLightingFromSun,Se.showGroundAtmosphere=_,Se.atmosphereLightIntensity=e.atmosphereLightIntensity,Se.atmosphereRayleighCoefficient=e.atmosphereRayleighCoefficient,Se.atmosphereMieCoefficient=e.atmosphereMieCoefficient,Se.atmosphereRayleighScaleHeight=e.atmosphereRayleighScaleHeight,Se.atmosphereMieScaleHeight=e.atmosphereMieScaleHeight,Se.atmosphereMieAnisotropy=e.atmosphereMieAnisotropy,Se.perFragmentGroundAtmosphere=B,Se.hasVertexNormals=O,Se.useWebMercatorProjection=we,Se.clippedByBoundaries=i.clippedByBoundaries,Se.hasGeodeticSurfaceNormals=Z,Se.hasExaggeration=J,Se.vectorAntialias=e.vectorProvider.antialias;let Re=i.imagery,Qe=0,He=Re.length,Xe=e.showSkirts&&!u&&!d,$e=e.backFaceCulling&&!u&&!d,Pe=$e?e._renderState:e._disableCullingRenderState,qe=$e?e._blendRenderState:e._disableCullingBlendRenderState,st=Pe,vt=e._firstPassInitialColor,Gt=n.context;if(l(e._debug.boundingSphereTile)||x7(),e._materialUniformMap!==e.materialUniformMap){e._materialUniformMap=e.materialUniformMap;let mt=e._drawCommands.length;for(let ft=0;ft<mt;++ft)e._uniformMaps[ft]=hMe(n,e)}do{let mt=0,ft,Xt;if(e._drawCommands.length<=e._usedDrawCommands?(ft=new at,ft.owner=t,ft.cull=!1,ft.boundingVolume=new ue,ft.orientedBoundingBox=void 0,Xt=hMe(n,e),e._drawCommands.push(ft),e._uniformMaps.push(Xt)):(ft=e._drawCommands[e._usedDrawCommands],Xt=e._uniformMaps[e._usedDrawCommands]),ft.owner=t,++e._usedDrawCommands,t===e._debug.boundingSphereTile){let ks=q.boundingVolume,tc=q.boundingSphere;l(ks)?_Me(ks,z.RED).update(n):l(tc)&&yMe(tc,z.RED).update(n)}let rt=Xt.properties;se.clone(vt,rt.initialColor),rt.oceanNormalMap=S,rt.lightingFadeDistance.x=e.lightingFadeOutDistance,rt.lightingFadeDistance.y=e.lightingFadeInDistance,rt.nightFadeDistance.x=e.nightFadeOutDistance,rt.nightFadeDistance.y=e.nightFadeInDistance,rt.atmosphereLightIntensity=e.atmosphereLightIntensity,rt.atmosphereRayleighCoefficient=e.atmosphereRayleighCoefficient,rt.atmosphereMieCoefficient=e.atmosphereMieCoefficient,rt.atmosphereRayleighScaleHeight=e.atmosphereRayleighScaleHeight,rt.atmosphereMieScaleHeight=e.atmosphereMieScaleHeight,rt.atmosphereMieAnisotropy=e.atmosphereMieAnisotropy,rt.zoomedOutOceanSpecularIntensity=e.zoomedOutOceanSpecularIntensity;let ht=u?g:p,Bi=u?p:g;l(ht)&&(se.fromElements(ht.near,ht.nearValue,ht.far,ht.farValue,rt.frontFaceAlphaByDistance),se.fromElements(Bi.near,Bi.nearValue,Bi.far,Bi.farValue,rt.backFaceAlphaByDistance)),se.fromElements(A.near,A.nearValue,A.far,A.farValue,rt.undergroundColorAlphaByDistance),z.clone(y,rt.undergroundColor),rt.lambertDiffuseMultiplier=x,rt.vertexShadowDarkness=T;let Xn=!l(i.vertexArray)&&l(e.fillHighlightColor)&&e.fillHighlightColor.alpha>0;Xn&&z.clone(e.fillHighlightColor,rt.fillHighlightColor),rt.verticalExaggerationAndRelativeHeight.x=Q,rt.verticalExaggerationAndRelativeHeight.y=W,rt.center3D=j.center,h.clone(k,rt.rtc),se.clone(ae,rt.tileRectangle),rt.southAndNorthLatitude.x=Ae,rt.southAndNorthLatitude.y=fe,rt.southMercatorYAndOneOverHeight.x=xe,rt.southMercatorYAndOneOverHeight.y=ge;let bi=o1t,Wi=b7(t.rectangle,e.cartographicLimitRectangle),wi=s1t,hi=b7(t.rectangle,m);h.fromElements(P,M,F,rt.hsbShift);let xi=t.rectangle,jn=1/xi.width,nn=1/xi.height;bi.x=(Wi.west-xi.west)*jn,bi.y=(Wi.south-xi.south)*nn,bi.z=(Wi.east-xi.west)*jn,bi.w=(Wi.north-xi.south)*nn,se.clone(bi,rt.localizedCartographicLimitRectangle),wi.x=(hi.west-xi.west)*jn,wi.y=(hi.south-xi.south)*nn,wi.z=(hi.east-xi.west)*jn,wi.w=(hi.north-xi.south)*nn,se.clone(wi,rt.localizedTranslucencyRectangle);let Wn=L&&D.fog(t._distance,n.fog.density)>D.EPSILON3;V=V&&(Wn||_);let Zi=!1,Mr=!1,fo=!1,Bs=!1,Ks=!1,no=!1,gi=!1,ho=!1,ur=!1,Zo=!1;for(;mt<s&&Qe<He;){let ks=Re[Qe],tc=ks.readyImagery;if(++Qe,!l(tc)||tc.imageryLayer.alpha===0)continue;let Kb=ks.useWebMercatorT?tc.textureWebMercator:tc.texture,ri=tc.imageryLayer;l(ks.textureTranslationAndScale)||(ks.textureTranslationAndScale=ri._calculateTextureTranslationAndScale(t,ks)),rt.dayTextures[mt]=Kb,rt.dayTextureTranslationAndScale[mt]=ks.textureTranslationAndScale,rt.dayTextureTexCoordsRectangle[mt]=ks.textureCoordinateRectangle,rt.dayTextureUseWebMercatorT[mt]=ks.useWebMercatorT,rt.dayTextureAlpha[mt]=ri.alpha,no=no||rt.dayTextureAlpha[mt]!==1,rt.dayTextureNightAlpha[mt]=ri.nightAlpha,gi=gi||rt.dayTextureNightAlpha[mt]!==1,rt.dayTextureDayAlpha[mt]=ri.dayAlpha,gi=gi||rt.dayTextureDayAlpha[mt]!==1,rt.dayTextureBrightness[mt]=ri.brightness,Zi=Zi||rt.dayTextureBrightness[mt]!==Ss.DEFAULT_BRIGHTNESS,rt.dayTextureContrast[mt]=ri.contrast,Mr=Mr||rt.dayTextureContrast[mt]!==Ss.DEFAULT_CONTRAST,rt.dayTextureHue[mt]=ri.hue,fo=fo||rt.dayTextureHue[mt]!==Ss.DEFAULT_HUE,rt.dayTextureSaturation[mt]=ri.saturation,Bs=Bs||rt.dayTextureSaturation[mt]!==Ss.DEFAULT_SATURATION,rt.dayTextureOneOverGamma[mt]=1/ri.gamma,Ks=Ks||rt.dayTextureOneOverGamma[mt]!==1/Ss.DEFAULT_GAMMA,rt.dayTextureSplit[mt]=ri.splitDirection,ho=ho||rt.dayTextureSplit[mt]!==0;let Kr=rt.dayTextureCutoutRectangles[mt];if(l(Kr)||(Kr=rt.dayTextureCutoutRectangles[mt]=new se),se.clone(se.ZERO,Kr),l(ri.cutoutRectangle)){let Ma=b7(xi,ri.cutoutRectangle),Ep=ie.simpleIntersection(Ma,xi,pMe);ur=l(Ep)||ur,Kr.x=(Ma.west-xi.west)*jn,Kr.y=(Ma.south-xi.south)*nn,Kr.z=(Ma.east-xi.west)*jn,Kr.w=(Ma.north-xi.south)*nn}let Ol=rt.colorsToAlpha[mt];l(Ol)||(Ol=rt.colorsToAlpha[mt]=new se);let Z0=l(ri.colorToAlpha)&&ri.colorToAlphaThreshold>0;if(Zo=Zo||Z0,Z0){let Ma=ri.colorToAlpha;Ol.x=Ma.red,Ol.y=Ma.green,Ol.z=Ma.blue,Ol.w=ri.colorToAlphaThreshold}else Ol.w=-1;if(l(tc.credits)){let Ma=tc.credits;for(let Ep=0,Cy=Ma.length;Ep<Cy;++Ep)r.addCreditToNextFrame(Ma[Ep])}++mt}rt.dayTextures.length=mt,rt.waterMask=a,se.clone(c,rt.waterMaskTranslationAndScale),rt.minMaxHeight.x=G.minimumHeight,rt.minMaxHeight.y=G.maximumHeight,N.clone(G.matrix,rt.scaleAndBias);let Bn=e._clippingPlanes,qi=l(Bn)&&Bn.enabled&&t.isClipped;qi&&(rt.clippingPlanesEdgeColor=z.clone(Bn.edgeColor,rt.clippingPlanesEdgeColor),rt.clippingPlanesEdgeWidth=Bn.edgeWidth);let ki=i.vectorData;l(ki)&&(rt.vectorSegmentTexture=ki.polylineSegmentTexture,rt.vectorWidthTexture=ki.widthTexture,rt.vectorColorTexture=ki.colorTexture,rt.vectorPickColorTexture=ki.pickColorTexture,rt.vectorSegmentPrimitiveIndicesTexture=ki.polylineSegmentPrimitiveIndicesTexture,rt.vectorGridCellIndicesTexture=ki.polylineGridCellIndicesTexture,rt.vectorPolygonEdgeTexture=ki.polygonEdgeTexture,rt.vectorPolygonEdgePrimitiveIndicesTexture=ki.polygonEdgePrimitiveIndicesTexture,rt.vectorPolygonGridCellIndicesTexture=ki.polygonGridCellIndicesTexture,U.clone(ki.metersPerUv,rt.vectorMetersPerUv));let Nr=i.clippingPolygonData;l(Nr)&&(rt.clippingEdgeTexture=Nr.polygonEdgeTexture,rt.clippingEdgePrimitiveIndicesTexture=Nr.polygonEdgePrimitiveIndicesTexture,rt.clippingGridCellIndicesTexture=Nr.polygonGridCellIndicesTexture);let Wc=e._clippingPolygons,xd=(Nr?.polygonRings.length??0)>0,xp=l(Wc)&&Wc.enabled&&Wc.length>0&&t.isClipped&&xd;Se.numberOfDayTextures=mt,Se.applyBrightness=Zi,Se.applyContrast=Mr,Se.applyHue=fo,Se.applySaturation=Bs,Se.applyGamma=Ks,Se.applyAlpha=no,Se.applyDayNightAlpha=gi,Se.applySplit=ho,Se.enableFog=Wn,Se.enableClippingPlanes=qi,Se.clippingPlanes=Bn,Se.enableClippingPolygons=xp,Se.clippingPolygons=Wc,Se.hasImageryLayerCutout=ur,Se.colorCorrect=V,Se.highlightFillTile=Xn,Se.colorToAlpha=Zo,Se.showUndergroundColor=b,Se.translucent=d;let Nh=i.renderedMesh.indices.length;Xe||(Nh=i.renderedMesh.indexCountWithoutSkirts),ft.shaderProgram=e._surfaceShaderSet.getShaderProgram(Se),ft.pickId=i.vectorData?.show?"vectorPickColorOver(vec4(0.0))":void 0,ft.castShadows=C,ft.receiveShadows=w,ft.renderState=st,ft.primitiveType=Oe.TRIANGLES,ft.vertexArray=i.vertexArray||i.fill.vertexArray,ft.count=Nh,ft.uniformMap=Xt,ft.pass=Ie.GLOBE,e._debug.wireframe&&(p1t(Gt,t),l(i.wireframeVertexArray)&&(ft.vertexArray=i.wireframeVertexArray,ft.primitiveType=Oe.LINES,ft.count=Nh*2));let da=ft.boundingVolume,Tp=ft.orientedBoundingBox;n.mode!==re.SCENE3D?(ue.fromRectangleWithHeights2D(t.rectangle,n.mapProjection,q.minimumHeight,q.maximumHeight,da),h.fromElements(da.center.z,da.center.x,da.center.y,da.center),n.mode===re.MORPHING&&ue.union(q.boundingSphere,da,da)):(ft.boundingVolume=ue.clone(q.boundingSphere,da),ft.orientedBoundingBox=en.clone(q.boundingVolume,Tp)),ft.dirty=!0,d&&f.updateDerivedCommands(ft,n),mMe(ft,n),st=qe,vt=_1t}while(Qe<He)}var ZU=ioe;function AMe(){this._enabled=!1,this._frontFaceAlpha=1,this._frontFaceAlphaByDistance=void 0,this._backFaceAlpha=1,this._backFaceAlphaByDistance=void 0,this._rectangle=ie.clone(ie.MAX_VALUE)}Object.defineProperties(AMe.prototype,{enabled:{get:function(){return this._enabled},set:function(e){this._enabled=e}},frontFaceAlpha:{get:function(){return this._frontFaceAlpha},set:function(e){this._frontFaceAlpha=e}},frontFaceAlphaByDistance:{get:function(){return this._frontFaceAlphaByDistance},set:function(e){this._frontFaceAlphaByDistance=qt.clone(e,this._frontFaceAlphaByDistance)}},backFaceAlpha:{get:function(){return this._backFaceAlpha},set:function(e){this._backFaceAlpha=e}},backFaceAlphaByDistance:{get:function(){return this._backFaceAlphaByDistance},set:function(e){this._backFaceAlphaByDistance=qt.clone(e,this._backFaceAlphaByDistance)}},rectangle:{get:function(){return this._rectangle},set:function(e){l(e)||(e=ie.clone(ie.MAX_VALUE)),ie.clone(e,this._rectangle)}}});var QU=AMe;var roe=class{constructor(t){this._ellipsoid=new Mm(t.ellipsoid,h.ZERO)}get ellipsoid(){return this._ellipsoid}},ez=roe;var ooe=class{constructor(t){this.maxSize=t,this.cache=new Map}get(t){if(!this.cache.has(t))return;let n=this.cache.get(t);return this.cache.delete(t),this.cache.set(t,n),n}set(t,n){if(this.cache.has(t))this.cache.delete(t);else if(this.cache.size>=this.maxSize){let i=this.cache.keys().next().value;this.cache.delete(i)}this.cache.set(t,n)}get size(){return this.cache.size}clear(){this.cache.clear()}},T1t=1e3,soe=class e{constructor(t){this._tilingScheme=t.tilingScheme,this._x=t.x,this._y=t.y,this._level=t.level,this._parent=t.parent,this._rectangle=this._tilingScheme.tileXYToRectangle(this._x,this._y,this._level),this._southwestChild=void 0,this._southeastChild=void 0,this._northwestChild=void 0,this._northeastChild=void 0,this.replacementPrevious=void 0,this.replacementNext=void 0,this._distance=0,this._loadPriority=0,this._customData=new Set,this._customDataIterator=void 0,this._addedCustomData=[],this._removedCustomData=[],this._lastSelectionResult=pi.NONE,this._lastSelectionResultFrame=void 0,this._loadedCallbacks={},this._positionCache=new ooe(T1t),this.state=Ja.START,this.renderable=!1,this.upsampledFromParent=!1,this.data=void 0}static createLevelZeroTiles(t){let n=t.getNumberOfXTilesAtLevel(0),i=t.getNumberOfYTilesAtLevel(0),r=new Array(n*i),o=0;for(let s=0;s<i;++s)for(let a=0;a<n;++a)r[o++]=new e({tilingScheme:t,x:a,y:s,level:0});return r}_getCacheKey(t,n){return C1t(t.longitude,t.latitude,this._rectangle,n)}getPositionCacheEntry(t,n){return this._positionCache.get(this._getCacheKey(t,n))}setPositionCacheEntry(t,n,i){this._positionCache.set(this._getCacheKey(t,n),i)}clearPositionCache(){this._positionCache.size>0&&this._positionCache.clear()}updateCustomData(){let t=this._addedCustomData,n=this._removedCustomData;if(t.length===0&&n.length===0)return;let i=this.customData;for(let r=0;r<t.length;++r){let o=t[r];if(!l(o))continue;i.add(o);let s=bMe(this,o.positionCartographic);o._pendingAddTile=s,o._pendingAddIndex=s._addedCustomData.length,s._addedCustomData.push(o)}this._addedCustomData.length=0;for(let r=0;r<n.length;++r){let o=n[r];if(!l(o))continue;i.has(o)&&i.delete(o);let s=bMe(this,o.positionCartographic);if(o._pendingAddTile===s&&s._addedCustomData[o._pendingAddIndex]===o){s._addedCustomData[o._pendingAddIndex]=void 0,o._pendingAddTile=void 0;continue}s._removedCustomData.push(o)}this._removedCustomData.length=0}get tilingScheme(){return this._tilingScheme}get x(){return this._x}get y(){return this._y}get level(){return this._level}get parent(){return this._parent}get rectangle(){return this._rectangle}get children(){return[this.northwestChild,this.northeastChild,this.southwestChild,this.southeastChild]}get southwestChild(){return l(this._southwestChild)||(this._southwestChild=new e({tilingScheme:this.tilingScheme,x:this.x*2,y:this.y*2+1,level:this.level+1,parent:this})),this._southwestChild}get southeastChild(){return l(this._southeastChild)||(this._southeastChild=new e({tilingScheme:this.tilingScheme,x:this.x*2+1,y:this.y*2+1,level:this.level+1,parent:this})),this._southeastChild}get northwestChild(){return l(this._northwestChild)||(this._northwestChild=new e({tilingScheme:this.tilingScheme,x:this.x*2,y:this.y*2,level:this.level+1,parent:this})),this._northwestChild}get northeastChild(){return l(this._northeastChild)||(this._northeastChild=new e({tilingScheme:this.tilingScheme,x:this.x*2+1,y:this.y*2,level:this.level+1,parent:this})),this._northeastChild}get customData(){return this._customData}get needsLoading(){return this.state<Ja.DONE}get eligibleForUnloading(){let t=!0;return l(this.data)&&(t=this.data.eligibleForUnloading,l(t)||(t=!0)),t}findLevelZeroTile(t,n,i){let r=this.tilingScheme.getNumberOfXTilesAtLevel(0);if(n<0?n+=r:n>=r&&(n-=r),!(i<0||i>=this.tilingScheme.getNumberOfYTilesAtLevel(0)))return t.filter(function(o){return o.x===n&&o.y===i})[0]}findTileToWest(t){let n=this.parent;if(n===void 0)return this.findLevelZeroTile(t,this.x-1,this.y);if(n.southeastChild===this)return n.southwestChild;if(n.northeastChild===this)return n.northwestChild;let i=n.findTileToWest(t);if(i!==void 0)return n.southwestChild===this?i.southeastChild:i.northeastChild}findTileToEast(t){let n=this.parent;if(n===void 0)return this.findLevelZeroTile(t,this.x+1,this.y);if(n.southwestChild===this)return n.southeastChild;if(n.northwestChild===this)return n.northeastChild;let i=n.findTileToEast(t);if(i!==void 0)return n.southeastChild===this?i.southwestChild:i.northwestChild}findTileToSouth(t){let n=this.parent;if(n===void 0)return this.findLevelZeroTile(t,this.x,this.y+1);if(n.northwestChild===this)return n.southwestChild;if(n.northeastChild===this)return n.southeastChild;let i=n.findTileToSouth(t);if(i!==void 0)return n.southwestChild===this?i.northwestChild:i.northeastChild}findTileToNorth(t){let n=this.parent;if(n===void 0)return this.findLevelZeroTile(t,this.x,this.y-1);if(n.southwestChild===this)return n.northwestChild;if(n.southeastChild===this)return n.northeastChild;let i=n.findTileToNorth(t);if(i!==void 0)return n.northwestChild===this?i.southwestChild:i.southeastChild}freeResources(){this.clearPositionCache(),this.state=Ja.START,this.renderable=!1,this.upsampledFromParent=!1;let t=this.data;l(t)&&l(t.freeResources)&&t.freeResources(),T7(this._southwestChild),this._southwestChild=void 0,T7(this._southeastChild),this._southeastChild=void 0,T7(this._northwestChild),this._northwestChild=void 0,T7(this._northeastChild),this._northeastChild=void 0}},E1t=256;function C1t(e,t,n,i){let r=n.width/E1t*i,o=Math.floor(e/r)*r,s=Math.floor(t/r)*r;return`${o.toFixed(10)},${s.toFixed(10)}`}var v1t=new he;function bMe(e,t){let n=e.northwestChild.rectangle,i=ie.southeast(n,v1t),r=t.longitude>=i.longitude?1:0;switch((t.latitude<i.latitude?1:0)*2+r){case 0:return e.northwestChild;case 1:return e.northeastChild;case 2:return e.southwestChild;default:return e.southeastChild}}function T7(e){l(e)&&e.freeResources()}var tz=soe;function E7(){this.head=void 0,this.tail=void 0,this.count=0,this._lastBeforeStartOfFrame=void 0}E7.prototype.markStartOfRenderFrame=function(){this._lastBeforeStartOfFrame=this.head};E7.prototype.trimTiles=function(e){let t=this.tail,n=!0;for(;n&&l(this._lastBeforeStartOfFrame)&&this.count>e&&l(t);){n=t!==this._lastBeforeStartOfFrame;let i=t.replacementPrevious;t.eligibleForUnloading&&(t.freeResources(),xMe(this,t)),t=i}};function xMe(e,t){let n=t.replacementPrevious,i=t.replacementNext;t===e._lastBeforeStartOfFrame&&(e._lastBeforeStartOfFrame=i),t===e.head?e.head=i:n.replacementNext=i,t===e.tail?e.tail=n:i.replacementPrevious=n,t.replacementPrevious=void 0,t.replacementNext=void 0,--e.count}E7.prototype.markTileRendered=function(e){let t=this.head;if(t===e){e===this._lastBeforeStartOfFrame&&(this._lastBeforeStartOfFrame=e.replacementNext);return}if(++this.count,!l(t)){e.replacementPrevious=void 0,e.replacementNext=void 0,this.head=e,this.tail=e;return}(l(e.replacementPrevious)||l(e.replacementNext))&&xMe(this,e),e.replacementPrevious=void 0,e.replacementNext=t,t.replacementPrevious=e,this.head=e};var nz=E7;function Ch(e){this._tileProvider=e.tileProvider,this._tileProvider.quadtree=this,this._debug={enableDebugOutput:!1,maxDepth:0,maxDepthVisited:0,tilesVisited:0,tilesCulled:0,tilesRendered:0,tilesWaitingForChildren:0,lastMaxDepth:-1,lastMaxDepthVisited:-1,lastTilesVisited:-1,lastTilesCulled:-1,lastTilesRendered:-1,lastTilesWaitingForChildren:-1,suspendLodUpdate:!1};let n=this._tileProvider.tilingScheme.ellipsoid;this._tilesRenderedThisFrame=new Set,this._tilesToRender=[],this._tileLoadQueueHigh=[],this._tileLoadQueueMedium=[],this._tileLoadQueueLow=[],this._tileReplacementQueue=new nz,this._levelZeroTiles=void 0,this._loadQueueTimeSlice=5,this._tilesInvalidated=!1,this._addHeightCallbacks=[],this._removeHeightCallbacks=[],this._tileToUpdateHeights=[],this._updateHeightsTimeSlice=2,this._cameraPositionCartographic=void 0,this._cameraReferenceFrameOriginCartographic=void 0,this.maximumScreenSpaceError=e.maximumScreenSpaceError??2,this.tileCacheSize=e.tileCacheSize??100,this.loadingDescendantLimit=20,this.preloadAncestors=!0,this.preloadSiblings=!1,this._occluders=new ez({ellipsoid:n}),this._tileLoadProgressEvent=new be,this._lastTileLoadQueueLength=0,this._lastSelectionFrameNumber=void 0}Object.defineProperties(Ch.prototype,{tileProvider:{get:function(){return this._tileProvider}},tileLoadProgressEvent:{get:function(){return this._tileLoadProgressEvent}},occluders:{get:function(){return this._occluders}}});Ch.prototype.invalidateAllTiles=function(){this._tilesInvalidated=!0};function S1t(e){let t=e._tileReplacementQueue;t.head=void 0,t.tail=void 0,t.count=0,EMe(e);let n=e._levelZeroTiles;if(l(n))for(let i=0;i<n.length;++i){let o=n[i].customData;for(let s of o)s.level=0,e._addHeightCallbacks.push(s);n[i].freeResources()}e._levelZeroTiles=void 0,e._tileProvider.cancelReprojections()}Ch.prototype.forEachLoadedTile=function(e){let t=this._tileReplacementQueue.head;for(;l(t);)t.state!==Ja.START&&e(t),t=t.replacementNext};Ch.prototype.forEachRenderedTile=function(e){let t=this._tilesRenderedThisFrame;for(let n of t)e(n)};Ch.prototype.updateHeight=function(e,t){let n=this,i={positionOnEllipsoidSurface:void 0,positionCartographic:e,level:-1,callback:t};return i.removeFunc=function(){let r=n._addHeightCallbacks,o=r.length,s=!1;for(let a=0;a<o;++a)if(r[a]===i){r.splice(a,1),s=!0;break}s||n._removeHeightCallbacks.push(i),i.callback&&(i.callback=void 0)},n._addHeightCallbacks.push(i),i.removeFunc};Ch.prototype.update=function(e){l(this._tileProvider.update)&&this._tileProvider.update(e)};function EMe(e){let t=e._debug;t.maxDepth=0,t.maxDepthVisited=0,t.tilesVisited=0,t.tilesCulled=0,t.tilesRendered=0,t.tilesWaitingForChildren=0,e._tileLoadQueueHigh.length=0,e._tileLoadQueueMedium.length=0,e._tileLoadQueueLow.length=0}Ch.prototype.beginFrame=function(e){e.passes.render&&(this._tilesInvalidated&&(S1t(this),this._tilesInvalidated=!1),this._tileProvider.initialize(e),EMe(this),!this._debug.suspendLodUpdate&&(this._tileReplacementQueue.markStartOfRenderFrame(),this._tilesRenderedThisFrame.clear()))};Ch.prototype.render=function(e){let t=e.passes,n=this._tileProvider;t.render&&(n.beginUpdate(e),D1t(this,e),z1t(this,e),n.endUpdate(e)),t.pick&&this._tilesToRender.length>0&&n.updateForPick(e)};function w1t(e,t){let n=e._tileLoadQueueHigh.length+e._tileLoadQueueMedium.length+e._tileLoadQueueLow.length;if(n!==e._lastTileLoadQueueLength||e._tilesInvalidated){let r=be.prototype.raiseEvent.bind(e._tileLoadProgressEvent,n);t.afterRender.push(()=>(r(),!0)),e._lastTileLoadQueueLength=n}let i=e._debug;i.enableDebugOutput&&!i.suspendLodUpdate&&(i.maxDepth=e._tilesToRender.reduce(function(r,o){return Math.max(r,o.level)},-1),i.tilesRendered=e._tilesToRender.length,(i.tilesVisited!==i.lastTilesVisited||i.tilesRendered!==i.lastTilesRendered||i.tilesCulled!==i.lastTilesCulled||i.maxDepth!==i.lastMaxDepth||i.tilesWaitingForChildren!==i.lastTilesWaitingForChildren||i.maxDepthVisited!==i.lastMaxDepthVisited)&&(console.log(`Visited ${i.tilesVisited}, Rendered: ${i.tilesRendered}, Culled: ${i.tilesCulled}, Max Depth Rendered: ${i.maxDepth}, Max Depth Visited: ${i.maxDepthVisited}, Waiting for children: ${i.tilesWaitingForChildren}`),i.lastTilesVisited=i.tilesVisited,i.lastTilesRendered=i.tilesRendered,i.lastTilesCulled=i.tilesCulled,i.lastMaxDepth=i.maxDepth,i.lastTilesWaitingForChildren=i.tilesWaitingForChildren,i.lastMaxDepthVisited=i.maxDepthVisited))}Ch.prototype.endFrame=function(e){!e.passes.render||e.mode===re.MORPHING||(F1t(this,e),U1t(this,e),w1t(this,e))};Ch.prototype.isDestroyed=function(){return!1};Ch.prototype.destroy=function(){this._tileProvider=this._tileProvider&&this._tileProvider.destroy()};var rz,TMe=new he;function I1t(e,t){let n=ie.center(e.rectangle,TMe),i=n.longitude-rz.longitude,r=n.latitude-rz.latitude;n=ie.center(t.rectangle,TMe);let o=n.longitude-rz.longitude,s=n.latitude-rz.latitude;return i*i+r*r-(o*o+s*s)}var P1t=new h,iz=[];function D1t(e,t){let n=e._debug;if(n.suspendLodUpdate)return;let i=e._tilesToRender;i.length=0;let r=e._tileProvider;if(!l(e._levelZeroTiles)){let d=r.tilingScheme;if(l(d)){let p=r.tilingScheme;e._levelZeroTiles=tz.createLevelZeroTiles(p);let g=e._levelZeroTiles.length;if(iz.length<g){iz=new Array(g);for(let m=0;m<g;++m)iz[m]===void 0&&(iz[m]=new oz)}}else return}e._occluders.ellipsoid.cameraPosition=t.camera.positionWC;let o=e._levelZeroTiles,s=o.length>1?e._occluders:void 0;rz=t.camera.positionCartographic,o.sort(I1t);let a=e._addHeightCallbacks,c=e._removeHeightCallbacks;a.forEach(d=>{let p=o.find(g=>ie.contains(g.rectangle,d.positionCartographic));p&&p._addedCustomData.push(d)}),c.forEach(d=>{let p=o.find(g=>ie.contains(g.rectangle,d.positionCartographic));p&&p._removedCustomData.push(d)}),o.forEach(d=>d.updateCustomData()),a.length=0,c.length=0;let u=t.camera;e._cameraPositionCartographic=u.positionCartographic;let f=N.getTranslation(u.transform,P1t);e._cameraReferenceFrameOriginCartographic=e.tileProvider.tilingScheme.ellipsoid.cartesianToCartographic(f,e._cameraReferenceFrameOriginCartographic);for(let d=0;d<o.length;++d){let p=o[d];e._tileReplacementQueue.markTileRendered(p),p.renderable?Hc(e,p,r,t,s,!1,iz[d]):(ty(e,e._tileLoadQueueHigh,p,t),++n.tilesWaitingForChildren)}e._lastSelectionFrameNumber=t.frameNumber}function ty(e,t,n,i){n.needsLoading&&(e.tileProvider.computeTileLoadPriority!==void 0&&(n._loadPriority=e.tileProvider.computeTileLoadPriority(n,i)),t.push(n))}function oz(){this.allAreRenderable=!0,this.anyWereRenderedLastFrame=!1,this.notYetRenderableCount=0}function CMe(){this.southwest=new oz,this.southeast=new oz,this.northwest=new oz,this.northeast=new oz}CMe.prototype.combine=function(e){let t=this.southwest,n=this.southeast,i=this.northwest,r=this.northeast;e.allAreRenderable=t.allAreRenderable&&n.allAreRenderable&&i.allAreRenderable&&r.allAreRenderable,e.anyWereRenderedLastFrame=t.anyWereRenderedLastFrame||n.anyWereRenderedLastFrame||i.anyWereRenderedLastFrame||r.anyWereRenderedLastFrame,e.notYetRenderableCount=t.notYetRenderableCount+n.notYetRenderableCount+i.notYetRenderableCount+r.notYetRenderableCount};var coe=new Array(31);for(let e=0;e<coe.length;++e)coe[e]=new CMe;function R1t(e,t,n,i,r){let o=e._debug;++o.tilesVisited,e._tileReplacementQueue.markTileRendered(n),n.updateCustomData(),n.level>o.maxDepthVisited&&(o.maxDepthVisited=n.level);let s=N1t(e,t,n)<e.maximumScreenSpaceError,a=n.southwestChild,c=n.southeastChild,u=n.northwestChild,f=n.northeastChild,d=e._lastSelectionFrameNumber,p=n._lastSelectionResultFrame===d?n._lastSelectionResult:pi.NONE,g=e.tileProvider;if(s||i){let m=pi.originalResult(p)===pi.RENDERED,y=pi.originalResult(p)===pi.CULLED||p===pi.NONE,A=n.state===Ja.DONE,b=m||y||A;if(b||l(g.canRenderWithoutLosingDetail)&&(b=g.canRenderWithoutLosingDetail(n)),b){s&&ty(e,e._tileLoadQueueMedium,n,t),C7(e,n),r.allAreRenderable=n.renderable,r.anyWereRenderedLastFrame=p===pi.RENDERED,r.notYetRenderableCount=n.renderable?0:1,n._lastSelectionResultFrame=t.frameNumber,n._lastSelectionResult=pi.RENDERED,r.anyWereRenderedLastFrame||e._tileToUpdateHeights.push(n);return}i=!0,s&&ty(e,e._tileLoadQueueHigh,n,t)}if(g.canRefine(n)){if(a.upsampledFromParent&&c.upsampledFromParent&&u.upsampledFromParent&&f.upsampledFromParent){C7(e,n),ty(e,e._tileLoadQueueMedium,n,t),e._tileReplacementQueue.markTileRendered(a),e._tileReplacementQueue.markTileRendered(c),e._tileReplacementQueue.markTileRendered(u),e._tileReplacementQueue.markTileRendered(f),r.allAreRenderable=n.renderable,r.anyWereRenderedLastFrame=p===pi.RENDERED,r.notYetRenderableCount=n.renderable?0:1,n._lastSelectionResultFrame=t.frameNumber,n._lastSelectionResult=pi.RENDERED,r.anyWereRenderedLastFrame||e._tileToUpdateHeights.push(n);return}n._lastSelectionResultFrame=t.frameNumber,n._lastSelectionResult=pi.REFINED;let y=e._tilesToRender.length,A=e._tileLoadQueueLow.length,b=e._tileLoadQueueMedium.length,x=e._tileLoadQueueHigh.length,T=e._tileToUpdateHeights.length;if(O1t(e,a,c,u,f,t,i,r),y!==e._tilesToRender.length){let E=r.allAreRenderable,v=r.anyWereRenderedLastFrame,S=r.notYetRenderableCount,I=!1;if(!E&&!v){let R=e._tilesToRender;for(let L=y;L<R.length;++L){let _=R[L];for(;_!==void 0&&_._lastSelectionResult!==pi.KICKED&&_!==n;)_._lastSelectionResult=pi.kick(_._lastSelectionResult),_=_.parent}e._tilesToRender.length=y,e._tileToUpdateHeights.length=T,C7(e,n),n._lastSelectionResult=pi.RENDERED;let O=p===pi.RENDERED;!O&&S>e.loadingDescendantLimit&&(e._tileLoadQueueLow.length=A,e._tileLoadQueueMedium.length=b,e._tileLoadQueueHigh.length=x,ty(e,e._tileLoadQueueMedium,n,t),r.notYetRenderableCount=n.renderable?0:1,I=!0),r.allAreRenderable=n.renderable,r.anyWereRenderedLastFrame=O,O||e._tileToUpdateHeights.push(n),++o.tilesWaitingForChildren}e.preloadAncestors&&!I&&ty(e,e._tileLoadQueueLow,n,t)}return}n._lastSelectionResultFrame=t.frameNumber,n._lastSelectionResult=pi.RENDERED,C7(e,n),ty(e,e._tileLoadQueueHigh,n,t),r.allAreRenderable=n.renderable,r.anyWereRenderedLastFrame=p===pi.RENDERED,r.notYetRenderableCount=n.renderable?0:1}function O1t(e,t,n,i,r,o,s,a){let c=o.camera.positionCartographic,u=e._tileProvider,f=e._occluders,d=coe[t.level],p=d.southwest,g=d.southeast,m=d.northwest,y=d.northeast;c.longitude<t.rectangle.east?c.latitude<t.rectangle.north?(Hc(e,t,u,o,f,s,p),Hc(e,n,u,o,f,s,g),Hc(e,i,u,o,f,s,m),Hc(e,r,u,o,f,s,y)):(Hc(e,i,u,o,f,s,m),Hc(e,t,u,o,f,s,p),Hc(e,r,u,o,f,s,y),Hc(e,n,u,o,f,s,g)):c.latitude<t.rectangle.north?(Hc(e,n,u,o,f,s,g),Hc(e,t,u,o,f,s,p),Hc(e,r,u,o,f,s,y),Hc(e,i,u,o,f,s,m)):(Hc(e,r,u,o,f,s,y),Hc(e,i,u,o,f,s,m),Hc(e,n,u,o,f,s,g),Hc(e,t,u,o,f,s,p)),d.combine(a)}function M1t(e,t){let n=t.rectangle;return l(e._cameraPositionCartographic)&&ie.contains(n,e._cameraPositionCartographic)||l(e._cameraReferenceFrameOriginCartographic)&&ie.contains(n,e._cameraReferenceFrameOriginCartographic)}function Hc(e,t,n,i,r,o,s){if(n.computeTileVisibility(t,i,r)!==$o.NONE)return R1t(e,i,t,o,s);if(++e._debug.tilesCulled,e._tileReplacementQueue.markTileRendered(t),s.allAreRenderable=!0,s.anyWereRenderedLastFrame=!1,s.notYetRenderableCount=0,M1t(e,t)){(!l(t.data)||!l(t.data.vertexArray))&&ty(e,e._tileLoadQueueMedium,t,i);let a=e._lastSelectionFrameNumber,c=t._lastSelectionResultFrame===a?t._lastSelectionResult:pi.NONE;c!==pi.CULLED_BUT_NEEDED&&c!==pi.RENDERED&&e._tileToUpdateHeights.push(t),t._lastSelectionResult=pi.CULLED_BUT_NEEDED}else e.preloadSiblings||t.level===0?(ty(e,e._tileLoadQueueLow,t,i),t._lastSelectionResult=pi.CULLED):t._lastSelectionResult=pi.CULLED;t._lastSelectionResultFrame=i.frameNumber}function N1t(e,t,n){if(t.mode===re.SCENE2D||t.camera.frustum instanceof gn||t.camera.frustum instanceof ys)return L1t(e,t,n);let i=e._tileProvider.getLevelMaximumGeometricError(n.level),r=n._distance,o=t.context.drawingBufferHeight,s=t.camera.frustum.sseDenominator,a=i*o/(r*s);return t.fog.enabled&&(a-=D.fog(r,t.fog.density)*t.fog.sse),a/=t.pixelRatio,a}function L1t(e,t,n){let r=t.camera.frustum,o=r.offCenterFrustum;l(o)&&(r=o);let s=t.context,a=s.drawingBufferWidth,c=s.drawingBufferHeight,u=e._tileProvider.getLevelMaximumGeometricError(n.level),f=Math.max(r.top-r.bottom,r.right-r.left)/Math.max(a,c),d=u/f;return t.fog.enabled&&t.mode!==re.SCENE2D&&(d-=D.fog(n._distance,t.fog.density)*t.fog.sse),d/=t.pixelRatio,d}function C7(e,t){e._tilesToRender.push(t),e._tilesRenderedThisFrame.add(t)}function F1t(e,t){let n=e._tileLoadQueueHigh,i=e._tileLoadQueueMedium,r=e._tileLoadQueueLow;if(n.length===0&&i.length===0&&r.length===0)return;e._tileReplacementQueue.trimTiles(e.tileCacheSize);let o=xn()+e._loadQueueTimeSlice,s=e._tileProvider,a=aoe(e,t,s,o,n,!1);a=aoe(e,t,s,o,i,a),aoe(e,t,s,o,r,a)}function B1t(e,t){return e._loadPriority-t._loadPriority}function aoe(e,t,n,i,r,o){n.computeTileLoadPriority!==void 0&&r.sort(B1t);for(let s=0,a=r.length;s<a&&(xn()<i||!o);++s){let c=r[s];e._tileReplacementQueue.markTileRendered(c),n.loadTile(t,c),o=!0}return o}var pP=new pn,v7=new he,Cb=new h,k1t=[];function U1t(e,t){if(!l(e.tileProvider.tilingScheme))return;let n=k1t;n.length=0;let i=e._tileToUpdateHeights,r=xn(),o=e._updateHeightsTimeSlice,s=r+o,a=t.mode,c=t.mapProjection,u=e.tileProvider.tilingScheme.ellipsoid,f;for(;i.length>0;){let d=i[0];if(!l(d.data)||!l(d.data.mesh)){let A=d._lastSelectionResultFrame===e._lastSelectionFrameNumber?d._lastSelectionResult:pi.NONE;(A===pi.RENDERED||A===pi.CULLED_BUT_NEEDED)&&n.push(d),d.clearPositionCache(),i.shift();continue}let p=d.customData;l(d._customDataIterator)||(d._customDataIterator=p.values());let g=d._customDataIterator,m=!1,y;for(;!(y=g.next()).done;){let A=y.value,b=d.data.terrainData,x=l(b)&&b.wasCreatedByUpsampling();if(d.level>A.level&&!x){let T,E=d.getPositionCacheEntry(A.positionCartographic,e.maximumScreenSpaceError);if(l(E))T=E;else{if(l(A.positionOnEllipsoidSurface)||(A.positionOnEllipsoidSurface=h.fromRadians(A.positionCartographic.longitude,A.positionCartographic.latitude,0,u)),a===re.SCENE3D){let v=u.geodeticSurfaceNormal(A.positionOnEllipsoidSurface,pP.direction),S=u.getSurfaceNormalIntersectionWithZAxis(A.positionOnEllipsoidSurface,11500,pP.origin);if(!l(S)){let I=0;l(d.data.tileBoundingRegion)&&(I=d.data.tileBoundingRegion.minimumHeight);let R=Math.min(I,-11500),O=h.multiplyByScalar(v,Math.abs(R)+1,Cb);h.subtract(A.positionOnEllipsoidSurface,O,pP.origin)}}else he.clone(A.positionCartographic,v7),v7.height=-11500,c.project(v7,Cb),h.fromElements(Cb.z,Cb.x,Cb.y,Cb),h.clone(Cb,pP.origin),h.clone(h.UNIT_X,pP.direction);T=d.data.pick(pP,a,c,!1,Cb),l(T)&&d.setPositionCacheEntry(A.positionCartographic,e.maximumScreenSpaceError,h.clone(T))}if(l(T)){if(l(A.callback)){let v=u.cartesianToCartographic(T,v7);A.callback(v)}A.level=d.level}}if(xn()>=s){m=!0;break}}if(m){d._customDataIterator=g;break}else d._customDataIterator=void 0,i.shift()}for(f=0;f<n.length;f++)i.push(n[f])}function z1t(e,t){let n=e._tileProvider,i=e._tilesToRender;for(let r=0,o=i.length;r<o;++r){let s=i[r];n.showTileThisFrame(s,t)}}var sz=Ch;function tp(e){e=e??ee.default;let t=new O0({ellipsoid:e}),n=new ZT,i=new f_({tilingScheme:t.tilingScheme});this._ellipsoid=e,this._imageryLayerCollection=n,this._surfaceShaderSet=new $U,this._material=void 0,this._surface=new sz({tileProvider:new ZU({terrainProvider:t,imageryLayers:n,surfaceShaderSet:this._surfaceShaderSet,vectorProvider:i})}),this._terrainProvider=t,this._terrainProviderChanged=new be,this._vectorProvider=i,this._undergroundColor=z.clone(z.BLACK),this._undergroundColorAlphaByDistance=new qt(e.maximumRadius/1e3,0,e.maximumRadius/5,1),this._translucency=new QU,uoe(this),this.show=!0,this._oceanNormalMapResourceDirty=!0,this._oceanNormalMapResource=new De({url:Zt("Assets/Textures/waterNormalsSmall.jpg")}),this.maximumScreenSpaceError=2,this.tileCacheSize=100,this.loadingDescendantLimit=20,this.preloadAncestors=!0,this.preloadSiblings=!1,this.fillHighlightColor=void 0,this.enableLighting=!1,this.lambertDiffuseMultiplier=.9,this.dynamicAtmosphereLighting=!0,this.dynamicAtmosphereLightingFromSun=!1,this.showGroundAtmosphere=ee.WGS84.equals(e),this.atmosphereLightIntensity=10,this.atmosphereRayleighCoefficient=new h(55e-7,13e-6,284e-7),this.atmosphereMieCoefficient=new h(21e-6,21e-6,21e-6),this.atmosphereRayleighScaleHeight=1e4,this.atmosphereMieScaleHeight=3200,this.atmosphereMieAnisotropy=.9,this.lightingFadeOutDistance=D.PI_OVER_TWO*e.minimumRadius,this.lightingFadeInDistance=D.PI*e.minimumRadius,this.nightFadeOutDistance=D.PI_OVER_TWO*e.minimumRadius,this.nightFadeInDistance=5*D.PI_OVER_TWO*e.minimumRadius,this.showWaterEffect=!0,this.depthTestAgainstTerrain=!1,this.shadows=Dn.RECEIVE_ONLY,this.atmosphereHueShift=0,this.atmosphereSaturationShift=0,this.atmosphereBrightnessShift=0,this.showSkirts=!0,this.backFaceCulling=!0,this._oceanNormalMap=void 0,this._zoomedOutOceanSpecularIntensity=void 0,this.vertexShadowDarkness=.3}Object.defineProperties(tp.prototype,{ellipsoid:{get:function(){return this._ellipsoid}},imageryLayers:{get:function(){return this._imageryLayerCollection}},imageryLayersUpdatedEvent:{get:function(){return this._surface.tileProvider.imageryLayersUpdatedEvent}},tilesLoaded:{get:function(){return l(this._surface)?this._surface._tileLoadQueueHigh.length===0&&this._surface._tileLoadQueueMedium.length===0&&this._surface._tileLoadQueueLow.length===0:!0}},baseColor:{get:function(){return this._surface.tileProvider.baseColor},set:function(e){this._surface.tileProvider.baseColor=e}},clippingPlanes:{get:function(){return this._surface.tileProvider.clippingPlanes},set:function(e){this._surface.tileProvider.clippingPlanes=e}},clippingPolygons:{get:function(){return this._surface.tileProvider.clippingPolygons},set:function(e){this._surface.tileProvider.clippingPolygons=e}},cartographicLimitRectangle:{get:function(){return this._surface.tileProvider.cartographicLimitRectangle},set:function(e){l(e)||(e=ie.clone(ie.MAX_VALUE)),this._surface.tileProvider.cartographicLimitRectangle=e}},oceanNormalMapUrl:{get:function(){return this._oceanNormalMapResource.url},set:function(e){this._oceanNormalMapResource.url=e,this._oceanNormalMapResourceDirty=!0}},terrainProvider:{get:function(){return this._terrainProvider},set:function(e){e!==this._terrainProvider&&(this._terrainProvider=e,l(e)&&(this._vectorProvider.tilingScheme=e.tilingScheme),this._terrainProviderChanged.raiseEvent(e),l(this._material)&&uoe(this))}},terrainProviderChanged:{get:function(){return this._terrainProviderChanged}},vectorProvider:{get:function(){return this._vectorProvider}},tileLoadProgressEvent:{get:function(){return this._surface.tileLoadProgressEvent}},material:{get:function(){return this._material},set:function(e){this._material!==e&&(this._material=e,uoe(this))}},undergroundColor:{get:function(){return this._undergroundColor},set:function(e){this._undergroundColor=z.clone(e,this._undergroundColor)}},undergroundColorAlphaByDistance:{get:function(){return this._undergroundColorAlphaByDistance},set:function(e){this._undergroundColorAlphaByDistance=qt.clone(e,this._undergroundColorAlphaByDistance)}},translucency:{get:function(){return this._translucency}}});function uoe(e){let t=[],n=l(e._material)&&(l(e._material.shaderSource.match(/slope/))||l(e._material.shaderSource.match("normalEC"))),i=[Yh,Pv];l(e._material)&&(!n||e._terrainProvider.hasVertexNormals)?(i.push(e._material.shaderSource),t.push("APPLY_MATERIAL"),e._surface._tileProvider.materialUniformMap=e._material._uniforms):e._surface._tileProvider.materialUniformMap=void 0,i.push(sM),e._surfaceShaderSet.baseVertexShaderSource=new Ye({sources:[Yh,Pv,aM],defines:t}),e._surfaceShaderSet.baseFragmentShaderSource=new Ye({sources:i,defines:t}),e._surfaceShaderSet.material=e._material}function V1t(e){return function(t,n){let i=ue.distanceSquaredTo(t.pickBoundingSphere,e),r=ue.distanceSquaredTo(n.pickBoundingSphere,e);return i-r}}var j1t=[],H1t={start:0,stop:0};tp.prototype.pickWorldCoordinates=function(e,t,n,i){n=n??!0;let r=t.mode,o=t.mapProjection,s=j1t;s.length=0;for(let u of this._surface._tilesRenderedThisFrame){let f=u.data;if(!l(f))continue;let d=f.pickBoundingSphere;if(r!==re.SCENE3D)f.pickBoundingSphere=d=ue.fromRectangleWithHeights2D(u.rectangle,o,f.tileBoundingRegion.minimumHeight,f.tileBoundingRegion.maximumHeight,d),h.fromElements(d.center.z,d.center.x,d.center.y,d.center);else if(l(f.renderedMesh))ue.clone(f.tileBoundingRegion.boundingSphere,d);else continue;let p=_i.raySphere(e,d,H1t);l(p)&&s.push(f)}s.sort(V1t(e.origin));let a,c=s.length;for(let u=0;u<c&&(a=s[u].pick(e,t.mode,t.mapProjection,n,i),!l(a));++u);return a};var G1t=new he;tp.prototype.pick=function(e,t,n){if(n=this.pickWorldCoordinates(e,t,!0,n),l(n)&&t.mode!==re.SCENE3D){n=h.fromElements(n.y,n.z,n.x,n);let i=t.mapProjection.unproject(n,G1t);n=this._ellipsoid.cartographicToCartesian(i,n)}return n};var W1t=new h,vMe=new h,q1t=new he,Y1t=new pn;function loe(e,t){return l(e)&&ie.contains(e.rectangle,t)?e:void 0}tp.prototype.getHeight=function(e){let t=this._surface._levelZeroTiles;if(!l(t))return;let n,i,r=t.length;for(i=0;i<r&&(n=t[i],!ie.contains(n.rectangle,e));++i);if(i>=r)return;let o=n;for(;l(n);)n=loe(n._southwestChild,e)||loe(n._southeastChild,e)||loe(n._northwestChild,e)||n._northeastChild,l(n)&&l(n.data)&&l(n.data.renderedMesh)&&(o=n);if(n=o,!l(n)||!l(n.data)||!l(n.data.renderedMesh))return;let s=this._surface._tileProvider.tilingScheme.projection,a=this._surface._tileProvider.tilingScheme.ellipsoid,c=h.fromRadians(e.longitude,e.latitude,0,a,W1t),u=Y1t,f=a.geodeticSurfaceNormal(c,u.direction),d=a.getSurfaceNormalIntersectionWithZAxis(c,11500,u.origin);if(!l(d)){let g;l(n.data.tileBoundingRegion)&&(g=n.data.tileBoundingRegion.minimumHeight);let m=Math.min(g??0,-11500),y=h.multiplyByScalar(f,Math.abs(m)+1,vMe);h.subtract(c,y,u.origin)}let p=n.data.pick(u,re.SCENE3D,s,!1,vMe);if(l(p))return a.cartesianToCartographic(p,q1t).height};tp.prototype.update=function(e){this.show&&e.passes.render&&this._surface.update(e)};tp.prototype.beginFrame=function(e){let t=this._surface,n=t.tileProvider,i=this.terrainProvider,r=l(i)&&i.hasWaterMask&&i.hasWaterMask;if(r&&this._oceanNormalMapResourceDirty){this._oceanNormalMapResourceDirty=!1;let a=this._oceanNormalMapResource,c=a.url;if(l(c)){let u=this;a.fetchImage().then(function(f){c===u._oceanNormalMapResource.url&&(u._oceanNormalMap=u._oceanNormalMap&&u._oceanNormalMap.destroy(),u._oceanNormalMap=new Dt({context:e.context,source:f}))})}else this._oceanNormalMap=this._oceanNormalMap&&this._oceanNormalMap.destroy()}let o=e.passes,s=e.mode;o.render&&(this.showGroundAtmosphere?this._zoomedOutOceanSpecularIntensity=.4:this._zoomedOutOceanSpecularIntensity=.5,t.maximumScreenSpaceError=this.maximumScreenSpaceError,t.tileCacheSize=this.tileCacheSize,t.loadingDescendantLimit=this.loadingDescendantLimit,t.preloadAncestors=this.preloadAncestors,t.preloadSiblings=this.preloadSiblings,n.terrainProvider=this.terrainProvider,n.lightingFadeOutDistance=this.lightingFadeOutDistance,n.lightingFadeInDistance=this.lightingFadeInDistance,n.nightFadeOutDistance=this.nightFadeOutDistance,n.nightFadeInDistance=this.nightFadeInDistance,n.zoomedOutOceanSpecularIntensity=s===re.SCENE3D?this._zoomedOutOceanSpecularIntensity:0,n.hasWaterMask=r,n.showWaterEffect=this.showWaterEffect,n.oceanNormalMap=this._oceanNormalMap,n.enableLighting=this.enableLighting,n.dynamicAtmosphereLighting=this.dynamicAtmosphereLighting,n.dynamicAtmosphereLightingFromSun=this.dynamicAtmosphereLightingFromSun,n.showGroundAtmosphere=this.showGroundAtmosphere,n.atmosphereLightIntensity=this.atmosphereLightIntensity,n.atmosphereRayleighCoefficient=this.atmosphereRayleighCoefficient,n.atmosphereMieCoefficient=this.atmosphereMieCoefficient,n.atmosphereRayleighScaleHeight=this.atmosphereRayleighScaleHeight,n.atmosphereMieScaleHeight=this.atmosphereMieScaleHeight,n.atmosphereMieAnisotropy=this.atmosphereMieAnisotropy,n.shadows=this.shadows,n.hueShift=this.atmosphereHueShift,n.saturationShift=this.atmosphereSaturationShift,n.brightnessShift=this.atmosphereBrightnessShift,n.fillHighlightColor=this.fillHighlightColor,n.showSkirts=this.showSkirts,n.backFaceCulling=this.backFaceCulling,n.vertexShadowDarkness=this.vertexShadowDarkness,n.undergroundColor=this._undergroundColor,n.undergroundColorAlphaByDistance=this._undergroundColorAlphaByDistance,n.lambertDiffuseMultiplier=this.lambertDiffuseMultiplier,t.beginFrame(e))};tp.prototype.render=function(e){this.show&&(l(this._material)&&this._material.update(e.context),this._surface.render(e))};tp.prototype.endFrame=function(e){this.show&&e.passes.render&&this._surface.endFrame(e)};tp.prototype.isDestroyed=function(){return!1};tp.prototype.destroy=function(){return this._surfaceShaderSet=this._surfaceShaderSet&&this._surfaceShaderSet.destroy(),this._surface=this._surface&&this._surface.destroy(),this._oceanNormalMap=this._oceanNormalMap&&this._oceanNormalMap.destroy(),le(this)};var az=tp;function X1t(e,t,n,i){this.rightAscension=e,this.declination=t,this.rotation=n,this.rotationRate=i}var cz=X1t;var UMe={},K1t=32.184,$1t=2451545,SMe=-.0529921,wMe=-.1059842,IMe=13.0120009,PMe=13.3407154,DMe=.9856003,RMe=26.4057084,OMe=13.064993,MMe=.3287146,NMe=1.7484877,LMe=-.1589763,FMe=.0036096,BMe=.1643573,kMe=12.9590088,foe=new K;UMe.ComputeMoon=function(e,t){l(e)||(e=K.now()),foe=K.addSeconds(e,K1t,foe);let n=K.totalDays(foe)-$1t,i=n/kn.DAYS_PER_JULIAN_CENTURY,r=(125.045+SMe*n)*D.RADIANS_PER_DEGREE,o=(250.089+wMe*n)*D.RADIANS_PER_DEGREE,s=(260.008+IMe*n)*D.RADIANS_PER_DEGREE,a=(176.625+PMe*n)*D.RADIANS_PER_DEGREE,c=(357.529+DMe*n)*D.RADIANS_PER_DEGREE,u=(311.589+RMe*n)*D.RADIANS_PER_DEGREE,f=(134.963+OMe*n)*D.RADIANS_PER_DEGREE,d=(276.617+MMe*n)*D.RADIANS_PER_DEGREE,p=(34.226+NMe*n)*D.RADIANS_PER_DEGREE,g=(15.134+LMe*n)*D.RADIANS_PER_DEGREE,m=(119.743+FMe*n)*D.RADIANS_PER_DEGREE,y=(239.961+BMe*n)*D.RADIANS_PER_DEGREE,A=(25.053+kMe*n)*D.RADIANS_PER_DEGREE,b=Math.sin(r),x=Math.sin(o),T=Math.sin(s),E=Math.sin(a),v=Math.sin(c),S=Math.sin(u),I=Math.sin(f),R=Math.sin(d),O=Math.sin(p),L=Math.sin(g),_=Math.sin(m),C=Math.sin(y),w=Math.sin(A),P=Math.cos(r),M=Math.cos(o),F=Math.cos(s),V=Math.cos(a),B=Math.cos(c),j=Math.cos(u),k=Math.cos(f),G=Math.cos(d),q=Math.cos(p),Q=Math.cos(g),W=Math.cos(m),J=Math.cos(y),Z=Math.cos(A),ae=(269.9949+.0031*i-3.8787*b-.1204*x+.07*T-.0172*E+.0072*S-.0052*L+.0043*w)*D.RADIANS_PER_DEGREE,Ae=(66.5392+.013*i+1.5419*P+.0239*M-.0278*F+.0068*V-.0029*j+9e-4*k+8e-4*Q-9e-4*Z)*D.RADIANS_PER_DEGREE,fe=(38.3213+13.17635815*n-14e-13*n*n+3.561*b+.1208*x-.0642*T+.0158*E+.0252*v-.0066*S-.0047*I-.0046*R+.0028*O+.0052*L+.004*_+.0019*C-.0044*w)*D.RADIANS_PER_DEGREE,xe=(13.17635815-14e-13*(2*n)+3.561*P*SMe+.1208*M*wMe-.0642*F*IMe+.0158*V*PMe+.0252*B*DMe-.0066*j*RMe-.0047*k*OMe-.0046*G*MMe+.0028*q*NMe+.0052*Q*LMe+.004*W*FMe+.0019*J*BMe-.0044*Z*kMe)/86400*D.RADIANS_PER_DEGREE;return l(t)||(t=new cz),t.rightAscension=ae,t.declination=Ae,t.rotation=fe,t.rotationRate=xe,t};var lz=UMe;function zMe(e){(!l(e)||typeof e!="function")&&(e=lz.ComputeMoon),this._computeFunction=e}var J1t=new h,Z1t=new h,Q1t=new h;function eRt(e,t,n){let i=J1t;i.x=Math.cos(e+D.PI_OVER_TWO),i.y=Math.sin(e+D.PI_OVER_TWO),i.z=0;let r=Math.cos(t),o=Q1t;o.x=r*Math.cos(e),o.y=r*Math.sin(e),o.z=Math.sin(t);let s=h.cross(o,i,Z1t);return l(n)||(n=new $),n[0]=i.x,n[1]=s.x,n[2]=o.x,n[3]=i.y,n[4]=s.y,n[5]=o.y,n[6]=i.z,n[7]=s.z,n[8]=o.z,n}var tRt=new $,nRt=new Le;zMe.prototype.evaluate=function(e,t){l(e)||(e=K.now());let n=this._computeFunction(e),i=eRt(n.rightAscension,n.declination,t),r=D.zeroToTwoPi(n.rotation),o=Le.fromAxisAngle(h.UNIT_Z,r,nRt),s=$.fromQuaternion(Le.conjugate(o,o),tRt);return $.multiply(s,i,i)};var uz=zMe;var doe={position:0};function S7(e){e=e??H.EMPTY_OBJECT,this.center=h.clone(e.center??h.ZERO),this._center=new h,this.radii=h.clone(e.radii),this._radii=new h,this._oneOverEllipsoidRadiiSquared=new h,this._boundingSphere=new ue,this.modelMatrix=N.clone(e.modelMatrix??N.IDENTITY),this._modelMatrix=new N,this._computedModelMatrix=new N,this.show=e.show??!0,this.material=e.material??Qi.fromType(Qi.ColorType),this._material=void 0,this._translucent=void 0,this.id=e.id,this._id=void 0,this.debugShowBoundingVolume=e.debugShowBoundingVolume??!1,this.onlySunLighting=e.onlySunLighting??!1,this._onlySunLighting=!1,this._depthTestEnabled=e.depthTestEnabled??!0,this._useLogDepth=!1,this._sp=void 0,this._rs=void 0,this._va=void 0,this._pickSP=void 0,this._pickId=void 0,this._colorCommand=new at({owner:e._owner??this}),this._pickCommand=new at({owner:e._owner??this,pickOnly:!0});let t=this;this._uniforms={u_radii:function(){return t.radii},u_oneOverEllipsoidRadiiSquared:function(){return t._oneOverEllipsoidRadiiSquared}},this._pickUniforms={czm_pickColor:function(){return t._pickId.color}}}function iRt(e){let t=e.cache.ellipsoidPrimitive_vertexArray;if(l(t))return t;let n=Ic.createGeometry(Ic.fromDimensions({dimensions:new h(2,2,2),vertexFormat:Be.POSITION_ONLY}));return t=zn.fromGeometry({context:e,geometry:n,attributeLocations:doe,bufferUsage:Me.STATIC_DRAW,interleave:!0}),e.cache.ellipsoidPrimitive_vertexArray=t,t}S7.prototype.update=function(e){if(!this.show||e.mode!==re.SCENE3D||!l(this.center)||!l(this.radii))return;let t=e.context,n=this.material.isTranslucent(),i=this._translucent!==n;(!l(this._rs)||i)&&(this._translucent=n,this._rs=Ge.fromCache({cull:{enabled:!0,face:Vi.FRONT},depthTest:{enabled:this._depthTestEnabled},depthMask:!n&&t.fragmentDepth,blending:n?tn.ALPHA_BLEND:void 0})),l(this._va)||(this._va=iRt(t));let r=!1,o=this.radii;if(!h.equals(this._radii,o)){h.clone(o,this._radii);let y=this._oneOverEllipsoidRadiiSquared;y.x=1/(o.x*o.x),y.y=1/(o.y*o.y),y.z=1/(o.z*o.z),r=!0}(!N.equals(this.modelMatrix,this._modelMatrix)||!h.equals(this.center,this._center))&&(N.clone(this.modelMatrix,this._modelMatrix),h.clone(this.center,this._center),N.multiplyByTranslation(this.modelMatrix,this.center,this._computedModelMatrix),r=!0),r&&(h.clone(h.ZERO,this._boundingSphere.center),this._boundingSphere.radius=h.maximumComponent(o),ue.transform(this._boundingSphere,this._computedModelMatrix,this._boundingSphere));let s=this._material!==this.material;this._material=this.material,this._material.update(t);let a=this.onlySunLighting!==this._onlySunLighting;this._onlySunLighting=this.onlySunLighting;let c=e.useLogDepth,u=this._useLogDepth!==c;this._useLogDepth=c;let f=this._colorCommand,d,p;(s||a||i||u)&&(d=new Ye({sources:[Iv]}),p=new Ye({sources:[this.material.shaderSource,wv]}),this.onlySunLighting&&p.defines.push("ONLY_SUN_LIGHTING"),!n&&t.fragmentDepth&&p.defines.push("WRITE_DEPTH"),this._useLogDepth&&(d.defines.push("LOG_DEPTH"),p.defines.push("LOG_DEPTH")),this._sp=Qt.replaceCache({context:t,shaderProgram:this._sp,vertexShaderSource:d,fragmentShaderSource:p,attributeLocations:doe}),f.vertexArray=this._va,f.renderState=this._rs,f.shaderProgram=this._sp,f.uniformMap=Ot(this._uniforms,this.material._uniforms),f.executeInClosestFrustum=n);let g=e.commandList,m=e.passes;if(m.render&&(f.boundingVolume=this._boundingSphere,f.debugShowBoundingVolume=this.debugShowBoundingVolume,f.modelMatrix=this._computedModelMatrix,f.pass=n?Ie.TRANSLUCENT:Ie.OPAQUE,g.push(f)),m.pick){let y=this._pickCommand;(!l(this._pickId)||this._id!==this.id)&&(this._id=this.id,this._pickId=this._pickId&&this._pickId.destroy(),this._pickId=t.createPickId({primitive:this,id:this.id})),(s||a||!l(this._pickSP)||u)&&(d=new Ye({sources:[Iv]}),p=new Ye({sources:[this.material.shaderSource,wv],pickColorQualifier:"uniform"}),this.onlySunLighting&&p.defines.push("ONLY_SUN_LIGHTING"),!n&&t.fragmentDepth&&p.defines.push("WRITE_DEPTH"),this._useLogDepth&&(d.defines.push("LOG_DEPTH"),p.defines.push("LOG_DEPTH")),this._pickSP=Qt.replaceCache({context:t,shaderProgram:this._pickSP,vertexShaderSource:d,fragmentShaderSource:p,attributeLocations:doe}),y.vertexArray=this._va,y.renderState=this._rs,y.shaderProgram=this._pickSP,y.uniformMap=Ot(Ot(this._uniforms,this._pickUniforms),this.material._uniforms),y.executeInClosestFrustum=n),y.boundingVolume=this._boundingSphere,y.modelMatrix=this._computedModelMatrix,y.pass=n?Ie.TRANSLUCENT:Ie.OPAQUE,g.push(y)}};S7.prototype.isDestroyed=function(){return!1};S7.prototype.destroy=function(){return this._sp=this._sp&&this._sp.destroy(),this._pickSP=this._pickSP&&this._pickSP.destroy(),this._pickId=this._pickId&&this._pickId.destroy(),le(this)};var fz=S7;function dz(e){e=e??H.EMPTY_OBJECT;let t=e.textureUrl;l(t)||(t=Zt("Assets/Textures/moonSmall.jpg")),this.show=e.show??!0,this.textureUrl=t,this._ellipsoid=e.ellipsoid??ee.MOON,this.onlySunLighting=e.onlySunLighting??!0,this._ellipsoidPrimitive=new fz({radii:this.ellipsoid.radii,material:Qi.fromType(Qi.ImageType),depthTestEnabled:!1,_owner:this}),this._ellipsoidPrimitive.material.translucent=!1,this._axes=new uz}Object.defineProperties(dz.prototype,{ellipsoid:{get:function(){return this._ellipsoid}}});var w7=new $,rRt=new $,oRt=new h,I7=[];dz.prototype.update=function(e){if(!this.show)return;let t=this._ellipsoidPrimitive;t.material.uniforms.image=this.textureUrl,t.onlySunLighting=this.onlySunLighting;let n=e.time;l(At.computeIcrfToFixedMatrix(n,w7))||At.computeTemeToPseudoFixedMatrix(n,w7);let i=this._axes.evaluate(n,rRt);$.transpose(i,i),$.multiply(w7,i,i);let r=ky.computeMoonPositionInEarthInertialFrame(n,oRt);$.multiplyByVector(w7,r,r),N.fromRotationTranslation(i,r,t.modelMatrix);let o=e.commandList;return e.commandList=I7,I7.length=0,t.update(e),e.commandList=o,I7.length===1?I7[0]:void 0};dz.prototype.isDestroyed=function(){return!1};dz.prototype.destroy=function(){return this._ellipsoidPrimitive=this._ellipsoidPrimitive&&this._ellipsoidPrimitive.destroy(),le(this)};var hz=dz;var hoe=[],moe=[];function sRt(e,t,n,i,r,o){let s=r-i+1,a=o-r,c=hoe,u=moe,f,d;for(f=0;f<s;++f)c[f]=e[i+f];for(d=0;d<a;++d)u[d]=e[r+d+1];f=0,d=0;for(let p=i;p<=o;++p){let g=c[f],m=u[d];f<s&&(d>=a||t(g,m,n)<=0)?(e[p]=g,++f):d<a&&(e[p]=m,++d)}}function poe(e,t,n,i,r){if(i>=r)return;let o=Math.floor((i+r)*.5);poe(e,t,n,i,o),poe(e,t,n,o+1,r),sRt(e,t,n,i,o,r)}function aRt(e,t,n){let i=e.length,r=Math.ceil(i*.5);hoe.length=r,moe.length=r,poe(e,t,n,0,i-1),hoe.length=0,moe.length=0}var N0=aRt;function Cl(e,t){this._occluderPosition=h.clone(e.center),this._occluderRadius=e.radius,this._horizonDistance=0,this._horizonPlaneNormal=void 0,this._horizonPlanePosition=void 0,this._cameraPosition=void 0,this.cameraPosition=t}var P7=new h;Object.defineProperties(Cl.prototype,{position:{get:function(){return this._occluderPosition}},radius:{get:function(){return this._occluderRadius}},cameraPosition:{set:function(e){e=h.clone(e,this._cameraPosition);let t=h.subtract(this._occluderPosition,e,P7),n=h.magnitudeSquared(t),i=this._occluderRadius*this._occluderRadius,r,o,s;if(n>i){r=Math.sqrt(n-i),n=1/Math.sqrt(n),o=h.multiplyByScalar(t,n,P7);let a=r*r*n;s=h.add(e,h.multiplyByScalar(o,a,P7),P7)}else r=Number.MAX_VALUE;this._horizonDistance=r,this._horizonPlaneNormal=o,this._horizonPlanePosition=s,this._cameraPosition=e}}});Cl.fromBoundingSphere=function(e,t,n){return l(n)?(h.clone(e.center,n._occluderPosition),n._occluderRadius=e.radius,n.cameraPosition=t,n):new Cl(e,t)};var jMe=new h;Cl.prototype.isPointVisible=function(e){if(this._horizonDistance!==Number.MAX_VALUE){let t=h.subtract(e,this._occluderPosition,jMe),n=this._occluderRadius;if(n=h.magnitudeSquared(t)-n*n,n>0)return n=Math.sqrt(n)+this._horizonDistance,t=h.subtract(e,this._cameraPosition,t),n*n>h.magnitudeSquared(t)}return!1};var cRt=new h;Cl.prototype.isBoundingSphereVisible=function(e){let t=h.clone(e.center,cRt),n=e.radius;if(this._horizonDistance!==Number.MAX_VALUE){let i=h.subtract(t,this._occluderPosition,jMe),r=this._occluderRadius-n;if(r=h.magnitudeSquared(i)-r*r,n<this._occluderRadius)return r>0?(r=Math.sqrt(r)+this._horizonDistance,i=h.subtract(t,this._cameraPosition,i),r*r+n*n>h.magnitudeSquared(i)):!1;if(r>0){i=h.subtract(t,this._cameraPosition,i);let o=h.magnitudeSquared(i),s=this._occluderRadius*this._occluderRadius,a=n*n;return(this._horizonDistance*this._horizonDistance+s)*a>o*s?!0:(r=Math.sqrt(r)+this._horizonDistance,r*r+a>o)}return!0}return!1};var lRt=new h;Cl.prototype.computeVisibility=function(e){let t=h.clone(e.center),n=e.radius;if(n>this._occluderRadius)return $o.FULL;if(this._horizonDistance!==Number.MAX_VALUE){let i=h.subtract(t,this._occluderPosition,lRt),r=this._occluderRadius-n,o=h.magnitudeSquared(i);if(r=o-r*r,r>0){r=Math.sqrt(r)+this._horizonDistance,i=h.subtract(t,this._cameraPosition,i);let s=h.magnitudeSquared(i);return r*r+n*n<s?$o.NONE:(r=this._occluderRadius+n,r=o-r*r,r>0?(r=Math.sqrt(r)+this._horizonDistance,s<r*r+n*n?$o.FULL:$o.PARTIAL):(i=h.subtract(t,this._horizonPlanePosition,i),h.dot(i,this._horizonPlaneNormal)>-n?$o.PARTIAL:$o.FULL))}}return $o.NONE};var D7=new h;Cl.computeOccludeePoint=function(e,t,n){let i=h.clone(t),r=h.clone(e.center),o=e.radius,s=n.length,a=h.normalize(h.subtract(i,r,D7),D7),c=-h.dot(a,r),u=Cl._anyRotationVector(r,a,c),f=Cl._horizonToPlaneNormalDotProduct(e,a,c,u,n[0]);if(!f)return;let d;for(let g=1;g<s;++g){if(d=Cl._horizonToPlaneNormalDotProduct(e,a,c,u,n[g]),!d)return;d<f&&(f=d)}if(f<.0017453283658983088)return;let p=o/f;return h.add(r,h.multiplyByScalar(a,p,D7),D7)};var uRt=[];Cl.computeOccludeePointFromRectangle=function(e,t){t=t??ee.default;let n=ie.subsample(e,t,0,uRt),i=ue.fromPoints(n),r=h.ZERO;if(!h.equals(r,i.center))return Cl.computeOccludeePoint(new ue(r,t.minimumRadius),i.center,n)};var fRt=new h;Cl._anyRotationVector=function(e,t,n){let i=h.abs(t,fRt),r=i.x>i.y?0:1;(r===0&&i.z>i.x||r===1&&i.z>i.y)&&(r=2);let o=new h,s;r===0?(i.x=e.x,i.y=e.y+1,i.z=e.z+1,s=h.UNIT_X):r===1?(i.x=e.x+1,i.y=e.y,i.z=e.z+1,s=h.UNIT_Y):(i.x=e.x+1,i.y=e.y+1,i.z=e.z,s=h.UNIT_Z);let a=(h.dot(t,i)+n)/-h.dot(t,s);return h.normalize(h.subtract(h.add(i,h.multiplyByScalar(s,a,o),i),e,i),i)};var dRt=new h;Cl._rotationVector=function(e,t,n,i,r){let o=h.subtract(i,e,dRt);if(o=h.normalize(o,o),h.dot(t,o)<.9999999847691291){let s=h.cross(t,o,o);if(h.magnitude(s)>D.EPSILON13)return h.normalize(s,new h)}return r};var goe=new h,hRt=new h,R7=new h,VMe=new h;Cl._horizonToPlaneNormalDotProduct=function(e,t,n,i,r){let o=h.clone(r,goe),s=h.clone(e.center,hRt),a=e.radius,c=h.subtract(s,o,R7),u=h.magnitudeSquared(c),f=a*a;if(u<f)return!1;let d=u-f,p=Math.sqrt(d),m=1/Math.sqrt(u),A=p*m*p;c=h.normalize(c,c);let b=h.add(o,h.multiplyByScalar(c,A,VMe),VMe),x=Math.sqrt(d-A*A),T=this._rotationVector(s,t,n,o,i),E=h.fromElements(T.x*T.x*c.x+(T.x*T.y-T.z)*c.y+(T.x*T.z+T.y)*c.z,(T.x*T.y+T.z)*c.x+T.y*T.y*c.y+(T.y*T.z-T.x)*c.z,(T.x*T.z-T.y)*c.x+(T.y*T.z+T.x)*c.y+T.z*T.z*c.z,goe);E=h.normalize(E,E);let v=h.multiplyByScalar(E,x,goe);T=h.normalize(h.subtract(h.add(b,v,R7),s,R7),R7);let S=h.dot(t,T);T=h.normalize(h.subtract(h.subtract(b,v,T),s,T),T);let I=h.dot(t,T);return S<I?S:I};var mz=Cl;function L0(e){e=e??H.EMPTY_OBJECT,this.left=e.left,this._left=void 0,this.right=e.right,this._right=void 0,this.top=e.top,this._top=void 0,this.bottom=e.bottom,this._bottom=void 0,this.near=e.near??1,this._near=this.near,this.far=e.far??5e8,this._far=this.far,this._cullingVolume=new ta,this._perspectiveMatrix=new N,this._infinitePerspective=new N}function _oe(e){let{top:t,bottom:n,right:i,left:r,near:o,far:s}=e;(t!==e._top||n!==e._bottom||r!==e._left||i!==e._right||o!==e._near||s!==e._far)&&(e._left=r,e._right=i,e._top=t,e._bottom=n,e._near=o,e._far=s,e._perspectiveMatrix=N.computePerspectiveOffCenter(r,i,n,t,o,s,e._perspectiveMatrix),e._infinitePerspective=N.computeInfinitePerspectiveOffCenter(r,i,n,t,o,e._infinitePerspective))}Object.defineProperties(L0.prototype,{projectionMatrix:{get:function(){return _oe(this),this._perspectiveMatrix}},infiniteProjectionMatrix:{get:function(){return _oe(this),this._infinitePerspective}}});var mRt=new h,pRt=new h,gRt=new h,_Rt=new h;L0.prototype.computeCullingVolume=function(e,t,n){let i=this._cullingVolume.planes,r=this.top,o=this.bottom,s=this.right,a=this.left,c=this.near,u=this.far,f=h.cross(t,n,mRt),d=pRt;h.multiplyByScalar(t,c,d),h.add(e,d,d);let p=gRt;h.multiplyByScalar(t,u,p),h.add(e,p,p);let g=_Rt;h.multiplyByScalar(f,a,g),h.add(d,g,g),h.subtract(g,e,g),h.normalize(g,g),h.cross(g,n,g),h.normalize(g,g);let m=i[0];return l(m)||(m=i[0]=new se),m.x=g.x,m.y=g.y,m.z=g.z,m.w=-h.dot(g,e),h.multiplyByScalar(f,s,g),h.add(d,g,g),h.subtract(g,e,g),h.cross(n,g,g),h.normalize(g,g),m=i[1],l(m)||(m=i[1]=new se),m.x=g.x,m.y=g.y,m.z=g.z,m.w=-h.dot(g,e),h.multiplyByScalar(n,o,g),h.add(d,g,g),h.subtract(g,e,g),h.cross(f,g,g),h.normalize(g,g),m=i[2],l(m)||(m=i[2]=new se),m.x=g.x,m.y=g.y,m.z=g.z,m.w=-h.dot(g,e),h.multiplyByScalar(n,r,g),h.add(d,g,g),h.subtract(g,e,g),h.cross(g,f,g),h.normalize(g,g),m=i[3],l(m)||(m=i[3]=new se),m.x=g.x,m.y=g.y,m.z=g.z,m.w=-h.dot(g,e),m=i[4],l(m)||(m=i[4]=new se),m.x=t.x,m.y=t.y,m.z=t.z,m.w=-h.dot(t,d),h.negate(t,g),m=i[5],l(m)||(m=i[5]=new se),m.x=g.x,m.y=g.y,m.z=g.z,m.w=-h.dot(g,p),this._cullingVolume};L0.prototype.getPixelDimensions=function(e,t,n,i,r){_oe(this);let o=1/this.near,s=this.top*o,a=2*i*n*s/t;s=this.right*o;let c=2*i*n*s/e;return r.x=c,r.y=a,r};L0.prototype.clone=function(e){return l(e)||(e=new L0),e.right=this.right,e.left=this.left,e.top=this.top,e.bottom=this.bottom,e.near=this.near,e.far=this.far,e._left=void 0,e._right=void 0,e._top=void 0,e._bottom=void 0,e._near=void 0,e._far=void 0,e};L0.prototype.equals=function(e){return l(e)&&e instanceof L0&&this.right===e.right&&this.left===e.left&&this.top===e.top&&this.bottom===e.bottom&&this.near===e.near&&this.far===e.far};L0.prototype.equalsEpsilon=function(e,t,n){return e===this||l(e)&&e instanceof L0&&D.equalsEpsilon(this.right,e.right,t,n)&&D.equalsEpsilon(this.left,e.left,t,n)&&D.equalsEpsilon(this.top,e.top,t,n)&&D.equalsEpsilon(this.bottom,e.bottom,t,n)&&D.equalsEpsilon(this.near,e.near,t,n)&&D.equalsEpsilon(this.far,e.far,t,n)};var yu=L0;function ff(e){e=e??H.EMPTY_OBJECT,this._offCenterFrustum=new yu,this.fov=e.fov,this._fov=void 0,this._fovy=void 0,this._sseDenominator=void 0,this.aspectRatio=e.aspectRatio,this._aspectRatio=void 0,this.near=e.near??1,this._near=this.near,this.far=e.far??5e8,this._far=this.far,this.xOffset=e.xOffset??0,this._xOffset=this.xOffset,this.yOffset=e.yOffset??0,this._yOffset=this.yOffset}ff.packedLength=6;ff.pack=function(e,t,n){return n=n??0,t[n++]=e.fov,t[n++]=e.aspectRatio,t[n++]=e.near,t[n++]=e.far,t[n++]=e.xOffset,t[n]=e.yOffset,t};ff.unpack=function(e,t,n){return t=t??0,l(n)||(n=new ff),n.fov=e[t++],n.aspectRatio=e[t++],n.near=e[t++],n.far=e[t++],n.xOffset=e[t++],n.yOffset=e[t],n};function np(e){if(!(e.fov!==e._fov||e.aspectRatio!==e._aspectRatio||e.near!==e._near||e.far!==e._far||e.xOffset!==e._xOffset||e.yOffset!==e._yOffset))return;e._aspectRatio=e.aspectRatio,e._fov=e.fov,e._fovy=e.aspectRatio<=1?e.fov:Math.atan(Math.tan(e.fov*.5)/e.aspectRatio)*2,e._near=e.near,e._far=e.far,e._sseDenominator=2*Math.tan(.5*e._fovy),e._xOffset=e.xOffset,e._yOffset=e.yOffset;let n=e._offCenterFrustum;n.top=e.near*Math.tan(.5*e._fovy),n.bottom=-n.top,n.right=e.aspectRatio*n.top,n.left=-n.right,n.near=e.near,n.far=e.far,n.right+=e.xOffset,n.left+=e.xOffset,n.top+=e.yOffset,n.bottom+=e.yOffset}Object.defineProperties(ff.prototype,{projectionMatrix:{get:function(){return np(this),this._offCenterFrustum.projectionMatrix}},infiniteProjectionMatrix:{get:function(){return np(this),this._offCenterFrustum.infiniteProjectionMatrix}},fovy:{get:function(){return np(this),this._fovy}},sseDenominator:{get:function(){return np(this),this._sseDenominator}},offCenterFrustum:{get:function(){return np(this),this._offCenterFrustum}}});ff.prototype.computeCullingVolume=function(e,t,n){return np(this),this._offCenterFrustum.computeCullingVolume(e,t,n)};ff.prototype.getPixelDimensions=function(e,t,n,i,r){return np(this),this._offCenterFrustum.getPixelDimensions(e,t,n,i,r)};ff.prototype.clone=function(e){return l(e)||(e=new ff),e.aspectRatio=this.aspectRatio,e.fov=this.fov,e.near=this.near,e.far=this.far,e._aspectRatio=void 0,e._fov=void 0,e._near=void 0,e._far=void 0,this._offCenterFrustum.clone(e._offCenterFrustum),e};ff.prototype.equals=function(e){return!l(e)||!(e instanceof ff)?!1:(np(this),np(e),this.fov===e.fov&&this.aspectRatio===e.aspectRatio&&this._offCenterFrustum.equals(e._offCenterFrustum))};ff.prototype.equalsEpsilon=function(e,t,n){return!l(e)||!(e instanceof ff)?!1:(np(this),np(e),D.equalsEpsilon(this.fov,e.fov,t,n)&&D.equalsEpsilon(this.aspectRatio,e.aspectRatio,t,n)&&this._offCenterFrustum.equalsEpsilon(e._offCenterFrustum,t,n))};var Ji=ff;function pz(){this._colorTexture=void 0,this._drawCommand=void 0}Object.defineProperties(pz.prototype,{colorTexture:{get:function(){return this._colorTexture}}});function yRt(e,t,n){let i=t.createViewportQuadCommand(UO,{framebuffer:n,renderState:Ge.fromCache({viewport:new et(0,0,256,256)})});e._drawCommand=i}pz.prototype.update=function(e){if(!l(this._colorTexture)){let t=e.context,n=new Dt({context:t,width:256,height:256,pixelFormat:Ke.RGBA,pixelDatatype:ze.UNSIGNED_BYTE,sampler:jt.NEAREST});this._colorTexture=n;let i=new _s({context:t,colorTextures:[n],destroyAttachments:!1});yRt(this,t,i),this._drawCommand.execute(t),i.destroy(),this._drawCommand.shaderProgram=this._drawCommand.shaderProgram&&this._drawCommand.shaderProgram.destroy()}};pz.prototype.isDestroyed=function(){return!1};pz.prototype.destroy=function(){return this._colorTexture=this._colorTexture&&this._colorTexture.destroy(),le(this)};var gz=pz;var qMe={};function ARt(e,t,n){let i,r,o;if(e instanceof Ji){let s=Math.tan(.5*e.fovy);return i=e.near,r=e.near*s,o=e.aspectRatio*r,Math.max(t*i/o,n*i/r)}else if(e instanceof yu)return i=e.near,r=e.top,o=e.right,Math.max(t*i/o,n*i/r);return Math.max(t,n)}var bRt=new h,HMe=new h;function YMe(e,t,n,i){if(l(i)&&n(.5)>i){let r=n(0),o=n(1),s=n(.5),a=s-r,c=s-o;return function(u){let f=n(u);if(u<=.5){let p=(f-r)/a;return D.lerp(e,-D.PI_OVER_TWO,p)}let d=(f-o)/c;return D.lerp(-D.PI_OVER_TWO,t,1-d)}}return function(r){return D.lerp(e,t,r)}}function Aoe(e,t,n,i,r){let o=r,s=Math.max(n,i);if(!l(o)){let a=e.position,c=t,u=e.up,f=e.right,d=e.frustum,p=h.subtract(a,c,bRt),g=h.magnitude(h.multiplyByScalar(u,h.dot(p,u),HMe)),m=h.magnitude(h.multiplyByScalar(f,h.dot(p,f),HMe));o=Math.min(ARt(d,g,m)*.2,1e9)}if(s<o){let u=-Math.pow((o-n)*1e6,.125),f=Math.pow((o-i)*1e6,1/8);return function(d){let p=d*(f-u)+u;return-Math.pow(p,8)/1e6+o}}return function(a){return D.lerp(n,i,a)}}function _z(e,t){return D.equalsEpsilon(e,D.TWO_PI,D.EPSILON11)&&(e=0),t>e+Math.PI?e+=D.TWO_PI:t<e-Math.PI&&(e-=D.TWO_PI),e}var XMe=new h;function xRt(e,t,n,i,r,o,s,a){let c=e.camera,u=h.clone(c.position,XMe),f=c.pitch,d=_z(c.heading,i),p=_z(c.roll,o),g=Aoe(c,n,u.z,n.z,s),m=YMe(f,r,g,a);function y(A){let b=A.time/t;c.setView({orientation:{heading:D.lerp(d,i,b),pitch:m(b),roll:D.lerp(p,o,b)}}),U.lerp(u,n,b,c.position),c.position.z=g(b)}return y}function TRt(e,t){e.longitude<t.longitude?e.longitude+=D.TWO_PI:t.longitude+=D.TWO_PI}function ERt(e,t){let n=e.longitude-t.longitude;n<-D.PI?e.longitude+=D.TWO_PI:n>D.PI&&(t.longitude+=D.TWO_PI)}var CRt=new he,vRt=new he;function SRt(e,t,n,i,r,o,s,a,c,u){let f=e.camera,p=e.mapProjection.ellipsoid,g=he.clone(f.positionCartographic,CRt),m=f.pitch,y=_z(f.heading,i),A=_z(f.roll,o),b=p.cartesianToCartographic(n,vRt);g.longitude=D.zeroToTwoPi(g.longitude),b.longitude=D.zeroToTwoPi(b.longitude);let x=!1;if(l(a)){let S=D.zeroToTwoPi(a),I=Math.min(g.longitude,b.longitude),R=Math.max(g.longitude,b.longitude),O=S>=I&&S<=R;if(l(c)){let L=Math.abs(g.longitude-b.longitude),_=D.TWO_PI-L;(O?L:_)<(O?_:L)*c&&!O&&(x=!0)}else O||(x=!0)}x?TRt(g,b):ERt(g,b);let T=Aoe(f,n,g.height,b.height,s),E=YMe(m,r,T,u);function v(){let S=g.longitude,I=b.longitude,R=g.latitude,O=b.latitude;return function(_){let C=_.time/t,w=h.fromRadians(D.lerp(S,I,C),D.lerp(R,O,C),T(C),p);f.setView({destination:w,orientation:{heading:D.lerp(y,i,C),pitch:E(C),roll:D.lerp(A,o,C)}})}}return v()}function wRt(e,t,n,i,r,o,s){let a=e.camera,c=h.clone(a.position,XMe),u=_z(a.heading,i),f=a.frustum.right-a.frustum.left,d=Aoe(a,n,f,n.z,s);function p(g){let m=g.time/t;a.setView({orientation:{heading:D.lerp(u,i,m)}}),U.lerp(c,n,m,a.position);let y=d(m),A=a.frustum,b=A.top/A.right,x=(y-(A.right-A.left))*.5;A.right+=x,A.left-=x,A.top=b*A.right,A.bottom=-A.top}return p}var GMe=new he,IRt=new h;function yoe(e,t){return{startObject:{},stopObject:{},duration:0,complete:e,cancel:t}}function WMe(e,t){function n(){typeof t=="function"&&t(),e.enableInputs=!0}return n}qMe.createTween=function(e,t){t=t??H.EMPTY_OBJECT;let n=t.destination,i=e.mode;if(i===re.MORPHING)return yoe();let r=t.convert??!0,o=e.mapProjection,s=o.ellipsoid,a=t.maximumHeight,c=t.flyOverLongitude,u=t.flyOverLongitudeWeight,f=t.pitchAdjustHeight,d=t.easingFunction;r&&i!==re.SCENE3D&&(s.cartesianToCartographic(n,GMe),n=o.project(GMe,IRt));let p=e.camera,g=t.endTransform;l(g)&&p._setTransform(g);let m=t.duration;l(m)||(m=Math.ceil(h.distance(p.position,n)/1e6)+2,m=Math.min(m,3));let y=t.heading??0,A=t.pitch??-D.PI_OVER_TWO,b=t.roll??0,x=e.screenSpaceCameraController;x.enableInputs=!1;let T=WMe(x,t.complete),E=WMe(x,t.cancel),v=p.frustum,S=e.mode===re.SCENE2D;if(S=S&&U.equalsEpsilon(p.position,n,D.EPSILON6),S=S&&D.equalsEpsilon(Math.max(v.right-v.left,v.top-v.bottom),n.z,D.EPSILON6),S=S||e.mode!==re.SCENE2D&&h.equalsEpsilon(n,p.position,D.EPSILON10),S=S&&D.equalsEpsilon(D.negativePiToPi(y),D.negativePiToPi(p.heading),D.EPSILON10)&&D.equalsEpsilon(D.negativePiToPi(A),D.negativePiToPi(p.pitch),D.EPSILON10)&&D.equalsEpsilon(D.negativePiToPi(b),D.negativePiToPi(p.roll),D.EPSILON10),S)return yoe(T,E);let I=new Array(4);if(I[re.SCENE2D]=wRt,I[re.SCENE3D]=SRt,I[re.COLUMBUS_VIEW]=xRt,m<=0)return yoe(function(){I[i](e,1,n,y,A,b,a,c,u,f)({time:1}),typeof T=="function"&&T()},E);let R=I[i](e,m,n,y,A,b,a,c,u,f);if(!l(d)){let O=p.positionCartographic.height,L=i===re.SCENE3D?s.cartesianToCartographic(n).height:n.z;O>L&&O>11500?d=Ls.CUBIC_OUT:d=Ls.QUINTIC_IN_OUT}return{duration:m,easingFunction:d,startObject:{time:0},stopObject:{time:m},update:R,complete:T,cancel:E}};var yz=qMe;var KMe={ROTATE:0,INFINITE_SCROLL:1};Object.freeze(KMe);var Au=KMe;function an(e){this._scene=e,this._transform=N.clone(N.IDENTITY),this._invTransform=N.clone(N.IDENTITY),this._actualTransform=N.clone(N.IDENTITY),this._actualInvTransform=N.clone(N.IDENTITY),this._transformChanged=!1,this.position=new h,this._position=new h,this._positionWC=new h,this._positionCartographic=new he,this._oldPositionWC=void 0,this.positionWCDeltaMagnitude=0,this.positionWCDeltaMagnitudeLastFrame=0,this.timeSinceMoved=0,this._lastMovedTimestamp=0,this.direction=new h,this._direction=new h,this._directionWC=new h,this.up=new h,this._up=new h,this._upWC=new h,this.right=new h,this._right=new h,this._rightWC=new h,this.frustum=new Ji,this.frustum.aspectRatio=e.drawingBufferWidth/e.drawingBufferHeight,this.frustum.fov=D.toRadians(60),this.defaultMoveAmount=1e5,this.defaultLookAmount=Math.PI/60,this.defaultRotateAmount=Math.PI/3600,this.defaultZoomAmount=1e5,this.constrainedAxis=void 0,this.maximumZoomFactor=1.5,this._moveStart=new be,this._moveEnd=new be,this._changed=new be,this._changedPosition=void 0,this._changedDirection=void 0,this._changedFrustum=void 0,this._changedHeading=void 0,this._changedRoll=void 0,this.percentageChanged=.5,this._viewMatrix=new N,this._invViewMatrix=new N,sNe(this),this._mode=re.SCENE3D,this._modeChanged=!0;let t=e.mapProjection;this._projection=t,this._maxCoord=t.project(new he(Math.PI,D.PI_OVER_TWO)),this._max2Dfrustum=void 0,yNe(this,an.DEFAULT_VIEW_RECTANGLE,this.position,!0);let n=h.magnitude(this.position);n+=n*an.DEFAULT_VIEW_FACTOR,h.normalize(this.position,this.position),h.multiplyByScalar(this.position,n,this.position)}an.TRANSFORM_2D=new N(0,0,1,0,1,0,0,0,0,1,0,0,0,0,0,1);an.TRANSFORM_2D_INVERSE=N.inverseTransformation(an.TRANSFORM_2D,new N);an.DEFAULT_VIEW_RECTANGLE=ie.fromDegrees(-95,-20,-70,90);an.DEFAULT_VIEW_FACTOR=.5;an.DEFAULT_OFFSET=new ph(0,-D.PI_OVER_FOUR,0);function sNe(e){N.computeView(e._position,e._direction,e._up,e._right,e._viewMatrix),N.multiply(e._viewMatrix,e._actualInvTransform,e._viewMatrix),N.inverseTransformation(e._viewMatrix,e._invViewMatrix)}function PRt(e){if(!l(e._oldPositionWC))e._oldPositionWC=h.clone(e.positionWC,e._oldPositionWC);else{e.positionWCDeltaMagnitudeLastFrame=e.positionWCDeltaMagnitude;let t=h.subtract(e.positionWC,e._oldPositionWC,e._oldPositionWC);e.positionWCDeltaMagnitude=h.magnitude(t),e._oldPositionWC=h.clone(e.positionWC,e._oldPositionWC),e.positionWCDeltaMagnitude>0?(e.timeSinceMoved=0,e._lastMovedTimestamp=xn()):e.timeSinceMoved=Math.max(xn()-e._lastMovedTimestamp,0)/1e3}}an.prototype.canPreloadFlight=function(){return l(this._currentFlight)&&this._mode!==re.SCENE2D};an.prototype._updateCameraChanged=function(){let e=this;if(PRt(e),e._changed.numberOfListeners===0)return;let t=e.percentageChanged,n=e.heading;l(e._changedHeading)||(e._changedHeading=n);let i=Math.abs(e._changedHeading-n)%D.TWO_PI;i=i>D.PI?D.TWO_PI-i:i;let r=i/Math.PI;r>t&&(e._changedHeading=n);let o=e.roll;l(e._changedRoll)||(e._changedRoll=o);let s=Math.abs(e._changedRoll-o)%D.TWO_PI;s=s>D.PI?D.TWO_PI-s:s;let a=s/Math.PI;if(a>t&&(e._changedRoll=o),(a>t||r>t)&&e._changed.raiseEvent(Math.max(a,r)),e._mode===re.SCENE2D){if(!l(e._changedFrustum)){e._changedPosition=h.clone(e.position,e._changedPosition),e._changedFrustum=e.frustum.clone();return}let p=e.position,g=e._changedPosition,m=e.frustum,y=e._changedFrustum,A=p.x+m.left,b=p.x+m.right,x=g.x+y.left,T=g.x+y.right,E=p.y+m.bottom,v=p.y+m.top,S=g.y+y.bottom,I=g.y+y.top,R=Math.max(A,x),O=Math.min(b,T),L=Math.max(E,S),_=Math.min(v,I),C;if(R>=O||L>=v)C=1;else{let w=y;A<x&&b>T&&E<S&&v>I&&(w=m),C=1-(O-R)*(_-L)/((w.right-w.left)*(w.top-w.bottom))}C>t&&(e._changed.raiseEvent(C),e._changedPosition=h.clone(e.position,e._changedPosition),e._changedFrustum=e.frustum.clone(e._changedFrustum));return}if(!l(e._changedDirection)){e._changedPosition=h.clone(e.positionWC,e._changedPosition),e._changedDirection=h.clone(e.directionWC,e._changedDirection);return}let c=D.acosClamped(h.dot(e.directionWC,e._changedDirection)),u;l(e.frustum.fovy)?u=c/(e.frustum.fovy*.5):u=c;let d=h.distance(e.positionWC,e._changedPosition)/e.positionCartographic.height;(u>t||d>t)&&(e._changed.raiseEvent(Math.max(u,d)),e._changedPosition=h.clone(e.positionWC,e._changedPosition),e._changedDirection=h.clone(e.directionWC,e._changedDirection))};function DRt(e){At.basisTo2D(e._projection,e._transform,e._actualTransform)}var RRt=new he,ORt=new h,O7=new h,MRt=new se,NRt=new se,LRt=new se,FRt=new se,BRt=new se;function kRt(e){let t=e._projection,n=t.ellipsoid,i=N.getColumn(e._transform,3,MRt),r=n.cartesianToCartographic(i,RRt),o=t.project(r,ORt),s=NRt;s.x=o.z,s.y=o.x,s.z=o.y,s.w=1;let a=se.clone(se.UNIT_X,BRt),c=se.add(N.getColumn(e._transform,0,O7),i,O7);n.cartesianToCartographic(c,r),t.project(r,o);let u=LRt;u.x=o.z,u.y=o.x,u.z=o.y,u.w=0,h.subtract(u,s,u),u.x=0;let f=FRt;if(h.magnitudeSquared(u)>D.EPSILON10)h.cross(a,u,f);else{let d=se.add(N.getColumn(e._transform,1,O7),i,O7);n.cartesianToCartographic(d,r),t.project(r,o),f.x=o.z,f.y=o.x,f.z=o.y,f.w=0,h.subtract(f,s,f),f.x=0,h.magnitudeSquared(f)<D.EPSILON10&&(se.clone(se.UNIT_Y,u),se.clone(se.UNIT_Z,f))}h.cross(f,a,u),h.normalize(u,u),h.cross(a,u,f),h.normalize(f,f),N.setColumn(e._actualTransform,0,u,e._actualTransform),N.setColumn(e._actualTransform,1,f,e._actualTransform),N.setColumn(e._actualTransform,2,a,e._actualTransform),N.setColumn(e._actualTransform,3,s,e._actualTransform)}var boe=new h;function Sl(e){let t=e._mode,n=!1,i=0;t===re.SCENE2D&&(i=e.frustum.right-e.frustum.left,n=i!==e._positionCartographic.height);let r=e._position,o=!h.equals(r,e.position)||n;o&&(r=h.clone(e.position,e._position));let s=e._direction,a=!h.equals(s,e.direction);a&&(h.normalize(e.direction,e.direction),s=h.clone(e.direction,e._direction));let c=e._up,u=!h.equals(c,e.up);u&&(h.normalize(e.up,e.up),c=h.clone(e.up,e._up));let f=e._right,d=!h.equals(f,e.right);d&&(h.normalize(e.right,e.right),f=h.clone(e.right,e._right));let p=e._transformChanged||e._modeChanged;e._transformChanged=!1,p&&(N.inverseTransformation(e._transform,e._invTransform),e._mode===re.COLUMBUS_VIEW||e._mode===re.SCENE2D?N.equals(N.IDENTITY,e._transform)?N.clone(an.TRANSFORM_2D,e._actualTransform):e._mode===re.COLUMBUS_VIEW?DRt(e):kRt(e):N.clone(e._transform,e._actualTransform),N.inverseTransformation(e._actualTransform,e._actualInvTransform),e._modeChanged=!1);let g=e._actualTransform;if(o||p)if(e._positionWC=N.multiplyByPoint(g,r,e._positionWC),t===re.SCENE3D||t===re.MORPHING)e._positionCartographic=e._projection.ellipsoid.cartesianToCartographic(e._positionWC,e._positionCartographic);else{let m=boe;m.x=e._positionWC.y,m.y=e._positionWC.z,m.z=e._positionWC.x,t===re.SCENE2D&&(m.z=i),e._projection.unproject(m,e._positionCartographic)}if(a||u||d){let m=h.dot(s,h.cross(c,f,boe));if(Math.abs(1-m)>D.EPSILON2){let y=1/h.magnitudeSquared(c),A=h.dot(c,s)*y,b=h.multiplyByScalar(s,A,boe);c=h.normalize(h.subtract(c,b,e._up),e._up),h.clone(c,e.up),f=h.cross(s,c,e._right),h.clone(f,e.right)}}(a||p)&&(e._directionWC=N.multiplyByPointAsVector(g,s,e._directionWC),h.normalize(e._directionWC,e._directionWC)),(u||p)&&(e._upWC=N.multiplyByPointAsVector(g,c,e._upWC),h.normalize(e._upWC,e._upWC)),(d||p)&&(e._rightWC=N.multiplyByPointAsVector(g,f,e._rightWC),h.normalize(e._rightWC,e._rightWC)),(o||a||u||d||p)&&sNe(e)}function aNe(e,t){let n;return D.equalsEpsilon(Math.abs(e.z),1,D.EPSILON3)?n=Math.atan2(t.y,t.x)-D.PI_OVER_TWO:n=Math.atan2(e.y,e.x)-D.PI_OVER_TWO,D.TWO_PI-D.zeroToTwoPi(n)}function cNe(e){return D.PI_OVER_TWO-D.acosClamped(e.z)}function lNe(e,t,n){let i=0;return D.equalsEpsilon(Math.abs(e.z),1,D.EPSILON3)||(i=Math.atan2(-n.z,t.z),i=D.zeroToTwoPi(i+D.TWO_PI)),i}var L7=new N,F7=new N;Object.defineProperties(an.prototype,{transform:{get:function(){return this._transform}},inverseTransform:{get:function(){return Sl(this),this._invTransform}},viewMatrix:{get:function(){return Sl(this),this._viewMatrix}},inverseViewMatrix:{get:function(){return Sl(this),this._invViewMatrix}},positionCartographic:{get:function(){return Sl(this),this._positionCartographic}},positionWC:{get:function(){return Sl(this),this._positionWC}},directionWC:{get:function(){return Sl(this),this._directionWC}},upWC:{get:function(){return Sl(this),this._upWC}},rightWC:{get:function(){return Sl(this),this._rightWC}},heading:{get:function(){if(this._mode!==re.MORPHING){let e=this._projection.ellipsoid,t=N.clone(this._transform,L7),n=At.eastNorthUpToFixedFrame(this.positionWC,e,F7);this._setTransform(n);let i=aNe(this.direction,this.up);return this._setTransform(t),i}}},pitch:{get:function(){if(this._mode!==re.MORPHING){let e=this._projection.ellipsoid,t=N.clone(this._transform,L7),n=At.eastNorthUpToFixedFrame(this.positionWC,e,F7);this._setTransform(n);let i=cNe(this.direction);return this._setTransform(t),i}}},roll:{get:function(){if(this._mode!==re.MORPHING){let e=this._projection.ellipsoid,t=N.clone(this._transform,L7),n=At.eastNorthUpToFixedFrame(this.positionWC,e,F7);this._setTransform(n);let i=lNe(this.direction,this.up,this.right);return this._setTransform(t),i}}},moveStart:{get:function(){return this._moveStart}},moveEnd:{get:function(){return this._moveEnd}},changed:{get:function(){return this._changed}}});an.prototype.update=function(e){let t=!1;if(e!==this._mode&&(this._mode=e,this._modeChanged=e!==re.MORPHING,t=this._mode===re.SCENE2D),t){let n=this._max2Dfrustum=this.frustum.clone(),i=2,r=n.top/n.right;n.right=this._maxCoord.x*i,n.left=-n.right,n.top=r*n.right,n.bottom=-n.top}this._mode===re.SCENE2D&&hNe(this,this.position)};var URt=new h,zRt=new h,VRt=new h;an.prototype._setTransform=function(e){let t=h.clone(this.positionWC,URt),n=h.clone(this.upWC,zRt),i=h.clone(this.directionWC,VRt);N.clone(e,this._transform),this._transformChanged=!0,Sl(this);let r=this._actualInvTransform;N.multiplyByPoint(r,t,this.position),N.multiplyByPointAsVector(r,i,this.direction),N.multiplyByPointAsVector(r,n,this.up),h.cross(this.direction,this.up,this.right),Sl(this)};var jRt=new U,HRt=new pn,GRt=new h,WRt=new h;function uNe(e){if(!N.equals(N.IDENTITY,e.transform))return h.magnitude(e.position);let t=e._scene,n=t.globe,i=jRt;i.x=t.drawingBufferWidth/t.pixelRatio/2,i.y=t.drawingBufferHeight/t.pixelRatio/2;let r;if(l(n)){let a=e.getPickRay(i,HRt);r=n.pickWorldCoordinates(a,t,!0,GRt)}let o;t.pickPositionSupported&&(o=t.pickPositionWorldCoordinates(i,WRt));let s;if(l(r)||l(o)){let a=l(o)?h.distance(o,e.positionWC):Number.POSITIVE_INFINITY,c=l(r)?h.distance(r,e.positionWC):Number.POSITIVE_INFINITY;s=Math.min(a,c)}else s=Math.max(e.positionCartographic.height,0);return s}an.prototype._adjustOrthographicFrustum=function(e){this.frustum instanceof gn&&(!e&&this._positionCartographic.height<15e4||(this.frustum.width=uNe(this)))};var B7=new h,voe=new N,qRt=new N,Soe=new Le,woe=new $,fNe=new he;function YRt(e,t,n){let i=N.clone(e.transform,voe),r=At.eastNorthUpToFixedFrame(t,e._projection.ellipsoid,qRt);e._setTransform(r),h.clone(h.ZERO,e.position),n.heading=n.heading-D.PI_OVER_TWO;let o=Le.fromHeadingPitchRoll(n,Soe),s=$.fromQuaternion(o,woe);$.getColumn(s,0,e.direction),$.getColumn(s,2,e.up),h.cross(e.direction,e.up,e.right),e._setTransform(i),e._adjustOrthographicFrustum(!0)}function XRt(e,t,n,i){let r=N.clone(e.transform,voe);if(e._setTransform(N.IDENTITY),!h.equals(t,e.positionWC)){if(i){let a=e._projection,c=a.ellipsoid.cartesianToCartographic(t,fNe);t=a.project(c,B7)}h.clone(t,e.position)}n.heading=n.heading-D.PI_OVER_TWO;let o=Le.fromHeadingPitchRoll(n,Soe),s=$.fromQuaternion(o,woe);$.getColumn(s,0,e.direction),$.getColumn(s,2,e.up),h.cross(e.direction,e.up,e.right),e._setTransform(r),e._adjustOrthographicFrustum(!0)}function KRt(e,t,n,i){let r=N.clone(e.transform,voe);if(e._setTransform(N.IDENTITY),!h.equals(t,e.positionWC)){if(i){let c=e._projection,u=c.ellipsoid.cartesianToCartographic(t,fNe);t=c.project(u,B7)}U.clone(t,e.position);let o=-t.z*.5,s=-o,a=e.frustum;if(s>o){let c=a.top/a.right;a.right=s,a.left=o,a.top=a.right*c,a.bottom=-a.top}}if(e._scene.mapMode2D===Au.ROTATE){n.heading=n.heading-D.PI_OVER_TWO,n.pitch=-D.PI_OVER_TWO,n.roll=0;let o=Le.fromHeadingPitchRoll(n,Soe),s=$.fromQuaternion(o,woe);$.getColumn(s,2,e.up),h.cross(e.direction,e.up,e.right)}e._setTransform(r)}var $Rt=new h,JRt=new h,ZRt=new h;function dNe(e,t,n,i){let r=h.clone(n.direction,$Rt),o=h.clone(n.up,JRt);if(e._scene.mode===re.SCENE3D){let a=e._projection.ellipsoid,c=At.eastNorthUpToFixedFrame(t,a,L7),u=N.inverseTransformation(c,F7);N.multiplyByPointAsVector(u,r,r),N.multiplyByPointAsVector(u,o,o)}let s=h.cross(r,o,ZRt);return i.heading=aNe(r,o),i.pitch=cNe(r),i.roll=lNe(r,o,s),i}var Coe={destination:void 0,orientation:{direction:void 0,up:void 0,heading:void 0,pitch:void 0,roll:void 0},convert:void 0,endTransform:void 0},gP=new wc;an.prototype.setView=function(e){e=e??H.EMPTY_OBJECT;let t=e.orientation??H.EMPTY_OBJECT,n=this._mode;if(n===re.MORPHING)return;l(e.endTransform)&&this._setTransform(e.endTransform);let i=e.convert??!0,r=e.destination??h.clone(this.positionWC,B7);l(r)&&l(r.west)&&(r=this.getRectangleCameraCoordinates(r,B7),i=!1),l(t.direction)&&(t=dNe(this,r,t,Coe.orientation)),gP.heading=t.heading??0,gP.pitch=t.pitch??-D.PI_OVER_TWO,gP.roll=t.roll??0,n===re.SCENE3D?YRt(this,r,gP):n===re.SCENE2D?KRt(this,r,gP,i):XRt(this,r,gP,i)};var QRt=new h;an.prototype.flyHome=function(e){let t=this._mode;if(t===re.MORPHING&&this._scene.completeMorph(),t===re.SCENE2D)this.flyTo({destination:an.DEFAULT_VIEW_RECTANGLE,duration:e,endTransform:N.IDENTITY});else if(t===re.SCENE3D){let n=this.getRectangleCameraCoordinates(an.DEFAULT_VIEW_RECTANGLE),i=h.magnitude(n);i+=i*an.DEFAULT_VIEW_FACTOR,h.normalize(n,n),h.multiplyByScalar(n,i,n),this.flyTo({destination:n,duration:e,endTransform:N.IDENTITY})}else if(t===re.COLUMBUS_VIEW){let n=this._projection.ellipsoid.maximumRadius,i=new h(0,-1,1);i=h.multiplyByScalar(h.normalize(i,i),5*n,i),this.flyTo({destination:i,duration:e,orientation:{heading:0,pitch:-Math.acos(h.normalize(i,QRt).z),roll:0},endTransform:N.IDENTITY,convert:!1})}};an.prototype.worldToCameraCoordinates=function(e,t){return l(t)||(t=new se),Sl(this),N.multiplyByVector(this._actualInvTransform,e,t)};an.prototype.worldToCameraCoordinatesPoint=function(e,t){return l(t)||(t=new h),Sl(this),N.multiplyByPoint(this._actualInvTransform,e,t)};an.prototype.worldToCameraCoordinatesVector=function(e,t){return l(t)||(t=new h),Sl(this),N.multiplyByPointAsVector(this._actualInvTransform,e,t)};an.prototype.cameraToWorldCoordinates=function(e,t){return l(t)||(t=new se),Sl(this),N.multiplyByVector(this._actualTransform,e,t)};an.prototype.cameraToWorldCoordinatesPoint=function(e,t){return l(t)||(t=new h),Sl(this),N.multiplyByPoint(this._actualTransform,e,t)};an.prototype.cameraToWorldCoordinatesVector=function(e,t){return l(t)||(t=new h),Sl(this),N.multiplyByPointAsVector(this._actualTransform,e,t)};function hNe(e,t){let n=e._scene.mapMode2D===Au.ROTATE,i=e._maxCoord.x,r=e._maxCoord.y,o,s;n?(s=i,o=-s):(s=t.x-i*2,o=t.x+i*2),t.x>i&&(t.x=s),t.x<-i&&(t.x=o),t.y>r&&(t.y=r),t.y<-r&&(t.y=-r)}var $Me=new h;an.prototype.move=function(e,t){let n=this.position;h.multiplyByScalar(e,t,$Me),h.add(n,$Me,n),this._mode===re.SCENE2D&&hNe(this,n),this._adjustOrthographicFrustum(!0)};an.prototype.moveForward=function(e){e=e??this.defaultMoveAmount,this._mode===re.SCENE2D?k7(this,e):this.move(this.direction,e)};an.prototype.moveBackward=function(e){e=e??this.defaultMoveAmount,this._mode===re.SCENE2D?k7(this,-e):this.move(this.direction,-e)};an.prototype.moveUp=function(e){e=e??this.defaultMoveAmount,this.move(this.up,e)};an.prototype.moveDown=function(e){e=e??this.defaultMoveAmount,this.move(this.up,-e)};an.prototype.moveRight=function(e){e=e??this.defaultMoveAmount,this.move(this.right,e)};an.prototype.moveLeft=function(e){e=e??this.defaultMoveAmount,this.move(this.right,-e)};an.prototype.lookLeft=function(e){e=e??this.defaultLookAmount,this._mode!==re.SCENE2D&&this.look(this.up,-e)};an.prototype.lookRight=function(e){e=e??this.defaultLookAmount,this._mode!==re.SCENE2D&&this.look(this.up,e)};an.prototype.lookUp=function(e){e=e??this.defaultLookAmount,this._mode!==re.SCENE2D&&this.look(this.right,-e)};an.prototype.lookDown=function(e){e=e??this.defaultLookAmount,this._mode!==re.SCENE2D&&this.look(this.right,e)};var eOt=new Le,tOt=new $;an.prototype.look=function(e,t){let n=t??this.defaultLookAmount,i=Le.fromAxisAngle(e,-n,eOt),r=$.fromQuaternion(i,tOt),o=this.direction,s=this.up,a=this.right;$.multiplyByVector(r,o,o),$.multiplyByVector(r,s,s),$.multiplyByVector(r,a,a)};an.prototype.twistLeft=function(e){e=e??this.defaultLookAmount,this.look(this.direction,e)};an.prototype.twistRight=function(e){e=e??this.defaultLookAmount,this.look(this.direction,-e)};var nOt=new Le,iOt=new $;an.prototype.rotate=function(e,t){let n=t??this.defaultRotateAmount,i=Le.fromAxisAngle(e,-n,nOt),r=$.fromQuaternion(i,iOt);$.multiplyByVector(r,this.position,this.position),$.multiplyByVector(r,this.direction,this.direction),$.multiplyByVector(r,this.up,this.up),h.cross(this.direction,this.up,this.right),h.cross(this.right,this.direction,this.up),this._adjustOrthographicFrustum(!1)};an.prototype.rotateDown=function(e){e=e??this.defaultRotateAmount,mNe(this,e)};an.prototype.rotateUp=function(e){e=e??this.defaultRotateAmount,mNe(this,-e)};var rOt=new h,oOt=new h,sOt=new h,JMe=new h;function mNe(e,t){let n=e.position;if(l(e.constrainedAxis)&&!h.equalsEpsilon(e.position,h.ZERO,D.EPSILON2)){let i=h.normalize(n,rOt),r=h.equalsEpsilon(i,e.constrainedAxis,D.EPSILON2),o=h.equalsEpsilon(i,h.negate(e.constrainedAxis,JMe),D.EPSILON2);if(!r&&!o){let s=h.normalize(e.constrainedAxis,oOt),a=h.dot(i,s),c=D.acosClamped(a);t>0&&t>c&&(t=c-D.EPSILON4),a=h.dot(i,h.negate(s,JMe)),c=D.acosClamped(a),t<0&&-t>c&&(t=-c+D.EPSILON4);let u=h.cross(s,i,sOt);e.rotate(u,t)}else(r&&t<0||o&&t>0)&&e.rotate(e.right,t)}else e.rotate(e.right,t)}an.prototype.rotateRight=function(e){e=e??this.defaultRotateAmount,pNe(this,-e)};an.prototype.rotateLeft=function(e){e=e??this.defaultRotateAmount,pNe(this,e)};function pNe(e,t){l(e.constrainedAxis)?e.rotate(e.constrainedAxis,t):e.rotate(e.up,t)}function k7(e,t){let n=e.frustum,i;if(t=t*.5,Math.abs(n.top)+Math.abs(n.bottom)>Math.abs(n.left)+Math.abs(n.right)){let r=n.top-t,o=n.bottom+t,s=e._maxCoord.y;e._scene.mapMode2D===Au.ROTATE&&(s*=e.maximumZoomFactor),o>s&&(o=s,r=-s),r<=o&&(r=1,o=-1),i=n.right/n.top,n.top=r,n.bottom=o,n.right=n.top*i,n.left=-n.right}else{let r=n.right-t,o=n.left+t,s=e._maxCoord.x;e._scene.mapMode2D===Au.ROTATE&&(s*=e.maximumZoomFactor),r>s&&(r=s,o=-s),r<=o&&(r=1,o=-1),i=n.top/n.right,n.right=r,n.left=o,n.top=n.right*i,n.bottom=-n.top}}function gNe(e,t){e.move(e.direction,t)}an.prototype.zoomIn=function(e){e=e??this.defaultZoomAmount,this._mode===re.SCENE2D?k7(this,e):gNe(this,e)};an.prototype.zoomOut=function(e){e=e??this.defaultZoomAmount,this._mode===re.SCENE2D?k7(this,-e):gNe(this,-e)};an.prototype.getMagnitude=function(){if(this._mode===re.SCENE3D)return h.magnitude(this.position);if(this._mode===re.COLUMBUS_VIEW)return Math.abs(this.position.z);if(this._mode===re.SCENE2D)return Math.max(this.frustum.right-this.frustum.left,this.frustum.top-this.frustum.bottom)};var aOt=new N;an.prototype.lookAt=function(e,t){let i=this._scene.ellipsoid??ee.default,r=At.eastNorthUpToFixedFrame(e,i,aOt);this.lookAtTransform(r,t)};var cOt=new h,lOt=new Le,uOt=new Le,fOt=new $;function _Ne(e,t,n,i){t=D.clamp(t,-D.PI_OVER_TWO,D.PI_OVER_TWO),e=D.zeroToTwoPi(e)-D.PI_OVER_TWO;let r=Le.fromAxisAngle(h.UNIT_Y,-t,lOt),o=Le.fromAxisAngle(h.UNIT_Z,-e,uOt),s=Le.multiply(o,r,o),a=$.fromQuaternion(s,fOt),c=h.clone(h.UNIT_X,i);return $.multiplyByVector(a,c,c),h.negate(c,c),h.multiplyByScalar(c,n,c),c}an.prototype.lookAtTransform=function(e,t){if(this._setTransform(e),!l(t))return;let n;if(l(t.heading)?n=_Ne(t.heading,t.pitch,t.range,cOt):n=t,this._mode===re.SCENE2D){U.clone(U.ZERO,this.position),h.negate(n,this.up),this.up.z=0,h.magnitudeSquared(this.up)<D.EPSILON10&&h.clone(h.UNIT_Y,this.up),h.normalize(this.up,this.up),this._setTransform(N.IDENTITY),h.negate(h.UNIT_Z,this.direction),h.cross(this.direction,this.up,this.right),h.normalize(this.right,this.right);let i=this.frustum,r=i.top/i.right;i.right=h.magnitude(n)*.5,i.left=-i.right,i.top=r*i.right,i.bottom=-i.top,this._setTransform(e);return}h.clone(n,this.position),h.negate(this.position,this.direction),h.normalize(this.direction,this.direction),h.cross(this.direction,h.UNIT_Z,this.right),h.magnitudeSquared(this.right)<D.EPSILON10&&h.clone(h.UNIT_X,this.right),h.normalize(this.right,this.right),h.cross(this.right,this.direction,this.up),h.normalize(this.up,this.up),this._adjustOrthographicFrustum(!0)};var dOt=new N,ZMe=new h,hOt=new h,QMe=new h;an.prototype.lookAtWorldPosition=function(e,t=ee.default){let n=N.clone(this._transform,dOt);this._setTransform(N.IDENTITY);let i=h.subtract(e,this.positionWC,ZMe);h.magnitudeSquared(i)<D.EPSILON8&&(i=h.clone(this.directionWC,ZMe)),i=h.normalize(i,this.direction);let r=t.geodeticSurfaceNormal(e,hOt),o=h.cross(i,r,QMe);h.magnitudeSquared(o)<D.EPSILON8&&(o=h.clone(this.rightWC,QMe)),h.normalize(o,this.right);let s=h.cross(o,i,this.up);h.normalize(s,this.up),this._setTransform(n)};var Az=new he,mOt=new he,pOt=new h,gOt=new h,_Ot=new h,yOt=new h,AOt=new h,bOt=new h,xOt=new h,xoe=new h,TOt={direction:new h,right:new h,up:new h},eNe;function vl(e,t,n,i){return Math.abs(h.dot(t,n))/i-h.dot(e,n)}function yNe(e,t,n,i){let r=e._projection.ellipsoid,o=i?e:TOt,{north:s,south:a,west:c}=t,{east:u}=t;c>u&&(u+=D.TWO_PI);let f=(c+u)*.5,d;if(a<-D.PI_OVER_TWO+D.RADIANS_PER_DEGREE&&s>D.PI_OVER_TWO-D.RADIANS_PER_DEGREE)d=0;else{let O=Az;O.longitude=f,O.latitude=s,O.height=0;let L=mOt;L.longitude=f,L.latitude=a,L.height=0;let _=eNe;(!l(_)||_.ellipsoid!==r)&&(eNe=_=new xg(void 0,void 0,r)),_.setEndPoints(O,L),d=_.interpolateUsingFraction(.5,Az).latitude}let p=Az;p.longitude=f,p.latitude=d,p.height=0;let g=r.cartographicToCartesian(p,xOt),m=Az;m.longitude=u,m.latitude=s;let y=r.cartographicToCartesian(m,pOt);m.longitude=c;let A=r.cartographicToCartesian(m,_Ot);m.longitude=f;let b=r.cartographicToCartesian(m,AOt);m.latitude=a;let x=r.cartographicToCartesian(m,bOt);m.longitude=u;let T=r.cartographicToCartesian(m,yOt);m.longitude=c;let E=r.cartographicToCartesian(m,gOt);h.subtract(A,g,A),h.subtract(T,g,T),h.subtract(y,g,y),h.subtract(E,g,E),h.subtract(b,g,b),h.subtract(x,g,x);let v=r.geodeticSurfaceNormal(g,o.direction);h.negate(v,v);let S=h.cross(v,h.UNIT_Z,o.right);h.normalize(S,S);let I=h.cross(S,v,o.up),R;if(e.frustum instanceof gn){let O=Math.max(h.distance(y,A),h.distance(T,E)),L=Math.max(h.distance(y,T),h.distance(A,E)),_,C,w=e.frustum._offCenterFrustum,P=w.right/w.top,M=L*P;O>M?(_=O,C=_/P):(C=L,_=M),R=Math.max(_,C)}else{let O=Math.tan(e.frustum.fovy*.5),L=e.frustum.aspectRatio*O;if(R=Math.max(vl(v,I,A,O),vl(v,I,T,O),vl(v,I,y,O),vl(v,I,E,O),vl(v,I,b,O),vl(v,I,x,O),vl(v,S,A,L),vl(v,S,T,L),vl(v,S,y,L),vl(v,S,E,L),vl(v,S,b,L),vl(v,S,x,L)),a<0&&s>0){let _=Az;_.longitude=c,_.latitude=0,_.height=0;let C=r.cartographicToCartesian(_,xoe);h.subtract(C,g,C),R=Math.max(R,vl(v,I,C,O),vl(v,S,C,L)),_.longitude=u,C=r.cartographicToCartesian(_,xoe),h.subtract(C,g,C),R=Math.max(R,vl(v,I,C,O),vl(v,S,C,L))}}return h.add(g,h.multiplyByScalar(v,-R,xoe),n)}var EOt=new he,COt=new h,vOt=new h;function SOt(e,t,n){let i=e._projection;t.west>t.east&&(t=ie.MAX_VALUE);let r=e._actualTransform,o=e._actualInvTransform,s=EOt;s.longitude=t.east,s.latitude=t.north;let a=i.project(s,COt);N.multiplyByPoint(r,a,a),N.multiplyByPoint(o,a,a),s.longitude=t.west,s.latitude=t.south;let c=i.project(s,vOt);if(N.multiplyByPoint(r,c,c),N.multiplyByPoint(o,c,c),n.x=(a.x-c.x)*.5+c.x,n.y=(a.y-c.y)*.5+c.y,l(e.frustum.fovy)){let u=Math.tan(e.frustum.fovy*.5),f=e.frustum.aspectRatio*u;n.z=Math.max((a.x-c.x)/f,(a.y-c.y)/u)*.5}else{let u=a.x-c.x,f=a.y-c.y;n.z=Math.max(u,f)}return n}var wOt=new he,IOt=new h,POt=new h;function DOt(e,t,n){let i=e._projection,r=t.east;t.west>t.east&&(e._scene.mapMode2D===Au.INFINITE_SCROLL?r+=D.TWO_PI:(t=ie.MAX_VALUE,r=t.east));let o=wOt;o.longitude=r,o.latitude=t.north;let s=i.project(o,IOt);o.longitude=t.west,o.latitude=t.south;let a=i.project(o,POt),c=Math.abs(s.x-a.x)*.5,u=Math.abs(s.y-a.y)*.5,f,d,p=e.frustum.right/e.frustum.top,g=u*p;return c>g?(f=c,d=f/p):(d=u,f=g),u=Math.max(2*f,2*d),n.x=(s.x-a.x)*.5+a.x,n.y=(s.y-a.y)*.5+a.y,o=i.unproject(n,o),o.height=u,n=i.project(o,n),n}an.prototype.getRectangleCameraCoordinates=function(e,t){let n=this._mode;if(l(t)||(t=new h),n===re.SCENE3D)return yNe(this,e,t);if(n===re.COLUMBUS_VIEW)return SOt(this,e,t);if(n===re.SCENE2D)return DOt(this,e,t)};var ROt=new pn;function OOt(e,t,n,i){n=n??ee.default;let r=e.getPickRay(t,ROt),o=_i.rayEllipsoid(r,n);if(!o)return;let s=o.start>0?o.start:o.stop;return pn.getPoint(r,s,i)}var MOt=new pn;function NOt(e,t,n,i){let o=e.getPickRay(t,MOt).origin;o=h.fromElements(o.y,o.z,0,o);let s=n.unproject(o);if(!(s.latitude<-D.PI_OVER_TWO||s.latitude>D.PI_OVER_TWO))return n.ellipsoid.cartographicToCartesian(s,i)}var LOt=new pn;function FOt(e,t,n,i){let r=e.getPickRay(t,LOt),o=-r.origin.x/r.direction.x;pn.getPoint(r,o,i);let s=n.unproject(new h(i.y,i.z,0));if(!(s.latitude<-D.PI_OVER_TWO||s.latitude>D.PI_OVER_TWO||s.longitude<-Math.PI||s.longitude>Math.PI))return n.ellipsoid.cartographicToCartesian(s,i)}an.prototype.pickEllipsoid=function(e,t,n){let i=this._scene.canvas;if(!(i.clientWidth===0||i.clientHeight===0)){if(l(n)||(n=new h),t=t??ee.default,this._mode===re.SCENE3D)n=OOt(this,e,t,n);else if(this._mode===re.SCENE2D)n=NOt(this,e,this._projection,n);else if(this._mode===re.COLUMBUS_VIEW)n=FOt(this,e,this._projection,n);else return;return n}};var BOt=new h,kOt=new h,UOt=new h;function zOt(e,t,n){let i=e._scene.canvas,r=i.clientWidth,o=i.clientHeight,s=Math.tan(e.frustum.fovy*.5),a=e.frustum.aspectRatio*s,c=e.frustum.near,u=2/r*t.x-1,f=2/o*(o-t.y)-1,d=e.positionWC;h.clone(d,n.origin);let p=h.multiplyByScalar(e.directionWC,c,BOt);h.add(d,p,p);let g=h.multiplyByScalar(e.rightWC,u*c*a,kOt),m=h.multiplyByScalar(e.upWC,f*c*s,UOt),y=h.add(p,g,n.direction);return h.add(y,m,y),h.subtract(y,d,y),h.normalize(y,y),n}var M7=new h;function VOt(e,t,n){let i=e._scene.canvas,r=i.clientWidth,o=i.clientHeight,s=e.frustum,a=s.offCenterFrustum;l(a)&&(s=a);let c=2/r*t.x-1;c*=(s.right-s.left)*.5;let u=2/o*(o-t.y)-1;u*=(s.top-s.bottom)*.5;let f=n.origin;if(h.clone(e.positionWC,f),h.multiplyByScalar(e.rightWC,c,M7),h.add(M7,f,f),h.multiplyByScalar(e.upWC,u,M7),h.add(M7,f,f),h.clone(e.directionWC,n.direction),e._mode===re.SCENE2D&&e._scene.mapMode2D===Au.INFINITE_SCROLL){let d=e._maxCoord.x;f.y=D.mod(f.y+d,2*d)-d}return n}an.prototype.getPickRay=function(e,t){l(t)||(t=new pn);let n=this._scene.canvas;if(n.clientWidth<=0||n.clientHeight<=0)return;let i=this.frustum;return l(i.aspectRatio)&&l(i.fov)&&l(i.near)?zOt(this,e,t):VOt(this,e,t)};var jOt=new h,HOt=new h;an.prototype.distanceToBoundingSphere=function(e){let t=h.subtract(this.positionWC,e.center,jOt),n=h.multiplyByScalar(this.directionWC,h.dot(t,this.directionWC),HOt);return Math.max(0,h.magnitude(n)-e.radius)};var GOt=new U;an.prototype.getPixelSize=function(e,t,n){let i=this.distanceToBoundingSphere(e),r=this.frustum.getPixelDimensions(t,n,i,this._scene.pixelRatio,GOt);return Math.max(r.x,r.y)};function WOt(e,t,n,i,r,o){let s=h.clone(t);n.y>i?s.y-=n.y-i:n.y<-i&&(s.y+=-i-n.y),n.z>r?s.z-=n.z-r:n.z<-r&&(s.z+=-r-n.z);function a(c){let u=h.lerp(t,s,c.time,new h);e.worldToCameraCoordinatesPoint(u,e.position)}return{easingFunction:Ls.EXPONENTIAL_OUT,startObject:{time:0},stopObject:{time:1},duration:o,update:a}}var qOt=new h,tNe=new h,YOt=new h,XOt=new h;function KOt(e,t){let n=e.position,i=e.direction,r=e.worldToCameraCoordinatesVector(h.UNIT_X,qOt),o=-h.dot(r,n)/h.dot(r,i),s=h.add(n,h.multiplyByScalar(i,o,tNe),tNe);e.cameraToWorldCoordinatesPoint(s,s),n=e.cameraToWorldCoordinatesPoint(e.position,YOt);let a=Math.tan(e.frustum.fovy*.5),c=e.frustum.aspectRatio*a,u=h.magnitude(h.subtract(n,s,XOt)),f=c*u,d=a*u,p=e._maxCoord.x,g=e._maxCoord.y,m=Math.max(f-p,p),y=Math.max(d-g,g);if(n.z<-m||n.z>m||n.y<-y||n.y>y){let A=s.y<-m||s.y>m,b=s.z<-y||s.z>y;if(A||b)return WOt(e,n,s,m,y,t)}}an.prototype.createCorrectPositionTween=function(e){if(this._mode===re.COLUMBUS_VIEW)return KOt(this,e)};var $Ot=new h,Za={destination:void 0,heading:void 0,pitch:void 0,roll:void 0,duration:void 0,complete:void 0,cancel:void 0,endTransform:void 0,maximumHeight:void 0,easingFunction:void 0};an.prototype.cancelFlight=function(){l(this._currentFlight)&&(this._currentFlight.cancelTween(),this._currentFlight=void 0)};an.prototype.completeFlight=function(){if(l(this._currentFlight)){this._currentFlight.cancelTween();let e={destination:void 0,orientation:{heading:void 0,pitch:void 0,roll:void 0}};e.destination=Za.destination,e.orientation.heading=Za.heading,e.orientation.pitch=Za.pitch,e.orientation.roll=Za.roll,this.setView(e),l(this._currentFlight.complete)&&this._currentFlight.complete(),this._currentFlight=void 0}};an.prototype.flyTo=function(e){e=e??H.EMPTY_OBJECT;let t=e.destination;if(this._mode===re.MORPHING)return;this.cancelFlight();let i=t instanceof ie;i&&(t=this.getRectangleCameraCoordinates(t,$Ot));let r=e.orientation??H.EMPTY_OBJECT;if(l(r.direction)&&(r=dNe(this,t,r,Coe.orientation)),l(e.duration)&&e.duration<=0){let f=Coe;f.destination=e.destination,f.orientation.heading=r.heading,f.orientation.pitch=r.pitch,f.orientation.roll=r.roll,f.convert=e.convert,f.endTransform=e.endTransform,this.setView(f),typeof e.complete=="function"&&e.complete();return}let o=this,s;Za.destination=t,Za.heading=r.heading,Za.pitch=r.pitch,Za.roll=r.roll,Za.duration=e.duration,Za.complete=function(){s===o._currentFlight&&(o._currentFlight=void 0),l(e.complete)&&e.complete()},Za.cancel=e.cancel,Za.endTransform=e.endTransform,Za.convert=i?!1:e.convert,Za.maximumHeight=e.maximumHeight,Za.pitchAdjustHeight=e.pitchAdjustHeight,Za.flyOverLongitude=e.flyOverLongitude,Za.flyOverLongitudeWeight=e.flyOverLongitudeWeight,Za.easingFunction=e.easingFunction;let a=this._scene,c=yz.createTween(a,Za);if(c.duration===0){typeof c.complete=="function"&&c.complete();return}s=a.tweens.add(c),this._currentFlight=s;let u=this._scene.preloadFlightCamera;this._mode!==re.SCENE2D&&(l(u)||(u=an.clone(this)),u.setView({destination:t,orientation:r}),this._scene.preloadFlightCullingVolume=u.frustum.computeCullingVolume(u.positionWC,u.directionWC,u.upWC))};function JOt(e,t){let n=e.frustum,i=Math.tan(n.fovy*.5),r=n.aspectRatio*i;return Math.max(t/r,t/i)}function ZOt(e,t){let n=e.frustum,i=n.offCenterFrustum;l(i)&&(n=i);let r,o,s=n.right/n.top,a=t*s;return t>a?(r=t,o=r/s):(o=t,r=a),Math.max(r,o)*1.5}var QOt=100;function ANe(e,t,n){n=ph.clone(l(n)?n:an.DEFAULT_OFFSET);let i=e._scene.screenSpaceCameraController.minimumZoomDistance,r=e._scene.screenSpaceCameraController.maximumZoomDistance,o=n.range;if(!l(o)||o===0){let s=t.radius;s===0?n.range=QOt:e.frustum instanceof gn||e._mode===re.SCENE2D?n.range=ZOt(e,s):n.range=JOt(e,s),n.range=D.clamp(n.range,i,r)}return n}an.prototype.viewBoundingSphere=function(e,t){t=ANe(this,e,t),this.lookAt(e.center,t)};var eMt=new N,nNe=new h,tMt=new h,nMt=new h,iMt=new h,rMt=new se,oMt=new Le,sMt=new $;an.prototype.flyToBoundingSphere=function(e,t){t=t??H.EMPTY_OBJECT;let n=this._mode===re.SCENE2D||this._mode===re.COLUMBUS_VIEW;this._setTransform(N.IDENTITY);let i=ANe(this,e,t.offset),r;n?r=h.multiplyByScalar(h.UNIT_Z,i.range,nNe):r=_Ne(i.heading,i.pitch,i.range,nNe);let s=this._scene.ellipsoid??ee.default,a=At.eastNorthUpToFixedFrame(e.center,s,eMt);N.multiplyByPoint(a,r,r);let c,u;if(!n){if(c=h.subtract(e.center,r,tMt),h.normalize(c,c),u=N.multiplyByPointAsVector(a,h.UNIT_Z,nMt),1-Math.abs(h.dot(c,u))<D.EPSILON6){let d=Le.fromAxisAngle(c,i.heading,oMt),p=$.fromQuaternion(d,sMt);h.fromCartesian4(N.getColumn(a,1,rMt),u),$.multiplyByVector(p,u,u)}let f=h.cross(c,u,iMt);h.cross(f,c,u),h.normalize(u,u)}this.flyTo({destination:r,orientation:{direction:c,up:u},duration:t.duration,complete:t.complete,cancel:t.cancel,endTransform:t.endTransform,maximumHeight:t.maximumHeight,easingFunction:t.easingFunction,flyOverLongitude:t.flyOverLongitude,flyOverLongitudeWeight:t.flyOverLongitudeWeight,pitchAdjustHeight:t.pitchAdjustHeight})};var iNe=new h,rNe=new h,Toe=new h,oNe=new h,bz=[new h,new h,new h,new h];function aMt(e,t){let n=t.radii,i=e.positionWC,r=h.multiplyComponents(t.oneOverRadii,i,iNe),o=h.magnitude(r),s=h.normalize(r,rNe),a,c;h.equalsEpsilon(s,h.UNIT_Z,D.EPSILON10)?(a=new h(0,1,0),c=new h(0,0,1)):(a=h.normalize(h.cross(h.UNIT_Z,s,Toe),Toe),c=h.normalize(h.cross(s,a,oNe),oNe));let u=Math.sqrt(h.magnitudeSquared(r)-1),f=h.multiplyByScalar(s,1/o,iNe),d=u/o,p=h.multiplyByScalar(a,d,rNe),g=h.multiplyByScalar(c,d,Toe),m=h.add(f,g,bz[0]);h.subtract(m,p,m),h.multiplyComponents(n,m,m);let y=h.subtract(f,g,bz[1]);h.subtract(y,p,y),h.multiplyComponents(n,y,y);let A=h.subtract(f,g,bz[2]);h.add(A,p,A),h.multiplyComponents(n,A,A);let b=h.add(f,g,bz[3]);return h.add(b,p,b),h.multiplyComponents(n,b,b),bz}var Eoe=new U,cMt=new h,vb=[new he,new he,new he,new he];function N7(e,t,n,i,r,o){Eoe.x=e,Eoe.y=t;let s=i.pickEllipsoid(Eoe,r,cMt);return l(s)?(vb[n]=r.cartesianToCartographic(s,vb[n]),1):(vb[n]=r.cartesianToCartographic(o[n],vb[n]),0)}an.prototype.computeViewRectangle=function(e,t){e=e??ee.default;let n=this.frustum.computeCullingVolume(this.positionWC,this.directionWC,this.upWC),i=new ue(h.ZERO,e.maximumRadius);if(n.computeVisibility(i)===$t.OUTSIDE)return;let o=this._scene.canvas,s=o.clientWidth,a=o.clientHeight,c=0,u=aMt(this,e);if(c+=N7(0,0,0,this,e,u),c+=N7(0,a,1,this,e,u),c+=N7(s,a,2,this,e,u),c+=N7(s,0,3,this,e,u),c<2)return ie.MAX_VALUE;t=ie.fromCartographicArray(vb,t);let f=0,d=vb[3].longitude;for(let p=0;p<4;++p){let g=vb[p].longitude,m=Math.abs(g-d);m>D.PI?f+=D.TWO_PI-m:f+=m,d=g}return D.equalsEpsilon(Math.abs(f),D.TWO_PI,D.EPSILON9)&&(t.west=-D.PI,t.east=D.PI,vb[0].latitude>=0?t.north=D.PI_OVER_TWO:t.south=-D.PI_OVER_TWO),t};an.prototype.switchToPerspectiveFrustum=function(){if(this._mode===re.SCENE2D||this.frustum instanceof Ji)return;let e=this._scene;this.frustum=new Ji,this.frustum.aspectRatio=e.drawingBufferWidth/e.drawingBufferHeight,this.frustum.fov=D.toRadians(60)};an.prototype.switchToOrthographicFrustum=function(){if(this._mode===re.SCENE2D||this.frustum instanceof gn)return;let e=uNe(this),t=this._scene;this.frustum=new gn,this.frustum.aspectRatio=t.drawingBufferWidth/t.drawingBufferHeight,this.frustum.width=e};an.clone=function(e,t){return l(t)||(t=new an(e._scene)),h.clone(e.position,t.position),h.clone(e.direction,t.direction),h.clone(e.up,t.up),h.clone(e.right,t.right),N.clone(e._transform,t.transform),t._transformChanged=!0,t.frustum=e.frustum.clone(),t};var Or=an;function lMt(e){this.pass=e.pass,this.commandList=e.commandList,this.camera=e.camera,this.cullingVolume=e.cullingVolume,this.ready=!1}var vh=lMt;var Ioe=class{constructor(){this._controllers=[],this._needsUpdate=new Set}get controllerCount(){return this._controllers.length}registerController(t,n,i){let r=i??this.controllerCount;this._controllers.splice(r,0,t),this._needsUpdate.add(t),t.connectedCallback(n)}unregisterController(t,n){let i=this._controllers,r=i.indexOf(t);r!==-1&&(i.splice(r,1),t.disconnectedCallback(n))}update(t,n){for(let i of this._controllers)i.enabled&&(this._needsUpdate.has(i)&&(i.firstUpdate(t,n),this._needsUpdate.delete(i)),i.update(t,n))}},xz=Ioe;var vNe=Qo(Tf(),1),bNe=576,uMt=100,Tz="#ffffff",Ez="#48b";function SNe(e,t){this.credit=e,this.count=t??1}function fMt(e,t){let n=e.length;for(let i=0;i<n;i++){let r=e[i];if(It.equals(r,t))return!0}return!1}function dMt(e){let t=e._previousCesiumCredit,n=e._currentCesiumCredit;It.equals(n,t)||(l(t)&&e._cesiumCreditContainer.removeChild(t.element),l(n)&&e._cesiumCreditContainer.appendChild(n.element),e._previousCesiumCredit=n)}var wNe="cesium-credit-delimiter";function xNe(e){let t=document.createElement("span");return t.textContent=e,t.className=wNe,t}function TNe(e,t){if(l(t)){let n=document.createElement(t);n._creditId=e._creditId,n.appendChild(e),e=n}return e}function ENe(e,t,n,i){let r=e.childNodes,o=-1;t.sort(function(s,a){return a.count-s.count});for(let s=0;s<t.length;++s){let a=t[s].credit;if(l(a)){if(o=s,l(n)&&(o*=2,s>0)){let u=o-1;if(r.length<=u)e.appendChild(xNe(n));else{let f=r[u];f.className!==wNe&&e.replaceChild(xNe(n),f)}}let c=a.element;if(r.length<=o)e.appendChild(TNe(c,i));else{let u=r[o];u._creditId!==a._id&&e.replaceChild(TNe(c,i),u)}}}for(++o;o<r.length;)e.removeChild(r[o])}function hMt(e){let t=e._lightboxCredits,n=e.viewport.clientWidth,i=e.viewport.clientHeight;n!==e._lastViewportWidth&&(n<bNe?(t.className="cesium-credit-lightbox cesium-credit-lightbox-mobile",t.style.marginTop="0"):(t.className="cesium-credit-lightbox cesium-credit-lightbox-expanded",t.style.marginTop=`${Math.floor((i-t.clientHeight)*.5)}px`),e._lastViewportWidth=n),n>=bNe&&i!==e._lastViewportHeight&&(t.style.marginTop=`${Math.floor((i-t.clientHeight)*.5)}px`,e._lastViewportHeight=i)}function CNe(e){return function(t){t.key!=="Enter"&&t.key!==" "||(t.preventDefault(),t.stopPropagation(),e())}}function mMt(e){let t=` + }`,lt.sources.push(mt),Gt.sources.push(pxt(Xe)),Gt.sources.push(gxt(S));let ft=Qt.fromCache({context:n.context,vertexShaderSource:Gt,fragmentShaderSource:lt,attributeLocations:ge.getAttributeLocations()});st=vt[$e]=new Tte(r,$e,this.material,ft,Pe,qe)}return i.surfaceShader=st,st.shaderProgram}destroy(){let t,n,i=this._shadersByTexturesFlags;for(let r in i)if(i.hasOwnProperty(r)){let o=i[r];if(!l(o))continue;for(t in o)o.hasOwnProperty(t)&&(n=o[t],l(n)&&n.shaderProgram.destroy())}return le(this)}};function pxt(e){let t="vec4 getPosition(vec3 position, float height, vec2 textureCoordinates) { return getPosition3DMode(position, height, textureCoordinates); }",n="vec4 getPosition(vec3 position, float height, vec2 textureCoordinates) { return getPositionColumbusViewMode(position, height, textureCoordinates); }",i="vec4 getPosition(vec3 position, float height, vec2 textureCoordinates) { return getPositionMorphingMode(position, height, textureCoordinates); }",r;switch(e){case re.SCENE3D:r=t;break;case re.SCENE2D:case re.COLUMBUS_VIEW:r=n;break;case re.MORPHING:r=i;break}return r}function gxt(e){return e?"float get2DYPositionFraction(vec2 textureCoordinates) { return get2DMercatorYPositionFraction(textureCoordinates); }":"float get2DYPositionFraction(vec2 textureCoordinates) { return get2DGeographicYPositionFraction(textureCoordinates); }"}var k3=Ete;var Vwe={NONE:-1,PARTIAL:0,FULL:1};Object.freeze(Vwe);var Ko=Vwe;var jwe={START:0,LOADING:1,DONE:2,FAILED:3};Object.freeze(jwe);var $a=jwe;var Hwe={FAILED:0,UNLOADED:1,RECEIVING:2,RECEIVED:3,TRANSFORMING:4,TRANSFORMED:5,READY:6};Object.freeze(Hwe);var kr=Hwe;var A0=class e{constructor(){ut(this,"request");this.imagery=[],this.waterMaskTexture=void 0,this.waterMaskTranslationAndScale=new se(0,0,1,1),this.terrainData=void 0,this.vectorData=void 0,this.clippingPolygonData=void 0,this.vertexArray=void 0,this.tileBoundingRegion=void 0,this.occludeePointInScaledSpace=new h,this.boundingVolumeSourceTile=void 0,this.boundingVolumeIsFromMesh=!1,this.terrainState=kr.UNLOADED,this.mesh=void 0,this.fill=void 0,this.pickBoundingSphere=new ue,this.surfaceShader=void 0,this.isClipped=!0,this.clippedByBoundaries=!1}get eligibleForUnloading(){let t=this.terrainState,i=!(t===kr.RECEIVING||t===kr.TRANSFORMING),r=this.imagery;for(let o=0,s=r.length;i&&o<s;++o){let a=r[o];i=!l(a.loadingImagery)||a.loadingImagery.state!==Vn.TRANSITIONING}return i}get renderedMesh(){if(l(this.vertexArray))return this.mesh;if(l(this.fill))return this.fill.mesh}pick(t,n,i,r,o){if(!l(this.renderedMesh))return;let s=this.renderedMesh.pick(t,r,n,i);return h.clone(s,o)}freeResources(){l(this.waterMaskTexture)&&(--this.waterMaskTexture.referenceCount,this.waterMaskTexture.referenceCount===0&&this.waterMaskTexture.destroy(),this.waterMaskTexture=void 0),l(this.vectorData)&&(vs.freeResources(this.vectorData),this.vectorData=void 0),l(this.clippingPolygonData)&&(Nc.releaseRectangleData(this.clippingPolygonData),this.clippingPolygonData=void 0),this.terrainData=void 0,this.terrainState=kr.UNLOADED,this.mesh=void 0,this.fill=this.fill&&this.fill.destroy();let t=this.imagery;for(let n=0,i=t.length;n<i;++n)t[n].freeResources();this.imagery.length=0,this.freeVertexArray()}freeVertexArray(){e._freeVertexArray(this.vertexArray),this.vertexArray=void 0,e._freeVertexArray(this.wireframeVertexArray),this.wireframeVertexArray=void 0}static initialize(t,n,i,r){l(t.data)||(t.data=new e),t.state===$a.START&&(_xt(t,n,i,r),t.state=$a.LOADING)}static processStateMachine(t,n,i,r,o,s,a,c){e.initialize(t,i,r,o);let u=t.data;if(t.state===$a.LOADING&&yxt(t,n,i,r,o,s,a),c)return;let f=t.renderable;t.renderable=l(u.vertexArray);let d=u.terrainState===kr.READY;t.upsampledFromParent=l(u.terrainData)&&u.terrainData.wasCreatedByUpsampling();let p=u.processImagery(t,i,n);if(d&&p){let g=t._loadedCallbacks,m={};for(let y in g)g.hasOwnProperty(y)&&(g[y](t)||(m[y]=g[y]));t._loadedCallbacks=m,t.state=$a.DONE}f&&(t.renderable=!0)}processImagery(t,n,i,r){let o=t.data,s=t.upsampledFromParent,a=!1,c=!0,u=o.imagery,f,d;for(f=0,d=u.length;f<d;++f){let p=u[f];if(!l(p.loadingImagery)){s=!1;continue}if(p.loadingImagery.state===Vn.PLACEHOLDER){let m=p.loadingImagery.imageryLayer;if(m.ready){p.freeResources(),u.splice(f,1),m._createTileImagerySkeletons(t,n,f),--f,d=u.length;continue}else s=!1}let g=p.processStateMachine(t,i,r);c=c&&g,a=a||g||l(p.readyImagery),s=s&&l(p.loadingImagery)&&(p.loadingImagery.state===Vn.FAILED||p.loadingImagery.state===Vn.INVALID)}return t.upsampledFromParent=s,t.renderable=t.renderable&&(a||c),c}addGeodeticSurfaceNormals(t,n){Gwe(this,!0,t,n)}removeGeodeticSurfaceNormals(t){Gwe(this,!1,void 0,t)}updateExaggeration(t,n,i){let r=this,o=r.renderedMesh;if(o===void 0)return;let s=n.verticalExaggeration,a=n.verticalExaggerationRelativeHeight,c=s!==1,u=o.encoding,f=u.exaggeration!==s,d=u.exaggerationRelativeHeight!==a;if(f||d){if(f)if(c&&!u.hasGeodeticSurfaceNormals){let g=t.tilingScheme.ellipsoid;r.addGeodeticSurfaceNormals(g,n)}else!c&&u.hasGeodeticSurfaceNormals&&r.removeGeodeticSurfaceNormals(n);if(u.exaggeration=s,u.exaggerationRelativeHeight=a,i!==void 0){i._tileToUpdateHeights.push(t);let g=t.customData;for(let m of g)m.level=-1}o.updateExaggeration(s,a)}}updateSceneMode(t){let i=this.renderedMesh;i!==void 0&&i.updateSceneMode(t)}static _createVertexArrayForMesh(t,n){let i=n.vertices,r=tt.createVertexBuffer({context:t,typedArray:i,usage:Me.STATIC_DRAW}),o=n.encoding.getAttributes(r),s=n.indices.indexBuffers||{},a=s[t.id];if(!l(a)||a.isDestroyed()){let c=n.indices;a=tt.createIndexBuffer({context:t,typedArray:c,usage:Me.STATIC_DRAW,indexDatatype:je.fromSizeInBytes(c.BYTES_PER_ELEMENT)}),a.vertexArrayDestroyable=!1,a.referenceCount=1,s[t.id]=a,n.indices.indexBuffers=s}else++a.referenceCount;return new zn({context:t,attributes:o,indexBuffer:a})}static _freeVertexArray(t){if(l(t)){let n=t.indexBuffer;t.isDestroyed()||t.destroy(),l(n)&&!n.isDestroyed()&&l(n.referenceCount)&&(--n.referenceCount,n.referenceCount===0&&n.destroy())}}_findAncestorTileWithTerrainData(t){let n=t.parent;for(;l(n)&&(!l(n.data)||!l(n.data.terrainData)||n.data.terrainData.wasCreatedByUpsampling());)n=n.parent;return n}_computeWaterMaskTranslationAndScale(t,n,i){let r=n.rectangle,o=t.rectangle,s=o.width,a=o.height,c=s/r.width,u=a/r.height;return i.x=c*(o.west-r.west)/s,i.y=u*(o.south-r.south)/a,i.z=c,i.w=u,i}};function Gwe(e,t,n,i){let r=e.renderedMesh,o=r.vertices,s=r.encoding,a=o.length/s.stride,c=Eo.clone(s);c.hasGeodeticSurfaceNormals=t,c=Eo.clone(c);let u=c.stride,f=new Float32Array(a*u);t?s.addGeodeticSurfaceNormals(o,f,n):s.removeGeodeticSurfaceNormals(o,f),r.vertices=f,r.stride=u,r!==e.mesh?(A0._freeVertexArray(e.fill.vertexArray),e.fill.vertexArray=A0._createVertexArrayForMesh(i.context,r)):(A0._freeVertexArray(e.vertexArray),e.vertexArray=A0._createVertexArrayForMesh(i.context,r)),A0._freeVertexArray(e.wireframeVertexArray),e.wireframeVertexArray=void 0}function _xt(e,t,n,i){let r=t.getTileDataAvailable(e.x,e.y,e.level);if(!l(r)&&l(e.parent)){let s=e.parent,a=s.data;l(a)&&l(a.terrainData)&&(r=a.terrainData.isChildAvailable(s.x,s.y,e.x,e.y))}let o=e.data;r===!1&&(o.terrainState=kr.FAILED);for(let s=0,a=i.length;s<a;++s){let c=i.get(s);c.show&&c._createTileImagerySkeletons(e,t)}}function yxt(e,t,n,i,r,o,s){let a=e.data,c=e.parent;if(a.terrainState===kr.FAILED&&c!==void 0){let u=c.data;u!==void 0&&u.terrainData!==void 0&&u.terrainData.canUpsample!==!1||A0.processStateMachine(c,t,n,i,r,o,s,!0)}if(a.terrainState===kr.FAILED&&Axt(a,e,t,n,e.x,e.y,e.level),a.terrainState===kr.UNLOADED&&bxt(a,n,e.x,e.y,e.level),a.terrainState===kr.RECEIVED&&Txt(a,t,n,e.x,e.y,e.level),a.terrainState===kr.TRANSFORMED&&(Ext(a,t.context,n,e.x,e.y,e.level,s),a.updateExaggeration(e,t,o)),a.terrainState>=kr.RECEIVED&&a.waterMaskTexture===void 0&&n.hasWaterMask)if(a.terrainData.waterMask!==void 0)vxt(t.context,a);else{let f=a._findAncestorTileWithTerrainData(e),d=f?.data;l(f)&&l(d.waterMaskTexture)&&(a.waterMaskTexture=d.waterMaskTexture,++a.waterMaskTexture.referenceCount,a._computeWaterMaskTranslationAndScale(e,f,a.waterMaskTranslationAndScale))}}function Axt(e,t,n,i,r,o,s){let a=t.parent;if(!a){t.state=$a.FAILED;return}let u=a.data.terrainData,f=a.x,d=a.y,p=a.level;if(!l(u))return;let g=u.upsample(i.tilingScheme,f,d,p,r,o,s);l(g)&&(e.terrainState=kr.RECEIVING,Promise.resolve(g).then(function(m){l(m)&&(e.terrainData=m,e.terrainState=kr.RECEIVED)}).catch(function(){e.terrainState=kr.FAILED}))}function bxt(e,t,n,i,r){function o(c){if(!l(c)){e.terrainState=kr.UNLOADED,e.request=void 0;return}e.terrainData=c,e.terrainState=kr.RECEIVED,e.request=void 0}function s(c){if(e.request.state===Ti.CANCELLED){e.terrainData=void 0,e.terrainState=kr.UNLOADED,e.request=void 0;return}e.terrainState=kr.FAILED,e.request=void 0;let u=`Failed to obtain terrain tile X: ${n} Y: ${i} Level: ${r}. Error message: "${c}"`;t._requestError=Zr.reportError(t._requestError,t,t.errorEvent,u,n,i,r),t._requestError.retry&&a()}function a(){let c=new wo({throttle:!1,throttleByServer:!0,type:Zs.TERRAIN});e.request=c;let u=t.requestTileGeometry(n,i,r,c);l(u)?(e.terrainState=kr.RECEIVING,Promise.resolve(u).then(function(f){o(f)}).catch(function(f){s(f)})):(e.terrainState=kr.UNLOADED,e.request=void 0)}a()}var xxt={tilingScheme:void 0,x:0,y:0,level:0,exaggeration:1,exaggerationRelativeHeight:0,throttle:!0};function Txt(e,t,n,i,r,o){let s=n.tilingScheme,a=xxt;a.tilingScheme=s,a.x=i,a.y=r,a.level=o,a.exaggeration=t.verticalExaggeration,a.exaggerationRelativeHeight=t.verticalExaggerationRelativeHeight,a.throttle=!0;let u=e.terrainData.createMesh(a);l(u)&&(e.terrainState=kr.TRANSFORMING,Promise.resolve(u).then(function(f){e.mesh=f,e.terrainState=kr.TRANSFORMED}).catch(function(){e.terrainState=kr.FAILED}))}function Ext(e,t,n,i,r,o,s){e.vertexArray=A0._createVertexArrayForMesh(t,e.mesh),e.terrainState=kr.READY,e.fill=e.fill&&e.fill.destroy(s)}function Cxt(e){let t=e.cache.tile_waterMaskData;if(!l(t)){let n=Dt.create({context:e,pixelFormat:Ke.LUMINANCE,pixelDatatype:ze.UNSIGNED_BYTE,source:{arrayBufferView:new Uint8Array([255]),width:1,height:1}});n.referenceCount=1;let i=new jt({wrapS:hn.CLAMP_TO_EDGE,wrapT:hn.CLAMP_TO_EDGE,minificationFilter:Wt.LINEAR,magnificationFilter:Jn.LINEAR});t={allWaterTexture:n,sampler:i,destroy:function(){this.allWaterTexture.destroy()}},e.cache.tile_waterMaskData=t}return t}function vxt(e,t){let n=t.terrainData.waterMask,i=Cxt(e),r,o=n.length;if(n instanceof ImageBitmap)r=Dt.create({context:e,source:n,sampler:i.sampler,flipY:!1,skipColorSpaceConversion:!0});else if(o===1)if(n[0]!==0)r=i.allWaterTexture;else return;else{let s=Math.sqrt(o);r=Dt.create({context:e,pixelFormat:Ke.LUMINANCE,pixelDatatype:ze.UNSIGNED_BYTE,source:{width:s,height:s,arrayBufferView:n},sampler:i.sampler,flipY:!1}),r.referenceCount=0}++r.referenceCount,t.waterMaskTexture=r,se.fromElements(0,0,1,1,t.waterMaskTranslationAndScale)}var _h=A0;var Sxt={WEST:0,NORTH:1,EAST:2,SOUTH:3,NORTHWEST:4,NORTHEAST:5,SOUTHWEST:6,SOUTHEAST:7},wn=Sxt;var Wwe={NONE:0,CULLED:1,RENDERED:2,REFINED:3,RENDERED_AND_KICKED:6,REFINED_AND_KICKED:7,CULLED_BUT_NEEDED:9,wasKicked:function(e){return e>=Wwe.RENDERED_AND_KICKED},originalResult:function(e){return e&3},kick:function(e){return e|4}},pi=Wwe;function aI(e){this.tile=e,this.frameLastUpdated=void 0,this.westMeshes=[],this.westTiles=[],this.southMeshes=[],this.southTiles=[],this.eastMeshes=[],this.eastTiles=[],this.northMeshes=[],this.northTiles=[],this.southwestMesh=void 0,this.southwestTile=void 0,this.southeastMesh=void 0,this.southeastTile=void 0,this.northwestMesh=void 0,this.northwestTile=void 0,this.northeastMesh=void 0,this.northeastTile=void 0,this.changedThisFrame=!0,this.visitedFrame=void 0,this.enqueuedFrame=void 0,this.mesh=void 0,this.vertexArray=void 0,this.waterMaskTexture=void 0,this.waterMaskTranslationAndScale=new se}aI.prototype.update=function(e,t,n){this.changedThisFrame&&(Zwe(e,t,this.tile,n),this.changedThisFrame=!1)};aI.prototype.destroy=function(e){this._destroyVertexArray(e),l(this.waterMaskTexture)&&(--this.waterMaskTexture.referenceCount,this.waterMaskTexture.referenceCount===0&&this.waterMaskTexture.destroy(),this.waterMaskTexture=void 0)};aI.prototype._destroyVertexArray=function(e){l(this.vertexArray)&&(l(e)?e.push(this.vertexArray):_h._freeVertexArray(this.vertexArray),this.vertexArray=void 0)};var wxt=new sA;aI.updateFillTiles=function(e,t,n,i){let r=e._quadtree,o=r._levelZeroTiles,s=r._lastSelectionFrameNumber,a=wxt;a.clear();for(let u=0;u<t.length;++u){let f=t[u];l(f.data.vertexArray)&&a.enqueue(t[u])}let c=a.dequeue();for(;c!==void 0;){let u=c.findTileToWest(o),f=c.findTileToSouth(o),d=c.findTileToEast(o),p=c.findTileToNorth(o);Da(e,n,c,u,s,wn.EAST,!1,a,i),Da(e,n,c,f,s,wn.NORTH,!1,a,i),Da(e,n,c,d,s,wn.WEST,!1,a,i),Da(e,n,c,p,s,wn.SOUTH,!1,a,i);let g=u.findTileToNorth(o),m=u.findTileToSouth(o),y=d.findTileToNorth(o),A=d.findTileToSouth(o);Da(e,n,c,g,s,wn.SOUTHEAST,!1,a,i),Da(e,n,c,y,s,wn.SOUTHWEST,!1,a,i),Da(e,n,c,m,s,wn.NORTHEAST,!1,a,i),Da(e,n,c,A,s,wn.NORTHWEST,!1,a,i),c=a.dequeue()}};function Da(e,t,n,i,r,o,s,a,c){if(i===void 0)return;let u=i;for(;u&&(u._lastSelectionResultFrame!==r||pi.wasKicked(u._lastSelectionResult)||pi.originalResult(u._lastSelectionResult)===pi.CULLED);){if(s)return;let f=u.parent;if(o>=wn.NORTHWEST&&f!==void 0)switch(o){case wn.NORTHWEST:u=u===f.northwestChild?f:void 0;break;case wn.NORTHEAST:u=u===f.northeastChild?f:void 0;break;case wn.SOUTHWEST:u=u===f.southwestChild?f:void 0;break;case wn.SOUTHEAST:u=u===f.southeastChild?f:void 0;break}else u=f}if(u!==void 0){if(u._lastSelectionResult===pi.RENDERED){if(l(u.data.vertexArray))return;Ixt(e,t,n,u,o,r,a,c);return}if(pi.originalResult(i._lastSelectionResult)!==pi.CULLED)switch(o){case wn.WEST:Da(e,t,n,i.northwestChild,r,o,!0,a,c),Da(e,t,n,i.southwestChild,r,o,!0,a,c);break;case wn.EAST:Da(e,t,n,i.southeastChild,r,o,!0,a,c),Da(e,t,n,i.northeastChild,r,o,!0,a,c);break;case wn.SOUTH:Da(e,t,n,i.southwestChild,r,o,!0,a,c),Da(e,t,n,i.southeastChild,r,o,!0,a,c);break;case wn.NORTH:Da(e,t,n,i.northeastChild,r,o,!0,a,c),Da(e,t,n,i.northwestChild,r,o,!0,a,c);break;case wn.NORTHWEST:Da(e,t,n,i.northwestChild,r,o,!0,a,c);break;case wn.NORTHEAST:Da(e,t,n,i.northeastChild,r,o,!0,a,c);break;case wn.SOUTHWEST:Da(e,t,n,i.southwestChild,r,o,!0,a,c);break;case wn.SOUTHEAST:Da(e,t,n,i.southeastChild,r,o,!0,a,c);break;default:throw new pe("Invalid edge")}}}function Ixt(e,t,n,i,r,o,s,a){let c=i.data;if(c.fill===void 0)c.fill=new aI(i);else if(c.fill.visitedFrame===o)return;c.fill.enqueuedFrame!==o&&(c.fill.enqueuedFrame=o,c.fill.changedThisFrame=!1,s.enqueue(i)),Pxt(e,t,n,i,r,a)}function Pxt(e,t,n,i,r,o){let s=i.data.fill,a,c=n.data.fill;l(c)?(c.visitedFrame=t.frameNumber,c.changedThisFrame&&(Zwe(e,t,n,o),c.changedThisFrame=!1),a=n.data.fill.mesh):a=n.data.mesh;let u,f;switch(r){case wn.WEST:u=s.westMeshes,f=s.westTiles;break;case wn.SOUTH:u=s.southMeshes,f=s.southTiles;break;case wn.EAST:u=s.eastMeshes,f=s.eastTiles;break;case wn.NORTH:u=s.northMeshes,f=s.northTiles;break;case wn.NORTHWEST:s.changedThisFrame=s.changedThisFrame||s.northwestMesh!==a,s.northwestMesh=a,s.northwestTile=n;return;case wn.NORTHEAST:s.changedThisFrame=s.changedThisFrame||s.northeastMesh!==a,s.northeastMesh=a,s.northeastTile=n;return;case wn.SOUTHWEST:s.changedThisFrame=s.changedThisFrame||s.southwestMesh!==a,s.southwestMesh=a,s.southwestTile=n;return;case wn.SOUTHEAST:s.changedThisFrame=s.changedThisFrame||s.southeastMesh!==a,s.southeastMesh=a,s.southeastTile=n;return}if(n.level<=i.level){s.changedThisFrame=s.changedThisFrame||u[0]!==a||u.length!==1,u[0]=a,f[0]=n,u.length=1,f.length=1;return}let d,p,g,m,y=n.rectangle,A,b=i.rectangle;switch(r){case wn.WEST:for(A=(b.north-b.south)*D.EPSILON5,d=0;d<f.length&&(g=f[d],m=g.rectangle,!D.greaterThan(y.north,m.south,A));++d);for(p=d;p<f.length&&(g=f[p],m=g.rectangle,!D.greaterThanOrEquals(y.south,m.north,A));++p);break;case wn.SOUTH:for(A=(b.east-b.west)*D.EPSILON5,d=0;d<f.length&&(g=f[d],m=g.rectangle,!D.lessThan(y.west,m.east,A));++d);for(p=d;p<f.length&&(g=f[p],m=g.rectangle,!D.lessThanOrEquals(y.east,m.west,A));++p);break;case wn.EAST:for(A=(b.north-b.south)*D.EPSILON5,d=0;d<f.length&&(g=f[d],m=g.rectangle,!D.lessThan(y.south,m.north,A));++d);for(p=d;p<f.length&&(g=f[p],m=g.rectangle,!D.lessThanOrEquals(y.north,m.south,A));++p);break;case wn.NORTH:for(A=(b.east-b.west)*D.EPSILON5,d=0;d<f.length&&(g=f[d],m=g.rectangle,!D.greaterThan(y.east,m.west,A));++d);for(p=d;p<f.length&&(g=f[p],m=g.rectangle,!D.greaterThanOrEquals(y.west,m.east,A));++p);break}p-d===1?(s.changedThisFrame=s.changedThisFrame||u[d]!==a,u[d]=a,f[d]=n):(s.changedThisFrame=!0,u.splice(d,p-d,a),f.splice(d,p-d,n))}var CE=new he,Dxt=new he,sI=new h,wte=new h,Cte=new U,vte=new U,nd=new U;function a5(){this.height=0,this.encodedNormal=new U}function t5(e,t,n,i,r,o,s,a,c){if(l(r))return r;let u;if(l(o)&&l(s))u=(o.height+s.height)*.5;else if(l(o))u=o.height;else if(l(s))u=s.height;else if(l(a))u=a.height;else{let d=e.tile.data.tileBoundingRegion,p=0,g=0;l(d)&&(p=d.minimumHeight,g=d.maximumHeight),u=(p+g)*.5}return Qwe(e,t,n,i,u,c),c}var Rxt={minimumHeight:0,maximumHeight:0},Oxt=new h,qwe=new a5,Ywe=new a5,Xwe=new a5,Kwe=new a5,Mxt=typeof Uint8Array<"u"?new Uint8Array(81):void 0,Nxt={tilingScheme:void 0,x:0,y:0,level:0,exaggeration:1,exaggerationRelativeHeight:0};function Zwe(e,t,n,i){_h.initialize(n,e.terrainProvider,e.vectorProvider,e._imageryLayers);let r=n.data,o=r.fill,s=n.rectangle,a=t.verticalExaggeration,c=t.verticalExaggerationRelativeHeight,u=a!==1,f=n.tilingScheme.ellipsoid,d=i5(o,f,0,1,o.northwestTile,o.northwestMesh,o.northTiles,o.northMeshes,o.westTiles,o.westMeshes,Xwe),p=i5(o,f,0,0,o.southwestTile,o.southwestMesh,o.westTiles,o.westMeshes,o.southTiles,o.southMeshes,qwe),g=i5(o,f,1,0,o.southeastTile,o.southeastMesh,o.southTiles,o.southMeshes,o.eastTiles,o.eastMeshes,Ywe),m=i5(o,f,1,1,o.northeastTile,o.northeastMesh,o.eastTiles,o.eastMeshes,o.northTiles,o.northMeshes,Kwe);d=t5(o,f,0,1,d,p,m,g,Xwe),p=t5(o,f,0,0,p,d,g,m,qwe),g=t5(o,f,1,1,g,p,m,d,Ywe),m=t5(o,f,1,1,m,g,d,p,Kwe);let y=p.height,A=g.height,b=d.height,x=m.height,T=Math.min(y,A,b,x),E=Math.max(y,A,b,x),v=(T+E)*.5,S,I,R=e.getLevelMaximumGeometricError(n.level),O=f.maximumRadius-R,L=Math.acos(O/f.maximumRadius)*4;if(L*=1.5,s.width>L&&E-T<=R){let w=new zc({width:9,height:9,buffer:Mxt,structure:{heightOffset:E}}),P=Nxt;P.tilingScheme=n.tilingScheme,P.x=n.x,P.y=n.y,P.level=n.level,P.exaggeration=a,P.exaggerationRelativeHeight=c,o.mesh=w._createMeshSync(P)}else{let w=u,P=ie.center(s,Dxt);P.height=v;let M=f.cartographicToCartesian(P,Oxt),F=new Eo(M,void 0,void 0,void 0,void 0,!0,!0,w,a,c),V=5,B;for(B=o.westMeshes,S=0,I=B.length;S<I;++S)V+=B[S].eastIndicesNorthToSouth.length;for(B=o.southMeshes,S=0,I=B.length;S<I;++S)V+=B[S].northIndicesWestToEast.length;for(B=o.eastMeshes,S=0,I=B.length;S<I;++S)V+=B[S].westIndicesSouthToNorth.length;for(B=o.northMeshes,S=0,I=B.length;S<I;++S)V+=B[S].southIndicesEastToWest.length;let j=Rxt;j.minimumHeight=T,j.maximumHeight=E;let k=F.stride,G=new Float32Array(V*k),q=0,Q=q;q=n5(f,s,F,G,q,0,1,d.height,d.encodedNormal,1,j),q=o5(o,f,F,G,q,o.westTiles,o.westMeshes,wn.EAST,j);let W=q;q=n5(f,s,F,G,q,0,0,p.height,p.encodedNormal,0,j),q=o5(o,f,F,G,q,o.southTiles,o.southMeshes,wn.NORTH,j);let J=q;q=n5(f,s,F,G,q,1,0,g.height,g.encodedNormal,0,j),q=o5(o,f,F,G,q,o.eastTiles,o.eastMeshes,wn.WEST,j);let Z=q;q=n5(f,s,F,G,q,1,1,m.height,m.encodedNormal,1,j),q=o5(o,f,F,G,q,o.northTiles,o.northMeshes,wn.SOUTH,j),T=j.minimumHeight,E=j.maximumHeight;let ae=en.fromRectangle(s,T,E,n.tilingScheme.ellipsoid),Ae=yi.geodeticLatitudeToMercatorAngle(s.south),fe=1/(yi.geodeticLatitudeToMercatorAngle(s.north)-Ae),xe=(yi.geodeticLatitudeToMercatorAngle(P.latitude)-Ae)*fe,ge=f.geodeticSurfaceNormalCartographic(CE,wte),we=cn.octEncode(ge,Cte),Se=q;F.encode(G,q*k,ae.center,U.fromElements(.5,.5,nd),v,we,xe,ge),++q;let Re=q,Qe=Re<256?1:2,He=(Re-1)*3,Xe=He*Qe,$e=(G.length-Re*k)*Float32Array.BYTES_PER_ELEMENT,Pe;if($e>=Xe){let mt=Re*k*Float32Array.BYTES_PER_ELEMENT;Pe=Re<256?new Uint8Array(G.buffer,mt,He):new Uint16Array(G.buffer,mt,He)}else Pe=Re<256?new Uint8Array(He):new Uint16Array(He);G=new Float32Array(G.buffer,0,Re*k);let qe=0;for(S=0;S<Re-2;++S)Pe[qe++]=Se,Pe[qe++]=S,Pe[qe++]=S+1;Pe[qe++]=Se,Pe[qe++]=S,Pe[qe]=0;let st=[];for(S=W;S>=Q;--S)st.push(S);let vt=[];for(S=J;S>=W;--S)vt.push(S);let Gt=[];for(S=Z;S>=J;--S)Gt.push(S);let lt=[];for(lt.push(0),S=Se-1;S>=Z;--S)lt.push(S);o.mesh=new Ac(F.center,G,Pe,He,Re,T,E,s,ue.fromOrientedBoundingBox(ae),Vxt(e,ae.center,s,T,E),F.stride,ae,F,st,vt,Gt,lt)}let _=t.context;o._destroyVertexArray(i),o.vertexArray=_h._createVertexArrayForMesh(_,o.mesh),r.processImagery(n,e.terrainProvider,t,!0);let C=o.waterMaskTexture;if(o.waterMaskTexture=void 0,e.terrainProvider.hasWaterMask){let w=r._findAncestorTileWithTerrainData(n);l(w)&&l(w.data.waterMaskTexture)&&(o.waterMaskTexture=w.data.waterMaskTexture,++o.waterMaskTexture.referenceCount,r._computeWaterMaskTranslationAndScale(n,w,o.waterMaskTranslationAndScale))}l(C)&&(--C.referenceCount,C.referenceCount===0&&C.destroy())}function n5(e,t,n,i,r,o,s,a,c,u,f){let d=CE;d.longitude=D.lerp(t.west,t.east,o),d.latitude=D.lerp(t.south,t.north,s),d.height=a;let p=e.cartographicToCartesian(d,sI),g;n.hasGeodeticSurfaceNormals&&(g=e.geodeticSurfaceNormal(p,wte));let m=vte;return m.x=o,m.y=s,n.encode(i,r*n.stride,p,m,a,c,u,g),f.minimumHeight=Math.min(f.minimumHeight,a),f.maximumHeight=Math.max(f.maximumHeight,a),r+1}var s5=new ie;function U3(e,t,n,i){let r=e.rectangle,o=t.rectangle;t.x===0&&n.x===1&&e.x===e.tilingScheme.getNumberOfXTilesAtLevel(e.level)-1?(r=ie.clone(e.rectangle,s5),r.west-=D.TWO_PI,r.east-=D.TWO_PI):e.x===0&&n.x===0&&t.x===t.tilingScheme.getNumberOfXTilesAtLevel(t.level)-1&&(r=ie.clone(e.rectangle,s5),r.west+=D.TWO_PI,r.east+=D.TWO_PI);let s=r.east-r.west,a=(o.west-r.west)/s,c=(o.east-r.west)/s,u=r.north-r.south,f=(o.south-r.south)/u,d=(o.north-r.south)/u,p=(n.x-a)/(c-a),g=(n.y-f)/(d-f);return Math.abs(p)<Math.EPSILON5?p=0:Math.abs(p-1)<Math.EPSILON5&&(p=1),Math.abs(g)<Math.EPSILON5?g=0:Math.abs(g-1)<Math.EPSILON5&&(g=1),i.x=p,i.y=g,i}var Lxt=new U;function Ste(e,t,n,i,r){let o=e.encoding,s=e.vertices;if(r.height=o.decodeHeight(s,t),o.hasVertexNormals)o.getOctEncodedNormal(s,t,r.encodedNormal);else{let a=r.encodedNormal;a.x=0,a.y=0}}var Fxt=new U,Bxt=new h;function kxt(e,t,n,i,r,o,s,a,c,u){let f=i.encoding,d=i.vertices,p=U3(t,n,f.decodeTextureCoordinates(d,r,nd),nd),g=U3(t,n,f.decodeTextureCoordinates(d,o,vte),vte),m;c?m=(s-p.x)/(g.x-p.x):m=(a-p.y)/(g.y-p.y);let y=f.decodeHeight(d,r),A=f.decodeHeight(d,o),b=n.rectangle;CE.longitude=D.lerp(b.west,b.east,s),CE.latitude=D.lerp(b.south,b.north,a),u.height=CE.height=D.lerp(y,A,m);let x;if(f.hasVertexNormals){let T=f.getOctEncodedNormal(d,r,Lxt),E=f.getOctEncodedNormal(d,o,Fxt),v=cn.octDecode(T.x,T.y,sI),S=cn.octDecode(E.x,E.y,Bxt);x=h.lerp(v,S,m,sI),h.normalize(x,x),cn.octEncode(x,u.encodedNormal)}else x=e.geodeticSurfaceNormalCartographic(CE,sI),cn.octEncode(x,u.encodedNormal)}function Qwe(e,t,n,i,r,o){o.height=r;let s=t.geodeticSurfaceNormalCartographic(CE,sI);cn.octEncode(s,o.encodedNormal)}function i5(e,t,n,i,r,o,s,a,c,u,f){if(Jwe(e,t,a,s,!1,n,i,f)||Jwe(e,t,u,c,!0,n,i,f))return f;let p;if(Ite(r,o))return n===0?i===0?p=o.eastIndicesNorthToSouth[0]:p=o.southIndicesEastToWest[0]:i===0?p=o.northIndicesWestToEast[0]:p=o.westIndicesSouthToNorth[0],Ste(o,p,n,i,f),f;let g;if(n===0?i===0?g=r5(e.westMeshes,e.westTiles,wn.EAST,e.southMeshes,e.southTiles,wn.NORTH,n,i):g=r5(e.northMeshes,e.northTiles,wn.SOUTH,e.westMeshes,e.westTiles,wn.EAST,n,i):i===0?g=r5(e.southMeshes,e.southTiles,wn.NORTH,e.eastMeshes,e.eastTiles,wn.WEST,n,i):g=r5(e.eastMeshes,e.eastTiles,wn.WEST,e.northMeshes,e.northTiles,wn.SOUTH,n,i),l(g))return Qwe(e,t,n,i,g,f),f}function r5(e,t,n,i,r,o,s,a){let c=$we(e,t,!1,n,s,a),u=$we(i,r,!0,o,s,a);return l(c)&&l(u)?(c+u)*.5:l(c)?c:u}function o5(e,t,n,i,r,o,s,a,c){for(let u=0;u<o.length;++u)r=Uxt(e,t,n,i,r,o[u],s[u],a,c);return r}function Uxt(e,t,n,i,r,o,s,a,c){let u;a===wn.EAST&&e.tile.x===0?(u=ie.clone(o.rectangle,s5),u.west-=D.TWO_PI,u.east-=D.TWO_PI):a===wn.WEST&&o.x===0&&(u=ie.clone(o.rectangle,s5),u.west+=D.TWO_PI,u.east+=D.TWO_PI);let f=e.tile.rectangle,d,p;r>0&&(n.decodeTextureCoordinates(i,r-1,nd),d=nd.x,p=nd.y);let g,m;switch(a){case wn.WEST:g=s.westIndicesSouthToNorth,m=!1;break;case wn.NORTH:g=s.northIndicesWestToEast,m=!0;break;case wn.EAST:g=s.eastIndicesNorthToSouth,m=!1;break;case wn.SOUTH:g=s.southIndicesEastToWest,m=!0;break}let y=o,A=e.tile,b=s.encoding,x=s.vertices,T=n.stride,E,v;b.hasWebMercatorT&&(E=yi.geodeticLatitudeToMercatorAngle(f.south),v=1/(yi.geodeticLatitudeToMercatorAngle(f.north)-E));for(let S=0;S<g.length;++S){let I=g[S],R=b.decodeTextureCoordinates(x,I,nd);U3(y,A,R,R);let O=R.x,L=R.y,_=m?O:L;if(_<0||_>1||Math.abs(O-d)<D.EPSILON5&&Math.abs(L-p)<D.EPSILON5)continue;let C=Math.abs(O)<D.EPSILON5||Math.abs(O-1)<D.EPSILON5,w=Math.abs(L)<D.EPSILON5||Math.abs(L-1)<D.EPSILON5;if(C&&w)continue;let P=b.decodePosition(x,I,sI),M=b.decodeHeight(x,I),F;b.hasVertexNormals?F=b.getOctEncodedNormal(x,I,Cte):(F=Cte,F.x=0,F.y=0);let V=L;if(b.hasWebMercatorT){let j=D.lerp(f.south,f.north,L);V=(yi.geodeticLatitudeToMercatorAngle(j)-E)*v}let B;n.hasGeodeticSurfaceNormals&&(B=t.geodeticSurfaceNormal(P,wte)),n.encode(i,r*T,P,R,M,F,V,B),c.minimumHeight=Math.min(c.minimumHeight,M),c.maximumHeight=Math.max(c.maximumHeight,M),++r}return r}function $we(e,t,n,i,r,o){let s,a,c;n?(s=0,a=e.length,c=1):(s=e.length-1,a=-1,c=-1);for(let u=s;u!==a;u+=c){let f=e[u],d=t[u];if(!Ite(d,f))continue;let p;switch(i){case wn.WEST:p=f.westIndicesSouthToNorth;break;case wn.SOUTH:p=f.southIndicesEastToWest;break;case wn.EAST:p=f.eastIndicesNorthToSouth;break;case wn.NORTH:p=f.northIndicesWestToEast;break}let g=p[n?0:p.length-1];if(l(g))return f.encoding.decodeHeight(f.vertices,g)}}function Ite(e,t){return l(t)&&(!l(e.data.fill)||!e.data.fill.changedThisFrame)}function Jwe(e,t,n,i,r,o,s,a){let c,u,f,d,p,g=i[r?0:n.length-1],m=n[r?0:n.length-1];if(Ite(g,m)&&(o===0?s===0?(c=r?m.northIndicesWestToEast:m.eastIndicesNorthToSouth,u=r,f=r):(c=r?m.eastIndicesNorthToSouth:m.southIndicesEastToWest,u=!r,f=!1):s===0?(c=r?m.westIndicesSouthToNorth:m.northIndicesWestToEast,u=!r,f=!0):(c=r?m.southIndicesEastToWest:m.westIndicesSouthToNorth,u=r,f=!r),c.length>0)){d=r?0:c.length-1,p=c[d],m.encoding.decodeTextureCoordinates(m.vertices,p,nd);let y=U3(g,e.tile,nd,nd);if(y.x===o&&y.y===s)return Ste(m,p,o,s,a),!0;if(d=vr(c,u?o:s,function(A,b){m.encoding.decodeTextureCoordinates(m.vertices,A,nd);let x=U3(g,e.tile,nd,nd);return f?u?x.x-o:x.y-s:u?o-x.x:s-x.y}),d<0){if(d=~d,d>0&&d<c.length)return kxt(t,g,e.tile,m,c[d-1],c[d],o,s,u,a),!0}else return Ste(m,c[d],o,s,a),!0}return!1}var zxt=[new h,new h,new h,new h];function Vxt(e,t,n,i,r,o){let s=e.quadtree._occluders.ellipsoid,a=s.ellipsoid,c=zxt;return h.fromRadians(n.west,n.south,r,a,c[0]),h.fromRadians(n.east,n.south,r,a,c[1]),h.fromRadians(n.west,n.north,r,a,c[2]),h.fromRadians(n.east,n.north,r,a,c[3]),s.computeHorizonCullingPointPossiblyUnderEllipsoid(t,c,i,o)}var cI=aI;var Pte=class e{constructor(t){this.lightingFadeOutDistance=65e5,this.lightingFadeInDistance=9e6,this.hasWaterMask=!1,this.showWaterEffect=!1,this.oceanNormalMap=void 0,this.zoomedOutOceanSpecularIntensity=.5,this.enableLighting=!1,this.dynamicAtmosphereLighting=!1,this.dynamicAtmosphereLightingFromSun=!1,this.showGroundAtmosphere=!1,this.shadows=Pn.RECEIVE_ONLY,this.vertexShadowDarkness=.3,this.fillHighlightColor=void 0,this.hueShift=0,this.saturationShift=0,this.brightnessShift=0,this.showSkirts=!0,this.backFaceCulling=!0,this.undergroundColor=void 0,this.undergroundColorAlphaByDistance=void 0,this.lambertDiffuseMultiplier=0,this.materialUniformMap=void 0,this._materialUniformMap=void 0,this._quadtree=void 0,this._terrainProvider=t.terrainProvider,this._vectorProvider=t.vectorProvider,this._imageryLayers=t.imageryLayers,this._surfaceShaderSet=t.surfaceShaderSet,this._renderState=void 0,this._blendRenderState=void 0,this._disableCullingRenderState=void 0,this._disableCullingBlendRenderState=void 0,this._errorEvent=new be,this._removeLayerAddedListener=this._imageryLayers.layerAdded.addEventListener(e.prototype._onLayerAdded,this),this._removeLayerRemovedListener=this._imageryLayers.layerRemoved.addEventListener(e.prototype._onLayerRemoved,this),this._removeLayerMovedListener=this._imageryLayers.layerMoved.addEventListener(e.prototype._onLayerMoved,this),this._removeLayerShownListener=this._imageryLayers.layerShownOrHidden.addEventListener(e.prototype._onLayerShownOrHidden,this),this._imageryLayersUpdatedEvent=new be,this._layerOrderChanged=!1,this._tilesToRenderByTextureCount=[],this._drawCommands=[],this._uniformMaps=[],this._usedDrawCommands=0,this._vertexArraysToDestroy=[],this._debug={wireframe:!1,boundingSphereTile:void 0,tilesRendered:0,texturesRendered:0},this._baseColor=void 0,this._firstPassInitialColor=void 0,this.baseColor=new z(0,0,.5,1),this._clippingPlanes=void 0,this._clippingPolygons=void 0,this._clippingPolygonsDirty=!1,this._removeClippingPolygonAdded=void 0,this._removeClippingPolygonRemoved=void 0,this.cartographicLimitRectangle=ie.clone(ie.MAX_VALUE),this._hasLoadedTilesThisFrame=!1,this._hasFillTilesThisFrame=!1,this._oldVerticalExaggeration=void 0,this._oldVerticalExaggerationRelativeHeight=void 0,this._oldSceneMode=re.SCENE3D}get baseColor(){return this._baseColor}set baseColor(t){this._baseColor=t,this._firstPassInitialColor=se.fromColor(t,this._firstPassInitialColor)}get quadtree(){return this._quadtree}set quadtree(t){this._quadtree=t}get tilingScheme(){if(l(this._terrainProvider))return this._terrainProvider.tilingScheme}get errorEvent(){return this._errorEvent}get imageryLayersUpdatedEvent(){return this._imageryLayersUpdatedEvent}get terrainProvider(){return this._terrainProvider}set terrainProvider(t){this._terrainProvider!==t&&(this._terrainProvider=t,l(this._quadtree)&&this._quadtree.invalidateAllTiles())}get vectorProvider(){return this._vectorProvider}get clippingPlanes(){return this._clippingPlanes}set clippingPlanes(t){Cs.setOwner(t,this,"_clippingPlanes")}get clippingPolygons(){return this._clippingPolygons}set clippingPolygons(t){if(t===this._clippingPolygons||(Nc.setOwner(t,this,"_clippingPolygons"),this._removeClippingPolygonAdded=this._removeClippingPolygonAdded&&this._removeClippingPolygonAdded(),this._removeClippingPolygonRemoved=this._removeClippingPolygonRemoved&&this._removeClippingPolygonRemoved(),this._clippingPolygonsDirty=!0,!l(t)))return;let n=()=>{this._clippingPolygonsDirty=!0};this._removeClippingPolygonAdded=t.polygonAdded.addEventListener(n),this._removeClippingPolygonRemoved=t.polygonRemoved.addEventListener(n)}update(t){this._imageryLayers._update()}initialize(t){this._imageryLayers.queueReprojectionCommands(t),this._layerOrderChanged&&(this._layerOrderChanged=!1,this._quadtree.forEachLoadedTile(function(o){o.data.imagery.sort(Gxt)}));let n=this._vectorProvider;n.minimumTileScreenPixels=Hxt(this),n.update(t.frameNumber),this._quadtree.forEachRenderedTile(o=>{let s=o.data;l(s.vectorData)?s.vectorData=n.updateTileData(o.x,o.y,o.level,t.context,s.vectorData,We.CLAMP_TO_TERRAIN):s.vectorData=n.requestTileData(o.x,o.y,o.level,t.context,We.CLAMP_TO_TERRAIN)}),n.makeClean(),Xxt(this,t);let i=this._vertexArraysToDestroy,r=i.length;for(let o=0;o<r;++o)_h._freeVertexArray(i[o]);i.length=0}beginUpdate(t){let n=this._tilesToRenderByTextureCount;for(let o=0,s=n.length;o<s;++o){let a=n[o];l(a)&&(a.length=0)}let i=this._clippingPlanes;l(i)&&i.enabled&&i.update(t);let r=this._clippingPolygons;l(r)&&r.enabled&&r.update(t),this._usedDrawCommands=0,this._hasLoadedTilesThisFrame=!1,this._hasFillTilesThisFrame=!1}endUpdate(t){if(!l(this._renderState)){this._renderState=Ge.fromCache({cull:{enabled:!0},depthTest:{enabled:!0,func:cc.LESS}}),this._blendRenderState=Ge.fromCache({cull:{enabled:!0},depthTest:{enabled:!0,func:cc.LESS_OR_EQUAL},blending:tn.ALPHA_BLEND});let c=Je(this._renderState,!0);c.cull.enabled=!1,this._disableCullingRenderState=Ge.fromCache(c),c=Je(this._blendRenderState,!0),c.cull.enabled=!1,this._disableCullingBlendRenderState=Ge.fromCache(c)}this._hasFillTilesThisFrame&&this._hasLoadedTilesThisFrame&&cI.updateFillTiles(this,this._quadtree._tilesToRender,t,this._vertexArraysToDestroy);let n=this.quadtree,i=t.verticalExaggeration,r=t.verticalExaggerationRelativeHeight,o=this._oldVerticalExaggeration!==i||this._oldVerticalExaggerationRelativeHeight!==r;this._oldVerticalExaggeration=i,this._oldVerticalExaggerationRelativeHeight=r,o&&n.forEachLoadedTile(function(c){c.data.updateExaggeration(c,t,n)});let s=this._oldSceneMode!==t.mode;this._oldSceneMode=t.mode,s&&n.forEachLoadedTile(function(c){c.data.updateSceneMode(t.mode)}),this._clippingPolygonsDirty&&Wxt(this);let a=this._tilesToRenderByTextureCount;for(let c=0,u=a.length;c<u;++c){let f=a[c];if(l(f))for(let d=0,p=f.length;d<p;++d){let g=f[d],m=g.data;qxt(this,g,m,t);let y=m.tileBoundingRegion;yTt(this,g,t),t.minimumTerrainHeight=Math.min(t.minimumTerrainHeight,y.minimumHeight)}}}updateForPick(t){let n=this._drawCommands;for(let i=0,r=this._usedDrawCommands;i<r;++i){let o=n[i];o.dirty=!0,o.derivedCommands.picking=void 0;let s=o.derivedCommands.logDepth?.command;l(s)&&(s.derivedCommands.picking=void 0),rIe(o,t)}}cancelReprojections(){this._imageryLayers.cancelReprojections()}getLevelMaximumGeometricError(t){return l(this._terrainProvider)?this._terrainProvider.getLevelMaximumGeometricError(t):0}loadTile(t,n){let i=n.data,r=!0,o;l(i)&&(r=i.boundingVolumeSourceTile!==n||n._lastSelectionResult===pi.CULLED_BUT_NEEDED,o=i.terrainState),_h.processStateMachine(n,t,this.terrainProvider,this.vectorProvider,this._imageryLayers,this.quadtree,this._vertexArraysToDestroy,r),i=n.data,r&&o!==i.terrainState&&this.computeTileVisibility(n,t,this.quadtree.occluders)!==Ko.NONE&&i.boundingVolumeSourceTile===n&&(r=!1,_h.processStateMachine(n,t,this.terrainProvider,this.vectorProvider,this._imageryLayers,this.quadtree,this._vertexArraysToDestroy,r))}computeTileVisibility(t,n,i){let r=this.computeDistanceToTile(t,n);t._distance=r;let o=sIe(this,n);if(n.fog.enabled&&!o&&D.fog(r,n.fog.density)>=1)return Ko.NONE;let s=t.data,a=s.tileBoundingRegion;if(s.boundingVolumeSourceTile===void 0)return Ko.PARTIAL;let c=n.cullingVolume,u=a.boundingVolume;l(u)||(u=a.boundingSphere),s.clippedByBoundaries=!1;let f=l5(t.rectangle,this.cartographicLimitRectangle),d=ie.simpleIntersection(f,t.rectangle,oIe);if(!l(d))return Ko.NONE;if(ie.equals(d,t.rectangle)||(s.clippedByBoundaries=!0),n.mode!==re.SCENE3D&&(u=Kxt,ue.fromRectangleWithHeights2D(t.rectangle,n.mapProjection,a.minimumHeight,a.maximumHeight,u),h.fromElements(u.center.z,u.center.x,u.center.y,u.center),n.mode===re.MORPHING&&l(s.renderedMesh)&&(u=ue.union(a.boundingSphere,u,u))),!l(u))return Ko.PARTIAL;let p=this._clippingPlanes;if(l(p)&&p.enabled){let b=p.computeIntersectionWithBoundingVolume(u);if(t.isClipped=b!==$t.INSIDE,b===$t.OUTSIDE)return Ko.NONE}let g=this._clippingPolygons;if(l(g)&&g.enabled){let b=g.computeIntersectionWithBoundingVolume(a);t.isClipped=b!==$t.OUTSIDE}let m,y=c.computeVisibility(u);if(y===$t.OUTSIDE?m=Ko.NONE:y===$t.INTERSECTING?m=Ko.PARTIAL:y===$t.INSIDE&&(m=Ko.FULL),m===Ko.NONE)return m;let A=n.mode===re.SCENE3D&&n.camera.frustum instanceof gn;if(n.mode===re.SCENE3D&&!A&&l(i)&&!o){let b=s.occludeePointInScaledSpace;return!l(b)||i.ellipsoid.isScaledSpacePointVisiblePossiblyUnderEllipsoid(b,a.minimumHeight)?m:Ko.NONE}return m}canRefine(t){let n=t.data;return l(n.terrainData)?!0:this.terrainProvider.getTileDataAvailable(t.x*2,t.y*2,t.level+1)!==void 0}canRenderWithoutLosingDetail(t){let n=t.data,i=Zxt;i.length=this._imageryLayers.length;let r=!1,o=!1,s;l(n)&&(r=n.terrainState===kr.READY,o=!0,s=n.imagery);let a,c;for(a=0,c=i.length;a<c;++a)i[a]=o;if(l(s))for(a=0,c=s.length;a<c;++a){let d=s[a],p=d.loadingImagery,g=!l(p)||p.state===Vn.FAILED||p.state===Vn.INVALID,m=(d.loadingImagery||d.readyImagery).imageryLayer._layerIndex;i[m]=g&&i[m]}let u=this.quadtree._lastSelectionFrameNumber,f=Qxt;for(f.length=0,f.push(t.southwestChild,t.southeastChild,t.northwestChild,t.northeastChild);f.length>0;){let d=f.pop(),p=d._lastSelectionResultFrame===u?d._lastSelectionResult:pi.NONE;if(p===pi.RENDERED){let g=d.data;if(!l(g))continue;if(!r&&d.data.terrainState===kr.READY)return!1;let m=d.data.imagery;for(a=0,c=m.length;a<c;++a){let y=m[a],A=y.loadingImagery,b=!l(A)||A.state===Vn.FAILED||A.state===Vn.INVALID,x=(y.loadingImagery||y.readyImagery).imageryLayer._layerIndex;if(b&&!i[x])return!1}}else p===pi.REFINED&&f.push(d.southwestChild,d.southeastChild,d.northwestChild,d.northeastChild)}return!0}computeTileLoadPriority(t,n){let i=t.data;if(i===void 0)return 0;let r=i.tileBoundingRegion.boundingVolume;if(r===void 0)return 0;let o=n.camera.positionWC,s=n.camera.directionWC,a=h.subtract(r.center,o,eTt),c=h.magnitude(a);return c<D.EPSILON5?0:(h.divideByScalar(a,c,a),(1-h.dot(a,s))*t._distance)}showTileThisFrame(t,n){let i=0,r=t.data,o=r.imagery;for(let c=0,u=o.length;c<u;++c){let f=o[c];l(f.readyImagery)&&f.readyImagery.imageryLayer.alpha!==0&&++i}let s=this._tilesToRenderByTextureCount[i];l(s)||(s=[],this._tilesToRenderByTextureCount[i]=s),s.push(t),l(r.vertexArray)?this._hasLoadedTilesThisFrame=!0:this._hasFillTilesThisFrame=!0;let a=this._debug;++a.tilesRendered,a.texturesRendered+=i}computeDistanceToTile(t,n){cTt(t,this,n);let i=t.data;if(i.boundingVolumeSourceTile===void 0)return 9999999999;let o=i.tileBoundingRegion,s=o.minimumHeight,a=o.maximumHeight;if(i.boundingVolumeSourceTile!==t){let u=n.camera.positionCartographic.height,f=Math.abs(u-s),d=Math.abs(u-a);f>d?(o.minimumHeight=s,o.maximumHeight=s):(o.minimumHeight=a,o.maximumHeight=a)}let c=o.distanceToCamera(n);return o.minimumHeight=s,o.maximumHeight=a,c}isDestroyed(){return!1}destroy(){return this._tileProvider=this._tileProvider&&this._tileProvider.destroy(),this._clippingPlanes=this._clippingPlanes&&this._clippingPlanes.destroy(),this._clippingPolygons=void 0,this._removeLayerAddedListener=this._removeLayerAddedListener&&this._removeLayerAddedListener(),this._removeLayerRemovedListener=this._removeLayerRemovedListener&&this._removeLayerRemovedListener(),this._removeLayerMovedListener=this._removeLayerMovedListener&&this._removeLayerMovedListener(),this._removeLayerShownListener=this._removeLayerShownListener&&this._removeLayerShownListener(),this._removeClippingPolygonAdded=this._removeClippingPolygonAdded&&this._removeClippingPolygonAdded(),this._removeClippingPolygonRemoved=this._removeClippingPolygonRemoved&&this._removeClippingPolygonRemoved(),le(this)}_onLayerAdded(t,n){if(!this.isDestroyed()&&t.show){let i=this._terrainProvider,r=this,o=this._imageryLayersUpdatedEvent,s=function(){t._imageryCache={},r._quadtree.forEachLoadedTile(function(a){if(l(a._loadedCallbacks[t._layerIndex]))return;let c,u=a.data.imagery,f=u.length,d=-1,p=0;for(c=0;c<f;++c){let m=u[c];if((m.readyImagery??m.loadingImagery).imageryLayer===t)d===-1&&(d=c),++p;else if(d!==-1)break}if(d===-1)return;let g=d+p;t._createTileImagerySkeletons(a,i,g)&&(a._loadedCallbacks[t._layerIndex]=lTt(p,t,i),a.state=$a.LOADING)})};if(t.ready){let a=t.imageryProvider;a._reload=s}this._quadtree.forEachLoadedTile(function(a){t._createTileImagerySkeletons(a,i)&&(a.state=$a.LOADING,a.level!==0&&(a._lastSelectionResultFrame!==r.quadtree._lastSelectionFrameNumber||a._lastSelectionResult!==pi.RENDERED)&&(a.renderable=!1))}),this._layerOrderChanged=!0,o.raiseEvent()}}_onLayerRemoved(t,n){this._quadtree.forEachLoadedTile(function(i){let r=i.data.imagery,o=-1,s=0;for(let a=0,c=r.length;a<c;++a){let u=r[a],f=u.loadingImagery;if(l(f)||(f=u.readyImagery),f.imageryLayer===t)o===-1&&(o=a),u.freeResources(),++s;else if(o!==-1)break}o!==-1&&r.splice(o,s)}),l(t.imageryProvider)&&(t.imageryProvider._reload=void 0),this._imageryLayersUpdatedEvent.raiseEvent()}_onLayerMoved(t,n,i){this._layerOrderChanged=!0,this._imageryLayersUpdatedEvent.raiseEvent()}_onLayerShownOrHidden(t,n,i){i?this._onLayerAdded(t,n):this._onLayerRemoved(t,n)}},jxt=new ie;function Hxt(e){let t=e.getLevelMaximumGeometricError(0);if(t<=0)return e._vectorProvider.minimumTileScreenPixels;let n=e.tilingScheme;return n.tileXYToRectangle(0,0,0,jxt).width*n.ellipsoid.maximumRadius/t*e._quadtree.maximumScreenSpaceError/2}function Gxt(e,t){let n=e.loadingImagery;l(n)||(n=e.readyImagery);let i=t.loadingImagery;return l(i)||(i=t.readyImagery),n.imageryLayer._layerIndex-i.imageryLayer._layerIndex}function Wxt(e){e._quadtree.forEachLoadedTile(function(t){let n=t.data;l(n?.clippingPolygonData)&&(Nc.releaseRectangleData(n.clippingPolygonData),n.clippingPolygonData=void 0)}),e._clippingPolygonsDirty=!1}function qxt(e,t,n,i){let r=e._clippingPolygons;!l(r)||!r.enabled||!t.isClipped||l(n.clippingPolygonData)||(n.clippingPolygonData=r.requestRectangleData(t.rectangle,i.context))}function Yxt(e,t){let n=e._clippingPolygons;return l(n)&&n.enabled&&n.length>0&&n.inverse&&(t.clippingPolygonData?.polygonRings.length??0)===0}function Xxt(e,t){let n=t.creditDisplay,i=e._terrainProvider;l(i)&&l(i.credit)&&n.addCreditToNextFrame(i.credit);let r=e._imageryLayers;for(let o=0,s=r.length;o<s;++o){let a=r.get(o);a.ready&&a.show&&l(a.imageryProvider.credit)&&n.addCreditToNextFrame(a.imageryProvider.credit)}}function rIe(e,t){let n=t.globeTranslucencyState;if(n.translucent){let i=e.renderState.blending.enabled;n.pushDerivedCommands(e,i,t)}else t.commandList.push(e)}var Kxt=new ue,oIe=new ie,$xt=new ie,Jxt=new he;function l5(e,t){if(t.west<t.east)return t;let n=ie.clone(t,$xt);return ie.center(e,Jxt).longitude>0?n.east=D.PI:n.west=-D.PI,n}function sIe(e,t){if(t.cameraUnderground||t.globeTranslucencyState.translucent)return!0;if(e.backFaceCulling)return!1;let n=e._clippingPlanes;if(l(n)&&n.enabled)return!0;let i=e._clippingPolygons;return!!(l(i)&&i.enabled||!ie.equals(e.cartographicLimitRectangle,ie.MAX_VALUE))}var Zxt=[],Qxt=[],eTt=new h,eIe=new N,c5=new N,tTt=new se,nTt=new se,iTt=new se,rTt=new h,tIe=new h,oTt=new h,sTt=new h,aTt=[new h,new h,new h,new h];function nIe(e,t,n,i,r,o){let s=e.quadtree._occluders.ellipsoid,a=s.ellipsoid,c=aTt;return h.fromRadians(n.west,n.south,r,a,c[0]),h.fromRadians(n.east,n.south,r,a,c[1]),h.fromRadians(n.west,n.north,r,a,c[2]),h.fromRadians(n.east,n.north,r,a,c[3]),s.computeHorizonCullingPointPossiblyUnderEllipsoid(t,c,i,o)}function cTt(e,t,n){let i=e.data;i===void 0&&(i=e.data=new _h);let r=e.tilingScheme.ellipsoid;i.tileBoundingRegion===void 0&&(i.tileBoundingRegion=new ed({computeBoundingVolumes:!1,rectangle:e.rectangle,ellipsoid:r,minimumHeight:0,maximumHeight:0}));let o=i.tileBoundingRegion,s=o.minimumHeight,a=o.maximumHeight,c=!1,u=e,f=i.mesh,d=i.terrainData;if(f!==void 0&&f.minimumHeight!==void 0&&f.maximumHeight!==void 0)o.minimumHeight=f.minimumHeight,o.maximumHeight=f.maximumHeight,c=!0;else if(d!==void 0&&d._minimumHeight!==void 0&&d._maximumHeight!==void 0)o.minimumHeight=d._minimumHeight,o.maximumHeight=d._maximumHeight;else{o.minimumHeight=Number.NaN,o.maximumHeight=Number.NaN;let p=e.parent;for(;p!==void 0;){let g=p.data;if(g!==void 0){let m=g.mesh,y=g.terrainData;if(m!==void 0&&m.minimumHeight!==void 0&&m.maximumHeight!==void 0){o.minimumHeight=m.minimumHeight,o.maximumHeight=m.maximumHeight;break}else if(y!==void 0&&y._minimumHeight!==void 0&&y._maximumHeight!==void 0){o.minimumHeight=y._minimumHeight,o.maximumHeight=y._maximumHeight;break}}p=p.parent}u=p}if(u!==void 0){let p=n.verticalExaggeration,g=n.verticalExaggerationRelativeHeight;if(p!==1&&(c=!1,o.minimumHeight=Ar.getHeight(o.minimumHeight,p,g),o.maximumHeight=Ar.getHeight(o.maximumHeight,p,g)),c)i.boundingVolumeIsFromMesh||(o._orientedBoundingBox=en.clone(f.orientedBoundingBox,o._orientedBoundingBox),o._boundingSphere=ue.clone(f.boundingSphere3D,o._boundingSphere),i.occludeePointInScaledSpace=h.clone(f.occludeePointInScaledSpace,i.occludeePointInScaledSpace),l(i.occludeePointInScaledSpace)||(i.occludeePointInScaledSpace=nIe(t,o._orientedBoundingBox.center,e.rectangle,o.minimumHeight,o.maximumHeight,i.occludeePointInScaledSpace)));else{let y=o._orientedBoundingBox===void 0||o._boundingSphere===void 0;(o.minimumHeight!==s||o.maximumHeight!==a||y)&&(o.computeBoundingVolumes(r),i.occludeePointInScaledSpace=nIe(t,o._orientedBoundingBox.center,e.rectangle,o.minimumHeight,o.maximumHeight,i.occludeePointInScaledSpace))}i.boundingVolumeSourceTile=u,i.boundingVolumeIsFromMesh=c}else i.boundingVolumeSourceTile=void 0,i.boundingVolumeIsFromMesh=!1}function lTt(e,t,n){return function(i){let r,o,s=-1,a=i.data.imagery,c=a.length,u;for(u=0;u<c;++u)if(r=a[u],o=r.readyImagery??r.loadingImagery,o.imageryLayer===t){s=u;break}if(s!==-1){let f=s+e;if(r=a[f],o=l(r)?r.readyImagery??r.loadingImagery:void 0,!l(o)||o.imageryLayer!==t)return!t._createTileImagerySkeletons(i,n,f);for(u=s;u<f;++u)a[u].freeResources();a.splice(s,e)}return!0}}var uTt=new N,fTt=new N;function iIe(e,t){let n={u_initialColor:function(){return this.properties.initialColor},u_fillHighlightColor:function(){return this.properties.fillHighlightColor},u_zoomedOutOceanSpecularIntensity:function(){return this.properties.zoomedOutOceanSpecularIntensity},u_oceanNormalMap:function(){return this.properties.oceanNormalMap},u_atmosphereLightIntensity:function(){return this.properties.atmosphereLightIntensity},u_atmosphereRayleighCoefficient:function(){return this.properties.atmosphereRayleighCoefficient},u_atmosphereMieCoefficient:function(){return this.properties.atmosphereMieCoefficient},u_atmosphereRayleighScaleHeight:function(){return this.properties.atmosphereRayleighScaleHeight},u_atmosphereMieScaleHeight:function(){return this.properties.atmosphereMieScaleHeight},u_atmosphereMieAnisotropy:function(){return this.properties.atmosphereMieAnisotropy},u_lightingFadeDistance:function(){return this.properties.lightingFadeDistance},u_nightFadeDistance:function(){return this.properties.nightFadeDistance},u_center3D:function(){return this.properties.center3D},u_verticalExaggerationAndRelativeHeight:function(){return this.properties.verticalExaggerationAndRelativeHeight},u_tileRectangle:function(){return this.properties.tileRectangle},u_modifiedModelView:function(){let i=e.context.uniformState.view,r=N.multiplyByPoint(i,this.properties.rtc,tIe);return N.setTranslation(i,r,eIe),eIe},u_modifiedModelViewProjection:function(){let i=e.context.uniformState.view,r=e.context.uniformState.projection,o=N.multiplyByPoint(i,this.properties.rtc,tIe);return N.setTranslation(i,o,c5),N.multiply(r,c5,c5),c5},u_dayTextures:function(){return this.properties.dayTextures},u_dayTextureTranslationAndScale:function(){return this.properties.dayTextureTranslationAndScale},u_dayTextureTexCoordsRectangle:function(){return this.properties.dayTextureTexCoordsRectangle},u_dayTextureUseWebMercatorT:function(){return this.properties.dayTextureUseWebMercatorT},u_dayTextureAlpha:function(){return this.properties.dayTextureAlpha},u_dayTextureNightAlpha:function(){return this.properties.dayTextureNightAlpha},u_dayTextureDayAlpha:function(){return this.properties.dayTextureDayAlpha},u_dayTextureBrightness:function(){return this.properties.dayTextureBrightness},u_dayTextureContrast:function(){return this.properties.dayTextureContrast},u_dayTextureHue:function(){return this.properties.dayTextureHue},u_dayTextureSaturation:function(){return this.properties.dayTextureSaturation},u_dayTextureOneOverGamma:function(){return this.properties.dayTextureOneOverGamma},u_dayIntensity:function(){return this.properties.dayIntensity},u_southAndNorthLatitude:function(){return this.properties.southAndNorthLatitude},u_southMercatorYAndOneOverHeight:function(){return this.properties.southMercatorYAndOneOverHeight},u_waterMask:function(){return this.properties.waterMask},u_waterMaskTranslationAndScale:function(){return this.properties.waterMaskTranslationAndScale},u_minMaxHeight:function(){return this.properties.minMaxHeight},u_scaleAndBias:function(){return this.properties.scaleAndBias},u_dayTextureSplit:function(){return this.properties.dayTextureSplit},u_dayTextureCutoutRectangles:function(){return this.properties.dayTextureCutoutRectangles},u_clippingPlanes:function(){let i=t._clippingPlanes;return l(i)&&l(i.texture)?i.texture:e.context.defaultTexture},u_cartographicLimitRectangle:function(){return this.properties.localizedCartographicLimitRectangle},u_clippingPlanesMatrix:function(){let i=t._clippingPlanes,r=l(i)?N.multiply(e.context.uniformState.view,i.modelMatrix,uTt):N.IDENTITY;return N.inverseTranspose(r,fTt)},u_clippingPlanesEdgeStyle:function(){let i=this.properties.clippingPlanesEdgeColor;return i.alpha=this.properties.clippingPlanesEdgeWidth,i},u_minimumBrightness:function(){return e.fog.minimumBrightness},u_hsbShift:function(){return this.properties.hsbShift},u_colorsToAlpha:function(){return this.properties.colorsToAlpha},u_frontFaceAlphaByDistance:function(){return this.properties.frontFaceAlphaByDistance},u_backFaceAlphaByDistance:function(){return this.properties.backFaceAlphaByDistance},u_translucencyRectangle:function(){return this.properties.localizedTranslucencyRectangle},u_undergroundColor:function(){return this.properties.undergroundColor},u_undergroundColorAlphaByDistance:function(){return this.properties.undergroundColorAlphaByDistance},u_lambertDiffuseMultiplier:function(){return this.properties.lambertDiffuseMultiplier},u_vertexShadowDarkness:function(){return this.properties.vertexShadowDarkness},u_vectorSegmentTexture:function(){return this.properties.vectorSegmentTexture??e.context.defaultTexture},u_vectorWidthTexture:function(){return this.properties.vectorWidthTexture??e.context.defaultTexture},u_vectorColorTexture:function(){return this.properties.vectorColorTexture??e.context.defaultTexture},u_vectorPickColorTexture:function(){return this.properties.vectorPickColorTexture??e.context.defaultTexture},u_vectorSegmentPrimitiveIndicesTexture:function(){return this.properties.vectorSegmentPrimitiveIndicesTexture??e.context.defaultTexture},u_vectorGridCellIndicesTexture:function(){return this.properties.vectorGridCellIndicesTexture??e.context.defaultTexture},u_vectorPolygonEdgeTexture:function(){return this.properties.vectorPolygonEdgeTexture??e.context.defaultTexture},u_vectorPolygonEdgePrimitiveIndicesTexture:function(){return this.properties.vectorPolygonEdgePrimitiveIndicesTexture??e.context.defaultTexture},u_vectorPolygonGridCellIndicesTexture:function(){return this.properties.vectorPolygonGridCellIndicesTexture??e.context.defaultTexture},u_vectorMetersPerUv:function(){return this.properties.vectorMetersPerUv},u_clippingEdgeTexture:function(){return this.properties.clippingEdgeTexture??e.context.defaultTexture},u_clippingEdgePrimitiveIndicesTexture:function(){return this.properties.clippingEdgePrimitiveIndicesTexture??e.context.defaultTexture},u_clippingGridCellIndicesTexture:function(){return this.properties.clippingGridCellIndicesTexture??e.context.defaultTexture},properties:{initialColor:new se(0,0,.5,1),fillHighlightColor:new z(0,0,0,0),zoomedOutOceanSpecularIntensity:.5,oceanNormalMap:void 0,lightingFadeDistance:new U(65e5,9e6),nightFadeDistance:new U(1e7,4e7),atmosphereLightIntensity:10,atmosphereRayleighCoefficient:new h(55e-7,13e-6,284e-7),atmosphereMieCoefficient:new h(21e-6,21e-6,21e-6),atmosphereRayleighScaleHeight:1e4,atmosphereMieScaleHeight:3200,atmosphereMieAnisotropy:.9,hsbShift:new h,center3D:void 0,rtc:new h,modifiedModelView:new N,tileRectangle:new se,verticalExaggerationAndRelativeHeight:new U(1,0),dayTextures:[],dayTextureTranslationAndScale:[],dayTextureTexCoordsRectangle:[],dayTextureUseWebMercatorT:[],dayTextureAlpha:[],dayTextureNightAlpha:[],dayTextureDayAlpha:[],dayTextureBrightness:[],dayTextureContrast:[],dayTextureHue:[],dayTextureSaturation:[],dayTextureOneOverGamma:[],dayTextureSplit:[],dayTextureCutoutRectangles:[],dayIntensity:0,colorsToAlpha:[],southAndNorthLatitude:new U,southMercatorYAndOneOverHeight:new U,waterMask:void 0,waterMaskTranslationAndScale:new se,minMaxHeight:new U,scaleAndBias:new N,clippingPlanesEdgeColor:z.clone(z.WHITE),clippingPlanesEdgeWidth:0,localizedCartographicLimitRectangle:new se,frontFaceAlphaByDistance:new se,backFaceAlphaByDistance:new se,localizedTranslucencyRectangle:new se,undergroundColor:z.clone(z.TRANSPARENT),undergroundColorAlphaByDistance:new se,lambertDiffuseMultiplier:0,vertexShadowDarkness:0,vectorSegmentTexture:void 0,vectorWidthTexture:void 0,vectorColorTexture:void 0,vectorPickColorTexture:void 0,vectorSegmentPrimitiveIndicesTexture:void 0,vectorGridCellIndicesTexture:void 0,vectorPolygonEdgeTexture:void 0,vectorPolygonEdgePrimitiveIndicesTexture:void 0,vectorPolygonGridCellIndicesTexture:void 0,vectorMetersPerUv:new U,clippingEdgeTexture:void 0,clippingEdgePrimitiveIndicesTexture:void 0,clippingGridCellIndicesTexture:void 0}};return l(t.materialUniformMap)?Ot(n,t.materialUniformMap):n}function dTt(e,t){let n=t.data,i,r;if(l(n.vertexArray)?(i=n.mesh,r=n.vertexArray):l(n.fill)&&l(n.fill.vertexArray)&&(i=n.fill.mesh,r=n.fill.vertexArray),!(!l(i)||!l(r))){if(l(n.wireframeVertexArray)){if(n.wireframeVertexArray.mesh===i)return;n.wireframeVertexArray.destroy(),n.wireframeVertexArray=void 0}n.wireframeVertexArray=hTt(e,r,i),n.wireframeVertexArray.mesh=i}}function hTt(e,t,n){let r={indices:n.indices,primitiveType:Oe.TRIANGLES};Hn.toWireframe(r);let o=r.indices,s=tt.createIndexBuffer({context:e,typedArray:o,usage:Me.STATIC_DRAW,indexDatatype:je.fromSizeInBytes(o.BYTES_PER_ELEMENT)});return new zn({context:e,attributes:t._attributes,indexBuffer:s})}var aIe,cIe,u5;(function(){let e=new Ft({geometry:sm.fromDimensions({dimensions:new h(2,2,2)})}),t=new Ft({geometry:new S_({radius:1})}),n=new N,i,r;function o(s){return new On({geometryInstances:s,appearance:new yn({translucent:!1,flat:!0}),asynchronous:!1})}aIe=function(s,a){return s===i||(u5(),i=s,n=N.fromRotationTranslation(s.halfAxes,s.center,n),e.modelMatrix=n,e.attributes.color=Jt.fromColor(a),r=o(e)),r},cIe=function(s,a){return s===i||(u5(),i=s,n=N.fromTranslation(s.center,n),n=N.multiplyByUniformScale(n,s.radius,n),t.modelMatrix=n,t.attributes.color=Jt.fromColor(a),r=o(t)),r},u5=function(){l(r)&&(r.destroy(),r=void 0,i=void 0)}})();var mTt=new se(0,0,0,0),pTt={frameState:void 0,surfaceTile:void 0,numberOfDayTextures:void 0,applyBrightness:void 0,applyContrast:void 0,applyHue:void 0,applySaturation:void 0,applyGamma:void 0,applyAlpha:void 0,applyDayNightAlpha:void 0,applySplit:void 0,showReflectiveOcean:void 0,showOceanWaves:void 0,enableLighting:void 0,dynamicAtmosphereLighting:void 0,dynamicAtmosphereLightingFromSun:void 0,showGroundAtmosphere:void 0,perFragmentGroundAtmosphere:void 0,hasVertexNormals:void 0,useWebMercatorProjection:void 0,enableFog:void 0,enableClippingPlanes:void 0,clippingPlanes:void 0,enableClippingPolygons:void 0,clippingPolygons:void 0,clippedByBoundaries:void 0,hasImageryLayerCutout:void 0,colorCorrect:void 0,colorToAlpha:void 0,hasGeodeticSurfaceNormals:void 0,hasExaggeration:void 0,vectorAntialias:void 0},gTt=z.TRANSPARENT,_Tt=new qt;function yTt(e,t,n){let i=t.data;if(Yxt(e,i))return;l(i.vertexArray)||(i.fill===void 0&&(i.fill=new cI(t)),i.fill.update(e,n));let r=n.creditDisplay,o=i.terrainData;if(l(o)&&l(o.credits)){let mt=o.credits;for(let ft=0,Xt=mt.length;ft<Xt;++ft)r.addCreditToNextFrame(mt[ft])}let s=kt.maximumTextureImageUnits,a=i.waterMaskTexture,c=i.waterMaskTranslationAndScale;!l(a)&&l(i.fill)&&(a=i.fill.waterMaskTexture,c=i.fill.waterMaskTranslationAndScale);let u=n.cameraUnderground,f=n.globeTranslucencyState,d=f.translucent,p=f.frontFaceAlphaByDistance,g=f.backFaceAlphaByDistance,m=f.rectangle,y=e.undergroundColor??gTt,A=e.undergroundColorAlphaByDistance??_Tt,b=sIe(e,n)&&n.mode===re.SCENE3D&&y.alpha>0&&(A.nearValue>0||A.farValue>0),x=e.lambertDiffuseMultiplier,T=e.vertexShadowDarkness,E=e.hasWaterMask&&l(a),v=E&&e.showWaterEffect,S=e.oceanNormalMap,I=v&&l(S),R=e.terrainProvider,O=l(R)&&e.terrainProvider.hasVertexNormals,L=n.fog.enabled&&n.fog.renderable&&!u,_=e.showGroundAtmosphere&&n.mode===re.SCENE3D,C=Pn.castShadows(e.shadows)&&!d,w=Pn.receiveShadows(e.shadows)&&!d,P=e.hueShift,M=e.saturationShift,F=e.brightnessShift,V=!(D.equalsEpsilon(P,0,D.EPSILON7)&&D.equalsEpsilon(M,0,D.EPSILON7)&&D.equalsEpsilon(F,0,D.EPSILON7)),B=!1;if(_){let mt=h.magnitude(n.camera.positionWC),ft=e.nightFadeOutDistance;B=mt>ft}E&&--s,I&&--s,l(n.shadowState)&&n.shadowState.shadowsEnabled&&--s,l(e.clippingPlanes)&&e.clippingPlanes.enabled&&--s,l(e.clippingPolygons)&&e.clippingPolygons.enabled&&(s-=3),s-=f.numberOfTextureUniforms;let j=i.renderedMesh,k=j.center,G=j.encoding,q=i.tileBoundingRegion,Q=n.verticalExaggeration,W=n.verticalExaggerationRelativeHeight,J=Q!==1,Z=G.hasGeodeticSurfaceNormals,ae=tTt,Ae=0,fe=0,xe=0,ge=0,we=!1;if(n.mode!==re.SCENE3D){let mt=n.mapProjection,ft=mt.project(ie.southwest(t.rectangle),oTt),Xt=mt.project(ie.northeast(t.rectangle),sTt);if(ae.x=ft.x,ae.y=ft.y,ae.z=Xt.x,ae.w=Xt.y,n.mode!==re.MORPHING&&(k=rTt,k.x=0,k.y=(ae.z+ae.x)*.5,k.z=(ae.w+ae.y)*.5,ae.x-=k.y,ae.y-=k.z,ae.z-=k.y,ae.w-=k.z),n.mode===re.SCENE2D&&G.quantization===Ka.BITS12){let rt=1/(Math.pow(2,12)-1)*.5,ht=(ae.z-ae.x)*rt,Bi=(ae.w-ae.y)*rt;ae.x-=ht,ae.y-=Bi,ae.z+=ht,ae.w+=Bi}mt instanceof yi&&(Ae=t.rectangle.south,fe=t.rectangle.north,xe=yi.geodeticLatitudeToMercatorAngle(Ae),ge=1/(yi.geodeticLatitudeToMercatorAngle(fe)-xe),we=!0)}let Se=pTt;Se.frameState=n,Se.surfaceTile=i,Se.hasWaterMask=E,Se.showReflectiveOcean=v,Se.showOceanWaves=I,Se.enableLighting=e.enableLighting,Se.dynamicAtmosphereLighting=e.dynamicAtmosphereLighting,Se.dynamicAtmosphereLightingFromSun=e.dynamicAtmosphereLightingFromSun,Se.showGroundAtmosphere=_,Se.atmosphereLightIntensity=e.atmosphereLightIntensity,Se.atmosphereRayleighCoefficient=e.atmosphereRayleighCoefficient,Se.atmosphereMieCoefficient=e.atmosphereMieCoefficient,Se.atmosphereRayleighScaleHeight=e.atmosphereRayleighScaleHeight,Se.atmosphereMieScaleHeight=e.atmosphereMieScaleHeight,Se.atmosphereMieAnisotropy=e.atmosphereMieAnisotropy,Se.perFragmentGroundAtmosphere=B,Se.hasVertexNormals=O,Se.useWebMercatorProjection=we,Se.clippedByBoundaries=i.clippedByBoundaries,Se.hasGeodeticSurfaceNormals=Z,Se.hasExaggeration=J,Se.vectorAntialias=e.vectorProvider.antialias;let Re=i.imagery,Qe=0,He=Re.length,Xe=e.showSkirts&&!u&&!d,$e=e.backFaceCulling&&!u&&!d,Pe=$e?e._renderState:e._disableCullingRenderState,qe=$e?e._blendRenderState:e._disableCullingBlendRenderState,st=Pe,vt=e._firstPassInitialColor,Gt=n.context;if(l(e._debug.boundingSphereTile)||u5(),e._materialUniformMap!==e.materialUniformMap){e._materialUniformMap=e.materialUniformMap;let mt=e._drawCommands.length;for(let ft=0;ft<mt;++ft)e._uniformMaps[ft]=iIe(n,e)}do{let mt=0,ft,Xt;if(e._drawCommands.length<=e._usedDrawCommands?(ft=new at,ft.owner=t,ft.cull=!1,ft.boundingVolume=new ue,ft.orientedBoundingBox=void 0,Xt=iIe(n,e),e._drawCommands.push(ft),e._uniformMaps.push(Xt)):(ft=e._drawCommands[e._usedDrawCommands],Xt=e._uniformMaps[e._usedDrawCommands]),ft.owner=t,++e._usedDrawCommands,t===e._debug.boundingSphereTile){let ks=q.boundingVolume,tc=q.boundingSphere;l(ks)?aIe(ks,z.RED).update(n):l(tc)&&cIe(tc,z.RED).update(n)}let rt=Xt.properties;se.clone(vt,rt.initialColor),rt.oceanNormalMap=S,rt.lightingFadeDistance.x=e.lightingFadeOutDistance,rt.lightingFadeDistance.y=e.lightingFadeInDistance,rt.nightFadeDistance.x=e.nightFadeOutDistance,rt.nightFadeDistance.y=e.nightFadeInDistance,rt.atmosphereLightIntensity=e.atmosphereLightIntensity,rt.atmosphereRayleighCoefficient=e.atmosphereRayleighCoefficient,rt.atmosphereMieCoefficient=e.atmosphereMieCoefficient,rt.atmosphereRayleighScaleHeight=e.atmosphereRayleighScaleHeight,rt.atmosphereMieScaleHeight=e.atmosphereMieScaleHeight,rt.atmosphereMieAnisotropy=e.atmosphereMieAnisotropy,rt.zoomedOutOceanSpecularIntensity=e.zoomedOutOceanSpecularIntensity;let ht=u?g:p,Bi=u?p:g;l(ht)&&(se.fromElements(ht.near,ht.nearValue,ht.far,ht.farValue,rt.frontFaceAlphaByDistance),se.fromElements(Bi.near,Bi.nearValue,Bi.far,Bi.farValue,rt.backFaceAlphaByDistance)),se.fromElements(A.near,A.nearValue,A.far,A.farValue,rt.undergroundColorAlphaByDistance),z.clone(y,rt.undergroundColor),rt.lambertDiffuseMultiplier=x,rt.vertexShadowDarkness=T;let Xn=!l(i.vertexArray)&&l(e.fillHighlightColor)&&e.fillHighlightColor.alpha>0;Xn&&z.clone(e.fillHighlightColor,rt.fillHighlightColor),rt.verticalExaggerationAndRelativeHeight.x=Q,rt.verticalExaggerationAndRelativeHeight.y=W,rt.center3D=j.center,h.clone(k,rt.rtc),se.clone(ae,rt.tileRectangle),rt.southAndNorthLatitude.x=Ae,rt.southAndNorthLatitude.y=fe,rt.southMercatorYAndOneOverHeight.x=xe,rt.southMercatorYAndOneOverHeight.y=ge;let bi=nTt,Wi=l5(t.rectangle,e.cartographicLimitRectangle),wi=iTt,hi=l5(t.rectangle,m);h.fromElements(P,M,F,rt.hsbShift);let xi=t.rectangle,jn=1/xi.width,nn=1/xi.height;bi.x=(Wi.west-xi.west)*jn,bi.y=(Wi.south-xi.south)*nn,bi.z=(Wi.east-xi.west)*jn,bi.w=(Wi.north-xi.south)*nn,se.clone(bi,rt.localizedCartographicLimitRectangle),wi.x=(hi.west-xi.west)*jn,wi.y=(hi.south-xi.south)*nn,wi.z=(hi.east-xi.west)*jn,wi.w=(hi.north-xi.south)*nn,se.clone(wi,rt.localizedTranslucencyRectangle);let Wn=L&&D.fog(t._distance,n.fog.density)>D.EPSILON3;V=V&&(Wn||_);let Zi=!1,Mr=!1,fo=!1,Bs=!1,Ks=!1,no=!1,gi=!1,ho=!1,ur=!1,Zo=!1;for(;mt<s&&Qe<He;){let ks=Re[Qe],tc=ks.readyImagery;if(++Qe,!l(tc)||tc.imageryLayer.alpha===0)continue;let Kb=ks.useWebMercatorT?tc.textureWebMercator:tc.texture,ri=tc.imageryLayer;l(ks.textureTranslationAndScale)||(ks.textureTranslationAndScale=ri._calculateTextureTranslationAndScale(t,ks)),rt.dayTextures[mt]=Kb,rt.dayTextureTranslationAndScale[mt]=ks.textureTranslationAndScale,rt.dayTextureTexCoordsRectangle[mt]=ks.textureCoordinateRectangle,rt.dayTextureUseWebMercatorT[mt]=ks.useWebMercatorT,rt.dayTextureAlpha[mt]=ri.alpha,no=no||rt.dayTextureAlpha[mt]!==1,rt.dayTextureNightAlpha[mt]=ri.nightAlpha,gi=gi||rt.dayTextureNightAlpha[mt]!==1,rt.dayTextureDayAlpha[mt]=ri.dayAlpha,gi=gi||rt.dayTextureDayAlpha[mt]!==1,rt.dayTextureBrightness[mt]=ri.brightness,Zi=Zi||rt.dayTextureBrightness[mt]!==Is.DEFAULT_BRIGHTNESS,rt.dayTextureContrast[mt]=ri.contrast,Mr=Mr||rt.dayTextureContrast[mt]!==Is.DEFAULT_CONTRAST,rt.dayTextureHue[mt]=ri.hue,fo=fo||rt.dayTextureHue[mt]!==Is.DEFAULT_HUE,rt.dayTextureSaturation[mt]=ri.saturation,Bs=Bs||rt.dayTextureSaturation[mt]!==Is.DEFAULT_SATURATION,rt.dayTextureOneOverGamma[mt]=1/ri.gamma,Ks=Ks||rt.dayTextureOneOverGamma[mt]!==1/Is.DEFAULT_GAMMA,rt.dayTextureSplit[mt]=ri.splitDirection,ho=ho||rt.dayTextureSplit[mt]!==0;let Kr=rt.dayTextureCutoutRectangles[mt];if(l(Kr)||(Kr=rt.dayTextureCutoutRectangles[mt]=new se),se.clone(se.ZERO,Kr),l(ri.cutoutRectangle)){let Ma=l5(xi,ri.cutoutRectangle),Ep=ie.simpleIntersection(Ma,xi,oIe);ur=l(Ep)||ur,Kr.x=(Ma.west-xi.west)*jn,Kr.y=(Ma.south-xi.south)*nn,Kr.z=(Ma.east-xi.west)*jn,Kr.w=(Ma.north-xi.south)*nn}let Ol=rt.colorsToAlpha[mt];l(Ol)||(Ol=rt.colorsToAlpha[mt]=new se);let Z0=l(ri.colorToAlpha)&&ri.colorToAlphaThreshold>0;if(Zo=Zo||Z0,Z0){let Ma=ri.colorToAlpha;Ol.x=Ma.red,Ol.y=Ma.green,Ol.z=Ma.blue,Ol.w=ri.colorToAlphaThreshold}else Ol.w=-1;if(l(tc.credits)){let Ma=tc.credits;for(let Ep=0,Cy=Ma.length;Ep<Cy;++Ep)r.addCreditToNextFrame(Ma[Ep])}++mt}rt.dayTextures.length=mt,rt.waterMask=a,se.clone(c,rt.waterMaskTranslationAndScale),rt.minMaxHeight.x=G.minimumHeight,rt.minMaxHeight.y=G.maximumHeight,N.clone(G.matrix,rt.scaleAndBias);let Bn=e._clippingPlanes,qi=l(Bn)&&Bn.enabled&&t.isClipped;qi&&(rt.clippingPlanesEdgeColor=z.clone(Bn.edgeColor,rt.clippingPlanesEdgeColor),rt.clippingPlanesEdgeWidth=Bn.edgeWidth);let ki=i.vectorData;l(ki)&&(rt.vectorSegmentTexture=ki.polylineSegmentTexture,rt.vectorWidthTexture=ki.widthTexture,rt.vectorColorTexture=ki.colorTexture,rt.vectorPickColorTexture=ki.pickColorTexture,rt.vectorSegmentPrimitiveIndicesTexture=ki.polylineSegmentPrimitiveIndicesTexture,rt.vectorGridCellIndicesTexture=ki.polylineGridCellIndicesTexture,rt.vectorPolygonEdgeTexture=ki.polygonEdgeTexture,rt.vectorPolygonEdgePrimitiveIndicesTexture=ki.polygonEdgePrimitiveIndicesTexture,rt.vectorPolygonGridCellIndicesTexture=ki.polygonGridCellIndicesTexture,U.clone(ki.metersPerUv,rt.vectorMetersPerUv));let Nr=i.clippingPolygonData;l(Nr)&&(rt.clippingEdgeTexture=Nr.polygonEdgeTexture,rt.clippingEdgePrimitiveIndicesTexture=Nr.polygonEdgePrimitiveIndicesTexture,rt.clippingGridCellIndicesTexture=Nr.polygonGridCellIndicesTexture);let Wc=e._clippingPolygons,bd=(Nr?.polygonRings.length??0)>0,xp=l(Wc)&&Wc.enabled&&Wc.length>0&&t.isClipped&&bd;Se.numberOfDayTextures=mt,Se.applyBrightness=Zi,Se.applyContrast=Mr,Se.applyHue=fo,Se.applySaturation=Bs,Se.applyGamma=Ks,Se.applyAlpha=no,Se.applyDayNightAlpha=gi,Se.applySplit=ho,Se.enableFog=Wn,Se.enableClippingPlanes=qi,Se.clippingPlanes=Bn,Se.enableClippingPolygons=xp,Se.clippingPolygons=Wc,Se.hasImageryLayerCutout=ur,Se.colorCorrect=V,Se.highlightFillTile=Xn,Se.colorToAlpha=Zo,Se.showUndergroundColor=b,Se.translucent=d;let Nh=i.renderedMesh.indices.length;Xe||(Nh=i.renderedMesh.indexCountWithoutSkirts),ft.shaderProgram=e._surfaceShaderSet.getShaderProgram(Se),ft.pickId=i.vectorData?.show?"vectorPickColorOver(vec4(0.0))":void 0,ft.castShadows=C,ft.receiveShadows=w,ft.renderState=st,ft.primitiveType=Oe.TRIANGLES,ft.vertexArray=i.vertexArray||i.fill.vertexArray,ft.count=Nh,ft.uniformMap=Xt,ft.pass=Ie.GLOBE,e._debug.wireframe&&(dTt(Gt,t),l(i.wireframeVertexArray)&&(ft.vertexArray=i.wireframeVertexArray,ft.primitiveType=Oe.LINES,ft.count=Nh*2));let da=ft.boundingVolume,Tp=ft.orientedBoundingBox;n.mode!==re.SCENE3D?(ue.fromRectangleWithHeights2D(t.rectangle,n.mapProjection,q.minimumHeight,q.maximumHeight,da),h.fromElements(da.center.z,da.center.x,da.center.y,da.center),n.mode===re.MORPHING&&ue.union(q.boundingSphere,da,da)):(ft.boundingVolume=ue.clone(q.boundingSphere,da),ft.orientedBoundingBox=en.clone(q.boundingVolume,Tp)),ft.dirty=!0,d&&f.updateDerivedCommands(ft,n),rIe(ft,n),st=qe,vt=mTt}while(Qe<He)}var z3=Pte;function lIe(){this._enabled=!1,this._frontFaceAlpha=1,this._frontFaceAlphaByDistance=void 0,this._backFaceAlpha=1,this._backFaceAlphaByDistance=void 0,this._rectangle=ie.clone(ie.MAX_VALUE)}Object.defineProperties(lIe.prototype,{enabled:{get:function(){return this._enabled},set:function(e){this._enabled=e}},frontFaceAlpha:{get:function(){return this._frontFaceAlpha},set:function(e){this._frontFaceAlpha=e}},frontFaceAlphaByDistance:{get:function(){return this._frontFaceAlphaByDistance},set:function(e){this._frontFaceAlphaByDistance=qt.clone(e,this._frontFaceAlphaByDistance)}},backFaceAlpha:{get:function(){return this._backFaceAlpha},set:function(e){this._backFaceAlpha=e}},backFaceAlphaByDistance:{get:function(){return this._backFaceAlphaByDistance},set:function(e){this._backFaceAlphaByDistance=qt.clone(e,this._backFaceAlphaByDistance)}},rectangle:{get:function(){return this._rectangle},set:function(e){l(e)||(e=ie.clone(ie.MAX_VALUE)),ie.clone(e,this._rectangle)}}});var V3=lIe;var Dte=class{constructor(t){this._ellipsoid=new Zh(t.ellipsoid,h.ZERO)}get ellipsoid(){return this._ellipsoid}},j3=Dte;var Rte=class{constructor(t){this.maxSize=t,this.cache=new Map}get(t){if(!this.cache.has(t))return;let n=this.cache.get(t);return this.cache.delete(t),this.cache.set(t,n),n}set(t,n){if(this.cache.has(t))this.cache.delete(t);else if(this.cache.size>=this.maxSize){let i=this.cache.keys().next().value;this.cache.delete(i)}this.cache.set(t,n)}get size(){return this.cache.size}clear(){this.cache.clear()}},ATt=1e3,Ote=class e{constructor(t){this._tilingScheme=t.tilingScheme,this._x=t.x,this._y=t.y,this._level=t.level,this._parent=t.parent,this._rectangle=this._tilingScheme.tileXYToRectangle(this._x,this._y,this._level),this._southwestChild=void 0,this._southeastChild=void 0,this._northwestChild=void 0,this._northeastChild=void 0,this.replacementPrevious=void 0,this.replacementNext=void 0,this._distance=0,this._loadPriority=0,this._customData=new Set,this._customDataIterator=void 0,this._addedCustomData=[],this._removedCustomData=[],this._lastSelectionResult=pi.NONE,this._lastSelectionResultFrame=void 0,this._loadedCallbacks={},this._positionCache=new Rte(ATt),this.state=$a.START,this.renderable=!1,this.upsampledFromParent=!1,this.data=void 0}static createLevelZeroTiles(t){let n=t.getNumberOfXTilesAtLevel(0),i=t.getNumberOfYTilesAtLevel(0),r=new Array(n*i),o=0;for(let s=0;s<i;++s)for(let a=0;a<n;++a)r[o++]=new e({tilingScheme:t,x:a,y:s,level:0});return r}_getCacheKey(t,n){return xTt(t.longitude,t.latitude,this._rectangle,n)}getPositionCacheEntry(t,n){return this._positionCache.get(this._getCacheKey(t,n))}setPositionCacheEntry(t,n,i){this._positionCache.set(this._getCacheKey(t,n),i)}clearPositionCache(){this._positionCache.size>0&&this._positionCache.clear()}updateCustomData(){let t=this._addedCustomData,n=this._removedCustomData;if(t.length===0&&n.length===0)return;let i=this.customData;for(let r=0;r<t.length;++r){let o=t[r];if(!l(o))continue;i.add(o);let s=uIe(this,o.positionCartographic);o._pendingAddTile=s,o._pendingAddIndex=s._addedCustomData.length,s._addedCustomData.push(o)}this._addedCustomData.length=0;for(let r=0;r<n.length;++r){let o=n[r];if(!l(o))continue;i.has(o)&&i.delete(o);let s=uIe(this,o.positionCartographic);if(o._pendingAddTile===s&&s._addedCustomData[o._pendingAddIndex]===o){s._addedCustomData[o._pendingAddIndex]=void 0,o._pendingAddTile=void 0;continue}s._removedCustomData.push(o)}this._removedCustomData.length=0}get tilingScheme(){return this._tilingScheme}get x(){return this._x}get y(){return this._y}get level(){return this._level}get parent(){return this._parent}get rectangle(){return this._rectangle}get children(){return[this.northwestChild,this.northeastChild,this.southwestChild,this.southeastChild]}get southwestChild(){return l(this._southwestChild)||(this._southwestChild=new e({tilingScheme:this.tilingScheme,x:this.x*2,y:this.y*2+1,level:this.level+1,parent:this})),this._southwestChild}get southeastChild(){return l(this._southeastChild)||(this._southeastChild=new e({tilingScheme:this.tilingScheme,x:this.x*2+1,y:this.y*2+1,level:this.level+1,parent:this})),this._southeastChild}get northwestChild(){return l(this._northwestChild)||(this._northwestChild=new e({tilingScheme:this.tilingScheme,x:this.x*2,y:this.y*2,level:this.level+1,parent:this})),this._northwestChild}get northeastChild(){return l(this._northeastChild)||(this._northeastChild=new e({tilingScheme:this.tilingScheme,x:this.x*2+1,y:this.y*2,level:this.level+1,parent:this})),this._northeastChild}get customData(){return this._customData}get needsLoading(){return this.state<$a.DONE}get eligibleForUnloading(){let t=!0;return l(this.data)&&(t=this.data.eligibleForUnloading,l(t)||(t=!0)),t}findLevelZeroTile(t,n,i){let r=this.tilingScheme.getNumberOfXTilesAtLevel(0);if(n<0?n+=r:n>=r&&(n-=r),!(i<0||i>=this.tilingScheme.getNumberOfYTilesAtLevel(0)))return t.filter(function(o){return o.x===n&&o.y===i})[0]}findTileToWest(t){let n=this.parent;if(n===void 0)return this.findLevelZeroTile(t,this.x-1,this.y);if(n.southeastChild===this)return n.southwestChild;if(n.northeastChild===this)return n.northwestChild;let i=n.findTileToWest(t);if(i!==void 0)return n.southwestChild===this?i.southeastChild:i.northeastChild}findTileToEast(t){let n=this.parent;if(n===void 0)return this.findLevelZeroTile(t,this.x+1,this.y);if(n.southwestChild===this)return n.southeastChild;if(n.northwestChild===this)return n.northeastChild;let i=n.findTileToEast(t);if(i!==void 0)return n.southeastChild===this?i.southwestChild:i.northwestChild}findTileToSouth(t){let n=this.parent;if(n===void 0)return this.findLevelZeroTile(t,this.x,this.y+1);if(n.northwestChild===this)return n.southwestChild;if(n.northeastChild===this)return n.southeastChild;let i=n.findTileToSouth(t);if(i!==void 0)return n.southwestChild===this?i.northwestChild:i.northeastChild}findTileToNorth(t){let n=this.parent;if(n===void 0)return this.findLevelZeroTile(t,this.x,this.y-1);if(n.southwestChild===this)return n.northwestChild;if(n.southeastChild===this)return n.northeastChild;let i=n.findTileToNorth(t);if(i!==void 0)return n.northwestChild===this?i.southwestChild:i.southeastChild}freeResources(){this.clearPositionCache(),this.state=$a.START,this.renderable=!1,this.upsampledFromParent=!1;let t=this.data;l(t)&&l(t.freeResources)&&t.freeResources(),f5(this._southwestChild),this._southwestChild=void 0,f5(this._southeastChild),this._southeastChild=void 0,f5(this._northwestChild),this._northwestChild=void 0,f5(this._northeastChild),this._northeastChild=void 0}},bTt=256;function xTt(e,t,n,i){let r=n.width/bTt*i,o=Math.floor(e/r)*r,s=Math.floor(t/r)*r;return`${o.toFixed(10)},${s.toFixed(10)}`}var TTt=new he;function uIe(e,t){let n=e.northwestChild.rectangle,i=ie.southeast(n,TTt),r=t.longitude>=i.longitude?1:0;switch((t.latitude<i.latitude?1:0)*2+r){case 0:return e.northwestChild;case 1:return e.northeastChild;case 2:return e.southwestChild;default:return e.southeastChild}}function f5(e){l(e)&&e.freeResources()}var H3=Ote;function d5(){this.head=void 0,this.tail=void 0,this.count=0,this._lastBeforeStartOfFrame=void 0}d5.prototype.markStartOfRenderFrame=function(){this._lastBeforeStartOfFrame=this.head};d5.prototype.trimTiles=function(e){let t=this.tail,n=!0;for(;n&&l(this._lastBeforeStartOfFrame)&&this.count>e&&l(t);){n=t!==this._lastBeforeStartOfFrame;let i=t.replacementPrevious;t.eligibleForUnloading&&(t.freeResources(),fIe(this,t)),t=i}};function fIe(e,t){let n=t.replacementPrevious,i=t.replacementNext;t===e._lastBeforeStartOfFrame&&(e._lastBeforeStartOfFrame=i),t===e.head?e.head=i:n.replacementNext=i,t===e.tail?e.tail=n:i.replacementPrevious=n,t.replacementPrevious=void 0,t.replacementNext=void 0,--e.count}d5.prototype.markTileRendered=function(e){let t=this.head;if(t===e){e===this._lastBeforeStartOfFrame&&(this._lastBeforeStartOfFrame=e.replacementNext);return}if(++this.count,!l(t)){e.replacementPrevious=void 0,e.replacementNext=void 0,this.head=e,this.tail=e;return}(l(e.replacementPrevious)||l(e.replacementNext))&&fIe(this,e),e.replacementPrevious=void 0,e.replacementNext=t,t.replacementPrevious=e,this.head=e};var G3=d5;function yh(e){this._tileProvider=e.tileProvider,this._tileProvider.quadtree=this,this._debug={enableDebugOutput:!1,maxDepth:0,maxDepthVisited:0,tilesVisited:0,tilesCulled:0,tilesRendered:0,tilesWaitingForChildren:0,lastMaxDepth:-1,lastMaxDepthVisited:-1,lastTilesVisited:-1,lastTilesCulled:-1,lastTilesRendered:-1,lastTilesWaitingForChildren:-1,suspendLodUpdate:!1};let n=this._tileProvider.tilingScheme.ellipsoid;this._tilesRenderedThisFrame=new Set,this._tilesToRender=[],this._tileLoadQueueHigh=[],this._tileLoadQueueMedium=[],this._tileLoadQueueLow=[],this._tileReplacementQueue=new G3,this._levelZeroTiles=void 0,this._loadQueueTimeSlice=5,this._tilesInvalidated=!1,this._addHeightCallbacks=[],this._removeHeightCallbacks=[],this._tileToUpdateHeights=[],this._updateHeightsTimeSlice=2,this._cameraPositionCartographic=void 0,this._cameraReferenceFrameOriginCartographic=void 0,this.maximumScreenSpaceError=e.maximumScreenSpaceError??2,this.tileCacheSize=e.tileCacheSize??100,this.loadingDescendantLimit=20,this.preloadAncestors=!0,this.preloadSiblings=!1,this._occluders=new j3({ellipsoid:n}),this._tileLoadProgressEvent=new be,this._lastTileLoadQueueLength=0,this._lastSelectionFrameNumber=void 0}Object.defineProperties(yh.prototype,{tileProvider:{get:function(){return this._tileProvider}},tileLoadProgressEvent:{get:function(){return this._tileLoadProgressEvent}},occluders:{get:function(){return this._occluders}}});yh.prototype.invalidateAllTiles=function(){this._tilesInvalidated=!0};function ETt(e){let t=e._tileReplacementQueue;t.head=void 0,t.tail=void 0,t.count=0,hIe(e);let n=e._levelZeroTiles;if(l(n))for(let i=0;i<n.length;++i){let o=n[i].customData;for(let s of o)s.level=0,e._addHeightCallbacks.push(s);n[i].freeResources()}e._levelZeroTiles=void 0,e._tileProvider.cancelReprojections()}yh.prototype.forEachLoadedTile=function(e){let t=this._tileReplacementQueue.head;for(;l(t);)t.state!==$a.START&&e(t),t=t.replacementNext};yh.prototype.forEachRenderedTile=function(e){let t=this._tilesRenderedThisFrame;for(let n of t)e(n)};yh.prototype.updateHeight=function(e,t){let n=this,i={positionOnEllipsoidSurface:void 0,positionCartographic:e,level:-1,callback:t};return i.removeFunc=function(){let r=n._addHeightCallbacks,o=r.length,s=!1;for(let a=0;a<o;++a)if(r[a]===i){r.splice(a,1),s=!0;break}s||n._removeHeightCallbacks.push(i),i.callback&&(i.callback=void 0)},n._addHeightCallbacks.push(i),i.removeFunc};yh.prototype.update=function(e){l(this._tileProvider.update)&&this._tileProvider.update(e)};function hIe(e){let t=e._debug;t.maxDepth=0,t.maxDepthVisited=0,t.tilesVisited=0,t.tilesCulled=0,t.tilesRendered=0,t.tilesWaitingForChildren=0,e._tileLoadQueueHigh.length=0,e._tileLoadQueueMedium.length=0,e._tileLoadQueueLow.length=0}yh.prototype.beginFrame=function(e){e.passes.render&&(this._tilesInvalidated&&(ETt(this),this._tilesInvalidated=!1),this._tileProvider.initialize(e),hIe(this),!this._debug.suspendLodUpdate&&(this._tileReplacementQueue.markStartOfRenderFrame(),this._tilesRenderedThisFrame.clear()))};yh.prototype.render=function(e){let t=e.passes,n=this._tileProvider;t.render&&(n.beginUpdate(e),wTt(this,e),BTt(this,e),n.endUpdate(e)),t.pick&&this._tilesToRender.length>0&&n.updateForPick(e)};function CTt(e,t){let n=e._tileLoadQueueHigh.length+e._tileLoadQueueMedium.length+e._tileLoadQueueLow.length;if(n!==e._lastTileLoadQueueLength||e._tilesInvalidated){let r=be.prototype.raiseEvent.bind(e._tileLoadProgressEvent,n);t.afterRender.push(()=>(r(),!0)),e._lastTileLoadQueueLength=n}let i=e._debug;i.enableDebugOutput&&!i.suspendLodUpdate&&(i.maxDepth=e._tilesToRender.reduce(function(r,o){return Math.max(r,o.level)},-1),i.tilesRendered=e._tilesToRender.length,(i.tilesVisited!==i.lastTilesVisited||i.tilesRendered!==i.lastTilesRendered||i.tilesCulled!==i.lastTilesCulled||i.maxDepth!==i.lastMaxDepth||i.tilesWaitingForChildren!==i.lastTilesWaitingForChildren||i.maxDepthVisited!==i.lastMaxDepthVisited)&&(console.log(`Visited ${i.tilesVisited}, Rendered: ${i.tilesRendered}, Culled: ${i.tilesCulled}, Max Depth Rendered: ${i.maxDepth}, Max Depth Visited: ${i.maxDepthVisited}, Waiting for children: ${i.tilesWaitingForChildren}`),i.lastTilesVisited=i.tilesVisited,i.lastTilesRendered=i.tilesRendered,i.lastTilesCulled=i.tilesCulled,i.lastMaxDepth=i.maxDepth,i.lastTilesWaitingForChildren=i.tilesWaitingForChildren,i.lastMaxDepthVisited=i.maxDepthVisited))}yh.prototype.endFrame=function(e){!e.passes.render||e.mode===re.MORPHING||(MTt(this,e),FTt(this,e),CTt(this,e))};yh.prototype.isDestroyed=function(){return!1};yh.prototype.destroy=function(){this._tileProvider=this._tileProvider&&this._tileProvider.destroy()};var q3,dIe=new he;function vTt(e,t){let n=ie.center(e.rectangle,dIe),i=n.longitude-q3.longitude,r=n.latitude-q3.latitude;n=ie.center(t.rectangle,dIe);let o=n.longitude-q3.longitude,s=n.latitude-q3.latitude;return i*i+r*r-(o*o+s*s)}var STt=new h,W3=[];function wTt(e,t){let n=e._debug;if(n.suspendLodUpdate)return;let i=e._tilesToRender;i.length=0;let r=e._tileProvider;if(!l(e._levelZeroTiles)){let d=r.tilingScheme;if(l(d)){let p=r.tilingScheme;e._levelZeroTiles=H3.createLevelZeroTiles(p);let g=e._levelZeroTiles.length;if(W3.length<g){W3=new Array(g);for(let m=0;m<g;++m)W3[m]===void 0&&(W3[m]=new Y3)}}else return}e._occluders.ellipsoid.cameraPosition=t.camera.positionWC;let o=e._levelZeroTiles,s=o.length>1?e._occluders:void 0;q3=t.camera.positionCartographic,o.sort(vTt);let a=e._addHeightCallbacks,c=e._removeHeightCallbacks;a.forEach(d=>{let p=o.find(g=>ie.contains(g.rectangle,d.positionCartographic));p&&p._addedCustomData.push(d)}),c.forEach(d=>{let p=o.find(g=>ie.contains(g.rectangle,d.positionCartographic));p&&p._removedCustomData.push(d)}),o.forEach(d=>d.updateCustomData()),a.length=0,c.length=0;let u=t.camera;e._cameraPositionCartographic=u.positionCartographic;let f=N.getTranslation(u.transform,STt);e._cameraReferenceFrameOriginCartographic=e.tileProvider.tilingScheme.ellipsoid.cartesianToCartographic(f,e._cameraReferenceFrameOriginCartographic);for(let d=0;d<o.length;++d){let p=o[d];e._tileReplacementQueue.markTileRendered(p),p.renderable?Vc(e,p,r,t,s,!1,W3[d]):(B_(e,e._tileLoadQueueHigh,p,t),++n.tilesWaitingForChildren)}e._lastSelectionFrameNumber=t.frameNumber}function B_(e,t,n,i){n.needsLoading&&(e.tileProvider.computeTileLoadPriority!==void 0&&(n._loadPriority=e.tileProvider.computeTileLoadPriority(n,i)),t.push(n))}function Y3(){this.allAreRenderable=!0,this.anyWereRenderedLastFrame=!1,this.notYetRenderableCount=0}function mIe(){this.southwest=new Y3,this.southeast=new Y3,this.northwest=new Y3,this.northeast=new Y3}mIe.prototype.combine=function(e){let t=this.southwest,n=this.southeast,i=this.northwest,r=this.northeast;e.allAreRenderable=t.allAreRenderable&&n.allAreRenderable&&i.allAreRenderable&&r.allAreRenderable,e.anyWereRenderedLastFrame=t.anyWereRenderedLastFrame||n.anyWereRenderedLastFrame||i.anyWereRenderedLastFrame||r.anyWereRenderedLastFrame,e.notYetRenderableCount=t.notYetRenderableCount+n.notYetRenderableCount+i.notYetRenderableCount+r.notYetRenderableCount};var Nte=new Array(31);for(let e=0;e<Nte.length;++e)Nte[e]=new mIe;function ITt(e,t,n,i,r){let o=e._debug;++o.tilesVisited,e._tileReplacementQueue.markTileRendered(n),n.updateCustomData(),n.level>o.maxDepthVisited&&(o.maxDepthVisited=n.level);let s=RTt(e,t,n)<e.maximumScreenSpaceError,a=n.southwestChild,c=n.southeastChild,u=n.northwestChild,f=n.northeastChild,d=e._lastSelectionFrameNumber,p=n._lastSelectionResultFrame===d?n._lastSelectionResult:pi.NONE,g=e.tileProvider;if(s||i){let m=pi.originalResult(p)===pi.RENDERED,y=pi.originalResult(p)===pi.CULLED||p===pi.NONE,A=n.state===$a.DONE,b=m||y||A;if(b||l(g.canRenderWithoutLosingDetail)&&(b=g.canRenderWithoutLosingDetail(n)),b){s&&B_(e,e._tileLoadQueueMedium,n,t),h5(e,n),r.allAreRenderable=n.renderable,r.anyWereRenderedLastFrame=p===pi.RENDERED,r.notYetRenderableCount=n.renderable?0:1,n._lastSelectionResultFrame=t.frameNumber,n._lastSelectionResult=pi.RENDERED,r.anyWereRenderedLastFrame||e._tileToUpdateHeights.push(n);return}i=!0,s&&B_(e,e._tileLoadQueueHigh,n,t)}if(g.canRefine(n)){if(a.upsampledFromParent&&c.upsampledFromParent&&u.upsampledFromParent&&f.upsampledFromParent){h5(e,n),B_(e,e._tileLoadQueueMedium,n,t),e._tileReplacementQueue.markTileRendered(a),e._tileReplacementQueue.markTileRendered(c),e._tileReplacementQueue.markTileRendered(u),e._tileReplacementQueue.markTileRendered(f),r.allAreRenderable=n.renderable,r.anyWereRenderedLastFrame=p===pi.RENDERED,r.notYetRenderableCount=n.renderable?0:1,n._lastSelectionResultFrame=t.frameNumber,n._lastSelectionResult=pi.RENDERED,r.anyWereRenderedLastFrame||e._tileToUpdateHeights.push(n);return}n._lastSelectionResultFrame=t.frameNumber,n._lastSelectionResult=pi.REFINED;let y=e._tilesToRender.length,A=e._tileLoadQueueLow.length,b=e._tileLoadQueueMedium.length,x=e._tileLoadQueueHigh.length,T=e._tileToUpdateHeights.length;if(PTt(e,a,c,u,f,t,i,r),y!==e._tilesToRender.length){let E=r.allAreRenderable,v=r.anyWereRenderedLastFrame,S=r.notYetRenderableCount,I=!1;if(!E&&!v){let R=e._tilesToRender;for(let L=y;L<R.length;++L){let _=R[L];for(;_!==void 0&&_._lastSelectionResult!==pi.KICKED&&_!==n;)_._lastSelectionResult=pi.kick(_._lastSelectionResult),_=_.parent}e._tilesToRender.length=y,e._tileToUpdateHeights.length=T,h5(e,n),n._lastSelectionResult=pi.RENDERED;let O=p===pi.RENDERED;!O&&S>e.loadingDescendantLimit&&(e._tileLoadQueueLow.length=A,e._tileLoadQueueMedium.length=b,e._tileLoadQueueHigh.length=x,B_(e,e._tileLoadQueueMedium,n,t),r.notYetRenderableCount=n.renderable?0:1,I=!0),r.allAreRenderable=n.renderable,r.anyWereRenderedLastFrame=O,O||e._tileToUpdateHeights.push(n),++o.tilesWaitingForChildren}e.preloadAncestors&&!I&&B_(e,e._tileLoadQueueLow,n,t)}return}n._lastSelectionResultFrame=t.frameNumber,n._lastSelectionResult=pi.RENDERED,h5(e,n),B_(e,e._tileLoadQueueHigh,n,t),r.allAreRenderable=n.renderable,r.anyWereRenderedLastFrame=p===pi.RENDERED,r.notYetRenderableCount=n.renderable?0:1}function PTt(e,t,n,i,r,o,s,a){let c=o.camera.positionCartographic,u=e._tileProvider,f=e._occluders,d=Nte[t.level],p=d.southwest,g=d.southeast,m=d.northwest,y=d.northeast;c.longitude<t.rectangle.east?c.latitude<t.rectangle.north?(Vc(e,t,u,o,f,s,p),Vc(e,n,u,o,f,s,g),Vc(e,i,u,o,f,s,m),Vc(e,r,u,o,f,s,y)):(Vc(e,i,u,o,f,s,m),Vc(e,t,u,o,f,s,p),Vc(e,r,u,o,f,s,y),Vc(e,n,u,o,f,s,g)):c.latitude<t.rectangle.north?(Vc(e,n,u,o,f,s,g),Vc(e,t,u,o,f,s,p),Vc(e,r,u,o,f,s,y),Vc(e,i,u,o,f,s,m)):(Vc(e,r,u,o,f,s,y),Vc(e,i,u,o,f,s,m),Vc(e,n,u,o,f,s,g),Vc(e,t,u,o,f,s,p)),d.combine(a)}function DTt(e,t){let n=t.rectangle;return l(e._cameraPositionCartographic)&&ie.contains(n,e._cameraPositionCartographic)||l(e._cameraReferenceFrameOriginCartographic)&&ie.contains(n,e._cameraReferenceFrameOriginCartographic)}function Vc(e,t,n,i,r,o,s){if(n.computeTileVisibility(t,i,r)!==Ko.NONE)return ITt(e,i,t,o,s);if(++e._debug.tilesCulled,e._tileReplacementQueue.markTileRendered(t),s.allAreRenderable=!0,s.anyWereRenderedLastFrame=!1,s.notYetRenderableCount=0,DTt(e,t)){(!l(t.data)||!l(t.data.vertexArray))&&B_(e,e._tileLoadQueueMedium,t,i);let a=e._lastSelectionFrameNumber,c=t._lastSelectionResultFrame===a?t._lastSelectionResult:pi.NONE;c!==pi.CULLED_BUT_NEEDED&&c!==pi.RENDERED&&e._tileToUpdateHeights.push(t),t._lastSelectionResult=pi.CULLED_BUT_NEEDED}else e.preloadSiblings||t.level===0?(B_(e,e._tileLoadQueueLow,t,i),t._lastSelectionResult=pi.CULLED):t._lastSelectionResult=pi.CULLED;t._lastSelectionResultFrame=i.frameNumber}function RTt(e,t,n){if(t.mode===re.SCENE2D||t.camera.frustum instanceof gn||t.camera.frustum instanceof ys)return OTt(e,t,n);let i=e._tileProvider.getLevelMaximumGeometricError(n.level),r=n._distance,o=t.context.drawingBufferHeight,s=t.camera.frustum.sseDenominator,a=i*o/(r*s);return t.fog.enabled&&(a-=D.fog(r,t.fog.density)*t.fog.sse),a/=t.pixelRatio,a}function OTt(e,t,n){let r=t.camera.frustum,o=r.offCenterFrustum;l(o)&&(r=o);let s=t.context,a=s.drawingBufferWidth,c=s.drawingBufferHeight,u=e._tileProvider.getLevelMaximumGeometricError(n.level),f=Math.max(r.top-r.bottom,r.right-r.left)/Math.max(a,c),d=u/f;return t.fog.enabled&&t.mode!==re.SCENE2D&&(d-=D.fog(n._distance,t.fog.density)*t.fog.sse),d/=t.pixelRatio,d}function h5(e,t){e._tilesToRender.push(t),e._tilesRenderedThisFrame.add(t)}function MTt(e,t){let n=e._tileLoadQueueHigh,i=e._tileLoadQueueMedium,r=e._tileLoadQueueLow;if(n.length===0&&i.length===0&&r.length===0)return;e._tileReplacementQueue.trimTiles(e.tileCacheSize);let o=xn()+e._loadQueueTimeSlice,s=e._tileProvider,a=Mte(e,t,s,o,n,!1);a=Mte(e,t,s,o,i,a),Mte(e,t,s,o,r,a)}function NTt(e,t){return e._loadPriority-t._loadPriority}function Mte(e,t,n,i,r,o){n.computeTileLoadPriority!==void 0&&r.sort(NTt);for(let s=0,a=r.length;s<a&&(xn()<i||!o);++s){let c=r[s];e._tileReplacementQueue.markTileRendered(c),n.loadTile(t,c),o=!0}return o}var lI=new pn,m5=new he,ib=new h,LTt=[];function FTt(e,t){if(!l(e.tileProvider.tilingScheme))return;let n=LTt;n.length=0;let i=e._tileToUpdateHeights,r=xn(),o=e._updateHeightsTimeSlice,s=r+o,a=t.mode,c=t.mapProjection,u=e.tileProvider.tilingScheme.ellipsoid,f;for(;i.length>0;){let d=i[0];if(!l(d.data)||!l(d.data.mesh)){let A=d._lastSelectionResultFrame===e._lastSelectionFrameNumber?d._lastSelectionResult:pi.NONE;(A===pi.RENDERED||A===pi.CULLED_BUT_NEEDED)&&n.push(d),d.clearPositionCache(),i.shift();continue}let p=d.customData;l(d._customDataIterator)||(d._customDataIterator=p.values());let g=d._customDataIterator,m=!1,y;for(;!(y=g.next()).done;){let A=y.value,b=d.data.terrainData,x=l(b)&&b.wasCreatedByUpsampling();if(d.level>A.level&&!x){let T,E=d.getPositionCacheEntry(A.positionCartographic,e.maximumScreenSpaceError);if(l(E))T=E;else{if(l(A.positionOnEllipsoidSurface)||(A.positionOnEllipsoidSurface=h.fromRadians(A.positionCartographic.longitude,A.positionCartographic.latitude,0,u)),a===re.SCENE3D){let v=u.geodeticSurfaceNormal(A.positionOnEllipsoidSurface,lI.direction),S=u.getSurfaceNormalIntersectionWithZAxis(A.positionOnEllipsoidSurface,11500,lI.origin);if(!l(S)){let I=0;l(d.data.tileBoundingRegion)&&(I=d.data.tileBoundingRegion.minimumHeight);let R=Math.min(I,-11500),O=h.multiplyByScalar(v,Math.abs(R)+1,ib);h.subtract(A.positionOnEllipsoidSurface,O,lI.origin)}}else he.clone(A.positionCartographic,m5),m5.height=-11500,c.project(m5,ib),h.fromElements(ib.z,ib.x,ib.y,ib),h.clone(ib,lI.origin),h.clone(h.UNIT_X,lI.direction);T=d.data.pick(lI,a,c,!1,ib),l(T)&&d.setPositionCacheEntry(A.positionCartographic,e.maximumScreenSpaceError,h.clone(T))}if(l(T)){if(l(A.callback)){let v=u.cartesianToCartographic(T,m5);A.callback(v)}A.level=d.level}}if(xn()>=s){m=!0;break}}if(m){d._customDataIterator=g;break}else d._customDataIterator=void 0,i.shift()}for(f=0;f<n.length;f++)i.push(n[f])}function BTt(e,t){let n=e._tileProvider,i=e._tilesToRender;for(let r=0,o=i.length;r<o;++r){let s=i[r];n.showTileThisFrame(s,t)}}var X3=yh;function Hm(e){e=e??ee.default;let t=new y0({ellipsoid:e}),n=new pE,i=new x_({tilingScheme:t.tilingScheme});this._ellipsoid=e,this._imageryLayerCollection=n,this._surfaceShaderSet=new k3,this._material=void 0,this._surface=new X3({tileProvider:new z3({terrainProvider:t,imageryLayers:n,surfaceShaderSet:this._surfaceShaderSet,vectorProvider:i})}),this._terrainProvider=t,this._terrainProviderChanged=new be,this._vectorProvider=i,this._undergroundColor=z.clone(z.BLACK),this._undergroundColorAlphaByDistance=new qt(e.maximumRadius/1e3,0,e.maximumRadius/5,1),this._translucency=new V3,Fte(this),this.show=!0,this._oceanNormalMapResourceDirty=!0,this._oceanNormalMapResource=new De({url:Zt("Assets/Textures/waterNormalsSmall.jpg")}),this.maximumScreenSpaceError=2,this.tileCacheSize=100,this.loadingDescendantLimit=20,this.preloadAncestors=!0,this.preloadSiblings=!1,this.fillHighlightColor=void 0,this.enableLighting=!1,this.lambertDiffuseMultiplier=.9,this.dynamicAtmosphereLighting=!0,this.dynamicAtmosphereLightingFromSun=!1,this.showGroundAtmosphere=ee.WGS84.equals(e),this.atmosphereLightIntensity=10,this.atmosphereRayleighCoefficient=new h(55e-7,13e-6,284e-7),this.atmosphereMieCoefficient=new h(21e-6,21e-6,21e-6),this.atmosphereRayleighScaleHeight=1e4,this.atmosphereMieScaleHeight=3200,this.atmosphereMieAnisotropy=.9,this.lightingFadeOutDistance=D.PI_OVER_TWO*e.minimumRadius,this.lightingFadeInDistance=D.PI*e.minimumRadius,this.nightFadeOutDistance=D.PI_OVER_TWO*e.minimumRadius,this.nightFadeInDistance=5*D.PI_OVER_TWO*e.minimumRadius,this.showWaterEffect=!0,this.depthTestAgainstTerrain=!1,this.shadows=Pn.RECEIVE_ONLY,this.atmosphereHueShift=0,this.atmosphereSaturationShift=0,this.atmosphereBrightnessShift=0,this.showSkirts=!0,this.backFaceCulling=!0,this._oceanNormalMap=void 0,this._zoomedOutOceanSpecularIntensity=void 0,this.vertexShadowDarkness=.3}Object.defineProperties(Hm.prototype,{ellipsoid:{get:function(){return this._ellipsoid}},imageryLayers:{get:function(){return this._imageryLayerCollection}},imageryLayersUpdatedEvent:{get:function(){return this._surface.tileProvider.imageryLayersUpdatedEvent}},tilesLoaded:{get:function(){return l(this._surface)?this._surface._tileLoadQueueHigh.length===0&&this._surface._tileLoadQueueMedium.length===0&&this._surface._tileLoadQueueLow.length===0:!0}},baseColor:{get:function(){return this._surface.tileProvider.baseColor},set:function(e){this._surface.tileProvider.baseColor=e}},clippingPlanes:{get:function(){return this._surface.tileProvider.clippingPlanes},set:function(e){this._surface.tileProvider.clippingPlanes=e}},clippingPolygons:{get:function(){return this._surface.tileProvider.clippingPolygons},set:function(e){this._surface.tileProvider.clippingPolygons=e}},cartographicLimitRectangle:{get:function(){return this._surface.tileProvider.cartographicLimitRectangle},set:function(e){l(e)||(e=ie.clone(ie.MAX_VALUE)),this._surface.tileProvider.cartographicLimitRectangle=e}},oceanNormalMapUrl:{get:function(){return this._oceanNormalMapResource.url},set:function(e){this._oceanNormalMapResource.url=e,this._oceanNormalMapResourceDirty=!0}},terrainProvider:{get:function(){return this._terrainProvider},set:function(e){e!==this._terrainProvider&&(this._terrainProvider=e,l(e)&&(this._vectorProvider.tilingScheme=e.tilingScheme),this._terrainProviderChanged.raiseEvent(e),l(this._material)&&Fte(this))}},terrainProviderChanged:{get:function(){return this._terrainProviderChanged}},vectorProvider:{get:function(){return this._vectorProvider}},tileLoadProgressEvent:{get:function(){return this._surface.tileLoadProgressEvent}},material:{get:function(){return this._material},set:function(e){this._material!==e&&(this._material=e,Fte(this))}},undergroundColor:{get:function(){return this._undergroundColor},set:function(e){this._undergroundColor=z.clone(e,this._undergroundColor)}},undergroundColorAlphaByDistance:{get:function(){return this._undergroundColorAlphaByDistance},set:function(e){this._undergroundColorAlphaByDistance=qt.clone(e,this._undergroundColorAlphaByDistance)}},translucency:{get:function(){return this._translucency}}});function Fte(e){let t=[],n=l(e._material)&&(l(e._material.shaderSource.match(/slope/))||l(e._material.shaderSource.match("normalEC"))),i=[Yh,Pv];l(e._material)&&(!n||e._terrainProvider.hasVertexNormals)?(i.push(e._material.shaderSource),t.push("APPLY_MATERIAL"),e._surface._tileProvider.materialUniformMap=e._material._uniforms):e._surface._tileProvider.materialUniformMap=void 0,i.push(sM),e._surfaceShaderSet.baseVertexShaderSource=new Ye({sources:[Yh,Pv,aM],defines:t}),e._surfaceShaderSet.baseFragmentShaderSource=new Ye({sources:i,defines:t}),e._surfaceShaderSet.material=e._material}function kTt(e){return function(t,n){let i=ue.distanceSquaredTo(t.pickBoundingSphere,e),r=ue.distanceSquaredTo(n.pickBoundingSphere,e);return i-r}}var UTt=[],zTt={start:0,stop:0};Hm.prototype.pickWorldCoordinates=function(e,t,n,i){n=n??!0;let r=t.mode,o=t.mapProjection,s=UTt;s.length=0;for(let u of this._surface._tilesRenderedThisFrame){let f=u.data;if(!l(f))continue;let d=f.pickBoundingSphere;if(r!==re.SCENE3D)f.pickBoundingSphere=d=ue.fromRectangleWithHeights2D(u.rectangle,o,f.tileBoundingRegion.minimumHeight,f.tileBoundingRegion.maximumHeight,d),h.fromElements(d.center.z,d.center.x,d.center.y,d.center);else if(l(f.renderedMesh))ue.clone(f.tileBoundingRegion.boundingSphere,d);else continue;let p=_i.raySphere(e,d,zTt);l(p)&&s.push(f)}s.sort(kTt(e.origin));let a,c=s.length;for(let u=0;u<c&&(a=s[u].pick(e,t.mode,t.mapProjection,n,i),!l(a));++u);return a};var VTt=new he;Hm.prototype.pick=function(e,t,n){if(n=this.pickWorldCoordinates(e,t,!0,n),l(n)&&t.mode!==re.SCENE3D){n=h.fromElements(n.y,n.z,n.x,n);let i=t.mapProjection.unproject(n,VTt);n=this._ellipsoid.cartographicToCartesian(i,n)}return n};var jTt=new h,pIe=new h,HTt=new he,GTt=new pn;function Lte(e,t){return l(e)&&ie.contains(e.rectangle,t)?e:void 0}Hm.prototype.getHeight=function(e){let t=this._surface._levelZeroTiles;if(!l(t))return;let n,i,r=t.length;for(i=0;i<r&&(n=t[i],!ie.contains(n.rectangle,e));++i);if(i>=r)return;let o=n;for(;l(n);)n=Lte(n._southwestChild,e)||Lte(n._southeastChild,e)||Lte(n._northwestChild,e)||n._northeastChild,l(n)&&l(n.data)&&l(n.data.renderedMesh)&&(o=n);if(n=o,!l(n)||!l(n.data)||!l(n.data.renderedMesh))return;let s=this._surface._tileProvider.tilingScheme.projection,a=this._surface._tileProvider.tilingScheme.ellipsoid,c=h.fromRadians(e.longitude,e.latitude,0,a,jTt),u=GTt,f=a.geodeticSurfaceNormal(c,u.direction),d=a.getSurfaceNormalIntersectionWithZAxis(c,11500,u.origin);if(!l(d)){let g;l(n.data.tileBoundingRegion)&&(g=n.data.tileBoundingRegion.minimumHeight);let m=Math.min(g??0,-11500),y=h.multiplyByScalar(f,Math.abs(m)+1,pIe);h.subtract(c,y,u.origin)}let p=n.data.pick(u,re.SCENE3D,s,!1,pIe);if(l(p))return a.cartesianToCartographic(p,HTt).height};Hm.prototype.update=function(e){this.show&&e.passes.render&&this._surface.update(e)};Hm.prototype.beginFrame=function(e){let t=this._surface,n=t.tileProvider,i=this.terrainProvider,r=l(i)&&i.hasWaterMask&&i.hasWaterMask;if(r&&this._oceanNormalMapResourceDirty){this._oceanNormalMapResourceDirty=!1;let a=this._oceanNormalMapResource,c=a.url;if(l(c)){let u=this;a.fetchImage().then(function(f){c===u._oceanNormalMapResource.url&&(u._oceanNormalMap=u._oceanNormalMap&&u._oceanNormalMap.destroy(),u._oceanNormalMap=new Dt({context:e.context,source:f}))})}else this._oceanNormalMap=this._oceanNormalMap&&this._oceanNormalMap.destroy()}let o=e.passes,s=e.mode;o.render&&(this.showGroundAtmosphere?this._zoomedOutOceanSpecularIntensity=.4:this._zoomedOutOceanSpecularIntensity=.5,t.maximumScreenSpaceError=this.maximumScreenSpaceError,t.tileCacheSize=this.tileCacheSize,t.loadingDescendantLimit=this.loadingDescendantLimit,t.preloadAncestors=this.preloadAncestors,t.preloadSiblings=this.preloadSiblings,n.terrainProvider=this.terrainProvider,n.lightingFadeOutDistance=this.lightingFadeOutDistance,n.lightingFadeInDistance=this.lightingFadeInDistance,n.nightFadeOutDistance=this.nightFadeOutDistance,n.nightFadeInDistance=this.nightFadeInDistance,n.zoomedOutOceanSpecularIntensity=s===re.SCENE3D?this._zoomedOutOceanSpecularIntensity:0,n.hasWaterMask=r,n.showWaterEffect=this.showWaterEffect,n.oceanNormalMap=this._oceanNormalMap,n.enableLighting=this.enableLighting,n.dynamicAtmosphereLighting=this.dynamicAtmosphereLighting,n.dynamicAtmosphereLightingFromSun=this.dynamicAtmosphereLightingFromSun,n.showGroundAtmosphere=this.showGroundAtmosphere,n.atmosphereLightIntensity=this.atmosphereLightIntensity,n.atmosphereRayleighCoefficient=this.atmosphereRayleighCoefficient,n.atmosphereMieCoefficient=this.atmosphereMieCoefficient,n.atmosphereRayleighScaleHeight=this.atmosphereRayleighScaleHeight,n.atmosphereMieScaleHeight=this.atmosphereMieScaleHeight,n.atmosphereMieAnisotropy=this.atmosphereMieAnisotropy,n.shadows=this.shadows,n.hueShift=this.atmosphereHueShift,n.saturationShift=this.atmosphereSaturationShift,n.brightnessShift=this.atmosphereBrightnessShift,n.fillHighlightColor=this.fillHighlightColor,n.showSkirts=this.showSkirts,n.backFaceCulling=this.backFaceCulling,n.vertexShadowDarkness=this.vertexShadowDarkness,n.undergroundColor=this._undergroundColor,n.undergroundColorAlphaByDistance=this._undergroundColorAlphaByDistance,n.lambertDiffuseMultiplier=this.lambertDiffuseMultiplier,t.beginFrame(e))};Hm.prototype.render=function(e){this.show&&(l(this._material)&&this._material.update(e.context),this._surface.render(e))};Hm.prototype.endFrame=function(e){this.show&&e.passes.render&&this._surface.endFrame(e)};Hm.prototype.isDestroyed=function(){return!1};Hm.prototype.destroy=function(){return this._surfaceShaderSet=this._surfaceShaderSet&&this._surfaceShaderSet.destroy(),this._surface=this._surface&&this._surface.destroy(),this._oceanNormalMap=this._oceanNormalMap&&this._oceanNormalMap.destroy(),le(this)};var K3=Hm;function WTt(e,t,n,i){this.rightAscension=e,this.declination=t,this.rotation=n,this.rotationRate=i}var $3=WTt;var PIe={},qTt=32.184,YTt=2451545,gIe=-.0529921,_Ie=-.1059842,yIe=13.0120009,AIe=13.3407154,bIe=.9856003,xIe=26.4057084,TIe=13.064993,EIe=.3287146,CIe=1.7484877,vIe=-.1589763,SIe=.0036096,wIe=.1643573,IIe=12.9590088,Bte=new K;PIe.ComputeMoon=function(e,t){l(e)||(e=K.now()),Bte=K.addSeconds(e,qTt,Bte);let n=K.totalDays(Bte)-YTt,i=n/kn.DAYS_PER_JULIAN_CENTURY,r=(125.045+gIe*n)*D.RADIANS_PER_DEGREE,o=(250.089+_Ie*n)*D.RADIANS_PER_DEGREE,s=(260.008+yIe*n)*D.RADIANS_PER_DEGREE,a=(176.625+AIe*n)*D.RADIANS_PER_DEGREE,c=(357.529+bIe*n)*D.RADIANS_PER_DEGREE,u=(311.589+xIe*n)*D.RADIANS_PER_DEGREE,f=(134.963+TIe*n)*D.RADIANS_PER_DEGREE,d=(276.617+EIe*n)*D.RADIANS_PER_DEGREE,p=(34.226+CIe*n)*D.RADIANS_PER_DEGREE,g=(15.134+vIe*n)*D.RADIANS_PER_DEGREE,m=(119.743+SIe*n)*D.RADIANS_PER_DEGREE,y=(239.961+wIe*n)*D.RADIANS_PER_DEGREE,A=(25.053+IIe*n)*D.RADIANS_PER_DEGREE,b=Math.sin(r),x=Math.sin(o),T=Math.sin(s),E=Math.sin(a),v=Math.sin(c),S=Math.sin(u),I=Math.sin(f),R=Math.sin(d),O=Math.sin(p),L=Math.sin(g),_=Math.sin(m),C=Math.sin(y),w=Math.sin(A),P=Math.cos(r),M=Math.cos(o),F=Math.cos(s),V=Math.cos(a),B=Math.cos(c),j=Math.cos(u),k=Math.cos(f),G=Math.cos(d),q=Math.cos(p),Q=Math.cos(g),W=Math.cos(m),J=Math.cos(y),Z=Math.cos(A),ae=(269.9949+.0031*i-3.8787*b-.1204*x+.07*T-.0172*E+.0072*S-.0052*L+.0043*w)*D.RADIANS_PER_DEGREE,Ae=(66.5392+.013*i+1.5419*P+.0239*M-.0278*F+.0068*V-.0029*j+9e-4*k+8e-4*Q-9e-4*Z)*D.RADIANS_PER_DEGREE,fe=(38.3213+13.17635815*n-14e-13*n*n+3.561*b+.1208*x-.0642*T+.0158*E+.0252*v-.0066*S-.0047*I-.0046*R+.0028*O+.0052*L+.004*_+.0019*C-.0044*w)*D.RADIANS_PER_DEGREE,xe=(13.17635815-14e-13*(2*n)+3.561*P*gIe+.1208*M*_Ie-.0642*F*yIe+.0158*V*AIe+.0252*B*bIe-.0066*j*xIe-.0047*k*TIe-.0046*G*EIe+.0028*q*CIe+.0052*Q*vIe+.004*W*SIe+.0019*J*wIe-.0044*Z*IIe)/86400*D.RADIANS_PER_DEGREE;return l(t)||(t=new $3),t.rightAscension=ae,t.declination=Ae,t.rotation=fe,t.rotationRate=xe,t};var J3=PIe;function DIe(e){(!l(e)||typeof e!="function")&&(e=J3.ComputeMoon),this._computeFunction=e}var XTt=new h,KTt=new h,$Tt=new h;function JTt(e,t,n){let i=XTt;i.x=Math.cos(e+D.PI_OVER_TWO),i.y=Math.sin(e+D.PI_OVER_TWO),i.z=0;let r=Math.cos(t),o=$Tt;o.x=r*Math.cos(e),o.y=r*Math.sin(e),o.z=Math.sin(t);let s=h.cross(o,i,KTt);return l(n)||(n=new $),n[0]=i.x,n[1]=s.x,n[2]=o.x,n[3]=i.y,n[4]=s.y,n[5]=o.y,n[6]=i.z,n[7]=s.z,n[8]=o.z,n}var ZTt=new $,QTt=new Le;DIe.prototype.evaluate=function(e,t){l(e)||(e=K.now());let n=this._computeFunction(e),i=JTt(n.rightAscension,n.declination,t),r=D.zeroToTwoPi(n.rotation),o=Le.fromAxisAngle(h.UNIT_Z,r,QTt),s=$.fromQuaternion(Le.conjugate(o,o),ZTt);return $.multiply(s,i,i)};var Z3=DIe;var kte={position:0};function p5(e){e=e??H.EMPTY_OBJECT,this.center=h.clone(e.center??h.ZERO),this._center=new h,this.radii=h.clone(e.radii),this._radii=new h,this._oneOverEllipsoidRadiiSquared=new h,this._boundingSphere=new ue,this.modelMatrix=N.clone(e.modelMatrix??N.IDENTITY),this._modelMatrix=new N,this._computedModelMatrix=new N,this.show=e.show??!0,this.material=e.material??er.fromType(er.ColorType),this._material=void 0,this._translucent=void 0,this.id=e.id,this._id=void 0,this.debugShowBoundingVolume=e.debugShowBoundingVolume??!1,this.onlySunLighting=e.onlySunLighting??!1,this._onlySunLighting=!1,this._depthTestEnabled=e.depthTestEnabled??!0,this._useLogDepth=!1,this._sp=void 0,this._rs=void 0,this._va=void 0,this._pickSP=void 0,this._pickId=void 0,this._colorCommand=new at({owner:e._owner??this}),this._pickCommand=new at({owner:e._owner??this,pickOnly:!0});let t=this;this._uniforms={u_radii:function(){return t.radii},u_oneOverEllipsoidRadiiSquared:function(){return t._oneOverEllipsoidRadiiSquared}},this._pickUniforms={czm_pickColor:function(){return t._pickId.color}}}function eEt(e){let t=e.cache.ellipsoidPrimitive_vertexArray;if(l(t))return t;let n=Ic.createGeometry(Ic.fromDimensions({dimensions:new h(2,2,2),vertexFormat:Be.POSITION_ONLY}));return t=zn.fromGeometry({context:e,geometry:n,attributeLocations:kte,bufferUsage:Me.STATIC_DRAW,interleave:!0}),e.cache.ellipsoidPrimitive_vertexArray=t,t}p5.prototype.update=function(e){if(!this.show||e.mode!==re.SCENE3D||!l(this.center)||!l(this.radii))return;let t=e.context,n=this.material.isTranslucent(),i=this._translucent!==n;(!l(this._rs)||i)&&(this._translucent=n,this._rs=Ge.fromCache({cull:{enabled:!0,face:zi.FRONT},depthTest:{enabled:this._depthTestEnabled},depthMask:!n&&t.fragmentDepth,blending:n?tn.ALPHA_BLEND:void 0})),l(this._va)||(this._va=eEt(t));let r=!1,o=this.radii;if(!h.equals(this._radii,o)){h.clone(o,this._radii);let y=this._oneOverEllipsoidRadiiSquared;y.x=1/(o.x*o.x),y.y=1/(o.y*o.y),y.z=1/(o.z*o.z),r=!0}(!N.equals(this.modelMatrix,this._modelMatrix)||!h.equals(this.center,this._center))&&(N.clone(this.modelMatrix,this._modelMatrix),h.clone(this.center,this._center),N.multiplyByTranslation(this.modelMatrix,this.center,this._computedModelMatrix),r=!0),r&&(h.clone(h.ZERO,this._boundingSphere.center),this._boundingSphere.radius=h.maximumComponent(o),ue.transform(this._boundingSphere,this._computedModelMatrix,this._boundingSphere));let s=this._material!==this.material;this._material=this.material,this._material.update(t);let a=this.onlySunLighting!==this._onlySunLighting;this._onlySunLighting=this.onlySunLighting;let c=e.useLogDepth,u=this._useLogDepth!==c;this._useLogDepth=c;let f=this._colorCommand,d,p;(s||a||i||u)&&(d=new Ye({sources:[Iv]}),p=new Ye({sources:[this.material.shaderSource,wv]}),this.onlySunLighting&&p.defines.push("ONLY_SUN_LIGHTING"),!n&&t.fragmentDepth&&p.defines.push("WRITE_DEPTH"),this._useLogDepth&&(d.defines.push("LOG_DEPTH"),p.defines.push("LOG_DEPTH")),this._sp=Qt.replaceCache({context:t,shaderProgram:this._sp,vertexShaderSource:d,fragmentShaderSource:p,attributeLocations:kte}),f.vertexArray=this._va,f.renderState=this._rs,f.shaderProgram=this._sp,f.uniformMap=Ot(this._uniforms,this.material._uniforms),f.executeInClosestFrustum=n);let g=e.commandList,m=e.passes;if(m.render&&(f.boundingVolume=this._boundingSphere,f.debugShowBoundingVolume=this.debugShowBoundingVolume,f.modelMatrix=this._computedModelMatrix,f.pass=n?Ie.TRANSLUCENT:Ie.OPAQUE,g.push(f)),m.pick){let y=this._pickCommand;(!l(this._pickId)||this._id!==this.id)&&(this._id=this.id,this._pickId=this._pickId&&this._pickId.destroy(),this._pickId=t.createPickId({primitive:this,id:this.id})),(s||a||!l(this._pickSP)||u)&&(d=new Ye({sources:[Iv]}),p=new Ye({sources:[this.material.shaderSource,wv],pickColorQualifier:"uniform"}),this.onlySunLighting&&p.defines.push("ONLY_SUN_LIGHTING"),!n&&t.fragmentDepth&&p.defines.push("WRITE_DEPTH"),this._useLogDepth&&(d.defines.push("LOG_DEPTH"),p.defines.push("LOG_DEPTH")),this._pickSP=Qt.replaceCache({context:t,shaderProgram:this._pickSP,vertexShaderSource:d,fragmentShaderSource:p,attributeLocations:kte}),y.vertexArray=this._va,y.renderState=this._rs,y.shaderProgram=this._pickSP,y.uniformMap=Ot(Ot(this._uniforms,this._pickUniforms),this.material._uniforms),y.executeInClosestFrustum=n),y.boundingVolume=this._boundingSphere,y.modelMatrix=this._computedModelMatrix,y.pass=n?Ie.TRANSLUCENT:Ie.OPAQUE,g.push(y)}};p5.prototype.isDestroyed=function(){return!1};p5.prototype.destroy=function(){return this._sp=this._sp&&this._sp.destroy(),this._pickSP=this._pickSP&&this._pickSP.destroy(),this._pickId=this._pickId&&this._pickId.destroy(),le(this)};var Q3=p5;function eU(e){e=e??H.EMPTY_OBJECT;let t=e.textureUrl;l(t)||(t=Zt("Assets/Textures/moonSmall.jpg")),this.show=e.show??!0,this.textureUrl=t,this._ellipsoid=e.ellipsoid??ee.MOON,this.onlySunLighting=e.onlySunLighting??!0,this._ellipsoidPrimitive=new Q3({radii:this.ellipsoid.radii,material:er.fromType(er.ImageType),depthTestEnabled:!1,_owner:this}),this._ellipsoidPrimitive.material.translucent=!1,this._axes=new Z3}Object.defineProperties(eU.prototype,{ellipsoid:{get:function(){return this._ellipsoid}}});var g5=new $,tEt=new $,nEt=new h,_5=[];eU.prototype.update=function(e){if(!this.show)return;let t=this._ellipsoidPrimitive;t.material.uniforms.image=this.textureUrl,t.onlySunLighting=this.onlySunLighting;let n=e.time;l(At.computeIcrfToFixedMatrix(n,g5))||At.computeTemeToPseudoFixedMatrix(n,g5);let i=this._axes.evaluate(n,tEt);$.transpose(i,i),$.multiply(g5,i,i);let r=ky.computeMoonPositionInEarthInertialFrame(n,nEt);$.multiplyByVector(g5,r,r),N.fromRotationTranslation(i,r,t.modelMatrix);let o=e.commandList;return e.commandList=_5,_5.length=0,t.update(e),e.commandList=o,_5.length===1?_5[0]:void 0};eU.prototype.isDestroyed=function(){return!1};eU.prototype.destroy=function(){return this._ellipsoidPrimitive=this._ellipsoidPrimitive&&this._ellipsoidPrimitive.destroy(),le(this)};var tU=eU;var Ute=[],zte=[];function iEt(e,t,n,i,r,o){let s=r-i+1,a=o-r,c=Ute,u=zte,f,d;for(f=0;f<s;++f)c[f]=e[i+f];for(d=0;d<a;++d)u[d]=e[r+d+1];f=0,d=0;for(let p=i;p<=o;++p){let g=c[f],m=u[d];f<s&&(d>=a||t(g,m,n)<=0)?(e[p]=g,++f):d<a&&(e[p]=m,++d)}}function Vte(e,t,n,i,r){if(i>=r)return;let o=Math.floor((i+r)*.5);Vte(e,t,n,i,o),Vte(e,t,n,o+1,r),iEt(e,t,n,i,o,r)}function rEt(e,t,n){let i=e.length,r=Math.ceil(i*.5);Ute.length=r,zte.length=r,Vte(e,t,n,0,i-1),Ute.length=0,zte.length=0}var b0=rEt;function bl(e,t){this._occluderPosition=h.clone(e.center),this._occluderRadius=e.radius,this._horizonDistance=0,this._horizonPlaneNormal=void 0,this._horizonPlanePosition=void 0,this._cameraPosition=void 0,this.cameraPosition=t}var y5=new h;Object.defineProperties(bl.prototype,{position:{get:function(){return this._occluderPosition}},radius:{get:function(){return this._occluderRadius}},cameraPosition:{set:function(e){e=h.clone(e,this._cameraPosition);let t=h.subtract(this._occluderPosition,e,y5),n=h.magnitudeSquared(t),i=this._occluderRadius*this._occluderRadius,r,o,s;if(n>i){r=Math.sqrt(n-i),n=1/Math.sqrt(n),o=h.multiplyByScalar(t,n,y5);let a=r*r*n;s=h.add(e,h.multiplyByScalar(o,a,y5),y5)}else r=Number.MAX_VALUE;this._horizonDistance=r,this._horizonPlaneNormal=o,this._horizonPlanePosition=s,this._cameraPosition=e}}});bl.fromBoundingSphere=function(e,t,n){return l(n)?(h.clone(e.center,n._occluderPosition),n._occluderRadius=e.radius,n.cameraPosition=t,n):new bl(e,t)};var OIe=new h;bl.prototype.isPointVisible=function(e){if(this._horizonDistance!==Number.MAX_VALUE){let t=h.subtract(e,this._occluderPosition,OIe),n=this._occluderRadius;if(n=h.magnitudeSquared(t)-n*n,n>0)return n=Math.sqrt(n)+this._horizonDistance,t=h.subtract(e,this._cameraPosition,t),n*n>h.magnitudeSquared(t)}return!1};var oEt=new h;bl.prototype.isBoundingSphereVisible=function(e){let t=h.clone(e.center,oEt),n=e.radius;if(this._horizonDistance!==Number.MAX_VALUE){let i=h.subtract(t,this._occluderPosition,OIe),r=this._occluderRadius-n;if(r=h.magnitudeSquared(i)-r*r,n<this._occluderRadius)return r>0?(r=Math.sqrt(r)+this._horizonDistance,i=h.subtract(t,this._cameraPosition,i),r*r+n*n>h.magnitudeSquared(i)):!1;if(r>0){i=h.subtract(t,this._cameraPosition,i);let o=h.magnitudeSquared(i),s=this._occluderRadius*this._occluderRadius,a=n*n;return(this._horizonDistance*this._horizonDistance+s)*a>o*s?!0:(r=Math.sqrt(r)+this._horizonDistance,r*r+a>o)}return!0}return!1};var sEt=new h;bl.prototype.computeVisibility=function(e){let t=h.clone(e.center),n=e.radius;if(n>this._occluderRadius)return Ko.FULL;if(this._horizonDistance!==Number.MAX_VALUE){let i=h.subtract(t,this._occluderPosition,sEt),r=this._occluderRadius-n,o=h.magnitudeSquared(i);if(r=o-r*r,r>0){r=Math.sqrt(r)+this._horizonDistance,i=h.subtract(t,this._cameraPosition,i);let s=h.magnitudeSquared(i);return r*r+n*n<s?Ko.NONE:(r=this._occluderRadius+n,r=o-r*r,r>0?(r=Math.sqrt(r)+this._horizonDistance,s<r*r+n*n?Ko.FULL:Ko.PARTIAL):(i=h.subtract(t,this._horizonPlanePosition,i),h.dot(i,this._horizonPlaneNormal)>-n?Ko.PARTIAL:Ko.FULL))}}return Ko.NONE};var A5=new h;bl.computeOccludeePoint=function(e,t,n){let i=h.clone(t),r=h.clone(e.center),o=e.radius,s=n.length,a=h.normalize(h.subtract(i,r,A5),A5),c=-h.dot(a,r),u=bl._anyRotationVector(r,a,c),f=bl._horizonToPlaneNormalDotProduct(e,a,c,u,n[0]);if(!f)return;let d;for(let g=1;g<s;++g){if(d=bl._horizonToPlaneNormalDotProduct(e,a,c,u,n[g]),!d)return;d<f&&(f=d)}if(f<.0017453283658983088)return;let p=o/f;return h.add(r,h.multiplyByScalar(a,p,A5),A5)};var aEt=[];bl.computeOccludeePointFromRectangle=function(e,t){t=t??ee.default;let n=ie.subsample(e,t,0,aEt),i=ue.fromPoints(n),r=h.ZERO;if(!h.equals(r,i.center))return bl.computeOccludeePoint(new ue(r,t.minimumRadius),i.center,n)};var cEt=new h;bl._anyRotationVector=function(e,t,n){let i=h.abs(t,cEt),r=i.x>i.y?0:1;(r===0&&i.z>i.x||r===1&&i.z>i.y)&&(r=2);let o=new h,s;r===0?(i.x=e.x,i.y=e.y+1,i.z=e.z+1,s=h.UNIT_X):r===1?(i.x=e.x+1,i.y=e.y,i.z=e.z+1,s=h.UNIT_Y):(i.x=e.x+1,i.y=e.y+1,i.z=e.z,s=h.UNIT_Z);let a=(h.dot(t,i)+n)/-h.dot(t,s);return h.normalize(h.subtract(h.add(i,h.multiplyByScalar(s,a,o),i),e,i),i)};var lEt=new h;bl._rotationVector=function(e,t,n,i,r){let o=h.subtract(i,e,lEt);if(o=h.normalize(o,o),h.dot(t,o)<.9999999847691291){let s=h.cross(t,o,o);if(h.magnitude(s)>D.EPSILON13)return h.normalize(s,new h)}return r};var jte=new h,uEt=new h,b5=new h,RIe=new h;bl._horizonToPlaneNormalDotProduct=function(e,t,n,i,r){let o=h.clone(r,jte),s=h.clone(e.center,uEt),a=e.radius,c=h.subtract(s,o,b5),u=h.magnitudeSquared(c),f=a*a;if(u<f)return!1;let d=u-f,p=Math.sqrt(d),m=1/Math.sqrt(u),A=p*m*p;c=h.normalize(c,c);let b=h.add(o,h.multiplyByScalar(c,A,RIe),RIe),x=Math.sqrt(d-A*A),T=this._rotationVector(s,t,n,o,i),E=h.fromElements(T.x*T.x*c.x+(T.x*T.y-T.z)*c.y+(T.x*T.z+T.y)*c.z,(T.x*T.y+T.z)*c.x+T.y*T.y*c.y+(T.y*T.z-T.x)*c.z,(T.x*T.z-T.y)*c.x+(T.y*T.z+T.x)*c.y+T.z*T.z*c.z,jte);E=h.normalize(E,E);let v=h.multiplyByScalar(E,x,jte);T=h.normalize(h.subtract(h.add(b,v,b5),s,b5),b5);let S=h.dot(t,T);T=h.normalize(h.subtract(h.subtract(b,v,T),s,T),T);let I=h.dot(t,T);return S<I?S:I};var nU=bl;function x0(e){e=e??H.EMPTY_OBJECT,this.left=e.left,this._left=void 0,this.right=e.right,this._right=void 0,this.top=e.top,this._top=void 0,this.bottom=e.bottom,this._bottom=void 0,this.near=e.near??1,this._near=this.near,this.far=e.far??5e8,this._far=this.far,this._cullingVolume=new ta,this._perspectiveMatrix=new N,this._infinitePerspective=new N}function Hte(e){let{top:t,bottom:n,right:i,left:r,near:o,far:s}=e;(t!==e._top||n!==e._bottom||r!==e._left||i!==e._right||o!==e._near||s!==e._far)&&(e._left=r,e._right=i,e._top=t,e._bottom=n,e._near=o,e._far=s,e._perspectiveMatrix=N.computePerspectiveOffCenter(r,i,n,t,o,s,e._perspectiveMatrix),e._infinitePerspective=N.computeInfinitePerspectiveOffCenter(r,i,n,t,o,e._infinitePerspective))}Object.defineProperties(x0.prototype,{projectionMatrix:{get:function(){return Hte(this),this._perspectiveMatrix}},infiniteProjectionMatrix:{get:function(){return Hte(this),this._infinitePerspective}}});var fEt=new h,dEt=new h,hEt=new h,mEt=new h;x0.prototype.computeCullingVolume=function(e,t,n){let i=this._cullingVolume.planes,r=this.top,o=this.bottom,s=this.right,a=this.left,c=this.near,u=this.far,f=h.cross(t,n,fEt),d=dEt;h.multiplyByScalar(t,c,d),h.add(e,d,d);let p=hEt;h.multiplyByScalar(t,u,p),h.add(e,p,p);let g=mEt;h.multiplyByScalar(f,a,g),h.add(d,g,g),h.subtract(g,e,g),h.normalize(g,g),h.cross(g,n,g),h.normalize(g,g);let m=i[0];return l(m)||(m=i[0]=new se),m.x=g.x,m.y=g.y,m.z=g.z,m.w=-h.dot(g,e),h.multiplyByScalar(f,s,g),h.add(d,g,g),h.subtract(g,e,g),h.cross(n,g,g),h.normalize(g,g),m=i[1],l(m)||(m=i[1]=new se),m.x=g.x,m.y=g.y,m.z=g.z,m.w=-h.dot(g,e),h.multiplyByScalar(n,o,g),h.add(d,g,g),h.subtract(g,e,g),h.cross(f,g,g),h.normalize(g,g),m=i[2],l(m)||(m=i[2]=new se),m.x=g.x,m.y=g.y,m.z=g.z,m.w=-h.dot(g,e),h.multiplyByScalar(n,r,g),h.add(d,g,g),h.subtract(g,e,g),h.cross(g,f,g),h.normalize(g,g),m=i[3],l(m)||(m=i[3]=new se),m.x=g.x,m.y=g.y,m.z=g.z,m.w=-h.dot(g,e),m=i[4],l(m)||(m=i[4]=new se),m.x=t.x,m.y=t.y,m.z=t.z,m.w=-h.dot(t,d),h.negate(t,g),m=i[5],l(m)||(m=i[5]=new se),m.x=g.x,m.y=g.y,m.z=g.z,m.w=-h.dot(g,p),this._cullingVolume};x0.prototype.getPixelDimensions=function(e,t,n,i,r){Hte(this);let o=1/this.near,s=this.top*o,a=2*i*n*s/t;s=this.right*o;let c=2*i*n*s/e;return r.x=c,r.y=a,r};x0.prototype.clone=function(e){return l(e)||(e=new x0),e.right=this.right,e.left=this.left,e.top=this.top,e.bottom=this.bottom,e.near=this.near,e.far=this.far,e._left=void 0,e._right=void 0,e._top=void 0,e._bottom=void 0,e._near=void 0,e._far=void 0,e};x0.prototype.equals=function(e){return l(e)&&e instanceof x0&&this.right===e.right&&this.left===e.left&&this.top===e.top&&this.bottom===e.bottom&&this.near===e.near&&this.far===e.far};x0.prototype.equalsEpsilon=function(e,t,n){return e===this||l(e)&&e instanceof x0&&D.equalsEpsilon(this.right,e.right,t,n)&&D.equalsEpsilon(this.left,e.left,t,n)&&D.equalsEpsilon(this.top,e.top,t,n)&&D.equalsEpsilon(this.bottom,e.bottom,t,n)&&D.equalsEpsilon(this.near,e.near,t,n)&&D.equalsEpsilon(this.far,e.far,t,n)};var mu=x0;function of(e){e=e??H.EMPTY_OBJECT,this._offCenterFrustum=new mu,this.fov=e.fov,this._fov=void 0,this._fovy=void 0,this._sseDenominator=void 0,this.aspectRatio=e.aspectRatio,this._aspectRatio=void 0,this.near=e.near??1,this._near=this.near,this.far=e.far??5e8,this._far=this.far,this.xOffset=e.xOffset??0,this._xOffset=this.xOffset,this.yOffset=e.yOffset??0,this._yOffset=this.yOffset}of.packedLength=6;of.pack=function(e,t,n){return n=n??0,t[n++]=e.fov,t[n++]=e.aspectRatio,t[n++]=e.near,t[n++]=e.far,t[n++]=e.xOffset,t[n]=e.yOffset,t};of.unpack=function(e,t,n){return t=t??0,l(n)||(n=new of),n.fov=e[t++],n.aspectRatio=e[t++],n.near=e[t++],n.far=e[t++],n.xOffset=e[t++],n.yOffset=e[t],n};function Gm(e){if(!(e.fov!==e._fov||e.aspectRatio!==e._aspectRatio||e.near!==e._near||e.far!==e._far||e.xOffset!==e._xOffset||e.yOffset!==e._yOffset))return;e._aspectRatio=e.aspectRatio,e._fov=e.fov,e._fovy=e.aspectRatio<=1?e.fov:Math.atan(Math.tan(e.fov*.5)/e.aspectRatio)*2,e._near=e.near,e._far=e.far,e._sseDenominator=2*Math.tan(.5*e._fovy),e._xOffset=e.xOffset,e._yOffset=e.yOffset;let n=e._offCenterFrustum;n.top=e.near*Math.tan(.5*e._fovy),n.bottom=-n.top,n.right=e.aspectRatio*n.top,n.left=-n.right,n.near=e.near,n.far=e.far,n.right+=e.xOffset,n.left+=e.xOffset,n.top+=e.yOffset,n.bottom+=e.yOffset}Object.defineProperties(of.prototype,{projectionMatrix:{get:function(){return Gm(this),this._offCenterFrustum.projectionMatrix}},infiniteProjectionMatrix:{get:function(){return Gm(this),this._offCenterFrustum.infiniteProjectionMatrix}},fovy:{get:function(){return Gm(this),this._fovy}},sseDenominator:{get:function(){return Gm(this),this._sseDenominator}},offCenterFrustum:{get:function(){return Gm(this),this._offCenterFrustum}}});of.prototype.computeCullingVolume=function(e,t,n){return Gm(this),this._offCenterFrustum.computeCullingVolume(e,t,n)};of.prototype.getPixelDimensions=function(e,t,n,i,r){return Gm(this),this._offCenterFrustum.getPixelDimensions(e,t,n,i,r)};of.prototype.clone=function(e){return l(e)||(e=new of),e.aspectRatio=this.aspectRatio,e.fov=this.fov,e.near=this.near,e.far=this.far,e._aspectRatio=void 0,e._fov=void 0,e._near=void 0,e._far=void 0,this._offCenterFrustum.clone(e._offCenterFrustum),e};of.prototype.equals=function(e){return!l(e)||!(e instanceof of)?!1:(Gm(this),Gm(e),this.fov===e.fov&&this.aspectRatio===e.aspectRatio&&this._offCenterFrustum.equals(e._offCenterFrustum))};of.prototype.equalsEpsilon=function(e,t,n){return!l(e)||!(e instanceof of)?!1:(Gm(this),Gm(e),D.equalsEpsilon(this.fov,e.fov,t,n)&&D.equalsEpsilon(this.aspectRatio,e.aspectRatio,t,n)&&this._offCenterFrustum.equalsEpsilon(e._offCenterFrustum,t,n))};var $i=of;function iU(){this._colorTexture=void 0,this._drawCommand=void 0}Object.defineProperties(iU.prototype,{colorTexture:{get:function(){return this._colorTexture}}});function pEt(e,t,n){let i=t.createViewportQuadCommand(UO,{framebuffer:n,renderState:Ge.fromCache({viewport:new et(0,0,256,256)})});e._drawCommand=i}iU.prototype.update=function(e){if(!l(this._colorTexture)){let t=e.context,n=new Dt({context:t,width:256,height:256,pixelFormat:Ke.RGBA,pixelDatatype:ze.UNSIGNED_BYTE,sampler:jt.NEAREST});this._colorTexture=n;let i=new _s({context:t,colorTextures:[n],destroyAttachments:!1});pEt(this,t,i),this._drawCommand.execute(t),i.destroy(),this._drawCommand.shaderProgram=this._drawCommand.shaderProgram&&this._drawCommand.shaderProgram.destroy()}};iU.prototype.isDestroyed=function(){return!1};iU.prototype.destroy=function(){return this._colorTexture=this._colorTexture&&this._colorTexture.destroy(),le(this)};var rU=iU;var or=Object.freeze({Linear:Object.freeze({None:function(e){return e},In:function(e){return e},Out:function(e){return e},InOut:function(e){return e}}),Quadratic:Object.freeze({In:function(e){return e*e},Out:function(e){return e*(2-e)},InOut:function(e){return(e*=2)<1?.5*e*e:-.5*(--e*(e-2)-1)}}),Cubic:Object.freeze({In:function(e){return e*e*e},Out:function(e){return--e*e*e+1},InOut:function(e){return(e*=2)<1?.5*e*e*e:.5*((e-=2)*e*e+2)}}),Quartic:Object.freeze({In:function(e){return e*e*e*e},Out:function(e){return 1- --e*e*e*e},InOut:function(e){return(e*=2)<1?.5*e*e*e*e:-.5*((e-=2)*e*e*e-2)}}),Quintic:Object.freeze({In:function(e){return e*e*e*e*e},Out:function(e){return--e*e*e*e*e+1},InOut:function(e){return(e*=2)<1?.5*e*e*e*e*e:.5*((e-=2)*e*e*e*e+2)}}),Sinusoidal:Object.freeze({In:function(e){return 1-Math.sin((1-e)*Math.PI/2)},Out:function(e){return Math.sin(e*Math.PI/2)},InOut:function(e){return .5*(1-Math.sin(Math.PI*(.5-e)))}}),Exponential:Object.freeze({In:function(e){return e===0?0:Math.pow(1024,e-1)},Out:function(e){return e===1?1:1-Math.pow(2,-10*e)},InOut:function(e){return e===0?0:e===1?1:(e*=2)<1?.5*Math.pow(1024,e-1):.5*(-Math.pow(2,-10*(e-1))+2)}}),Circular:Object.freeze({In:function(e){return 1-Math.sqrt(1-e*e)},Out:function(e){return Math.sqrt(1- --e*e)},InOut:function(e){return(e*=2)<1?-.5*(Math.sqrt(1-e*e)-1):.5*(Math.sqrt(1-(e-=2)*e)+1)}}),Elastic:Object.freeze({In:function(e){return e===0?0:e===1?1:-Math.pow(2,10*(e-1))*Math.sin((e-1.1)*5*Math.PI)},Out:function(e){return e===0?0:e===1?1:Math.pow(2,-10*e)*Math.sin((e-.1)*5*Math.PI)+1},InOut:function(e){return e===0?0:e===1?1:(e*=2,e<1?-.5*Math.pow(2,10*(e-1))*Math.sin((e-1.1)*5*Math.PI):.5*Math.pow(2,-10*(e-1))*Math.sin((e-1.1)*5*Math.PI)+1)}}),Back:Object.freeze({In:function(e){var t=1.70158;return e===1?1:e*e*((t+1)*e-t)},Out:function(e){var t=1.70158;return e===0?0:--e*e*((t+1)*e+t)+1},InOut:function(e){var t=2.5949095;return(e*=2)<1?.5*(e*e*((t+1)*e-t)):.5*((e-=2)*e*((t+1)*e+t)+2)}}),Bounce:Object.freeze({In:function(e){return 1-or.Bounce.Out(1-e)},Out:function(e){return e<.36363636363636365?7.5625*e*e:e<.7272727272727273?7.5625*(e-=.5454545454545454)*e+.75:e<.9090909090909091?7.5625*(e-=.8181818181818182)*e+.9375:7.5625*(e-=.9545454545454546)*e+.984375},InOut:function(e){return e<.5?or.Bounce.In(e*2)*.5:or.Bounce.Out(e*2-1)*.5+.5}}),generatePow:function(e){return e===void 0&&(e=4),e=e<Number.EPSILON?Number.EPSILON:e,e=e>1e4?1e4:e,{In:function(t){return Math.pow(t,e)},Out:function(t){return 1-Math.pow(1-t,e)},InOut:function(t){return t<.5?Math.pow(t*2,e)/2:(1-Math.pow(2-t*2,e))/2+.5}}}}),oU=function(){return performance.now()},gEt=(function(){function e(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];this._tweens={},this._tweensAddedDuringUpdate={},this.add.apply(this,t)}return e.prototype.getAll=function(){var t=this;return Object.keys(this._tweens).map(function(n){return t._tweens[n]})},e.prototype.removeAll=function(){this._tweens={}},e.prototype.add=function(){for(var t,n=[],i=0;i<arguments.length;i++)n[i]=arguments[i];for(var r=0,o=n;r<o.length;r++){var s=o[r];(t=s._group)===null||t===void 0||t.remove(s),s._group=this,this._tweens[s.getId()]=s,this._tweensAddedDuringUpdate[s.getId()]=s}},e.prototype.remove=function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];for(var i=0,r=t;i<r.length;i++){var o=r[i];o._group=void 0,delete this._tweens[o.getId()],delete this._tweensAddedDuringUpdate[o.getId()]}},e.prototype.allStopped=function(){return this.getAll().every(function(t){return!t.isPlaying()})},e.prototype.update=function(t,n){t===void 0&&(t=oU()),n===void 0&&(n=!0);var i=Object.keys(this._tweens);if(i.length!==0)for(;i.length>0;){this._tweensAddedDuringUpdate={};for(var r=0;r<i.length;r++){var o=this._tweens[i[r]],s=!n;o&&o.update(t,s)===!1&&!n&&this.remove(o)}i=Object.keys(this._tweensAddedDuringUpdate)}},e})(),uI={Linear:function(e,t){var n=e.length-1,i=n*t,r=Math.floor(i),o=uI.Utils.Linear;return t<0?o(e[0],e[1],i):t>1?o(e[n],e[n-1],n-i):o(e[r],e[r+1>n?n:r+1],i-r)},Bezier:function(e,t){for(var n=0,i=e.length-1,r=Math.pow,o=uI.Utils.Bernstein,s=0;s<=i;s++)n+=r(1-t,i-s)*r(t,s)*e[s]*o(i,s);return n},CatmullRom:function(e,t){var n=e.length-1,i=n*t,r=Math.floor(i),o=uI.Utils.CatmullRom;return e[0]===e[n]?(t<0&&(r=Math.floor(i=n*(1+t))),o(e[(r-1+n)%n],e[r],e[(r+1)%n],e[(r+2)%n],i-r)):t<0?e[0]-(o(e[0],e[0],e[1],e[1],-i)-e[0]):t>1?e[n]-(o(e[n],e[n],e[n-1],e[n-1],i-n)-e[n]):o(e[r?r-1:0],e[r],e[n<r+1?n:r+1],e[n<r+2?n:r+2],i-r)},Utils:{Linear:function(e,t,n){return(t-e)*n+e},Bernstein:function(e,t){var n=uI.Utils.Factorial;return n(e)/n(t)/n(e-t)},Factorial:(function(){var e=[1];return function(t){var n=1;if(e[t])return e[t];for(var i=t;i>1;i--)n*=i;return e[t]=n,n}})(),CatmullRom:function(e,t,n,i,r){var o=(n-e)*.5,s=(i-t)*.5,a=r*r,c=r*a;return(2*t-2*n+o+s)*c+(-3*t+3*n-2*o-s)*a+o*r+t}}},MIe=(function(){function e(){}return e.nextId=function(){return e._nextId++},e._nextId=0,e})(),Gte=new gEt,NIe=(function(){function e(t,n){this._isPaused=!1,this._pauseStart=0,this._valuesStart={},this._valuesEnd={},this._valuesStartRepeat={},this._duration=1e3,this._isDynamic=!1,this._initialRepeat=0,this._repeat=0,this._yoyo=!1,this._isPlaying=!1,this._reversed=!1,this._delayTime=0,this._startTime=0,this._easingFunction=or.Linear.None,this._interpolationFunction=uI.Linear,this._chainedTweens=[],this._onStartCallbackFired=!1,this._onEveryStartCallbackFired=!1,this._id=MIe.nextId(),this._isChainStopped=!1,this._propertiesAreSetUp=!1,this._goToEnd=!1,this._object=t,typeof n=="object"?(this._group=n,n.add(this)):n===!0&&(this._group=Gte,Gte.add(this))}return e.prototype.getId=function(){return this._id},e.prototype.isPlaying=function(){return this._isPlaying},e.prototype.isPaused=function(){return this._isPaused},e.prototype.getDuration=function(){return this._duration},e.prototype.to=function(t,n){if(n===void 0&&(n=1e3),this._isPlaying)throw new Error("Can not call Tween.to() while Tween is already started or paused. Stop the Tween first.");return this._valuesEnd=t,this._propertiesAreSetUp=!1,this._duration=n<0?0:n,this},e.prototype.duration=function(t){return t===void 0&&(t=1e3),this._duration=t<0?0:t,this},e.prototype.dynamic=function(t){return t===void 0&&(t=!1),this._isDynamic=t,this},e.prototype.start=function(t,n){if(t===void 0&&(t=oU()),n===void 0&&(n=!1),this._isPlaying)return this;if(this._repeat=this._initialRepeat,this._reversed){this._reversed=!1;for(var i in this._valuesStartRepeat)this._swapEndStartRepeatValues(i),this._valuesStart[i]=this._valuesStartRepeat[i]}if(this._isPlaying=!0,this._isPaused=!1,this._onStartCallbackFired=!1,this._onEveryStartCallbackFired=!1,this._isChainStopped=!1,this._startTime=t,this._startTime+=this._delayTime,!this._propertiesAreSetUp||n){if(this._propertiesAreSetUp=!0,!this._isDynamic){var r={};for(var o in this._valuesEnd)r[o]=this._valuesEnd[o];this._valuesEnd=r}this._setupProperties(this._object,this._valuesStart,this._valuesEnd,this._valuesStartRepeat,n)}return this},e.prototype.startFromCurrentValues=function(t){return this.start(t,!0)},e.prototype._setupProperties=function(t,n,i,r,o){for(var s in i){var a=t[s],c=Array.isArray(a),u=c?"array":typeof a,f=!c&&Array.isArray(i[s]);if(!(u==="undefined"||u==="function")){if(f){var d=i[s];if(d.length===0)continue;for(var p=[a],g=0,m=d.length;g<m;g+=1){var y=this._handleRelativeValue(a,d[g]);if(isNaN(y)){f=!1,console.warn("Found invalid interpolation list. Skipping.");break}p.push(y)}f&&(i[s]=p)}if((u==="object"||c)&&a&&!f){n[s]=c?[]:{};var A=a;for(var b in A)n[s][b]=A[b];r[s]=c?[]:{};var d=i[s];if(!this._isDynamic){var x={};for(var b in d)x[b]=d[b];i[s]=d=x}this._setupProperties(A,n[s],d,r[s],o)}else(typeof n[s]>"u"||o)&&(n[s]=a),c||(n[s]*=1),f?r[s]=i[s].slice().reverse():r[s]=n[s]||0}}},e.prototype.stop=function(){return this._isChainStopped||(this._isChainStopped=!0,this.stopChainedTweens()),this._isPlaying?(this._isPlaying=!1,this._isPaused=!1,this._onStopCallback&&this._onStopCallback(this._object),this):this},e.prototype.end=function(){return this._goToEnd=!0,this.update(this._startTime+this._duration),this},e.prototype.pause=function(t){return t===void 0&&(t=oU()),this._isPaused||!this._isPlaying?this:(this._isPaused=!0,this._pauseStart=t,this)},e.prototype.resume=function(t){return t===void 0&&(t=oU()),!this._isPaused||!this._isPlaying?this:(this._isPaused=!1,this._startTime+=t-this._pauseStart,this._pauseStart=0,this)},e.prototype.stopChainedTweens=function(){for(var t=0,n=this._chainedTweens.length;t<n;t++)this._chainedTweens[t].stop();return this},e.prototype.group=function(t){return t?(t.add(this),this):(console.warn("tween.group() without args has been removed, use group.add(tween) instead."),this)},e.prototype.remove=function(){var t;return(t=this._group)===null||t===void 0||t.remove(this),this},e.prototype.delay=function(t){return t===void 0&&(t=0),this._delayTime=t,this},e.prototype.repeat=function(t){return t===void 0&&(t=0),this._initialRepeat=t,this._repeat=t,this},e.prototype.repeatDelay=function(t){return this._repeatDelayTime=t,this},e.prototype.yoyo=function(t){return t===void 0&&(t=!1),this._yoyo=t,this},e.prototype.easing=function(t){return t===void 0&&(t=or.Linear.None),this._easingFunction=t,this},e.prototype.interpolation=function(t){return t===void 0&&(t=uI.Linear),this._interpolationFunction=t,this},e.prototype.chain=function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];return this._chainedTweens=t,this},e.prototype.onStart=function(t){return this._onStartCallback=t,this},e.prototype.onEveryStart=function(t){return this._onEveryStartCallback=t,this},e.prototype.onUpdate=function(t){return this._onUpdateCallback=t,this},e.prototype.onRepeat=function(t){return this._onRepeatCallback=t,this},e.prototype.onComplete=function(t){return this._onCompleteCallback=t,this},e.prototype.onStop=function(t){return this._onStopCallback=t,this},e.prototype.update=function(t,n){var i=this,r;if(t===void 0&&(t=oU()),n===void 0&&(n=e.autoStartOnUpdate),this._isPaused)return!0;var o;if(!this._goToEnd&&!this._isPlaying)if(n)this.start(t,!0);else return!1;if(this._goToEnd=!1,t<this._startTime)return!0;this._onStartCallbackFired===!1&&(this._onStartCallback&&this._onStartCallback(this._object),this._onStartCallbackFired=!0),this._onEveryStartCallbackFired===!1&&(this._onEveryStartCallback&&this._onEveryStartCallback(this._object),this._onEveryStartCallbackFired=!0);var s=t-this._startTime,a=this._duration+((r=this._repeatDelayTime)!==null&&r!==void 0?r:this._delayTime),c=this._duration+this._repeat*a,u=function(){if(i._duration===0||s>c)return 1;var y=Math.trunc(s/a),A=s-y*a,b=Math.min(A/i._duration,1);return b===0&&s===i._duration?1:b},f=u(),d=this._easingFunction(f);if(this._updateProperties(this._object,this._valuesStart,this._valuesEnd,d),this._onUpdateCallback&&this._onUpdateCallback(this._object,f),this._duration===0||s>=this._duration)if(this._repeat>0){var p=Math.min(Math.trunc((s-this._duration)/a)+1,this._repeat);isFinite(this._repeat)&&(this._repeat-=p);for(o in this._valuesStartRepeat)!this._yoyo&&typeof this._valuesEnd[o]=="string"&&(this._valuesStartRepeat[o]=this._valuesStartRepeat[o]+parseFloat(this._valuesEnd[o])),this._yoyo&&this._swapEndStartRepeatValues(o),this._valuesStart[o]=this._valuesStartRepeat[o];return this._yoyo&&(this._reversed=!this._reversed),this._startTime+=a*p,this._onRepeatCallback&&this._onRepeatCallback(this._object),this._onEveryStartCallbackFired=!1,!0}else{this._onCompleteCallback&&this._onCompleteCallback(this._object);for(var g=0,m=this._chainedTweens.length;g<m;g++)this._chainedTweens[g].start(this._startTime+this._duration,!1);return this._isPlaying=!1,!1}return!0},e.prototype._updateProperties=function(t,n,i,r){for(var o in i)if(n[o]!==void 0){var s=n[o]||0,a=i[o],c=Array.isArray(t[o]),u=Array.isArray(a),f=!c&&u;f?t[o]=this._interpolationFunction(a,r):typeof a=="object"&&a?this._updateProperties(t[o],s,a,r):(a=this._handleRelativeValue(s,a),typeof a=="number"&&(t[o]=s+(a-s)*r))}},e.prototype._handleRelativeValue=function(t,n){return typeof n!="string"?n:n.charAt(0)==="+"||n.charAt(0)==="-"?t+parseFloat(n):parseFloat(n)},e.prototype._swapEndStartRepeatValues=function(t){var n=this._valuesStartRepeat[t],i=this._valuesEnd[t];typeof i=="string"?this._valuesStartRepeat[t]=this._valuesStartRepeat[t]+parseFloat(i):this._valuesStartRepeat[t]=this._valuesEnd[t],this._valuesEnd[t]=n},e.autoStartOnUpdate=!1,e})();var x2i=MIe.nextId,T0=Gte,T2i=T0.getAll.bind(T0),E2i=T0.removeAll.bind(T0),C2i=T0.add.bind(T0),v2i=T0.remove.bind(T0),S2i=T0.update.bind(T0);var _Et={LINEAR_NONE:or.Linear.None,QUADRATIC_IN:or.Quadratic.In,QUADRATIC_OUT:or.Quadratic.Out,QUADRATIC_IN_OUT:or.Quadratic.InOut,CUBIC_IN:or.Cubic.In,CUBIC_OUT:or.Cubic.Out,CUBIC_IN_OUT:or.Cubic.InOut,QUARTIC_IN:or.Quartic.In,QUARTIC_OUT:or.Quartic.Out,QUARTIC_IN_OUT:or.Quartic.InOut,QUINTIC_IN:or.Quintic.In,QUINTIC_OUT:or.Quintic.Out,QUINTIC_IN_OUT:or.Quintic.InOut,SINUSOIDAL_IN:or.Sinusoidal.In,SINUSOIDAL_OUT:or.Sinusoidal.Out,SINUSOIDAL_IN_OUT:or.Sinusoidal.InOut,EXPONENTIAL_IN:or.Exponential.In,EXPONENTIAL_OUT:or.Exponential.Out,EXPONENTIAL_IN_OUT:or.Exponential.InOut,CIRCULAR_IN:or.Circular.In,CIRCULAR_OUT:or.Circular.Out,CIRCULAR_IN_OUT:or.Circular.InOut,ELASTIC_IN:or.Elastic.In,ELASTIC_OUT:or.Elastic.Out,ELASTIC_IN_OUT:or.Elastic.InOut,BACK_IN:or.Back.In,BACK_OUT:or.Back.Out,BACK_IN_OUT:or.Back.InOut,BOUNCE_IN:or.Bounce.In,BOUNCE_OUT:or.Bounce.Out,BOUNCE_IN_OUT:or.Bounce.InOut},Rs=Object.freeze(_Et);var kIe={};function yEt(e,t,n){let i,r,o;if(e instanceof $i){let s=Math.tan(.5*e.fovy);return i=e.near,r=e.near*s,o=e.aspectRatio*r,Math.max(t*i/o,n*i/r)}else if(e instanceof mu)return i=e.near,r=e.top,o=e.right,Math.max(t*i/o,n*i/r);return Math.max(t,n)}var AEt=new h,LIe=new h;function UIe(e,t,n,i){if(l(i)&&n(.5)>i){let r=n(0),o=n(1),s=n(.5),a=s-r,c=s-o;return function(u){let f=n(u);if(u<=.5){let p=(f-r)/a;return D.lerp(e,-D.PI_OVER_TWO,p)}let d=(f-o)/c;return D.lerp(-D.PI_OVER_TWO,t,1-d)}}return function(r){return D.lerp(e,t,r)}}function qte(e,t,n,i,r){let o=r,s=Math.max(n,i);if(!l(o)){let a=e.position,c=t,u=e.up,f=e.right,d=e.frustum,p=h.subtract(a,c,AEt),g=h.magnitude(h.multiplyByScalar(u,h.dot(p,u),LIe)),m=h.magnitude(h.multiplyByScalar(f,h.dot(p,f),LIe));o=Math.min(yEt(d,g,m)*.2,1e9)}if(s<o){let u=-Math.pow((o-n)*1e6,.125),f=Math.pow((o-i)*1e6,1/8);return function(d){let p=d*(f-u)+u;return-Math.pow(p,8)/1e6+o}}return function(a){return D.lerp(n,i,a)}}function sU(e,t){return D.equalsEpsilon(e,D.TWO_PI,D.EPSILON11)&&(e=0),t>e+Math.PI?e+=D.TWO_PI:t<e-Math.PI&&(e-=D.TWO_PI),e}var zIe=new h;function bEt(e,t,n,i,r,o,s,a){let c=e.camera,u=h.clone(c.position,zIe),f=c.pitch,d=sU(c.heading,i),p=sU(c.roll,o),g=qte(c,n,u.z,n.z,s),m=UIe(f,r,g,a);function y(A){let b=A.time/t;c.setView({orientation:{heading:D.lerp(d,i,b),pitch:m(b),roll:D.lerp(p,o,b)}}),U.lerp(u,n,b,c.position),c.position.z=g(b)}return y}function xEt(e,t){e.longitude<t.longitude?e.longitude+=D.TWO_PI:t.longitude+=D.TWO_PI}function TEt(e,t){let n=e.longitude-t.longitude;n<-D.PI?e.longitude+=D.TWO_PI:n>D.PI&&(t.longitude+=D.TWO_PI)}var EEt=new he,CEt=new he;function vEt(e,t,n,i,r,o,s,a,c,u){let f=e.camera,p=e.mapProjection.ellipsoid,g=he.clone(f.positionCartographic,EEt),m=f.pitch,y=sU(f.heading,i),A=sU(f.roll,o),b=p.cartesianToCartographic(n,CEt);g.longitude=D.zeroToTwoPi(g.longitude),b.longitude=D.zeroToTwoPi(b.longitude);let x=!1;if(l(a)){let S=D.zeroToTwoPi(a),I=Math.min(g.longitude,b.longitude),R=Math.max(g.longitude,b.longitude),O=S>=I&&S<=R;if(l(c)){let L=Math.abs(g.longitude-b.longitude),_=D.TWO_PI-L;(O?L:_)<(O?_:L)*c&&!O&&(x=!0)}else O||(x=!0)}x?xEt(g,b):TEt(g,b);let T=qte(f,n,g.height,b.height,s),E=UIe(m,r,T,u);function v(){let S=g.longitude,I=b.longitude,R=g.latitude,O=b.latitude;return function(_){let C=_.time/t,w=h.fromRadians(D.lerp(S,I,C),D.lerp(R,O,C),T(C),p);f.setView({destination:w,orientation:{heading:D.lerp(y,i,C),pitch:E(C),roll:D.lerp(A,o,C)}})}}return v()}function SEt(e,t,n,i,r,o,s){let a=e.camera,c=h.clone(a.position,zIe),u=sU(a.heading,i),f=a.frustum.right-a.frustum.left,d=qte(a,n,f,n.z,s);function p(g){let m=g.time/t;a.setView({orientation:{heading:D.lerp(u,i,m)}}),U.lerp(c,n,m,a.position);let y=d(m),A=a.frustum,b=A.top/A.right,x=(y-(A.right-A.left))*.5;A.right+=x,A.left-=x,A.top=b*A.right,A.bottom=-A.top}return p}var FIe=new he,wEt=new h;function Wte(e,t){return{startObject:{},stopObject:{},duration:0,complete:e,cancel:t}}function BIe(e,t){function n(){typeof t=="function"&&t(),e.enableInputs=!0}return n}kIe.createTween=function(e,t){t=t??H.EMPTY_OBJECT;let n=t.destination,i=e.mode;if(i===re.MORPHING)return Wte();let r=t.convert??!0,o=e.mapProjection,s=o.ellipsoid,a=t.maximumHeight,c=t.flyOverLongitude,u=t.flyOverLongitudeWeight,f=t.pitchAdjustHeight,d=t.easingFunction;r&&i!==re.SCENE3D&&(s.cartesianToCartographic(n,FIe),n=o.project(FIe,wEt));let p=e.camera,g=t.endTransform;l(g)&&p._setTransform(g);let m=t.duration;l(m)||(m=Math.ceil(h.distance(p.position,n)/1e6)+2,m=Math.min(m,3));let y=t.heading??0,A=t.pitch??-D.PI_OVER_TWO,b=t.roll??0,x=e.screenSpaceCameraController;x.enableInputs=!1;let T=BIe(x,t.complete),E=BIe(x,t.cancel),v=p.frustum,S=e.mode===re.SCENE2D;if(S=S&&U.equalsEpsilon(p.position,n,D.EPSILON6),S=S&&D.equalsEpsilon(Math.max(v.right-v.left,v.top-v.bottom),n.z,D.EPSILON6),S=S||e.mode!==re.SCENE2D&&h.equalsEpsilon(n,p.position,D.EPSILON10),S=S&&D.equalsEpsilon(D.negativePiToPi(y),D.negativePiToPi(p.heading),D.EPSILON10)&&D.equalsEpsilon(D.negativePiToPi(A),D.negativePiToPi(p.pitch),D.EPSILON10)&&D.equalsEpsilon(D.negativePiToPi(b),D.negativePiToPi(p.roll),D.EPSILON10),S)return Wte(T,E);let I=new Array(4);if(I[re.SCENE2D]=SEt,I[re.SCENE3D]=vEt,I[re.COLUMBUS_VIEW]=bEt,m<=0)return Wte(function(){I[i](e,1,n,y,A,b,a,c,u,f)({time:1}),typeof T=="function"&&T()},E);let R=I[i](e,m,n,y,A,b,a,c,u,f);if(!l(d)){let O=p.positionCartographic.height,L=i===re.SCENE3D?s.cartesianToCartographic(n).height:n.z;O>L&&O>11500?d=Rs.CUBIC_OUT:d=Rs.QUINTIC_IN_OUT}return{duration:m,easingFunction:d,startObject:{time:0},stopObject:{time:m},update:R,complete:T,cancel:E}};var aU=kIe;var VIe={ROTATE:0,INFINITE_SCROLL:1};Object.freeze(VIe);var pu=VIe;function an(e){this._scene=e,this._transform=N.clone(N.IDENTITY),this._invTransform=N.clone(N.IDENTITY),this._actualTransform=N.clone(N.IDENTITY),this._actualInvTransform=N.clone(N.IDENTITY),this._transformChanged=!1,this.position=new h,this._position=new h,this._positionWC=new h,this._positionCartographic=new he,this._oldPositionWC=void 0,this.positionWCDeltaMagnitude=0,this.positionWCDeltaMagnitudeLastFrame=0,this.timeSinceMoved=0,this._lastMovedTimestamp=0,this.direction=new h,this._direction=new h,this._directionWC=new h,this.up=new h,this._up=new h,this._upWC=new h,this.right=new h,this._right=new h,this._rightWC=new h,this.frustum=new $i,this.frustum.aspectRatio=e.drawingBufferWidth/e.drawingBufferHeight,this.frustum.fov=D.toRadians(60),this.defaultMoveAmount=1e5,this.defaultLookAmount=Math.PI/60,this.defaultRotateAmount=Math.PI/3600,this.defaultZoomAmount=1e5,this.constrainedAxis=void 0,this.maximumZoomFactor=1.5,this._moveStart=new be,this._moveEnd=new be,this._changed=new be,this._changedPosition=void 0,this._changedDirection=void 0,this._changedFrustum=void 0,this._changedHeading=void 0,this._changedRoll=void 0,this.percentageChanged=.5,this._viewMatrix=new N,this._invViewMatrix=new N,ZIe(this),this._mode=re.SCENE3D,this._modeChanged=!0;let t=e.mapProjection;this._projection=t,this._maxCoord=t.project(new he(Math.PI,D.PI_OVER_TWO)),this._max2Dfrustum=void 0,uPe(this,an.DEFAULT_VIEW_RECTANGLE,this.position,!0);let n=h.magnitude(this.position);n+=n*an.DEFAULT_VIEW_FACTOR,h.normalize(this.position,this.position),h.multiplyByScalar(this.position,n,this.position)}an.TRANSFORM_2D=new N(0,0,1,0,1,0,0,0,0,1,0,0,0,0,0,1);an.TRANSFORM_2D_INVERSE=N.inverseTransformation(an.TRANSFORM_2D,new N);an.DEFAULT_VIEW_RECTANGLE=ie.fromDegrees(-95,-20,-70,90);an.DEFAULT_VIEW_FACTOR=.5;an.DEFAULT_OFFSET=new Od(0,-D.PI_OVER_FOUR,0);function ZIe(e){N.computeView(e._position,e._direction,e._up,e._right,e._viewMatrix),N.multiply(e._viewMatrix,e._actualInvTransform,e._viewMatrix),N.inverseTransformation(e._viewMatrix,e._invViewMatrix)}function IEt(e){if(!l(e._oldPositionWC))e._oldPositionWC=h.clone(e.positionWC,e._oldPositionWC);else{e.positionWCDeltaMagnitudeLastFrame=e.positionWCDeltaMagnitude;let t=h.subtract(e.positionWC,e._oldPositionWC,e._oldPositionWC);e.positionWCDeltaMagnitude=h.magnitude(t),e._oldPositionWC=h.clone(e.positionWC,e._oldPositionWC),e.positionWCDeltaMagnitude>0?(e.timeSinceMoved=0,e._lastMovedTimestamp=xn()):e.timeSinceMoved=Math.max(xn()-e._lastMovedTimestamp,0)/1e3}}an.prototype.canPreloadFlight=function(){return l(this._currentFlight)&&this._mode!==re.SCENE2D};an.prototype._updateCameraChanged=function(){let e=this;if(IEt(e),e._changed.numberOfListeners===0)return;let t=e.percentageChanged,n=e.heading;l(e._changedHeading)||(e._changedHeading=n);let i=Math.abs(e._changedHeading-n)%D.TWO_PI;i=i>D.PI?D.TWO_PI-i:i;let r=i/Math.PI;r>t&&(e._changedHeading=n);let o=e.roll;l(e._changedRoll)||(e._changedRoll=o);let s=Math.abs(e._changedRoll-o)%D.TWO_PI;s=s>D.PI?D.TWO_PI-s:s;let a=s/Math.PI;if(a>t&&(e._changedRoll=o),(a>t||r>t)&&e._changed.raiseEvent(Math.max(a,r)),e._mode===re.SCENE2D){if(!l(e._changedFrustum)){e._changedPosition=h.clone(e.position,e._changedPosition),e._changedFrustum=e.frustum.clone();return}let p=e.position,g=e._changedPosition,m=e.frustum,y=e._changedFrustum,A=p.x+m.left,b=p.x+m.right,x=g.x+y.left,T=g.x+y.right,E=p.y+m.bottom,v=p.y+m.top,S=g.y+y.bottom,I=g.y+y.top,R=Math.max(A,x),O=Math.min(b,T),L=Math.max(E,S),_=Math.min(v,I),C;if(R>=O||L>=v)C=1;else{let w=y;A<x&&b>T&&E<S&&v>I&&(w=m),C=1-(O-R)*(_-L)/((w.right-w.left)*(w.top-w.bottom))}C>t&&(e._changed.raiseEvent(C),e._changedPosition=h.clone(e.position,e._changedPosition),e._changedFrustum=e.frustum.clone(e._changedFrustum));return}if(!l(e._changedDirection)){e._changedPosition=h.clone(e.positionWC,e._changedPosition),e._changedDirection=h.clone(e.directionWC,e._changedDirection);return}let c=D.acosClamped(h.dot(e.directionWC,e._changedDirection)),u;l(e.frustum.fovy)?u=c/(e.frustum.fovy*.5):u=c;let d=h.distance(e.positionWC,e._changedPosition)/e.positionCartographic.height;(u>t||d>t)&&(e._changed.raiseEvent(Math.max(u,d)),e._changedPosition=h.clone(e.positionWC,e._changedPosition),e._changedDirection=h.clone(e.directionWC,e._changedDirection))};function PEt(e){At.basisTo2D(e._projection,e._transform,e._actualTransform)}var DEt=new he,REt=new h,x5=new h,OEt=new se,MEt=new se,NEt=new se,LEt=new se,FEt=new se;function BEt(e){let t=e._projection,n=t.ellipsoid,i=N.getColumn(e._transform,3,OEt),r=n.cartesianToCartographic(i,DEt),o=t.project(r,REt),s=MEt;s.x=o.z,s.y=o.x,s.z=o.y,s.w=1;let a=se.clone(se.UNIT_X,FEt),c=se.add(N.getColumn(e._transform,0,x5),i,x5);n.cartesianToCartographic(c,r),t.project(r,o);let u=NEt;u.x=o.z,u.y=o.x,u.z=o.y,u.w=0,h.subtract(u,s,u),u.x=0;let f=LEt;if(h.magnitudeSquared(u)>D.EPSILON10)h.cross(a,u,f);else{let d=se.add(N.getColumn(e._transform,1,x5),i,x5);n.cartesianToCartographic(d,r),t.project(r,o),f.x=o.z,f.y=o.x,f.z=o.y,f.w=0,h.subtract(f,s,f),f.x=0,h.magnitudeSquared(f)<D.EPSILON10&&(se.clone(se.UNIT_Y,u),se.clone(se.UNIT_Z,f))}h.cross(f,a,u),h.normalize(u,u),h.cross(a,u,f),h.normalize(f,f),N.setColumn(e._actualTransform,0,u,e._actualTransform),N.setColumn(e._actualTransform,1,f,e._actualTransform),N.setColumn(e._actualTransform,2,a,e._actualTransform),N.setColumn(e._actualTransform,3,s,e._actualTransform)}var Yte=new h;function Tl(e){let t=e._mode,n=!1,i=0;t===re.SCENE2D&&(i=e.frustum.right-e.frustum.left,n=i!==e._positionCartographic.height);let r=e._position,o=!h.equals(r,e.position)||n;o&&(r=h.clone(e.position,e._position));let s=e._direction,a=!h.equals(s,e.direction);a&&(h.normalize(e.direction,e.direction),s=h.clone(e.direction,e._direction));let c=e._up,u=!h.equals(c,e.up);u&&(h.normalize(e.up,e.up),c=h.clone(e.up,e._up));let f=e._right,d=!h.equals(f,e.right);d&&(h.normalize(e.right,e.right),f=h.clone(e.right,e._right));let p=e._transformChanged||e._modeChanged;e._transformChanged=!1,p&&(N.inverseTransformation(e._transform,e._invTransform),e._mode===re.COLUMBUS_VIEW||e._mode===re.SCENE2D?N.equals(N.IDENTITY,e._transform)?N.clone(an.TRANSFORM_2D,e._actualTransform):e._mode===re.COLUMBUS_VIEW?PEt(e):BEt(e):N.clone(e._transform,e._actualTransform),N.inverseTransformation(e._actualTransform,e._actualInvTransform),e._modeChanged=!1);let g=e._actualTransform;if(o||p)if(e._positionWC=N.multiplyByPoint(g,r,e._positionWC),t===re.SCENE3D||t===re.MORPHING)e._positionCartographic=e._projection.ellipsoid.cartesianToCartographic(e._positionWC,e._positionCartographic);else{let m=Yte;m.x=e._positionWC.y,m.y=e._positionWC.z,m.z=e._positionWC.x,t===re.SCENE2D&&(m.z=i),e._projection.unproject(m,e._positionCartographic)}if(a||u||d){let m=h.dot(s,h.cross(c,f,Yte));if(Math.abs(1-m)>D.EPSILON2){let y=1/h.magnitudeSquared(c),A=h.dot(c,s)*y,b=h.multiplyByScalar(s,A,Yte);c=h.normalize(h.subtract(c,b,e._up),e._up),h.clone(c,e.up),f=h.cross(s,c,e._right),h.clone(f,e.right)}}(a||p)&&(e._directionWC=N.multiplyByPointAsVector(g,s,e._directionWC),h.normalize(e._directionWC,e._directionWC)),(u||p)&&(e._upWC=N.multiplyByPointAsVector(g,c,e._upWC),h.normalize(e._upWC,e._upWC)),(d||p)&&(e._rightWC=N.multiplyByPointAsVector(g,f,e._rightWC),h.normalize(e._rightWC,e._rightWC)),(o||a||u||d||p)&&ZIe(e)}function QIe(e,t){let n;return D.equalsEpsilon(Math.abs(e.z),1,D.EPSILON3)?n=Math.atan2(t.y,t.x)-D.PI_OVER_TWO:n=Math.atan2(e.y,e.x)-D.PI_OVER_TWO,D.TWO_PI-D.zeroToTwoPi(n)}function ePe(e){return D.PI_OVER_TWO-D.acosClamped(e.z)}function tPe(e,t,n){let i=0;return D.equalsEpsilon(Math.abs(e.z),1,D.EPSILON3)||(i=Math.atan2(-n.z,t.z),i=D.zeroToTwoPi(i+D.TWO_PI)),i}var C5=new N,v5=new N;Object.defineProperties(an.prototype,{transform:{get:function(){return this._transform}},inverseTransform:{get:function(){return Tl(this),this._invTransform}},viewMatrix:{get:function(){return Tl(this),this._viewMatrix}},inverseViewMatrix:{get:function(){return Tl(this),this._invViewMatrix}},positionCartographic:{get:function(){return Tl(this),this._positionCartographic}},positionWC:{get:function(){return Tl(this),this._positionWC}},directionWC:{get:function(){return Tl(this),this._directionWC}},upWC:{get:function(){return Tl(this),this._upWC}},rightWC:{get:function(){return Tl(this),this._rightWC}},heading:{get:function(){if(this._mode!==re.MORPHING){let e=this._projection.ellipsoid,t=N.clone(this._transform,C5),n=At.eastNorthUpToFixedFrame(this.positionWC,e,v5);this._setTransform(n);let i=QIe(this.direction,this.up);return this._setTransform(t),i}}},pitch:{get:function(){if(this._mode!==re.MORPHING){let e=this._projection.ellipsoid,t=N.clone(this._transform,C5),n=At.eastNorthUpToFixedFrame(this.positionWC,e,v5);this._setTransform(n);let i=ePe(this.direction);return this._setTransform(t),i}}},roll:{get:function(){if(this._mode!==re.MORPHING){let e=this._projection.ellipsoid,t=N.clone(this._transform,C5),n=At.eastNorthUpToFixedFrame(this.positionWC,e,v5);this._setTransform(n);let i=tPe(this.direction,this.up,this.right);return this._setTransform(t),i}}},moveStart:{get:function(){return this._moveStart}},moveEnd:{get:function(){return this._moveEnd}},changed:{get:function(){return this._changed}}});an.prototype.update=function(e){let t=!1;if(e!==this._mode&&(this._mode=e,this._modeChanged=e!==re.MORPHING,t=this._mode===re.SCENE2D),t){let n=this._max2Dfrustum=this.frustum.clone(),i=2,r=n.top/n.right;n.right=this._maxCoord.x*i,n.left=-n.right,n.top=r*n.right,n.bottom=-n.top}this._mode===re.SCENE2D&&oPe(this,this.position)};var kEt=new h,UEt=new h,zEt=new h;an.prototype._setTransform=function(e){let t=h.clone(this.positionWC,kEt),n=h.clone(this.upWC,UEt),i=h.clone(this.directionWC,zEt);N.clone(e,this._transform),this._transformChanged=!0,Tl(this);let r=this._actualInvTransform;N.multiplyByPoint(r,t,this.position),N.multiplyByPointAsVector(r,i,this.direction),N.multiplyByPointAsVector(r,n,this.up),h.cross(this.direction,this.up,this.right),Tl(this)};var VEt=new U,jEt=new pn,HEt=new h,GEt=new h;function nPe(e){if(!N.equals(N.IDENTITY,e.transform))return h.magnitude(e.position);let t=e._scene,n=t.globe,i=VEt;i.x=t.drawingBufferWidth/t.pixelRatio/2,i.y=t.drawingBufferHeight/t.pixelRatio/2;let r;if(l(n)){let a=e.getPickRay(i,jEt);r=n.pickWorldCoordinates(a,t,!0,HEt)}let o;t.pickPositionSupported&&(o=t.pickPositionWorldCoordinates(i,GEt));let s;if(l(r)||l(o)){let a=l(o)?h.distance(o,e.positionWC):Number.POSITIVE_INFINITY,c=l(r)?h.distance(r,e.positionWC):Number.POSITIVE_INFINITY;s=Math.min(a,c)}else s=Math.max(e.positionCartographic.height,0);return s}an.prototype._adjustOrthographicFrustum=function(e){this.frustum instanceof gn&&(!e&&this._positionCartographic.height<15e4||(this.frustum.width=nPe(this)))};var S5=new h,Zte=new N,WEt=new N,Qte=new Le,ene=new $,iPe=new he;function qEt(e,t,n){let i=N.clone(e.transform,Zte),r=At.eastNorthUpToFixedFrame(t,e._projection.ellipsoid,WEt);e._setTransform(r),h.clone(h.ZERO,e.position),n.heading=n.heading-D.PI_OVER_TWO;let o=Le.fromHeadingPitchRoll(n,Qte),s=$.fromQuaternion(o,ene);$.getColumn(s,0,e.direction),$.getColumn(s,2,e.up),h.cross(e.direction,e.up,e.right),e._setTransform(i),e._adjustOrthographicFrustum(!0)}function YEt(e,t,n,i){let r=N.clone(e.transform,Zte);if(e._setTransform(N.IDENTITY),!h.equals(t,e.positionWC)){if(i){let a=e._projection,c=a.ellipsoid.cartesianToCartographic(t,iPe);t=a.project(c,S5)}h.clone(t,e.position)}n.heading=n.heading-D.PI_OVER_TWO;let o=Le.fromHeadingPitchRoll(n,Qte),s=$.fromQuaternion(o,ene);$.getColumn(s,0,e.direction),$.getColumn(s,2,e.up),h.cross(e.direction,e.up,e.right),e._setTransform(r),e._adjustOrthographicFrustum(!0)}function XEt(e,t,n,i){let r=N.clone(e.transform,Zte);if(e._setTransform(N.IDENTITY),!h.equals(t,e.positionWC)){if(i){let c=e._projection,u=c.ellipsoid.cartesianToCartographic(t,iPe);t=c.project(u,S5)}U.clone(t,e.position);let o=-t.z*.5,s=-o,a=e.frustum;if(s>o){let c=a.top/a.right;a.right=s,a.left=o,a.top=a.right*c,a.bottom=-a.top}}if(e._scene.mapMode2D===pu.ROTATE){n.heading=n.heading-D.PI_OVER_TWO,n.pitch=-D.PI_OVER_TWO,n.roll=0;let o=Le.fromHeadingPitchRoll(n,Qte),s=$.fromQuaternion(o,ene);$.getColumn(s,2,e.up),h.cross(e.direction,e.up,e.right)}e._setTransform(r)}var KEt=new h,$Et=new h,JEt=new h;function rPe(e,t,n,i){let r=h.clone(n.direction,KEt),o=h.clone(n.up,$Et);if(e._scene.mode===re.SCENE3D){let a=e._projection.ellipsoid,c=At.eastNorthUpToFixedFrame(t,a,C5),u=N.inverseTransformation(c,v5);N.multiplyByPointAsVector(u,r,r),N.multiplyByPointAsVector(u,o,o)}let s=h.cross(r,o,JEt);return i.heading=QIe(r,o),i.pitch=ePe(r),i.roll=tPe(r,o,s),i}var Jte={destination:void 0,orientation:{direction:void 0,up:void 0,heading:void 0,pitch:void 0,roll:void 0},convert:void 0,endTransform:void 0},fI=new wc;an.prototype.setView=function(e){e=e??H.EMPTY_OBJECT;let t=e.orientation??H.EMPTY_OBJECT,n=this._mode;if(n===re.MORPHING)return;l(e.endTransform)&&this._setTransform(e.endTransform);let i=e.convert??!0,r=e.destination??h.clone(this.positionWC,S5);l(r)&&l(r.west)&&(r=this.getRectangleCameraCoordinates(r,S5),i=!1),l(t.direction)&&(t=rPe(this,r,t,Jte.orientation)),fI.heading=t.heading??0,fI.pitch=t.pitch??-D.PI_OVER_TWO,fI.roll=t.roll??0,n===re.SCENE3D?qEt(this,r,fI):n===re.SCENE2D?XEt(this,r,fI,i):YEt(this,r,fI,i)};var ZEt=new h;an.prototype.flyHome=function(e){let t=this._mode;if(t===re.MORPHING&&this._scene.completeMorph(),t===re.SCENE2D)this.flyTo({destination:an.DEFAULT_VIEW_RECTANGLE,duration:e,endTransform:N.IDENTITY});else if(t===re.SCENE3D){let n=this.getRectangleCameraCoordinates(an.DEFAULT_VIEW_RECTANGLE),i=h.magnitude(n);i+=i*an.DEFAULT_VIEW_FACTOR,h.normalize(n,n),h.multiplyByScalar(n,i,n),this.flyTo({destination:n,duration:e,endTransform:N.IDENTITY})}else if(t===re.COLUMBUS_VIEW){let n=this._projection.ellipsoid.maximumRadius,i=new h(0,-1,1);i=h.multiplyByScalar(h.normalize(i,i),5*n,i),this.flyTo({destination:i,duration:e,orientation:{heading:0,pitch:-Math.acos(h.normalize(i,ZEt).z),roll:0},endTransform:N.IDENTITY,convert:!1})}};an.prototype.worldToCameraCoordinates=function(e,t){return l(t)||(t=new se),Tl(this),N.multiplyByVector(this._actualInvTransform,e,t)};an.prototype.worldToCameraCoordinatesPoint=function(e,t){return l(t)||(t=new h),Tl(this),N.multiplyByPoint(this._actualInvTransform,e,t)};an.prototype.worldToCameraCoordinatesVector=function(e,t){return l(t)||(t=new h),Tl(this),N.multiplyByPointAsVector(this._actualInvTransform,e,t)};an.prototype.cameraToWorldCoordinates=function(e,t){return l(t)||(t=new se),Tl(this),N.multiplyByVector(this._actualTransform,e,t)};an.prototype.cameraToWorldCoordinatesPoint=function(e,t){return l(t)||(t=new h),Tl(this),N.multiplyByPoint(this._actualTransform,e,t)};an.prototype.cameraToWorldCoordinatesVector=function(e,t){return l(t)||(t=new h),Tl(this),N.multiplyByPointAsVector(this._actualTransform,e,t)};function oPe(e,t){let n=e._scene.mapMode2D===pu.ROTATE,i=e._maxCoord.x,r=e._maxCoord.y,o,s;n?(s=i,o=-s):(s=t.x-i*2,o=t.x+i*2),t.x>i&&(t.x=s),t.x<-i&&(t.x=o),t.y>r&&(t.y=r),t.y<-r&&(t.y=-r)}var jIe=new h;an.prototype.move=function(e,t){let n=this.position;h.multiplyByScalar(e,t,jIe),h.add(n,jIe,n),this._mode===re.SCENE2D&&oPe(this,n),this._adjustOrthographicFrustum(!0)};an.prototype.moveForward=function(e){e=e??this.defaultMoveAmount,this._mode===re.SCENE2D?w5(this,e):this.move(this.direction,e)};an.prototype.moveBackward=function(e){e=e??this.defaultMoveAmount,this._mode===re.SCENE2D?w5(this,-e):this.move(this.direction,-e)};an.prototype.moveUp=function(e){e=e??this.defaultMoveAmount,this.move(this.up,e)};an.prototype.moveDown=function(e){e=e??this.defaultMoveAmount,this.move(this.up,-e)};an.prototype.moveRight=function(e){e=e??this.defaultMoveAmount,this.move(this.right,e)};an.prototype.moveLeft=function(e){e=e??this.defaultMoveAmount,this.move(this.right,-e)};an.prototype.lookLeft=function(e){e=e??this.defaultLookAmount,this._mode!==re.SCENE2D&&this.look(this.up,-e)};an.prototype.lookRight=function(e){e=e??this.defaultLookAmount,this._mode!==re.SCENE2D&&this.look(this.up,e)};an.prototype.lookUp=function(e){e=e??this.defaultLookAmount,this._mode!==re.SCENE2D&&this.look(this.right,-e)};an.prototype.lookDown=function(e){e=e??this.defaultLookAmount,this._mode!==re.SCENE2D&&this.look(this.right,e)};var QEt=new Le,eCt=new $;an.prototype.look=function(e,t){let n=t??this.defaultLookAmount,i=Le.fromAxisAngle(e,-n,QEt),r=$.fromQuaternion(i,eCt),o=this.direction,s=this.up,a=this.right;$.multiplyByVector(r,o,o),$.multiplyByVector(r,s,s),$.multiplyByVector(r,a,a)};an.prototype.twistLeft=function(e){e=e??this.defaultLookAmount,this.look(this.direction,e)};an.prototype.twistRight=function(e){e=e??this.defaultLookAmount,this.look(this.direction,-e)};var tCt=new Le,nCt=new $;an.prototype.rotate=function(e,t){let n=t??this.defaultRotateAmount,i=Le.fromAxisAngle(e,-n,tCt),r=$.fromQuaternion(i,nCt);$.multiplyByVector(r,this.position,this.position),$.multiplyByVector(r,this.direction,this.direction),$.multiplyByVector(r,this.up,this.up),h.cross(this.direction,this.up,this.right),h.cross(this.right,this.direction,this.up),this._adjustOrthographicFrustum(!1)};an.prototype.rotateDown=function(e){e=e??this.defaultRotateAmount,sPe(this,e)};an.prototype.rotateUp=function(e){e=e??this.defaultRotateAmount,sPe(this,-e)};var iCt=new h,rCt=new h,oCt=new h,HIe=new h;function sPe(e,t){let n=e.position;if(l(e.constrainedAxis)&&!h.equalsEpsilon(e.position,h.ZERO,D.EPSILON2)){let i=h.normalize(n,iCt),r=h.equalsEpsilon(i,e.constrainedAxis,D.EPSILON2),o=h.equalsEpsilon(i,h.negate(e.constrainedAxis,HIe),D.EPSILON2);if(!r&&!o){let s=h.normalize(e.constrainedAxis,rCt),a=h.dot(i,s),c=D.acosClamped(a);t>0&&t>c&&(t=c-D.EPSILON4),a=h.dot(i,h.negate(s,HIe)),c=D.acosClamped(a),t<0&&-t>c&&(t=-c+D.EPSILON4);let u=h.cross(s,i,oCt);e.rotate(u,t)}else(r&&t<0||o&&t>0)&&e.rotate(e.right,t)}else e.rotate(e.right,t)}an.prototype.rotateRight=function(e){e=e??this.defaultRotateAmount,aPe(this,-e)};an.prototype.rotateLeft=function(e){e=e??this.defaultRotateAmount,aPe(this,e)};function aPe(e,t){l(e.constrainedAxis)?e.rotate(e.constrainedAxis,t):e.rotate(e.up,t)}function w5(e,t){let n=e.frustum,i;if(t=t*.5,Math.abs(n.top)+Math.abs(n.bottom)>Math.abs(n.left)+Math.abs(n.right)){let r=n.top-t,o=n.bottom+t,s=e._maxCoord.y;e._scene.mapMode2D===pu.ROTATE&&(s*=e.maximumZoomFactor),o>s&&(o=s,r=-s),r<=o&&(r=1,o=-1),i=n.right/n.top,n.top=r,n.bottom=o,n.right=n.top*i,n.left=-n.right}else{let r=n.right-t,o=n.left+t,s=e._maxCoord.x;e._scene.mapMode2D===pu.ROTATE&&(s*=e.maximumZoomFactor),r>s&&(r=s,o=-s),r<=o&&(r=1,o=-1),i=n.top/n.right,n.right=r,n.left=o,n.top=n.right*i,n.bottom=-n.top}}function cPe(e,t){e.move(e.direction,t)}an.prototype.zoomIn=function(e){e=e??this.defaultZoomAmount,this._mode===re.SCENE2D?w5(this,e):cPe(this,e)};an.prototype.zoomOut=function(e){e=e??this.defaultZoomAmount,this._mode===re.SCENE2D?w5(this,-e):cPe(this,-e)};an.prototype.getMagnitude=function(){if(this._mode===re.SCENE3D)return h.magnitude(this.position);if(this._mode===re.COLUMBUS_VIEW)return Math.abs(this.position.z);if(this._mode===re.SCENE2D)return Math.max(this.frustum.right-this.frustum.left,this.frustum.top-this.frustum.bottom)};var sCt=new N;an.prototype.lookAt=function(e,t){let i=this._scene.ellipsoid??ee.default,r=At.eastNorthUpToFixedFrame(e,i,sCt);this.lookAtTransform(r,t)};var aCt=new h,cCt=new Le,lCt=new Le,uCt=new $;function lPe(e,t,n,i){t=D.clamp(t,-D.PI_OVER_TWO,D.PI_OVER_TWO),e=D.zeroToTwoPi(e)-D.PI_OVER_TWO;let r=Le.fromAxisAngle(h.UNIT_Y,-t,cCt),o=Le.fromAxisAngle(h.UNIT_Z,-e,lCt),s=Le.multiply(o,r,o),a=$.fromQuaternion(s,uCt),c=h.clone(h.UNIT_X,i);return $.multiplyByVector(a,c,c),h.negate(c,c),h.multiplyByScalar(c,n,c),c}an.prototype.lookAtTransform=function(e,t){if(this._setTransform(e),!l(t))return;let n;if(l(t.heading)?n=lPe(t.heading,t.pitch,t.range,aCt):n=t,this._mode===re.SCENE2D){U.clone(U.ZERO,this.position),h.negate(n,this.up),this.up.z=0,h.magnitudeSquared(this.up)<D.EPSILON10&&h.clone(h.UNIT_Y,this.up),h.normalize(this.up,this.up),this._setTransform(N.IDENTITY),h.negate(h.UNIT_Z,this.direction),h.cross(this.direction,this.up,this.right),h.normalize(this.right,this.right);let i=this.frustum,r=i.top/i.right;i.right=h.magnitude(n)*.5,i.left=-i.right,i.top=r*i.right,i.bottom=-i.top,this._setTransform(e);return}h.clone(n,this.position),h.negate(this.position,this.direction),h.normalize(this.direction,this.direction),h.cross(this.direction,h.UNIT_Z,this.right),h.magnitudeSquared(this.right)<D.EPSILON10&&h.clone(h.UNIT_X,this.right),h.normalize(this.right,this.right),h.cross(this.right,this.direction,this.up),h.normalize(this.up,this.up),this._adjustOrthographicFrustum(!0)};var fCt=new N,GIe=new h,dCt=new h,WIe=new h;an.prototype.lookAtWorldPosition=function(e,t=ee.default){let n=N.clone(this._transform,fCt);this._setTransform(N.IDENTITY);let i=h.subtract(e,this.positionWC,GIe);h.magnitudeSquared(i)<D.EPSILON8&&(i=h.clone(this.directionWC,GIe)),i=h.normalize(i,this.direction);let r=t.geodeticSurfaceNormal(e,dCt),o=h.cross(i,r,WIe);h.magnitudeSquared(o)<D.EPSILON8&&(o=h.clone(this.rightWC,WIe)),h.normalize(o,this.right);let s=h.cross(o,i,this.up);h.normalize(s,this.up),this._setTransform(n)};var cU=new he,hCt=new he,mCt=new h,pCt=new h,gCt=new h,_Ct=new h,yCt=new h,ACt=new h,bCt=new h,Xte=new h,xCt={direction:new h,right:new h,up:new h},qIe;function xl(e,t,n,i){return Math.abs(h.dot(t,n))/i-h.dot(e,n)}function uPe(e,t,n,i){let r=e._projection.ellipsoid,o=i?e:xCt,{north:s,south:a,west:c}=t,{east:u}=t;c>u&&(u+=D.TWO_PI);let f=(c+u)*.5,d;if(a<-D.PI_OVER_TWO+D.RADIANS_PER_DEGREE&&s>D.PI_OVER_TWO-D.RADIANS_PER_DEGREE)d=0;else{let O=cU;O.longitude=f,O.latitude=s,O.height=0;let L=hCt;L.longitude=f,L.latitude=a,L.height=0;let _=qIe;(!l(_)||_.ellipsoid!==r)&&(qIe=_=new gg(void 0,void 0,r)),_.setEndPoints(O,L),d=_.interpolateUsingFraction(.5,cU).latitude}let p=cU;p.longitude=f,p.latitude=d,p.height=0;let g=r.cartographicToCartesian(p,bCt),m=cU;m.longitude=u,m.latitude=s;let y=r.cartographicToCartesian(m,mCt);m.longitude=c;let A=r.cartographicToCartesian(m,gCt);m.longitude=f;let b=r.cartographicToCartesian(m,yCt);m.latitude=a;let x=r.cartographicToCartesian(m,ACt);m.longitude=u;let T=r.cartographicToCartesian(m,_Ct);m.longitude=c;let E=r.cartographicToCartesian(m,pCt);h.subtract(A,g,A),h.subtract(T,g,T),h.subtract(y,g,y),h.subtract(E,g,E),h.subtract(b,g,b),h.subtract(x,g,x);let v=r.geodeticSurfaceNormal(g,o.direction);h.negate(v,v);let S=h.cross(v,h.UNIT_Z,o.right);h.normalize(S,S);let I=h.cross(S,v,o.up),R;if(e.frustum instanceof gn){let O=Math.max(h.distance(y,A),h.distance(T,E)),L=Math.max(h.distance(y,T),h.distance(A,E)),_,C,w=e.frustum._offCenterFrustum,P=w.right/w.top,M=L*P;O>M?(_=O,C=_/P):(C=L,_=M),R=Math.max(_,C)}else{let O=Math.tan(e.frustum.fovy*.5),L=e.frustum.aspectRatio*O;if(R=Math.max(xl(v,I,A,O),xl(v,I,T,O),xl(v,I,y,O),xl(v,I,E,O),xl(v,I,b,O),xl(v,I,x,O),xl(v,S,A,L),xl(v,S,T,L),xl(v,S,y,L),xl(v,S,E,L),xl(v,S,b,L),xl(v,S,x,L)),a<0&&s>0){let _=cU;_.longitude=c,_.latitude=0,_.height=0;let C=r.cartographicToCartesian(_,Xte);h.subtract(C,g,C),R=Math.max(R,xl(v,I,C,O),xl(v,S,C,L)),_.longitude=u,C=r.cartographicToCartesian(_,Xte),h.subtract(C,g,C),R=Math.max(R,xl(v,I,C,O),xl(v,S,C,L))}}return h.add(g,h.multiplyByScalar(v,-R,Xte),n)}var TCt=new he,ECt=new h,CCt=new h;function vCt(e,t,n){let i=e._projection;t.west>t.east&&(t=ie.MAX_VALUE);let r=e._actualTransform,o=e._actualInvTransform,s=TCt;s.longitude=t.east,s.latitude=t.north;let a=i.project(s,ECt);N.multiplyByPoint(r,a,a),N.multiplyByPoint(o,a,a),s.longitude=t.west,s.latitude=t.south;let c=i.project(s,CCt);if(N.multiplyByPoint(r,c,c),N.multiplyByPoint(o,c,c),n.x=(a.x-c.x)*.5+c.x,n.y=(a.y-c.y)*.5+c.y,l(e.frustum.fovy)){let u=Math.tan(e.frustum.fovy*.5),f=e.frustum.aspectRatio*u;n.z=Math.max((a.x-c.x)/f,(a.y-c.y)/u)*.5}else{let u=a.x-c.x,f=a.y-c.y;n.z=Math.max(u,f)}return n}var SCt=new he,wCt=new h,ICt=new h;function PCt(e,t,n){let i=e._projection,r=t.east;t.west>t.east&&(e._scene.mapMode2D===pu.INFINITE_SCROLL?r+=D.TWO_PI:(t=ie.MAX_VALUE,r=t.east));let o=SCt;o.longitude=r,o.latitude=t.north;let s=i.project(o,wCt);o.longitude=t.west,o.latitude=t.south;let a=i.project(o,ICt),c=Math.abs(s.x-a.x)*.5,u=Math.abs(s.y-a.y)*.5,f,d,p=e.frustum.right/e.frustum.top,g=u*p;return c>g?(f=c,d=f/p):(d=u,f=g),u=Math.max(2*f,2*d),n.x=(s.x-a.x)*.5+a.x,n.y=(s.y-a.y)*.5+a.y,o=i.unproject(n,o),o.height=u,n=i.project(o,n),n}an.prototype.getRectangleCameraCoordinates=function(e,t){let n=this._mode;if(l(t)||(t=new h),n===re.SCENE3D)return uPe(this,e,t);if(n===re.COLUMBUS_VIEW)return vCt(this,e,t);if(n===re.SCENE2D)return PCt(this,e,t)};var DCt=new pn;function RCt(e,t,n,i){n=n??ee.default;let r=e.getPickRay(t,DCt),o=_i.rayEllipsoid(r,n);if(!o)return;let s=o.start>0?o.start:o.stop;return pn.getPoint(r,s,i)}var OCt=new pn;function MCt(e,t,n,i){let o=e.getPickRay(t,OCt).origin;o=h.fromElements(o.y,o.z,0,o);let s=n.unproject(o);if(!(s.latitude<-D.PI_OVER_TWO||s.latitude>D.PI_OVER_TWO))return n.ellipsoid.cartographicToCartesian(s,i)}var NCt=new pn;function LCt(e,t,n,i){let r=e.getPickRay(t,NCt),o=-r.origin.x/r.direction.x;pn.getPoint(r,o,i);let s=n.unproject(new h(i.y,i.z,0));if(!(s.latitude<-D.PI_OVER_TWO||s.latitude>D.PI_OVER_TWO||s.longitude<-Math.PI||s.longitude>Math.PI))return n.ellipsoid.cartographicToCartesian(s,i)}an.prototype.pickEllipsoid=function(e,t,n){let i=this._scene.canvas;if(!(i.clientWidth===0||i.clientHeight===0)){if(l(n)||(n=new h),t=t??ee.default,this._mode===re.SCENE3D)n=RCt(this,e,t,n);else if(this._mode===re.SCENE2D)n=MCt(this,e,this._projection,n);else if(this._mode===re.COLUMBUS_VIEW)n=LCt(this,e,this._projection,n);else return;return n}};var FCt=new h,BCt=new h,kCt=new h;function UCt(e,t,n){let i=e._scene.canvas,r=i.clientWidth,o=i.clientHeight,s=Math.tan(e.frustum.fovy*.5),a=e.frustum.aspectRatio*s,c=e.frustum.near,u=2/r*t.x-1,f=2/o*(o-t.y)-1,d=e.positionWC;h.clone(d,n.origin);let p=h.multiplyByScalar(e.directionWC,c,FCt);h.add(d,p,p);let g=h.multiplyByScalar(e.rightWC,u*c*a,BCt),m=h.multiplyByScalar(e.upWC,f*c*s,kCt),y=h.add(p,g,n.direction);return h.add(y,m,y),h.subtract(y,d,y),h.normalize(y,y),n}var T5=new h;function zCt(e,t,n){let i=e._scene.canvas,r=i.clientWidth,o=i.clientHeight,s=e.frustum,a=s.offCenterFrustum;l(a)&&(s=a);let c=2/r*t.x-1;c*=(s.right-s.left)*.5;let u=2/o*(o-t.y)-1;u*=(s.top-s.bottom)*.5;let f=n.origin;if(h.clone(e.positionWC,f),h.multiplyByScalar(e.rightWC,c,T5),h.add(T5,f,f),h.multiplyByScalar(e.upWC,u,T5),h.add(T5,f,f),h.clone(e.directionWC,n.direction),e._mode===re.SCENE2D&&e._scene.mapMode2D===pu.INFINITE_SCROLL){let d=e._maxCoord.x;f.y=D.mod(f.y+d,2*d)-d}return n}an.prototype.getPickRay=function(e,t){l(t)||(t=new pn);let n=this._scene.canvas;if(n.clientWidth<=0||n.clientHeight<=0)return;let i=this.frustum;return l(i.aspectRatio)&&l(i.fov)&&l(i.near)?UCt(this,e,t):zCt(this,e,t)};var VCt=new h,jCt=new h;an.prototype.distanceToBoundingSphere=function(e){let t=h.subtract(this.positionWC,e.center,VCt),n=h.multiplyByScalar(this.directionWC,h.dot(t,this.directionWC),jCt);return Math.max(0,h.magnitude(n)-e.radius)};var HCt=new U;an.prototype.getPixelSize=function(e,t,n){let i=this.distanceToBoundingSphere(e),r=this.frustum.getPixelDimensions(t,n,i,this._scene.pixelRatio,HCt);return Math.max(r.x,r.y)};function GCt(e,t,n,i,r,o){let s=h.clone(t);n.y>i?s.y-=n.y-i:n.y<-i&&(s.y+=-i-n.y),n.z>r?s.z-=n.z-r:n.z<-r&&(s.z+=-r-n.z);function a(c){let u=h.lerp(t,s,c.time,new h);e.worldToCameraCoordinatesPoint(u,e.position)}return{easingFunction:Rs.EXPONENTIAL_OUT,startObject:{time:0},stopObject:{time:1},duration:o,update:a}}var WCt=new h,YIe=new h,qCt=new h,YCt=new h;function XCt(e,t){let n=e.position,i=e.direction,r=e.worldToCameraCoordinatesVector(h.UNIT_X,WCt),o=-h.dot(r,n)/h.dot(r,i),s=h.add(n,h.multiplyByScalar(i,o,YIe),YIe);e.cameraToWorldCoordinatesPoint(s,s),n=e.cameraToWorldCoordinatesPoint(e.position,qCt);let a=Math.tan(e.frustum.fovy*.5),c=e.frustum.aspectRatio*a,u=h.magnitude(h.subtract(n,s,YCt)),f=c*u,d=a*u,p=e._maxCoord.x,g=e._maxCoord.y,m=Math.max(f-p,p),y=Math.max(d-g,g);if(n.z<-m||n.z>m||n.y<-y||n.y>y){let A=s.y<-m||s.y>m,b=s.z<-y||s.z>y;if(A||b)return GCt(e,n,s,m,y,t)}}an.prototype.createCorrectPositionTween=function(e){if(this._mode===re.COLUMBUS_VIEW)return XCt(this,e)};var KCt=new h,Ja={destination:void 0,heading:void 0,pitch:void 0,roll:void 0,duration:void 0,complete:void 0,cancel:void 0,endTransform:void 0,maximumHeight:void 0,easingFunction:void 0};an.prototype.cancelFlight=function(){l(this._currentFlight)&&(this._currentFlight.cancelTween(),this._currentFlight=void 0)};an.prototype.completeFlight=function(){if(l(this._currentFlight)){this._currentFlight.cancelTween();let e={destination:void 0,orientation:{heading:void 0,pitch:void 0,roll:void 0}};e.destination=Ja.destination,e.orientation.heading=Ja.heading,e.orientation.pitch=Ja.pitch,e.orientation.roll=Ja.roll,this.setView(e),l(this._currentFlight.complete)&&this._currentFlight.complete(),this._currentFlight=void 0}};an.prototype.flyTo=function(e){e=e??H.EMPTY_OBJECT;let t=e.destination;if(this._mode===re.MORPHING)return;this.cancelFlight();let i=t instanceof ie;i&&(t=this.getRectangleCameraCoordinates(t,KCt));let r=e.orientation??H.EMPTY_OBJECT;if(l(r.direction)&&(r=rPe(this,t,r,Jte.orientation)),l(e.duration)&&e.duration<=0){let f=Jte;f.destination=e.destination,f.orientation.heading=r.heading,f.orientation.pitch=r.pitch,f.orientation.roll=r.roll,f.convert=e.convert,f.endTransform=e.endTransform,this.setView(f),typeof e.complete=="function"&&e.complete();return}let o=this,s;Ja.destination=t,Ja.heading=r.heading,Ja.pitch=r.pitch,Ja.roll=r.roll,Ja.duration=e.duration,Ja.complete=function(){s===o._currentFlight&&(o._currentFlight=void 0),l(e.complete)&&e.complete()},Ja.cancel=e.cancel,Ja.endTransform=e.endTransform,Ja.convert=i?!1:e.convert,Ja.maximumHeight=e.maximumHeight,Ja.pitchAdjustHeight=e.pitchAdjustHeight,Ja.flyOverLongitude=e.flyOverLongitude,Ja.flyOverLongitudeWeight=e.flyOverLongitudeWeight,Ja.easingFunction=e.easingFunction;let a=this._scene,c=aU.createTween(a,Ja);if(c.duration===0){typeof c.complete=="function"&&c.complete();return}s=a.tweens.add(c),this._currentFlight=s;let u=this._scene.preloadFlightCamera;this._mode!==re.SCENE2D&&(l(u)||(u=an.clone(this)),u.setView({destination:t,orientation:r}),this._scene.preloadFlightCullingVolume=u.frustum.computeCullingVolume(u.positionWC,u.directionWC,u.upWC))};function $Ct(e,t){let n=e.frustum,i=Math.tan(n.fovy*.5),r=n.aspectRatio*i;return Math.max(t/r,t/i)}function JCt(e,t){let n=e.frustum,i=n.offCenterFrustum;l(i)&&(n=i);let r,o,s=n.right/n.top,a=t*s;return t>a?(r=t,o=r/s):(o=t,r=a),Math.max(r,o)*1.5}var ZCt=100;function fPe(e,t,n){n=Od.clone(l(n)?n:an.DEFAULT_OFFSET);let i=e._scene.screenSpaceCameraController.minimumZoomDistance,r=e._scene.screenSpaceCameraController.maximumZoomDistance,o=n.range;if(!l(o)||o===0){let s=t.radius;s===0?n.range=ZCt:e.frustum instanceof gn||e._mode===re.SCENE2D?n.range=JCt(e,s):n.range=$Ct(e,s),n.range=D.clamp(n.range,i,r)}return n}an.prototype.viewBoundingSphere=function(e,t){t=fPe(this,e,t),this.lookAt(e.center,t)};var QCt=new N,XIe=new h,evt=new h,tvt=new h,nvt=new h,ivt=new se,rvt=new Le,ovt=new $;an.prototype.flyToBoundingSphere=function(e,t){t=t??H.EMPTY_OBJECT;let n=this._mode===re.SCENE2D||this._mode===re.COLUMBUS_VIEW;this._setTransform(N.IDENTITY);let i=fPe(this,e,t.offset),r;n?r=h.multiplyByScalar(h.UNIT_Z,i.range,XIe):r=lPe(i.heading,i.pitch,i.range,XIe);let s=this._scene.ellipsoid??ee.default,a=At.eastNorthUpToFixedFrame(e.center,s,QCt);N.multiplyByPoint(a,r,r);let c,u;if(!n){if(c=h.subtract(e.center,r,evt),h.normalize(c,c),u=N.multiplyByPointAsVector(a,h.UNIT_Z,tvt),1-Math.abs(h.dot(c,u))<D.EPSILON6){let d=Le.fromAxisAngle(c,i.heading,rvt),p=$.fromQuaternion(d,ovt);h.fromCartesian4(N.getColumn(a,1,ivt),u),$.multiplyByVector(p,u,u)}let f=h.cross(c,u,nvt);h.cross(f,c,u),h.normalize(u,u)}this.flyTo({destination:r,orientation:{direction:c,up:u},duration:t.duration,complete:t.complete,cancel:t.cancel,endTransform:t.endTransform,maximumHeight:t.maximumHeight,easingFunction:t.easingFunction,flyOverLongitude:t.flyOverLongitude,flyOverLongitudeWeight:t.flyOverLongitudeWeight,pitchAdjustHeight:t.pitchAdjustHeight})};var KIe=new h,$Ie=new h,Kte=new h,JIe=new h,lU=[new h,new h,new h,new h];function svt(e,t){let n=t.radii,i=e.positionWC,r=h.multiplyComponents(t.oneOverRadii,i,KIe),o=h.magnitude(r),s=h.normalize(r,$Ie),a,c;h.equalsEpsilon(s,h.UNIT_Z,D.EPSILON10)?(a=new h(0,1,0),c=new h(0,0,1)):(a=h.normalize(h.cross(h.UNIT_Z,s,Kte),Kte),c=h.normalize(h.cross(s,a,JIe),JIe));let u=Math.sqrt(h.magnitudeSquared(r)-1),f=h.multiplyByScalar(s,1/o,KIe),d=u/o,p=h.multiplyByScalar(a,d,$Ie),g=h.multiplyByScalar(c,d,Kte),m=h.add(f,g,lU[0]);h.subtract(m,p,m),h.multiplyComponents(n,m,m);let y=h.subtract(f,g,lU[1]);h.subtract(y,p,y),h.multiplyComponents(n,y,y);let A=h.subtract(f,g,lU[2]);h.add(A,p,A),h.multiplyComponents(n,A,A);let b=h.add(f,g,lU[3]);return h.add(b,p,b),h.multiplyComponents(n,b,b),lU}var $te=new U,avt=new h,rb=[new he,new he,new he,new he];function E5(e,t,n,i,r,o){$te.x=e,$te.y=t;let s=i.pickEllipsoid($te,r,avt);return l(s)?(rb[n]=r.cartesianToCartographic(s,rb[n]),1):(rb[n]=r.cartesianToCartographic(o[n],rb[n]),0)}an.prototype.computeViewRectangle=function(e,t){e=e??ee.default;let n=this.frustum.computeCullingVolume(this.positionWC,this.directionWC,this.upWC),i=new ue(h.ZERO,e.maximumRadius);if(n.computeVisibility(i)===$t.OUTSIDE)return;let o=this._scene.canvas,s=o.clientWidth,a=o.clientHeight,c=0,u=svt(this,e);if(c+=E5(0,0,0,this,e,u),c+=E5(0,a,1,this,e,u),c+=E5(s,a,2,this,e,u),c+=E5(s,0,3,this,e,u),c<2)return ie.MAX_VALUE;t=ie.fromCartographicArray(rb,t);let f=0,d=rb[3].longitude;for(let p=0;p<4;++p){let g=rb[p].longitude,m=Math.abs(g-d);m>D.PI?f+=D.TWO_PI-m:f+=m,d=g}return D.equalsEpsilon(Math.abs(f),D.TWO_PI,D.EPSILON9)&&(t.west=-D.PI,t.east=D.PI,rb[0].latitude>=0?t.north=D.PI_OVER_TWO:t.south=-D.PI_OVER_TWO),t};an.prototype.switchToPerspectiveFrustum=function(){if(this._mode===re.SCENE2D||this.frustum instanceof $i)return;let e=this._scene;this.frustum=new $i,this.frustum.aspectRatio=e.drawingBufferWidth/e.drawingBufferHeight,this.frustum.fov=D.toRadians(60)};an.prototype.switchToOrthographicFrustum=function(){if(this._mode===re.SCENE2D||this.frustum instanceof gn)return;let e=nPe(this),t=this._scene;this.frustum=new gn,this.frustum.aspectRatio=t.drawingBufferWidth/t.drawingBufferHeight,this.frustum.width=e};an.clone=function(e,t){return l(t)||(t=new an(e._scene)),h.clone(e.position,t.position),h.clone(e.direction,t.direction),h.clone(e.up,t.up),h.clone(e.right,t.right),N.clone(e._transform,t.transform),t._transformChanged=!0,t.frustum=e.frustum.clone(),t};var Or=an;function cvt(e){this.pass=e.pass,this.commandList=e.commandList,this.camera=e.camera,this.cullingVolume=e.cullingVolume,this.ready=!1}var Ah=cvt;var tne=class{constructor(){this._controllers=[],this._needsUpdate=new Set}get controllerCount(){return this._controllers.length}registerController(t,n,i){let r=i??this.controllerCount;this._controllers.splice(r,0,t),this._needsUpdate.add(t),t.connectedCallback(n)}unregisterController(t,n){let i=this._controllers,r=i.indexOf(t);r!==-1&&(i.splice(r,1),t.disconnectedCallback(n))}update(t,n){for(let i of this._controllers)i.enabled&&(this._needsUpdate.has(i)&&(i.firstUpdate(t,n),this._needsUpdate.delete(i)),i.update(t,n))}},uU=tne;var _Pe=Qo(Tf(),1),dPe=576,lvt=100,fU="#ffffff",dU="#48b";function yPe(e,t){this.credit=e,this.count=t??1}function uvt(e,t){let n=e.length;for(let i=0;i<n;i++){let r=e[i];if(It.equals(r,t))return!0}return!1}function fvt(e){let t=e._previousCesiumCredit,n=e._currentCesiumCredit;It.equals(n,t)||(l(t)&&e._cesiumCreditContainer.removeChild(t.element),l(n)&&e._cesiumCreditContainer.appendChild(n.element),e._previousCesiumCredit=n)}var APe="cesium-credit-delimiter";function hPe(e){let t=document.createElement("span");return t.textContent=e,t.className=APe,t}function mPe(e,t){if(l(t)){let n=document.createElement(t);n._creditId=e._creditId,n.appendChild(e),e=n}return e}function pPe(e,t,n,i){let r=e.childNodes,o=-1;t.sort(function(s,a){return a.count-s.count});for(let s=0;s<t.length;++s){let a=t[s].credit;if(l(a)){if(o=s,l(n)&&(o*=2,s>0)){let u=o-1;if(r.length<=u)e.appendChild(hPe(n));else{let f=r[u];f.className!==APe&&e.replaceChild(hPe(n),f)}}let c=a.element;if(r.length<=o)e.appendChild(mPe(c,i));else{let u=r[o];u._creditId!==a._id&&e.replaceChild(mPe(c,i),u)}}}for(++o;o<r.length;)e.removeChild(r[o])}function dvt(e){let t=e._lightboxCredits,n=e.viewport.clientWidth,i=e.viewport.clientHeight;n!==e._lastViewportWidth&&(n<dPe?(t.className="cesium-credit-lightbox cesium-credit-lightbox-mobile",t.style.marginTop="0"):(t.className="cesium-credit-lightbox cesium-credit-lightbox-expanded",t.style.marginTop=`${Math.floor((i-t.clientHeight)*.5)}px`),e._lastViewportWidth=n),n>=dPe&&i!==e._lastViewportHeight&&(t.style.marginTop=`${Math.floor((i-t.clientHeight)*.5)}px`,e._lastViewportHeight=i)}function gPe(e){return function(t){t.key!=="Enter"&&t.key!==" "||(t.preventDefault(),t.stopPropagation(),e())}}function hvt(e){let t=` .cesium-credit-lightbox-overlay { display: none; z-index: 1; @@ -10085,19 +10085,19 @@ Url: ${e._contentHeader.uri}`,r++;let o={text:i.substring(1),position:n,font:`${ .cesium-credit-lightbox { background-color: #303336; - color: ${Tz}; + color: ${fU}; position: relative; - min-height: ${uMt}px; + min-height: ${lvt}px; margin: auto; } .cesium-credit-lightbox > ul > li a, .cesium-credit-lightbox > ul > li a:visited, .cesium-credit-wrapper a, .cesium-credit-wrapper a:visited { - color: ${Tz}; + color: ${fU}; } .cesium-credit-lightbox > ul > li a:hover { - color: ${Ez}; + color: ${dU}; } .cesium-credit-lightbox.cesium-credit-lightbox-expanded { border: 1px solid #444; @@ -10117,10 +10117,10 @@ Url: ${e._contentHeader.uri}`,r++;let o={text:i.substring(1),position:n,font:`${ position: absolute; top: 0; right: 6px; - color: ${Tz}; + color: ${fU}; } .cesium-credit-lightbox-close:hover { - color: ${Ez}; + color: ${dU}; } .cesium-credit-lightbox > ul { margin: 0; @@ -10139,20 +10139,20 @@ Url: ${e._contentHeader.uri}`,r++;let o={text:i.substring(1),position:n,font:`${ padding-left: 5px; cursor: pointer; text-decoration: underline; - color: ${Tz}; + color: ${fU}; } .cesium-credit-expand-link:hover { - color: ${Ez}; + color: ${dU}; } .cesium-credit-expand-link:focus-visible, .cesium-credit-lightbox-close:focus-visible { - outline: 2px solid ${Ez}; + outline: 2px solid ${dU}; outline-offset: 2px; } .cesium-credit-text { - color: ${Tz}; + color: ${fU}; } .cesium-credit-delimiter { @@ -10165,13 +10165,13 @@ Url: ${e._contentHeader.uri}`,r++;let o={text:i.substring(1),position:n,font:`${ } .cesium-credit-textContainer a:hover { - color: ${Ez} + color: ${dU} } .cesium-credit-textContainer .cesium-credit-wrapper:first-of-type { padding-left: 5px; } -`;function n(o){if(o.shadowRoot)return o.shadowRoot;if(o.getRootNode){let s=o.getRootNode();if(s instanceof ShadowRoot)return s}}let i=n(e)??document.head,r=document.createElement("style");r.innerHTML=t,i.appendChild(r)}function Jo(e,t,n){let i=this;n=n??document.body;let r=document.createElement("div");r.className="cesium-credit-lightbox-overlay",n.appendChild(r);let o=document.createElement("div");o.className="cesium-credit-lightbox",o.setAttribute("role","dialog"),o.setAttribute("aria-modal","true"),o.setAttribute("aria-label","Data attribution"),r.appendChild(o);function s(y){o.contains(y.target)||i.hideLightbox()}r.addEventListener("click",s,!1);function a(y){y.key==="Escape"&&(y.preventDefault(),i.hideLightbox())}r.addEventListener("keydown",a,!1);let c=document.createElement("div");c.className="cesium-credit-lightbox-title",c.textContent="Data provided by:",o.appendChild(c);let u=document.createElement("a");u.onclick=this.hideLightbox.bind(this),u.onkeydown=CNe(this.hideLightbox.bind(this)),u.innerHTML="×",u.className="cesium-credit-lightbox-close",u.setAttribute("role","button"),u.setAttribute("tabindex","0"),u.setAttribute("aria-label","Close data attribution"),o.appendChild(u);let f=document.createElement("ul");o.appendChild(f);let d=document.createElement("div");d.className="cesium-credit-logoContainer",d.style.display="inline",e.appendChild(d);let p=document.createElement("div");p.className="cesium-credit-textContainer",p.style.display="inline",e.appendChild(p);let g=document.createElement("a");g.className="cesium-credit-expand-link",g.onclick=this.showLightbox.bind(this),g.onkeydown=CNe(this.showLightbox.bind(this)),g.textContent="Data attribution",g.setAttribute("role","button"),g.setAttribute("tabindex","0"),g.setAttribute("aria-haspopup","dialog"),g.setAttribute("aria-expanded","false"),e.appendChild(g),mMt(e);let m=It.clone(Jo.cesiumCredit);this._delimiter=t??"\u2022",this._screenContainer=p,this._cesiumCreditContainer=d,this._lastViewportHeight=void 0,this._lastViewportWidth=void 0,this._lightboxCredits=o,this._creditList=f,this._lightbox=r,this._hideLightbox=s,this._hideLightboxOnEscape=a,this._expandLink=g,this._closeButton=u,this._expanded=!1,this._staticCredits=[],this._cesiumCredit=m,this._previousCesiumCredit=void 0,this._currentCesiumCredit=m,this._creditDisplayElementPool=[],this._creditDisplayElementIndex=0,this._currentFrameCredits={screenCredits:new Ut,lightboxCredits:new Ut},this._defaultCredit=void 0,this.viewport=n,this.container=e}function INe(e,t,n,i){i=i??1;let r=t.get(n.id);if(l(r))r.count<Number.MAX_VALUE&&(r.count+=i);else{let o=e._creditDisplayElementPool,s=e._creditDisplayElementPoolIndex;s<o.length?(r=o[s],r.credit=n,r.count=i):(r=new SNe(n,i),o.push(r)),++e._creditDisplayElementPoolIndex,t.set(n.id,r)}}Jo.prototype.addCreditToNextFrame=function(e){if(e.isIon()){l(this._defaultCredit)||(this._defaultCredit=It.clone(PNe())),this._currentCesiumCredit=this._defaultCredit;return}let t;e.showOnScreen?t=this._currentFrameCredits.screenCredits:t=this._currentFrameCredits.lightboxCredits,INe(this,t,e)};Jo.prototype.addStaticCredit=function(e){let t=this._staticCredits;fMt(t,e)||t.push(e)};Jo.prototype.removeStaticCredit=function(e){let t=this._staticCredits,n=t.indexOf(e);n!==-1&&t.splice(n,1)};Jo.prototype.showLightbox=function(){this._lightbox.style.display="block",this._expanded=!0,this._expandLink.setAttribute("aria-expanded","true"),this._closeButton.focus()};Jo.prototype.hideLightbox=function(){this._lightbox.style.display="none",this._expanded=!1,this._expandLink.setAttribute("aria-expanded","false"),this._expandLink.focus()};Jo.prototype.update=function(){this._expanded&&hMt(this)};Jo.prototype.beginFrame=function(){let e=this._currentFrameCredits;this._creditDisplayElementPoolIndex=0;let t=e.screenCredits,n=e.lightboxCredits;t.removeAll(),n.removeAll();let i=this._staticCredits;for(let r=0;r<i.length;++r){let o=i[r],s=o.showOnScreen?t:n;o.isIon()&&It.equals(Jo.cesiumCredit,this._cesiumCredit)||INe(this,s,o,Number.MAX_VALUE)}It.equals(Jo.cesiumCredit,this._cesiumCredit)||(this._cesiumCredit=It.clone(Jo.cesiumCredit)),this._currentCesiumCredit=this._cesiumCredit};Jo.prototype.endFrame=function(){let e=this._currentFrameCredits.screenCredits.values;ENe(this._screenContainer,e,this._delimiter,void 0);let t=this._currentFrameCredits.lightboxCredits.values;this._expandLink.style.display=t.length>0?"inline":"none",ENe(this._creditList,t,void 0,"li"),dMt(this)};Jo.prototype.destroy=function(){return this._lightbox.removeEventListener("click",this._hideLightbox,!1),this._lightbox.removeEventListener("keydown",this._hideLightboxOnEscape,!1),this.container.removeChild(this._cesiumCreditContainer),this.container.removeChild(this._screenContainer),this.container.removeChild(this._expandLink),this.viewport.removeChild(this._lightbox),le(this)};Jo.prototype.isDestroyed=function(){return!1};Jo._cesiumCredit=void 0;Jo._cesiumCreditInitialized=!1;var U7;function PNe(){if(!l(U7)){let e=Zt("Assets/Images/ion-credit.png");e.indexOf("http://")!==0&&e.indexOf("https://")!==0&&e.indexOf("data:")!==0&&(e=new vNe.default(e).path()),U7=new It(`<a href="https://cesium.com/" target="_blank"><img src="${e}" style="vertical-align: -7px" title="Cesium ion"/></a>`,!0)}return Jo._cesiumCreditInitialized||(Jo._cesiumCredit=U7,Jo._cesiumCreditInitialized=!0),U7}Object.defineProperties(Jo,{cesiumCredit:{get:function(){return PNe(),Jo._cesiumCredit},set:function(e){Jo._cesiumCredit=e,Jo._cesiumCreditInitialized=!0}}});Jo.CreditDisplayElement=SNe;var Cz=Jo;var z7=0,pMt=1;function nC(e){let t=e.frustum,n=e.orientation,i=e.origin,r=e.vertexFormat??Be.DEFAULT,o=e._drawNearPlane??!0,s,a;t instanceof Ji?(s=z7,a=Ji.packedLength):t instanceof gn&&(s=pMt,a=gn.packedLength),this._frustumType=s,this._frustum=t.clone(),this._origin=h.clone(i),this._orientation=Le.clone(n),this._drawNearPlane=o,this._vertexFormat=r,this._workerName="createFrustumGeometry",this.packedLength=2+a+h.packedLength+Le.packedLength+Be.packedLength}nC.pack=function(e,t,n){n=n??0;let i=e._frustumType,r=e._frustum;return t[n++]=i,i===z7?(Ji.pack(r,t,n),n+=Ji.packedLength):(gn.pack(r,t,n),n+=gn.packedLength),h.pack(e._origin,t,n),n+=h.packedLength,Le.pack(e._orientation,t,n),n+=Le.packedLength,Be.pack(e._vertexFormat,t,n),n+=Be.packedLength,t[n]=e._drawNearPlane?1:0,t};var gMt=new Ji,_Mt=new gn,yMt=new Le,AMt=new h,bMt=new Be;nC.unpack=function(e,t,n){t=t??0;let i=e[t++],r;i===z7?(r=Ji.unpack(e,t,gMt),t+=Ji.packedLength):(r=gn.unpack(e,t,_Mt),t+=gn.packedLength);let o=h.unpack(e,t,AMt);t+=h.packedLength;let s=Le.unpack(e,t,yMt);t+=Le.packedLength;let a=Be.unpack(e,t,bMt);t+=Be.packedLength;let c=e[t]===1;if(!l(n))return new nC({frustum:r,origin:o,orientation:s,vertexFormat:a,_drawNearPlane:c});let u=i===n._frustumType?n._frustum:void 0;return n._frustum=r.clone(u),n._frustumType=i,n._origin=h.clone(o,n._origin),n._orientation=Le.clone(s,n._orientation),n._vertexFormat=Be.clone(a,n._vertexFormat),n._drawNearPlane=c,n};function _P(e,t,n,i,r,o,s,a){let c=e/3*2;for(let u=0;u<4;++u)l(t)&&(t[e]=o.x,t[e+1]=o.y,t[e+2]=o.z),l(n)&&(n[e]=s.x,n[e+1]=s.y,n[e+2]=s.z),l(i)&&(i[e]=a.x,i[e+1]=a.y,i[e+2]=a.z),e+=3;r[c]=0,r[c+1]=0,r[c+2]=1,r[c+3]=0,r[c+4]=1,r[c+5]=1,r[c+6]=0,r[c+7]=1}var xMt=new $,TMt=new N,Poe=new N,DNe=new h,RNe=new h,ONe=new h,EMt=new h,CMt=new h,vMt=new h,Sb=new Array(3),vz=new Array(4);vz[0]=new se(-1,-1,1,1);vz[1]=new se(1,-1,1,1);vz[2]=new se(1,1,1,1);vz[3]=new se(-1,1,1,1);var MNe=new Array(4);for(let e=0;e<4;++e)MNe[e]=new se;nC._computeNearFarPlanes=function(e,t,n,i,r,o,s,a){let c=$.fromQuaternion(t,xMt),u=o??DNe,f=s??RNe,d=a??ONe;u=$.getColumn(c,0,u),f=$.getColumn(c,1,f),d=$.getColumn(c,2,d),h.normalize(u,u),h.normalize(f,f),h.normalize(d,d),h.negate(u,u);let p=N.computeView(e,d,f,u,TMt),g,m,y=i.projectionMatrix;if(n===z7){let A=N.multiply(y,p,Poe);m=N.inverse(A,Poe)}else g=N.inverseTransformation(p,Poe);l(m)?(Sb[0]=i.near,Sb[1]=i.far):(Sb[0]=0,Sb[1]=i.near,Sb[2]=i.far);for(let A=0;A<2;++A)for(let b=0;b<4;++b){let x=se.clone(vz[b],MNe[b]);if(l(m)){x=N.multiplyByVector(m,x,x);let T=1/x.w;h.multiplyByScalar(x,T,x),h.subtract(x,e,x),h.normalize(x,x);let E=h.dot(d,x);h.multiplyByScalar(x,Sb[A]/E,x),h.add(x,e,x)}else{let T=i.offCenterFrustum;l(T)&&(i=T);let E=Sb[A],v=Sb[A+1];x.x=(x.x*(i.right-i.left)+i.left+i.right)*.5,x.y=(x.y*(i.top-i.bottom)+i.bottom+i.top)*.5,x.z=(x.z*(E-v)-E-v)*.5,x.w=1,N.multiplyByVector(g,x,x)}r[12*A+b*3]=x.x,r[12*A+b*3+1]=x.y,r[12*A+b*3+2]=x.z}};nC.createGeometry=function(e){let t=e._frustumType,n=e._frustum,i=e._origin,r=e._orientation,o=e._drawNearPlane,s=e._vertexFormat,a=o?6:5,c=new Float64Array(72);nC._computeNearFarPlanes(i,r,t,n,c);let u=24;c[u]=c[12],c[u+1]=c[13],c[u+2]=c[14],c[u+3]=c[0],c[u+4]=c[1],c[u+5]=c[2],c[u+6]=c[9],c[u+7]=c[10],c[u+8]=c[11],c[u+9]=c[21],c[u+10]=c[22],c[u+11]=c[23],u+=12,c[u]=c[15],c[u+1]=c[16],c[u+2]=c[17],c[u+3]=c[3],c[u+4]=c[4],c[u+5]=c[5],c[u+6]=c[0],c[u+7]=c[1],c[u+8]=c[2],c[u+9]=c[12],c[u+10]=c[13],c[u+11]=c[14],u+=12,c[u]=c[3],c[u+1]=c[4],c[u+2]=c[5],c[u+3]=c[15],c[u+4]=c[16],c[u+5]=c[17],c[u+6]=c[18],c[u+7]=c[19],c[u+8]=c[20],c[u+9]=c[6],c[u+10]=c[7],c[u+11]=c[8],u+=12,c[u]=c[6],c[u+1]=c[7],c[u+2]=c[8],c[u+3]=c[18],c[u+4]=c[19],c[u+5]=c[20],c[u+6]=c[21],c[u+7]=c[22],c[u+8]=c[23],c[u+9]=c[9],c[u+10]=c[10],c[u+11]=c[11],o||(c=c.subarray(12));let f=new Tn({position:new Ne({componentDatatype:Y.DOUBLE,componentsPerAttribute:3,values:c})});if(l(s.normal)||l(s.tangent)||l(s.bitangent)||l(s.st)){let p=l(s.normal)?new Float32Array(12*a):void 0,g=l(s.tangent)?new Float32Array(12*a):void 0,m=l(s.bitangent)?new Float32Array(12*a):void 0,y=l(s.st)?new Float32Array(8*a):void 0,A=DNe,b=RNe,x=ONe,T=h.negate(A,EMt),E=h.negate(b,CMt),v=h.negate(x,vMt);u=0,o&&(_P(u,p,g,m,y,v,A,b),u+=12),_P(u,p,g,m,y,x,T,b),u+=12,_P(u,p,g,m,y,T,v,b),u+=12,_P(u,p,g,m,y,E,v,T),u+=12,_P(u,p,g,m,y,A,x,b),u+=12,_P(u,p,g,m,y,b,x,T),l(p)&&(f.normal=new Ne({componentDatatype:Y.FLOAT,componentsPerAttribute:3,values:p})),l(g)&&(f.tangent=new Ne({componentDatatype:Y.FLOAT,componentsPerAttribute:3,values:g})),l(m)&&(f.bitangent=new Ne({componentDatatype:Y.FLOAT,componentsPerAttribute:3,values:m})),l(y)&&(f.st=new Ne({componentDatatype:Y.FLOAT,componentsPerAttribute:2,values:y}))}let d=new Uint16Array(6*a);for(let p=0;p<a;++p){let g=p*6,m=p*4;d[g]=m,d[g+1]=m+1,d[g+2]=m+2,d[g+3]=m,d[g+4]=m+2,d[g+5]=m+3}return new St({attributes:f,indices:d,primitiveType:Oe.TRIANGLES,boundingSphere:ue.fromVertices(c)})};var iC=nC;var Doe=0,SMt=1;function Sz(e){let t=e.frustum,n=e.orientation,i=e.origin,r=e._drawNearPlane??!0,o,s;t instanceof Ji?(o=Doe,s=Ji.packedLength):t instanceof gn&&(o=SMt,s=gn.packedLength),this._frustumType=o,this._frustum=t.clone(),this._origin=h.clone(i),this._orientation=Le.clone(n),this._drawNearPlane=r,this._workerName="createFrustumOutlineGeometry",this.packedLength=2+s+h.packedLength+Le.packedLength}Sz.pack=function(e,t,n){n=n??0;let i=e._frustumType,r=e._frustum;return t[n++]=i,i===Doe?(Ji.pack(r,t,n),n+=Ji.packedLength):(gn.pack(r,t,n),n+=gn.packedLength),h.pack(e._origin,t,n),n+=h.packedLength,Le.pack(e._orientation,t,n),n+=Le.packedLength,t[n]=e._drawNearPlane?1:0,t};var wMt=new Ji,IMt=new gn,PMt=new Le,DMt=new h;Sz.unpack=function(e,t,n){t=t??0;let i=e[t++],r;i===Doe?(r=Ji.unpack(e,t,wMt),t+=Ji.packedLength):(r=gn.unpack(e,t,IMt),t+=gn.packedLength);let o=h.unpack(e,t,DMt);t+=h.packedLength;let s=Le.unpack(e,t,PMt);t+=Le.packedLength;let a=e[t]===1;if(!l(n))return new Sz({frustum:r,origin:o,orientation:s,_drawNearPlane:a});let c=i===n._frustumType?n._frustum:void 0;return n._frustum=r.clone(c),n._frustumType=i,n._origin=h.clone(o,n._origin),n._orientation=Le.clone(s,n._orientation),n._drawNearPlane=a,n};Sz.createGeometry=function(e){let t=e._frustumType,n=e._frustum,i=e._origin,r=e._orientation,o=e._drawNearPlane,s=new Float64Array(24);iC._computeNearFarPlanes(i,r,t,n,s);let a=new Tn({position:new Ne({componentDatatype:Y.DOUBLE,componentsPerAttribute:3,values:s})}),c,u,f=o?2:1,d=new Uint16Array(8*(f+1)),p=o?0:1;for(;p<2;++p)c=o?p*8:0,u=p*4,d[c]=u,d[c+1]=u+1,d[c+2]=u+1,d[c+3]=u+2,d[c+4]=u+2,d[c+5]=u+3,d[c+6]=u+3,d[c+7]=u;for(p=0;p<2;++p)c=(f+p)*8,u=p*4,d[c]=u,d[c+1]=u+4,d[c+2]=u+1,d[c+3]=u+5,d[c+4]=u+2,d[c+5]=u+6,d[c+6]=u+3,d[c+7]=u+7;return new St({attributes:a,indices:d,primitiveType:Oe.LINES,boundingSphere:ue.fromVertices(s)})};var wz=Sz;function V7(e){e=e??H.EMPTY_OBJECT,this._camera=e.camera,this._frustumSplits=e.frustumSplits,this._color=e.color??z.CYAN,this._updateOnChange=e.updateOnChange??!0,this.show=e.show??!0,this.id=e.id,this._id=void 0,this._outlinePrimitives=[],this._planesPrimitives=[]}var RMt=new h,OMt=new $,MMt=new Le,NMt=new Ji,LMt=new yu,FMt=new gn,BMt=new ys,kMt=new z,UMt=[1,1e5];V7.prototype.update=function(e){if(!this.show)return;let t=this._planesPrimitives,n=this._outlinePrimitives,i,r;if(this._updateOnChange){for(r=t.length,i=0;i<r;++i)n[i]=n[i]&&n[i].destroy(),t[i]=t[i]&&t[i].destroy();t.length=0,n.length=0}if(t.length===0){let o=this._camera,s=o.frustum,a;s instanceof Ji?a=NMt:s instanceof yu?a=LMt:s instanceof gn?a=FMt:a=BMt,a=s.clone(a);let c,u=this._frustumSplits;!l(u)||u.length<=1?(u=UMt,u[0]=this._camera.frustum.near,u[1]=this._camera.frustum.far,c=1):c=u.length-1;let f=o.positionWC,d=o.directionWC,p=o.upWC,g=o.rightWC;g=h.negate(g,RMt);let m=OMt;$.setColumn(m,0,g,m),$.setColumn(m,1,p,m),$.setColumn(m,2,d,m);let y=Le.fromRotationMatrix(m,MMt);for(t.length=n.length=c,i=0;i<c;++i)a.near=u[i],a.far=u[i+1],t[i]=new On({geometryInstances:new Ft({geometry:new iC({origin:f,orientation:y,frustum:a,_drawNearPlane:i===0}),attributes:{color:Jt.fromColor(z.fromAlpha(this._color,.1,kMt))},id:this.id,pickPrimitive:this}),appearance:new yn({translucent:!0,flat:!0}),asynchronous:!1}),n[i]=new On({geometryInstances:new Ft({geometry:new wz({origin:f,orientation:y,frustum:a,_drawNearPlane:i===0}),attributes:{color:Jt.fromColor(this._color)},id:this.id,pickPrimitive:this}),appearance:new yn({translucent:!1,flat:!0}),asynchronous:!1})}for(r=t.length,i=0;i<r;++i)n[i].update(e),t[i].update(e)};V7.prototype.isDestroyed=function(){return!1};V7.prototype.destroy=function(){let e=this._planesPrimitives.length;for(let t=0;t<e;++t)this._outlinePrimitives[t]=this._outlinePrimitives[t]&&this._outlinePrimitives[t].destroy(),this._planesPrimitives[t]=this._planesPrimitives[t]&&this._planesPrimitives[t].destroy();return le(this)};var F0=V7;function Pz(e){this._rs=void 0,this._sp=void 0,this._va=void 0,this._command=void 0,this._mode=void 0,this._useLogDepth=!1,this._ellipsoidOffset=e??0}var Iz=dn.supportsTypedArrays()?new Float32Array(12):[],NNe=new h,LNe=new h,Roe=new h,FNe=new h,j7=new h;function zMt(e,t){let n=e.radii,i=t.camera,r,o,s;if(i.frustum instanceof gn)r=h.ZERO,o=i.rightWC,s=i.upWC;else{let d=i.positionWC,p=h.multiplyComponents(e.oneOverRadii,d,NNe),g=h.normalize(p,LNe),m=h.normalize(h.cross(h.UNIT_Z,p,Roe),Roe),y=h.normalize(h.cross(g,m,FNe),FNe),A=h.magnitude(p),b=Math.sqrt(A*A-1);r=h.multiplyByScalar(g,1/A,NNe);let x=b/A;o=h.multiplyByScalar(m,x,LNe),s=h.multiplyByScalar(y,x,Roe)}let a=h.add(r,s,j7);h.subtract(a,o,a),h.multiplyComponents(n,a,a),h.pack(a,Iz,0);let c=h.subtract(r,s,j7);h.subtract(c,o,c),h.multiplyComponents(n,c,c),h.pack(c,Iz,3);let u=h.add(r,s,j7);h.add(u,o,u),h.multiplyComponents(n,u,u),h.pack(u,Iz,6);let f=h.subtract(r,s,j7);return h.add(f,o,f),h.multiplyComponents(n,f,f),h.pack(f,Iz,9),Iz}Pz.prototype.update=function(e){if(this._mode=e.mode,e.mode!==re.SCENE3D)return;let t=e.context,n=e.mapProjection.ellipsoid.radii,i=new ee(n.x+this._ellipsoidOffset,n.y+this._ellipsoidOffset,n.z+this._ellipsoidOffset),r=e.useLogDepth;if(l(this._command)||(this._rs=Ge.fromCache({cull:{enabled:!0},depthTest:{enabled:!0},colorMask:{red:!1,green:!1,blue:!1,alpha:!1}}),this._command=new at({renderState:this._rs,boundingVolume:new ue(h.ZERO,i.maximumRadius),pass:Ie.OPAQUE,owner:this})),!l(this._sp)||this._useLogDepth!==r){this._useLogDepth=r;let s=new Ye({sources:[rM]}),a=new Ye({sources:[iM]});r&&(a.defines.push("LOG_DEPTH"),s.defines.push("LOG_DEPTH")),this._sp=Qt.replaceCache({shaderProgram:this._sp,context:t,vertexShaderSource:s,fragmentShaderSource:a,attributeLocations:{position:0}}),this._command.shaderProgram=this._sp}let o=zMt(i,e);if(l(this._va))this._va.getAttribute(0).vertexBuffer.copyFromArrayView(o);else{let s=new St({attributes:{position:new Ne({componentDatatype:Y.FLOAT,componentsPerAttribute:3,values:o})},indices:[0,1,2,2,1,3],primitiveType:Oe.TRIANGLES});this._va=zn.fromGeometry({context:t,geometry:s,attributeLocations:{position:0},bufferUsage:Me.DYNAMIC_DRAW}),this._command.vertexArray=this._va}};Pz.prototype.execute=function(e,t){this._mode===re.SCENE3D&&this._command.execute(e,t)};Pz.prototype.isDestroyed=function(){return!1};Pz.prototype.destroy=function(){this._sp=this._sp&&this._sp.destroy(),this._va=this._va&&this._va.destroy()};var Dz=Pz;function rC(){}var VMt=/\bgl_FragDepth\b/,jMt=/\bdiscard\b/;function HMt(e,t){let n=e.shaderCache.getDerivedShaderProgram(t,"depthOnly");if(l(n))return n;let i=t.fragmentShaderSource,r=!1,o=i.sources;for(let a=0;a<o.length;++a)if(VMt.test(o[a])||jMt.test(o[a])){r=!0;break}let s=i.defines.indexOf("LOG_DEPTH")>=0;if(!r&&!s){let a=`void main() +`;function n(o){if(o.shadowRoot)return o.shadowRoot;if(o.getRootNode){let s=o.getRootNode();if(s instanceof ShadowRoot)return s}}let i=n(e)??document.head,r=document.createElement("style");r.innerHTML=t,i.appendChild(r)}function $o(e,t,n){let i=this;n=n??document.body;let r=document.createElement("div");r.className="cesium-credit-lightbox-overlay",n.appendChild(r);let o=document.createElement("div");o.className="cesium-credit-lightbox",o.setAttribute("role","dialog"),o.setAttribute("aria-modal","true"),o.setAttribute("aria-label","Data attribution"),r.appendChild(o);function s(y){o.contains(y.target)||i.hideLightbox()}r.addEventListener("click",s,!1);function a(y){y.key==="Escape"&&(y.preventDefault(),i.hideLightbox())}r.addEventListener("keydown",a,!1);let c=document.createElement("div");c.className="cesium-credit-lightbox-title",c.textContent="Data provided by:",o.appendChild(c);let u=document.createElement("a");u.onclick=this.hideLightbox.bind(this),u.onkeydown=gPe(this.hideLightbox.bind(this)),u.innerHTML="×",u.className="cesium-credit-lightbox-close",u.setAttribute("role","button"),u.setAttribute("tabindex","0"),u.setAttribute("aria-label","Close data attribution"),o.appendChild(u);let f=document.createElement("ul");o.appendChild(f);let d=document.createElement("div");d.className="cesium-credit-logoContainer",d.style.display="inline",e.appendChild(d);let p=document.createElement("div");p.className="cesium-credit-textContainer",p.style.display="inline",e.appendChild(p);let g=document.createElement("a");g.className="cesium-credit-expand-link",g.onclick=this.showLightbox.bind(this),g.onkeydown=gPe(this.showLightbox.bind(this)),g.textContent="Data attribution",g.setAttribute("role","button"),g.setAttribute("tabindex","0"),g.setAttribute("aria-haspopup","dialog"),g.setAttribute("aria-expanded","false"),e.appendChild(g),hvt(e);let m=It.clone($o.cesiumCredit);this._delimiter=t??"\u2022",this._screenContainer=p,this._cesiumCreditContainer=d,this._lastViewportHeight=void 0,this._lastViewportWidth=void 0,this._lightboxCredits=o,this._creditList=f,this._lightbox=r,this._hideLightbox=s,this._hideLightboxOnEscape=a,this._expandLink=g,this._closeButton=u,this._expanded=!1,this._staticCredits=[],this._cesiumCredit=m,this._previousCesiumCredit=void 0,this._currentCesiumCredit=m,this._creditDisplayElementPool=[],this._creditDisplayElementIndex=0,this._currentFrameCredits={screenCredits:new Ut,lightboxCredits:new Ut},this._defaultCredit=void 0,this.viewport=n,this.container=e}function bPe(e,t,n,i){i=i??1;let r=t.get(n.id);if(l(r))r.count<Number.MAX_VALUE&&(r.count+=i);else{let o=e._creditDisplayElementPool,s=e._creditDisplayElementPoolIndex;s<o.length?(r=o[s],r.credit=n,r.count=i):(r=new yPe(n,i),o.push(r)),++e._creditDisplayElementPoolIndex,t.set(n.id,r)}}$o.prototype.addCreditToNextFrame=function(e){if(e.isIon()){l(this._defaultCredit)||(this._defaultCredit=It.clone(xPe())),this._currentCesiumCredit=this._defaultCredit;return}let t;e.showOnScreen?t=this._currentFrameCredits.screenCredits:t=this._currentFrameCredits.lightboxCredits,bPe(this,t,e)};$o.prototype.addStaticCredit=function(e){let t=this._staticCredits;uvt(t,e)||t.push(e)};$o.prototype.removeStaticCredit=function(e){let t=this._staticCredits,n=t.indexOf(e);n!==-1&&t.splice(n,1)};$o.prototype.showLightbox=function(){this._lightbox.style.display="block",this._expanded=!0,this._expandLink.setAttribute("aria-expanded","true"),this._closeButton.focus()};$o.prototype.hideLightbox=function(){this._lightbox.style.display="none",this._expanded=!1,this._expandLink.setAttribute("aria-expanded","false"),this._expandLink.focus()};$o.prototype.update=function(){this._expanded&&dvt(this)};$o.prototype.beginFrame=function(){let e=this._currentFrameCredits;this._creditDisplayElementPoolIndex=0;let t=e.screenCredits,n=e.lightboxCredits;t.removeAll(),n.removeAll();let i=this._staticCredits;for(let r=0;r<i.length;++r){let o=i[r],s=o.showOnScreen?t:n;o.isIon()&&It.equals($o.cesiumCredit,this._cesiumCredit)||bPe(this,s,o,Number.MAX_VALUE)}It.equals($o.cesiumCredit,this._cesiumCredit)||(this._cesiumCredit=It.clone($o.cesiumCredit)),this._currentCesiumCredit=this._cesiumCredit};$o.prototype.endFrame=function(){let e=this._currentFrameCredits.screenCredits.values;pPe(this._screenContainer,e,this._delimiter,void 0);let t=this._currentFrameCredits.lightboxCredits.values;this._expandLink.style.display=t.length>0?"inline":"none",pPe(this._creditList,t,void 0,"li"),fvt(this)};$o.prototype.destroy=function(){return this._lightbox.removeEventListener("click",this._hideLightbox,!1),this._lightbox.removeEventListener("keydown",this._hideLightboxOnEscape,!1),this.container.removeChild(this._cesiumCreditContainer),this.container.removeChild(this._screenContainer),this.container.removeChild(this._expandLink),this.viewport.removeChild(this._lightbox),le(this)};$o.prototype.isDestroyed=function(){return!1};$o._cesiumCredit=void 0;$o._cesiumCreditInitialized=!1;var I5;function xPe(){if(!l(I5)){let e=Zt("Assets/Images/ion-credit.png");e.indexOf("http://")!==0&&e.indexOf("https://")!==0&&e.indexOf("data:")!==0&&(e=new _Pe.default(e).path()),I5=new It(`<a href="https://cesium.com/" target="_blank"><img src="${e}" style="vertical-align: -7px" title="Cesium ion"/></a>`,!0)}return $o._cesiumCreditInitialized||($o._cesiumCredit=I5,$o._cesiumCreditInitialized=!0),I5}Object.defineProperties($o,{cesiumCredit:{get:function(){return xPe(),$o._cesiumCredit},set:function(e){$o._cesiumCredit=e,$o._cesiumCreditInitialized=!0}}});$o.CreditDisplayElement=yPe;var hU=$o;var P5=0,mvt=1;function vE(e){let t=e.frustum,n=e.orientation,i=e.origin,r=e.vertexFormat??Be.DEFAULT,o=e._drawNearPlane??!0,s,a;t instanceof $i?(s=P5,a=$i.packedLength):t instanceof gn&&(s=mvt,a=gn.packedLength),this._frustumType=s,this._frustum=t.clone(),this._origin=h.clone(i),this._orientation=Le.clone(n),this._drawNearPlane=o,this._vertexFormat=r,this._workerName="createFrustumGeometry",this.packedLength=2+a+h.packedLength+Le.packedLength+Be.packedLength}vE.pack=function(e,t,n){n=n??0;let i=e._frustumType,r=e._frustum;return t[n++]=i,i===P5?($i.pack(r,t,n),n+=$i.packedLength):(gn.pack(r,t,n),n+=gn.packedLength),h.pack(e._origin,t,n),n+=h.packedLength,Le.pack(e._orientation,t,n),n+=Le.packedLength,Be.pack(e._vertexFormat,t,n),n+=Be.packedLength,t[n]=e._drawNearPlane?1:0,t};var pvt=new $i,gvt=new gn,_vt=new Le,yvt=new h,Avt=new Be;vE.unpack=function(e,t,n){t=t??0;let i=e[t++],r;i===P5?(r=$i.unpack(e,t,pvt),t+=$i.packedLength):(r=gn.unpack(e,t,gvt),t+=gn.packedLength);let o=h.unpack(e,t,yvt);t+=h.packedLength;let s=Le.unpack(e,t,_vt);t+=Le.packedLength;let a=Be.unpack(e,t,Avt);t+=Be.packedLength;let c=e[t]===1;if(!l(n))return new vE({frustum:r,origin:o,orientation:s,vertexFormat:a,_drawNearPlane:c});let u=i===n._frustumType?n._frustum:void 0;return n._frustum=r.clone(u),n._frustumType=i,n._origin=h.clone(o,n._origin),n._orientation=Le.clone(s,n._orientation),n._vertexFormat=Be.clone(a,n._vertexFormat),n._drawNearPlane=c,n};function dI(e,t,n,i,r,o,s,a){let c=e/3*2;for(let u=0;u<4;++u)l(t)&&(t[e]=o.x,t[e+1]=o.y,t[e+2]=o.z),l(n)&&(n[e]=s.x,n[e+1]=s.y,n[e+2]=s.z),l(i)&&(i[e]=a.x,i[e+1]=a.y,i[e+2]=a.z),e+=3;r[c]=0,r[c+1]=0,r[c+2]=1,r[c+3]=0,r[c+4]=1,r[c+5]=1,r[c+6]=0,r[c+7]=1}var bvt=new $,xvt=new N,nne=new N,TPe=new h,EPe=new h,CPe=new h,Tvt=new h,Evt=new h,Cvt=new h,ob=new Array(3),mU=new Array(4);mU[0]=new se(-1,-1,1,1);mU[1]=new se(1,-1,1,1);mU[2]=new se(1,1,1,1);mU[3]=new se(-1,1,1,1);var vPe=new Array(4);for(let e=0;e<4;++e)vPe[e]=new se;vE._computeNearFarPlanes=function(e,t,n,i,r,o,s,a){let c=$.fromQuaternion(t,bvt),u=o??TPe,f=s??EPe,d=a??CPe;u=$.getColumn(c,0,u),f=$.getColumn(c,1,f),d=$.getColumn(c,2,d),h.normalize(u,u),h.normalize(f,f),h.normalize(d,d),h.negate(u,u);let p=N.computeView(e,d,f,u,xvt),g,m,y=i.projectionMatrix;if(n===P5){let A=N.multiply(y,p,nne);m=N.inverse(A,nne)}else g=N.inverseTransformation(p,nne);l(m)?(ob[0]=i.near,ob[1]=i.far):(ob[0]=0,ob[1]=i.near,ob[2]=i.far);for(let A=0;A<2;++A)for(let b=0;b<4;++b){let x=se.clone(mU[b],vPe[b]);if(l(m)){x=N.multiplyByVector(m,x,x);let T=1/x.w;h.multiplyByScalar(x,T,x),h.subtract(x,e,x),h.normalize(x,x);let E=h.dot(d,x);h.multiplyByScalar(x,ob[A]/E,x),h.add(x,e,x)}else{let T=i.offCenterFrustum;l(T)&&(i=T);let E=ob[A],v=ob[A+1];x.x=(x.x*(i.right-i.left)+i.left+i.right)*.5,x.y=(x.y*(i.top-i.bottom)+i.bottom+i.top)*.5,x.z=(x.z*(E-v)-E-v)*.5,x.w=1,N.multiplyByVector(g,x,x)}r[12*A+b*3]=x.x,r[12*A+b*3+1]=x.y,r[12*A+b*3+2]=x.z}};vE.createGeometry=function(e){let t=e._frustumType,n=e._frustum,i=e._origin,r=e._orientation,o=e._drawNearPlane,s=e._vertexFormat,a=o?6:5,c=new Float64Array(72);vE._computeNearFarPlanes(i,r,t,n,c);let u=24;c[u]=c[12],c[u+1]=c[13],c[u+2]=c[14],c[u+3]=c[0],c[u+4]=c[1],c[u+5]=c[2],c[u+6]=c[9],c[u+7]=c[10],c[u+8]=c[11],c[u+9]=c[21],c[u+10]=c[22],c[u+11]=c[23],u+=12,c[u]=c[15],c[u+1]=c[16],c[u+2]=c[17],c[u+3]=c[3],c[u+4]=c[4],c[u+5]=c[5],c[u+6]=c[0],c[u+7]=c[1],c[u+8]=c[2],c[u+9]=c[12],c[u+10]=c[13],c[u+11]=c[14],u+=12,c[u]=c[3],c[u+1]=c[4],c[u+2]=c[5],c[u+3]=c[15],c[u+4]=c[16],c[u+5]=c[17],c[u+6]=c[18],c[u+7]=c[19],c[u+8]=c[20],c[u+9]=c[6],c[u+10]=c[7],c[u+11]=c[8],u+=12,c[u]=c[6],c[u+1]=c[7],c[u+2]=c[8],c[u+3]=c[18],c[u+4]=c[19],c[u+5]=c[20],c[u+6]=c[21],c[u+7]=c[22],c[u+8]=c[23],c[u+9]=c[9],c[u+10]=c[10],c[u+11]=c[11],o||(c=c.subarray(12));let f=new Tn({position:new Ne({componentDatatype:Y.DOUBLE,componentsPerAttribute:3,values:c})});if(l(s.normal)||l(s.tangent)||l(s.bitangent)||l(s.st)){let p=l(s.normal)?new Float32Array(12*a):void 0,g=l(s.tangent)?new Float32Array(12*a):void 0,m=l(s.bitangent)?new Float32Array(12*a):void 0,y=l(s.st)?new Float32Array(8*a):void 0,A=TPe,b=EPe,x=CPe,T=h.negate(A,Tvt),E=h.negate(b,Evt),v=h.negate(x,Cvt);u=0,o&&(dI(u,p,g,m,y,v,A,b),u+=12),dI(u,p,g,m,y,x,T,b),u+=12,dI(u,p,g,m,y,T,v,b),u+=12,dI(u,p,g,m,y,E,v,T),u+=12,dI(u,p,g,m,y,A,x,b),u+=12,dI(u,p,g,m,y,b,x,T),l(p)&&(f.normal=new Ne({componentDatatype:Y.FLOAT,componentsPerAttribute:3,values:p})),l(g)&&(f.tangent=new Ne({componentDatatype:Y.FLOAT,componentsPerAttribute:3,values:g})),l(m)&&(f.bitangent=new Ne({componentDatatype:Y.FLOAT,componentsPerAttribute:3,values:m})),l(y)&&(f.st=new Ne({componentDatatype:Y.FLOAT,componentsPerAttribute:2,values:y}))}let d=new Uint16Array(6*a);for(let p=0;p<a;++p){let g=p*6,m=p*4;d[g]=m,d[g+1]=m+1,d[g+2]=m+2,d[g+3]=m,d[g+4]=m+2,d[g+5]=m+3}return new St({attributes:f,indices:d,primitiveType:Oe.TRIANGLES,boundingSphere:ue.fromVertices(c)})};var SE=vE;var ine=0,vvt=1;function pU(e){let t=e.frustum,n=e.orientation,i=e.origin,r=e._drawNearPlane??!0,o,s;t instanceof $i?(o=ine,s=$i.packedLength):t instanceof gn&&(o=vvt,s=gn.packedLength),this._frustumType=o,this._frustum=t.clone(),this._origin=h.clone(i),this._orientation=Le.clone(n),this._drawNearPlane=r,this._workerName="createFrustumOutlineGeometry",this.packedLength=2+s+h.packedLength+Le.packedLength}pU.pack=function(e,t,n){n=n??0;let i=e._frustumType,r=e._frustum;return t[n++]=i,i===ine?($i.pack(r,t,n),n+=$i.packedLength):(gn.pack(r,t,n),n+=gn.packedLength),h.pack(e._origin,t,n),n+=h.packedLength,Le.pack(e._orientation,t,n),n+=Le.packedLength,t[n]=e._drawNearPlane?1:0,t};var Svt=new $i,wvt=new gn,Ivt=new Le,Pvt=new h;pU.unpack=function(e,t,n){t=t??0;let i=e[t++],r;i===ine?(r=$i.unpack(e,t,Svt),t+=$i.packedLength):(r=gn.unpack(e,t,wvt),t+=gn.packedLength);let o=h.unpack(e,t,Pvt);t+=h.packedLength;let s=Le.unpack(e,t,Ivt);t+=Le.packedLength;let a=e[t]===1;if(!l(n))return new pU({frustum:r,origin:o,orientation:s,_drawNearPlane:a});let c=i===n._frustumType?n._frustum:void 0;return n._frustum=r.clone(c),n._frustumType=i,n._origin=h.clone(o,n._origin),n._orientation=Le.clone(s,n._orientation),n._drawNearPlane=a,n};pU.createGeometry=function(e){let t=e._frustumType,n=e._frustum,i=e._origin,r=e._orientation,o=e._drawNearPlane,s=new Float64Array(24);SE._computeNearFarPlanes(i,r,t,n,s);let a=new Tn({position:new Ne({componentDatatype:Y.DOUBLE,componentsPerAttribute:3,values:s})}),c,u,f=o?2:1,d=new Uint16Array(8*(f+1)),p=o?0:1;for(;p<2;++p)c=o?p*8:0,u=p*4,d[c]=u,d[c+1]=u+1,d[c+2]=u+1,d[c+3]=u+2,d[c+4]=u+2,d[c+5]=u+3,d[c+6]=u+3,d[c+7]=u;for(p=0;p<2;++p)c=(f+p)*8,u=p*4,d[c]=u,d[c+1]=u+4,d[c+2]=u+1,d[c+3]=u+5,d[c+4]=u+2,d[c+5]=u+6,d[c+6]=u+3,d[c+7]=u+7;return new St({attributes:a,indices:d,primitiveType:Oe.LINES,boundingSphere:ue.fromVertices(s)})};var gU=pU;function D5(e){e=e??H.EMPTY_OBJECT,this._camera=e.camera,this._frustumSplits=e.frustumSplits,this._color=e.color??z.CYAN,this._updateOnChange=e.updateOnChange??!0,this.show=e.show??!0,this.id=e.id,this._id=void 0,this._outlinePrimitives=[],this._planesPrimitives=[]}var Dvt=new h,Rvt=new $,Ovt=new Le,Mvt=new $i,Nvt=new mu,Lvt=new gn,Fvt=new ys,Bvt=new z,kvt=[1,1e5];D5.prototype.update=function(e){if(!this.show)return;let t=this._planesPrimitives,n=this._outlinePrimitives,i,r;if(this._updateOnChange){for(r=t.length,i=0;i<r;++i)n[i]=n[i]&&n[i].destroy(),t[i]=t[i]&&t[i].destroy();t.length=0,n.length=0}if(t.length===0){let o=this._camera,s=o.frustum,a;s instanceof $i?a=Mvt:s instanceof mu?a=Nvt:s instanceof gn?a=Lvt:a=Fvt,a=s.clone(a);let c,u=this._frustumSplits;!l(u)||u.length<=1?(u=kvt,u[0]=this._camera.frustum.near,u[1]=this._camera.frustum.far,c=1):c=u.length-1;let f=o.positionWC,d=o.directionWC,p=o.upWC,g=o.rightWC;g=h.negate(g,Dvt);let m=Rvt;$.setColumn(m,0,g,m),$.setColumn(m,1,p,m),$.setColumn(m,2,d,m);let y=Le.fromRotationMatrix(m,Ovt);for(t.length=n.length=c,i=0;i<c;++i)a.near=u[i],a.far=u[i+1],t[i]=new On({geometryInstances:new Ft({geometry:new SE({origin:f,orientation:y,frustum:a,_drawNearPlane:i===0}),attributes:{color:Jt.fromColor(z.fromAlpha(this._color,.1,Bvt))},id:this.id,pickPrimitive:this}),appearance:new yn({translucent:!0,flat:!0}),asynchronous:!1}),n[i]=new On({geometryInstances:new Ft({geometry:new gU({origin:f,orientation:y,frustum:a,_drawNearPlane:i===0}),attributes:{color:Jt.fromColor(this._color)},id:this.id,pickPrimitive:this}),appearance:new yn({translucent:!1,flat:!0}),asynchronous:!1})}for(r=t.length,i=0;i<r;++i)n[i].update(e),t[i].update(e)};D5.prototype.isDestroyed=function(){return!1};D5.prototype.destroy=function(){let e=this._planesPrimitives.length;for(let t=0;t<e;++t)this._outlinePrimitives[t]=this._outlinePrimitives[t]&&this._outlinePrimitives[t].destroy(),this._planesPrimitives[t]=this._planesPrimitives[t]&&this._planesPrimitives[t].destroy();return le(this)};var E0=D5;function yU(e){this._rs=void 0,this._sp=void 0,this._va=void 0,this._command=void 0,this._mode=void 0,this._useLogDepth=!1,this._ellipsoidOffset=e??0}var _U=dn.supportsTypedArrays()?new Float32Array(12):[],SPe=new h,wPe=new h,rne=new h,IPe=new h,R5=new h;function Uvt(e,t){let n=e.radii,i=t.camera,r,o,s;if(i.frustum instanceof gn)r=h.ZERO,o=i.rightWC,s=i.upWC;else{let d=i.positionWC,p=h.multiplyComponents(e.oneOverRadii,d,SPe),g=h.normalize(p,wPe),m=h.normalize(h.cross(h.UNIT_Z,p,rne),rne),y=h.normalize(h.cross(g,m,IPe),IPe),A=h.magnitude(p),b=Math.sqrt(A*A-1);r=h.multiplyByScalar(g,1/A,SPe);let x=b/A;o=h.multiplyByScalar(m,x,wPe),s=h.multiplyByScalar(y,x,rne)}let a=h.add(r,s,R5);h.subtract(a,o,a),h.multiplyComponents(n,a,a),h.pack(a,_U,0);let c=h.subtract(r,s,R5);h.subtract(c,o,c),h.multiplyComponents(n,c,c),h.pack(c,_U,3);let u=h.add(r,s,R5);h.add(u,o,u),h.multiplyComponents(n,u,u),h.pack(u,_U,6);let f=h.subtract(r,s,R5);return h.add(f,o,f),h.multiplyComponents(n,f,f),h.pack(f,_U,9),_U}yU.prototype.update=function(e){if(this._mode=e.mode,e.mode!==re.SCENE3D)return;let t=e.context,n=e.mapProjection.ellipsoid.radii,i=new ee(n.x+this._ellipsoidOffset,n.y+this._ellipsoidOffset,n.z+this._ellipsoidOffset),r=e.useLogDepth;if(l(this._command)||(this._rs=Ge.fromCache({cull:{enabled:!0},depthTest:{enabled:!0},colorMask:{red:!1,green:!1,blue:!1,alpha:!1}}),this._command=new at({renderState:this._rs,boundingVolume:new ue(h.ZERO,i.maximumRadius),pass:Ie.OPAQUE,owner:this})),!l(this._sp)||this._useLogDepth!==r){this._useLogDepth=r;let s=new Ye({sources:[rM]}),a=new Ye({sources:[iM]});r&&(a.defines.push("LOG_DEPTH"),s.defines.push("LOG_DEPTH")),this._sp=Qt.replaceCache({shaderProgram:this._sp,context:t,vertexShaderSource:s,fragmentShaderSource:a,attributeLocations:{position:0}}),this._command.shaderProgram=this._sp}let o=Uvt(i,e);if(l(this._va))this._va.getAttribute(0).vertexBuffer.copyFromArrayView(o);else{let s=new St({attributes:{position:new Ne({componentDatatype:Y.FLOAT,componentsPerAttribute:3,values:o})},indices:[0,1,2,2,1,3],primitiveType:Oe.TRIANGLES});this._va=zn.fromGeometry({context:t,geometry:s,attributeLocations:{position:0},bufferUsage:Me.DYNAMIC_DRAW}),this._command.vertexArray=this._va}};yU.prototype.execute=function(e,t){this._mode===re.SCENE3D&&this._command.execute(e,t)};yU.prototype.isDestroyed=function(){return!1};yU.prototype.destroy=function(){this._sp=this._sp&&this._sp.destroy(),this._va=this._va&&this._va.destroy()};var AU=yU;function wE(){}var zvt=/\bgl_FragDepth\b/,Vvt=/\bdiscard\b/;function jvt(e,t){let n=e.shaderCache.getDerivedShaderProgram(t,"depthOnly");if(l(n))return n;let i=t.fragmentShaderSource,r=!1,o=i.sources;for(let a=0;a<o.length;++a)if(zvt.test(o[a])||Vvt.test(o[a])){r=!0;break}let s=i.defines.indexOf("LOG_DEPTH")>=0;if(!r&&!s){let a=`void main() { out_FragColor = vec4(1.0); } @@ -10180,32 +10180,32 @@ Url: ${e._contentHeader.uri}`,r++;let o={text:i.substring(1),position:n,font:`${ out_FragColor = vec4(1.0); czm_writeLogDepth(); } -`;i=new Ye({defines:["LOG_DEPTH"],sources:[a]})}return e.shaderCache.createDerivedShaderProgram(t,"depthOnly",{vertexShaderSource:t.vertexShaderSource,fragmentShaderSource:i,attributeLocations:t._attributeLocations})}function GMt(e,t){let n=e._depthOnlyRenderStateCache,i=n[t.id];if(l(i))return i;let r=Ge.getState(t);r.depthMask=!0,r.colorMask={red:!1,green:!1,blue:!1,alpha:!1};let o=Ge.fromCache(r);return n[t.id]=o,o}rC.createDepthOnlyDerivedCommand=function(e,t,n,i){l(i)||(i={});let r=i.depthOnlyCommand?.shaderProgram,o=i.depthOnlyCommand?.renderState;return i.depthOnlyCommand=at.shallowClone(t,i.depthOnlyCommand),!l(r)||i.shaderProgramId!==t.shaderProgram.id?(i.depthOnlyCommand.shaderProgram=HMt(n,t.shaderProgram),i.depthOnlyCommand.renderState=GMt(e,t.renderState),i.shaderProgramId=t.shaderProgram.id):(i.depthOnlyCommand.shaderProgram=r,i.depthOnlyCommand.renderState=o),i};var WMt=/\s+czm_writeLogDepth\(/,qMt=/\s+czm_vertexLogDepth\(/;function YMt(e,t){if(t.fragmentShaderSource.defines.indexOf("LOG_DEPTH_READ_ONLY")>=0)return t;let i=e.shaderCache.getDerivedShaderProgram(t,"logDepth");if(l(i))return i;let r=t._attributeLocations,o=t.vertexShaderSource.clone(),s=t.fragmentShaderSource.clone();o.defines=l(o.defines)?o.defines.slice(0):[],o.defines.push("LOG_DEPTH"),s.defines=l(s.defines)?s.defines.slice(0):[],s.defines.push("LOG_DEPTH");let a=!1,c=o.sources;for(let f=0;f<c.length;++f)if(qMt.test(c[f])){a=!0;break}if(!a){for(let d=0;d<c.length;++d)c[d]=Ye.replaceMain(c[d],"czm_log_depth_main");c.push(` +`;i=new Ye({defines:["LOG_DEPTH"],sources:[a]})}return e.shaderCache.createDerivedShaderProgram(t,"depthOnly",{vertexShaderSource:t.vertexShaderSource,fragmentShaderSource:i,attributeLocations:t._attributeLocations})}function Hvt(e,t){let n=e._depthOnlyRenderStateCache,i=n[t.id];if(l(i))return i;let r=Ge.getState(t);r.depthMask=!0,r.colorMask={red:!1,green:!1,blue:!1,alpha:!1};let o=Ge.fromCache(r);return n[t.id]=o,o}wE.createDepthOnlyDerivedCommand=function(e,t,n,i){l(i)||(i={});let r=i.depthOnlyCommand?.shaderProgram,o=i.depthOnlyCommand?.renderState;return i.depthOnlyCommand=at.shallowClone(t,i.depthOnlyCommand),!l(r)||i.shaderProgramId!==t.shaderProgram.id?(i.depthOnlyCommand.shaderProgram=jvt(n,t.shaderProgram),i.depthOnlyCommand.renderState=Hvt(e,t.renderState),i.shaderProgramId=t.shaderProgram.id):(i.depthOnlyCommand.shaderProgram=r,i.depthOnlyCommand.renderState=o),i};var Gvt=/\s+czm_writeLogDepth\(/,Wvt=/\s+czm_vertexLogDepth\(/;function qvt(e,t){if(t.fragmentShaderSource.defines.indexOf("LOG_DEPTH_READ_ONLY")>=0)return t;let i=e.shaderCache.getDerivedShaderProgram(t,"logDepth");if(l(i))return i;let r=t._attributeLocations,o=t.vertexShaderSource.clone(),s=t.fragmentShaderSource.clone();o.defines=l(o.defines)?o.defines.slice(0):[],o.defines.push("LOG_DEPTH"),s.defines=l(s.defines)?s.defines.slice(0):[],s.defines.push("LOG_DEPTH");let a=!1,c=o.sources;for(let f=0;f<c.length;++f)if(Wvt.test(c[f])){a=!0;break}if(!a){for(let d=0;d<c.length;++d)c[d]=Ye.replaceMain(c[d],"czm_log_depth_main");c.push(` void main() { czm_log_depth_main(); czm_vertexLogDepth(); } -`)}c=s.sources,a=!1;for(let f=0;f<c.length;++f)WMt.test(c[f])&&(a=!0);s.defines.indexOf("LOG_DEPTH_WRITE")!==-1&&(a=!0);let u="";if(!a){for(let f=0;f<c.length;f++)c[f]=Ye.replaceMain(c[f],"czm_log_depth_main");u=` +`)}c=s.sources,a=!1;for(let f=0;f<c.length;++f)Gvt.test(c[f])&&(a=!0);s.defines.indexOf("LOG_DEPTH_WRITE")!==-1&&(a=!0);let u="";if(!a){for(let f=0;f<c.length;f++)c[f]=Ye.replaceMain(c[f],"czm_log_depth_main");u=` void main() { czm_log_depth_main(); czm_writeLogDepth(); } -`}return c.push(u),e.shaderCache.createDerivedShaderProgram(t,"logDepth",{vertexShaderSource:o,fragmentShaderSource:s,attributeLocations:r})}rC.createLogDepthCommand=function(e,t,n){l(n)||(n={});let i=n.command?.shaderProgram;return n.command=at.shallowClone(e,n.command),!l(i)||n.shaderProgramId!==e.shaderProgram.id?(n.command.shaderProgram=YMt(t,e.shaderProgram),n.shaderProgramId=e.shaderProgram.id):n.command.shaderProgram=i,n};function XMt(e,t,n){let i=e.shaderCache.getDerivedShaderProgram(t,"pick");if(l(i))return i;let r=t._attributeLocations,{sources:o,defines:s}=t.fragmentShaderSource,c=o.some(g=>g.includes("out_FragData"))?"out_FragData_0":"out_FragColor",u=`void main () +`}return c.push(u),e.shaderCache.createDerivedShaderProgram(t,"logDepth",{vertexShaderSource:o,fragmentShaderSource:s,attributeLocations:r})}wE.createLogDepthCommand=function(e,t,n){l(n)||(n={});let i=n.command?.shaderProgram;return n.command=at.shallowClone(e,n.command),!l(i)||n.shaderProgramId!==e.shaderProgram.id?(n.command.shaderProgram=qvt(t,e.shaderProgram),n.shaderProgramId=e.shaderProgram.id):n.command.shaderProgram=i,n};function Yvt(e,t,n){let i=e.shaderCache.getDerivedShaderProgram(t,"pick");if(l(i))return i;let r=t._attributeLocations,{sources:o,defines:s}=t.fragmentShaderSource,c=o.some(g=>g.includes("out_FragData"))?"out_FragData_0":"out_FragColor",u=`void main () { czm_non_pick_main(); if (${c}.a == 0.0) { discard; } ${c} = ${n}; -} `,f=o.length,d=new Array(f+1);for(let g=0;g<f;++g)d[g]=Ye.replaceMain(o[g],"czm_non_pick_main");d[f]=u;let p=new Ye({sources:d,defines:s});return e.shaderCache.createDerivedShaderProgram(t,"pick",{vertexShaderSource:t.vertexShaderSource,fragmentShaderSource:p,attributeLocations:r})}function Ooe(e,t){let n=e.picking.pickRenderStateCache,i=n[t.id];if(l(i))return i;let r=Ge.getState(t);r.blending.enabled=!1,r.depthMask=!0;let o=Ge.fromCache(r);return n[t.id]=o,o}rC.createPickDerivedCommand=function(e,t,n,i){l(i)||(i={});let r=i.pickCommand?.shaderProgram,o=i.pickCommand?.renderState;return i.pickCommand=at.shallowClone(t,i.pickCommand),!l(r)||i.shaderProgramId!==t.shaderProgram.id?(i.pickCommand.shaderProgram=XMt(n,t.shaderProgram,t.pickId),i.pickCommand.renderState=Ooe(e,t.renderState),i.shaderProgramId=t.shaderProgram.id):(i.pickCommand.shaderProgram=r,i.pickCommand.renderState=o),i};var KMt=`uint rgba8UnormToUint32(vec4 c) +} `,f=o.length,d=new Array(f+1);for(let g=0;g<f;++g)d[g]=Ye.replaceMain(o[g],"czm_non_pick_main");d[f]=u;let p=new Ye({sources:d,defines:s});return e.shaderCache.createDerivedShaderProgram(t,"pick",{vertexShaderSource:t.vertexShaderSource,fragmentShaderSource:p,attributeLocations:r})}function one(e,t){let n=e.picking.pickRenderStateCache,i=n[t.id];if(l(i))return i;let r=Ge.getState(t);r.blending.enabled=!1,r.depthMask=!0;let o=Ge.fromCache(r);return n[t.id]=o,o}wE.createPickDerivedCommand=function(e,t,n,i){l(i)||(i={});let r=i.pickCommand?.shaderProgram,o=i.pickCommand?.renderState;return i.pickCommand=at.shallowClone(t,i.pickCommand),!l(r)||i.shaderProgramId!==t.shaderProgram.id?(i.pickCommand.shaderProgram=Yvt(n,t.shaderProgram,t.pickId),i.pickCommand.renderState=one(e,t.renderState),i.shaderProgramId=t.shaderProgram.id):(i.pickCommand.shaderProgram=r,i.pickCommand.renderState=o),i};var Xvt=`uint rgba8UnormToUint32(vec4 c) { uvec4 b = uvec4(c * 255.0 + 0.5); return (b.r) | (b.g << 8u) | (b.b << 16u) | (b.a << 24u); } -`;function $Mt(e,t,n){let i=e.shaderCache.getDerivedShaderProgram(t,"snap");if(l(i))return i;let r=t._attributeLocations,{sources:o,defines:s}=t.fragmentShaderSource,c=o.some(g=>g.includes("out_FragData"))?"out_FragData_0":"out_FragColor",u=`${KMt} +`;function Kvt(e,t,n){let i=e.shaderCache.getDerivedShaderProgram(t,"snap");if(l(i))return i;let r=t._attributeLocations,{sources:o,defines:s}=t.fragmentShaderSource,c=o.some(g=>g.includes("out_FragData"))?"out_FragData_0":"out_FragColor",u=`${Xvt} void main () { czm_non_snap_main(); @@ -10213,11 +10213,11 @@ void main () discard; } ${c} = ${n}; -} `,f=o.length,d=new Array(f+1);for(let g=0;g<f;++g)d[g]=Ye.replaceMain(o[g],"czm_non_snap_main");d[f]=u;let p=new Ye({sources:d,defines:s});return e.shaderCache.createDerivedShaderProgram(t,"snap",{vertexShaderSource:t.vertexShaderSource,fragmentShaderSource:p,attributeLocations:r})}rC.createSnapDerivedCommand=function(e,t,n,i){l(i)||(i={});let r=i.snapCommand?.shaderProgram,o=i.snapCommand?.renderState;return i.snapCommand=at.shallowClone(t,i.snapCommand),!l(r)||i.shaderProgramId!==t.shaderProgram.id?(i.snapCommand.shaderProgram=$Mt(n,t.shaderProgram,t.snapId),i.snapCommand.renderState=Ooe(e,t.renderState),i.shaderProgramId=t.shaderProgram.id):(i.snapCommand.shaderProgram=r,i.snapCommand.renderState=o),i};function yP(e,t,n){let i=e.length;for(let r=0;r<i;r++)e[r].trimStart().split(/\s+/)[0]===t&&(e[r]=`${t} ${n}`)}function JMt(e){return e.isArray?e.arrayLength:bt.getComponentCount(e.type)}function BNe(e,t,n){return`((${e} - float(${t})) / float(${n}))`}function kNe(e,t){let n=Lt.getMaximum(t);return`(${e}) / float(${n})`}function ZMt(e,t){let n="float(value)";if(t.hasValueTransform){let i=t.offset,r=t.scale;n=BNe(n,i,r)}return e.normalized||(n=kNe(n,e.componentType)),n}function QMt(e,t,n){let r=`float(${`value.${n}`})`;if(t.hasValueTransform){let o=t.offset[n],s=t.scale[n];r=BNe(r,o,s)}return e.normalized||(r=kNe(r,e.componentType)),r}function eNt(e,t,n){let i=n.schemaId,r=n.className,o=n.propertyName,s=`pickMetadata-${i}-${r}-${o}`,a=e.shaderCache.getDerivedShaderProgram(t,s);if(l(a))return a;let c=n.metadataProperty,u=n.classProperty,f=u.getGlslType(),d=["0.0","0.0","0.0","0.0"],p=JMt(u);if(p===1)d[0]=ZMt(u,c);else{let A=["x","y","z","w"];for(let b=0;b<p;b++)d[b]=QMt(u,c,A[b])}let g=t.fragmentShaderSource.defines.slice();g.push(jf.METADATA_PICKING_ENABLED),yP(g,jf.METADATA_PICKING_VALUE_TYPE,f),yP(g,jf.METADATA_PICKING_VALUE_STRING,`metadata.${o}`),yP(g,jf.METADATA_PICKING_VALUE_COMPONENT_X,d[0]),yP(g,jf.METADATA_PICKING_VALUE_COMPONENT_Y,d[1]),yP(g,jf.METADATA_PICKING_VALUE_COMPONENT_Z,d[2]),yP(g,jf.METADATA_PICKING_VALUE_COMPONENT_W,d[3]);let m=new Ye({sources:t.fragmentShaderSource.sources,defines:g});return e.shaderCache.createDerivedShaderProgram(t,s,{vertexShaderSource:t.vertexShaderSource,fragmentShaderSource:m,attributeLocations:t._attributeLocations})}rC.createPickMetadataDerivedCommand=function(e,t,n,i){return l(i)||(i={}),i.pickMetadataCommand=at.shallowClone(t,i.pickMetadataCommand),i.pickMetadataCommand.shaderProgram=eNt(n,t.shaderProgram,t.pickedMetadataInfo),i.pickMetadataCommand.renderState=Ooe(e,t.renderState),i.shaderProgramId=t.shaderProgram.id,i};function tNt(e,t){let n=e.shaderCache.getDerivedShaderProgram(t,"HDR");if(l(n))return n;let i=t._attributeLocations,r=t.vertexShaderSource.clone(),o=t.fragmentShaderSource.clone();return r.defines=l(r.defines)?r.defines.slice(0):[],r.defines.push("HDR"),o.defines=l(o.defines)?o.defines.slice(0):[],o.defines.push("HDR"),e.shaderCache.createDerivedShaderProgram(t,"HDR",{vertexShaderSource:r,fragmentShaderSource:o,attributeLocations:i})}rC.createHdrCommand=function(e,t,n){l(n)||(n={});let i=n.command?.shaderProgram;return n.command=at.shallowClone(e,n.command),!l(i)||n.shaderProgramId!==e.shaderProgram.id?(n.command.shaderProgram=tNt(t,e.shaderProgram),n.shaderProgramId=e.shaderProgram.id):n.command.shaderProgram=i,n};var ip=rC;function H7(e){this._scene=e,this._lastAlpha=void 0,this._lastBeta=void 0,this._lastGamma=void 0,this._alpha=void 0,this._beta=void 0,this._gamma=void 0;let t=this;function n(i){let r=i.alpha;if(!l(r)){t._alpha=void 0,t._beta=void 0,t._gamma=void 0;return}t._alpha=D.toRadians(r),t._beta=D.toRadians(i.beta),t._gamma=D.toRadians(i.gamma)}window.addEventListener("deviceorientation",n,!1),this._removeListener=function(){window.removeEventListener("deviceorientation",n,!1)}}var nNt=new Le,UNe=new Le,iNt=new $;function rNt(e,t,n,i){let r=e.direction,o=e.right,s=e.up,a=Le.fromAxisAngle(r,n,UNe),c=Le.fromAxisAngle(o,i,nNt),u=Le.multiply(c,a,c),f=Le.fromAxisAngle(s,t,UNe);Le.multiply(f,u,u);let d=$.fromQuaternion(u,iNt);$.multiplyByVector(d,o,o),$.multiplyByVector(d,s,s),$.multiplyByVector(d,r,r)}H7.prototype.update=function(){if(!l(this._alpha))return;l(this._lastAlpha)||(this._lastAlpha=this._alpha,this._lastBeta=this._beta,this._lastGamma=this._gamma);let e=this._lastAlpha-this._alpha,t=this._lastBeta-this._beta,n=this._lastGamma-this._gamma;rNt(this._scene.camera,-e,t,n),this._lastAlpha=this._alpha,this._lastBeta=this._beta,this._lastGamma=this._gamma};H7.prototype.isDestroyed=function(){return!1};H7.prototype.destroy=function(){return this._removeListener(),le(this)};var Rz=H7;function Moe(){this.enabled=!0,this.renderable=!0,this.density=6e-4,this.heightScalar=.001,this._heightFalloff=.59,this.maxHeight=8e5,this.visualDensityScalar=.15,this.screenSpaceErrorFactor=2,this.minimumBrightness=.03}Object.defineProperties(Moe.prototype,{heightFalloff:{get:function(){return this._heightFalloff},set:function(e){this._heightFalloff=e}}});var oNt=new h;Moe.prototype.update=function(e){if(!(e.fog.enabled=this.enabled))return;e.fog.renderable=this.renderable;let n=e.camera,i=n.positionCartographic;if(!l(i)||i.height>this.maxHeight||e.mode!==re.SCENE3D){e.fog.enabled=!1,e.fog.density=0;return}let r=i.height,o=this.density*this.heightScalar*Math.pow(Math.max(r/this.maxHeight,D.EPSILON4),-Math.max(this._heightFalloff,0)),s=h.normalize(n.positionWC,oNt),a=Math.abs(h.dot(n.directionWC,s));o*=1-a,e.fog.density=o,e.fog.visualDensityScalar=this.visualDensityScalar,e.fog.sse=this.screenSpaceErrorFactor,e.fog.minimumBrightness=this.minimumBrightness};var Oz=Moe;var xc={OPAQUE_FRONT_FACE:0,OPAQUE_BACK_FACE:1,DEPTH_ONLY_FRONT_FACE:2,DEPTH_ONLY_BACK_FACE:3,DEPTH_ONLY_FRONT_AND_BACK_FACE:4,TRANSLUCENT_FRONT_FACE:5,TRANSLUCENT_BACK_FACE:6,TRANSLUCENT_FRONT_FACE_MANUAL_DEPTH_TEST:7,TRANSLUCENT_BACK_FACE_MANUAL_DEPTH_TEST:8,PICK_FRONT_FACE:9,PICK_BACK_FACE:10,DERIVED_COMMANDS_MAXIMUM_LENGTH:11},oC=xc.DERIVED_COMMANDS_MAXIMUM_LENGTH,KNe=["opaqueFrontFaceCommand","opaqueBackFaceCommand","depthOnlyFrontFaceCommand","depthOnlyBackFaceCommand","depthOnlyFrontAndBackFaceCommand","translucentFrontFaceCommand","translucentBackFaceCommand","translucentFrontFaceManualDepthTestCommand","translucentBackFaceManualDepthTestCommand","pickFrontFaceCommand","pickBackFaceCommand"];function sC(){this._frontFaceAlphaByDistance=new qt(0,1,0,1),this._backFaceAlphaByDistance=new qt(0,1,0,1),this._frontFaceTranslucent=!1,this._backFaceTranslucent=!1,this._requiresManualDepthTest=!1,this._sunVisibleThroughGlobe=!1,this._environmentVisible=!1,this._useDepthPlane=!1,this._numberOfTextureUniforms=0,this._globeTranslucencyFramebuffer=void 0,this._rectangle=ie.clone(ie.MAX_VALUE),this._derivedCommandKey=0,this._derivedCommandsDirty=!1,this._derivedCommandPacks=void 0,this._derivedCommandTypes=new Array(oC),this._derivedBlendCommandTypes=new Array(oC),this._derivedPickCommandTypes=new Array(oC),this._derivedCommandTypesToUpdate=new Array(oC),this._derivedCommandsLength=0,this._derivedBlendCommandsLength=0,this._derivedPickCommandsLength=0,this._derivedCommandsToUpdateLength=0}Object.defineProperties(sC.prototype,{frontFaceAlphaByDistance:{get:function(){return this._frontFaceAlphaByDistance}},backFaceAlphaByDistance:{get:function(){return this._backFaceAlphaByDistance}},translucent:{get:function(){return this._frontFaceTranslucent}},sunVisibleThroughGlobe:{get:function(){return this._sunVisibleThroughGlobe}},environmentVisible:{get:function(){return this._environmentVisible}},useDepthPlane:{get:function(){return this._useDepthPlane}},numberOfTextureUniforms:{get:function(){return this._numberOfTextureUniforms}},rectangle:{get:function(){return this._rectangle}}});sC.prototype.update=function(e){let t=e.globe;if(!l(t)||!t.show){this._frontFaceTranslucent=!1,this._backFaceTranslucent=!1,this._sunVisibleThroughGlobe=!0,this._environmentVisible=!0,this._useDepthPlane=!1;return}this._frontFaceAlphaByDistance=zNe(t.translucency.enabled,t.translucency.frontFaceAlpha,t.translucency.frontFaceAlphaByDistance,this._frontFaceAlphaByDistance),this._backFaceAlphaByDistance=zNe(t.translucency.enabled,t.translucency.backFaceAlpha,t.translucency.backFaceAlphaByDistance,this._backFaceAlphaByDistance),this._frontFaceTranslucent=VNe(t.translucency.enabled,this._frontFaceAlphaByDistance,t),this._backFaceTranslucent=VNe(t.translucency.enabled,this._backFaceAlphaByDistance,t),this._requiresManualDepthTest=lNt(this,e,t),this._sunVisibleThroughGlobe=sNt(this,e),this._environmentVisible=aNt(this,e),this._useDepthPlane=cNt(this,e),this._numberOfTextureUniforms=uNt(this),this._rectangle=ie.clone(t.translucency.rectangle,this._rectangle),fNt(this,e)};function zNe(e,t,n,i){return e?l(n)?(qt.clone(n,i),i.nearValue*=t,i.farValue*=t,i):(i.nearValue=t,i.farValue=t,i):(i.nearValue=1,i.farValue=1,i)}function VNe(e,t,n){return e&&(n.baseColor.alpha<1||t.nearValue<1||t.farValue<1)}function sNt(e,t){let n=e._frontFaceTranslucent,i=e._backFaceTranslucent;return n&&(t.cameraUnderground||i)}function aNt(e,t){return!t.cameraUnderground||e._frontFaceTranslucent}function cNt(e,t){return!t.cameraUnderground&&!e._frontFaceTranslucent}function lNt(e,t,n){return e._frontFaceTranslucent&&!e._backFaceTranslucent&&!n.depthTestAgainstTerrain&&t.mode!==re.SCENE2D&&t.context.depthTexture}function uNt(e){let t=0;return e._frontFaceTranslucent&&++t,e._requiresManualDepthTest&&++t,t}function fNt(e,t){e._derivedCommandsLength=Noe(e,t,!1,!1,e._derivedCommandTypes),e._derivedBlendCommandsLength=Noe(e,t,!0,!1,e._derivedBlendCommandTypes),e._derivedPickCommandsLength=Noe(e,t,!1,!0,e._derivedPickCommandTypes);let n,i=0;for(n=0;n<e._derivedCommandsLength;++n)i|=1<<e._derivedCommandTypes[n];for(n=0;n<e._derivedBlendCommandsLength;++n)i|=1<<e._derivedBlendCommandTypes[n];for(n=0;n<e._derivedPickCommandsLength;++n)i|=1<<e._derivedPickCommandTypes[n];let r=0;for(n=0;n<oC;++n)(i&1<<n)>0&&(e._derivedCommandTypesToUpdate[r++]=n);e._derivedCommandsToUpdateLength=r;let o=i!==e._derivedCommandKey;e._derivedCommandKey=i,e._derivedCommandsDirty=o,!l(e._derivedCommandPacks)&&e._frontFaceTranslucent&&(e._derivedCommandPacks=SNt())}function Noe(e,t,n,i,r){let o=0,s=e._frontFaceTranslucent,a=e._backFaceTranslucent;if(!s)return o;let c=t.cameraUnderground,u=e._requiresManualDepthTest,f=i?xc.PICK_FRONT_FACE:u?xc.TRANSLUCENT_FRONT_FACE_MANUAL_DEPTH_TEST:xc.TRANSLUCENT_FRONT_FACE,d=i?xc.PICK_BACK_FACE:u?xc.TRANSLUCENT_BACK_FACE_MANUAL_DEPTH_TEST:xc.TRANSLUCENT_BACK_FACE;return t.mode===re.SCENE2D?(r[o++]=xc.DEPTH_ONLY_FRONT_FACE,r[o++]=f,o):(a?(n||(r[o++]=xc.DEPTH_ONLY_FRONT_AND_BACK_FACE),c?(r[o++]=f,r[o++]=d):(r[o++]=d,r[o++]=f)):c?(n||(r[o++]=xc.DEPTH_ONLY_BACK_FACE),r[o++]=xc.OPAQUE_FRONT_FACE,r[o++]=d):(n||(r[o++]=xc.DEPTH_ONLY_FRONT_FACE),r[o++]=xc.OPAQUE_BACK_FACE,r[o++]=f),o)}function Sh(e,t){let n=e.indexOf(t);n>-1&&e.splice(n,1)}function jNe(e,t){return e.indexOf(t)>-1}function dNt(e,t){Sh(e.defines,"TRANSLUCENT"),Sh(t.defines,"TRANSLUCENT")}function hNt(e,t){Sh(e.defines,"GROUND_ATMOSPHERE"),Sh(t.defines,"GROUND_ATMOSPHERE"),Sh(e.defines,"FOG"),Sh(t.defines,"FOG"),Sh(e.defines,"TRANSLUCENT"),Sh(t.defines,"TRANSLUCENT")}function Loe(e,t){if(jNe(t.defines,"TILE_LIMIT_RECTANGLE")||jNe(t.defines,"ENABLE_CLIPPING_PLANES"))return;let n=`void main() +} `,f=o.length,d=new Array(f+1);for(let g=0;g<f;++g)d[g]=Ye.replaceMain(o[g],"czm_non_snap_main");d[f]=u;let p=new Ye({sources:d,defines:s});return e.shaderCache.createDerivedShaderProgram(t,"snap",{vertexShaderSource:t.vertexShaderSource,fragmentShaderSource:p,attributeLocations:r})}wE.createSnapDerivedCommand=function(e,t,n,i){l(i)||(i={});let r=i.snapCommand?.shaderProgram,o=i.snapCommand?.renderState;return i.snapCommand=at.shallowClone(t,i.snapCommand),!l(r)||i.shaderProgramId!==t.shaderProgram.id?(i.snapCommand.shaderProgram=Kvt(n,t.shaderProgram,t.snapId),i.snapCommand.renderState=one(e,t.renderState),i.shaderProgramId=t.shaderProgram.id):(i.snapCommand.shaderProgram=r,i.snapCommand.renderState=o),i};function hI(e,t,n){let i=e.length;for(let r=0;r<i;r++)e[r].trimStart().split(/\s+/)[0]===t&&(e[r]=`${t} ${n}`)}function $vt(e){return e.isArray?e.arrayLength:bt.getComponentCount(e.type)}function PPe(e,t,n){return`((${e} - float(${t})) / float(${n}))`}function DPe(e,t){let n=Lt.getMaximum(t);return`(${e}) / float(${n})`}function Jvt(e,t){let n="float(value)";if(t.hasValueTransform){let i=t.offset,r=t.scale;n=PPe(n,i,r)}return e.normalized||(n=DPe(n,e.componentType)),n}function Zvt(e,t,n){let r=`float(${`value.${n}`})`;if(t.hasValueTransform){let o=t.offset[n],s=t.scale[n];r=PPe(r,o,s)}return e.normalized||(r=DPe(r,e.componentType)),r}function Qvt(e,t,n){let i=n.schemaId,r=n.className,o=n.propertyName,s=`pickMetadata-${i}-${r}-${o}`,a=e.shaderCache.getDerivedShaderProgram(t,s);if(l(a))return a;let c=n.metadataProperty,u=n.classProperty,f=u.getGlslType(),d=["0.0","0.0","0.0","0.0"],p=$vt(u);if(p===1)d[0]=Jvt(u,c);else{let A=["x","y","z","w"];for(let b=0;b<p;b++)d[b]=Zvt(u,c,A[b])}let g=t.fragmentShaderSource.defines.slice();g.push(Kf.METADATA_PICKING_ENABLED),hI(g,Kf.METADATA_PICKING_VALUE_TYPE,f),hI(g,Kf.METADATA_PICKING_VALUE_STRING,`metadata.${o}`),hI(g,Kf.METADATA_PICKING_VALUE_COMPONENT_X,d[0]),hI(g,Kf.METADATA_PICKING_VALUE_COMPONENT_Y,d[1]),hI(g,Kf.METADATA_PICKING_VALUE_COMPONENT_Z,d[2]),hI(g,Kf.METADATA_PICKING_VALUE_COMPONENT_W,d[3]);let m=new Ye({sources:t.fragmentShaderSource.sources,defines:g});return e.shaderCache.createDerivedShaderProgram(t,s,{vertexShaderSource:t.vertexShaderSource,fragmentShaderSource:m,attributeLocations:t._attributeLocations})}wE.createPickMetadataDerivedCommand=function(e,t,n,i){return l(i)||(i={}),i.pickMetadataCommand=at.shallowClone(t,i.pickMetadataCommand),i.pickMetadataCommand.shaderProgram=Qvt(n,t.shaderProgram,t.pickedMetadataInfo),i.pickMetadataCommand.renderState=one(e,t.renderState),i.shaderProgramId=t.shaderProgram.id,i};function eSt(e,t){let n=e.shaderCache.getDerivedShaderProgram(t,"HDR");if(l(n))return n;let i=t._attributeLocations,r=t.vertexShaderSource.clone(),o=t.fragmentShaderSource.clone();return r.defines=l(r.defines)?r.defines.slice(0):[],r.defines.push("HDR"),o.defines=l(o.defines)?o.defines.slice(0):[],o.defines.push("HDR"),e.shaderCache.createDerivedShaderProgram(t,"HDR",{vertexShaderSource:r,fragmentShaderSource:o,attributeLocations:i})}wE.createHdrCommand=function(e,t,n){l(n)||(n={});let i=n.command?.shaderProgram;return n.command=at.shallowClone(e,n.command),!l(i)||n.shaderProgramId!==e.shaderProgram.id?(n.command.shaderProgram=eSt(t,e.shaderProgram),n.shaderProgramId=e.shaderProgram.id):n.command.shaderProgram=i,n};var Wm=wE;function O5(e){this._scene=e,this._lastAlpha=void 0,this._lastBeta=void 0,this._lastGamma=void 0,this._alpha=void 0,this._beta=void 0,this._gamma=void 0;let t=this;function n(i){let r=i.alpha;if(!l(r)){t._alpha=void 0,t._beta=void 0,t._gamma=void 0;return}t._alpha=D.toRadians(r),t._beta=D.toRadians(i.beta),t._gamma=D.toRadians(i.gamma)}window.addEventListener("deviceorientation",n,!1),this._removeListener=function(){window.removeEventListener("deviceorientation",n,!1)}}var tSt=new Le,RPe=new Le,nSt=new $;function iSt(e,t,n,i){let r=e.direction,o=e.right,s=e.up,a=Le.fromAxisAngle(r,n,RPe),c=Le.fromAxisAngle(o,i,tSt),u=Le.multiply(c,a,c),f=Le.fromAxisAngle(s,t,RPe);Le.multiply(f,u,u);let d=$.fromQuaternion(u,nSt);$.multiplyByVector(d,o,o),$.multiplyByVector(d,s,s),$.multiplyByVector(d,r,r)}O5.prototype.update=function(){if(!l(this._alpha))return;l(this._lastAlpha)||(this._lastAlpha=this._alpha,this._lastBeta=this._beta,this._lastGamma=this._gamma);let e=this._lastAlpha-this._alpha,t=this._lastBeta-this._beta,n=this._lastGamma-this._gamma;iSt(this._scene.camera,-e,t,n),this._lastAlpha=this._alpha,this._lastBeta=this._beta,this._lastGamma=this._gamma};O5.prototype.isDestroyed=function(){return!1};O5.prototype.destroy=function(){return this._removeListener(),le(this)};var bU=O5;function sne(){this.enabled=!0,this.renderable=!0,this.density=6e-4,this.heightScalar=.001,this._heightFalloff=.59,this.maxHeight=8e5,this.visualDensityScalar=.15,this.screenSpaceErrorFactor=2,this.minimumBrightness=.03}Object.defineProperties(sne.prototype,{heightFalloff:{get:function(){return this._heightFalloff},set:function(e){this._heightFalloff=e}}});var rSt=new h;sne.prototype.update=function(e){if(!(e.fog.enabled=this.enabled))return;e.fog.renderable=this.renderable;let n=e.camera,i=n.positionCartographic;if(!l(i)||i.height>this.maxHeight||e.mode!==re.SCENE3D){e.fog.enabled=!1,e.fog.density=0;return}let r=i.height,o=this.density*this.heightScalar*Math.pow(Math.max(r/this.maxHeight,D.EPSILON4),-Math.max(this._heightFalloff,0)),s=h.normalize(n.positionWC,rSt),a=Math.abs(h.dot(n.directionWC,s));o*=1-a,e.fog.density=o,e.fog.visualDensityScalar=this.visualDensityScalar,e.fog.sse=this.screenSpaceErrorFactor,e.fog.minimumBrightness=this.minimumBrightness};var xU=sne;var bc={OPAQUE_FRONT_FACE:0,OPAQUE_BACK_FACE:1,DEPTH_ONLY_FRONT_FACE:2,DEPTH_ONLY_BACK_FACE:3,DEPTH_ONLY_FRONT_AND_BACK_FACE:4,TRANSLUCENT_FRONT_FACE:5,TRANSLUCENT_BACK_FACE:6,TRANSLUCENT_FRONT_FACE_MANUAL_DEPTH_TEST:7,TRANSLUCENT_BACK_FACE_MANUAL_DEPTH_TEST:8,PICK_FRONT_FACE:9,PICK_BACK_FACE:10,DERIVED_COMMANDS_MAXIMUM_LENGTH:11},IE=bc.DERIVED_COMMANDS_MAXIMUM_LENGTH,VPe=["opaqueFrontFaceCommand","opaqueBackFaceCommand","depthOnlyFrontFaceCommand","depthOnlyBackFaceCommand","depthOnlyFrontAndBackFaceCommand","translucentFrontFaceCommand","translucentBackFaceCommand","translucentFrontFaceManualDepthTestCommand","translucentBackFaceManualDepthTestCommand","pickFrontFaceCommand","pickBackFaceCommand"];function PE(){this._frontFaceAlphaByDistance=new qt(0,1,0,1),this._backFaceAlphaByDistance=new qt(0,1,0,1),this._frontFaceTranslucent=!1,this._backFaceTranslucent=!1,this._requiresManualDepthTest=!1,this._sunVisibleThroughGlobe=!1,this._environmentVisible=!1,this._useDepthPlane=!1,this._numberOfTextureUniforms=0,this._globeTranslucencyFramebuffer=void 0,this._rectangle=ie.clone(ie.MAX_VALUE),this._derivedCommandKey=0,this._derivedCommandsDirty=!1,this._derivedCommandPacks=void 0,this._derivedCommandTypes=new Array(IE),this._derivedBlendCommandTypes=new Array(IE),this._derivedPickCommandTypes=new Array(IE),this._derivedCommandTypesToUpdate=new Array(IE),this._derivedCommandsLength=0,this._derivedBlendCommandsLength=0,this._derivedPickCommandsLength=0,this._derivedCommandsToUpdateLength=0}Object.defineProperties(PE.prototype,{frontFaceAlphaByDistance:{get:function(){return this._frontFaceAlphaByDistance}},backFaceAlphaByDistance:{get:function(){return this._backFaceAlphaByDistance}},translucent:{get:function(){return this._frontFaceTranslucent}},sunVisibleThroughGlobe:{get:function(){return this._sunVisibleThroughGlobe}},environmentVisible:{get:function(){return this._environmentVisible}},useDepthPlane:{get:function(){return this._useDepthPlane}},numberOfTextureUniforms:{get:function(){return this._numberOfTextureUniforms}},rectangle:{get:function(){return this._rectangle}}});PE.prototype.update=function(e){let t=e.globe;if(!l(t)||!t.show){this._frontFaceTranslucent=!1,this._backFaceTranslucent=!1,this._sunVisibleThroughGlobe=!0,this._environmentVisible=!0,this._useDepthPlane=!1;return}this._frontFaceAlphaByDistance=OPe(t.translucency.enabled,t.translucency.frontFaceAlpha,t.translucency.frontFaceAlphaByDistance,this._frontFaceAlphaByDistance),this._backFaceAlphaByDistance=OPe(t.translucency.enabled,t.translucency.backFaceAlpha,t.translucency.backFaceAlphaByDistance,this._backFaceAlphaByDistance),this._frontFaceTranslucent=MPe(t.translucency.enabled,this._frontFaceAlphaByDistance,t),this._backFaceTranslucent=MPe(t.translucency.enabled,this._backFaceAlphaByDistance,t),this._requiresManualDepthTest=cSt(this,e,t),this._sunVisibleThroughGlobe=oSt(this,e),this._environmentVisible=sSt(this,e),this._useDepthPlane=aSt(this,e),this._numberOfTextureUniforms=lSt(this),this._rectangle=ie.clone(t.translucency.rectangle,this._rectangle),uSt(this,e)};function OPe(e,t,n,i){return e?l(n)?(qt.clone(n,i),i.nearValue*=t,i.farValue*=t,i):(i.nearValue=t,i.farValue=t,i):(i.nearValue=1,i.farValue=1,i)}function MPe(e,t,n){return e&&(n.baseColor.alpha<1||t.nearValue<1||t.farValue<1)}function oSt(e,t){let n=e._frontFaceTranslucent,i=e._backFaceTranslucent;return n&&(t.cameraUnderground||i)}function sSt(e,t){return!t.cameraUnderground||e._frontFaceTranslucent}function aSt(e,t){return!t.cameraUnderground&&!e._frontFaceTranslucent}function cSt(e,t,n){return e._frontFaceTranslucent&&!e._backFaceTranslucent&&!n.depthTestAgainstTerrain&&t.mode!==re.SCENE2D&&t.context.depthTexture}function lSt(e){let t=0;return e._frontFaceTranslucent&&++t,e._requiresManualDepthTest&&++t,t}function uSt(e,t){e._derivedCommandsLength=ane(e,t,!1,!1,e._derivedCommandTypes),e._derivedBlendCommandsLength=ane(e,t,!0,!1,e._derivedBlendCommandTypes),e._derivedPickCommandsLength=ane(e,t,!1,!0,e._derivedPickCommandTypes);let n,i=0;for(n=0;n<e._derivedCommandsLength;++n)i|=1<<e._derivedCommandTypes[n];for(n=0;n<e._derivedBlendCommandsLength;++n)i|=1<<e._derivedBlendCommandTypes[n];for(n=0;n<e._derivedPickCommandsLength;++n)i|=1<<e._derivedPickCommandTypes[n];let r=0;for(n=0;n<IE;++n)(i&1<<n)>0&&(e._derivedCommandTypesToUpdate[r++]=n);e._derivedCommandsToUpdateLength=r;let o=i!==e._derivedCommandKey;e._derivedCommandKey=i,e._derivedCommandsDirty=o,!l(e._derivedCommandPacks)&&e._frontFaceTranslucent&&(e._derivedCommandPacks=vSt())}function ane(e,t,n,i,r){let o=0,s=e._frontFaceTranslucent,a=e._backFaceTranslucent;if(!s)return o;let c=t.cameraUnderground,u=e._requiresManualDepthTest,f=i?bc.PICK_FRONT_FACE:u?bc.TRANSLUCENT_FRONT_FACE_MANUAL_DEPTH_TEST:bc.TRANSLUCENT_FRONT_FACE,d=i?bc.PICK_BACK_FACE:u?bc.TRANSLUCENT_BACK_FACE_MANUAL_DEPTH_TEST:bc.TRANSLUCENT_BACK_FACE;return t.mode===re.SCENE2D?(r[o++]=bc.DEPTH_ONLY_FRONT_FACE,r[o++]=f,o):(a?(n||(r[o++]=bc.DEPTH_ONLY_FRONT_AND_BACK_FACE),c?(r[o++]=f,r[o++]=d):(r[o++]=d,r[o++]=f)):c?(n||(r[o++]=bc.DEPTH_ONLY_BACK_FACE),r[o++]=bc.OPAQUE_FRONT_FACE,r[o++]=d):(n||(r[o++]=bc.DEPTH_ONLY_FRONT_FACE),r[o++]=bc.OPAQUE_BACK_FACE,r[o++]=f),o)}function bh(e,t){let n=e.indexOf(t);n>-1&&e.splice(n,1)}function NPe(e,t){return e.indexOf(t)>-1}function fSt(e,t){bh(e.defines,"TRANSLUCENT"),bh(t.defines,"TRANSLUCENT")}function dSt(e,t){bh(e.defines,"GROUND_ATMOSPHERE"),bh(t.defines,"GROUND_ATMOSPHERE"),bh(e.defines,"FOG"),bh(t.defines,"FOG"),bh(e.defines,"TRANSLUCENT"),bh(t.defines,"TRANSLUCENT")}function cne(e,t){if(NPe(t.defines,"TILE_LIMIT_RECTANGLE")||NPe(t.defines,"ENABLE_CLIPPING_PLANES"))return;let n=`void main() { out_FragColor = vec4(1.0); } -`;t.sources=[n]}function Foe(e,t){let n=t.sources,i=n.length;for(let o=0;o<i;++o)n[o]=Ye.replaceMain(n[o],"czm_globe_translucency_main");n.push(` +`;t.sources=[n]}function lne(e,t){let n=t.sources,i=n.length;for(let o=0;o<i;++o)n[o]=Ye.replaceMain(n[o],"czm_globe_translucency_main");n.push(` uniform sampler2D u_classificationTexture; void main() @@ -10244,7 +10244,7 @@ void main() } out_FragColor = classificationColor * vec4(classificationColor.aaa, 1.0) + out_FragColor * (1.0 - classificationColor.a); } -`)}function $Ne(e,t){Foe(e,t),Sh(e.defines,"GROUND_ATMOSPHERE"),Sh(t.defines,"GROUND_ATMOSPHERE"),Sh(e.defines,"FOG"),Sh(t.defines,"FOG")}function mNt(e,t){Foe(e,t),e.defines.push("GENERATE_POSITION"),t.defines.push("MANUAL_DEPTH_TEST")}function pNt(e,t){$Ne(e,t),e.defines.push("GENERATE_POSITION"),t.defines.push("MANUAL_DEPTH_TEST")}function HNe(e,t){let n=`uniform sampler2D u_classificationTexture; +`)}function jPe(e,t){lne(e,t),bh(e.defines,"GROUND_ATMOSPHERE"),bh(t.defines,"GROUND_ATMOSPHERE"),bh(e.defines,"FOG"),bh(t.defines,"FOG")}function hSt(e,t){lne(e,t),e.defines.push("GENERATE_POSITION"),t.defines.push("MANUAL_DEPTH_TEST")}function mSt(e,t){jPe(e,t),e.defines.push("GENERATE_POSITION"),t.defines.push("MANUAL_DEPTH_TEST")}function LPe(e,t){let n=`uniform sampler2D u_classificationTexture; void main() { vec2 st = gl_FragCoord.xy / czm_viewport.zw; @@ -10255,13 +10255,13 @@ void main() } out_FragColor = pickColor; } -`;t.sources=[n]}function gNt(e,t,n,i,r,o){if(!l(r))return t;if(!i&&l(n))return n;let s=e.shaderCache.getDerivedShaderProgram(t,o);if(!l(s)){let a=t._attributeLocations,c=t.vertexShaderSource.clone(),u=t.fragmentShaderSource.clone();c.defines=l(c.defines)?c.defines.slice(0):[],u.defines=l(u.defines)?u.defines.slice(0):[],r(c,u),s=e.shaderCache.createDerivedShaderProgram(t,o,{vertexShaderSource:c,fragmentShaderSource:u,attributeLocations:a})}return s}function _Nt(e){e.cull.face=Vi.BACK,e.cull.enabled=!0}function yNt(e){e.cull.face=Vi.FRONT,e.cull.enabled=!0}function ANt(e){e.cull.face=Vi.BACK,e.cull.enabled=!0,e.colorMask={red:!1,green:!1,blue:!1,alpha:!1}}function bNt(e){e.cull.face=Vi.FRONT,e.cull.enabled=!0,e.colorMask={red:!1,green:!1,blue:!1,alpha:!1}}function xNt(e){e.cull.enabled=!1,e.colorMask={red:!1,green:!1,blue:!1,alpha:!1}}function GNe(e){e.cull.face=Vi.BACK,e.cull.enabled=!0,e.depthMask=!1,e.blending=tn.ALPHA_BLEND}function WNe(e){e.cull.face=Vi.FRONT,e.cull.enabled=!0,e.depthMask=!1,e.blending=tn.ALPHA_BLEND}function TNt(e){e.cull.face=Vi.BACK,e.cull.enabled=!0,e.blending.enabled=!1}function ENt(e){e.cull.face=Vi.FRONT,e.cull.enabled=!0,e.blending.enabled=!1}function CNt(e,t,n,i,r){if(!l(i))return e;if(!n&&l(t))return t;let o=r[e.id];if(!l(o)){let s=Ge.getState(e);i(s),o=Ge.fromCache(s),r[e.id]=o}return o}function AP(e){return{u_classificationTexture:function(){return e._globeTranslucencyFramebuffer.classificationTexture}}}function vNt(e,t,n,i,r){return l(r)?!i&&l(n)?n:Ot(t,r(e),!1):t}function rp(e){this.pass=e.pass,this.pickOnly=e.pickOnly,this.getShaderProgramFunction=e.getShaderProgramFunction,this.getRenderStateFunction=e.getRenderStateFunction,this.getUniformMapFunction=e.getUniformMapFunction,this.renderStateCache={}}function SNt(){return[new rp({pass:Ie.GLOBE,pickOnly:!1,getShaderProgramFunction:dNt,getRenderStateFunction:_Nt,getUniformMapFunction:void 0}),new rp({pass:Ie.GLOBE,pickOnly:!1,getShaderProgramFunction:hNt,getRenderStateFunction:yNt,getUniformMapFunction:void 0}),new rp({pass:Ie.GLOBE,pickOnly:!1,getShaderProgramFunction:Loe,getRenderStateFunction:ANt,getUniformMapFunction:void 0}),new rp({pass:Ie.GLOBE,pickOnly:!1,getShaderProgramFunction:Loe,getRenderStateFunction:bNt,getUniformMapFunction:void 0}),new rp({pass:Ie.GLOBE,pickOnly:!1,getShaderProgramFunction:Loe,getRenderStateFunction:xNt,getUniformMapFunction:void 0}),new rp({pass:Ie.TRANSLUCENT,pickOnly:!1,getShaderProgramFunction:Foe,getRenderStateFunction:GNe,getUniformMapFunction:AP}),new rp({pass:Ie.TRANSLUCENT,pickOnly:!1,getShaderProgramFunction:$Ne,getRenderStateFunction:WNe,getUniformMapFunction:AP}),new rp({pass:Ie.TRANSLUCENT,pickOnly:!1,getShaderProgramFunction:mNt,getRenderStateFunction:GNe,getUniformMapFunction:AP}),new rp({pass:Ie.TRANSLUCENT,pickOnly:!1,getShaderProgramFunction:pNt,getRenderStateFunction:WNe,getUniformMapFunction:AP}),new rp({pass:Ie.TRANSLUCENT,pickOnly:!0,getShaderProgramFunction:HNe,getRenderStateFunction:TNt,getUniformMapFunction:AP}),new rp({pass:Ie.TRANSLUCENT,pickOnly:!0,getShaderProgramFunction:HNe,getRenderStateFunction:ENt,getUniformMapFunction:AP})]}var qNe=new Array(oC),YNe=new Array(oC);sC.prototype.updateDerivedCommands=function(e,t){let n=this._derivedCommandTypesToUpdate,i=this._derivedCommandsToUpdateLength;if(i!==0){for(let r=0;r<i;++r)YNe[r]=this._derivedCommandPacks[n[r]],qNe[r]=KNe[n[r]];wNt(this,e,i,n,qNe,YNe,t)}};function wNt(e,t,n,i,r,o,s){let a=t.derivedCommands.globeTranslucency,c=e._derivedCommandsDirty;if(t.dirty||!l(a)||c){t.dirty=!1,l(a)||(a={},t.derivedCommands.globeTranslucency=a);let u=s.frameNumber,f=a.uniformMapDirtyFrame??0,d=a.shaderProgramDirtyFrame??0,p=a.renderStateDirtyFrame??0,g=a.uniformMap!==t.uniformMap,m=a.shaderProgramId!==t.shaderProgram.id,y=a.renderStateId!==t.renderState.id;g&&(a.uniformMapDirtyFrame=u),m&&(a.shaderProgramDirtyFrame=u),y&&(a.renderStateDirtyFrame=u),a.uniformMap=t.uniformMap,a.shaderProgramId=t.shaderProgram.id,a.renderStateId=t.renderState.id;for(let A=0;A<n;++A){let b=o[A],x=i[A],T=r[A],E=a[T],v,S,I;l(E)?(v=E.uniformMap,S=E.shaderProgram,I=E.renderState):(v=void 0,S=void 0,I=void 0),E=at.shallowClone(t,E),a[T]=E;let R=E.derivedCommands.uniformMapDirtyFrame??0,O=E.derivedCommands.shaderProgramDirtyFrame??0,L=E.derivedCommands.renderStateDirtyFrame??0,_=g||R<f,C=m||O<d,w=y||L<p;_&&(E.derivedCommands.uniformMapDirtyFrame=u),C&&(E.derivedCommands.shaderProgramDirtyFrame=u),w&&(E.derivedCommands.renderStateDirtyFrame=u),E.derivedCommands.type=x,E.pass=b.pass,E.pickOnly=b.pickOnly,E.uniformMap=vNt(e,t.uniformMap,v,_,b.getUniformMapFunction),E.shaderProgram=gNt(s.context,t.shaderProgram,S,C,b.getShaderProgramFunction,T),E.renderState=CNt(t.renderState,I,w,b.getRenderStateFunction,b.renderStateCache)}}}sC.prototype.pushDerivedCommands=function(e,t,n){let i=n.passes.pick||n.passes.pickVoxel;if(i&&t)return;let r=this._derivedCommandTypes,o=this._derivedCommandsLength;if(i?(r=this._derivedPickCommandTypes,o=this._derivedPickCommandsLength):t&&(r=this._derivedBlendCommandTypes,o=this._derivedBlendCommandsLength),o===0){n.commandList.push(e);return}let s=e.derivedCommands.globeTranslucency;for(let a=0;a<o;++a){let c=KNe[r[a]];n.commandList.push(s[c])}};function JNe(e,t,n,i,r,o){for(let s=0;s<t;++s){let a=e[s],c=a.derivedCommands.type;(!l(o)||o.indexOf(c)>-1)&&n(a,i,r)}}function XNe(e,t,n,i,r){for(let o=0;o<t;++o)n(e[o],i,r)}var INt=[xc.OPAQUE_FRONT_FACE,xc.OPAQUE_BACK_FACE],PNt=[xc.DEPTH_ONLY_FRONT_FACE,xc.DEPTH_ONLY_BACK_FACE,xc.DEPTH_ONLY_FRONT_AND_BACK_FACE];sC.prototype.executeGlobeCommands=function(e,t,n,i,r){let o=i.context,s=e.commands[Ie.GLOBE],a=e.indices[Ie.GLOBE];a!==0&&(this._globeTranslucencyFramebuffer=n,n.clearClassification(o,r),JNe(s,a,t,i,r,INt))};sC.prototype.executeGlobeClassificationCommands=function(e,t,n,i,r){let{context:o}=i,{uniformState:s}=o,a=e.commands[Ie.GLOBE],c=e.indices[Ie.GLOBE],u=e.commands[Ie.TERRAIN_CLASSIFICATION],f=e.indices[Ie.TERRAIN_CLASSIFICATION];if(c===0||f===0)return;let d=this._frontFaceTranslucent,p=this._backFaceTranslucent;if((!d||!p)&&XNe(u,f,t,i,r),!d&&!p)return;this._globeTranslucencyFramebuffer=n;let g=s.globeDepthTexture,m=r.framebuffer;if(r.framebuffer=n.classificationFramebuffer,JNe(a,c,t,i,r,PNt),o.depthTexture){let y=n.packDepth(o,r);s.globeDepthTexture=y}XNe(u,f,t,i,r),s.globeDepthTexture=g,r.framebuffer=m};var Mz=sC;var df=`uniform sampler2D colorTexture; +`;t.sources=[n]}function pSt(e,t,n,i,r,o){if(!l(r))return t;if(!i&&l(n))return n;let s=e.shaderCache.getDerivedShaderProgram(t,o);if(!l(s)){let a=t._attributeLocations,c=t.vertexShaderSource.clone(),u=t.fragmentShaderSource.clone();c.defines=l(c.defines)?c.defines.slice(0):[],u.defines=l(u.defines)?u.defines.slice(0):[],r(c,u),s=e.shaderCache.createDerivedShaderProgram(t,o,{vertexShaderSource:c,fragmentShaderSource:u,attributeLocations:a})}return s}function gSt(e){e.cull.face=zi.BACK,e.cull.enabled=!0}function _St(e){e.cull.face=zi.FRONT,e.cull.enabled=!0}function ySt(e){e.cull.face=zi.BACK,e.cull.enabled=!0,e.colorMask={red:!1,green:!1,blue:!1,alpha:!1}}function ASt(e){e.cull.face=zi.FRONT,e.cull.enabled=!0,e.colorMask={red:!1,green:!1,blue:!1,alpha:!1}}function bSt(e){e.cull.enabled=!1,e.colorMask={red:!1,green:!1,blue:!1,alpha:!1}}function FPe(e){e.cull.face=zi.BACK,e.cull.enabled=!0,e.depthMask=!1,e.blending=tn.ALPHA_BLEND}function BPe(e){e.cull.face=zi.FRONT,e.cull.enabled=!0,e.depthMask=!1,e.blending=tn.ALPHA_BLEND}function xSt(e){e.cull.face=zi.BACK,e.cull.enabled=!0,e.blending.enabled=!1}function TSt(e){e.cull.face=zi.FRONT,e.cull.enabled=!0,e.blending.enabled=!1}function ESt(e,t,n,i,r){if(!l(i))return e;if(!n&&l(t))return t;let o=r[e.id];if(!l(o)){let s=Ge.getState(e);i(s),o=Ge.fromCache(s),r[e.id]=o}return o}function mI(e){return{u_classificationTexture:function(){return e._globeTranslucencyFramebuffer.classificationTexture}}}function CSt(e,t,n,i,r){return l(r)?!i&&l(n)?n:Ot(t,r(e),!1):t}function qm(e){this.pass=e.pass,this.pickOnly=e.pickOnly,this.getShaderProgramFunction=e.getShaderProgramFunction,this.getRenderStateFunction=e.getRenderStateFunction,this.getUniformMapFunction=e.getUniformMapFunction,this.renderStateCache={}}function vSt(){return[new qm({pass:Ie.GLOBE,pickOnly:!1,getShaderProgramFunction:fSt,getRenderStateFunction:gSt,getUniformMapFunction:void 0}),new qm({pass:Ie.GLOBE,pickOnly:!1,getShaderProgramFunction:dSt,getRenderStateFunction:_St,getUniformMapFunction:void 0}),new qm({pass:Ie.GLOBE,pickOnly:!1,getShaderProgramFunction:cne,getRenderStateFunction:ySt,getUniformMapFunction:void 0}),new qm({pass:Ie.GLOBE,pickOnly:!1,getShaderProgramFunction:cne,getRenderStateFunction:ASt,getUniformMapFunction:void 0}),new qm({pass:Ie.GLOBE,pickOnly:!1,getShaderProgramFunction:cne,getRenderStateFunction:bSt,getUniformMapFunction:void 0}),new qm({pass:Ie.TRANSLUCENT,pickOnly:!1,getShaderProgramFunction:lne,getRenderStateFunction:FPe,getUniformMapFunction:mI}),new qm({pass:Ie.TRANSLUCENT,pickOnly:!1,getShaderProgramFunction:jPe,getRenderStateFunction:BPe,getUniformMapFunction:mI}),new qm({pass:Ie.TRANSLUCENT,pickOnly:!1,getShaderProgramFunction:hSt,getRenderStateFunction:FPe,getUniformMapFunction:mI}),new qm({pass:Ie.TRANSLUCENT,pickOnly:!1,getShaderProgramFunction:mSt,getRenderStateFunction:BPe,getUniformMapFunction:mI}),new qm({pass:Ie.TRANSLUCENT,pickOnly:!0,getShaderProgramFunction:LPe,getRenderStateFunction:xSt,getUniformMapFunction:mI}),new qm({pass:Ie.TRANSLUCENT,pickOnly:!0,getShaderProgramFunction:LPe,getRenderStateFunction:TSt,getUniformMapFunction:mI})]}var kPe=new Array(IE),UPe=new Array(IE);PE.prototype.updateDerivedCommands=function(e,t){let n=this._derivedCommandTypesToUpdate,i=this._derivedCommandsToUpdateLength;if(i!==0){for(let r=0;r<i;++r)UPe[r]=this._derivedCommandPacks[n[r]],kPe[r]=VPe[n[r]];SSt(this,e,i,n,kPe,UPe,t)}};function SSt(e,t,n,i,r,o,s){let a=t.derivedCommands.globeTranslucency,c=e._derivedCommandsDirty;if(t.dirty||!l(a)||c){t.dirty=!1,l(a)||(a={},t.derivedCommands.globeTranslucency=a);let u=s.frameNumber,f=a.uniformMapDirtyFrame??0,d=a.shaderProgramDirtyFrame??0,p=a.renderStateDirtyFrame??0,g=a.uniformMap!==t.uniformMap,m=a.shaderProgramId!==t.shaderProgram.id,y=a.renderStateId!==t.renderState.id;g&&(a.uniformMapDirtyFrame=u),m&&(a.shaderProgramDirtyFrame=u),y&&(a.renderStateDirtyFrame=u),a.uniformMap=t.uniformMap,a.shaderProgramId=t.shaderProgram.id,a.renderStateId=t.renderState.id;for(let A=0;A<n;++A){let b=o[A],x=i[A],T=r[A],E=a[T],v,S,I;l(E)?(v=E.uniformMap,S=E.shaderProgram,I=E.renderState):(v=void 0,S=void 0,I=void 0),E=at.shallowClone(t,E),a[T]=E;let R=E.derivedCommands.uniformMapDirtyFrame??0,O=E.derivedCommands.shaderProgramDirtyFrame??0,L=E.derivedCommands.renderStateDirtyFrame??0,_=g||R<f,C=m||O<d,w=y||L<p;_&&(E.derivedCommands.uniformMapDirtyFrame=u),C&&(E.derivedCommands.shaderProgramDirtyFrame=u),w&&(E.derivedCommands.renderStateDirtyFrame=u),E.derivedCommands.type=x,E.pass=b.pass,E.pickOnly=b.pickOnly,E.uniformMap=CSt(e,t.uniformMap,v,_,b.getUniformMapFunction),E.shaderProgram=pSt(s.context,t.shaderProgram,S,C,b.getShaderProgramFunction,T),E.renderState=ESt(t.renderState,I,w,b.getRenderStateFunction,b.renderStateCache)}}}PE.prototype.pushDerivedCommands=function(e,t,n){let i=n.passes.pick||n.passes.pickVoxel;if(i&&t)return;let r=this._derivedCommandTypes,o=this._derivedCommandsLength;if(i?(r=this._derivedPickCommandTypes,o=this._derivedPickCommandsLength):t&&(r=this._derivedBlendCommandTypes,o=this._derivedBlendCommandsLength),o===0){n.commandList.push(e);return}let s=e.derivedCommands.globeTranslucency;for(let a=0;a<o;++a){let c=VPe[r[a]];n.commandList.push(s[c])}};function HPe(e,t,n,i,r,o){for(let s=0;s<t;++s){let a=e[s],c=a.derivedCommands.type;(!l(o)||o.indexOf(c)>-1)&&n(a,i,r)}}function zPe(e,t,n,i,r){for(let o=0;o<t;++o)n(e[o],i,r)}var wSt=[bc.OPAQUE_FRONT_FACE,bc.OPAQUE_BACK_FACE],ISt=[bc.DEPTH_ONLY_FRONT_FACE,bc.DEPTH_ONLY_BACK_FACE,bc.DEPTH_ONLY_FRONT_AND_BACK_FACE];PE.prototype.executeGlobeCommands=function(e,t,n,i,r){let o=i.context,s=e.commands[Ie.GLOBE],a=e.indices[Ie.GLOBE];a!==0&&(this._globeTranslucencyFramebuffer=n,n.clearClassification(o,r),HPe(s,a,t,i,r,wSt))};PE.prototype.executeGlobeClassificationCommands=function(e,t,n,i,r){let{context:o}=i,{uniformState:s}=o,a=e.commands[Ie.GLOBE],c=e.indices[Ie.GLOBE],u=e.commands[Ie.TERRAIN_CLASSIFICATION],f=e.indices[Ie.TERRAIN_CLASSIFICATION];if(c===0||f===0)return;let d=this._frontFaceTranslucent,p=this._backFaceTranslucent;if((!d||!p)&&zPe(u,f,t,i,r),!d&&!p)return;this._globeTranslucencyFramebuffer=n;let g=s.globeDepthTexture,m=r.framebuffer;if(r.framebuffer=n.classificationFramebuffer,HPe(a,c,t,i,r,ISt),o.depthTexture){let y=n.packDepth(o,r);s.globeDepthTexture=y}zPe(u,f,t,i,r),s.globeDepthTexture=g,r.framebuffer=m};var TU=PE;var sf=`uniform sampler2D colorTexture; in vec2 v_textureCoordinates; void main() { out_FragColor = texture(colorTexture, v_textureCoordinates); } -`;function B0(){this._numSamples=1,this.previousFramebuffer=void 0,this._previousFramebuffer=void 0,this._depthStencilTexture=void 0,this._depthStencilRenderbuffer=void 0,this._fbo=new ai({depthStencil:!0,createDepthAttachments:!1}),this._fboClassified=new ai({depthStencil:!0,createDepthAttachments:!1}),this._rsUnclassified=void 0,this._rsClassified=void 0,this._unclassifiedCommand=void 0,this._classifiedCommand=void 0,this._translucentCommand=void 0,this._clearColorCommand=new li({color:new z(0,0,0,0),owner:this}),this._clearCommand=new li({color:new z(0,0,0,0),depth:1,stencil:0});let e=this;this._uniformMap={colorTexture:function(){return e._fbo.getColorTexture()},depthTexture:function(){return e._depthStencilTexture},classifiedTexture:function(){return e._fboClassified.getColorTexture()}}}Object.defineProperties(B0.prototype,{unclassifiedCommand:{get:function(){return this._unclassifiedCommand}}});B0.isTranslucencySupported=function(e){return e.depthTexture&&e.fragmentDepth};var DNt={depthMask:!1,stencilTest:{enabled:!0,frontFunction:ti.EQUAL,frontOperation:{fail:Rt.KEEP,zFail:Rt.KEEP,zPass:Rt.KEEP},backFunction:ti.NEVER,reference:0,mask:Yt.CLASSIFICATION_MASK},blending:tn.ALPHA_BLEND},RNt={depthMask:!1,stencilTest:{enabled:!0,frontFunction:ti.NOT_EQUAL,frontOperation:{fail:Rt.KEEP,zFail:Rt.KEEP,zPass:Rt.KEEP},backFunction:ti.NEVER,reference:0,mask:Yt.CLASSIFICATION_MASK},blending:tn.ALPHA_BLEND},ONt={depthMask:!0,depthTest:{enabled:!0},stencilTest:Yt.setCesium3DTileBit(),stencilMask:Yt.CESIUM_3D_TILE_MASK,blending:tn.ALPHA_BLEND},MNt=`uniform sampler2D colorTexture; +`;function C0(){this._numSamples=1,this.previousFramebuffer=void 0,this._previousFramebuffer=void 0,this._depthStencilTexture=void 0,this._depthStencilRenderbuffer=void 0,this._fbo=new ai({depthStencil:!0,createDepthAttachments:!1}),this._fboClassified=new ai({depthStencil:!0,createDepthAttachments:!1}),this._rsUnclassified=void 0,this._rsClassified=void 0,this._unclassifiedCommand=void 0,this._classifiedCommand=void 0,this._translucentCommand=void 0,this._clearColorCommand=new li({color:new z(0,0,0,0),owner:this}),this._clearCommand=new li({color:new z(0,0,0,0),depth:1,stencil:0});let e=this;this._uniformMap={colorTexture:function(){return e._fbo.getColorTexture()},depthTexture:function(){return e._depthStencilTexture},classifiedTexture:function(){return e._fboClassified.getColorTexture()}}}Object.defineProperties(C0.prototype,{unclassifiedCommand:{get:function(){return this._unclassifiedCommand}}});C0.isTranslucencySupported=function(e){return e.depthTexture&&e.fragmentDepth};var PSt={depthMask:!1,stencilTest:{enabled:!0,frontFunction:ei.EQUAL,frontOperation:{fail:Rt.KEEP,zFail:Rt.KEEP,zPass:Rt.KEEP},backFunction:ei.NEVER,reference:0,mask:Yt.CLASSIFICATION_MASK},blending:tn.ALPHA_BLEND},DSt={depthMask:!1,stencilTest:{enabled:!0,frontFunction:ei.NOT_EQUAL,frontOperation:{fail:Rt.KEEP,zFail:Rt.KEEP,zPass:Rt.KEEP},backFunction:ei.NEVER,reference:0,mask:Yt.CLASSIFICATION_MASK},blending:tn.ALPHA_BLEND},RSt={depthMask:!0,depthTest:{enabled:!0},stencilTest:Yt.setCesium3DTileBit(),stencilMask:Yt.CESIUM_3D_TILE_MASK,blending:tn.ALPHA_BLEND},OSt=`uniform sampler2D colorTexture; uniform sampler2D depthTexture; uniform sampler2D classifiedTexture; in vec2 v_textureCoordinates; @@ -10289,7 +10289,7 @@ void main() out_FragColor = color * highlightColor; gl_FragDepth = texture(depthTexture, v_textureCoordinates).r; } -`,NNt=`uniform sampler2D colorTexture; +`,MSt=`uniform sampler2D colorTexture; in vec2 v_textureCoordinates; void main() { @@ -10304,7 +10304,7 @@ void main() out_FragColor = color; #endif } -`;B0.prototype.update=function(e,t,n){let i=this._fbo.getColorTexture(),r=this.previousFramebuffer!==this._previousFramebuffer;this._previousFramebuffer=this.previousFramebuffer;let o=this._numSamples!==t,s=e.drawingBufferWidth,a=e.drawingBufferHeight,c=!l(i)||i.width!==s||i.height!==a;if((c||r||o)&&(this._numSamples=t,this._depthStencilTexture=this._depthStencilTexture&&this._depthStencilTexture.destroy(),this._depthStencilRenderbuffer=this._depthStencilRenderbuffer&&this._depthStencilRenderbuffer.destroy(),l(this._previousFramebuffer)||(this._depthStencilTexture=new Dt({context:e,width:s,height:a,pixelFormat:Ke.DEPTH_STENCIL,pixelDatatype:ze.UNSIGNED_INT_24_8}),t>1&&(this._depthStencilRenderbuffer=new Sf({context:e,width:s,height:a,format:jl.DEPTH24_STENCIL8,numSamples:t})))),!l(this._fbo.framebuffer)||c||r||o){this._fbo.destroy(),this._fboClassified.destroy();let u,f;l(this._previousFramebuffer)?(u=n.getDepthStencilTexture(),f=n.getDepthStencilRenderbuffer()):(u=this._depthStencilTexture,f=this._depthStencilRenderbuffer),this._fbo.setDepthStencilTexture(u),l(f)&&this._fbo.setDepthStencilRenderbuffer(f),this._fbo.update(e,s,a,t),l(this._previousFramebuffer)||(this._fboClassified.setDepthStencilTexture(u),this._fboClassified.update(e,s,a))}if(l(this._rsUnclassified)||(this._rsUnclassified=Ge.fromCache(DNt),this._rsClassified=Ge.fromCache(RNt),this._rsDefault=Ge.fromCache(ONt)),!l(this._unclassifiedCommand)||r||o){l(this._unclassifiedCommand)&&(this._unclassifiedCommand.shaderProgram=this._unclassifiedCommand.shaderProgram&&this._unclassifiedCommand.shaderProgram.destroy(),this._classifiedCommand.shaderProgram=this._classifiedCommand.shaderProgram&&this._classifiedCommand.shaderProgram.destroy());let u=l(this._previousFramebuffer)?NNt:MNt,f=new Ye({defines:["UNCLASSIFIED"],sources:[u]}),d=new Ye({sources:[u]});this._unclassifiedCommand=e.createViewportQuadCommand(f,{renderState:l(this._previousFramebuffer)?this._rsUnclassified:this._rsDefault,uniformMap:this._uniformMap,owner:this}),this._classifiedCommand=e.createViewportQuadCommand(d,{renderState:l(this._previousFramebuffer)?this._rsClassified:this._rsDefault,uniformMap:this._uniformMap,owner:this}),l(this._translucentCommand)&&(this._translucentCommand.shaderProgram=this._translucentCommand.shaderProgram&&this._translucentCommand.shaderProgram.destroy()),l(this._previousFramebuffer)||(this._translucentCommand=e.createViewportQuadCommand(df,{renderState:this._rsUnclassified,uniformMap:this._uniformMap,owner:this}))}};B0.prototype.prepareTextures=function(e,t){this._fbo._numSamples>1&&this._fbo.prepareTextures(e,t)};B0.prototype.clear=function(e,t){l(this._previousFramebuffer)?this._fbo.clear(e,this._clearColorCommand,t):(this._fbo.clear(e,this._clearCommand,t),this._fboClassified.clear(e,this._clearCommand,t))};B0.prototype.executeClassified=function(e,t){if(!l(this._previousFramebuffer)){let n=t.framebuffer;this.prepareTextures(e,!0),t.framebuffer=this._fboClassified.framebuffer,this._translucentCommand.execute(e,t),t.framebuffer=n}this._classifiedCommand.execute(e,t)};B0.prototype.executeUnclassified=function(e,t){this._unclassifiedCommand.execute(e,t)};B0.prototype.isDestroyed=function(){return!1};B0.prototype.destroy=function(){return this._fbo.destroy(),this._fboClassified.destroy(),this._depthStencilTexture=this._depthStencilTexture&&this._depthStencilTexture.destroy(),this._depthStencilRenderbuffer=this._depthStencilRenderbuffer&&this._depthStencilRenderbuffer.destroy(),l(this._unclassifiedCommand)&&(this._unclassifiedCommand.shaderProgram=this._unclassifiedCommand.shaderProgram&&this._unclassifiedCommand.shaderProgram.destroy(),this._classifiedCommand.shaderProgram=this._classifiedCommand.shaderProgram&&this._classifiedCommand.shaderProgram.destroy()),le(this)};var bP=B0;function G7(e){this._total=e,this.usedThisFrame=0,this.stolenFromMeThisFrame=0,this.starvedThisFrame=!1,this.starvedLastFrame=!1}Object.defineProperties(G7.prototype,{total:{get:function(){return this._total}}});function wb(e){let t=new Array(Mc.NUMBER_OF_JOB_TYPES);t[Mc.TEXTURE]=new G7(l(e)?e[Mc.TEXTURE]:10),t[Mc.PROGRAM]=new G7(l(e)?e[Mc.PROGRAM]:10),t[Mc.BUFFER]=new G7(l(e)?e[Mc.BUFFER]:30);let n=t.length,i,r=0;for(i=0;i<n;++i)r+=t[i].total;let o=new Array(n);for(i=0;i<n;++i)o[i]=!1;this._totalBudget=r,this._totalUsedThisFrame=0,this._budgets=t,this._executedThisFrame=o}wb.getTimestamp=xn;Object.defineProperties(wb.prototype,{totalBudget:{get:function(){return this._totalBudget}}});wb.prototype.disableThisFrame=function(){this._totalUsedThisFrame=this._totalBudget};wb.prototype.resetBudgets=function(){let e=this._budgets,t=e.length;for(let n=0;n<t;++n){let i=e[n];i.starvedLastFrame=i.starvedThisFrame,i.starvedThisFrame=!1,i.usedThisFrame=0,i.stolenFromMeThisFrame=0}this._totalUsedThisFrame=0};wb.prototype.execute=function(e,t){let n=this._budgets,i=n[t],r=this._executedThisFrame[t];if(this._totalUsedThisFrame>=this._totalBudget&&r)return i.starvedThisFrame=!0,!1;let o;if(i.usedThisFrame+i.stolenFromMeThisFrame>=i.total){let c=n.length,u;for(u=0;u<c&&(o=n[u],!(o.usedThisFrame+o.stolenFromMeThisFrame<o.total&&!o.starvedLastFrame));++u);if(u===c&&r)return!1;r&&(i.starvedThisFrame=!0)}let s=wb.getTimestamp();e.execute();let a=wb.getTimestamp()-s;return this._totalUsedThisFrame+=a,o?o.stolenFromMeThisFrame+=a:i.usedThisFrame+=a,this._executedThisFrame[t]=!0,!0};var Nz=wb;function W7(e){e=e??H.EMPTY_OBJECT;let t=Ln(e.container);this._container=t;let n=document.createElement("div");n.className="cesium-performanceDisplay";let i=document.createElement("div");i.className="cesium-performanceDisplay-fps",this._fpsText=document.createTextNode(""),i.appendChild(this._fpsText);let r=document.createElement("div");r.className="cesium-performanceDisplay-ms",this._msText=document.createTextNode(""),r.appendChild(this._msText),n.appendChild(r),n.appendChild(i),this._container.appendChild(n),this._lastFpsSampleTime=xn(),this._lastMsSampleTime=xn(),this._fpsFrameCount=0,this._msFrameCount=0,this._throttled=!1;let o=document.createElement("div");o.className="cesium-performanceDisplay-throttled",this._throttledText=document.createTextNode(""),o.appendChild(this._throttledText),n.appendChild(o)}Object.defineProperties(W7.prototype,{throttled:{get:function(){return this._throttled},set:function(e){this._throttled!==e&&(e?this._throttledText.nodeValue="(throttled)":this._throttledText.nodeValue="",this._throttled=e)}}});W7.prototype.update=function(e){let t=xn(),n=e??!0;this._fpsFrameCount++;let i=t-this._lastFpsSampleTime;if(i>1e3){let o="N/A";n&&(o=this._fpsFrameCount*1e3/i|0),this._fpsText.nodeValue=`${o} FPS`,this._lastFpsSampleTime=t,this._fpsFrameCount=0}this._msFrameCount++;let r=t-this._lastMsSampleTime;if(r>200){let o="N/A";n&&(o=(r/this._msFrameCount).toFixed(2)),this._msText.nodeValue=`${o} MS`,this._lastMsSampleTime=t,this._msFrameCount=0}};W7.prototype.destroy=function(){return le(this)};var ny=W7;var Tc={};Tc.decodeRawMetadataValue=function(e,t,n){switch(e){case Lt.INT8:return t.getInt8(n);case Lt.UINT8:return t.getUint8(n);case Lt.INT16:return t.getInt16(n,!0);case Lt.UINT16:return t.getUint16(n,!0);case Lt.INT32:return t.getInt32(n,!0);case Lt.UINT32:return t.getUint32(n,!0);case Lt.INT64:return t.getBigInt64(n,!0);case Lt.UINT64:return t.getBigUint64(n,!0);case Lt.FLOAT32:return t.getFloat32(n,!0);case Lt.FLOAT64:return t.getFloat64(n,!0)}throw new oe(`Invalid component type: ${e}`)};Tc.decodeRawMetadataValueComponent=function(e,t,n){let i=e.componentType,r=Tc.decodeRawMetadataValue(i,t,n);return e.normalized?Lt.normalize(r,i):r};Tc.decodeRawMetadataValueElement=function(e,t,n){let i=e.componentType,r=Lt.getSizeInBytes(i),o=e.type,s=bt.getComponentCount(o),a=r*s;if(s>1){let f=Array(s);for(let d=0;d<s;d++){let p=n*a+d*r,g=Tc.decodeRawMetadataValueComponent(e,t,p);f[d]=g}return f}let c=n*a;return Tc.decodeRawMetadataValueComponent(e,t,c)};Tc.decodeRawMetadataValues=function(e,t){let n=new DataView(t.buffer,t.byteOffset,t.byteLength);if(e.isArray){let r=e.arrayLength,o=Array(r);for(let s=0;s<r;s++){let a=Tc.decodeRawMetadataValueElement(e,n,s);o[s]=a}return o}return Tc.decodeRawMetadataValueElement(e,n,0)};Tc.convertToObjectType=function(e,t){if(!l(t)||e===bt.SCALAR||e===bt.STRING||e===bt.BOOLEAN||e===bt.ENUM)return t;let n=t.map(i=>Number(i));switch(e){case bt.VEC2:return U.unpack(n,0,new U);case bt.VEC3:return h.unpack(n,0,new h);case bt.VEC4:return se.unpack(n,0,new se);case bt.MAT2:return Xi.unpack(n,0,new Xi);case bt.MAT3:return $.unpack(n,0,new $);case bt.MAT4:return N.unpack(n,0,new N)}throw new oe(`Invalid metadata object type: ${e}`)};Tc.convertFromObjectType=function(e,t){if(!l(t)||e===bt.SCALAR||e===bt.STRING||e===bt.BOOLEAN||e===bt.ENUM)return t;switch(e){case bt.VEC2:return U.pack(t,Array(2));case bt.VEC3:return h.pack(t,Array(3));case bt.VEC4:return se.pack(t,Array(4));case bt.MAT2:return Xi.pack(t,Array(4));case bt.MAT3:return $.pack(t,Array(9));case bt.MAT4:return N.pack(t,Array(16))}throw new oe(`Invalid metadata object type: ${e}`)};Tc.decodeMetadataValues=function(e,t,n){let i=Tc.decodeRawMetadataValues(e,n);if(t.hasValueTransform){let o=Tc.convertFromObjectType(e.type,t.offset),s=Tc.convertFromObjectType(e.type,t.scale);i=Vp.valueTransformInPlace(i,o,s,Lt.applyValueTransform)}if(e.isArray){let o=e.arrayLength,s=Array(o);for(let a=0;a<o;a++){let c=i[a],u=Tc.convertToObjectType(e.type,c);s[a]=u}return s}return Tc.convertToObjectType(e.type,i)};var Lz=Object.freeze(Tc);function aC(){this._framebuffer=new ai,this._textureToCopy=void 0,this._copyDepthCommand=void 0}Object.defineProperties(aC.prototype,{framebuffer:{get:function(){return this._framebuffer.framebuffer}}});function LNt(e,t,n){let{width:i,height:r}=n;e._framebuffer.update(t,i,r)}function FNt(e,t,n){l(e._copyDepthCommand)||(e._copyDepthCommand=t.createViewportQuadCommand(`uniform highp sampler2D colorTexture; +`;C0.prototype.update=function(e,t,n){let i=this._fbo.getColorTexture(),r=this.previousFramebuffer!==this._previousFramebuffer;this._previousFramebuffer=this.previousFramebuffer;let o=this._numSamples!==t,s=e.drawingBufferWidth,a=e.drawingBufferHeight,c=!l(i)||i.width!==s||i.height!==a;if((c||r||o)&&(this._numSamples=t,this._depthStencilTexture=this._depthStencilTexture&&this._depthStencilTexture.destroy(),this._depthStencilRenderbuffer=this._depthStencilRenderbuffer&&this._depthStencilRenderbuffer.destroy(),l(this._previousFramebuffer)||(this._depthStencilTexture=new Dt({context:e,width:s,height:a,pixelFormat:Ke.DEPTH_STENCIL,pixelDatatype:ze.UNSIGNED_INT_24_8}),t>1&&(this._depthStencilRenderbuffer=new Sf({context:e,width:s,height:a,format:jl.DEPTH24_STENCIL8,numSamples:t})))),!l(this._fbo.framebuffer)||c||r||o){this._fbo.destroy(),this._fboClassified.destroy();let u,f;l(this._previousFramebuffer)?(u=n.getDepthStencilTexture(),f=n.getDepthStencilRenderbuffer()):(u=this._depthStencilTexture,f=this._depthStencilRenderbuffer),this._fbo.setDepthStencilTexture(u),l(f)&&this._fbo.setDepthStencilRenderbuffer(f),this._fbo.update(e,s,a,t),l(this._previousFramebuffer)||(this._fboClassified.setDepthStencilTexture(u),this._fboClassified.update(e,s,a))}if(l(this._rsUnclassified)||(this._rsUnclassified=Ge.fromCache(PSt),this._rsClassified=Ge.fromCache(DSt),this._rsDefault=Ge.fromCache(RSt)),!l(this._unclassifiedCommand)||r||o){l(this._unclassifiedCommand)&&(this._unclassifiedCommand.shaderProgram=this._unclassifiedCommand.shaderProgram&&this._unclassifiedCommand.shaderProgram.destroy(),this._classifiedCommand.shaderProgram=this._classifiedCommand.shaderProgram&&this._classifiedCommand.shaderProgram.destroy());let u=l(this._previousFramebuffer)?MSt:OSt,f=new Ye({defines:["UNCLASSIFIED"],sources:[u]}),d=new Ye({sources:[u]});this._unclassifiedCommand=e.createViewportQuadCommand(f,{renderState:l(this._previousFramebuffer)?this._rsUnclassified:this._rsDefault,uniformMap:this._uniformMap,owner:this}),this._classifiedCommand=e.createViewportQuadCommand(d,{renderState:l(this._previousFramebuffer)?this._rsClassified:this._rsDefault,uniformMap:this._uniformMap,owner:this}),l(this._translucentCommand)&&(this._translucentCommand.shaderProgram=this._translucentCommand.shaderProgram&&this._translucentCommand.shaderProgram.destroy()),l(this._previousFramebuffer)||(this._translucentCommand=e.createViewportQuadCommand(sf,{renderState:this._rsUnclassified,uniformMap:this._uniformMap,owner:this}))}};C0.prototype.prepareTextures=function(e,t){this._fbo._numSamples>1&&this._fbo.prepareTextures(e,t)};C0.prototype.clear=function(e,t){l(this._previousFramebuffer)?this._fbo.clear(e,this._clearColorCommand,t):(this._fbo.clear(e,this._clearCommand,t),this._fboClassified.clear(e,this._clearCommand,t))};C0.prototype.executeClassified=function(e,t){if(!l(this._previousFramebuffer)){let n=t.framebuffer;this.prepareTextures(e,!0),t.framebuffer=this._fboClassified.framebuffer,this._translucentCommand.execute(e,t),t.framebuffer=n}this._classifiedCommand.execute(e,t)};C0.prototype.executeUnclassified=function(e,t){this._unclassifiedCommand.execute(e,t)};C0.prototype.isDestroyed=function(){return!1};C0.prototype.destroy=function(){return this._fbo.destroy(),this._fboClassified.destroy(),this._depthStencilTexture=this._depthStencilTexture&&this._depthStencilTexture.destroy(),this._depthStencilRenderbuffer=this._depthStencilRenderbuffer&&this._depthStencilRenderbuffer.destroy(),l(this._unclassifiedCommand)&&(this._unclassifiedCommand.shaderProgram=this._unclassifiedCommand.shaderProgram&&this._unclassifiedCommand.shaderProgram.destroy(),this._classifiedCommand.shaderProgram=this._classifiedCommand.shaderProgram&&this._classifiedCommand.shaderProgram.destroy()),le(this)};var pI=C0;function M5(e){this._total=e,this.usedThisFrame=0,this.stolenFromMeThisFrame=0,this.starvedThisFrame=!1,this.starvedLastFrame=!1}Object.defineProperties(M5.prototype,{total:{get:function(){return this._total}}});function sb(e){let t=new Array(Fc.NUMBER_OF_JOB_TYPES);t[Fc.TEXTURE]=new M5(l(e)?e[Fc.TEXTURE]:10),t[Fc.PROGRAM]=new M5(l(e)?e[Fc.PROGRAM]:10),t[Fc.BUFFER]=new M5(l(e)?e[Fc.BUFFER]:30);let n=t.length,i,r=0;for(i=0;i<n;++i)r+=t[i].total;let o=new Array(n);for(i=0;i<n;++i)o[i]=!1;this._totalBudget=r,this._totalUsedThisFrame=0,this._budgets=t,this._executedThisFrame=o}sb.getTimestamp=xn;Object.defineProperties(sb.prototype,{totalBudget:{get:function(){return this._totalBudget}}});sb.prototype.disableThisFrame=function(){this._totalUsedThisFrame=this._totalBudget};sb.prototype.resetBudgets=function(){let e=this._budgets,t=e.length;for(let n=0;n<t;++n){let i=e[n];i.starvedLastFrame=i.starvedThisFrame,i.starvedThisFrame=!1,i.usedThisFrame=0,i.stolenFromMeThisFrame=0}this._totalUsedThisFrame=0};sb.prototype.execute=function(e,t){let n=this._budgets,i=n[t],r=this._executedThisFrame[t];if(this._totalUsedThisFrame>=this._totalBudget&&r)return i.starvedThisFrame=!0,!1;let o;if(i.usedThisFrame+i.stolenFromMeThisFrame>=i.total){let c=n.length,u;for(u=0;u<c&&(o=n[u],!(o.usedThisFrame+o.stolenFromMeThisFrame<o.total&&!o.starvedLastFrame));++u);if(u===c&&r)return!1;r&&(i.starvedThisFrame=!0)}let s=sb.getTimestamp();e.execute();let a=sb.getTimestamp()-s;return this._totalUsedThisFrame+=a,o?o.stolenFromMeThisFrame+=a:i.usedThisFrame+=a,this._executedThisFrame[t]=!0,!0};var EU=sb;function N5(e){e=e??H.EMPTY_OBJECT;let t=Ln(e.container);this._container=t;let n=document.createElement("div");n.className="cesium-performanceDisplay";let i=document.createElement("div");i.className="cesium-performanceDisplay-fps",this._fpsText=document.createTextNode(""),i.appendChild(this._fpsText);let r=document.createElement("div");r.className="cesium-performanceDisplay-ms",this._msText=document.createTextNode(""),r.appendChild(this._msText),n.appendChild(r),n.appendChild(i),this._container.appendChild(n),this._lastFpsSampleTime=xn(),this._lastMsSampleTime=xn(),this._fpsFrameCount=0,this._msFrameCount=0,this._throttled=!1;let o=document.createElement("div");o.className="cesium-performanceDisplay-throttled",this._throttledText=document.createTextNode(""),o.appendChild(this._throttledText),n.appendChild(o)}Object.defineProperties(N5.prototype,{throttled:{get:function(){return this._throttled},set:function(e){this._throttled!==e&&(e?this._throttledText.nodeValue="(throttled)":this._throttledText.nodeValue="",this._throttled=e)}}});N5.prototype.update=function(e){let t=xn(),n=e??!0;this._fpsFrameCount++;let i=t-this._lastFpsSampleTime;if(i>1e3){let o="N/A";n&&(o=this._fpsFrameCount*1e3/i|0),this._fpsText.nodeValue=`${o} FPS`,this._lastFpsSampleTime=t,this._fpsFrameCount=0}this._msFrameCount++;let r=t-this._lastMsSampleTime;if(r>200){let o="N/A";n&&(o=(r/this._msFrameCount).toFixed(2)),this._msText.nodeValue=`${o} MS`,this._lastMsSampleTime=t,this._msFrameCount=0}};N5.prototype.destroy=function(){return le(this)};var k_=N5;var xc={};xc.decodeRawMetadataValue=function(e,t,n){switch(e){case Lt.INT8:return t.getInt8(n);case Lt.UINT8:return t.getUint8(n);case Lt.INT16:return t.getInt16(n,!0);case Lt.UINT16:return t.getUint16(n,!0);case Lt.INT32:return t.getInt32(n,!0);case Lt.UINT32:return t.getUint32(n,!0);case Lt.INT64:return t.getBigInt64(n,!0);case Lt.UINT64:return t.getBigUint64(n,!0);case Lt.FLOAT32:return t.getFloat32(n,!0);case Lt.FLOAT64:return t.getFloat64(n,!0)}throw new oe(`Invalid component type: ${e}`)};xc.decodeRawMetadataValueComponent=function(e,t,n){let i=e.componentType,r=xc.decodeRawMetadataValue(i,t,n);return e.normalized?Lt.normalize(r,i):r};xc.decodeRawMetadataValueElement=function(e,t,n){let i=e.componentType,r=Lt.getSizeInBytes(i),o=e.type,s=bt.getComponentCount(o),a=r*s;if(s>1){let f=Array(s);for(let d=0;d<s;d++){let p=n*a+d*r,g=xc.decodeRawMetadataValueComponent(e,t,p);f[d]=g}return f}let c=n*a;return xc.decodeRawMetadataValueComponent(e,t,c)};xc.decodeRawMetadataValues=function(e,t){let n=new DataView(t.buffer,t.byteOffset,t.byteLength);if(e.isArray){let r=e.arrayLength,o=Array(r);for(let s=0;s<r;s++){let a=xc.decodeRawMetadataValueElement(e,n,s);o[s]=a}return o}return xc.decodeRawMetadataValueElement(e,n,0)};xc.convertToObjectType=function(e,t){if(!l(t)||e===bt.SCALAR||e===bt.STRING||e===bt.BOOLEAN||e===bt.ENUM)return t;let n=t.map(i=>Number(i));switch(e){case bt.VEC2:return U.unpack(n,0,new U);case bt.VEC3:return h.unpack(n,0,new h);case bt.VEC4:return se.unpack(n,0,new se);case bt.MAT2:return Xi.unpack(n,0,new Xi);case bt.MAT3:return $.unpack(n,0,new $);case bt.MAT4:return N.unpack(n,0,new N)}throw new oe(`Invalid metadata object type: ${e}`)};xc.convertFromObjectType=function(e,t){if(!l(t)||e===bt.SCALAR||e===bt.STRING||e===bt.BOOLEAN||e===bt.ENUM)return t;switch(e){case bt.VEC2:return U.pack(t,Array(2));case bt.VEC3:return h.pack(t,Array(3));case bt.VEC4:return se.pack(t,Array(4));case bt.MAT2:return Xi.pack(t,Array(4));case bt.MAT3:return $.pack(t,Array(9));case bt.MAT4:return N.pack(t,Array(16))}throw new oe(`Invalid metadata object type: ${e}`)};xc.decodeMetadataValues=function(e,t,n){let i=xc.decodeRawMetadataValues(e,n);if(t.hasValueTransform){let o=xc.convertFromObjectType(e.type,t.offset),s=xc.convertFromObjectType(e.type,t.scale);i=Jp.valueTransformInPlace(i,o,s,Lt.applyValueTransform)}if(e.isArray){let o=e.arrayLength,s=Array(o);for(let a=0;a<o;a++){let c=i[a],u=xc.convertToObjectType(e.type,c);s[a]=u}return s}return xc.convertToObjectType(e.type,i)};var CU=Object.freeze(xc);function DE(){this._framebuffer=new ai,this._textureToCopy=void 0,this._copyDepthCommand=void 0}Object.defineProperties(DE.prototype,{framebuffer:{get:function(){return this._framebuffer.framebuffer}}});function NSt(e,t,n){let{width:i,height:r}=n;e._framebuffer.update(t,i,r)}function LSt(e,t,n){l(e._copyDepthCommand)||(e._copyDepthCommand=t.createViewportQuadCommand(`uniform highp sampler2D colorTexture; in vec2 v_textureCoordinates; @@ -10316,24 +10316,24 @@ void main() out_FragColor = czm_branchFreeTernary(globeDepth <= 0.0 || globeDepth >= 1.0 || depth < globeDepth && depth > 0.0 && depth < 1.0, czm_packDepth(depth), globeDepthPacked); } -`,{renderState:Ge.fromCache(),uniformMap:{colorTexture:function(){return e._textureToCopy}},owner:e})),e._textureToCopy=n,e._copyDepthCommand.framebuffer=e.framebuffer}aC.prototype.update=function(e,t){LNt(this,e,t),FNt(this,e,t)};var BNt=new se,kNt=new se(1,1/255,1/65025,1/16581375);aC.prototype.getDepth=function(e,t,n){if(!l(this.framebuffer))return;let i=e.readPixels({x:t,y:n,width:1,height:1,framebuffer:this.framebuffer}),r=se.unpack(i,0,BNt);return se.divideByScalar(r,255,r),se.dot(r,kNt)};aC.prototype.executeCopyDepth=function(e,t){this._copyDepthCommand.execute(e,t)};aC.prototype.isDestroyed=function(){return!1};aC.prototype.destroy=function(){return this._framebuffer.destroy(),l(this._copyDepthCommand)&&(this._copyDepthCommand.shaderProgram=l(this._copyDepthCommand.shaderProgram)&&this._copyDepthCommand.shaderProgram.destroy()),le(this)};var Fz=aC;function Ib(){this._framebufferManager=new ai({colorAttachmentsLength:3,createColorAttachments:!0,depthStencil:!0,supportsDepthTexture:!0,color:!0}),this._framebuffer=void 0,this._colorTexture=void 0,this._idTexture=void 0,this._depthTexture=void 0,this._depthStencilTexture=void 0,this._clearCommand=new li({color:new z(0,0,0,0),depth:1,stencil:0,owner:this})}Object.defineProperties(Ib.prototype,{framebuffer:{get:function(){return this._framebuffer}},colorTexture:{get:function(){return this._colorTexture}},idTexture:{get:function(){return this._idTexture}},depthTexture:{get:function(){return this._depthTexture}},depthStencilTexture:{get:function(){return this._depthStencilTexture}}});Ib.prototype.update=function(e,t,n,i,r){let o=t.width,s=t.height,a=n?e.halfFloatingPointTexture?ze.HALF_FLOAT:ze.FLOAT:ze.UNSIGNED_BYTE,c=this._framebufferManager.update(e,o,s,1,a,Ke.RGBA);return this._framebufferManager.framebuffer&&(this._framebuffer=this._framebufferManager.framebuffer,this._colorTexture=l(i)?i:this._framebufferManager.getColorTexture(0),this._idTexture=this._framebufferManager.getColorTexture(1),this._depthTexture=this._framebufferManager.getColorTexture(2),this._depthStencilTexture=l(r)?r:this._framebufferManager.getDepthStencilTexture()),c};Ib.prototype.clear=function(e,t,n){this.getClearCommand(n).execute(e,t)};Ib.prototype.getClearCommand=function(e){return this._clearCommand.framebuffer=this._framebuffer,l(e)&&z.clone(e,this._clearCommand.color),this._clearCommand};Ib.prototype.getFramebuffer=function(e,t,n,i){return this.update(e,t,!1,n,i),this._framebuffer};Ib.prototype.isDestroyed=function(){return!1};Ib.prototype.destroy=function(){return this._framebufferManager=this._framebufferManager&&this._framebufferManager.destroy(),this._clearCommand=void 0,le(this)};var Bz=Ib;function cC(){this._framebufferManager=new ai({colorAttachmentsLength:1,createColorAttachments:!0,depthStencil:!0,supportsDepthTexture:!0,color:!0}),this._framebuffer=void 0,this._idTexture=void 0,this._depthStencilTexture=void 0,this._clearCommand=new li({color:new z(0,0,0,0),depth:1,stencil:0,owner:this})}Object.defineProperties(cC.prototype,{framebuffer:{get:function(){return this._framebuffer}},idTexture:{get:function(){return this._idTexture}},depthStencilTexture:{get:function(){return this._depthStencilTexture}}});cC.prototype.update=function(e,t,n){let i=t.width,r=t.height,o=e.colorBufferFloat?ze.FLOAT:ze.UNSIGNED_BYTE,s=this._framebufferManager.update(e,i,r,1,o,Ke.RED);return this._framebufferManager.framebuffer&&(this._framebuffer=this._framebufferManager.framebuffer,this._idTexture=this._framebufferManager.getColorTexture(0),this._depthStencilTexture=this._framebufferManager.getDepthStencilTexture()),s};cC.prototype.getClearCommand=function(e){return this._clearCommand.framebuffer=this._framebuffer,l(e)&&z.clone(e,this._clearCommand.color),this._clearCommand};cC.prototype.releaseResources=function(){l(this._framebuffer)&&(this._framebufferManager.destroy(),this._framebuffer=void 0,this._idTexture=void 0,this._depthStencilTexture=void 0)};cC.prototype.isDestroyed=function(){return!1};cC.prototype.destroy=function(){return this._framebufferManager=this._framebufferManager&&this._framebufferManager.destroy(),this._clearCommand=void 0,le(this)};var kz=cC;function UNt(e,t){this.near=e??0,this.far=t??0;let n=Ie.NUMBER_OF_PASSES,i=new Array(n),r=new Array(n);for(let o=0;o<n;++o)i[o]=[],r[o]=0;this.commands=i,this.indices=r}var Uz=UNt;var Pb=`uniform highp sampler2D u_depthTexture; +`,{renderState:Ge.fromCache(),uniformMap:{colorTexture:function(){return e._textureToCopy}},owner:e})),e._textureToCopy=n,e._copyDepthCommand.framebuffer=e.framebuffer}DE.prototype.update=function(e,t){NSt(this,e,t),LSt(this,e,t)};var FSt=new se,BSt=new se(1,1/255,1/65025,1/16581375);DE.prototype.getDepth=function(e,t,n){if(!l(this.framebuffer))return;let i=e.readPixels({x:t,y:n,width:1,height:1,framebuffer:this.framebuffer}),r=se.unpack(i,0,FSt);return se.divideByScalar(r,255,r),se.dot(r,BSt)};DE.prototype.executeCopyDepth=function(e,t){this._copyDepthCommand.execute(e,t)};DE.prototype.isDestroyed=function(){return!1};DE.prototype.destroy=function(){return this._framebuffer.destroy(),l(this._copyDepthCommand)&&(this._copyDepthCommand.shaderProgram=l(this._copyDepthCommand.shaderProgram)&&this._copyDepthCommand.shaderProgram.destroy()),le(this)};var vU=DE;function ab(){this._framebufferManager=new ai({colorAttachmentsLength:3,createColorAttachments:!0,depthStencil:!0,supportsDepthTexture:!0,color:!0}),this._framebuffer=void 0,this._colorTexture=void 0,this._idTexture=void 0,this._depthTexture=void 0,this._depthStencilTexture=void 0,this._clearCommand=new li({color:new z(0,0,0,0),depth:1,stencil:0,owner:this})}Object.defineProperties(ab.prototype,{framebuffer:{get:function(){return this._framebuffer}},colorTexture:{get:function(){return this._colorTexture}},idTexture:{get:function(){return this._idTexture}},depthTexture:{get:function(){return this._depthTexture}},depthStencilTexture:{get:function(){return this._depthStencilTexture}}});ab.prototype.update=function(e,t,n,i,r){let o=t.width,s=t.height,a=n?e.halfFloatingPointTexture?ze.HALF_FLOAT:ze.FLOAT:ze.UNSIGNED_BYTE,c=this._framebufferManager.update(e,o,s,1,a,Ke.RGBA);return this._framebufferManager.framebuffer&&(this._framebuffer=this._framebufferManager.framebuffer,this._colorTexture=l(i)?i:this._framebufferManager.getColorTexture(0),this._idTexture=this._framebufferManager.getColorTexture(1),this._depthTexture=this._framebufferManager.getColorTexture(2),this._depthStencilTexture=l(r)?r:this._framebufferManager.getDepthStencilTexture()),c};ab.prototype.clear=function(e,t,n){this.getClearCommand(n).execute(e,t)};ab.prototype.getClearCommand=function(e){return this._clearCommand.framebuffer=this._framebuffer,l(e)&&z.clone(e,this._clearCommand.color),this._clearCommand};ab.prototype.getFramebuffer=function(e,t,n,i){return this.update(e,t,!1,n,i),this._framebuffer};ab.prototype.isDestroyed=function(){return!1};ab.prototype.destroy=function(){return this._framebufferManager=this._framebufferManager&&this._framebufferManager.destroy(),this._clearCommand=void 0,le(this)};var SU=ab;function RE(){this._framebufferManager=new ai({colorAttachmentsLength:1,createColorAttachments:!0,depthStencil:!0,supportsDepthTexture:!0,color:!0}),this._framebuffer=void 0,this._idTexture=void 0,this._depthStencilTexture=void 0,this._clearCommand=new li({color:new z(0,0,0,0),depth:1,stencil:0,owner:this})}Object.defineProperties(RE.prototype,{framebuffer:{get:function(){return this._framebuffer}},idTexture:{get:function(){return this._idTexture}},depthStencilTexture:{get:function(){return this._depthStencilTexture}}});RE.prototype.update=function(e,t,n){let i=t.width,r=t.height,o=e.colorBufferFloat?ze.FLOAT:ze.UNSIGNED_BYTE,s=this._framebufferManager.update(e,i,r,1,o,Ke.RED);return this._framebufferManager.framebuffer&&(this._framebuffer=this._framebufferManager.framebuffer,this._idTexture=this._framebufferManager.getColorTexture(0),this._depthStencilTexture=this._framebufferManager.getDepthStencilTexture()),s};RE.prototype.getClearCommand=function(e){return this._clearCommand.framebuffer=this._framebuffer,l(e)&&z.clone(e,this._clearCommand.color),this._clearCommand};RE.prototype.releaseResources=function(){l(this._framebuffer)&&(this._framebufferManager.destroy(),this._framebuffer=void 0,this._idTexture=void 0,this._depthStencilTexture=void 0)};RE.prototype.isDestroyed=function(){return!1};RE.prototype.destroy=function(){return this._framebufferManager=this._framebufferManager&&this._framebufferManager.destroy(),this._clearCommand=void 0,le(this)};var wU=RE;function kSt(e,t){this.near=e??0,this.far=t??0;let n=Ie.NUMBER_OF_PASSES,i=new Array(n),r=new Array(n);for(let o=0;o<n;++o)i[o]=[],r[o]=0;this.commands=i,this.indices=r}var IU=kSt;var cb=`uniform highp sampler2D u_depthTexture; in vec2 v_textureCoordinates; void main() { out_FragColor = czm_packDepth(texture(u_depthTexture, v_textureCoordinates).r); } -`;function k0(){this._picking=!1,this._snapping=!1,this._numSamples=1,this._tempCopyDepthTexture=void 0,this._pickColorFramebuffer=new ai({depthStencil:!0,supportsDepthTexture:!0}),this._snapColorFramebuffer=new ai({depthStencil:!0,supportsDepthTexture:!0,pixelDatatype:ze.FLOAT,pixelFormat:Ke.RGBA}),this._outputFramebuffer=new ai({depthStencil:!0,supportsDepthTexture:!0}),this._copyDepthFramebuffer=new ai,this._tempCopyDepthFramebuffer=new ai,this._updateDepthFramebuffer=new ai({createColorAttachments:!1,createDepthAttachments:!1,depthStencil:!0}),this._clearGlobeColorCommand=void 0,this._copyColorCommand=void 0,this._copyDepthCommand=void 0,this._tempCopyDepthCommand=void 0,this._updateDepthCommand=void 0,this._viewport=new et,this._rs=void 0,this._rsBlend=void 0,this._rsUpdate=void 0,this._useScissorTest=!1,this._scissorRectangle=void 0,this._useHdr=void 0,this._clearGlobeDepth=void 0}Object.defineProperties(k0.prototype,{colorFramebufferManager:{get:function(){return this._snapping?this._snapColorFramebuffer:this._picking?this._pickColorFramebuffer:this._outputFramebuffer}},framebuffer:{get:function(){return this.colorFramebufferManager.framebuffer}},depthStencilTexture:{get:function(){return this.colorFramebufferManager.getDepthStencilTexture()}},picking:{get:function(){return this._picking},set:function(e){this._picking=e}},snapping:{get:function(){return this._snapping},set:function(e){this._snapping=e}}});function ZNe(e,t,n,i,r){let o=e._viewport;o.width=n,o.height=i;let s=!et.equals(o,r.viewport),a=s!==e._useScissorTest;e._useScissorTest=s,et.equals(e._scissorRectangle,r.viewport)||(e._scissorRectangle=et.clone(r.viewport,e._scissorRectangle),a=!0),(!l(e._rs)||!et.equals(o,e._rs.viewport)||a)&&(e._rs=Ge.fromCache({viewport:o,scissorTest:{enabled:e._useScissorTest,rectangle:e._scissorRectangle}}),e._rsBlend=Ge.fromCache({viewport:o,scissorTest:{enabled:e._useScissorTest,rectangle:e._scissorRectangle},blending:tn.ALPHA_BLEND}),e._rsUpdate=Ge.fromCache({viewport:o,scissorTest:{enabled:e._useScissorTest,rectangle:e._scissorRectangle},stencilTest:{enabled:!0,frontFunction:ti.EQUAL,frontOperation:{fail:Rt.KEEP,zFail:Rt.KEEP,zPass:Rt.KEEP},backFunction:ti.NEVER,reference:Yt.CESIUM_3D_TILE_MASK,mask:Yt.CESIUM_3D_TILE_MASK}})),l(e._copyDepthCommand)||(e._copyDepthCommand=t.createViewportQuadCommand(Pb,{uniformMap:{u_depthTexture:function(){return e.colorFramebufferManager.getDepthStencilTexture()}},owner:e})),e._copyDepthCommand.framebuffer=e._copyDepthFramebuffer.framebuffer,e._copyDepthCommand.renderState=e._rs,l(e._copyColorCommand)||(e._copyColorCommand=t.createViewportQuadCommand(df,{uniformMap:{colorTexture:function(){return e.colorFramebufferManager.getColorTexture()}},owner:e})),e._copyColorCommand.renderState=e._rs,l(e._tempCopyDepthCommand)||(e._tempCopyDepthCommand=t.createViewportQuadCommand(Pb,{uniformMap:{u_depthTexture:function(){return e._tempCopyDepthTexture}},owner:e})),e._tempCopyDepthCommand.framebuffer=e._tempCopyDepthFramebuffer.framebuffer,e._tempCopyDepthCommand.renderState=e._rs,l(e._updateDepthCommand)||(e._updateDepthCommand=t.createViewportQuadCommand(df,{uniformMap:{colorTexture:function(){return e._tempCopyDepthFramebuffer.getColorTexture()}},owner:e})),e._updateDepthCommand.framebuffer=e._updateDepthFramebuffer.framebuffer,e._updateDepthCommand.renderState=e._rsUpdate,l(e._clearGlobeColorCommand)||(e._clearGlobeColorCommand=new li({color:new z(0,0,0,0),stencil:0,owner:e})),e._clearGlobeColorCommand.framebuffer=e.framebuffer}k0.prototype.update=function(e,t,n,i,r,o){let{width:s,height:a}=n,c=r?e.halfFloatingPointTexture?ze.HALF_FLOAT:ze.FLOAT:ze.UNSIGNED_BYTE;this._numSamples=i,this.snapping?this._snapColorFramebuffer.update(e,s,a):this.picking?this._pickColorFramebuffer.update(e,s,a):this._outputFramebuffer.update(e,s,a,i,c),this._copyDepthFramebuffer.update(e,s,a),ZNe(this,e,s,a,t),e.uniformState.globeDepthTexture=void 0,this._clearGlobeDepth=o};k0.prototype.prepareColorTextures=function(e,t){!this.picking&&this._numSamples>1&&this._outputFramebuffer.prepareTextures(e,t)};k0.prototype.executeCopyDepth=function(e,t){l(this._copyDepthCommand)&&(this.prepareColorTextures(e),this._copyDepthCommand.execute(e,t),e.uniformState.globeDepthTexture=this._copyDepthFramebuffer.getColorTexture())};k0.prototype.executeUpdateDepth=function(e,t,n){let i=l(n)?n:t.framebuffer.depthStencilTexture;if(!this._clearGlobeDepth&&i===this.colorFramebufferManager.getDepthStencilTexture()){l(this._copyDepthCommand)&&this._copyDepthCommand.execute(e,t);return}if(!l(this._updateDepthCommand))return;let r=this._updateDepthFramebuffer;if(!l(r.framebuffer)||r.getDepthStencilTexture()!==i||r.getColorTexture()!==this._copyDepthFramebuffer.getColorTexture()){let o=this._copyDepthFramebuffer.getColorTexture(),{width:s,height:a}=o;this._tempCopyDepthFramebuffer.destroy(),this._tempCopyDepthFramebuffer.update(e,s,a),r.setColorTexture(o,0),r.setDepthStencilTexture(i),r.update(e,s,a),ZNe(this,e,s,a,t)}this._tempCopyDepthTexture=i,this._tempCopyDepthCommand.execute(e,t),this._updateDepthCommand.execute(e,t)};k0.prototype.executeCopyColor=function(e,t){l(this._copyColorCommand)&&this._copyColorCommand.execute(e,t)};k0.prototype.clear=function(e,t,n){let i=this._clearGlobeColorCommand;l(i)&&(z.clone(n,i.color),this.colorFramebufferManager.clear(e,i,t))};k0.prototype.isDestroyed=function(){return!1};k0.prototype.destroy=function(){return this._pickColorFramebuffer.destroy(),this._snapColorFramebuffer.destroy(),this._outputFramebuffer.destroy(),this._copyDepthFramebuffer.destroy(),this._tempCopyDepthFramebuffer.destroy(),this._updateDepthFramebuffer.destroy(),l(this._copyColorCommand)&&(this._copyColorCommand.shaderProgram=this._copyColorCommand.shaderProgram.destroy()),l(this._copyDepthCommand)&&(this._copyDepthCommand.shaderProgram=this._copyDepthCommand.shaderProgram.destroy()),l(this._tempCopyDepthCommand)&&(this._tempCopyDepthCommand.shaderProgram=this._tempCopyDepthCommand.shaderProgram.destroy()),l(this._updateDepthCommand)&&(this._updateDepthCommand.shaderProgram=this._updateDepthCommand.shaderProgram.destroy()),le(this)};var zz=k0;function lC(){this._framebuffer=new ai({depthStencil:!0,supportsDepthTexture:!0}),this._packedDepthFramebuffer=new ai,this._renderState=void 0,this._packedDepthCommand=void 0,this._clearCommand=void 0,this._viewport=new et,this._useScissorTest=!1,this._scissorRectangle=void 0,this._useHdr=void 0}Object.defineProperties(lC.prototype,{classificationTexture:{get:function(){return this._framebuffer.getColorTexture()}},classificationFramebuffer:{get:function(){return this._framebuffer.framebuffer}},packedDepthFramebuffer:{get:function(){return this._packedDepthFramebuffer.framebuffer}},depthStencilTexture:{get:function(){return this._framebuffer.getDepthStencilTexture()}},depthStencilRenderbuffer:{get:function(){return this._framebuffer.getDepthStencilRenderbuffer()}},packedDepthTexture:{get:function(){return this._packedDepthFramebuffer.getColorTexture()}}});function zNt(e){e._framebuffer.destroy(),e._packedDepthFramebuffer.destroy()}function VNt(e,t,n,i,r){let o=r?t.halfFloatingPointTexture?ze.HALF_FLOAT:ze.FLOAT:ze.UNSIGNED_BYTE;e._framebuffer.update(t,n,i,1,o),e._packedDepthFramebuffer.update(t,n,i)}function jNt(e,t,n,i,r){e._viewport.width=n,e._viewport.height=i;let o=!et.equals(e._viewport,r.viewport),s=o!==e._useScissorTest;e._useScissorTest=o,et.equals(e._scissorRectangle,r.viewport)||(e._scissorRectangle=et.clone(r.viewport,e._scissorRectangle),s=!0),(!l(e._renderState)||!et.equals(e._viewport,e._renderState.viewport)||s)&&(e._renderState=Ge.fromCache({viewport:e._viewport,scissorTest:{enabled:e._useScissorTest,rectangle:e._scissorRectangle}})),l(e._packedDepthCommand)||(e._packedDepthCommand=t.createViewportQuadCommand(Pb,{uniformMap:{u_depthTexture:function(){return e.depthStencilTexture}},owner:e})),l(e._clearCommand)||(e._clearCommand=new li({color:new z(0,0,0,0),depth:1,stencil:0,owner:e})),e._packedDepthCommand.framebuffer=e._packedDepthFramebuffer.framebuffer,e._packedDepthCommand.renderState=e._renderState,e._clearCommand.framebuffer=e.classificationFramebuffer,e._clearCommand.renderState=e._renderState}lC.prototype.updateAndClear=function(e,t,n,i){let r=t.width,o=t.height;VNt(this,n,r,o,e),jNt(this,n,r,o,i),this._useHdr=e};lC.prototype.clearClassification=function(e,t){this._clearCommand.execute(e,t)};lC.prototype.packDepth=function(e,t){return this._packedDepthCommand.execute(e,t),this.packedDepthTexture};lC.prototype.isDestroyed=function(){return!1};lC.prototype.destroy=function(){return zNt(this),le(this)};var Vz=lC;function iy(e){this._numSamples=1,this._translucentMultipassSupport=!1,this._translucentMRTSupport=!1;let t=e.colorBufferFloat&&e.depthTexture&&e.floatBlend;this._translucentMRTSupport=e.drawBuffers&&t,this._translucentMultipassSupport=!this._translucentMRTSupport&&t,this._opaqueFBO=void 0,this._opaqueTexture=void 0,this._depthStencilTexture=void 0,this._accumulationTexture=void 0,this._translucentFBO=new ai({colorAttachmentsLength:this._translucentMRTSupport?2:1,createColorAttachments:!1,createDepthAttachments:!1,depth:!0}),this._alphaFBO=new ai({createColorAttachments:!1,createDepthAttachments:!1,depth:!0}),this._adjustTranslucentFBO=new ai({colorAttachmentsLength:this._translucentMRTSupport?2:1,createColorAttachments:!1}),this._adjustAlphaFBO=new ai({createColorAttachments:!1}),this._opaqueClearCommand=new li({color:new z(0,0,0,0),owner:this}),this._translucentMRTClearCommand=new li({color:new z(0,0,0,1),owner:this}),this._translucentMultipassClearCommand=new li({color:new z(0,0,0,0),owner:this}),this._alphaClearCommand=new li({color:new z(1,1,1,1),owner:this}),this._translucentRenderStateCache={},this._alphaRenderStateCache={},this._compositeCommand=void 0,this._adjustTranslucentCommand=void 0,this._adjustAlphaCommand=void 0,this._viewport=new et,this._rs=void 0,this._useScissorTest=!1,this._scissorRectangle=void 0,this._useHDR=!1}function QNe(e){e._accumulationTexture=e._accumulationTexture&&!e._accumulationTexture.isDestroyed()&&e._accumulationTexture.destroy(),e._revealageTexture=e._revealageTexture&&!e._revealageTexture.isDestroyed()&&e._revealageTexture.destroy()}function Boe(e){e._translucentFBO.destroy(),e._alphaFBO.destroy(),e._adjustTranslucentFBO.destroy(),e._adjustAlphaFBO.destroy()}function eLe(e){QNe(e),Boe(e)}function HNt(e,t,n,i){QNe(e),e._accumulationTexture=new Dt({context:t,width:n,height:i,pixelFormat:Ke.RGBA,pixelDatatype:ze.FLOAT}),e._revealageTexture=new Dt({context:t,pixelFormat:Ke.RGBA,pixelDatatype:ze.FLOAT,width:n,height:i,flipY:!1})}function GNt(e,t){Boe(e);let n=te.FRAMEBUFFER_COMPLETE,i=!0,{width:r,height:o}=e._accumulationTexture;if(e._translucentMRTSupport&&(e._translucentFBO.setColorTexture(e._accumulationTexture,0),e._translucentFBO.setColorTexture(e._revealageTexture,1),e._translucentFBO.setDepthStencilTexture(e._depthStencilTexture),e._translucentFBO.update(t,r,o),e._adjustTranslucentFBO.setColorTexture(e._accumulationTexture,0),e._adjustTranslucentFBO.setColorTexture(e._revealageTexture,1),e._adjustTranslucentFBO.update(t,r,o),(e._translucentFBO.status!==n||e._adjustTranslucentFBO.status!==n)&&(Boe(e),e._translucentMRTSupport=!1)),!e._translucentMRTSupport){e._translucentFBO.setColorTexture(e._accumulationTexture),e._translucentFBO.setDepthStencilTexture(e._depthStencilTexture),e._translucentFBO.update(t,r,o),e._alphaFBO.setColorTexture(e._revealageTexture),e._alphaFBO.setDepthStencilTexture(e._depthStencilTexture),e._alphaFBO.update(t,r,o),e._adjustTranslucentFBO.setColorTexture(e._accumulationTexture),e._adjustTranslucentFBO.update(t,r,o),e._adjustAlphaFBO.setColorTexture(e._revealageTexture),e._adjustAlphaFBO.update(t,r,o);let s=e._translucentFBO.status===n,a=e._alphaFBO.status===n,c=e._adjustTranslucentFBO.status===n,u=e._adjustAlphaFBO.status===n;(!s||!a||!c||!u)&&(eLe(e),e._translucentMultipassSupport=!1,i=!1)}return i}iy.prototype.update=function(e,t,n,i,r){if(!this.isSupported())return;this._opaqueFBO=n,this._opaqueTexture=n.getColorTexture(0),this._depthStencilTexture=n.getDepthStencilTexture();let{width:o,height:s}=this._opaqueTexture,a=this._accumulationTexture,c=!l(a)||a.width!==o||a.height!==s||i!==this._useHDR,u=this._numSamples!==r;if((c||u)&&(this._numSamples=r,HNt(this,e,o,s)),(!l(this._translucentFBO.framebuffer)||c||u)&&!GNt(this,e))return;this._useHDR=i;let f=this,d,p;l(this._compositeCommand)||(d=new Ye({sources:[JO]}),this._translucentMRTSupport&&d.defines.push("MRT"),p={u_opaque:function(){return f._opaqueTexture},u_accumulation:function(){return f._accumulationTexture},u_revealage:function(){return f._revealageTexture}},this._compositeCommand=e.createViewportQuadCommand(d,{uniformMap:p,owner:this})),l(this._adjustTranslucentCommand)||(this._translucentMRTSupport?(d=new Ye({defines:["MRT"],sources:[Sv]}),p={u_bgColor:function(){return f._translucentMRTClearCommand.color},u_depthTexture:function(){return f._depthStencilTexture}},this._adjustTranslucentCommand=e.createViewportQuadCommand(d,{uniformMap:p,owner:this})):this._translucentMultipassSupport&&(d=new Ye({sources:[Sv]}),p={u_bgColor:function(){return f._translucentMultipassClearCommand.color},u_depthTexture:function(){return f._depthStencilTexture}},this._adjustTranslucentCommand=e.createViewportQuadCommand(d,{uniformMap:p,owner:this}),p={u_bgColor:function(){return f._alphaClearCommand.color},u_depthTexture:function(){return f._depthStencilTexture}},this._adjustAlphaCommand=e.createViewportQuadCommand(d,{uniformMap:p,owner:this}))),this._viewport.width=o,this._viewport.height=s;let g=!et.equals(this._viewport,t.viewport),m=g!==this._useScissorTest;this._useScissorTest=g,et.equals(this._scissorRectangle,t.viewport)||(this._scissorRectangle=et.clone(t.viewport,this._scissorRectangle),m=!0),(!l(this._rs)||!et.equals(this._viewport,this._rs.viewport)||m)&&(this._rs=Ge.fromCache({viewport:this._viewport,scissorTest:{enabled:this._useScissorTest,rectangle:this._scissorRectangle}})),l(this._compositeCommand)&&(this._compositeCommand.renderState=this._rs),this._adjustTranslucentCommand&&(this._adjustTranslucentCommand.renderState=this._rs),l(this._adjustAlphaCommand)&&(this._adjustAlphaCommand.renderState=this._rs)};var WNt={enabled:!0,color:new z(0,0,0,0),equationRgb:Dc.ADD,equationAlpha:Dc.ADD,functionSourceRgb:$r.ONE,functionDestinationRgb:$r.ONE,functionSourceAlpha:$r.ZERO,functionDestinationAlpha:$r.ONE_MINUS_SOURCE_ALPHA},qNt={enabled:!0,color:new z(0,0,0,0),equationRgb:Dc.ADD,equationAlpha:Dc.ADD,functionSourceRgb:$r.ONE,functionDestinationRgb:$r.ONE,functionSourceAlpha:$r.ONE,functionDestinationAlpha:$r.ONE},YNt={enabled:!0,color:new z(0,0,0,0),equationRgb:Dc.ADD,equationAlpha:Dc.ADD,functionSourceRgb:$r.ZERO,functionDestinationRgb:$r.ONE_MINUS_SOURCE_ALPHA,functionSourceAlpha:$r.ZERO,functionDestinationAlpha:$r.ONE_MINUS_SOURCE_ALPHA};function koe(e,t,n,i){let r=n[i.id];if(!l(r)){let o=Ge.getState(i);o.depthMask=!1,o.blending=t,r=Ge.fromCache(o),n[i.id]=r}return r}function XNt(e,t,n){return koe(t,WNt,e._translucentRenderStateCache,n)}function KNt(e,t,n){return koe(t,qNt,e._translucentRenderStateCache,n)}function $Nt(e,t,n){return koe(t,YNt,e._alphaRenderStateCache,n)}var JNt=` vec3 Ci = czm_out_FragColor.rgb * czm_out_FragColor.a; +`;function v0(){this._picking=!1,this._snapping=!1,this._numSamples=1,this._tempCopyDepthTexture=void 0,this._pickColorFramebuffer=new ai({depthStencil:!0,supportsDepthTexture:!0}),this._snapColorFramebuffer=new ai({depthStencil:!0,supportsDepthTexture:!0,pixelDatatype:ze.FLOAT,pixelFormat:Ke.RGBA}),this._outputFramebuffer=new ai({depthStencil:!0,supportsDepthTexture:!0}),this._copyDepthFramebuffer=new ai,this._tempCopyDepthFramebuffer=new ai,this._updateDepthFramebuffer=new ai({createColorAttachments:!1,createDepthAttachments:!1,depthStencil:!0}),this._clearGlobeColorCommand=void 0,this._copyColorCommand=void 0,this._copyDepthCommand=void 0,this._tempCopyDepthCommand=void 0,this._updateDepthCommand=void 0,this._viewport=new et,this._rs=void 0,this._rsBlend=void 0,this._rsUpdate=void 0,this._useScissorTest=!1,this._scissorRectangle=void 0,this._useHdr=void 0,this._clearGlobeDepth=void 0}Object.defineProperties(v0.prototype,{colorFramebufferManager:{get:function(){return this._snapping?this._snapColorFramebuffer:this._picking?this._pickColorFramebuffer:this._outputFramebuffer}},framebuffer:{get:function(){return this.colorFramebufferManager.framebuffer}},depthStencilTexture:{get:function(){return this.colorFramebufferManager.getDepthStencilTexture()}},picking:{get:function(){return this._picking},set:function(e){this._picking=e}},snapping:{get:function(){return this._snapping},set:function(e){this._snapping=e}}});function GPe(e,t,n,i,r){let o=e._viewport;o.width=n,o.height=i;let s=!et.equals(o,r.viewport),a=s!==e._useScissorTest;e._useScissorTest=s,et.equals(e._scissorRectangle,r.viewport)||(e._scissorRectangle=et.clone(r.viewport,e._scissorRectangle),a=!0),(!l(e._rs)||!et.equals(o,e._rs.viewport)||a)&&(e._rs=Ge.fromCache({viewport:o,scissorTest:{enabled:e._useScissorTest,rectangle:e._scissorRectangle}}),e._rsBlend=Ge.fromCache({viewport:o,scissorTest:{enabled:e._useScissorTest,rectangle:e._scissorRectangle},blending:tn.ALPHA_BLEND}),e._rsUpdate=Ge.fromCache({viewport:o,scissorTest:{enabled:e._useScissorTest,rectangle:e._scissorRectangle},stencilTest:{enabled:!0,frontFunction:ei.EQUAL,frontOperation:{fail:Rt.KEEP,zFail:Rt.KEEP,zPass:Rt.KEEP},backFunction:ei.NEVER,reference:Yt.CESIUM_3D_TILE_MASK,mask:Yt.CESIUM_3D_TILE_MASK}})),l(e._copyDepthCommand)||(e._copyDepthCommand=t.createViewportQuadCommand(cb,{uniformMap:{u_depthTexture:function(){return e.colorFramebufferManager.getDepthStencilTexture()}},owner:e})),e._copyDepthCommand.framebuffer=e._copyDepthFramebuffer.framebuffer,e._copyDepthCommand.renderState=e._rs,l(e._copyColorCommand)||(e._copyColorCommand=t.createViewportQuadCommand(sf,{uniformMap:{colorTexture:function(){return e.colorFramebufferManager.getColorTexture()}},owner:e})),e._copyColorCommand.renderState=e._rs,l(e._tempCopyDepthCommand)||(e._tempCopyDepthCommand=t.createViewportQuadCommand(cb,{uniformMap:{u_depthTexture:function(){return e._tempCopyDepthTexture}},owner:e})),e._tempCopyDepthCommand.framebuffer=e._tempCopyDepthFramebuffer.framebuffer,e._tempCopyDepthCommand.renderState=e._rs,l(e._updateDepthCommand)||(e._updateDepthCommand=t.createViewportQuadCommand(sf,{uniformMap:{colorTexture:function(){return e._tempCopyDepthFramebuffer.getColorTexture()}},owner:e})),e._updateDepthCommand.framebuffer=e._updateDepthFramebuffer.framebuffer,e._updateDepthCommand.renderState=e._rsUpdate,l(e._clearGlobeColorCommand)||(e._clearGlobeColorCommand=new li({color:new z(0,0,0,0),stencil:0,owner:e})),e._clearGlobeColorCommand.framebuffer=e.framebuffer}v0.prototype.update=function(e,t,n,i,r,o){let{width:s,height:a}=n,c=r?e.halfFloatingPointTexture?ze.HALF_FLOAT:ze.FLOAT:ze.UNSIGNED_BYTE;this._numSamples=i,this.snapping?this._snapColorFramebuffer.update(e,s,a):this.picking?this._pickColorFramebuffer.update(e,s,a):this._outputFramebuffer.update(e,s,a,i,c),this._copyDepthFramebuffer.update(e,s,a),GPe(this,e,s,a,t),e.uniformState.globeDepthTexture=void 0,this._clearGlobeDepth=o};v0.prototype.prepareColorTextures=function(e,t){!this.picking&&this._numSamples>1&&this._outputFramebuffer.prepareTextures(e,t)};v0.prototype.executeCopyDepth=function(e,t){l(this._copyDepthCommand)&&(this.prepareColorTextures(e),this._copyDepthCommand.execute(e,t),e.uniformState.globeDepthTexture=this._copyDepthFramebuffer.getColorTexture())};v0.prototype.executeUpdateDepth=function(e,t,n){let i=l(n)?n:t.framebuffer.depthStencilTexture;if(!this._clearGlobeDepth&&i===this.colorFramebufferManager.getDepthStencilTexture()){l(this._copyDepthCommand)&&this._copyDepthCommand.execute(e,t);return}if(!l(this._updateDepthCommand))return;let r=this._updateDepthFramebuffer;if(!l(r.framebuffer)||r.getDepthStencilTexture()!==i||r.getColorTexture()!==this._copyDepthFramebuffer.getColorTexture()){let o=this._copyDepthFramebuffer.getColorTexture(),{width:s,height:a}=o;this._tempCopyDepthFramebuffer.destroy(),this._tempCopyDepthFramebuffer.update(e,s,a),r.setColorTexture(o,0),r.setDepthStencilTexture(i),r.update(e,s,a),GPe(this,e,s,a,t)}this._tempCopyDepthTexture=i,this._tempCopyDepthCommand.execute(e,t),this._updateDepthCommand.execute(e,t)};v0.prototype.executeCopyColor=function(e,t){l(this._copyColorCommand)&&this._copyColorCommand.execute(e,t)};v0.prototype.clear=function(e,t,n){let i=this._clearGlobeColorCommand;l(i)&&(z.clone(n,i.color),this.colorFramebufferManager.clear(e,i,t))};v0.prototype.isDestroyed=function(){return!1};v0.prototype.destroy=function(){return this._pickColorFramebuffer.destroy(),this._snapColorFramebuffer.destroy(),this._outputFramebuffer.destroy(),this._copyDepthFramebuffer.destroy(),this._tempCopyDepthFramebuffer.destroy(),this._updateDepthFramebuffer.destroy(),l(this._copyColorCommand)&&(this._copyColorCommand.shaderProgram=this._copyColorCommand.shaderProgram.destroy()),l(this._copyDepthCommand)&&(this._copyDepthCommand.shaderProgram=this._copyDepthCommand.shaderProgram.destroy()),l(this._tempCopyDepthCommand)&&(this._tempCopyDepthCommand.shaderProgram=this._tempCopyDepthCommand.shaderProgram.destroy()),l(this._updateDepthCommand)&&(this._updateDepthCommand.shaderProgram=this._updateDepthCommand.shaderProgram.destroy()),le(this)};var PU=v0;function OE(){this._framebuffer=new ai({depthStencil:!0,supportsDepthTexture:!0}),this._packedDepthFramebuffer=new ai,this._renderState=void 0,this._packedDepthCommand=void 0,this._clearCommand=void 0,this._viewport=new et,this._useScissorTest=!1,this._scissorRectangle=void 0,this._useHdr=void 0}Object.defineProperties(OE.prototype,{classificationTexture:{get:function(){return this._framebuffer.getColorTexture()}},classificationFramebuffer:{get:function(){return this._framebuffer.framebuffer}},packedDepthFramebuffer:{get:function(){return this._packedDepthFramebuffer.framebuffer}},depthStencilTexture:{get:function(){return this._framebuffer.getDepthStencilTexture()}},depthStencilRenderbuffer:{get:function(){return this._framebuffer.getDepthStencilRenderbuffer()}},packedDepthTexture:{get:function(){return this._packedDepthFramebuffer.getColorTexture()}}});function USt(e){e._framebuffer.destroy(),e._packedDepthFramebuffer.destroy()}function zSt(e,t,n,i,r){let o=r?t.halfFloatingPointTexture?ze.HALF_FLOAT:ze.FLOAT:ze.UNSIGNED_BYTE;e._framebuffer.update(t,n,i,1,o),e._packedDepthFramebuffer.update(t,n,i)}function VSt(e,t,n,i,r){e._viewport.width=n,e._viewport.height=i;let o=!et.equals(e._viewport,r.viewport),s=o!==e._useScissorTest;e._useScissorTest=o,et.equals(e._scissorRectangle,r.viewport)||(e._scissorRectangle=et.clone(r.viewport,e._scissorRectangle),s=!0),(!l(e._renderState)||!et.equals(e._viewport,e._renderState.viewport)||s)&&(e._renderState=Ge.fromCache({viewport:e._viewport,scissorTest:{enabled:e._useScissorTest,rectangle:e._scissorRectangle}})),l(e._packedDepthCommand)||(e._packedDepthCommand=t.createViewportQuadCommand(cb,{uniformMap:{u_depthTexture:function(){return e.depthStencilTexture}},owner:e})),l(e._clearCommand)||(e._clearCommand=new li({color:new z(0,0,0,0),depth:1,stencil:0,owner:e})),e._packedDepthCommand.framebuffer=e._packedDepthFramebuffer.framebuffer,e._packedDepthCommand.renderState=e._renderState,e._clearCommand.framebuffer=e.classificationFramebuffer,e._clearCommand.renderState=e._renderState}OE.prototype.updateAndClear=function(e,t,n,i){let r=t.width,o=t.height;zSt(this,n,r,o,e),VSt(this,n,r,o,i),this._useHdr=e};OE.prototype.clearClassification=function(e,t){this._clearCommand.execute(e,t)};OE.prototype.packDepth=function(e,t){return this._packedDepthCommand.execute(e,t),this.packedDepthTexture};OE.prototype.isDestroyed=function(){return!1};OE.prototype.destroy=function(){return USt(this),le(this)};var DU=OE;function U_(e){this._numSamples=1,this._translucentMultipassSupport=!1,this._translucentMRTSupport=!1;let t=e.colorBufferFloat&&e.depthTexture&&e.floatBlend;this._translucentMRTSupport=e.drawBuffers&&t,this._translucentMultipassSupport=!this._translucentMRTSupport&&t,this._opaqueFBO=void 0,this._opaqueTexture=void 0,this._depthStencilTexture=void 0,this._accumulationTexture=void 0,this._translucentFBO=new ai({colorAttachmentsLength:this._translucentMRTSupport?2:1,createColorAttachments:!1,createDepthAttachments:!1,depth:!0}),this._alphaFBO=new ai({createColorAttachments:!1,createDepthAttachments:!1,depth:!0}),this._adjustTranslucentFBO=new ai({colorAttachmentsLength:this._translucentMRTSupport?2:1,createColorAttachments:!1}),this._adjustAlphaFBO=new ai({createColorAttachments:!1}),this._opaqueClearCommand=new li({color:new z(0,0,0,0),owner:this}),this._translucentMRTClearCommand=new li({color:new z(0,0,0,1),owner:this}),this._translucentMultipassClearCommand=new li({color:new z(0,0,0,0),owner:this}),this._alphaClearCommand=new li({color:new z(1,1,1,1),owner:this}),this._translucentRenderStateCache={},this._alphaRenderStateCache={},this._compositeCommand=void 0,this._adjustTranslucentCommand=void 0,this._adjustAlphaCommand=void 0,this._viewport=new et,this._rs=void 0,this._useScissorTest=!1,this._scissorRectangle=void 0,this._useHDR=!1}function WPe(e){e._accumulationTexture=e._accumulationTexture&&!e._accumulationTexture.isDestroyed()&&e._accumulationTexture.destroy(),e._revealageTexture=e._revealageTexture&&!e._revealageTexture.isDestroyed()&&e._revealageTexture.destroy()}function une(e){e._translucentFBO.destroy(),e._alphaFBO.destroy(),e._adjustTranslucentFBO.destroy(),e._adjustAlphaFBO.destroy()}function qPe(e){WPe(e),une(e)}function jSt(e,t,n,i){WPe(e),e._accumulationTexture=new Dt({context:t,width:n,height:i,pixelFormat:Ke.RGBA,pixelDatatype:ze.FLOAT}),e._revealageTexture=new Dt({context:t,pixelFormat:Ke.RGBA,pixelDatatype:ze.FLOAT,width:n,height:i,flipY:!1})}function HSt(e,t){une(e);let n=te.FRAMEBUFFER_COMPLETE,i=!0,{width:r,height:o}=e._accumulationTexture;if(e._translucentMRTSupport&&(e._translucentFBO.setColorTexture(e._accumulationTexture,0),e._translucentFBO.setColorTexture(e._revealageTexture,1),e._translucentFBO.setDepthStencilTexture(e._depthStencilTexture),e._translucentFBO.update(t,r,o),e._adjustTranslucentFBO.setColorTexture(e._accumulationTexture,0),e._adjustTranslucentFBO.setColorTexture(e._revealageTexture,1),e._adjustTranslucentFBO.update(t,r,o),(e._translucentFBO.status!==n||e._adjustTranslucentFBO.status!==n)&&(une(e),e._translucentMRTSupport=!1)),!e._translucentMRTSupport){e._translucentFBO.setColorTexture(e._accumulationTexture),e._translucentFBO.setDepthStencilTexture(e._depthStencilTexture),e._translucentFBO.update(t,r,o),e._alphaFBO.setColorTexture(e._revealageTexture),e._alphaFBO.setDepthStencilTexture(e._depthStencilTexture),e._alphaFBO.update(t,r,o),e._adjustTranslucentFBO.setColorTexture(e._accumulationTexture),e._adjustTranslucentFBO.update(t,r,o),e._adjustAlphaFBO.setColorTexture(e._revealageTexture),e._adjustAlphaFBO.update(t,r,o);let s=e._translucentFBO.status===n,a=e._alphaFBO.status===n,c=e._adjustTranslucentFBO.status===n,u=e._adjustAlphaFBO.status===n;(!s||!a||!c||!u)&&(qPe(e),e._translucentMultipassSupport=!1,i=!1)}return i}U_.prototype.update=function(e,t,n,i,r){if(!this.isSupported())return;this._opaqueFBO=n,this._opaqueTexture=n.getColorTexture(0),this._depthStencilTexture=n.getDepthStencilTexture();let{width:o,height:s}=this._opaqueTexture,a=this._accumulationTexture,c=!l(a)||a.width!==o||a.height!==s||i!==this._useHDR,u=this._numSamples!==r;if((c||u)&&(this._numSamples=r,jSt(this,e,o,s)),(!l(this._translucentFBO.framebuffer)||c||u)&&!HSt(this,e))return;this._useHDR=i;let f=this,d,p;l(this._compositeCommand)||(d=new Ye({sources:[JO]}),this._translucentMRTSupport&&d.defines.push("MRT"),p={u_opaque:function(){return f._opaqueTexture},u_accumulation:function(){return f._accumulationTexture},u_revealage:function(){return f._revealageTexture}},this._compositeCommand=e.createViewportQuadCommand(d,{uniformMap:p,owner:this})),l(this._adjustTranslucentCommand)||(this._translucentMRTSupport?(d=new Ye({defines:["MRT"],sources:[Sv]}),p={u_bgColor:function(){return f._translucentMRTClearCommand.color},u_depthTexture:function(){return f._depthStencilTexture}},this._adjustTranslucentCommand=e.createViewportQuadCommand(d,{uniformMap:p,owner:this})):this._translucentMultipassSupport&&(d=new Ye({sources:[Sv]}),p={u_bgColor:function(){return f._translucentMultipassClearCommand.color},u_depthTexture:function(){return f._depthStencilTexture}},this._adjustTranslucentCommand=e.createViewportQuadCommand(d,{uniformMap:p,owner:this}),p={u_bgColor:function(){return f._alphaClearCommand.color},u_depthTexture:function(){return f._depthStencilTexture}},this._adjustAlphaCommand=e.createViewportQuadCommand(d,{uniformMap:p,owner:this}))),this._viewport.width=o,this._viewport.height=s;let g=!et.equals(this._viewport,t.viewport),m=g!==this._useScissorTest;this._useScissorTest=g,et.equals(this._scissorRectangle,t.viewport)||(this._scissorRectangle=et.clone(t.viewport,this._scissorRectangle),m=!0),(!l(this._rs)||!et.equals(this._viewport,this._rs.viewport)||m)&&(this._rs=Ge.fromCache({viewport:this._viewport,scissorTest:{enabled:this._useScissorTest,rectangle:this._scissorRectangle}})),l(this._compositeCommand)&&(this._compositeCommand.renderState=this._rs),this._adjustTranslucentCommand&&(this._adjustTranslucentCommand.renderState=this._rs),l(this._adjustAlphaCommand)&&(this._adjustAlphaCommand.renderState=this._rs)};var GSt={enabled:!0,color:new z(0,0,0,0),equationRgb:Rc.ADD,equationAlpha:Rc.ADD,functionSourceRgb:$r.ONE,functionDestinationRgb:$r.ONE,functionSourceAlpha:$r.ZERO,functionDestinationAlpha:$r.ONE_MINUS_SOURCE_ALPHA},WSt={enabled:!0,color:new z(0,0,0,0),equationRgb:Rc.ADD,equationAlpha:Rc.ADD,functionSourceRgb:$r.ONE,functionDestinationRgb:$r.ONE,functionSourceAlpha:$r.ONE,functionDestinationAlpha:$r.ONE},qSt={enabled:!0,color:new z(0,0,0,0),equationRgb:Rc.ADD,equationAlpha:Rc.ADD,functionSourceRgb:$r.ZERO,functionDestinationRgb:$r.ONE_MINUS_SOURCE_ALPHA,functionSourceAlpha:$r.ZERO,functionDestinationAlpha:$r.ONE_MINUS_SOURCE_ALPHA};function fne(e,t,n,i){let r=n[i.id];if(!l(r)){let o=Ge.getState(i);o.depthMask=!1,o.blending=t,r=Ge.fromCache(o),n[i.id]=r}return r}function YSt(e,t,n){return fne(t,GSt,e._translucentRenderStateCache,n)}function XSt(e,t,n){return fne(t,WSt,e._translucentRenderStateCache,n)}function KSt(e,t,n){return fne(t,qSt,e._alphaRenderStateCache,n)}var $St=` vec3 Ci = czm_out_FragColor.rgb * czm_out_FragColor.a; float ai = czm_out_FragColor.a; float wzi = czm_alphaWeight(ai); out_FragData_0 = vec4(Ci * wzi, ai); out_FragData_1 = vec4(ai * wzi); -`,ZNt=` vec3 Ci = czm_out_FragColor.rgb * czm_out_FragColor.a; +`,JSt=` vec3 Ci = czm_out_FragColor.rgb * czm_out_FragColor.a; float ai = czm_out_FragColor.a; float wzi = czm_alphaWeight(ai); out_FragColor = vec4(Ci, ai) * wzi; -`,QNt=` float ai = czm_out_FragColor.a; +`,ZSt=` float ai = czm_out_FragColor.a; out_FragColor = vec4(ai); -`;function Uoe(e,t,n,i){let{shaderCache:r}=e,o=r.getDerivedShaderProgram(t,n);if(l(o))return o;let s=t._attributeLocations,a=t.fragmentShaderSource.clone();a.sources=a.sources.map(function(f){return Ye.replaceMain(f,"czm_translucent_main").replace(/out_FragColor/g,"czm_out_FragColor").replace(/layout\s*\(location\s*=\s*0\)\s*out\s+vec4\s+out_FragColor;/g,"").replace(/\bdiscard\b/g,"czm_discard = true").replace(/czm_phong/g,"czm_translucentPhong")}),a.sources.splice(0,0,`#define CESIUM_REDIRECTED_COLOR_OUTPUT +`;function dne(e,t,n,i){let{shaderCache:r}=e,o=r.getDerivedShaderProgram(t,n);if(l(o))return o;let s=t._attributeLocations,a=t.fragmentShaderSource.clone();a.sources=a.sources.map(function(f){return Ye.replaceMain(f,"czm_translucent_main").replace(/out_FragColor/g,"czm_out_FragColor").replace(/layout\s*\(location\s*=\s*0\)\s*out\s+vec4\s+out_FragColor;/g,"").replace(/\bdiscard\b/g,"czm_discard = true").replace(/czm_phong/g,"czm_translucentPhong")}),a.sources.splice(0,0,`#define CESIUM_REDIRECTED_COLOR_OUTPUT vec4 czm_out_FragColor; bool czm_discard = false; `);let c=[...i.matchAll(/out_FragData_(\d+)/g)],u="";for(let f=0;f<c.length;f++){let d=c[f];u=`layout (location = ${d[1]}) out vec4 ${d[0]}; @@ -10345,12 +10345,12 @@ ${u}`}return a.sources.push(u),a.sources.push(`void main() discard; } ${i}} -`),r.createDerivedShaderProgram(t,n,{vertexShaderSource:t.vertexShaderSource,fragmentShaderSource:a,attributeLocations:s})}function eLt(e,t){return Uoe(e,t,"translucentMRT",JNt)}function tLt(e,t){return Uoe(e,t,"translucentMultipass",ZNt)}function nLt(e,t){return Uoe(e,t,"alphaMultipass",QNt)}iy.prototype.createDerivedCommands=function(e,t,n){if(l(n)||(n={}),this._translucentMRTSupport){let a,c;return l(n.translucentCommand)&&(a=n.translucentCommand.shaderProgram,c=n.translucentCommand.renderState),n.translucentCommand=at.shallowClone(e,n.translucentCommand),!l(a)||n.shaderProgramId!==e.shaderProgram.id?(n.translucentCommand.shaderProgram=eLt(t,e.shaderProgram),n.translucentCommand.renderState=XNt(this,t,e.renderState),n.shaderProgramId=e.shaderProgram.id):(n.translucentCommand.shaderProgram=a,n.translucentCommand.renderState=c),n}let i,r,o,s;return l(n.translucentCommand)&&(i=n.translucentCommand.shaderProgram,r=n.translucentCommand.renderState,o=n.alphaCommand.shaderProgram,s=n.alphaCommand.renderState),n.translucentCommand=at.shallowClone(e,n.translucentCommand),n.alphaCommand=at.shallowClone(e,n.alphaCommand),!l(i)||n.shaderProgramId!==e.shaderProgram.id?(n.translucentCommand.shaderProgram=tLt(t,e.shaderProgram),n.translucentCommand.renderState=KNt(this,t,e.renderState),n.alphaCommand.shaderProgram=nLt(t,e.shaderProgram),n.alphaCommand.renderState=$Nt(this,t,e.renderState),n.shaderProgramId=e.shaderProgram.id):(n.translucentCommand.shaderProgram=i,n.translucentCommand.renderState=r,n.alphaCommand.shaderProgram=o,n.alphaCommand.renderState=s),n};function iLt(e,t,n,i,r,o){let{context:s,frameState:a}=t,{useLogDepth:c,shadowState:u}=a,f=t._hdr,d=i.framebuffer,p=u.lightShadowsEnabled;i.framebuffer=e._adjustTranslucentFBO.framebuffer,e._adjustTranslucentCommand.execute(s,i),i.framebuffer=e._adjustAlphaFBO.framebuffer,e._adjustAlphaCommand.execute(s,i);let g=e._opaqueFBO.framebuffer;i.framebuffer=e._translucentFBO.framebuffer;for(let m=0;m<r.length;++m){let y=r[m];y=c?y.derivedCommands.logDepth.command:y,y=f?y.derivedCommands.hdr.command:y;let A=p&&y.receiveShadows?y.derivedCommands.oit.shadows.translucentCommand:y.derivedCommands.oit.translucentCommand;n(A,t,i,g)}if(l(o)){let m=o.unclassifiedCommand,y=p&&m.receiveShadows?m.derivedCommands.oit.shadows.translucentCommand:m.derivedCommands.oit.translucentCommand;n(y,t,i,g)}i.framebuffer=e._alphaFBO.framebuffer;for(let m=0;m<r.length;++m){let y=r[m];y=c?y.derivedCommands.logDepth.command:y,y=f?y.derivedCommands.hdr.command:y;let A=p&&y.receiveShadows?y.derivedCommands.oit.shadows.alphaCommand:y.derivedCommands.oit.alphaCommand;n(A,t,i,g)}if(l(o)){let m=o.unclassifiedCommand,y=p&&m.receiveShadows?m.derivedCommands.oit.shadows.alphaCommand:m.derivedCommands.oit.alphaCommand;n(y,t,i,g)}i.framebuffer=d}function rLt(e,t,n,i,r,o){let{context:s,frameState:a}=t,{useLogDepth:c,shadowState:u}=a,f=t._hdr,d=i.framebuffer,p=u.lightShadowsEnabled;i.framebuffer=e._adjustTranslucentFBO.framebuffer,e._adjustTranslucentCommand.execute(s,i);let g=e._opaqueFBO.framebuffer;i.framebuffer=e._translucentFBO.framebuffer;for(let m=0;m<r.length;++m){let y=r[m];y=c?y.derivedCommands.logDepth.command:y,y=f?y.derivedCommands.hdr.command:y;let A=p&&y.receiveShadows?y.derivedCommands.oit.shadows.translucentCommand:y.derivedCommands.oit.translucentCommand;n(A,t,i,g)}if(l(o)){let m=o.unclassifiedCommand,y=p&&m.receiveShadows?m.derivedCommands.oit.shadows.translucentCommand:m.derivedCommands.oit.translucentCommand;n(y,t,i,g)}i.framebuffer=d}iy.prototype.executeCommands=function(e,t,n,i,r){if(this._translucentMRTSupport){rLt(this,e,t,n,i,r);return}iLt(this,e,t,n,i,r)};iy.prototype.execute=function(e,t){this._compositeCommand.execute(e,t)};iy.prototype.clear=function(e,t,n){let i=t.framebuffer;t.framebuffer=this._opaqueFBO.framebuffer,z.clone(n,this._opaqueClearCommand.color),this._opaqueClearCommand.execute(e,t),t.framebuffer=this._translucentFBO.framebuffer,(this._translucentMRTSupport?this._translucentMRTClearCommand:this._translucentMultipassClearCommand).execute(e,t),this._translucentMultipassSupport&&(t.framebuffer=this._alphaFBO.framebuffer,this._alphaClearCommand.execute(e,t)),t.framebuffer=i};iy.prototype.isSupported=function(){return this._translucentMRTSupport||this._translucentMultipassSupport};iy.prototype.isDestroyed=function(){return!1};iy.prototype.destroy=function(){return eLe(this),l(this._compositeCommand)&&(this._compositeCommand.shaderProgram=this._compositeCommand.shaderProgram&&this._compositeCommand.shaderProgram.destroy()),l(this._adjustTranslucentCommand)&&(this._adjustTranslucentCommand.shaderProgram=this._adjustTranslucentCommand.shaderProgram&&this._adjustTranslucentCommand.shaderProgram.destroy()),l(this._adjustAlphaCommand)&&(this._adjustAlphaCommand.shaderProgram=this._adjustAlphaCommand.shaderProgram&&this._adjustAlphaCommand.shaderProgram.destroy()),le(this)};var jz=iy;function Hz(){this._framebuffer=new ai({color:!1,depthStencil:!0,supportsDepthTexture:!0}),this._passState=void 0}Object.defineProperties(Hz.prototype,{framebuffer:{get:function(){return this._framebuffer.framebuffer}}});function oLt(e){e._framebuffer.destroy()}function sLt(e,t){let n=t.drawingBufferWidth,i=t.drawingBufferHeight;e._framebuffer.update(t,n,i);let r=new sc(t);r.blendingEnabled=!1,r.scissorTest={enabled:!0,rectangle:new et},r.viewport=new et,e._passState=r}Hz.prototype.update=function(e,t,n){let i=n.width,r=n.height;this._framebuffer.isDirty(i,r)&&sLt(this,e);let o=this.framebuffer,s=this._passState;return s.framebuffer=o,s.viewport.width=i,s.viewport.height=r,s.scissorTest.rectangle.x=t.x,s.scissorTest.rectangle.y=r-t.y,s.scissorTest.rectangle.width=1,s.scissorTest.rectangle.height=1,s};Hz.prototype.isDestroyed=function(){return!1};Hz.prototype.destroy=function(){return oLt(this),le(this)};var Gz=Hz;function uC(e){let t=new sc(e);t.blendingEnabled=!1,t.scissorTest={enabled:!0,rectangle:new et},t.viewport=new et,this._context=e,this._fb=new ai({depthStencil:!0}),this._passState=t,this._width=0,this._height=0}function tLe(e,t,n,i,r=1){let o=Math.max(n,i),s=o*o,a=Math.floor(n*.5),c=Math.floor(i*.5),u=0,f=0,d=0,p=-1,g=new Set;for(let m=0;m<s;++m){if(-a<=u&&u<=a&&-c<=f&&f<=c){let y=4*((c-f)*n+u+a),A=z.bytesToRgba(t[y],t[y+1],t[y+2],t[y+3]),b=e.getObjectByPickColor(A);if(l(b)&&(g.add(b),g.size>=r))break}if(u===f||u<0&&-u===f||u>0&&u===1-f){let y=d;d=-p,p=y}u+=d,f+=p}return[...g]}uC.prototype.begin=function(e,t){let n=this._context,{width:i,height:r}=t;return et.clone(e,this._passState.scissorTest.rectangle),this._width=i,this._height=r,this._fb.update(n,i,r),this._passState.framebuffer=this._fb.framebuffer,this._passState.viewport.width=i,this._passState.viewport.height=r,this._passState};uC.prototype.endAsync=async function(e,t,n=1){let i=e.width??1,r=e.height??1,o=this._context,s=this._fb.framebuffer,a=ze.UNSIGNED_BYTE,c=Ke.RGBA;l(s)&&s.numberOfColorAttachments>0&&(a=s.getColorTexture(0).pixelDatatype,c=s.getColorTexture(0).pixelFormat);let u=o.readPixelsToPBO({x:e.x,y:e.y,width:i,height:r,framebuffer:s}),f=NO.create({context:o});try{await f.waitForSignal(g=>t.afterRender.push(g));let d=Ke.createTypedArray(c,a,i,r);return u.getBufferData(d),tLe(o,d,i,r,n)}catch{throw new oe("Async Picking Request Timeout")}finally{f.destroy(),u.destroy()}};uC.prototype.end=function(e,t=1){let n=e.width??1,i=e.height??1,r=this._context,o=r.readPixels({x:e.x,y:e.y,width:n,height:i,framebuffer:this._fb.framebuffer});return tLe(r,o,n,i,t)};uC.prototype.readCenterPixel=function(e){let t=e.width??1,n=e.height??1,r=this._context.readPixels({x:e.x,y:e.y,width:t,height:n,framebuffer:this._fb.framebuffer}),o=Math.floor(t*.5),a=4*(Math.floor(n*.5)*t+o);return r.slice(a,a+4)};uC.prototype.isDestroyed=function(){return!1};uC.prototype.destroy=function(){return this._fb.destroy(),le(this)};var Wz=uC;function ry(){this._numSamples=1,this._colorFramebuffer=new ai({depthStencil:!0,supportsDepthTexture:!0}),this._idFramebuffer=new ai({depthStencil:!0,supportsDepthTexture:!0}),this._idClearColor=new z(0,0,0,0),this._clearCommand=new li({color:new z(0,0,0,0),depth:1,owner:this})}function aLt(e){e._colorFramebuffer.destroy(),e._idFramebuffer.destroy()}Object.defineProperties(ry.prototype,{framebuffer:{get:function(){return this._colorFramebuffer.framebuffer}},idFramebuffer:{get:function(){return this._idFramebuffer.framebuffer}},depthStencilTexture:{get:function(){return this._colorFramebuffer.getDepthStencilTexture()}}});ry.prototype.update=function(e,t,n,i){let r=t.width,o=t.height,s=n?e.halfFloatingPointTexture?ze.HALF_FLOAT:ze.FLOAT:ze.UNSIGNED_BYTE;this._numSamples=i,this._colorFramebuffer.update(e,r,o,i,s),this._idFramebuffer.update(e,r,o)};ry.prototype.clear=function(e,t,n){z.clone(n,this._clearCommand.color),z.clone(this._idClearColor,this._clearCommand.color),this._colorFramebuffer.clear(e,this._clearCommand,t),this._idFramebuffer.clear(e,this._clearCommand,t)};ry.prototype.getFramebuffer=function(){return this._colorFramebuffer.framebuffer};ry.prototype.getIdFramebuffer=function(){return this._idFramebuffer.framebuffer};ry.prototype.prepareColorTextures=function(e){this._numSamples>1&&this._colorFramebuffer.prepareTextures(e)};ry.prototype.isDestroyed=function(){return!1};ry.prototype.destroy=function(){return aLt(this),le(this)};var fC=ry;function Db(){}var cLt={HAS_CLIPPING_PLANES:!0,ENABLE_CLIPPING_POLYGONS:!0};Db.hasClippingForShadowCast=function(e){let t=e.defines;return l(t)&&t.some(function(n){return cLt[n]===!0})};Db.getShadowCastShaderKeyword=function(e,t,n,i,r){return`castShadow ${e} ${t} ${n} ${i} ${r}`};Db.createShadowCastVertexShader=function(e,t,n){let i=e.defines.slice(0),r=e.sources.slice(0);i.push("SHADOW_MAP"),n&&i.push("GENERATE_POSITION");let o=Ye.findPositionVarying(e),s=l(o);if(t&&!s){let a=r.length;for(let u=0;u<a;++u)r[u]=Ye.replaceMain(r[u],"czm_shadow_cast_main");r.push(`out vec3 v_positionEC; +`),r.createDerivedShaderProgram(t,n,{vertexShaderSource:t.vertexShaderSource,fragmentShaderSource:a,attributeLocations:s})}function QSt(e,t){return dne(e,t,"translucentMRT",$St)}function ewt(e,t){return dne(e,t,"translucentMultipass",JSt)}function twt(e,t){return dne(e,t,"alphaMultipass",ZSt)}U_.prototype.createDerivedCommands=function(e,t,n){if(l(n)||(n={}),this._translucentMRTSupport){let a,c;return l(n.translucentCommand)&&(a=n.translucentCommand.shaderProgram,c=n.translucentCommand.renderState),n.translucentCommand=at.shallowClone(e,n.translucentCommand),!l(a)||n.shaderProgramId!==e.shaderProgram.id?(n.translucentCommand.shaderProgram=QSt(t,e.shaderProgram),n.translucentCommand.renderState=YSt(this,t,e.renderState),n.shaderProgramId=e.shaderProgram.id):(n.translucentCommand.shaderProgram=a,n.translucentCommand.renderState=c),n}let i,r,o,s;return l(n.translucentCommand)&&(i=n.translucentCommand.shaderProgram,r=n.translucentCommand.renderState,o=n.alphaCommand.shaderProgram,s=n.alphaCommand.renderState),n.translucentCommand=at.shallowClone(e,n.translucentCommand),n.alphaCommand=at.shallowClone(e,n.alphaCommand),!l(i)||n.shaderProgramId!==e.shaderProgram.id?(n.translucentCommand.shaderProgram=ewt(t,e.shaderProgram),n.translucentCommand.renderState=XSt(this,t,e.renderState),n.alphaCommand.shaderProgram=twt(t,e.shaderProgram),n.alphaCommand.renderState=KSt(this,t,e.renderState),n.shaderProgramId=e.shaderProgram.id):(n.translucentCommand.shaderProgram=i,n.translucentCommand.renderState=r,n.alphaCommand.shaderProgram=o,n.alphaCommand.renderState=s),n};function nwt(e,t,n,i,r,o){let{context:s,frameState:a}=t,{useLogDepth:c,shadowState:u}=a,f=t._hdr,d=i.framebuffer,p=u.lightShadowsEnabled;i.framebuffer=e._adjustTranslucentFBO.framebuffer,e._adjustTranslucentCommand.execute(s,i),i.framebuffer=e._adjustAlphaFBO.framebuffer,e._adjustAlphaCommand.execute(s,i);let g=e._opaqueFBO.framebuffer;i.framebuffer=e._translucentFBO.framebuffer;for(let m=0;m<r.length;++m){let y=r[m];y=c?y.derivedCommands.logDepth.command:y,y=f?y.derivedCommands.hdr.command:y;let A=p&&y.receiveShadows?y.derivedCommands.oit.shadows.translucentCommand:y.derivedCommands.oit.translucentCommand;n(A,t,i,g)}if(l(o)){let m=o.unclassifiedCommand,y=p&&m.receiveShadows?m.derivedCommands.oit.shadows.translucentCommand:m.derivedCommands.oit.translucentCommand;n(y,t,i,g)}i.framebuffer=e._alphaFBO.framebuffer;for(let m=0;m<r.length;++m){let y=r[m];y=c?y.derivedCommands.logDepth.command:y,y=f?y.derivedCommands.hdr.command:y;let A=p&&y.receiveShadows?y.derivedCommands.oit.shadows.alphaCommand:y.derivedCommands.oit.alphaCommand;n(A,t,i,g)}if(l(o)){let m=o.unclassifiedCommand,y=p&&m.receiveShadows?m.derivedCommands.oit.shadows.alphaCommand:m.derivedCommands.oit.alphaCommand;n(y,t,i,g)}i.framebuffer=d}function iwt(e,t,n,i,r,o){let{context:s,frameState:a}=t,{useLogDepth:c,shadowState:u}=a,f=t._hdr,d=i.framebuffer,p=u.lightShadowsEnabled;i.framebuffer=e._adjustTranslucentFBO.framebuffer,e._adjustTranslucentCommand.execute(s,i);let g=e._opaqueFBO.framebuffer;i.framebuffer=e._translucentFBO.framebuffer;for(let m=0;m<r.length;++m){let y=r[m];y=c?y.derivedCommands.logDepth.command:y,y=f?y.derivedCommands.hdr.command:y;let A=p&&y.receiveShadows?y.derivedCommands.oit.shadows.translucentCommand:y.derivedCommands.oit.translucentCommand;n(A,t,i,g)}if(l(o)){let m=o.unclassifiedCommand,y=p&&m.receiveShadows?m.derivedCommands.oit.shadows.translucentCommand:m.derivedCommands.oit.translucentCommand;n(y,t,i,g)}i.framebuffer=d}U_.prototype.executeCommands=function(e,t,n,i,r){if(this._translucentMRTSupport){iwt(this,e,t,n,i,r);return}nwt(this,e,t,n,i,r)};U_.prototype.execute=function(e,t){this._compositeCommand.execute(e,t)};U_.prototype.clear=function(e,t,n){let i=t.framebuffer;t.framebuffer=this._opaqueFBO.framebuffer,z.clone(n,this._opaqueClearCommand.color),this._opaqueClearCommand.execute(e,t),t.framebuffer=this._translucentFBO.framebuffer,(this._translucentMRTSupport?this._translucentMRTClearCommand:this._translucentMultipassClearCommand).execute(e,t),this._translucentMultipassSupport&&(t.framebuffer=this._alphaFBO.framebuffer,this._alphaClearCommand.execute(e,t)),t.framebuffer=i};U_.prototype.isSupported=function(){return this._translucentMRTSupport||this._translucentMultipassSupport};U_.prototype.isDestroyed=function(){return!1};U_.prototype.destroy=function(){return qPe(this),l(this._compositeCommand)&&(this._compositeCommand.shaderProgram=this._compositeCommand.shaderProgram&&this._compositeCommand.shaderProgram.destroy()),l(this._adjustTranslucentCommand)&&(this._adjustTranslucentCommand.shaderProgram=this._adjustTranslucentCommand.shaderProgram&&this._adjustTranslucentCommand.shaderProgram.destroy()),l(this._adjustAlphaCommand)&&(this._adjustAlphaCommand.shaderProgram=this._adjustAlphaCommand.shaderProgram&&this._adjustAlphaCommand.shaderProgram.destroy()),le(this)};var RU=U_;function OU(){this._framebuffer=new ai({color:!1,depthStencil:!0,supportsDepthTexture:!0}),this._passState=void 0}Object.defineProperties(OU.prototype,{framebuffer:{get:function(){return this._framebuffer.framebuffer}}});function rwt(e){e._framebuffer.destroy()}function owt(e,t){let n=t.drawingBufferWidth,i=t.drawingBufferHeight;e._framebuffer.update(t,n,i);let r=new sc(t);r.blendingEnabled=!1,r.scissorTest={enabled:!0,rectangle:new et},r.viewport=new et,e._passState=r}OU.prototype.update=function(e,t,n){let i=n.width,r=n.height;this._framebuffer.isDirty(i,r)&&owt(this,e);let o=this.framebuffer,s=this._passState;return s.framebuffer=o,s.viewport.width=i,s.viewport.height=r,s.scissorTest.rectangle.x=t.x,s.scissorTest.rectangle.y=r-t.y,s.scissorTest.rectangle.width=1,s.scissorTest.rectangle.height=1,s};OU.prototype.isDestroyed=function(){return!1};OU.prototype.destroy=function(){return rwt(this),le(this)};var MU=OU;function ME(e){let t=new sc(e);t.blendingEnabled=!1,t.scissorTest={enabled:!0,rectangle:new et},t.viewport=new et,this._context=e,this._fb=new ai({depthStencil:!0}),this._passState=t,this._width=0,this._height=0}function YPe(e,t,n,i,r=1){let o=Math.max(n,i),s=o*o,a=Math.floor(n*.5),c=Math.floor(i*.5),u=0,f=0,d=0,p=-1,g=new Set;for(let m=0;m<s;++m){if(-a<=u&&u<=a&&-c<=f&&f<=c){let y=4*((c-f)*n+u+a),A=z.bytesToRgba(t[y],t[y+1],t[y+2],t[y+3]),b=e.getObjectByPickColor(A);if(l(b)&&(g.add(b),g.size>=r))break}if(u===f||u<0&&-u===f||u>0&&u===1-f){let y=d;d=-p,p=y}u+=d,f+=p}return[...g]}ME.prototype.begin=function(e,t){let n=this._context,{width:i,height:r}=t;return et.clone(e,this._passState.scissorTest.rectangle),this._width=i,this._height=r,this._fb.update(n,i,r),this._passState.framebuffer=this._fb.framebuffer,this._passState.viewport.width=i,this._passState.viewport.height=r,this._passState};ME.prototype.endAsync=async function(e,t,n=1){let i=e.width??1,r=e.height??1,o=this._context,s=this._fb.framebuffer,a=ze.UNSIGNED_BYTE,c=Ke.RGBA;l(s)&&s.numberOfColorAttachments>0&&(a=s.getColorTexture(0).pixelDatatype,c=s.getColorTexture(0).pixelFormat);let u=o.readPixelsToPBO({x:e.x,y:e.y,width:i,height:r,framebuffer:s}),f=NO.create({context:o});try{await f.waitForSignal(g=>t.afterRender.push(g));let d=Ke.createTypedArray(c,a,i,r);return u.getBufferData(d),YPe(o,d,i,r,n)}catch{throw new oe("Async Picking Request Timeout")}finally{f.destroy(),u.destroy()}};ME.prototype.end=function(e,t=1){let n=e.width??1,i=e.height??1,r=this._context,o=r.readPixels({x:e.x,y:e.y,width:n,height:i,framebuffer:this._fb.framebuffer});return YPe(r,o,n,i,t)};ME.prototype.readCenterPixel=function(e){let t=e.width??1,n=e.height??1,r=this._context.readPixels({x:e.x,y:e.y,width:t,height:n,framebuffer:this._fb.framebuffer}),o=Math.floor(t*.5),a=4*(Math.floor(n*.5)*t+o);return r.slice(a,a+4)};ME.prototype.isDestroyed=function(){return!1};ME.prototype.destroy=function(){return this._fb.destroy(),le(this)};var NU=ME;function z_(){this._numSamples=1,this._colorFramebuffer=new ai({depthStencil:!0,supportsDepthTexture:!0}),this._idFramebuffer=new ai({depthStencil:!0,supportsDepthTexture:!0}),this._idClearColor=new z(0,0,0,0),this._clearCommand=new li({color:new z(0,0,0,0),depth:1,owner:this})}function swt(e){e._colorFramebuffer.destroy(),e._idFramebuffer.destroy()}Object.defineProperties(z_.prototype,{framebuffer:{get:function(){return this._colorFramebuffer.framebuffer}},idFramebuffer:{get:function(){return this._idFramebuffer.framebuffer}},depthStencilTexture:{get:function(){return this._colorFramebuffer.getDepthStencilTexture()}}});z_.prototype.update=function(e,t,n,i){let r=t.width,o=t.height,s=n?e.halfFloatingPointTexture?ze.HALF_FLOAT:ze.FLOAT:ze.UNSIGNED_BYTE;this._numSamples=i,this._colorFramebuffer.update(e,r,o,i,s),this._idFramebuffer.update(e,r,o)};z_.prototype.clear=function(e,t,n){z.clone(n,this._clearCommand.color),z.clone(this._idClearColor,this._clearCommand.color),this._colorFramebuffer.clear(e,this._clearCommand,t),this._idFramebuffer.clear(e,this._clearCommand,t)};z_.prototype.getFramebuffer=function(){return this._colorFramebuffer.framebuffer};z_.prototype.getIdFramebuffer=function(){return this._idFramebuffer.framebuffer};z_.prototype.prepareColorTextures=function(e){this._numSamples>1&&this._colorFramebuffer.prepareTextures(e)};z_.prototype.isDestroyed=function(){return!1};z_.prototype.destroy=function(){return swt(this),le(this)};var NE=z_;function lb(){}var awt={HAS_CLIPPING_PLANES:!0,ENABLE_CLIPPING_POLYGONS:!0};lb.hasClippingForShadowCast=function(e){let t=e.defines;return l(t)&&t.some(function(n){return awt[n]===!0})};lb.getShadowCastShaderKeyword=function(e,t,n,i,r){return`castShadow ${e} ${t} ${n} ${i} ${r}`};lb.createShadowCastVertexShader=function(e,t,n){let i=e.defines.slice(0),r=e.sources.slice(0);i.push("SHADOW_MAP"),n&&i.push("GENERATE_POSITION");let o=Ye.findPositionVarying(e),s=l(o);if(t&&!s){let a=r.length;for(let u=0;u<a;++u)r[u]=Ye.replaceMain(r[u],"czm_shadow_cast_main");r.push(`out vec3 v_positionEC; void main() { czm_shadow_cast_main(); v_positionEC = (czm_inverseProjection * gl_Position).xyz; -}`)}return new Ye({defines:i,sources:r})};Db.createShadowCastFragmentShader=function(e,t,n,i,r){let o=e.defines.slice(0),s=e.sources.slice(0);o.push("SHADOW_MAP");let a=Ye.findPositionVarying(e),c=l(a);c||(a="v_positionEC");let u=s.length;for(let d=0;d<u;++d)s[d]=Ye.replaceMain(s[d],"czm_shadow_cast_main");let f="";return t&&(c||(f+=`in vec3 v_positionEC; +}`)}return new Ye({defines:i,sources:r})};lb.createShadowCastFragmentShader=function(e,t,n,i,r){let o=e.defines.slice(0),s=e.sources.slice(0);o.push("SHADOW_MAP");let a=Ye.findPositionVarying(e),c=l(a);c||(a="v_positionEC");let u=s.length;for(let d=0;d<u;++d)s[d]=Ye.replaceMain(s[d],"czm_shadow_cast_main");let f="";return t&&(c||(f+=`in vec3 v_positionEC; `),f+=`uniform vec4 shadowMap_lightPositionEC; `),i&&r?f+=`void main() { @@ -10374,7 +10374,7 @@ void main() `:n?f+=` out_FragColor = vec4(1.0); `:f+=` out_FragColor = czm_packDepth(gl_FragCoord.z); `,f+=`} -`,s.push(f),new Ye({defines:o,sources:s})};Db.getShadowReceiveShaderKeyword=function(e,t,n,i){let r=e._usesDepthTexture,o=e._polygonOffsetSupported,s=e._isPointLight,a=e._isSpotLight,c=e._numberOfCascades>1,u=e.debugCascadeColors,f=e.softShadows;return`receiveShadow ${r}${o}${s}${a}${c}${u}${f}${t}${n}${i}`};Db.createShadowReceiveVertexShader=function(e,t,n){let i=e.defines.slice(0),r=e.sources.slice(0);return i.push("SHADOW_MAP"),t&&(n?i.push("GENERATE_POSITION_AND_NORMAL"):i.push("GENERATE_POSITION")),new Ye({defines:i,sources:r})};Db.createShadowReceiveFragmentShader=function(e,t,n,i,r){let o=Ye.findNormalVarying(e),s=!i&&l(o)||i&&r,a=Ye.findPositionVarying(e),c=l(a),u=t._usesDepthTexture,f=t._polygonOffsetSupported,d=t._isPointLight,p=t._isSpotLight,g=t._numberOfCascades>1,m=t.debugCascadeColors,y=t.softShadows,A=d?t._pointBias:i?t._terrainBias:t._primitiveBias,b=e.defines.slice(0),x=e.sources.slice(0),T=x.length;for(let S=0;S<T;++S)x[S]=Ye.replaceMain(x[S],"czm_shadow_receive_main");d?b.push("USE_CUBE_MAP_SHADOW"):u&&b.push("USE_SHADOW_DEPTH_TEXTURE"),y&&!d&&b.push("USE_SOFT_SHADOWS"),g&&n&&i&&(s?b.push("ENABLE_VERTEX_LIGHTING"):b.push("ENABLE_DAYNIGHT_SHADING")),n&&A.normalShading&&s&&(b.push("USE_NORMAL_SHADING"),A.normalShadingSmooth>0&&b.push("USE_NORMAL_SHADING_SMOOTH"));let E="";d?E+=`uniform samplerCube shadowMap_textureCube; +`,s.push(f),new Ye({defines:o,sources:s})};lb.getShadowReceiveShaderKeyword=function(e,t,n,i){let r=e._usesDepthTexture,o=e._polygonOffsetSupported,s=e._isPointLight,a=e._isSpotLight,c=e._numberOfCascades>1,u=e.debugCascadeColors,f=e.softShadows;return`receiveShadow ${r}${o}${s}${a}${c}${u}${f}${t}${n}${i}`};lb.createShadowReceiveVertexShader=function(e,t,n){let i=e.defines.slice(0),r=e.sources.slice(0);return i.push("SHADOW_MAP"),t&&(n?i.push("GENERATE_POSITION_AND_NORMAL"):i.push("GENERATE_POSITION")),new Ye({defines:i,sources:r})};lb.createShadowReceiveFragmentShader=function(e,t,n,i,r){let o=Ye.findNormalVarying(e),s=!i&&l(o)||i&&r,a=Ye.findPositionVarying(e),c=l(a),u=t._usesDepthTexture,f=t._polygonOffsetSupported,d=t._isPointLight,p=t._isSpotLight,g=t._numberOfCascades>1,m=t.debugCascadeColors,y=t.softShadows,A=d?t._pointBias:i?t._terrainBias:t._primitiveBias,b=e.defines.slice(0),x=e.sources.slice(0),T=x.length;for(let S=0;S<T;++S)x[S]=Ye.replaceMain(x[S],"czm_shadow_receive_main");d?b.push("USE_CUBE_MAP_SHADOW"):u&&b.push("USE_SHADOW_DEPTH_TEXTURE"),y&&!d&&b.push("USE_SOFT_SHADOWS"),g&&n&&i&&(s?b.push("ENABLE_VERTEX_LIGHTING"):b.push("ENABLE_DAYNIGHT_SHADING")),n&&A.normalShading&&s&&(b.push("USE_NORMAL_SHADING"),A.normalShadingSmooth>0&&b.push("USE_NORMAL_SHADING_SMOOTH"));let E="";d?E+=`uniform samplerCube shadowMap_textureCube; `:E+=`uniform sampler2D shadowMap_texture; `;let v;return c?v=` return vec4(${a}, 1.0); `:v=`#ifndef LOG_DEPTH @@ -10485,7 +10485,7 @@ ${m?` // Draw cascade colors for debugging float visibility = czm_shadowVisibility(shadowMap_texture, shadowParameters); `,E+=` out_FragColor.rgb *= visibility; } -`,x.push(E),new Ye({defines:b,sources:x})};var op=Db;function U0(e){e=e??H.EMPTY_OBJECT;let t=e.context;this._enabled=e.enabled??!0,this._softShadows=e.softShadows??!1,this._normalOffset=e.normalOffset??!0,this.dirty=!0,this.fromLightSource=e.fromLightSource??!0,this.darkness=e.darkness??.3,this._darkness=this.darkness,this.fadingEnabled=e.fadingEnabled??!0,this.maximumDistance=e.maximumDistance??5e3,this._outOfView=!1,this._outOfViewPrevious=!1,this._needsUpdate=!0;let n=!0;(dn.isEdge()||(dn.isChrome()||dn.isFirefox())&&dn.isWindows()&&!t.depthTexture)&&(n=!1),this._polygonOffsetSupported=n,this._terrainBias={polygonOffset:n,polygonOffsetFactor:1.1,polygonOffsetUnits:4,normalOffset:this._normalOffset,normalOffsetScale:.5,normalShading:!0,normalShadingSmooth:.3,depthBias:1e-4},this._primitiveBias={polygonOffset:n,polygonOffsetFactor:1.1,polygonOffsetUnits:4,normalOffset:this._normalOffset,normalOffsetScale:.1,normalShading:!0,normalShadingSmooth:.05,depthBias:2e-5},this._pointBias={polygonOffset:!1,polygonOffsetFactor:1.1,polygonOffsetUnits:4,normalOffset:this._normalOffset,normalOffsetScale:0,normalShading:!0,normalShadingSmooth:.1,depthBias:5e-4},this._depthAttachment=void 0,this._colorAttachment=void 0,this._shadowMapMatrix=new N,this._shadowMapTexture=void 0,this._lightDirectionEC=new h,this._lightPositionEC=new se,this._distance=0,this._lightCamera=e.lightCamera,this._shadowMapCamera=new q7,this._shadowMapCullingVolume=void 0,this._sceneCamera=void 0,this._boundingSphere=new ue,this._isPointLight=e.isPointLight??!1,this._pointLightRadius=e.pointLightRadius??100,this._cascadesEnabled=this._isPointLight?!1:e.cascadesEnabled??!0,this._numberOfCascades=this._cascadesEnabled?e.numberOfCascades??4:0,this._fitNearFar=!0,this._maximumCascadeDistances=[25,150,700,Number.MAX_VALUE],this._textureSize=new U,this._isSpotLight=!1,this._cascadesEnabled?this._shadowMapCamera.frustum=new ys:l(this._lightCamera.frustum.fov)&&(this._isSpotLight=!0),this._cascadeSplits=[new se,new se],this._cascadeMatrices=[new N,new N,new N,new N],this._cascadeDistances=new se;let i;this._isPointLight?i=6:this._cascadesEnabled?i=this._numberOfCascades:i=1,this._passes=new Array(i);for(let r=0;r<i;++r)this._passes[r]=new lLt(t);this.debugShow=!1,this.debugFreezeFrame=!1,this._debugFreezeFrame=!1,this._debugCascadeColors=!1,this._debugLightFrustum=void 0,this._debugCameraFrustum=void 0,this._debugCascadeFrustums=new Array(this._numberOfCascades),this._debugShadowViewCommand=void 0,this._usesDepthTexture=t.depthTexture,this._isPointLight&&(this._usesDepthTexture=!1),this._primitiveRenderState=void 0,this._terrainRenderState=void 0,this._pointRenderState=void 0,Voe(this),this._clearCommand=new li({depth:1,color:new z}),this._clearPassState=new sc(t),this._size=e.size??2048,this.size=this._size}U0.MAXIMUM_DISTANCE=2e4;function lLt(e){this.camera=new q7,this.passState=new sc(e),this.framebuffer=void 0,this.textureOffsets=void 0,this.commandList=[],this.cullingVolume=void 0}function zoe(e,t){return Ge.fromCache({cull:{enabled:!0,face:Vi.BACK},depthTest:{enabled:!0},colorMask:{red:e,green:e,blue:e,alpha:e},depthMask:!0,polygonOffset:{enabled:t.polygonOffset,factor:t.polygonOffsetFactor,units:t.polygonOffsetUnits}})}function Voe(e){let t=!e._usesDepthTexture;e._primitiveRenderState=zoe(t,e._primitiveBias),e._terrainRenderState=zoe(t,e._terrainBias),e._pointRenderState=zoe(t,e._pointBias)}U0.prototype.debugCreateRenderStates=function(){Voe(this)};Object.defineProperties(U0.prototype,{enabled:{get:function(){return this._enabled},set:function(e){this.dirty=this._enabled!==e,this._enabled=e}},normalOffset:{get:function(){return this._normalOffset},set:function(e){this.dirty=this._normalOffset!==e,this._normalOffset=e,this._terrainBias.normalOffset=e,this._primitiveBias.normalOffset=e,this._pointBias.normalOffset=e}},softShadows:{get:function(){return this._softShadows},set:function(e){this.dirty=this._softShadows!==e,this._softShadows=e}},size:{get:function(){return this._size},set:function(e){pLt(this,e)}},outOfView:{get:function(){return this._outOfView}},shadowMapCullingVolume:{get:function(){return this._shadowMapCullingVolume}},passes:{get:function(){return this._passes}},isPointLight:{get:function(){return this._isPointLight}},debugCascadeColors:{get:function(){return this._debugCascadeColors},set:function(e){this.dirty=this._debugCascadeColors!==e,this._debugCascadeColors=e}}});function joe(e){let t=e._passes.length;for(let n=0;n<t;++n){let i=e._passes[n],r=i.framebuffer;l(r)&&!r.isDestroyed()&&r.destroy(),i.framebuffer=void 0}e._depthAttachment=e._depthAttachment&&e._depthAttachment.destroy(),e._colorAttachment=e._colorAttachment&&e._colorAttachment.destroy()}function uLt(e,t){let n=new Sf({context:t,width:e._textureSize.x,height:e._textureSize.y,format:jl.DEPTH_COMPONENT16}),i=new Dt({context:t,width:e._textureSize.x,height:e._textureSize.y,pixelFormat:Ke.RGBA,pixelDatatype:ze.UNSIGNED_BYTE,sampler:jt.NEAREST}),r=new _s({context:t,depthRenderbuffer:n,colorTextures:[i],destroyAttachments:!1}),o=e._passes.length;for(let s=0;s<o;++s){let a=e._passes[s];a.framebuffer=r,a.passState.framebuffer=r}e._shadowMapTexture=i,e._depthAttachment=n,e._colorAttachment=i}function fLt(e,t){let n=new Dt({context:t,width:e._textureSize.x,height:e._textureSize.y,pixelFormat:Ke.DEPTH_STENCIL,pixelDatatype:ze.UNSIGNED_INT_24_8,sampler:jt.NEAREST}),i=new _s({context:t,depthStencilTexture:n,destroyAttachments:!1}),r=e._passes.length;for(let o=0;o<r;++o){let s=e._passes[o];s.framebuffer=i,s.passState.framebuffer=i}e._shadowMapTexture=n,e._depthAttachment=n}function dLt(e,t){let n=new Sf({context:t,width:e._textureSize.x,height:e._textureSize.y,format:jl.DEPTH_COMPONENT16}),i=new ns({context:t,width:e._textureSize.x,height:e._textureSize.y,pixelFormat:Ke.RGBA,pixelDatatype:ze.UNSIGNED_BYTE,sampler:jt.NEAREST}),r=[i.negativeX,i.negativeY,i.negativeZ,i.positiveX,i.positiveY,i.positiveZ];for(let o=0;o<6;++o){let s=new _s({context:t,depthRenderbuffer:n,colorTextures:[r[o]],destroyAttachments:!1}),a=e._passes[o];a.framebuffer=s,a.passState.framebuffer=s}e._shadowMapTexture=i,e._depthAttachment=n,e._colorAttachment=i}function rLe(e,t){e._isPointLight?dLt(e,t):e._usesDepthTexture?fLt(e,t):uLt(e,t)}function hLt(e,t){e._usesDepthTexture&&e._passes[0].framebuffer.status!==te.FRAMEBUFFER_COMPLETE&&(e._usesDepthTexture=!1,Voe(e),joe(e),rLe(e,t))}function mLt(e,t){(!l(e._passes[0].framebuffer)||e._shadowMapTexture.width!==e._textureSize.x)&&(joe(e),rLe(e,t),hLt(e,t),oLe(e,t))}function oLe(e,t,n){n=n??0,(e._isPointLight||n===0)&&(e._clearCommand.framebuffer=e._passes[n].framebuffer,e._clearCommand.execute(t,e._clearPassState))}function pLt(e,t){e._size=t;let n=e._passes,i=n.length,r=e._textureSize;if(e._isPointLight){t=kt.maximumCubeMapSize>=t?t:kt.maximumCubeMapSize,r.x=t,r.y=t;let o=new et(0,0,t,t);n[0].passState.viewport=o,n[1].passState.viewport=o,n[2].passState.viewport=o,n[3].passState.viewport=o,n[4].passState.viewport=o,n[5].passState.viewport=o}else i===1?(t=kt.maximumTextureSize>=t?t:kt.maximumTextureSize,r.x=t,r.y=t,n[0].passState.viewport=new et(0,0,t,t)):i===4&&(t=kt.maximumTextureSize>=t*2?t:kt.maximumTextureSize/2,r.x=t*2,r.y=t*2,n[0].passState.viewport=new et(0,0,t,t),n[1].passState.viewport=new et(t,0,t,t),n[2].passState.viewport=new et(0,t,t,t),n[3].passState.viewport=new et(t,t,t,t));e._clearPassState.viewport=new et(0,0,r.x,r.y);for(let o=0;o<i;++o){let s=n[o],a=s.passState.viewport,c=a.x/r.x,u=a.y/r.y,f=a.width/r.x,d=a.height/r.y;s.textureOffsets=new N(f,0,0,c,0,d,0,u,0,0,1,0,0,0,0,1)}}var gLt=new et;function _Lt(e,t){let n;e._isPointLight?n=`uniform samplerCube shadowMap_textureCube; +`,x.push(E),new Ye({defines:b,sources:x})};var Ym=lb;function S0(e){e=e??H.EMPTY_OBJECT;let t=e.context;this._enabled=e.enabled??!0,this._softShadows=e.softShadows??!1,this._normalOffset=e.normalOffset??!0,this.dirty=!0,this.fromLightSource=e.fromLightSource??!0,this.darkness=e.darkness??.3,this._darkness=this.darkness,this.fadingEnabled=e.fadingEnabled??!0,this.maximumDistance=e.maximumDistance??5e3,this._outOfView=!1,this._outOfViewPrevious=!1,this._needsUpdate=!0;let n=!0;(dn.isEdge()||(dn.isChrome()||dn.isFirefox())&&dn.isWindows()&&!t.depthTexture)&&(n=!1),this._polygonOffsetSupported=n,this._terrainBias={polygonOffset:n,polygonOffsetFactor:1.1,polygonOffsetUnits:4,normalOffset:this._normalOffset,normalOffsetScale:.5,normalShading:!0,normalShadingSmooth:.3,depthBias:1e-4},this._primitiveBias={polygonOffset:n,polygonOffsetFactor:1.1,polygonOffsetUnits:4,normalOffset:this._normalOffset,normalOffsetScale:.1,normalShading:!0,normalShadingSmooth:.05,depthBias:2e-5},this._pointBias={polygonOffset:!1,polygonOffsetFactor:1.1,polygonOffsetUnits:4,normalOffset:this._normalOffset,normalOffsetScale:0,normalShading:!0,normalShadingSmooth:.1,depthBias:5e-4},this._depthAttachment=void 0,this._colorAttachment=void 0,this._shadowMapMatrix=new N,this._shadowMapTexture=void 0,this._lightDirectionEC=new h,this._lightPositionEC=new se,this._distance=0,this._lightCamera=e.lightCamera,this._shadowMapCamera=new L5,this._shadowMapCullingVolume=void 0,this._sceneCamera=void 0,this._boundingSphere=new ue,this._isPointLight=e.isPointLight??!1,this._pointLightRadius=e.pointLightRadius??100,this._cascadesEnabled=this._isPointLight?!1:e.cascadesEnabled??!0,this._numberOfCascades=this._cascadesEnabled?e.numberOfCascades??4:0,this._fitNearFar=!0,this._maximumCascadeDistances=[25,150,700,Number.MAX_VALUE],this._textureSize=new U,this._isSpotLight=!1,this._cascadesEnabled?this._shadowMapCamera.frustum=new ys:l(this._lightCamera.frustum.fov)&&(this._isSpotLight=!0),this._cascadeSplits=[new se,new se],this._cascadeMatrices=[new N,new N,new N,new N],this._cascadeDistances=new se;let i;this._isPointLight?i=6:this._cascadesEnabled?i=this._numberOfCascades:i=1,this._passes=new Array(i);for(let r=0;r<i;++r)this._passes[r]=new cwt(t);this.debugShow=!1,this.debugFreezeFrame=!1,this._debugFreezeFrame=!1,this._debugCascadeColors=!1,this._debugLightFrustum=void 0,this._debugCameraFrustum=void 0,this._debugCascadeFrustums=new Array(this._numberOfCascades),this._debugShadowViewCommand=void 0,this._usesDepthTexture=t.depthTexture,this._isPointLight&&(this._usesDepthTexture=!1),this._primitiveRenderState=void 0,this._terrainRenderState=void 0,this._pointRenderState=void 0,mne(this),this._clearCommand=new li({depth:1,color:new z}),this._clearPassState=new sc(t),this._size=e.size??2048,this.size=this._size}S0.MAXIMUM_DISTANCE=2e4;function cwt(e){this.camera=new L5,this.passState=new sc(e),this.framebuffer=void 0,this.textureOffsets=void 0,this.commandList=[],this.cullingVolume=void 0}function hne(e,t){return Ge.fromCache({cull:{enabled:!0,face:zi.BACK},depthTest:{enabled:!0},colorMask:{red:e,green:e,blue:e,alpha:e},depthMask:!0,polygonOffset:{enabled:t.polygonOffset,factor:t.polygonOffsetFactor,units:t.polygonOffsetUnits}})}function mne(e){let t=!e._usesDepthTexture;e._primitiveRenderState=hne(t,e._primitiveBias),e._terrainRenderState=hne(t,e._terrainBias),e._pointRenderState=hne(t,e._pointBias)}S0.prototype.debugCreateRenderStates=function(){mne(this)};Object.defineProperties(S0.prototype,{enabled:{get:function(){return this._enabled},set:function(e){this.dirty=this._enabled!==e,this._enabled=e}},normalOffset:{get:function(){return this._normalOffset},set:function(e){this.dirty=this._normalOffset!==e,this._normalOffset=e,this._terrainBias.normalOffset=e,this._primitiveBias.normalOffset=e,this._pointBias.normalOffset=e}},softShadows:{get:function(){return this._softShadows},set:function(e){this.dirty=this._softShadows!==e,this._softShadows=e}},size:{get:function(){return this._size},set:function(e){mwt(this,e)}},outOfView:{get:function(){return this._outOfView}},shadowMapCullingVolume:{get:function(){return this._shadowMapCullingVolume}},passes:{get:function(){return this._passes}},isPointLight:{get:function(){return this._isPointLight}},debugCascadeColors:{get:function(){return this._debugCascadeColors},set:function(e){this.dirty=this._debugCascadeColors!==e,this._debugCascadeColors=e}}});function pne(e){let t=e._passes.length;for(let n=0;n<t;++n){let i=e._passes[n],r=i.framebuffer;l(r)&&!r.isDestroyed()&&r.destroy(),i.framebuffer=void 0}e._depthAttachment=e._depthAttachment&&e._depthAttachment.destroy(),e._colorAttachment=e._colorAttachment&&e._colorAttachment.destroy()}function lwt(e,t){let n=new Sf({context:t,width:e._textureSize.x,height:e._textureSize.y,format:jl.DEPTH_COMPONENT16}),i=new Dt({context:t,width:e._textureSize.x,height:e._textureSize.y,pixelFormat:Ke.RGBA,pixelDatatype:ze.UNSIGNED_BYTE,sampler:jt.NEAREST}),r=new _s({context:t,depthRenderbuffer:n,colorTextures:[i],destroyAttachments:!1}),o=e._passes.length;for(let s=0;s<o;++s){let a=e._passes[s];a.framebuffer=r,a.passState.framebuffer=r}e._shadowMapTexture=i,e._depthAttachment=n,e._colorAttachment=i}function uwt(e,t){let n=new Dt({context:t,width:e._textureSize.x,height:e._textureSize.y,pixelFormat:Ke.DEPTH_STENCIL,pixelDatatype:ze.UNSIGNED_INT_24_8,sampler:jt.NEAREST}),i=new _s({context:t,depthStencilTexture:n,destroyAttachments:!1}),r=e._passes.length;for(let o=0;o<r;++o){let s=e._passes[o];s.framebuffer=i,s.passState.framebuffer=i}e._shadowMapTexture=n,e._depthAttachment=n}function fwt(e,t){let n=new Sf({context:t,width:e._textureSize.x,height:e._textureSize.y,format:jl.DEPTH_COMPONENT16}),i=new ns({context:t,width:e._textureSize.x,height:e._textureSize.y,pixelFormat:Ke.RGBA,pixelDatatype:ze.UNSIGNED_BYTE,sampler:jt.NEAREST}),r=[i.negativeX,i.negativeY,i.negativeZ,i.positiveX,i.positiveY,i.positiveZ];for(let o=0;o<6;++o){let s=new _s({context:t,depthRenderbuffer:n,colorTextures:[r[o]],destroyAttachments:!1}),a=e._passes[o];a.framebuffer=s,a.passState.framebuffer=s}e._shadowMapTexture=i,e._depthAttachment=n,e._colorAttachment=i}function $Pe(e,t){e._isPointLight?fwt(e,t):e._usesDepthTexture?uwt(e,t):lwt(e,t)}function dwt(e,t){e._usesDepthTexture&&e._passes[0].framebuffer.status!==te.FRAMEBUFFER_COMPLETE&&(e._usesDepthTexture=!1,mne(e),pne(e),$Pe(e,t))}function hwt(e,t){(!l(e._passes[0].framebuffer)||e._shadowMapTexture.width!==e._textureSize.x)&&(pne(e),$Pe(e,t),dwt(e,t),JPe(e,t))}function JPe(e,t,n){n=n??0,(e._isPointLight||n===0)&&(e._clearCommand.framebuffer=e._passes[n].framebuffer,e._clearCommand.execute(t,e._clearPassState))}function mwt(e,t){e._size=t;let n=e._passes,i=n.length,r=e._textureSize;if(e._isPointLight){t=kt.maximumCubeMapSize>=t?t:kt.maximumCubeMapSize,r.x=t,r.y=t;let o=new et(0,0,t,t);n[0].passState.viewport=o,n[1].passState.viewport=o,n[2].passState.viewport=o,n[3].passState.viewport=o,n[4].passState.viewport=o,n[5].passState.viewport=o}else i===1?(t=kt.maximumTextureSize>=t?t:kt.maximumTextureSize,r.x=t,r.y=t,n[0].passState.viewport=new et(0,0,t,t)):i===4&&(t=kt.maximumTextureSize>=t*2?t:kt.maximumTextureSize/2,r.x=t*2,r.y=t*2,n[0].passState.viewport=new et(0,0,t,t),n[1].passState.viewport=new et(t,0,t,t),n[2].passState.viewport=new et(0,t,t,t),n[3].passState.viewport=new et(t,t,t,t));e._clearPassState.viewport=new et(0,0,r.x,r.y);for(let o=0;o<i;++o){let s=n[o],a=s.passState.viewport,c=a.x/r.x,u=a.y/r.y,f=a.width/r.x,d=a.height/r.y;s.textureOffsets=new N(f,0,0,c,0,d,0,u,0,0,1,0,0,0,0,1)}}var pwt=new et;function gwt(e,t){let n;e._isPointLight?n=`uniform samplerCube shadowMap_textureCube; in vec2 v_textureCoordinates; void main() { @@ -10546,7 +10546,7 @@ ${e._usesDepthTexture?` float shadow = texture(shadowMap_texture, v_textureCo `:` float shadow = czm_unpackDepth(texture(shadowMap_texture, v_textureCoordinates)); `} out_FragColor = vec4(vec3(shadow), 1.0); } -`;let i=t.createViewportQuadCommand(n,{uniformMap:{shadowMap_texture:function(){return e._shadowMapTexture},shadowMap_textureCube:function(){return e._shadowMapTexture}}});return i.pass=Ie.OVERLAY,i}function yLt(e,t){let n=t.context,i=t.context.drawingBufferWidth,r=t.context.drawingBufferHeight,o=Math.min(i,r)*.3,s=gLt;s.x=i-o,s.y=0,s.width=o,s.height=o;let a=e._debugShadowViewCommand;l(a)||(a=_Lt(e,n),e._debugShadowViewCommand=a),(!l(a.renderState)||!et.equals(a.renderState.viewport,s))&&(a.renderState=Ge.fromCache({viewport:et.clone(s)})),t.commandList.push(e._debugShadowViewCommand)}var z0=new Array(8);z0[0]=new se(-1,-1,-1,1);z0[1]=new se(1,-1,-1,1);z0[2]=new se(1,1,-1,1);z0[3]=new se(-1,1,-1,1);z0[4]=new se(-1,-1,1,1);z0[5]=new se(1,-1,1,1);z0[6]=new se(1,1,1,1);z0[7]=new se(-1,1,1,1);var Rb=new N,Hoe=new Array(8);for(let e=0;e<8;++e)Hoe[e]=new se;function ALt(e,t){let n=new Ft({geometry:new $h({minimum:new h(-.5,-.5,-.5),maximum:new h(.5,.5,.5)}),attributes:{color:Jt.fromColor(t)}}),i=new Ft({geometry:new y_({radius:.5}),attributes:{color:Jt.fromColor(t)}});return new On({geometryInstances:[n,i],appearance:new yn({translucent:!1,flat:!0}),asynchronous:!1,modelMatrix:e})}var bLt=[z.RED,z.GREEN,z.BLUE,z.MAGENTA],xLt=new h;function TLt(e,t){yLt(e,t);let n=e.debugFreezeFrame&&!e._debugFreezeFrame;if(e._debugFreezeFrame=e.debugFreezeFrame,e.debugFreezeFrame&&(n&&(e._debugCameraFrustum=e._debugCameraFrustum&&e._debugCameraFrustum.destroy(),e._debugCameraFrustum=new F0({camera:e._sceneCamera,color:z.CYAN,updateOnChange:!1})),e._debugCameraFrustum.update(t)),e._cascadesEnabled){if(e.debugFreezeFrame){n&&(e._debugLightFrustum=e._debugLightFrustum&&e._debugLightFrustum.destroy(),e._debugLightFrustum=new F0({camera:e._shadowMapCamera,color:z.YELLOW,updateOnChange:!1})),e._debugLightFrustum.update(t);for(let i=0;i<e._numberOfCascades;++i)n&&(e._debugCascadeFrustums[i]=e._debugCascadeFrustums[i]&&e._debugCascadeFrustums[i].destroy(),e._debugCascadeFrustums[i]=new F0({camera:e._passes[i].camera,color:bLt[i],updateOnChange:!1})),e._debugCascadeFrustums[i].update(t)}}else if(e._isPointLight){if(!l(e._debugLightFrustum)||e._needsUpdate){let i=e._shadowMapCamera.positionWC,r=Le.IDENTITY,o=e._pointLightRadius*2,s=h.fromElements(o,o,o,xLt),a=N.fromTranslationQuaternionRotationScale(i,r,s,Rb);e._debugLightFrustum=e._debugLightFrustum&&e._debugLightFrustum.destroy(),e._debugLightFrustum=ALt(a,z.YELLOW)}e._debugLightFrustum.update(t)}else(!l(e._debugLightFrustum)||e._needsUpdate)&&(e._debugLightFrustum=new F0({camera:e._shadowMapCamera,color:z.YELLOW,updateOnChange:!1})),e._debugLightFrustum.update(t)}function q7(){this.viewMatrix=new N,this.inverseViewMatrix=new N,this.frustum=void 0,this.positionCartographic=new he,this.positionWC=new h,this.directionWC=h.clone(h.UNIT_Z),this.upWC=h.clone(h.UNIT_Y),this.rightWC=h.clone(h.UNIT_X),this.viewProjectionMatrix=new N}q7.prototype.clone=function(e){N.clone(e.viewMatrix,this.viewMatrix),N.clone(e.inverseViewMatrix,this.inverseViewMatrix),this.frustum=e.frustum.clone(this.frustum),he.clone(e.positionCartographic,this.positionCartographic),h.clone(e.positionWC,this.positionWC),h.clone(e.directionWC,this.directionWC),h.clone(e.upWC,this.upWC),h.clone(e.rightWC,this.rightWC)};var ELt=new N(.5,0,0,.5,0,.5,0,.5,0,0,.5,.5,0,0,0,1);q7.prototype.getViewProjection=function(){let e=this.viewMatrix,t=this.frustum.projectionMatrix;return N.multiply(t,e,this.viewProjectionMatrix),N.multiply(ELt,this.viewProjectionMatrix,this.viewProjectionMatrix),this.viewProjectionMatrix};var CLt=new Array(5),vLt=new Ji,SLt=new Array(4),sLe=new h,aLe=new h;function wLt(e,t){let n=e._shadowMapCamera,i=e._sceneCamera,r=i.frustum.near,o=i.frustum.far,s=e._numberOfCascades,a,c=o-r,u=o/r,f=.9,d=!1;t.shadowState.closestObjectSize<200&&(d=!0,f=.9);let p=SLt,g=CLt;for(g[0]=r,g[s]=o,a=0;a<s;++a){let L=(a+1)/s,_=r*Math.pow(u,L),C=r+c*L,w=D.lerp(C,_,f);g[a+1]=w,p[a]=w-g[a]}if(d){for(a=0;a<s;++a)p[a]=Math.min(p[a],e._maximumCascadeDistances[a]);let L=g[0];for(a=0;a<s-1;++a)L+=p[a],g[a+1]=L}se.unpack(g,0,e._cascadeSplits[0]),se.unpack(g,1,e._cascadeSplits[1]),se.unpack(p,0,e._cascadeDistances);let m=n.frustum,y=m.left,A=m.right,b=m.bottom,x=m.top,T=m.near,E=m.far,v=n.positionWC,S=n.directionWC,I=n.upWC,R=i.frustum.clone(vLt),O=n.getViewProjection();for(a=0;a<s;++a){R.near=g[a],R.far=g[a+1];let L=N.multiply(R.projectionMatrix,i.viewMatrix,Rb),_=N.inverse(L,Rb),C=N.multiply(O,_,Rb),w=h.fromElements(Number.MAX_VALUE,Number.MAX_VALUE,Number.MAX_VALUE,sLe),P=h.fromElements(-Number.MAX_VALUE,-Number.MAX_VALUE,-Number.MAX_VALUE,aLe);for(let j=0;j<8;++j){let k=se.clone(z0[j],Hoe[j]);N.multiplyByVector(C,k,k),h.divideByScalar(k,k.w,k),h.minimumByComponent(k,w,w),h.maximumByComponent(k,P,P)}w.x=Math.max(w.x,0),w.y=Math.max(w.y,0),w.z=0,P.x=Math.min(P.x,1),P.y=Math.min(P.y,1),P.z=Math.min(P.z,1);let M=e._passes[a],F=M.camera;F.clone(n);let V=F.frustum;V.left=y+w.x*(A-y),V.right=y+P.x*(A-y),V.bottom=b+w.y*(x-b),V.top=b+P.y*(x-b),V.near=T+w.z*(E-T),V.far=T+P.z*(E-T),M.cullingVolume=F.frustum.computeCullingVolume(v,S,I);let B=e._cascadeMatrices[a];N.multiply(F.getViewProjection(),i.inverseViewMatrix,B),N.multiply(M.textureOffsets,B,B)}}var ILt=new N,PLt=new h,DLt=new h,nLe=new h;function RLt(e,t){let n=e._shadowMapCamera,i=e._sceneCamera,r=N.multiply(i.frustum.projectionMatrix,i.viewMatrix,Rb),o=N.inverse(r,Rb),s=n.directionWC,a=i.directionWC;h.equalsEpsilon(s,a,D.EPSILON10)&&(a=i.upWC);let c=h.cross(s,a,PLt);a=h.cross(c,s,DLt),h.normalize(a,a),h.normalize(c,c);let u=h.fromElements(0,0,0,nLe),f=N.computeView(u,s,a,c,ILt),d=N.multiply(f,o,Rb),p=h.fromElements(Number.MAX_VALUE,Number.MAX_VALUE,Number.MAX_VALUE,sLe),g=h.fromElements(-Number.MAX_VALUE,-Number.MAX_VALUE,-Number.MAX_VALUE,aLe);for(let E=0;E<8;++E){let v=se.clone(z0[E],Hoe[E]);N.multiplyByVector(d,v,v),h.divideByScalar(v,v.w,v),h.minimumByComponent(v,p,p),h.maximumByComponent(v,g,g)}g.z+=1e3,p.z-=10;let m=nLe;m.x=-(.5*(p.x+g.x)),m.y=-(.5*(p.y+g.y)),m.z=-g.z;let y=N.fromTranslation(m,Rb);f=N.multiply(y,f,f);let A=.5*(g.x-p.x),b=.5*(g.y-p.y),x=g.z-p.z,T=n.frustum;T.left=-A,T.right=A,T.bottom=-b,T.top=b,T.near=.01,T.far=x,N.clone(f,n.viewMatrix),N.inverse(f,n.inverseViewMatrix),N.getTranslation(n.inverseViewMatrix,n.positionWC),t.mapProjection.ellipsoid.cartesianToCartographic(n.positionWC,n.positionCartographic),h.clone(s,n.directionWC),h.clone(a,n.upWC),h.clone(c,n.rightWC)}var OLt=[new h(-1,0,0),new h(0,-1,0),new h(0,0,-1),new h(1,0,0),new h(0,1,0),new h(0,0,1)],MLt=[new h(0,-1,0),new h(0,0,-1),new h(0,-1,0),new h(0,-1,0),new h(0,0,1),new h(0,-1,0)],NLt=[new h(0,0,1),new h(1,0,0),new h(-1,0,0),new h(0,0,-1),new h(1,0,0),new h(1,0,0)];function LLt(e,t){let n=new Ji;n.fov=D.PI_OVER_TWO,n.near=1,n.far=e._pointLightRadius,n.aspectRatio=1;for(let i=0;i<6;++i){let r=e._passes[i].camera;r.positionWC=e._shadowMapCamera.positionWC,r.positionCartographic=t.mapProjection.ellipsoid.cartesianToCartographic(r.positionWC,r.positionCartographic),r.directionWC=OLt[i],r.upWC=MLt[i],r.rightWC=NLt[i],N.computeView(r.positionWC,r.directionWC,r.upWC,r.rightWC,r.viewMatrix),N.inverse(r.viewMatrix,r.inverseViewMatrix),r.frustum=n}}var FLt=new h,BLt=new h,cLe=new ue,iLe=cLe.center;function kLt(e,t){let n=e._sceneCamera,i=e._shadowMapCamera,r=cLe;if(e._cascadesEnabled){if(n.frustum.near>=e.maximumDistance){e._outOfView=!0,e._needsUpdate=!1;return}let o=t.mapProjection.ellipsoid.geodeticSurfaceNormal(n.positionWC,FLt),s=h.negate(i.directionWC,BLt),a=h.dot(o,s);if(e.fadingEnabled){let c=D.clamp(a/.1,0,1);e._darkness=D.lerp(1,e.darkness,c)}else e._darkness=e.darkness;if(a<0){e._outOfView=!0,e._needsUpdate=!1;return}e._needsUpdate=!0,e._outOfView=!1}else if(e._isPointLight)r.center=i.positionWC,r.radius=e._pointLightRadius,e._outOfView=t.cullingVolume.computeVisibility(r)===$t.OUTSIDE,e._needsUpdate=!e._outOfView&&!e._boundingSphere.equals(r),ue.clone(r,e._boundingSphere);else{let o=i.frustum.far/2,s=h.add(i.positionWC,h.multiplyByScalar(i.directionWC,o,iLe),iLe);r.center=s,r.radius=o,e._outOfView=t.cullingVolume.computeVisibility(r)===$t.OUTSIDE,e._needsUpdate=!e._outOfView&&!e._boundingSphere.equals(r),ue.clone(r,e._boundingSphere)}}function ULt(e,t){let n=t.camera,i=e._lightCamera,r=e._sceneCamera,o=e._shadowMapCamera;e._cascadesEnabled?h.clone(i.directionWC,o.directionWC):e._isPointLight?h.clone(i.positionWC,o.positionWC):o.clone(i);let s=e._lightDirectionEC;N.multiplyByPointAsVector(n.viewMatrix,o.directionWC,s),h.normalize(s,s),h.negate(s,s),N.multiplyByPoint(n.viewMatrix,o.positionWC,e._lightPositionEC),e._lightPositionEC.w=e._pointLightRadius;let a,c;e._fitNearFar?(a=Math.min(t.shadowState.nearPlane,e.maximumDistance),c=Math.min(t.shadowState.farPlane,e.maximumDistance),c=Math.max(c,a+1)):(a=n.frustum.near,c=e.maximumDistance),e._sceneCamera=Or.clone(n,r),n.frustum.clone(e._sceneCamera.frustum),e._sceneCamera.frustum.near=a,e._sceneCamera.frustum.far=c,e._distance=c-a,kLt(e,t),!e._outOfViewPrevious&&e._outOfView&&(e._needsUpdate=!0),e._outOfViewPrevious=e._outOfView}U0.prototype.update=function(e){if(ULt(this,e),this._needsUpdate)if(mLt(this,e.context),this._isPointLight&&LLt(this,e),this._cascadesEnabled&&(RLt(this,e),this._numberOfCascades>1&&wLt(this,e)),this._isPointLight)this._shadowMapCullingVolume=ta.fromBoundingSphere(this._boundingSphere);else{let t=this._shadowMapCamera,n=t.positionWC,i=t.directionWC,r=t.upWC;this._shadowMapCullingVolume=t.frustum.computeCullingVolume(n,i,r),this._passes.length===1&&this._passes[0].camera.clone(t)}if(this._passes.length===1){let t=this._sceneCamera.inverseViewMatrix;N.multiply(this._shadowMapCamera.getViewProjection(),t,this._shadowMapMatrix)}this.debugShow&&TLt(this,e)};U0.prototype.updatePass=function(e,t){oLe(this,e,t)};var zLt=new U;function lLe(e,t,n){let i=e._isPointLight?e._pointBias:n?e._terrainBias:e._primitiveBias,r={shadowMap_texture:function(){return e._shadowMapTexture},shadowMap_textureCube:function(){return e._shadowMapTexture},shadowMap_matrix:function(){return e._shadowMapMatrix},shadowMap_cascadeSplits:function(){return e._cascadeSplits},shadowMap_cascadeMatrices:function(){return e._cascadeMatrices},shadowMap_lightDirectionEC:function(){return e._lightDirectionEC},shadowMap_lightPositionEC:function(){return e._lightPositionEC},shadowMap_cascadeDistances:function(){return e._cascadeDistances},shadowMap_texelSizeDepthBiasAndNormalShadingSmooth:function(){let o=zLt;return o.x=1/e._textureSize.x,o.y=1/e._textureSize.y,se.fromElements(o.x,o.y,i.depthBias,i.normalShadingSmooth,this.combinedUniforms1)},shadowMap_normalOffsetScaleDistanceMaxDistanceAndDarkness:function(){return se.fromElements(i.normalOffsetScale,e._distance,e.maximumDistance,e._darkness,this.combinedUniforms2)},combinedUniforms1:new se,combinedUniforms2:new se};return Ot(t,r,!1)}function VLt(e,t,n,i,r,o){let s,a,c;if(l(o)&&(s=o.shaderProgram,a=o.renderState,c=o.uniformMap),o=at.shallowClone(n,o),o.castShadows=!0,o.receiveShadows=!1,!l(s)||r!==n.shaderProgram.id||t){let u=n.shaderProgram,f=n.pass===Ie.GLOBE,d=n.pass!==Ie.TRANSLUCENT,p=e._isPointLight,g=e._usesDepthTexture,m=u.vertexShaderSource,y=u.fragmentShaderSource,A=d&&op.hasClippingForShadowCast(y),b=op.getShadowCastShaderKeyword(p,f,g,d,A);if(s=i.shaderCache.getDerivedShaderProgram(u,b),!l(s)){let T=op.createShadowCastVertexShader(m,p,f),E=op.createShadowCastFragmentShader(y,p,g,d,A);s=i.shaderCache.createDerivedShaderProgram(u,b,{vertexShaderSource:T,fragmentShaderSource:E,attributeLocations:u._attributeLocations})}a=e._primitiveRenderState,p?a=e._pointRenderState:f&&(a=e._terrainRenderState),n.renderState.cull.enabled||(a=Je(a,!1),a.cull=Je(a.cull,!1),a.cull.enabled=!1,a=Ge.fromCache(a)),c=lLe(e,n.uniformMap,f)}return o.shaderProgram=s,o.renderState=a,o.uniformMap=c,o}U0.createReceiveDerivedCommand=function(e,t,n,i,r){l(r)||(r={});let o=e.length>0,s=t.shaderProgram,a=s.vertexShaderSource,c=s.fragmentShaderSource,u=t.pass===Ie.GLOBE,f=!1;if(u&&(f=t.owner.data.renderedMesh.encoding.hasVertexNormals),t.receiveShadows&&o){let d,p;l(r.receiveCommand)&&(d=r.receiveCommand.shaderProgram,p=r.receiveCommand.uniformMap),r.receiveCommand=at.shallowClone(t,r.receiveCommand),r.castShadows=!1,r.receiveShadows=!0;let g=r.receiveShaderCastShadows!==t.castShadows,m=r.receiveShaderProgramId!==t.shaderProgram.id;if(!l(d)||m||n||g){let y=op.getShadowReceiveShaderKeyword(e[0],t.castShadows,u,f);if(d=i.shaderCache.getDerivedShaderProgram(s,y),!l(d)){let A=op.createShadowReceiveVertexShader(a,u,f),b=op.createShadowReceiveFragmentShader(c,e[0],t.castShadows,u,f);d=i.shaderCache.createDerivedShaderProgram(s,y,{vertexShaderSource:A,fragmentShaderSource:b,attributeLocations:s._attributeLocations})}p=lLe(e[0],t.uniformMap,u)}r.receiveCommand.shaderProgram=d,r.receiveCommand.uniformMap=p,r.receiveShaderProgramId=t.shaderProgram.id,r.receiveShaderCastShadows=t.castShadows}return r};U0.createCastDerivedCommand=function(e,t,n,i,r){if(l(r)||(r={}),t.castShadows){let o=r.castCommands;l(o)||(o=r.castCommands=[]);let s=r.castShaderProgramId,a=e.length;o.length=a;for(let c=0;c<a;++c)o[c]=VLt(e[c],n,t,i,s,o[c]);r.castShaderProgramId=t.shaderProgram.id}return r};U0.prototype.isDestroyed=function(){return!1};U0.prototype.destroy=function(){joe(this),this._debugLightFrustum=this._debugLightFrustum&&this._debugLightFrustum.destroy(),this._debugCameraFrustum=this._debugCameraFrustum&&this._debugCameraFrustum.destroy(),this._debugShadowViewCommand=this._debugShadowViewCommand&&this._debugShadowViewCommand.shaderProgram&&this._debugShadowViewCommand.shaderProgram.destroy();for(let e=0;e<this._numberOfCascades;++e)this._debugCascadeFrustums[e]=this._debugCascadeFrustums[e]&&this._debugCascadeFrustums[e].destroy();return le(this)};var oy=U0;var dC=`uniform sampler2D colorTexture; +`;let i=t.createViewportQuadCommand(n,{uniformMap:{shadowMap_texture:function(){return e._shadowMapTexture},shadowMap_textureCube:function(){return e._shadowMapTexture}}});return i.pass=Ie.OVERLAY,i}function _wt(e,t){let n=t.context,i=t.context.drawingBufferWidth,r=t.context.drawingBufferHeight,o=Math.min(i,r)*.3,s=pwt;s.x=i-o,s.y=0,s.width=o,s.height=o;let a=e._debugShadowViewCommand;l(a)||(a=gwt(e,n),e._debugShadowViewCommand=a),(!l(a.renderState)||!et.equals(a.renderState.viewport,s))&&(a.renderState=Ge.fromCache({viewport:et.clone(s)})),t.commandList.push(e._debugShadowViewCommand)}var w0=new Array(8);w0[0]=new se(-1,-1,-1,1);w0[1]=new se(1,-1,-1,1);w0[2]=new se(1,1,-1,1);w0[3]=new se(-1,1,-1,1);w0[4]=new se(-1,-1,1,1);w0[5]=new se(1,-1,1,1);w0[6]=new se(1,1,1,1);w0[7]=new se(-1,1,1,1);var ub=new N,gne=new Array(8);for(let e=0;e<8;++e)gne[e]=new se;function ywt(e,t){let n=new Ft({geometry:new sm({minimum:new h(-.5,-.5,-.5),maximum:new h(.5,.5,.5)}),attributes:{color:Jt.fromColor(t)}}),i=new Ft({geometry:new S_({radius:.5}),attributes:{color:Jt.fromColor(t)}});return new On({geometryInstances:[n,i],appearance:new yn({translucent:!1,flat:!0}),asynchronous:!1,modelMatrix:e})}var Awt=[z.RED,z.GREEN,z.BLUE,z.MAGENTA],bwt=new h;function xwt(e,t){_wt(e,t);let n=e.debugFreezeFrame&&!e._debugFreezeFrame;if(e._debugFreezeFrame=e.debugFreezeFrame,e.debugFreezeFrame&&(n&&(e._debugCameraFrustum=e._debugCameraFrustum&&e._debugCameraFrustum.destroy(),e._debugCameraFrustum=new E0({camera:e._sceneCamera,color:z.CYAN,updateOnChange:!1})),e._debugCameraFrustum.update(t)),e._cascadesEnabled){if(e.debugFreezeFrame){n&&(e._debugLightFrustum=e._debugLightFrustum&&e._debugLightFrustum.destroy(),e._debugLightFrustum=new E0({camera:e._shadowMapCamera,color:z.YELLOW,updateOnChange:!1})),e._debugLightFrustum.update(t);for(let i=0;i<e._numberOfCascades;++i)n&&(e._debugCascadeFrustums[i]=e._debugCascadeFrustums[i]&&e._debugCascadeFrustums[i].destroy(),e._debugCascadeFrustums[i]=new E0({camera:e._passes[i].camera,color:Awt[i],updateOnChange:!1})),e._debugCascadeFrustums[i].update(t)}}else if(e._isPointLight){if(!l(e._debugLightFrustum)||e._needsUpdate){let i=e._shadowMapCamera.positionWC,r=Le.IDENTITY,o=e._pointLightRadius*2,s=h.fromElements(o,o,o,bwt),a=N.fromTranslationQuaternionRotationScale(i,r,s,ub);e._debugLightFrustum=e._debugLightFrustum&&e._debugLightFrustum.destroy(),e._debugLightFrustum=ywt(a,z.YELLOW)}e._debugLightFrustum.update(t)}else(!l(e._debugLightFrustum)||e._needsUpdate)&&(e._debugLightFrustum=new E0({camera:e._shadowMapCamera,color:z.YELLOW,updateOnChange:!1})),e._debugLightFrustum.update(t)}function L5(){this.viewMatrix=new N,this.inverseViewMatrix=new N,this.frustum=void 0,this.positionCartographic=new he,this.positionWC=new h,this.directionWC=h.clone(h.UNIT_Z),this.upWC=h.clone(h.UNIT_Y),this.rightWC=h.clone(h.UNIT_X),this.viewProjectionMatrix=new N}L5.prototype.clone=function(e){N.clone(e.viewMatrix,this.viewMatrix),N.clone(e.inverseViewMatrix,this.inverseViewMatrix),this.frustum=e.frustum.clone(this.frustum),he.clone(e.positionCartographic,this.positionCartographic),h.clone(e.positionWC,this.positionWC),h.clone(e.directionWC,this.directionWC),h.clone(e.upWC,this.upWC),h.clone(e.rightWC,this.rightWC)};var Twt=new N(.5,0,0,.5,0,.5,0,.5,0,0,.5,.5,0,0,0,1);L5.prototype.getViewProjection=function(){let e=this.viewMatrix,t=this.frustum.projectionMatrix;return N.multiply(t,e,this.viewProjectionMatrix),N.multiply(Twt,this.viewProjectionMatrix,this.viewProjectionMatrix),this.viewProjectionMatrix};var Ewt=new Array(5),Cwt=new $i,vwt=new Array(4),ZPe=new h,QPe=new h;function Swt(e,t){let n=e._shadowMapCamera,i=e._sceneCamera,r=i.frustum.near,o=i.frustum.far,s=e._numberOfCascades,a,c=o-r,u=o/r,f=.9,d=!1;t.shadowState.closestObjectSize<200&&(d=!0,f=.9);let p=vwt,g=Ewt;for(g[0]=r,g[s]=o,a=0;a<s;++a){let L=(a+1)/s,_=r*Math.pow(u,L),C=r+c*L,w=D.lerp(C,_,f);g[a+1]=w,p[a]=w-g[a]}if(d){for(a=0;a<s;++a)p[a]=Math.min(p[a],e._maximumCascadeDistances[a]);let L=g[0];for(a=0;a<s-1;++a)L+=p[a],g[a+1]=L}se.unpack(g,0,e._cascadeSplits[0]),se.unpack(g,1,e._cascadeSplits[1]),se.unpack(p,0,e._cascadeDistances);let m=n.frustum,y=m.left,A=m.right,b=m.bottom,x=m.top,T=m.near,E=m.far,v=n.positionWC,S=n.directionWC,I=n.upWC,R=i.frustum.clone(Cwt),O=n.getViewProjection();for(a=0;a<s;++a){R.near=g[a],R.far=g[a+1];let L=N.multiply(R.projectionMatrix,i.viewMatrix,ub),_=N.inverse(L,ub),C=N.multiply(O,_,ub),w=h.fromElements(Number.MAX_VALUE,Number.MAX_VALUE,Number.MAX_VALUE,ZPe),P=h.fromElements(-Number.MAX_VALUE,-Number.MAX_VALUE,-Number.MAX_VALUE,QPe);for(let j=0;j<8;++j){let k=se.clone(w0[j],gne[j]);N.multiplyByVector(C,k,k),h.divideByScalar(k,k.w,k),h.minimumByComponent(k,w,w),h.maximumByComponent(k,P,P)}w.x=Math.max(w.x,0),w.y=Math.max(w.y,0),w.z=0,P.x=Math.min(P.x,1),P.y=Math.min(P.y,1),P.z=Math.min(P.z,1);let M=e._passes[a],F=M.camera;F.clone(n);let V=F.frustum;V.left=y+w.x*(A-y),V.right=y+P.x*(A-y),V.bottom=b+w.y*(x-b),V.top=b+P.y*(x-b),V.near=T+w.z*(E-T),V.far=T+P.z*(E-T),M.cullingVolume=F.frustum.computeCullingVolume(v,S,I);let B=e._cascadeMatrices[a];N.multiply(F.getViewProjection(),i.inverseViewMatrix,B),N.multiply(M.textureOffsets,B,B)}}var wwt=new N,Iwt=new h,Pwt=new h,XPe=new h;function Dwt(e,t){let n=e._shadowMapCamera,i=e._sceneCamera,r=N.multiply(i.frustum.projectionMatrix,i.viewMatrix,ub),o=N.inverse(r,ub),s=n.directionWC,a=i.directionWC;h.equalsEpsilon(s,a,D.EPSILON10)&&(a=i.upWC);let c=h.cross(s,a,Iwt);a=h.cross(c,s,Pwt),h.normalize(a,a),h.normalize(c,c);let u=h.fromElements(0,0,0,XPe),f=N.computeView(u,s,a,c,wwt),d=N.multiply(f,o,ub),p=h.fromElements(Number.MAX_VALUE,Number.MAX_VALUE,Number.MAX_VALUE,ZPe),g=h.fromElements(-Number.MAX_VALUE,-Number.MAX_VALUE,-Number.MAX_VALUE,QPe);for(let E=0;E<8;++E){let v=se.clone(w0[E],gne[E]);N.multiplyByVector(d,v,v),h.divideByScalar(v,v.w,v),h.minimumByComponent(v,p,p),h.maximumByComponent(v,g,g)}g.z+=1e3,p.z-=10;let m=XPe;m.x=-(.5*(p.x+g.x)),m.y=-(.5*(p.y+g.y)),m.z=-g.z;let y=N.fromTranslation(m,ub);f=N.multiply(y,f,f);let A=.5*(g.x-p.x),b=.5*(g.y-p.y),x=g.z-p.z,T=n.frustum;T.left=-A,T.right=A,T.bottom=-b,T.top=b,T.near=.01,T.far=x,N.clone(f,n.viewMatrix),N.inverse(f,n.inverseViewMatrix),N.getTranslation(n.inverseViewMatrix,n.positionWC),t.mapProjection.ellipsoid.cartesianToCartographic(n.positionWC,n.positionCartographic),h.clone(s,n.directionWC),h.clone(a,n.upWC),h.clone(c,n.rightWC)}var Rwt=[new h(-1,0,0),new h(0,-1,0),new h(0,0,-1),new h(1,0,0),new h(0,1,0),new h(0,0,1)],Owt=[new h(0,-1,0),new h(0,0,-1),new h(0,-1,0),new h(0,-1,0),new h(0,0,1),new h(0,-1,0)],Mwt=[new h(0,0,1),new h(1,0,0),new h(-1,0,0),new h(0,0,-1),new h(1,0,0),new h(1,0,0)];function Nwt(e,t){let n=new $i;n.fov=D.PI_OVER_TWO,n.near=1,n.far=e._pointLightRadius,n.aspectRatio=1;for(let i=0;i<6;++i){let r=e._passes[i].camera;r.positionWC=e._shadowMapCamera.positionWC,r.positionCartographic=t.mapProjection.ellipsoid.cartesianToCartographic(r.positionWC,r.positionCartographic),r.directionWC=Rwt[i],r.upWC=Owt[i],r.rightWC=Mwt[i],N.computeView(r.positionWC,r.directionWC,r.upWC,r.rightWC,r.viewMatrix),N.inverse(r.viewMatrix,r.inverseViewMatrix),r.frustum=n}}var Lwt=new h,Fwt=new h,eDe=new ue,KPe=eDe.center;function Bwt(e,t){let n=e._sceneCamera,i=e._shadowMapCamera,r=eDe;if(e._cascadesEnabled){if(n.frustum.near>=e.maximumDistance){e._outOfView=!0,e._needsUpdate=!1;return}let o=t.mapProjection.ellipsoid.geodeticSurfaceNormal(n.positionWC,Lwt),s=h.negate(i.directionWC,Fwt),a=h.dot(o,s);if(e.fadingEnabled){let c=D.clamp(a/.1,0,1);e._darkness=D.lerp(1,e.darkness,c)}else e._darkness=e.darkness;if(a<0){e._outOfView=!0,e._needsUpdate=!1;return}e._needsUpdate=!0,e._outOfView=!1}else if(e._isPointLight)r.center=i.positionWC,r.radius=e._pointLightRadius,e._outOfView=t.cullingVolume.computeVisibility(r)===$t.OUTSIDE,e._needsUpdate=!e._outOfView&&!e._boundingSphere.equals(r),ue.clone(r,e._boundingSphere);else{let o=i.frustum.far/2,s=h.add(i.positionWC,h.multiplyByScalar(i.directionWC,o,KPe),KPe);r.center=s,r.radius=o,e._outOfView=t.cullingVolume.computeVisibility(r)===$t.OUTSIDE,e._needsUpdate=!e._outOfView&&!e._boundingSphere.equals(r),ue.clone(r,e._boundingSphere)}}function kwt(e,t){let n=t.camera,i=e._lightCamera,r=e._sceneCamera,o=e._shadowMapCamera;e._cascadesEnabled?h.clone(i.directionWC,o.directionWC):e._isPointLight?h.clone(i.positionWC,o.positionWC):o.clone(i);let s=e._lightDirectionEC;N.multiplyByPointAsVector(n.viewMatrix,o.directionWC,s),h.normalize(s,s),h.negate(s,s),N.multiplyByPoint(n.viewMatrix,o.positionWC,e._lightPositionEC),e._lightPositionEC.w=e._pointLightRadius;let a,c;e._fitNearFar?(a=Math.min(t.shadowState.nearPlane,e.maximumDistance),c=Math.min(t.shadowState.farPlane,e.maximumDistance),c=Math.max(c,a+1)):(a=n.frustum.near,c=e.maximumDistance),e._sceneCamera=Or.clone(n,r),n.frustum.clone(e._sceneCamera.frustum),e._sceneCamera.frustum.near=a,e._sceneCamera.frustum.far=c,e._distance=c-a,Bwt(e,t),!e._outOfViewPrevious&&e._outOfView&&(e._needsUpdate=!0),e._outOfViewPrevious=e._outOfView}S0.prototype.update=function(e){if(kwt(this,e),this._needsUpdate)if(hwt(this,e.context),this._isPointLight&&Nwt(this,e),this._cascadesEnabled&&(Dwt(this,e),this._numberOfCascades>1&&Swt(this,e)),this._isPointLight)this._shadowMapCullingVolume=ta.fromBoundingSphere(this._boundingSphere);else{let t=this._shadowMapCamera,n=t.positionWC,i=t.directionWC,r=t.upWC;this._shadowMapCullingVolume=t.frustum.computeCullingVolume(n,i,r),this._passes.length===1&&this._passes[0].camera.clone(t)}if(this._passes.length===1){let t=this._sceneCamera.inverseViewMatrix;N.multiply(this._shadowMapCamera.getViewProjection(),t,this._shadowMapMatrix)}this.debugShow&&xwt(this,e)};S0.prototype.updatePass=function(e,t){JPe(this,e,t)};var Uwt=new U;function tDe(e,t,n){let i=e._isPointLight?e._pointBias:n?e._terrainBias:e._primitiveBias,r={shadowMap_texture:function(){return e._shadowMapTexture},shadowMap_textureCube:function(){return e._shadowMapTexture},shadowMap_matrix:function(){return e._shadowMapMatrix},shadowMap_cascadeSplits:function(){return e._cascadeSplits},shadowMap_cascadeMatrices:function(){return e._cascadeMatrices},shadowMap_lightDirectionEC:function(){return e._lightDirectionEC},shadowMap_lightPositionEC:function(){return e._lightPositionEC},shadowMap_cascadeDistances:function(){return e._cascadeDistances},shadowMap_texelSizeDepthBiasAndNormalShadingSmooth:function(){let o=Uwt;return o.x=1/e._textureSize.x,o.y=1/e._textureSize.y,se.fromElements(o.x,o.y,i.depthBias,i.normalShadingSmooth,this.combinedUniforms1)},shadowMap_normalOffsetScaleDistanceMaxDistanceAndDarkness:function(){return se.fromElements(i.normalOffsetScale,e._distance,e.maximumDistance,e._darkness,this.combinedUniforms2)},combinedUniforms1:new se,combinedUniforms2:new se};return Ot(t,r,!1)}function zwt(e,t,n,i,r,o){let s,a,c;if(l(o)&&(s=o.shaderProgram,a=o.renderState,c=o.uniformMap),o=at.shallowClone(n,o),o.castShadows=!0,o.receiveShadows=!1,!l(s)||r!==n.shaderProgram.id||t){let u=n.shaderProgram,f=n.pass===Ie.GLOBE,d=n.pass!==Ie.TRANSLUCENT,p=e._isPointLight,g=e._usesDepthTexture,m=u.vertexShaderSource,y=u.fragmentShaderSource,A=d&&Ym.hasClippingForShadowCast(y),b=Ym.getShadowCastShaderKeyword(p,f,g,d,A);if(s=i.shaderCache.getDerivedShaderProgram(u,b),!l(s)){let T=Ym.createShadowCastVertexShader(m,p,f),E=Ym.createShadowCastFragmentShader(y,p,g,d,A);s=i.shaderCache.createDerivedShaderProgram(u,b,{vertexShaderSource:T,fragmentShaderSource:E,attributeLocations:u._attributeLocations})}a=e._primitiveRenderState,p?a=e._pointRenderState:f&&(a=e._terrainRenderState),n.renderState.cull.enabled||(a=Je(a,!1),a.cull=Je(a.cull,!1),a.cull.enabled=!1,a=Ge.fromCache(a)),c=tDe(e,n.uniformMap,f)}return o.shaderProgram=s,o.renderState=a,o.uniformMap=c,o}S0.createReceiveDerivedCommand=function(e,t,n,i,r){l(r)||(r={});let o=e.length>0,s=t.shaderProgram,a=s.vertexShaderSource,c=s.fragmentShaderSource,u=t.pass===Ie.GLOBE,f=!1;if(u&&(f=t.owner.data.renderedMesh.encoding.hasVertexNormals),t.receiveShadows&&o){let d,p;l(r.receiveCommand)&&(d=r.receiveCommand.shaderProgram,p=r.receiveCommand.uniformMap),r.receiveCommand=at.shallowClone(t,r.receiveCommand),r.castShadows=!1,r.receiveShadows=!0;let g=r.receiveShaderCastShadows!==t.castShadows,m=r.receiveShaderProgramId!==t.shaderProgram.id;if(!l(d)||m||n||g){let y=Ym.getShadowReceiveShaderKeyword(e[0],t.castShadows,u,f);if(d=i.shaderCache.getDerivedShaderProgram(s,y),!l(d)){let A=Ym.createShadowReceiveVertexShader(a,u,f),b=Ym.createShadowReceiveFragmentShader(c,e[0],t.castShadows,u,f);d=i.shaderCache.createDerivedShaderProgram(s,y,{vertexShaderSource:A,fragmentShaderSource:b,attributeLocations:s._attributeLocations})}p=tDe(e[0],t.uniformMap,u)}r.receiveCommand.shaderProgram=d,r.receiveCommand.uniformMap=p,r.receiveShaderProgramId=t.shaderProgram.id,r.receiveShaderCastShadows=t.castShadows}return r};S0.createCastDerivedCommand=function(e,t,n,i,r){if(l(r)||(r={}),t.castShadows){let o=r.castCommands;l(o)||(o=r.castCommands=[]);let s=r.castShaderProgramId,a=e.length;o.length=a;for(let c=0;c<a;++c)o[c]=zwt(e[c],n,t,i,s,o[c]);r.castShaderProgramId=t.shaderProgram.id}return r};S0.prototype.isDestroyed=function(){return!1};S0.prototype.destroy=function(){pne(this),this._debugLightFrustum=this._debugLightFrustum&&this._debugLightFrustum.destroy(),this._debugCameraFrustum=this._debugCameraFrustum&&this._debugCameraFrustum.destroy(),this._debugShadowViewCommand=this._debugShadowViewCommand&&this._debugShadowViewCommand.shaderProgram&&this._debugShadowViewCommand.shaderProgram.destroy();for(let e=0;e<this._numberOfCascades;++e)this._debugCascadeFrustums[e]=this._debugCascadeFrustums[e]&&this._debugCascadeFrustums[e].destroy();return le(this)};var V_=S0;var LE=`uniform sampler2D colorTexture; #ifdef DEBUG_SHOW_DEPTH uniform sampler2D u_packedTranslucentDepth; #endif @@ -10572,7 +10572,7 @@ color.rgb /= color.a; out_FragColor = color; #endif } -`;var jLt=!1;function Ob(e){this._drawClassificationFBO=new ai({createDepthAttachments:!1}),this._accumulationFBO=new ai({createDepthAttachments:!1}),this._packFBO=new ai,this._opaqueDepthStencilTexture=void 0,this._textureToComposite=void 0,this._translucentDepthStencilTexture=void 0,this._packDepthCommand=void 0,this._accumulateCommand=void 0,this._compositeCommand=void 0,this._copyCommand=void 0,this._clearColorCommand=new li({color:new z(0,0,0,0),owner:this}),this._clearDepthStencilCommand=new li({depth:1,stencil:0,owner:this}),this._supported=e.depthTexture,this._viewport=new et,this._rsDepth=void 0,this._rsAccumulate=void 0,this._rsComp=void 0,this._useScissorTest=void 0,this._scissorRectangle=void 0,this._hasTranslucentDepth=!1,this._frustumsDrawn=0}Object.defineProperties(Ob.prototype,{hasTranslucentDepth:{get:function(){return this._hasTranslucentDepth}}});function uLe(e){e._textureToComposite=void 0,e._translucentDepthStencilTexture=e._translucentDepthStencilTexture&&!e._translucentDepthStencilTexture.isDestroyed()&&e._translucentDepthStencilTexture.destroy()}function fLe(e){e._drawClassificationFBO.destroy(),e._accumulationFBO.destroy(),e._packFBO.destroy()}function HLt(e,t,n,i){uLe(e),e._translucentDepthStencilTexture=new Dt({context:t,width:n,height:i,pixelFormat:Ke.DEPTH_STENCIL,pixelDatatype:ze.UNSIGNED_INT_24_8,sampler:jt.NEAREST})}function GLt(e,t,n,i){fLe(e),e._drawClassificationFBO.setDepthStencilTexture(e._translucentDepthStencilTexture),e._drawClassificationFBO.update(t,n,i),e._accumulationFBO.setDepthStencilTexture(e._translucentDepthStencilTexture),e._accumulationFBO.update(t,n,i),e._packFBO.update(t,n,i)}function WLt(e,t,n,i){if(!e.isSupported())return;e._opaqueDepthStencilTexture=i;let r=e._opaqueDepthStencilTexture.width,o=e._opaqueDepthStencilTexture.height;e._drawClassificationFBO.isDirty(r,o)&&(HLt(e,t,r,o),GLt(e,t,r,o));let s,a;if(l(e._packDepthCommand)||(s=new Ye({sources:[$O]}),a={u_opaqueDepthTexture:function(){return e._opaqueDepthStencilTexture},u_translucentDepthTexture:function(){return e._translucentDepthStencilTexture}},e._packDepthCommand=t.createViewportQuadCommand(s,{uniformMap:a,owner:e})),!l(e._compositeCommand)){s=new Ye({sources:[dC]}),a={colorTexture:function(){return e._textureToComposite}},jLt&&(s.defines=["DEBUG_SHOW_DEPTH"],a.u_packedTranslucentDepth=function(){return e._packFBO.getColorTexture()}),e._compositeCommand=t.createViewportQuadCommand(s,{uniformMap:a,owner:e});let f=e._compositeCommand,d=f.shaderProgram,p=t.shaderCache.createDerivedShaderProgram(d,"pick",{vertexShaderSource:d.vertexShaderSource,fragmentShaderSource:new Ye({sources:s.sources,defines:["PICK"]}),attributeLocations:d._attributeLocations}),g=at.shallowClone(f);g.shaderProgram=p,f.derivedCommands.pick=g}l(e._copyCommand)||(s=new Ye({sources:[dC]}),a={colorTexture:function(){return e._drawClassificationFBO.getColorTexture()}},e._copyCommand=t.createViewportQuadCommand(s,{uniformMap:a,owner:e})),l(e._accumulateCommand)||(s=new Ye({sources:[dC]}),a={colorTexture:function(){return e._drawClassificationFBO.getColorTexture()}},e._accumulateCommand=t.createViewportQuadCommand(s,{uniformMap:a,owner:e})),e._viewport.width=r,e._viewport.height=o;let c=!et.equals(e._viewport,n.viewport),u=c!==e._useScissorTest;e._useScissorTest=c,et.equals(e._scissorRectangle,n.viewport)||(e._scissorRectangle=et.clone(n.viewport,e._scissorRectangle),u=!0),(!l(e._rsDepth)||!et.equals(e._viewport,e._rsDepth.viewport)||u)&&(e._rsDepth=Ge.fromCache({viewport:e._viewport,scissorTest:{enabled:e._useScissorTest,rectangle:e._scissorRectangle}})),l(e._packDepthCommand)&&(e._packDepthCommand.renderState=e._rsDepth),(!l(e._rsAccumulate)||!et.equals(e._viewport,e._rsAccumulate.viewport)||u)&&(e._rsAccumulate=Ge.fromCache({viewport:e._viewport,scissorTest:{enabled:e._useScissorTest,rectangle:e._scissorRectangle},stencilTest:{enabled:!0,frontFunction:ti.EQUAL,reference:Yt.CESIUM_3D_TILE_MASK}})),l(e._accumulateCommand)&&(e._accumulateCommand.renderState=e._rsAccumulate),(!l(e._rsComp)||!et.equals(e._viewport,e._rsComp.viewport)||u)&&(e._rsComp=Ge.fromCache({viewport:e._viewport,scissorTest:{enabled:e._useScissorTest,rectangle:e._scissorRectangle},blending:tn.ALPHA_BLEND})),l(e._compositeCommand)&&(e._compositeCommand.renderState=e._rsComp,e._compositeCommand.derivedCommands.pick.renderState=e._rsComp)}Ob.prototype.executeTranslucentCommands=function(e,t,n,i,r){let o=e.frameState.useLogDepth,s=e.context,a=n.framebuffer;for(let c=0;c<i.length;++c){let u=i[c];if(u=o?u.derivedCommands.logDepth.command:u,u.depthForTranslucentClassification){this._hasTranslucentDepth=!0;break}}if(this._hasTranslucentDepth){WLt(this,s,n,r),n.framebuffer=this._drawClassificationFBO.framebuffer,this._clearDepthStencilCommand.execute(s,n);for(let c=0;c<i.length;++c){let u=i[c];if(u=o?u.derivedCommands.logDepth.command:u,!u.depthForTranslucentClassification)continue;let f=u.derivedCommands.depth.depthOnlyCommand;t(f,e,n)}this._frustumsDrawn+=this._hasTranslucentDepth?1:0,this._hasTranslucentDepth&&(n.framebuffer=this._packFBO.framebuffer,this._packDepthCommand.execute(s,n)),n.framebuffer=a}};Ob.prototype.executeClassificationCommands=function(e,t,n,i){if(!this._hasTranslucentDepth)return;let r=e.context,o=r.uniformState,s=n.framebuffer;n.framebuffer=this._accumulationFBO.framebuffer,this._accumulateCommand.execute(r,n),n.framebuffer=this._drawClassificationFBO.framebuffer,this._frustumsDrawn>1&&this._clearColorCommand.execute(r,n),o.updatePass(Ie.CESIUM_3D_TILE_CLASSIFICATION);let a=o.globeDepthTexture;o.globeDepthTexture=this._packFBO.getColorTexture();let c=i.commands[Ie.CESIUM_3D_TILE_CLASSIFICATION],u=i.indices[Ie.CESIUM_3D_TILE_CLASSIFICATION];for(let f=0;f<u;++f)t(c[f],e,n);o.globeDepthTexture=a,n.framebuffer=s,this._frustumsDrawn!==1&&(n.framebuffer=this._accumulationFBO.framebuffer,this._accumulateCommand.execute(r,n),n.framebuffer=s)};Ob.prototype.execute=function(e,t){if(!this._hasTranslucentDepth)return;this._frustumsDrawn===1?this._textureToComposite=this._drawClassificationFBO.getColorTexture():this._textureToComposite=this._accumulationFBO.getColorTexture(),(e.frameState.passes.pick?this._compositeCommand.derivedCommands.pick:this._compositeCommand).execute(e.context,t),qLt(this,e,t)};function qLt(e,t,n){if(!e._hasTranslucentDepth)return;let i=n.framebuffer;n.framebuffer=e._drawClassificationFBO.framebuffer,e._clearColorCommand.execute(t._context,n),n.framebuffer=i,e._frustumsDrawn>1&&(n.framebuffer=e._accumulationFBO.framebuffer,e._clearColorCommand.execute(t._context,n)),e._hasTranslucentDepth=!1,e._frustumsDrawn=0}Ob.prototype.isSupported=function(){return this._supported};Ob.prototype.isDestroyed=function(){return!1};Ob.prototype.destroy=function(){return uLe(this),fLe(this),l(this._compositeCommand)&&(this._compositeCommand.shaderProgram=this._compositeCommand.shaderProgram&&this._compositeCommand.shaderProgram.destroy()),l(this._packDepthCommand)&&(this._packDepthCommand.shaderProgram=this._packDepthCommand.shaderProgram&&this._packDepthCommand.shaderProgram.destroy()),le(this)};var qz=Ob;function YLt(){this.command=void 0,this.near=void 0,this.far=void 0}function Y7(e,t,n){let i=e.context,r;i.depthTexture&&(r=new zz);let o;e._useOIT&&i.depthTexture&&(o=new jz(i));let s=new sc(i);s.viewport=et.clone(n),this.camera=t,this._cameraClone=Or.clone(t),this._cameraStartFired=!1,this._cameraMovedTime=void 0,this.viewport=n,this.passState=s,this.pickFramebuffer=new Wz(i),this.snapFramebuffer=void 0,this.pickDepthFramebuffer=new Gz,this.sceneFramebuffer=new fC,this.edgeFramebuffer=new Bz,this.planarFillIdFramebuffer=new kz,this.globeDepth=r,this.globeTranslucencyFramebuffer=new Vz,this.oit=o,this.translucentTileClassification=new qz(i),this.pickDepths=[],this.frustumCommandsList=[],this.debugFrustumStatistics=void 0,this._commandExtents=[]}var Goe=new h,Woe=new h;function XLt(e,t,n){let i=Math.max(h.maximumComponent(h.abs(e.position,Goe)),h.maximumComponent(h.abs(t.position,Woe))),r=1/Math.max(1,i);return h.multiplyByScalar(e.position,r,Goe),h.multiplyByScalar(t.position,r,Woe),h.equalsEpsilon(Goe,Woe,n)&&h.equalsEpsilon(e.direction,t.direction,n)&&h.equalsEpsilon(e.up,t.up,n)&&h.equalsEpsilon(e.right,t.right,n)&&N.equalsEpsilon(e.transform,t.transform,n)&&e.frustum.equalsEpsilon(t.frustum,n)}Y7.prototype.checkForCameraUpdates=function(e){let t=this.camera,n=this._cameraClone;return XLt(t,n,D.EPSILON15)?(this._cameraStartFired&&xn()-this._cameraMovedTime>e.cameraEventWaitTime&&(t.moveEnd.raiseEvent(),this._cameraStartFired=!1),!1):(this._cameraStartFired||(t.moveStart.raiseEvent(),this._cameraStartFired=!0),this._cameraMovedTime=xn(),Or.clone(t,n),!0)};function KLt(e,t,n,i){let{frameState:r}=t,{camera:o,useLogDepth:s}=r,a=s?t.logarithmicDepthFarToNearRatio:t.farToNearRatio,c=t.mode===re.SCENE2D,u=t.nearToFarDistance2D;i*=1+D.EPSILON2,n=Math.min(Math.max(n,o.frustum.near),o.frustum.far),i=Math.max(Math.min(i,o.frustum.far),n);let f;c?(i=Math.min(i,o.position.z+t.nearToFarDistance2D),n=Math.min(n,i),f=Math.ceil(Math.max(1,i-n)/t.nearToFarDistance2D)):f=Math.ceil(Math.log(i/n)/Math.log(a));let{frustumCommandsList:d}=e;d.length=f;for(let p=0;p<f;++p){let g,m;c?(g=Math.min(i-u,n+p*u),m=Math.min(i,g+u)):(g=Math.max(n,Math.pow(a,p)*n),m=Math.min(i,a*g)),l(d[p])?(d[p].near=g,d[p].far=m):d[p]=new Uz(g,m)}}function $Lt(e,t,n){let{command:i,near:r,far:o}=n;t.debugShowFrustums&&(i.debugOverlappingFrustums=0);let{frustumCommandsList:s}=e;for(let a=0;a<s.length;++a){let c=s[a];if(r>c.far)continue;if(o<c.near)break;let u=i.pass,f=c.indices[u]++;if(c.commands[u][f]=i,t.debugShowFrustums&&(i.debugOverlappingFrustums|=1<<a),i.executeInClosestFrustum)break}if(t.debugShowFrustums){let{debugFrustumStatistics:a}=e,{debugOverlappingFrustums:c}=i,u=a.commandsInFrustums;u[c]=l(u[c])?u[c]+1:1,++a.totalCommands}t.updateDerivedCommands(i)}var dLe=new ta,JLt=new Us;Y7.prototype.createPotentiallyVisibleSet=function(e){let{frameState:t}=e,{camera:n,commandList:i,shadowState:r}=t,{positionWC:o,directionWC:s,frustum:a}=n,c=e._computeCommandList,u=e._overlayCommandList;e.debugShowFrustums&&(this.debugFrustumStatistics={totalCommands:0,commandsInFrustums:{}});let f=this.frustumCommandsList;for(let O=0;O<f.length;++O)for(let L=0;L<Ie.NUMBER_OF_PASSES;++L)f[O].indices[L]=0;c.length=0,u.length=0;let d=this._commandExtents,p=d.length,g=0,m=+Number.MAX_VALUE,y=-Number.MAX_VALUE,{shadowsEnabled:A}=r,b=+Number.MAX_VALUE,x=-Number.MAX_VALUE,T=Number.MAX_VALUE,E=t.mode===re.SCENE3D?t.occluder:void 0,{cullingVolume:v}=t,S=dLe.planes;for(let O=0;O<5;++O)S[O]=v.planes[O];v=dLe;for(let O=0;O<i.length;++O){let L=i[O],{pass:_,boundingVolume:C}=L;if(_===Ie.COMPUTE)c.push(L);else if(_===Ie.OVERLAY)u.push(L);else{let w,P;if(l(C)){if(!e.isVisible(v,L,E))continue;let F=C.computePlaneDistances(o,s,JLt);if(w=F.start,P=F.stop,m=Math.min(m,w),y=Math.max(y,P),A&&L.receiveShadows&&w<oy.MAXIMUM_DISTANCE&&!(_===Ie.GLOBE&&w<-100&&P>100)){let V=P-w;_!==Ie.GLOBE&&w<100&&(T=Math.min(T,V)),b=Math.min(b,w),x=Math.max(x,P)}}else L instanceof li?(w=a.near,P=a.far):(w=a.near,P=a.far,m=Math.min(m,w),y=Math.max(y,P));let M=d[g];l(M)||(M=d[g]=new YLt),M.command=L,M.near=w,M.far=P,g++}}A&&(b=Math.min(Math.max(b,a.near),a.far),x=Math.max(Math.min(x,a.far),b),r.nearPlane=b,r.farPlane=x,r.closestObjectSize=T),KLt(this,e,m,y);for(let O=0;O<g;O++)$Lt(this,e,d[O]);if(g<p)for(let O=g;O<p;O++){let L=d[O];if(!l(L.command))break;L.command=void 0}for(let O=0;O<f.length;++O){let{commands:L,indices:_}=f[O];for(let C=0;C<L.length;++C){let w=L[C];for(let P=_[C];P<w.length&&l(w[P]);++P)w[P]=void 0}}let I=f.length,{frustumSplits:R}=t;R.length=I+1;for(let O=0;O<I;++O)R[O]=f[O].near,O===I-1&&(R[O+1]=f[O].far)};Y7.prototype.destroy=function(){this.pickFramebuffer=this.pickFramebuffer&&this.pickFramebuffer.destroy(),this.snapFramebuffer=this.snapFramebuffer&&this.snapFramebuffer.destroy(),this.pickDepthFramebuffer=this.pickDepthFramebuffer&&this.pickDepthFramebuffer.destroy(),this.sceneFramebuffer=this.sceneFramebuffer&&this.sceneFramebuffer.destroy(),this.edgeFramebuffer=this.edgeFramebuffer&&this.edgeFramebuffer.destroy(),this.planarFillIdFramebuffer=this.planarFillIdFramebuffer&&this.planarFillIdFramebuffer.destroy(),this.globeDepth=this.globeDepth&&this.globeDepth.destroy(),this.oit=this.oit&&this.oit.destroy(),this.translucentTileClassification=this.translucentTileClassification&&this.translucentTileClassification.destroy(),this.globeTranslucencyFramebuffer=this.globeTranslucencyFramebuffer&&this.globeTranslucencyFramebuffer.destroy();let e=this.pickDepths;for(let t=0;t<e.length;++t)e[t].destroy()};var hC=Y7;var mLe=.1,ZLt=new vh({pass:ao.MOST_DETAILED_PRELOAD}),QLt=new vh({pass:ao.MOST_DETAILED_PICK}),Yz=new vh({pass:ao.PICK});function Oa(e){this._mostDetailedRayPicks=[],this.pickRenderStateCache={},this._pickPositionCache={},this._pickPositionCacheDirty=!1;let t=new et(0,0,1,1),n=new Or(e);n.frustum=new gn({width:mLe,aspectRatio:1,near:.1}),this._pickOffscreenView=new hC(e,n,t)}Oa.prototype.update=function(){this._pickPositionCacheDirty=!0};Oa.prototype.getPickDepth=function(e,t){let n=e.view.pickDepths,i=n[t];return l(i)||(i=new Fz,n[t]=i),i};var eFt=new ys,tFt=new h,X7=new h,nFt=new U,iFt=new N;function rFt(e,t,n,i,r){let o=e.camera,s=o.frustum,a=s.offCenterFrustum;l(a)&&(s=a);let c=2*(t.x-r.x)/r.width-1;c*=(s.right-s.left)*.5;let u=2*(r.height-t.y-r.y)/r.height-1;u*=(s.top-s.bottom)*.5;let f=N.clone(o.transform,iFt);o._setTransform(N.IDENTITY);let d=h.clone(o.position,tFt);h.multiplyByScalar(o.right,c,X7),h.add(X7,d,d),h.multiplyByScalar(o.up,u,X7),h.add(X7,d,d),o._setTransform(f),e.mode===re.SCENE2D&&h.fromElements(d.z,d.x,d.y,d);let p=s.getPixelDimensions(r.width,r.height,1,1,nFt),g=eFt;return g.right=p.x*.5,g.left=-g.right,g.top=p.y*.5,g.bottom=-g.top,g.near=s.near,g.far=s.far,g.computeCullingVolume(d,o.directionWC,o.upWC)}var oFt=new yu,sFt=new U;function aFt(e,t,n,i,r){let o=e.camera,s=o.frustum,a=s.near,c=Math.tan(s.fovy*.5),u=s.aspectRatio*c,f=2*(t.x-r.x)/r.width-1,d=2*(r.height-t.y-r.y)/r.height-1,p=f*a*u,g=d*a*c,m=s.getPixelDimensions(r.width,r.height,1,1,sFt),y=m.x*n*.5,A=m.y*i*.5,b=oFt;return b.top=g+A,b.bottom=g-A,b.right=p+y,b.left=p-y,b.near=a,b.far=s.far,b.computeCullingVolume(o.positionWC,o.directionWC,o.upWC)}function K7(e,t,n,i,r){let o=e.camera.frustum;return o instanceof gn||o instanceof ys?rFt(e,t,n,i,r):aFt(e,t,n,i,r)}var Xz=new et(0,0,3,3),$7=new U,Kz=new z(0,0,0,0);function qoe(e,t,n,i,r){return r.width=n??3,r.height=i??r.width,r.x=t.x-(r.width-1)*.5,r.y=e-t.y-(r.height-1)*.5,r}function $z(e,t,n,i,r,o){let{context:s,frameState:a,defaultView:c}=e,{viewport:u,pickFramebuffer:f}=c,d=o?.framebuffer??f;e.view=c,u.x=0,u.y=0,u.width=s.drawingBufferWidth,u.height=s.drawingBufferHeight;let p=c.passState;p.viewport=et.clone(u,p.viewport);let g=dr.transformWindowToDrawingBuffer(e,t,$7);qoe(s.drawingBufferHeight,g,i,r,n),e.jobScheduler.disableThisFrame(),e.updateFrameState(),a.cullingVolume=K7(e,g,n.width,n.height,u),a.invertClassification=!1,a.passes.pick=!0,a.passes.snap=o?.snap??!1,a.tilesetPassState=Yz,s.uniformState.update(a),e.updateEnvironment(),p=d.begin(n,u),e.updateAndExecuteCommands(p,Kz),e.resolveFramebuffers(p)}function Jz(e){let{context:t}=e;t.endFrame()}Oa.prototype.pickAsync=async function(e,t,n,i,r=1){let{context:o,frameState:s,defaultView:a}=e,{pickFramebuffer:c}=a,u=Xz;$z(e,t,u,n,i);let f;return o.webgl2?f=c.endAsync(u,s,r):(f=c.end(u,r),f=Promise.resolve(f),_t("picking-async-fallback","Fallback to synchronous picking because async operation requires WebGL2 context.")),Jz(e),f};Oa.prototype.pick=function(e,t,n,i,r=1){let{defaultView:o}=e,{pickFramebuffer:s}=o,a=Xz;$z(e,t,a,n,i);let c=s.end(a,r);return Jz(e),c};Oa.prototype.pickVoxelCoordinate=function(e,t,n,i){let{context:r,frameState:o,defaultView:s}=e,{viewport:a,pickFramebuffer:c}=s;e.view=s,a.x=0,a.y=0,a.width=r.drawingBufferWidth,a.height=r.drawingBufferHeight;let u=s.passState;u.viewport=et.clone(a,u.viewport);let f=dr.transformWindowToDrawingBuffer(e,t,$7),d=qoe(r.drawingBufferHeight,f,n,i,Xz);e.jobScheduler.disableThisFrame(),e.updateFrameState(),o.cullingVolume=K7(e,f,d.width,d.height,a),o.invertClassification=!1,o.passes.pickVoxel=!0,o.tilesetPassState=Yz,r.uniformState.update(o),e.updateEnvironment(),u=c.begin(d,a),e.updateAndExecuteCommands(u,Kz),e.resolveFramebuffers(u);let p=c.readCenterPixel(d);return r.endFrame(),p};Oa.prototype.pickMetadata=function(e,t,n){let{context:i,frameState:r,defaultView:o}=e,{viewport:s,pickFramebuffer:a}=o;e.view=o,s.x=0,s.y=0,s.width=i.drawingBufferWidth,s.height=i.drawingBufferHeight;let c=o.passState;c.viewport=et.clone(s,c.viewport);let u=dr.transformWindowToDrawingBuffer(e,t,$7),f=qoe(i.drawingBufferHeight,u,1,1,Xz);e.jobScheduler.disableThisFrame(),e.updateFrameState(),r.cullingVolume=K7(e,u,f.width,f.height,s),r.invertClassification=!1,r.passes.pick=!0,r.tilesetPassState=Yz,r.pickingMetadata=!0,r.pickedMetadataInfo=n,i.uniformState.update(r),e.updateEnvironment(),c=a.begin(f,s),e.updateAndExecuteCommands(c,Kz);let d=e._environmentState.useOIT;e._environmentState.useOIT=!1,e.resolveFramebuffers(c),e._environmentState.useOIT=d;let p=a.readCenterPixel(f);return i.endFrame(),r.pickingMetadata=!1,Lz.decodeMetadataValues(n.classProperty,n.metadataProperty,p)};function cFt(e,t){let{defaultView:n,context:i,frameState:r,environmentState:o}=e,{viewport:s,pickDepthFramebuffer:a}=n;e.view=n,s.x=0,s.y=0,s.width=i.drawingBufferWidth,s.height=i.drawingBufferHeight;let c=n.passState;c.viewport=et.clone(s,c.viewport),e.clearPasses(r.passes),r.passes.pick=!0,r.passes.depth=!0,r.cullingVolume=K7(e,t,1,1,s),r.tilesetPassState=Yz,e.updateEnvironment(),o.renderTranslucentDepthForPick=!0,c=a.update(i,t,s),e.updateAndExecuteCommands(c,Kz),e.resolveFramebuffers(c),i.endFrame()}var lFt=new Ji,uFt=new yu,fFt=new gn,dFt=new ys;Oa.prototype.pickPositionWorldCoordinates=function(e,t,n){if(!e.useDepthPicking)return;let i=t.toString();if(this._pickPositionCacheDirty)this._pickPositionCache={},this._pickPositionCacheDirty=!1;else if(this._pickPositionCache.hasOwnProperty(i))return h.clone(this._pickPositionCache[i],n);let{context:r,frameState:o,camera:s,defaultView:a}=e,{uniformState:c}=r;e.view=a;let u=dr.transformWindowToDrawingBuffer(e,t,$7);e.pickTranslucentDepth?cFt(e,u):(e.updateFrameState(),c.update(o),e.updateEnvironment()),u.y=e.drawingBufferHeight-u.y;let f;l(s.frustum.fov)?f=s.frustum.clone(lFt):l(s.frustum.infiniteProjectionMatrix)?f=s.frustum.clone(uFt):l(s.frustum.width)?f=s.frustum.clone(fFt):f=s.frustum.clone(dFt);let{frustumCommandsList:d}=a,p=d.length;for(let g=0;g<p;++g){let y=this.getPickDepth(e,g).getDepth(r,u.x,u.y);if(l(y)&&y>0&&y<1){let A=d[g],b;return e.mode===re.SCENE2D?(b=s.position.z,s.position.z=b-A.near+1,f.far=Math.max(1,A.far-A.near),f.near=1,c.update(o),c.updateFrustum(f)):(f.near=A.near*(g!==0?e.opaqueFrustumNearOffset:1),f.far=A.far,c.updateFrustum(f)),n=dr.drawingBufferToWorldCoordinates(e,u,y,n),e.mode===re.SCENE2D&&(s.position.z=b,c.update(o)),this._pickPositionCache[i]=h.clone(n),n}}this._pickPositionCache[i]=void 0};var hFt=new he;Oa.prototype.pickPosition=function(e,t,n){if(n=this.pickPositionWorldCoordinates(e,t,n),l(n)&&e.mode!==re.SCENE3D){h.fromElements(n.y,n.z,n.x,n);let i=e.mapProjection,r=i.ellipsoid,o=i.unproject(n,hFt);r.cartographicToCartesian(o,n)}return n};function mFt(e,t,n,i,r,o){for(let s of e){let a=s.object,c=s.position,u=s.exclude;if(l(c)&&!l(a))return n.push(s),!0;if(!l(a)||!l(a.primitive)||!u&&(n.push(s),n.length>=t))return!0;let f=a.primitive,d=!1;if(typeof f.getGeometryInstanceAttributes=="function"&&l(a.id)){let p=f.getGeometryInstanceAttributes(a.id);l(p)&&l(p.show)&&(d=!0,p.show=Pn.toValue(!1,p.show),r.push(p))}a instanceof na&&(d=!0,a.show=!1,o.push(a)),d||(f.show=!1,i.push(f))}}function pLe(e,t){let n=[],i=[],r=[],o=[];l(t)||(t=Number.MAX_VALUE);let s=e(t);for(;l(s)&&s.length>0&&!mFt(s,t,n,i,r,o);)s=e(t-n.length);for(let a=0;a<i.length;++a)i[a].show=!0;for(let a=0;a<r.length;++a){let c=r[a];c.show=Pn.toValue(!0,c.show)}for(let a=0;a<o.length;++a)o[a].show=!0;return n}Oa.prototype.drillPick=function(e,t,n,i,r){return pLe(a=>this.pick(e,t,i,r,a).map(u=>({object:u,position:void 0,exclude:!1})),n).map(a=>a.object)};var hLe=new h,pFt=new h;function gFt(e,t,n){this.ray=e,this.width=t,this.tilesets=n,this.ready=!1;let i=this;this.promise=new Promise(r=>{i._completePick=()=>{r()}})}function gLe(e,t,n,i){let r=t.direction,o=h.mostOrthogonalAxis(r,hLe),s=h.cross(r,o,hLe),a=h.cross(r,s,pFt);return i.position=t.origin,i.direction=r,i.up=a,i.right=s,i.frustum.width=n??mLe,i.frustum.computeCullingVolume(i.positionWC,i.directionWC,i.upWC)}function _Ft(e,t,n){let i=t.frameState,{ray:r,width:o,tilesets:s}=n,a=e._pickOffscreenView.camera,c=gLe(e,r,o,a),u=ZLt;u.camera=a,u.cullingVolume=c;let f=!0,d=s.length;for(let p=0;p<d;++p){let g=s[p];g.show&&t.primitives.contains(g)&&(g.updateForPass(i,u),f=f&&u.ready)}return f&&n._completePick(),f}Oa.prototype.updateMostDetailedRayPicks=function(e){let t=this._mostDetailedRayPicks;for(let n=0;n<t.length;++n)_Ft(this,e,t[n])&&t.splice(n--,1)};function _Le(e,t,n){for(let i=0;i<e.length;++i){let r=e.get(i);r.show&&(l(r.isCesium3DTileset)?(!l(t)||t.indexOf(r)===-1)&&n.push(r):r instanceof xl&&_Le(r,t,n))}}function J7(e,t,n,i,r,o){let s=[];if(_Le(t.primitives,i,s),s.length===0)return Promise.resolve(o());let a=new gFt(n,r,s);return e._mostDetailedRayPicks.push(a),a.promise.then(function(){return o()})}function yFt(e,t){return!l(e)||!l(t)||t.length===0?!1:t.indexOf(e)>-1||t.indexOf(e.primitive)>-1||t.indexOf(e.id)>-1}function AFt(e,t,n,i,r,o,s){let{context:a,frameState:c}=t,u=a.uniformState,f=e._pickOffscreenView;t.view=f,gLe(e,n,r,f.camera);let d=et.clone(f.viewport,Xz),p=f.pickFramebuffer.begin(d,f.viewport);t.jobScheduler.disableThisFrame(),t.updateFrameState(),c.invertClassification=!1,c.passes.pick=!0,c.passes.offscreen=!0,s?c.tilesetPassState=QLt:c.tilesetPassState=Yz,u.update(c),t.updateEnvironment(),t.updateAndExecuteCommands(p,Kz),t.resolveFramebuffers(p);let g,m=f.pickFramebuffer.end(d,1)[0];if(t.context.depthTexture){let{frustumCommandsList:y}=f,A=y.length;for(let b=0;b<A;++b){let T=e.getPickDepth(t,b).getDepth(a,0,0);if(l(T)&&T>0&&T<1){let E=y[b],v=E.near*(b!==0?t.opaqueFrustumNearOffset:1),S=E.far,I=v+T*(S-v);g=pn.getPoint(n,I);break}}}if(t.view=t.defaultView,a.endFrame(),l(m)||l(g))return{object:m,position:g,exclude:!l(g)&&o||yFt(m,i)}}function Yoe(e,t,n,i,r,o,s,a){return pLe(function(){let u=AFt(e,t,n,r,o,s,a);return u?[u]:void 0},i)}function xP(e,t,n,i,r,o,s){let a=Yoe(e,t,n,1,i,r,o,s);if(a.length>0)return a[0]}function Z7(e,t){return new Promise((n,i)=>{t.then(function(r){let o=e.postRender.addEventListener(function(){o(),n(r)});e.requestRender()}).catch(function(r){i(r)})})}Oa.prototype.pickFromRay=function(e,t,n,i){return xP(this,e,t,n,i,!1,!1)};Oa.prototype.drillPickFromRay=function(e,t,n,i,r){return Yoe(this,e,t,n,i,r,!1,!1)};Oa.prototype.pickFromRayMostDetailed=function(e,t,n,i){let r=this;return t=pn.clone(t),n=l(n)?n.slice():n,Z7(e,J7(r,e,t,n,i,function(){return xP(r,e,t,n,i,!1,!0)}))};Oa.prototype.drillPickFromRayMostDetailed=function(e,t,n,i,r){let o=this;return t=pn.clone(t),i=l(i)?i.slice():i,Z7(e,J7(o,e,t,i,r,function(){return Yoe(o,e,t,n,i,r,!1,!0)}))};var bFt=new h,xFt=new h,TFt=new pn,yLe=new he;function Xoe(e,t){let n=e.ellipsoid,i=Mi._defaultMaxTerrainHeight,r=n.geodeticSurfaceNormalCartographic(t,xFt),o=he.toCartesian(t,n,bFt),s=TFt;s.origin=o,s.direction=r;let a=new pn;return pn.getPoint(s,i,a.origin),h.negate(r,a.direction),a}function ALe(e,t){let n=e.ellipsoid,i=he.fromCartesian(t,n,yLe);return Xoe(e,i)}function bLe(e,t){let n=e.ellipsoid;return he.fromCartesian(t,n,yLe).height}function EFt(e,t,n,i,r){let o=Xoe(t,n);return J7(e,t,o,i,r,function(){let s=xP(e,t,o,i,r,!0,!0);if(l(s))return bLe(t,s.position)})}function CFt(e,t,n,i,r,o){let s=ALe(t,n);return J7(e,t,s,i,r,function(){let a=xP(e,t,s,i,r,!0,!0);if(l(a))return h.clone(a.position,o)})}Oa.prototype.sampleHeight=function(e,t,n,i){let r=Xoe(e,t),o=xP(this,e,r,n,i,!0,!1);if(l(o))return bLe(e,o.position)};Oa.prototype.clampToHeight=function(e,t,n,i,r){let o=ALe(e,t),s=xP(this,e,o,n,i,!0,!1);if(l(s))return h.clone(s.position,r)};Oa.prototype.sampleHeightMostDetailed=function(e,t,n,i){n=l(n)?n.slice():n;let r=t.length,o=new Array(r);for(let s=0;s<r;++s)o[s]=EFt(this,e,t[s],n,i);return Z7(e,Promise.all(o).then(function(s){let a=s.length;for(let c=0;c<a;++c)t[c].height=s[c];return t}))};Oa.prototype.clampToHeightMostDetailed=function(e,t,n,i){n=l(n)?n.slice():n;let r=t.length,o=new Array(r);for(let s=0;s<r;++s)o[s]=CFt(this,e,t[s],n,i,t[s]);return Z7(e,Promise.all(o).then(function(s){let a=s.length;for(let c=0;c<a;++c)t[c]=s[c];return t}))};Oa.prototype.destroy=function(){this._pickOffscreenView=this._pickOffscreenView&&this._pickOffscreenView.destroy()};var Zz=Oa;var Qz=`uniform sampler2D colorTexture; +`;var Vwt=!1;function fb(e){this._drawClassificationFBO=new ai({createDepthAttachments:!1}),this._accumulationFBO=new ai({createDepthAttachments:!1}),this._packFBO=new ai,this._opaqueDepthStencilTexture=void 0,this._textureToComposite=void 0,this._translucentDepthStencilTexture=void 0,this._packDepthCommand=void 0,this._accumulateCommand=void 0,this._compositeCommand=void 0,this._copyCommand=void 0,this._clearColorCommand=new li({color:new z(0,0,0,0),owner:this}),this._clearDepthStencilCommand=new li({depth:1,stencil:0,owner:this}),this._supported=e.depthTexture,this._viewport=new et,this._rsDepth=void 0,this._rsAccumulate=void 0,this._rsComp=void 0,this._useScissorTest=void 0,this._scissorRectangle=void 0,this._hasTranslucentDepth=!1,this._frustumsDrawn=0}Object.defineProperties(fb.prototype,{hasTranslucentDepth:{get:function(){return this._hasTranslucentDepth}}});function nDe(e){e._textureToComposite=void 0,e._translucentDepthStencilTexture=e._translucentDepthStencilTexture&&!e._translucentDepthStencilTexture.isDestroyed()&&e._translucentDepthStencilTexture.destroy()}function iDe(e){e._drawClassificationFBO.destroy(),e._accumulationFBO.destroy(),e._packFBO.destroy()}function jwt(e,t,n,i){nDe(e),e._translucentDepthStencilTexture=new Dt({context:t,width:n,height:i,pixelFormat:Ke.DEPTH_STENCIL,pixelDatatype:ze.UNSIGNED_INT_24_8,sampler:jt.NEAREST})}function Hwt(e,t,n,i){iDe(e),e._drawClassificationFBO.setDepthStencilTexture(e._translucentDepthStencilTexture),e._drawClassificationFBO.update(t,n,i),e._accumulationFBO.setDepthStencilTexture(e._translucentDepthStencilTexture),e._accumulationFBO.update(t,n,i),e._packFBO.update(t,n,i)}function Gwt(e,t,n,i){if(!e.isSupported())return;e._opaqueDepthStencilTexture=i;let r=e._opaqueDepthStencilTexture.width,o=e._opaqueDepthStencilTexture.height;e._drawClassificationFBO.isDirty(r,o)&&(jwt(e,t,r,o),Hwt(e,t,r,o));let s,a;if(l(e._packDepthCommand)||(s=new Ye({sources:[$O]}),a={u_opaqueDepthTexture:function(){return e._opaqueDepthStencilTexture},u_translucentDepthTexture:function(){return e._translucentDepthStencilTexture}},e._packDepthCommand=t.createViewportQuadCommand(s,{uniformMap:a,owner:e})),!l(e._compositeCommand)){s=new Ye({sources:[LE]}),a={colorTexture:function(){return e._textureToComposite}},Vwt&&(s.defines=["DEBUG_SHOW_DEPTH"],a.u_packedTranslucentDepth=function(){return e._packFBO.getColorTexture()}),e._compositeCommand=t.createViewportQuadCommand(s,{uniformMap:a,owner:e});let f=e._compositeCommand,d=f.shaderProgram,p=t.shaderCache.createDerivedShaderProgram(d,"pick",{vertexShaderSource:d.vertexShaderSource,fragmentShaderSource:new Ye({sources:s.sources,defines:["PICK"]}),attributeLocations:d._attributeLocations}),g=at.shallowClone(f);g.shaderProgram=p,f.derivedCommands.pick=g}l(e._copyCommand)||(s=new Ye({sources:[LE]}),a={colorTexture:function(){return e._drawClassificationFBO.getColorTexture()}},e._copyCommand=t.createViewportQuadCommand(s,{uniformMap:a,owner:e})),l(e._accumulateCommand)||(s=new Ye({sources:[LE]}),a={colorTexture:function(){return e._drawClassificationFBO.getColorTexture()}},e._accumulateCommand=t.createViewportQuadCommand(s,{uniformMap:a,owner:e})),e._viewport.width=r,e._viewport.height=o;let c=!et.equals(e._viewport,n.viewport),u=c!==e._useScissorTest;e._useScissorTest=c,et.equals(e._scissorRectangle,n.viewport)||(e._scissorRectangle=et.clone(n.viewport,e._scissorRectangle),u=!0),(!l(e._rsDepth)||!et.equals(e._viewport,e._rsDepth.viewport)||u)&&(e._rsDepth=Ge.fromCache({viewport:e._viewport,scissorTest:{enabled:e._useScissorTest,rectangle:e._scissorRectangle}})),l(e._packDepthCommand)&&(e._packDepthCommand.renderState=e._rsDepth),(!l(e._rsAccumulate)||!et.equals(e._viewport,e._rsAccumulate.viewport)||u)&&(e._rsAccumulate=Ge.fromCache({viewport:e._viewport,scissorTest:{enabled:e._useScissorTest,rectangle:e._scissorRectangle},stencilTest:{enabled:!0,frontFunction:ei.EQUAL,reference:Yt.CESIUM_3D_TILE_MASK}})),l(e._accumulateCommand)&&(e._accumulateCommand.renderState=e._rsAccumulate),(!l(e._rsComp)||!et.equals(e._viewport,e._rsComp.viewport)||u)&&(e._rsComp=Ge.fromCache({viewport:e._viewport,scissorTest:{enabled:e._useScissorTest,rectangle:e._scissorRectangle},blending:tn.ALPHA_BLEND})),l(e._compositeCommand)&&(e._compositeCommand.renderState=e._rsComp,e._compositeCommand.derivedCommands.pick.renderState=e._rsComp)}fb.prototype.executeTranslucentCommands=function(e,t,n,i,r){let o=e.frameState.useLogDepth,s=e.context,a=n.framebuffer;for(let c=0;c<i.length;++c){let u=i[c];if(u=o?u.derivedCommands.logDepth.command:u,u.depthForTranslucentClassification){this._hasTranslucentDepth=!0;break}}if(this._hasTranslucentDepth){Gwt(this,s,n,r),n.framebuffer=this._drawClassificationFBO.framebuffer,this._clearDepthStencilCommand.execute(s,n);for(let c=0;c<i.length;++c){let u=i[c];if(u=o?u.derivedCommands.logDepth.command:u,!u.depthForTranslucentClassification)continue;let f=u.derivedCommands.depth.depthOnlyCommand;t(f,e,n)}this._frustumsDrawn+=this._hasTranslucentDepth?1:0,this._hasTranslucentDepth&&(n.framebuffer=this._packFBO.framebuffer,this._packDepthCommand.execute(s,n)),n.framebuffer=a}};fb.prototype.executeClassificationCommands=function(e,t,n,i){if(!this._hasTranslucentDepth)return;let r=e.context,o=r.uniformState,s=n.framebuffer;n.framebuffer=this._accumulationFBO.framebuffer,this._accumulateCommand.execute(r,n),n.framebuffer=this._drawClassificationFBO.framebuffer,this._frustumsDrawn>1&&this._clearColorCommand.execute(r,n),o.updatePass(Ie.CESIUM_3D_TILE_CLASSIFICATION);let a=o.globeDepthTexture;o.globeDepthTexture=this._packFBO.getColorTexture();let c=i.commands[Ie.CESIUM_3D_TILE_CLASSIFICATION],u=i.indices[Ie.CESIUM_3D_TILE_CLASSIFICATION];for(let f=0;f<u;++f)t(c[f],e,n);o.globeDepthTexture=a,n.framebuffer=s,this._frustumsDrawn!==1&&(n.framebuffer=this._accumulationFBO.framebuffer,this._accumulateCommand.execute(r,n),n.framebuffer=s)};fb.prototype.execute=function(e,t){if(!this._hasTranslucentDepth)return;this._frustumsDrawn===1?this._textureToComposite=this._drawClassificationFBO.getColorTexture():this._textureToComposite=this._accumulationFBO.getColorTexture(),(e.frameState.passes.pick?this._compositeCommand.derivedCommands.pick:this._compositeCommand).execute(e.context,t),Wwt(this,e,t)};function Wwt(e,t,n){if(!e._hasTranslucentDepth)return;let i=n.framebuffer;n.framebuffer=e._drawClassificationFBO.framebuffer,e._clearColorCommand.execute(t._context,n),n.framebuffer=i,e._frustumsDrawn>1&&(n.framebuffer=e._accumulationFBO.framebuffer,e._clearColorCommand.execute(t._context,n)),e._hasTranslucentDepth=!1,e._frustumsDrawn=0}fb.prototype.isSupported=function(){return this._supported};fb.prototype.isDestroyed=function(){return!1};fb.prototype.destroy=function(){return nDe(this),iDe(this),l(this._compositeCommand)&&(this._compositeCommand.shaderProgram=this._compositeCommand.shaderProgram&&this._compositeCommand.shaderProgram.destroy()),l(this._packDepthCommand)&&(this._packDepthCommand.shaderProgram=this._packDepthCommand.shaderProgram&&this._packDepthCommand.shaderProgram.destroy()),le(this)};var LU=fb;function qwt(){this.command=void 0,this.near=void 0,this.far=void 0}function F5(e,t,n){let i=e.context,r;i.depthTexture&&(r=new PU);let o;e._useOIT&&i.depthTexture&&(o=new RU(i));let s=new sc(i);s.viewport=et.clone(n),this.camera=t,this._cameraClone=Or.clone(t),this._cameraStartFired=!1,this._cameraMovedTime=void 0,this.viewport=n,this.passState=s,this.pickFramebuffer=new NU(i),this.snapFramebuffer=void 0,this.pickDepthFramebuffer=new MU,this.sceneFramebuffer=new NE,this.edgeFramebuffer=new SU,this.planarFillIdFramebuffer=new wU,this.globeDepth=r,this.globeTranslucencyFramebuffer=new DU,this.oit=o,this.translucentTileClassification=new LU(i),this.pickDepths=[],this.frustumCommandsList=[],this.debugFrustumStatistics=void 0,this._commandExtents=[]}var _ne=new h,yne=new h;function Ywt(e,t,n){let i=Math.max(h.maximumComponent(h.abs(e.position,_ne)),h.maximumComponent(h.abs(t.position,yne))),r=1/Math.max(1,i);return h.multiplyByScalar(e.position,r,_ne),h.multiplyByScalar(t.position,r,yne),h.equalsEpsilon(_ne,yne,n)&&h.equalsEpsilon(e.direction,t.direction,n)&&h.equalsEpsilon(e.up,t.up,n)&&h.equalsEpsilon(e.right,t.right,n)&&N.equalsEpsilon(e.transform,t.transform,n)&&e.frustum.equalsEpsilon(t.frustum,n)}F5.prototype.checkForCameraUpdates=function(e){let t=this.camera,n=this._cameraClone;return Ywt(t,n,D.EPSILON15)?(this._cameraStartFired&&xn()-this._cameraMovedTime>e.cameraEventWaitTime&&(t.moveEnd.raiseEvent(),this._cameraStartFired=!1),!1):(this._cameraStartFired||(t.moveStart.raiseEvent(),this._cameraStartFired=!0),this._cameraMovedTime=xn(),Or.clone(t,n),!0)};function Xwt(e,t,n,i){let{frameState:r}=t,{camera:o,useLogDepth:s}=r,a=s?t.logarithmicDepthFarToNearRatio:t.farToNearRatio,c=t.mode===re.SCENE2D,u=t.nearToFarDistance2D;i*=1+D.EPSILON2,n=Math.min(Math.max(n,o.frustum.near),o.frustum.far),i=Math.max(Math.min(i,o.frustum.far),n);let f;c?(i=Math.min(i,o.position.z+t.nearToFarDistance2D),n=Math.min(n,i),f=Math.ceil(Math.max(1,i-n)/t.nearToFarDistance2D)):f=Math.ceil(Math.log(i/n)/Math.log(a));let{frustumCommandsList:d}=e;d.length=f;for(let p=0;p<f;++p){let g,m;c?(g=Math.min(i-u,n+p*u),m=Math.min(i,g+u)):(g=Math.max(n,Math.pow(a,p)*n),m=Math.min(i,a*g)),l(d[p])?(d[p].near=g,d[p].far=m):d[p]=new IU(g,m)}}function Kwt(e,t,n){let{command:i,near:r,far:o}=n;t.debugShowFrustums&&(i.debugOverlappingFrustums=0);let{frustumCommandsList:s}=e;for(let a=0;a<s.length;++a){let c=s[a];if(r>c.far)continue;if(o<c.near)break;let u=i.pass,f=c.indices[u]++;if(c.commands[u][f]=i,t.debugShowFrustums&&(i.debugOverlappingFrustums|=1<<a),i.executeInClosestFrustum)break}if(t.debugShowFrustums){let{debugFrustumStatistics:a}=e,{debugOverlappingFrustums:c}=i,u=a.commandsInFrustums;u[c]=l(u[c])?u[c]+1:1,++a.totalCommands}t.updateDerivedCommands(i)}var rDe=new ta,$wt=new Us;F5.prototype.createPotentiallyVisibleSet=function(e){let{frameState:t}=e,{camera:n,commandList:i,shadowState:r}=t,{positionWC:o,directionWC:s,frustum:a}=n,c=e._computeCommandList,u=e._overlayCommandList;e.debugShowFrustums&&(this.debugFrustumStatistics={totalCommands:0,commandsInFrustums:{}});let f=this.frustumCommandsList;for(let O=0;O<f.length;++O)for(let L=0;L<Ie.NUMBER_OF_PASSES;++L)f[O].indices[L]=0;c.length=0,u.length=0;let d=this._commandExtents,p=d.length,g=0,m=+Number.MAX_VALUE,y=-Number.MAX_VALUE,{shadowsEnabled:A}=r,b=+Number.MAX_VALUE,x=-Number.MAX_VALUE,T=Number.MAX_VALUE,E=t.mode===re.SCENE3D?t.occluder:void 0,{cullingVolume:v}=t,S=rDe.planes;for(let O=0;O<5;++O)S[O]=v.planes[O];v=rDe;for(let O=0;O<i.length;++O){let L=i[O],{pass:_,boundingVolume:C}=L;if(_===Ie.COMPUTE)c.push(L);else if(_===Ie.OVERLAY)u.push(L);else{let w,P;if(l(C)){if(!e.isVisible(v,L,E))continue;let F=C.computePlaneDistances(o,s,$wt);if(w=F.start,P=F.stop,m=Math.min(m,w),y=Math.max(y,P),A&&L.receiveShadows&&w<V_.MAXIMUM_DISTANCE&&!(_===Ie.GLOBE&&w<-100&&P>100)){let V=P-w;_!==Ie.GLOBE&&w<100&&(T=Math.min(T,V)),b=Math.min(b,w),x=Math.max(x,P)}}else L instanceof li?(w=a.near,P=a.far):(w=a.near,P=a.far,m=Math.min(m,w),y=Math.max(y,P));let M=d[g];l(M)||(M=d[g]=new qwt),M.command=L,M.near=w,M.far=P,g++}}A&&(b=Math.min(Math.max(b,a.near),a.far),x=Math.max(Math.min(x,a.far),b),r.nearPlane=b,r.farPlane=x,r.closestObjectSize=T),Xwt(this,e,m,y);for(let O=0;O<g;O++)Kwt(this,e,d[O]);if(g<p)for(let O=g;O<p;O++){let L=d[O];if(!l(L.command))break;L.command=void 0}for(let O=0;O<f.length;++O){let{commands:L,indices:_}=f[O];for(let C=0;C<L.length;++C){let w=L[C];for(let P=_[C];P<w.length&&l(w[P]);++P)w[P]=void 0}}let I=f.length,{frustumSplits:R}=t;R.length=I+1;for(let O=0;O<I;++O)R[O]=f[O].near,O===I-1&&(R[O+1]=f[O].far)};F5.prototype.destroy=function(){this.pickFramebuffer=this.pickFramebuffer&&this.pickFramebuffer.destroy(),this.snapFramebuffer=this.snapFramebuffer&&this.snapFramebuffer.destroy(),this.pickDepthFramebuffer=this.pickDepthFramebuffer&&this.pickDepthFramebuffer.destroy(),this.sceneFramebuffer=this.sceneFramebuffer&&this.sceneFramebuffer.destroy(),this.edgeFramebuffer=this.edgeFramebuffer&&this.edgeFramebuffer.destroy(),this.planarFillIdFramebuffer=this.planarFillIdFramebuffer&&this.planarFillIdFramebuffer.destroy(),this.globeDepth=this.globeDepth&&this.globeDepth.destroy(),this.oit=this.oit&&this.oit.destroy(),this.translucentTileClassification=this.translucentTileClassification&&this.translucentTileClassification.destroy(),this.globeTranslucencyFramebuffer=this.globeTranslucencyFramebuffer&&this.globeTranslucencyFramebuffer.destroy();let e=this.pickDepths;for(let t=0;t<e.length;++t)e[t].destroy()};var FE=F5;var sDe=.1,Jwt=new Ah({pass:ao.MOST_DETAILED_PRELOAD}),Zwt=new Ah({pass:ao.MOST_DETAILED_PICK}),FU=new Ah({pass:ao.PICK});function Ra(e){this._mostDetailedRayPicks=[],this.pickRenderStateCache={},this._pickPositionCache={},this._pickPositionCacheDirty=!1;let t=new et(0,0,1,1),n=new Or(e);n.frustum=new gn({width:sDe,aspectRatio:1,near:.1}),this._pickOffscreenView=new FE(e,n,t)}Ra.prototype.update=function(){this._pickPositionCacheDirty=!0};Ra.prototype.getPickDepth=function(e,t){let n=e.view.pickDepths,i=n[t];return l(i)||(i=new vU,n[t]=i),i};var Qwt=new ys,eIt=new h,B5=new h,tIt=new U,nIt=new N;function iIt(e,t,n,i,r){let o=e.camera,s=o.frustum,a=s.offCenterFrustum;l(a)&&(s=a);let c=2*(t.x-r.x)/r.width-1;c*=(s.right-s.left)*.5;let u=2*(r.height-t.y-r.y)/r.height-1;u*=(s.top-s.bottom)*.5;let f=N.clone(o.transform,nIt);o._setTransform(N.IDENTITY);let d=h.clone(o.position,eIt);h.multiplyByScalar(o.right,c,B5),h.add(B5,d,d),h.multiplyByScalar(o.up,u,B5),h.add(B5,d,d),o._setTransform(f),e.mode===re.SCENE2D&&h.fromElements(d.z,d.x,d.y,d);let p=s.getPixelDimensions(r.width,r.height,1,1,tIt),g=Qwt;return g.right=p.x*.5,g.left=-g.right,g.top=p.y*.5,g.bottom=-g.top,g.near=s.near,g.far=s.far,g.computeCullingVolume(d,o.directionWC,o.upWC)}var rIt=new mu,oIt=new U;function sIt(e,t,n,i,r){let o=e.camera,s=o.frustum,a=s.near,c=Math.tan(s.fovy*.5),u=s.aspectRatio*c,f=2*(t.x-r.x)/r.width-1,d=2*(r.height-t.y-r.y)/r.height-1,p=f*a*u,g=d*a*c,m=s.getPixelDimensions(r.width,r.height,1,1,oIt),y=m.x*n*.5,A=m.y*i*.5,b=rIt;return b.top=g+A,b.bottom=g-A,b.right=p+y,b.left=p-y,b.near=a,b.far=s.far,b.computeCullingVolume(o.positionWC,o.directionWC,o.upWC)}function k5(e,t,n,i,r){let o=e.camera.frustum;return o instanceof gn||o instanceof ys?iIt(e,t,n,i,r):sIt(e,t,n,i,r)}var BU=new et(0,0,3,3),U5=new U,kU=new z(0,0,0,0);function Ane(e,t,n,i,r){return r.width=n??3,r.height=i??r.width,r.x=t.x-(r.width-1)*.5,r.y=e-t.y-(r.height-1)*.5,r}function UU(e,t,n,i,r,o){let{context:s,frameState:a,defaultView:c}=e,{viewport:u,pickFramebuffer:f}=c,d=o?.framebuffer??f;e.view=c,u.x=0,u.y=0,u.width=s.drawingBufferWidth,u.height=s.drawingBufferHeight;let p=c.passState;p.viewport=et.clone(u,p.viewport);let g=dr.transformWindowToDrawingBuffer(e,t,U5);Ane(s.drawingBufferHeight,g,i,r,n),e.jobScheduler.disableThisFrame(),e.updateFrameState(),a.cullingVolume=k5(e,g,n.width,n.height,u),a.invertClassification=!1,a.passes.pick=!0,a.passes.snap=o?.snap??!1,a.tilesetPassState=FU,s.uniformState.update(a),e.updateEnvironment(),p=d.begin(n,u),e.updateAndExecuteCommands(p,kU),e.resolveFramebuffers(p)}function zU(e){let{context:t}=e;t.endFrame()}Ra.prototype.pickAsync=async function(e,t,n,i,r=1){let{context:o,frameState:s,defaultView:a}=e,{pickFramebuffer:c}=a,u=BU;UU(e,t,u,n,i);let f;return o.webgl2?f=c.endAsync(u,s,r):(f=c.end(u,r),f=Promise.resolve(f),_t("picking-async-fallback","Fallback to synchronous picking because async operation requires WebGL2 context.")),zU(e),f};Ra.prototype.pick=function(e,t,n,i,r=1){let{defaultView:o}=e,{pickFramebuffer:s}=o,a=BU;UU(e,t,a,n,i);let c=s.end(a,r);return zU(e),c};Ra.prototype.pickVoxelCoordinate=function(e,t,n,i){let{context:r,frameState:o,defaultView:s}=e,{viewport:a,pickFramebuffer:c}=s;e.view=s,a.x=0,a.y=0,a.width=r.drawingBufferWidth,a.height=r.drawingBufferHeight;let u=s.passState;u.viewport=et.clone(a,u.viewport);let f=dr.transformWindowToDrawingBuffer(e,t,U5),d=Ane(r.drawingBufferHeight,f,n,i,BU);e.jobScheduler.disableThisFrame(),e.updateFrameState(),o.cullingVolume=k5(e,f,d.width,d.height,a),o.invertClassification=!1,o.passes.pickVoxel=!0,o.tilesetPassState=FU,r.uniformState.update(o),e.updateEnvironment(),u=c.begin(d,a),e.updateAndExecuteCommands(u,kU),e.resolveFramebuffers(u);let p=c.readCenterPixel(d);return r.endFrame(),p};Ra.prototype.pickMetadata=function(e,t,n){let{context:i,frameState:r,defaultView:o}=e,{viewport:s,pickFramebuffer:a}=o;e.view=o,s.x=0,s.y=0,s.width=i.drawingBufferWidth,s.height=i.drawingBufferHeight;let c=o.passState;c.viewport=et.clone(s,c.viewport);let u=dr.transformWindowToDrawingBuffer(e,t,U5),f=Ane(i.drawingBufferHeight,u,1,1,BU);e.jobScheduler.disableThisFrame(),e.updateFrameState(),r.cullingVolume=k5(e,u,f.width,f.height,s),r.invertClassification=!1,r.passes.pick=!0,r.tilesetPassState=FU,r.pickingMetadata=!0,r.pickedMetadataInfo=n,i.uniformState.update(r),e.updateEnvironment(),c=a.begin(f,s),e.updateAndExecuteCommands(c,kU);let d=e._environmentState.useOIT;e._environmentState.useOIT=!1,e.resolveFramebuffers(c),e._environmentState.useOIT=d;let p=a.readCenterPixel(f);return i.endFrame(),r.pickingMetadata=!1,CU.decodeMetadataValues(n.classProperty,n.metadataProperty,p)};function aIt(e,t){let{defaultView:n,context:i,frameState:r,environmentState:o}=e,{viewport:s,pickDepthFramebuffer:a}=n;e.view=n,s.x=0,s.y=0,s.width=i.drawingBufferWidth,s.height=i.drawingBufferHeight;let c=n.passState;c.viewport=et.clone(s,c.viewport),e.clearPasses(r.passes),r.passes.pick=!0,r.passes.depth=!0,r.cullingVolume=k5(e,t,1,1,s),r.tilesetPassState=FU,e.updateEnvironment(),o.renderTranslucentDepthForPick=!0,c=a.update(i,t,s),e.updateAndExecuteCommands(c,kU),e.resolveFramebuffers(c),i.endFrame()}var cIt=new $i,lIt=new mu,uIt=new gn,fIt=new ys;Ra.prototype.pickPositionWorldCoordinates=function(e,t,n){if(!e.useDepthPicking)return;let i=t.toString();if(this._pickPositionCacheDirty)this._pickPositionCache={},this._pickPositionCacheDirty=!1;else if(this._pickPositionCache.hasOwnProperty(i))return h.clone(this._pickPositionCache[i],n);let{context:r,frameState:o,camera:s,defaultView:a}=e,{uniformState:c}=r;e.view=a;let u=dr.transformWindowToDrawingBuffer(e,t,U5);e.pickTranslucentDepth?aIt(e,u):(e.updateFrameState(),c.update(o),e.updateEnvironment()),u.y=e.drawingBufferHeight-u.y;let f;l(s.frustum.fov)?f=s.frustum.clone(cIt):l(s.frustum.infiniteProjectionMatrix)?f=s.frustum.clone(lIt):l(s.frustum.width)?f=s.frustum.clone(uIt):f=s.frustum.clone(fIt);let{frustumCommandsList:d}=a,p=d.length;for(let g=0;g<p;++g){let y=this.getPickDepth(e,g).getDepth(r,u.x,u.y);if(l(y)&&y>0&&y<1){let A=d[g],b;return e.mode===re.SCENE2D?(b=s.position.z,s.position.z=b-A.near+1,f.far=Math.max(1,A.far-A.near),f.near=1,c.update(o),c.updateFrustum(f)):(f.near=A.near*(g!==0?e.opaqueFrustumNearOffset:1),f.far=A.far,c.updateFrustum(f)),n=dr.drawingBufferToWorldCoordinates(e,u,y,n),e.mode===re.SCENE2D&&(s.position.z=b,c.update(o)),this._pickPositionCache[i]=h.clone(n),n}}this._pickPositionCache[i]=void 0};var dIt=new he;Ra.prototype.pickPosition=function(e,t,n){if(n=this.pickPositionWorldCoordinates(e,t,n),l(n)&&e.mode!==re.SCENE3D){h.fromElements(n.y,n.z,n.x,n);let i=e.mapProjection,r=i.ellipsoid,o=i.unproject(n,dIt);r.cartographicToCartesian(o,n)}return n};function hIt(e,t,n,i,r,o){for(let s of e){let a=s.object,c=s.position,u=s.exclude;if(l(c)&&!l(a))return n.push(s),!0;if(!l(a)||!l(a.primitive)||!u&&(n.push(s),n.length>=t))return!0;let f=a.primitive,d=!1;if(typeof f.getGeometryInstanceAttributes=="function"&&l(a.id)){let p=f.getGeometryInstanceAttributes(a.id);l(p)&&l(p.show)&&(d=!0,p.show=Dn.toValue(!1,p.show),r.push(p))}a instanceof oa&&(d=!0,a.show=!1,o.push(a)),d||(f.show=!1,i.push(f))}}function aDe(e,t){let n=[],i=[],r=[],o=[];l(t)||(t=Number.MAX_VALUE);let s=e(t);for(;l(s)&&s.length>0&&!hIt(s,t,n,i,r,o);)s=e(t-n.length);for(let a=0;a<i.length;++a)i[a].show=!0;for(let a=0;a<r.length;++a){let c=r[a];c.show=Dn.toValue(!0,c.show)}for(let a=0;a<o.length;++a)o[a].show=!0;return n}Ra.prototype.drillPick=function(e,t,n,i,r){return aDe(a=>this.pick(e,t,i,r,a).map(u=>({object:u,position:void 0,exclude:!1})),n).map(a=>a.object)};var oDe=new h,mIt=new h;function pIt(e,t,n){this.ray=e,this.width=t,this.tilesets=n,this.ready=!1;let i=this;this.promise=new Promise(r=>{i._completePick=()=>{r()}})}function cDe(e,t,n,i){let r=t.direction,o=h.mostOrthogonalAxis(r,oDe),s=h.cross(r,o,oDe),a=h.cross(r,s,mIt);return i.position=t.origin,i.direction=r,i.up=a,i.right=s,i.frustum.width=n??sDe,i.frustum.computeCullingVolume(i.positionWC,i.directionWC,i.upWC)}function gIt(e,t,n){let i=t.frameState,{ray:r,width:o,tilesets:s}=n,a=e._pickOffscreenView.camera,c=cDe(e,r,o,a),u=Jwt;u.camera=a,u.cullingVolume=c;let f=!0,d=s.length;for(let p=0;p<d;++p){let g=s[p];g.show&&t.primitives.contains(g)&&(g.updateForPass(i,u),f=f&&u.ready)}return f&&n._completePick(),f}Ra.prototype.updateMostDetailedRayPicks=function(e){let t=this._mostDetailedRayPicks;for(let n=0;n<t.length;++n)gIt(this,e,t[n])&&t.splice(n--,1)};function lDe(e,t,n){for(let i=0;i<e.length;++i){let r=e.get(i);r.show&&(l(r.isCesium3DTileset)?(!l(t)||t.indexOf(r)===-1)&&n.push(r):r instanceof Qc&&lDe(r,t,n))}}function z5(e,t,n,i,r,o){let s=[];if(lDe(t.primitives,i,s),s.length===0)return Promise.resolve(o());let a=new pIt(n,r,s);return e._mostDetailedRayPicks.push(a),a.promise.then(function(){return o()})}function _It(e,t){return!l(e)||!l(t)||t.length===0?!1:t.indexOf(e)>-1||t.indexOf(e.primitive)>-1||t.indexOf(e.id)>-1}function yIt(e,t,n,i,r,o,s){let{context:a,frameState:c}=t,u=a.uniformState,f=e._pickOffscreenView;t.view=f,cDe(e,n,r,f.camera);let d=et.clone(f.viewport,BU),p=f.pickFramebuffer.begin(d,f.viewport);t.jobScheduler.disableThisFrame(),t.updateFrameState(),c.invertClassification=!1,c.passes.pick=!0,c.passes.offscreen=!0,s?c.tilesetPassState=Zwt:c.tilesetPassState=FU,u.update(c),t.updateEnvironment(),t.updateAndExecuteCommands(p,kU),t.resolveFramebuffers(p);let g,m=f.pickFramebuffer.end(d,1)[0];if(t.context.depthTexture){let{frustumCommandsList:y}=f,A=y.length;for(let b=0;b<A;++b){let T=e.getPickDepth(t,b).getDepth(a,0,0);if(l(T)&&T>0&&T<1){let E=y[b],v=E.near*(b!==0?t.opaqueFrustumNearOffset:1),S=E.far,I=v+T*(S-v);g=pn.getPoint(n,I);break}}}if(t.view=t.defaultView,a.endFrame(),l(m)||l(g))return{object:m,position:g,exclude:!l(g)&&o||_It(m,i)}}function bne(e,t,n,i,r,o,s,a){return aDe(function(){let u=yIt(e,t,n,r,o,s,a);return u?[u]:void 0},i)}function gI(e,t,n,i,r,o,s){let a=bne(e,t,n,1,i,r,o,s);if(a.length>0)return a[0]}function V5(e,t){return new Promise((n,i)=>{t.then(function(r){let o=e.postRender.addEventListener(function(){o(),n(r)});e.requestRender()}).catch(function(r){i(r)})})}Ra.prototype.pickFromRay=function(e,t,n,i){return gI(this,e,t,n,i,!1,!1)};Ra.prototype.drillPickFromRay=function(e,t,n,i,r){return bne(this,e,t,n,i,r,!1,!1)};Ra.prototype.pickFromRayMostDetailed=function(e,t,n,i){let r=this;return t=pn.clone(t),n=l(n)?n.slice():n,V5(e,z5(r,e,t,n,i,function(){return gI(r,e,t,n,i,!1,!0)}))};Ra.prototype.drillPickFromRayMostDetailed=function(e,t,n,i,r){let o=this;return t=pn.clone(t),i=l(i)?i.slice():i,V5(e,z5(o,e,t,i,r,function(){return bne(o,e,t,n,i,r,!1,!0)}))};var AIt=new h,bIt=new h,xIt=new pn,uDe=new he;function xne(e,t){let n=e.ellipsoid,i=Mi._defaultMaxTerrainHeight,r=n.geodeticSurfaceNormalCartographic(t,bIt),o=he.toCartesian(t,n,AIt),s=xIt;s.origin=o,s.direction=r;let a=new pn;return pn.getPoint(s,i,a.origin),h.negate(r,a.direction),a}function fDe(e,t){let n=e.ellipsoid,i=he.fromCartesian(t,n,uDe);return xne(e,i)}function dDe(e,t){let n=e.ellipsoid;return he.fromCartesian(t,n,uDe).height}function TIt(e,t,n,i,r){let o=xne(t,n);return z5(e,t,o,i,r,function(){let s=gI(e,t,o,i,r,!0,!0);if(l(s))return dDe(t,s.position)})}function EIt(e,t,n,i,r,o){let s=fDe(t,n);return z5(e,t,s,i,r,function(){let a=gI(e,t,s,i,r,!0,!0);if(l(a))return h.clone(a.position,o)})}Ra.prototype.sampleHeight=function(e,t,n,i){let r=xne(e,t),o=gI(this,e,r,n,i,!0,!1);if(l(o))return dDe(e,o.position)};Ra.prototype.clampToHeight=function(e,t,n,i,r){let o=fDe(e,t),s=gI(this,e,o,n,i,!0,!1);if(l(s))return h.clone(s.position,r)};Ra.prototype.sampleHeightMostDetailed=function(e,t,n,i){n=l(n)?n.slice():n;let r=t.length,o=new Array(r);for(let s=0;s<r;++s)o[s]=TIt(this,e,t[s],n,i);return V5(e,Promise.all(o).then(function(s){let a=s.length;for(let c=0;c<a;++c)t[c].height=s[c];return t}))};Ra.prototype.clampToHeightMostDetailed=function(e,t,n,i){n=l(n)?n.slice():n;let r=t.length,o=new Array(r);for(let s=0;s<r;++s)o[s]=EIt(this,e,t[s],n,i,t[s]);return V5(e,Promise.all(o).then(function(s){let a=s.length;for(let c=0;c<a;++c)t[c]=s[c];return t}))};Ra.prototype.destroy=function(){this._pickOffscreenView=this._pickOffscreenView&&this._pickOffscreenView.destroy()};var VU=Ra;var jU=`uniform sampler2D colorTexture; in vec2 v_textureCoordinates; #ifdef AUTO_EXPOSURE uniform sampler2D autoExposure; @@ -10592,7 +10592,7 @@ color = czm_acesTonemapping(color); color = czm_inverseGamma(color); out_FragColor = vec4(color, fragmentColor.a); } -`;var eV=`precision highp float; +`;var HU=`precision highp float; uniform sampler2D randomTexture; uniform sampler2D depthTexture; uniform float intensity; @@ -10700,7 +10700,7 @@ ao = 1.0 - clamp(ao, 0.0, 1.0); ao = pow(ao, intensity); out_FragColor = vec4(vec3(ao), 1.0); } -`;var tV=`uniform sampler2D colorTexture; +`;var GU=`uniform sampler2D colorTexture; uniform sampler2D ambientOcclusionTexture; uniform bool ambientOcclusionOnly; in vec2 v_textureCoordinates; @@ -10710,7 +10710,7 @@ vec4 color = texture(colorTexture, v_textureCoordinates); vec4 ao = texture(ambientOcclusionTexture, v_textureCoordinates); out_FragColor = ambientOcclusionOnly ? ao : ao * color; } -`;var nV=`uniform sampler2D colorTexture; +`;var WU=`uniform sampler2D colorTexture; uniform float gradations; in vec2 v_textureCoordinates; void main(void) @@ -10727,7 +10727,7 @@ float darkness = luminance * gradations; darkness = (darkness - fract(darkness)) / gradations; out_FragColor = vec4(vec3(darkness), 1.0); } -`;var iV=`uniform sampler2D colorTexture; +`;var qU=`uniform sampler2D colorTexture; uniform sampler2D bloomTexture; uniform bool glowOnly; in vec2 v_textureCoordinates; @@ -10743,7 +10743,7 @@ return; vec4 bloom = texture(bloomTexture, v_textureCoordinates); out_FragColor = glowOnly ? bloom : bloom + color; } -`;var rV=`uniform sampler2D colorTexture; +`;var YU=`uniform sampler2D colorTexture; uniform float brightness; in vec2 v_textureCoordinates; void main(void) @@ -10752,7 +10752,7 @@ vec3 rgb = texture(colorTexture, v_textureCoordinates).rgb; vec3 target = vec3(0.0); out_FragColor = vec4(mix(target, rgb, brightness), 1.0); } -`;var oV=`uniform sampler2D colorTexture; +`;var XU=`uniform sampler2D colorTexture; uniform float contrast; uniform float brightness; in vec2 v_textureCoordinates; @@ -10766,7 +10766,7 @@ float factor = (259.0 * (contrast + 255.0)) / (255.0 * (259.0 - contrast)); sceneColor = factor * (sceneColor - vec3(0.5)) + vec3(0.5); out_FragColor = vec4(sceneColor, 1.0); } -`;var sV=`uniform sampler2D colorTexture; +`;var KU=`uniform sampler2D colorTexture; uniform sampler2D blurTexture; uniform sampler2D depthTexture; uniform float focalDistance; @@ -10801,14 +10801,14 @@ vec4 posInCamera = toEye(v_textureCoordinates, depth); float d = computeDepthBlur(-posInCamera.z); out_FragColor = mix(texture(colorTexture, v_textureCoordinates), texture(blurTexture, v_textureCoordinates), d); } -`;var aV=`uniform sampler2D depthTexture; +`;var $U=`uniform sampler2D depthTexture; in vec2 v_textureCoordinates; void main(void) { float depth = czm_readDepth(depthTexture, v_textureCoordinates); out_FragColor = vec4(vec3(depth), 1.0); } -`;var cV=`uniform sampler2D depthTexture; +`;var JU=`uniform sampler2D depthTexture; uniform float length; uniform vec4 color; in vec2 v_textureCoordinates; @@ -10858,7 +10858,7 @@ vertEdge += texture(depthTexture, v_textureCoordinates + vec2(dir * padx, pady)) float len = sqrt(horizEdge * horizEdge + vertEdge * vertEdge); out_FragColor = vec4(color.rgb, len > length ? color.a : 0.0); } -`;var lV=`uniform sampler2D colorTexture; +`;var ZU=`uniform sampler2D colorTexture; in vec2 v_textureCoordinates; #ifdef AUTO_EXPOSURE uniform sampler2D autoExposure; @@ -10887,7 +10887,7 @@ float w = ((white * (A * white + C * B) + D * E) / (white * ( A * white + B) + D c = czm_inverseGamma(c / w); out_FragColor = vec4(c, fragmentColor.a); } -`;var uV=`uniform sampler2D colorTexture; +`;var QU=`uniform sampler2D colorTexture; in vec2 v_textureCoordinates; #ifdef AUTO_EXPOSURE uniform sampler2D autoExposure; @@ -10907,7 +10907,7 @@ color = czm_pbrNeutralTonemapping(color); color = czm_inverseGamma(color); out_FragColor = vec4(color, fragmentColor.a); } -`;var fV=`in vec2 v_textureCoordinates; +`;var ez=`in vec2 v_textureCoordinates; uniform sampler2D colorTexture; const float fxaaQualitySubpix = 0.5; const float fxaaQualityEdgeThreshold = 0.125; @@ -10925,7 +10925,7 @@ fxaaQualityEdgeThresholdMin); float alpha = texture(colorTexture, v_textureCoordinates).a; out_FragColor = vec4(color.rgb, alpha); } -`;var Mb=`#define SAMPLES 8 +`;var db=`#define SAMPLES 8 uniform float delta; uniform float sigma; uniform float direction; @@ -10959,7 +10959,7 @@ result += texture(colorTexture, st + offset) * g.x; } out_FragColor = result; } -`;var dV=`uniform sampler2D colorTexture; +`;var tz=`uniform sampler2D colorTexture; uniform sampler2D dirtTexture; uniform sampler2D starTexture; uniform vec2 dirtTextureDimensions; @@ -11074,7 +11074,7 @@ result *= texture(starTexture, lensStarTexcoord) * pow(weightForLensFlare, 1.0) result += texture(colorTexture, v_textureCoordinates); out_FragColor = result; } -`;var hV=`uniform sampler2D colorTexture; +`;var nz=`uniform sampler2D colorTexture; uniform vec3 white; in vec2 v_textureCoordinates; #ifdef AUTO_EXPOSURE @@ -11096,7 +11096,7 @@ color = (color * (1.0 + color / white)) / (1.0 + color); color = czm_inverseGamma(color); out_FragColor = vec4(color, fragmentColor.a); } -`;var mV=`uniform sampler2D colorTexture; +`;var iz=`uniform sampler2D colorTexture; in vec2 v_textureCoordinates; float rand(vec2 co) { @@ -11109,7 +11109,7 @@ vec3 rgb = texture(colorTexture, v_textureCoordinates).rgb; vec3 green = vec3(0.0, 1.0, 0.0); out_FragColor = vec4((noiseValue + rgb) * green, 1.0); } -`;var pV=`uniform sampler2D colorTexture; +`;var rz=`uniform sampler2D colorTexture; in vec2 v_textureCoordinates; #ifdef AUTO_EXPOSURE uniform sampler2D autoExposure; @@ -11130,7 +11130,7 @@ color = color / (1.0 + color); color = czm_inverseGamma(color); out_FragColor = vec4(color, fragmentColor.a); } -`;var gV=`uniform sampler2D colorTexture; +`;var oz=`uniform sampler2D colorTexture; uniform sampler2D silhouetteTexture; in vec2 v_textureCoordinates; void main(void) @@ -11139,7 +11139,7 @@ vec4 silhouetteColor = texture(silhouetteTexture, v_textureCoordinates); vec4 color = texture(colorTexture, v_textureCoordinates); out_FragColor = mix(color, silhouetteColor, silhouetteColor.a); } -`;function mC(){this._uniformMap=void 0,this._command=void 0,this._colorTexture=void 0,this._depthTexture=void 0,this._ready=!1,this._name="czm_autoexposure",this._logDepthChanged=void 0,this._useLogDepth=void 0,this._framebuffers=void 0,this._previousLuminance=new ai,this._commands=void 0,this._clearCommand=void 0,this._minMaxLuminance=new U,this.enabled=!0,this._enabled=!0,this.minimumLuminance=.1,this.maximumLuminance=10}Object.defineProperties(mC.prototype,{ready:{get:function(){return this._ready}},name:{get:function(){return this._name}},outputTexture:{get:function(){let e=this._framebuffers;if(l(e))return e[e.length-1].getColorTexture(0)}}});function xLe(e){let t=e._framebuffers;if(!l(t))return;let n=t.length;for(let i=0;i<n;++i)t[i].destroy();e._framebuffers=void 0,e._previousLuminance.destroy(),e._previousLuminance=void 0}function vFt(e,t){xLe(e);let n=e._width,i=e._height,r=t.halfFloatingPointTexture?ze.HALF_FLOAT:ze.FLOAT,o=Math.ceil(Math.log(Math.max(n,i))/Math.log(3)),s=new Array(o);for(let c=0;c<o;++c)n=Math.max(Math.ceil(n/3),1),i=Math.max(Math.ceil(i/3),1),s[c]=new ai,s[c].update(t,n,i,1,r);let a=s[o-1].getColorTexture(0);e._previousLuminance.update(t,a.width,a.height,1,r),e._framebuffers=s}function TLe(e){let t=e._commands;if(!l(t))return;let n=t.length;for(let i=0;i<n;++i)t[i].shaderProgram.destroy();e._commands=void 0}function SFt(e,t){let n;if(t===0)n={colorTexture:function(){return e._colorTexture},colorTextureDimensions:function(){return e._colorTexture.dimensions}};else{let i=e._framebuffers[t-1].getColorTexture(0);n={colorTexture:function(){return i},colorTextureDimensions:function(){return i.dimensions}}}return n.minMaxLuminance=function(){return e._minMaxLuminance},n.previousLuminance=function(){return e._previousLuminance.getColorTexture(0)},n}function wFt(e,t){let n=`uniform sampler2D colorTexture; +`;function BE(){this._uniformMap=void 0,this._command=void 0,this._colorTexture=void 0,this._depthTexture=void 0,this._ready=!1,this._name="czm_autoexposure",this._logDepthChanged=void 0,this._useLogDepth=void 0,this._framebuffers=void 0,this._previousLuminance=new ai,this._commands=void 0,this._clearCommand=void 0,this._minMaxLuminance=new U,this.enabled=!0,this._enabled=!0,this.minimumLuminance=.1,this.maximumLuminance=10}Object.defineProperties(BE.prototype,{ready:{get:function(){return this._ready}},name:{get:function(){return this._name}},outputTexture:{get:function(){let e=this._framebuffers;if(l(e))return e[e.length-1].getColorTexture(0)}}});function hDe(e){let t=e._framebuffers;if(!l(t))return;let n=t.length;for(let i=0;i<n;++i)t[i].destroy();e._framebuffers=void 0,e._previousLuminance.destroy(),e._previousLuminance=void 0}function CIt(e,t){hDe(e);let n=e._width,i=e._height,r=t.halfFloatingPointTexture?ze.HALF_FLOAT:ze.FLOAT,o=Math.ceil(Math.log(Math.max(n,i))/Math.log(3)),s=new Array(o);for(let c=0;c<o;++c)n=Math.max(Math.ceil(n/3),1),i=Math.max(Math.ceil(i/3),1),s[c]=new ai,s[c].update(t,n,i,1,r);let a=s[o-1].getColorTexture(0);e._previousLuminance.update(t,a.width,a.height,1,r),e._framebuffers=s}function mDe(e){let t=e._commands;if(!l(t))return;let n=t.length;for(let i=0;i<n;++i)t[i].shaderProgram.destroy();e._commands=void 0}function vIt(e,t){let n;if(t===0)n={colorTexture:function(){return e._colorTexture},colorTextureDimensions:function(){return e._colorTexture.dimensions}};else{let i=e._framebuffers[t-1].getColorTexture(0);n={colorTexture:function(){return i},colorTextureDimensions:function(){return i.dimensions}}}return n.minMaxLuminance=function(){return e._minMaxLuminance},n.previousLuminance=function(){return e._previousLuminance.getColorTexture(0)},n}function SIt(e,t){let n=`uniform sampler2D colorTexture; in vec2 v_textureCoordinates; float sampleTexture(vec2 offset) { `;return e===0?n+=` vec4 color = texture(colorTexture, v_textureCoordinates + offset); @@ -11176,7 +11176,7 @@ void main() { color = clamp(color, minMaxLuminance.x, minMaxLuminance.y); `),n+=` out_FragColor = vec4(color); } -`,n}function IFt(e,t){TLe(e);let n=e._framebuffers,i=n.length,r=new Array(i);for(let o=0;o<i;++o)r[o]=t.createViewportQuadCommand(wFt(o,i),{framebuffer:n[o].framebuffer,uniformMap:SFt(e,o)});e._commands=r}mC.prototype.clear=function(e){let t=this._framebuffers;if(!l(t))return;let n=this._clearCommand;l(n)||(n=this._clearCommand=new li({color:new z(0,0,0,0),framebuffer:void 0}));let i=t.length;for(let r=0;r<i;++r)t[r].clear(e,n)};mC.prototype.update=function(e){let t=e.drawingBufferWidth,n=e.drawingBufferHeight;(t!==this._width||n!==this._height)&&(this._width=t,this._height=n,vFt(this,e),IFt(this,e),this._ready||(this._ready=!0)),this._minMaxLuminance.x=this.minimumLuminance,this._minMaxLuminance.y=this.maximumLuminance;let i=this._framebuffers,r=i[i.length-1];i[i.length-1]=this._previousLuminance,this._commands[this._commands.length-1].framebuffer=this._previousLuminance.framebuffer,this._previousLuminance=r};mC.prototype.execute=function(e,t){this._colorTexture=t;let n=this._commands;if(!l(n))return;let i=n.length;for(let r=0;r<i;++r)n[r].execute(e)};mC.prototype.isDestroyed=function(){return!1};mC.prototype.destroy=function(){return xLe(this),TLe(this),le(this)};var _V=mC;var PFt={NEAREST:0,LINEAR:1},fd=PFt;function sy(e){e=e??H.EMPTY_OBJECT;let{name:t=Kn(),fragmentShader:n,uniforms:i,textureScale:r=1,forcePowerOfTwo:o=!1,sampleMode:s=fd.NEAREST,pixelFormat:a=Ke.RGBA,pixelDatatype:c=ze.UNSIGNED_BYTE,clearColor:u=z.BLACK,scissorRectangle:f}=e;this._fragmentShader=n,this._uniforms=i,this._textureScale=r,this._forcePowerOfTwo=o,this._sampleMode=s,this._pixelFormat=a,this._pixelDatatype=c,this._clearColor=u,this._uniformMap=void 0,this._command=void 0,this._colorTexture=void 0,this._depthTexture=void 0,this._idTexture=void 0,this._actualUniforms={},this._dirtyUniforms=[],this._texturesToRelease=[],this._texturesToCreate=[],this._texturePromise=void 0;let d=new sc;d.scissorTest={enabled:!0,rectangle:l(f)?et.clone(f):new et},this._passState=d,this._ready=!1,this._name=t,this._logDepthChanged=void 0,this._useLogDepth=void 0,this._selectedIdTexture=void 0,this._selected=void 0,this._selectedShadow=void 0,this._parentSelected=void 0,this._parentSelectedShadow=void 0,this._combinedSelected=void 0,this._combinedSelectedShadow=void 0,this._selectedLength=0,this._parentSelectedLength=0,this._selectedDirty=!0,this._textureCache=void 0,this._index=void 0,this.enabled=!0,this._enabled=!0}Object.defineProperties(sy.prototype,{ready:{get:function(){return this._ready}},name:{get:function(){return this._name}},fragmentShader:{get:function(){return this._fragmentShader}},uniforms:{get:function(){return this._uniforms}},textureScale:{get:function(){return this._textureScale}},forcePowerOfTwo:{get:function(){return this._forcePowerOfTwo}},sampleMode:{get:function(){return this._sampleMode}},pixelFormat:{get:function(){return this._pixelFormat}},pixelDatatype:{get:function(){return this._pixelDatatype}},clearColor:{get:function(){return this._clearColor}},scissorRectangle:{get:function(){return this._passState.scissorTest.rectangle}},outputTexture:{get:function(){if(l(this._textureCache)){let e=this._textureCache.getFramebuffer(this._name);if(l(e))return e.getColorTexture(0)}}},selected:{get:function(){return this._selected},set:function(e){this._selected=e}},parentSelected:{get:function(){return this._parentSelected},set:function(e){this._parentSelected=e}}});var DFt=/uniform\s+sampler2D\s+depthTexture/g;sy.prototype._isSupported=function(e){return!DFt.test(this._fragmentShader)||e.depthTexture};function RFt(e,t,n){let i=t[n];return(typeof i=="string"||i instanceof HTMLCanvasElement||i instanceof HTMLImageElement||i instanceof HTMLVideoElement||i instanceof ImageData)&&e._dirtyUniforms.push(n),{get:function(){return t[n]},set:function(r){let o=t[n];t[n]=r;let s=e._actualUniforms,a=s[n];l(a)&&a!==o&&a instanceof Dt&&!l(e._textureCache.getStageByName(n))&&(e._texturesToRelease.push(a),delete s[n],delete s[`${n}Dimensions`]),o instanceof Dt&&e._texturesToRelease.push(o),typeof r=="string"||r instanceof HTMLCanvasElement||r instanceof HTMLImageElement||r instanceof HTMLVideoElement||r instanceof ImageData?e._dirtyUniforms.push(n):s[n]=r}}}function OFt(e,t){return function(){let n=e._actualUniforms[t];return typeof n=="function"?n():n}}function MFt(e,t){return function(){let n=e[t]();if(l(n))return n.dimensions}}function NFt(e){if(l(e._uniformMap))return;let t={},n={},i=e._uniforms,r=e._actualUniforms;for(let o in i){if(!i.hasOwnProperty(o))continue;typeof i[o]!="function"?(t[o]=OFt(e,o),n[o]=RFt(e,i,o)):(t[o]=i[o],n[o]=i[o]),r[o]=i[o];let s=t[o]();(typeof s=="string"||s instanceof Dt||s instanceof HTMLImageElement||s instanceof HTMLCanvasElement||s instanceof HTMLVideoElement)&&(t[`${o}Dimensions`]=MFt(t,o))}e._uniforms={},Object.defineProperties(e._uniforms,n),e._uniformMap=Ot(t,{colorTexture:function(){return e._colorTexture},colorTextureDimensions:function(){return e._colorTexture.dimensions},depthTexture:function(){return e._depthTexture},depthTextureDimensions:function(){return e._depthTexture.dimensions},czm_idTexture:function(){return e._idTexture},czm_selectedIdTexture:function(){return e._selectedIdTexture},czm_selectedIdTextureStep:function(){return 1/e._selectedIdTexture.width}})}function LFt(e,t){return e=e.replace(/in\s+vec2\s+v_textureCoordinates;/g,""),`#define CZM_SELECTED_FEATURE +`,n}function wIt(e,t){mDe(e);let n=e._framebuffers,i=n.length,r=new Array(i);for(let o=0;o<i;++o)r[o]=t.createViewportQuadCommand(SIt(o,i),{framebuffer:n[o].framebuffer,uniformMap:vIt(e,o)});e._commands=r}BE.prototype.clear=function(e){let t=this._framebuffers;if(!l(t))return;let n=this._clearCommand;l(n)||(n=this._clearCommand=new li({color:new z(0,0,0,0),framebuffer:void 0}));let i=t.length;for(let r=0;r<i;++r)t[r].clear(e,n)};BE.prototype.update=function(e){let t=e.drawingBufferWidth,n=e.drawingBufferHeight;(t!==this._width||n!==this._height)&&(this._width=t,this._height=n,CIt(this,e),wIt(this,e),this._ready||(this._ready=!0)),this._minMaxLuminance.x=this.minimumLuminance,this._minMaxLuminance.y=this.maximumLuminance;let i=this._framebuffers,r=i[i.length-1];i[i.length-1]=this._previousLuminance,this._commands[this._commands.length-1].framebuffer=this._previousLuminance.framebuffer,this._previousLuminance=r};BE.prototype.execute=function(e,t){this._colorTexture=t;let n=this._commands;if(!l(n))return;let i=n.length;for(let r=0;r<i;++r)n[r].execute(e)};BE.prototype.isDestroyed=function(){return!1};BE.prototype.destroy=function(){return hDe(this),mDe(this),le(this)};var sz=BE;var IIt={NEAREST:0,LINEAR:1},id=IIt;function j_(e){e=e??H.EMPTY_OBJECT;let{name:t=Kn(),fragmentShader:n,uniforms:i,textureScale:r=1,forcePowerOfTwo:o=!1,sampleMode:s=id.NEAREST,pixelFormat:a=Ke.RGBA,pixelDatatype:c=ze.UNSIGNED_BYTE,clearColor:u=z.BLACK,scissorRectangle:f}=e;this._fragmentShader=n,this._uniforms=i,this._textureScale=r,this._forcePowerOfTwo=o,this._sampleMode=s,this._pixelFormat=a,this._pixelDatatype=c,this._clearColor=u,this._uniformMap=void 0,this._command=void 0,this._colorTexture=void 0,this._depthTexture=void 0,this._idTexture=void 0,this._actualUniforms={},this._dirtyUniforms=[],this._texturesToRelease=[],this._texturesToCreate=[],this._texturePromise=void 0;let d=new sc;d.scissorTest={enabled:!0,rectangle:l(f)?et.clone(f):new et},this._passState=d,this._ready=!1,this._name=t,this._logDepthChanged=void 0,this._useLogDepth=void 0,this._selectedIdTexture=void 0,this._selected=void 0,this._selectedShadow=void 0,this._parentSelected=void 0,this._parentSelectedShadow=void 0,this._combinedSelected=void 0,this._combinedSelectedShadow=void 0,this._selectedLength=0,this._parentSelectedLength=0,this._selectedDirty=!0,this._textureCache=void 0,this._index=void 0,this.enabled=!0,this._enabled=!0}Object.defineProperties(j_.prototype,{ready:{get:function(){return this._ready}},name:{get:function(){return this._name}},fragmentShader:{get:function(){return this._fragmentShader}},uniforms:{get:function(){return this._uniforms}},textureScale:{get:function(){return this._textureScale}},forcePowerOfTwo:{get:function(){return this._forcePowerOfTwo}},sampleMode:{get:function(){return this._sampleMode}},pixelFormat:{get:function(){return this._pixelFormat}},pixelDatatype:{get:function(){return this._pixelDatatype}},clearColor:{get:function(){return this._clearColor}},scissorRectangle:{get:function(){return this._passState.scissorTest.rectangle}},outputTexture:{get:function(){if(l(this._textureCache)){let e=this._textureCache.getFramebuffer(this._name);if(l(e))return e.getColorTexture(0)}}},selected:{get:function(){return this._selected},set:function(e){this._selected=e}},parentSelected:{get:function(){return this._parentSelected},set:function(e){this._parentSelected=e}}});var PIt=/uniform\s+sampler2D\s+depthTexture/g;j_.prototype._isSupported=function(e){return!PIt.test(this._fragmentShader)||e.depthTexture};function DIt(e,t,n){let i=t[n];return(typeof i=="string"||i instanceof HTMLCanvasElement||i instanceof HTMLImageElement||i instanceof HTMLVideoElement||i instanceof ImageData)&&e._dirtyUniforms.push(n),{get:function(){return t[n]},set:function(r){let o=t[n];t[n]=r;let s=e._actualUniforms,a=s[n];l(a)&&a!==o&&a instanceof Dt&&!l(e._textureCache.getStageByName(n))&&(e._texturesToRelease.push(a),delete s[n],delete s[`${n}Dimensions`]),o instanceof Dt&&e._texturesToRelease.push(o),typeof r=="string"||r instanceof HTMLCanvasElement||r instanceof HTMLImageElement||r instanceof HTMLVideoElement||r instanceof ImageData?e._dirtyUniforms.push(n):s[n]=r}}}function RIt(e,t){return function(){let n=e._actualUniforms[t];return typeof n=="function"?n():n}}function OIt(e,t){return function(){let n=e[t]();if(l(n))return n.dimensions}}function MIt(e){if(l(e._uniformMap))return;let t={},n={},i=e._uniforms,r=e._actualUniforms;for(let o in i){if(!i.hasOwnProperty(o))continue;typeof i[o]!="function"?(t[o]=RIt(e,o),n[o]=DIt(e,i,o)):(t[o]=i[o],n[o]=i[o]),r[o]=i[o];let s=t[o]();(typeof s=="string"||s instanceof Dt||s instanceof HTMLImageElement||s instanceof HTMLCanvasElement||s instanceof HTMLVideoElement)&&(t[`${o}Dimensions`]=OIt(t,o))}e._uniforms={},Object.defineProperties(e._uniforms,n),e._uniformMap=Ot(t,{colorTexture:function(){return e._colorTexture},colorTextureDimensions:function(){return e._colorTexture.dimensions},depthTexture:function(){return e._depthTexture},depthTextureDimensions:function(){return e._depthTexture.dimensions},czm_idTexture:function(){return e._idTexture},czm_selectedIdTexture:function(){return e._selectedIdTexture},czm_selectedIdTextureStep:function(){return 1/e._selectedIdTexture.width}})}function NIt(e,t){return e=e.replace(/in\s+vec2\s+v_textureCoordinates;/g,""),`#define CZM_SELECTED_FEATURE uniform sampler2D czm_idTexture; uniform sampler2D czm_selectedIdTexture; uniform float czm_selectedIdTextureStep; @@ -11200,8 +11200,8 @@ bool czm_selected() return czm_selected(vec2(0.0)); } -${e}`}function FFt(e,t){if(l(e._command)&&!e._logDepthChanged&&!e._selectedDirty)return;let n=e._fragmentShader;if(l(e._selectedIdTexture)){let r=e._selectedIdTexture.width;n=LFt(n,r)}let i=new Ye({defines:[e._useLogDepth?"LOG_DEPTH":""],sources:[n]});e._command=t.createViewportQuadCommand(i,{uniformMap:e._uniformMap,owner:e})}function BFt(e){let t=e._sampleMode,n,i;t===fd.LINEAR?(n=Wt.LINEAR,i=Jn.LINEAR):(n=Wt.NEAREST,i=Jn.NEAREST);let r=e._sampler;(!l(r)||r.minificationFilter!==n||r.magnificationFilter!==i)&&(e._sampler=new jt({wrapS:hn.CLAMP_TO_EDGE,wrapT:hn.CLAMP_TO_EDGE,minificationFilter:n,magnificationFilter:i}))}function kFt(e,t){return function(n){e._texturesToCreate.push({name:t,source:n})}}function UFt(e,t){return function(){return e._textureCache.getOutputTexture(t)}}function zFt(e,t){let n=e._texturesToRelease;for(let a=0;a<n.length;++a){let c=n[a];l(c)&&c.destroy()}n.length=0;let i=e._texturesToCreate;for(let a=0;a<i.length;++a){let{name:c,source:u}=i[a];e._actualUniforms[c]=new Dt({context:t,source:u})}i.length=0;let r=e._dirtyUniforms;if(r.length===0&&!l(e._texturePromise)){e._ready=!0;return}if(r.length===0||l(e._texturePromise))return;let o=e._uniforms,s=[];for(let a=0;a<r.length;++a){let c=r[a],u=o[c],f=e._textureCache.getStageByName(u);if(l(f))e._actualUniforms[c]=UFt(e,u);else if(typeof u=="string"){let d=new De({url:u});s.push(d.fetchImage().then(kFt(e,c)))}else e._texturesToCreate.push({name:c,source:u})}r.length=0,s.length>0?(e._ready=!1,e._texturePromise=Promise.all(s).then(function(){e._ready=!0,e._texturePromise=void 0})):e._ready=!0}function ELe(e){l(e._command)&&(e._command.shaderProgram=e._command.shaderProgram&&e._command.shaderProgram.destroy(),e._command=void 0),e._selectedIdTexture=e._selectedIdTexture&&e._selectedIdTexture.destroy();let t=e._textureCache;if(!l(t))return;let n=e._uniforms,i=e._actualUniforms;for(let r in i){if(!i.hasOwnProperty(r))continue;let o=i[r];o instanceof Dt&&(l(t.getStageByName(n[r]))||o.destroy(),e._dirtyUniforms.push(r))}}function VFt(e){let t=l(e._selected)?e._selected.length:0,n=l(e._parentSelected)?e._parentSelected:0,i=e._selected!==e._selectedShadow||t!==e._selectedLength||e._parentSelected!==e._parentSelectedShadow||n!==e._parentSelectedLength;if(l(e._selected)&&l(e._parentSelected)?e._combinedSelected=e._selected.concat(e._parentSelected):l(e._parentSelected)?e._combinedSelected=e._parentSelected:e._combinedSelected=e._selected,!i&&l(e._combinedSelected)){if(!l(e._combinedSelectedShadow))return!0;for(let r=0;r<e._combinedSelected.length;++r)if(e._combinedSelected[r]!==e._combinedSelectedShadow[r])return!0}return i}function jFt(e,t){if(!e._selectedDirty)return;e._selectedIdTexture=e._selectedIdTexture&&e._selectedIdTexture.destroy(),e._selectedIdTexture=void 0;let n=e._combinedSelected;if(!l(n))return;let i=0;for(let c=0;c<n.length;++c){let u=n[c];l(u.pickIds)?i+=u.pickIds.length:l(u.pickId)&&++i}let r=kt.maximumTextureSize;if(i>r&&(sy._oneTimeWarning("postProcessStageSelectedTextureSize",`The number of selected feature ids (${i}) exceeds the maximum texture size (${r}). Features beyond the limit will not have the post-process effect applied.`),i=r),n.length===0||i===0){let c=new Uint8Array([255,255,255,255]);e._selectedIdTexture=new Dt({context:t,pixelFormat:Ke.RGBA,pixelDatatype:ze.UNSIGNED_BYTE,source:{arrayBufferView:c,width:1,height:1},sampler:jt.NEAREST});return}let o=0,s=i*4,a=new Uint8Array(s);for(let c=0;c<n.length&&o<s;++c){let u=n[c];if(l(u.pickIds)){let f=u.pickIds,d=f.length;for(let p=0;p<d&&o<s;++p){let g=f[p].color;a[o]=z.floatToByte(g.red),a[o+1]=z.floatToByte(g.green),a[o+2]=z.floatToByte(g.blue),a[o+3]=z.floatToByte(g.alpha),o+=4}}else if(l(u.pickId)){let f=u.pickId.color;a[o]=z.floatToByte(f.red),a[o+1]=z.floatToByte(f.green),a[o+2]=z.floatToByte(f.blue),a[o+3]=z.floatToByte(f.alpha),o+=4}}e._selectedIdTexture=new Dt({context:t,pixelFormat:Ke.RGBA,pixelDatatype:ze.UNSIGNED_BYTE,source:{arrayBufferView:a,width:i,height:1},sampler:jt.NEAREST})}sy.prototype.update=function(e,t){if(this.enabled!==this._enabled&&!this.enabled&&ELe(this),this._enabled=this.enabled,!this._enabled||(this._logDepthChanged=t!==this._useLogDepth,this._useLogDepth=t,this._selectedDirty=VFt(this),this._selectedShadow=this._selected,this._parentSelectedShadow=this._parentSelected,this._combinedSelectedShadow=this._combinedSelected,this._selectedLength=l(this._selected)?this._selected.length:0,this._parentSelectedLength=l(this._parentSelected)?this._parentSelected.length:0,jFt(this,e),NFt(this),zFt(this,e),FFt(this,e),BFt(this),this._selectedDirty=!1,!this._ready))return;let n=this._textureCache.getFramebuffer(this._name);if(this._command.framebuffer=n,!l(n))return;let i=n.getColorTexture(0),r;(i.width!==e.drawingBufferWidth||i.height!==e.drawingBufferHeight)&&(r=this._renderState,(!l(r)||i.width!==r.viewport.width||i.height!==r.viewport.height)&&(this._renderState=Ge.fromCache({viewport:new et(0,0,i.width,i.height)}))),this._command.renderState=r};sy.prototype.execute=function(e,t,n,i){if(!l(this._command)||!l(this._command.framebuffer)||!this._ready||!this._enabled)return;this._colorTexture=t,this._depthTexture=n,this._idTexture=i,jt.equals(this._colorTexture.sampler,this._sampler)||(this._colorTexture.sampler=this._sampler);let r=this.scissorRectangle.width>0&&this.scissorRectangle.height>0?this._passState:void 0;l(r)&&(r.context=e),this._command.execute(e,r)};sy.prototype.isDestroyed=function(){return!1};sy.prototype.destroy=function(){return ELe(this),le(this)};sy._oneTimeWarning=_t;var Ur=sy;function pC(e){e=e??H.EMPTY_OBJECT,this._stages=e.stages,this._inputPreviousStageTexture=e.inputPreviousStageTexture??!0;let t=e.name;l(t)||(t=Kn()),this._name=t,this._uniforms=e.uniforms,this._textureCache=void 0,this._index=void 0,this._selected=void 0,this._selectedShadow=void 0,this._parentSelected=void 0,this._parentSelectedShadow=void 0,this._combinedSelected=void 0,this._combinedSelectedShadow=void 0,this._selectedLength=0,this._parentSelectedLength=0,this._selectedDirty=!0}Object.defineProperties(pC.prototype,{ready:{get:function(){let e=this._stages,t=e.length;for(let n=0;n<t;++n)if(!e[n].ready)return!1;return!0}},name:{get:function(){return this._name}},enabled:{get:function(){return this._stages[0].enabled},set:function(e){let t=this._stages,n=t.length;for(let i=0;i<n;++i)t[i].enabled=e}},uniforms:{get:function(){return this._uniforms}},inputPreviousStageTexture:{get:function(){return this._inputPreviousStageTexture}},length:{get:function(){return this._stages.length}},selected:{get:function(){return this._selected},set:function(e){this._selected=e}},parentSelected:{get:function(){return this._parentSelected},set:function(e){this._parentSelected=e}}});pC.prototype._isSupported=function(e){let t=this._stages,n=t.length;for(let i=0;i<n;++i)if(!t[i]._isSupported(e))return!1;return!0};pC.prototype.get=function(e){return this._stages[e]};function HFt(e){let t=l(e._selected)?e._selected.length:0,n=l(e._parentSelected)?e._parentSelected:0,i=e._selected!==e._selectedShadow||t!==e._selectedLength;if(i=i||e._parentSelected!==e._parentSelectedShadow||n!==e._parentSelectedLength,l(e._selected)&&l(e._parentSelected)?e._combinedSelected=e._selected.concat(e._parentSelected):l(e._parentSelected)?e._combinedSelected=e._parentSelected:e._combinedSelected=e._selected,!i&&l(e._combinedSelected)){if(!l(e._combinedSelectedShadow))return!0;t=e._combinedSelected.length;for(let r=0;r<t;++r)if(e._combinedSelected[r]!==e._combinedSelectedShadow[r])return!0}return i}pC.prototype.update=function(e,t){this._selectedDirty=HFt(this),this._selectedShadow=this._selected,this._parentSelectedShadow=this._parentSelected,this._combinedSelectedShadow=this._combinedSelected,this._selectedLength=l(this._selected)?this._selected.length:0,this._parentSelectedLength=l(this._parentSelected)?this._parentSelected.length:0;let n=this._stages,i=n.length;for(let r=0;r<i;++r){let o=n[r];this._selectedDirty&&(o.parentSelected=this._combinedSelected),o.update(e,t)}};pC.prototype.isDestroyed=function(){return!1};pC.prototype.destroy=function(){let e=this._stages,t=e.length;for(let n=0;n<t;++n)e[n].destroy();return le(this)};var hf=pC;var fs={};function Koe(e){let r=`#define USE_STEP_SIZE -${Mb}`,o=new Ur({name:`${e}_x_direction`,fragmentShader:r,uniforms:{delta:1,sigma:2,stepSize:1,direction:0},sampleMode:fd.LINEAR}),s=new Ur({name:`${e}_y_direction`,fragmentShader:r,uniforms:{delta:1,sigma:2,stepSize:1,direction:1},sampleMode:fd.LINEAR}),a={};return Object.defineProperties(a,{delta:{get:function(){return o.uniforms.delta},set:function(c){let u=o.uniforms,f=s.uniforms;u.delta=f.delta=c}},sigma:{get:function(){return o.uniforms.sigma},set:function(c){let u=o.uniforms,f=s.uniforms;u.sigma=f.sigma=c}},stepSize:{get:function(){return o.uniforms.stepSize},set:function(c){let u=o.uniforms,f=s.uniforms;u.stepSize=f.stepSize=c}}}),new hf({name:e,stages:[o,s],uniforms:a})}fs.createBlurStage=function(){return Koe("czm_blur")};fs.createDepthOfFieldStage=function(){let e=Koe("czm_depth_of_field_blur"),t=new Ur({name:"czm_depth_of_field_composite",fragmentShader:sV,uniforms:{focalDistance:5,blurTexture:e.name}}),n={};return Object.defineProperties(n,{focalDistance:{get:function(){return t.uniforms.focalDistance},set:function(i){t.uniforms.focalDistance=i}},delta:{get:function(){return e.uniforms.delta},set:function(i){e.uniforms.delta=i}},sigma:{get:function(){return e.uniforms.sigma},set:function(i){e.uniforms.sigma=i}},stepSize:{get:function(){return e.uniforms.stepSize},set:function(i){e.uniforms.stepSize=i}}}),new hf({name:"czm_depth_of_field",stages:[e,t],inputPreviousStageTexture:!1,uniforms:n})};fs.isDepthOfFieldSupported=function(e){return e.context.depthTexture};fs.createEdgeDetectionStage=function(){let e=Kn();return new Ur({name:`czm_edge_detection_${e}`,fragmentShader:cV,uniforms:{length:.25,color:z.clone(z.BLACK)}})};fs.isEdgeDetectionSupported=function(e){return e.context.depthTexture};function GFt(e){if(!l(e))return fs.createEdgeDetectionStage();let t=new hf({name:"czm_edge_detection_multiple",stages:e,inputPreviousStageTexture:!1}),n={},i="",r="";for(let a=0;a<e.length;++a)i+=`uniform sampler2D edgeTexture${a}; +${e}`}function LIt(e,t){if(l(e._command)&&!e._logDepthChanged&&!e._selectedDirty)return;let n=e._fragmentShader;if(l(e._selectedIdTexture)){let r=e._selectedIdTexture.width;n=NIt(n,r)}let i=new Ye({defines:[e._useLogDepth?"LOG_DEPTH":""],sources:[n]});e._command=t.createViewportQuadCommand(i,{uniformMap:e._uniformMap,owner:e})}function FIt(e){let t=e._sampleMode,n,i;t===id.LINEAR?(n=Wt.LINEAR,i=Jn.LINEAR):(n=Wt.NEAREST,i=Jn.NEAREST);let r=e._sampler;(!l(r)||r.minificationFilter!==n||r.magnificationFilter!==i)&&(e._sampler=new jt({wrapS:hn.CLAMP_TO_EDGE,wrapT:hn.CLAMP_TO_EDGE,minificationFilter:n,magnificationFilter:i}))}function BIt(e,t){return function(n){e._texturesToCreate.push({name:t,source:n})}}function kIt(e,t){return function(){return e._textureCache.getOutputTexture(t)}}function UIt(e,t){let n=e._texturesToRelease;for(let a=0;a<n.length;++a){let c=n[a];l(c)&&c.destroy()}n.length=0;let i=e._texturesToCreate;for(let a=0;a<i.length;++a){let{name:c,source:u}=i[a];e._actualUniforms[c]=new Dt({context:t,source:u})}i.length=0;let r=e._dirtyUniforms;if(r.length===0&&!l(e._texturePromise)){e._ready=!0;return}if(r.length===0||l(e._texturePromise))return;let o=e._uniforms,s=[];for(let a=0;a<r.length;++a){let c=r[a],u=o[c],f=e._textureCache.getStageByName(u);if(l(f))e._actualUniforms[c]=kIt(e,u);else if(typeof u=="string"){let d=new De({url:u});s.push(d.fetchImage().then(BIt(e,c)))}else e._texturesToCreate.push({name:c,source:u})}r.length=0,s.length>0?(e._ready=!1,e._texturePromise=Promise.all(s).then(function(){e._ready=!0,e._texturePromise=void 0})):e._ready=!0}function pDe(e){l(e._command)&&(e._command.shaderProgram=e._command.shaderProgram&&e._command.shaderProgram.destroy(),e._command=void 0),e._selectedIdTexture=e._selectedIdTexture&&e._selectedIdTexture.destroy();let t=e._textureCache;if(!l(t))return;let n=e._uniforms,i=e._actualUniforms;for(let r in i){if(!i.hasOwnProperty(r))continue;let o=i[r];o instanceof Dt&&(l(t.getStageByName(n[r]))||o.destroy(),e._dirtyUniforms.push(r))}}function zIt(e){let t=l(e._selected)?e._selected.length:0,n=l(e._parentSelected)?e._parentSelected:0,i=e._selected!==e._selectedShadow||t!==e._selectedLength||e._parentSelected!==e._parentSelectedShadow||n!==e._parentSelectedLength;if(l(e._selected)&&l(e._parentSelected)?e._combinedSelected=e._selected.concat(e._parentSelected):l(e._parentSelected)?e._combinedSelected=e._parentSelected:e._combinedSelected=e._selected,!i&&l(e._combinedSelected)){if(!l(e._combinedSelectedShadow))return!0;for(let r=0;r<e._combinedSelected.length;++r)if(e._combinedSelected[r]!==e._combinedSelectedShadow[r])return!0}return i}function VIt(e,t){if(!e._selectedDirty)return;e._selectedIdTexture=e._selectedIdTexture&&e._selectedIdTexture.destroy(),e._selectedIdTexture=void 0;let n=e._combinedSelected;if(!l(n))return;let i=0;for(let c=0;c<n.length;++c){let u=n[c];l(u.pickIds)?i+=u.pickIds.length:l(u.pickId)&&++i}let r=kt.maximumTextureSize;if(i>r&&(j_._oneTimeWarning("postProcessStageSelectedTextureSize",`The number of selected feature ids (${i}) exceeds the maximum texture size (${r}). Features beyond the limit will not have the post-process effect applied.`),i=r),n.length===0||i===0){let c=new Uint8Array([255,255,255,255]);e._selectedIdTexture=new Dt({context:t,pixelFormat:Ke.RGBA,pixelDatatype:ze.UNSIGNED_BYTE,source:{arrayBufferView:c,width:1,height:1},sampler:jt.NEAREST});return}let o=0,s=i*4,a=new Uint8Array(s);for(let c=0;c<n.length&&o<s;++c){let u=n[c];if(l(u.pickIds)){let f=u.pickIds,d=f.length;for(let p=0;p<d&&o<s;++p){let g=f[p].color;a[o]=z.floatToByte(g.red),a[o+1]=z.floatToByte(g.green),a[o+2]=z.floatToByte(g.blue),a[o+3]=z.floatToByte(g.alpha),o+=4}}else if(l(u.pickId)){let f=u.pickId.color;a[o]=z.floatToByte(f.red),a[o+1]=z.floatToByte(f.green),a[o+2]=z.floatToByte(f.blue),a[o+3]=z.floatToByte(f.alpha),o+=4}}e._selectedIdTexture=new Dt({context:t,pixelFormat:Ke.RGBA,pixelDatatype:ze.UNSIGNED_BYTE,source:{arrayBufferView:a,width:i,height:1},sampler:jt.NEAREST})}j_.prototype.update=function(e,t){if(this.enabled!==this._enabled&&!this.enabled&&pDe(this),this._enabled=this.enabled,!this._enabled||(this._logDepthChanged=t!==this._useLogDepth,this._useLogDepth=t,this._selectedDirty=zIt(this),this._selectedShadow=this._selected,this._parentSelectedShadow=this._parentSelected,this._combinedSelectedShadow=this._combinedSelected,this._selectedLength=l(this._selected)?this._selected.length:0,this._parentSelectedLength=l(this._parentSelected)?this._parentSelected.length:0,VIt(this,e),MIt(this),UIt(this,e),LIt(this,e),FIt(this),this._selectedDirty=!1,!this._ready))return;let n=this._textureCache.getFramebuffer(this._name);if(this._command.framebuffer=n,!l(n))return;let i=n.getColorTexture(0),r;(i.width!==e.drawingBufferWidth||i.height!==e.drawingBufferHeight)&&(r=this._renderState,(!l(r)||i.width!==r.viewport.width||i.height!==r.viewport.height)&&(this._renderState=Ge.fromCache({viewport:new et(0,0,i.width,i.height)}))),this._command.renderState=r};j_.prototype.execute=function(e,t,n,i){if(!l(this._command)||!l(this._command.framebuffer)||!this._ready||!this._enabled)return;this._colorTexture=t,this._depthTexture=n,this._idTexture=i,jt.equals(this._colorTexture.sampler,this._sampler)||(this._colorTexture.sampler=this._sampler);let r=this.scissorRectangle.width>0&&this.scissorRectangle.height>0?this._passState:void 0;l(r)&&(r.context=e),this._command.execute(e,r)};j_.prototype.isDestroyed=function(){return!1};j_.prototype.destroy=function(){return pDe(this),le(this)};j_._oneTimeWarning=_t;var Ur=j_;function kE(e){e=e??H.EMPTY_OBJECT,this._stages=e.stages,this._inputPreviousStageTexture=e.inputPreviousStageTexture??!0;let t=e.name;l(t)||(t=Kn()),this._name=t,this._uniforms=e.uniforms,this._textureCache=void 0,this._index=void 0,this._selected=void 0,this._selectedShadow=void 0,this._parentSelected=void 0,this._parentSelectedShadow=void 0,this._combinedSelected=void 0,this._combinedSelectedShadow=void 0,this._selectedLength=0,this._parentSelectedLength=0,this._selectedDirty=!0}Object.defineProperties(kE.prototype,{ready:{get:function(){let e=this._stages,t=e.length;for(let n=0;n<t;++n)if(!e[n].ready)return!1;return!0}},name:{get:function(){return this._name}},enabled:{get:function(){return this._stages[0].enabled},set:function(e){let t=this._stages,n=t.length;for(let i=0;i<n;++i)t[i].enabled=e}},uniforms:{get:function(){return this._uniforms}},inputPreviousStageTexture:{get:function(){return this._inputPreviousStageTexture}},length:{get:function(){return this._stages.length}},selected:{get:function(){return this._selected},set:function(e){this._selected=e}},parentSelected:{get:function(){return this._parentSelected},set:function(e){this._parentSelected=e}}});kE.prototype._isSupported=function(e){let t=this._stages,n=t.length;for(let i=0;i<n;++i)if(!t[i]._isSupported(e))return!1;return!0};kE.prototype.get=function(e){return this._stages[e]};function jIt(e){let t=l(e._selected)?e._selected.length:0,n=l(e._parentSelected)?e._parentSelected:0,i=e._selected!==e._selectedShadow||t!==e._selectedLength;if(i=i||e._parentSelected!==e._parentSelectedShadow||n!==e._parentSelectedLength,l(e._selected)&&l(e._parentSelected)?e._combinedSelected=e._selected.concat(e._parentSelected):l(e._parentSelected)?e._combinedSelected=e._parentSelected:e._combinedSelected=e._selected,!i&&l(e._combinedSelected)){if(!l(e._combinedSelectedShadow))return!0;t=e._combinedSelected.length;for(let r=0;r<t;++r)if(e._combinedSelected[r]!==e._combinedSelectedShadow[r])return!0}return i}kE.prototype.update=function(e,t){this._selectedDirty=jIt(this),this._selectedShadow=this._selected,this._parentSelectedShadow=this._parentSelected,this._combinedSelectedShadow=this._combinedSelected,this._selectedLength=l(this._selected)?this._selected.length:0,this._parentSelectedLength=l(this._parentSelected)?this._parentSelected.length:0;let n=this._stages,i=n.length;for(let r=0;r<i;++r){let o=n[r];this._selectedDirty&&(o.parentSelected=this._combinedSelected),o.update(e,t)}};kE.prototype.isDestroyed=function(){return!1};kE.prototype.destroy=function(){let e=this._stages,t=e.length;for(let n=0;n<t;++n)e[n].destroy();return le(this)};var af=kE;var fs={};function Tne(e){let r=`#define USE_STEP_SIZE +${db}`,o=new Ur({name:`${e}_x_direction`,fragmentShader:r,uniforms:{delta:1,sigma:2,stepSize:1,direction:0},sampleMode:id.LINEAR}),s=new Ur({name:`${e}_y_direction`,fragmentShader:r,uniforms:{delta:1,sigma:2,stepSize:1,direction:1},sampleMode:id.LINEAR}),a={};return Object.defineProperties(a,{delta:{get:function(){return o.uniforms.delta},set:function(c){let u=o.uniforms,f=s.uniforms;u.delta=f.delta=c}},sigma:{get:function(){return o.uniforms.sigma},set:function(c){let u=o.uniforms,f=s.uniforms;u.sigma=f.sigma=c}},stepSize:{get:function(){return o.uniforms.stepSize},set:function(c){let u=o.uniforms,f=s.uniforms;u.stepSize=f.stepSize=c}}}),new af({name:e,stages:[o,s],uniforms:a})}fs.createBlurStage=function(){return Tne("czm_blur")};fs.createDepthOfFieldStage=function(){let e=Tne("czm_depth_of_field_blur"),t=new Ur({name:"czm_depth_of_field_composite",fragmentShader:KU,uniforms:{focalDistance:5,blurTexture:e.name}}),n={};return Object.defineProperties(n,{focalDistance:{get:function(){return t.uniforms.focalDistance},set:function(i){t.uniforms.focalDistance=i}},delta:{get:function(){return e.uniforms.delta},set:function(i){e.uniforms.delta=i}},sigma:{get:function(){return e.uniforms.sigma},set:function(i){e.uniforms.sigma=i}},stepSize:{get:function(){return e.uniforms.stepSize},set:function(i){e.uniforms.stepSize=i}}}),new af({name:"czm_depth_of_field",stages:[e,t],inputPreviousStageTexture:!1,uniforms:n})};fs.isDepthOfFieldSupported=function(e){return e.context.depthTexture};fs.createEdgeDetectionStage=function(){let e=Kn();return new Ur({name:`czm_edge_detection_${e}`,fragmentShader:JU,uniforms:{length:.25,color:z.clone(z.BLACK)}})};fs.isEdgeDetectionSupported=function(e){return e.context.depthTexture};function HIt(e){if(!l(e))return fs.createEdgeDetectionStage();let t=new af({name:"czm_edge_detection_multiple",stages:e,inputPreviousStageTexture:!1}),n={},i="",r="";for(let a=0;a<e.length;++a)i+=`uniform sampler2D edgeTexture${a}; `,r+=` vec4 edge${a} = texture(edgeTexture${a}, v_textureCoordinates); if (edge${a}.a > 0.0) { @@ -11216,14 +11216,14 @@ void main() { ${r} } out_FragColor = color; } -`,s=new Ur({name:"czm_edge_detection_combine",fragmentShader:o,uniforms:n});return new hf({name:"czm_edge_detection_composite",stages:[t,s]})}fs.createSilhouetteStage=function(e){let t=GFt(e),n=new Ur({name:"czm_silhouette_color_edges",fragmentShader:gV,uniforms:{silhouetteTexture:t.name}});return new hf({name:"czm_silhouette",stages:[t,n],inputPreviousStageTexture:!1,uniforms:t.uniforms})};fs.isSilhouetteSupported=function(e){return e.context.depthTexture};fs.createBloomStage=function(){let e=new Ur({name:"czm_bloom_contrast_bias",fragmentShader:oV,uniforms:{contrast:128,brightness:-.3}}),t=Koe("czm_bloom_blur"),n=new hf({name:"czm_bloom_contrast_bias_blur",stages:[e,t]}),i=new Ur({name:"czm_bloom_generate_composite",fragmentShader:iV,uniforms:{glowOnly:!1,bloomTexture:n.name}}),r={};return Object.defineProperties(r,{glowOnly:{get:function(){return i.uniforms.glowOnly},set:function(o){i.uniforms.glowOnly=o}},contrast:{get:function(){return e.uniforms.contrast},set:function(o){e.uniforms.contrast=o}},brightness:{get:function(){return e.uniforms.brightness},set:function(o){e.uniforms.brightness=o}},delta:{get:function(){return t.uniforms.delta},set:function(o){t.uniforms.delta=o}},sigma:{get:function(){return t.uniforms.sigma},set:function(o){t.uniforms.sigma=o}},stepSize:{get:function(){return t.uniforms.stepSize},set:function(o){t.uniforms.stepSize=o}}}),new hf({name:"czm_bloom",stages:[n,i],inputPreviousStageTexture:!1,uniforms:r})};fs.createAmbientOcclusionStage=function(){let e=new Ur({name:"czm_ambient_occlusion_generate",fragmentShader:eV,uniforms:{intensity:3,bias:.1,lengthCap:.26,directionCount:8,stepCount:32,randomTexture:void 0}}),t=new Ur({name:"czm_ambient_occlusion_composite",fragmentShader:tV,uniforms:{ambientOcclusionOnly:!1,ambientOcclusionTexture:e.name}}),n={};return Object.defineProperties(n,{intensity:{get:function(){return e.uniforms.intensity},set:function(i){e.uniforms.intensity=i}},bias:{get:function(){return e.uniforms.bias},set:function(i){e.uniforms.bias=i}},lengthCap:{get:function(){return e.uniforms.lengthCap},set:function(i){e.uniforms.lengthCap=i}},directionCount:{get:function(){return e.uniforms.directionCount},set:function(i){e.uniforms.directionCount=i}},stepCount:{get:function(){return e.uniforms.stepCount},set:function(i){e.uniforms.stepCount=i}},randomTexture:{get:function(){return e.uniforms.randomTexture},set:function(i){e.uniforms.randomTexture=i}},ambientOcclusionOnly:{get:function(){return t.uniforms.ambientOcclusionOnly},set:function(i){t.uniforms.ambientOcclusionOnly=i}}}),new hf({name:"czm_ambient_occlusion",stages:[e,t],inputPreviousStageTexture:!1,uniforms:n})};fs.isAmbientOcclusionSupported=function(e){return e.context.depthTexture};var WFt=`#define FXAA_QUALITY_PRESET 39 +`,s=new Ur({name:"czm_edge_detection_combine",fragmentShader:o,uniforms:n});return new af({name:"czm_edge_detection_composite",stages:[t,s]})}fs.createSilhouetteStage=function(e){let t=HIt(e),n=new Ur({name:"czm_silhouette_color_edges",fragmentShader:oz,uniforms:{silhouetteTexture:t.name}});return new af({name:"czm_silhouette",stages:[t,n],inputPreviousStageTexture:!1,uniforms:t.uniforms})};fs.isSilhouetteSupported=function(e){return e.context.depthTexture};fs.createBloomStage=function(){let e=new Ur({name:"czm_bloom_contrast_bias",fragmentShader:XU,uniforms:{contrast:128,brightness:-.3}}),t=Tne("czm_bloom_blur"),n=new af({name:"czm_bloom_contrast_bias_blur",stages:[e,t]}),i=new Ur({name:"czm_bloom_generate_composite",fragmentShader:qU,uniforms:{glowOnly:!1,bloomTexture:n.name}}),r={};return Object.defineProperties(r,{glowOnly:{get:function(){return i.uniforms.glowOnly},set:function(o){i.uniforms.glowOnly=o}},contrast:{get:function(){return e.uniforms.contrast},set:function(o){e.uniforms.contrast=o}},brightness:{get:function(){return e.uniforms.brightness},set:function(o){e.uniforms.brightness=o}},delta:{get:function(){return t.uniforms.delta},set:function(o){t.uniforms.delta=o}},sigma:{get:function(){return t.uniforms.sigma},set:function(o){t.uniforms.sigma=o}},stepSize:{get:function(){return t.uniforms.stepSize},set:function(o){t.uniforms.stepSize=o}}}),new af({name:"czm_bloom",stages:[n,i],inputPreviousStageTexture:!1,uniforms:r})};fs.createAmbientOcclusionStage=function(){let e=new Ur({name:"czm_ambient_occlusion_generate",fragmentShader:HU,uniforms:{intensity:3,bias:.1,lengthCap:.26,directionCount:8,stepCount:32,randomTexture:void 0}}),t=new Ur({name:"czm_ambient_occlusion_composite",fragmentShader:GU,uniforms:{ambientOcclusionOnly:!1,ambientOcclusionTexture:e.name}}),n={};return Object.defineProperties(n,{intensity:{get:function(){return e.uniforms.intensity},set:function(i){e.uniforms.intensity=i}},bias:{get:function(){return e.uniforms.bias},set:function(i){e.uniforms.bias=i}},lengthCap:{get:function(){return e.uniforms.lengthCap},set:function(i){e.uniforms.lengthCap=i}},directionCount:{get:function(){return e.uniforms.directionCount},set:function(i){e.uniforms.directionCount=i}},stepCount:{get:function(){return e.uniforms.stepCount},set:function(i){e.uniforms.stepCount=i}},randomTexture:{get:function(){return e.uniforms.randomTexture},set:function(i){e.uniforms.randomTexture=i}},ambientOcclusionOnly:{get:function(){return t.uniforms.ambientOcclusionOnly},set:function(i){t.uniforms.ambientOcclusionOnly=i}}}),new af({name:"czm_ambient_occlusion",stages:[e,t],inputPreviousStageTexture:!1,uniforms:n})};fs.isAmbientOcclusionSupported=function(e){return e.context.depthTexture};var GIt=`#define FXAA_QUALITY_PRESET 39 ${oM} -${fV}`;fs.createFXAAStage=function(){return new Ur({name:"czm_FXAA",fragmentShader:WFt,sampleMode:fd.LINEAR})};fs.createAcesTonemappingStage=function(e){let t=e?`#define AUTO_EXPOSURE -`:"";return t+=Qz,new Ur({name:"czm_aces",fragmentShader:t,uniforms:{autoExposure:void 0,exposure:1}})};fs.createFilmicTonemappingStage=function(e){let t=e?`#define AUTO_EXPOSURE -`:"";return t+=lV,new Ur({name:"czm_filmic",fragmentShader:t,uniforms:{autoExposure:void 0,exposure:1}})};fs.createPbrNeutralTonemappingStage=function(e){let t=e?`#define AUTO_EXPOSURE -`:"";return t+=uV,new Ur({name:"czm_pbr_neutral",fragmentShader:t,uniforms:{autoExposure:void 0,exposure:1}})};fs.createReinhardTonemappingStage=function(e){let t=e?`#define AUTO_EXPOSURE -`:"";return t+=pV,new Ur({name:"czm_reinhard",fragmentShader:t,uniforms:{autoExposure:void 0,exposure:1}})};fs.createModifiedReinhardTonemappingStage=function(e){let t=e?`#define AUTO_EXPOSURE -`:"";return t+=hV,new Ur({name:"czm_modified_reinhard",fragmentShader:t,uniforms:{white:z.WHITE,autoExposure:void 0,exposure:1}})};fs.createAutoExposureStage=function(){return new _V};fs.createBlackAndWhiteStage=function(){return new Ur({name:"czm_black_and_white",fragmentShader:nV,uniforms:{gradations:5}})};fs.createBrightnessStage=function(){return new Ur({name:"czm_brightness",fragmentShader:rV,uniforms:{brightness:.5}})};fs.createNightVisionStage=function(){return new Ur({name:"czm_night_vision",fragmentShader:mV})};fs.createDepthViewStage=function(){return new Ur({name:"czm_depth_view",fragmentShader:aV})};fs.createLensFlareStage=function(){return new Ur({name:"czm_lens_flare",fragmentShader:dV,uniforms:{dirtTexture:Zt("Assets/Textures/LensFlare/DirtMask.jpg"),starTexture:Zt("Assets/Textures/LensFlare/StarBurst.jpg"),intensity:2,distortion:10,ghostDispersal:.4,haloWidth:.4,dirtAmount:.4,earthRadius:ee.WGS84.maximumRadius}})};var dd=fs;function ay(e){this._collection=e,this._framebuffers=[],this._stageNameToFramebuffer={},this._width=void 0,this._height=void 0,this._updateDependencies=!1}function AV(e){for(;l(e.length);)e=e.get(e.length-1);return e.name}function $oe(e,t,n,i,r){if(!i.enabled||!i._isSupported(t))return r;let o=n[i.name]={};if(l(r)){let a=e.getStageByName(r);o[AV(a)]=!0}let s=i.uniforms;if(l(s)){let a=Object.getOwnPropertyNames(s),c=a.length;for(let u=0;u<c;++u){let f=s[a[u]];if(typeof f=="string"){let d=e.getStageByName(f);l(d)&&(o[AV(d)]=!0)}}}return i.name}function yV(e,t,n,i,r){if(l(i.enabled)&&!i.enabled||l(i._isSupported)&&!i._isSupported(t))return r;let o=r,s=!l(i.inputPreviousStageTexture)||i.inputPreviousStageTexture,a=r,c=i.length;for(let d=0;d<c;++d){let p=i.get(d);l(p.length)?a=yV(e,t,n,p,r):a=$oe(e,t,n,p,r),s&&(r=a)}let u,f;if(s)for(u=1;u<c;++u)f=AV(i.get(u)),l(n[f])||(n[f]={}),n[f][o]=!0;else for(u=1;u<c;++u){f=AV(i.get(u));let d=n[f];for(let p=0;p<u;++p)d[AV(i.get(p))]=!0}return a}function qFt(e,t){let n={};if(l(e.ambientOcclusion)){let i=e.ambientOcclusion,r=e.bloom,o=e._tonemapping,s=e.fxaa,a=yV(e,t,n,i,void 0);a=yV(e,t,n,r,a),a=$oe(e,t,n,o,a),a=yV(e,t,n,e,a),$oe(e,t,n,s,a)}else yV(e,t,n,e,void 0);return n}function YFt(e,t,n){let r=e._collection.getStageByName(t),o=r._textureScale,s=r._forcePowerOfTwo,a=r._pixelFormat,c=r._pixelDatatype,u=r._clearColor,f,d,p=e._framebuffers,g=p.length;for(f=0;f<g;++f){if(d=p[f],o!==d.textureScale||s!==d.forcePowerOfTwo||a!==d.pixelFormat||c!==d.pixelDatatype||!z.equals(u,d.clearColor))continue;let m=d.stages,y=m.length,A=!1;for(let b=0;b<y;++b)if(n[m[b]]){A=!0;break}if(!A)break}return l(d)&&f<g?(d.stages.push(t),d):(d={textureScale:o,forcePowerOfTwo:s,pixelFormat:a,pixelDatatype:c,clearColor:u,stages:[t],buffer:new ai({pixelFormat:a,pixelDatatype:c}),clear:void 0},p.push(d),d)}function XFt(e,t){let n=qFt(e._collection,t);for(let i in n)n.hasOwnProperty(i)&&(e._stageNameToFramebuffer[i]=YFt(e,i,n[i]))}function Joe(e){let t=e._framebuffers,n=t.length;for(let i=0;i<n;++i)t[i].buffer.destroy()}function KFt(e,t){let n=e._width,i=e._height,r=e._framebuffers,o=r.length;for(let s=0;s<o;++s){let a=r[s],c=a.textureScale,u=Math.ceil(n*c),f=Math.ceil(i*c),d=Math.min(u,f);a.forcePowerOfTwo&&(D.isPowerOfTwo(d)||(d=D.nextPowerOfTwo(d)),u=d,f=d),a.buffer.update(t,u,f),a.clear=new li({color:a.clearColor,framebuffer:a.buffer.framebuffer})}}ay.prototype.updateDependencies=function(){this._updateDependencies=!0};ay.prototype.update=function(e){let t=this._collection,n=this._updateDependencies,i=l(t.ambientOcclusion)&&t.ambientOcclusion.enabled&&t.ambientOcclusion._isSupported(e),r=l(t.bloom)&&t.bloom.enabled&&t.bloom._isSupported(e),o=l(t._tonemapping)&&t._tonemapping.enabled&&t._tonemapping._isSupported(e),s=l(t.fxaa)&&t.fxaa.enabled&&t.fxaa._isSupported(e),a=!l(t._activeStages)||t._activeStages.length>0||i||r||o||s;if((n||!a&&this._framebuffers.length>0)&&(Joe(this),this._framebuffers.length=0,this._stageNameToFramebuffer={},this._width=void 0,this._height=void 0),!n&&!a)return;this._framebuffers.length===0&&XFt(this,e);let c=e.drawingBufferWidth,u=e.drawingBufferHeight,f=this._width!==c||this._height!==u;!n&&!f||(this._width=c,this._height=u,this._updateDependencies=!1,Joe(this),KFt(this,e))};ay.prototype.clear=function(e){let t=this._framebuffers;for(let n=0;n<t.length;++n)t[n].clear.execute(e)};ay.prototype.getStageByName=function(e){return this._collection.getStageByName(e)};ay.prototype.getOutputTexture=function(e){return this._collection.getOutputTexture(e)};ay.prototype.getFramebuffer=function(e){let t=this._stageNameToFramebuffer[e];if(l(t))return t.buffer.framebuffer};ay.prototype.isDestroyed=function(){return!1};ay.prototype.destroy=function(){return Joe(this),le(this)};var gC=ay;var CLe={REINHARD:"REINHARD",MODIFIED_REINHARD:"MODIFIED_REINHARD",FILMIC:"FILMIC",ACES:"ACES",PBR_NEUTRAL:"PBR_NEUTRAL"};Object.freeze(CLe);var cy=CLe;var Zoe=[];function bu(){let e=dd.createFXAAStage(),t=dd.createAmbientOcclusionStage(),n=dd.createBloomStage();this._autoExposureEnabled=!1,this._autoExposure=dd.createAutoExposureStage(),this._exposure=1,this._tonemapping=void 0,this._tonemapper=void 0,this.tonemapper=cy.PBR_NEUTRAL;let i=this._tonemapping;e.enabled=!1,t.enabled=!1,n.enabled=!1,i.enabled=!1;let r=new gC(this),o={},s=Zoe;for(s.push(e,t,n,i);s.length>0;){let c=s.pop();o[c.name]=c,c._textureCache=r;let u=c.length;if(l(u))for(let f=0;f<u;++f)s.push(c.get(f))}this._stages=[],this._activeStages=[],this._previousActiveStages=[],this._randomTexture=void 0;let a=this;t.uniforms.randomTexture=function(){return a._randomTexture},this._ao=t,this._bloom=n,this._fxaa=e,this._aoEnabled=void 0,this._bloomEnabled=void 0,this._tonemappingEnabled=void 0,this._fxaaEnabled=void 0,this._activeStagesChanged=!1,this._stagesRemoved=!1,this._textureCacheDirty=!1,this._stageNames=o,this._textureCache=r}Object.defineProperties(bu.prototype,{ready:{get:function(){let e=!1,t=this._stages,n=t.length;for(let a=n-1;a>=0;--a){let c=t[a];e=e||c.ready&&c.enabled}let i=this._fxaa,r=this._ao,o=this._bloom,s=this._tonemapping;return e=e||i.ready&&i.enabled,e=e||r.ready&&r.enabled,e=e||o.ready&&o.enabled,e=e||s.ready&&s.enabled,e}},fxaa:{get:function(){return this._fxaa}},ambientOcclusion:{get:function(){return this._ao}},bloom:{get:function(){return this._bloom}},length:{get:function(){return Qoe(this),this._stages.length}},outputTexture:{get:function(){let e=this._fxaa;if(e.enabled&&e.ready)return this.getOutputTexture(e.name);let t=this._stages,n=t.length;for(let s=n-1;s>=0;--s){let a=t[s];if(l(a)&&a.ready&&a.enabled)return this.getOutputTexture(a.name)}let i=this._tonemapping;if(i.enabled&&i.ready)return this.getOutputTexture(i.name);let r=this._bloom;if(r.enabled&&r.ready)return this.getOutputTexture(r.name);let o=this._ao;if(o.enabled&&o.ready)return this.getOutputTexture(o.name)}},hasSelected:{get:function(){let e=this._stages.slice();for(;e.length>0;){let t=e.pop();if(!l(t))continue;if(l(t.selected))return!0;let n=t.length;if(l(n))for(let i=0;i<n;++i)e.push(t.get(i))}return!1}},tonemapper:{get:function(){return this._tonemapper},set:function(e){if(this._tonemapper===e)return;l(this._tonemapping)&&(delete this._stageNames[this._tonemapping.name],this._tonemapping.destroy());let t=this._autoExposureEnabled,n;switch(e){case cy.REINHARD:n=dd.createReinhardTonemappingStage(t);break;case cy.MODIFIED_REINHARD:n=dd.createModifiedReinhardTonemappingStage(t);break;case cy.FILMIC:n=dd.createFilmicTonemappingStage(t);break;case cy.PBR_NEUTRAL:n=dd.createPbrNeutralTonemappingStage(t);break;default:n=dd.createAcesTonemappingStage(t);break}if(t){let i=this._autoExposure;n.uniforms.autoExposure=function(){return i.outputTexture}}else n.uniforms.exposure=this._exposure;this._tonemapper=e,this._tonemapping=n,l(this._stageNames)&&(this._stageNames[n.name]=n,n._textureCache=this._textureCache),this._textureCacheDirty=!0}},exposure:{get:function(){return this._exposure},set:function(e){this._tonemapping.uniforms.exposure=e,this._exposure=e}}});function Qoe(e){if(!e._stagesRemoved)return;e._stagesRemoved=!1;let t=[],n=e._stages;for(let i=0,r=0;i<n.length;++i){let o=n[i];o&&(o._index=r++,t.push(o))}e._stages=t}bu.prototype.add=function(e){let t=this._stageNames,n=Zoe;for(n.push(e);n.length>0;){let r=n.pop();t[r.name]=r,r._textureCache=this._textureCache;let o=r.length;if(l(o))for(let s=0;s<o;++s)n.push(r.get(s))}let i=this._stages;return e._index=i.length,i.push(e),this._textureCacheDirty=!0,e};bu.prototype.remove=function(e){if(!this.contains(e))return!1;let t=this._stageNames,n=Zoe;for(n.push(e);n.length>0;){let i=n.pop();delete t[i.name];let r=i.length;if(l(r))for(let o=0;o<r;++o)n.push(i.get(o))}return this._stages[e._index]=void 0,this._stagesRemoved=!0,this._textureCacheDirty=!0,e._index=void 0,e._textureCache=void 0,e.destroy(),!0};bu.prototype.contains=function(e){return l(e)&&l(e._index)&&e._textureCache===this._textureCache};bu.prototype.get=function(e){return Qoe(this),this._stages[e]};bu.prototype.removeAll=function(){let e=this._stages,t=e.length;for(let n=0;n<t;++n)this.remove(e[n]);e.length=0};bu.prototype.getStageByName=function(e){return this._stageNames[e]};bu.prototype.update=function(e,t,n){Qoe(this);let i=this._activeStages,r=this._activeStages=this._previousActiveStages;this._previousActiveStages=i;let o=this._stages;r.length=o.length;let s=0;for(let b=0;b<o.length;++b){let x=o[b];x.ready&&x.enabled&&x._isSupported(e)&&(r[s++]=x)}r.length=s;let a=s!==i.length;if(!a){for(let b=0;b<s;++b)if(r[b]!==i[b]){a=!0;break}}let c=this._ao,u=this._bloom,f=this._autoExposure,d=this._tonemapping,p=this._fxaa;d.enabled=n;let g=c.enabled&&c._isSupported(e),m=u.enabled&&u._isSupported(e),y=d.enabled&&d._isSupported(e),A=p.enabled&&p._isSupported(e);if((a||this._textureCacheDirty||g!==this._aoEnabled||m!==this._bloomEnabled||y!==this._tonemappingEnabled||A!==this._fxaaEnabled)&&(this._textureCache.updateDependencies(),this._aoEnabled=g,this._bloomEnabled=m,this._tonemappingEnabled=y,this._fxaaEnabled=A,this._textureCacheDirty=!1),l(this._randomTexture)&&!g&&(this._randomTexture.destroy(),this._randomTexture=void 0),!l(this._randomTexture)&&g){let x=new Uint8Array(196608);for(let T=0;T<196608;T+=3)x[T]=Math.floor(Math.random()*255);this._randomTexture=new Dt({context:e,pixelFormat:Ke.RGB,pixelDatatype:ze.UNSIGNED_BYTE,source:{arrayBufferView:x,width:256,height:256},sampler:new jt({wrapS:hn.REPEAT,wrapT:hn.REPEAT,minificationFilter:Wt.NEAREST,magnificationFilter:Jn.NEAREST})})}this._textureCache.update(e),p.update(e,t),c.update(e,t),u.update(e,t),d.update(e,t),this._autoExposureEnabled&&f.update(e,t);for(let b=0;b<o.length;++b)o[b].update(e,t);s=0;for(let b=0;b<o.length;++b){let x=o[b];x.ready&&x.enabled&&x._isSupported(e)&&s++}a=s!==r.length,a&&this.update(e,t,n)};bu.prototype.clear=function(e){this._textureCache.clear(e),this._autoExposureEnabled&&this._autoExposure.clear(e)};function _C(e){for(;l(e.length);)e=e.get(e.length-1);return e.outputTexture}bu.prototype.getOutputTexture=function(e){let t=this.getStageByName(e);if(l(t))return _C(t)};function V0(e,t,n,i,r){if(l(e.execute)){e.execute(t,n,i,r);return}if(e.inputPreviousStageTexture){V0(e.get(0),t,n,i,r);for(let o=1;o<e.length;++o)V0(e.get(o),t,_C(e.get(o-1)),i,r)}else for(let o=0;o<e.length;++o)V0(e.get(o),t,n,i,r)}bu.prototype.execute=function(e,t,n,i){let r=this._activeStages,o=r.length,s=this._fxaa,a=this._ao,c=this._bloom,u=this._autoExposure,f=this._tonemapping,d=a.enabled&&a._isSupported(e),p=c.enabled&&c._isSupported(e),g=this._autoExposureEnabled,m=f.enabled&&f._isSupported(e),y=s.enabled&&s._isSupported(e);if(!y&&!d&&!p&&!m&&o===0)return;let A=t;d&&a.ready&&(V0(a,e,A,n,i),A=_C(a)),p&&c.ready&&(V0(c,e,A,n,i),A=_C(c)),g&&u.ready&&V0(u,e,A,n,i),m&&f.ready&&(V0(f,e,A,n,i),A=_C(f));let b=A;if(o>0){V0(r[0],e,A,n,i);for(let x=1;x<o;++x)V0(r[x],e,_C(r[x-1]),n,i);b=_C(r[o-1])}y&&s.ready&&V0(s,e,b,n,i)};bu.prototype.copy=function(e,t){if(!l(this._copyColorCommand)){let n=this;this._copyColorCommand=e.createViewportQuadCommand(df,{uniformMap:{colorTexture:function(){return n.outputTexture}},owner:this})}this._copyColorCommand.framebuffer=t,this._copyColorCommand.execute(e)};bu.prototype.isDestroyed=function(){return!1};bu.prototype.destroy=function(){return this._fxaa.destroy(),this._ao.destroy(),this._bloom.destroy(),this._autoExposure.destroy(),this._tonemapping.destroy(),this.removeAll(),this._textureCache=this._textureCache&&this._textureCache.destroy(),le(this)};var bV=bu;var vLe={SHIFT:0,CTRL:1,ALT:2};Object.freeze(vLe);var to=vLe;var SLe={LEFT_DOWN:0,LEFT_UP:1,LEFT_CLICK:2,LEFT_DOUBLE_CLICK:3,RIGHT_DOWN:5,RIGHT_UP:6,RIGHT_CLICK:7,MIDDLE_DOWN:10,MIDDLE_UP:11,MIDDLE_CLICK:12,MOUSE_MOVE:15,WHEEL:16,PINCH_START:17,PINCH_END:18,PINCH_MOVE:19};Object.freeze(SLe);var un=SLe;function Nb(e,t,n){let i=e._element;if(i===document)return n.x=t.clientX,n.y=t.clientY,n;let r=i.getBoundingClientRect();return n.x=t.clientX-r.left,n.y=t.clientY-r.top,n}function ose(e,t){if(!l(t))return`${e}`;let n=Array.isArray(t)?t.toSorted():[t];return`${e}+${n.join("+")}`}function yC(e){let t=[];if(e.shiftKey&&t.push(to.SHIFT),e.ctrlKey&&t.push(to.CTRL),e.altKey&&t.push(to.ALT),t.length)return t}var Fs={LEFT:0,MIDDLE:1,RIGHT:2};function hd(e,t,n,i){function r(o){i(e,o)}n.addEventListener(t,r,{capture:!1,passive:!1}),e._removalFunctions.push(function(){n.removeEventListener(t,r,!1)})}function $Ft(e){let t=e._element,n=l(t.disableRootEvents)?t:document;dn.supportsPointerEvents()?(hd(e,"pointerdown",t,nBt),hd(e,"pointerup",t,FLe),hd(e,"pointermove",t,iBt),hd(e,"pointercancel",t,FLe)):(hd(e,"mousedown",t,BLe),hd(e,"mouseup",n,kLe),hd(e,"mousemove",n,ULe),hd(e,"touchstart",t,eBt),hd(e,"touchend",n,RLe),hd(e,"touchmove",n,tBt),hd(e,"touchcancel",n,RLe)),hd(e,"dblclick",t,ZFt);let i;"onwheel"in t?i="wheel":document.onmousewheel!==void 0?i="mousewheel":i="DOMMouseScroll",hd(e,i,t,QFt)}function JFt(e){let t=e._removalFunctions;for(let n=0;n<t.length;++n)t[n]()}var wLe={position:new U};function sse(e){e._lastSeenTouchEvent=xn()}function ase(e){return xn()-e._lastSeenTouchEvent>sp.mouseEmulationIgnoreMilliseconds}function rse(e,t,n){let i=e.x-t.x,r=e.y-t.y;return Math.sqrt(i*i+r*r)<n}function BLe(e,t){if(!ase(e))return;let n=t.button;e._buttonDown[n]=!0;let i;if(n===Fs.LEFT)i=un.LEFT_DOWN;else if(n===Fs.MIDDLE)i=un.MIDDLE_DOWN;else if(n===Fs.RIGHT)i=un.RIGHT_DOWN;else return;let r=Nb(e,t,e._primaryPosition);U.clone(r,e._primaryStartPosition),U.clone(r,e._primaryPreviousPosition);let o=yC(t),s=e.getInputAction(i,o);l(s)&&(U.clone(r,wLe.position),s(wLe),t.preventDefault())}var ILe={position:new U},PLe={position:new U};function ese(e,t,n,i){let r=yC(i),o=e.getInputAction(t,r),s=e.getInputAction(n,r);if(l(o)||l(s)){let a=Nb(e,i,e._primaryPosition);if(l(o)&&(U.clone(a,ILe.position),o(ILe)),l(s)){let c=e._primaryStartPosition;rse(c,a,e._clickPixelTolerance)&&(U.clone(a,PLe.position),s(PLe))}}}function kLe(e,t){if(!ase(e))return;let n=t.button;n!==Fs.LEFT&&n!==Fs.MIDDLE&&n!==Fs.RIGHT||(e._buttonDown[Fs.LEFT]&&(ese(e,un.LEFT_UP,un.LEFT_CLICK,t),e._buttonDown[Fs.LEFT]=!1),e._buttonDown[Fs.MIDDLE]&&(ese(e,un.MIDDLE_UP,un.MIDDLE_CLICK,t),e._buttonDown[Fs.MIDDLE]=!1),e._buttonDown[Fs.RIGHT]&&(ese(e,un.RIGHT_UP,un.RIGHT_CLICK,t),e._buttonDown[Fs.RIGHT]=!1))}var tse={startPosition:new U,endPosition:new U};function ULe(e,t){if(!ase(e))return;let n=yC(t),i=Nb(e,t,e._primaryPosition),r=e._primaryPreviousPosition,o=e.getInputAction(un.MOUSE_MOVE,n);l(o)&&(U.clone(r,tse.startPosition),U.clone(i,tse.endPosition),o(tse)),U.clone(i,r),(e._buttonDown[Fs.LEFT]||e._buttonDown[Fs.MIDDLE]||e._buttonDown[Fs.RIGHT])&&t.preventDefault()}var DLe={position:new U};function ZFt(e,t){let n=t.button,i;if(n===Fs.LEFT)i=un.LEFT_DOUBLE_CLICK;else return;let r=yC(t),o=e.getInputAction(i,r);l(o)&&(Nb(e,t,DLe.position),o(DLe))}function QFt(e,t){let n;if(l(t.deltaY)){let o=t.deltaMode;o===t.DOM_DELTA_PIXEL?n=-t.deltaY:o===t.DOM_DELTA_LINE?n=-t.deltaY*40:n=-t.deltaY*120}else t.detail>0?n=t.detail*-120:n=t.wheelDelta;if(!l(n))return;let i=yC(t),r=e.getInputAction(un.WHEEL,i);l(r)&&(r(n),t.preventDefault())}function eBt(e,t){sse(e);let n=t.changedTouches,i,r=n.length,o,s,a=e._positions;for(i=0;i<r;++i)o=n[i],s=o.identifier,a.set(s,Nb(e,o,new U));Q7(e,t);let c=e._previousPositions;for(i=0;i<r;++i)o=n[i],s=o.identifier,c.set(s,U.clone(a.get(s)))}function RLe(e,t){sse(e);let n=t.changedTouches,i,r=n.length,o,s,a=e._positions;for(i=0;i<r;++i)o=n[i],s=o.identifier,a.remove(s);Q7(e,t);let c=e._previousPositions;for(i=0;i<r;++i)o=n[i],s=o.identifier,c.remove(s)}var OLe={position:new U},nse={position1:new U,position2:new U},MLe={position:new U},NLe={position:new U},LLe={position:new U};function Q7(e,t){let n=yC(t),i=e._positions,r=i.length,o,s,a=e._isPinching;if(r!==1&&e._buttonDown[Fs.LEFT]){if(e._buttonDown[Fs.LEFT]=!1,l(e._touchHoldTimer)&&(clearTimeout(e._touchHoldTimer),e._touchHoldTimer=void 0),o=e.getInputAction(un.LEFT_UP,n),l(o)&&(U.clone(e._primaryPosition,MLe.position),o(MLe)),r===0&&!e._isTouchHolding&&(s=e.getInputAction(un.LEFT_CLICK,n),l(s))){let c=e._primaryStartPosition,u=e._previousPositions.values[0];rse(c,u,e._clickPixelTolerance)&&(U.clone(e._primaryPosition,NLe.position),s(NLe))}e._isTouchHolding=!1}if(r===0&&a&&(e._isPinching=!1,o=e.getInputAction(un.PINCH_END,n),l(o)&&o()),r===1&&!a){let c=i.values[0];U.clone(c,e._primaryPosition),U.clone(c,e._primaryStartPosition),U.clone(c,e._primaryPreviousPosition),e._buttonDown[Fs.LEFT]=!0,o=e.getInputAction(un.LEFT_DOWN,n),l(o)&&(U.clone(c,OLe.position),o(OLe)),e._touchHoldTimer=setTimeout(function(){if(!e.isDestroyed()&&(e._touchHoldTimer=void 0,e._isTouchHolding=!0,s=e.getInputAction(un.RIGHT_CLICK,n),l(s))){let u=e._primaryStartPosition,f=e._previousPositions.values[0];rse(u,f,e._holdPixelTolerance)&&(U.clone(e._primaryPosition,LLe.position),s(LLe))}},sp.touchHoldDelayMilliseconds),t.preventDefault()}r===2&&!a&&(e._isPinching=!0,o=e.getInputAction(un.PINCH_START,n),l(o)&&(U.clone(i.values[0],nse.position1),U.clone(i.values[1],nse.position2),o(nse),t.preventDefault()))}function tBt(e,t){sse(e);let n=t.changedTouches,i,r=n.length,o,s,a=e._positions;for(i=0;i<r;++i){o=n[i],s=o.identifier;let u=a.get(s);l(u)&&Nb(e,o,u)}zLe(e,t);let c=e._previousPositions;for(i=0;i<r;++i)o=n[i],s=o.identifier,U.clone(a.get(s),c.get(s))}var ise={startPosition:new U,endPosition:new U},xV={distance:{startPosition:new U,endPosition:new U},angleAndHeight:{startPosition:new U,endPosition:new U}};function zLe(e,t){let n=yC(t),i=e._positions,r=e._previousPositions,o=i.length,s;if(o===1&&e._buttonDown[Fs.LEFT]){let a=i.values[0];U.clone(a,e._primaryPosition);let c=e._primaryPreviousPosition;s=e.getInputAction(un.MOUSE_MOVE,n),l(s)&&(U.clone(c,ise.startPosition),U.clone(a,ise.endPosition),s(ise)),U.clone(a,c),t.preventDefault()}else if(o===2&&e._isPinching&&(s=e.getInputAction(un.PINCH_MOVE,n),l(s))){let a=i.values[0],c=i.values[1],u=r.values[0],f=r.values[1],d=c.x-a.x,p=c.y-a.y,g=Math.sqrt(d*d+p*p)*.25,m=f.x-u.x,y=f.y-u.y,A=Math.sqrt(m*m+y*y)*.25,b=(c.y+a.y)*.125,x=(f.y+u.y)*.125,T=Math.atan2(p,d),E=Math.atan2(y,m);U.fromElements(0,A,xV.distance.startPosition),U.fromElements(0,g,xV.distance.endPosition),U.fromElements(E,x,xV.angleAndHeight.startPosition),U.fromElements(T,b,xV.angleAndHeight.endPosition),s(xV)}}function nBt(e,t){if(t.target.setPointerCapture(t.pointerId),t.pointerType==="touch"){let n=e._positions,i=t.pointerId;n.set(i,Nb(e,t,new U)),Q7(e,t),e._previousPositions.set(i,U.clone(n.get(i)))}else BLe(e,t)}function FLe(e,t){if(t.pointerType==="touch"){let n=e._positions,i=t.pointerId;n.remove(i),Q7(e,t),e._previousPositions.remove(i)}else kLe(e,t)}function iBt(e,t){if(t.pointerType==="touch"){let n=e._positions,i=t.pointerId,r=n.get(i);if(!l(r))return;Nb(e,t,r),zLe(e,t);let o=e._previousPositions;U.clone(n.get(i),o.get(i))}else ULe(e,t)}function sp(e){this._inputEvents={},this._buttonDown={[Fs.LEFT]:!1,[Fs.MIDDLE]:!1,[Fs.RIGHT]:!1},this._isPinching=!1,this._isTouchHolding=!1,this._lastSeenTouchEvent=-sp.mouseEmulationIgnoreMilliseconds,this._primaryStartPosition=new U,this._primaryPosition=new U,this._primaryPreviousPosition=new U,this._positions=new Ut,this._previousPositions=new Ut,this._removalFunctions=[],this._touchHoldTimer=void 0,this._clickPixelTolerance=5,this._holdPixelTolerance=25,this._element=e??document,$Ft(this)}sp.prototype.setInputAction=function(e,t,n){let i=ose(t,n);this._inputEvents[i]=e};sp.prototype.getInputAction=function(e,t){let n=ose(e,t);return this._inputEvents[n]};sp.prototype.removeInputAction=function(e,t){let n=ose(e,t);delete this._inputEvents[n]};sp.prototype.isDestroyed=function(){return!1};sp.prototype.destroy=function(){return JFt(this),le(this)};sp.mouseEmulationIgnoreMilliseconds=800;sp.touchHoldDelayMilliseconds=1500;var ca=sp;function AC(e){this._scene=e,this._currentTweens=[],this._morphHandler=void 0,this._morphCancelled=!1,this._completeMorph=void 0,this._morphToOrthographic=!1}AC.prototype.completeMorph=function(){l(this._completeMorph)&&this._completeMorph()};AC.prototype.morphTo2D=function(e,t){l(this._completeMorph)&&this._completeMorph();let n=this._scene;this._previousMode=n.mode,this._morphToOrthographic=n.camera.frustum instanceof gn,!(this._previousMode===re.SCENE2D||this._previousMode===re.MORPHING)&&(this._scene.morphStart.raiseEvent(this,this._previousMode,re.SCENE2D,!0),n._mode=re.MORPHING,n.camera._setTransform(N.IDENTITY),this._previousMode===re.COLUMBUS_VIEW?FBt(this,e):HBt(this,e,t),e===0&&l(this._completeMorph)&&this._completeMorph())};var rBt=new h,oBt=new h,sBt=new h,aBt=new h,cBt=new h,lBt=new h,uBt=new h,fBt=new he,dBt=new N,hBt=new Ji,mBt=new gn,pBt={position:void 0,direction:void 0,up:void 0,position2D:void 0,direction2D:void 0,up2D:void 0,frustum:void 0};AC.prototype.morphToColumbusView=function(e,t){l(this._completeMorph)&&this._completeMorph();let n=this._scene;if(this._previousMode=n.mode,this._previousMode===re.COLUMBUS_VIEW||this._previousMode===re.MORPHING)return;this._scene.morphStart.raiseEvent(this,this._previousMode,re.COLUMBUS_VIEW,!0),n.camera._setTransform(N.IDENTITY);let i=rBt,r=oBt,o=sBt;if(e>0)i.x=0,i.y=-1,i.z=1,i=h.multiplyByScalar(h.normalize(i,i),5*t.maximumRadius,i),h.negate(h.normalize(i,r),r),h.cross(h.UNIT_X,r,o);else{let u=n.camera;if(this._previousMode===re.SCENE2D)h.clone(u.position,i),i.z=u.frustum.right-u.frustum.left,h.negate(h.UNIT_Z,r),h.clone(h.UNIT_Y,o);else{h.clone(u.positionWC,i),h.clone(u.directionWC,r),h.clone(u.upWC,o);let f=t.scaleToGeodeticSurface(i,uBt),d=At.eastNorthUpToFixedFrame(f,t,dBt);N.inverseTransformation(d,d),n.mapProjection.project(t.cartesianToCartographic(i,fBt),i),N.multiplyByPointAsVector(d,r,r),N.multiplyByPointAsVector(d,o,o)}}let s;this._morphToOrthographic?(s=mBt,s.width=n.camera.frustum.right-n.camera.frustum.left,s.aspectRatio=n.drawingBufferWidth/n.drawingBufferHeight):(s=hBt,s.aspectRatio=n.drawingBufferWidth/n.drawingBufferHeight,s.fov=D.toRadians(60));let a=pBt;a.position=i,a.direction=r,a.up=o,a.frustum=s;let c=WBt(a);TV(this,c),this._previousMode===re.SCENE2D?GBt(this,e,a,c):(a.position2D=N.multiplyByPoint(Or.TRANSFORM_2D,i,aBt),a.direction2D=N.multiplyByPointAsVector(Or.TRANSFORM_2D,r,cBt),a.up2D=N.multiplyByPointAsVector(Or.TRANSFORM_2D,o,lBt),n._mode=re.MORPHING,JLe(this,e,a,c)),e===0&&l(this._completeMorph)&&this._completeMorph()};var use={position:new h,direction:new h,up:new h,frustum:void 0},jLe=new Ji;AC.prototype.morphTo3D=function(e,t){l(this._completeMorph)&&this._completeMorph();let n=this._scene;if(this._previousMode=n.mode,!(this._previousMode===re.SCENE3D||this._previousMode===re.MORPHING)){if(this._scene.morphStart.raiseEvent(this,this._previousMode,re.SCENE3D,!0),n._mode=re.MORPHING,n.camera._setTransform(N.IDENTITY),this._previousMode===re.SCENE2D)SBt(this,e,t);else{let i;e>0?(i=use,h.fromDegrees(0,0,5*t.maximumRadius,t,i.position),h.negate(i.position,i.direction),h.normalize(i.direction,i.direction),h.clone(h.UNIT_Z,i.up)):i=HLe(this,t);let r,o=n.camera;o.frustum instanceof gn?r=o.frustum.clone():(r=jLe,r.aspectRatio=n.drawingBufferWidth/n.drawingBufferHeight,r.fov=D.toRadians(60)),i.frustum=r;let s=QLe(i);TV(this,s),lse(this,e,i,s)}e===0&&l(this._completeMorph)&&this._completeMorph()}};AC.prototype.isDestroyed=function(){return!1};AC.prototype.destroy=function(){return eW(this),le(this)};function TV(e,t){if(e._scene.completeMorphOnUserInput){e._morphHandler=new ca(e._scene.canvas);let n=function(){e._morphCancelled=!0,e._scene.camera.cancelFlight(),t(e)};e._completeMorph=n,e._morphHandler.setInputAction(n,un.LEFT_DOWN),e._morphHandler.setInputAction(n,un.MIDDLE_DOWN),e._morphHandler.setInputAction(n,un.RIGHT_DOWN),e._morphHandler.setInputAction(n,un.WHEEL)}}function eW(e){let t=e._currentTweens;for(let n=0;n<t.length;++n)t[n].cancelTween();e._currentTweens.length=0,e._morphHandler=e._morphHandler&&e._morphHandler.destroy()}var gBt=new he,_Bt=new h,yBt=new N;function HLe(e,t){let n=e._scene,i=n.camera,r=use,o=r.position,s=r.direction,a=r.up,c=n.mapProjection.unproject(i.position,gBt);t.cartographicToCartesian(c,o);let u=t.scaleToGeodeticSurface(o,_Bt),f=At.eastNorthUpToFixedFrame(u,t,yBt);return N.multiplyByPointAsVector(f,i.direction,s),N.multiplyByPointAsVector(f,i.up,a),r}var ABt=new h,bBt=new h,xBt=new h,TBt=new h,EBt=new h,CBt=new h;function lse(e,t,n,i){t*=.5;let r=e._scene,o=r.camera,s=h.clone(o.position,ABt),a=h.clone(o.direction,bBt),c=h.clone(o.up,xBt),u=N.multiplyByPoint(Or.TRANSFORM_2D_INVERSE,n.position,TBt),f=N.multiplyByPointAsVector(Or.TRANSFORM_2D_INVERSE,n.direction,EBt),d=N.multiplyByPointAsVector(Or.TRANSFORM_2D_INVERSE,n.up,CBt);function p(m){wh(s,u,m.time,o.position),wh(a,f,m.time,o.direction),wh(c,d,m.time,o.up),h.cross(o.direction,o.up,o.right),h.normalize(o.right,o.right)}let g=r.tweens.add({duration:t,easingFunction:Ls.QUARTIC_OUT,startObject:{time:0},stopObject:{time:1},update:p,complete:function(){ZLe(e,r,0,1,t,i)}});e._currentTweens.push(g)}var vBt=new gn,GLe=new h,WLe=new h,qLe=new h,fse=new h,YLe=new h,XLe=new h;function SBt(e,t,n){t/=3;let i=e._scene,r=i.camera,o;t>0?(o=use,h.fromDegrees(0,0,5*n.maximumRadius,n,o.position),h.negate(o.position,o.direction),h.normalize(o.direction,o.direction),h.clone(h.UNIT_Z,o.up)):(r.position.z=r.frustum.right-r.frustum.left,o=HLe(e,n));let s;e._morphToOrthographic?(s=vBt,s.aspectRatio=i.drawingBufferWidth/i.drawingBufferHeight,s.width=r.frustum.right-r.frustum.left):(s=jLe,s.aspectRatio=i.drawingBufferWidth/i.drawingBufferHeight,s.fov=D.toRadians(60)),o.frustum=s;let a=QLe(o);TV(e,a);let c;e._morphToOrthographic?c=function(){lse(e,t,o,a)}:c=function(){$Le(e,t,o,function(){lse(e,t,o,a)})},t>0?(i._mode=re.SCENE2D,r.flyTo({duration:t,destination:h.fromDegrees(0,0,5*n.maximumRadius,n,fse),complete:function(){i._mode=re.MORPHING,c()}})):c()}function wh(e,t,n,i){return h.lerp(e,t,n,i)}function KLe(e,t,n,i,r){let o=e._scene,s=o.camera;if(s.frustum instanceof gn)return;let a=s.frustum.fov,c=D.RADIANS_PER_DEGREE*.5,u=n.position.z*Math.tan(a*.5);s.frustum.far=u/Math.tan(c*.5)+1e7;function f(p){s.frustum.fov=D.lerp(a,c,p.time);let g=u/Math.tan(s.frustum.fov*.5);i(s,g)}let d=o.tweens.add({duration:t,easingFunction:Ls.QUARTIC_OUT,startObject:{time:0},stopObject:{time:1},update:f,complete:function(){s.frustum=n.frustum.clone(),r(e)}});e._currentTweens.push(d)}var wBt=new h,IBt=new h,PBt=new h,cse=new h,DBt=new h,RBt=new h,OBt=new ys,MBt=new pn,NBt=new h,LBt={position:void 0,direction:void 0,up:void 0,frustum:void 0};function FBt(e,t){t*=.5;let n=e._scene,i=n.camera,r=h.clone(i.position,wBt),o=h.clone(i.direction,IBt),s=h.clone(i.up,PBt),a=h.negate(h.UNIT_Z,DBt),c=h.clone(h.UNIT_Y,RBt),u=cse;if(t>0)h.clone(h.ZERO,cse),u.z=5*n.ellipsoid.maximumRadius;else{h.clone(r,cse);let A=MBt;N.multiplyByPoint(Or.TRANSFORM_2D,r,A.origin),N.multiplyByPointAsVector(Or.TRANSFORM_2D,o,A.direction);let b=n.globe;if(l(b)){let x=b.pickWorldCoordinates(A,n,!0,NBt);l(x)&&(N.multiplyByPoint(Or.TRANSFORM_2D_INVERSE,x,u),u.z+=h.distance(r,u))}}let f=OBt;f.right=u.z*.5,f.left=-f.right,f.top=f.right*(n.drawingBufferHeight/n.drawingBufferWidth),f.bottom=-f.top;let d=LBt;d.position=u,d.direction=a,d.up=c,d.frustum=f;let p=eFe(d);TV(e,p);function g(A){wh(r,u,A.time,i.position),wh(o,a,A.time,i.direction),wh(s,c,A.time,i.up),h.cross(i.direction,i.up,i.right),h.normalize(i.right,i.right),i._adjustOrthographicFrustum(!0)}function m(A,b){A.position.z=b}let y=n.tweens.add({duration:t,easingFunction:Ls.QUARTIC_OUT,startObject:{time:0},stopObject:{time:1},update:g,complete:function(){KLe(e,t,d,m,p)}});e._currentTweens.push(y)}var VLe=new he,BBt={position:new h,direction:new h,up:new h,position2D:new h,direction2D:new h,up2D:new h,frustum:new ys},kBt={position:new h,direction:new h,up:new h,frustum:void 0},UBt=new h,zBt=new pn,VBt=new N,jBt=new h;function HBt(e,t,n){t*=.5;let i=e._scene,r=i.camera,o=BBt;if(t>0)h.clone(h.ZERO,o.position),o.position.z=5*n.maximumRadius,h.negate(h.UNIT_Z,o.direction),h.clone(h.UNIT_Y,o.up);else{n.cartesianToCartographic(r.positionWC,VLe),i.mapProjection.project(VLe,o.position),h.negate(h.UNIT_Z,o.direction),h.clone(h.UNIT_Y,o.up);let d=zBt;h.clone(o.position2D,d.origin);let p=h.clone(r.directionWC,d.direction),g=n.scaleToGeodeticSurface(r.positionWC,jBt),m=At.eastNorthUpToFixedFrame(g,n,VBt);N.inverseTransformation(m,m),N.multiplyByPointAsVector(m,p,p),N.multiplyByPointAsVector(Or.TRANSFORM_2D,p,p);let y=i.globe;if(l(y)){let A=y.pickWorldCoordinates(d,i,!0,UBt);if(l(A)){let b=h.distance(o.position2D,A);A.x+=b,h.clone(A,o.position2D)}}}function s(d,p){d.position.x=p}N.multiplyByPoint(Or.TRANSFORM_2D,o.position,o.position2D),N.multiplyByPointAsVector(Or.TRANSFORM_2D,o.direction,o.direction2D),N.multiplyByPointAsVector(Or.TRANSFORM_2D,o.up,o.up2D);let a=o.frustum;a.right=o.position.z*.5,a.left=-a.right,a.top=a.right*(i.drawingBufferHeight/i.drawingBufferWidth),a.bottom=-a.top;let c=kBt;N.multiplyByPoint(Or.TRANSFORM_2D_INVERSE,o.position2D,c.position),h.clone(o.direction,c.direction),h.clone(o.up,c.up),c.frustum=a;let u=eFe(c);TV(e,u);function f(){KLe(e,t,o,s,u)}JLe(e,t,o,f)}function $Le(e,t,n,i){let r=e._scene,o=r.camera,s=o.frustum.right-o.frustum.left;o.frustum=n.frustum.clone();let a=o.frustum.fov,c=D.RADIANS_PER_DEGREE*.5,u=s*Math.tan(a*.5);o.frustum.far=u/Math.tan(c*.5)+1e7,o.frustum.fov=c;function f(p){o.frustum.fov=D.lerp(c,a,p.time),o.position.z=u/Math.tan(o.frustum.fov*.5)}let d=r.tweens.add({duration:t,easingFunction:Ls.QUARTIC_OUT,startObject:{time:0},stopObject:{time:1},update:f,complete:function(){i(e)}});e._currentTweens.push(d)}function GBt(e,t,n,i){t*=.5;let r=e._scene,o=r.camera,s=h.clone(n.position,fse),a=h.clone(n.direction,YLe),c=h.clone(n.up,XLe);r._mode=re.MORPHING;function u(){o.frustum=n.frustum.clone();let f=h.clone(o.position,GLe),d=h.clone(o.direction,WLe),p=h.clone(o.up,qLe);f.z=s.z;function g(y){wh(f,s,y.time,o.position),wh(d,a,y.time,o.direction),wh(p,c,y.time,o.up),h.cross(o.direction,o.up,o.right),h.normalize(o.right,o.right)}let m=r.tweens.add({duration:t,easingFunction:Ls.QUARTIC_OUT,startObject:{time:0},stopObject:{time:1},update:g,complete:function(){i(e)}});e._currentTweens.push(m)}e._morphToOrthographic?u():$Le(e,0,n,u)}function JLe(e,t,n,i){let r=e._scene,o=r.camera,s=h.clone(o.position,GLe),a=h.clone(o.direction,WLe),c=h.clone(o.up,qLe),u=h.clone(n.position2D,fse),f=h.clone(n.direction2D,YLe),d=h.clone(n.up2D,XLe);function p(m){wh(s,u,m.time,o.position),wh(a,f,m.time,o.direction),wh(c,d,m.time,o.up),h.cross(o.direction,o.up,o.right),h.normalize(o.right,o.right),o._adjustOrthographicFrustum(!0)}let g=r.tweens.add({duration:t,easingFunction:Ls.QUARTIC_OUT,startObject:{time:0},stopObject:{time:1},update:p,complete:function(){ZLe(e,r,1,0,t,i)}});e._currentTweens.push(g)}function ZLe(e,t,n,i,r,o){let s={object:t,property:"morphTime",startValue:n,stopValue:i,duration:r,easingFunction:Ls.QUARTIC_OUT};l(o)&&(s.complete=function(){o(e)});let a=t.tweens.addProperty(s);e._currentTweens.push(a)}function QLe(e){return function(t){let n=t._scene;n._mode=re.SCENE3D,n.morphTime=re.getMorphTime(re.SCENE3D),eW(t);let i=n.camera;(t._previousMode!==re.MORPHING||t._morphCancelled)&&(t._morphCancelled=!1,h.clone(e.position,i.position),h.clone(e.direction,i.direction),h.clone(e.up,i.up),h.cross(i.direction,i.up,i.right),h.normalize(i.right,i.right),i.frustum=e.frustum.clone());let r=i.frustum;n.frameState.useLogDepth&&(r.near=.1,r.far=1e10);let o=l(t._completeMorph);t._completeMorph=void 0,n.camera.update(n.mode),t._scene.morphComplete.raiseEvent(t,t._previousMode,re.SCENE3D,o)}}function eFe(e){return function(t){let n=t._scene;n._mode=re.SCENE2D,n.morphTime=re.getMorphTime(re.SCENE2D),eW(t);let i=n.camera;h.clone(e.position,i.position),i.position.z=n.ellipsoid.maximumRadius*2,h.clone(e.direction,i.direction),h.clone(e.up,i.up),h.cross(i.direction,i.up,i.right),h.normalize(i.right,i.right),i.frustum=e.frustum.clone();let r=l(t._completeMorph);t._completeMorph=void 0,n.camera.update(n.mode),t._scene.morphComplete.raiseEvent(t,t._previousMode,re.SCENE2D,r)}}function WBt(e){return function(t){let n=t._scene;n._mode=re.COLUMBUS_VIEW,n.morphTime=re.getMorphTime(re.COLUMBUS_VIEW),eW(t);let i=n.camera;(t._previousModeMode!==re.MORPHING||t._morphCancelled)&&(t._morphCancelled=!1,h.clone(e.position,i.position),h.clone(e.direction,i.direction),h.clone(e.up,i.up),h.cross(i.direction,i.up,i.right),h.normalize(i.right,i.right));let r=i.frustum;n.frameState.useLogDepth&&(r.near=.1,r.far=1e10);let o=l(t._completeMorph);t._completeMorph=void 0,n.camera.update(n.mode),t._scene.morphComplete.raiseEvent(t,t._previousMode,re.COLUMBUS_VIEW,o)}}var EV=AC;var tFe={LEFT_DRAG:0,RIGHT_DRAG:1,MIDDLE_DRAG:2,WHEEL:3,PINCH:4};Object.freeze(tFe);var cr=tFe;var sFe=[to.SHIFT,to.CTRL,to.ALT,[to.SHIFT,to.CTRL],[to.SHIFT,to.ALT],[to.CTRL,to.ALT],[to.SHIFT,to.CTRL,to.ALT]];function Qa(e,t){if(!l(t))return`${e}`;let n=Array.isArray(t)?t.toSorted():[t];return`${e}+${n.join("+")}`}function qBt(e,t){U.clone(e.distance.startPosition,t.distance.startPosition),U.clone(e.distance.endPosition,t.distance.endPosition),U.clone(e.angleAndHeight.startPosition,t.angleAndHeight.startPosition),U.clone(e.angleAndHeight.endPosition,t.angleAndHeight.endPosition)}function nFe(e,t,n){let i=Qa(cr.PINCH,t),r=e._update,o=e._isDown,s=e._eventStartPosition,a=e._pressTime,c=e._releaseTime;r[i]=!0,o[i]=!1,s[i]=new U;let u=e._movement[i];l(u)||(u=e._movement[i]={}),u.distance={startPosition:new U,endPosition:new U},u.angleAndHeight={startPosition:new U,endPosition:new U},u.prevAngle=0,e._eventHandler.setInputAction(function(f){e._buttonsDown++,o[i]=!0,a[i]=new Date,U.lerp(f.position1,f.position2,.5,s[i])},un.PINCH_START,t),e._eventHandler.setInputAction(function(){e._buttonsDown=Math.max(e._buttonsDown-1,0),o[i]=!1,c[i]=new Date},un.PINCH_END,t),e._eventHandler.setInputAction(function(f){if(o[i]){r[i]?(qBt(f,u),r[i]=!1,u.prevAngle=u.angleAndHeight.startPosition.x):(U.clone(f.distance.endPosition,u.distance.endPosition),U.clone(f.angleAndHeight.endPosition,u.angleAndHeight.endPosition));let d=u.angleAndHeight.endPosition.x,p=u.prevAngle,g=Math.PI*2;for(;d>=p+Math.PI;)d-=g;for(;d<p-Math.PI;)d+=g;u.angleAndHeight.endPosition.x=-d*n.clientWidth/12,u.angleAndHeight.startPosition.x=-p*n.clientWidth/12}},un.PINCH_MOVE,t)}function iFe(e,t){let n=Qa(cr.WHEEL,t),i=e._pressTime,r=e._releaseTime,o=e._update;o[n]=!0;let s=e._movement[n];l(s)||(s=e._movement[n]={});let a=e._lastMovement[n];l(a)||(a=e._lastMovement[n]={startPosition:new U,endPosition:new U,valid:!1}),s.startPosition=new U,U.clone(U.ZERO,s.startPosition),s.endPosition=new U,e._eventHandler.setInputAction(function(c){let u=7.5*D.toRadians(c);i[n]=r[n]=new Date,s.endPosition.x=0,s.endPosition.y=u,U.clone(s.endPosition,a.endPosition),a.valid=!0,o[n]=!1},un.WHEEL,t)}function TP(e,t,n){let i=Qa(n,t),r=e._isDown,o=e._eventStartPosition,s=e._pressTime;r[i]=!1,o[i]=new U;let a=e._lastMovement[i];l(a)||(a=e._lastMovement[i]={startPosition:new U,endPosition:new U,valid:!1});let c,u;n===cr.LEFT_DRAG?(c=un.LEFT_DOWN,u=un.LEFT_UP):n===cr.RIGHT_DRAG?(c=un.RIGHT_DOWN,u=un.RIGHT_UP):n===cr.MIDDLE_DRAG&&(c=un.MIDDLE_DOWN,u=un.MIDDLE_UP),e._eventHandler.setInputAction(function(f){e._buttonsDown++,a.valid=!1,r[i]=!0,s[i]=new Date,U.clone(f.position,o[i])},c,t),e._eventHandler.setInputAction(function(){dse(Qa(n,void 0),e);for(let f of sFe){let d=Qa(n,f);dse(d,e)}},u,t)}function dse(e,t){let n=t._releaseTime,i=t._isDown;i[e]&&(t._buttonsDown=Math.max(t._buttonsDown-1,0)),i[e]=!1,n[e]=new Date}function rFe(e,t){U.clone(e.startPosition,t.startPosition),U.clone(e.endPosition,t.endPosition)}function YBt(e,t,n){let i=n._isDown,r=!1,o=Qa(e,t);for(let[c,u]of Object.entries(i))c.startsWith(e)&&u&&c!==o&&(r=!0,dse(c,n));if(!r)return;let s=n._pressTime,a=n._lastMovement[o];l(a)||(a=n._lastMovement[o]={startPosition:new U,endPosition:new U,valid:!1}),n._buttonsDown++,a.valid=!1,i[o]=!0,s[o]=new Date}function oFe(e,t){let n=e._update,i=e._movement,r=e._lastMovement,o=e._isDown;for(let s in cr)if(cr.hasOwnProperty(s)){let a=cr[s];if(l(a)){let c=Qa(a,t);n[c]=!0,l(e._lastMovement[c])||(e._lastMovement[c]={startPosition:new U,endPosition:new U,valid:!1}),l(e._movement[c])||(e._movement[c]={startPosition:new U,endPosition:new U})}}e._eventHandler.setInputAction(function(s){for(let a in cr)if(cr.hasOwnProperty(a)){let c=cr[a];if(l(c)){let u=Qa(c,t);YBt(c,t,e),o[u]&&(n[u]?(rFe(i[u],r[u]),r[u].valid=!0,rFe(s,i[u]),n[u]=!1):U.clone(s.endPosition,i[u].endPosition))}}U.clone(s.endPosition,e._currentMousePosition)},un.MOUSE_MOVE,t)}function Ih(e){this._eventHandler=new ca(e),this._update={},this._movement={},this._lastMovement={},this._isDown={},this._eventStartPosition={},this._pressTime={},this._releaseTime={},this._buttonsDown=0,this._currentMousePosition=new U,iFe(this,void 0),nFe(this,void 0,e),TP(this,void 0,cr.LEFT_DRAG),TP(this,void 0,cr.RIGHT_DRAG),TP(this,void 0,cr.MIDDLE_DRAG),oFe(this,void 0);for(let t of sFe)iFe(this,t),nFe(this,t,e),TP(this,t,cr.LEFT_DRAG),TP(this,t,cr.RIGHT_DRAG),TP(this,t,cr.MIDDLE_DRAG),oFe(this,t)}Object.defineProperties(Ih.prototype,{currentMousePosition:{get:function(){return this._currentMousePosition}},anyButtonDown:{get:function(){let e=!this._update[Qa(cr.WHEEL)]||!this._update[Qa(cr.WHEEL,to.SHIFT)]||!this._update[Qa(cr.WHEEL,to.CTRL)]||!this._update[Qa(cr.WHEEL,to.ALT)];return this._buttonsDown>0||e}}});Ih.prototype.isMoving=function(e,t){let n=Qa(e,t);return!this._update[n]};Ih.prototype.getMovement=function(e,t){let n=Qa(e,t);return this._movement[n]};Ih.prototype.getLastMovement=function(e,t){let n=Qa(e,t),i=this._lastMovement[n];if(i.valid)return i};Ih.prototype.isButtonDown=function(e,t){let n=Qa(e,t);return this._isDown[n]};Ih.prototype.getStartMousePosition=function(e,t){if(e===cr.WHEEL)return this._currentMousePosition;let n=Qa(e,t);return this._eventStartPosition[n]};Ih.prototype.getButtonPressTime=function(e,t){let n=Qa(e,t);return this._pressTime[n]};Ih.prototype.getButtonReleaseTime=function(e,t){let n=Qa(e,t);return this._releaseTime[n]};Ih.prototype.reset=function(){for(let e in this._update)this._update.hasOwnProperty(e)&&(this._update[e]=!0)};Ih.prototype.isDestroyed=function(){return!1};Ih.prototype.destroy=function(){return this._eventHandler=this._eventHandler&&this._eventHandler.destroy(),le(this)};var CV=Ih;function tW(e,t,n,i,r,o,s,a,c,u){this._tweens=e,this._tweenjs=t,this._startObject=Je(n),this._stopObject=Je(i),this._duration=r,this._delay=o,this._easingFunction=s,this._update=a,this._complete=c,this.cancel=u,this.needsStart=!0}Object.defineProperties(tW.prototype,{startObject:{get:function(){return this._startObject}},stopObject:{get:function(){return this._stopObject}},duration:{get:function(){return this._duration}},delay:{get:function(){return this._delay}},easingFunction:{get:function(){return this._easingFunction}},update:{get:function(){return this._update}},complete:{get:function(){return this._complete}},tweenjs:{get:function(){return this._tweenjs}}});tW.prototype.cancelTween=function(){this._tweens.remove(this)};function ap(){this._tweens=[]}Object.defineProperties(ap.prototype,{length:{get:function(){return this._tweens.length}}});ap.prototype.add=function(e){if(e=e??H.EMPTY_OBJECT,e.duration===0)return l(e.complete)&&e.complete(),new tW(this);let t=e.duration/kn.SECONDS_PER_MILLISECOND,n=e.delay??0,i=n/kn.SECONDS_PER_MILLISECOND,r=e.easingFunction??Ls.LINEAR_NONE,o=e.startObject,s=new pOe(o);s.to(Je(e.stopObject),t),s.delay(i),s.easing(r),l(e.update)&&s.onUpdate(function(){e.update(o)}),s.onComplete(e.complete??null),s.repeat(e._repeat??0);let a=new tW(this,s,e.startObject,e.stopObject,e.duration,n,r,e.update,e.complete,e.cancel);return this._tweens.push(a),a};ap.prototype.addProperty=function(e){e=e??H.EMPTY_OBJECT;let t=e.object,n=e.property,i=e.startValue,r=e.stopValue;function o(s){t[n]=s.value}return this.add({startObject:{value:i},stopObject:{value:r},duration:e.duration??3,delay:e.delay,easingFunction:e.easingFunction,update:o,complete:e.complete,cancel:e.cancel,_repeat:e._repeat})};ap.prototype.addAlpha=function(e){e=e??H.EMPTY_OBJECT;let t=e.material,n=[];for(let r in t.uniforms)t.uniforms.hasOwnProperty(r)&&l(t.uniforms[r])&&l(t.uniforms[r].alpha)&&n.push(r);function i(r){let o=n.length;for(let s=0;s<o;++s)t.uniforms[n[s]].alpha=r.alpha}return this.add({startObject:{alpha:e.startValue??0},stopObject:{alpha:e.stopValue??1},duration:e.duration??3,delay:e.delay,easingFunction:e.easingFunction,update:i,complete:e.complete,cancel:e.cancel})};ap.prototype.addOffsetIncrement=function(e){e=e??H.EMPTY_OBJECT;let n=e.material.uniforms;return this.addProperty({object:n,property:"offset",startValue:n.offset,stopValue:n.offset+1,duration:e.duration,delay:e.delay,easingFunction:e.easingFunction,update:e.update,cancel:e.cancel,_repeat:1/0})};ap.prototype.remove=function(e){if(!l(e))return!1;let t=this._tweens.indexOf(e);return t!==-1?(e.tweenjs.stop(),l(e.cancel)&&e.cancel(),this._tweens.splice(t,1),!0):!1};ap.prototype.removeAll=function(){let e=this._tweens;for(let t=0;t<e.length;++t){let n=e[t];n.tweenjs.stop(),l(n.cancel)&&n.cancel()}e.length=0};ap.prototype.contains=function(e){return l(e)&&this._tweens.indexOf(e)!==-1};ap.prototype.get=function(e){return this._tweens[e]};ap.prototype.update=function(e){let t=this._tweens,n=0;for(e=l(e)?e/kn.SECONDS_PER_MILLISECOND:xn();n<t.length;){let i=t[n],r=i.tweenjs;if(i.needsStart)i.needsStart=!1,r.start(e);else if(r.update(e))n++;else{if(t[n]?.needsStart)continue;r.stop(),t.splice(n,1)}}};var bC=ap;function SV(e){this.enableInputs=!0,this.enableTranslate=!0,this.enableZoom=!0,this.enableRotate=!0,this.enableTilt=!0,this.enableLook=!0,this.inertiaSpin=.9,this.inertiaTranslate=.9,this.inertiaZoom=.8,this.maximumMovementRatio=.1,this.bounceAnimationTime=3,this.minimumZoomDistance=1,this.maximumZoomDistance=Number.POSITIVE_INFINITY,this.zoomFactor=5,this.translateEventTypes=cr.LEFT_DRAG,this.zoomEventTypes=[cr.RIGHT_DRAG,cr.WHEEL,cr.PINCH],this.rotateEventTypes=cr.LEFT_DRAG,this.tiltEventTypes=[cr.MIDDLE_DRAG,cr.PINCH,{eventType:cr.LEFT_DRAG,modifier:to.CTRL},{eventType:cr.RIGHT_DRAG,modifier:to.CTRL}],this.lookEventTypes={eventType:cr.LEFT_DRAG,modifier:to.SHIFT};let t=e.ellipsoid??ee.default;this.minimumPickingTerrainHeight=ee.WGS84.equals(t)?15e4:t.minimumRadius*.025,this._minimumPickingTerrainHeight=this.minimumPickingTerrainHeight,this.minimumPickingTerrainDistanceWithInertia=ee.WGS84.equals(t)?4e3:t.minimumRadius*63e-5,this.minimumCollisionTerrainHeight=ee.WGS84.equals(t)?15e3:t.minimumRadius*.0025,this._minimumCollisionTerrainHeight=this.minimumCollisionTerrainHeight,this.minimumTrackBallHeight=ee.WGS84.equals(t)?75e5:t.minimumRadius*1.175,this._minimumTrackBallHeight=this.minimumTrackBallHeight,this.enableCollisionDetection=!0,this.maximumTiltAngle=void 0,this._scene=e,this._globe=void 0,this._ellipsoid=t,this._lastGlobeHeight=0,this._aggregator=new CV(e.canvas),this._lastInertiaSpinMovement=void 0,this._lastInertiaZoomMovement=void 0,this._lastInertiaTranslateMovement=void 0,this._lastInertiaTiltMovement=void 0,this._inertiaDisablers={_lastInertiaZoomMovement:["_lastInertiaSpinMovement","_lastInertiaTranslateMovement","_lastInertiaTiltMovement"],_lastInertiaTiltMovement:["_lastInertiaSpinMovement","_lastInertiaTranslateMovement"]},this._tweens=new bC,this._tween=void 0,this._horizontalRotationAxis=void 0,this._tiltCenterMousePosition=new U(-1,-1),this._tiltCenter=new h,this._rotateMousePosition=new U(-1,-1),this._rotateStartPosition=new h,this._strafeStartPosition=new h,this._strafeMousePosition=new U,this._strafeEndMousePosition=new U,this._zoomMouseStart=new U(-1,-1),this._zoomWorldPosition=new h,this._useZoomWorldPosition=!1,this._panLastMousePosition=new U,this._panLastWorldPosition=new h,this._tiltCVOffMap=!1,this._looking=!1,this._rotating=!1,this._strafing=!1,this._zoomingOnVector=!1,this._zoomingUnderground=!1,this._rotatingZoom=!1,this._adjustedHeightForTerrain=!1,this._cameraUnderground=!1;let n=e.mapProjection;this._maxCoord=n.project(new he(Math.PI,D.PI_OVER_TWO)),this._rotateFactor=void 0,this._rotateRateRangeAdjustment=void 0,this._maximumRotateRate=1.77,this._minimumRotateRate=1/5e3,this._minimumZoomRate=20,this._maximumZoomRate=5906376272e3,this._minimumUndergroundPickDistance=2e3,this._maximumUndergroundPickDistance=1e4}function XBt(e,t){if(e<0)return 0;let n=(1-t)*25;return Math.exp(-n*e)}function KBt(e){return U.equalsEpsilon(e.startPosition,e.endPosition,D.EPSILON14)}var $Bt=.4;function JBt(e,t,n,i,r,o,s){let a=o[s];l(a)||(a=o[s]={startPosition:new U,endPosition:new U,motion:new U,inertiaEnabled:!0});let c=e.getButtonPressTime(t,n),u=e.getButtonReleaseTime(t,n),f=c&&u&&(u.getTime()-c.getTime())/1e3,p=u&&(new Date().getTime()-u.getTime())/1e3;if(c&&u&&f<$Bt){let g=XBt(p,i),m=e.getLastMovement(t,n);if(!l(m)||KBt(m)||!a.inertiaEnabled||(a.motion.x=(m.endPosition.x-m.startPosition.x)*.5,a.motion.y=(m.endPosition.y-m.startPosition.y)*.5,a.startPosition=U.clone(m.startPosition,a.startPosition),a.endPosition=U.multiplyByScalar(a.motion,g,a.endPosition),a.endPosition=U.add(a.startPosition,a.endPosition,a.endPosition),isNaN(a.endPosition.x)||isNaN(a.endPosition.y)||U.distance(a.startPosition,a.endPosition)<.5))return;if(!e.isButtonDown(t,n)){let y=e.getStartMousePosition(t,n);r(o,y,a)}}}function ZBt(e,t){if(l(t)){let n=e[t];l(n)&&(n.inertiaEnabled=!0);let i=e._inertiaDisablers[t];if(l(i)){let r=i.length;for(let o=0;o<r;++o)n=e[i[o]],l(n)&&(n.inertiaEnabled=!1)}}}var aFe=[];function xu(e,t,n,i,r,o){if(!l(n))return;let s=e._aggregator;Array.isArray(n)||(aFe[0]=n,n=aFe);let a=n.length;for(let c=0;c<a;++c){let u=n[c],f=l(u.eventType)?u.eventType:u,d=u.modifier,p=s.isMoving(f,d)&&s.getMovement(f,d),g=s.getStartMousePosition(f,d);e.enableInputs&&t&&(p?(i(e,g,p),ZBt(e,o)):r<1&&JBt(s,f,d,r,i,e,o))}}var nW=new pn,QBt=new h,e2t=new U,t2t=new h,n2t=new U,i2t=new h,r2t=new h,o2t=new h,s2t=new h,AFe=new h,a2t=new h,c2t=new h,l2t=new h,u2t=new h,f2t=new h,d2t=new h,h2t=new h,m2t=new h,p2t=new h,g2t=new h,xC=new h,cFe=new h,lFe=new h,hse={orientation:new wc};function xse(e,t,n,i,r,o){let s=1;l(o)&&(s=D.clamp(Math.abs(o),.25,1));let a=n.endPosition.y-n.startPosition.y,u=a>0?e.minimumZoomDistance*s:0,f=e.maximumZoomDistance,d=r-u,p=i*d;p=D.clamp(p,e._minimumZoomRate,e._maximumZoomRate);let g=a/e._scene.canvas.clientHeight;g=Math.min(g,e.maximumMovementRatio);let m=p*g;if(e.enableCollisionDetection||e.minimumZoomDistance===0||!l(e._globe)){if(m>0&&Math.abs(r-u)<1||m<0&&Math.abs(r-f)<1)return;r-m<u?m=r-u-1:r-m>f&&(m=r-f)}let y=e._scene,A=y.camera,b=y.mode,x=hse.orientation;x.heading=A.heading,x.pitch=A.pitch,x.roll=A.roll;let T=n.inertiaEnabled??U.equals(t,e._zoomMouseStart),E=e._zoomingOnVector,v=e._rotatingZoom,S;if(T||(e._zoomMouseStart=U.clone(t,e._zoomMouseStart),l(e._globe)&&b===re.SCENE2D?(S=A.getPickRay(t,nW).origin,S=h.fromElements(S.y,S.z,S.x)):l(e._globe)&&(S=ly(e,t,QBt)),l(S)?(e._useZoomWorldPosition=!0,e._zoomWorldPosition=h.clone(S,e._zoomWorldPosition)):e._useZoomWorldPosition=!1,E=e._zoomingOnVector=!1,v=e._rotatingZoom=!1,e._zoomingUnderground=e._cameraUnderground),!e._useZoomWorldPosition){A.zoomIn(m);return}let I=b===re.COLUMBUS_VIEW;if(A.positionCartographic.height<2e6&&(v=!0),!T||v){if(b===re.SCENE2D){let R=e._zoomWorldPosition,O=A.position;if(!h.equals(R,O)&&A.positionCartographic.height<e._maxCoord.x*2){let L=A.position.x,_=h.subtract(R,O,t2t);h.normalize(_,_);let C=h.distance(R,O)*m/(A.getMagnitude()*.5);A.move(_,C*.5),(A.position.x<0&&L>0||A.position.x>0&&L<0)&&(S=A.getPickRay(t,nW).origin,S=h.fromElements(S.y,S.z,S.x),e._zoomWorldPosition=h.clone(S,e._zoomWorldPosition))}}else if(b===re.SCENE3D){let R=h.normalize(A.position,AFe);if(e._cameraUnderground||e._zoomingUnderground||A.positionCartographic.height<3e3&&Math.abs(h.dot(A.direction,R))<.6)I=!0;else{let O=y.canvas,L=n2t;L.x=O.clientWidth/2,L.y=O.clientHeight/2;let _=ly(e,L,i2t);if(!l(_))I=!0;else if(A.positionCartographic.height<1e6)if(h.dot(A.direction,R)>=-.5)I=!0;else{let C=c2t;h.clone(A.position,C);let w=e._zoomWorldPosition,P=a2t;if(P=h.normalize(w,P),h.dot(P,R)<0)return;let M=g2t,F=f2t;h.clone(A.direction,F),h.add(C,h.multiplyByScalar(F,1e3,xC),M);let V=d2t,B=h2t;h.subtract(w,C,V),h.normalize(V,B);let j=h.dot(R,B);if(j>=0){e._zoomMouseStart.x=-1;return}let k=Math.acos(-j),G=h.magnitude(C),q=h.magnitude(w),Q=G-m,W=h.magnitude(V),J=Math.asin(D.clamp(W/q*Math.sin(k),-1,1)),Z=Math.asin(D.clamp(Q/q*Math.sin(k),-1,1)),ae=J-Z+k,Ae=l2t;h.normalize(C,Ae);let fe=u2t;fe=h.cross(B,Ae,fe),fe=h.normalize(fe,fe),h.normalize(h.cross(Ae,fe,xC),F),h.multiplyByScalar(h.normalize(M,xC),h.magnitude(M)-m,M),h.normalize(C,C),h.multiplyByScalar(C,Q,C);let xe=m2t;h.multiplyByScalar(h.add(h.multiplyByScalar(Ae,Math.cos(ae)-1,cFe),h.multiplyByScalar(F,Math.sin(ae),lFe),xC),Q,xe),h.add(C,xe,C),h.normalize(M,Ae),h.normalize(h.cross(Ae,fe,xC),F);let ge=p2t;h.multiplyByScalar(h.add(h.multiplyByScalar(Ae,Math.cos(ae)-1,cFe),h.multiplyByScalar(F,Math.sin(ae),lFe),xC),h.magnitude(M),ge),h.add(M,ge,M),h.clone(C,A.position),h.normalize(h.subtract(M,C,xC),A.direction),h.clone(A.direction,A.direction),h.cross(A.direction,A.up,A.right),h.cross(A.right,A.direction,A.up),A.setView(hse);return}else{let C=h.normalize(_,r2t),w=h.normalize(e._zoomWorldPosition,o2t),P=h.dot(w,C);if(P>0&&P<1){let M=D.acosClamped(P),F=h.cross(w,C,s2t),V=Math.abs(M)>D.toRadians(20)?A.positionCartographic.height*.75:A.positionCartographic.height-m,B=m/V;A.rotate(F,M*B)}}}}e._rotatingZoom=!I}if(!T&&I||E){let R,O=dr.worldToWindowCoordinates(y,e._zoomWorldPosition,e2t);b!==re.COLUMBUS_VIEW&&U.equals(t,e._zoomMouseStart)&&l(O)?R=A.getPickRay(O,nW):R=A.getPickRay(t,nW);let L=R.direction;(b===re.COLUMBUS_VIEW||b===re.SCENE2D)&&h.fromElements(L.y,L.z,L.x,L),A.move(L,m),e._zoomingOnVector=!0}else A.zoomIn(m);e._cameraUnderground||A.setView(hse)}var _2t=new pn,y2t=new pn,A2t=new h;function b2t(e,t,n){let r=e._scene.camera,o=r.getPickRay(n.startPosition,_2t).origin,s=r.getPickRay(n.endPosition,y2t).origin;o=h.fromElements(o.y,o.z,o.x,o),s=h.fromElements(s.y,s.z,s.x,s);let a=h.subtract(o,s,A2t),c=h.magnitude(a);c>0&&(h.normalize(a,a),r.move(a,c))}function uFe(e,t,n){l(n.distance)&&(n=n.distance);let r=e._scene.camera;xse(e,t,n,e.zoomFactor,r.getMagnitude())}var x2t=new U,T2t=new U;function fFe(e,t,n){if(l(n.angleAndHeight)){E2t(e,t,n.angleAndHeight);return}let i=e._scene,r=i.camera,o=i.canvas,s=o.clientWidth,a=o.clientHeight,c=x2t;c.x=2/s*n.startPosition.x-1,c.y=2/a*(a-n.startPosition.y)-1,c=U.normalize(c,c);let u=T2t;u.x=2/s*n.endPosition.x-1,u.y=2/a*(a-n.endPosition.y)-1,u=U.normalize(u,u);let f=D.acosClamped(c.x);c.y<0&&(f=D.TWO_PI-f);let d=D.acosClamped(u.x);u.y<0&&(d=D.TWO_PI-d);let p=d-f;r.twistRight(p)}function E2t(e,t,n){let i=e._rotateFactor*e._rotateRateRangeAdjustment;i>e._maximumRotateRate&&(i=e._maximumRotateRate),i<e._minimumRotateRate&&(i=e._minimumRotateRate);let r=e._scene,o=r.camera,s=r.canvas,a=(n.endPosition.x-n.startPosition.x)/s.clientWidth;a=Math.min(a,e.maximumMovementRatio);let c=i*a*Math.PI*4;o.twistRight(c)}function C2t(e){let t=e._scene.mapMode2D===Au.ROTATE;N.equals(N.IDENTITY,e._scene.camera.transform)?(xu(e,e.enableTranslate,e.translateEventTypes,b2t,e.inertiaTranslate,"_lastInertiaTranslateMovement"),xu(e,e.enableZoom,e.zoomEventTypes,uFe,e.inertiaZoom,"_lastInertiaZoomMovement"),t&&xu(e,e.enableRotate,e.tiltEventTypes,fFe,e.inertiaSpin,"_lastInertiaTiltMovement")):(xu(e,e.enableZoom,e.zoomEventTypes,uFe,e.inertiaZoom,"_lastInertiaZoomMovement"),t&&xu(e,e.enableRotate,e.translateEventTypes,fFe,e.inertiaSpin,"_lastInertiaSpinMovement"))}var bFe=new pn,v2t=new h,S2t=new h;function ly(e,t,n){let i=e._scene,r=e._globe,o=i.camera,s;if(i.pickPositionSupported&&(s=i.pickPositionWorldCoordinates(t,v2t)),!l(r))return h.clone(s,n);let a=!e._cameraUnderground,c=o.getPickRay(t,bFe),u=r.pickWorldCoordinates(c,i,a,S2t),f=l(s)?h.distance(s,o.positionWC):Number.POSITIVE_INFINITY,d=l(u)?h.distance(u,o.positionWC):Number.POSITIVE_INFINITY;return f<d?h.clone(s,n):h.clone(u,n)}var w2t=new he;function lW(e){let t=e._ellipsoid,n=e._scene,i=n.camera,r=n.mode,o=0;if(r===re.SCENE3D){let c=t.cartesianToCartographic(i.position,w2t);l(c)&&(o=c.height)}else o=i.position.z;let s=e._scene.globeHeight??0;return Math.abs(s-o)}var I2t=new h;function xFe(e,t){let n=t.origin,i=t.direction,r=lW(e),o=h.normalize(n,I2t),s=Math.abs(h.dot(o,i));return s=Math.max(s,.5)*2,r*s}function TFe(e,t,n,i){let r=h.distance(t.origin,n),o=lW(e),s=D.clamp(o*5,e._minimumUndergroundPickDistance,e._maximumUndergroundPickDistance);return r>s&&(r=Math.min(r,o/5),r=Math.max(r,100)),pn.getPoint(t,r,i)}function EFe(e,t,n,i){let r;return l(n)?(r=h.distance(t.origin,n),r>e._maximumUndergroundPickDistance&&(r=lW(e))):r=lW(e),pn.getPoint(t,r,i)}var P2t=new U;function CFe(e,t){let n=t.endPosition,i=U.subtract(t.endPosition,t.startPosition,P2t),r=e._strafeEndMousePosition;U.add(r,i,r),t.endPosition=r,Tse(e,t,e._strafeStartPosition),t.endPosition=n}var dFe=new pn,D2t=new pn,mse=new h,R2t=new h,O2t=new h,M2t=new h,N2t=new sn(h.UNIT_X,0),L2t=new U,F2t=new U;function B2t(e,t,n){if(h.equals(t,e._translateMousePosition)||(e._looking=!1),h.equals(t,e._strafeMousePosition)||(e._strafing=!1),e._looking){pd(e,t,n);return}if(e._strafing){CFe(e,n);return}let r=e._scene.camera,o=e._cameraUnderground,s=U.clone(n.startPosition,L2t),a=U.clone(n.endPosition,F2t),c=r.getPickRay(s,dFe),u=h.clone(h.ZERO,M2t),f=h.UNIT_X,d;if(r.position.z<e._minimumPickingTerrainHeight&&(d=ly(e,s,mse),l(d)&&(u.x=d.x)),o||u.x>r.position.z&&l(d)){let T=d;o&&(T=EFe(e,c,d,mse)),U.clone(t,e._strafeMousePosition),U.clone(t,e._strafeEndMousePosition),h.clone(T,e._strafeStartPosition),e._strafing=!0,Tse(e,n,e._strafeStartPosition);return}let p=sn.fromPointNormal(u,f,N2t);c=r.getPickRay(s,dFe);let g=_i.rayPlane(c,p,mse),m=r.getPickRay(a,D2t),y=_i.rayPlane(m,p,R2t);if(!l(g)||!l(y)){e._looking=!0,pd(e,t,n),U.clone(t,e._translateMousePosition);return}let A=h.subtract(g,y,O2t),b=A.x;A.x=A.y,A.y=A.z,A.z=b;let x=h.magnitude(A);x>D.EPSILON6&&(h.normalize(A,A),r.move(A,x))}var vFe=new U,oW=new pn,sW=new h,k2t=new h,SFe=new N,U2t=new N,z2t=new h,V2t=new sn(h.UNIT_X,0),pse=new h,yse=new he,wFe=new N,j2t=new Le,H2t=new $,aW=new h;function G2t(e,t,n){if(l(n.angleAndHeight)&&(n=n.angleAndHeight),U.equals(t,e._tiltCenterMousePosition)||(e._tiltCVOffMap=!1,e._looking=!1),e._looking){pd(e,t,n);return}let r=e._scene.camera;e._tiltCVOffMap||!e.onMap()||Math.abs(r.position.z)>e._minimumPickingTerrainHeight?(e._tiltCVOffMap=!0,W2t(e,t,n)):q2t(e,t,n)}function W2t(e,t,n){let i=e._scene,r=i.camera,o=i.canvas,s=vFe;s.x=o.clientWidth/2,s.y=o.clientHeight/2;let a=r.getPickRay(s,oW),c=h.UNIT_X,u=a.origin,f=a.direction,d,p=h.dot(c,f);if(Math.abs(p)>D.EPSILON6&&(d=-h.dot(c,u)/p),!l(d)||d<=0){e._looking=!0,pd(e,t,n),U.clone(t,e._tiltCenterMousePosition);return}let g=h.multiplyByScalar(f,d,sW);h.add(u,g,g);let m=i.mapProjection,y=m.ellipsoid;h.fromElements(g.y,g.z,g.x,g);let A=m.unproject(g,yse);y.cartographicToCartesian(A,g);let b=At.eastNorthUpToFixedFrame(g,y,SFe),x=e._globe,T=e._ellipsoid;e._globe=void 0,e._ellipsoid=ee.UNIT_SPHERE,e._rotateFactor=1,e._rotateRateRangeAdjustment=1;let E=N.clone(r.transform,wFe);r._setTransform(b),md(e,t,n,h.UNIT_Z),r._setTransform(E),e._globe=x,e._ellipsoid=T;let v=T.maximumRadius;e._rotateFactor=1/v,e._rotateRateRangeAdjustment=v}function q2t(e,t,n){let i=e._scene,r=i.camera,o=e._cameraUnderground,s,a,c=h.UNIT_X;if(U.equals(t,e._tiltCenterMousePosition))s=h.clone(e._tiltCenter,sW);else{if(r.position.z<e._minimumPickingTerrainHeight&&(s=ly(e,t,sW)),!l(s)){a=r.getPickRay(t,oW);let _=a.origin,C=a.direction,w,P=h.dot(c,C);if(Math.abs(P)>D.EPSILON6&&(w=-h.dot(c,_)/P),!l(w)||w<=0){e._looking=!0,pd(e,t,n),U.clone(t,e._tiltCenterMousePosition);return}s=h.multiplyByScalar(C,w,sW),h.add(_,s,s)}o&&(l(a)||(a=r.getPickRay(t,oW)),TFe(e,a,s,s)),U.clone(t,e._tiltCenterMousePosition),h.clone(s,e._tiltCenter)}let u=i.canvas,f=vFe;f.x=u.clientWidth/2,f.y=e._tiltCenterMousePosition.y,a=r.getPickRay(f,oW);let d=h.clone(h.ZERO,z2t);d.x=s.x;let p=sn.fromPointNormal(d,c,V2t),g=_i.rayPlane(a,p,k2t),m=r._projection,y=m.ellipsoid;h.fromElements(s.y,s.z,s.x,s);let A=m.unproject(s,yse);y.cartographicToCartesian(A,s);let b=At.eastNorthUpToFixedFrame(s,y,SFe),x;l(g)?(h.fromElements(g.y,g.z,g.x,g),A=m.unproject(g,yse),y.cartographicToCartesian(A,g),x=At.eastNorthUpToFixedFrame(g,y,U2t)):x=b;let T=e._globe,E=e._ellipsoid;e._globe=void 0,e._ellipsoid=ee.UNIT_SPHERE,e._rotateFactor=1,e._rotateRateRangeAdjustment=1;let v=h.UNIT_Z,S=N.clone(r.transform,wFe);r._setTransform(b);let I=h.cross(h.UNIT_Z,h.normalize(r.position,pse),pse),R=h.dot(r.right,I);if(md(e,t,n,v,!1,!0),r._setTransform(x),R<0){let _=n.startPosition.y-n.endPosition.y;(o&&_<0||!o&&_>0)&&(v=void 0);let C=r.constrainedAxis;r.constrainedAxis=void 0,md(e,t,n,v,!0,!1),r.constrainedAxis=C}else md(e,t,n,v,!0,!1);if(l(r.constrainedAxis)){let _=h.cross(r.direction,r.constrainedAxis,aW);h.equalsEpsilon(_,h.ZERO,D.EPSILON6)||(h.dot(_,r.right)<0&&h.negate(_,_),h.cross(_,r.direction,r.up),h.cross(r.direction,r.up,r.right),h.normalize(r.up,r.up),h.normalize(r.right,r.right))}r._setTransform(S),e._globe=T,e._ellipsoid=E;let O=E.maximumRadius;e._rotateFactor=1/O,e._rotateRateRangeAdjustment=O;let L=h.clone(r.positionWC,pse);if(e.enableCollisionDetection&&vse(e,!0),!h.equals(r.positionWC,L)){r._setTransform(x),r.worldToCameraCoordinatesPoint(L,L);let _=h.magnitudeSquared(L);h.magnitudeSquared(r.position)>_&&(h.normalize(r.position,r.position),h.multiplyByScalar(r.position,Math.sqrt(_),r.position));let C=h.angleBetween(L,r.position),w=h.cross(L,r.position,L);h.normalize(w,w);let P=Le.fromAxisAngle(w,C,j2t),M=$.fromQuaternion(P,H2t);$.multiplyByVector(M,r.direction,r.direction),$.multiplyByVector(M,r.up,r.up),h.cross(r.direction,r.up,r.right),h.cross(r.right,r.direction,r.up),r._setTransform(S)}}var IFe=new U,PFe=new pn,DFe=new h;function Y2t(e,t,n){l(n.distance)&&(n=n.distance);let i=e._scene,r=i.camera,o=i.canvas,s=e._cameraUnderground,a;s?a=t:(a=IFe,a.x=o.clientWidth/2,a.y=o.clientHeight/2);let c=r.getPickRay(a,PFe),u=c.origin,f=c.direction,d=r.position.z,p;d<e._minimumPickingTerrainHeight&&(p=ly(e,a,DFe));let g;if(l(p)&&(g=h.distance(u,p)),s){let m=xFe(e,c,d);l(g)?g=Math.min(g,m):g=m}if(!l(g)){let m=h.UNIT_X;g=-h.dot(m,u)/h.dot(m,f)}xse(e,t,n,e.zoomFactor,g)}function X2t(e){let n=e._scene.camera;if(!N.equals(N.IDENTITY,n.transform))xu(e,e.enableRotate,e.rotateEventTypes,md,e.inertiaSpin,"_lastInertiaSpinMovement"),xu(e,e.enableZoom,e.zoomEventTypes,OFe,e.inertiaZoom,"_lastInertiaZoomMovement");else{let i=e._tweens;if(e._aggregator.anyButtonDown&&i.removeAll(),xu(e,e.enableTilt,e.tiltEventTypes,G2t,e.inertiaSpin,"_lastInertiaTiltMovement"),xu(e,e.enableTranslate,e.translateEventTypes,B2t,e.inertiaTranslate,"_lastInertiaTranslateMovement"),xu(e,e.enableZoom,e.zoomEventTypes,Y2t,e.inertiaZoom,"_lastInertiaZoomMovement"),xu(e,e.enableLook,e.lookEventTypes,pd),!e._aggregator.anyButtonDown&&!i.contains(e._tween)){let r=n.createCorrectPositionTween(e.bounceAnimationTime);l(r)&&(e._tween=i.add(r))}i.update()}}var K2t=new pn,$2t=new sn(h.UNIT_X,0),J2t=new h,Z2t=new h;function Tse(e,t,n){let i=e._scene,r=i.camera,o=r.getPickRay(t.endPosition,K2t),s=h.clone(r.direction,Z2t);i.mode===re.COLUMBUS_VIEW&&h.fromElements(s.z,s.x,s.y,s);let a=sn.fromPointNormal(n,s,$2t),c=_i.rayPlane(o,a,J2t);l(c)&&(s=h.subtract(n,c,s),i.mode===re.COLUMBUS_VIEW&&h.fromElements(s.y,s.z,s.x,s),h.add(r.position,s,r.position))}var hFe=new h,RFe=new he,Ase=new h,bse=new ee,Q2t=new h,ekt=new h,tkt=new h;function nkt(e,t,n){let r=e._scene.camera,o=e._cameraUnderground,s=e._ellipsoid;if(!N.equals(r.transform,N.IDENTITY)){md(e,t,n);return}let a,c,u=s.geodeticSurfaceNormal(r.position,Q2t);if(U.equals(t,e._rotateMousePosition)){if(e._looking)pd(e,t,n,u);else if(e._rotating)md(e,t,n);else if(e._strafing)CFe(e,n);else{if(h.magnitude(r.position)<h.magnitude(e._rotateStartPosition))return;a=h.magnitude(e._rotateStartPosition),c=Ase,c.x=c.y=c.z=a,s=ee.fromCartesian3(c,bse),_se(e,t,n,s)}return}e._looking=!1,e._rotating=!1,e._strafing=!1;let f=s.cartesianToCartographic(r.positionWC,RFe).height,d=e._globe;if(l(d)&&f<e._minimumPickingTerrainHeight){let p=ly(e,n.startPosition,tkt);if(l(p)){let g,m=r.getPickRay(n.startPosition,bFe);if(o)g=!0,EFe(e,m,p,p);else{let y=s.geodeticSurfaceNormal(p,ekt);Math.abs(h.dot(m.direction,y))<.05?g=!0:g=h.magnitude(r.position)<h.magnitude(p)}g?(U.clone(t,e._strafeEndMousePosition),h.clone(p,e._strafeStartPosition),e._strafing=!0,Tse(e,n,e._strafeStartPosition)):(a=h.magnitude(p),c=Ase,c.x=c.y=c.z=a,s=ee.fromCartesian3(c,bse),_se(e,t,n,s),h.clone(p,e._rotateStartPosition))}else e._looking=!0,pd(e,t,n,u)}else l(r.pickEllipsoid(n.startPosition,e._ellipsoid,hFe))?(_se(e,t,n,e._ellipsoid),h.clone(hFe,e._rotateStartPosition)):f>e._minimumTrackBallHeight?(e._rotating=!0,md(e,t,n)):(e._looking=!0,pd(e,t,n,u));U.clone(t,e._rotateMousePosition)}function md(e,t,n,i,r,o){r=r??!1,o=o??!1;let s=e._scene,a=s.camera,c=s.canvas,u=a.constrainedAxis;l(i)&&(a.constrainedAxis=i);let f=h.magnitude(a.position),d=e._rotateFactor*(f-e._rotateRateRangeAdjustment);d>e._maximumRotateRate&&(d=e._maximumRotateRate),d<e._minimumRotateRate&&(d=e._minimumRotateRate);let p=(n.startPosition.x-n.endPosition.x)/c.clientWidth,g=(n.startPosition.y-n.endPosition.y)/c.clientHeight;p=Math.min(p,e.maximumMovementRatio),g=Math.min(g,e.maximumMovementRatio);let m=d*p*Math.PI*2,y=d*g*Math.PI;if(l(i)&&l(e.maximumTiltAngle)){let A=e.maximumTiltAngle,b=h.dot(a.direction,i),x=Math.PI-Math.acos(b)+y;x>A&&(y-=x-A)}r||a.rotateRight(m),o||a.rotateUp(y),a.constrainedAxis=u}var gse=se.clone(se.UNIT_W),mFe=se.clone(se.UNIT_W),iW=new h,EP=new h,rW=new h,pFe=new h,ikt=new U,rkt=new U,okt=new U,skt=new U,akt=new pn;function _se(e,t,n,i){let r=e._scene,o=r.camera,s=U.clone(n.startPosition,ikt),a=U.clone(n.endPosition,rkt),c=i.cartesianToCartographic(o.positionWC,RFe).height,u,f;if(!n.inertiaEnabled&&c<e._minimumPickingTerrainHeight&&(u=h.clone(e._panLastWorldPosition,gse),!l(e._globe)&&!U.equalsEpsilon(s,e._panLastMousePosition)&&(u=ly(e,s,gse)),!l(e._globe)&&l(u))){let d=h.subtract(u,o.positionWC,EP),p=h.multiplyByScalar(o.directionWC,h.dot(o.directionWC,d),EP),g=h.magnitude(p),m=o.frustum.getPixelDimensions(r.drawingBufferWidth,r.drawingBufferHeight,g,r.pixelRatio,skt),y=U.subtract(a,s,okt),A=h.multiplyByScalar(o.rightWC,y.x*m.x,EP),b=h.normalize(o.positionWC,AFe),x=o.getPickRay(a,akt).direction,T=h.subtract(x,h.projectVector(x,o.rightWC,rW),rW),E=h.angleBetween(T,o.directionWC),v=1;l(o.frustum.fov)&&(v=Math.max(Math.tan(E),.1));let S=Math.abs(h.dot(o.directionWC,b)),I=-y.y*m.y*2/Math.sqrt(v)*(1-S),R=h.multiplyByScalar(x,I,rW);S=Math.abs(h.dot(o.upWC,b));let O=h.multiplyByScalar(o.upWC,-y.y*(1-S)*m.y,pFe);f=h.add(u,A,mFe),f=h.add(f,R,f),f=h.add(f,O,f),h.clone(f,e._panLastWorldPosition),U.clone(a,e._panLastMousePosition)}if((!l(u)||!l(f))&&(u=o.pickEllipsoid(s,i,gse),f=o.pickEllipsoid(a,i,mFe)),!l(u)||!l(f)){e._rotating=!0,md(e,t,n);return}if(u=o.worldToCameraCoordinates(u,u),f=o.worldToCameraCoordinates(f,f),l(o.constrainedAxis)){let d=o.constrainedAxis,p=h.mostOrthogonalAxis(d,iW);h.cross(p,d,p),h.normalize(p,p);let g=h.cross(d,p,EP),m=h.magnitude(u),y=h.dot(d,u),A=Math.acos(y/m),b=h.multiplyByScalar(d,y,rW);h.subtract(u,b,b),h.normalize(b,b);let x=h.magnitude(f),T=h.dot(d,f),E=Math.acos(T/x),v=h.multiplyByScalar(d,T,pFe);h.subtract(f,v,v),h.normalize(v,v);let S=Math.acos(h.dot(b,p));h.dot(b,g)<0&&(S=D.TWO_PI-S);let I=Math.acos(h.dot(v,p));h.dot(v,g)<0&&(I=D.TWO_PI-I);let R=S-I,O;h.equalsEpsilon(d,o.position,D.EPSILON2)?O=o.right:O=h.cross(d,o.position,iW);let L=h.cross(d,O,iW),_=h.dot(L,h.subtract(u,d,EP)),C=h.dot(L,h.subtract(f,d,EP)),w;_>0&&C>0?w=E-A:_>0&&C<=0?h.dot(o.position,d)>0?w=-A-E:w=A+E:w=A-E,o.rotateRight(R),o.rotateUp(w)}else{h.normalize(u,u),h.normalize(f,f);let d=h.dot(u,f),p=h.cross(u,f,iW);if(d<1&&!h.equalsEpsilon(p,h.ZERO,D.EPSILON14)){let g=Math.acos(d);o.rotate(p,g)}}}var ckt=new h,lkt=new he,gFe=0;function OFe(e,t,n){l(n.distance)&&(n=n.distance);let i=n.inertiaEnabled,r=e._ellipsoid,o=e._scene,s=o.camera,a=o.canvas,c=e._cameraUnderground,u;c?u=t:(u=IFe,u.x=a.clientWidth/2,u.y=a.clientHeight/2);let f=s.getPickRay(u,PFe),d,p=r.cartesianToCartographic(s.position,lkt).height,g=Math.abs(gFe)<e.minimumPickingTerrainDistanceWithInertia;(i?g:p<e._minimumPickingTerrainHeight)&&(d=ly(e,u,DFe));let y;if(l(d)&&(y=h.distance(f.origin,d)),!l(e._globe)&&l(y)&&s.getMagnitude()<y&&(y=void 0),l(y)&&(gFe=y),c){let b=xFe(e,f,p);l(y)?y=Math.min(y,b):y=b}l(y)||(y=p);let A=h.normalize(s.position,ckt);xse(e,t,n,e.zoomFactor,y,h.dot(A,s.direction))}var MFe=new U,cW=new pn,vV=new h,ukt=new h,NFe=new N,fkt=new N,LFe=new N,dkt=new Le,hkt=new $,Ese=new he,Cse=new h;function mkt(e,t,n){let r=e._scene.camera;if(!N.equals(r.transform,N.IDENTITY))return;if(l(n.angleAndHeight)&&(n=n.angleAndHeight),U.equals(t,e._tiltCenterMousePosition)||(e._tiltOnEllipsoid=!1,e._looking=!1),e._looking){let a=e._ellipsoid.geodeticSurfaceNormal(r.position,Cse);pd(e,t,n,a);return}let s=e._ellipsoid.cartesianToCartographic(r.position,Ese);e._tiltOnEllipsoid||s.height>e._minimumCollisionTerrainHeight?(e._tiltOnEllipsoid=!0,gkt(e,t,n)):_kt(e,t,n)}var pkt=new he;function gkt(e,t,n){let i=e._ellipsoid,r=e._scene,o=r.camera,s=e.minimumZoomDistance*.25,a=i.cartesianToCartographic(o.positionWC,pkt).height;if(a-s-1<D.EPSILON3&&n.endPosition.y-n.startPosition.y<0)return;let c=r.canvas,u=MFe;u.x=c.clientWidth/2,u.y=c.clientHeight/2;let f=o.getPickRay(u,cW),d,p=_i.rayEllipsoid(f,i);if(l(p))d=pn.getPoint(f,p.start,vV);else if(a>e._minimumTrackBallHeight){let x=_i.grazingAltitudeLocation(f,i);if(!l(x))return;let T=i.cartesianToCartographic(x,Ese);T.height=0,d=i.cartographicToCartesian(T,vV)}else{e._looking=!0;let x=e._ellipsoid.geodeticSurfaceNormal(o.position,Cse);pd(e,t,n,x),U.clone(t,e._tiltCenterMousePosition);return}let g=At.eastNorthUpToFixedFrame(d,i,NFe),m=e._globe,y=e._ellipsoid;e._globe=void 0,e._ellipsoid=ee.UNIT_SPHERE,e._rotateFactor=1,e._rotateRateRangeAdjustment=1;let A=N.clone(o.transform,LFe);o._setTransform(g),md(e,t,n,h.UNIT_Z),o._setTransform(A),e._globe=m,e._ellipsoid=y;let b=y.maximumRadius;e._rotateFactor=1/b,e._rotateRateRangeAdjustment=b}function _kt(e,t,n){let i=e._ellipsoid,r=e._scene,o=r.camera,s=e._cameraUnderground,a,c,u;if(U.equals(t,e._tiltCenterMousePosition))a=h.clone(e._tiltCenter,vV);else{if(a=ly(e,t,vV),!l(a)){if(c=o.getPickRay(t,cW),u=_i.rayEllipsoid(c,i),!l(u)){if(i.cartesianToCartographic(o.position,Ese).height<=e._minimumTrackBallHeight){e._looking=!0;let C=e._ellipsoid.geodeticSurfaceNormal(o.position,Cse);pd(e,t,n,C),U.clone(t,e._tiltCenterMousePosition)}return}a=pn.getPoint(c,u.start,vV)}s&&(l(c)||(c=o.getPickRay(t,cW)),TFe(e,c,a,a)),U.clone(t,e._tiltCenterMousePosition),h.clone(a,e._tiltCenter)}let f=r.canvas,d=MFe;d.x=f.clientWidth/2,d.y=e._tiltCenterMousePosition.y,c=o.getPickRay(d,cW);let p=h.magnitude(a),g=h.fromElements(p,p,p,Ase),m=ee.fromCartesian3(g,bse);if(u=_i.rayEllipsoid(c,m),!l(u))return;let y=h.magnitude(c.origin)>p?u.start:u.stop,A=pn.getPoint(c,y,ukt),b=At.eastNorthUpToFixedFrame(a,i,NFe),x=At.eastNorthUpToFixedFrame(A,m,fkt),T=e._globe,E=e._ellipsoid;e._globe=void 0,e._ellipsoid=ee.UNIT_SPHERE,e._rotateFactor=1,e._rotateRateRangeAdjustment=1;let v=h.UNIT_Z,S=N.clone(o.transform,LFe);o._setTransform(x);let I=h.cross(A,o.positionWC,aW);if(h.dot(o.rightWC,I)<0){let _=n.startPosition.y-n.endPosition.y;(s&&_<0||!s&&_>0)&&(v=void 0);let C=o.constrainedAxis;o.constrainedAxis=void 0,md(e,t,n,v,!0,!1),o.constrainedAxis=C}else md(e,t,n,v,!0,!1);if(o._setTransform(b),md(e,t,n,v,!1,!0),l(o.constrainedAxis)){let _=h.cross(o.direction,o.constrainedAxis,aW);h.equalsEpsilon(_,h.ZERO,D.EPSILON6)||(h.dot(_,o.right)<0&&h.negate(_,_),h.cross(_,o.direction,o.up),h.cross(o.direction,o.up,o.right),h.normalize(o.up,o.up),h.normalize(o.right,o.right))}o._setTransform(S),e._globe=T,e._ellipsoid=E;let O=E.maximumRadius;e._rotateFactor=1/O,e._rotateRateRangeAdjustment=O;let L=h.clone(o.positionWC,aW);if(e.enableCollisionDetection&&vse(e,!0),!h.equals(o.positionWC,L)){o._setTransform(x),o.worldToCameraCoordinatesPoint(L,L);let _=h.magnitudeSquared(L);h.magnitudeSquared(o.position)>_&&(h.normalize(o.position,o.position),h.multiplyByScalar(o.position,Math.sqrt(_),o.position));let C=h.angleBetween(L,o.position),w=h.cross(L,o.position,L);h.normalize(w,w);let P=Le.fromAxisAngle(w,C,dkt),M=$.fromQuaternion(P,hkt);$.multiplyByVector(M,o.direction,o.direction),$.multiplyByVector(M,o.up,o.up),h.cross(o.direction,o.up,o.right),h.cross(o.right,o.direction,o.up),o._setTransform(S)}}var ykt=new U,Akt=new U,_Fe=new pn,yFe=new pn,bkt=new h,xkt=new h;function pd(e,t,n,i){let o=e._scene.camera,s=ykt;s.x=n.startPosition.x,s.y=0;let a=Akt;a.x=n.endPosition.x,a.y=0;let c=o.getPickRay(s,_Fe),u=o.getPickRay(a,yFe),f=0,d,p;o.frustum instanceof gn?(d=c.origin,p=u.origin,h.add(o.direction,d,d),h.add(o.direction,p,p),h.subtract(d,o.position,d),h.subtract(p,o.position,p),h.normalize(d,d),h.normalize(p,p)):(d=c.direction,p=u.direction);let g=h.dot(d,p);g<1&&(f=Math.acos(g)),f=n.startPosition.x>n.endPosition.x?-f:f;let m=e._horizontalRotationAxis;if(l(i)?o.look(i,-f):l(m)?o.look(m,-f):o.lookLeft(f),s.x=0,s.y=n.startPosition.y,a.x=0,a.y=n.endPosition.y,c=o.getPickRay(s,_Fe),u=o.getPickRay(a,yFe),f=0,o.frustum instanceof gn?(d=c.origin,p=u.origin,h.add(o.direction,d,d),h.add(o.direction,p,p),h.subtract(d,o.position,d),h.subtract(p,o.position,p),h.normalize(d,d),h.normalize(p,p)):(d=c.direction,p=u.direction),g=h.dot(d,p),g<1&&(f=Math.acos(g)),f=n.startPosition.y>n.endPosition.y?-f:f,i=i??m,l(i)){let y=o.direction,A=h.negate(i,bkt),b=h.equalsEpsilon(y,i,D.EPSILON2),x=h.equalsEpsilon(y,A,D.EPSILON2);if(!b&&!x){g=h.dot(y,i);let T=D.acosClamped(g);f>0&&f>T&&(f=T-D.EPSILON4),g=h.dot(y,A),T=D.acosClamped(g),f<0&&-f>T&&(f=-T+D.EPSILON4);let E=h.cross(i,y,xkt);o.look(E,f)}else(b&&f<0||x&&f>0)&&o.look(o.right,-f)}else o.lookUp(f)}function Tkt(e){xu(e,e.enableRotate,e.rotateEventTypes,nkt,e.inertiaSpin,"_lastInertiaSpinMovement"),xu(e,e.enableZoom,e.zoomEventTypes,OFe,e.inertiaZoom,"_lastInertiaZoomMovement"),xu(e,e.enableTilt,e.tiltEventTypes,mkt,e.inertiaSpin,"_lastInertiaTiltMovement"),xu(e,e.enableLook,e.lookEventTypes,pd)}var Ekt=new N,Ckt=new he;function vse(e,t){e._adjustedHeightForTerrain=!0;let n=e._scene,i=n.mode;if(i===re.SCENE2D||i===re.MORPHING)return;let r=n.camera,o=n.ellipsoid??ee.WGS84,s=n.mapProjection,a,c;N.equals(r.transform,N.IDENTITY)||(a=N.clone(r.transform,Ekt),c=h.magnitude(r.position),r._setTransform(N.IDENTITY));let u=Ckt;i===re.SCENE3D?o.cartesianToCartographic(r.position,u):s.unproject(r.position,u);let f=!1;if(u.height<e._minimumCollisionTerrainHeight){let d=e._scene.globeHeight;if(l(d)){let p=d+e.minimumZoomDistance,g=d-e._lastGlobeHeight,m=g/e._lastGlobeHeight;u.height<p&&(t||Math.abs(m)<=.1)&&(u.height=p,i===re.SCENE3D?o.cartographicToCartesian(u,r.position):s.project(u,r.position),f=!0),t||Math.abs(m)<=.1?e._lastGlobeHeight=d:e._lastGlobeHeight+=g*.1}}l(a)&&(r._setTransform(a),f&&(h.normalize(r.position,r.position),h.negate(r.position,r.direction),h.multiplyByScalar(r.position,Math.max(c,e.minimumZoomDistance),r.position),h.normalize(r.direction,r.direction),h.cross(r.direction,r.up,r.right),h.cross(r.right,r.direction,r.up)))}SV.prototype.onMap=function(){let e=this._scene,t=e.mode,n=e.camera;return t===re.COLUMBUS_VIEW?Math.abs(n.position.x)-this._maxCoord.x<0&&Math.abs(n.position.y)-this._maxCoord.y<0:!0};var vkt=new h,Skt=new h;SV.prototype.update=function(){let e=this._scene,{camera:t,globe:n,mode:i}=e;N.equals(t.transform,N.IDENTITY)?(this._globe=n,this._ellipsoid=e.ellipsoid??ee.default):(this._globe=void 0,this._ellipsoid=ee.UNIT_SPHERE);let{verticalExaggeration:r,verticalExaggerationRelativeHeight:o}=e;this._minimumCollisionTerrainHeight=Ar.getHeight(this.minimumCollisionTerrainHeight,r,o),this._minimumPickingTerrainHeight=Ar.getHeight(this.minimumPickingTerrainHeight,r,o),this._minimumTrackBallHeight=Ar.getHeight(this.minimumTrackBallHeight,r,o),this._cameraUnderground=e.cameraUnderground&&l(this._globe);let s=this._ellipsoid.maximumRadius;this._rotateFactor=1/s,this._rotateRateRangeAdjustment=s,this._adjustedHeightForTerrain=!1;let a=h.clone(t.positionWC,vkt),c=h.clone(t.directionWC,Skt);if(i===re.SCENE2D?C2t(this):i===re.COLUMBUS_VIEW?(this._horizontalRotationAxis=h.UNIT_Z,X2t(this)):i===re.SCENE3D&&(this._horizontalRotationAxis=void 0,Tkt(this)),this.enableCollisionDetection&&!this._adjustedHeightForTerrain){let u=!h.equals(a,t.positionWC)||!h.equals(c,t.directionWC);vse(this,u)}this._aggregator.reset()};SV.prototype.isDestroyed=function(){return!1};SV.prototype.destroy=function(){return this._tweens.removeAll(),this._aggregator=this._aggregator&&this._aggregator.destroy(),le(this)};var wV=SV;function IV(e){let t=new sc(e);t.blendingEnabled=!1,t.scissorTest={enabled:!0,rectangle:new et},t.viewport=new et,this._context=e,this._fb=new ai({depthStencil:!0,pixelDatatype:ze.FLOAT,pixelFormat:Ke.RGBA}),this._passState=t}function wkt(e,t,n,i){let r=Math.max(n,i),o=r*r,s=Math.floor(n*.5),a=Math.floor(i*.5),c=0,u=0,f=0,d=-1,p=[];for(let g=0;g<o;++g){if(-s<=c&&c<=s&&-a<=u&&u<=a){let m=4*((a-u)*n+c+s),y=t[m],A=e.getObjectByPickColor(y);l(A)&&p.push({object:A,isEdge:t[m+1]>0,depth:t[m+2],x:c,y:u})}if(c===u||c<0&&-c===u||c>0&&c===1-u){let m=f;f=-d,d=m}c+=f,u+=d}return p}IV.prototype.begin=function(e,t){let n=this._context,{width:i,height:r}=t;return et.clone(e,this._passState.scissorTest.rectangle),this._fb.update(n,i,r),this._passState.framebuffer=this._fb.framebuffer,this._passState.viewport.width=i,this._passState.viewport.height=r,this._passState};IV.prototype.end=function(e){let t=e.width??1,n=e.height??1,i=this._context,r=i.readPixels({x:e.x,y:e.y,width:t,height:n,pixelDatatype:ze.FLOAT,framebuffer:this._fb.framebuffer});return wkt(i,r,t,n)};IV.prototype.isDestroyed=function(){return!1};IV.prototype.destroy=function(){return this._fb.destroy(),le(this)};var PV=IV;var DV={},Ikt=new et(0,0,3,3),Pkt=new U,Dkt=new U,Rkt=new pn,Okt=new h,Mkt=3,Nkt=.1,FFe=9;function Sse(e){return Math.sqrt(e.x*e.x+e.y*e.y)}function BFe(e){let t=Number.POSITIVE_INFINITY;for(let s of e)!s.isEdge&&Sse(s)<=Mkt&&(t=Math.min(t,s.depth));let n=t*(1+Nkt),i=e.filter(s=>!s.isEdge||s.depth<=n),r=i.some(s=>s.isEdge);return i.filter(s=>s.isEdge===r).reduce((s,a)=>Sse(a)<Sse(s)?a:s)}function kFe(e,t){let n,i=Number.POSITIVE_INFINITY;for(let r of e){if(r.isEdge||r.object!==t)continue;let o=r.x*r.x+r.y*r.y;o<i&&(n=r,i=o)}return n}function wse(e,t,n){let i=Pkt;i.x=t.x+n.x,i.y=t.y+n.y;let r=e.camera.getPickRay(i,Rkt);if(!l(r))return;let o=h.dot(r.direction,e.camera.directionWC);if(o<=0)return;let s=n.depth/o,a=h.multiplyByScalar(r.direction,s,Okt);return h.add(r.origin,a,new h)}DV.snap=function(e,t,n){let i=n?.width??25,r=n?.height??i,{context:o,defaultView:s}=e;if(!o.colorBufferFloat){_t("snap-color-buffer-float","Scene.snap requires the EXT_color_buffer_float extension, which is not supported on this platform.");return}l(s.snapFramebuffer)||(s.snapFramebuffer=new PV(o));let a=s.snapFramebuffer,c=Ikt;$z(e,t,c,i,r,{framebuffer:a,snap:!0});let u=a.end(c);if(Jz(e),u.length===0)return;let f=BFe(u);if(!l(f))return;let d=wse(e,t,f);if(!l(d))return;let p=d;if(f.isEdge){let g=Dkt;g.x=t.x+f.x,g.y=t.y+f.y,$z(e,g,c,FFe,FFe,{framebuffer:a,snap:!0});let m=a.end(c);Jz(e);let y=kFe(m,f.object);p=l(y)?wse(e,g,y):void 0}return{object:f.object,isEdge:f.isEdge,position:d,surfacePosition:p,screenPosition:new U(t.x+f.x,t.y+f.y)}};DV._selectBestHit=BFe;DV._nearestSurfaceHit=kFe;DV._snapHitToWorld=wse;var RV=DV;var OV=`uniform sampler2D colorTexture; +${ez}`;fs.createFXAAStage=function(){return new Ur({name:"czm_FXAA",fragmentShader:GIt,sampleMode:id.LINEAR})};fs.createAcesTonemappingStage=function(e){let t=e?`#define AUTO_EXPOSURE +`:"";return t+=jU,new Ur({name:"czm_aces",fragmentShader:t,uniforms:{autoExposure:void 0,exposure:1}})};fs.createFilmicTonemappingStage=function(e){let t=e?`#define AUTO_EXPOSURE +`:"";return t+=ZU,new Ur({name:"czm_filmic",fragmentShader:t,uniforms:{autoExposure:void 0,exposure:1}})};fs.createPbrNeutralTonemappingStage=function(e){let t=e?`#define AUTO_EXPOSURE +`:"";return t+=QU,new Ur({name:"czm_pbr_neutral",fragmentShader:t,uniforms:{autoExposure:void 0,exposure:1}})};fs.createReinhardTonemappingStage=function(e){let t=e?`#define AUTO_EXPOSURE +`:"";return t+=rz,new Ur({name:"czm_reinhard",fragmentShader:t,uniforms:{autoExposure:void 0,exposure:1}})};fs.createModifiedReinhardTonemappingStage=function(e){let t=e?`#define AUTO_EXPOSURE +`:"";return t+=nz,new Ur({name:"czm_modified_reinhard",fragmentShader:t,uniforms:{white:z.WHITE,autoExposure:void 0,exposure:1}})};fs.createAutoExposureStage=function(){return new sz};fs.createBlackAndWhiteStage=function(){return new Ur({name:"czm_black_and_white",fragmentShader:WU,uniforms:{gradations:5}})};fs.createBrightnessStage=function(){return new Ur({name:"czm_brightness",fragmentShader:YU,uniforms:{brightness:.5}})};fs.createNightVisionStage=function(){return new Ur({name:"czm_night_vision",fragmentShader:iz})};fs.createDepthViewStage=function(){return new Ur({name:"czm_depth_view",fragmentShader:$U})};fs.createLensFlareStage=function(){return new Ur({name:"czm_lens_flare",fragmentShader:tz,uniforms:{dirtTexture:Zt("Assets/Textures/LensFlare/DirtMask.jpg"),starTexture:Zt("Assets/Textures/LensFlare/StarBurst.jpg"),intensity:2,distortion:10,ghostDispersal:.4,haloWidth:.4,dirtAmount:.4,earthRadius:ee.WGS84.maximumRadius}})};var rd=fs;function H_(e){this._collection=e,this._framebuffers=[],this._stageNameToFramebuffer={},this._width=void 0,this._height=void 0,this._updateDependencies=!1}function cz(e){for(;l(e.length);)e=e.get(e.length-1);return e.name}function Ene(e,t,n,i,r){if(!i.enabled||!i._isSupported(t))return r;let o=n[i.name]={};if(l(r)){let a=e.getStageByName(r);o[cz(a)]=!0}let s=i.uniforms;if(l(s)){let a=Object.getOwnPropertyNames(s),c=a.length;for(let u=0;u<c;++u){let f=s[a[u]];if(typeof f=="string"){let d=e.getStageByName(f);l(d)&&(o[cz(d)]=!0)}}}return i.name}function az(e,t,n,i,r){if(l(i.enabled)&&!i.enabled||l(i._isSupported)&&!i._isSupported(t))return r;let o=r,s=!l(i.inputPreviousStageTexture)||i.inputPreviousStageTexture,a=r,c=i.length;for(let d=0;d<c;++d){let p=i.get(d);l(p.length)?a=az(e,t,n,p,r):a=Ene(e,t,n,p,r),s&&(r=a)}let u,f;if(s)for(u=1;u<c;++u)f=cz(i.get(u)),l(n[f])||(n[f]={}),n[f][o]=!0;else for(u=1;u<c;++u){f=cz(i.get(u));let d=n[f];for(let p=0;p<u;++p)d[cz(i.get(p))]=!0}return a}function WIt(e,t){let n={};if(l(e.ambientOcclusion)){let i=e.ambientOcclusion,r=e.bloom,o=e._tonemapping,s=e.fxaa,a=az(e,t,n,i,void 0);a=az(e,t,n,r,a),a=Ene(e,t,n,o,a),a=az(e,t,n,e,a),Ene(e,t,n,s,a)}else az(e,t,n,e,void 0);return n}function qIt(e,t,n){let r=e._collection.getStageByName(t),o=r._textureScale,s=r._forcePowerOfTwo,a=r._pixelFormat,c=r._pixelDatatype,u=r._clearColor,f,d,p=e._framebuffers,g=p.length;for(f=0;f<g;++f){if(d=p[f],o!==d.textureScale||s!==d.forcePowerOfTwo||a!==d.pixelFormat||c!==d.pixelDatatype||!z.equals(u,d.clearColor))continue;let m=d.stages,y=m.length,A=!1;for(let b=0;b<y;++b)if(n[m[b]]){A=!0;break}if(!A)break}return l(d)&&f<g?(d.stages.push(t),d):(d={textureScale:o,forcePowerOfTwo:s,pixelFormat:a,pixelDatatype:c,clearColor:u,stages:[t],buffer:new ai({pixelFormat:a,pixelDatatype:c}),clear:void 0},p.push(d),d)}function YIt(e,t){let n=WIt(e._collection,t);for(let i in n)n.hasOwnProperty(i)&&(e._stageNameToFramebuffer[i]=qIt(e,i,n[i]))}function Cne(e){let t=e._framebuffers,n=t.length;for(let i=0;i<n;++i)t[i].buffer.destroy()}function XIt(e,t){let n=e._width,i=e._height,r=e._framebuffers,o=r.length;for(let s=0;s<o;++s){let a=r[s],c=a.textureScale,u=Math.ceil(n*c),f=Math.ceil(i*c),d=Math.min(u,f);a.forcePowerOfTwo&&(D.isPowerOfTwo(d)||(d=D.nextPowerOfTwo(d)),u=d,f=d),a.buffer.update(t,u,f),a.clear=new li({color:a.clearColor,framebuffer:a.buffer.framebuffer})}}H_.prototype.updateDependencies=function(){this._updateDependencies=!0};H_.prototype.update=function(e){let t=this._collection,n=this._updateDependencies,i=l(t.ambientOcclusion)&&t.ambientOcclusion.enabled&&t.ambientOcclusion._isSupported(e),r=l(t.bloom)&&t.bloom.enabled&&t.bloom._isSupported(e),o=l(t._tonemapping)&&t._tonemapping.enabled&&t._tonemapping._isSupported(e),s=l(t.fxaa)&&t.fxaa.enabled&&t.fxaa._isSupported(e),a=!l(t._activeStages)||t._activeStages.length>0||i||r||o||s;if((n||!a&&this._framebuffers.length>0)&&(Cne(this),this._framebuffers.length=0,this._stageNameToFramebuffer={},this._width=void 0,this._height=void 0),!n&&!a)return;this._framebuffers.length===0&&YIt(this,e);let c=e.drawingBufferWidth,u=e.drawingBufferHeight,f=this._width!==c||this._height!==u;!n&&!f||(this._width=c,this._height=u,this._updateDependencies=!1,Cne(this),XIt(this,e))};H_.prototype.clear=function(e){let t=this._framebuffers;for(let n=0;n<t.length;++n)t[n].clear.execute(e)};H_.prototype.getStageByName=function(e){return this._collection.getStageByName(e)};H_.prototype.getOutputTexture=function(e){return this._collection.getOutputTexture(e)};H_.prototype.getFramebuffer=function(e){let t=this._stageNameToFramebuffer[e];if(l(t))return t.buffer.framebuffer};H_.prototype.isDestroyed=function(){return!1};H_.prototype.destroy=function(){return Cne(this),le(this)};var UE=H_;var gDe={REINHARD:"REINHARD",MODIFIED_REINHARD:"MODIFIED_REINHARD",FILMIC:"FILMIC",ACES:"ACES",PBR_NEUTRAL:"PBR_NEUTRAL"};Object.freeze(gDe);var G_=gDe;var vne=[];function gu(){let e=rd.createFXAAStage(),t=rd.createAmbientOcclusionStage(),n=rd.createBloomStage();this._autoExposureEnabled=!1,this._autoExposure=rd.createAutoExposureStage(),this._exposure=1,this._tonemapping=void 0,this._tonemapper=void 0,this.tonemapper=G_.PBR_NEUTRAL;let i=this._tonemapping;e.enabled=!1,t.enabled=!1,n.enabled=!1,i.enabled=!1;let r=new UE(this),o={},s=vne;for(s.push(e,t,n,i);s.length>0;){let c=s.pop();o[c.name]=c,c._textureCache=r;let u=c.length;if(l(u))for(let f=0;f<u;++f)s.push(c.get(f))}this._stages=[],this._activeStages=[],this._previousActiveStages=[],this._randomTexture=void 0;let a=this;t.uniforms.randomTexture=function(){return a._randomTexture},this._ao=t,this._bloom=n,this._fxaa=e,this._aoEnabled=void 0,this._bloomEnabled=void 0,this._tonemappingEnabled=void 0,this._fxaaEnabled=void 0,this._activeStagesChanged=!1,this._stagesRemoved=!1,this._textureCacheDirty=!1,this._stageNames=o,this._textureCache=r}Object.defineProperties(gu.prototype,{ready:{get:function(){let e=!1,t=this._stages,n=t.length;for(let a=n-1;a>=0;--a){let c=t[a];e=e||c.ready&&c.enabled}let i=this._fxaa,r=this._ao,o=this._bloom,s=this._tonemapping;return e=e||i.ready&&i.enabled,e=e||r.ready&&r.enabled,e=e||o.ready&&o.enabled,e=e||s.ready&&s.enabled,e}},fxaa:{get:function(){return this._fxaa}},ambientOcclusion:{get:function(){return this._ao}},bloom:{get:function(){return this._bloom}},length:{get:function(){return Sne(this),this._stages.length}},outputTexture:{get:function(){let e=this._fxaa;if(e.enabled&&e.ready)return this.getOutputTexture(e.name);let t=this._stages,n=t.length;for(let s=n-1;s>=0;--s){let a=t[s];if(l(a)&&a.ready&&a.enabled)return this.getOutputTexture(a.name)}let i=this._tonemapping;if(i.enabled&&i.ready)return this.getOutputTexture(i.name);let r=this._bloom;if(r.enabled&&r.ready)return this.getOutputTexture(r.name);let o=this._ao;if(o.enabled&&o.ready)return this.getOutputTexture(o.name)}},hasSelected:{get:function(){let e=this._stages.slice();for(;e.length>0;){let t=e.pop();if(!l(t))continue;if(l(t.selected))return!0;let n=t.length;if(l(n))for(let i=0;i<n;++i)e.push(t.get(i))}return!1}},tonemapper:{get:function(){return this._tonemapper},set:function(e){if(this._tonemapper===e)return;l(this._tonemapping)&&(delete this._stageNames[this._tonemapping.name],this._tonemapping.destroy());let t=this._autoExposureEnabled,n;switch(e){case G_.REINHARD:n=rd.createReinhardTonemappingStage(t);break;case G_.MODIFIED_REINHARD:n=rd.createModifiedReinhardTonemappingStage(t);break;case G_.FILMIC:n=rd.createFilmicTonemappingStage(t);break;case G_.PBR_NEUTRAL:n=rd.createPbrNeutralTonemappingStage(t);break;default:n=rd.createAcesTonemappingStage(t);break}if(t){let i=this._autoExposure;n.uniforms.autoExposure=function(){return i.outputTexture}}else n.uniforms.exposure=this._exposure;this._tonemapper=e,this._tonemapping=n,l(this._stageNames)&&(this._stageNames[n.name]=n,n._textureCache=this._textureCache),this._textureCacheDirty=!0}},exposure:{get:function(){return this._exposure},set:function(e){this._tonemapping.uniforms.exposure=e,this._exposure=e}}});function Sne(e){if(!e._stagesRemoved)return;e._stagesRemoved=!1;let t=[],n=e._stages;for(let i=0,r=0;i<n.length;++i){let o=n[i];o&&(o._index=r++,t.push(o))}e._stages=t}gu.prototype.add=function(e){let t=this._stageNames,n=vne;for(n.push(e);n.length>0;){let r=n.pop();t[r.name]=r,r._textureCache=this._textureCache;let o=r.length;if(l(o))for(let s=0;s<o;++s)n.push(r.get(s))}let i=this._stages;return e._index=i.length,i.push(e),this._textureCacheDirty=!0,e};gu.prototype.remove=function(e){if(!this.contains(e))return!1;let t=this._stageNames,n=vne;for(n.push(e);n.length>0;){let i=n.pop();delete t[i.name];let r=i.length;if(l(r))for(let o=0;o<r;++o)n.push(i.get(o))}return this._stages[e._index]=void 0,this._stagesRemoved=!0,this._textureCacheDirty=!0,e._index=void 0,e._textureCache=void 0,e.destroy(),!0};gu.prototype.contains=function(e){return l(e)&&l(e._index)&&e._textureCache===this._textureCache};gu.prototype.get=function(e){return Sne(this),this._stages[e]};gu.prototype.removeAll=function(){let e=this._stages,t=e.length;for(let n=0;n<t;++n)this.remove(e[n]);e.length=0};gu.prototype.getStageByName=function(e){return this._stageNames[e]};gu.prototype.update=function(e,t,n){Sne(this);let i=this._activeStages,r=this._activeStages=this._previousActiveStages;this._previousActiveStages=i;let o=this._stages;r.length=o.length;let s=0;for(let b=0;b<o.length;++b){let x=o[b];x.ready&&x.enabled&&x._isSupported(e)&&(r[s++]=x)}r.length=s;let a=s!==i.length;if(!a){for(let b=0;b<s;++b)if(r[b]!==i[b]){a=!0;break}}let c=this._ao,u=this._bloom,f=this._autoExposure,d=this._tonemapping,p=this._fxaa;d.enabled=n;let g=c.enabled&&c._isSupported(e),m=u.enabled&&u._isSupported(e),y=d.enabled&&d._isSupported(e),A=p.enabled&&p._isSupported(e);if((a||this._textureCacheDirty||g!==this._aoEnabled||m!==this._bloomEnabled||y!==this._tonemappingEnabled||A!==this._fxaaEnabled)&&(this._textureCache.updateDependencies(),this._aoEnabled=g,this._bloomEnabled=m,this._tonemappingEnabled=y,this._fxaaEnabled=A,this._textureCacheDirty=!1),l(this._randomTexture)&&!g&&(this._randomTexture.destroy(),this._randomTexture=void 0),!l(this._randomTexture)&&g){let x=new Uint8Array(196608);for(let T=0;T<196608;T+=3)x[T]=Math.floor(Math.random()*255);this._randomTexture=new Dt({context:e,pixelFormat:Ke.RGB,pixelDatatype:ze.UNSIGNED_BYTE,source:{arrayBufferView:x,width:256,height:256},sampler:new jt({wrapS:hn.REPEAT,wrapT:hn.REPEAT,minificationFilter:Wt.NEAREST,magnificationFilter:Jn.NEAREST})})}this._textureCache.update(e),p.update(e,t),c.update(e,t),u.update(e,t),d.update(e,t),this._autoExposureEnabled&&f.update(e,t);for(let b=0;b<o.length;++b)o[b].update(e,t);s=0;for(let b=0;b<o.length;++b){let x=o[b];x.ready&&x.enabled&&x._isSupported(e)&&s++}a=s!==r.length,a&&this.update(e,t,n)};gu.prototype.clear=function(e){this._textureCache.clear(e),this._autoExposureEnabled&&this._autoExposure.clear(e)};function zE(e){for(;l(e.length);)e=e.get(e.length-1);return e.outputTexture}gu.prototype.getOutputTexture=function(e){let t=this.getStageByName(e);if(l(t))return zE(t)};function I0(e,t,n,i,r){if(l(e.execute)){e.execute(t,n,i,r);return}if(e.inputPreviousStageTexture){I0(e.get(0),t,n,i,r);for(let o=1;o<e.length;++o)I0(e.get(o),t,zE(e.get(o-1)),i,r)}else for(let o=0;o<e.length;++o)I0(e.get(o),t,n,i,r)}gu.prototype.execute=function(e,t,n,i){let r=this._activeStages,o=r.length,s=this._fxaa,a=this._ao,c=this._bloom,u=this._autoExposure,f=this._tonemapping,d=a.enabled&&a._isSupported(e),p=c.enabled&&c._isSupported(e),g=this._autoExposureEnabled,m=f.enabled&&f._isSupported(e),y=s.enabled&&s._isSupported(e);if(!y&&!d&&!p&&!m&&o===0)return;let A=t;d&&a.ready&&(I0(a,e,A,n,i),A=zE(a)),p&&c.ready&&(I0(c,e,A,n,i),A=zE(c)),g&&u.ready&&I0(u,e,A,n,i),m&&f.ready&&(I0(f,e,A,n,i),A=zE(f));let b=A;if(o>0){I0(r[0],e,A,n,i);for(let x=1;x<o;++x)I0(r[x],e,zE(r[x-1]),n,i);b=zE(r[o-1])}y&&s.ready&&I0(s,e,b,n,i)};gu.prototype.copy=function(e,t){if(!l(this._copyColorCommand)){let n=this;this._copyColorCommand=e.createViewportQuadCommand(sf,{uniformMap:{colorTexture:function(){return n.outputTexture}},owner:this})}this._copyColorCommand.framebuffer=t,this._copyColorCommand.execute(e)};gu.prototype.isDestroyed=function(){return!1};gu.prototype.destroy=function(){return this._fxaa.destroy(),this._ao.destroy(),this._bloom.destroy(),this._autoExposure.destroy(),this._tonemapping.destroy(),this.removeAll(),this._textureCache=this._textureCache&&this._textureCache.destroy(),le(this)};var lz=gu;var _De={SHIFT:0,CTRL:1,ALT:2};Object.freeze(_De);var Qr=_De;var yDe={LEFT_DOWN:0,LEFT_UP:1,LEFT_CLICK:2,LEFT_DOUBLE_CLICK:3,RIGHT_DOWN:5,RIGHT_UP:6,RIGHT_CLICK:7,MIDDLE_DOWN:10,MIDDLE_UP:11,MIDDLE_CLICK:12,MOUSE_MOVE:15,WHEEL:16,PINCH_START:17,PINCH_END:18,PINCH_MOVE:19};Object.freeze(yDe);var un=yDe;function hb(e,t,n){let i=e._element;if(i===document)return n.x=t.clientX,n.y=t.clientY,n;let r=i.getBoundingClientRect();return n.x=t.clientX-r.left,n.y=t.clientY-r.top,n}function One(e,t){if(!l(t))return`${e}`;let n=Array.isArray(t)?t.toSorted():[t];return`${e}+${n.join("+")}`}function VE(e){let t=[];if(e.shiftKey&&t.push(Qr.SHIFT),e.ctrlKey&&t.push(Qr.CTRL),e.altKey&&t.push(Qr.ALT),t.length)return t}var Os={LEFT:0,MIDDLE:1,RIGHT:2};function od(e,t,n,i){function r(o){i(e,o)}n.addEventListener(t,r,{capture:!1,passive:!1}),e._removalFunctions.push(function(){n.removeEventListener(t,r,!1)})}function KIt(e){let t=e._element,n=l(t.disableRootEvents)?t:document;dn.supportsPointerEvents()?(od(e,"pointerdown",t,tPt),od(e,"pointerup",t,IDe),od(e,"pointermove",t,nPt),od(e,"pointercancel",t,IDe)):(od(e,"mousedown",t,PDe),od(e,"mouseup",n,DDe),od(e,"mousemove",n,RDe),od(e,"touchstart",t,QIt),od(e,"touchend",n,EDe),od(e,"touchmove",n,ePt),od(e,"touchcancel",n,EDe)),od(e,"dblclick",t,JIt);let i;"onwheel"in t?i="wheel":document.onmousewheel!==void 0?i="mousewheel":i="DOMMouseScroll",od(e,i,t,ZIt)}function $It(e){let t=e._removalFunctions;for(let n=0;n<t.length;++n)t[n]()}var ADe={position:new U};function Mne(e){e._lastSeenTouchEvent=xn()}function Nne(e){return xn()-e._lastSeenTouchEvent>Xm.mouseEmulationIgnoreMilliseconds}function Rne(e,t,n){let i=e.x-t.x,r=e.y-t.y;return Math.sqrt(i*i+r*r)<n}function PDe(e,t){if(!Nne(e))return;let n=t.button;e._buttonDown[n]=!0;let i;if(n===Os.LEFT)i=un.LEFT_DOWN;else if(n===Os.MIDDLE)i=un.MIDDLE_DOWN;else if(n===Os.RIGHT)i=un.RIGHT_DOWN;else return;let r=hb(e,t,e._primaryPosition);U.clone(r,e._primaryStartPosition),U.clone(r,e._primaryPreviousPosition);let o=VE(t),s=e.getInputAction(i,o);l(s)&&(U.clone(r,ADe.position),s(ADe),t.preventDefault())}var bDe={position:new U},xDe={position:new U};function wne(e,t,n,i){let r=VE(i),o=e.getInputAction(t,r),s=e.getInputAction(n,r);if(l(o)||l(s)){let a=hb(e,i,e._primaryPosition);if(l(o)&&(U.clone(a,bDe.position),o(bDe)),l(s)){let c=e._primaryStartPosition;Rne(c,a,e._clickPixelTolerance)&&(U.clone(a,xDe.position),s(xDe))}}}function DDe(e,t){if(!Nne(e))return;let n=t.button;n!==Os.LEFT&&n!==Os.MIDDLE&&n!==Os.RIGHT||(e._buttonDown[Os.LEFT]&&(wne(e,un.LEFT_UP,un.LEFT_CLICK,t),e._buttonDown[Os.LEFT]=!1),e._buttonDown[Os.MIDDLE]&&(wne(e,un.MIDDLE_UP,un.MIDDLE_CLICK,t),e._buttonDown[Os.MIDDLE]=!1),e._buttonDown[Os.RIGHT]&&(wne(e,un.RIGHT_UP,un.RIGHT_CLICK,t),e._buttonDown[Os.RIGHT]=!1))}var Ine={startPosition:new U,endPosition:new U};function RDe(e,t){if(!Nne(e))return;let n=VE(t),i=hb(e,t,e._primaryPosition),r=e._primaryPreviousPosition,o=e.getInputAction(un.MOUSE_MOVE,n);l(o)&&(U.clone(r,Ine.startPosition),U.clone(i,Ine.endPosition),o(Ine)),U.clone(i,r),(e._buttonDown[Os.LEFT]||e._buttonDown[Os.MIDDLE]||e._buttonDown[Os.RIGHT])&&t.preventDefault()}var TDe={position:new U};function JIt(e,t){let n=t.button,i;if(n===Os.LEFT)i=un.LEFT_DOUBLE_CLICK;else return;let r=VE(t),o=e.getInputAction(i,r);l(o)&&(hb(e,t,TDe.position),o(TDe))}function ZIt(e,t){let n;if(l(t.deltaY)){let o=t.deltaMode;o===t.DOM_DELTA_PIXEL?n=-t.deltaY:o===t.DOM_DELTA_LINE?n=-t.deltaY*40:n=-t.deltaY*120}else t.detail>0?n=t.detail*-120:n=t.wheelDelta;if(!l(n))return;let i=VE(t),r=e.getInputAction(un.WHEEL,i);l(r)&&(r(n),t.preventDefault())}function QIt(e,t){Mne(e);let n=t.changedTouches,i,r=n.length,o,s,a=e._positions;for(i=0;i<r;++i)o=n[i],s=o.identifier,a.set(s,hb(e,o,new U));j5(e,t);let c=e._previousPositions;for(i=0;i<r;++i)o=n[i],s=o.identifier,c.set(s,U.clone(a.get(s)))}function EDe(e,t){Mne(e);let n=t.changedTouches,i,r=n.length,o,s,a=e._positions;for(i=0;i<r;++i)o=n[i],s=o.identifier,a.remove(s);j5(e,t);let c=e._previousPositions;for(i=0;i<r;++i)o=n[i],s=o.identifier,c.remove(s)}var CDe={position:new U},Pne={position1:new U,position2:new U},vDe={position:new U},SDe={position:new U},wDe={position:new U};function j5(e,t){let n=VE(t),i=e._positions,r=i.length,o,s,a=e._isPinching;if(r!==1&&e._buttonDown[Os.LEFT]){if(e._buttonDown[Os.LEFT]=!1,l(e._touchHoldTimer)&&(clearTimeout(e._touchHoldTimer),e._touchHoldTimer=void 0),o=e.getInputAction(un.LEFT_UP,n),l(o)&&(U.clone(e._primaryPosition,vDe.position),o(vDe)),r===0&&!e._isTouchHolding&&(s=e.getInputAction(un.LEFT_CLICK,n),l(s))){let c=e._primaryStartPosition,u=e._previousPositions.values[0];Rne(c,u,e._clickPixelTolerance)&&(U.clone(e._primaryPosition,SDe.position),s(SDe))}e._isTouchHolding=!1}if(r===0&&a&&(e._isPinching=!1,o=e.getInputAction(un.PINCH_END,n),l(o)&&o()),r===1&&!a){let c=i.values[0];U.clone(c,e._primaryPosition),U.clone(c,e._primaryStartPosition),U.clone(c,e._primaryPreviousPosition),e._buttonDown[Os.LEFT]=!0,o=e.getInputAction(un.LEFT_DOWN,n),l(o)&&(U.clone(c,CDe.position),o(CDe)),e._touchHoldTimer=setTimeout(function(){if(!e.isDestroyed()&&(e._touchHoldTimer=void 0,e._isTouchHolding=!0,s=e.getInputAction(un.RIGHT_CLICK,n),l(s))){let u=e._primaryStartPosition,f=e._previousPositions.values[0];Rne(u,f,e._holdPixelTolerance)&&(U.clone(e._primaryPosition,wDe.position),s(wDe))}},Xm.touchHoldDelayMilliseconds),t.preventDefault()}r===2&&!a&&(e._isPinching=!0,o=e.getInputAction(un.PINCH_START,n),l(o)&&(U.clone(i.values[0],Pne.position1),U.clone(i.values[1],Pne.position2),o(Pne),t.preventDefault()))}function ePt(e,t){Mne(e);let n=t.changedTouches,i,r=n.length,o,s,a=e._positions;for(i=0;i<r;++i){o=n[i],s=o.identifier;let u=a.get(s);l(u)&&hb(e,o,u)}ODe(e,t);let c=e._previousPositions;for(i=0;i<r;++i)o=n[i],s=o.identifier,U.clone(a.get(s),c.get(s))}var Dne={startPosition:new U,endPosition:new U},uz={distance:{startPosition:new U,endPosition:new U},angleAndHeight:{startPosition:new U,endPosition:new U}};function ODe(e,t){let n=VE(t),i=e._positions,r=e._previousPositions,o=i.length,s;if(o===1&&e._buttonDown[Os.LEFT]){let a=i.values[0];U.clone(a,e._primaryPosition);let c=e._primaryPreviousPosition;s=e.getInputAction(un.MOUSE_MOVE,n),l(s)&&(U.clone(c,Dne.startPosition),U.clone(a,Dne.endPosition),s(Dne)),U.clone(a,c),t.preventDefault()}else if(o===2&&e._isPinching&&(s=e.getInputAction(un.PINCH_MOVE,n),l(s))){let a=i.values[0],c=i.values[1],u=r.values[0],f=r.values[1],d=c.x-a.x,p=c.y-a.y,g=Math.sqrt(d*d+p*p)*.25,m=f.x-u.x,y=f.y-u.y,A=Math.sqrt(m*m+y*y)*.25,b=(c.y+a.y)*.125,x=(f.y+u.y)*.125,T=Math.atan2(p,d),E=Math.atan2(y,m);U.fromElements(0,A,uz.distance.startPosition),U.fromElements(0,g,uz.distance.endPosition),U.fromElements(E,x,uz.angleAndHeight.startPosition),U.fromElements(T,b,uz.angleAndHeight.endPosition),s(uz)}}function tPt(e,t){if(t.target.setPointerCapture(t.pointerId),t.pointerType==="touch"){let n=e._positions,i=t.pointerId;n.set(i,hb(e,t,new U)),j5(e,t),e._previousPositions.set(i,U.clone(n.get(i)))}else PDe(e,t)}function IDe(e,t){if(t.pointerType==="touch"){let n=e._positions,i=t.pointerId;n.remove(i),j5(e,t),e._previousPositions.remove(i)}else DDe(e,t)}function nPt(e,t){if(t.pointerType==="touch"){let n=e._positions,i=t.pointerId,r=n.get(i);if(!l(r))return;hb(e,t,r),ODe(e,t);let o=e._previousPositions;U.clone(n.get(i),o.get(i))}else RDe(e,t)}function Xm(e){this._inputEvents={},this._buttonDown={[Os.LEFT]:!1,[Os.MIDDLE]:!1,[Os.RIGHT]:!1},this._isPinching=!1,this._isTouchHolding=!1,this._lastSeenTouchEvent=-Xm.mouseEmulationIgnoreMilliseconds,this._primaryStartPosition=new U,this._primaryPosition=new U,this._primaryPreviousPosition=new U,this._positions=new Ut,this._previousPositions=new Ut,this._removalFunctions=[],this._touchHoldTimer=void 0,this._clickPixelTolerance=5,this._holdPixelTolerance=25,this._element=e??document,KIt(this)}Xm.prototype.setInputAction=function(e,t,n){let i=One(t,n);this._inputEvents[i]=e};Xm.prototype.getInputAction=function(e,t){let n=One(e,t);return this._inputEvents[n]};Xm.prototype.removeInputAction=function(e,t){let n=One(e,t);delete this._inputEvents[n]};Xm.prototype.isDestroyed=function(){return!1};Xm.prototype.destroy=function(){return $It(this),le(this)};Xm.mouseEmulationIgnoreMilliseconds=800;Xm.touchHoldDelayMilliseconds=1500;var sa=Xm;function jE(e){this._scene=e,this._currentTweens=[],this._morphHandler=void 0,this._morphCancelled=!1,this._completeMorph=void 0,this._morphToOrthographic=!1}jE.prototype.completeMorph=function(){l(this._completeMorph)&&this._completeMorph()};jE.prototype.morphTo2D=function(e,t){l(this._completeMorph)&&this._completeMorph();let n=this._scene;this._previousMode=n.mode,this._morphToOrthographic=n.camera.frustum instanceof gn,!(this._previousMode===re.SCENE2D||this._previousMode===re.MORPHING)&&(this._scene.morphStart.raiseEvent(this,this._previousMode,re.SCENE2D,!0),n._mode=re.MORPHING,n.camera._setTransform(N.IDENTITY),this._previousMode===re.COLUMBUS_VIEW?LPt(this,e):jPt(this,e,t),e===0&&l(this._completeMorph)&&this._completeMorph())};var iPt=new h,rPt=new h,oPt=new h,sPt=new h,aPt=new h,cPt=new h,lPt=new h,uPt=new he,fPt=new N,dPt=new $i,hPt=new gn,mPt={position:void 0,direction:void 0,up:void 0,position2D:void 0,direction2D:void 0,up2D:void 0,frustum:void 0};jE.prototype.morphToColumbusView=function(e,t){l(this._completeMorph)&&this._completeMorph();let n=this._scene;if(this._previousMode=n.mode,this._previousMode===re.COLUMBUS_VIEW||this._previousMode===re.MORPHING)return;this._scene.morphStart.raiseEvent(this,this._previousMode,re.COLUMBUS_VIEW,!0),n.camera._setTransform(N.IDENTITY);let i=iPt,r=rPt,o=oPt;if(e>0)i.x=0,i.y=-1,i.z=1,i=h.multiplyByScalar(h.normalize(i,i),5*t.maximumRadius,i),h.negate(h.normalize(i,r),r),h.cross(h.UNIT_X,r,o);else{let u=n.camera;if(this._previousMode===re.SCENE2D)h.clone(u.position,i),i.z=u.frustum.right-u.frustum.left,h.negate(h.UNIT_Z,r),h.clone(h.UNIT_Y,o);else{h.clone(u.positionWC,i),h.clone(u.directionWC,r),h.clone(u.upWC,o);let f=t.scaleToGeodeticSurface(i,lPt),d=At.eastNorthUpToFixedFrame(f,t,fPt);N.inverseTransformation(d,d),n.mapProjection.project(t.cartesianToCartographic(i,uPt),i),N.multiplyByPointAsVector(d,r,r),N.multiplyByPointAsVector(d,o,o)}}let s;this._morphToOrthographic?(s=hPt,s.width=n.camera.frustum.right-n.camera.frustum.left,s.aspectRatio=n.drawingBufferWidth/n.drawingBufferHeight):(s=dPt,s.aspectRatio=n.drawingBufferWidth/n.drawingBufferHeight,s.fov=D.toRadians(60));let a=mPt;a.position=i,a.direction=r,a.up=o,a.frustum=s;let c=GPt(a);fz(this,c),this._previousMode===re.SCENE2D?HPt(this,e,a,c):(a.position2D=N.multiplyByPoint(Or.TRANSFORM_2D,i,sPt),a.direction2D=N.multiplyByPointAsVector(Or.TRANSFORM_2D,r,aPt),a.up2D=N.multiplyByPointAsVector(Or.TRANSFORM_2D,o,cPt),n._mode=re.MORPHING,HDe(this,e,a,c)),e===0&&l(this._completeMorph)&&this._completeMorph()};var Bne={position:new h,direction:new h,up:new h,frustum:void 0},NDe=new $i;jE.prototype.morphTo3D=function(e,t){l(this._completeMorph)&&this._completeMorph();let n=this._scene;if(this._previousMode=n.mode,!(this._previousMode===re.SCENE3D||this._previousMode===re.MORPHING)){if(this._scene.morphStart.raiseEvent(this,this._previousMode,re.SCENE3D,!0),n._mode=re.MORPHING,n.camera._setTransform(N.IDENTITY),this._previousMode===re.SCENE2D)vPt(this,e,t);else{let i;e>0?(i=Bne,h.fromDegrees(0,0,5*t.maximumRadius,t,i.position),h.negate(i.position,i.direction),h.normalize(i.direction,i.direction),h.clone(h.UNIT_Z,i.up)):i=LDe(this,t);let r,o=n.camera;o.frustum instanceof gn?r=o.frustum.clone():(r=NDe,r.aspectRatio=n.drawingBufferWidth/n.drawingBufferHeight,r.fov=D.toRadians(60)),i.frustum=r;let s=WDe(i);fz(this,s),Fne(this,e,i,s)}e===0&&l(this._completeMorph)&&this._completeMorph()}};jE.prototype.isDestroyed=function(){return!1};jE.prototype.destroy=function(){return H5(this),le(this)};function fz(e,t){if(e._scene.completeMorphOnUserInput){e._morphHandler=new sa(e._scene.canvas);let n=function(){e._morphCancelled=!0,e._scene.camera.cancelFlight(),t(e)};e._completeMorph=n,e._morphHandler.setInputAction(n,un.LEFT_DOWN),e._morphHandler.setInputAction(n,un.MIDDLE_DOWN),e._morphHandler.setInputAction(n,un.RIGHT_DOWN),e._morphHandler.setInputAction(n,un.WHEEL)}}function H5(e){let t=e._currentTweens;for(let n=0;n<t.length;++n)t[n].cancelTween();e._currentTweens.length=0,e._morphHandler=e._morphHandler&&e._morphHandler.destroy()}var pPt=new he,gPt=new h,_Pt=new N;function LDe(e,t){let n=e._scene,i=n.camera,r=Bne,o=r.position,s=r.direction,a=r.up,c=n.mapProjection.unproject(i.position,pPt);t.cartographicToCartesian(c,o);let u=t.scaleToGeodeticSurface(o,gPt),f=At.eastNorthUpToFixedFrame(u,t,_Pt);return N.multiplyByPointAsVector(f,i.direction,s),N.multiplyByPointAsVector(f,i.up,a),r}var yPt=new h,APt=new h,bPt=new h,xPt=new h,TPt=new h,EPt=new h;function Fne(e,t,n,i){t*=.5;let r=e._scene,o=r.camera,s=h.clone(o.position,yPt),a=h.clone(o.direction,APt),c=h.clone(o.up,bPt),u=N.multiplyByPoint(Or.TRANSFORM_2D_INVERSE,n.position,xPt),f=N.multiplyByPointAsVector(Or.TRANSFORM_2D_INVERSE,n.direction,TPt),d=N.multiplyByPointAsVector(Or.TRANSFORM_2D_INVERSE,n.up,EPt);function p(m){xh(s,u,m.time,o.position),xh(a,f,m.time,o.direction),xh(c,d,m.time,o.up),h.cross(o.direction,o.up,o.right),h.normalize(o.right,o.right)}let g=r.tweens.add({duration:t,easingFunction:Rs.QUARTIC_OUT,startObject:{time:0},stopObject:{time:1},update:p,complete:function(){GDe(e,r,0,1,t,i)}});e._currentTweens.push(g)}var CPt=new gn,FDe=new h,BDe=new h,kDe=new h,kne=new h,UDe=new h,zDe=new h;function vPt(e,t,n){t/=3;let i=e._scene,r=i.camera,o;t>0?(o=Bne,h.fromDegrees(0,0,5*n.maximumRadius,n,o.position),h.negate(o.position,o.direction),h.normalize(o.direction,o.direction),h.clone(h.UNIT_Z,o.up)):(r.position.z=r.frustum.right-r.frustum.left,o=LDe(e,n));let s;e._morphToOrthographic?(s=CPt,s.aspectRatio=i.drawingBufferWidth/i.drawingBufferHeight,s.width=r.frustum.right-r.frustum.left):(s=NDe,s.aspectRatio=i.drawingBufferWidth/i.drawingBufferHeight,s.fov=D.toRadians(60)),o.frustum=s;let a=WDe(o);fz(e,a);let c;e._morphToOrthographic?c=function(){Fne(e,t,o,a)}:c=function(){jDe(e,t,o,function(){Fne(e,t,o,a)})},t>0?(i._mode=re.SCENE2D,r.flyTo({duration:t,destination:h.fromDegrees(0,0,5*n.maximumRadius,n,kne),complete:function(){i._mode=re.MORPHING,c()}})):c()}function xh(e,t,n,i){return h.lerp(e,t,n,i)}function VDe(e,t,n,i,r){let o=e._scene,s=o.camera;if(s.frustum instanceof gn)return;let a=s.frustum.fov,c=D.RADIANS_PER_DEGREE*.5,u=n.position.z*Math.tan(a*.5);s.frustum.far=u/Math.tan(c*.5)+1e7;function f(p){s.frustum.fov=D.lerp(a,c,p.time);let g=u/Math.tan(s.frustum.fov*.5);i(s,g)}let d=o.tweens.add({duration:t,easingFunction:Rs.QUARTIC_OUT,startObject:{time:0},stopObject:{time:1},update:f,complete:function(){s.frustum=n.frustum.clone(),r(e)}});e._currentTweens.push(d)}var SPt=new h,wPt=new h,IPt=new h,Lne=new h,PPt=new h,DPt=new h,RPt=new ys,OPt=new pn,MPt=new h,NPt={position:void 0,direction:void 0,up:void 0,frustum:void 0};function LPt(e,t){t*=.5;let n=e._scene,i=n.camera,r=h.clone(i.position,SPt),o=h.clone(i.direction,wPt),s=h.clone(i.up,IPt),a=h.negate(h.UNIT_Z,PPt),c=h.clone(h.UNIT_Y,DPt),u=Lne;if(t>0)h.clone(h.ZERO,Lne),u.z=5*n.ellipsoid.maximumRadius;else{h.clone(r,Lne);let A=OPt;N.multiplyByPoint(Or.TRANSFORM_2D,r,A.origin),N.multiplyByPointAsVector(Or.TRANSFORM_2D,o,A.direction);let b=n.globe;if(l(b)){let x=b.pickWorldCoordinates(A,n,!0,MPt);l(x)&&(N.multiplyByPoint(Or.TRANSFORM_2D_INVERSE,x,u),u.z+=h.distance(r,u))}}let f=RPt;f.right=u.z*.5,f.left=-f.right,f.top=f.right*(n.drawingBufferHeight/n.drawingBufferWidth),f.bottom=-f.top;let d=NPt;d.position=u,d.direction=a,d.up=c,d.frustum=f;let p=qDe(d);fz(e,p);function g(A){xh(r,u,A.time,i.position),xh(o,a,A.time,i.direction),xh(s,c,A.time,i.up),h.cross(i.direction,i.up,i.right),h.normalize(i.right,i.right),i._adjustOrthographicFrustum(!0)}function m(A,b){A.position.z=b}let y=n.tweens.add({duration:t,easingFunction:Rs.QUARTIC_OUT,startObject:{time:0},stopObject:{time:1},update:g,complete:function(){VDe(e,t,d,m,p)}});e._currentTweens.push(y)}var MDe=new he,FPt={position:new h,direction:new h,up:new h,position2D:new h,direction2D:new h,up2D:new h,frustum:new ys},BPt={position:new h,direction:new h,up:new h,frustum:void 0},kPt=new h,UPt=new pn,zPt=new N,VPt=new h;function jPt(e,t,n){t*=.5;let i=e._scene,r=i.camera,o=FPt;if(t>0)h.clone(h.ZERO,o.position),o.position.z=5*n.maximumRadius,h.negate(h.UNIT_Z,o.direction),h.clone(h.UNIT_Y,o.up);else{n.cartesianToCartographic(r.positionWC,MDe),i.mapProjection.project(MDe,o.position),h.negate(h.UNIT_Z,o.direction),h.clone(h.UNIT_Y,o.up);let d=UPt;h.clone(o.position2D,d.origin);let p=h.clone(r.directionWC,d.direction),g=n.scaleToGeodeticSurface(r.positionWC,VPt),m=At.eastNorthUpToFixedFrame(g,n,zPt);N.inverseTransformation(m,m),N.multiplyByPointAsVector(m,p,p),N.multiplyByPointAsVector(Or.TRANSFORM_2D,p,p);let y=i.globe;if(l(y)){let A=y.pickWorldCoordinates(d,i,!0,kPt);if(l(A)){let b=h.distance(o.position2D,A);A.x+=b,h.clone(A,o.position2D)}}}function s(d,p){d.position.x=p}N.multiplyByPoint(Or.TRANSFORM_2D,o.position,o.position2D),N.multiplyByPointAsVector(Or.TRANSFORM_2D,o.direction,o.direction2D),N.multiplyByPointAsVector(Or.TRANSFORM_2D,o.up,o.up2D);let a=o.frustum;a.right=o.position.z*.5,a.left=-a.right,a.top=a.right*(i.drawingBufferHeight/i.drawingBufferWidth),a.bottom=-a.top;let c=BPt;N.multiplyByPoint(Or.TRANSFORM_2D_INVERSE,o.position2D,c.position),h.clone(o.direction,c.direction),h.clone(o.up,c.up),c.frustum=a;let u=qDe(c);fz(e,u);function f(){VDe(e,t,o,s,u)}HDe(e,t,o,f)}function jDe(e,t,n,i){let r=e._scene,o=r.camera,s=o.frustum.right-o.frustum.left;o.frustum=n.frustum.clone();let a=o.frustum.fov,c=D.RADIANS_PER_DEGREE*.5,u=s*Math.tan(a*.5);o.frustum.far=u/Math.tan(c*.5)+1e7,o.frustum.fov=c;function f(p){o.frustum.fov=D.lerp(c,a,p.time),o.position.z=u/Math.tan(o.frustum.fov*.5)}let d=r.tweens.add({duration:t,easingFunction:Rs.QUARTIC_OUT,startObject:{time:0},stopObject:{time:1},update:f,complete:function(){i(e)}});e._currentTweens.push(d)}function HPt(e,t,n,i){t*=.5;let r=e._scene,o=r.camera,s=h.clone(n.position,kne),a=h.clone(n.direction,UDe),c=h.clone(n.up,zDe);r._mode=re.MORPHING;function u(){o.frustum=n.frustum.clone();let f=h.clone(o.position,FDe),d=h.clone(o.direction,BDe),p=h.clone(o.up,kDe);f.z=s.z;function g(y){xh(f,s,y.time,o.position),xh(d,a,y.time,o.direction),xh(p,c,y.time,o.up),h.cross(o.direction,o.up,o.right),h.normalize(o.right,o.right)}let m=r.tweens.add({duration:t,easingFunction:Rs.QUARTIC_OUT,startObject:{time:0},stopObject:{time:1},update:g,complete:function(){i(e)}});e._currentTweens.push(m)}e._morphToOrthographic?u():jDe(e,0,n,u)}function HDe(e,t,n,i){let r=e._scene,o=r.camera,s=h.clone(o.position,FDe),a=h.clone(o.direction,BDe),c=h.clone(o.up,kDe),u=h.clone(n.position2D,kne),f=h.clone(n.direction2D,UDe),d=h.clone(n.up2D,zDe);function p(m){xh(s,u,m.time,o.position),xh(a,f,m.time,o.direction),xh(c,d,m.time,o.up),h.cross(o.direction,o.up,o.right),h.normalize(o.right,o.right),o._adjustOrthographicFrustum(!0)}let g=r.tweens.add({duration:t,easingFunction:Rs.QUARTIC_OUT,startObject:{time:0},stopObject:{time:1},update:p,complete:function(){GDe(e,r,1,0,t,i)}});e._currentTweens.push(g)}function GDe(e,t,n,i,r,o){let s={object:t,property:"morphTime",startValue:n,stopValue:i,duration:r,easingFunction:Rs.QUARTIC_OUT};l(o)&&(s.complete=function(){o(e)});let a=t.tweens.addProperty(s);e._currentTweens.push(a)}function WDe(e){return function(t){let n=t._scene;n._mode=re.SCENE3D,n.morphTime=re.getMorphTime(re.SCENE3D),H5(t);let i=n.camera;(t._previousMode!==re.MORPHING||t._morphCancelled)&&(t._morphCancelled=!1,h.clone(e.position,i.position),h.clone(e.direction,i.direction),h.clone(e.up,i.up),h.cross(i.direction,i.up,i.right),h.normalize(i.right,i.right),i.frustum=e.frustum.clone());let r=i.frustum;n.frameState.useLogDepth&&(r.near=.1,r.far=1e10);let o=l(t._completeMorph);t._completeMorph=void 0,n.camera.update(n.mode),t._scene.morphComplete.raiseEvent(t,t._previousMode,re.SCENE3D,o)}}function qDe(e){return function(t){let n=t._scene;n._mode=re.SCENE2D,n.morphTime=re.getMorphTime(re.SCENE2D),H5(t);let i=n.camera;h.clone(e.position,i.position),i.position.z=n.ellipsoid.maximumRadius*2,h.clone(e.direction,i.direction),h.clone(e.up,i.up),h.cross(i.direction,i.up,i.right),h.normalize(i.right,i.right),i.frustum=e.frustum.clone();let r=l(t._completeMorph);t._completeMorph=void 0,n.camera.update(n.mode),t._scene.morphComplete.raiseEvent(t,t._previousMode,re.SCENE2D,r)}}function GPt(e){return function(t){let n=t._scene;n._mode=re.COLUMBUS_VIEW,n.morphTime=re.getMorphTime(re.COLUMBUS_VIEW),H5(t);let i=n.camera;(t._previousModeMode!==re.MORPHING||t._morphCancelled)&&(t._morphCancelled=!1,h.clone(e.position,i.position),h.clone(e.direction,i.direction),h.clone(e.up,i.up),h.cross(i.direction,i.up,i.right),h.normalize(i.right,i.right));let r=i.frustum;n.frameState.useLogDepth&&(r.near=.1,r.far=1e10);let o=l(t._completeMorph);t._completeMorph=void 0,n.camera.update(n.mode),t._scene.morphComplete.raiseEvent(t,t._previousMode,re.COLUMBUS_VIEW,o)}}var dz=jE;var YDe={LEFT_DRAG:0,RIGHT_DRAG:1,MIDDLE_DRAG:2,WHEEL:3,PINCH:4};Object.freeze(YDe);var sr=YDe;var ZDe=[Qr.SHIFT,Qr.CTRL,Qr.ALT,[Qr.SHIFT,Qr.CTRL],[Qr.SHIFT,Qr.ALT],[Qr.CTRL,Qr.ALT],[Qr.SHIFT,Qr.CTRL,Qr.ALT]];function Za(e,t){if(!l(t))return`${e}`;let n=Array.isArray(t)?t.toSorted():[t];return`${e}+${n.join("+")}`}function WPt(e,t){U.clone(e.distance.startPosition,t.distance.startPosition),U.clone(e.distance.endPosition,t.distance.endPosition),U.clone(e.angleAndHeight.startPosition,t.angleAndHeight.startPosition),U.clone(e.angleAndHeight.endPosition,t.angleAndHeight.endPosition)}function XDe(e,t,n){let i=Za(sr.PINCH,t),r=e._update,o=e._isDown,s=e._eventStartPosition,a=e._pressTime,c=e._releaseTime;r[i]=!0,o[i]=!1,s[i]=new U;let u=e._movement[i];l(u)||(u=e._movement[i]={}),u.distance={startPosition:new U,endPosition:new U},u.angleAndHeight={startPosition:new U,endPosition:new U},u.prevAngle=0,e._eventHandler.setInputAction(function(f){e._buttonsDown++,o[i]=!0,a[i]=new Date,U.lerp(f.position1,f.position2,.5,s[i])},un.PINCH_START,t),e._eventHandler.setInputAction(function(){e._buttonsDown=Math.max(e._buttonsDown-1,0),o[i]=!1,c[i]=new Date},un.PINCH_END,t),e._eventHandler.setInputAction(function(f){if(o[i]){r[i]?(WPt(f,u),r[i]=!1,u.prevAngle=u.angleAndHeight.startPosition.x):(U.clone(f.distance.endPosition,u.distance.endPosition),U.clone(f.angleAndHeight.endPosition,u.angleAndHeight.endPosition));let d=u.angleAndHeight.endPosition.x,p=u.prevAngle,g=Math.PI*2;for(;d>=p+Math.PI;)d-=g;for(;d<p-Math.PI;)d+=g;u.angleAndHeight.endPosition.x=-d*n.clientWidth/12,u.angleAndHeight.startPosition.x=-p*n.clientWidth/12}},un.PINCH_MOVE,t)}function KDe(e,t){let n=Za(sr.WHEEL,t),i=e._pressTime,r=e._releaseTime,o=e._update;o[n]=!0;let s=e._movement[n];l(s)||(s=e._movement[n]={});let a=e._lastMovement[n];l(a)||(a=e._lastMovement[n]={startPosition:new U,endPosition:new U,valid:!1}),s.startPosition=new U,U.clone(U.ZERO,s.startPosition),s.endPosition=new U,e._eventHandler.setInputAction(function(c){let u=7.5*D.toRadians(c);i[n]=r[n]=new Date,s.endPosition.x=0,s.endPosition.y=u,U.clone(s.endPosition,a.endPosition),a.valid=!0,o[n]=!1},un.WHEEL,t)}function _I(e,t,n){let i=Za(n,t),r=e._isDown,o=e._eventStartPosition,s=e._pressTime;r[i]=!1,o[i]=new U;let a=e._lastMovement[i];l(a)||(a=e._lastMovement[i]={startPosition:new U,endPosition:new U,valid:!1});let c,u;n===sr.LEFT_DRAG?(c=un.LEFT_DOWN,u=un.LEFT_UP):n===sr.RIGHT_DRAG?(c=un.RIGHT_DOWN,u=un.RIGHT_UP):n===sr.MIDDLE_DRAG&&(c=un.MIDDLE_DOWN,u=un.MIDDLE_UP),e._eventHandler.setInputAction(function(f){e._buttonsDown++,a.valid=!1,r[i]=!0,s[i]=new Date,U.clone(f.position,o[i])},c,t),e._eventHandler.setInputAction(function(){Une(Za(n,void 0),e);for(let f of ZDe){let d=Za(n,f);Une(d,e)}},u,t)}function Une(e,t){let n=t._releaseTime,i=t._isDown;i[e]&&(t._buttonsDown=Math.max(t._buttonsDown-1,0)),i[e]=!1,n[e]=new Date}function $De(e,t){U.clone(e.startPosition,t.startPosition),U.clone(e.endPosition,t.endPosition)}function qPt(e,t,n){let i=n._isDown,r=!1,o=Za(e,t);for(let[c,u]of Object.entries(i))c.startsWith(e)&&u&&c!==o&&(r=!0,Une(c,n));if(!r)return;let s=n._pressTime,a=n._lastMovement[o];l(a)||(a=n._lastMovement[o]={startPosition:new U,endPosition:new U,valid:!1}),n._buttonsDown++,a.valid=!1,i[o]=!0,s[o]=new Date}function JDe(e,t){let n=e._update,i=e._movement,r=e._lastMovement,o=e._isDown;for(let s in sr)if(sr.hasOwnProperty(s)){let a=sr[s];if(l(a)){let c=Za(a,t);n[c]=!0,l(e._lastMovement[c])||(e._lastMovement[c]={startPosition:new U,endPosition:new U,valid:!1}),l(e._movement[c])||(e._movement[c]={startPosition:new U,endPosition:new U})}}e._eventHandler.setInputAction(function(s){for(let a in sr)if(sr.hasOwnProperty(a)){let c=sr[a];if(l(c)){let u=Za(c,t);qPt(c,t,e),o[u]&&(n[u]?($De(i[u],r[u]),r[u].valid=!0,$De(s,i[u]),n[u]=!1):U.clone(s.endPosition,i[u].endPosition))}}U.clone(s.endPosition,e._currentMousePosition)},un.MOUSE_MOVE,t)}function Th(e){this._eventHandler=new sa(e),this._update={},this._movement={},this._lastMovement={},this._isDown={},this._eventStartPosition={},this._pressTime={},this._releaseTime={},this._buttonsDown=0,this._currentMousePosition=new U,KDe(this,void 0),XDe(this,void 0,e),_I(this,void 0,sr.LEFT_DRAG),_I(this,void 0,sr.RIGHT_DRAG),_I(this,void 0,sr.MIDDLE_DRAG),JDe(this,void 0);for(let t of ZDe)KDe(this,t),XDe(this,t,e),_I(this,t,sr.LEFT_DRAG),_I(this,t,sr.RIGHT_DRAG),_I(this,t,sr.MIDDLE_DRAG),JDe(this,t)}Object.defineProperties(Th.prototype,{currentMousePosition:{get:function(){return this._currentMousePosition}},anyButtonDown:{get:function(){let e=!this._update[Za(sr.WHEEL)]||!this._update[Za(sr.WHEEL,Qr.SHIFT)]||!this._update[Za(sr.WHEEL,Qr.CTRL)]||!this._update[Za(sr.WHEEL,Qr.ALT)];return this._buttonsDown>0||e}}});Th.prototype.isMoving=function(e,t){let n=Za(e,t);return!this._update[n]};Th.prototype.getMovement=function(e,t){let n=Za(e,t);return this._movement[n]};Th.prototype.getLastMovement=function(e,t){let n=Za(e,t),i=this._lastMovement[n];if(i.valid)return i};Th.prototype.isButtonDown=function(e,t){let n=Za(e,t);return this._isDown[n]};Th.prototype.getStartMousePosition=function(e,t){if(e===sr.WHEEL)return this._currentMousePosition;let n=Za(e,t);return this._eventStartPosition[n]};Th.prototype.getButtonPressTime=function(e,t){let n=Za(e,t);return this._pressTime[n]};Th.prototype.getButtonReleaseTime=function(e,t){let n=Za(e,t);return this._releaseTime[n]};Th.prototype.reset=function(){for(let e in this._update)this._update.hasOwnProperty(e)&&(this._update[e]=!0)};Th.prototype.isDestroyed=function(){return!1};Th.prototype.destroy=function(){return this._eventHandler=this._eventHandler&&this._eventHandler.destroy(),le(this)};var hz=Th;function G5(e,t,n,i,r,o,s,a,c,u){this._tweens=e,this._tweenjs=t,this._startObject=Je(n),this._stopObject=Je(i),this._duration=r,this._delay=o,this._easingFunction=s,this._update=a,this._complete=c,this.cancel=u,this.needsStart=!0}Object.defineProperties(G5.prototype,{startObject:{get:function(){return this._startObject}},stopObject:{get:function(){return this._stopObject}},duration:{get:function(){return this._duration}},delay:{get:function(){return this._delay}},easingFunction:{get:function(){return this._easingFunction}},update:{get:function(){return this._update}},complete:{get:function(){return this._complete}},tweenjs:{get:function(){return this._tweenjs}}});G5.prototype.cancelTween=function(){this._tweens.remove(this)};function Km(){this._tweens=[]}Object.defineProperties(Km.prototype,{length:{get:function(){return this._tweens.length}}});Km.prototype.add=function(e){if(e=e??H.EMPTY_OBJECT,e.duration===0)return l(e.complete)&&e.complete(),new G5(this);let t=e.duration/kn.SECONDS_PER_MILLISECOND,n=e.delay??0,i=n/kn.SECONDS_PER_MILLISECOND,r=e.easingFunction??Rs.LINEAR_NONE,o=e.startObject,s=new NIe(o);s.to(Je(e.stopObject),t),s.delay(i),s.easing(r),l(e.update)&&s.onUpdate(function(){e.update(o)}),s.onComplete(e.complete??null),s.repeat(e._repeat??0);let a=new G5(this,s,e.startObject,e.stopObject,e.duration,n,r,e.update,e.complete,e.cancel);return this._tweens.push(a),a};Km.prototype.addProperty=function(e){e=e??H.EMPTY_OBJECT;let t=e.object,n=e.property,i=e.startValue,r=e.stopValue;function o(s){t[n]=s.value}return this.add({startObject:{value:i},stopObject:{value:r},duration:e.duration??3,delay:e.delay,easingFunction:e.easingFunction,update:o,complete:e.complete,cancel:e.cancel,_repeat:e._repeat})};Km.prototype.addAlpha=function(e){e=e??H.EMPTY_OBJECT;let t=e.material,n=[];for(let r in t.uniforms)t.uniforms.hasOwnProperty(r)&&l(t.uniforms[r])&&l(t.uniforms[r].alpha)&&n.push(r);function i(r){let o=n.length;for(let s=0;s<o;++s)t.uniforms[n[s]].alpha=r.alpha}return this.add({startObject:{alpha:e.startValue??0},stopObject:{alpha:e.stopValue??1},duration:e.duration??3,delay:e.delay,easingFunction:e.easingFunction,update:i,complete:e.complete,cancel:e.cancel})};Km.prototype.addOffsetIncrement=function(e){e=e??H.EMPTY_OBJECT;let n=e.material.uniforms;return this.addProperty({object:n,property:"offset",startValue:n.offset,stopValue:n.offset+1,duration:e.duration,delay:e.delay,easingFunction:e.easingFunction,update:e.update,cancel:e.cancel,_repeat:1/0})};Km.prototype.remove=function(e){if(!l(e))return!1;let t=this._tweens.indexOf(e);return t!==-1?(e.tweenjs.stop(),l(e.cancel)&&e.cancel(),this._tweens.splice(t,1),!0):!1};Km.prototype.removeAll=function(){let e=this._tweens;for(let t=0;t<e.length;++t){let n=e[t];n.tweenjs.stop(),l(n.cancel)&&n.cancel()}e.length=0};Km.prototype.contains=function(e){return l(e)&&this._tweens.indexOf(e)!==-1};Km.prototype.get=function(e){return this._tweens[e]};Km.prototype.update=function(e){let t=this._tweens,n=0;for(e=l(e)?e/kn.SECONDS_PER_MILLISECOND:xn();n<t.length;){let i=t[n],r=i.tweenjs;if(i.needsStart)i.needsStart=!1,r.start(e);else if(r.update(e))n++;else{if(t[n]?.needsStart)continue;r.stop(),t.splice(n,1)}}};var HE=Km;function pz(e){this.enableInputs=!0,this.enableTranslate=!0,this.enableZoom=!0,this.enableRotate=!0,this.enableTilt=!0,this.enableLook=!0,this.inertiaSpin=.9,this.inertiaTranslate=.9,this.inertiaZoom=.8,this.maximumMovementRatio=.1,this.bounceAnimationTime=3,this.minimumZoomDistance=1,this.maximumZoomDistance=Number.POSITIVE_INFINITY,this.zoomFactor=5,this.translateEventTypes=sr.LEFT_DRAG,this.zoomEventTypes=[sr.RIGHT_DRAG,sr.WHEEL,sr.PINCH],this.rotateEventTypes=sr.LEFT_DRAG,this.tiltEventTypes=[sr.MIDDLE_DRAG,sr.PINCH,{eventType:sr.LEFT_DRAG,modifier:Qr.CTRL},{eventType:sr.RIGHT_DRAG,modifier:Qr.CTRL}],this.lookEventTypes={eventType:sr.LEFT_DRAG,modifier:Qr.SHIFT};let t=e.ellipsoid??ee.default;this.minimumPickingTerrainHeight=ee.WGS84.equals(t)?15e4:t.minimumRadius*.025,this._minimumPickingTerrainHeight=this.minimumPickingTerrainHeight,this.minimumPickingTerrainDistanceWithInertia=ee.WGS84.equals(t)?4e3:t.minimumRadius*63e-5,this.minimumCollisionTerrainHeight=ee.WGS84.equals(t)?15e3:t.minimumRadius*.0025,this._minimumCollisionTerrainHeight=this.minimumCollisionTerrainHeight,this.minimumTrackBallHeight=ee.WGS84.equals(t)?75e5:t.minimumRadius*1.175,this._minimumTrackBallHeight=this.minimumTrackBallHeight,this.enableCollisionDetection=!0,this.maximumTiltAngle=void 0,this._scene=e,this._globe=void 0,this._ellipsoid=t,this._lastGlobeHeight=0,this._aggregator=new hz(e.canvas),this._lastInertiaSpinMovement=void 0,this._lastInertiaZoomMovement=void 0,this._lastInertiaTranslateMovement=void 0,this._lastInertiaTiltMovement=void 0,this._inertiaDisablers={_lastInertiaZoomMovement:["_lastInertiaSpinMovement","_lastInertiaTranslateMovement","_lastInertiaTiltMovement"],_lastInertiaTiltMovement:["_lastInertiaSpinMovement","_lastInertiaTranslateMovement"]},this._tweens=new HE,this._tween=void 0,this._horizontalRotationAxis=void 0,this._tiltCenterMousePosition=new U(-1,-1),this._tiltCenter=new h,this._rotateMousePosition=new U(-1,-1),this._rotateStartPosition=new h,this._strafeStartPosition=new h,this._strafeMousePosition=new U,this._strafeEndMousePosition=new U,this._zoomMouseStart=new U(-1,-1),this._zoomWorldPosition=new h,this._useZoomWorldPosition=!1,this._panLastMousePosition=new U,this._panLastWorldPosition=new h,this._tiltCVOffMap=!1,this._looking=!1,this._rotating=!1,this._strafing=!1,this._zoomingOnVector=!1,this._zoomingUnderground=!1,this._rotatingZoom=!1,this._adjustedHeightForTerrain=!1,this._cameraUnderground=!1;let n=e.mapProjection;this._maxCoord=n.project(new he(Math.PI,D.PI_OVER_TWO)),this._rotateFactor=void 0,this._rotateRateRangeAdjustment=void 0,this._maximumRotateRate=1.77,this._minimumRotateRate=1/5e3,this._minimumZoomRate=20,this._maximumZoomRate=5906376272e3,this._minimumUndergroundPickDistance=2e3,this._maximumUndergroundPickDistance=1e4}function YPt(e,t){if(e<0)return 0;let n=(1-t)*25;return Math.exp(-n*e)}function XPt(e){return U.equalsEpsilon(e.startPosition,e.endPosition,D.EPSILON14)}var KPt=.4;function $Pt(e,t,n,i,r,o,s){let a=o[s];l(a)||(a=o[s]={startPosition:new U,endPosition:new U,motion:new U,inertiaEnabled:!0});let c=e.getButtonPressTime(t,n),u=e.getButtonReleaseTime(t,n),f=c&&u&&(u.getTime()-c.getTime())/1e3,p=u&&(new Date().getTime()-u.getTime())/1e3;if(c&&u&&f<KPt){let g=YPt(p,i),m=e.getLastMovement(t,n);if(!l(m)||XPt(m)||!a.inertiaEnabled||(a.motion.x=(m.endPosition.x-m.startPosition.x)*.5,a.motion.y=(m.endPosition.y-m.startPosition.y)*.5,a.startPosition=U.clone(m.startPosition,a.startPosition),a.endPosition=U.multiplyByScalar(a.motion,g,a.endPosition),a.endPosition=U.add(a.startPosition,a.endPosition,a.endPosition),isNaN(a.endPosition.x)||isNaN(a.endPosition.y)||U.distance(a.startPosition,a.endPosition)<.5))return;if(!e.isButtonDown(t,n)){let y=e.getStartMousePosition(t,n);r(o,y,a)}}}function JPt(e,t){if(l(t)){let n=e[t];l(n)&&(n.inertiaEnabled=!0);let i=e._inertiaDisablers[t];if(l(i)){let r=i.length;for(let o=0;o<r;++o)n=e[i[o]],l(n)&&(n.inertiaEnabled=!1)}}}var QDe=[];function _u(e,t,n,i,r,o){if(!l(n))return;let s=e._aggregator;Array.isArray(n)||(QDe[0]=n,n=QDe);let a=n.length;for(let c=0;c<a;++c){let u=n[c],f=l(u.eventType)?u.eventType:u,d=u.modifier,p=s.isMoving(f,d)&&s.getMovement(f,d),g=s.getStartMousePosition(f,d);e.enableInputs&&t&&(p?(i(e,g,p),JPt(e,o)):r<1&&$Pt(s,f,d,r,i,e,o))}}var W5=new pn,ZPt=new h,QPt=new U,eDt=new h,tDt=new U,nDt=new h,iDt=new h,rDt=new h,oDt=new h,f1e=new h,sDt=new h,aDt=new h,cDt=new h,lDt=new h,uDt=new h,fDt=new h,dDt=new h,hDt=new h,mDt=new h,pDt=new h,GE=new h,e1e=new h,t1e=new h,zne={orientation:new wc};function Xne(e,t,n,i,r,o){let s=1;l(o)&&(s=D.clamp(Math.abs(o),.25,1));let a=n.endPosition.y-n.startPosition.y,u=a>0?e.minimumZoomDistance*s:0,f=e.maximumZoomDistance,d=r-u,p=i*d;p=D.clamp(p,e._minimumZoomRate,e._maximumZoomRate);let g=a/e._scene.canvas.clientHeight;g=Math.min(g,e.maximumMovementRatio);let m=p*g;if(e.enableCollisionDetection||e.minimumZoomDistance===0||!l(e._globe)){if(m>0&&Math.abs(r-u)<1||m<0&&Math.abs(r-f)<1)return;r-m<u?m=r-u-1:r-m>f&&(m=r-f)}let y=e._scene,A=y.camera,b=y.mode,x=zne.orientation;x.heading=A.heading,x.pitch=A.pitch,x.roll=A.roll;let T=n.inertiaEnabled??U.equals(t,e._zoomMouseStart),E=e._zoomingOnVector,v=e._rotatingZoom,S;if(T||(e._zoomMouseStart=U.clone(t,e._zoomMouseStart),l(e._globe)&&b===re.SCENE2D?(S=A.getPickRay(t,W5).origin,S=h.fromElements(S.y,S.z,S.x)):l(e._globe)&&(S=W_(e,t,ZPt)),l(S)?(e._useZoomWorldPosition=!0,e._zoomWorldPosition=h.clone(S,e._zoomWorldPosition)):e._useZoomWorldPosition=!1,E=e._zoomingOnVector=!1,v=e._rotatingZoom=!1,e._zoomingUnderground=e._cameraUnderground),!e._useZoomWorldPosition){A.zoomIn(m);return}let I=b===re.COLUMBUS_VIEW;if(A.positionCartographic.height<2e6&&(v=!0),!T||v){if(b===re.SCENE2D){let R=e._zoomWorldPosition,O=A.position;if(!h.equals(R,O)&&A.positionCartographic.height<e._maxCoord.x*2){let L=A.position.x,_=h.subtract(R,O,eDt);h.normalize(_,_);let C=h.distance(R,O)*m/(A.getMagnitude()*.5);A.move(_,C*.5),(A.position.x<0&&L>0||A.position.x>0&&L<0)&&(S=A.getPickRay(t,W5).origin,S=h.fromElements(S.y,S.z,S.x),e._zoomWorldPosition=h.clone(S,e._zoomWorldPosition))}}else if(b===re.SCENE3D){let R=h.normalize(A.position,f1e);if(e._cameraUnderground||e._zoomingUnderground||A.positionCartographic.height<3e3&&Math.abs(h.dot(A.direction,R))<.6)I=!0;else{let O=y.canvas,L=tDt;L.x=O.clientWidth/2,L.y=O.clientHeight/2;let _=W_(e,L,nDt);if(!l(_))I=!0;else if(A.positionCartographic.height<1e6)if(h.dot(A.direction,R)>=-.5)I=!0;else{let C=aDt;h.clone(A.position,C);let w=e._zoomWorldPosition,P=sDt;if(P=h.normalize(w,P),h.dot(P,R)<0)return;let M=pDt,F=uDt;h.clone(A.direction,F),h.add(C,h.multiplyByScalar(F,1e3,GE),M);let V=fDt,B=dDt;h.subtract(w,C,V),h.normalize(V,B);let j=h.dot(R,B);if(j>=0){e._zoomMouseStart.x=-1;return}let k=Math.acos(-j),G=h.magnitude(C),q=h.magnitude(w),Q=G-m,W=h.magnitude(V),J=Math.asin(D.clamp(W/q*Math.sin(k),-1,1)),Z=Math.asin(D.clamp(Q/q*Math.sin(k),-1,1)),ae=J-Z+k,Ae=cDt;h.normalize(C,Ae);let fe=lDt;fe=h.cross(B,Ae,fe),fe=h.normalize(fe,fe),h.normalize(h.cross(Ae,fe,GE),F),h.multiplyByScalar(h.normalize(M,GE),h.magnitude(M)-m,M),h.normalize(C,C),h.multiplyByScalar(C,Q,C);let xe=hDt;h.multiplyByScalar(h.add(h.multiplyByScalar(Ae,Math.cos(ae)-1,e1e),h.multiplyByScalar(F,Math.sin(ae),t1e),GE),Q,xe),h.add(C,xe,C),h.normalize(M,Ae),h.normalize(h.cross(Ae,fe,GE),F);let ge=mDt;h.multiplyByScalar(h.add(h.multiplyByScalar(Ae,Math.cos(ae)-1,e1e),h.multiplyByScalar(F,Math.sin(ae),t1e),GE),h.magnitude(M),ge),h.add(M,ge,M),h.clone(C,A.position),h.normalize(h.subtract(M,C,GE),A.direction),h.clone(A.direction,A.direction),h.cross(A.direction,A.up,A.right),h.cross(A.right,A.direction,A.up),A.setView(zne);return}else{let C=h.normalize(_,iDt),w=h.normalize(e._zoomWorldPosition,rDt),P=h.dot(w,C);if(P>0&&P<1){let M=D.acosClamped(P),F=h.cross(w,C,oDt),V=Math.abs(M)>D.toRadians(20)?A.positionCartographic.height*.75:A.positionCartographic.height-m,B=m/V;A.rotate(F,M*B)}}}}e._rotatingZoom=!I}if(!T&&I||E){let R,O=dr.worldToWindowCoordinates(y,e._zoomWorldPosition,QPt);b!==re.COLUMBUS_VIEW&&U.equals(t,e._zoomMouseStart)&&l(O)?R=A.getPickRay(O,W5):R=A.getPickRay(t,W5);let L=R.direction;(b===re.COLUMBUS_VIEW||b===re.SCENE2D)&&h.fromElements(L.y,L.z,L.x,L),A.move(L,m),e._zoomingOnVector=!0}else A.zoomIn(m);e._cameraUnderground||A.setView(zne)}var gDt=new pn,_Dt=new pn,yDt=new h;function ADt(e,t,n){let r=e._scene.camera,o=r.getPickRay(n.startPosition,gDt).origin,s=r.getPickRay(n.endPosition,_Dt).origin;o=h.fromElements(o.y,o.z,o.x,o),s=h.fromElements(s.y,s.z,s.x,s);let a=h.subtract(o,s,yDt),c=h.magnitude(a);c>0&&(h.normalize(a,a),r.move(a,c))}function n1e(e,t,n){l(n.distance)&&(n=n.distance);let r=e._scene.camera;Xne(e,t,n,e.zoomFactor,r.getMagnitude())}var bDt=new U,xDt=new U;function i1e(e,t,n){if(l(n.angleAndHeight)){TDt(e,t,n.angleAndHeight);return}let i=e._scene,r=i.camera,o=i.canvas,s=o.clientWidth,a=o.clientHeight,c=bDt;c.x=2/s*n.startPosition.x-1,c.y=2/a*(a-n.startPosition.y)-1,c=U.normalize(c,c);let u=xDt;u.x=2/s*n.endPosition.x-1,u.y=2/a*(a-n.endPosition.y)-1,u=U.normalize(u,u);let f=D.acosClamped(c.x);c.y<0&&(f=D.TWO_PI-f);let d=D.acosClamped(u.x);u.y<0&&(d=D.TWO_PI-d);let p=d-f;r.twistRight(p)}function TDt(e,t,n){let i=e._rotateFactor*e._rotateRateRangeAdjustment;i>e._maximumRotateRate&&(i=e._maximumRotateRate),i<e._minimumRotateRate&&(i=e._minimumRotateRate);let r=e._scene,o=r.camera,s=r.canvas,a=(n.endPosition.x-n.startPosition.x)/s.clientWidth;a=Math.min(a,e.maximumMovementRatio);let c=i*a*Math.PI*4;o.twistRight(c)}function EDt(e){let t=e._scene.mapMode2D===pu.ROTATE;N.equals(N.IDENTITY,e._scene.camera.transform)?(_u(e,e.enableTranslate,e.translateEventTypes,ADt,e.inertiaTranslate,"_lastInertiaTranslateMovement"),_u(e,e.enableZoom,e.zoomEventTypes,n1e,e.inertiaZoom,"_lastInertiaZoomMovement"),t&&_u(e,e.enableRotate,e.tiltEventTypes,i1e,e.inertiaSpin,"_lastInertiaTiltMovement")):(_u(e,e.enableZoom,e.zoomEventTypes,n1e,e.inertiaZoom,"_lastInertiaZoomMovement"),t&&_u(e,e.enableRotate,e.translateEventTypes,i1e,e.inertiaSpin,"_lastInertiaSpinMovement"))}var d1e=new pn,CDt=new h,vDt=new h;function W_(e,t,n){let i=e._scene,r=e._globe,o=i.camera,s;if(i.pickPositionSupported&&(s=i.pickPositionWorldCoordinates(t,CDt)),!l(r))return h.clone(s,n);let a=!e._cameraUnderground,c=o.getPickRay(t,d1e),u=r.pickWorldCoordinates(c,i,a,vDt),f=l(s)?h.distance(s,o.positionWC):Number.POSITIVE_INFINITY,d=l(u)?h.distance(u,o.positionWC):Number.POSITIVE_INFINITY;return f<d?h.clone(s,n):h.clone(u,n)}var SDt=new he;function Z5(e){let t=e._ellipsoid,n=e._scene,i=n.camera,r=n.mode,o=0;if(r===re.SCENE3D){let c=t.cartesianToCartographic(i.position,SDt);l(c)&&(o=c.height)}else o=i.position.z;let s=e._scene.globeHeight??0;return Math.abs(s-o)}var wDt=new h;function h1e(e,t){let n=t.origin,i=t.direction,r=Z5(e),o=h.normalize(n,wDt),s=Math.abs(h.dot(o,i));return s=Math.max(s,.5)*2,r*s}function m1e(e,t,n,i){let r=h.distance(t.origin,n),o=Z5(e),s=D.clamp(o*5,e._minimumUndergroundPickDistance,e._maximumUndergroundPickDistance);return r>s&&(r=Math.min(r,o/5),r=Math.max(r,100)),pn.getPoint(t,r,i)}function p1e(e,t,n,i){let r;return l(n)?(r=h.distance(t.origin,n),r>e._maximumUndergroundPickDistance&&(r=Z5(e))):r=Z5(e),pn.getPoint(t,r,i)}var IDt=new U;function g1e(e,t){let n=t.endPosition,i=U.subtract(t.endPosition,t.startPosition,IDt),r=e._strafeEndMousePosition;U.add(r,i,r),t.endPosition=r,Kne(e,t,e._strafeStartPosition),t.endPosition=n}var r1e=new pn,PDt=new pn,Vne=new h,DDt=new h,RDt=new h,ODt=new h,MDt=new sn(h.UNIT_X,0),NDt=new U,LDt=new U;function FDt(e,t,n){if(h.equals(t,e._translateMousePosition)||(e._looking=!1),h.equals(t,e._strafeMousePosition)||(e._strafing=!1),e._looking){ad(e,t,n);return}if(e._strafing){g1e(e,n);return}let r=e._scene.camera,o=e._cameraUnderground,s=U.clone(n.startPosition,NDt),a=U.clone(n.endPosition,LDt),c=r.getPickRay(s,r1e),u=h.clone(h.ZERO,ODt),f=h.UNIT_X,d;if(r.position.z<e._minimumPickingTerrainHeight&&(d=W_(e,s,Vne),l(d)&&(u.x=d.x)),o||u.x>r.position.z&&l(d)){let T=d;o&&(T=p1e(e,c,d,Vne)),U.clone(t,e._strafeMousePosition),U.clone(t,e._strafeEndMousePosition),h.clone(T,e._strafeStartPosition),e._strafing=!0,Kne(e,n,e._strafeStartPosition);return}let p=sn.fromPointNormal(u,f,MDt);c=r.getPickRay(s,r1e);let g=_i.rayPlane(c,p,Vne),m=r.getPickRay(a,PDt),y=_i.rayPlane(m,p,DDt);if(!l(g)||!l(y)){e._looking=!0,ad(e,t,n),U.clone(t,e._translateMousePosition);return}let A=h.subtract(g,y,RDt),b=A.x;A.x=A.y,A.y=A.z,A.z=b;let x=h.magnitude(A);x>D.EPSILON6&&(h.normalize(A,A),r.move(A,x))}var _1e=new U,X5=new pn,K5=new h,BDt=new h,y1e=new N,kDt=new N,UDt=new h,zDt=new sn(h.UNIT_X,0),jne=new h,Wne=new he,A1e=new N,VDt=new Le,jDt=new $,$5=new h;function HDt(e,t,n){if(l(n.angleAndHeight)&&(n=n.angleAndHeight),U.equals(t,e._tiltCenterMousePosition)||(e._tiltCVOffMap=!1,e._looking=!1),e._looking){ad(e,t,n);return}let r=e._scene.camera;e._tiltCVOffMap||!e.onMap()||Math.abs(r.position.z)>e._minimumPickingTerrainHeight?(e._tiltCVOffMap=!0,GDt(e,t,n)):WDt(e,t,n)}function GDt(e,t,n){let i=e._scene,r=i.camera,o=i.canvas,s=_1e;s.x=o.clientWidth/2,s.y=o.clientHeight/2;let a=r.getPickRay(s,X5),c=h.UNIT_X,u=a.origin,f=a.direction,d,p=h.dot(c,f);if(Math.abs(p)>D.EPSILON6&&(d=-h.dot(c,u)/p),!l(d)||d<=0){e._looking=!0,ad(e,t,n),U.clone(t,e._tiltCenterMousePosition);return}let g=h.multiplyByScalar(f,d,K5);h.add(u,g,g);let m=i.mapProjection,y=m.ellipsoid;h.fromElements(g.y,g.z,g.x,g);let A=m.unproject(g,Wne);y.cartographicToCartesian(A,g);let b=At.eastNorthUpToFixedFrame(g,y,y1e),x=e._globe,T=e._ellipsoid;e._globe=void 0,e._ellipsoid=ee.UNIT_SPHERE,e._rotateFactor=1,e._rotateRateRangeAdjustment=1;let E=N.clone(r.transform,A1e);r._setTransform(b),sd(e,t,n,h.UNIT_Z),r._setTransform(E),e._globe=x,e._ellipsoid=T;let v=T.maximumRadius;e._rotateFactor=1/v,e._rotateRateRangeAdjustment=v}function WDt(e,t,n){let i=e._scene,r=i.camera,o=e._cameraUnderground,s,a,c=h.UNIT_X;if(U.equals(t,e._tiltCenterMousePosition))s=h.clone(e._tiltCenter,K5);else{if(r.position.z<e._minimumPickingTerrainHeight&&(s=W_(e,t,K5)),!l(s)){a=r.getPickRay(t,X5);let _=a.origin,C=a.direction,w,P=h.dot(c,C);if(Math.abs(P)>D.EPSILON6&&(w=-h.dot(c,_)/P),!l(w)||w<=0){e._looking=!0,ad(e,t,n),U.clone(t,e._tiltCenterMousePosition);return}s=h.multiplyByScalar(C,w,K5),h.add(_,s,s)}o&&(l(a)||(a=r.getPickRay(t,X5)),m1e(e,a,s,s)),U.clone(t,e._tiltCenterMousePosition),h.clone(s,e._tiltCenter)}let u=i.canvas,f=_1e;f.x=u.clientWidth/2,f.y=e._tiltCenterMousePosition.y,a=r.getPickRay(f,X5);let d=h.clone(h.ZERO,UDt);d.x=s.x;let p=sn.fromPointNormal(d,c,zDt),g=_i.rayPlane(a,p,BDt),m=r._projection,y=m.ellipsoid;h.fromElements(s.y,s.z,s.x,s);let A=m.unproject(s,Wne);y.cartographicToCartesian(A,s);let b=At.eastNorthUpToFixedFrame(s,y,y1e),x;l(g)?(h.fromElements(g.y,g.z,g.x,g),A=m.unproject(g,Wne),y.cartographicToCartesian(A,g),x=At.eastNorthUpToFixedFrame(g,y,kDt)):x=b;let T=e._globe,E=e._ellipsoid;e._globe=void 0,e._ellipsoid=ee.UNIT_SPHERE,e._rotateFactor=1,e._rotateRateRangeAdjustment=1;let v=h.UNIT_Z,S=N.clone(r.transform,A1e);r._setTransform(b);let I=h.cross(h.UNIT_Z,h.normalize(r.position,jne),jne),R=h.dot(r.right,I);if(sd(e,t,n,v,!1,!0),r._setTransform(x),R<0){let _=n.startPosition.y-n.endPosition.y;(o&&_<0||!o&&_>0)&&(v=void 0);let C=r.constrainedAxis;r.constrainedAxis=void 0,sd(e,t,n,v,!0,!1),r.constrainedAxis=C}else sd(e,t,n,v,!0,!1);if(l(r.constrainedAxis)){let _=h.cross(r.direction,r.constrainedAxis,$5);h.equalsEpsilon(_,h.ZERO,D.EPSILON6)||(h.dot(_,r.right)<0&&h.negate(_,_),h.cross(_,r.direction,r.up),h.cross(r.direction,r.up,r.right),h.normalize(r.up,r.up),h.normalize(r.right,r.right))}r._setTransform(S),e._globe=T,e._ellipsoid=E;let O=E.maximumRadius;e._rotateFactor=1/O,e._rotateRateRangeAdjustment=O;let L=h.clone(r.positionWC,jne);if(e.enableCollisionDetection&&Zne(e,!0),!h.equals(r.positionWC,L)){r._setTransform(x),r.worldToCameraCoordinatesPoint(L,L);let _=h.magnitudeSquared(L);h.magnitudeSquared(r.position)>_&&(h.normalize(r.position,r.position),h.multiplyByScalar(r.position,Math.sqrt(_),r.position));let C=h.angleBetween(L,r.position),w=h.cross(L,r.position,L);h.normalize(w,w);let P=Le.fromAxisAngle(w,C,VDt),M=$.fromQuaternion(P,jDt);$.multiplyByVector(M,r.direction,r.direction),$.multiplyByVector(M,r.up,r.up),h.cross(r.direction,r.up,r.right),h.cross(r.right,r.direction,r.up),r._setTransform(S)}}var b1e=new U,x1e=new pn,T1e=new h;function qDt(e,t,n){l(n.distance)&&(n=n.distance);let i=e._scene,r=i.camera,o=i.canvas,s=e._cameraUnderground,a;s?a=t:(a=b1e,a.x=o.clientWidth/2,a.y=o.clientHeight/2);let c=r.getPickRay(a,x1e),u=c.origin,f=c.direction,d=r.position.z,p;d<e._minimumPickingTerrainHeight&&(p=W_(e,a,T1e));let g;if(l(p)&&(g=h.distance(u,p)),s){let m=h1e(e,c,d);l(g)?g=Math.min(g,m):g=m}if(!l(g)){let m=h.UNIT_X;g=-h.dot(m,u)/h.dot(m,f)}Xne(e,t,n,e.zoomFactor,g)}function YDt(e){let n=e._scene.camera;if(!N.equals(N.IDENTITY,n.transform))_u(e,e.enableRotate,e.rotateEventTypes,sd,e.inertiaSpin,"_lastInertiaSpinMovement"),_u(e,e.enableZoom,e.zoomEventTypes,C1e,e.inertiaZoom,"_lastInertiaZoomMovement");else{let i=e._tweens;if(e._aggregator.anyButtonDown&&i.removeAll(),_u(e,e.enableTilt,e.tiltEventTypes,HDt,e.inertiaSpin,"_lastInertiaTiltMovement"),_u(e,e.enableTranslate,e.translateEventTypes,FDt,e.inertiaTranslate,"_lastInertiaTranslateMovement"),_u(e,e.enableZoom,e.zoomEventTypes,qDt,e.inertiaZoom,"_lastInertiaZoomMovement"),_u(e,e.enableLook,e.lookEventTypes,ad),!e._aggregator.anyButtonDown&&!i.contains(e._tween)){let r=n.createCorrectPositionTween(e.bounceAnimationTime);l(r)&&(e._tween=i.add(r))}i.update()}}var XDt=new pn,KDt=new sn(h.UNIT_X,0),$Dt=new h,JDt=new h;function Kne(e,t,n){let i=e._scene,r=i.camera,o=r.getPickRay(t.endPosition,XDt),s=h.clone(r.direction,JDt);i.mode===re.COLUMBUS_VIEW&&h.fromElements(s.z,s.x,s.y,s);let a=sn.fromPointNormal(n,s,KDt),c=_i.rayPlane(o,a,$Dt);l(c)&&(s=h.subtract(n,c,s),i.mode===re.COLUMBUS_VIEW&&h.fromElements(s.y,s.z,s.x,s),h.add(r.position,s,r.position))}var o1e=new h,E1e=new he,qne=new h,Yne=new ee,ZDt=new h,QDt=new h,e1t=new h;function t1t(e,t,n){let r=e._scene.camera,o=e._cameraUnderground,s=e._ellipsoid;if(!N.equals(r.transform,N.IDENTITY)){sd(e,t,n);return}let a,c,u=s.geodeticSurfaceNormal(r.position,ZDt);if(U.equals(t,e._rotateMousePosition)){if(e._looking)ad(e,t,n,u);else if(e._rotating)sd(e,t,n);else if(e._strafing)g1e(e,n);else{if(h.magnitude(r.position)<h.magnitude(e._rotateStartPosition))return;a=h.magnitude(e._rotateStartPosition),c=qne,c.x=c.y=c.z=a,s=ee.fromCartesian3(c,Yne),Gne(e,t,n,s)}return}e._looking=!1,e._rotating=!1,e._strafing=!1;let f=s.cartesianToCartographic(r.positionWC,E1e).height,d=e._globe;if(l(d)&&f<e._minimumPickingTerrainHeight){let p=W_(e,n.startPosition,e1t);if(l(p)){let g,m=r.getPickRay(n.startPosition,d1e);if(o)g=!0,p1e(e,m,p,p);else{let y=s.geodeticSurfaceNormal(p,QDt);Math.abs(h.dot(m.direction,y))<.05?g=!0:g=h.magnitude(r.position)<h.magnitude(p)}g?(U.clone(t,e._strafeEndMousePosition),h.clone(p,e._strafeStartPosition),e._strafing=!0,Kne(e,n,e._strafeStartPosition)):(a=h.magnitude(p),c=qne,c.x=c.y=c.z=a,s=ee.fromCartesian3(c,Yne),Gne(e,t,n,s),h.clone(p,e._rotateStartPosition))}else e._looking=!0,ad(e,t,n,u)}else l(r.pickEllipsoid(n.startPosition,e._ellipsoid,o1e))?(Gne(e,t,n,e._ellipsoid),h.clone(o1e,e._rotateStartPosition)):f>e._minimumTrackBallHeight?(e._rotating=!0,sd(e,t,n)):(e._looking=!0,ad(e,t,n,u));U.clone(t,e._rotateMousePosition)}function sd(e,t,n,i,r,o){r=r??!1,o=o??!1;let s=e._scene,a=s.camera,c=s.canvas,u=a.constrainedAxis;l(i)&&(a.constrainedAxis=i);let f=h.magnitude(a.position),d=e._rotateFactor*(f-e._rotateRateRangeAdjustment);d>e._maximumRotateRate&&(d=e._maximumRotateRate),d<e._minimumRotateRate&&(d=e._minimumRotateRate);let p=(n.startPosition.x-n.endPosition.x)/c.clientWidth,g=(n.startPosition.y-n.endPosition.y)/c.clientHeight;p=Math.min(p,e.maximumMovementRatio),g=Math.min(g,e.maximumMovementRatio);let m=d*p*Math.PI*2,y=d*g*Math.PI;if(l(i)&&l(e.maximumTiltAngle)){let A=e.maximumTiltAngle,b=h.dot(a.direction,i),x=Math.PI-Math.acos(b)+y;x>A&&(y-=x-A)}r||a.rotateRight(m),o||a.rotateUp(y),a.constrainedAxis=u}var Hne=se.clone(se.UNIT_W),s1e=se.clone(se.UNIT_W),q5=new h,yI=new h,Y5=new h,a1e=new h,n1t=new U,i1t=new U,r1t=new U,o1t=new U,s1t=new pn;function Gne(e,t,n,i){let r=e._scene,o=r.camera,s=U.clone(n.startPosition,n1t),a=U.clone(n.endPosition,i1t),c=i.cartesianToCartographic(o.positionWC,E1e).height,u,f;if(!n.inertiaEnabled&&c<e._minimumPickingTerrainHeight&&(u=h.clone(e._panLastWorldPosition,Hne),!l(e._globe)&&!U.equalsEpsilon(s,e._panLastMousePosition)&&(u=W_(e,s,Hne)),!l(e._globe)&&l(u))){let d=h.subtract(u,o.positionWC,yI),p=h.multiplyByScalar(o.directionWC,h.dot(o.directionWC,d),yI),g=h.magnitude(p),m=o.frustum.getPixelDimensions(r.drawingBufferWidth,r.drawingBufferHeight,g,r.pixelRatio,o1t),y=U.subtract(a,s,r1t),A=h.multiplyByScalar(o.rightWC,y.x*m.x,yI),b=h.normalize(o.positionWC,f1e),x=o.getPickRay(a,s1t).direction,T=h.subtract(x,h.projectVector(x,o.rightWC,Y5),Y5),E=h.angleBetween(T,o.directionWC),v=1;l(o.frustum.fov)&&(v=Math.max(Math.tan(E),.1));let S=Math.abs(h.dot(o.directionWC,b)),I=-y.y*m.y*2/Math.sqrt(v)*(1-S),R=h.multiplyByScalar(x,I,Y5);S=Math.abs(h.dot(o.upWC,b));let O=h.multiplyByScalar(o.upWC,-y.y*(1-S)*m.y,a1e);f=h.add(u,A,s1e),f=h.add(f,R,f),f=h.add(f,O,f),h.clone(f,e._panLastWorldPosition),U.clone(a,e._panLastMousePosition)}if((!l(u)||!l(f))&&(u=o.pickEllipsoid(s,i,Hne),f=o.pickEllipsoid(a,i,s1e)),!l(u)||!l(f)){e._rotating=!0,sd(e,t,n);return}if(u=o.worldToCameraCoordinates(u,u),f=o.worldToCameraCoordinates(f,f),l(o.constrainedAxis)){let d=o.constrainedAxis,p=h.mostOrthogonalAxis(d,q5);h.cross(p,d,p),h.normalize(p,p);let g=h.cross(d,p,yI),m=h.magnitude(u),y=h.dot(d,u),A=Math.acos(y/m),b=h.multiplyByScalar(d,y,Y5);h.subtract(u,b,b),h.normalize(b,b);let x=h.magnitude(f),T=h.dot(d,f),E=Math.acos(T/x),v=h.multiplyByScalar(d,T,a1e);h.subtract(f,v,v),h.normalize(v,v);let S=Math.acos(h.dot(b,p));h.dot(b,g)<0&&(S=D.TWO_PI-S);let I=Math.acos(h.dot(v,p));h.dot(v,g)<0&&(I=D.TWO_PI-I);let R=S-I,O;h.equalsEpsilon(d,o.position,D.EPSILON2)?O=o.right:O=h.cross(d,o.position,q5);let L=h.cross(d,O,q5),_=h.dot(L,h.subtract(u,d,yI)),C=h.dot(L,h.subtract(f,d,yI)),w;_>0&&C>0?w=E-A:_>0&&C<=0?h.dot(o.position,d)>0?w=-A-E:w=A+E:w=A-E,o.rotateRight(R),o.rotateUp(w)}else{h.normalize(u,u),h.normalize(f,f);let d=h.dot(u,f),p=h.cross(u,f,q5);if(d<1&&!h.equalsEpsilon(p,h.ZERO,D.EPSILON14)){let g=Math.acos(d);o.rotate(p,g)}}}var a1t=new h,c1t=new he,c1e=0;function C1e(e,t,n){l(n.distance)&&(n=n.distance);let i=n.inertiaEnabled,r=e._ellipsoid,o=e._scene,s=o.camera,a=o.canvas,c=e._cameraUnderground,u;c?u=t:(u=b1e,u.x=a.clientWidth/2,u.y=a.clientHeight/2);let f=s.getPickRay(u,x1e),d,p=r.cartesianToCartographic(s.position,c1t).height,g=Math.abs(c1e)<e.minimumPickingTerrainDistanceWithInertia;(i?g:p<e._minimumPickingTerrainHeight)&&(d=W_(e,u,T1e));let y;if(l(d)&&(y=h.distance(f.origin,d)),!l(e._globe)&&l(y)&&s.getMagnitude()<y&&(y=void 0),l(y)&&(c1e=y),c){let b=h1e(e,f,p);l(y)?y=Math.min(y,b):y=b}l(y)||(y=p);let A=h.normalize(s.position,a1t);Xne(e,t,n,e.zoomFactor,y,h.dot(A,s.direction))}var v1e=new U,J5=new pn,mz=new h,l1t=new h,S1e=new N,u1t=new N,w1e=new N,f1t=new Le,d1t=new $,$ne=new he,Jne=new h;function h1t(e,t,n){let r=e._scene.camera;if(!N.equals(r.transform,N.IDENTITY))return;if(l(n.angleAndHeight)&&(n=n.angleAndHeight),U.equals(t,e._tiltCenterMousePosition)||(e._tiltOnEllipsoid=!1,e._looking=!1),e._looking){let a=e._ellipsoid.geodeticSurfaceNormal(r.position,Jne);ad(e,t,n,a);return}let s=e._ellipsoid.cartesianToCartographic(r.position,$ne);e._tiltOnEllipsoid||s.height>e._minimumCollisionTerrainHeight?(e._tiltOnEllipsoid=!0,p1t(e,t,n)):g1t(e,t,n)}var m1t=new he;function p1t(e,t,n){let i=e._ellipsoid,r=e._scene,o=r.camera,s=e.minimumZoomDistance*.25,a=i.cartesianToCartographic(o.positionWC,m1t).height;if(a-s-1<D.EPSILON3&&n.endPosition.y-n.startPosition.y<0)return;let c=r.canvas,u=v1e;u.x=c.clientWidth/2,u.y=c.clientHeight/2;let f=o.getPickRay(u,J5),d,p=_i.rayEllipsoid(f,i);if(l(p))d=pn.getPoint(f,p.start,mz);else if(a>e._minimumTrackBallHeight){let x=_i.grazingAltitudeLocation(f,i);if(!l(x))return;let T=i.cartesianToCartographic(x,$ne);T.height=0,d=i.cartographicToCartesian(T,mz)}else{e._looking=!0;let x=e._ellipsoid.geodeticSurfaceNormal(o.position,Jne);ad(e,t,n,x),U.clone(t,e._tiltCenterMousePosition);return}let g=At.eastNorthUpToFixedFrame(d,i,S1e),m=e._globe,y=e._ellipsoid;e._globe=void 0,e._ellipsoid=ee.UNIT_SPHERE,e._rotateFactor=1,e._rotateRateRangeAdjustment=1;let A=N.clone(o.transform,w1e);o._setTransform(g),sd(e,t,n,h.UNIT_Z),o._setTransform(A),e._globe=m,e._ellipsoid=y;let b=y.maximumRadius;e._rotateFactor=1/b,e._rotateRateRangeAdjustment=b}function g1t(e,t,n){let i=e._ellipsoid,r=e._scene,o=r.camera,s=e._cameraUnderground,a,c,u;if(U.equals(t,e._tiltCenterMousePosition))a=h.clone(e._tiltCenter,mz);else{if(a=W_(e,t,mz),!l(a)){if(c=o.getPickRay(t,J5),u=_i.rayEllipsoid(c,i),!l(u)){if(i.cartesianToCartographic(o.position,$ne).height<=e._minimumTrackBallHeight){e._looking=!0;let C=e._ellipsoid.geodeticSurfaceNormal(o.position,Jne);ad(e,t,n,C),U.clone(t,e._tiltCenterMousePosition)}return}a=pn.getPoint(c,u.start,mz)}s&&(l(c)||(c=o.getPickRay(t,J5)),m1e(e,c,a,a)),U.clone(t,e._tiltCenterMousePosition),h.clone(a,e._tiltCenter)}let f=r.canvas,d=v1e;d.x=f.clientWidth/2,d.y=e._tiltCenterMousePosition.y,c=o.getPickRay(d,J5);let p=h.magnitude(a),g=h.fromElements(p,p,p,qne),m=ee.fromCartesian3(g,Yne);if(u=_i.rayEllipsoid(c,m),!l(u))return;let y=h.magnitude(c.origin)>p?u.start:u.stop,A=pn.getPoint(c,y,l1t),b=At.eastNorthUpToFixedFrame(a,i,S1e),x=At.eastNorthUpToFixedFrame(A,m,u1t),T=e._globe,E=e._ellipsoid;e._globe=void 0,e._ellipsoid=ee.UNIT_SPHERE,e._rotateFactor=1,e._rotateRateRangeAdjustment=1;let v=h.UNIT_Z,S=N.clone(o.transform,w1e);o._setTransform(x);let I=h.cross(A,o.positionWC,$5);if(h.dot(o.rightWC,I)<0){let _=n.startPosition.y-n.endPosition.y;(s&&_<0||!s&&_>0)&&(v=void 0);let C=o.constrainedAxis;o.constrainedAxis=void 0,sd(e,t,n,v,!0,!1),o.constrainedAxis=C}else sd(e,t,n,v,!0,!1);if(o._setTransform(b),sd(e,t,n,v,!1,!0),l(o.constrainedAxis)){let _=h.cross(o.direction,o.constrainedAxis,$5);h.equalsEpsilon(_,h.ZERO,D.EPSILON6)||(h.dot(_,o.right)<0&&h.negate(_,_),h.cross(_,o.direction,o.up),h.cross(o.direction,o.up,o.right),h.normalize(o.up,o.up),h.normalize(o.right,o.right))}o._setTransform(S),e._globe=T,e._ellipsoid=E;let O=E.maximumRadius;e._rotateFactor=1/O,e._rotateRateRangeAdjustment=O;let L=h.clone(o.positionWC,$5);if(e.enableCollisionDetection&&Zne(e,!0),!h.equals(o.positionWC,L)){o._setTransform(x),o.worldToCameraCoordinatesPoint(L,L);let _=h.magnitudeSquared(L);h.magnitudeSquared(o.position)>_&&(h.normalize(o.position,o.position),h.multiplyByScalar(o.position,Math.sqrt(_),o.position));let C=h.angleBetween(L,o.position),w=h.cross(L,o.position,L);h.normalize(w,w);let P=Le.fromAxisAngle(w,C,f1t),M=$.fromQuaternion(P,d1t);$.multiplyByVector(M,o.direction,o.direction),$.multiplyByVector(M,o.up,o.up),h.cross(o.direction,o.up,o.right),h.cross(o.right,o.direction,o.up),o._setTransform(S)}}var _1t=new U,y1t=new U,l1e=new pn,u1e=new pn,A1t=new h,b1t=new h;function ad(e,t,n,i){let o=e._scene.camera,s=_1t;s.x=n.startPosition.x,s.y=0;let a=y1t;a.x=n.endPosition.x,a.y=0;let c=o.getPickRay(s,l1e),u=o.getPickRay(a,u1e),f=0,d,p;o.frustum instanceof gn?(d=c.origin,p=u.origin,h.add(o.direction,d,d),h.add(o.direction,p,p),h.subtract(d,o.position,d),h.subtract(p,o.position,p),h.normalize(d,d),h.normalize(p,p)):(d=c.direction,p=u.direction);let g=h.dot(d,p);g<1&&(f=Math.acos(g)),f=n.startPosition.x>n.endPosition.x?-f:f;let m=e._horizontalRotationAxis;if(l(i)?o.look(i,-f):l(m)?o.look(m,-f):o.lookLeft(f),s.x=0,s.y=n.startPosition.y,a.x=0,a.y=n.endPosition.y,c=o.getPickRay(s,l1e),u=o.getPickRay(a,u1e),f=0,o.frustum instanceof gn?(d=c.origin,p=u.origin,h.add(o.direction,d,d),h.add(o.direction,p,p),h.subtract(d,o.position,d),h.subtract(p,o.position,p),h.normalize(d,d),h.normalize(p,p)):(d=c.direction,p=u.direction),g=h.dot(d,p),g<1&&(f=Math.acos(g)),f=n.startPosition.y>n.endPosition.y?-f:f,i=i??m,l(i)){let y=o.direction,A=h.negate(i,A1t),b=h.equalsEpsilon(y,i,D.EPSILON2),x=h.equalsEpsilon(y,A,D.EPSILON2);if(!b&&!x){g=h.dot(y,i);let T=D.acosClamped(g);f>0&&f>T&&(f=T-D.EPSILON4),g=h.dot(y,A),T=D.acosClamped(g),f<0&&-f>T&&(f=-T+D.EPSILON4);let E=h.cross(i,y,b1t);o.look(E,f)}else(b&&f<0||x&&f>0)&&o.look(o.right,-f)}else o.lookUp(f)}function x1t(e){_u(e,e.enableRotate,e.rotateEventTypes,t1t,e.inertiaSpin,"_lastInertiaSpinMovement"),_u(e,e.enableZoom,e.zoomEventTypes,C1e,e.inertiaZoom,"_lastInertiaZoomMovement"),_u(e,e.enableTilt,e.tiltEventTypes,h1t,e.inertiaSpin,"_lastInertiaTiltMovement"),_u(e,e.enableLook,e.lookEventTypes,ad)}var T1t=new N,E1t=new he;function Zne(e,t){e._adjustedHeightForTerrain=!0;let n=e._scene,i=n.mode;if(i===re.SCENE2D||i===re.MORPHING)return;let r=n.camera,o=n.ellipsoid??ee.WGS84,s=n.mapProjection,a,c;N.equals(r.transform,N.IDENTITY)||(a=N.clone(r.transform,T1t),c=h.magnitude(r.position),r._setTransform(N.IDENTITY));let u=E1t;i===re.SCENE3D?o.cartesianToCartographic(r.position,u):s.unproject(r.position,u);let f=!1;if(u.height<e._minimumCollisionTerrainHeight){let d=e._scene.globeHeight;if(l(d)){let p=d+e.minimumZoomDistance,g=d-e._lastGlobeHeight,m=g/e._lastGlobeHeight;u.height<p&&(t||Math.abs(m)<=.1)&&(u.height=p,i===re.SCENE3D?o.cartographicToCartesian(u,r.position):s.project(u,r.position),f=!0),t||Math.abs(m)<=.1?e._lastGlobeHeight=d:e._lastGlobeHeight+=g*.1}}l(a)&&(r._setTransform(a),f&&(h.normalize(r.position,r.position),h.negate(r.position,r.direction),h.multiplyByScalar(r.position,Math.max(c,e.minimumZoomDistance),r.position),h.normalize(r.direction,r.direction),h.cross(r.direction,r.up,r.right),h.cross(r.right,r.direction,r.up)))}pz.prototype.onMap=function(){let e=this._scene,t=e.mode,n=e.camera;return t===re.COLUMBUS_VIEW?Math.abs(n.position.x)-this._maxCoord.x<0&&Math.abs(n.position.y)-this._maxCoord.y<0:!0};var C1t=new h,v1t=new h;pz.prototype.update=function(){let e=this._scene,{camera:t,globe:n,mode:i}=e;N.equals(t.transform,N.IDENTITY)?(this._globe=n,this._ellipsoid=e.ellipsoid??ee.default):(this._globe=void 0,this._ellipsoid=ee.UNIT_SPHERE);let{verticalExaggeration:r,verticalExaggerationRelativeHeight:o}=e;this._minimumCollisionTerrainHeight=Ar.getHeight(this.minimumCollisionTerrainHeight,r,o),this._minimumPickingTerrainHeight=Ar.getHeight(this.minimumPickingTerrainHeight,r,o),this._minimumTrackBallHeight=Ar.getHeight(this.minimumTrackBallHeight,r,o),this._cameraUnderground=e.cameraUnderground&&l(this._globe);let s=this._ellipsoid.maximumRadius;this._rotateFactor=1/s,this._rotateRateRangeAdjustment=s,this._adjustedHeightForTerrain=!1;let a=h.clone(t.positionWC,C1t),c=h.clone(t.directionWC,v1t);if(i===re.SCENE2D?EDt(this):i===re.COLUMBUS_VIEW?(this._horizontalRotationAxis=h.UNIT_Z,YDt(this)):i===re.SCENE3D&&(this._horizontalRotationAxis=void 0,x1t(this)),this.enableCollisionDetection&&!this._adjustedHeightForTerrain){let u=!h.equals(a,t.positionWC)||!h.equals(c,t.directionWC);Zne(this,u)}this._aggregator.reset()};pz.prototype.isDestroyed=function(){return!1};pz.prototype.destroy=function(){return this._tweens.removeAll(),this._aggregator=this._aggregator&&this._aggregator.destroy(),le(this)};var gz=pz;function _z(e){let t=new sc(e);t.blendingEnabled=!1,t.scissorTest={enabled:!0,rectangle:new et},t.viewport=new et,this._context=e,this._fb=new ai({depthStencil:!0,pixelDatatype:ze.FLOAT,pixelFormat:Ke.RGBA}),this._passState=t}function S1t(e,t,n,i){let r=Math.max(n,i),o=r*r,s=Math.floor(n*.5),a=Math.floor(i*.5),c=0,u=0,f=0,d=-1,p=[];for(let g=0;g<o;++g){if(-s<=c&&c<=s&&-a<=u&&u<=a){let m=4*((a-u)*n+c+s),y=t[m],A=e.getObjectByPickColor(y);l(A)&&p.push({object:A,isEdge:t[m+1]>0,depth:t[m+2],x:c,y:u})}if(c===u||c<0&&-c===u||c>0&&c===1-u){let m=f;f=-d,d=m}c+=f,u+=d}return p}_z.prototype.begin=function(e,t){let n=this._context,{width:i,height:r}=t;return et.clone(e,this._passState.scissorTest.rectangle),this._fb.update(n,i,r),this._passState.framebuffer=this._fb.framebuffer,this._passState.viewport.width=i,this._passState.viewport.height=r,this._passState};_z.prototype.end=function(e){let t=e.width??1,n=e.height??1,i=this._context,r=i.readPixels({x:e.x,y:e.y,width:t,height:n,pixelDatatype:ze.FLOAT,framebuffer:this._fb.framebuffer});return S1t(i,r,t,n)};_z.prototype.isDestroyed=function(){return!1};_z.prototype.destroy=function(){return this._fb.destroy(),le(this)};var yz=_z;var Az={},w1t=new et(0,0,3,3),I1t=new U,P1t=new U,D1t=new pn,R1t=new h,O1t=3,M1t=.1,I1e=9;function Qne(e){return Math.sqrt(e.x*e.x+e.y*e.y)}function P1e(e){let t=Number.POSITIVE_INFINITY;for(let s of e)!s.isEdge&&Qne(s)<=O1t&&(t=Math.min(t,s.depth));let n=t*(1+M1t),i=e.filter(s=>!s.isEdge||s.depth<=n),r=i.some(s=>s.isEdge);return i.filter(s=>s.isEdge===r).reduce((s,a)=>Qne(a)<Qne(s)?a:s)}function D1e(e,t){let n,i=Number.POSITIVE_INFINITY;for(let r of e){if(r.isEdge||r.object!==t)continue;let o=r.x*r.x+r.y*r.y;o<i&&(n=r,i=o)}return n}function eie(e,t,n){let i=I1t;i.x=t.x+n.x,i.y=t.y+n.y;let r=e.camera.getPickRay(i,D1t);if(!l(r))return;let o=h.dot(r.direction,e.camera.directionWC);if(o<=0)return;let s=n.depth/o,a=h.multiplyByScalar(r.direction,s,R1t);return h.add(r.origin,a,new h)}Az.snap=function(e,t,n){let i=n?.width??25,r=n?.height??i,{context:o,defaultView:s}=e;if(!o.colorBufferFloat){_t("snap-color-buffer-float","Scene.snap requires the EXT_color_buffer_float extension, which is not supported on this platform.");return}l(s.snapFramebuffer)||(s.snapFramebuffer=new yz(o));let a=s.snapFramebuffer,c=w1t;UU(e,t,c,i,r,{framebuffer:a,snap:!0});let u=a.end(c);if(zU(e),u.length===0)return;let f=P1e(u);if(!l(f))return;let d=eie(e,t,f);if(!l(d))return;let p=d;if(f.isEdge){let g=P1t;g.x=t.x+f.x,g.y=t.y+f.y,UU(e,g,c,I1e,I1e,{framebuffer:a,snap:!0});let m=a.end(c);zU(e);let y=D1e(m,f.object);p=l(y)?eie(e,g,y):void 0}return{object:f.object,isEdge:f.isEdge,position:d,surfacePosition:p,screenPosition:new U(t.x+f.x,t.y+f.y)}};Az._selectBestHit=P1e;Az._nearestSurfaceHit=D1e;Az._snapHitToWorld=eie;var bz=Az;var xz=`uniform sampler2D colorTexture; uniform sampler2D colorTexture2; uniform vec2 center; uniform float radius; @@ -11236,7 +11236,7 @@ float x = length(gl_FragCoord.xy - center) / radius; float t = smoothstep(0.5, 0.8, x); out_FragColor = mix(color0 + color1, color1, t); } -`;var MV=`uniform sampler2D colorTexture; +`;var Tz=`uniform sampler2D colorTexture; uniform float avgLuminance; uniform float threshold; uniform float offset; @@ -11257,7 +11257,7 @@ float brightness = brightLum / (offset + brightLum); xyz.r = brightness; out_FragColor = vec4(czm_XYZToRGB(xyz), 1.0); } -`;function uy(){this._sceneFramebuffer=new fC;let e=.125,t=new Array(6);t[0]=new Ur({fragmentShader:df,textureScale:e,forcePowerOfTwo:!0,sampleMode:fd.LINEAR});let n=t[1]=new Ur({fragmentShader:MV,uniforms:{avgLuminance:.5,threshold:.25,offset:.1},textureScale:e,forcePowerOfTwo:!0}),i=this;this._delta=1,this._sigma=2,this._blurStep=new U,t[2]=new Ur({fragmentShader:Mb,uniforms:{step:function(){return i._blurStep.x=i._blurStep.y=1/n.outputTexture.width,i._blurStep},delta:function(){return i._delta},sigma:function(){return i._sigma},direction:0},textureScale:e,forcePowerOfTwo:!0}),t[3]=new Ur({fragmentShader:Mb,uniforms:{step:function(){return i._blurStep.x=i._blurStep.y=1/n.outputTexture.width,i._blurStep},delta:function(){return i._delta},sigma:function(){return i._sigma},direction:1},textureScale:e,forcePowerOfTwo:!0}),t[4]=new Ur({fragmentShader:df,sampleMode:fd.LINEAR}),this._uCenter=new U,this._uRadius=void 0,t[5]=new Ur({fragmentShader:OV,uniforms:{center:function(){return i._uCenter},radius:function(){return i._uRadius},colorTexture2:function(){return i._sceneFramebuffer.framebuffer.getColorTexture(0)}}}),this._stages=new hf({stages:t});let r=new gC(this),o=t.length;for(let s=0;s<o;++s)t[s]._textureCache=r;this._textureCache=r,this.length=t.length}uy.prototype.get=function(e){return this._stages.get(e)};uy.prototype.getStageByName=function(e){let t=this._stages.length;for(let n=0;n<t;++n){let i=this._stages.get(n);if(i.name===e)return i}};var Lkt=new se,UFe=new U,Fkt=new U,zFe=new N;function Bkt(e,t,n){let i=t.uniformState,r=i.sunPositionWC,o=i.view,s=i.viewProjection,a=i.projection,c=N.computeViewportTransformation(n,0,1,zFe),u=N.multiplyByPoint(o,r,Lkt),f=At.pointToGLWindowCoordinates(s,c,r,UFe);u.x+=D.SOLAR_RADIUS;let d=At.pointToGLWindowCoordinates(a,c,u,u),p=U.magnitude(U.subtract(d,f,d))*30*2,g=Fkt;g.x=p,g.y=p,e._uCenter=U.clone(f,e._uCenter),e._uRadius=Math.max(g.x,g.y)*.15;let m=t.drawingBufferWidth,y=t.drawingBufferHeight,A=e._stages,b=A.get(0),x=b.outputTexture.width,T=b.outputTexture.height,E=new et;E.width=x,E.height=T,c=N.computeViewportTransformation(E,0,1,zFe),f=At.pointToGLWindowCoordinates(s,c,r,UFe),g.x*=x/m,g.y*=T/y;let v=b.scissorRectangle;v.x=Math.max(f.x-g.x*.5,0),v.y=Math.max(f.y-g.y*.5,0),v.width=Math.min(g.x,m),v.height=Math.min(g.y,y);for(let S=1;S<4;++S)et.clone(v,A.get(S).scissorRectangle)}uy.prototype.clear=function(e,t,n){this._sceneFramebuffer.clear(e,t,n),this._textureCache.clear(e)};uy.prototype.update=function(e){let t=e.context,n=e.viewport,i=this._sceneFramebuffer;i.update(t,n);let r=i.framebuffer;return this._textureCache.update(t),this._stages.update(t,!1),Bkt(this,t,n),r};uy.prototype.execute=function(e){let t=this._sceneFramebuffer.framebuffer.getColorTexture(0),n=this._stages,i=n.length;n.get(0).execute(e,t);for(let r=1;r<i;++r)n.get(r).execute(e,n.get(r-1).outputTexture)};uy.prototype.copy=function(e,t){if(!l(this._copyColorCommand)){let n=this;this._copyColorCommand=e.createViewportQuadCommand(df,{uniformMap:{colorTexture:function(){return n._stages.get(n._stages.length-1).outputTexture}},owner:this})}this._copyColorCommand.framebuffer=t,this._copyColorCommand.execute(e)};uy.prototype.isDestroyed=function(){return!1};uy.prototype.destroy=function(){return this._textureCache.destroy(),this._stages.destroy(),le(this)};var NV=uy;function VFe(){this._cachedShowFrustumsShaders={}}function kkt(e){let t={},n=e.vertexAttributes;for(let i in n)n.hasOwnProperty(i)&&(t[i]=n[i].index);return t}function Ukt(e,t){let n=e.context,i=t,r=i.fragmentShaderSource.clone(),o=[];r.sources=r.sources.map(function(f){f=Ye.replaceMain(f,"czm_Debug_main");let d=/out_FragData_(\d+)/g,p;for(;(p=d.exec(f))!==null;)o.indexOf(p[1])===-1&&o.push(p[1]);return f});let s=o.length,a="";a+=`uniform vec3 debugShowCommandsColor; +`;function q_(){this._sceneFramebuffer=new NE;let e=.125,t=new Array(6);t[0]=new Ur({fragmentShader:sf,textureScale:e,forcePowerOfTwo:!0,sampleMode:id.LINEAR});let n=t[1]=new Ur({fragmentShader:Tz,uniforms:{avgLuminance:.5,threshold:.25,offset:.1},textureScale:e,forcePowerOfTwo:!0}),i=this;this._delta=1,this._sigma=2,this._blurStep=new U,t[2]=new Ur({fragmentShader:db,uniforms:{step:function(){return i._blurStep.x=i._blurStep.y=1/n.outputTexture.width,i._blurStep},delta:function(){return i._delta},sigma:function(){return i._sigma},direction:0},textureScale:e,forcePowerOfTwo:!0}),t[3]=new Ur({fragmentShader:db,uniforms:{step:function(){return i._blurStep.x=i._blurStep.y=1/n.outputTexture.width,i._blurStep},delta:function(){return i._delta},sigma:function(){return i._sigma},direction:1},textureScale:e,forcePowerOfTwo:!0}),t[4]=new Ur({fragmentShader:sf,sampleMode:id.LINEAR}),this._uCenter=new U,this._uRadius=void 0,t[5]=new Ur({fragmentShader:xz,uniforms:{center:function(){return i._uCenter},radius:function(){return i._uRadius},colorTexture2:function(){return i._sceneFramebuffer.framebuffer.getColorTexture(0)}}}),this._stages=new af({stages:t});let r=new UE(this),o=t.length;for(let s=0;s<o;++s)t[s]._textureCache=r;this._textureCache=r,this.length=t.length}q_.prototype.get=function(e){return this._stages.get(e)};q_.prototype.getStageByName=function(e){let t=this._stages.length;for(let n=0;n<t;++n){let i=this._stages.get(n);if(i.name===e)return i}};var N1t=new se,R1e=new U,L1t=new U,O1e=new N;function F1t(e,t,n){let i=t.uniformState,r=i.sunPositionWC,o=i.view,s=i.viewProjection,a=i.projection,c=N.computeViewportTransformation(n,0,1,O1e),u=N.multiplyByPoint(o,r,N1t),f=At.pointToGLWindowCoordinates(s,c,r,R1e);u.x+=D.SOLAR_RADIUS;let d=At.pointToGLWindowCoordinates(a,c,u,u),p=U.magnitude(U.subtract(d,f,d))*30*2,g=L1t;g.x=p,g.y=p,e._uCenter=U.clone(f,e._uCenter),e._uRadius=Math.max(g.x,g.y)*.15;let m=t.drawingBufferWidth,y=t.drawingBufferHeight,A=e._stages,b=A.get(0),x=b.outputTexture.width,T=b.outputTexture.height,E=new et;E.width=x,E.height=T,c=N.computeViewportTransformation(E,0,1,O1e),f=At.pointToGLWindowCoordinates(s,c,r,R1e),g.x*=x/m,g.y*=T/y;let v=b.scissorRectangle;v.x=Math.max(f.x-g.x*.5,0),v.y=Math.max(f.y-g.y*.5,0),v.width=Math.min(g.x,m),v.height=Math.min(g.y,y);for(let S=1;S<4;++S)et.clone(v,A.get(S).scissorRectangle)}q_.prototype.clear=function(e,t,n){this._sceneFramebuffer.clear(e,t,n),this._textureCache.clear(e)};q_.prototype.update=function(e){let t=e.context,n=e.viewport,i=this._sceneFramebuffer;i.update(t,n);let r=i.framebuffer;return this._textureCache.update(t),this._stages.update(t,!1),F1t(this,t,n),r};q_.prototype.execute=function(e){let t=this._sceneFramebuffer.framebuffer.getColorTexture(0),n=this._stages,i=n.length;n.get(0).execute(e,t);for(let r=1;r<i;++r)n.get(r).execute(e,n.get(r-1).outputTexture)};q_.prototype.copy=function(e,t){if(!l(this._copyColorCommand)){let n=this;this._copyColorCommand=e.createViewportQuadCommand(sf,{uniformMap:{colorTexture:function(){return n._stages.get(n._stages.length-1).outputTexture}},owner:this})}this._copyColorCommand.framebuffer=t,this._copyColorCommand.execute(e)};q_.prototype.isDestroyed=function(){return!1};q_.prototype.destroy=function(){return this._textureCache.destroy(),this._stages.destroy(),le(this)};var Ez=q_;function M1e(){this._cachedShowFrustumsShaders={}}function B1t(e){let t={},n=e.vertexAttributes;for(let i in n)n.hasOwnProperty(i)&&(t[i]=n[i].index);return t}function k1t(e,t){let n=e.context,i=t,r=i.fragmentShaderSource.clone(),o=[];r.sources=r.sources.map(function(f){f=Ye.replaceMain(f,"czm_Debug_main");let d=/out_FragData_(\d+)/g,p;for(;(p=d.exec(f))!==null;)o.indexOf(p[1])===-1&&o.push(p[1]);return f});let s=o.length,a="";a+=`uniform vec3 debugShowCommandsColor; `,a+=`uniform vec3 debugShowFrustumsColor; `,a+=`void main() { @@ -11266,11 +11266,11 @@ out_FragColor = vec4(czm_XYZToRGB(xyz), 1.0); `,a+=` out_FragData_${o[c]}.rgb *= debugShowFrustumsColor; `;else a+=` out_FragColor.rgb *= debugShowCommandsColor; `,a+=` out_FragColor.rgb *= debugShowFrustumsColor; -`;a+="}",r.sources.push(a);let u=kkt(i);return Qt.fromCache({context:n,vertexShaderSource:i.vertexShaderSource,fragmentShaderSource:r,attributeLocations:u})}var LV=new z;function zkt(e,t){let n;return l(t.uniformMap)?n=t.uniformMap:n={},l(n.debugShowCommandsColor)||l(n.debugShowFrustumsColor)||(n.debugShowCommandsColor=function(){return e.debugShowCommands?(l(t._debugColor)||(t._debugColor=z.fromRandom()),t._debugColor):z.WHITE},n.debugShowFrustumsColor=function(){return e.debugShowFrustums?(LV.red=t.debugOverlappingFrustums&1?1:0,LV.green=t.debugOverlappingFrustums&2?1:0,LV.blue=t.debugOverlappingFrustums&4?1:0,LV.alpha=1,LV):z.WHITE}),n}var Vkt=new at;VFe.prototype.executeDebugShowFrustumsCommand=function(e,t,n){let i=t.shaderProgram.id,r=this._cachedShowFrustumsShaders[i];l(r)||(r=Ukt(e,t.shaderProgram),this._cachedShowFrustumsShaders[i]=r);let o=at.shallowClone(t,Vkt);o.shaderProgram=r,o.uniformMap=zkt(e,t),o.execute(e.context,n)};var FV=VFe;function TC(e,t,n){this._primitive=e,this._tileIndex=t,this._sampleIndex=n,this._metadata={},this._orientedBoundingBox=new en}TC.fromKeyframeNode=function(e,t,n,i){let r=new TC(e,t,n),{spatialNode:o,content:s}=i;return r._metadata=jkt(e,s,n),r._orientedBoundingBox=Gkt(e,o,n,r._orientedBoundingBox),r};function jkt(e,t,n){if(!l(t)||!l(t.metadata))return;let{names:i,types:r}=e.provider,{metadata:o}=t,s={};for(let a=0;a<i.length;a++){let c=i[a],u=bt.getComponentCount(r[a]),f=o[a].slice(n*u,(n+1)*u);s[c]=f}return s}var jFe=new h,Hkt=new h;function Gkt(e,t,n,i){let r=t.dimensions,o=r.x*r.y,s=Math.floor(n/o),a=n-s*o,c=Math.floor(a/r.x),u=a-c*r.x,f=h.fromElements(u,c,s,jFe),d=h.divideComponents(h.subtract(f,e._paddingBefore,jFe),e.dimensions,Hkt);return e._shape.computeOrientedBoundingBoxForSample(t,e.dimensions,d,i)}Object.defineProperties(TC.prototype,{metadata:{get:function(){return this._metadata}},primitive:{get:function(){return this._primitive}},sampleIndex:{get:function(){return this._sampleIndex}},tileIndex:{get:function(){return this._tileIndex}},orientedBoundingBox:{get:function(){return this._orientedBoundingBox.clone()}}});TC.prototype.hasProperty=function(e){return l(this._metadata[e])};TC.prototype.getNames=function(){return Object.keys(this._metadata)};TC.prototype.getProperty=function(e){return this._metadata[e]};var BV=TC;function Wkt(e,t){let n=document.createElement("canvas");n.width=t,n.height=1;let i=n.getContext("2d"),r=i.createLinearGradient(0,0,n.width,0),o=1/(e.length-1);for(let c=0;c<e.length;c++){let u=e[c],f=c*o,d=u.toCssColorString();r.addColorStop(f,d)}i.fillStyle=r,i.fillRect(0,0,n.width,n.height);let s=i.getImageData(0,0,n.width,n.height);return new Uint8Array(s.data.buffer)}var kV=Wkt;var HFe={FLOAT:"float",VEC2:"vec2",VEC3:"vec3",VEC4:"vec4",INT:"int",INT_VEC2:"ivec2",INT_VEC3:"ivec3",INT_VEC4:"ivec4",BOOL:"bool",BOOL_VEC2:"bvec2",BOOL_VEC3:"bvec3",BOOL_VEC4:"bvec4",MAT2:"mat2",MAT3:"mat3",MAT4:"mat4",SAMPLER_2D:"sampler2D",SAMPLER_CUBE:"samplerCube"};Object.freeze(HFe);var j0=HFe;function qkt(e,t,n){let i=new Uint8ClampedArray(e.buffer),r=new ImageData(i,t,n),o=document.createElement("canvas");return o.width=t,o.height=n,o.getContext("2d").putImageData(r,0,0),o}var UV=qkt;function CP(){this._defaultTexture=void 0,this._textures={},this._loadedImages=[],this._lastUpdatedFrame=-1}CP.prototype.getTexture=function(e){return this._textures[e]};function Ykt(e,t,n){n.resource.fetchImage().then(function(i){e._loadedImages.push({id:t,image:i,textureUniform:n})}).catch(function(){let i=e._textures[t];l(i)&&i!==e._defaultTexture&&i.destroy(),e._textures[t]=e._defaultTexture})}CP.prototype.loadTexture2D=function(e,t){l(t.typedArray)?this._loadedImages.push({id:e,textureUniform:t}):Ykt(this,e,t)};function Xkt(e,t,n){let{id:i,textureUniform:r,image:o}=t,s=n.webgl2?uW(r,o,n):Kkt(r,o,n),a=e._textures[i];l(a)&&a!==n.defaultTexture&&a.destroy(),e._textures[i]=s}function uW(e,t,n){let{typedArray:i,sampler:r}=e,o=l(i)?WFe(e,n):new Dt({context:n,source:t,sampler:r});return GFe(r)&&o.generateMipmap(),o}function Kkt(e,t,n){let{typedArray:i,sampler:r}=e,o=GFe(r),s=r.wrapS===hn.REPEAT||r.wrapS===hn.MIRRORED_REPEAT||r.wrapT===hn.REPEAT||r.wrapT===hn.MIRRORED_REPEAT,{width:a,height:c}=l(i)?e:t,u=[a,c].every(D.isPowerOfTwo);if((o||s)&&!u)if(l(i)){if(e.pixelDatatype===ze.UNSIGNED_BYTE){let d=UV(i,a,c),p=uA(d);return uW({sampler:r},p,n)}}else{let d=uA(t);return uW(e,d,n)}else return uW(e,t,n);return o?console.warn("Texture requires resizing for mipmaps but pixelDataType cannot be resized. The texture may be rendered incorrectly."):s&&console.warn("Texture requires resizing for wrapping but pixelDataType cannot be resized. The texture may be rendered incorrectly."),WFe(e,n)}function GFe(e){return[Wt.NEAREST_MIPMAP_NEAREST,Wt.NEAREST_MIPMAP_LINEAR,Wt.LINEAR_MIPMAP_NEAREST,Wt.LINEAR_MIPMAP_LINEAR].includes(e.minificationFilter)}function WFe(e,t){let{pixelFormat:n,pixelDatatype:i,width:r,height:o,typedArray:s,sampler:a}=e;return new Dt({context:t,pixelFormat:n,pixelDatatype:i,source:{arrayBufferView:s,width:r,height:o},sampler:a,flipY:!1})}CP.prototype.update=function(e){if(e.frameNumber===this._lastUpdatedFrame)return;this._lastUpdatedFrame=e.frameNumber;let t=e.context;this._defaultTexture=t.defaultTexture;let n=this._loadedImages;for(let i=0;i<n.length;i++){let r=n[i];Xkt(this,r,t)}n.length=0};CP.prototype.isDestroyed=function(){return!1};CP.prototype.destroy=function(){let e=this._textures;for(let t in e)if(e.hasOwnProperty(t)){let n=e[t];n!==this._defaultTexture&&n.destroy()}return le(this)};var zV=CP;function VV(e){e=e??H.EMPTY_OBJECT,this.mode=e.mode??Zg.MODIFY_MATERIAL,this.lightingModel=e.lightingModel,this.uniforms=e.uniforms??H.EMPTY_OBJECT,this.varyings=e.varyings??H.EMPTY_OBJECT,this.vertexShaderText=e.vertexShaderText,this.fragmentShaderText=e.fragmentShaderText,this.translucencyMode=e.translucencyMode??vA.INHERIT,this._textureManager=new zV,this._defaultTexture=void 0,this.uniformMap=$kt(this),this.usedVariablesVertex={attributeSet:{},featureIdSet:{},metadataSet:{}},this.usedVariablesFragment={attributeSet:{},featureIdSet:{},metadataSet:{},materialSet:{}},Qkt(this),e3t(this)}function $kt(e){let t=e.uniforms,n={};for(let i in t)if(t.hasOwnProperty(i)){let r=t[i];r.type===j0.SAMPLER_2D?(e._textureManager.loadTexture2D(i,r.value),n[i]=Jkt(e,i)):n[i]=Zkt(e,i)}return n}function Jkt(e,t){return function(){return e._textureManager.getTexture(t)??e._defaultTexture}}function Zkt(e,t){return function(){return e.uniforms[t].value}}function EC(e,t,n){let i;for(;(i=t.exec(e))!==null;){let r=i[1];n[r]=!0}}function Qkt(e){let t=/[vf]sInput\.attributes\.(\w+)/g,n=/[vf]sInput\.featureIds\.(\w+)/g,i=/[vf]sInput\.(?:metadata|metadataClass|metadataStatistics)\.(\w+)/g,r,o=e.vertexShaderText;l(o)&&(r=e.usedVariablesVertex.attributeSet,EC(o,t,r),r=e.usedVariablesVertex.featureIdSet,EC(o,n,r),r=e.usedVariablesVertex.metadataSet,EC(o,i,r));let s=e.fragmentShaderText;if(l(s)){r=e.usedVariablesFragment.attributeSet,EC(s,t,r),r=e.usedVariablesFragment.featureIdSet,EC(s,n,r),r=e.usedVariablesFragment.metadataSet,EC(s,i,r);let a=/material\.(\w+)/g,c=e.usedVariablesFragment.materialSet;EC(s,a,c)}}function qFe(e){let t=/^.*MC$/,n=/^.*WC$/,i=/^.*EC$/;return t.test(e)?`${e} (model coordinates)`:n.test(e)?`${e} (Cartesian world coordinates)`:i.test(e)?`${e} (eye coordinates)`:e}function wl(e,t,n,i){if(e.hasOwnProperty(t)){let r=`${qFe(t)} is not available in the ${i} shader. Did you mean ${qFe(n)} instead?`;throw new pe(r)}}function e3t(e){let t=e.usedVariablesVertex.attributeSet;wl(t,"position","positionMC","vertex"),wl(t,"normal","normalMC","vertex"),wl(t,"tangent","tangentMC","vertex"),wl(t,"bitangent","bitangentMC","vertex"),wl(t,"positionWC","positionMC","vertex"),wl(t,"positionEC","positionMC","vertex"),wl(t,"normalEC","normalMC","vertex"),wl(t,"tangentEC","tangentMC","vertex"),wl(t,"bitangentEC","bitangentMC","vertex");let n=e.usedVariablesFragment.attributeSet;wl(n,"position","positionEC","fragment"),wl(n,"normal","normalEC","fragment"),wl(n,"tangent","tangentEC","fragment"),wl(n,"bitangent","bitangentEC","fragment"),wl(n,"normalMC","normalEC","fragment"),wl(n,"tangentMC","tangentEC","fragment"),wl(n,"bitangentMC","bitangentEC","fragment")}VV.prototype.setUniform=function(e,t){let n=this.uniforms[e];n.type===j0.SAMPLER_2D?this._textureManager.loadTexture2D(e,t):l(t.clone)?n.value=t.clone(n.value):n.value=t};VV.prototype.update=function(e){this._defaultTexture=e.context.defaultTexture,this._textureManager.update(e)};VV.prototype.isDestroyed=function(){return!1};VV.prototype.destroy=function(){this._textureManager=this._textureManager&&this._textureManager.destroy(),le(this)};var H0=VV;function t3t(e){e=e??H.EMPTY_OBJECT,this.typedArray=e.typedArray,this.width=e.width,this.height=e.height,this.pixelFormat=e.pixelFormat??Ke.RGBA,this.pixelDatatype=e.pixelDatatype??ze.UNSIGNED_BYTE;let t=e.url;typeof t=="string"&&(t=De.createIfNeeded(t)),this.resource=t;let i=e.repeat??!0?hn.REPEAT:hn.CLAMP_TO_EDGE;this.sampler=new jt({wrapS:i,wrapT:i,minificationFilter:e.minificationFilter,magnificationFilter:e.magnificationFilter,maximumAnisotropy:e.maximumAnisotropy})}var jV=t3t;function n3t(e){let{names:t,types:n,componentTypes:i,minimumValues:r,maximumValues:o}=e;for(let s=0;s<t.length;s++){if(!i3t(r?.[s],o?.[s]))continue;let a=r3t(t[s],n[s],i[s],r[s],o[s]);if(l(a))return a}}function i3t(e,t){if(!Array.isArray(e)||!Array.isArray(t))return!1;let n=Math.min(...e),i=Math.max(...t);return n<i}function r3t(e,t,n,i,r){if(t===bt.VEC4&&n===Lt.FLOAT32)return o3t(e,i,r);if(t===bt.SCALAR&&n===Lt.FLOAT32)return s3t(e,i,r)}function o3t(e,t,n){let i=Math.min(...t),r=Math.max(...n);if(!(i<0||r>1))return new H0({fragmentShaderText:`void fragmentMain(FragmentInput fsInput, inout czm_modelMaterial material) +`;a+="}",r.sources.push(a);let u=B1t(i);return Qt.fromCache({context:n,vertexShaderSource:i.vertexShaderSource,fragmentShaderSource:r,attributeLocations:u})}var Cz=new z;function U1t(e,t){let n;return l(t.uniformMap)?n=t.uniformMap:n={},l(n.debugShowCommandsColor)||l(n.debugShowFrustumsColor)||(n.debugShowCommandsColor=function(){return e.debugShowCommands?(l(t._debugColor)||(t._debugColor=z.fromRandom()),t._debugColor):z.WHITE},n.debugShowFrustumsColor=function(){return e.debugShowFrustums?(Cz.red=t.debugOverlappingFrustums&1?1:0,Cz.green=t.debugOverlappingFrustums&2?1:0,Cz.blue=t.debugOverlappingFrustums&4?1:0,Cz.alpha=1,Cz):z.WHITE}),n}var z1t=new at;M1e.prototype.executeDebugShowFrustumsCommand=function(e,t,n){let i=t.shaderProgram.id,r=this._cachedShowFrustumsShaders[i];l(r)||(r=k1t(e,t.shaderProgram),this._cachedShowFrustumsShaders[i]=r);let o=at.shallowClone(t,z1t);o.shaderProgram=r,o.uniformMap=U1t(e,t),o.execute(e.context,n)};var vz=M1e;function WE(e,t,n){this._primitive=e,this._tileIndex=t,this._sampleIndex=n,this._metadata={},this._orientedBoundingBox=new en}WE.fromKeyframeNode=function(e,t,n,i){let r=new WE(e,t,n),{spatialNode:o,content:s}=i;return r._metadata=V1t(e,s,n),r._orientedBoundingBox=H1t(e,o,n,r._orientedBoundingBox),r};function V1t(e,t,n){if(!l(t)||!l(t.metadata))return;let{names:i,types:r}=e.provider,{metadata:o}=t,s={};for(let a=0;a<i.length;a++){let c=i[a],u=bt.getComponentCount(r[a]),f=o[a].slice(n*u,(n+1)*u);s[c]=f}return s}var N1e=new h,j1t=new h;function H1t(e,t,n,i){let r=t.dimensions,o=r.x*r.y,s=Math.floor(n/o),a=n-s*o,c=Math.floor(a/r.x),u=a-c*r.x,f=h.fromElements(u,c,s,N1e),d=h.divideComponents(h.subtract(f,e._paddingBefore,N1e),e.dimensions,j1t);return e._shape.computeOrientedBoundingBoxForSample(t,e.dimensions,d,i)}Object.defineProperties(WE.prototype,{metadata:{get:function(){return this._metadata}},primitive:{get:function(){return this._primitive}},sampleIndex:{get:function(){return this._sampleIndex}},tileIndex:{get:function(){return this._tileIndex}},orientedBoundingBox:{get:function(){return this._orientedBoundingBox.clone()}}});WE.prototype.hasProperty=function(e){return l(this._metadata[e])};WE.prototype.getNames=function(){return Object.keys(this._metadata)};WE.prototype.getProperty=function(e){return this._metadata[e]};var Sz=WE;function G1t(e,t){let n=document.createElement("canvas");n.width=t,n.height=1;let i=n.getContext("2d"),r=i.createLinearGradient(0,0,n.width,0),o=1/(e.length-1);for(let c=0;c<e.length;c++){let u=e[c],f=c*o,d=u.toCssColorString();r.addColorStop(f,d)}i.fillStyle=r,i.fillRect(0,0,n.width,n.height);let s=i.getImageData(0,0,n.width,n.height);return new Uint8Array(s.data.buffer)}var wz=G1t;var L1e={FLOAT:"float",VEC2:"vec2",VEC3:"vec3",VEC4:"vec4",INT:"int",INT_VEC2:"ivec2",INT_VEC3:"ivec3",INT_VEC4:"ivec4",BOOL:"bool",BOOL_VEC2:"bvec2",BOOL_VEC3:"bvec3",BOOL_VEC4:"bvec4",MAT2:"mat2",MAT3:"mat3",MAT4:"mat4",SAMPLER_2D:"sampler2D",SAMPLER_CUBE:"samplerCube"};Object.freeze(L1e);var P0=L1e;function W1t(e,t,n){let i=new Uint8ClampedArray(e.buffer),r=new ImageData(i,t,n),o=document.createElement("canvas");return o.width=t,o.height=n,o.getContext("2d").putImageData(r,0,0),o}var Iz=W1t;function AI(){this._defaultTexture=void 0,this._textures={},this._loadedImages=[],this._lastUpdatedFrame=-1}AI.prototype.getTexture=function(e){return this._textures[e]};function q1t(e,t,n){n.resource.fetchImage().then(function(i){e._loadedImages.push({id:t,image:i,textureUniform:n})}).catch(function(){let i=e._textures[t];l(i)&&i!==e._defaultTexture&&i.destroy(),e._textures[t]=e._defaultTexture})}AI.prototype.loadTexture2D=function(e,t){l(t.typedArray)?this._loadedImages.push({id:e,textureUniform:t}):q1t(this,e,t)};function Y1t(e,t,n){let{id:i,textureUniform:r,image:o}=t,s=n.webgl2?Q5(r,o,n):X1t(r,o,n),a=e._textures[i];l(a)&&a!==n.defaultTexture&&a.destroy(),e._textures[i]=s}function Q5(e,t,n){let{typedArray:i,sampler:r}=e,o=l(i)?B1e(e,n):new Dt({context:n,source:t,sampler:r});return F1e(r)&&o.generateMipmap(),o}function X1t(e,t,n){let{typedArray:i,sampler:r}=e,o=F1e(r),s=r.wrapS===hn.REPEAT||r.wrapS===hn.MIRRORED_REPEAT||r.wrapT===hn.REPEAT||r.wrapT===hn.MIRRORED_REPEAT,{width:a,height:c}=l(i)?e:t,u=[a,c].every(D.isPowerOfTwo);if((o||s)&&!u)if(l(i)){if(e.pixelDatatype===ze.UNSIGNED_BYTE){let d=Iz(i,a,c),p=yA(d);return Q5({sampler:r},p,n)}}else{let d=yA(t);return Q5(e,d,n)}else return Q5(e,t,n);return o?console.warn("Texture requires resizing for mipmaps but pixelDataType cannot be resized. The texture may be rendered incorrectly."):s&&console.warn("Texture requires resizing for wrapping but pixelDataType cannot be resized. The texture may be rendered incorrectly."),B1e(e,n)}function F1e(e){return[Wt.NEAREST_MIPMAP_NEAREST,Wt.NEAREST_MIPMAP_LINEAR,Wt.LINEAR_MIPMAP_NEAREST,Wt.LINEAR_MIPMAP_LINEAR].includes(e.minificationFilter)}function B1e(e,t){let{pixelFormat:n,pixelDatatype:i,width:r,height:o,typedArray:s,sampler:a}=e;return new Dt({context:t,pixelFormat:n,pixelDatatype:i,source:{arrayBufferView:s,width:r,height:o},sampler:a,flipY:!1})}AI.prototype.update=function(e){if(e.frameNumber===this._lastUpdatedFrame)return;this._lastUpdatedFrame=e.frameNumber;let t=e.context;this._defaultTexture=t.defaultTexture;let n=this._loadedImages;for(let i=0;i<n.length;i++){let r=n[i];Y1t(this,r,t)}n.length=0};AI.prototype.isDestroyed=function(){return!1};AI.prototype.destroy=function(){let e=this._textures;for(let t in e)if(e.hasOwnProperty(t)){let n=e[t];n!==this._defaultTexture&&n.destroy()}return le(this)};var Pz=AI;function Dz(e){e=e??H.EMPTY_OBJECT,this.mode=e.mode??r_.MODIFY_MATERIAL,this.lightingModel=e.lightingModel,this.uniforms=e.uniforms??H.EMPTY_OBJECT,this.varyings=e.varyings??H.EMPTY_OBJECT,this.vertexShaderText=e.vertexShaderText,this.fragmentShaderText=e.fragmentShaderText,this.translucencyMode=e.translucencyMode??wA.INHERIT,this._textureManager=new Pz,this._defaultTexture=void 0,this.uniformMap=K1t(this),this.usedVariablesVertex={attributeSet:{},featureIdSet:{},metadataSet:{}},this.usedVariablesFragment={attributeSet:{},featureIdSet:{},metadataSet:{},materialSet:{}},Z1t(this),Q1t(this)}function K1t(e){let t=e.uniforms,n={};for(let i in t)if(t.hasOwnProperty(i)){let r=t[i];r.type===P0.SAMPLER_2D?(e._textureManager.loadTexture2D(i,r.value),n[i]=$1t(e,i)):n[i]=J1t(e,i)}return n}function $1t(e,t){return function(){return e._textureManager.getTexture(t)??e._defaultTexture}}function J1t(e,t){return function(){return e.uniforms[t].value}}function qE(e,t,n){let i;for(;(i=t.exec(e))!==null;){let r=i[1];n[r]=!0}}function Z1t(e){let t=/[vf]sInput\.attributes\.(\w+)/g,n=/[vf]sInput\.featureIds\.(\w+)/g,i=/[vf]sInput\.(?:metadata|metadataClass|metadataStatistics)\.(\w+)/g,r,o=e.vertexShaderText;l(o)&&(r=e.usedVariablesVertex.attributeSet,qE(o,t,r),r=e.usedVariablesVertex.featureIdSet,qE(o,n,r),r=e.usedVariablesVertex.metadataSet,qE(o,i,r));let s=e.fragmentShaderText;if(l(s)){r=e.usedVariablesFragment.attributeSet,qE(s,t,r),r=e.usedVariablesFragment.featureIdSet,qE(s,n,r),r=e.usedVariablesFragment.metadataSet,qE(s,i,r);let a=/material\.(\w+)/g,c=e.usedVariablesFragment.materialSet;qE(s,a,c)}}function k1e(e){let t=/^.*MC$/,n=/^.*WC$/,i=/^.*EC$/;return t.test(e)?`${e} (model coordinates)`:n.test(e)?`${e} (Cartesian world coordinates)`:i.test(e)?`${e} (eye coordinates)`:e}function El(e,t,n,i){if(e.hasOwnProperty(t)){let r=`${k1e(t)} is not available in the ${i} shader. Did you mean ${k1e(n)} instead?`;throw new pe(r)}}function Q1t(e){let t=e.usedVariablesVertex.attributeSet;El(t,"position","positionMC","vertex"),El(t,"normal","normalMC","vertex"),El(t,"tangent","tangentMC","vertex"),El(t,"bitangent","bitangentMC","vertex"),El(t,"positionWC","positionMC","vertex"),El(t,"positionEC","positionMC","vertex"),El(t,"normalEC","normalMC","vertex"),El(t,"tangentEC","tangentMC","vertex"),El(t,"bitangentEC","bitangentMC","vertex");let n=e.usedVariablesFragment.attributeSet;El(n,"position","positionEC","fragment"),El(n,"normal","normalEC","fragment"),El(n,"tangent","tangentEC","fragment"),El(n,"bitangent","bitangentEC","fragment"),El(n,"normalMC","normalEC","fragment"),El(n,"tangentMC","tangentEC","fragment"),El(n,"bitangentMC","bitangentEC","fragment")}Dz.prototype.setUniform=function(e,t){let n=this.uniforms[e];n.type===P0.SAMPLER_2D?this._textureManager.loadTexture2D(e,t):l(t.clone)?n.value=t.clone(n.value):n.value=t};Dz.prototype.update=function(e){this._defaultTexture=e.context.defaultTexture,this._textureManager.update(e)};Dz.prototype.isDestroyed=function(){return!1};Dz.prototype.destroy=function(){this._textureManager=this._textureManager&&this._textureManager.destroy(),le(this)};var D0=Dz;function eRt(e){e=e??H.EMPTY_OBJECT,this.typedArray=e.typedArray,this.width=e.width,this.height=e.height,this.pixelFormat=e.pixelFormat??Ke.RGBA,this.pixelDatatype=e.pixelDatatype??ze.UNSIGNED_BYTE;let t=e.url;typeof t=="string"&&(t=De.createIfNeeded(t)),this.resource=t;let i=e.repeat??!0?hn.REPEAT:hn.CLAMP_TO_EDGE;this.sampler=new jt({wrapS:i,wrapT:i,minificationFilter:e.minificationFilter,magnificationFilter:e.magnificationFilter,maximumAnisotropy:e.maximumAnisotropy})}var Rz=eRt;function tRt(e){let{names:t,types:n,componentTypes:i,minimumValues:r,maximumValues:o}=e;for(let s=0;s<t.length;s++){if(!nRt(r?.[s],o?.[s]))continue;let a=iRt(t[s],n[s],i[s],r[s],o[s]);if(l(a))return a}}function nRt(e,t){if(!Array.isArray(e)||!Array.isArray(t))return!1;let n=Math.min(...e),i=Math.max(...t);return n<i}function iRt(e,t,n,i,r){if(t===bt.VEC4&&n===Lt.FLOAT32)return rRt(e,i,r);if(t===bt.SCALAR&&n===Lt.FLOAT32)return oRt(e,i,r)}function rRt(e,t,n){let i=Math.min(...t),r=Math.max(...n);if(!(i<0||r>1))return new D0({fragmentShaderText:`void fragmentMain(FragmentInput fsInput, inout czm_modelMaterial material) { material.diffuse = fsInput.metadata.${e}.rgb; material.alpha = fsInput.metadata.${e}.a; -}`})}function s3t(e,t,n){let r=kV([new z(.267,.004,.329),new z(.282,.14,.457),new z(.254,.265,.53),new z(.207,.372,.553),new z(.164,.471,.558),new z(.128,.567,.551),new z(.135,.659,.518),new z(.194,.741,.443),new z(.282,.819,.369),new z(.396,.898,.301),new z(.538,.965,.236),new z(.741,.998,.149),new z(.993,1,.144)],128),o=new jV({typedArray:r,width:128,height:1});return new H0({uniforms:{u_colorMap:{type:j0.SAMPLER_2D,value:o},u_minimumValue:{type:j0.FLOAT,value:t[0]},u_maximumValue:{type:j0.FLOAT,value:n[0]}},fragmentShaderText:`void fragmentMain(FragmentInput fsInput, inout czm_modelMaterial material) +}`})}function oRt(e,t,n){let r=wz([new z(.267,.004,.329),new z(.282,.14,.457),new z(.254,.265,.53),new z(.207,.372,.553),new z(.164,.471,.558),new z(.128,.567,.551),new z(.135,.659,.518),new z(.194,.741,.443),new z(.282,.819,.369),new z(.396,.898,.301),new z(.538,.965,.236),new z(.741,.998,.149),new z(.993,1,.144)],128),o=new Rz({typedArray:r,width:128,height:1});return new D0({uniforms:{u_colorMap:{type:P0.SAMPLER_2D,value:o},u_minimumValue:{type:P0.FLOAT,value:t[0]},u_maximumValue:{type:P0.FLOAT,value:n[0]}},fragmentShaderText:`void fragmentMain(FragmentInput fsInput, inout czm_modelMaterial material) { float value = fsInput.metadata.${e}; vec3 voxelNormal = fsInput.attributes.normalEC; @@ -11282,7 +11282,7 @@ out_FragColor = vec4(czm_XYZToRGB(xyz), 1.0); material.diffuse = texture(u_colorMap, vec2(lerp, 0.5)).rgb * lighting; material.alpha = 1.0; } - }`})}var vP=n3t;function a3t(e,t){let{shaderBuilder:n}=e,{names:i,types:r,componentTypes:o,minimumValues:s,maximumValues:a}=t._provider,c=r.length,u=l(s)&&l(a);n.addDefine("METADATA_COUNT",c,de.FRAGMENT),u&&n.addDefine("STATISTICS",void 0,de.FRAGMENT);for(let _=0;_<c;_++){let C=i[_],w=fW(r[_]),P=`PropertyStatistics_${C}`,M=`PropertyStatistics_${C}`;n.addStruct(P,M,de.FRAGMENT),n.addStructField(P,w,"min"),n.addStructField(P,w,"max")}let f="MetadataStatistics",d="MetadataStatistics",p="metadataStatistics";n.addStruct(f,d,de.FRAGMENT);for(let _=0;_<c;_++){let C=i[_],w=`PropertyStatistics_${C}`,P=C;n.addStructField(f,w,P)}let g="Metadata",m="Metadata",y="metadata";n.addStruct(g,m,de.FRAGMENT);for(let _=0;_<c;_++){let C=fW(r[_]);n.addStructField(g,C,i[_])}let A="Attributes",b="Attributes",x="attributes";n.addStruct(A,b,de.FRAGMENT),n.addStructField(A,"vec3","positionEC"),n.addStructField(A,"vec3","normalEC");let T="Voxel",E="Voxel",v="voxel";n.addStruct(T,E,de.FRAGMENT),n.addStructField(T,"vec3","viewDirUv"),n.addStructField(T,"float","travelDistance"),n.addStructField(T,"int","stepCount"),n.addStructField(T,"int","tileIndex"),n.addStructField(T,"int","sampleIndex"),n.addStructField(T,"float","distanceToDepthBuffer");let S="FragmentInput";n.addStruct(S,"FragmentInput",de.FRAGMENT),n.addStructField(S,d,p),n.addStructField(S,m,y),n.addStructField(S,b,x),n.addStructField(S,E,v);let R="Properties",O="Properties",L="properties";n.addStruct(R,O,de.FRAGMENT);for(let _=0;_<c;_++){let C=fW(r[_]);n.addStructField(R,C,i[_])}{let _="clearProperties";n.addFunction(_,`${O} clearProperties()`,de.FRAGMENT),n.addFunctionLines(_,[`${O} ${L};`]);for(let C=0;C<c;C++){let w=fW(r[C],o[C]);n.addFunctionLines(_,[`${L}.${i[C]} = ${w}(0.0);`])}n.addFunctionLines(_,[`return ${L};`])}{let _="sumProperties";n.addFunction(_,`${O} sumProperties(${O} propertiesA, ${O} propertiesB)`,de.FRAGMENT),n.addFunctionLines(_,[`${O} ${L};`]);for(let C=0;C<c;C++){let w=i[C];n.addFunctionLines(_,[`${L}.${w} = propertiesA.${w} + propertiesB.${w};`])}n.addFunctionLines(_,[`return ${L};`])}{let _="scaleProperties";n.addFunction(_,`${O} scaleProperties(${O} ${L}, float scale)`,de.FRAGMENT),n.addFunctionLines(_,[`${O} scaledProperties = ${L};`]);for(let C=0;C<c;C++)n.addFunctionLines(_,[`scaledProperties.${i[C]} *= scale;`]);n.addFunctionLines(_,["return scaledProperties;"])}{let _="mixProperties";n.addFunction(_,`${O} mixProperties(${O} propertiesA, ${O} propertiesB, float mixFactor)`,de.FRAGMENT),n.addFunctionLines(_,[`${O} ${L};`]);for(let C=0;C<c;C++){let w=i[C];n.addFunctionLines(_,[`${L}.${w} = mix(propertiesA.${w}, propertiesB.${w}, mixFactor);`])}n.addFunctionLines(_,[`return ${L};`])}{let _="copyPropertiesToMetadata";n.addFunction(_,`void copyPropertiesToMetadata(in ${O} ${L}, inout ${m} ${y})`,de.FRAGMENT);for(let C=0;C<c;C++){let w=i[C];n.addFunctionLines(_,[`${y}.${w} = ${L}.${w};`])}}if(u){let _="setStatistics";n.addFunction(_,`void setStatistics(inout ${d} ${p})`,de.FRAGMENT);for(let C=0;C<c;C++){let w=i[C],P=r[C],M=bt.getComponentCount(P);for(let F=0;F<M;F++){let V=l3t(P,F),B=s[C][F],j=a[C][F];!l(B)||!l(j)||n.addFunctionLines(_,[`${p}.${w}.min${V} = ${YFe(B)};`,`${p}.${w}.max${V} = ${YFe(j)};`])}}}{let _="getPropertiesFromMegatextureAtUv";n.addFunction(_,`${O} getPropertiesFromMegatextureAtUv(vec3 texcoord)`,de.FRAGMENT),n.addFunctionLines(_,[`${O} ${L};`]);for(let C=0;C<c;C++){let w=r[C],P=o[C],M=c3t(w,P);n.addFunctionLines(_,[`properties.${i[C]} = texture(u_megatextureTextures[${C}], texcoord)${M};`])}n.addFunctionLines(_,[`return ${L};`])}}function fW(e){if(e===bt.SCALAR)return"float";if(e===bt.VEC2)return"vec2";if(e===bt.VEC3)return"vec3";if(e===bt.VEC4)return"vec4"}function c3t(e){if(e===bt.SCALAR)return".r";if(e===bt.VEC2)return".ra";if(e===bt.VEC3)return".rgb";if(e===bt.VEC4)return""}function YFe(e){let t=e.toString();return t.indexOf(".")===-1&&(t=`${e}.0`),t}function l3t(e,t){return e===bt.SCALAR?"":`[${t}]`}var HV=a3t;function cp(e){let{planes:t,modelMatrix:n=N.IDENTITY,unionClippingRegions:i=!1}=e??H.EMPTY_OBJECT;if(this._planes=[],this.modelMatrix=N.clone(n),this.planeAdded=new be,this.planeRemoved=new be,this._unionClippingRegions=i,this._testIntersection=i?XFe:KFe,this._float32View=void 0,this._clippingPlanesTexture=void 0,l(t))for(let r=0;r<t.length;++r)this.add(t[r])}function XFe(e){return e===$t.OUTSIDE}function KFe(e){return e===$t.INSIDE}Object.defineProperties(cp.prototype,{length:{get:function(){return this._planes.length}},unionClippingRegions:{get:function(){return this._unionClippingRegions},set:function(e){this._unionClippingRegions!==e&&(this._unionClippingRegions=e,this._testIntersection=e?XFe:KFe)}},texture:{get:function(){return this._clippingPlanesTexture}},clippingPlanesState:{get:function(){return this._unionClippingRegions?this._planes.length:-this._planes.length}}});cp.prototype.add=function(e){let t=this._planes.length;e.index=t,this._planes.push(e),this.planeAdded.raiseEvent(e,t)};cp.prototype.get=function(e){return this._planes[e]};function $Fe(e,t){for(let n=0;n<e.length;++n)if(sn.equals(e[n],t))return n;return-1}cp.prototype.contains=function(e){return $Fe(this._planes,e)!==-1};cp.prototype.remove=function(e){let t=this._planes,n=$Fe(t,e);if(n===-1)return!1;e instanceof ia&&(e.onChangeCallback=void 0,e.index=-1);let i=t.length-1;for(let r=n;r<i;++r){let o=t[r+1];t[r]=o,o instanceof ia&&(o.index=r)}return t.length=i,this.planeRemoved.raiseEvent(e,n),!0};cp.prototype.removeAll=function(){let e=this._planes;for(let t=0;t<e.length;++t){let n=e[t];n instanceof ia&&(n.onChangeCallback=void 0,n.index=-1),this.planeRemoved.raiseEvent(n,t)}this._planes=[]};var u3t=new sn(h.fromElements(1,0,0),0);function f3t(e,t){let n=e._float32View,i=e._planes,r=0;for(let o=0;o<i.length;++o){let{normal:s,distance:a}=h3t(i[o],t,u3t);n[r]=s.x,n[r+1]=s.y,n[r+2]=s.z,n[r+3]=a,r+=4}}var Ise=new se,d3t=new h;function h3t(e,t,n){let{normal:i,distance:r}=e,o=se.fromElements(i.x,i.y,i.z,r,Ise),s=N.multiplyByVector(t,o,Ise),a=h.fromCartesian4(s,d3t);return s=se.divideByScalar(s,h.magnitude(a),Ise),sn.fromCartesian4(s,n)}function JFe(e,t){return t.x=Math.min(e,kt.maximumTextureSize),t.y=Math.ceil(e/t.x),t}var m3t=new U;cp.prototype.update=function(e,t){let n=this._clippingPlanesTexture,i=this.length;if(l(n)){let s=n.width*n.height;(s<i||i<.25*s)&&(n.destroy(),n=void 0,this._clippingPlanesTexture=void 0)}if(this.length===0)return;if(!l(n)){let s=JFe(i,m3t);s.y*=2,n=new Dt({context:e.context,width:s.x,height:s.y,pixelFormat:Ke.RGBA,pixelDatatype:ze.FLOAT,sampler:jt.NEAREST,flipY:!1}),this._float32View=new Float32Array(s.x*s.y*4),this._clippingPlanesTexture=n}let{width:r,height:o}=n;f3t(this,t),n.copyFrom({source:{width:r,height:o,arrayBufferView:this._float32View}})};cp.getTextureResolution=function(e,t,n){let i=e.texture;if(l(i))return n.x=i.width,n.y=i.height,n;let r=e.length,o=JFe(r,n);return o.y*=2,o};cp.prototype.isDestroyed=function(){return!1};cp.prototype.destroy=function(){return this._clippingPlanesTexture=this._clippingPlanesTexture&&this._clippingPlanesTexture.destroy(),le(this)};var fy=cp;var GV=`struct Ray { + }`})}var bI=tRt;function sRt(e,t){let{shaderBuilder:n}=e,{names:i,types:r,componentTypes:o,minimumValues:s,maximumValues:a}=t._provider,c=r.length,u=l(s)&&l(a);n.addDefine("METADATA_COUNT",c,de.FRAGMENT),u&&n.addDefine("STATISTICS",void 0,de.FRAGMENT);for(let _=0;_<c;_++){let C=i[_],w=e9(r[_]),P=`PropertyStatistics_${C}`,M=`PropertyStatistics_${C}`;n.addStruct(P,M,de.FRAGMENT),n.addStructField(P,w,"min"),n.addStructField(P,w,"max")}let f="MetadataStatistics",d="MetadataStatistics",p="metadataStatistics";n.addStruct(f,d,de.FRAGMENT);for(let _=0;_<c;_++){let C=i[_],w=`PropertyStatistics_${C}`,P=C;n.addStructField(f,w,P)}let g="Metadata",m="Metadata",y="metadata";n.addStruct(g,m,de.FRAGMENT);for(let _=0;_<c;_++){let C=e9(r[_]);n.addStructField(g,C,i[_])}let A="Attributes",b="Attributes",x="attributes";n.addStruct(A,b,de.FRAGMENT),n.addStructField(A,"vec3","positionEC"),n.addStructField(A,"vec3","normalEC");let T="Voxel",E="Voxel",v="voxel";n.addStruct(T,E,de.FRAGMENT),n.addStructField(T,"vec3","viewDirUv"),n.addStructField(T,"float","travelDistance"),n.addStructField(T,"int","stepCount"),n.addStructField(T,"int","tileIndex"),n.addStructField(T,"int","sampleIndex"),n.addStructField(T,"float","distanceToDepthBuffer");let S="FragmentInput";n.addStruct(S,"FragmentInput",de.FRAGMENT),n.addStructField(S,d,p),n.addStructField(S,m,y),n.addStructField(S,b,x),n.addStructField(S,E,v);let R="Properties",O="Properties",L="properties";n.addStruct(R,O,de.FRAGMENT);for(let _=0;_<c;_++){let C=e9(r[_]);n.addStructField(R,C,i[_])}{let _="clearProperties";n.addFunction(_,`${O} clearProperties()`,de.FRAGMENT),n.addFunctionLines(_,[`${O} ${L};`]);for(let C=0;C<c;C++){let w=e9(r[C],o[C]);n.addFunctionLines(_,[`${L}.${i[C]} = ${w}(0.0);`])}n.addFunctionLines(_,[`return ${L};`])}{let _="sumProperties";n.addFunction(_,`${O} sumProperties(${O} propertiesA, ${O} propertiesB)`,de.FRAGMENT),n.addFunctionLines(_,[`${O} ${L};`]);for(let C=0;C<c;C++){let w=i[C];n.addFunctionLines(_,[`${L}.${w} = propertiesA.${w} + propertiesB.${w};`])}n.addFunctionLines(_,[`return ${L};`])}{let _="scaleProperties";n.addFunction(_,`${O} scaleProperties(${O} ${L}, float scale)`,de.FRAGMENT),n.addFunctionLines(_,[`${O} scaledProperties = ${L};`]);for(let C=0;C<c;C++)n.addFunctionLines(_,[`scaledProperties.${i[C]} *= scale;`]);n.addFunctionLines(_,["return scaledProperties;"])}{let _="mixProperties";n.addFunction(_,`${O} mixProperties(${O} propertiesA, ${O} propertiesB, float mixFactor)`,de.FRAGMENT),n.addFunctionLines(_,[`${O} ${L};`]);for(let C=0;C<c;C++){let w=i[C];n.addFunctionLines(_,[`${L}.${w} = mix(propertiesA.${w}, propertiesB.${w}, mixFactor);`])}n.addFunctionLines(_,[`return ${L};`])}{let _="copyPropertiesToMetadata";n.addFunction(_,`void copyPropertiesToMetadata(in ${O} ${L}, inout ${m} ${y})`,de.FRAGMENT);for(let C=0;C<c;C++){let w=i[C];n.addFunctionLines(_,[`${y}.${w} = ${L}.${w};`])}}if(u){let _="setStatistics";n.addFunction(_,`void setStatistics(inout ${d} ${p})`,de.FRAGMENT);for(let C=0;C<c;C++){let w=i[C],P=r[C],M=bt.getComponentCount(P);for(let F=0;F<M;F++){let V=cRt(P,F),B=s[C][F],j=a[C][F];!l(B)||!l(j)||n.addFunctionLines(_,[`${p}.${w}.min${V} = ${U1e(B)};`,`${p}.${w}.max${V} = ${U1e(j)};`])}}}{let _="getPropertiesFromMegatextureAtUv";n.addFunction(_,`${O} getPropertiesFromMegatextureAtUv(vec3 texcoord)`,de.FRAGMENT),n.addFunctionLines(_,[`${O} ${L};`]);for(let C=0;C<c;C++){let w=r[C],P=o[C],M=aRt(w,P);n.addFunctionLines(_,[`properties.${i[C]} = texture(u_megatextureTextures[${C}], texcoord)${M};`])}n.addFunctionLines(_,[`return ${L};`])}}function e9(e){if(e===bt.SCALAR)return"float";if(e===bt.VEC2)return"vec2";if(e===bt.VEC3)return"vec3";if(e===bt.VEC4)return"vec4"}function aRt(e){if(e===bt.SCALAR)return".r";if(e===bt.VEC2)return".ra";if(e===bt.VEC3)return".rgb";if(e===bt.VEC4)return""}function U1e(e){let t=e.toString();return t.indexOf(".")===-1&&(t=`${e}.0`),t}function cRt(e,t){return e===bt.SCALAR?"":`[${t}]`}var Oz=sRt;function $m(e){let{planes:t,modelMatrix:n=N.IDENTITY,unionClippingRegions:i=!1}=e??H.EMPTY_OBJECT;if(this._planes=[],this.modelMatrix=N.clone(n),this.planeAdded=new be,this.planeRemoved=new be,this._unionClippingRegions=i,this._testIntersection=i?z1e:V1e,this._float32View=void 0,this._clippingPlanesTexture=void 0,l(t))for(let r=0;r<t.length;++r)this.add(t[r])}function z1e(e){return e===$t.OUTSIDE}function V1e(e){return e===$t.INSIDE}Object.defineProperties($m.prototype,{length:{get:function(){return this._planes.length}},unionClippingRegions:{get:function(){return this._unionClippingRegions},set:function(e){this._unionClippingRegions!==e&&(this._unionClippingRegions=e,this._testIntersection=e?z1e:V1e)}},texture:{get:function(){return this._clippingPlanesTexture}},clippingPlanesState:{get:function(){return this._unionClippingRegions?this._planes.length:-this._planes.length}}});$m.prototype.add=function(e){let t=this._planes.length;e.index=t,this._planes.push(e),this.planeAdded.raiseEvent(e,t)};$m.prototype.get=function(e){return this._planes[e]};function j1e(e,t){for(let n=0;n<e.length;++n)if(sn.equals(e[n],t))return n;return-1}$m.prototype.contains=function(e){return j1e(this._planes,e)!==-1};$m.prototype.remove=function(e){let t=this._planes,n=j1e(t,e);if(n===-1)return!1;e instanceof ia&&(e.onChangeCallback=void 0,e.index=-1);let i=t.length-1;for(let r=n;r<i;++r){let o=t[r+1];t[r]=o,o instanceof ia&&(o.index=r)}return t.length=i,this.planeRemoved.raiseEvent(e,n),!0};$m.prototype.removeAll=function(){let e=this._planes;for(let t=0;t<e.length;++t){let n=e[t];n instanceof ia&&(n.onChangeCallback=void 0,n.index=-1),this.planeRemoved.raiseEvent(n,t)}this._planes=[]};var lRt=new sn(h.fromElements(1,0,0),0);function uRt(e,t){let n=e._float32View,i=e._planes,r=0;for(let o=0;o<i.length;++o){let{normal:s,distance:a}=dRt(i[o],t,lRt);n[r]=s.x,n[r+1]=s.y,n[r+2]=s.z,n[r+3]=a,r+=4}}var tie=new se,fRt=new h;function dRt(e,t,n){let{normal:i,distance:r}=e,o=se.fromElements(i.x,i.y,i.z,r,tie),s=N.multiplyByVector(t,o,tie),a=h.fromCartesian4(s,fRt);return s=se.divideByScalar(s,h.magnitude(a),tie),sn.fromCartesian4(s,n)}function H1e(e,t){return t.x=Math.min(e,kt.maximumTextureSize),t.y=Math.ceil(e/t.x),t}var hRt=new U;$m.prototype.update=function(e,t){let n=this._clippingPlanesTexture,i=this.length;if(l(n)){let s=n.width*n.height;(s<i||i<.25*s)&&(n.destroy(),n=void 0,this._clippingPlanesTexture=void 0)}if(this.length===0)return;if(!l(n)){let s=H1e(i,hRt);s.y*=2,n=new Dt({context:e.context,width:s.x,height:s.y,pixelFormat:Ke.RGBA,pixelDatatype:ze.FLOAT,sampler:jt.NEAREST,flipY:!1}),this._float32View=new Float32Array(s.x*s.y*4),this._clippingPlanesTexture=n}let{width:r,height:o}=n;uRt(this,t),n.copyFrom({source:{width:r,height:o,arrayBufferView:this._float32View}})};$m.getTextureResolution=function(e,t,n){let i=e.texture;if(l(i))return n.x=i.width,n.y=i.height,n;let r=e.length,o=H1e(r,n);return o.y*=2,o};$m.prototype.isDestroyed=function(){return!1};$m.prototype.destroy=function(){return this._clippingPlanesTexture=this._clippingPlanesTexture&&this._clippingPlanesTexture.destroy(),le(this)};var Y_=$m;var Mz=`struct Ray { vec3 pos; vec3 dir; }; @@ -11292,7 +11292,7 @@ return min(min(v.x, v.y), v.z); float maxComponent(in vec3 v) { return max(max(v.x, v.y), v.z); } -`;var WV=`#define STEP_COUNT_MAX 1000 // Harcoded value because GLSL doesn't like variable length loops +`;var Nz=`#define STEP_COUNT_MAX 1000 // Harcoded value because GLSL doesn't like variable length loops #if defined(PICKING_VOXEL) #define ALPHA_ACCUM_MAX 0.1 #else @@ -11474,7 +11474,7 @@ out_FragColor = vec4(megatextureId, sampleIndex); out_FragColor = colorAccum; #endif } -`;var qV=`in vec2 position; +`;var Lz=`in vec2 position; uniform vec4 u_ndcSpaceAxisAlignedBoundingBox; void main() { vec2 aabbMin = u_ndcSpaceAxisAlignedBoundingBox.xy; @@ -11483,7 +11483,7 @@ vec2 translation = 0.5 * (aabbMax + aabbMin); vec2 scale = 0.5 * (aabbMax - aabbMin); gl_Position = vec4(position * scale + translation, 0.0, 1.0); } -`;var YV=`#define NO_HIT (-czm_infinity) +`;var Fz=`#define NO_HIT (-czm_infinity) #define INF_HIT (czm_infinity * 0.5) struct RayShapeIntersection { vec4 entry; @@ -11591,7 +11591,7 @@ break; return shapeIntersection; } #endif -`;var XV=`void intersectDepth(in vec2 screenCoord, in Ray ray, inout Intersections ix) { +`;var Bz=`void intersectDepth(in vec2 screenCoord, in Ray ray, inout Intersections ix) { float logDepthOrDepth = czm_unpackDepth(texture(czm_globeDepthTexture, screenCoord)); float entry; float exit; @@ -11609,7 +11609,7 @@ ix.distanceToDepthBuffer = entry; setIntersectionPair(ix, DEPTH_INTERSECTION_INDEX, vec2(entry, exit)); #endif } -`;var KV=`uniform sampler2D u_clippingPlanesTexture; +`;var kz=`uniform sampler2D u_clippingPlanesTexture; uniform mat4 u_clippingPlanesMatrix; vec4 intersectPlane(in Ray ray, in vec4 plane) { vec3 n = plane.xyz; @@ -11672,7 +11672,7 @@ setShapeIntersection(ix, CLIPPING_PLANES_INTERSECTION_INDEX, clippingVolume); #endif } #endif -`;var SP=`vec4 transformNormalToEC(in vec4 intersection) { +`;var xI=`vec4 transformNormalToEC(in vec4 intersection) { return vec4(normalize(czm_normal * intersection.xyz), intersection.w); } RayShapeIntersection transformNormalsToEC(in RayShapeIntersection ix) { @@ -11756,7 +11756,7 @@ return transformNormalsToEC(RayShapeIntersection(last, farSide)); return transformNormalsToEC(RayShapeIntersection(miss, miss)); } } -`;var $V=`uniform sampler2D u_renderBoundPlanesTexture; +`;var Uz=`uniform sampler2D u_renderBoundPlanesTexture; RayShapeIntersection intersectBoundPlanes(in Ray ray) { vec4 lastEntry = vec4(ray.dir, -INF_HIT); vec4 firstExit = vec4(-ray.dir, +INF_HIT); @@ -11780,7 +11780,7 @@ void intersectShape(in Ray rayUV, in Ray rayEC, inout Intersections ix) RayShapeIntersection intersection = intersectBoundPlanes(rayEC); setShapeIntersection(ix, BOX_INTERSECTION_INDEX, intersection); } -`;var JV=`uniform vec2 u_cylinderRenderRadiusMinMax; +`;var zz=`uniform vec2 u_cylinderRenderRadiusMinMax; #if defined(CYLINDER_HAS_RENDER_BOUNDS_ANGLE) uniform vec2 u_cylinderRenderAngleMinMax; #endif @@ -11863,7 +11863,7 @@ setShapeIntersection(ix, CYLINDER_INTERSECTION_INDEX_ANGLE + 0, wedgeIntersects[ setShapeIntersection(ix, CYLINDER_INTERSECTION_INDEX_ANGLE + 1, wedgeIntersects[1]); #endif } -`;var ZV=`#if defined(ELLIPSOID_HAS_RENDER_BOUNDS_LONGITUDE) +`;var Vz=`#if defined(ELLIPSOID_HAS_RENDER_BOUNDS_LONGITUDE) uniform vec2 u_ellipsoidRenderLongitudeMinMax; #endif uniform float u_eccentricitySquared; @@ -12064,7 +12064,7 @@ setShapeIntersection(ix, ELLIPSOID_INTERSECTION_INDEX_LONGITUDE + 0, wedgeInters setShapeIntersection(ix, ELLIPSOID_INTERSECTION_INDEX_LONGITUDE + 1, wedgeIntersects[1]); #endif } -`;var CC=`RayShapeIntersection intersectScene(in vec2 screenCoord, in Ray ray, in Ray rayEC, out Intersections ix) { +`;var YE=`RayShapeIntersection intersectScene(in vec2 screenCoord, in Ray ray, in Ray rayEC, out Intersections ix) { intersectShape(ray, rayEC, ix); RayShapeIntersection intersection = getFirstIntersection(ix); if (intersection.entry.w == NO_HIT) { @@ -12088,7 +12088,7 @@ intersection.entry.w = max(intersection.entry.w, 0.0); #endif return intersection; } -`;var QV=`uniform vec3 u_boxLocalToShapeUvScale; +`;var jz=`uniform vec3 u_boxLocalToShapeUvScale; uniform ivec4 u_cameraTileCoordinates; uniform vec3 u_cameraTileUv; uniform mat3 u_boxEcToXyz; @@ -12111,7 +12111,7 @@ ivec3 tileCoordinateChange = tileCoordinate - u_cameraTileCoordinates.xyz; vec3 tileUv = clamp(tileUvSum - vec3(tileCoordinateChange), 0.0, 1.0); return TileAndUvCoordinate(ivec4(tileCoordinate, u_cameraTileCoordinates.w), tileUv); } -`;var e4=`uniform vec3 u_cylinderLocalToShapeUvScale; +`;var Hz=`uniform vec3 u_cylinderLocalToShapeUvScale; uniform float u_cylinderShapeUvAngleRangeOrigin; uniform mat3 u_cylinderEcToRadialTangentUp; uniform ivec4 u_cameraTileCoordinates; @@ -12185,7 +12185,7 @@ tileUv.y = clamp(tileUv.y, 0.0, 1.0); tileUv.z = clamp(tileUv.z, 0.0, 1.0); return TileAndUvCoordinate(ivec4(tileCoordinate, u_cameraTileCoordinates.w), tileUv); } -`;var t4=`uniform vec3 u_cameraPositionCartographic; +`;var Gz=`uniform vec3 u_cameraPositionCartographic; uniform vec2 u_ellipsoidCurvatureAtLatitude; uniform mat3 u_ellipsoidEcToEastNorthUp; uniform vec3 u_ellipsoidRadii; @@ -12304,7 +12304,7 @@ tileUv.y = clamp(tileUv.y, 0.0, 1.0); tileUv.z = clamp(tileUv.z, 0.0, 1.0); return TileAndUvCoordinate(ivec4(tileCoordinate, u_cameraTileCoordinates.w), tileUv); } -`;var n4=`#define OCTREE_FLAG_INTERNAL 0 +`;var Wz=`#define OCTREE_FLAG_INTERNAL 0 #define OCTREE_FLAG_LEAF 1 #define OCTREE_FLAG_PACKED_LEAF_FROM_PARENT 2 #define OCTREE_MAX_LEVELS 32 // Harcoded value because GLSL doesn't like variable length loops @@ -12505,7 +12505,7 @@ addSampleCoordinates(tileAndUv, sampleDatas[0]); addSampleCoordinates(tileAndUv, sampleDatas[1]); #endif } -`;var i4=`uniform ivec3 u_megatextureTileCounts; +`;var qz=`uniform ivec3 u_megatextureTileCounts; vec3 index1DTo3DTexCoord(int index) { int tilesPerZ = u_megatextureTileCounts.x * u_megatextureTileCounts.y; @@ -12540,19 +12540,19 @@ properties = sumProperties(properties, tempProperties); return properties; #endif } -`;var ZFe={Z_UP:0,Y_UP:1};Object.freeze(ZFe);var G0=ZFe;function p3t(e){let t=new hg;this.shaderBuilder=t;let n=e._customShader,i=Ot(e._uniformMap,n.uniformMap);e._uniformMap=i;let r=n.uniforms;for(let m in r)if(r.hasOwnProperty(m)){let y=r[m];t.addUniform(y.type,m,de.FRAGMENT)}t.addUniform("sampler3D","u_megatextureTextures[METADATA_COUNT]",de.FRAGMENT),this.uniformMap=i;let o=e._clippingPlanes,s=l(o)&&o.enabled?o.length:0;this.clippingPlanes=o,this.clippingPlanesLength=s;let a=e._shape.renderBoundPlanes,c=a?.length??0;this.renderBoundPlanes=a,this.renderBoundPlanesLength=c,t.addVertexLines([qV]),e.provider.metadataOrder===G0.Y_UP&&t.addDefine("Y_UP_METADATA_ORDER",void 0,de.FRAGMENT);let u=e._provider.shape;u==="BOX"?t.addDefine("SHAPE_BOX",void 0,de.FRAGMENT):u==="CYLINDER"?t.addDefine("SHAPE_CYLINDER",void 0,de.FRAGMENT):u==="ELLIPSOID"&&t.addDefine("SHAPE_ELLIPSOID",void 0,de.FRAGMENT),t.addFragmentLines([n.fragmentShaderText,"#line 0",n4,GV,i4,YV,KV,XV]),s>0&&(t.addDefine("CLIPPING_PLANES",void 0,de.FRAGMENT),t.addDefine("CLIPPING_PLANES_COUNT",s,de.FRAGMENT),o.unionClippingRegions&&t.addDefine("CLIPPING_PLANES_UNION",void 0,de.FRAGMENT)),e._depthTest&&t.addDefine("DEPTH_TEST",void 0,de.FRAGMENT),u==="BOX"?t.addFragmentLines([QV,$V,CC]):u==="CYLINDER"?t.addFragmentLines([e4,SP,JV,CC]):u==="ELLIPSOID"&&t.addFragmentLines([t4,SP,ZV,CC]),t.addFragmentLines([WV]);let f=e._shape,d=f.shaderDefines;for(let m in d)if(d.hasOwnProperty(m)){let y=d[m];l(y)&&(y=y===!0?void 0:y,t.addDefine(m,y,de.FRAGMENT))}let p=f.shaderMaximumIntersectionsLength;s>0&&(t.addDefine("CLIPPING_PLANES_INTERSECTION_INDEX",p,de.FRAGMENT),s===1?p+=1:o.unionClippingRegions?p+=2:p+=1),e._depthTest&&(t.addDefine("DEPTH_INTERSECTION_INDEX",p,de.FRAGMENT),p+=1),t.addDefine("INTERSECTION_COUNT",p,de.FRAGMENT),(!h.equals(e.paddingBefore,h.ZERO)||!h.equals(e.paddingAfter,h.ZERO))&&t.addDefine("PADDING",void 0,de.FRAGMENT),e._useLogDepth&&t.addDefine("LOG_DEPTH_READ_ONLY",void 0,de.FRAGMENT);let g=e._traversal;t.addDefine("SAMPLE_COUNT",`${g._sampleCount}`,de.FRAGMENT)}var r4=p3t;var QFe=new U;function g3t(e,t){let n=new r4(e);HV(n,e);let{shaderBuilder:i,clippingPlanes:r,clippingPlanesLength:o,renderBoundPlanes:s,renderBoundPlanesLength:a}=n;if(o>0){let T="getClippingPlane",E=`vec4 ${T}(highp sampler2D packedPlanes, int planeNumber)`,v=bs.getTextureResolution(r,t,QFe),S=eBe(v);i.addFunction(T,E,de.FRAGMENT),i.addFunctionLines(T,[S])}if(a>0){let T="getBoundPlane",E=`vec4 ${T}(highp sampler2D packedPlanes, int planeNumber)`,v=fy.getTextureResolution(s,t,QFe),S=eBe(v);i.addFunction(T,E,de.FRAGMENT),i.addFunctionLines(T,[S])}let c=i.clone();c.addDefine("PICKING",void 0,de.FRAGMENT);let u=i.clone();u.addDefine("PICKING_VOXEL",void 0,de.FRAGMENT);let f=i.buildShaderProgram(t),d=c.buildShaderProgram(t),p=u.buildShaderProgram(t),g=Ge.fromCache({cull:{enabled:!0,face:Vi.BACK},depthTest:{enabled:!1},depthMask:!1,blending:tn.PRE_MULTIPLIED_ALPHA_BLEND}),m=t.getViewportQuadVertexArray(),y=e._depthTest,A=new at({vertexArray:m,primitiveType:Oe.TRIANGLES,renderState:g,shaderProgram:f,uniformMap:n.uniformMap,modelMatrix:e._compoundModelMatrix,pass:Ie.VOXELS,executeInClosestFrustum:!0,owner:this,cull:y,occlude:y}),b=at.shallowClone(A,new at);b.shaderProgram=d,b.pickOnly=!0;let x=at.shallowClone(A,new at);if(x.shaderProgram=p,x.pickOnly=!0,l(e._drawCommand)){let T=e._drawCommand;T.shaderProgram=T.shaderProgram&&T.shaderProgram.destroy()}if(l(e._drawCommandPick)){let T=e._drawCommandPick;T.shaderProgram=T.shaderProgram&&T.shaderProgram.destroy()}if(l(e._drawCommandPickVoxel)){let T=e._drawCommandPickVoxel;T.shaderProgram=T.shaderProgram&&T.shaderProgram.destroy()}e._drawCommand=A,e._drawCommandPick=b,e._drawCommandPickVoxel=x}function eBe(e){let t=e.x,n=e.y,i=1/t,r=1/n,o=`${i}`;o.indexOf(".")===-1&&(o+=".0");let s=`${r}`;return s.indexOf(".")===-1&&(s+=".0"),`int pixY = planeNumber / ${t}; +`;var G1e={Z_UP:0,Y_UP:1};Object.freeze(G1e);var R0=G1e;function mRt(e){let t=new hg;this.shaderBuilder=t;let n=e._customShader,i=Ot(e._uniformMap,n.uniformMap);e._uniformMap=i;let r=n.uniforms;for(let m in r)if(r.hasOwnProperty(m)){let y=r[m];t.addUniform(y.type,m,de.FRAGMENT)}t.addUniform("sampler3D","u_megatextureTextures[METADATA_COUNT]",de.FRAGMENT),this.uniformMap=i;let o=e._clippingPlanes,s=l(o)&&o.enabled?o.length:0;this.clippingPlanes=o,this.clippingPlanesLength=s;let a=e._shape.renderBoundPlanes,c=a?.length??0;this.renderBoundPlanes=a,this.renderBoundPlanesLength=c,t.addVertexLines([Lz]),e.provider.metadataOrder===R0.Y_UP&&t.addDefine("Y_UP_METADATA_ORDER",void 0,de.FRAGMENT);let u=e._provider.shape;u==="BOX"?t.addDefine("SHAPE_BOX",void 0,de.FRAGMENT):u==="CYLINDER"?t.addDefine("SHAPE_CYLINDER",void 0,de.FRAGMENT):u==="ELLIPSOID"&&t.addDefine("SHAPE_ELLIPSOID",void 0,de.FRAGMENT),t.addFragmentLines([n.fragmentShaderText,"#line 0",Wz,Mz,qz,Fz,kz,Bz]),s>0&&(t.addDefine("CLIPPING_PLANES",void 0,de.FRAGMENT),t.addDefine("CLIPPING_PLANES_COUNT",s,de.FRAGMENT),o.unionClippingRegions&&t.addDefine("CLIPPING_PLANES_UNION",void 0,de.FRAGMENT)),e._depthTest&&t.addDefine("DEPTH_TEST",void 0,de.FRAGMENT),u==="BOX"?t.addFragmentLines([jz,Uz,YE]):u==="CYLINDER"?t.addFragmentLines([Hz,xI,zz,YE]):u==="ELLIPSOID"&&t.addFragmentLines([Gz,xI,Vz,YE]),t.addFragmentLines([Nz]);let f=e._shape,d=f.shaderDefines;for(let m in d)if(d.hasOwnProperty(m)){let y=d[m];l(y)&&(y=y===!0?void 0:y,t.addDefine(m,y,de.FRAGMENT))}let p=f.shaderMaximumIntersectionsLength;s>0&&(t.addDefine("CLIPPING_PLANES_INTERSECTION_INDEX",p,de.FRAGMENT),s===1?p+=1:o.unionClippingRegions?p+=2:p+=1),e._depthTest&&(t.addDefine("DEPTH_INTERSECTION_INDEX",p,de.FRAGMENT),p+=1),t.addDefine("INTERSECTION_COUNT",p,de.FRAGMENT),(!h.equals(e.paddingBefore,h.ZERO)||!h.equals(e.paddingAfter,h.ZERO))&&t.addDefine("PADDING",void 0,de.FRAGMENT),e._useLogDepth&&t.addDefine("LOG_DEPTH_READ_ONLY",void 0,de.FRAGMENT);let g=e._traversal;t.addDefine("SAMPLE_COUNT",`${g._sampleCount}`,de.FRAGMENT)}var Yz=mRt;var W1e=new U;function pRt(e,t){let n=new Yz(e);Oz(n,e);let{shaderBuilder:i,clippingPlanes:r,clippingPlanesLength:o,renderBoundPlanes:s,renderBoundPlanesLength:a}=n;if(o>0){let T="getClippingPlane",E=`vec4 ${T}(highp sampler2D packedPlanes, int planeNumber)`,v=Cs.getTextureResolution(r,t,W1e),S=q1e(v);i.addFunction(T,E,de.FRAGMENT),i.addFunctionLines(T,[S])}if(a>0){let T="getBoundPlane",E=`vec4 ${T}(highp sampler2D packedPlanes, int planeNumber)`,v=Y_.getTextureResolution(s,t,W1e),S=q1e(v);i.addFunction(T,E,de.FRAGMENT),i.addFunctionLines(T,[S])}let c=i.clone();c.addDefine("PICKING",void 0,de.FRAGMENT);let u=i.clone();u.addDefine("PICKING_VOXEL",void 0,de.FRAGMENT);let f=i.buildShaderProgram(t),d=c.buildShaderProgram(t),p=u.buildShaderProgram(t),g=Ge.fromCache({cull:{enabled:!0,face:zi.BACK},depthTest:{enabled:!1},depthMask:!1,blending:tn.PRE_MULTIPLIED_ALPHA_BLEND}),m=t.getViewportQuadVertexArray(),y=e._depthTest,A=new at({vertexArray:m,primitiveType:Oe.TRIANGLES,renderState:g,shaderProgram:f,uniformMap:n.uniformMap,modelMatrix:e._compoundModelMatrix,pass:Ie.VOXELS,executeInClosestFrustum:!0,owner:this,cull:y,occlude:y}),b=at.shallowClone(A,new at);b.shaderProgram=d,b.pickOnly=!0;let x=at.shallowClone(A,new at);if(x.shaderProgram=p,x.pickOnly=!0,l(e._drawCommand)){let T=e._drawCommand;T.shaderProgram=T.shaderProgram&&T.shaderProgram.destroy()}if(l(e._drawCommandPick)){let T=e._drawCommandPick;T.shaderProgram=T.shaderProgram&&T.shaderProgram.destroy()}if(l(e._drawCommandPickVoxel)){let T=e._drawCommandPickVoxel;T.shaderProgram=T.shaderProgram&&T.shaderProgram.destroy()}e._drawCommand=A,e._drawCommandPick=b,e._drawCommandPickVoxel=x}function q1e(e){let t=e.x,n=e.y,i=1/t,r=1/n,o=`${i}`;o.indexOf(".")===-1&&(o+=".0");let s=`${r}`;return s.indexOf(".")===-1&&(s+=".0"),`int pixY = planeNumber / ${t}; int pixX = planeNumber - (pixY * ${t}); // Sample from center of pixel float u = (float(pixX) + 0.5) * ${o}; float v = (float(pixY) + 0.5) * ${s}; - return texture(packedPlanes, vec2(u, v));`}var o4=g3t;function dy(e){let{loader:t,metadata:n}=e;this._loader=t,this._metadata=n,this._resourcesLoaded=!1,this._ready=!1}Object.defineProperties(dy.prototype,{ready:{get:function(){return this._ready}},metadata:{get:function(){return this._metadata}}});dy.fromMetadataArray=function(e){return new dy({metadata:e})};dy.fromGltf=async function(e){let t=new Bf({gltfResource:e,releaseGltfJson:!1,loadAttributesAsTypedArray:!0});try{await t.load()}catch(n){throw t.destroy(),n}return new dy({loader:t})};dy.prototype.update=function(e,t){let n=this._loader;if(!this._ready){if(t.afterRender.push(()=>!0),!l(n)){this._ready=!0;return}if(this._resourcesLoaded){let{structuralMetadata:i,scene:r}=n.components,{attributes:o}=r.nodes[0].primitives[0];this._metadata=_3t(o,i,e),this._ready=!0;return}this._resourcesLoaded=n.process(t)}};function _3t(e,t,n){let{className:i,names:r,types:o,componentTypes:s}=n.provider,a=t.propertyAttributes.find(f=>f.class.id===i),{properties:c}=a,u=new Array(r.length);for(let f=0;f<e.length;f++){let d=c[r[f]].attribute,p=e.find(A=>A.name===d);if(!l(p))continue;let g=Lt.toComponentDatatype(s[f]),m=bt.getComponentCount(o[f]),y=p.count*m;u[f]=Y.createArrayBufferView(g,p.typedArray.buffer,p.typedArray.byteOffset+p.byteOffset,y)}return u}dy.prototype.isDestroyed=function(){return!1};dy.prototype.destroy=function(){return this._loader=this._loader&&this._loader.destroy(),le(this)};var vC=dy;function Il(){this._orientedBoundingBox=new en,this._boundingSphere=new ue,this._boundTransform=new N,this._shapeTransform=new N,this._minBounds=Il.DefaultMinBounds.clone(),this._maxBounds=Il.DefaultMaxBounds.clone(),this._renderMinBounds=Il.DefaultMinBounds.clone(),this._renderMaxBounds=Il.DefaultMaxBounds.clone();let{DefaultMinBounds:e,DefaultMaxBounds:t}=Il,n=[new ia(h.negate(h.UNIT_X,new h),e.x),new ia(h.negate(h.UNIT_Y,new h),e.y),new ia(h.negate(h.UNIT_Z,new h),e.z),new ia(h.UNIT_X,-t.x),new ia(h.UNIT_Y,-t.y),new ia(h.UNIT_Z,-t.z)];this._renderBoundPlanes=new fy({planes:n}),this._localToShapeUvTranslate=new h,this._shaderUniforms={boxEcToXyz:new $,boxLocalToShapeUvScale:new h},this._shaderDefines={BOX_INTERSECTION_INDEX:void 0},this._shaderMaximumIntersectionsLength=0}Object.defineProperties(Il.prototype,{orientedBoundingBox:{get:function(){return this._orientedBoundingBox}},renderBoundPlanes:{get:function(){return this._renderBoundPlanes}},boundingSphere:{get:function(){return this._boundingSphere}},boundTransform:{get:function(){return this._boundTransform}},shapeTransform:{get:function(){return this._shapeTransform}},shaderUniforms:{get:function(){return this._shaderUniforms}},shaderDefines:{get:function(){return this._shaderDefines}},shaderMaximumIntersectionsLength:{get:function(){return this._shaderMaximumIntersectionsLength}}});var y3t=new h,A3t=new h,b3t=new $,x3t=new h,T3t=new h;Il.prototype.update=function(e,t,n,i,r){i=i??t.clone(x3t),r=r??n.clone(T3t),t=h.clone(t,this._minBounds),n=h.clone(n,this._maxBounds);let o=h.clamp(t,i,r,this._renderMinBounds),s=h.clamp(n,i,r,this._renderMaxBounds),a=N.getScale(e,A3t);if(o.x>s.x||o.y>s.y||o.z>s.z||(o.x===s.x)+(o.y===s.y)+(o.z===s.z)>=2||a.x===0||a.y===0||a.z===0)return!1;let c=this._renderBoundPlanes;c.get(0).distance=o.x,c.get(1).distance=o.y,c.get(2).distance=o.z,c.get(3).distance=-s.x,c.get(4).distance=-s.y,c.get(5).distance=-s.z,this._shapeTransform=N.clone(e,this._shapeTransform),this._orientedBoundingBox=Rse(o,s,this._shapeTransform,this._orientedBoundingBox),this._boundTransform=N.fromRotationTranslation(this._orientedBoundingBox.halfAxes,this._orientedBoundingBox.center,this._boundTransform),this._boundingSphere=ue.fromOrientedBoundingBox(this._orientedBoundingBox,this._boundingSphere);let u=this._shaderUniforms,f=this._shaderDefines;for(let y in f)f.hasOwnProperty(y)&&(f[y]=void 0);let d=0;f.BOX_INTERSECTION_INDEX=d,d+=1;let p=t,g=n,m=h.fromElements(Pse(p.x,g.x),Pse(p.y,g.y),Pse(p.z,g.z),u.boxLocalToShapeUvScale);return this._localToShapeUvTranslate=h.negate(h.multiplyComponents(m,p,this._localToShapeUvTranslate),this._localToShapeUvTranslate),this._shaderMaximumIntersectionsLength=d,!0};function Pse(e,t){return D.equalsEpsilon(e,t,D.EPSILON7)?1:1/(t-e)}var E3t=new N;Il.prototype.updateViewTransforms=function(e){let t=this._shaderUniforms,n=N.inverse(this._shapeTransform,E3t),i=N.getMatrix3(n,t.boxEcToXyz),r=e.context.uniformState.inverseViewRotation;$.multiply(i,r,t.boxEcToXyz)};Il.prototype.convertLocalToShapeUvSpace=function(e,t){let{boxLocalToShapeUvScale:n}=this._shaderUniforms,i=this._localToShapeUvTranslate;return h.add(h.multiplyComponents(e,n,t),i,t)};var dW=new h,Dse=new h;Il.prototype.computeOrientedBoundingBoxForTile=function(e,t,n,i,r){let o=this._minBounds,s=this._maxBounds,a=1/Math.pow(2,e),c=h.fromElements(D.lerp(o.x,s.x,a*t),D.lerp(o.y,s.y,a*n),D.lerp(o.z,s.z,a*i),dW),u=h.fromElements(D.lerp(o.x,s.x,a*(t+1)),D.lerp(o.y,s.y,a*(n+1)),D.lerp(o.z,s.z,a*(i+1)),Dse);return Rse(c,u,this._shapeTransform,r)};var tBe=new h;Il.prototype.computeOrientedBoundingBoxForSample=function(e,t,n,i){let r=1/Math.pow(2,e.level),o=h.divideComponents(h.ONE,t,tBe),s=h.multiplyByScalar(o,r,tBe),a=h.multiplyByScalar(h.fromElements(e.x+n.x,e.y+n.y,e.z+n.z,dW),r,dW),c=h.add(a,s,Dse),u=this._minBounds,f=this._maxBounds,d=h.fromElements(D.lerp(u.x,f.x,a.x),D.lerp(u.y,f.y,a.y),D.lerp(u.z,f.z,a.z),dW),p=h.fromElements(D.lerp(u.x,f.x,c.x),D.lerp(u.y,f.y,c.y),D.lerp(u.z,f.z,c.z),Dse);return Rse(d,p,this._shapeTransform,i)};Il.DefaultMinBounds=Object.freeze(new h(-1,-1,-1));Il.DefaultMaxBounds=Object.freeze(new h(1,1,1));var nBe=new h;function Rse(e,t,n,i){let r=Il.DefaultMinBounds,o=Il.DefaultMaxBounds;if(h.equals(e,r)&&h.equals(t,o))i.center=N.getTranslation(n,i.center),i.halfAxes=N.getMatrix3(n,i.halfAxes);else{let a=N.getScale(n,nBe),c=h.midpoint(e,t,y3t);i.center=N.multiplyByPoint(n,c,i.center),a=h.fromElements(a.x*.5*(t.x-e.x),a.y*.5*(t.y-e.y),a.z*.5*(t.z-e.z),nBe);let u=N.getRotation(n,b3t);i.halfAxes=$.setScale(u,a,i.halfAxes)}return i}var SC=Il;function gd(){this._orientedBoundingBox=new en,this._boundingSphere=new ue,this._boundTransform=new N,this._shapeTransform=new N,this._minBounds=gd.DefaultMinBounds.clone(),this._maxBounds=gd.DefaultMaxBounds.clone();let{DefaultMinBounds:e,DefaultMaxBounds:t}=gd,n=[new ia(h.negate(h.UNIT_Z,new h),e.z),new ia(h.UNIT_Z,-t.z)];this._renderBoundPlanes=new fy({planes:n}),this._localToShapeUvTranslate=new h,this._shaderUniforms={cameraShapePosition:new h,cylinderEcToRadialTangentUp:new $,cylinderRenderRadiusMinMax:new U,cylinderRenderAngleMinMax:new U,cylinderLocalToShapeUvScale:new h,cylinderShapeUvAngleRangeOrigin:0},this._shaderDefines={CYLINDER_HAS_SHAPE_BOUNDS_ANGLE:void 0,CYLINDER_HAS_RENDER_BOUNDS_RADIUS_MIN:void 0,CYLINDER_HAS_RENDER_BOUNDS_RADIUS_FLAT:void 0,CYLINDER_HAS_RENDER_BOUNDS_ANGLE:void 0,CYLINDER_HAS_RENDER_BOUNDS_ANGLE_RANGE_EQUAL_ZERO:void 0,CYLINDER_HAS_RENDER_BOUNDS_ANGLE_RANGE_UNDER_HALF:void 0,CYLINDER_HAS_RENDER_BOUNDS_ANGLE_RANGE_OVER_HALF:void 0,CYLINDER_INTERSECTION_INDEX_RADIUS_MAX:void 0,CYLINDER_INTERSECTION_INDEX_RADIUS_MIN:void 0,CYLINDER_INTERSECTION_INDEX_ANGLE:void 0},this._shaderMaximumIntersectionsLength=0}Object.defineProperties(gd.prototype,{orientedBoundingBox:{get:function(){return this._orientedBoundingBox}},renderBoundPlanes:{get:function(){return this._renderBoundPlanes}},boundingSphere:{get:function(){return this._boundingSphere}},boundTransform:{get:function(){return this._boundTransform}},shapeTransform:{get:function(){return this._shapeTransform}},shaderUniforms:{get:function(){return this._shaderUniforms}},shaderDefines:{get:function(){return this._shaderDefines}},shaderMaximumIntersectionsLength:{get:function(){return this._shaderMaximumIntersectionsLength}}});var C3t=new h,v3t=new h,S3t=new h,w3t=new h,I3t=new h,P3t=new N,D3t=new h,iBe=new U;gd.prototype.update=function(e,t,n,i,r){i=i??t.clone(v3t),r=r??n.clone(S3t),t=h.clone(t,this._minBounds),n=h.clone(n,this._maxBounds);let{DefaultMinBounds:o,DefaultMaxBounds:s}=gd,a=s.y-o.y,c=.5*a,u=D.EPSILON10,f=D.EPSILON10;t.x=Math.max(0,t.x),n.x=Math.max(0,n.x),t.y=D.negativePiToPi(t.y),n.y=D.negativePiToPi(n.y),i.y=D.negativePiToPi(i.y),r.y=D.negativePiToPi(r.y);let d=h.maximumByComponent(t,i,w3t),p=h.minimumByComponent(n,r,I3t),g=N.getScale(e,C3t);if(p.x===0||d.x>p.x||d.z>p.z||D.equalsEpsilon(g.x,0,void 0,u)||D.equalsEpsilon(g.y,0,void 0,u)||D.equalsEpsilon(g.z,0,void 0,u))return!1;let m=this._renderBoundPlanes;m.get(0).distance=d.z,m.get(1).distance=-p.z,this._shapeTransform=N.clone(e,this._shapeTransform),this._orientedBoundingBox=Nse(d,p,this._shapeTransform,this._orientedBoundingBox),this._boundTransform=N.fromRotationTranslation(this._orientedBoundingBox.halfAxes,this._orientedBoundingBox.center,this._boundTransform),this._boundingSphere=ue.fromOrientedBoundingBox(this._orientedBoundingBox,this._boundingSphere);let y=n.y<t.y,A=n.y-t.y+y*a,b=p.y<d.y,x=p.y-d.y+b*a,T=x>=c-f&&x<a-f,E=x>f&&x<c-f,v=x<=f,S=T||E||v,I=this._shaderUniforms,R=this._shaderDefines;for(let q in R)R.hasOwnProperty(q)&&(R[q]=void 0);let O=0;R.CYLINDER_INTERSECTION_INDEX_RADIUS_MAX=O,O+=1,A<a-f&&(R.CYLINDER_HAS_SHAPE_BOUNDS_ANGLE=!0),d.x!==o.x&&(R.CYLINDER_HAS_RENDER_BOUNDS_RADIUS_MIN=!0,R.CYLINDER_INTERSECTION_INDEX_RADIUS_MIN=O,O+=1),I.cylinderRenderRadiusMinMax=U.fromElements(d.x,p.x,I.cylinderRenderRadiusMinMax),d.x===p.x&&(R.CYLINDER_HAS_RENDER_BOUNDS_RADIUS_FLAT=!0);let L=n.x-t.x,_=0,C=1;L!==0&&(_=1/L,C=-t.x*_);let w=n.z-t.z,P=0,M=1;w!==0&&(P=1/w,M=-t.z*P),S&&(R.CYLINDER_HAS_RENDER_BOUNDS_ANGLE=!0,R.CYLINDER_INTERSECTION_INDEX_ANGLE=O,T?(R.CYLINDER_HAS_RENDER_BOUNDS_ANGLE_RANGE_UNDER_HALF=!0,O+=1):E?(R.CYLINDER_HAS_RENDER_BOUNDS_ANGLE_RANGE_OVER_HALF=!0,O+=2):v&&(R.CYLINDER_HAS_RENDER_BOUNDS_ANGLE_RANGE_EQUAL_ZERO=!0,O+=2),I.cylinderRenderAngleMinMax=U.fromElements(d.y,p.y,I.cylinderRenderAngleMinMax));let F=(t.y-o.y)/a,V=(n.y-o.y)/a,B=1-A/a,j=(V+.5*B)%1;I.cylinderShapeUvAngleRangeOrigin=j;let k=0,G=1;if(A>f){k=a/A;let q=F-j;G=-k*(q-Math.floor(q))}return I.cylinderLocalToShapeUvScale=h.fromElements(_,k,P,I.cylinderLocalToShapeUvScale),this._localToShapeUvTranslate=h.fromElements(C,G,M,this._localToShapeUvTranslate),this._shaderMaximumIntersectionsLength=O,!0};var R3t=new $,O3t=new $,M3t=new N;gd.prototype.updateViewTransforms=function(e){let t=this._shaderUniforms,n=N.inverse(this._shapeTransform,P3t),i=N.multiplyByPoint(n,e.camera.positionWC,D3t);t.cameraShapePosition=h.fromElements(U.magnitude(i),Math.atan2(i.y,i.x),i.z,t.cameraShapePosition);let r=U.normalize(U.fromCartesian3(i,iBe),iBe),o=$.fromRowMajorArray([r.x,r.y,0,-r.y,r.x,0,0,0,1],R3t),s=e.context.uniformState.inverseView,a=N.multiplyTransformation(n,s,M3t),c=N.getMatrix3(a,O3t);t.cylinderEcToRadialTangentUp=$.multiply(o,c,t.cylinderEcToRadialTangentUp)};gd.prototype.convertLocalToShapeUvSpace=function(e,t){let n=Math.hypot(e.x,e.y),i=Math.atan2(e.y,e.x),r=e.z,{cylinderLocalToShapeUvScale:o,cylinderShapeUvAngleRangeOrigin:s}=this._shaderUniforms,a=this._localToShapeUvTranslate;return n=n*o.x+a.x,i=(i+Math.PI)/(2*Math.PI),i-=s,i=i-Math.floor(i),i=i*o.y+a.y,r=r*o.z+a.z,h.fromElements(n,i,r,t)};var hW=new h,Mse=new h;gd.prototype.computeOrientedBoundingBoxForTile=function(e,t,n,i,r){let o=this._minBounds,s=this._maxBounds,a=1/Math.pow(2,e),c=h.fromElements(D.lerp(o.x,s.x,t*a),D.lerp(o.y,s.y,n*a),D.lerp(o.z,s.z,i*a),hW),u=h.fromElements(D.lerp(o.x,s.x,(t+1)*a),D.lerp(o.y,s.y,(n+1)*a),D.lerp(o.z,s.z,(i+1)*a),Mse);return Nse(c,u,this._shapeTransform,r)};var rBe=new h;gd.prototype.computeOrientedBoundingBoxForSample=function(e,t,n,i){let r=1/Math.pow(2,e.level),o=h.divideComponents(h.ONE,t,rBe),s=h.multiplyByScalar(o,r,rBe),a=h.multiplyByScalar(h.fromElements(e.x+n.x,e.y+n.y,e.z+n.z,hW),r,hW),c=h.add(a,s,Mse),u=this._minBounds,f=this._maxBounds,d=h.fromElements(D.lerp(u.x,f.x,a.x),D.lerp(u.y,f.y,a.y),D.lerp(u.z,f.z,a.z),hW),p=h.fromElements(D.lerp(u.x,f.x,c.x),D.lerp(u.y,f.y,c.y),D.lerp(u.z,f.z,c.z),Mse);return Nse(d,p,this._shapeTransform,i)};gd.DefaultMinBounds=Object.freeze(new h(0,-D.PI,-1));gd.DefaultMaxBounds=Object.freeze(new h(1,+D.PI,1));var N3t=5,L3t=new Array(N3t),F3t=new h,B3t=new $,k3t=new N,U3t=new N,z3t=new N,Ose=new N,V3t=new h,j3t=new h,H3t=new h,sBe=new Array(8);for(let e=0;e<8;e++)sBe[e]=new h;function oBe(e,t,n){return Math.abs(se.dot(e,t))<n}function G3t(e){let t=N.getColumn(e,0,V3t),n=N.getColumn(e,1,j3t),i=N.getColumn(e,2,H3t),r=D.EPSILON4;return oBe(t,n,r)&&oBe(n,i,r)}function W3t(e,t){let n=sBe;h.fromElements(-.5,-.5,-.5,n[0]),h.fromElements(-.5,-.5,.5,n[1]),h.fromElements(-.5,.5,-.5,n[2]),h.fromElements(-.5,.5,.5,n[3]),h.fromElements(.5,-.5,-.5,n[4]),h.fromElements(.5,-.5,.5,n[5]),h.fromElements(.5,.5,-.5,n[6]),h.fromElements(.5,.5,.5,n[7]);for(let i=0;i<8;++i)N.multiplyByPoint(e,n[i],n[i]);return en.fromPoints(n,t)}var q3t=new h;function Nse(e,t,n,i){let r=e.x,o=t.x,s=e.y,a=t.y<s?t.y+D.TWO_PI:t.y,c=e.z,u=t.z,f=a-s,d=s+f*.5,p=L3t,g=0;p[g++]=s,p[g++]=a,p[g++]=d,f>D.PI&&(p[g++]=d-D.PI_OVER_TWO,p[g++]=d+D.PI_OVER_TWO);let m=Number.POSITIVE_INFINITY,y=Number.POSITIVE_INFINITY,A=Number.NEGATIVE_INFINITY,b=Number.NEGATIVE_INFINITY;for(let F=0;F<g;++F){let V=p[F]-d,B=Math.cos(V),j=Math.sin(V),k=B*r,G=j*r,q=B*o,Q=j*o;m=Math.min(m,k,q),y=Math.min(y,G,Q),A=Math.max(A,k,q),b=Math.max(b,G,Q)}let x=A-m,T=b-y,E=u-c,v=(m+A)*.5,S=(y+b)*.5,I=(c+u)*.5,R=h.fromElements(v,S,I,F3t),O=$.fromRotationZ(d,B3t),L=h.fromElements(x,T,E,q3t),_=N.fromScale(L,z3t),C=N.fromRotation(O,U3t),w=N.fromTranslation(R,k3t),P=N.multiplyTransformation(C,N.multiplyTransformation(w,_,Ose),Ose),M=N.multiplyTransformation(n,P,Ose);return G3t(M)?en.fromTransformation(M,i):W3t(M,i)}var wC=gd;function Ph(){this._orientedBoundingBox=new en,this._boundingSphere=new ue,this._boundTransform=new N,this._shapeTransform=new N,this._rectangle=new ie,this._minimumHeight=Ph.DefaultMinBounds.z,this._maximumHeight=Ph.DefaultMaxBounds.z,this._ellipsoid=new ee,this._translation=new h,this._rotation=new $,this._localToShapeUvTranslate=new h,this._shaderUniforms={cameraPositionCartographic:new h,ellipsoidEcToEastNorthUp:new $,ellipsoidRadii:new h,eccentricitySquared:0,evoluteScale:new U,ellipsoidCurvatureAtLatitude:new U,ellipsoidInverseRadiiSquared:new h,ellipsoidRenderLongitudeMinMax:new U,ellipsoidShapeUvLongitudeRangeOrigin:0,ellipsoidShapeUvLongitudeMinMaxMid:new h,ellipsoidLocalToShapeUvScale:new h,ellipsoidRenderLatitudeSinMinMax:new U,clipMinMaxHeight:new U},this._shaderDefines={ELLIPSOID_HAS_RENDER_BOUNDS_LONGITUDE:void 0,ELLIPSOID_HAS_RENDER_BOUNDS_LONGITUDE_RANGE_EQUAL_ZERO:void 0,ELLIPSOID_HAS_RENDER_BOUNDS_LONGITUDE_RANGE_UNDER_HALF:void 0,ELLIPSOID_HAS_RENDER_BOUNDS_LONGITUDE_RANGE_OVER_HALF:void 0,ELLIPSOID_HAS_SHAPE_BOUNDS_LONGITUDE:void 0,ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MAX_UNDER_HALF:void 0,ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MAX_EQUAL_HALF:void 0,ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MAX_OVER_HALF:void 0,ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MIN_UNDER_HALF:void 0,ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MIN_EQUAL_HALF:void 0,ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MIN_OVER_HALF:void 0,ELLIPSOID_HAS_SHAPE_BOUNDS_LATITUDE:void 0,ELLIPSOID_INTERSECTION_INDEX_LONGITUDE:void 0,ELLIPSOID_INTERSECTION_INDEX_LATITUDE_MAX:void 0,ELLIPSOID_INTERSECTION_INDEX_LATITUDE_MIN:void 0,ELLIPSOID_INTERSECTION_INDEX_HEIGHT_MAX:void 0,ELLIPSOID_INTERSECTION_INDEX_HEIGHT_MIN:void 0},this._shaderMaximumIntersectionsLength=0}Object.defineProperties(Ph.prototype,{orientedBoundingBox:{get:function(){return this._orientedBoundingBox}},boundingSphere:{get:function(){return this._boundingSphere}},boundTransform:{get:function(){return this._boundTransform}},shapeTransform:{get:function(){return this._shapeTransform}},shaderUniforms:{get:function(){return this._shaderUniforms}},shaderDefines:{get:function(){return this._shaderDefines}},shaderMaximumIntersectionsLength:{get:function(){return this._shaderMaximumIntersectionsLength}}});var Y3t=new h,X3t=new h,K3t=new h,$3t=new h,J3t=new h,Z3t=new h,Q3t=new h,eUt=new h,aBe=new h,cBe=new h,tUt=new ie;Ph.prototype.update=function(e,t,n,i,r){let{DefaultMinBounds:o,DefaultMaxBounds:s}=Ph;i=i??o,r=r??s;let a=D.EPSILON10,c=D.EPSILON10,u=D.EPSILON10,f=D.EPSILON3,d=N.getScale(e,eUt),p=h.clone(o,Y3t);p.z=-h.minimumComponent(d);let g=h.clamp(t,p,s,X3t),m=h.clamp(n,p,s,K3t),y=h.clamp(i,p,s,$3t),A=h.clamp(r,p,s,J3t),b=h.maximumByComponent(g,y,Z3t),x=h.minimumByComponent(m,A,Q3t),T=h.add(d,h.fromElements(m.z,m.z,m.z,aBe),aBe),E=h.add(d,h.fromElements(x.z,x.z,x.z,cBe),cBe);if(b.y>x.y||b.y===s.y||x.y===o.y||b.z>x.z||D.equalsEpsilon(E,h.ZERO,void 0,a))return!1;this._rectangle=ie.fromRadians(g.x,g.y,m.x,m.y),this._translation=N.getTranslation(e,this._translation),this._rotation=N.getRotation(e,this._rotation),this._ellipsoid=ee.fromCartesian3(d,this._ellipsoid),this._minimumHeight=g.z,this._maximumHeight=m.z;let v=ie.fromRadians(b.x,b.y,x.x,x.y,tUt);this._orientedBoundingBox=Lse(v,b.z,x.z,this._ellipsoid,this._translation,this._rotation,this._orientedBoundingBox),this._shapeTransform=N.fromRotationTranslation(this._rotation,this._translation,this._shapeTransform),this._boundTransform=N.fromRotationTranslation(this._orientedBoundingBox.halfAxes,this._orientedBoundingBox.center,this._boundTransform),this._boundingSphere=ue.fromOrientedBoundingBox(this._orientedBoundingBox,this._boundingSphere);let S=s.x-o.x,I=.5*S,R=x.x<b.x,O=x.x-b.x+R*S,L=O<=c,_=O>=I-c&&O<S-c,C=O>c&&O<I-c,w=L||_||C,P=m.x<g.x,M=m.x-g.x+P*S,F=M>I+c&&M<S-c,V=M>=I-c&&M<=I+c,B=M<I-c,j=F||V||B,k=x.y<-f,G=x.y>=-f&&x.y<=+f,q=x.y>+f&&x.y<s.y-u,Q=k||G||q,W=b.y>o.y+u&&b.y<-f,J=b.y>=-f&&b.y<=+f,Z=b.y>+f,ae=W||J||Z,Ae=Q||ae,fe=m.y-g.y,xe=m.y<-f,ge=m.y>=-f&&m.y<=+f,we=m.y>+f&&m.y<s.y-u,Se=xe||ge||we,Re=g.y>o.y+u&&g.y<-f,Qe=g.y>=-f&&g.y<=+f,He=g.y>+f,$e=Se||(Re||Qe||He),Pe=this._shaderUniforms,qe=this._shaderDefines;for(let Xn in qe)qe.hasOwnProperty(Xn)&&(qe[Xn]=void 0);Pe.ellipsoidRadii=h.clone(T,Pe.ellipsoidRadii);let{x:st,z:vt}=Pe.ellipsoidRadii,Gt=vt/st;Pe.eccentricitySquared=1-Gt*Gt,Pe.evoluteScale=U.fromElements((st*st-vt*vt)/st,(vt*vt-st*st)/vt,Pe.evoluteScale),Pe.ellipsoidInverseRadiiSquared=h.divideComponents(h.ONE,h.multiplyComponents(Pe.ellipsoidRadii,Pe.ellipsoidRadii,Pe.ellipsoidInverseRadiiSquared),Pe.ellipsoidInverseRadiiSquared);let lt=0;qe.ELLIPSOID_INTERSECTION_INDEX_HEIGHT_MAX=lt,lt+=1,qe.ELLIPSOID_INTERSECTION_INDEX_HEIGHT_MIN=lt,lt+=1,Pe.clipMinMaxHeight=U.fromElements(b.z-m.z,x.z-m.z,Pe.clipMinMaxHeight);let mt=m.z-g.z,ft=mt===0?0:1/mt;w&&(qe.ELLIPSOID_HAS_RENDER_BOUNDS_LONGITUDE=!0,qe.ELLIPSOID_INTERSECTION_INDEX_LONGITUDE=lt,_?(qe.ELLIPSOID_HAS_RENDER_BOUNDS_LONGITUDE_RANGE_UNDER_HALF=!0,lt+=1):C?(qe.ELLIPSOID_HAS_RENDER_BOUNDS_LONGITUDE_RANGE_OVER_HALF=!0,lt+=2):L&&(qe.ELLIPSOID_HAS_RENDER_BOUNDS_LONGITUDE_RANGE_EQUAL_ZERO=!0,lt+=2),Pe.ellipsoidRenderLongitudeMinMax=U.fromElements(b.x,x.x,Pe.ellipsoidRenderLongitudeMinMax));let Xt=0,rt=1;if(j){qe.ELLIPSOID_HAS_SHAPE_BOUNDS_LONGITUDE=!0;let Xn=(g.x-o.x)/S,bi=(m.x-o.x)/S,Wi=1-M/S,wi=(bi+.5*Wi)%1;if(Pe.ellipsoidShapeUvLongitudeRangeOrigin=wi,M>c){Xt=S/M;let hi=Xn-wi;rt=-Xt*(hi-Math.floor(hi))}}Ae&&(ae&&(qe.ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MIN=!0,qe.ELLIPSOID_INTERSECTION_INDEX_LATITUDE_MIN=lt,W?(qe.ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MIN_UNDER_HALF=!0,lt+=1):J?(qe.ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MIN_EQUAL_HALF=!0,lt+=1):Z&&(qe.ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MIN_OVER_HALF=!0,lt+=2)),Q&&(qe.ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MAX=!0,qe.ELLIPSOID_INTERSECTION_INDEX_LATITUDE_MAX=lt,k?(qe.ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MAX_UNDER_HALF=!0,lt+=2):G?(qe.ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MAX_EQUAL_HALF=!0,lt+=1):q&&(qe.ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MAX_OVER_HALF=!0,lt+=1)),Pe.ellipsoidRenderLatitudeSinMinMax=U.fromElements(Math.sin(b.y),Math.sin(x.y),Pe.ellipsoidRenderLatitudeSinMinMax));let ht=0,Bi=1;return $e&&(qe.ELLIPSOID_HAS_SHAPE_BOUNDS_LATITUDE=!0,fe>u&&(ht=(s.y-o.y)/fe,Bi=(o.y-g.y)/fe)),Pe.ellipsoidLocalToShapeUvScale=h.fromElements(Xt,ht,ft,Pe.ellipsoidLocalToShapeUvScale),this._localToShapeUvTranslate=h.fromElements(rt,Bi,0,this._localToShapeUvTranslate),this._shaderMaximumIntersectionsLength=lt,!0};var nUt=new he,iUt=new h,rUt=new N,lBe=new $;Ph.prototype.updateViewTransforms=function(e){let t=this._shaderUniforms,n=this._ellipsoid,i=e.camera.positionWC,r=n.cartesianToCartographic(i,nUt);h.fromElements(r.longitude,r.latitude,r.height,t.cameraPositionCartographic);let o=h.fromRadians(r.longitude,r.latitude,0,n,iUt);t.ellipsoidCurvatureAtLatitude=n.getLocalCurvature(o,t.ellipsoidCurvatureAtLatitude);let s=At.eastNorthUpToFixedFrame(o,n,rUt),a=N.getRotation(s,lBe),c=e.context.uniformState.viewRotation,u=$.multiply(c,a,lBe);t.ellipsoidEcToEastNorthUp=$.transpose(u,t.ellipsoidEcToEastNorthUp)};var gBe=new ie;Ph.prototype.computeOrientedBoundingBoxForTile=function(e,t,n,i,r){let o=1/Math.pow(2,e),s=t*o,a=(t+1)*o,c=n*o,u=(n+1)*o,f=i*o,d=(i+1)*o,p=ie.subsection(this._rectangle,s,c,a,u,gBe),g=D.lerp(this._minimumHeight,this._maximumHeight,f),m=D.lerp(this._minimumHeight,this._maximumHeight,d);return Lse(p,g,m,this._ellipsoid,this._translation,this._rotation,r)};var oUt=new U,sUt=new U,s4=new U,uBe=new U,fBe=new U,a4=new U;function aUt(e,t,n,i){let r=U.abs(e,oUt),o=U.fromElements(1/t.x,1/t.y,sUt),s=U.fromElements(Math.SQRT1_2,Math.SQRT1_2,s4),a=U.multiplyComponents(t,s,uBe),c=U.fromElements(n.x*s.x*s.x*s.x,n.y*s.y*s.y*s.y,fBe);for(let u=0;u<3;++u){let f=U.magnitude(U.subtract(a,c,a4)),d=U.normalize(U.subtract(r,c,a4),a4),p=U.multiplyByScalar(d,f,a4);s=U.multiplyComponents(U.add(p,c,s4),o,s4),s=U.normalize(U.clamp(s,U.ZERO,U.ONE,s4),s4),a=U.multiplyComponents(t,s,uBe),c=U.fromElements(n.x*s.x*s.x*s.x,n.y*s.y*s.y*s.y,fBe)}return h.fromElements(Math.sign(e.x)*a.x,Math.sign(e.y)*a.y,U.magnitude(U.subtract(a,c,a4)),i)}var cUt=new U,dBe=new U,lUt=new h,hBe=new U;Ph.prototype.convertLocalToShapeUvSpace=function(e,t){let n=Math.atan2(e.y,e.x),{ellipsoidRadii:i,evoluteScale:r,ellipsoidInverseRadiiSquared:o,ellipsoidShapeUvLongitudeRangeOrigin:s,ellipsoidLocalToShapeUvScale:a}=this._shaderUniforms,c=this._localToShapeUvTranslate,u=Math.hypot(e.x,e.y),f=U.fromElements(u,e.z,dBe),d=aUt(f,U.fromElements(i.x,i.z,cUt),r,lUt),p=U.normalize(U.fromElements(d.x*o.x,d.y*o.z,hBe),hBe),g=Math.atan2(p.y,p.x),m=U.magnitude(f)<U.magnitude(d)?-1:1,y=U.subtract(f,d,dBe),A=m*U.magnitude(y),{ELLIPSOID_HAS_SHAPE_BOUNDS_LONGITUDE:b,ELLIPSOID_HAS_SHAPE_BOUNDS_LATITUDE:x}=this._shaderDefines;return n=(n+Math.PI)/(2*Math.PI),l(b)&&(n-=s,n=n-Math.floor(n),n=n*a.x+c.x),g=(g+Math.PI/2)/Math.PI,l(x)&&(g=g*a.y+c.y),A=1+A*a.z,h.fromElements(n,g,A,t)};var mBe=new h,pBe=new h,uUt=new h;Ph.prototype.computeOrientedBoundingBoxForSample=function(e,t,n,i){let r=1/Math.pow(2,e.level),o=h.divideComponents(h.ONE,t,mBe),s=h.multiplyByScalar(o,r,mBe),a=h.multiplyByScalar(h.fromElements(e.x+n.x,e.y+n.y,e.z+n.z,pBe),r,pBe),c=h.add(a,s,uUt),u=ie.subsection(this._rectangle,a.x,a.y,c.x,c.y,gBe),f=D.lerp(this._minimumHeight,this._maximumHeight,a.z),d=D.lerp(this._minimumHeight,this._maximumHeight,c.z);return Lse(u,f,d,this._ellipsoid,this._translation,this._rotation,i)};function Lse(e,t,n,i,r,o,s){return s=en.fromRectangle(e,t,n,i,s),s.center=h.add(s.center,r,s.center),s.halfAxes=$.multiply(s.halfAxes,o,s.halfAxes),s}Ph.DefaultMinBounds=Object.freeze(new h(-D.PI,-D.PI_OVER_TWO,-ee.WGS84.minimumRadius));Ph.DefaultMaxBounds=Object.freeze(new h(D.PI,D.PI_OVER_TWO,10*ee.WGS84.maximumRadius));var IC=Ph;var mf={BOX:"BOX",ELLIPSOID:"ELLIPSOID",CYLINDER:"CYLINDER"};mf.getMinBounds=function(e){switch(e){case mf.BOX:return SC.DefaultMinBounds;case mf.ELLIPSOID:return IC.DefaultMinBounds;case mf.CYLINDER:return wC.DefaultMinBounds}};mf.getMaxBounds=function(e){switch(e){case mf.BOX:return SC.DefaultMaxBounds;case mf.ELLIPSOID:return IC.DefaultMaxBounds;case mf.CYLINDER:return wC.DefaultMaxBounds}};mf.getShapeConstructor=function(e){switch(e){case mf.BOX:return SC;case mf.ELLIPSOID:return IC;case mf.CYLINDER:return wC}};Object.freeze(mf);var Ec=mf;function lp(e){this._comparator=e.comparator,this._maximumLength=e.maximumLength,this._array=l(e.maximumLength)?new Array(e.maximumLength):[],this._length=0}Object.defineProperties(lp.prototype,{length:{get:function(){return this._length}},maximumLength:{get:function(){return this._maximumLength},set:function(e){if(l(e)){for(;this._length>e;)this.removeMinimum();this._array.length=e}this._maximumLength=e}},internalArray:{get:function(){return this._array}},comparator:{get:function(){return this._comparator}}});lp.prototype.clone=function(){let e=this._maximumLength,t=this._comparator,n=this._array,i=this._length,r=new lp({comparator:t,maximumLength:e});r._length=i;for(let o=0;o<i;o++)r._array[o]=n[o];return r};lp.prototype.reset=function(){this._length=0;let e=this._maximumLength;if(l(e))for(let t=0;t<e;t++)this._array[t]=void 0;else this._array.length=0};lp.prototype.resort=function(){let e=this._length;for(let t=0;t<e;t++)_Be(this,t)};lp.prototype.insert=function(e){let t,n=this._maximumLength;if(l(n)){if(n===0)return;if(this._length===n){let r=this._array[0];if(this._comparator(e,r)<=0)return e;t=this.removeMinimum()}}let i=this._length;return this._array[i]=e,this._length++,_Be(this,i),t};lp.prototype.removeMinimum=function(){let e=this._length;if(e===0)return;this._length--;let t=this._array[0];return e>=2&&(this._array[0]=this._array[e-1],yBe(this,0)),this._array[e-1]=void 0,t};lp.prototype.removeMaximum=function(){let e=this._length;if(e===0)return;this._length--;let t;if(e<=2)t=this._array[e-1];else{let n=Fse(this,1,2)?1:2;t=this._array[n],this._array[n]=this._array[e-1],e>=4&&yBe(this,n)}return this._array[e-1]=void 0,t};lp.prototype.getMinimum=function(){if(this._length!==0)return this._array[0]};lp.prototype.getMaximum=function(){let e=this._length;if(e!==0)return e<=2?this._array[e-1]:this._array[Fse(this,1,2)?1:2]};function mW(e,t,n){let i=e._array,r=i[t];i[t]=i[n],i[n]=r}function c4(e,t,n){return e._comparator(e._array[t],e._array[n])<0}function Fse(e,t,n){return e._comparator(e._array[t],e._array[n])>0}function _Be(e,t){if(t===0)return;let n=Math.floor(D.log2(t+1))%2===0,i=Math.floor((t-1)/2),r=c4(e,t,i);for(r!==n&&(mW(e,t,i),t=i);t>=3;){let o=Math.floor((t-3)/4);if(c4(e,t,o)!==r)break;mW(e,t,o),t=o}}function yBe(e,t){let n=e._length,i=Math.floor(D.log2(t+1))%2===0,r;for(;(r=2*t+1)<n;){let o=r,s=r+1;if(s<n){c4(e,s,o)===i&&(o=s);let a=2*r+1,c=Math.max(Math.min(n-a,4),0);for(let u=0;u<c;u++){let f=a+u;c4(e,f,o)===i&&(o=f)}}if(c4(e,o,t)===i&&(mW(e,o,t),o!==r&&o!==s)){let a=Math.floor((o-1)/2);Fse(e,o,a)===i&&mW(e,o,a)}t=o}}var hy=lp;var Bse=Object.freeze({UNLOADED:0,RECEIVING:1,PROCESSING:2,LOADED:3,FAILED:4,UNAVAILABLE:5});function l4(e,t){this.spatialNode=e,this.keyframe=t,this.state=Bse.UNLOADED,this.content=void 0,this.megatextureIndex=-1,this.priority=-Number.MAX_VALUE,this.highPriorityFrameNumber=-1}l4.prototype.unload=function(){this.content=this.content&&this.content.destroy(),this.spatialNode=void 0,this.state=Bse.UNLOADED,this.megatextureIndex=-1,this.priority=-Number.MAX_VALUE,this.highPriorityFrameNumber=-1};l4.priorityComparator=function(e,t){return e.priority-t.priority};l4.searchComparator=function(e,t){return e.keyframe-t.keyframe};l4.LoadState=Bse;var Hr=l4;function W0(e,t,n,i,r=134217728,o){let s=fUt(i),a=dUt(n),c=n*Lt.getSizeInBytes(i),u=W0.get3DTextureDimension(t,c,r,o),f=h.divideComponents(u,t,new h);this.channelCount=n,this.componentType=i,this.textureMemoryByteLength=c*u.x*u.y*u.z,this.tileCounts=h.clone(f,new h),this.voxelCountPerTile=h.clone(t,new h),this.maximumTileCount=f.x*f.y*f.z,this.texture=new LO({context:e,pixelFormat:a,pixelDatatype:s,flipY:!1,width:u.x,height:u.y,depth:u.z,sampler:new jt({wrapR:hn.CLAMP_TO_EDGE,wrapS:hn.CLAMP_TO_EDGE,wrapT:hn.CLAMP_TO_EDGE,minificationFilter:Wt.LINEAR,magnificationFilter:Jn.LINEAR})}),this.nodes=new Array(this.maximumTileCount);for(let d=0;d<this.maximumTileCount;d++)this.nodes[d]=new hUt(d);for(let d=0;d<this.maximumTileCount;d++){let p=this.nodes[d];p.previousNode=d>0?this.nodes[d-1]:void 0,p.nextNode=d<this.maximumTileCount-1?this.nodes[d+1]:void 0}this.occupiedList=void 0,this.emptyList=this.nodes[0],this.occupiedCount=0,this._nearestSampling=!1}Object.defineProperties(W0.prototype,{nearestSampling:{get:function(){return this._nearestSampling},set:function(e){this._nearestSampling!==e&&(e?this.texture.sampler=jt.NEAREST:this.texture.sampler=new jt({wrapR:hn.CLAMP_TO_EDGE,wrapS:hn.CLAMP_TO_EDGE,wrapT:hn.CLAMP_TO_EDGE,minificationFilter:Wt.LINEAR,magnificationFilter:Jn.LINEAR}),this._nearestSampling=e)}}});function fUt(e){if(e===Lt.FLOAT32||e===Lt.FLOAT64)return ze.FLOAT;if(e===Lt.UINT8)return ze.UNSIGNED_BYTE}function dUt(e){switch(e){case 1:return Ke.RED;case 2:return Ke.RG;case 3:return Ke.RGB;case 4:return Ke.RGBA}}function hUt(e){this.index=e,this.nextNode=void 0,this.previousNode=void 0}W0.prototype.add=function(e){if(this.isFull())throw new pe("Trying to add when there are no empty spots");let t=this.emptyList;this.emptyList=this.emptyList.nextNode,l(this.emptyList)&&(this.emptyList.previousNode=void 0),t.nextNode=this.occupiedList,l(t.nextNode)&&(t.nextNode.previousNode=t),this.occupiedList=t;let n=t.index;return this.writeDataToTexture(n,e),this.occupiedCount++,n};W0.prototype.remove=function(e){if(e<0||e>=this.maximumTileCount)throw new pe("Megatexture index out of bounds");let t=this.nodes[e];l(t.previousNode)&&(t.previousNode.nextNode=t.nextNode),l(t.nextNode)&&(t.nextNode.previousNode=t.previousNode),t.nextNode=this.emptyList,l(t.nextNode)&&(t.nextNode.previousNode=t),t.previousNode=void 0,this.emptyList=t,this.occupiedCount--};W0.prototype.isFull=function(){return this.emptyList===void 0};W0.get3DTextureDimension=function(e,t,n,i){let{maximum3DTextureSize:r}=kt;if(h.maximumComponent(e)>r)throw new oe("The GL context does not support a 3D texture large enough to contain a tile with the given dimensions.");let o=t*e.x*e.y*e.z,s=Math.floor(n/o);if(s<1)throw new oe("Not enough texture memory available to create a megatexture with the given tile dimensions.");l(i)?i=Math.min(i,s):i=s;let a=Object.entries(e).sort((f,d)=>d[1]-f[1]),c=a.map(([f,d])=>Math.floor(r/d));for(let f=0;f<3;f++){let d=ABe(c);if(d<i)break;let p=c.slice();p.splice(f,1);let g=p[0]*p[1],m=d-i,y=Math.floor(m/g);c[f]-=y}ABe(c)>s&&(c[2]=Math.floor(s/(c[0]*c[1])));let u=new h;for(let f=0;f<3;f++){let[d,p]=a[f];u[d]=c[f]*p}return u};function ABe(e){return e.reduce((t,n)=>t*n)}W0.prototype.writeDataToTexture=function(e,t){let{tileCounts:n,voxelCountPerTile:i}=this,r={arrayBufferView:t,width:i.x,height:i.y,depth:i.z},o=n.x*n.y,s=Math.floor(e/o),a=e-s*o,c=Math.floor(a/n.x),u=a-c*n.x,f={source:r,xOffset:u*i.x,yOffset:c*i.y,zOffset:s*i.z};this.texture.copyFrom(f)};W0.prototype.isDestroyed=function(){return!1};W0.prototype.destroy=function(){return this.texture=this.texture&&this.texture.destroy(),le(this)};var u4=W0;function Dh(e,t,n,i,r,o,s){this.children=void 0,this.parent=r,this.level=e,this.x=t,this.y=n,this.z=i,this.dimensions=h.clone(s),this.keyframeNodes=[],this.renderableKeyframeNodes=[],this.renderableKeyframeNodeLerp=0,this.renderableKeyframeNodePrevious=void 0,this.renderableKeyframeNodeNext=void 0,this.orientedBoundingBox=new en,this.approximateVoxelSize=0,this.screenSpaceError=0,this.visitedFrameNumber=-1,this.computeBoundingVolumes(o)}var mUt=new h;Dh.prototype.computeBoundingVolumes=function(e){this.orientedBoundingBox=e.computeOrientedBoundingBoxForTile(this.level,this.x,this.y,this.z,this.orientedBoundingBox);let t=$.getScale(this.orientedBoundingBox.halfAxes,mUt),n=2*h.maximumComponent(t);this.approximateVoxelSize=n/h.minimumComponent(this.dimensions)};Dh.prototype.constructChildNodes=function(e){let{level:t,x:n,y:i,z:r}=this,o=n*2,s=i*2,a=r*2,c=s+1,u=o+1,f=a+1,d=t+1,p=[[d,o,s,a],[d,u,s,a],[d,o,c,a],[d,u,c,a],[d,o,s,f],[d,u,s,f],[d,o,c,f],[d,u,c,f]];this.children=p.map(([g,m,y,A])=>new Dh(g,m,y,A,this,e,this.dimensions))};Dh.prototype.visibility=function(e,t){let n=this.orientedBoundingBox;return e.cullingVolume.computeVisibilityWithPlaneMask(n,t)};Dh.prototype.computeScreenSpaceError=function(e,t){let n=this.orientedBoundingBox,i=Math.sqrt(n.distanceSquaredTo(e));i=Math.max(i,D.EPSILON7);let r=this.approximateVoxelSize,o=t*(r/i);this.screenSpaceError=o};var bBe={keyframe:0};function f4(e,t){return bBe.keyframe=e,vr(t,bBe,Hr.searchComparator)}Dh.prototype.computeSurroundingRenderableKeyframeNodes=function(e){let t=this,n=t.level,i=Math.floor(e),r=Math.ceil(e),o,s,a=+Number.MAX_VALUE,c=+Number.MAX_VALUE;for(;l(t);){let{renderableKeyframeNodes:d}=t;if(d.length>=1){let p=pUt(i,d),g=d[p],m=r===i||i<g.keyframe?p:Math.min(p+1,d.length-1),y=d[m],A=i-g.keyframe,b=xBe(n-t.level,A);b<a&&(a=b,o=g);let x=y.keyframe-r,T=xBe(n-t.level,x);if(T<c&&(c=T,s=y),A===0&&x===0)break}t=t.parent}if(this.renderableKeyframeNodePrevious=o,this.renderableKeyframeNodeNext=s,!l(o)||!l(s))return;let u=o.keyframe,f=s.keyframe;this.renderableKeyframeNodeLerp=u===f?0:D.clamp((e-u)/(f-u),0,1)};function pUt(e,t){let n=f4(e,t);return n<0?D.clamp(~n-1,0,t.length-1):n}function xBe(e,t){let n=Math.exp(e*4),i=t>=0?1:-200;return e*n+t*i}Dh.prototype.isVisited=function(e){return this.visitedFrameNumber===e};Dh.prototype.createKeyframeNode=function(e){let t=f4(e,this.keyframeNodes);if(t<0){t=~t;let n=new Hr(this,e);this.keyframeNodes.splice(t,0,n)}};Dh.prototype.destroyKeyframeNode=function(e,t){let n=e.keyframe,i=f4(n,this.keyframeNodes);if(i<0)throw new pe("Keyframe node does not exist.");if(this.keyframeNodes.splice(i,1),e.megatextureIndex!==-1){for(let o=0;o<t.length;o++)t[o].remove(e.megatextureIndex);let r=f4(n,this.renderableKeyframeNodes);if(r<0)throw new pe("Renderable keyframe node does not exist.");this.renderableKeyframeNodes.splice(r,1)}e.unload()};Dh.prototype.addKeyframeNodeToMegatextures=function(e,t){if(e.megatextureIndex!==-1||e.content.metadata.length!==t.length)throw new pe("Keyframe node cannot be added to megatexture");let{metadata:n}=e.content;for(let o=0;o<t.length;o++){let s=t[o];e.megatextureIndex=s.add(n[o])}let i=this.renderableKeyframeNodes,r=f4(e.keyframe,i);if(r>=0)throw new pe("Keyframe already renderable");r=~r,i.splice(r,0,e)};Dh.prototype.isRenderable=function(e){let t=this.renderableKeyframeNodePrevious,n=this.renderableKeyframeNodeNext,i=this.level;return l(t)&&l(n)&&(t.spatialNode.level===i||n.spatialNode.level===i)&&this.visitedFrameNumber===e};var d4=Dh;function Lb(e,t,n,i){let{provider:r,dimensions:o,inputDimensions:s}=e,{types:a,componentTypes:c}=r;l(i)?i=Math.min(Math.max(0,i),512*1024*1024):i=128*1024*1024,this._primitive=e,this.textureMemoryByteLength=0,this.megatextures=new Array(a.length);let u=l(r.maximumTileCount)?r.maximumTileCount:l(r.availableLevels)?(8**r.availableLevels-1)/7:void 0;for(let b=0;b<a.length;b++){let x=a[b],T=bt.getComponentCount(x),E=c[b];this.megatextures[b]=new u4(t,s,T,E,i,u),this.textureMemoryByteLength+=this.megatextures[b].textureMemoryByteLength}let f=this.megatextures[0].maximumTileCount;this._simultaneousRequestCount=0,this._debugPrint=!1,this._calculateStatistics=this._primitive._calculateStatistics??!1,this._frameNumber=0;let d=e._shape;this.rootNode=new d4(0,0,0,0,void 0,d,o),this._priorityQueue=new hy({maximumLength:f,comparator:Hr.priorityComparator}),this._highPriorityKeyframeNodes=new Array(f),this._highPriorityKeyframeNodeCount=0,this._keyframeNodesInMegatexture=new Array(f),this._keyframeCount=n,this._sampleCount=void 0,this._keyframeLocation=0,this._binaryTreeKeyframeWeighting=new Array(n),this._initialTilesLoaded=!1;let p=this._binaryTreeKeyframeWeighting;p[0]=0,p[n-1]=0,kse(p,1,n-2,0);let g=9,m=2048,y=Math.floor(m/g),A=Math.ceil(f/y);this.internalNodeTexture=new Dt({context:t,pixelFormat:Ke.RGBA,pixelDatatype:ze.UNSIGNED_BYTE,flipY:!1,width:m,height:A,sampler:new jt({minificationFilter:Wt.NEAREST,magnificationFilter:Jn.NEAREST})}),this.internalNodeTilesPerRow=y,this.internalNodeTexelSizeUv=new U(1/m,1/A),this.leafNodeTexture=void 0,this.leafNodeTilesPerRow=void 0,this.leafNodeTexelSizeUv=new U}Lb.prototype.findKeyframeNode=function(e){return this._keyframeNodesInMegatexture.find(function(t){return t.megatextureIndex===e})};function kse(e,t,n,i){if(t>n)return;let r=Math.floor((t+n)/2);e[r]=i,kse(e,t,r-1,i+1),kse(e,r+1,n,i+1)}Lb.simultaneousRequestCountMaximum=50;Lb.prototype.update=function(e,t,n,i){let r=this._primitive,o=e.context,s=this.megatextures[0].maximumTileCount,a=this._keyframeCount,c=r._levelBlendFactor,u=c>0,f=a>1,d=(u?2:1)*(f?2:1);this._sampleCount=d;let p=d>=2;if(p&&!l(this.leafNodeTexture)){let T=Math.floor(512),E=Math.ceil(s/T);this.leafNodeTexture=new Dt({context:o,pixelFormat:Ke.RGBA,pixelDatatype:ze.UNSIGNED_BYTE,flipY:!1,width:1024,height:E,sampler:new jt({minificationFilter:Wt.NEAREST,magnificationFilter:Jn.NEAREST})}),this.leafNodeTexelSizeUv=U.fromElements(1/1024,1/E,this.leafNodeTexelSizeUv),this.leafNodeTilesPerRow=T}else!p&&l(this.leafNodeTexture)&&(this.leafNodeTexture=this.leafNodeTexture.destroy());if(this._keyframeLocation=D.clamp(t,0,a-1),n&&TBe(this,this.rootNode),i)return;this._frameNumber=e.frameNumber;let g=xn();yUt(this,e),AUt(this,e);let m=xn();CUt(this,d,c);let y=xn(),A=r.loadProgress.numberOfListeners>0||r.allTilesLoaded.numberOfListeners>0||r.initialTilesLoaded.numberOfListeners>0;if(this._debugPrint||this._calculateStatistics||A){let b=m-g,x=y-m,T=y-g;EUt(this,e,b,x,T)}};Lb.prototype.isRenderable=function(e){return e.isRenderable(this._frameNumber)};Lb.prototype.isDestroyed=function(){return!1};Lb.prototype.destroy=function(){let e=this.megatextures,t=e.length;for(let n=0;n<t;n++)e[n]=e[n]&&e[n].destroy();return this.textureMemoryByteLength=0,this.internalNodeTexture=this.internalNodeTexture&&this.internalNodeTexture.destroy(),this.leafNodeTexture=this.leafNodeTexture&&this.leafNodeTexture.destroy(),le(this)};function TBe(e,t){if(t.computeBoundingVolumes(e._primitive._shape),l(t.children))for(let n=0;n<8;n++){let i=t.children[n];TBe(e,i)}}function gUt(e,t){if(e._simultaneousRequestCount>=Lb.simultaneousRequestCountMaximum)return;let i=e._primitive.provider,{keyframe:r,spatialNode:o}=t;if(l(i.availableLevels)&&o.level>=i.availableLevels)return;function s(f){e._simultaneousRequestCount--,t.content=f,t.state=l(f)?Hr.LoadState.PROCESSING:Hr.LoadState.UNAVAILABLE}function a(f){e._simultaneousRequestCount--,t.state=Hr.LoadState.FAILED,e._primitive.tileFailed.raiseEvent()}let c={tileLevel:o.level,tileX:o.x,tileY:o.y,tileZ:o.z,keyframe:r},u=i.requestData(c);l(u)&&(e._simultaneousRequestCount++,t.state=Hr.LoadState.RECEIVING,u.then(s).catch(a))}function _Ut(e){return e/(1+e)}function yUt(e,t){let n=e._frameNumber,i=e._priorityQueue;i.reset(),EBe(e.rootNode,ta.MASK_INDETERMINATE,e,t);let r=e._highPriorityKeyframeNodes,o=0,s;for(;i.length>0;)s=i.removeMaximum(),s.highPriorityFrameNumber=n,r[o]=s,o++;e._highPriorityKeyframeNodeCount=o}function AUt(e,t){let n=e.megatextures[0],i=n.occupiedCount,r=e._keyframeNodesInMegatexture;r.length=i,r.sort(bUt);let o=e._highPriorityKeyframeNodes,s=e._highPriorityKeyframeNodeCount,a=0,c=0;for(let u=0;u<s;u++){let f=o[u];if(!(f.state===Hr.LoadState.LOADED||f.spatialNode===void 0)&&(f.state===Hr.LoadState.UNLOADED&&gUt(e,f),f.state===Hr.LoadState.PROCESSING)){let{content:d}=f;if(d.update(e._primitive,t),!d.ready)continue;if(!xUt(d.metadata,e)){f.content=void 0,f.state=Hr.LoadState.FAILED,e._primitive.tileFailed.raiseEvent();continue}let p;if(n.isFull()){p=i-1-a,a++;let g=r[p];e._primitive.tileUnload.raiseEvent(),g.spatialNode.destroyKeyframeNode(g,e.megatextures)}else p=i+c,c++;f.spatialNode.addKeyframeNodeToMegatextures(f,e.megatextures),f.state=Hr.LoadState.LOADED,r[p]=f,e._primitive.tileLoad.raiseEvent()}}}function bUt(e,t){return e.highPriorityFrameNumber===t.highPriorityFrameNumber?t.priority-e.priority:t.highPriorityFrameNumber-e.highPriorityFrameNumber}function xUt(e,t){let n=t._primitive.provider.types.length;if(!Array.isArray(e)||e.length!==n)return!1;let{megatextures:i}=t;for(let r=0;r<n;r++){let{voxelCountPerTile:o,channelCount:s}=i[r],{x:a,y:c,z:u}=o,f=a*c*u,d=e[r],p=f*s;if(d.length!==p)return!1}return!0}function EBe(e,t,n,i){let{camera:r,context:o,pixelRatio:s,frameNumber:a}=i,{positionWC:c,frustum:u}=r,d=o.drawingBufferHeight/s/u.sseDenominator;if(e.computeScreenSpaceError(c,d),t=e.visibility(i,t),t===ta.MASK_OUTSIDE)return;e.visitedFrameNumber=a;let p=n._primitive,g=p._shape,m=p.screenSpaceError,y=n._priorityQueue,A=n._keyframeCount,b=D.clamp(Math.floor(n._keyframeLocation),0,A-2),x=b+1;if(A===1)e.createKeyframeNode(0);else if(e.keyframeNodes.length!==A)for(let I=0;I<A;I++)e.createKeyframeNode(I);let{screenSpaceError:T,keyframeNodes:E}=e,v=_Ut(T),S=!1;for(let I=0;I<E.length;I++){let R=E[I];R.priority=10*v+TUt(b,R.keyframe,x,n),R.state!==Hr.LoadState.UNAVAILABLE&&R.state!==Hr.LoadState.FAILED&&R.priority!==-Number.MAX_VALUE&&y.insert(R),R.state===Hr.LoadState.LOADED&&(S=!0)}if(T<m||!S){e.children=void 0;return}l(e.children)||e.constructChildNodes(g);for(let I=0;I<8;I++){let R=e.children[I];EBe(R,t,n,i)}}function TUt(e,t,n,i){let r=Math.min(Math.abs(t-e),Math.abs(t-n)),o=Math.max(e,i._keyframeCount-n-1,1),s=Math.pow(1-r/o,4),a=Math.exp(-i._binaryTreeKeyframeWeighting[t]);return D.lerp(a,s,.15+.85*s)}function EUt(e,t,n,i,r){let o=e._keyframeCount,s=e.rootNode,a=Object.keys(Hr.LoadState).length,c=new Array(a),u=new Array(a),f=0;for(let S=0;S<a;S++){let I=new Array(o).fill(0);c[S]=I,u[S]=0}function d(S){let I=S.keyframeNodes;for(let R=0;R<I.length;R++){let O=I[R],L=O.keyframe,_=O.state;c[_][L]+=1,u[_]+=1,f++}if(l(S.children))for(let R=0;R<8;R++){let O=S.children[R];d(O)}}d(s),e._primitive.statistics.numberOfTilesWithContentReady=u[Hr.LoadState.LOADED],e._primitive.statistics.visited=f;let p=u[Hr.LoadState.RECEIVING],g=u[Hr.LoadState.PROCESSING],m=p!==e._primitive.statistics.numberOfPendingRequests||g!==e._primitive.statistics.numberOfTilesProcessing;if(m&&t.afterRender.push(function(){return e._primitive.loadProgress.raiseEvent(p,g),!0}),e._primitive.statistics.numberOfPendingRequests=p,e._primitive.statistics.numberOfTilesProcessing=g,m&&(p===0&&g===0)&&(t.afterRender.push(function(){return e._primitive.allTilesLoaded.raiseEvent(),!0}),e._initialTilesLoaded||(e._initialTilesLoaded=!0,t.afterRender.push(function(){return e._primitive.initialTilesLoaded.raiseEvent(),!0}))),!e._debugPrint)return;let A=`KEYFRAMES: ${c[Hr.LoadState.LOADED]}`,b=`UNLOADED: ${u[Hr.LoadState.UNLOADED]} | RECEIVING: ${u[Hr.LoadState.RECEIVING]} | PROCESSING: ${u[Hr.LoadState.PROCESSING]} | LOADED: ${u[Hr.LoadState.LOADED]} | FAILED: ${u[Hr.LoadState.FAILED]} | UNAVAILABLE: ${u[Hr.LoadState.UNAVAILABLE]} | TOTAL: ${f}`,x=Math.round(n*100)/100,T=Math.round(i*100)/100,E=Math.round(r*100)/100,v=`LOAD: ${x} | OCT: ${T} | ALL: ${E}`;console.log(`${A} || ${b} || ${v}`)}var pW={INTERNAL:0,LEAF:1,PACKED_LEAF_FROM_PARENT:2};function CUt(e,t,n){let i=e._primitive._screenSpaceError,r=e._keyframeLocation,o=e._frameNumber,s=t>=2,a=0,c=0,u=[],f=[];function d(g,m,y,A,b){let x=!1;if(l(g.children))for(let T=0;T<8;T++){let E=g.children[T];E.computeSurroundingRenderableKeyframeNodes(r),E.isRenderable(o)&&(x=!0)}if(x){u[b]=pW.INTERNAL<<16|m,u[y]=A,a++,A=m,b=A*9+1;for(let T=0;T<8;T++){let E=g.children[T];m=a,y=m*9+0,d(E,m,y,A,b+T)}}else{if(e._primitive.tileVisible.raiseEvent(),s){let T=c*5,E=g.renderableKeyframeNodePrevious,v=g.level-E.spatialNode.level,S=E.spatialNode.parent,I=l(S)?S.renderableKeyframeNodePrevious:E,R=vUt(g,i,n),O=v,L=1,_=E.megatextureIndex,C=I.megatextureIndex;f[T+0]=R,f[T+1]=O,f[T+2]=L,f[T+3]=_,f[T+4]=C,u[b]=pW.LEAF<<16|c}else{let T=g.renderableKeyframeNodePrevious,v=g.level-T.spatialNode.level===0?pW.LEAF:pW.PACKED_LEAF_FROM_PARENT;u[b]=v<<16|T.megatextureIndex}c++}}let p=e.rootNode;p.computeSurroundingRenderableKeyframeNodes(r),p.isRenderable(o)&&d(p,0,0,0,0),SUt(u,9,e.internalNodeTilesPerRow,e.internalNodeTexture),s&&wUt(f,2,e.leafNodeTilesPerRow,e.leafNodeTexture)}function vUt(e,t,n){if(e.parent===void 0)return 0;let i=e.screenSpaceError,r=e.parent.screenSpaceError,s=((t-i)/(r-i)+n-1)/n;return D.clamp(s,0,1)}function SUt(e,t,n,i){let r=Ke.componentsLength(i.pixelFormat),o=Math.ceil(e.length/t),s=Math.max(1,t*Math.min(o,n)),a=Math.max(1,Math.ceil(o/n)),c=new Uint8Array(s*a*r);for(let d=0;d<e.length;d++){let p=e[d],g=d*r;for(let m=0;m<r;m++)c[g+m]=p>>>m*8&255}let f={source:{arrayBufferView:c,width:s,height:a},xOffset:0,yOffset:0};i.copyFrom(f)}function wUt(e,t,n,i){let r=Ke.componentsLength(i.pixelFormat),o=5,s=Math.ceil(e.length/o),a=Math.max(1,t*Math.min(s,n)),c=Math.max(1,Math.ceil(s/n)),u=new Uint8Array(a*c*r);for(let p=0;p<s;p++){let g=e[p*o+0],m=e[p*o+1],y=e[p*o+2],A=e[p*o+3],b=e[p*o+4],x=D.clamp(Math.floor(65536*g),0,65535);u[p*8+0]=x>>>0&255,u[p*8+1]=x>>>8&255,u[p*8+2]=m&255,u[p*8+3]=y&255,u[p*8+4]=A>>>0&255,u[p*8+5]=A>>>8&255,u[p*8+6]=b>>>0&255,u[p*8+7]=b>>>8&255}let d={source:{arrayBufferView:u,width:a,height:c},xOffset:0,yOffset:0};i.copyFrom(d)}var h4=Lb;function q0(e){e=e??H.EMPTY_OBJECT;let{provider:t=q0.DefaultProvider,modelMatrix:n=N.IDENTITY,customShader:i=vP(t),clock:r,calculateStatistics:o=!1}=e;this._ready=!1,this._provider=t,this._traversal=void 0,this._statistics=new Pm,this._calculateStatistics=o;let{shape:s,minBounds:a=Ec.getMinBounds(s),maxBounds:c=Ec.getMaxBounds(s),dimensions:u,paddingBefore:f=h.ZERO,paddingAfter:d=h.ZERO,metadataOrder:p,availableLevels:g=1}=t;this._dimensions=h.clone(u),this._paddingBefore=h.clone(f),this._paddingAfter=h.clone(d),this._inputDimensions=IUt(u,f,d,p),this._availableLevels=g,this._minBounds=a.clone(),this._minBoundsOld=new h,this._maxBounds=c.clone(),this._maxBoundsOld=new h,this._minClippingBounds=a.clone(),this._minClippingBoundsOld=new h,this._maxClippingBounds=c.clone(),this._maxClippingBoundsOld=new h,this._verticalExaggeration=1,this._verticalExaggerationRelativeHeight=0,this._clippingPlanes=void 0,this._clippingPlanesState=0,this._clippingPlanesEnabled=!1,this._modelMatrix=N.clone(n),this._modelMatrixOld=N.clone(this._modelMatrix),this._customShader=i??q0.DefaultCustomShader,this._customShaderCompilationEvent=new be,this._shaderDirty=!0,this._drawCommand=void 0,this._drawCommandPick=void 0,this._pickId=void 0,this._clock=r,this._transformPositionLocalToWorld=new N,this._transformPositionWorldToLocal=new N,this._transformPlaneLocalToView=new N,this._transformDirectionWorldToLocal=new $,this._nearestSampling=!1,this._levelBlendFactor=0,this._stepSizeMultiplier=1,this._depthTest=!0,this._useLogDepth=void 0,this._screenSpaceError=4,this._debugPolylines=new Cm,this._debugDraw=!1,this._disableRender=!1,this._disableUpdate=!1;let m=Ec.getShapeConstructor(s);this._shape=new m,vBe(this),this._shapeVisible=SBe(this),this._uniforms={octreeInternalNodeTexture:void 0,octreeInternalNodeTilesPerRow:0,octreeInternalNodeTexelSizeUv:new U,octreeLeafNodeTexture:void 0,octreeLeafNodeTilesPerRow:0,octreeLeafNodeTexelSizeUv:new U,megatextureTextures:[],megatextureTileCounts:new h,dimensions:this._dimensions,inputDimensions:this._inputDimensions,paddingBefore:this._paddingBefore,paddingAfter:this._paddingAfter,transformPositionViewToLocal:new N,transformDirectionViewToLocal:new $,cameraPositionLocal:new h,cameraDirectionLocal:new h,cameraTileCoordinates:new se,cameraTileUv:new h,ndcSpaceAxisAlignedBoundingBox:new se,clippingPlanesTexture:void 0,clippingPlanesMatrix:new N,renderBoundPlanesTexture:void 0,stepSize:this._stepSizeMultiplier,pickColor:new z},this._shapeDefinesOld={},this._uniformMap={};let y=this._uniforms,A=this._uniformMap;for(let b in y)if(y.hasOwnProperty(b)){let x=`u_${b}`;A[x]=function(){return y[b]}}PUt(this,this._shape),this.tileLoad=new be,this.tileVisible=new be,this.tileFailed=new be,this.tileUnload=new be,this.loadProgress=new be,this.allTilesLoaded=new be,this.initialTilesLoaded=new be}function IUt(e,t,n,i){let r=h.add(e,t,new h);if(h.add(r,n,r),i===G0.Y_UP){let o=r.y;r.y=r.z,r.z=o}return r}function PUt(e,t){let n=e._uniformMap,{shaderUniforms:i,shaderDefines:r}=t;for(let o in i)if(i.hasOwnProperty(o)){let s=`u_${o}`;n[s]=function(){return i[o]}}e._shapeDefinesOld=Je(r,!0)}Object.defineProperties(q0.prototype,{ready:{get:function(){return this._ready}},provider:{get:function(){return this._provider}},boundingSphere:{get:function(){return this._shape.boundingSphere}},orientedBoundingBox:{get:function(){return this._shape.orientedBoundingBox}},modelMatrix:{get:function(){return this._modelMatrix},set:function(e){this._modelMatrix=N.clone(e,this._modelMatrix)}},shape:{get:function(){return this._provider.shape}},dimensions:{get:function(){return this._dimensions}},inputDimensions:{get:function(){return this._inputDimensions}},paddingBefore:{get:function(){return this._paddingBefore}},paddingAfter:{get:function(){return this._paddingAfter}},minimumValues:{get:function(){return this._provider.minimumValues}},maximumValues:{get:function(){return this._provider.maximumValues}},show:{get:function(){return!this._disableRender},set:function(e){this._disableRender=!e}},disableUpdate:{get:function(){return this._disableUpdate},set:function(e){this._disableUpdate=e}},debugDraw:{get:function(){return this._debugDraw},set:function(e){this._debugDraw=e}},depthTest:{get:function(){return this._depthTest},set:function(e){this._depthTest!==e&&(this._depthTest=e,this._shaderDirty=!0)}},nearestSampling:{get:function(){return this._nearestSampling},set:function(e){this._nearestSampling=e}},levelBlendFactor:{get:function(){return this._levelBlendFactor},set:function(e){this._levelBlendFactor=D.clamp(e,0,1)}},screenSpaceError:{get:function(){return this._screenSpaceError},set:function(e){this._screenSpaceError=e}},stepSize:{get:function(){return this._stepSizeMultiplier},set:function(e){this._stepSizeMultiplier=e}},minBounds:{get:function(){return this._minBounds},set:function(e){this._minBounds=h.clone(e,this._minBounds)}},maxBounds:{get:function(){return this._maxBounds},set:function(e){this._maxBounds=h.clone(e,this._maxBounds)}},minClippingBounds:{get:function(){return this._minClippingBounds},set:function(e){this._minClippingBounds=h.clone(e,this._minClippingBounds)}},maxClippingBounds:{get:function(){return this._maxClippingBounds},set:function(e){this._maxClippingBounds=h.clone(e,this._maxClippingBounds)}},clippingPlanes:{get:function(){return this._clippingPlanes},set:function(e){bs.setOwner(e,this,"_clippingPlanes")}},customShader:{get:function(){return this._customShader},set:function(e){if(e===this._customShader)return;let t=this._uniformMap,i=this._customShader.uniformMap;for(let r in i)i.hasOwnProperty(r)&&delete t[r];if(l(e))this._customShader=e;else{let r=vP(this._provider);this._customShader=r??q0.DefaultCustomShader}this._shaderDirty=!0}},customShaderCompilationEvent:{get:function(){return this._customShaderCompilationEvent}},statistics:{get:function(){return this._statistics}}});var DUt=new se,RUt=new se,OUt=new N,MUt=new N,NUt=new h,LUt=new se;q0.prototype.update=function(e){let t=this._provider,n=this._uniforms;this._customShader.update(e);let i=e.context;if(!this._ready){jUt(this,t,i),e.afterRender.push(()=>(this._ready=!0,!0));return}let r=vBe(this),o=VUt(this,e);if((r||o)&&(this._shapeVisible=SBe(this),ZUt(this)&&(this._shaderDirty=!0)),!this._shapeVisible)return;this._shape.updateViewTransforms(e);let s=QUt(t.timeIntervalCollection,this._clock),a=this._traversal,c=a._sampleCount;if(a.update(e,s,r,this._disableUpdate),c!==a._sampleCount&&(this._shaderDirty=!0),!a.isRenderable(a.rootNode)||(this._debugDraw&&azt(this,e),this._disableRender))return;this._useLogDepth!==e.useLogDepth&&(this._useLogDepth=e.useLogDepth,this._shaderDirty=!0),ezt(this,e)&&(this._shaderDirty=!0);let f=a.leafNodeTexture;l(f)&&(n.octreeLeafNodeTexture=a.leafNodeTexture,n.octreeLeafNodeTexelSizeUv=U.clone(a.leafNodeTexelSizeUv,n.octreeLeafNodeTexelSizeUv),n.octreeLeafNodeTilesPerRow=a.leafNodeTilesPerRow),this._shaderDirty&&(o4(this,i),this._shaderDirty=!1);let d=i.uniformState.viewProjection,{orientedBoundingBox:p}=this._shape,g=izt(p,d,RUt);if(g.x===1||g.y===1||g.z===-1||g.w===-1)return;n.ndcSpaceAxisAlignedBoundingBox=se.clone(g,n.ndcSpaceAxisAlignedBoundingBox);let y=i.uniformState.inverseView,A=N.multiplyTransformation(this._transformPositionWorldToLocal,y,n.transformPositionViewToLocal);this._transformPlaneLocalToView=N.transpose(A,this._transformPlaneLocalToView);let b=i.uniformState.inverseViewRotation;n.transformDirectionViewToLocal=$.multiply(this._transformDirectionWorldToLocal,b,n.transformDirectionViewToLocal),n.cameraPositionLocal=N.multiplyByPoint(this._transformPositionWorldToLocal,e.camera.positionWC,n.cameraPositionLocal),n.cameraDirectionLocal=$.multiplyByVector(this._transformDirectionWorldToLocal,e.camera.directionWC,n.cameraDirectionLocal);let x=kUt(this,n.cameraPositionLocal,LUt);n.cameraTileCoordinates=se.fromElements(Math.floor(x.x),Math.floor(x.y),Math.floor(x.z),x.w,n.cameraTileCoordinates),n.cameraTileUv=h.fromElements(x.x-Math.floor(x.x),x.y-Math.floor(x.y),x.z-Math.floor(x.z),n.cameraTileUv),n.stepSize=this._stepSizeMultiplier,FUt(this),BUt(this,e);let T=e.passes.pick?this._drawCommandPick:e.passes.pickVoxel?this._drawCommandPickVoxel:this._drawCommand;T.boundingVolume=this._shape.boundingSphere,e.commandList.push(T)};function FUt(e){let{megatextures:t}=e._traversal;for(let n=0;n<t.length;++n)t[n].nearestSampling=e._nearestSampling}function BUt(e,t){let n=e._uniforms,{renderBoundPlanes:i}=e._shape;l(i)&&(i.update(t,e._transformPlaneLocalToView),n.renderBoundPlanesTexture=i.texture)}function kUt(e,t,n){let i=e._shape.convertLocalToShapeUvSpace(t,NUt),r=e._availableLevels,o=2**(r-1);return se.fromElements(i.x*o,i.y*o,i.z*o,r-1,n)}var UUt=new h,Use=new h,zUt=new he;function VUt(e,t){let{verticalExaggeration:n,verticalExaggerationRelativeHeight:i}=t;return e._verticalExaggeration===n&&e._verticalExaggerationRelativeHeight===i?!1:(e._verticalExaggeration=n,e._verticalExaggerationRelativeHeight=i,!0)}function jUt(e,t,n){let i=e._uniforms;e._pickId=n.createPickId({primitive:e}),i.pickColor=z.clone(e._pickId.color,i.pickColor);let r=t.keyframeCount??1;e._traversal=new h4(e,n,r),e.statistics.texturesByteLength=e._traversal.textureMemoryByteLength,JUt(e._traversal,i)}function vBe(e){return m4(e,"_modelMatrix","_modelMatrixOld")+m4(e,"_minBounds","_minBoundsOld")+m4(e,"_maxBounds","_maxBoundsOld")+m4(e,"_minClippingBounds","_minClippingBoundsOld")+m4(e,"_maxClippingBounds","_maxClippingBoundsOld")>0}function m4(e,t,n){let i=e[t],r=e[n],o=!i.equals(r);return o&&i.clone(r),o?1:0}var HUt=new h,GUt=new h,WUt=new h,qUt=new h,YUt=new N,XUt=new N;function SBe(e){let t=e._verticalExaggeration,n=e._verticalExaggerationRelativeHeight,i=h.clone(e._minBounds,HUt),r=h.clone(e._maxBounds,GUt),o=h.clone(e._minClippingBounds,WUt),s=h.clone(e._maxClippingBounds,qUt),a=N.clone(e._modelMatrix,YUt);if(e.shape===Ec.ELLIPSOID)i.z=Ar.getHeight(e._minBounds.z,t,n),r.z=Ar.getHeight(e._maxBounds.z,t,n),o.z=Ar.getHeight(e._minClippingBounds.z,t,n),s.z=Ar.getHeight(e._maxClippingBounds.z,t,n);else{let m=h.fromElements(1,1,t,UUt);N.multiplyByScale(a,m,a),N.multiplyByTranslation(a,$Ut(e),a)}let c=e._provider,u=c.shapeTransform??N.IDENTITY,f=c.globalTransform??N.IDENTITY,d=N.multiplyTransformation(f,a,XUt);N.multiplyTransformation(d,u,d);let p=e._shape;return p.update(d,i,r,o,s)?(e._transformPositionLocalToWorld=N.clone(p.shapeTransform,e._transformPositionLocalToWorld),e._transformPositionWorldToLocal=N.inverse(e._transformPositionLocalToWorld,e._transformPositionWorldToLocal),e._transformDirectionWorldToLocal=N.getMatrix3(e._transformPositionWorldToLocal,e._transformDirectionWorldToLocal),!0):!1}var KUt=new h;function $Ut(e){let t=e._verticalExaggeration,n=e._verticalExaggerationRelativeHeight,{shapeTransform:i=N.IDENTITY,globalTransform:r=N.IDENTITY}=e._provider,o=N.getTranslation(i,Use),s=N.multiplyByPoint(e._modelMatrix,o,Use),a=N.multiplyByPoint(r,s,Use),u=ee.WGS84.cartesianToCartographic(a,zUt),f=0;l(u)&&(f=u.height);let d=Ar.getHeight(f,t,n);return h.fromElements(0,0,(d-f)/t,KUt)}function JUt(e,t){t.octreeInternalNodeTexture=e.internalNodeTexture,t.octreeInternalNodeTexelSizeUv=U.clone(e.internalNodeTexelSizeUv,t.octreeInternalNodeTexelSizeUv),t.octreeInternalNodeTilesPerRow=e.internalNodeTilesPerRow;let{megatextures:n}=e,i=n[0];t.megatextureTextures=new Array(n.length);for(let r=0;r<n.length;r++)t.megatextureTextures[r]=n[r].texture;t.megatextureTileCounts=h.clone(i.tileCounts,t.megatextureTileCounts)}function ZUt(e){let{shaderDefines:t}=e._shape,n=Object.keys(t).some(i=>t[i]!==e._shapeDefinesOld[i]);return n&&(e._shapeDefinesOld=Je(t,!0)),n}function QUt(e,t){if(!l(e)||!l(t))return 0;let n=t.currentTime,i,r=e.indexOf(n);r>=0?i=e.get(r):(r=~r,r===e.length?(r=e.length-1,i=e.get(r),n=i.stop):(i=e.get(r),n=i.start));let o=K.secondsDifference(i.stop,i.start),a=K.secondsDifference(n,i.start)/o;return r+a}function ezt(e,t){let n=e.clippingPlanes;if(!l(n))return!1;n.update(t);let{clippingPlanesState:i,enabled:r}=n;if(r){let o=e._uniforms;o.clippingPlanesTexture=n.texture,o.clippingPlanesMatrix=N.transpose(N.multiplyTransformation(N.inverse(n.modelMatrix,o.clippingPlanesMatrix),e._transformPositionLocalToWorld,o.clippingPlanesMatrix),o.clippingPlanesMatrix)}return e._clippingPlanesState===i&&e._clippingPlanesEnabled===r?!1:(e._clippingPlanesState=i,e._clippingPlanesEnabled=r,!0)}q0.prototype.isDestroyed=function(){return!1};q0.prototype.destroy=function(){let e=this._drawCommand;l(e)&&(e.shaderProgram=e.shaderProgram&&e.shaderProgram.destroy());let t=this._drawCommandPick;return l(t)&&(t.shaderProgram=t.shaderProgram&&t.shaderProgram.destroy()),this._pickId=this._pickId&&this._pickId.destroy(),this._traversal=this._traversal&&this._traversal.destroy(),this.statistics.texturesByteLength=0,this._clippingPlanes=this._clippingPlanes&&this._clippingPlanes.destroy(),le(this)};var CBe=new Array(new se(-1,-1,-1,1),new se(1,-1,-1,1),new se(-1,1,-1,1),new se(1,1,-1,1),new se(-1,-1,1,1),new se(1,-1,1,1),new se(-1,1,1,1),new se(1,1,1,1)),tzt=new Array(1,2,4,0,3,5,0,3,6,1,2,7,0,5,6,1,4,7,2,4,7,3,5,6),nzt=new Array(new se,new se,new se,new se,new se,new se,new se,new se);function izt(e,t,n){let i=N.fromRotationTranslation(e.halfAxes,e.center,OUt),r=N.multiply(t,i,MUt),o=+Number.MAX_VALUE,s=-Number.MAX_VALUE,a=+Number.MAX_VALUE,c=-Number.MAX_VALUE,u,f=nzt,d=CBe.length;for(u=0;u<d;u++)N.multiplyByVector(r,CBe[u],f[u]);for(u=0;u<d;u++){let p=f[u];if(p.z>=-p.w){let g=p.x/p.w,m=p.y/p.w;o=Math.min(o,g),s=Math.max(s,g),a=Math.min(a,m),c=Math.max(c,m)}else for(let g=0;g<3;g++){let m=tzt[u*3+g],y=f[m];if(y.z>=-y.w){let A=p.z+p.w,b=y.z+y.w,x=A/(A-b),T=se.lerp(p,y,x,DUt),E=T.x/T.w,v=T.y/T.w;o=Math.min(o,E),s=Math.max(s,E),a=Math.min(a,v),c=Math.max(c,v)}}}return o=D.clamp(o,-1,1),a=D.clamp(a,-1,1),s=D.clamp(s,-1,1),c=D.clamp(c,-1,1),n=se.fromElements(o,a,s,c,n),n}var zse=3e7,rzt=new h(zse,0,0),ozt=new h(0,zse,0),szt=new h(0,0,zse);function azt(e,t){let n=e._traversal,i=e._debugPolylines;i.removeAll();function r(c,u,f,d){i.add({positions:[c,u],width:d,material:Qi.fromType("Color",{color:f})})}function o(c,u,f){let d=c.computeCorners();r(d[0],d[1],u,f),r(d[2],d[3],u,f),r(d[4],d[5],u,f),r(d[6],d[7],u,f),r(d[0],d[2],u,f),r(d[4],d[6],u,f),r(d[1],d[3],u,f),r(d[5],d[7],u,f),r(d[0],d[4],u,f),r(d[2],d[6],u,f),r(d[1],d[5],u,f),r(d[3],d[7],u,f)}function s(c){if(!n.isRenderable(c))return;let u=c.level,d=Math.max(1,5/Math.pow(2,u)),g=[z.RED,z.LIME,z.BLUE][u%3];if(o(c.orientedBoundingBox,g,d),l(c.children))for(let m=0;m<8;m++)s(c.children[m])}o(e._shape.orientedBoundingBox,z.WHITE,5),s(n.rootNode);let a=10;r(h.ZERO,rzt,z.RED,a),r(h.ZERO,ozt,z.LIME,a),r(h.ZERO,szt,z.BLUE,a),i.update(t)}q0.DefaultCustomShader=new H0({fragmentShaderText:`void fragmentMain(FragmentInput fsInput, inout czm_modelMaterial material) + return texture(packedPlanes, vec2(u, v));`}var Xz=pRt;function X_(e){let{loader:t,metadata:n}=e;this._loader=t,this._metadata=n,this._resourcesLoaded=!1,this._ready=!1}Object.defineProperties(X_.prototype,{ready:{get:function(){return this._ready}},metadata:{get:function(){return this._metadata}}});X_.fromMetadataArray=function(e){return new X_({metadata:e})};X_.fromGltf=async function(e){let t=new Gf({gltfResource:e,releaseGltfJson:!1,loadAttributesAsTypedArray:!0});try{await t.load()}catch(n){throw t.destroy(),n}return new X_({loader:t})};X_.prototype.update=function(e,t){let n=this._loader;if(!this._ready){if(t.afterRender.push(()=>!0),!l(n)){this._ready=!0;return}if(this._resourcesLoaded){let{structuralMetadata:i,scene:r}=n.components,{attributes:o}=r.nodes[0].primitives[0];this._metadata=gRt(o,i,e),this._ready=!0;return}this._resourcesLoaded=n.process(t)}};function gRt(e,t,n){let{className:i,names:r,types:o,componentTypes:s}=n.provider,a=t.propertyAttributes.find(f=>f.class.id===i),{properties:c}=a,u=new Array(r.length);for(let f=0;f<e.length;f++){let d=c[r[f]].attribute,p=e.find(A=>A.name===d);if(!l(p))continue;let g=Lt.toComponentDatatype(s[f]),m=bt.getComponentCount(o[f]),y=p.count*m;u[f]=Y.createArrayBufferView(g,p.typedArray.buffer,p.typedArray.byteOffset+p.byteOffset,y)}return u}X_.prototype.isDestroyed=function(){return!1};X_.prototype.destroy=function(){return this._loader=this._loader&&this._loader.destroy(),le(this)};var XE=X_;function Cl(){this._orientedBoundingBox=new en,this._boundingSphere=new ue,this._boundTransform=new N,this._shapeTransform=new N,this._minBounds=Cl.DefaultMinBounds.clone(),this._maxBounds=Cl.DefaultMaxBounds.clone(),this._renderMinBounds=Cl.DefaultMinBounds.clone(),this._renderMaxBounds=Cl.DefaultMaxBounds.clone();let{DefaultMinBounds:e,DefaultMaxBounds:t}=Cl,n=[new ia(h.negate(h.UNIT_X,new h),e.x),new ia(h.negate(h.UNIT_Y,new h),e.y),new ia(h.negate(h.UNIT_Z,new h),e.z),new ia(h.UNIT_X,-t.x),new ia(h.UNIT_Y,-t.y),new ia(h.UNIT_Z,-t.z)];this._renderBoundPlanes=new Y_({planes:n}),this._localToShapeUvTranslate=new h,this._shaderUniforms={boxEcToXyz:new $,boxLocalToShapeUvScale:new h},this._shaderDefines={BOX_INTERSECTION_INDEX:void 0},this._shaderMaximumIntersectionsLength=0}Object.defineProperties(Cl.prototype,{orientedBoundingBox:{get:function(){return this._orientedBoundingBox}},renderBoundPlanes:{get:function(){return this._renderBoundPlanes}},boundingSphere:{get:function(){return this._boundingSphere}},boundTransform:{get:function(){return this._boundTransform}},shapeTransform:{get:function(){return this._shapeTransform}},shaderUniforms:{get:function(){return this._shaderUniforms}},shaderDefines:{get:function(){return this._shaderDefines}},shaderMaximumIntersectionsLength:{get:function(){return this._shaderMaximumIntersectionsLength}}});var _Rt=new h,yRt=new h,ARt=new $,bRt=new h,xRt=new h;Cl.prototype.update=function(e,t,n,i,r){i=i??t.clone(bRt),r=r??n.clone(xRt),t=h.clone(t,this._minBounds),n=h.clone(n,this._maxBounds);let o=h.clamp(t,i,r,this._renderMinBounds),s=h.clamp(n,i,r,this._renderMaxBounds),a=N.getScale(e,yRt);if(o.x>s.x||o.y>s.y||o.z>s.z||(o.x===s.x)+(o.y===s.y)+(o.z===s.z)>=2||a.x===0||a.y===0||a.z===0)return!1;let c=this._renderBoundPlanes;c.get(0).distance=o.x,c.get(1).distance=o.y,c.get(2).distance=o.z,c.get(3).distance=-s.x,c.get(4).distance=-s.y,c.get(5).distance=-s.z,this._shapeTransform=N.clone(e,this._shapeTransform),this._orientedBoundingBox=rie(o,s,this._shapeTransform,this._orientedBoundingBox),this._boundTransform=N.fromRotationTranslation(this._orientedBoundingBox.halfAxes,this._orientedBoundingBox.center,this._boundTransform),this._boundingSphere=ue.fromOrientedBoundingBox(this._orientedBoundingBox,this._boundingSphere);let u=this._shaderUniforms,f=this._shaderDefines;for(let y in f)f.hasOwnProperty(y)&&(f[y]=void 0);let d=0;f.BOX_INTERSECTION_INDEX=d,d+=1;let p=t,g=n,m=h.fromElements(nie(p.x,g.x),nie(p.y,g.y),nie(p.z,g.z),u.boxLocalToShapeUvScale);return this._localToShapeUvTranslate=h.negate(h.multiplyComponents(m,p,this._localToShapeUvTranslate),this._localToShapeUvTranslate),this._shaderMaximumIntersectionsLength=d,!0};function nie(e,t){return D.equalsEpsilon(e,t,D.EPSILON7)?1:1/(t-e)}var TRt=new N;Cl.prototype.updateViewTransforms=function(e){let t=this._shaderUniforms,n=N.inverse(this._shapeTransform,TRt),i=N.getMatrix3(n,t.boxEcToXyz),r=e.context.uniformState.inverseViewRotation;$.multiply(i,r,t.boxEcToXyz)};Cl.prototype.convertLocalToShapeUvSpace=function(e,t){let{boxLocalToShapeUvScale:n}=this._shaderUniforms,i=this._localToShapeUvTranslate;return h.add(h.multiplyComponents(e,n,t),i,t)};var t9=new h,iie=new h;Cl.prototype.computeOrientedBoundingBoxForTile=function(e,t,n,i,r){let o=this._minBounds,s=this._maxBounds,a=1/Math.pow(2,e),c=h.fromElements(D.lerp(o.x,s.x,a*t),D.lerp(o.y,s.y,a*n),D.lerp(o.z,s.z,a*i),t9),u=h.fromElements(D.lerp(o.x,s.x,a*(t+1)),D.lerp(o.y,s.y,a*(n+1)),D.lerp(o.z,s.z,a*(i+1)),iie);return rie(c,u,this._shapeTransform,r)};var Y1e=new h;Cl.prototype.computeOrientedBoundingBoxForSample=function(e,t,n,i){let r=1/Math.pow(2,e.level),o=h.divideComponents(h.ONE,t,Y1e),s=h.multiplyByScalar(o,r,Y1e),a=h.multiplyByScalar(h.fromElements(e.x+n.x,e.y+n.y,e.z+n.z,t9),r,t9),c=h.add(a,s,iie),u=this._minBounds,f=this._maxBounds,d=h.fromElements(D.lerp(u.x,f.x,a.x),D.lerp(u.y,f.y,a.y),D.lerp(u.z,f.z,a.z),t9),p=h.fromElements(D.lerp(u.x,f.x,c.x),D.lerp(u.y,f.y,c.y),D.lerp(u.z,f.z,c.z),iie);return rie(d,p,this._shapeTransform,i)};Cl.DefaultMinBounds=Object.freeze(new h(-1,-1,-1));Cl.DefaultMaxBounds=Object.freeze(new h(1,1,1));var X1e=new h;function rie(e,t,n,i){let r=Cl.DefaultMinBounds,o=Cl.DefaultMaxBounds;if(h.equals(e,r)&&h.equals(t,o))i.center=N.getTranslation(n,i.center),i.halfAxes=N.getMatrix3(n,i.halfAxes);else{let a=N.getScale(n,X1e),c=h.midpoint(e,t,_Rt);i.center=N.multiplyByPoint(n,c,i.center),a=h.fromElements(a.x*.5*(t.x-e.x),a.y*.5*(t.y-e.y),a.z*.5*(t.z-e.z),X1e);let u=N.getRotation(n,ARt);i.halfAxes=$.setScale(u,a,i.halfAxes)}return i}var KE=Cl;function cd(){this._orientedBoundingBox=new en,this._boundingSphere=new ue,this._boundTransform=new N,this._shapeTransform=new N,this._minBounds=cd.DefaultMinBounds.clone(),this._maxBounds=cd.DefaultMaxBounds.clone();let{DefaultMinBounds:e,DefaultMaxBounds:t}=cd,n=[new ia(h.negate(h.UNIT_Z,new h),e.z),new ia(h.UNIT_Z,-t.z)];this._renderBoundPlanes=new Y_({planes:n}),this._localToShapeUvTranslate=new h,this._shaderUniforms={cameraShapePosition:new h,cylinderEcToRadialTangentUp:new $,cylinderRenderRadiusMinMax:new U,cylinderRenderAngleMinMax:new U,cylinderLocalToShapeUvScale:new h,cylinderShapeUvAngleRangeOrigin:0},this._shaderDefines={CYLINDER_HAS_SHAPE_BOUNDS_ANGLE:void 0,CYLINDER_HAS_RENDER_BOUNDS_RADIUS_MIN:void 0,CYLINDER_HAS_RENDER_BOUNDS_RADIUS_FLAT:void 0,CYLINDER_HAS_RENDER_BOUNDS_ANGLE:void 0,CYLINDER_HAS_RENDER_BOUNDS_ANGLE_RANGE_EQUAL_ZERO:void 0,CYLINDER_HAS_RENDER_BOUNDS_ANGLE_RANGE_UNDER_HALF:void 0,CYLINDER_HAS_RENDER_BOUNDS_ANGLE_RANGE_OVER_HALF:void 0,CYLINDER_INTERSECTION_INDEX_RADIUS_MAX:void 0,CYLINDER_INTERSECTION_INDEX_RADIUS_MIN:void 0,CYLINDER_INTERSECTION_INDEX_ANGLE:void 0},this._shaderMaximumIntersectionsLength=0}Object.defineProperties(cd.prototype,{orientedBoundingBox:{get:function(){return this._orientedBoundingBox}},renderBoundPlanes:{get:function(){return this._renderBoundPlanes}},boundingSphere:{get:function(){return this._boundingSphere}},boundTransform:{get:function(){return this._boundTransform}},shapeTransform:{get:function(){return this._shapeTransform}},shaderUniforms:{get:function(){return this._shaderUniforms}},shaderDefines:{get:function(){return this._shaderDefines}},shaderMaximumIntersectionsLength:{get:function(){return this._shaderMaximumIntersectionsLength}}});var ERt=new h,CRt=new h,vRt=new h,SRt=new h,wRt=new h,IRt=new N,PRt=new h,K1e=new U;cd.prototype.update=function(e,t,n,i,r){i=i??t.clone(CRt),r=r??n.clone(vRt),t=h.clone(t,this._minBounds),n=h.clone(n,this._maxBounds);let{DefaultMinBounds:o,DefaultMaxBounds:s}=cd,a=s.y-o.y,c=.5*a,u=D.EPSILON10,f=D.EPSILON10;t.x=Math.max(0,t.x),n.x=Math.max(0,n.x),t.y=D.negativePiToPi(t.y),n.y=D.negativePiToPi(n.y),i.y=D.negativePiToPi(i.y),r.y=D.negativePiToPi(r.y);let d=h.maximumByComponent(t,i,SRt),p=h.minimumByComponent(n,r,wRt),g=N.getScale(e,ERt);if(p.x===0||d.x>p.x||d.z>p.z||D.equalsEpsilon(g.x,0,void 0,u)||D.equalsEpsilon(g.y,0,void 0,u)||D.equalsEpsilon(g.z,0,void 0,u))return!1;let m=this._renderBoundPlanes;m.get(0).distance=d.z,m.get(1).distance=-p.z,this._shapeTransform=N.clone(e,this._shapeTransform),this._orientedBoundingBox=aie(d,p,this._shapeTransform,this._orientedBoundingBox),this._boundTransform=N.fromRotationTranslation(this._orientedBoundingBox.halfAxes,this._orientedBoundingBox.center,this._boundTransform),this._boundingSphere=ue.fromOrientedBoundingBox(this._orientedBoundingBox,this._boundingSphere);let y=n.y<t.y,A=n.y-t.y+y*a,b=p.y<d.y,x=p.y-d.y+b*a,T=x>=c-f&&x<a-f,E=x>f&&x<c-f,v=x<=f,S=T||E||v,I=this._shaderUniforms,R=this._shaderDefines;for(let q in R)R.hasOwnProperty(q)&&(R[q]=void 0);let O=0;R.CYLINDER_INTERSECTION_INDEX_RADIUS_MAX=O,O+=1,A<a-f&&(R.CYLINDER_HAS_SHAPE_BOUNDS_ANGLE=!0),d.x!==o.x&&(R.CYLINDER_HAS_RENDER_BOUNDS_RADIUS_MIN=!0,R.CYLINDER_INTERSECTION_INDEX_RADIUS_MIN=O,O+=1),I.cylinderRenderRadiusMinMax=U.fromElements(d.x,p.x,I.cylinderRenderRadiusMinMax),d.x===p.x&&(R.CYLINDER_HAS_RENDER_BOUNDS_RADIUS_FLAT=!0);let L=n.x-t.x,_=0,C=1;L!==0&&(_=1/L,C=-t.x*_);let w=n.z-t.z,P=0,M=1;w!==0&&(P=1/w,M=-t.z*P),S&&(R.CYLINDER_HAS_RENDER_BOUNDS_ANGLE=!0,R.CYLINDER_INTERSECTION_INDEX_ANGLE=O,T?(R.CYLINDER_HAS_RENDER_BOUNDS_ANGLE_RANGE_UNDER_HALF=!0,O+=1):E?(R.CYLINDER_HAS_RENDER_BOUNDS_ANGLE_RANGE_OVER_HALF=!0,O+=2):v&&(R.CYLINDER_HAS_RENDER_BOUNDS_ANGLE_RANGE_EQUAL_ZERO=!0,O+=2),I.cylinderRenderAngleMinMax=U.fromElements(d.y,p.y,I.cylinderRenderAngleMinMax));let F=(t.y-o.y)/a,V=(n.y-o.y)/a,B=1-A/a,j=(V+.5*B)%1;I.cylinderShapeUvAngleRangeOrigin=j;let k=0,G=1;if(A>f){k=a/A;let q=F-j;G=-k*(q-Math.floor(q))}return I.cylinderLocalToShapeUvScale=h.fromElements(_,k,P,I.cylinderLocalToShapeUvScale),this._localToShapeUvTranslate=h.fromElements(C,G,M,this._localToShapeUvTranslate),this._shaderMaximumIntersectionsLength=O,!0};var DRt=new $,RRt=new $,ORt=new N;cd.prototype.updateViewTransforms=function(e){let t=this._shaderUniforms,n=N.inverse(this._shapeTransform,IRt),i=N.multiplyByPoint(n,e.camera.positionWC,PRt);t.cameraShapePosition=h.fromElements(U.magnitude(i),Math.atan2(i.y,i.x),i.z,t.cameraShapePosition);let r=U.normalize(U.fromCartesian3(i,K1e),K1e),o=$.fromRowMajorArray([r.x,r.y,0,-r.y,r.x,0,0,0,1],DRt),s=e.context.uniformState.inverseView,a=N.multiplyTransformation(n,s,ORt),c=N.getMatrix3(a,RRt);t.cylinderEcToRadialTangentUp=$.multiply(o,c,t.cylinderEcToRadialTangentUp)};cd.prototype.convertLocalToShapeUvSpace=function(e,t){let n=Math.hypot(e.x,e.y),i=Math.atan2(e.y,e.x),r=e.z,{cylinderLocalToShapeUvScale:o,cylinderShapeUvAngleRangeOrigin:s}=this._shaderUniforms,a=this._localToShapeUvTranslate;return n=n*o.x+a.x,i=(i+Math.PI)/(2*Math.PI),i-=s,i=i-Math.floor(i),i=i*o.y+a.y,r=r*o.z+a.z,h.fromElements(n,i,r,t)};var n9=new h,sie=new h;cd.prototype.computeOrientedBoundingBoxForTile=function(e,t,n,i,r){let o=this._minBounds,s=this._maxBounds,a=1/Math.pow(2,e),c=h.fromElements(D.lerp(o.x,s.x,t*a),D.lerp(o.y,s.y,n*a),D.lerp(o.z,s.z,i*a),n9),u=h.fromElements(D.lerp(o.x,s.x,(t+1)*a),D.lerp(o.y,s.y,(n+1)*a),D.lerp(o.z,s.z,(i+1)*a),sie);return aie(c,u,this._shapeTransform,r)};var $1e=new h;cd.prototype.computeOrientedBoundingBoxForSample=function(e,t,n,i){let r=1/Math.pow(2,e.level),o=h.divideComponents(h.ONE,t,$1e),s=h.multiplyByScalar(o,r,$1e),a=h.multiplyByScalar(h.fromElements(e.x+n.x,e.y+n.y,e.z+n.z,n9),r,n9),c=h.add(a,s,sie),u=this._minBounds,f=this._maxBounds,d=h.fromElements(D.lerp(u.x,f.x,a.x),D.lerp(u.y,f.y,a.y),D.lerp(u.z,f.z,a.z),n9),p=h.fromElements(D.lerp(u.x,f.x,c.x),D.lerp(u.y,f.y,c.y),D.lerp(u.z,f.z,c.z),sie);return aie(d,p,this._shapeTransform,i)};cd.DefaultMinBounds=Object.freeze(new h(0,-D.PI,-1));cd.DefaultMaxBounds=Object.freeze(new h(1,+D.PI,1));var MRt=5,NRt=new Array(MRt),LRt=new h,FRt=new $,BRt=new N,kRt=new N,URt=new N,oie=new N,zRt=new h,VRt=new h,jRt=new h,Z1e=new Array(8);for(let e=0;e<8;e++)Z1e[e]=new h;function J1e(e,t,n){return Math.abs(se.dot(e,t))<n}function HRt(e){let t=N.getColumn(e,0,zRt),n=N.getColumn(e,1,VRt),i=N.getColumn(e,2,jRt),r=D.EPSILON4;return J1e(t,n,r)&&J1e(n,i,r)}function GRt(e,t){let n=Z1e;h.fromElements(-.5,-.5,-.5,n[0]),h.fromElements(-.5,-.5,.5,n[1]),h.fromElements(-.5,.5,-.5,n[2]),h.fromElements(-.5,.5,.5,n[3]),h.fromElements(.5,-.5,-.5,n[4]),h.fromElements(.5,-.5,.5,n[5]),h.fromElements(.5,.5,-.5,n[6]),h.fromElements(.5,.5,.5,n[7]);for(let i=0;i<8;++i)N.multiplyByPoint(e,n[i],n[i]);return en.fromPoints(n,t)}var WRt=new h;function aie(e,t,n,i){let r=e.x,o=t.x,s=e.y,a=t.y<s?t.y+D.TWO_PI:t.y,c=e.z,u=t.z,f=a-s,d=s+f*.5,p=NRt,g=0;p[g++]=s,p[g++]=a,p[g++]=d,f>D.PI&&(p[g++]=d-D.PI_OVER_TWO,p[g++]=d+D.PI_OVER_TWO);let m=Number.POSITIVE_INFINITY,y=Number.POSITIVE_INFINITY,A=Number.NEGATIVE_INFINITY,b=Number.NEGATIVE_INFINITY;for(let F=0;F<g;++F){let V=p[F]-d,B=Math.cos(V),j=Math.sin(V),k=B*r,G=j*r,q=B*o,Q=j*o;m=Math.min(m,k,q),y=Math.min(y,G,Q),A=Math.max(A,k,q),b=Math.max(b,G,Q)}let x=A-m,T=b-y,E=u-c,v=(m+A)*.5,S=(y+b)*.5,I=(c+u)*.5,R=h.fromElements(v,S,I,LRt),O=$.fromRotationZ(d,FRt),L=h.fromElements(x,T,E,WRt),_=N.fromScale(L,URt),C=N.fromRotation(O,kRt),w=N.fromTranslation(R,BRt),P=N.multiplyTransformation(C,N.multiplyTransformation(w,_,oie),oie),M=N.multiplyTransformation(n,P,oie);return HRt(M)?en.fromTransformation(M,i):GRt(M,i)}var $E=cd;function Eh(){this._orientedBoundingBox=new en,this._boundingSphere=new ue,this._boundTransform=new N,this._shapeTransform=new N,this._rectangle=new ie,this._minimumHeight=Eh.DefaultMinBounds.z,this._maximumHeight=Eh.DefaultMaxBounds.z,this._ellipsoid=new ee,this._translation=new h,this._rotation=new $,this._localToShapeUvTranslate=new h,this._shaderUniforms={cameraPositionCartographic:new h,ellipsoidEcToEastNorthUp:new $,ellipsoidRadii:new h,eccentricitySquared:0,evoluteScale:new U,ellipsoidCurvatureAtLatitude:new U,ellipsoidInverseRadiiSquared:new h,ellipsoidRenderLongitudeMinMax:new U,ellipsoidShapeUvLongitudeRangeOrigin:0,ellipsoidShapeUvLongitudeMinMaxMid:new h,ellipsoidLocalToShapeUvScale:new h,ellipsoidRenderLatitudeSinMinMax:new U,clipMinMaxHeight:new U},this._shaderDefines={ELLIPSOID_HAS_RENDER_BOUNDS_LONGITUDE:void 0,ELLIPSOID_HAS_RENDER_BOUNDS_LONGITUDE_RANGE_EQUAL_ZERO:void 0,ELLIPSOID_HAS_RENDER_BOUNDS_LONGITUDE_RANGE_UNDER_HALF:void 0,ELLIPSOID_HAS_RENDER_BOUNDS_LONGITUDE_RANGE_OVER_HALF:void 0,ELLIPSOID_HAS_SHAPE_BOUNDS_LONGITUDE:void 0,ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MAX_UNDER_HALF:void 0,ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MAX_EQUAL_HALF:void 0,ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MAX_OVER_HALF:void 0,ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MIN_UNDER_HALF:void 0,ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MIN_EQUAL_HALF:void 0,ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MIN_OVER_HALF:void 0,ELLIPSOID_HAS_SHAPE_BOUNDS_LATITUDE:void 0,ELLIPSOID_INTERSECTION_INDEX_LONGITUDE:void 0,ELLIPSOID_INTERSECTION_INDEX_LATITUDE_MAX:void 0,ELLIPSOID_INTERSECTION_INDEX_LATITUDE_MIN:void 0,ELLIPSOID_INTERSECTION_INDEX_HEIGHT_MAX:void 0,ELLIPSOID_INTERSECTION_INDEX_HEIGHT_MIN:void 0},this._shaderMaximumIntersectionsLength=0}Object.defineProperties(Eh.prototype,{orientedBoundingBox:{get:function(){return this._orientedBoundingBox}},boundingSphere:{get:function(){return this._boundingSphere}},boundTransform:{get:function(){return this._boundTransform}},shapeTransform:{get:function(){return this._shapeTransform}},shaderUniforms:{get:function(){return this._shaderUniforms}},shaderDefines:{get:function(){return this._shaderDefines}},shaderMaximumIntersectionsLength:{get:function(){return this._shaderMaximumIntersectionsLength}}});var qRt=new h,YRt=new h,XRt=new h,KRt=new h,$Rt=new h,JRt=new h,ZRt=new h,QRt=new h,Q1e=new h,eRe=new h,eOt=new ie;Eh.prototype.update=function(e,t,n,i,r){let{DefaultMinBounds:o,DefaultMaxBounds:s}=Eh;i=i??o,r=r??s;let a=D.EPSILON10,c=D.EPSILON10,u=D.EPSILON10,f=D.EPSILON3,d=N.getScale(e,QRt),p=h.clone(o,qRt);p.z=-h.minimumComponent(d);let g=h.clamp(t,p,s,YRt),m=h.clamp(n,p,s,XRt),y=h.clamp(i,p,s,KRt),A=h.clamp(r,p,s,$Rt),b=h.maximumByComponent(g,y,JRt),x=h.minimumByComponent(m,A,ZRt),T=h.add(d,h.fromElements(m.z,m.z,m.z,Q1e),Q1e),E=h.add(d,h.fromElements(x.z,x.z,x.z,eRe),eRe);if(b.y>x.y||b.y===s.y||x.y===o.y||b.z>x.z||D.equalsEpsilon(E,h.ZERO,void 0,a))return!1;this._rectangle=ie.fromRadians(g.x,g.y,m.x,m.y),this._translation=N.getTranslation(e,this._translation),this._rotation=N.getRotation(e,this._rotation),this._ellipsoid=ee.fromCartesian3(d,this._ellipsoid),this._minimumHeight=g.z,this._maximumHeight=m.z;let v=ie.fromRadians(b.x,b.y,x.x,x.y,eOt);this._orientedBoundingBox=cie(v,b.z,x.z,this._ellipsoid,this._translation,this._rotation,this._orientedBoundingBox),this._shapeTransform=N.fromRotationTranslation(this._rotation,this._translation,this._shapeTransform),this._boundTransform=N.fromRotationTranslation(this._orientedBoundingBox.halfAxes,this._orientedBoundingBox.center,this._boundTransform),this._boundingSphere=ue.fromOrientedBoundingBox(this._orientedBoundingBox,this._boundingSphere);let S=s.x-o.x,I=.5*S,R=x.x<b.x,O=x.x-b.x+R*S,L=O<=c,_=O>=I-c&&O<S-c,C=O>c&&O<I-c,w=L||_||C,P=m.x<g.x,M=m.x-g.x+P*S,F=M>I+c&&M<S-c,V=M>=I-c&&M<=I+c,B=M<I-c,j=F||V||B,k=x.y<-f,G=x.y>=-f&&x.y<=+f,q=x.y>+f&&x.y<s.y-u,Q=k||G||q,W=b.y>o.y+u&&b.y<-f,J=b.y>=-f&&b.y<=+f,Z=b.y>+f,ae=W||J||Z,Ae=Q||ae,fe=m.y-g.y,xe=m.y<-f,ge=m.y>=-f&&m.y<=+f,we=m.y>+f&&m.y<s.y-u,Se=xe||ge||we,Re=g.y>o.y+u&&g.y<-f,Qe=g.y>=-f&&g.y<=+f,He=g.y>+f,$e=Se||(Re||Qe||He),Pe=this._shaderUniforms,qe=this._shaderDefines;for(let Xn in qe)qe.hasOwnProperty(Xn)&&(qe[Xn]=void 0);Pe.ellipsoidRadii=h.clone(T,Pe.ellipsoidRadii);let{x:st,z:vt}=Pe.ellipsoidRadii,Gt=vt/st;Pe.eccentricitySquared=1-Gt*Gt,Pe.evoluteScale=U.fromElements((st*st-vt*vt)/st,(vt*vt-st*st)/vt,Pe.evoluteScale),Pe.ellipsoidInverseRadiiSquared=h.divideComponents(h.ONE,h.multiplyComponents(Pe.ellipsoidRadii,Pe.ellipsoidRadii,Pe.ellipsoidInverseRadiiSquared),Pe.ellipsoidInverseRadiiSquared);let lt=0;qe.ELLIPSOID_INTERSECTION_INDEX_HEIGHT_MAX=lt,lt+=1,qe.ELLIPSOID_INTERSECTION_INDEX_HEIGHT_MIN=lt,lt+=1,Pe.clipMinMaxHeight=U.fromElements(b.z-m.z,x.z-m.z,Pe.clipMinMaxHeight);let mt=m.z-g.z,ft=mt===0?0:1/mt;w&&(qe.ELLIPSOID_HAS_RENDER_BOUNDS_LONGITUDE=!0,qe.ELLIPSOID_INTERSECTION_INDEX_LONGITUDE=lt,_?(qe.ELLIPSOID_HAS_RENDER_BOUNDS_LONGITUDE_RANGE_UNDER_HALF=!0,lt+=1):C?(qe.ELLIPSOID_HAS_RENDER_BOUNDS_LONGITUDE_RANGE_OVER_HALF=!0,lt+=2):L&&(qe.ELLIPSOID_HAS_RENDER_BOUNDS_LONGITUDE_RANGE_EQUAL_ZERO=!0,lt+=2),Pe.ellipsoidRenderLongitudeMinMax=U.fromElements(b.x,x.x,Pe.ellipsoidRenderLongitudeMinMax));let Xt=0,rt=1;if(j){qe.ELLIPSOID_HAS_SHAPE_BOUNDS_LONGITUDE=!0;let Xn=(g.x-o.x)/S,bi=(m.x-o.x)/S,Wi=1-M/S,wi=(bi+.5*Wi)%1;if(Pe.ellipsoidShapeUvLongitudeRangeOrigin=wi,M>c){Xt=S/M;let hi=Xn-wi;rt=-Xt*(hi-Math.floor(hi))}}Ae&&(ae&&(qe.ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MIN=!0,qe.ELLIPSOID_INTERSECTION_INDEX_LATITUDE_MIN=lt,W?(qe.ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MIN_UNDER_HALF=!0,lt+=1):J?(qe.ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MIN_EQUAL_HALF=!0,lt+=1):Z&&(qe.ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MIN_OVER_HALF=!0,lt+=2)),Q&&(qe.ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MAX=!0,qe.ELLIPSOID_INTERSECTION_INDEX_LATITUDE_MAX=lt,k?(qe.ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MAX_UNDER_HALF=!0,lt+=2):G?(qe.ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MAX_EQUAL_HALF=!0,lt+=1):q&&(qe.ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MAX_OVER_HALF=!0,lt+=1)),Pe.ellipsoidRenderLatitudeSinMinMax=U.fromElements(Math.sin(b.y),Math.sin(x.y),Pe.ellipsoidRenderLatitudeSinMinMax));let ht=0,Bi=1;return $e&&(qe.ELLIPSOID_HAS_SHAPE_BOUNDS_LATITUDE=!0,fe>u&&(ht=(s.y-o.y)/fe,Bi=(o.y-g.y)/fe)),Pe.ellipsoidLocalToShapeUvScale=h.fromElements(Xt,ht,ft,Pe.ellipsoidLocalToShapeUvScale),this._localToShapeUvTranslate=h.fromElements(rt,Bi,0,this._localToShapeUvTranslate),this._shaderMaximumIntersectionsLength=lt,!0};var tOt=new he,nOt=new h,iOt=new N,tRe=new $;Eh.prototype.updateViewTransforms=function(e){let t=this._shaderUniforms,n=this._ellipsoid,i=e.camera.positionWC,r=n.cartesianToCartographic(i,tOt);h.fromElements(r.longitude,r.latitude,r.height,t.cameraPositionCartographic);let o=h.fromRadians(r.longitude,r.latitude,0,n,nOt);t.ellipsoidCurvatureAtLatitude=n.getLocalCurvature(o,t.ellipsoidCurvatureAtLatitude);let s=At.eastNorthUpToFixedFrame(o,n,iOt),a=N.getRotation(s,tRe),c=e.context.uniformState.viewRotation,u=$.multiply(c,a,tRe);t.ellipsoidEcToEastNorthUp=$.transpose(u,t.ellipsoidEcToEastNorthUp)};var cRe=new ie;Eh.prototype.computeOrientedBoundingBoxForTile=function(e,t,n,i,r){let o=1/Math.pow(2,e),s=t*o,a=(t+1)*o,c=n*o,u=(n+1)*o,f=i*o,d=(i+1)*o,p=ie.subsection(this._rectangle,s,c,a,u,cRe),g=D.lerp(this._minimumHeight,this._maximumHeight,f),m=D.lerp(this._minimumHeight,this._maximumHeight,d);return cie(p,g,m,this._ellipsoid,this._translation,this._rotation,r)};var rOt=new U,oOt=new U,Kz=new U,nRe=new U,iRe=new U,$z=new U;function sOt(e,t,n,i){let r=U.abs(e,rOt),o=U.fromElements(1/t.x,1/t.y,oOt),s=U.fromElements(Math.SQRT1_2,Math.SQRT1_2,Kz),a=U.multiplyComponents(t,s,nRe),c=U.fromElements(n.x*s.x*s.x*s.x,n.y*s.y*s.y*s.y,iRe);for(let u=0;u<3;++u){let f=U.magnitude(U.subtract(a,c,$z)),d=U.normalize(U.subtract(r,c,$z),$z),p=U.multiplyByScalar(d,f,$z);s=U.multiplyComponents(U.add(p,c,Kz),o,Kz),s=U.normalize(U.clamp(s,U.ZERO,U.ONE,Kz),Kz),a=U.multiplyComponents(t,s,nRe),c=U.fromElements(n.x*s.x*s.x*s.x,n.y*s.y*s.y*s.y,iRe)}return h.fromElements(Math.sign(e.x)*a.x,Math.sign(e.y)*a.y,U.magnitude(U.subtract(a,c,$z)),i)}var aOt=new U,rRe=new U,cOt=new h,oRe=new U;Eh.prototype.convertLocalToShapeUvSpace=function(e,t){let n=Math.atan2(e.y,e.x),{ellipsoidRadii:i,evoluteScale:r,ellipsoidInverseRadiiSquared:o,ellipsoidShapeUvLongitudeRangeOrigin:s,ellipsoidLocalToShapeUvScale:a}=this._shaderUniforms,c=this._localToShapeUvTranslate,u=Math.hypot(e.x,e.y),f=U.fromElements(u,e.z,rRe),d=sOt(f,U.fromElements(i.x,i.z,aOt),r,cOt),p=U.normalize(U.fromElements(d.x*o.x,d.y*o.z,oRe),oRe),g=Math.atan2(p.y,p.x),m=U.magnitude(f)<U.magnitude(d)?-1:1,y=U.subtract(f,d,rRe),A=m*U.magnitude(y),{ELLIPSOID_HAS_SHAPE_BOUNDS_LONGITUDE:b,ELLIPSOID_HAS_SHAPE_BOUNDS_LATITUDE:x}=this._shaderDefines;return n=(n+Math.PI)/(2*Math.PI),l(b)&&(n-=s,n=n-Math.floor(n),n=n*a.x+c.x),g=(g+Math.PI/2)/Math.PI,l(x)&&(g=g*a.y+c.y),A=1+A*a.z,h.fromElements(n,g,A,t)};var sRe=new h,aRe=new h,lOt=new h;Eh.prototype.computeOrientedBoundingBoxForSample=function(e,t,n,i){let r=1/Math.pow(2,e.level),o=h.divideComponents(h.ONE,t,sRe),s=h.multiplyByScalar(o,r,sRe),a=h.multiplyByScalar(h.fromElements(e.x+n.x,e.y+n.y,e.z+n.z,aRe),r,aRe),c=h.add(a,s,lOt),u=ie.subsection(this._rectangle,a.x,a.y,c.x,c.y,cRe),f=D.lerp(this._minimumHeight,this._maximumHeight,a.z),d=D.lerp(this._minimumHeight,this._maximumHeight,c.z);return cie(u,f,d,this._ellipsoid,this._translation,this._rotation,i)};function cie(e,t,n,i,r,o,s){return s=en.fromRectangle(e,t,n,i,s),s.center=h.add(s.center,r,s.center),s.halfAxes=$.multiply(s.halfAxes,o,s.halfAxes),s}Eh.DefaultMinBounds=Object.freeze(new h(-D.PI,-D.PI_OVER_TWO,-ee.WGS84.minimumRadius));Eh.DefaultMaxBounds=Object.freeze(new h(D.PI,D.PI_OVER_TWO,10*ee.WGS84.maximumRadius));var JE=Eh;var cf={BOX:"BOX",ELLIPSOID:"ELLIPSOID",CYLINDER:"CYLINDER"};cf.getMinBounds=function(e){switch(e){case cf.BOX:return KE.DefaultMinBounds;case cf.ELLIPSOID:return JE.DefaultMinBounds;case cf.CYLINDER:return $E.DefaultMinBounds}};cf.getMaxBounds=function(e){switch(e){case cf.BOX:return KE.DefaultMaxBounds;case cf.ELLIPSOID:return JE.DefaultMaxBounds;case cf.CYLINDER:return $E.DefaultMaxBounds}};cf.getShapeConstructor=function(e){switch(e){case cf.BOX:return KE;case cf.ELLIPSOID:return JE;case cf.CYLINDER:return $E}};Object.freeze(cf);var Tc=cf;function Jm(e){this._comparator=e.comparator,this._maximumLength=e.maximumLength,this._array=l(e.maximumLength)?new Array(e.maximumLength):[],this._length=0}Object.defineProperties(Jm.prototype,{length:{get:function(){return this._length}},maximumLength:{get:function(){return this._maximumLength},set:function(e){if(l(e)){for(;this._length>e;)this.removeMinimum();this._array.length=e}this._maximumLength=e}},internalArray:{get:function(){return this._array}},comparator:{get:function(){return this._comparator}}});Jm.prototype.clone=function(){let e=this._maximumLength,t=this._comparator,n=this._array,i=this._length,r=new Jm({comparator:t,maximumLength:e});r._length=i;for(let o=0;o<i;o++)r._array[o]=n[o];return r};Jm.prototype.reset=function(){this._length=0;let e=this._maximumLength;if(l(e))for(let t=0;t<e;t++)this._array[t]=void 0;else this._array.length=0};Jm.prototype.resort=function(){let e=this._length;for(let t=0;t<e;t++)lRe(this,t)};Jm.prototype.insert=function(e){let t,n=this._maximumLength;if(l(n)){if(n===0)return;if(this._length===n){let r=this._array[0];if(this._comparator(e,r)<=0)return e;t=this.removeMinimum()}}let i=this._length;return this._array[i]=e,this._length++,lRe(this,i),t};Jm.prototype.removeMinimum=function(){let e=this._length;if(e===0)return;this._length--;let t=this._array[0];return e>=2&&(this._array[0]=this._array[e-1],uRe(this,0)),this._array[e-1]=void 0,t};Jm.prototype.removeMaximum=function(){let e=this._length;if(e===0)return;this._length--;let t;if(e<=2)t=this._array[e-1];else{let n=lie(this,1,2)?1:2;t=this._array[n],this._array[n]=this._array[e-1],e>=4&&uRe(this,n)}return this._array[e-1]=void 0,t};Jm.prototype.getMinimum=function(){if(this._length!==0)return this._array[0]};Jm.prototype.getMaximum=function(){let e=this._length;if(e!==0)return e<=2?this._array[e-1]:this._array[lie(this,1,2)?1:2]};function i9(e,t,n){let i=e._array,r=i[t];i[t]=i[n],i[n]=r}function Jz(e,t,n){return e._comparator(e._array[t],e._array[n])<0}function lie(e,t,n){return e._comparator(e._array[t],e._array[n])>0}function lRe(e,t){if(t===0)return;let n=Math.floor(D.log2(t+1))%2===0,i=Math.floor((t-1)/2),r=Jz(e,t,i);for(r!==n&&(i9(e,t,i),t=i);t>=3;){let o=Math.floor((t-3)/4);if(Jz(e,t,o)!==r)break;i9(e,t,o),t=o}}function uRe(e,t){let n=e._length,i=Math.floor(D.log2(t+1))%2===0,r;for(;(r=2*t+1)<n;){let o=r,s=r+1;if(s<n){Jz(e,s,o)===i&&(o=s);let a=2*r+1,c=Math.max(Math.min(n-a,4),0);for(let u=0;u<c;u++){let f=a+u;Jz(e,f,o)===i&&(o=f)}}if(Jz(e,o,t)===i&&(i9(e,o,t),o!==r&&o!==s)){let a=Math.floor((o-1)/2);lie(e,o,a)===i&&i9(e,o,a)}t=o}}var K_=Jm;var uie=Object.freeze({UNLOADED:0,RECEIVING:1,PROCESSING:2,LOADED:3,FAILED:4,UNAVAILABLE:5});function Zz(e,t){this.spatialNode=e,this.keyframe=t,this.state=uie.UNLOADED,this.content=void 0,this.megatextureIndex=-1,this.priority=-Number.MAX_VALUE,this.highPriorityFrameNumber=-1}Zz.prototype.unload=function(){this.content=this.content&&this.content.destroy(),this.spatialNode=void 0,this.state=uie.UNLOADED,this.megatextureIndex=-1,this.priority=-Number.MAX_VALUE,this.highPriorityFrameNumber=-1};Zz.priorityComparator=function(e,t){return e.priority-t.priority};Zz.searchComparator=function(e,t){return e.keyframe-t.keyframe};Zz.LoadState=uie;var jr=Zz;function O0(e,t,n,i,r=134217728,o){let s=uOt(i),a=fOt(n),c=n*Lt.getSizeInBytes(i),u=O0.get3DTextureDimension(t,c,r,o),f=h.divideComponents(u,t,new h);this.channelCount=n,this.componentType=i,this.textureMemoryByteLength=c*u.x*u.y*u.z,this.tileCounts=h.clone(f,new h),this.voxelCountPerTile=h.clone(t,new h),this.maximumTileCount=f.x*f.y*f.z,this.texture=new LO({context:e,pixelFormat:a,pixelDatatype:s,flipY:!1,width:u.x,height:u.y,depth:u.z,sampler:new jt({wrapR:hn.CLAMP_TO_EDGE,wrapS:hn.CLAMP_TO_EDGE,wrapT:hn.CLAMP_TO_EDGE,minificationFilter:Wt.LINEAR,magnificationFilter:Jn.LINEAR})}),this.nodes=new Array(this.maximumTileCount);for(let d=0;d<this.maximumTileCount;d++)this.nodes[d]=new dOt(d);for(let d=0;d<this.maximumTileCount;d++){let p=this.nodes[d];p.previousNode=d>0?this.nodes[d-1]:void 0,p.nextNode=d<this.maximumTileCount-1?this.nodes[d+1]:void 0}this.occupiedList=void 0,this.emptyList=this.nodes[0],this.occupiedCount=0,this._nearestSampling=!1}Object.defineProperties(O0.prototype,{nearestSampling:{get:function(){return this._nearestSampling},set:function(e){this._nearestSampling!==e&&(e?this.texture.sampler=jt.NEAREST:this.texture.sampler=new jt({wrapR:hn.CLAMP_TO_EDGE,wrapS:hn.CLAMP_TO_EDGE,wrapT:hn.CLAMP_TO_EDGE,minificationFilter:Wt.LINEAR,magnificationFilter:Jn.LINEAR}),this._nearestSampling=e)}}});function uOt(e){if(e===Lt.FLOAT32||e===Lt.FLOAT64)return ze.FLOAT;if(e===Lt.UINT8)return ze.UNSIGNED_BYTE}function fOt(e){switch(e){case 1:return Ke.RED;case 2:return Ke.RG;case 3:return Ke.RGB;case 4:return Ke.RGBA}}function dOt(e){this.index=e,this.nextNode=void 0,this.previousNode=void 0}O0.prototype.add=function(e){if(this.isFull())throw new pe("Trying to add when there are no empty spots");let t=this.emptyList;this.emptyList=this.emptyList.nextNode,l(this.emptyList)&&(this.emptyList.previousNode=void 0),t.nextNode=this.occupiedList,l(t.nextNode)&&(t.nextNode.previousNode=t),this.occupiedList=t;let n=t.index;return this.writeDataToTexture(n,e),this.occupiedCount++,n};O0.prototype.remove=function(e){if(e<0||e>=this.maximumTileCount)throw new pe("Megatexture index out of bounds");let t=this.nodes[e];l(t.previousNode)&&(t.previousNode.nextNode=t.nextNode),l(t.nextNode)&&(t.nextNode.previousNode=t.previousNode),t.nextNode=this.emptyList,l(t.nextNode)&&(t.nextNode.previousNode=t),t.previousNode=void 0,this.emptyList=t,this.occupiedCount--};O0.prototype.isFull=function(){return this.emptyList===void 0};O0.get3DTextureDimension=function(e,t,n,i){let{maximum3DTextureSize:r}=kt;if(h.maximumComponent(e)>r)throw new oe("The GL context does not support a 3D texture large enough to contain a tile with the given dimensions.");let o=t*e.x*e.y*e.z,s=Math.floor(n/o);if(s<1)throw new oe("Not enough texture memory available to create a megatexture with the given tile dimensions.");l(i)?i=Math.min(i,s):i=s;let a=Object.entries(e).sort((f,d)=>d[1]-f[1]),c=a.map(([f,d])=>Math.floor(r/d));for(let f=0;f<3;f++){let d=fRe(c);if(d<i)break;let p=c.slice();p.splice(f,1);let g=p[0]*p[1],m=d-i,y=Math.floor(m/g);c[f]-=y}fRe(c)>s&&(c[2]=Math.floor(s/(c[0]*c[1])));let u=new h;for(let f=0;f<3;f++){let[d,p]=a[f];u[d]=c[f]*p}return u};function fRe(e){return e.reduce((t,n)=>t*n)}O0.prototype.writeDataToTexture=function(e,t){let{tileCounts:n,voxelCountPerTile:i}=this,r={arrayBufferView:t,width:i.x,height:i.y,depth:i.z},o=n.x*n.y,s=Math.floor(e/o),a=e-s*o,c=Math.floor(a/n.x),u=a-c*n.x,f={source:r,xOffset:u*i.x,yOffset:c*i.y,zOffset:s*i.z};this.texture.copyFrom(f)};O0.prototype.isDestroyed=function(){return!1};O0.prototype.destroy=function(){return this.texture=this.texture&&this.texture.destroy(),le(this)};var Qz=O0;function Ch(e,t,n,i,r,o,s){this.children=void 0,this.parent=r,this.level=e,this.x=t,this.y=n,this.z=i,this.dimensions=h.clone(s),this.keyframeNodes=[],this.renderableKeyframeNodes=[],this.renderableKeyframeNodeLerp=0,this.renderableKeyframeNodePrevious=void 0,this.renderableKeyframeNodeNext=void 0,this.orientedBoundingBox=new en,this.approximateVoxelSize=0,this.screenSpaceError=0,this.visitedFrameNumber=-1,this.computeBoundingVolumes(o)}var hOt=new h;Ch.prototype.computeBoundingVolumes=function(e){this.orientedBoundingBox=e.computeOrientedBoundingBoxForTile(this.level,this.x,this.y,this.z,this.orientedBoundingBox);let t=$.getScale(this.orientedBoundingBox.halfAxes,hOt),n=2*h.maximumComponent(t);this.approximateVoxelSize=n/h.minimumComponent(this.dimensions)};Ch.prototype.constructChildNodes=function(e){let{level:t,x:n,y:i,z:r}=this,o=n*2,s=i*2,a=r*2,c=s+1,u=o+1,f=a+1,d=t+1,p=[[d,o,s,a],[d,u,s,a],[d,o,c,a],[d,u,c,a],[d,o,s,f],[d,u,s,f],[d,o,c,f],[d,u,c,f]];this.children=p.map(([g,m,y,A])=>new Ch(g,m,y,A,this,e,this.dimensions))};Ch.prototype.visibility=function(e,t){let n=this.orientedBoundingBox;return e.cullingVolume.computeVisibilityWithPlaneMask(n,t)};Ch.prototype.computeScreenSpaceError=function(e,t){let n=this.orientedBoundingBox,i=Math.sqrt(n.distanceSquaredTo(e));i=Math.max(i,D.EPSILON7);let r=this.approximateVoxelSize,o=t*(r/i);this.screenSpaceError=o};var dRe={keyframe:0};function eV(e,t){return dRe.keyframe=e,vr(t,dRe,jr.searchComparator)}Ch.prototype.computeSurroundingRenderableKeyframeNodes=function(e){let t=this,n=t.level,i=Math.floor(e),r=Math.ceil(e),o,s,a=+Number.MAX_VALUE,c=+Number.MAX_VALUE;for(;l(t);){let{renderableKeyframeNodes:d}=t;if(d.length>=1){let p=mOt(i,d),g=d[p],m=r===i||i<g.keyframe?p:Math.min(p+1,d.length-1),y=d[m],A=i-g.keyframe,b=hRe(n-t.level,A);b<a&&(a=b,o=g);let x=y.keyframe-r,T=hRe(n-t.level,x);if(T<c&&(c=T,s=y),A===0&&x===0)break}t=t.parent}if(this.renderableKeyframeNodePrevious=o,this.renderableKeyframeNodeNext=s,!l(o)||!l(s))return;let u=o.keyframe,f=s.keyframe;this.renderableKeyframeNodeLerp=u===f?0:D.clamp((e-u)/(f-u),0,1)};function mOt(e,t){let n=eV(e,t);return n<0?D.clamp(~n-1,0,t.length-1):n}function hRe(e,t){let n=Math.exp(e*4),i=t>=0?1:-200;return e*n+t*i}Ch.prototype.isVisited=function(e){return this.visitedFrameNumber===e};Ch.prototype.createKeyframeNode=function(e){let t=eV(e,this.keyframeNodes);if(t<0){t=~t;let n=new jr(this,e);this.keyframeNodes.splice(t,0,n)}};Ch.prototype.destroyKeyframeNode=function(e,t){let n=e.keyframe,i=eV(n,this.keyframeNodes);if(i<0)throw new pe("Keyframe node does not exist.");if(this.keyframeNodes.splice(i,1),e.megatextureIndex!==-1){for(let o=0;o<t.length;o++)t[o].remove(e.megatextureIndex);let r=eV(n,this.renderableKeyframeNodes);if(r<0)throw new pe("Renderable keyframe node does not exist.");this.renderableKeyframeNodes.splice(r,1)}e.unload()};Ch.prototype.addKeyframeNodeToMegatextures=function(e,t){if(e.megatextureIndex!==-1||e.content.metadata.length!==t.length)throw new pe("Keyframe node cannot be added to megatexture");let{metadata:n}=e.content;for(let o=0;o<t.length;o++){let s=t[o];e.megatextureIndex=s.add(n[o])}let i=this.renderableKeyframeNodes,r=eV(e.keyframe,i);if(r>=0)throw new pe("Keyframe already renderable");r=~r,i.splice(r,0,e)};Ch.prototype.isRenderable=function(e){let t=this.renderableKeyframeNodePrevious,n=this.renderableKeyframeNodeNext,i=this.level;return l(t)&&l(n)&&(t.spatialNode.level===i||n.spatialNode.level===i)&&this.visitedFrameNumber===e};var tV=Ch;function mb(e,t,n,i){let{provider:r,dimensions:o,inputDimensions:s}=e,{types:a,componentTypes:c}=r;l(i)?i=Math.min(Math.max(0,i),512*1024*1024):i=128*1024*1024,this._primitive=e,this.textureMemoryByteLength=0,this.megatextures=new Array(a.length);let u=l(r.maximumTileCount)?r.maximumTileCount:l(r.availableLevels)?(8**r.availableLevels-1)/7:void 0;for(let b=0;b<a.length;b++){let x=a[b],T=bt.getComponentCount(x),E=c[b];this.megatextures[b]=new Qz(t,s,T,E,i,u),this.textureMemoryByteLength+=this.megatextures[b].textureMemoryByteLength}let f=this.megatextures[0].maximumTileCount;this._simultaneousRequestCount=0,this._debugPrint=!1,this._calculateStatistics=this._primitive._calculateStatistics??!1,this._frameNumber=0;let d=e._shape;this.rootNode=new tV(0,0,0,0,void 0,d,o),this._priorityQueue=new K_({maximumLength:f,comparator:jr.priorityComparator}),this._highPriorityKeyframeNodes=new Array(f),this._highPriorityKeyframeNodeCount=0,this._keyframeNodesInMegatexture=new Array(f),this._keyframeCount=n,this._sampleCount=void 0,this._keyframeLocation=0,this._binaryTreeKeyframeWeighting=new Array(n),this._initialTilesLoaded=!1;let p=this._binaryTreeKeyframeWeighting;p[0]=0,p[n-1]=0,fie(p,1,n-2,0);let g=9,m=2048,y=Math.floor(m/g),A=Math.ceil(f/y);this.internalNodeTexture=new Dt({context:t,pixelFormat:Ke.RGBA,pixelDatatype:ze.UNSIGNED_BYTE,flipY:!1,width:m,height:A,sampler:new jt({minificationFilter:Wt.NEAREST,magnificationFilter:Jn.NEAREST})}),this.internalNodeTilesPerRow=y,this.internalNodeTexelSizeUv=new U(1/m,1/A),this.leafNodeTexture=void 0,this.leafNodeTilesPerRow=void 0,this.leafNodeTexelSizeUv=new U}mb.prototype.findKeyframeNode=function(e){return this._keyframeNodesInMegatexture.find(function(t){return t.megatextureIndex===e})};function fie(e,t,n,i){if(t>n)return;let r=Math.floor((t+n)/2);e[r]=i,fie(e,t,r-1,i+1),fie(e,r+1,n,i+1)}mb.simultaneousRequestCountMaximum=50;mb.prototype.update=function(e,t,n,i){let r=this._primitive,o=e.context,s=this.megatextures[0].maximumTileCount,a=this._keyframeCount,c=r._levelBlendFactor,u=c>0,f=a>1,d=(u?2:1)*(f?2:1);this._sampleCount=d;let p=d>=2;if(p&&!l(this.leafNodeTexture)){let T=Math.floor(512),E=Math.ceil(s/T);this.leafNodeTexture=new Dt({context:o,pixelFormat:Ke.RGBA,pixelDatatype:ze.UNSIGNED_BYTE,flipY:!1,width:1024,height:E,sampler:new jt({minificationFilter:Wt.NEAREST,magnificationFilter:Jn.NEAREST})}),this.leafNodeTexelSizeUv=U.fromElements(1/1024,1/E,this.leafNodeTexelSizeUv),this.leafNodeTilesPerRow=T}else!p&&l(this.leafNodeTexture)&&(this.leafNodeTexture=this.leafNodeTexture.destroy());if(this._keyframeLocation=D.clamp(t,0,a-1),n&&mRe(this,this.rootNode),i)return;this._frameNumber=e.frameNumber;let g=xn();_Ot(this,e),yOt(this,e);let m=xn();EOt(this,d,c);let y=xn(),A=r.loadProgress.numberOfListeners>0||r.allTilesLoaded.numberOfListeners>0||r.initialTilesLoaded.numberOfListeners>0;if(this._debugPrint||this._calculateStatistics||A){let b=m-g,x=y-m,T=y-g;TOt(this,e,b,x,T)}};mb.prototype.isRenderable=function(e){return e.isRenderable(this._frameNumber)};mb.prototype.isDestroyed=function(){return!1};mb.prototype.destroy=function(){let e=this.megatextures,t=e.length;for(let n=0;n<t;n++)e[n]=e[n]&&e[n].destroy();return this.textureMemoryByteLength=0,this.internalNodeTexture=this.internalNodeTexture&&this.internalNodeTexture.destroy(),this.leafNodeTexture=this.leafNodeTexture&&this.leafNodeTexture.destroy(),le(this)};function mRe(e,t){if(t.computeBoundingVolumes(e._primitive._shape),l(t.children))for(let n=0;n<8;n++){let i=t.children[n];mRe(e,i)}}function pOt(e,t){if(e._simultaneousRequestCount>=mb.simultaneousRequestCountMaximum)return;let i=e._primitive.provider,{keyframe:r,spatialNode:o}=t;if(l(i.availableLevels)&&o.level>=i.availableLevels)return;function s(f){e._simultaneousRequestCount--,t.content=f,t.state=l(f)?jr.LoadState.PROCESSING:jr.LoadState.UNAVAILABLE}function a(f){e._simultaneousRequestCount--,t.state=jr.LoadState.FAILED,e._primitive.tileFailed.raiseEvent()}let c={tileLevel:o.level,tileX:o.x,tileY:o.y,tileZ:o.z,keyframe:r},u=i.requestData(c);l(u)&&(e._simultaneousRequestCount++,t.state=jr.LoadState.RECEIVING,u.then(s).catch(a))}function gOt(e){return e/(1+e)}function _Ot(e,t){let n=e._frameNumber,i=e._priorityQueue;i.reset(),pRe(e.rootNode,ta.MASK_INDETERMINATE,e,t);let r=e._highPriorityKeyframeNodes,o=0,s;for(;i.length>0;)s=i.removeMaximum(),s.highPriorityFrameNumber=n,r[o]=s,o++;e._highPriorityKeyframeNodeCount=o}function yOt(e,t){let n=e.megatextures[0],i=n.occupiedCount,r=e._keyframeNodesInMegatexture;r.length=i,r.sort(AOt);let o=e._highPriorityKeyframeNodes,s=e._highPriorityKeyframeNodeCount,a=0,c=0;for(let u=0;u<s;u++){let f=o[u];if(!(f.state===jr.LoadState.LOADED||f.spatialNode===void 0)&&(f.state===jr.LoadState.UNLOADED&&pOt(e,f),f.state===jr.LoadState.PROCESSING)){let{content:d}=f;if(d.update(e._primitive,t),!d.ready)continue;if(!bOt(d.metadata,e)){f.content=void 0,f.state=jr.LoadState.FAILED,e._primitive.tileFailed.raiseEvent();continue}let p;if(n.isFull()){p=i-1-a,a++;let g=r[p];e._primitive.tileUnload.raiseEvent(),g.spatialNode.destroyKeyframeNode(g,e.megatextures)}else p=i+c,c++;f.spatialNode.addKeyframeNodeToMegatextures(f,e.megatextures),f.state=jr.LoadState.LOADED,r[p]=f,e._primitive.tileLoad.raiseEvent()}}}function AOt(e,t){return e.highPriorityFrameNumber===t.highPriorityFrameNumber?t.priority-e.priority:t.highPriorityFrameNumber-e.highPriorityFrameNumber}function bOt(e,t){let n=t._primitive.provider.types.length;if(!Array.isArray(e)||e.length!==n)return!1;let{megatextures:i}=t;for(let r=0;r<n;r++){let{voxelCountPerTile:o,channelCount:s}=i[r],{x:a,y:c,z:u}=o,f=a*c*u,d=e[r],p=f*s;if(d.length!==p)return!1}return!0}function pRe(e,t,n,i){let{camera:r,context:o,pixelRatio:s,frameNumber:a}=i,{positionWC:c,frustum:u}=r,d=o.drawingBufferHeight/s/u.sseDenominator;if(e.computeScreenSpaceError(c,d),t=e.visibility(i,t),t===ta.MASK_OUTSIDE)return;e.visitedFrameNumber=a;let p=n._primitive,g=p._shape,m=p.screenSpaceError,y=n._priorityQueue,A=n._keyframeCount,b=D.clamp(Math.floor(n._keyframeLocation),0,A-2),x=b+1;if(A===1)e.createKeyframeNode(0);else if(e.keyframeNodes.length!==A)for(let I=0;I<A;I++)e.createKeyframeNode(I);let{screenSpaceError:T,keyframeNodes:E}=e,v=gOt(T),S=!1;for(let I=0;I<E.length;I++){let R=E[I];R.priority=10*v+xOt(b,R.keyframe,x,n),R.state!==jr.LoadState.UNAVAILABLE&&R.state!==jr.LoadState.FAILED&&R.priority!==-Number.MAX_VALUE&&y.insert(R),R.state===jr.LoadState.LOADED&&(S=!0)}if(T<m||!S){e.children=void 0;return}l(e.children)||e.constructChildNodes(g);for(let I=0;I<8;I++){let R=e.children[I];pRe(R,t,n,i)}}function xOt(e,t,n,i){let r=Math.min(Math.abs(t-e),Math.abs(t-n)),o=Math.max(e,i._keyframeCount-n-1,1),s=Math.pow(1-r/o,4),a=Math.exp(-i._binaryTreeKeyframeWeighting[t]);return D.lerp(a,s,.15+.85*s)}function TOt(e,t,n,i,r){let o=e._keyframeCount,s=e.rootNode,a=Object.keys(jr.LoadState).length,c=new Array(a),u=new Array(a),f=0;for(let S=0;S<a;S++){let I=new Array(o).fill(0);c[S]=I,u[S]=0}function d(S){let I=S.keyframeNodes;for(let R=0;R<I.length;R++){let O=I[R],L=O.keyframe,_=O.state;c[_][L]+=1,u[_]+=1,f++}if(l(S.children))for(let R=0;R<8;R++){let O=S.children[R];d(O)}}d(s),e._primitive.statistics.numberOfTilesWithContentReady=u[jr.LoadState.LOADED],e._primitive.statistics.visited=f;let p=u[jr.LoadState.RECEIVING],g=u[jr.LoadState.PROCESSING],m=p!==e._primitive.statistics.numberOfPendingRequests||g!==e._primitive.statistics.numberOfTilesProcessing;if(m&&t.afterRender.push(function(){return e._primitive.loadProgress.raiseEvent(p,g),!0}),e._primitive.statistics.numberOfPendingRequests=p,e._primitive.statistics.numberOfTilesProcessing=g,m&&(p===0&&g===0)&&(t.afterRender.push(function(){return e._primitive.allTilesLoaded.raiseEvent(),!0}),e._initialTilesLoaded||(e._initialTilesLoaded=!0,t.afterRender.push(function(){return e._primitive.initialTilesLoaded.raiseEvent(),!0}))),!e._debugPrint)return;let A=`KEYFRAMES: ${c[jr.LoadState.LOADED]}`,b=`UNLOADED: ${u[jr.LoadState.UNLOADED]} | RECEIVING: ${u[jr.LoadState.RECEIVING]} | PROCESSING: ${u[jr.LoadState.PROCESSING]} | LOADED: ${u[jr.LoadState.LOADED]} | FAILED: ${u[jr.LoadState.FAILED]} | UNAVAILABLE: ${u[jr.LoadState.UNAVAILABLE]} | TOTAL: ${f}`,x=Math.round(n*100)/100,T=Math.round(i*100)/100,E=Math.round(r*100)/100,v=`LOAD: ${x} | OCT: ${T} | ALL: ${E}`;console.log(`${A} || ${b} || ${v}`)}var r9={INTERNAL:0,LEAF:1,PACKED_LEAF_FROM_PARENT:2};function EOt(e,t,n){let i=e._primitive._screenSpaceError,r=e._keyframeLocation,o=e._frameNumber,s=t>=2,a=0,c=0,u=[],f=[];function d(g,m,y,A,b){let x=!1;if(l(g.children))for(let T=0;T<8;T++){let E=g.children[T];E.computeSurroundingRenderableKeyframeNodes(r),E.isRenderable(o)&&(x=!0)}if(x){u[b]=r9.INTERNAL<<16|m,u[y]=A,a++,A=m,b=A*9+1;for(let T=0;T<8;T++){let E=g.children[T];m=a,y=m*9+0,d(E,m,y,A,b+T)}}else{if(e._primitive.tileVisible.raiseEvent(),s){let T=c*5,E=g.renderableKeyframeNodePrevious,v=g.level-E.spatialNode.level,S=E.spatialNode.parent,I=l(S)?S.renderableKeyframeNodePrevious:E,R=COt(g,i,n),O=v,L=1,_=E.megatextureIndex,C=I.megatextureIndex;f[T+0]=R,f[T+1]=O,f[T+2]=L,f[T+3]=_,f[T+4]=C,u[b]=r9.LEAF<<16|c}else{let T=g.renderableKeyframeNodePrevious,v=g.level-T.spatialNode.level===0?r9.LEAF:r9.PACKED_LEAF_FROM_PARENT;u[b]=v<<16|T.megatextureIndex}c++}}let p=e.rootNode;p.computeSurroundingRenderableKeyframeNodes(r),p.isRenderable(o)&&d(p,0,0,0,0),vOt(u,9,e.internalNodeTilesPerRow,e.internalNodeTexture),s&&SOt(f,2,e.leafNodeTilesPerRow,e.leafNodeTexture)}function COt(e,t,n){if(e.parent===void 0)return 0;let i=e.screenSpaceError,r=e.parent.screenSpaceError,s=((t-i)/(r-i)+n-1)/n;return D.clamp(s,0,1)}function vOt(e,t,n,i){let r=Ke.componentsLength(i.pixelFormat),o=Math.ceil(e.length/t),s=Math.max(1,t*Math.min(o,n)),a=Math.max(1,Math.ceil(o/n)),c=new Uint8Array(s*a*r);for(let d=0;d<e.length;d++){let p=e[d],g=d*r;for(let m=0;m<r;m++)c[g+m]=p>>>m*8&255}let f={source:{arrayBufferView:c,width:s,height:a},xOffset:0,yOffset:0};i.copyFrom(f)}function SOt(e,t,n,i){let r=Ke.componentsLength(i.pixelFormat),o=5,s=Math.ceil(e.length/o),a=Math.max(1,t*Math.min(s,n)),c=Math.max(1,Math.ceil(s/n)),u=new Uint8Array(a*c*r);for(let p=0;p<s;p++){let g=e[p*o+0],m=e[p*o+1],y=e[p*o+2],A=e[p*o+3],b=e[p*o+4],x=D.clamp(Math.floor(65536*g),0,65535);u[p*8+0]=x>>>0&255,u[p*8+1]=x>>>8&255,u[p*8+2]=m&255,u[p*8+3]=y&255,u[p*8+4]=A>>>0&255,u[p*8+5]=A>>>8&255,u[p*8+6]=b>>>0&255,u[p*8+7]=b>>>8&255}let d={source:{arrayBufferView:u,width:a,height:c},xOffset:0,yOffset:0};i.copyFrom(d)}var nV=mb;function M0(e){e=e??H.EMPTY_OBJECT;let{provider:t=M0.DefaultProvider,modelMatrix:n=N.IDENTITY,customShader:i=bI(t),clock:r,calculateStatistics:o=!1}=e;this._ready=!1,this._provider=t,this._traversal=void 0,this._statistics=new zm,this._calculateStatistics=o;let{shape:s,minBounds:a=Tc.getMinBounds(s),maxBounds:c=Tc.getMaxBounds(s),dimensions:u,paddingBefore:f=h.ZERO,paddingAfter:d=h.ZERO,metadataOrder:p,availableLevels:g=1}=t;this._dimensions=h.clone(u),this._paddingBefore=h.clone(f),this._paddingAfter=h.clone(d),this._inputDimensions=wOt(u,f,d,p),this._availableLevels=g,this._minBounds=a.clone(),this._minBoundsOld=new h,this._maxBounds=c.clone(),this._maxBoundsOld=new h,this._minClippingBounds=a.clone(),this._minClippingBoundsOld=new h,this._maxClippingBounds=c.clone(),this._maxClippingBoundsOld=new h,this._verticalExaggeration=1,this._verticalExaggerationRelativeHeight=0,this._clippingPlanes=void 0,this._clippingPlanesState=0,this._clippingPlanesEnabled=!1,this._modelMatrix=N.clone(n),this._modelMatrixOld=N.clone(this._modelMatrix),this._customShader=i??M0.DefaultCustomShader,this._customShaderCompilationEvent=new be,this._shaderDirty=!0,this._drawCommand=void 0,this._drawCommandPick=void 0,this._pickId=void 0,this._clock=r,this._transformPositionLocalToWorld=new N,this._transformPositionWorldToLocal=new N,this._transformPlaneLocalToView=new N,this._transformDirectionWorldToLocal=new $,this._nearestSampling=!1,this._levelBlendFactor=0,this._stepSizeMultiplier=1,this._depthTest=!0,this._useLogDepth=void 0,this._screenSpaceError=4,this._debugPolylines=new Lm,this._debugDraw=!1,this._disableRender=!1,this._disableUpdate=!1;let m=Tc.getShapeConstructor(s);this._shape=new m,_Re(this),this._shapeVisible=yRe(this),this._uniforms={octreeInternalNodeTexture:void 0,octreeInternalNodeTilesPerRow:0,octreeInternalNodeTexelSizeUv:new U,octreeLeafNodeTexture:void 0,octreeLeafNodeTilesPerRow:0,octreeLeafNodeTexelSizeUv:new U,megatextureTextures:[],megatextureTileCounts:new h,dimensions:this._dimensions,inputDimensions:this._inputDimensions,paddingBefore:this._paddingBefore,paddingAfter:this._paddingAfter,transformPositionViewToLocal:new N,transformDirectionViewToLocal:new $,cameraPositionLocal:new h,cameraDirectionLocal:new h,cameraTileCoordinates:new se,cameraTileUv:new h,ndcSpaceAxisAlignedBoundingBox:new se,clippingPlanesTexture:void 0,clippingPlanesMatrix:new N,renderBoundPlanesTexture:void 0,stepSize:this._stepSizeMultiplier,pickColor:new z},this._shapeDefinesOld={},this._uniformMap={};let y=this._uniforms,A=this._uniformMap;for(let b in y)if(y.hasOwnProperty(b)){let x=`u_${b}`;A[x]=function(){return y[b]}}IOt(this,this._shape),this.tileLoad=new be,this.tileVisible=new be,this.tileFailed=new be,this.tileUnload=new be,this.loadProgress=new be,this.allTilesLoaded=new be,this.initialTilesLoaded=new be}function wOt(e,t,n,i){let r=h.add(e,t,new h);if(h.add(r,n,r),i===R0.Y_UP){let o=r.y;r.y=r.z,r.z=o}return r}function IOt(e,t){let n=e._uniformMap,{shaderUniforms:i,shaderDefines:r}=t;for(let o in i)if(i.hasOwnProperty(o)){let s=`u_${o}`;n[s]=function(){return i[o]}}e._shapeDefinesOld=Je(r,!0)}Object.defineProperties(M0.prototype,{ready:{get:function(){return this._ready}},provider:{get:function(){return this._provider}},boundingSphere:{get:function(){return this._shape.boundingSphere}},orientedBoundingBox:{get:function(){return this._shape.orientedBoundingBox}},modelMatrix:{get:function(){return this._modelMatrix},set:function(e){this._modelMatrix=N.clone(e,this._modelMatrix)}},shape:{get:function(){return this._provider.shape}},dimensions:{get:function(){return this._dimensions}},inputDimensions:{get:function(){return this._inputDimensions}},paddingBefore:{get:function(){return this._paddingBefore}},paddingAfter:{get:function(){return this._paddingAfter}},minimumValues:{get:function(){return this._provider.minimumValues}},maximumValues:{get:function(){return this._provider.maximumValues}},show:{get:function(){return!this._disableRender},set:function(e){this._disableRender=!e}},disableUpdate:{get:function(){return this._disableUpdate},set:function(e){this._disableUpdate=e}},debugDraw:{get:function(){return this._debugDraw},set:function(e){this._debugDraw=e}},depthTest:{get:function(){return this._depthTest},set:function(e){this._depthTest!==e&&(this._depthTest=e,this._shaderDirty=!0)}},nearestSampling:{get:function(){return this._nearestSampling},set:function(e){this._nearestSampling=e}},levelBlendFactor:{get:function(){return this._levelBlendFactor},set:function(e){this._levelBlendFactor=D.clamp(e,0,1)}},screenSpaceError:{get:function(){return this._screenSpaceError},set:function(e){this._screenSpaceError=e}},stepSize:{get:function(){return this._stepSizeMultiplier},set:function(e){this._stepSizeMultiplier=e}},minBounds:{get:function(){return this._minBounds},set:function(e){this._minBounds=h.clone(e,this._minBounds)}},maxBounds:{get:function(){return this._maxBounds},set:function(e){this._maxBounds=h.clone(e,this._maxBounds)}},minClippingBounds:{get:function(){return this._minClippingBounds},set:function(e){this._minClippingBounds=h.clone(e,this._minClippingBounds)}},maxClippingBounds:{get:function(){return this._maxClippingBounds},set:function(e){this._maxClippingBounds=h.clone(e,this._maxClippingBounds)}},clippingPlanes:{get:function(){return this._clippingPlanes},set:function(e){Cs.setOwner(e,this,"_clippingPlanes")}},customShader:{get:function(){return this._customShader},set:function(e){if(e===this._customShader)return;let t=this._uniformMap,i=this._customShader.uniformMap;for(let r in i)i.hasOwnProperty(r)&&delete t[r];if(l(e))this._customShader=e;else{let r=bI(this._provider);this._customShader=r??M0.DefaultCustomShader}this._shaderDirty=!0}},customShaderCompilationEvent:{get:function(){return this._customShaderCompilationEvent}},statistics:{get:function(){return this._statistics}}});var POt=new se,DOt=new se,ROt=new N,OOt=new N,MOt=new h,NOt=new se;M0.prototype.update=function(e){let t=this._provider,n=this._uniforms;this._customShader.update(e);let i=e.context;if(!this._ready){VOt(this,t,i),e.afterRender.push(()=>(this._ready=!0,!0));return}let r=_Re(this),o=zOt(this,e);if((r||o)&&(this._shapeVisible=yRe(this),JOt(this)&&(this._shaderDirty=!0)),!this._shapeVisible)return;this._shape.updateViewTransforms(e);let s=ZOt(t.timeIntervalCollection,this._clock),a=this._traversal,c=a._sampleCount;if(a.update(e,s,r,this._disableUpdate),c!==a._sampleCount&&(this._shaderDirty=!0),!a.isRenderable(a.rootNode)||(this._debugDraw&&sMt(this,e),this._disableRender))return;this._useLogDepth!==e.useLogDepth&&(this._useLogDepth=e.useLogDepth,this._shaderDirty=!0),QOt(this,e)&&(this._shaderDirty=!0);let f=a.leafNodeTexture;l(f)&&(n.octreeLeafNodeTexture=a.leafNodeTexture,n.octreeLeafNodeTexelSizeUv=U.clone(a.leafNodeTexelSizeUv,n.octreeLeafNodeTexelSizeUv),n.octreeLeafNodeTilesPerRow=a.leafNodeTilesPerRow),this._shaderDirty&&(Xz(this,i),this._shaderDirty=!1);let d=i.uniformState.viewProjection,{orientedBoundingBox:p}=this._shape,g=nMt(p,d,DOt);if(g.x===1||g.y===1||g.z===-1||g.w===-1)return;n.ndcSpaceAxisAlignedBoundingBox=se.clone(g,n.ndcSpaceAxisAlignedBoundingBox);let y=i.uniformState.inverseView,A=N.multiplyTransformation(this._transformPositionWorldToLocal,y,n.transformPositionViewToLocal);this._transformPlaneLocalToView=N.transpose(A,this._transformPlaneLocalToView);let b=i.uniformState.inverseViewRotation;n.transformDirectionViewToLocal=$.multiply(this._transformDirectionWorldToLocal,b,n.transformDirectionViewToLocal),n.cameraPositionLocal=N.multiplyByPoint(this._transformPositionWorldToLocal,e.camera.positionWC,n.cameraPositionLocal),n.cameraDirectionLocal=$.multiplyByVector(this._transformDirectionWorldToLocal,e.camera.directionWC,n.cameraDirectionLocal);let x=BOt(this,n.cameraPositionLocal,NOt);n.cameraTileCoordinates=se.fromElements(Math.floor(x.x),Math.floor(x.y),Math.floor(x.z),x.w,n.cameraTileCoordinates),n.cameraTileUv=h.fromElements(x.x-Math.floor(x.x),x.y-Math.floor(x.y),x.z-Math.floor(x.z),n.cameraTileUv),n.stepSize=this._stepSizeMultiplier,LOt(this),FOt(this,e);let T=e.passes.pick?this._drawCommandPick:e.passes.pickVoxel?this._drawCommandPickVoxel:this._drawCommand;T.boundingVolume=this._shape.boundingSphere,e.commandList.push(T)};function LOt(e){let{megatextures:t}=e._traversal;for(let n=0;n<t.length;++n)t[n].nearestSampling=e._nearestSampling}function FOt(e,t){let n=e._uniforms,{renderBoundPlanes:i}=e._shape;l(i)&&(i.update(t,e._transformPlaneLocalToView),n.renderBoundPlanesTexture=i.texture)}function BOt(e,t,n){let i=e._shape.convertLocalToShapeUvSpace(t,MOt),r=e._availableLevels,o=2**(r-1);return se.fromElements(i.x*o,i.y*o,i.z*o,r-1,n)}var kOt=new h,die=new h,UOt=new he;function zOt(e,t){let{verticalExaggeration:n,verticalExaggerationRelativeHeight:i}=t;return e._verticalExaggeration===n&&e._verticalExaggerationRelativeHeight===i?!1:(e._verticalExaggeration=n,e._verticalExaggerationRelativeHeight=i,!0)}function VOt(e,t,n){let i=e._uniforms;e._pickId=n.createPickId({primitive:e}),i.pickColor=z.clone(e._pickId.color,i.pickColor);let r=t.keyframeCount??1;e._traversal=new nV(e,n,r),e.statistics.texturesByteLength=e._traversal.textureMemoryByteLength,$Ot(e._traversal,i)}function _Re(e){return iV(e,"_modelMatrix","_modelMatrixOld")+iV(e,"_minBounds","_minBoundsOld")+iV(e,"_maxBounds","_maxBoundsOld")+iV(e,"_minClippingBounds","_minClippingBoundsOld")+iV(e,"_maxClippingBounds","_maxClippingBoundsOld")>0}function iV(e,t,n){let i=e[t],r=e[n],o=!i.equals(r);return o&&i.clone(r),o?1:0}var jOt=new h,HOt=new h,GOt=new h,WOt=new h,qOt=new N,YOt=new N;function yRe(e){let t=e._verticalExaggeration,n=e._verticalExaggerationRelativeHeight,i=h.clone(e._minBounds,jOt),r=h.clone(e._maxBounds,HOt),o=h.clone(e._minClippingBounds,GOt),s=h.clone(e._maxClippingBounds,WOt),a=N.clone(e._modelMatrix,qOt);if(e.shape===Tc.ELLIPSOID)i.z=Ar.getHeight(e._minBounds.z,t,n),r.z=Ar.getHeight(e._maxBounds.z,t,n),o.z=Ar.getHeight(e._minClippingBounds.z,t,n),s.z=Ar.getHeight(e._maxClippingBounds.z,t,n);else{let m=h.fromElements(1,1,t,kOt);N.multiplyByScale(a,m,a),N.multiplyByTranslation(a,KOt(e),a)}let c=e._provider,u=c.shapeTransform??N.IDENTITY,f=c.globalTransform??N.IDENTITY,d=N.multiplyTransformation(f,a,YOt);N.multiplyTransformation(d,u,d);let p=e._shape;return p.update(d,i,r,o,s)?(e._transformPositionLocalToWorld=N.clone(p.shapeTransform,e._transformPositionLocalToWorld),e._transformPositionWorldToLocal=N.inverse(e._transformPositionLocalToWorld,e._transformPositionWorldToLocal),e._transformDirectionWorldToLocal=N.getMatrix3(e._transformPositionWorldToLocal,e._transformDirectionWorldToLocal),!0):!1}var XOt=new h;function KOt(e){let t=e._verticalExaggeration,n=e._verticalExaggerationRelativeHeight,{shapeTransform:i=N.IDENTITY,globalTransform:r=N.IDENTITY}=e._provider,o=N.getTranslation(i,die),s=N.multiplyByPoint(e._modelMatrix,o,die),a=N.multiplyByPoint(r,s,die),u=ee.WGS84.cartesianToCartographic(a,UOt),f=0;l(u)&&(f=u.height);let d=Ar.getHeight(f,t,n);return h.fromElements(0,0,(d-f)/t,XOt)}function $Ot(e,t){t.octreeInternalNodeTexture=e.internalNodeTexture,t.octreeInternalNodeTexelSizeUv=U.clone(e.internalNodeTexelSizeUv,t.octreeInternalNodeTexelSizeUv),t.octreeInternalNodeTilesPerRow=e.internalNodeTilesPerRow;let{megatextures:n}=e,i=n[0];t.megatextureTextures=new Array(n.length);for(let r=0;r<n.length;r++)t.megatextureTextures[r]=n[r].texture;t.megatextureTileCounts=h.clone(i.tileCounts,t.megatextureTileCounts)}function JOt(e){let{shaderDefines:t}=e._shape,n=Object.keys(t).some(i=>t[i]!==e._shapeDefinesOld[i]);return n&&(e._shapeDefinesOld=Je(t,!0)),n}function ZOt(e,t){if(!l(e)||!l(t))return 0;let n=t.currentTime,i,r=e.indexOf(n);r>=0?i=e.get(r):(r=~r,r===e.length?(r=e.length-1,i=e.get(r),n=i.stop):(i=e.get(r),n=i.start));let o=K.secondsDifference(i.stop,i.start),a=K.secondsDifference(n,i.start)/o;return r+a}function QOt(e,t){let n=e.clippingPlanes;if(!l(n))return!1;n.update(t);let{clippingPlanesState:i,enabled:r}=n;if(r){let o=e._uniforms;o.clippingPlanesTexture=n.texture,o.clippingPlanesMatrix=N.transpose(N.multiplyTransformation(N.inverse(n.modelMatrix,o.clippingPlanesMatrix),e._transformPositionLocalToWorld,o.clippingPlanesMatrix),o.clippingPlanesMatrix)}return e._clippingPlanesState===i&&e._clippingPlanesEnabled===r?!1:(e._clippingPlanesState=i,e._clippingPlanesEnabled=r,!0)}M0.prototype.isDestroyed=function(){return!1};M0.prototype.destroy=function(){let e=this._drawCommand;l(e)&&(e.shaderProgram=e.shaderProgram&&e.shaderProgram.destroy());let t=this._drawCommandPick;return l(t)&&(t.shaderProgram=t.shaderProgram&&t.shaderProgram.destroy()),this._pickId=this._pickId&&this._pickId.destroy(),this._traversal=this._traversal&&this._traversal.destroy(),this.statistics.texturesByteLength=0,this._clippingPlanes=this._clippingPlanes&&this._clippingPlanes.destroy(),le(this)};var gRe=new Array(new se(-1,-1,-1,1),new se(1,-1,-1,1),new se(-1,1,-1,1),new se(1,1,-1,1),new se(-1,-1,1,1),new se(1,-1,1,1),new se(-1,1,1,1),new se(1,1,1,1)),eMt=new Array(1,2,4,0,3,5,0,3,6,1,2,7,0,5,6,1,4,7,2,4,7,3,5,6),tMt=new Array(new se,new se,new se,new se,new se,new se,new se,new se);function nMt(e,t,n){let i=N.fromRotationTranslation(e.halfAxes,e.center,ROt),r=N.multiply(t,i,OOt),o=+Number.MAX_VALUE,s=-Number.MAX_VALUE,a=+Number.MAX_VALUE,c=-Number.MAX_VALUE,u,f=tMt,d=gRe.length;for(u=0;u<d;u++)N.multiplyByVector(r,gRe[u],f[u]);for(u=0;u<d;u++){let p=f[u];if(p.z>=-p.w){let g=p.x/p.w,m=p.y/p.w;o=Math.min(o,g),s=Math.max(s,g),a=Math.min(a,m),c=Math.max(c,m)}else for(let g=0;g<3;g++){let m=eMt[u*3+g],y=f[m];if(y.z>=-y.w){let A=p.z+p.w,b=y.z+y.w,x=A/(A-b),T=se.lerp(p,y,x,POt),E=T.x/T.w,v=T.y/T.w;o=Math.min(o,E),s=Math.max(s,E),a=Math.min(a,v),c=Math.max(c,v)}}}return o=D.clamp(o,-1,1),a=D.clamp(a,-1,1),s=D.clamp(s,-1,1),c=D.clamp(c,-1,1),n=se.fromElements(o,a,s,c,n),n}var hie=3e7,iMt=new h(hie,0,0),rMt=new h(0,hie,0),oMt=new h(0,0,hie);function sMt(e,t){let n=e._traversal,i=e._debugPolylines;i.removeAll();function r(c,u,f,d){i.add({positions:[c,u],width:d,material:er.fromType("Color",{color:f})})}function o(c,u,f){let d=c.computeCorners();r(d[0],d[1],u,f),r(d[2],d[3],u,f),r(d[4],d[5],u,f),r(d[6],d[7],u,f),r(d[0],d[2],u,f),r(d[4],d[6],u,f),r(d[1],d[3],u,f),r(d[5],d[7],u,f),r(d[0],d[4],u,f),r(d[2],d[6],u,f),r(d[1],d[5],u,f),r(d[3],d[7],u,f)}function s(c){if(!n.isRenderable(c))return;let u=c.level,d=Math.max(1,5/Math.pow(2,u)),g=[z.RED,z.LIME,z.BLUE][u%3];if(o(c.orientedBoundingBox,g,d),l(c.children))for(let m=0;m<8;m++)s(c.children[m])}o(e._shape.orientedBoundingBox,z.WHITE,5),s(n.rootNode);let a=10;r(h.ZERO,iMt,z.RED,a),r(h.ZERO,rMt,z.LIME,a),r(h.ZERO,oMt,z.BLUE,a),i.update(t)}M0.DefaultCustomShader=new D0({fragmentShaderText:`void fragmentMain(FragmentInput fsInput, inout czm_modelMaterial material) { vec3 voxelNormal = fsInput.attributes.normalEC; float diffuse = max(0.0, dot(voxelNormal, czm_lightDirectionEC)); float lighting = 0.5 + 0.5 * diffuse; material.diffuse = vec3(lighting); material.alpha = 1.0; -}`});function wBe(){this.shape=Ec.BOX,this.dimensions=new h(1,1,1),this.names=["data"],this.types=[bt.SCALAR],this.componentTypes=[Lt.FLOAT32],this.maximumTileCount=1}wBe.prototype.requestData=function(e){if((l(e)?e.tileLevel??0:0)>=1)return;let n=new vC({metadata:[new Float32Array(1)]});return Promise.resolve(n)};q0.DefaultProvider=new wBe;var Fb=q0;function czt(e,t,n,i){if(!l(e)||l(t)&&e.id!==t)return;let o=(e.classes||{})[n];if(!l(o))return;let a=(o.properties||{})[i];if(l(a))return a}var p4=czt;function lzt(e,t,n,i,r){this.schemaId=e,this.className=t,this.propertyName=n,this.classProperty=i,this.metadataProperty=r}var g4=lzt;function uzt(e,t,n){if(!l(e))return;let i=e.propertyTextures;for(let r of i)if(r.class.id===t){let a=r.properties[n];if(l(a))return a}}var _4=uzt;var _W=function(e){return function(){e.frameState.afterRender.push(function(){e.requestRender()})}};function Ai(e){e=e??H.EMPTY_OBJECT;let t=e.canvas,n=e.creditContainer,i=e.creditViewport,r=e.contextOptions instanceof MO;if(r)this._context=e.contextOptions.createSceneContext(t);else{let u=Je(e.contextOptions);this._context=new xx(t,u)}let o=this._context,s=l(n);s||(n=document.createElement("div"),n.style.position="absolute",n.style.bottom="0",n.style["text-shadow"]="0 0 2px #000000",n.style.color="#ffffff",n.style["font-size"]="10px",n.style["padding-right"]="5px",t.parentNode.appendChild(n)),l(i)||(i=t.parentNode),this._id=Kn(),this._jobScheduler=new Nz,this._heightQueryCache=new Map,this._heightQueryFrame=-1,this._frameState=new VA(o,new Cz(n,"\u2022",i),this._jobScheduler),this._frameState.scene3DOnly=e.scene3DOnly??!1,this._removeCreditContainer=!s,this._creditContainer=n,this._canvas=t,this._computeEngine=new CD(o),this._ellipsoid=e.ellipsoid??ee.default,this._globe=void 0,this._globeTranslucencyState=new Mz,this._primitives=new xl({countReferences:r}),this._groundPrimitives=new xl({countReferences:r}),this._globeHeight=void 0,this._globeHeightDirty=!0,this._cameraUnderground=!1,this._removeUpdateHeightCallback=void 0,this._logDepthBuffer=Ai.defaultLogDepthBuffer&&o.fragmentDepth,this._logDepthBufferDirty=!0,this._tweens=new bC,this._shaderFrameCount=0,this._sunPostProcess=void 0,this._computeCommandList=[],this._overlayCommandList=[],this._useOIT=e.orderIndependentTranslucency??!0,this._executeOITFunction=void 0,this._depthPlane=new Dz(e.depthPlaneEllipsoidOffset),this._clearColorCommand=new li({color:new z,stencil:0,owner:this}),this._depthClearCommand=new li({depth:1,owner:this}),this._stencilClearCommand=new li({stencil:0}),this._classificationStencilClearCommand=new li({stencil:0,renderState:Ge.fromCache({stencilMask:Yt.CLASSIFICATION_MASK})}),this._depthOnlyRenderStateCache={},this._transitioner=new EV(this),this._preUpdate=new be,this._postUpdate=new be,this._renderError=new be,this._preRender=new be,this._postRender=new be,this._controllerHost=new xz,this._minimumDisableDepthTestDistance=0,this._debugInspector=new FV,this._msaaSamples=e.msaaSamples??4,this.rethrowRenderErrors=!1,this.completeMorphOnUserInput=!0,this.morphStart=new be,this.morphComplete=new be,this.skyBox=void 0,this.skyAtmosphere=void 0,this.sun=void 0,this.sunBloom=!0,this._sunBloom=void 0,this.moon=void 0,this.backgroundColor=z.clone(z.BLACK),this._mode=re.SCENE3D,this._mapProjection=l(e.mapProjection)?e.mapProjection:new Ui(this._ellipsoid),this.morphTime=1,this.farToNearRatio=1e3,this.logarithmicDepthFarToNearRatio=1e9,this.nearToFarDistance2D=175e4,this.verticalExaggeration=1,this.verticalExaggerationRelativeHeight=0,this.debugCommandFilter=void 0,this.debugShowCommands=!1,this.debugShowFrustums=!1,this.debugShowFramesPerSecond=!1,this.debugShowDepthFrustum=1,this.debugShowFrustumPlanes=!1,this._debugShowFrustumPlanes=!1,this._debugFrustumPlanes=void 0,this.useDepthPicking=!0,this.pickTranslucentDepth=!1,this.cameraEventWaitTime=500,this.atmosphere=new hT,this.fog=new Oz,this.fog.enabled=ee.WGS84.equals(this._ellipsoid),ee.WGS84.equals(this._ellipsoid)||(Or.DEFAULT_VIEW_RECTANGLE=ie.fromDegrees(-45,-45,45,45)),this._shadowMapCamera=new Or(this),this.shadowMap=new oy({context:o,lightCamera:this._shadowMapCamera,enabled:e.shadows??!1}),this.invertClassification=!1,this.invertClassificationColor=z.clone(z.WHITE),this._actualInvertClassificationColor=z.clone(this._invertClassificationColor),this._invertClassification=new bP,this.focalLength=void 0,this.eyeSeparation=void 0,this.postProcessStages=new bV,this._brdfLutGenerator=new gz,this._performanceDisplay=void 0,this._debugVolume=void 0,this._screenSpaceCameraController=new wV(this),this._cameraUnderground=!1,this._mapMode2D=e.mapMode2D??Au.INFINITE_SCROLL,this._environmentState={skyBoxCommand:void 0,skyAtmosphereCommand:void 0,sunDrawCommand:void 0,sunComputeCommand:void 0,moonCommand:void 0,isSunVisible:!1,isMoonVisible:!1,isReadyForAtmosphere:!1,isSkyAtmosphereVisible:!1,clearGlobeDepth:!1,useDepthPlane:!1,renderTranslucentDepthForPick:!1,originalFramebuffer:void 0,useGlobeDepthFramebuffer:!1,useOIT:!1,useInvertClassification:!1,usePostProcess:!1,usePostProcessSelected:!1,useWebVR:!1},this._useWebVR=!1,this._cameraVR=void 0,this._aspectRatioVR=void 0,this.requestRenderMode=e.requestRenderMode??!1,this._renderRequested=!0,this.maximumRenderTimeChange=e.maximumRenderTimeChange??0,this._lastRenderTime=void 0,this._frameRateMonitor=void 0,this._removeRequestListenerCallback=Kc.requestCompletedEvent.addEventListener(_W(this)),this._removeTaskProcessorListenerCallback=$n.taskCompletedEvent.addEventListener(_W(this)),this._removeGlobeCallbacks=[],this._removeTerrainProviderReadyListener=void 0;let a=new et(0,0,o.drawingBufferWidth,o.drawingBufferHeight),c=new Or(this);this._logDepthBuffer&&(c.frustum.near=.1,c.frustum.far=1e10),this.preloadFlightCamera=new Or(this),this.preloadFlightCullingVolume=void 0,this._picking=new Zz(this),this._defaultView=new hC(this,c,a),this._view=this._defaultView,this._hdr=void 0,this._hdrDirty=void 0,this.highDynamicRange=!1,this.gamma=2.2,this.sphericalHarmonicCoefficients=void 0,this.specularEnvironmentMaps=void 0,this._specularEnvironmentCubeMap=void 0,this.light=new dg,this._enableEdgeVisibility=!1,this._enablePlanarFillId=!1,MBe(this,0,K.now()),this.updateFrameState(),this.initializeFrame()}Ai.defaultLogDepthBuffer=!0;function fzt(e,t){for(let i=0;i<e._removeGlobeCallbacks.length;++i)e._removeGlobeCallbacks[i]();e._removeGlobeCallbacks.length=0;let n=[];l(t)&&(n.push(t.imageryLayersUpdatedEvent.addEventListener(_W(e))),n.push(t.terrainProviderChanged.addEventListener(_W(e)))),e._removeGlobeCallbacks=n}Object.defineProperties(Ai.prototype,{canvas:{get:function(){return this._canvas}},drawingBufferHeight:{get:function(){return this._context.drawingBufferHeight}},drawingBufferWidth:{get:function(){return this._context.drawingBufferWidth}},maximumAliasedLineWidth:{get:function(){return kt.maximumAliasedLineWidth}},maximumCubeMapSize:{get:function(){return kt.maximumCubeMapSize}},pickPositionSupported:{get:function(){return this._context.depthTexture}},sampleHeightSupported:{get:function(){return this._context.depthTexture}},clampToHeightSupported:{get:function(){return this._context.depthTexture}},invertClassificationSupported:{get:function(){return this._context.depthTexture}},specularEnvironmentMapsSupported:{get:function(){return rm.isSupported(this._context)}},ellipsoid:{get:function(){return this._ellipsoid}},globe:{get:function(){return this._globe},set:function(e){this._globe=this._globe&&this._globe.destroy(),this._globe=e,fzt(this,e)}},primitives:{get:function(){return this._primitives}},groundPrimitives:{get:function(){return this._groundPrimitives}},camera:{get:function(){return this._view.camera},set:function(e){this._view.camera=e}},view:{get:function(){return this._view},set:function(e){this._view=e}},defaultView:{get:function(){return this._defaultView}},picking:{get:function(){return this._picking}},controllerHost:{get:function(){return this._controllerHost}},screenSpaceCameraController:{get:function(){return this._screenSpaceCameraController}},mapProjection:{get:function(){return this._mapProjection}},jobScheduler:{get:function(){return this._jobScheduler}},frameState:{get:function(){return this._frameState}},environmentState:{get:function(){return this._environmentState}},tweens:{get:function(){return this._tweens}},imageryLayers:{get:function(){if(l(this.globe))return this.globe.imageryLayers}},terrainProvider:{get:function(){if(l(this.globe))return this.globe.terrainProvider},set:function(e){this._removeTerrainProviderReadyListener=this._removeTerrainProviderReadyListener&&this._removeTerrainProviderReadyListener(),l(this.globe)&&(this.globe.terrainProvider=e)}},terrainProviderChanged:{get:function(){if(l(this.globe))return this.globe.terrainProviderChanged}},vectorProvider:{get:function(){return this.globe?.vectorProvider}},preUpdate:{get:function(){return this._preUpdate}},postUpdate:{get:function(){return this._postUpdate}},renderError:{get:function(){return this._renderError}},preRender:{get:function(){return this._preRender}},postRender:{get:function(){return this._postRender}},lastRenderTime:{get:function(){return this._lastRenderTime}},context:{get:function(){return this._context}},debugFrustumStatistics:{get:function(){return this._view.debugFrustumStatistics}},scene3DOnly:{get:function(){return this._frameState.scene3DOnly}},orderIndependentTranslucency:{get:function(){return this._useOIT}},id:{get:function(){return this._id}},mode:{get:function(){return this._mode},set:function(e){e===re.SCENE2D?this.morphTo2D(0):e===re.SCENE3D?this.morphTo3D(0):e===re.COLUMBUS_VIEW&&this.morphToColumbusView(0),this._mode=e}},frustumCommandsList:{get:function(){return this._view.frustumCommandsList}},numberOfFrustums:{get:function(){return this._view.frustumCommandsList.length}},useWebVR:{get:function(){return this._useWebVR},set:function(e){this._useWebVR=e,this._useWebVR?(this._frameState.creditDisplay.container.style.visibility="hidden",this._cameraVR=new Or(this),l(this._deviceOrientationCameraController)||(this._deviceOrientationCameraController=new Rz(this)),this._aspectRatioVR=this.camera.frustum.aspectRatio):(this._frameState.creditDisplay.container.style.visibility="visible",this._cameraVR=void 0,this._deviceOrientationCameraController=this._deviceOrientationCameraController&&!this._deviceOrientationCameraController.isDestroyed()&&this._deviceOrientationCameraController.destroy(),this.camera.frustum.aspectRatio=this._aspectRatioVR,this.camera.frustum.xOffset=0)}},mapMode2D:{get:function(){return this._mapMode2D}},splitPosition:{get:function(){return this._frameState.splitPosition},set:function(e){this._frameState.splitPosition=e}},minimumDisableDepthTestDistance:{get:function(){return this._minimumDisableDepthTestDistance},set:function(e){this._minimumDisableDepthTestDistance=e}},logarithmicDepthBuffer:{get:function(){return this._logDepthBuffer},set:function(e){e=this._context.fragmentDepth&&e,this._logDepthBuffer!==e&&(this._logDepthBuffer=e,this._logDepthBufferDirty=!0)}},gamma:{get:function(){return this._context.uniformState.gamma},set:function(e){this._context.uniformState.gamma=e}},highDynamicRange:{get:function(){return this._hdr},set:function(e){let t=this._context,n=e&&t.depthTexture&&(t.colorBufferFloat||t.colorBufferHalfFloat);this._hdrDirty=n!==this._hdr,this._hdr=n}},highDynamicRangeSupported:{get:function(){let e=this._context;return e.depthTexture&&(e.colorBufferFloat||e.colorBufferHalfFloat)}},cameraUnderground:{get:function(){return this._cameraUnderground}},msaaSamples:{get:function(){return this._msaaSamples},set:function(e){e=Math.min(e,kt.maximumSamples),this._msaaSamples=e}},msaaSupported:{get:function(){return this._context.msaa}},pixelRatio:{get:function(){return this._frameState.pixelRatio},set:function(e){this._frameState.pixelRatio=e}},opaqueFrustumNearOffset:{get:function(){return .9999}},globeHeight:{get:function(){return this._globeHeight}}});Ai.prototype.getCompressedTextureFormatSupported=function(e){let t=this.context;return(e==="WEBGL_compressed_texture_s3tc"||e==="s3tc")&&t.s3tc||(e==="WEBGL_compressed_texture_pvrtc"||e==="pvrtc")&&t.pvrtc||(e==="WEBGL_compressed_texture_etc"||e==="etc")&&t.etc||(e==="WEBGL_compressed_texture_etc1"||e==="etc1")&&t.etc1||(e==="WEBGL_compressed_texture_astc"||e==="astc")&&t.astc||(e==="EXT_texture_compression_bptc"||e==="bc7")&&t.bc7};function dzt(e,t){let n=e.pickedMetadataInfo,i=t.pickedMetadataInfo;return n?.schemaId!==i?.schemaId||n?.className!==i?.className||n?.propertyName!==i?.propertyName}function IBe(e,t,n){let i=e._frameState,r=e._context,o=e._view.oit,{lightShadowMaps:s,lightShadowsEnabled:a}=i.shadowState,c=t.derivedCommands;l(t.pickId)&&(c.picking=ip.createPickDerivedCommand(e,t,r,c.picking)),l(t.snapId)&&i.passes.snap&&(c.snapping=ip.createSnapDerivedCommand(e,t,r,c.snapping)),i.pickingMetadata&&t.pickMetadataAllowed&&(t.pickedMetadataInfo=i.pickedMetadataInfo,l(t.pickedMetadataInfo)&&(c.pickingMetadata=ip.createPickMetadataDerivedCommand(e,t,r,c.pickingMetadata))),t.pickOnly||(c.depth=ip.createDepthOnlyDerivedCommand(e,t,r,c.depth)),c.originalCommand=t,e._hdr&&(c.hdr=ip.createHdrCommand(t,r,c.hdr),t=c.hdr.command,c=t.derivedCommands),a&&t.receiveShadows&&(c.shadows=oy.createReceiveDerivedCommand(s,t,n,r,c.shadows)),t.pass===Ie.TRANSLUCENT&&l(o)&&o.isSupported()&&(a&&t.receiveShadows?(c.oit=l(c.oit)?c.oit:{},c.oit.shadows=o.createDerivedCommands(c.shadows.receiveCommand,r,c.oit.shadows)):c.oit=o.createDerivedCommands(t,r,c.oit))}Ai.prototype.updateDerivedCommands=function(e){let{derivedCommands:t}=e;if(!l(t))return;let n=this._frameState,{shadowState:i,useLogDepth:r}=this._frameState,o=this._context,s=!1,a=i.lastDirtyTime;e.lastDirtyTime!==a&&(e.lastDirtyTime=a,e.dirty=!0,s=!0);let c=this._hdr,u=l(t.logDepth),f=l(t.hdr),d=l(t.originalCommand),p=r&&!u,g=c&&!f,m=(!r||!c)&&!d,y=n.pickingMetadata&&dzt(e,n),A=n.passes.snap&&l(e.snapId)&&!l(t.snapping);if(e.dirty=e.dirty||p||g||m||y||A,!e.dirty)return;e.dirty=!1;let{shadowsEnabled:b,shadowMaps:x}=i;b&&e.castShadows&&(t.shadows=oy.createCastDerivedCommand(x,e,s,o,t.shadows)),(u||p)&&(t.logDepth=ip.createLogDepthCommand(e,o,t.logDepth),IBe(this,t.logDepth.command,s)),(d||m)&&IBe(this,e,s)};var hzt=new vh({pass:ao.RENDER}),Vse=new vh({pass:ao.PRELOAD}),jse=new vh({pass:ao.PRELOAD_FLIGHT}),mzt=new vh({pass:ao.REQUEST_RENDER_MODE_DEFER_CHECK}),PBe=new ue,Hse;function pzt(e){if(!(e._mode!==re.SCENE3D||!e.globe?.show||e._cameraUnderground||e._globeTranslucencyState.translucent))return PBe.radius=e.ellipsoid.minimumRadius+e.frameState.minimumTerrainHeight,Hse=mz.fromBoundingSphere(PBe,e.camera.positionWC,Hse),Hse}Ai.prototype.clearPasses=function(e){e.render=!1,e.pick=!1,e.pickVoxel=!1,e.snap=!1,e.depth=!1,e.postProcess=!1,e.offscreen=!1};function MBe(e,t,n){let i=e._frameState;i.frameNumber=t,i.time=K.clone(n,i.time)}Ai.prototype.updateFrameState=function(){let e=this.camera,t=this._frameState;t.commandList.length=0,t.shadowMaps.length=0,t.brdfLutGenerator=this._brdfLutGenerator,t.environmentMap=this.skyBox&&this.skyBox._cubeMap,t.mode=this._mode,t.morphTime=this.morphTime,t.mapProjection=this.mapProjection,t.camera=e,t.cullingVolume=e.frustum.computeCullingVolume(e.positionWC,e.directionWC,e.upWC),t.occluder=pzt(this),t.minimumTerrainHeight=0,t.minimumDisableDepthTestDistance=this._minimumDisableDepthTestDistance,t.invertClassification=this.invertClassification,t.useLogDepth=this._logDepthBuffer&&!(this.camera.frustum instanceof gn||this.camera.frustum instanceof ys),t.light=this.light,t.cameraUnderground=this._cameraUnderground,t.globeTranslucencyState=this._globeTranslucencyState;let{globe:n}=this;l(n)&&n._terrainExaggerationChanged&&(this.verticalExaggeration=n._terrainExaggeration,this.verticalExaggerationRelativeHeight=n._terrainExaggerationRelativeHeight,n._terrainExaggerationChanged=!1),t.verticalExaggeration=this.verticalExaggeration,t.verticalExaggerationRelativeHeight=this.verticalExaggerationRelativeHeight,l(this._specularEnvironmentCubeMap)&&this._specularEnvironmentCubeMap.ready?(t.specularEnvironmentMaps=this._specularEnvironmentCubeMap.texture,t.specularEnvironmentMapsMaximumLOD=this._specularEnvironmentCubeMap.maximumMipmapLevel):(t.specularEnvironmentMaps=void 0,t.specularEnvironmentMapsMaximumLOD=void 0),t.sphericalHarmonicCoefficients=this.sphericalHarmonicCoefficients,this._actualInvertClassificationColor=z.clone(this.invertClassificationColor,this._actualInvertClassificationColor),bP.isTranslucencySupported(this._context)||(this._actualInvertClassificationColor.alpha=1),t.invertClassificationColor=this._actualInvertClassificationColor,l(this.globe)?t.maximumScreenSpaceError=this.globe.maximumScreenSpaceError:t.maximumScreenSpaceError=2,this.clearPasses(t.passes),t.tilesetPassState=void 0};Ai.prototype.isVisible=function(e,t,n){if(!l(t))return!1;let{boundingVolume:i}=t;return!l(i)||!t.cull?!0:e.computeVisibility(i)===$t.OUTSIDE?!1:!l(n)||!t.occlude||!i.isOccluded(n)};var gW=new N(0,0,1,0,1,0,0,0,0,1,0,0,0,0,0,1);gW=N.inverseTransformation(gW,gW);function gzt(e,t,n,i){let r=t._frameState,o=r.context,s=e.boundingVolume;l(t._debugVolume)&&t._debugVolume.destroy();let a=h.clone(s.center);if(r.mode!==re.SCENE3D){a=N.multiplyByPoint(gW,a,a);let m=r.mapProjection,y=m.unproject(a);a=m.ellipsoid.cartographicToCartesian(y)}let c,u,{radius:f}=s;l(f)?(c=Xa.createGeometry(new Xa({radii:new h(f,f,f),vertexFormat:yn.FLAT_VERTEX_FORMAT})),u=N.fromTranslation(a)):(c=Ic.createGeometry(Ic.fromDimensions({dimensions:new h(2,2,2),vertexFormat:yn.FLAT_VERTEX_FORMAT})),u=N.fromRotationTranslation(s.halfAxes,a,new N)),t._debugVolume=new On({geometryInstances:new Ft({geometry:Hn.toWireframe(c),modelMatrix:u,attributes:{color:new Jt(1,0,0,1)}}),appearance:new yn({flat:!0,translucent:!1}),asynchronous:!1});let d=r.commandList,p=r.commandList=[];t._debugVolume.update(r),e=p[0],r.useLogDepth&&(e=ip.createLogDepthCommand(e,o).command);let g;l(i)&&(g=n.framebuffer,n.framebuffer=i),e.execute(o,n),l(g)&&(n.framebuffer=g),r.commandList=d}function Tu(e,t,n,i){let r=t._frameState,o=t._context;if(l(t.debugCommandFilter)&&!t.debugCommandFilter(e))return;if(e instanceof li){e.execute(o,n);return}e.debugShowBoundingVolume&&l(e.boundingVolume)&&gzt(e,t,n,i),r.useLogDepth&&l(e.derivedCommands.logDepth)&&(e=e.derivedCommands.logDepth.command);let s=r.passes;if(!s.pick&&!s.pickVoxel&&!s.depth&&t._hdr&&l(e.derivedCommands)&&l(e.derivedCommands.hdr)&&(e=e.derivedCommands.hdr.command),s.pick||s.depth){if(s.pick&&!s.depth){if(r.passes.snap){l(e.derivedCommands.snapping)?(e=e.derivedCommands.snapping.snapCommand,e.execute(o,n)):l(e.derivedCommands.depth)&&(e=e.derivedCommands.depth.depthOnlyCommand,e.execute(o,n));return}if(r.pickingMetadata&&l(e.derivedCommands.pickingMetadata)){e=e.derivedCommands.pickingMetadata.pickMetadataCommand,e.execute(o,n);return}if(!r.pickingMetadata&&l(e.derivedCommands.picking)){e=e.derivedCommands.picking.pickCommand,e.execute(o,n);return}}else if(l(e.derivedCommands.depth)){e=e.derivedCommands.depth.depthOnlyCommand,e.execute(o,n);return}}if(t.debugShowCommands||t.debugShowFrustums){t._debugInspector.executeDebugShowFrustumsCommand(t,e,n);return}r.shadowState.lightShadowsEnabled&&e.receiveShadows&&l(e.derivedCommands.shadows)?e.derivedCommands.shadows.receiveCommand.execute(o,n):e.execute(o,n)}function DBe(e,t,n){let{derivedCommands:i}=e;if(!l(i))return;let r=t._frameState,o=t._context;r.useLogDepth&&l(i.logDepth)&&(e=i.logDepth.command);let{picking:s,pickingMetadata:a,depth:c}=e.derivedCommands;l(a)&&(e=i.pickingMetadata.pickMetadataCommand,e.execute(o,n)),l(s)?(e=s.pickCommand,e.execute(o,n)):l(c)&&(e=c.depthOnlyCommand,e.execute(o,n))}function NBe(e,t,n){return t.boundingVolume.distanceSquaredTo(n)-e.boundingVolume.distanceSquaredTo(n)}var _zt=new h;function RBe(e,t){let n=h.subtract(e,t,_zt),i=Math.max(0,h.magnitude(n));return i*i}function yzt(e,t,n){let i=e.boundingVolume,r=t.boundingVolume;return RBe(r.center,n)-RBe(i.center,n)}function Azt(e,t,n){return e.boundingVolume.distanceSquaredTo(n)-t.boundingVolume.distanceSquaredTo(n)+D.EPSILON12}function bzt(e,t,n,i,r){N0(i,NBe,e.camera.positionWC),l(r)&&t(r.unclassifiedCommand,e,n);for(let o=0;o<i.length;++o)t(i[o],e,n)}function xzt(e,t,n,i,r){N0(i,Azt,e.camera.positionWC),l(r)&&t(r.unclassifiedCommand,e,n);for(let o=0;o<i.length;++o)t(i[o],e,n)}function Tzt(e,t,n){e.context.uniformState.updatePass(Ie.VOXELS);let i=n.commands[Ie.VOXELS];i.length=n.indices[Ie.VOXELS],N0(i,NBe,e.camera.positionWC);for(let r=0;r<i.length;++r)Tu(i[r],e,t)}function Ezt(e,t,n){e.context.uniformState.updatePass(Ie.GAUSSIAN_SPLATS);let i=n.commands[Ie.GAUSSIAN_SPLATS];i.length=n.indices[Ie.GAUSSIAN_SPLATS],N0(i,yzt,e.camera.positionWC);for(let r=0;r<i.length;++r)Tu(i[r],e,t)}var Czt=new Ji,vzt=new yu,Szt=new gn,wzt=new ys;function Izt(e){let{frustum:t}=e;return l(t.fov)?t.clone(Czt):l(t.infiniteProjectionMatrix)?t.clone(vzt):l(t.width)?t.clone(Szt):t.clone(wzt)}function Pzt(e){if(e._environmentState.useOIT){if(!l(e._executeOITFunction)){let{view:t,context:n}=e;e._executeOITFunction=function(i,r,o,s,a){t.globeDepth.prepareColorTextures(n),t.oit.executeCommands(i,r,o,s,a)}}return e._executeOITFunction}return e.frameState.passes.render?bzt:xzt}function Dzt(e,t,n){let{frameState:i,context:r}=e,{pick:o,pickVoxel:s}=i.passes,a=o||s,c;!a&&e._environmentState.useInvertClassification&&i.invertClassificationColor.alpha<1&&(c=e._invertClassification);let u=Pzt(e);r.uniformState.updatePass(Ie.TRANSLUCENT);let f=n.commands[Ie.TRANSLUCENT];f.length=n.indices[Ie.TRANSLUCENT],u(e,Tu,t,f,c)}function Rzt(e,t,n){let{translucentTileClassification:i,globeDepth:r}=e._view;if(!(n.indices[Ie.CESIUM_3D_TILE_CLASSIFICATION]>0)||!i.isSupported())return;let s=n.commands[Ie.TRANSLUCENT];i.executeTranslucentCommands(e,Tu,t,s,r.depthStencilTexture),i.executeClassificationCommands(e,Tu,t,n)}function Ozt(e,t,n){e.context.uniformState.updatePass(Ie.CESIUM_3D_TILE_EDGES);let i=t.framebuffer;e.context.uniformState.edgeColorTexture=e.context.defaultTexture,e.context.uniformState.edgeIdTexture=e.context.defaultTexture,e.context.uniformState.edgeDepthTexture=e.context.defaultTexture,e._enableEdgeVisibility&&l(e._view)&&l(e._view.edgeFramebuffer)&&(t.framebuffer=e._view.edgeFramebuffer.framebuffer);let r=n.commands[Ie.CESIUM_3D_TILE_EDGES],o=n.indices[Ie.CESIUM_3D_TILE_EDGES];e._enableEdgeVisibility&&l(e._view)&&l(e._view.edgeFramebuffer)&&e._view.edgeFramebuffer.getClearCommand(new z(0,0,0,0)).execute(e.context,t);for(let s=0;s<o;++s)Tu(r[s],e,t);t.framebuffer=i}function Mzt(e,t,n){let{context:i}=e,{uniformState:r}=i;r.updatePass(Ie.CESIUM_3D_TILE_PLANAR_FILL_ID),r.planarFillIdTexture=i.defaultTexture;let o=e._view,s=o&&o.planarFillIdFramebuffer,a=n.commands[Ie.CESIUM_3D_TILE_PLANAR_FILL_ID],c=n.indices[Ie.CESIUM_3D_TILE_PLANAR_FILL_ID];if(c!==0&&e._enablePlanarFillId&&l(s)&&l(s.framebuffer)){let u=t.framebuffer;t.framebuffer=s.framebuffer,s.getClearCommand(new z(0,0,0,0)).execute(i,t);for(let d=0;d<c;++d)Tu(a[d],e,t);t.framebuffer=u}}function Nzt(e,t,n){e.context.uniformState.updatePass(Ie.CESIUM_3D_TILE_EDGES_DIRECT);let i=n.commands[Ie.CESIUM_3D_TILE_EDGES_DIRECT],r=n.indices[Ie.CESIUM_3D_TILE_EDGES_DIRECT];for(let o=0;o<r;++o)Tu(i[o],e,t)}function Wse(e,t){let{camera:n,context:i,frameState:r}=e,{uniformState:o}=i;o.updateCamera(n),o.planarFillIdTexture=i.defaultTexture;let s=Izt(n);s.near=n.frustum.near,s.far=n.frustum.far;let a=r.passes,c=a.pick||a.pickVoxel;c||Lzt(e,t);let{clearGlobeDepth:u,renderTranslucentDepthForPick:f,useDepthPlane:d,useGlobeDepthFramebuffer:p,useInvertClassification:g,usePostProcessSelected:m}=e._environmentState,{globeDepth:y,globeTranslucencyFramebuffer:A,sceneFramebuffer:b,frustumCommandsList:x}=e._view,T=x.length,E=e._globeTranslucencyState,v=e._depthClearCommand,S=e._stencilClearCommand,I=e._classificationStencilClearCommand,R=e._depthPlane,O=n.position.z;function L(C,w){o.updatePass(w);let P=C.commands[w],M=C.indices[w];for(let F=0;F<M;++F)Tu(P[F],e,t);return M}function _(C,w){o.updatePass(w);let P=C.commands[w],M=C.indices[w];for(let F=0;F<M;++F)DBe(P[F],e,t)}for(let C=0;C<T;++C){let w=T-C-1,P=x[w];e.mode===re.SCENE2D?(n.position.z=O-P.near+1,s.far=Math.max(1,P.far-P.near),s.near=1,o.update(r),o.updateFrustum(s)):(s.near=w!==0?P.near*e.opaqueFrustumNearOffset:P.near,s.far=P.far,o.updateFrustum(s)),v.execute(i,t),i.stencilBuffer&&S.execute(i,t),E.translucent?(o.updatePass(Ie.GLOBE),E.executeGlobeCommands(P,Tu,A,e,t)):L(P,Ie.GLOBE),p&&y.executeCopyDepth(i,t),f||(E.translucent?(o.updatePass(Ie.TERRAIN_CLASSIFICATION),E.executeGlobeClassificationCommands(P,Tu,A,e,t)):L(P,Ie.TERRAIN_CLASSIFICATION)),u&&(v.execute(i,t),d&&R.execute(i,t));let M;if(Ozt(e,t,P),e._enableEdgeVisibility&&l(e._view)&&l(e._view.edgeFramebuffer)){let V=e._view.edgeFramebuffer.colorTexture;l(V)?e.context.uniformState.edgeColorTexture=V:e.context.uniformState.edgeColorTexture=e.context.defaultTexture;let B=e._view.edgeFramebuffer.idTexture;l(B)?e.context.uniformState.edgeIdTexture=B:e.context.uniformState.edgeIdTexture=e.context.defaultTexture;let j=e._view.edgeFramebuffer.depthTexture;l(j)?e.context.uniformState.edgeDepthTexture=j:e.context.uniformState.edgeDepthTexture=e.context.defaultTexture}else e.context.uniformState.edgeColorTexture=e.context.defaultTexture,e.context.uniformState.edgeIdTexture=e.context.defaultTexture,e.context.uniformState.edgeDepthTexture=e.context.defaultTexture;if(Mzt(e,t,P),e._enablePlanarFillId&&l(e._view)&&l(e._view.planarFillIdFramebuffer)){let V=e._view.planarFillIdFramebuffer.idTexture;o.planarFillIdTexture=l(V)?V:i.defaultTexture}else o.planarFillIdTexture=i.defaultTexture;if(!g||c||f)M=L(P,Ie.CESIUM_3D_TILE),M>0&&(p&&(y.prepareColorTextures(i,u),y.executeUpdateDepth(i,t,y.depthStencilTexture)),f||(M=L(P,Ie.CESIUM_3D_TILE_CLASSIFICATION)));else{e._invertClassification.clear(i,t);let V=t.framebuffer;t.framebuffer=e._invertClassification._fbo.framebuffer,L(P,Ie.CESIUM_3D_TILE),p&&(e._invertClassification.prepareTextures(i),y.executeUpdateDepth(i,t,e._invertClassification._fbo.getDepthStencilTexture())),M=L(P,Ie.CESIUM_3D_TILE_CLASSIFICATION_IGNORE_SHOW),t.framebuffer=V,e._invertClassification.executeClassified(i,t),r.invertClassificationColor.alpha===1&&e._invertClassification.executeUnclassified(i,t),M>0&&i.stencilBuffer&&I.execute(i,t),M=L(P,Ie.CESIUM_3D_TILE_CLASSIFICATION)}if(M>0&&i.stencilBuffer&&S.execute(i,t),Tzt(e,t,P),L(P,Ie.OPAQUE),Nzt(e,t,P),Ezt(e,t,P),w!==0&&e.mode!==re.SCENE2D&&(s.near=P.near,o.updateFrustum(s)),Dzt(e,t,P),Rzt(e,t,P),i.depthTexture&&e.useDepthPicking&&(p||f)){let V=e._picking.getPickDepth(e,w);V.update(i,y.depthStencilTexture),V.executeCopyDepth(i,t)}if(c||!m)continue;let F=t.framebuffer;t.framebuffer=b.getIdFramebuffer(),s.near=w!==0?P.near*e.opaqueFrustumNearOffset:P.near,s.far=P.far,o.updateFrustum(s),E.translucent?(o.updatePass(Ie.GLOBE),E.executeGlobeCommands(P,DBe,A,e,t)):_(P,Ie.GLOBE),u&&(v.framebuffer=t.framebuffer,v.execute(i,t),v.framebuffer=void 0),u&&d&&R.execute(i,t),_(P,Ie.CESIUM_3D_TILE),_(P,Ie.OPAQUE),_(P,Ie.TRANSLUCENT),t.framebuffer=F}}function Lzt(e,t){let{context:n,environmentState:i,view:r}=e;if(n.uniformState.updatePass(Ie.ENVIRONMENT),l(i.skyBoxCommand)&&Tu(i.skyBoxCommand,e,t),i.isSkyAtmosphereVisible&&Tu(i.skyAtmosphereCommand,e,t),i.isSunVisible&&(i.sunDrawCommand.execute(n,t),e.sunBloom&&!i.useWebVR)){let s;i.useGlobeDepthFramebuffer?s=r.globeDepth.framebuffer:i.usePostProcess?s=r.sceneFramebuffer.framebuffer:s=i.originalFramebuffer,e._sunPostProcess.execute(n),e._sunPostProcess.copy(n,s),t.framebuffer=s}i.isMoonVisible&&i.moonCommand.execute(n,t);let o=e.frameState.panoramaCommandList;for(let s=o.length-1;s>=0;s--){let a=o[s];l(a.shaderProgram)?Tu(o[s],e,t):o.splice(s,1)}}function LBe(e){e.context.uniformState.updatePass(Ie.COMPUTE);let t=e._environmentState.sunComputeCommand;l(t)&&t.execute(e._computeEngine);let n=e._computeCommandList;for(let i=0;i<n.length;++i)n[i].execute(e._computeEngine)}function Fzt(e,t){e.context.uniformState.updatePass(Ie.OVERLAY);let n=e.context,i=e._overlayCommandList;for(let r=0;r<i.length;++r)i[r].execute(n,t)}function Bzt(e,t,n){let{shadowMapCullingVolume:i,isPointLight:r,passes:o}=n,s=o.length,a=[Ie.GLOBE,Ie.CESIUM_3D_TILE,Ie.OPAQUE,Ie.TRANSLUCENT];for(let c=0;c<t.length;++c){let u=t[c];if(e.updateDerivedCommands(u),!(!u.castShadows||a.indexOf(u.pass)<0||!e.isVisible(i,u)))if(r)for(let f=0;f<s;++f)o[f].commandList.push(u);else if(s===1)o[0].commandList.push(u);else{let f=!1;for(let d=s-1;d>=0;--d){let p=o[d].cullingVolume;if(e.isVisible(p,u))o[d].commandList.push(u),f=!0;else if(f)break}}}}function FBe(e){let{shadowState:t,commandList:n}=e.frameState,{shadowsEnabled:i,shadowMaps:r}=t;if(!i)return;let{context:o}=e,{uniformState:s}=o;for(let a=0;a<r.length;++a){let c=r[a];if(c.outOfView)continue;let{passes:u}=c;for(let f=0;f<u.length;++f)u[f].commandList.length=0;Bzt(e,n,c);for(let f=0;f<u.length;++f){let d=c.passes[f],{camera:p,commandList:g}=d;s.updateCamera(p),c.updatePass(o,f);for(let m=0;m<g.length;++m){let y=g[m];s.updatePass(y.pass);let A=y.derivedCommands.shadows.castCommands[a];Tu(A,e,d.passState)}}}}var kzt=new h;Ai.prototype.updateAndExecuteCommands=function(e,t){Zzt(this,e,t),this._environmentState.useWebVR?Uzt(this,e,t):this._frameState.mode!==re.SCENE2D||this._mapMode2D===Au.ROTATE?Bb(!0,this,e):Xzt(this,e)};function Uzt(e,t){let n=e._view,i=n.camera,o=e._environmentState.renderTranslucentDepthForPick;kBe(e),n.createPotentiallyVisibleSet(e),LBe(e),o||FBe(e);let s=t.viewport;s.x=0,s.y=0,s.width=s.width*.5;let a=Or.clone(i,e._cameraVR);a.frustum=i.frustum;let c=i.frustum.near,u=c*(e.focalLength??5),f=e.eyeSeparation??u/30,d=h.multiplyByScalar(a.right,f*.5,kzt);i.frustum.aspectRatio=s.width/s.height;let p=.5*f*c/u;h.add(a.position,d,i.position),i.frustum.xOffset=p,Wse(e,t),s.x=s.width,h.subtract(a.position,d,i.position),i.frustum.xOffset=-p,Wse(e,t),Or.clone(a,i)}var zzt=new he(Math.PI,D.PI_OVER_TWO),Vzt=new h,jzt=new h,Hzt=new N,Gzt=new N,Wzt=new h,qzt=new h,Yzt=new et;function Xzt(e,t){let{frameState:n,camera:i}=e,{uniformState:r}=e.context,o=t.viewport,s=et.clone(o,Yzt);t.viewport=s;let a=zzt,c=Vzt;e.mapProjection.project(a,c);let f=h.clone(i.position,jzt),d=N.clone(i.transform,Gzt),p=i.frustum.clone();i._setTransform(N.IDENTITY);let g=N.computeViewportTransformation(s,0,1,Hzt),m=i.frustum.projectionMatrix,y=i.positionWC.y,A=h.fromElements(D.sign(y)*c.x-y,0,-i.positionWC.x,Wzt),b=At.pointToGLWindowCoordinates(m,g,A,qzt);b.x=Math.floor(b.x);let x=s.x,T=s.width;if(y===0||b.x<=x||b.x>=x+T)Bb(!0,e,t);else if(Math.abs(x+T*.5-b.x)<1)s.width=b.x-s.x,i.position.x*=D.sign(i.position.x),i.frustum.right=0,n.cullingVolume=i.frustum.computeCullingVolume(i.positionWC,i.directionWC,i.upWC),r.update(n),Bb(!0,e,t),s.x=b.x,i.position.x=-i.position.x,i.frustum.right=-i.frustum.left,i.frustum.left=0,n.cullingVolume=i.frustum.computeCullingVolume(i.positionWC,i.directionWC,i.upWC),r.update(n),Bb(!1,e,t);else if(b.x>x+T*.5){s.width=b.x-x;let E=i.frustum.right;i.frustum.right=c.x-y,n.cullingVolume=i.frustum.computeCullingVolume(i.positionWC,i.directionWC,i.upWC),r.update(n),Bb(!0,e,t),s.x=b.x,s.width=x+T-b.x,i.position.x=-i.position.x,i.frustum.left=-i.frustum.right,i.frustum.right=E-i.frustum.right*2,n.cullingVolume=i.frustum.computeCullingVolume(i.positionWC,i.directionWC,i.upWC),r.update(n),Bb(!1,e,t)}else{s.x=b.x,s.width=x+T-b.x;let E=i.frustum.left;i.frustum.left=-c.x-y,n.cullingVolume=i.frustum.computeCullingVolume(i.positionWC,i.directionWC,i.upWC),r.update(n),Bb(!0,e,t),s.x=x,s.width=b.x-x,i.position.x=-i.position.x,i.frustum.right=-i.frustum.left,i.frustum.left=E-i.frustum.left*2,n.cullingVolume=i.frustum.computeCullingVolume(i.positionWC,i.directionWC,i.upWC),r.update(n),Bb(!1,e,t)}i._setTransform(d),h.clone(f,i.position),i.frustum=p.clone(),t.viewport=o}function Bb(e,t,n){let i=t._view,{renderTranslucentDepthForPick:r}=t._environmentState;e||(t.frameState.commandList.length=0),kBe(t),i.createPotentiallyVisibleSet(t),e&&(LBe(t),r||FBe(t)),Wse(t,n)}var OBe=new ta;function BBe(e,t,n){if(!e.show)return;let i=e.length;for(let r=0;r<i;++r){let o=e.get(r);if(o instanceof xl){BBe(o,t,n);continue}o.show&&f_.isSupported(o)&&As(o.heightReference)&&t.markForFrame(o,n,o.heightReference)}}function Kzt(e,t){let n=e.vectorProvider;if(!l(n))return;let i=t.frameNumber;BBe(e._primitives,n,i)}Ai.prototype.updateEnvironment=function(){let e=this._frameState,t=this._view,n=this._environmentState,i=e.passes.render,r=e.passes.offscreen,o=this.atmosphere,s=this.skyAtmosphere,a=this.globe,c=this._globeTranslucencyState;if(!i||this._mode!==re.SCENE2D&&t.camera.frustum instanceof gn||!c.environmentVisible)n.skyAtmosphereCommand=void 0,n.skyBoxCommand=void 0,n.sunDrawCommand=void 0,n.sunComputeCommand=void 0,n.moonCommand=void 0;else{if(l(s)){if(l(a))s.setDynamicLighting(Vg.fromGlobeFlags(a)),n.isReadyForAtmosphere=n.isReadyForAtmosphere||!a.show||a._surface._tilesToRender.length>0;else{let b=o.dynamicLighting;s.setDynamicLighting(b),n.isReadyForAtmosphere=!0}n.skyAtmosphereCommand=s.update(e,a),l(n.skyAtmosphereCommand)&&this.updateDerivedCommands(n.skyAtmosphereCommand)}else n.skyAtmosphereCommand=void 0;n.skyBoxCommand=l(this.skyBox)?this.skyBox.update(e,this._hdr):void 0;let A=l(this.sun)?this.sun.update(e,t.passState,this._hdr):void 0;n.sunDrawCommand=l(A)?A.drawCommand:void 0,n.sunComputeCommand=l(A)?A.computeCommand:void 0,n.moonCommand=l(this.moon)?this.moon.update(e):void 0}let u=n.clearGlobeDepth=l(a)&&a.show&&(!a.depthTestAgainstTerrain||this.mode===re.SCENE2D);(n.useDepthPlane=u&&this.mode===re.SCENE3D&&c.useDepthPlane)&&this._depthPlane.update(e),n.renderTranslucentDepthForPick=!1,n.useWebVR=this._useWebVR&&this.mode!==re.SCENE2D&&!r;let d=e.mode===re.SCENE3D&&!c.sunVisibleThroughGlobe?e.occluder:void 0,p=e.cullingVolume,g=OBe.planes;for(let A=0;A<5;++A)g[A]=p.planes[A];p=OBe,n.isSkyAtmosphereVisible=l(n.skyAtmosphereCommand)&&n.isReadyForAtmosphere,n.isSunVisible=this.isVisible(p,n.sunDrawCommand,d),n.isMoonVisible=this.isVisible(p,n.moonCommand,d);let m=this.specularEnvironmentMaps,y=this._specularEnvironmentCubeMap;l(m)&&y?.url!==m?(l(y)&&y.destroy(),this._specularEnvironmentCubeMap=new rm(m)):!l(m)&&l(y)&&(y.destroy(),this._specularEnvironmentCubeMap=void 0),l(this._specularEnvironmentCubeMap)&&this._specularEnvironmentCubeMap.update(e),Kzt(this,e)};function $zt(e){let t=e._frameState;e.debugShowFrustumPlanes!==e._debugShowFrustumPlanes&&(e.debugShowFrustumPlanes?e._debugFrustumPlanes=new F0({camera:e.camera,updateOnChange:!1,frustumSplits:t.frustumSplits}):e._debugFrustumPlanes=e._debugFrustumPlanes&&e._debugFrustumPlanes.destroy(),e._debugShowFrustumPlanes=e.debugShowFrustumPlanes),l(e._debugFrustumPlanes)&&e._debugFrustumPlanes.update(t)}function Jzt(e){let t=e._frameState,{passes:n,shadowState:i,shadowMaps:r}=t,o=r.length,s=o>0&&!n.pick&&!n.pickVoxel&&e.mode===re.SCENE3D;if(s!==i.shadowsEnabled&&(++i.lastDirtyTime,i.shadowsEnabled=s),i.lightShadowsEnabled=!1,!!s){for(let a=0;a<o;++a)if(r[a]!==i.shadowMaps[a]){++i.lastDirtyTime;break}i.shadowMaps.length=0,i.lightShadowMaps.length=0;for(let a=0;a<o;++a){let c=r[a];c.update(t),i.shadowMaps.push(c),c.fromLightSource&&(i.lightShadowMaps.push(c),i.lightShadowsEnabled=!0),c.dirty&&(++i.lastDirtyTime,c.dirty=!1)}}}function kBe(e){let t=e._frameState;t.edgeVisibilityRequested=!1,t.planarFillRequested=!1,e._groundPrimitives.update(t),e._primitives.update(t),t.edgeVisibilityRequested&&e._enableEdgeVisibility===!1&&(e._enableEdgeVisibility=!0),e._enablePlanarFillId=t.planarFillRequested,$zt(e),Jzt(e),e._globe&&e._globe.render(t)}function Zzt(e,t,n){let i=e._context,r=e._frameState,o=e._environmentState,s=e._view,a=r.passes,c=a.pick||a.pickVoxel;l(s.globeDepth)&&(s.globeDepth.picking=c,s.globeDepth.snapping=a.snap);let u=o.useWebVR;o.originalFramebuffer=t.framebuffer,l(e.sun)&&e.sunBloom!==e._sunBloom?(e.sunBloom&&!u?e._sunPostProcess=new NV:l(e._sunPostProcess)&&(e._sunPostProcess=e._sunPostProcess.destroy()),e._sunBloom=e.sunBloom):!l(e.sun)&&l(e._sunPostProcess)&&(e._sunPostProcess=e._sunPostProcess.destroy(),e._sunBloom=!1);let f=e._clearColorCommand;z.clone(n,f.color),f.execute(i,t);let d=o.useGlobeDepthFramebuffer=l(s.globeDepth);d&&(s.globeDepth.update(i,t,s.viewport,e.msaaSamples,e._hdr,o.clearGlobeDepth),s.globeDepth.clear(i,t,n));let p=s.oit,g=o.useOIT=!c&&l(p)&&p.isSupported();g&&(p.update(i,t,s.globeDepth.colorFramebufferManager,e._hdr,e.msaaSamples),p.clear(i,t,n),o.useOIT=p.isSupported());let m=e.postProcessStages,y=o.usePostProcess=!c&&(e._hdr||m.length>0||m.ambientOcclusion.enabled||m.fxaa.enabled||m.bloom.enabled);o.usePostProcessSelected=!1,y&&(s.sceneFramebuffer.update(i,s.viewport,e._hdr,e.msaaSamples),s.sceneFramebuffer.clear(i,t,n),m.update(i,r.useLogDepth,e._hdr),m.clear(i),y=o.usePostProcess=m.ready,o.usePostProcessSelected=y&&m.hasSelected),o.isSunVisible&&e.sunBloom&&!u?(t.framebuffer=e._sunPostProcess.update(t),e._sunPostProcess.clear(i,t,n)):d?t.framebuffer=s.globeDepth.framebuffer:y&&(t.framebuffer=s.sceneFramebuffer.framebuffer),l(t.framebuffer)&&f.execute(i,t);let A=o.useInvertClassification=!c&&l(t.framebuffer)&&e.invertClassification;if(!c&&e._enableEdgeVisibility&&s.edgeFramebuffer.update(i,s.viewport,e._hdr),!c&&e._enablePlanarFillId?s.planarFillIdFramebuffer.update(i,s.viewport,e._hdr):c||s.planarFillIdFramebuffer.releaseResources(),A){let T;if(r.invertClassificationColor.alpha===1&&d&&(T=s.globeDepth.framebuffer),l(T)||i.depthTexture){if(e._invertClassification.previousFramebuffer=T,e._invertClassification.update(i,e.msaaSamples,s.globeDepth.colorFramebufferManager),e._invertClassification.clear(i,t),r.invertClassificationColor.alpha<1&&g){let E=e._invertClassification.unclassifiedCommand,v=E.derivedCommands;v.oit=p.createDerivedCommands(E,i,v.oit)}}else o.useInvertClassification=!1}e._globeTranslucencyState.translucent&&s.globeTranslucencyFramebuffer.updateAndClear(e._hdr,s.viewport,i,t)}Ai.prototype.resolveFramebuffers=function(e){let t=this._context,n=this._environmentState,i=this._view,{globeDepth:r,translucentTileClassification:o}=i;l(r)&&r.prepareColorTextures(t);let{useOIT:s,useGlobeDepthFramebuffer:a,usePostProcess:c,originalFramebuffer:u}=n,f=a?r.colorFramebufferManager:void 0,d=i.sceneFramebuffer._colorFramebuffer,p=i.sceneFramebuffer.idFramebuffer;if(s&&(e.framebuffer=c?d.framebuffer:u,i.oit.execute(t,e)),o.hasTranslucentDepth&&o.isSupported()&&o.execute(this,e),c){i.sceneFramebuffer.prepareColorTextures(t);let g=d;a&&!s&&(g=f);let m=this.postProcessStages,y=g.getColorTexture(0),A=p.getColorTexture(0),b=(f??d).getDepthStencilTexture();m.execute(t,y,b,A),m.copy(t,u)}!s&&!c&&a&&(e.framebuffer=u,r.executeCopyColor(t,e))};function Qzt(e){let t=e._frameState.afterRender,n=t.slice();t.length=0;for(let i=0;i<n.length;++i)n[i]()&&e.requestRender()}function eVt(e){if(e.mode===re.MORPHING)return;let t=e.camera.positionCartographic;return e.getHeight(t)}function UBe(e,t,n){let i=Number.NEGATIVE_INFINITY;if(e instanceof xl){let r=e.length;for(let o=0;o<r;++o){let s=e.get(o),a=UBe(s,t,n);l(a)&&a>i&&(i=a)}}else if(e.isCesium3DTileset&&e.show&&e.enableCollision){let r=e.getHeight(t,n);if(l(r)&&r>i)return r}return i}Ai.prototype.getHeight=function(e,t){if(!l(e))return;let n=this._frameState.frameNumber;this._heightQueryFrame!==n&&(this._heightQueryFrame=n,this._heightQueryCache.clear());let i=`${t}:${e.longitude.toFixed(8)}:${e.latitude.toFixed(8)}`,r=this._heightQueryCache.get(i);if(r!==void 0)return r===null?void 0:r;let o=tVt(this,e,t);return this._heightQueryCache.set(i,o===void 0?null:o),o};function tVt(e,t,n){let i=n===We.CLAMP_TO_TERRAIN||n===We.RELATIVE_TO_TERRAIN,r=n===We.CLAMP_TO_3D_TILE||n===We.RELATIVE_TO_3D_TILE;if(!l(t))return;let o=Number.NEGATIVE_INFINITY;if(!i){let a=UBe(e.primitives,t,e);l(a)&&a>o&&(o=a)}let s=e._globe;if(!r&&l(s)&&s.show){let a=s.getHeight(t);a>o&&(o=a)}if(o>Number.NEGATIVE_INFINITY)return o}var Gse=new he;Ai.prototype.updateHeight=function(e,t,n){let i=this._ellipsoid,r=g=>{he.clone(e,Gse);let m;l(g)&&(m=g.height),l(m)||(m=this.getHeight(e,n)),l(m)&&(Gse.height=m,t(Gse))},o=n===We.CLAMP_TO_TERRAIN||n===We.RELATIVE_TO_TERRAIN,s=n===We.CLAMP_TO_3D_TILE||n===We.RELATIVE_TO_3D_TILE,a;!s&&l(this.globe)&&(a=this.globe._surface.updateHeight(e,r));let c={},u=g=>{if(o||g.isDestroyed()||!g.isCesium3DTileset)return;let m=g.updateHeight(e,r,i);c[g.id]=m};if(!o){let g=this.primitives.length;for(let m=0;m<g;++m){let y=this.primitives.get(m);u(y)}}let f=this.primitives.primitiveAdded.addEventListener(u),d=this.primitives.primitiveRemoved.addEventListener(g=>{g.isDestroyed()||!g.isCesium3DTileset||(l(c[g.id])&&c[g.id](),delete c[g.id])});return()=>{a=a&&a(),Object.values(c).forEach(g=>g()),c={},f(),d()}};function nVt(e){let t=e.camera,n=e._mode,i=e._screenSpaceCameraController,r=t.positionCartographic;if(!l(r))return!1;if(!i.onMap()&&r.height<0)return!0;if(n===re.SCENE2D||n===re.MORPHING)return!1;let o=e._globeHeight;return l(o)&&r.height<o}Ai.prototype.initializeFrame=function(){if(this._shaderFrameCount++===120&&(this._shaderFrameCount=0,this._context.shaderCache.destroyReleasedShaderPrograms(),this._context.textureCache.destroyReleasedTextures()),this._tweens.update(),this._globeHeightDirty){l(this._removeUpdateHeightCallback)&&(this._removeUpdateHeightCallback(),this._removeUpdateHeightCallback=void 0),this._globeHeight=eVt(this),this._globeHeightDirty=!1;let e=this.camera.positionCartographic;this._removeUpdateHeightCallback=this.updateHeight(e,t=>{this.isDestroyed()||(this._globeHeight=t.height)})}this._cameraUnderground=nVt(this),this._globeTranslucencyState.update(this),this._screenSpaceCameraController.update(),l(this._deviceOrientationCameraController)&&this._deviceOrientationCameraController.update(),this.camera.update(this._mode),this.camera._updateCameraChanged()};function iVt(e,t){if(e.debugShowFramesPerSecond){if(!l(e._performanceDisplay)){let n=document.createElement("div");n.className="cesium-performanceDisplay-defaultContainer",e._canvas.parentNode.appendChild(n);let r=new ny({container:n});e._performanceDisplay=r,e._performanceContainer=n}e._performanceDisplay.throttled=e.requestRenderMode,e._performanceDisplay.update(t)}else l(e._performanceDisplay)&&(e._performanceDisplay=e._performanceDisplay&&e._performanceDisplay.destroy(),e._performanceContainer.parentNode.removeChild(e._performanceContainer))}function rVt(e){e._jobScheduler.resetBudgets();let t=e._frameState;e.primitives.prePassesUpdate(t),l(e.globe)&&e.globe.update(t),e._picking.update(),t.creditDisplay.update()}function oVt(e){e.primitives.postPassesUpdate(e._frameState),Kc.update()}var sVt=new z;function aVt(e){let t=e._frameState,n=e.context,{uniformState:i}=n,r=e._defaultView;e._view=r,e.updateFrameState(),t.passes.render=!0,t.passes.postProcess=e.postProcessStages.hasSelected,t.tilesetPassState=hzt;let o=e.backgroundColor??z.BLACK;e._hdr&&(o=z.clone(o,sVt),o.red=Math.pow(o.red,e.gamma),o.green=Math.pow(o.green,e.gamma),o.blue=Math.pow(o.blue,e.gamma)),t.backgroundColor=o,t.atmosphere=e.atmosphere,e.fog.update(t),i.update(t);let s=e.shadowMap;l(s)&&s.enabled&&(!l(e.light)||e.light instanceof dg?h.negate(i.sunDirectionWC,e._shadowMapCamera.direction):h.clone(e.light.direction,e._shadowMapCamera.direction),t.shadowMaps.push(s)),e._computeCommandList.length=0,e._overlayCommandList.length=0;let a=r.viewport;a.x=0,a.y=0,a.width=n.drawingBufferWidth,a.height=n.drawingBufferHeight;let c=r.passState;c.framebuffer=void 0,c.blendingEnabled=void 0,c.scissorTest=void 0,c.viewport=et.clone(a,c.viewport),n.beginFrame(),l(e.globe)&&e.globe.beginFrame(t),e.updateEnvironment(),e.updateAndExecuteCommands(c,o),e.resolveFramebuffers(c),c.framebuffer=void 0,Fzt(e,c),l(e.globe)&&(e.globe.endFrame(t),e.globe.tilesLoaded||(e._renderRequested=!0)),n.endFrame()}function PC(e,t){try{t(e)}catch(n){if(e._renderError.raiseEvent(e,n),e.rethrowRenderErrors)throw n}}function cVt(e){return e._picking.updateMostDetailedRayPicks(e)}Ai.prototype.render=function(e){this._preUpdate.raiseEvent(this,e);let t=this._frameState;t.newFrame=!1,l(e)||(e=K.now()),this._controllerHost.update(this,e);let n=this._view.checkForCameraUpdates(this);n&&(this._globeHeightDirty=!0);let i=!this.requestRenderMode||this._renderRequested||n||this._logDepthBufferDirty||this._hdrDirty||this.mode===re.MORPHING;if(!i&&l(this.maximumRenderTimeChange)&&l(this._lastRenderTime)){let r=Math.abs(K.secondsDifference(this._lastRenderTime,e));i=i||r>this.maximumRenderTimeChange}if(i){this._lastRenderTime=K.clone(e,this._lastRenderTime),this._renderRequested=!1,this._logDepthBufferDirty=!1,this._hdrDirty=!1;let r=D.incrementWrap(t.frameNumber,VA.maximumFrameNumber,1);MBe(this,r,e),t.newFrame=!0}PC(this,rVt),this.primitives.show&&(PC(this,cVt),PC(this,lVt),PC(this,uVt),i||PC(this,fVt)),this._postUpdate.raiseEvent(this,e),i&&(this._preRender.raiseEvent(this,e),t.creditDisplay.beginFrame(),PC(this,aVt)),iVt(this,i),PC(this,oVt),Qzt(this),i&&(this._postRender.raiseEvent(this,e),t.creditDisplay.endFrame())};Ai.prototype.forceRender=function(e){this._renderRequested=!0,this.render(e)};Ai.prototype.requestRender=function(){this._renderRequested=!0};Ai.prototype.clampLineWidth=function(e){return Math.max(kt.minimumAliasedLineWidth,Math.min(e,kt.maximumAliasedLineWidth))};Ai.prototype.pick=function(e,t,n){return this._picking.pick(this,e,t,n,1)[0]};Ai.prototype.snap=function(e,t){return RV.snap(this,e,t)};Ai.prototype.pickAsync=async function(e,t,n){return(await this._picking.pickAsync(this,e,t,n,1))[0]};Ai.prototype.pickVoxel=function(e,t,n){let i=this.pick(e,t,n);if(!l(i))return;let r=i.primitive;if(!(r instanceof Fb))return;let o=this._picking.pickVoxelCoordinate(this,e,t,n),s=255*o[0]+o[1],a=r._traversal.findKeyframeNode(s);if(!l(a))return;let c=255*o[2]+o[3];return BV.fromKeyframeNode(r,s,c,a)};Ai.prototype.pickMetadata=function(e,t,n,i){let r=this.pick(e);if(!l(r))return;let o=r.detail?.model?.structuralMetadata;if(!l(o))return;let s=o.schema,a=p4(s,t,n,i);if(!l(a))return;let c=_4(o,n,i);if(!l(c))return;let u=new g4(t,n,i,a,c);return this._picking.pickMetadata(this,e,u)};Ai.prototype.pickMetadataSchema=function(e){let t=this.pick(e);return l(t)?t.detail?.model?.structuralMetadata?.schema:void 0};Ai.prototype.pickPositionWorldCoordinates=function(e,t){return this._picking.pickPositionWorldCoordinates(this,e,t)};Ai.prototype.pickPosition=function(e,t){return this._picking.pickPosition(this,e,t)};Ai.prototype.drillPick=function(e,t,n,i){return this._picking.drillPick(this,e,t,n,i)};function lVt(e){let t=e._frameState;Vse.camera=t.camera,Vse.cullingVolume=t.cullingVolume,e.primitives.updateForPass(t,Vse)}function uVt(e){let t=e._frameState;if(!t.camera.canPreloadFlight())return;jse.camera=e.preloadFlightCamera,jse.cullingVolume=e.preloadFlightCullingVolume,e.primitives.updateForPass(t,jse)}function fVt(e){e.primitives.updateForPass(e._frameState,mzt)}Ai.prototype.pickFromRay=function(e,t,n){return this._picking.pickFromRay(this,e,t,n)};Ai.prototype.drillPickFromRay=function(e,t,n,i){return this._picking.drillPickFromRay(this,e,t,n,i)};Ai.prototype.pickFromRayMostDetailed=function(e,t,n){return this._picking.pickFromRayMostDetailed(this,e,t,n)};Ai.prototype.drillPickFromRayMostDetailed=function(e,t,n,i){return this._picking.drillPickFromRayMostDetailed(this,e,t,n,i)};Ai.prototype.sampleHeight=function(e,t,n){return this._picking.sampleHeight(this,e,t,n)};Ai.prototype.clampToHeight=function(e,t,n,i){return this._picking.clampToHeight(this,e,t,n,i)};Ai.prototype.sampleHeightMostDetailed=function(e,t,n){return this._picking.sampleHeightMostDetailed(this,e,t,n)};Ai.prototype.clampToHeightMostDetailed=function(e,t,n){return this._picking.clampToHeightMostDetailed(this,e,t,n)};Ai.prototype.cartesianToCanvasCoordinates=function(e,t){return dr.worldToWindowCoordinates(this,e,t)};Ai.prototype.completeMorph=function(){this._transitioner.completeMorph()};Ai.prototype.morphTo2D=function(e){e=e??2,this._transitioner.morphTo2D(e,this._ellipsoid)};Ai.prototype.morphToColumbusView=function(e){e=e??2,this._transitioner.morphToColumbusView(e,this._ellipsoid)};Ai.prototype.morphTo3D=function(e){e=e??2,this._transitioner.morphTo3D(e,this._ellipsoid)};function dVt(e,t){if(e._removeTerrainProviderReadyListener=e._removeTerrainProviderReadyListener&&e._removeTerrainProviderReadyListener(),t.ready){l(e.globe)&&(e.globe.terrainProvider=t.provider);return}e.globe.terrainProvider=void 0,e._removeTerrainProviderReadyListener=t.readyEvent.addEventListener(n=>{l(e)&&l(e.globe)&&(e.globe.terrainProvider=n),e._removeTerrainProviderReadyListener()})}Ai.prototype.setTerrain=function(e){return dVt(this,e),e};Ai.prototype.isDestroyed=function(){return!1};Ai.prototype.destroy=function(){this._tweens.removeAll(),this._computeEngine=this._computeEngine&&this._computeEngine.destroy(),this._screenSpaceCameraController=this._screenSpaceCameraController&&this._screenSpaceCameraController.destroy(),this._deviceOrientationCameraController=this._deviceOrientationCameraController&&!this._deviceOrientationCameraController.isDestroyed()&&this._deviceOrientationCameraController.destroy(),this._primitives=this._primitives&&this._primitives.destroy(),this._groundPrimitives=this._groundPrimitives&&this._groundPrimitives.destroy(),this._globe=this._globe&&this._globe.destroy(),this._removeTerrainProviderReadyListener=this._removeTerrainProviderReadyListener&&this._removeTerrainProviderReadyListener(),this.skyBox=this.skyBox&&this.skyBox.destroy(),this.skyAtmosphere=this.skyAtmosphere&&this.skyAtmosphere.destroy(),this._debugSphere=this._debugSphere&&this._debugSphere.destroy(),this.sun=this.sun&&this.sun.destroy(),this._sunPostProcess=this._sunPostProcess&&this._sunPostProcess.destroy(),this._depthPlane=this._depthPlane&&this._depthPlane.destroy(),this._transitioner=this._transitioner&&this._transitioner.destroy(),this._debugFrustumPlanes=this._debugFrustumPlanes&&this._debugFrustumPlanes.destroy(),this._brdfLutGenerator=this._brdfLutGenerator&&this._brdfLutGenerator.destroy(),this._picking=this._picking&&this._picking.destroy(),this._defaultView=this._defaultView&&this._defaultView.destroy(),this._view=void 0,this._removeCreditContainer&&this._canvas.parentNode.removeChild(this._creditContainer),this.postProcessStages=this.postProcessStages&&this.postProcessStages.destroy(),this._context=this._context&&this._context.destroy(),this._frameState.creditDisplay=this._frameState.creditDisplay&&this._frameState.creditDisplay.destroy(),l(this._performanceDisplay)&&(this._performanceDisplay=this._performanceDisplay&&this._performanceDisplay.destroy(),this._performanceContainer.parentNode.removeChild(this._performanceContainer)),this._removeRequestListenerCallback(),this._removeTaskProcessorListenerCallback();for(let e=0;e<this._removeGlobeCallbacks.length;++e)this._removeGlobeCallbacks[e]();return this._removeGlobeCallbacks.length=0,l(this._removeUpdateHeightCallback)&&(this._removeUpdateHeightCallback(),this._removeUpdateHeightCallback=void 0),le(this)};var y4=Ai;function wP(e){e=e??ee.WGS84,this.show=!0,this.perFragmentAtmosphere=!1,this._ellipsoid=e;let t=1.025,n=h.multiplyByScalar(e.radii,t,new h);this._scaleMatrix=N.fromScale(n),this._modelMatrix=new N,this._command=new at({owner:this,modelMatrix:this._modelMatrix}),this._spSkyFromSpace=void 0,this._spSkyFromAtmosphere=void 0,this._flags=void 0,this.atmosphereLightIntensity=50,this.atmosphereRayleighCoefficient=new h(55e-7,13e-6,284e-7),this.atmosphereMieCoefficient=new h(21e-6,21e-6,21e-6),this.atmosphereRayleighScaleHeight=1e4,this.atmosphereMieScaleHeight=3200,this.atmosphereMieAnisotropy=.9,this.hueShift=0,this.saturationShift=0,this.brightnessShift=0,this._hueSaturationBrightness=new h;let i=new h;i.x=e.maximumRadius*t,i.y=e.maximumRadius,i.z=0,this._radiiAndDynamicAtmosphereColor=i;let r=this;this._command.uniformMap={u_radiiAndDynamicAtmosphereColor:function(){return r._radiiAndDynamicAtmosphereColor},u_hsbShift:function(){return r._hueSaturationBrightness.x=r.hueShift,r._hueSaturationBrightness.y=r.saturationShift,r._hueSaturationBrightness.z=r.brightnessShift,r._hueSaturationBrightness},u_atmosphereLightIntensity:function(){return r.atmosphereLightIntensity},u_atmosphereRayleighCoefficient:function(){return r.atmosphereRayleighCoefficient},u_atmosphereMieCoefficient:function(){return r.atmosphereMieCoefficient},u_atmosphereRayleighScaleHeight:function(){return r.atmosphereRayleighScaleHeight},u_atmosphereMieScaleHeight:function(){return r.atmosphereMieScaleHeight},u_atmosphereMieAnisotropy:function(){return r.atmosphereMieAnisotropy}}}Object.defineProperties(wP.prototype,{ellipsoid:{get:function(){return this._ellipsoid}}});wP.prototype.setDynamicLighting=function(e){this._radiiAndDynamicAtmosphereColor.z=e};var qse=new N;wP.prototype.update=function(e,t){if(!this.show)return;let n=e.mode;if(n!==re.SCENE3D&&n!==re.MORPHING||!e.passes.render)return;let i=N.fromRotationTranslation(e.context.uniformState.inverseViewRotation,h.ZERO,qse),r=N.multiplyTransformation(i,Hi.Y_UP_TO_Z_UP,qse),o=N.multiply(this._scaleMatrix,r,qse);N.clone(o,this._modelMatrix);let s=e.context,a=hVt(this),c=e.globeTranslucencyState.translucent,u=this.perFragmentAtmosphere||c||!l(t)||!t.show,f=this._command;if(!l(f.vertexArray)){let p=Xa.createGeometry(new Xa({radii:new h(1,1,1),slicePartitions:256,stackPartitions:256,vertexFormat:Be.POSITION_ONLY}));f.vertexArray=zn.fromGeometry({context:s,geometry:p,attributeLocations:Hn.createAttributeLocations(p),bufferUsage:Me.STATIC_DRAW}),f.renderState=Ge.fromCache({cull:{enabled:!0,face:Vi.FRONT},blending:tn.ALPHA_BLEND,depthMask:!1})}let d=a|u<<2|c<<3;if(d!==this._flags){this._flags=d;let p=[];a&&p.push("COLOR_CORRECT"),u&&p.push("PER_FRAGMENT_ATMOSPHERE"),c&&p.push("GLOBE_TRANSLUCENT");let g=new Ye({defines:p,sources:[Yh,Rv,bM]}),m=new Ye({defines:p,sources:[Yh,Rv,AM]});this._spSkyAtmosphere=Qt.fromCache({context:s,vertexShaderSource:g,fragmentShaderSource:m}),f.shaderProgram=this._spSkyAtmosphere}return f};function hVt(e){return!(D.equalsEpsilon(e.hueShift,0,D.EPSILON7)&&D.equalsEpsilon(e.saturationShift,0,D.EPSILON7)&&D.equalsEpsilon(e.brightnessShift,0,D.EPSILON7))}wP.prototype.isDestroyed=function(){return!1};wP.prototype.destroy=function(){let e=this._command;return e.vertexArray=e.vertexArray&&e.vertexArray.destroy(),this._spSkyAtmosphere=this._spSkyAtmosphere&&this._spSkyAtmosphere.destroy(),le(this)};var A4=wP;function b4(e){this.sources=e.sources,this._sources=void 0,this._transform=e.transform,this.show=e.show??!0,this._returnCommand=e.returnCommand??!1,this._addToPanoramaCommandList=!this._returnCommand,this._command=new at({modelMatrix:N.clone(N.IDENTITY),owner:this,pass:Ie.ENVIRONMENT}),this._cubeMap=void 0,this._attributeLocations=void 0,this._useHdr=void 0,this._hasError=!1,this._error=void 0;let t=e.credit;typeof t=="string"&&(t=new It(t)),this._credit=t}Object.defineProperties(b4.prototype,{transform:{get:function(){return this._transform}},credit:{get:function(){return l(this._credit)?this._credit:void 0}}});b4.prototype.update=function(e,t){let n=this,{mode:i,passes:r,context:o,panoramaCommandList:s}=e;if(!this.show||i!==re.SCENE3D&&i!==re.MORPHING||!r.render)return;if(this._hasError){let c=this._error;throw this._hasError=!1,this._error=void 0,c}if(this._sources!==this.sources){this._sources=this.sources;let c=this.sources;typeof c.positiveX=="string"?DO(o,this._sources).then(function(u){n._cubeMap=n._cubeMap&&n._cubeMap.destroy(),n._cubeMap=u}).catch(u=>{this._hasError=!0,this._error=u}):(this._cubeMap=this._cubeMap&&this._cubeMap.destroy(),this._cubeMap=new ns({context:o,source:c})),this._addToPanoramaCommandList=!0}let a=this._command;if(!l(a.vertexArray)){a.uniformMap={u_cubeMap:function(){return n._cubeMap},u_cubeMapPanoramaTransform:function(){return n._transform}};let c=Ic.createGeometry(Ic.fromDimensions({dimensions:new h(2,2,2),vertexFormat:Be.POSITION_ONLY})),u=this._attributeLocations=Hn.createAttributeLocations(c);a.vertexArray=zn.fromGeometry({context:o,geometry:c,attributeLocations:u,bufferUsage:Me.STATIC_DRAW}),a.renderState=Ge.fromCache({depthTest:{enabled:!1},depthMask:!1,blending:tn.ALPHA_BLEND}),this._addToPanoramaCommandList=!0}if(!l(a.shaderProgram)||this._useHdr!==t){let c=new Ye({defines:[t?"HDR":""],sources:[xM]});a.shaderProgram=Qt.fromCache({context:o,vertexShaderSource:l(this._transform)?nM:TM,fragmentShaderSource:c,attributeLocations:this._attributeLocations}),this._useHdr=t,this._addToPanoramaCommandList=!0}if(l(this._cubeMap)){if(this.show&&l(this._credit)&&!this._returnCommand&&e.creditDisplay.addCreditToNextFrame(this._credit),this._returnCommand)return a;this._addToPanoramaCommandList&&(s.push(a),this._addToPanoramaCommandList=!1)}};b4.prototype.isDestroyed=function(){return!1};b4.prototype.destroy=function(){let e=this._command;return e.vertexArray=e.vertexArray&&e.vertexArray.destroy(),e.shaderProgram=e.shaderProgram&&e.shaderProgram.destroy(),this._cubeMap=this._cubeMap&&this._cubeMap.destroy(),le(this)};var DC=b4;function RC(e){this._sources=e.sources,this._show=e.show??!0,this._panorama=new DC({sources:this._sources,show:this._show,returnCommand:!0})}Object.defineProperties(RC.prototype,{sources:{get:function(){return this._panorama.sources},set:function(e){this._panorama.sources=e}},show:{get:function(){return this._panorama.show},set:function(e){this._panorama.show=e}}});RC.prototype.update=function(e,t){let{mode:n,passes:i}=e;if(!(n!==re.SCENE3D&&n!==re.MORPHING)&&i.render)return this._panorama.update(e,t)};RC.prototype.isDestroyed=function(){return!1};RC.prototype.destroy=function(){return this._panorama=this._panorama&&this._panorama.destroy(),le(this)};function IP(e){return Zt(`Assets/Textures/SkyBox/tycho2t3_80_${e}.jpg`)}RC.createEarthSkyBox=function(){return new RC({sources:{positiveX:IP("px"),negativeX:IP("mx"),positiveY:IP("py"),negativeY:IP("my"),positiveZ:IP("pz"),negativeZ:IP("mz")}})};var x4=RC;function E4(){this.show=!0,this._drawCommand=new at({primitiveType:Oe.TRIANGLES,boundingVolume:new ue,owner:this}),this._commands={drawCommand:this._drawCommand,computeCommand:void 0},this._boundingVolume=new ue,this._boundingVolume2D=new ue,this._texture=void 0,this._drawingBufferWidth=void 0,this._drawingBufferHeight=void 0,this._radiusTS=void 0,this._size=void 0,this.glowFactor=1,this._glowFactorDirty=!1,this._useHdr=void 0;let e=this;this._uniformMap={u_texture:function(){return e._texture},u_size:function(){return e._size}}}Object.defineProperties(E4.prototype,{glowFactor:{get:function(){return this._glowFactor},set:function(e){e=Math.max(e,0),this._glowFactor=e,this._glowFactorDirty=!0}}});var mVt=new U,pVt=new U,gVt=new se,T4=new se;E4.prototype.update=function(e,t,n){if(!this.show)return;let i=e.mode;if(i===re.SCENE2D||i===re.MORPHING||!e.passes.render)return;let r=e.context,o=t.viewport.width,s=t.viewport.height;if(!l(this._texture)||o!==this._drawingBufferWidth||s!==this._drawingBufferHeight||this._glowFactorDirty||n!==this._useHdr){this._texture=this._texture&&this._texture.destroy(),this._drawingBufferWidth=o,this._drawingBufferHeight=s,this._glowFactorDirty=!1,this._useHdr=n;let E=Math.max(o,s);E=Math.pow(2,Math.ceil(Math.log(E)/Math.log(2))-2),E=Math.max(1,E);let v=n?r.halfFloatingPointTexture?ze.HALF_FLOAT:ze.FLOAT:ze.UNSIGNED_BYTE;this._texture=new Dt({context:r,width:E,height:E,pixelFormat:Ke.RGBA,pixelDatatype:v}),this._glowLengthTS=this._glowFactor*5,this._radiusTS=1/(1+2*this._glowLengthTS)*.5;let S=this,I={u_radiusTS:function(){return S._radiusTS}};this._commands.computeCommand=new xf({fragmentShaderSource:CM,outputTexture:this._texture,uniformMap:I,persists:!1,owner:this,postExecute:function(){S._commands.computeCommand=void 0}})}let a=this._drawCommand;if(!l(a.vertexArray)){let E={direction:0},v=new Uint8Array(8);v[0]=0,v[1]=0,v[2]=255,v[3]=0,v[4]=255,v[5]=255,v[6]=0,v[7]=255;let S=tt.createVertexBuffer({context:r,typedArray:v,usage:Me.STATIC_DRAW}),I=[{index:E.direction,vertexBuffer:S,componentsPerAttribute:2,normalize:!0,componentDatatype:Y.UNSIGNED_BYTE}],R=tt.createIndexBuffer({context:r,typedArray:new Uint16Array([0,1,2,0,2,3]),usage:Me.STATIC_DRAW,indexDatatype:je.UNSIGNED_SHORT});a.vertexArray=new zn({context:r,attributes:I,indexBuffer:R}),a.shaderProgram=Qt.fromCache({context:r,vertexShaderSource:vM,fragmentShaderSource:EM,attributeLocations:E}),a.renderState=Ge.fromCache({blending:tn.ALPHA_BLEND}),a.uniformMap=this._uniformMap}let c=r.uniformState.sunPositionWC,u=r.uniformState.sunPositionColumbusView,f=this._boundingVolume,d=this._boundingVolume2D;h.clone(c,f.center),d.center.x=u.z,d.center.y=u.x,d.center.z=u.y,f.radius=D.SOLAR_RADIUS+D.SOLAR_RADIUS*this._glowLengthTS,d.radius=f.radius,i===re.SCENE3D?ue.clone(f,a.boundingVolume):i===re.COLUMBUS_VIEW&&ue.clone(d,a.boundingVolume);let p=dr.computeActualEllipsoidPosition(e,c,T4),g=h.magnitude(h.subtract(p,e.camera.position,T4)),m=r.uniformState.projection,y=gVt;y.x=0,y.y=0,y.z=-g,y.w=1;let A=N.multiplyByVector(m,y,T4),b=dr.clipToGLWindowCoordinates(t.viewport,A,mVt);y.x=D.SOLAR_RADIUS;let x=N.multiplyByVector(m,y,T4),T=dr.clipToGLWindowCoordinates(t.viewport,x,pVt);return this._size=U.magnitude(U.subtract(T,b,T4)),this._size=2*this._size*(1+2*this._glowLengthTS),this._size=Math.ceil(this._size),this._commands};E4.prototype.isDestroyed=function(){return!1};E4.prototype.destroy=function(){let e=this._drawCommand;return e.vertexArray=e.vertexArray&&e.vertexArray.destroy(),e.shaderProgram=e.shaderProgram&&e.shaderProgram.destroy(),this._texture=this._texture&&this._texture.destroy(),le(this)};var C4=E4;var jBe=Qo(mj(),1);function _Vt(e,t,n){return` float clipDistance = clip(gl_FragCoord, ${e}, ${t}); +}`});function ARe(){this.shape=Tc.BOX,this.dimensions=new h(1,1,1),this.names=["data"],this.types=[bt.SCALAR],this.componentTypes=[Lt.FLOAT32],this.maximumTileCount=1}ARe.prototype.requestData=function(e){if((l(e)?e.tileLevel??0:0)>=1)return;let n=new XE({metadata:[new Float32Array(1)]});return Promise.resolve(n)};M0.DefaultProvider=new ARe;var pb=M0;function aMt(e,t,n,i){if(!l(e)||l(t)&&e.id!==t)return;let o=(e.classes||{})[n];if(!l(o))return;let a=(o.properties||{})[i];if(l(a))return a}var rV=aMt;function cMt(e,t,n,i,r){this.schemaId=e,this.className=t,this.propertyName=n,this.classProperty=i,this.metadataProperty=r}var oV=cMt;function lMt(e,t,n){if(!l(e))return;let i=e.propertyTextures;for(let r of i)if(r.class.id===t){let a=r.properties[n];if(l(a))return a}}var sV=lMt;var s9=function(e){return function(){e.frameState.afterRender.push(function(){e.requestRender()})}};function Ai(e){e=e??H.EMPTY_OBJECT;let t=e.canvas,n=e.creditContainer,i=e.creditViewport,r=e.contextOptions instanceof MO;if(r)this._context=e.contextOptions.createSceneContext(t);else{let u=Je(e.contextOptions);this._context=new xx(t,u)}let o=this._context,s=l(n);s||(n=document.createElement("div"),n.style.position="absolute",n.style.bottom="0",n.style["text-shadow"]="0 0 2px #000000",n.style.color="#ffffff",n.style["font-size"]="10px",n.style["padding-right"]="5px",t.parentNode.appendChild(n)),l(i)||(i=t.parentNode),this._id=Kn(),this._jobScheduler=new EU,this._heightQueryCache=new Map,this._heightQueryFrame=-1,this._frameState=new XA(o,new hU(n,"\u2022",i),this._jobScheduler),this._frameState.scene3DOnly=e.scene3DOnly??!1,this._removeCreditContainer=!s,this._creditContainer=n,this._canvas=t,this._computeEngine=new CD(o),this._ellipsoid=e.ellipsoid??ee.default,this._globe=void 0,this._globeTranslucencyState=new TU,this._primitives=new Qc({countReferences:r}),this._groundPrimitives=new Qc({countReferences:r}),this._globeHeight=void 0,this._globeHeightDirty=!0,this._cameraUnderground=!1,this._removeUpdateHeightCallback=void 0,this._logDepthBuffer=Ai.defaultLogDepthBuffer&&o.fragmentDepth,this._logDepthBufferDirty=!0,this._tweens=new HE,this._shaderFrameCount=0,this._sunPostProcess=void 0,this._computeCommandList=[],this._overlayCommandList=[],this._useOIT=e.orderIndependentTranslucency??!0,this._executeOITFunction=void 0,this._depthPlane=new AU(e.depthPlaneEllipsoidOffset),this._clearColorCommand=new li({color:new z,stencil:0,owner:this}),this._depthClearCommand=new li({depth:1,owner:this}),this._stencilClearCommand=new li({stencil:0}),this._classificationStencilClearCommand=new li({stencil:0,renderState:Ge.fromCache({stencilMask:Yt.CLASSIFICATION_MASK})}),this._depthOnlyRenderStateCache={},this._transitioner=new dz(this),this._preUpdate=new be,this._postUpdate=new be,this._renderError=new be,this._preRender=new be,this._postRender=new be,this._controllerHost=new uU,this._minimumDisableDepthTestDistance=0,this._debugInspector=new vz,this._msaaSamples=e.msaaSamples??4,this.rethrowRenderErrors=!1,this.completeMorphOnUserInput=!0,this.morphStart=new be,this.morphComplete=new be,this.skyBox=void 0,this.skyAtmosphere=void 0,this.sun=void 0,this.sunBloom=!0,this._sunBloom=void 0,this.moon=void 0,this.backgroundColor=z.clone(z.BLACK),this._mode=re.SCENE3D,this._mapProjection=l(e.mapProjection)?e.mapProjection:new Ui(this._ellipsoid),this.morphTime=1,this.farToNearRatio=1e3,this.logarithmicDepthFarToNearRatio=1e9,this.nearToFarDistance2D=175e4,this.verticalExaggeration=1,this.verticalExaggerationRelativeHeight=0,this.debugCommandFilter=void 0,this.debugShowCommands=!1,this.debugShowFrustums=!1,this.debugShowFramesPerSecond=!1,this.debugShowDepthFrustum=1,this.debugShowFrustumPlanes=!1,this._debugShowFrustumPlanes=!1,this._debugFrustumPlanes=void 0,this.useDepthPicking=!0,this.pickTranslucentDepth=!1,this.cameraEventWaitTime=500,this.atmosphere=new xT,this.fog=new xU,this.fog.enabled=ee.WGS84.equals(this._ellipsoid),ee.WGS84.equals(this._ellipsoid)||(Or.DEFAULT_VIEW_RECTANGLE=ie.fromDegrees(-45,-45,45,45)),this._shadowMapCamera=new Or(this),this.shadowMap=new V_({context:o,lightCamera:this._shadowMapCamera,enabled:e.shadows??!1}),this.invertClassification=!1,this.invertClassificationColor=z.clone(z.WHITE),this._actualInvertClassificationColor=z.clone(this._invertClassificationColor),this._invertClassification=new pI,this.focalLength=void 0,this.eyeSeparation=void 0,this.postProcessStages=new lz,this._brdfLutGenerator=new rU,this._performanceDisplay=void 0,this._debugVolume=void 0,this._screenSpaceCameraController=new gz(this),this._cameraUnderground=!1,this._mapMode2D=e.mapMode2D??pu.INFINITE_SCROLL,this._environmentState={skyBoxCommand:void 0,skyAtmosphereCommand:void 0,sunDrawCommand:void 0,sunComputeCommand:void 0,moonCommand:void 0,isSunVisible:!1,isMoonVisible:!1,isReadyForAtmosphere:!1,isSkyAtmosphereVisible:!1,clearGlobeDepth:!1,useDepthPlane:!1,renderTranslucentDepthForPick:!1,originalFramebuffer:void 0,useGlobeDepthFramebuffer:!1,useOIT:!1,useInvertClassification:!1,usePostProcess:!1,usePostProcessSelected:!1,useWebVR:!1},this._useWebVR=!1,this._cameraVR=void 0,this._aspectRatioVR=void 0,this.requestRenderMode=e.requestRenderMode??!1,this._renderRequested=!0,this.maximumRenderTimeChange=e.maximumRenderTimeChange??0,this._lastRenderTime=void 0,this._frameRateMonitor=void 0,this._removeRequestListenerCallback=Kc.requestCompletedEvent.addEventListener(s9(this)),this._removeTaskProcessorListenerCallback=$n.taskCompletedEvent.addEventListener(s9(this)),this._removeGlobeCallbacks=[],this._removeTerrainProviderReadyListener=void 0;let a=new et(0,0,o.drawingBufferWidth,o.drawingBufferHeight),c=new Or(this);this._logDepthBuffer&&(c.frustum.near=.1,c.frustum.far=1e10),this.preloadFlightCamera=new Or(this),this.preloadFlightCullingVolume=void 0,this._picking=new VU(this),this._defaultView=new FE(this,c,a),this._view=this._defaultView,this._hdr=void 0,this._hdrDirty=void 0,this.highDynamicRange=!1,this.gamma=2.2,this.sphericalHarmonicCoefficients=void 0,this.specularEnvironmentMaps=void 0,this._specularEnvironmentCubeMap=void 0,this.light=new dg,this._enableEdgeVisibility=!1,this._enablePlanarFillId=!1,vRe(this,0,K.now()),this.updateFrameState(),this.initializeFrame()}Ai.defaultLogDepthBuffer=!0;function uMt(e,t){for(let i=0;i<e._removeGlobeCallbacks.length;++i)e._removeGlobeCallbacks[i]();e._removeGlobeCallbacks.length=0;let n=[];l(t)&&(n.push(t.imageryLayersUpdatedEvent.addEventListener(s9(e))),n.push(t.terrainProviderChanged.addEventListener(s9(e)))),e._removeGlobeCallbacks=n}Object.defineProperties(Ai.prototype,{canvas:{get:function(){return this._canvas}},drawingBufferHeight:{get:function(){return this._context.drawingBufferHeight}},drawingBufferWidth:{get:function(){return this._context.drawingBufferWidth}},maximumAliasedLineWidth:{get:function(){return kt.maximumAliasedLineWidth}},maximumCubeMapSize:{get:function(){return kt.maximumCubeMapSize}},pickPositionSupported:{get:function(){return this._context.depthTexture}},sampleHeightSupported:{get:function(){return this._context.depthTexture}},clampToHeightSupported:{get:function(){return this._context.depthTexture}},invertClassificationSupported:{get:function(){return this._context.depthTexture}},specularEnvironmentMapsSupported:{get:function(){return Em.isSupported(this._context)}},ellipsoid:{get:function(){return this._ellipsoid}},globe:{get:function(){return this._globe},set:function(e){this._globe=this._globe&&this._globe.destroy(),this._globe=e,uMt(this,e)}},primitives:{get:function(){return this._primitives}},groundPrimitives:{get:function(){return this._groundPrimitives}},camera:{get:function(){return this._view.camera},set:function(e){this._view.camera=e}},view:{get:function(){return this._view},set:function(e){this._view=e}},defaultView:{get:function(){return this._defaultView}},picking:{get:function(){return this._picking}},controllerHost:{get:function(){return this._controllerHost}},screenSpaceCameraController:{get:function(){return this._screenSpaceCameraController}},mapProjection:{get:function(){return this._mapProjection}},jobScheduler:{get:function(){return this._jobScheduler}},frameState:{get:function(){return this._frameState}},environmentState:{get:function(){return this._environmentState}},tweens:{get:function(){return this._tweens}},imageryLayers:{get:function(){if(l(this.globe))return this.globe.imageryLayers}},terrainProvider:{get:function(){if(l(this.globe))return this.globe.terrainProvider},set:function(e){this._removeTerrainProviderReadyListener=this._removeTerrainProviderReadyListener&&this._removeTerrainProviderReadyListener(),l(this.globe)&&(this.globe.terrainProvider=e)}},terrainProviderChanged:{get:function(){if(l(this.globe))return this.globe.terrainProviderChanged}},vectorProvider:{get:function(){return this.globe?.vectorProvider}},preUpdate:{get:function(){return this._preUpdate}},postUpdate:{get:function(){return this._postUpdate}},renderError:{get:function(){return this._renderError}},preRender:{get:function(){return this._preRender}},postRender:{get:function(){return this._postRender}},lastRenderTime:{get:function(){return this._lastRenderTime}},context:{get:function(){return this._context}},debugFrustumStatistics:{get:function(){return this._view.debugFrustumStatistics}},scene3DOnly:{get:function(){return this._frameState.scene3DOnly}},orderIndependentTranslucency:{get:function(){return this._useOIT}},id:{get:function(){return this._id}},mode:{get:function(){return this._mode},set:function(e){e===re.SCENE2D?this.morphTo2D(0):e===re.SCENE3D?this.morphTo3D(0):e===re.COLUMBUS_VIEW&&this.morphToColumbusView(0),this._mode=e}},frustumCommandsList:{get:function(){return this._view.frustumCommandsList}},numberOfFrustums:{get:function(){return this._view.frustumCommandsList.length}},useWebVR:{get:function(){return this._useWebVR},set:function(e){this._useWebVR=e,this._useWebVR?(this._frameState.creditDisplay.container.style.visibility="hidden",this._cameraVR=new Or(this),l(this._deviceOrientationCameraController)||(this._deviceOrientationCameraController=new bU(this)),this._aspectRatioVR=this.camera.frustum.aspectRatio):(this._frameState.creditDisplay.container.style.visibility="visible",this._cameraVR=void 0,this._deviceOrientationCameraController=this._deviceOrientationCameraController&&!this._deviceOrientationCameraController.isDestroyed()&&this._deviceOrientationCameraController.destroy(),this.camera.frustum.aspectRatio=this._aspectRatioVR,this.camera.frustum.xOffset=0)}},mapMode2D:{get:function(){return this._mapMode2D}},splitPosition:{get:function(){return this._frameState.splitPosition},set:function(e){this._frameState.splitPosition=e}},minimumDisableDepthTestDistance:{get:function(){return this._minimumDisableDepthTestDistance},set:function(e){this._minimumDisableDepthTestDistance=e}},logarithmicDepthBuffer:{get:function(){return this._logDepthBuffer},set:function(e){e=this._context.fragmentDepth&&e,this._logDepthBuffer!==e&&(this._logDepthBuffer=e,this._logDepthBufferDirty=!0)}},gamma:{get:function(){return this._context.uniformState.gamma},set:function(e){this._context.uniformState.gamma=e}},highDynamicRange:{get:function(){return this._hdr},set:function(e){let t=this._context,n=e&&t.depthTexture&&(t.colorBufferFloat||t.colorBufferHalfFloat);this._hdrDirty=n!==this._hdr,this._hdr=n}},highDynamicRangeSupported:{get:function(){let e=this._context;return e.depthTexture&&(e.colorBufferFloat||e.colorBufferHalfFloat)}},cameraUnderground:{get:function(){return this._cameraUnderground}},msaaSamples:{get:function(){return this._msaaSamples},set:function(e){e=Math.min(e,kt.maximumSamples),this._msaaSamples=e}},msaaSupported:{get:function(){return this._context.msaa}},pixelRatio:{get:function(){return this._frameState.pixelRatio},set:function(e){this._frameState.pixelRatio=e}},opaqueFrustumNearOffset:{get:function(){return .9999}},globeHeight:{get:function(){return this._globeHeight}}});Ai.prototype.getCompressedTextureFormatSupported=function(e){let t=this.context;return(e==="WEBGL_compressed_texture_s3tc"||e==="s3tc")&&t.s3tc||(e==="WEBGL_compressed_texture_pvrtc"||e==="pvrtc")&&t.pvrtc||(e==="WEBGL_compressed_texture_etc"||e==="etc")&&t.etc||(e==="WEBGL_compressed_texture_etc1"||e==="etc1")&&t.etc1||(e==="WEBGL_compressed_texture_astc"||e==="astc")&&t.astc||(e==="EXT_texture_compression_bptc"||e==="bc7")&&t.bc7};function fMt(e,t){let n=e.pickedMetadataInfo,i=t.pickedMetadataInfo;return n?.schemaId!==i?.schemaId||n?.className!==i?.className||n?.propertyName!==i?.propertyName}function bRe(e,t,n){let i=e._frameState,r=e._context,o=e._view.oit,{lightShadowMaps:s,lightShadowsEnabled:a}=i.shadowState,c=t.derivedCommands;l(t.pickId)&&(c.picking=Wm.createPickDerivedCommand(e,t,r,c.picking)),l(t.snapId)&&i.passes.snap&&(c.snapping=Wm.createSnapDerivedCommand(e,t,r,c.snapping)),i.pickingMetadata&&t.pickMetadataAllowed&&(t.pickedMetadataInfo=i.pickedMetadataInfo,l(t.pickedMetadataInfo)&&(c.pickingMetadata=Wm.createPickMetadataDerivedCommand(e,t,r,c.pickingMetadata))),t.pickOnly||(c.depth=Wm.createDepthOnlyDerivedCommand(e,t,r,c.depth)),c.originalCommand=t,e._hdr&&(c.hdr=Wm.createHdrCommand(t,r,c.hdr),t=c.hdr.command,c=t.derivedCommands),a&&t.receiveShadows&&(c.shadows=V_.createReceiveDerivedCommand(s,t,n,r,c.shadows)),t.pass===Ie.TRANSLUCENT&&l(o)&&o.isSupported()&&(a&&t.receiveShadows?(c.oit=l(c.oit)?c.oit:{},c.oit.shadows=o.createDerivedCommands(c.shadows.receiveCommand,r,c.oit.shadows)):c.oit=o.createDerivedCommands(t,r,c.oit))}Ai.prototype.updateDerivedCommands=function(e){let{derivedCommands:t}=e;if(!l(t))return;let n=this._frameState,{shadowState:i,useLogDepth:r}=this._frameState,o=this._context,s=!1,a=i.lastDirtyTime;e.lastDirtyTime!==a&&(e.lastDirtyTime=a,e.dirty=!0,s=!0);let c=this._hdr,u=l(t.logDepth),f=l(t.hdr),d=l(t.originalCommand),p=r&&!u,g=c&&!f,m=(!r||!c)&&!d,y=n.pickingMetadata&&fMt(e,n),A=n.passes.snap&&l(e.snapId)&&!l(t.snapping);if(e.dirty=e.dirty||p||g||m||y||A,!e.dirty)return;e.dirty=!1;let{shadowsEnabled:b,shadowMaps:x}=i;b&&e.castShadows&&(t.shadows=V_.createCastDerivedCommand(x,e,s,o,t.shadows)),(u||p)&&(t.logDepth=Wm.createLogDepthCommand(e,o,t.logDepth),bRe(this,t.logDepth.command,s)),(d||m)&&bRe(this,e,s)};var dMt=new Ah({pass:ao.RENDER}),mie=new Ah({pass:ao.PRELOAD}),pie=new Ah({pass:ao.PRELOAD_FLIGHT}),hMt=new Ah({pass:ao.REQUEST_RENDER_MODE_DEFER_CHECK}),xRe=new ue,gie;function mMt(e){if(!(e._mode!==re.SCENE3D||!e.globe?.show||e._cameraUnderground||e._globeTranslucencyState.translucent))return xRe.radius=e.ellipsoid.minimumRadius+e.frameState.minimumTerrainHeight,gie=nU.fromBoundingSphere(xRe,e.camera.positionWC,gie),gie}Ai.prototype.clearPasses=function(e){e.render=!1,e.pick=!1,e.pickVoxel=!1,e.snap=!1,e.depth=!1,e.postProcess=!1,e.offscreen=!1};function vRe(e,t,n){let i=e._frameState;i.frameNumber=t,i.time=K.clone(n,i.time)}Ai.prototype.updateFrameState=function(){let e=this.camera,t=this._frameState;t.commandList.length=0,t.shadowMaps.length=0,t.brdfLutGenerator=this._brdfLutGenerator,t.environmentMap=this.skyBox&&this.skyBox._cubeMap,t.mode=this._mode,t.morphTime=this.morphTime,t.mapProjection=this.mapProjection,t.camera=e,t.cullingVolume=e.frustum.computeCullingVolume(e.positionWC,e.directionWC,e.upWC),t.occluder=mMt(this),t.minimumTerrainHeight=0,t.minimumDisableDepthTestDistance=this._minimumDisableDepthTestDistance,t.invertClassification=this.invertClassification,t.useLogDepth=this._logDepthBuffer&&!(this.camera.frustum instanceof gn||this.camera.frustum instanceof ys),t.light=this.light,t.cameraUnderground=this._cameraUnderground,t.globeTranslucencyState=this._globeTranslucencyState;let{globe:n}=this;l(n)&&n._terrainExaggerationChanged&&(this.verticalExaggeration=n._terrainExaggeration,this.verticalExaggerationRelativeHeight=n._terrainExaggerationRelativeHeight,n._terrainExaggerationChanged=!1),t.verticalExaggeration=this.verticalExaggeration,t.verticalExaggerationRelativeHeight=this.verticalExaggerationRelativeHeight,l(this._specularEnvironmentCubeMap)&&this._specularEnvironmentCubeMap.ready?(t.specularEnvironmentMaps=this._specularEnvironmentCubeMap.texture,t.specularEnvironmentMapsMaximumLOD=this._specularEnvironmentCubeMap.maximumMipmapLevel):(t.specularEnvironmentMaps=void 0,t.specularEnvironmentMapsMaximumLOD=void 0),t.sphericalHarmonicCoefficients=this.sphericalHarmonicCoefficients,this._actualInvertClassificationColor=z.clone(this.invertClassificationColor,this._actualInvertClassificationColor),pI.isTranslucencySupported(this._context)||(this._actualInvertClassificationColor.alpha=1),t.invertClassificationColor=this._actualInvertClassificationColor,l(this.globe)?t.maximumScreenSpaceError=this.globe.maximumScreenSpaceError:t.maximumScreenSpaceError=2,this.clearPasses(t.passes),t.tilesetPassState=void 0};Ai.prototype.isVisible=function(e,t,n){if(!l(t))return!1;let{boundingVolume:i}=t;return!l(i)||!t.cull?!0:e.computeVisibility(i)===$t.OUTSIDE?!1:!l(n)||!t.occlude||!i.isOccluded(n)};var o9=new N(0,0,1,0,1,0,0,0,0,1,0,0,0,0,0,1);o9=N.inverseTransformation(o9,o9);function pMt(e,t,n,i){let r=t._frameState,o=r.context,s=e.boundingVolume;l(t._debugVolume)&&t._debugVolume.destroy();let a=h.clone(s.center);if(r.mode!==re.SCENE3D){a=N.multiplyByPoint(o9,a,a);let m=r.mapProjection,y=m.unproject(a);a=m.ellipsoid.cartographicToCartesian(y)}let c,u,{radius:f}=s;l(f)?(c=za.createGeometry(new za({radii:new h(f,f,f),vertexFormat:yn.FLAT_VERTEX_FORMAT})),u=N.fromTranslation(a)):(c=Ic.createGeometry(Ic.fromDimensions({dimensions:new h(2,2,2),vertexFormat:yn.FLAT_VERTEX_FORMAT})),u=N.fromRotationTranslation(s.halfAxes,a,new N)),t._debugVolume=new On({geometryInstances:new Ft({geometry:Hn.toWireframe(c),modelMatrix:u,attributes:{color:new Jt(1,0,0,1)}}),appearance:new yn({flat:!0,translucent:!1}),asynchronous:!1});let d=r.commandList,p=r.commandList=[];t._debugVolume.update(r),e=p[0],r.useLogDepth&&(e=Wm.createLogDepthCommand(e,o).command);let g;l(i)&&(g=n.framebuffer,n.framebuffer=i),e.execute(o,n),l(g)&&(n.framebuffer=g),r.commandList=d}function yu(e,t,n,i){let r=t._frameState,o=t._context;if(l(t.debugCommandFilter)&&!t.debugCommandFilter(e))return;if(e instanceof li){e.execute(o,n);return}e.debugShowBoundingVolume&&l(e.boundingVolume)&&pMt(e,t,n,i),r.useLogDepth&&l(e.derivedCommands.logDepth)&&(e=e.derivedCommands.logDepth.command);let s=r.passes;if(!s.pick&&!s.pickVoxel&&!s.depth&&t._hdr&&l(e.derivedCommands)&&l(e.derivedCommands.hdr)&&(e=e.derivedCommands.hdr.command),s.pick||s.depth){if(s.pick&&!s.depth){if(r.passes.snap){l(e.derivedCommands.snapping)?(e=e.derivedCommands.snapping.snapCommand,e.execute(o,n)):l(e.derivedCommands.depth)&&(e=e.derivedCommands.depth.depthOnlyCommand,e.execute(o,n));return}if(r.pickingMetadata&&l(e.derivedCommands.pickingMetadata)){e=e.derivedCommands.pickingMetadata.pickMetadataCommand,e.execute(o,n);return}if(!r.pickingMetadata&&l(e.derivedCommands.picking)){e=e.derivedCommands.picking.pickCommand,e.execute(o,n);return}}else if(l(e.derivedCommands.depth)){e=e.derivedCommands.depth.depthOnlyCommand,e.execute(o,n);return}}if(t.debugShowCommands||t.debugShowFrustums){t._debugInspector.executeDebugShowFrustumsCommand(t,e,n);return}r.shadowState.lightShadowsEnabled&&e.receiveShadows&&l(e.derivedCommands.shadows)?e.derivedCommands.shadows.receiveCommand.execute(o,n):e.execute(o,n)}function TRe(e,t,n){let{derivedCommands:i}=e;if(!l(i))return;let r=t._frameState,o=t._context;r.useLogDepth&&l(i.logDepth)&&(e=i.logDepth.command);let{picking:s,pickingMetadata:a,depth:c}=e.derivedCommands;l(a)&&(e=i.pickingMetadata.pickMetadataCommand,e.execute(o,n)),l(s)?(e=s.pickCommand,e.execute(o,n)):l(c)&&(e=c.depthOnlyCommand,e.execute(o,n))}function SRe(e,t,n){return t.boundingVolume.distanceSquaredTo(n)-e.boundingVolume.distanceSquaredTo(n)}var gMt=new h;function ERe(e,t){let n=h.subtract(e,t,gMt),i=Math.max(0,h.magnitude(n));return i*i}function _Mt(e,t,n){let i=e.boundingVolume,r=t.boundingVolume;return ERe(r.center,n)-ERe(i.center,n)}function yMt(e,t,n){return e.boundingVolume.distanceSquaredTo(n)-t.boundingVolume.distanceSquaredTo(n)+D.EPSILON12}function AMt(e,t,n,i,r){b0(i,SRe,e.camera.positionWC),l(r)&&t(r.unclassifiedCommand,e,n);for(let o=0;o<i.length;++o)t(i[o],e,n)}function bMt(e,t,n,i,r){b0(i,yMt,e.camera.positionWC),l(r)&&t(r.unclassifiedCommand,e,n);for(let o=0;o<i.length;++o)t(i[o],e,n)}function xMt(e,t,n){e.context.uniformState.updatePass(Ie.VOXELS);let i=n.commands[Ie.VOXELS];i.length=n.indices[Ie.VOXELS],b0(i,SRe,e.camera.positionWC);for(let r=0;r<i.length;++r)yu(i[r],e,t)}function TMt(e,t,n){e.context.uniformState.updatePass(Ie.GAUSSIAN_SPLATS);let i=n.commands[Ie.GAUSSIAN_SPLATS];i.length=n.indices[Ie.GAUSSIAN_SPLATS],b0(i,_Mt,e.camera.positionWC);for(let r=0;r<i.length;++r)yu(i[r],e,t)}var EMt=new $i,CMt=new mu,vMt=new gn,SMt=new ys;function wMt(e){let{frustum:t}=e;return l(t.fov)?t.clone(EMt):l(t.infiniteProjectionMatrix)?t.clone(CMt):l(t.width)?t.clone(vMt):t.clone(SMt)}function IMt(e){if(e._environmentState.useOIT){if(!l(e._executeOITFunction)){let{view:t,context:n}=e;e._executeOITFunction=function(i,r,o,s,a){t.globeDepth.prepareColorTextures(n),t.oit.executeCommands(i,r,o,s,a)}}return e._executeOITFunction}return e.frameState.passes.render?AMt:bMt}function PMt(e,t,n){let{frameState:i,context:r}=e,{pick:o,pickVoxel:s}=i.passes,a=o||s,c;!a&&e._environmentState.useInvertClassification&&i.invertClassificationColor.alpha<1&&(c=e._invertClassification);let u=IMt(e);r.uniformState.updatePass(Ie.TRANSLUCENT);let f=n.commands[Ie.TRANSLUCENT];f.length=n.indices[Ie.TRANSLUCENT],u(e,yu,t,f,c)}function DMt(e,t,n){let{translucentTileClassification:i,globeDepth:r}=e._view;if(!(n.indices[Ie.CESIUM_3D_TILE_CLASSIFICATION]>0)||!i.isSupported())return;let s=n.commands[Ie.TRANSLUCENT];i.executeTranslucentCommands(e,yu,t,s,r.depthStencilTexture),i.executeClassificationCommands(e,yu,t,n)}function RMt(e,t,n){e.context.uniformState.updatePass(Ie.CESIUM_3D_TILE_EDGES);let i=t.framebuffer;e.context.uniformState.edgeColorTexture=e.context.defaultTexture,e.context.uniformState.edgeIdTexture=e.context.defaultTexture,e.context.uniformState.edgeDepthTexture=e.context.defaultTexture,e._enableEdgeVisibility&&l(e._view)&&l(e._view.edgeFramebuffer)&&(t.framebuffer=e._view.edgeFramebuffer.framebuffer);let r=n.commands[Ie.CESIUM_3D_TILE_EDGES],o=n.indices[Ie.CESIUM_3D_TILE_EDGES];e._enableEdgeVisibility&&l(e._view)&&l(e._view.edgeFramebuffer)&&e._view.edgeFramebuffer.getClearCommand(new z(0,0,0,0)).execute(e.context,t);for(let s=0;s<o;++s)yu(r[s],e,t);t.framebuffer=i}function OMt(e,t,n){let{context:i}=e,{uniformState:r}=i;r.updatePass(Ie.CESIUM_3D_TILE_PLANAR_FILL_ID),r.planarFillIdTexture=i.defaultTexture;let o=e._view,s=o&&o.planarFillIdFramebuffer,a=n.commands[Ie.CESIUM_3D_TILE_PLANAR_FILL_ID],c=n.indices[Ie.CESIUM_3D_TILE_PLANAR_FILL_ID];if(c!==0&&e._enablePlanarFillId&&l(s)&&l(s.framebuffer)){let u=t.framebuffer;t.framebuffer=s.framebuffer,s.getClearCommand(new z(0,0,0,0)).execute(i,t);for(let d=0;d<c;++d)yu(a[d],e,t);t.framebuffer=u}}function MMt(e,t,n){e.context.uniformState.updatePass(Ie.CESIUM_3D_TILE_EDGES_DIRECT);let i=n.commands[Ie.CESIUM_3D_TILE_EDGES_DIRECT],r=n.indices[Ie.CESIUM_3D_TILE_EDGES_DIRECT];for(let o=0;o<r;++o)yu(i[o],e,t)}function yie(e,t){let{camera:n,context:i,frameState:r}=e,{uniformState:o}=i;o.updateCamera(n),o.planarFillIdTexture=i.defaultTexture;let s=wMt(n);s.near=n.frustum.near,s.far=n.frustum.far;let a=r.passes,c=a.pick||a.pickVoxel;c||NMt(e,t);let{clearGlobeDepth:u,renderTranslucentDepthForPick:f,useDepthPlane:d,useGlobeDepthFramebuffer:p,useInvertClassification:g,usePostProcessSelected:m}=e._environmentState,{globeDepth:y,globeTranslucencyFramebuffer:A,sceneFramebuffer:b,frustumCommandsList:x}=e._view,T=x.length,E=e._globeTranslucencyState,v=e._depthClearCommand,S=e._stencilClearCommand,I=e._classificationStencilClearCommand,R=e._depthPlane,O=n.position.z;function L(C,w){o.updatePass(w);let P=C.commands[w],M=C.indices[w];for(let F=0;F<M;++F)yu(P[F],e,t);return M}function _(C,w){o.updatePass(w);let P=C.commands[w],M=C.indices[w];for(let F=0;F<M;++F)TRe(P[F],e,t)}for(let C=0;C<T;++C){let w=T-C-1,P=x[w];e.mode===re.SCENE2D?(n.position.z=O-P.near+1,s.far=Math.max(1,P.far-P.near),s.near=1,o.update(r),o.updateFrustum(s)):(s.near=w!==0?P.near*e.opaqueFrustumNearOffset:P.near,s.far=P.far,o.updateFrustum(s)),v.execute(i,t),i.stencilBuffer&&S.execute(i,t),E.translucent?(o.updatePass(Ie.GLOBE),E.executeGlobeCommands(P,yu,A,e,t)):L(P,Ie.GLOBE),p&&y.executeCopyDepth(i,t),f||(E.translucent?(o.updatePass(Ie.TERRAIN_CLASSIFICATION),E.executeGlobeClassificationCommands(P,yu,A,e,t)):L(P,Ie.TERRAIN_CLASSIFICATION)),u&&(v.execute(i,t),d&&R.execute(i,t));let M;if(RMt(e,t,P),e._enableEdgeVisibility&&l(e._view)&&l(e._view.edgeFramebuffer)){let V=e._view.edgeFramebuffer.colorTexture;l(V)?e.context.uniformState.edgeColorTexture=V:e.context.uniformState.edgeColorTexture=e.context.defaultTexture;let B=e._view.edgeFramebuffer.idTexture;l(B)?e.context.uniformState.edgeIdTexture=B:e.context.uniformState.edgeIdTexture=e.context.defaultTexture;let j=e._view.edgeFramebuffer.depthTexture;l(j)?e.context.uniformState.edgeDepthTexture=j:e.context.uniformState.edgeDepthTexture=e.context.defaultTexture}else e.context.uniformState.edgeColorTexture=e.context.defaultTexture,e.context.uniformState.edgeIdTexture=e.context.defaultTexture,e.context.uniformState.edgeDepthTexture=e.context.defaultTexture;if(OMt(e,t,P),e._enablePlanarFillId&&l(e._view)&&l(e._view.planarFillIdFramebuffer)){let V=e._view.planarFillIdFramebuffer.idTexture;o.planarFillIdTexture=l(V)?V:i.defaultTexture}else o.planarFillIdTexture=i.defaultTexture;if(!g||c||f)M=L(P,Ie.CESIUM_3D_TILE),M>0&&(p&&(y.prepareColorTextures(i,u),y.executeUpdateDepth(i,t,y.depthStencilTexture)),f||(M=L(P,Ie.CESIUM_3D_TILE_CLASSIFICATION)));else{e._invertClassification.clear(i,t);let V=t.framebuffer;t.framebuffer=e._invertClassification._fbo.framebuffer,L(P,Ie.CESIUM_3D_TILE),p&&(e._invertClassification.prepareTextures(i),y.executeUpdateDepth(i,t,e._invertClassification._fbo.getDepthStencilTexture())),M=L(P,Ie.CESIUM_3D_TILE_CLASSIFICATION_IGNORE_SHOW),t.framebuffer=V,e._invertClassification.executeClassified(i,t),r.invertClassificationColor.alpha===1&&e._invertClassification.executeUnclassified(i,t),M>0&&i.stencilBuffer&&I.execute(i,t),M=L(P,Ie.CESIUM_3D_TILE_CLASSIFICATION)}if(M>0&&i.stencilBuffer&&S.execute(i,t),xMt(e,t,P),L(P,Ie.OPAQUE),MMt(e,t,P),TMt(e,t,P),w!==0&&e.mode!==re.SCENE2D&&(s.near=P.near,o.updateFrustum(s)),PMt(e,t,P),DMt(e,t,P),i.depthTexture&&e.useDepthPicking&&(p||f)){let V=e._picking.getPickDepth(e,w);V.update(i,y.depthStencilTexture),V.executeCopyDepth(i,t)}if(c||!m)continue;let F=t.framebuffer;t.framebuffer=b.getIdFramebuffer(),s.near=w!==0?P.near*e.opaqueFrustumNearOffset:P.near,s.far=P.far,o.updateFrustum(s),E.translucent?(o.updatePass(Ie.GLOBE),E.executeGlobeCommands(P,TRe,A,e,t)):_(P,Ie.GLOBE),u&&(v.framebuffer=t.framebuffer,v.execute(i,t),v.framebuffer=void 0),u&&d&&R.execute(i,t),_(P,Ie.CESIUM_3D_TILE),_(P,Ie.OPAQUE),_(P,Ie.TRANSLUCENT),t.framebuffer=F}}function NMt(e,t){let{context:n,environmentState:i,view:r}=e;if(n.uniformState.updatePass(Ie.ENVIRONMENT),l(i.skyBoxCommand)&&yu(i.skyBoxCommand,e,t),i.isSkyAtmosphereVisible&&yu(i.skyAtmosphereCommand,e,t),i.isSunVisible&&(i.sunDrawCommand.execute(n,t),e.sunBloom&&!i.useWebVR)){let s;i.useGlobeDepthFramebuffer?s=r.globeDepth.framebuffer:i.usePostProcess?s=r.sceneFramebuffer.framebuffer:s=i.originalFramebuffer,e._sunPostProcess.execute(n),e._sunPostProcess.copy(n,s),t.framebuffer=s}i.isMoonVisible&&i.moonCommand.execute(n,t);let o=e.frameState.panoramaCommandList;for(let s=o.length-1;s>=0;s--){let a=o[s];l(a.shaderProgram)?yu(o[s],e,t):o.splice(s,1)}}function wRe(e){e.context.uniformState.updatePass(Ie.COMPUTE);let t=e._environmentState.sunComputeCommand;l(t)&&t.execute(e._computeEngine);let n=e._computeCommandList;for(let i=0;i<n.length;++i)n[i].execute(e._computeEngine)}function LMt(e,t){e.context.uniformState.updatePass(Ie.OVERLAY);let n=e.context,i=e._overlayCommandList;for(let r=0;r<i.length;++r)i[r].execute(n,t)}function FMt(e,t,n){let{shadowMapCullingVolume:i,isPointLight:r,passes:o}=n,s=o.length,a=[Ie.GLOBE,Ie.CESIUM_3D_TILE,Ie.OPAQUE,Ie.TRANSLUCENT];for(let c=0;c<t.length;++c){let u=t[c];if(e.updateDerivedCommands(u),!(!u.castShadows||a.indexOf(u.pass)<0||!e.isVisible(i,u)))if(r)for(let f=0;f<s;++f)o[f].commandList.push(u);else if(s===1)o[0].commandList.push(u);else{let f=!1;for(let d=s-1;d>=0;--d){let p=o[d].cullingVolume;if(e.isVisible(p,u))o[d].commandList.push(u),f=!0;else if(f)break}}}}function IRe(e){let{shadowState:t,commandList:n}=e.frameState,{shadowsEnabled:i,shadowMaps:r}=t;if(!i)return;let{context:o}=e,{uniformState:s}=o;for(let a=0;a<r.length;++a){let c=r[a];if(c.outOfView)continue;let{passes:u}=c;for(let f=0;f<u.length;++f)u[f].commandList.length=0;FMt(e,n,c);for(let f=0;f<u.length;++f){let d=c.passes[f],{camera:p,commandList:g}=d;s.updateCamera(p),c.updatePass(o,f);for(let m=0;m<g.length;++m){let y=g[m];s.updatePass(y.pass);let A=y.derivedCommands.shadows.castCommands[a];yu(A,e,d.passState)}}}}var BMt=new h;Ai.prototype.updateAndExecuteCommands=function(e,t){JMt(this,e,t),this._environmentState.useWebVR?kMt(this,e,t):this._frameState.mode!==re.SCENE2D||this._mapMode2D===pu.ROTATE?gb(!0,this,e):YMt(this,e)};function kMt(e,t){let n=e._view,i=n.camera,o=e._environmentState.renderTranslucentDepthForPick;DRe(e),n.createPotentiallyVisibleSet(e),wRe(e),o||IRe(e);let s=t.viewport;s.x=0,s.y=0,s.width=s.width*.5;let a=Or.clone(i,e._cameraVR);a.frustum=i.frustum;let c=i.frustum.near,u=c*(e.focalLength??5),f=e.eyeSeparation??u/30,d=h.multiplyByScalar(a.right,f*.5,BMt);i.frustum.aspectRatio=s.width/s.height;let p=.5*f*c/u;h.add(a.position,d,i.position),i.frustum.xOffset=p,yie(e,t),s.x=s.width,h.subtract(a.position,d,i.position),i.frustum.xOffset=-p,yie(e,t),Or.clone(a,i)}var UMt=new he(Math.PI,D.PI_OVER_TWO),zMt=new h,VMt=new h,jMt=new N,HMt=new N,GMt=new h,WMt=new h,qMt=new et;function YMt(e,t){let{frameState:n,camera:i}=e,{uniformState:r}=e.context,o=t.viewport,s=et.clone(o,qMt);t.viewport=s;let a=UMt,c=zMt;e.mapProjection.project(a,c);let f=h.clone(i.position,VMt),d=N.clone(i.transform,HMt),p=i.frustum.clone();i._setTransform(N.IDENTITY);let g=N.computeViewportTransformation(s,0,1,jMt),m=i.frustum.projectionMatrix,y=i.positionWC.y,A=h.fromElements(D.sign(y)*c.x-y,0,-i.positionWC.x,GMt),b=At.pointToGLWindowCoordinates(m,g,A,WMt);b.x=Math.floor(b.x);let x=s.x,T=s.width;if(y===0||b.x<=x||b.x>=x+T)gb(!0,e,t);else if(Math.abs(x+T*.5-b.x)<1)s.width=b.x-s.x,i.position.x*=D.sign(i.position.x),i.frustum.right=0,n.cullingVolume=i.frustum.computeCullingVolume(i.positionWC,i.directionWC,i.upWC),r.update(n),gb(!0,e,t),s.x=b.x,i.position.x=-i.position.x,i.frustum.right=-i.frustum.left,i.frustum.left=0,n.cullingVolume=i.frustum.computeCullingVolume(i.positionWC,i.directionWC,i.upWC),r.update(n),gb(!1,e,t);else if(b.x>x+T*.5){s.width=b.x-x;let E=i.frustum.right;i.frustum.right=c.x-y,n.cullingVolume=i.frustum.computeCullingVolume(i.positionWC,i.directionWC,i.upWC),r.update(n),gb(!0,e,t),s.x=b.x,s.width=x+T-b.x,i.position.x=-i.position.x,i.frustum.left=-i.frustum.right,i.frustum.right=E-i.frustum.right*2,n.cullingVolume=i.frustum.computeCullingVolume(i.positionWC,i.directionWC,i.upWC),r.update(n),gb(!1,e,t)}else{s.x=b.x,s.width=x+T-b.x;let E=i.frustum.left;i.frustum.left=-c.x-y,n.cullingVolume=i.frustum.computeCullingVolume(i.positionWC,i.directionWC,i.upWC),r.update(n),gb(!0,e,t),s.x=x,s.width=b.x-x,i.position.x=-i.position.x,i.frustum.right=-i.frustum.left,i.frustum.left=E-i.frustum.left*2,n.cullingVolume=i.frustum.computeCullingVolume(i.positionWC,i.directionWC,i.upWC),r.update(n),gb(!1,e,t)}i._setTransform(d),h.clone(f,i.position),i.frustum=p.clone(),t.viewport=o}function gb(e,t,n){let i=t._view,{renderTranslucentDepthForPick:r}=t._environmentState;e||(t.frameState.commandList.length=0),DRe(t),i.createPotentiallyVisibleSet(t),e&&(wRe(t),r||IRe(t)),yie(t,n)}var CRe=new ta;function PRe(e,t,n){if(!e.show)return;let i=e.length;for(let r=0;r<i;++r){let o=e.get(r);if(o instanceof Qc){PRe(o,t,n);continue}o.show&&x_.isSupported(o)&&bs(o.heightReference)&&t.markForFrame(o,n,o.heightReference)}}function XMt(e,t){let n=e.vectorProvider;if(!l(n))return;let i=t.frameNumber;PRe(e._primitives,n,i)}Ai.prototype.updateEnvironment=function(){let e=this._frameState,t=this._view,n=this._environmentState,i=e.passes.render,r=e.passes.offscreen,o=this.atmosphere,s=this.skyAtmosphere,a=this.globe,c=this._globeTranslucencyState;if(!i||this._mode!==re.SCENE2D&&t.camera.frustum instanceof gn||!c.environmentVisible)n.skyAtmosphereCommand=void 0,n.skyBoxCommand=void 0,n.sunDrawCommand=void 0,n.sunComputeCommand=void 0,n.moonCommand=void 0;else{if(l(s)){if(l(a))s.setDynamicLighting(Gg.fromGlobeFlags(a)),n.isReadyForAtmosphere=n.isReadyForAtmosphere||!a.show||a._surface._tilesToRender.length>0;else{let b=o.dynamicLighting;s.setDynamicLighting(b),n.isReadyForAtmosphere=!0}n.skyAtmosphereCommand=s.update(e,a),l(n.skyAtmosphereCommand)&&this.updateDerivedCommands(n.skyAtmosphereCommand)}else n.skyAtmosphereCommand=void 0;n.skyBoxCommand=l(this.skyBox)?this.skyBox.update(e,this._hdr):void 0;let A=l(this.sun)?this.sun.update(e,t.passState,this._hdr):void 0;n.sunDrawCommand=l(A)?A.drawCommand:void 0,n.sunComputeCommand=l(A)?A.computeCommand:void 0,n.moonCommand=l(this.moon)?this.moon.update(e):void 0}let u=n.clearGlobeDepth=l(a)&&a.show&&(!a.depthTestAgainstTerrain||this.mode===re.SCENE2D);(n.useDepthPlane=u&&this.mode===re.SCENE3D&&c.useDepthPlane)&&this._depthPlane.update(e),n.renderTranslucentDepthForPick=!1,n.useWebVR=this._useWebVR&&this.mode!==re.SCENE2D&&!r;let d=e.mode===re.SCENE3D&&!c.sunVisibleThroughGlobe?e.occluder:void 0,p=e.cullingVolume,g=CRe.planes;for(let A=0;A<5;++A)g[A]=p.planes[A];p=CRe,n.isSkyAtmosphereVisible=l(n.skyAtmosphereCommand)&&n.isReadyForAtmosphere,n.isSunVisible=this.isVisible(p,n.sunDrawCommand,d),n.isMoonVisible=this.isVisible(p,n.moonCommand,d);let m=this.specularEnvironmentMaps,y=this._specularEnvironmentCubeMap;l(m)&&y?.url!==m?(l(y)&&y.destroy(),this._specularEnvironmentCubeMap=new Em(m)):!l(m)&&l(y)&&(y.destroy(),this._specularEnvironmentCubeMap=void 0),l(this._specularEnvironmentCubeMap)&&this._specularEnvironmentCubeMap.update(e),XMt(this,e)};function KMt(e){let t=e._frameState;e.debugShowFrustumPlanes!==e._debugShowFrustumPlanes&&(e.debugShowFrustumPlanes?e._debugFrustumPlanes=new E0({camera:e.camera,updateOnChange:!1,frustumSplits:t.frustumSplits}):e._debugFrustumPlanes=e._debugFrustumPlanes&&e._debugFrustumPlanes.destroy(),e._debugShowFrustumPlanes=e.debugShowFrustumPlanes),l(e._debugFrustumPlanes)&&e._debugFrustumPlanes.update(t)}function $Mt(e){let t=e._frameState,{passes:n,shadowState:i,shadowMaps:r}=t,o=r.length,s=o>0&&!n.pick&&!n.pickVoxel&&e.mode===re.SCENE3D;if(s!==i.shadowsEnabled&&(++i.lastDirtyTime,i.shadowsEnabled=s),i.lightShadowsEnabled=!1,!!s){for(let a=0;a<o;++a)if(r[a]!==i.shadowMaps[a]){++i.lastDirtyTime;break}i.shadowMaps.length=0,i.lightShadowMaps.length=0;for(let a=0;a<o;++a){let c=r[a];c.update(t),i.shadowMaps.push(c),c.fromLightSource&&(i.lightShadowMaps.push(c),i.lightShadowsEnabled=!0),c.dirty&&(++i.lastDirtyTime,c.dirty=!1)}}}function DRe(e){let t=e._frameState;t.edgeVisibilityRequested=!1,t.planarFillRequested=!1,e._groundPrimitives.update(t),e._primitives.update(t),t.edgeVisibilityRequested&&e._enableEdgeVisibility===!1&&(e._enableEdgeVisibility=!0),e._enablePlanarFillId=t.planarFillRequested,KMt(e),$Mt(e),e._globe&&e._globe.render(t)}function JMt(e,t,n){let i=e._context,r=e._frameState,o=e._environmentState,s=e._view,a=r.passes,c=a.pick||a.pickVoxel;l(s.globeDepth)&&(s.globeDepth.picking=c,s.globeDepth.snapping=a.snap);let u=o.useWebVR;o.originalFramebuffer=t.framebuffer,l(e.sun)&&e.sunBloom!==e._sunBloom?(e.sunBloom&&!u?e._sunPostProcess=new Ez:l(e._sunPostProcess)&&(e._sunPostProcess=e._sunPostProcess.destroy()),e._sunBloom=e.sunBloom):!l(e.sun)&&l(e._sunPostProcess)&&(e._sunPostProcess=e._sunPostProcess.destroy(),e._sunBloom=!1);let f=e._clearColorCommand;z.clone(n,f.color),f.execute(i,t);let d=o.useGlobeDepthFramebuffer=l(s.globeDepth);d&&(s.globeDepth.update(i,t,s.viewport,e.msaaSamples,e._hdr,o.clearGlobeDepth),s.globeDepth.clear(i,t,n));let p=s.oit,g=o.useOIT=!c&&l(p)&&p.isSupported();g&&(p.update(i,t,s.globeDepth.colorFramebufferManager,e._hdr,e.msaaSamples),p.clear(i,t,n),o.useOIT=p.isSupported());let m=e.postProcessStages,y=o.usePostProcess=!c&&(e._hdr||m.length>0||m.ambientOcclusion.enabled||m.fxaa.enabled||m.bloom.enabled);o.usePostProcessSelected=!1,y&&(s.sceneFramebuffer.update(i,s.viewport,e._hdr,e.msaaSamples),s.sceneFramebuffer.clear(i,t,n),m.update(i,r.useLogDepth,e._hdr),m.clear(i),y=o.usePostProcess=m.ready,o.usePostProcessSelected=y&&m.hasSelected),o.isSunVisible&&e.sunBloom&&!u?(t.framebuffer=e._sunPostProcess.update(t),e._sunPostProcess.clear(i,t,n)):d?t.framebuffer=s.globeDepth.framebuffer:y&&(t.framebuffer=s.sceneFramebuffer.framebuffer),l(t.framebuffer)&&f.execute(i,t);let A=o.useInvertClassification=!c&&l(t.framebuffer)&&e.invertClassification;if(!c&&e._enableEdgeVisibility&&s.edgeFramebuffer.update(i,s.viewport,e._hdr),!c&&e._enablePlanarFillId?s.planarFillIdFramebuffer.update(i,s.viewport,e._hdr):c||s.planarFillIdFramebuffer.releaseResources(),A){let T;if(r.invertClassificationColor.alpha===1&&d&&(T=s.globeDepth.framebuffer),l(T)||i.depthTexture){if(e._invertClassification.previousFramebuffer=T,e._invertClassification.update(i,e.msaaSamples,s.globeDepth.colorFramebufferManager),e._invertClassification.clear(i,t),r.invertClassificationColor.alpha<1&&g){let E=e._invertClassification.unclassifiedCommand,v=E.derivedCommands;v.oit=p.createDerivedCommands(E,i,v.oit)}}else o.useInvertClassification=!1}e._globeTranslucencyState.translucent&&s.globeTranslucencyFramebuffer.updateAndClear(e._hdr,s.viewport,i,t)}Ai.prototype.resolveFramebuffers=function(e){let t=this._context,n=this._environmentState,i=this._view,{globeDepth:r,translucentTileClassification:o}=i;l(r)&&r.prepareColorTextures(t);let{useOIT:s,useGlobeDepthFramebuffer:a,usePostProcess:c,originalFramebuffer:u}=n,f=a?r.colorFramebufferManager:void 0,d=i.sceneFramebuffer._colorFramebuffer,p=i.sceneFramebuffer.idFramebuffer;if(s&&(e.framebuffer=c?d.framebuffer:u,i.oit.execute(t,e)),o.hasTranslucentDepth&&o.isSupported()&&o.execute(this,e),c){i.sceneFramebuffer.prepareColorTextures(t);let g=d;a&&!s&&(g=f);let m=this.postProcessStages,y=g.getColorTexture(0),A=p.getColorTexture(0),b=(f??d).getDepthStencilTexture();m.execute(t,y,b,A),m.copy(t,u)}!s&&!c&&a&&(e.framebuffer=u,r.executeCopyColor(t,e))};function ZMt(e){let t=e._frameState.afterRender,n=t.slice();t.length=0;for(let i=0;i<n.length;++i)n[i]()&&e.requestRender()}function QMt(e){if(e.mode===re.MORPHING)return;let t=e.camera.positionCartographic;return e.getHeight(t)}function RRe(e,t,n){let i=Number.NEGATIVE_INFINITY;if(e instanceof Qc){let r=e.length;for(let o=0;o<r;++o){let s=e.get(o),a=RRe(s,t,n);l(a)&&a>i&&(i=a)}}else if(e.isCesium3DTileset&&e.show&&e.enableCollision){let r=e.getHeight(t,n);if(l(r)&&r>i)return r}return i}Ai.prototype.getHeight=function(e,t){if(!l(e))return;let n=this._frameState.frameNumber;this._heightQueryFrame!==n&&(this._heightQueryFrame=n,this._heightQueryCache.clear());let i=`${t}:${e.longitude.toFixed(8)}:${e.latitude.toFixed(8)}`,r=this._heightQueryCache.get(i);if(r!==void 0)return r===null?void 0:r;let o=eNt(this,e,t);return this._heightQueryCache.set(i,o===void 0?null:o),o};function eNt(e,t,n){let i=n===We.CLAMP_TO_TERRAIN||n===We.RELATIVE_TO_TERRAIN,r=n===We.CLAMP_TO_3D_TILE||n===We.RELATIVE_TO_3D_TILE;if(!l(t))return;let o=Number.NEGATIVE_INFINITY;if(!i){let a=RRe(e.primitives,t,e);l(a)&&a>o&&(o=a)}let s=e._globe;if(!r&&l(s)&&s.show){let a=s.getHeight(t);a>o&&(o=a)}if(o>Number.NEGATIVE_INFINITY)return o}var _ie=new he;Ai.prototype.updateHeight=function(e,t,n){let i=this._ellipsoid,r=g=>{he.clone(e,_ie);let m;l(g)&&(m=g.height),l(m)||(m=this.getHeight(e,n)),l(m)&&(_ie.height=m,t(_ie))},o=n===We.CLAMP_TO_TERRAIN||n===We.RELATIVE_TO_TERRAIN,s=n===We.CLAMP_TO_3D_TILE||n===We.RELATIVE_TO_3D_TILE,a;!s&&l(this.globe)&&(a=this.globe._surface.updateHeight(e,r));let c={},u=g=>{if(o||g.isDestroyed()||!g.isCesium3DTileset)return;let m=g.updateHeight(e,r,i);c[g.id]=m};if(!o){let g=this.primitives.length;for(let m=0;m<g;++m){let y=this.primitives.get(m);u(y)}}let f=this.primitives.primitiveAdded.addEventListener(u),d=this.primitives.primitiveRemoved.addEventListener(g=>{g.isDestroyed()||!g.isCesium3DTileset||(l(c[g.id])&&c[g.id](),delete c[g.id])});return()=>{a=a&&a(),Object.values(c).forEach(g=>g()),c={},f(),d()}};function tNt(e){let t=e.camera,n=e._mode,i=e._screenSpaceCameraController,r=t.positionCartographic;if(!l(r))return!1;if(!i.onMap()&&r.height<0)return!0;if(n===re.SCENE2D||n===re.MORPHING)return!1;let o=e._globeHeight;return l(o)&&r.height<o}Ai.prototype.initializeFrame=function(){if(this._shaderFrameCount++===120&&(this._shaderFrameCount=0,this._context.shaderCache.destroyReleasedShaderPrograms(),this._context.textureCache.destroyReleasedTextures()),this._tweens.update(),this._globeHeightDirty){l(this._removeUpdateHeightCallback)&&(this._removeUpdateHeightCallback(),this._removeUpdateHeightCallback=void 0),this._globeHeight=QMt(this),this._globeHeightDirty=!1;let e=this.camera.positionCartographic;this._removeUpdateHeightCallback=this.updateHeight(e,t=>{this.isDestroyed()||(this._globeHeight=t.height)})}this._cameraUnderground=tNt(this),this._globeTranslucencyState.update(this),this._screenSpaceCameraController.update(),l(this._deviceOrientationCameraController)&&this._deviceOrientationCameraController.update(),this.camera.update(this._mode),this.camera._updateCameraChanged()};function nNt(e,t){if(e.debugShowFramesPerSecond){if(!l(e._performanceDisplay)){let n=document.createElement("div");n.className="cesium-performanceDisplay-defaultContainer",e._canvas.parentNode.appendChild(n);let r=new k_({container:n});e._performanceDisplay=r,e._performanceContainer=n}e._performanceDisplay.throttled=e.requestRenderMode,e._performanceDisplay.update(t)}else l(e._performanceDisplay)&&(e._performanceDisplay=e._performanceDisplay&&e._performanceDisplay.destroy(),e._performanceContainer.parentNode.removeChild(e._performanceContainer))}function iNt(e){e._jobScheduler.resetBudgets();let t=e._frameState;e.primitives.prePassesUpdate(t),l(e.globe)&&e.globe.update(t),e._picking.update(),t.creditDisplay.update()}function rNt(e){e.primitives.postPassesUpdate(e._frameState),Kc.update()}var oNt=new z;function sNt(e){let t=e._frameState,n=e.context,{uniformState:i}=n,r=e._defaultView;e._view=r,e.updateFrameState(),t.passes.render=!0,t.passes.postProcess=e.postProcessStages.hasSelected,t.tilesetPassState=dMt;let o=e.backgroundColor??z.BLACK;e._hdr&&(o=z.clone(o,oNt),o.red=Math.pow(o.red,e.gamma),o.green=Math.pow(o.green,e.gamma),o.blue=Math.pow(o.blue,e.gamma)),t.backgroundColor=o,t.atmosphere=e.atmosphere,e.fog.update(t),i.update(t);let s=e.shadowMap;l(s)&&s.enabled&&(!l(e.light)||e.light instanceof dg?h.negate(i.sunDirectionWC,e._shadowMapCamera.direction):h.clone(e.light.direction,e._shadowMapCamera.direction),t.shadowMaps.push(s)),e._computeCommandList.length=0,e._overlayCommandList.length=0;let a=r.viewport;a.x=0,a.y=0,a.width=n.drawingBufferWidth,a.height=n.drawingBufferHeight;let c=r.passState;c.framebuffer=void 0,c.blendingEnabled=void 0,c.scissorTest=void 0,c.viewport=et.clone(a,c.viewport),n.beginFrame(),l(e.globe)&&e.globe.beginFrame(t),e.updateEnvironment(),e.updateAndExecuteCommands(c,o),e.resolveFramebuffers(c),c.framebuffer=void 0,LMt(e,c),l(e.globe)&&(e.globe.endFrame(t),e.globe.tilesLoaded||(e._renderRequested=!0)),n.endFrame()}function ZE(e,t){try{t(e)}catch(n){if(e._renderError.raiseEvent(e,n),e.rethrowRenderErrors)throw n}}function aNt(e){return e._picking.updateMostDetailedRayPicks(e)}Ai.prototype.render=function(e){this._preUpdate.raiseEvent(this,e);let t=this._frameState;t.newFrame=!1,l(e)||(e=K.now()),this._controllerHost.update(this,e);let n=this._view.checkForCameraUpdates(this);n&&(this._globeHeightDirty=!0);let i=!this.requestRenderMode||this._renderRequested||n||this._logDepthBufferDirty||this._hdrDirty||this.mode===re.MORPHING;if(!i&&l(this.maximumRenderTimeChange)&&l(this._lastRenderTime)){let r=Math.abs(K.secondsDifference(this._lastRenderTime,e));i=i||r>this.maximumRenderTimeChange}if(i){this._lastRenderTime=K.clone(e,this._lastRenderTime),this._renderRequested=!1,this._logDepthBufferDirty=!1,this._hdrDirty=!1;let r=D.incrementWrap(t.frameNumber,XA.maximumFrameNumber,1);vRe(this,r,e),t.newFrame=!0}ZE(this,iNt),this.primitives.show&&(ZE(this,aNt),ZE(this,cNt),ZE(this,lNt),i||ZE(this,uNt)),this._postUpdate.raiseEvent(this,e),i&&(this._preRender.raiseEvent(this,e),t.creditDisplay.beginFrame(),ZE(this,sNt)),nNt(this,i),ZE(this,rNt),ZMt(this),i&&(this._postRender.raiseEvent(this,e),t.creditDisplay.endFrame())};Ai.prototype.forceRender=function(e){this._renderRequested=!0,this.render(e)};Ai.prototype.requestRender=function(){this._renderRequested=!0};Ai.prototype.clampLineWidth=function(e){return Math.max(kt.minimumAliasedLineWidth,Math.min(e,kt.maximumAliasedLineWidth))};Ai.prototype.pick=function(e,t,n){return this._picking.pick(this,e,t,n,1)[0]};Ai.prototype.snap=function(e,t){return bz.snap(this,e,t)};Ai.prototype.pickAsync=async function(e,t,n){return(await this._picking.pickAsync(this,e,t,n,1))[0]};Ai.prototype.pickVoxel=function(e,t,n){let i=this.pick(e,t,n);if(!l(i))return;let r=i.primitive;if(!(r instanceof pb))return;let o=this._picking.pickVoxelCoordinate(this,e,t,n),s=255*o[0]+o[1],a=r._traversal.findKeyframeNode(s);if(!l(a))return;let c=255*o[2]+o[3];return Sz.fromKeyframeNode(r,s,c,a)};Ai.prototype.pickMetadata=function(e,t,n,i){let r=this.pick(e);if(!l(r))return;let o=r.detail?.model?.structuralMetadata;if(!l(o))return;let s=o.schema,a=rV(s,t,n,i);if(!l(a))return;let c=sV(o,n,i);if(!l(c))return;let u=new oV(t,n,i,a,c);return this._picking.pickMetadata(this,e,u)};Ai.prototype.pickMetadataSchema=function(e){let t=this.pick(e);return l(t)?t.detail?.model?.structuralMetadata?.schema:void 0};Ai.prototype.pickPositionWorldCoordinates=function(e,t){return this._picking.pickPositionWorldCoordinates(this,e,t)};Ai.prototype.pickPosition=function(e,t){return this._picking.pickPosition(this,e,t)};Ai.prototype.drillPick=function(e,t,n,i){return this._picking.drillPick(this,e,t,n,i)};function cNt(e){let t=e._frameState;mie.camera=t.camera,mie.cullingVolume=t.cullingVolume,e.primitives.updateForPass(t,mie)}function lNt(e){let t=e._frameState;if(!t.camera.canPreloadFlight())return;pie.camera=e.preloadFlightCamera,pie.cullingVolume=e.preloadFlightCullingVolume,e.primitives.updateForPass(t,pie)}function uNt(e){e.primitives.updateForPass(e._frameState,hMt)}Ai.prototype.pickFromRay=function(e,t,n){return this._picking.pickFromRay(this,e,t,n)};Ai.prototype.drillPickFromRay=function(e,t,n,i){return this._picking.drillPickFromRay(this,e,t,n,i)};Ai.prototype.pickFromRayMostDetailed=function(e,t,n){return this._picking.pickFromRayMostDetailed(this,e,t,n)};Ai.prototype.drillPickFromRayMostDetailed=function(e,t,n,i){return this._picking.drillPickFromRayMostDetailed(this,e,t,n,i)};Ai.prototype.sampleHeight=function(e,t,n){return this._picking.sampleHeight(this,e,t,n)};Ai.prototype.clampToHeight=function(e,t,n,i){return this._picking.clampToHeight(this,e,t,n,i)};Ai.prototype.sampleHeightMostDetailed=function(e,t,n){return this._picking.sampleHeightMostDetailed(this,e,t,n)};Ai.prototype.clampToHeightMostDetailed=function(e,t,n){return this._picking.clampToHeightMostDetailed(this,e,t,n)};Ai.prototype.cartesianToCanvasCoordinates=function(e,t){return dr.worldToWindowCoordinates(this,e,t)};Ai.prototype.completeMorph=function(){this._transitioner.completeMorph()};Ai.prototype.morphTo2D=function(e){e=e??2,this._transitioner.morphTo2D(e,this._ellipsoid)};Ai.prototype.morphToColumbusView=function(e){e=e??2,this._transitioner.morphToColumbusView(e,this._ellipsoid)};Ai.prototype.morphTo3D=function(e){e=e??2,this._transitioner.morphTo3D(e,this._ellipsoid)};function fNt(e,t){if(e._removeTerrainProviderReadyListener=e._removeTerrainProviderReadyListener&&e._removeTerrainProviderReadyListener(),t.ready){l(e.globe)&&(e.globe.terrainProvider=t.provider);return}e.globe.terrainProvider=void 0,e._removeTerrainProviderReadyListener=t.readyEvent.addEventListener(n=>{l(e)&&l(e.globe)&&(e.globe.terrainProvider=n),e._removeTerrainProviderReadyListener()})}Ai.prototype.setTerrain=function(e){return fNt(this,e),e};Ai.prototype.isDestroyed=function(){return!1};Ai.prototype.destroy=function(){this._tweens.removeAll(),this._computeEngine=this._computeEngine&&this._computeEngine.destroy(),this._screenSpaceCameraController=this._screenSpaceCameraController&&this._screenSpaceCameraController.destroy(),this._deviceOrientationCameraController=this._deviceOrientationCameraController&&!this._deviceOrientationCameraController.isDestroyed()&&this._deviceOrientationCameraController.destroy(),this._primitives=this._primitives&&this._primitives.destroy(),this._groundPrimitives=this._groundPrimitives&&this._groundPrimitives.destroy(),this._globe=this._globe&&this._globe.destroy(),this._removeTerrainProviderReadyListener=this._removeTerrainProviderReadyListener&&this._removeTerrainProviderReadyListener(),this.skyBox=this.skyBox&&this.skyBox.destroy(),this.skyAtmosphere=this.skyAtmosphere&&this.skyAtmosphere.destroy(),this._debugSphere=this._debugSphere&&this._debugSphere.destroy(),this.sun=this.sun&&this.sun.destroy(),this._sunPostProcess=this._sunPostProcess&&this._sunPostProcess.destroy(),this._depthPlane=this._depthPlane&&this._depthPlane.destroy(),this._transitioner=this._transitioner&&this._transitioner.destroy(),this._debugFrustumPlanes=this._debugFrustumPlanes&&this._debugFrustumPlanes.destroy(),this._brdfLutGenerator=this._brdfLutGenerator&&this._brdfLutGenerator.destroy(),this._picking=this._picking&&this._picking.destroy(),this._defaultView=this._defaultView&&this._defaultView.destroy(),this._view=void 0,this._removeCreditContainer&&this._canvas.parentNode.removeChild(this._creditContainer),this.postProcessStages=this.postProcessStages&&this.postProcessStages.destroy(),this._context=this._context&&this._context.destroy(),this._frameState.creditDisplay=this._frameState.creditDisplay&&this._frameState.creditDisplay.destroy(),l(this._performanceDisplay)&&(this._performanceDisplay=this._performanceDisplay&&this._performanceDisplay.destroy(),this._performanceContainer.parentNode.removeChild(this._performanceContainer)),this._removeRequestListenerCallback(),this._removeTaskProcessorListenerCallback();for(let e=0;e<this._removeGlobeCallbacks.length;++e)this._removeGlobeCallbacks[e]();return this._removeGlobeCallbacks.length=0,l(this._removeUpdateHeightCallback)&&(this._removeUpdateHeightCallback(),this._removeUpdateHeightCallback=void 0),le(this)};var aV=Ai;function TI(e){e=e??ee.WGS84,this.show=!0,this.perFragmentAtmosphere=!1,this._ellipsoid=e;let t=1.025,n=h.multiplyByScalar(e.radii,t,new h);this._scaleMatrix=N.fromScale(n),this._modelMatrix=new N,this._command=new at({owner:this,modelMatrix:this._modelMatrix}),this._spSkyFromSpace=void 0,this._spSkyFromAtmosphere=void 0,this._flags=void 0,this.atmosphereLightIntensity=50,this.atmosphereRayleighCoefficient=new h(55e-7,13e-6,284e-7),this.atmosphereMieCoefficient=new h(21e-6,21e-6,21e-6),this.atmosphereRayleighScaleHeight=1e4,this.atmosphereMieScaleHeight=3200,this.atmosphereMieAnisotropy=.9,this.hueShift=0,this.saturationShift=0,this.brightnessShift=0,this._hueSaturationBrightness=new h;let i=new h;i.x=e.maximumRadius*t,i.y=e.maximumRadius,i.z=0,this._radiiAndDynamicAtmosphereColor=i;let r=this;this._command.uniformMap={u_radiiAndDynamicAtmosphereColor:function(){return r._radiiAndDynamicAtmosphereColor},u_hsbShift:function(){return r._hueSaturationBrightness.x=r.hueShift,r._hueSaturationBrightness.y=r.saturationShift,r._hueSaturationBrightness.z=r.brightnessShift,r._hueSaturationBrightness},u_atmosphereLightIntensity:function(){return r.atmosphereLightIntensity},u_atmosphereRayleighCoefficient:function(){return r.atmosphereRayleighCoefficient},u_atmosphereMieCoefficient:function(){return r.atmosphereMieCoefficient},u_atmosphereRayleighScaleHeight:function(){return r.atmosphereRayleighScaleHeight},u_atmosphereMieScaleHeight:function(){return r.atmosphereMieScaleHeight},u_atmosphereMieAnisotropy:function(){return r.atmosphereMieAnisotropy}}}Object.defineProperties(TI.prototype,{ellipsoid:{get:function(){return this._ellipsoid}}});TI.prototype.setDynamicLighting=function(e){this._radiiAndDynamicAtmosphereColor.z=e};var Aie=new N;TI.prototype.update=function(e,t){if(!this.show)return;let n=e.mode;if(n!==re.SCENE3D&&n!==re.MORPHING||!e.passes.render)return;let i=N.fromRotationTranslation(e.context.uniformState.inverseViewRotation,h.ZERO,Aie),r=N.multiplyTransformation(i,Hi.Y_UP_TO_Z_UP,Aie),o=N.multiply(this._scaleMatrix,r,Aie);N.clone(o,this._modelMatrix);let s=e.context,a=dNt(this),c=e.globeTranslucencyState.translucent,u=this.perFragmentAtmosphere||c||!l(t)||!t.show,f=this._command;if(!l(f.vertexArray)){let p=za.createGeometry(new za({radii:new h(1,1,1),slicePartitions:256,stackPartitions:256,vertexFormat:Be.POSITION_ONLY}));f.vertexArray=zn.fromGeometry({context:s,geometry:p,attributeLocations:Hn.createAttributeLocations(p),bufferUsage:Me.STATIC_DRAW}),f.renderState=Ge.fromCache({cull:{enabled:!0,face:zi.FRONT},blending:tn.ALPHA_BLEND,depthMask:!1})}let d=a|u<<2|c<<3;if(d!==this._flags){this._flags=d;let p=[];a&&p.push("COLOR_CORRECT"),u&&p.push("PER_FRAGMENT_ATMOSPHERE"),c&&p.push("GLOBE_TRANSLUCENT");let g=new Ye({defines:p,sources:[Yh,Rv,bM]}),m=new Ye({defines:p,sources:[Yh,Rv,AM]});this._spSkyAtmosphere=Qt.fromCache({context:s,vertexShaderSource:g,fragmentShaderSource:m}),f.shaderProgram=this._spSkyAtmosphere}return f};function dNt(e){return!(D.equalsEpsilon(e.hueShift,0,D.EPSILON7)&&D.equalsEpsilon(e.saturationShift,0,D.EPSILON7)&&D.equalsEpsilon(e.brightnessShift,0,D.EPSILON7))}TI.prototype.isDestroyed=function(){return!1};TI.prototype.destroy=function(){let e=this._command;return e.vertexArray=e.vertexArray&&e.vertexArray.destroy(),this._spSkyAtmosphere=this._spSkyAtmosphere&&this._spSkyAtmosphere.destroy(),le(this)};var cV=TI;function lV(e){this.sources=e.sources,this._sources=void 0,this._transform=e.transform,this.show=e.show??!0,this._returnCommand=e.returnCommand??!1,this._addToPanoramaCommandList=!this._returnCommand,this._command=new at({modelMatrix:N.clone(N.IDENTITY),owner:this,pass:Ie.ENVIRONMENT}),this._cubeMap=void 0,this._attributeLocations=void 0,this._useHdr=void 0,this._hasError=!1,this._error=void 0;let t=e.credit;typeof t=="string"&&(t=new It(t)),this._credit=t}Object.defineProperties(lV.prototype,{transform:{get:function(){return this._transform}},credit:{get:function(){return l(this._credit)?this._credit:void 0}}});lV.prototype.update=function(e,t){let n=this,{mode:i,passes:r,context:o,panoramaCommandList:s}=e;if(!this.show||i!==re.SCENE3D&&i!==re.MORPHING||!r.render)return;if(this._hasError){let c=this._error;throw this._hasError=!1,this._error=void 0,c}if(this._sources!==this.sources){this._sources=this.sources;let c=this.sources;typeof c.positiveX=="string"?DO(o,this._sources).then(function(u){n._cubeMap=n._cubeMap&&n._cubeMap.destroy(),n._cubeMap=u}).catch(u=>{this._hasError=!0,this._error=u}):(this._cubeMap=this._cubeMap&&this._cubeMap.destroy(),this._cubeMap=new ns({context:o,source:c})),this._addToPanoramaCommandList=!0}let a=this._command;if(!l(a.vertexArray)){a.uniformMap={u_cubeMap:function(){return n._cubeMap},u_cubeMapPanoramaTransform:function(){return n._transform}};let c=Ic.createGeometry(Ic.fromDimensions({dimensions:new h(2,2,2),vertexFormat:Be.POSITION_ONLY})),u=this._attributeLocations=Hn.createAttributeLocations(c);a.vertexArray=zn.fromGeometry({context:o,geometry:c,attributeLocations:u,bufferUsage:Me.STATIC_DRAW}),a.renderState=Ge.fromCache({depthTest:{enabled:!1},depthMask:!1,blending:tn.ALPHA_BLEND}),this._addToPanoramaCommandList=!0}if(!l(a.shaderProgram)||this._useHdr!==t){let c=new Ye({defines:[t?"HDR":""],sources:[xM]});a.shaderProgram=Qt.fromCache({context:o,vertexShaderSource:l(this._transform)?nM:TM,fragmentShaderSource:c,attributeLocations:this._attributeLocations}),this._useHdr=t,this._addToPanoramaCommandList=!0}if(l(this._cubeMap)){if(this.show&&l(this._credit)&&!this._returnCommand&&e.creditDisplay.addCreditToNextFrame(this._credit),this._returnCommand)return a;this._addToPanoramaCommandList&&(s.push(a),this._addToPanoramaCommandList=!1)}};lV.prototype.isDestroyed=function(){return!1};lV.prototype.destroy=function(){let e=this._command;return e.vertexArray=e.vertexArray&&e.vertexArray.destroy(),e.shaderProgram=e.shaderProgram&&e.shaderProgram.destroy(),this._cubeMap=this._cubeMap&&this._cubeMap.destroy(),le(this)};var QE=lV;function eC(e){this._sources=e.sources,this._show=e.show??!0,this._panorama=new QE({sources:this._sources,show:this._show,returnCommand:!0})}Object.defineProperties(eC.prototype,{sources:{get:function(){return this._panorama.sources},set:function(e){this._panorama.sources=e}},show:{get:function(){return this._panorama.show},set:function(e){this._panorama.show=e}}});eC.prototype.update=function(e,t){let{mode:n,passes:i}=e;if(!(n!==re.SCENE3D&&n!==re.MORPHING)&&i.render)return this._panorama.update(e,t)};eC.prototype.isDestroyed=function(){return!1};eC.prototype.destroy=function(){return this._panorama=this._panorama&&this._panorama.destroy(),le(this)};function EI(e){return Zt(`Assets/Textures/SkyBox/tycho2t3_80_${e}.jpg`)}eC.createEarthSkyBox=function(){return new eC({sources:{positiveX:EI("px"),negativeX:EI("mx"),positiveY:EI("py"),negativeY:EI("my"),positiveZ:EI("pz"),negativeZ:EI("mz")}})};var uV=eC;function dV(){this.show=!0,this._drawCommand=new at({primitiveType:Oe.TRIANGLES,boundingVolume:new ue,owner:this}),this._commands={drawCommand:this._drawCommand,computeCommand:void 0},this._boundingVolume=new ue,this._boundingVolume2D=new ue,this._texture=void 0,this._drawingBufferWidth=void 0,this._drawingBufferHeight=void 0,this._radiusTS=void 0,this._size=void 0,this.glowFactor=1,this._glowFactorDirty=!1,this._useHdr=void 0;let e=this;this._uniformMap={u_texture:function(){return e._texture},u_size:function(){return e._size}}}Object.defineProperties(dV.prototype,{glowFactor:{get:function(){return this._glowFactor},set:function(e){e=Math.max(e,0),this._glowFactor=e,this._glowFactorDirty=!0}}});var hNt=new U,mNt=new U,pNt=new se,fV=new se;dV.prototype.update=function(e,t,n){if(!this.show)return;let i=e.mode;if(i===re.SCENE2D||i===re.MORPHING||!e.passes.render)return;let r=e.context,o=t.viewport.width,s=t.viewport.height;if(!l(this._texture)||o!==this._drawingBufferWidth||s!==this._drawingBufferHeight||this._glowFactorDirty||n!==this._useHdr){this._texture=this._texture&&this._texture.destroy(),this._drawingBufferWidth=o,this._drawingBufferHeight=s,this._glowFactorDirty=!1,this._useHdr=n;let E=Math.max(o,s);E=Math.pow(2,Math.ceil(Math.log(E)/Math.log(2))-2),E=Math.max(1,E);let v=n?r.halfFloatingPointTexture?ze.HALF_FLOAT:ze.FLOAT:ze.UNSIGNED_BYTE;this._texture=new Dt({context:r,width:E,height:E,pixelFormat:Ke.RGBA,pixelDatatype:v}),this._glowLengthTS=this._glowFactor*5,this._radiusTS=1/(1+2*this._glowLengthTS)*.5;let S=this,I={u_radiusTS:function(){return S._radiusTS}};this._commands.computeCommand=new xf({fragmentShaderSource:CM,outputTexture:this._texture,uniformMap:I,persists:!1,owner:this,postExecute:function(){S._commands.computeCommand=void 0}})}let a=this._drawCommand;if(!l(a.vertexArray)){let E={direction:0},v=new Uint8Array(8);v[0]=0,v[1]=0,v[2]=255,v[3]=0,v[4]=255,v[5]=255,v[6]=0,v[7]=255;let S=tt.createVertexBuffer({context:r,typedArray:v,usage:Me.STATIC_DRAW}),I=[{index:E.direction,vertexBuffer:S,componentsPerAttribute:2,normalize:!0,componentDatatype:Y.UNSIGNED_BYTE}],R=tt.createIndexBuffer({context:r,typedArray:new Uint16Array([0,1,2,0,2,3]),usage:Me.STATIC_DRAW,indexDatatype:je.UNSIGNED_SHORT});a.vertexArray=new zn({context:r,attributes:I,indexBuffer:R}),a.shaderProgram=Qt.fromCache({context:r,vertexShaderSource:vM,fragmentShaderSource:EM,attributeLocations:E}),a.renderState=Ge.fromCache({blending:tn.ALPHA_BLEND}),a.uniformMap=this._uniformMap}let c=r.uniformState.sunPositionWC,u=r.uniformState.sunPositionColumbusView,f=this._boundingVolume,d=this._boundingVolume2D;h.clone(c,f.center),d.center.x=u.z,d.center.y=u.x,d.center.z=u.y,f.radius=D.SOLAR_RADIUS+D.SOLAR_RADIUS*this._glowLengthTS,d.radius=f.radius,i===re.SCENE3D?ue.clone(f,a.boundingVolume):i===re.COLUMBUS_VIEW&&ue.clone(d,a.boundingVolume);let p=dr.computeActualEllipsoidPosition(e,c,fV),g=h.magnitude(h.subtract(p,e.camera.position,fV)),m=r.uniformState.projection,y=pNt;y.x=0,y.y=0,y.z=-g,y.w=1;let A=N.multiplyByVector(m,y,fV),b=dr.clipToGLWindowCoordinates(t.viewport,A,hNt);y.x=D.SOLAR_RADIUS;let x=N.multiplyByVector(m,y,fV),T=dr.clipToGLWindowCoordinates(t.viewport,x,mNt);return this._size=U.magnitude(U.subtract(T,b,fV)),this._size=2*this._size*(1+2*this._glowLengthTS),this._size=Math.ceil(this._size),this._commands};dV.prototype.isDestroyed=function(){return!1};dV.prototype.destroy=function(){let e=this._drawCommand;return e.vertexArray=e.vertexArray&&e.vertexArray.destroy(),e.shaderProgram=e.shaderProgram&&e.shaderProgram.destroy(),this._texture=this._texture&&this._texture.destroy(),le(this)};var hV=dV;var NRe=Qo(mj(),1);function gNt(e,t,n){return` float clipDistance = clip(gl_FragCoord, ${e}, ${t}); vec4 clippingPlanesEdgeColor = vec4(1.0); clippingPlanesEdgeColor.rgb = ${n}.rgb; float clippingPlanesEdgeWidth = ${n}.a; @@ -12560,7 +12560,7 @@ return properties; { out_FragColor = clippingPlanesEdgeColor; } -`}var v4=_Vt;var yVt={modifyFragmentShader:function(t){return t=Ye.replaceMain(t,"czm_splitter_main"),t+=`uniform float czm_splitDirection; +`}var mV=gNt;var _Nt={modifyFragmentShader:function(t){return t=Ye.replaceMain(t,"czm_splitter_main"),t+=`uniform float czm_splitDirection; void main() { #ifndef SHADOW_MAP @@ -12569,9 +12569,9 @@ void main() #endif czm_splitter_main(); } -`,t},addUniforms:function(t,n){n.czm_splitDirection=function(){return t.splitDirection}}},PP=yVt;var OC={NEEDS_DECODE:0,DECODING:1,READY:2,FAILED:3};function S4(e){this._parsedContent=void 0,this._drawCommand=void 0,this._isTranslucent=!1,this._styleTranslucent=!1,this._constantColor=z.clone(z.DARKGRAY),this._highlightColor=z.clone(z.WHITE),this._pointSize=1,this._rtcCenter=void 0,this._quantizedVolumeScale=void 0,this._quantizedVolumeOffset=void 0,this._styleableShaderAttributes=void 0,this._isQuantized=!1,this._isOctEncoded16P=!1,this._isRGB565=!1,this._hasColors=!1,this._hasNormals=!1,this._hasBatchIds=!1,this._decodingState=OC.READY,this._dequantizeInShader=!0,this._isQuantizedDraco=!1,this._isOctEncodedDraco=!1,this._quantizedRange=0,this._octEncodedRange=0,this.backFaceCulling=!1,this._backFaceCulling=!1,this.normalShading=!0,this._normalShading=!0,this._opaqueRenderState=void 0,this._translucentRenderState=void 0,this._mode=void 0,this._ready=!1,this._pointsLength=0,this._geometryByteLength=0,this._vertexShaderLoaded=e.vertexShaderLoaded,this._fragmentShaderLoaded=e.fragmentShaderLoaded,this._uniformMapLoaded=e.uniformMapLoaded,this._batchTableLoaded=e.batchTableLoaded,this._pickIdLoaded=e.pickIdLoaded,this._opaquePass=e.opaquePass??Ie.OPAQUE,this._cull=e.cull??!0,this.style=void 0,this._style=void 0,this.styleDirty=!1,this.modelMatrix=N.clone(N.IDENTITY),this._modelMatrix=N.clone(N.IDENTITY),this.time=0,this.shadows=Dn.ENABLED,this._boundingSphere=void 0,this.clippingPlanes=void 0,this.isClipped=!1,this.clippingPlanesDirty=!1,this.clippingPlanesOriginMatrix=void 0,this.attenuation=!1,this._attenuation=!1,this.geometricError=0,this.geometricErrorScale=1,this.maximumAttenuation=this._pointSize,this.splitDirection=e.splitDirection??jo.NONE,this._splittingEnabled=!1,this._error=void 0,AVt(this,e)}Object.defineProperties(S4.prototype,{pointsLength:{get:function(){return this._pointsLength}},geometryByteLength:{get:function(){return this._geometryByteLength}},ready:{get:function(){return this._ready}},color:{get:function(){return z.clone(this._highlightColor)},set:function(e){this._highlightColor=z.clone(e,this._highlightColor)}},boundingSphere:{get:function(){if(l(this._drawCommand))return this._drawCommand.boundingVolume},set:function(e){this._boundingSphere=ue.clone(e,this._boundingSphere)}}});function AVt(e,t){let n=wT.parse(t.arrayBuffer,t.byteOffset);if(e._parsedContent=n,e._rtcCenter=n.rtcCenter,e._hasNormals=n.hasNormals,e._hasColors=n.hasColors,e._hasBatchIds=n.hasBatchIds,e._isTranslucent=n.isTranslucent,!n.hasBatchIds&&l(n.batchTableBinary)&&(n.styleableProperties=sm.getBinaryProperties(n.pointsLength,n.batchTableJson,n.batchTableBinary)),l(n.draco)){let a=n.draco;e._decodingState=OC.NEEDS_DECODE,a.dequantizeInShader=e._dequantizeInShader}let i=n.positions;l(i)&&(e._isQuantized=i.isQuantized,e._quantizedVolumeScale=i.quantizedVolumeScale,e._quantizedVolumeOffset=i.quantizedVolumeOffset,e._quantizedRange=i.quantizedRange);let r=n.normals;l(r)&&(e._isOctEncoded16P=r.octEncoded);let o=n.colors;l(o)&&(l(o.constantColor)&&(e._constantColor=z.clone(o.constantColor,e._constantColor),e._hasColors=!1),e._isRGB565=o.isRGB565);let s=n.batchIds;l(n.batchIds)&&(s.name="BATCH_ID",s.semantic="BATCH_ID",s.setIndex=void 0),n.hasBatchIds&&e._batchTableLoaded(n.batchLength,n.batchTableJson,n.batchTableBinary),e._pointsLength=n.pointsLength}var bVt=new h,xVt=new h,TVt=new h,zBe,yW;function EVt(e){if(!l(yW)){zBe=new jBe.default(0),yW=new Array(e);for(let t=0;t<e;++t)yW[t]=zBe.random()}return yW}function CVt(e){let n=e.length/3,i=Math.min(n,20),r=EVt(20),o=Number.MAX_VALUE,s=-Number.MAX_VALUE,a=h.fromElements(o,o,o,bVt),c=h.fromElements(s,s,s,xVt);for(let f=0;f<i;++f){let d=Math.floor(r[f]*n),p=h.unpack(e,d*3,TVt);h.minimumByComponent(a,p,a),h.maximumByComponent(c,p,c)}let u=ue.fromCornerPoints(a,c);return u.radius+=D.EPSILON2,u}function VBe(e,t){let n=Y.fromTypedArray(e);return n===Y.INT||n===Y.UNSIGNED_INT||n===Y.DOUBLE?(_t("Cast pnts property to floats",`Point cloud property "${t}" will be cast to a float array because INT, UNSIGNED_INT, and DOUBLE are not valid WebGL vertex attribute types. Some precision may be lost.`),new Float32Array(e)):e}var vVt=new se,SVt=new se,wVt=new z,HBe=0,AW=1,Jse=2,GBe=3,IVt=4,Yse=new N,PVt=new N;function DVt(e,t){let n=t.context,i=e._parsedContent,r=e._pointsLength,o=i.positions,s=i.colors,a=i.normals,c=i.batchIds,u=i.styleableProperties,f=l(u),d=e._isQuantized,p=e._isQuantizedDraco,g=e._isOctEncoded16P,m=e._isOctEncodedDraco,y=e._quantizedRange,A=e._octEncodedRange,b=e._isRGB565,x=e._isTranslucent,T=e._hasColors,E=e._hasNormals,v=e._hasBatchIds,S,I,R=[],O={};if(e._styleableShaderAttributes=O,f){let B=IVt;for(let j in u)if(u.hasOwnProperty(j)){let k=u[j],G=VBe(k.typedArray,j);S=k.componentCount,I=Y.fromTypedArray(G);let q=tt.createVertexBuffer({context:n,typedArray:G,usage:Me.STATIC_DRAW});e._geometryByteLength+=q.sizeInBytes;let Q={index:B,vertexBuffer:q,componentsPerAttribute:S,componentDatatype:I,normalize:!1,offsetInBytes:0,strideInBytes:0};R.push(Q),O[j]={location:B,componentCount:S},++B}}let L=tt.createVertexBuffer({context:n,typedArray:o.typedArray,usage:Me.STATIC_DRAW});e._geometryByteLength+=L.sizeInBytes;let _;T&&(_=tt.createVertexBuffer({context:n,typedArray:s.typedArray,usage:Me.STATIC_DRAW}),e._geometryByteLength+=_.sizeInBytes);let C;E&&(C=tt.createVertexBuffer({context:n,typedArray:a.typedArray,usage:Me.STATIC_DRAW}),e._geometryByteLength+=C.sizeInBytes);let w;v&&(c.typedArray=VBe(c.typedArray,"batchIds"),w=tt.createVertexBuffer({context:n,typedArray:c.typedArray,usage:Me.STATIC_DRAW}),e._geometryByteLength+=w.sizeInBytes);let P=[];if(d?I=Y.UNSIGNED_SHORT:p?I=y<=255?Y.UNSIGNED_BYTE:Y.UNSIGNED_SHORT:I=Y.FLOAT,P.push({index:HBe,vertexBuffer:L,componentsPerAttribute:3,componentDatatype:I,normalize:!1,offsetInBytes:0,strideInBytes:0}),e._cull&&(d||p?e._boundingSphere=ue.fromCornerPoints(h.ZERO,e._quantizedVolumeScale):e._boundingSphere=CVt(o.typedArray)),T)if(b)P.push({index:AW,vertexBuffer:_,componentsPerAttribute:1,componentDatatype:Y.UNSIGNED_SHORT,normalize:!1,offsetInBytes:0,strideInBytes:0});else{let B=x?4:3;P.push({index:AW,vertexBuffer:_,componentsPerAttribute:B,componentDatatype:Y.UNSIGNED_BYTE,normalize:!0,offsetInBytes:0,strideInBytes:0})}E&&(g?(S=2,I=Y.UNSIGNED_BYTE):m?(S=2,I=A<=255?Y.UNSIGNED_BYTE:Y.UNSIGNED_SHORT):(S=3,I=Y.FLOAT),P.push({index:Jse,vertexBuffer:C,componentsPerAttribute:S,componentDatatype:I,normalize:!1,offsetInBytes:0,strideInBytes:0})),v&&P.push({index:GBe,vertexBuffer:w,componentsPerAttribute:1,componentDatatype:Y.fromTypedArray(c.typedArray),normalize:!1,offsetInBytes:0,strideInBytes:0}),f&&(P=P.concat(R));let M=new zn({context:n,attributes:P}),F={depthTest:{enabled:!0}},V={depthTest:{enabled:!0},depthMask:!1,blending:tn.ALPHA_BLEND};e._opaquePass===Ie.CESIUM_3D_TILE&&(F.stencilTest=Yt.setCesium3DTileBit(),F.stencilMask=Yt.CESIUM_3D_TILE_MASK,V.stencilTest=Yt.setCesium3DTileBit(),V.stencilMask=Yt.CESIUM_3D_TILE_MASK),e._opaqueRenderState=Ge.fromCache(F),e._translucentRenderState=Ge.fromCache(V),e._drawCommand=new at({boundingVolume:new ue,cull:e._cull,modelMatrix:new N,primitiveType:Oe.POINTS,vertexArray:M,count:r,shaderProgram:void 0,uniformMap:void 0,renderState:x?e._translucentRenderState:e._opaqueRenderState,pass:x?Ie.TRANSLUCENT:e._opaquePass,owner:e,castShadows:!1,receiveShadows:!1,pickId:e._pickIdLoaded()})}function RVt(e,t){let n=t.context,i=e._isQuantized,r=e._isQuantizedDraco,o=e._isOctEncodedDraco,s={u_pointSizeAndTimeAndGeometricErrorAndDepthMultiplier:function(){let a=vVt;if(a.x=e._attenuation?e.maximumAttenuation:e._pointSize,a.x*=t.pixelRatio,a.y=e.time,e._attenuation){let c=t.camera.frustum,u;t.mode===re.SCENE2D||c instanceof gn?u=Number.POSITIVE_INFINITY:u=n.drawingBufferHeight/t.camera.frustum.sseDenominator,a.z=e.geometricError*e.geometricErrorScale,a.w=u}return a},u_highlightColor:function(){return e._highlightColor},u_constantColor:function(){return e._constantColor},u_clippingPlanes:function(){let a=e.clippingPlanes;return e.isClipped?a.texture:n.defaultTexture},u_clippingPlanesEdgeStyle:function(){let a=e.clippingPlanes;if(!l(a))return z.TRANSPARENT;let c=z.clone(a.edgeColor,wVt);return c.alpha=a.edgeWidth,c},u_clippingPlanesMatrix:function(){let a=e.clippingPlanes;if(!l(a))return N.IDENTITY;let c=e.clippingPlanesOriginMatrix??e._modelMatrix;N.multiply(n.uniformState.view3D,c,Yse);let u=N.multiply(Yse,a.modelMatrix,Yse);return N.inverseTranspose(u,PVt)}};PP.addUniforms(e,s),(i||r||o)&&(s=Ot(s,{u_quantizedVolumeScaleAndOctEncodedRange:function(){let a=SVt;if(l(e._quantizedVolumeScale)){let c=h.clone(e._quantizedVolumeScale,a);h.divideByScalar(c,e._quantizedRange,a)}return a.w=e._octEncodedRange,a}})),l(e._uniformMapLoaded)&&(s=e._uniformMapLoaded(s)),e._drawCommand.uniformMap=s}function Xse(e,t){let n=/czm_3dtiles_property_(\d+)/g,i=n.exec(e);for(;i!==null;){let r=parseInt(i[1]);t.indexOf(r)===-1&&t.push(r),i=n.exec(e)}}function Kse(e,t){e=e.slice(e.indexOf(` -`));let n=/czm_3dtiles_builtin_property_(\w+)/g,i=n.exec(e);for(;i!==null;){let r=i[1];t.indexOf(r)===-1&&t.push(r),i=n.exec(e)}}function $se(e,t){let n=e.numberOfAttributes;for(let i=0;i<n;++i){let r=e.getAttribute(i);if(r.index===t)return r}}var OVt={POSITION:"czm_3dtiles_builtin_property_POSITION",POSITION_ABSOLUTE:"czm_3dtiles_builtin_property_POSITION_ABSOLUTE",COLOR:"czm_3dtiles_builtin_property_COLOR",NORMAL:"czm_3dtiles_builtin_property_NORMAL"};function MVt(e,t,n){let i,r,o,s=t.context,a=l(n),c=e._isQuantized,u=e._isQuantizedDraco,f=e._isOctEncoded16P,d=e._isOctEncodedDraco,p=e._isRGB565,g=e._isTranslucent,m=e._hasColors,y=e._hasNormals,A=e._hasBatchIds,b=e._backFaceCulling,x=e._normalShading,T=e._drawCommand.vertexArray,E=e.clippingPlanes,v=e._attenuation,S,I,R,O=g,L=Je(OVt),_={},C=e._styleableShaderAttributes;for(r in C)C.hasOwnProperty(r)&&(o=C[r],L[r]=`czm_3dtiles_property_${o.location}`,_[o.location]=o);if(a){let fe={translucent:!1},xe="(vec3 czm_3dtiles_builtin_property_POSITION, vec3 czm_3dtiles_builtin_property_POSITION_ABSOLUTE, vec4 czm_3dtiles_builtin_property_COLOR, vec3 czm_3dtiles_builtin_property_NORMAL)";S=n.getColorShaderFunction(`getColorFromStyle${xe}`,L,fe),I=n.getShowShaderFunction(`getShowFromStyle${xe}`,L,fe),R=n.getPointSizeShaderFunction(`getPointSizeFromStyle${xe}`,L,fe),l(S)&&fe.translucent&&(O=!0)}e._styleTranslucent=O;let w=l(S),P=l(I),M=l(R),F=e.isClipped,V=[],B=[];w&&(Xse(S,V),Kse(S,B)),P&&(Xse(I,V),Kse(I,B)),M&&(Xse(R,V),Kse(R,B));let j=B.indexOf("COLOR")>=0,k=B.indexOf("NORMAL")>=0;if(k&&!y)throw new oe("Style references the NORMAL semantic but the point cloud does not have normals");for(r in C)if(C.hasOwnProperty(r)){o=C[r];let fe=V.indexOf(o.location)>=0,xe=$se(T,o.location);xe.enabled=fe}let G=m&&(!w||j);if(m){let fe=$se(T,AW);fe.enabled=G}let q=y&&(x||b||k);if(y){let fe=$se(T,Jse);fe.enabled=q}let Q={a_position:HBe};G&&(Q.a_color=AW),q&&(Q.a_normal=Jse),A&&(Q.a_batchId=GBe);let W="",J=V.length;for(i=0;i<J;++i){let fe=V[i];o=_[fe];let xe=o.componentCount,ge=`czm_3dtiles_property_${fe}`,we;xe===1?we="float":we=`vec${xe}`,W+=`in ${we} ${ge}; -`,Q[ge]=o.location}RVt(e,t);let Z=`in vec3 a_position; +`,t},addUniforms:function(t,n){n.czm_splitDirection=function(){return t.splitDirection}}},CI=_Nt;var tC={NEEDS_DECODE:0,DECODING:1,READY:2,FAILED:3};function pV(e){this._parsedContent=void 0,this._drawCommand=void 0,this._isTranslucent=!1,this._styleTranslucent=!1,this._constantColor=z.clone(z.DARKGRAY),this._highlightColor=z.clone(z.WHITE),this._pointSize=1,this._rtcCenter=void 0,this._quantizedVolumeScale=void 0,this._quantizedVolumeOffset=void 0,this._styleableShaderAttributes=void 0,this._isQuantized=!1,this._isOctEncoded16P=!1,this._isRGB565=!1,this._hasColors=!1,this._hasNormals=!1,this._hasBatchIds=!1,this._decodingState=tC.READY,this._dequantizeInShader=!0,this._isQuantizedDraco=!1,this._isOctEncodedDraco=!1,this._quantizedRange=0,this._octEncodedRange=0,this.backFaceCulling=!1,this._backFaceCulling=!1,this.normalShading=!0,this._normalShading=!0,this._opaqueRenderState=void 0,this._translucentRenderState=void 0,this._mode=void 0,this._ready=!1,this._pointsLength=0,this._geometryByteLength=0,this._vertexShaderLoaded=e.vertexShaderLoaded,this._fragmentShaderLoaded=e.fragmentShaderLoaded,this._uniformMapLoaded=e.uniformMapLoaded,this._batchTableLoaded=e.batchTableLoaded,this._pickIdLoaded=e.pickIdLoaded,this._opaquePass=e.opaquePass??Ie.OPAQUE,this._cull=e.cull??!0,this.style=void 0,this._style=void 0,this.styleDirty=!1,this.modelMatrix=N.clone(N.IDENTITY),this._modelMatrix=N.clone(N.IDENTITY),this.time=0,this.shadows=Pn.ENABLED,this._boundingSphere=void 0,this.clippingPlanes=void 0,this.isClipped=!1,this.clippingPlanesDirty=!1,this.clippingPlanesOriginMatrix=void 0,this.attenuation=!1,this._attenuation=!1,this.geometricError=0,this.geometricErrorScale=1,this.maximumAttenuation=this._pointSize,this.splitDirection=e.splitDirection??Ho.NONE,this._splittingEnabled=!1,this._error=void 0,yNt(this,e)}Object.defineProperties(pV.prototype,{pointsLength:{get:function(){return this._pointsLength}},geometryByteLength:{get:function(){return this._geometryByteLength}},ready:{get:function(){return this._ready}},color:{get:function(){return z.clone(this._highlightColor)},set:function(e){this._highlightColor=z.clone(e,this._highlightColor)}},boundingSphere:{get:function(){if(l(this._drawCommand))return this._drawCommand.boundingVolume},set:function(e){this._boundingSphere=ue.clone(e,this._boundingSphere)}}});function yNt(e,t){let n=qT.parse(t.arrayBuffer,t.byteOffset);if(e._parsedContent=n,e._rtcCenter=n.rtcCenter,e._hasNormals=n.hasNormals,e._hasColors=n.hasColors,e._hasBatchIds=n.hasBatchIds,e._isTranslucent=n.isTranslucent,!n.hasBatchIds&&l(n.batchTableBinary)&&(n.styleableProperties=vm.getBinaryProperties(n.pointsLength,n.batchTableJson,n.batchTableBinary)),l(n.draco)){let a=n.draco;e._decodingState=tC.NEEDS_DECODE,a.dequantizeInShader=e._dequantizeInShader}let i=n.positions;l(i)&&(e._isQuantized=i.isQuantized,e._quantizedVolumeScale=i.quantizedVolumeScale,e._quantizedVolumeOffset=i.quantizedVolumeOffset,e._quantizedRange=i.quantizedRange);let r=n.normals;l(r)&&(e._isOctEncoded16P=r.octEncoded);let o=n.colors;l(o)&&(l(o.constantColor)&&(e._constantColor=z.clone(o.constantColor,e._constantColor),e._hasColors=!1),e._isRGB565=o.isRGB565);let s=n.batchIds;l(n.batchIds)&&(s.name="BATCH_ID",s.semantic="BATCH_ID",s.setIndex=void 0),n.hasBatchIds&&e._batchTableLoaded(n.batchLength,n.batchTableJson,n.batchTableBinary),e._pointsLength=n.pointsLength}var ANt=new h,bNt=new h,xNt=new h,ORe,a9;function TNt(e){if(!l(a9)){ORe=new NRe.default(0),a9=new Array(e);for(let t=0;t<e;++t)a9[t]=ORe.random()}return a9}function ENt(e){let n=e.length/3,i=Math.min(n,20),r=TNt(20),o=Number.MAX_VALUE,s=-Number.MAX_VALUE,a=h.fromElements(o,o,o,ANt),c=h.fromElements(s,s,s,bNt);for(let f=0;f<i;++f){let d=Math.floor(r[f]*n),p=h.unpack(e,d*3,xNt);h.minimumByComponent(a,p,a),h.maximumByComponent(c,p,c)}let u=ue.fromCornerPoints(a,c);return u.radius+=D.EPSILON2,u}function MRe(e,t){let n=Y.fromTypedArray(e);return n===Y.INT||n===Y.UNSIGNED_INT||n===Y.DOUBLE?(_t("Cast pnts property to floats",`Point cloud property "${t}" will be cast to a float array because INT, UNSIGNED_INT, and DOUBLE are not valid WebGL vertex attribute types. Some precision may be lost.`),new Float32Array(e)):e}var CNt=new se,vNt=new se,SNt=new z,LRe=0,c9=1,Cie=2,FRe=3,wNt=4,bie=new N,INt=new N;function PNt(e,t){let n=t.context,i=e._parsedContent,r=e._pointsLength,o=i.positions,s=i.colors,a=i.normals,c=i.batchIds,u=i.styleableProperties,f=l(u),d=e._isQuantized,p=e._isQuantizedDraco,g=e._isOctEncoded16P,m=e._isOctEncodedDraco,y=e._quantizedRange,A=e._octEncodedRange,b=e._isRGB565,x=e._isTranslucent,T=e._hasColors,E=e._hasNormals,v=e._hasBatchIds,S,I,R=[],O={};if(e._styleableShaderAttributes=O,f){let B=wNt;for(let j in u)if(u.hasOwnProperty(j)){let k=u[j],G=MRe(k.typedArray,j);S=k.componentCount,I=Y.fromTypedArray(G);let q=tt.createVertexBuffer({context:n,typedArray:G,usage:Me.STATIC_DRAW});e._geometryByteLength+=q.sizeInBytes;let Q={index:B,vertexBuffer:q,componentsPerAttribute:S,componentDatatype:I,normalize:!1,offsetInBytes:0,strideInBytes:0};R.push(Q),O[j]={location:B,componentCount:S},++B}}let L=tt.createVertexBuffer({context:n,typedArray:o.typedArray,usage:Me.STATIC_DRAW});e._geometryByteLength+=L.sizeInBytes;let _;T&&(_=tt.createVertexBuffer({context:n,typedArray:s.typedArray,usage:Me.STATIC_DRAW}),e._geometryByteLength+=_.sizeInBytes);let C;E&&(C=tt.createVertexBuffer({context:n,typedArray:a.typedArray,usage:Me.STATIC_DRAW}),e._geometryByteLength+=C.sizeInBytes);let w;v&&(c.typedArray=MRe(c.typedArray,"batchIds"),w=tt.createVertexBuffer({context:n,typedArray:c.typedArray,usage:Me.STATIC_DRAW}),e._geometryByteLength+=w.sizeInBytes);let P=[];if(d?I=Y.UNSIGNED_SHORT:p?I=y<=255?Y.UNSIGNED_BYTE:Y.UNSIGNED_SHORT:I=Y.FLOAT,P.push({index:LRe,vertexBuffer:L,componentsPerAttribute:3,componentDatatype:I,normalize:!1,offsetInBytes:0,strideInBytes:0}),e._cull&&(d||p?e._boundingSphere=ue.fromCornerPoints(h.ZERO,e._quantizedVolumeScale):e._boundingSphere=ENt(o.typedArray)),T)if(b)P.push({index:c9,vertexBuffer:_,componentsPerAttribute:1,componentDatatype:Y.UNSIGNED_SHORT,normalize:!1,offsetInBytes:0,strideInBytes:0});else{let B=x?4:3;P.push({index:c9,vertexBuffer:_,componentsPerAttribute:B,componentDatatype:Y.UNSIGNED_BYTE,normalize:!0,offsetInBytes:0,strideInBytes:0})}E&&(g?(S=2,I=Y.UNSIGNED_BYTE):m?(S=2,I=A<=255?Y.UNSIGNED_BYTE:Y.UNSIGNED_SHORT):(S=3,I=Y.FLOAT),P.push({index:Cie,vertexBuffer:C,componentsPerAttribute:S,componentDatatype:I,normalize:!1,offsetInBytes:0,strideInBytes:0})),v&&P.push({index:FRe,vertexBuffer:w,componentsPerAttribute:1,componentDatatype:Y.fromTypedArray(c.typedArray),normalize:!1,offsetInBytes:0,strideInBytes:0}),f&&(P=P.concat(R));let M=new zn({context:n,attributes:P}),F={depthTest:{enabled:!0}},V={depthTest:{enabled:!0},depthMask:!1,blending:tn.ALPHA_BLEND};e._opaquePass===Ie.CESIUM_3D_TILE&&(F.stencilTest=Yt.setCesium3DTileBit(),F.stencilMask=Yt.CESIUM_3D_TILE_MASK,V.stencilTest=Yt.setCesium3DTileBit(),V.stencilMask=Yt.CESIUM_3D_TILE_MASK),e._opaqueRenderState=Ge.fromCache(F),e._translucentRenderState=Ge.fromCache(V),e._drawCommand=new at({boundingVolume:new ue,cull:e._cull,modelMatrix:new N,primitiveType:Oe.POINTS,vertexArray:M,count:r,shaderProgram:void 0,uniformMap:void 0,renderState:x?e._translucentRenderState:e._opaqueRenderState,pass:x?Ie.TRANSLUCENT:e._opaquePass,owner:e,castShadows:!1,receiveShadows:!1,pickId:e._pickIdLoaded()})}function DNt(e,t){let n=t.context,i=e._isQuantized,r=e._isQuantizedDraco,o=e._isOctEncodedDraco,s={u_pointSizeAndTimeAndGeometricErrorAndDepthMultiplier:function(){let a=CNt;if(a.x=e._attenuation?e.maximumAttenuation:e._pointSize,a.x*=t.pixelRatio,a.y=e.time,e._attenuation){let c=t.camera.frustum,u;t.mode===re.SCENE2D||c instanceof gn?u=Number.POSITIVE_INFINITY:u=n.drawingBufferHeight/t.camera.frustum.sseDenominator,a.z=e.geometricError*e.geometricErrorScale,a.w=u}return a},u_highlightColor:function(){return e._highlightColor},u_constantColor:function(){return e._constantColor},u_clippingPlanes:function(){let a=e.clippingPlanes;return e.isClipped?a.texture:n.defaultTexture},u_clippingPlanesEdgeStyle:function(){let a=e.clippingPlanes;if(!l(a))return z.TRANSPARENT;let c=z.clone(a.edgeColor,SNt);return c.alpha=a.edgeWidth,c},u_clippingPlanesMatrix:function(){let a=e.clippingPlanes;if(!l(a))return N.IDENTITY;let c=e.clippingPlanesOriginMatrix??e._modelMatrix;N.multiply(n.uniformState.view3D,c,bie);let u=N.multiply(bie,a.modelMatrix,bie);return N.inverseTranspose(u,INt)}};CI.addUniforms(e,s),(i||r||o)&&(s=Ot(s,{u_quantizedVolumeScaleAndOctEncodedRange:function(){let a=vNt;if(l(e._quantizedVolumeScale)){let c=h.clone(e._quantizedVolumeScale,a);h.divideByScalar(c,e._quantizedRange,a)}return a.w=e._octEncodedRange,a}})),l(e._uniformMapLoaded)&&(s=e._uniformMapLoaded(s)),e._drawCommand.uniformMap=s}function xie(e,t){let n=/czm_3dtiles_property_(\d+)/g,i=n.exec(e);for(;i!==null;){let r=parseInt(i[1]);t.indexOf(r)===-1&&t.push(r),i=n.exec(e)}}function Tie(e,t){e=e.slice(e.indexOf(` +`));let n=/czm_3dtiles_builtin_property_(\w+)/g,i=n.exec(e);for(;i!==null;){let r=i[1];t.indexOf(r)===-1&&t.push(r),i=n.exec(e)}}function Eie(e,t){let n=e.numberOfAttributes;for(let i=0;i<n;++i){let r=e.getAttribute(i);if(r.index===t)return r}}var RNt={POSITION:"czm_3dtiles_builtin_property_POSITION",POSITION_ABSOLUTE:"czm_3dtiles_builtin_property_POSITION_ABSOLUTE",COLOR:"czm_3dtiles_builtin_property_COLOR",NORMAL:"czm_3dtiles_builtin_property_NORMAL"};function ONt(e,t,n){let i,r,o,s=t.context,a=l(n),c=e._isQuantized,u=e._isQuantizedDraco,f=e._isOctEncoded16P,d=e._isOctEncodedDraco,p=e._isRGB565,g=e._isTranslucent,m=e._hasColors,y=e._hasNormals,A=e._hasBatchIds,b=e._backFaceCulling,x=e._normalShading,T=e._drawCommand.vertexArray,E=e.clippingPlanes,v=e._attenuation,S,I,R,O=g,L=Je(RNt),_={},C=e._styleableShaderAttributes;for(r in C)C.hasOwnProperty(r)&&(o=C[r],L[r]=`czm_3dtiles_property_${o.location}`,_[o.location]=o);if(a){let fe={translucent:!1},xe="(vec3 czm_3dtiles_builtin_property_POSITION, vec3 czm_3dtiles_builtin_property_POSITION_ABSOLUTE, vec4 czm_3dtiles_builtin_property_COLOR, vec3 czm_3dtiles_builtin_property_NORMAL)";S=n.getColorShaderFunction(`getColorFromStyle${xe}`,L,fe),I=n.getShowShaderFunction(`getShowFromStyle${xe}`,L,fe),R=n.getPointSizeShaderFunction(`getPointSizeFromStyle${xe}`,L,fe),l(S)&&fe.translucent&&(O=!0)}e._styleTranslucent=O;let w=l(S),P=l(I),M=l(R),F=e.isClipped,V=[],B=[];w&&(xie(S,V),Tie(S,B)),P&&(xie(I,V),Tie(I,B)),M&&(xie(R,V),Tie(R,B));let j=B.indexOf("COLOR")>=0,k=B.indexOf("NORMAL")>=0;if(k&&!y)throw new oe("Style references the NORMAL semantic but the point cloud does not have normals");for(r in C)if(C.hasOwnProperty(r)){o=C[r];let fe=V.indexOf(o.location)>=0,xe=Eie(T,o.location);xe.enabled=fe}let G=m&&(!w||j);if(m){let fe=Eie(T,c9);fe.enabled=G}let q=y&&(x||b||k);if(y){let fe=Eie(T,Cie);fe.enabled=q}let Q={a_position:LRe};G&&(Q.a_color=c9),q&&(Q.a_normal=Cie),A&&(Q.a_batchId=FRe);let W="",J=V.length;for(i=0;i<J;++i){let fe=V[i];o=_[fe];let xe=o.componentCount,ge=`czm_3dtiles_property_${fe}`,we;xe===1?we="float":we=`vec${xe}`,W+=`in ${we} ${ge}; +`,Q[ge]=o.location}DNt(e,t);let Z=`in vec3 a_position; out vec4 v_color; uniform vec4 u_pointSizeAndTimeAndGeometricErrorAndDepthMultiplier; uniform vec4 u_constantColor; @@ -12642,43 +12642,15 @@ const float NORMALIZE_5 = 1.0 / 32.0; uniform mat4 u_clippingPlanesMatrix; uniform vec4 u_clippingPlanesEdgeStyle; `,ae+=` -`,ae+=eC(E,s),ae+=` +`,ae+=EE(E,s),ae+=` `),ae+=`void main() { out_FragColor = czm_gammaCorrect(v_color); -`,F&&(ae+=v4("u_clippingPlanes","u_clippingPlanesMatrix","u_clippingPlanesEdgeStyle")),ae+=`} -`,e.splitDirection!==jo.NONE&&(ae=PP.modifyFragmentShader(ae)),l(e._vertexShaderLoaded)&&(Z=e._vertexShaderLoaded(Z)),l(e._fragmentShaderLoaded)&&(ae=e._fragmentShaderLoaded(ae));let Ae=e._drawCommand;l(Ae.shaderProgram)&&Ae.shaderProgram.destroy(),Ae.shaderProgram=Qt.fromCache({context:s,vertexShaderSource:Z,fragmentShaderSource:ae,attributeLocations:Q});try{Ae.shaderProgram._bind()}catch{throw new oe("Error generating style shader: this may be caused by a type mismatch, index out-of-bounds, or other syntax error.")}}function NVt(e,t){if(e._decodingState===OC.READY)return!1;if(e._decodingState===OC.NEEDS_DECODE){let n=e._parsedContent,i=n.draco,r=Fg.decodePointCloud(i,t);l(r)&&(e._decodingState=OC.DECODING,r.then(function(o){e._decodingState=OC.READY;let s=l(o.POSITION)?o.POSITION.array:void 0,a=l(o.RGB)?o.RGB.array:void 0,c=l(o.RGBA)?o.RGBA.array:void 0,u=l(o.NORMAL)?o.NORMAL.array:void 0,f=l(o.BATCH_ID)?o.BATCH_ID.array:void 0,d=l(s)&&l(o.POSITION.data.quantization),p=l(u)&&l(o.NORMAL.data.quantization);if(d){let A=o.POSITION.data.quantization,b=A.range;e._quantizedVolumeScale=h.fromElements(b,b,b),e._quantizedVolumeOffset=h.unpack(A.minValues),e._quantizedRange=(1<<A.quantizationBits)-1,e._isQuantizedDraco=!0}p&&(e._octEncodedRange=(1<<o.NORMAL.data.quantization.quantizationBits)-1,e._isOctEncodedDraco=!0);let g=n.styleableProperties,m=i.batchTableProperties;for(let A in m)if(m.hasOwnProperty(A)){let b=o[A];l(g)||(g={}),g[A]={typedArray:b.array,componentCount:b.data.componentsPerAttribute}}l(s)&&(n.positions={typedArray:s});let y=c??a;l(y)&&(n.colors={typedArray:y}),l(u)&&(n.normals={typedArray:u}),l(f)&&(n.batchIds={typedArray:f}),n.styleableProperties=g}).catch(function(o){e._decodingState=OC.FAILED,e._error=o}))}return!0}var LVt=new se,FVt=new h;S4.prototype.update=function(e){let t=e.context;if(l(this._error)){let u=this._error;throw this._error=void 0,u}if(NVt(this,t))return;let i=!1,r=!N.equals(this._modelMatrix,this.modelMatrix);if(this._mode!==e.mode&&(this._mode=e.mode,r=!0),l(this._drawCommand)||(DVt(this,e),r=!0,i=!0,this._ready=!0,this._parsedContent=void 0),r){N.clone(this.modelMatrix,this._modelMatrix);let u=this._drawCommand.modelMatrix;if(N.clone(this._modelMatrix,u),l(this._rtcCenter)&&N.multiplyByTranslation(u,this._rtcCenter,u),l(this._quantizedVolumeOffset)&&N.multiplyByTranslation(u,this._quantizedVolumeOffset,u),e.mode!==re.SCENE3D){let d=e.mapProjection,p=N.getColumn(u,3,LVt);se.equals(p,se.UNIT_W)||At.basisTo2D(d,u,u)}let f=this._drawCommand.boundingVolume;if(ue.clone(this._boundingSphere,f),this._cull){let d=f.center;N.multiplyByPoint(u,d,d);let p=N.getScale(u,FVt);f.radius*=h.maximumComponent(p)}}this.clippingPlanesDirty&&(this.clippingPlanesDirty=!1,i=!0),this._attenuation!==this.attenuation&&(this._attenuation=this.attenuation,i=!0),this.backFaceCulling!==this._backFaceCulling&&(this._backFaceCulling=this.backFaceCulling,i=!0),this.normalShading!==this._normalShading&&(this._normalShading=this.normalShading,i=!0),(this._style!==this.style||this.styleDirty)&&(this._style=this.style,this.styleDirty=!1,i=!0);let o=this.splitDirection!==jo.NONE;this._splittingEnabled!==o&&(this._splittingEnabled=o,i=!0),i&&MVt(this,e,this._style),this._drawCommand.castShadows=Dn.castShadows(this.shadows),this._drawCommand.receiveShadows=Dn.receiveShadows(this.shadows);let s=this._highlightColor.alpha<1||this._constantColor.alpha<1||this._styleTranslucent;this._drawCommand.renderState=s?this._translucentRenderState:this._opaqueRenderState,this._drawCommand.pass=s?Ie.TRANSLUCENT:this._opaquePass;let a=e.commandList,c=e.passes;(c.render||c.pick)&&a.push(this._drawCommand)};S4.prototype.isDestroyed=function(){return!1};S4.prototype.destroy=function(){let e=this._drawCommand;return l(e)&&(e.vertexArray=e.vertexArray&&e.vertexArray.destroy(),e.shaderProgram=e.shaderProgram&&e.shaderProgram.destroy()),le(this)};var w4=S4;function NC(e){e=e??H.EMPTY_OBJECT,this.show=e.show??!0,this.modelMatrix=N.clone(e.modelMatrix??N.IDENTITY),this.shadows=e.shadows??Dn.ENABLED,this.maximumMemoryUsage=e.maximumMemoryUsage??256,this.shading=new Yp(e.shading),this.style=e.style,this.frameFailed=new be,this.frameChanged=new be,this._clock=e.clock,this._intervals=e.intervals,this._clippingPlanes=void 0,this.clippingPlanes=e.clippingPlanes,this._pointCloudEyeDomeLighting=new Wg,this._loadTimestamp=void 0,this._clippingPlanesState=0,this._styleDirty=!1,this._pickId=void 0,this._totalMemoryUsageInBytes=0,this._frames=[],this._previousInterval=void 0,this._nextInterval=void 0,this._lastRenderedFrame=void 0,this._clockMultiplier=0,this._runningSum=0,this._runningLength=0,this._runningIndex=0,this._runningSamples=new Array(5).fill(0),this._runningAverage=0}Object.defineProperties(NC.prototype,{clippingPlanes:{get:function(){return this._clippingPlanes},set:function(e){bs.setOwner(e,this,"_clippingPlanes")}},totalMemoryUsageInBytes:{get:function(){return this._totalMemoryUsageInBytes}},boundingSphere:{get:function(){if(l(this._lastRenderedFrame))return this._lastRenderedFrame.pointCloud.boundingSphere}}});function BVt(e){return`uniform vec4 czm_pickColor; -${e}`}function kVt(e){return function(t){return Ot(t,{czm_pickColor:function(){return e._pickId.color}})}}function UVt(){return"czm_pickColor"}NC.prototype.makeStyleDirty=function(){this._styleDirty=!0};NC.prototype._getAverageLoadTime=function(){return this._runningLength===0?.05:this._runningAverage};var zVt=new K;function Qse(e){let t=e._clock,n=t.canAnimate&&t.shouldAnimate,i=t.multiplier;return n?i:0}function MC(e,t){return e._intervals.indexOf(t.start)}function VVt(e,t){let n=e._intervals,i=e._clock,r=Qse(e);if(r===0)return;let o=e._getAverageLoadTime(),s=K.addSeconds(i.currentTime,o*r,zVt),a=n.indexOf(s),c=MC(e,t);return a===c&&(r>=0?++a:--a),n.get(a)}function jVt(e){let t=e._intervals,i=e._clock.currentTime,r=t.indexOf(i);return t.get(r)}function HVt(e,t,n){let i=Qse(e),r=MC(e,t),o=MC(e,n);return i>=0?r>=o:r<=o}function qBe(e,t){return function(n){let i=l(n.message)?n.message:n.toString();e.frameFailed.numberOfListeners>0?e.frameFailed.raiseEvent({uri:t,message:i}):(console.log(`A frame failed to load: ${t}`),console.log(`Error: ${i}`))}}function GVt(e,t,n){let i=MC(e,t),r=e._frames,o=r[i];if(!l(o)){let s=t.data.transform,a=l(s)?N.fromArray(s):void 0,c=t.data.uri;o={pointCloud:void 0,transform:a,timestamp:xn(),sequential:!0,ready:!1,touchedFrameNumber:n.frameNumber,uri:c},r[i]=o,De.fetchArrayBuffer({url:c}).then(function(u){o.pointCloud=new w4({arrayBuffer:u,cull:!0,fragmentShaderLoaded:BVt,uniformMapLoaded:kVt(e),pickIdLoaded:UVt})}).catch(qBe(e,c))}return o}function WVt(e,t){e._runningSum+=t,e._runningSum-=e._runningSamples[e._runningIndex],e._runningSamples[e._runningIndex]=t,e._runningLength=Math.min(e._runningLength+1,e._runningSamples.length),e._runningIndex=(e._runningIndex+1)%e._runningSamples.length,e._runningAverage=e._runningSum/e._runningLength}function qVt(e,t,n,i){t.touchedFrameNumber<i.frameNumber-1&&(t.sequential=!1);let r=t.pointCloud;if(l(r)&&!t.ready){let o=i.commandList,s=o.length;if(YBe(e,t,n,i),r.ready&&(t.ready=!0,e._totalMemoryUsageInBytes+=r.geometryByteLength,o.length=s,t.sequential)){let a=(xn()-t.timestamp)/1e3;WVt(e,a)}}t.touchedFrameNumber=i.frameNumber}var YVt=new N;function XVt(e,t){let n=e.shading;return l(n)&&l(n.baseResolution)?n.baseResolution:l(t.boundingSphere)?D.cbrt(t.boundingSphere.volume()/t.pointsLength):0}function KVt(e){let t=e.shading;return l(t)&&l(t.maximumAttenuation)?t.maximumAttenuation:10}var $Vt=new Yp;function YBe(e,t,n,i){let r=e.shading??$Vt,o=t.pointCloud,s=t.transform??N.IDENTITY;o.modelMatrix=N.multiplyTransformation(e.modelMatrix,s,YVt),o.style=e.style,o.time=n.timeSinceLoad,o.shadows=e.shadows,o.clippingPlanes=e._clippingPlanes,o.isClipped=n.isClipped,o.attenuation=r.attenuation,o.backFaceCulling=r.backFaceCulling,o.normalShading=r.normalShading,o.geometricError=XVt(e,o),o.geometricErrorScale=r.geometricErrorScale,o.maximumAttenuation=KVt(e);try{o.update(i)}catch(a){qBe(e,t.uri)(a)}t.touchedFrameNumber=i.frameNumber}function Zse(e,t,n,i){let r=GVt(e,t,i);qVt(e,r,n,i)}function JVt(e){return function(t){return t.touchedFrameNumber<e.frameNumber}}function XBe(e,t){let n=e._frames,i=n.length;for(let r=0;r<i;++r){let o=n[r];if(l(o)&&(!l(t)||t(o))){let s=o.pointCloud;o.ready&&(e._totalMemoryUsageInBytes-=s.geometryByteLength),l(s)&&s.destroy(),o===e._lastRenderedFrame&&(e._lastRenderedFrame=void 0),n[r]=void 0}}}function ZVt(e,t){let n=MC(e,t),i=e._frames[n];if(l(i)&&i.ready)return i}function WBe(e,t,n,i,r){return l(n)?n.ready?!0:(Zse(e,t,i,r),n.ready):!1}function QVt(e,t,n,i,r){let o,s,a,c=e._intervals,u=e._frames,f=MC(e,n),d=MC(e,t);if(f>=d){for(o=f;o>=d;--o)if(s=c.get(o),a=u[o],WBe(e,s,a,i,r))return s}else for(o=f;o<=d;++o)if(s=c.get(o),a=u[o],WBe(e,s,a,i,r))return s;return t}function e4t(e,t,n){let i=e._frames,r=i.length;for(let o=0;o<r;++o){let s=i[o];l(s)&&l(s.pointCloud)&&(s.pointCloud.clippingPlanesDirty=t,s.pointCloud.styleDirty=n)}}var DP={timeSinceLoad:0,isClipped:!1,clippingPlanesDirty:!1};NC.prototype.update=function(e){if(e.mode===re.MORPHING||!this.show)return;l(this._pickId)||(this._pickId=e.context.createPickId({primitive:this})),l(this._loadTimestamp)||(this._loadTimestamp=K.clone(e.time));let t=Math.max(K.secondsDifference(e.time,this._loadTimestamp)*1e3,0),n=this._clippingPlanes,i=0,r=!1,o=l(n)&&n.enabled;o&&(n.update(e),i=n.clippingPlanesState),this._clippingPlanesState!==i&&(this._clippingPlanesState=i,r=!0);let s=this._styleDirty;this._styleDirty=!1,(r||s)&&e4t(this,r,s),DP.timeSinceLoad=t,DP.isClipped=o;let a=this.shading,c=this._pointCloudEyeDomeLighting,u=e.commandList,f=u.length,d=this._previousInterval,p=this._nextInterval,g=jVt(this);if(!l(g))return;let m=!1,y=Qse(this),A=y===0;y!==this._clockMultiplier&&(m=!0,this._clockMultiplier=y),(!l(d)||A)&&(d=g),(!l(p)||m||HVt(this,g,p))&&(p=VVt(this,g)),d=QVt(this,d,g,DP,e);let b=ZVt(this,d);l(b)||(Zse(this,d,DP,e),b=this._lastRenderedFrame),l(b)&&YBe(this,b,DP,e),l(p)&&Zse(this,p,DP,e);let x=this;l(b)&&!l(this._lastRenderedFrame)&&e.afterRender.push(function(){return!0}),l(b)&&b!==this._lastRenderedFrame&&x.frameChanged.numberOfListeners>0&&e.afterRender.push(function(){return x.frameChanged.raiseEvent(x),!0}),this._previousInterval=d,this._nextInterval=p,this._lastRenderedFrame=b;let T=this._totalMemoryUsageInBytes,E=this.maximumMemoryUsage*1024*1024;T>E&&XBe(this,JVt(e));let S=u.length-f;l(a)&&a.attenuation&&a.eyeDomeLighting&&S>0&&c.update(e,f,a,this.boundingSphere)};NC.prototype.isDestroyed=function(){return!1};NC.prototype.destroy=function(){return XBe(this),this._clippingPlanes=this._clippingPlanes&&this._clippingPlanes.destroy(),this._pickId=this._pickId&&this._pickId.destroy(),le(this)};var RP=NC;function JBe(e,t){if(l(t)){let n=t.clock;l(n)&&n.getValue(e)}}function t4t(e){e._renderLoopRunning=!0;let t=0;function n(i){if(!e.isDestroyed())if(e._useDefaultRenderLoop)try{let r=e._targetFrameRate;if(!l(r))e.resize(),e.render(),requestAnimationFrame(n);else{let o=1e3/r,s=i-t;s>o&&(e.resize(),e.render(),t=i-s%o),requestAnimationFrame(n)}}catch(r){e._useDefaultRenderLoop=!1,e._renderLoopRunning=!1,e._showRenderLoopErrors&&e.showErrorPanel("An error occurred while rendering. Rendering has stopped.",void 0,r)}else e._renderLoopRunning=!1}requestAnimationFrame(n)}function ZBe(e){let t=e._useBrowserRecommendedResolution?1:window.devicePixelRatio;return t*=e._resolutionScale,l(e._scene)&&(e._scene.pixelRatio=t),t}function QBe(e){let t=e._canvas,n=t.clientWidth,i=t.clientHeight,r=ZBe(e);e._canvasClientWidth=n,e._canvasClientHeight=i,n*=r,i*=r,t.width=n,t.height=i,e._canRender=n!==0&&i!==0,e._lastDevicePixelRatio=window.devicePixelRatio}function e2e(e){let t=e._canvas,n=t.width,i=t.height;if(n!==0&&i!==0){let r=e._scene.camera.frustum;l(r.aspectRatio)?r.aspectRatio=n/i:(r.top=r.right*(i/n),r.bottom=-r.top)}}function Gr(e,t){e=Ln(e),t=t??H.EMPTY_OBJECT;let n=document.createElement("div");n.className="cesium-widget",e.appendChild(n);let i=document.createElement("canvas"),r=dn.supportsImageRenderingPixelated();this._supportsImageRenderingPixelated=r,r&&(i.style.imageRendering=dn.imageRenderingValue()),i.oncontextmenu=function(){return!1},i.onselectstart=function(){return!1};function o(){i!==i.ownerDocument.activeElement&&i.ownerDocument.activeElement.blur()}(t.blurActiveElementOnCanvasFocus??!0)&&(i.addEventListener("mousedown",o),i.addEventListener("pointerdown",o)),n.appendChild(i);let a=document.createElement("div");a.className="cesium-widget-credits";let c=l(t.creditContainer)?Ln(t.creditContainer):n;c.appendChild(a);let u=l(t.creditViewport)?Ln(t.creditViewport):n,f=t.showRenderLoopErrors??!0,d=t.useBrowserRecommendedResolution??!0;this._element=n,this._container=e,this._canvas=i,this._canvasClientWidth=0,this._canvasClientHeight=0,this._lastDevicePixelRatio=0,this._creditViewport=u,this._creditContainer=c,this._innerCreditContainer=a,this._canRender=!1,this._renderLoopRunning=!1,this._showRenderLoopErrors=f,this._resolutionScale=1,this._useBrowserRecommendedResolution=d,this._forceResize=!1,this._entityView=void 0,this._clockTrackedDataSource=void 0,this._trackedEntity=void 0,this._needTrackedEntityUpdate=!1,this._zoomIsFlight=!1,this._zoomTarget=void 0,this._zoomPromise=void 0,this._zoomOptions=void 0,this._trackedEntityChanged=new be,this._allowDataSourcesToSuspendAnimation=!0,this._clock=l(t.clock)?t.clock:new Lm,l(t.shouldAnimate)&&(this._clock.shouldAnimate=t.shouldAnimate),QBe(this);try{let p=t.ellipsoid??ee.default,g=new y4({canvas:i,contextOptions:t.contextOptions,creditContainer:a,creditViewport:u,ellipsoid:p,mapProjection:t.mapProjection,orderIndependentTranslucency:t.orderIndependentTranslucency,scene3DOnly:t.scene3DOnly??!1,shadows:t.shadows,mapMode2D:t.mapMode2D,requestRenderMode:t.requestRenderMode,maximumRenderTimeChange:t.maximumRenderTimeChange,depthPlaneEllipsoidOffset:t.depthPlaneEllipsoidOffset,msaaSamples:t.msaaSamples});this._scene=g,g.camera.constrainedAxis=h.UNIT_Z,ZBe(this),e2e(this);let m=t.globe;l(m)||(m=new az(p)),m!==!1&&(g.globe=m,g.globe.shadows=t.terrainShadows??Dn.RECEIVE_ONLY);let y=t.skyBox;!l(y)&&ee.WGS84.equals(p)&&(y=x4.createEarthSkyBox()),y!==!1&&(g.skyBox=y,g.sun=new C4,ee.WGS84.equals(p)&&(g.moon=new hz));let A=t.skyAtmosphere;!l(A)&&ee.WGS84.equals(p)&&(A=new A4(p),A.show=t.globe!==!1&&m.show),A!==!1&&(g.skyAtmosphere=A);let b=t.baseLayer;t.globe!==!1&&b!==!1&&(l(b)||(b=Ss.fromWorldImagery()),g.imageryLayers.add(b)),l(t.terrainProvider)&&t.globe!==!1&&(g.terrainProvider=t.terrainProvider),l(t.terrain)&&t.globe!==!1&&g.setTerrain(t.terrain),this._screenSpaceEventHandler=new ca(i),l(t.sceneMode)&&(t.sceneMode===re.SCENE2D&&this._scene.morphTo2D(0),t.sceneMode===re.COLUMBUS_VIEW&&this._scene.morphToColumbusView(0)),this._useDefaultRenderLoop=void 0,this.useDefaultRenderLoop=t.useDefaultRenderLoop??!0,this._targetFrameRate=void 0,this.targetFrameRate=t.targetFrameRate;let x=this;this._onRenderError=function(R,O){x._useDefaultRenderLoop=!1,x._renderLoopRunning=!1,x._showRenderLoopErrors&&x.showErrorPanel("An error occurred while rendering. Rendering has stopped.",void 0,O)},g.renderError.addEventListener(this._onRenderError);let T=t.dataSources,E=!1;l(T)||(T=new $k,E=!0);let v=new V3({scene:g,dataSourceCollection:T}),S=new Xo;this._dataSourceChangedListeners={},this._automaticallyTrackDataSourceClocks=t.automaticallyTrackDataSourceClocks??!0,this._dataSourceCollection=T,this._destroyDataSourceCollection=E,this._dataSourceDisplay=v,this._eventHelper=S,this._canAnimateUpdateCallback=this._updateCanAnimate,S.add(this._clock.onTick,Gr.prototype._onTick,this),S.add(g.morphStart,Gr.prototype._clearTrackedObject,this),S.add(T.dataSourceAdded,Gr.prototype._onDataSourceAdded,this),S.add(T.dataSourceRemoved,Gr.prototype._onDataSourceRemoved,this),S.add(g.postRender,Gr.prototype._postRender,this);let I=T.length;for(let R=0;R<I;R++)this._dataSourceAdded(T,T.get(R));this._dataSourceAdded(void 0,v.defaultDataSource),S.add(T.dataSourceAdded,Gr.prototype._dataSourceAdded,this),S.add(T.dataSourceRemoved,Gr.prototype._dataSourceRemoved,this)}catch(p){throw f&&this.showErrorPanel("Error constructing CesiumWidget.",'Visit <a href="http://get.webgl.org">http://get.webgl.org</a> to verify that your web browser and hardware support WebGL. Consider trying a different web browser or updating your video drivers. Detailed error information is below:',p),p}}Object.defineProperties(Gr.prototype,{container:{get:function(){return this._container}},canvas:{get:function(){return this._canvas}},creditContainer:{get:function(){return this._creditContainer}},creditViewport:{get:function(){return this._creditViewport}},scene:{get:function(){return this._scene}},imageryLayers:{get:function(){return this._scene.imageryLayers}},terrainProvider:{get:function(){return this._scene.terrainProvider},set:function(e){this._scene.terrainProvider=e}},creditDisplay:{get:function(){return this._scene.frameState.creditDisplay}},dataSourceDisplay:{get:function(){return this._dataSourceDisplay}},entities:{get:function(){return this._dataSourceDisplay.defaultDataSource.entities}},dataSources:{get:function(){return this._dataSourceCollection}},camera:{get:function(){return this._scene.camera}},ellipsoid:{get:function(){return this._scene.ellipsoid}},clock:{get:function(){return this._clock}},screenSpaceEventHandler:{get:function(){return this._screenSpaceEventHandler}},targetFrameRate:{get:function(){return this._targetFrameRate},set:function(e){this._targetFrameRate=e}},useDefaultRenderLoop:{get:function(){return this._useDefaultRenderLoop},set:function(e){this._useDefaultRenderLoop!==e&&(this._useDefaultRenderLoop=e,e&&!this._renderLoopRunning&&t4t(this))}},resolutionScale:{get:function(){return this._resolutionScale},set:function(e){this._resolutionScale!==e&&(this._resolutionScale=e,this._forceResize=!0)}},useBrowserRecommendedResolution:{get:function(){return this._useBrowserRecommendedResolution},set:function(e){this._useBrowserRecommendedResolution!==e&&(this._useBrowserRecommendedResolution=e,this._forceResize=!0)}},allowDataSourcesToSuspendAnimation:{get:function(){return this._allowDataSourcesToSuspendAnimation},set:function(e){this._allowDataSourcesToSuspendAnimation=e}},trackedEntity:{get:function(){return this._trackedEntity},set:function(e){if(this._trackedEntity!==e){this._trackedEntity=e,eae(this);let t=this.scene,n=t.mode;!l(e)||!l(e.position)?(this._needTrackedEntityUpdate=!1,(n===re.COLUMBUS_VIEW||n===re.SCENE2D)&&(t.screenSpaceCameraController.enableTranslate=!0),(n===re.COLUMBUS_VIEW||n===re.SCENE3D)&&(t.screenSpaceCameraController.enableTilt=!0),this._entityView=void 0,this.camera.lookAtTransform(N.IDENTITY)):this._needTrackedEntityUpdate=!0,this._trackedEntityChanged.raiseEvent(e),this.scene.requestRender()}}},trackedEntityChanged:{get:function(){return this._trackedEntityChanged}},clockTrackedDataSource:{get:function(){return this._clockTrackedDataSource},set:function(e){this._clockTrackedDataSource!==e&&(this._clockTrackedDataSource=e,JBe(this.clock,e))}}});Gr.prototype.showErrorPanel=function(e,t,n){let i=this._element,r=document.createElement("div");r.className="cesium-widget-errorPanel";let o=document.createElement("div");o.className="cesium-widget-errorPanel-content",r.appendChild(o);let s=document.createElement("div");s.className="cesium-widget-errorPanel-header",s.appendChild(document.createTextNode(e)),o.appendChild(s);let a=document.createElement("div");a.className="cesium-widget-errorPanel-scroll",o.appendChild(a);function c(){a.style.maxHeight=`${Math.max(Math.round(i.clientHeight*.9-100),30)}px`}c(),l(window.addEventListener)&&window.addEventListener("resize",c,!1);let u=l(t),f=l(n);if(u||f){let g=document.createElement("div");if(g.className="cesium-widget-errorPanel-message",a.appendChild(g),f){let m=Kp(n);u||(typeof n=="string"&&(n=new Error(n)),t=Kp({name:n.name,message:n.message}),m=n.stack),typeof console<"u"&&console.error(`${e} +`,F&&(ae+=mV("u_clippingPlanes","u_clippingPlanesMatrix","u_clippingPlanesEdgeStyle")),ae+=`} +`,e.splitDirection!==Ho.NONE&&(ae=CI.modifyFragmentShader(ae)),l(e._vertexShaderLoaded)&&(Z=e._vertexShaderLoaded(Z)),l(e._fragmentShaderLoaded)&&(ae=e._fragmentShaderLoaded(ae));let Ae=e._drawCommand;l(Ae.shaderProgram)&&Ae.shaderProgram.destroy(),Ae.shaderProgram=Qt.fromCache({context:s,vertexShaderSource:Z,fragmentShaderSource:ae,attributeLocations:Q});try{Ae.shaderProgram._bind()}catch{throw new oe("Error generating style shader: this may be caused by a type mismatch, index out-of-bounds, or other syntax error.")}}function MNt(e,t){if(e._decodingState===tC.READY)return!1;if(e._decodingState===tC.NEEDS_DECODE){let n=e._parsedContent,i=n.draco,r=Kg.decodePointCloud(i,t);l(r)&&(e._decodingState=tC.DECODING,r.then(function(o){e._decodingState=tC.READY;let s=l(o.POSITION)?o.POSITION.array:void 0,a=l(o.RGB)?o.RGB.array:void 0,c=l(o.RGBA)?o.RGBA.array:void 0,u=l(o.NORMAL)?o.NORMAL.array:void 0,f=l(o.BATCH_ID)?o.BATCH_ID.array:void 0,d=l(s)&&l(o.POSITION.data.quantization),p=l(u)&&l(o.NORMAL.data.quantization);if(d){let A=o.POSITION.data.quantization,b=A.range;e._quantizedVolumeScale=h.fromElements(b,b,b),e._quantizedVolumeOffset=h.unpack(A.minValues),e._quantizedRange=(1<<A.quantizationBits)-1,e._isQuantizedDraco=!0}p&&(e._octEncodedRange=(1<<o.NORMAL.data.quantization.quantizationBits)-1,e._isOctEncodedDraco=!0);let g=n.styleableProperties,m=i.batchTableProperties;for(let A in m)if(m.hasOwnProperty(A)){let b=o[A];l(g)||(g={}),g[A]={typedArray:b.array,componentCount:b.data.componentsPerAttribute}}l(s)&&(n.positions={typedArray:s});let y=c??a;l(y)&&(n.colors={typedArray:y}),l(u)&&(n.normals={typedArray:u}),l(f)&&(n.batchIds={typedArray:f}),n.styleableProperties=g}).catch(function(o){e._decodingState=tC.FAILED,e._error=o}))}return!0}var NNt=new se,LNt=new h;pV.prototype.update=function(e){let t=e.context;if(l(this._error)){let u=this._error;throw this._error=void 0,u}if(MNt(this,t))return;let i=!1,r=!N.equals(this._modelMatrix,this.modelMatrix);if(this._mode!==e.mode&&(this._mode=e.mode,r=!0),l(this._drawCommand)||(PNt(this,e),r=!0,i=!0,this._ready=!0,this._parsedContent=void 0),r){N.clone(this.modelMatrix,this._modelMatrix);let u=this._drawCommand.modelMatrix;if(N.clone(this._modelMatrix,u),l(this._rtcCenter)&&N.multiplyByTranslation(u,this._rtcCenter,u),l(this._quantizedVolumeOffset)&&N.multiplyByTranslation(u,this._quantizedVolumeOffset,u),e.mode!==re.SCENE3D){let d=e.mapProjection,p=N.getColumn(u,3,NNt);se.equals(p,se.UNIT_W)||At.basisTo2D(d,u,u)}let f=this._drawCommand.boundingVolume;if(ue.clone(this._boundingSphere,f),this._cull){let d=f.center;N.multiplyByPoint(u,d,d);let p=N.getScale(u,LNt);f.radius*=h.maximumComponent(p)}}this.clippingPlanesDirty&&(this.clippingPlanesDirty=!1,i=!0),this._attenuation!==this.attenuation&&(this._attenuation=this.attenuation,i=!0),this.backFaceCulling!==this._backFaceCulling&&(this._backFaceCulling=this.backFaceCulling,i=!0),this.normalShading!==this._normalShading&&(this._normalShading=this.normalShading,i=!0),(this._style!==this.style||this.styleDirty)&&(this._style=this.style,this.styleDirty=!1,i=!0);let o=this.splitDirection!==Ho.NONE;this._splittingEnabled!==o&&(this._splittingEnabled=o,i=!0),i&&ONt(this,e,this._style),this._drawCommand.castShadows=Pn.castShadows(this.shadows),this._drawCommand.receiveShadows=Pn.receiveShadows(this.shadows);let s=this._highlightColor.alpha<1||this._constantColor.alpha<1||this._styleTranslucent;this._drawCommand.renderState=s?this._translucentRenderState:this._opaqueRenderState,this._drawCommand.pass=s?Ie.TRANSLUCENT:this._opaquePass;let a=e.commandList,c=e.passes;(c.render||c.pick)&&a.push(this._drawCommand)};pV.prototype.isDestroyed=function(){return!1};pV.prototype.destroy=function(){let e=this._drawCommand;return l(e)&&(e.vertexArray=e.vertexArray&&e.vertexArray.destroy(),e.shaderProgram=e.shaderProgram&&e.shaderProgram.destroy()),le(this)};var gV=pV;function iC(e){e=e??H.EMPTY_OBJECT,this.show=e.show??!0,this.modelMatrix=N.clone(e.modelMatrix??N.IDENTITY),this.shadows=e.shadows??Pn.ENABLED,this.maximumMemoryUsage=e.maximumMemoryUsage??256,this.shading=new t0(e.shading),this.style=e.style,this.frameFailed=new be,this.frameChanged=new be,this._clock=e.clock,this._intervals=e.intervals,this._clippingPlanes=void 0,this.clippingPlanes=e.clippingPlanes,this._pointCloudEyeDomeLighting=new Jg,this._loadTimestamp=void 0,this._clippingPlanesState=0,this._styleDirty=!1,this._pickId=void 0,this._totalMemoryUsageInBytes=0,this._frames=[],this._previousInterval=void 0,this._nextInterval=void 0,this._lastRenderedFrame=void 0,this._clockMultiplier=0,this._runningSum=0,this._runningLength=0,this._runningIndex=0,this._runningSamples=new Array(5).fill(0),this._runningAverage=0}Object.defineProperties(iC.prototype,{clippingPlanes:{get:function(){return this._clippingPlanes},set:function(e){Cs.setOwner(e,this,"_clippingPlanes")}},totalMemoryUsageInBytes:{get:function(){return this._totalMemoryUsageInBytes}},boundingSphere:{get:function(){if(l(this._lastRenderedFrame))return this._lastRenderedFrame.pointCloud.boundingSphere}}});function FNt(e){return`uniform vec4 czm_pickColor; +${e}`}function BNt(e){return function(t){return Ot(t,{czm_pickColor:function(){return e._pickId.color}})}}function kNt(){return"czm_pickColor"}iC.prototype.makeStyleDirty=function(){this._styleDirty=!0};iC.prototype._getAverageLoadTime=function(){return this._runningLength===0?.05:this._runningAverage};var UNt=new K;function Sie(e){let t=e._clock,n=t.canAnimate&&t.shouldAnimate,i=t.multiplier;return n?i:0}function nC(e,t){return e._intervals.indexOf(t.start)}function zNt(e,t){let n=e._intervals,i=e._clock,r=Sie(e);if(r===0)return;let o=e._getAverageLoadTime(),s=K.addSeconds(i.currentTime,o*r,UNt),a=n.indexOf(s),c=nC(e,t);return a===c&&(r>=0?++a:--a),n.get(a)}function VNt(e){let t=e._intervals,i=e._clock.currentTime,r=t.indexOf(i);return t.get(r)}function jNt(e,t,n){let i=Sie(e),r=nC(e,t),o=nC(e,n);return i>=0?r>=o:r<=o}function kRe(e,t){return function(n){let i=l(n.message)?n.message:n.toString();e.frameFailed.numberOfListeners>0?e.frameFailed.raiseEvent({uri:t,message:i}):(console.log(`A frame failed to load: ${t}`),console.log(`Error: ${i}`))}}function HNt(e,t,n){let i=nC(e,t),r=e._frames,o=r[i];if(!l(o)){let s=t.data.transform,a=l(s)?N.fromArray(s):void 0,c=t.data.uri;o={pointCloud:void 0,transform:a,timestamp:xn(),sequential:!0,ready:!1,touchedFrameNumber:n.frameNumber,uri:c},r[i]=o,De.fetchArrayBuffer({url:c}).then(function(u){o.pointCloud=new gV({arrayBuffer:u,cull:!0,fragmentShaderLoaded:FNt,uniformMapLoaded:BNt(e),pickIdLoaded:kNt})}).catch(kRe(e,c))}return o}function GNt(e,t){e._runningSum+=t,e._runningSum-=e._runningSamples[e._runningIndex],e._runningSamples[e._runningIndex]=t,e._runningLength=Math.min(e._runningLength+1,e._runningSamples.length),e._runningIndex=(e._runningIndex+1)%e._runningSamples.length,e._runningAverage=e._runningSum/e._runningLength}function WNt(e,t,n,i){t.touchedFrameNumber<i.frameNumber-1&&(t.sequential=!1);let r=t.pointCloud;if(l(r)&&!t.ready){let o=i.commandList,s=o.length;if(URe(e,t,n,i),r.ready&&(t.ready=!0,e._totalMemoryUsageInBytes+=r.geometryByteLength,o.length=s,t.sequential)){let a=(xn()-t.timestamp)/1e3;GNt(e,a)}}t.touchedFrameNumber=i.frameNumber}var qNt=new N;function YNt(e,t){let n=e.shading;return l(n)&&l(n.baseResolution)?n.baseResolution:l(t.boundingSphere)?D.cbrt(t.boundingSphere.volume()/t.pointsLength):0}function XNt(e){let t=e.shading;return l(t)&&l(t.maximumAttenuation)?t.maximumAttenuation:10}var KNt=new t0;function URe(e,t,n,i){let r=e.shading??KNt,o=t.pointCloud,s=t.transform??N.IDENTITY;o.modelMatrix=N.multiplyTransformation(e.modelMatrix,s,qNt),o.style=e.style,o.time=n.timeSinceLoad,o.shadows=e.shadows,o.clippingPlanes=e._clippingPlanes,o.isClipped=n.isClipped,o.attenuation=r.attenuation,o.backFaceCulling=r.backFaceCulling,o.normalShading=r.normalShading,o.geometricError=YNt(e,o),o.geometricErrorScale=r.geometricErrorScale,o.maximumAttenuation=XNt(e);try{o.update(i)}catch(a){kRe(e,t.uri)(a)}t.touchedFrameNumber=i.frameNumber}function vie(e,t,n,i){let r=HNt(e,t,i);WNt(e,r,n,i)}function $Nt(e){return function(t){return t.touchedFrameNumber<e.frameNumber}}function zRe(e,t){let n=e._frames,i=n.length;for(let r=0;r<i;++r){let o=n[r];if(l(o)&&(!l(t)||t(o))){let s=o.pointCloud;o.ready&&(e._totalMemoryUsageInBytes-=s.geometryByteLength),l(s)&&s.destroy(),o===e._lastRenderedFrame&&(e._lastRenderedFrame=void 0),n[r]=void 0}}}function JNt(e,t){let n=nC(e,t),i=e._frames[n];if(l(i)&&i.ready)return i}function BRe(e,t,n,i,r){return l(n)?n.ready?!0:(vie(e,t,i,r),n.ready):!1}function ZNt(e,t,n,i,r){let o,s,a,c=e._intervals,u=e._frames,f=nC(e,n),d=nC(e,t);if(f>=d){for(o=f;o>=d;--o)if(s=c.get(o),a=u[o],BRe(e,s,a,i,r))return s}else for(o=f;o<=d;++o)if(s=c.get(o),a=u[o],BRe(e,s,a,i,r))return s;return t}function QNt(e,t,n){let i=e._frames,r=i.length;for(let o=0;o<r;++o){let s=i[o];l(s)&&l(s.pointCloud)&&(s.pointCloud.clippingPlanesDirty=t,s.pointCloud.styleDirty=n)}}var vI={timeSinceLoad:0,isClipped:!1,clippingPlanesDirty:!1};iC.prototype.update=function(e){if(e.mode===re.MORPHING||!this.show)return;l(this._pickId)||(this._pickId=e.context.createPickId({primitive:this})),l(this._loadTimestamp)||(this._loadTimestamp=K.clone(e.time));let t=Math.max(K.secondsDifference(e.time,this._loadTimestamp)*1e3,0),n=this._clippingPlanes,i=0,r=!1,o=l(n)&&n.enabled;o&&(n.update(e),i=n.clippingPlanesState),this._clippingPlanesState!==i&&(this._clippingPlanesState=i,r=!0);let s=this._styleDirty;this._styleDirty=!1,(r||s)&&QNt(this,r,s),vI.timeSinceLoad=t,vI.isClipped=o;let a=this.shading,c=this._pointCloudEyeDomeLighting,u=e.commandList,f=u.length,d=this._previousInterval,p=this._nextInterval,g=VNt(this);if(!l(g))return;let m=!1,y=Sie(this),A=y===0;y!==this._clockMultiplier&&(m=!0,this._clockMultiplier=y),(!l(d)||A)&&(d=g),(!l(p)||m||jNt(this,g,p))&&(p=zNt(this,g)),d=ZNt(this,d,g,vI,e);let b=JNt(this,d);l(b)||(vie(this,d,vI,e),b=this._lastRenderedFrame),l(b)&&URe(this,b,vI,e),l(p)&&vie(this,p,vI,e);let x=this;l(b)&&!l(this._lastRenderedFrame)&&e.afterRender.push(function(){return!0}),l(b)&&b!==this._lastRenderedFrame&&x.frameChanged.numberOfListeners>0&&e.afterRender.push(function(){return x.frameChanged.raiseEvent(x),!0}),this._previousInterval=d,this._nextInterval=p,this._lastRenderedFrame=b;let T=this._totalMemoryUsageInBytes,E=this.maximumMemoryUsage*1024*1024;T>E&&zRe(this,$Nt(e));let S=u.length-f;l(a)&&a.attenuation&&a.eyeDomeLighting&&S>0&&c.update(e,f,a,this.boundingSphere)};iC.prototype.isDestroyed=function(){return!1};iC.prototype.destroy=function(){return zRe(this),this._clippingPlanes=this._clippingPlanes&&this._clippingPlanes.destroy(),this._pickId=this._pickId&&this._pickId.destroy(),le(this)};var SI=iC;function HRe(e,t){if(l(t)){let n=t.clock;l(n)&&n.getValue(e)}}function eLt(e){e._renderLoopRunning=!0;let t=0;function n(i){if(!e.isDestroyed())if(e._useDefaultRenderLoop)try{let r=e._targetFrameRate;if(!l(r))e.resize(),e.render(),requestAnimationFrame(n);else{let o=1e3/r,s=i-t;s>o&&(e.resize(),e.render(),t=i-s%o),requestAnimationFrame(n)}}catch(r){e._useDefaultRenderLoop=!1,e._renderLoopRunning=!1,e._showRenderLoopErrors&&e.showErrorPanel("An error occurred while rendering. Rendering has stopped.",void 0,r)}else e._renderLoopRunning=!1}requestAnimationFrame(n)}function GRe(e){let t=e._useBrowserRecommendedResolution?1:window.devicePixelRatio;return t*=e._resolutionScale,l(e._scene)&&(e._scene.pixelRatio=t),t}function WRe(e){let t=e._canvas,n=t.clientWidth,i=t.clientHeight,r=GRe(e);e._canvasClientWidth=n,e._canvasClientHeight=i,n*=r,i*=r,t.width=n,t.height=i,e._canRender=n!==0&&i!==0,e._lastDevicePixelRatio=window.devicePixelRatio}function qRe(e){let t=e._canvas,n=t.width,i=t.height;if(n!==0&&i!==0){let r=e._scene.camera.frustum;l(r.aspectRatio)?r.aspectRatio=n/i:(r.top=r.right*(i/n),r.bottom=-r.top)}}function Hr(e,t){e=Ln(e),t=t??H.EMPTY_OBJECT;let n=document.createElement("div");n.className="cesium-widget",e.appendChild(n);let i=document.createElement("canvas"),r=dn.supportsImageRenderingPixelated();this._supportsImageRenderingPixelated=r,r&&(i.style.imageRendering=dn.imageRenderingValue()),i.oncontextmenu=function(){return!1},i.onselectstart=function(){return!1};function o(){i!==i.ownerDocument.activeElement&&i.ownerDocument.activeElement.blur()}(t.blurActiveElementOnCanvasFocus??!0)&&(i.addEventListener("mousedown",o),i.addEventListener("pointerdown",o)),n.appendChild(i);let a=document.createElement("div");a.className="cesium-widget-credits";let c=l(t.creditContainer)?Ln(t.creditContainer):n;c.appendChild(a);let u=l(t.creditViewport)?Ln(t.creditViewport):n,f=t.showRenderLoopErrors??!0,d=t.useBrowserRecommendedResolution??!0;this._element=n,this._container=e,this._canvas=i,this._canvasClientWidth=0,this._canvasClientHeight=0,this._lastDevicePixelRatio=0,this._creditViewport=u,this._creditContainer=c,this._innerCreditContainer=a,this._canRender=!1,this._renderLoopRunning=!1,this._showRenderLoopErrors=f,this._resolutionScale=1,this._useBrowserRecommendedResolution=d,this._forceResize=!1,this._entityView=void 0,this._clockTrackedDataSource=void 0,this._trackedEntity=void 0,this._needTrackedEntityUpdate=!1,this._zoomIsFlight=!1,this._zoomTarget=void 0,this._zoomPromise=void 0,this._zoomOptions=void 0,this._trackedEntityChanged=new be,this._allowDataSourcesToSuspendAnimation=!0,this._clock=l(t.clock)?t.clock:new Xh,l(t.shouldAnimate)&&(this._clock.shouldAnimate=t.shouldAnimate),WRe(this);try{let p=t.ellipsoid??ee.default,g=new aV({canvas:i,contextOptions:t.contextOptions,creditContainer:a,creditViewport:u,ellipsoid:p,mapProjection:t.mapProjection,orderIndependentTranslucency:t.orderIndependentTranslucency,scene3DOnly:t.scene3DOnly??!1,shadows:t.shadows,mapMode2D:t.mapMode2D,requestRenderMode:t.requestRenderMode,maximumRenderTimeChange:t.maximumRenderTimeChange,depthPlaneEllipsoidOffset:t.depthPlaneEllipsoidOffset,msaaSamples:t.msaaSamples});this._scene=g,g.camera.constrainedAxis=h.UNIT_Z,GRe(this),qRe(this);let m=t.globe;l(m)||(m=new K3(p)),m!==!1&&(g.globe=m,g.globe.shadows=t.terrainShadows??Pn.RECEIVE_ONLY);let y=t.skyBox;!l(y)&&ee.WGS84.equals(p)&&(y=uV.createEarthSkyBox()),y!==!1&&(g.skyBox=y,g.sun=new hV,ee.WGS84.equals(p)&&(g.moon=new tU));let A=t.skyAtmosphere;!l(A)&&ee.WGS84.equals(p)&&(A=new cV(p),A.show=t.globe!==!1&&m.show),A!==!1&&(g.skyAtmosphere=A);let b=t.baseLayer;t.globe!==!1&&b!==!1&&(l(b)||(b=Is.fromWorldImagery()),g.imageryLayers.add(b)),l(t.terrainProvider)&&t.globe!==!1&&(g.terrainProvider=t.terrainProvider),l(t.terrain)&&t.globe!==!1&&g.setTerrain(t.terrain),this._screenSpaceEventHandler=new sa(i),l(t.sceneMode)&&(t.sceneMode===re.SCENE2D&&this._scene.morphTo2D(0),t.sceneMode===re.COLUMBUS_VIEW&&this._scene.morphToColumbusView(0)),this._useDefaultRenderLoop=void 0,this.useDefaultRenderLoop=t.useDefaultRenderLoop??!0,this._targetFrameRate=void 0,this.targetFrameRate=t.targetFrameRate;let x=this;this._onRenderError=function(R,O){x._useDefaultRenderLoop=!1,x._renderLoopRunning=!1,x._showRenderLoopErrors&&x.showErrorPanel("An error occurred while rendering. Rendering has stopped.",void 0,O)},g.renderError.addEventListener(this._onRenderError);let T=t.dataSources,E=!1;l(T)||(T=new DM,E=!0);let v=new R3({scene:g,dataSourceCollection:T}),S=new jo;this._dataSourceChangedListeners={},this._automaticallyTrackDataSourceClocks=t.automaticallyTrackDataSourceClocks??!0,this._dataSourceCollection=T,this._destroyDataSourceCollection=E,this._dataSourceDisplay=v,this._eventHelper=S,this._canAnimateUpdateCallback=this._updateCanAnimate,S.add(this._clock.onTick,Hr.prototype._onTick,this),S.add(g.morphStart,Hr.prototype._clearTrackedObject,this),S.add(T.dataSourceAdded,Hr.prototype._onDataSourceAdded,this),S.add(T.dataSourceRemoved,Hr.prototype._onDataSourceRemoved,this),S.add(g.postRender,Hr.prototype._postRender,this);let I=T.length;for(let R=0;R<I;R++)this._dataSourceAdded(T,T.get(R));this._dataSourceAdded(void 0,v.defaultDataSource),S.add(T.dataSourceAdded,Hr.prototype._dataSourceAdded,this),S.add(T.dataSourceRemoved,Hr.prototype._dataSourceRemoved,this)}catch(p){throw f&&this.showErrorPanel("Error constructing CesiumWidget.",'Visit <a href="http://get.webgl.org">http://get.webgl.org</a> to verify that your web browser and hardware support WebGL. Consider trying a different web browser or updating your video drivers. Detailed error information is below:',p),p}}Object.defineProperties(Hr.prototype,{container:{get:function(){return this._container}},canvas:{get:function(){return this._canvas}},creditContainer:{get:function(){return this._creditContainer}},creditViewport:{get:function(){return this._creditViewport}},scene:{get:function(){return this._scene}},imageryLayers:{get:function(){return this._scene.imageryLayers}},terrainProvider:{get:function(){return this._scene.terrainProvider},set:function(e){this._scene.terrainProvider=e}},creditDisplay:{get:function(){return this._scene.frameState.creditDisplay}},dataSourceDisplay:{get:function(){return this._dataSourceDisplay}},entities:{get:function(){return this._dataSourceDisplay.defaultDataSource.entities}},dataSources:{get:function(){return this._dataSourceCollection}},camera:{get:function(){return this._scene.camera}},ellipsoid:{get:function(){return this._scene.ellipsoid}},clock:{get:function(){return this._clock}},screenSpaceEventHandler:{get:function(){return this._screenSpaceEventHandler}},targetFrameRate:{get:function(){return this._targetFrameRate},set:function(e){this._targetFrameRate=e}},useDefaultRenderLoop:{get:function(){return this._useDefaultRenderLoop},set:function(e){this._useDefaultRenderLoop!==e&&(this._useDefaultRenderLoop=e,e&&!this._renderLoopRunning&&eLt(this))}},resolutionScale:{get:function(){return this._resolutionScale},set:function(e){this._resolutionScale!==e&&(this._resolutionScale=e,this._forceResize=!0)}},useBrowserRecommendedResolution:{get:function(){return this._useBrowserRecommendedResolution},set:function(e){this._useBrowserRecommendedResolution!==e&&(this._useBrowserRecommendedResolution=e,this._forceResize=!0)}},allowDataSourcesToSuspendAnimation:{get:function(){return this._allowDataSourcesToSuspendAnimation},set:function(e){this._allowDataSourcesToSuspendAnimation=e}},trackedEntity:{get:function(){return this._trackedEntity},set:function(e){if(this._trackedEntity!==e){this._trackedEntity=e,wie(this);let t=this.scene,n=t.mode;!l(e)||!l(e.position)?(this._needTrackedEntityUpdate=!1,(n===re.COLUMBUS_VIEW||n===re.SCENE2D)&&(t.screenSpaceCameraController.enableTranslate=!0),(n===re.COLUMBUS_VIEW||n===re.SCENE3D)&&(t.screenSpaceCameraController.enableTilt=!0),this._entityView=void 0,this.camera.lookAtTransform(N.IDENTITY)):this._needTrackedEntityUpdate=!0,this._trackedEntityChanged.raiseEvent(e),this.scene.requestRender()}}},trackedEntityChanged:{get:function(){return this._trackedEntityChanged}},clockTrackedDataSource:{get:function(){return this._clockTrackedDataSource},set:function(e){this._clockTrackedDataSource!==e&&(this._clockTrackedDataSource=e,HRe(this.clock,e))}}});Hr.prototype.showErrorPanel=function(e,t,n){let i=this._element,r=document.createElement("div");r.className="cesium-widget-errorPanel";let o=document.createElement("div");o.className="cesium-widget-errorPanel-content",r.appendChild(o);let s=document.createElement("div");s.className="cesium-widget-errorPanel-header",s.appendChild(document.createTextNode(e)),o.appendChild(s);let a=document.createElement("div");a.className="cesium-widget-errorPanel-scroll",o.appendChild(a);function c(){a.style.maxHeight=`${Math.max(Math.round(i.clientHeight*.9-100),30)}px`}c(),l(window.addEventListener)&&window.addEventListener("resize",c,!1);let u=l(t),f=l(n);if(u||f){let g=document.createElement("div");if(g.className="cesium-widget-errorPanel-message",a.appendChild(g),f){let m=Fp(n);u||(typeof n=="string"&&(n=new Error(n)),t=Fp({name:n.name,message:n.message}),m=n.stack),typeof console<"u"&&console.error(`${e} ${t} -${m}`);let y=document.createElement("div");y.className="cesium-widget-errorPanel-message-details collapsed";let A=document.createElement("span");A.className="cesium-widget-errorPanel-more-details",A.appendChild(document.createTextNode("See more...")),y.appendChild(A),y.onclick=function(b){y.removeChild(A),y.appendChild(document.createTextNode(m)),y.className="cesium-widget-errorPanel-message-details",o.className="cesium-widget-errorPanel-content expanded",y.onclick=void 0},a.appendChild(y)}g.innerHTML=`<p>${t}</p>`}let d=document.createElement("div");d.className="cesium-widget-errorPanel-buttonPanel",o.appendChild(d);let p=document.createElement("button");p.setAttribute("type","button"),p.className="cesium-button",p.appendChild(document.createTextNode("OK")),p.onclick=function(){l(c)&&l(window.removeEventListener)&&window.removeEventListener("resize",c,!1),i.removeChild(r)},d.appendChild(p),i.appendChild(r)};Gr.prototype.isDestroyed=function(){return!1};Gr.prototype.destroy=function(){let e=this.dataSources,t=e.length;for(let n=0;n<t;n++)this._dataSourceRemoved(e,e.get(n));this._dataSourceRemoved(void 0,this._dataSourceDisplay.defaultDataSource),this._dataSourceDisplay=this._dataSourceDisplay.destroy(),l(this._scene)&&(this._scene.renderError.removeEventListener(this._onRenderError),this._scene=this._scene.destroy()),this._container.removeChild(this._element),this._creditContainer.removeChild(this._innerCreditContainer),this._eventHelper.removeAll(),this._destroyDataSourceCollection&&(this._dataSourceCollection=this._dataSourceCollection.destroy()),le(this)};Gr.prototype.resize=function(){let e=this._canvas;!this._forceResize&&this._canvasClientWidth===e.clientWidth&&this._canvasClientHeight===e.clientHeight&&this._lastDevicePixelRatio===window.devicePixelRatio||(this._forceResize=!1,QBe(this),e2e(this),this._scene.requestRender())};Gr.prototype.render=function(){if(this._canRender){this._scene.initializeFrame();let e=this._clock.tick();this._scene.render(e)}else this._clock.tick()};Gr.prototype._dataSourceAdded=function(e,t){t.entities.collectionChanged.addEventListener(Gr.prototype._onEntityCollectionChanged,this)};Gr.prototype._dataSourceRemoved=function(e,t){let n=t.entities;n.collectionChanged.removeEventListener(Gr.prototype._onEntityCollectionChanged,this),l(this.trackedEntity)&&n.getById(this.trackedEntity.id)===this.trackedEntity&&(this.trackedEntity=void 0)};Gr.prototype._updateCanAnimate=function(e){this._clock.canAnimate=e};var n4t=new ue;Gr.prototype._onTick=function(e){let t=e.currentTime,n=this._dataSourceDisplay.update(t);this._allowDataSourcesToSuspendAnimation&&this._canAnimateUpdateCallback(n);let i=this._entityView;if(l(i)){let r=this._trackedEntity;this._dataSourceDisplay.getBoundingSphere(r,!1,i.boundingSphere??n4t)===Pt.DONE&&i.update(t)}};Gr.prototype._onEntityCollectionChanged=function(e,t,n){let i=n.length;for(let r=0;r<i;r++){let o=n[r];this.trackedEntity===o&&(this.trackedEntity=void 0)}};Gr.prototype._clearTrackedObject=function(){this.trackedEntity=void 0};Gr.prototype._onDataSourceChanged=function(e){this.clockTrackedDataSource===e&&JBe(this.clock,e)};Gr.prototype._onDataSourceAdded=function(e,t){this._automaticallyTrackDataSourceClocks&&(this.clockTrackedDataSource=t);let n=t.entities.id,i=this._eventHelper.add(t.changedEvent,Gr.prototype._onDataSourceChanged,this);this._dataSourceChangedListeners[n]=i};Gr.prototype._onDataSourceRemoved=function(e,t){let n=this.clockTrackedDataSource===t,i=t.entities.id;if(this._dataSourceChangedListeners[i](),this._dataSourceChangedListeners[i]=void 0,n){let r=e.length;this._automaticallyTrackDataSourceClocks&&r>0?this.clockTrackedDataSource=e.get(r-1):this.clockTrackedDataSource=void 0}};Gr.prototype.addController=function(e){return this.scene.controllerHost.registerController(e,this.container)};Gr.prototype.removeController=function(e){return this.scene.controllerHost.unregisterController(e,this.container)};Gr.prototype.zoomTo=function(e,t){return t2e(this,e,{offset:t},!1)};Gr.prototype.flyTo=function(e,t){return t2e(this,e,t,!0)};function t2e(e,t,n,i){eae(e);let r=new Promise(o=>{e._completeZoom=function(s){o(s)}});return e._zoomPromise=r,e._zoomIsFlight=i,e._zoomOptions=n,Promise.resolve(t).then(function(o){if(e._zoomPromise===r){if(o instanceof Ss){let s;l(o.imageryProvider)?s=Promise.resolve(o.getImageryRectangle()):s=new Promise(a=>{let c=o.readyEvent.addEventListener(()=>{c(),a(o.getImageryRectangle())})}),s.then(function(a){return QE(a,e.scene)}).then(function(a){e._zoomPromise===r&&(e._zoomTarget=a)});return}if(o instanceof Yo||o instanceof RP||o instanceof Fb||o instanceof ra){e._zoomTarget=o;return}if(o.isLoading&&l(o.loadingEvent)){let s=o.loadingEvent.addEventListener(function(){s(),e._zoomPromise===r&&(e._zoomTarget=o.entities.values.slice(0))});return}if(Array.isArray(o)){e._zoomTarget=o.slice(0);return}o=o.values??o,l(o.entities)&&(o=o.entities.values),Array.isArray(o)?e._zoomTarget=o.slice(0):e._zoomTarget=[o]}}),e.scene.requestRender(),r}function I4(e){e._zoomPromise=void 0,e._zoomTarget=void 0,e._zoomOptions=void 0}function eae(e){let t=e._zoomPromise;l(t)&&(I4(e),e._completeZoom(!1))}Gr.prototype._postRender=function(){i4t(this),r4t(this)};var KBe=new ue;function i4t(e){let t=e._zoomTarget;if(!l(t)||e.scene.mode===re.MORPHING)return;let n=e.scene,i=n.camera,r=e._zoomOptions??{},o;function s(f){l(r.offset)||(r.offset=new ph(0,-.5,f.radius)),o={offset:r.offset,duration:r.duration,maximumHeight:r.maximumHeight,complete:function(){e._completeZoom(!0)},cancel:function(){e._completeZoom(!1)}},e._zoomIsFlight?i.flyToBoundingSphere(f,o):(i.viewBoundingSphere(f,r.offset),i.lookAtTransform(N.IDENTITY),e._completeZoom(!0)),I4(e)}if(t instanceof RP){if(l(t.boundingSphere)){s(t.boundingSphere);return}let f=t.frameChanged.addEventListener(function(d){s(d.boundingSphere),f()});return}if(t instanceof Yo||t instanceof Fb){s(t.boundingSphere);return}if(t instanceof ra){s(t.boundingVolume);return}if(t instanceof he){o={destination:n.ellipsoid.cartographicToCartesian(t),duration:r.duration,maximumHeight:r.maximumHeight,complete:function(){e._completeZoom(!0)},cancel:function(){e._completeZoom(!1)}},e._zoomIsFlight?i.flyTo(o):(i.setView(o),e._completeZoom(!0)),I4(e);return}let a=t,c=[];for(let f=0,d=a.length;f<d;f++){let p=e._dataSourceDisplay.getBoundingSphere(a[f],!1,KBe);if(p===Pt.PENDING)return;p!==Pt.FAILED&&c.push(ue.clone(KBe))}if(c.length===0){eae(e);return}e.trackedEntity=void 0;let u=ue.fromBoundingSpheres(c);e._zoomIsFlight?(I4(e),i.flyToBoundingSphere(u,{duration:r.duration,maximumHeight:r.maximumHeight,complete:function(){e._completeZoom(!0)},cancel:function(){e._completeZoom(!1)},offset:r.offset})):(i.viewBoundingSphere(u,r.offset),i.lookAtTransform(N.IDENTITY),I4(e),e._completeZoom(!0))}var $Be=new ue;function r4t(e){if(!e._needTrackedEntityUpdate)return;let t=e._trackedEntity,n=e.clock.currentTime,i=X.getValueOrUndefined(t.position,n);if(!l(i))return;let r=e.scene,o=e._dataSourceDisplay.getBoundingSphere(t,!1,$Be);if(o===Pt.PENDING)return;let s=r.mode;(s===re.COLUMBUS_VIEW||s===re.SCENE2D)&&(r.screenSpaceCameraController.enableTranslate=!1),(s===re.COLUMBUS_VIEW||s===re.SCENE3D)&&(r.screenSpaceCameraController.enableTilt=!1);let a=o!==Pt.FAILED?$Be:void 0;e._entityView=new H3(t,r,r.ellipsoid),e._entityView.update(n,a),e._needTrackedEntityUpdate=!1}var P4=Gr;function NP(e,t){this._tilingScheme=e,this._maximumLevel=t,this._rootNodes=[]}var LC=new ie;function o4t(e,t,n,i){let r=i.length;for(let o=0;o<r;++o){let s=i[o];if(s.x===t&&s.y===n&&s.level===e)return!0}return!1}NP.prototype.addAvailableTileRange=function(e,t,n,i,r){let o=this._tilingScheme,s=this._rootNodes;if(e===0)for(let p=n;p<=r;++p)for(let g=t;g<=i;++g)o4t(e,g,p,s)||s.push(new OP(o,void 0,0,g,p));o.tileXYToRectangle(t,n,e,LC);let a=LC.west,c=LC.north;o.tileXYToRectangle(i,r,e,LC);let u=LC.east,f=LC.south,d=new u4t(e,a,f,u,c);for(let p=0;p<s.length;++p){let g=s[p];tae(g.extent,d)&&f4t(this._maximumLevel,g,d)}};NP.prototype.computeMaximumLevelAtPosition=function(e){let t;for(let n=0;n<this._rootNodes.length;++n){let i=this._rootNodes[n];if(MP(i.extent,e)){t=i;break}}return l(t)?D4(void 0,t,e):-1};var s4t=[],a4t=[],c4t=new ie,l4t=new ie;NP.prototype.computeBestAvailableLevelOverRectangle=function(e){let t=s4t;t.length=0,e.east<e.west?(t.push(ie.fromRadians(-Math.PI,e.south,e.east,e.north,c4t)),t.push(ie.fromRadians(e.west,e.south,Math.PI,e.north,l4t))):t.push(e);let n=a4t;n.length=0;let i;for(i=0;i<this._rootNodes.length;++i)R4(n,this._rootNodes[i],t);for(i=n.length-1;i>=0;--i)if(l(n[i])&&n[i].length===0)return i;return 0};var n2e=new he;NP.prototype.isTileAvailable=function(e,t,n){let i=this._tilingScheme.tileXYToRectangle(t,n,e,LC);return ie.center(i,n2e),this.computeMaximumLevelAtPosition(n2e)>=e};NP.prototype.computeChildMaskForTile=function(e,t,n){let i=e+1;if(i>=this._maximumLevel)return 0;let r=0;return r|=this.isTileAvailable(i,2*t,2*n+1)?1:0,r|=this.isTileAvailable(i,2*t+1,2*n+1)?2:0,r|=this.isTileAvailable(i,2*t,2*n)?4:0,r|=this.isTileAvailable(i,2*t+1,2*n)?8:0,r};function OP(e,t,n,i,r){this.tilingScheme=e,this.parent=t,this.level=n,this.x=i,this.y=r,this.extent=e.tileXYToRectangle(i,r,n),this.rectangles=[],this._sw=void 0,this._se=void 0,this._nw=void 0,this._ne=void 0}Object.defineProperties(OP.prototype,{nw:{get:function(){return this._nw||(this._nw=new OP(this.tilingScheme,this,this.level+1,this.x*2,this.y*2)),this._nw}},ne:{get:function(){return this._ne||(this._ne=new OP(this.tilingScheme,this,this.level+1,this.x*2+1,this.y*2)),this._ne}},sw:{get:function(){return this._sw||(this._sw=new OP(this.tilingScheme,this,this.level+1,this.x*2,this.y*2+1)),this._sw}},se:{get:function(){return this._se||(this._se=new OP(this.tilingScheme,this,this.level+1,this.x*2+1,this.y*2+1)),this._se}}});function u4t(e,t,n,i,r){this.level=e,this.west=t,this.south=n,this.east=i,this.north=r}function tae(e,t){let n=Math.max(e.west,t.west),i=Math.max(e.south,t.south),r=Math.min(e.east,t.east),o=Math.min(e.north,t.north);return i<o&&n<r}function f4t(e,t,n){for(;t.level<e;)if(bW(t.nw.extent,n))t=t.nw;else if(bW(t.ne.extent,n))t=t.ne;else if(bW(t.sw.extent,n))t=t.sw;else if(bW(t.se.extent,n))t=t.se;else break;if(t.rectangles.length===0||t.rectangles[t.rectangles.length-1].level<=n.level)t.rectangles.push(n);else{let i=vr(t.rectangles,n.level,d4t);i<0&&(i=~i),t.rectangles.splice(i,0,n)}}function d4t(e,t){return e.level-t}function bW(e,t){return t.west>=e.west&&t.east<=e.east&&t.south>=e.south&&t.north<=e.north}function MP(e,t){return t.longitude>=e.west&&t.longitude<=e.east&&t.latitude>=e.south&&t.latitude<=e.north}function D4(e,t,n){let i=0,r=!1;for(;!r;){let o=t._nw&&MP(t._nw.extent,n),s=t._ne&&MP(t._ne.extent,n),a=t._sw&&MP(t._sw.extent,n),c=t._se&&MP(t._se.extent,n);if(o+s+a+c>1){o&&(i=Math.max(i,D4(t,t._nw,n))),s&&(i=Math.max(i,D4(t,t._ne,n))),a&&(i=Math.max(i,D4(t,t._sw,n))),c&&(i=Math.max(i,D4(t,t._se,n)));break}else o?t=t._nw:s?t=t._ne:a?t=t._sw:c?t=t._se:r=!0}for(;t!==e;){let o=t.rectangles;for(let s=o.length-1;s>=0&&o[s].level>i;--s){let a=o[s];MP(a,n)&&(i=a.level)}t=t.parent}return i}function R4(e,t,n){if(!t)return;let i,r=!1;for(i=0;i<n.length;++i)r=r||tae(t.extent,n[i]);if(!r)return;let o=t.rectangles;for(i=0;i<o.length;++i){let s=o[i];e[s.level]||(e[s.level]=n),e[s.level]=h4t(e[s.level],s)}R4(e,t._nw,n),R4(e,t._ne,n),R4(e,t._sw,n),R4(e,t._se,n)}function h4t(e,t){let n=[];for(let i=0;i<e.length;++i){let r=e[i];tae(r,t)?(r.west<t.west&&n.push(new ie(r.west,r.south,t.west,r.north)),r.east>t.east&&n.push(new ie(t.east,r.south,r.east,r.north)),r.south<t.south&&n.push(new ie(Math.max(t.west,r.west),r.south,Math.min(t.east,r.east),t.south)),r.north>t.north&&n.push(new ie(Math.max(t.west,r.west),t.north,Math.min(t.east,r.east),r.north))):n.push(r)}return n}var up=NP;var m4t=15;function i2e(e){this.ellipsoid=e.ellipsoid??ee.default,this.credit=void 0,this.tilingScheme=void 0,this.height=void 0,this.width=void 0,this.encoding=void 0,this.lodCount=void 0,this.hasAvailability=!1,this.tilesAvailable=void 0,this.tilesAvailabilityLoaded=void 0,this.levelZeroMaximumGeometricError=void 0,this.terrainDataStructure=void 0}i2e.prototype.build=function(e){e._credit=this.credit,e._tilingScheme=this.tilingScheme,e._height=this.height,e._width=this.width,e._encoding=this.encoding,e._lodCount=this.lodCount,e._hasAvailability=this.hasAvailability,e._tilesAvailable=this.tilesAvailable,e._tilesAvailabilityLoaded=this.tilesAvailabilityLoaded,e._levelZeroMaximumGeometricError=this.levelZeroMaximumGeometricError,e._terrainDataStructure=this.terrainDataStructure};function p4t(e,t){let n=t.copyrightText;l(n)&&(e.credit=new It(n));let i=t.spatialReference,r=i.latestWkid??i.wkid,o=t.extent,s={ellipsoid:e.ellipsoid};if(r===4326)s.rectangle=ie.fromDegrees(o.xmin,o.ymin,o.xmax,o.ymax),e.tilingScheme=new er(s);else if(r===3857){let u=Math.PI*e.ellipsoid.maximumRadius;t.extent.xmax>u&&(t.extent.xmax=u),t.extent.ymax>u&&(t.extent.ymax=u),t.extent.xmin<-u&&(t.extent.xmin=-u),t.extent.ymin<-u&&(t.extent.ymin=-u),s.rectangleSouthwestInMeters=new U(o.xmin,o.ymin),s.rectangleNortheastInMeters=new U(o.xmax,o.ymax),e.tilingScheme=new Lo(s)}else throw new oe("Invalid spatial reference");let a=t.tileInfo;if(!l(a))throw new oe("tileInfo is required");e.width=a.rows+1,e.height=a.cols+1,e.encoding=a.format==="LERC"?xh.LERC:xh.NONE,e.lodCount=a.lods.length-1,(e.hasAvailability=t.capabilities.indexOf("Tilemap")!==-1)&&(e.tilesAvailable=new up(e.tilingScheme,e.lodCount),e.tilesAvailable.addAvailableTileRange(0,0,0,e.tilingScheme.getNumberOfXTilesAtLevel(0),e.tilingScheme.getNumberOfYTilesAtLevel(0)),e.tilesAvailabilityLoaded=new up(e.tilingScheme,e.lodCount)),e.levelZeroMaximumGeometricError=Xr.getEstimatedLevelZeroGeometricErrorForAHeightmap(e.tilingScheme.ellipsoid,e.width,e.tilingScheme.getNumberOfXTilesAtLevel(0)),t.bandCount>1&&console.log("ArcGISTiledElevationTerrainProvider: Terrain data has more than 1 band. Using the first one."),l(t.minValues)&&l(t.maxValues)?e.terrainDataStructure={elementMultiplier:1,lowestEncodedHeight:t.minValues[0],highestEncodedHeight:t.maxValues[0]}:e.terrainDataStructure={elementMultiplier:1}}async function g4t(e,t,n){try{let i=await t.fetchJson();p4t(e,i)}catch(i){let r=`An error occurred while accessing ${t}.`;throw Zr.reportError(void 0,n,l(n)?n._errorEvent:void 0,r),i}}function kb(){this._resource=void 0,this._credit=void 0,this._tilingScheme=void 0,this._levelZeroMaximumGeometricError=void 0,this._maxLevel=void 0,this._terrainDataStructure=void 0,this._width=void 0,this._height=void 0,this._encoding=void 0,this._lodCount=void 0,this._hasAvailability=!1,this._tilesAvailable=void 0,this._tilesAvailabilityLoaded=void 0,this._availableCache={},this._errorEvent=new be}Object.defineProperties(kb.prototype,{errorEvent:{get:function(){return this._errorEvent}},credit:{get:function(){return this._credit}},tilingScheme:{get:function(){return this._tilingScheme}},hasWaterMask:{get:function(){return!1}},hasVertexNormals:{get:function(){return!1}},availability:{get:function(){return this._tilesAvailable}}});kb.fromUrl=async function(e,t){t=t??H.EMPTY_OBJECT,e=await Promise.resolve(e);let n=De.createIfNeeded(e);n.appendForwardSlash(),l(t.token)&&(n=n.getDerivedResource({queryParameters:{token:t.token}}));let i=n.getDerivedResource({queryParameters:{f:"pjson"}}),r=new i2e(t);await g4t(r,i);let o=new kb(t);return r.build(o),o._resource=n,o};kb.prototype.requestTileGeometry=function(e,t,n,i){let r=this._resource.getDerivedResource({url:`tile/${n}/${t}/${e}`,request:i}),o=this._hasAvailability,s=Promise.resolve(!0),a;if(o&&!l(nae(this,n+1,e*2,t*2))){let d=r2e(this,n+1,e*2,t*2);s=d.promise,a=d.request}let c=r.fetchArrayBuffer();if(!l(c)||!l(s))return;let u=this,f=this._tilesAvailable;return Promise.all([c,s]).then(function(d){return new jc({buffer:d[0],width:u._width,height:u._height,childTileMask:o?f.computeChildMaskForTile(n,e,t):m4t,structure:u._terrainDataStructure,encoding:u._encoding})}).catch(async function(d){if(l(a)&&a.state===Ti.CANCELLED){i.cancel();try{await i.deferred?.promise}catch{}return i.state=Ti.CANCELLED,Promise.reject(d)}return Promise.reject(d)})};function nae(e,t,n,i){if(!e._hasAvailability)return;let r=e._tilesAvailabilityLoaded,o=e._tilesAvailable;if(t>e._lodCount)return!1;if(o.isTileAvailable(t,n,i))return!0;if(r.isTileAvailable(t,n,i))return!1}kb.prototype.getLevelMaximumGeometricError=function(e){return this._levelZeroMaximumGeometricError/(1<<e)};kb.prototype.getTileDataAvailable=function(e,t,n){if(!this._hasAvailability)return;let i=nae(this,n,e,t);if(l(i))return i;r2e(this,n,e,t)};kb.prototype.loadTileDataAvailability=function(e,t,n){};function _4t(e,t,n,i){let r=t-1,o=n-1,s=i[e.y*t+e.x],a=[],c={startX:e.x,startY:e.y,endX:0,endY:0},u=new U(e.x+1,e.y+1),f=!1,d=!1;for(;!(f&&d);){let p=u.x,g=d?u.y+1:u.y;if(!f){for(let m=e.y;m<g;++m)if(i[m*t+u.x]!==s){f=!0;break}f?(a.push(new U(u.x,e.y)),--u.x,--p,c.endX=u.x):u.x===r?(c.endX=u.x,f=!0):++u.x}if(!d){let m=u.y*t;for(let y=e.x;y<=p;++y)if(i[m+y]!==s){d=!0;break}d?(a.push(new U(e.x,u.y)),--u.y,c.endY=u.y):u.y===o?(c.endY=u.y,d=!0):++u.y}}return{endingIndices:a,range:c,value:s}}function y4t(e,t,n,i,r){let o=[];if(r.every(function(c){return c===r[0]}))return r[0]===1&&o.push({startX:e,startY:t,endX:e+n-1,endY:t+i-1}),o;let a=[new U(0,0)];for(;a.length>0;){let c=a.pop(),u=_4t(c,n,i,r);if(u.value===1){let d=u.range;d.startX+=e,d.endX+=e,d.startY+=t,d.endY+=t,o.push(d)}let f=u.endingIndices;f.length>0&&(a=a.concat(f))}return o}function r2e(e,t,n,i){if(!e._hasAvailability)return{};let r=Math.floor(n/128)*128,o=Math.floor(i/128)*128,s=Math.min(1<<t,128),a=`tilemap/${t}/${o}/${r}/${s}/${s}`,c=e._availableCache;if(l(c[a]))return c[a];let u=new wo({throttle:!1,throttleByServer:!0,type:Zs.TERRAIN}),d=e._resource.getDerivedResource({url:a,request:u}).fetchJson();return l(d)?(d=d.then(function(p){let g=y4t(r,o,s,s,p.data);e._tilesAvailabilityLoaded.addAvailableTileRange(t,r,o,r+s,o+s);let m=e._tilesAvailable;for(let y=0;y<g.length;++y){let A=g[y];m.addAvailableTileRange(t,A.startX,A.startY,A.endX,A.endY)}return nae(e,t,n,i)}),c[a]={promise:d,request:u},d=d.finally(function(p){return delete c[a],p}),{promise:d,request:u}):{}}var iae=kb;var o2e="https://dev.virtualearth.net/REST/v1/Locations";function rae(e){e=e??H.EMPTY_OBJECT;let t=e.key;this._key=t;let n={key:t};l(e.culture)&&(n.culture=e.culture),this._resource=new De({url:o2e,queryParameters:n}),this._credit=new It('<img src="http://dev.virtualearth.net/Branding/logo_powered_by.png"/>',!1)}Object.defineProperties(rae.prototype,{url:{get:function(){return o2e}},key:{get:function(){return this._key}},credit:{get:function(){return this._credit}}});rae.prototype.geocode=async function(e){return this._resource.getDerivedResource({queryParameters:{query:e}}).fetchJsonp("jsonp").then(function(n){return n.resourceSets.length===0?[]:n.resourceSets[0].resources.map(function(r){let o=r.bbox,s=o[0],a=o[1],c=o[2],u=o[3];return{displayName:r.name,destination:ie.fromDegrees(a,s,u,c)}})})};var oae=rae;function sae(){}Object.defineProperties(sae.prototype,{credit:{get:function(){}}});sae.prototype.geocode=function(e){let t=e.match(/[^\s,\n]+/g);if(t.length===2||t.length===3){let n=+t[0],i=+t[1],r=t.length===3?+t[2]:300;if(isNaN(n)&&isNaN(i)){let o=/^(\d+.?\d*)([nsew])/i;for(let s=0;s<t.length;++s){let a=t[s].match(o);o.test(t[s])&&a.length===3&&(/^[ns]/i.test(a[2])?i=/^[n]/i.test(a[2])?+a[1]:-a[1]:/^[ew]/i.test(a[2])&&(n=/^[e]/i.test(a[2])?+a[1]:-a[1]))}}if(!isNaN(n)&&!isNaN(i)&&!isNaN(r)){let o={displayName:e,destination:h.fromDegrees(n,i,r)};return Promise.resolve([o])}}return Promise.resolve([])};var aae=sae;var A4t=new se,s2e=new h,LP=new h;function b4t(e){let t=e.points,n=e.times;if(t.length<3){let i=n[0],r=1/(n[1]-i),o=t[0],s=t[1];return function(a,c){l(c)||(c=new h);let u=(a-i)*r;return h.lerp(o,s,u,c)}}return function(i,r){l(r)||(r=new h);let o=e._lastTimeIndex=e.findTimeInterval(i,e._lastTimeIndex),s=(i-n[o])/(n[o+1]-n[o]),a=A4t;a.z=s,a.y=s*s,a.x=a.y*s,a.w=1;let c,u,f,d,p;return o===0?(c=t[0],u=t[1],f=e.firstTangent,d=h.subtract(t[2],c,s2e),h.multiplyByScalar(d,.5,d),p=N.multiplyByVector(TA.hermiteCoefficientMatrix,a,a)):o===t.length-2?(c=t[o],u=t[o+1],d=e.lastTangent,f=h.subtract(u,t[o-1],s2e),h.multiplyByScalar(f,.5,f),p=N.multiplyByVector(TA.hermiteCoefficientMatrix,a,a)):(c=t[o-1],u=t[o],f=t[o+1],d=t[o+2],p=N.multiplyByVector(Ub.catmullRomCoefficientMatrix,a,a)),r=h.multiplyByScalar(c,p.x,r),h.multiplyByScalar(u,p.y,LP),h.add(r,LP,r),h.multiplyByScalar(f,p.z,LP),h.add(r,LP,r),h.multiplyByScalar(d,p.w,LP),h.add(r,LP,r)}}var x4t=new h,T4t=new h;function Ub(e){e=e??H.EMPTY_OBJECT;let t=e.points,n=e.times,i=e.firstTangent,r=e.lastTangent;if(t.length>2&&(l(i)||(i=x4t,h.multiplyByScalar(t[1],2,i),h.subtract(i,t[2],i),h.subtract(i,t[0],i),h.multiplyByScalar(i,.5,i)),!l(r))){let o=t.length-1;r=T4t,h.multiplyByScalar(t[o-1],2,r),h.subtract(t[o],r,r),h.add(r,t[o-2],r),h.multiplyByScalar(r,.5,r)}this._times=n,this._points=t,this._firstTangent=h.clone(i),this._lastTangent=h.clone(r),this._evaluateFunction=b4t(this),this._lastTimeIndex=0}Object.defineProperties(Ub.prototype,{times:{get:function(){return this._times}},points:{get:function(){return this._points}},firstTangent:{get:function(){return this._firstTangent}},lastTangent:{get:function(){return this._lastTangent}}});Ub.catmullRomCoefficientMatrix=new N(-.5,1,-.5,0,1.5,-2.5,0,1,-1.5,2,.5,0,.5,-.5,0,0);Ub.prototype.findTimeInterval=Dr.prototype.findTimeInterval;Ub.prototype.wrapTime=Dr.prototype.wrapTime;Ub.prototype.clampTime=Dr.prototype.clampTime;Ub.prototype.evaluate=function(e,t){return this._evaluateFunction(e,t)};var cae=Ub;var lae={},E4t={positions:void 0,normals:void 0,indices:void 0,edgeIndicesWest:void 0,edgeIndicesSouth:void 0,edgeIndicesEast:void 0,edgeIndicesNorth:void 0},C4t=new he,v4t=new h,S4t=new N,w4t=new N,I4t=new N,P4t=new h,D4t=new h,R4t=new h,O4t=new h,M4t=new he,N4t=new U,O4=new h,L4t=new U,F4t=new h,B4t=new h,xW=function(e,t){return e-t};lae.createMesh=async function(e){e=e??H.EMPTY_OBJECT;let{exaggeration:t=1,exaggerationRelativeHeight:n=0,hasVertexNormals:i,hasWebMercatorT:r,gltf:o,minimumHeight:s,maximumHeight:a,skirtHeight:c}=e,f=t!==1,d=ue.clone(e.boundingSphere,new ue),p=en.clone(e.orientedBoundingBox,new en),g=h.clone(e.horizonOcclusionPoint,new h),m=ee.clone(e.ellipsoid,new ee),y=ie.clone(e.rectangle,new ie);await(o.extensionsRequired!==void 0&&o.extensionsRequired.indexOf("EXT_meshopt_compression")!==-1?sA.ready:Promise.resolve(void 0));let x=y.west,T=y.south,E=y.north,v=y.width,S=y.height,I=ie.center(y,C4t);I.height=.5*(s+a);let R=he.toCartesian(I,m,v4t),O=At.eastNorthUpToFixedFrame(R,m,S4t),L=N.inverseTransformation(O,w4t),_=N.unpack(o.nodes[0].matrix,0,I4t);_=N.multiply(Hi.Y_UP_TO_Z_UP,_,_);let C=g8t(o,i,E4t),w=Xr.getSkirtVertexCount(C.edgeIndicesWest,C.edgeIndicesSouth,C.edgeIndicesEast,C.edgeIndicesNorth),P=C.positions,M=C.normals,F=C.indices,V=P.length/3,B=V+w,j=F.length,k=Xr.getSkirtIndexCountWithFilledCorners(w),G=B<=65535?Uint16Array:Uint32Array,q=new G(j+k);q.set(F);let Q=new G(C.edgeIndicesWest),W=new G(C.edgeIndicesSouth),J=new G(C.edgeIndicesEast),Z=new G(C.edgeIndicesNorth),ae=new G(Q).sort(),Ae=new G(W).sort(),fe=new G(J).sort(),xe=new G(Z).sort(),ge=yi.geodeticLatitudeToMercatorAngle(T),Se=1/(yi.geodeticLatitudeToMercatorAngle(E)-ge),Re=h.fromElements(Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY,P4t),Qe=h.fromElements(Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY,D4t),He=new Co(d.center,void 0,void 0,void 0,void 0,i,r,f,t,n),Xe=He.stride,$e=new Float32Array(B*Xe),Pe=0;for(let st=0;st<V;st++){let vt=h.unpack(P,st*3,R4t),Gt=N.multiplyByPoint(_,vt,O4t),lt=he.fromCartesian(Gt,m,M4t),{longitude:mt,latitude:ft,height:Xt}=lt,rt=(mt-x)/v,ht=(ft-T)/S;rt=D.clamp(rt,0,1),ht=D.clamp(ht,0,1),vr(ae,st,xW)>=0?rt=0:vr(fe,st,xW)>=0&&(rt=1),vr(Ae,st,xW)>=0?ht=0:vr(xe,st,xW)>=0&&(ht=1);let Bi=U.fromElements(rt,ht,N4t),Xn;if(i){let hi=h.unpack(M,st*3,O4);hi=N.multiplyByPointAsVector(_,hi,O4),hi=h.normalize(hi,O4),Xn=cn.octEncode(hi,L4t)}let bi;r&&(bi=(yi.geodeticLatitudeToMercatorAngle(ft)-ge)*Se);let Wi;f&&(Wi=m.geodeticSurfaceNormal(Gt,F4t)),Pe=He.encode($e,Pe,Gt,Bi,Xt,Xn,bi,Wi);let wi=N.multiplyByPoint(L,Gt,B4t);Re=h.minimumByComponent(wi,Re,Re),Qe=h.maximumByComponent(wi,Qe,Qe)}let qe=new bc(h.clone(He.center,new h),$e,q,j,V,s,a,y,ue.clone(d,new ue),h.clone(g,new h),Xe,en.clone(p,new en),He,Q,W,J,Z);return h2e(qe,y,m,Re,Qe,O,L,c),Promise.resolve(qe)};var k4t=new U,U4t=new U,z4t=new Array(6),V4t=new U,j4t=new U,H4t=new U,G4t=new h,W4t=new h,q4t=new h,Y4t=new he,X4t=new h,K4t=new he,$4t=new he,a2e=new h,J4t=new h,Z4t=new h,Q4t=new h,e8t=new h,t8t=new h,n8t=new h,i8t=new h,r8t=new N,o8t=new N,c2e=new U,s8t=new U,a8t=new h,c8t=new ue,l8t=new en,u8t=new If,l2e=new h,u2e=new U,f8t=new U,f2e=new h,d8t=new h;function h8t(e){let t=e.meshes[0].primitives[0],n=e.accessors[t.attributes.POSITION],i=e.bufferViews[n.bufferView],r=n.count,o=i.extensions?i.extensions.EXT_meshopt_compression:void 0;if(o===void 0){let g=e.buffers[i.buffer].extras._pipeline.source;return new Float32Array(g.buffer,g.byteOffset+(i.byteOffset??0)+(n.byteOffset??0),r*3)}let s=e.buffers[o.buffer].extras._pipeline.source,a=new Uint8Array(s.buffer,s.byteOffset+(o.byteOffset??0)+(n.byteOffset??0),o.byteLength),c=o.byteStride,u=c===4?Uint8Array:Uint16Array,f=new u(r*4);sA.decodeVertexBuffer(new Uint8Array(f.buffer),r,c,a);let d=(1<<f.BYTES_PER_ELEMENT*8)-1,p=new Float32Array(r*3);for(let g=0;g<r;g++)p[g*3+0]=f[g*4+0]/d,p[g*3+1]=f[g*4+1]/d,p[g*3+2]=f[g*4+2]/d;return p}function m8t(e){let t=e.meshes[0].primitives[0],n=e.accessors[t.attributes.NORMAL],i=e.bufferViews[n.bufferView],r=n.count,o=i.extensions?i.extensions.EXT_meshopt_compression:void 0;if(o===void 0){let d=e.buffers[i.buffer].extras._pipeline.source;return new Float32Array(d.buffer,d.byteOffset+(i.byteOffset??0)+(n.byteOffset??0),r*3)}let s=e.buffers[o.buffer].extras._pipeline.source,a=new Uint8Array(s.buffer,s.byteOffset+(o.byteOffset??0)+(n.byteOffset??0),o.byteLength),c=o.byteStride,u=new Int8Array(r*c);sA.decodeVertexBuffer(new Uint8Array(u.buffer),r,c,a);let f=new Float32Array(r*3);for(let d=0;d<r;d++){let p=Math.max(u[d*4+0]/127,-1),g=Math.max(u[d*4+1]/127,-1),m=1-(Math.abs(p)+Math.abs(g));if(m<0){let A=p,b=g;p=(1-Math.abs(b))*D.signNotZero(A),g=(1-Math.abs(A))*D.signNotZero(b)}let y=O4;y.x=p,y.y=g,y.z=m,y=h.normalize(y,O4),f[d*3+0]=y.x,f[d*3+1]=y.y,f[d*3+2]=y.z}return f}function p8t(e){let t=e.meshes[0].primitives[0],n=e.accessors[t.indices],i=e.bufferViews[n.bufferView],r=n.count,o=n.componentType===Y.UNSIGNED_SHORT?Uint16Array:Uint32Array,s=i.extensions?i.extensions.EXT_meshopt_compression:void 0;if(s===void 0){let f=e.buffers[i.buffer].extras._pipeline.source;return new o(f.buffer,f.byteOffset+(i.byteOffset??0)+(n.byteOffset??0),r)}let a=e.buffers[s.buffer].extras._pipeline.source,c=new Uint8Array(a.buffer,a.byteOffset+(s.byteOffset??0)+(n.byteOffset??0),s.byteLength),u=new o(r);return sA.decodeIndexBuffer(new Uint8Array(u.buffer),r,s.byteStride,c),u}function TW(e,t){let n=e.meshes[0].primitives[0],i=e.accessors[n.extensions.CESIUM_tile_edges[t]],r=e.bufferViews[i.bufferView],o=i.count,s=i.componentType===Y.UNSIGNED_SHORT?Uint16Array:Uint32Array,a=r.extensions?r.extensions.EXT_meshopt_compression:void 0;if(a===void 0){let p=e.buffers[r.buffer].extras._pipeline.source;return new s(p.buffer,p.byteOffset+(r.byteOffset??0)+(i.byteOffset??0),o)}let c=e.buffers[a.buffer].extras._pipeline.source,u=new Uint8Array(c.buffer,c.byteOffset+(a.byteOffset??0)+(i.byteOffset??0),a.byteLength),f=new s(o),d=a.byteStride;return sA.decodeIndexSequence(new Uint8Array(f.buffer),o,d,u),f}function g8t(e,t,n){return n.positions=h8t(e),n.normals=t?m8t(e):void 0,n.indices=p8t(e),n.edgeIndicesWest=TW(e,"left"),n.edgeIndicesSouth=TW(e,"bottom"),n.edgeIndicesEast=TW(e,"right"),n.edgeIndicesNorth=TW(e,"top"),n}lae.upsampleMesh=function(e){e=e??H.EMPTY_OBJECT;let{isEastChild:t,isNorthChild:n,parentMinimumHeight:i,parentMaximumHeight:r,skirtHeight:o}=e,s=e.parentIndexCountWithoutSkirts,a=e.parentIndices,c=e.parentVertexCountWithoutSkirts,u=e.parentVertices,f=Co.clone(e.parentEncoding,new Co),d=f.hasVertexNormals,p=f.hasWebMercatorT,g=f.exaggeration,m=f.exaggerationRelativeHeight,A=g!==1,b=ie.clone(e.rectangle,new ie),x=ee.clone(e.ellipsoid),T=[],E=[],v=[],S=[],I=[],R=[],O=[],L=[];P8t(t,n,s,a,c,u,f,S,I,R,O,L,T,v,E);let _=ie.center(b,Y4t);_.height=.5*(i+r);let C=he.toCartesian(_,x,X4t),w=T.length,P=new Co(C,void 0,void 0,void 0,void 0,d,p,A,g,m),M=P.stride,F=Xr.getSkirtVertexCount(I,R,O,L),V=w+F,B=S.length,j=Xr.getSkirtIndexCountWithFilledCorners(F),k=B+j,G=V<=65535?Uint16Array:Uint32Array,q=new G(k);q.set(S);let Q=new G(I),W=new G(R),J=new G(O),Z=new G(L),ae=new Float32Array(V*M),Ae=0,fe=At.eastNorthUpToFixedFrame(C,x,r8t),xe=N.inverseTransformation(fe,o8t),ge=b.west,we=b.east,Se=b.south,Re=b.north,Qe=yi.geodeticLatitudeToMercatorAngle(Se),Xe=1/(yi.geodeticLatitudeToMercatorAngle(Re)-Qe),$e=Number.POSITIVE_INFINITY,Pe=Number.NEGATIVE_INFINITY,qe=h.fromElements(Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY,n8t),st=h.fromElements(Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY,i8t);for(let Xt=0;Xt<w;Xt++){let rt=T[Xt],ht=a[rt*3+0],Bi=a[rt*3+1],Xn=a[rt*3+2],bi=s8t;bi.x=E[Xt*2+0],bi.y=E[Xt*2+1];let Wi=bi.x,wi=bi.y,hi=v[Xt*2+0],xi=v[Xt*2+1],jn=1-hi-xi,nn=f.decodeHeight(u,ht),Wn=f.decodeHeight(u,Bi),Zi=f.decodeHeight(u,Xn),Mr=nn*hi+Wn*xi+Zi*jn;$e=Math.min(Mr,$e),Pe=Math.max(Mr,Pe);let fo=D.lerp(ge,we,Wi),Bs=D.lerp(Se,Re,wi),Ks=he.fromRadians(fo,Bs,Mr,$4t),no=he.toCartesian(Ks,x,J4t),gi=N.multiplyByPoint(xe,no,Q4t);qe=h.minimumByComponent(gi,qe,qe),st=h.maximumByComponent(gi,st,st);let ho;if(d){let Bn=f.decodeNormal(u,ht,G4t),qi=f.decodeNormal(u,Bi,W4t),ki=f.decodeNormal(u,Xn,q4t),Nr=h.fromElements(Bn.x*hi+qi.x*xi+ki.x*jn,Bn.y*hi+qi.y*xi+ki.y*jn,Bn.z*hi+qi.z*xi+ki.z*jn,l2e);Nr=h.normalize(Nr,l2e),ho=cn.octEncode(Nr,f8t)}let ur;p&&(ur=(yi.geodeticLatitudeToMercatorAngle(Bs)-Qe)*Xe);let Zo;A&&(Zo=x.geodeticSurfaceNormal(no,d8t)),Ae=P.encode(ae,Ae,no,bi,Mr,ho,ur,Zo)}let vt=en.fromRectangle(b,$e,Pe,x,l8t),Gt=ue.fromVertices(ae,P.center,M,c8t),mt=new Mm(x).computeHorizonCullingPointFromVerticesPossiblyUnderEllipsoid(P.center,ae,M,P.center,$e,a8t),ft=new bc(h.clone(P.center,new h),ae,q,B,w,$e,Pe,b,ue.clone(Gt),h.clone(mt),M,en.clone(vt),P,Q,W,J,Z);return h2e(ft,b,x,qe,st,fe,xe,o),ft};function h2e(e,t,n,i,r,o,s,a){let{encoding:c}=e,u=c.stride,f=e.vertices,{hasVertexNormals:d,hasWebMercatorT:p,exaggeration:g,exaggerationRelativeHeight:m}=c,A=g!==1,b=e.vertexCountWithoutSkirts,x=b*u,T=f.length/u,E=T-b,v=e.indices,S=e.indexCountWithoutSkirts,I=e.westIndicesSouthToNorth,R=e.southIndicesEastToWest,O=e.eastIndicesNorthToSouth,L=e.northIndicesWestToEast;Xr.addSkirtIndicesWithFilledCorners(I,R,O,L,b,v,S);let _=0,C=_+I.length,w=C+R.length,P=w+O.length,M=[I,R,O,L],F=[_,C,w,P],V=[-1,0,1,0],B=[0,-1,0,1],j=h.clone(i,e8t),k=h.clone(r,t8t),G=e.maximumHeight,q=e.minimumHeight-a;for(let J=0;J<E;J++){let Z;for(Z=0;Z<3&&!(J<F[Z+1]);Z++);let ae=M[Z][J-F[Z]],Ae=c.decodeTextureCoordinates(f,ae,c2e),fe=1e-4,xe=Ae.x+V[Z]*fe,ge=Ae.y+B[Z]*fe,we=D.lerp(t.west,t.east,xe),Se=D.clamp(D.lerp(t.south,t.north,ge),-D.PI_OVER_TWO,+D.PI_OVER_TWO),Qe=c.decodeHeight(f,ae)-a,He=he.fromRadians(we,Se,Qe,K4t),Xe=he.toCartesian(He,n,a2e),$e;d&&($e=c.getOctEncodedNormal(f,ae,u2e));let Pe;p&&(Pe=c.decodeWebMercatorT(f,ae));let qe;A&&(qe=n.geodeticSurfaceNormal(Xe,f2e)),x=c.encode(f,x,Xe,Ae,Qe,$e,Pe,qe);let st=N.multiplyByPoint(s,Xe,Z4t);h.minimumByComponent(st,j,j),h.maximumByComponent(st,k,k)}let Q=If.fromCorners(j,k,u8t),W=new Co(c.center,Q,q,G,o,c.hasVertexNormals,c.hasWebMercatorT,A,g,m);if(c.quantization!==W.quantization){let J=W,Z=J.stride,ae=new Float32Array(T*Z),Ae=0;for(let fe=0;fe<T;fe++)Ae=J.encode(ae,Ae,c.decodePosition(f,fe,a2e),c.decodeTextureCoordinates(f,fe,c2e),c.decodeHeight(f,fe),c.hasVertexNormals?c.getOctEncodedNormal(f,fe,u2e):void 0,c.hasWebMercatorT?c.decodeWebMercatorT(f,fe):void 0,c.hasGeodeticSurfaceNormals?c.decodeGeodeticSurfaceNormal(f,fe,f2e):void 0);e.vertices=ae,e.stride=Z,e.encoding=J}return e}var uae=0,_8t=1,fae=2,dae=3,y8t=4,A8t=new h,b8t=[new h,new h,new h,new h,new h,new h],x8t=[new U,new U,new U,new U,new U,new U],T8t=[new h,new h,new h,new h,new h,new h],E8t=[new U,new U,new U,new U,new U,new U];function d2e(e,t,n,i){switch(n){case uae:return D.sign(i.x-e.x);case fae:return D.sign(t.x-i.x);case dae:return D.sign(i.y-e.y);default:return D.sign(t.y-i.y)}}function C8t(e,t,n,i,r,o){let s,a,c;switch(n){case uae:s=(e.x-i.x)/(r.x-i.x),a=e.x,c=i.y+(r.y-i.y)*s;break;case fae:s=(t.x-i.x)/(r.x-i.x),a=t.x,c=i.y+(r.y-i.y)*s;break;case dae:s=(e.y-i.y)/(r.y-i.y),a=i.x+(r.x-i.x)*s,c=e.y;break;default:s=(t.y-i.y)/(r.y-i.y),a=i.x+(r.x-i.x)*s,c=t.y;break}return h.fromElements(a,c,s,o)}var v8t={length:0,coordinates:[new U,new U,new U,new U,new U,new U],barycentricCoordinates:[new h,new h,new h,new h,new h,new h]};function S8t(e,t,n,i,r,o,s,a){let c,u=x8t,f=b8t,d=3,p=E8t;U.clone(r,p[0]),U.clone(o,p[1]),U.clone(s,p[2]);let g=T8t;h.fromElements(1,0,0,g[0]),h.fromElements(0,1,0,g[1]),h.fromElements(0,0,1,g[2]);for(let m=0;m<t;m++){let y=(e+m)%y8t,A=u,b=f;u=p,f=g,c=d,p=A,g=b,d=0;let x=c-1,T=u[x],E=f[x],v=d2e(n,i,y,T);for(let S=0;S<c;S++){let I=u[S],R=f[S],O=d2e(n,i,y,I);if(v*O===-1){let L=C8t(n,i,y,T,I,A8t),{x:_,y:C,z:w}=L,P=1-w,M=E.x*P+R.x*w,F=E.y*P+R.y*w,V=E.z*P+R.z*w;U.fromElements(_,C,p[d]),h.fromElements(M,F,V,g[d]),d++}O>=0&&(U.clone(I,p[d]),h.clone(R,g[d]),d++),T=I,E=R,v=O}if(d===0)break}a.length=d;for(let m=0;m<d;m++)U.clone(p[m],a.coordinates[m]),h.clone(g[m],a.barycentricCoordinates[m]);return a}function w8t(e,t,n,i,r,o,s,a){return S8t(e?t?dae:uae:t?fae:_8t,2,n,i,r,o,s,a)}var I8t=[[],[0],[1],[0,1],[2],[0,2],[1,2],[0,1,2]];function P8t(e,t,n,i,r,o,s,a,c,u,f,d,p,g,m){let y={},A=e?.5:0,b=e?1:.5,x=t?.5:0,T=t?1:.5,E=k4t;E.x=A,E.y=x;let v=U4t;v.x=b,v.y=T;let S=0;for(let I=0;I<n;I+=3){let R=i[I+0],O=i[I+1],L=i[I+2],_=s.decodeTextureCoordinates(o,R,V4t),C=s.decodeTextureCoordinates(o,O,j4t),w=s.decodeTextureCoordinates(o,L,H4t),P=w8t(e,t,E,v,_,C,w,v8t),M=P.length;if(M<3)continue;let F=z4t;for(let k=0;k<M;k++){let G=P.barycentricCoordinates[k],q=G.x,Q=G.y,W=G.z,J=Math.ceil(q)|Math.ceil(Q)<<1|Math.ceil(W)<<2,Z=I8t[J],ae,Ae=!1;if(Z.length===1){let fe=Z[0],ge=i[I+fe];ae=y[ge],ae===void 0&&(Ae=!0,ae=S++,y[ge]=ae)}else if(Z.length===2){let fe=Z[0],xe=Z[1],ge=i[I+fe],we=i[I+xe],Se=P.barycentricCoordinates[(k+M-1)%M],Re=Math.ceil(Se.x)|Math.ceil(Se.y)<<1|Math.ceil(Se.z)<<2,Qe=J===Re,He=Math.min(ge,we),Xe=Math.max(ge,we),$e=r+2*(He*r+Xe),Pe=$e+0,qe=$e+1,st=y[Pe],vt=y[qe],Gt=!Qe==(st===void 0||vt===void 0);if(ae=Gt?st:vt,ae===void 0){Ae=!0,ae=S++;let lt=Gt?Pe:qe;y[lt]=ae}}else Ae=!0,ae=S++;if(F[k]=ae,Ae){let fe=I/3;p.push(fe);let xe=P.coordinates[k],ge=(xe.x-A)/(b-A),we=(xe.y-x)/(T-x);m.push(ge,we),g.push(q,Q),ge===0?c.push(ae):ge===1&&f.push(ae),we===0?u.push(ae):we===1&&d.push(ae)}}let V=F[0],B=F[1],j=F[2];a.push(V,B,j);for(let k=3;k<M;k++)B=j,j=F[k],a.push(V,B,j)}c.sort(function(I,R){return m[I*2+1]-m[R*2+1]}),u.sort(function(I,R){return m[R*2+0]-m[I*2+0]}),f.sort(function(I,R){return m[R*2+1]-m[I*2+1]}),d.sort(function(I,R){return m[I*2+0]-m[R*2+0]})}var FP=lae;var EW={};EW.clipTriangleAtAxisAlignedThreshold=function(e,t,n,i,r,o){l(o)?o.length=0:o=[];let s,a,c;t?(s=n<e,a=i<e,c=r<e):(s=n>e,a=i>e,c=r>e);let u=s+a+c,f,d,p,g,m,y;return u===1?s?(f=(e-n)/(i-n),d=(e-n)/(r-n),o.push(1),o.push(2),d!==1&&(o.push(-1),o.push(0),o.push(2),o.push(d)),f!==1&&(o.push(-1),o.push(0),o.push(1),o.push(f))):a?(p=(e-i)/(r-i),g=(e-i)/(n-i),o.push(2),o.push(0),g!==1&&(o.push(-1),o.push(1),o.push(0),o.push(g)),p!==1&&(o.push(-1),o.push(1),o.push(2),o.push(p))):c&&(m=(e-r)/(n-r),y=(e-r)/(i-r),o.push(0),o.push(1),y!==1&&(o.push(-1),o.push(2),o.push(1),o.push(y)),m!==1&&(o.push(-1),o.push(2),o.push(0),o.push(m))):u===2?!s&&n!==e?(g=(e-i)/(n-i),m=(e-r)/(n-r),o.push(0),o.push(-1),o.push(1),o.push(0),o.push(g),o.push(-1),o.push(2),o.push(0),o.push(m)):!a&&i!==e?(y=(e-r)/(i-r),f=(e-n)/(i-n),o.push(1),o.push(-1),o.push(2),o.push(1),o.push(y),o.push(-1),o.push(0),o.push(1),o.push(f)):!c&&r!==e&&(d=(e-n)/(r-n),p=(e-i)/(r-i),o.push(2),o.push(-1),o.push(0),o.push(2),o.push(d),o.push(-1),o.push(1),o.push(2),o.push(p)):u!==3&&(o.push(0),o.push(1),o.push(2)),o};EW.computeBarycentricCoordinates=function(e,t,n,i,r,o,s,a,c){let u=n-s,f=s-r,d=o-a,p=i-a,g=1/(d*u+f*p),m=t-a,y=e-s,A=(d*y+f*m)*g,b=(-p*y+u*m)*g,x=1-A-b;return l(c)?(c.x=A,c.y=b,c.z=x,c):new h(A,b,x)};EW.computeLineSegmentLineSegmentIntersection=function(e,t,n,i,r,o,s,a,c){let u=(s-r)*(t-o)-(a-o)*(e-r),f=(n-e)*(t-o)-(i-t)*(e-r),d=(a-o)*(n-e)-(s-r)*(i-t);if(d===0)return;let p=u/d,g=f/d;if(p>=0&&p<=1&&g>=0&&g<=1)return l(c)||(c=new U),c.x=e+p*(n-e),c.y=t+p*(i-t),c};var fp=EW;function py(e){e=e??H.EMPTY_OBJECT,this._minimumHeight=e.minimumHeight,this._maximumHeight=e.maximumHeight,this._skirtHeight=e.skirtHeight,this._boundingSphere=ue.clone(e.boundingSphere,new ue),this._orientedBoundingBox=en.clone(e.orientedBoundingBox,new en),this._horizonOcclusionPoint=h.clone(e.horizonOcclusionPoint,new h),this._hasVertexNormals=e.requestVertexNormals??!1,this._hasWaterMask=e.requestWaterMask??!1,this._hasWebMercatorT=!0,this._credits=e.credits,this._childTileMask=e.childTileMask??15,this._gltf=e.gltf,this._mesh=void 0,this._waterMask=e.waterMask}Object.defineProperties(py.prototype,{credits:{get:function(){return this._credits}},waterMask:{get:function(){return this._waterMask}}});py.prototype.interpolateHeight=function(e,t,n){let i=this._mesh;return i===void 0?void 0:p2e(i,e,t,n)};py.prototype.isChildAvailable=function(e,t,n,i){let r=2;return n!==e*2&&++r,i!==t*2&&(r-=2),(this._childTileMask&1<<r)!==0};var m2e="createVerticesFromCesium3DTilesTerrain",D8t=new $n(m2e),R8t=new $n(m2e,uf.maximumAsynchronousTasks);py.prototype.createMesh=function(e){e=e??H.EMPTY_OBJECT;let n=e.throttle??!0?R8t:D8t,i=e.tilingScheme,r=i.ellipsoid,o=e.x,s=e.y,a=e.level,c=i.tileXYToRectangle(o,s,a,new ie),u=this._gltf,f=n.scheduleTask({ellipsoid:r,rectangle:c,hasVertexNormals:this._hasVertexNormals,hasWaterMask:this._hasWaterMask,hasWebMercatorT:this._hasWebMercatorT,gltf:u,minimumHeight:this._minimumHeight,maximumHeight:this._maximumHeight,boundingSphere:this._boundingSphere,orientedBoundingBox:this._orientedBoundingBox,horizonOcclusionPoint:this._horizonOcclusionPoint,skirtHeight:this._skirtHeight,exaggeration:e.exaggeration,exaggerationRelativeHeight:e.exaggerationRelativeHeight});if(!l(f))return;let d=this;return Promise.resolve(f).then(function(p){let g=p,m=Co.clone(g.encoding,new Co),y=new Float32Array(g.verticesBuffer),A=y.length/m.stride,b=g.vertexCountWithoutSkirts,x=A<=65535?Uint16Array:Uint32Array,T=new x(g.indicesBuffer),E=new x(g.westIndicesBuffer),v=new x(g.eastIndicesBuffer),S=new x(g.southIndicesBuffer),I=new x(g.northIndicesBuffer),R=g.indexCountWithoutSkirts,O=d._minimumHeight,L=d._maximumHeight,_=h.clone(m.center,new h),C=ue.clone(d._boundingSphere,new ue),w=h.clone(d._horizonOcclusionPoint,new h),P=en.clone(d._orientedBoundingBox,new en),M=new bc(_,y,T,R,b,O,L,c,C,w,m.stride,P,m,E,S,v,I);return d._mesh=M,Promise.resolve(M)})};py.prototype._createMeshSync=function(e){e=e??H.EMPTY_OBJECT;let t=e.tilingScheme,n=t.ellipsoid,i=e.x,r=e.y,o=e.level,s=t.tileXYToRectangle(i,r,o,new ie),a=FP.createMesh({ellipsoid:n,rectangle:s,hasVertexNormals:this._hasVertexNormals,hasWebMercatorT:this._hasWebMercatorT,gltf:this._gltf,minimumHeight:this._minimumHeight,maximumHeight:this._maximumHeight,boundingSphere:this._boundingSphere,orientedBoundingBox:this._orientedBoundingBox,horizonOcclusionPoint:this._horizonOcclusionPoint,skirtHeight:this._skirtHeight,exaggeration:e.exaggeration,exaggerationRelativeHeight:e.exaggerationRelativeHeight}),c=this;return Promise.resolve(a).then(function(u){return c._mesh=u,Promise.resolve(u)})};py.prototype.upsample=function(e,t,n,i,r,o,s){let a=this._mesh;return a===void 0?void 0:CW(!1,a,this._skirtHeight,this._credits,e,t,n,i,r,o,s)};py.prototype._upsampleSync=function(e,t,n,i,r,o,s){let a=this._mesh;return a===void 0?void 0:CW(!0,a,this._skirtHeight,this._credits,e,t,n,i,r,o,s)};py.prototype.wasCreatedByUpsampling=function(){return!1};function my(e){e=e??H.EMPTY_OBJECT,this._mesh=e.terrainMesh,this._skirtHeight=e.skirtHeight,this._credits=e.credits}my.prototype.createMesh=function(e){return e=e??H.EMPTY_OBJECT,Promise.resolve(this._mesh)};my.prototype.upsample=function(e,t,n,i,r,o,s){return CW(!1,this._mesh,this._skirtHeight,this._credits,e,t,n,i,r,o,s)};my.prototype._upsampleSync=function(e,t,n,i,r,o,s){return CW(!0,this._mesh,this._skirtHeight,this._credits,e,t,n,i,r,o,s)};my.prototype.interpolateHeight=function(e,t,n){let i=this._mesh;return p2e(i,e,t,n)};my.prototype.wasCreatedByUpsampling=function(){return!0};my.prototype.isChildAvailable=function(e,t,n,i){return!1};Object.defineProperties(my.prototype,{credits:{get:function(){return this._credits}},waterMask:{get:function(){}}});var O8t=new $n("upsampleVerticesFromCesium3DTilesTerrain",uf.maximumAsynchronousTasks);function CW(e,t,n,i,r,o,s,a,c,u,f){if(f-a>1)throw new pe("Upsampling through more than one level at a time is not currently supported.");let p=n*.5,g=o*2!==c,m=s*2===u,y=r.tileXYToRectangle(c,u,f,new ie),A=r.ellipsoid,b={isEastChild:g,isNorthChild:m,rectangle:y,ellipsoid:A,skirtHeight:p,parentVertices:t.vertices,parentIndices:t.indices,parentVertexCountWithoutSkirts:t.vertexCountWithoutSkirts,parentIndexCountWithoutSkirts:t.indexCountWithoutSkirts,parentMinimumHeight:t.minimumHeight,parentMaximumHeight:t.maximumHeight,parentEncoding:t.encoding};if(e){let T=FP.upsampleMesh(b),E=new my({terrainMesh:T,skirtHeight:p,credits:i});return Promise.resolve(E)}let x=O8t.scheduleTask(b);if(x!==void 0)return x.then(function(T){let E=Co.clone(T.encoding,new Co),v=E.stride,S=new Float32Array(T.verticesBuffer),I=S.length/v,R=T.vertexCountWithoutSkirts,O=I<=65535?Uint16Array:Uint32Array,L=new O(T.indicesBuffer),_=new O(T.westIndicesBuffer),C=new O(T.eastIndicesBuffer),w=new O(T.southIndicesBuffer),P=new O(T.northIndicesBuffer),M=T.indexCountWithoutSkirts,F=T.minimumHeight,V=T.maximumHeight,B=h.clone(E.center,new h),j=ue.clone(T.boundingSphere,new ue),k=h.clone(T.horizonOcclusionPoint,new h),G=en.clone(T.orientedBoundingBox,new en),q=new bc(B,S,L,M,R,F,V,y,j,k,v,G,E,_,w,C,P),Q=new my({terrainMesh:q,skirtHeight:p,credits:i});return Promise.resolve(Q)})}var M8t=new U,N8t=new U,L8t=new U,F8t=new h;function p2e(e,t,n,i){let r=D.clamp((n-t.west)/t.width,0,1),o=D.clamp((i-t.south)/t.height,0,1),{vertices:s,encoding:a,indices:c}=e;for(let u=0;u<e.indexCountWithoutSkirts;u+=3){let f=c[u],d=c[u+1],p=c[u+2],g=a.decodeTextureCoordinates(s,f,M8t),m=a.decodeTextureCoordinates(s,d,N8t),y=a.decodeTextureCoordinates(s,p,L8t),A=Math.min(g.x,m.x,y.x),b=Math.max(g.x,m.x,y.x),x=Math.min(g.y,m.y,y.y),T=Math.max(g.y,m.y,y.y);if(r>=A&&r<=b&&o>=x&&o<=T){let E=fp.computeBarycentricCoordinates(r,o,g.x,g.y,m.x,m.y,y.x,y.y,F8t);if(E.x>=0&&E.y>=0&&E.z>=0){let v=a.decodeHeight(s,f),S=a.decodeHeight(s,d),I=a.decodeHeight(s,p);return E.x*v+E.y*S+E.z*I}}}return 0}var M4=py;function Y0(e){e=e??H.EMPTY_OBJECT;let t=e.credit;typeof t=="string"&&(t=new It(t)),this._credit=t,this._tileCredits=void 0,this._errorEvent=new be,this._ellipsoid=e.ellipsoid??ee.WGS84,this._tilingScheme=new er({ellipsoid:this._ellipsoid}),this._subtreeCache=new FC({provider:this}),this._tileset0=void 0,this._tileset1=void 0,this._resource=void 0,this._requestVertexNormals=e.requestVertexNormals??!1,this._requestWaterMask=e.requestWaterMask??!1}Y0.fromUrl=async function(e,t){t=t??H.EMPTY_OBJECT,e=await Promise.resolve(e);let n=De.createIfNeeded(e),i;try{i=await n.fetchJson()}catch(f){throw new oe("Could not load tileset JSON",f)}let r=new Y0(t);r._tileCredits=n.credits,r._resource=n;let o=i.root.children,s=o[0],a=o[1],c=i.schema,u=eu.fromJson(c);return r._tileset0=new r0(n,s,u),r._tileset1=new r0(n,a,u),r};Y0.fromIonAssetId=async function(e,t){let n=await Ho.fromAssetId(e);return Y0.fromUrl(n,t)};var B8t=new Array(3);Y0.prototype.requestTileGeometry=async function(e,t,n,i){let r=_2e(n,e),o=r===0?this._tileset0:this._tileset1,s=y2e(o,n,e,t),a=s.getSubtreeCoordinates(),c=this._subtreeCache,u=c.find(r,a),f=this._requestWaterMask,d=this,p;if(u===void 0){let x=o.subtreeUriTemplate.getDerivedResource({templateValues:a.getTemplateValues()});p=o.baseResource.getDerivedResource({url:x.url}).fetchArrayBuffer().then(async function(E){if(u=c.find(r,a),u===void 0){let v=new Uint8Array(E);u=await Ug.fromSubtreeJson(d._resource,void 0,v,o,a),c.addSubtree(r,u)}return u})}else p=Promise.resolve(u);let g=o.contentUriTemplates[0].getDerivedResource({templateValues:s.getTemplateValues()}),m=o.baseResource.getDerivedResource({url:g.url}),y=m.fetchArrayBuffer();if(y===void 0)return;let A=y.then(x=>cT(new Uint8Array(x))),b=B8t;b[0]=p,b[1]=A,b[2]=f?A.then(x=>k8t(x,m)):void 0;try{let x=await Promise.all(b),T=x[0],E=x[1],v=x[2],S=T.getTileMetadataView(s),I=S.getPropertyBySemantic(Vd.TILE_MINIMUM_HEIGHT),R=S.getPropertyBySemantic(Vd.TILE_MAXIMUM_HEIGHT),O=S.getPropertyBySemantic(Vd.TILE_BOUNDING_SPHERE),L=ue.unpack(O,0,new ue),_=S.getPropertyBySemantic(Vd.TILE_HORIZON_OCCLUSION_POINT),w=d._tilingScheme.tileXYToRectangle(e,t,n,new ie),P=d._ellipsoid,M=en.fromRectangle(w,I,R,P,new en),F=d.getLevelMaximumGeometricError(n)*5,V=vW(o,T,s,0,0),B=vW(o,T,s,1,0),j=vW(o,T,s,0,1),k=vW(o,T,s,1,1),G=(V?1:0)|(B?2:0)|(j?4:0)|(k?8:0),q=new M4({gltf:E,minimumHeight:I,maximumHeight:R,boundingSphere:L,orientedBoundingBox:M,horizonOcclusionPoint:_,skirtHeight:F,requestVertexNormals:d._requestVertexNormals,childTileMask:G,credits:d._tileCredits,waterMask:v});return Promise.resolve(q)}catch(x){console.log(`Could not load subtree: ${r} ${a.level} ${a.x} ${a.y}: ${x}`),console.log(`Could not load tile: ${r} ${s.level} ${s.x} ${s.y}: ${x}`);return}};Y0.prototype.getTileDataAvailable=function(e,t,n){let i=this._subtreeCache,r=_2e(n,e),o=r===0?this._tileset0:this._tileset1,s=y2e(o,n,e,t),a=s.getSubtreeCoordinates(),c=i.find(r,a);if(c!==void 0)return c.tileIsAvailableAtCoordinates(s);if(a.isImplicitTilesetRoot())return s.isSubtreeRoot()?!0:void 0;let u=a.getParentSubtreeCoordinates(),f=i.find(r,u);if(f!==void 0)return f.childSubtreeIsAvailableAtCoordinates(a)?s.isSubtreeRoot()?!0:void 0:!1};function _2e(e,t){let n=1<<e;return t/n|0}function y2e(e,t,n,i){let r=1<<t,o=t,s=n%r,a=r-i-1,{subdivisionScheme:c,subtreeLevels:u}=e;return new o0({subdivisionScheme:c,subtreeLevels:u,level:o,x:s,y:a})}async function k8t(e,t){let n=e.extensions?.EXT_structural_metadata;if(!l(n)||!l(n.propertyTextures))return;let i=new fA({schema:n.schema});await i.load();let r=i.schema,o,s;if(l(r.classes)){for(let g in r.classes)if(r.classes.hasOwnProperty(g)&&(o=r.classes[g],s=o.propertiesBySemantic.WATERMASK,l(s)))break}if(!l(s))return;let a=n.propertyTextures.find(g=>g.class===o.id);if(!l(a))throw new pe(`Expected a propertyTexture with a class ${o.id}`);let c=a.properties[s.id],u=e.textures[c.index],f=e.images[u.source]?.bufferView,d=Li.getBufferViewLoader({gltf:e,bufferViewId:f,gltfResource:t,baseResource:t});return await d.load(),await Bg({uint8Array:new Uint8Array(d.typedArray),format:"image/png",flipY:!1,skipColorSpaceConversion:!0})}function vW(e,t,n,i,r){let o=n.isBottomOfSubtree(),a=hae(e,1,i,r),c=n.getDescendantCoordinates(a);return o?t.childSubtreeIsAvailableAtCoordinates(c):t.tileIsAvailableAtCoordinates(c)}function hae(e,t,n,i){let{subdivisionScheme:r,subtreeLevels:o}=e;return new o0({subdivisionScheme:r,subtreeLevels:o,level:t,x:n,y:i})}Y0.prototype.loadTileDataAvailability=function(e,t,n){};Y0.prototype.getLevelMaximumGeometricError=function(e){let t=this._ellipsoid;return Xr.getEstimatedLevelZeroGeometricErrorForAHeightmap(t,64,2)/(1<<e)};Object.defineProperties(Y0.prototype,{errorEvent:{get:function(){return this._errorEvent}},credit:{get:function(){return this._credit}},tilingScheme:{get:function(){return this._tilingScheme}},hasWaterMask:{get:function(){return this._requestWaterMask}},hasVertexNormals:{get:function(){return this._requestVertexNormals}},availability:{get:function(){return this._subtreeCache}}});function U8t(e,t,n){this.rootId=e,this.subtree=t,this.stamp=n}function FC(e){this._maximumSubtreeCount=e.maximumSubtreeCount??0,this._subtreeRequestCounter=0,this._queue=new hy({comparator:FC.comparator}),this._provider=e.provider}FC.comparator=function(e,t){let n=e.subtree.implicitCoordinates,i=t.subtree.implicitCoordinates;return n.isAncestor(i)?1:i.isAncestor(n)?-1:e.stamp-t.stamp};FC.prototype.addSubtree=function(e,t){let n=new U8t(e,t,this._subtreeRequestCounter);this._queue.insert(n),this._subtreeRequestCounter++;let i=t.implicitCoordinates;if(i.level>0){let r=i.getParentSubtreeCoordinates(),o=this.find(e,r)}if(this._maximumSubtreeCount>0)for(;this._queue.length>this._maximumSubtreeCount&&this._queue.getMinimum()!==n;)this._queue.removeMinimum()};FC.prototype.find=function(e,t){let n=this._queue,i=n.internalArray,{level:r,x:o,y:s}=t;for(let a=0;a<n.length;a++){let c=i[a],u=c.rootId,f=c.subtree.implicitCoordinates;if(u===e&&f.level===r&&f.x===o&&f.y===s)return c.subtree}};FC.prototype._computeMaximumImplicitTileCoordinatesAtPosition=function(e){let{longitude:t,latitude:n}=e,i=this._provider,r=t<0?0:1,o=r===0?i._tileset0:i._tileset1,s=o.subtreeLevels,a=hae(o,0,0,0),c=this.find(r,a);if(c===void 0)return;let u=c.implicitCoordinates,f=u.x,d=u.y,p=u.level,g=-D.PI,m=+D.PI,y=D.lerp(g,m,r/2),A=D.lerp(g,m,(r+1)/2),b=-D.PI*.5,x=+D.PI*.5,T=0,E=0,v=!0;for(;v;){let I=1/(1<<p),R=(A-y)*I,O=y+f*R,L=(x-b)*I,_=b+d*L;T=(t-O)/R,E=(n-_)/L;let C=g2e(o,u,T,E,s);if(c.childSubtreeIsAvailableAtCoordinates(C)){let w=this.find(r,C);if(w!==void 0)c=w,u=c.implicitCoordinates,f=u.x,d=u.y,p=u.level;else return C}else v=!1}let S;for(let I=0;I<s;I++){let R=g2e(o,u,T,E,I);if(c.tileIsAvailableAtCoordinates(R))S=R;else break}return S};function g2e(e,t,n,i,r){let o=1<<r,s=D.clamp(n*o|0,0,o-1),a=D.clamp(i*o|0,0,o-1),c=hae(e,r,s,a);return t.getDescendantCoordinates(c)}FC.prototype.computeMaximumLevelAtPosition=function(e){let t=this._computeMaximumImplicitTileCoordinatesAtPosition(e);return t===void 0?0:t.level};var mae=Y0;function zb(e){e=e??H.EMPTY_OBJECT,this._quantizedVertices=e.quantizedVertices,this._encodedNormals=e.encodedNormals,this._indices=e.indices,this._minimumHeight=e.minimumHeight,this._maximumHeight=e.maximumHeight,this._boundingSphere=e.boundingSphere,this._orientedBoundingBox=e.orientedBoundingBox,this._horizonOcclusionPoint=e.horizonOcclusionPoint,this._credits=e.credits;let t=this._quantizedVertices.length/3,n=this._uValues=this._quantizedVertices.subarray(0,t),i=this._vValues=this._quantizedVertices.subarray(t,2*t);this._heightValues=this._quantizedVertices.subarray(2*t,3*t);function r(s,a){return i[s]-i[a]}function o(s,a){return n[s]-n[a]}this._westIndices=wW(e.westIndices,r,t),this._southIndices=wW(e.southIndices,o,t),this._eastIndices=wW(e.eastIndices,r,t),this._northIndices=wW(e.northIndices,o,t),this._westSkirtHeight=e.westSkirtHeight,this._southSkirtHeight=e.southSkirtHeight,this._eastSkirtHeight=e.eastSkirtHeight,this._northSkirtHeight=e.northSkirtHeight,this._childTileMask=e.childTileMask??15,this._createdByUpsampling=e.createdByUpsampling??!1,this._waterMask=e.waterMask,this._mesh=void 0}Object.defineProperties(zb.prototype,{credits:{get:function(){return this._credits}},waterMask:{get:function(){return this._waterMask}},childTileMask:{get:function(){return this._childTileMask}},canUpsample:{get:function(){return l(this._mesh)}}});var SW=[];function wW(e,t,n){SW.length=e.length;let i=!1;for(let r=0,o=e.length;r<o;++r)SW[r]=e[r],i=i||r>0&&t(e[r-1],e[r])>0;return i?(SW.sort(t),je.createTypedArray(n,SW)):e}var A2e="createVerticesFromQuantizedTerrainMesh",z8t=new $n(A2e),V8t=new $n(A2e,uf.maximumAsynchronousTasks);zb.prototype.createMesh=function(e){e=e??H.EMPTY_OBJECT;let t=e.tilingScheme,n=e.x,i=e.y,r=e.level,o=e.exaggeration??1,s=e.exaggerationRelativeHeight??0,a=e.throttle??!0,c=t.ellipsoid,u=t.tileXYToRectangle(n,i,r),d=(a?V8t:z8t).scheduleTask({minimumHeight:this._minimumHeight,maximumHeight:this._maximumHeight,quantizedVertices:this._quantizedVertices,octEncodedNormals:this._encodedNormals,includeWebMercatorT:!0,indices:this._indices,westIndices:this._westIndices,southIndices:this._southIndices,eastIndices:this._eastIndices,northIndices:this._northIndices,westSkirtHeight:this._westSkirtHeight,southSkirtHeight:this._southSkirtHeight,eastSkirtHeight:this._eastSkirtHeight,northSkirtHeight:this._northSkirtHeight,rectangle:u,relativeToCenter:this._boundingSphere.center,ellipsoid:c,exaggeration:o,exaggerationRelativeHeight:s});if(!l(d))return;let p=this;return Promise.resolve(d).then(function(g){let m=p._quantizedVertices.length/3,y=m+p._westIndices.length+p._southIndices.length+p._eastIndices.length+p._northIndices.length,A=je.createTypedArray(y,g.indices),b=new Float32Array(g.vertices),x=g.center,T=g.minimumHeight,E=g.maximumHeight,v=p._boundingSphere,S=p._orientedBoundingBox,I=h.clone(g.occludeePointInScaledSpace)??p._horizonOcclusionPoint,R=g.vertexStride,O=Co.clone(g.encoding);return p._mesh=new bc(x,b,A,g.indexCountWithoutSkirts,m,T,E,u,v,I,R,S,O,g.westIndicesSouthToNorth,g.southIndicesEastToWest,g.eastIndicesNorthToSouth,g.northIndicesWestToEast),p._quantizedVertices=void 0,p._encodedNormals=void 0,p._indices=void 0,p._uValues=void 0,p._vValues=void 0,p._heightValues=void 0,p._westIndices=void 0,p._southIndices=void 0,p._eastIndices=void 0,p._northIndices=void 0,p._mesh})};var j8t=new $n("upsampleQuantizedTerrainMesh",uf.maximumAsynchronousTasks);zb.prototype.upsample=function(e,t,n,i,r,o,s){let a=this._mesh;if(!l(this._mesh))return;let c=t*2!==r,u=n*2===o,f=e.ellipsoid,d=e.tileXYToRectangle(r,o,s),p=j8t.scheduleTask({vertices:a.vertices,vertexCountWithoutSkirts:a.vertexCountWithoutSkirts,indices:a.indices,indexCountWithoutSkirts:a.indexCountWithoutSkirts,encoding:a.encoding,minimumHeight:this._minimumHeight,maximumHeight:this._maximumHeight,isEastChild:c,isNorthChild:u,childRectangle:d,ellipsoid:f});if(!l(p))return;let g=Math.min(this._westSkirtHeight,this._eastSkirtHeight);g=Math.min(g,this._southSkirtHeight),g=Math.min(g,this._northSkirtHeight);let m=c?g*.5:this._westSkirtHeight,y=u?g*.5:this._southSkirtHeight,A=c?this._eastSkirtHeight:g*.5,b=u?this._northSkirtHeight:g*.5,x=this._credits;return Promise.resolve(p).then(function(T){let E=new Uint16Array(T.vertices),v=je.createTypedArray(E.length/3,T.indices),S;return l(T.encodedNormals)&&(S=new Uint8Array(T.encodedNormals)),new zb({quantizedVertices:E,indices:v,encodedNormals:S,minimumHeight:T.minimumHeight,maximumHeight:T.maximumHeight,boundingSphere:ue.clone(T.boundingSphere),orientedBoundingBox:en.clone(T.orientedBoundingBox),horizonOcclusionPoint:h.clone(T.horizonOcclusionPoint),westIndices:T.westIndices,southIndices:T.southIndices,eastIndices:T.eastIndices,northIndices:T.northIndices,westSkirtHeight:m,southSkirtHeight:y,eastSkirtHeight:A,northSkirtHeight:b,childTileMask:0,credits:x,createdByUpsampling:!0})})};var pae=32767,b2e=new h;zb.prototype.interpolateHeight=function(e,t,n){let i=D.clamp((t-e.west)/e.width,0,1);i*=pae;let r=D.clamp((n-e.south)/e.height,0,1);return r*=pae,l(this._mesh)?q8t(this,i,r):Y8t(this,i,r)};function x2e(e,t,n,i,r,o,s,a){let c=Math.min(n,r,s),u=Math.max(n,r,s),f=Math.min(i,o,a),d=Math.max(i,o,a);return e>=c&&e<=u&&t>=f&&t<=d}var H8t=new U,G8t=new U,W8t=new U;function q8t(e,t,n){let i=e._mesh,r=i.vertices,o=i.encoding,s=i.indices;for(let a=0,c=s.length;a<c;a+=3){let u=s[a],f=s[a+1],d=s[a+2],p=o.decodeTextureCoordinates(r,u,H8t),g=o.decodeTextureCoordinates(r,f,G8t),m=o.decodeTextureCoordinates(r,d,W8t);if(x2e(t,n,p.x,p.y,g.x,g.y,m.x,m.y)){let y=fp.computeBarycentricCoordinates(t,n,p.x,p.y,g.x,g.y,m.x,m.y,b2e);if(y.x>=-1e-15&&y.y>=-1e-15&&y.z>=-1e-15){let A=o.decodeHeight(r,u),b=o.decodeHeight(r,f),x=o.decodeHeight(r,d);return y.x*A+y.y*b+y.z*x}}}}function Y8t(e,t,n){let i=e._uValues,r=e._vValues,o=e._heightValues,s=e._indices;for(let a=0,c=s.length;a<c;a+=3){let u=s[a],f=s[a+1],d=s[a+2],p=i[u],g=i[f],m=i[d],y=r[u],A=r[f],b=r[d];if(x2e(t,n,p,y,g,A,m,b)){let x=fp.computeBarycentricCoordinates(t,n,p,y,g,A,m,b,b2e);if(x.x>=-1e-15&&x.y>=-1e-15&&x.z>=-1e-15){let T=x.x*o[u]+x.y*o[f]+x.z*o[d];return D.lerp(e._minimumHeight,e._maximumHeight,T/pae)}}}}zb.prototype.isChildAvailable=function(e,t,n,i){let r=2;return n!==e*2&&++r,i!==t*2&&(r-=2),(this._childTileMask&1<<r)!==0};zb.prototype.wasCreatedByUpsampling=function(){return this._createdByUpsampling};var BC=zb;function X8t(e){this.resource=e.resource,this.version=e.version,this.isHeightmap=e.isHeightmap,this.tileUrlTemplates=e.tileUrlTemplates,this.availability=e.availability,this.hasVertexNormals=e.hasVertexNormals,this.hasWaterMask=e.hasWaterMask,this.hasMetadata=e.hasMetadata,this.availabilityLevels=e.availabilityLevels,this.availabilityTilesLoaded=e.availabilityTilesLoaded,this.littleEndianExtensionSize=e.littleEndianExtensionSize,this.availabilityPromiseCache={}}function E2e(e){this.requestVertexNormals=e.requestVertexNormals??!1,this.requestWaterMask=e.requestWaterMask??!1,this.requestMetadata=e.requestMetadata??!0,this.ellipsoid=e.ellipsoid??ee.default,this.heightmapWidth=65,this.heightmapStructure=void 0,this.hasWaterMask=!1,this.hasMetadata=!1,this.hasVertexNormals=!1,this.scheme=void 0,this.lastResource=void 0,this.layerJsonResource=void 0,this.previousError=void 0,this.availability=void 0,this.tilingScheme=void 0,this.levelZeroMaximumGeometricError=void 0,this.heightmapStructure=void 0,this.layers=[],this.attribution="",this.overallAvailability=[],this.overallMaxZoom=0,this.tileCredits=[]}E2e.prototype.build=function(e){e._heightmapWidth=this.heightmapWidth,e._scheme=this.scheme;let t=l(this.lastResource.credits)?this.lastResource.credits:[];e._tileCredits=t.concat(this.tileCredits),e._availability=this.availability,e._tilingScheme=this.tilingScheme,e._requestWaterMask=this.requestWaterMask,e._levelZeroMaximumGeometricError=this.levelZeroMaximumGeometricError,e._heightmapStructure=this.heightmapStructure,e._layers=this.layers,e._hasWaterMask=this.hasWaterMask,e._hasVertexNormals=this.hasVertexNormals,e._hasMetadata=this.hasMetadata};async function C2e(e,t,n){if(!t.format){let y="The tile format is not specified in the layer.json file.";throw e.previousError=Zr.reportError(e.previousError,n,l(n)?n._errorEvent:void 0,y),new oe(y)}if(!t.tiles||t.tiles.length===0){let y="The layer.json file does not specify any tile URL templates.";throw e.previousError=Zr.reportError(e.previousError,n,l(n)?n._errorEvent:void 0,y),new oe(y)}let i=!1,r=!1,o=!1,s=!0,a=!1;if(t.format==="heightmap-1.0")a=!0,l(e.heightmapStructure)||(e.heightmapStructure={heightScale:1/5,heightOffset:-1e3,elementsPerHeight:1,stride:1,elementMultiplier:256,isBigEndian:!1,lowestEncodedHeight:0,highestEncodedHeight:256*256-1}),r=!0,e.requestWaterMask=!0;else if(t.format.indexOf("quantized-mesh-1.")!==0){let y=`The tile format "${t.format}" is invalid or not supported.`;throw e.previousError=Zr.reportError(e.previousError,n,l(n)?n._errorEvent:void 0,y),new oe(y)}let c=t.tiles,u=t.maxzoom;if(e.overallMaxZoom=Math.max(e.overallMaxZoom,u),!t.projection||t.projection==="EPSG:4326")e.tilingScheme=new er({numberOfLevelZeroTilesX:2,numberOfLevelZeroTilesY:1,ellipsoid:e.ellipsoid});else if(t.projection==="EPSG:3857")e.tilingScheme=new Lo({numberOfLevelZeroTilesX:1,numberOfLevelZeroTilesY:1,ellipsoid:e.ellipsoid});else{let y=`The projection "${t.projection}" is invalid or not supported.`;throw e.previousError=Zr.reportError(e.previousError,n,l(n)?n._errorEvent:void 0,y),new oe(y)}if(e.levelZeroMaximumGeometricError=Xr.getEstimatedLevelZeroGeometricErrorForAHeightmap(e.tilingScheme.ellipsoid,e.heightmapWidth,e.tilingScheme.getNumberOfXTilesAtLevel(0)),!t.scheme||t.scheme==="tms"||t.scheme==="slippyMap")e.scheme=t.scheme;else{let y=`The scheme "${t.scheme}" is invalid or not supported.`;throw e.previousError=Zr.reportError(e.previousError,n,l(n)?n._errorEvent:void 0,y),new oe(y)}let f;l(t.extensions)&&t.extensions.indexOf("octvertexnormals")!==-1?i=!0:l(t.extensions)&&t.extensions.indexOf("vertexnormals")!==-1&&(i=!0,s=!1),l(t.extensions)&&t.extensions.indexOf("watermask")!==-1&&(r=!0),l(t.extensions)&&t.extensions.indexOf("metadata")!==-1&&(o=!0);let d=t.metadataAvailability,p=t.available,g;if(l(p)&&!l(d)){g=new up(e.tilingScheme,p.length);for(let y=0;y<p.length;++y){let A=p[y],b=e.tilingScheme.getNumberOfYTilesAtLevel(y);l(e.overallAvailability[y])||(e.overallAvailability[y]=[]);for(let x=0;x<A.length;++x){let T=A[x],E=b-T.endY-1,v=b-T.startY-1;e.overallAvailability[y].push([T.startX,E,T.endX,v]),g.addAvailableTileRange(y,T.startX,E,T.endX,v)}}}else l(d)&&(f=new up(e.tilingScheme,u),g=new up(e.tilingScheme,u),e.overallAvailability[0]=[[0,0,1,0]],g.addAvailableTileRange(0,0,0,1,0));e.hasWaterMask=e.hasWaterMask||r,e.hasVertexNormals=e.hasVertexNormals||i,e.hasMetadata=e.hasMetadata||o,l(t.attribution)&&(e.attribution.length>0&&(e.attribution+=" "),e.attribution+=t.attribution),e.layers.push(new X8t({resource:e.lastResource,version:t.version,isHeightmap:a,tileUrlTemplates:c,availability:g,hasVertexNormals:i,hasWaterMask:r,hasMetadata:o,availabilityLevels:d,availabilityTilesLoaded:f,littleEndianExtensionSize:s}));let m=t.parentUrl;return l(m)?l(g)?(e.lastResource=e.lastResource.getDerivedResource({url:m}),e.lastResource.appendForwardSlash(),e.layerJsonResource=e.lastResource.getDerivedResource({url:"layer.json"}),await yae(e),!0):(console.log("A layer.json can't have a parentUrl if it does't have an available array."),!0):!0}function K8t(e,t,n){let i=`An error occurred while accessing ${e.layerJsonResource.url}.`;if(l(t)&&(i+=` -${t.message}`),e.previousError=Zr.reportError(e.previousError,n,l(n)?n._errorEvent:void 0,i),e.previousError.retry)return yae(e,n);throw new oe(i)}async function $8t(e,t,n){await C2e(e,t,n);let i=e.overallAvailability.length;if(i>0){let r=e.availability=new up(e.tilingScheme,e.overallMaxZoom);for(let o=0;o<i;++o){let s=e.overallAvailability[o];for(let a=0;a<s.length;++a){let c=s[a];r.addAvailableTileRange(o,c[0],c[1],c[2],c[3])}}}if(e.attribution.length>0){let r=new It(e.attribution);e.tileCredits.push(r)}return!0}async function yae(e,t){try{let n=await e.layerJsonResource.fetchJson();return $8t(e,n,t)}catch(n){return l(n)&&n.statusCode===404?(await C2e(e,{tilejson:"2.1.0",format:"heightmap-1.0",version:"1.0.0",scheme:"tms",tiles:["{z}/{x}/{y}.terrain?v={version}"]},t),!0):K8t(e,n,t)}}function dp(e){e=e??H.EMPTY_OBJECT,this._heightmapWidth=void 0,this._heightmapStructure=void 0,this._hasWaterMask=!1,this._hasVertexNormals=!1,this._hasMetadata=!1,this._scheme=void 0,this._ellipsoid=e.ellipsoid,this._requestVertexNormals=e.requestVertexNormals??!1,this._requestWaterMask=e.requestWaterMask??!1,this._requestMetadata=e.requestMetadata??!0,this._errorEvent=new be;let t=e.credit;typeof t=="string"&&(t=new It(t)),this._credit=t,this._availability=void 0,this._tilingScheme=void 0,this._levelZeroMaximumGeometricError=void 0,this._layers=void 0,this._tileCredits=void 0}var gae={OCT_VERTEX_NORMALS:1,WATER_MASK:2,METADATA:4};function T2e(e){return!l(e)||e.length===0?{Accept:"application/vnd.quantized-mesh,application/octet-stream;q=0.9,*/*;q=0.01"}:{Accept:`application/vnd.quantized-mesh;extensions=${e.join("-")},application/octet-stream;q=0.9,*/*;q=0.01`}}function J8t(e,t,n,i,r){let o=new Uint16Array(t,0,e._heightmapWidth*e._heightmapWidth);return new jc({buffer:o,childTileMask:new Uint8Array(t,o.byteLength,1)[0],waterMask:new Uint8Array(t,o.byteLength+1,t.byteLength-o.byteLength-1),width:e._heightmapWidth,height:e._heightmapWidth,structure:e._heightmapStructure,credits:e._tileCredits})}function Z8t(e,t,n,i,r,o){let s=o.littleEndianExtensionSize,a=0,c=3,u=c+1,f=Float64Array.BYTES_PER_ELEMENT*c,d=Float64Array.BYTES_PER_ELEMENT*u,g=Uint16Array.BYTES_PER_ELEMENT*3,m=3,y=Uint16Array.BYTES_PER_ELEMENT,A=y*m,b=new DataView(t),x=new h(b.getFloat64(a,!0),b.getFloat64(a+8,!0),b.getFloat64(a+16,!0));a+=f;let T=b.getFloat32(a,!0);a+=Float32Array.BYTES_PER_ELEMENT;let E=b.getFloat32(a,!0);a+=Float32Array.BYTES_PER_ELEMENT;let v=new ue(new h(b.getFloat64(a,!0),b.getFloat64(a+8,!0),b.getFloat64(a+16,!0)),b.getFloat64(a+f,!0));a+=d;let S=new h(b.getFloat64(a,!0),b.getFloat64(a+8,!0),b.getFloat64(a+16,!0));a+=f;let I=b.getUint32(a,!0);a+=Uint32Array.BYTES_PER_ELEMENT;let R=new Uint16Array(t,a,I*3);a+=I*g,I>64*1024&&(y=Uint32Array.BYTES_PER_ELEMENT,A=y*m);let O=R.subarray(0,I),L=R.subarray(I,2*I),_=R.subarray(I*2,3*I);cn.zigZagDeltaDecode(O,L,_),a%y!==0&&(a+=y-a%y);let C=b.getUint32(a,!0);a+=Uint32Array.BYTES_PER_ELEMENT;let w=je.createTypedArrayFromArrayBuffer(I,t,a,C*m);a+=C*A;let P=0,M=w.length;for(let fe=0;fe<M;++fe){let xe=w[fe];w[fe]=P-xe,xe===0&&++P}let F=b.getUint32(a,!0);a+=Uint32Array.BYTES_PER_ELEMENT;let V=je.createTypedArrayFromArrayBuffer(I,t,a,F);a+=F*y;let B=b.getUint32(a,!0);a+=Uint32Array.BYTES_PER_ELEMENT;let j=je.createTypedArrayFromArrayBuffer(I,t,a,B);a+=B*y;let k=b.getUint32(a,!0);a+=Uint32Array.BYTES_PER_ELEMENT;let G=je.createTypedArrayFromArrayBuffer(I,t,a,k);a+=k*y;let q=b.getUint32(a,!0);a+=Uint32Array.BYTES_PER_ELEMENT;let Q=je.createTypedArrayFromArrayBuffer(I,t,a,q);a+=q*y;let W,J;for(;a<b.byteLength;){let fe=b.getUint8(a,!0);a+=Uint8Array.BYTES_PER_ELEMENT;let xe=b.getUint32(a,s);if(a+=Uint32Array.BYTES_PER_ELEMENT,fe===gae.OCT_VERTEX_NORMALS&&e._requestVertexNormals)W=new Uint8Array(t,a,I*2);else if(fe===gae.WATER_MASK&&e._requestWaterMask)J=new Uint8Array(t,a,xe);else if(fe===gae.METADATA&&e._requestMetadata){let ge=b.getUint32(a,!0);if(ge>0){let Se=Ro(new Uint8Array(t),a+Uint32Array.BYTES_PER_ELEMENT,ge).available;if(l(Se))for(let Re=0;Re<Se.length;++Re){let Qe=n+Re+1,He=Se[Re],Xe=e._tilingScheme.getNumberOfYTilesAtLevel(Qe);for(let $e=0;$e<He.length;++$e){let Pe=He[$e],qe=Xe-Pe.endY-1,st=Xe-Pe.startY-1;e.availability.addAvailableTileRange(Qe,Pe.startX,qe,Pe.endX,st),o.availability.addAvailableTileRange(Qe,Pe.startX,qe,Pe.endX,st)}}}o.availabilityTilesLoaded.addAvailableTileRange(n,i,r,i,r)}a+=xe}let Z=e.getLevelMaximumGeometricError(n)*5,ae=e._tilingScheme.tileXYToRectangle(i,r,n),Ae=en.fromRectangle(ae,T,E,e._tilingScheme.ellipsoid);return new BC({center:x,minimumHeight:T,maximumHeight:E,boundingSphere:v,orientedBoundingBox:Ae,horizonOcclusionPoint:S,quantizedVertices:R,encodedNormals:W,indices:w,westIndices:V,southIndices:j,eastIndices:G,northIndices:Q,westSkirtHeight:Z,southSkirtHeight:Z,eastSkirtHeight:Z,northSkirtHeight:Z,childTileMask:e.availability.computeChildMaskForTile(n,i,r),waterMask:J,credits:e._tileCredits})}dp.prototype.requestTileGeometry=function(e,t,n,i){let r=this._layers,o,s=r.length,a=!1,c=Promise.resolve();if(s===1)o=r[0];else for(let u=0;u<s;++u){let f=r[u];if(!l(f.availability)||f.availability.isTileAvailable(n,e,t)){o=f;break}let d=Aae(this,e,t,n,f,u===0);d.result&&(a=!0,c=c.then(()=>d.promise))}return!l(o)&&a?c.then(()=>new Promise(u=>{setTimeout(()=>{let f=this.requestTileGeometry(e,t,n,i);u(f)},0)})):v2e(this,e,t,n,o,i)};function v2e(e,t,n,i,r,o){if(!l(r))return Promise.reject(new oe("Terrain tile doesn't exist"));let s=r.tileUrlTemplates;if(s.length===0)return;let a;!e._scheme||e._scheme==="tms"?a=e._tilingScheme.getNumberOfYTilesAtLevel(i)-n-1:a=n;let c=[];e._requestVertexNormals&&r.hasVertexNormals&&c.push(r.littleEndianExtensionSize?"octvertexnormals":"vertexnormals"),e._requestWaterMask&&r.hasWaterMask&&c.push("watermask"),e._requestMetadata&&r.hasMetadata&&c.push("metadata");let u,f,d=s[(t+a+i)%s.length],p=r.resource;l(p._ionEndpoint)&&!l(p._ionEndpoint.externalType)?(c.length!==0&&(f={extensions:c.join("-")}),u=T2e(void 0)):u=T2e(c);let g=p.getDerivedResource({url:d,templateValues:{version:r.version,z:i,x:t,y:a},queryParameters:f,headers:u,request:o}).fetchArrayBuffer();if(l(g))return g.then(function(m){return l(m)?l(e._heightmapStructure)?J8t(e,m,i,t,n):Z8t(e,m,i,t,n,r):Promise.reject(new oe("Mesh buffer doesn't exist."))})}Object.defineProperties(dp.prototype,{errorEvent:{get:function(){return this._errorEvent}},credit:{get:function(){return this._credit}},tilingScheme:{get:function(){return this._tilingScheme}},hasWaterMask:{get:function(){return this._hasWaterMask&&this._requestWaterMask}},hasVertexNormals:{get:function(){return this._hasVertexNormals&&this._requestVertexNormals}},hasMetadata:{get:function(){return this._hasMetadata&&this._requestMetadata}},requestVertexNormals:{get:function(){return this._requestVertexNormals}},requestWaterMask:{get:function(){return this._requestWaterMask}},requestMetadata:{get:function(){return this._requestMetadata}},availability:{get:function(){return this._availability}}});dp.prototype.getLevelMaximumGeometricError=function(e){return this._levelZeroMaximumGeometricError/(1<<e)};dp.fromIonAssetId=async function(e,t){let n=await Ho.fromAssetId(e);return dp.fromUrl(n,t)};dp.fromUrl=async function(e,t){t=t??H.EMPTY_OBJECT,e=await Promise.resolve(e);let n=De.createIfNeeded(e);n.appendForwardSlash();let i=new E2e(t);i.lastResource=n,i.layerJsonResource=i.lastResource.getDerivedResource({url:"layer.json"}),await yae(i);let r=new dp(t);return i.build(r),r};dp.prototype.getTileDataAvailable=function(e,t,n){if(!l(this._availability))return;if(n>this._availability._maximumLevel)return!1;if(this._availability.isTileAvailable(n,e,t))return!0;if(!this._hasMetadata)return!1;let i=this._layers,r=i.length;for(let o=0;o<r;++o)if(Aae(this,e,t,n,i[o],o===0).result)return;return!1};dp.prototype.loadTileDataAvailability=function(e,t,n){if(!l(this._availability)||n>this._availability._maximumLevel||this._availability.isTileAvailable(n,e,t)||!this._hasMetadata)return;let i=this._layers,r=i.length;for(let o=0;o<r;++o){let s=Aae(this,e,t,n,i[o],o===0);if(l(s.promise))return s.promise}};function _ae(e,t,n,i){if(i===0)return;let r=e.availabilityLevels,o=i%r===0?i-r:(i/r|0)*r,s=1<<i-o,a=t/s|0,c=n/s|0;return{level:o,x:a,y:c}}function Aae(e,t,n,i,r,o){if(!l(r.availabilityLevels))return{result:!1};let s,a=function(){delete r.availabilityPromiseCache[s]},c=r.availabilityTilesLoaded,u=r.availability,f=_ae(r,t,n,i);for(;l(f);){if(u.isTileAvailable(f.level,f.x,f.y)&&!c.isTileAvailable(f.level,f.x,f.y)){let d;if(!o&&(s=`${f.level}-${f.x}-${f.y}`,d=r.availabilityPromiseCache[s],!l(d))){let p=new wo({throttle:!1,throttleByServer:!0,type:Zs.TERRAIN});d=v2e(e,f.x,f.y,f.level,r,p),l(d)&&(r.availabilityPromiseCache[s]=d,d.then(a))}return{result:!0,promise:d}}f=_ae(r,f.x,f.y,f.level)}return{result:!1}}dp._getAvailabilityTile=_ae;var kC=dp;function gy(e){e=e??H.EMPTY_OBJECT;let t=e.radius,n={center:e.center,semiMajorAxis:t,semiMinorAxis:t,ellipsoid:e.ellipsoid,height:e.height,extrudedHeight:e.extrudedHeight,granularity:e.granularity,vertexFormat:e.vertexFormat,stRotation:e.stRotation,shadowVolume:e.shadowVolume};this._ellipseGeometry=new mu(n),this._workerName="createCircleGeometry"}gy.packedLength=mu.packedLength;gy.pack=function(e,t,n){return mu.pack(e._ellipseGeometry,t,n)};var S2e=new mu({center:new h,semiMajorAxis:1,semiMinorAxis:1}),Gc={center:new h,radius:void 0,ellipsoid:ee.clone(ee.default),height:void 0,extrudedHeight:void 0,granularity:void 0,vertexFormat:new Be,stRotation:void 0,semiMajorAxis:void 0,semiMinorAxis:void 0,shadowVolume:void 0};gy.unpack=function(e,t,n){let i=mu.unpack(e,t,S2e);return Gc.center=h.clone(i._center,Gc.center),Gc.ellipsoid=ee.clone(i._ellipsoid,Gc.ellipsoid),Gc.ellipsoid=ee.clone(i._ellipsoid,S2e._ellipsoid),Gc.height=i._height,Gc.extrudedHeight=i._extrudedHeight,Gc.granularity=i._granularity,Gc.vertexFormat=Be.clone(i._vertexFormat,Gc.vertexFormat),Gc.stRotation=i._stRotation,Gc.shadowVolume=i._shadowVolume,l(n)?(Gc.semiMajorAxis=i._semiMajorAxis,Gc.semiMinorAxis=i._semiMinorAxis,n._ellipseGeometry=new mu(Gc),n):(Gc.radius=i._semiMajorAxis,new gy(Gc))};gy.createGeometry=function(e){return mu.createGeometry(e._ellipseGeometry)};gy.createShadowVolume=function(e,t,n){let i=e._ellipseGeometry._granularity,r=e._ellipseGeometry._ellipsoid,o=t(i,r),s=n(i,r);return new gy({center:e._ellipseGeometry._center,radius:e._ellipseGeometry._semiMajorAxis,ellipsoid:r,stRotation:e._ellipseGeometry._stRotation,granularity:i,extrudedHeight:o,height:s,vertexFormat:Be.POSITION_ONLY,shadowVolume:!0})};Object.defineProperties(gy.prototype,{rectangle:{get:function(){return this._ellipseGeometry.rectangle}},textureCoordinateRotationPoints:{get:function(){return this._ellipseGeometry.textureCoordinateRotationPoints}}});var bae=gy;function BP(e){e=e??H.EMPTY_OBJECT;let t=e.radius,n={center:e.center,semiMajorAxis:t,semiMinorAxis:t,ellipsoid:e.ellipsoid,height:e.height,extrudedHeight:e.extrudedHeight,granularity:e.granularity,numberOfVerticalLines:e.numberOfVerticalLines};this._ellipseGeometry=new td(n),this._workerName="createCircleOutlineGeometry"}BP.packedLength=td.packedLength;BP.pack=function(e,t,n){return td.pack(e._ellipseGeometry,t,n)};var Q8t=new td({center:new h,semiMajorAxis:1,semiMinorAxis:1}),_d={center:new h,radius:void 0,ellipsoid:ee.clone(ee.UNIT_SPHERE),height:void 0,extrudedHeight:void 0,granularity:void 0,numberOfVerticalLines:void 0,semiMajorAxis:void 0,semiMinorAxis:void 0};BP.unpack=function(e,t,n){let i=td.unpack(e,t,Q8t);return _d.center=h.clone(i._center,_d.center),_d.ellipsoid=ee.clone(i._ellipsoid,_d.ellipsoid),_d.height=i._height,_d.extrudedHeight=i._extrudedHeight,_d.granularity=i._granularity,_d.numberOfVerticalLines=i._numberOfVerticalLines,l(n)?(_d.semiMajorAxis=i._semiMajorAxis,_d.semiMinorAxis=i._semiMinorAxis,n._ellipseGeometry=new td(_d),n):(_d.radius=i._semiMajorAxis,new BP(_d))};BP.createGeometry=function(e){return td.createGeometry(e._ellipseGeometry)};var xae=BP;function ejt(e){return e=e??H.EMPTY_OBJECT,kC.fromIonAssetId(2426648,{requestVertexNormals:e.requestVertexNormals??!1})}var N4=ejt;function tjt(e){return e=e??H.EMPTY_OBJECT,kC.fromIonAssetId(1,{requestVertexNormals:e.requestVertexNormals??!1,requestWaterMask:e.requestWaterMask??!1,ellipsoid:ee.WGS84})}var UC=tjt;function kP(e){e=e??H.EMPTY_OBJECT,this._callback=e.callback,this._tilingScheme=e.tilingScheme,l(this._tilingScheme)||(this._tilingScheme=new er({ellipsoid:e.ellipsoid??ee.default})),this._width=e.width,this._height=e.height;let t=Math.max(this._width,this._height);this._levelZeroMaximumGeometricError=Xr.getEstimatedLevelZeroGeometricErrorForAHeightmap(this._tilingScheme.ellipsoid,t,this._tilingScheme.getNumberOfXTilesAtLevel(0)),this._errorEvent=new be;let n=e.credit;typeof n=="string"&&(n=new It(n)),this._credit=n}Object.defineProperties(kP.prototype,{errorEvent:{get:function(){return this._errorEvent}},credit:{get:function(){return this._credit}},tilingScheme:{get:function(){return this._tilingScheme}},hasWaterMask:{get:function(){return!1}},hasVertexNormals:{get:function(){return!1}},availability:{get:function(){}},width:{get:function(){return this._width}},height:{get:function(){return this._height}}});kP.prototype.requestTileGeometry=function(e,t,n,i){let r=this._callback(e,t,n);if(!l(r))return;let o=this._width,s=this._height;return Promise.resolve(r).then(function(a){let c=a;return Array.isArray(c)&&(c=new Float64Array(c)),new jc({buffer:c,width:o,height:s})})};kP.prototype.getLevelMaximumGeometricError=function(e){return this._levelZeroMaximumGeometricError/(1<<e)};kP.prototype.getTileDataAvailable=function(e,t,n){};kP.prototype.loadTileDataAvailability=function(e,t,n){};var Tae=kP;var njt=1953029805,ijt=2917034100;function Eae(e,t){if(Eae.passThroughDataForTesting)return t;let n=e.byteLength;if(n===0||n%4!==0)throw new oe("The length of key must be greater than 0 and a multiple of 4.");let i=new DataView(t),r=i.getUint32(0,!0);if(r===njt||r===ijt)return t;let o=new DataView(e),s=0,a=t.byteLength,c=a-a%8,u=n,f,d=8;for(;s<c;)for(d=(d+8)%24,f=d;s<c&&f<u;)i.setUint32(s,i.getUint32(s,!0)^o.getUint32(f,!0),!0),i.setUint32(s+4,i.getUint32(s+4,!0)^o.getUint32(f+4,!0),!0),s+=8,f+=24;if(s<a)for(f>=u&&(d=(d+8)%24,f=d);s<a;)i.setUint8(s,i.getUint8(s)^o.getUint8(f)),s++,f++}Eae.passThroughDataForTesting=!1;var L4=Eae;function w2e(e){this.proxy=e}w2e.prototype.getURL=function(e){let t=this.proxy.indexOf("?")===-1?"?":"";return this.proxy+t+encodeURIComponent(e)};var Cae=w2e;function IW(){pe.throwInstantiationError()}Object.defineProperties(IW.prototype,{credit:{get:pe.throwInstantiationError}});IW.getCreditsFromResult=function(e){if(l(e.attributions))return e.attributions.map(It.getIonCredit)};IW.prototype.geocode=pe.throwInstantiationError;var UP=IW;var I2e={SEARCH:0,AUTOCOMPLETE:1};Object.freeze(I2e);var Vb=I2e;function P2e(){pe.throwInstantiationError()}P2e.createGeometry=function(e){pe.throwInstantiationError()};var vae=P2e;var ljt=Qo(Sae(),1);function rjt(e,t){return(e&t)!==0}var Pl=rjt;var ojt=[1,2,4,8],D2e=15,sjt=16,ajt=64,cjt=128;function X0(e,t,n,i,r,o){this._bits=e,this.cnodeVersion=t,this.imageryVersion=n,this.terrainVersion=i,this.imageryProvider=r,this.terrainProvider=o,this.ancestorHasTerrain=!1,this.terrainState=void 0}X0.clone=function(e,t){return l(t)?(t._bits=e._bits,t.cnodeVersion=e.cnodeVersion,t.imageryVersion=e.imageryVersion,t.terrainVersion=e.terrainVersion,t.imageryProvider=e.imageryProvider,t.terrainProvider=e.terrainProvider):t=new X0(e._bits,e.cnodeVersion,e.imageryVersion,e.terrainVersion,e.imageryProvider,e.terrainProvider),t.ancestorHasTerrain=e.ancestorHasTerrain,t.terrainState=e.terrainState,t};X0.prototype.setParent=function(e){this.ancestorHasTerrain=e.ancestorHasTerrain||this.hasTerrain()};X0.prototype.hasSubtree=function(){return Pl(this._bits,sjt)};X0.prototype.hasImagery=function(){return Pl(this._bits,ajt)};X0.prototype.hasTerrain=function(){return Pl(this._bits,cjt)};X0.prototype.hasChildren=function(){return Pl(this._bits,D2e)};X0.prototype.hasChild=function(e){return Pl(this._bits,ojt[e])};X0.prototype.getChildBitmask=function(){return this._bits&D2e};var B4=X0;function ujt(e){let t=e.length,n=new ArrayBuffer(t),i=new Uint8Array(n);for(let r=0;r<t;++r)i[r]=e.charCodeAt(r);return n}var fjt=ujt(`E\xF4\xBD\vy\xE2jE"\x92,\xCDq\xF8IFgQ\0B%\xC6\xE8a,f)\b\xC64\xDCjb%y -wmi\xD6\xF0\x9Ck\x93\xA1\xBDNu\xE0A[\xDF@V\f\xD9\xBBr\x9B\x81|3S\xEEOl\xD4q\xB0{\xC0\x7FEVZ\xADwUe\v3\x92*\xACl5\xC50s\xF83>mF8J\xB4\xDD\xF0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BF^PI\xF8M\xC0\xCBGLO\xF7{+\xD8\xC51\x92;\xB5o\xDCl\r\x92\x88\xD1\x9E\xDB?\xE2\xE9\xDA_\xD4\x84\xE2FaZ\xDEU\xCF\xA4\0\xBE\xFD\xCEg\xF1Ji\x97\xE6 H\xD8]\x7F~\xAEq N\xAE\xC0V\xA9\x91<\x82r\xE7v\xEC)I\xD6]-\x83\xE3\xDB6\xA9;f\x97\x87j\xD5\xB6=P^R\xB9K\xC7sWx\xC9\xF4.Y\x07\x95\x93o\xD0KW>''\xC7\`\xDB;\xED\x9ASD>?\x8D\x92mw\xA2 -\xEB?R\xA8\xC6U^1I7\x85\xF4\xC5&-\xA9\xBF\x8B'T\xDA\xC3j \xE5*x\xB0\xD6\x90pr\xAA\x8Bh\xBD\x88\xF7_H\xB1~\xC0XL?f\xF9>\xE1e\xC0p\xA7\xCF8i\xAF\xF0VldI\x9C'\xADxtO\xC2\x87\xDEV9\0\xDAw\v\xCB-\x1B\x89\xFB5O\xF5\bQ\`\xC1 -ZGM&30x\xDA\xC0\x9CFG\xE2[y\`In7gS ->\xE9\xECF9\xB2\xF14\r\xC6\x84Sun\xE1\fY\xD9\xDE)\x85{II\xA5wy\xBEIV.6\xE7\v:\xBBOb{\xD2M1\x95/\xBD8{\xA8O!\xE1\xECFpv\x95})"x\x88 -\x90\xDD\x9D\\\xDA\xDEQ\xCF\xF0\xFCYRe|3\xDF\xF3H\xDA\xBB*u\xDB\`\xB2\xD4\xFC\xED\x1B\xEC\x7F5\xA8\xFF(1\x07-\xC8\xDC\x88F|\x8A["`);function yd(e){this.imageryPresent=!0,this.protoImagery=void 0,this.terrainPresent=!0,this.negativeAltitudeExponentBias=32,this.negativeAltitudeThreshold=D.EPSILON12,this.providers={},this.key=void 0,this._resource=void 0,this._quadPacketVersion=1,this._tileInfo={},this._subtreePromises={}}Object.defineProperties(yd.prototype,{url:{get:function(){return this._resource.url}},proxy:{get:function(){return this._resource.proxy}},resource:{get:function(){return this._resource}}});yd.fromUrl=async function(e){let t=e;typeof t!="string"&&!(t instanceof De)&&(t=e.url);let n=De.createIfNeeded(t);n.appendForwardSlash();let i=new yd;i._resource=n;try{await djt(i),await i.getQuadTreePacket("",i._quadPacketVersion)}catch(r){let o=`An error occurred while accessing ${O2e(i,"",1).url}: ${r}`;throw new oe(o)}return i};yd.tileXYToQuadKey=function(e,t,n){let i="";for(let r=n;r>=0;--r){let o=1<<r,s=0;Pl(t,o)?Pl(e,o)&&(s|=1):(s|=2,Pl(e,o)||(s|=1)),i+=s}return i};yd.quadKeyToTileXY=function(e){let t=0,n=0,i=e.length-1;for(let r=i;r>=0;--r){let o=1<<r,s=+e[i-r];Pl(s,2)?Pl(s,1)||(t|=o):(n|=o,Pl(s,1)&&(t|=o))}return{x:t,y:n,level:i}};yd.prototype.isValid=function(e){let t=this.getTileInformationFromQuadKey(e);if(l(t))return t!==null;let n=!0,i=e,r;for(;i.length>1;)if(r=i.substring(i.length-1),i=i.substring(0,i.length-1),t=this.getTileInformationFromQuadKey(i),l(t)){!t.hasSubtree()&&!t.hasChild(parseInt(r))&&(n=!1);break}else if(t===null){n=!1;break}return n};var R2e=new $n("decodeGoogleEarthEnterprisePacket");yd.prototype.getQuadTreePacket=function(e,t,n){t=t??1,e=e??"";let r=O2e(this,e,t,n).fetchArrayBuffer();if(!l(r))return;let o=this._tileInfo,s=this.key;return r.then(function(a){return R2e.scheduleTask({buffer:a,quadKey:e,type:"Metadata",key:s},[a]).then(function(u){let f,d=-1;if(e!==""){d=e.length+1;let m=u[e];f=o[e],f._bits|=m._bits,delete u[e]}let p=Object.keys(u);p.sort(function(m,y){return m.length-y.length});let g=p.length;for(let m=0;m<g;++m){let y=p[m];if(u[y]!==null){let b=B4.clone(u[y]),x=y.length;if(x===d)b.setParent(f);else if(x>1){let T=o[y.substring(0,y.length-1)];b.setParent(T)}o[y]=b}else o[y]=null}})})};yd.prototype.populateSubtree=function(e,t,n,i){let r=yd.tileXYToQuadKey(e,t,n);return Pae(this,r,i)};function Pae(e,t,n){let i=e._tileInfo,r=t,o=i[r];if(l(o)&&(!o.hasSubtree()||o.hasChildren()))return o;for(;o===void 0&&r.length>1;)r=r.substring(0,r.length-1),o=i[r];let s,a=e._subtreePromises,c=a[r];if(l(c))return c.then(function(){return s=new wo({throttle:n.throttle,throttleByServer:n.throttleByServer,type:n.type,priorityFunction:n.priorityFunction}),Pae(e,t,s)});if(!l(o)||!o.hasSubtree())return Promise.reject(new oe(`Couldn't load metadata for tile ${t}`));if(c=e.getQuadTreePacket(r,o.cnodeVersion,n),!!l(c))return a[r]=c,c.then(function(){return s=new wo({throttle:n.throttle,throttleByServer:n.throttleByServer,type:n.type,priorityFunction:n.priorityFunction}),Pae(e,t,s)}).finally(function(){delete a[r]})}yd.prototype.getTileInformation=function(e,t,n){let i=yd.tileXYToQuadKey(e,t,n);return this._tileInfo[i]};yd.prototype.getTileInformationFromQuadKey=function(e){return this._tileInfo[e]};function O2e(e,t,n,i){return e._resource.getDerivedResource({url:`flatfile?q2-0${t}-q.${n.toString()}`,request:i})}var wae,Iae;function djt(e){let t=e._resource.getDerivedResource({url:"dbRoot.v5",queryParameters:{output:"proto"}});if(!l(Iae)){let n=Zt("ThirdParty/google-earth-dbroot-parser.js"),i=window.cesiumGoogleEarthDbRootParser;Iae=ix(n).then(function(){wae=window.cesiumGoogleEarthDbRootParser(ljt),l(i)?window.cesiumGoogleEarthDbRootParser=i:delete window.cesiumGoogleEarthDbRootParser})}return Iae.then(function(){return t.fetchArrayBuffer()}).then(function(n){let i=wae.EncryptedDbRootProto.decode(new Uint8Array(n)),r=i.encryptionData,o=r.byteOffset,s=o+r.byteLength,a=e.key=r.buffer.slice(o,s);r=i.dbrootData,o=r.byteOffset,s=o+r.byteLength;let c=r.buffer.slice(o,s);return R2e.scheduleTask({buffer:c,type:"DbRoot",key:a},[c])}).then(function(n){let i=wae.DbRootProto.decode(new Uint8Array(n.buffer));if(e.imageryPresent=i.imageryPresent??e.imageryPresent,e.protoImagery=i.protoImagery,e.terrainPresent=i.terrainPresent??e.terrainPresent,l(i.endSnippet)&&l(i.endSnippet.model)){let a=i.endSnippet.model;e.negativeAltitudeExponentBias=a.negativeAltitudeExponentBias??e.negativeAltitudeExponentBias,e.negativeAltitudeThreshold=a.compressedNegativeAltitudeThreshold??e.negativeAltitudeThreshold}l(i.databaseVersion)&&(e._quadPacketVersion=i.databaseVersion.quadtreeVersion??e._quadPacketVersion);let r=e.providers,o=i.providerInfo??[],s=o.length;for(let a=0;a<s;++a){let c=o[a],u=c.copyrightString;l(u)&&(r[c.providerId]=new It(u.value))}}).catch(function(){console.log(`Failed to retrieve ${t.url}. Using defaults.`),e.key=fjt})}var _y=yd;function zC(e){e=e??H.EMPTY_OBJECT,this._buffer=e.buffer,this._credits=e.credits,this._negativeAltitudeExponentBias=e.negativeAltitudeExponentBias,this._negativeElevationThreshold=e.negativeElevationThreshold;let t=e.childTileMask??15,n=t&3;n|=t&4?8:0,n|=t&8?4:0,this._childTileMask=n,this._createdByUpsampling=e.createdByUpsampling??!1,this._skirtHeight=void 0,this._bufferType=this._buffer.constructor,this._mesh=void 0,this._minimumHeight=void 0,this._maximumHeight=void 0}Object.defineProperties(zC.prototype,{credits:{get:function(){return this._credits}},waterMask:{get:function(){}}});var L2e="createVerticesFromGoogleEarthEnterpriseBuffer",hjt=new $n(L2e),mjt=new $n(L2e,uf.maximumAsynchronousTasks),M2e=new ie,PW=new ie;zC.prototype.createMesh=function(e){e=e??H.EMPTY_OBJECT;let t=e.tilingScheme,n=e.x,i=e.y,r=e.level,o=e.exaggeration??1,s=e.exaggerationRelativeHeight??0,a=e.throttle??!0,c=t.ellipsoid;t.tileXYToNativeRectangle(n,i,r,M2e),t.tileXYToRectangle(n,i,r,PW);let u=c.cartographicToCartesian(ie.center(PW)),d=40075.16/(1<<r);this._skirtHeight=Math.min(d*8,1e3);let g=(a?mjt:hjt).scheduleTask({buffer:this._buffer,nativeRectangle:M2e,rectangle:PW,relativeToCenter:u,ellipsoid:c,skirtHeight:this._skirtHeight,exaggeration:o,exaggerationRelativeHeight:s,includeWebMercatorT:!0,negativeAltitudeExponentBias:this._negativeAltitudeExponentBias,negativeElevationThreshold:this._negativeElevationThreshold});if(!l(g))return;let m=this;return g.then(function(y){return m._mesh=new bc(u,new Float32Array(y.vertices),new Uint16Array(y.indices),y.indexCountWithoutSkirts,y.vertexCountWithoutSkirts,y.minimumHeight,y.maximumHeight,PW,ue.clone(y.boundingSphere3D),h.clone(y.occludeePointInScaledSpace),y.numberOfAttributes,en.clone(y.orientedBoundingBox),Co.clone(y.encoding),y.westIndicesSouthToNorth,y.southIndicesEastToWest,y.eastIndicesNorthToSouth,y.northIndicesWestToEast),m._minimumHeight=y.minimumHeight,m._maximumHeight=y.maximumHeight,m._buffer=void 0,m._mesh})};zC.prototype.interpolateHeight=function(e,t,n){let i=D.clamp((t-e.west)/e.width,0,1),r=D.clamp((n-e.south)/e.height,0,1);return l(this._mesh)?Ajt(this,i,r):Tjt(this,i,r,e)};var pjt=new $n("upsampleQuantizedTerrainMesh",uf.maximumAsynchronousTasks);zC.prototype.upsample=function(e,t,n,i,r,o,s){let a=this._mesh;if(!l(this._mesh))return;let c=t*2!==r,u=n*2===o,f=e.ellipsoid,d=e.tileXYToRectangle(r,o,s),p=pjt.scheduleTask({vertices:a.vertices,indices:a.indices,indexCountWithoutSkirts:a.indexCountWithoutSkirts,vertexCountWithoutSkirts:a.vertexCountWithoutSkirts,encoding:a.encoding,minimumHeight:this._minimumHeight,maximumHeight:this._maximumHeight,isEastChild:c,isNorthChild:u,childRectangle:d,ellipsoid:f});if(!l(p))return;let g=this;return p.then(function(m){let y=new Uint16Array(m.vertices),A=je.createTypedArray(y.length/3,m.indices),b=g._skirtHeight;return new BC({quantizedVertices:y,indices:A,minimumHeight:m.minimumHeight,maximumHeight:m.maximumHeight,boundingSphere:ue.clone(m.boundingSphere),orientedBoundingBox:en.clone(m.orientedBoundingBox),horizonOcclusionPoint:h.clone(m.horizonOcclusionPoint),westIndices:m.westIndices,southIndices:m.southIndices,eastIndices:m.eastIndices,northIndices:m.northIndices,westSkirtHeight:b,southSkirtHeight:b,eastSkirtHeight:b,northSkirtHeight:b,childTileMask:0,createdByUpsampling:!0,credits:g._credits})})};zC.prototype.isChildAvailable=function(e,t,n,i){let r=2;return n!==e*2&&++r,i!==t*2&&(r-=2),(this._childTileMask&1<<r)!==0};zC.prototype.wasCreatedByUpsampling=function(){return this._createdByUpsampling};var gjt=new U,_jt=new U,yjt=new U,F2e=new h;function Ajt(e,t,n){let i=e._mesh,r=i.vertices,o=i.encoding,s=i.indices;for(let a=0,c=s.length;a<c;a+=3){let u=s[a],f=s[a+1],d=s[a+2],p=o.decodeTextureCoordinates(r,u,gjt),g=o.decodeTextureCoordinates(r,f,_jt),m=o.decodeTextureCoordinates(r,d,yjt),y=fp.computeBarycentricCoordinates(t,n,p.x,p.y,g.x,g.y,m.x,m.y,F2e);if(y.x>=-1e-15&&y.y>=-1e-15&&y.z>=-1e-15){let A=o.decodeHeight(r,u),b=o.decodeHeight(r,f),x=o.decodeHeight(r,d);return y.x*A+y.y*b+y.z*x}}}var bjt=Uint16Array.BYTES_PER_ELEMENT,N2e=Uint32Array.BYTES_PER_ELEMENT,Dae=Int32Array.BYTES_PER_ELEMENT,xjt=Float32Array.BYTES_PER_ELEMENT,Rae=Float64Array.BYTES_PER_ELEMENT;function Tjt(e,t,n,i){let r=e._buffer,o=0,s=0,a=0;n>.5?(t>.5?(o=2,s=.5):o=3,a=.5):t>.5&&(o=1,s=.5);let c=new DataView(r),u=0;for(let v=0;v<o;++v)u+=c.getUint32(u,!0),u+=N2e;u+=N2e,u+=2*Rae;let f=D.toRadians(c.getFloat64(u,!0)*180);u+=Rae;let d=D.toRadians(c.getFloat64(u,!0)*180);u+=Rae;let p=i.width/f/2,g=i.height/d/2,m=c.getInt32(u,!0);u+=Dae;let y=c.getInt32(u,!0)*3;u+=Dae,u+=Dae;let A=new Array(m),b=new Array(m),x=new Array(m),T;for(T=0;T<m;++T)A[T]=s+c.getUint8(u++)*p,b[T]=a+c.getUint8(u++)*g,x[T]=c.getFloat32(u,!0)*6371010,u+=xjt;let E=new Array(y);for(T=0;T<y;++T)E[T]=c.getUint16(u,!0),u+=bjt;for(T=0;T<y;T+=3){let v=E[T],S=E[T+1],I=E[T+2],R=A[v],O=A[S],L=A[I],_=b[v],C=b[S],w=b[I],P=fp.computeBarycentricCoordinates(t,n,R,_,O,C,L,w,F2e);if(P.x>=-1e-15&&P.y>=-1e-15&&P.z>=-1e-15)return P.x*x[v]+P.y*x[S]+P.z*x[I]}}var zP=zC;var Rh={UNKNOWN:0,NONE:1,SELF:2,PARENT:3},DW=new K;function RW(){this._terrainCache={},this._lastTidy=K.now()}RW.prototype.add=function(e,t){this._terrainCache[e]={buffer:t,timestamp:K.now()}};RW.prototype.get=function(e){let n=this._terrainCache[e];if(l(n))return delete this._terrainCache[e],n.buffer};RW.prototype.tidy=function(){if(K.now(DW),K.secondsDifference(DW,this._lastTidy)>10){let e=this._terrainCache,t=Object.keys(e),n=t.length;for(let i=0;i<n;++i){let r=t[i],o=e[r];K.secondsDifference(DW,o.timestamp)>10&&delete e[r]}K.clone(DW,this._lastTidy)}};function jb(e){e=e??H.EMPTY_OBJECT,this._tilingScheme=new er({numberOfLevelZeroTilesX:2,numberOfLevelZeroTilesY:2,rectangle:new ie(-D.PI,-D.PI,D.PI,D.PI),ellipsoid:e.ellipsoid});let t=e.credit;typeof t=="string"&&(t=new It(t)),this._credit=t,this._levelZeroMaximumGeometricError=40075.16,this._terrainCache=new RW,this._terrainPromises={},this._terrainRequests={},this._errorEvent=new be}Object.defineProperties(jb.prototype,{url:{get:function(){return this._metadata.url}},proxy:{get:function(){return this._metadata.proxy}},tilingScheme:{get:function(){return this._tilingScheme}},errorEvent:{get:function(){return this._errorEvent}},credit:{get:function(){return this._credit}},hasWaterMask:{get:function(){return!1}},hasVertexNormals:{get:function(){return!1}},availability:{get:function(){}}});jb.fromMetadata=function(e,t){if(!e.terrainPresent)throw new oe(`The server ${e.url} doesn't have terrain`);let n=new jb(t);return n._metadata=e,n};var Ejt=new $n("decodeGoogleEarthEnterprisePacket");function B2e(e,t,n){let i=t.getChildBitmask();if(t.terrainState===Rh.PARENT){i=0;for(let r=0;r<4;++r){let o=n.getTileInformationFromQuadKey(e+r.toString());l(o)&&o.hasTerrain()&&(i|=1<<r)}}return i}jb.prototype.requestTileGeometry=function(e,t,n,i){let r=_y.tileXYToQuadKey(e,t,n),o=this._terrainCache,s=this._metadata,a=s.getTileInformationFromQuadKey(r);if(!l(a))return Promise.reject(new oe("Terrain tile doesn't exist"));let c=a.terrainState;l(c)||(c=a.terrainState=Rh.UNKNOWN);let u=o.get(r);if(l(u)){let b=s.providers[a.terrainProvider];return Promise.resolve(new zP({buffer:u,childTileMask:B2e(r,a,s),credits:l(b)?[b]:void 0,negativeAltitudeExponentBias:s.negativeAltitudeExponentBias,negativeElevationThreshold:s.negativeAltitudeThreshold}))}if(o.tidy(),a.ancestorHasTerrain){if(c===Rh.NONE)return Promise.reject(new oe("Terrain tile doesn't exist"))}else return Promise.resolve(new jc({buffer:new Uint8Array(256),width:16,height:16}));let f,d=r,p=-1;switch(c){case Rh.SELF:p=a.terrainVersion;break;case Rh.PARENT:d=d.substring(0,d.length-1),f=s.getTileInformationFromQuadKey(d),p=f.terrainVersion;break;case Rh.UNKNOWN:a.hasTerrain()?p=a.terrainVersion:(d=d.substring(0,d.length-1),f=s.getTileInformationFromQuadKey(d),l(f)&&f.hasTerrain()&&(p=f.terrainVersion));break}if(p<0)return Promise.reject(new oe("Terrain tile doesn't exist"));let g=this._terrainPromises,m=this._terrainRequests,y,A;if(l(g[d]))y=g[d],A=m[d];else{A=i;let b=Cjt(this,d,p,A).fetchArrayBuffer();if(!l(b))return;y=b.then(function(x){return l(x)?Ejt.scheduleTask({buffer:x,type:"Terrain",key:s.key},[x]).then(function(T){let E=s.getTileInformationFromQuadKey(d);E.terrainState=Rh.SELF,o.add(d,T[0]);let v=E.terrainProvider,S=T.length-1;for(let I=0;I<S;++I){let R=d+I.toString(),O=s.getTileInformationFromQuadKey(R);l(O)&&(o.add(R,T[I+1]),O.terrainState=Rh.PARENT,O.terrainProvider===0&&(O.terrainProvider=v))}}):Promise.reject(new oe("Failed to load terrain."))}),g[d]=y,m[d]=A,y=y.finally(function(){delete g[d],delete m[d]})}return y.then(function(){let b=o.get(r);if(l(b)){let x=s.providers[a.terrainProvider];return new zP({buffer:b,childTileMask:B2e(r,a,s),credits:l(x)?[x]:void 0,negativeAltitudeExponentBias:s.negativeAltitudeExponentBias,negativeElevationThreshold:s.negativeAltitudeThreshold})}return Promise.reject(new oe("Failed to load terrain."))}).catch(function(b){return A.state===Ti.CANCELLED?(i.state=A.state,Promise.reject(b)):(a.terrainState=Rh.NONE,Promise.reject(b))})};jb.prototype.getLevelMaximumGeometricError=function(e){return this._levelZeroMaximumGeometricError/(1<<e)};jb.prototype.getTileDataAvailable=function(e,t,n){let i=this._metadata,r=_y.tileXYToQuadKey(e,t,n),o=i.getTileInformation(e,t,n);if(o===null)return!1;if(l(o)){if(!o.ancestorHasTerrain)return!0;let s=o.terrainState;if(s===Rh.NONE)return!1;if((!l(s)||s===Rh.UNKNOWN)&&(o.terrainState=Rh.UNKNOWN,!o.hasTerrain())){r=r.substring(0,r.length-1);let a=i.getTileInformationFromQuadKey(r);if(!l(a)||!a.hasTerrain())return!1}return!0}if(i.isValid(r)){let s=new wo({throttle:!1,throttleByServer:!0,type:Zs.TERRAIN});i.populateSubtree(e,t,n,s)}return!1};jb.prototype.loadTileDataAvailability=function(e,t,n){};function Cjt(e,t,n,i){return n=l(n)&&n>0?n:1,e._metadata.resource.getDerivedResource({url:`flatfile?f1c-0${t}-t.${n.toString()}`,request:i})}var Oae=jb;var vjt="https://maps.googleapis.com/maps/api/geocode/json",k2e='<img alt="Google" src="https://assets.ion.cesium.com/google-credit.png" style="vertical-align:-5px">';function Mae(e){e=e??H.EMPTY_OBJECT;let t=e.key;this._resource=new De({url:vjt,queryParameters:{key:t}}),this._credit=new It(k2e,!0)}Object.defineProperties(Mae.prototype,{credit:{get:function(){return this._credit}}});Mae.prototype.geocode=async function(e){let n=await this._resource.getDerivedResource({queryParameters:{address:e}}).fetchJson();if(n.status==="ZERO_RESULTS")return[];if(n.status!=="OK")throw new oe(`GoogleGeocoderService got a bad response ${n.status}: ${n.error_message}`);return n.results.map(r=>{let o=r.geometry.viewport.southwest,s=r.geometry.viewport.northeast;return{displayName:r.formatted_address,destination:ie.fromDegrees(o.lng,o.lat,s.lng,s.lat),attribution:{html:k2e,collapsible:!1}}})};var Nae=Mae;var Lae=class{constructor(){ut(this,"type")}getRequiredDataPoints(t){pe.throwInstantiationError()}interpolateOrderZero(t,n,i,r,o){pe.throwInstantiationError()}interpolate(t,n,i,r,o,s,a){pe.throwInstantiationError()}},Fae=Lae;var U2e={GOOGLE:"GOOGLE",BING:"BING",DEFAULT:"DEFAULT"};Object.freeze(U2e);var yy=U2e;function Bae(e){this._url=De.createIfNeeded(e),this._url.appendForwardSlash()}Object.defineProperties(Bae.prototype,{url:{get:function(){return this._url}},credit:{get:function(){}}});Bae.prototype.geocode=async function(e,t){return this._url.getDerivedResource({url:t===Vb.AUTOCOMPLETE?"autocomplete":"search",queryParameters:{text:e}}).fetchJson().then(function(i){return i.features.map(function(r){let o,s=r.bbox;if(l(s))o=ie.fromDegrees(s[0],s[1],s[2],s[3]);else{let a=r.geometry.coordinates[0],c=r.geometry.coordinates[1];o=h.fromDegrees(a,c)}return{displayName:r.properties.label,destination:o,attributions:i.attributions}})})};var k4=Bae;function Sjt(e){if(!Object.values(yy).some(t=>t===e))throw new pe(`Invalid geocodeProviderType: "${e}"`)}var z2e=Object.freeze({[yy.GOOGLE]:"google",[yy.BING]:"bing",[yy.DEFAULT]:void 0});function wjt(e){return z2e[e]}function Ijt(e){return Object.entries(z2e).find(t=>t[1]===e)[0]}function kae(e){e=e??H.EMPTY_OBJECT;let t=e.geocodeProviderType??yy.DEFAULT,n=e.accessToken??ku.defaultAccessToken,i=De.createIfNeeded(e.server??ku.defaultServer);i.appendForwardSlash();let r=ku.getDefaultTokenCredit(n);l(r)&&e.scene.frameState.creditDisplay.addStaticCredit(It.clone(r));let o=i.getDerivedResource({url:"v1/geocode"});l(n)&&o.appendQueryParameters({access_token:n}),this._accessToken=n,this._server=i,this._pelias=new k4(o),this.geocodeProviderType=t}Object.defineProperties(kae.prototype,{credit:{get:function(){}},geocodeProviderType:{get:function(){return Ijt(this._pelias.url.queryParameters.geocoder)},set:function(e){Sjt(e);let t={...this._pelias.url.queryParameters,geocoder:wjt(e)};l(t.geocoder)||delete t.geocoder,this._pelias.url.setQueryParameters(t)}}});kae.prototype.geocode=async function(e,t){return this._pelias.geocode(e,t)};var VC=kae;var V2e={NONE:0,POINT:1,SEGMENT:2,CURVE:3,ARC:4,SURFACE:5};Object.freeze(V2e);var Uae=V2e;var j2e={NONE:0,NOT_IN_RANGE:1,IN_RANGE:2};Object.freeze(j2e);var zae=j2e;var H2e={NEAREST:1,NEAREST_KEYPOINT:2,CENTER:8};Object.freeze(H2e);var U4=H2e;var G2e={NONE:0,WIRE:1,SHEET:2,SOLID:3,MESH:4,TEXT:5};Object.freeze(G2e);var Vae=G2e;function W2e(e){if(!(!l(e)||!l(e.longitude)||!l(e.latitude)))return h.fromDegrees(e.longitude,e.latitude,e.height??0)}function q2e(e){let t=he.fromCartesian(e);return{longitude:D.toDegrees(t.longitude),latitude:D.toDegrees(t.latitude),height:t.height}}function Pjt(e){let t=[],n=new se;for(let i=0;i<4;i++)N.getRow(e,i,n),t.push([n.x,n.y,n.z,n.w]);return t}function Djt(e,t,n){return N.fromRowMajorArray([e/2,0,0,e/2,0,-t/2,0,t/2,0,0,.5,.5,0,0,0,1],n)}var Rjt=new N,Ojt=new N,OW=class e{constructor(t){this._assetId=t.assetId,this._resource=t.resource,this.ecefTransform=t.ecefTransform}get assetId(){return this._assetId}static async fromAssetId(t,n){n=n??H.EMPTY_OBJECT;let i=n.accessToken??ku.defaultAccessToken,r=De.createIfNeeded(n.server??ku.defaultServer);r.appendForwardSlash();let o={url:`assets/${t}/`,headers:Ho._addClientHeaders()};l(i)&&(o.queryParameters={access_token:i});let s=r.getDerivedResource(o),a=await s.getDerivedResource({url:"ecef"}).fetchJson();if(!l(a?.ecefTransform))throw new oe(`Cesium ion asset ${t} is not geolocated; snapping requires geolocation`);let c=N.fromRowMajorArray(a.ecefTransform.flat());return new e({assetId:t,resource:s,ecefTransform:c})}_computeWorldToView(t,n,i,r){r=r??new N;let o=Djt(n,i,Rjt);return N.multiply(t.viewMatrix,this.ecefTransform,r),N.multiply(t.frustum.projectionMatrix,r,r),N.multiply(o,r,r)}async snap(t){let n=this._computeWorldToView(t.camera,t.canvasWidth,t.canvasHeight,Ojt),i={testPoint:q2e(t.testPoint),closePoint:q2e(t.closePoint??t.testPoint),snapAperture:t.snapAperture??e.DEFAULT_SNAP_APERTURE,snapMode:t.snapMode??U4.NEAREST,worldToView:Pjt(n)},r;try{r=await this._resource.getDerivedResource({url:`elements/${t.elementId}/snap`}).post(JSON.stringify(i),{headers:{"Content-Type":"application/json"},responseType:"json"})}catch(s){if(s?.statusCode===404||s?.statusCode===400&&typeof s.response?.message=="string"&&s.response.message.includes("No snap possible"))return;throw s}if(!l(r))return;let o={heat:r.heat,geometryType:r.geomType,parentGeometryType:r.parentGeomType,normal:r.normal,curve:r.curve};return o.snapPoint=W2e(r.snapPoint),o.hitPoint=W2e(r.hitPoint),o}};OW.DEFAULT_SNAP_APERTURE=12;var jae=OW;var la={};la.ExportStatus=Object.freeze({NotStarted:"NotStarted",InProgress:"InProgress",Complete:"Complete",Invalid:"Invalid"});la.ExportType=Object.freeze({IMODEL:"IMODEL",CESIUM:"CESIUM","3DTILES":"3DTILES"});la.RealityDataType=Object.freeze({Cesium3DTiles:"Cesium3DTiles",PNTS:"PNTS",RealityMesh3DTiles:"RealityMesh3DTiles",Terrain3DTiles:"Terrain3DTiles",GaussianSplat3DTiles:"GS_3DT",KML:"KML",GeoJSON:"GeoJSON",Unstructured:"Unstructured"});la.defaultAccessToken=void 0;la.defaultShareKey=void 0;la._getAuthorizationHeader=function(){return l(la.defaultShareKey)?`Basic ${la.defaultShareKey}`:`Bearer ${la.defaultAccessToken}`};la.apiEndpoint=new De({url:"https://api.bentley.com"});la.getExports=async function(e,t){let n=new De({url:`${la.apiEndpoint}mesh-export`,headers:{Authorization:la._getAuthorizationHeader(),Accept:"application/vnd.bentley.itwin-platform.v1+json",Prefer:"return=representation"},queryParameters:{iModelId:e,exportType:la.ExportType["3DTILES"],$top:"5",client:"CesiumJS"}});typeof CESIUM_VERSION<"u"&&n.appendQueryParameters({clientVersion:CESIUM_VERSION}),l(t)&&t!==""&&n.appendQueryParameters({changesetId:t});try{return await n.fetchJson()}catch(i){let r=JSON.parse(i.response);if(i.statusCode===401){let o=r.error.details?.[0].code??"";throw new oe(`Unauthorized, bad token, wrong scopes or headers bad. ${o}`)}else{if(i.statusCode===403)throw console.error(r.error.code,r.error.message),new oe("Not allowed, forbidden");if(i.statusCode===422)throw new oe(`Unprocessable Entity:${r.error.code} ${r.error.message}`);if(i.statusCode===429)throw new oe("Too many requests")}throw new oe(`Unknown request failure ${i.statusCode}`)}};la.getRealityDataMetadata=async function(e,t){let n=new De({url:`${la.apiEndpoint}reality-management/reality-data/${t}`,headers:{Authorization:la._getAuthorizationHeader(),Accept:"application/vnd.bentley.itwin-platform.v1+json"},queryParameters:{iTwinId:e}});try{return(await n.fetchJson()).realityData}catch(i){let r=JSON.parse(i.response);if(i.statusCode===401){let o=r.error.details?.[0].code??"";throw new oe(`Unauthorized, bad token, wrong scopes or headers bad. ${o}`)}else{if(i.statusCode===403)throw console.error(r.error.code,r.error.message),new oe("Not allowed, forbidden");if(i.statusCode===404)throw new oe(`Reality data not found: ${e}, ${t}`);if(i.statusCode===422)throw new oe(`Unprocessable Entity:${r.error.code} ${r.error.message}`);if(i.statusCode===429)throw new oe("Too many requests")}throw new oe(`Unknown request failure ${i.statusCode}`)}};la.getRealityDataURL=async function(e,t,n){let i=new De({url:`${la.apiEndpoint}reality-management/reality-data/${t}/readaccess`,headers:{Authorization:la._getAuthorizationHeader(),Accept:"application/vnd.bentley.itwin-platform.v1+json"},queryParameters:{iTwinId:e}});try{let o=(await i.fetchJson())._links.containerUrl.href,s=new URL(o);return s.pathname=`${s.pathname}/${n}`,s.toString()}catch(r){let o=JSON.parse(r.response);if(r.statusCode===401){let s=o.error.details?.[0].code??"";throw new oe(`Unauthorized, bad token, wrong scopes or headers bad. ${s}`)}else{if(r.statusCode===403)throw console.error(o.error.code,o.error.message),new oe("Not allowed, forbidden");if(r.statusCode===404)throw new oe(`Reality data not found: ${e}, ${t}`);if(r.statusCode===422)throw new oe(`Unprocessable Entity:${o.error.code} ${o.error.message}`);if(r.statusCode===429)throw new oe("Too many requests")}throw new oe(`Unknown request failure ${r.statusCode}`)}};var ua=la;var Hae=class{constructor(){ut(this,"ellipsoid")}project(t,n){pe.throwInstantiationError()}unproject(t,n){pe.throwInstantiationError()}},Gae=Hae;function VP(e){e=e??H.EMPTY_OBJECT;let t=e.weights,n=e.times;this._times=n,this._weights=t,this._count=t.length/n.length,this._lastTimeIndex=0}Object.defineProperties(VP.prototype,{times:{get:function(){return this._times}},weights:{get:function(){return this._weights}}});VP.prototype.findTimeInterval=Dr.prototype.findTimeInterval;VP.prototype.wrapTime=Dr.prototype.wrapTime;VP.prototype.clampTime=Dr.prototype.clampTime;VP.prototype.evaluate=function(e,t){let n=this.weights,i=this.times,r=this._lastTimeIndex=this.findTimeInterval(e,this._lastTimeIndex),o=(e-i[r])/(i[r+1]-i[r]);l(t)||(t=new Array(this._count));for(let s=0;s<this._count;s++){let a=r*this._count+s;t[s]=n[a]*(1-o)+n[a+this._count]*o}return t};var Wae=VP;function qae(e,t,n){e=De.createIfNeeded(e),e.appendForwardSlash(),e.setQueryParameters({key:t}),this._url=e,this._params=n??{},this._credit=new It('Geodata copyright <a href="https://www.openstreetmap.org/">OpenStreetMap</a> contributors',!1)}Object.defineProperties(qae.prototype,{url:{get:function(){return this._url}},params:{get:function(){return this._params}},credit:{get:function(){return this._credit}}});qae.prototype.geocode=async function(e){return this._url.getDerivedResource({url:"json",queryParameters:Ot(this._params,{q:e})}).fetchJson().then(function(n){return n.results.map(function(i){let r,o=i.bounds;if(l(o))r=ie.fromDegrees(o.southwest.lng,o.southwest.lat,o.northeast.lng,o.northeast.lat);else{let{lng:s,lat:a}=i.geometry;r=h.fromDegrees(s,a)}return{displayName:i.formatted,destination:r}})})};var Yae=qae;var Mjt={packedLength:void 0,pack:pe.throwInstantiationError,unpack:pe.throwInstantiationError},Xae=Mjt;var Njt={packedInterpolationLength:void 0,convertPackedArrayForInterpolation:pe.throwInstantiationError,unpackInterpolationResult:pe.throwInstantiationError},Kae=Njt;var Ljt=new h;function Fjt(e,t,n,i){let r=dx(e,t,n,i,Ljt);return l(r)?r.x>0&&r.y>0&&r.z>0:!1}var $ae=Fjt;function Y2e(){pe.throwInstantiationError()}Y2e.prototype.getURL=pe.throwInstantiationError;var Jae=Y2e;function Bjt(e,t,n,i,r,o,s){let a=ir.numberOfPoints(e,t,r),c,u=n.red,f=n.green,d=n.blue,p=n.alpha,g=i.red,m=i.green,y=i.blue,A=i.alpha;if(z.equals(n,i)){for(c=0;c<a;c++)o[s++]=z.floatToByte(u),o[s++]=z.floatToByte(f),o[s++]=z.floatToByte(d),o[s++]=z.floatToByte(p);return s}let b=(g-u)/a,x=(m-f)/a,T=(y-d)/a,E=(A-p)/a,v=s;for(c=0;c<a;c++)o[v++]=z.floatToByte(u+c*b),o[v++]=z.floatToByte(f+c*x),o[v++]=z.floatToByte(d+c*T),o[v++]=z.floatToByte(p+c*E);return v}function z4(e){e=e??H.EMPTY_OBJECT;let t=e.positions,n=e.colors,i=e.colorsPerVertex??!1;this._positions=t,this._colors=n,this._colorsPerVertex=i,this._arcType=e.arcType??ln.GEODESIC,this._granularity=e.granularity??D.RADIANS_PER_DEGREE,this._ellipsoid=e.ellipsoid??ee.default,this._workerName="createSimplePolylineGeometry";let r=1+t.length*h.packedLength;r+=l(n)?1+n.length*z.packedLength:1,this.packedLength=r+ee.packedLength+3}z4.pack=function(e,t,n){n=n??0;let i,r=e._positions,o=r.length;for(t[n++]=o,i=0;i<o;++i,n+=h.packedLength)h.pack(r[i],t,n);let s=e._colors;for(o=l(s)?s.length:0,t[n++]=o,i=0;i<o;++i,n+=z.packedLength)z.pack(s[i],t,n);return ee.pack(e._ellipsoid,t,n),n+=ee.packedLength,t[n++]=e._colorsPerVertex?1:0,t[n++]=e._arcType,t[n]=e._granularity,t};z4.unpack=function(e,t,n){t=t??0;let i,r=e[t++],o=new Array(r);for(i=0;i<r;++i,t+=h.packedLength)o[i]=h.unpack(e,t);r=e[t++];let s=r>0?new Array(r):void 0;for(i=0;i<r;++i,t+=z.packedLength)s[i]=z.unpack(e,t);let a=ee.unpack(e,t);t+=ee.packedLength;let c=e[t++]===1,u=e[t++],f=e[t];return l(n)?(n._positions=o,n._colors=s,n._ellipsoid=a,n._colorsPerVertex=c,n._arcType=u,n._granularity=f,n):new z4({positions:o,colors:s,ellipsoid:a,colorsPerVertex:c,arcType:u,granularity:f})};var MW=new Array(2),NW=new Array(2),kjt={positions:MW,height:NW,ellipsoid:void 0,minDistance:void 0,granularity:void 0};z4.createGeometry=function(e){let t=e._positions,n=e._colors,i=e._colorsPerVertex,r=e._arcType,o=e._granularity,s=e._ellipsoid,a=D.chordLength(o,s.maximumRadius),c=l(n)&&!i,u,f=t.length,d,p,g,m,y=0;if(r===ln.GEODESIC||r===ln.RHUMB){let E,v,S;r===ln.GEODESIC?(E=D.chordLength(o,s.maximumRadius),v=ir.numberOfPoints,S=ir.generateArc):(E=o,v=ir.numberOfPointsRhumbLine,S=ir.generateRhumbArc);let I=ir.extractHeights(t,s),R=kjt;if(r===ln.GEODESIC?R.minDistance=a:R.granularity=o,R.ellipsoid=s,c){let O=0;for(u=0;u<f-1;u++)O+=v(t[u],t[u+1],E)+1;d=new Float64Array(O*3),g=new Uint8Array(O*4),R.positions=MW,R.height=NW;let L=0;for(u=0;u<f-1;++u){MW[0]=t[u],MW[1]=t[u+1],NW[0]=I[u],NW[1]=I[u+1];let _=S(R);if(l(n)){let C=_.length/3;m=n[u];for(let w=0;w<C;++w)g[L++]=z.floatToByte(m.red),g[L++]=z.floatToByte(m.green),g[L++]=z.floatToByte(m.blue),g[L++]=z.floatToByte(m.alpha)}d.set(_,y),y+=_.length}}else if(R.positions=t,R.height=I,d=new Float64Array(S(R)),l(n)){for(g=new Uint8Array(d.length/3*4),u=0;u<f-1;++u){let L=t[u],_=t[u+1],C=n[u],w=n[u+1];y=Bjt(L,_,C,w,a,g,y)}let O=n[f-1];g[y++]=z.floatToByte(O.red),g[y++]=z.floatToByte(O.green),g[y++]=z.floatToByte(O.blue),g[y]=z.floatToByte(O.alpha)}}else{p=c?f*2-2:f,d=new Float64Array(p*3),g=l(n)?new Uint8Array(p*4):void 0;let E=0,v=0;for(u=0;u<f;++u){let S=t[u];if(c&&u>0&&(h.pack(S,d,E),E+=3,m=n[u-1],g[v++]=z.floatToByte(m.red),g[v++]=z.floatToByte(m.green),g[v++]=z.floatToByte(m.blue),g[v++]=z.floatToByte(m.alpha)),c&&u===f-1)break;h.pack(S,d,E),E+=3,l(n)&&(m=n[u],g[v++]=z.floatToByte(m.red),g[v++]=z.floatToByte(m.green),g[v++]=z.floatToByte(m.blue),g[v++]=z.floatToByte(m.alpha))}}let A=new Tn;A.position=new Ne({componentDatatype:Y.DOUBLE,componentsPerAttribute:3,values:d}),l(n)&&(A.color=new Ne({componentDatatype:Y.UNSIGNED_BYTE,componentsPerAttribute:4,values:g,normalize:!0})),p=d.length/3;let b=(p-1)*2,x=je.createTypedArray(p,b),T=0;for(u=0;u<p-1;++u)x[T++]=u,x[T++]=u+1;return new St({attributes:A,indices:x,primitiveType:Oe.LINES,boundingSphere:ue.fromPoints(t)})};var Zae=z4;var LW=class{constructor(){pe.throwInstantiationError()}async snap(t){pe.throwInstantiationError()}};LW.DEFAULT_SNAP_APERTURE=void 0;var Qae=LW;function jP(e){let t=e.radius??1,i={radii:new h(t,t,t),stackPartitions:e.stackPartitions,slicePartitions:e.slicePartitions,vertexFormat:e.vertexFormat};this._ellipsoidGeometry=new Xa(i),this._workerName="createSphereGeometry"}jP.packedLength=Xa.packedLength;jP.pack=function(e,t,n){return Xa.pack(e._ellipsoidGeometry,t,n)};var Ujt=new Xa,Hb={radius:void 0,radii:new h,vertexFormat:new Be,stackPartitions:void 0,slicePartitions:void 0};jP.unpack=function(e,t,n){let i=Xa.unpack(e,t,Ujt);return Hb.vertexFormat=Be.clone(i._vertexFormat,Hb.vertexFormat),Hb.stackPartitions=i._stackPartitions,Hb.slicePartitions=i._slicePartitions,l(n)?(h.clone(i._radii,Hb.radii),n._ellipsoidGeometry=new Xa(Hb),n):(Hb.radius=i._radii.x,new jP(Hb))};jP.createGeometry=function(e){return Xa.createGeometry(e._ellipsoidGeometry)};var V4=jP;function zjt(e){return e<=.04045?e*.07739938080495357:Math.pow((e+.055)*.9478672985781991,2.4)}var jC=zjt;var ece=class{constructor(t){ut(this,"ellipsoid");ut(this,"rectangle");ut(this,"projection")}getNumberOfXTilesAtLevel(t){pe.throwInstantiationError()}getNumberOfYTilesAtLevel(t){pe.throwInstantiationError()}rectangleToNativeRectangle(t,n){pe.throwInstantiationError()}tileXYToNativeRectangle(t,n,i,r){pe.throwInstantiationError()}tileXYToRectangle(t,n,i,r){pe.throwInstantiationError()}positionToTileXY(t,n,i){pe.throwInstantiationError()}},tce=ece;function HC(e){e=e??H.EMPTY_OBJECT,this._clock=void 0,this._element=void 0,this._clockSubscription=void 0,this._seekFunction=void 0,this._lastPlaybackRate=void 0,this.clock=e.clock,this.element=e.element,this.epoch=e.epoch??nt.MINIMUM_VALUE,this.tolerance=e.tolerance??1,this._seeking=!1,this._seekFunction=void 0,this._firstTickAfterSeek=!1}Object.defineProperties(HC.prototype,{clock:{get:function(){return this._clock},set:function(e){let t=this._clock;t!==e&&(l(t)&&(this._clockSubscription(),this._clockSubscription=void 0),l(e)&&(this._clockSubscription=e.onTick.addEventListener(HC.prototype._onTick,this)),this._clock=e)}},element:{get:function(){return this._element},set:function(e){let t=this._element;t!==e&&(l(t)&&t.removeEventListener("seeked",this._seekFunction,!1),l(e)&&(this._seeking=!1,this._seekFunction=Vjt(this),e.addEventListener("seeked",this._seekFunction,!1)),this._element=e,this._seeking=!1,this._firstTickAfterSeek=!1)}}});HC.prototype.destroy=function(){return this.element=void 0,this.clock=void 0,le(this)};HC.prototype.isDestroyed=function(){return!1};HC.prototype._trySetPlaybackRate=function(e){if(this._lastPlaybackRate===e.multiplier)return;let t=this._element;try{t.playbackRate=e.multiplier}catch{t.playbackRate=0}this._lastPlaybackRate=e.multiplier};HC.prototype._onTick=function(e){let t=this._element;if(!l(t)||t.readyState<2)return;let n=t.paused,i=e.shouldAnimate;if(i===n&&(i?t.play():t.pause()),this._seeking||this._firstTickAfterSeek){this._firstTickAfterSeek=!1;return}this._trySetPlaybackRate(e);let r=e.currentTime,o=this.epoch??nt.MINIMUM_VALUE,s=K.secondsDifference(r,o),a=t.duration,c,u=t.currentTime;t.loop?(s=s%a,s<0&&(s=a-s),c=s):s>a?c=a:s<0?c=0:c=s;let f=i?this.tolerance??1:.001;Math.abs(c-u)>f&&(this._seeking=!0,t.currentTime=c)};function Vjt(e){return function(){e._seeking=!1,e._firstTickAfterSeek=!0}}var nce=HC;function jjt(e,t){this.rectangle=e,this.maxLevel=t}function X2e(e){this.ellipsoid=e.ellipsoid??ee.default,this.tilingScheme=void 0,this.heightmapWidth=void 0,this.heightmapHeight=void 0,this.levelZeroMaximumGeometricError=void 0,this.rectangles=[]}X2e.prototype.build=function(e){e._tilingScheme=this.tilingScheme,e._heightmapWidth=this.heightmapWidth,e._heightmapHeight=this.heightmapHeight,e._levelZeroMaximumGeometricError=this.levelZeroMaximumGeometricError,e._rectangles=this.rectangles};function Hjt(e,t){let n=t.getElementsByTagName("SRS")[0].textContent;if(n==="EPSG:4326")e.tilingScheme=new er({ellipsoid:e.ellipsoid});else throw new oe(`SRS ${n} is not supported`);let i=t.getElementsByTagName("TileFormat")[0];e.heightmapWidth=parseInt(i.getAttribute("width"),10),e.heightmapHeight=parseInt(i.getAttribute("height"),10),e.levelZeroMaximumGeometricError=Xr.getEstimatedLevelZeroGeometricErrorForAHeightmap(e.ellipsoid,Math.min(e.heightmapWidth,e.heightmapHeight),e.tilingScheme.getNumberOfXTilesAtLevel(0));let r=t.getElementsByTagName("DataExtent");for(let o=0;o<r.length;++o){let s=r[o],a=D.toRadians(parseFloat(s.getAttribute("minx"))),c=D.toRadians(parseFloat(s.getAttribute("miny"))),u=D.toRadians(parseFloat(s.getAttribute("maxx"))),f=D.toRadians(parseFloat(s.getAttribute("maxy"))),d=parseInt(s.getAttribute("maxlevel"),10);e.rectangles.push(new jjt(new ie(a,c,u,f),d))}}function Gjt(e,t,n){let i=`An error occurred while accessing ${e.url}`;throw l(t)&&l(t.message)&&(i=`${i}: ${t.message}`),Zr.reportError(void 0,n,l(n)?n._errorEvent:void 0,i),new oe(i)}async function Wjt(e,t,n){try{let i=await t.fetchXML();Hjt(e,i)}catch(i){Gjt(t,i,n)}}function Gb(e){e=e??H.EMPTY_OBJECT,this._errorEvent=new be,this._terrainDataStructure={heightScale:1/1e3,heightOffset:-1e3,elementsPerHeight:3,stride:4,elementMultiplier:256,isBigEndian:!0,lowestEncodedHeight:0,highestEncodedHeight:256*256*256-1};let t=e.credit;typeof t=="string"&&(t=new It(t)),this._credit=t,this._tilingScheme=void 0,this._rectangles=[]}Object.defineProperties(Gb.prototype,{errorEvent:{get:function(){return this._errorEvent}},credit:{get:function(){return this._credit}},tilingScheme:{get:function(){return this._tilingScheme}},hasWaterMask:{get:function(){return!1}},hasVertexNormals:{get:function(){return!1}},availability:{get:function(){}}});Gb.fromUrl=async function(e,t){t=t??H.EMPTY_OBJECT;let n=new X2e(t),i=De.createIfNeeded(e);await Wjt(n,i);let r=new Gb(t);return n.build(r),r._resource=i,r};Gb.prototype.requestTileGeometry=function(e,t,n,i){let r=this._tilingScheme.getNumberOfYTilesAtLevel(n),s=this._resource.getDerivedResource({url:`${n}/${e}/${r-t-1}.tif`,queryParameters:{cesium:!0},request:i}).fetchImage({preferImageBitmap:!0});if(!l(s))return;let a=this;return Promise.resolve(s).then(function(c){return new jc({buffer:kh(c),width:a._heightmapWidth,height:a._heightmapHeight,childTileMask:qjt(a,e,t,n),structure:a._terrainDataStructure})})};Gb.prototype.getLevelMaximumGeometricError=function(e){return this._levelZeroMaximumGeometricError/(1<<e)};var K2e=new ie;function qjt(e,t,n,i){let r=e._tilingScheme,o=e._rectangles,s=r.tileXYToRectangle(t,n,i),a=0;for(let c=0;c<o.length&&a!==15;++c){let u=o[c];if(u.maxLevel<=i)continue;let f=u.rectangle,d=ie.intersection(f,s,K2e);l(d)&&(FW(r,f,t*2,n*2,i+1)&&(a|=4),FW(r,f,t*2+1,n*2,i+1)&&(a|=8),FW(r,f,t*2,n*2+1,i+1)&&(a|=1),FW(r,f,t*2+1,n*2+1,i+1)&&(a|=2))}return a}function FW(e,t,n,i,r){let o=e.tileXYToRectangle(n,i,r);return l(ie.intersection(o,t,K2e))}Gb.prototype.getTileDataAvailable=function(e,t,n){};Gb.prototype.loadTileDataAvailability=function(e,t,n){};var ice=Gb;var $2e={VK_FORMAT_UNDEFINED:0,VK_FORMAT_R4G4_UNORM_PACK8:1,VK_FORMAT_R4G4B4A4_UNORM_PACK16:2,VK_FORMAT_B4G4R4A4_UNORM_PACK16:3,VK_FORMAT_R5G6B5_UNORM_PACK16:4,VK_FORMAT_B5G6R5_UNORM_PACK16:5,VK_FORMAT_R5G5B5A1_UNORM_PACK16:6,VK_FORMAT_B5G5R5A1_UNORM_PACK16:7,VK_FORMAT_A1R5G5B5_UNORM_PACK16:8,VK_FORMAT_R8_UNORM:9,VK_FORMAT_R8_SNORM:10,VK_FORMAT_R8_USCALED:11,VK_FORMAT_R8_SSCALED:12,VK_FORMAT_R8_UINT:13,VK_FORMAT_R8_SINT:14,VK_FORMAT_R8_SRGB:15,VK_FORMAT_R8G8_UNORM:16,VK_FORMAT_R8G8_SNORM:17,VK_FORMAT_R8G8_USCALED:18,VK_FORMAT_R8G8_SSCALED:19,VK_FORMAT_R8G8_UINT:20,VK_FORMAT_R8G8_SINT:21,VK_FORMAT_R8G8_SRGB:22,VK_FORMAT_R8G8B8_UNORM:23,VK_FORMAT_R8G8B8_SNORM:24,VK_FORMAT_R8G8B8_USCALED:25,VK_FORMAT_R8G8B8_SSCALED:26,VK_FORMAT_R8G8B8_UINT:27,VK_FORMAT_R8G8B8_SINT:28,VK_FORMAT_R8G8B8_SRGB:29,VK_FORMAT_B8G8R8_UNORM:30,VK_FORMAT_B8G8R8_SNORM:31,VK_FORMAT_B8G8R8_USCALED:32,VK_FORMAT_B8G8R8_SSCALED:33,VK_FORMAT_B8G8R8_UINT:34,VK_FORMAT_B8G8R8_SINT:35,VK_FORMAT_B8G8R8_SRGB:36,VK_FORMAT_R8G8B8A8_UNORM:37,VK_FORMAT_R8G8B8A8_SNORM:38,VK_FORMAT_R8G8B8A8_USCALED:39,VK_FORMAT_R8G8B8A8_SSCALED:40,VK_FORMAT_R8G8B8A8_UINT:41,VK_FORMAT_R8G8B8A8_SINT:42,VK_FORMAT_R8G8B8A8_SRGB:43,VK_FORMAT_B8G8R8A8_UNORM:44,VK_FORMAT_B8G8R8A8_SNORM:45,VK_FORMAT_B8G8R8A8_USCALED:46,VK_FORMAT_B8G8R8A8_SSCALED:47,VK_FORMAT_B8G8R8A8_UINT:48,VK_FORMAT_B8G8R8A8_SINT:49,VK_FORMAT_B8G8R8A8_SRGB:50,VK_FORMAT_A8B8G8R8_UNORM_PACK32:51,VK_FORMAT_A8B8G8R8_SNORM_PACK32:52,VK_FORMAT_A8B8G8R8_USCALED_PACK32:53,VK_FORMAT_A8B8G8R8_SSCALED_PACK32:54,VK_FORMAT_A8B8G8R8_UINT_PACK32:55,VK_FORMAT_A8B8G8R8_SINT_PACK32:56,VK_FORMAT_A8B8G8R8_SRGB_PACK32:57,VK_FORMAT_A2R10G10B10_UNORM_PACK32:58,VK_FORMAT_A2R10G10B10_SNORM_PACK32:59,VK_FORMAT_A2R10G10B10_USCALED_PACK32:60,VK_FORMAT_A2R10G10B10_SSCALED_PACK32:61,VK_FORMAT_A2R10G10B10_UINT_PACK32:62,VK_FORMAT_A2R10G10B10_SINT_PACK32:63,VK_FORMAT_A2B10G10R10_UNORM_PACK32:64,VK_FORMAT_A2B10G10R10_SNORM_PACK32:65,VK_FORMAT_A2B10G10R10_USCALED_PACK32:66,VK_FORMAT_A2B10G10R10_SSCALED_PACK32:67,VK_FORMAT_A2B10G10R10_UINT_PACK32:68,VK_FORMAT_A2B10G10R10_SINT_PACK32:69,VK_FORMAT_R16_UNORM:70,VK_FORMAT_R16_SNORM:71,VK_FORMAT_R16_USCALED:72,VK_FORMAT_R16_SSCALED:73,VK_FORMAT_R16_UINT:74,VK_FORMAT_R16_SINT:75,VK_FORMAT_R16_SFLOAT:76,VK_FORMAT_R16G16_UNORM:77,VK_FORMAT_R16G16_SNORM:78,VK_FORMAT_R16G16_USCALED:79,VK_FORMAT_R16G16_SSCALED:80,VK_FORMAT_R16G16_UINT:81,VK_FORMAT_R16G16_SINT:82,VK_FORMAT_R16G16_SFLOAT:83,VK_FORMAT_R16G16B16_UNORM:84,VK_FORMAT_R16G16B16_SNORM:85,VK_FORMAT_R16G16B16_USCALED:86,VK_FORMAT_R16G16B16_SSCALED:87,VK_FORMAT_R16G16B16_UINT:88,VK_FORMAT_R16G16B16_SINT:89,VK_FORMAT_R16G16B16_SFLOAT:90,VK_FORMAT_R16G16B16A16_UNORM:91,VK_FORMAT_R16G16B16A16_SNORM:92,VK_FORMAT_R16G16B16A16_USCALED:93,VK_FORMAT_R16G16B16A16_SSCALED:94,VK_FORMAT_R16G16B16A16_UINT:95,VK_FORMAT_R16G16B16A16_SINT:96,VK_FORMAT_R16G16B16A16_SFLOAT:97,VK_FORMAT_R32_UINT:98,VK_FORMAT_R32_SINT:99,VK_FORMAT_R32_SFLOAT:100,VK_FORMAT_R32G32_UINT:101,VK_FORMAT_R32G32_SINT:102,VK_FORMAT_R32G32_SFLOAT:103,VK_FORMAT_R32G32B32_UINT:104,VK_FORMAT_R32G32B32_SINT:105,VK_FORMAT_R32G32B32_SFLOAT:106,VK_FORMAT_R32G32B32A32_UINT:107,VK_FORMAT_R32G32B32A32_SINT:108,VK_FORMAT_R32G32B32A32_SFLOAT:109,VK_FORMAT_R64_UINT:110,VK_FORMAT_R64_SINT:111,VK_FORMAT_R64_SFLOAT:112,VK_FORMAT_R64G64_UINT:113,VK_FORMAT_R64G64_SINT:114,VK_FORMAT_R64G64_SFLOAT:115,VK_FORMAT_R64G64B64_UINT:116,VK_FORMAT_R64G64B64_SINT:117,VK_FORMAT_R64G64B64_SFLOAT:118,VK_FORMAT_R64G64B64A64_UINT:119,VK_FORMAT_R64G64B64A64_SINT:120,VK_FORMAT_R64G64B64A64_SFLOAT:121,VK_FORMAT_B10G11R11_UFLOAT_PACK32:122,VK_FORMAT_E5B9G9R9_UFLOAT_PACK32:123,VK_FORMAT_D16_UNORM:124,VK_FORMAT_X8_D24_UNORM_PACK32:125,VK_FORMAT_D32_SFLOAT:126,VK_FORMAT_S8_UINT:127,VK_FORMAT_D16_UNORM_S8_UINT:128,VK_FORMAT_D24_UNORM_S8_UINT:129,VK_FORMAT_D32_SFLOAT_S8_UINT:130,VK_FORMAT_BC1_RGB_UNORM_BLOCK:131,VK_FORMAT_BC1_RGB_SRGB_BLOCK:132,VK_FORMAT_BC1_RGBA_UNORM_BLOCK:133,VK_FORMAT_BC1_RGBA_SRGB_BLOCK:134,VK_FORMAT_BC2_UNORM_BLOCK:135,VK_FORMAT_BC2_SRGB_BLOCK:136,VK_FORMAT_BC3_UNORM_BLOCK:137,VK_FORMAT_BC3_SRGB_BLOCK:138,VK_FORMAT_BC4_UNORM_BLOCK:139,VK_FORMAT_BC4_SNORM_BLOCK:140,VK_FORMAT_BC5_UNORM_BLOCK:141,VK_FORMAT_BC5_SNORM_BLOCK:142,VK_FORMAT_BC6H_UFLOAT_BLOCK:143,VK_FORMAT_BC6H_SFLOAT_BLOCK:144,VK_FORMAT_BC7_UNORM_BLOCK:145,VK_FORMAT_BC7_SRGB_BLOCK:146,VK_FORMAT_ETC2_R8G8B8_UNORM_BLOCK:147,VK_FORMAT_ETC2_R8G8B8_SRGB_BLOCK:148,VK_FORMAT_ETC2_R8G8B8A1_UNORM_BLOCK:149,VK_FORMAT_ETC2_R8G8B8A1_SRGB_BLOCK:150,VK_FORMAT_ETC2_R8G8B8A8_UNORM_BLOCK:151,VK_FORMAT_ETC2_R8G8B8A8_SRGB_BLOCK:152,VK_FORMAT_EAC_R11_UNORM_BLOCK:153,VK_FORMAT_EAC_R11_SNORM_BLOCK:154,VK_FORMAT_EAC_R11G11_UNORM_BLOCK:155,VK_FORMAT_EAC_R11G11_SNORM_BLOCK:156,VK_FORMAT_ASTC_4x4_UNORM_BLOCK:157,VK_FORMAT_ASTC_4x4_SRGB_BLOCK:158,VK_FORMAT_ASTC_5x4_UNORM_BLOCK:159,VK_FORMAT_ASTC_5x4_SRGB_BLOCK:160,VK_FORMAT_ASTC_5x5_UNORM_BLOCK:161,VK_FORMAT_ASTC_5x5_SRGB_BLOCK:162,VK_FORMAT_ASTC_6x5_UNORM_BLOCK:163,VK_FORMAT_ASTC_6x5_SRGB_BLOCK:164,VK_FORMAT_ASTC_6x6_UNORM_BLOCK:165,VK_FORMAT_ASTC_6x6_SRGB_BLOCK:166,VK_FORMAT_ASTC_8x5_UNORM_BLOCK:167,VK_FORMAT_ASTC_8x5_SRGB_BLOCK:168,VK_FORMAT_ASTC_8x6_UNORM_BLOCK:169,VK_FORMAT_ASTC_8x6_SRGB_BLOCK:170,VK_FORMAT_ASTC_8x8_UNORM_BLOCK:171,VK_FORMAT_ASTC_8x8_SRGB_BLOCK:172,VK_FORMAT_ASTC_10x5_UNORM_BLOCK:173,VK_FORMAT_ASTC_10x5_SRGB_BLOCK:174,VK_FORMAT_ASTC_10x6_UNORM_BLOCK:175,VK_FORMAT_ASTC_10x6_SRGB_BLOCK:176,VK_FORMAT_ASTC_10x8_UNORM_BLOCK:177,VK_FORMAT_ASTC_10x8_SRGB_BLOCK:178,VK_FORMAT_ASTC_10x10_UNORM_BLOCK:179,VK_FORMAT_ASTC_10x10_SRGB_BLOCK:180,VK_FORMAT_ASTC_12x10_UNORM_BLOCK:181,VK_FORMAT_ASTC_12x10_SRGB_BLOCK:182,VK_FORMAT_ASTC_12x12_UNORM_BLOCK:183,VK_FORMAT_ASTC_12x12_SRGB_BLOCK:184,VK_FORMAT_G8B8G8R8_422_UNORM:1000156e3,VK_FORMAT_B8G8R8G8_422_UNORM:1000156001,VK_FORMAT_G8_B8_R8_3PLANE_420_UNORM:1000156002,VK_FORMAT_G8_B8R8_2PLANE_420_UNORM:1000156003,VK_FORMAT_G8_B8_R8_3PLANE_422_UNORM:1000156004,VK_FORMAT_G8_B8R8_2PLANE_422_UNORM:1000156005,VK_FORMAT_G8_B8_R8_3PLANE_444_UNORM:1000156006,VK_FORMAT_R10X6_UNORM_PACK16:1000156007,VK_FORMAT_R10X6G10X6_UNORM_2PACK16:1000156008,VK_FORMAT_R10X6G10X6B10X6A10X6_UNORM_4PACK16:1000156009,VK_FORMAT_G10X6B10X6G10X6R10X6_422_UNORM_4PACK16:1000156010,VK_FORMAT_B10X6G10X6R10X6G10X6_422_UNORM_4PACK16:1000156011,VK_FORMAT_G10X6_B10X6_R10X6_3PLANE_420_UNORM_3PACK16:1000156012,VK_FORMAT_G10X6_B10X6R10X6_2PLANE_420_UNORM_3PACK16:1000156013,VK_FORMAT_G10X6_B10X6_R10X6_3PLANE_422_UNORM_3PACK16:1000156014,VK_FORMAT_G10X6_B10X6R10X6_2PLANE_422_UNORM_3PACK16:1000156015,VK_FORMAT_G10X6_B10X6_R10X6_3PLANE_444_UNORM_3PACK16:1000156016,VK_FORMAT_R12X4_UNORM_PACK16:1000156017,VK_FORMAT_R12X4G12X4_UNORM_2PACK16:1000156018,VK_FORMAT_R12X4G12X4B12X4A12X4_UNORM_4PACK16:1000156019,VK_FORMAT_G12X4B12X4G12X4R12X4_422_UNORM_4PACK16:1000156020,VK_FORMAT_B12X4G12X4R12X4G12X4_422_UNORM_4PACK16:1000156021,VK_FORMAT_G12X4_B12X4_R12X4_3PLANE_420_UNORM_3PACK16:1000156022,VK_FORMAT_G12X4_B12X4R12X4_2PLANE_420_UNORM_3PACK16:1000156023,VK_FORMAT_G12X4_B12X4_R12X4_3PLANE_422_UNORM_3PACK16:1000156024,VK_FORMAT_G12X4_B12X4R12X4_2PLANE_422_UNORM_3PACK16:1000156025,VK_FORMAT_G12X4_B12X4_R12X4_3PLANE_444_UNORM_3PACK16:1000156026,VK_FORMAT_G16B16G16R16_422_UNORM:1000156027,VK_FORMAT_B16G16R16G16_422_UNORM:1000156028,VK_FORMAT_G16_B16_R16_3PLANE_420_UNORM:1000156029,VK_FORMAT_G16_B16R16_2PLANE_420_UNORM:1000156030,VK_FORMAT_G16_B16_R16_3PLANE_422_UNORM:1000156031,VK_FORMAT_G16_B16R16_2PLANE_422_UNORM:1000156032,VK_FORMAT_G16_B16_R16_3PLANE_444_UNORM:1000156033,VK_FORMAT_PVRTC1_2BPP_UNORM_BLOCK_IMG:1000054e3,VK_FORMAT_PVRTC1_4BPP_UNORM_BLOCK_IMG:1000054001,VK_FORMAT_PVRTC2_2BPP_UNORM_BLOCK_IMG:1000054002,VK_FORMAT_PVRTC2_4BPP_UNORM_BLOCK_IMG:1000054003,VK_FORMAT_PVRTC1_2BPP_SRGB_BLOCK_IMG:1000054004,VK_FORMAT_PVRTC1_4BPP_SRGB_BLOCK_IMG:1000054005,VK_FORMAT_PVRTC2_2BPP_SRGB_BLOCK_IMG:1000054006,VK_FORMAT_PVRTC2_4BPP_SRGB_BLOCK_IMG:1000054007,VK_FORMAT_ASTC_4x4_SFLOAT_BLOCK_EXT:1000066e3,VK_FORMAT_ASTC_5x4_SFLOAT_BLOCK_EXT:1000066001,VK_FORMAT_ASTC_5x5_SFLOAT_BLOCK_EXT:1000066002,VK_FORMAT_ASTC_6x5_SFLOAT_BLOCK_EXT:1000066003,VK_FORMAT_ASTC_6x6_SFLOAT_BLOCK_EXT:1000066004,VK_FORMAT_ASTC_8x5_SFLOAT_BLOCK_EXT:1000066005,VK_FORMAT_ASTC_8x6_SFLOAT_BLOCK_EXT:1000066006,VK_FORMAT_ASTC_8x8_SFLOAT_BLOCK_EXT:1000066007,VK_FORMAT_ASTC_10x5_SFLOAT_BLOCK_EXT:1000066008,VK_FORMAT_ASTC_10x6_SFLOAT_BLOCK_EXT:1000066009,VK_FORMAT_ASTC_10x8_SFLOAT_BLOCK_EXT:1000066010,VK_FORMAT_ASTC_10x10_SFLOAT_BLOCK_EXT:1000066011,VK_FORMAT_ASTC_12x10_SFLOAT_BLOCK_EXT:1000066012,VK_FORMAT_ASTC_12x12_SFLOAT_BLOCK_EXT:1000066013,VK_FORMAT_G8B8G8R8_422_UNORM_KHR:1000156e3,VK_FORMAT_B8G8R8G8_422_UNORM_KHR:1000156001,VK_FORMAT_G8_B8_R8_3PLANE_420_UNORM_KHR:1000156002,VK_FORMAT_G8_B8R8_2PLANE_420_UNORM_KHR:1000156003,VK_FORMAT_G8_B8_R8_3PLANE_422_UNORM_KHR:1000156004,VK_FORMAT_G8_B8R8_2PLANE_422_UNORM_KHR:1000156005,VK_FORMAT_G8_B8_R8_3PLANE_444_UNORM_KHR:1000156006,VK_FORMAT_R10X6_UNORM_PACK16_KHR:1000156007,VK_FORMAT_R10X6G10X6_UNORM_2PACK16_KHR:1000156008,VK_FORMAT_R10X6G10X6B10X6A10X6_UNORM_4PACK16_KHR:1000156009,VK_FORMAT_G10X6B10X6G10X6R10X6_422_UNORM_4PACK16_KHR:1000156010,VK_FORMAT_B10X6G10X6R10X6G10X6_422_UNORM_4PACK16_KHR:1000156011,VK_FORMAT_G10X6_B10X6_R10X6_3PLANE_420_UNORM_3PACK16_KHR:1000156012,VK_FORMAT_G10X6_B10X6R10X6_2PLANE_420_UNORM_3PACK16_KHR:1000156013,VK_FORMAT_G10X6_B10X6_R10X6_3PLANE_422_UNORM_3PACK16_KHR:1000156014,VK_FORMAT_G10X6_B10X6R10X6_2PLANE_422_UNORM_3PACK16_KHR:1000156015,VK_FORMAT_G10X6_B10X6_R10X6_3PLANE_444_UNORM_3PACK16_KHR:1000156016,VK_FORMAT_R12X4_UNORM_PACK16_KHR:1000156017,VK_FORMAT_R12X4G12X4_UNORM_2PACK16_KHR:1000156018,VK_FORMAT_R12X4G12X4B12X4A12X4_UNORM_4PACK16_KHR:1000156019,VK_FORMAT_G12X4B12X4G12X4R12X4_422_UNORM_4PACK16_KHR:1000156020,VK_FORMAT_B12X4G12X4R12X4G12X4_422_UNORM_4PACK16_KHR:1000156021,VK_FORMAT_G12X4_B12X4_R12X4_3PLANE_420_UNORM_3PACK16_KHR:1000156022,VK_FORMAT_G12X4_B12X4R12X4_2PLANE_420_UNORM_3PACK16_KHR:1000156023,VK_FORMAT_G12X4_B12X4_R12X4_3PLANE_422_UNORM_3PACK16_KHR:1000156024,VK_FORMAT_G12X4_B12X4R12X4_2PLANE_422_UNORM_3PACK16_KHR:1000156025,VK_FORMAT_G12X4_B12X4_R12X4_3PLANE_444_UNORM_3PACK16_KHR:1000156026,VK_FORMAT_G16B16G16R16_422_UNORM_KHR:1000156027,VK_FORMAT_B16G16R16G16_422_UNORM_KHR:1000156028,VK_FORMAT_G16_B16_R16_3PLANE_420_UNORM_KHR:1000156029,VK_FORMAT_G16_B16R16_2PLANE_420_UNORM_KHR:1000156030,VK_FORMAT_G16_B16_R16_3PLANE_422_UNORM_KHR:1000156031,VK_FORMAT_G16_B16R16_2PLANE_422_UNORM_KHR:1000156032,VK_FORMAT_G16_B16_R16_3PLANE_444_UNORM_KHR:1000156033};Object.freeze($2e);var rce=$2e;function Yjt(e){switch(e){case te.FLOAT:return"float";case te.FLOAT_VEC2:return"vec2";case te.FLOAT_VEC3:return"vec3";case te.FLOAT_VEC4:return"vec4";case te.FLOAT_MAT2:return"mat2";case te.FLOAT_MAT3:return"mat3";case te.FLOAT_MAT4:return"mat4";case te.SAMPLER_2D:return"sampler2D";case te.BOOL:return"bool"}}var oce=Yjt;function Xjt(e,t,n){return function(){n.apply(e,arguments),t.apply(e,arguments)}}var j4=Xjt;var Kjt=new h(1,1,1);function sce(e){e=e??Kjt,this._dimensions=h.clone(e)}Object.defineProperties(sce.prototype,{dimensions:{get:function(){return this._dimensions},set:function(e){h.clone(e,this._dimensions)}}});var $jt=new h;sce.prototype.emit=function(e){let t=this._dimensions,n=h.multiplyByScalar(t,.5,$jt),i=D.randomBetween(-n.x,n.x),r=D.randomBetween(-n.y,n.y),o=D.randomBetween(-n.z,n.z);e.position=h.fromElements(i,r,o,e.position),e.velocity=h.normalize(e.position,e.velocity)};var ace=sce;var cce=0,J2e=new h,BW=new h,Jjt=new Lo;function Zjt(e,t,n){let i=t.tileX,r=t.tileY,o=t.tileZ,s=n?.featureIdProperty,a=Jjt.tileXYToRectangle(i,r,o),c=ie.center(a),u=h.fromRadians(c.longitude,c.latitude,0),f=4294967295,d=f,p=f,g=new Map,m=new Map,y=[],A=[],b=[],x=0;function T(){let B=(4-x%4)%4;B>0&&(b.push(new Uint8Array(B)),x+=B)}function E(B,j){T();let k=x;b.push(new Uint8Array(B.buffer,B.byteOffset,B.byteLength)),x+=B.byteLength;let G=y.length;return y.push({buffer:0,byteOffset:k,byteLength:B.byteLength,target:j}),G}function v(B,j){let k=E(B,j.target),G=bt.getComponentCount(j.type),q={bufferView:k,byteOffset:0,componentType:j.componentType,count:B.length/G,type:j.type};l(j.min)&&(q.min=j.min),l(j.max)&&(q.max=j.max);let Q=A.length;return A.push(q),Q}function S(B){let j=Number.POSITIVE_INFINITY,k=Number.POSITIVE_INFINITY,G=Number.POSITIVE_INFINITY,q=Number.NEGATIVE_INFINITY,Q=Number.NEGATIVE_INFINITY,W=Number.NEGATIVE_INFINITY;for(let J=0;J<B.length;J+=3){let Z=B[J],ae=B[J+1],Ae=B[J+2];Z<j&&(j=Z),ae<k&&(k=ae),Ae<G&&(G=Ae),Z>q&&(q=Z),ae>Q&&(Q=ae),Ae>W&&(W=Ae)}return{min:[j,k,G],max:[q,Q,W]}}function I(B,j,k){if(k.length===0)return;let G=new Uint32Array(k),q=v(G,{type:"SCALAR",componentType:Y.UNSIGNED_INT,target:te.ARRAY_BUFFER});B._FEATURE_ID_0=q;let Q={featureCount:g.size,nullFeatureId:d,attribute:0};m.size>0&&(Q.propertyTable=0),j.EXT_mesh_features={featureIds:[Q]}}function R(B,j){j=j??4;let k=(j-x%j)%j;k>0&&(b.push(new Uint8Array(k)),x+=k);let G=x;b.push(B),x+=B.byteLength;let q=y.length;return y.push({buffer:0,byteOffset:G,byteLength:B.byteLength}),q}function O(){if(m.size===0)return;let B=new Map;for(let q of m.values())for(let[Q,W]of Object.entries(q)){if(!l(W))continue;let J=typeof W,Z;J==="string"?Z="STRING":J==="number"?Z="SCALAR":J==="boolean"?Z="BOOLEAN":Z="STRING";let ae=B.get(Q);l(ae)?ae!==Z&&B.set(Q,"STRING"):B.set(Q,Z)}if(B.size===0)return;let j={};for(let[q,Q]of B)Q==="SCALAR"?j[q]={type:"SCALAR",componentType:"FLOAT64"}:Q==="BOOLEAN"?j[q]={type:"BOOLEAN"}:j[q]={type:"STRING"};let k={},G=g.size;for(let[q,Q]of B)if(Q==="SCALAR"){let W=new Float64Array(G);for(let Z=0;Z<G;Z++){let Ae=m.get(Z)?.[q];W[Z]=typeof Ae=="number"&&Number.isFinite(Ae)?Ae:NaN}let J=R(new Uint8Array(W.buffer,W.byteOffset,W.byteLength),8);k[q]={values:J}}else if(Q==="BOOLEAN"){let W=Math.ceil(G/8),J=new Uint8Array(W);for(let ae=0;ae<G;ae++)m.get(ae)?.[q]&&(J[ae>>3]|=1<<(ae&7));let Z=R(J);k[q]={values:Z}}else{let W=new TextEncoder,J=[],Z=new Uint32Array(G+1),ae=0;for(let we=0;we<G;we++){Z[we]=ae;let Re=m.get(we)?.[q],Qe;Re==null?Qe="":typeof Re=="string"?Qe=Re:Qe=String(Re);let He=W.encode(Qe);J.push(He),ae+=He.byteLength}Z[G]=ae;let Ae=new Uint8Array(ae),fe=0;for(let we of J)Ae.set(we,fe),fe+=we.byteLength;let xe=R(Ae),ge=R(new Uint8Array(Z.buffer,Z.byteOffset,Z.byteLength));k[q]={values:xe,stringOffsets:ge,stringOffsetType:"UINT32"}}return{schema:{classes:{mvt_feature:{properties:j}}},propertyTables:[{class:"mvt_feature",count:G,properties:k}]}}let L=[],_=[],C=[u.x,u.y,u.z];for(let B of e.layers){let j=B.extent,k=[],G=[],q=[],Q=[],W=[],J=0,Z=[],ae=[],Ae=[],fe=[],xe=[],ge=[],we=[],Se=0;for(let He of B.features){let Xe=l(s)?e6t(He,s,g)??d:Qjt(He,g);if(Xe!==d&&!m.has(Xe)){let $e=Object.assign({},He.properties);$e._layer=B.name??"",m.set(Xe,$e)}if(He.type==="Point"){let $e=He.geometry;for(let Pe of $e)lce(Pe,i,r,o,j,cce,u,k),G.push(Xe);continue}if(He.type==="LineString"){let $e=He.geometry;for(let Pe of $e){let qe=q.length/3;for(let st of Pe)lce(st,i,r,o,j,cce,u,q),Q.push(Xe);for(let st=0;st<Pe.length;st++)W.push(qe+st);W.push(p),J++}continue}if(He.type==="Polygon"){let $e=He.geometry,Pe=t6t($e);for(let qe of Pe){let st=[qe.outerRing,...qe.holes],vt=[],Gt=[],lt=[],mt=0;for(let ht=0;ht<st.length;ht++){let Bi=st[ht];ht>0&<.push(mt);for(let Xn of Bi)vt.push(new U(Xn.x,Xn.y)),lce(Xn,i,r,o,j,cce,u,Gt),mt++}if(vt.length<3)continue;let ft=fi.triangulate(vt,lt.length>0?lt:void 0);if(!l(ft)||ft.length===0){_t("buildVectorGltfFromMVT-triangulation-failed","Polygon triangulation failed; skipping polygon.");continue}let Xt=Z.length/3,rt=Ae.length;fe.push(Xt),xe.push(rt),ge.push(lt.length);for(let ht=0;ht<lt.length;ht++)we.push(Xt+lt[ht]);for(let ht=0;ht<Gt.length;ht++)Z.push(Gt[ht]);for(let ht=0;ht<Gt.length/3;ht++)ae.push(Xe);for(let ht=0;ht<ft.length;ht++)Ae.push(ft[ht]+Xt);Se++}}}if(k.length===0&&q.length===0&&Z.length===0)continue;W.length>0&&W[W.length-1]===p&&W.pop();let Re=[];if(k.length>0){let He=new Float32Array(k),Xe=S(He),Pe={POSITION:v(He,{type:"VEC3",componentType:Y.FLOAT,target:te.ARRAY_BUFFER,min:Xe.min,max:Xe.max})},qe={CESIUM_mesh_vector:{vector:!0,count:He.length/3}};I(Pe,qe,G),Re.push({mode:Oe.POINTS,attributes:Pe,extensions:qe})}if(q.length>0&&W.length>1){let He=new Float32Array(q),Xe=new Uint32Array(W),$e=S(He),Pe=v(He,{type:"VEC3",componentType:Y.FLOAT,target:te.ARRAY_BUFFER,min:$e.min,max:$e.max}),qe=v(Xe,{type:"SCALAR",componentType:Y.UNSIGNED_INT,target:te.ELEMENT_ARRAY_BUFFER}),st={POSITION:Pe},vt={CESIUM_mesh_vector:{vector:!0,count:J}};I(st,vt,Q),Re.push({mode:Oe.LINE_STRIP,indices:qe,attributes:st,extensions:vt})}if(Z.length>0&&Ae.length>=3){let He=new Float32Array(Z),Xe=new Uint32Array(Ae),$e=new Uint32Array(fe),Pe=new Uint32Array(xe),qe=we.length>0,st=qe?new Uint32Array(ge):void 0,vt=qe?new Uint32Array(we):void 0,Gt=S(He),lt=v(He,{type:"VEC3",componentType:Y.FLOAT,target:te.ARRAY_BUFFER,min:Gt.min,max:Gt.max}),mt=v(Xe,{type:"SCALAR",componentType:Y.UNSIGNED_INT,target:te.ELEMENT_ARRAY_BUFFER}),ft=v($e,{type:"SCALAR",componentType:Y.UNSIGNED_INT,target:te.ARRAY_BUFFER}),Xt=v(Pe,{type:"SCALAR",componentType:Y.UNSIGNED_INT,target:te.ARRAY_BUFFER}),rt=l(st)?v(st,{type:"SCALAR",componentType:Y.UNSIGNED_INT,target:te.ARRAY_BUFFER}):void 0,ht=l(vt)?v(vt,{type:"SCALAR",componentType:Y.UNSIGNED_INT,target:te.ARRAY_BUFFER}):void 0,Bi={POSITION:lt},Xn={CESIUM_mesh_vector:{vector:!0,count:Se,polygonAttributeOffsets:ft,polygonIndicesOffsets:Xt}};qe&&(Xn.CESIUM_mesh_vector.polygonHoleCounts=rt,Xn.CESIUM_mesh_vector.polygonHoleOffsets=ht),I(Bi,Xn,ae),Re.push({mode:Oe.TRIANGLES,indices:mt,attributes:Bi,extensions:Xn})}if(Re.length===0)continue;let Qe=L.length;L.push({primitives:Re}),_.push({name:B.name,mesh:Qe,translation:C})}if(_.length===0)return;let w=O(),P=o6t(b,x),M=["CESIUM_mesh_vector"];g.size>0&&M.push("EXT_mesh_features"),l(w)&&M.push("EXT_structural_metadata");let F=_.map((B,j)=>j),V={asset:{version:"2.0"},extensionsUsed:M,scene:0,scenes:[{nodes:F}],nodes:_,meshes:L,accessors:A,bufferViews:y,buffers:[{byteLength:P.byteLength}],extensions:void 0};return l(w)&&(V.extensions={EXT_structural_metadata:w}),r6t(V,P)}function Qjt(e,t){let n=t.get(e);return l(n)||(n=t.size,t.set(e,n)),n}function e6t(e,t,n){let i=e.properties;if(!l(i))return;let r=i[t];if(!l(r)||typeof r!="string"&&typeof r!="number"&&typeof r!="boolean"||typeof r=="number"&&!Number.isFinite(r))return;let o=`${typeof r}:${r}`,s=n.get(o);return l(s)||(s=n.size,n.set(o,s)),s}function t6t(e){let t=[];for(let n of e){let i=i6t(n);if(i.length<3)continue;n6t(i)<=0?t.push({outerRing:i,holes:[]}):t.length>0&&t[t.length-1].holes.push(i)}return t}function n6t(e){let t=0;for(let n=0,i=e.length-1;n<e.length;i=n++)t+=(e[i].x+e[n].x)*(e[i].y-e[n].y);return t/2}function i6t(e){return e.length>1&&e[0].x===e[e.length-1].x&&e[0].y===e[e.length-1].y?e.slice(0,e.length-1):e}function lce(e,t,n,i,r,o,s,a){let c=1<<i,u=(t+e.x/r)/c,f=(n+e.y/r)/c,d=u*2*Math.PI-Math.PI,p=Math.atan(Math.sinh(Math.PI*(1-2*f)));h.fromRadians(d,p,o,void 0,J2e),h.subtract(J2e,s,BW),a.push(BW.x,BW.y,BW.z)}function r6t(e,t){let s=new TextEncoder().encode(JSON.stringify(e)),a=Math.ceil(s.length/4)*4,c=new Uint8Array(a);c.fill(32),c.set(s);let u=Math.ceil(t.byteLength/4)*4,f=new Uint8Array(u);f.set(t);let d=20+a+8+u,p=new Uint8Array(d),g=new DataView(p.buffer),m=0;return g.setUint32(m,1179937895,!0),m+=4,g.setUint32(m,2,!0),m+=4,g.setUint32(m,d,!0),m+=4,g.setUint32(m,a,!0),m+=4,g.setUint32(m,1313821514,!0),m+=4,p.set(c,m),m+=a,g.setUint32(m,u,!0),m+=4,g.setUint32(m,5130562,!0),m+=4,p.set(f,m),p}function o6t(e,t){let n=new Uint8Array(t),i=0;for(let r of e)n.set(r,i),i+=r.byteLength;return n}var H4=Zjt;var uce=class{constructor(){ut(this,"featuresLength");ut(this,"pointsLength");ut(this,"trianglesLength");ut(this,"geometryByteLength");ut(this,"texturesByteLength");ut(this,"batchTableByteLength");ut(this,"innerContents");ut(this,"ready");ut(this,"tileset");ut(this,"tile");ut(this,"url");ut(this,"batchTable");ut(this,"metadata");ut(this,"group");this.featurePropertiesDirty=!1}hasProperty(t,n){pe.throwInstantiationError()}getFeature(t){pe.throwInstantiationError()}applyDebugSettings(t,n){pe.throwInstantiationError()}applyStyle(t){pe.throwInstantiationError()}update(t,n){pe.throwInstantiationError()}pick(t,n,i){pe.throwInstantiationError()}isDestroyed(){pe.throwInstantiationError()}destroy(){pe.throwInstantiationError()}},fce=uce;function G4(e){e=e??H.EMPTY_OBJECT,this._maximumSubtreeCount=e.maximumSubtreeCount??0,this._subtreeRequestCounter=0,this._queue=new hy({comparator:G4.comparator})}G4.prototype.addSubtree=function(e){let t=new s6t(e,this._subtreeRequestCounter);this._subtreeRequestCounter++,this._queue.insert(t);let n=e.implicitCoordinates;if(n.level>0){let i=n.getParentSubtreeCoordinates(),r=this.find(i)}if(this._maximumSubtreeCount>0)for(;this._queue.length>this._maximumSubtreeCount&&this._queue.getMinimum()!==t;)this._queue.removeMinimum()};G4.prototype.find=function(e){let t=this._queue,n=t.internalArray,i=t.length;for(let r=0;r<i;r++){let o=n[r],a=o.subtree.implicitCoordinates;if(e.isEqual(a))return o.subtree}};G4.comparator=function(e,t){let n=e.subtree.implicitCoordinates,i=t.subtree.implicitCoordinates;return n.isAncestor(i)?1:i.isAncestor(n)?-1:e.stamp-t.stamp};function s6t(e,t){this.subtree=e,this.stamp=t}var W4=G4;function q4(e){e=e??H.EMPTY_OBJECT;let{className:t,names:n,types:i,componentTypes:r,shape:o,dimensions:s,paddingBefore:a=h.ZERO.clone(),paddingAfter:c=h.ZERO.clone(),globalTransform:u=N.IDENTITY.clone(),shapeTransform:f=N.IDENTITY.clone(),minBounds:d,maxBounds:p,minimumValues:g,maximumValues:m,maximumTileCount:y}=e;this._shapeTransform=f,this._globalTransform=u,this._shape=o,this._minBounds=d,this._maxBounds=p,this._dimensions=s,this._paddingBefore=a,this._paddingAfter=c,this._className=t,this._names=n,this._types=i,this._componentTypes=r,this._metadataOrder=o===Ec.ELLIPSOID?G0.Z_UP:G0.Y_UP,this._minimumValues=g,this._maximumValues=m,this._maximumTileCount=y,this._availableLevels=void 0,this._implicitTileset=void 0,this._subtreeCache=new W4}Object.defineProperties(q4.prototype,{globalTransform:{get:function(){return this._globalTransform}},shapeTransform:{get:function(){return this._shapeTransform}},shape:{get:function(){return this._shape}},minBounds:{get:function(){return this._minBounds}},maxBounds:{get:function(){return this._maxBounds}},dimensions:{get:function(){return this._dimensions}},paddingBefore:{get:function(){return this._paddingBefore}},paddingAfter:{get:function(){return this._paddingAfter}},className:{get:function(){return this._className}},names:{get:function(){return this._names}},types:{get:function(){return this._types}},componentTypes:{get:function(){return this._componentTypes}},metadataOrder:{get:function(){return this._metadataOrder}},minimumValues:{get:function(){return this._minimumValues}},maximumValues:{get:function(){return this._maximumValues}},maximumTileCount:{get:function(){return this._maximumTileCount}},availableLevels:{get:function(){return this._availableLevels}}});q4.fromUrl=async function(e){let t=De.createIfNeeded(e),n=await t.fetchJson();c6t(n);let i=p6t(n,t);await i.load();let{root:r}=n,o=tr(n,"3DTILES_metadata")?n.extensions["3DTILES_metadata"]:n,s=new JT({metadataJson:o,schema:i.schema}),a=r.content.extensions["3DTILES_content_voxels"],c=a.class,u=g6t(s,c);Object.assign(u,l6t(r)),l(r.transform)?u.globalTransform=N.unpack(r.transform):u.globalTransform=N.clone(N.IDENTITY),u.dimensions=h.unpack(a.dimensions),u.maximumTileCount=a6t(s),l(a.padding)&&(u.paddingBefore=h.unpack(a.padding.before),u.paddingAfter=h.unpack(a.padding.after));let f=new q4(u),d=new r0(t,r,i.schema);return f._implicitTileset=d,f._availableLevels=d.availableLevels,Li.unload(i),f};function a6t(e){if(l(e.tileset))return e.tileset.getPropertyBySemantic(Vd.TILESET_TILE_COUNT)}function c6t(e){let t=e.root;if(!l(t.content))throw new oe("Root must have content");if(!tr(t.content,"3DTILES_content_voxels"))throw new oe("Root tile content must have 3DTILES_content_voxels extension");if(!tr(t,"3DTILES_implicit_tiling")&&!l(t.implicitTiling))throw new oe("Root tile must have implicit tiling");if(!l(e.schema)&&!l(e.schemaUri)&&!tr(e,"3DTILES_metadata"))throw new oe("Tileset must have a metadata schema")}function l6t(e){let t=e.boundingVolume;if(l(t.box))return h6t(t.box);if(l(t.region))return u6t(t.region);if(tr(t,"3DTILES_bounding_volume_cylinder"))return m6t(t.extensions["3DTILES_bounding_volume_cylinder"]);throw new oe("Only box, region and 3DTILES_bounding_volume_cylinder are supported in Cesium3DTilesVoxelProvider")}function u6t(e){let t=e[0],n=e[1],i=e[2],r=e[3],o=e[4],s=e[5],a=N.fromScale(ee.WGS84.radii),c=new h(t,n,o),u=new h(i,r,s);return{shape:Ec.ELLIPSOID,minBounds:c,maxBounds:u,shapeTransform:a}}var f6t=new h,d6t=new $;function h6t(e){let t=en.unpack(e),n=$.getScale(t.halfAxes,f6t),i=$.getRotation(t.halfAxes,d6t);return{shape:Ec.BOX,minBounds:h.negate(n,new h),maxBounds:h.clone(n),shapeTransform:N.fromRotationTranslation(i,t.center)}}function m6t(e){let{minRadius:t,maxRadius:n,height:i,minAngle:r=-D.PI,maxAngle:o=D.PI,translation:s=[0,0,0],rotation:a=[0,0,0,1]}=e,c=-.5*i+s[2],u=.5*i+s[2],f=N.fromTranslationQuaternionRotationScale(h.unpack(s),Le.unpack(a),h.ONE);return{shape:Ec.CYLINDER,minBounds:h.fromElements(t,r,c),maxBounds:h.fromElements(n,o,u),shapeTransform:f}}function p6t(e,t){let{schemaUri:n,schema:i}=e;return l(n)?Li.getSchemaLoader({resource:t.getDerivedResource({url:n})}):Li.getSchemaLoader({schema:i})}function g6t(e,t){let{schema:n,statistics:i}=e,r=i?.classes[t],o=n.classes[t].properties,s=Object.entries(o).map(([g,m])=>{let{type:y,componentType:A}=m,b=r?.properties[g].min,x=r?.properties[g].max,T=bt.getComponentCount(y),E=Z2e(b,T),v=Z2e(x,T);return{id:g,type:y,componentType:A,minValue:E,maxValue:v}}),a=s.map(g=>g.id),c=s.map(g=>g.type),u=s.map(g=>g.componentType),f=s.map(g=>g.minValue),d=s.map(g=>g.maxValue),p=f.some(l);return{className:t,names:a,types:c,componentTypes:u,minimumValues:p?f:void 0,maximumValues:p?d:void 0}}function Z2e(e,t){if(!l(e))return;let n=Array.isArray(e)?e:[e];return Array.from({length:t},(i,r)=>n[r])}async function _6t(e,t){let n=e._implicitTileset,i=e._subtreeCache,r=i.find(t);if(l(r))return r;let o=n.subtreeUriTemplate.getDerivedResource({templateValues:t.getTemplateValues()}),s=n.baseResource.getDerivedResource({url:o.url}),a=await s.fetchArrayBuffer();if(r=i.find(t),l(r))return r;let c=p_(a);return r=await Ug.fromSubtreeJson(s,c.jsonPayload,c.binaryPayload,n,t),i.addSubtree(r),r}q4.prototype.requestData=async function(e){e=e??H.EMPTY_OBJECT;let{tileLevel:t=0,tileX:n=0,tileY:i=0,tileZ:r=0,keyframe:o=0}=e;if(o!==0)return Promise.reject("3D Tiles currently doesn't support time-dynamic data.");let s=this._implicitTileset,a=new o0({subdivisionScheme:s.subdivisionScheme,subtreeLevels:s.subtreeLevels,level:t,x:n,y:i,z:r}),c=a.isSubtreeRoot()&&a.level>0,u=c?a.getParentSubtreeCoordinates():a.getSubtreeCoordinates(),d=await _6t(this,u);if(!(c?d.childSubtreeIsAvailableAtCoordinates:d.tileIsAvailableAtCoordinates).call(d,a))return Promise.reject(`Tile is not available at level ${t}, x ${n}, y ${i}, z ${r}.`);let{contentUriTemplates:m,baseResource:y}=s,A=m[0].getDerivedResource({templateValues:a.getTemplateValues()}),b=y.getDerivedResource({url:A.url});return vC.fromGltf(b)};var dce=q4;function hce(e){e=e??1,this._radius=e??1}Object.defineProperties(hce.prototype,{radius:{get:function(){return this._radius},set:function(e){this._radius=e}}});hce.prototype.emit=function(e){let t=D.randomBetween(0,D.TWO_PI),n=D.randomBetween(0,this._radius),i=n*Math.cos(t),r=n*Math.sin(t),o=0;e.position=h.fromElements(i,r,o,e.position),e.velocity=h.clone(h.UNIT_Z,e.velocity)};var Y4=hce;var kW={CUMULUS:0};kW.validate=function(e){return e===kW.CUMULUS};Object.freeze(kW);var HP=kW;function hp(e,t){if(e=e??H.EMPTY_OBJECT,this._show=e.show??!0,this._position=h.clone(e.position??h.ZERO),!l(e.scale)&&l(e.maximumSize))this._maximumSize=h.clone(e.maximumSize),this._scale=new U(this._maximumSize.x,this._maximumSize.y);else{this._scale=U.clone(e.scale??new U(20,12));let n=new h(this._scale.x,this._scale.y,Math.min(this._scale.x,this._scale.y)/1.5);this._maximumSize=h.clone(e.maximumSize??n)}this._slice=e.slice??-1,this._color=z.clone(e.color??z.WHITE),this._brightness=e.brightness??1,this._cloudCollection=t,this._index=-1}var y6t=hp.SHOW_INDEX=0,A6t=hp.POSITION_INDEX=1,b6t=hp.SCALE_INDEX=2,x6t=hp.MAXIMUM_SIZE_INDEX=3,T6t=hp.SLICE_INDEX=4,E6t=hp.BRIGHTNESS_INDEX=5,C6t=hp.COLOR_INDEX=6;hp.NUMBER_OF_PROPERTIES=7;function GC(e,t){let n=e._cloudCollection;l(n)&&(n._updateCloud(e,t),e._dirty=!0)}Object.defineProperties(hp.prototype,{show:{get:function(){return this._show},set:function(e){this._show!==e&&(this._show=e,GC(this,y6t))}},position:{get:function(){return this._position},set:function(e){let t=this._position;h.equals(t,e)||(h.clone(e,t),GC(this,A6t))}},scale:{get:function(){return this._scale},set:function(e){let t=this._scale;U.equals(t,e)||(U.clone(e,t),GC(this,b6t))}},maximumSize:{get:function(){return this._maximumSize},set:function(e){let t=this._maximumSize;h.equals(t,e)||(h.clone(e,t),GC(this,x6t))}},color:{get:function(){return this._color},set:function(e){let t=this._color;z.equals(t,e)||(z.clone(e,t),GC(this,C6t))}},slice:{get:function(){return this._slice},set:function(e){this._slice!==e&&(this._slice=e,GC(this,T6t))}},brightness:{get:function(){return this._brightness},set:function(e){this._brightness!==e&&(this._brightness=e,GC(this,E6t))}}});hp.prototype._destroy=function(){this._cloudCollection=void 0};var Ad=hp;var bd,UW=new h,v6t={positionHighAndScaleX:0,positionLowAndScaleY:1,packedAttribute0:2,packedAttribute1:3,color:4},S6t={direction:0,positionHighAndScaleX:1,positionLowAndScaleY:2,packedAttribute0:3,packedAttribute1:4,color:5},w6t=Ad.SHOW_INDEX,I6t=Ad.POSITION_INDEX,P6t=Ad.SCALE_INDEX,D6t=Ad.MAXIMUM_SIZE_INDEX,R6t=Ad.SLICE_INDEX,O6t=Ad.BRIGHTNESS_INDEX,M6t=Ad.NUMBER_OF_PROPERTIES,N6t=Ad.COLOR_INDEX;function mp(e){e=e??H.EMPTY_OBJECT,this._clouds=[],this._cloudsToUpdate=[],this._cloudsToUpdateIndex=0,this._cloudsRemoved=!1,this._createVertexArray=!1,this._propertiesChanged=new Uint32Array(M6t),this._noiseTexture=void 0,this._textureSliceWidth=128,this._noiseTextureRows=4,this.noiseDetail=e.noiseDetail??16,this.noiseOffset=h.clone(e.noiseOffset??h.ZERO),this._loading=!1,this._ready=!1;let t=this;this._uniforms={u_noiseTexture:function(){return t._noiseTexture},u_noiseTextureDimensions:Q2e(t),u_noiseDetail:function(){return t.noiseDetail}},this._vaNoise=void 0,this._spNoise=void 0,this._spCreated=!1,this._sp=void 0,this._rs=void 0,this.show=e.show??!0,this._colorCommands=[],this.debugBillboards=e.debugBillboards??!1,this._compiledDebugBillboards=!1,this.debugEllipsoids=e.debugEllipsoids??!1,this._compiledDebugEllipsoids=!1}function Q2e(e){return function(){return UW.x=e._textureSliceWidth,UW.y=e._noiseTextureRows,UW.z=1/e._noiseTextureRows,UW}}Object.defineProperties(mp.prototype,{length:{get:function(){return pce(this),this._clouds.length}}});function eke(e){let t=e.length;for(let n=0;n<t;++n)e[n]&&e[n]._destroy()}mp.prototype.add=function(e){e=e??H.EMPTY_OBJECT;let t=e.cloudType??HP.CUMULUS,n;return t===HP.CUMULUS&&(n=new Ad(e,this),n._index=this._clouds.length,this._clouds.push(n),this._createVertexArray=!0),n};mp.prototype.remove=function(e){return this.contains(e)?(this._clouds[e._index]=void 0,this._cloudsRemoved=!0,this._createVertexArray=!0,e._destroy(),!0):!1};mp.prototype.removeAll=function(){eke(this._clouds),this._clouds=[],this._cloudsToUpdate=[],this._cloudsToUpdateIndex=0,this._cloudsRemoved=!1,this._createVertexArray=!0};function pce(e){if(e._cloudsRemoved){e._cloudsRemoved=!1;let t=[],n=e._clouds,i=n.length;for(let r=0,o=0;r<i;++r){let s=n[r];l(s)&&(n._index=o++,t.push(s))}e._clouds=t}}mp.prototype._updateCloud=function(e,t){e._dirty||(this._cloudsToUpdate[this._cloudsToUpdateIndex++]=e),++this._propertiesChanged[t]};mp.prototype.contains=function(e){return l(e)&&e._cloudCollection===this};mp.prototype.get=function(e){return pce(this),this._clouds[e]};var L6t=new Float32Array([-1,-1,1,-1,1,1,-1,1]),F6t=new Uint16Array([0,1,2,0,2,3]);function B6t(e){let t=tt.createVertexBuffer({context:e,typedArray:L6t,usage:Me.STATIC_DRAW}),n=tt.createIndexBuffer({context:e,typedArray:F6t,usage:Me.STATIC_DRAW,indexDatatype:je.UNSIGNED_SHORT}),i=[{index:0,vertexBuffer:t,componentsPerAttribute:2,componentDatatype:Y.FLOAT}];return new zn({context:e,attributes:i,indexBuffer:n})}var gce;function k6t(e){let n=e.cache.cloudCollection_indexBufferBatched;if(l(n))return n;let i=16384*6-6,r=new Uint16Array(i);for(let o=0,s=0;o<i;o+=6,s+=4)r[o]=s,r[o+1]=s+1,r[o+2]=s+2,r[o+3]=s,r[o+4]=s+2,r[o+5]=s+3;return n=tt.createIndexBuffer({context:e,typedArray:r,usage:Me.STATIC_DRAW,indexDatatype:je.UNSIGNED_SHORT}),n.vertexArrayDestroyable=!1,e.cache.cloudCollection_indexBufferBatched=n,n}function U6t(e){let t=e.cache.cloudCollection_indexBufferInstanced;return l(t)||(t=tt.createIndexBuffer({context:e,typedArray:new Uint16Array([0,1,2,0,2,3]),usage:Me.STATIC_DRAW,indexDatatype:je.UNSIGNED_SHORT}),t.vertexArrayDestroyable=!1,e.cache.cloudCollection_indexBufferInstanced=t),t}function z6t(e){let t=e.cache.cloudCollection_vertexBufferInstanced;return l(t)||(t=tt.createVertexBuffer({context:e,typedArray:new Float32Array([0,0,1,0,1,1,0,1]),usage:Me.STATIC_DRAW}),t.vertexArrayDestroyable=!1,e.cache.cloudCollection_vertexBufferInstanced=t),t}function V6t(e,t,n){let i=[{index:bd.positionHighAndScaleX,componentsPerAttribute:4,componentDatatype:Y.FLOAT,usage:Me.STATIC_DRAW},{index:bd.positionLowAndScaleY,componentsPerAttribute:4,componentDatatype:Y.FLOAT,usage:Me.STATIC_DRAW},{index:bd.packedAttribute0,componentsPerAttribute:4,componentDatatype:Y.FLOAT,usage:Me.STATIC_DRAW},{index:bd.packedAttribute1,componentsPerAttribute:4,componentDatatype:Y.FLOAT,usage:Me.STATIC_DRAW},{index:bd.color,componentsPerAttribute:4,componentDatatype:Y.UNSIGNED_BYTE,normalize:!0,usage:Me.STATIC_DRAW}];n&&i.push({index:bd.direction,componentsPerAttribute:2,componentDatatype:Y.FLOAT,vertexBuffer:z6t(e)});let r=n?t:4*t;return new mg(e,i,r,n)}var mce=new Sn;function tke(e,t,n,i){let r,o=n[bd.positionHighAndScaleX],s=n[bd.positionLowAndScaleY],a=i.position;Sn.fromCartesian(a,mce);let c=i.scale,u=mce.high,f=mce.low;e._instanced?(r=i._index,o(r,u.x,u.y,u.z,c.x),s(r,f.x,f.y,f.z,c.y)):(r=i._index*4,o(r+0,u.x,u.y,u.z,c.x),o(r+1,u.x,u.y,u.z,c.x),o(r+2,u.x,u.y,u.z,c.x),o(r+3,u.x,u.y,u.z,c.x),s(r+0,f.x,f.y,f.z,c.y),s(r+1,f.x,f.y,f.z,c.y),s(r+2,f.x,f.y,f.z,c.y),s(r+3,f.x,f.y,f.z,c.y))}function nke(e,t,n,i){let r,o=n[bd.packedAttribute0],s=i.show,a=i.brightness;e._instanced?(r=i._index,o(r,s,a,0,0)):(r=i._index*4,o(r+0,s,a,0,0),o(r+1,s,a,1,0),o(r+2,s,a,1,1),o(r+3,s,a,0,1))}function ike(e,t,n,i){let r,o=n[bd.packedAttribute1],s=i.maximumSize,a=i.slice;e._instanced?(r=i._index,o(r,s.x,s.y,s.z,a)):(r=i._index*4,o(r+0,s.x,s.y,s.z,a),o(r+1,s.x,s.y,s.z,a),o(r+2,s.x,s.y,s.z,a),o(r+3,s.x,s.y,s.z,a))}function rke(e,t,n,i){let r,o=n[bd.color],s=i.color,a=z.floatToByte(s.red),c=z.floatToByte(s.green),u=z.floatToByte(s.blue),f=z.floatToByte(s.alpha);e._instanced?(r=i._index,o(r,a,c,u,f)):(r=i._index*4,o(r+0,a,c,u,f),o(r+1,a,c,u,f),o(r+2,a,c,u,f),o(r+3,a,c,u,f))}function j6t(e,t,n,i){tke(e,t,n,i),nke(e,t,n,i),ike(e,t,n,i),rke(e,t,n,i)}function H6t(e,t,n,i){let r=e,o=r._textureSliceWidth,s=r._noiseTextureRows,a=t.context;r._vaNoise=B6t(a),r._spNoise=Qt.fromCache({context:a,vertexShaderSource:n,fragmentShaderSource:i,attributeLocations:{position:0}});let c=r.noiseDetail,u=r.noiseOffset;r._noiseTexture=new Dt({context:a,width:o*o/s,height:o*s,pixelDatatype:ze.UNSIGNED_BYTE,pixelFormat:Ke.RGBA,sampler:new jt({wrapS:hn.REPEAT,wrapT:hn.REPEAT,minificationFilter:Wt.NEAREST,magnificationFilter:Jn.NEAREST})});let f=new xf({vertexArray:r._vaNoise,shaderProgram:r._spNoise,outputTexture:r._noiseTexture,uniformMap:{u_noiseTextureDimensions:Q2e(r),u_noiseDetail:function(){return c},u_noiseOffset:function(){return u}},persists:!1,owner:e,postExecute:function(d){r._ready=!0,r._loading=!1}});t.commandList.push(f),r._loading=!0}function G6t(e,t){let n=e,i=t.context;n._createVertexArray=!1,n._vaf=n._vaf&&n._vaf.destroy();let r=e._clouds,o=r.length;if(o>0){n._vaf=V6t(i,o,n._instanced);let s=n._vaf.writers,a;for(a=0;a<o;++a){let c=r[a];j6t(e,t,s,c)}n._vaf.commit(gce(i))}}var W6t=[];function q6t(e,t){let n=t.context,i=e,o=i._clouds.length,s=i._cloudsToUpdate,a=i._cloudsToUpdateIndex,c=i._propertiesChanged,u=W6t;u.length=0,(c[I6t]||c[P6t])&&u.push(tke),(c[w6t]||c[O6t])&&u.push(nke),(c[D6t]||c[R6t])&&u.push(ike),c[N6t]&&u.push(rke);let f=u.length,d=i._vaf.writers,p,g,m;if(a/o>.1){for(p=0;p<a;++p)for(g=s[p],g._dirty=!1,m=0;m<f;++m)u[m](e,t,d,g);i._vaf.commit(gce(n))}else{for(p=0;p<a;++p){for(g=s[p],g._dirty=!1,m=0;m<f;++m)u[m](e,t,d,g);i._instanced?i._vaf.subCommit(g._index,1):i._vaf.subCommit(g._index*4,4)}i._vaf.endSubCommits()}i._cloudsToUpdateIndex=0}function Y6t(e,t,n,i){let r=t.context,o=e,s=new Ye({defines:[],sources:[n]});o._instanced&&s.defines.push("INSTANCED");let a=new Ye({defines:[],sources:[i]});o.debugBillboards&&a.defines.push("DEBUG_BILLBOARDS"),o.debugEllipsoids&&a.defines.push("DEBUG_ELLIPSOIDS"),o._sp=Qt.replaceCache({context:r,shaderProgram:o._sp,vertexShaderSource:s,fragmentShaderSource:a,attributeLocations:bd}),o._rs=Ge.fromCache({depthTest:{enabled:!0,func:te.LESS},depthMask:!1,blending:tn.ALPHA_BLEND}),o._spCreated=!0,o._compiledDebugBillboards=o.debugBillboards,o._compiledDebugEllipsoids=o.debugEllipsoids}function X6t(e,t){let n=e,i=t.passes,r=n._uniforms,o=t.commandList;if(i.render){let s=n._colorCommands,a=n._vaf.va,c=a.length;s.length=c;for(let u=0;u<c;u++){let f=s[u];l(f)||(f=s[u]=new at),f.pass=Ie.TRANSLUCENT,f.owner=e,f.uniformMap=r,f.count=a[u].indicesCount,f.vertexArray=a[u].va,f.shaderProgram=n._sp,f.renderState=n._rs,n._instanced&&(f.count=6,f.instanceCount=n._clouds.length),o.push(f)}}}mp.prototype.update=function(e){if(pce(this),!this.show)return;let t=this.debugBillboards||this.debugEllipsoids;this._ready=t?!0:l(this._noiseTexture),!this._ready&&!this._loading&&!t&&H6t(this,e,KO,XO),this._instanced=e.context.instancedArrays,bd=this._instanced?S6t:v6t,gce=this._instanced?U6t:k6t;let i=this._clouds.length,r=this._cloudsToUpdate,o=this._cloudsToUpdateIndex;this._createVertexArray?G6t(this,e):o>0&&q6t(this,e),o>i*1.5&&(r.length=i),!(!l(this._vaf)||!l(this._vaf.va)||!this._ready&!t)&&((!this._spCreated||this.debugBillboards!==this._compiledDebugBillboards||this.debugEllipsoids!==this._compiledDebugEllipsoids)&&Y6t(this,e,YO,qO),X6t(this,e))};mp.prototype.isDestroyed=function(){return!1};mp.prototype.destroy=function(){return this._noiseTexture=this._noiseTexture&&this._noiseTexture.destroy(),this._sp=this._sp&&this._sp.destroy(),this._vaf=this._vaf&&this._vaf.destroy(),eke(this._clouds),le(this)};var _ce=mp;var K6t=D.toRadians(30);function yce(e){this._angle=e??K6t}Object.defineProperties(yce.prototype,{angle:{get:function(){return this._angle},set:function(e){this._angle=e}}});yce.prototype.emit=function(e){let t=Math.tan(this._angle),n=D.randomBetween(0,D.TWO_PI),i=D.randomBetween(0,t),r=i*Math.cos(n),o=i*Math.sin(n),s=1;e.velocity=h.fromElements(r,o,s,e.velocity),h.normalize(e.velocity,e.velocity),e.position=h.clone(h.ZERO,e.position)};var Ace=yce;var $6t=new z,J6t=new z,Z6t=new z,Q6t=new z,oke=new se,X4=new Uint8Array(4);function ske(e,t,n,i){let r=t.height===n.height?0:(e-t.height)/(n.height-t.height);return z.lerp(t.color,n.color,r,i)}function zW(e,t){return{height:e,color:z.clone(t)}}function ake(e){return e=e.filter(function(t,n,i){let r=n>0,o=n<i.length-1,s=r?t.height===i[n-1].height:!0,a=o?t.height===i[n+1].height:!0;return!s||!a}),e=e.filter(function(t,n,i){let r=n>0,o=n<i.length-1,s=r?z.equals(t.color,i[n-1].color):!1,a=o?z.equals(t.color,i[n+1].color):!1;return!s||!a}),e=e.filter(function(t,n,i){let r=n>0,o=r?z.equals(t.color,i[n-1].color):!1,s=r?t.height===i[n-1].height:!0;return!o||!s}),e}function eHt(e){let t,n,i=[],r=e.length;for(t=0;t<r;t++){let o=e[t],s=o.entries,a=s.length,c=[];for(n=0;n<a;n++){let g=s[n],m=D.clamp(g.height,pf._minimumHeight,pf._maximumHeight),y=z.clone(g.color,$6t);y.red*=y.alpha,y.green*=y.alpha,y.blue*=y.alpha,c.push(zW(m,y))}let u=!0,f=!0;for(n=0;n<a-1;n++){let g=c[n+0],m=c[n+1];u=u&&g.height<=m.height,f=f&&g.height>=m.height}f?c=c.reverse():u||N0(c,function(g,m){return D.sign(g.height-m.height)});let d=o.extendDownwards??!1,p=o.extendUpwards??!1;c.length===1&&!d&&!p&&(d=!0,p=!0),d&&c.splice(0,0,zW(pf._minimumHeight,c[0].color)),p&&c.splice(c.length,0,zW(pf._maximumHeight,c[c.length-1].color)),c=ake(c),i.push(c)}return i}function tHt(e){let t=eHt(e),n=[],i,r;function o(u,f){n.push(zW(u,f))}function s(u,f,d){let p=z.multiplyByScalar(d,1-f.alpha,Q6t);p=z.add(p,f,p),o(u,p)}let a=t.length;for(r=0;r<a;r++){let u=t[r],f=0,d=0;i=n,n=[];let p=u.length,g=i.length;for(;f<p||d<g;){let m=f<p?u[f]:void 0,y=f>0?u[f-1]:void 0,A=f<p-1?u[f+1]:void 0,b=d<g?i[d]:void 0,x=d>0?i[d-1]:void 0,T=d<g-1?i[d+1]:void 0;if(l(m)&&l(b)&&m.height===b.height){let E=l(T)&&b.height===T.height,v=!l(x),S=!l(T),I=l(A)&&m.height===A.height,R=!l(y),O=!l(A);E?I?(s(m.height,m.color,b.color),s(m.height,A.color,T.color)):R?(o(m.height,b.color),s(m.height,m.color,T.color)):O?(s(m.height,m.color,b.color),o(m.height,T.color)):(s(m.height,m.color,b.color),s(m.height,m.color,T.color)):v?I?(o(m.height,m.color),s(m.height,A.color,b.color)):O?(o(m.height,m.color),o(m.height,b.color)):(R||o(m.height,m.color),s(m.height,m.color,b.color)):S?I?(s(m.height,m.color,b.color),o(m.height,A.color)):R?(o(m.height,b.color),o(m.height,m.color)):O?s(m.height,m.color,b.color):(s(m.height,m.color,b.color),o(m.height,m.color)):I?(s(m.height,m.color,b.color),s(m.height,A.color,b.color)):R?(o(m.height,b.color),s(m.height,m.color,b.color)):O?(s(m.height,m.color,b.color),o(m.height,b.color)):s(m.height,m.color,b.color),f+=I?2:1,d+=E?2:1}else if(l(m)&&l(b)&&l(x)&&m.height<b.height){let E=ske(m.height,x,b,Z6t);l(y)?l(A)?s(m.height,m.color,E):(s(m.height,m.color,E),o(m.height,E)):(o(m.height,E),s(m.height,m.color,E)),f++}else if(l(b)&&l(m)&&l(y)&&b.height<m.height){let E=ske(b.height,y,m,J6t);l(x)?l(T)?s(b.height,E,b.color):(s(b.height,E,b.color),o(b.height,E)):(o(b.height,E),s(b.height,E,b.color)),d++}else l(m)&&(!l(b)||m.height<b.height)?(l(b)&&!l(x)&&!l(A)?(o(m.height,m.color),o(m.height,pf._emptyColor),o(b.height,pf._emptyColor)):(!l(b)&&l(x)&&!l(y)&&(o(x.height,pf._emptyColor),o(m.height,pf._emptyColor)),o(m.height,m.color)),f++):l(b)&&(!l(m)||b.height<m.height)&&(o(b.height,b.color),d++)}}return ake(n)}function pf(e){let{scene:t,layers:n}=e??H.EMPTY_OBJECT,{context:i}=t,r=tHt(n),o=r.length,s,a,c;if(!pf._useFloatTexture(i)){a=ze.UNSIGNED_BYTE,c=Ke.RGBA,s=new Uint8Array(o*4);for(let g=0;g<o;g++)se.packFloat(r[g].height,oke),se.pack(oke,s,g*4)}else{a=ze.FLOAT,c=i.webgl2?Ke.RED:Ke.LUMINANCE,s=new Float32Array(o);for(let g=0;g<o;g++)s[g]=r[g].height}let f=Dt.create({context:i,pixelFormat:c,pixelDatatype:a,source:{arrayBufferView:s,width:o,height:1},sampler:new jt({wrapS:hn.CLAMP_TO_EDGE,wrapT:hn.CLAMP_TO_EDGE,minificationFilter:Wt.NEAREST,magnificationFilter:Jn.NEAREST})}),d=new Uint8Array(o*4);for(let g=0;g<o;g++)r[g].color.toBytes(X4),d[g*4+0]=X4[0],d[g*4+1]=X4[1],d[g*4+2]=X4[2],d[g*4+3]=X4[3];let p=Dt.create({context:i,pixelFormat:Ke.RGBA,pixelDatatype:ze.UNSIGNED_BYTE,source:{arrayBufferView:d,width:o,height:1},sampler:new jt({wrapS:hn.CLAMP_TO_EDGE,wrapT:hn.CLAMP_TO_EDGE,minificationFilter:Wt.LINEAR,magnificationFilter:Jn.LINEAR})});return Qi.fromType("ElevationBand",{heights:f,colors:p})}pf._useFloatTexture=function(e){return e.floatingPointTexture};pf._maximumHeight=5906376425472;pf._minimumHeight=-5906376425472;pf._emptyColor=new z(0,0,0,0);var bce=pf;async function nHt(e,t){t=t??{},t.cacheBytes=t.cacheBytes??1536*1024*1024,t.maximumCacheOverflowBytes=t.maximumCacheOverflowBytes??1024*1024*1024,t.enableCollision=t.enableCollision??!0,e=e??H.EMPTY_OBJECT,e.onlyUsingWithGoogleGeocoder||_t("google-tiles-with-google-geocoder","Only the Google geocoder can be used with Google Photorealistic 3D Tiles. Set the `geocode` property of Viewer constructor options. You can set additionalOptions.onlyUsingWithGoogleGeocoder to hide this warning once you have configured the geocoder.");let n=e.key??Ta.defaultApiKey;if(!l(n))return iHt(t);let i,r=Ta.getDefaultCredit();l(r)&&(i=[r]);let o=new De({url:`${Ta.mapTilesApiEndpoint}v1/3dtiles/root.json`,queryParameters:{key:n},credits:i});return Yo.fromUrl(o,t)}var cke={};async function iHt(e){let i=cke[2275207];l(i)||(i=Ho.fromAssetId(2275207),cke[2275207]=i);let r=await i;return Yo.fromUrl(r,e)}var xce=nHt;async function rHt(e){let t=await Yo.fromIonAssetId(96188,e);e=e??H.EMPTY_OBJECT;let n=e.style;if(!l(n)){let i=(e.defaultColor??z.WHITE).toCssColorString();n=new u_({color:`Boolean(\${feature['cesium#color']}) ? color(\${feature['cesium#color']}) : ${i}`})}return t.style=n,t}var Tce=rHt;function oHt(e){e=e??H.EMPTY_OBJECT;let t=[],n=e.geometry;(!l(n.attributes)||!l(n.primitiveType))&&(n=n.constructor.createGeometry(n));let i=n.attributes,r=N.clone(e.modelMatrix??N.IDENTITY),o=e.length??1e4;if(l(i.normal)&&t.push(new Ft({geometry:Hn.createLineSegmentsForVectors(n,"normal",o),attributes:{color:new Jt(1,0,0,1)},modelMatrix:r})),l(i.tangent)&&t.push(new Ft({geometry:Hn.createLineSegmentsForVectors(n,"tangent",o),attributes:{color:new Jt(0,1,0,1)},modelMatrix:r})),l(i.bitangent)&&t.push(new Ft({geometry:Hn.createLineSegmentsForVectors(n,"bitangent",o),attributes:{color:new Jt(0,0,1,1)},modelMatrix:r})),t.length>0)return new On({asynchronous:!1,geometryInstances:t,appearance:new yn({flat:!0,translucent:!1})})}var Ece=oHt;function K4(e){e=e??H.EMPTY_OBJECT;let t=e.attributeName,n=e.perInstanceAttribute;l(n)||(n=!1);let i=e.glslDatatype??"vec3",r=`v_${t}`,o;if(t==="normal"||t==="tangent"||t==="bitangent")o=`vec4 getColor() { return vec4((${r} + vec3(1.0)) * 0.5, 1.0); } -`;else switch(t==="st"&&(i="vec2"),i){case"float":o=`vec4 getColor() { return vec4(vec3(${r}), 1.0); } -`;break;case"vec2":o=`vec4 getColor() { return vec4(${r}, 0.0, 1.0); } -`;break;case"vec3":o=`vec4 getColor() { return vec4(${r}, 1.0); } -`;break;case"vec4":o=`vec4 getColor() { return ${r}; } -`;break}let s=`in vec3 position3DHigh; -in vec3 position3DLow; -in float batchId; -${n?"":`in ${i} ${t}; -`}out ${i} ${r}; -void main() -{ -vec4 p = czm_translateRelativeToEye(position3DHigh, position3DLow); -${n?`${r} = czm_batchTable_${t}(batchId); -`:`${r} = ${t}; -`}gl_Position = czm_modelViewProjectionRelativeToEye * p; -}`,a=`in ${i} ${r}; -${o} -void main() -{ -out_FragColor = getColor(); -}`;this.material=void 0,this.translucent=e.translucent??!1,this._vertexShaderSource=e.vertexShaderSource??s,this._fragmentShaderSource=e.fragmentShaderSource??a,this._renderState=wr.getDefaultRenderState(!1,!1,e.renderState),this._closed=e.closed??!1,this._attributeName=t,this._glslDatatype=i}Object.defineProperties(K4.prototype,{vertexShaderSource:{get:function(){return this._vertexShaderSource}},fragmentShaderSource:{get:function(){return this._fragmentShaderSource}},renderState:{get:function(){return this._renderState}},closed:{get:function(){return this._closed}},attributeName:{get:function(){return this._attributeName}},glslDatatype:{get:function(){return this._glslDatatype}}});K4.prototype.getFragmentShaderSource=wr.prototype.getFragmentShaderSource;K4.prototype.isTranslucent=wr.prototype.isTranslucent;K4.prototype.getRenderState=wr.prototype.getRenderState;var Cce=K4;function VW(e){e=e??H.EMPTY_OBJECT,this.length=e.length??1e7,this._length=void 0,this.width=e.width??2,this._width=void 0,this.show=e.show??!0,this.modelMatrix=N.clone(e.modelMatrix??N.IDENTITY),this._modelMatrix=new N,this.id=e.id,this._id=void 0,this._primitive=void 0}VW.prototype.update=function(e){if(this.show){if(!l(this._primitive)||!N.equals(this._modelMatrix,this.modelMatrix)||this._length!==this.length||this._width!==this.width||this._id!==this.id){this._modelMatrix=N.clone(this.modelMatrix,this._modelMatrix),this._length=this.length,this._width=this.width,this._id=this.id,l(this._primitive)&&this._primitive.destroy(),this.modelMatrix[12]===0&&this.modelMatrix[13]===0&&this.modelMatrix[14]===0&&(this.modelMatrix[14]=.01);let t=new Ft({geometry:new z_({positions:[h.ZERO,h.UNIT_X],width:this.width,vertexFormat:js.VERTEX_FORMAT,colors:[z.RED,z.RED],arcType:ln.NONE}),modelMatrix:N.multiplyByUniformScale(this.modelMatrix,this.length,new N),id:this.id,pickPrimitive:this}),n=new Ft({geometry:new z_({positions:[h.ZERO,h.UNIT_Y],width:this.width,vertexFormat:js.VERTEX_FORMAT,colors:[z.GREEN,z.GREEN],arcType:ln.NONE}),modelMatrix:N.multiplyByUniformScale(this.modelMatrix,this.length,new N),id:this.id,pickPrimitive:this}),i=new Ft({geometry:new z_({positions:[h.ZERO,h.UNIT_Z],width:this.width,vertexFormat:js.VERTEX_FORMAT,colors:[z.BLUE,z.BLUE],arcType:ln.NONE}),modelMatrix:N.multiplyByUniformScale(this.modelMatrix,this.length,new N),id:this.id,pickPrimitive:this});this._primitive=new On({geometryInstances:[t,n,i],appearance:new js,asynchronous:!1})}this._primitive.update(e)}};VW.prototype.isDestroyed=function(){return!1};VW.prototype.destroy=function(){return this._primitive=this._primitive&&this._primitive.destroy(),le(this)};var $4=VW;var sHt=new TextDecoder,jW={UNKNOWN:0,POINT:1,LINESTRING:2,POLYGON:3},aHt={LAYERS:3},J4={NAME:1,FEATURES:2,KEYS:3,VALUES:4,EXTENT:5},vce={TAGS:2,TYPE:3,GEOMETRY:4},WC={STRING:1,FLOAT:2,DOUBLE:3,INT64:4,UINT64:5,SINT64:6,BOOL:7},cHt=["Unknown","Point","LineString","Polygon"];function lHt(e){let t=new Uint8Array(e),n=[],i=0;for(;i<t.length;){let r=HW(t,i,t.length),o=r.fieldNumber,s=r.wireType;if(i=r.newPos,o===aHt.LAYERS&&s===2){let a=Ay(t,i,t.length);i=a.newPos;let c=gf(i,a.value,t.length,"layer");n.push(uHt(t,i,c)),i=c}else i=GW(t,i,s,t.length)}return{layers:n}}function uHt(e,t,n){let i=t,r="",o=4096,s=[],a=[],c=[];for(;i<n;){let f=HW(e,i,n),d=f.fieldNumber,p=f.wireType;if(i=f.newPos,d===J4.NAME&&p===2){let g=Ay(e,i,n);i=g.newPos;let m=gf(i,g.value,n,"layer name");r=wce(e,i,g.value),i=m}else if(d===J4.FEATURES&&p===2){let g=Ay(e,i,n);i=g.newPos;let m=gf(i,g.value,n,"feature");c.push({start:i,end:m}),i=m}else if(d===J4.KEYS&&p===2){let g=Ay(e,i,n);i=g.newPos;let m=gf(i,g.value,n,"key");s.push(wce(e,i,g.value)),i=m}else if(d===J4.VALUES&&p===2){let g=Ay(e,i,n);i=g.newPos;let m=gf(i,g.value,n,"value"),y=hHt(e,i,m);a.push(y),i=m}else if(d===J4.EXTENT&&p===0){let g=GP(e,i,n);o=g.value,i=g.newPos}else i=GW(e,i,p,n)}let u=c.map(({start:f,end:d})=>fHt(e,f,d,s,a));return{name:r,extent:o,features:u}}function fHt(e,t,n,i,r){let o=t,s=jW.UNKNOWN,a=[],c=[];for(;o<n;){let d=HW(e,o,n),p=d.fieldNumber,g=d.wireType;if(o=d.newPos,p===vce.TYPE&&g===0){let m=GP(e,o,n);s=m.value,o=m.newPos}else if(p===vce.TAGS&&g===2){let m=Ay(e,o,n);o=m.newPos;let y=gf(o,m.value,n,"feature tags");for(;o<y;){let A=GP(e,o,y);a.push(A.value),o=A.newPos}}else if(p===vce.GEOMETRY&&g===2){let m=Ay(e,o,n);o=m.newPos;let y=gf(o,m.value,n,"feature geometry");for(;o<y;){let A=GP(e,o,y);c.push(A.value),o=A.newPos}}else o=GW(e,o,g,n)}let u={};for(let d=0;d<a.length-1;d+=2){let p=i[a[d]],g=r[a[d+1]];typeof p!="string"||g===void 0||(u[p]=g)}let f=dHt(s,c);return{type:cHt[s]??"Unknown",geometry:f,properties:u}}function dHt(e,t){let n=0,i=0,r=0;if(e===jW.POINT){let o=[];for(;n<t.length;){let s=t[n++],a=s&7,c=s>>3;if(a===1)for(let u=0;u<c;u++)i+=K0(t[n++]),r+=K0(t[n++]),o.push({x:i,y:r})}return o}if(e===jW.LINESTRING){let o=[],s=null;for(;n<t.length;){let a=t[n++],c=a&7,u=a>>3;if(c===1)s!==null&&o.push(s),s=[],i+=K0(t[n++]),r+=K0(t[n++]),s.push({x:i,y:r});else if(c===2)for(let f=0;f<u;f++)i+=K0(t[n++]),r+=K0(t[n++]),s.push({x:i,y:r})}return s!==null&&o.push(s),o}if(e===jW.POLYGON){let o=[],s=null;for(;n<t.length;){let a=t[n++],c=a&7,u=a>>3;if(c===1)s!==null&&o.push(s),s=[],i+=K0(t[n++]),r+=K0(t[n++]),s.push({x:i,y:r});else if(c===2)for(let f=0;f<u;f++)i+=K0(t[n++]),r+=K0(t[n++]),s.push({x:i,y:r});else c===7&&s!==null&&s.length>0&&(s.push({x:s[0].x,y:s[0].y}),o.push(s),s=null)}return s!==null&&o.push(s),o}return[]}function hHt(e,t,n){let i=t;for(;i<n;){let r=HW(e,i,n),o=r.fieldNumber,s=r.wireType;if(i=r.newPos,o===WC.STRING&&s===2){let a=Ay(e,i,n);i=a.newPos;let c=gf(i,a.value,n,"string value");return wce(e,i,c-i)}else{if(o===WC.FLOAT&&s===5)return gf(i,4,n,"float value"),new DataView(e.buffer,e.byteOffset+i,4).getFloat32(0,!0);if(o===WC.DOUBLE&&s===1)return gf(i,8,n,"double value"),new DataView(e.buffer,e.byteOffset+i,8).getFloat64(0,!0);if(o===WC.INT64&&s===0){let a=WP(e,i,n);return Sce(a.value)}else if(o===WC.UINT64&&s===0){let a=WP(e,i,n);return Sce(a.value)}else if(o===WC.SINT64&&s===0){let a=WP(e,i,n);return Sce(mHt(a.value))}else if(o===WC.BOOL&&s===0)return GP(e,i,n).value!==0}i=GW(e,i,s,n)}}function HW(e,t,n){let i=GP(e,t,n);return{fieldNumber:i.value>>>3,wireType:i.value&7,newPos:i.newPos}}function GP(e,t,n){let i=WP(e,t,n,5);if(i.value>0xffffffffn)throw new oe("Invalid MVT uint32 varint.");return{value:Number(i.value),newPos:i.newPos}}function Ay(e,t,n){let i=WP(e,t,n);if(i.value>BigInt(Number.MAX_SAFE_INTEGER))throw new oe("Invalid MVT length varint.");return{value:Number(i.value),newPos:i.newPos}}function WP(e,t,n,i){let r=0n,o=0n,s=0,a=i??10;for(;;){if(t>=n||t>=e.length)throw new oe("Invalid MVT: truncated varint.");let c=e[t++];if(r|=BigInt(c&127)<<o,s++,(c&128)===0)break;if(s>=a)throw new oe("Invalid MVT: varint is too long.");o+=7n}return{value:r,newPos:t}}function wce(e,t,n){let i=gf(t,n,e.length,"string");return sHt.decode(e.subarray(t,i))}function gf(e,t,n,i){if(!Number.isFinite(t)||t<0)throw new oe(`Invalid MVT ${i}: invalid length.`);let r=e+t;if(!Number.isFinite(r)||r<e||r>n)throw new oe(`Invalid MVT ${i}: length exceeds available bytes.`);return r}function GW(e,t,n,i){if(n===0)return WP(e,t,i).newPos;if(n===1)return gf(t,8,i,"fixed64 field");if(n===2){let r=Ay(e,t,i);return gf(r.newPos,r.value,i,"length-delimited field")}else if(n===5)return gf(t,4,i,"fixed32 field");throw new oe(`Unsupported protobuf wire type: ${n}`)}function K0(e){return e>>>1^-(e&1)}function mHt(e){return e>>1n^-(e&1n)}function Sce(e){return e<=BigInt(Number.MAX_SAFE_INTEGER)&&e>=BigInt(Number.MIN_SAFE_INTEGER)?Number(e):e}var Z4=lHt;function pHt(e){this.direction=h.clone(e.direction),this.color=z.clone(e.color??z.WHITE),this.intensity=e.intensity??1}var Ice=pHt;var Q4=`in vec3 v_positionMC; +${m}`);let y=document.createElement("div");y.className="cesium-widget-errorPanel-message-details collapsed";let A=document.createElement("span");A.className="cesium-widget-errorPanel-more-details",A.appendChild(document.createTextNode("See more...")),y.appendChild(A),y.onclick=function(b){y.removeChild(A),y.appendChild(document.createTextNode(m)),y.className="cesium-widget-errorPanel-message-details",o.className="cesium-widget-errorPanel-content expanded",y.onclick=void 0},a.appendChild(y)}g.innerHTML=`<p>${t}</p>`}let d=document.createElement("div");d.className="cesium-widget-errorPanel-buttonPanel",o.appendChild(d);let p=document.createElement("button");p.setAttribute("type","button"),p.className="cesium-button",p.appendChild(document.createTextNode("OK")),p.onclick=function(){l(c)&&l(window.removeEventListener)&&window.removeEventListener("resize",c,!1),i.removeChild(r)},d.appendChild(p),i.appendChild(r)};Hr.prototype.isDestroyed=function(){return!1};Hr.prototype.destroy=function(){let e=this.dataSources,t=e.length;for(let n=0;n<t;n++)this._dataSourceRemoved(e,e.get(n));this._dataSourceRemoved(void 0,this._dataSourceDisplay.defaultDataSource),this._dataSourceDisplay=this._dataSourceDisplay.destroy(),l(this._scene)&&(this._scene.renderError.removeEventListener(this._onRenderError),this._scene=this._scene.destroy()),this._container.removeChild(this._element),this._creditContainer.removeChild(this._innerCreditContainer),this._eventHelper.removeAll(),this._destroyDataSourceCollection&&(this._dataSourceCollection=this._dataSourceCollection.destroy()),le(this)};Hr.prototype.resize=function(){let e=this._canvas;!this._forceResize&&this._canvasClientWidth===e.clientWidth&&this._canvasClientHeight===e.clientHeight&&this._lastDevicePixelRatio===window.devicePixelRatio||(this._forceResize=!1,WRe(this),qRe(this),this._scene.requestRender())};Hr.prototype.render=function(){if(this._canRender){this._scene.initializeFrame();let e=this._clock.tick();this._scene.render(e)}else this._clock.tick()};Hr.prototype._dataSourceAdded=function(e,t){t.entities.collectionChanged.addEventListener(Hr.prototype._onEntityCollectionChanged,this)};Hr.prototype._dataSourceRemoved=function(e,t){let n=t.entities;n.collectionChanged.removeEventListener(Hr.prototype._onEntityCollectionChanged,this),l(this.trackedEntity)&&n.getById(this.trackedEntity.id)===this.trackedEntity&&(this.trackedEntity=void 0)};Hr.prototype._updateCanAnimate=function(e){this._clock.canAnimate=e};var tLt=new ue;Hr.prototype._onTick=function(e){let t=e.currentTime,n=this._dataSourceDisplay.update(t);this._allowDataSourcesToSuspendAnimation&&this._canAnimateUpdateCallback(n);let i=this._entityView;if(l(i)){let r=this._trackedEntity;this._dataSourceDisplay.getBoundingSphere(r,!1,i.boundingSphere??tLt)===Pt.DONE&&i.update(t)}};Hr.prototype._onEntityCollectionChanged=function(e,t,n){let i=n.length;for(let r=0;r<i;r++){let o=n[r];this.trackedEntity===o&&(this.trackedEntity=void 0)}};Hr.prototype._clearTrackedObject=function(){this.trackedEntity=void 0};Hr.prototype._onDataSourceChanged=function(e){this.clockTrackedDataSource===e&&HRe(this.clock,e)};Hr.prototype._onDataSourceAdded=function(e,t){this._automaticallyTrackDataSourceClocks&&(this.clockTrackedDataSource=t);let n=t.entities.id,i=this._eventHelper.add(t.changedEvent,Hr.prototype._onDataSourceChanged,this);this._dataSourceChangedListeners[n]=i};Hr.prototype._onDataSourceRemoved=function(e,t){let n=this.clockTrackedDataSource===t,i=t.entities.id;if(this._dataSourceChangedListeners[i](),this._dataSourceChangedListeners[i]=void 0,n){let r=e.length;this._automaticallyTrackDataSourceClocks&&r>0?this.clockTrackedDataSource=e.get(r-1):this.clockTrackedDataSource=void 0}};Hr.prototype.addController=function(e){return this.scene.controllerHost.registerController(e,this.container)};Hr.prototype.removeController=function(e){return this.scene.controllerHost.unregisterController(e,this.container)};Hr.prototype.zoomTo=function(e,t){return YRe(this,e,{offset:t},!1)};Hr.prototype.flyTo=function(e,t){return YRe(this,e,t,!0)};function YRe(e,t,n,i){wie(e);let r=new Promise(o=>{e._completeZoom=function(s){o(s)}});return e._zoomPromise=r,e._zoomIsFlight=i,e._zoomOptions=n,Promise.resolve(t).then(function(o){if(e._zoomPromise===r){if(o instanceof Is){let s;l(o.imageryProvider)?s=Promise.resolve(o.getImageryRectangle()):s=new Promise(a=>{let c=o.readyEvent.addEventListener(()=>{c(),a(o.getImageryRectangle())})}),s.then(function(a){return TE(a,e.scene)}).then(function(a){e._zoomPromise===r&&(e._zoomTarget=a)});return}if(o instanceof Xo||o instanceof SI||o instanceof pb||o instanceof ra){e._zoomTarget=o;return}if(o.isLoading&&l(o.loadingEvent)){let s=o.loadingEvent.addEventListener(function(){s(),e._zoomPromise===r&&(e._zoomTarget=o.entities.values.slice(0))});return}if(Array.isArray(o)){e._zoomTarget=o.slice(0);return}o=o.values??o,l(o.entities)&&(o=o.entities.values),Array.isArray(o)?e._zoomTarget=o.slice(0):e._zoomTarget=[o]}}),e.scene.requestRender(),r}function _V(e){e._zoomPromise=void 0,e._zoomTarget=void 0,e._zoomOptions=void 0}function wie(e){let t=e._zoomPromise;l(t)&&(_V(e),e._completeZoom(!1))}Hr.prototype._postRender=function(){nLt(this),iLt(this)};var VRe=new ue;function nLt(e){let t=e._zoomTarget;if(!l(t)||e.scene.mode===re.MORPHING)return;let n=e.scene,i=n.camera,r=e._zoomOptions??{},o;function s(f){l(r.offset)||(r.offset=new Od(0,-.5,f.radius)),o={offset:r.offset,duration:r.duration,maximumHeight:r.maximumHeight,complete:function(){e._completeZoom(!0)},cancel:function(){e._completeZoom(!1)}},e._zoomIsFlight?i.flyToBoundingSphere(f,o):(i.viewBoundingSphere(f,r.offset),i.lookAtTransform(N.IDENTITY),e._completeZoom(!0)),_V(e)}if(t instanceof SI){if(l(t.boundingSphere)){s(t.boundingSphere);return}let f=t.frameChanged.addEventListener(function(d){s(d.boundingSphere),f()});return}if(t instanceof Xo||t instanceof pb){s(t.boundingSphere);return}if(t instanceof ra){s(t.boundingVolume);return}if(t instanceof he){o={destination:n.ellipsoid.cartographicToCartesian(t),duration:r.duration,maximumHeight:r.maximumHeight,complete:function(){e._completeZoom(!0)},cancel:function(){e._completeZoom(!1)}},e._zoomIsFlight?i.flyTo(o):(i.setView(o),e._completeZoom(!0)),_V(e);return}let a=t,c=[];for(let f=0,d=a.length;f<d;f++){let p=e._dataSourceDisplay.getBoundingSphere(a[f],!1,VRe);if(p===Pt.PENDING)return;p!==Pt.FAILED&&c.push(ue.clone(VRe))}if(c.length===0){wie(e);return}e.trackedEntity=void 0;let u=ue.fromBoundingSpheres(c);e._zoomIsFlight?(_V(e),i.flyToBoundingSphere(u,{duration:r.duration,maximumHeight:r.maximumHeight,complete:function(){e._completeZoom(!0)},cancel:function(){e._completeZoom(!1)},offset:r.offset})):(i.viewBoundingSphere(u,r.offset),i.lookAtTransform(N.IDENTITY),_V(e),e._completeZoom(!0))}var jRe=new ue;function iLt(e){if(!e._needTrackedEntityUpdate)return;let t=e._trackedEntity,n=e.clock.currentTime,i=X.getValueOrUndefined(t.position,n);if(!l(i))return;let r=e.scene,o=e._dataSourceDisplay.getBoundingSphere(t,!1,jRe);if(o===Pt.PENDING)return;let s=r.mode;(s===re.COLUMBUS_VIEW||s===re.SCENE2D)&&(r.screenSpaceCameraController.enableTranslate=!1),(s===re.COLUMBUS_VIEW||s===re.SCENE3D)&&(r.screenSpaceCameraController.enableTilt=!1);let a=o!==Pt.FAILED?jRe:void 0;e._entityView=new M3(t,r,r.ellipsoid),e._entityView.update(n,a),e._needTrackedEntityUpdate=!1}var yV=Hr;var rLt=z.WHITE,oLt=z.BLACK,sLt=new U(2,2);function wI(e){e=e??H.EMPTY_OBJECT,this._definitionChanged=new be,this._evenColor=void 0,this._evenColorSubscription=void 0,this._oddColor=void 0,this._oddColorSubscription=void 0,this._repeat=void 0,this._repeatSubscription=void 0,this.evenColor=e.evenColor,this.oddColor=e.oddColor,this.repeat=e.repeat}Object.defineProperties(wI.prototype,{isConstant:{get:function(){return X.isConstant(this._evenColor)&&X.isConstant(this._oddColor)&&X.isConstant(this._repeat)}},definitionChanged:{get:function(){return this._definitionChanged}},evenColor:me("evenColor"),oddColor:me("oddColor"),repeat:me("repeat")});wI.prototype.getType=function(e){return"Checkerboard"};var aLt=new K;wI.prototype.getValue=function(e,t){return l(e)||(e=K.now(aLt)),l(t)||(t={}),t.lightColor=X.getValueOrClonedDefault(this._evenColor,e,rLt,t.lightColor),t.darkColor=X.getValueOrClonedDefault(this._oddColor,e,oLt,t.darkColor),t.repeat=X.getValueOrDefault(this._repeat,e,sLt),t};wI.prototype.equals=function(e){return this===e||e instanceof wI&&X.equals(this._evenColor,e._evenColor)&&X.equals(this._oddColor,e._oddColor)&&X.equals(this._repeat,e._repeat)};var II=wI;var l9={id:void 0},PI=new Array(2);function Iie(e){let t=e.propertyNames,n=t.length;for(let i=0;i<n;i++)e[t[i]]=void 0;e._name=void 0,e._availability=void 0}function XRe(e,t,n,i){PI[0]=n,PI[1]=i.id,t[JSON.stringify(PI)]=i.definitionChanged.addEventListener(Ms.prototype._onDefinitionChanged,e)}function KRe(e,t,n,i){PI[0]=n,PI[1]=i.id;let r=JSON.stringify(PI);t[r](),t[r]=void 0}function _b(e){if(e._shouldRecomposite=!0,e._suspendCount!==0)return;let t=e._collections,n=t.length,i=e._collectionsCopy,r=i.length,o,s,a,c,u,f=e._composite,d=new Ua(e),p=e._eventHash,g;for(o=0;o<r;o++)for(u=i[o],u.collectionChanged.removeEventListener(Ms.prototype._onCollectionChanged,e),a=u.values,g=u.id,c=a.length-1;c>-1;c--)s=a[c],KRe(e,p,g,s);for(o=n-1;o>=0;o--)for(u=t[o],u.collectionChanged.addEventListener(Ms.prototype._onCollectionChanged,e),a=u.values,g=u.id,c=a.length-1;c>-1;c--){s=a[c],XRe(e,p,g,s);let y=d.getById(s.id);l(y)||(y=f.getById(s.id),l(y)?Iie(y):(l9.id=s.id,y=new Jr(l9)),d.add(y)),y.merge(s)}e._collectionsCopy=t.slice(0),f.suspendEvents(),f.removeAll();let m=d.values;for(o=0;o<m.length;o++)f.add(m[o]);f.resumeEvents()}function Ms(e,t){this._owner=t,this._composite=new Ua(this),this._suspendCount=0,this._collections=l(e)?e.slice():[],this._collectionsCopy=[],this._id=Kn(),this._eventHash={},_b(this),this._shouldRecomposite=!1}Object.defineProperties(Ms.prototype,{collectionChanged:{get:function(){return this._composite._collectionChanged}},id:{get:function(){return this._id}},values:{get:function(){return this._composite.values}},owner:{get:function(){return this._owner}}});Ms.prototype.addCollection=function(e,t){l(t)?this._collections.splice(t,0,e):this._collections.push(e),_b(this)};Ms.prototype.removeCollection=function(e){let t=this._collections.indexOf(e);return t!==-1?(this._collections.splice(t,1),_b(this),!0):!1};Ms.prototype.removeAllCollections=function(){this._collections.length=0,_b(this)};Ms.prototype.containsCollection=function(e){return this._collections.indexOf(e)!==-1};Ms.prototype.contains=function(e){return this._composite.contains(e)};Ms.prototype.indexOfCollection=function(e){return this._collections.indexOf(e)};Ms.prototype.getCollection=function(e){return this._collections[e]};Ms.prototype.getCollectionsLength=function(){return this._collections.length};function u9(e,t){return e.indexOf(t)}function $Re(e,t,n){let i=e._collections;if(t=D.clamp(t,0,i.length-1),n=D.clamp(n,0,i.length-1),t===n)return;let r=i[t];i[t]=i[n],i[n]=r,_b(e)}Ms.prototype.raiseCollection=function(e){let t=u9(this._collections,e);$Re(this,t,t+1)};Ms.prototype.lowerCollection=function(e){let t=u9(this._collections,e);$Re(this,t,t-1)};Ms.prototype.raiseCollectionToTop=function(e){let t=u9(this._collections,e);t!==this._collections.length-1&&(this._collections.splice(t,1),this._collections.push(e),_b(this))};Ms.prototype.lowerCollectionToBottom=function(e){let t=u9(this._collections,e);t!==0&&(this._collections.splice(t,1),this._collections.splice(0,0,e),_b(this))};Ms.prototype.suspendEvents=function(){this._suspendCount++,this._composite.suspendEvents()};Ms.prototype.resumeEvents=function(){this._suspendCount--,this._shouldRecomposite&&this._suspendCount===0&&(_b(this),this._shouldRecomposite=!1),this._composite.resumeEvents()};Ms.prototype.computeAvailability=function(){return this._composite.computeAvailability()};Ms.prototype.getById=function(e){return this._composite.getById(e)};Ms.prototype._onCollectionChanged=function(e,t,n){let i=this._collectionsCopy,r=i.length,o=this._composite;o.suspendEvents();let s,a,c,u,f=n.length,d=this._eventHash,p=e.id;for(s=0;s<f;s++){let m=n[s];KRe(this,d,p,m);let y=m.id;for(a=r-1;a>=0;a--)c=i[a].getById(y),l(c)&&(l(u)||(u=o.getById(y),Iie(u)),u.merge(c));l(u)||o.removeById(y),u=void 0}let g=t.length;for(s=0;s<g;s++){let m=t[s];XRe(this,d,p,m);let y=m.id;for(a=r-1;a>=0;a--)c=i[a].getById(y),l(c)&&(l(u)||(u=o.getById(y),l(u)?Iie(u):(l9.id=y,u=new Jr(l9),o.add(u))),u.merge(c));u=void 0}o.resumeEvents()};Ms.prototype._onDefinitionChanged=function(e,t,n,i){let r=this._collections,o=this._composite,s=r.length,a=e.id,c=o.getById(a),u=c[t],f=!l(u),d=!0;for(let p=s-1;p>=0;p--){let g=r[p].getById(e.id);if(l(g)){let m=g[t];if(l(m)){if(d)if(d=!1,l(m.merge)&&l(m.clone))u=m.clone(u);else{u=m;break}u.merge(m)}}}f&&c.propertyNames.indexOf(t)===-1&&c.addProperty(t),c[t]=u};var Pie=Ms;function yb(){this._definitionChanged=new be,this._composite=new Al,this._composite.definitionChanged.addEventListener(yb.prototype._raiseDefinitionChanged,this)}Object.defineProperties(yb.prototype,{isConstant:{get:function(){return this._composite.isConstant}},definitionChanged:{get:function(){return this._definitionChanged}},intervals:{get:function(){return this._composite._intervals}}});yb.prototype.getType=function(e){let t=this._composite._intervals.findDataForIntervalContainingDate(e);if(l(t))return t.getType(e)};var cLt=new K;yb.prototype.getValue=function(e,t){l(e)||(e=K.now(cLt));let n=this._composite._intervals.findDataForIntervalContainingDate(e);if(l(n))return n.getValue(e,t)};yb.prototype.equals=function(e){return this===e||e instanceof yb&&this._composite.equals(e._composite,X.equals)};yb.prototype._raiseDefinitionChanged=function(){this._definitionChanged.raiseEvent(this)};var DI=yb;var JRe=Qo(Tf(),1);function lLt(e){let t=new JRe.default(e);t.normalize();let n=t.path(),i=n.lastIndexOf("/");return i!==-1&&(n=n.substr(i+1)),n}var $_=lLt;var uLt=D.factorial;function Die(e,t,n,i,r,o){let s=0,a,c,u;if(i>0){for(c=0;c<r;c++){for(a=!1,u=0;u<o.length&&!a;u++)c===o[u]&&(a=!0);a||(o.push(c),s+=Die(e,t,n,i-1,r,o),o.splice(o.length-1,1))}return s}for(s=1,c=0;c<r;c++){for(a=!1,u=0;u<o.length&&!a;u++)c===o[u]&&(a=!0);a||(s*=e-n[t[c]])}return s}var fLt=[],Rie=class{static get type(){return"Hermite"}static getRequiredDataPoints(t,n){return n=n??0,Math.max(Math.floor((t+1)/(n+1)),2)}static interpolateOrderZero(t,n,i,r,o){l(o)||(o=new Array(r));let s,a,c,u,f,d,p=n.length,g=new Array(r);for(s=0;s<r;s++){o[s]=0;let b=new Array(p);for(g[s]=b,a=0;a<p;a++)b[a]=[]}let m=p,y=new Array(m);for(s=0;s<m;s++)y[s]=s;let A=p-1;for(u=0;u<r;u++){for(a=0;a<m;a++)d=y[a]*r+u,g[u][0].push(i[d]);for(s=1;s<m;s++){let b=!1;for(a=0;a<m-s;a++){let x=n[y[a]],T=n[y[a+s]],E;T-x<=0?(d=y[a]*r+r*s+u,E=i[d],g[u][s].push(E/uLt(s))):(E=g[u][s-1][a+1]-g[u][s-1][a],g[u][s].push(E/(T-x))),b=b||E!==0}b||(A=s-1)}}for(c=0,f=0;c<=f;c++)for(s=c;s<=A;s++){let b=Die(t,y,n,c,s,[]);for(u=0;u<r;u++){let x=g[u][s][0];o[u+c*r]+=x*b}}return o}static interpolate(t,n,i,r,o,s,a){let c=r*(s+1);l(a)||(a=new Array(c));for(let x=0;x<c;x++)a[x]=0;let u=n.length,f=new Array(u*(o+1)),d;for(d=0;d<u;d++)for(let x=0;x<o+1;x++)f[d*(o+1)+x]=d;let p=f.length,g=fLt,m=dLt(g,f,n,i,r,o),y=[],A=p*(p+1)/2,b=Math.min(m,s);for(let x=0;x<=b;x++)for(d=x;d<=m;d++){y.length=0;let T=Die(t,f,n,x,d,y),E=Math.floor(d*(1-d)/2)+p*d;for(let v=0;v<r;v++){let S=Math.floor(v*A),I=g[S+E];a[v+x*r]+=I*T}}return a}};function dLt(e,t,n,i,r,o){let s,a,c=-1,u=t.length,f=u*(u+1)/2;for(let d=0;d<r;d++){let p=Math.floor(d*f);for(s=0;s<u;s++)a=t[s]*r*(o+1)+d,e[p+s]=i[a];for(let g=1;g<u;g++){let m=0,y=Math.floor(g*(1-g)/2)+u*g,A=!1;for(s=0;s<u-g;s++){let b=n[t[s]],x=n[t[s+g]],T,E;if(x-b<=0)a=t[s]*r*(o+1)+r*g+d,T=i[a],E=T/D.factorial(g),e[p+y+m]=E,m++;else{let v=Math.floor((g-1)*(2-g)/2)+u*(g-1);T=e[p+v+s+1]-e[p+v+s],E=T/(x-b),e[p+y+m]=E,m++}A=A||T!==0}A&&(c=Math.max(c,g))}}return c}var AV=Rie;var Oie=class{static get type(){return"Lagrange"}static getRequiredDataPoints(t){return Math.max(t+1,2)}static interpolateOrderZero(t,n,i,r,o){l(o)||(o=new Array(r));let s,a,c=n.length;for(s=0;s<r;s++)o[s]=0;for(s=0;s<c;s++){let u=1;for(a=0;a<c;a++)if(a!==s){let f=n[s]-n[a];u*=(t-n[a])/f}for(a=0;a<r;a++)o[a]+=u*i[s*r+a]}return o}},bV=Oie;function vl(e,t,n){this.clock=e??0,this.cone=t??0,this.magnitude=n??1}vl.fromCartesian3=function(e,t){let n=e.x,i=e.y,r=e.z,o=n*n+i*i;return l(t)||(t=new vl),t.clock=Math.atan2(i,n),t.cone=Math.atan2(Math.sqrt(o),r),t.magnitude=Math.sqrt(o+r*r),t};vl.clone=function(e,t){if(l(e))return l(t)?(t.clock=e.clock,t.cone=e.cone,t.magnitude=e.magnitude,t):new vl(e.clock,e.cone,e.magnitude)};vl.normalize=function(e,t){return l(t)?(t.clock=e.clock,t.cone=e.cone,t.magnitude=1,t):new vl(e.clock,e.cone,1)};vl.equals=function(e,t){return e===t||l(e)&&l(t)&&e.clock===t.clock&&e.cone===t.cone&&e.magnitude===t.magnitude};vl.equalsEpsilon=function(e,t,n){return n=n??0,e===t||l(e)&&l(t)&&Math.abs(e.clock-t.clock)<=n&&Math.abs(e.cone-t.cone)<=n&&Math.abs(e.magnitude-t.magnitude)<=n};vl.prototype.equals=function(e){return vl.equals(this,e)};vl.prototype.clone=function(e){return vl.clone(this,e)};vl.prototype.equalsEpsilon=function(e,t){return vl.equalsEpsilon(this,e,t)};vl.prototype.toString=function(){return`(${this.clock}, ${this.cone}, ${this.magnitude})`};var xV=vl;var SV=Qo(Tf(),1);function rC(){this._definitionChanged=new be,this._startTime=void 0,this._stopTime=void 0,this._currentTime=void 0,this._clockRange=void 0,this._clockStep=void 0,this._multiplier=void 0}Object.defineProperties(rC.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},startTime:$l("startTime"),stopTime:$l("stopTime"),currentTime:$l("currentTime"),clockRange:$l("clockRange"),clockStep:$l("clockStep"),multiplier:$l("multiplier")});rC.prototype.clone=function(e){return l(e)||(e=new rC),e.startTime=this.startTime,e.stopTime=this.stopTime,e.currentTime=this.currentTime,e.clockRange=this.clockRange,e.clockStep=this.clockStep,e.multiplier=this.multiplier,e};rC.prototype.equals=function(e){return this===e||l(e)&&K.equals(this.startTime,e.startTime)&&K.equals(this.stopTime,e.stopTime)&&K.equals(this.currentTime,e.currentTime)&&this.clockRange===e.clockRange&&this.clockStep===e.clockStep&&this.multiplier===e.multiplier};rC.prototype.merge=function(e){this.startTime=this.startTime??e.startTime,this.stopTime=this.stopTime??e.stopTime,this.currentTime=this.currentTime??e.currentTime,this.clockRange=this.clockRange??e.clockRange,this.clockStep=this.clockStep??e.clockStep,this.multiplier=this.multiplier??e.multiplier};rC.prototype.getValue=function(e){return l(e)||(e=new Xh),e.startTime=this.startTime??e.startTime,e.stopTime=this.stopTime??e.stopTime,e.currentTime=this.currentTime??e.currentTime,e.clockRange=this.clockRange??e.clockRange,e.multiplier=this.multiplier??e.multiplier,e.clockStep=this.clockStep??e.clockStep,e};var Zm=rC;var hLt=z.WHITE,mLt=.1,pLt=new U(8,8),gLt=new U(0,0),_Lt=new U(1,1);function RI(e){e=e??H.EMPTY_OBJECT,this._definitionChanged=new be,this._color=void 0,this._colorSubscription=void 0,this._cellAlpha=void 0,this._cellAlphaSubscription=void 0,this._lineCount=void 0,this._lineCountSubscription=void 0,this._lineThickness=void 0,this._lineThicknessSubscription=void 0,this._lineOffset=void 0,this._lineOffsetSubscription=void 0,this.color=e.color,this.cellAlpha=e.cellAlpha,this.lineCount=e.lineCount,this.lineThickness=e.lineThickness,this.lineOffset=e.lineOffset}Object.defineProperties(RI.prototype,{isConstant:{get:function(){return X.isConstant(this._color)&&X.isConstant(this._cellAlpha)&&X.isConstant(this._lineCount)&&X.isConstant(this._lineThickness)&&X.isConstant(this._lineOffset)}},definitionChanged:{get:function(){return this._definitionChanged}},color:me("color"),cellAlpha:me("cellAlpha"),lineCount:me("lineCount"),lineThickness:me("lineThickness"),lineOffset:me("lineOffset")});RI.prototype.getType=function(e){return"Grid"};var yLt=new K;RI.prototype.getValue=function(e,t){return l(e)||(e=K.now(yLt)),l(t)||(t={}),t.color=X.getValueOrClonedDefault(this._color,e,hLt,t.color),t.cellAlpha=X.getValueOrDefault(this._cellAlpha,e,mLt),t.lineCount=X.getValueOrClonedDefault(this._lineCount,e,pLt,t.lineCount),t.lineThickness=X.getValueOrClonedDefault(this._lineThickness,e,_Lt,t.lineThickness),t.lineOffset=X.getValueOrClonedDefault(this._lineOffset,e,gLt,t.lineOffset),t};RI.prototype.equals=function(e){return this===e||e instanceof RI&&X.equals(this._color,e._color)&&X.equals(this._cellAlpha,e._cellAlpha)&&X.equals(this._lineCount,e._lineCount)&&X.equals(this._lineThickness,e._lineThickness)&&X.equals(this._lineOffset,e._lineOffset)};var OI=RI;function MI(e){this._definitionChanged=new be,this._color=void 0,this._colorSubscription=void 0,this.color=e}Object.defineProperties(MI.prototype,{isConstant:{get:function(){return X.isConstant(this._color)}},definitionChanged:{get:function(){return this._definitionChanged}},color:me("color")});MI.prototype.getType=function(e){return"PolylineArrow"};var ALt=new K;MI.prototype.getValue=function(e,t){return l(e)||(e=K.now(ALt)),l(t)||(t={}),t.color=X.getValueOrClonedDefault(this._color,e,z.WHITE,t.color),t};MI.prototype.equals=function(e){return this===e||e instanceof MI&&X.equals(this._color,e._color)};var NI=MI;var bLt=z.WHITE,xLt=z.TRANSPARENT,TLt=16,ELt=255;function LI(e){e=e??H.EMPTY_OBJECT,this._definitionChanged=new be,this._color=void 0,this._colorSubscription=void 0,this._gapColor=void 0,this._gapColorSubscription=void 0,this._dashLength=void 0,this._dashLengthSubscription=void 0,this._dashPattern=void 0,this._dashPatternSubscription=void 0,this.color=e.color,this.gapColor=e.gapColor,this.dashLength=e.dashLength,this.dashPattern=e.dashPattern}Object.defineProperties(LI.prototype,{isConstant:{get:function(){return X.isConstant(this._color)&&X.isConstant(this._gapColor)&&X.isConstant(this._dashLength)&&X.isConstant(this._dashPattern)}},definitionChanged:{get:function(){return this._definitionChanged}},color:me("color"),gapColor:me("gapColor"),dashLength:me("dashLength"),dashPattern:me("dashPattern")});LI.prototype.getType=function(e){return"PolylineDash"};var CLt=new K;LI.prototype.getValue=function(e,t){return l(e)||(e=K.now(CLt)),l(t)||(t={}),t.color=X.getValueOrClonedDefault(this._color,e,bLt,t.color),t.gapColor=X.getValueOrClonedDefault(this._gapColor,e,xLt,t.gapColor),t.dashLength=X.getValueOrDefault(this._dashLength,e,TLt,t.dashLength),t.dashPattern=X.getValueOrDefault(this._dashPattern,e,ELt,t.dashPattern),t};LI.prototype.equals=function(e){return this===e||e instanceof LI&&X.equals(this._color,e._color)&&X.equals(this._gapColor,e._gapColor)&&X.equals(this._dashLength,e._dashLength)&&X.equals(this._dashPattern,e._dashPattern)};var FI=LI;var vLt=z.WHITE,SLt=.25,wLt=1;function BI(e){e=e??H.EMPTY_OBJECT,this._definitionChanged=new be,this._color=void 0,this._colorSubscription=void 0,this._glowPower=void 0,this._glowPowerSubscription=void 0,this._taperPower=void 0,this._taperPowerSubscription=void 0,this.color=e.color,this.glowPower=e.glowPower,this.taperPower=e.taperPower}Object.defineProperties(BI.prototype,{isConstant:{get:function(){return X.isConstant(this._color)&&X.isConstant(this._glow)}},definitionChanged:{get:function(){return this._definitionChanged}},color:me("color"),glowPower:me("glowPower"),taperPower:me("taperPower")});BI.prototype.getType=function(e){return"PolylineGlow"};var ILt=new K;BI.prototype.getValue=function(e,t){return l(e)||(e=K.now(ILt)),l(t)||(t={}),t.color=X.getValueOrClonedDefault(this._color,e,vLt,t.color),t.glowPower=X.getValueOrDefault(this._glowPower,e,SLt,t.glowPower),t.taperPower=X.getValueOrDefault(this._taperPower,e,wLt,t.taperPower),t};BI.prototype.equals=function(e){return this===e||e instanceof BI&&X.equals(this._color,e._color)&&X.equals(this._glowPower,e._glowPower)&&X.equals(this._taperPower,e._taperPower)};var kI=BI;var PLt=z.WHITE,DLt=z.BLACK,RLt=1;function UI(e){e=e??H.EMPTY_OBJECT,this._definitionChanged=new be,this._color=void 0,this._colorSubscription=void 0,this._outlineColor=void 0,this._outlineColorSubscription=void 0,this._outlineWidth=void 0,this._outlineWidthSubscription=void 0,this.color=e.color,this.outlineColor=e.outlineColor,this.outlineWidth=e.outlineWidth}Object.defineProperties(UI.prototype,{isConstant:{get:function(){return X.isConstant(this._color)&&X.isConstant(this._outlineColor)&&X.isConstant(this._outlineWidth)}},definitionChanged:{get:function(){return this._definitionChanged}},color:me("color"),outlineColor:me("outlineColor"),outlineWidth:me("outlineWidth")});UI.prototype.getType=function(e){return"PolylineOutline"};var OLt=new K;UI.prototype.getValue=function(e,t){return l(e)||(e=K.now(OLt)),l(t)||(t={}),t.color=X.getValueOrClonedDefault(this._color,e,PLt,t.color),t.outlineColor=X.getValueOrClonedDefault(this._outlineColor,e,DLt,t.outlineColor),t.outlineWidth=X.getValueOrDefault(this._outlineWidth,e,RLt),t};UI.prototype.equals=function(e){return this===e||e instanceof UI&&X.equals(this._color,e._color)&&X.equals(this._outlineColor,e._outlineColor)&&X.equals(this._outlineWidth,e._outlineWidth)};var Ab=UI;function J_(e,t){this._value=void 0,this._definitionChanged=new be,this._eventHelper=new jo,this._referenceFrame=t??ji.FIXED,this.setValue(e)}Object.defineProperties(J_.prototype,{isConstant:{get:function(){let e=this._value;if(!l(e))return!0;let t=e.length;for(let n=0;n<t;n++)if(!X.isConstant(e[n]))return!1;return!0}},definitionChanged:{get:function(){return this._definitionChanged}},referenceFrame:{get:function(){return this._referenceFrame}}});var MLt=new K;J_.prototype.getValue=function(e,t){return l(e)||(e=K.now(MLt)),this.getValueInReferenceFrame(e,ji.FIXED,t)};J_.prototype.getValueInReferenceFrame=function(e,t,n){let i=this._value;if(!l(i))return;let r=i.length;l(n)||(n=new Array(r));let o=0,s=0;for(;o<r;){let c=i[o].getValueInReferenceFrame(e,t,n[o]);l(c)&&(n[s]=c,s++),o++}return n.length=s,n};J_.prototype.setValue=function(e){let t=this._eventHelper;if(t.removeAll(),l(e)){this._value=e.slice();let n=e.length;for(let i=0;i<n;i++){let r=e[i];l(r)&&t.add(r.definitionChanged,J_.prototype._raiseDefinitionChanged,this)}}else this._value=void 0;this._definitionChanged.raiseEvent(this)};J_.prototype.equals=function(e){return this===e||e instanceof J_&&this._referenceFrame===e._referenceFrame&&X.arrayEquals(this._value,e._value)};J_.prototype._raiseDefinitionChanged=function(){this._definitionChanged.raiseEvent(this)};var Z_=J_;function bb(e){this._value=void 0,this._definitionChanged=new be,this._eventHelper=new jo,this.setValue(e)}Object.defineProperties(bb.prototype,{isConstant:{get:function(){let e=this._value;if(!l(e))return!0;let t=e.length;for(let n=0;n<t;n++)if(!X.isConstant(e[n]))return!1;return!0}},definitionChanged:{get:function(){return this._definitionChanged}}});var NLt=new K;bb.prototype.getValue=function(e,t){l(e)||(e=K.now(NLt));let n=this._value;if(!l(n))return;let i=n.length;l(t)||(t=new Array(i));let r=0,o=0;for(;r<i;){let a=this._value[r].getValue(e,t[r]);l(a)&&(t[o]=a,o++),r++}return t.length=o,t};bb.prototype.setValue=function(e){let t=this._eventHelper;if(t.removeAll(),l(e)){this._value=e.slice();let n=e.length;for(let i=0;i<n;i++){let r=e[i];l(r)&&t.add(r.definitionChanged,bb.prototype._raiseDefinitionChanged,this)}}else this._value=void 0;this._definitionChanged.raiseEvent(this)};bb.prototype.equals=function(e){return this===e||e instanceof bb&&X.arrayEquals(this._value,e._value)};bb.prototype._raiseDefinitionChanged=function(){this._definitionChanged.raiseEvent(this)};var zI=bb;var LLt={packedLength:1,pack:function(e,t,n){return n=n??0,t[n]=e,t},unpack:function(e,t,n){return t=t??0,e[t]},convertPackedArrayForInterpolation:function(e,t,n,i){l(i)||(i=[]),t=t??0,n=n??e.length;let r;for(let o=0,s=n-t+1;o<s;o++){let a=e[t+o];o===0||Math.abs(r-a)<Math.PI?i[o]=a:i[o]=a-D.TWO_PI,r=a}},unpackInterpolationResult:function(e,t,n,i,r){return r=e[0],r<0?r+D.TWO_PI:r}},vh=LLt;var ZRe={HORIZONTAL:0,VERTICAL:1};Object.freeze(ZRe);var Qm=ZRe;var FLt=Qm.HORIZONTAL,BLt=z.WHITE,kLt=z.BLACK,ULt=0,zLt=1;function VI(e){e=e??H.EMPTY_OBJECT,this._definitionChanged=new be,this._orientation=void 0,this._orientationSubscription=void 0,this._evenColor=void 0,this._evenColorSubscription=void 0,this._oddColor=void 0,this._oddColorSubscription=void 0,this._offset=void 0,this._offsetSubscription=void 0,this._repeat=void 0,this._repeatSubscription=void 0,this.orientation=e.orientation,this.evenColor=e.evenColor,this.oddColor=e.oddColor,this.offset=e.offset,this.repeat=e.repeat}Object.defineProperties(VI.prototype,{isConstant:{get:function(){return X.isConstant(this._orientation)&&X.isConstant(this._evenColor)&&X.isConstant(this._oddColor)&&X.isConstant(this._offset)&&X.isConstant(this._repeat)}},definitionChanged:{get:function(){return this._definitionChanged}},orientation:me("orientation"),evenColor:me("evenColor"),oddColor:me("oddColor"),offset:me("offset"),repeat:me("repeat")});VI.prototype.getType=function(e){return"Stripe"};var VLt=new K;VI.prototype.getValue=function(e,t){return l(e)||(e=K.now(VLt)),l(t)||(t={}),t.horizontal=X.getValueOrDefault(this._orientation,e,FLt)===Qm.HORIZONTAL,t.evenColor=X.getValueOrClonedDefault(this._evenColor,e,BLt,t.evenColor),t.oddColor=X.getValueOrClonedDefault(this._oddColor,e,kLt,t.oddColor),t.offset=X.getValueOrDefault(this._offset,e,ULt),t.repeat=X.getValueOrDefault(this._repeat,e,zLt),t};VI.prototype.equals=function(e){return this===e||e instanceof VI&&X.equals(this._orientation,e._orientation)&&X.equals(this._evenColor,e._evenColor)&&X.equals(this._oddColor,e._oddColor)&&X.equals(this._offset,e._offset)&&X.equals(this._repeat,e._repeat)};var jI=VI;function oC(){this._definitionChanged=new be,this._intervals=new Ds,this._intervals.changedEvent.addEventListener(oC.prototype._intervalsChanged,this)}Object.defineProperties(oC.prototype,{isConstant:{get:function(){return this._intervals.isEmpty}},definitionChanged:{get:function(){return this._definitionChanged}},intervals:{get:function(){return this._intervals}}});var jLt=new K;oC.prototype.getValue=function(e,t){l(e)||(e=K.now(jLt));let n=this._intervals.findDataForIntervalContainingDate(e);return l(n)&&typeof n.clone=="function"?n.clone(t):n};oC.prototype.equals=function(e){return this===e||e instanceof oC&&this._intervals.equals(e._intervals,X.equals)};oC.prototype._intervalsChanged=function(){this._definitionChanged.raiseEvent(this)};var Q_=oC;function TV(e,t){this._velocityVectorProperty=new L_(e,!0),this._subscription=void 0,this._ellipsoid=void 0,this._definitionChanged=new be,this.ellipsoid=t??ee.default;let n=this;this._velocityVectorProperty.definitionChanged.addEventListener(function(){n._definitionChanged.raiseEvent(n)})}Object.defineProperties(TV.prototype,{isConstant:{get:function(){return X.isConstant(this._velocityVectorProperty)}},definitionChanged:{get:function(){return this._definitionChanged}},position:{get:function(){return this._velocityVectorProperty.position},set:function(e){this._velocityVectorProperty.position=e}},ellipsoid:{get:function(){return this._ellipsoid},set:function(e){this._ellipsoid!==e&&(this._ellipsoid=e,this._definitionChanged.raiseEvent(this))}}});var QRe=new h,HLt=new h,eOe=new $,GLt=new K;TV.prototype.getValue=function(e,t){l(e)||(e=K.now(GLt));let n=this._velocityVectorProperty._getValue(e,HLt,QRe);if(l(n))return At.rotationMatrixFromPositionVelocity(QRe,n,this._ellipsoid,eOe),Le.fromRotationMatrix(eOe,t)};TV.prototype.equals=function(e){return this===e||e instanceof TV&&X.equals(this._velocityVectorProperty,e._velocityVectorProperty)&&(this._ellipsoid===e._ellipsoid||this._ellipsoid.equals(e._ellipsoid))};var EV=TV;var ey={COMPLETE:0,BELOW_ELLIPSOID_HORIZON:1,ABOVE_ELLIPSOID_HORIZON:2};ey.validate=function(e){return e===ey.COMPLETE||e===ey.BELOW_ELLIPSOID_HORIZON||e===ey.ABOVE_ELLIPSOID_HORIZON};ey.toString=function(e){switch(e){case ey.COMPLETE:return"COMPLETE";case ey.BELOW_ELLIPSOID_HORIZON:return"BELOW_ELLIPSOID_HORIZON";case ey.ABOVE_ELLIPSOID_HORIZON:return"ABOVE_ELLIPSOID_HORIZON";default:throw new pe("SensorVolumePortionToDisplay value is not valid and cannot be converted to a String.")}};var HI=ey;function xb(){}xb.packedLength=h.packedLength;xb.unpack=h.unpack;xb.pack=h.pack;var Mie;function CV(e,t){return t[0]==="#"&&(t=Mie+t),O_.fromString(e,t)}function tOe(e,t,n){if(l(n.reference))return CV(t,n.reference);if(l(n.velocityReference)){let i=CV(t,n.velocityReference);switch(e){case h:case xb:return new L_(i,e===xb);case Le:return new EV(i)}}throw new oe(`${JSON.stringify(n)} is not valid CZML.`)}function WLt(e,t){return new am(function(n,i){return t(e.getValue(n,i))},e.isConstant)}var pr=new h,Au=new xV,Sl=new he,sC=new En,f9=new Le;function qLt(e){let t=e.rgbaf;if(l(t))return t;let n=e.rgba;if(!l(n))return;let i=n.length;if(i===z.packedLength)return[z.byteToFloat(n[0]),z.byteToFloat(n[1]),z.byteToFloat(n[2]),z.byteToFloat(n[3])];t=new Array(i);for(let r=0;r<i;r+=5)t[r]=n[r],t[r+1]=z.byteToFloat(n[r+1]),t[r+2]=z.byteToFloat(n[r+2]),t[r+3]=z.byteToFloat(n[r+3]),t[r+4]=z.byteToFloat(n[r+4]);return t}function nOe(e,t){let n=e.uri??e;return l(t)?t.getDerivedResource({url:n}):De.createIfNeeded(n)}function YLt(e){let t=e.wsen;if(l(t))return t;let n=e.wsenDegrees;if(!l(n))return;let i=n.length;if(i===ie.packedLength)return[D.toRadians(n[0]),D.toRadians(n[1]),D.toRadians(n[2]),D.toRadians(n[3])];t=new Array(i);for(let r=0;r<i;r+=5)t[r]=n[r],t[r+1]=D.toRadians(n[r+1]),t[r+2]=D.toRadians(n[r+2]),t[r+3]=D.toRadians(n[r+3]),t[r+4]=D.toRadians(n[r+4]);return t}function XLt(e){let t=e.length;if(Au.magnitude=1,t===2)return Au.clock=e[0],Au.cone=e[1],h.fromSpherical(Au,pr),[pr.x,pr.y,pr.z];let n=new Array(t/3*4);for(let i=0,r=0;i<t;i+=3,r+=4)n[r]=e[i],Au.clock=e[i+1],Au.cone=e[i+2],h.fromSpherical(Au,pr),n[r+1]=pr.x,n[r+2]=pr.y,n[r+3]=pr.z;return n}function KLt(e){let t=e.length;if(t===3)return Au.clock=e[0],Au.cone=e[1],Au.magnitude=e[2],h.fromSpherical(Au,pr),[pr.x,pr.y,pr.z];let n=new Array(t);for(let i=0;i<t;i+=4)n[i]=e[i],Au.clock=e[i+1],Au.cone=e[i+2],Au.magnitude=e[i+3],h.fromSpherical(Au,pr),n[i+1]=pr.x,n[i+2]=pr.y,n[i+3]=pr.z;return n}function $Lt(e){let t=e.length;if(t===3)return Sl.longitude=e[0],Sl.latitude=e[1],Sl.height=e[2],ee.default.cartographicToCartesian(Sl,pr),[pr.x,pr.y,pr.z];let n=new Array(t);for(let i=0;i<t;i+=4)n[i]=e[i],Sl.longitude=e[i+1],Sl.latitude=e[i+2],Sl.height=e[i+3],ee.default.cartographicToCartesian(Sl,pr),n[i+1]=pr.x,n[i+2]=pr.y,n[i+3]=pr.z;return n}function JLt(e){let t=e.length;if(t===3)return Sl.longitude=D.toRadians(e[0]),Sl.latitude=D.toRadians(e[1]),Sl.height=e[2],ee.default.cartographicToCartesian(Sl,pr),[pr.x,pr.y,pr.z];let n=new Array(t);for(let i=0;i<t;i+=4)n[i]=e[i],Sl.longitude=D.toRadians(e[i+1]),Sl.latitude=D.toRadians(e[i+2]),Sl.height=e[i+3],ee.default.cartographicToCartesian(Sl,pr),n[i+1]=pr.x,n[i+2]=pr.y,n[i+3]=pr.z;return n}function Nie(e){let t=e.cartesian;if(l(t))return t;let n=e.cartesianVelocity;if(l(n))return n;let i=e.unitCartesian;if(l(i))return i;let r=e.unitSpherical;if(l(r))return XLt(r);let o=e.spherical;if(l(o))return KLt(o);let s=e.cartographicRadians;if(l(s))return $Lt(s);let a=e.cartographicDegrees;if(l(a))return JLt(a);throw new oe(`${JSON.stringify(e)} is not a valid CZML interval.`)}function iOe(e,t){h.unpack(e,t,pr),h.normalize(pr,pr),h.pack(pr,e,t)}function ZLt(e){let t=Nie(e);if(t.length===3)return iOe(t,0),t;for(let n=1;n<t.length;n+=4)iOe(t,n);return t}function rOe(e,t){Le.unpack(e,t,f9),Le.normalize(f9,f9),Le.pack(f9,e,t)}function QLt(e){let t=e.unitQuaternion;if(l(t)){if(t.length===4)return rOe(t,0),t;for(let n=1;n<t.length;n+=5)rOe(t,n)}return t}function oOe(e){return typeof e=="boolean"?Boolean:typeof e=="number"?Number:typeof e=="string"?String:e.hasOwnProperty("array")?Array:e.hasOwnProperty("boolean")?Boolean:e.hasOwnProperty("boundingRectangle")?et:e.hasOwnProperty("cartesian2")?U:e.hasOwnProperty("cartesian")||e.hasOwnProperty("spherical")||e.hasOwnProperty("cartographicRadians")||e.hasOwnProperty("cartographicDegrees")?h:e.hasOwnProperty("unitCartesian")||e.hasOwnProperty("unitSpherical")?xb:e.hasOwnProperty("rgba")||e.hasOwnProperty("rgbaf")?z:e.hasOwnProperty("arcType")?ln:e.hasOwnProperty("classificationType")?Qn:e.hasOwnProperty("colorBlendMode")?sl:e.hasOwnProperty("cornerType")?tr:e.hasOwnProperty("heightReference")?We:e.hasOwnProperty("horizontalOrigin")?Vi:e.hasOwnProperty("date")?K:e.hasOwnProperty("labelStyle")?_o:e.hasOwnProperty("number")?Number:e.hasOwnProperty("nearFarScalar")?qt:e.hasOwnProperty("distanceDisplayCondition")?Ht:e.hasOwnProperty("object")||e.hasOwnProperty("value")?Object:e.hasOwnProperty("unitQuaternion")?Le:e.hasOwnProperty("pathMode")?h0:e.hasOwnProperty("shadowMode")?Pn:e.hasOwnProperty("string")?String:e.hasOwnProperty("stripeOrientation")?Qm:e.hasOwnProperty("wsen")||e.hasOwnProperty("wsenDegrees")?ie:e.hasOwnProperty("uri")?SV.default:e.hasOwnProperty("verticalOrigin")?Gn:Object}function eFt(e,t,n){switch(e){case ln:return ln[t.arcType??t];case Array:return t.array;case Boolean:return t.boolean??t;case et:return t.boundingRectangle;case U:return t.cartesian2;case h:return Nie(t);case xb:return ZLt(t);case z:return qLt(t);case Qn:return Qn[t.classificationType??t];case sl:return sl[t.colorBlendMode??t];case tr:return tr[t.cornerType??t];case We:return We[t.heightReference??t];case Vi:return Vi[t.horizontalOrigin??t];case Image:return nOe(t,n);case K:return K.fromIso8601(t.date??t);case _o:return _o[t.labelStyle??t];case Number:return t.number??t;case qt:return t.nearFarScalar;case Ht:return t.distanceDisplayCondition;case Object:return t.object??t.value??t;case h0:return h0[t.pathMode??t];case Le:return QLt(t);case vh:return t.number??t;case HI:return HI[t.portionToDisplay??t];case Pn:return Pn[t.shadowMode??t.shadows??t];case String:return t.string??t;case Qm:return Qm[t.stripeOrientation??t];case ie:return YLt(t);case SV.default:return nOe(t,n);case Gn:return Gn[t.verticalOrigin??t];default:throw new oe(`Unknown CzmlDataSource interval type: ${e}`)}}var tFt={HERMITE:AV,LAGRANGE:bV,LINEAR:ZA};function d9(e,t){let n=e.interpolationAlgorithm,i=e.interpolationDegree;(l(n)||l(i))&&t.setInterpolationOptions({interpolationAlgorithm:tFt[n],interpolationDegree:i});let r=e.forwardExtrapolationType;l(r)&&(t.forwardExtrapolationType=hu[r]);let o=e.forwardExtrapolationDuration;l(o)&&(t.forwardExtrapolationDuration=o);let s=e.backwardExtrapolationType;l(s)&&(t.backwardExtrapolationType=hu[s]);let a=e.backwardExtrapolationDuration;l(a)&&(t.backwardExtrapolationDuration=a)}var sOe={iso8601:void 0};function Jo(e){if(l(e))return sOe.iso8601=e,En.fromIso8601(sOe)}function Lie(e){let t=nt.MAXIMUM_INTERVAL.clone();return t.data=e,t}function aOe(e){let t=new Al;return t.intervals.addInterval(Lie(e)),t}function cOe(e){let t=new _c(e.referenceFrame);return t.intervals.addInterval(Lie(e)),t}function h9(e,t,n,i,r,o,s){let a=Jo(i.interval);l(r)&&(l(a)?a=En.intersect(a,r,sC):a=r);let c,u,f,d=!l(i.reference)&&!l(i.velocityReference),p=l(a)&&!a.equals(nt.MAXIMUM_INTERVAL);if(i.delete===!0){if(!p){t[n]=void 0;return}return AOe(t[n],a)}let g=!1;if(d){if(u=eFt(e,i,o),!l(u))return;c=e.packedLength??1,f=u.length??1,g=!l(i.array)&&typeof u!="string"&&f>c&&e!==Object}let m=typeof e.unpack=="function"&&e!==vh;if(!g&&!p){d?t[n]=new ui(m?e.unpack(u,0):u):t[n]=tOe(e,s,i);return}let y=t[n],A,b=i.epoch;if(l(b)&&(A=K.fromIso8601(b)),g&&!p){y instanceof td||(t[n]=y=new td(e)),y.addSamplesPackedArray(u,A),d9(i,y);return}let x;if(!g&&p){a=a.clone(),d?a.data=m?e.unpack(u,0):u:a.data=tOe(e,s,i),l(y)||(t[n]=y=d?new Q_:new Al),d&&y instanceof Q_?y.intervals.addInterval(a):y instanceof Al?(d&&(a.data=new ui(a.data)),y.intervals.addInterval(a)):(t[n]=y=aOe(y),d&&(a.data=new ui(a.data)),y.intervals.addInterval(a));return}l(y)||(t[n]=y=new Al),y instanceof Al||(t[n]=y=aOe(y));let T=y.intervals;x=T.findInterval(a),(!l(x)||!(x.data instanceof td))&&(x=a.clone(),x.data=new td(e),T.addInterval(x)),x.data.addSamplesPackedArray(u,A),d9(i,x.data)}function AOe(e,t){if(e instanceof td){e.removeSamples(t);return}else if(e instanceof Q_){e.intervals.removeInterval(t);return}else if(e instanceof Al){let n=e.intervals;for(let i=0;i<n.length;++i){let r=En.intersect(n.get(i),t,sC);r.isEmpty||AOe(r.data,t)}n.removeInterval(t);return}}function Ee(e,t,n,i,r,o,s){if(l(i))if(Array.isArray(i))for(let a=0,c=i.length;a<c;++a)h9(e,t,n,i[a],r,o,s);else h9(e,t,n,i,r,o,s)}function lOe(e,t,n,i,r,o){let s=Jo(n.interval);l(i)&&(l(s)?s=En.intersect(s,i,sC):s=i);let a=l(n.cartesianVelocity)?1:0,c=h.packedLength*(a+1),u,f,d=!l(n.reference),p=l(s)&&!s.equals(nt.MAXIMUM_INTERVAL);if(n.delete===!0){if(!p){e[t]=void 0;return}return bOe(e[t],s)}let g,m=!1;if(d&&(l(n.referenceFrame)&&(g=ji[n.referenceFrame]),g=g??ji.FIXED,u=Nie(n),f=u.length??1,m=f>c),!m&&!p){d?e[t]=new Kl(h.unpack(u),g):e[t]=CV(o,n.reference);return}let y=e[t],A,b=n.epoch;if(l(b)&&(A=K.fromIso8601(b)),m&&!p){(!(y instanceof yc)||l(g)&&y.referenceFrame!==g)&&(e[t]=y=new yc(g,a)),y.addSamplesPackedArray(u,A),d9(n,y);return}let x;if(!m&&p){s=s.clone(),d?s.data=h.unpack(u):s.data=CV(o,n.reference),l(y)||(d?y=new M_(g):y=new _c(g),e[t]=y),d&&y instanceof M_&&l(g)&&y.referenceFrame===g?y.intervals.addInterval(s):y instanceof _c?(d&&(s.data=new Kl(s.data,g)),y.intervals.addInterval(s)):(e[t]=y=cOe(y),d&&(s.data=new Kl(s.data,g)),y.intervals.addInterval(s));return}l(y)?y instanceof _c||(e[t]=y=cOe(y)):e[t]=y=new _c(g);let T=y.intervals;x=T.findInterval(s),(!l(x)||!(x.data instanceof yc)||l(g)&&x.data.referenceFrame!==g)&&(x=s.clone(),x.data=new yc(g,a),T.addInterval(x)),x.data.addSamplesPackedArray(u,A),d9(n,x.data)}function bOe(e,t){if(e instanceof yc){e.removeSamples(t);return}else if(e instanceof M_){e.intervals.removeInterval(t);return}else if(e instanceof _c){let n=e.intervals;for(let i=0;i<n.length;++i){let r=En.intersect(n.get(i),t,sC);r.isEmpty||bOe(r.data,t)}n.removeInterval(t);return}}function xOe(e,t,n,i,r,o){if(l(n))if(Array.isArray(n))for(let s=0,a=n.length;s<a;++s)lOe(e,t,n[s],i,r,o);else lOe(e,t,n,i,r,o)}function uOe(e,t,n,i){l(n.references)?m9(e,t,n.references,n.interval,i,zI,Al):(l(n.cartesian2)?n.array=U.unpackArray(n.cartesian2):l(n.cartesian)&&(n.array=U.unpackArray(n.cartesian)),l(n.array)&&Ee(Array,e,t,n,void 0,void 0,i))}function fOe(e,t,n,i,r,o){let s=Jo(n.interval);l(i)&&(l(s)?s=En.intersect(s,i,sC):s=i);let a=e[t],c,u;if(l(s)){a instanceof DI||(a=new DI,e[t]=a);let d=a.intervals;u=d.findInterval({start:s.start,stop:s.stop}),l(u)?c=u.data:(u=s.clone(),d.addInterval(u))}else c=a;let f;l(n.solidColor)?(c instanceof Kt||(c=new Kt),f=n.solidColor,Ee(z,c,"color",f.color,void 0,void 0,o)):l(n.grid)?(c instanceof OI||(c=new OI),f=n.grid,Ee(z,c,"color",f.color,void 0,r,o),Ee(Number,c,"cellAlpha",f.cellAlpha,void 0,r,o),Ee(U,c,"lineCount",f.lineCount,void 0,r,o),Ee(U,c,"lineThickness",f.lineThickness,void 0,r,o),Ee(U,c,"lineOffset",f.lineOffset,void 0,r,o)):l(n.image)?(c instanceof Jy||(c=new Jy),f=n.image,Ee(Image,c,"image",f.image,void 0,r,o),Ee(U,c,"repeat",f.repeat,void 0,r,o),Ee(z,c,"color",f.color,void 0,r,o),Ee(Boolean,c,"transparent",f.transparent,void 0,r,o)):l(n.stripe)?(c instanceof jI||(c=new jI),f=n.stripe,Ee(Qm,c,"orientation",f.orientation,void 0,r,o),Ee(z,c,"evenColor",f.evenColor,void 0,r,o),Ee(z,c,"oddColor",f.oddColor,void 0,r,o),Ee(Number,c,"offset",f.offset,void 0,r,o),Ee(Number,c,"repeat",f.repeat,void 0,r,o)):l(n.polylineOutline)?(c instanceof Ab||(c=new Ab),f=n.polylineOutline,Ee(z,c,"color",f.color,void 0,r,o),Ee(z,c,"outlineColor",f.outlineColor,void 0,r,o),Ee(Number,c,"outlineWidth",f.outlineWidth,void 0,r,o)):l(n.polylineGlow)?(c instanceof kI||(c=new kI),f=n.polylineGlow,Ee(z,c,"color",f.color,void 0,r,o),Ee(Number,c,"glowPower",f.glowPower,void 0,r,o),Ee(Number,c,"taperPower",f.taperPower,void 0,r,o)):l(n.polylineArrow)?(c instanceof NI||(c=new NI),f=n.polylineArrow,Ee(z,c,"color",f.color,void 0,void 0,o)):l(n.polylineDash)?(c instanceof FI||(c=new FI),f=n.polylineDash,Ee(z,c,"color",f.color,void 0,void 0,o),Ee(z,c,"gapColor",f.gapColor,void 0,void 0,o),Ee(Number,c,"dashLength",f.dashLength,void 0,r,o),Ee(Number,c,"dashPattern",f.dashPattern,void 0,r,o)):l(n.checkerboard)&&(c instanceof II||(c=new II),f=n.checkerboard,Ee(z,c,"evenColor",f.evenColor,void 0,r,o),Ee(z,c,"oddColor",f.oddColor,void 0,r,o),Ee(U,c,"repeat",f.repeat,void 0,r,o)),l(u)?u.data=c:e[t]=c}function ld(e,t,n,i,r,o){if(l(n))if(Array.isArray(n))for(let s=0,a=n.length;s<a;++s)fOe(e,t,n[s],i,r,o);else fOe(e,t,n,i,r,o)}function nFt(e,t,n,i){let r=t.name;l(r)&&(e.name=t.name)}function iFt(e,t,n,i){let r=t.description;l(r)&&Ee(String,e,"description",r,void 0,i,n)}function rFt(e,t,n,i){let r=t.position;l(r)&&xOe(e,"position",r,void 0,i,n)}function oFt(e,t,n,i){let r=t.viewFrom;l(r)&&Ee(h,e,"viewFrom",r,void 0,i,n)}function sFt(e,t,n,i){let r=t.orientation;l(r)&&Ee(Le,e,"orientation",r,void 0,i,n)}function aFt(e,t,n,i){let r=t.properties;if(l(r)){l(e.properties)||(e.properties=new Jl);for(let o in r)if(r.hasOwnProperty(o)){e.properties.hasProperty(o)||e.properties.addProperty(o);let s=r[o];if(Array.isArray(s))for(let a=0,c=s.length;a<c;++a)h9(oOe(s[a]),e.properties,o,s[a],void 0,i,n);else h9(oOe(s),e.properties,o,s,void 0,i,n)}}}function m9(e,t,n,i,r,o,s){let a=n.map(function(c){return CV(r,c)});if(l(i)){i=Jo(i);let c=e[t];if(!(c instanceof s)){let u=new s;u.intervals.addInterval(Lie(c)),e[t]=c=u}i.data=new o(a),c.intervals.addInterval(i)}else e[t]=new o(a)}function dOe(e,t,n,i){let r=n.references;l(r)?m9(e,t,r,n.interval,i,zI,Al):Ee(Array,e,t,n,void 0,void 0,i)}function hOe(e,t,n,i){if(l(n))if(Array.isArray(n))for(let r=0,o=n.length;r<o;++r)dOe(e,t,n[r],i);else dOe(e,t,n,i)}function mOe(e,t,n,i){let r=n.references;l(r)?m9(e,t,r,n.interval,i,Z_,_c):(l(n.cartesian)?n.array=h.unpackArray(n.cartesian):l(n.cartographicRadians)?n.array=h.fromRadiansArrayHeights(n.cartographicRadians,ee.default):l(n.cartographicDegrees)&&(n.array=h.fromDegreesArrayHeights(n.cartographicDegrees,ee.default)),l(n.array)&&Ee(Array,e,t,n,void 0,void 0,i))}function wV(e,t,n,i){if(l(n))if(Array.isArray(n))for(let r=0,o=n.length;r<o;++r)mOe(e,t,n[r],i);else mOe(e,t,n,i)}function cFt(e){return h.unpackArray(e)}function lFt(e){return h.fromRadiansArrayHeights(e,ee.default)}function uFt(e){return h.fromDegreesArrayHeights(e,ee.default)}function pOe(e,t,n,i){let r=n.references;if(l(r)){let o=r.map(function(s){let a={};return m9(a,"positions",s,n.interval,i,Z_,_c),a.positions});e[t]=new Z_(o)}else l(n.cartesian)?n.array=n.cartesian.map(cFt):l(n.cartographicRadians)?n.array=n.cartographicRadians.map(lFt):l(n.cartographicDegrees)&&(n.array=n.cartographicDegrees.map(uFt)),l(n.array)&&Ee(Array,e,t,n,void 0,void 0,i)}function fFt(e,t,n,i){if(l(n))if(Array.isArray(n))for(let r=0,o=n.length;r<o;++r)pOe(e,t,n[r],i);else pOe(e,t,n,i)}function dFt(e,t,n,i){if(l(n))if(Array.isArray(n))for(let r=0,o=n.length;r<o;r++)uOe(e,t,n[r],i);else uOe(e,t,n,i)}function hFt(e,t,n,i){let r=t.availability;if(!l(r))return;let o;if(Array.isArray(r))for(let s=0,a=r.length;s<a;++s)l(o)||(o=new Ds),o.addInterval(Jo(r[s]));else o=new Ds,o.addInterval(Jo(r));e.availability=o}function mFt(e,t,n,i,r){l(t)&&Ee(xb,e,"alignedAxis",t,n,i,r)}function pFt(e,t,n,i){let r=t.billboard;if(!l(r))return;let o=Jo(r.interval),s=e.billboard;l(s)||(e.billboard=s=new nl),Ee(Boolean,s,"show",r.show,o,i,n),Ee(Image,s,"image",r.image,o,i,n),Ee(Number,s,"scale",r.scale,o,i,n),Ee(U,s,"pixelOffset",r.pixelOffset,o,i,n),Ee(h,s,"eyeOffset",r.eyeOffset,o,i,n),Ee(Vi,s,"horizontalOrigin",r.horizontalOrigin,o,i,n),Ee(Gn,s,"verticalOrigin",r.verticalOrigin,o,i,n),Ee(We,s,"heightReference",r.heightReference,o,i,n),Ee(z,s,"color",r.color,o,i,n),Ee(vh,s,"rotation",r.rotation,o,i,n),mFt(s,r.alignedAxis,o,i,n),Ee(Boolean,s,"sizeInMeters",r.sizeInMeters,o,i,n),Ee(Number,s,"width",r.width,o,i,n),Ee(Number,s,"height",r.height,o,i,n),Ee(qt,s,"scaleByDistance",r.scaleByDistance,o,i,n),Ee(qt,s,"translucencyByDistance",r.translucencyByDistance,o,i,n),Ee(qt,s,"pixelOffsetScaleByDistance",r.pixelOffsetScaleByDistance,o,i,n),Ee(et,s,"imageSubRegion",r.imageSubRegion,o,i,n),Ee(Ht,s,"distanceDisplayCondition",r.distanceDisplayCondition,o,i,n),Ee(Number,s,"disableDepthTestDistance",r.disableDepthTestDistance,o,i,n)}function gFt(e,t,n,i){let r=t.box;if(!l(r))return;let o=Jo(r.interval),s=e.box;l(s)||(e.box=s=new kx),Ee(Boolean,s,"show",r.show,o,i,n),Ee(h,s,"dimensions",r.dimensions,o,i,n),Ee(We,s,"heightReference",r.heightReference,o,i,n),Ee(Boolean,s,"fill",r.fill,o,i,n),ld(s,"material",r.material,o,i,n),Ee(Boolean,s,"outline",r.outline,o,i,n),Ee(z,s,"outlineColor",r.outlineColor,o,i,n),Ee(Number,s,"outlineWidth",r.outlineWidth,o,i,n),Ee(Pn,s,"shadows",r.shadows,o,i,n),Ee(Ht,s,"distanceDisplayCondition",r.distanceDisplayCondition,o,i,n)}function _Ft(e,t,n,i){let r=t.corridor;if(!l(r))return;let o=Jo(r.interval),s=e.corridor;l(s)||(e.corridor=s=new zx),Ee(Boolean,s,"show",r.show,o,i,n),wV(s,"positions",r.positions,n),Ee(Number,s,"width",r.width,o,i,n),Ee(Number,s,"height",r.height,o,i,n),Ee(We,s,"heightReference",r.heightReference,o,i,n),Ee(Number,s,"extrudedHeight",r.extrudedHeight,o,i,n),Ee(We,s,"extrudedHeightReference",r.extrudedHeightReference,o,i,n),Ee(tr,s,"cornerType",r.cornerType,o,i,n),Ee(Number,s,"granularity",r.granularity,o,i,n),Ee(Boolean,s,"fill",r.fill,o,i,n),ld(s,"material",r.material,o,i,n),Ee(Boolean,s,"outline",r.outline,o,i,n),Ee(z,s,"outlineColor",r.outlineColor,o,i,n),Ee(Number,s,"outlineWidth",r.outlineWidth,o,i,n),Ee(Pn,s,"shadows",r.shadows,o,i,n),Ee(Ht,s,"distanceDisplayCondition",r.distanceDisplayCondition,o,i,n),Ee(Qn,s,"classificationType",r.classificationType,o,i,n),Ee(Number,s,"zIndex",r.zIndex,o,i,n)}function yFt(e,t,n,i){let r=t.cylinder;if(!l(r))return;let o=Jo(r.interval),s=e.cylinder;l(s)||(e.cylinder=s=new Vx),Ee(Boolean,s,"show",r.show,o,i,n),Ee(Number,s,"length",r.length,o,i,n),Ee(Number,s,"topRadius",r.topRadius,o,i,n),Ee(Number,s,"bottomRadius",r.bottomRadius,o,i,n),Ee(We,s,"heightReference",r.heightReference,o,i,n),Ee(Boolean,s,"fill",r.fill,o,i,n),ld(s,"material",r.material,o,i,n),Ee(Boolean,s,"outline",r.outline,o,i,n),Ee(z,s,"outlineColor",r.outlineColor,o,i,n),Ee(Number,s,"outlineWidth",r.outlineWidth,o,i,n),Ee(Number,s,"numberOfVerticalLines",r.numberOfVerticalLines,o,i,n),Ee(Number,s,"slices",r.slices,o,i,n),Ee(Pn,s,"shadows",r.shadows,o,i,n),Ee(Ht,s,"distanceDisplayCondition",r.distanceDisplayCondition,o,i,n)}function AFt(e,t){let n=e.version;if(l(n)&&typeof n=="string"){let o=n.split(".");if(o.length===2){if(o[0]!=="1")throw new oe("Cesium only supports CZML version 1.");t._version=n}}if(!l(t._version))throw new oe("CZML version information invalid. It is expected to be a property on the document object in the <Major>.<Minor> version format.");let i=t._documentPacket;l(e.name)&&(i.name=e.name);let r=e.clock;if(l(r)){let o=i.clock;l(o)?(o.interval=r.interval??o.interval,o.currentTime=r.currentTime??o.currentTime,o.range=r.range??o.range,o.step=r.step??o.step,o.multiplier=r.multiplier??o.multiplier):i.clock={interval:r.interval,currentTime:r.currentTime,range:r.range,step:r.step,multiplier:r.multiplier}}}function bFt(e,t,n,i){let r=t.ellipse;if(!l(r))return;let o=Jo(r.interval),s=e.ellipse;l(s)||(e.ellipse=s=new jx),Ee(Boolean,s,"show",r.show,o,i,n),Ee(Number,s,"semiMajorAxis",r.semiMajorAxis,o,i,n),Ee(Number,s,"semiMinorAxis",r.semiMinorAxis,o,i,n),Ee(Number,s,"height",r.height,o,i,n),Ee(We,s,"heightReference",r.heightReference,o,i,n),Ee(Number,s,"extrudedHeight",r.extrudedHeight,o,i,n),Ee(We,s,"extrudedHeightReference",r.extrudedHeightReference,o,i,n),Ee(vh,s,"rotation",r.rotation,o,i,n),Ee(vh,s,"stRotation",r.stRotation,o,i,n),Ee(Number,s,"granularity",r.granularity,o,i,n),Ee(Boolean,s,"fill",r.fill,o,i,n),ld(s,"material",r.material,o,i,n),Ee(Boolean,s,"outline",r.outline,o,i,n),Ee(z,s,"outlineColor",r.outlineColor,o,i,n),Ee(Number,s,"outlineWidth",r.outlineWidth,o,i,n),Ee(Number,s,"numberOfVerticalLines",r.numberOfVerticalLines,o,i,n),Ee(Pn,s,"shadows",r.shadows,o,i,n),Ee(Ht,s,"distanceDisplayCondition",r.distanceDisplayCondition,o,i,n),Ee(Qn,s,"classificationType",r.classificationType,o,i,n),Ee(Number,s,"zIndex",r.zIndex,o,i,n)}function xFt(e,t,n,i){let r=t.ellipsoid;if(!l(r))return;let o=Jo(r.interval),s=e.ellipsoid;l(s)||(e.ellipsoid=s=new Hx),Ee(Boolean,s,"show",r.show,o,i,n),Ee(h,s,"radii",r.radii,o,i,n),Ee(h,s,"innerRadii",r.innerRadii,o,i,n),Ee(Number,s,"minimumClock",r.minimumClock,o,i,n),Ee(Number,s,"maximumClock",r.maximumClock,o,i,n),Ee(Number,s,"minimumCone",r.minimumCone,o,i,n),Ee(Number,s,"maximumCone",r.maximumCone,o,i,n),Ee(We,s,"heightReference",r.heightReference,o,i,n),Ee(Boolean,s,"fill",r.fill,o,i,n),ld(s,"material",r.material,o,i,n),Ee(Boolean,s,"outline",r.outline,o,i,n),Ee(z,s,"outlineColor",r.outlineColor,o,i,n),Ee(Number,s,"outlineWidth",r.outlineWidth,o,i,n),Ee(Number,s,"stackPartitions",r.stackPartitions,o,i,n),Ee(Number,s,"slicePartitions",r.slicePartitions,o,i,n),Ee(Number,s,"subdivisions",r.subdivisions,o,i,n),Ee(Pn,s,"shadows",r.shadows,o,i,n),Ee(Ht,s,"distanceDisplayCondition",r.distanceDisplayCondition,o,i,n)}function TFt(e,t,n,i){let r=t.label;if(!l(r))return;let o=Jo(r.interval),s=e.label;l(s)||(e.label=s=new im),Ee(Boolean,s,"show",r.show,o,i,n),Ee(String,s,"text",r.text,o,i,n),Ee(String,s,"font",r.font,o,i,n),Ee(_o,s,"style",r.style,o,i,n),Ee(Number,s,"scale",r.scale,o,i,n),Ee(Boolean,s,"showBackground",r.showBackground,o,i,n),Ee(z,s,"backgroundColor",r.backgroundColor,o,i,n),Ee(U,s,"backgroundPadding",r.backgroundPadding,o,i,n),Ee(U,s,"pixelOffset",r.pixelOffset,o,i,n),Ee(h,s,"eyeOffset",r.eyeOffset,o,i,n),Ee(Vi,s,"horizontalOrigin",r.horizontalOrigin,o,i,n),Ee(Gn,s,"verticalOrigin",r.verticalOrigin,o,i,n),Ee(We,s,"heightReference",r.heightReference,o,i,n),Ee(z,s,"fillColor",r.fillColor,o,i,n),Ee(z,s,"outlineColor",r.outlineColor,o,i,n),Ee(Number,s,"outlineWidth",r.outlineWidth,o,i,n),Ee(qt,s,"translucencyByDistance",r.translucencyByDistance,o,i,n),Ee(qt,s,"pixelOffsetScaleByDistance",r.pixelOffsetScaleByDistance,o,i,n),Ee(qt,s,"scaleByDistance",r.scaleByDistance,o,i,n),Ee(Ht,s,"distanceDisplayCondition",r.distanceDisplayCondition,o,i,n),Ee(Number,s,"disableDepthTestDistance",r.disableDepthTestDistance,o,i,n)}function EFt(e,t,n,i){let r=t.model;if(!l(r))return;let o=Jo(r.interval),s=e.model;l(s)||(e.model=s=new Pg),Ee(Boolean,s,"show",r.show,o,i,n),Ee(SV.default,s,"uri",r.gltf,o,i,n),Ee(Number,s,"scale",r.scale,o,i,n),Ee(Number,s,"minimumPixelSize",r.minimumPixelSize,o,i,n),Ee(Number,s,"maximumScale",r.maximumScale,o,i,n),Ee(Boolean,s,"incrementallyLoadTextures",r.incrementallyLoadTextures,o,i,n),Ee(Boolean,s,"runAnimations",r.runAnimations,o,i,n),Ee(Boolean,s,"clampAnimations",r.clampAnimations,o,i,n),Ee(Pn,s,"shadows",r.shadows,o,i,n),Ee(We,s,"heightReference",r.heightReference,o,i,n),Ee(z,s,"silhouetteColor",r.silhouetteColor,o,i,n),Ee(Number,s,"silhouetteSize",r.silhouetteSize,o,i,n),Ee(z,s,"color",r.color,o,i,n),Ee(sl,s,"colorBlendMode",r.colorBlendMode,o,i,n),Ee(Number,s,"colorBlendAmount",r.colorBlendAmount,o,i,n),Ee(Ht,s,"distanceDisplayCondition",r.distanceDisplayCondition,o,i,n);let a,c,u=r.nodeTransformations;if(l(u))if(Array.isArray(u))for(a=0,c=u.length;a<c;++a)gOe(s,u[a],o,i,n);else gOe(s,u,o,i,n);let f=r.articulations;if(l(f))if(Array.isArray(f))for(a=0,c=f.length;a<c;++a)_Oe(s,f[a],o,i,n);else _Oe(s,f,o,i,n)}function gOe(e,t,n,i,r){let o=Jo(t.interval);l(n)&&(l(o)?o=En.intersect(o,n,sC):o=n);let s=e.nodeTransformations,a=Object.keys(t);for(let c=0,u=a.length;c<u;++c){let f=a[c];if(f==="interval")continue;let d=t[f];if(!l(d))continue;l(s)||(e.nodeTransformations=s=new Jl),s.hasProperty(f)||s.addProperty(f);let p=s[f];l(p)||(s[f]=p=new Gx),Ee(h,p,"translation",d.translation,o,i,r),Ee(Le,p,"rotation",d.rotation,o,i,r),Ee(h,p,"scale",d.scale,o,i,r)}}function _Oe(e,t,n,i,r){let o=Jo(t.interval);l(n)&&(l(o)?o=En.intersect(o,n,sC):o=n);let s=e.articulations,a=Object.keys(t);for(let c=0,u=a.length;c<u;++c){let f=a[c];if(f==="interval")continue;let d=t[f];l(d)&&(l(s)||(e.articulations=s=new Jl),s.hasProperty(f)||s.addProperty(f),Ee(Number,s,f,d,o,i,r))}}function CFt(e,t,n,i){let r=t.path;if(!l(r))return;let o=Jo(r.interval),s=e.path;l(s)||(e.path=s=new Dg),Ee(Boolean,s,"show",r.show,o,i,n),Ee(Number,s,"leadTime",r.leadTime,o,i,n),Ee(Number,s,"trailTime",r.trailTime,o,i,n),Ee(Number,s,"width",r.width,o,i,n),Ee(Number,s,"resolution",r.resolution,o,i,n),ld(s,"material",r.material,o,i,n),Ee(Ht,s,"distanceDisplayCondition",r.distanceDisplayCondition,o,i,n),Ee(String,s,"relativeTo",r.relativeTo,o,i,n),Ee(h0,s,"materialMode",r.materialMode,o,i,n)}function vFt(e,t,n,i){let r=t.point;if(!l(r))return;let o=Jo(r.interval),s=e.point;l(s)||(e.point=s=new qx),Ee(Boolean,s,"show",r.show,o,i,n),Ee(Number,s,"pixelSize",r.pixelSize,o,i,n),Ee(We,s,"heightReference",r.heightReference,o,i,n),Ee(z,s,"color",r.color,o,i,n),Ee(z,s,"outlineColor",r.outlineColor,o,i,n),Ee(Number,s,"outlineWidth",r.outlineWidth,o,i,n),Ee(qt,s,"scaleByDistance",r.scaleByDistance,o,i,n),Ee(qt,s,"translucencyByDistance",r.translucencyByDistance,o,i,n),Ee(Ht,s,"distanceDisplayCondition",r.distanceDisplayCondition,o,i,n),Ee(Number,s,"disableDepthTestDistance",r.disableDepthTestDistance,o,i,n)}function vV(e){this.polygon=e,this._definitionChanged=new be}Object.defineProperties(vV.prototype,{isConstant:{get:function(){let e=this.polygon._positions,t=this.polygon._holes;return(!l(e)||e.isConstant)&&(!l(t)||t.isConstant)}},definitionChanged:{get:function(){return this._definitionChanged}}});vV.prototype.getValue=function(e,t){let n;l(this.polygon._positions)&&(n=this.polygon._positions.getValue(e));let i;return l(this.polygon._holes)&&(i=this.polygon._holes.getValue(e),l(i)&&(i=i.map(function(r){return new Mc(r)}))),l(t)?(t.positions=n,t.holes=i,t):new Mc(n,i)};vV.prototype.equals=function(e){return this===e||e instanceof vV&&X.equals(this.polygon._positions,e.polygon._positions)&&X.equals(this.polygon._holes,e.polygon._holes)};function SFt(e,t,n,i){let r=t.polygon;if(!l(r))return;let o=Jo(r.interval),s=e.polygon;l(s)||(e.polygon=s=new rm),Ee(Boolean,s,"show",r.show,o,i,n),wV(s,"_positions",r.positions,n),fFt(s,"_holes",r.holes,n),(l(s._positions)||l(s._holes))&&(s.hierarchy=new vV(s)),Ee(Number,s,"height",r.height,o,i,n),Ee(We,s,"heightReference",r.heightReference,o,i,n),Ee(Number,s,"extrudedHeight",r.extrudedHeight,o,i,n),Ee(We,s,"extrudedHeightReference",r.extrudedHeightReference,o,i,n),Ee(vh,s,"stRotation",r.stRotation,o,i,n),Ee(Number,s,"granularity",r.granularity,o,i,n),Ee(Boolean,s,"fill",r.fill,o,i,n),ld(s,"material",r.material,o,i,n),Ee(Boolean,s,"outline",r.outline,o,i,n),Ee(z,s,"outlineColor",r.outlineColor,o,i,n),Ee(Number,s,"outlineWidth",r.outlineWidth,o,i,n),Ee(Boolean,s,"perPositionHeight",r.perPositionHeight,o,i,n),Ee(Boolean,s,"closeTop",r.closeTop,o,i,n),Ee(Boolean,s,"closeBottom",r.closeBottom,o,i,n),Ee(ln,s,"arcType",r.arcType,o,i,n),Ee(Pn,s,"shadows",r.shadows,o,i,n),Ee(Ht,s,"distanceDisplayCondition",r.distanceDisplayCondition,o,i,n),Ee(Qn,s,"classificationType",r.classificationType,o,i,n),Ee(Number,s,"zIndex",r.zIndex,o,i,n)}function wFt(e){return e?ln.GEODESIC:ln.NONE}function IFt(e,t,n,i){let r=t.polyline;if(!l(r))return;let o=Jo(r.interval),s=e.polyline;if(l(s)||(e.polyline=s=new il),Ee(Boolean,s,"show",r.show,o,i,n),wV(s,"positions",r.positions,n),Ee(Number,s,"width",r.width,o,i,n),Ee(Number,s,"granularity",r.granularity,o,i,n),ld(s,"material",r.material,o,i,n),ld(s,"depthFailMaterial",r.depthFailMaterial,o,i,n),Ee(ln,s,"arcType",r.arcType,o,i,n),Ee(Boolean,s,"clampToGround",r.clampToGround,o,i,n),Ee(Pn,s,"shadows",r.shadows,o,i,n),Ee(Ht,s,"distanceDisplayCondition",r.distanceDisplayCondition,o,i,n),Ee(Qn,s,"classificationType",r.classificationType,o,i,n),Ee(Number,s,"zIndex",r.zIndex,o,i,n),l(r.followSurface)&&!l(r.arcType)){let a={};Ee(Boolean,a,"followSurface",r.followSurface,o,i,n),s.arcType=WLt(a.followSurface,wFt)}}function PFt(e,t,n,i){let r=t.polylineVolume;if(!l(r))return;let o=Jo(r.interval),s=e.polylineVolume;l(s)||(e.polylineVolume=s=new Yx),wV(s,"positions",r.positions,n),dFt(s,"shape",r.shape,n),Ee(Boolean,s,"show",r.show,o,i,n),Ee(tr,s,"cornerType",r.cornerType,o,i,n),Ee(Boolean,s,"fill",r.fill,o,i,n),ld(s,"material",r.material,o,i,n),Ee(Boolean,s,"outline",r.outline,o,i,n),Ee(z,s,"outlineColor",r.outlineColor,o,i,n),Ee(Number,s,"outlineWidth",r.outlineWidth,o,i,n),Ee(Number,s,"granularity",r.granularity,o,i,n),Ee(Pn,s,"shadows",r.shadows,o,i,n),Ee(Ht,s,"distanceDisplayCondition",r.distanceDisplayCondition,o,i,n)}function DFt(e,t,n,i){let r=t.rectangle;if(!l(r))return;let o=Jo(r.interval),s=e.rectangle;l(s)||(e.rectangle=s=new om),Ee(Boolean,s,"show",r.show,o,i,n),Ee(ie,s,"coordinates",r.coordinates,o,i,n),Ee(Number,s,"height",r.height,o,i,n),Ee(We,s,"heightReference",r.heightReference,o,i,n),Ee(Number,s,"extrudedHeight",r.extrudedHeight,o,i,n),Ee(We,s,"extrudedHeightReference",r.extrudedHeightReference,o,i,n),Ee(vh,s,"rotation",r.rotation,o,i,n),Ee(vh,s,"stRotation",r.stRotation,o,i,n),Ee(Number,s,"granularity",r.granularity,o,i,n),Ee(Boolean,s,"fill",r.fill,o,i,n),ld(s,"material",r.material,o,i,n),Ee(Boolean,s,"outline",r.outline,o,i,n),Ee(z,s,"outlineColor",r.outlineColor,o,i,n),Ee(Number,s,"outlineWidth",r.outlineWidth,o,i,n),Ee(Pn,s,"shadows",r.shadows,o,i,n),Ee(Ht,s,"distanceDisplayCondition",r.distanceDisplayCondition,o,i,n),Ee(Qn,s,"classificationType",r.classificationType,o,i,n),Ee(Number,s,"zIndex",r.zIndex,o,i,n)}function RFt(e,t,n,i){let r=t.tileset;if(!l(r))return;let o=Jo(r.interval),s=e.tileset;l(s)||(e.tileset=s=new Wx),Ee(Boolean,s,"show",r.show,o,i,n),Ee(SV.default,s,"uri",r.uri,o,i,n),Ee(Number,s,"maximumScreenSpaceError",r.maximumScreenSpaceError,o,i,n)}function OFt(e,t,n,i){let r=t.wall;if(!l(r))return;let o=Jo(r.interval),s=e.wall;l(s)||(e.wall=s=new Rg),Ee(Boolean,s,"show",r.show,o,i,n),wV(s,"positions",r.positions,n),hOe(s,"minimumHeights",r.minimumHeights,n),hOe(s,"maximumHeights",r.maximumHeights,n),Ee(Number,s,"granularity",r.granularity,o,i,n),Ee(Boolean,s,"fill",r.fill,o,i,n),ld(s,"material",r.material,o,i,n),Ee(Boolean,s,"outline",r.outline,o,i,n),Ee(z,s,"outlineColor",r.outlineColor,o,i,n),Ee(Number,s,"outlineWidth",r.outlineWidth,o,i,n),Ee(Pn,s,"shadows",r.shadows,o,i,n),Ee(Ht,s,"distanceDisplayCondition",r.distanceDisplayCondition,o,i,n)}function yOe(e,t,n,i,r){let o=e.id;if(l(o)||(o=Kn()),Mie=o,!l(r._version)&&o!=="document")throw new oe("The first CZML packet is required to be the document object.");if(e.delete===!0)t.removeById(o);else if(o==="document")AFt(e,r);else{let s=t.getOrCreateEntity(o),a=e.parent;l(a)&&(s.parent=t.getOrCreateEntity(a));for(let c=n.length-1;c>-1;c--)n[c](s,e,t,i)}Mie=void 0}function MFt(e){let t,n=e._documentPacket.clock;if(!l(n)){if(!l(e._clock)){let r=e._entityCollection.computeAvailability();if(!r.start.equals(nt.MINIMUM_VALUE)){let o=r.start,s=r.stop,a=K.secondsDifference(s,o),c=Math.round(a/120);return t=new Zm,t.startTime=K.clone(o),t.stopTime=K.clone(s),t.clockRange=As.LOOP_STOP,t.multiplier=c,t.currentTime=K.clone(o),t.clockStep=zr.SYSTEM_CLOCK_MULTIPLIER,e._clock=t,!0}}return!1}l(e._clock)?t=e._clock.clone():(t=new Zm,t.startTime=nt.MINIMUM_VALUE.clone(),t.stopTime=nt.MAXIMUM_VALUE.clone(),t.currentTime=nt.MINIMUM_VALUE.clone(),t.clockRange=As.LOOP_STOP,t.clockStep=zr.SYSTEM_CLOCK_MULTIPLIER,t.multiplier=1);let i=Jo(n.interval);return l(i)&&(t.startTime=i.start,t.stopTime=i.stop),l(n.currentTime)&&(t.currentTime=K.fromIso8601(n.currentTime)),l(n.range)&&(t.clockRange=As[n.range]??As.LOOP_STOP),l(n.step)&&(t.clockStep=zr[n.step]??zr.SYSTEM_CLOCK_MULTIPLIER),l(n.multiplier)&&(t.multiplier=n.multiplier),t.equals(e._clock)?!1:(e._clock=t.clone(e._clock),!0)}function TOe(e,t,n,i){n=n??H.EMPTY_OBJECT;let r=t,o=n.sourceUri,s=n.credit;if(typeof s=="string"&&(s=new It(s)),e._credit=s,typeof t=="string"||t instanceof De){t=De.createIfNeeded(t),r=t.fetchJson(),o=o??t.clone();let a=e._resourceCredits,c=t.credits;if(l(c)){let u=c.length;for(let f=0;f<u;f++)a.push(c[f])}}return o=De.createIfNeeded(o),xs.setLoading(e,!0),Promise.resolve(r).then(function(a){return NFt(e,a,o,i)}).catch(function(a){return xs.setLoading(e,!1),e._error.raiseEvent(e,a),console.log(a),Promise.reject(a)})}function NFt(e,t,n,i){xs.setLoading(e,!0);let r=e._entityCollection;i&&(e._version=void 0,e._documentPacket=new EOe,r.removeAll()),aa._processCzml(t,r,n,void 0,e);let o=MFt(e),s=e._documentPacket;return l(s.name)&&e._name!==s.name?(e._name=s.name,o=!0):!l(e._name)&&l(n)&&(e._name=$_(n.getUrlComponent()),o=!0),xs.setLoading(e,!1),o&&e._changed.raiseEvent(e),e}function EOe(){this.name=void 0,this.clock=void 0}function aa(e){this._name=e,this._changed=new be,this._error=new be,this._isLoading=!1,this._loading=new be,this._clock=void 0,this._documentPacket=new EOe,this._version=void 0,this._entityCollection=new Ua(this),this._entityCluster=new Of,this._credit=void 0,this._resourceCredits=[]}aa.load=function(e,t){return new aa().load(e,t)};Object.defineProperties(aa.prototype,{name:{get:function(){return this._name}},clock:{get:function(){return this._clock}},entities:{get:function(){return this._entityCollection}},isLoading:{get:function(){return this._isLoading}},changedEvent:{get:function(){return this._changed}},errorEvent:{get:function(){return this._error}},loadingEvent:{get:function(){return this._loading}},show:{get:function(){return this._entityCollection.show},set:function(e){this._entityCollection.show=e}},clustering:{get:function(){return this._entityCluster},set:function(e){this._entityCluster=e}},credit:{get:function(){return this._credit}}});aa.updaters=[pFt,gFt,_Ft,yFt,bFt,xFt,TFt,EFt,nFt,iFt,CFt,vFt,SFt,IFt,PFt,aFt,DFt,rFt,RFt,oFt,OFt,sFt,hFt];aa.registerUpdater=function(e){aa.updaters.includes(e)||aa.updaters.push(e)};aa.unregisterUpdater=function(e){if(aa.updaters.includes(e)){let t=aa.updaters.indexOf(e);aa.updaters.splice(t,1)}};aa.prototype.process=function(e,t){return TOe(this,e,t,!1)};aa.prototype.load=function(e,t){return TOe(this,e,t,!0)};aa.prototype.update=function(e){return!0};aa.processPacketData=Ee;aa.processPositionPacketData=xOe;aa.processMaterialPacketData=ld;aa._processCzml=function(e,t,n,i,r){if(i=i??aa.updaters,Array.isArray(e))for(let o=0,s=e.length;o<s;++o)yOe(e[o],t,i,n,r);else yOe(e,t,i,n,r)};var IV=aa;N0();Ec();uC();W9();WV();var eNe={type:"module"},sre="error",xBt="messageerror",tNe,ore,nNe,are=!0;try{are=typeof structuredClone==Bo&&structuredClone(new DOMException("","AbortError")).code!==Ue}catch{}ZMe(TBt);function TBt(e,t){let{baseURI:n,chunkSize:i,workerStartupTimeout:r}=t,{wasmURI:o}=t;if(!e.interface){typeof o==Bo&&(o=o());let s;try{s=K9(e.workerURI,n,e)}catch{return ire(e),rre(e,t)}Object.assign(e,{worker:s,workerAlive:!1,terminated:!1,startupError:null,interface:{run:async()=>{try{return await EBt(e,{chunkSize:i,wasmURI:o,baseURI:n,workerStartupTimeout:r})}catch(a){if(a&&a.workerStartupFailed)return ire(e),iNe(e),X9(e,t);if(a&&a.codecImportFailed){if(e.reader)return iNe(e),X9(e,t);e.onTaskFinished()}throw a}}}})}return e.interface}async function EBt(e,t){if(!e.worker){let{startupError:g}=e;e.startupError=null;let m=g||new Error(mC);throw m.workerStartupFailed=!0,m}let n,i,r=new Promise((g,m)=>{n=g,i=m});Object.assign(e,{reader:null,writer:null,resolveResult:n,rejectResult:i,result:r});let{readable:o,options:s}=e,{writable:a,closed:c,abortPipe:u}=CBt(e.writable),f;try{f=cre({type:qMe,options:s,config:t,readable:o,writable:a},e)}catch(g){u();try{await c}catch{}throw e.onTaskFinished(),g}f||Object.assign(e,{reader:o.getReader(),writer:a.getWriter()});let{workerStartupTimeout:d}=t;!e.workerAlive&&Number.isFinite(d)&&d>=0&&(e.startupTimeout=setTimeout(()=>vBt(e),d));try{let g=await r;return await p(),await c,g}catch(g){await p(),u();try{await c}catch{}throw g}async function p(){if(!f&&!a.locked)try{await a.getWriter().close()}catch{}}}function CBt(e){let t=new AbortController,{writable:n,readable:i}=new null,r=i.pipeTo(e,{preventClose:!0,preventAbort:!0,signal:t.signal});return r.catch(()=>{}),{writable:n,closed:r,abortPipe:()=>t.abort()}}function iNe(e){let{reader:t}=e;t&&t.releaseLock(),e.reader=null,e.writer=null}function lre(e){let{worker:t}=e;if(t)try{t.terminate()}catch{}e.interface=null}function K9(e,t,n,i,r=!0){let{createWorker:o}=n,s,a,c;if(o)s=o();else if(ore===Ue||tNe!==e){let u=typeof e==Bo;u?a=e(r):a=e;let f=a.startsWith("data:"),d=a.startsWith("blob:");if(f||d){i===Ue&&(i=!1),i&&(c=eNe);try{s=new Worker(a,c)}catch(p){if(d)try{URL.revokeObjectURL(a)}catch{}if(u&&d)return K9(e,t,n,i,!1);if(i)throw p;return K9(e,t,n,!0,!1)}}else{i===Ue&&(i=!0),i&&(c=eNe);try{a=new URL(a,t)}catch{}try{s=new Worker(a,c)}catch(p){if(i)return K9(e,t,n,!1,r);throw p}}tNe=e,ore=a,nNe=c}else s=new Worker(ore,nNe);return s.addEventListener(WMe,u=>{n.workerAlive=!0,oNe(n),SBt(u,n)}),s.addEventListener(sre,u=>rNe(u,n)),s.addEventListener(xBt,u=>rNe(u,n)),s}function vBt(e){if(e.startupTimeout=null,e.workerAlive)return;let{rejectResult:t,writer:n}=e;if(lre(e),e.worker=null,t){let i=new Error(mC);i.workerStartupFailed=!0,t(i),n&&n.releaseLock()}}function oNe(e){let{startupTimeout:t}=e;t&&(clearTimeout(t),e.startupTimeout=null)}function rNe(e,t){e.preventDefault&&e.preventDefault(),oNe(t);let{workerAlive:n,rejectResult:i,writer:r,onTaskFinished:o}=t;lre(t),n||(t.worker=null);let s=e.error||new Error(e.message||sre);n||(s=Object.assign(new Error(s.message||sre),{workerStartupFailed:!0}),t.startupError=s),i&&(i(s),r&&r.releaseLock(),n&&o())}function cre(e,{worker:t,writer:n,transferStreams:i,workerAlive:r}){try{let{value:o,readable:s,writable:a}=e,c=[];if(o&&(e.value=I9(o),c.push(e.value.buffer)),i&&are&&r?(s&&c.push(s),a&&c.push(a)):e.readable=e.writable=null,c.length)try{return t.postMessage(e,c),!0}catch{are=!1,e.readable=e.writable=null,t.postMessage(e)}else t.postMessage(e)}catch(o){throw n&&n.releaseLock(),o}}async function SBt({data:e},t){let{type:n,value:i,messageId:r,result:o,error:s}=e,{reader:a,writer:c,resolveResult:u,rejectResult:f,onTaskFinished:d,generation:p}=t,g=()=>t.generation!=p;try{if(s){let{message:y,stack:A,code:b,name:x,outputSize:T,cause:E,codecImportFailed:v}=s,S=new Error(y);Object.assign(S,{stack:A,code:b,name:x,outputSize:T}),E&&(S.cause=Object.assign(new Error(E.message),{name:E.name})),v&&(S.codecImportFailed=!0),m(S)}else{if(n==YMe){let{value:y,done:A}=await a.read();g()||cre({type:Qie,value:y,done:A,messageId:r},t)}n==Qie&&(await c.ready,await c.write(new Uint8Array(i)),g()||cre({type:XMe,messageId:r},t)),n==KMe&&m(null,o)}}catch(y){g()||(lre(t),m(y))}function m(y,A){g()||(y?f(y):u(A),c&&c.releaseLock(),y&&y.codecImportFailed||d())}}Doe();Ec();N0();dC();WV();Q9();r7();Hie();uC();QI();Bre();DV();var joe="File already exists",Hoe="Zip file comment exceeds 64KB",oLe="Invalid zip file comment (must be a Uint8Array)",sLe="File entry comment exceeds 64KB",aLe="Invalid file entry comment (must be a string)",cLe="Invalid date (must be a valid Date instance)",lLe="File entry name exceeds 64KB",Goe="Version exceeds 65535",uLe="The strength must equal 1, 2, or 3",fLe="Encryption is not supported in USDZ files",dLe="Encryption is not supported when the 'passThrough' option is set",hLe="Invalid extra field (must be a Map)",mLe="Invalid extra field type (must be integer 0..65535)",pLe="Invalid extra field data (must be a Uint8Array)",N7="Extra field data exceeds 64KB",W2t="Compression method not supported",gLe=-2147483648,_Le=2147483647,KNe=BigInt(0),$Ne=BigInt("0x7fffffffffffffff"),L7="Zip64 is not supported (set the 'zip64' option to 'true')",yLe="Undefined uncompressed size",ALe="Undefined compression method";var bLe="Undefined reader",xLe="Zip file not empty",TLe="Invalid uid (must be integer 0..2^32-1)",ELe="Invalid gid (must be integer 0..2^32-1)",CLe="Invalid UNIX mode (must be integer 0..65535)",vLe="Invalid unixExtraFieldType (must be 'infozip' or 'unix')",SLe="uid/gid must be 0..65535 for unixExtraFieldType 'unix' (use 'infozip' for larger ids)",wLe="Invalid msdosAttributesRaw (must be integer 0..255)",ILe="Invalid msdosAttributes (must be an object with boolean flags)",PLe="Invalid level (must be integer 0..9)",DLe="Signature data exceeds 64KB",JNe=new Uint8Array([7,0,2,0,65,69,3,0,0]),q2t=4,Y2t=9,X2t=67,K2t=1,Boe="infozip",koe="unix",$2t=9,Roe=0,ZNe=[],a4=class{constructor(t,n={}){t=new uP(t);let{availableSize:i=aC,maxSize:r=aC}=t,o=i>0&&i!==aC&&r>0&&r!==aC;Object.assign(this,{writer:t,addSplitZipSignature:o,options:n,fileEntries:new Map,filenames:new Set,offset:n[PV]===Ue?t.size||t.writable.size||0:n[PV],initialOffset:n[PV]===Ue?0:n[PV]-(t.size||t.writable.size||0),pendingAddFileCalls:new Set,pendingErrors:[],bufferedWrites:0,lastFileEntry:Ue})}prependZip(t){return Ooe(this,J2t(this,t))}appendZip(t){return Ooe(this,this.appendZipEntries(t))}async appendZipEntries(t){let n=this,{pendingAddFileCalls:i,filenames:r,fileEntries:o}=n;for(;i.size;)await Promise.allSettled(Array.from(i));let s,a=new Promise(f=>s=f);i.add(a);let c=[],u;try{t=new oy(t),await jc(t),(t.size===Ue||!t.readUint8Array)&&(t=new uf(await B0(t.readable)),await jc(t));let{ZipReader:f}=await Promise.resolve().then(()=>(Doe(),WNe)),d=new f(t),p=await d.getEntries();await d.close(),await jc(n.writer);let{directoryOffset:g}=d;p.forEach(({filename:A})=>{if(r.has(A))throw new Error(joe);r.add(A),c.push(A)}),n.writerLocked=!0;let{lockWriter:m}=n;n.lockWriter=new Promise(A=>u=()=>{n.writerLocked=!1,A()}),await m,n.addSplitZipSignature&&(delete n.addSplitZipSignature,await gkt(t)||(await j0(n.writer,OLe()),n.offset+=4));let y=await _kt(n,t,p,g);p.forEach(A=>{let{version:b,rawLastModDate:x,rawFilename:T,bitFlag:E,encrypted:v,uncompressedSize:S,compressedSize:I,extraFieldZip64:R}=A,{compressionMethod:O,rawExtraField:L}=A,{level:_,languageEncodingFlag:C,dataDescriptor:w}=E;L=RLe(L||gr),A.extraFieldAES&&(O=99);let P=ar(L),M=!!R&&R.uncompressedSize!==Ue,F=!!R&&R.compressedSize!==Ue,V=BLe(_,C,w,v,O)&-7|_<<1,{headerArray:B,headerView:j}=FLe({version:b,bitFlag:V,compressionMethod:O,uncompressedSize:S,compressedSize:I,rawLastModDate:x,rawFilename:T,zip64CompressedSize:F,zip64UncompressedSize:M,extraFieldLength:P}),{crc32:k}=A;k!==Ue&&Hc(j,10,k);let{offset:G,diskNumberStart:q}=y.get(A);Object.assign(A,{zip64UncompressedSize:M,zip64CompressedSize:F,offset:G,diskNumberStart:q,zip64DiskNumberStart:!1,rawExtraFieldZip64:gr,rawExtraFieldAES:gr,rawExtraFieldExtendedTimestamp:gr,rawExtraFieldNTFS:gr,rawExtraFieldUnix:gr,rawExtraField:L,rawCentralExtraField:gr,extendedTimestamp:!1,headerArray:B,headerView:j}),o.set(A.filename,A)})}catch(f){throw c.forEach(d=>r.delete(d)),f}finally{s(),i.delete(a),u&&u()}}add(t="",n,i={}){let r=this,{pendingAddFileCalls:o}=r,s=Z2t(r,t,n,i);o.add(s);let a=()=>o.delete(s);return Promise.prototype.then.call(s,a,a),Ooe(r,s)}remove(t){let{filenames:n,fileEntries:i}=this;if(typeof t==cC&&(t=i.get(t)),t&&t.filename!==Ue){let{filename:r}=t;if(n.has(r)&&i.has(r))return n.delete(r),i.delete(r),!0}return!1}async close(t=gr,n={}){let i=this,{pendingAddFileCalls:r,writer:o}=this,{writable:s}=o;if(!(t instanceof Uint8Array))throw new Error(oLe);if(ar(t)>65535)throw new Error(Hoe);for(;r.size;)await Promise.allSettled(Array.from(r));await Promise.allSettled(i.pendingErrors.map(u=>u.recorded));let a=i.pendingErrors.filter(u=>u.error&&!u.observed);if(a.length){let u=a.map(d=>d.error);a.forEach(d=>d.observed=!0);let[f]=u;try{f.entryErrors=u}catch{}throw f}return await fkt(i,t,n),!i7(o)&&Ji(i,n,T9)||await s.getWriter().close(),o.getData?o.getData():s}};var Uoe=class extends Promise{then(t,n){let{watcher:i}=this;return i&&(i.observed=!0),super.then(t,n)}};function Ooe(e,t){let n=new Uoe((r,o)=>Promise.prototype.then.call(t,r,o)),i={};return n.watcher=i,i.recorded=Promise.prototype.then.call(n,Ue,r=>i.error=r),e.pendingErrors.push(i),n}async function J2t(e,t){if(e.filenames.size)throw new Error(xLe);await e.appendZipEntries(t)}async function Z2t(e,t,n,i){if(i=Object.assign({},i),Ji(e,i,gC)&&!t.endsWith("/")&&(t+="/"),e.filenames.has(t))throw new Error(joe);e.filenames.add(t),Roe<ny().maxWorkers?Roe++:await new Promise(r=>ZNe.push(r));try{return await Q2t(e,t,n,i)}catch(r){throw e.filenames.delete(t),r}finally{let r=ZNe.shift();r?r():Roe--}}async function Q2t(e,t,n,i){let r=ekt(e,t,i);({name:t}=r);let o=tkt(e,t,i),{comment:s}=o,a=i[l7];e.fileEntries.set(t,Ue);let c=e.lastFileEntry,u={},f;o.resolvedOptions.keepOrder&&(u.lockFileEntry=new Promise(p=>f=p)),e.lastFileEntry=u;let d;try{let{resolvedOptions:p}=o;p.level!=0&&p.compressionMethod===Ue&&!p.passThrough&&!await QMe(ny())&&(p.level=0);let g=await nkt(e,n,o,i);({reader:n}=g);let m=c4(e.writer),y=cy(e.writer);i=Object.assign({},i,r.resolvedOptions,o.resolvedOptions,g.resolvedOptions,{signature:i[c7],crc32:i.crc32===Ue?i[c7]:i.crc32,offset:e.offset-m,diskNumberStart:y,[WI]:e.options[WI]});let A=skt(i),b=ckt(i),x=ar(A.localHeaderArray,b.dataDescriptorArray);d=await rkt(e,t,n,{headerInfo:A,dataDescriptorInfo:b,metadataSize:x,fileEntry:u,previousFileEntry:c,releaseLockFileEntry:f},i)}catch(p){throw e.fileEntries.delete(t),p}finally{f&&f(c&&c.lockFileEntry)}return Object.assign(d,{name:t,comment:s,extraField:a,[o7]:d.internalFileAttributes,[s7]:d.externalFileAttributes}),new wb(d)}function ekt(e,t,n){let i=Ji(e,n,Sre),r=Ji(e,n,Pre,i?20:768),o=Ji(e,n,Rre),s=xP(e,n,"uid"),a=xP(e,n,"gid"),c=xP(e,n,Mre),u=Ji(e,n,JOe),f=Ji(e,n,Nre),d=Ji(e,n,Lre),p=Ji(e,n,Fre);if(YI(s,4294967295,TLe),YI(a,4294967295,ELe),YI(c,65535,CLe),u!==Ue&&u!==Boe&&u!==koe)throw new Error(vLe);if(u===koe&&(s!==Ue&&s>65535||a!==Ue&&a>65535))throw new Error(SLe);u===Ue&&(s!==Ue||a!==Ue)&&(u=Boe);let g=xP(e,n,Cre),m=Ji(e,n,vre),y=s!==Ue||a!==Ue||c!==Ue||u||o,A=g!==Ue||m!==Ue;if(y?(i=!1,r=r&255|768):A&&(i=!0,r=r&255),YI(g,255,wLe),m&&(typeof m!==COe||Array.isArray(m)))throw new Error(ILe);if(r>65535)throw new Error(Goe);let b=LLe(e,n,Ere,s7),x=b!==Ue;x||(b=0),!n[gC]&&t.endsWith("/")&&(n[gC]=!0);let T=Ji(e,n,gC);if(T?(t.endsWith("/")||(t+="/"),x||(b=16,i||(b|=16877<<16))):!i&&!x&&(o?b=493<<16:b=420<<16),!i){let S=c!==Ue||!!(f||d||p),I=b>>16&65535;c=c===Ue?I:c&65535,f?c|=2048:f=!!(c&2048),d?c|=1024:d=!!(c&1024),p?c|=512:p=!!(c&512),(!x||S)&&(T?c=c&-61441|16384:c&61440||(c|=32768),b=(c&65535)<<16|b&65535)}({msdosAttributesRaw:g,msdosAttributes:m}=akt(g,m)),A&&(b=b&4294967295|g&255);let E=b>>16&65535,v=c!==Ue&&(c&61440)==40960;return{name:t,resolvedOptions:{versionMadeBy:r,msDosCompatible:!!i,externalFileAttributes:b,unixExternalUpper:E,uid:s,gid:a,unixMode:c,unixExtraFieldType:u,symlink:v,setuid:f,setgid:d,sticky:p,msdosAttributesRaw:g,msdosAttributes:m}}}function tkt(e,t,n){let i=zoe(e,n,$Oe)||KI,r=i(t,E9);if(r===Ue&&(r=KI(t)),ar(r)>65535)throw new Error(lLe);let o=n[$V]||"";if(typeof o!=cC)throw new Error(aLe);let s=i(o,C9);if(s===Ue&&(s=KI(o)),ar(s)>65535)throw new Error(sLe);let a=Ji(e,n,Ire);if(a!==Ue&&a>65535)throw new Error(Goe);let c=Foe(e,n,fP,new Date),u=Ji(e,n,dP),f=Foe(e,n,ZV),d=Foe(e,n,QV),p=LLe(e,n,Tre,o7,0),g=Ji(e,n,_9),m=Ji(e,n,p9),y=Ji(e,n,g9);w9(m,y);let A=xP(e,n,zOe,3),b=Ji(e,n,Dre),x=Ji(e,n,VOe,!0),T=Ji(e,n,jOe),E=Ji(e,n,HOe,!0),v=Ji(e,n,A9),S=Ji(e,n,x9),I=Ji(e,n,WOe),R=zoe(e,n,qOe),O=Ji(e,n,YOe,!0),L=S9(Ji(e,n,y9)),_=Ji(e,n,XOe,!0),C=Ji(e,n,Ore),w=g||C===Ue?Ue:B9(C);if(!g&&C!==Ue&&C!==0&&C!==8&&!w)throw new Error(W2t);let P=xP(e,n,GOe);if(YI(P,$2t,PLe),e.options[WI]){if(m!==Ue||y!==Ue)throw new Error(fLe);P===Ue&&C===Ue&&(P=0)}g&&(P=Ue);let M=Ji(e,n,b9),F=Ji(e,n,Bie);I&&F===Ue&&(F=!1),(F===Ue||b&&!g)&&(F=!0),P!==Ue&&P!=6&&(M=!1);let V=Ji(e,n,a7);if(!b&&(m!==Ue||y!==Ue)&&!(Number.isInteger(A)&&A>=1&&A<=3))throw new Error(uLe);let B=Moe(n[l7]),j=Moe(n[ZOe]),k=Moe(n[QOe]);return{comment:o,resolvedOptions:{rawFilename:r,rawComment:s,version:a,lastModDate:c,rawLastModDate:u,lastAccessDate:f,creationDate:d,internalFileAttributes:p,passThrough:g,password:m,rawPassword:y,encryptionStrength:A,zipCrypto:b,extendedTimestamp:x,ntfsTimestamp:T,keepOrder:E,useWebWorkers:v,transferStreams:S,bufferedWrite:I,createTempStream:R,dataDescriptorSignature:O,signal:L,useUnicodeFileNames:_,compressionMethod:C,format:w?w.format:Ue,codecURI:w?w.codecURI:Ue,codecVersionNeeded:w?w.versionNeeded:Ue,level:P,useCompressionStream:M,dataDescriptor:F,zip64:V,rawExtraField:B,rawLocalExtraField:j,rawCentralExtraField:k}}}function Moe(e){if(!e)return gr;if(!(e instanceof Map))throw new Error(hLe);let t=0,n=0;e.forEach((o,s)=>{if(zie(s,65535,mLe),!(o instanceof Uint8Array))throw new Error(pLe);if(ar(o)>65535)throw new Error(N7);t+=4+ar(o)});let i=new Uint8Array(t),r=di(i);return e.forEach((o,s)=>{V0(r,n,s),V0(r,n+2,ar(o)),f4(i,o,n+4),n+=4+ar(o)}),i}async function nkt(e,t,{resolvedOptions:n},i){if(n.passThrough&&!t&&!Ji(e,i,gC))throw new Error(bLe);let r;return t&&(t=new oy(t),await jc(t),{size:r}=t),Object.assign({reader:t},ikt(e,!!t,r,n,i))}function ikt(e,t,n,i,r){let{passThrough:o,zipCrypto:s,password:a,rawPassword:c,encryptionStrength:u}=i,{dataDescriptor:f,zip64:d,level:p,compressionMethod:g}=i,m=0,y=0;if(o&&t){if(y=r[JV],y===Ue)throw new Error(yLe);if(g===Ue)throw new Error(ALe)}let A=d===!0,b=Ji(e,r,wre);if(t&&o&&!b&&ar(a,c))throw new Error(dLe);let x=t&&(!!(a&&ar(a)||c&&ar(c))||o&&b);t||(p=0,g=0);let T=x?s?12:16+u*4:0;t&&(o?(r.uncompressedSize=y,m=n===Ue?rLe(y)+T:n):n===Ue?(f=!0,(d||d===Ue)&&(d=!0,y=m=4294967296)):(r.uncompressedSize=y=n,m=(Voe(g,p)?rLe(y):y)+T));let E=!x&&(!t||n===0&&!o)&&!Voe(g,p);E&&!s&&Ji(e,r,Bie)===Ue&&(f=!1);let v=A||y>=4294967295,S=A||m>=4294967295;if(v||S){if(d===!1)throw new Error(L7);d=!0}return d=d||!1,{maximumCompressedSize:m,resolvedOptions:{dataDescriptor:f,emptyEntry:E,zip64:d,zip64UncompressedSize:v,zip64CompressedSize:S,uncompressedSize:y,level:p,compressionMethod:g,encrypted:x}}}async function rkt(e,t,n,i,r){let{fileEntries:o,writer:s}=e,{keepOrder:a,dataDescriptor:c,emptyEntry:u,signal:f}=r,{headerInfo:d,fileEntry:p,previousFileEntry:g,releaseLockFileEntry:m}=i,y=e.options[WI],A=p,b,x,T,E,v,S=0,I,R=a&&g?g.lockFileEntry:Ue;o.set(t,A);try{r.bufferedWrite||!a||e.writerLocked||e.bufferedWrites||!c&&!u?(b=!0,e.bufferedWrites++,r.createTempStream?I=await r.createTempStream():I=new null(Ue,Ue,{highWaterMark:aC}),I.size=0,await jc(s)):(I=s,await R,await O()),await jc(I);let _=c4(s);e.addSplitZipSignature&&!b&&await tLe(e,s),y&&!b&&QNe(i,e.offset-_);let{localHeaderArray:C}=d;b||await L();let w=cy(s),P=l4(e,s);if(A.diskNumberStart=w,b||(E=!0,v=s.size,await j0(I,C)),A=await okt(n,I,A,i,ny(),r),b||(E=!1),o.set(t,A),A.filename=t,b){if(await Promise.all([I.writable.getWriter().close(),R]),await O(),e.addSplitZipSignature&&await tLe(e,s),T=!0,v=s.size,await L(),A.diskNumberStart=cy(s),A.offset=l4(e,s),y){let M=i.metadataSize;QNe(i,e.offset-c4(s)),A.size+=i.metadataSize-M}ukt(A,d.localHeaderView,r),await j0(s,d.localHeaderArray),await MLe(I.readable,s,f,M=>S+=M),s.size+=I.size,T=!1}else A.diskNumberStart=w,A.offset=P;return e.offset+=A.size,A}catch(_){if(T||E){if(e.hasCorruptedEntries=!0,_)try{_.corruptedEntry=!0}catch{}e.offset+=s.size-v,b&&(e.offset+=S)}throw o.delete(t),_}finally{if(b&&e.bufferedWrites--,m&&m(R),x&&x(),b&&I&&I.dispose)try{await I.dispose()}catch{}}async function O(){e.writerLocked=!0;let{lockWriter:_}=e;e.lockWriter=new Promise(C=>x=()=>{e.writerLocked=!1,C()}),await _}async function L(){TP(s,ar(d.localHeaderArray))&&await s.closeDisk()}}async function okt(e,t,{diskNumberStart:n,lockFileEntry:i},r,o,s){let{headerInfo:a,dataDescriptorInfo:c,metadataSize:u}=r,{headerArray:f,headerView:d,lastModDate:p,rawLastModDate:g,encrypted:m,compressed:y,version:A,compressionMethod:b,rawExtraFieldZip64:x,localExtraFieldZip64Length:T,rawExtraFieldExtendedTimestamp:E,extraFieldExtendedTimestampFlag:v,rawExtraFieldNTFS:S,rawExtraFieldUnix:I,rawExtraFieldAES:R}=a,{dataDescriptorArray:O}=c,{rawFilename:L,lastAccessDate:_,creationDate:C,password:w,rawPassword:P,level:M,zip64:F,zip64UncompressedSize:V,zip64CompressedSize:B,zipCrypto:j,dataDescriptor:k,directory:G,executable:q,versionMadeBy:Q,rawComment:W,rawExtraField:J,rawCentralExtraField:Z,useWebWorkers:ae,transferStreams:Ae,onstart:fe,onprogress:xe,onend:ge,signal:we,encryptionStrength:Se,extendedTimestamp:Re,msDosCompatible:Qe,internalFileAttributes:He,externalFileAttributes:Xe,uid:$e,gid:Pe,unixMode:qe,symlink:st,setuid:vt,setgid:Gt,sticky:lt,unixExternalUpper:mt,msdosAttributesRaw:ft,msdosAttributes:Xt,useCompressionStream:rt,passThrough:ht,format:Bi,codecURI:Xn}=s,bi={lockFileEntry:i,versionMadeBy:Q,zip64:F,directory:!!G,executable:!!q,filenameUTF8:!0,rawFilename:L,commentUTF8:!0,rawComment:W,rawExtraFieldZip64:x,localExtraFieldZip64Length:T,rawExtraFieldExtendedTimestamp:E,rawExtraFieldNTFS:S,rawExtraFieldUnix:I,rawExtraFieldAES:R,rawExtraField:J,rawCentralExtraField:Z,extendedTimestamp:Re,msDosCompatible:Qe,internalFileAttributes:He,externalFileAttributes:Xe,diskNumberStart:n,uid:$e,gid:Pe,unixMode:qe,symlink:!!st,setuid:vt,setgid:Gt,sticky:lt,unixExternalUpper:mt,msdosAttributesRaw:ft,msdosAttributes:Xt},{crc32:Wi,uncompressedSize:wi}=s,hi=0;ht||(wi=0);let{writable:xi}=t;if(e){let jn=tp(hre(e)),nn=e.size,Wn={options:{codecType:rP,inputSize:nn,level:M,rawPassword:P,password:w,encryptionStrength:Se,zipCrypto:m&&j,passwordVerification:m&&j&&g>>8&255,computeCrc32:!ht,compressed:y&&!ht,encrypted:m&&!ht,useWebWorkers:ae,useCompressionStream:rt,transferStreams:Ae,format:Bi,codecURI:Xn,compressionMethod:b},config:o,streamOptions:{signal:we,size:nn,onstart:fe,onprogress:xe,onend:ge}};try{let Zi=await Z9({readable:jn,writable:xi},Wn);if(hi=Zi.outputSize,t.size+=hi,ht||(wi=Zi.inputSize,(!m||j)&&(Wi=Zi.crc32)),!B&&hi>=4294967295||!V&&wi>=4294967295)throw new Error(L7)}catch(Zi){throw Zi.outputSize!==Ue&&(t.size+=Zi.outputSize),Zi}}return lkt({crc32:Wi,compressedSize:hi,uncompressedSize:wi,headerInfo:a,dataDescriptorInfo:c},s),k&&await j0(t,O),Object.assign(bi,{uncompressedSize:wi,compressedSize:hi,lastModDate:p,rawLastModDate:g,creationDate:C,lastAccessDate:_,encrypted:!!m,zipCrypto:!!j,size:u+hi,compressionMethod:b,version:A,headerArray:f,headerView:d,signature:Wi,crc32:m&&!j&&!ht?Ue:Wi,extraFieldExtendedTimestampFlag:v,zip64UncompressedSize:V,zip64CompressedSize:B}),bi}function skt(e){let{rawFilename:t,lastModDate:n,rawLastModDate:i,lastAccessDate:r,creationDate:o,level:s,zip64:a,zipCrypto:c,useUnicodeFileNames:u,dataDescriptor:f,directory:d,rawExtraField:p,rawLocalExtraField:g,encryptionStrength:m,extendedTimestamp:y,ntfsTimestamp:A,passThrough:b,encrypted:x,zip64UncompressedSize:T,zip64CompressedSize:E,uncompressedSize:v,crc32:S}=e,{version:I,compressionMethod:R}=e,O=!d&&Voe(R,s),L,_=b||!O,C=a&&(e.bufferedWrite||!f||!T&&!E||_),w=C||a&&f&&(T||E);if(a&&(T||E)){let ge=fd(20);if(ge.writeUint16(1),ge.writeUint16(16),L=ge.array,C&&(ge.writeUint64(v),_)){let we=x?c?12:16+m*4:0;ge.writeUint64(b?0:v+we)}}else L=gr;let P;if(x&&!c){let xe=fd(ar(JNe)+2);xe.writeUint16(39169),xe.writeBytes(JNe),P=xe.array,P[8]=m}else P=gr;let M,F,V;if(y){let xe=R7(n),ge=NLe(xe);if(ge){let Se=9+(r?4:0)+(o?4:0),Re=fd(Se);V=1+(r?2:0)+(o?4:0),Re.writeUint16(21589),Re.writeUint16(Se-4),Re.writeUint8(V),Re.writeUint32(xe),r&&Re.writeUint32(nLe(R7(r))),o&&Re.writeUint32(nLe(R7(o))),F=Re.array}else F=gr;if(A===Ue?!ge||!!(r||o):A)try{let Se=Loe(n),Re=fd(36);Re.writeUint16(10),Re.writeUint16(32),Re.skip(4),Re.writeUint16(1),Re.writeUint16(24),Re.writeUint64(Se),Re.writeUint64(r?Loe(r):Se),Re.writeUint64(o?Loe(o):Se),M=Re.array}catch{M=gr}else M=gr}else M=F=gr;let B;try{let{uid:xe,gid:ge,unixExtraFieldType:we}=e;if(we==Boe&&(xe!==Ue||ge!==Ue)){let Se=eLe(xe===Ue?0:xe),Re=eLe(ge===Ue?0:ge),Qe=3+Se.length+Re.length,He=fd(4+Qe);He.writeUint16(30837),He.writeUint16(Qe),He.writeUint8(1),He.writeUint8(Se.length),He.writeBytes(Se),He.writeUint8(Re.length),He.writeBytes(Re),B=He.array}else if(we==koe&&(xe!==Ue||ge!==Ue)){let Se=fd(8);Se.writeUint16(30805),Se.writeUint16(4),Se.writeUint16((xe===Ue?0:xe)&65535),Se.writeUint16((ge===Ue?0:ge)&65535),B=Se.array}else B=gr}catch{B=gr}R===Ue&&(R=O?8:0),I===Ue&&(I=R==0&&!d&&!x?10:20);let{codecVersionNeeded:j}=e;O&&j!==Ue&&(I=I>j?I:j),a&&(I=I>45?I:45),x&&!c&&(I=I>51?I:51,b&&S!==Ue&&(P[q2t]=K2t),V0(di(P),Y2t,R),R=99);let k=w?ar(L):0,G=k+ar(P,F,M,B,p,g),q=e[WI]?X2t:0;if(G+q>65535)throw new Error(N7);let Q=new Date(Math.ceil(Math.floor(n.getTime()/1e3)/2)*2e3),{headerArray:W,headerView:J,rawLastModDate:Z}=FLe({version:I,bitFlag:BLe(s,u,f,x,R),compressionMethod:R,uncompressedSize:v,lastModDate:Q<GI?GI:Q>Fie?Fie:Q,rawLastModDate:i,rawFilename:t,zip64CompressedSize:E,zip64UncompressedSize:T,extraFieldLength:G}),ae=fd(30+ar(t)+G),Ae=ae.array,fe=di(Ae);return ae.writeUint32(67324752),ae.writeBytes(W),ae.writeBytes(t),w&&ae.writeBytes(L),ae.writeBytes(P),ae.writeBytes(F),ae.writeBytes(M),ae.writeBytes(B),ae.writeBytes(p),ae.writeBytes(g),f&&(E||Hc(fe,18,0),T||Hc(fe,22,0)),{localHeaderArray:Ae,localHeaderView:fe,headerArray:W,headerView:J,lastModDate:n,rawLastModDate:Z,encrypted:x,compressed:O,version:I,compressionMethod:R,extraFieldExtendedTimestampFlag:V,rawExtraFieldZip64:gr,localExtraFieldZip64Length:k,rawExtraFieldExtendedTimestamp:F,rawExtraFieldNTFS:M,rawExtraFieldUnix:B,rawExtraFieldAES:P,extraFieldLength:G}}function QNe(e,t){let{headerInfo:n}=e,{localHeaderArray:i,extraFieldLength:r}=n,o=64-(t+ar(i))%64;o<4&&(o+=64);let s=new Uint8Array(o),a=di(s);V0(a,0,6534),V0(a,2,o-4);let c=i;n.localHeaderArray=i=new Uint8Array(ar(c)+o),f4(i,c),f4(i,s,ar(c));let u=di(i);V0(u,28,r+o),n.localHeaderView=u,e.metadataSize+=o}function eLe(e){let t=new Uint8Array(4);di(t).setUint32(0,e,!0);let i=4;for(;i>1&&t[i-1]===0;)i--;return t.subarray(0,i)}function akt(e,t){if(e!==Ue)e=e&255;else if(t!==Ue){let{readOnly:n,hidden:i,system:r,directory:o,archive:s}=t,a=0;n&&(a|=1),i&&(a|=2),r&&(a|=4),o&&(a|=16),s&&(a|=32),e=a&255}return t===Ue&&(t={readOnly:!!(e&1),hidden:!!(e&2),system:!!(e&4),directory:!!(e&16),archive:!!(e&32)}),{msdosAttributesRaw:e,msdosAttributes:t}}function ckt({zip64:e,dataDescriptor:t,dataDescriptorSignature:n}){let i=gr,r,o=0,s=e?20:12;return n&&(s+=4),t&&(i=new Uint8Array(s),r=di(i),n&&(o=4,Hc(r,0,134695760))),{dataDescriptorArray:i,dataDescriptorView:r,dataDescriptorOffset:o}}function lkt({crc32:e,compressedSize:t,uncompressedSize:n,headerInfo:i,dataDescriptorInfo:r},{zip64:o,zipCrypto:s,passThrough:a,dataDescriptor:c}){let{headerView:u,encrypted:f}=i,{dataDescriptorView:d,dataDescriptorOffset:p}=r;(!f||s||a)&&e!==Ue&&(Hc(u,10,e),c&&Hc(d,p,e)),o?c&&(u4(d,p+4,BigInt(t)),u4(d,p+12,BigInt(n))):(Hc(u,14,t),Hc(u,18,n),c&&(Hc(d,p+4,t),Hc(d,p+8,n)))}function ukt({rawFilename:e,encrypted:t,zip64:n,localExtraFieldZip64Length:i,crc32:r,compressedSize:o,uncompressedSize:s,zip64UncompressedSize:a,zip64CompressedSize:c},u,{dataDescriptor:f,passThrough:d}){if(f||((!t||d&&r!==Ue)&&Hc(u,14,r),c||Hc(u,18,o),a||Hc(u,22,s)),n&&i){let p=30+ar(e)+4;u4(u,p,BigInt(s)),u4(u,p+8,BigInt(o))}}async function fkt(e,t,n){let i=dkt(e.fileEntries),{directoryStart:r,directoryEnd:o,directoryArray:s}=await hkt(e,i,n),a=await mkt(e,s,n);await pkt(e,t,n,{directoryStart:r,directoryEnd:o,directoryDataLength:i,signatureLength:a})}function dkt(e){let t=0;for(let[,n]of e){let{rawFilename:i,rawExtraFieldAES:r,rawComment:o,rawExtraFieldNTFS:s,rawExtraFieldUnix:a,rawExtraField:c,rawCentralExtraField:u,extendedTimestamp:f,extraFieldExtendedTimestampFlag:d,lastModDate:p,zip64UncompressedSize:g,zip64CompressedSize:m,uncompressedSize:y,compressedSize:A}=n,b=n.offset>=4294967295,x=n.diskNumberStart>=65535,T;if(b||x||g||m){let I=4+(g?8:0)+(m?8:0)+(b?8:0)+(x?4:0),R=fd(I);R.writeUint16(1),R.writeUint16(I-4),g&&R.writeUint64(y),m&&R.writeUint64(A),b&&R.writeUint64(n.offset),x&&R.writeUint32(n.diskNumberStart),T=R.array}else T=gr;n.rawExtraFieldZip64=T,n.zip64Offset=b,n.zip64DiskNumberStart=x;let E,v=R7(p);if(f&&NLe(v)){let I=fd(9);I.writeUint16(21589),I.writeUint16(5),I.writeUint8(d),I.writeUint32(v),E=I.array}else E=gr;n.rawExtraFieldExtendedTimestamp=E;let S=ar(T,r,s,a,E,c,u);if(S>65535)throw new Error(N7);t+=46+ar(i,o)+S}return t}async function hkt(e,t,n){let{fileEntries:i,writer:r}=e,o=new Uint8Array(t);await jc(r);let s=0,a=0,c=cy(r),u=c4(r),f=0;for(let[d,p]of Array.from(i.values()).entries()){let{offset:g,rawFilename:m,rawExtraFieldZip64:y,rawExtraFieldAES:A,rawExtraFieldExtendedTimestamp:b,rawExtraFieldNTFS:x,rawExtraFieldUnix:T,rawExtraField:E,rawCentralExtraField:v,rawComment:S,versionMadeBy:I,headerArray:R,headerView:O,zip64UncompressedSize:L,zip64CompressedSize:_,zip64DiskNumberStart:C,zip64Offset:w,internalFileAttributes:P,externalFileAttributes:M,diskNumberStart:F,uncompressedSize:V,compressedSize:B}=p,j=ar(y,A,b,x,T,E,v),k=46+ar(m,S)+j;TP(r,s+k-a)&&(await j0(r,o.slice(a,s)),a=s,f=0,await r.closeDisk()),d==0&&(c=cy(r),u=c4(r)),L||Hc(O,18,V),_||Hc(O,14,B),(w||C)&&p.version<45&&V0(O,0,45);let G=fd(k);if(G.writeUint32(33639248),G.writeUint16(I),G.writeBytes(R.subarray(0,24)),G.writeUint16(j),G.writeUint16(ar(S)),G.writeUint16(C?65535:F),G.writeUint16(P),G.writeUint32(M),G.writeUint32(w?4294967295:g),G.writeBytes(m),G.writeBytes(y),G.writeBytes(A),G.writeBytes(b),G.writeBytes(x),G.writeBytes(T),G.writeBytes(E),G.writeBytes(v),G.writeBytes(S),f4(o,G.array,s),s+=k,f++,n.onprogress)try{await n.onprogress(d+1,i.size,new wb(p))}catch{}}return await j0(r,a?o.slice(a):o),{directoryStart:{diskNumber:c,diskOffset:u},directoryEnd:{diskNumber:cy(r),entriesLength:f},directoryArray:o}}async function mkt(e,t,n){let i=zoe(e,n,rMe);if(i){let r=await i(t),o=ar(r);if(o>65535)throw new Error(DLe);let s=fd(6+o);s.writeUint32(84233040),s.writeUint16(o),s.writeBytes(r);let{writer:a}=e;return TP(a,ar(s.array))&&await a.closeDisk(),await j0(a,s.array),6+o}return 0}async function pkt(e,t,n,i){let{writer:r}=e,{directoryStart:o,directoryEnd:s,signatureLength:a}=i,{directoryDataLength:c}=i,u=e.fileEntries.size,f=o.diskNumber,d=l4(e,o),p=ar(t);if(p>65535)throw new Error(Hoe);let g=Ji(e,n,a7),m=cy(r);if(TP(r,(g?98:22)+p)&&m++,d>=4294967295||c>=4294967295||u>=65535||m>=65535){if(g===!1)throw new Error(L7);g=!0}let y=fd(g?98:22);TP(r,ar(y.array)+p)&&await r.closeDisk(),m=cy(r);let A=m==s.diskNumber?s.entriesLength:0;g&&(y.writeUint32(101075792),y.writeUint64(44),y.writeUint16(45),y.writeUint16(45),y.writeUint32(m),y.writeUint32(f),y.writeUint64(A),y.writeUint64(u),y.writeUint64(c),y.writeUint64(d),y.writeUint32(117853008),y.writeUint32(m),y.writeUint64(BigInt(l4(e,r))+BigInt(c)+BigInt(a)),y.writeUint32(m+1),Ji(e,n,KOe,!0)&&(m=65535,f=65535),A=65535,u=65535,d=4294967295,c=4294967295),y.writeUint32(101010256),y.writeUint16(m),y.writeUint16(f),y.writeUint16(A),y.writeUint16(u),y.writeUint32(c),y.writeUint32(d),y.writeUint16(p),await j0(r,y.array),p&&await j0(r,t)}function fd(e){let t=new Uint8Array(e),n=di(t),i=0;return{array:t,writeUint8:r=>{bkt(n,i,r),i+=1},writeUint16:r=>{V0(n,i,r),i+=2},writeUint32:r=>{Hc(n,i,r),i+=4},writeUint64:r=>{u4(n,i,BigInt(r)),i+=8},writeBytes:r=>{f4(t,r,i),i+=ar(r)},skip:r=>i+=r}}function cy(e){let{diskNumber:t=0}=e;return t}function c4(e){let{diskOffset:t=0}=e;return t}function TP(e,t){let{availableSize:n=aC}=e;return t>n}function l4(e,{diskNumber:t=0,diskOffset:n=0}){return e.offset-n-(t?e.initialOffset:0)}async function gkt(e){let t=await Uo(e,0,4);return Akt(di(t),0)==134695760}function RLe(e){let t=di(e),n=0;for(;n+4<=ar(e);){let i=4+M7(t,n+2);if(M7(t,n)==1)return RLe(Sh(e.subarray(0,n),e.subarray(Math.min(n+i,ar(e)))));n+=i}return e}async function _kt(e,t,n,i){let{writer:r}=e,o=new Map;if(r.closeDisk){let s=Array.from(n).sort((c,u)=>D7(t,c)-D7(t,u)),a=0;for(let c of s){let u=D7(t,c);await Noe(e,t,a,u-a),TP(r,await ykt(t,u))&&await r.closeDisk(),o.set(c,{offset:l4(e,r),diskNumberStart:cy(r)}),a=u}await Noe(e,t,a,i-a)}else{let s=e.offset;await Noe(e,t,0,i),n.forEach(a=>o.set(a,{offset:s+D7(t,a),diskNumberStart:0}))}return o}async function Noe(e,t,n,i){if(i>0){let{writer:r}=e,o=0;try{await MLe(hre(t,{offset:n,size:i}),r,Ue,s=>o+=s)}catch(s){e.hasCorruptedEntries=!0;try{s.corruptedEntry=!0}catch{}throw s}finally{r.size+=o,e.offset+=o}}}async function ykt(e,t){let n=await Uo(e,t,30);if(ar(n)<30)return 30;let i=di(n);return 30+M7(i,26)+M7(i,28)}function D7(e,{offset:t,diskNumberStart:n}){return t+(e.getDiskOffset?e.getDiskOffset(n):0)}function OLe(){let e=new Uint8Array(4);return Hc(di(e),0,134695760),e}async function tLe(e,t){delete e.addSplitZipSignature,await j0(t,OLe()),e.offset+=4}async function j0(e,t){let{writable:n}=e,i=n.getWriter();try{await i.ready,e.size+=ar(t),await i.write(t)}finally{i.releaseLock()}}async function MLe(e,t,n,i){let r=t.writable.getWriter();try{await e.pipeTo(new WritableStream({async write(o){await r.ready,await r.write(o),i(ar(o))}}),{preventClose:!0,preventAbort:!0,signal:n})}finally{r.releaseLock()}}function Loe(e){if(e){let t=(BigInt(e.getTime())+BigInt(116444736e5))*BigInt(1e4);return t<KNe?KNe:t>$Ne?$Ne:t}}function R7(e){return Math.floor(e.getTime()/1e3)}function NLe(e){return e>=gLe&&e<=_Le}function nLe(e){return Math.min(_Le,Math.max(gLe,e))}function Ji(e,t,n,i){let r=t[n]===Ue?e.options[n]:t[n];return r===Ue?i:r}function Foe(e,t,n,i){let r=Ji(e,t,n,i);if(r===null)return i;if(r!==Ue&&(typeof r.getTime!=Bo||Number.isNaN(r.getTime())))throw new Error(cLe);return r}function zoe(e,t,n){return qI(Ji(e,t,n))}function LLe(e,t,n,i,r){let o=iLe(t,n,i),s=o===Ue?iLe(e.options,n,i):o;return s===Ue?r:s}function iLe(e,t,n){return e[t]===Ue?e[n]:e[t]}function xP(e,t,n,i){return lC(Ji(e,t,n,i))}function rLe(e){return e+5*(Math.floor(e/16383)+1)}function Voe(e,t){return e===Ue?t===Ue||t>0:e!==0}function M7(e,t){return e.getUint16(t,!0)}function Akt(e,t){return e.getUint32(t,!0)}function bkt(e,t,n){e.setUint8(t,n)}function V0(e,t,n){e.setUint16(t,n,!0)}function Hc(e,t,n){e.setUint32(t,n,!0)}function u4(e,t,n){e.setBigUint64(t,n,!0)}function f4(e,t,n){e.set(t,n)}function ar(...e){let t=0;return e.forEach(n=>n&&(t+=n.length)),t}function FLe({version:e,bitFlag:t,compressionMethod:n,uncompressedSize:i,compressedSize:r,lastModDate:o,rawLastModDate:s,rawFilename:a,zip64CompressedSize:c,zip64UncompressedSize:u,extraFieldLength:f}){let d=fd(26),p=d.array,g=di(p);if(d.writeUint16(e),d.writeUint16(t),d.writeUint16(n),s===Ue){let m=new Uint32Array(1),y=di(m);V0(y,0,(o.getHours()<<6|o.getMinutes())<<5|o.getSeconds()/2),V0(y,2,(o.getFullYear()-1980<<4|o.getMonth()+1)<<5|o.getDate()),s=m[0]}return d.writeUint32(s),d.skip(4),c||r!==Ue?d.writeUint32(c?4294967295:r):d.skip(4),u||i!==Ue?d.writeUint32(u?4294967295:i):d.skip(4),d.writeUint16(ar(a)),d.writeUint16(f),{headerArray:p,headerView:g,rawLastModDate:s}}function BLe(e,t,n,i,r){let o=0;return t&&(o=o|2048),n&&(o=o|8),(r==8||r==9)&&(e>=0&&e<=3&&(o=o|6),e>3&&e<=5&&(o=o|4),e==9&&(o=o|2)),i&&(o=o|1),o}r7();DV();N0();dC();Ec();N0();dC();Zie();var gir=1024*1024;QI();var Air=1024*1024;var xir=1024*1024;var Tir=512*1024;var Tkt={};try{XI({baseURI:Tkt.url})}catch{}N0();var Ekt=[3,4,5,6,7,8,9,10,11,13,15,17,19,23,27,31,35,43,51,59,67,83,99,115,131,163,195,227,258],Ckt=[0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0],vkt=[1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577],Skt=[0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13],wkt=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15],h4=new Uint8Array(288);h4.fill(8,0,144),h4.fill(9,144,256),h4.fill(7,256,280),h4.fill(8,280,288);var Ikt=new Uint8Array(30).fill(5);function d4(e){let t=new Uint16Array(16);for(let r of e)t[r]++;t[0]=0;let n=new Uint16Array(17);for(let r=1;r<=15;r++)n[r+1]=n[r]+t[r];let i=new Uint16Array(e.length);for(let r=0;r<e.length;r++)e[r]&&(i[n[e[r]]++]=r);return{l:t,symbols:i}}var dd="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";function kLe(e){let t;e({wasmURI:()=>(t||(t="data:application/wasm;base64,"+(function(n){let i="",r=n.length,o=0;for(;o+2<r;o+=3){let a=n[o]<<16|n[o+1]<<8|n[o+2];i+=dd[a>>18&63]+dd[a>>12&63]+dd[a>>6&63]+dd[63&a]}let s=r-o;if(s===1){let a=n[o]<<16;i+=dd[a>>18&63]+dd[a>>12&63]+"=="}else if(s===2){let a=n[o]<<16|n[o+1]<<8;i+=dd[a>>18&63]+dd[a>>12&63]+dd[a>>6&63]+"="}return i})((function(n){let i=0,r=0,o=0,s=new Uint8Array(1024),a=0,c=0;for(;!c;){c=f(1);let A=f(2);if(A==0)d();else if(A==1)p(d4(h4),d4(Ikt));else{if(A!=2)throw new Error("invalid deflate block type");p(...g())}}return s.subarray(0,a);function u(){if(i>=n.length)throw new Error("unexpected end of deflate data");return n[i++]}function f(A){for(;o<A;)r|=u()<<o,o+=8;let b=r&(1<<A)-1;return r>>>=A,o-=A,b}function d(){r=0,o=0;let A=u()|u()<<8;i+=2,y(a+A);for(let b=0;b<A;b++)s[a++]=u()}function p(A,b){let x=m(A);for(;x!=256;){if(x<256)y(a+1),s[a++]=x;else{let T=x-257,E=Ekt[T]+f(Ckt[T]),v=m(b),S=vkt[v]+f(Skt[v]);y(a+E);let I=a-S;for(let R=0;R<E;R++)s[a++]=s[I+R]}x=m(A)}}function g(){let A=f(5)+257,b=f(5)+1,x=f(4)+4,T=new Uint8Array(19);for(let I=0;I<x;I++)T[wkt[I]]=f(3);let E=d4(T),v=new Uint8Array(A+b),S=0;for(;S<v.length;){let I=m(E);if(I<16)v[S++]=I;else if(I==16){let R=v[S-1],O=f(2)+3;for(;O--;)v[S++]=R}else S+=I==17?f(3)+3:f(7)+11}return[d4(v.subarray(0,A)),d4(v.subarray(A))]}function m(A){let{l:b,symbols:x}=A,T=0,E=0,v=0;for(let S=1;S<=15;S++){T|=f(1);let I=b[S];if(T-E<I)return x[v+(T-E)];v+=I,E=E+I<<1,T<<=1}throw new Error("invalid huffman code")}function y(A){if(s.length<A){let b=2*s.length;for(;b<A;)b*=2;let x=new Uint8Array(b);x.set(s.subarray(0,a)),s=x}}})((function(n){let i=(n=String(n).replace(/[^A-Za-z0-9+/=]/g,"")).length,r=[];for(let o=0;o<i;o+=4){let s=dd.indexOf(n[o])<<18|dd.indexOf(n[o+1])<<12|(63&dd.indexOf(n[o+2]))<<6|63&dd.indexOf(n[o+3]);r.push(s>>16&255),n[o+2]!=="="&&r.push(s>>8&255),n[o+3]!=="="&&r.push(255&s)}return new Uint8Array(r)})("zb19kF3XcSd2vu7He/fdmTvAABzigUTfK0gaSxiBk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/ZDpwenRzenu0zo08Ont+gzp8/0VFPt1hkA8OjpwZlHRl98/uz5hy58nrbP/srmGEXcu8EXHtu8yshwf65slO82w3LmwqOPbW1ub5+9cJ4e3Rw8cuEhJf8Vak7tU0qlKlEtFau2ilSmnOooq3Jl1IzSalb5VzvZHzqrnIpUrBKVqpZqq0zlalbNqf3qBtVVR9R71AfVR9Wd6pfUf6HOqG31tPqH6s/U/6GMbtqa/psLf/vC3/7wNx/+DoS/Qm2o7/LOmVECA2DN1Zy6UZXqw8qr0+pJ9SdK6yeRpspqp2Od6o4u9IImfYte0Q9Ott+02bSFNg6qg+oGdYNaUAvqRnWjOqQOqa7qqsPqsLpJ3aRW1Ip6p/23Adc7u/6eDH9Phb+nw98z4e/Z8PfCz6H/eke/Otlu017TznPqOfVr6tfU8+p59evq19VvqN9Qv6l+U31JfUl9WX1ZfUV9RdFdSu2kSmmt1M1aqVml1KU1pVRL+nezknvc13Bvv1IqUf7SXHZSNj/H/8yuf3bXP7frXzT1z7+wL9vcXdXuT5vX4/AvCf/S8K8V/rXDvyz864R/Of/zr+7P3tNUnzQTZ26fSpNW3I4y17G5mdGzyv/1/uzRhNt2KuV/iserUGkox6zVp+EdUGOLYSn4flPGKEmZ3iwrjTJKRisnZaONVkVL+R/PZy06oQWr/x8=")))),t)})}Ec();N0();WV();Q9();var k7="deflate",F7="deflate-raw",ULe="deflate64-raw",B7="gzip",Ls,EP,ly,m4,zLe;function VLe(e){if(Ls=e,{malloc:EP,free:ly,memory:m4}=Ls,typeof EP!="function"||typeof ly!="function"||!m4)throw Ls=EP=ly=m4=null,new Error("Invalid WASM module")}function jLe(e){zLe=e}function HLe(e,t,n={}){if(!Ls){let a=new Error("WASM module not loaded");throw a.cause=zLe,a}let i=typeof n.level=="number"?n.level:-1,r=typeof n.outBuffer=="number"?n.outBuffer:64*1024,o=typeof n.inBufferSize=="number"?n.inBufferSize:64*1024;return new null({start(){try{let a;if(this.out=EP(r),this.in=EP(o),this.inBufferSize=o,!this.out||!this.in)throw new Error("allocation failed");if(this._scratch=new Uint8Array(r),e?(this._process=Ls.deflate_process,this._last_consumed=Ls.deflate_last_consumed,this._end=Ls.deflate_end,this.streamHandle=Ls.deflate_new(),t===B7?a=Ls.deflate_init_gzip(this.streamHandle,i):t===F7?a=Ls.deflate_init_raw(this.streamHandle,i):a=Ls.deflate_init(this.streamHandle,i)):t===ULe?(this._process=Ls.inflate9_process,this._last_consumed=Ls.inflate9_last_consumed,this._end=Ls.inflate9_end,this.streamHandle=Ls.inflate9_new(),a=Ls.inflate9_init_raw(this.streamHandle)):(this._process=Ls.inflate_process,this._last_consumed=Ls.inflate_last_consumed,this._end=Ls.inflate_end,this.streamHandle=Ls.inflate_new(),t===F7?a=Ls.inflate_init_raw(this.streamHandle):t===B7?a=Ls.inflate_init_gzip(this.streamHandle):a=Ls.inflate_init(this.streamHandle)),a!==0)throw new Error("init failed:"+a)}catch(a){throw s(this),a}},transform(a,c){try{let u=a,f=new Uint8Array(m4.buffer),d=this._process,p=this._last_consumed,g=this.out,m=this._scratch,y=0;for(;y<u.length;){let A=Math.min(u.length-y,32768);if((!this.in||this.inBufferSize<A)&&(this.in&&ly&&(ly(this.in),this.in=0),this.in=EP(A),this.inBufferSize=A,!this.in))throw new Error("allocation failed");f.set(u.subarray(y,y+A),this.in);let b=d(this.streamHandle,this.in,A,g,r,0),x=b&16777215;if(x&&(m.set(f.subarray(g,g+x),0),c.enqueue(m.slice(0,x))),!e){let E=b>>24&255,v=E&128?E-256:E;if(v<0)throw new Error("process error:"+v)}let T=p(this.streamHandle);if(T===0)break;y+=T}}catch(u){s(this),c.error(u)}},flush(a){try{let c=new Uint8Array(m4.buffer),u=this._process,f=this.out,d=this._scratch;for(;;){let p=u(this.streamHandle,0,0,f,r,4),g=p&16777215,m=p>>24&255;if(!e){let y=m&128?m-256:m;if(y<0)throw new Error("process error:"+y)}if(g&&(d.set(c.subarray(f,f+g),0),a.enqueue(d.slice(0,g))),m===1||g===0)break}}catch(c){a.error(c)}finally{let c=s(this);c!==0&&a.error(new Error("end error:"+c))}},cancel(){s(this)}});function s(a){let c=0;return a.streamHandle&&a._end&&(c=a._end(a.streamHandle)),a.streamHandle=0,a.in&&ly&&ly(a.in),a.in=0,a.out&&ly&&ly(a.out),a.out=0,c}}var EC=class{constructor(t=k7,n){return HLe(!0,t,n)}},CC=class{constructor(t=k7,n){return HLe(!1,t,n)}};EC.requiresModule=!0;CC.requiresModule=!0;EC.supportedFormats=[k7,F7,B7];CC.supportedFormats=[k7,F7,B7,ULe];var GLe=!1;async function WLe(e,{baseURI:t}){if(!GLe)try{await Pkt(e,t),GLe=!0}catch(n){throw jLe(n),n}}async function Pkt(e,t){let n,i;try{try{i=new URL(e,t)}catch{}n=await(await fetch(i)).arrayBuffer()}catch(o){if(e.startsWith("data:application/wasm;base64,"))n=Dkt(e);else throw o}let r=await WebAssembly.instantiate(n);VLe(r.instance.exports)}function Dkt(e){let t=e.split(",")[1],n=atob(t),i=n.length,r=new Uint8Array(i);for(let o=0;o<i;++o)r[o]=n.charCodeAt(o);return r.buffer}var U7;JMe({initModule:e=>{if(!U7){let{wasmURI:t}=e;typeof t==Bo&&(t=t()),U7=WLe(t,e).catch(n=>{throw U7=null,n})}return U7}});XI({CompressionStreamFallback:EC,DecompressionStreamFallback:CC});kLe(XI);var Woe=32,Rkt="http://www.opengis.net/kml/2.2",rp="http://www.google.com/kml/ext/2.2",Okt="http://www.w3.org/2000/xmlns/";function z7(e){this._files={},this._promises=[],this._count=0,this._modelCallback=e}var Mkt=/^data:image\/([^,;]+)/;z7.prototype.texture=function(e){let t=this,n;if(typeof e=="string"||e instanceof De){if(e=De.createIfNeeded(e),!e.isDataUri)return e.url;let i=e.url.match(Mkt);n=`texture_${++this._count}`,l(i)&&(n+=`.${i[1]}`);let r=e.fetchBlob().then(function(o){t._files[n]=o});return this._promises.push(r),n}if(e instanceof HTMLCanvasElement){n=`texture_${++this._count}.png`;let i=new Promise(r=>{e.toBlob(function(o){t._files[n]=o,r()})});return this._promises.push(i),n}return""};function Nkt(e,t){return function(n){e._files[t]=n}}z7.prototype.model=function(e,t){let n=this._modelCallback;if(!l(n))throw new oe("Encountered a model entity while exporting to KML, but no model callback was supplied.");let i={},r=n(e,t,i);for(let o in i)if(i.hasOwnProperty(o)){let s=Promise.resolve(i[o]);this._promises.push(s),s.then(Nkt(this,o))}return r};Object.defineProperties(z7.prototype,{promise:{get:function(){return Promise.all(this._promises)}},files:{get:function(){return this._files}}});function V7(e){this._time=e}V7.prototype.get=function(e,t,n){let i;return l(e)&&(i=l(e.getValue)?e.getValue(this._time,n):e),i??t};V7.prototype.getColor=function(e,t){let n=this.get(e,t);if(l(n))return SC(n)};V7.prototype.getMaterialType=function(e){if(l(e))return e.getType(this._time)};function qoe(){this._ids={},this._styles={},this._count=0}qoe.prototype.get=function(e){let t=this._ids,n=e.innerHTML;if(l(t[n]))return t[n];let i=`style-${++this._count}`;return e.setAttribute("id",i),i=`#${i}`,t[n]=i,this._styles[n]=e,i};qoe.prototype.save=function(e){let t=this._styles,n=e.childNodes[0];for(let i in t)t.hasOwnProperty(i)&&e.insertBefore(t[i],n)};function XLe(){this._ids={}}XLe.prototype.get=function(e){if(!l(e))return this.get(Kn());let t=this._ids;return l(t[e])?`${e.toString()}-${++t[e]}`:(t[e]=0,e)};function Yoe(e){e=e??H.EMPTY_OBJECT;let t=e.entities,n=e.kmz??!1,i=Yoe._createState(e),r=t.values.filter(function(u){return!l(u.parent)}),o=i.kmlDoc,s=o.documentElement;s.setAttributeNS(Okt,"xmlns:gx",rp);let a=o.createElement("Document");s.appendChild(a),$Le(i,a,r),i.styleCache.save(a);let c=i.externalFileHandler;return c.promise.then(function(){let f=new XMLSerializer().serializeToString(i.kmlDoc);return n?Lkt(f,c.files):{kml:f,externalFiles:c.files}})}async function Lkt(e,t){let n=Zt("ThirdParty/Workers/zip-web-worker.js"),i=Zt("ThirdParty/zip-module.wasm");OV({workerURI:n,wasmURI:i});let r=new lP("application/vnd.google-earth.kmz"),o=new a4(r);await o.add("doc.kml",new XV(e));let s=Object.keys(t);return await KLe(o,s,t,0),await o.close(),{kmz:await r.getData()}}async function KLe(e,t,n,i){if(t.length===i)return;let r=t[i];return await e.add(r,new uf(n[r])),KLe(e,t,n,i+1)}Yoe._createState=function(e){let t=e.entities,n=new qoe,i=t.computeAvailability(),r=l(e.time)?e.time:i.start,o=e.defaultAvailability??i,s=e.sampleDuration??60;o.start===nt.MINIMUM_VALUE?o.stop===nt.MAXIMUM_VALUE?o=new En:K.addSeconds(o.stop,-10*s,o.start):o.stop===nt.MAXIMUM_VALUE&&K.addSeconds(o.start,10*s,o.stop);let a=new z7(e.modelCallback);return{kmlDoc:document.implementation.createDocument(Rkt,"kml"),ellipsoid:e.ellipsoid??ee.default,idManager:new XLe,styleCache:n,externalFileHandler:a,time:r,valueGetter:new V7(r),sampleDuration:s,defaultAvailability:new Ds([o])}};function $Le(e,t,n){let i=e.kmlDoc,r=e.styleCache,o=e.valueGetter,s=e.idManager,a=n.length,c,u,f;for(let d=0;d<a;++d){let p=n[d];c=[],u=[],f=[],Fkt(e,p,u,f),Bkt(e,p.polyline,u,f),YLe(e,p.rectangle,u,f,c),YLe(e,p.polygon,u,f,c),Vkt(e,p,p.model,u,f);let g,m=p.availability;l(m)&&(g=i.createElement("TimeSpan"),K.equals(m.start,nt.MINIMUM_VALUE)||g.appendChild(vn(i,"begin",K.toIso8601(m.start))),K.equals(m.stop,nt.MAXIMUM_VALUE)||g.appendChild(vn(i,"end",K.toIso8601(m.stop))));for(let b=0;b<c.length;++b){let x=c[b];x.setAttribute("id",s.get(p.id)),x.appendChild(vn(i,"name",p.name)),x.appendChild(vn(i,"visibility",p.show)),x.appendChild(vn(i,"description",p.description)),l(g)&&x.appendChild(g),t.appendChild(x)}let y=u.length;if(y>0){let b=i.createElement("Placemark");b.setAttribute("id",s.get(p.id));let x=p.name,T=p.label;if(l(T)){let v=i.createElement("LabelStyle"),S=o.get(T.text);x=l(S)&&S.length>0?S:x;let I=o.getColor(T.fillColor);l(I)&&(v.appendChild(vn(i,"color",I)),v.appendChild(vn(i,"colorMode","normal")));let R=o.get(T.scale);l(R)&&v.appendChild(vn(i,"scale",R)),f.push(v)}b.appendChild(vn(i,"name",x)),b.appendChild(vn(i,"visibility",p.show)),b.appendChild(vn(i,"description",p.description)),l(g)&&b.appendChild(g),t.appendChild(b);let E=f.length;if(E>0){let v=i.createElement("Style");for(let S=0;S<E;++S)v.appendChild(f[S]);b.appendChild(vn(i,"styleUrl",r.get(v)))}if(u.length===1)b.appendChild(u[0]);else if(u.length>1){let v=i.createElement("MultiGeometry");for(let S=0;S<y;++S)v.appendChild(u[S]);b.appendChild(v)}}let A=p._children;if(A.length>0){let b=i.createElement("Folder");b.setAttribute("id",s.get(p.id)),b.appendChild(vn(i,"name",p.name)),b.appendChild(vn(i,"visibility",p.show)),b.appendChild(vn(i,"description",p.description)),t.appendChild(b),$Le(e,b,A)}}}var df=new h,xu=new he,ip=new K;function Fkt(e,t,n,i){let r=e.kmlDoc,o=e.ellipsoid,s=e.valueGetter,a=t.billboard??t.point;if(!l(a)&&!l(t.path))return;let c=t.position;if(!c.isConstant){JLe(e,t,a,n,i);return}s.get(c,void 0,df);let u=vn(r,"coordinates",vC(df,o)),f=r.createElement("Point"),d=r.createElement("altitudeMode");d.appendChild(wC(e,a.heightReference)),f.appendChild(d),f.appendChild(u),n.push(f);let p=a instanceof nl?QLe(e,a):ZLe(e,a);i.push(p)}function JLe(e,t,n,i,r){let o=e.kmlDoc,s=e.ellipsoid,a=e.valueGetter,c,u=t.position,f=!0;u instanceof _c?(c=u.intervals,f=!1):c=t.availability??e.defaultAvailability;let d=n instanceof Pg,p,g,m,y=[];for(p=0;p<c.length;++p){let b=c.get(p),x=f?u:b.data,T=o.createElement("altitudeMode");x instanceof m0?(x=x._value,T.appendChild(wC(e,We.CLAMP_TO_GROUND))):l(n)?T.appendChild(wC(e,n.heightReference)):T.appendChild(wC(e,We.NONE));let E=[],v=[];if(x.isConstant){a.get(x,void 0,df);let I=vn(o,"coordinates",vC(df,s));E.push(K.toIso8601(b.start)),v.push(I),E.push(K.toIso8601(b.stop)),v.push(I)}else if(x instanceof yc)for(m=x._property._times,g=0;g<m.length;++g)E.push(K.toIso8601(m[g])),x.getValueInReferenceFrame(m[g],ji.FIXED,df),v.push(vC(df,s));else if(x instanceof td){m=x._times;let I=x._values;for(g=0;g<m.length;++g)E.push(K.toIso8601(m[g])),h.fromArray(I,g*3,df),v.push(vC(df,s))}else{let I=e.sampleDuration;b.start.clone(ip),b.isStartIncluded||K.addSeconds(ip,I,ip);let R=b.stop;for(;K.lessThan(ip,R);)x.getValue(ip,df),E.push(K.toIso8601(ip)),v.push(vC(df,s)),K.addSeconds(ip,I,ip);b.isStopIncluded&&K.equals(ip,R)&&(x.getValue(ip,df),E.push(K.toIso8601(ip)),v.push(vC(df,s)))}let S=o.createElementNS(rp,"Track");S.appendChild(T);for(let I=0;I<E.length;++I){let R=vn(o,"when",E[I]),O=vn(o,"coord",v[I],rp);S.appendChild(R),S.appendChild(O)}d&&S.appendChild(eFe(e,n)),y.push(S)}if(y.length===1)i.push(y[0]);else if(y.length>1){let b=o.createElementNS(rp,"MultiTrack");for(p=0;p<y.length;++p)b.appendChild(y[p]);i.push(b)}if(l(n)&&!d){let b=n instanceof nl?QLe(e,n):ZLe(e,n);r.push(b)}let A=t.path;if(l(A)){let b=a.get(A.width),x=A.material;if(l(x)||l(b)){let T=o.createElement("LineStyle");l(b)&&T.appendChild(vn(o,"width",b)),Xoe(e,x,T),r.push(T)}}}function ZLe(e,t){let n=e.kmlDoc,i=e.valueGetter,r=n.createElement("IconStyle"),o=i.getColor(t.color);l(o)&&(r.appendChild(vn(n,"color",o)),r.appendChild(vn(n,"colorMode","normal")));let s=i.get(t.pixelSize);return l(s)&&r.appendChild(vn(n,"scale",s/Woe)),r}function QLe(e,t){let n=e.kmlDoc,i=e.valueGetter,r=e.externalFileHandler,o=n.createElement("IconStyle"),s=i.get(t.image);if(l(s)){s=r.texture(s);let p=n.createElement("Icon");p.appendChild(vn(n,"href",s));let g=i.get(t.imageSubRegion);l(g)&&(p.appendChild(vn(n,"x",g.x,rp)),p.appendChild(vn(n,"y",g.y,rp)),p.appendChild(vn(n,"w",g.width,rp)),p.appendChild(vn(n,"h",g.height,rp))),o.appendChild(p)}let a=i.getColor(t.color);l(a)&&(o.appendChild(vn(n,"color",a)),o.appendChild(vn(n,"colorMode","normal")));let c=i.get(t.scale);l(c)&&o.appendChild(vn(n,"scale",c));let u=i.get(t.pixelOffset);if(l(u)){c=c??1,U.divideByScalar(u,c,u);let p=i.get(t.width,Woe),g=i.get(t.height,Woe),m=i.get(t.horizontalOrigin,Vi.CENTER);m===Vi.CENTER?u.x-=p*.5:m===Vi.RIGHT&&(u.x-=p);let y=i.get(t.verticalOrigin,Gn.CENTER);y===Gn.TOP?u.y+=g:y===Gn.CENTER&&(u.y+=g*.5);let A=n.createElement("hotSpot");A.setAttribute("x",-u.x),A.setAttribute("y",u.y),A.setAttribute("xunits","pixels"),A.setAttribute("yunits","pixels"),o.appendChild(A)}let f=i.get(t.rotation),d=i.get(t.alignedAxis);return l(f)&&h.equals(h.UNIT_Z,d)&&(f=D.toDegrees(-f),f===0&&(f=360),o.appendChild(vn(n,"heading",f))),o}function Bkt(e,t,n,i){let r=e.kmlDoc,o=e.ellipsoid,s=e.valueGetter;if(!l(t))return;let a=r.createElement("LineString"),c=r.createElement("altitudeMode"),u=s.get(t.clampToGround,!1),f;u?(a.appendChild(vn(r,"tessellate",!0)),f=r.createTextNode("clampToGround")):f=r.createTextNode("absolute"),c.appendChild(f),a.appendChild(c);let d=t.positions,p=s.get(d),g=vn(r,"coordinates",vC(p,o));a.appendChild(g);let m=s.get(t.zIndex);u&&l(m)&&a.appendChild(vn(r,"drawOrder",m,rp)),n.push(a);let y=r.createElement("LineStyle"),A=s.get(t.width);l(A)&&y.appendChild(vn(r,"width",A)),Xoe(e,t.material,y),i.push(y)}function kkt(e,t,n){let i=e.kmlDoc,r=e.valueGetter,o=r.get(t.height,0);n>0&&(o=n);let s=t.coordinates,a=r.get(s),c=[],u=[ie.northeast,ie.southeast,ie.southwest,ie.northwest];for(let g=0;g<4;++g)u[g](a,xu),c.push(`${D.toDegrees(xu.longitude)},${D.toDegrees(xu.latitude)},${o}`);let f=vn(i,"coordinates",c.join(" ")),d=i.createElement("outerBoundaryIs"),p=i.createElement("LinearRing");return p.appendChild(f),d.appendChild(p),[d]}function qLe(e,t,n,i){let r=e.kmlDoc,o=e.ellipsoid,s=[],a=t.length;for(let f=0;f<a;++f)he.fromCartesian(t[f],o,xu),s.push(`${D.toDegrees(xu.longitude)},${D.toDegrees(xu.latitude)},${i?xu.height:n}`);let c=vn(r,"coordinates",s.join(" ")),u=r.createElement("LinearRing");return u.appendChild(c),u}function Ukt(e,t,n){let i=e.kmlDoc,r=e.valueGetter,o=r.get(t.height,0),s=r.get(t.perPositionHeight,!1);!s&&n>0&&(o=n);let a=[],c=t.hierarchy,u=r.get(c),f=Array.isArray(u)?u:u.positions,d=i.createElement("outerBoundaryIs");d.appendChild(qLe(e,f,o,s)),a.push(d);let p=u.holes;if(l(p)){let g=p.length;for(let m=0;m<g;++m){let y=i.createElement("innerBoundaryIs");y.appendChild(qLe(e,p[m].positions,o,s)),a.push(y)}}return a}function YLe(e,t,n,i,r){let o=e.kmlDoc,s=e.valueGetter;if(!l(t))return;let a=t instanceof om;if(a&&s.getMaterialType(t.material)==="Image"){zkt(e,t,r);return}let c=o.createElement("Polygon"),u=s.get(t.extrudedHeight,0);u>0&&c.appendChild(vn(o,"extrude",!0));let f=a?kkt(e,t,u):Ukt(e,t,u),d=f.length;for(let A=0;A<d;++A)c.appendChild(f[A]);let p=o.createElement("altitudeMode");p.appendChild(wC(e,t.heightReference)),c.appendChild(p),n.push(c);let g=o.createElement("PolyStyle"),m=s.get(t.fill,!1);m&&g.appendChild(vn(o,"fill",m)),Xoe(e,t.material,g);let y=s.get(t.outline,!1);if(y){g.appendChild(vn(o,"outline",y));let A=o.createElement("LineStyle"),b=s.get(t.outlineWidth,1);A.appendChild(vn(o,"width",b));let x=s.getColor(t.outlineColor,z.BLACK);A.appendChild(vn(o,"color",x)),A.appendChild(vn(o,"colorMode","normal")),i.push(A)}i.push(g)}function zkt(e,t,n){let i=e.kmlDoc,r=e.valueGetter,o=e.externalFileHandler,s=i.createElement("GroundOverlay"),a=i.createElement("altitudeMode");a.appendChild(wC(e,t.heightReference)),s.appendChild(a);let c=r.get(t.height);l(c)&&s.appendChild(vn(i,"altitude",c));let u=r.get(t.coordinates),f=i.createElement("LatLonBox");f.appendChild(vn(i,"north",D.toDegrees(u.north))),f.appendChild(vn(i,"south",D.toDegrees(u.south))),f.appendChild(vn(i,"east",D.toDegrees(u.east))),f.appendChild(vn(i,"west",D.toDegrees(u.west))),s.appendChild(f);let d=r.get(t.material),p=o.texture(d.image),g=i.createElement("Icon");g.appendChild(vn(i,"href",p)),s.appendChild(g);let m=d.color;l(m)&&s.appendChild(vn(i,"color",SC(d.color))),n.push(s)}function eFe(e,t){let n=e.kmlDoc,i=e.valueGetter,r=e.externalFileHandler,o=n.createElement("Model"),s=i.get(t.scale);if(l(s)){let u=n.createElement("scale");u.appendChild(vn(n,"x",s)),u.appendChild(vn(n,"y",s)),u.appendChild(vn(n,"z",s)),o.appendChild(u)}let a=n.createElement("Link"),c=r.model(t,e.time);return a.appendChild(vn(n,"href",c)),o.appendChild(a),o}function Vkt(e,t,n,i,r){let o=e.kmlDoc,s=e.ellipsoid,a=e.valueGetter;if(!l(n))return;let c=t.position;if(!c.isConstant){JLe(e,t,n,i,r);return}let u=eFe(e,n),f=o.createElement("altitudeMode");f.appendChild(wC(e,n.heightReference)),u.appendChild(f),a.get(c,void 0,df),he.fromCartesian(df,s,xu);let d=o.createElement("Location");d.appendChild(vn(o,"longitude",D.toDegrees(xu.longitude))),d.appendChild(vn(o,"latitude",D.toDegrees(xu.latitude))),d.appendChild(vn(o,"altitude",xu.height)),u.appendChild(d),i.push(u)}function Xoe(e,t,n){let i=e.kmlDoc,r=e.valueGetter;if(!l(t))return;let o=r.get(t);if(!l(o))return;let s,a=r.getMaterialType(t),c,u;switch(a){case"Image":s=SC(z.WHITE);break;case"Color":case"Grid":case"PolylineGlow":case"PolylineArrow":case"PolylineDash":s=SC(o.color);break;case"PolylineOutline":s=SC(o.color),c=SC(o.outlineColor),u=o.outlineWidth,n.appendChild(vn(i,"outerColor",c,rp)),n.appendChild(vn(i,"outerWidth",u,rp));break;case"Stripe":s=SC(o.oddColor);break}l(s)&&(n.appendChild(vn(i,"color",s)),n.appendChild(vn(i,"colorMode","normal")))}function wC(e,t){let n=e.kmlDoc,r=e.valueGetter.get(t,We.NONE),o;switch(r){case We.NONE:o=n.createTextNode("absolute");break;case We.CLAMP_TO_GROUND:o=n.createTextNode("clampToGround");break;case We.RELATIVE_TO_GROUND:o=n.createTextNode("relativeToGround");break}return o}function vC(e,t){Array.isArray(e)||(e=[e]);let n=e.length,i=[];for(let r=0;r<n;++r)he.fromCartesian(e[r],t,xu),i.push(`${D.toDegrees(xu.longitude)},${D.toDegrees(xu.latitude)},${xu.height}`);return i.join(" ")}function vn(e,t,n,i){n=n??"",typeof n=="boolean"&&(n=n?"1":"0");let r=l(i)?e.createElementNS(i,t):e.createElement(t),o=n==="string"&&n.indexOf("<")!==-1?e.createCDATASection(n):e.createTextNode(n);return r.appendChild(o),r}function SC(e){let t="",n=e.toBytes();for(let i=3;i>=0;--i)t+=n[i]<16?`0${n[i].toString(16)}`:n[i].toString(16);return t}var Koe=Yoe;function g4(){this._cache={}}g4.prototype.fromColor=function(e,t){return j7(void 0,void 0,e,t,this._cache)};g4.prototype.fromUrl=function(e,t,n){return j7(e,void 0,t,n,this._cache)};g4.prototype.fromMakiIconId=function(e,t,n){return j7(Zt(`Assets/Textures/maki/${encodeURIComponent(e)}.png`),void 0,t,n,this._cache)};g4.prototype.fromText=function(e,t,n){return j7(void 0,e,t,n,this._cache)};var jkt=new z;function Hkt(e,t,n){e.save(),e.scale(n/24,n/24),e.fillStyle=t.toCssColorString(),e.strokeStyle=t.brighten(.6,jkt).toCssColorString(),e.lineWidth=.846,e.beginPath(),e.moveTo(6.72,.422),e.lineTo(17.28,.422),e.bezierCurveTo(18.553,.422,19.577,1.758,19.577,3.415),e.lineTo(19.577,10.973),e.bezierCurveTo(19.577,12.63,18.553,13.966,17.282,13.966),e.lineTo(14.386,14.008),e.lineTo(11.826,23.578),e.lineTo(9.614,14.008),e.lineTo(6.719,13.965),e.bezierCurveTo(5.446,13.983,4.422,12.629,4.422,10.972),e.lineTo(4.422,3.416),e.bezierCurveTo(4.423,1.76,5.447,.423,6.718,.423),e.closePath(),e.fill(),e.stroke(),e.restore()}function tFe(e,t,n){let i=n/2.5,r=i,o=i;t.width>t.height?o=i*(t.height/t.width):t.width<t.height&&(r=i*(t.width/t.height));let s=Math.round((n-r)/2),a=Math.round(7/24*n-o/2);e.globalCompositeOperation="destination-out",e.drawImage(t,s-1,a,r,o),e.drawImage(t,s,a-1,r,o),e.drawImage(t,s+1,a,r,o),e.drawImage(t,s,a+1,r,o),e.globalCompositeOperation="destination-over",e.fillStyle=z.BLACK.toCssColorString(),e.fillRect(s-1,a-1,r+2,o+2),e.globalCompositeOperation="destination-out",e.drawImage(t,s,a,r,o),e.globalCompositeOperation="destination-over",e.fillStyle=z.WHITE.toCssColorString(),e.fillRect(s-1,a-2,r+2,o+2)}var p4=new Array(4);function j7(e,t,n,i,r){p4[0]=e,p4[1]=t,p4[2]=n,p4[3]=i;let o=JSON.stringify(p4),s=r[o];if(l(s))return s;let a=document.createElement("canvas");a.width=i,a.height=i;let c=a.getContext("2d");if(Hkt(c,n,i),l(e)){let f=De.createIfNeeded(e).fetchImage().then(function(d){return tFe(c,d,i),r[o]=a,a});return r[o]=f,f}else if(l(t)){let u=Bx(t,{font:`bold ${i}px sans-serif`});tFe(c,u,i)}return r[o]=a,a}var uy=g4;var rFe=Qo(iFe(),1);function G7(e){return h.fromDegrees(e[0],e[1],e[2])}var $oe={"urn:ogc:def:crs:OGC:1.3:CRS84":G7,"EPSG:4326":G7,"urn:ogc:def:crs:EPSG::4326":G7},oFe={},sFe={},Joe=48,Zoe,Qoe=z.ROYALBLUE,ese=z.YELLOW,tse=2,nse=z.fromBytes(255,255,0,100),ise=!1,Gkt={small:24,medium:48,large:64},Wkt=["title","description","marker-size","marker-symbol","marker-color","stroke","stroke-opacity","stroke-width","fill","fill-opacity"];function aFe(e,t){let n="";for(let i in e)if(e.hasOwnProperty(i)){if(i===t||Wkt.indexOf(i)!==-1)continue;let r=e[i];l(r)&&(typeof r=="object"?n+=`<tr><th>${i}</th><td>${aFe(r)}</td></tr>`:n+=`<tr><th>${i}</th><td>${r}</td></tr>`)}return n.length>0&&(n=`<table class="cesium-infoBox-defaultTable"><tbody>${n}</tbody></table>`),n}function qkt(e,t,n){let i;return function(r,o){return l(i)||(i=e(t,n)),i}}function Ykt(e,t){return new am(qkt(aFe,e,t),!0)}function W7(e,t,n){let i=e.id;if(!l(i)||e.type!=="Feature")i=Kn();else{let s=2,a=i;for(;l(t.getById(a));)a=`${i}_${s}`,s++;i=a}let r=t.getOrCreateEntity(i),o=e.properties;if(l(o)){r.properties=o;let s,a=o.title;if(l(a))r.name=a,s="title";else{let u=Number.MAX_VALUE;for(let f in o)if(o.hasOwnProperty(f)&&o[f]){let d=f.toLowerCase();if(u>1&&d==="title"){s=f;break}else u>2&&d==="name"?(u=2,s=f):u>3&&/title/i.test(f)?(u=3,s=f):u>4&&/name/i.test(f)&&(u=4,s=f)}l(s)&&(r.name=o[s])}let c=o.description;c!==null&&(r.description=l(c)?new ui(c):n(o,s))}return r}function rse(e,t){let n=new Array(e.length);for(let i=0;i<e.length;i++)n[i]=t(e[i]);return n}var cFe={Feature:uFe,FeatureCollection:Xkt,GeometryCollection:fFe,LineString:gFe,MultiLineString:_Fe,MultiPoint:mFe,MultiPolygon:bFe,Point:hFe,Polygon:AFe,Topology:xFe},lFe={GeometryCollection:fFe,LineString:gFe,MultiLineString:_Fe,MultiPoint:mFe,MultiPolygon:bFe,Point:hFe,Polygon:AFe,Topology:xFe};function uFe(e,t,n,i,r){if(t.geometry===null){W7(t,e._entityCollection,r.describe);return}if(!l(t.geometry))throw new oe("feature.geometry is required.");let o=t.geometry.type,s=lFe[o];if(!l(s))throw new oe(`Unknown geometry type: ${o}`);s(e,t,t.geometry,i,r)}function Xkt(e,t,n,i,r){let o=t.features;for(let s=0,a=o.length;s<a;s++)uFe(e,o[s],void 0,i,r)}function fFe(e,t,n,i,r){let o=n.geometries;for(let s=0,a=o.length;s<a;s++){let c=o[s],u=c.type,f=lFe[u];if(!l(f))throw new oe(`Unknown geometry type: ${u}`);f(e,t,c,i,r)}}function dFe(e,t,n,i,r){let o=r.markerSymbol,s=r.markerColor,a=r.markerSize,c=t.properties;if(l(c)){let g=c["marker-color"];l(g)&&(s=z.fromCssColorString(g)),a=Gkt[c["marker-size"]]??a;let m=c["marker-symbol"];l(m)&&(o=m)}let u;l(o)?o.length===1?u=e._pinBuilder.fromText(o.toUpperCase(),s,a):u=e._pinBuilder.fromMakiIconId(o,s,a):u=e._pinBuilder.fromColor(s,a);let f=new nl;f.verticalOrigin=new ui(Gn.BOTTOM),i.length===2&&r.clampToGround&&(f.heightReference=We.CLAMP_TO_GROUND);let d=W7(t,e._entityCollection,r.describe);d.billboard=f,d.position=new Kl(n(i));let p=Promise.resolve(u).then(function(g){f.image=new ui(g)}).catch(function(){f.image=new ui(e._pinBuilder.fromColor(s,a))});e._promises.push(p)}function hFe(e,t,n,i,r){dFe(e,t,i,n.coordinates,r)}function mFe(e,t,n,i,r){let o=n.coordinates;for(let s=0;s<o.length;s++)dFe(e,t,i,o[s],r)}function pFe(e,t,n,i,r){let o=r.strokeMaterialProperty,s=r.strokeWidthProperty,a=t.properties;if(l(a)){let f=a["stroke-width"];l(f)&&(s=new ui(f));let d,p=a.stroke;l(p)&&(d=z.fromCssColorString(p));let g=a["stroke-opacity"];l(g)&&g!==1&&(l(d)||(d=o.color.getValue().clone()),d.alpha=g),l(d)&&(o=new Kt(d))}let c=W7(t,e._entityCollection,r.describe),u=new il;c.polyline=u,u.clampToGround=r.clampToGround,u.material=o,u.width=s,u.positions=new ui(rse(i,n)),u.arcType=ln.RHUMB}function gFe(e,t,n,i,r){pFe(e,t,i,n.coordinates,r)}function _Fe(e,t,n,i,r){let o=n.coordinates;for(let s=0;s<o.length;s++)pFe(e,t,i,o[s],r)}function yFe(e,t,n,i,r){if(i.length===0||i[0].length===0)return;let o=r.strokeMaterialProperty.color,s=r.fillMaterialProperty,a=r.strokeWidthProperty,c=t.properties;if(l(c)){let g=c["stroke-width"];l(g)&&(a=new ui(g));let m,y=c.stroke;l(y)&&(m=z.fromCssColorString(y));let A=c["stroke-opacity"];l(A)&&A!==1&&(l(m)||(m=o.getValue().clone()),m.alpha=A),l(m)&&(o=new ui(m));let b,x=c.fill,T=s.color.getValue();l(x)&&(b=z.fromCssColorString(x),b.alpha=T.alpha),A=c["fill-opacity"],l(A)&&A!==T.alpha&&(l(b)||(b=T.clone()),b.alpha=A),l(b)&&(s=new Kt(b))}let u=new rm;u.outline=new ui(!0),u.outlineColor=o,u.outlineWidth=a,u.material=s,u.arcType=ln.RHUMB;let f=[];for(let g=1,m=i.length;g<m;g++)f.push(new Mc(rse(i[g],n)));let d=i[0];u.hierarchy=new ui(new Mc(rse(d,n),f)),d[0].length>2?u.perPositionHeight=new ui(!0):r.clampToGround||(u.height=0);let p=W7(t,e._entityCollection,r.describe);p.polygon=u}function AFe(e,t,n,i,r){yFe(e,t,i,n.coordinates,r)}function bFe(e,t,n,i,r){let o=n.coordinates;for(let s=0;s<o.length;s++)yFe(e,t,i,o[s],r)}function xFe(e,t,n,i,r){for(let o in n.objects)if(n.objects.hasOwnProperty(o)){let s=rFe.feature(n,n.objects[o]),a=cFe[s.type];a(e,s,s,i,r)}}function Db(e){this._name=e,this._changed=new be,this._error=new be,this._isLoading=!1,this._loading=new be,this._entityCollection=new Ua(this),this._promises=[],this._pinBuilder=new uy,this._entityCluster=new Of,this._credit=void 0,this._resourceCredits=[]}Db.load=function(e,t){return new Db().load(e,t)};Object.defineProperties(Db,{markerSize:{get:function(){return Joe},set:function(e){Joe=e}},markerSymbol:{get:function(){return Zoe},set:function(e){Zoe=e}},markerColor:{get:function(){return Qoe},set:function(e){Qoe=e}},stroke:{get:function(){return ese},set:function(e){ese=e}},strokeWidth:{get:function(){return tse},set:function(e){tse=e}},fill:{get:function(){return nse},set:function(e){nse=e}},clampToGround:{get:function(){return ise},set:function(e){ise=e}},crsNames:{get:function(){return $oe}},crsLinkHrefs:{get:function(){return oFe}},crsLinkTypes:{get:function(){return sFe}}});Object.defineProperties(Db.prototype,{name:{get:function(){return this._name},set:function(e){this._name!==e&&(this._name=e,this._changed.raiseEvent(this))}},clock:{value:void 0,writable:!1},entities:{get:function(){return this._entityCollection}},isLoading:{get:function(){return this._isLoading}},changedEvent:{get:function(){return this._changed}},errorEvent:{get:function(){return this._error}},loadingEvent:{get:function(){return this._loading}},show:{get:function(){return this._entityCollection.show},set:function(e){this._entityCollection.show=e}},clustering:{get:function(){return this._entityCluster},set:function(e){this._entityCluster=e}},credit:{get:function(){return this._credit}}});Db.prototype.load=function(e,t){return TFe(this,e,t,!0)};Db.prototype.process=function(e,t){return TFe(this,e,t,!1)};function TFe(e,t,n,i){xs.setLoading(e,!0),n=n??H.EMPTY_OBJECT;let r=n.credit;typeof r=="string"&&(r=new It(r)),e._credit=r;let o=t,s=n.sourceUri;if(typeof t=="string"||t instanceof De){t=De.createIfNeeded(t),o=t.fetchJson(),s=s??t.getUrlComponent();let a=e._resourceCredits,c=t.credits;if(l(c)){let u=c.length;for(let f=0;f<u;f++)a.push(c[f])}}return n={describe:n.describe??Ykt,markerSize:n.markerSize??Joe,markerSymbol:n.markerSymbol??Zoe,markerColor:n.markerColor??Qoe,strokeWidthProperty:new ui(n.strokeWidth??tse),strokeMaterialProperty:new Kt(n.stroke??ese),fillMaterialProperty:new Kt(n.fill??nse),clampToGround:n.clampToGround??ise},Promise.resolve(o).then(function(a){return Kkt(e,a,n,s,i)}).catch(function(a){throw xs.setLoading(e,!1),e._error.raiseEvent(e,a),a})}Db.prototype.update=function(e){return!0};function Kkt(e,t,n,i,r){let o;l(i)&&(o=$_(i)),l(o)&&e._name!==o&&(e._name=o,e._changed.raiseEvent(e));let s=cFe[t.type];if(!l(s))throw new oe(`Unsupported GeoJSON object type: ${t.type}`);let a=t.crs,c=a!==null?G7:null;if(l(a)){if(!l(a.properties))throw new oe("crs.properties is undefined.");let u=a.properties;if(a.type==="name"){if(c=$oe[u.name],!l(c))throw new oe(`Unknown crs name: ${u.name}`)}else if(a.type==="link"){let f=oFe[u.href];if(l(f)||(f=sFe[u.type]),!l(f))throw new oe(`Unable to resolve crs link: ${JSON.stringify(u)}`);c=f(u)}else if(a.type==="EPSG"){if(c=$oe[`EPSG:${u.code}`],!l(c))throw new oe(`Unknown crs EPSG code: ${u.code}`)}else throw new oe(`Unknown crs type: ${a.type}`)}return Promise.resolve(c).then(function(u){return r&&e._entityCollection.removeAll(),u!==null&&s(e,t,t,u,n),Promise.all(e._promises).then(function(){return e._promises.length=0,xs.setLoading(e,!1),e})})}var Rb=Db;var vBe=Qo(Rse(),1);var SBe;typeof DOMParser<"u"&&(SBe=new DOMParser);var cVt=new vBe.default({stripPrefix:!1,email:!1,replaceFn:function(e,t){return t.urlMatchType==="scheme"||t.urlMatchType==="www"}}),fW=32,_Be=2414016,yBe=1,ABe=16093e3,bBe=.1,lVt=[null,void 0,"http://www.topografix.com/GPX/1/1"],to={gpx:lVt};function uVt(e){return new Promise((t,n)=>{let i=new FileReader;i.addEventListener("load",function(){t(i.result)}),i.addEventListener("error",function(){n(i.error)}),i.readAsText(e)})}function Ose(e,t){let n=b4(e,"id");return n=l(n)?n:Kn(),t.getOrCreateEntity(n)}function Mse(e){let t=xBe(e,"lon"),n=xBe(e,"lat"),i=y4(e,"ele",to.gpx);return h.fromDegrees(t,n,i)}function xBe(e,t){if(!l(e))return;let n=e.getAttribute(t);if(n!==null){let i=parseFloat(n);return isNaN(i)?void 0:i}}function b4(e,t){if(!l(e))return;let n=e.getAttribute(t);return n!==null?n:void 0}function Nb(e,t,n){if(!l(e))return;let i=e.childNodes,r=i.length;for(let o=0;o<r;o++){let s=i[o];if(s.localName===t&&n.indexOf(s.namespaceURI)!==-1)return s}}function Nse(e,t,n){if(!l(e))return;let i=[],r=e.getElementsByTagName(t),o=r.length;for(let s=0;s<o;s++){let a=r[s];a.localName===t&&n.indexOf(a.namespaceURI)!==-1&&i.push(a)}return i}function y4(e,t,n){let i=Nb(e,t,n);if(l(i)){let r=parseFloat(i.textContent);return isNaN(r)?void 0:r}}function hf(e,t,n){let i=Nb(e,t,n);if(l(i))return i.textContent.trim()}function wBe(e){let t=new nl;return t.width=fW,t.height=fW,t.scaleByDistance=new qt(_Be,yBe,ABe,bBe),t.pixelOffsetScaleByDistance=new qt(_Be,yBe,ABe,bBe),t.verticalOrigin=new ui(Gn.BOTTOM),t.image=e,t}function fVt(){let e=new im;return e.translucencyByDistance=new qt(3e6,1,5e6,0),e.pixelOffset=new U(17,0),e.horizontalOrigin=Vi.LEFT,e.font="16px sans-serif",e.style=_o.FILL_AND_OUTLINE,e}function IBe(e){let t=new il;return t.width=4,t.material=new Ab,t.material.color=l(e)?e:z.RED,t.material.outlineWidth=2,t.material.outlineColor=z.BLACK,t}var TBe={time:{text:"Time",tag:"time"},comment:{text:"Comment",tag:"cmt"},description:{text:"Description",tag:"desc"},source:{text:"Source",tag:"src"},number:{text:"GPS track/route number",tag:"number"},type:{text:"Type",tag:"type"}},A4;typeof document<"u"&&(A4=document.createElement("div"));function Lse(e,t){let n,i="",r=Object.keys(TBe),o=r.length;for(n=0;n<o;n++){let f=r[n],d=TBe[f];d.value=hf(e,d.tag,to.gpx)??"",l(d.value)&&d.value!==""&&(i=`${i}<p>${d.text}: ${d.value}</p>`)}if(!l(i)||i==="")return;i=cVt.link(i),A4.innerHTML=i;let s=A4.querySelectorAll("a");for(n=0;n<s.length;n++)s[n].setAttribute("target","_blank");let a=z.WHITE,c=z.BLACK,u='<div class="cesium-infoBox-description-lighter" style="';return u+="overflow:auto;",u+="word-wrap:break-word;",u+=`background-color:${a.toCssColorString()};`,u+=`color:${c.toCssColorString()};`,u+='">',u+=`${A4.innerHTML}</div>`,A4.innerHTML="",u}function PBe(e,t,n,i){let r=Mse(t),o=Ose(t,n);o.position=r;let s=l(i.waypointImage)?i.waypointImage:e._pinBuilder.fromMakiIconId("marker",z.RED,fW);o.billboard=wBe(s);let a=hf(t,"name",to.gpx);o.name=a,o.label=fVt(),o.label.text=a,o.description=Lse(t,o),i.clampToGround&&(o.billboard.heightReference=We.CLAMP_TO_GROUND,o.label.heightReference=We.CLAMP_TO_GROUND)}function dVt(e,t,n,i){let r=Ose(t,n);r.description=Lse(t,r);let o=Nse(t,"rtept",to.gpx),s=new Array(o.length);for(let a=0;a<o.length;a++)PBe(e,o[a],n,i),s[a]=Mse(o[a]);r.polyline=IBe(i.routeColor),i.clampToGround&&(r.polyline.clampToGround=!0),r.polyline.positions=s}function hVt(e,t,n,i){let r=Ose(t,n);r.description=Lse(t,r);let o=Nse(t,"trkseg",to.gpx),s=[],a=[],c,u=!0,f=new yc;for(let d=0;d<o.length;d++)c=mVt(o[d]),s=s.concat(c.positions),c.times.length>0?(a=a.concat(c.times),f.addSamples(a,s),u=u&&!0):u=!1;if(u){let d=l(i.waypointImage)?i.waypointImage:e._pinBuilder.fromMakiIconId("marker",z.RED,fW);r.billboard=wBe(d),r.position=f,i.clampToGround&&(r.billboard.heightReference=We.CLAMP_TO_GROUND),r.availability=new Ds,r.availability.addInterval(new En({start:a[0],stop:a[a.length-1]}))}r.polyline=IBe(i.trackColor),r.polyline.positions=s,i.clampToGround&&(r.polyline.clampToGround=!0)}function mVt(e){let t={positions:[],times:[]},n=Nse(e,"trkpt",to.gpx),i;for(let r=0;r<n.length;r++){let o=Mse(n[r]);t.positions.push(o),i=hf(n[r],"time",to.gpx),l(i)&&t.times.push(K.fromIso8601(i))}return t}function pVt(e){let t=Nb(e,"metadata",to.gpx);if(l(t)){let n={name:hf(t,"name",to.gpx),desc:hf(t,"desc",to.gpx),author:gVt(t),copyright:yVt(t),link:DBe(t),time:hf(t,"time",to.gpx),keywords:hf(t,"keywords",to.gpx),bounds:AVt(t)};if(l(n.name)||l(n.desc)||l(n.author)||l(n.copyright)||l(n.link)||l(n.time)||l(n.keywords)||l(n.bounds))return n}}function gVt(e){let t=Nb(e,"author",to.gpx);if(l(t)){let n={name:hf(t,"name",to.gpx),email:_Vt(t),link:DBe(t)};if(l(n.name)||l(n.email)||l(n.link))return n}}function _Vt(e){let t=Nb(e,"email",to.gpx);if(l(t)){let n=hf(t,"id",to.gpx),i=hf(t,"domain",to.gpx);return`${n}@${i}`}}function DBe(e){let t=Nb(e,"link",to.gpx);if(l(t)){let n={href:b4(t,"href"),text:hf(t,"text",to.gpx),mimeType:hf(t,"type",to.gpx)};if(l(n.href)||l(n.text)||l(n.mimeType))return n}}function yVt(e){let t=Nb(e,"copyright",to.gpx);if(l(t)){let n={author:b4(t,"author"),year:hf(t,"year",to.gpx),license:hf(t,"license",to.gpx)};if(l(n.author)||l(n.year)||l(n.license))return n}}function AVt(e){let t=Nb(e,"bounds",to.gpx);if(l(t)){let n={minLat:y4(t,"minlat",to.gpx),maxLat:y4(t,"maxlat",to.gpx),minLon:y4(t,"minlon",to.gpx),maxLon:y4(t,"maxlon",to.gpx)};if(l(n.minLat)||l(n.maxLat)||l(n.minLon)||l(n.maxLon))return n}}var EBe={wpt:PBe,rte:dVt,trk:hVt};function bVt(e,t,n,i){let r=Object.keys(EBe),o=r.length;for(let s=0;s<o;s++){let a=r[s],c=EBe[a],u=t.childNodes,f=u.length;for(let d=0;d<f;d++){let p=u[d];p.localName===a&&to.gpx.indexOf(p.namespaceURI)!==-1&&c(e,p,n,i)}}}function CBe(e,t,n){let i=e._entityCollection;i.removeAll();let r=t.documentElement,o=b4(r,"version"),s=b4(r,"creator"),a,c=pVt(r);l(c)&&(a=c.name),r.localName==="gpx"?bVt(e,r,i,n):console.log(`GPX - Unsupported node: ${r.localName}`);let u,f=i.computeAvailability(),d=f.start,p=f.stop,g=K.equals(d,nt.MINIMUM_VALUE),m=K.equals(p,nt.MAXIMUM_VALUE);if(!g||!m){let A;g&&(A=new Date,A.setHours(0,0,0,0),d=K.fromDate(A)),m&&(A=new Date,A.setHours(24,0,0,0),p=K.fromDate(A)),u=new Zm,u.startTime=d,u.stopTime=p,u.currentTime=K.clone(d),u.clockRange=As.LOOP_STOP,u.clockStep=zr.SYSTEM_CLOCK_MULTIPLIER,u.multiplier=Math.round(Math.min(Math.max(K.secondsDifference(p,d)/60,1),31556900))}let y=!1;return e._name!==a&&(e._name=a,y=!0),e._creator!==s&&(e._creator=s,y=!0),xVt(e._metadata,c)&&(e._metadata=c,y=!0),e._version!==o&&(e._version=o,y=!0),u!==e._clock&&(y=!0,e._clock=u),y&&e._changed.raiseEvent(e),xs.setLoading(e,!1),e}function xVt(e,t){return!l(e)&&!l(t)?!1:l(e)&&l(t)?e.name!==t.name||e.dec!==t.desc||e.src!==t.src||e.author!==t.author||e.copyright!==t.copyright||e.link!==t.link||e.time!==t.time||e.bounds!==t.bounds:!0}function TVt(e,t,n,i){i=i??H.EMPTY_OBJECT;let r=n;if(typeof n=="string"||n instanceof De){n=De.createIfNeeded(n),r=n.fetchBlob();let o=e._resourceCredits,s=n.credits;if(l(s)){let a=s.length;for(let c=0;c<a;c++)o.push(s[c])}}return Promise.resolve(r).then(function(o){return o instanceof Blob?uVt(o).then(function(s){let a,c;try{a=SBe.parseFromString(s,"application/xml")}catch(u){c=u.toString()}if(l(c)||a.body||a.documentElement.tagName==="parsererror"){let u=l(c)?c:a.documentElement.firstChild.nodeValue;throw u||(u=a.body.innerText),new oe(u)}return CBe(e,a,i)}):CBe(e,o,i)}).catch(function(o){return e._error.raiseEvent(e,o),console.log(o),Promise.reject(o)})}function DP(){this._changed=new be,this._error=new be,this._loading=new be,this._clock=void 0,this._entityCollection=new Ua(this),this._entityCluster=new Of,this._name=void 0,this._version=void 0,this._creator=void 0,this._metadata=void 0,this._isLoading=!1,this._pinBuilder=new uy}DP.load=function(e,t){return new DP().load(e,t)};Object.defineProperties(DP.prototype,{name:{get:function(){return this._name}},version:{get:function(){return this._version}},creator:{get:function(){return this._creator}},metadata:{get:function(){return this._metadata}},clock:{get:function(){return this._clock}},entities:{get:function(){return this._entityCollection}},isLoading:{get:function(){return this._isLoading}},changedEvent:{get:function(){return this._changed}},errorEvent:{get:function(){return this._error}},loadingEvent:{get:function(){return this._loading}},show:{get:function(){return this._entityCollection.show},set:function(e){this._entityCollection.show=e}},clustering:{get:function(){return this._entityCluster},set:function(e){this._entityCluster=e}}});DP.prototype.update=function(e){return!0};DP.prototype.load=function(e,t){if(!l(e))throw new pe("data is required.");t=t??H.EMPTY_OBJECT,xs.setLoading(this,!0);let n=this._name,i=this;return TVt(this,this._entityCollection,e,t).then(function(){let r,o=i._entityCollection.computeAvailability(),s=o.start,a=o.stop,c=K.equals(s,nt.MINIMUM_VALUE),u=K.equals(a,nt.MAXIMUM_VALUE);if(!c||!u){let d;c&&(d=new Date,d.setHours(0,0,0,0),s=K.fromDate(d)),u&&(d=new Date,d.setHours(24,0,0,0),a=K.fromDate(d)),r=new Zm,r.startTime=s,r.stopTime=a,r.currentTime=K.clone(s),r.clockRange=As.LOOP_STOP,r.clockStep=zr.SYSTEM_CLOCK_MULTIPLIER,r.multiplier=Math.round(Math.min(Math.max(K.secondsDifference(a,s)/60,1),31556900))}let f=!1;return r!==i._clock&&(i._clock=r,f=!0),n!==i._name&&(f=!0),f&&i._changed.raiseEvent(i),xs.setLoading(i,!1),i}).catch(function(r){return xs.setLoading(i,!1),i._error.raiseEvent(i,r),console.log(r),Promise.reject(r)})};var x4=DP;function EVt(e,t){this.position=e,this.headingPitchRoll=t}var T4=EVt;var jBe=Qo(Rse(),1),w4=Qo(Tf(),1);function CVt(e,t){this.position=e,this.headingPitchRange=t}var E4=CVt;function dW(e,t){this.id=t,this.name=e,this.playlistIndex=0,this.playlist=[],this.tourStart=new be,this.tourEnd=new be,this.entryStart=new be,this.entryEnd=new be,this._activeEntries=[]}dW.prototype.addPlaylistEntry=function(e){this.playlist.push(e)};dW.prototype.play=function(e,t){this.tourStart.raiseEvent();let n=this;OBe.call(this,e,t,function(i){n.playlistIndex=0,i||RBe(n._activeEntries),n.tourEnd.raiseEvent(i)})};dW.prototype.stop=function(){RBe(this._activeEntries)};function RBe(e){for(let t=e.pop();t!==void 0;t=e.pop())t.stop()}function OBe(e,t,n){let i=this.playlist[this.playlistIndex];if(i){let r=vVt.bind(this,e,t,n);if(this._activeEntries.push(i),this.entryStart.raiseEvent(i),i.blocking)i.play(r,e.scene.camera,t);else{let o=this;i.play(function(){o.entryEnd.raiseEvent(i);let s=o._activeEntries.indexOf(i);s>=0&&o._activeEntries.splice(s,1)}),r(e,t,n)}}else l(n)&&n(!1)}function vVt(e,t,n,i){let r=this.playlist[this.playlistIndex];if(this.entryEnd.raiseEvent(r,i),i)n(i);else{let o=this._activeEntries.indexOf(r);o>=0&&this._activeEntries.splice(o,1),this.playlistIndex++,OBe.call(this,e,t,n)}}var C4=dW;function hW(e,t,n){this.type="KmlTourFlyTo",this.blocking=!0,this.activeCamera=null,this.activeCallback=null,this.duration=e,this.view=n,this.flyToMode=t}hW.prototype.play=function(e,t,n){if(this.activeCamera=t,l(e)&&e!==null){let r=this;this.activeCallback=function(o){delete r.activeCallback,delete r.activeCamera,e(l(o)?!1:o)}}let i=this.getCameraOptions(n);if(this.view.headingPitchRoll)t.flyTo(i);else if(this.view.headingPitchRange){let r=new ue(this.view.position);t.flyToBoundingSphere(r,i)}};hW.prototype.stop=function(){l(this.activeCamera)&&this.activeCamera.cancelFlight(),l(this.activeCallback)&&this.activeCallback(!0)};hW.prototype.getCameraOptions=function(e){let t={duration:this.duration};return l(this.activeCallback)&&(t.complete=this.activeCallback),this.flyToMode==="smooth"&&(t.easingFunction=Rs.LINEAR_NONE),this.view.headingPitchRoll?(t.destination=this.view.position,t.orientation=this.view.headingPitchRoll):this.view.headingPitchRange&&(t.offset=this.view.headingPitchRange),l(e)&&(t=Ot(t,e)),t};var v4=hW;function Fse(e){this.type="KmlTourWait",this.blocking=!0,this.duration=e,this.timeout=null}Fse.prototype.play=function(e){let t=this;this.activeCallback=e,this.timeout=setTimeout(function(){delete t.activeCallback,e(!1)},this.duration*1e3)};Fse.prototype.stop=function(){clearTimeout(this.timeout),l(this.activeCallback)&&this.activeCallback(!0)};var S4=Fse;var HBe={avi:"video/x-msvideo",bmp:"image/bmp",bz2:"application/x-bzip2",chm:"application/vnd.ms-htmlhelp",css:"text/css",csv:"text/csv",doc:"application/msword",dvi:"application/x-dvi",eps:"application/postscript",flv:"video/x-flv",gif:"image/gif",gz:"application/x-gzip",htm:"text/html",html:"text/html",ico:"image/vnd.microsoft.icon",jnlp:"application/x-java-jnlp-file",jpeg:"image/jpeg",jpg:"image/jpeg",m3u:"audio/x-mpegurl",m4v:"video/mp4",mathml:"application/mathml+xml",mid:"audio/midi",midi:"audio/midi",mov:"video/quicktime",mp3:"audio/mpeg",mp4:"video/mp4",mp4v:"video/mp4",mpeg:"video/mpeg",mpg:"video/mpeg",odp:"application/vnd.oasis.opendocument.presentation",ods:"application/vnd.oasis.opendocument.spreadsheet",odt:"application/vnd.oasis.opendocument.text",ogg:"application/ogg",pdf:"application/pdf",png:"image/png",pps:"application/vnd.ms-powerpoint",ppt:"application/vnd.ms-powerpoint",ps:"application/postscript",qt:"video/quicktime",rdf:"application/rdf+xml",rss:"application/rss+xml",rtf:"application/rtf",svg:"image/svg+xml",swf:"application/x-shockwave-flash",text:"text/plain",tif:"image/tiff",tiff:"image/tiff",txt:"text/plain",wav:"audio/x-wav",wma:"audio/x-ms-wma",wmv:"video/x-ms-wmv",xml:"application/xml",zip:"application/zip",detectFromFilename:function(e){let t=e.toLowerCase();return t=rg(t),HBe[t]}},qse;typeof DOMParser<"u"&&(qse=new DOMParser);var SVt=new jBe.default({stripPrefix:!1,email:!1,replaceFn:function(e){return e.urlMatchType==="scheme"||e.urlMatchType==="www"}}),Lb=32,MBe=2414016,NBe=1,LBe=16093e3,FBe=.1,BBe=[null,void 0,"http://www.opengis.net/kml/2.2","http://earth.google.com/kml/2.2","http://earth.google.com/kml/2.1","http://earth.google.com/kml/2.0"],kBe=["http://www.google.com/kml/ext/2.2"],wVt=["http://www.w3.org/2005/Atom"],Ve={kml:BBe,gx:kBe,atom:wVt,kmlgx:BBe.concat(kBe)},Yse={Document:QBe,Folder:qVt,Placemark:YVt,NetworkLink:n4t,GroundOverlay:QVt,PhotoOverlay:n2e,ScreenOverlay:ZVt,Tour:KVt},Vse=class{constructor(t){this._dataSource=t,this._deferred=Pu(),this._stack=[],this._promises=[],this._timeoutSet=!1,this._used=!1,this._started=0,this._timeThreshold=1e3}get dataSource(){return this._dataSource}addNodes(t,n){this._stack.push({nodes:t,index:0,processingData:n}),this._used=!0}addPromise(t){this._promises.push(t)}wait(){let t=this._deferred;return this._used||t.resolve(),Promise.all([t.promise,Promise.all(this._promises)])}process(){let t=this._stack.length===1;return t&&(this._started=hy._getTimestamp()),this._process(t)}_giveUpTime(){if(this._timeoutSet)return;this._timeoutSet=!0,this._timeThreshold=50;let t=this;setTimeout(function(){t._timeoutSet=!1,t._started=hy._getTimestamp(),t._process(!0)},0)}_nextNode(){let t=this._stack,n=t[t.length-1],i=n.index,r=n.nodes;if(i!==r.length)return++n.index,r[i]}_pop(){let t=this._stack;return t.pop(),t.length===0?(this._deferred.resolve(),!1):!0}_process(t){let n=this.dataSource,i=this._stack[this._stack.length-1].processingData,r=this._nextNode();for(;l(r);){let o=Yse[r.localName];if(l(o)&&(Ve.kml.indexOf(r.namespaceURI)!==-1||Ve.gx.indexOf(r.namespaceURI)!==-1)&&(o(n,r,i,this),this._timeoutSet||hy._getTimestamp()>this._started+this._timeThreshold)){this._giveUpTime();return}r=this._nextNode()}this._pop()&&t&&this._process(!0)}};function IVt(e){let t=e.slice(0,Math.min(4,e.size)),n=Pu(),i=new FileReader;return i.addEventListener("load",function(){n.resolve(new DataView(i.result).getUint32(0,!1)===1347093252)}),i.addEventListener("error",function(){n.reject(i.error)}),i.readAsArrayBuffer(t),n.promise}function PVt(e){let t=Pu(),n=new FileReader;return n.addEventListener("load",function(){t.resolve(n.result)}),n.addEventListener("error",function(){t.reject(n.error)}),n.readAsText(e),t.promise}function GBe(e){let t={xsi:"http://www.w3.org/2001/XMLSchema-instance"},n,i,r,o;for(let s in t)t.hasOwnProperty(s)&&(r=RegExp(`[< ]${s}:`),o=`xmlns:${s}=`,r.test(e)&&e.indexOf(o)===-1&&(l(n)||(n=e.substr(0,e.indexOf("<kml")+4),i=e.substr(n.length)),n+=` ${o}"${t[s]}"`));return l(n)&&(e=n+i),e}function WBe(e){let t=e.indexOf("xmlns:"),n=e.indexOf(">",t),i,r,o;for(;t!==-1&&t<n;)i=e.slice(t,e.indexOf('"',t)),r=t,t=e.indexOf(i,t+1),t!==-1?(o=e.indexOf('"',e.indexOf('"',t)+1),e=e.slice(0,t-1)+e.slice(o+1,e.length),t=e.indexOf("xmlns:",r-1)):t=e.indexOf("xmlns:",r+1);return e}async function DVt(e,t){let n=await e.getData(new KV);n=GBe(n),n=WBe(n),t.kml=qse.parseFromString(n,"application/xml")}async function Bse(e,t){let n=HBe.detectFromFilename(e.filename)??"application/octet-stream",i=await e.getData(new YV(n));t[e.filename]=i}function md(e,t,n,i){let r=i.keys,o=new w4.default("."),s=e.querySelectorAll(t);for(let a=0;a<s.length;a++){let c=s[a],u=c.getAttribute(n);if(l(u)){let d=new w4.default(u).absoluteTo(o).toString(),p=r.indexOf(d);if(p!==-1){let g=r[p];c.setAttribute(n,i[g]),t==="a"&&c.getAttribute("download")===null&&c.setAttribute("download",g)}}}}function pd(e,t,n,i){let r=e.querySelectorAll(t);for(let o=0;o<r.length;o++){let s=r[o],a=s.getAttribute(n),c=Xse(a,i);l(c)&&s.setAttribute(n,c.url)}}function qBe(e,t,n){let i=Oa(e,"id");i=l(i)&&i.length!==0?i:Kn(),l(n)&&(i=n+i);let r=t.getById(i);return l(r)&&(i=Kn(),l(n)&&(i=n+i)),r=t.add(new Jr({id:i})),l(r.kml)||(r.addProperty("kml"),r.kml=new Wse),r}function I4(e,t){return e==="absolute"||e==="relativeToGround"||t==="relativeToSeaFloor"}function _W(e,t){if(!l(e))return h.fromDegrees(0,0,0,t);let n=e.match(/[^\s,\n]+/g);if(!l(n))return h.fromDegrees(0,0,0,t);let i=parseFloat(n[0]),r=parseFloat(n[1]),o=parseFloat(n[2]);return i=isNaN(i)?0:i,r=isNaN(r)?0:r,o=isNaN(o)?0:o,h.fromDegrees(i,r,o,t)}function mW(e,t){if(!l(e))return;let n=e.textContent.match(/[^\s\n]+/g);if(!l(n))return;let i=n.length,r=new Array(i),o=0;for(let s=0;s<i;s++)r[o++]=_W(n[s],t);return r}function Fb(e,t){if(!l(e))return;let n=e.getAttribute(t);if(n!==null){let i=parseFloat(n);return isNaN(i)?void 0:i}}function Oa(e,t){if(!l(e))return;let n=e.getAttribute(t);return n!==null?n:void 0}function cr(e,t,n){if(!l(e))return;let i=e.childNodes,r=i.length;for(let o=0;o<r;o++){let s=i[o];if(s.localName===t&&n.indexOf(s.namespaceURI)!==-1)return s}}function UBe(e,t,n){if(!l(e))return;let i=[],r=e.getElementsByTagNameNS("*",t),o=r.length;for(let s=0;s<o;s++){let a=r[s];a.localName===t&&n.indexOf(a.namespaceURI)!==-1&&i.push(a)}return i}function cp(e,t,n){if(!l(e))return[];let i=[],r=e.childNodes,o=r.length;for(let s=0;s<o;s++){let a=r[s];a.localName===t&&n.indexOf(a.namespaceURI)!==-1&&i.push(a)}return i}function Si(e,t,n){let i=cr(e,t,n);if(l(i)){let r=parseFloat(i.textContent);return isNaN(r)?void 0:r}}function Fn(e,t,n){let i=cr(e,t,n);if(l(i))return i.textContent.trim()}function lp(e,t,n){let i=cr(e,t,n);if(l(i)){let r=i.textContent.trim();return r==="1"||/^true$/i.test(r)}}function Xse(e,t,n){if(!l(e))return;let i;if(l(n)){e=e.replace(/\\/g,"/");let r=n[e];if(l(r))i=new De({url:r});else{let o=new w4.default(t.getUrlComponent()),s=new w4.default(e);r=n[s.absoluteTo(o)],l(r)&&(i=new De({url:r}))}}return l(i)||(i=t.getDerivedResource({url:e})),i}var mf={maximumRed:void 0,red:void 0,maximumGreen:void 0,green:void 0,maximumBlue:void 0,blue:void 0};function jse(e,t){if(!l(e)||/^\s*$/gm.test(e))return;e[0]==="#"&&(e=e.substring(1));let n=parseInt(e.substring(0,2),16)/255,i=parseInt(e.substring(2,4),16)/255,r=parseInt(e.substring(4,6),16)/255,o=parseInt(e.substring(6,8),16)/255;return t?(o>0?(mf.maximumRed=o,mf.red=void 0):(mf.maximumRed=void 0,mf.red=0),r>0?(mf.maximumGreen=r,mf.green=void 0):(mf.maximumGreen=void 0,mf.green=0),i>0?(mf.maximumBlue=i,mf.blue=void 0):(mf.maximumBlue=void 0,mf.blue=0),mf.alpha=n,z.fromRandom(mf)):new z(o,r,i,n)}function MC(e,t,n){let i=Fn(e,t,n);if(l(i))return jse(i,Fn(e,"colorMode",n)==="random")}function RVt(e){let t=cr(e,"TimeStamp",Ve.kmlgx),n=Fn(t,"when",Ve.kmlgx);if(!l(t)||!l(n)||n.length===0)return;let i=K.fromIso8601(n),r=new Ds;return r.addInterval(new En({start:i,stop:nt.MAXIMUM_VALUE})),r}function OVt(e){let t=cr(e,"TimeSpan",Ve.kmlgx);if(!l(t))return;let n,i=cr(t,"begin",Ve.kmlgx),r=l(i)?K.fromIso8601(i.textContent):void 0,o=cr(t,"end",Ve.kmlgx),s=l(o)?K.fromIso8601(o.textContent):void 0;if(l(r)&&l(s)){if(K.lessThan(s,r)){let a=r;r=s,s=a}n=new Ds,n.addInterval(new En({start:r,stop:s}))}else l(r)?(n=new Ds,n.addInterval(new En({start:r,stop:nt.MAXIMUM_VALUE}))):l(s)&&(n=new Ds,n.addInterval(new En({start:nt.MINIMUM_VALUE,stop:s})));return n}function YBe(){let e=new nl;return e.width=Lb,e.height=Lb,e.scaleByDistance=new qt(MBe,NBe,LBe,FBe),e.pixelOffsetScaleByDistance=new qt(MBe,NBe,LBe,FBe),e}function Kse(){let e=new rm;return e.outline=!0,e.outlineColor=z.WHITE,e}function XBe(){let e=new im;return e.translucencyByDistance=new qt(3e6,1,5e6,0),e.pixelOffset=new U(17,0),e.horizontalOrigin=Vi.LEFT,e.font="16px sans-serif",e.style=_o.FILL_AND_OUTLINE,e}function $se(e,t,n,i,r){let o=Fn(e,"href",Ve.kml);if(!l(o)||o.length===0)return;if(o.indexOf("root://icons/palette-")===0){let a=o.charAt(21),c=Si(e,"x",Ve.gx)??0,u=Si(e,"y",Ve.gx)??0;c=Math.min(c/32,7),u=7-Math.min(u/32,7);let f=8*u+c;o=`https://maps.google.com/mapfiles/kml/pal${a}/icon${f}.png`}let s=Xse(o,n,i);if(r){let a=Fn(e,"refreshMode",Ve.kml),c=Fn(e,"viewRefreshMode",Ve.kml);a==="onInterval"||a==="onExpire"?_t(`kml-refreshMode-${a}`,`KML - Unsupported Icon refreshMode: ${a}`):(c==="onStop"||c==="onRegion")&&_t(`kml-refreshMode-${c}`,`KML - Unsupported Icon viewRefreshMode: ${c}`);let u=Fn(e,"viewBoundScale",Ve.kml)??1,f=c==="onStop"?"BBOX=[bboxWest],[bboxSouth],[bboxEast],[bboxNorth]":"",d=Fn(e,"viewFormat",Ve.kml)??f,p=Fn(e,"httpQuery",Ve.kml);l(d)&&s.setQueryParameters(Ef(gW(d))),l(p)&&s.setQueryParameters(Ef(gW(p)));let g=t._ellipsoid;return Zse(s,t.camera,t.canvas,u,t._lastCameraView.bbox,g),s}return s}function MVt(e,t,n,i,r){let o=Si(t,"scale",Ve.kml),s=Si(t,"heading",Ve.kml),a=MC(t,"color",Ve.kml),c=cr(t,"Icon",Ve.kml),u=$se(c,e,i,r,!1);l(c)&&!l(u)&&(u=!1);let f=Si(c,"x",Ve.gx),d=Si(c,"y",Ve.gx),p=Si(c,"w",Ve.gx),g=Si(c,"h",Ve.gx),m=cr(t,"hotSpot",Ve.kml),y=Fb(m,"x"),A=Fb(m,"y"),b=Oa(m,"xunits"),x=Oa(m,"yunits"),T=n.billboard;l(T)||(T=YBe(),n.billboard=T),T.image=u,T.scale=o,T.color=a,(l(f)||l(d)||l(p)||l(g))&&(T.imageSubRegion=new et(f,d,p,g)),l(s)&&s!==0&&(T.rotation=D.toRadians(-s),T.alignedAxis=h.UNIT_Z),o=o??1;let E,v;l(y)&&(b==="pixels"?E=-y*o:b==="insetPixels"?E=(y-Lb)*o:b==="fraction"&&(E=-y*Lb*o),E+=Lb*.5*o),l(A)&&(x==="pixels"?v=A*o:x==="insetPixels"?v=(-A+Lb)*o:x==="fraction"&&(v=A*Lb*o),v-=Lb*.5*o),(l(E)||l(v))&&(T.pixelOffset=new U(E,v))}function pW(e,t,n,i,r){for(let o=0,s=t.childNodes.length;o<s;o++){let a=t.childNodes.item(o);if(a.localName==="IconStyle")MVt(e,a,n,i,r);else if(a.localName==="LabelStyle"){let c=n.label;l(c)||(c=XBe(),n.label=c),c.scale=Si(a,"scale",Ve.kml)??c.scale,c.fillColor=MC(a,"color",Ve.kml)??c.fillColor,c.text=n.name}else if(a.localName==="LineStyle"){let c=n.polyline;l(c)||(c=new il,n.polyline=c),c.width=Si(a,"width",Ve.kml),c.material=MC(a,"color",Ve.kml),l(MC(a,"outerColor",Ve.gx))&&_t("kml-gx:outerColor","KML - gx:outerColor is not supported in a LineStyle"),l(Si(a,"outerWidth",Ve.gx))&&_t("kml-gx:outerWidth","KML - gx:outerWidth is not supported in a LineStyle"),l(Si(a,"physicalWidth",Ve.gx))&&_t("kml-gx:physicalWidth","KML - gx:physicalWidth is not supported in a LineStyle"),l(lp(a,"labelVisibility",Ve.gx))&&_t("kml-gx:labelVisibility","KML - gx:labelVisibility is not supported in a LineStyle")}else if(a.localName==="PolyStyle"){let c=n.polygon;l(c)||(c=Kse(),n.polygon=c),c.material=MC(a,"color",Ve.kml)??c.material,c.fill=lp(a,"fill",Ve.kml)??c.fill,c.outline=lp(a,"outline",Ve.kml)??c.outline}else if(a.localName==="BalloonStyle"){let c=jse(Fn(a,"bgColor",Ve.kml))??z.WHITE,u=jse(Fn(a,"textColor",Ve.kml))??z.BLACK,f=Fn(a,"text",Ve.kml);n.addProperty("balloonStyle"),n.balloonStyle={bgColor:c,textColor:u,text:f}}else if(a.localName==="ListStyle"){let c=Fn(a,"listItemType",Ve.kml);(c==="radioFolder"||c==="checkOffOnly")&&_t(`kml-listStyle-${c}`,`KML - Unsupported ListStyle with listItemType: ${c}`)}}}function NVt(e,t,n,i,r){let o=new Jr,s,a=-1,c=t.childNodes,u=c.length;for(let d=0;d<u;d++){let p=c[d];(p.localName==="Style"||p.localName==="StyleMap")&&(a=d)}if(a!==-1){let d=c[a];if(d.localName==="Style")pW(e,d,o,i,r);else{let p=cp(d,"Pair",Ve.kml);for(let g=0;g<p.length;g++){let m=p[g],y=Fn(m,"key",Ve.kml);if(y==="normal"){let A=Fn(m,"styleUrl",Ve.kml);if(l(A))s=n.getById(A),l(s)||(s=n.getById(`#${A}`)),l(s)&&o.merge(s);else{let b=cr(m,"Style",Ve.kml);pW(e,b,o,i,r)}}else _t(`kml-styleMap-${y}`,`KML - Unsupported StyleMap key: ${y}`)}}}let f=Fn(t,"styleUrl",Ve.kml);if(l(f)){let d=f;if(f[0]!=="#"&&f.indexOf("#")!==-1){let p=f.split("#"),g=p[0];d=`${i.getDerivedResource({url:g}).getUrlComponent()}#${p[1]}`}s=n.getById(d),l(s)||(s=n.getById(`#${d}`)),l(s)&&o.merge(s)}return o}function LVt(e,t,n){return t.fetchXML().then(function(i){return KBe(e,i,n,t,!0)})}function KBe(e,t,n,i,r,o){let s,a,c,u,f=UBe(t,"Style",Ve.kml);if(l(f)){let y=f.length;for(s=0;s<y;s++)u=f[s],a=Oa(u,"id"),l(a)&&(a=`#${a}`,r&&l(i)&&(a=i.getUrlComponent()+a),l(n.getById(a))||(c=new Jr({id:a}),n.add(c),pW(e,u,c,i,o)))}let d=UBe(t,"StyleMap",Ve.kml);if(l(d)){let y=d.length;for(s=0;s<y;s++){let A=d[s];if(a=Oa(A,"id"),l(a)){let b=cp(A,"Pair",Ve.kml);for(let x=0;x<b.length;x++){let T=b[x],E=Fn(T,"key",Ve.kml);if(E==="normal"){if(a=`#${a}`,r&&l(i)&&(a=i.getUrlComponent()+a),!l(n.getById(a))){c=n.getOrCreateEntity(a);let v=Fn(T,"styleUrl",Ve.kml);if(l(v)){v[0]!=="#"&&(v=`#${v}`),r&&l(i)&&(v=i.getUrlComponent()+v);let S=n.getById(v);l(S)&&c.merge(S)}else u=cr(T,"Style",Ve.kml),pW(e,u,c,i,o)}}else _t(`kml-styleMap-${E}`,`KML - Unsupported StyleMap key: ${E}`)}}}}let p=[],g=t.getElementsByTagName("styleUrl"),m=g.length;for(s=0;s<m;s++){let y=g[s].textContent;if(y[0]!=="#"){let A=y.split("#");if(A.length===2){let b=A[0],x=i.getDerivedResource({url:b});p.push(LVt(e,x,n))}}}return p}function Jse(e,t,n){let i=new O_(e,t.id,["position"]),r=new m0(t.position);t.polyline=l(n.polyline)?n.polyline.clone():new il,t.polyline.positions=new Z_([i,r])}function $Be(e,t){return!l(e)&&!l(t)||e==="clampToGround"?We.CLAMP_TO_GROUND:e==="relativeToGround"?We.RELATIVE_TO_GROUND:e==="absolute"?We.NONE:t==="clampToSeaFloor"?(_t("kml-gx:altitudeMode-clampToSeaFloor","KML - <gx:altitudeMode>:clampToSeaFloor is currently not supported, using <kml:altitudeMode>:clampToGround."),We.CLAMP_TO_GROUND):t==="relativeToSeaFloor"?(_t("kml-gx:altitudeMode-relativeToSeaFloor","KML - <gx:altitudeMode>:relativeToSeaFloor is currently not supported, using <kml:altitudeMode>:relativeToGround."),We.RELATIVE_TO_GROUND):(l(e)?_t("kml-altitudeMode-unknown",`KML - Unknown <kml:altitudeMode>:${e}, using <kml:altitudeMode>:CLAMP_TO_GROUND.`):_t("kml-gx:altitudeMode-unknown",`KML - Unknown <gx:altitudeMode>:${t}, using <kml:altitudeMode>:CLAMP_TO_GROUND.`),We.CLAMP_TO_GROUND)}function FVt(e,t,n){return n==="relativeToSeaFloor"||t==="absolute"||t==="relativeToGround"?e:((l(t)&&t!=="clampToGround"||l(n)&&n!=="clampToSeaFloor")&&_t("kml-altitudeMode-unknown",`KML - Unknown altitudeMode: ${t??n}`),new m0(e))}function BVt(e,t,n,i){if(!l(e))return;if(n==="relativeToSeaFloor"||t==="absolute"||t==="relativeToGround")return e;(l(t)&&t!=="clampToGround"||l(n)&&n!=="clampToSeaFloor")&&_t("kml-altitudeMode-unknown",`KML - Unknown altitudeMode: ${t??n}`);let r=e.length;for(let o=0;o<r;o++){let s=e[o];i.scaleToGeodeticSurface(s,s)}return e}function yW(e,t,n,i){let r=t.label;l(r)||(r=l(n.label)?n.label.clone():XBe(),t.label=r),r.text=t.name;let o=t.billboard;if(l(o)||(o=l(n.billboard)?n.billboard.clone():YBe(),t.billboard=o),l(o.image)?o.image.getValue()||(o.image=void 0):o.image=e._pinBuilder.fromColor(z.YELLOW,64),l(o.scale)){let s=o.scale.getValue();s!==0?r.pixelOffset=new U(s*16+1,0):(r.pixelOffset=void 0,r.horizontalOrigin=void 0)}l(i)&&e._clampToGround&&(o.heightReference=i,r.heightReference=i)}function JBe(e,t){let n=e.path;l(n)||(n=new Dg,n.leadTime=0,e.path=n);let i=t.polyline;l(i)&&(n.material=i.material,n.width=i.width)}function kVt(e,t,n,i,r){let o=Fn(n,"coordinates",Ve.kml),s=Fn(n,"altitudeMode",Ve.kml),a=Fn(n,"altitudeMode",Ve.gx),c=lp(n,"extrude",Ve.kml),u=e._ellipsoid,f=_W(o,u);return i.position=f,yW(e,i,r,$Be(s,a)),c&&I4(s,a)&&Jse(t,i,r),!0}function zBe(e,t,n,i,r){let o=cr(n,"coordinates",Ve.kml),s=Fn(n,"altitudeMode",Ve.kml),a=Fn(n,"altitudeMode",Ve.gx),c=lp(n,"extrude",Ve.kml),u=lp(n,"tessellate",Ve.kml),f=I4(s,a),d=Si(n,"drawOrder",Ve.gx),p=e._ellipsoid,g=mW(o,p),m=r.polyline;if(f&&c){let y=new Rg;i.wall=y,y.positions=g;let A=r.polygon;l(A)&&(y.fill=A.fill,y.material=A.material),y.outline=!0,l(m)?(y.outlineColor=l(m.material)?m.material.color:z.WHITE,y.outlineWidth=m.width):l(A)&&(y.outlineColor=l(A.material)?A.material.color:z.WHITE)}else if(e._clampToGround&&!f&&u){let y=new il;y.clampToGround=!0,i.polyline=y,y.positions=g,l(m)?(y.material=l(m.material)?m.material.color.getValue(nt.MINIMUM_VALUE):z.WHITE,y.width=m.width??1):(y.material=z.WHITE,y.width=1),y.zIndex=d}else l(d)&&_t("kml-gx:drawOrder","KML - gx:drawOrder is not supported in LineStrings when clampToGround is false"),e._clampToGround&&!u&&_t("kml-line-tesselate","Ignoring clampToGround for KML lines without the tessellate flag."),m=l(m)?m.clone():new il,i.polyline=m,m.positions=BVt(g,s,a,p),(!u||f)&&(m.arcType=ln.NONE);return!0}function UVt(e,t,n,i,r){let o=cr(n,"outerBoundaryIs",Ve.kml),s=cr(o,"LinearRing",Ve.kml),a=cr(s,"coordinates",Ve.kml),c=e._ellipsoid,u=mW(a,c),f=lp(n,"extrude",Ve.kml),d=Fn(n,"altitudeMode",Ve.kml),p=Fn(n,"altitudeMode",Ve.gx),g=I4(d,p),m=l(r.polygon)?r.polygon.clone():Kse(),y=r.polyline;if(l(y)&&(m.outlineColor=l(y.material)?y.material.color:z.WHITE,m.outlineWidth=y.width),i.polygon=m,g?(m.perPositionHeight=!0,m.extrudedHeight=f?0:void 0):e._clampToGround||(m.height=0),l(u)){let A=new Mc(u),b=cp(n,"innerBoundaryIs",Ve.kml);for(let x=0;x<b.length;x++){s=cp(b[x],"LinearRing",Ve.kml);for(let T=0;T<s.length;T++)a=cr(s[T],"coordinates",Ve.kml),u=mW(a,c),l(u)&&A.holes.push(new Mc(u))}m.hierarchy=A}return!0}function zVt(e,t,n,i,r){let o=Fn(n,"altitudeMode",Ve.kml),s=Fn(n,"altitudeMode",Ve.gx),a=cp(n,"coord",Ve.gx),c=cp(n,"angles",Ve.gx),u=cp(n,"when",Ve.kml),f=lp(n,"extrude",Ve.kml),d=I4(o,s),p=e._ellipsoid;c.length>0&&_t("kml-gx:angles","KML - gx:angles are not supported in gx:Tracks");let g=Math.min(a.length,u.length),m=[],y=[];for(let b=0;b<g;b++){let x=_W(a[b].textContent,p);m.push(x),y.push(K.fromIso8601(u[b].textContent))}let A=new yc;return A.addSamples(y,m),i.position=A,yW(e,i,r,$Be(o,s)),JBe(i,r),i.availability=new Ds,u.length>0&&i.availability.addInterval(new En({start:y[0],stop:y[y.length-1]})),d&&f&&Jse(t,i,r),!0}function VBe(e,t,n,i,r,o,s,a,c){let u=e[0],f=e[e.length-1],d=new yc;d.addSamples(e,t),n.intervals.addInterval(new En({start:u,stop:f,isStartIncluded:c,isStopIncluded:c,data:FVt(d,s,a)})),i.addInterval(new En({start:u,stop:f,isStartIncluded:c,isStopIncluded:c})),r.intervals.addInterval(new En({start:u,stop:f,isStartIncluded:c,isStopIncluded:c,data:o}))}function VVt(e,t,n,i,r){let o=lp(n,"interpolate",Ve.gx),s=cp(n,"Track",Ve.gx),a,c,u,f=!1,d=new Q_,p=new Ds,g=new _c,m=e._ellipsoid;for(let y=0,A=s.length;y<A;y++){let b=s[y],x=cp(b,"when",Ve.kml),T=cp(b,"coord",Ve.gx),E=Fn(b,"altitudeMode",Ve.kml),v=Fn(b,"altitudeMode",Ve.gx),S=I4(E,v),I=lp(b,"extrude",Ve.kml),R=Math.min(T.length,x.length),O=[];a=[];for(let L=0;L<R;L++){let _=_W(T[L].textContent,m);O.push(_),a.push(K.fromIso8601(x[L].textContent))}o&&(l(c)&&VBe([c,a[0]],[u,O[0]],g,p,d,!1,"absolute",void 0,!1),c=a[R-1],u=O[O.length-1]),VBe(a,O,g,p,d,S&&I,E,v,!0),f=f||S&&I}return i.availability=p,i.position=g,yW(e,i,r),JBe(i,r),f&&(Jse(t,i,r),i.polyline.show=d),!0}var ZBe={Point:kVt,LineString:zBe,LinearRing:zBe,Polygon:UVt,Track:zVt,MultiTrack:VVt,MultiGeometry:jVt,Model:HVt};function jVt(e,t,n,i,r,o){let s=n.childNodes,a=!1;for(let c=0,u=s.length;c<u;c++){let f=s.item(c),d=ZBe[f.localName];if(l(d)){let p=qBe(f,t,o);p.parent=i,p.name=i.name,p.availability=i.availability,p.description=i.description,p.kml=i.kml,d(e,t,f,p,r)&&(a=!0)}}return a}function HVt(e,t,n,i,r){return _t("kml-unsupportedGeometry",`KML - Unsupported geometry: ${n.localName}`),!1}function GVt(e,t){let n=cr(e,"ExtendedData",Ve.kml);if(!l(n))return;l(cr(n,"SchemaData",Ve.kml))&&_t("kml-schemaData","KML - SchemaData is unsupported"),l(Oa(n,"xmlns:prefix"))&&_t("kml-extendedData","KML - ExtendedData with xmlns:prefix is unsupported");let i={},r=cp(n,"Data",Ve.kml);if(l(r)){let o=r.length;for(let s=0;s<o;s++){let a=r[s],c=Oa(a,"name");l(c)&&(i[c]={displayName:Fn(a,"displayName",Ve.kml),value:Fn(a,"value",Ve.kml)})}}t.kml.extendedData=i}var Gr;typeof document<"u"&&(Gr=document.createElement("div"));function WVt(e,t,n,i,r){let o,s,a,c=t.kml,u=c.extendedData,f=Fn(e,"description",Ve.kml),d=t.balloonStyle??n.balloonStyle,p=z.WHITE,g=z.BLACK,m=f;l(d)&&(p=d.bgColor??z.WHITE,g=d.textColor??z.BLACK,m=d.text??f);let y;if(l(m)){if(m=m.replace("$[name]",t.name??""),m=m.replace("$[description]",f??""),m=m.replace("$[address]",c.address??""),m=m.replace("$[Snippet]",c.snippet??""),m=m.replace("$[id]",t.id),m=m.replace("$[geDirections]",""),l(u)){let x=m.match(/\$\[.+?\]/g);if(x!==null)for(o=0;o<x.length;o++){let T=x[o],E=T.substr(2,T.length-3),v=/\/displayName$/.test(E);E=E.replace(/\/displayName$/,""),y=u[E],l(y)&&(y=v?y.displayName:y.value),l(y)&&(m=m.replace(T,y??""))}}}else if(l(u)&&(a=Object.keys(u),a.length>0)){for(m='<table class="cesium-infoBox-defaultTable cesium-infoBox-defaultTable-lighter"><tbody>',o=0;o<a.length;o++)s=a[o],y=u[s],m+=`<tr><th>${y.displayName??s}</th><td>${y.value??""}</td></tr>`;m+="</tbody></table>"}if(!l(m))return;m=SVt.link(m),Gr.innerHTML=m;let A=Gr.querySelectorAll("a");for(o=0;o<A.length;o++)A[o].setAttribute("target","_blank");l(i)&&i.keys.length>1&&(md(Gr,"a","href",i),md(Gr,"link","href",i),md(Gr,"area","href",i),md(Gr,"img","src",i),md(Gr,"iframe","src",i),md(Gr,"video","src",i),md(Gr,"audio","src",i),md(Gr,"source","src",i),md(Gr,"track","src",i),md(Gr,"input","src",i),md(Gr,"embed","src",i),md(Gr,"script","src",i),md(Gr,"video","poster",i)),pd(Gr,"a","href",r),pd(Gr,"link","href",r),pd(Gr,"area","href",r),pd(Gr,"img","src",r),pd(Gr,"iframe","src",r),pd(Gr,"video","src",r),pd(Gr,"audio","src",r),pd(Gr,"source","src",r),pd(Gr,"track","src",r),pd(Gr,"input","src",r),pd(Gr,"embed","src",r),pd(Gr,"script","src",r),pd(Gr,"video","poster",r);let b='<div class="cesium-infoBox-description-lighter" style="';b+="overflow:auto;",b+="word-wrap:break-word;",b+=`background-color:${p.toCssColorString()};`,b+=`color:${g.toCssColorString()};`,b+='">',b+=`${Gr.innerHTML}</div>`,Gr.innerHTML="",t.description=b}function AW(e,t,n){let i=n.entityCollection,r=n.parentEntity,o=n.sourceResource,s=n.uriResolver,a=qBe(t,i,n.context),c=a.kml,u=NVt(e,t,n.styleCollection,o,s),f=Fn(t,"name",Ve.kml);a.name=f,a.parent=r;let d=OVt(t);l(d)||(d=RVt(t)),a.availability=d,Qse(a);function p(T){return T?T.show&&p(T.parent):!0}let g=lp(t,"visibility",Ve.kml);a.show=p(r)&&(g??!0);let m=cr(t,"author",Ve.atom),y=c.author;y.name=Fn(m,"name",Ve.atom),y.uri=Fn(m,"uri",Ve.atom),y.email=Fn(m,"email",Ve.atom);let A=cr(t,"link",Ve.atom),b=c.link;b.href=Oa(A,"href"),b.hreflang=Oa(A,"hreflang"),b.rel=Oa(A,"rel"),b.type=Oa(A,"type"),b.title=Oa(A,"title"),b.length=Oa(A,"length"),c.address=Fn(t,"address",Ve.kml),c.phoneNumber=Fn(t,"phoneNumber",Ve.kml),c.snippet=Fn(t,"Snippet",Ve.kml),GVt(t,a),WVt(t,a,u,s,o);let x=e._ellipsoid;return t2e(t,a,x),e2e(t,a,x),l(cr(t,"Region",Ve.kml))&&_t("kml-region","KML - Placemark Regions are unsupported"),{entity:a,styleEntity:u}}function QBe(e,t,n,i){i.addNodes(t.childNodes,n),i.process()}function qVt(e,t,n,i){let r=AW(e,t,n),o=Je(n);o.parentEntity=r.entity,QBe(e,t,o,i)}function YVt(e,t,n,i){let r=AW(e,t,n),o=r.entity,s=r.styleEntity,a=!1,c=t.childNodes;for(let u=0,f=c.length;u<f&&!a;u++){let d=c.item(u),p=ZBe[d.localName];l(p)&&(p(e,n.entityCollection,d,o,s,o.id),a=!0)}a||(o.merge(s),yW(e,o,s))}var XVt={FlyTo:JVt,Wait:$Vt,SoundCue:kse,AnimatedUpdate:kse,TourControl:kse};function KVt(e,t,n,i){let r=Fn(t,"name",Ve.kml),o=Oa(t,"id"),s=new C4(r,o),a=cr(t,"Playlist",Ve.gx);if(a){let c=e._ellipsoid,u=a.childNodes;for(let f=0;f<u.length;f++){let d=u[f];if(d.localName){let p=XVt[d.localName];p?p(s,d,c):console.log(`Unknown KML Tour playlist entry type ${d.localName}`)}}}e._kmlTours.push(s)}function kse(e,t){_t(`KML Tour unsupported node ${t.localName}`)}function $Vt(e,t){let n=Si(t,"duration",Ve.gx);e.addPlaylistEntry(new S4(n))}function JVt(e,t,n){let i=Si(t,"duration",Ve.gx),r=Fn(t,"flyToMode",Ve.gx),o={kml:{}};t2e(t,o,n),e2e(t,o,n);let s=o.kml.lookAt||o.kml.camera,a=new v4(i,r,s);e.addPlaylistEntry(a)}function e2e(e,t,n){let i=cr(e,"Camera",Ve.kml);if(l(i)){let r=Si(i,"longitude",Ve.kml)??0,o=Si(i,"latitude",Ve.kml)??0,s=Si(i,"altitude",Ve.kml)??0,a=Si(i,"heading",Ve.kml)??0,c=Si(i,"tilt",Ve.kml)??0,u=Si(i,"roll",Ve.kml)??0,f=h.fromDegrees(r,o,s,n),d=wc.fromDegrees(a,c-90,u);t.kml.camera=new T4(f,d)}}function t2e(e,t,n){let i=cr(e,"LookAt",Ve.kml);if(l(i)){let r=Si(i,"longitude",Ve.kml)??0,o=Si(i,"latitude",Ve.kml)??0,s=Si(i,"altitude",Ve.kml)??0,a=Si(i,"heading",Ve.kml),c=Si(i,"tilt",Ve.kml),u=Si(i,"range",Ve.kml)??0;c=D.toRadians(c??0),a=D.toRadians(a??0);let f=new Od(a,c-D.PI_OVER_TWO,u),d=h.fromDegrees(r,o,s,n);t.kml.lookAt=new E4(d,f)}}function ZVt(e,t,n,i){let r=n.screenOverlayContainer;if(!l(r))return;let o=n.sourceResource,s=n.uriResolver,a=cr(t,"Icon",Ve.kml),c=$se(a,e,o,s,!1);if(!l(c))return;let u=document.createElement("img");e._screenOverlays.push(u),u.src=c.url,u.onload=function(){let f=["position: absolute"],d=cr(t,"screenXY",Ve.kml),p=cr(t,"overlayXY",Ve.kml),g=cr(t,"size",Ve.kml),m,y,A,b,x,T;l(g)&&(m=Fb(g,"x"),y=Fb(g,"y"),A=Oa(g,"xunits"),b=Oa(g,"yunits"),l(m)&&m!==-1&&m!==0&&(A==="fraction"?x=`width: ${Math.floor(m*100)}%`:A==="pixels"&&(x=`width: ${m}px`),f.push(x)),l(y)&&y!==-1&&y!==0&&(b==="fraction"?T=`height: ${Math.floor(y*100)}%`:b==="pixels"&&(T=`height: ${y}px`),f.push(T))),u.style=f.join(";");let E=0,v=u.height;l(p)&&(m=Fb(p,"x"),y=Fb(p,"y"),A=Oa(p,"xunits"),b=Oa(p,"yunits"),l(m)&&(A==="fraction"?E=m*u.width:(A==="pixels"||A==="insetPixels")&&(E=m)),l(y)&&(b==="fraction"?v=y*u.height:(b==="pixels"||b==="insetPixels")&&(v=y))),l(d)&&(m=Fb(d,"x"),y=Fb(d,"y"),A=Oa(d,"xunits"),b=Oa(d,"yunits"),l(m)&&(A==="fraction"?x=`left: calc(${Math.floor(m*100)}% - ${E}px)`:A==="pixels"?x=`left: ${m-E}px`:A==="insetPixels"&&(x=`right: ${m-E}px`),f.push(x)),l(y)&&(b==="fraction"?T=`bottom: calc(${Math.floor(y*100)}% - ${v}px)`:b==="pixels"?T=`bottom: ${y-v}px`:b==="insetPixels"&&(T=`top: ${y-v}px`),f.push(T))),u.style=f.join(";")},r.appendChild(u)}function QVt(e,t,n,i){let o=AW(e,t,n).entity,s,a=!1,c=e._ellipsoid,u=mW(cr(t,"LatLonQuad",Ve.gx),c),f=Si(t,"drawOrder",Ve.kml);if(l(u))s=Kse(),s.hierarchy=new Mc(u),s.zIndex=f,o.polygon=s,a=!0;else{s=new om,s.zIndex=f,o.rectangle=s;let m=cr(t,"LatLonBox",Ve.kml);if(l(m)){let y=Si(m,"west",Ve.kml),A=Si(m,"south",Ve.kml),b=Si(m,"east",Ve.kml),x=Si(m,"north",Ve.kml);l(y)&&(y=D.negativePiToPi(D.toRadians(y))),l(A)&&(A=D.clampToLatitudeRange(D.toRadians(A))),l(b)&&(b=D.negativePiToPi(D.toRadians(b))),l(x)&&(x=D.clampToLatitudeRange(D.toRadians(x))),s.coordinates=new ie(y,A,b,x);let T=Si(m,"rotation",Ve.kml);if(l(T)){let E=D.toRadians(T);s.rotation=E,s.stRotation=E}}}let d=cr(t,"Icon",Ve.kml),p=$se(d,e,n.sourceResource,n.uriResolver,!0);if(l(p)){a&&_t("kml-gx:LatLonQuad","KML - gx:LatLonQuad Icon does not support texture projection.");let m=Si(d,"x",Ve.gx),y=Si(d,"y",Ve.gx),A=Si(d,"w",Ve.gx),b=Si(d,"h",Ve.gx);(l(m)||l(y)||l(A)||l(b))&&_t("kml-groundOverlay-xywh","KML - gx:x, gx:y, gx:w, gx:h aren't supported for GroundOverlays"),s.material=p,s.material.color=MC(t,"color",Ve.kml),s.material.transparent=!0}else s.material=MC(t,"color",Ve.kml);let g=Fn(t,"altitudeMode",Ve.kml);l(g)?g==="absolute"?(s.height=Si(t,"altitude",Ve.kml),s.zIndex=void 0):g!=="clampToGround"&&_t("kml-altitudeMode-unknown",`KML - Unknown altitudeMode: ${g}`):(g=Fn(t,"altitudeMode",Ve.gx),g==="relativeToSeaFloor"?(_t("kml-altitudeMode-relativeToSeaFloor","KML - altitudeMode relativeToSeaFloor is currently not supported, treating as absolute."),s.height=Si(t,"altitude",Ve.kml),s.zIndex=void 0):g==="clampToSeaFloor"?_t("kml-altitudeMode-clampToSeaFloor","KML - altitudeMode clampToSeaFloor is currently not supported, treating as clampToGround."):l(g)&&_t("kml-altitudeMode-unknown",`KML - Unknown altitudeMode: ${g}`))}function n2e(e,t,n,i){e._unsupportedNode.raiseEvent(e,n.parentEntity,t,n.entityCollection,n.styleCollection,n.sourceResource,n.uriResolver),_t(`kml-unsupportedFeature-${t.nodeName}`,`KML - Unsupported feature: ${t.nodeName}`)}var Bb={INTERVAL:0,EXPIRE:1,STOP:2};function gW(e){if(!l(e)||e.length===0)return"";let t=e[0];return(t==="&"||t==="?")&&(e=e.substring(1)),e}var e4t=new ie,RP=new he,Use=new U,t4t=new h;function Zse(e,t,n,i,r,o){function s(u){return u<-D.PI_OVER_TWO?-D.PI_OVER_TWO:u>D.PI_OVER_TWO?D.PI_OVER_TWO:u}function a(u){return u>D.PI?u-D.TWO_PI:u<-D.PI?u+D.TWO_PI:u}let c=rx(e.queryParameters);if(c=c.replace(/%5B/g,"[").replace(/%5D/g,"]"),l(t)&&t._mode!==re.MORPHING){let u,f;if(r=r??e4t,l(n)&&(Use.x=n.clientWidth*.5,Use.y=n.clientHeight*.5,u=t.pickEllipsoid(Use,o,t4t)),l(u)?f=o.cartesianToCartographic(u,RP):(f=ie.center(r,RP),u=o.cartographicToCartesian(f)),l(i)&&!D.equalsEpsilon(i,1,D.EPSILON9)){let b=r.width*i*.5,x=r.height*i*.5;r=new ie(a(f.longitude-b),s(f.latitude-x),a(f.longitude+b),s(f.latitude+x))}c=c.replace("[bboxWest]",D.toDegrees(r.west).toString()),c=c.replace("[bboxSouth]",D.toDegrees(r.south).toString()),c=c.replace("[bboxEast]",D.toDegrees(r.east).toString()),c=c.replace("[bboxNorth]",D.toDegrees(r.north).toString());let d=D.toDegrees(f.longitude).toString(),p=D.toDegrees(f.latitude).toString();c=c.replace("[lookatLon]",d),c=c.replace("[lookatLat]",p),c=c.replace("[lookatTilt]",D.toDegrees(t.pitch).toString()),c=c.replace("[lookatHeading]",D.toDegrees(t.heading).toString()),c=c.replace("[lookatRange]",h.distance(t.positionWC,u)),c=c.replace("[lookatTerrainLon]",d),c=c.replace("[lookatTerrainLat]",p),c=c.replace("[lookatTerrainAlt]",f.height.toString()),o.cartesianToCartographic(t.positionWC,RP),c=c.replace("[cameraLon]",D.toDegrees(RP.longitude).toString()),c=c.replace("[cameraLat]",D.toDegrees(RP.latitude).toString()),c=c.replace("[cameraAlt]",D.toDegrees(RP.height).toString());let g=t.frustum,m=g.aspectRatio,y="",A="";if(l(m)){let b=D.toDegrees(g.fov);m>1?(y=b,A=b/m):(A=b,y=b*m)}c=c.replace("[horizFov]",y.toString()),c=c.replace("[vertFov]",A.toString())}else c=c.replace("[bboxWest]","-180"),c=c.replace("[bboxSouth]","-90"),c=c.replace("[bboxEast]","180"),c=c.replace("[bboxNorth]","90"),c=c.replace("[lookatLon]",""),c=c.replace("[lookatLat]",""),c=c.replace("[lookatRange]",""),c=c.replace("[lookatTilt]",""),c=c.replace("[lookatHeading]",""),c=c.replace("[lookatTerrainLon]",""),c=c.replace("[lookatTerrainLat]",""),c=c.replace("[lookatTerrainAlt]",""),c=c.replace("[cameraLon]",""),c=c.replace("[cameraLat]",""),c=c.replace("[cameraAlt]",""),c=c.replace("[horizFov]",""),c=c.replace("[vertFov]","");l(n)?(c=c.replace("[horizPixels]",n.clientWidth),c=c.replace("[vertPixels]",n.clientHeight)):(c=c.replace("[horizPixels]",""),c=c.replace("[vertPixels]","")),c=c.replace("[terrainEnabled]","1"),c=c.replace("[clientVersion]","1"),c=c.replace("[kmlVersion]","2.2"),c=c.replace("[clientName]","Cesium"),c=c.replace("[language]","English"),e.setQueryParameters(Ef(c))}function n4t(e,t,n,i){let o=AW(e,t,n).entity,s=n.sourceResource,a=n.uriResolver,c=cr(t,"Link",Ve.kml);if(l(c)||(c=cr(t,"Url",Ve.kml)),l(c)){let u=Fn(c,"href",Ve.kml),f,d;if(l(u)){let p=u;if(u=Xse(u,s,n.uriResolver),/^data:/.test(u.getUrlComponent()))/\.kmz/i.test(s.getUrlComponent())||(p=s.getDerivedResource({url:p}));else{if(p=u.clone(),f=Fn(c,"viewRefreshMode",Ve.kml),f==="onRegion"){_t("kml-refrehMode-onRegion","KML - Unsupported viewRefreshMode: onRegion");return}d=Fn(c,"viewBoundScale",Ve.kml)??1;let A=f==="onStop"?"BBOX=[bboxWest],[bboxSouth],[bboxEast],[bboxNorth]":"",b=Fn(c,"viewFormat",Ve.kml)??A,x=Fn(c,"httpQuery",Ve.kml);l(b)&&u.setQueryParameters(Ef(gW(b))),l(x)&&u.setQueryParameters(Ef(gW(x)));let T=e._ellipsoid;Zse(u,e.camera,e.canvas,d,e._lastCameraView.bbox,T)}let g={sourceUri:p,uriResolver:a,context:o.id,screenOverlayContainer:n.screenOverlayContainer},m=new Ua,y=Gse(e,m,u,g).then(function(A){let b=e._entityCollection,x=m.values;b.suspendEvents();for(let v=0;v<x.length;v++){let S=x[v];l(S.parent)||(S.parent=o,Qse(S)),b.add(S)}b.resumeEvents();let T=Fn(c,"refreshMode",Ve.kml),E=Si(c,"refreshInterval",Ve.kml)??0;if(T==="onInterval"&&E>0||T==="onExpire"||f==="onStop"){let v=cr(A,"NetworkLinkControl",Ve.kml),S=l(v),I=K.now(),R={id:Kn(),href:u,cookie:{},lastUpdated:I,updating:!1,entity:o,viewBoundScale:d,needsUpdate:!1,cameraUpdateTime:I},O=0;if(S&&(R.cookie=Ef(Fn(v,"cookie",Ve.kml)??""),O=Si(v,"minRefreshPeriod",Ve.kml)??0),T==="onInterval")S&&(E=Math.max(O,E)),R.refreshMode=Bb.INTERVAL,R.time=E;else if(T==="onExpire"){let L;if(S&&(L=Fn(v,"expires",Ve.kml)),l(L))try{let _=K.fromIso8601(L),C=K.secondsDifference(_,I);C>0&&C<O&&K.addSeconds(I,O,_),R.refreshMode=Bb.EXPIRE,R.time=_}catch{_t("kml-refreshMode-onInterval-onExpire","KML - NetworkLinkControl expires is not a valid date")}else _t("kml-refreshMode-onExpire","KML - refreshMode of onExpire requires the NetworkLinkControl to have an expires element")}else l(e.camera)?(R.refreshMode=Bb.STOP,R.time=Si(c,"viewRefreshTime",Ve.kml)??0):_t("kml-refrehMode-onStop-noCamera","A NetworkLink with viewRefreshMode=onStop requires the `camera` property to be defined.");l(R.refreshMode)&&e._networkLinks.set(R.id,R)}}).catch(function(A){_t(`An error occured during loading ${u.url}`),e._error.raiseEvent(e,A)});i.addPromise(y)}}}function i4t(e,t,n,i){let r=Yse[t.localName];return l(r)?r(e,t,n,i):n2e(e,t,n,i)}function Hse(e,t,n,i,r,o,s){t.removeAll();let a=n.documentElement,c=a.localName==="Document"?a:cr(a,"Document",Ve.kml),u=Fn(c,"name",Ve.kml);l(u)||(u=$_(i.getUrlComponent())),l(e._name)||(e._name=u);let f=new hy._DeferredLoading(e),d=new Ua(e);return Promise.all(KBe(e,n,d,i,!1,r)).then(function(){let p=n.documentElement;if(p.localName==="kml"){let m=p.childNodes;for(let y=0;y<m.length;y++){let A=m[y];if(l(Yse[A.localName])){p=A;break}}}let g={parentEntity:void 0,entityCollection:t,styleCollection:d,sourceResource:i,uriResolver:r,context:s,screenOverlayContainer:o};return t.suspendEvents(),i4t(e,p,g,f),t.resumeEvents(),f.wait().then(function(){return n.documentElement})})}async function r4t(e,t,n,i,r){let o=Zt("ThirdParty/Workers/zip-web-worker.js"),s=Zt("ThirdParty/zip-module.wasm");OV({workerURI:o,wasmURI:s});let a=new bC(new uf(n)),c=await a.getEntries(),u=[],f={},d;for(let p=0;p<c.length;p++){let g=c[p];g.directory||(/\.kml$/i.test(g.filename)&&(!l(d)||!/\//i.test(g.filename))?(l(d)&&u.push(Bse(d,f)),d=g):u.push(Bse(g,f)))}if(l(d)&&u.push(DVt(d,f)),await Promise.all(u),a.close(),!l(f.kml))throw new oe("KMZ file does not contain a KML document.");return f.keys=Object.keys(f),Hse(e,t,f.kml,i,f,r)}function Gse(e,t,n,i){i=i??H.EMPTY_OBJECT;let r=i.sourceUri,o=i.uriResolver,s=i.context,a=i.screenOverlayContainer,c=n;if(typeof n=="string"||n instanceof De){n=De.createIfNeeded(n),c=n.fetchBlob(),r=r??n.clone();let u=e._resourceCredits,f=n.credits;if(l(f)){let d=f.length;for(let p=0;p<d;p++)u.push(f[p])}}else r=r??De.DEFAULT.clone();return r=De.createIfNeeded(r),l(a)&&(a=Ln(a)),Promise.resolve(c).then(function(u){return u instanceof Blob?IVt(u).then(function(f){return f?r4t(e,t,u,r,a):PVt(u).then(function(d){d=GBe(d),d=WBe(d);let p,g;try{p=qse.parseFromString(d,"application/xml")}catch(m){g=m.toString()}if(l(g)||p.body||p.documentElement.tagName==="parsererror"){let m=l(g)?g:p.documentElement.firstChild.nodeValue;throw m||(m=p.body.innerText),new oe(m)}return Hse(e,t,p,r,o,a,s)})}):Hse(e,t,u,r,o,a,s)}).catch(function(u){return e._error.raiseEvent(e,u),console.log(u),Promise.reject(u)})}var hy=class e{constructor(t){t=t??H.EMPTY_OBJECT;let n=t.camera,i=t.canvas;this._changed=new be,this._error=new be,this._loading=new be,this._refresh=new be,this._unsupportedNode=new be,this._clock=void 0,this._entityCollection=new Ua(this),this._name=void 0,this._isLoading=!1,this._pinBuilder=new uy,this._networkLinks=new Ut,this._entityCluster=new Of,this.canvas=i,this.camera=n,this._lastCameraView={position:l(n)?h.clone(n.positionWC):void 0,direction:l(n)?h.clone(n.directionWC):void 0,up:l(n)?h.clone(n.upWC):void 0,bbox:l(n)?n.computeViewRectangle():ie.clone(ie.MAX_VALUE)},this._ellipsoid=t.ellipsoid??ee.default;let r=t.credit;typeof r=="string"&&(r=new It(r)),this._credit=r,this._resourceCredits=[],this._kmlTours=[],this._screenOverlays=[]}static load(t,n){return n=n??H.EMPTY_OBJECT,new e(n).load(t,n)}get name(){return this._name}set name(t){this._name!==t&&(this._name=t,this._changed.raiseEvent(this))}get clock(){return this._clock}get entities(){return this._entityCollection}get isLoading(){return this._isLoading}get changedEvent(){return this._changed}get errorEvent(){return this._error}get loadingEvent(){return this._loading}get refreshEvent(){return this._refresh}get unsupportedNodeEvent(){return this._unsupportedNode}get show(){return this._entityCollection.show}set show(t){this._entityCollection.show=t}get clustering(){return this._entityCluster}set clustering(t){this._entityCluster=t}get credit(){return this._credit}get kmlTours(){return this._kmlTours}load(t,n){n=n??H.EMPTY_OBJECT,xs.setLoading(this,!0);let i=this._name;this._name=void 0,this._clampToGround=n.clampToGround??!1;let r=this;return Gse(this,this._entityCollection,t,n).then(function(){let o,s=r._entityCollection.computeAvailability(),a=s.start,c=s.stop,u=K.equals(a,nt.MINIMUM_VALUE),f=K.equals(c,nt.MAXIMUM_VALUE);if(!u||!f){let p;u&&(p=new Date,p.setHours(0,0,0,0),a=K.fromDate(p)),f&&(p=new Date,p.setHours(24,0,0,0),c=K.fromDate(p)),o=new Zm,o.startTime=a,o.stopTime=c,o.currentTime=K.clone(a),o.clockRange=As.LOOP_STOP,o.clockStep=zr.SYSTEM_CLOCK_MULTIPLIER,o.multiplier=Math.round(Math.min(Math.max(K.secondsDifference(c,a)/60,1),31556900))}let d=!1;return o!==r._clock&&(r._clock=o,d=!0),i!==r._name&&(d=!0),d&&r._changed.raiseEvent(r),xs.setLoading(r,!1),r}).catch(function(o){return xs.setLoading(r,!1),r._error.raiseEvent(r,o),console.log(o),Promise.reject(o)})}destroy(){for(;this._screenOverlays.length>0;)this._screenOverlays.pop().remove()}update(t){let n=this._networkLinks;if(n.length===0)return!0;let i=K.now(),r=this;zse.removeAll();function o(d){let p=d._children,g=p.length;for(let m=0;m<g;++m){let y=p[m];zse.set(y.id,y),o(y)}}let s=!1,a=this._lastCameraView,c=this.camera;l(c)&&!(c.positionWC.equalsEpsilon(a.position,D.EPSILON7)&&c.directionWC.equalsEpsilon(a.direction,D.EPSILON7)&&c.upWC.equalsEpsilon(a.up,D.EPSILON7))&&(a.position=h.clone(c.positionWC),a.direction=h.clone(c.directionWC),a.up=h.clone(c.upWC),a.bbox=c.computeViewRectangle(),s=!0);let u=new Ut,f=!1;return n.values.forEach(function(d){let p=d.entity;if(!zse.contains(p.id)){if(!d.updating){let g=!1;if(d.refreshMode===Bb.INTERVAL?K.secondsDifference(i,d.lastUpdated)>d.time&&(g=!0):d.refreshMode===Bb.EXPIRE?K.greaterThan(i,d.time)&&(g=!0):d.refreshMode===Bb.STOP&&(s&&(d.needsUpdate=!0,d.cameraUpdateTime=i),d.needsUpdate&&K.secondsDifference(i,d.cameraUpdateTime)>=d.time&&(g=!0)),g){o(p),d.updating=!0;let m=new Ua,y=d.href.clone();y.setQueryParameters(d.cookie);let A=r._ellipsoid??ee.default;Zse(y,r.camera,r.canvas,d.viewBoundScale,a.bbox,A),Gse(r,m,y,{context:p.id}).then(o4t(r,d,m,u,y)).catch(function(b){let x=`NetworkLink ${d.href} refresh failed: ${b}`;console.log(x),r._error.raiseEvent(r,x)}),f=!0}}u.set(d.id,d)}}),f&&(this._networkLinks=u,this._changed.raiseEvent(this)),!0}};function Qse(e){let t=e.parent;if(l(t)){let n=t.availability;if(l(n)){let i=e.availability;l(i)?i.intersect(n):e.availability=n}}}function o4t(e,t,n,i,r){return function(o){if(!i.contains(t.id))return;let s=!1,a=cr(o,"NetworkLinkControl",Ve.kml),c=l(a),u=0;if(c){if(l(cr(a,"Update",Ve.kml))){_t("kml-networkLinkControl-update","KML - NetworkLinkControl updates aren't supported."),t.updating=!1,i.remove(t.id);return}t.cookie=Ef(Fn(a,"cookie",Ve.kml)??""),u=Si(a,"minRefreshPeriod",Ve.kml)??0}let f=K.now(),d=t.refreshMode;if(d===Bb.INTERVAL)l(a)&&(t.time=Math.max(u,t.time));else if(d===Bb.EXPIRE){let I;if(l(a)&&(I=Fn(a,"expires",Ve.kml)),l(I))try{let R=K.fromIso8601(I),O=K.secondsDifference(R,f);O>0&&O<u&&K.addSeconds(f,u,R),t.time=R}catch{_t("kml-networkLinkControl-expires","KML - NetworkLinkControl expires is not a valid date"),s=!0}else _t("kml-refreshMode-onExpire","KML - refreshMode of onExpire requires the NetworkLinkControl to have an expires element"),s=!0}let p=t.entity,g=e._entityCollection,m=n.values;function y(I){g.remove(I);let R=I._children,O=R.length;for(let L=0;L<O;++L)y(R[L])}g.suspendEvents();let A=g.values.slice(),b;for(b=0;b<A.length;++b){let I=A[b];I.parent===p&&(I.parent=void 0,y(I))}for(g.resumeEvents(),g.suspendEvents(),b=0;b<m.length;b++){let I=m[b];l(I.parent)||(I.parent=p,Qse(I)),g.add(I)}g.resumeEvents(),s?i.remove(t.id):t.lastUpdated=f;let x=g.computeAvailability(),T=x.start,E=x.stop,v=K.equals(T,nt.MINIMUM_VALUE),S=K.equals(E,nt.MAXIMUM_VALUE);if(!v||!S){let I=e._clock;(I.startTime!==T||I.stopTime!==E)&&(I.startTime=T,I.stopTime=E,e._changed.raiseEvent(e))}t.updating=!1,t.needsUpdate=!1,e._refresh.raiseEvent(e,r.getUrlComponent(!0))}}var zse=new Ut,Wse=class{constructor(){this.author={name:void 0,uri:void 0,email:void 0},this.link={href:void 0,hreflang:void 0,rel:void 0,type:void 0,title:void 0,length:void 0},this.address=void 0,this.phoneNumber=void 0,this.snippet=void 0,this.extendedData=void 0}};hy._DeferredLoading=Vse;hy._getTimestamp=xn;var NC=hy;function P4(){pe.throwInstantiationError()}P4.prototype.update=pe.throwInstantiationError;P4.prototype.getBoundingSphere=pe.throwInstantiationError;P4.prototype.isDestroyed=pe.throwInstantiationError;P4.prototype.destroy=pe.throwInstantiationError;var eae=P4;var D4=`in vec3 v_positionMC; in vec3 v_positionEC; in vec2 v_st; void main() @@ -12702,7 +12674,7 @@ out_FragColor = vec4(material.diffuse + material.emission, material.alpha); out_FragColor = czm_phong(normalize(positionToEyeEC), material, czm_lightDirectionEC); #endif } -`;var e8=`in vec3 position3DHigh; +`;var R4=`in vec3 position3DHigh; in vec3 position3DLow; in vec2 st; in float batchId; @@ -12717,7 +12689,7 @@ v_positionEC = (czm_modelViewRelativeToEye * p).xyz; v_st = st; gl_Position = czm_modelViewProjectionRelativeToEye * p; } -`;function qC(e){e=e??H.EMPTY_OBJECT;let t=e.translucent??!0,n=e.aboveGround??!1;this.material=l(e.material)?e.material:Qi.fromType(Qi.ColorType),this.translucent=e.translucent??!0,this._vertexShaderSource=e.vertexShaderSource??e8,this._fragmentShaderSource=e.fragmentShaderSource??Q4,this._renderState=wr.getDefaultRenderState(t,!n,e.renderState),this._closed=!1,this._flat=e.flat??!1,this._faceForward=e.faceForward??n,this._aboveGround=n}Object.defineProperties(qC.prototype,{vertexShaderSource:{get:function(){return this._vertexShaderSource}},fragmentShaderSource:{get:function(){return this._fragmentShaderSource}},renderState:{get:function(){return this._renderState}},closed:{get:function(){return this._closed}},vertexFormat:{get:function(){return qC.VERTEX_FORMAT}},flat:{get:function(){return this._flat}},faceForward:{get:function(){return this._faceForward}},aboveGround:{get:function(){return this._aboveGround}}});qC.VERTEX_FORMAT=Be.POSITION_AND_ST;qC.prototype.getFragmentShaderSource=wr.prototype.getFragmentShaderSource;qC.prototype.isTranslucent=wr.prototype.isTranslucent;qC.prototype.getRenderState=wr.prototype.getRenderState;var Pce=qC;var gHt=1e5;function t8(e){e=e??H.EMPTY_OBJECT;let t=e.credit;typeof t=="string"&&(t=new It(t)),this._credit=t,this._radius=l(e.radius)?e.radius:gHt,this._image=e.image,this._transform=l(e.transform)?e.transform:N.IDENTITY,this._repeatHorizontal=l(e.repeatHorizontal)?e.repeatHorizontal:1,this._repeatVertical=l(e.repeatVertical)?e.repeatVertical:1;let n=new V4({radius:this._radius,vertexFormat:Be.ALL}),i=new Ft({geometry:n,modelMatrix:this._transform}),r=new Qi({fabric:{type:"Image",uniforms:{image:this._image,repeat:new U(-this._repeatHorizontal,this._repeatVertical)}}});return this._primitive=new On({geometryInstances:i,appearance:new Er({material:r,closed:!0,faceForward:!1,flat:!0,translucent:!1,renderState:{cull:{enabled:!1}}}),credit:this._credit}),this}Object.defineProperties(t8.prototype,{radius:{get:function(){return this._radius}},image:{get:function(){return this._image}},transform:{get:function(){return this._transform}},credit:{get:function(){return l(this._credit)?this._credit:void 0}},show:{get:function(){return l(this._primitive)?this._primitive.show:void 0},set:function(e){l(this._primitive)&&(this._primitive.show=e)}}});t8.prototype.update=function(e){return l(this._credit)&&e.creditDisplay.addCreditToNextFrame(this._credit),this._primitive.update(e)};t8.prototype.destroy=function(){return this._primitive=this._primitive&&this._primitive.destroy(),le(this)};t8.prototype.isDestroyed=function(){return this._primitive.isDestroyed()};var Dce=t8;function _f(e){this._scene=e.scene,this.samplingWindow=e.samplingWindow??_f.defaultSettings.samplingWindow,this.quietPeriod=e.quietPeriod??_f.defaultSettings.quietPeriod,this.warmupPeriod=e.warmupPeriod??_f.defaultSettings.warmupPeriod,this.minimumFrameRateDuringWarmup=e.minimumFrameRateDuringWarmup??_f.defaultSettings.minimumFrameRateDuringWarmup,this.minimumFrameRateAfterWarmup=e.minimumFrameRateAfterWarmup??_f.defaultSettings.minimumFrameRateAfterWarmup,this._lowFrameRate=new be,this._nominalFrameRate=new be,this._frameTimes=[],this._needsQuietPeriod=!0,this._quietPeriodEndTime=0,this._warmupPeriodEndTime=0,this._frameRateIsLow=!1,this._lastFramesPerSecond=void 0,this._pauseCount=0;let t=this;this._preUpdateRemoveListener=this._scene.preUpdate.addEventListener(function(r,o){_Ht(t,o)}),this._hiddenPropertyName=document.hidden!==void 0?"hidden":document.mozHidden!==void 0?"mozHidden":document.msHidden!==void 0?"msHidden":document.webkitHidden!==void 0?"webkitHidden":void 0;let n=document.hidden!==void 0?"visibilitychange":document.mozHidden!==void 0?"mozvisibilitychange":document.msHidden!==void 0?"msvisibilitychange":document.webkitHidden!==void 0?"webkitvisibilitychange":void 0;function i(){yHt(t)}this._visibilityChangeRemoveListener=void 0,l(n)&&(document.addEventListener(n,i,!1),this._visibilityChangeRemoveListener=function(){document.removeEventListener(n,i,!1)})}_f.defaultSettings={samplingWindow:5,quietPeriod:2,warmupPeriod:5,minimumFrameRateDuringWarmup:4,minimumFrameRateAfterWarmup:8};_f.fromScene=function(e){return(!l(e._frameRateMonitor)||e._frameRateMonitor.isDestroyed())&&(e._frameRateMonitor=new _f({scene:e})),e._frameRateMonitor};Object.defineProperties(_f.prototype,{scene:{get:function(){return this._scene}},lowFrameRate:{get:function(){return this._lowFrameRate}},nominalFrameRate:{get:function(){return this._nominalFrameRate}},lastFramesPerSecond:{get:function(){return this._lastFramesPerSecond}}});_f.prototype.pause=function(){++this._pauseCount,this._pauseCount===1&&(this._frameTimes.length=0,this._lastFramesPerSecond=void 0)};_f.prototype.unpause=function(){--this._pauseCount,this._pauseCount<=0&&(this._pauseCount=0,this._needsQuietPeriod=!0)};_f.prototype.isDestroyed=function(){return!1};_f.prototype.destroy=function(){return this._preUpdateRemoveListener(),l(this._visibilityChangeRemoveListener)&&this._visibilityChangeRemoveListener(),le(this)};function _Ht(e,t){if(e._pauseCount>0)return;let n=xn();if(e._needsQuietPeriod)e._needsQuietPeriod=!1,e._frameTimes.length=0,e._quietPeriodEndTime=n+e.quietPeriod/kn.SECONDS_PER_MILLISECOND,e._warmupPeriodEndTime=e._quietPeriodEndTime+(e.warmupPeriod+e.samplingWindow)/kn.SECONDS_PER_MILLISECOND;else if(n>=e._quietPeriodEndTime){e._frameTimes.push(n);let i=n-e.samplingWindow/kn.SECONDS_PER_MILLISECOND;if(e._frameTimes.length>=2&&e._frameTimes[0]<=i){for(;e._frameTimes.length>=2&&e._frameTimes[1]<i;)e._frameTimes.shift();let r=(n-e._frameTimes[0])/(e._frameTimes.length-1);e._lastFramesPerSecond=1e3/r;let o=1e3/(n>e._warmupPeriodEndTime?e.minimumFrameRateAfterWarmup:e.minimumFrameRateDuringWarmup);r>o?e._frameRateIsLow||(e._frameRateIsLow=!0,e._needsQuietPeriod=!0,e.lowFrameRate.raiseEvent(e.scene,e._lastFramesPerSecond)):e._frameRateIsLow&&(e._frameRateIsLow=!1,e._needsQuietPeriod=!0,e.nominalFrameRate.raiseEvent(e.scene,e._lastFramesPerSecond))}}}function yHt(e){document[e._hiddenPropertyName]?e.pause():e.unpause()}var n8=_f;var Oce=class e{constructor(t){t=t??H.EMPTY_OBJECT;let n=AHt(t.geoJson),i=t.allowPicking??!0,r=t.ellipsoid??ee.default,o=new Float64Array(0);function s(g){return o.length<g&&(o=new Float64Array(g)),o}this.show=t.show??!0,this._url=t.url,this._ids=n.ids,this._properties=n.properties,this._featureCount=n.ids.length,this._pickObjectFactory=t.pickObjectFactory,this._points=void 0,this._polylines=void 0,this._polygons=void 0,this._heightReference=t.heightReference??We.NONE,this._scene=t.scene;let a=this._heightReference,c=this._scene;n.pointCount>0&&(this._points=new $u({primitiveCountMax:n.pointCount,allowPicking:i})),n.polylineCount>0&&(this._polylines=new ml({primitiveCountMax:n.polylineCount,vertexCountMax:n.polylineVertexCount,allowPicking:i,heightReference:a})),n.polygonCount>0&&(this._polygons=new za({primitiveCountMax:n.polygonCount,vertexCountMax:n.polygonVertexCount,holeCountMax:n.polygonHoleCount,triangleCountMax:n.polygonTriangleCount,allowPicking:i,heightReference:a}));let u=new h,f=0,d=0,p=0;for(let g=0;g<n.features.length;g++){let m=n.features[g],y=m.featureId,A=this._properties[y];for(let b=0;b<m.points.length;b++){let x=f++;this._points.add({featureId:y,position:mke(m.points[b],r,u),pickObject:i?Rce(this,x,this._points,kc,A):void 0})}for(let b=0;b<m.polylines.length;b++){let x=d++;this._polylines.add({featureId:y,positions:lke(m.polylines[b],r,s),pickObject:i?Rce(this,x,this._polylines,Aa,A):void 0})}for(let b=0;b<m.polygons.length;b++){let x=m.polygons[b],T=p++;this._polygons.add({featureId:y,positions:lke(x.positions,r,s),holes:x.holes,triangles:x.triangles,pickObject:i?Rce(this,T,this._polygons,Mo,A):void 0})}}}get url(){let t=this._url;if(l(t))return t instanceof De?t.getUrlComponent(!0):t}get featureCount(){return this._featureCount}get ids(){return this._ids}get properties(){return this._properties}get points(){return this._points}get polylines(){return this._polylines}get polygons(){return this._polygons}static async fromUrl(t,n){let i=De.createIfNeeded(t),r=await i.fetchJson();if(!l(r))throw new oe(`Failed to load GeoJSON from ${i.getUrlComponent(!0)}.`);return e.fromGeoJson(r,{...n,url:i})}static fromGeoJson(t,n){return new e({...n,geoJson:t})}getId(t){return this._ids[t]}getProperties(t){return this._properties[t]}update(t){if(!this.show)return;let n=this._points,i=this._polylines,r=this._polygons,o=t.frameNumber,s=this._heightReference,a=As(s)?this._scene.vectorProvider:null;l(n)&&n.update(t),l(i)&&(l(a)?a.markForFrame(i,o,s):i.update(t)),l(r)&&(l(a)?a.markForFrame(r,o,s):r.update(t))}destroy(){let t=As(this._heightReference)?this._scene.vectorProvider:null;return this._points&&(this._points.destroy(),this._points=void 0),this._polylines&&(l(t)&&t.remove(this._polylines),this._polylines.destroy(),this._polylines=void 0),this._polygons&&(l(t)&&t.remove(this._polygons),this._polygons.destroy(),this._polygons=void 0),le(this)}isDestroyed(){return!1}};function Rce(e,t,n,i,r){return l(e._pickObjectFactory)?e._pickObjectFactory(t,n,r):{index:t,collection:n,get primitive(){return n.get(t,new i)},parentPrimitive:e,properties:r}}function AHt(e){let t=bHt(e),n=[],i=[],r=[],o=0,s=0,a=0,c=0,u=0,f=0,d=0;for(let p=0;p<t.length;p++){let g=t[p],m={points:[],polylines:[],polygons:[]};if(uke(g.geometry,m),m.points.length===0&&m.polylines.length===0&&m.polygons.length===0)continue;let y=i.length;i.push(g.id),r.push(RHt(g.properties)?g.properties:H.EMPTY_OBJECT);for(let A=0;A<m.polygons.length;A++){let b=m.polygons[A];f+=b.holes.length,d+=b.triangles.length/3,u+=b.positions.length}for(let A=0;A<m.polylines.length;A++)a+=m.polylines[A].length;o+=m.points.length,s+=m.polylines.length,c+=m.polygons.length,n.push({featureId:y,points:m.points,polylines:m.polylines,polygons:m.polygons})}return{features:n,ids:i,properties:r,pointCount:o,polylineCount:s,polylineVertexCount:a,polygonCount:c,polygonVertexCount:u,polygonHoleCount:f,polygonTriangleCount:d}}function bHt(e){if(!l(e)||!l(e.type))throw new oe("GeoJSON object must define 'type'.");switch(e.type){case"FeatureCollection":return e.features;case"Feature":return[e];default:if(PHt(e.type))return[{type:"Feature",geometry:e,properties:H.EMPTY_OBJECT,id:void 0}];throw new oe(`Unsupported GeoJSON type: ${e.type}`)}}function uke(e,t){if(!(!l(e)||!l(e.type)))switch(e.type){case"Point":fke(e.coordinates,t.points);return;case"MultiPoint":THt(e.coordinates,t.points);return;case"LineString":dke(e.coordinates,t.polylines);return;case"MultiLineString":EHt(e.coordinates,t.polylines);return;case"Polygon":hke(e.coordinates,t.polygons);return;case"MultiPolygon":CHt(e.coordinates,t.polygons);return;case"GeometryCollection":xHt(e.geometries,t);return;default:return}}function xHt(e,t){if(Array.isArray(e))for(let n=0;n<e.length;n++)uke(e[n],t)}function fke(e,t){let n=Mce(e);l(n)&&t.push(n)}function THt(e,t){for(let n=0;n<e.length;n++)fke(e[n],t)}function dke(e,t){let n=vHt(e);l(n)&&n.length>=2&&t.push(n)}function EHt(e,t){for(let n=0;n<e.length;n++)dke(e[n],t)}function hke(e,t){let n=SHt(e);l(n)&&t.push(n)}function CHt(e,t){for(let n=0;n<e.length;n++)hke(e[n],t)}function vHt(e){if(!Array.isArray(e))return;let t=[];for(let n=0;n<e.length;n++){let i=Mce(e[n]);l(i)&&t.push(i)}return t.length>=2?t:void 0}function SHt(e){if(!Array.isArray(e)||e.length===0)return;let t=[];for(let a=0;a<e.length;a++){let c=wHt(e[a]);l(c)&&t.push(c)}if(t.length===0||t[0].length<3)return;let i=[],r=[],o=[];for(let a=0;a<t.length;a++){let c=t[a];if(!(c.length<3)){a>0&&o.push(r.length);for(let u=0;u<c.length;u++){let f=c[u];r.push(f),i.push(new U(f[0],f[1]))}}}if(r.length<3)return;let s=fi.triangulate(i,o);if(!(!l(s)||s.length<3))return{positions:r,holes:new Uint32Array(o),triangles:new Uint32Array(s)}}function wHt(e){if(!Array.isArray(e))return;let t=[];for(let n=0;n<e.length;n++){let i=Mce(e[n]);l(i)&&t.push(i)}if(!(t.length<3))return t.length>1&&IHt(t[0],t[t.length-1])&&t.pop(),t.length>=3?t:void 0}function Mce(e){if(!Array.isArray(e)||e.length<2)return;let t=e[0],n=e[1],i=e[2]??0;if(!(!Number.isFinite(t)||!Number.isFinite(n)||!Number.isFinite(i)))return[t,n,i]}function IHt(e,t){return e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]}function PHt(e){return e==="Point"||e==="MultiPoint"||e==="LineString"||e==="MultiLineString"||e==="Polygon"||e==="MultiPolygon"||e==="GeometryCollection"}function mke(e,t,n){return h.fromDegrees(e[0],e[1],e[2]??0,t,n)}var DHt=new h;function lke(e,t,n){let i=e.length*3,r=n(i);for(let o=0;o<e.length;o++){let s=mke(e[o],t,DHt);r[o*3]=s.x,r[o*3+1]=s.y,r[o*3+2]=s.z}return r.subarray(0,i)}function RHt(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}var Nce=Oce;var pke=Qo(Sae(),1);function Lce(){this._image=new Image}Lce.prototype.isReady=function(){return!0};Lce.prototype.shouldDiscardImage=function(e){return e===this._image};function YC(e){e=e??H.EMPTY_OBJECT,this._defaultAlpha=void 0,this._defaultNightAlpha=void 0,this._defaultDayAlpha=void 0,this._defaultBrightness=void 0,this._defaultContrast=void 0,this._defaultHue=void 0,this._defaultSaturation=void 0,this._defaultGamma=void 0,this._defaultMinificationFilter=void 0,this._defaultMagnificationFilter=void 0,this._tileDiscardPolicy=e.tileDiscardPolicy,this._tilingScheme=new er({numberOfLevelZeroTilesX:2,numberOfLevelZeroTilesY:2,rectangle:new ie(-D.PI,-D.PI,D.PI,D.PI),ellipsoid:e.ellipsoid});let t=e.credit;typeof t=="string"&&(t=new It(t)),this._credit=t,this._tileWidth=256,this._tileHeight=256,this._maximumLevel=23,l(this._tileDiscardPolicy)||(this._tileDiscardPolicy=new Lce),this._errorEvent=new be}Object.defineProperties(YC.prototype,{url:{get:function(){return this._metadata.url}},proxy:{get:function(){return this._metadata.proxy}},tileWidth:{get:function(){return this._tileWidth}},tileHeight:{get:function(){return this._tileHeight}},maximumLevel:{get:function(){return this._maximumLevel}},minimumLevel:{get:function(){return 0}},tilingScheme:{get:function(){return this._tilingScheme}},rectangle:{get:function(){return this._tilingScheme.rectangle}},tileDiscardPolicy:{get:function(){return this._tileDiscardPolicy}},errorEvent:{get:function(){return this._errorEvent}},credit:{get:function(){return this._credit}},hasAlphaChannel:{get:function(){return!1}}});YC.fromMetadata=function(e,t){if(!e.imageryPresent)throw new oe(`The server ${e.url} doesn't have imagery`);let n=new YC(t);return n._metadata=e,n};YC.prototype.getTileCredits=function(e,t,n){let i=this._metadata,r=i.getTileInformation(e,t,n);if(l(r)){let o=i.providers[r.imageryProvider];if(l(o))return[o]}};YC.prototype.requestImage=function(e,t,n,i){let r=this._tileDiscardPolicy._image,o=this._metadata,s=_y.tileXYToQuadKey(e,t,n),a=o.getTileInformation(e,t,n);if(!l(a)){if(o.isValid(s)){let u=new wo({throttle:i.throttle,throttleByServer:i.throttleByServer,type:i.type,priorityFunction:i.priorityFunction});o.populateSubtree(e,t,n,u);return}return Promise.resolve(r)}if(!a.hasImagery())return Promise.resolve(r);let c=OHt(this,a,e,t,n,i).fetchArrayBuffer();if(l(c))return c.then(function(u){L4(o.key,u);let f=new Uint8Array(u),d,p=o.protoImagery;if((!l(p)||!p)&&(d=MHt(f)),!l(d)&&(!l(p)||p)){let g=NHt(f);d=g.imageType,f=g.imageData}return!l(d)||!l(f)?r:Bg({uint8Array:f,format:d,flipY:!0})})};YC.prototype.pickFeatures=function(e,t,n,i,r){};function OHt(e,t,n,i,r,o){let s=_y.tileXYToQuadKey(n,i,r),a=t.imageryVersion;return a=l(a)&&a>0?a:1,e._metadata.resource.getDerivedResource({url:`flatfile?f1-0${s}-i.${a.toString()}`,request:o})}function MHt(e){let t="JFIF";if(e[6]===t.charCodeAt(0)&&e[7]===t.charCodeAt(1)&&e[8]===t.charCodeAt(2)&&e[9]===t.charCodeAt(3))return"image/jpeg";let n="PNG";if(e[1]===n.charCodeAt(0)&&e[2]===n.charCodeAt(1)&&e[3]===n.charCodeAt(2))return"image/png"}function NHt(e){let t=pke.Reader.create(e),n=t.len,i={};for(;t.pos<n;){let s=t.uint32(),a;switch(s>>>3){case 1:i.imageType=t.uint32();break;case 2:i.imageData=t.bytes();break;case 3:i.alphaType=t.uint32();break;case 4:i.imageAlpha=t.bytes();break;case 5:if(a=i.copyrightIds,l(a)||(a=i.copyrightIds=[]),(s&7)===2){let c=t.uint32()+t.pos;for(;t.pos<c;)a.push(t.uint32())}else a.push(t.uint32());break;default:t.skipType(s&7);break}}let r=i.imageType;if(l(r))switch(r){case 0:i.imageType="image/jpeg";break;case 4:i.imageType="image/png";break;default:throw new oe("GoogleEarthEnterpriseImageryProvider: Unsupported image type.")}let o=i.alphaType;return l(o)&&o!==0&&(console.log("GoogleEarthEnterpriseImageryProvider: External alpha not supported."),delete i.alphaType,delete i.imageAlpha),i}var Fce=YC;var LHt=600;function $0(e){e=e??H.EMPTY_OBJECT,this._key=l(e.key)?e.key:Ta.defaultApiKey,this._baseResource=De.createIfNeeded(e.url??Ta.streetViewStaticApiEndpoint),this._metadataResource=this._baseResource.getDerivedResource({url:"streetview/metadata"}),this._tileSize=e.tileSize??LHt}Object.defineProperties($0.prototype,{});$0.prototype.loadPanorama=async function(e){let t=e.cartographic,n=e.tileSize??this._tileSize,i=`${n}x${n}`,r=e.signature,{panoId:o}=e;l(o)||(o=(await this.getNearestPanoId(t)).panoId);let s=Ta.getDefaultCredit(),a=h.fromDegrees(D.toDegrees(t.longitude),D.toDegrees(t.latitude),0),c=[this._loadFaceImage({heading:0,pitch:0,tileSizeString:i,panoId:o,signature:r}),this._loadFaceImage({heading:180,pitch:0,tileSizeString:i,panoId:o,signature:r}),this._loadFaceImage({heading:-90,pitch:-90,tileSizeString:i,panoId:o,signature:r}),this._loadFaceImage({heading:-90,pitch:90,tileSizeString:i,panoId:o,signature:r}),this._loadFaceImage({heading:270,pitch:0,tileSizeString:i,panoId:o,signature:r}),this._loadFaceImage({heading:90,pitch:0,tileSizeString:i,panoId:o,signature:r})],[u,f,d,p,g,m]=await Promise.all(c),y=At.localFrameToFixedFrameGenerator("north","down"),A=N.getMatrix3(y(a,ee.default),new $);return new DC({sources:{positiveX:u,negativeX:f,positiveY:d,negativeY:p,positiveZ:g,negativeZ:m},transform:A,credit:s})};$0.prototype.getNearestPanoId=async function(e,t){let i=[D.toDegrees(e.latitude),D.toDegrees(e.longitude)].join(","),o=await this._metadataResource.getDerivedResource({queryParameters:{key:this._key,location:i,radius:t??50}}).fetchJson();if(o.status!=="OK")throw new pe(`GoogleStreetViewCubeMapPanoramaProvider metadata error: ${o.status}`);return{panoId:o.pano_id,latitude:o.location.lat,longitude:o.location.lng}};$0.prototype.getPanoIdMetadata=async function(e){let n=await this._metadataResource.getDerivedResource({queryParameters:{key:this._key,pano:e}}).fetchJson();if(n.status!=="OK")throw new pe(`GoogleStreetViewCubeMapPanoramaProvider metadata error: ${n.status}`);return n};$0.prototype._loadFaceImage=async function(e){let t=this._buildFaceUrl(e);try{return await De.fetchImage({url:t,preferImageBitmap:!0,flipY:!0})}catch{throw new pe(`Failed to load Street View face image: ${t}`)}};$0.prototype._buildFaceUrl=function(e){let{heading:t,pitch:n,tileSizeString:i,panoId:r,signature:o}=e;return this._baseResource.getDerivedResource({queryParameters:{size:i,pano:r,heading:t,pitch:n,key:this._key,...l(o)&&{signature:o}}}).url};$0.fromUrl=async function(e){if(e=e??{},e.key=e.key??Ta.defaultStreetViewStaticApiKey??Ta.defaultApiKey,!l(e.key)&&!l(Ta.defaultStreetViewStaticApiKey)&&!l(Ta.defaultApiKey))throw new pe("options.key, GoogleMaps.defaultStreetViewStaticApiKey or GoogleMaps.defaultApiKey is required.");return new $0({...e})};$0._parseMetadata=function(e){return{cartographic:he.fromDegrees(e.location.lng,e.location.lat,0)}};var Bce=$0;var FHt=new z(1,1,1,.4),BHt=new z(0,1,0,.05),kHt=new z(0,.5,0,.2);function XC(e){e=e??H.EMPTY_OBJECT,this._defaultAlpha=void 0,this._defaultNightAlpha=void 0,this._defaultDayAlpha=void 0,this._defaultBrightness=void 0,this._defaultContrast=void 0,this._defaultHue=void 0,this._defaultSaturation=void 0,this._defaultGamma=void 0,this._defaultMinificationFilter=void 0,this._defaultMagnificationFilter=void 0,this._tilingScheme=l(e.tilingScheme)?e.tilingScheme:new er({ellipsoid:e.ellipsoid}),this._cells=e.cells??8,this._color=e.color??FHt,this._glowColor=e.glowColor??BHt,this._glowWidth=e.glowWidth??6,this._backgroundColor=e.backgroundColor??kHt,this._errorEvent=new be,this._tileWidth=e.tileWidth??256,this._tileHeight=e.tileHeight??256,this._canvasSize=e.canvasSize??256,this._canvas=this._createGridCanvas()}Object.defineProperties(XC.prototype,{proxy:{get:function(){}},tileWidth:{get:function(){return this._tileWidth}},tileHeight:{get:function(){return this._tileHeight}},maximumLevel:{get:function(){}},minimumLevel:{get:function(){}},tilingScheme:{get:function(){return this._tilingScheme}},rectangle:{get:function(){return this._tilingScheme.rectangle}},tileDiscardPolicy:{get:function(){}},errorEvent:{get:function(){return this._errorEvent}},credit:{get:function(){}},hasAlphaChannel:{get:function(){return!0}}});XC.prototype._drawGrid=function(e){let n=this._canvasSize;for(let i=0;i<=this._cells;++i){let o=1+i/this._cells*(n-1);e.moveTo(o,0),e.lineTo(o,n),e.moveTo(0,o),e.lineTo(n,o)}e.stroke()};XC.prototype._createGridCanvas=function(){let e=document.createElement("canvas");e.width=this._canvasSize,e.height=this._canvasSize;let t=0,n=this._canvasSize,i=e.getContext("2d"),r=this._backgroundColor.toCssColorString();i.fillStyle=r,i.fillRect(t,t,n,n);let o=this._glowColor.toCssColorString();i.strokeStyle=o,i.lineWidth=this._glowWidth,i.strokeRect(t,t,n,n),this._drawGrid(i),i.lineWidth=this._glowWidth*.5,i.strokeRect(t,t,n,n),this._drawGrid(i);let s=this._color.toCssColorString();return i.strokeStyle=s,i.lineWidth=2,i.strokeRect(t,t,n,n),i.lineWidth=1,this._drawGrid(i),e};XC.prototype.getTileCredits=function(e,t,n){};XC.prototype.requestImage=function(e,t,n,i){return Promise.resolve(this._canvas)};XC.prototype.pickFeatures=function(e,t,n,i,r){};var kce=XC;function pp(){}pp._maxDecodingConcurrency=Math.max(dn.hardwareConcurrency-1,1);pp._decodeTaskProcessor=new $n("decodeI3S",pp._maxDecodingConcurrency);pp._promise=void 0;async function UHt(){if(await pp._decodeTaskProcessor.initWebAssemblyModule({wasmBinaryFile:"ThirdParty/draco_decoder.wasm"}))return pp._decodeTaskProcessor;throw new oe("I3S decoder could not be initialized.")}pp.decode=async function(e,t,n,i,r){return l(pp._promise)||(pp._promise=UHt()),pp._promise.then(function(o){let s=n._parent._data,a=n._parent._inverseRotationMatrix,c=0,u=0,f=0;l(s.obb)?(c=s.obb.center[0],u=s.obb.center[1],f=s.obb.center[2]):l(s.mbs)&&(c=s.mbs[0],u=s.mbs[1],f=s.mbs[2]);let d=$.fromRotationX(-D.PI_OVER_TWO),p=new $;$.multiply(d,a,p);let g=he.fromDegrees(c,u,f),m=ee.WGS84.cartographicToCartesian(g),y={binaryData:n._data,featureData:l(i)&&l(i[0])?i[0].data:void 0,schema:t,bufferInfo:n._geometryBufferInfo,ellipsoidRadiiSquare:ee.WGS84.radiiSquared,url:e,geoidDataList:n._dataProvider._geoidDataList,cartographicCenter:g,cartesianCenter:m,parentRotation:p,enableFeatures:n._dataProvider.showFeatures,splitGeometryByColorTransparency:n._dataProvider.adjustMaterialAlphaMode,symbologyData:r,calculateNormals:n._dataProvider.calculateNormals};return o.scheduleTask(y)})};var i8=pp;function Uce(e,t){this._parent=e,this._dataProvider=e._dataProvider,this._layer=e._layer,l(this._parent._nodeIndex)?this._resource=this._parent._layer.resource.getDerivedResource({url:`nodes/${this._parent._data.mesh.attribute.resource}/${t}`}):this._resource=this._parent.resource.getDerivedResource({url:t})}Object.defineProperties(Uce.prototype,{resource:{get:function(){return this._resource}},data:{get:function(){return this._data}}});Uce.prototype.load=async function(){return this._data=await gp.loadJson(this._resource),this._data};var r8=Uce;function by(e,t){this._storageInfo=t,this._parent=e,this._dataProvider=e._dataProvider,this._loadPromise=void 0;let n=`attributes/${t.key}/0`;l(this._parent._nodeIndex)?this._resource=this._parent._layer.resource.getDerivedResource({url:`nodes/${this._parent._data.mesh.attribute.resource}/${n}`}):this._resource=this._parent.resource.getDerivedResource({url:n})}Object.defineProperties(by.prototype,{resource:{get:function(){return this._resource}},header:{get:function(){return this._header}},values:{get:function(){if(l(this._values)){if(l(this._values.attributeValues))return this._values.attributeValues;if(l(this._values.objectIds))return this._values.objectIds}return[]}},name:{get:function(){return this._storageInfo.name}}});function WW(e){return e==="UInt8"||e==="Int8"?1:e==="UInt16"||e==="Int16"?2:e==="UInt32"||e==="Int32"||e==="Oid32"||e==="Float32"?4:e==="UInt64"||e==="Int64"||e==="Float64"?8:0}function zHt(e){return e==="String"?1:WW(e)}async function VHt(e){let t=await e._dataProvider._loadBinary(e._resource),n=new DataView(t);e._data=t,e._validateHeader(n);let i=e._parseHeader(n),r=e._getBodyOffset(i);e._validateBody(n,r),e._parseBody(n,r)}by.prototype.load=function(){return l(this._loadPromise)?this._loadPromise:(this._loadPromise=VHt(this).catch(function(e){console.error(e)}),this._loadPromise)};by.prototype._parseValue=function(e,t,n){let i;if(t==="UInt8")i=e.getUint8(n),n+=1;else if(t==="Int8")i=e.getInt8(n),n+=1;else if(t==="UInt16")i=e.getUint16(n,!0),n+=2;else if(t==="Int16")i=e.getInt16(n,!0),n+=2;else if(t==="UInt32")i=e.getUint32(n,!0),n+=4;else if(t==="Oid32")i=e.getUint32(n,!0),n+=4;else if(t==="Int32")i=e.getInt32(n,!0),n+=4;else if(t==="UInt64"){let r=e.getUint32(n,!0),o=e.getUint32(n+4,!0);i=r+Math.pow(2,32)*o,n+=8}else if(t==="Int64"){let r=e.getUint32(n,!0),o=e.getUint32(n+4,!0);o<Math.pow(2,31)?i=r+Math.pow(2,32)*o:i=r+Math.pow(2,32)*(o-Math.pow(2,32)),n+=8}else t==="Float32"?(i=e.getFloat32(n,!0),n+=4):t==="Float64"?(i=e.getFloat64(n,!0),n+=8):t==="String"&&(i=String.fromCharCode(e.getUint8(n)),n+=1);return{value:i,offset:n}};by.prototype._parseHeader=function(e){let t=0;this._header={};for(let n=0;n<this._storageInfo.header.length;n++){let i=this._storageInfo.header[n],r=this._parseValue(e,i.valueType,t);this._header[i.property]=r.value,t=r.offset}return t};by.prototype._parseBody=function(e,t){this._values={};for(let n=0;n<this._storageInfo.ordering.length;n++){let i=this._storageInfo.ordering[n],r=i==="ObjectIds"?"objectIds":i,o=this._storageInfo[r];if(l(o)){this._values[r]=[];for(let s=0;s<this._header.count;++s)if(o.valueType!=="String"){let a=this._parseValue(e,o.valueType,t);this._values[r].push(a.value),t=a.offset}else{let a=this._values.attributeByteCounts[s],c="";for(let u=0;u<a;++u){let f=this._parseValue(e,o.valueType,t);f.value.charCodeAt(0)!==0&&(c+=f.value),t=f.offset}this._values[r].push(c)}}}};by.prototype._getBodyOffset=function(e){let t=0;return l(this._storageInfo.attributeValues)?t=WW(this._storageInfo.attributeValues.valueType):l(this._storageInfo.objectIds)&&(t=WW(this._storageInfo.objectIds.valueType)),t>0?Math.ceil(e/t)*t:e};by.prototype._validateHeader=function(e){let t=0;for(let n=0;n<this._storageInfo.header.length;n++){let i=this._storageInfo.header[n];t+=zHt(i.valueType)}if(e.byteLength<t)throw new oe(`Invalid attribute buffer size (field: ${this.name}, header: ${t}, actual: ${e.byteLength})`)};by.prototype._validateBody=function(e,t){if(!l(this._header.count))throw new oe(`Invalid attribute buffer (field: ${this.name}, count is missing)`);let n;for(let i=0;i<this._storageInfo.ordering.length&&t<e.byteLength;i++){let r=this._storageInfo.ordering[i],o=r==="ObjectIds"?"objectIds":r,s=this._storageInfo[o];if(l(s))if(s.valueType!=="String"){o==="attributeByteCounts"&&(n=t);let a=WW(s.valueType);t+=a*this._header.count}else{if(!l(n))throw new oe(`Invalid attribute buffer (field: ${this.name}, attributeByteCounts is missing)`);for(let a=0;a<this._header.count&&t<e.byteLength;++a){let c=this._parseValue(e,this._storageInfo.attributeByteCounts.valueType,n);t+=c.value,n=c.offset}}else throw new oe(`Invalid attribute buffer (field: ${this.name}, ${o} is missing)`)}if(e.byteLength<t)throw new oe(`Invalid attribute buffer size (field: ${this.name}, expected: ${t}, actual: ${e.byteLength})`)};var o8=by;function s8(e,t){let n=e._dataProvider,i=e._layer,r;l(e._nodeIndex)?r=i.resource.getDerivedResource({url:`nodes/${e._data.mesh.geometry.resource}/${t}`}):r=e.resource.getDerivedResource({url:t}),this._parent=e,this._dataProvider=n,this._layer=i,this._resource=r,this._customAttributes=void 0}Object.defineProperties(s8.prototype,{resource:{get:function(){return this._resource}},data:{get:function(){return this._data}},customAttributes:{get:function(){return this._customAttributes}}});s8.prototype.load=function(){let e=this;return this._dataProvider._loadBinary(this._resource).then(function(t){return e._data=t,t})};var jHt=new h,HHt=new h,GHt=new h,WHt=new h,qHt=new h;function zce(e,t,n,i){let r=h.subtract(i,n,jHt),o=h.cross(r,h.subtract(e,n,HHt),WHt),s=h.cross(r,h.subtract(t,n,GHt),qHt);return h.dot(o,s)>=0}var YHt=new h,XHt=new h,KHt=new h,$Ht=new h,JHt=new h,ZHt=new h,QHt=new h,eGt=new h,tGt=new h,nGt=new h;s8.prototype.getClosestPointIndexOnTriangle=function(e,t,n){if(l(this._customAttributes)&&l(this._customAttributes.positions)){let i=new h(e,t,n);i.x-=this._customAttributes.cartesianCenter.x,i.y-=this._customAttributes.cartesianCenter.y,i.z-=this._customAttributes.cartesianCenter.z,$.multiplyByVector(this._customAttributes.parentRotation,i,i);let r=Number.MAX_VALUE,o,s,a,c,u=this._customAttributes.positions,f=this._customAttributes.indices,d;l(f)?d=f.length:d=u.length/3;for(let p=0;p<d;p++){let g,m,y;l(f)?(g=f[p],m=f[p+1],y=f[p+2]):(g=p*3,m=p*3+1,y=p*3+2);let A=h.fromElements(u[g*3],u[g*3+1],u[g*3+2],YHt),b=h.fromElements(u[m*3],u[m*3+1],u[m*3+2],XHt),x=new h(u[y*3],u[y*3+1],u[y*3+2],KHt);if(!zce(i,A,b,x)||!zce(i,b,A,x)||!zce(i,x,A,b))continue;let T=h.subtract(b,A,$Ht),E=h.subtract(x,A,JHt),v=h.cross(T,E,ZHt);if(h.magnitude(v)===0)continue;let S=h.normalize(v,QHt),I=h.subtract(i,A,eGt),R=Math.abs(h.dot(I,S));if(R<r){r=R,o=p;let O=h.magnitudeSquared(h.subtract(i,A,I)),L=h.magnitudeSquared(h.subtract(i,b,tGt)),_=h.magnitudeSquared(h.subtract(i,x,nGt));O<L&&O<_?(a=g,c=A,s=O):L<_?(a=m,c=b,s=L):(a=y,c=x,s=_)}}if(l(o))return{index:a,distanceSquared:s,distance:Math.sqrt(s),queriedPosition:i,closestPosition:h.clone(c)}}return{index:-1,distanceSquared:Number.Infinity,distance:Number.Infinity}};function gke(e){let t=[],n=e.length;for(let i=0;i<n;i++)i<3?t.push(jC(e[i])):t.push(e[i]);return t}s8.prototype._generateGltf=function(e,t,n,i,r,o,s,a){let c={pbrMetallicRoughness:{metallicFactor:0},doubleSided:!0,name:"Material"},u=!1,f,d="";if(l(this._parent._data.mesh)&&l(this._layer._data.materialDefinitions)){let T=this._parent._data.mesh.material.definition;if(T>=0&&T<this._layer._data.materialDefinitions.length){if(f=this._layer._data.materialDefinitions[T],c=f,l(c.pbrMetallicRoughness)&&l(c.pbrMetallicRoughness.baseColorTexture)){u=!0,c.pbrMetallicRoughness.baseColorTexture.index=0;let E="0";if(l(this._layer._data.textureSetDefinitions))for(let v=0;v<this._layer._data.textureSetDefinitions.length;v++){let S=this._layer._data.textureSetDefinitions[v];for(let I=0;I<S.formats.length;I++){let R=S.formats[I];if(R.format==="jpg"){E=R.name;break}}}l(this._parent._data.mesh)&&this._parent._data.mesh.material.resource>=0&&(d=this._layer.resource.getDerivedResource({url:`nodes/${this._parent._data.mesh.material.resource}/textures/${E}`}).url)}l(c.pbrMetallicRoughness)&&l(c.pbrMetallicRoughness.baseColorFactor)&&(c.pbrMetallicRoughness.baseColorFactor=gke(c.pbrMetallicRoughness.baseColorFactor)),l(c.emissiveFactor)&&(c.emissiveFactor=gke(c.emissiveFactor))}}else l(this._parent._data.textureData)&&(u=!0,d=this._parent.resource.getDerivedResource({url:`${this._parent._data.textureData[0].href}`}).url,c.pbrMetallicRoughness.baseColorTexture={index:0});l(c.alphaMode)&&(c.alphaMode=c.alphaMode.toUpperCase());let p=[],g=[],m=[];u&&(p=[{sampler:0,source:0}],g=[{uri:d}],m=[{magFilter:9729,minFilter:9986,wrapS:10497,wrapT:10497}]);let y=[],A=n.length;for(let x=0;x<A;x++){let T=n[x].primitives,E=T.length;for(let v=0;v<E;v++){let S=T[v];if(l(S.material)){for(;S.material>=y.length;){let R=Je(c,!0);y.push(R)}let I=y[S.material];l(S.extra)&&S.extra.isTransparent?l(I.alphaMode)||(I.alphaMode="BLEND"):I.alphaMode==="BLEND"&&(I.alphaMode="OPAQUE")}}}return{scene:0,scenes:[{nodes:e}],nodes:t,meshes:n,buffers:i,bufferViews:r,accessors:o,materials:y,textures:p,images:g,samplers:m,asset:{version:"2.0"},extensions:s,extensionsUsed:a}};var qP=s8;function Dl(e,t,n){let i,r,o,s;n?(i=0,r=e):(i=e._level+1,r=e._layer),typeof t=="number"?o=t:s=e.resource.getDerivedResource({url:`${t}/`}),this._parent=e,this._dataProvider=e._dataProvider,this._isRoot=n,this._level=i,this._layer=r,this._nodeIndex=o,this._resource=s,this._isLoading=!1,this._tile=void 0,this._data=void 0,this._geometryData=[],this._featureData=[],this._fields={},this._children=[],this._childrenReadyPromise=void 0,this._globalTransform=void 0,this._inverseGlobalTransform=void 0,this._inverseRotationMatrix=void 0,this._symbologyData=void 0}Object.defineProperties(Dl.prototype,{resource:{get:function(){return this._resource}},layer:{get:function(){return this._layer}},parent:{get:function(){return this._parent}},children:{get:function(){return this._children}},geometryData:{get:function(){return this._geometryData}},featureData:{get:function(){return this._featureData}},fields:{get:function(){return this._fields}},tile:{get:function(){return this._tile}},data:{get:function(){return this._data}}});Dl.prototype.load=async function(){let e=this;function t(){if(!e._isRoot){let r=e._create3DTileDefinition();e._tile=new oh(e._layer._tileset,e._dataProvider.resource,r,e._parent._tile),e._tile._i3sNode=e}}if(!l(this._nodeIndex)){let r=await gp.loadJson(this._resource);e._data=r,t();return}let n=await this._layer._getNodeInNodePages(this._nodeIndex);e._data=n;let i;e._isRoot?i="nodes/root/":l(n.mesh)&&(i=`../${n.mesh.geometry.resource}/`),l(i)&&l(e._parent.resource)&&(e._resource=e._parent.resource.getDerivedResource({url:i})),t()};function _ke(e,t){let n=new o8(e,t);return e._fields[t.name]=n,n.load()}Dl.prototype.loadFields=function(){let e=this._layer._data.attributeStorageInfo,t=[];if(l(e))for(let n=0;n<e.length;n++){let i=e[n],r=this._fields[i.name];l(r)?t.push(r.load()):t.push(_ke(this,i))}return Promise.all(t)};Dl.prototype.loadField=function(e){let t=this._fields[e];if(l(t))return t.load();let n=this._layer._data.attributeStorageInfo;if(l(n))for(let i=0;i<n.length;i++){let r=n[i];if(r.name===e)return _ke(this,r)}return Promise.resolve()};Dl.prototype.getFieldsForPickedPosition=function(e){let t=this.geometryData[0];if(!l(t.customAttributes.featureIndex))return{};let n=t.getClosestPointIndexOnTriangle(e.x,e.y,e.z);if(n.index===-1||n.index>t.customAttributes.featureIndex.length)return{};let i=t.customAttributes.featureIndex[n.index];return this.getFieldsForFeature(i)};Dl.prototype.getFieldsForFeature=function(e){let t={};for(let n in this.fields)if(this.fields.hasOwnProperty(n)){let i=this.fields[n];e>=0&&e<i.values.length&&(t[i.name]=i.values[e])}return t};Dl.prototype._loadChildren=function(){let e=this;if(l(this._childrenReadyPromise))return this._childrenReadyPromise;let t=[];if(l(e._data.children))for(let n=0;n<e._data.children.length;n++){let i=e._data.children[n],r=new Dl(e,i.href??i,!1);e._children.push(r),t.push(r.load())}return this._childrenReadyPromise=Promise.all(t).then(function(){for(let n=0;n<e._children.length;n++)e._tile.children.push(e._children[n]._tile)}),this._childrenReadyPromise};Dl.prototype._loadGeometryData=function(){let e=[];if(l(this._data.geometryData))for(let t=0;t<this._data.geometryData.length;t++){let n=new qP(this,this._data.geometryData[t].href);this._geometryData.push(n),e.push(n.load())}else if(l(this._data.mesh)){let t=this._layer._findBestGeometryBuffers(this._data.mesh.geometry.definition,["position","uv0"]),n=`./geometries/${t.bufferIndex}/`,i=new qP(this,n);i._geometryDefinitions=t.definition,i._geometryBufferInfo=t.geometryBufferInfo,this._geometryData.push(i),e.push(i.load())}return Promise.all(e)};Dl.prototype._loadFeatureData=function(){let e=[];if(l(this._data.featureData))for(let t=0;t<this._data.featureData.length;t++){let n=new r8(this,this._data.featureData[t].href);this._featureData.push(n),e.push(n.load())}return Promise.all(e)};Dl.prototype._clearGeometryData=function(){this._geometryData=[]};Dl.prototype._create3DTileDefinition=function(){let e=this._data.obb,t=this._data.mbs;if(!l(e)&&!l(t)){console.error("Failed to load I3S node. Bounding volume is required.");return}let n;if(l(e)?n=he.fromDegrees(e.center[0],e.center[1],e.center[2]):n=he.fromDegrees(t[0],t[1],t[2]),l(this._dataProvider._geoidDataList)&&l(n))for(let b=0;b<this._dataProvider._geoidDataList.length;b++){let x=this._dataProvider._geoidDataList[b],T=x.projection.project(n);if(T.x>x.nativeExtent.west&&T.x<x.nativeExtent.east&&T.y>x.nativeExtent.south&&T.y<x.nativeExtent.north){n.height+=sGt(T.x,T.y,x);break}}let i,r,o;l(e)?(i={box:[0,0,0,e.halfSize[0],0,0,0,e.halfSize[1],0,0,0,e.halfSize[2]]},o=Math.max(Math.max(this._data.obb.halfSize[0],this._data.obb.halfSize[1]),this._data.obb.halfSize[2]),r=ee.WGS84.cartographicToCartesian(n)):(i={sphere:[0,0,0,t[3]]},r=ee.WGS84.cartographicToCartesian(n),o=this._data.mbs[3]),o*=2;let s=1/0;if(l(this._data.lodThreshold))if(this._layer._data.nodePages.lodSelectionMetricType==="maxScreenThresholdSQ"){let b=Math.sqrt(this._data.lodThreshold/(Math.PI*.25));s=o/b}else if(this._layer._data.nodePages.lodSelectionMetricType==="maxScreenThreshold"){let b=this._data.lodThreshold;s=o/b}else console.error("Invalid lodSelectionMetricType in Layer");else if(l(this._data.lodSelection))for(let b=0;b<this._data.lodSelection.length;b++)this._data.lodSelection[b].metricType==="maxScreenThreshold"&&(s=o/this._data.lodSelection[b].maxError);s===1/0&&(s=1e5);let a=s*16,c=new wc(0,0,0),u=At.headingPitchRollQuaternion(r,c);l(this._data.obb)&&(u=new Le(this._data.obb.quaternion[0],this._data.obb.quaternion[1],this._data.obb.quaternion[2],this._data.obb.quaternion[3]));let f=$.fromQuaternion(u),d=$.inverse(f,new $),p=new N(f[0],f[1],f[2],0,f[3],f[4],f[5],0,f[6],f[7],f[8],0,r.x,r.y,r.z,1),g=N.inverse(p,new N),m=N.clone(p);l(this._parent._globalTransform)&&N.multiply(p,this._parent._inverseGlobalTransform,m),this._globalTransform=p,this._inverseGlobalTransform=g,this._inverseRotationMatrix=d;let y=[];for(let b=0;b<this._children.length;b++)y.push(this._children[b]._create3DTileDefinition());return{children:y,refine:"REPLACE",boundingVolume:i,transform:[m[0],m[4],m[8],m[12],m[1],m[5],m[9],m[13],m[2],m[6],m[10],m[14],m[3],m[7],m[11],m[15]],content:{uri:l(this._resource)?this._resource.url:void 0},geometricError:a}};Dl.prototype._loadSymbology=async function(){!l(this._symbologyData)&&l(this._layer._symbology)&&(this._symbologyData=await this._layer._symbology._getSymbology(this))};Dl.prototype._createContentURL=async function(){let e={scene:0,scenes:[{nodes:[0]}],nodes:[{name:"singleNode"}],meshes:[],buffers:[],bufferViews:[],accessors:[],materials:[],textures:[],images:[],samplers:[],asset:{version:"2.0"}},t=[this._loadGeometryData()];if(this._dataProvider.legacyVersion16&&t.push(this._loadFeatureData()),await Promise.all(t),l(this._geometryData)&&this._geometryData.length>0){this._dataProvider._applySymbology&&await this._loadSymbology();let r=this._geometryData[0].resource.url,o=this._layer._data.store.defaultGeometrySchema,s=this._geometryData[0],a=await i8.decode(r,o,s,this._featureData[0],this._symbologyData);if(!l(a))return;e=s._generateGltf(a.meshData.nodesInScene,a.meshData.nodes,a.meshData.meshes,a.meshData.buffers,a.meshData.bufferViews,a.meshData.accessors,a.meshData.rootExtensions,a.meshData.extensionsUsed),this._geometryData[0]._customAttributes=a.meshData._customAttributes}let n=this._dataProvider._binarizeGltf(e),i=new Blob([n],{type:"application/binary"});return URL.createObjectURL(i)};async function iGt(e){let t=e._layer._filters,n=[];for(let i=0;i<t.length;i++){let r=e.loadField(t[i].name);n.push(r)}return await Promise.all(n),t}function rGt(e,t,n){if(!l(n.values)||n.values.length===0)return!1;let i=l(t)?t.values:[],r;e<i.length&&(r=i[e]);let o=!1;for(let s=0;s<n.values.length;s++)if(n.values[s]===r){o=!0;break}return o}async function yke(e,t){let n=e._tile.content.batchTable;if(l(n)&&n.featuresLength>0){n.setAllShow(!0);let i=await iGt(e);if(i.length>0)for(let r=0;r<n.featuresLength;r++)for(let o=0;o<i.length;o++){let s=i[o];if(!rGt(r,e._fields[s.name],s)){n.setShow(r,!1);break}}}t.show=!0}Dl.prototype._filterFeatures=function(){let e=[];for(let n=0;n<this._children.length;n++){let i=this._children[n]._filterFeatures();e.push(i)}let t=this._tile?.content?._model;if(l(this._geometryData)&&this._geometryData.length>0&&l(t)&&t.ready){t.show=!1;let n=yke(this,t);e.push(n)}return Promise.all(e)};oh.prototype._hookedRequestContent=oh.prototype.requestContent;oh.prototype.requestContent=function(){if(!this.tileset._isI3STileSet)return this._hookedRequestContent();if(!this._isLoading){this._isLoading=!0;let e=this;return this._i3sNode._createContentURL().then(t=>{if(!l(t)){e._isLoading=!1;return}return e._contentResource=new De({url:t}),e._hookedRequestContent()}).then(t=>{let n=t?._model;return l(e._i3sNode._geometryData)&&e._i3sNode._geometryData.length>0&&l(n)&&(n.show=!1,n.readyEvent.addEventListener(()=>{yke(e._i3sNode,n)})),e._isLoading=!1,t})}};function oGt(e,t,n,i,r,o){let s=n*(1-e)+i*e,a=r*(1-e)+o*e;return s*(1-t)+a*t}function qW(e,t,n,i){let r=e+t*n;return i[r]}function sGt(e,t,n){let i=n.nativeExtent,r=(e-i.west)/(i.east-i.west)*(n.width-1),o=(t-i.south)/(i.north-i.south)*(n.height-1),s=Math.floor(r),a=Math.floor(o);r-=s,o-=a;let c=s<n.width?s+1:s,u=a<n.height?a+1:a;a=n.height-1-a,u=n.height-1-u;let f=qW(s,a,n.width,n.buffer),d=qW(c,a,n.width,n.buffer),p=qW(s,u,n.width,n.buffer),g=qW(c,u,n.width,n.buffer),m=oGt(r,o,f,d,p,g);return m=m*n.scale+n.offset,m}Object.defineProperties(oh.prototype,{i3sNode:{get:function(){return this._i3sNode}}});var YP=Dl;function YW(e){this._layer=e,this._defaultSymbology=void 0,this._valueFields=[],this._uniqueValueHash=void 0,this._classBreaksHash=void 0,this._parseLayerSymbology()}Object.defineProperties(YW.prototype,{defaultSymbology:{get:function(){return this._defaultSymbology}}});function Vce(e,t){let n=[];for(let i=0;i<e.length;i++){let r=z.byteToFloat(e[i]);i<3?n.push(jC(r)):n.push(r)}return n.length===3&&(l(t)?n.push(1-t/100):n.push(1)),n}function XP(e,t){let n={edges:void 0,material:void 0};if(l(e)&&l(e.symbolLayers))for(let i=0;i<e.symbolLayers.length;i++){let r=e.symbolLayers[i];if(r.type==="Fill"){let o=r.edges,s=r.outline;if(l(o)?(n.edges={},l(o.color)&&(n.edges.color=Vce(o.color,o.transparency))):l(s)&&(n.edges={},l(s.color)&&(n.edges.color=Vce(s.color,s.transparency))),!t){let a=r.material;l(a)&&(n.material={colorMixMode:a.colorMixMode},l(a.color)&&(n.material.color=Vce(a.color,a.transparency)))}break}}return n}function aGt(e,t){if(l(e.uniqueValueGroups)){let n={};for(let i=0;i<e.uniqueValueGroups.length;i++){let r=e.uniqueValueGroups[i].classes;if(l(r))for(let o=0;o<r.length;o++){let s=XP(r[o].symbol,t),a=r[o].values;for(let c=0;c<a.length;c++){let u=a[c],f=n;for(let d=0;d<u.length;d++){let p=u[d];d===u.length-1?f[p]=s:(l(f[p])||(f[p]={}),f=f[p])}}}}return n}if(l(e.uniqueValueInfos)){let n={};for(let i=0;i<e.uniqueValueInfos.length;i++){let r=e.uniqueValueInfos[i];n[r.value]=XP(r.symbol,t)}return n}}function cGt(e,t){if(l(e.classBreakInfos)){let n=[...e.classBreakInfos];n.sort(function(r,o){let s=r.classMaxValue??r.classMinValue,a=o.classMaxValue??o.classMinValue;return s-a});let i={ranges:[],symbols:[]};l(e.minValue)&&(i.ranges.push(e.minValue),i.symbols.push(void 0));for(let r=0;r<n.length;r++){let o=n[r];l(o.classMinValue)&&(i.ranges.length===0||o.classMinValue>i.ranges[i.ranges.length-1])&&(i.ranges.push(o.classMinValue),i.symbols.push(void 0)),l(o.classMaxValue)&&(i.ranges.length===0||o.classMaxValue>i.ranges[i.ranges.length-1])&&(i.ranges.push(o.classMaxValue),i.symbols.push(XP(o.symbol,t)))}return i.symbols.push(void 0),i}}YW.prototype._parseLayerSymbology=function(){let e=this._layer.data.drawingInfo;if(l(e)&&l(e.renderer)){let t=this._layer.data.cachedDrawingInfo,n=l(t)&&t.color===!0,i=e.renderer;i.type==="simple"?this._defaultSymbology=XP(i.symbol,n):i.type==="uniqueValue"?(this._defaultSymbology=XP(i.defaultSymbol,n),this._valueFields.push(i.field1),l(i.field2)&&this._valueFields.push(i.field2),l(i.field3)&&this._valueFields.push(i.field3),this._uniqueValueHash=aGt(i,n)):i.type==="classBreaks"&&(this._defaultSymbology=XP(i.defaultSymbol,n),this._valueFields.push(i.field),this._classBreaksHash=cGt(i,n))}};function Ake(e,t,n,i){let r=t[n];if(i<r.length){let o=r[i],s=e[o];return l(s)&&++n<t.length?Ake(s,t,n,i):s}}function lGt(e,t){let n=0,i=e.length;if(n<i)do{let r=n+i>>>1;e[r]<t?n=r+1:i=r}while(n<i);return n}function uGt(e,t,n){let i=t[n],r=lGt(e.ranges,i);return e.symbols[r]}YW.prototype._getSymbology=async function(e){let t={default:this._defaultSymbology};if(this._valueFields.length>0){let n=[];for(let o=0;o<this._valueFields.length;o++)n.push(e.loadField(this._valueFields[o]));await Promise.all(n);let i=[];for(let o=0;o<this._valueFields.length;o++)i.push(e.fields[this._valueFields[o]].values);let r;if(l(this._uniqueValueHash)?r=o=>Ake(this._uniqueValueHash,i,0,o):l(this._classBreaksHash)&&(r=o=>uGt(this._classBreaksHash,i[0],o)),l(r)){let o=i[0];for(let s=0;s<o.length;s++){let a=r(s);l(a)&&(t[s]=a)}}}return t};var a8=YW;function yf(e,t,n){this._dataProvider=e,this._parent=n,!l(t.href)&&l(t.id)&&(t.href=`layers/${t.id}`);let i=this._parent.resource.getUrlComponent(),r;i.match(/layers\/\d/)?r=`${i}`.replace(/\/+$/,""):r=`${i}`.replace(/\/?$/,"/").concat(`${t.href}`),this._version=t.store.version;let o=this._version.split(".");this._majorVersion=parseInt(o[0]),this._minorVersion=o.length>1?parseInt(o[1]):0,this._resource=new De({url:r}),this._resource.setQueryParameters(this._dataProvider.resource.queryParameters),this._resource.appendForwardSlash(),this._data=t,this._rootNode=void 0,this._nodePages={},this._nodePageFetches={},this._extent=void 0,this._tileset=void 0,this._geometryDefinitions=void 0,this._filters=[],this._symbology=void 0,this._computeGeometryDefinitions(!0),this._computeExtent()}Object.defineProperties(yf.prototype,{resource:{get:function(){return this._resource}},rootNode:{get:function(){return this._rootNode}},tileset:{get:function(){return this._tileset}},data:{get:function(){return this._data}},version:{get:function(){return this._version}},majorVersion:{get:function(){return this._majorVersion}},minorVersion:{get:function(){return this._minorVersion}},legacyVersion16:{get:function(){if(l(this.version))return this.majorVersion<1||this.majorVersion===1&&this.minorVersion<=6}}});yf.prototype.load=async function(e){if(this._data.spatialReference.wkid!==4326)throw new oe(`Unsupported spatial reference: ${this._data.spatialReference.wkid}`);if(this._dataProvider.applySymbology&&(this._symbology=new a8(this)),await this._dataProvider.loadGeoidData(),await this._loadRootNode(e),await this._create3DTileset(e),this._rootNode._tile=this._tileset._root,this._tileset._root._i3sNode=this._rootNode,this.legacyVersion16)return this._rootNode._loadChildren()};yf.prototype._computeGeometryDefinitions=function(e){if(this._geometryDefinitions=[],l(this._data.geometryDefinitions))for(let t=0;t<this._data.geometryDefinitions.length;t++){let n=[],i=this._data.geometryDefinitions[t].geometryBuffers;for(let r=0;r<i.length;r++){let o=i[r],s=[],a=!1;if(l(o.compressedAttributes)&&e){a=!0;let c=o.compressedAttributes.attributes;for(let u=0;u<c.length;u++)s.push(c[u])}else for(let c in o)c!=="offset"&&s.push(c);n.push({compressed:a,attributes:s,index:i.indexOf(o)})}n.sort(function(r,o){return r.compressed&&!o.compressed?-1:!r.compressed&&o.compressed?1:r.attributes.length-o.attributes.length}),this._geometryDefinitions.push(n)}};yf.prototype._findBestGeometryBuffers=function(e,t){let n=this._geometryDefinitions[e];if(l(n)){for(let i=0;i<n.length;++i){let r=n[i],o=!1,s=r.attributes;for(let a=0;a<t.length;a++)if(!s.includes(t[a])){o=!0;break}if(!o)return{bufferIndex:r.index,definition:n,geometryBufferInfo:r}}if(l(n[0]))return{bufferIndex:0,definition:n,geometryBufferInfo:n[0]}}};yf.prototype._loadRootNode=function(e){if(l(this._data.nodePages)){let t=0;l(this._data.nodePages.rootIndex)&&(t=this._data.nodePages.rootIndex),this._rootNode=new YP(this,t,!0)}else this._rootNode=new YP(this,this._data.store.rootNode,!0);return this._rootNode.load(e)};yf.prototype._getNodeInNodePages=function(e){let t=Math.floor(e/this._data.nodePages.nodesPerPage),n=e%this._data.nodePages.nodesPerPage;return this._loadNodePage(t).then(function(i){return i.nodes[n]})};yf._fetchJson=function(e){return e.fetchJson()};yf.prototype._loadNodePage=function(e){let t=this;if(!l(this._nodePageFetches[e])){let n=this.resource.getDerivedResource({url:`nodepages/${e}/`}),i=yf._fetchJson(n).then(function(r){return l(r.error)&&r.error.code!==200?Promise.reject(r.error):(t._nodePages[e]=r.nodes,r)});this._nodePageFetches[e]=i}return this._nodePageFetches[e]};yf.prototype._computeExtent=function(){l(this._data.fullExtent)?this._extent=ie.fromDegrees(this._data.fullExtent.xmin,this._data.fullExtent.ymin,this._data.fullExtent.xmax,this._data.fullExtent.ymax):l(this._data.store.extent)&&(this._extent=ie.fromDegrees(this._data.store.extent[0],this._data.store.extent[1],this._data.store.extent[2],this._data.store.extent[3]))};yf.prototype._create3DTileset=async function(e){let t={asset:{version:"1.0"},geometricError:Number.MAX_VALUE,root:this._rootNode._create3DTileDefinition()},n=new Blob([JSON.stringify(t)],{type:"application/json"}),i=URL.createObjectURL(n),r=this._symbology?.defaultSymbology?.edges?.color;l(r)&&!l(e?.outlineColor)&&(e=l(e)?Je(e):{},e.outlineColor=z.fromCartesian4(se.fromArray(r))),this._tileset=await Yo.fromUrl(i,e),this._tileset.show=this._parent.show,this._tileset._isI3STileSet=!0,this._tileset.tileUnload.addEventListener(function(o){o._i3sNode._clearGeometryData(),URL.revokeObjectURL(o._contentResource._url),o._contentResource=o._i3sNode.resource}),this._tileset.tileVisible.addEventListener(function(o){l(o._i3sNode)&&o._i3sNode._loadChildren()})};yf.prototype._updateVisibility=function(){l(this._tileset)&&(this._tileset.show=this._parent.show)};yf.prototype.filterByAttributes=function(e){this._filters=l(e)?Je(e,!0):[];let t=this._rootNode;return l(t)?t._filterFeatures():Promise.resolve()};var KC=yf;function XW(e,t){this._dataProvider=e,this._resource=new De({url:t}),this._resource.setQueryParameters(e.resource.queryParameters),this._resource.appendForwardSlash()}Object.defineProperties(XW.prototype,{resource:{get:function(){return this._resource}},data:{get:function(){return this._data}},names:{get:function(){let e=[],t=this._data.summary;if(l(t))for(let n=0;n<t.length;++n)e.push(t[n].fieldName);return e}}});XW.prototype.load=async function(){return this._data=await gp.loadJson(this._resource),this._data};XW.prototype._getValues=function(e){let t=this._data.summary;if(l(t))for(let n=0;n<t.length;++n){let i=t[n];if(i.fieldName===e)return l(i.mostFrequentValues)?[...i.mostFrequentValues]:[]}};var c8=XW;function l8(e,t,n){this._dataProvider=e,this._parent=t,this._data=n,this._name=n.name,this._modelName=n.modelName,this._visibility=n.visibility??!0,this._resource=void 0,this._sublayers=[],this._i3sLayers=[]}Object.defineProperties(l8.prototype,{resource:{get:function(){return this._resource}},data:{get:function(){return this._data}},name:{get:function(){return this._name}},modelName:{get:function(){return this._modelName}},sublayers:{get:function(){return this._sublayers}},visibility:{get:function(){return this._visibility},set:function(e){if(this._visibility!==e){this._visibility=e;for(let t=0;t<this._i3sLayers.length;t++)this._i3sLayers[t]._updateVisibility()}}},show:{get:function(){return this._visibility&&this._parent.show}}});l8._fromData=async function(e,t,n,i){let r=new l8(e,i,n);if(r._data.layerType==="group"){let o=r._data.sublayers;if(l(o)){let s=[];for(let c=0;c<o.length;c++){let u=l8._fromData(e,t,o[c],r);s.push(u)}let a=await Promise.all(s);for(let c=0;c<a.length;c++){let u=a[c];r._sublayers.push(u),r._i3sLayers.push(...u._i3sLayers)}}}else if(r._data.layerType==="3DObject"){let o=t.concat(`/sublayers/${r._data.id}`),s=new De({url:o});s.setQueryParameters(e.resource.queryParameters),s.appendForwardSlash(),r._resource=s;let a=await gp.loadJson(r._resource),c=new KC(e,a,r);r._i3sLayers.push(c)}else console.log(`${r._data.layerType} layer ${r._data.name} is skipped as not supported.`);return r};var u8=l8;var Tke=Qo(bke(),1);function fa(e){e=e??H.EMPTY_OBJECT,this._name=e.name,this._show=e.show??!0,this._geoidTiledTerrainProvider=e.geoidTiledTerrainProvider,this._showFeatures=e.showFeatures??!1,this._adjustMaterialAlphaMode=e.adjustMaterialAlphaMode??!1,this._applySymbology=e.applySymbology??!1,this._calculateNormals=e.calculateNormals??!1,this._cesium3dTilesetOptions=e.cesium3dTilesetOptions??H.EMPTY_OBJECT,this._layers=[],this._sublayers=[],this._data=void 0,this._extent=void 0,this._geoidDataPromise=void 0,this._geoidDataList=void 0,this._decoderTaskProcessor=void 0,this._taskProcessorReadyPromise=void 0,this._attributeStatistics=[],this._layersExtent=[]}Object.defineProperties(fa.prototype,{name:{get:function(){return this._name}},show:{get:function(){return this._show},set:function(e){if(this._show!==e){this._show=e;for(let t=0;t<this._layers.length;t++)this._layers[t]._updateVisibility()}}},geoidTiledTerrainProvider:{get:function(){return this._geoidTiledTerrainProvider}},layers:{get:function(){return this._layers}},sublayers:{get:function(){return this._sublayers}},data:{get:function(){return this._data}},extent:{get:function(){return this._extent}},resource:{get:function(){return this._resource}},showFeatures:{get:function(){return this._showFeatures}},adjustMaterialAlphaMode:{get:function(){return this._adjustMaterialAlphaMode}},applySymbology:{get:function(){return this._applySymbology}},calculateNormals:{get:function(){return this._calculateNormals}}});fa.prototype.destroy=function(){for(let e=0;e<this._layers.length;e++)l(this._layers[e]._tileset)&&this._layers[e]._tileset.destroy();return le(this)};fa.prototype.isDestroyed=function(){return!1};fa.prototype.update=function(e){for(let t=0;t<this._layers.length;t++)l(this._layers[t]._tileset)&&this._layers[t]._tileset.update(e)};fa.prototype.prePassesUpdate=function(e){for(let t=0;t<this._layers.length;t++)l(this._layers[t]._tileset)&&this._layers[t]._tileset.prePassesUpdate(e)};fa.prototype.postPassesUpdate=function(e){for(let t=0;t<this._layers.length;t++)l(this._layers[t]._tileset)&&this._layers[t]._tileset.postPassesUpdate(e)};fa.prototype.updateForPass=function(e,t){for(let n=0;n<this._layers.length;n++)l(this._layers[n]._tileset)&&this._layers[n]._tileset.updateForPass(e,t)};function fGt(e,t){let n=e.resource.getUrlComponent(),i;return n.match(/layers\/\d/)?i=`${n}`.replace(/\/+$/,""):i=`${n}`.replace(/\/?$/,"/").concat(`layers/${t}`),i}async function xke(e,t,n){if(t.layerType==="Building"){l(n.showFeatures)||(e._showFeatures=!0),l(n.adjustMaterialAlphaMode)||(e._adjustMaterialAlphaMode=!0),l(n.applySymbology)||(e._applySymbology=!0),l(n.calculateNormals)||(e._calculateNormals=!0);let i=fGt(e,t.id);if(l(t.sublayers)){let r=[];for(let s=0;s<t.sublayers.length;s++){let a=u8._fromData(e,i,t.sublayers[s],e);r.push(a)}let o=await Promise.all(r);for(let s=0;s<o.length;s++){let a=o[s];e._sublayers.push(a),e._layers.push(...a._i3sLayers)}}if(l(t.statisticsHRef)){let r=i.concat(`/${t.statisticsHRef}`),o=new c8(e,r);await o.load(),e._attributeStatistics.push(o)}if(l(t.fullExtent)){let r=ie.fromDegrees(t.fullExtent.xmin,t.fullExtent.ymin,t.fullExtent.xmax,t.fullExtent.ymax);e._layersExtent.push(r)}}else if(t.layerType==="3DObject"||t.layerType==="IntegratedMesh"){!l(n.calculateNormals)&&!l(t.textureSetDefinitions)&&(e._calculateNormals=!0);let i=new KC(e,t,e);e._layers.push(i),l(i._extent)&&e._layersExtent.push(i._extent)}else console.log(`${t.layerType} layer ${t.name} is skipped as not supported.`)}fa.fromUrl=async function(e,t){t=t??H.EMPTY_OBJECT;let n=De.createIfNeeded(e);n.setQueryParameters({f:"pjson"},!0);let i=await fa.loadJson(n),r=new fa(t);if(r._resource=n,r._data=i,l(i.layers)){let s=[];for(let a=0;a<i.layers.length;a++){let c=xke(r,i.layers[a],t);s.push(c)}await Promise.all(s)}else await xke(r,i,t);r._computeExtent();let o=[];for(let s=0;s<r._layers.length;s++)o.push(r._layers[s].load(t.cesium3dTilesetOptions));return await Promise.all(o),r};fa._fetchJson=function(e){return e.fetchJson()};fa.loadJson=async function(e){let t=await fa._fetchJson(e);if(l(t.error)){if(console.error("Failed to fetch I3S ",e.url),l(t.error.message)&&console.error(t.error.message),l(t.error.details))for(let n=0;n<t.error.details.length;n++)console.log(t.error.details[n]);throw new oe(t.error)}return t};fa.prototype._loadBinary=async function(e){let t=await e.fetchArrayBuffer();if(t.byteLength>0&&new Uint8Array(t)[0]===123&&new TextDecoder().decode(t).includes("404"))throw new oe(`Failed to load binary: ${e.url}`);return t};fa.prototype._binarizeGltf=function(e){let n=new TextEncoder().encode(JSON.stringify(e)),i=new Uint8Array(n.byteLength+20),r={magic:new Uint8Array(i.buffer,0,4),version:new Uint32Array(i.buffer,4,1),length:new Uint32Array(i.buffer,8,1),chunkLength:new Uint32Array(i.buffer,12,1),chunkType:new Uint32Array(i.buffer,16,1),chunkData:new Uint8Array(i.buffer,20,n.byteLength)};return r.magic[0]=103,r.magic[1]=108,r.magic[2]=84,r.magic[3]=70,r.version[0]=2,r.length[0]=i.byteLength,r.chunkLength[0]=n.byteLength,r.chunkType[0]=1313821514,r.chunkData.set(n),i};var dGt=new U;function hGt(e,t){let n=e.tilingScheme,i=[],r={},o=e._lodCount,s=he.fromRadians(t.west,t.north),a=he.fromRadians(t.east,t.south),c=n.positionToTileXY(s,o),u=n.positionToTileXY(a,o);for(let d=c.x;d<=u.x;d++)for(let p=c.y;p<=u.y;p++){let g=U.fromElements(d,p,dGt),m=g.toString();if(!r.hasOwnProperty(m)){let y={x:g.x,y:g.y,level:o,tilingScheme:n,terrainProvider:e,positions:[]};r[m]=y,i.push(y)}}let f=[];for(let d=0;d<i.length;++d){let p=i[d],g=p.terrainProvider.requestTileGeometry(p.x,p.y,p.level);f.push(g)}return Promise.all(f).then(function(d){let p=[];for(let g=0;g<d.length;g++){let m={tilingScheme:n,x:i[g].x,y:i[g].y,level:i[g].level},y=d[g],A="Geographic";n._projection instanceof yi&&(A="WebMercator");let b={projectionType:A,projection:n._projection,nativeExtent:n.tileXYToNativeRectangle(m.x,m.y,m.level),height:y._height,width:y._width,scale:y._structure.heightScale,offset:y._structure.heightOffset};if(y._encoding===xh.LERC){let x=Tke.default.decode(y._buffer);b.buffer=x.pixels[0]}else b.buffer=y._buffer;p.push(b)}return p})}async function mGt(e){let t=e._geoidTiledTerrainProvider;if(l(t))try{let n=await hGt(t,e._extent);e._geoidDataList=n}catch{console.log("Error retrieving Geoid Terrain tiles - no geoid conversion will be performed.")}}fa.prototype.loadGeoidData=async function(){return l(this._geoidDataPromise)?this._geoidDataPromise:(this._geoidDataPromise=mGt(this),this._geoidDataPromise)};fa.prototype._computeExtent=function(){let e;for(let t=0;t<this._layersExtent.length;t++){let n=this._layersExtent[t];l(e)?ie.union(e,n,e):e=ie.clone(n)}this._extent=e};fa.prototype.getAttributeNames=function(){let e=[];for(let t=0;t<this._attributeStatistics.length;++t)e.push(...this._attributeStatistics[t].names);return e};fa.prototype.getAttributeValues=function(e){for(let t=0;t<this._attributeStatistics.length;++t){let n=this._attributeStatistics[t]._getValues(e);if(l(n))return n}return[]};fa.prototype.filterByAttributes=function(e){let t=[];for(let n=0;n<this._layers.length;n++){let i=this._layers[n].filterByAttributes(e);t.push(i)}return Promise.all(t)};var gp=fa;var f8={};f8.createTilesetFromIModelId=async function({iModelId:e,changesetId:t,tilesetOptions:n}){let{exports:i}=await ua.getExports(e,t);if(i.length>0&&i.every(c=>c.status===ua.ExportStatus.Invalid))throw new oe(`All exports for this iModel are Invalid: ${e}`);let r=i.find(c=>c.status===ua.ExportStatus.Complete);if(!l(r))return;let o=new URL(r._links.mesh.href);o.pathname=`${o.pathname}/tileset.json`;let s=o.toString(),a=new De({url:s});return Yo.fromUrl(a,n)};f8.createTilesetForRealityDataId=async function({iTwinId:e,realityDataId:t,type:n,rootDocument:i,tilesetOptions:r}){if(!l(n)||!l(i)){let c=await ua.getRealityDataMetadata(e,t);i=c.rootDocument,n=c.type}if(![ua.RealityDataType.Cesium3DTiles,ua.RealityDataType.PNTS,ua.RealityDataType.RealityMesh3DTiles,ua.RealityDataType.Terrain3DTiles,ua.RealityDataType.GaussianSplat3DTiles].includes(n))throw new oe(`Reality data type is not a mesh type: ${n}`);let s=await ua.getRealityDataURL(e,t,i),a={maximumScreenSpaceError:4,...r};return Yo.fromUrl(s,a)};f8.createDataSourceForRealityDataId=async function({iTwinId:e,realityDataId:t,type:n,rootDocument:i}){if(!l(n)||!l(i)){let s=await ua.getRealityDataMetadata(e,t);i=s.rootDocument,n=s.type}if(![ua.RealityDataType.KML,ua.RealityDataType.GeoJSON].includes(n))throw new oe(`Reality data type is not a data source type: ${n}`);let o=await ua.getRealityDataURL(e,t,i);return n===ua.RealityDataType.GeoJSON?gb.load(o):JE.load(o)};f8.loadGeospatialFeatures=async function({iTwinId:e,collectionId:t,limit:n}){let i=n??1e4,r=`${ua.apiEndpoint}geospatial-features/itwins/${e}/ogc/collections/${t}/items`,o=new De({url:r,headers:{Authorization:ua._getAuthorizationHeader(),Accept:"application/vnd.bentley.itwin-platform.v1+json"},queryParameters:{limit:i,client:"CesiumJS"}});return gb.load(o)};var jce=f8;function Eke(){}Object.defineProperties(Eke.prototype,{color:{get:pe.throwInstantiationError},intensity:{get:pe.throwInstantiationError}});var Hce=Eke;var pGt=/\/$/,Cke=new It('© <a href="https://www.mapbox.com/about/maps/">Mapbox</a> © <a href="http://www.openstreetmap.org/copyright">OpenStreetMap</a> <strong><a href="https://www.mapbox.com/map-feedback/">Improve this map</a></strong>');function KP(e){e=e??H.EMPTY_OBJECT;let t=e.styleId,n=e.accessToken;this._defaultAlpha=void 0,this._defaultNightAlpha=void 0,this._defaultDayAlpha=void 0,this._defaultBrightness=void 0,this._defaultContrast=void 0,this._defaultHue=void 0,this._defaultSaturation=void 0,this._defaultGamma=void 0,this._defaultMinificationFilter=void 0,this._defaultMagnificationFilter=void 0;let i=De.createIfNeeded(e.url??"https://api.mapbox.com/styles/v1/");this._styleId=t,this._accessToken=n;let r=e.tilesize??512;this._tilesize=r;let o=e.username??"mapbox";this._username=o;let s=l(e.scaleFactor)?"@2x":"",a=i.getUrlComponent();pGt.test(a)||(a+="/"),a+=`${this._username}/${t}/tiles/${this._tilesize}/{z}/{x}/{y}${s}`,i.url=a,i.setQueryParameters({access_token:n});let c;l(e.credit)?(c=e.credit,typeof c=="string"&&(c=new It(c))):c=Cke,this._resource=i,this._imageryProvider=new vs({url:i,credit:c,ellipsoid:e.ellipsoid,minimumLevel:e.minimumLevel,maximumLevel:e.maximumLevel,rectangle:e.rectangle})}Object.defineProperties(KP.prototype,{url:{get:function(){return this._imageryProvider.url}},rectangle:{get:function(){return this._imageryProvider.rectangle}},tileWidth:{get:function(){return this._imageryProvider.tileWidth}},tileHeight:{get:function(){return this._imageryProvider.tileHeight}},maximumLevel:{get:function(){return this._imageryProvider.maximumLevel}},minimumLevel:{get:function(){return this._imageryProvider.minimumLevel}},tilingScheme:{get:function(){return this._imageryProvider.tilingScheme}},tileDiscardPolicy:{get:function(){return this._imageryProvider.tileDiscardPolicy}},errorEvent:{get:function(){return this._imageryProvider.errorEvent}},credit:{get:function(){return this._imageryProvider.credit}},proxy:{get:function(){return this._imageryProvider.proxy}},hasAlphaChannel:{get:function(){return this._imageryProvider.hasAlphaChannel}}});KP.prototype.getTileCredits=function(e,t,n){};KP.prototype.requestImage=function(e,t,n,i){return this._imageryProvider.requestImage(e,t,n,i)};KP.prototype.pickFeatures=function(e,t,n,i,r){return this._imageryProvider.pickFeatures(e,t,n,i,r)};KP._defaultCredit=Cke;var Gce=KP;var gGt=0,_Gt=14,yGt=-1e3,AGt=1e4,bGt=2*Math.PI*ee.WGS84.maximumRadius,xGt=256,TGt=new ie,EGt=new ie,Wce=class{constructor(t,n){n=n??{},this._resource=De.createIfNeeded(t),this._urlTemplate=this._resource.url,this._extent=ie.clone(n.extent),this._minZoom=n.minZoom??gGt,this._maxZoom=n.maxZoom??_Gt,this._featureIdProperty=n.featureIdProperty,this._heightReference=n.heightReference,this._scene=n.scene,this._show=!0,this._tileset=void 0,this._tilesetJsonUrl=void 0}static async fromUrl(t,n){let i=new this(t,n);return await i._initializeTileset(),i}get urlTemplate(){return this._urlTemplate}get resource(){return this._resource}get extent(){return this._extent}get tileset(){return this._tileset}get show(){return this._show}set show(t){this._show=t,l(this._tileset)&&(this._tileset.show=t)}_createRuntimeTilesetOptions(){return{minZoom:this._minZoom,maxZoom:this._maxZoom,extent:this._extent}}_createTilesetLoadOptions(){return{heightReference:this._heightReference,scene:this._scene}}_configureTileset(t){}_createCodec(){}async _initializeTileset(){let t=CGt(this._resource,this._createRuntimeTilesetOptions()),n=new Blob([JSON.stringify(t)],{type:"application/json"}),i=URL.createObjectURL(n);this._tilesetJsonUrl=i;try{this._tileset=await Yo.fromUrl(i,this._createTilesetLoadOptions())}catch(r){throw URL.revokeObjectURL(i),this._tilesetJsonUrl=void 0,r}URL.revokeObjectURL(i),this._tilesetJsonUrl=void 0,this._configureTileset(this._tileset),this._tileset._runtimeContentCodec=this._createCodec(),this._tileset.show=this._show}update(t){l(this._tileset)&&this._tileset.update(t)}prePassesUpdate(t){l(this._tileset)&&this._tileset.prePassesUpdate(t)}postPassesUpdate(t){l(this._tileset)&&this._tileset.postPassesUpdate(t)}updateForPass(t,n){l(this._tileset)&&this._tileset.updateForPass(t,n)}isDestroyed(){return!1}destroy(){return l(this._tileset)&&(this._tileset.destroy(),this._tileset=void 0),l(this._tilesetJsonUrl)&&(URL.revokeObjectURL(this._tilesetJsonUrl),this._tilesetJsonUrl=void 0),this._resource=void 0,this._extent=void 0,this._featureIdProperty=void 0,le(this)}};function CGt(e,t){let n=new Lo,i=l(t.extent)?ie.clone(t.extent):ie.clone(n.rectangle),r=SGt(n,i,t.minZoom),o={boundingVolume:{region:wke(i)},geometricError:Ske(0),refine:"REPLACE",children:[]};for(let s=r.minY;s<=r.maxY;s++)for(let a=r.minX;a<=r.maxX;a++){let c=vke(n,e,i,t.minZoom,t.maxZoom,a,s);l(c)&&o.children.push(c)}return o.children.length===0&&(o.geometricError=0),{asset:{version:"1.1"},geometricError:o.geometricError,root:o}}function vke(e,t,n,i,r,o,s){if(!wGt(e,i,o,s,n,TGt,EGt))return;let a=e.tileXYToRectangle(o,s,i,new ie),c={boundingVolume:{region:wke(a)},geometricError:i<r?Ske(i):0,refine:"REPLACE",content:{uri:vGt(t,i,o,s)}};if(i>=r)return c;let u=i+1,f=[];for(let d=s*2;d<=s*2+1;d++)for(let p=o*2;p<=o*2+1;p++){let g=vke(e,t,n,u,r,p,d);l(g)&&f.push(g)}return f.length>0?c.children=f:c.geometricError=0,c}function vGt(e,t,n,i){let o=e.url.replace(/\{z\}/gi,`${t}`).replace(/\{x\}/gi,`${n}`).replace(/\{y\}/gi,`${i}`);return vd(o)}function Ske(e){return bGt/((1<<e)*xGt)}function wke(e){return[e.west,e.south,e.east,e.north,yGt,AGt]}function SGt(e,t,n){let i=(1<<n)-1,r=he.fromRadians(t.west,t.north),o=he.fromRadians(t.east,t.south),s=e.positionToTileXY(r,n),a=e.positionToTileXY(o,n);return!l(s)||!l(a)||t.west>t.east?{minX:0,maxX:i,minY:0,maxY:i}:{minX:D.clamp(Math.min(s.x,a.x),0,i),maxX:D.clamp(Math.max(s.x,a.x),0,i),minY:D.clamp(Math.min(s.y,a.y),0,i),maxY:D.clamp(Math.max(s.y,a.y),0,i)}}function wGt(e,t,n,i,r,o,s){let a=e.tileXYToRectangle(n,i,t,o);return l(ie.intersection(a,r,s))}var d8=Wce;var $W=class extends d8{static async fromUrl(t,n){return super.fromUrl(t,n)}_createTilesetLoadOptions(){return{...super._createTilesetLoadOptions(),skipLevelOfDetail:!1,enablePick:!0,featureIdLabel:"featureId_0",instanceFeatureIdLabel:"instanceFeatureId_0"}}_configureTileset(t){t._modelUpAxis=Hi.Z,t._modelForwardAxis=Hi.X}_createCodec(){let t=this._featureIdProperty;return{contentType:"mvt",missingTilePolicy:{statusCodes:[404,204]},createContent:async(n,i,r,o)=>{let s=Z4(o),a=Ike(r.getUrlComponent(!0)),c=H4(s,a,{featureIdProperty:t});if(!l(c)){if(!IGt(s))return new n0(n,i);throw new oe("Decoded MVT tile did not produce vector glTF content.")}return FA.fromGltf(n,i,r,c)}}}};function Ike(e){let t=e.match(/\/(\d+)\/(\d+)\/(\d+)(?:\.[^/?#]+)?(?:[?#]|$)/i);return t?{tileZ:parseInt(t[1],10),tileX:parseInt(t[2],10),tileY:parseInt(t[3],10)}:(_t("MVTDataProvider.parseTileCoordinates",`MVT tile URL did not match /{z}/{x}/{y} pattern. Falling back to z/x/y = 0/0/0. URL: ${e}`),{tileZ:0,tileX:0,tileY:0})}function IGt(e){let t=e.layers;for(let n=0;n<t.length;n++)if(t[n].features.length>0)return!0;return!1}$W._parseTileCoordinates=Ike;var qce=$W;function Yce(e){}Yce.prototype.isReady=function(){return!0};Yce.prototype.shouldDiscardImage=function(e){return!1};var Xce=Yce;var PGt=new It("MapQuest, Open Street Map and contributors, CC-BY-SA");function JW(e){e=e??H.EMPTY_OBJECT;let t=De.createIfNeeded(e.url??"https://tile.openstreetmap.org/");t.appendForwardSlash(),t.url+=`{z}/{x}/{y}${e.retinaTiles?"@2x":""}.${e.fileExtension??"png"}`;let n=new Lo({ellipsoid:e.ellipsoid}),i=256,r=256,o=e.minimumLevel??0,s=e.maximumLevel,a=e.rectangle??n.rectangle,c=n.positionToTileXY(ie.southwest(a),o),u=n.positionToTileXY(ie.northeast(a),o),f=(Math.abs(u.x-c.x)+1)*(Math.abs(u.y-c.y)+1),d=e.credit??PGt;typeof d=="string"&&(d=new It(d)),vs.call(this,{url:t,credit:d,tilingScheme:n,tileWidth:i,tileHeight:r,minimumLevel:o,maximumLevel:s,rectangle:a})}l(Object.create)&&(JW.prototype=Object.create(vs.prototype),JW.prototype.constructor=JW);var xy=JW;function Pke(){pe.throwInstantiationError()}Object.defineProperties(Pke.prototype,{show:{get:pe.throwInstantiationError,set:pe.throwInstantiationError},transform:{get:pe.throwInstantiationError},credit:{get:pe.throwInstantiationError}});var Kce=Pke;function ZW(){pe.throwInstantiationError()}Object.defineProperties(ZW.prototype,{});ZW.fromUrl=function(e){pe.throwInstantiationError()};ZW.prototype.loadPanorama=function(e){pe.throwInstantiationError()};var $ce=ZW;var DGt=new U(1,1);function Jce(e){e=e??H.EMPTY_OBJECT,this.mass=e.mass??1,this.position=h.clone(e.position??h.ZERO),this.velocity=h.clone(e.velocity??h.ZERO),this.life=e.life??Number.MAX_VALUE,this.image=e.image,this.startColor=z.clone(e.startColor??z.WHITE),this.endColor=z.clone(e.endColor??z.WHITE),this.startScale=e.startScale??1,this.endScale=e.endScale??1,this.imageSize=U.clone(e.imageSize??DGt),this._age=0,this._normalizedAge=0,this._billboard=void 0}Object.defineProperties(Jce.prototype,{age:{get:function(){return this._age}},normalizedAge:{get:function(){return this._normalizedAge}}});var Dke=new h;Jce.prototype.update=function(e,t){return h.multiplyByScalar(this.velocity,e,Dke),h.add(this.position,Dke,this.position),l(t)&&t(this,e),this._age+=e,this.life===Number.MAX_VALUE?this._normalizedAge=0:this._normalizedAge=this._age/this.life,this._age<=this.life};var $P=Jce;function Rke(e){e=e??H.EMPTY_OBJECT,this.time=e.time??0,this.minimum=e.minimum??0,this.maximum=e.maximum??50,this._complete=!1}Object.defineProperties(Rke.prototype,{complete:{get:function(){return this._complete}}});var Zce=Rke;function Oke(e){}Oke.prototype.emit=function(e){pe.throwInstantiationError()};var Qce=Oke;var Mke=new U(1,1);function h8(e){e=e??H.EMPTY_OBJECT,this.show=e.show??!0,this.updateCallback=e.updateCallback,this.loop=e.loop??!0,this.image=e.image??void 0;let t=e.emitter;l(t)||(t=new Y4(.5)),this._emitter=t,this._bursts=e.bursts,this._modelMatrix=N.clone(e.modelMatrix??N.IDENTITY),this._emitterModelMatrix=N.clone(e.emitterModelMatrix??N.IDENTITY),this._matrixDirty=!0,this._combinedMatrix=new N,this._startColor=z.clone(e.color??e.startColor??z.WHITE),this._endColor=z.clone(e.color??e.endColor??z.WHITE),this._startScale=e.scale??e.startScale??1,this._endScale=e.scale??e.endScale??1,this._emissionRate=e.emissionRate??5,this._minimumSpeed=e.speed??e.minimumSpeed??1,this._maximumSpeed=e.speed??e.maximumSpeed??1,this._minimumParticleLife=e.particleLife??e.minimumParticleLife??5,this._maximumParticleLife=e.particleLife??e.maximumParticleLife??5,this._minimumMass=e.mass??e.minimumMass??1,this._maximumMass=e.mass??e.maximumMass??1,this._minimumImageSize=U.clone(e.imageSize??e.minimumImageSize??Mke),this._maximumImageSize=U.clone(e.imageSize??e.maximumImageSize??Mke),this._sizeInMeters=e.sizeInMeters??!1,this._lifetime=e.lifetime??Number.MAX_VALUE,this._billboardCollection=void 0,this._particles=[],this._particlePool=[],this._previousTime=void 0,this._currentTime=0,this._carryOver=0,this._complete=new be,this._isComplete=!1,this._updateParticlePool=!0,this._particleEstimate=0}Object.defineProperties(h8.prototype,{emitter:{get:function(){return this._emitter},set:function(e){this._emitter=e}},bursts:{get:function(){return this._bursts},set:function(e){this._bursts=e,this._updateParticlePool=!0}},modelMatrix:{get:function(){return this._modelMatrix},set:function(e){this._matrixDirty=this._matrixDirty||!N.equals(this._modelMatrix,e),N.clone(e,this._modelMatrix)}},emitterModelMatrix:{get:function(){return this._emitterModelMatrix},set:function(e){this._matrixDirty=this._matrixDirty||!N.equals(this._emitterModelMatrix,e),N.clone(e,this._emitterModelMatrix)}},startColor:{get:function(){return this._startColor},set:function(e){z.clone(e,this._startColor)}},endColor:{get:function(){return this._endColor},set:function(e){z.clone(e,this._endColor)}},startScale:{get:function(){return this._startScale},set:function(e){this._startScale=e}},endScale:{get:function(){return this._endScale},set:function(e){this._endScale=e}},emissionRate:{get:function(){return this._emissionRate},set:function(e){this._emissionRate=e,this._updateParticlePool=!0}},minimumSpeed:{get:function(){return this._minimumSpeed},set:function(e){this._minimumSpeed=e}},maximumSpeed:{get:function(){return this._maximumSpeed},set:function(e){this._maximumSpeed=e}},minimumParticleLife:{get:function(){return this._minimumParticleLife},set:function(e){this._minimumParticleLife=e}},maximumParticleLife:{get:function(){return this._maximumParticleLife},set:function(e){this._maximumParticleLife=e,this._updateParticlePool=!0}},minimumMass:{get:function(){return this._minimumMass},set:function(e){this._minimumMass=e}},maximumMass:{get:function(){return this._maximumMass},set:function(e){this._maximumMass=e}},minimumImageSize:{get:function(){return this._minimumImageSize},set:function(e){this._minimumImageSize=e}},maximumImageSize:{get:function(){return this._maximumImageSize},set:function(e){this._maximumImageSize=e}},sizeInMeters:{get:function(){return this._sizeInMeters},set:function(e){this._sizeInMeters=e}},lifetime:{get:function(){return this._lifetime},set:function(e){this._lifetime=e}},complete:{get:function(){return this._complete}},isComplete:{get:function(){return this._isComplete}}});function RGt(e){let t=e._emissionRate,n=e._maximumParticleLife,i=0,r=e._bursts;if(l(r)){let d=r.length;for(let p=0;p<d;++p)i+=r[p].maximum}let o=e._billboardCollection,s=e.image,a=Math.ceil(t*n+i),c=e._particles,u=e._particlePool,f=Math.max(a-c.length-u.length,0);for(let d=0;d<f;++d){let p=new $P;p._billboard=o.add({image:s,show:!1}),u.push(p)}e._particleEstimate=a}function OGt(e){let t=e._particlePool.pop();return l(t)||(t=new $P),t}function MGt(e,t){e._particlePool.push(t)}function NGt(e){let t=e._particles,n=e._particlePool,i=e._billboardCollection,r=t.length,o=n.length,s=e._particleEstimate,a=o-Math.max(s-r-o,0);for(let c=a;c<o;++c){let u=n[c];i.remove(u._billboard)}n.length=a}function LGt(e){l(e._billboard)&&(e._billboard.show=!1)}function Nke(e,t){let n=t._billboard;l(n)||(n=t._billboard=e._billboardCollection.add({image:t.image})),n.width=t.imageSize.x,n.height=t.imageSize.y,n.position=t.position,n.sizeInMeters=e.sizeInMeters,n.show=!0;let i=D.lerp(t.startColor.red,t.endColor.red,t.normalizedAge),r=D.lerp(t.startColor.green,t.endColor.green,t.normalizedAge),o=D.lerp(t.startColor.blue,t.endColor.blue,t.normalizedAge),s=D.lerp(t.startColor.alpha,t.endColor.alpha,t.normalizedAge);n.color=new z(i,r,o,s),n.scale=D.lerp(t.startScale,t.endScale,t.normalizedAge)}function FGt(e,t){t.startColor=z.clone(e._startColor,t.startColor),t.endColor=z.clone(e._endColor,t.endColor),t.startScale=e._startScale,t.endScale=e._endScale,t.image=e.image,t.life=D.randomBetween(e._minimumParticleLife,e._maximumParticleLife),t.mass=D.randomBetween(e._minimumMass,e._maximumMass),t.imageSize.x=D.randomBetween(e._minimumImageSize.x,e._maximumImageSize.x),t.imageSize.y=D.randomBetween(e._minimumImageSize.y,e._maximumImageSize.y),t._normalizedAge=0,t._age=0;let n=D.randomBetween(e._minimumSpeed,e._maximumSpeed);h.multiplyByScalar(t.velocity,n,t.velocity),e._particles.push(t)}function BGt(e,t){if(e._isComplete)return 0;t=D.mod(t,e._lifetime);let n=t*e._emissionRate,i=Math.floor(n);if(e._carryOver+=n-i,e._carryOver>1&&(i++,e._carryOver-=1),l(e.bursts)){let r=e.bursts.length;for(let o=0;o<r;o++){let s=e.bursts[o],a=e._currentTime;l(s)&&!s._complete&&a>s.time&&(i+=D.randomBetween(s.minimum,s.maximum),s._complete=!0)}}return i}var QW=new h;h8.prototype.update=function(e){if(!this.show)return;l(this._billboardCollection)||(this._billboardCollection=new Wf),this._updateParticlePool&&(RGt(this),this._updateParticlePool=!1);let t=0;this._previousTime&&(t=K.secondsDifference(e.time,this._previousTime)),t<0&&(t=0);let n=this._particles,i=this._emitter,r=this.updateCallback,o,s,a=n.length;for(o=0;o<a;++o)s=n[o],s.update(t,r)?Nke(this,s):(LGt(s),MGt(this,s),n[o]=n[a-1],--o,--a);n.length=a;let c=BGt(this,t);if(c>0&&l(i)){this._matrixDirty&&(this._combinedMatrix=N.multiply(this.modelMatrix,this.emitterModelMatrix,this._combinedMatrix),this._matrixDirty=!1);let u=this._combinedMatrix;for(o=0;o<c;o++)s=OGt(this),this._emitter.emit(s),h.add(s.position,s.velocity,QW),N.multiplyByPoint(u,QW,QW),s.position=N.multiplyByPoint(u,s.position,s.position),h.subtract(QW,s.position,s.velocity),h.normalize(s.velocity,s.velocity),FGt(this,s),Nke(this,s)}if(this._billboardCollection.update(e),this._previousTime=K.clone(e.time,this._previousTime),this._currentTime+=t,this._lifetime!==Number.MAX_VALUE&&this._currentTime>this._lifetime)if(this.loop){if(this._currentTime=D.mod(this._currentTime,this._lifetime),this.bursts){let u=this.bursts.length;for(o=0;o<u;o++)this.bursts[o]._complete=!1}}else this._isComplete=!0,this._complete.raiseEvent(this);e.frameNumber%120===0&&NGt(this)};h8.prototype.isDestroyed=function(){return!1};h8.prototype.destroy=function(){return this._billboardCollection=this._billboardCollection&&this._billboardCollection.destroy(),le(this)};var ele=h8;var tle=class{constructor(){ut(this,"quadtree");ut(this,"tilingScheme");ut(this,"errorEvent");pe.throwInstantiationError()}static computeDefaultLevelZeroMaximumGeometricError(t){return t.ellipsoid.maximumRadius*2*Math.PI*.25/(65*t.getNumberOfXTilesAtLevel(0))}update(t,n){pe.throwInstantiationError()}beginUpdate(t,n,i){pe.throwInstantiationError()}endUpdate(t,n,i){pe.throwInstantiationError()}getLevelMaximumGeometricError(t){pe.throwInstantiationError()}loadTile(t,n,i){pe.throwInstantiationError()}computeTileVisibility(t,n,i){pe.throwInstantiationError()}showTileThisFrame(t,n,i,r){pe.throwInstantiationError()}computeDistanceToTile(t,n){pe.throwInstantiationError()}isDestroyed(){pe.throwInstantiationError()}destroy(){pe.throwInstantiationError()}},nle=tle;function ile(e){e=e??1,this._radius=e??1}Object.defineProperties(ile.prototype,{radius:{get:function(){return this._radius},set:function(e){this._radius=e}}});ile.prototype.emit=function(e){let t=D.randomBetween(0,D.TWO_PI),n=D.randomBetween(0,D.PI),i=D.randomBetween(0,this._radius),r=i*Math.cos(t)*Math.sin(n),o=i*Math.sin(t)*Math.sin(n),s=i*Math.cos(n);e.position=h.fromElements(r,o,s,e.position),e.velocity=h.normalize(e.position,e.velocity)};var rle=ile;function m8(){}m8.prototype.evaluate=function(e,t){pe.throwInstantiationError()};m8.prototype.evaluateColor=function(e,t){pe.throwInstantiationError()};m8.prototype.getShaderFunction=function(e,t,n,i){pe.throwInstantiationError()};m8.prototype.getVariables=function(){pe.throwInstantiationError()};var ole=m8;function JP(e){this._ready=!1,this._provider=void 0,this._errorEvent=new be,this._readyEvent=new be,UGt(this,e)}Object.defineProperties(JP.prototype,{errorEvent:{get:function(){return this._errorEvent}},readyEvent:{get:function(){return this._readyEvent}},ready:{get:function(){return this._ready}},provider:{get:function(){return this._provider}}});JP.fromWorldTerrain=function(e){return new JP(UC(e))};JP.fromWorldBathymetry=function(e){return new JP(N4(e))};function kGt(e,t){e.numberOfListeners>0?e.raiseEvent(t):console.error(t)}async function UGt(e,t){let n;try{n=await Promise.resolve(t),e._provider=n,e._ready=!0,e._readyEvent.raiseEvent(n)}catch(i){kGt(e._errorEvent,i)}}var p8=JP;function ZP(){}ZP.prototype.boundingVolume=void 0;ZP.prototype.boundingSphere=void 0;ZP.prototype.distanceToCamera=function(e){pe.throwInstantiationError()};ZP.prototype.intersectPlane=function(e){pe.throwInstantiationError()};ZP.prototype.createDebugVolume=function(e){pe.throwInstantiationError()};var sle=ZP;function g8(e){e=e??H.EMPTY_OBJECT,this._tilingScheme=l(e.tilingScheme)?e.tilingScheme:new er({ellipsoid:e.ellipsoid}),this._color=e.color??z.YELLOW,this._errorEvent=new be,this._tileWidth=e.tileWidth??256,this._tileHeight=e.tileHeight??256,this._defaultAlpha=void 0,this._defaultNightAlpha=void 0,this._defaultDayAlpha=void 0,this._defaultBrightness=void 0,this._defaultContrast=void 0,this._defaultHue=void 0,this._defaultSaturation=void 0,this._defaultGamma=void 0,this._defaultMinificationFilter=void 0,this._defaultMagnificationFilter=void 0}Object.defineProperties(g8.prototype,{proxy:{get:function(){}},tileWidth:{get:function(){return this._tileWidth}},tileHeight:{get:function(){return this._tileHeight}},maximumLevel:{get:function(){}},minimumLevel:{get:function(){}},tilingScheme:{get:function(){return this._tilingScheme}},rectangle:{get:function(){return this._tilingScheme.rectangle}},tileDiscardPolicy:{get:function(){}},errorEvent:{get:function(){return this._errorEvent}},credit:{get:function(){}},hasAlphaChannel:{get:function(){return!0}}});g8.prototype.getTileCredits=function(e,t,n){};g8.prototype.requestImage=function(e,t,n,i){let r=document.createElement("canvas");r.width=256,r.height=256;let o=r.getContext("2d"),s=this._color.toCssColorString();return o.strokeStyle=s,o.lineWidth=2,o.strokeRect(1,1,255,255),o.font="bold 25px Arial",o.textAlign="center",o.fillStyle=s,o.fillText(`L: ${n}`,124,86),o.fillText(`X: ${e}`,124,136),o.fillText(`Y: ${t}`,124,186),Promise.resolve(r)};g8.prototype.pickFeatures=function(e,t,n,i,r){};var _8=g8;function ale(e){pe.throwInstantiationError()}ale.prototype.isReady=pe.throwInstantiationError;ale.prototype.shouldDiscardImage=pe.throwInstantiationError;var cle=ale;var Lke={START:0,LOADING:1,READY:2,UPSAMPLED_ONLY:3};Object.freeze(Lke);var lle=Lke;function eq(e,t){this.show=!0,l(e)||(e=new et),this.rectangle=et.clone(e),l(t)||(t=Qi.fromType(Qi.ColorType,{color:new z(1,1,1,1)})),this.material=t,this._material=void 0,this._overlayCommand=void 0,this._rs=void 0}eq.prototype.update=function(e){if(!this.show)return;let t=this._rs;if((!l(t)||!et.equals(t.viewport,this.rectangle))&&(this._rs=Ge.fromCache({blending:tn.ALPHA_BLEND,viewport:this.rectangle})),e.passes.render){let i=e.context;if(this._material!==this.material||!l(this._overlayCommand)){this._material=this.material,l(this._overlayCommand)&&this._overlayCommand.shaderProgram.destroy();let r=new Ye({sources:[this._material.shaderSource,PM]});this._overlayCommand=i.createViewportQuadCommand(r,{renderState:this._rs,uniformMap:this._material._uniforms,owner:this}),this._overlayCommand.pass=Ie.OVERLAY}this._material.update(i),this._overlayCommand.renderState=this._rs,this._overlayCommand.uniformMap=this._material._uniforms,e.commandList.push(this._overlayCommand)}};eq.prototype.isDestroyed=function(){return!1};eq.prototype.destroy=function(){return l(this._overlayCommand)&&(this._overlayCommand.shaderProgram=this._overlayCommand.shaderProgram&&this._overlayCommand.shaderProgram.destroy()),le(this)};var ule=eq;var fle=class{constructor(){ut(this,"globalTransform");ut(this,"shapeTransform");ut(this,"shape");ut(this,"minBounds");ut(this,"maxBounds");ut(this,"dimensions");ut(this,"paddingBefore");ut(this,"paddingAfter");ut(this,"names");ut(this,"types");ut(this,"componentTypes");ut(this,"minimumValues");ut(this,"maximumValues");ut(this,"maximumTileCount");ut(this,"availableLevels");ut(this,"keyframeCount");ut(this,"timeIntervalCollection");pe.throwInstantiationError()}requestData(t){pe.throwInstantiationError()}},dle=fle;function Ty(){pe.throwInstantiationError()}Object.defineProperties(Ty.prototype,{orientedBoundingBox:{get:pe.throwInstantiationError},boundingSphere:{get:pe.throwInstantiationError},boundTransform:{get:pe.throwInstantiationError},shapeTransform:{get:pe.throwInstantiationError},shaderUniforms:{get:pe.throwInstantiationError},shaderDefines:{get:pe.throwInstantiationError},shaderMaximumIntersectionsLength:{get:pe.throwInstantiationError}});Ty.prototype.update=pe.throwInstantiationError;Ty.prototype.updateViewTransforms=pe.throwInstantiationError;Ty.prototype.convertLocalToShapeUvSpace=pe.throwInstantiationError;Ty.prototype.computeOrientedBoundingBoxForTile=pe.throwInstantiationError;Ty.prototype.computeOrientedBoundingBoxForSample=pe.throwInstantiationError;Ty.DefaultMinBounds=pe.throwInstantiationError;Ty.DefaultMaxBounds=pe.throwInstantiationError;var hle=Ty;var mle=`uniform sampler2D u_depthTexture; +`;var tae=`uniform sampler2D u_depthTexture; in vec2 v_textureCoordinates; void main() { @@ -12729,8 +12701,36 @@ float z_ndc = (2.0 * z_window - n_range - f_range) / (f_range - n_range); float scale = pow(z_ndc * 0.5 + 0.5, 8.0); out_FragColor = vec4(mix(vec3(0.0), vec3(1.0), scale), 1.0); } -`;var ple=class{get enabled(){return pe.throwInstantiationError()}set enabled(t){pe.throwInstantiationError()}connectedCallback(t){pe.throwInstantiationError()}disconnectedCallback(t){pe.throwInstantiationError()}update(t,n){pe.throwInstantiationError()}firstUpdate(t,n){pe.throwInstantiationError()}},gle=ple;var Fke=new h,zGt=new sn(h.UNIT_X,0),VGt=new pn,jGt=new U(1,1,1);function _p(e,t,n,i=jGt){let{camera:r,ellipsoid:o}=e,s=o.scaleToGeodeticSurface(r.positionWC,Fke);if(!l(s))return;let a=h.magnitude(r.positionWC),c=h.magnitude(s),u=a<=c,f=o.geodeticSurfaceNormal(r.positionWC,Fke),d=h.dot(f,r.directionWC),p=d>0;if(u||p){let g=sn.fromPointNormal(r.positionWC,f,zGt),{clientHeight:m}=e.canvas,y=i.y*m/(2*Math.tan(r.frustum.fovy*.5));g.distance-=d*y;let A=r.getPickRay(t,VGt);return _i.rayPlane(A,g,n)}return r.pickEllipsoid(t,o,n)}var Bke={LEFT:0,MIDDLE:1,RIGHT:2};Object.freeze(Bke);var ec=Bke;function HGt(e){if(e===ec.LEFT)return un.LEFT_DOWN;if(e===ec.MIDDLE)return un.MIDDLE_DOWN;if(e===ec.RIGHT)return un.RIGHT_DOWN}function GGt(e){if(e===ec.LEFT)return un.LEFT_UP;if(e===ec.MIDDLE)return un.MIDDLE_UP;if(e===ec.RIGHT)return un.RIGHT_UP}var _le=class{static registerDragInputBindings(t,n,i){let r=new Set,o={isDragging:!1};for(let s of n){o.isDragging=!1;let a=HGt(s.button),c=GGt(s.button);l(a)&&t.setInputAction((...u)=>{o.isDragging=!0,l(i.start)&&i.start(...u)},a,s.modifier),l(c)&&(t.setInputAction((...u)=>{o.isDragging&&(o.isDragging=!1,l(i.end)&&i.end(...u))},c,s.modifier),t.setInputAction((...u)=>{o.isDragging&&(o.isDragging=!1,l(i.end)&&i.end(...u))},c)),r.add(s.modifier)}for(let s of r)t.setInputAction((...a)=>{o.isDragging&&l(i.change)&&i.change(...a)},un.MOUSE_MOVE,s);return o}},yp=_le;var yle=class e{static _getDefaultDragInputs(){return[Object.freeze({button:ec.LEFT})]}constructor(t=H.EMPTY_OBJECT){this._enabled=!0,this._handler=void 0,this._lastUpdateTime=void 0,this.dragInputs=t.dragInputs??e._getDefaultDragInputs(),this._dragInputState=void 0,this._panDelta=new U,this._panPosition=new U,this.pickWorldPosition=_p,this._ellipsoidNormal=new h,this._ellipsoidSurfacePosition=new h,this._panDirectionX=new h,this._panDirectionY=new h,this._pixelSize=new U,this._panVelocity=new U,this.panSpeed=1,this.inertiaEnabled=!0,this.inertialDecay=6,this.maximumMovementRatio=.1}get enabled(){return this._enabled}set enabled(t){this._enabled=t,t?(this._lastUpdateTime=xn(),this._panDelta.x=0,this._panDelta.y=0):l(this._dragInputState)&&(this._dragInputState.isDragging=!1)}get isDragging(){return l(this._dragInputState)&&this._dragInputState.isDragging}connectedCallback(t){let n=new ca(t);this._handler=n,this._dragInputState=yp.registerDragInputBindings(n,this.dragInputs,{start:this._handleStartPan.bind(this),change:this._handlePan.bind(this)})}disconnectedCallback(t){let n=this._handler;l(n)&&!n.isDestroyed()&&n.destroy()}firstUpdate(){this._lastUpdateTime=xn(),this._panDelta.x=0,this._panDelta.y=0}update(t){let n=(xn()-this._lastUpdateTime)*kn.SECONDS_PER_MILLISECOND,{camera:i,ellipsoid:r,canvas:o}=t,s=-this._panDelta.x,a=this._panDelta.y;if(this.inertiaEnabled&&!this.isDragging){let E=Math.exp(-this.inertialDecay*n);this._panVelocity.x*=E,this._panVelocity.y*=E,s=this._panVelocity.x*n,a=this._panVelocity.y*n}let{clientWidth:c,clientHeight:u}=o;if(n===0||c===0||u===0||Math.abs(s)<=D.EPSILON3&&Math.abs(a)<=D.EPSILON3){this._lastUpdateTime=xn(),this._panDelta.x=0,this._panDelta.y=0;return}let f=this._panPosition,d=this.pickWorldPosition(t,f,this._ellipsoidSurfacePosition);l(d)||(d=r.scaleToGeodeticSurface(i.positionWC,this._ellipsoidSurfacePosition));let p=h.clone(i.rightWC,this._panDirectionX);p=h.normalize(p,this._panDirectionX);let g=h.normalize(d,this._panDirectionY),m=h.distance(i.positionWC,d),{drawingBufferWidth:y,drawingBufferHeight:A,pixelRatio:b}=t,x=i.frustum.getPixelDimensions(y,A,m,b,this._pixelSize),T=this.maximumMovementRatio*Math.max(c,u);s=D.clamp(s,-T,T),this._panVelocity.x=s/n,s*=this.panSpeed*x.x,a=D.clamp(a,-T,T),this._panVelocity.y=a/n,a*=this.panSpeed*x.y,i.move(p,s),i.move(g,a),this._lastUpdateTime=xn(),this._panDelta.x=0,this._panDelta.y=0}_handleStartPan(){this.enabled&&(this._panDelta.x=0,this._panDelta.y=0)}_handlePan(t){this._panDelta.x+=t.endPosition.x-t.startPosition.x,this._panDelta.y+=t.endPosition.y-t.startPosition.y,this._panPosition.x=t.endPosition.x,this._panPosition.y=t.endPosition.y}},y8=yle;var Ale=class e{static _getDefaultDragInputs(){return[Object.freeze({button:ec.LEFT})]}constructor(t=H.EMPTY_OBJECT){this._enabled=!0,this._handler=void 0,this._lastUpdateTime=void 0,this.dragInputs=t.dragInputs??e._getDefaultDragInputs(),this._dragInputState=void 0,this._panDelta=new U,this._panPosition=new U,this.pickWorldPosition=_p,this._ellipsoidNormal=new h,this._ellipsoidSurfacePosition=new h,this._panDirectionX=new h,this._panDirectionY=new h,this._pixelSize=new U,this._panVelocity=new U,this.panSpeed=1,this.inertiaEnabled=!0,this.inertialDecay=6,this.maximumMovementRatio=.1}get enabled(){return this._enabled}set enabled(t){this._enabled=t,t?(this._panDelta.x=0,this._panDelta.y=0):l(this._dragInputState)&&(this._dragInputState.isDragging=!1)}get isDragging(){return l(this._dragInputState)&&this._dragInputState.isDragging}connectedCallback(t){let n=new ca(t);this._handler=n,this._dragInputState=yp.registerDragInputBindings(n,this.dragInputs,{start:this._handleStartPan.bind(this),change:this._handlePan.bind(this)})}disconnectedCallback(t){let n=this._handler;l(n)&&!n.isDestroyed()&&n.destroy()}firstUpdate(){this._lastUpdateTime=xn(),this._panDelta.x=0,this._panDelta.y=0}update(t){let n=(xn()-this._lastUpdateTime)*kn.SECONDS_PER_MILLISECOND,i=-this._panDelta.x,r=this._panDelta.y;if(this.inertiaEnabled&&!this.isDragging){let S=Math.exp(-this.inertialDecay*n);this._panVelocity.x*=S,this._panVelocity.y*=S,i=this._panVelocity.x*n,r=this._panVelocity.y*n}let{camera:o,ellipsoid:s,canvas:a}=t,{clientWidth:c,clientHeight:u}=a;if(n===0||c===0||u===0||Math.abs(i)<=D.EPSILON3&&Math.abs(r)<=D.EPSILON3){this._lastUpdateTime=xn(),this._panDelta.x=0,this._panDelta.y=0;return}let f=this._panPosition,d=this.pickWorldPosition(t,f,this._ellipsoidSurfacePosition);l(d)||(d=s.scaleToGeodeticSurface(o.positionWC,this._ellipsoidSurfacePosition));let p=s.geodeticSurfaceNormal(d,this._ellipsoidNormal),g=h.clone(o.rightWC,this._panDirectionX);g=h.normalize(g,this._panDirectionX);let m=h.clone(o.upWC,this._panDirectionY),y=Math.abs(h.dot(p,o.directionWC));D.lessThan(y,1,D.EPSILON6)&&(m=h.cross(p,g,this._panDirectionY)),m=h.normalize(m,this._panDirectionY);let A=h.distance(o.positionWC,d),{drawingBufferWidth:b,drawingBufferHeight:x,pixelRatio:T}=t,E=o.frustum.getPixelDimensions(b,x,A,T,this._pixelSize),v=this.maximumMovementRatio*Math.max(c,u);i=D.clamp(i,-v,v),this._panVelocity.x=i/n,i*=this.panSpeed*E.x,r=D.clamp(r,-v,v),this._panVelocity.y=r/n,r*=this.panSpeed*E.y,o.move(g,i),o.move(m,r),this._lastUpdateTime=xn(),this._panDelta.x=0,this._panDelta.y=0}_handleStartPan(t){this.enabled&&(this._panDelta.x=0,this._panDelta.y=0)}_handlePan(t){this._panDelta.x+=t.endPosition.x-t.startPosition.x,this._panDelta.y+=t.endPosition.y-t.startPosition.y,this._panPosition.x=t.endPosition.x,this._panPosition.y=t.endPosition.y}},A8=Ale;var ble=class{constructor(){this._elevatorController=new y8,this._mapController=new A8,this._enabled=!0,this._ellipsoidNormal=new h,this.angleThreshold=D.toRadians(125)}get enabled(){return this._enabled}set enabled(t){this._enabled=t}get elevatorController(){return this._elevatorController}get mapController(){return this._mapController}connectedCallback(t){this._elevatorController.connectedCallback(t),this._mapController.connectedCallback(t)}disconnectedCallback(t){this._elevatorController.disconnectedCallback(t),this._mapController.disconnectedCallback(t)}firstUpdate(){this._elevatorController.firstUpdate(),this._mapController.firstUpdate()}update(t){let n=t.camera,i=t.ellipsoid.geodeticSurfaceNormal(n.positionWC,this._ellipsoidNormal),r=Math.abs(h.angleBetween(i,n.directionWC));(r<this.angleThreshold&&r>Math.PI-this.angleThreshold?this._elevatorController:this._mapController).update(t)}},xle=ble;var Tle=class e{static _getDefaultDragInputs(){return[Object.freeze({button:ec.LEFT,modifier:to.CTRL}),Object.freeze({button:ec.RIGHT})]}constructor(t=H.EMPTY_OBJECT){this._enabled=!0,this._handler=void 0,this._lastUpdateTime=void 0,this.tiltEnabled=!0,this.orbitEnabled=!0,this.useDragPosition=!1,this.dragInputs=t.dragInputs??e._getDefaultDragInputs(),this._dragInputState=void 0,this._dragDelta=new U,this._screenSpaceDragPosition=new U,this._screenSpaceOrigin=new U,this.pickWorldPosition=_p,this._hasTarget=!1,this._target=new h,this._axis=new h,this.tiltMagnitude=2,this.dampingEnabled=!0,this.tiltAnimationDuration=.0045,this.maximumTiltVelocity=D.PI,this.minimumTiltVelocity=D.EPSILON20,this.orbitMagnitude=2,this.orbitAnimationDuration=.0045,this.maximumOrbitVelocity=D.TWO_PI,this.minimumOrbitVelocity=D.EPSILON20,this._tiltAxis=new h,this._tiltQuaternion=new Le,this._tiltOffset=new h,this._tiltOrigin=new h,this._tiltDampenedResults={velocity:0,value:0},this._orbitTargetEnu=new N,this._orbitTargetEast=new h,this._orbitQuaternion=new Le,this._orbitOffset=new h,this._orbitLookOffset=new h,this._orbitOrigin=new h,this._orbitDampenedResults={velocity:0,value:0},this.maximumMovementRatio=.1}get enabled(){return this._enabled}set enabled(t){this._enabled=t,t?(this._lastUpdateTime=xn(),this._dragDelta.x=0,this._dragDelta.y=0):l(this._dragInputState)&&(this._dragInputState.isDragging=!1)}get isDragging(){return l(this._dragInputState)&&this._dragInputState.isDragging}connectedCallback(t){let n=new ca(t);this._handler=n,this._dragInputState=yp.registerDragInputBindings(n,this.dragInputs,{start:this._handleStartDrag.bind(this),change:this._handleDrag.bind(this)})}disconnectedCallback(t){let n=this._handler;l(n)&&!n.isDestroyed()&&n.destroy()}firstUpdate(){this._lastUpdateTime=xn(),this._dragDelta.x=0,this._dragDelta.y=0}_handleStartDrag(t){this.enabled&&(this._hasTarget=!1,this._screenSpaceDragPosition.x=t.position.x,this._screenSpaceDragPosition.y=t.position.y,this._dragDelta.x=0,this._dragDelta.y=0)}_handleDrag(t){this._dragDelta.x+=t.endPosition.x-t.startPosition.x,this._dragDelta.y+=t.endPosition.y-t.startPosition.y}get tiltAngle(){return this._tiltDampenedResults.value}get tiltVelocity(){return this._tiltDampenedResults.velocity}set tiltVelocity(t){this._tiltDampenedResults.velocity=t}get orbitAngle(){return this._orbitDampenedResults.value}get orbitVelocity(){return this._orbitDampenedResults.velocity}set orbitVelocity(t){this._orbitDampenedResults.velocity=t}orbit(t,n,i,r,o,s=ee.default){let a=At.eastNorthUpToFixedFrame(n,s,this._orbitTargetEnu),c=N.multiplyByPointAsVector(a,h.UNIT_X,this._orbitTargetEast),u=h.angleBetween(t.directionWC,c);if(Math.abs(this.orbitVelocity)<this.minimumOrbitVelocity&&(this.orbitVelocity=0),!this.isDragging&&this.dampingEnabled&&(r+=this.orbitVelocity*o),r===0)return;let f=u+r,d=this.dampingEnabled?this.maximumOrbitVelocity*this.orbitMagnitude:void 0,p=this.dampingEnabled?this.orbitAnimationDuration:void 0;this._orbitDampenedResults=D.smoothDamp(u,f,this.orbitVelocity,o,d,p,this._orbitDampenedResults);let g=this.orbitAngle-u,m=$.fromQuaternion(Le.fromAxisAngle(i,-g,this._orbitQuaternion)),y=h.subtract(t.positionWC,n,this._orbitOffset),A=h.dot(y,t.directionWC),b=h.multiplyByScalar(t.directionWC,A,this._orbitLookOffset),x=h.subtract(y,b,this._orbitLookOffset),T=$.multiplyByVector(m,y,this._orbitOffset),E=$.multiplyByVector(m,x,this._orbitLookOffset);h.add(n,T,t.position);let v=h.add(n,E,this._orbitOrigin);t.lookAtWorldPosition(v,s)}tilt(t,n,i,r,o,s=ee.default){if(Math.abs(this.tiltVelocity)<this.minimumTiltVelocity&&(this.tiltVelocity=0),!this.isDragging&&this.dampingEnabled&&(r+=this.tiltVelocity*o),r===0)return;let a=h.angleBetween(t.direction,i);(a<D.PI_OVER_TWO&&r>0||a>D.PI_OVER_TWO&&r<0)&&(r*=Math.abs(Math.sin(a)));let c=a+r,u=this.dampingEnabled?this.maximumTiltVelocity*this.tiltMagnitude:void 0,f=this.dampingEnabled?this.tiltAnimationDuration:void 0;D.smoothDamp(a,c,this.tiltVelocity,o,u,f,this._tiltDampenedResults);let d=this.tiltAngle-a,p=$.fromQuaternion(Le.fromAxisAngle(t.rightWC,-d,this._tiltQuaternion)),g=h.subtract(t.position,n,this._tiltOffset),m=h.dot(g,t.directionWC),y=h.multiplyByScalar(t.directionWC,m,this._tiltOffset),A=h.subtract(t.position,y,this._tiltOrigin),b=$.multiplyByVector(p,y,this._tiltOffset);h.add(A,b,t.position),t.lookAtWorldPosition(A,s)}update(t){let n=(xn()-this._lastUpdateTime)*kn.SECONDS_PER_MILLISECOND,{canvas:i}=t,{clientWidth:r,clientHeight:o}=i;if(n===0||r===0||o===0){this._lastUpdateTime=xn(),this._dragDelta.x=0,this._dragDelta.y=0;return}let s=this._target;if(this.isDragging&&!this._hasTarget){let a=this._screenSpaceDragPosition;this.useDragPosition||(a=this._screenSpaceOrigin,a.x=r/2,a.y=o/2);let c=this.pickWorldPosition(t,a,this._target),u=l(c);this._hasTarget=u,s=c}if(this._hasTarget){let{camera:a,ellipsoid:c}=t,u=c.geodeticSurfaceNormal(s,this._axis),f=h.negate(u,this._axis);if(this.orbitEnabled){let d=this._dragDelta.x/r;d=D.clamp(d,-this.maximumMovementRatio,this.maximumMovementRatio),d*=this.orbitMagnitude*D.TWO_PI,this.orbit(a,s,f,d,n,c)}if(this.tiltEnabled){let d=this._dragDelta.y/o;d=D.clamp(d,-this.maximumMovementRatio,this.maximumMovementRatio),d*=this.tiltMagnitude*D.PI,this.tilt(a,s,f,d,n,c)}}this._lastUpdateTime=xn(),this._dragDelta.x=0,this._dragDelta.y=0}},Ele=Tle;var Cle=class e{static _getDefaultDragInputs(){return[Object.freeze({button:ec.MIDDLE})]}static _getDefaultScrollInputs(){return[un.WHEEL]}constructor(t=H.EMPTY_OBJECT){this._enabled=!0,this._handler=void 0,this._lastUpdateTime=void 0,this.usePointerPosition=!1,this.dragInputs=t.dragInputs??e._getDefaultDragInputs(),this.scrollInputs=t.scrollInputs??e._getDefaultScrollInputs(),this._dragInputState=void 0,this._dragDelta=new U,this._scrollDelta=0,this._zoomInputVelocity=0,this._screenSpaceScrollPosition=new U,this._screenSpaceDragPosition=new U,this._screenSpaceOrigin=new U,this.zoomSensitivity=.2,this.pickWorldPosition=_p,this.zoomDistanceRatio=.4,this.inertiaEnabled=!1,this.inertialDecay=6,this.minimumZoomDistance=0,this.maximumZoomDistance=1e5,this.minimumZoomVelocity=D.EPSILON20,this.maximumZoomVelocity=1,this.dampingEnabled=!0,this.zoomAnimationDuration=.45,this._target=new h,this._zoomDirection=new h,this._zoomDampenedResults={velocity:0,value:0}}get enabled(){return this._enabled}set enabled(t){this._enabled=t,t?(this._lastUpdateTime=xn(),this._scrollDelta=0,this._dragDelta.x=0,this._dragDelta.y=0):l(this._dragInputState)&&(this._dragInputState.isDragging=!1)}get isDragging(){return l(this._dragInputState)&&this._dragInputState.isDragging}connectedCallback(t){let n=new ca(t);this._handler=n;for(let i of this.scrollInputs)n.setInputAction(this._handleZoom.bind(this),i);n.setInputAction(this._handleZoomPosition.bind(this),un.MOUSE_MOVE),this._dragInputState=yp.registerDragInputBindings(n,this.dragInputs,{start:this._handleStartDrag.bind(this),change:this._handleDrag.bind(this)})}disconnectedCallback(t){let n=this._handler;l(n)&&!n.isDestroyed()&&n.destroy()}firstUpdate(){this._lastUpdateTime=xn(),this._scrollDelta=0,this._dragDelta.x=0,this._dragDelta.y=0}get zoomDistance(){return this._zoomDampenedResults.value}get zoomVelocity(){return this._zoomDampenedResults.velocity}set zoomVelocity(t){this._zoomDampenedResults.velocity=t}update(t){let i=(xn()-this._lastUpdateTime)*kn.SECONDS_PER_MILLISECOND,{canvas:r}=t,{clientWidth:o,clientHeight:s}=r;if(i===0||o===0||s===0){this._lastUpdateTime=xn(),this._scrollDelta=0,this._dragDelta.x=0,this._dragDelta.y=0;return}let a=this._scrollDelta+this._dragDelta.y;if(a===0&&this.inertiaEnabled){let A=Math.exp(-this.inertialDecay*i);this._zoomInputVelocity*=A,a=this._zoomInputVelocity*i}if(Math.abs(this.zoomVelocity)<this.minimumZoomVelocity&&a<=D.EPSILON3&&a>=-D.EPSILON3&&this.zoomVelocity<=D.EPSILON3){this._lastUpdateTime=xn(),this._scrollDelta=0,this._dragDelta.x=0,this._dragDelta.y=0,this.zoomVelocity=0;return}this._zoomInputVelocity=D.clamp(a/i,-this.maximumZoomVelocity,this.maximumZoomVelocity);let{camera:c,ellipsoid:u}=t,f=c.direction,d=h.magnitude(c.positionWC)-u.maximumRadius,p=this.isDragging?this._screenSpaceDragPosition:this._screenSpaceScrollPosition;this.useDragPosition||(p=this._screenSpaceOrigin,p.x=o/2,p.y=s/2);let g=this.pickWorldPosition(t,p,this._target);l(g)&&(f=h.subtract(g,c.positionWC,this._zoomDirection),f=h.normalize(f,this._zoomDirection),d=h.distance(g,c.positionWC)),d=D.clamp(d,d>0?this.minimumZoomDistance:-this.maximumZoomDistance,d>0?this.maximumZoomDistance:-this.minimumZoomDistance);let m=a*d*this.zoomDistanceRatio,y=this.dampingEnabled?this.zoomAnimationDuration:void 0;this._zoomDampenedResults=D.smoothDamp(0,m,this.zoomVelocity,i,void 0,y,this._zoomDampenedResults),c.move(f,this.zoomDistance),this._lastUpdateTime=xn(),this._scrollDelta=0,this._dragDelta.x=0,this._dragDelta.y=0}_handleZoom(t){this._scrollDelta+=t*this.zoomSensitivity}_handleZoomPosition(t){this._screenSpaceScrollPosition.x=t.endPosition.x,this._screenSpaceScrollPosition.y=t.endPosition.y}_handleStartDrag(t){this.enabled&&(this._screenSpaceDragPosition.x=t.position.x,this._screenSpaceDragPosition.y=t.position.y,this._dragDelta.x=0,this._dragDelta.y=0)}_handleDrag(t){this._dragDelta.x+=t.endPosition.x-t.startPosition.x,this._dragDelta.y+=t.endPosition.y-t.startPosition.y}},vle=Cle;var kke={FLOAT:"float",VEC2:"vec2",VEC3:"vec3",VEC4:"vec4",MAT2:"mat2",MAT3:"mat3",MAT4:"mat4"};Object.freeze(kke);var Sle=kke;var Uke={SIGX:"SIGX",SIGY:"SIGY",SIGZ:"SIGZ",VARX:"VARX",VARY:"VARY",VARZ:"VARZ",SIGR:"VARZ"};Object.freeze(Uke);var wle=Uke;function WGt(e){async function t({data:i}){let r=[],o={id:i.id,result:void 0,error:void 0};self.CESIUM_BASE_URL=i.baseUrl;try{let s=await e(i.parameters,r);o.result=s}catch(s){s instanceof Error?o.error={name:s.name,message:s.message,stack:s.stack}:o.error=s}i.canTransferArrayBuffer||(r.length=0);try{postMessage(o,r)}catch(s){o.result=void 0,o.error=`postMessage failed with error: ${Kp(s)} - with responseMessage: ${JSON.stringify(o)}`,postMessage(o)}}function n(i){postMessage({id:i.data?.id,error:`postMessage failed with error: ${JSON.stringify(i)}`})}return self.onmessage=t,self.onmessageerror=n,self}var Ile=WGt;globalThis.CESIUM_VERSION="1.145.0";var b8;typeof ko<"u"&&(b8=ko);(function(){/*! +`;function NP(e,t){this._tilingScheme=e,this._maximumLevel=t,this._rootNodes=[]}var LC=new ie;function s4t(e,t,n,i){let r=i.length;for(let o=0;o<r;++o){let s=i[o];if(s.x===t&&s.y===n&&s.level===e)return!0}return!1}NP.prototype.addAvailableTileRange=function(e,t,n,i,r){let o=this._tilingScheme,s=this._rootNodes;if(e===0)for(let p=n;p<=r;++p)for(let g=t;g<=i;++g)s4t(e,g,p,s)||s.push(new OP(o,void 0,0,g,p));o.tileXYToRectangle(t,n,e,LC);let a=LC.west,c=LC.north;o.tileXYToRectangle(i,r,e,LC);let u=LC.east,f=LC.south,d=new f4t(e,a,f,u,c);for(let p=0;p<s.length;++p){let g=s[p];nae(g.extent,d)&&d4t(this._maximumLevel,g,d)}};NP.prototype.computeMaximumLevelAtPosition=function(e){let t;for(let n=0;n<this._rootNodes.length;++n){let i=this._rootNodes[n];if(MP(i.extent,e)){t=i;break}}return l(t)?O4(void 0,t,e):-1};var a4t=[],c4t=[],l4t=new ie,u4t=new ie;NP.prototype.computeBestAvailableLevelOverRectangle=function(e){let t=a4t;t.length=0,e.east<e.west?(t.push(ie.fromRadians(-Math.PI,e.south,e.east,e.north,l4t)),t.push(ie.fromRadians(e.west,e.south,Math.PI,e.north,u4t))):t.push(e);let n=c4t;n.length=0;let i;for(i=0;i<this._rootNodes.length;++i)M4(n,this._rootNodes[i],t);for(i=n.length-1;i>=0;--i)if(l(n[i])&&n[i].length===0)return i;return 0};var i2e=new he;NP.prototype.isTileAvailable=function(e,t,n){let i=this._tilingScheme.tileXYToRectangle(t,n,e,LC);return ie.center(i,i2e),this.computeMaximumLevelAtPosition(i2e)>=e};NP.prototype.computeChildMaskForTile=function(e,t,n){let i=e+1;if(i>=this._maximumLevel)return 0;let r=0;return r|=this.isTileAvailable(i,2*t,2*n+1)?1:0,r|=this.isTileAvailable(i,2*t+1,2*n+1)?2:0,r|=this.isTileAvailable(i,2*t,2*n)?4:0,r|=this.isTileAvailable(i,2*t+1,2*n)?8:0,r};function OP(e,t,n,i,r){this.tilingScheme=e,this.parent=t,this.level=n,this.x=i,this.y=r,this.extent=e.tileXYToRectangle(i,r,n),this.rectangles=[],this._sw=void 0,this._se=void 0,this._nw=void 0,this._ne=void 0}Object.defineProperties(OP.prototype,{nw:{get:function(){return this._nw||(this._nw=new OP(this.tilingScheme,this,this.level+1,this.x*2,this.y*2)),this._nw}},ne:{get:function(){return this._ne||(this._ne=new OP(this.tilingScheme,this,this.level+1,this.x*2+1,this.y*2)),this._ne}},sw:{get:function(){return this._sw||(this._sw=new OP(this.tilingScheme,this,this.level+1,this.x*2,this.y*2+1)),this._sw}},se:{get:function(){return this._se||(this._se=new OP(this.tilingScheme,this,this.level+1,this.x*2+1,this.y*2+1)),this._se}}});function f4t(e,t,n,i,r){this.level=e,this.west=t,this.south=n,this.east=i,this.north=r}function nae(e,t){let n=Math.max(e.west,t.west),i=Math.max(e.south,t.south),r=Math.min(e.east,t.east),o=Math.min(e.north,t.north);return i<o&&n<r}function d4t(e,t,n){for(;t.level<e;)if(bW(t.nw.extent,n))t=t.nw;else if(bW(t.ne.extent,n))t=t.ne;else if(bW(t.sw.extent,n))t=t.sw;else if(bW(t.se.extent,n))t=t.se;else break;if(t.rectangles.length===0||t.rectangles[t.rectangles.length-1].level<=n.level)t.rectangles.push(n);else{let i=vr(t.rectangles,n.level,h4t);i<0&&(i=~i),t.rectangles.splice(i,0,n)}}function h4t(e,t){return e.level-t}function bW(e,t){return t.west>=e.west&&t.east<=e.east&&t.south>=e.south&&t.north<=e.north}function MP(e,t){return t.longitude>=e.west&&t.longitude<=e.east&&t.latitude>=e.south&&t.latitude<=e.north}function O4(e,t,n){let i=0,r=!1;for(;!r;){let o=t._nw&&MP(t._nw.extent,n),s=t._ne&&MP(t._ne.extent,n),a=t._sw&&MP(t._sw.extent,n),c=t._se&&MP(t._se.extent,n);if(o+s+a+c>1){o&&(i=Math.max(i,O4(t,t._nw,n))),s&&(i=Math.max(i,O4(t,t._ne,n))),a&&(i=Math.max(i,O4(t,t._sw,n))),c&&(i=Math.max(i,O4(t,t._se,n)));break}else o?t=t._nw:s?t=t._ne:a?t=t._sw:c?t=t._se:r=!0}for(;t!==e;){let o=t.rectangles;for(let s=o.length-1;s>=0&&o[s].level>i;--s){let a=o[s];MP(a,n)&&(i=a.level)}t=t.parent}return i}function M4(e,t,n){if(!t)return;let i,r=!1;for(i=0;i<n.length;++i)r=r||nae(t.extent,n[i]);if(!r)return;let o=t.rectangles;for(i=0;i<o.length;++i){let s=o[i];e[s.level]||(e[s.level]=n),e[s.level]=m4t(e[s.level],s)}M4(e,t._nw,n),M4(e,t._ne,n),M4(e,t._sw,n),M4(e,t._se,n)}function m4t(e,t){let n=[];for(let i=0;i<e.length;++i){let r=e[i];nae(r,t)?(r.west<t.west&&n.push(new ie(r.west,r.south,t.west,r.north)),r.east>t.east&&n.push(new ie(t.east,r.south,r.east,r.north)),r.south<t.south&&n.push(new ie(Math.max(t.west,r.west),r.south,Math.min(t.east,r.east),t.south)),r.north>t.north&&n.push(new ie(Math.max(t.west,r.west),t.north,Math.min(t.east,r.east),r.north))):n.push(r)}return n}var up=NP;var p4t=15;function r2e(e){this.ellipsoid=e.ellipsoid??ee.default,this.credit=void 0,this.tilingScheme=void 0,this.height=void 0,this.width=void 0,this.encoding=void 0,this.lodCount=void 0,this.hasAvailability=!1,this.tilesAvailable=void 0,this.tilesAvailabilityLoaded=void 0,this.levelZeroMaximumGeometricError=void 0,this.terrainDataStructure=void 0}r2e.prototype.build=function(e){e._credit=this.credit,e._tilingScheme=this.tilingScheme,e._height=this.height,e._width=this.width,e._encoding=this.encoding,e._lodCount=this.lodCount,e._hasAvailability=this.hasAvailability,e._tilesAvailable=this.tilesAvailable,e._tilesAvailabilityLoaded=this.tilesAvailabilityLoaded,e._levelZeroMaximumGeometricError=this.levelZeroMaximumGeometricError,e._terrainDataStructure=this.terrainDataStructure};function g4t(e,t){let n=t.copyrightText;l(n)&&(e.credit=new It(n));let i=t.spatialReference,r=i.latestWkid??i.wkid,o=t.extent,s={ellipsoid:e.ellipsoid};if(r===4326)s.rectangle=ie.fromDegrees(o.xmin,o.ymin,o.xmax,o.ymax),e.tilingScheme=new Qi(s);else if(r===3857){let u=Math.PI*e.ellipsoid.maximumRadius;t.extent.xmax>u&&(t.extent.xmax=u),t.extent.ymax>u&&(t.extent.ymax=u),t.extent.xmin<-u&&(t.extent.xmin=-u),t.extent.ymin<-u&&(t.extent.ymin=-u),s.rectangleSouthwestInMeters=new U(o.xmin,o.ymin),s.rectangleNortheastInMeters=new U(o.xmax,o.ymax),e.tilingScheme=new Fo(s)}else throw new oe("Invalid spatial reference");let a=t.tileInfo;if(!l(a))throw new oe("tileInfo is required");e.width=a.rows+1,e.height=a.cols+1,e.encoding=a.format==="LERC"?ph.LERC:ph.NONE,e.lodCount=a.lods.length-1,(e.hasAvailability=t.capabilities.indexOf("Tilemap")!==-1)&&(e.tilesAvailable=new up(e.tilingScheme,e.lodCount),e.tilesAvailable.addAvailableTileRange(0,0,0,e.tilingScheme.getNumberOfXTilesAtLevel(0),e.tilingScheme.getNumberOfYTilesAtLevel(0)),e.tilesAvailabilityLoaded=new up(e.tilingScheme,e.lodCount)),e.levelZeroMaximumGeometricError=Xr.getEstimatedLevelZeroGeometricErrorForAHeightmap(e.tilingScheme.ellipsoid,e.width,e.tilingScheme.getNumberOfXTilesAtLevel(0)),t.bandCount>1&&console.log("ArcGISTiledElevationTerrainProvider: Terrain data has more than 1 band. Using the first one."),l(t.minValues)&&l(t.maxValues)?e.terrainDataStructure={elementMultiplier:1,lowestEncodedHeight:t.minValues[0],highestEncodedHeight:t.maxValues[0]}:e.terrainDataStructure={elementMultiplier:1}}async function _4t(e,t,n){try{let i=await t.fetchJson();g4t(e,i)}catch(i){let r=`An error occurred while accessing ${t}.`;throw Zr.reportError(void 0,n,l(n)?n._errorEvent:void 0,r),i}}function kb(){this._resource=void 0,this._credit=void 0,this._tilingScheme=void 0,this._levelZeroMaximumGeometricError=void 0,this._maxLevel=void 0,this._terrainDataStructure=void 0,this._width=void 0,this._height=void 0,this._encoding=void 0,this._lodCount=void 0,this._hasAvailability=!1,this._tilesAvailable=void 0,this._tilesAvailabilityLoaded=void 0,this._availableCache={},this._errorEvent=new be}Object.defineProperties(kb.prototype,{errorEvent:{get:function(){return this._errorEvent}},credit:{get:function(){return this._credit}},tilingScheme:{get:function(){return this._tilingScheme}},hasWaterMask:{get:function(){return!1}},hasVertexNormals:{get:function(){return!1}},availability:{get:function(){return this._tilesAvailable}}});kb.fromUrl=async function(e,t){t=t??H.EMPTY_OBJECT,e=await Promise.resolve(e);let n=De.createIfNeeded(e);n.appendForwardSlash(),l(t.token)&&(n=n.getDerivedResource({queryParameters:{token:t.token}}));let i=n.getDerivedResource({queryParameters:{f:"pjson"}}),r=new r2e(t);await _4t(r,i);let o=new kb(t);return r.build(o),o._resource=n,o};kb.prototype.requestTileGeometry=function(e,t,n,i){let r=this._resource.getDerivedResource({url:`tile/${n}/${t}/${e}`,request:i}),o=this._hasAvailability,s=Promise.resolve(!0),a;if(o&&!l(iae(this,n+1,e*2,t*2))){let d=o2e(this,n+1,e*2,t*2);s=d.promise,a=d.request}let c=r.fetchArrayBuffer();if(!l(c)||!l(s))return;let u=this,f=this._tilesAvailable;return Promise.all([c,s]).then(function(d){return new zc({buffer:d[0],width:u._width,height:u._height,childTileMask:o?f.computeChildMaskForTile(n,e,t):p4t,structure:u._terrainDataStructure,encoding:u._encoding})}).catch(async function(d){if(l(a)&&a.state===Ti.CANCELLED){i.cancel();try{await i.deferred?.promise}catch{}return i.state=Ti.CANCELLED,Promise.reject(d)}return Promise.reject(d)})};function iae(e,t,n,i){if(!e._hasAvailability)return;let r=e._tilesAvailabilityLoaded,o=e._tilesAvailable;if(t>e._lodCount)return!1;if(o.isTileAvailable(t,n,i))return!0;if(r.isTileAvailable(t,n,i))return!1}kb.prototype.getLevelMaximumGeometricError=function(e){return this._levelZeroMaximumGeometricError/(1<<e)};kb.prototype.getTileDataAvailable=function(e,t,n){if(!this._hasAvailability)return;let i=iae(this,n,e,t);if(l(i))return i;o2e(this,n,e,t)};kb.prototype.loadTileDataAvailability=function(e,t,n){};function y4t(e,t,n,i){let r=t-1,o=n-1,s=i[e.y*t+e.x],a=[],c={startX:e.x,startY:e.y,endX:0,endY:0},u=new U(e.x+1,e.y+1),f=!1,d=!1;for(;!(f&&d);){let p=u.x,g=d?u.y+1:u.y;if(!f){for(let m=e.y;m<g;++m)if(i[m*t+u.x]!==s){f=!0;break}f?(a.push(new U(u.x,e.y)),--u.x,--p,c.endX=u.x):u.x===r?(c.endX=u.x,f=!0):++u.x}if(!d){let m=u.y*t;for(let y=e.x;y<=p;++y)if(i[m+y]!==s){d=!0;break}d?(a.push(new U(e.x,u.y)),--u.y,c.endY=u.y):u.y===o?(c.endY=u.y,d=!0):++u.y}}return{endingIndices:a,range:c,value:s}}function A4t(e,t,n,i,r){let o=[];if(r.every(function(c){return c===r[0]}))return r[0]===1&&o.push({startX:e,startY:t,endX:e+n-1,endY:t+i-1}),o;let a=[new U(0,0)];for(;a.length>0;){let c=a.pop(),u=y4t(c,n,i,r);if(u.value===1){let d=u.range;d.startX+=e,d.endX+=e,d.startY+=t,d.endY+=t,o.push(d)}let f=u.endingIndices;f.length>0&&(a=a.concat(f))}return o}function o2e(e,t,n,i){if(!e._hasAvailability)return{};let r=Math.floor(n/128)*128,o=Math.floor(i/128)*128,s=Math.min(1<<t,128),a=`tilemap/${t}/${o}/${r}/${s}/${s}`,c=e._availableCache;if(l(c[a]))return c[a];let u=new wo({throttle:!1,throttleByServer:!0,type:Zs.TERRAIN}),d=e._resource.getDerivedResource({url:a,request:u}).fetchJson();return l(d)?(d=d.then(function(p){let g=A4t(r,o,s,s,p.data);e._tilesAvailabilityLoaded.addAvailableTileRange(t,r,o,r+s,o+s);let m=e._tilesAvailable;for(let y=0;y<g.length;++y){let A=g[y];m.addAvailableTileRange(t,A.startX,A.startY,A.endX,A.endY)}return iae(e,t,n,i)}),c[a]={promise:d,request:u},d=d.finally(function(p){return delete c[a],p}),{promise:d,request:u}):{}}var rae=kb;var s2e="https://dev.virtualearth.net/REST/v1/Locations";function oae(e){e=e??H.EMPTY_OBJECT;let t=e.key;this._key=t;let n={key:t};l(e.culture)&&(n.culture=e.culture),this._resource=new De({url:s2e,queryParameters:n}),this._credit=new It('<img src="http://dev.virtualearth.net/Branding/logo_powered_by.png"/>',!1)}Object.defineProperties(oae.prototype,{url:{get:function(){return s2e}},key:{get:function(){return this._key}},credit:{get:function(){return this._credit}}});oae.prototype.geocode=async function(e){return this._resource.getDerivedResource({queryParameters:{query:e}}).fetchJsonp("jsonp").then(function(n){return n.resourceSets.length===0?[]:n.resourceSets[0].resources.map(function(r){let o=r.bbox,s=o[0],a=o[1],c=o[2],u=o[3];return{displayName:r.name,destination:ie.fromDegrees(a,s,u,c)}})})};var sae=oae;function aae(){}Object.defineProperties(aae.prototype,{credit:{get:function(){}}});aae.prototype.geocode=function(e){let t=e.match(/[^\s,\n]+/g);if(t.length===2||t.length===3){let n=+t[0],i=+t[1],r=t.length===3?+t[2]:300;if(isNaN(n)&&isNaN(i)){let o=/^(\d+.?\d*)([nsew])/i;for(let s=0;s<t.length;++s){let a=t[s].match(o);o.test(t[s])&&a.length===3&&(/^[ns]/i.test(a[2])?i=/^[n]/i.test(a[2])?+a[1]:-a[1]:/^[ew]/i.test(a[2])&&(n=/^[e]/i.test(a[2])?+a[1]:-a[1]))}}if(!isNaN(n)&&!isNaN(i)&&!isNaN(r)){let o={displayName:e,destination:h.fromDegrees(n,i,r)};return Promise.resolve([o])}}return Promise.resolve([])};var cae=aae;var b4t=new se,a2e=new h,LP=new h;function x4t(e){let t=e.points,n=e.times;if(t.length<3){let i=n[0],r=1/(n[1]-i),o=t[0],s=t[1];return function(a,c){l(c)||(c=new h);let u=(a-i)*r;return h.lerp(o,s,u,c)}}return function(i,r){l(r)||(r=new h);let o=e._lastTimeIndex=e.findTimeInterval(i,e._lastTimeIndex),s=(i-n[o])/(n[o+1]-n[o]),a=b4t;a.z=s,a.y=s*s,a.x=a.y*s,a.w=1;let c,u,f,d,p;return o===0?(c=t[0],u=t[1],f=e.firstTangent,d=h.subtract(t[2],c,a2e),h.multiplyByScalar(d,.5,d),p=N.multiplyByVector(CA.hermiteCoefficientMatrix,a,a)):o===t.length-2?(c=t[o],u=t[o+1],d=e.lastTangent,f=h.subtract(u,t[o-1],a2e),h.multiplyByScalar(f,.5,f),p=N.multiplyByVector(CA.hermiteCoefficientMatrix,a,a)):(c=t[o-1],u=t[o],f=t[o+1],d=t[o+2],p=N.multiplyByVector(Ub.catmullRomCoefficientMatrix,a,a)),r=h.multiplyByScalar(c,p.x,r),h.multiplyByScalar(u,p.y,LP),h.add(r,LP,r),h.multiplyByScalar(f,p.z,LP),h.add(r,LP,r),h.multiplyByScalar(d,p.w,LP),h.add(r,LP,r)}}var T4t=new h,E4t=new h;function Ub(e){e=e??H.EMPTY_OBJECT;let t=e.points,n=e.times,i=e.firstTangent,r=e.lastTangent;if(t.length>2&&(l(i)||(i=T4t,h.multiplyByScalar(t[1],2,i),h.subtract(i,t[2],i),h.subtract(i,t[0],i),h.multiplyByScalar(i,.5,i)),!l(r))){let o=t.length-1;r=E4t,h.multiplyByScalar(t[o-1],2,r),h.subtract(t[o],r,r),h.add(r,t[o-2],r),h.multiplyByScalar(r,.5,r)}this._times=n,this._points=t,this._firstTangent=h.clone(i),this._lastTangent=h.clone(r),this._evaluateFunction=x4t(this),this._lastTimeIndex=0}Object.defineProperties(Ub.prototype,{times:{get:function(){return this._times}},points:{get:function(){return this._points}},firstTangent:{get:function(){return this._firstTangent}},lastTangent:{get:function(){return this._lastTangent}}});Ub.catmullRomCoefficientMatrix=new N(-.5,1,-.5,0,1.5,-2.5,0,1,-1.5,2,.5,0,.5,-.5,0,0);Ub.prototype.findTimeInterval=Dr.prototype.findTimeInterval;Ub.prototype.wrapTime=Dr.prototype.wrapTime;Ub.prototype.clampTime=Dr.prototype.clampTime;Ub.prototype.evaluate=function(e,t){return this._evaluateFunction(e,t)};var lae=Ub;var uae={},C4t={positions:void 0,normals:void 0,indices:void 0,edgeIndicesWest:void 0,edgeIndicesSouth:void 0,edgeIndicesEast:void 0,edgeIndicesNorth:void 0},v4t=new he,S4t=new h,w4t=new N,I4t=new N,P4t=new N,D4t=new h,R4t=new h,O4t=new h,M4t=new h,N4t=new he,L4t=new U,N4=new h,F4t=new U,B4t=new h,k4t=new h,xW=function(e,t){return e-t};uae.createMesh=async function(e){e=e??H.EMPTY_OBJECT;let{exaggeration:t=1,exaggerationRelativeHeight:n=0,hasVertexNormals:i,hasWebMercatorT:r,gltf:o,minimumHeight:s,maximumHeight:a,skirtHeight:c}=e,f=t!==1,d=ue.clone(e.boundingSphere,new ue),p=en.clone(e.orientedBoundingBox,new en),g=h.clone(e.horizonOcclusionPoint,new h),m=ee.clone(e.ellipsoid,new ee),y=ie.clone(e.rectangle,new ie);await(o.extensionsRequired!==void 0&&o.extensionsRequired.indexOf("EXT_meshopt_compression")!==-1?gA.ready:Promise.resolve(void 0));let x=y.west,T=y.south,E=y.north,v=y.width,S=y.height,I=ie.center(y,v4t);I.height=.5*(s+a);let R=he.toCartesian(I,m,S4t),O=At.eastNorthUpToFixedFrame(R,m,w4t),L=N.inverseTransformation(O,I4t),_=N.unpack(o.nodes[0].matrix,0,P4t);_=N.multiply(Hi.Y_UP_TO_Z_UP,_,_);let C=_8t(o,i,C4t),w=Xr.getSkirtVertexCount(C.edgeIndicesWest,C.edgeIndicesSouth,C.edgeIndicesEast,C.edgeIndicesNorth),P=C.positions,M=C.normals,F=C.indices,V=P.length/3,B=V+w,j=F.length,k=Xr.getSkirtIndexCountWithFilledCorners(w),G=B<=65535?Uint16Array:Uint32Array,q=new G(j+k);q.set(F);let Q=new G(C.edgeIndicesWest),W=new G(C.edgeIndicesSouth),J=new G(C.edgeIndicesEast),Z=new G(C.edgeIndicesNorth),ae=new G(Q).sort(),Ae=new G(W).sort(),fe=new G(J).sort(),xe=new G(Z).sort(),ge=yi.geodeticLatitudeToMercatorAngle(T),Se=1/(yi.geodeticLatitudeToMercatorAngle(E)-ge),Re=h.fromElements(Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY,D4t),Qe=h.fromElements(Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY,R4t),He=new Eo(d.center,void 0,void 0,void 0,void 0,i,r,f,t,n),Xe=He.stride,$e=new Float32Array(B*Xe),Pe=0;for(let st=0;st<V;st++){let vt=h.unpack(P,st*3,O4t),Gt=N.multiplyByPoint(_,vt,M4t),lt=he.fromCartesian(Gt,m,N4t),{longitude:mt,latitude:ft,height:Xt}=lt,rt=(mt-x)/v,ht=(ft-T)/S;rt=D.clamp(rt,0,1),ht=D.clamp(ht,0,1),vr(ae,st,xW)>=0?rt=0:vr(fe,st,xW)>=0&&(rt=1),vr(Ae,st,xW)>=0?ht=0:vr(xe,st,xW)>=0&&(ht=1);let Bi=U.fromElements(rt,ht,L4t),Xn;if(i){let hi=h.unpack(M,st*3,N4);hi=N.multiplyByPointAsVector(_,hi,N4),hi=h.normalize(hi,N4),Xn=cn.octEncode(hi,F4t)}let bi;r&&(bi=(yi.geodeticLatitudeToMercatorAngle(ft)-ge)*Se);let Wi;f&&(Wi=m.geodeticSurfaceNormal(Gt,B4t)),Pe=He.encode($e,Pe,Gt,Bi,Xt,Xn,bi,Wi);let wi=N.multiplyByPoint(L,Gt,k4t);Re=h.minimumByComponent(wi,Re,Re),Qe=h.maximumByComponent(wi,Qe,Qe)}let qe=new Ac(h.clone(He.center,new h),$e,q,j,V,s,a,y,ue.clone(d,new ue),h.clone(g,new h),Xe,en.clone(p,new en),He,Q,W,J,Z);return m2e(qe,y,m,Re,Qe,O,L,c),Promise.resolve(qe)};var U4t=new U,z4t=new U,V4t=new Array(6),j4t=new U,H4t=new U,G4t=new U,W4t=new h,q4t=new h,Y4t=new h,X4t=new he,K4t=new h,$4t=new he,J4t=new he,c2e=new h,Z4t=new h,Q4t=new h,e8t=new h,t8t=new h,n8t=new h,i8t=new h,r8t=new h,o8t=new N,s8t=new N,l2e=new U,a8t=new U,c8t=new h,l8t=new ue,u8t=new en,f8t=new wf,u2e=new h,f2e=new U,d8t=new U,d2e=new h,h8t=new h;function m8t(e){let t=e.meshes[0].primitives[0],n=e.accessors[t.attributes.POSITION],i=e.bufferViews[n.bufferView],r=n.count,o=i.extensions?i.extensions.EXT_meshopt_compression:void 0;if(o===void 0){let g=e.buffers[i.buffer].extras._pipeline.source;return new Float32Array(g.buffer,g.byteOffset+(i.byteOffset??0)+(n.byteOffset??0),r*3)}let s=e.buffers[o.buffer].extras._pipeline.source,a=new Uint8Array(s.buffer,s.byteOffset+(o.byteOffset??0)+(n.byteOffset??0),o.byteLength),c=o.byteStride,u=c===4?Uint8Array:Uint16Array,f=new u(r*4);gA.decodeVertexBuffer(new Uint8Array(f.buffer),r,c,a);let d=(1<<f.BYTES_PER_ELEMENT*8)-1,p=new Float32Array(r*3);for(let g=0;g<r;g++)p[g*3+0]=f[g*4+0]/d,p[g*3+1]=f[g*4+1]/d,p[g*3+2]=f[g*4+2]/d;return p}function p8t(e){let t=e.meshes[0].primitives[0],n=e.accessors[t.attributes.NORMAL],i=e.bufferViews[n.bufferView],r=n.count,o=i.extensions?i.extensions.EXT_meshopt_compression:void 0;if(o===void 0){let d=e.buffers[i.buffer].extras._pipeline.source;return new Float32Array(d.buffer,d.byteOffset+(i.byteOffset??0)+(n.byteOffset??0),r*3)}let s=e.buffers[o.buffer].extras._pipeline.source,a=new Uint8Array(s.buffer,s.byteOffset+(o.byteOffset??0)+(n.byteOffset??0),o.byteLength),c=o.byteStride,u=new Int8Array(r*c);gA.decodeVertexBuffer(new Uint8Array(u.buffer),r,c,a);let f=new Float32Array(r*3);for(let d=0;d<r;d++){let p=Math.max(u[d*4+0]/127,-1),g=Math.max(u[d*4+1]/127,-1),m=1-(Math.abs(p)+Math.abs(g));if(m<0){let A=p,b=g;p=(1-Math.abs(b))*D.signNotZero(A),g=(1-Math.abs(A))*D.signNotZero(b)}let y=N4;y.x=p,y.y=g,y.z=m,y=h.normalize(y,N4),f[d*3+0]=y.x,f[d*3+1]=y.y,f[d*3+2]=y.z}return f}function g8t(e){let t=e.meshes[0].primitives[0],n=e.accessors[t.indices],i=e.bufferViews[n.bufferView],r=n.count,o=n.componentType===Y.UNSIGNED_SHORT?Uint16Array:Uint32Array,s=i.extensions?i.extensions.EXT_meshopt_compression:void 0;if(s===void 0){let f=e.buffers[i.buffer].extras._pipeline.source;return new o(f.buffer,f.byteOffset+(i.byteOffset??0)+(n.byteOffset??0),r)}let a=e.buffers[s.buffer].extras._pipeline.source,c=new Uint8Array(a.buffer,a.byteOffset+(s.byteOffset??0)+(n.byteOffset??0),s.byteLength),u=new o(r);return gA.decodeIndexBuffer(new Uint8Array(u.buffer),r,s.byteStride,c),u}function TW(e,t){let n=e.meshes[0].primitives[0],i=e.accessors[n.extensions.CESIUM_tile_edges[t]],r=e.bufferViews[i.bufferView],o=i.count,s=i.componentType===Y.UNSIGNED_SHORT?Uint16Array:Uint32Array,a=r.extensions?r.extensions.EXT_meshopt_compression:void 0;if(a===void 0){let p=e.buffers[r.buffer].extras._pipeline.source;return new s(p.buffer,p.byteOffset+(r.byteOffset??0)+(i.byteOffset??0),o)}let c=e.buffers[a.buffer].extras._pipeline.source,u=new Uint8Array(c.buffer,c.byteOffset+(a.byteOffset??0)+(i.byteOffset??0),a.byteLength),f=new s(o),d=a.byteStride;return gA.decodeIndexSequence(new Uint8Array(f.buffer),o,d,u),f}function _8t(e,t,n){return n.positions=m8t(e),n.normals=t?p8t(e):void 0,n.indices=g8t(e),n.edgeIndicesWest=TW(e,"left"),n.edgeIndicesSouth=TW(e,"bottom"),n.edgeIndicesEast=TW(e,"right"),n.edgeIndicesNorth=TW(e,"top"),n}uae.upsampleMesh=function(e){e=e??H.EMPTY_OBJECT;let{isEastChild:t,isNorthChild:n,parentMinimumHeight:i,parentMaximumHeight:r,skirtHeight:o}=e,s=e.parentIndexCountWithoutSkirts,a=e.parentIndices,c=e.parentVertexCountWithoutSkirts,u=e.parentVertices,f=Eo.clone(e.parentEncoding,new Eo),d=f.hasVertexNormals,p=f.hasWebMercatorT,g=f.exaggeration,m=f.exaggerationRelativeHeight,A=g!==1,b=ie.clone(e.rectangle,new ie),x=ee.clone(e.ellipsoid),T=[],E=[],v=[],S=[],I=[],R=[],O=[],L=[];D8t(t,n,s,a,c,u,f,S,I,R,O,L,T,v,E);let _=ie.center(b,X4t);_.height=.5*(i+r);let C=he.toCartesian(_,x,K4t),w=T.length,P=new Eo(C,void 0,void 0,void 0,void 0,d,p,A,g,m),M=P.stride,F=Xr.getSkirtVertexCount(I,R,O,L),V=w+F,B=S.length,j=Xr.getSkirtIndexCountWithFilledCorners(F),k=B+j,G=V<=65535?Uint16Array:Uint32Array,q=new G(k);q.set(S);let Q=new G(I),W=new G(R),J=new G(O),Z=new G(L),ae=new Float32Array(V*M),Ae=0,fe=At.eastNorthUpToFixedFrame(C,x,o8t),xe=N.inverseTransformation(fe,s8t),ge=b.west,we=b.east,Se=b.south,Re=b.north,Qe=yi.geodeticLatitudeToMercatorAngle(Se),Xe=1/(yi.geodeticLatitudeToMercatorAngle(Re)-Qe),$e=Number.POSITIVE_INFINITY,Pe=Number.NEGATIVE_INFINITY,qe=h.fromElements(Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY,i8t),st=h.fromElements(Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY,r8t);for(let Xt=0;Xt<w;Xt++){let rt=T[Xt],ht=a[rt*3+0],Bi=a[rt*3+1],Xn=a[rt*3+2],bi=a8t;bi.x=E[Xt*2+0],bi.y=E[Xt*2+1];let Wi=bi.x,wi=bi.y,hi=v[Xt*2+0],xi=v[Xt*2+1],jn=1-hi-xi,nn=f.decodeHeight(u,ht),Wn=f.decodeHeight(u,Bi),Zi=f.decodeHeight(u,Xn),Mr=nn*hi+Wn*xi+Zi*jn;$e=Math.min(Mr,$e),Pe=Math.max(Mr,Pe);let fo=D.lerp(ge,we,Wi),Bs=D.lerp(Se,Re,wi),Ks=he.fromRadians(fo,Bs,Mr,J4t),no=he.toCartesian(Ks,x,Z4t),gi=N.multiplyByPoint(xe,no,e8t);qe=h.minimumByComponent(gi,qe,qe),st=h.maximumByComponent(gi,st,st);let ho;if(d){let Bn=f.decodeNormal(u,ht,W4t),qi=f.decodeNormal(u,Bi,q4t),ki=f.decodeNormal(u,Xn,Y4t),Nr=h.fromElements(Bn.x*hi+qi.x*xi+ki.x*jn,Bn.y*hi+qi.y*xi+ki.y*jn,Bn.z*hi+qi.z*xi+ki.z*jn,u2e);Nr=h.normalize(Nr,u2e),ho=cn.octEncode(Nr,d8t)}let ur;p&&(ur=(yi.geodeticLatitudeToMercatorAngle(Bs)-Qe)*Xe);let Zo;A&&(Zo=x.geodeticSurfaceNormal(no,h8t)),Ae=P.encode(ae,Ae,no,bi,Mr,ho,ur,Zo)}let vt=en.fromRectangle(b,$e,Pe,x,u8t),Gt=ue.fromVertices(ae,P.center,M,l8t),mt=new Zh(x).computeHorizonCullingPointFromVerticesPossiblyUnderEllipsoid(P.center,ae,M,P.center,$e,c8t),ft=new Ac(h.clone(P.center,new h),ae,q,B,w,$e,Pe,b,ue.clone(Gt),h.clone(mt),M,en.clone(vt),P,Q,W,J,Z);return m2e(ft,b,x,qe,st,fe,xe,o),ft};function m2e(e,t,n,i,r,o,s,a){let{encoding:c}=e,u=c.stride,f=e.vertices,{hasVertexNormals:d,hasWebMercatorT:p,exaggeration:g,exaggerationRelativeHeight:m}=c,A=g!==1,b=e.vertexCountWithoutSkirts,x=b*u,T=f.length/u,E=T-b,v=e.indices,S=e.indexCountWithoutSkirts,I=e.westIndicesSouthToNorth,R=e.southIndicesEastToWest,O=e.eastIndicesNorthToSouth,L=e.northIndicesWestToEast;Xr.addSkirtIndicesWithFilledCorners(I,R,O,L,b,v,S);let _=0,C=_+I.length,w=C+R.length,P=w+O.length,M=[I,R,O,L],F=[_,C,w,P],V=[-1,0,1,0],B=[0,-1,0,1],j=h.clone(i,t8t),k=h.clone(r,n8t),G=e.maximumHeight,q=e.minimumHeight-a;for(let J=0;J<E;J++){let Z;for(Z=0;Z<3&&!(J<F[Z+1]);Z++);let ae=M[Z][J-F[Z]],Ae=c.decodeTextureCoordinates(f,ae,l2e),fe=1e-4,xe=Ae.x+V[Z]*fe,ge=Ae.y+B[Z]*fe,we=D.lerp(t.west,t.east,xe),Se=D.clamp(D.lerp(t.south,t.north,ge),-D.PI_OVER_TWO,+D.PI_OVER_TWO),Qe=c.decodeHeight(f,ae)-a,He=he.fromRadians(we,Se,Qe,$4t),Xe=he.toCartesian(He,n,c2e),$e;d&&($e=c.getOctEncodedNormal(f,ae,f2e));let Pe;p&&(Pe=c.decodeWebMercatorT(f,ae));let qe;A&&(qe=n.geodeticSurfaceNormal(Xe,d2e)),x=c.encode(f,x,Xe,Ae,Qe,$e,Pe,qe);let st=N.multiplyByPoint(s,Xe,Q4t);h.minimumByComponent(st,j,j),h.maximumByComponent(st,k,k)}let Q=wf.fromCorners(j,k,f8t),W=new Eo(c.center,Q,q,G,o,c.hasVertexNormals,c.hasWebMercatorT,A,g,m);if(c.quantization!==W.quantization){let J=W,Z=J.stride,ae=new Float32Array(T*Z),Ae=0;for(let fe=0;fe<T;fe++)Ae=J.encode(ae,Ae,c.decodePosition(f,fe,c2e),c.decodeTextureCoordinates(f,fe,l2e),c.decodeHeight(f,fe),c.hasVertexNormals?c.getOctEncodedNormal(f,fe,f2e):void 0,c.hasWebMercatorT?c.decodeWebMercatorT(f,fe):void 0,c.hasGeodeticSurfaceNormals?c.decodeGeodeticSurfaceNormal(f,fe,d2e):void 0);e.vertices=ae,e.stride=Z,e.encoding=J}return e}var fae=0,y8t=1,dae=2,hae=3,A8t=4,b8t=new h,x8t=[new h,new h,new h,new h,new h,new h],T8t=[new U,new U,new U,new U,new U,new U],E8t=[new h,new h,new h,new h,new h,new h],C8t=[new U,new U,new U,new U,new U,new U];function h2e(e,t,n,i){switch(n){case fae:return D.sign(i.x-e.x);case dae:return D.sign(t.x-i.x);case hae:return D.sign(i.y-e.y);default:return D.sign(t.y-i.y)}}function v8t(e,t,n,i,r,o){let s,a,c;switch(n){case fae:s=(e.x-i.x)/(r.x-i.x),a=e.x,c=i.y+(r.y-i.y)*s;break;case dae:s=(t.x-i.x)/(r.x-i.x),a=t.x,c=i.y+(r.y-i.y)*s;break;case hae:s=(e.y-i.y)/(r.y-i.y),a=i.x+(r.x-i.x)*s,c=e.y;break;default:s=(t.y-i.y)/(r.y-i.y),a=i.x+(r.x-i.x)*s,c=t.y;break}return h.fromElements(a,c,s,o)}var S8t={length:0,coordinates:[new U,new U,new U,new U,new U,new U],barycentricCoordinates:[new h,new h,new h,new h,new h,new h]};function w8t(e,t,n,i,r,o,s,a){let c,u=T8t,f=x8t,d=3,p=C8t;U.clone(r,p[0]),U.clone(o,p[1]),U.clone(s,p[2]);let g=E8t;h.fromElements(1,0,0,g[0]),h.fromElements(0,1,0,g[1]),h.fromElements(0,0,1,g[2]);for(let m=0;m<t;m++){let y=(e+m)%A8t,A=u,b=f;u=p,f=g,c=d,p=A,g=b,d=0;let x=c-1,T=u[x],E=f[x],v=h2e(n,i,y,T);for(let S=0;S<c;S++){let I=u[S],R=f[S],O=h2e(n,i,y,I);if(v*O===-1){let L=v8t(n,i,y,T,I,b8t),{x:_,y:C,z:w}=L,P=1-w,M=E.x*P+R.x*w,F=E.y*P+R.y*w,V=E.z*P+R.z*w;U.fromElements(_,C,p[d]),h.fromElements(M,F,V,g[d]),d++}O>=0&&(U.clone(I,p[d]),h.clone(R,g[d]),d++),T=I,E=R,v=O}if(d===0)break}a.length=d;for(let m=0;m<d;m++)U.clone(p[m],a.coordinates[m]),h.clone(g[m],a.barycentricCoordinates[m]);return a}function I8t(e,t,n,i,r,o,s,a){return w8t(e?t?hae:fae:t?dae:y8t,2,n,i,r,o,s,a)}var P8t=[[],[0],[1],[0,1],[2],[0,2],[1,2],[0,1,2]];function D8t(e,t,n,i,r,o,s,a,c,u,f,d,p,g,m){let y={},A=e?.5:0,b=e?1:.5,x=t?.5:0,T=t?1:.5,E=U4t;E.x=A,E.y=x;let v=z4t;v.x=b,v.y=T;let S=0;for(let I=0;I<n;I+=3){let R=i[I+0],O=i[I+1],L=i[I+2],_=s.decodeTextureCoordinates(o,R,j4t),C=s.decodeTextureCoordinates(o,O,H4t),w=s.decodeTextureCoordinates(o,L,G4t),P=I8t(e,t,E,v,_,C,w,S8t),M=P.length;if(M<3)continue;let F=V4t;for(let k=0;k<M;k++){let G=P.barycentricCoordinates[k],q=G.x,Q=G.y,W=G.z,J=Math.ceil(q)|Math.ceil(Q)<<1|Math.ceil(W)<<2,Z=P8t[J],ae,Ae=!1;if(Z.length===1){let fe=Z[0],ge=i[I+fe];ae=y[ge],ae===void 0&&(Ae=!0,ae=S++,y[ge]=ae)}else if(Z.length===2){let fe=Z[0],xe=Z[1],ge=i[I+fe],we=i[I+xe],Se=P.barycentricCoordinates[(k+M-1)%M],Re=Math.ceil(Se.x)|Math.ceil(Se.y)<<1|Math.ceil(Se.z)<<2,Qe=J===Re,He=Math.min(ge,we),Xe=Math.max(ge,we),$e=r+2*(He*r+Xe),Pe=$e+0,qe=$e+1,st=y[Pe],vt=y[qe],Gt=!Qe==(st===void 0||vt===void 0);if(ae=Gt?st:vt,ae===void 0){Ae=!0,ae=S++;let lt=Gt?Pe:qe;y[lt]=ae}}else Ae=!0,ae=S++;if(F[k]=ae,Ae){let fe=I/3;p.push(fe);let xe=P.coordinates[k],ge=(xe.x-A)/(b-A),we=(xe.y-x)/(T-x);m.push(ge,we),g.push(q,Q),ge===0?c.push(ae):ge===1&&f.push(ae),we===0?u.push(ae):we===1&&d.push(ae)}}let V=F[0],B=F[1],j=F[2];a.push(V,B,j);for(let k=3;k<M;k++)B=j,j=F[k],a.push(V,B,j)}c.sort(function(I,R){return m[I*2+1]-m[R*2+1]}),u.sort(function(I,R){return m[R*2+0]-m[I*2+0]}),f.sort(function(I,R){return m[R*2+1]-m[I*2+1]}),d.sort(function(I,R){return m[I*2+0]-m[R*2+0]})}var FP=uae;var EW={};EW.clipTriangleAtAxisAlignedThreshold=function(e,t,n,i,r,o){l(o)?o.length=0:o=[];let s,a,c;t?(s=n<e,a=i<e,c=r<e):(s=n>e,a=i>e,c=r>e);let u=s+a+c,f,d,p,g,m,y;return u===1?s?(f=(e-n)/(i-n),d=(e-n)/(r-n),o.push(1),o.push(2),d!==1&&(o.push(-1),o.push(0),o.push(2),o.push(d)),f!==1&&(o.push(-1),o.push(0),o.push(1),o.push(f))):a?(p=(e-i)/(r-i),g=(e-i)/(n-i),o.push(2),o.push(0),g!==1&&(o.push(-1),o.push(1),o.push(0),o.push(g)),p!==1&&(o.push(-1),o.push(1),o.push(2),o.push(p))):c&&(m=(e-r)/(n-r),y=(e-r)/(i-r),o.push(0),o.push(1),y!==1&&(o.push(-1),o.push(2),o.push(1),o.push(y)),m!==1&&(o.push(-1),o.push(2),o.push(0),o.push(m))):u===2?!s&&n!==e?(g=(e-i)/(n-i),m=(e-r)/(n-r),o.push(0),o.push(-1),o.push(1),o.push(0),o.push(g),o.push(-1),o.push(2),o.push(0),o.push(m)):!a&&i!==e?(y=(e-r)/(i-r),f=(e-n)/(i-n),o.push(1),o.push(-1),o.push(2),o.push(1),o.push(y),o.push(-1),o.push(0),o.push(1),o.push(f)):!c&&r!==e&&(d=(e-n)/(r-n),p=(e-i)/(r-i),o.push(2),o.push(-1),o.push(0),o.push(2),o.push(d),o.push(-1),o.push(1),o.push(2),o.push(p)):u!==3&&(o.push(0),o.push(1),o.push(2)),o};EW.computeBarycentricCoordinates=function(e,t,n,i,r,o,s,a,c){let u=n-s,f=s-r,d=o-a,p=i-a,g=1/(d*u+f*p),m=t-a,y=e-s,A=(d*y+f*m)*g,b=(-p*y+u*m)*g,x=1-A-b;return l(c)?(c.x=A,c.y=b,c.z=x,c):new h(A,b,x)};EW.computeLineSegmentLineSegmentIntersection=function(e,t,n,i,r,o,s,a,c){let u=(s-r)*(t-o)-(a-o)*(e-r),f=(n-e)*(t-o)-(i-t)*(e-r),d=(a-o)*(n-e)-(s-r)*(i-t);if(d===0)return;let p=u/d,g=f/d;if(p>=0&&p<=1&&g>=0&&g<=1)return l(c)||(c=new U),c.x=e+p*(n-e),c.y=t+p*(i-t),c};var fp=EW;function py(e){e=e??H.EMPTY_OBJECT,this._minimumHeight=e.minimumHeight,this._maximumHeight=e.maximumHeight,this._skirtHeight=e.skirtHeight,this._boundingSphere=ue.clone(e.boundingSphere,new ue),this._orientedBoundingBox=en.clone(e.orientedBoundingBox,new en),this._horizonOcclusionPoint=h.clone(e.horizonOcclusionPoint,new h),this._hasVertexNormals=e.requestVertexNormals??!1,this._hasWaterMask=e.requestWaterMask??!1,this._hasWebMercatorT=!0,this._credits=e.credits,this._childTileMask=e.childTileMask??15,this._gltf=e.gltf,this._mesh=void 0,this._waterMask=e.waterMask}Object.defineProperties(py.prototype,{credits:{get:function(){return this._credits}},waterMask:{get:function(){return this._waterMask}}});py.prototype.interpolateHeight=function(e,t,n){let i=this._mesh;return i===void 0?void 0:g2e(i,e,t,n)};py.prototype.isChildAvailable=function(e,t,n,i){let r=2;return n!==e*2&&++r,i!==t*2&&(r-=2),(this._childTileMask&1<<r)!==0};var p2e="createVerticesFromCesium3DTilesTerrain",R8t=new $n(p2e),O8t=new $n(p2e,rf.maximumAsynchronousTasks);py.prototype.createMesh=function(e){e=e??H.EMPTY_OBJECT;let n=e.throttle??!0?O8t:R8t,i=e.tilingScheme,r=i.ellipsoid,o=e.x,s=e.y,a=e.level,c=i.tileXYToRectangle(o,s,a,new ie),u=this._gltf,f=n.scheduleTask({ellipsoid:r,rectangle:c,hasVertexNormals:this._hasVertexNormals,hasWaterMask:this._hasWaterMask,hasWebMercatorT:this._hasWebMercatorT,gltf:u,minimumHeight:this._minimumHeight,maximumHeight:this._maximumHeight,boundingSphere:this._boundingSphere,orientedBoundingBox:this._orientedBoundingBox,horizonOcclusionPoint:this._horizonOcclusionPoint,skirtHeight:this._skirtHeight,exaggeration:e.exaggeration,exaggerationRelativeHeight:e.exaggerationRelativeHeight});if(!l(f))return;let d=this;return Promise.resolve(f).then(function(p){let g=p,m=Eo.clone(g.encoding,new Eo),y=new Float32Array(g.verticesBuffer),A=y.length/m.stride,b=g.vertexCountWithoutSkirts,x=A<=65535?Uint16Array:Uint32Array,T=new x(g.indicesBuffer),E=new x(g.westIndicesBuffer),v=new x(g.eastIndicesBuffer),S=new x(g.southIndicesBuffer),I=new x(g.northIndicesBuffer),R=g.indexCountWithoutSkirts,O=d._minimumHeight,L=d._maximumHeight,_=h.clone(m.center,new h),C=ue.clone(d._boundingSphere,new ue),w=h.clone(d._horizonOcclusionPoint,new h),P=en.clone(d._orientedBoundingBox,new en),M=new Ac(_,y,T,R,b,O,L,c,C,w,m.stride,P,m,E,S,v,I);return d._mesh=M,Promise.resolve(M)})};py.prototype._createMeshSync=function(e){e=e??H.EMPTY_OBJECT;let t=e.tilingScheme,n=t.ellipsoid,i=e.x,r=e.y,o=e.level,s=t.tileXYToRectangle(i,r,o,new ie),a=FP.createMesh({ellipsoid:n,rectangle:s,hasVertexNormals:this._hasVertexNormals,hasWebMercatorT:this._hasWebMercatorT,gltf:this._gltf,minimumHeight:this._minimumHeight,maximumHeight:this._maximumHeight,boundingSphere:this._boundingSphere,orientedBoundingBox:this._orientedBoundingBox,horizonOcclusionPoint:this._horizonOcclusionPoint,skirtHeight:this._skirtHeight,exaggeration:e.exaggeration,exaggerationRelativeHeight:e.exaggerationRelativeHeight}),c=this;return Promise.resolve(a).then(function(u){return c._mesh=u,Promise.resolve(u)})};py.prototype.upsample=function(e,t,n,i,r,o,s){let a=this._mesh;return a===void 0?void 0:CW(!1,a,this._skirtHeight,this._credits,e,t,n,i,r,o,s)};py.prototype._upsampleSync=function(e,t,n,i,r,o,s){let a=this._mesh;return a===void 0?void 0:CW(!0,a,this._skirtHeight,this._credits,e,t,n,i,r,o,s)};py.prototype.wasCreatedByUpsampling=function(){return!1};function my(e){e=e??H.EMPTY_OBJECT,this._mesh=e.terrainMesh,this._skirtHeight=e.skirtHeight,this._credits=e.credits}my.prototype.createMesh=function(e){return e=e??H.EMPTY_OBJECT,Promise.resolve(this._mesh)};my.prototype.upsample=function(e,t,n,i,r,o,s){return CW(!1,this._mesh,this._skirtHeight,this._credits,e,t,n,i,r,o,s)};my.prototype._upsampleSync=function(e,t,n,i,r,o,s){return CW(!0,this._mesh,this._skirtHeight,this._credits,e,t,n,i,r,o,s)};my.prototype.interpolateHeight=function(e,t,n){let i=this._mesh;return g2e(i,e,t,n)};my.prototype.wasCreatedByUpsampling=function(){return!0};my.prototype.isChildAvailable=function(e,t,n,i){return!1};Object.defineProperties(my.prototype,{credits:{get:function(){return this._credits}},waterMask:{get:function(){}}});var M8t=new $n("upsampleVerticesFromCesium3DTilesTerrain",rf.maximumAsynchronousTasks);function CW(e,t,n,i,r,o,s,a,c,u,f){if(f-a>1)throw new pe("Upsampling through more than one level at a time is not currently supported.");let p=n*.5,g=o*2!==c,m=s*2===u,y=r.tileXYToRectangle(c,u,f,new ie),A=r.ellipsoid,b={isEastChild:g,isNorthChild:m,rectangle:y,ellipsoid:A,skirtHeight:p,parentVertices:t.vertices,parentIndices:t.indices,parentVertexCountWithoutSkirts:t.vertexCountWithoutSkirts,parentIndexCountWithoutSkirts:t.indexCountWithoutSkirts,parentMinimumHeight:t.minimumHeight,parentMaximumHeight:t.maximumHeight,parentEncoding:t.encoding};if(e){let T=FP.upsampleMesh(b),E=new my({terrainMesh:T,skirtHeight:p,credits:i});return Promise.resolve(E)}let x=M8t.scheduleTask(b);if(x!==void 0)return x.then(function(T){let E=Eo.clone(T.encoding,new Eo),v=E.stride,S=new Float32Array(T.verticesBuffer),I=S.length/v,R=T.vertexCountWithoutSkirts,O=I<=65535?Uint16Array:Uint32Array,L=new O(T.indicesBuffer),_=new O(T.westIndicesBuffer),C=new O(T.eastIndicesBuffer),w=new O(T.southIndicesBuffer),P=new O(T.northIndicesBuffer),M=T.indexCountWithoutSkirts,F=T.minimumHeight,V=T.maximumHeight,B=h.clone(E.center,new h),j=ue.clone(T.boundingSphere,new ue),k=h.clone(T.horizonOcclusionPoint,new h),G=en.clone(T.orientedBoundingBox,new en),q=new Ac(B,S,L,M,R,F,V,y,j,k,v,G,E,_,w,C,P),Q=new my({terrainMesh:q,skirtHeight:p,credits:i});return Promise.resolve(Q)})}var N8t=new U,L8t=new U,F8t=new U,B8t=new h;function g2e(e,t,n,i){let r=D.clamp((n-t.west)/t.width,0,1),o=D.clamp((i-t.south)/t.height,0,1),{vertices:s,encoding:a,indices:c}=e;for(let u=0;u<e.indexCountWithoutSkirts;u+=3){let f=c[u],d=c[u+1],p=c[u+2],g=a.decodeTextureCoordinates(s,f,N8t),m=a.decodeTextureCoordinates(s,d,L8t),y=a.decodeTextureCoordinates(s,p,F8t),A=Math.min(g.x,m.x,y.x),b=Math.max(g.x,m.x,y.x),x=Math.min(g.y,m.y,y.y),T=Math.max(g.y,m.y,y.y);if(r>=A&&r<=b&&o>=x&&o<=T){let E=fp.computeBarycentricCoordinates(r,o,g.x,g.y,m.x,m.y,y.x,y.y,B8t);if(E.x>=0&&E.y>=0&&E.z>=0){let v=a.decodeHeight(s,f),S=a.decodeHeight(s,d),I=a.decodeHeight(s,p);return E.x*v+E.y*S+E.z*I}}}return 0}var L4=py;function Y0(e){e=e??H.EMPTY_OBJECT;let t=e.credit;typeof t=="string"&&(t=new It(t)),this._credit=t,this._tileCredits=void 0,this._errorEvent=new be,this._ellipsoid=e.ellipsoid??ee.WGS84,this._tilingScheme=new Qi({ellipsoid:this._ellipsoid}),this._subtreeCache=new FC({provider:this}),this._tileset0=void 0,this._tileset1=void 0,this._resource=void 0,this._requestVertexNormals=e.requestVertexNormals??!1,this._requestWaterMask=e.requestWaterMask??!1}Y0.fromUrl=async function(e,t){t=t??H.EMPTY_OBJECT,e=await Promise.resolve(e);let n=De.createIfNeeded(e),i;try{i=await n.fetchJson()}catch(f){throw new oe("Could not load tileset JSON",f)}let r=new Y0(t);r._tileCredits=n.credits,r._resource=n;let o=i.root.children,s=o[0],a=o[1],c=i.schema,u=ou.fromJson(c);return r._tileset0=new f0(n,s,u),r._tileset1=new f0(n,a,u),r};Y0.fromIonAssetId=async function(e,t){let n=await Yo.fromAssetId(e);return Y0.fromUrl(n,t)};var k8t=new Array(3);Y0.prototype.requestTileGeometry=async function(e,t,n,i){let r=y2e(n,e),o=r===0?this._tileset0:this._tileset1,s=A2e(o,n,e,t),a=s.getSubtreeCoordinates(),c=this._subtreeCache,u=c.find(r,a),f=this._requestWaterMask,d=this,p;if(u===void 0){let x=o.subtreeUriTemplate.getDerivedResource({templateValues:a.getTemplateValues()});p=o.baseResource.getDerivedResource({url:x.url}).fetchArrayBuffer().then(async function(E){if(u=c.find(r,a),u===void 0){let v=new Uint8Array(E);u=await p_.fromSubtreeJson(d._resource,void 0,v,o,a),c.addSubtree(r,u)}return u})}else p=Promise.resolve(u);let g=o.contentUriTemplates[0].getDerivedResource({templateValues:s.getTemplateValues()}),m=o.baseResource.getDerivedResource({url:g.url}),y=m.fetchArrayBuffer();if(y===void 0)return;let A=y.then(x=>IT(new Uint8Array(x))),b=k8t;b[0]=p,b[1]=A,b[2]=f?A.then(x=>U8t(x,m)):void 0;try{let x=await Promise.all(b),T=x[0],E=x[1],v=x[2],S=T.getTileMetadataView(s),I=S.getPropertyBySemantic(rh.TILE_MINIMUM_HEIGHT),R=S.getPropertyBySemantic(rh.TILE_MAXIMUM_HEIGHT),O=S.getPropertyBySemantic(rh.TILE_BOUNDING_SPHERE),L=ue.unpack(O,0,new ue),_=S.getPropertyBySemantic(rh.TILE_HORIZON_OCCLUSION_POINT),w=d._tilingScheme.tileXYToRectangle(e,t,n,new ie),P=d._ellipsoid,M=en.fromRectangle(w,I,R,P,new en),F=d.getLevelMaximumGeometricError(n)*5,V=vW(o,T,s,0,0),B=vW(o,T,s,1,0),j=vW(o,T,s,0,1),k=vW(o,T,s,1,1),G=(V?1:0)|(B?2:0)|(j?4:0)|(k?8:0),q=new L4({gltf:E,minimumHeight:I,maximumHeight:R,boundingSphere:L,orientedBoundingBox:M,horizonOcclusionPoint:_,skirtHeight:F,requestVertexNormals:d._requestVertexNormals,childTileMask:G,credits:d._tileCredits,waterMask:v});return Promise.resolve(q)}catch(x){console.log(`Could not load subtree: ${r} ${a.level} ${a.x} ${a.y}: ${x}`),console.log(`Could not load tile: ${r} ${s.level} ${s.x} ${s.y}: ${x}`);return}};Y0.prototype.getTileDataAvailable=function(e,t,n){let i=this._subtreeCache,r=y2e(n,e),o=r===0?this._tileset0:this._tileset1,s=A2e(o,n,e,t),a=s.getSubtreeCoordinates(),c=i.find(r,a);if(c!==void 0)return c.tileIsAvailableAtCoordinates(s);if(a.isImplicitTilesetRoot())return s.isSubtreeRoot()?!0:void 0;let u=a.getParentSubtreeCoordinates(),f=i.find(r,u);if(f!==void 0)return f.childSubtreeIsAvailableAtCoordinates(a)?s.isSubtreeRoot()?!0:void 0:!1};function y2e(e,t){let n=1<<e;return t/n|0}function A2e(e,t,n,i){let r=1<<t,o=t,s=n%r,a=r-i-1,{subdivisionScheme:c,subtreeLevels:u}=e;return new d0({subdivisionScheme:c,subtreeLevels:u,level:o,x:s,y:a})}async function U8t(e,t){let n=e.extensions?.EXT_structural_metadata;if(!l(n)||!l(n.propertyTextures))return;let i=new AA({schema:n.schema});await i.load();let r=i.schema,o,s;if(l(r.classes)){for(let g in r.classes)if(r.classes.hasOwnProperty(g)&&(o=r.classes[g],s=o.propertiesBySemantic.WATERMASK,l(s)))break}if(!l(s))return;let a=n.propertyTextures.find(g=>g.class===o.id);if(!l(a))throw new pe(`Expected a propertyTexture with a class ${o.id}`);let c=a.properties[s.id],u=e.textures[c.index],f=e.images[u.source]?.bufferView,d=Fi.getBufferViewLoader({gltf:e,bufferViewId:f,gltfResource:t,baseResource:t});return await d.load(),await $g({uint8Array:new Uint8Array(d.typedArray),format:"image/png",flipY:!1,skipColorSpaceConversion:!0})}function vW(e,t,n,i,r){let o=n.isBottomOfSubtree(),a=mae(e,1,i,r),c=n.getDescendantCoordinates(a);return o?t.childSubtreeIsAvailableAtCoordinates(c):t.tileIsAvailableAtCoordinates(c)}function mae(e,t,n,i){let{subdivisionScheme:r,subtreeLevels:o}=e;return new d0({subdivisionScheme:r,subtreeLevels:o,level:t,x:n,y:i})}Y0.prototype.loadTileDataAvailability=function(e,t,n){};Y0.prototype.getLevelMaximumGeometricError=function(e){let t=this._ellipsoid;return Xr.getEstimatedLevelZeroGeometricErrorForAHeightmap(t,64,2)/(1<<e)};Object.defineProperties(Y0.prototype,{errorEvent:{get:function(){return this._errorEvent}},credit:{get:function(){return this._credit}},tilingScheme:{get:function(){return this._tilingScheme}},hasWaterMask:{get:function(){return this._requestWaterMask}},hasVertexNormals:{get:function(){return this._requestVertexNormals}},availability:{get:function(){return this._subtreeCache}}});function z8t(e,t,n){this.rootId=e,this.subtree=t,this.stamp=n}function FC(e){this._maximumSubtreeCount=e.maximumSubtreeCount??0,this._subtreeRequestCounter=0,this._queue=new K_({comparator:FC.comparator}),this._provider=e.provider}FC.comparator=function(e,t){let n=e.subtree.implicitCoordinates,i=t.subtree.implicitCoordinates;return n.isAncestor(i)?1:i.isAncestor(n)?-1:e.stamp-t.stamp};FC.prototype.addSubtree=function(e,t){let n=new z8t(e,t,this._subtreeRequestCounter);this._queue.insert(n),this._subtreeRequestCounter++;let i=t.implicitCoordinates;if(i.level>0){let r=i.getParentSubtreeCoordinates(),o=this.find(e,r)}if(this._maximumSubtreeCount>0)for(;this._queue.length>this._maximumSubtreeCount&&this._queue.getMinimum()!==n;)this._queue.removeMinimum()};FC.prototype.find=function(e,t){let n=this._queue,i=n.internalArray,{level:r,x:o,y:s}=t;for(let a=0;a<n.length;a++){let c=i[a],u=c.rootId,f=c.subtree.implicitCoordinates;if(u===e&&f.level===r&&f.x===o&&f.y===s)return c.subtree}};FC.prototype._computeMaximumImplicitTileCoordinatesAtPosition=function(e){let{longitude:t,latitude:n}=e,i=this._provider,r=t<0?0:1,o=r===0?i._tileset0:i._tileset1,s=o.subtreeLevels,a=mae(o,0,0,0),c=this.find(r,a);if(c===void 0)return;let u=c.implicitCoordinates,f=u.x,d=u.y,p=u.level,g=-D.PI,m=+D.PI,y=D.lerp(g,m,r/2),A=D.lerp(g,m,(r+1)/2),b=-D.PI*.5,x=+D.PI*.5,T=0,E=0,v=!0;for(;v;){let I=1/(1<<p),R=(A-y)*I,O=y+f*R,L=(x-b)*I,_=b+d*L;T=(t-O)/R,E=(n-_)/L;let C=_2e(o,u,T,E,s);if(c.childSubtreeIsAvailableAtCoordinates(C)){let w=this.find(r,C);if(w!==void 0)c=w,u=c.implicitCoordinates,f=u.x,d=u.y,p=u.level;else return C}else v=!1}let S;for(let I=0;I<s;I++){let R=_2e(o,u,T,E,I);if(c.tileIsAvailableAtCoordinates(R))S=R;else break}return S};function _2e(e,t,n,i,r){let o=1<<r,s=D.clamp(n*o|0,0,o-1),a=D.clamp(i*o|0,0,o-1),c=mae(e,r,s,a);return t.getDescendantCoordinates(c)}FC.prototype.computeMaximumLevelAtPosition=function(e){let t=this._computeMaximumImplicitTileCoordinatesAtPosition(e);return t===void 0?0:t.level};var pae=Y0;function zb(e){e=e??H.EMPTY_OBJECT,this._quantizedVertices=e.quantizedVertices,this._encodedNormals=e.encodedNormals,this._indices=e.indices,this._minimumHeight=e.minimumHeight,this._maximumHeight=e.maximumHeight,this._boundingSphere=e.boundingSphere,this._orientedBoundingBox=e.orientedBoundingBox,this._horizonOcclusionPoint=e.horizonOcclusionPoint,this._credits=e.credits;let t=this._quantizedVertices.length/3,n=this._uValues=this._quantizedVertices.subarray(0,t),i=this._vValues=this._quantizedVertices.subarray(t,2*t);this._heightValues=this._quantizedVertices.subarray(2*t,3*t);function r(s,a){return i[s]-i[a]}function o(s,a){return n[s]-n[a]}this._westIndices=wW(e.westIndices,r,t),this._southIndices=wW(e.southIndices,o,t),this._eastIndices=wW(e.eastIndices,r,t),this._northIndices=wW(e.northIndices,o,t),this._westSkirtHeight=e.westSkirtHeight,this._southSkirtHeight=e.southSkirtHeight,this._eastSkirtHeight=e.eastSkirtHeight,this._northSkirtHeight=e.northSkirtHeight,this._childTileMask=e.childTileMask??15,this._createdByUpsampling=e.createdByUpsampling??!1,this._waterMask=e.waterMask,this._mesh=void 0}Object.defineProperties(zb.prototype,{credits:{get:function(){return this._credits}},waterMask:{get:function(){return this._waterMask}},childTileMask:{get:function(){return this._childTileMask}},canUpsample:{get:function(){return l(this._mesh)}}});var SW=[];function wW(e,t,n){SW.length=e.length;let i=!1;for(let r=0,o=e.length;r<o;++r)SW[r]=e[r],i=i||r>0&&t(e[r-1],e[r])>0;return i?(SW.sort(t),je.createTypedArray(n,SW)):e}var b2e="createVerticesFromQuantizedTerrainMesh",V8t=new $n(b2e),j8t=new $n(b2e,rf.maximumAsynchronousTasks);zb.prototype.createMesh=function(e){e=e??H.EMPTY_OBJECT;let t=e.tilingScheme,n=e.x,i=e.y,r=e.level,o=e.exaggeration??1,s=e.exaggerationRelativeHeight??0,a=e.throttle??!0,c=t.ellipsoid,u=t.tileXYToRectangle(n,i,r),d=(a?j8t:V8t).scheduleTask({minimumHeight:this._minimumHeight,maximumHeight:this._maximumHeight,quantizedVertices:this._quantizedVertices,octEncodedNormals:this._encodedNormals,includeWebMercatorT:!0,indices:this._indices,westIndices:this._westIndices,southIndices:this._southIndices,eastIndices:this._eastIndices,northIndices:this._northIndices,westSkirtHeight:this._westSkirtHeight,southSkirtHeight:this._southSkirtHeight,eastSkirtHeight:this._eastSkirtHeight,northSkirtHeight:this._northSkirtHeight,rectangle:u,relativeToCenter:this._boundingSphere.center,ellipsoid:c,exaggeration:o,exaggerationRelativeHeight:s});if(!l(d))return;let p=this;return Promise.resolve(d).then(function(g){let m=p._quantizedVertices.length/3,y=m+p._westIndices.length+p._southIndices.length+p._eastIndices.length+p._northIndices.length,A=je.createTypedArray(y,g.indices),b=new Float32Array(g.vertices),x=g.center,T=g.minimumHeight,E=g.maximumHeight,v=p._boundingSphere,S=p._orientedBoundingBox,I=h.clone(g.occludeePointInScaledSpace)??p._horizonOcclusionPoint,R=g.vertexStride,O=Eo.clone(g.encoding);return p._mesh=new Ac(x,b,A,g.indexCountWithoutSkirts,m,T,E,u,v,I,R,S,O,g.westIndicesSouthToNorth,g.southIndicesEastToWest,g.eastIndicesNorthToSouth,g.northIndicesWestToEast),p._quantizedVertices=void 0,p._encodedNormals=void 0,p._indices=void 0,p._uValues=void 0,p._vValues=void 0,p._heightValues=void 0,p._westIndices=void 0,p._southIndices=void 0,p._eastIndices=void 0,p._northIndices=void 0,p._mesh})};var H8t=new $n("upsampleQuantizedTerrainMesh",rf.maximumAsynchronousTasks);zb.prototype.upsample=function(e,t,n,i,r,o,s){let a=this._mesh;if(!l(this._mesh))return;let c=t*2!==r,u=n*2===o,f=e.ellipsoid,d=e.tileXYToRectangle(r,o,s),p=H8t.scheduleTask({vertices:a.vertices,vertexCountWithoutSkirts:a.vertexCountWithoutSkirts,indices:a.indices,indexCountWithoutSkirts:a.indexCountWithoutSkirts,encoding:a.encoding,minimumHeight:this._minimumHeight,maximumHeight:this._maximumHeight,isEastChild:c,isNorthChild:u,childRectangle:d,ellipsoid:f});if(!l(p))return;let g=Math.min(this._westSkirtHeight,this._eastSkirtHeight);g=Math.min(g,this._southSkirtHeight),g=Math.min(g,this._northSkirtHeight);let m=c?g*.5:this._westSkirtHeight,y=u?g*.5:this._southSkirtHeight,A=c?this._eastSkirtHeight:g*.5,b=u?this._northSkirtHeight:g*.5,x=this._credits;return Promise.resolve(p).then(function(T){let E=new Uint16Array(T.vertices),v=je.createTypedArray(E.length/3,T.indices),S;return l(T.encodedNormals)&&(S=new Uint8Array(T.encodedNormals)),new zb({quantizedVertices:E,indices:v,encodedNormals:S,minimumHeight:T.minimumHeight,maximumHeight:T.maximumHeight,boundingSphere:ue.clone(T.boundingSphere),orientedBoundingBox:en.clone(T.orientedBoundingBox),horizonOcclusionPoint:h.clone(T.horizonOcclusionPoint),westIndices:T.westIndices,southIndices:T.southIndices,eastIndices:T.eastIndices,northIndices:T.northIndices,westSkirtHeight:m,southSkirtHeight:y,eastSkirtHeight:A,northSkirtHeight:b,childTileMask:0,credits:x,createdByUpsampling:!0})})};var gae=32767,x2e=new h;zb.prototype.interpolateHeight=function(e,t,n){let i=D.clamp((t-e.west)/e.width,0,1);i*=gae;let r=D.clamp((n-e.south)/e.height,0,1);return r*=gae,l(this._mesh)?Y8t(this,i,r):X8t(this,i,r)};function T2e(e,t,n,i,r,o,s,a){let c=Math.min(n,r,s),u=Math.max(n,r,s),f=Math.min(i,o,a),d=Math.max(i,o,a);return e>=c&&e<=u&&t>=f&&t<=d}var G8t=new U,W8t=new U,q8t=new U;function Y8t(e,t,n){let i=e._mesh,r=i.vertices,o=i.encoding,s=i.indices;for(let a=0,c=s.length;a<c;a+=3){let u=s[a],f=s[a+1],d=s[a+2],p=o.decodeTextureCoordinates(r,u,G8t),g=o.decodeTextureCoordinates(r,f,W8t),m=o.decodeTextureCoordinates(r,d,q8t);if(T2e(t,n,p.x,p.y,g.x,g.y,m.x,m.y)){let y=fp.computeBarycentricCoordinates(t,n,p.x,p.y,g.x,g.y,m.x,m.y,x2e);if(y.x>=-1e-15&&y.y>=-1e-15&&y.z>=-1e-15){let A=o.decodeHeight(r,u),b=o.decodeHeight(r,f),x=o.decodeHeight(r,d);return y.x*A+y.y*b+y.z*x}}}}function X8t(e,t,n){let i=e._uValues,r=e._vValues,o=e._heightValues,s=e._indices;for(let a=0,c=s.length;a<c;a+=3){let u=s[a],f=s[a+1],d=s[a+2],p=i[u],g=i[f],m=i[d],y=r[u],A=r[f],b=r[d];if(T2e(t,n,p,y,g,A,m,b)){let x=fp.computeBarycentricCoordinates(t,n,p,y,g,A,m,b,x2e);if(x.x>=-1e-15&&x.y>=-1e-15&&x.z>=-1e-15){let T=x.x*o[u]+x.y*o[f]+x.z*o[d];return D.lerp(e._minimumHeight,e._maximumHeight,T/gae)}}}}zb.prototype.isChildAvailable=function(e,t,n,i){let r=2;return n!==e*2&&++r,i!==t*2&&(r-=2),(this._childTileMask&1<<r)!==0};zb.prototype.wasCreatedByUpsampling=function(){return this._createdByUpsampling};var BC=zb;function K8t(e){this.resource=e.resource,this.version=e.version,this.isHeightmap=e.isHeightmap,this.tileUrlTemplates=e.tileUrlTemplates,this.availability=e.availability,this.hasVertexNormals=e.hasVertexNormals,this.hasWaterMask=e.hasWaterMask,this.hasMetadata=e.hasMetadata,this.availabilityLevels=e.availabilityLevels,this.availabilityTilesLoaded=e.availabilityTilesLoaded,this.littleEndianExtensionSize=e.littleEndianExtensionSize,this.availabilityPromiseCache={}}function C2e(e){this.requestVertexNormals=e.requestVertexNormals??!1,this.requestWaterMask=e.requestWaterMask??!1,this.requestMetadata=e.requestMetadata??!0,this.ellipsoid=e.ellipsoid??ee.default,this.heightmapWidth=65,this.heightmapStructure=void 0,this.hasWaterMask=!1,this.hasMetadata=!1,this.hasVertexNormals=!1,this.scheme=void 0,this.lastResource=void 0,this.layerJsonResource=void 0,this.previousError=void 0,this.availability=void 0,this.tilingScheme=void 0,this.levelZeroMaximumGeometricError=void 0,this.heightmapStructure=void 0,this.layers=[],this.attribution="",this.overallAvailability=[],this.overallMaxZoom=0,this.tileCredits=[]}C2e.prototype.build=function(e){e._heightmapWidth=this.heightmapWidth,e._scheme=this.scheme;let t=l(this.lastResource.credits)?this.lastResource.credits:[];e._tileCredits=t.concat(this.tileCredits),e._availability=this.availability,e._tilingScheme=this.tilingScheme,e._requestWaterMask=this.requestWaterMask,e._levelZeroMaximumGeometricError=this.levelZeroMaximumGeometricError,e._heightmapStructure=this.heightmapStructure,e._layers=this.layers,e._hasWaterMask=this.hasWaterMask,e._hasVertexNormals=this.hasVertexNormals,e._hasMetadata=this.hasMetadata};async function v2e(e,t,n){if(!t.format){let y="The tile format is not specified in the layer.json file.";throw e.previousError=Zr.reportError(e.previousError,n,l(n)?n._errorEvent:void 0,y),new oe(y)}if(!t.tiles||t.tiles.length===0){let y="The layer.json file does not specify any tile URL templates.";throw e.previousError=Zr.reportError(e.previousError,n,l(n)?n._errorEvent:void 0,y),new oe(y)}let i=!1,r=!1,o=!1,s=!0,a=!1;if(t.format==="heightmap-1.0")a=!0,l(e.heightmapStructure)||(e.heightmapStructure={heightScale:1/5,heightOffset:-1e3,elementsPerHeight:1,stride:1,elementMultiplier:256,isBigEndian:!1,lowestEncodedHeight:0,highestEncodedHeight:256*256-1}),r=!0,e.requestWaterMask=!0;else if(t.format.indexOf("quantized-mesh-1.")!==0){let y=`The tile format "${t.format}" is invalid or not supported.`;throw e.previousError=Zr.reportError(e.previousError,n,l(n)?n._errorEvent:void 0,y),new oe(y)}let c=t.tiles,u=t.maxzoom;if(e.overallMaxZoom=Math.max(e.overallMaxZoom,u),!t.projection||t.projection==="EPSG:4326")e.tilingScheme=new Qi({numberOfLevelZeroTilesX:2,numberOfLevelZeroTilesY:1,ellipsoid:e.ellipsoid});else if(t.projection==="EPSG:3857")e.tilingScheme=new Fo({numberOfLevelZeroTilesX:1,numberOfLevelZeroTilesY:1,ellipsoid:e.ellipsoid});else{let y=`The projection "${t.projection}" is invalid or not supported.`;throw e.previousError=Zr.reportError(e.previousError,n,l(n)?n._errorEvent:void 0,y),new oe(y)}if(e.levelZeroMaximumGeometricError=Xr.getEstimatedLevelZeroGeometricErrorForAHeightmap(e.tilingScheme.ellipsoid,e.heightmapWidth,e.tilingScheme.getNumberOfXTilesAtLevel(0)),!t.scheme||t.scheme==="tms"||t.scheme==="slippyMap")e.scheme=t.scheme;else{let y=`The scheme "${t.scheme}" is invalid or not supported.`;throw e.previousError=Zr.reportError(e.previousError,n,l(n)?n._errorEvent:void 0,y),new oe(y)}let f;l(t.extensions)&&t.extensions.indexOf("octvertexnormals")!==-1?i=!0:l(t.extensions)&&t.extensions.indexOf("vertexnormals")!==-1&&(i=!0,s=!1),l(t.extensions)&&t.extensions.indexOf("watermask")!==-1&&(r=!0),l(t.extensions)&&t.extensions.indexOf("metadata")!==-1&&(o=!0);let d=t.metadataAvailability,p=t.available,g;if(l(p)&&!l(d)){g=new up(e.tilingScheme,p.length);for(let y=0;y<p.length;++y){let A=p[y],b=e.tilingScheme.getNumberOfYTilesAtLevel(y);l(e.overallAvailability[y])||(e.overallAvailability[y]=[]);for(let x=0;x<A.length;++x){let T=A[x],E=b-T.endY-1,v=b-T.startY-1;e.overallAvailability[y].push([T.startX,E,T.endX,v]),g.addAvailableTileRange(y,T.startX,E,T.endX,v)}}}else l(d)&&(f=new up(e.tilingScheme,u),g=new up(e.tilingScheme,u),e.overallAvailability[0]=[[0,0,1,0]],g.addAvailableTileRange(0,0,0,1,0));e.hasWaterMask=e.hasWaterMask||r,e.hasVertexNormals=e.hasVertexNormals||i,e.hasMetadata=e.hasMetadata||o,l(t.attribution)&&(e.attribution.length>0&&(e.attribution+=" "),e.attribution+=t.attribution),e.layers.push(new K8t({resource:e.lastResource,version:t.version,isHeightmap:a,tileUrlTemplates:c,availability:g,hasVertexNormals:i,hasWaterMask:r,hasMetadata:o,availabilityLevels:d,availabilityTilesLoaded:f,littleEndianExtensionSize:s}));let m=t.parentUrl;return l(m)?l(g)?(e.lastResource=e.lastResource.getDerivedResource({url:m}),e.lastResource.appendForwardSlash(),e.layerJsonResource=e.lastResource.getDerivedResource({url:"layer.json"}),await Aae(e),!0):(console.log("A layer.json can't have a parentUrl if it does't have an available array."),!0):!0}function $8t(e,t,n){let i=`An error occurred while accessing ${e.layerJsonResource.url}.`;if(l(t)&&(i+=` +${t.message}`),e.previousError=Zr.reportError(e.previousError,n,l(n)?n._errorEvent:void 0,i),e.previousError.retry)return Aae(e,n);throw new oe(i)}async function J8t(e,t,n){await v2e(e,t,n);let i=e.overallAvailability.length;if(i>0){let r=e.availability=new up(e.tilingScheme,e.overallMaxZoom);for(let o=0;o<i;++o){let s=e.overallAvailability[o];for(let a=0;a<s.length;++a){let c=s[a];r.addAvailableTileRange(o,c[0],c[1],c[2],c[3])}}}if(e.attribution.length>0){let r=new It(e.attribution);e.tileCredits.push(r)}return!0}async function Aae(e,t){try{let n=await e.layerJsonResource.fetchJson();return J8t(e,n,t)}catch(n){return l(n)&&n.statusCode===404?(await v2e(e,{tilejson:"2.1.0",format:"heightmap-1.0",version:"1.0.0",scheme:"tms",tiles:["{z}/{x}/{y}.terrain?v={version}"]},t),!0):$8t(e,n,t)}}function dp(e){e=e??H.EMPTY_OBJECT,this._heightmapWidth=void 0,this._heightmapStructure=void 0,this._hasWaterMask=!1,this._hasVertexNormals=!1,this._hasMetadata=!1,this._scheme=void 0,this._ellipsoid=e.ellipsoid,this._requestVertexNormals=e.requestVertexNormals??!1,this._requestWaterMask=e.requestWaterMask??!1,this._requestMetadata=e.requestMetadata??!0,this._errorEvent=new be;let t=e.credit;typeof t=="string"&&(t=new It(t)),this._credit=t,this._availability=void 0,this._tilingScheme=void 0,this._levelZeroMaximumGeometricError=void 0,this._layers=void 0,this._tileCredits=void 0}var _ae={OCT_VERTEX_NORMALS:1,WATER_MASK:2,METADATA:4};function E2e(e){return!l(e)||e.length===0?{Accept:"application/vnd.quantized-mesh,application/octet-stream;q=0.9,*/*;q=0.01"}:{Accept:`application/vnd.quantized-mesh;extensions=${e.join("-")},application/octet-stream;q=0.9,*/*;q=0.01`}}function Z8t(e,t,n,i,r){let o=new Uint16Array(t,0,e._heightmapWidth*e._heightmapWidth);return new zc({buffer:o,childTileMask:new Uint8Array(t,o.byteLength,1)[0],waterMask:new Uint8Array(t,o.byteLength+1,t.byteLength-o.byteLength-1),width:e._heightmapWidth,height:e._heightmapWidth,structure:e._heightmapStructure,credits:e._tileCredits})}function Q8t(e,t,n,i,r,o){let s=o.littleEndianExtensionSize,a=0,c=3,u=c+1,f=Float64Array.BYTES_PER_ELEMENT*c,d=Float64Array.BYTES_PER_ELEMENT*u,g=Uint16Array.BYTES_PER_ELEMENT*3,m=3,y=Uint16Array.BYTES_PER_ELEMENT,A=y*m,b=new DataView(t),x=new h(b.getFloat64(a,!0),b.getFloat64(a+8,!0),b.getFloat64(a+16,!0));a+=f;let T=b.getFloat32(a,!0);a+=Float32Array.BYTES_PER_ELEMENT;let E=b.getFloat32(a,!0);a+=Float32Array.BYTES_PER_ELEMENT;let v=new ue(new h(b.getFloat64(a,!0),b.getFloat64(a+8,!0),b.getFloat64(a+16,!0)),b.getFloat64(a+f,!0));a+=d;let S=new h(b.getFloat64(a,!0),b.getFloat64(a+8,!0),b.getFloat64(a+16,!0));a+=f;let I=b.getUint32(a,!0);a+=Uint32Array.BYTES_PER_ELEMENT;let R=new Uint16Array(t,a,I*3);a+=I*g,I>64*1024&&(y=Uint32Array.BYTES_PER_ELEMENT,A=y*m);let O=R.subarray(0,I),L=R.subarray(I,2*I),_=R.subarray(I*2,3*I);cn.zigZagDeltaDecode(O,L,_),a%y!==0&&(a+=y-a%y);let C=b.getUint32(a,!0);a+=Uint32Array.BYTES_PER_ELEMENT;let w=je.createTypedArrayFromArrayBuffer(I,t,a,C*m);a+=C*A;let P=0,M=w.length;for(let fe=0;fe<M;++fe){let xe=w[fe];w[fe]=P-xe,xe===0&&++P}let F=b.getUint32(a,!0);a+=Uint32Array.BYTES_PER_ELEMENT;let V=je.createTypedArrayFromArrayBuffer(I,t,a,F);a+=F*y;let B=b.getUint32(a,!0);a+=Uint32Array.BYTES_PER_ELEMENT;let j=je.createTypedArrayFromArrayBuffer(I,t,a,B);a+=B*y;let k=b.getUint32(a,!0);a+=Uint32Array.BYTES_PER_ELEMENT;let G=je.createTypedArrayFromArrayBuffer(I,t,a,k);a+=k*y;let q=b.getUint32(a,!0);a+=Uint32Array.BYTES_PER_ELEMENT;let Q=je.createTypedArrayFromArrayBuffer(I,t,a,q);a+=q*y;let W,J;for(;a<b.byteLength;){let fe=b.getUint8(a,!0);a+=Uint8Array.BYTES_PER_ELEMENT;let xe=b.getUint32(a,s);if(a+=Uint32Array.BYTES_PER_ELEMENT,fe===_ae.OCT_VERTEX_NORMALS&&e._requestVertexNormals)W=new Uint8Array(t,a,I*2);else if(fe===_ae.WATER_MASK&&e._requestWaterMask)J=new Uint8Array(t,a,xe);else if(fe===_ae.METADATA&&e._requestMetadata){let ge=b.getUint32(a,!0);if(ge>0){let Se=No(new Uint8Array(t),a+Uint32Array.BYTES_PER_ELEMENT,ge).available;if(l(Se))for(let Re=0;Re<Se.length;++Re){let Qe=n+Re+1,He=Se[Re],Xe=e._tilingScheme.getNumberOfYTilesAtLevel(Qe);for(let $e=0;$e<He.length;++$e){let Pe=He[$e],qe=Xe-Pe.endY-1,st=Xe-Pe.startY-1;e.availability.addAvailableTileRange(Qe,Pe.startX,qe,Pe.endX,st),o.availability.addAvailableTileRange(Qe,Pe.startX,qe,Pe.endX,st)}}}o.availabilityTilesLoaded.addAvailableTileRange(n,i,r,i,r)}a+=xe}let Z=e.getLevelMaximumGeometricError(n)*5,ae=e._tilingScheme.tileXYToRectangle(i,r,n),Ae=en.fromRectangle(ae,T,E,e._tilingScheme.ellipsoid);return new BC({center:x,minimumHeight:T,maximumHeight:E,boundingSphere:v,orientedBoundingBox:Ae,horizonOcclusionPoint:S,quantizedVertices:R,encodedNormals:W,indices:w,westIndices:V,southIndices:j,eastIndices:G,northIndices:Q,westSkirtHeight:Z,southSkirtHeight:Z,eastSkirtHeight:Z,northSkirtHeight:Z,childTileMask:e.availability.computeChildMaskForTile(n,i,r),waterMask:J,credits:e._tileCredits})}dp.prototype.requestTileGeometry=function(e,t,n,i){let r=this._layers,o,s=r.length,a=!1,c=Promise.resolve();if(s===1)o=r[0];else for(let u=0;u<s;++u){let f=r[u];if(!l(f.availability)||f.availability.isTileAvailable(n,e,t)){o=f;break}let d=bae(this,e,t,n,f,u===0);d.result&&(a=!0,c=c.then(()=>d.promise))}return!l(o)&&a?c.then(()=>new Promise(u=>{setTimeout(()=>{let f=this.requestTileGeometry(e,t,n,i);u(f)},0)})):S2e(this,e,t,n,o,i)};function S2e(e,t,n,i,r,o){if(!l(r))return Promise.reject(new oe("Terrain tile doesn't exist"));let s=r.tileUrlTemplates;if(s.length===0)return;let a;!e._scheme||e._scheme==="tms"?a=e._tilingScheme.getNumberOfYTilesAtLevel(i)-n-1:a=n;let c=[];e._requestVertexNormals&&r.hasVertexNormals&&c.push(r.littleEndianExtensionSize?"octvertexnormals":"vertexnormals"),e._requestWaterMask&&r.hasWaterMask&&c.push("watermask"),e._requestMetadata&&r.hasMetadata&&c.push("metadata");let u,f,d=s[(t+a+i)%s.length],p=r.resource;l(p._ionEndpoint)&&!l(p._ionEndpoint.externalType)?(c.length!==0&&(f={extensions:c.join("-")}),u=E2e(void 0)):u=E2e(c);let g=p.getDerivedResource({url:d,templateValues:{version:r.version,z:i,x:t,y:a},queryParameters:f,headers:u,request:o}).fetchArrayBuffer();if(l(g))return g.then(function(m){return l(m)?l(e._heightmapStructure)?Z8t(e,m,i,t,n):Q8t(e,m,i,t,n,r):Promise.reject(new oe("Mesh buffer doesn't exist."))})}Object.defineProperties(dp.prototype,{errorEvent:{get:function(){return this._errorEvent}},credit:{get:function(){return this._credit}},tilingScheme:{get:function(){return this._tilingScheme}},hasWaterMask:{get:function(){return this._hasWaterMask&&this._requestWaterMask}},hasVertexNormals:{get:function(){return this._hasVertexNormals&&this._requestVertexNormals}},hasMetadata:{get:function(){return this._hasMetadata&&this._requestMetadata}},requestVertexNormals:{get:function(){return this._requestVertexNormals}},requestWaterMask:{get:function(){return this._requestWaterMask}},requestMetadata:{get:function(){return this._requestMetadata}},availability:{get:function(){return this._availability}}});dp.prototype.getLevelMaximumGeometricError=function(e){return this._levelZeroMaximumGeometricError/(1<<e)};dp.fromIonAssetId=async function(e,t){let n=await Yo.fromAssetId(e);return dp.fromUrl(n,t)};dp.fromUrl=async function(e,t){t=t??H.EMPTY_OBJECT,e=await Promise.resolve(e);let n=De.createIfNeeded(e);n.appendForwardSlash();let i=new C2e(t);i.lastResource=n,i.layerJsonResource=i.lastResource.getDerivedResource({url:"layer.json"}),await Aae(i);let r=new dp(t);return i.build(r),r};dp.prototype.getTileDataAvailable=function(e,t,n){if(!l(this._availability))return;if(n>this._availability._maximumLevel)return!1;if(this._availability.isTileAvailable(n,e,t))return!0;if(!this._hasMetadata)return!1;let i=this._layers,r=i.length;for(let o=0;o<r;++o)if(bae(this,e,t,n,i[o],o===0).result)return;return!1};dp.prototype.loadTileDataAvailability=function(e,t,n){if(!l(this._availability)||n>this._availability._maximumLevel||this._availability.isTileAvailable(n,e,t)||!this._hasMetadata)return;let i=this._layers,r=i.length;for(let o=0;o<r;++o){let s=bae(this,e,t,n,i[o],o===0);if(l(s.promise))return s.promise}};function yae(e,t,n,i){if(i===0)return;let r=e.availabilityLevels,o=i%r===0?i-r:(i/r|0)*r,s=1<<i-o,a=t/s|0,c=n/s|0;return{level:o,x:a,y:c}}function bae(e,t,n,i,r,o){if(!l(r.availabilityLevels))return{result:!1};let s,a=function(){delete r.availabilityPromiseCache[s]},c=r.availabilityTilesLoaded,u=r.availability,f=yae(r,t,n,i);for(;l(f);){if(u.isTileAvailable(f.level,f.x,f.y)&&!c.isTileAvailable(f.level,f.x,f.y)){let d;if(!o&&(s=`${f.level}-${f.x}-${f.y}`,d=r.availabilityPromiseCache[s],!l(d))){let p=new wo({throttle:!1,throttleByServer:!0,type:Zs.TERRAIN});d=S2e(e,f.x,f.y,f.level,r,p),l(d)&&(r.availabilityPromiseCache[s]=d,d.then(a))}return{result:!0,promise:d}}f=yae(r,f.x,f.y,f.level)}return{result:!1}}dp._getAvailabilityTile=yae;var kC=dp;function gy(e){e=e??H.EMPTY_OBJECT;let t=e.radius,n={center:e.center,semiMajorAxis:t,semiMinorAxis:t,ellipsoid:e.ellipsoid,height:e.height,extrudedHeight:e.extrudedHeight,granularity:e.granularity,vertexFormat:e.vertexFormat,stRotation:e.stRotation,shadowVolume:e.shadowVolume};this._ellipseGeometry=new nu(n),this._workerName="createCircleGeometry"}gy.packedLength=nu.packedLength;gy.pack=function(e,t,n){return nu.pack(e._ellipseGeometry,t,n)};var w2e=new nu({center:new h,semiMajorAxis:1,semiMinorAxis:1}),Gc={center:new h,radius:void 0,ellipsoid:ee.clone(ee.default),height:void 0,extrudedHeight:void 0,granularity:void 0,vertexFormat:new Be,stRotation:void 0,semiMajorAxis:void 0,semiMinorAxis:void 0,shadowVolume:void 0};gy.unpack=function(e,t,n){let i=nu.unpack(e,t,w2e);return Gc.center=h.clone(i._center,Gc.center),Gc.ellipsoid=ee.clone(i._ellipsoid,Gc.ellipsoid),Gc.ellipsoid=ee.clone(i._ellipsoid,w2e._ellipsoid),Gc.height=i._height,Gc.extrudedHeight=i._extrudedHeight,Gc.granularity=i._granularity,Gc.vertexFormat=Be.clone(i._vertexFormat,Gc.vertexFormat),Gc.stRotation=i._stRotation,Gc.shadowVolume=i._shadowVolume,l(n)?(Gc.semiMajorAxis=i._semiMajorAxis,Gc.semiMinorAxis=i._semiMinorAxis,n._ellipseGeometry=new nu(Gc),n):(Gc.radius=i._semiMajorAxis,new gy(Gc))};gy.createGeometry=function(e){return nu.createGeometry(e._ellipseGeometry)};gy.createShadowVolume=function(e,t,n){let i=e._ellipseGeometry._granularity,r=e._ellipseGeometry._ellipsoid,o=t(i,r),s=n(i,r);return new gy({center:e._ellipseGeometry._center,radius:e._ellipseGeometry._semiMajorAxis,ellipsoid:r,stRotation:e._ellipseGeometry._stRotation,granularity:i,extrudedHeight:o,height:s,vertexFormat:Be.POSITION_ONLY,shadowVolume:!0})};Object.defineProperties(gy.prototype,{rectangle:{get:function(){return this._ellipseGeometry.rectangle}},textureCoordinateRotationPoints:{get:function(){return this._ellipseGeometry.textureCoordinateRotationPoints}}});var xae=gy;function BP(e){e=e??H.EMPTY_OBJECT;let t=e.radius,n={center:e.center,semiMajorAxis:t,semiMinorAxis:t,ellipsoid:e.ellipsoid,height:e.height,extrudedHeight:e.extrudedHeight,granularity:e.granularity,numberOfVerticalLines:e.numberOfVerticalLines};this._ellipseGeometry=new Lf(n),this._workerName="createCircleOutlineGeometry"}BP.packedLength=Lf.packedLength;BP.pack=function(e,t,n){return Lf.pack(e._ellipseGeometry,t,n)};var ejt=new Lf({center:new h,semiMajorAxis:1,semiMinorAxis:1}),gd={center:new h,radius:void 0,ellipsoid:ee.clone(ee.UNIT_SPHERE),height:void 0,extrudedHeight:void 0,granularity:void 0,numberOfVerticalLines:void 0,semiMajorAxis:void 0,semiMinorAxis:void 0};BP.unpack=function(e,t,n){let i=Lf.unpack(e,t,ejt);return gd.center=h.clone(i._center,gd.center),gd.ellipsoid=ee.clone(i._ellipsoid,gd.ellipsoid),gd.height=i._height,gd.extrudedHeight=i._extrudedHeight,gd.granularity=i._granularity,gd.numberOfVerticalLines=i._numberOfVerticalLines,l(n)?(gd.semiMajorAxis=i._semiMajorAxis,gd.semiMinorAxis=i._semiMinorAxis,n._ellipseGeometry=new Lf(gd),n):(gd.radius=i._semiMajorAxis,new BP(gd))};BP.createGeometry=function(e){return Lf.createGeometry(e._ellipseGeometry)};var Tae=BP;function tjt(e){return e=e??H.EMPTY_OBJECT,kC.fromIonAssetId(2426648,{requestVertexNormals:e.requestVertexNormals??!1})}var F4=tjt;function njt(e){return e=e??H.EMPTY_OBJECT,kC.fromIonAssetId(1,{requestVertexNormals:e.requestVertexNormals??!1,requestWaterMask:e.requestWaterMask??!1,ellipsoid:ee.WGS84})}var UC=njt;function kP(e){e=e??H.EMPTY_OBJECT,this._callback=e.callback,this._tilingScheme=e.tilingScheme,l(this._tilingScheme)||(this._tilingScheme=new Qi({ellipsoid:e.ellipsoid??ee.default})),this._width=e.width,this._height=e.height;let t=Math.max(this._width,this._height);this._levelZeroMaximumGeometricError=Xr.getEstimatedLevelZeroGeometricErrorForAHeightmap(this._tilingScheme.ellipsoid,t,this._tilingScheme.getNumberOfXTilesAtLevel(0)),this._errorEvent=new be;let n=e.credit;typeof n=="string"&&(n=new It(n)),this._credit=n}Object.defineProperties(kP.prototype,{errorEvent:{get:function(){return this._errorEvent}},credit:{get:function(){return this._credit}},tilingScheme:{get:function(){return this._tilingScheme}},hasWaterMask:{get:function(){return!1}},hasVertexNormals:{get:function(){return!1}},availability:{get:function(){}},width:{get:function(){return this._width}},height:{get:function(){return this._height}}});kP.prototype.requestTileGeometry=function(e,t,n,i){let r=this._callback(e,t,n);if(!l(r))return;let o=this._width,s=this._height;return Promise.resolve(r).then(function(a){let c=a;return Array.isArray(c)&&(c=new Float64Array(c)),new zc({buffer:c,width:o,height:s})})};kP.prototype.getLevelMaximumGeometricError=function(e){return this._levelZeroMaximumGeometricError/(1<<e)};kP.prototype.getTileDataAvailable=function(e,t,n){};kP.prototype.loadTileDataAvailability=function(e,t,n){};var Eae=kP;var ijt=1953029805,rjt=2917034100;function Cae(e,t){if(Cae.passThroughDataForTesting)return t;let n=e.byteLength;if(n===0||n%4!==0)throw new oe("The length of key must be greater than 0 and a multiple of 4.");let i=new DataView(t),r=i.getUint32(0,!0);if(r===ijt||r===rjt)return t;let o=new DataView(e),s=0,a=t.byteLength,c=a-a%8,u=n,f,d=8;for(;s<c;)for(d=(d+8)%24,f=d;s<c&&f<u;)i.setUint32(s,i.getUint32(s,!0)^o.getUint32(f,!0),!0),i.setUint32(s+4,i.getUint32(s+4,!0)^o.getUint32(f+4,!0),!0),s+=8,f+=24;if(s<a)for(f>=u&&(d=(d+8)%24,f=d);s<a;)i.setUint8(s,i.getUint8(s)^o.getUint8(f)),s++,f++}Cae.passThroughDataForTesting=!1;var B4=Cae;function I2e(e){this.proxy=e}I2e.prototype.getURL=function(e){let t=this.proxy.indexOf("?")===-1?"?":"";return this.proxy+t+encodeURIComponent(e)};var vae=I2e;function IW(){pe.throwInstantiationError()}Object.defineProperties(IW.prototype,{credit:{get:pe.throwInstantiationError}});IW.getCreditsFromResult=function(e){if(l(e.attributions))return e.attributions.map(It.getIonCredit)};IW.prototype.geocode=pe.throwInstantiationError;var UP=IW;var P2e={SEARCH:0,AUTOCOMPLETE:1};Object.freeze(P2e);var Vb=P2e;function D2e(){pe.throwInstantiationError()}D2e.createGeometry=function(e){pe.throwInstantiationError()};var Sae=D2e;var ujt=Qo(wae(),1);function ojt(e,t){return(e&t)!==0}var Pl=ojt;var sjt=[1,2,4,8],R2e=15,ajt=16,cjt=64,ljt=128;function X0(e,t,n,i,r,o){this._bits=e,this.cnodeVersion=t,this.imageryVersion=n,this.terrainVersion=i,this.imageryProvider=r,this.terrainProvider=o,this.ancestorHasTerrain=!1,this.terrainState=void 0}X0.clone=function(e,t){return l(t)?(t._bits=e._bits,t.cnodeVersion=e.cnodeVersion,t.imageryVersion=e.imageryVersion,t.terrainVersion=e.terrainVersion,t.imageryProvider=e.imageryProvider,t.terrainProvider=e.terrainProvider):t=new X0(e._bits,e.cnodeVersion,e.imageryVersion,e.terrainVersion,e.imageryProvider,e.terrainProvider),t.ancestorHasTerrain=e.ancestorHasTerrain,t.terrainState=e.terrainState,t};X0.prototype.setParent=function(e){this.ancestorHasTerrain=e.ancestorHasTerrain||this.hasTerrain()};X0.prototype.hasSubtree=function(){return Pl(this._bits,ajt)};X0.prototype.hasImagery=function(){return Pl(this._bits,cjt)};X0.prototype.hasTerrain=function(){return Pl(this._bits,ljt)};X0.prototype.hasChildren=function(){return Pl(this._bits,R2e)};X0.prototype.hasChild=function(e){return Pl(this._bits,sjt[e])};X0.prototype.getChildBitmask=function(){return this._bits&R2e};var U4=X0;function fjt(e){let t=e.length,n=new ArrayBuffer(t),i=new Uint8Array(n);for(let r=0;r<t;++r)i[r]=e.charCodeAt(r);return n}var djt=fjt(`E\xF4\xBD\vy\xE2jE"\x92,\xCDq\xF8IFgQ\0B%\xC6\xE8a,f)\b\xC64\xDCjb%y +wmi\xD6\xF0\x9Ck\x93\xA1\xBDNu\xE0A[\xDF@V\f\xD9\xBBr\x9B\x81|3S\xEEOl\xD4q\xB0{\xC0\x7FEVZ\xADwUe\v3\x92*\xACl5\xC50s\xF83>mF8J\xB4\xDD\xF0.\xDDu\xDA\x8CDt"\xFAa"\f3"So\xAF9D\v\x8C9\xD99L\xB9\xBF\x7F\xAB\\\x8CP_\x9F"ux\xE9\x07q\x91h;\xC1\xC4\x9B\x7F\xF0<VqH\x82'UfYNe\x98u\xA3aF}a?A\0\x9F\xD7\xB44M\xCE\x87F\xB0\xD5\xB8\x8A'{\x8B\xDC+\xBBMg0\xC8\xD1\xF6\\\x8FP\xFA[/F\x9Bn5/'C.\xEB +\f^\xA5s\x1Be4\xE5l.jC'c#U\xA9?q{gC}:\xAF\xCD\xE2TU\x9C\xFDK\xC6\xE2\x9F/(\xED\xCB\\\xC6-f\x07\x88\xA7;/*"N\xB0k.\xDD\r\x95}}G\xBAC\xB2\xB2+>M\xAA>}\xE6\xCEI\x89\xC6\xE6x\fa1-\xA4O\xA5~q \x88\xEC\r1\xE8N\v\0nPh}=\b\r\x95\xA6n\xA3h\x97$[k\xF3#\xF3\xB6s\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V9\0\xDAw\v\xCB-\x1B\x89\xFB5O\xF5\bQ\`\xC1 +ZGM&30x\xDA\xC0\x9CFG\xE2[y\`In7gS +>\xE9\xECF9\xB2\xF14\r\xC6\x84Sun\xE1\fY\xD9\xDE)\x85{II\xA5wy\xBEIV.6\xE7\v:\xBBOb{\xD2M1\x95/\xBD8{\xA8O!\xE1\xECFpv\x95})"x\x88 +\x90\xDD\x9D\\\xDA\xDEQ\xCF\xF0\xFCYRe|3\xDF\xF3H\xDA\xBB*u\xDB\`\xB2\xD4\xFC\xED\x1B\xEC\x7F5\xA8\xFF(1\x07-\xC8\xDC\x88F|\x8A["`);function _d(e){this.imageryPresent=!0,this.protoImagery=void 0,this.terrainPresent=!0,this.negativeAltitudeExponentBias=32,this.negativeAltitudeThreshold=D.EPSILON12,this.providers={},this.key=void 0,this._resource=void 0,this._quadPacketVersion=1,this._tileInfo={},this._subtreePromises={}}Object.defineProperties(_d.prototype,{url:{get:function(){return this._resource.url}},proxy:{get:function(){return this._resource.proxy}},resource:{get:function(){return this._resource}}});_d.fromUrl=async function(e){let t=e;typeof t!="string"&&!(t instanceof De)&&(t=e.url);let n=De.createIfNeeded(t);n.appendForwardSlash();let i=new _d;i._resource=n;try{await hjt(i),await i.getQuadTreePacket("",i._quadPacketVersion)}catch(r){let o=`An error occurred while accessing ${M2e(i,"",1).url}: ${r}`;throw new oe(o)}return i};_d.tileXYToQuadKey=function(e,t,n){let i="";for(let r=n;r>=0;--r){let o=1<<r,s=0;Pl(t,o)?Pl(e,o)&&(s|=1):(s|=2,Pl(e,o)||(s|=1)),i+=s}return i};_d.quadKeyToTileXY=function(e){let t=0,n=0,i=e.length-1;for(let r=i;r>=0;--r){let o=1<<r,s=+e[i-r];Pl(s,2)?Pl(s,1)||(t|=o):(n|=o,Pl(s,1)&&(t|=o))}return{x:t,y:n,level:i}};_d.prototype.isValid=function(e){let t=this.getTileInformationFromQuadKey(e);if(l(t))return t!==null;let n=!0,i=e,r;for(;i.length>1;)if(r=i.substring(i.length-1),i=i.substring(0,i.length-1),t=this.getTileInformationFromQuadKey(i),l(t)){!t.hasSubtree()&&!t.hasChild(parseInt(r))&&(n=!1);break}else if(t===null){n=!1;break}return n};var O2e=new $n("decodeGoogleEarthEnterprisePacket");_d.prototype.getQuadTreePacket=function(e,t,n){t=t??1,e=e??"";let r=M2e(this,e,t,n).fetchArrayBuffer();if(!l(r))return;let o=this._tileInfo,s=this.key;return r.then(function(a){return O2e.scheduleTask({buffer:a,quadKey:e,type:"Metadata",key:s},[a]).then(function(u){let f,d=-1;if(e!==""){d=e.length+1;let m=u[e];f=o[e],f._bits|=m._bits,delete u[e]}let p=Object.keys(u);p.sort(function(m,y){return m.length-y.length});let g=p.length;for(let m=0;m<g;++m){let y=p[m];if(u[y]!==null){let b=U4.clone(u[y]),x=y.length;if(x===d)b.setParent(f);else if(x>1){let T=o[y.substring(0,y.length-1)];b.setParent(T)}o[y]=b}else o[y]=null}})})};_d.prototype.populateSubtree=function(e,t,n,i){let r=_d.tileXYToQuadKey(e,t,n);return Dae(this,r,i)};function Dae(e,t,n){let i=e._tileInfo,r=t,o=i[r];if(l(o)&&(!o.hasSubtree()||o.hasChildren()))return o;for(;o===void 0&&r.length>1;)r=r.substring(0,r.length-1),o=i[r];let s,a=e._subtreePromises,c=a[r];if(l(c))return c.then(function(){return s=new wo({throttle:n.throttle,throttleByServer:n.throttleByServer,type:n.type,priorityFunction:n.priorityFunction}),Dae(e,t,s)});if(!l(o)||!o.hasSubtree())return Promise.reject(new oe(`Couldn't load metadata for tile ${t}`));if(c=e.getQuadTreePacket(r,o.cnodeVersion,n),!!l(c))return a[r]=c,c.then(function(){return s=new wo({throttle:n.throttle,throttleByServer:n.throttleByServer,type:n.type,priorityFunction:n.priorityFunction}),Dae(e,t,s)}).finally(function(){delete a[r]})}_d.prototype.getTileInformation=function(e,t,n){let i=_d.tileXYToQuadKey(e,t,n);return this._tileInfo[i]};_d.prototype.getTileInformationFromQuadKey=function(e){return this._tileInfo[e]};function M2e(e,t,n,i){return e._resource.getDerivedResource({url:`flatfile?q2-0${t}-q.${n.toString()}`,request:i})}var Iae,Pae;function hjt(e){let t=e._resource.getDerivedResource({url:"dbRoot.v5",queryParameters:{output:"proto"}});if(!l(Pae)){let n=Zt("ThirdParty/google-earth-dbroot-parser.js"),i=window.cesiumGoogleEarthDbRootParser;Pae=ix(n).then(function(){Iae=window.cesiumGoogleEarthDbRootParser(ujt),l(i)?window.cesiumGoogleEarthDbRootParser=i:delete window.cesiumGoogleEarthDbRootParser})}return Pae.then(function(){return t.fetchArrayBuffer()}).then(function(n){let i=Iae.EncryptedDbRootProto.decode(new Uint8Array(n)),r=i.encryptionData,o=r.byteOffset,s=o+r.byteLength,a=e.key=r.buffer.slice(o,s);r=i.dbrootData,o=r.byteOffset,s=o+r.byteLength;let c=r.buffer.slice(o,s);return O2e.scheduleTask({buffer:c,type:"DbRoot",key:a},[c])}).then(function(n){let i=Iae.DbRootProto.decode(new Uint8Array(n.buffer));if(e.imageryPresent=i.imageryPresent??e.imageryPresent,e.protoImagery=i.protoImagery,e.terrainPresent=i.terrainPresent??e.terrainPresent,l(i.endSnippet)&&l(i.endSnippet.model)){let a=i.endSnippet.model;e.negativeAltitudeExponentBias=a.negativeAltitudeExponentBias??e.negativeAltitudeExponentBias,e.negativeAltitudeThreshold=a.compressedNegativeAltitudeThreshold??e.negativeAltitudeThreshold}l(i.databaseVersion)&&(e._quadPacketVersion=i.databaseVersion.quadtreeVersion??e._quadPacketVersion);let r=e.providers,o=i.providerInfo??[],s=o.length;for(let a=0;a<s;++a){let c=o[a],u=c.copyrightString;l(u)&&(r[c.providerId]=new It(u.value))}}).catch(function(){console.log(`Failed to retrieve ${t.url}. Using defaults.`),e.key=djt})}var _y=_d;function zC(e){e=e??H.EMPTY_OBJECT,this._buffer=e.buffer,this._credits=e.credits,this._negativeAltitudeExponentBias=e.negativeAltitudeExponentBias,this._negativeElevationThreshold=e.negativeElevationThreshold;let t=e.childTileMask??15,n=t&3;n|=t&4?8:0,n|=t&8?4:0,this._childTileMask=n,this._createdByUpsampling=e.createdByUpsampling??!1,this._skirtHeight=void 0,this._bufferType=this._buffer.constructor,this._mesh=void 0,this._minimumHeight=void 0,this._maximumHeight=void 0}Object.defineProperties(zC.prototype,{credits:{get:function(){return this._credits}},waterMask:{get:function(){}}});var F2e="createVerticesFromGoogleEarthEnterpriseBuffer",mjt=new $n(F2e),pjt=new $n(F2e,rf.maximumAsynchronousTasks),N2e=new ie,PW=new ie;zC.prototype.createMesh=function(e){e=e??H.EMPTY_OBJECT;let t=e.tilingScheme,n=e.x,i=e.y,r=e.level,o=e.exaggeration??1,s=e.exaggerationRelativeHeight??0,a=e.throttle??!0,c=t.ellipsoid;t.tileXYToNativeRectangle(n,i,r,N2e),t.tileXYToRectangle(n,i,r,PW);let u=c.cartographicToCartesian(ie.center(PW)),d=40075.16/(1<<r);this._skirtHeight=Math.min(d*8,1e3);let g=(a?pjt:mjt).scheduleTask({buffer:this._buffer,nativeRectangle:N2e,rectangle:PW,relativeToCenter:u,ellipsoid:c,skirtHeight:this._skirtHeight,exaggeration:o,exaggerationRelativeHeight:s,includeWebMercatorT:!0,negativeAltitudeExponentBias:this._negativeAltitudeExponentBias,negativeElevationThreshold:this._negativeElevationThreshold});if(!l(g))return;let m=this;return g.then(function(y){return m._mesh=new Ac(u,new Float32Array(y.vertices),new Uint16Array(y.indices),y.indexCountWithoutSkirts,y.vertexCountWithoutSkirts,y.minimumHeight,y.maximumHeight,PW,ue.clone(y.boundingSphere3D),h.clone(y.occludeePointInScaledSpace),y.numberOfAttributes,en.clone(y.orientedBoundingBox),Eo.clone(y.encoding),y.westIndicesSouthToNorth,y.southIndicesEastToWest,y.eastIndicesNorthToSouth,y.northIndicesWestToEast),m._minimumHeight=y.minimumHeight,m._maximumHeight=y.maximumHeight,m._buffer=void 0,m._mesh})};zC.prototype.interpolateHeight=function(e,t,n){let i=D.clamp((t-e.west)/e.width,0,1),r=D.clamp((n-e.south)/e.height,0,1);return l(this._mesh)?bjt(this,i,r):Ejt(this,i,r,e)};var gjt=new $n("upsampleQuantizedTerrainMesh",rf.maximumAsynchronousTasks);zC.prototype.upsample=function(e,t,n,i,r,o,s){let a=this._mesh;if(!l(this._mesh))return;let c=t*2!==r,u=n*2===o,f=e.ellipsoid,d=e.tileXYToRectangle(r,o,s),p=gjt.scheduleTask({vertices:a.vertices,indices:a.indices,indexCountWithoutSkirts:a.indexCountWithoutSkirts,vertexCountWithoutSkirts:a.vertexCountWithoutSkirts,encoding:a.encoding,minimumHeight:this._minimumHeight,maximumHeight:this._maximumHeight,isEastChild:c,isNorthChild:u,childRectangle:d,ellipsoid:f});if(!l(p))return;let g=this;return p.then(function(m){let y=new Uint16Array(m.vertices),A=je.createTypedArray(y.length/3,m.indices),b=g._skirtHeight;return new BC({quantizedVertices:y,indices:A,minimumHeight:m.minimumHeight,maximumHeight:m.maximumHeight,boundingSphere:ue.clone(m.boundingSphere),orientedBoundingBox:en.clone(m.orientedBoundingBox),horizonOcclusionPoint:h.clone(m.horizonOcclusionPoint),westIndices:m.westIndices,southIndices:m.southIndices,eastIndices:m.eastIndices,northIndices:m.northIndices,westSkirtHeight:b,southSkirtHeight:b,eastSkirtHeight:b,northSkirtHeight:b,childTileMask:0,createdByUpsampling:!0,credits:g._credits})})};zC.prototype.isChildAvailable=function(e,t,n,i){let r=2;return n!==e*2&&++r,i!==t*2&&(r-=2),(this._childTileMask&1<<r)!==0};zC.prototype.wasCreatedByUpsampling=function(){return this._createdByUpsampling};var _jt=new U,yjt=new U,Ajt=new U,B2e=new h;function bjt(e,t,n){let i=e._mesh,r=i.vertices,o=i.encoding,s=i.indices;for(let a=0,c=s.length;a<c;a+=3){let u=s[a],f=s[a+1],d=s[a+2],p=o.decodeTextureCoordinates(r,u,_jt),g=o.decodeTextureCoordinates(r,f,yjt),m=o.decodeTextureCoordinates(r,d,Ajt),y=fp.computeBarycentricCoordinates(t,n,p.x,p.y,g.x,g.y,m.x,m.y,B2e);if(y.x>=-1e-15&&y.y>=-1e-15&&y.z>=-1e-15){let A=o.decodeHeight(r,u),b=o.decodeHeight(r,f),x=o.decodeHeight(r,d);return y.x*A+y.y*b+y.z*x}}}var xjt=Uint16Array.BYTES_PER_ELEMENT,L2e=Uint32Array.BYTES_PER_ELEMENT,Rae=Int32Array.BYTES_PER_ELEMENT,Tjt=Float32Array.BYTES_PER_ELEMENT,Oae=Float64Array.BYTES_PER_ELEMENT;function Ejt(e,t,n,i){let r=e._buffer,o=0,s=0,a=0;n>.5?(t>.5?(o=2,s=.5):o=3,a=.5):t>.5&&(o=1,s=.5);let c=new DataView(r),u=0;for(let v=0;v<o;++v)u+=c.getUint32(u,!0),u+=L2e;u+=L2e,u+=2*Oae;let f=D.toRadians(c.getFloat64(u,!0)*180);u+=Oae;let d=D.toRadians(c.getFloat64(u,!0)*180);u+=Oae;let p=i.width/f/2,g=i.height/d/2,m=c.getInt32(u,!0);u+=Rae;let y=c.getInt32(u,!0)*3;u+=Rae,u+=Rae;let A=new Array(m),b=new Array(m),x=new Array(m),T;for(T=0;T<m;++T)A[T]=s+c.getUint8(u++)*p,b[T]=a+c.getUint8(u++)*g,x[T]=c.getFloat32(u,!0)*6371010,u+=Tjt;let E=new Array(y);for(T=0;T<y;++T)E[T]=c.getUint16(u,!0),u+=xjt;for(T=0;T<y;T+=3){let v=E[T],S=E[T+1],I=E[T+2],R=A[v],O=A[S],L=A[I],_=b[v],C=b[S],w=b[I],P=fp.computeBarycentricCoordinates(t,n,R,_,O,C,L,w,B2e);if(P.x>=-1e-15&&P.y>=-1e-15&&P.z>=-1e-15)return P.x*x[v]+P.y*x[S]+P.z*x[I]}}var zP=zC;var Rh={UNKNOWN:0,NONE:1,SELF:2,PARENT:3},DW=new K;function RW(){this._terrainCache={},this._lastTidy=K.now()}RW.prototype.add=function(e,t){this._terrainCache[e]={buffer:t,timestamp:K.now()}};RW.prototype.get=function(e){let n=this._terrainCache[e];if(l(n))return delete this._terrainCache[e],n.buffer};RW.prototype.tidy=function(){if(K.now(DW),K.secondsDifference(DW,this._lastTidy)>10){let e=this._terrainCache,t=Object.keys(e),n=t.length;for(let i=0;i<n;++i){let r=t[i],o=e[r];K.secondsDifference(DW,o.timestamp)>10&&delete e[r]}K.clone(DW,this._lastTidy)}};function jb(e){e=e??H.EMPTY_OBJECT,this._tilingScheme=new Qi({numberOfLevelZeroTilesX:2,numberOfLevelZeroTilesY:2,rectangle:new ie(-D.PI,-D.PI,D.PI,D.PI),ellipsoid:e.ellipsoid});let t=e.credit;typeof t=="string"&&(t=new It(t)),this._credit=t,this._levelZeroMaximumGeometricError=40075.16,this._terrainCache=new RW,this._terrainPromises={},this._terrainRequests={},this._errorEvent=new be}Object.defineProperties(jb.prototype,{url:{get:function(){return this._metadata.url}},proxy:{get:function(){return this._metadata.proxy}},tilingScheme:{get:function(){return this._tilingScheme}},errorEvent:{get:function(){return this._errorEvent}},credit:{get:function(){return this._credit}},hasWaterMask:{get:function(){return!1}},hasVertexNormals:{get:function(){return!1}},availability:{get:function(){}}});jb.fromMetadata=function(e,t){if(!e.terrainPresent)throw new oe(`The server ${e.url} doesn't have terrain`);let n=new jb(t);return n._metadata=e,n};var Cjt=new $n("decodeGoogleEarthEnterprisePacket");function k2e(e,t,n){let i=t.getChildBitmask();if(t.terrainState===Rh.PARENT){i=0;for(let r=0;r<4;++r){let o=n.getTileInformationFromQuadKey(e+r.toString());l(o)&&o.hasTerrain()&&(i|=1<<r)}}return i}jb.prototype.requestTileGeometry=function(e,t,n,i){let r=_y.tileXYToQuadKey(e,t,n),o=this._terrainCache,s=this._metadata,a=s.getTileInformationFromQuadKey(r);if(!l(a))return Promise.reject(new oe("Terrain tile doesn't exist"));let c=a.terrainState;l(c)||(c=a.terrainState=Rh.UNKNOWN);let u=o.get(r);if(l(u)){let b=s.providers[a.terrainProvider];return Promise.resolve(new zP({buffer:u,childTileMask:k2e(r,a,s),credits:l(b)?[b]:void 0,negativeAltitudeExponentBias:s.negativeAltitudeExponentBias,negativeElevationThreshold:s.negativeAltitudeThreshold}))}if(o.tidy(),a.ancestorHasTerrain){if(c===Rh.NONE)return Promise.reject(new oe("Terrain tile doesn't exist"))}else return Promise.resolve(new zc({buffer:new Uint8Array(256),width:16,height:16}));let f,d=r,p=-1;switch(c){case Rh.SELF:p=a.terrainVersion;break;case Rh.PARENT:d=d.substring(0,d.length-1),f=s.getTileInformationFromQuadKey(d),p=f.terrainVersion;break;case Rh.UNKNOWN:a.hasTerrain()?p=a.terrainVersion:(d=d.substring(0,d.length-1),f=s.getTileInformationFromQuadKey(d),l(f)&&f.hasTerrain()&&(p=f.terrainVersion));break}if(p<0)return Promise.reject(new oe("Terrain tile doesn't exist"));let g=this._terrainPromises,m=this._terrainRequests,y,A;if(l(g[d]))y=g[d],A=m[d];else{A=i;let b=vjt(this,d,p,A).fetchArrayBuffer();if(!l(b))return;y=b.then(function(x){return l(x)?Cjt.scheduleTask({buffer:x,type:"Terrain",key:s.key},[x]).then(function(T){let E=s.getTileInformationFromQuadKey(d);E.terrainState=Rh.SELF,o.add(d,T[0]);let v=E.terrainProvider,S=T.length-1;for(let I=0;I<S;++I){let R=d+I.toString(),O=s.getTileInformationFromQuadKey(R);l(O)&&(o.add(R,T[I+1]),O.terrainState=Rh.PARENT,O.terrainProvider===0&&(O.terrainProvider=v))}}):Promise.reject(new oe("Failed to load terrain."))}),g[d]=y,m[d]=A,y=y.finally(function(){delete g[d],delete m[d]})}return y.then(function(){let b=o.get(r);if(l(b)){let x=s.providers[a.terrainProvider];return new zP({buffer:b,childTileMask:k2e(r,a,s),credits:l(x)?[x]:void 0,negativeAltitudeExponentBias:s.negativeAltitudeExponentBias,negativeElevationThreshold:s.negativeAltitudeThreshold})}return Promise.reject(new oe("Failed to load terrain."))}).catch(function(b){return A.state===Ti.CANCELLED?(i.state=A.state,Promise.reject(b)):(a.terrainState=Rh.NONE,Promise.reject(b))})};jb.prototype.getLevelMaximumGeometricError=function(e){return this._levelZeroMaximumGeometricError/(1<<e)};jb.prototype.getTileDataAvailable=function(e,t,n){let i=this._metadata,r=_y.tileXYToQuadKey(e,t,n),o=i.getTileInformation(e,t,n);if(o===null)return!1;if(l(o)){if(!o.ancestorHasTerrain)return!0;let s=o.terrainState;if(s===Rh.NONE)return!1;if((!l(s)||s===Rh.UNKNOWN)&&(o.terrainState=Rh.UNKNOWN,!o.hasTerrain())){r=r.substring(0,r.length-1);let a=i.getTileInformationFromQuadKey(r);if(!l(a)||!a.hasTerrain())return!1}return!0}if(i.isValid(r)){let s=new wo({throttle:!1,throttleByServer:!0,type:Zs.TERRAIN});i.populateSubtree(e,t,n,s)}return!1};jb.prototype.loadTileDataAvailability=function(e,t,n){};function vjt(e,t,n,i){return n=l(n)&&n>0?n:1,e._metadata.resource.getDerivedResource({url:`flatfile?f1c-0${t}-t.${n.toString()}`,request:i})}var Mae=jb;var Sjt="https://maps.googleapis.com/maps/api/geocode/json",U2e='<img alt="Google" src="https://assets.ion.cesium.com/google-credit.png" style="vertical-align:-5px">';function Nae(e){e=e??H.EMPTY_OBJECT;let t=e.key;this._resource=new De({url:Sjt,queryParameters:{key:t}}),this._credit=new It(U2e,!0)}Object.defineProperties(Nae.prototype,{credit:{get:function(){return this._credit}}});Nae.prototype.geocode=async function(e){let n=await this._resource.getDerivedResource({queryParameters:{address:e}}).fetchJson();if(n.status==="ZERO_RESULTS")return[];if(n.status!=="OK")throw new oe(`GoogleGeocoderService got a bad response ${n.status}: ${n.error_message}`);return n.results.map(r=>{let o=r.geometry.viewport.southwest,s=r.geometry.viewport.northeast;return{displayName:r.formatted_address,destination:ie.fromDegrees(o.lng,o.lat,s.lng,s.lat),attribution:{html:U2e,collapsible:!1}}})};var Lae=Nae;var Fae=class{constructor(){ut(this,"type")}getRequiredDataPoints(t){pe.throwInstantiationError()}interpolateOrderZero(t,n,i,r,o){pe.throwInstantiationError()}interpolate(t,n,i,r,o,s,a){pe.throwInstantiationError()}},Bae=Fae;var z2e={GOOGLE:"GOOGLE",BING:"BING",DEFAULT:"DEFAULT"};Object.freeze(z2e);var yy=z2e;function kae(e){this._url=De.createIfNeeded(e),this._url.appendForwardSlash()}Object.defineProperties(kae.prototype,{url:{get:function(){return this._url}},credit:{get:function(){}}});kae.prototype.geocode=async function(e,t){return this._url.getDerivedResource({url:t===Vb.AUTOCOMPLETE?"autocomplete":"search",queryParameters:{text:e}}).fetchJson().then(function(i){return i.features.map(function(r){let o,s=r.bbox;if(l(s))o=ie.fromDegrees(s[0],s[1],s[2],s[3]);else{let a=r.geometry.coordinates[0],c=r.geometry.coordinates[1];o=h.fromDegrees(a,c)}return{displayName:r.properties.label,destination:o,attributions:i.attributions}})})};var z4=kae;function wjt(e){if(!Object.values(yy).some(t=>t===e))throw new pe(`Invalid geocodeProviderType: "${e}"`)}var V2e=Object.freeze({[yy.GOOGLE]:"google",[yy.BING]:"bing",[yy.DEFAULT]:void 0});function Ijt(e){return V2e[e]}function Pjt(e){return Object.entries(V2e).find(t=>t[1]===e)[0]}function Uae(e){e=e??H.EMPTY_OBJECT;let t=e.geocodeProviderType??yy.DEFAULT,n=e.accessToken??Ku.defaultAccessToken,i=De.createIfNeeded(e.server??Ku.defaultServer);i.appendForwardSlash();let r=Ku.getDefaultTokenCredit(n);l(r)&&e.scene.frameState.creditDisplay.addStaticCredit(It.clone(r));let o=i.getDerivedResource({url:"v1/geocode"});l(n)&&o.appendQueryParameters({access_token:n}),this._accessToken=n,this._server=i,this._pelias=new z4(o),this.geocodeProviderType=t}Object.defineProperties(Uae.prototype,{credit:{get:function(){}},geocodeProviderType:{get:function(){return Pjt(this._pelias.url.queryParameters.geocoder)},set:function(e){wjt(e);let t={...this._pelias.url.queryParameters,geocoder:Ijt(e)};l(t.geocoder)||delete t.geocoder,this._pelias.url.setQueryParameters(t)}}});Uae.prototype.geocode=async function(e,t){return this._pelias.geocode(e,t)};var VC=Uae;var j2e={NONE:0,POINT:1,SEGMENT:2,CURVE:3,ARC:4,SURFACE:5};Object.freeze(j2e);var zae=j2e;var H2e={NONE:0,NOT_IN_RANGE:1,IN_RANGE:2};Object.freeze(H2e);var Vae=H2e;var G2e={NEAREST:1,NEAREST_KEYPOINT:2,CENTER:8};Object.freeze(G2e);var V4=G2e;var W2e={NONE:0,WIRE:1,SHEET:2,SOLID:3,MESH:4,TEXT:5};Object.freeze(W2e);var jae=W2e;function q2e(e){if(!(!l(e)||!l(e.longitude)||!l(e.latitude)))return h.fromDegrees(e.longitude,e.latitude,e.height??0)}function Y2e(e){let t=he.fromCartesian(e);return{longitude:D.toDegrees(t.longitude),latitude:D.toDegrees(t.latitude),height:t.height}}function Djt(e){let t=[],n=new se;for(let i=0;i<4;i++)N.getRow(e,i,n),t.push([n.x,n.y,n.z,n.w]);return t}function Rjt(e,t,n){return N.fromRowMajorArray([e/2,0,0,e/2,0,-t/2,0,t/2,0,0,.5,.5,0,0,0,1],n)}var Ojt=new N,Mjt=new N,OW=class e{constructor(t){this._assetId=t.assetId,this._resource=t.resource,this.ecefTransform=t.ecefTransform}get assetId(){return this._assetId}static async fromAssetId(t,n){n=n??H.EMPTY_OBJECT;let i=n.accessToken??Ku.defaultAccessToken,r=De.createIfNeeded(n.server??Ku.defaultServer);r.appendForwardSlash();let o={url:`assets/${t}/`,headers:Yo._addClientHeaders()};l(i)&&(o.queryParameters={access_token:i});let s=r.getDerivedResource(o),a=await s.getDerivedResource({url:"ecef"}).fetchJson();if(!l(a?.ecefTransform))throw new oe(`Cesium ion asset ${t} is not geolocated; snapping requires geolocation`);let c=N.fromRowMajorArray(a.ecefTransform.flat());return new e({assetId:t,resource:s,ecefTransform:c})}_computeWorldToView(t,n,i,r){r=r??new N;let o=Rjt(n,i,Ojt);return N.multiply(t.viewMatrix,this.ecefTransform,r),N.multiply(t.frustum.projectionMatrix,r,r),N.multiply(o,r,r)}async snap(t){let n=this._computeWorldToView(t.camera,t.canvasWidth,t.canvasHeight,Mjt),i={testPoint:Y2e(t.testPoint),closePoint:Y2e(t.closePoint??t.testPoint),snapAperture:t.snapAperture??e.DEFAULT_SNAP_APERTURE,snapMode:t.snapMode??V4.NEAREST,worldToView:Djt(n)},r;try{r=await this._resource.getDerivedResource({url:`elements/${t.elementId}/snap`}).post(JSON.stringify(i),{headers:{"Content-Type":"application/json"},responseType:"json"})}catch(s){if(s?.statusCode===404||s?.statusCode===400&&typeof s.response?.message=="string"&&s.response.message.includes("No snap possible"))return;throw s}if(!l(r))return;let o={heat:r.heat,geometryType:r.geomType,parentGeometryType:r.parentGeomType,normal:r.normal,curve:r.curve};return o.snapPoint=q2e(r.snapPoint),o.hitPoint=q2e(r.hitPoint),o}};OW.DEFAULT_SNAP_APERTURE=12;var Hae=OW;var la={};la.ExportStatus=Object.freeze({NotStarted:"NotStarted",InProgress:"InProgress",Complete:"Complete",Invalid:"Invalid"});la.ExportType=Object.freeze({IMODEL:"IMODEL",CESIUM:"CESIUM","3DTILES":"3DTILES"});la.RealityDataType=Object.freeze({Cesium3DTiles:"Cesium3DTiles",PNTS:"PNTS",RealityMesh3DTiles:"RealityMesh3DTiles",Terrain3DTiles:"Terrain3DTiles",GaussianSplat3DTiles:"GS_3DT",KML:"KML",GeoJSON:"GeoJSON",Unstructured:"Unstructured"});la.defaultAccessToken=void 0;la.defaultShareKey=void 0;la._getAuthorizationHeader=function(){return l(la.defaultShareKey)?`Basic ${la.defaultShareKey}`:`Bearer ${la.defaultAccessToken}`};la.apiEndpoint=new De({url:"https://api.bentley.com"});la.getExports=async function(e,t){let n=new De({url:`${la.apiEndpoint}mesh-export`,headers:{Authorization:la._getAuthorizationHeader(),Accept:"application/vnd.bentley.itwin-platform.v1+json",Prefer:"return=representation"},queryParameters:{iModelId:e,exportType:la.ExportType["3DTILES"],$top:"5",client:"CesiumJS"}});typeof CESIUM_VERSION<"u"&&n.appendQueryParameters({clientVersion:CESIUM_VERSION}),l(t)&&t!==""&&n.appendQueryParameters({changesetId:t});try{return await n.fetchJson()}catch(i){let r=JSON.parse(i.response);if(i.statusCode===401){let o=r.error.details?.[0].code??"";throw new oe(`Unauthorized, bad token, wrong scopes or headers bad. ${o}`)}else{if(i.statusCode===403)throw console.error(r.error.code,r.error.message),new oe("Not allowed, forbidden");if(i.statusCode===422)throw new oe(`Unprocessable Entity:${r.error.code} ${r.error.message}`);if(i.statusCode===429)throw new oe("Too many requests")}throw new oe(`Unknown request failure ${i.statusCode}`)}};la.getRealityDataMetadata=async function(e,t){let n=new De({url:`${la.apiEndpoint}reality-management/reality-data/${t}`,headers:{Authorization:la._getAuthorizationHeader(),Accept:"application/vnd.bentley.itwin-platform.v1+json"},queryParameters:{iTwinId:e}});try{return(await n.fetchJson()).realityData}catch(i){let r=JSON.parse(i.response);if(i.statusCode===401){let o=r.error.details?.[0].code??"";throw new oe(`Unauthorized, bad token, wrong scopes or headers bad. ${o}`)}else{if(i.statusCode===403)throw console.error(r.error.code,r.error.message),new oe("Not allowed, forbidden");if(i.statusCode===404)throw new oe(`Reality data not found: ${e}, ${t}`);if(i.statusCode===422)throw new oe(`Unprocessable Entity:${r.error.code} ${r.error.message}`);if(i.statusCode===429)throw new oe("Too many requests")}throw new oe(`Unknown request failure ${i.statusCode}`)}};la.getRealityDataURL=async function(e,t,n){let i=new De({url:`${la.apiEndpoint}reality-management/reality-data/${t}/readaccess`,headers:{Authorization:la._getAuthorizationHeader(),Accept:"application/vnd.bentley.itwin-platform.v1+json"},queryParameters:{iTwinId:e}});try{let o=(await i.fetchJson())._links.containerUrl.href,s=new URL(o);return s.pathname=`${s.pathname}/${n}`,s.toString()}catch(r){let o=JSON.parse(r.response);if(r.statusCode===401){let s=o.error.details?.[0].code??"";throw new oe(`Unauthorized, bad token, wrong scopes or headers bad. ${s}`)}else{if(r.statusCode===403)throw console.error(o.error.code,o.error.message),new oe("Not allowed, forbidden");if(r.statusCode===404)throw new oe(`Reality data not found: ${e}, ${t}`);if(r.statusCode===422)throw new oe(`Unprocessable Entity:${o.error.code} ${o.error.message}`);if(r.statusCode===429)throw new oe("Too many requests")}throw new oe(`Unknown request failure ${r.statusCode}`)}};var ua=la;var Gae=class{constructor(){ut(this,"ellipsoid")}project(t,n){pe.throwInstantiationError()}unproject(t,n){pe.throwInstantiationError()}},Wae=Gae;function VP(e){e=e??H.EMPTY_OBJECT;let t=e.weights,n=e.times;this._times=n,this._weights=t,this._count=t.length/n.length,this._lastTimeIndex=0}Object.defineProperties(VP.prototype,{times:{get:function(){return this._times}},weights:{get:function(){return this._weights}}});VP.prototype.findTimeInterval=Dr.prototype.findTimeInterval;VP.prototype.wrapTime=Dr.prototype.wrapTime;VP.prototype.clampTime=Dr.prototype.clampTime;VP.prototype.evaluate=function(e,t){let n=this.weights,i=this.times,r=this._lastTimeIndex=this.findTimeInterval(e,this._lastTimeIndex),o=(e-i[r])/(i[r+1]-i[r]);l(t)||(t=new Array(this._count));for(let s=0;s<this._count;s++){let a=r*this._count+s;t[s]=n[a]*(1-o)+n[a+this._count]*o}return t};var qae=VP;function Yae(e,t,n){e=De.createIfNeeded(e),e.appendForwardSlash(),e.setQueryParameters({key:t}),this._url=e,this._params=n??{},this._credit=new It('Geodata copyright <a href="https://www.openstreetmap.org/">OpenStreetMap</a> contributors',!1)}Object.defineProperties(Yae.prototype,{url:{get:function(){return this._url}},params:{get:function(){return this._params}},credit:{get:function(){return this._credit}}});Yae.prototype.geocode=async function(e){return this._url.getDerivedResource({url:"json",queryParameters:Ot(this._params,{q:e})}).fetchJson().then(function(n){return n.results.map(function(i){let r,o=i.bounds;if(l(o))r=ie.fromDegrees(o.southwest.lng,o.southwest.lat,o.northeast.lng,o.northeast.lat);else{let{lng:s,lat:a}=i.geometry;r=h.fromDegrees(s,a)}return{displayName:i.formatted,destination:r}})})};var Xae=Yae;var Njt={packedLength:void 0,pack:pe.throwInstantiationError,unpack:pe.throwInstantiationError},Kae=Njt;var Ljt={packedInterpolationLength:void 0,convertPackedArrayForInterpolation:pe.throwInstantiationError,unpackInterpolationResult:pe.throwInstantiationError},$ae=Ljt;var Fjt=new h;function Bjt(e,t,n,i){let r=dx(e,t,n,i,Fjt);return l(r)?r.x>0&&r.y>0&&r.z>0:!1}var Jae=Bjt;function X2e(){pe.throwInstantiationError()}X2e.prototype.getURL=pe.throwInstantiationError;var Zae=X2e;function kjt(e,t,n,i,r,o,s){let a=nr.numberOfPoints(e,t,r),c,u=n.red,f=n.green,d=n.blue,p=n.alpha,g=i.red,m=i.green,y=i.blue,A=i.alpha;if(z.equals(n,i)){for(c=0;c<a;c++)o[s++]=z.floatToByte(u),o[s++]=z.floatToByte(f),o[s++]=z.floatToByte(d),o[s++]=z.floatToByte(p);return s}let b=(g-u)/a,x=(m-f)/a,T=(y-d)/a,E=(A-p)/a,v=s;for(c=0;c<a;c++)o[v++]=z.floatToByte(u+c*b),o[v++]=z.floatToByte(f+c*x),o[v++]=z.floatToByte(d+c*T),o[v++]=z.floatToByte(p+c*E);return v}function j4(e){e=e??H.EMPTY_OBJECT;let t=e.positions,n=e.colors,i=e.colorsPerVertex??!1;this._positions=t,this._colors=n,this._colorsPerVertex=i,this._arcType=e.arcType??ln.GEODESIC,this._granularity=e.granularity??D.RADIANS_PER_DEGREE,this._ellipsoid=e.ellipsoid??ee.default,this._workerName="createSimplePolylineGeometry";let r=1+t.length*h.packedLength;r+=l(n)?1+n.length*z.packedLength:1,this.packedLength=r+ee.packedLength+3}j4.pack=function(e,t,n){n=n??0;let i,r=e._positions,o=r.length;for(t[n++]=o,i=0;i<o;++i,n+=h.packedLength)h.pack(r[i],t,n);let s=e._colors;for(o=l(s)?s.length:0,t[n++]=o,i=0;i<o;++i,n+=z.packedLength)z.pack(s[i],t,n);return ee.pack(e._ellipsoid,t,n),n+=ee.packedLength,t[n++]=e._colorsPerVertex?1:0,t[n++]=e._arcType,t[n]=e._granularity,t};j4.unpack=function(e,t,n){t=t??0;let i,r=e[t++],o=new Array(r);for(i=0;i<r;++i,t+=h.packedLength)o[i]=h.unpack(e,t);r=e[t++];let s=r>0?new Array(r):void 0;for(i=0;i<r;++i,t+=z.packedLength)s[i]=z.unpack(e,t);let a=ee.unpack(e,t);t+=ee.packedLength;let c=e[t++]===1,u=e[t++],f=e[t];return l(n)?(n._positions=o,n._colors=s,n._ellipsoid=a,n._colorsPerVertex=c,n._arcType=u,n._granularity=f,n):new j4({positions:o,colors:s,ellipsoid:a,colorsPerVertex:c,arcType:u,granularity:f})};var MW=new Array(2),NW=new Array(2),Ujt={positions:MW,height:NW,ellipsoid:void 0,minDistance:void 0,granularity:void 0};j4.createGeometry=function(e){let t=e._positions,n=e._colors,i=e._colorsPerVertex,r=e._arcType,o=e._granularity,s=e._ellipsoid,a=D.chordLength(o,s.maximumRadius),c=l(n)&&!i,u,f=t.length,d,p,g,m,y=0;if(r===ln.GEODESIC||r===ln.RHUMB){let E,v,S;r===ln.GEODESIC?(E=D.chordLength(o,s.maximumRadius),v=nr.numberOfPoints,S=nr.generateArc):(E=o,v=nr.numberOfPointsRhumbLine,S=nr.generateRhumbArc);let I=nr.extractHeights(t,s),R=Ujt;if(r===ln.GEODESIC?R.minDistance=a:R.granularity=o,R.ellipsoid=s,c){let O=0;for(u=0;u<f-1;u++)O+=v(t[u],t[u+1],E)+1;d=new Float64Array(O*3),g=new Uint8Array(O*4),R.positions=MW,R.height=NW;let L=0;for(u=0;u<f-1;++u){MW[0]=t[u],MW[1]=t[u+1],NW[0]=I[u],NW[1]=I[u+1];let _=S(R);if(l(n)){let C=_.length/3;m=n[u];for(let w=0;w<C;++w)g[L++]=z.floatToByte(m.red),g[L++]=z.floatToByte(m.green),g[L++]=z.floatToByte(m.blue),g[L++]=z.floatToByte(m.alpha)}d.set(_,y),y+=_.length}}else if(R.positions=t,R.height=I,d=new Float64Array(S(R)),l(n)){for(g=new Uint8Array(d.length/3*4),u=0;u<f-1;++u){let L=t[u],_=t[u+1],C=n[u],w=n[u+1];y=kjt(L,_,C,w,a,g,y)}let O=n[f-1];g[y++]=z.floatToByte(O.red),g[y++]=z.floatToByte(O.green),g[y++]=z.floatToByte(O.blue),g[y]=z.floatToByte(O.alpha)}}else{p=c?f*2-2:f,d=new Float64Array(p*3),g=l(n)?new Uint8Array(p*4):void 0;let E=0,v=0;for(u=0;u<f;++u){let S=t[u];if(c&&u>0&&(h.pack(S,d,E),E+=3,m=n[u-1],g[v++]=z.floatToByte(m.red),g[v++]=z.floatToByte(m.green),g[v++]=z.floatToByte(m.blue),g[v++]=z.floatToByte(m.alpha)),c&&u===f-1)break;h.pack(S,d,E),E+=3,l(n)&&(m=n[u],g[v++]=z.floatToByte(m.red),g[v++]=z.floatToByte(m.green),g[v++]=z.floatToByte(m.blue),g[v++]=z.floatToByte(m.alpha))}}let A=new Tn;A.position=new Ne({componentDatatype:Y.DOUBLE,componentsPerAttribute:3,values:d}),l(n)&&(A.color=new Ne({componentDatatype:Y.UNSIGNED_BYTE,componentsPerAttribute:4,values:g,normalize:!0})),p=d.length/3;let b=(p-1)*2,x=je.createTypedArray(p,b),T=0;for(u=0;u<p-1;++u)x[T++]=u,x[T++]=u+1;return new St({attributes:A,indices:x,primitiveType:Oe.LINES,boundingSphere:ue.fromPoints(t)})};var Qae=j4;var LW=class{constructor(){pe.throwInstantiationError()}async snap(t){pe.throwInstantiationError()}};LW.DEFAULT_SNAP_APERTURE=void 0;var ece=LW;function jP(e){let t=e.radius??1,i={radii:new h(t,t,t),stackPartitions:e.stackPartitions,slicePartitions:e.slicePartitions,vertexFormat:e.vertexFormat};this._ellipsoidGeometry=new za(i),this._workerName="createSphereGeometry"}jP.packedLength=za.packedLength;jP.pack=function(e,t,n){return za.pack(e._ellipsoidGeometry,t,n)};var zjt=new za,Hb={radius:void 0,radii:new h,vertexFormat:new Be,stackPartitions:void 0,slicePartitions:void 0};jP.unpack=function(e,t,n){let i=za.unpack(e,t,zjt);return Hb.vertexFormat=Be.clone(i._vertexFormat,Hb.vertexFormat),Hb.stackPartitions=i._stackPartitions,Hb.slicePartitions=i._slicePartitions,l(n)?(h.clone(i._radii,Hb.radii),n._ellipsoidGeometry=new za(Hb),n):(Hb.radius=i._radii.x,new jP(Hb))};jP.createGeometry=function(e){return za.createGeometry(e._ellipsoidGeometry)};var H4=jP;function Vjt(e){return e<=.04045?e*.07739938080495357:Math.pow((e+.055)*.9478672985781991,2.4)}var jC=Vjt;var tce=class{constructor(t){ut(this,"ellipsoid");ut(this,"rectangle");ut(this,"projection")}getNumberOfXTilesAtLevel(t){pe.throwInstantiationError()}getNumberOfYTilesAtLevel(t){pe.throwInstantiationError()}rectangleToNativeRectangle(t,n){pe.throwInstantiationError()}tileXYToNativeRectangle(t,n,i,r){pe.throwInstantiationError()}tileXYToRectangle(t,n,i,r){pe.throwInstantiationError()}positionToTileXY(t,n,i){pe.throwInstantiationError()}},nce=tce;function HC(e){e=e??H.EMPTY_OBJECT,this._clock=void 0,this._element=void 0,this._clockSubscription=void 0,this._seekFunction=void 0,this._lastPlaybackRate=void 0,this.clock=e.clock,this.element=e.element,this.epoch=e.epoch??nt.MINIMUM_VALUE,this.tolerance=e.tolerance??1,this._seeking=!1,this._seekFunction=void 0,this._firstTickAfterSeek=!1}Object.defineProperties(HC.prototype,{clock:{get:function(){return this._clock},set:function(e){let t=this._clock;t!==e&&(l(t)&&(this._clockSubscription(),this._clockSubscription=void 0),l(e)&&(this._clockSubscription=e.onTick.addEventListener(HC.prototype._onTick,this)),this._clock=e)}},element:{get:function(){return this._element},set:function(e){let t=this._element;t!==e&&(l(t)&&t.removeEventListener("seeked",this._seekFunction,!1),l(e)&&(this._seeking=!1,this._seekFunction=jjt(this),e.addEventListener("seeked",this._seekFunction,!1)),this._element=e,this._seeking=!1,this._firstTickAfterSeek=!1)}}});HC.prototype.destroy=function(){return this.element=void 0,this.clock=void 0,le(this)};HC.prototype.isDestroyed=function(){return!1};HC.prototype._trySetPlaybackRate=function(e){if(this._lastPlaybackRate===e.multiplier)return;let t=this._element;try{t.playbackRate=e.multiplier}catch{t.playbackRate=0}this._lastPlaybackRate=e.multiplier};HC.prototype._onTick=function(e){let t=this._element;if(!l(t)||t.readyState<2)return;let n=t.paused,i=e.shouldAnimate;if(i===n&&(i?t.play():t.pause()),this._seeking||this._firstTickAfterSeek){this._firstTickAfterSeek=!1;return}this._trySetPlaybackRate(e);let r=e.currentTime,o=this.epoch??nt.MINIMUM_VALUE,s=K.secondsDifference(r,o),a=t.duration,c,u=t.currentTime;t.loop?(s=s%a,s<0&&(s=a-s),c=s):s>a?c=a:s<0?c=0:c=s;let f=i?this.tolerance??1:.001;Math.abs(c-u)>f&&(this._seeking=!0,t.currentTime=c)};function jjt(e){return function(){e._seeking=!1,e._firstTickAfterSeek=!0}}var ice=HC;function Hjt(e,t){this.rectangle=e,this.maxLevel=t}function K2e(e){this.ellipsoid=e.ellipsoid??ee.default,this.tilingScheme=void 0,this.heightmapWidth=void 0,this.heightmapHeight=void 0,this.levelZeroMaximumGeometricError=void 0,this.rectangles=[]}K2e.prototype.build=function(e){e._tilingScheme=this.tilingScheme,e._heightmapWidth=this.heightmapWidth,e._heightmapHeight=this.heightmapHeight,e._levelZeroMaximumGeometricError=this.levelZeroMaximumGeometricError,e._rectangles=this.rectangles};function Gjt(e,t){let n=t.getElementsByTagName("SRS")[0].textContent;if(n==="EPSG:4326")e.tilingScheme=new Qi({ellipsoid:e.ellipsoid});else throw new oe(`SRS ${n} is not supported`);let i=t.getElementsByTagName("TileFormat")[0];e.heightmapWidth=parseInt(i.getAttribute("width"),10),e.heightmapHeight=parseInt(i.getAttribute("height"),10),e.levelZeroMaximumGeometricError=Xr.getEstimatedLevelZeroGeometricErrorForAHeightmap(e.ellipsoid,Math.min(e.heightmapWidth,e.heightmapHeight),e.tilingScheme.getNumberOfXTilesAtLevel(0));let r=t.getElementsByTagName("DataExtent");for(let o=0;o<r.length;++o){let s=r[o],a=D.toRadians(parseFloat(s.getAttribute("minx"))),c=D.toRadians(parseFloat(s.getAttribute("miny"))),u=D.toRadians(parseFloat(s.getAttribute("maxx"))),f=D.toRadians(parseFloat(s.getAttribute("maxy"))),d=parseInt(s.getAttribute("maxlevel"),10);e.rectangles.push(new Hjt(new ie(a,c,u,f),d))}}function Wjt(e,t,n){let i=`An error occurred while accessing ${e.url}`;throw l(t)&&l(t.message)&&(i=`${i}: ${t.message}`),Zr.reportError(void 0,n,l(n)?n._errorEvent:void 0,i),new oe(i)}async function qjt(e,t,n){try{let i=await t.fetchXML();Gjt(e,i)}catch(i){Wjt(t,i,n)}}function Gb(e){e=e??H.EMPTY_OBJECT,this._errorEvent=new be,this._terrainDataStructure={heightScale:1/1e3,heightOffset:-1e3,elementsPerHeight:3,stride:4,elementMultiplier:256,isBigEndian:!0,lowestEncodedHeight:0,highestEncodedHeight:256*256*256-1};let t=e.credit;typeof t=="string"&&(t=new It(t)),this._credit=t,this._tilingScheme=void 0,this._rectangles=[]}Object.defineProperties(Gb.prototype,{errorEvent:{get:function(){return this._errorEvent}},credit:{get:function(){return this._credit}},tilingScheme:{get:function(){return this._tilingScheme}},hasWaterMask:{get:function(){return!1}},hasVertexNormals:{get:function(){return!1}},availability:{get:function(){}}});Gb.fromUrl=async function(e,t){t=t??H.EMPTY_OBJECT;let n=new K2e(t),i=De.createIfNeeded(e);await qjt(n,i);let r=new Gb(t);return n.build(r),r._resource=i,r};Gb.prototype.requestTileGeometry=function(e,t,n,i){let r=this._tilingScheme.getNumberOfYTilesAtLevel(n),s=this._resource.getDerivedResource({url:`${n}/${e}/${r-t-1}.tif`,queryParameters:{cesium:!0},request:i}).fetchImage({preferImageBitmap:!0});if(!l(s))return;let a=this;return Promise.resolve(s).then(function(c){return new zc({buffer:kh(c),width:a._heightmapWidth,height:a._heightmapHeight,childTileMask:Yjt(a,e,t,n),structure:a._terrainDataStructure})})};Gb.prototype.getLevelMaximumGeometricError=function(e){return this._levelZeroMaximumGeometricError/(1<<e)};var $2e=new ie;function Yjt(e,t,n,i){let r=e._tilingScheme,o=e._rectangles,s=r.tileXYToRectangle(t,n,i),a=0;for(let c=0;c<o.length&&a!==15;++c){let u=o[c];if(u.maxLevel<=i)continue;let f=u.rectangle,d=ie.intersection(f,s,$2e);l(d)&&(FW(r,f,t*2,n*2,i+1)&&(a|=4),FW(r,f,t*2+1,n*2,i+1)&&(a|=8),FW(r,f,t*2,n*2+1,i+1)&&(a|=1),FW(r,f,t*2+1,n*2+1,i+1)&&(a|=2))}return a}function FW(e,t,n,i,r){let o=e.tileXYToRectangle(n,i,r);return l(ie.intersection(o,t,$2e))}Gb.prototype.getTileDataAvailable=function(e,t,n){};Gb.prototype.loadTileDataAvailability=function(e,t,n){};var rce=Gb;var J2e={VK_FORMAT_UNDEFINED:0,VK_FORMAT_R4G4_UNORM_PACK8:1,VK_FORMAT_R4G4B4A4_UNORM_PACK16:2,VK_FORMAT_B4G4R4A4_UNORM_PACK16:3,VK_FORMAT_R5G6B5_UNORM_PACK16:4,VK_FORMAT_B5G6R5_UNORM_PACK16:5,VK_FORMAT_R5G5B5A1_UNORM_PACK16:6,VK_FORMAT_B5G5R5A1_UNORM_PACK16:7,VK_FORMAT_A1R5G5B5_UNORM_PACK16:8,VK_FORMAT_R8_UNORM:9,VK_FORMAT_R8_SNORM:10,VK_FORMAT_R8_USCALED:11,VK_FORMAT_R8_SSCALED:12,VK_FORMAT_R8_UINT:13,VK_FORMAT_R8_SINT:14,VK_FORMAT_R8_SRGB:15,VK_FORMAT_R8G8_UNORM:16,VK_FORMAT_R8G8_SNORM:17,VK_FORMAT_R8G8_USCALED:18,VK_FORMAT_R8G8_SSCALED:19,VK_FORMAT_R8G8_UINT:20,VK_FORMAT_R8G8_SINT:21,VK_FORMAT_R8G8_SRGB:22,VK_FORMAT_R8G8B8_UNORM:23,VK_FORMAT_R8G8B8_SNORM:24,VK_FORMAT_R8G8B8_USCALED:25,VK_FORMAT_R8G8B8_SSCALED:26,VK_FORMAT_R8G8B8_UINT:27,VK_FORMAT_R8G8B8_SINT:28,VK_FORMAT_R8G8B8_SRGB:29,VK_FORMAT_B8G8R8_UNORM:30,VK_FORMAT_B8G8R8_SNORM:31,VK_FORMAT_B8G8R8_USCALED:32,VK_FORMAT_B8G8R8_SSCALED:33,VK_FORMAT_B8G8R8_UINT:34,VK_FORMAT_B8G8R8_SINT:35,VK_FORMAT_B8G8R8_SRGB:36,VK_FORMAT_R8G8B8A8_UNORM:37,VK_FORMAT_R8G8B8A8_SNORM:38,VK_FORMAT_R8G8B8A8_USCALED:39,VK_FORMAT_R8G8B8A8_SSCALED:40,VK_FORMAT_R8G8B8A8_UINT:41,VK_FORMAT_R8G8B8A8_SINT:42,VK_FORMAT_R8G8B8A8_SRGB:43,VK_FORMAT_B8G8R8A8_UNORM:44,VK_FORMAT_B8G8R8A8_SNORM:45,VK_FORMAT_B8G8R8A8_USCALED:46,VK_FORMAT_B8G8R8A8_SSCALED:47,VK_FORMAT_B8G8R8A8_UINT:48,VK_FORMAT_B8G8R8A8_SINT:49,VK_FORMAT_B8G8R8A8_SRGB:50,VK_FORMAT_A8B8G8R8_UNORM_PACK32:51,VK_FORMAT_A8B8G8R8_SNORM_PACK32:52,VK_FORMAT_A8B8G8R8_USCALED_PACK32:53,VK_FORMAT_A8B8G8R8_SSCALED_PACK32:54,VK_FORMAT_A8B8G8R8_UINT_PACK32:55,VK_FORMAT_A8B8G8R8_SINT_PACK32:56,VK_FORMAT_A8B8G8R8_SRGB_PACK32:57,VK_FORMAT_A2R10G10B10_UNORM_PACK32:58,VK_FORMAT_A2R10G10B10_SNORM_PACK32:59,VK_FORMAT_A2R10G10B10_USCALED_PACK32:60,VK_FORMAT_A2R10G10B10_SSCALED_PACK32:61,VK_FORMAT_A2R10G10B10_UINT_PACK32:62,VK_FORMAT_A2R10G10B10_SINT_PACK32:63,VK_FORMAT_A2B10G10R10_UNORM_PACK32:64,VK_FORMAT_A2B10G10R10_SNORM_PACK32:65,VK_FORMAT_A2B10G10R10_USCALED_PACK32:66,VK_FORMAT_A2B10G10R10_SSCALED_PACK32:67,VK_FORMAT_A2B10G10R10_UINT_PACK32:68,VK_FORMAT_A2B10G10R10_SINT_PACK32:69,VK_FORMAT_R16_UNORM:70,VK_FORMAT_R16_SNORM:71,VK_FORMAT_R16_USCALED:72,VK_FORMAT_R16_SSCALED:73,VK_FORMAT_R16_UINT:74,VK_FORMAT_R16_SINT:75,VK_FORMAT_R16_SFLOAT:76,VK_FORMAT_R16G16_UNORM:77,VK_FORMAT_R16G16_SNORM:78,VK_FORMAT_R16G16_USCALED:79,VK_FORMAT_R16G16_SSCALED:80,VK_FORMAT_R16G16_UINT:81,VK_FORMAT_R16G16_SINT:82,VK_FORMAT_R16G16_SFLOAT:83,VK_FORMAT_R16G16B16_UNORM:84,VK_FORMAT_R16G16B16_SNORM:85,VK_FORMAT_R16G16B16_USCALED:86,VK_FORMAT_R16G16B16_SSCALED:87,VK_FORMAT_R16G16B16_UINT:88,VK_FORMAT_R16G16B16_SINT:89,VK_FORMAT_R16G16B16_SFLOAT:90,VK_FORMAT_R16G16B16A16_UNORM:91,VK_FORMAT_R16G16B16A16_SNORM:92,VK_FORMAT_R16G16B16A16_USCALED:93,VK_FORMAT_R16G16B16A16_SSCALED:94,VK_FORMAT_R16G16B16A16_UINT:95,VK_FORMAT_R16G16B16A16_SINT:96,VK_FORMAT_R16G16B16A16_SFLOAT:97,VK_FORMAT_R32_UINT:98,VK_FORMAT_R32_SINT:99,VK_FORMAT_R32_SFLOAT:100,VK_FORMAT_R32G32_UINT:101,VK_FORMAT_R32G32_SINT:102,VK_FORMAT_R32G32_SFLOAT:103,VK_FORMAT_R32G32B32_UINT:104,VK_FORMAT_R32G32B32_SINT:105,VK_FORMAT_R32G32B32_SFLOAT:106,VK_FORMAT_R32G32B32A32_UINT:107,VK_FORMAT_R32G32B32A32_SINT:108,VK_FORMAT_R32G32B32A32_SFLOAT:109,VK_FORMAT_R64_UINT:110,VK_FORMAT_R64_SINT:111,VK_FORMAT_R64_SFLOAT:112,VK_FORMAT_R64G64_UINT:113,VK_FORMAT_R64G64_SINT:114,VK_FORMAT_R64G64_SFLOAT:115,VK_FORMAT_R64G64B64_UINT:116,VK_FORMAT_R64G64B64_SINT:117,VK_FORMAT_R64G64B64_SFLOAT:118,VK_FORMAT_R64G64B64A64_UINT:119,VK_FORMAT_R64G64B64A64_SINT:120,VK_FORMAT_R64G64B64A64_SFLOAT:121,VK_FORMAT_B10G11R11_UFLOAT_PACK32:122,VK_FORMAT_E5B9G9R9_UFLOAT_PACK32:123,VK_FORMAT_D16_UNORM:124,VK_FORMAT_X8_D24_UNORM_PACK32:125,VK_FORMAT_D32_SFLOAT:126,VK_FORMAT_S8_UINT:127,VK_FORMAT_D16_UNORM_S8_UINT:128,VK_FORMAT_D24_UNORM_S8_UINT:129,VK_FORMAT_D32_SFLOAT_S8_UINT:130,VK_FORMAT_BC1_RGB_UNORM_BLOCK:131,VK_FORMAT_BC1_RGB_SRGB_BLOCK:132,VK_FORMAT_BC1_RGBA_UNORM_BLOCK:133,VK_FORMAT_BC1_RGBA_SRGB_BLOCK:134,VK_FORMAT_BC2_UNORM_BLOCK:135,VK_FORMAT_BC2_SRGB_BLOCK:136,VK_FORMAT_BC3_UNORM_BLOCK:137,VK_FORMAT_BC3_SRGB_BLOCK:138,VK_FORMAT_BC4_UNORM_BLOCK:139,VK_FORMAT_BC4_SNORM_BLOCK:140,VK_FORMAT_BC5_UNORM_BLOCK:141,VK_FORMAT_BC5_SNORM_BLOCK:142,VK_FORMAT_BC6H_UFLOAT_BLOCK:143,VK_FORMAT_BC6H_SFLOAT_BLOCK:144,VK_FORMAT_BC7_UNORM_BLOCK:145,VK_FORMAT_BC7_SRGB_BLOCK:146,VK_FORMAT_ETC2_R8G8B8_UNORM_BLOCK:147,VK_FORMAT_ETC2_R8G8B8_SRGB_BLOCK:148,VK_FORMAT_ETC2_R8G8B8A1_UNORM_BLOCK:149,VK_FORMAT_ETC2_R8G8B8A1_SRGB_BLOCK:150,VK_FORMAT_ETC2_R8G8B8A8_UNORM_BLOCK:151,VK_FORMAT_ETC2_R8G8B8A8_SRGB_BLOCK:152,VK_FORMAT_EAC_R11_UNORM_BLOCK:153,VK_FORMAT_EAC_R11_SNORM_BLOCK:154,VK_FORMAT_EAC_R11G11_UNORM_BLOCK:155,VK_FORMAT_EAC_R11G11_SNORM_BLOCK:156,VK_FORMAT_ASTC_4x4_UNORM_BLOCK:157,VK_FORMAT_ASTC_4x4_SRGB_BLOCK:158,VK_FORMAT_ASTC_5x4_UNORM_BLOCK:159,VK_FORMAT_ASTC_5x4_SRGB_BLOCK:160,VK_FORMAT_ASTC_5x5_UNORM_BLOCK:161,VK_FORMAT_ASTC_5x5_SRGB_BLOCK:162,VK_FORMAT_ASTC_6x5_UNORM_BLOCK:163,VK_FORMAT_ASTC_6x5_SRGB_BLOCK:164,VK_FORMAT_ASTC_6x6_UNORM_BLOCK:165,VK_FORMAT_ASTC_6x6_SRGB_BLOCK:166,VK_FORMAT_ASTC_8x5_UNORM_BLOCK:167,VK_FORMAT_ASTC_8x5_SRGB_BLOCK:168,VK_FORMAT_ASTC_8x6_UNORM_BLOCK:169,VK_FORMAT_ASTC_8x6_SRGB_BLOCK:170,VK_FORMAT_ASTC_8x8_UNORM_BLOCK:171,VK_FORMAT_ASTC_8x8_SRGB_BLOCK:172,VK_FORMAT_ASTC_10x5_UNORM_BLOCK:173,VK_FORMAT_ASTC_10x5_SRGB_BLOCK:174,VK_FORMAT_ASTC_10x6_UNORM_BLOCK:175,VK_FORMAT_ASTC_10x6_SRGB_BLOCK:176,VK_FORMAT_ASTC_10x8_UNORM_BLOCK:177,VK_FORMAT_ASTC_10x8_SRGB_BLOCK:178,VK_FORMAT_ASTC_10x10_UNORM_BLOCK:179,VK_FORMAT_ASTC_10x10_SRGB_BLOCK:180,VK_FORMAT_ASTC_12x10_UNORM_BLOCK:181,VK_FORMAT_ASTC_12x10_SRGB_BLOCK:182,VK_FORMAT_ASTC_12x12_UNORM_BLOCK:183,VK_FORMAT_ASTC_12x12_SRGB_BLOCK:184,VK_FORMAT_G8B8G8R8_422_UNORM:1000156e3,VK_FORMAT_B8G8R8G8_422_UNORM:1000156001,VK_FORMAT_G8_B8_R8_3PLANE_420_UNORM:1000156002,VK_FORMAT_G8_B8R8_2PLANE_420_UNORM:1000156003,VK_FORMAT_G8_B8_R8_3PLANE_422_UNORM:1000156004,VK_FORMAT_G8_B8R8_2PLANE_422_UNORM:1000156005,VK_FORMAT_G8_B8_R8_3PLANE_444_UNORM:1000156006,VK_FORMAT_R10X6_UNORM_PACK16:1000156007,VK_FORMAT_R10X6G10X6_UNORM_2PACK16:1000156008,VK_FORMAT_R10X6G10X6B10X6A10X6_UNORM_4PACK16:1000156009,VK_FORMAT_G10X6B10X6G10X6R10X6_422_UNORM_4PACK16:1000156010,VK_FORMAT_B10X6G10X6R10X6G10X6_422_UNORM_4PACK16:1000156011,VK_FORMAT_G10X6_B10X6_R10X6_3PLANE_420_UNORM_3PACK16:1000156012,VK_FORMAT_G10X6_B10X6R10X6_2PLANE_420_UNORM_3PACK16:1000156013,VK_FORMAT_G10X6_B10X6_R10X6_3PLANE_422_UNORM_3PACK16:1000156014,VK_FORMAT_G10X6_B10X6R10X6_2PLANE_422_UNORM_3PACK16:1000156015,VK_FORMAT_G10X6_B10X6_R10X6_3PLANE_444_UNORM_3PACK16:1000156016,VK_FORMAT_R12X4_UNORM_PACK16:1000156017,VK_FORMAT_R12X4G12X4_UNORM_2PACK16:1000156018,VK_FORMAT_R12X4G12X4B12X4A12X4_UNORM_4PACK16:1000156019,VK_FORMAT_G12X4B12X4G12X4R12X4_422_UNORM_4PACK16:1000156020,VK_FORMAT_B12X4G12X4R12X4G12X4_422_UNORM_4PACK16:1000156021,VK_FORMAT_G12X4_B12X4_R12X4_3PLANE_420_UNORM_3PACK16:1000156022,VK_FORMAT_G12X4_B12X4R12X4_2PLANE_420_UNORM_3PACK16:1000156023,VK_FORMAT_G12X4_B12X4_R12X4_3PLANE_422_UNORM_3PACK16:1000156024,VK_FORMAT_G12X4_B12X4R12X4_2PLANE_422_UNORM_3PACK16:1000156025,VK_FORMAT_G12X4_B12X4_R12X4_3PLANE_444_UNORM_3PACK16:1000156026,VK_FORMAT_G16B16G16R16_422_UNORM:1000156027,VK_FORMAT_B16G16R16G16_422_UNORM:1000156028,VK_FORMAT_G16_B16_R16_3PLANE_420_UNORM:1000156029,VK_FORMAT_G16_B16R16_2PLANE_420_UNORM:1000156030,VK_FORMAT_G16_B16_R16_3PLANE_422_UNORM:1000156031,VK_FORMAT_G16_B16R16_2PLANE_422_UNORM:1000156032,VK_FORMAT_G16_B16_R16_3PLANE_444_UNORM:1000156033,VK_FORMAT_PVRTC1_2BPP_UNORM_BLOCK_IMG:1000054e3,VK_FORMAT_PVRTC1_4BPP_UNORM_BLOCK_IMG:1000054001,VK_FORMAT_PVRTC2_2BPP_UNORM_BLOCK_IMG:1000054002,VK_FORMAT_PVRTC2_4BPP_UNORM_BLOCK_IMG:1000054003,VK_FORMAT_PVRTC1_2BPP_SRGB_BLOCK_IMG:1000054004,VK_FORMAT_PVRTC1_4BPP_SRGB_BLOCK_IMG:1000054005,VK_FORMAT_PVRTC2_2BPP_SRGB_BLOCK_IMG:1000054006,VK_FORMAT_PVRTC2_4BPP_SRGB_BLOCK_IMG:1000054007,VK_FORMAT_ASTC_4x4_SFLOAT_BLOCK_EXT:1000066e3,VK_FORMAT_ASTC_5x4_SFLOAT_BLOCK_EXT:1000066001,VK_FORMAT_ASTC_5x5_SFLOAT_BLOCK_EXT:1000066002,VK_FORMAT_ASTC_6x5_SFLOAT_BLOCK_EXT:1000066003,VK_FORMAT_ASTC_6x6_SFLOAT_BLOCK_EXT:1000066004,VK_FORMAT_ASTC_8x5_SFLOAT_BLOCK_EXT:1000066005,VK_FORMAT_ASTC_8x6_SFLOAT_BLOCK_EXT:1000066006,VK_FORMAT_ASTC_8x8_SFLOAT_BLOCK_EXT:1000066007,VK_FORMAT_ASTC_10x5_SFLOAT_BLOCK_EXT:1000066008,VK_FORMAT_ASTC_10x6_SFLOAT_BLOCK_EXT:1000066009,VK_FORMAT_ASTC_10x8_SFLOAT_BLOCK_EXT:1000066010,VK_FORMAT_ASTC_10x10_SFLOAT_BLOCK_EXT:1000066011,VK_FORMAT_ASTC_12x10_SFLOAT_BLOCK_EXT:1000066012,VK_FORMAT_ASTC_12x12_SFLOAT_BLOCK_EXT:1000066013,VK_FORMAT_G8B8G8R8_422_UNORM_KHR:1000156e3,VK_FORMAT_B8G8R8G8_422_UNORM_KHR:1000156001,VK_FORMAT_G8_B8_R8_3PLANE_420_UNORM_KHR:1000156002,VK_FORMAT_G8_B8R8_2PLANE_420_UNORM_KHR:1000156003,VK_FORMAT_G8_B8_R8_3PLANE_422_UNORM_KHR:1000156004,VK_FORMAT_G8_B8R8_2PLANE_422_UNORM_KHR:1000156005,VK_FORMAT_G8_B8_R8_3PLANE_444_UNORM_KHR:1000156006,VK_FORMAT_R10X6_UNORM_PACK16_KHR:1000156007,VK_FORMAT_R10X6G10X6_UNORM_2PACK16_KHR:1000156008,VK_FORMAT_R10X6G10X6B10X6A10X6_UNORM_4PACK16_KHR:1000156009,VK_FORMAT_G10X6B10X6G10X6R10X6_422_UNORM_4PACK16_KHR:1000156010,VK_FORMAT_B10X6G10X6R10X6G10X6_422_UNORM_4PACK16_KHR:1000156011,VK_FORMAT_G10X6_B10X6_R10X6_3PLANE_420_UNORM_3PACK16_KHR:1000156012,VK_FORMAT_G10X6_B10X6R10X6_2PLANE_420_UNORM_3PACK16_KHR:1000156013,VK_FORMAT_G10X6_B10X6_R10X6_3PLANE_422_UNORM_3PACK16_KHR:1000156014,VK_FORMAT_G10X6_B10X6R10X6_2PLANE_422_UNORM_3PACK16_KHR:1000156015,VK_FORMAT_G10X6_B10X6_R10X6_3PLANE_444_UNORM_3PACK16_KHR:1000156016,VK_FORMAT_R12X4_UNORM_PACK16_KHR:1000156017,VK_FORMAT_R12X4G12X4_UNORM_2PACK16_KHR:1000156018,VK_FORMAT_R12X4G12X4B12X4A12X4_UNORM_4PACK16_KHR:1000156019,VK_FORMAT_G12X4B12X4G12X4R12X4_422_UNORM_4PACK16_KHR:1000156020,VK_FORMAT_B12X4G12X4R12X4G12X4_422_UNORM_4PACK16_KHR:1000156021,VK_FORMAT_G12X4_B12X4_R12X4_3PLANE_420_UNORM_3PACK16_KHR:1000156022,VK_FORMAT_G12X4_B12X4R12X4_2PLANE_420_UNORM_3PACK16_KHR:1000156023,VK_FORMAT_G12X4_B12X4_R12X4_3PLANE_422_UNORM_3PACK16_KHR:1000156024,VK_FORMAT_G12X4_B12X4R12X4_2PLANE_422_UNORM_3PACK16_KHR:1000156025,VK_FORMAT_G12X4_B12X4_R12X4_3PLANE_444_UNORM_3PACK16_KHR:1000156026,VK_FORMAT_G16B16G16R16_422_UNORM_KHR:1000156027,VK_FORMAT_B16G16R16G16_422_UNORM_KHR:1000156028,VK_FORMAT_G16_B16_R16_3PLANE_420_UNORM_KHR:1000156029,VK_FORMAT_G16_B16R16_2PLANE_420_UNORM_KHR:1000156030,VK_FORMAT_G16_B16_R16_3PLANE_422_UNORM_KHR:1000156031,VK_FORMAT_G16_B16R16_2PLANE_422_UNORM_KHR:1000156032,VK_FORMAT_G16_B16_R16_3PLANE_444_UNORM_KHR:1000156033};Object.freeze(J2e);var oce=J2e;function Xjt(e){switch(e){case te.FLOAT:return"float";case te.FLOAT_VEC2:return"vec2";case te.FLOAT_VEC3:return"vec3";case te.FLOAT_VEC4:return"vec4";case te.FLOAT_MAT2:return"mat2";case te.FLOAT_MAT3:return"mat3";case te.FLOAT_MAT4:return"mat4";case te.SAMPLER_2D:return"sampler2D";case te.BOOL:return"bool"}}var sce=Xjt;function Kjt(e,t,n){return function(){n.apply(e,arguments),t.apply(e,arguments)}}var G4=Kjt;var $jt=new h(1,1,1);function ace(e){e=e??$jt,this._dimensions=h.clone(e)}Object.defineProperties(ace.prototype,{dimensions:{get:function(){return this._dimensions},set:function(e){h.clone(e,this._dimensions)}}});var Jjt=new h;ace.prototype.emit=function(e){let t=this._dimensions,n=h.multiplyByScalar(t,.5,Jjt),i=D.randomBetween(-n.x,n.x),r=D.randomBetween(-n.y,n.y),o=D.randomBetween(-n.z,n.z);e.position=h.fromElements(i,r,o,e.position),e.velocity=h.normalize(e.position,e.velocity)};var cce=ace;var lce=0,Z2e=new h,BW=new h,Zjt=new Fo;function Qjt(e,t,n){let i=t.tileX,r=t.tileY,o=t.tileZ,s=n?.featureIdProperty,a=Zjt.tileXYToRectangle(i,r,o),c=ie.center(a),u=h.fromRadians(c.longitude,c.latitude,0),f=4294967295,d=f,p=f,g=new Map,m=new Map,y=[],A=[],b=[],x=0;function T(){let B=(4-x%4)%4;B>0&&(b.push(new Uint8Array(B)),x+=B)}function E(B,j){T();let k=x;b.push(new Uint8Array(B.buffer,B.byteOffset,B.byteLength)),x+=B.byteLength;let G=y.length;return y.push({buffer:0,byteOffset:k,byteLength:B.byteLength,target:j}),G}function v(B,j){let k=E(B,j.target),G=bt.getComponentCount(j.type),q={bufferView:k,byteOffset:0,componentType:j.componentType,count:B.length/G,type:j.type};l(j.min)&&(q.min=j.min),l(j.max)&&(q.max=j.max);let Q=A.length;return A.push(q),Q}function S(B){let j=Number.POSITIVE_INFINITY,k=Number.POSITIVE_INFINITY,G=Number.POSITIVE_INFINITY,q=Number.NEGATIVE_INFINITY,Q=Number.NEGATIVE_INFINITY,W=Number.NEGATIVE_INFINITY;for(let J=0;J<B.length;J+=3){let Z=B[J],ae=B[J+1],Ae=B[J+2];Z<j&&(j=Z),ae<k&&(k=ae),Ae<G&&(G=Ae),Z>q&&(q=Z),ae>Q&&(Q=ae),Ae>W&&(W=Ae)}return{min:[j,k,G],max:[q,Q,W]}}function I(B,j,k){if(k.length===0)return;let G=new Uint32Array(k),q=v(G,{type:"SCALAR",componentType:Y.UNSIGNED_INT,target:te.ARRAY_BUFFER});B._FEATURE_ID_0=q;let Q={featureCount:g.size,nullFeatureId:d,attribute:0};m.size>0&&(Q.propertyTable=0),j.EXT_mesh_features={featureIds:[Q]}}function R(B,j){j=j??4;let k=(j-x%j)%j;k>0&&(b.push(new Uint8Array(k)),x+=k);let G=x;b.push(B),x+=B.byteLength;let q=y.length;return y.push({buffer:0,byteOffset:G,byteLength:B.byteLength}),q}function O(){if(m.size===0)return;let B=new Map;for(let q of m.values())for(let[Q,W]of Object.entries(q)){if(!l(W))continue;let J=typeof W,Z;J==="string"?Z="STRING":J==="number"?Z="SCALAR":J==="boolean"?Z="BOOLEAN":Z="STRING";let ae=B.get(Q);l(ae)?ae!==Z&&B.set(Q,"STRING"):B.set(Q,Z)}if(B.size===0)return;let j={};for(let[q,Q]of B)Q==="SCALAR"?j[q]={type:"SCALAR",componentType:"FLOAT64"}:Q==="BOOLEAN"?j[q]={type:"BOOLEAN"}:j[q]={type:"STRING"};let k={},G=g.size;for(let[q,Q]of B)if(Q==="SCALAR"){let W=new Float64Array(G);for(let Z=0;Z<G;Z++){let Ae=m.get(Z)?.[q];W[Z]=typeof Ae=="number"&&Number.isFinite(Ae)?Ae:NaN}let J=R(new Uint8Array(W.buffer,W.byteOffset,W.byteLength),8);k[q]={values:J}}else if(Q==="BOOLEAN"){let W=Math.ceil(G/8),J=new Uint8Array(W);for(let ae=0;ae<G;ae++)m.get(ae)?.[q]&&(J[ae>>3]|=1<<(ae&7));let Z=R(J);k[q]={values:Z}}else{let W=new TextEncoder,J=[],Z=new Uint32Array(G+1),ae=0;for(let we=0;we<G;we++){Z[we]=ae;let Re=m.get(we)?.[q],Qe;Re==null?Qe="":typeof Re=="string"?Qe=Re:Qe=String(Re);let He=W.encode(Qe);J.push(He),ae+=He.byteLength}Z[G]=ae;let Ae=new Uint8Array(ae),fe=0;for(let we of J)Ae.set(we,fe),fe+=we.byteLength;let xe=R(Ae),ge=R(new Uint8Array(Z.buffer,Z.byteOffset,Z.byteLength));k[q]={values:xe,stringOffsets:ge,stringOffsetType:"UINT32"}}return{schema:{classes:{mvt_feature:{properties:j}}},propertyTables:[{class:"mvt_feature",count:G,properties:k}]}}let L=[],_=[],C=[u.x,u.y,u.z];for(let B of e.layers){let j=B.extent,k=[],G=[],q=[],Q=[],W=[],J=0,Z=[],ae=[],Ae=[],fe=[],xe=[],ge=[],we=[],Se=0;for(let He of B.features){let Xe=l(s)?t6t(He,s,g)??d:e6t(He,g);if(Xe!==d&&!m.has(Xe)){let $e=Object.assign({},He.properties);$e._layer=B.name??"",m.set(Xe,$e)}if(He.type==="Point"){let $e=He.geometry;for(let Pe of $e)uce(Pe,i,r,o,j,lce,u,k),G.push(Xe);continue}if(He.type==="LineString"){let $e=He.geometry;for(let Pe of $e){let qe=q.length/3;for(let st of Pe)uce(st,i,r,o,j,lce,u,q),Q.push(Xe);for(let st=0;st<Pe.length;st++)W.push(qe+st);W.push(p),J++}continue}if(He.type==="Polygon"){let $e=He.geometry,Pe=n6t($e);for(let qe of Pe){let st=[qe.outerRing,...qe.holes],vt=[],Gt=[],lt=[],mt=0;for(let ht=0;ht<st.length;ht++){let Bi=st[ht];ht>0&<.push(mt);for(let Xn of Bi)vt.push(new U(Xn.x,Xn.y)),uce(Xn,i,r,o,j,lce,u,Gt),mt++}if(vt.length<3)continue;let ft=fi.triangulate(vt,lt.length>0?lt:void 0);if(!l(ft)||ft.length===0){_t("buildVectorGltfFromMVT-triangulation-failed","Polygon triangulation failed; skipping polygon.");continue}let Xt=Z.length/3,rt=Ae.length;fe.push(Xt),xe.push(rt),ge.push(lt.length);for(let ht=0;ht<lt.length;ht++)we.push(Xt+lt[ht]);for(let ht=0;ht<Gt.length;ht++)Z.push(Gt[ht]);for(let ht=0;ht<Gt.length/3;ht++)ae.push(Xe);for(let ht=0;ht<ft.length;ht++)Ae.push(ft[ht]+Xt);Se++}}}if(k.length===0&&q.length===0&&Z.length===0)continue;W.length>0&&W[W.length-1]===p&&W.pop();let Re=[];if(k.length>0){let He=new Float32Array(k),Xe=S(He),Pe={POSITION:v(He,{type:"VEC3",componentType:Y.FLOAT,target:te.ARRAY_BUFFER,min:Xe.min,max:Xe.max})},qe={CESIUM_mesh_vector:{vector:!0,count:He.length/3}};I(Pe,qe,G),Re.push({mode:Oe.POINTS,attributes:Pe,extensions:qe})}if(q.length>0&&W.length>1){let He=new Float32Array(q),Xe=new Uint32Array(W),$e=S(He),Pe=v(He,{type:"VEC3",componentType:Y.FLOAT,target:te.ARRAY_BUFFER,min:$e.min,max:$e.max}),qe=v(Xe,{type:"SCALAR",componentType:Y.UNSIGNED_INT,target:te.ELEMENT_ARRAY_BUFFER}),st={POSITION:Pe},vt={CESIUM_mesh_vector:{vector:!0,count:J}};I(st,vt,Q),Re.push({mode:Oe.LINE_STRIP,indices:qe,attributes:st,extensions:vt})}if(Z.length>0&&Ae.length>=3){let He=new Float32Array(Z),Xe=new Uint32Array(Ae),$e=new Uint32Array(fe),Pe=new Uint32Array(xe),qe=we.length>0,st=qe?new Uint32Array(ge):void 0,vt=qe?new Uint32Array(we):void 0,Gt=S(He),lt=v(He,{type:"VEC3",componentType:Y.FLOAT,target:te.ARRAY_BUFFER,min:Gt.min,max:Gt.max}),mt=v(Xe,{type:"SCALAR",componentType:Y.UNSIGNED_INT,target:te.ELEMENT_ARRAY_BUFFER}),ft=v($e,{type:"SCALAR",componentType:Y.UNSIGNED_INT,target:te.ARRAY_BUFFER}),Xt=v(Pe,{type:"SCALAR",componentType:Y.UNSIGNED_INT,target:te.ARRAY_BUFFER}),rt=l(st)?v(st,{type:"SCALAR",componentType:Y.UNSIGNED_INT,target:te.ARRAY_BUFFER}):void 0,ht=l(vt)?v(vt,{type:"SCALAR",componentType:Y.UNSIGNED_INT,target:te.ARRAY_BUFFER}):void 0,Bi={POSITION:lt},Xn={CESIUM_mesh_vector:{vector:!0,count:Se,polygonAttributeOffsets:ft,polygonIndicesOffsets:Xt}};qe&&(Xn.CESIUM_mesh_vector.polygonHoleCounts=rt,Xn.CESIUM_mesh_vector.polygonHoleOffsets=ht),I(Bi,Xn,ae),Re.push({mode:Oe.TRIANGLES,indices:mt,attributes:Bi,extensions:Xn})}if(Re.length===0)continue;let Qe=L.length;L.push({primitives:Re}),_.push({name:B.name,mesh:Qe,translation:C})}if(_.length===0)return;let w=O(),P=s6t(b,x),M=["CESIUM_mesh_vector"];g.size>0&&M.push("EXT_mesh_features"),l(w)&&M.push("EXT_structural_metadata");let F=_.map((B,j)=>j),V={asset:{version:"2.0"},extensionsUsed:M,scene:0,scenes:[{nodes:F}],nodes:_,meshes:L,accessors:A,bufferViews:y,buffers:[{byteLength:P.byteLength}],extensions:void 0};return l(w)&&(V.extensions={EXT_structural_metadata:w}),o6t(V,P)}function e6t(e,t){let n=t.get(e);return l(n)||(n=t.size,t.set(e,n)),n}function t6t(e,t,n){let i=e.properties;if(!l(i))return;let r=i[t];if(!l(r)||typeof r!="string"&&typeof r!="number"&&typeof r!="boolean"||typeof r=="number"&&!Number.isFinite(r))return;let o=`${typeof r}:${r}`,s=n.get(o);return l(s)||(s=n.size,n.set(o,s)),s}function n6t(e){let t=[];for(let n of e){let i=r6t(n);if(i.length<3)continue;i6t(i)<=0?t.push({outerRing:i,holes:[]}):t.length>0&&t[t.length-1].holes.push(i)}return t}function i6t(e){let t=0;for(let n=0,i=e.length-1;n<e.length;i=n++)t+=(e[i].x+e[n].x)*(e[i].y-e[n].y);return t/2}function r6t(e){return e.length>1&&e[0].x===e[e.length-1].x&&e[0].y===e[e.length-1].y?e.slice(0,e.length-1):e}function uce(e,t,n,i,r,o,s,a){let c=1<<i,u=(t+e.x/r)/c,f=(n+e.y/r)/c,d=u*2*Math.PI-Math.PI,p=Math.atan(Math.sinh(Math.PI*(1-2*f)));h.fromRadians(d,p,o,void 0,Z2e),h.subtract(Z2e,s,BW),a.push(BW.x,BW.y,BW.z)}function o6t(e,t){let s=new TextEncoder().encode(JSON.stringify(e)),a=Math.ceil(s.length/4)*4,c=new Uint8Array(a);c.fill(32),c.set(s);let u=Math.ceil(t.byteLength/4)*4,f=new Uint8Array(u);f.set(t);let d=20+a+8+u,p=new Uint8Array(d),g=new DataView(p.buffer),m=0;return g.setUint32(m,1179937895,!0),m+=4,g.setUint32(m,2,!0),m+=4,g.setUint32(m,d,!0),m+=4,g.setUint32(m,a,!0),m+=4,g.setUint32(m,1313821514,!0),m+=4,p.set(c,m),m+=a,g.setUint32(m,u,!0),m+=4,g.setUint32(m,5130562,!0),m+=4,p.set(f,m),p}function s6t(e,t){let n=new Uint8Array(t),i=0;for(let r of e)n.set(r,i),i+=r.byteLength;return n}var W4=Qjt;var fce=class{constructor(){ut(this,"featuresLength");ut(this,"pointsLength");ut(this,"trianglesLength");ut(this,"geometryByteLength");ut(this,"texturesByteLength");ut(this,"batchTableByteLength");ut(this,"innerContents");ut(this,"ready");ut(this,"tileset");ut(this,"tile");ut(this,"url");ut(this,"batchTable");ut(this,"metadata");ut(this,"group");this.featurePropertiesDirty=!1}hasProperty(t,n){pe.throwInstantiationError()}getFeature(t){pe.throwInstantiationError()}applyDebugSettings(t,n){pe.throwInstantiationError()}applyStyle(t){pe.throwInstantiationError()}update(t,n){pe.throwInstantiationError()}pick(t,n,i){pe.throwInstantiationError()}isDestroyed(){pe.throwInstantiationError()}destroy(){pe.throwInstantiationError()}},dce=fce;function q4(e){e=e??H.EMPTY_OBJECT,this._maximumSubtreeCount=e.maximumSubtreeCount??0,this._subtreeRequestCounter=0,this._queue=new K_({comparator:q4.comparator})}q4.prototype.addSubtree=function(e){let t=new a6t(e,this._subtreeRequestCounter);this._subtreeRequestCounter++,this._queue.insert(t);let n=e.implicitCoordinates;if(n.level>0){let i=n.getParentSubtreeCoordinates(),r=this.find(i)}if(this._maximumSubtreeCount>0)for(;this._queue.length>this._maximumSubtreeCount&&this._queue.getMinimum()!==t;)this._queue.removeMinimum()};q4.prototype.find=function(e){let t=this._queue,n=t.internalArray,i=t.length;for(let r=0;r<i;r++){let o=n[r],a=o.subtree.implicitCoordinates;if(e.isEqual(a))return o.subtree}};q4.comparator=function(e,t){let n=e.subtree.implicitCoordinates,i=t.subtree.implicitCoordinates;return n.isAncestor(i)?1:i.isAncestor(n)?-1:e.stamp-t.stamp};function a6t(e,t){this.subtree=e,this.stamp=t}var Y4=q4;function X4(e){e=e??H.EMPTY_OBJECT;let{className:t,names:n,types:i,componentTypes:r,shape:o,dimensions:s,paddingBefore:a=h.ZERO.clone(),paddingAfter:c=h.ZERO.clone(),globalTransform:u=N.IDENTITY.clone(),shapeTransform:f=N.IDENTITY.clone(),minBounds:d,maxBounds:p,minimumValues:g,maximumValues:m,maximumTileCount:y}=e;this._shapeTransform=f,this._globalTransform=u,this._shape=o,this._minBounds=d,this._maxBounds=p,this._dimensions=s,this._paddingBefore=a,this._paddingAfter=c,this._className=t,this._names=n,this._types=i,this._componentTypes=r,this._metadataOrder=o===Tc.ELLIPSOID?R0.Z_UP:R0.Y_UP,this._minimumValues=g,this._maximumValues=m,this._maximumTileCount=y,this._availableLevels=void 0,this._implicitTileset=void 0,this._subtreeCache=new Y4}Object.defineProperties(X4.prototype,{globalTransform:{get:function(){return this._globalTransform}},shapeTransform:{get:function(){return this._shapeTransform}},shape:{get:function(){return this._shape}},minBounds:{get:function(){return this._minBounds}},maxBounds:{get:function(){return this._maxBounds}},dimensions:{get:function(){return this._dimensions}},paddingBefore:{get:function(){return this._paddingBefore}},paddingAfter:{get:function(){return this._paddingAfter}},className:{get:function(){return this._className}},names:{get:function(){return this._names}},types:{get:function(){return this._types}},componentTypes:{get:function(){return this._componentTypes}},metadataOrder:{get:function(){return this._metadataOrder}},minimumValues:{get:function(){return this._minimumValues}},maximumValues:{get:function(){return this._maximumValues}},maximumTileCount:{get:function(){return this._maximumTileCount}},availableLevels:{get:function(){return this._availableLevels}}});X4.fromUrl=async function(e){let t=De.createIfNeeded(e),n=await t.fetchJson();l6t(n);let i=g6t(n,t);await i.load();let{root:r}=n,o=rr(n,"3DTILES_metadata")?n.extensions["3DTILES_metadata"]:n,s=new mE({metadataJson:o,schema:i.schema}),a=r.content.extensions["3DTILES_content_voxels"],c=a.class,u=_6t(s,c);Object.assign(u,u6t(r)),l(r.transform)?u.globalTransform=N.unpack(r.transform):u.globalTransform=N.clone(N.IDENTITY),u.dimensions=h.unpack(a.dimensions),u.maximumTileCount=c6t(s),l(a.padding)&&(u.paddingBefore=h.unpack(a.padding.before),u.paddingAfter=h.unpack(a.padding.after));let f=new X4(u),d=new f0(t,r,i.schema);return f._implicitTileset=d,f._availableLevels=d.availableLevels,Fi.unload(i),f};function c6t(e){if(l(e.tileset))return e.tileset.getPropertyBySemantic(rh.TILESET_TILE_COUNT)}function l6t(e){let t=e.root;if(!l(t.content))throw new oe("Root must have content");if(!rr(t.content,"3DTILES_content_voxels"))throw new oe("Root tile content must have 3DTILES_content_voxels extension");if(!rr(t,"3DTILES_implicit_tiling")&&!l(t.implicitTiling))throw new oe("Root tile must have implicit tiling");if(!l(e.schema)&&!l(e.schemaUri)&&!rr(e,"3DTILES_metadata"))throw new oe("Tileset must have a metadata schema")}function u6t(e){let t=e.boundingVolume;if(l(t.box))return m6t(t.box);if(l(t.region))return f6t(t.region);if(rr(t,"3DTILES_bounding_volume_cylinder"))return p6t(t.extensions["3DTILES_bounding_volume_cylinder"]);throw new oe("Only box, region and 3DTILES_bounding_volume_cylinder are supported in Cesium3DTilesVoxelProvider")}function f6t(e){let t=e[0],n=e[1],i=e[2],r=e[3],o=e[4],s=e[5],a=N.fromScale(ee.WGS84.radii),c=new h(t,n,o),u=new h(i,r,s);return{shape:Tc.ELLIPSOID,minBounds:c,maxBounds:u,shapeTransform:a}}var d6t=new h,h6t=new $;function m6t(e){let t=en.unpack(e),n=$.getScale(t.halfAxes,d6t),i=$.getRotation(t.halfAxes,h6t);return{shape:Tc.BOX,minBounds:h.negate(n,new h),maxBounds:h.clone(n),shapeTransform:N.fromRotationTranslation(i,t.center)}}function p6t(e){let{minRadius:t,maxRadius:n,height:i,minAngle:r=-D.PI,maxAngle:o=D.PI,translation:s=[0,0,0],rotation:a=[0,0,0,1]}=e,c=-.5*i+s[2],u=.5*i+s[2],f=N.fromTranslationQuaternionRotationScale(h.unpack(s),Le.unpack(a),h.ONE);return{shape:Tc.CYLINDER,minBounds:h.fromElements(t,r,c),maxBounds:h.fromElements(n,o,u),shapeTransform:f}}function g6t(e,t){let{schemaUri:n,schema:i}=e;return l(n)?Fi.getSchemaLoader({resource:t.getDerivedResource({url:n})}):Fi.getSchemaLoader({schema:i})}function _6t(e,t){let{schema:n,statistics:i}=e,r=i?.classes[t],o=n.classes[t].properties,s=Object.entries(o).map(([g,m])=>{let{type:y,componentType:A}=m,b=r?.properties[g].min,x=r?.properties[g].max,T=bt.getComponentCount(y),E=Q2e(b,T),v=Q2e(x,T);return{id:g,type:y,componentType:A,minValue:E,maxValue:v}}),a=s.map(g=>g.id),c=s.map(g=>g.type),u=s.map(g=>g.componentType),f=s.map(g=>g.minValue),d=s.map(g=>g.maxValue),p=f.some(l);return{className:t,names:a,types:c,componentTypes:u,minimumValues:p?f:void 0,maximumValues:p?d:void 0}}function Q2e(e,t){if(!l(e))return;let n=Array.isArray(e)?e:[e];return Array.from({length:t},(i,r)=>n[r])}async function y6t(e,t){let n=e._implicitTileset,i=e._subtreeCache,r=i.find(t);if(l(r))return r;let o=n.subtreeUriTemplate.getDerivedResource({templateValues:t.getTemplateValues()}),s=n.baseResource.getDerivedResource({url:o.url}),a=await s.fetchArrayBuffer();if(r=i.find(t),l(r))return r;let c=v_(a);return r=await p_.fromSubtreeJson(s,c.jsonPayload,c.binaryPayload,n,t),i.addSubtree(r),r}X4.prototype.requestData=async function(e){e=e??H.EMPTY_OBJECT;let{tileLevel:t=0,tileX:n=0,tileY:i=0,tileZ:r=0,keyframe:o=0}=e;if(o!==0)return Promise.reject("3D Tiles currently doesn't support time-dynamic data.");let s=this._implicitTileset,a=new d0({subdivisionScheme:s.subdivisionScheme,subtreeLevels:s.subtreeLevels,level:t,x:n,y:i,z:r}),c=a.isSubtreeRoot()&&a.level>0,u=c?a.getParentSubtreeCoordinates():a.getSubtreeCoordinates(),d=await y6t(this,u);if(!(c?d.childSubtreeIsAvailableAtCoordinates:d.tileIsAvailableAtCoordinates).call(d,a))return Promise.reject(`Tile is not available at level ${t}, x ${n}, y ${i}, z ${r}.`);let{contentUriTemplates:m,baseResource:y}=s,A=m[0].getDerivedResource({templateValues:a.getTemplateValues()}),b=y.getDerivedResource({url:A.url});return XE.fromGltf(b)};var hce=X4;function mce(e){e=e??1,this._radius=e??1}Object.defineProperties(mce.prototype,{radius:{get:function(){return this._radius},set:function(e){this._radius=e}}});mce.prototype.emit=function(e){let t=D.randomBetween(0,D.TWO_PI),n=D.randomBetween(0,this._radius),i=n*Math.cos(t),r=n*Math.sin(t),o=0;e.position=h.fromElements(i,r,o,e.position),e.velocity=h.clone(h.UNIT_Z,e.velocity)};var K4=mce;var kW={CUMULUS:0};kW.validate=function(e){return e===kW.CUMULUS};Object.freeze(kW);var HP=kW;function hp(e,t){if(e=e??H.EMPTY_OBJECT,this._show=e.show??!0,this._position=h.clone(e.position??h.ZERO),!l(e.scale)&&l(e.maximumSize))this._maximumSize=h.clone(e.maximumSize),this._scale=new U(this._maximumSize.x,this._maximumSize.y);else{this._scale=U.clone(e.scale??new U(20,12));let n=new h(this._scale.x,this._scale.y,Math.min(this._scale.x,this._scale.y)/1.5);this._maximumSize=h.clone(e.maximumSize??n)}this._slice=e.slice??-1,this._color=z.clone(e.color??z.WHITE),this._brightness=e.brightness??1,this._cloudCollection=t,this._index=-1}var A6t=hp.SHOW_INDEX=0,b6t=hp.POSITION_INDEX=1,x6t=hp.SCALE_INDEX=2,T6t=hp.MAXIMUM_SIZE_INDEX=3,E6t=hp.SLICE_INDEX=4,C6t=hp.BRIGHTNESS_INDEX=5,v6t=hp.COLOR_INDEX=6;hp.NUMBER_OF_PROPERTIES=7;function GC(e,t){let n=e._cloudCollection;l(n)&&(n._updateCloud(e,t),e._dirty=!0)}Object.defineProperties(hp.prototype,{show:{get:function(){return this._show},set:function(e){this._show!==e&&(this._show=e,GC(this,A6t))}},position:{get:function(){return this._position},set:function(e){let t=this._position;h.equals(t,e)||(h.clone(e,t),GC(this,b6t))}},scale:{get:function(){return this._scale},set:function(e){let t=this._scale;U.equals(t,e)||(U.clone(e,t),GC(this,x6t))}},maximumSize:{get:function(){return this._maximumSize},set:function(e){let t=this._maximumSize;h.equals(t,e)||(h.clone(e,t),GC(this,T6t))}},color:{get:function(){return this._color},set:function(e){let t=this._color;z.equals(t,e)||(z.clone(e,t),GC(this,v6t))}},slice:{get:function(){return this._slice},set:function(e){this._slice!==e&&(this._slice=e,GC(this,E6t))}},brightness:{get:function(){return this._brightness},set:function(e){this._brightness!==e&&(this._brightness=e,GC(this,C6t))}}});hp.prototype._destroy=function(){this._cloudCollection=void 0};var yd=hp;var Ad,UW=new h,S6t={positionHighAndScaleX:0,positionLowAndScaleY:1,packedAttribute0:2,packedAttribute1:3,color:4},w6t={direction:0,positionHighAndScaleX:1,positionLowAndScaleY:2,packedAttribute0:3,packedAttribute1:4,color:5},I6t=yd.SHOW_INDEX,P6t=yd.POSITION_INDEX,D6t=yd.SCALE_INDEX,R6t=yd.MAXIMUM_SIZE_INDEX,O6t=yd.SLICE_INDEX,M6t=yd.BRIGHTNESS_INDEX,N6t=yd.NUMBER_OF_PROPERTIES,L6t=yd.COLOR_INDEX;function mp(e){e=e??H.EMPTY_OBJECT,this._clouds=[],this._cloudsToUpdate=[],this._cloudsToUpdateIndex=0,this._cloudsRemoved=!1,this._createVertexArray=!1,this._propertiesChanged=new Uint32Array(N6t),this._noiseTexture=void 0,this._textureSliceWidth=128,this._noiseTextureRows=4,this.noiseDetail=e.noiseDetail??16,this.noiseOffset=h.clone(e.noiseOffset??h.ZERO),this._loading=!1,this._ready=!1;let t=this;this._uniforms={u_noiseTexture:function(){return t._noiseTexture},u_noiseTextureDimensions:eke(t),u_noiseDetail:function(){return t.noiseDetail}},this._vaNoise=void 0,this._spNoise=void 0,this._spCreated=!1,this._sp=void 0,this._rs=void 0,this.show=e.show??!0,this._colorCommands=[],this.debugBillboards=e.debugBillboards??!1,this._compiledDebugBillboards=!1,this.debugEllipsoids=e.debugEllipsoids??!1,this._compiledDebugEllipsoids=!1}function eke(e){return function(){return UW.x=e._textureSliceWidth,UW.y=e._noiseTextureRows,UW.z=1/e._noiseTextureRows,UW}}Object.defineProperties(mp.prototype,{length:{get:function(){return gce(this),this._clouds.length}}});function tke(e){let t=e.length;for(let n=0;n<t;++n)e[n]&&e[n]._destroy()}mp.prototype.add=function(e){e=e??H.EMPTY_OBJECT;let t=e.cloudType??HP.CUMULUS,n;return t===HP.CUMULUS&&(n=new yd(e,this),n._index=this._clouds.length,this._clouds.push(n),this._createVertexArray=!0),n};mp.prototype.remove=function(e){return this.contains(e)?(this._clouds[e._index]=void 0,this._cloudsRemoved=!0,this._createVertexArray=!0,e._destroy(),!0):!1};mp.prototype.removeAll=function(){tke(this._clouds),this._clouds=[],this._cloudsToUpdate=[],this._cloudsToUpdateIndex=0,this._cloudsRemoved=!1,this._createVertexArray=!0};function gce(e){if(e._cloudsRemoved){e._cloudsRemoved=!1;let t=[],n=e._clouds,i=n.length;for(let r=0,o=0;r<i;++r){let s=n[r];l(s)&&(n._index=o++,t.push(s))}e._clouds=t}}mp.prototype._updateCloud=function(e,t){e._dirty||(this._cloudsToUpdate[this._cloudsToUpdateIndex++]=e),++this._propertiesChanged[t]};mp.prototype.contains=function(e){return l(e)&&e._cloudCollection===this};mp.prototype.get=function(e){return gce(this),this._clouds[e]};var F6t=new Float32Array([-1,-1,1,-1,1,1,-1,1]),B6t=new Uint16Array([0,1,2,0,2,3]);function k6t(e){let t=tt.createVertexBuffer({context:e,typedArray:F6t,usage:Me.STATIC_DRAW}),n=tt.createIndexBuffer({context:e,typedArray:B6t,usage:Me.STATIC_DRAW,indexDatatype:je.UNSIGNED_SHORT}),i=[{index:0,vertexBuffer:t,componentsPerAttribute:2,componentDatatype:Y.FLOAT}];return new zn({context:e,attributes:i,indexBuffer:n})}var _ce;function U6t(e){let n=e.cache.cloudCollection_indexBufferBatched;if(l(n))return n;let i=16384*6-6,r=new Uint16Array(i);for(let o=0,s=0;o<i;o+=6,s+=4)r[o]=s,r[o+1]=s+1,r[o+2]=s+2,r[o+3]=s,r[o+4]=s+2,r[o+5]=s+3;return n=tt.createIndexBuffer({context:e,typedArray:r,usage:Me.STATIC_DRAW,indexDatatype:je.UNSIGNED_SHORT}),n.vertexArrayDestroyable=!1,e.cache.cloudCollection_indexBufferBatched=n,n}function z6t(e){let t=e.cache.cloudCollection_indexBufferInstanced;return l(t)||(t=tt.createIndexBuffer({context:e,typedArray:new Uint16Array([0,1,2,0,2,3]),usage:Me.STATIC_DRAW,indexDatatype:je.UNSIGNED_SHORT}),t.vertexArrayDestroyable=!1,e.cache.cloudCollection_indexBufferInstanced=t),t}function V6t(e){let t=e.cache.cloudCollection_vertexBufferInstanced;return l(t)||(t=tt.createVertexBuffer({context:e,typedArray:new Float32Array([0,0,1,0,1,1,0,1]),usage:Me.STATIC_DRAW}),t.vertexArrayDestroyable=!1,e.cache.cloudCollection_vertexBufferInstanced=t),t}function j6t(e,t,n){let i=[{index:Ad.positionHighAndScaleX,componentsPerAttribute:4,componentDatatype:Y.FLOAT,usage:Me.STATIC_DRAW},{index:Ad.positionLowAndScaleY,componentsPerAttribute:4,componentDatatype:Y.FLOAT,usage:Me.STATIC_DRAW},{index:Ad.packedAttribute0,componentsPerAttribute:4,componentDatatype:Y.FLOAT,usage:Me.STATIC_DRAW},{index:Ad.packedAttribute1,componentsPerAttribute:4,componentDatatype:Y.FLOAT,usage:Me.STATIC_DRAW},{index:Ad.color,componentsPerAttribute:4,componentDatatype:Y.UNSIGNED_BYTE,normalize:!0,usage:Me.STATIC_DRAW}];n&&i.push({index:Ad.direction,componentsPerAttribute:2,componentDatatype:Y.FLOAT,vertexBuffer:V6t(e)});let r=n?t:4*t;return new mg(e,i,r,n)}var pce=new Sn;function nke(e,t,n,i){let r,o=n[Ad.positionHighAndScaleX],s=n[Ad.positionLowAndScaleY],a=i.position;Sn.fromCartesian(a,pce);let c=i.scale,u=pce.high,f=pce.low;e._instanced?(r=i._index,o(r,u.x,u.y,u.z,c.x),s(r,f.x,f.y,f.z,c.y)):(r=i._index*4,o(r+0,u.x,u.y,u.z,c.x),o(r+1,u.x,u.y,u.z,c.x),o(r+2,u.x,u.y,u.z,c.x),o(r+3,u.x,u.y,u.z,c.x),s(r+0,f.x,f.y,f.z,c.y),s(r+1,f.x,f.y,f.z,c.y),s(r+2,f.x,f.y,f.z,c.y),s(r+3,f.x,f.y,f.z,c.y))}function ike(e,t,n,i){let r,o=n[Ad.packedAttribute0],s=i.show,a=i.brightness;e._instanced?(r=i._index,o(r,s,a,0,0)):(r=i._index*4,o(r+0,s,a,0,0),o(r+1,s,a,1,0),o(r+2,s,a,1,1),o(r+3,s,a,0,1))}function rke(e,t,n,i){let r,o=n[Ad.packedAttribute1],s=i.maximumSize,a=i.slice;e._instanced?(r=i._index,o(r,s.x,s.y,s.z,a)):(r=i._index*4,o(r+0,s.x,s.y,s.z,a),o(r+1,s.x,s.y,s.z,a),o(r+2,s.x,s.y,s.z,a),o(r+3,s.x,s.y,s.z,a))}function oke(e,t,n,i){let r,o=n[Ad.color],s=i.color,a=z.floatToByte(s.red),c=z.floatToByte(s.green),u=z.floatToByte(s.blue),f=z.floatToByte(s.alpha);e._instanced?(r=i._index,o(r,a,c,u,f)):(r=i._index*4,o(r+0,a,c,u,f),o(r+1,a,c,u,f),o(r+2,a,c,u,f),o(r+3,a,c,u,f))}function H6t(e,t,n,i){nke(e,t,n,i),ike(e,t,n,i),rke(e,t,n,i),oke(e,t,n,i)}function G6t(e,t,n,i){let r=e,o=r._textureSliceWidth,s=r._noiseTextureRows,a=t.context;r._vaNoise=k6t(a),r._spNoise=Qt.fromCache({context:a,vertexShaderSource:n,fragmentShaderSource:i,attributeLocations:{position:0}});let c=r.noiseDetail,u=r.noiseOffset;r._noiseTexture=new Dt({context:a,width:o*o/s,height:o*s,pixelDatatype:ze.UNSIGNED_BYTE,pixelFormat:Ke.RGBA,sampler:new jt({wrapS:hn.REPEAT,wrapT:hn.REPEAT,minificationFilter:Wt.NEAREST,magnificationFilter:Jn.NEAREST})});let f=new xf({vertexArray:r._vaNoise,shaderProgram:r._spNoise,outputTexture:r._noiseTexture,uniformMap:{u_noiseTextureDimensions:eke(r),u_noiseDetail:function(){return c},u_noiseOffset:function(){return u}},persists:!1,owner:e,postExecute:function(d){r._ready=!0,r._loading=!1}});t.commandList.push(f),r._loading=!0}function W6t(e,t){let n=e,i=t.context;n._createVertexArray=!1,n._vaf=n._vaf&&n._vaf.destroy();let r=e._clouds,o=r.length;if(o>0){n._vaf=j6t(i,o,n._instanced);let s=n._vaf.writers,a;for(a=0;a<o;++a){let c=r[a];H6t(e,t,s,c)}n._vaf.commit(_ce(i))}}var q6t=[];function Y6t(e,t){let n=t.context,i=e,o=i._clouds.length,s=i._cloudsToUpdate,a=i._cloudsToUpdateIndex,c=i._propertiesChanged,u=q6t;u.length=0,(c[P6t]||c[D6t])&&u.push(nke),(c[I6t]||c[M6t])&&u.push(ike),(c[R6t]||c[O6t])&&u.push(rke),c[L6t]&&u.push(oke);let f=u.length,d=i._vaf.writers,p,g,m;if(a/o>.1){for(p=0;p<a;++p)for(g=s[p],g._dirty=!1,m=0;m<f;++m)u[m](e,t,d,g);i._vaf.commit(_ce(n))}else{for(p=0;p<a;++p){for(g=s[p],g._dirty=!1,m=0;m<f;++m)u[m](e,t,d,g);i._instanced?i._vaf.subCommit(g._index,1):i._vaf.subCommit(g._index*4,4)}i._vaf.endSubCommits()}i._cloudsToUpdateIndex=0}function X6t(e,t,n,i){let r=t.context,o=e,s=new Ye({defines:[],sources:[n]});o._instanced&&s.defines.push("INSTANCED");let a=new Ye({defines:[],sources:[i]});o.debugBillboards&&a.defines.push("DEBUG_BILLBOARDS"),o.debugEllipsoids&&a.defines.push("DEBUG_ELLIPSOIDS"),o._sp=Qt.replaceCache({context:r,shaderProgram:o._sp,vertexShaderSource:s,fragmentShaderSource:a,attributeLocations:Ad}),o._rs=Ge.fromCache({depthTest:{enabled:!0,func:te.LESS},depthMask:!1,blending:tn.ALPHA_BLEND}),o._spCreated=!0,o._compiledDebugBillboards=o.debugBillboards,o._compiledDebugEllipsoids=o.debugEllipsoids}function K6t(e,t){let n=e,i=t.passes,r=n._uniforms,o=t.commandList;if(i.render){let s=n._colorCommands,a=n._vaf.va,c=a.length;s.length=c;for(let u=0;u<c;u++){let f=s[u];l(f)||(f=s[u]=new at),f.pass=Ie.TRANSLUCENT,f.owner=e,f.uniformMap=r,f.count=a[u].indicesCount,f.vertexArray=a[u].va,f.shaderProgram=n._sp,f.renderState=n._rs,n._instanced&&(f.count=6,f.instanceCount=n._clouds.length),o.push(f)}}}mp.prototype.update=function(e){if(gce(this),!this.show)return;let t=this.debugBillboards||this.debugEllipsoids;this._ready=t?!0:l(this._noiseTexture),!this._ready&&!this._loading&&!t&&G6t(this,e,KO,XO),this._instanced=e.context.instancedArrays,Ad=this._instanced?w6t:S6t,_ce=this._instanced?z6t:U6t;let i=this._clouds.length,r=this._cloudsToUpdate,o=this._cloudsToUpdateIndex;this._createVertexArray?W6t(this,e):o>0&&Y6t(this,e),o>i*1.5&&(r.length=i),!(!l(this._vaf)||!l(this._vaf.va)||!this._ready&!t)&&((!this._spCreated||this.debugBillboards!==this._compiledDebugBillboards||this.debugEllipsoids!==this._compiledDebugEllipsoids)&&X6t(this,e,YO,qO),K6t(this,e))};mp.prototype.isDestroyed=function(){return!1};mp.prototype.destroy=function(){return this._noiseTexture=this._noiseTexture&&this._noiseTexture.destroy(),this._sp=this._sp&&this._sp.destroy(),this._vaf=this._vaf&&this._vaf.destroy(),tke(this._clouds),le(this)};var yce=mp;var $6t=D.toRadians(30);function Ace(e){this._angle=e??$6t}Object.defineProperties(Ace.prototype,{angle:{get:function(){return this._angle},set:function(e){this._angle=e}}});Ace.prototype.emit=function(e){let t=Math.tan(this._angle),n=D.randomBetween(0,D.TWO_PI),i=D.randomBetween(0,t),r=i*Math.cos(n),o=i*Math.sin(n),s=1;e.velocity=h.fromElements(r,o,s,e.velocity),h.normalize(e.velocity,e.velocity),e.position=h.clone(h.ZERO,e.position)};var bce=Ace;var J6t=new z,Z6t=new z,Q6t=new z,eHt=new z,ske=new se,$4=new Uint8Array(4);function ake(e,t,n,i){let r=t.height===n.height?0:(e-t.height)/(n.height-t.height);return z.lerp(t.color,n.color,r,i)}function zW(e,t){return{height:e,color:z.clone(t)}}function cke(e){return e=e.filter(function(t,n,i){let r=n>0,o=n<i.length-1,s=r?t.height===i[n-1].height:!0,a=o?t.height===i[n+1].height:!0;return!s||!a}),e=e.filter(function(t,n,i){let r=n>0,o=n<i.length-1,s=r?z.equals(t.color,i[n-1].color):!1,a=o?z.equals(t.color,i[n+1].color):!1;return!s||!a}),e=e.filter(function(t,n,i){let r=n>0,o=r?z.equals(t.color,i[n-1].color):!1,s=r?t.height===i[n-1].height:!0;return!o||!s}),e}function tHt(e){let t,n,i=[],r=e.length;for(t=0;t<r;t++){let o=e[t],s=o.entries,a=s.length,c=[];for(n=0;n<a;n++){let g=s[n],m=D.clamp(g.height,pf._minimumHeight,pf._maximumHeight),y=z.clone(g.color,J6t);y.red*=y.alpha,y.green*=y.alpha,y.blue*=y.alpha,c.push(zW(m,y))}let u=!0,f=!0;for(n=0;n<a-1;n++){let g=c[n+0],m=c[n+1];u=u&&g.height<=m.height,f=f&&g.height>=m.height}f?c=c.reverse():u||b0(c,function(g,m){return D.sign(g.height-m.height)});let d=o.extendDownwards??!1,p=o.extendUpwards??!1;c.length===1&&!d&&!p&&(d=!0,p=!0),d&&c.splice(0,0,zW(pf._minimumHeight,c[0].color)),p&&c.splice(c.length,0,zW(pf._maximumHeight,c[c.length-1].color)),c=cke(c),i.push(c)}return i}function nHt(e){let t=tHt(e),n=[],i,r;function o(u,f){n.push(zW(u,f))}function s(u,f,d){let p=z.multiplyByScalar(d,1-f.alpha,eHt);p=z.add(p,f,p),o(u,p)}let a=t.length;for(r=0;r<a;r++){let u=t[r],f=0,d=0;i=n,n=[];let p=u.length,g=i.length;for(;f<p||d<g;){let m=f<p?u[f]:void 0,y=f>0?u[f-1]:void 0,A=f<p-1?u[f+1]:void 0,b=d<g?i[d]:void 0,x=d>0?i[d-1]:void 0,T=d<g-1?i[d+1]:void 0;if(l(m)&&l(b)&&m.height===b.height){let E=l(T)&&b.height===T.height,v=!l(x),S=!l(T),I=l(A)&&m.height===A.height,R=!l(y),O=!l(A);E?I?(s(m.height,m.color,b.color),s(m.height,A.color,T.color)):R?(o(m.height,b.color),s(m.height,m.color,T.color)):O?(s(m.height,m.color,b.color),o(m.height,T.color)):(s(m.height,m.color,b.color),s(m.height,m.color,T.color)):v?I?(o(m.height,m.color),s(m.height,A.color,b.color)):O?(o(m.height,m.color),o(m.height,b.color)):(R||o(m.height,m.color),s(m.height,m.color,b.color)):S?I?(s(m.height,m.color,b.color),o(m.height,A.color)):R?(o(m.height,b.color),o(m.height,m.color)):O?s(m.height,m.color,b.color):(s(m.height,m.color,b.color),o(m.height,m.color)):I?(s(m.height,m.color,b.color),s(m.height,A.color,b.color)):R?(o(m.height,b.color),s(m.height,m.color,b.color)):O?(s(m.height,m.color,b.color),o(m.height,b.color)):s(m.height,m.color,b.color),f+=I?2:1,d+=E?2:1}else if(l(m)&&l(b)&&l(x)&&m.height<b.height){let E=ake(m.height,x,b,Q6t);l(y)?l(A)?s(m.height,m.color,E):(s(m.height,m.color,E),o(m.height,E)):(o(m.height,E),s(m.height,m.color,E)),f++}else if(l(b)&&l(m)&&l(y)&&b.height<m.height){let E=ake(b.height,y,m,Z6t);l(x)?l(T)?s(b.height,E,b.color):(s(b.height,E,b.color),o(b.height,E)):(o(b.height,E),s(b.height,E,b.color)),d++}else l(m)&&(!l(b)||m.height<b.height)?(l(b)&&!l(x)&&!l(A)?(o(m.height,m.color),o(m.height,pf._emptyColor),o(b.height,pf._emptyColor)):(!l(b)&&l(x)&&!l(y)&&(o(x.height,pf._emptyColor),o(m.height,pf._emptyColor)),o(m.height,m.color)),f++):l(b)&&(!l(m)||b.height<m.height)&&(o(b.height,b.color),d++)}}return cke(n)}function pf(e){let{scene:t,layers:n}=e??H.EMPTY_OBJECT,{context:i}=t,r=nHt(n),o=r.length,s,a,c;if(!pf._useFloatTexture(i)){a=ze.UNSIGNED_BYTE,c=Ke.RGBA,s=new Uint8Array(o*4);for(let g=0;g<o;g++)se.packFloat(r[g].height,ske),se.pack(ske,s,g*4)}else{a=ze.FLOAT,c=i.webgl2?Ke.RED:Ke.LUMINANCE,s=new Float32Array(o);for(let g=0;g<o;g++)s[g]=r[g].height}let f=Dt.create({context:i,pixelFormat:c,pixelDatatype:a,source:{arrayBufferView:s,width:o,height:1},sampler:new jt({wrapS:hn.CLAMP_TO_EDGE,wrapT:hn.CLAMP_TO_EDGE,minificationFilter:Wt.NEAREST,magnificationFilter:Jn.NEAREST})}),d=new Uint8Array(o*4);for(let g=0;g<o;g++)r[g].color.toBytes($4),d[g*4+0]=$4[0],d[g*4+1]=$4[1],d[g*4+2]=$4[2],d[g*4+3]=$4[3];let p=Dt.create({context:i,pixelFormat:Ke.RGBA,pixelDatatype:ze.UNSIGNED_BYTE,source:{arrayBufferView:d,width:o,height:1},sampler:new jt({wrapS:hn.CLAMP_TO_EDGE,wrapT:hn.CLAMP_TO_EDGE,minificationFilter:Wt.LINEAR,magnificationFilter:Jn.LINEAR})});return er.fromType("ElevationBand",{heights:f,colors:p})}pf._useFloatTexture=function(e){return e.floatingPointTexture};pf._maximumHeight=5906376425472;pf._minimumHeight=-5906376425472;pf._emptyColor=new z(0,0,0,0);var xce=pf;async function iHt(e,t){t=t??{},t.cacheBytes=t.cacheBytes??1536*1024*1024,t.maximumCacheOverflowBytes=t.maximumCacheOverflowBytes??1024*1024*1024,t.enableCollision=t.enableCollision??!0,e=e??H.EMPTY_OBJECT,e.onlyUsingWithGoogleGeocoder||_t("google-tiles-with-google-geocoder","Only the Google geocoder can be used with Google Photorealistic 3D Tiles. Set the `geocode` property of Viewer constructor options. You can set additionalOptions.onlyUsingWithGoogleGeocoder to hide this warning once you have configured the geocoder.");let n=e.key??va.defaultApiKey;if(!l(n))return rHt(t);let i,r=va.getDefaultCredit();l(r)&&(i=[r]);let o=new De({url:`${va.mapTilesApiEndpoint}v1/3dtiles/root.json`,queryParameters:{key:n},credits:i});return Xo.fromUrl(o,t)}var lke={};async function rHt(e){let i=lke[2275207];l(i)||(i=Yo.fromAssetId(2275207),lke[2275207]=i);let r=await i;return Xo.fromUrl(r,e)}var Tce=iHt;async function oHt(e){let t=await Xo.fromIonAssetId(96188,e);e=e??H.EMPTY_OBJECT;let n=e.style;if(!l(n)){let i=(e.defaultColor??z.WHITE).toCssColorString();n=new b_({color:`Boolean(\${feature['cesium#color']}) ? color(\${feature['cesium#color']}) : ${i}`})}return t.style=n,t}var Ece=oHt;function sHt(e){e=e??H.EMPTY_OBJECT;let t=[],n=e.geometry;(!l(n.attributes)||!l(n.primitiveType))&&(n=n.constructor.createGeometry(n));let i=n.attributes,r=N.clone(e.modelMatrix??N.IDENTITY),o=e.length??1e4;if(l(i.normal)&&t.push(new Ft({geometry:Hn.createLineSegmentsForVectors(n,"normal",o),attributes:{color:new Jt(1,0,0,1)},modelMatrix:r})),l(i.tangent)&&t.push(new Ft({geometry:Hn.createLineSegmentsForVectors(n,"tangent",o),attributes:{color:new Jt(0,1,0,1)},modelMatrix:r})),l(i.bitangent)&&t.push(new Ft({geometry:Hn.createLineSegmentsForVectors(n,"bitangent",o),attributes:{color:new Jt(0,0,1,1)},modelMatrix:r})),t.length>0)return new On({asynchronous:!1,geometryInstances:t,appearance:new yn({flat:!0,translucent:!1})})}var Cce=sHt;function J4(e){e=e??H.EMPTY_OBJECT;let t=e.attributeName,n=e.perInstanceAttribute;l(n)||(n=!1);let i=e.glslDatatype??"vec3",r=`v_${t}`,o;if(t==="normal"||t==="tangent"||t==="bitangent")o=`vec4 getColor() { return vec4((${r} + vec3(1.0)) * 0.5, 1.0); } +`;else switch(t==="st"&&(i="vec2"),i){case"float":o=`vec4 getColor() { return vec4(vec3(${r}), 1.0); } +`;break;case"vec2":o=`vec4 getColor() { return vec4(${r}, 0.0, 1.0); } +`;break;case"vec3":o=`vec4 getColor() { return vec4(${r}, 1.0); } +`;break;case"vec4":o=`vec4 getColor() { return ${r}; } +`;break}let s=`in vec3 position3DHigh; +in vec3 position3DLow; +in float batchId; +${n?"":`in ${i} ${t}; +`}out ${i} ${r}; +void main() +{ +vec4 p = czm_translateRelativeToEye(position3DHigh, position3DLow); +${n?`${r} = czm_batchTable_${t}(batchId); +`:`${r} = ${t}; +`}gl_Position = czm_modelViewProjectionRelativeToEye * p; +}`,a=`in ${i} ${r}; +${o} +void main() +{ +out_FragColor = getColor(); +}`;this.material=void 0,this.translucent=e.translucent??!1,this._vertexShaderSource=e.vertexShaderSource??s,this._fragmentShaderSource=e.fragmentShaderSource??a,this._renderState=wr.getDefaultRenderState(!1,!1,e.renderState),this._closed=e.closed??!1,this._attributeName=t,this._glslDatatype=i}Object.defineProperties(J4.prototype,{vertexShaderSource:{get:function(){return this._vertexShaderSource}},fragmentShaderSource:{get:function(){return this._fragmentShaderSource}},renderState:{get:function(){return this._renderState}},closed:{get:function(){return this._closed}},attributeName:{get:function(){return this._attributeName}},glslDatatype:{get:function(){return this._glslDatatype}}});J4.prototype.getFragmentShaderSource=wr.prototype.getFragmentShaderSource;J4.prototype.isTranslucent=wr.prototype.isTranslucent;J4.prototype.getRenderState=wr.prototype.getRenderState;var vce=J4;function VW(e){e=e??H.EMPTY_OBJECT,this.length=e.length??1e7,this._length=void 0,this.width=e.width??2,this._width=void 0,this.show=e.show??!0,this.modelMatrix=N.clone(e.modelMatrix??N.IDENTITY),this._modelMatrix=new N,this.id=e.id,this._id=void 0,this._primitive=void 0}VW.prototype.update=function(e){if(this.show){if(!l(this._primitive)||!N.equals(this._modelMatrix,this.modelMatrix)||this._length!==this.length||this._width!==this.width||this._id!==this.id){this._modelMatrix=N.clone(this.modelMatrix,this._modelMatrix),this._length=this.length,this._width=this.width,this._id=this.id,l(this._primitive)&&this._primitive.destroy(),this.modelMatrix[12]===0&&this.modelMatrix[13]===0&&this.modelMatrix[14]===0&&(this.modelMatrix[14]=.01);let t=new Ft({geometry:new N_({positions:[h.ZERO,h.UNIT_X],width:this.width,vertexFormat:Vs.VERTEX_FORMAT,colors:[z.RED,z.RED],arcType:ln.NONE}),modelMatrix:N.multiplyByUniformScale(this.modelMatrix,this.length,new N),id:this.id,pickPrimitive:this}),n=new Ft({geometry:new N_({positions:[h.ZERO,h.UNIT_Y],width:this.width,vertexFormat:Vs.VERTEX_FORMAT,colors:[z.GREEN,z.GREEN],arcType:ln.NONE}),modelMatrix:N.multiplyByUniformScale(this.modelMatrix,this.length,new N),id:this.id,pickPrimitive:this}),i=new Ft({geometry:new N_({positions:[h.ZERO,h.UNIT_Z],width:this.width,vertexFormat:Vs.VERTEX_FORMAT,colors:[z.BLUE,z.BLUE],arcType:ln.NONE}),modelMatrix:N.multiplyByUniformScale(this.modelMatrix,this.length,new N),id:this.id,pickPrimitive:this});this._primitive=new On({geometryInstances:[t,n,i],appearance:new Vs,asynchronous:!1})}this._primitive.update(e)}};VW.prototype.isDestroyed=function(){return!1};VW.prototype.destroy=function(){return this._primitive=this._primitive&&this._primitive.destroy(),le(this)};var Z4=VW;var aHt=new TextDecoder,jW={UNKNOWN:0,POINT:1,LINESTRING:2,POLYGON:3},cHt={LAYERS:3},Q4={NAME:1,FEATURES:2,KEYS:3,VALUES:4,EXTENT:5},Sce={TAGS:2,TYPE:3,GEOMETRY:4},WC={STRING:1,FLOAT:2,DOUBLE:3,INT64:4,UINT64:5,SINT64:6,BOOL:7},lHt=["Unknown","Point","LineString","Polygon"];function uHt(e){let t=new Uint8Array(e),n=[],i=0;for(;i<t.length;){let r=HW(t,i,t.length),o=r.fieldNumber,s=r.wireType;if(i=r.newPos,o===cHt.LAYERS&&s===2){let a=Ay(t,i,t.length);i=a.newPos;let c=gf(i,a.value,t.length,"layer");n.push(fHt(t,i,c)),i=c}else i=GW(t,i,s,t.length)}return{layers:n}}function fHt(e,t,n){let i=t,r="",o=4096,s=[],a=[],c=[];for(;i<n;){let f=HW(e,i,n),d=f.fieldNumber,p=f.wireType;if(i=f.newPos,d===Q4.NAME&&p===2){let g=Ay(e,i,n);i=g.newPos;let m=gf(i,g.value,n,"layer name");r=Ice(e,i,g.value),i=m}else if(d===Q4.FEATURES&&p===2){let g=Ay(e,i,n);i=g.newPos;let m=gf(i,g.value,n,"feature");c.push({start:i,end:m}),i=m}else if(d===Q4.KEYS&&p===2){let g=Ay(e,i,n);i=g.newPos;let m=gf(i,g.value,n,"key");s.push(Ice(e,i,g.value)),i=m}else if(d===Q4.VALUES&&p===2){let g=Ay(e,i,n);i=g.newPos;let m=gf(i,g.value,n,"value"),y=mHt(e,i,m);a.push(y),i=m}else if(d===Q4.EXTENT&&p===0){let g=GP(e,i,n);o=g.value,i=g.newPos}else i=GW(e,i,p,n)}let u=c.map(({start:f,end:d})=>dHt(e,f,d,s,a));return{name:r,extent:o,features:u}}function dHt(e,t,n,i,r){let o=t,s=jW.UNKNOWN,a=[],c=[];for(;o<n;){let d=HW(e,o,n),p=d.fieldNumber,g=d.wireType;if(o=d.newPos,p===Sce.TYPE&&g===0){let m=GP(e,o,n);s=m.value,o=m.newPos}else if(p===Sce.TAGS&&g===2){let m=Ay(e,o,n);o=m.newPos;let y=gf(o,m.value,n,"feature tags");for(;o<y;){let A=GP(e,o,y);a.push(A.value),o=A.newPos}}else if(p===Sce.GEOMETRY&&g===2){let m=Ay(e,o,n);o=m.newPos;let y=gf(o,m.value,n,"feature geometry");for(;o<y;){let A=GP(e,o,y);c.push(A.value),o=A.newPos}}else o=GW(e,o,g,n)}let u={};for(let d=0;d<a.length-1;d+=2){let p=i[a[d]],g=r[a[d+1]];typeof p!="string"||g===void 0||(u[p]=g)}let f=hHt(s,c);return{type:lHt[s]??"Unknown",geometry:f,properties:u}}function hHt(e,t){let n=0,i=0,r=0;if(e===jW.POINT){let o=[];for(;n<t.length;){let s=t[n++],a=s&7,c=s>>3;if(a===1)for(let u=0;u<c;u++)i+=K0(t[n++]),r+=K0(t[n++]),o.push({x:i,y:r})}return o}if(e===jW.LINESTRING){let o=[],s=null;for(;n<t.length;){let a=t[n++],c=a&7,u=a>>3;if(c===1)s!==null&&o.push(s),s=[],i+=K0(t[n++]),r+=K0(t[n++]),s.push({x:i,y:r});else if(c===2)for(let f=0;f<u;f++)i+=K0(t[n++]),r+=K0(t[n++]),s.push({x:i,y:r})}return s!==null&&o.push(s),o}if(e===jW.POLYGON){let o=[],s=null;for(;n<t.length;){let a=t[n++],c=a&7,u=a>>3;if(c===1)s!==null&&o.push(s),s=[],i+=K0(t[n++]),r+=K0(t[n++]),s.push({x:i,y:r});else if(c===2)for(let f=0;f<u;f++)i+=K0(t[n++]),r+=K0(t[n++]),s.push({x:i,y:r});else c===7&&s!==null&&s.length>0&&(s.push({x:s[0].x,y:s[0].y}),o.push(s),s=null)}return s!==null&&o.push(s),o}return[]}function mHt(e,t,n){let i=t;for(;i<n;){let r=HW(e,i,n),o=r.fieldNumber,s=r.wireType;if(i=r.newPos,o===WC.STRING&&s===2){let a=Ay(e,i,n);i=a.newPos;let c=gf(i,a.value,n,"string value");return Ice(e,i,c-i)}else{if(o===WC.FLOAT&&s===5)return gf(i,4,n,"float value"),new DataView(e.buffer,e.byteOffset+i,4).getFloat32(0,!0);if(o===WC.DOUBLE&&s===1)return gf(i,8,n,"double value"),new DataView(e.buffer,e.byteOffset+i,8).getFloat64(0,!0);if(o===WC.INT64&&s===0){let a=WP(e,i,n);return wce(a.value)}else if(o===WC.UINT64&&s===0){let a=WP(e,i,n);return wce(a.value)}else if(o===WC.SINT64&&s===0){let a=WP(e,i,n);return wce(pHt(a.value))}else if(o===WC.BOOL&&s===0)return GP(e,i,n).value!==0}i=GW(e,i,s,n)}}function HW(e,t,n){let i=GP(e,t,n);return{fieldNumber:i.value>>>3,wireType:i.value&7,newPos:i.newPos}}function GP(e,t,n){let i=WP(e,t,n,5);if(i.value>0xffffffffn)throw new oe("Invalid MVT uint32 varint.");return{value:Number(i.value),newPos:i.newPos}}function Ay(e,t,n){let i=WP(e,t,n);if(i.value>BigInt(Number.MAX_SAFE_INTEGER))throw new oe("Invalid MVT length varint.");return{value:Number(i.value),newPos:i.newPos}}function WP(e,t,n,i){let r=0n,o=0n,s=0,a=i??10;for(;;){if(t>=n||t>=e.length)throw new oe("Invalid MVT: truncated varint.");let c=e[t++];if(r|=BigInt(c&127)<<o,s++,(c&128)===0)break;if(s>=a)throw new oe("Invalid MVT: varint is too long.");o+=7n}return{value:r,newPos:t}}function Ice(e,t,n){let i=gf(t,n,e.length,"string");return aHt.decode(e.subarray(t,i))}function gf(e,t,n,i){if(!Number.isFinite(t)||t<0)throw new oe(`Invalid MVT ${i}: invalid length.`);let r=e+t;if(!Number.isFinite(r)||r<e||r>n)throw new oe(`Invalid MVT ${i}: length exceeds available bytes.`);return r}function GW(e,t,n,i){if(n===0)return WP(e,t,i).newPos;if(n===1)return gf(t,8,i,"fixed64 field");if(n===2){let r=Ay(e,t,i);return gf(r.newPos,r.value,i,"length-delimited field")}else if(n===5)return gf(t,4,i,"fixed32 field");throw new oe(`Unsupported protobuf wire type: ${n}`)}function K0(e){return e>>>1^-(e&1)}function pHt(e){return e>>1n^-(e&1n)}function wce(e){return e<=BigInt(Number.MAX_SAFE_INTEGER)&&e>=BigInt(Number.MIN_SAFE_INTEGER)?Number(e):e}var e8=uHt;function gHt(e){this.direction=h.clone(e.direction),this.color=z.clone(e.color??z.WHITE),this.intensity=e.intensity??1}var Pce=gHt;function qC(e){e=e??H.EMPTY_OBJECT;let t=e.translucent??!0,n=e.aboveGround??!1;this.material=l(e.material)?e.material:er.fromType(er.ColorType),this.translucent=e.translucent??!0,this._vertexShaderSource=e.vertexShaderSource??R4,this._fragmentShaderSource=e.fragmentShaderSource??D4,this._renderState=wr.getDefaultRenderState(t,!n,e.renderState),this._closed=!1,this._flat=e.flat??!1,this._faceForward=e.faceForward??n,this._aboveGround=n}Object.defineProperties(qC.prototype,{vertexShaderSource:{get:function(){return this._vertexShaderSource}},fragmentShaderSource:{get:function(){return this._fragmentShaderSource}},renderState:{get:function(){return this._renderState}},closed:{get:function(){return this._closed}},vertexFormat:{get:function(){return qC.VERTEX_FORMAT}},flat:{get:function(){return this._flat}},faceForward:{get:function(){return this._faceForward}},aboveGround:{get:function(){return this._aboveGround}}});qC.VERTEX_FORMAT=Be.POSITION_AND_ST;qC.prototype.getFragmentShaderSource=wr.prototype.getFragmentShaderSource;qC.prototype.isTranslucent=wr.prototype.isTranslucent;qC.prototype.getRenderState=wr.prototype.getRenderState;var Dce=qC;var _Ht=1e5;function t8(e){e=e??H.EMPTY_OBJECT;let t=e.credit;typeof t=="string"&&(t=new It(t)),this._credit=t,this._radius=l(e.radius)?e.radius:_Ht,this._image=e.image,this._transform=l(e.transform)?e.transform:N.IDENTITY,this._repeatHorizontal=l(e.repeatHorizontal)?e.repeatHorizontal:1,this._repeatVertical=l(e.repeatVertical)?e.repeatVertical:1;let n=new H4({radius:this._radius,vertexFormat:Be.ALL}),i=new Ft({geometry:n,modelMatrix:this._transform}),r=new er({fabric:{type:"Image",uniforms:{image:this._image,repeat:new U(-this._repeatHorizontal,this._repeatVertical)}}});return this._primitive=new On({geometryInstances:i,appearance:new Er({material:r,closed:!0,faceForward:!1,flat:!0,translucent:!1,renderState:{cull:{enabled:!1}}}),credit:this._credit}),this}Object.defineProperties(t8.prototype,{radius:{get:function(){return this._radius}},image:{get:function(){return this._image}},transform:{get:function(){return this._transform}},credit:{get:function(){return l(this._credit)?this._credit:void 0}},show:{get:function(){return l(this._primitive)?this._primitive.show:void 0},set:function(e){l(this._primitive)&&(this._primitive.show=e)}}});t8.prototype.update=function(e){return l(this._credit)&&e.creditDisplay.addCreditToNextFrame(this._credit),this._primitive.update(e)};t8.prototype.destroy=function(){return this._primitive=this._primitive&&this._primitive.destroy(),le(this)};t8.prototype.isDestroyed=function(){return this._primitive.isDestroyed()};var Rce=t8;function _f(e){this._scene=e.scene,this.samplingWindow=e.samplingWindow??_f.defaultSettings.samplingWindow,this.quietPeriod=e.quietPeriod??_f.defaultSettings.quietPeriod,this.warmupPeriod=e.warmupPeriod??_f.defaultSettings.warmupPeriod,this.minimumFrameRateDuringWarmup=e.minimumFrameRateDuringWarmup??_f.defaultSettings.minimumFrameRateDuringWarmup,this.minimumFrameRateAfterWarmup=e.minimumFrameRateAfterWarmup??_f.defaultSettings.minimumFrameRateAfterWarmup,this._lowFrameRate=new be,this._nominalFrameRate=new be,this._frameTimes=[],this._needsQuietPeriod=!0,this._quietPeriodEndTime=0,this._warmupPeriodEndTime=0,this._frameRateIsLow=!1,this._lastFramesPerSecond=void 0,this._pauseCount=0;let t=this;this._preUpdateRemoveListener=this._scene.preUpdate.addEventListener(function(r,o){yHt(t,o)}),this._hiddenPropertyName=document.hidden!==void 0?"hidden":document.mozHidden!==void 0?"mozHidden":document.msHidden!==void 0?"msHidden":document.webkitHidden!==void 0?"webkitHidden":void 0;let n=document.hidden!==void 0?"visibilitychange":document.mozHidden!==void 0?"mozvisibilitychange":document.msHidden!==void 0?"msvisibilitychange":document.webkitHidden!==void 0?"webkitvisibilitychange":void 0;function i(){AHt(t)}this._visibilityChangeRemoveListener=void 0,l(n)&&(document.addEventListener(n,i,!1),this._visibilityChangeRemoveListener=function(){document.removeEventListener(n,i,!1)})}_f.defaultSettings={samplingWindow:5,quietPeriod:2,warmupPeriod:5,minimumFrameRateDuringWarmup:4,minimumFrameRateAfterWarmup:8};_f.fromScene=function(e){return(!l(e._frameRateMonitor)||e._frameRateMonitor.isDestroyed())&&(e._frameRateMonitor=new _f({scene:e})),e._frameRateMonitor};Object.defineProperties(_f.prototype,{scene:{get:function(){return this._scene}},lowFrameRate:{get:function(){return this._lowFrameRate}},nominalFrameRate:{get:function(){return this._nominalFrameRate}},lastFramesPerSecond:{get:function(){return this._lastFramesPerSecond}}});_f.prototype.pause=function(){++this._pauseCount,this._pauseCount===1&&(this._frameTimes.length=0,this._lastFramesPerSecond=void 0)};_f.prototype.unpause=function(){--this._pauseCount,this._pauseCount<=0&&(this._pauseCount=0,this._needsQuietPeriod=!0)};_f.prototype.isDestroyed=function(){return!1};_f.prototype.destroy=function(){return this._preUpdateRemoveListener(),l(this._visibilityChangeRemoveListener)&&this._visibilityChangeRemoveListener(),le(this)};function yHt(e,t){if(e._pauseCount>0)return;let n=xn();if(e._needsQuietPeriod)e._needsQuietPeriod=!1,e._frameTimes.length=0,e._quietPeriodEndTime=n+e.quietPeriod/kn.SECONDS_PER_MILLISECOND,e._warmupPeriodEndTime=e._quietPeriodEndTime+(e.warmupPeriod+e.samplingWindow)/kn.SECONDS_PER_MILLISECOND;else if(n>=e._quietPeriodEndTime){e._frameTimes.push(n);let i=n-e.samplingWindow/kn.SECONDS_PER_MILLISECOND;if(e._frameTimes.length>=2&&e._frameTimes[0]<=i){for(;e._frameTimes.length>=2&&e._frameTimes[1]<i;)e._frameTimes.shift();let r=(n-e._frameTimes[0])/(e._frameTimes.length-1);e._lastFramesPerSecond=1e3/r;let o=1e3/(n>e._warmupPeriodEndTime?e.minimumFrameRateAfterWarmup:e.minimumFrameRateDuringWarmup);r>o?e._frameRateIsLow||(e._frameRateIsLow=!0,e._needsQuietPeriod=!0,e.lowFrameRate.raiseEvent(e.scene,e._lastFramesPerSecond)):e._frameRateIsLow&&(e._frameRateIsLow=!1,e._needsQuietPeriod=!0,e.nominalFrameRate.raiseEvent(e.scene,e._lastFramesPerSecond))}}}function AHt(e){document[e._hiddenPropertyName]?e.pause():e.unpause()}var n8=_f;var Mce=class e{constructor(t){t=t??H.EMPTY_OBJECT;let n=bHt(t.geoJson),i=t.allowPicking??!0,r=t.ellipsoid??ee.default,o=new Float64Array(0);function s(g){return o.length<g&&(o=new Float64Array(g)),o}this.show=t.show??!0,this._url=t.url,this._ids=n.ids,this._properties=n.properties,this._featureCount=n.ids.length,this._pickObjectFactory=t.pickObjectFactory,this._points=void 0,this._polylines=void 0,this._polygons=void 0,this._heightReference=t.heightReference??We.NONE,this._scene=t.scene;let a=this._heightReference,c=this._scene;n.pointCount>0&&(this._points=new ef({primitiveCountMax:n.pointCount,allowPicking:i})),n.polylineCount>0&&(this._polylines=new _l({primitiveCountMax:n.polylineCount,vertexCountMax:n.polylineVertexCount,allowPicking:i,heightReference:a})),n.polygonCount>0&&(this._polygons=new ja({primitiveCountMax:n.polygonCount,vertexCountMax:n.polygonVertexCount,holeCountMax:n.polygonHoleCount,triangleCountMax:n.polygonTriangleCount,allowPicking:i,heightReference:a}));let u=new h,f=0,d=0,p=0;for(let g=0;g<n.features.length;g++){let m=n.features[g],y=m.featureId,A=this._properties[y];for(let b=0;b<m.points.length;b++){let x=f++;this._points.add({featureId:y,position:pke(m.points[b],r,u),pickObject:i?Oce(this,x,this._points,kc,A):void 0})}for(let b=0;b<m.polylines.length;b++){let x=d++;this._polylines.add({featureId:y,positions:uke(m.polylines[b],r,s),pickObject:i?Oce(this,x,this._polylines,xa,A):void 0})}for(let b=0;b<m.polygons.length;b++){let x=m.polygons[b],T=p++;this._polygons.add({featureId:y,positions:uke(x.positions,r,s),holes:x.holes,triangles:x.triangles,pickObject:i?Oce(this,T,this._polygons,Mo,A):void 0})}}}get url(){let t=this._url;if(l(t))return t instanceof De?t.getUrlComponent(!0):t}get featureCount(){return this._featureCount}get ids(){return this._ids}get properties(){return this._properties}get points(){return this._points}get polylines(){return this._polylines}get polygons(){return this._polygons}static async fromUrl(t,n){let i=De.createIfNeeded(t),r=await i.fetchJson();if(!l(r))throw new oe(`Failed to load GeoJSON from ${i.getUrlComponent(!0)}.`);return e.fromGeoJson(r,{...n,url:i})}static fromGeoJson(t,n){return new e({...n,geoJson:t})}getId(t){return this._ids[t]}getProperties(t){return this._properties[t]}update(t){if(!this.show)return;let n=this._points,i=this._polylines,r=this._polygons,o=t.frameNumber,s=this._heightReference,a=bs(s)?this._scene.vectorProvider:null;l(n)&&n.update(t),l(i)&&(l(a)?a.markForFrame(i,o,s):i.update(t)),l(r)&&(l(a)?a.markForFrame(r,o,s):r.update(t))}destroy(){let t=bs(this._heightReference)?this._scene.vectorProvider:null;return this._points&&(this._points.destroy(),this._points=void 0),this._polylines&&(l(t)&&t.remove(this._polylines),this._polylines.destroy(),this._polylines=void 0),this._polygons&&(l(t)&&t.remove(this._polygons),this._polygons.destroy(),this._polygons=void 0),le(this)}isDestroyed(){return!1}};function Oce(e,t,n,i,r){return l(e._pickObjectFactory)?e._pickObjectFactory(t,n,r):{index:t,collection:n,get primitive(){return n.get(t,new i)},parentPrimitive:e,properties:r}}function bHt(e){let t=xHt(e),n=[],i=[],r=[],o=0,s=0,a=0,c=0,u=0,f=0,d=0;for(let p=0;p<t.length;p++){let g=t[p],m={points:[],polylines:[],polygons:[]};if(fke(g.geometry,m),m.points.length===0&&m.polylines.length===0&&m.polygons.length===0)continue;let y=i.length;i.push(g.id),r.push(OHt(g.properties)?g.properties:H.EMPTY_OBJECT);for(let A=0;A<m.polygons.length;A++){let b=m.polygons[A];f+=b.holes.length,d+=b.triangles.length/3,u+=b.positions.length}for(let A=0;A<m.polylines.length;A++)a+=m.polylines[A].length;o+=m.points.length,s+=m.polylines.length,c+=m.polygons.length,n.push({featureId:y,points:m.points,polylines:m.polylines,polygons:m.polygons})}return{features:n,ids:i,properties:r,pointCount:o,polylineCount:s,polylineVertexCount:a,polygonCount:c,polygonVertexCount:u,polygonHoleCount:f,polygonTriangleCount:d}}function xHt(e){if(!l(e)||!l(e.type))throw new oe("GeoJSON object must define 'type'.");switch(e.type){case"FeatureCollection":return e.features;case"Feature":return[e];default:if(DHt(e.type))return[{type:"Feature",geometry:e,properties:H.EMPTY_OBJECT,id:void 0}];throw new oe(`Unsupported GeoJSON type: ${e.type}`)}}function fke(e,t){if(!(!l(e)||!l(e.type)))switch(e.type){case"Point":dke(e.coordinates,t.points);return;case"MultiPoint":EHt(e.coordinates,t.points);return;case"LineString":hke(e.coordinates,t.polylines);return;case"MultiLineString":CHt(e.coordinates,t.polylines);return;case"Polygon":mke(e.coordinates,t.polygons);return;case"MultiPolygon":vHt(e.coordinates,t.polygons);return;case"GeometryCollection":THt(e.geometries,t);return;default:return}}function THt(e,t){if(Array.isArray(e))for(let n=0;n<e.length;n++)fke(e[n],t)}function dke(e,t){let n=Nce(e);l(n)&&t.push(n)}function EHt(e,t){for(let n=0;n<e.length;n++)dke(e[n],t)}function hke(e,t){let n=SHt(e);l(n)&&n.length>=2&&t.push(n)}function CHt(e,t){for(let n=0;n<e.length;n++)hke(e[n],t)}function mke(e,t){let n=wHt(e);l(n)&&t.push(n)}function vHt(e,t){for(let n=0;n<e.length;n++)mke(e[n],t)}function SHt(e){if(!Array.isArray(e))return;let t=[];for(let n=0;n<e.length;n++){let i=Nce(e[n]);l(i)&&t.push(i)}return t.length>=2?t:void 0}function wHt(e){if(!Array.isArray(e)||e.length===0)return;let t=[];for(let a=0;a<e.length;a++){let c=IHt(e[a]);l(c)&&t.push(c)}if(t.length===0||t[0].length<3)return;let i=[],r=[],o=[];for(let a=0;a<t.length;a++){let c=t[a];if(!(c.length<3)){a>0&&o.push(r.length);for(let u=0;u<c.length;u++){let f=c[u];r.push(f),i.push(new U(f[0],f[1]))}}}if(r.length<3)return;let s=fi.triangulate(i,o);if(!(!l(s)||s.length<3))return{positions:r,holes:new Uint32Array(o),triangles:new Uint32Array(s)}}function IHt(e){if(!Array.isArray(e))return;let t=[];for(let n=0;n<e.length;n++){let i=Nce(e[n]);l(i)&&t.push(i)}if(!(t.length<3))return t.length>1&&PHt(t[0],t[t.length-1])&&t.pop(),t.length>=3?t:void 0}function Nce(e){if(!Array.isArray(e)||e.length<2)return;let t=e[0],n=e[1],i=e[2]??0;if(!(!Number.isFinite(t)||!Number.isFinite(n)||!Number.isFinite(i)))return[t,n,i]}function PHt(e,t){return e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]}function DHt(e){return e==="Point"||e==="MultiPoint"||e==="LineString"||e==="MultiLineString"||e==="Polygon"||e==="MultiPolygon"||e==="GeometryCollection"}function pke(e,t,n){return h.fromDegrees(e[0],e[1],e[2]??0,t,n)}var RHt=new h;function uke(e,t,n){let i=e.length*3,r=n(i);for(let o=0;o<e.length;o++){let s=pke(e[o],t,RHt);r[o*3]=s.x,r[o*3+1]=s.y,r[o*3+2]=s.z}return r.subarray(0,i)}function OHt(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}var Lce=Mce;var gke=Qo(wae(),1);function Fce(){this._image=new Image}Fce.prototype.isReady=function(){return!0};Fce.prototype.shouldDiscardImage=function(e){return e===this._image};function YC(e){e=e??H.EMPTY_OBJECT,this._defaultAlpha=void 0,this._defaultNightAlpha=void 0,this._defaultDayAlpha=void 0,this._defaultBrightness=void 0,this._defaultContrast=void 0,this._defaultHue=void 0,this._defaultSaturation=void 0,this._defaultGamma=void 0,this._defaultMinificationFilter=void 0,this._defaultMagnificationFilter=void 0,this._tileDiscardPolicy=e.tileDiscardPolicy,this._tilingScheme=new Qi({numberOfLevelZeroTilesX:2,numberOfLevelZeroTilesY:2,rectangle:new ie(-D.PI,-D.PI,D.PI,D.PI),ellipsoid:e.ellipsoid});let t=e.credit;typeof t=="string"&&(t=new It(t)),this._credit=t,this._tileWidth=256,this._tileHeight=256,this._maximumLevel=23,l(this._tileDiscardPolicy)||(this._tileDiscardPolicy=new Fce),this._errorEvent=new be}Object.defineProperties(YC.prototype,{url:{get:function(){return this._metadata.url}},proxy:{get:function(){return this._metadata.proxy}},tileWidth:{get:function(){return this._tileWidth}},tileHeight:{get:function(){return this._tileHeight}},maximumLevel:{get:function(){return this._maximumLevel}},minimumLevel:{get:function(){return 0}},tilingScheme:{get:function(){return this._tilingScheme}},rectangle:{get:function(){return this._tilingScheme.rectangle}},tileDiscardPolicy:{get:function(){return this._tileDiscardPolicy}},errorEvent:{get:function(){return this._errorEvent}},credit:{get:function(){return this._credit}},hasAlphaChannel:{get:function(){return!1}}});YC.fromMetadata=function(e,t){if(!e.imageryPresent)throw new oe(`The server ${e.url} doesn't have imagery`);let n=new YC(t);return n._metadata=e,n};YC.prototype.getTileCredits=function(e,t,n){let i=this._metadata,r=i.getTileInformation(e,t,n);if(l(r)){let o=i.providers[r.imageryProvider];if(l(o))return[o]}};YC.prototype.requestImage=function(e,t,n,i){let r=this._tileDiscardPolicy._image,o=this._metadata,s=_y.tileXYToQuadKey(e,t,n),a=o.getTileInformation(e,t,n);if(!l(a)){if(o.isValid(s)){let u=new wo({throttle:i.throttle,throttleByServer:i.throttleByServer,type:i.type,priorityFunction:i.priorityFunction});o.populateSubtree(e,t,n,u);return}return Promise.resolve(r)}if(!a.hasImagery())return Promise.resolve(r);let c=MHt(this,a,e,t,n,i).fetchArrayBuffer();if(l(c))return c.then(function(u){B4(o.key,u);let f=new Uint8Array(u),d,p=o.protoImagery;if((!l(p)||!p)&&(d=NHt(f)),!l(d)&&(!l(p)||p)){let g=LHt(f);d=g.imageType,f=g.imageData}return!l(d)||!l(f)?r:$g({uint8Array:f,format:d,flipY:!0})})};YC.prototype.pickFeatures=function(e,t,n,i,r){};function MHt(e,t,n,i,r,o){let s=_y.tileXYToQuadKey(n,i,r),a=t.imageryVersion;return a=l(a)&&a>0?a:1,e._metadata.resource.getDerivedResource({url:`flatfile?f1-0${s}-i.${a.toString()}`,request:o})}function NHt(e){let t="JFIF";if(e[6]===t.charCodeAt(0)&&e[7]===t.charCodeAt(1)&&e[8]===t.charCodeAt(2)&&e[9]===t.charCodeAt(3))return"image/jpeg";let n="PNG";if(e[1]===n.charCodeAt(0)&&e[2]===n.charCodeAt(1)&&e[3]===n.charCodeAt(2))return"image/png"}function LHt(e){let t=gke.Reader.create(e),n=t.len,i={};for(;t.pos<n;){let s=t.uint32(),a;switch(s>>>3){case 1:i.imageType=t.uint32();break;case 2:i.imageData=t.bytes();break;case 3:i.alphaType=t.uint32();break;case 4:i.imageAlpha=t.bytes();break;case 5:if(a=i.copyrightIds,l(a)||(a=i.copyrightIds=[]),(s&7)===2){let c=t.uint32()+t.pos;for(;t.pos<c;)a.push(t.uint32())}else a.push(t.uint32());break;default:t.skipType(s&7);break}}let r=i.imageType;if(l(r))switch(r){case 0:i.imageType="image/jpeg";break;case 4:i.imageType="image/png";break;default:throw new oe("GoogleEarthEnterpriseImageryProvider: Unsupported image type.")}let o=i.alphaType;return l(o)&&o!==0&&(console.log("GoogleEarthEnterpriseImageryProvider: External alpha not supported."),delete i.alphaType,delete i.imageAlpha),i}var Bce=YC;var FHt=600;function $0(e){e=e??H.EMPTY_OBJECT,this._key=l(e.key)?e.key:va.defaultApiKey,this._baseResource=De.createIfNeeded(e.url??va.streetViewStaticApiEndpoint),this._metadataResource=this._baseResource.getDerivedResource({url:"streetview/metadata"}),this._tileSize=e.tileSize??FHt}Object.defineProperties($0.prototype,{});$0.prototype.loadPanorama=async function(e){let t=e.cartographic,n=e.tileSize??this._tileSize,i=`${n}x${n}`,r=e.signature,{panoId:o}=e;l(o)||(o=(await this.getNearestPanoId(t)).panoId);let s=va.getDefaultCredit(),a=h.fromDegrees(D.toDegrees(t.longitude),D.toDegrees(t.latitude),0),c=[this._loadFaceImage({heading:0,pitch:0,tileSizeString:i,panoId:o,signature:r}),this._loadFaceImage({heading:180,pitch:0,tileSizeString:i,panoId:o,signature:r}),this._loadFaceImage({heading:-90,pitch:-90,tileSizeString:i,panoId:o,signature:r}),this._loadFaceImage({heading:-90,pitch:90,tileSizeString:i,panoId:o,signature:r}),this._loadFaceImage({heading:270,pitch:0,tileSizeString:i,panoId:o,signature:r}),this._loadFaceImage({heading:90,pitch:0,tileSizeString:i,panoId:o,signature:r})],[u,f,d,p,g,m]=await Promise.all(c),y=At.localFrameToFixedFrameGenerator("north","down"),A=N.getMatrix3(y(a,ee.default),new $);return new QE({sources:{positiveX:u,negativeX:f,positiveY:d,negativeY:p,positiveZ:g,negativeZ:m},transform:A,credit:s})};$0.prototype.getNearestPanoId=async function(e,t){let i=[D.toDegrees(e.latitude),D.toDegrees(e.longitude)].join(","),o=await this._metadataResource.getDerivedResource({queryParameters:{key:this._key,location:i,radius:t??50}}).fetchJson();if(o.status!=="OK")throw new pe(`GoogleStreetViewCubeMapPanoramaProvider metadata error: ${o.status}`);return{panoId:o.pano_id,latitude:o.location.lat,longitude:o.location.lng}};$0.prototype.getPanoIdMetadata=async function(e){let n=await this._metadataResource.getDerivedResource({queryParameters:{key:this._key,pano:e}}).fetchJson();if(n.status!=="OK")throw new pe(`GoogleStreetViewCubeMapPanoramaProvider metadata error: ${n.status}`);return n};$0.prototype._loadFaceImage=async function(e){let t=this._buildFaceUrl(e);try{return await De.fetchImage({url:t,preferImageBitmap:!0,flipY:!0})}catch{throw new pe(`Failed to load Street View face image: ${t}`)}};$0.prototype._buildFaceUrl=function(e){let{heading:t,pitch:n,tileSizeString:i,panoId:r,signature:o}=e;return this._baseResource.getDerivedResource({queryParameters:{size:i,pano:r,heading:t,pitch:n,key:this._key,...l(o)&&{signature:o}}}).url};$0.fromUrl=async function(e){if(e=e??{},e.key=e.key??va.defaultStreetViewStaticApiKey??va.defaultApiKey,!l(e.key)&&!l(va.defaultStreetViewStaticApiKey)&&!l(va.defaultApiKey))throw new pe("options.key, GoogleMaps.defaultStreetViewStaticApiKey or GoogleMaps.defaultApiKey is required.");return new $0({...e})};$0._parseMetadata=function(e){return{cartographic:he.fromDegrees(e.location.lng,e.location.lat,0)}};var kce=$0;var BHt=new z(1,1,1,.4),kHt=new z(0,1,0,.05),UHt=new z(0,.5,0,.2);function XC(e){e=e??H.EMPTY_OBJECT,this._defaultAlpha=void 0,this._defaultNightAlpha=void 0,this._defaultDayAlpha=void 0,this._defaultBrightness=void 0,this._defaultContrast=void 0,this._defaultHue=void 0,this._defaultSaturation=void 0,this._defaultGamma=void 0,this._defaultMinificationFilter=void 0,this._defaultMagnificationFilter=void 0,this._tilingScheme=l(e.tilingScheme)?e.tilingScheme:new Qi({ellipsoid:e.ellipsoid}),this._cells=e.cells??8,this._color=e.color??BHt,this._glowColor=e.glowColor??kHt,this._glowWidth=e.glowWidth??6,this._backgroundColor=e.backgroundColor??UHt,this._errorEvent=new be,this._tileWidth=e.tileWidth??256,this._tileHeight=e.tileHeight??256,this._canvasSize=e.canvasSize??256,this._canvas=this._createGridCanvas()}Object.defineProperties(XC.prototype,{proxy:{get:function(){}},tileWidth:{get:function(){return this._tileWidth}},tileHeight:{get:function(){return this._tileHeight}},maximumLevel:{get:function(){}},minimumLevel:{get:function(){}},tilingScheme:{get:function(){return this._tilingScheme}},rectangle:{get:function(){return this._tilingScheme.rectangle}},tileDiscardPolicy:{get:function(){}},errorEvent:{get:function(){return this._errorEvent}},credit:{get:function(){}},hasAlphaChannel:{get:function(){return!0}}});XC.prototype._drawGrid=function(e){let n=this._canvasSize;for(let i=0;i<=this._cells;++i){let o=1+i/this._cells*(n-1);e.moveTo(o,0),e.lineTo(o,n),e.moveTo(0,o),e.lineTo(n,o)}e.stroke()};XC.prototype._createGridCanvas=function(){let e=document.createElement("canvas");e.width=this._canvasSize,e.height=this._canvasSize;let t=0,n=this._canvasSize,i=e.getContext("2d"),r=this._backgroundColor.toCssColorString();i.fillStyle=r,i.fillRect(t,t,n,n);let o=this._glowColor.toCssColorString();i.strokeStyle=o,i.lineWidth=this._glowWidth,i.strokeRect(t,t,n,n),this._drawGrid(i),i.lineWidth=this._glowWidth*.5,i.strokeRect(t,t,n,n),this._drawGrid(i);let s=this._color.toCssColorString();return i.strokeStyle=s,i.lineWidth=2,i.strokeRect(t,t,n,n),i.lineWidth=1,this._drawGrid(i),e};XC.prototype.getTileCredits=function(e,t,n){};XC.prototype.requestImage=function(e,t,n,i){return Promise.resolve(this._canvas)};XC.prototype.pickFeatures=function(e,t,n,i,r){};var Uce=XC;function pp(){}pp._maxDecodingConcurrency=Math.max(dn.hardwareConcurrency-1,1);pp._decodeTaskProcessor=new $n("decodeI3S",pp._maxDecodingConcurrency);pp._promise=void 0;async function zHt(){if(await pp._decodeTaskProcessor.initWebAssemblyModule({wasmBinaryFile:"ThirdParty/draco_decoder.wasm"}))return pp._decodeTaskProcessor;throw new oe("I3S decoder could not be initialized.")}pp.decode=async function(e,t,n,i,r){return l(pp._promise)||(pp._promise=zHt()),pp._promise.then(function(o){let s=n._parent._data,a=n._parent._inverseRotationMatrix,c=0,u=0,f=0;l(s.obb)?(c=s.obb.center[0],u=s.obb.center[1],f=s.obb.center[2]):l(s.mbs)&&(c=s.mbs[0],u=s.mbs[1],f=s.mbs[2]);let d=$.fromRotationX(-D.PI_OVER_TWO),p=new $;$.multiply(d,a,p);let g=he.fromDegrees(c,u,f),m=ee.WGS84.cartographicToCartesian(g),y={binaryData:n._data,featureData:l(i)&&l(i[0])?i[0].data:void 0,schema:t,bufferInfo:n._geometryBufferInfo,ellipsoidRadiiSquare:ee.WGS84.radiiSquared,url:e,geoidDataList:n._dataProvider._geoidDataList,cartographicCenter:g,cartesianCenter:m,parentRotation:p,enableFeatures:n._dataProvider.showFeatures,splitGeometryByColorTransparency:n._dataProvider.adjustMaterialAlphaMode,symbologyData:r,calculateNormals:n._dataProvider.calculateNormals};return o.scheduleTask(y)})};var i8=pp;function zce(e,t){this._parent=e,this._dataProvider=e._dataProvider,this._layer=e._layer,l(this._parent._nodeIndex)?this._resource=this._parent._layer.resource.getDerivedResource({url:`nodes/${this._parent._data.mesh.attribute.resource}/${t}`}):this._resource=this._parent.resource.getDerivedResource({url:t})}Object.defineProperties(zce.prototype,{resource:{get:function(){return this._resource}},data:{get:function(){return this._data}}});zce.prototype.load=async function(){return this._data=await gp.loadJson(this._resource),this._data};var r8=zce;function by(e,t){this._storageInfo=t,this._parent=e,this._dataProvider=e._dataProvider,this._loadPromise=void 0;let n=`attributes/${t.key}/0`;l(this._parent._nodeIndex)?this._resource=this._parent._layer.resource.getDerivedResource({url:`nodes/${this._parent._data.mesh.attribute.resource}/${n}`}):this._resource=this._parent.resource.getDerivedResource({url:n})}Object.defineProperties(by.prototype,{resource:{get:function(){return this._resource}},header:{get:function(){return this._header}},values:{get:function(){if(l(this._values)){if(l(this._values.attributeValues))return this._values.attributeValues;if(l(this._values.objectIds))return this._values.objectIds}return[]}},name:{get:function(){return this._storageInfo.name}}});function WW(e){return e==="UInt8"||e==="Int8"?1:e==="UInt16"||e==="Int16"?2:e==="UInt32"||e==="Int32"||e==="Oid32"||e==="Float32"?4:e==="UInt64"||e==="Int64"||e==="Float64"?8:0}function VHt(e){return e==="String"?1:WW(e)}async function jHt(e){let t=await e._dataProvider._loadBinary(e._resource),n=new DataView(t);e._data=t,e._validateHeader(n);let i=e._parseHeader(n),r=e._getBodyOffset(i);e._validateBody(n,r),e._parseBody(n,r)}by.prototype.load=function(){return l(this._loadPromise)?this._loadPromise:(this._loadPromise=jHt(this).catch(function(e){console.error(e)}),this._loadPromise)};by.prototype._parseValue=function(e,t,n){let i;if(t==="UInt8")i=e.getUint8(n),n+=1;else if(t==="Int8")i=e.getInt8(n),n+=1;else if(t==="UInt16")i=e.getUint16(n,!0),n+=2;else if(t==="Int16")i=e.getInt16(n,!0),n+=2;else if(t==="UInt32")i=e.getUint32(n,!0),n+=4;else if(t==="Oid32")i=e.getUint32(n,!0),n+=4;else if(t==="Int32")i=e.getInt32(n,!0),n+=4;else if(t==="UInt64"){let r=e.getUint32(n,!0),o=e.getUint32(n+4,!0);i=r+Math.pow(2,32)*o,n+=8}else if(t==="Int64"){let r=e.getUint32(n,!0),o=e.getUint32(n+4,!0);o<Math.pow(2,31)?i=r+Math.pow(2,32)*o:i=r+Math.pow(2,32)*(o-Math.pow(2,32)),n+=8}else t==="Float32"?(i=e.getFloat32(n,!0),n+=4):t==="Float64"?(i=e.getFloat64(n,!0),n+=8):t==="String"&&(i=String.fromCharCode(e.getUint8(n)),n+=1);return{value:i,offset:n}};by.prototype._parseHeader=function(e){let t=0;this._header={};for(let n=0;n<this._storageInfo.header.length;n++){let i=this._storageInfo.header[n],r=this._parseValue(e,i.valueType,t);this._header[i.property]=r.value,t=r.offset}return t};by.prototype._parseBody=function(e,t){this._values={};for(let n=0;n<this._storageInfo.ordering.length;n++){let i=this._storageInfo.ordering[n],r=i==="ObjectIds"?"objectIds":i,o=this._storageInfo[r];if(l(o)){this._values[r]=[];for(let s=0;s<this._header.count;++s)if(o.valueType!=="String"){let a=this._parseValue(e,o.valueType,t);this._values[r].push(a.value),t=a.offset}else{let a=this._values.attributeByteCounts[s],c="";for(let u=0;u<a;++u){let f=this._parseValue(e,o.valueType,t);f.value.charCodeAt(0)!==0&&(c+=f.value),t=f.offset}this._values[r].push(c)}}}};by.prototype._getBodyOffset=function(e){let t=0;return l(this._storageInfo.attributeValues)?t=WW(this._storageInfo.attributeValues.valueType):l(this._storageInfo.objectIds)&&(t=WW(this._storageInfo.objectIds.valueType)),t>0?Math.ceil(e/t)*t:e};by.prototype._validateHeader=function(e){let t=0;for(let n=0;n<this._storageInfo.header.length;n++){let i=this._storageInfo.header[n];t+=VHt(i.valueType)}if(e.byteLength<t)throw new oe(`Invalid attribute buffer size (field: ${this.name}, header: ${t}, actual: ${e.byteLength})`)};by.prototype._validateBody=function(e,t){if(!l(this._header.count))throw new oe(`Invalid attribute buffer (field: ${this.name}, count is missing)`);let n;for(let i=0;i<this._storageInfo.ordering.length&&t<e.byteLength;i++){let r=this._storageInfo.ordering[i],o=r==="ObjectIds"?"objectIds":r,s=this._storageInfo[o];if(l(s))if(s.valueType!=="String"){o==="attributeByteCounts"&&(n=t);let a=WW(s.valueType);t+=a*this._header.count}else{if(!l(n))throw new oe(`Invalid attribute buffer (field: ${this.name}, attributeByteCounts is missing)`);for(let a=0;a<this._header.count&&t<e.byteLength;++a){let c=this._parseValue(e,this._storageInfo.attributeByteCounts.valueType,n);t+=c.value,n=c.offset}}else throw new oe(`Invalid attribute buffer (field: ${this.name}, ${o} is missing)`)}if(e.byteLength<t)throw new oe(`Invalid attribute buffer size (field: ${this.name}, expected: ${t}, actual: ${e.byteLength})`)};var o8=by;function s8(e,t){let n=e._dataProvider,i=e._layer,r;l(e._nodeIndex)?r=i.resource.getDerivedResource({url:`nodes/${e._data.mesh.geometry.resource}/${t}`}):r=e.resource.getDerivedResource({url:t}),this._parent=e,this._dataProvider=n,this._layer=i,this._resource=r,this._customAttributes=void 0}Object.defineProperties(s8.prototype,{resource:{get:function(){return this._resource}},data:{get:function(){return this._data}},customAttributes:{get:function(){return this._customAttributes}}});s8.prototype.load=function(){let e=this;return this._dataProvider._loadBinary(this._resource).then(function(t){return e._data=t,t})};var HHt=new h,GHt=new h,WHt=new h,qHt=new h,YHt=new h;function Vce(e,t,n,i){let r=h.subtract(i,n,HHt),o=h.cross(r,h.subtract(e,n,GHt),qHt),s=h.cross(r,h.subtract(t,n,WHt),YHt);return h.dot(o,s)>=0}var XHt=new h,KHt=new h,$Ht=new h,JHt=new h,ZHt=new h,QHt=new h,eGt=new h,tGt=new h,nGt=new h,iGt=new h;s8.prototype.getClosestPointIndexOnTriangle=function(e,t,n){if(l(this._customAttributes)&&l(this._customAttributes.positions)){let i=new h(e,t,n);i.x-=this._customAttributes.cartesianCenter.x,i.y-=this._customAttributes.cartesianCenter.y,i.z-=this._customAttributes.cartesianCenter.z,$.multiplyByVector(this._customAttributes.parentRotation,i,i);let r=Number.MAX_VALUE,o,s,a,c,u=this._customAttributes.positions,f=this._customAttributes.indices,d;l(f)?d=f.length:d=u.length/3;for(let p=0;p<d;p++){let g,m,y;l(f)?(g=f[p],m=f[p+1],y=f[p+2]):(g=p*3,m=p*3+1,y=p*3+2);let A=h.fromElements(u[g*3],u[g*3+1],u[g*3+2],XHt),b=h.fromElements(u[m*3],u[m*3+1],u[m*3+2],KHt),x=new h(u[y*3],u[y*3+1],u[y*3+2],$Ht);if(!Vce(i,A,b,x)||!Vce(i,b,A,x)||!Vce(i,x,A,b))continue;let T=h.subtract(b,A,JHt),E=h.subtract(x,A,ZHt),v=h.cross(T,E,QHt);if(h.magnitude(v)===0)continue;let S=h.normalize(v,eGt),I=h.subtract(i,A,tGt),R=Math.abs(h.dot(I,S));if(R<r){r=R,o=p;let O=h.magnitudeSquared(h.subtract(i,A,I)),L=h.magnitudeSquared(h.subtract(i,b,nGt)),_=h.magnitudeSquared(h.subtract(i,x,iGt));O<L&&O<_?(a=g,c=A,s=O):L<_?(a=m,c=b,s=L):(a=y,c=x,s=_)}}if(l(o))return{index:a,distanceSquared:s,distance:Math.sqrt(s),queriedPosition:i,closestPosition:h.clone(c)}}return{index:-1,distanceSquared:Number.Infinity,distance:Number.Infinity}};function _ke(e){let t=[],n=e.length;for(let i=0;i<n;i++)i<3?t.push(jC(e[i])):t.push(e[i]);return t}s8.prototype._generateGltf=function(e,t,n,i,r,o,s,a){let c={pbrMetallicRoughness:{metallicFactor:0},doubleSided:!0,name:"Material"},u=!1,f,d="";if(l(this._parent._data.mesh)&&l(this._layer._data.materialDefinitions)){let T=this._parent._data.mesh.material.definition;if(T>=0&&T<this._layer._data.materialDefinitions.length){if(f=this._layer._data.materialDefinitions[T],c=f,l(c.pbrMetallicRoughness)&&l(c.pbrMetallicRoughness.baseColorTexture)){u=!0,c.pbrMetallicRoughness.baseColorTexture.index=0;let E="0";if(l(this._layer._data.textureSetDefinitions))for(let v=0;v<this._layer._data.textureSetDefinitions.length;v++){let S=this._layer._data.textureSetDefinitions[v];for(let I=0;I<S.formats.length;I++){let R=S.formats[I];if(R.format==="jpg"){E=R.name;break}}}l(this._parent._data.mesh)&&this._parent._data.mesh.material.resource>=0&&(d=this._layer.resource.getDerivedResource({url:`nodes/${this._parent._data.mesh.material.resource}/textures/${E}`}).url)}l(c.pbrMetallicRoughness)&&l(c.pbrMetallicRoughness.baseColorFactor)&&(c.pbrMetallicRoughness.baseColorFactor=_ke(c.pbrMetallicRoughness.baseColorFactor)),l(c.emissiveFactor)&&(c.emissiveFactor=_ke(c.emissiveFactor))}}else l(this._parent._data.textureData)&&(u=!0,d=this._parent.resource.getDerivedResource({url:`${this._parent._data.textureData[0].href}`}).url,c.pbrMetallicRoughness.baseColorTexture={index:0});l(c.alphaMode)&&(c.alphaMode=c.alphaMode.toUpperCase());let p=[],g=[],m=[];u&&(p=[{sampler:0,source:0}],g=[{uri:d}],m=[{magFilter:9729,minFilter:9986,wrapS:10497,wrapT:10497}]);let y=[],A=n.length;for(let x=0;x<A;x++){let T=n[x].primitives,E=T.length;for(let v=0;v<E;v++){let S=T[v];if(l(S.material)){for(;S.material>=y.length;){let R=Je(c,!0);y.push(R)}let I=y[S.material];l(S.extra)&&S.extra.isTransparent?l(I.alphaMode)||(I.alphaMode="BLEND"):I.alphaMode==="BLEND"&&(I.alphaMode="OPAQUE")}}}return{scene:0,scenes:[{nodes:e}],nodes:t,meshes:n,buffers:i,bufferViews:r,accessors:o,materials:y,textures:p,images:g,samplers:m,asset:{version:"2.0"},extensions:s,extensionsUsed:a}};var qP=s8;function Dl(e,t,n){let i,r,o,s;n?(i=0,r=e):(i=e._level+1,r=e._layer),typeof t=="number"?o=t:s=e.resource.getDerivedResource({url:`${t}/`}),this._parent=e,this._dataProvider=e._dataProvider,this._isRoot=n,this._level=i,this._layer=r,this._nodeIndex=o,this._resource=s,this._isLoading=!1,this._tile=void 0,this._data=void 0,this._geometryData=[],this._featureData=[],this._fields={},this._children=[],this._childrenReadyPromise=void 0,this._globalTransform=void 0,this._inverseGlobalTransform=void 0,this._inverseRotationMatrix=void 0,this._symbologyData=void 0}Object.defineProperties(Dl.prototype,{resource:{get:function(){return this._resource}},layer:{get:function(){return this._layer}},parent:{get:function(){return this._parent}},children:{get:function(){return this._children}},geometryData:{get:function(){return this._geometryData}},featureData:{get:function(){return this._featureData}},fields:{get:function(){return this._fields}},tile:{get:function(){return this._tile}},data:{get:function(){return this._data}}});Dl.prototype.load=async function(){let e=this;function t(){if(!e._isRoot){let r=e._create3DTileDefinition();e._tile=new fh(e._layer._tileset,e._dataProvider.resource,r,e._parent._tile),e._tile._i3sNode=e}}if(!l(this._nodeIndex)){let r=await gp.loadJson(this._resource);e._data=r,t();return}let n=await this._layer._getNodeInNodePages(this._nodeIndex);e._data=n;let i;e._isRoot?i="nodes/root/":l(n.mesh)&&(i=`../${n.mesh.geometry.resource}/`),l(i)&&l(e._parent.resource)&&(e._resource=e._parent.resource.getDerivedResource({url:i})),t()};function yke(e,t){let n=new o8(e,t);return e._fields[t.name]=n,n.load()}Dl.prototype.loadFields=function(){let e=this._layer._data.attributeStorageInfo,t=[];if(l(e))for(let n=0;n<e.length;n++){let i=e[n],r=this._fields[i.name];l(r)?t.push(r.load()):t.push(yke(this,i))}return Promise.all(t)};Dl.prototype.loadField=function(e){let t=this._fields[e];if(l(t))return t.load();let n=this._layer._data.attributeStorageInfo;if(l(n))for(let i=0;i<n.length;i++){let r=n[i];if(r.name===e)return yke(this,r)}return Promise.resolve()};Dl.prototype.getFieldsForPickedPosition=function(e){let t=this.geometryData[0];if(!l(t.customAttributes.featureIndex))return{};let n=t.getClosestPointIndexOnTriangle(e.x,e.y,e.z);if(n.index===-1||n.index>t.customAttributes.featureIndex.length)return{};let i=t.customAttributes.featureIndex[n.index];return this.getFieldsForFeature(i)};Dl.prototype.getFieldsForFeature=function(e){let t={};for(let n in this.fields)if(this.fields.hasOwnProperty(n)){let i=this.fields[n];e>=0&&e<i.values.length&&(t[i.name]=i.values[e])}return t};Dl.prototype._loadChildren=function(){let e=this;if(l(this._childrenReadyPromise))return this._childrenReadyPromise;let t=[];if(l(e._data.children))for(let n=0;n<e._data.children.length;n++){let i=e._data.children[n],r=new Dl(e,i.href??i,!1);e._children.push(r),t.push(r.load())}return this._childrenReadyPromise=Promise.all(t).then(function(){for(let n=0;n<e._children.length;n++)e._tile.children.push(e._children[n]._tile)}),this._childrenReadyPromise};Dl.prototype._loadGeometryData=function(){let e=[];if(l(this._data.geometryData))for(let t=0;t<this._data.geometryData.length;t++){let n=new qP(this,this._data.geometryData[t].href);this._geometryData.push(n),e.push(n.load())}else if(l(this._data.mesh)){let t=this._layer._findBestGeometryBuffers(this._data.mesh.geometry.definition,["position","uv0"]),n=`./geometries/${t.bufferIndex}/`,i=new qP(this,n);i._geometryDefinitions=t.definition,i._geometryBufferInfo=t.geometryBufferInfo,this._geometryData.push(i),e.push(i.load())}return Promise.all(e)};Dl.prototype._loadFeatureData=function(){let e=[];if(l(this._data.featureData))for(let t=0;t<this._data.featureData.length;t++){let n=new r8(this,this._data.featureData[t].href);this._featureData.push(n),e.push(n.load())}return Promise.all(e)};Dl.prototype._clearGeometryData=function(){this._geometryData=[]};Dl.prototype._create3DTileDefinition=function(){let e=this._data.obb,t=this._data.mbs;if(!l(e)&&!l(t)){console.error("Failed to load I3S node. Bounding volume is required.");return}let n;if(l(e)?n=he.fromDegrees(e.center[0],e.center[1],e.center[2]):n=he.fromDegrees(t[0],t[1],t[2]),l(this._dataProvider._geoidDataList)&&l(n))for(let b=0;b<this._dataProvider._geoidDataList.length;b++){let x=this._dataProvider._geoidDataList[b],T=x.projection.project(n);if(T.x>x.nativeExtent.west&&T.x<x.nativeExtent.east&&T.y>x.nativeExtent.south&&T.y<x.nativeExtent.north){n.height+=aGt(T.x,T.y,x);break}}let i,r,o;l(e)?(i={box:[0,0,0,e.halfSize[0],0,0,0,e.halfSize[1],0,0,0,e.halfSize[2]]},o=Math.max(Math.max(this._data.obb.halfSize[0],this._data.obb.halfSize[1]),this._data.obb.halfSize[2]),r=ee.WGS84.cartographicToCartesian(n)):(i={sphere:[0,0,0,t[3]]},r=ee.WGS84.cartographicToCartesian(n),o=this._data.mbs[3]),o*=2;let s=1/0;if(l(this._data.lodThreshold))if(this._layer._data.nodePages.lodSelectionMetricType==="maxScreenThresholdSQ"){let b=Math.sqrt(this._data.lodThreshold/(Math.PI*.25));s=o/b}else if(this._layer._data.nodePages.lodSelectionMetricType==="maxScreenThreshold"){let b=this._data.lodThreshold;s=o/b}else console.error("Invalid lodSelectionMetricType in Layer");else if(l(this._data.lodSelection))for(let b=0;b<this._data.lodSelection.length;b++)this._data.lodSelection[b].metricType==="maxScreenThreshold"&&(s=o/this._data.lodSelection[b].maxError);s===1/0&&(s=1e5);let a=s*16,c=new wc(0,0,0),u=At.headingPitchRollQuaternion(r,c);l(this._data.obb)&&(u=new Le(this._data.obb.quaternion[0],this._data.obb.quaternion[1],this._data.obb.quaternion[2],this._data.obb.quaternion[3]));let f=$.fromQuaternion(u),d=$.inverse(f,new $),p=new N(f[0],f[1],f[2],0,f[3],f[4],f[5],0,f[6],f[7],f[8],0,r.x,r.y,r.z,1),g=N.inverse(p,new N),m=N.clone(p);l(this._parent._globalTransform)&&N.multiply(p,this._parent._inverseGlobalTransform,m),this._globalTransform=p,this._inverseGlobalTransform=g,this._inverseRotationMatrix=d;let y=[];for(let b=0;b<this._children.length;b++)y.push(this._children[b]._create3DTileDefinition());return{children:y,refine:"REPLACE",boundingVolume:i,transform:[m[0],m[4],m[8],m[12],m[1],m[5],m[9],m[13],m[2],m[6],m[10],m[14],m[3],m[7],m[11],m[15]],content:{uri:l(this._resource)?this._resource.url:void 0},geometricError:a}};Dl.prototype._loadSymbology=async function(){!l(this._symbologyData)&&l(this._layer._symbology)&&(this._symbologyData=await this._layer._symbology._getSymbology(this))};Dl.prototype._createContentURL=async function(){let e={scene:0,scenes:[{nodes:[0]}],nodes:[{name:"singleNode"}],meshes:[],buffers:[],bufferViews:[],accessors:[],materials:[],textures:[],images:[],samplers:[],asset:{version:"2.0"}},t=[this._loadGeometryData()];if(this._dataProvider.legacyVersion16&&t.push(this._loadFeatureData()),await Promise.all(t),l(this._geometryData)&&this._geometryData.length>0){this._dataProvider._applySymbology&&await this._loadSymbology();let r=this._geometryData[0].resource.url,o=this._layer._data.store.defaultGeometrySchema,s=this._geometryData[0],a=await i8.decode(r,o,s,this._featureData[0],this._symbologyData);if(!l(a))return;e=s._generateGltf(a.meshData.nodesInScene,a.meshData.nodes,a.meshData.meshes,a.meshData.buffers,a.meshData.bufferViews,a.meshData.accessors,a.meshData.rootExtensions,a.meshData.extensionsUsed),this._geometryData[0]._customAttributes=a.meshData._customAttributes}let n=this._dataProvider._binarizeGltf(e),i=new Blob([n],{type:"application/binary"});return URL.createObjectURL(i)};async function rGt(e){let t=e._layer._filters,n=[];for(let i=0;i<t.length;i++){let r=e.loadField(t[i].name);n.push(r)}return await Promise.all(n),t}function oGt(e,t,n){if(!l(n.values)||n.values.length===0)return!1;let i=l(t)?t.values:[],r;e<i.length&&(r=i[e]);let o=!1;for(let s=0;s<n.values.length;s++)if(n.values[s]===r){o=!0;break}return o}async function Ake(e,t){let n=e._tile.content.batchTable;if(l(n)&&n.featuresLength>0){n.setAllShow(!0);let i=await rGt(e);if(i.length>0)for(let r=0;r<n.featuresLength;r++)for(let o=0;o<i.length;o++){let s=i[o];if(!oGt(r,e._fields[s.name],s)){n.setShow(r,!1);break}}}t.show=!0}Dl.prototype._filterFeatures=function(){let e=[];for(let n=0;n<this._children.length;n++){let i=this._children[n]._filterFeatures();e.push(i)}let t=this._tile?.content?._model;if(l(this._geometryData)&&this._geometryData.length>0&&l(t)&&t.ready){t.show=!1;let n=Ake(this,t);e.push(n)}return Promise.all(e)};fh.prototype._hookedRequestContent=fh.prototype.requestContent;fh.prototype.requestContent=function(){if(!this.tileset._isI3STileSet)return this._hookedRequestContent();if(!this._isLoading){this._isLoading=!0;let e=this;return this._i3sNode._createContentURL().then(t=>{if(!l(t)){e._isLoading=!1;return}return e._contentResource=new De({url:t}),e._hookedRequestContent()}).then(t=>{let n=t?._model;return l(e._i3sNode._geometryData)&&e._i3sNode._geometryData.length>0&&l(n)&&(n.show=!1,n.readyEvent.addEventListener(()=>{Ake(e._i3sNode,n)})),e._isLoading=!1,t})}};function sGt(e,t,n,i,r,o){let s=n*(1-e)+i*e,a=r*(1-e)+o*e;return s*(1-t)+a*t}function qW(e,t,n,i){let r=e+t*n;return i[r]}function aGt(e,t,n){let i=n.nativeExtent,r=(e-i.west)/(i.east-i.west)*(n.width-1),o=(t-i.south)/(i.north-i.south)*(n.height-1),s=Math.floor(r),a=Math.floor(o);r-=s,o-=a;let c=s<n.width?s+1:s,u=a<n.height?a+1:a;a=n.height-1-a,u=n.height-1-u;let f=qW(s,a,n.width,n.buffer),d=qW(c,a,n.width,n.buffer),p=qW(s,u,n.width,n.buffer),g=qW(c,u,n.width,n.buffer),m=sGt(r,o,f,d,p,g);return m=m*n.scale+n.offset,m}Object.defineProperties(fh.prototype,{i3sNode:{get:function(){return this._i3sNode}}});var YP=Dl;function YW(e){this._layer=e,this._defaultSymbology=void 0,this._valueFields=[],this._uniqueValueHash=void 0,this._classBreaksHash=void 0,this._parseLayerSymbology()}Object.defineProperties(YW.prototype,{defaultSymbology:{get:function(){return this._defaultSymbology}}});function jce(e,t){let n=[];for(let i=0;i<e.length;i++){let r=z.byteToFloat(e[i]);i<3?n.push(jC(r)):n.push(r)}return n.length===3&&(l(t)?n.push(1-t/100):n.push(1)),n}function XP(e,t){let n={edges:void 0,material:void 0};if(l(e)&&l(e.symbolLayers))for(let i=0;i<e.symbolLayers.length;i++){let r=e.symbolLayers[i];if(r.type==="Fill"){let o=r.edges,s=r.outline;if(l(o)?(n.edges={},l(o.color)&&(n.edges.color=jce(o.color,o.transparency))):l(s)&&(n.edges={},l(s.color)&&(n.edges.color=jce(s.color,s.transparency))),!t){let a=r.material;l(a)&&(n.material={colorMixMode:a.colorMixMode},l(a.color)&&(n.material.color=jce(a.color,a.transparency)))}break}}return n}function cGt(e,t){if(l(e.uniqueValueGroups)){let n={};for(let i=0;i<e.uniqueValueGroups.length;i++){let r=e.uniqueValueGroups[i].classes;if(l(r))for(let o=0;o<r.length;o++){let s=XP(r[o].symbol,t),a=r[o].values;for(let c=0;c<a.length;c++){let u=a[c],f=n;for(let d=0;d<u.length;d++){let p=u[d];d===u.length-1?f[p]=s:(l(f[p])||(f[p]={}),f=f[p])}}}}return n}if(l(e.uniqueValueInfos)){let n={};for(let i=0;i<e.uniqueValueInfos.length;i++){let r=e.uniqueValueInfos[i];n[r.value]=XP(r.symbol,t)}return n}}function lGt(e,t){if(l(e.classBreakInfos)){let n=[...e.classBreakInfos];n.sort(function(r,o){let s=r.classMaxValue??r.classMinValue,a=o.classMaxValue??o.classMinValue;return s-a});let i={ranges:[],symbols:[]};l(e.minValue)&&(i.ranges.push(e.minValue),i.symbols.push(void 0));for(let r=0;r<n.length;r++){let o=n[r];l(o.classMinValue)&&(i.ranges.length===0||o.classMinValue>i.ranges[i.ranges.length-1])&&(i.ranges.push(o.classMinValue),i.symbols.push(void 0)),l(o.classMaxValue)&&(i.ranges.length===0||o.classMaxValue>i.ranges[i.ranges.length-1])&&(i.ranges.push(o.classMaxValue),i.symbols.push(XP(o.symbol,t)))}return i.symbols.push(void 0),i}}YW.prototype._parseLayerSymbology=function(){let e=this._layer.data.drawingInfo;if(l(e)&&l(e.renderer)){let t=this._layer.data.cachedDrawingInfo,n=l(t)&&t.color===!0,i=e.renderer;i.type==="simple"?this._defaultSymbology=XP(i.symbol,n):i.type==="uniqueValue"?(this._defaultSymbology=XP(i.defaultSymbol,n),this._valueFields.push(i.field1),l(i.field2)&&this._valueFields.push(i.field2),l(i.field3)&&this._valueFields.push(i.field3),this._uniqueValueHash=cGt(i,n)):i.type==="classBreaks"&&(this._defaultSymbology=XP(i.defaultSymbol,n),this._valueFields.push(i.field),this._classBreaksHash=lGt(i,n))}};function bke(e,t,n,i){let r=t[n];if(i<r.length){let o=r[i],s=e[o];return l(s)&&++n<t.length?bke(s,t,n,i):s}}function uGt(e,t){let n=0,i=e.length;if(n<i)do{let r=n+i>>>1;e[r]<t?n=r+1:i=r}while(n<i);return n}function fGt(e,t,n){let i=t[n],r=uGt(e.ranges,i);return e.symbols[r]}YW.prototype._getSymbology=async function(e){let t={default:this._defaultSymbology};if(this._valueFields.length>0){let n=[];for(let o=0;o<this._valueFields.length;o++)n.push(e.loadField(this._valueFields[o]));await Promise.all(n);let i=[];for(let o=0;o<this._valueFields.length;o++)i.push(e.fields[this._valueFields[o]].values);let r;if(l(this._uniqueValueHash)?r=o=>bke(this._uniqueValueHash,i,0,o):l(this._classBreaksHash)&&(r=o=>fGt(this._classBreaksHash,i[0],o)),l(r)){let o=i[0];for(let s=0;s<o.length;s++){let a=r(s);l(a)&&(t[s]=a)}}}return t};var a8=YW;function yf(e,t,n){this._dataProvider=e,this._parent=n,!l(t.href)&&l(t.id)&&(t.href=`layers/${t.id}`);let i=this._parent.resource.getUrlComponent(),r;i.match(/layers\/\d/)?r=`${i}`.replace(/\/+$/,""):r=`${i}`.replace(/\/?$/,"/").concat(`${t.href}`),this._version=t.store.version;let o=this._version.split(".");this._majorVersion=parseInt(o[0]),this._minorVersion=o.length>1?parseInt(o[1]):0,this._resource=new De({url:r}),this._resource.setQueryParameters(this._dataProvider.resource.queryParameters),this._resource.appendForwardSlash(),this._data=t,this._rootNode=void 0,this._nodePages={},this._nodePageFetches={},this._extent=void 0,this._tileset=void 0,this._geometryDefinitions=void 0,this._filters=[],this._symbology=void 0,this._computeGeometryDefinitions(!0),this._computeExtent()}Object.defineProperties(yf.prototype,{resource:{get:function(){return this._resource}},rootNode:{get:function(){return this._rootNode}},tileset:{get:function(){return this._tileset}},data:{get:function(){return this._data}},version:{get:function(){return this._version}},majorVersion:{get:function(){return this._majorVersion}},minorVersion:{get:function(){return this._minorVersion}},legacyVersion16:{get:function(){if(l(this.version))return this.majorVersion<1||this.majorVersion===1&&this.minorVersion<=6}}});yf.prototype.load=async function(e){if(this._data.spatialReference.wkid!==4326)throw new oe(`Unsupported spatial reference: ${this._data.spatialReference.wkid}`);if(this._dataProvider.applySymbology&&(this._symbology=new a8(this)),await this._dataProvider.loadGeoidData(),await this._loadRootNode(e),await this._create3DTileset(e),this._rootNode._tile=this._tileset._root,this._tileset._root._i3sNode=this._rootNode,this.legacyVersion16)return this._rootNode._loadChildren()};yf.prototype._computeGeometryDefinitions=function(e){if(this._geometryDefinitions=[],l(this._data.geometryDefinitions))for(let t=0;t<this._data.geometryDefinitions.length;t++){let n=[],i=this._data.geometryDefinitions[t].geometryBuffers;for(let r=0;r<i.length;r++){let o=i[r],s=[],a=!1;if(l(o.compressedAttributes)&&e){a=!0;let c=o.compressedAttributes.attributes;for(let u=0;u<c.length;u++)s.push(c[u])}else for(let c in o)c!=="offset"&&s.push(c);n.push({compressed:a,attributes:s,index:i.indexOf(o)})}n.sort(function(r,o){return r.compressed&&!o.compressed?-1:!r.compressed&&o.compressed?1:r.attributes.length-o.attributes.length}),this._geometryDefinitions.push(n)}};yf.prototype._findBestGeometryBuffers=function(e,t){let n=this._geometryDefinitions[e];if(l(n)){for(let i=0;i<n.length;++i){let r=n[i],o=!1,s=r.attributes;for(let a=0;a<t.length;a++)if(!s.includes(t[a])){o=!0;break}if(!o)return{bufferIndex:r.index,definition:n,geometryBufferInfo:r}}if(l(n[0]))return{bufferIndex:0,definition:n,geometryBufferInfo:n[0]}}};yf.prototype._loadRootNode=function(e){if(l(this._data.nodePages)){let t=0;l(this._data.nodePages.rootIndex)&&(t=this._data.nodePages.rootIndex),this._rootNode=new YP(this,t,!0)}else this._rootNode=new YP(this,this._data.store.rootNode,!0);return this._rootNode.load(e)};yf.prototype._getNodeInNodePages=function(e){let t=Math.floor(e/this._data.nodePages.nodesPerPage),n=e%this._data.nodePages.nodesPerPage;return this._loadNodePage(t).then(function(i){return i.nodes[n]})};yf._fetchJson=function(e){return e.fetchJson()};yf.prototype._loadNodePage=function(e){let t=this;if(!l(this._nodePageFetches[e])){let n=this.resource.getDerivedResource({url:`nodepages/${e}/`}),i=yf._fetchJson(n).then(function(r){return l(r.error)&&r.error.code!==200?Promise.reject(r.error):(t._nodePages[e]=r.nodes,r)});this._nodePageFetches[e]=i}return this._nodePageFetches[e]};yf.prototype._computeExtent=function(){l(this._data.fullExtent)?this._extent=ie.fromDegrees(this._data.fullExtent.xmin,this._data.fullExtent.ymin,this._data.fullExtent.xmax,this._data.fullExtent.ymax):l(this._data.store.extent)&&(this._extent=ie.fromDegrees(this._data.store.extent[0],this._data.store.extent[1],this._data.store.extent[2],this._data.store.extent[3]))};yf.prototype._create3DTileset=async function(e){let t={asset:{version:"1.0"},geometricError:Number.MAX_VALUE,root:this._rootNode._create3DTileDefinition()},n=new Blob([JSON.stringify(t)],{type:"application/json"}),i=URL.createObjectURL(n),r=this._symbology?.defaultSymbology?.edges?.color;l(r)&&!l(e?.outlineColor)&&(e=l(e)?Je(e):{},e.outlineColor=z.fromCartesian4(se.fromArray(r))),this._tileset=await Xo.fromUrl(i,e),this._tileset.show=this._parent.show,this._tileset._isI3STileSet=!0,this._tileset.tileUnload.addEventListener(function(o){o._i3sNode._clearGeometryData(),URL.revokeObjectURL(o._contentResource._url),o._contentResource=o._i3sNode.resource}),this._tileset.tileVisible.addEventListener(function(o){l(o._i3sNode)&&o._i3sNode._loadChildren()})};yf.prototype._updateVisibility=function(){l(this._tileset)&&(this._tileset.show=this._parent.show)};yf.prototype.filterByAttributes=function(e){this._filters=l(e)?Je(e,!0):[];let t=this._rootNode;return l(t)?t._filterFeatures():Promise.resolve()};var KC=yf;function XW(e,t){this._dataProvider=e,this._resource=new De({url:t}),this._resource.setQueryParameters(e.resource.queryParameters),this._resource.appendForwardSlash()}Object.defineProperties(XW.prototype,{resource:{get:function(){return this._resource}},data:{get:function(){return this._data}},names:{get:function(){let e=[],t=this._data.summary;if(l(t))for(let n=0;n<t.length;++n)e.push(t[n].fieldName);return e}}});XW.prototype.load=async function(){return this._data=await gp.loadJson(this._resource),this._data};XW.prototype._getValues=function(e){let t=this._data.summary;if(l(t))for(let n=0;n<t.length;++n){let i=t[n];if(i.fieldName===e)return l(i.mostFrequentValues)?[...i.mostFrequentValues]:[]}};var c8=XW;function l8(e,t,n){this._dataProvider=e,this._parent=t,this._data=n,this._name=n.name,this._modelName=n.modelName,this._visibility=n.visibility??!0,this._resource=void 0,this._sublayers=[],this._i3sLayers=[]}Object.defineProperties(l8.prototype,{resource:{get:function(){return this._resource}},data:{get:function(){return this._data}},name:{get:function(){return this._name}},modelName:{get:function(){return this._modelName}},sublayers:{get:function(){return this._sublayers}},visibility:{get:function(){return this._visibility},set:function(e){if(this._visibility!==e){this._visibility=e;for(let t=0;t<this._i3sLayers.length;t++)this._i3sLayers[t]._updateVisibility()}}},show:{get:function(){return this._visibility&&this._parent.show}}});l8._fromData=async function(e,t,n,i){let r=new l8(e,i,n);if(r._data.layerType==="group"){let o=r._data.sublayers;if(l(o)){let s=[];for(let c=0;c<o.length;c++){let u=l8._fromData(e,t,o[c],r);s.push(u)}let a=await Promise.all(s);for(let c=0;c<a.length;c++){let u=a[c];r._sublayers.push(u),r._i3sLayers.push(...u._i3sLayers)}}}else if(r._data.layerType==="3DObject"){let o=t.concat(`/sublayers/${r._data.id}`),s=new De({url:o});s.setQueryParameters(e.resource.queryParameters),s.appendForwardSlash(),r._resource=s;let a=await gp.loadJson(r._resource),c=new KC(e,a,r);r._i3sLayers.push(c)}else console.log(`${r._data.layerType} layer ${r._data.name} is skipped as not supported.`);return r};var u8=l8;var Eke=Qo(xke(),1);function fa(e){e=e??H.EMPTY_OBJECT,this._name=e.name,this._show=e.show??!0,this._geoidTiledTerrainProvider=e.geoidTiledTerrainProvider,this._showFeatures=e.showFeatures??!1,this._adjustMaterialAlphaMode=e.adjustMaterialAlphaMode??!1,this._applySymbology=e.applySymbology??!1,this._calculateNormals=e.calculateNormals??!1,this._cesium3dTilesetOptions=e.cesium3dTilesetOptions??H.EMPTY_OBJECT,this._layers=[],this._sublayers=[],this._data=void 0,this._extent=void 0,this._geoidDataPromise=void 0,this._geoidDataList=void 0,this._decoderTaskProcessor=void 0,this._taskProcessorReadyPromise=void 0,this._attributeStatistics=[],this._layersExtent=[]}Object.defineProperties(fa.prototype,{name:{get:function(){return this._name}},show:{get:function(){return this._show},set:function(e){if(this._show!==e){this._show=e;for(let t=0;t<this._layers.length;t++)this._layers[t]._updateVisibility()}}},geoidTiledTerrainProvider:{get:function(){return this._geoidTiledTerrainProvider}},layers:{get:function(){return this._layers}},sublayers:{get:function(){return this._sublayers}},data:{get:function(){return this._data}},extent:{get:function(){return this._extent}},resource:{get:function(){return this._resource}},showFeatures:{get:function(){return this._showFeatures}},adjustMaterialAlphaMode:{get:function(){return this._adjustMaterialAlphaMode}},applySymbology:{get:function(){return this._applySymbology}},calculateNormals:{get:function(){return this._calculateNormals}}});fa.prototype.destroy=function(){for(let e=0;e<this._layers.length;e++)l(this._layers[e]._tileset)&&this._layers[e]._tileset.destroy();return le(this)};fa.prototype.isDestroyed=function(){return!1};fa.prototype.update=function(e){for(let t=0;t<this._layers.length;t++)l(this._layers[t]._tileset)&&this._layers[t]._tileset.update(e)};fa.prototype.prePassesUpdate=function(e){for(let t=0;t<this._layers.length;t++)l(this._layers[t]._tileset)&&this._layers[t]._tileset.prePassesUpdate(e)};fa.prototype.postPassesUpdate=function(e){for(let t=0;t<this._layers.length;t++)l(this._layers[t]._tileset)&&this._layers[t]._tileset.postPassesUpdate(e)};fa.prototype.updateForPass=function(e,t){for(let n=0;n<this._layers.length;n++)l(this._layers[n]._tileset)&&this._layers[n]._tileset.updateForPass(e,t)};function dGt(e,t){let n=e.resource.getUrlComponent(),i;return n.match(/layers\/\d/)?i=`${n}`.replace(/\/+$/,""):i=`${n}`.replace(/\/?$/,"/").concat(`layers/${t}`),i}async function Tke(e,t,n){if(t.layerType==="Building"){l(n.showFeatures)||(e._showFeatures=!0),l(n.adjustMaterialAlphaMode)||(e._adjustMaterialAlphaMode=!0),l(n.applySymbology)||(e._applySymbology=!0),l(n.calculateNormals)||(e._calculateNormals=!0);let i=dGt(e,t.id);if(l(t.sublayers)){let r=[];for(let s=0;s<t.sublayers.length;s++){let a=u8._fromData(e,i,t.sublayers[s],e);r.push(a)}let o=await Promise.all(r);for(let s=0;s<o.length;s++){let a=o[s];e._sublayers.push(a),e._layers.push(...a._i3sLayers)}}if(l(t.statisticsHRef)){let r=i.concat(`/${t.statisticsHRef}`),o=new c8(e,r);await o.load(),e._attributeStatistics.push(o)}if(l(t.fullExtent)){let r=ie.fromDegrees(t.fullExtent.xmin,t.fullExtent.ymin,t.fullExtent.xmax,t.fullExtent.ymax);e._layersExtent.push(r)}}else if(t.layerType==="3DObject"||t.layerType==="IntegratedMesh"){!l(n.calculateNormals)&&!l(t.textureSetDefinitions)&&(e._calculateNormals=!0);let i=new KC(e,t,e);e._layers.push(i),l(i._extent)&&e._layersExtent.push(i._extent)}else console.log(`${t.layerType} layer ${t.name} is skipped as not supported.`)}fa.fromUrl=async function(e,t){t=t??H.EMPTY_OBJECT;let n=De.createIfNeeded(e);n.setQueryParameters({f:"pjson"},!0);let i=await fa.loadJson(n),r=new fa(t);if(r._resource=n,r._data=i,l(i.layers)){let s=[];for(let a=0;a<i.layers.length;a++){let c=Tke(r,i.layers[a],t);s.push(c)}await Promise.all(s)}else await Tke(r,i,t);r._computeExtent();let o=[];for(let s=0;s<r._layers.length;s++)o.push(r._layers[s].load(t.cesium3dTilesetOptions));return await Promise.all(o),r};fa._fetchJson=function(e){return e.fetchJson()};fa.loadJson=async function(e){let t=await fa._fetchJson(e);if(l(t.error)){if(console.error("Failed to fetch I3S ",e.url),l(t.error.message)&&console.error(t.error.message),l(t.error.details))for(let n=0;n<t.error.details.length;n++)console.log(t.error.details[n]);throw new oe(t.error)}return t};fa.prototype._loadBinary=async function(e){let t=await e.fetchArrayBuffer();if(t.byteLength>0&&new Uint8Array(t)[0]===123&&new TextDecoder().decode(t).includes("404"))throw new oe(`Failed to load binary: ${e.url}`);return t};fa.prototype._binarizeGltf=function(e){let n=new TextEncoder().encode(JSON.stringify(e)),i=new Uint8Array(n.byteLength+20),r={magic:new Uint8Array(i.buffer,0,4),version:new Uint32Array(i.buffer,4,1),length:new Uint32Array(i.buffer,8,1),chunkLength:new Uint32Array(i.buffer,12,1),chunkType:new Uint32Array(i.buffer,16,1),chunkData:new Uint8Array(i.buffer,20,n.byteLength)};return r.magic[0]=103,r.magic[1]=108,r.magic[2]=84,r.magic[3]=70,r.version[0]=2,r.length[0]=i.byteLength,r.chunkLength[0]=n.byteLength,r.chunkType[0]=1313821514,r.chunkData.set(n),i};var hGt=new U;function mGt(e,t){let n=e.tilingScheme,i=[],r={},o=e._lodCount,s=he.fromRadians(t.west,t.north),a=he.fromRadians(t.east,t.south),c=n.positionToTileXY(s,o),u=n.positionToTileXY(a,o);for(let d=c.x;d<=u.x;d++)for(let p=c.y;p<=u.y;p++){let g=U.fromElements(d,p,hGt),m=g.toString();if(!r.hasOwnProperty(m)){let y={x:g.x,y:g.y,level:o,tilingScheme:n,terrainProvider:e,positions:[]};r[m]=y,i.push(y)}}let f=[];for(let d=0;d<i.length;++d){let p=i[d],g=p.terrainProvider.requestTileGeometry(p.x,p.y,p.level);f.push(g)}return Promise.all(f).then(function(d){let p=[];for(let g=0;g<d.length;g++){let m={tilingScheme:n,x:i[g].x,y:i[g].y,level:i[g].level},y=d[g],A="Geographic";n._projection instanceof yi&&(A="WebMercator");let b={projectionType:A,projection:n._projection,nativeExtent:n.tileXYToNativeRectangle(m.x,m.y,m.level),height:y._height,width:y._width,scale:y._structure.heightScale,offset:y._structure.heightOffset};if(y._encoding===ph.LERC){let x=Eke.default.decode(y._buffer);b.buffer=x.pixels[0]}else b.buffer=y._buffer;p.push(b)}return p})}async function pGt(e){let t=e._geoidTiledTerrainProvider;if(l(t))try{let n=await mGt(t,e._extent);e._geoidDataList=n}catch{console.log("Error retrieving Geoid Terrain tiles - no geoid conversion will be performed.")}}fa.prototype.loadGeoidData=async function(){return l(this._geoidDataPromise)?this._geoidDataPromise:(this._geoidDataPromise=pGt(this),this._geoidDataPromise)};fa.prototype._computeExtent=function(){let e;for(let t=0;t<this._layersExtent.length;t++){let n=this._layersExtent[t];l(e)?ie.union(e,n,e):e=ie.clone(n)}this._extent=e};fa.prototype.getAttributeNames=function(){let e=[];for(let t=0;t<this._attributeStatistics.length;++t)e.push(...this._attributeStatistics[t].names);return e};fa.prototype.getAttributeValues=function(e){for(let t=0;t<this._attributeStatistics.length;++t){let n=this._attributeStatistics[t]._getValues(e);if(l(n))return n}return[]};fa.prototype.filterByAttributes=function(e){let t=[];for(let n=0;n<this._layers.length;n++){let i=this._layers[n].filterByAttributes(e);t.push(i)}return Promise.all(t)};var gp=fa;var f8={};f8.createTilesetFromIModelId=async function({iModelId:e,changesetId:t,tilesetOptions:n}){let{exports:i}=await ua.getExports(e,t);if(i.length>0&&i.every(c=>c.status===ua.ExportStatus.Invalid))throw new oe(`All exports for this iModel are Invalid: ${e}`);let r=i.find(c=>c.status===ua.ExportStatus.Complete);if(!l(r))return;let o=new URL(r._links.mesh.href);o.pathname=`${o.pathname}/tileset.json`;let s=o.toString(),a=new De({url:s});return Xo.fromUrl(a,n)};f8.createTilesetForRealityDataId=async function({iTwinId:e,realityDataId:t,type:n,rootDocument:i,tilesetOptions:r}){if(!l(n)||!l(i)){let c=await ua.getRealityDataMetadata(e,t);i=c.rootDocument,n=c.type}if(![ua.RealityDataType.Cesium3DTiles,ua.RealityDataType.PNTS,ua.RealityDataType.RealityMesh3DTiles,ua.RealityDataType.Terrain3DTiles,ua.RealityDataType.GaussianSplat3DTiles].includes(n))throw new oe(`Reality data type is not a mesh type: ${n}`);let s=await ua.getRealityDataURL(e,t,i),a={maximumScreenSpaceError:4,...r};return Xo.fromUrl(s,a)};f8.createDataSourceForRealityDataId=async function({iTwinId:e,realityDataId:t,type:n,rootDocument:i}){if(!l(n)||!l(i)){let s=await ua.getRealityDataMetadata(e,t);i=s.rootDocument,n=s.type}if(![ua.RealityDataType.KML,ua.RealityDataType.GeoJSON].includes(n))throw new oe(`Reality data type is not a data source type: ${n}`);let o=await ua.getRealityDataURL(e,t,i);return n===ua.RealityDataType.GeoJSON?Rb.load(o):NC.load(o)};f8.loadGeospatialFeatures=async function({iTwinId:e,collectionId:t,limit:n}){let i=n??1e4,r=`${ua.apiEndpoint}geospatial-features/itwins/${e}/ogc/collections/${t}/items`,o=new De({url:r,headers:{Authorization:ua._getAuthorizationHeader(),Accept:"application/vnd.bentley.itwin-platform.v1+json"},queryParameters:{limit:i,client:"CesiumJS"}});return Rb.load(o)};var Hce=f8;function Cke(){}Object.defineProperties(Cke.prototype,{color:{get:pe.throwInstantiationError},intensity:{get:pe.throwInstantiationError}});var Gce=Cke;var gGt=/\/$/,vke=new It('© <a href="https://www.mapbox.com/about/maps/">Mapbox</a> © <a href="http://www.openstreetmap.org/copyright">OpenStreetMap</a> <strong><a href="https://www.mapbox.com/map-feedback/">Improve this map</a></strong>');function KP(e){e=e??H.EMPTY_OBJECT;let t=e.styleId,n=e.accessToken;this._defaultAlpha=void 0,this._defaultNightAlpha=void 0,this._defaultDayAlpha=void 0,this._defaultBrightness=void 0,this._defaultContrast=void 0,this._defaultHue=void 0,this._defaultSaturation=void 0,this._defaultGamma=void 0,this._defaultMinificationFilter=void 0,this._defaultMagnificationFilter=void 0;let i=De.createIfNeeded(e.url??"https://api.mapbox.com/styles/v1/");this._styleId=t,this._accessToken=n;let r=e.tilesize??512;this._tilesize=r;let o=e.username??"mapbox";this._username=o;let s=l(e.scaleFactor)?"@2x":"",a=i.getUrlComponent();gGt.test(a)||(a+="/"),a+=`${this._username}/${t}/tiles/${this._tilesize}/{z}/{x}/{y}${s}`,i.url=a,i.setQueryParameters({access_token:n});let c;l(e.credit)?(c=e.credit,typeof c=="string"&&(c=new It(c))):c=vke,this._resource=i,this._imageryProvider=new ws({url:i,credit:c,ellipsoid:e.ellipsoid,minimumLevel:e.minimumLevel,maximumLevel:e.maximumLevel,rectangle:e.rectangle})}Object.defineProperties(KP.prototype,{url:{get:function(){return this._imageryProvider.url}},rectangle:{get:function(){return this._imageryProvider.rectangle}},tileWidth:{get:function(){return this._imageryProvider.tileWidth}},tileHeight:{get:function(){return this._imageryProvider.tileHeight}},maximumLevel:{get:function(){return this._imageryProvider.maximumLevel}},minimumLevel:{get:function(){return this._imageryProvider.minimumLevel}},tilingScheme:{get:function(){return this._imageryProvider.tilingScheme}},tileDiscardPolicy:{get:function(){return this._imageryProvider.tileDiscardPolicy}},errorEvent:{get:function(){return this._imageryProvider.errorEvent}},credit:{get:function(){return this._imageryProvider.credit}},proxy:{get:function(){return this._imageryProvider.proxy}},hasAlphaChannel:{get:function(){return this._imageryProvider.hasAlphaChannel}}});KP.prototype.getTileCredits=function(e,t,n){};KP.prototype.requestImage=function(e,t,n,i){return this._imageryProvider.requestImage(e,t,n,i)};KP.prototype.pickFeatures=function(e,t,n,i,r){return this._imageryProvider.pickFeatures(e,t,n,i,r)};KP._defaultCredit=vke;var Wce=KP;var _Gt=0,yGt=14,AGt=-1e3,bGt=1e4,xGt=2*Math.PI*ee.WGS84.maximumRadius,TGt=256,EGt=new ie,CGt=new ie,qce=class{constructor(t,n){n=n??{},this._resource=De.createIfNeeded(t),this._urlTemplate=this._resource.url,this._extent=ie.clone(n.extent),this._minZoom=n.minZoom??_Gt,this._maxZoom=n.maxZoom??yGt,this._featureIdProperty=n.featureIdProperty,this._heightReference=n.heightReference,this._scene=n.scene,this._show=!0,this._tileset=void 0,this._tilesetJsonUrl=void 0}static async fromUrl(t,n){let i=new this(t,n);return await i._initializeTileset(),i}get urlTemplate(){return this._urlTemplate}get resource(){return this._resource}get extent(){return this._extent}get tileset(){return this._tileset}get show(){return this._show}set show(t){this._show=t,l(this._tileset)&&(this._tileset.show=t)}_createRuntimeTilesetOptions(){return{minZoom:this._minZoom,maxZoom:this._maxZoom,extent:this._extent}}_createTilesetLoadOptions(){return{heightReference:this._heightReference,scene:this._scene}}_configureTileset(t){}_createCodec(){}async _initializeTileset(){let t=vGt(this._resource,this._createRuntimeTilesetOptions()),n=new Blob([JSON.stringify(t)],{type:"application/json"}),i=URL.createObjectURL(n);this._tilesetJsonUrl=i;try{this._tileset=await Xo.fromUrl(i,this._createTilesetLoadOptions())}catch(r){throw URL.revokeObjectURL(i),this._tilesetJsonUrl=void 0,r}URL.revokeObjectURL(i),this._tilesetJsonUrl=void 0,this._configureTileset(this._tileset),this._tileset._runtimeContentCodec=this._createCodec(),this._tileset.show=this._show}update(t){l(this._tileset)&&this._tileset.update(t)}prePassesUpdate(t){l(this._tileset)&&this._tileset.prePassesUpdate(t)}postPassesUpdate(t){l(this._tileset)&&this._tileset.postPassesUpdate(t)}updateForPass(t,n){l(this._tileset)&&this._tileset.updateForPass(t,n)}isDestroyed(){return!1}destroy(){return l(this._tileset)&&(this._tileset.destroy(),this._tileset=void 0),l(this._tilesetJsonUrl)&&(URL.revokeObjectURL(this._tilesetJsonUrl),this._tilesetJsonUrl=void 0),this._resource=void 0,this._extent=void 0,this._featureIdProperty=void 0,le(this)}};function vGt(e,t){let n=new Fo,i=l(t.extent)?ie.clone(t.extent):ie.clone(n.rectangle),r=wGt(n,i,t.minZoom),o={boundingVolume:{region:Ike(i)},geometricError:wke(0),refine:"REPLACE",children:[]};for(let s=r.minY;s<=r.maxY;s++)for(let a=r.minX;a<=r.maxX;a++){let c=Ske(n,e,i,t.minZoom,t.maxZoom,a,s);l(c)&&o.children.push(c)}return o.children.length===0&&(o.geometricError=0),{asset:{version:"1.1"},geometricError:o.geometricError,root:o}}function Ske(e,t,n,i,r,o,s){if(!IGt(e,i,o,s,n,EGt,CGt))return;let a=e.tileXYToRectangle(o,s,i,new ie),c={boundingVolume:{region:Ike(a)},geometricError:i<r?wke(i):0,refine:"REPLACE",content:{uri:SGt(t,i,o,s)}};if(i>=r)return c;let u=i+1,f=[];for(let d=s*2;d<=s*2+1;d++)for(let p=o*2;p<=o*2+1;p++){let g=Ske(e,t,n,u,r,p,d);l(g)&&f.push(g)}return f.length>0?c.children=f:c.geometricError=0,c}function SGt(e,t,n,i){let o=e.url.replace(/\{z\}/gi,`${t}`).replace(/\{x\}/gi,`${n}`).replace(/\{y\}/gi,`${i}`);return Cd(o)}function wke(e){return xGt/((1<<e)*TGt)}function Ike(e){return[e.west,e.south,e.east,e.north,AGt,bGt]}function wGt(e,t,n){let i=(1<<n)-1,r=he.fromRadians(t.west,t.north),o=he.fromRadians(t.east,t.south),s=e.positionToTileXY(r,n),a=e.positionToTileXY(o,n);return!l(s)||!l(a)||t.west>t.east?{minX:0,maxX:i,minY:0,maxY:i}:{minX:D.clamp(Math.min(s.x,a.x),0,i),maxX:D.clamp(Math.max(s.x,a.x),0,i),minY:D.clamp(Math.min(s.y,a.y),0,i),maxY:D.clamp(Math.max(s.y,a.y),0,i)}}function IGt(e,t,n,i,r,o,s){let a=e.tileXYToRectangle(n,i,t,o);return l(ie.intersection(a,r,s))}var d8=qce;var $W=class extends d8{static async fromUrl(t,n){return super.fromUrl(t,n)}_createTilesetLoadOptions(){return{...super._createTilesetLoadOptions(),skipLevelOfDetail:!1,enablePick:!0,featureIdLabel:"featureId_0",instanceFeatureIdLabel:"instanceFeatureId_0"}}_configureTileset(t){t._modelUpAxis=Hi.Z,t._modelForwardAxis=Hi.X}_createCodec(){let t=this._featureIdProperty;return{contentType:"mvt",missingTilePolicy:{statusCodes:[404,204]},createContent:async(n,i,r,o)=>{let s=e8(o),a=Pke(r.getUrlComponent(!0)),c=W4(s,a,{featureIdProperty:t});if(!l(c)){if(!PGt(s))return new l0(n,i);throw new oe("Decoded MVT tile did not produce vector glTF content.")}return HA.fromGltf(n,i,r,c)}}}};function Pke(e){let t=e.match(/\/(\d+)\/(\d+)\/(\d+)(?:\.[^/?#]+)?(?:[?#]|$)/i);return t?{tileZ:parseInt(t[1],10),tileX:parseInt(t[2],10),tileY:parseInt(t[3],10)}:(_t("MVTDataProvider.parseTileCoordinates",`MVT tile URL did not match /{z}/{x}/{y} pattern. Falling back to z/x/y = 0/0/0. URL: ${e}`),{tileZ:0,tileX:0,tileY:0})}function PGt(e){let t=e.layers;for(let n=0;n<t.length;n++)if(t[n].features.length>0)return!0;return!1}$W._parseTileCoordinates=Pke;var Yce=$W;function Xce(e){}Xce.prototype.isReady=function(){return!0};Xce.prototype.shouldDiscardImage=function(e){return!1};var Kce=Xce;var DGt=new It("MapQuest, Open Street Map and contributors, CC-BY-SA");function JW(e){e=e??H.EMPTY_OBJECT;let t=De.createIfNeeded(e.url??"https://tile.openstreetmap.org/");t.appendForwardSlash(),t.url+=`{z}/{x}/{y}${e.retinaTiles?"@2x":""}.${e.fileExtension??"png"}`;let n=new Fo({ellipsoid:e.ellipsoid}),i=256,r=256,o=e.minimumLevel??0,s=e.maximumLevel,a=e.rectangle??n.rectangle,c=n.positionToTileXY(ie.southwest(a),o),u=n.positionToTileXY(ie.northeast(a),o),f=(Math.abs(u.x-c.x)+1)*(Math.abs(u.y-c.y)+1),d=e.credit??DGt;typeof d=="string"&&(d=new It(d)),ws.call(this,{url:t,credit:d,tilingScheme:n,tileWidth:i,tileHeight:r,minimumLevel:o,maximumLevel:s,rectangle:a})}l(Object.create)&&(JW.prototype=Object.create(ws.prototype),JW.prototype.constructor=JW);var xy=JW;function Dke(){pe.throwInstantiationError()}Object.defineProperties(Dke.prototype,{show:{get:pe.throwInstantiationError,set:pe.throwInstantiationError},transform:{get:pe.throwInstantiationError},credit:{get:pe.throwInstantiationError}});var $ce=Dke;function ZW(){pe.throwInstantiationError()}Object.defineProperties(ZW.prototype,{});ZW.fromUrl=function(e){pe.throwInstantiationError()};ZW.prototype.loadPanorama=function(e){pe.throwInstantiationError()};var Jce=ZW;var RGt=new U(1,1);function Zce(e){e=e??H.EMPTY_OBJECT,this.mass=e.mass??1,this.position=h.clone(e.position??h.ZERO),this.velocity=h.clone(e.velocity??h.ZERO),this.life=e.life??Number.MAX_VALUE,this.image=e.image,this.startColor=z.clone(e.startColor??z.WHITE),this.endColor=z.clone(e.endColor??z.WHITE),this.startScale=e.startScale??1,this.endScale=e.endScale??1,this.imageSize=U.clone(e.imageSize??RGt),this._age=0,this._normalizedAge=0,this._billboard=void 0}Object.defineProperties(Zce.prototype,{age:{get:function(){return this._age}},normalizedAge:{get:function(){return this._normalizedAge}}});var Rke=new h;Zce.prototype.update=function(e,t){return h.multiplyByScalar(this.velocity,e,Rke),h.add(this.position,Rke,this.position),l(t)&&t(this,e),this._age+=e,this.life===Number.MAX_VALUE?this._normalizedAge=0:this._normalizedAge=this._age/this.life,this._age<=this.life};var $P=Zce;function Oke(e){e=e??H.EMPTY_OBJECT,this.time=e.time??0,this.minimum=e.minimum??0,this.maximum=e.maximum??50,this._complete=!1}Object.defineProperties(Oke.prototype,{complete:{get:function(){return this._complete}}});var Qce=Oke;function Mke(e){}Mke.prototype.emit=function(e){pe.throwInstantiationError()};var ele=Mke;var Nke=new U(1,1);function h8(e){e=e??H.EMPTY_OBJECT,this.show=e.show??!0,this.updateCallback=e.updateCallback,this.loop=e.loop??!0,this.image=e.image??void 0;let t=e.emitter;l(t)||(t=new K4(.5)),this._emitter=t,this._bursts=e.bursts,this._modelMatrix=N.clone(e.modelMatrix??N.IDENTITY),this._emitterModelMatrix=N.clone(e.emitterModelMatrix??N.IDENTITY),this._matrixDirty=!0,this._combinedMatrix=new N,this._startColor=z.clone(e.color??e.startColor??z.WHITE),this._endColor=z.clone(e.color??e.endColor??z.WHITE),this._startScale=e.scale??e.startScale??1,this._endScale=e.scale??e.endScale??1,this._emissionRate=e.emissionRate??5,this._minimumSpeed=e.speed??e.minimumSpeed??1,this._maximumSpeed=e.speed??e.maximumSpeed??1,this._minimumParticleLife=e.particleLife??e.minimumParticleLife??5,this._maximumParticleLife=e.particleLife??e.maximumParticleLife??5,this._minimumMass=e.mass??e.minimumMass??1,this._maximumMass=e.mass??e.maximumMass??1,this._minimumImageSize=U.clone(e.imageSize??e.minimumImageSize??Nke),this._maximumImageSize=U.clone(e.imageSize??e.maximumImageSize??Nke),this._sizeInMeters=e.sizeInMeters??!1,this._lifetime=e.lifetime??Number.MAX_VALUE,this._billboardCollection=void 0,this._particles=[],this._particlePool=[],this._previousTime=void 0,this._currentTime=0,this._carryOver=0,this._complete=new be,this._isComplete=!1,this._updateParticlePool=!0,this._particleEstimate=0}Object.defineProperties(h8.prototype,{emitter:{get:function(){return this._emitter},set:function(e){this._emitter=e}},bursts:{get:function(){return this._bursts},set:function(e){this._bursts=e,this._updateParticlePool=!0}},modelMatrix:{get:function(){return this._modelMatrix},set:function(e){this._matrixDirty=this._matrixDirty||!N.equals(this._modelMatrix,e),N.clone(e,this._modelMatrix)}},emitterModelMatrix:{get:function(){return this._emitterModelMatrix},set:function(e){this._matrixDirty=this._matrixDirty||!N.equals(this._emitterModelMatrix,e),N.clone(e,this._emitterModelMatrix)}},startColor:{get:function(){return this._startColor},set:function(e){z.clone(e,this._startColor)}},endColor:{get:function(){return this._endColor},set:function(e){z.clone(e,this._endColor)}},startScale:{get:function(){return this._startScale},set:function(e){this._startScale=e}},endScale:{get:function(){return this._endScale},set:function(e){this._endScale=e}},emissionRate:{get:function(){return this._emissionRate},set:function(e){this._emissionRate=e,this._updateParticlePool=!0}},minimumSpeed:{get:function(){return this._minimumSpeed},set:function(e){this._minimumSpeed=e}},maximumSpeed:{get:function(){return this._maximumSpeed},set:function(e){this._maximumSpeed=e}},minimumParticleLife:{get:function(){return this._minimumParticleLife},set:function(e){this._minimumParticleLife=e}},maximumParticleLife:{get:function(){return this._maximumParticleLife},set:function(e){this._maximumParticleLife=e,this._updateParticlePool=!0}},minimumMass:{get:function(){return this._minimumMass},set:function(e){this._minimumMass=e}},maximumMass:{get:function(){return this._maximumMass},set:function(e){this._maximumMass=e}},minimumImageSize:{get:function(){return this._minimumImageSize},set:function(e){this._minimumImageSize=e}},maximumImageSize:{get:function(){return this._maximumImageSize},set:function(e){this._maximumImageSize=e}},sizeInMeters:{get:function(){return this._sizeInMeters},set:function(e){this._sizeInMeters=e}},lifetime:{get:function(){return this._lifetime},set:function(e){this._lifetime=e}},complete:{get:function(){return this._complete}},isComplete:{get:function(){return this._isComplete}}});function OGt(e){let t=e._emissionRate,n=e._maximumParticleLife,i=0,r=e._bursts;if(l(r)){let d=r.length;for(let p=0;p<d;++p)i+=r[p].maximum}let o=e._billboardCollection,s=e.image,a=Math.ceil(t*n+i),c=e._particles,u=e._particlePool,f=Math.max(a-c.length-u.length,0);for(let d=0;d<f;++d){let p=new $P;p._billboard=o.add({image:s,show:!1}),u.push(p)}e._particleEstimate=a}function MGt(e){let t=e._particlePool.pop();return l(t)||(t=new $P),t}function NGt(e,t){e._particlePool.push(t)}function LGt(e){let t=e._particles,n=e._particlePool,i=e._billboardCollection,r=t.length,o=n.length,s=e._particleEstimate,a=o-Math.max(s-r-o,0);for(let c=a;c<o;++c){let u=n[c];i.remove(u._billboard)}n.length=a}function FGt(e){l(e._billboard)&&(e._billboard.show=!1)}function Lke(e,t){let n=t._billboard;l(n)||(n=t._billboard=e._billboardCollection.add({image:t.image})),n.width=t.imageSize.x,n.height=t.imageSize.y,n.position=t.position,n.sizeInMeters=e.sizeInMeters,n.show=!0;let i=D.lerp(t.startColor.red,t.endColor.red,t.normalizedAge),r=D.lerp(t.startColor.green,t.endColor.green,t.normalizedAge),o=D.lerp(t.startColor.blue,t.endColor.blue,t.normalizedAge),s=D.lerp(t.startColor.alpha,t.endColor.alpha,t.normalizedAge);n.color=new z(i,r,o,s),n.scale=D.lerp(t.startScale,t.endScale,t.normalizedAge)}function BGt(e,t){t.startColor=z.clone(e._startColor,t.startColor),t.endColor=z.clone(e._endColor,t.endColor),t.startScale=e._startScale,t.endScale=e._endScale,t.image=e.image,t.life=D.randomBetween(e._minimumParticleLife,e._maximumParticleLife),t.mass=D.randomBetween(e._minimumMass,e._maximumMass),t.imageSize.x=D.randomBetween(e._minimumImageSize.x,e._maximumImageSize.x),t.imageSize.y=D.randomBetween(e._minimumImageSize.y,e._maximumImageSize.y),t._normalizedAge=0,t._age=0;let n=D.randomBetween(e._minimumSpeed,e._maximumSpeed);h.multiplyByScalar(t.velocity,n,t.velocity),e._particles.push(t)}function kGt(e,t){if(e._isComplete)return 0;t=D.mod(t,e._lifetime);let n=t*e._emissionRate,i=Math.floor(n);if(e._carryOver+=n-i,e._carryOver>1&&(i++,e._carryOver-=1),l(e.bursts)){let r=e.bursts.length;for(let o=0;o<r;o++){let s=e.bursts[o],a=e._currentTime;l(s)&&!s._complete&&a>s.time&&(i+=D.randomBetween(s.minimum,s.maximum),s._complete=!0)}}return i}var QW=new h;h8.prototype.update=function(e){if(!this.show)return;l(this._billboardCollection)||(this._billboardCollection=new Df),this._updateParticlePool&&(OGt(this),this._updateParticlePool=!1);let t=0;this._previousTime&&(t=K.secondsDifference(e.time,this._previousTime)),t<0&&(t=0);let n=this._particles,i=this._emitter,r=this.updateCallback,o,s,a=n.length;for(o=0;o<a;++o)s=n[o],s.update(t,r)?Lke(this,s):(FGt(s),NGt(this,s),n[o]=n[a-1],--o,--a);n.length=a;let c=kGt(this,t);if(c>0&&l(i)){this._matrixDirty&&(this._combinedMatrix=N.multiply(this.modelMatrix,this.emitterModelMatrix,this._combinedMatrix),this._matrixDirty=!1);let u=this._combinedMatrix;for(o=0;o<c;o++)s=MGt(this),this._emitter.emit(s),h.add(s.position,s.velocity,QW),N.multiplyByPoint(u,QW,QW),s.position=N.multiplyByPoint(u,s.position,s.position),h.subtract(QW,s.position,s.velocity),h.normalize(s.velocity,s.velocity),BGt(this,s),Lke(this,s)}if(this._billboardCollection.update(e),this._previousTime=K.clone(e.time,this._previousTime),this._currentTime+=t,this._lifetime!==Number.MAX_VALUE&&this._currentTime>this._lifetime)if(this.loop){if(this._currentTime=D.mod(this._currentTime,this._lifetime),this.bursts){let u=this.bursts.length;for(o=0;o<u;o++)this.bursts[o]._complete=!1}}else this._isComplete=!0,this._complete.raiseEvent(this);e.frameNumber%120===0&&LGt(this)};h8.prototype.isDestroyed=function(){return!1};h8.prototype.destroy=function(){return this._billboardCollection=this._billboardCollection&&this._billboardCollection.destroy(),le(this)};var tle=h8;var nle=class{constructor(){ut(this,"quadtree");ut(this,"tilingScheme");ut(this,"errorEvent");pe.throwInstantiationError()}static computeDefaultLevelZeroMaximumGeometricError(t){return t.ellipsoid.maximumRadius*2*Math.PI*.25/(65*t.getNumberOfXTilesAtLevel(0))}update(t,n){pe.throwInstantiationError()}beginUpdate(t,n,i){pe.throwInstantiationError()}endUpdate(t,n,i){pe.throwInstantiationError()}getLevelMaximumGeometricError(t){pe.throwInstantiationError()}loadTile(t,n,i){pe.throwInstantiationError()}computeTileVisibility(t,n,i){pe.throwInstantiationError()}showTileThisFrame(t,n,i,r){pe.throwInstantiationError()}computeDistanceToTile(t,n){pe.throwInstantiationError()}isDestroyed(){pe.throwInstantiationError()}destroy(){pe.throwInstantiationError()}},ile=nle;function rle(e){e=e??1,this._radius=e??1}Object.defineProperties(rle.prototype,{radius:{get:function(){return this._radius},set:function(e){this._radius=e}}});rle.prototype.emit=function(e){let t=D.randomBetween(0,D.TWO_PI),n=D.randomBetween(0,D.PI),i=D.randomBetween(0,this._radius),r=i*Math.cos(t)*Math.sin(n),o=i*Math.sin(t)*Math.sin(n),s=i*Math.cos(n);e.position=h.fromElements(r,o,s,e.position),e.velocity=h.normalize(e.position,e.velocity)};var ole=rle;function m8(){}m8.prototype.evaluate=function(e,t){pe.throwInstantiationError()};m8.prototype.evaluateColor=function(e,t){pe.throwInstantiationError()};m8.prototype.getShaderFunction=function(e,t,n,i){pe.throwInstantiationError()};m8.prototype.getVariables=function(){pe.throwInstantiationError()};var sle=m8;function JP(e){this._ready=!1,this._provider=void 0,this._errorEvent=new be,this._readyEvent=new be,zGt(this,e)}Object.defineProperties(JP.prototype,{errorEvent:{get:function(){return this._errorEvent}},readyEvent:{get:function(){return this._readyEvent}},ready:{get:function(){return this._ready}},provider:{get:function(){return this._provider}}});JP.fromWorldTerrain=function(e){return new JP(UC(e))};JP.fromWorldBathymetry=function(e){return new JP(F4(e))};function UGt(e,t){e.numberOfListeners>0?e.raiseEvent(t):console.error(t)}async function zGt(e,t){let n;try{n=await Promise.resolve(t),e._provider=n,e._ready=!0,e._readyEvent.raiseEvent(n)}catch(i){UGt(e._errorEvent,i)}}var p8=JP;function ZP(){}ZP.prototype.boundingVolume=void 0;ZP.prototype.boundingSphere=void 0;ZP.prototype.distanceToCamera=function(e){pe.throwInstantiationError()};ZP.prototype.intersectPlane=function(e){pe.throwInstantiationError()};ZP.prototype.createDebugVolume=function(e){pe.throwInstantiationError()};var ale=ZP;function g8(e){e=e??H.EMPTY_OBJECT,this._tilingScheme=l(e.tilingScheme)?e.tilingScheme:new Qi({ellipsoid:e.ellipsoid}),this._color=e.color??z.YELLOW,this._errorEvent=new be,this._tileWidth=e.tileWidth??256,this._tileHeight=e.tileHeight??256,this._defaultAlpha=void 0,this._defaultNightAlpha=void 0,this._defaultDayAlpha=void 0,this._defaultBrightness=void 0,this._defaultContrast=void 0,this._defaultHue=void 0,this._defaultSaturation=void 0,this._defaultGamma=void 0,this._defaultMinificationFilter=void 0,this._defaultMagnificationFilter=void 0}Object.defineProperties(g8.prototype,{proxy:{get:function(){}},tileWidth:{get:function(){return this._tileWidth}},tileHeight:{get:function(){return this._tileHeight}},maximumLevel:{get:function(){}},minimumLevel:{get:function(){}},tilingScheme:{get:function(){return this._tilingScheme}},rectangle:{get:function(){return this._tilingScheme.rectangle}},tileDiscardPolicy:{get:function(){}},errorEvent:{get:function(){return this._errorEvent}},credit:{get:function(){}},hasAlphaChannel:{get:function(){return!0}}});g8.prototype.getTileCredits=function(e,t,n){};g8.prototype.requestImage=function(e,t,n,i){let r=document.createElement("canvas");r.width=256,r.height=256;let o=r.getContext("2d"),s=this._color.toCssColorString();return o.strokeStyle=s,o.lineWidth=2,o.strokeRect(1,1,255,255),o.font="bold 25px Arial",o.textAlign="center",o.fillStyle=s,o.fillText(`L: ${n}`,124,86),o.fillText(`X: ${e}`,124,136),o.fillText(`Y: ${t}`,124,186),Promise.resolve(r)};g8.prototype.pickFeatures=function(e,t,n,i,r){};var _8=g8;function cle(e){pe.throwInstantiationError()}cle.prototype.isReady=pe.throwInstantiationError;cle.prototype.shouldDiscardImage=pe.throwInstantiationError;var lle=cle;var Fke={START:0,LOADING:1,READY:2,UPSAMPLED_ONLY:3};Object.freeze(Fke);var ule=Fke;function eq(e,t){this.show=!0,l(e)||(e=new et),this.rectangle=et.clone(e),l(t)||(t=er.fromType(er.ColorType,{color:new z(1,1,1,1)})),this.material=t,this._material=void 0,this._overlayCommand=void 0,this._rs=void 0}eq.prototype.update=function(e){if(!this.show)return;let t=this._rs;if((!l(t)||!et.equals(t.viewport,this.rectangle))&&(this._rs=Ge.fromCache({blending:tn.ALPHA_BLEND,viewport:this.rectangle})),e.passes.render){let i=e.context;if(this._material!==this.material||!l(this._overlayCommand)){this._material=this.material,l(this._overlayCommand)&&this._overlayCommand.shaderProgram.destroy();let r=new Ye({sources:[this._material.shaderSource,PM]});this._overlayCommand=i.createViewportQuadCommand(r,{renderState:this._rs,uniformMap:this._material._uniforms,owner:this}),this._overlayCommand.pass=Ie.OVERLAY}this._material.update(i),this._overlayCommand.renderState=this._rs,this._overlayCommand.uniformMap=this._material._uniforms,e.commandList.push(this._overlayCommand)}};eq.prototype.isDestroyed=function(){return!1};eq.prototype.destroy=function(){return l(this._overlayCommand)&&(this._overlayCommand.shaderProgram=this._overlayCommand.shaderProgram&&this._overlayCommand.shaderProgram.destroy()),le(this)};var fle=eq;var dle=class{constructor(){ut(this,"globalTransform");ut(this,"shapeTransform");ut(this,"shape");ut(this,"minBounds");ut(this,"maxBounds");ut(this,"dimensions");ut(this,"paddingBefore");ut(this,"paddingAfter");ut(this,"names");ut(this,"types");ut(this,"componentTypes");ut(this,"minimumValues");ut(this,"maximumValues");ut(this,"maximumTileCount");ut(this,"availableLevels");ut(this,"keyframeCount");ut(this,"timeIntervalCollection");pe.throwInstantiationError()}requestData(t){pe.throwInstantiationError()}},hle=dle;function Ty(){pe.throwInstantiationError()}Object.defineProperties(Ty.prototype,{orientedBoundingBox:{get:pe.throwInstantiationError},boundingSphere:{get:pe.throwInstantiationError},boundTransform:{get:pe.throwInstantiationError},shapeTransform:{get:pe.throwInstantiationError},shaderUniforms:{get:pe.throwInstantiationError},shaderDefines:{get:pe.throwInstantiationError},shaderMaximumIntersectionsLength:{get:pe.throwInstantiationError}});Ty.prototype.update=pe.throwInstantiationError;Ty.prototype.updateViewTransforms=pe.throwInstantiationError;Ty.prototype.convertLocalToShapeUvSpace=pe.throwInstantiationError;Ty.prototype.computeOrientedBoundingBoxForTile=pe.throwInstantiationError;Ty.prototype.computeOrientedBoundingBoxForSample=pe.throwInstantiationError;Ty.DefaultMinBounds=pe.throwInstantiationError;Ty.DefaultMaxBounds=pe.throwInstantiationError;var mle=Ty;var ple=class{get enabled(){return pe.throwInstantiationError()}set enabled(t){pe.throwInstantiationError()}connectedCallback(t){pe.throwInstantiationError()}disconnectedCallback(t){pe.throwInstantiationError()}update(t,n){pe.throwInstantiationError()}firstUpdate(t,n){pe.throwInstantiationError()}},gle=ple;var Bke=new h,VGt=new sn(h.UNIT_X,0),jGt=new pn,HGt=new U(1,1,1);function _p(e,t,n,i=HGt){let{camera:r,ellipsoid:o}=e,s=o.scaleToGeodeticSurface(r.positionWC,Bke);if(!l(s))return;let a=h.magnitude(r.positionWC),c=h.magnitude(s),u=a<=c,f=o.geodeticSurfaceNormal(r.positionWC,Bke),d=h.dot(f,r.directionWC),p=d>0;if(u||p){let g=sn.fromPointNormal(r.positionWC,f,VGt),{clientHeight:m}=e.canvas,y=i.y*m/(2*Math.tan(r.frustum.fovy*.5));g.distance-=d*y;let A=r.getPickRay(t,jGt);return _i.rayPlane(A,g,n)}return r.pickEllipsoid(t,o,n)}var kke={LEFT:0,MIDDLE:1,RIGHT:2};Object.freeze(kke);var ec=kke;function GGt(e){if(e===ec.LEFT)return un.LEFT_DOWN;if(e===ec.MIDDLE)return un.MIDDLE_DOWN;if(e===ec.RIGHT)return un.RIGHT_DOWN}function WGt(e){if(e===ec.LEFT)return un.LEFT_UP;if(e===ec.MIDDLE)return un.MIDDLE_UP;if(e===ec.RIGHT)return un.RIGHT_UP}var _le=class{static registerDragInputBindings(t,n,i){let r=new Set,o={isDragging:!1};for(let s of n){o.isDragging=!1;let a=GGt(s.button),c=WGt(s.button);l(a)&&t.setInputAction((...u)=>{o.isDragging=!0,l(i.start)&&i.start(...u)},a,s.modifier),l(c)&&(t.setInputAction((...u)=>{o.isDragging&&(o.isDragging=!1,l(i.end)&&i.end(...u))},c,s.modifier),t.setInputAction((...u)=>{o.isDragging&&(o.isDragging=!1,l(i.end)&&i.end(...u))},c)),r.add(s.modifier)}for(let s of r)t.setInputAction((...a)=>{o.isDragging&&l(i.change)&&i.change(...a)},un.MOUSE_MOVE,s);return o}},yp=_le;var yle=class e{static _getDefaultDragInputs(){return[Object.freeze({button:ec.LEFT})]}constructor(t=H.EMPTY_OBJECT){this._enabled=!0,this._handler=void 0,this._lastUpdateTime=void 0,this.dragInputs=t.dragInputs??e._getDefaultDragInputs(),this._dragInputState=void 0,this._panDelta=new U,this._panPosition=new U,this.pickWorldPosition=_p,this._ellipsoidNormal=new h,this._ellipsoidSurfacePosition=new h,this._panDirectionX=new h,this._panDirectionY=new h,this._pixelSize=new U,this._panVelocity=new U,this.panSpeed=1,this.inertiaEnabled=!0,this.inertialDecay=6,this.maximumMovementRatio=.1}get enabled(){return this._enabled}set enabled(t){this._enabled=t,t?(this._lastUpdateTime=xn(),this._panDelta.x=0,this._panDelta.y=0):l(this._dragInputState)&&(this._dragInputState.isDragging=!1)}get isDragging(){return l(this._dragInputState)&&this._dragInputState.isDragging}connectedCallback(t){let n=new sa(t);this._handler=n,this._dragInputState=yp.registerDragInputBindings(n,this.dragInputs,{start:this._handleStartPan.bind(this),change:this._handlePan.bind(this)})}disconnectedCallback(t){let n=this._handler;l(n)&&!n.isDestroyed()&&n.destroy()}firstUpdate(){this._lastUpdateTime=xn(),this._panDelta.x=0,this._panDelta.y=0}update(t){let n=(xn()-this._lastUpdateTime)*kn.SECONDS_PER_MILLISECOND,{camera:i,ellipsoid:r,canvas:o}=t,s=-this._panDelta.x,a=this._panDelta.y;if(this.inertiaEnabled&&!this.isDragging){let E=Math.exp(-this.inertialDecay*n);this._panVelocity.x*=E,this._panVelocity.y*=E,s=this._panVelocity.x*n,a=this._panVelocity.y*n}let{clientWidth:c,clientHeight:u}=o;if(n===0||c===0||u===0||Math.abs(s)<=D.EPSILON3&&Math.abs(a)<=D.EPSILON3){this._lastUpdateTime=xn(),this._panDelta.x=0,this._panDelta.y=0;return}let f=this._panPosition,d=this.pickWorldPosition(t,f,this._ellipsoidSurfacePosition);l(d)||(d=r.scaleToGeodeticSurface(i.positionWC,this._ellipsoidSurfacePosition));let p=h.clone(i.rightWC,this._panDirectionX);p=h.normalize(p,this._panDirectionX);let g=h.normalize(d,this._panDirectionY),m=h.distance(i.positionWC,d),{drawingBufferWidth:y,drawingBufferHeight:A,pixelRatio:b}=t,x=i.frustum.getPixelDimensions(y,A,m,b,this._pixelSize),T=this.maximumMovementRatio*Math.max(c,u);s=D.clamp(s,-T,T),this._panVelocity.x=s/n,s*=this.panSpeed*x.x,a=D.clamp(a,-T,T),this._panVelocity.y=a/n,a*=this.panSpeed*x.y,i.move(p,s),i.move(g,a),this._lastUpdateTime=xn(),this._panDelta.x=0,this._panDelta.y=0}_handleStartPan(){this.enabled&&(this._panDelta.x=0,this._panDelta.y=0)}_handlePan(t){this._panDelta.x+=t.endPosition.x-t.startPosition.x,this._panDelta.y+=t.endPosition.y-t.startPosition.y,this._panPosition.x=t.endPosition.x,this._panPosition.y=t.endPosition.y}},y8=yle;var Ale=class e{static _getDefaultDragInputs(){return[Object.freeze({button:ec.LEFT})]}constructor(t=H.EMPTY_OBJECT){this._enabled=!0,this._handler=void 0,this._lastUpdateTime=void 0,this.dragInputs=t.dragInputs??e._getDefaultDragInputs(),this._dragInputState=void 0,this._panDelta=new U,this._panPosition=new U,this.pickWorldPosition=_p,this._ellipsoidNormal=new h,this._ellipsoidSurfacePosition=new h,this._panDirectionX=new h,this._panDirectionY=new h,this._pixelSize=new U,this._panVelocity=new U,this.panSpeed=1,this.inertiaEnabled=!0,this.inertialDecay=6,this.maximumMovementRatio=.1}get enabled(){return this._enabled}set enabled(t){this._enabled=t,t?(this._panDelta.x=0,this._panDelta.y=0):l(this._dragInputState)&&(this._dragInputState.isDragging=!1)}get isDragging(){return l(this._dragInputState)&&this._dragInputState.isDragging}connectedCallback(t){let n=new sa(t);this._handler=n,this._dragInputState=yp.registerDragInputBindings(n,this.dragInputs,{start:this._handleStartPan.bind(this),change:this._handlePan.bind(this)})}disconnectedCallback(t){let n=this._handler;l(n)&&!n.isDestroyed()&&n.destroy()}firstUpdate(){this._lastUpdateTime=xn(),this._panDelta.x=0,this._panDelta.y=0}update(t){let n=(xn()-this._lastUpdateTime)*kn.SECONDS_PER_MILLISECOND,i=-this._panDelta.x,r=this._panDelta.y;if(this.inertiaEnabled&&!this.isDragging){let S=Math.exp(-this.inertialDecay*n);this._panVelocity.x*=S,this._panVelocity.y*=S,i=this._panVelocity.x*n,r=this._panVelocity.y*n}let{camera:o,ellipsoid:s,canvas:a}=t,{clientWidth:c,clientHeight:u}=a;if(n===0||c===0||u===0||Math.abs(i)<=D.EPSILON3&&Math.abs(r)<=D.EPSILON3){this._lastUpdateTime=xn(),this._panDelta.x=0,this._panDelta.y=0;return}let f=this._panPosition,d=this.pickWorldPosition(t,f,this._ellipsoidSurfacePosition);l(d)||(d=s.scaleToGeodeticSurface(o.positionWC,this._ellipsoidSurfacePosition));let p=s.geodeticSurfaceNormal(d,this._ellipsoidNormal),g=h.clone(o.rightWC,this._panDirectionX);g=h.normalize(g,this._panDirectionX);let m=h.clone(o.upWC,this._panDirectionY),y=Math.abs(h.dot(p,o.directionWC));D.lessThan(y,1,D.EPSILON6)&&(m=h.cross(p,g,this._panDirectionY)),m=h.normalize(m,this._panDirectionY);let A=h.distance(o.positionWC,d),{drawingBufferWidth:b,drawingBufferHeight:x,pixelRatio:T}=t,E=o.frustum.getPixelDimensions(b,x,A,T,this._pixelSize),v=this.maximumMovementRatio*Math.max(c,u);i=D.clamp(i,-v,v),this._panVelocity.x=i/n,i*=this.panSpeed*E.x,r=D.clamp(r,-v,v),this._panVelocity.y=r/n,r*=this.panSpeed*E.y,o.move(g,i),o.move(m,r),this._lastUpdateTime=xn(),this._panDelta.x=0,this._panDelta.y=0}_handleStartPan(t){this.enabled&&(this._panDelta.x=0,this._panDelta.y=0)}_handlePan(t){this._panDelta.x+=t.endPosition.x-t.startPosition.x,this._panDelta.y+=t.endPosition.y-t.startPosition.y,this._panPosition.x=t.endPosition.x,this._panPosition.y=t.endPosition.y}},A8=Ale;var ble=class{constructor(){this._elevatorController=new y8,this._mapController=new A8,this._enabled=!0,this._ellipsoidNormal=new h,this.angleThreshold=D.toRadians(125)}get enabled(){return this._enabled}set enabled(t){this._enabled=t}get elevatorController(){return this._elevatorController}get mapController(){return this._mapController}connectedCallback(t){this._elevatorController.connectedCallback(t),this._mapController.connectedCallback(t)}disconnectedCallback(t){this._elevatorController.disconnectedCallback(t),this._mapController.disconnectedCallback(t)}firstUpdate(){this._elevatorController.firstUpdate(),this._mapController.firstUpdate()}update(t){let n=t.camera,i=t.ellipsoid.geodeticSurfaceNormal(n.positionWC,this._ellipsoidNormal),r=Math.abs(h.angleBetween(i,n.directionWC));(r<this.angleThreshold&&r>Math.PI-this.angleThreshold?this._elevatorController:this._mapController).update(t)}},xle=ble;var Tle=class e{static _getDefaultDragInputs(){return[Object.freeze({button:ec.LEFT,modifier:Qr.CTRL}),Object.freeze({button:ec.RIGHT})]}constructor(t=H.EMPTY_OBJECT){this._enabled=!0,this._handler=void 0,this._lastUpdateTime=void 0,this.tiltEnabled=!0,this.orbitEnabled=!0,this.useDragPosition=!1,this.dragInputs=t.dragInputs??e._getDefaultDragInputs(),this._dragInputState=void 0,this._dragDelta=new U,this._screenSpaceDragPosition=new U,this._screenSpaceOrigin=new U,this.pickWorldPosition=_p,this._hasTarget=!1,this._target=new h,this._axis=new h,this.tiltMagnitude=2,this.dampingEnabled=!0,this.tiltAnimationDuration=.0045,this.maximumTiltVelocity=D.PI,this.minimumTiltVelocity=D.EPSILON20,this.orbitMagnitude=2,this.orbitAnimationDuration=.0045,this.maximumOrbitVelocity=D.TWO_PI,this.minimumOrbitVelocity=D.EPSILON20,this._tiltAxis=new h,this._tiltQuaternion=new Le,this._tiltOffset=new h,this._tiltOrigin=new h,this._tiltDampenedResults={velocity:0,value:0},this._orbitTargetEnu=new N,this._orbitTargetEast=new h,this._orbitQuaternion=new Le,this._orbitOffset=new h,this._orbitLookOffset=new h,this._orbitOrigin=new h,this._orbitDampenedResults={velocity:0,value:0},this.maximumMovementRatio=.1}get enabled(){return this._enabled}set enabled(t){this._enabled=t,t?(this._lastUpdateTime=xn(),this._dragDelta.x=0,this._dragDelta.y=0):l(this._dragInputState)&&(this._dragInputState.isDragging=!1)}get isDragging(){return l(this._dragInputState)&&this._dragInputState.isDragging}connectedCallback(t){let n=new sa(t);this._handler=n,this._dragInputState=yp.registerDragInputBindings(n,this.dragInputs,{start:this._handleStartDrag.bind(this),change:this._handleDrag.bind(this)})}disconnectedCallback(t){let n=this._handler;l(n)&&!n.isDestroyed()&&n.destroy()}firstUpdate(){this._lastUpdateTime=xn(),this._dragDelta.x=0,this._dragDelta.y=0}_handleStartDrag(t){this.enabled&&(this._hasTarget=!1,this._screenSpaceDragPosition.x=t.position.x,this._screenSpaceDragPosition.y=t.position.y,this._dragDelta.x=0,this._dragDelta.y=0)}_handleDrag(t){this._dragDelta.x+=t.endPosition.x-t.startPosition.x,this._dragDelta.y+=t.endPosition.y-t.startPosition.y}get tiltAngle(){return this._tiltDampenedResults.value}get tiltVelocity(){return this._tiltDampenedResults.velocity}set tiltVelocity(t){this._tiltDampenedResults.velocity=t}get orbitAngle(){return this._orbitDampenedResults.value}get orbitVelocity(){return this._orbitDampenedResults.velocity}set orbitVelocity(t){this._orbitDampenedResults.velocity=t}orbit(t,n,i,r,o,s=ee.default){let a=At.eastNorthUpToFixedFrame(n,s,this._orbitTargetEnu),c=N.multiplyByPointAsVector(a,h.UNIT_X,this._orbitTargetEast),u=h.angleBetween(t.directionWC,c);if(Math.abs(this.orbitVelocity)<this.minimumOrbitVelocity&&(this.orbitVelocity=0),!this.isDragging&&this.dampingEnabled&&(r+=this.orbitVelocity*o),r===0)return;let f=u+r,d=this.dampingEnabled?this.maximumOrbitVelocity*this.orbitMagnitude:void 0,p=this.dampingEnabled?this.orbitAnimationDuration:void 0;this._orbitDampenedResults=D.smoothDamp(u,f,this.orbitVelocity,o,d,p,this._orbitDampenedResults);let g=this.orbitAngle-u,m=$.fromQuaternion(Le.fromAxisAngle(i,-g,this._orbitQuaternion)),y=h.subtract(t.positionWC,n,this._orbitOffset),A=h.dot(y,t.directionWC),b=h.multiplyByScalar(t.directionWC,A,this._orbitLookOffset),x=h.subtract(y,b,this._orbitLookOffset),T=$.multiplyByVector(m,y,this._orbitOffset),E=$.multiplyByVector(m,x,this._orbitLookOffset);h.add(n,T,t.position);let v=h.add(n,E,this._orbitOrigin);t.lookAtWorldPosition(v,s)}tilt(t,n,i,r,o,s=ee.default){if(Math.abs(this.tiltVelocity)<this.minimumTiltVelocity&&(this.tiltVelocity=0),!this.isDragging&&this.dampingEnabled&&(r+=this.tiltVelocity*o),r===0)return;let a=h.angleBetween(t.direction,i);(a<D.PI_OVER_TWO&&r>0||a>D.PI_OVER_TWO&&r<0)&&(r*=Math.abs(Math.sin(a)));let c=a+r,u=this.dampingEnabled?this.maximumTiltVelocity*this.tiltMagnitude:void 0,f=this.dampingEnabled?this.tiltAnimationDuration:void 0;D.smoothDamp(a,c,this.tiltVelocity,o,u,f,this._tiltDampenedResults);let d=this.tiltAngle-a,p=$.fromQuaternion(Le.fromAxisAngle(t.rightWC,-d,this._tiltQuaternion)),g=h.subtract(t.position,n,this._tiltOffset),m=h.dot(g,t.directionWC),y=h.multiplyByScalar(t.directionWC,m,this._tiltOffset),A=h.subtract(t.position,y,this._tiltOrigin),b=$.multiplyByVector(p,y,this._tiltOffset);h.add(A,b,t.position),t.lookAtWorldPosition(A,s)}update(t){let n=(xn()-this._lastUpdateTime)*kn.SECONDS_PER_MILLISECOND,{canvas:i}=t,{clientWidth:r,clientHeight:o}=i;if(n===0||r===0||o===0){this._lastUpdateTime=xn(),this._dragDelta.x=0,this._dragDelta.y=0;return}let s=this._target;if(this.isDragging&&!this._hasTarget){let a=this._screenSpaceDragPosition;this.useDragPosition||(a=this._screenSpaceOrigin,a.x=r/2,a.y=o/2);let c=this.pickWorldPosition(t,a,this._target),u=l(c);this._hasTarget=u,s=c}if(this._hasTarget){let{camera:a,ellipsoid:c}=t,u=c.geodeticSurfaceNormal(s,this._axis),f=h.negate(u,this._axis);if(this.orbitEnabled){let d=this._dragDelta.x/r;d=D.clamp(d,-this.maximumMovementRatio,this.maximumMovementRatio),d*=this.orbitMagnitude*D.TWO_PI,this.orbit(a,s,f,d,n,c)}if(this.tiltEnabled){let d=this._dragDelta.y/o;d=D.clamp(d,-this.maximumMovementRatio,this.maximumMovementRatio),d*=this.tiltMagnitude*D.PI,this.tilt(a,s,f,d,n,c)}}this._lastUpdateTime=xn(),this._dragDelta.x=0,this._dragDelta.y=0}},Ele=Tle;var Cle=class e{static _getDefaultDragInputs(){return[Object.freeze({button:ec.MIDDLE})]}static _getDefaultScrollInputs(){return[un.WHEEL]}constructor(t=H.EMPTY_OBJECT){this._enabled=!0,this._handler=void 0,this._lastUpdateTime=void 0,this.usePointerPosition=!1,this.dragInputs=t.dragInputs??e._getDefaultDragInputs(),this.scrollInputs=t.scrollInputs??e._getDefaultScrollInputs(),this._dragInputState=void 0,this._dragDelta=new U,this._scrollDelta=0,this._zoomInputVelocity=0,this._screenSpaceScrollPosition=new U,this._screenSpaceDragPosition=new U,this._screenSpaceOrigin=new U,this.zoomSensitivity=.2,this.pickWorldPosition=_p,this.zoomDistanceRatio=.4,this.inertiaEnabled=!1,this.inertialDecay=6,this.minimumZoomDistance=0,this.maximumZoomDistance=1e5,this.minimumZoomVelocity=D.EPSILON20,this.maximumZoomVelocity=1,this.dampingEnabled=!0,this.zoomAnimationDuration=.45,this._target=new h,this._zoomDirection=new h,this._zoomDampenedResults={velocity:0,value:0}}get enabled(){return this._enabled}set enabled(t){this._enabled=t,t?(this._lastUpdateTime=xn(),this._scrollDelta=0,this._dragDelta.x=0,this._dragDelta.y=0):l(this._dragInputState)&&(this._dragInputState.isDragging=!1)}get isDragging(){return l(this._dragInputState)&&this._dragInputState.isDragging}connectedCallback(t){let n=new sa(t);this._handler=n;for(let i of this.scrollInputs)n.setInputAction(this._handleZoom.bind(this),i);n.setInputAction(this._handleZoomPosition.bind(this),un.MOUSE_MOVE),this._dragInputState=yp.registerDragInputBindings(n,this.dragInputs,{start:this._handleStartDrag.bind(this),change:this._handleDrag.bind(this)})}disconnectedCallback(t){let n=this._handler;l(n)&&!n.isDestroyed()&&n.destroy()}firstUpdate(){this._lastUpdateTime=xn(),this._scrollDelta=0,this._dragDelta.x=0,this._dragDelta.y=0}get zoomDistance(){return this._zoomDampenedResults.value}get zoomVelocity(){return this._zoomDampenedResults.velocity}set zoomVelocity(t){this._zoomDampenedResults.velocity=t}update(t){let i=(xn()-this._lastUpdateTime)*kn.SECONDS_PER_MILLISECOND,{canvas:r}=t,{clientWidth:o,clientHeight:s}=r;if(i===0||o===0||s===0){this._lastUpdateTime=xn(),this._scrollDelta=0,this._dragDelta.x=0,this._dragDelta.y=0;return}let a=this._scrollDelta+this._dragDelta.y;if(a===0&&this.inertiaEnabled){let A=Math.exp(-this.inertialDecay*i);this._zoomInputVelocity*=A,a=this._zoomInputVelocity*i}if(Math.abs(this.zoomVelocity)<this.minimumZoomVelocity&&a<=D.EPSILON3&&a>=-D.EPSILON3&&this.zoomVelocity<=D.EPSILON3){this._lastUpdateTime=xn(),this._scrollDelta=0,this._dragDelta.x=0,this._dragDelta.y=0,this.zoomVelocity=0;return}this._zoomInputVelocity=D.clamp(a/i,-this.maximumZoomVelocity,this.maximumZoomVelocity);let{camera:c,ellipsoid:u}=t,f=c.direction,d=h.magnitude(c.positionWC)-u.maximumRadius,p=this.isDragging?this._screenSpaceDragPosition:this._screenSpaceScrollPosition;this.useDragPosition||(p=this._screenSpaceOrigin,p.x=o/2,p.y=s/2);let g=this.pickWorldPosition(t,p,this._target);l(g)&&(f=h.subtract(g,c.positionWC,this._zoomDirection),f=h.normalize(f,this._zoomDirection),d=h.distance(g,c.positionWC)),d=D.clamp(d,d>0?this.minimumZoomDistance:-this.maximumZoomDistance,d>0?this.maximumZoomDistance:-this.minimumZoomDistance);let m=a*d*this.zoomDistanceRatio,y=this.dampingEnabled?this.zoomAnimationDuration:void 0;this._zoomDampenedResults=D.smoothDamp(0,m,this.zoomVelocity,i,void 0,y,this._zoomDampenedResults),c.move(f,this.zoomDistance),this._lastUpdateTime=xn(),this._scrollDelta=0,this._dragDelta.x=0,this._dragDelta.y=0}_handleZoom(t){this._scrollDelta+=t*this.zoomSensitivity}_handleZoomPosition(t){this._screenSpaceScrollPosition.x=t.endPosition.x,this._screenSpaceScrollPosition.y=t.endPosition.y}_handleStartDrag(t){this.enabled&&(this._screenSpaceDragPosition.x=t.position.x,this._screenSpaceDragPosition.y=t.position.y,this._dragDelta.x=0,this._dragDelta.y=0)}_handleDrag(t){this._dragDelta.x+=t.endPosition.x-t.startPosition.x,this._dragDelta.y+=t.endPosition.y-t.startPosition.y}},vle=Cle;var Uke={FLOAT:"float",VEC2:"vec2",VEC3:"vec3",VEC4:"vec4",MAT2:"mat2",MAT3:"mat3",MAT4:"mat4"};Object.freeze(Uke);var Sle=Uke;var zke={SIGX:"SIGX",SIGY:"SIGY",SIGZ:"SIGZ",VARX:"VARX",VARY:"VARY",VARZ:"VARZ",SIGR:"VARZ"};Object.freeze(zke);var wle=zke;function qGt(e){async function t({data:i}){let r=[],o={id:i.id,result:void 0,error:void 0};self.CESIUM_BASE_URL=i.baseUrl;try{let s=await e(i.parameters,r);o.result=s}catch(s){s instanceof Error?o.error={name:s.name,message:s.message,stack:s.stack}:o.error=s}i.canTransferArrayBuffer||(r.length=0);try{postMessage(o,r)}catch(s){o.result=void 0,o.error=`postMessage failed with error: ${Fp(s)} + with responseMessage: ${JSON.stringify(o)}`,postMessage(o)}}function n(i){postMessage({id:i.data?.id,error:`postMessage failed with error: ${JSON.stringify(i)}`})}return self.onmessage=t,self.onmessageerror=n,self}var Ile=qGt;globalThis.CESIUM_VERSION="1.145.0";var b8;typeof ko<"u"&&(b8=ko);(function(){/*! * Knockout JavaScript library v3.5.1 * (c) The Knockout.js team - http://knockoutjs.com/ * License: MIT (http://www.opensource.org/licenses/mit-license.php) @@ -12739,16 +12739,23 @@ out_FragColor = vec4(mix(vec3(0.0), vec3(1.0), scale), 1.0); |/(?:\\\\.|[^/])+/w*|[^\\s:,/][^,"'\`{}()/:[\\]]*[^\\s,"'\`{}()/:[\\]]|[^\\s]`,"g"),M=/[\])"'A-Za-z0-9_$]+$/,F={in:1,return:1,typeof:1},V={};return{Ra:[],wa:V,ac:_,vb:function(B,j){function k(Z,ae){var Ae;if(!W){var fe=m.getBindingHandler(Z);if(fe&&fe.preprocess&&!(ae=fe.preprocess(ae,Z,k)))return;(fe=V[Z])&&(Ae=ae,0<=m.a.A(C,Ae)?Ae=!1:(fe=Ae.match(w),Ae=fe===null?!1:fe[1]?"Object("+fe[1]+")"+fe[2]:Ae),fe=Ae),fe&&q.push("'"+(typeof V[Z]=="string"?V[Z]:Z)+"':function(_z){"+Ae+"=_z}")}Q&&(ae="function(){return "+ae+" }"),G.push("'"+Z+"':"+ae)}j=j||{};var G=[],q=[],Q=j.valueAccessors,W=j.bindingParams,J=typeof B=="string"?_(B):B;return m.a.D(J,function(Z){k(Z.key||Z.unknown,Z.value)}),q.length&&k("_ko_property_writers","{"+q.join(",")+" }"),G.join(",")},Id:function(B,j){for(var k=0;k<B.length;k++)if(B[k].key==j)return!0;return!1},eb:function(B,j,k,G,q){B&&m.O(B)?!m.Za(B)||q&&B.v()===G||B(G):(B=j.get("_ko_property_writers"))&&B[k]&&B[k](G)}}})(),m.b("expressionRewriting",m.m),m.b("expressionRewriting.bindingRewriteValidators",m.m.Ra),m.b("expressionRewriting.parseObjectLiteral",m.m.ac),m.b("expressionRewriting.preProcessBindings",m.m.vb),m.b("expressionRewriting._twoWayBindings",m.m.wa),m.b("jsonExpressionRewriting",m.m),m.b("jsonExpressionRewriting.insertPropertyAccessorsIntoJson",m.m.vb),(function(){function _(k){return k.nodeType==8&&F.test(M?k.text:k.nodeValue)}function C(k){return k.nodeType==8&&V.test(M?k.text:k.nodeValue)}function w(k,G){for(var q=k,Q=1,W=[];q=q.nextSibling;){if(C(q)&&(m.a.g.set(q,j,!0),Q--,Q===0))return W;W.push(q),_(q)&&Q++}if(!G)throw Error("Cannot find closing comment tag to match: "+k.nodeValue);return null}function P(k,G){var q=w(k,G);return q?0<q.length?q[q.length-1].nextSibling:k.nextSibling:null}var M=n&&n.createComment("test").text==="<!--test-->",F=M?/^\x3c!--\s*ko(?:\s+([\s\S]+))?\s*--\x3e$/:/^\s*ko(?:\s+([\s\S]+))?\s*$/,V=M?/^\x3c!--\s*\/ko\s*--\x3e$/:/^\s*\/ko\s*$/,B={ul:!0,ol:!0},j="__ko_matchedEndComment__";m.h={ea:{},childNodes:function(k){return _(k)?w(k):k.childNodes},Ea:function(k){if(_(k)){k=m.h.childNodes(k);for(var G=0,q=k.length;G<q;G++)m.removeNode(k[G])}else m.a.Tb(k)},va:function(k,G){if(_(k)){m.h.Ea(k);for(var q=k.nextSibling,Q=0,W=G.length;Q<W;Q++)q.parentNode.insertBefore(G[Q],q)}else m.a.va(k,G)},Vc:function(k,G){var q;_(k)?(q=k.nextSibling,k=k.parentNode):q=k.firstChild,q?G!==q&&k.insertBefore(G,q):k.appendChild(G)},Wb:function(k,G,q){q?(q=q.nextSibling,_(k)&&(k=k.parentNode),q?G!==q&&k.insertBefore(G,q):k.appendChild(G)):m.h.Vc(k,G)},firstChild:function(k){if(_(k))return!k.nextSibling||C(k.nextSibling)?null:k.nextSibling;if(k.firstChild&&C(k.firstChild))throw Error("Found invalid end comment, as the first child of "+k);return k.firstChild},nextSibling:function(k){if(_(k)&&(k=P(k)),k.nextSibling&&C(k.nextSibling)){var G=k.nextSibling;if(C(G)&&!m.a.g.get(G,j))throw Error("Found end comment without a matching opening comment, as child of "+k);return null}return k.nextSibling},Cd:_,Vd:function(k){return(k=(M?k.text:k.nodeValue).match(F))?k[1]:null},Sc:function(k){if(B[m.a.R(k)]){var G=k.firstChild;if(G)do if(G.nodeType===1){var q;q=G.firstChild;var Q=null;if(q)do if(Q)Q.push(q);else if(_(q)){var W=P(q,!0);W?q=W:Q=[q]}else C(q)&&(Q=[q]);while(q=q.nextSibling);if(q=Q)for(Q=G.nextSibling,W=0;W<q.length;W++)Q?k.insertBefore(q[W],Q):k.appendChild(q[W])}while(G=G.nextSibling)}}}})(),m.b("virtualElements",m.h),m.b("virtualElements.allowedBindings",m.h.ea),m.b("virtualElements.emptyNode",m.h.Ea),m.b("virtualElements.insertAfter",m.h.Wb),m.b("virtualElements.prepend",m.h.Vc),m.b("virtualElements.setDomNodeChildren",m.h.va),(function(){m.ga=function(){this.nd={}},m.a.extend(m.ga.prototype,{nodeHasBindings:function(_){switch(_.nodeType){case 1:return _.getAttribute("data-bind")!=null||m.j.getComponentNameForNode(_);case 8:return m.h.Cd(_);default:return!1}},getBindings:function(_,C){var w=this.getBindingsString(_,C),w=w?this.parseBindingsString(w,C,_):null;return m.j.tc(w,_,C,!1)},getBindingAccessors:function(_,C){var w=this.getBindingsString(_,C),w=w?this.parseBindingsString(w,C,_,{valueAccessors:!0}):null;return m.j.tc(w,_,C,!0)},getBindingsString:function(_){switch(_.nodeType){case 1:return _.getAttribute("data-bind");case 8:return m.h.Vd(_);default:return null}},parseBindingsString:function(_,C,w,P){try{var M=this.nd,F=_+(P&&P.valueAccessors||""),V;if(!(V=M[F])){var B,j="with($context){with($data||{}){return{"+m.m.vb(_,P)+"}}}";B=new Function("$context","$element",j),V=M[F]=B}return V(C,w)}catch(k){throw k.message=`Unable to parse bindings. Bindings value: `+_+` Message: `+k.message,k}}}),m.ga.instance=new m.ga})(),m.b("bindingProvider",m.ga),(function(){function _(fe){var xe=(fe=m.a.g.get(fe,Ae))&&fe.N;xe&&(fe.N=null,xe.Tc())}function C(fe,xe,ge){this.node=fe,this.yc=xe,this.kb=[],this.H=!1,xe.N||m.a.K.za(fe,_),ge&&ge.N&&(ge.N.kb.push(fe),this.Kb=ge)}function w(fe){return function(){return fe}}function P(fe){return fe()}function M(fe){return m.a.Ga(m.u.G(fe),function(xe,ge){return function(){return fe()[ge]}})}function F(fe,xe,ge){return typeof fe=="function"?M(fe.bind(null,xe,ge)):m.a.Ga(fe,w)}function V(fe,xe){return M(this.getBindings.bind(this,fe,xe))}function B(fe,xe){var ge=m.h.firstChild(xe);if(ge){var we,Se=m.ga.instance,Re=Se.preprocessNode;if(Re){for(;we=ge;)ge=m.h.nextSibling(we),Re.call(Se,we);ge=m.h.firstChild(xe)}for(;we=ge;)ge=m.h.nextSibling(we),j(fe,we)}m.i.ma(xe,m.i.H)}function j(fe,xe){var ge=fe,we=xe.nodeType===1;we&&m.h.Sc(xe),(we||m.ga.instance.nodeHasBindings(xe))&&(ge=G(xe,null,fe).bindingContextForDescendants),ge&&!Z[m.a.R(xe)]&&B(ge,xe)}function k(fe){var xe=[],ge={},we=[];return m.a.P(fe,function Se(Re){if(!ge[Re]){var Qe=m.getBindingHandler(Re);Qe&&(Qe.after&&(we.push(Re),m.a.D(Qe.after,function(He){if(fe[He]){if(m.a.A(we,He)!==-1)throw Error("Cannot combine the following bindings, because they have a cyclic dependency: "+we.join(", "));Se(He)}}),we.length--),xe.push({key:Re,Mc:Qe})),ge[Re]=!0}}),xe}function G(fe,xe,ge){var we=m.a.g.Ub(fe,Ae,{}),Se=we.hd;if(!xe){if(Se)throw Error("You cannot apply bindings multiple times to the same element.");we.hd=!0}Se||(we.context=ge),we.Zb||(we.Zb={});var Re;if(xe&&typeof xe!="function")Re=xe;else{var Qe=m.ga.instance,He=Qe.getBindingAccessors||V,Xe=m.$(function(){return(Re=xe?xe(ge,fe):He.call(Qe,fe,ge))&&(ge[Q]&&ge[Q](),ge[J]&&ge[J]()),Re},null,{l:fe});Re&&Xe.ja()||(Xe=null)}var $e=ge,Pe;if(Re){var qe=function(){return m.a.Ga(Xe?Xe():Re,P)},st=Xe?function(vt){return function(){return P(Xe()[vt])}}:function(vt){return Re[vt]};qe.get=function(vt){return Re[vt]&&P(st(vt))},qe.has=function(vt){return vt in Re},m.i.H in Re&&m.i.subscribe(fe,m.i.H,function(){var vt=(0,Re[m.i.H])();if(vt){var Gt=m.h.childNodes(fe);Gt.length&&vt(Gt,m.Ec(Gt[0]))}}),m.i.pa in Re&&($e=m.i.Cb(fe,ge),m.i.subscribe(fe,m.i.pa,function(){var vt=(0,Re[m.i.pa])();vt&&m.h.firstChild(fe)&&vt(fe)})),we=k(Re),m.a.D(we,function(vt){var Gt=vt.Mc.init,lt=vt.Mc.update,mt=vt.key;if(fe.nodeType===8&&!m.h.ea[mt])throw Error("The binding '"+mt+"' cannot be used with virtual elements");try{typeof Gt=="function"&&m.u.G(function(){var ft=Gt(fe,st(mt),qe,$e.$data,$e);if(ft&&ft.controlsDescendantBindings){if(Pe!==e)throw Error("Multiple bindings ("+Pe+" and "+mt+") are trying to control descendant bindings of the same element. You cannot use these bindings together on the same element.");Pe=mt}}),typeof lt=="function"&&m.$(function(){lt(fe,st(mt),qe,$e.$data,$e)},null,{l:fe})}catch(ft){throw ft.message='Unable to process binding "'+mt+": "+Re[mt]+`" -Message: `+ft.message,ft}})}return we=Pe===e,{shouldBindDescendants:we,bindingContextForDescendants:we&&$e}}function q(fe,xe){return fe&&fe instanceof m.fa?fe:new m.fa(fe,e,e,xe)}var Q=m.a.Da("_subscribable"),W=m.a.Da("_ancestorBindingInfo"),J=m.a.Da("_dataDependency");m.c={};var Z={script:!0,textarea:!0,template:!0};m.getBindingHandler=function(fe){return m.c[fe]};var ae={};m.fa=function(fe,xe,ge,we,Se){function Re(){var st=$e?Xe():Xe,vt=m.a.f(st);return xe?(m.a.extend(Qe,xe),W in xe&&(Qe[W]=xe[W])):(Qe.$parents=[],Qe.$root=vt,Qe.ko=m),Qe[Q]=Pe,He?vt=Qe.$data:(Qe.$rawData=st,Qe.$data=vt),ge&&(Qe[ge]=vt),we&&we(Qe,xe,vt),xe&&xe[Q]&&!m.S.o().Vb(xe[Q])&&xe[Q](),qe&&(Qe[J]=qe),Qe.$data}var Qe=this,He=fe===ae,Xe=He?e:fe,$e=typeof Xe=="function"&&!m.O(Xe),Pe,qe=Se&&Se.dataDependency;Se&&Se.exportDependencies?Re():(Pe=m.xb(Re),Pe.v(),Pe.ja()?Pe.equalityComparer=null:Qe[Q]=e)},m.fa.prototype.createChildContext=function(fe,xe,ge,we){if(!we&&xe&&typeof xe=="object"&&(we=xe,xe=we.as,ge=we.extend),xe&&we&&we.noChildContext){var Se=typeof fe=="function"&&!m.O(fe);return new m.fa(ae,this,null,function(Re){ge&&ge(Re),Re[xe]=Se?fe():fe},we)}return new m.fa(fe,this,xe,function(Re,Qe){Re.$parentContext=Qe,Re.$parent=Qe.$data,Re.$parents=(Qe.$parents||[]).slice(0),Re.$parents.unshift(Re.$parent),ge&&ge(Re)},we)},m.fa.prototype.extend=function(fe,xe){return new m.fa(ae,this,null,function(ge){m.a.extend(ge,typeof fe=="function"?fe(ge):fe)},xe)};var Ae=m.a.g.Z();C.prototype.Tc=function(){this.Kb&&this.Kb.N&&this.Kb.N.sd(this.node)},C.prototype.sd=function(fe){m.a.Pa(this.kb,fe),!this.kb.length&&this.H&&this.Cc()},C.prototype.Cc=function(){this.H=!0,this.yc.N&&!this.kb.length&&(this.yc.N=null,m.a.K.yb(this.node,_),m.i.ma(this.node,m.i.pa),this.Tc())},m.i={H:"childrenComplete",pa:"descendantsComplete",subscribe:function(fe,xe,ge,we,Se){var Re=m.a.g.Ub(fe,Ae,{});return Re.Fa||(Re.Fa=new m.T),Se&&Se.notifyImmediately&&Re.Zb[xe]&&m.u.G(ge,we,[fe]),Re.Fa.subscribe(ge,we,xe)},ma:function(fe,xe){var ge=m.a.g.get(fe,Ae);if(ge&&(ge.Zb[xe]=!0,ge.Fa&&ge.Fa.notifySubscribers(fe,xe),xe==m.i.H)){if(ge.N)ge.N.Cc();else if(ge.N===e&&ge.Fa&&ge.Fa.Wa(m.i.pa))throw Error("descendantsComplete event not supported for bindings on this node")}},Cb:function(fe,xe){var ge=m.a.g.Ub(fe,Ae,{});return ge.N||(ge.N=new C(fe,ge,xe[W])),xe[W]==ge?xe:xe.extend(function(we){we[W]=ge})}},m.Td=function(fe){return(fe=m.a.g.get(fe,Ae))&&fe.context},m.ib=function(fe,xe,ge){return fe.nodeType===1&&m.h.Sc(fe),G(fe,xe,q(ge))},m.ld=function(fe,xe,ge){return ge=q(ge),m.ib(fe,F(xe,ge,fe),ge)},m.Oa=function(fe,xe){xe.nodeType!==1&&xe.nodeType!==8||B(q(fe),xe)},m.vc=function(fe,xe,ge){if(!r&&t.jQuery&&(r=t.jQuery),2>arguments.length){if(xe=n.body,!xe)throw Error("ko.applyBindings: could not find document.body; has the document been loaded?")}else if(!xe||xe.nodeType!==1&&xe.nodeType!==8)throw Error("ko.applyBindings: first parameter should be your view model; second parameter should be a DOM node");j(q(fe,ge),xe)},m.Dc=function(fe){return!fe||fe.nodeType!==1&&fe.nodeType!==8?e:m.Td(fe)},m.Ec=function(fe){return(fe=m.Dc(fe))?fe.$data:e},m.b("bindingHandlers",m.c),m.b("bindingEvent",m.i),m.b("bindingEvent.subscribe",m.i.subscribe),m.b("bindingEvent.startPossiblyAsyncContentBinding",m.i.Cb),m.b("applyBindings",m.vc),m.b("applyBindingsToDescendants",m.Oa),m.b("applyBindingAccessorsToNode",m.ib),m.b("applyBindingsToNode",m.ld),m.b("contextFor",m.Dc),m.b("dataFor",m.Ec)})(),(function(_){function C(V,B){var j=Object.prototype.hasOwnProperty.call(M,V)?M[V]:_,k;j?j.subscribe(B):(j=M[V]=new m.T,j.subscribe(B),w(V,function(G,q){var Q=!(!q||!q.synchronous);F[V]={definition:G,Gd:Q},delete M[V],k||Q?j.notifySubscribers(G):m.na.zb(function(){j.notifySubscribers(G)})}),k=!0)}function w(V,B){P("getConfig",[V],function(j){j?P("loadComponent",[V,j],function(k){B(k,j)}):B(null,null)})}function P(V,B,j,k){k||(k=m.j.loaders.slice(0));var G=k.shift();if(G){var q=G[V];if(q){var Q=!1;if(q.apply(G,B.concat(function(W){Q?j(null):W!==null?j(W):P(V,B,j,k)}))!==_&&(Q=!0,!G.suppressLoaderExceptions))throw Error("Component loaders must supply values by invoking the callback, not by returning values synchronously.")}else P(V,B,j,k)}else j(null)}var M={},F={};m.j={get:function(V,B){var j=Object.prototype.hasOwnProperty.call(F,V)?F[V]:_;j?j.Gd?m.u.G(function(){B(j.definition)}):m.na.zb(function(){B(j.definition)}):C(V,B)},Bc:function(V){delete F[V]},oc:P},m.j.loaders=[],m.b("components",m.j),m.b("components.get",m.j.get),m.b("components.clearCachedDefinition",m.j.Bc)})(),(function(){function _(j,k,G,q){function Q(){--J===0&&q(W)}var W={},J=2,Z=G.template;G=G.viewModel,Z?M(k,Z,function(ae){m.j.oc("loadTemplate",[j,ae],function(Ae){W.template=Ae,Q()})}):Q(),G?M(k,G,function(ae){m.j.oc("loadViewModel",[j,ae],function(Ae){W[B]=Ae,Q()})}):Q()}function C(j,k,G){if(typeof k=="function")G(function(Q){return new k(Q)});else if(typeof k[B]=="function")G(k[B]);else if("instance"in k){var q=k.instance;G(function(){return q})}else"viewModel"in k?C(j,k.viewModel,G):j("Unknown viewModel value: "+k)}function w(j){switch(m.a.R(j)){case"script":return m.a.ua(j.text);case"textarea":return m.a.ua(j.value);case"template":if(P(j.content))return m.a.Ca(j.content.childNodes)}return m.a.Ca(j.childNodes)}function P(j){return t.DocumentFragment?j instanceof DocumentFragment:j&&j.nodeType===11}function M(j,k,G){typeof k.require=="string"?a||t.require?(a||t.require)([k.require],function(q){q&&typeof q=="object"&&q.Xd&&q.default&&(q=q.default),G(q)}):j("Uses require, but no AMD loader is present"):G(k)}function F(j){return function(k){throw Error("Component '"+j+"': "+k)}}var V={};m.j.register=function(j,k){if(!k)throw Error("Invalid configuration for "+j);if(m.j.tb(j))throw Error("Component "+j+" is already registered");V[j]=k},m.j.tb=function(j){return Object.prototype.hasOwnProperty.call(V,j)},m.j.unregister=function(j){delete V[j],m.j.Bc(j)},m.j.Fc={getConfig:function(j,k){k(m.j.tb(j)?V[j]:null)},loadComponent:function(j,k,G){var q=F(j);M(q,k,function(Q){_(j,q,Q,G)})},loadTemplate:function(j,k,G){if(j=F(j),typeof k=="string")G(m.a.ua(k));else if(k instanceof Array)G(k);else if(P(k))G(m.a.la(k.childNodes));else if(k.element)if(k=k.element,t.HTMLElement?k instanceof HTMLElement:k&&k.tagName&&k.nodeType===1)G(w(k));else if(typeof k=="string"){var q=n.getElementById(k);q?G(w(q)):j("Cannot find element with ID "+k)}else j("Unknown element type: "+k);else j("Unknown template value: "+k)},loadViewModel:function(j,k,G){C(F(j),k,G)}};var B="createViewModel";m.b("components.register",m.j.register),m.b("components.isRegistered",m.j.tb),m.b("components.unregister",m.j.unregister),m.b("components.defaultLoader",m.j.Fc),m.j.loaders.push(m.j.Fc),m.j.dd=V})(),(function(){function _(w,P){var M=w.getAttribute("params");if(M){var M=C.parseBindingsString(M,P,w,{valueAccessors:!0,bindingParams:!0}),M=m.a.Ga(M,function(B){return m.o(B,null,{l:w})}),F=m.a.Ga(M,function(B){var j=B.v();return B.ja()?m.o({read:function(){return m.a.f(B())},write:m.Za(j)&&function(k){B()(k)},l:w}):j});return Object.prototype.hasOwnProperty.call(F,"$raw")||(F.$raw=M),F}return{$raw:{}}}m.j.getComponentNameForNode=function(w){var P=m.a.R(w);if(m.j.tb(P)&&(P.indexOf("-")!=-1||""+w=="[object HTMLUnknownElement]"||8>=m.a.W&&w.tagName===P))return P},m.j.tc=function(w,P,M,F){if(P.nodeType===1){var V=m.j.getComponentNameForNode(P);if(V){if(w=w||{},w.component)throw Error('Cannot use the "component" binding on a custom element matching a component');var B={name:V,params:_(P,M)};w.component=F?function(){return B}:B}}return w};var C=new m.ga;9>m.a.W&&(m.j.register=(function(w){return function(P){return w.apply(this,arguments)}})(m.j.register),n.createDocumentFragment=(function(w){return function(){var P=w(),M=m.j.dd,F;for(F in M);return P}})(n.createDocumentFragment))})(),(function(){function _(P,M,F){if(M=M.template,!M)throw Error("Component '"+P+"' has no template");P=m.a.Ca(M),m.h.va(F,P)}function C(P,M,F){var V=P.createViewModel;return V?V.call(P,M,F):M}var w=0;m.c.component={init:function(P,M,F,V,B){function j(){var W=k&&k.dispose;typeof W=="function"&&W.call(k),q&&q.s(),G=k=q=null}var k,G,q,Q=m.a.la(m.h.childNodes(P));return m.h.Ea(P),m.a.K.za(P,j),m.o(function(){var W=m.a.f(M()),J,Z;if(typeof W=="string"?J=W:(J=m.a.f(W.name),Z=m.a.f(W.params)),!J)throw Error("No component name specified");var ae=m.i.Cb(P,B),Ae=G=++w;m.j.get(J,function(fe){if(G===Ae){if(j(),!fe)throw Error("Unknown component '"+J+"'");_(J,fe,P);var xe=C(fe,Z,{element:P,templateNodes:Q});fe=ae.createChildContext(xe,{extend:function(ge){ge.$component=xe,ge.$componentTemplateNodes=Q}}),xe&&xe.koDescendantsComplete&&(q=m.i.subscribe(P,m.i.pa,xe.koDescendantsComplete,xe)),k=xe,m.Oa(fe,P)}})},null,{l:P}),{controlsDescendantBindings:!0}}},m.h.ea.component=!0})();var O={class:"className",for:"htmlFor"};m.c.attr={update:function(_,C){var w=m.a.f(C())||{};m.a.P(w,function(P,M){M=m.a.f(M);var F=P.indexOf(":"),F="lookupNamespaceURI"in _&&0<F&&_.lookupNamespaceURI(P.substr(0,F)),V=M===!1||M===null||M===e;V?F?_.removeAttributeNS(F,P):_.removeAttribute(P):M=M.toString(),8>=m.a.W&&P in O?(P=O[P],V?_.removeAttribute(P):_[P]=M):V||(F?_.setAttributeNS(F,P,M):_.setAttribute(P,M)),P==="name"&&m.a.Yc(_,V?"":M)})}},(function(){m.c.checked={after:["value","attr"],init:function(_,C,w){function P(){var W=_.checked,J=F();if(!m.S.Ya()&&(W||!B&&!m.S.qa())){var Z=m.u.G(C);if(k){var ae=G?Z.v():Z,Ae=Q;Q=J,Ae!==J?W&&(m.a.Na(ae,J,!0),m.a.Na(ae,Ae,!1)):m.a.Na(ae,J,W),G&&m.Za(Z)&&Z(ae)}else V&&(J===e?J=W:W||(J=e)),m.m.eb(Z,w,"checked",J,!0)}}function M(){var W=m.a.f(C()),J=F();k?(_.checked=0<=m.a.A(W,J),Q=J):_.checked=V&&J===e?!!W:F()===W}var F=m.xb(function(){if(w.has("checkedValue"))return m.a.f(w.get("checkedValue"));if(q)return w.has("value")?m.a.f(w.get("value")):_.value}),V=_.type=="checkbox",B=_.type=="radio";if(V||B){var j=C(),k=V&&m.a.f(j)instanceof Array,G=!(k&&j.push&&j.splice),q=B||k,Q=k?F():e;B&&!_.name&&m.c.uniqueName.init(_,function(){return!0}),m.o(P,null,{l:_}),m.a.B(_,"click",P),m.o(M,null,{l:_}),j=e}}},m.m.wa.checked=!0,m.c.checkedValue={update:function(_,C){_.value=m.a.f(C())}}})(),m.c.class={update:function(_,C){var w=m.a.Db(m.a.f(C()));m.a.Eb(_,_.__ko__cssValue,!1),_.__ko__cssValue=w,m.a.Eb(_,w,!0)}},m.c.css={update:function(_,C){var w=m.a.f(C());w!==null&&typeof w=="object"?m.a.P(w,function(P,M){M=m.a.f(M),m.a.Eb(_,P,M)}):m.c.class.update(_,C)}},m.c.enable={update:function(_,C){var w=m.a.f(C());w&&_.disabled?_.removeAttribute("disabled"):w||_.disabled||(_.disabled=!0)}},m.c.disable={update:function(_,C){m.c.enable.update(_,function(){return!m.a.f(C())})}},m.c.event={init:function(_,C,w,P,M){var F=C()||{};m.a.P(F,function(V){typeof V=="string"&&m.a.B(_,V,function(B){var j,k=C()[V];if(k){try{var G=m.a.la(arguments);P=M.$data,G.unshift(P),j=k.apply(P,G)}finally{j!==!0&&(B.preventDefault?B.preventDefault():B.returnValue=!1)}w.get(V+"Bubble")===!1&&(B.cancelBubble=!0,B.stopPropagation&&B.stopPropagation())}})})}},m.c.foreach={Rc:function(_){return function(){var C=_(),w=m.a.bc(C);return!w||typeof w.length=="number"?{foreach:C,templateEngine:m.ba.Ma}:(m.a.f(C),{foreach:w.data,as:w.as,noChildContext:w.noChildContext,includeDestroyed:w.includeDestroyed,afterAdd:w.afterAdd,beforeRemove:w.beforeRemove,afterRender:w.afterRender,beforeMove:w.beforeMove,afterMove:w.afterMove,templateEngine:m.ba.Ma})}},init:function(_,C){return m.c.template.init(_,m.c.foreach.Rc(C))},update:function(_,C,w,P,M){return m.c.template.update(_,m.c.foreach.Rc(C),w,P,M)}},m.m.Ra.foreach=!1,m.h.ea.foreach=!0,m.c.hasfocus={init:function(_,C,w){function P(V){_.__ko_hasfocusUpdating=!0;var B=_.ownerDocument;if("activeElement"in B){var j;try{j=B.activeElement}catch{j=B.body}V=j===_}B=C(),m.m.eb(B,w,"hasfocus",V,!0),_.__ko_hasfocusLastValue=V,_.__ko_hasfocusUpdating=!1}var M=P.bind(null,!0),F=P.bind(null,!1);m.a.B(_,"focus",M),m.a.B(_,"focusin",M),m.a.B(_,"blur",F),m.a.B(_,"focusout",F),_.__ko_hasfocusLastValue=!1},update:function(_,C){var w=!!m.a.f(C());_.__ko_hasfocusUpdating||_.__ko_hasfocusLastValue===w||(w?_.focus():_.blur(),!w&&_.__ko_hasfocusLastValue&&_.ownerDocument.body.focus(),m.u.G(m.a.Fb,null,[_,w?"focusin":"focusout"]))}},m.m.wa.hasfocus=!0,m.c.hasFocus=m.c.hasfocus,m.m.wa.hasFocus="hasfocus",m.c.html={init:function(){return{controlsDescendantBindings:!0}},update:function(_,C){m.a.fc(_,C())}},(function(){function _(C,w,P){m.c[C]={init:function(M,F,V,B,j){var k,G,q={},Q,W,J;if(w){B=V.get("as");var Z=V.get("noChildContext");J=!(B&&Z),q={as:B,noChildContext:Z,exportDependencies:J}}return W=(Q=V.get("completeOn")=="render")||V.has(m.i.pa),m.o(function(){var ae=m.a.f(F()),Ae=!P!=!ae,fe=!G,xe;(J||Ae!==k)&&(W&&(j=m.i.Cb(M,j)),Ae&&((!w||J)&&(q.dataDependency=m.S.o()),xe=w?j.createChildContext(typeof ae=="function"?ae:F,q):m.S.qa()?j.extend(null,q):j),fe&&m.S.qa()&&(G=m.a.Ca(m.h.childNodes(M),!0)),Ae?(fe||m.h.va(M,m.a.Ca(G)),m.Oa(xe,M)):(m.h.Ea(M),Q||m.i.ma(M,m.i.H)),k=Ae)},null,{l:M}),{controlsDescendantBindings:!0}}},m.m.Ra[C]=!1,m.h.ea[C]=!0}_("if"),_("ifnot",!1,!0),_("with",!0)})(),m.c.let={init:function(_,C,w,P,M){return C=M.extend(C),m.Oa(C,_),{controlsDescendantBindings:!0}}},m.h.ea.let=!0;var L={};m.c.options={init:function(_){if(m.a.R(_)!=="select")throw Error("options binding applies only to SELECT elements");for(;0<_.length;)_.remove(0);return{controlsDescendantBindings:!0}},update:function(_,C,w){function P(){return m.a.jb(_.options,function(Z){return Z.selected})}function M(Z,ae,Ae){var fe=typeof ae;return fe=="function"?ae(Z):fe=="string"?Z[ae]:Ae}function F(Z,ae){if(W&&k)m.i.ma(_,m.i.H);else if(Q.length){var Ae=0<=m.a.A(Q,m.w.M(ae[0]));m.a.Zc(ae[0],Ae),W&&!Ae&&m.u.G(m.a.Fb,null,[_,"change"])}}var V=_.multiple,B=_.length!=0&&V?_.scrollTop:null,j=m.a.f(C()),k=w.get("valueAllowUnset")&&w.has("value"),G=w.get("optionsIncludeDestroyed");C={};var q,Q=[];k||(V?Q=m.a.Mb(P(),m.w.M):0<=_.selectedIndex&&Q.push(m.w.M(_.options[_.selectedIndex]))),j&&(typeof j.length>"u"&&(j=[j]),q=m.a.jb(j,function(Z){return G||Z===e||Z===null||!m.a.f(Z._destroy)}),w.has("optionsCaption")&&(j=m.a.f(w.get("optionsCaption")),j!==null&&j!==e&&q.unshift(L)));var W=!1;if(C.beforeRemove=function(Z){_.removeChild(Z)},j=F,w.has("optionsAfterRender")&&typeof w.get("optionsAfterRender")=="function"&&(j=function(Z,ae){F(0,ae),m.u.G(w.get("optionsAfterRender"),null,[ae[0],Z!==L?Z:e])}),m.a.ec(_,q,function(Z,ae,Ae){return Ae.length&&(Q=!k&&Ae[0].selected?[m.w.M(Ae[0])]:[],W=!0),ae=_.ownerDocument.createElement("option"),Z===L?(m.a.Bb(ae,w.get("optionsCaption")),m.w.cb(ae,e)):(Ae=M(Z,w.get("optionsValue"),Z),m.w.cb(ae,m.a.f(Ae)),Z=M(Z,w.get("optionsText"),Ae),m.a.Bb(ae,Z)),[ae]},C,j),!k){var J;V?J=Q.length&&P().length<Q.length:J=Q.length&&0<=_.selectedIndex?m.w.M(_.options[_.selectedIndex])!==Q[0]:Q.length||0<=_.selectedIndex,J&&m.u.G(m.a.Fb,null,[_,"change"])}(k||m.S.Ya())&&m.i.ma(_,m.i.H),m.a.wd(_),B&&20<Math.abs(B-_.scrollTop)&&(_.scrollTop=B)}},m.c.options.$b=m.a.g.Z(),m.c.selectedOptions={init:function(_,C,w){function P(){var V=C(),B=[];m.a.D(_.getElementsByTagName("option"),function(j){j.selected&&B.push(m.w.M(j))}),m.m.eb(V,w,"selectedOptions",B)}function M(){var V=m.a.f(C()),B=_.scrollTop;V&&typeof V.length=="number"&&m.a.D(_.getElementsByTagName("option"),function(j){var k=0<=m.a.A(V,m.w.M(j));j.selected!=k&&m.a.Zc(j,k)}),_.scrollTop=B}if(m.a.R(_)!="select")throw Error("selectedOptions binding applies only to SELECT elements");var F;m.i.subscribe(_,m.i.H,function(){F?P():(m.a.B(_,"change",P),F=m.o(M,null,{l:_}))},null,{notifyImmediately:!0})},update:function(){}},m.m.wa.selectedOptions=!0,m.c.style={update:function(_,C){var w=m.a.f(C()||{});m.a.P(w,function(P,M){if(M=m.a.f(M),(M===null||M===e||M===!1)&&(M=""),r)r(_).css(P,M);else if(/^--/.test(P))_.style.setProperty(P,M);else{P=P.replace(/-(\w)/g,function(V,B){return B.toUpperCase()});var F=_.style[P];_.style[P]=M,M===F||_.style[P]!=F||isNaN(M)||(_.style[P]=M+"px")}})}},m.c.submit={init:function(_,C,w,P,M){if(typeof C()!="function")throw Error("The value for a submit binding must be a function");m.a.B(_,"submit",function(F){var V,B=C();try{V=B.call(M.$data,_)}finally{V!==!0&&(F.preventDefault?F.preventDefault():F.returnValue=!1)}})}},m.c.text={init:function(){return{controlsDescendantBindings:!0}},update:function(_,C){m.a.Bb(_,C())}},m.h.ea.text=!0,(function(){if(t&&t.navigator){var _=function(q){if(q)return parseFloat(q[1])},C=t.navigator.userAgent,w,P,M,F,V;(w=t.opera&&t.opera.version&&parseInt(t.opera.version()))||(V=_(C.match(/Edge\/([^ ]+)$/)))||_(C.match(/Chrome\/([^ ]+)/))||(P=_(C.match(/Version\/([^ ]+) Safari/)))||(M=_(C.match(/Firefox\/([^ ]+)/)))||(F=m.a.W||_(C.match(/MSIE ([^ ]+)/)))||(F=_(C.match(/rv:([^ )]+)/)))}if(8<=F&&10>F)var B=m.a.g.Z(),j=m.a.g.Z(),k=function(q){var Q=this.activeElement;(Q=Q&&m.a.g.get(Q,j))&&Q(q)},G=function(q,Q){var W=q.ownerDocument;m.a.g.get(W,B)||(m.a.g.set(W,B,!0),m.a.B(W,"selectionchange",k)),m.a.g.set(q,j,Q)};m.c.textInput={init:function(q,Q,W){function J(Re,Qe){m.a.B(q,Re,Qe)}function Z(){var Re=m.a.f(Q());(Re===null||Re===e)&&(Re=""),ge!==e&&Re===ge?m.a.setTimeout(Z,4):q.value!==Re&&(Se=!0,q.value=Re,Se=!1,fe=q.value)}function ae(){xe||(ge=q.value,xe=m.a.setTimeout(Ae,4))}function Ae(){clearTimeout(xe),ge=xe=e;var Re=q.value;fe!==Re&&(fe=Re,m.m.eb(Q(),W,"textInput",Re))}var fe=q.value,xe,ge,we=m.a.W==9?ae:Ae,Se=!1;F&&J("keypress",Ae),11>F&&J("propertychange",function(Re){Se||Re.propertyName!=="value"||we(Re)}),F==8&&(J("keyup",Ae),J("keydown",Ae)),G&&(G(q,we),J("dragend",ae)),(!F||9<=F)&&J("input",we),5>P&&m.a.R(q)==="textarea"?(J("keydown",ae),J("paste",ae),J("cut",ae)):11>w?J("keydown",ae):4>M?(J("DOMAutoComplete",Ae),J("dragdrop",Ae),J("drop",Ae)):V&&q.type==="number"&&J("keydown",ae),J("change",Ae),J("blur",Ae),m.o(Z,null,{l:q})}},m.m.wa.textInput=!0,m.c.textinput={preprocess:function(q,Q,W){W("textInput",q)}}})(),m.c.uniqueName={init:function(_,C){if(C()){var w="ko_unique_"+ ++m.c.uniqueName.rd;m.a.Yc(_,w)}}},m.c.uniqueName.rd=0,m.c.using={init:function(_,C,w,P,M){var F;return w.has("as")&&(F={as:w.get("as"),noChildContext:w.get("noChildContext")}),C=M.createChildContext(C,F),m.Oa(C,_),{controlsDescendantBindings:!0}}},m.h.ea.using=!0,m.c.value={init:function(_,C,w){var P=m.a.R(_),M=P=="input";if(!M||_.type!="checkbox"&&_.type!="radio"){var F=[],V=w.get("valueUpdate"),B=!1,j=null;V&&(typeof V=="string"?F=[V]:F=m.a.wc(V),m.a.Pa(F,"change"));var k=function(){j=null,B=!1;var Q=C(),W=m.w.M(_);m.m.eb(Q,w,"value",W)};!m.a.W||!M||_.type!="text"||_.autocomplete=="off"||_.form&&_.form.autocomplete=="off"||m.a.A(F,"propertychange")!=-1||(m.a.B(_,"propertychange",function(){B=!0}),m.a.B(_,"focus",function(){B=!1}),m.a.B(_,"blur",function(){B&&k()})),m.a.D(F,function(Q){var W=k;m.a.Ud(Q,"after")&&(W=function(){j=m.w.M(_),m.a.setTimeout(k,0)},Q=Q.substring(5)),m.a.B(_,Q,W)});var G;if(G=M&&_.type=="file"?function(){var Q=m.a.f(C());Q===null||Q===e||Q===""?_.value="":m.u.G(k)}:function(){var Q=m.a.f(C()),W=m.w.M(_);j!==null&&Q===j?m.a.setTimeout(G,0):(Q!==W||W===e)&&(P==="select"?(W=w.get("valueAllowUnset"),m.w.cb(_,Q,W),W||Q===m.w.M(_)||m.u.G(k)):m.w.cb(_,Q))},P==="select"){var q;m.i.subscribe(_,m.i.H,function(){q?w.get("valueAllowUnset")?G():k():(m.a.B(_,"change",k),q=m.o(G,null,{l:_}))},null,{notifyImmediately:!0})}else m.a.B(_,"change",k),m.o(G,null,{l:_})}else m.ib(_,{checkedValue:C})},update:function(){}},m.m.wa.value=!0,m.c.visible={update:function(_,C){var w=m.a.f(C()),P=_.style.display!="none";w&&!P?_.style.display="":!w&&P&&(_.style.display="none")}},m.c.hidden={update:function(_,C){m.c.visible.update(_,function(){return!m.a.f(C())})}},(function(_){m.c[_]={init:function(C,w,P,M,F){return m.c.event.init.call(this,C,function(){var V={};return V[_]=w(),V},P,M,F)}}})("click"),m.ca=function(){},m.ca.prototype.renderTemplateSource=function(){throw Error("Override renderTemplateSource")},m.ca.prototype.createJavaScriptEvaluatorBlock=function(){throw Error("Override createJavaScriptEvaluatorBlock")},m.ca.prototype.makeTemplateSource=function(_,C){if(typeof _=="string"){C=C||n;var w=C.getElementById(_);if(!w)throw Error("Cannot find template with ID "+_);return new m.C.F(w)}if(_.nodeType==1||_.nodeType==8)return new m.C.ia(_);throw Error("Unknown template type: "+_)},m.ca.prototype.renderTemplate=function(_,C,w,P){return _=this.makeTemplateSource(_,P),this.renderTemplateSource(_,C,w,P)},m.ca.prototype.isTemplateRewritten=function(_,C){return this.allowTemplateRewriting===!1?!0:this.makeTemplateSource(_,C).data("isRewritten")},m.ca.prototype.rewriteTemplate=function(_,C,w){_=this.makeTemplateSource(_,w),C=C(_.text()),_.text(C),_.data("isRewritten",!0)},m.b("templateEngine",m.ca),m.kc=(function(){function _(P,M,F,V){P=m.m.ac(P);for(var B=m.m.Ra,j=0;j<P.length;j++){var k=P[j].key;if(Object.prototype.hasOwnProperty.call(B,k)){var G=B[k];if(typeof G=="function"){if(k=G(P[j].value))throw Error(k)}else if(!G)throw Error("This template engine does not support the '"+k+"' binding within its templates")}}return F="ko.__tr_ambtns(function($context,$element){return(function(){return{ "+m.m.vb(P,{valueAccessors:!0})+" } })()},'"+F.toLowerCase()+"')",V.createJavaScriptEvaluatorBlock(F)+M}var C=/(<([a-z]+\d*)(?:\s+(?!data-bind\s*=\s*)[a-z0-9\-]+(?:=(?:\"[^\"]*\"|\'[^\']*\'|[^>]*))?)*\s+)data-bind\s*=\s*(["'])([\s\S]*?)\3/gi,w=/\x3c!--\s*ko\b\s*([\s\S]*?)\s*--\x3e/g;return{xd:function(P,M,F){M.isTemplateRewritten(P,F)||M.rewriteTemplate(P,function(V){return m.kc.Ld(V,M)},F)},Ld:function(P,M){return P.replace(C,function(F,V,B,j,k){return _(k,V,B,M)}).replace(w,function(F,V){return _(V,"<!-- ko -->","#comment",M)})},md:function(P,M){return m.aa.Xb(function(F,V){var B=F.nextSibling;B&&B.nodeName.toLowerCase()===M&&m.ib(B,P,V)})}}})(),m.b("__tr_ambtns",m.kc.md),(function(){m.C={},m.C.F=function(w){if(this.F=w){var P=m.a.R(w);this.ab=P==="script"?1:P==="textarea"?2:P=="template"&&w.content&&w.content.nodeType===11?3:4}},m.C.F.prototype.text=function(){var w=this.ab===1?"text":this.ab===2?"value":"innerHTML";if(arguments.length==0)return this.F[w];var P=arguments[0];w==="innerHTML"?m.a.fc(this.F,P):this.F[w]=P};var _=m.a.g.Z()+"_";m.C.F.prototype.data=function(w){if(arguments.length===1)return m.a.g.get(this.F,_+w);m.a.g.set(this.F,_+w,arguments[1])};var C=m.a.g.Z();m.C.F.prototype.nodes=function(){var w=this.F;if(arguments.length==0){var P=m.a.g.get(w,C)||{},M=P.lb||(this.ab===3?w.content:this.ab===4?w:e);if(!M||P.jd){var F=this.text();F&&F!==P.bb&&(M=m.a.Md(F,w.ownerDocument),m.a.g.set(w,C,{lb:M,bb:F,jd:!0}))}return M}P=arguments[0],this.ab!==e&&this.text(""),m.a.g.set(w,C,{lb:P})},m.C.ia=function(w){this.F=w},m.C.ia.prototype=new m.C.F,m.C.ia.prototype.constructor=m.C.ia,m.C.ia.prototype.text=function(){if(arguments.length==0){var w=m.a.g.get(this.F,C)||{};return w.bb===e&&w.lb&&(w.bb=w.lb.innerHTML),w.bb}m.a.g.set(this.F,C,{bb:arguments[0]})},m.b("templateSources",m.C),m.b("templateSources.domElement",m.C.F),m.b("templateSources.anonymousTemplate",m.C.ia)})(),(function(){function _(j,k,G){var q;for(k=m.h.nextSibling(k);j&&(q=j)!==k;)j=m.h.nextSibling(q),G(q,j)}function C(j,k){if(j.length){var G=j[0],q=j[j.length-1],Q=G.parentNode,W=m.ga.instance,J=W.preprocessNode;if(J){if(_(G,q,function(Z,ae){var Ae=Z.previousSibling,fe=J.call(W,Z);fe&&(Z===G&&(G=fe[0]||ae),Z===q&&(q=fe[fe.length-1]||Ae))}),j.length=0,!G)return;G===q?j.push(G):(j.push(G,q),m.a.Ua(j,Q))}_(G,q,function(Z){Z.nodeType!==1&&Z.nodeType!==8||m.vc(k,Z)}),_(G,q,function(Z){Z.nodeType!==1&&Z.nodeType!==8||m.aa.cd(Z,[k])}),m.a.Ua(j,Q)}}function w(j){return j.nodeType?j:0<j.length?j[0]:null}function P(j,k,G,q,Q){Q=Q||{};var W=(j&&w(j)||G||{}).ownerDocument,J=Q.templateEngine||F;if(m.kc.xd(G,J,W),G=J.renderTemplate(G,q,Q,W),typeof G.length!="number"||0<G.length&&typeof G[0].nodeType!="number")throw Error("Template engine must return an array of DOM nodes");switch(W=!1,k){case"replaceChildren":m.h.va(j,G),W=!0;break;case"replaceNode":m.a.Xc(j,G),W=!0;break;case"ignoreTargetNode":break;default:throw Error("Unknown renderMode: "+k)}return W&&(C(G,q),Q.afterRender&&m.u.G(Q.afterRender,null,[G,q[Q.as||"$data"]]),k=="replaceChildren"&&m.i.ma(j,m.i.H)),G}function M(j,k,G){return m.O(j)?j():typeof j=="function"?j(k,G):j}var F;m.gc=function(j){if(j!=e&&!(j instanceof m.ca))throw Error("templateEngine must inherit from ko.templateEngine");F=j},m.dc=function(j,k,G,q,Q){if(G=G||{},(G.templateEngine||F)==e)throw Error("Set a template engine before calling renderTemplate");if(Q=Q||"replaceChildren",q){var W=w(q);return m.$(function(){var Z=k&&k instanceof m.fa?k:new m.fa(k,null,null,null,{exportDependencies:!0}),J=M(j,Z.$data,Z),Z=P(q,Q,J,Z,G);Q=="replaceNode"&&(q=Z,W=w(q))},null,{Sa:function(){return!W||!m.a.Sb(W)},l:W&&Q=="replaceNode"?W.parentNode:W})}return m.aa.Xb(function(J){m.dc(j,k,G,J,"replaceNode")})},m.Qd=function(j,k,G,q,Q){function W(ge,we){m.u.G(m.a.ec,null,[q,ge,Z,G,J,we]),m.i.ma(q,m.i.H)}function J(ge,we){C(we,ae),G.afterRender&&G.afterRender(we,ge),ae=null}function Z(ge,we){ae=Q.createChildContext(ge,{as:Ae,noChildContext:G.noChildContext,extend:function(Re){Re.$index=we,Ae&&(Re[Ae+"Index"]=we)}});var Se=M(j,ge,ae);return P(q,"ignoreTargetNode",Se,ae,G)}var ae,Ae=G.as,fe=G.includeDestroyed===!1||m.options.foreachHidesDestroyed&&!G.includeDestroyed;if(fe||G.beforeRemove||!m.Pc(k))return m.$(function(){var ge=m.a.f(k)||[];typeof ge.length>"u"&&(ge=[ge]),fe&&(ge=m.a.jb(ge,function(we){return we===e||we===null||!m.a.f(we._destroy)})),W(ge)},null,{l:q});W(k.v());var xe=k.subscribe(function(ge){W(k(),ge)},null,"arrayChange");return xe.l(q),xe};var V=m.a.g.Z(),B=m.a.g.Z();m.c.template={init:function(j,k){var G=m.a.f(k());if(typeof G=="string"||"name"in G)m.h.Ea(j);else if("nodes"in G){if(G=G.nodes||[],m.O(G))throw Error('The "nodes" option must be a plain, non-observable array.');var q=G[0]&&G[0].parentNode;q&&m.a.g.get(q,B)||(q=m.a.Yb(G),m.a.g.set(q,B,!0)),new m.C.ia(j).nodes(q)}else if(G=m.h.childNodes(j),0<G.length)q=m.a.Yb(G),new m.C.ia(j).nodes(q);else throw Error("Anonymous template defined, but no template content was provided");return{controlsDescendantBindings:!0}},update:function(j,k,G,q,Q){var W=k();k=m.a.f(W),G=!0,q=null,typeof k=="string"?k={}:(W="name"in k?k.name:j,"if"in k&&(G=m.a.f(k.if)),G&&"ifnot"in k&&(G=!m.a.f(k.ifnot)),G&&!W&&(G=!1)),"foreach"in k?q=m.Qd(W,G&&k.foreach||[],k,j,Q):G?(G=Q,"data"in k&&(G=Q.createChildContext(k.data,{as:k.as,noChildContext:k.noChildContext,exportDependencies:!0})),q=m.dc(W,G,k,j)):m.h.Ea(j),Q=q,(k=m.a.g.get(j,V))&&typeof k.s=="function"&&k.s(),m.a.g.set(j,V,!Q||Q.ja&&!Q.ja()?e:Q)}},m.m.Ra.template=function(j){return j=m.m.ac(j),j.length==1&&j[0].unknown||m.m.Id(j,"name")?null:"This template engine does not support anonymous templates nested within its templates"},m.h.ea.template=!0})(),m.b("setTemplateEngine",m.gc),m.b("renderTemplate",m.dc),m.a.Kc=function(_,C,w){if(_.length&&C.length){var P,M,F,V,B;for(P=M=0;(!w||P<w)&&(V=_[M]);++M){for(F=0;B=C[F];++F)if(V.value===B.value){V.moved=B.index,B.moved=V.index,C.splice(F,1),P=F=0;break}P+=F}}},m.a.Pb=(function(){function _(C,w,P,M,F){var V=Math.min,B=Math.max,j=[],k,G=C.length,q,Q=w.length,W=Q-G||1,J=G+Q+1,Z,ae,Ae;for(k=0;k<=G;k++)for(ae=Z,j.push(Z=[]),Ae=V(Q,k+W),q=B(0,k-1);q<=Ae;q++)Z[q]=q?k?C[k-1]===w[q-1]?ae[q-1]:V(ae[q]||J,Z[q-1]||J)+1:q+1:k+1;for(V=[],B=[],W=[],k=G,q=Q;k||q;)Q=j[k][q]-1,q&&Q===j[k][q-1]?B.push(V[V.length]={status:P,value:w[--q],index:q}):k&&Q===j[k-1][q]?W.push(V[V.length]={status:M,value:C[--k],index:k}):(--q,--k,F.sparse||V.push({status:"retained",value:w[q]}));return m.a.Kc(W,B,!F.dontLimitMoves&&10*G),V.reverse()}return function(C,w,P){return P=typeof P=="boolean"?{dontLimitMoves:P}:P||{},C=C||[],w=w||[],C.length<w.length?_(C,w,"added","deleted",P):_(w,C,"deleted","added",P)}})(),m.b("utils.compareArrays",m.a.Pb),(function(){function _(P,M,F,V,B){var j=[],k=m.$(function(){var G=M(F,B,m.a.Ua(j,P))||[];0<j.length&&(m.a.Xc(j,G),V&&m.u.G(V,null,[F,G,B])),j.length=0,m.a.Nb(j,G)},null,{l:P,Sa:function(){return!m.a.kd(j)}});return{Y:j,$:k.ja()?k:e}}var C=m.a.g.Z(),w=m.a.g.Z();m.a.ec=function(P,M,F,V,B,j){function k(vt){Se={Aa:vt,pb:m.ta(ae++)},J.push(Se),W||we.push(Se)}function G(vt){Se=Q[vt],ae!==Se.pb.v()&&ge.push(Se),Se.pb(ae++),m.a.Ua(Se.Y,P),J.push(Se)}function q(vt,Gt){if(vt)for(var lt=0,mt=Gt.length;lt<mt;lt++)m.a.D(Gt[lt].Y,function(ft){vt(ft,lt,Gt[lt].Aa)})}M=M||[],typeof M.length>"u"&&(M=[M]),V=V||{};var Q=m.a.g.get(P,C),W=!Q,J=[],Z=0,ae=0,Ae=[],fe=[],xe=[],ge=[],we=[],Se,Re=0;if(W)m.a.D(M,k);else{if(!j||Q&&Q._countWaitingForRemove){var Qe=m.a.Mb(Q,function(vt){return vt.Aa});j=m.a.Pb(Qe,M,{dontLimitMoves:V.dontLimitMoves,sparse:!0})}for(var Qe=0,He,Xe,$e;He=j[Qe];Qe++)switch(Xe=He.moved,$e=He.index,He.status){case"deleted":for(;Z<$e;)G(Z++);Xe===e&&(Se=Q[Z],Se.$&&(Se.$.s(),Se.$=e),m.a.Ua(Se.Y,P).length&&(V.beforeRemove&&(J.push(Se),Re++,Se.Aa===w?Se=null:xe.push(Se)),Se&&Ae.push.apply(Ae,Se.Y))),Z++;break;case"added":for(;ae<$e;)G(Z++);Xe!==e?(fe.push(J.length),G(Xe)):k(He.value)}for(;ae<M.length;)G(Z++);J._countWaitingForRemove=Re}m.a.g.set(P,C,J),q(V.beforeMove,ge),m.a.D(Ae,V.beforeRemove?m.oa:m.removeNode);var Pe,qe,st;try{st=P.ownerDocument.activeElement}catch{}if(fe.length)for(;(Qe=fe.shift())!=e;){for(Se=J[Qe],Pe=e;Qe;)if((qe=J[--Qe].Y)&&qe.length){Pe=qe[qe.length-1];break}for(M=0;Z=Se.Y[M];Pe=Z,M++)m.h.Wb(P,Z,Pe)}for(Qe=0;Se=J[Qe];Qe++){for(Se.Y||m.a.extend(Se,_(P,F,Se.Aa,B,Se.pb)),M=0;Z=Se.Y[M];Pe=Z,M++)m.h.Wb(P,Z,Pe);!Se.Ed&&B&&(B(Se.Aa,Se.Y,Se.pb),Se.Ed=!0,Pe=Se.Y[Se.Y.length-1])}for(st&&P.ownerDocument.activeElement!=st&&st.focus(),q(V.beforeRemove,xe),Qe=0;Qe<xe.length;++Qe)xe[Qe].Aa=w;q(V.afterMove,ge),q(V.afterAdd,we)}})(),m.b("utils.setDomNodeChildrenFromArrayMapping",m.a.ec),m.ba=function(){this.allowTemplateRewriting=!1},m.ba.prototype=new m.ca,m.ba.prototype.constructor=m.ba,m.ba.prototype.renderTemplateSource=function(_,C,w,P){return(C=!(9>m.a.W)&&_.nodes?_.nodes():null)?m.a.la(C.cloneNode(!0).childNodes):(_=_.text(),m.a.ua(_,P))},m.ba.Ma=new m.ba,m.gc(m.ba.Ma),m.b("nativeTemplateEngine",m.ba),(function(){m.$a=function(){var C=this.Hd=(function(){if(!r||!r.tmpl)return 0;try{if(0<=r.tmpl.tag.tmpl.open.toString().indexOf("__"))return 2}catch{}return 1})();this.renderTemplateSource=function(w,P,M,F){if(F=F||n,M=M||{},2>C)throw Error("Your version of jQuery.tmpl is too old. Please upgrade to jQuery.tmpl 1.0.0pre or later.");var V=w.data("precompiled");return V||(V=w.text()||"",V=r.template(null,"{{ko_with $item.koBindingContext}}"+V+"{{/ko_with}}"),w.data("precompiled",V)),w=[P.$data],P=r.extend({koBindingContext:P},M.templateOptions),P=r.tmpl(V,w,P),P.appendTo(F.createElement("div")),r.fragments={},P},this.createJavaScriptEvaluatorBlock=function(w){return"{{ko_code ((function() { return "+w+" })()) }}"},this.addTemplate=function(w,P){n.write("<script type='text/html' id='"+w+"'>"+P+"</script>")},0<C&&(r.tmpl.tag.ko_code={open:"__.push($1 || '');"},r.tmpl.tag.ko_with={open:"with($1) {",close:"} "})},m.$a.prototype=new m.ca,m.$a.prototype.constructor=m.$a;var _=new m.$a;0<_.Hd&&m.gc(_),m.b("jqueryTmplTemplateEngine",m.$a)})()})})()})()})();var qGt=ko;typeof window<"u"?(ko=window.ko,typeof b8<"u"?window.ko=b8:delete window.ko):(ko=global.ko,typeof b8<"u"?global.ko=b8:delete global.ko);var $C=qGt;/** +Message: `+ft.message,ft}})}return we=Pe===e,{shouldBindDescendants:we,bindingContextForDescendants:we&&$e}}function q(fe,xe){return fe&&fe instanceof m.fa?fe:new m.fa(fe,e,e,xe)}var Q=m.a.Da("_subscribable"),W=m.a.Da("_ancestorBindingInfo"),J=m.a.Da("_dataDependency");m.c={};var Z={script:!0,textarea:!0,template:!0};m.getBindingHandler=function(fe){return m.c[fe]};var ae={};m.fa=function(fe,xe,ge,we,Se){function Re(){var st=$e?Xe():Xe,vt=m.a.f(st);return xe?(m.a.extend(Qe,xe),W in xe&&(Qe[W]=xe[W])):(Qe.$parents=[],Qe.$root=vt,Qe.ko=m),Qe[Q]=Pe,He?vt=Qe.$data:(Qe.$rawData=st,Qe.$data=vt),ge&&(Qe[ge]=vt),we&&we(Qe,xe,vt),xe&&xe[Q]&&!m.S.o().Vb(xe[Q])&&xe[Q](),qe&&(Qe[J]=qe),Qe.$data}var Qe=this,He=fe===ae,Xe=He?e:fe,$e=typeof Xe=="function"&&!m.O(Xe),Pe,qe=Se&&Se.dataDependency;Se&&Se.exportDependencies?Re():(Pe=m.xb(Re),Pe.v(),Pe.ja()?Pe.equalityComparer=null:Qe[Q]=e)},m.fa.prototype.createChildContext=function(fe,xe,ge,we){if(!we&&xe&&typeof xe=="object"&&(we=xe,xe=we.as,ge=we.extend),xe&&we&&we.noChildContext){var Se=typeof fe=="function"&&!m.O(fe);return new m.fa(ae,this,null,function(Re){ge&&ge(Re),Re[xe]=Se?fe():fe},we)}return new m.fa(fe,this,xe,function(Re,Qe){Re.$parentContext=Qe,Re.$parent=Qe.$data,Re.$parents=(Qe.$parents||[]).slice(0),Re.$parents.unshift(Re.$parent),ge&&ge(Re)},we)},m.fa.prototype.extend=function(fe,xe){return new m.fa(ae,this,null,function(ge){m.a.extend(ge,typeof fe=="function"?fe(ge):fe)},xe)};var Ae=m.a.g.Z();C.prototype.Tc=function(){this.Kb&&this.Kb.N&&this.Kb.N.sd(this.node)},C.prototype.sd=function(fe){m.a.Pa(this.kb,fe),!this.kb.length&&this.H&&this.Cc()},C.prototype.Cc=function(){this.H=!0,this.yc.N&&!this.kb.length&&(this.yc.N=null,m.a.K.yb(this.node,_),m.i.ma(this.node,m.i.pa),this.Tc())},m.i={H:"childrenComplete",pa:"descendantsComplete",subscribe:function(fe,xe,ge,we,Se){var Re=m.a.g.Ub(fe,Ae,{});return Re.Fa||(Re.Fa=new m.T),Se&&Se.notifyImmediately&&Re.Zb[xe]&&m.u.G(ge,we,[fe]),Re.Fa.subscribe(ge,we,xe)},ma:function(fe,xe){var ge=m.a.g.get(fe,Ae);if(ge&&(ge.Zb[xe]=!0,ge.Fa&&ge.Fa.notifySubscribers(fe,xe),xe==m.i.H)){if(ge.N)ge.N.Cc();else if(ge.N===e&&ge.Fa&&ge.Fa.Wa(m.i.pa))throw Error("descendantsComplete event not supported for bindings on this node")}},Cb:function(fe,xe){var ge=m.a.g.Ub(fe,Ae,{});return ge.N||(ge.N=new C(fe,ge,xe[W])),xe[W]==ge?xe:xe.extend(function(we){we[W]=ge})}},m.Td=function(fe){return(fe=m.a.g.get(fe,Ae))&&fe.context},m.ib=function(fe,xe,ge){return fe.nodeType===1&&m.h.Sc(fe),G(fe,xe,q(ge))},m.ld=function(fe,xe,ge){return ge=q(ge),m.ib(fe,F(xe,ge,fe),ge)},m.Oa=function(fe,xe){xe.nodeType!==1&&xe.nodeType!==8||B(q(fe),xe)},m.vc=function(fe,xe,ge){if(!r&&t.jQuery&&(r=t.jQuery),2>arguments.length){if(xe=n.body,!xe)throw Error("ko.applyBindings: could not find document.body; has the document been loaded?")}else if(!xe||xe.nodeType!==1&&xe.nodeType!==8)throw Error("ko.applyBindings: first parameter should be your view model; second parameter should be a DOM node");j(q(fe,ge),xe)},m.Dc=function(fe){return!fe||fe.nodeType!==1&&fe.nodeType!==8?e:m.Td(fe)},m.Ec=function(fe){return(fe=m.Dc(fe))?fe.$data:e},m.b("bindingHandlers",m.c),m.b("bindingEvent",m.i),m.b("bindingEvent.subscribe",m.i.subscribe),m.b("bindingEvent.startPossiblyAsyncContentBinding",m.i.Cb),m.b("applyBindings",m.vc),m.b("applyBindingsToDescendants",m.Oa),m.b("applyBindingAccessorsToNode",m.ib),m.b("applyBindingsToNode",m.ld),m.b("contextFor",m.Dc),m.b("dataFor",m.Ec)})(),(function(_){function C(V,B){var j=Object.prototype.hasOwnProperty.call(M,V)?M[V]:_,k;j?j.subscribe(B):(j=M[V]=new m.T,j.subscribe(B),w(V,function(G,q){var Q=!(!q||!q.synchronous);F[V]={definition:G,Gd:Q},delete M[V],k||Q?j.notifySubscribers(G):m.na.zb(function(){j.notifySubscribers(G)})}),k=!0)}function w(V,B){P("getConfig",[V],function(j){j?P("loadComponent",[V,j],function(k){B(k,j)}):B(null,null)})}function P(V,B,j,k){k||(k=m.j.loaders.slice(0));var G=k.shift();if(G){var q=G[V];if(q){var Q=!1;if(q.apply(G,B.concat(function(W){Q?j(null):W!==null?j(W):P(V,B,j,k)}))!==_&&(Q=!0,!G.suppressLoaderExceptions))throw Error("Component loaders must supply values by invoking the callback, not by returning values synchronously.")}else P(V,B,j,k)}else j(null)}var M={},F={};m.j={get:function(V,B){var j=Object.prototype.hasOwnProperty.call(F,V)?F[V]:_;j?j.Gd?m.u.G(function(){B(j.definition)}):m.na.zb(function(){B(j.definition)}):C(V,B)},Bc:function(V){delete F[V]},oc:P},m.j.loaders=[],m.b("components",m.j),m.b("components.get",m.j.get),m.b("components.clearCachedDefinition",m.j.Bc)})(),(function(){function _(j,k,G,q){function Q(){--J===0&&q(W)}var W={},J=2,Z=G.template;G=G.viewModel,Z?M(k,Z,function(ae){m.j.oc("loadTemplate",[j,ae],function(Ae){W.template=Ae,Q()})}):Q(),G?M(k,G,function(ae){m.j.oc("loadViewModel",[j,ae],function(Ae){W[B]=Ae,Q()})}):Q()}function C(j,k,G){if(typeof k=="function")G(function(Q){return new k(Q)});else if(typeof k[B]=="function")G(k[B]);else if("instance"in k){var q=k.instance;G(function(){return q})}else"viewModel"in k?C(j,k.viewModel,G):j("Unknown viewModel value: "+k)}function w(j){switch(m.a.R(j)){case"script":return m.a.ua(j.text);case"textarea":return m.a.ua(j.value);case"template":if(P(j.content))return m.a.Ca(j.content.childNodes)}return m.a.Ca(j.childNodes)}function P(j){return t.DocumentFragment?j instanceof DocumentFragment:j&&j.nodeType===11}function M(j,k,G){typeof k.require=="string"?a||t.require?(a||t.require)([k.require],function(q){q&&typeof q=="object"&&q.Xd&&q.default&&(q=q.default),G(q)}):j("Uses require, but no AMD loader is present"):G(k)}function F(j){return function(k){throw Error("Component '"+j+"': "+k)}}var V={};m.j.register=function(j,k){if(!k)throw Error("Invalid configuration for "+j);if(m.j.tb(j))throw Error("Component "+j+" is already registered");V[j]=k},m.j.tb=function(j){return Object.prototype.hasOwnProperty.call(V,j)},m.j.unregister=function(j){delete V[j],m.j.Bc(j)},m.j.Fc={getConfig:function(j,k){k(m.j.tb(j)?V[j]:null)},loadComponent:function(j,k,G){var q=F(j);M(q,k,function(Q){_(j,q,Q,G)})},loadTemplate:function(j,k,G){if(j=F(j),typeof k=="string")G(m.a.ua(k));else if(k instanceof Array)G(k);else if(P(k))G(m.a.la(k.childNodes));else if(k.element)if(k=k.element,t.HTMLElement?k instanceof HTMLElement:k&&k.tagName&&k.nodeType===1)G(w(k));else if(typeof k=="string"){var q=n.getElementById(k);q?G(w(q)):j("Cannot find element with ID "+k)}else j("Unknown element type: "+k);else j("Unknown template value: "+k)},loadViewModel:function(j,k,G){C(F(j),k,G)}};var B="createViewModel";m.b("components.register",m.j.register),m.b("components.isRegistered",m.j.tb),m.b("components.unregister",m.j.unregister),m.b("components.defaultLoader",m.j.Fc),m.j.loaders.push(m.j.Fc),m.j.dd=V})(),(function(){function _(w,P){var M=w.getAttribute("params");if(M){var M=C.parseBindingsString(M,P,w,{valueAccessors:!0,bindingParams:!0}),M=m.a.Ga(M,function(B){return m.o(B,null,{l:w})}),F=m.a.Ga(M,function(B){var j=B.v();return B.ja()?m.o({read:function(){return m.a.f(B())},write:m.Za(j)&&function(k){B()(k)},l:w}):j});return Object.prototype.hasOwnProperty.call(F,"$raw")||(F.$raw=M),F}return{$raw:{}}}m.j.getComponentNameForNode=function(w){var P=m.a.R(w);if(m.j.tb(P)&&(P.indexOf("-")!=-1||""+w=="[object HTMLUnknownElement]"||8>=m.a.W&&w.tagName===P))return P},m.j.tc=function(w,P,M,F){if(P.nodeType===1){var V=m.j.getComponentNameForNode(P);if(V){if(w=w||{},w.component)throw Error('Cannot use the "component" binding on a custom element matching a component');var B={name:V,params:_(P,M)};w.component=F?function(){return B}:B}}return w};var C=new m.ga;9>m.a.W&&(m.j.register=(function(w){return function(P){return w.apply(this,arguments)}})(m.j.register),n.createDocumentFragment=(function(w){return function(){var P=w(),M=m.j.dd,F;for(F in M);return P}})(n.createDocumentFragment))})(),(function(){function _(P,M,F){if(M=M.template,!M)throw Error("Component '"+P+"' has no template");P=m.a.Ca(M),m.h.va(F,P)}function C(P,M,F){var V=P.createViewModel;return V?V.call(P,M,F):M}var w=0;m.c.component={init:function(P,M,F,V,B){function j(){var W=k&&k.dispose;typeof W=="function"&&W.call(k),q&&q.s(),G=k=q=null}var k,G,q,Q=m.a.la(m.h.childNodes(P));return m.h.Ea(P),m.a.K.za(P,j),m.o(function(){var W=m.a.f(M()),J,Z;if(typeof W=="string"?J=W:(J=m.a.f(W.name),Z=m.a.f(W.params)),!J)throw Error("No component name specified");var ae=m.i.Cb(P,B),Ae=G=++w;m.j.get(J,function(fe){if(G===Ae){if(j(),!fe)throw Error("Unknown component '"+J+"'");_(J,fe,P);var xe=C(fe,Z,{element:P,templateNodes:Q});fe=ae.createChildContext(xe,{extend:function(ge){ge.$component=xe,ge.$componentTemplateNodes=Q}}),xe&&xe.koDescendantsComplete&&(q=m.i.subscribe(P,m.i.pa,xe.koDescendantsComplete,xe)),k=xe,m.Oa(fe,P)}})},null,{l:P}),{controlsDescendantBindings:!0}}},m.h.ea.component=!0})();var O={class:"className",for:"htmlFor"};m.c.attr={update:function(_,C){var w=m.a.f(C())||{};m.a.P(w,function(P,M){M=m.a.f(M);var F=P.indexOf(":"),F="lookupNamespaceURI"in _&&0<F&&_.lookupNamespaceURI(P.substr(0,F)),V=M===!1||M===null||M===e;V?F?_.removeAttributeNS(F,P):_.removeAttribute(P):M=M.toString(),8>=m.a.W&&P in O?(P=O[P],V?_.removeAttribute(P):_[P]=M):V||(F?_.setAttributeNS(F,P,M):_.setAttribute(P,M)),P==="name"&&m.a.Yc(_,V?"":M)})}},(function(){m.c.checked={after:["value","attr"],init:function(_,C,w){function P(){var W=_.checked,J=F();if(!m.S.Ya()&&(W||!B&&!m.S.qa())){var Z=m.u.G(C);if(k){var ae=G?Z.v():Z,Ae=Q;Q=J,Ae!==J?W&&(m.a.Na(ae,J,!0),m.a.Na(ae,Ae,!1)):m.a.Na(ae,J,W),G&&m.Za(Z)&&Z(ae)}else V&&(J===e?J=W:W||(J=e)),m.m.eb(Z,w,"checked",J,!0)}}function M(){var W=m.a.f(C()),J=F();k?(_.checked=0<=m.a.A(W,J),Q=J):_.checked=V&&J===e?!!W:F()===W}var F=m.xb(function(){if(w.has("checkedValue"))return m.a.f(w.get("checkedValue"));if(q)return w.has("value")?m.a.f(w.get("value")):_.value}),V=_.type=="checkbox",B=_.type=="radio";if(V||B){var j=C(),k=V&&m.a.f(j)instanceof Array,G=!(k&&j.push&&j.splice),q=B||k,Q=k?F():e;B&&!_.name&&m.c.uniqueName.init(_,function(){return!0}),m.o(P,null,{l:_}),m.a.B(_,"click",P),m.o(M,null,{l:_}),j=e}}},m.m.wa.checked=!0,m.c.checkedValue={update:function(_,C){_.value=m.a.f(C())}}})(),m.c.class={update:function(_,C){var w=m.a.Db(m.a.f(C()));m.a.Eb(_,_.__ko__cssValue,!1),_.__ko__cssValue=w,m.a.Eb(_,w,!0)}},m.c.css={update:function(_,C){var w=m.a.f(C());w!==null&&typeof w=="object"?m.a.P(w,function(P,M){M=m.a.f(M),m.a.Eb(_,P,M)}):m.c.class.update(_,C)}},m.c.enable={update:function(_,C){var w=m.a.f(C());w&&_.disabled?_.removeAttribute("disabled"):w||_.disabled||(_.disabled=!0)}},m.c.disable={update:function(_,C){m.c.enable.update(_,function(){return!m.a.f(C())})}},m.c.event={init:function(_,C,w,P,M){var F=C()||{};m.a.P(F,function(V){typeof V=="string"&&m.a.B(_,V,function(B){var j,k=C()[V];if(k){try{var G=m.a.la(arguments);P=M.$data,G.unshift(P),j=k.apply(P,G)}finally{j!==!0&&(B.preventDefault?B.preventDefault():B.returnValue=!1)}w.get(V+"Bubble")===!1&&(B.cancelBubble=!0,B.stopPropagation&&B.stopPropagation())}})})}},m.c.foreach={Rc:function(_){return function(){var C=_(),w=m.a.bc(C);return!w||typeof w.length=="number"?{foreach:C,templateEngine:m.ba.Ma}:(m.a.f(C),{foreach:w.data,as:w.as,noChildContext:w.noChildContext,includeDestroyed:w.includeDestroyed,afterAdd:w.afterAdd,beforeRemove:w.beforeRemove,afterRender:w.afterRender,beforeMove:w.beforeMove,afterMove:w.afterMove,templateEngine:m.ba.Ma})}},init:function(_,C){return m.c.template.init(_,m.c.foreach.Rc(C))},update:function(_,C,w,P,M){return m.c.template.update(_,m.c.foreach.Rc(C),w,P,M)}},m.m.Ra.foreach=!1,m.h.ea.foreach=!0,m.c.hasfocus={init:function(_,C,w){function P(V){_.__ko_hasfocusUpdating=!0;var B=_.ownerDocument;if("activeElement"in B){var j;try{j=B.activeElement}catch{j=B.body}V=j===_}B=C(),m.m.eb(B,w,"hasfocus",V,!0),_.__ko_hasfocusLastValue=V,_.__ko_hasfocusUpdating=!1}var M=P.bind(null,!0),F=P.bind(null,!1);m.a.B(_,"focus",M),m.a.B(_,"focusin",M),m.a.B(_,"blur",F),m.a.B(_,"focusout",F),_.__ko_hasfocusLastValue=!1},update:function(_,C){var w=!!m.a.f(C());_.__ko_hasfocusUpdating||_.__ko_hasfocusLastValue===w||(w?_.focus():_.blur(),!w&&_.__ko_hasfocusLastValue&&_.ownerDocument.body.focus(),m.u.G(m.a.Fb,null,[_,w?"focusin":"focusout"]))}},m.m.wa.hasfocus=!0,m.c.hasFocus=m.c.hasfocus,m.m.wa.hasFocus="hasfocus",m.c.html={init:function(){return{controlsDescendantBindings:!0}},update:function(_,C){m.a.fc(_,C())}},(function(){function _(C,w,P){m.c[C]={init:function(M,F,V,B,j){var k,G,q={},Q,W,J;if(w){B=V.get("as");var Z=V.get("noChildContext");J=!(B&&Z),q={as:B,noChildContext:Z,exportDependencies:J}}return W=(Q=V.get("completeOn")=="render")||V.has(m.i.pa),m.o(function(){var ae=m.a.f(F()),Ae=!P!=!ae,fe=!G,xe;(J||Ae!==k)&&(W&&(j=m.i.Cb(M,j)),Ae&&((!w||J)&&(q.dataDependency=m.S.o()),xe=w?j.createChildContext(typeof ae=="function"?ae:F,q):m.S.qa()?j.extend(null,q):j),fe&&m.S.qa()&&(G=m.a.Ca(m.h.childNodes(M),!0)),Ae?(fe||m.h.va(M,m.a.Ca(G)),m.Oa(xe,M)):(m.h.Ea(M),Q||m.i.ma(M,m.i.H)),k=Ae)},null,{l:M}),{controlsDescendantBindings:!0}}},m.m.Ra[C]=!1,m.h.ea[C]=!0}_("if"),_("ifnot",!1,!0),_("with",!0)})(),m.c.let={init:function(_,C,w,P,M){return C=M.extend(C),m.Oa(C,_),{controlsDescendantBindings:!0}}},m.h.ea.let=!0;var L={};m.c.options={init:function(_){if(m.a.R(_)!=="select")throw Error("options binding applies only to SELECT elements");for(;0<_.length;)_.remove(0);return{controlsDescendantBindings:!0}},update:function(_,C,w){function P(){return m.a.jb(_.options,function(Z){return Z.selected})}function M(Z,ae,Ae){var fe=typeof ae;return fe=="function"?ae(Z):fe=="string"?Z[ae]:Ae}function F(Z,ae){if(W&&k)m.i.ma(_,m.i.H);else if(Q.length){var Ae=0<=m.a.A(Q,m.w.M(ae[0]));m.a.Zc(ae[0],Ae),W&&!Ae&&m.u.G(m.a.Fb,null,[_,"change"])}}var V=_.multiple,B=_.length!=0&&V?_.scrollTop:null,j=m.a.f(C()),k=w.get("valueAllowUnset")&&w.has("value"),G=w.get("optionsIncludeDestroyed");C={};var q,Q=[];k||(V?Q=m.a.Mb(P(),m.w.M):0<=_.selectedIndex&&Q.push(m.w.M(_.options[_.selectedIndex]))),j&&(typeof j.length>"u"&&(j=[j]),q=m.a.jb(j,function(Z){return G||Z===e||Z===null||!m.a.f(Z._destroy)}),w.has("optionsCaption")&&(j=m.a.f(w.get("optionsCaption")),j!==null&&j!==e&&q.unshift(L)));var W=!1;if(C.beforeRemove=function(Z){_.removeChild(Z)},j=F,w.has("optionsAfterRender")&&typeof w.get("optionsAfterRender")=="function"&&(j=function(Z,ae){F(0,ae),m.u.G(w.get("optionsAfterRender"),null,[ae[0],Z!==L?Z:e])}),m.a.ec(_,q,function(Z,ae,Ae){return Ae.length&&(Q=!k&&Ae[0].selected?[m.w.M(Ae[0])]:[],W=!0),ae=_.ownerDocument.createElement("option"),Z===L?(m.a.Bb(ae,w.get("optionsCaption")),m.w.cb(ae,e)):(Ae=M(Z,w.get("optionsValue"),Z),m.w.cb(ae,m.a.f(Ae)),Z=M(Z,w.get("optionsText"),Ae),m.a.Bb(ae,Z)),[ae]},C,j),!k){var J;V?J=Q.length&&P().length<Q.length:J=Q.length&&0<=_.selectedIndex?m.w.M(_.options[_.selectedIndex])!==Q[0]:Q.length||0<=_.selectedIndex,J&&m.u.G(m.a.Fb,null,[_,"change"])}(k||m.S.Ya())&&m.i.ma(_,m.i.H),m.a.wd(_),B&&20<Math.abs(B-_.scrollTop)&&(_.scrollTop=B)}},m.c.options.$b=m.a.g.Z(),m.c.selectedOptions={init:function(_,C,w){function P(){var V=C(),B=[];m.a.D(_.getElementsByTagName("option"),function(j){j.selected&&B.push(m.w.M(j))}),m.m.eb(V,w,"selectedOptions",B)}function M(){var V=m.a.f(C()),B=_.scrollTop;V&&typeof V.length=="number"&&m.a.D(_.getElementsByTagName("option"),function(j){var k=0<=m.a.A(V,m.w.M(j));j.selected!=k&&m.a.Zc(j,k)}),_.scrollTop=B}if(m.a.R(_)!="select")throw Error("selectedOptions binding applies only to SELECT elements");var F;m.i.subscribe(_,m.i.H,function(){F?P():(m.a.B(_,"change",P),F=m.o(M,null,{l:_}))},null,{notifyImmediately:!0})},update:function(){}},m.m.wa.selectedOptions=!0,m.c.style={update:function(_,C){var w=m.a.f(C()||{});m.a.P(w,function(P,M){if(M=m.a.f(M),(M===null||M===e||M===!1)&&(M=""),r)r(_).css(P,M);else if(/^--/.test(P))_.style.setProperty(P,M);else{P=P.replace(/-(\w)/g,function(V,B){return B.toUpperCase()});var F=_.style[P];_.style[P]=M,M===F||_.style[P]!=F||isNaN(M)||(_.style[P]=M+"px")}})}},m.c.submit={init:function(_,C,w,P,M){if(typeof C()!="function")throw Error("The value for a submit binding must be a function");m.a.B(_,"submit",function(F){var V,B=C();try{V=B.call(M.$data,_)}finally{V!==!0&&(F.preventDefault?F.preventDefault():F.returnValue=!1)}})}},m.c.text={init:function(){return{controlsDescendantBindings:!0}},update:function(_,C){m.a.Bb(_,C())}},m.h.ea.text=!0,(function(){if(t&&t.navigator){var _=function(q){if(q)return parseFloat(q[1])},C=t.navigator.userAgent,w,P,M,F,V;(w=t.opera&&t.opera.version&&parseInt(t.opera.version()))||(V=_(C.match(/Edge\/([^ ]+)$/)))||_(C.match(/Chrome\/([^ ]+)/))||(P=_(C.match(/Version\/([^ ]+) Safari/)))||(M=_(C.match(/Firefox\/([^ ]+)/)))||(F=m.a.W||_(C.match(/MSIE ([^ ]+)/)))||(F=_(C.match(/rv:([^ )]+)/)))}if(8<=F&&10>F)var B=m.a.g.Z(),j=m.a.g.Z(),k=function(q){var Q=this.activeElement;(Q=Q&&m.a.g.get(Q,j))&&Q(q)},G=function(q,Q){var W=q.ownerDocument;m.a.g.get(W,B)||(m.a.g.set(W,B,!0),m.a.B(W,"selectionchange",k)),m.a.g.set(q,j,Q)};m.c.textInput={init:function(q,Q,W){function J(Re,Qe){m.a.B(q,Re,Qe)}function Z(){var Re=m.a.f(Q());(Re===null||Re===e)&&(Re=""),ge!==e&&Re===ge?m.a.setTimeout(Z,4):q.value!==Re&&(Se=!0,q.value=Re,Se=!1,fe=q.value)}function ae(){xe||(ge=q.value,xe=m.a.setTimeout(Ae,4))}function Ae(){clearTimeout(xe),ge=xe=e;var Re=q.value;fe!==Re&&(fe=Re,m.m.eb(Q(),W,"textInput",Re))}var fe=q.value,xe,ge,we=m.a.W==9?ae:Ae,Se=!1;F&&J("keypress",Ae),11>F&&J("propertychange",function(Re){Se||Re.propertyName!=="value"||we(Re)}),F==8&&(J("keyup",Ae),J("keydown",Ae)),G&&(G(q,we),J("dragend",ae)),(!F||9<=F)&&J("input",we),5>P&&m.a.R(q)==="textarea"?(J("keydown",ae),J("paste",ae),J("cut",ae)):11>w?J("keydown",ae):4>M?(J("DOMAutoComplete",Ae),J("dragdrop",Ae),J("drop",Ae)):V&&q.type==="number"&&J("keydown",ae),J("change",Ae),J("blur",Ae),m.o(Z,null,{l:q})}},m.m.wa.textInput=!0,m.c.textinput={preprocess:function(q,Q,W){W("textInput",q)}}})(),m.c.uniqueName={init:function(_,C){if(C()){var w="ko_unique_"+ ++m.c.uniqueName.rd;m.a.Yc(_,w)}}},m.c.uniqueName.rd=0,m.c.using={init:function(_,C,w,P,M){var F;return w.has("as")&&(F={as:w.get("as"),noChildContext:w.get("noChildContext")}),C=M.createChildContext(C,F),m.Oa(C,_),{controlsDescendantBindings:!0}}},m.h.ea.using=!0,m.c.value={init:function(_,C,w){var P=m.a.R(_),M=P=="input";if(!M||_.type!="checkbox"&&_.type!="radio"){var F=[],V=w.get("valueUpdate"),B=!1,j=null;V&&(typeof V=="string"?F=[V]:F=m.a.wc(V),m.a.Pa(F,"change"));var k=function(){j=null,B=!1;var Q=C(),W=m.w.M(_);m.m.eb(Q,w,"value",W)};!m.a.W||!M||_.type!="text"||_.autocomplete=="off"||_.form&&_.form.autocomplete=="off"||m.a.A(F,"propertychange")!=-1||(m.a.B(_,"propertychange",function(){B=!0}),m.a.B(_,"focus",function(){B=!1}),m.a.B(_,"blur",function(){B&&k()})),m.a.D(F,function(Q){var W=k;m.a.Ud(Q,"after")&&(W=function(){j=m.w.M(_),m.a.setTimeout(k,0)},Q=Q.substring(5)),m.a.B(_,Q,W)});var G;if(G=M&&_.type=="file"?function(){var Q=m.a.f(C());Q===null||Q===e||Q===""?_.value="":m.u.G(k)}:function(){var Q=m.a.f(C()),W=m.w.M(_);j!==null&&Q===j?m.a.setTimeout(G,0):(Q!==W||W===e)&&(P==="select"?(W=w.get("valueAllowUnset"),m.w.cb(_,Q,W),W||Q===m.w.M(_)||m.u.G(k)):m.w.cb(_,Q))},P==="select"){var q;m.i.subscribe(_,m.i.H,function(){q?w.get("valueAllowUnset")?G():k():(m.a.B(_,"change",k),q=m.o(G,null,{l:_}))},null,{notifyImmediately:!0})}else m.a.B(_,"change",k),m.o(G,null,{l:_})}else m.ib(_,{checkedValue:C})},update:function(){}},m.m.wa.value=!0,m.c.visible={update:function(_,C){var w=m.a.f(C()),P=_.style.display!="none";w&&!P?_.style.display="":!w&&P&&(_.style.display="none")}},m.c.hidden={update:function(_,C){m.c.visible.update(_,function(){return!m.a.f(C())})}},(function(_){m.c[_]={init:function(C,w,P,M,F){return m.c.event.init.call(this,C,function(){var V={};return V[_]=w(),V},P,M,F)}}})("click"),m.ca=function(){},m.ca.prototype.renderTemplateSource=function(){throw Error("Override renderTemplateSource")},m.ca.prototype.createJavaScriptEvaluatorBlock=function(){throw Error("Override createJavaScriptEvaluatorBlock")},m.ca.prototype.makeTemplateSource=function(_,C){if(typeof _=="string"){C=C||n;var w=C.getElementById(_);if(!w)throw Error("Cannot find template with ID "+_);return new m.C.F(w)}if(_.nodeType==1||_.nodeType==8)return new m.C.ia(_);throw Error("Unknown template type: "+_)},m.ca.prototype.renderTemplate=function(_,C,w,P){return _=this.makeTemplateSource(_,P),this.renderTemplateSource(_,C,w,P)},m.ca.prototype.isTemplateRewritten=function(_,C){return this.allowTemplateRewriting===!1?!0:this.makeTemplateSource(_,C).data("isRewritten")},m.ca.prototype.rewriteTemplate=function(_,C,w){_=this.makeTemplateSource(_,w),C=C(_.text()),_.text(C),_.data("isRewritten",!0)},m.b("templateEngine",m.ca),m.kc=(function(){function _(P,M,F,V){P=m.m.ac(P);for(var B=m.m.Ra,j=0;j<P.length;j++){var k=P[j].key;if(Object.prototype.hasOwnProperty.call(B,k)){var G=B[k];if(typeof G=="function"){if(k=G(P[j].value))throw Error(k)}else if(!G)throw Error("This template engine does not support the '"+k+"' binding within its templates")}}return F="ko.__tr_ambtns(function($context,$element){return(function(){return{ "+m.m.vb(P,{valueAccessors:!0})+" } })()},'"+F.toLowerCase()+"')",V.createJavaScriptEvaluatorBlock(F)+M}var C=/(<([a-z]+\d*)(?:\s+(?!data-bind\s*=\s*)[a-z0-9\-]+(?:=(?:\"[^\"]*\"|\'[^\']*\'|[^>]*))?)*\s+)data-bind\s*=\s*(["'])([\s\S]*?)\3/gi,w=/\x3c!--\s*ko\b\s*([\s\S]*?)\s*--\x3e/g;return{xd:function(P,M,F){M.isTemplateRewritten(P,F)||M.rewriteTemplate(P,function(V){return m.kc.Ld(V,M)},F)},Ld:function(P,M){return P.replace(C,function(F,V,B,j,k){return _(k,V,B,M)}).replace(w,function(F,V){return _(V,"<!-- ko -->","#comment",M)})},md:function(P,M){return m.aa.Xb(function(F,V){var B=F.nextSibling;B&&B.nodeName.toLowerCase()===M&&m.ib(B,P,V)})}}})(),m.b("__tr_ambtns",m.kc.md),(function(){m.C={},m.C.F=function(w){if(this.F=w){var P=m.a.R(w);this.ab=P==="script"?1:P==="textarea"?2:P=="template"&&w.content&&w.content.nodeType===11?3:4}},m.C.F.prototype.text=function(){var w=this.ab===1?"text":this.ab===2?"value":"innerHTML";if(arguments.length==0)return this.F[w];var P=arguments[0];w==="innerHTML"?m.a.fc(this.F,P):this.F[w]=P};var _=m.a.g.Z()+"_";m.C.F.prototype.data=function(w){if(arguments.length===1)return m.a.g.get(this.F,_+w);m.a.g.set(this.F,_+w,arguments[1])};var C=m.a.g.Z();m.C.F.prototype.nodes=function(){var w=this.F;if(arguments.length==0){var P=m.a.g.get(w,C)||{},M=P.lb||(this.ab===3?w.content:this.ab===4?w:e);if(!M||P.jd){var F=this.text();F&&F!==P.bb&&(M=m.a.Md(F,w.ownerDocument),m.a.g.set(w,C,{lb:M,bb:F,jd:!0}))}return M}P=arguments[0],this.ab!==e&&this.text(""),m.a.g.set(w,C,{lb:P})},m.C.ia=function(w){this.F=w},m.C.ia.prototype=new m.C.F,m.C.ia.prototype.constructor=m.C.ia,m.C.ia.prototype.text=function(){if(arguments.length==0){var w=m.a.g.get(this.F,C)||{};return w.bb===e&&w.lb&&(w.bb=w.lb.innerHTML),w.bb}m.a.g.set(this.F,C,{bb:arguments[0]})},m.b("templateSources",m.C),m.b("templateSources.domElement",m.C.F),m.b("templateSources.anonymousTemplate",m.C.ia)})(),(function(){function _(j,k,G){var q;for(k=m.h.nextSibling(k);j&&(q=j)!==k;)j=m.h.nextSibling(q),G(q,j)}function C(j,k){if(j.length){var G=j[0],q=j[j.length-1],Q=G.parentNode,W=m.ga.instance,J=W.preprocessNode;if(J){if(_(G,q,function(Z,ae){var Ae=Z.previousSibling,fe=J.call(W,Z);fe&&(Z===G&&(G=fe[0]||ae),Z===q&&(q=fe[fe.length-1]||Ae))}),j.length=0,!G)return;G===q?j.push(G):(j.push(G,q),m.a.Ua(j,Q))}_(G,q,function(Z){Z.nodeType!==1&&Z.nodeType!==8||m.vc(k,Z)}),_(G,q,function(Z){Z.nodeType!==1&&Z.nodeType!==8||m.aa.cd(Z,[k])}),m.a.Ua(j,Q)}}function w(j){return j.nodeType?j:0<j.length?j[0]:null}function P(j,k,G,q,Q){Q=Q||{};var W=(j&&w(j)||G||{}).ownerDocument,J=Q.templateEngine||F;if(m.kc.xd(G,J,W),G=J.renderTemplate(G,q,Q,W),typeof G.length!="number"||0<G.length&&typeof G[0].nodeType!="number")throw Error("Template engine must return an array of DOM nodes");switch(W=!1,k){case"replaceChildren":m.h.va(j,G),W=!0;break;case"replaceNode":m.a.Xc(j,G),W=!0;break;case"ignoreTargetNode":break;default:throw Error("Unknown renderMode: "+k)}return W&&(C(G,q),Q.afterRender&&m.u.G(Q.afterRender,null,[G,q[Q.as||"$data"]]),k=="replaceChildren"&&m.i.ma(j,m.i.H)),G}function M(j,k,G){return m.O(j)?j():typeof j=="function"?j(k,G):j}var F;m.gc=function(j){if(j!=e&&!(j instanceof m.ca))throw Error("templateEngine must inherit from ko.templateEngine");F=j},m.dc=function(j,k,G,q,Q){if(G=G||{},(G.templateEngine||F)==e)throw Error("Set a template engine before calling renderTemplate");if(Q=Q||"replaceChildren",q){var W=w(q);return m.$(function(){var Z=k&&k instanceof m.fa?k:new m.fa(k,null,null,null,{exportDependencies:!0}),J=M(j,Z.$data,Z),Z=P(q,Q,J,Z,G);Q=="replaceNode"&&(q=Z,W=w(q))},null,{Sa:function(){return!W||!m.a.Sb(W)},l:W&&Q=="replaceNode"?W.parentNode:W})}return m.aa.Xb(function(J){m.dc(j,k,G,J,"replaceNode")})},m.Qd=function(j,k,G,q,Q){function W(ge,we){m.u.G(m.a.ec,null,[q,ge,Z,G,J,we]),m.i.ma(q,m.i.H)}function J(ge,we){C(we,ae),G.afterRender&&G.afterRender(we,ge),ae=null}function Z(ge,we){ae=Q.createChildContext(ge,{as:Ae,noChildContext:G.noChildContext,extend:function(Re){Re.$index=we,Ae&&(Re[Ae+"Index"]=we)}});var Se=M(j,ge,ae);return P(q,"ignoreTargetNode",Se,ae,G)}var ae,Ae=G.as,fe=G.includeDestroyed===!1||m.options.foreachHidesDestroyed&&!G.includeDestroyed;if(fe||G.beforeRemove||!m.Pc(k))return m.$(function(){var ge=m.a.f(k)||[];typeof ge.length>"u"&&(ge=[ge]),fe&&(ge=m.a.jb(ge,function(we){return we===e||we===null||!m.a.f(we._destroy)})),W(ge)},null,{l:q});W(k.v());var xe=k.subscribe(function(ge){W(k(),ge)},null,"arrayChange");return xe.l(q),xe};var V=m.a.g.Z(),B=m.a.g.Z();m.c.template={init:function(j,k){var G=m.a.f(k());if(typeof G=="string"||"name"in G)m.h.Ea(j);else if("nodes"in G){if(G=G.nodes||[],m.O(G))throw Error('The "nodes" option must be a plain, non-observable array.');var q=G[0]&&G[0].parentNode;q&&m.a.g.get(q,B)||(q=m.a.Yb(G),m.a.g.set(q,B,!0)),new m.C.ia(j).nodes(q)}else if(G=m.h.childNodes(j),0<G.length)q=m.a.Yb(G),new m.C.ia(j).nodes(q);else throw Error("Anonymous template defined, but no template content was provided");return{controlsDescendantBindings:!0}},update:function(j,k,G,q,Q){var W=k();k=m.a.f(W),G=!0,q=null,typeof k=="string"?k={}:(W="name"in k?k.name:j,"if"in k&&(G=m.a.f(k.if)),G&&"ifnot"in k&&(G=!m.a.f(k.ifnot)),G&&!W&&(G=!1)),"foreach"in k?q=m.Qd(W,G&&k.foreach||[],k,j,Q):G?(G=Q,"data"in k&&(G=Q.createChildContext(k.data,{as:k.as,noChildContext:k.noChildContext,exportDependencies:!0})),q=m.dc(W,G,k,j)):m.h.Ea(j),Q=q,(k=m.a.g.get(j,V))&&typeof k.s=="function"&&k.s(),m.a.g.set(j,V,!Q||Q.ja&&!Q.ja()?e:Q)}},m.m.Ra.template=function(j){return j=m.m.ac(j),j.length==1&&j[0].unknown||m.m.Id(j,"name")?null:"This template engine does not support anonymous templates nested within its templates"},m.h.ea.template=!0})(),m.b("setTemplateEngine",m.gc),m.b("renderTemplate",m.dc),m.a.Kc=function(_,C,w){if(_.length&&C.length){var P,M,F,V,B;for(P=M=0;(!w||P<w)&&(V=_[M]);++M){for(F=0;B=C[F];++F)if(V.value===B.value){V.moved=B.index,B.moved=V.index,C.splice(F,1),P=F=0;break}P+=F}}},m.a.Pb=(function(){function _(C,w,P,M,F){var V=Math.min,B=Math.max,j=[],k,G=C.length,q,Q=w.length,W=Q-G||1,J=G+Q+1,Z,ae,Ae;for(k=0;k<=G;k++)for(ae=Z,j.push(Z=[]),Ae=V(Q,k+W),q=B(0,k-1);q<=Ae;q++)Z[q]=q?k?C[k-1]===w[q-1]?ae[q-1]:V(ae[q]||J,Z[q-1]||J)+1:q+1:k+1;for(V=[],B=[],W=[],k=G,q=Q;k||q;)Q=j[k][q]-1,q&&Q===j[k][q-1]?B.push(V[V.length]={status:P,value:w[--q],index:q}):k&&Q===j[k-1][q]?W.push(V[V.length]={status:M,value:C[--k],index:k}):(--q,--k,F.sparse||V.push({status:"retained",value:w[q]}));return m.a.Kc(W,B,!F.dontLimitMoves&&10*G),V.reverse()}return function(C,w,P){return P=typeof P=="boolean"?{dontLimitMoves:P}:P||{},C=C||[],w=w||[],C.length<w.length?_(C,w,"added","deleted",P):_(w,C,"deleted","added",P)}})(),m.b("utils.compareArrays",m.a.Pb),(function(){function _(P,M,F,V,B){var j=[],k=m.$(function(){var G=M(F,B,m.a.Ua(j,P))||[];0<j.length&&(m.a.Xc(j,G),V&&m.u.G(V,null,[F,G,B])),j.length=0,m.a.Nb(j,G)},null,{l:P,Sa:function(){return!m.a.kd(j)}});return{Y:j,$:k.ja()?k:e}}var C=m.a.g.Z(),w=m.a.g.Z();m.a.ec=function(P,M,F,V,B,j){function k(vt){Se={Aa:vt,pb:m.ta(ae++)},J.push(Se),W||we.push(Se)}function G(vt){Se=Q[vt],ae!==Se.pb.v()&&ge.push(Se),Se.pb(ae++),m.a.Ua(Se.Y,P),J.push(Se)}function q(vt,Gt){if(vt)for(var lt=0,mt=Gt.length;lt<mt;lt++)m.a.D(Gt[lt].Y,function(ft){vt(ft,lt,Gt[lt].Aa)})}M=M||[],typeof M.length>"u"&&(M=[M]),V=V||{};var Q=m.a.g.get(P,C),W=!Q,J=[],Z=0,ae=0,Ae=[],fe=[],xe=[],ge=[],we=[],Se,Re=0;if(W)m.a.D(M,k);else{if(!j||Q&&Q._countWaitingForRemove){var Qe=m.a.Mb(Q,function(vt){return vt.Aa});j=m.a.Pb(Qe,M,{dontLimitMoves:V.dontLimitMoves,sparse:!0})}for(var Qe=0,He,Xe,$e;He=j[Qe];Qe++)switch(Xe=He.moved,$e=He.index,He.status){case"deleted":for(;Z<$e;)G(Z++);Xe===e&&(Se=Q[Z],Se.$&&(Se.$.s(),Se.$=e),m.a.Ua(Se.Y,P).length&&(V.beforeRemove&&(J.push(Se),Re++,Se.Aa===w?Se=null:xe.push(Se)),Se&&Ae.push.apply(Ae,Se.Y))),Z++;break;case"added":for(;ae<$e;)G(Z++);Xe!==e?(fe.push(J.length),G(Xe)):k(He.value)}for(;ae<M.length;)G(Z++);J._countWaitingForRemove=Re}m.a.g.set(P,C,J),q(V.beforeMove,ge),m.a.D(Ae,V.beforeRemove?m.oa:m.removeNode);var Pe,qe,st;try{st=P.ownerDocument.activeElement}catch{}if(fe.length)for(;(Qe=fe.shift())!=e;){for(Se=J[Qe],Pe=e;Qe;)if((qe=J[--Qe].Y)&&qe.length){Pe=qe[qe.length-1];break}for(M=0;Z=Se.Y[M];Pe=Z,M++)m.h.Wb(P,Z,Pe)}for(Qe=0;Se=J[Qe];Qe++){for(Se.Y||m.a.extend(Se,_(P,F,Se.Aa,B,Se.pb)),M=0;Z=Se.Y[M];Pe=Z,M++)m.h.Wb(P,Z,Pe);!Se.Ed&&B&&(B(Se.Aa,Se.Y,Se.pb),Se.Ed=!0,Pe=Se.Y[Se.Y.length-1])}for(st&&P.ownerDocument.activeElement!=st&&st.focus(),q(V.beforeRemove,xe),Qe=0;Qe<xe.length;++Qe)xe[Qe].Aa=w;q(V.afterMove,ge),q(V.afterAdd,we)}})(),m.b("utils.setDomNodeChildrenFromArrayMapping",m.a.ec),m.ba=function(){this.allowTemplateRewriting=!1},m.ba.prototype=new m.ca,m.ba.prototype.constructor=m.ba,m.ba.prototype.renderTemplateSource=function(_,C,w,P){return(C=!(9>m.a.W)&&_.nodes?_.nodes():null)?m.a.la(C.cloneNode(!0).childNodes):(_=_.text(),m.a.ua(_,P))},m.ba.Ma=new m.ba,m.gc(m.ba.Ma),m.b("nativeTemplateEngine",m.ba),(function(){m.$a=function(){var C=this.Hd=(function(){if(!r||!r.tmpl)return 0;try{if(0<=r.tmpl.tag.tmpl.open.toString().indexOf("__"))return 2}catch{}return 1})();this.renderTemplateSource=function(w,P,M,F){if(F=F||n,M=M||{},2>C)throw Error("Your version of jQuery.tmpl is too old. Please upgrade to jQuery.tmpl 1.0.0pre or later.");var V=w.data("precompiled");return V||(V=w.text()||"",V=r.template(null,"{{ko_with $item.koBindingContext}}"+V+"{{/ko_with}}"),w.data("precompiled",V)),w=[P.$data],P=r.extend({koBindingContext:P},M.templateOptions),P=r.tmpl(V,w,P),P.appendTo(F.createElement("div")),r.fragments={},P},this.createJavaScriptEvaluatorBlock=function(w){return"{{ko_code ((function() { return "+w+" })()) }}"},this.addTemplate=function(w,P){n.write("<script type='text/html' id='"+w+"'>"+P+"</script>")},0<C&&(r.tmpl.tag.ko_code={open:"__.push($1 || '');"},r.tmpl.tag.ko_with={open:"with($1) {",close:"} "})},m.$a.prototype=new m.ca,m.$a.prototype.constructor=m.$a;var _=new m.$a;0<_.Hd&&m.gc(_),m.b("jqueryTmplTemplateEngine",m.$a)})()})})()})()})();var YGt=ko;typeof window<"u"?(ko=window.ko,typeof b8<"u"?window.ko=b8:delete window.ko):(ko=global.ko,typeof b8<"u"?global.ko=b8:delete global.ko);var $C=YGt;/** * @license * Knockout ES5 plugin - https://github.com/SteveSanderson/knockout-es5 * Copyright (c) Steve Sanderson * MIT license - */var Ple="__knockoutObservables",Dle="__knockoutSubscribable";function zke(e,t){if(!e)throw new Error("When calling ko.track, you must pass an object as the first parameter.");var n=this,i=Vke(e,!0);return t=t||Object.getOwnPropertyNames(e),t.forEach(function(r){if(!(r===Ple||r===Dle)&&!(r in i)){var o=e[r],s=o instanceof Array,a=n.isObservable(o)?o:s?n.observableArray(o):n.observable(o);Object.defineProperty(e,r,{configurable:!0,enumerable:!0,get:a,set:n.isWriteableObservable(a)?a:void 0}),i[r]=a,s&&XGt(n,a)}}),e}function Vke(e,t){var n=e[Ple];return!n&&t&&(n={},Object.defineProperty(e,Ple,{value:n})),n}function YGt(e,t,n){var i=this,r={owner:e,deferEvaluation:!0};if(typeof n=="function")r.read=n;else{if("value"in n)throw new Error('For ko.defineProperty, you must not specify a "value" for the property. You must provide a "get" function.');if(typeof n.get!="function")throw new Error('For ko.defineProperty, the third parameter must be either an evaluator function, or an options object containing a function called "get".');r.read=n.get,r.write=n.set}return e[t]=i.computed(r),zke.call(i,e,[t]),e}function XGt(e,t){var n=null;e.computed(function(){n&&(n.dispose(),n=null);var i=t();i instanceof Array&&(n=KGt(e,t,i))})}function KGt(e,t,n){var i=$Gt(e,n);return i.subscribe(t)}function $Gt(e,t){var n=t[Dle];if(!n){n=new e.subscribable,Object.defineProperty(t,Dle,{value:n});var i={};JGt(t,n,i),ZGt(e,t,n,i)}return n}function JGt(e,t,n){["pop","push","reverse","shift","sort","splice","unshift"].forEach(function(i){var r=e[i];e[i]=function(){var o=r.apply(this,arguments);return n.pause!==!0&&t.notifySubscribers(this),o}})}function ZGt(e,t,n,i){["remove","removeAll","destroy","destroyAll","replace"].forEach(function(r){Object.defineProperty(t,r,{enumerable:!1,value:function(){var o;i.pause=!0;try{o=e.observableArray.fn[r].apply(e.observableArray(t),arguments)}finally{i.pause=!1}return n.notifySubscribers(t),o}})})}function jke(e,t){if(!e)return null;var n=Vke(e,!1);return n&&n[t]||null}function QGt(e,t){var n=jke(e,t);n&&n.valueHasMutated()}function e5t(e){e.track=zke,e.getObservable=jke,e.valueHasMutated=QGt,e.defineProperty=YGt}var x8={attachToKo:e5t};var Hke="http://www.w3.org/2000/svg",Gke="cesium-svgPath-svg",t5t={register:function(e){e.bindingHandlers.cesiumSvgPath={init:function(t,n){let i=document.createElementNS(Hke,"svg:svg");i.setAttribute("class",Gke);let r=document.createElementNS(Hke,"path");return i.appendChild(r),e.virtualElements.setDomNodeChildren(t,[i]),e.computed({read:function(){let o=e.unwrap(n());r.setAttribute("d",e.unwrap(o.path));let s=e.unwrap(o.width),a=e.unwrap(o.height);i.setAttribute("width",s),i.setAttribute("height",a),i.setAttribute("viewBox",`0 0 ${s} ${a}`),o.css&&i.setAttribute("class",`${Gke} ${e.unwrap(o.css)}`)},disposeWhenNodeIsRemoved:t}),{controlsDescendantBindings:!0}}},e.virtualElements.allowedBindings.cesiumSvgPath=!0}},T8=t5t;x8.attachToKo($C);T8.register($C);var ve=$C;function E8(e){l(e)||(e=new Lm),this._clock=e,this._eventHelper=new Xo,this._eventHelper.add(e.onTick,this.synchronize,this),this.systemTime=ve.observable(K.now()),this.systemTime.equalityComparer=K.equals,this.startTime=ve.observable(e.startTime),this.startTime.equalityComparer=K.equals,this.startTime.subscribe(function(t){e.startTime=t,this.synchronize()},this),this.stopTime=ve.observable(e.stopTime),this.stopTime.equalityComparer=K.equals,this.stopTime.subscribe(function(t){e.stopTime=t,this.synchronize()},this),this.currentTime=ve.observable(e.currentTime),this.currentTime.equalityComparer=K.equals,this.currentTime.subscribe(function(t){e.currentTime=t,this.synchronize()},this),this.multiplier=ve.observable(e.multiplier),this.multiplier.subscribe(function(t){e.multiplier=t,this.synchronize()},this),this.clockStep=ve.observable(e.clockStep),this.clockStep.subscribe(function(t){e.clockStep=t,this.synchronize()},this),this.clockRange=ve.observable(e.clockRange),this.clockRange.subscribe(function(t){e.clockRange=t,this.synchronize()},this),this.canAnimate=ve.observable(e.canAnimate),this.canAnimate.subscribe(function(t){e.canAnimate=t,this.synchronize()},this),this.shouldAnimate=ve.observable(e.shouldAnimate),this.shouldAnimate.subscribe(function(t){e.shouldAnimate=t,this.synchronize()},this),ve.track(this,["systemTime","startTime","stopTime","currentTime","multiplier","clockStep","clockRange","canAnimate","shouldAnimate"])}Object.defineProperties(E8.prototype,{clock:{get:function(){return this._clock}}});E8.prototype.synchronize=function(){let e=this._clock;this.systemTime=K.now(),this.startTime=e.startTime,this.stopTime=e.stopTime,this.currentTime=e.currentTime,this.multiplier=e.multiplier,this.clockStep=e.clockStep,this.clockRange=e.clockRange,this.canAnimate=e.canAnimate,this.shouldAnimate=e.shouldAnimate};E8.prototype.isDestroyed=function(){return!1};E8.prototype.destroy=function(){this._eventHelper.removeAll(),le(this)};var C8=E8;function n5t(){this.canExecute=void 0,this.beforeExecute=void 0,this.afterExecute=void 0,pe.throwInstantiationError()}var Rle=n5t;function i5t(e,t){t=t??!0;let n=new be,i=new be;function r(){let o={args:arguments,cancel:!1},s;return n.raiseEvent(o),o.cancel||(s=e.apply(null,arguments),i.raiseEvent(s)),s}return r.canExecute=t,ve.track(r,["canExecute"]),Object.defineProperties(r,{beforeExecute:{value:n},afterExecute:{value:i}}),r}var Rn=i5t;var QP={};QP.createCheckbox=function(e,t,n){let i=document.createElement("div"),r=document.createElement("label"),o=document.createElement("input");o.type="checkbox";let s=`checked: ${t}`;return l(n)&&(s+=`, enable: ${n}`),o.setAttribute("data-bind",s),r.appendChild(o),r.appendChild(document.createTextNode(e)),i.appendChild(r),i};QP.createSection=function(e,t,n,i){let r=document.createElement("div");r.className="cesium-cesiumInspector-section",r.setAttribute("data-bind",`css: { "cesium-cesiumInspector-section-collapsed": !${n} }`),e.appendChild(r);let o=document.createElement("h3");o.className="cesium-cesiumInspector-sectionHeader",o.appendChild(document.createTextNode(t)),o.setAttribute("data-bind",`click: ${i}`),r.appendChild(o);let s=document.createElement("div");return s.className="cesium-cesiumInspector-sectionContent",r.appendChild(s),s};QP.createRangeInput=function(e,t,n,i,r,o){o=o??t;let s=document.createElement("input");s.setAttribute("data-bind",`value: ${o}`),s.type="number";let a=document.createElement("input");a.type="range",a.min=n,a.max=i,a.step=r??"any",a.setAttribute("data-bind",`valueUpdate: "input", value: ${t}`);let c=document.createElement("div");c.appendChild(a);let u=document.createElement("div");return u.className="cesium-cesiumInspector-slider",u.appendChild(document.createTextNode(e)),u.appendChild(s),u.appendChild(c),u};QP.createRangeInputWithDynamicMinMax=function(e,t,n,i){i=i??t;let r=document.createElement("input");r.setAttribute("data-bind",`value: ${i}`),r.type="number";let o=document.createElement("input");o.type="range",o.step=n??"any",o.setAttribute("data-bind",`valueUpdate: "input", value: ${t}, attr: { min: ${t}Min, max: ${t}Max }`);let s=document.createElement("div");s.appendChild(o);let a=document.createElement("div");return a.className="cesium-cesiumInspector-slider",a.appendChild(document.createTextNode(e)),a.appendChild(r),a.appendChild(s),a};QP.createButton=function(e,t,n){let i=document.createElement("button");i.type="button",i.textContent=e,i.className="cesium-cesiumInspector-pickButton";let r=`click: ${t}`;return l(n)&&(r+=`, css: {"cesium-cesiumInspector-pickButtonHighlight" : ${n}}`),i.setAttribute("data-bind",r),i};var Af=QP;function r5t(e,t,n,i,r){return n.call(i,e[t]),ve.getObservable(e,t).subscribe(n,i,r)}var Cc=r5t;function Wke(e,t){this._command=e,t=t??H.EMPTY_OBJECT,this.toggled=t.toggled??!1,this.tooltip=t.tooltip??"",ve.track(this,["toggled","tooltip"])}Object.defineProperties(Wke.prototype,{command:{get:function(){return this._command}}});var Wb=Wke;var Rl="http://www.w3.org/2000/svg",Kke="http://www.w3.org/1999/xlink",tq,v8=z.fromCssColorString("rgba(247,250,255,0.384)"),nq=z.fromCssColorString("rgba(143,191,255,0.216)"),Ole=z.fromCssColorString("rgba(153,197,255,0.098)"),iq=z.fromCssColorString("rgba(255,255,255,0.086)"),o5t=z.fromCssColorString("rgba(255,255,255,0.267)"),s5t=z.fromCssColorString("rgba(255,255,255,0)"),qke=z.fromCssColorString("rgba(66,67,68,0.3)"),Yke=z.fromCssColorString("rgba(0,0,0,0.5)");function qb(e){return z.fromCssColorString(window.getComputedStyle(e).getPropertyValue("color"))}var S8={animation_pathReset:{tagName:"path",transform:"translate(16,16) scale(0.85) translate(-16,-16)",d:"M24.316,5.318,9.833,13.682,9.833,5.5,5.5,5.5,5.5,25.5,9.833,25.5,9.833,17.318,24.316,25.682z"},animation_pathPause:{tagName:"path",transform:"translate(16,16) scale(0.85) translate(-16,-16)",d:"M13,5.5,7.5,5.5,7.5,25.5,13,25.5zM24.5,5.5,19,5.5,19,25.5,24.5,25.5z"},animation_pathPlay:{tagName:"path",transform:"translate(16,16) scale(0.85) translate(-16,-16)",d:"M6.684,25.682L24.316,15.5L6.684,5.318V25.682z"},animation_pathPlayReverse:{tagName:"path",transform:"translate(16,16) scale(-0.85,0.85) translate(-16,-16)",d:"M6.684,25.682L24.316,15.5L6.684,5.318V25.682z"},animation_pathLoop:{tagName:"path",transform:"translate(16,16) scale(0.85) translate(-16,-16)",d:"M24.249,15.499c-0.009,4.832-3.918,8.741-8.75,8.75c-2.515,0-4.768-1.064-6.365-2.763l2.068-1.442l-7.901-3.703l0.744,8.694l2.193-1.529c2.244,2.594,5.562,4.242,9.26,4.242c6.767,0,12.249-5.482,12.249-12.249H24.249zM15.499,6.75c2.516,0,4.769,1.065,6.367,2.764l-2.068,1.443l7.901,3.701l-0.746-8.693l-2.192,1.529c-2.245-2.594-5.562-4.245-9.262-4.245C8.734,3.25,3.25,8.734,3.249,15.499H6.75C6.758,10.668,10.668,6.758,15.499,6.75z"},animation_pathClock:{tagName:"path",transform:"translate(16,16) scale(0.85) translate(-16,-15.5)",d:"M15.5,2.374C8.251,2.375,2.376,8.251,2.374,15.5C2.376,22.748,8.251,28.623,15.5,28.627c7.249-0.004,13.124-5.879,13.125-13.127C28.624,8.251,22.749,2.375,15.5,2.374zM15.5,25.623C9.909,25.615,5.385,21.09,5.375,15.5C5.385,9.909,9.909,5.384,15.5,5.374c5.59,0.01,10.115,4.535,10.124,10.125C25.615,21.09,21.091,25.615,15.5,25.623zM8.625,15.5c-0.001-0.552-0.448-0.999-1.001-1c-0.553,0-1,0.448-1,1c0,0.553,0.449,1,1,1C8.176,16.5,8.624,16.053,8.625,15.5zM8.179,18.572c-0.478,0.277-0.642,0.889-0.365,1.367c0.275,0.479,0.889,0.641,1.365,0.365c0.479-0.275,0.643-0.887,0.367-1.367C9.27,18.461,8.658,18.297,8.179,18.572zM9.18,10.696c-0.479-0.276-1.09-0.112-1.366,0.366s-0.111,1.09,0.365,1.366c0.479,0.276,1.09,0.113,1.367-0.366C9.821,11.584,9.657,10.973,9.18,10.696zM22.822,12.428c0.478-0.275,0.643-0.888,0.366-1.366c-0.275-0.478-0.89-0.642-1.366-0.366c-0.479,0.278-0.642,0.89-0.366,1.367C21.732,12.54,22.344,12.705,22.822,12.428zM12.062,21.455c-0.478-0.275-1.089-0.111-1.366,0.367c-0.275,0.479-0.111,1.09,0.366,1.365c0.478,0.277,1.091,0.111,1.365-0.365C12.704,22.344,12.54,21.732,12.062,21.455zM12.062,9.545c0.479-0.276,0.642-0.888,0.366-1.366c-0.276-0.478-0.888-0.642-1.366-0.366s-0.642,0.888-0.366,1.366C10.973,9.658,11.584,9.822,12.062,9.545zM22.823,18.572c-0.48-0.275-1.092-0.111-1.367,0.365c-0.275,0.479-0.112,1.092,0.367,1.367c0.477,0.275,1.089,0.113,1.365-0.365C23.464,19.461,23.3,18.848,22.823,18.572zM19.938,7.813c-0.477-0.276-1.091-0.111-1.365,0.366c-0.275,0.48-0.111,1.091,0.366,1.367s1.089,0.112,1.366-0.366C20.581,8.702,20.418,8.089,19.938,7.813zM23.378,14.5c-0.554,0.002-1.001,0.45-1.001,1c0.001,0.552,0.448,1,1.001,1c0.551,0,1-0.447,1-1C24.378,14.949,23.929,14.5,23.378,14.5zM15.501,6.624c-0.552,0-1,0.448-1,1l-0.466,7.343l-3.004,1.96c-0.478,0.277-0.642,0.889-0.365,1.365c0.275,0.479,0.889,0.643,1.365,0.367l3.305-1.676C15.39,16.99,15.444,17,15.501,17c0.828,0,1.5-0.671,1.5-1.5l-0.5-7.876C16.501,7.072,16.053,6.624,15.501,6.624zM15.501,22.377c-0.552,0-1,0.447-1,1s0.448,1,1,1s1-0.447,1-1S16.053,22.377,15.501,22.377zM18.939,21.455c-0.479,0.277-0.643,0.889-0.366,1.367c0.275,0.477,0.888,0.643,1.366,0.365c0.478-0.275,0.642-0.889,0.366-1.365C20.028,21.344,19.417,21.18,18.939,21.455z"},animation_pathWingButton:{tagName:"path",d:"m 4.5,0.5 c -2.216,0 -4,1.784 -4,4 l 0,24 c 0,2.216 1.784,4 4,4 l 13.71875,0 C 22.478584,27.272785 27.273681,22.511272 32.5,18.25 l 0,-13.75 c 0,-2.216 -1.784,-4 -4,-4 l -24,0 z"},animation_pathPointer:{tagName:"path",d:"M-15,-65,-15,-55,15,-55,15,-65,0,-95z"},animation_pathSwooshFX:{tagName:"path",d:"m 85,0 c 0,16.617 -4.813944,35.356 -13.131081,48.4508 h 6.099803 c 8.317138,-13.0948 13.13322,-28.5955 13.13322,-45.2124 0,-46.94483 -38.402714,-85.00262 -85.7743869,-85.00262 -1.0218522,0 -2.0373001,0.0241 -3.0506131,0.0589 45.958443,1.59437 82.723058,35.77285 82.723058,81.70532 z"}};function Ap(e){let t=document.createElementNS(Rl,e.tagName);for(let n in e)if(e.hasOwnProperty(n)&&n!=="tagName")if(n==="children"){let i=e.children.length;for(let r=0;r<i;++r)t.appendChild(Ap(e.children[r]))}else n.indexOf("xlink:")===0?t.setAttributeNS(Kke,n.substring(6),e[n]):n==="textContent"?t.textContent=e[n]:t.setAttribute(n,e[n]);return t}function Nle(e,t,n){let i=document.createElementNS(Rl,"text");i.setAttribute("x",e),i.setAttribute("y",t),i.setAttribute("class","cesium-animation-svgText");let r=document.createElementNS(Rl,"tspan");return r.textContent=n,i.appendChild(r),i}function a5t(e,t){let n=Nle(e,t,"");n.removeChild(n.firstChild);let i={},r=[],o=["month","day","year"];for(let a=0;a<o.length;++a){if(a>0){let f=document.createElementNS(Rl,"tspan");f.textContent=" ",r.push(f),n.appendChild(f)}let c=o[a],u=document.createElementNS(Rl,"tspan");u.setAttribute("class",`cesium-animation-dateField cesium-animation-dateField-${c}`),u.setAttribute("aria-label",`Adjust ${c} with mouse wheel`),i[c]=u,n.appendChild(u)}let s=document.createElementNS(Rl,"tspan");return n.appendChild(s),{element:n,fallback:s,parts:i,separators:r}}function c5t(e,t){let n=/^(\S+)\s+(\d{1,2})\s+(\d{1,4})$/.exec(t),i=e.parts,r=e.separators;if(n===null){i.month.textContent="",i.day.textContent="",i.year.textContent="",r[0].textContent="",r[1].textContent="",e.fallback.textContent=t;return}i.month.textContent=n[1],i.day.textContent=n[2],i.year.textContent=n[3],r[0].textContent=" ",r[1].textContent=" ",e.fallback.textContent=""}function l5t(e,t){let n=Nle(e,t,"");n.removeChild(n.firstChild);let i={},r=[],o=["hour","minute","second"];for(let f=0;f<o.length;++f){if(f>0){let g=document.createElementNS(Rl,"tspan");g.textContent=":",r.push(g),n.appendChild(g)}let d=o[f],p=document.createElementNS(Rl,"tspan");p.setAttribute("class",`cesium-animation-timeField cesium-animation-timeField-${d}`),p.setAttribute("aria-label",`Adjust ${d} with mouse wheel`),i[d]=p,n.appendChild(p)}let s=document.createElementNS(Rl,"tspan");n.appendChild(s);let a=document.createElementNS(Rl,"tspan");a.setAttribute("class","cesium-animation-timeField cesium-animation-timeField-millisecond"),a.setAttribute("aria-label","Adjust millisecond with mouse wheel"),i.millisecond=a,n.appendChild(a);let c=document.createElementNS(Rl,"tspan");n.appendChild(c);let u=document.createElementNS(Rl,"tspan");return n.appendChild(u),{decimalPoint:s,element:n,fallback:u,parts:i,separators:r,suffix:c}}function u5t(e,t){let n=/^(\d{2}):(\d{2}):(\d{2})(?:\.(\d{3})| UTC)$/.exec(t),i=e.parts,r=e.separators;if(n===null){i.hour.textContent="",i.minute.textContent="",i.second.textContent="",i.millisecond.textContent="",r[0].textContent="",r[1].textContent="",e.decimalPoint.textContent="",e.suffix.textContent="",e.fallback.textContent=t;return}i.hour.textContent=n[1],i.minute.textContent=n[2],i.second.textContent=n[3],r[0].textContent=":",r[1].textContent=":",e.decimalPoint.textContent=l(n[4])?".":"",i.millisecond.textContent=n[4]??"",e.suffix.textContent=l(n[4])?"":" UTC",e.fallback.textContent=""}function Xke(e,t,n){let i=Object.keys(t);for(let r=0;r<i.length;++r){let o=i[r],s=t[o],a=function(c){c.deltaY!==0&&(n(o,c.deltaY<0?1:-1),c.preventDefault(),c.stopPropagation())};s.addEventListener("wheel",a,!1),e._fieldWheelListeners.push({element:s,listener:a})}}function f5t(e,t,n){e.setAttribute("transform",`translate(100,100) rotate(${n})`),t.setAttribute("transform",`rotate(${n})`)}var rq=new z;function Xs(e,t){let n=t.alpha,i=1-n;return rq.red=e.red*i+t.red*n,rq.green=e.green*i+t.green*n,rq.blue=e.blue*i+t.blue*n,rq.toCssColorString()}function Mle(e,t,n){let i=S8[n],r={tagName:"g",class:"cesium-animation-rectButton",transform:`translate(${e},${t})`,children:[{tagName:"rect",class:"cesium-animation-buttonGlow",width:32,height:32,rx:2,ry:2},{tagName:"rect",class:"cesium-animation-buttonMain",width:32,height:32,rx:4,ry:4},{class:"cesium-animation-buttonPath",id:n,tagName:i.tagName,transform:i.transform,d:i.d},{tagName:"title",textContent:""}]};return Ap(r)}function d5t(e,t,n){let i=S8[n],r=S8.animation_pathWingButton,o={tagName:"g",class:"cesium-animation-rectButton",transform:`translate(${e},${t})`,children:[{class:"cesium-animation-buttonGlow",id:"animation_pathWingButton",tagName:r.tagName,d:r.d},{class:"cesium-animation-buttonMain",id:"animation_pathWingButton",tagName:r.tagName,d:r.d},{class:"cesium-animation-buttonPath",id:n,tagName:i.tagName,transform:i.transform,d:i.d},{tagName:"title",textContent:""}]};return Ap(o)}function h5t(e,t){let n=e._viewModel,i=n.shuttleRingDragging;if(!(i&&tq!==e))if(t.type==="mousedown"||i&&t.type==="mousemove"||t.type==="touchstart"&&t.touches.length===1||i&&t.type==="touchmove"&&t.touches.length===1){let r=e._centerX,o=e._centerY,a=e._svgNode.getBoundingClientRect(),c,u;if(t.type==="touchstart"||t.type==="touchmove"?(c=t.touches[0].clientX,u=t.touches[0].clientY):(c=t.clientX,u=t.clientY),!i&&(c>a.right||c<a.left||u<a.top||u>a.bottom))return;let f=e._shuttleRingPointer.getBoundingClientRect(),d=c-r-a.left,p=u-o-a.top,g=Math.atan2(p,d)*180/Math.PI+90;g>180&&(g-=360);let m=n.shuttleRingAngle;i||c<f.right&&c>f.left&&u>f.top&&u<f.bottom?(tq=e,n.shuttleRingDragging=!0,n.shuttleRingAngle=g):g<m?n.slower():g>m&&n.faster(),t.preventDefault()}else e===tq&&(tq=void 0),n.shuttleRingDragging=!1}function Ey(e,t){this._viewModel=t,this.svgElement=e,this._enabled=void 0,this._toggled=void 0;let n=this;this._clickFunction=function(){let i=n._viewModel.command;i.canExecute&&i()},e.addEventListener("click",this._clickFunction,!0),this._subscriptions=[Cc(t,"toggled",this.setToggled,this),Cc(t,"tooltip",this.setTooltip,this),Cc(t.command,"canExecute",this.setEnabled,this)]}Ey.prototype.destroy=function(){this.svgElement.removeEventListener("click",this._clickFunction,!0);let e=this._subscriptions;for(let t=0,n=e.length;t<n;t++)e[t].dispose();le(this)};Ey.prototype.isDestroyed=function(){return!1};Ey.prototype.setEnabled=function(e){if(this._enabled!==e){if(this._enabled=e,!e){this.svgElement.setAttribute("class","cesium-animation-buttonDisabled");return}if(this._toggled){this.svgElement.setAttribute("class","cesium-animation-rectButton cesium-animation-buttonToggled");return}this.svgElement.setAttribute("class","cesium-animation-rectButton")}};Ey.prototype.setToggled=function(e){this._toggled!==e&&(this._toggled=e,this._enabled&&(e?this.svgElement.setAttribute("class","cesium-animation-rectButton cesium-animation-buttonToggled"):this.svgElement.setAttribute("class","cesium-animation-rectButton")))};Ey.prototype.setTooltip=function(e){this.svgElement.getElementsByTagName("title")[0].textContent=e};function eD(e,t){e=Ln(e),this._viewModel=t,this._container=e,this._centerX=0,this._centerY=0,this._defsElement=void 0,this._svgNode=void 0,this._topG=void 0,this._lastHeight=void 0,this._lastWidth=void 0;let n=e.ownerDocument,i=document.createElement("style");i.textContent=".cesium-animation-rectButton .cesium-animation-buttonGlow { filter: url(#animation_blurred); }.cesium-animation-rectButton .cesium-animation-buttonMain { fill: url(#animation_buttonNormal); }.cesium-animation-buttonToggled .cesium-animation-buttonMain { fill: url(#animation_buttonToggled); }.cesium-animation-rectButton:hover .cesium-animation-buttonMain { fill: url(#animation_buttonHovered); }.cesium-animation-buttonDisabled .cesium-animation-buttonMain { fill: url(#animation_buttonDisabled); }.cesium-animation-shuttleRingG .cesium-animation-shuttleRingSwoosh { fill: url(#animation_shuttleRingSwooshGradient); }.cesium-animation-shuttleRingG:hover .cesium-animation-shuttleRingSwoosh { fill: url(#animation_shuttleRingSwooshHovered); }.cesium-animation-shuttleRingPointer { fill: url(#animation_shuttleRingPointerGradient); }.cesium-animation-shuttleRingPausePointer { fill: url(#animation_shuttleRingPointerPaused); }.cesium-animation-knobOuter { fill: url(#animation_knobOuter); }.cesium-animation-knobInner { fill: url(#animation_knobInner); }",n.head.insertBefore(i,n.head.childNodes[0]);let r=document.createElement("div");r.className="cesium-animation-theme",r.innerHTML='<div class="cesium-animation-themeNormal"></div><div class="cesium-animation-themeHover"></div><div class="cesium-animation-themeSelect"></div><div class="cesium-animation-themeDisabled"></div><div class="cesium-animation-themeKnob"></div><div class="cesium-animation-themePointer"></div><div class="cesium-animation-themeSwoosh"></div><div class="cesium-animation-themeSwooshHover"></div>',this._theme=r,this._themeNormal=r.childNodes[0],this._themeHover=r.childNodes[1],this._themeSelect=r.childNodes[2],this._themeDisabled=r.childNodes[3],this._themeKnob=r.childNodes[4],this._themePointer=r.childNodes[5],this._themeSwoosh=r.childNodes[6],this._themeSwooshHover=r.childNodes[7];let o=document.createElementNS(Rl,"svg:svg");this._svgNode=o,o.setAttributeNS("http://www.w3.org/2000/xmlns/","xmlns:xlink",Kke);let s=document.createElementNS(Rl,"g");this._topG=s,this._realtimeSVG=new Ey(d5t(3,4,"animation_pathClock"),t.playRealtimeViewModel),this._playReverseSVG=new Ey(Mle(44,99,"animation_pathPlayReverse"),t.playReverseViewModel),this._playForwardSVG=new Ey(Mle(124,99,"animation_pathPlay"),t.playForwardViewModel),this._pauseSVG=new Ey(Mle(84,99,"animation_pathPause"),t.pauseViewModel);let a=document.createElementNS(Rl,"g");a.appendChild(this._realtimeSVG.svgElement),a.appendChild(this._playReverseSVG.svgElement),a.appendChild(this._playForwardSVG.svgElement),a.appendChild(this._pauseSVG.svgElement);let c=Ap({tagName:"circle",class:"cesium-animation-shuttleRingBack",cx:100,cy:100,r:99});this._shuttleRingBackPanel=c;let u=S8.animation_pathSwooshFX,f=S8.animation_pathPointer,d=Ap({tagName:"g",class:"cesium-animation-shuttleRingSwoosh",children:[{tagName:u.tagName,transform:"translate(100,97) scale(-1,1)",id:"animation_pathSwooshFX",d:u.d},{tagName:u.tagName,transform:"translate(100,97)",id:"animation_pathSwooshFX",d:u.d},{tagName:"line",x1:100,y1:8,x2:100,y2:22}]});this._shuttleRingSwooshG=d,this._shuttleRingPointer=Ap({class:"cesium-animation-shuttleRingPointer",id:"animation_pathPointer",tagName:f.tagName,d:f.d});let p=Ap({tagName:"g",transform:"translate(100,100)"});this._knobOuter=Ap({tagName:"circle",class:"cesium-animation-knobOuter",cx:0,cy:0,r:71});let g=61,m=Ap({tagName:"circle",class:"cesium-animation-knobInner",cx:0,cy:0,r:g}),y=a5t(0,-24);this._knobDate=y.element;let A=l5t(0,-7);this._knobTime=A.element,this._knobStatus=Nle(0,-41,"");let b=Ap({tagName:"circle",class:"cesium-animation-blank",cx:0,cy:0,r:g}),x=document.createElementNS(Rl,"g");x.setAttribute("class","cesium-animation-shuttleRingG"),e.appendChild(r),s.appendChild(x),s.appendChild(p),s.appendChild(a),x.appendChild(c),x.appendChild(d),x.appendChild(this._shuttleRingPointer),p.appendChild(this._knobOuter),p.appendChild(m),p.appendChild(this._knobStatus),p.appendChild(b),p.appendChild(this._knobDate),p.appendChild(this._knobTime),o.appendChild(s),e.appendChild(o);let T=this;function E(I){h5t(T,I)}this._mouseCallback=E,c.addEventListener("mousedown",E,!0),c.addEventListener("touchstart",E,!0),d.addEventListener("mousedown",E,!0),d.addEventListener("touchstart",E,!0),n.addEventListener("mousemove",E,!0),n.addEventListener("touchmove",E,!0),n.addEventListener("mouseup",E,!0),n.addEventListener("touchend",E,!0),n.addEventListener("touchcancel",E,!0),this._shuttleRingPointer.addEventListener("mousedown",E,!0),this._shuttleRingPointer.addEventListener("touchstart",E,!0),this._knobOuter.addEventListener("mousedown",E,!0),this._knobOuter.addEventListener("touchstart",E,!0);let v=this._knobStatus.childNodes[0];this._fieldWheelListeners=[],Xke(this,y.parts,function(I,R){t.adjustDate(I,R)}),Xke(this,A.parts,function(I,R){t.adjustTime(I,R)});let S;this._subscriptions=[Cc(t.pauseViewModel,"toggled",function(I){S!==I&&(S=I,S?T._shuttleRingPointer.setAttribute("class","cesium-animation-shuttleRingPausePointer"):T._shuttleRingPointer.setAttribute("class","cesium-animation-shuttleRingPointer"))}),Cc(t,"shuttleRingAngle",function(I){f5t(T._shuttleRingPointer,T._knobOuter,I)}),Cc(t,"dateLabel",function(I){T._knobDate.textContent!==I&&c5t(y,I)}),Cc(t,"timeLabel",function(I){T._knobTime.textContent!==I&&u5t(A,I)}),Cc(t,"multiplierLabel",function(I){v.textContent!==I&&(v.textContent=I)})],this.applyThemeChanges(),this.resize()}Object.defineProperties(eD.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}}});eD.prototype.isDestroyed=function(){return!1};eD.prototype.destroy=function(){l(this._observer)&&(this._observer.disconnect(),this._observer=void 0);let e=this._container.ownerDocument,t=this._mouseCallback;this._shuttleRingBackPanel.removeEventListener("mousedown",t,!0),this._shuttleRingBackPanel.removeEventListener("touchstart",t,!0),this._shuttleRingSwooshG.removeEventListener("mousedown",t,!0),this._shuttleRingSwooshG.removeEventListener("touchstart",t,!0),e.removeEventListener("mousemove",t,!0),e.removeEventListener("touchmove",t,!0),e.removeEventListener("mouseup",t,!0),e.removeEventListener("touchend",t,!0),e.removeEventListener("touchcancel",t,!0),this._shuttleRingPointer.removeEventListener("mousedown",t,!0),this._shuttleRingPointer.removeEventListener("touchstart",t,!0),this._knobOuter.removeEventListener("mousedown",t,!0),this._knobOuter.removeEventListener("touchstart",t,!0);let n=this._fieldWheelListeners;for(let r=0;r<n.length;++r){let o=n[r];o.element.removeEventListener("wheel",o.listener,!1)}this._container.removeChild(this._svgNode),this._container.removeChild(this._theme),this._realtimeSVG.destroy(),this._playReverseSVG.destroy(),this._playForwardSVG.destroy(),this._pauseSVG.destroy();let i=this._subscriptions;for(let r=0,o=i.length;r<o;r++)i[r].dispose();return le(this)};eD.prototype.resize=function(){let e=this._container.clientWidth,t=this._container.clientHeight;if(e===this._lastWidth&&t===this._lastHeight)return;let n=this._svgNode,i=200,r=132,o=e,s=t;e===0&&t===0?(o=i,s=r):e===0?(s=t,o=i*(t/r)):t===0&&(o=e,s=r*(e/i));let a=o/i,c=s/r;n.style.cssText=`width: ${o}px; height: ${s}px; position: absolute; bottom: 0; left: 0; overflow: hidden;`,n.setAttribute("width",o),n.setAttribute("height",s),n.setAttribute("viewBox",`0 0 ${o} ${s}`),this._topG.setAttribute("transform",`scale(${a},${c})`),this._centerX=Math.max(1,100*a),this._centerY=Math.max(1,100*c),this._lastHeight=e,this._lastWidth=t};eD.prototype.applyThemeChanges=function(){let e=this._container.ownerDocument;if(!e.body.contains(this._container)){if(l(this._observer))return;let f=this;f._observer=new MutationObserver(function(){e.body.contains(f._container)&&(f._observer.disconnect(),f._observer=void 0,f.applyThemeChanges())}),f._observer.observe(e,{childList:!0,subtree:!0});return}let t=qb(this._themeNormal),n=qb(this._themeHover),i=qb(this._themeSelect),r=qb(this._themeDisabled),o=qb(this._themeKnob),s=qb(this._themePointer),a=qb(this._themeSwoosh),c=qb(this._themeSwooshHover),u=Ap({tagName:"defs",children:[{id:"animation_buttonNormal",tagName:"linearGradient",x1:"50%",y1:"0%",x2:"50%",y2:"100%",children:[{tagName:"stop",offset:"0%","stop-color":Xs(t,v8)},{tagName:"stop",offset:"12%","stop-color":Xs(t,nq)},{tagName:"stop",offset:"46%","stop-color":Xs(t,Ole)},{tagName:"stop",offset:"81%","stop-color":Xs(t,iq)}]},{id:"animation_buttonHovered",tagName:"linearGradient",x1:"50%",y1:"0%",x2:"50%",y2:"100%",children:[{tagName:"stop",offset:"0%","stop-color":Xs(n,v8)},{tagName:"stop",offset:"12%","stop-color":Xs(n,nq)},{tagName:"stop",offset:"46%","stop-color":Xs(n,Ole)},{tagName:"stop",offset:"81%","stop-color":Xs(n,iq)}]},{id:"animation_buttonToggled",tagName:"linearGradient",x1:"50%",y1:"0%",x2:"50%",y2:"100%",children:[{tagName:"stop",offset:"0%","stop-color":Xs(i,v8)},{tagName:"stop",offset:"12%","stop-color":Xs(i,nq)},{tagName:"stop",offset:"46%","stop-color":Xs(i,Ole)},{tagName:"stop",offset:"81%","stop-color":Xs(i,iq)}]},{id:"animation_buttonDisabled",tagName:"linearGradient",x1:"50%",y1:"0%",x2:"50%",y2:"100%",children:[{tagName:"stop",offset:"0%","stop-color":Xs(r,o5t)},{tagName:"stop",offset:"75%","stop-color":Xs(r,s5t)}]},{id:"animation_blurred",tagName:"filter",width:"200%",height:"200%",x:"-50%",y:"-50%",children:[{tagName:"feGaussianBlur",stdDeviation:4,in:"SourceGraphic"}]},{id:"animation_shuttleRingSwooshGradient",tagName:"linearGradient",x1:"50%",y1:"0%",x2:"50%",y2:"100%",children:[{tagName:"stop",offset:"0%","stop-opacity":.2,"stop-color":a.toCssColorString()},{tagName:"stop",offset:"85%","stop-opacity":.85,"stop-color":a.toCssColorString()},{tagName:"stop",offset:"95%","stop-opacity":.05,"stop-color":a.toCssColorString()}]},{id:"animation_shuttleRingSwooshHovered",tagName:"linearGradient",x1:"50%",y1:"0%",x2:"50%",y2:"100%",children:[{tagName:"stop",offset:"0%","stop-opacity":.2,"stop-color":c.toCssColorString()},{tagName:"stop",offset:"85%","stop-opacity":.85,"stop-color":c.toCssColorString()},{tagName:"stop",offset:"95%","stop-opacity":.05,"stop-color":c.toCssColorString()}]},{id:"animation_shuttleRingPointerGradient",tagName:"linearGradient",x1:"0%",y1:"50%",x2:"100%",y2:"50%",children:[{tagName:"stop",offset:"0%","stop-color":s.toCssColorString()},{tagName:"stop",offset:"40%","stop-color":s.toCssColorString()},{tagName:"stop",offset:"60%","stop-color":Xs(s,Yke)},{tagName:"stop",offset:"100%","stop-color":Xs(s,Yke)}]},{id:"animation_shuttleRingPointerPaused",tagName:"linearGradient",x1:"0%",y1:"50%",x2:"100%",y2:"50%",children:[{tagName:"stop",offset:"0%","stop-color":"#CCC"},{tagName:"stop",offset:"40%","stop-color":"#CCC"},{tagName:"stop",offset:"60%","stop-color":"#555"},{tagName:"stop",offset:"100%","stop-color":"#555"}]},{id:"animation_knobOuter",tagName:"linearGradient",x1:"20%",y1:"0%",x2:"90%",y2:"100%",children:[{tagName:"stop",offset:"5%","stop-color":Xs(o,v8)},{tagName:"stop",offset:"60%","stop-color":Xs(o,qke)},{tagName:"stop",offset:"85%","stop-color":Xs(o,nq)}]},{id:"animation_knobInner",tagName:"linearGradient",x1:"20%",y1:"0%",x2:"90%",y2:"100%",children:[{tagName:"stop",offset:"5%","stop-color":Xs(o,qke)},{tagName:"stop",offset:"60%","stop-color":Xs(o,v8)},{tagName:"stop",offset:"85%","stop-color":Xs(o,iq)}]}]});l(this._defsElement)?this._svgNode.replaceChild(u,this._defsElement):this._svgNode.appendChild(u),this._defsElement=u};var w8=eD;var m5t=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],Yb=15,tD=105,p5t=[31,28,31,30,31,30,31,31,30,31,30,31];function g5t(e,t){return t===2&&kl(e)?29:p5t[t-1]}function $ke(e,t,n){return K.fromGregorianDate(new Bh(t,n,Math.min(e.day,g5t(t,n)),e.hour,e.minute,e.second,e.millisecond,e.isLeapSecond))}function Jke(e,t){return e-t}function Lle(e,t){let n=vr(t,e,Jke);return n<0?~n:n}function _5t(e,t){if(Math.abs(e)<=Yb)return e/Yb;let n=Yb,i=tD,r,o=0,s;return e>0?(r=Math.log(t[t.length-1]),s=(r-o)/(i-n),Math.exp(o+s*(e-n))):(r=Math.log(-t[0]),s=(r-o)/(i-n),-Math.exp(o+s*(Math.abs(e)-n)))}function y5t(e,t,n){if(n.clockStep===Vr.SYSTEM_CLOCK)return Yb;if(Math.abs(e)<=1)return e*Yb;let i=t[t.length-1];e>i?e=i:e<-i&&(e=-i);let r=Yb,o=tD,s,a=0,c;return e>0?(s=Math.log(i),c=(s-a)/(o-r),(Math.log(e)-a)/c+r):(s=Math.log(-t[0]),c=(s-a)/(o-r),-((Math.log(Math.abs(e))-a)/c+r))}function bf(e){let t=this;this._clockViewModel=e,this._allShuttleRingTicks=[],this._dateFormatter=bf.defaultDateFormatter,this._timeFormatter=bf.defaultTimeFormatter,this.shuttleRingDragging=!1,this.snapToTicks=!1,ve.track(this,["_allShuttleRingTicks","_dateFormatter","_timeFormatter","shuttleRingDragging","snapToTicks"]),this._sortedFilteredPositiveTicks=[],this.setShuttleRingTicks(bf.defaultTicks),this.timeLabel=void 0,ve.defineProperty(this,"timeLabel",function(){return t._timeFormatter(t._clockViewModel.currentTime,t)}),this.dateLabel=void 0,ve.defineProperty(this,"dateLabel",function(){return t._dateFormatter(t._clockViewModel.currentTime,t)}),this.multiplierLabel=void 0,ve.defineProperty(this,"multiplierLabel",function(){let s=t._clockViewModel;if(s.clockStep===Vr.SYSTEM_CLOCK)return"Today";let a=s.multiplier;return a%1===0?`${a.toFixed(0)}x`:`${a.toFixed(3).replace(/0{0,3}$/,"")}x`}),this.shuttleRingAngle=void 0,ve.defineProperty(this,"shuttleRingAngle",{get:function(){return y5t(e.multiplier,t._allShuttleRingTicks,e)},set:function(s){s=Math.max(Math.min(s,tD),-tD);let a=t._allShuttleRingTicks,c=t._clockViewModel;if(c.clockStep=Vr.SYSTEM_CLOCK_MULTIPLIER,Math.abs(s)===tD){c.multiplier=s>0?a[a.length-1]:a[0];return}let u=_5t(s,a);if(t.snapToTicks)u=a[Lle(u,a)];else if(u!==0){let f=Math.abs(u);if(f>100){let d=f.toFixed(0).length-2,p=Math.pow(10,d);u=Math.round(u/p)*p|0}else f>Yb?u=Math.round(u):f>1?u=+u.toFixed(1):f>0&&(u=+u.toFixed(2))}c.multiplier=u}}),this._canAnimate=void 0,ve.defineProperty(this,"_canAnimate",function(){let s=t._clockViewModel,a=s.clockRange;if(t.shuttleRingDragging||a===Rs.UNBOUNDED)return!0;let c=s.multiplier,u=s.currentTime,f=s.startTime,d;if(a===Rs.LOOP_STOP)d=K.greaterThan(u,f)||u.equals(f)&&c>0;else{let p=s.stopTime;d=K.greaterThan(u,f)&&K.lessThan(u,p)||u.equals(f)&&c>0||u.equals(p)&&c<0}return d||(s.shouldAnimate=!1),d}),this._isSystemTimeAvailable=void 0,ve.defineProperty(this,"_isSystemTimeAvailable",function(){let s=t._clockViewModel;if(s.clockRange===Rs.UNBOUNDED)return!0;let c=s.systemTime;return K.greaterThanOrEquals(c,s.startTime)&&K.lessThanOrEquals(c,s.stopTime)}),this._isAnimating=void 0,ve.defineProperty(this,"_isAnimating",function(){return t._clockViewModel.shouldAnimate&&(t._canAnimate||t.shuttleRingDragging)});let n=Rn(function(){let s=t._clockViewModel;s.shouldAnimate?s.shouldAnimate=!1:t._canAnimate&&(s.shouldAnimate=!0)});this._pauseViewModel=new Wb(n,{toggled:ve.computed(function(){return!t._isAnimating}),tooltip:"Pause"});let i=Rn(function(){let s=t._clockViewModel,a=s.multiplier;a>0&&(s.multiplier=-a),s.shouldAnimate=!0});this._playReverseViewModel=new Wb(i,{toggled:ve.computed(function(){return t._isAnimating&&e.multiplier<0}),tooltip:"Play Reverse"});let r=Rn(function(){let s=t._clockViewModel,a=s.multiplier;a<0&&(s.multiplier=-a),s.shouldAnimate=!0});this._playForwardViewModel=new Wb(r,{toggled:ve.computed(function(){return t._isAnimating&&e.multiplier>0&&e.clockStep!==Vr.SYSTEM_CLOCK}),tooltip:"Play Forward"});let o=Rn(function(){t._clockViewModel.clockStep=Vr.SYSTEM_CLOCK},ve.getObservable(this,"_isSystemTimeAvailable"));this._playRealtimeViewModel=new Wb(o,{toggled:ve.computed(function(){return e.clockStep===Vr.SYSTEM_CLOCK}),tooltip:ve.computed(function(){return t._isSystemTimeAvailable?"Today (real-time)":"Current time not in range"})}),this._slower=Rn(function(){let s=t._clockViewModel,a=t._allShuttleRingTicks,c=s.multiplier,u=Lle(c,a)-1;u>=0&&(s.multiplier=a[u])}),this._faster=Rn(function(){let s=t._clockViewModel,a=t._allShuttleRingTicks,c=s.multiplier,u=Lle(c,a)+1;u<a.length&&(s.multiplier=a[u])})}bf.defaultDateFormatter=function(e,t){let n=K.toGregorianDate(e);return`${m5t[n.month-1]} ${n.day} ${n.year}`};bf.defaultTicks=[.001,.002,.005,.01,.02,.05,.1,.25,.5,1,2,5,10,15,30,60,120,300,600,900,1800,3600,7200,14400,21600,43200,86400,172800,345600,604800];bf.defaultTimeFormatter=function(e,t){let n=K.toGregorianDate(e),i=Math.round(n.millisecond);return Math.abs(t._clockViewModel.multiplier)<1?`${n.hour.toString().padStart(2,"0")}:${n.minute.toString().padStart(2,"0")}:${n.second.toString().padStart(2,"0")}.${i.toString().padStart(3,"0")}`:`${n.hour.toString().padStart(2,"0")}:${n.minute.toString().padStart(2,"0")}:${n.second.toString().padStart(2,"0")} UTC`};bf.prototype.getShuttleRingTicks=function(){return this._sortedFilteredPositiveTicks.slice(0)};bf.prototype.setShuttleRingTicks=function(e){let t,n,i,r={},o=this._sortedFilteredPositiveTicks;for(o.length=0,t=0,n=e.length;t<n;++t)i=e[t],r.hasOwnProperty(i)||(r[i]=!0,o.push(i));o.sort(Jke);let s=[];for(n=o.length,t=n-1;t>=0;--t)i=o[t],i!==0&&s.push(-i);Zn(s,o),this._allShuttleRingTicks=s};bf.prototype.adjustDate=function(e,t){if(t===0)return;let n=this._clockViewModel,i=n.currentTime,r=K.toGregorianDate(i),o;if(e==="day"){o=K.addDays(i,t,new K);let s=K.toGregorianDate(o);if(s.year<1||s.year>9999)return}else if(e==="month"){let a=Math.min(Math.max((r.year-1)*12+r.month-1+t,0),119987),c=Math.floor(a/12)+1,u=a%12+1;o=$ke(r,c,u)}else{let s=Math.min(Math.max(r.year+t,1),9999);o=$ke(r,s,r.month)}K.equals(i,o)||(n.shouldAnimate=!1,n.currentTime=o)};bf.prototype.adjustTime=function(e,t){if(t===0)return;let n=this._clockViewModel,i=n.currentTime,r;if(e==="hour")r=K.addHours(i,t,new K);else if(e==="minute")r=K.addMinutes(i,t,new K);else{let s=e==="second"?t:t/1e3;r=K.addSeconds(i,s,new K)}let o=K.toGregorianDate(r);o.year<1||o.year>9999||(n.shouldAnimate=!1,n.currentTime=r)};Object.defineProperties(bf.prototype,{slower:{get:function(){return this._slower}},faster:{get:function(){return this._faster}},clockViewModel:{get:function(){return this._clockViewModel}},pauseViewModel:{get:function(){return this._pauseViewModel}},playReverseViewModel:{get:function(){return this._playReverseViewModel}},playForwardViewModel:{get:function(){return this._playForwardViewModel}},playRealtimeViewModel:{get:function(){return this._playRealtimeViewModel}},dateFormatter:{get:function(){return this._dateFormatter},set:function(e){this._dateFormatter=e}},timeFormatter:{get:function(){return this._timeFormatter},set:function(e){this._timeFormatter=e}}});bf._maxShuttleRingAngle=tD;bf._realtimeShuttleRingAngle=Yb;var I8=bf;function Zke(e){e=e??H.EMPTY_OBJECT;let t=e.globe,n=e.imageryProviderViewModels??H.EMPTY_ARRAY,i=e.terrainProviderViewModels??H.EMPTY_ARRAY;this._globe=t,this.imageryProviderViewModels=n.slice(0),this.terrainProviderViewModels=i.slice(0),this.dropDownVisible=!1,ve.track(this,["imageryProviderViewModels","terrainProviderViewModels","dropDownVisible"]);let r=ve.getObservable(this,"imageryProviderViewModels"),o=ve.pureComputed(function(){let d=r(),p={},g;for(g=0;g<d.length;g++){let A=d[g],b=A.category;l(p[b])?p[b].push(A):p[b]=[A]}let m=Object.keys(p),y=[];for(g=0;g<m.length;g++){let A=m[g];y.push({name:A,providers:p[A]})}return y});this._imageryProviders=o;let s=ve.getObservable(this,"terrainProviderViewModels"),a=ve.pureComputed(function(){let d=s(),p={},g;for(g=0;g<d.length;g++){let A=d[g],b=A.category;l(p[b])?p[b].push(A):p[b]=[A]}let m=Object.keys(p),y=[];for(g=0;g<m.length;g++){let A=m[g];y.push({name:A,providers:p[A]})}return y});this._terrainProviders=a,this.buttonTooltip=void 0,ve.defineProperty(this,"buttonTooltip",function(){let d=this.selectedImagery,p=this.selectedTerrain,g=l(d)?d.name:void 0,m=l(p)?p.name:void 0;return l(g)&&l(m)?`${g} -${m}`:l(g)?g:m}),this.buttonImageUrl=void 0,ve.defineProperty(this,"buttonImageUrl",function(){let d=this.selectedImagery;if(l(d))return d.iconUrl}),this.selectedImagery=void 0;let c=ve.observable();this._currentImageryLayers=[],ve.defineProperty(this,"selectedImagery",{get:function(){return c()},set:function(d){if(c()===d){this.dropDownVisible=!1;return}let p,g=this._currentImageryLayers,m=g.length,y=this._globe.imageryLayers,A=!1;for(p=0;p<m;p++){let b=y.length;for(let x=0;x<b;x++){let T=y.get(x);if(T===g[p]){y.remove(T),A=!0;break}}}if(l(d)){let b=d.creationCommand();if(Array.isArray(b)){let x=b.length;for(this._currentImageryLayers=[],p=x-1;p>=0;p--){let T=Ss.fromProviderAsync(b[p]);y.add(T,0),this._currentImageryLayers.push(T)}}else{this._currentImageryLayers=[];let x=Ss.fromProviderAsync(b);if(x.name=d.name,A)y.add(x,0);else{let T=y.get(0);l(T)&&y.remove(T),y.add(x,0)}this._currentImageryLayers.push(x)}}c(d),this.dropDownVisible=!1}}),this.selectedTerrain=void 0;let u=ve.observable();ve.defineProperty(this,"selectedTerrain",{get:function(){return u()},set:function(d){if(u()===d){this.dropDownVisible=!1;return}let p;if(l(d)&&(p=d.creationCommand()),l(p)&&!l(p.then))this._globe.depthTestAgainstTerrain=!(p instanceof O0),this._globe.terrainProvider=p;else if(l(p)){let g=!1,m=this._globe.terrainProviderChanged.addEventListener(()=>{g=!0,m()}),A=new p8(p).readyEvent.addEventListener(b=>{g||(this._globe.depthTestAgainstTerrain=!(b instanceof O0),this._globe.terrainProvider=b,A())})}u(d),this.dropDownVisible=!1}});let f=this;this._toggleDropDown=Rn(function(){f.dropDownVisible=!f.dropDownVisible}),this.selectedImagery=e.selectedImageryProviderViewModel??n[0],this.selectedTerrain=e.selectedTerrainProviderViewModel}Object.defineProperties(Zke.prototype,{toggleDropDown:{get:function(){return this._toggleDropDown}},globe:{get:function(){return this._globe}}});var P8=Zke;function oq(e,t){e=Ln(e);let n=new P8(t),i=document.createElement("button");i.type="button",i.className="cesium-button cesium-toolbar-button",i.setAttribute("data-bind","attr: { title: buttonTooltip },click: toggleDropDown"),e.appendChild(i);let r=document.createElement("img");r.setAttribute("draggable","false"),r.className="cesium-baseLayerPicker-selected",r.setAttribute("data-bind","attr: { src: buttonImageUrl }, visible: !!buttonImageUrl"),i.appendChild(r);let o=document.createElement("div");o.className="cesium-baseLayerPicker-dropDown",o.setAttribute("data-bind",'css: { "cesium-baseLayerPicker-dropDown-visible" : dropDownVisible }'),e.appendChild(o);let s=document.createElement("div");s.className="cesium-baseLayerPicker-sectionTitle",s.setAttribute("data-bind","visible: imageryProviderViewModels.length > 0"),s.innerHTML="Imagery",o.appendChild(s);let a=document.createElement("div");a.className="cesium-baseLayerPicker-section",a.setAttribute("data-bind","foreach: _imageryProviders"),o.appendChild(a);let c=document.createElement("div");c.className="cesium-baseLayerPicker-category",a.appendChild(c);let u=document.createElement("div");u.className="cesium-baseLayerPicker-categoryTitle",u.setAttribute("data-bind","text: name"),c.appendChild(u);let f=document.createElement("div");f.className="cesium-baseLayerPicker-choices",f.setAttribute("data-bind","foreach: providers"),c.appendChild(f);let d=document.createElement("div");d.className="cesium-baseLayerPicker-item",d.setAttribute("data-bind",'css: { "cesium-baseLayerPicker-selectedItem" : $data === $parents[1].selectedImagery },attr: { title: tooltip },visible: creationCommand.canExecute,click: function($data) { $parents[1].selectedImagery = $data; }'),f.appendChild(d);let p=document.createElement("img");p.className="cesium-baseLayerPicker-itemIcon",p.setAttribute("data-bind","attr: { src: iconUrl }"),p.setAttribute("draggable","false"),d.appendChild(p);let g=document.createElement("div");g.className="cesium-baseLayerPicker-itemLabel",g.setAttribute("data-bind","text: name"),d.appendChild(g);let m=document.createElement("div");m.className="cesium-baseLayerPicker-sectionTitle",m.setAttribute("data-bind","visible: terrainProviderViewModels.length > 0"),m.innerHTML="Terrain",o.appendChild(m);let y=document.createElement("div");y.className="cesium-baseLayerPicker-section",y.setAttribute("data-bind","foreach: _terrainProviders"),o.appendChild(y);let A=document.createElement("div");A.className="cesium-baseLayerPicker-category",y.appendChild(A);let b=document.createElement("div");b.className="cesium-baseLayerPicker-categoryTitle",b.setAttribute("data-bind","text: name"),A.appendChild(b);let x=document.createElement("div");x.className="cesium-baseLayerPicker-choices",x.setAttribute("data-bind","foreach: providers"),A.appendChild(x);let T=document.createElement("div");T.className="cesium-baseLayerPicker-item",T.setAttribute("data-bind",'css: { "cesium-baseLayerPicker-selectedItem" : $data === $parents[1].selectedTerrain },attr: { title: tooltip },visible: creationCommand.canExecute,click: function($data) { $parents[1].selectedTerrain = $data; }'),x.appendChild(T);let E=document.createElement("img");E.className="cesium-baseLayerPicker-itemIcon",E.setAttribute("data-bind","attr: { src: iconUrl }"),E.setAttribute("draggable","false"),T.appendChild(E);let v=document.createElement("div");v.className="cesium-baseLayerPicker-itemLabel",v.setAttribute("data-bind","text: name"),T.appendChild(v),ve.applyBindings(n,i),ve.applyBindings(n,o),this._viewModel=n,this._container=e,this._element=i,this._dropPanel=o,this._closeDropDown=function(S){i.contains(S.target)||o.contains(S.target)||(n.dropDownVisible=!1)},dn.supportsPointerEvents()?document.addEventListener("pointerdown",this._closeDropDown,!0):(document.addEventListener("mousedown",this._closeDropDown,!0),document.addEventListener("touchstart",this._closeDropDown,!0))}Object.defineProperties(oq.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}}});oq.prototype.isDestroyed=function(){return!1};oq.prototype.destroy=function(){return dn.supportsPointerEvents()?document.removeEventListener("pointerdown",this._closeDropDown,!0):(document.removeEventListener("mousedown",this._closeDropDown,!0),document.removeEventListener("touchstart",this._closeDropDown,!0)),ve.cleanNode(this._element),ve.cleanNode(this._dropPanel),this._container.removeChild(this._element),this._container.removeChild(this._dropPanel),le(this)};var D8=oq;function Qke(e){let t=e.creationFunction;l(t.canExecute)||(t=Rn(t)),this._creationCommand=t,this.name=e.name,this.tooltip=e.tooltip,this.iconUrl=e.iconUrl,this._category=e.category??"",ve.track(this,["name","tooltip","iconUrl"])}Object.defineProperties(Qke.prototype,{creationCommand:{get:function(){return this._creationCommand}},category:{get:function(){return this._category}}});var uo=Qke;function A5t(){let e=[],t=devicePixelRatio>=2;return e.push(new uo({name:"Bing Maps Aerial",iconUrl:Zt("Widgets/Images/ImageryProviders/bingAerial.png"),tooltip:"Bing Maps aerial imagery, provided by Cesium ion",category:"Cesium ion",creationFunction:function(){return n_({style:t_.AERIAL})}})),e.push(new uo({name:"Bing Maps Aerial with Labels",iconUrl:Zt("Widgets/Images/ImageryProviders/bingAerialLabels.png"),tooltip:"Bing Maps aerial imagery with labels, provided by Cesium ion",category:"Cesium ion",creationFunction:function(){return n_({style:t_.AERIAL_WITH_LABELS})}})),e.push(new uo({name:"Bing Maps Roads",iconUrl:Zt("Widgets/Images/ImageryProviders/bingRoads.png"),tooltip:"Bing Maps standard road maps, provided by Cesium ion",category:"Cesium ion",creationFunction:function(){return n_({style:t_.ROAD})}})),e.push(new uo({name:"ArcGIS World Imagery",iconUrl:Zt("Widgets/Images/ImageryProviders/ArcGisMapServiceWorldImagery.png"),tooltip:`ArcGIS World Imagery provides one meter or better satellite and aerial imagery in many parts of the world and lower resolution satellite imagery worldwide. The map includes 15m TerraColor imagery at small and mid-scales (~1:591M down to ~1:288k) for the world. The map features Maxar imagery at 0.3m resolution for select metropolitan areas around the world, 0.5m resolution across the United States and parts of Western Europe, and 1m resolution imagery across the rest of the world. In addition to commercial sources, the World Imagery map features high-resolution aerial photography contributed by the GIS User Community. This imagery ranges from 0.3m to 0.03m resolution (down to ~1:280 nin select communities). For more information on this map, including the terms of use, visit us online at -https://www.arcgis.com/home/item.html?id=10df2279f9684e4a9f6a7f08febac2a9`,category:"Other",creationFunction:function(){return Qg.fromBasemapType(_m.SATELLITE,{enablePickFeatures:!1})}})),e.push(new uo({name:"ArcGIS World Hillshade",iconUrl:Zt("Widgets/Images/ImageryProviders/ArcGisMapServiceWorldHillshade.png"),tooltip:`ArcGIS World Hillshade map portrays elevation as an artistic hillshade. This map is designed to be used as a backdrop for topographical, soil, hydro, landcover or other outdoor recreational maps. The map was compiled from a variety of sources from several data providers. The basemap has global coverage down to a scale of ~1:72k. In select areas of the United States and Europe, coverage is available down to ~1:9k. For more information on this map, including the terms of use, visit us online at -https://www.arcgis.com/home/item.html?id=1b243539f4514b6ba35e7d995890db1d`,category:"Other",creationFunction:function(){return Qg.fromBasemapType(_m.HILLSHADE,{enablePickFeatures:!1})}})),e.push(new uo({name:"Esri World Ocean",iconUrl:Zt("Widgets/Images/ImageryProviders/ArcGisMapServiceWorldOcean.png"),tooltip:`ArcGIS World Ocean map is designed to be used as a base map by marine GIS professionals and as a reference map by anyone interested in ocean data. The base map features marine bathymetry. Land features include inland waters and roads overlaid on land cover and shaded relief imagery. The map was compiled from a variety of best available sources from several data providers, including General Bathymetric Chart of the Oceans GEBCO_08 Grid, National Oceanic and Atmospheric Administration (NOAA), and National Geographic, Garmin, HERE, Geonames.org, and Esri, and various other contributors. The base map currently provides coverage for the world down to a scale of ~1:577k, and coverage down to 1:72k in US coastal areas, and various other areas. Coverage down to ~ 1:9k is available limited areas based on regional hydrographic survey data. The base map was designed and developed by Esri. For more information on this map, including our terms of use, visit us online at -https://www.arcgis.com/home/item.html?id=1e126e7520f9466c9ca28b8f28b5e500`,category:"Other",creationFunction:function(){return Qg.fromBasemapType(_m.OCEANS,{enablePickFeatures:!1})}})),e.push(new uo({name:"Open\xADStreet\xADMap",iconUrl:Zt("Widgets/Images/ImageryProviders/openStreetMap.png"),tooltip:`OpenStreetMap (OSM) is a collaborative project to create a free editable map of the world. + */var Ple="__knockoutObservables",Dle="__knockoutSubscribable";function Vke(e,t){if(!e)throw new Error("When calling ko.track, you must pass an object as the first parameter.");var n=this,i=jke(e,!0);return t=t||Object.getOwnPropertyNames(e),t.forEach(function(r){if(!(r===Ple||r===Dle)&&!(r in i)){var o=e[r],s=o instanceof Array,a=n.isObservable(o)?o:s?n.observableArray(o):n.observable(o);Object.defineProperty(e,r,{configurable:!0,enumerable:!0,get:a,set:n.isWriteableObservable(a)?a:void 0}),i[r]=a,s&&KGt(n,a)}}),e}function jke(e,t){var n=e[Ple];return!n&&t&&(n={},Object.defineProperty(e,Ple,{value:n})),n}function XGt(e,t,n){var i=this,r={owner:e,deferEvaluation:!0};if(typeof n=="function")r.read=n;else{if("value"in n)throw new Error('For ko.defineProperty, you must not specify a "value" for the property. You must provide a "get" function.');if(typeof n.get!="function")throw new Error('For ko.defineProperty, the third parameter must be either an evaluator function, or an options object containing a function called "get".');r.read=n.get,r.write=n.set}return e[t]=i.computed(r),Vke.call(i,e,[t]),e}function KGt(e,t){var n=null;e.computed(function(){n&&(n.dispose(),n=null);var i=t();i instanceof Array&&(n=$Gt(e,t,i))})}function $Gt(e,t,n){var i=JGt(e,n);return i.subscribe(t)}function JGt(e,t){var n=t[Dle];if(!n){n=new e.subscribable,Object.defineProperty(t,Dle,{value:n});var i={};ZGt(t,n,i),QGt(e,t,n,i)}return n}function ZGt(e,t,n){["pop","push","reverse","shift","sort","splice","unshift"].forEach(function(i){var r=e[i];e[i]=function(){var o=r.apply(this,arguments);return n.pause!==!0&&t.notifySubscribers(this),o}})}function QGt(e,t,n,i){["remove","removeAll","destroy","destroyAll","replace"].forEach(function(r){Object.defineProperty(t,r,{enumerable:!1,value:function(){var o;i.pause=!0;try{o=e.observableArray.fn[r].apply(e.observableArray(t),arguments)}finally{i.pause=!1}return n.notifySubscribers(t),o}})})}function Hke(e,t){if(!e)return null;var n=jke(e,!1);return n&&n[t]||null}function e5t(e,t){var n=Hke(e,t);n&&n.valueHasMutated()}function t5t(e){e.track=Vke,e.getObservable=Hke,e.valueHasMutated=e5t,e.defineProperty=XGt}var x8={attachToKo:t5t};var Gke="http://www.w3.org/2000/svg",Wke="cesium-svgPath-svg",n5t={register:function(e){e.bindingHandlers.cesiumSvgPath={init:function(t,n){let i=document.createElementNS(Gke,"svg:svg");i.setAttribute("class",Wke);let r=document.createElementNS(Gke,"path");return i.appendChild(r),e.virtualElements.setDomNodeChildren(t,[i]),e.computed({read:function(){let o=e.unwrap(n());r.setAttribute("d",e.unwrap(o.path));let s=e.unwrap(o.width),a=e.unwrap(o.height);i.setAttribute("width",s),i.setAttribute("height",a),i.setAttribute("viewBox",`0 0 ${s} ${a}`),o.css&&i.setAttribute("class",`${Wke} ${e.unwrap(o.css)}`)},disposeWhenNodeIsRemoved:t}),{controlsDescendantBindings:!0}}},e.virtualElements.allowedBindings.cesiumSvgPath=!0}},T8=n5t;x8.attachToKo($C);T8.register($C);var ve=$C;function E8(e){l(e)||(e=new Xh),this._clock=e,this._eventHelper=new jo,this._eventHelper.add(e.onTick,this.synchronize,this),this.systemTime=ve.observable(K.now()),this.systemTime.equalityComparer=K.equals,this.startTime=ve.observable(e.startTime),this.startTime.equalityComparer=K.equals,this.startTime.subscribe(function(t){e.startTime=t,this.synchronize()},this),this.stopTime=ve.observable(e.stopTime),this.stopTime.equalityComparer=K.equals,this.stopTime.subscribe(function(t){e.stopTime=t,this.synchronize()},this),this.currentTime=ve.observable(e.currentTime),this.currentTime.equalityComparer=K.equals,this.currentTime.subscribe(function(t){e.currentTime=t,this.synchronize()},this),this.multiplier=ve.observable(e.multiplier),this.multiplier.subscribe(function(t){e.multiplier=t,this.synchronize()},this),this.clockStep=ve.observable(e.clockStep),this.clockStep.subscribe(function(t){e.clockStep=t,this.synchronize()},this),this.clockRange=ve.observable(e.clockRange),this.clockRange.subscribe(function(t){e.clockRange=t,this.synchronize()},this),this.canAnimate=ve.observable(e.canAnimate),this.canAnimate.subscribe(function(t){e.canAnimate=t,this.synchronize()},this),this.shouldAnimate=ve.observable(e.shouldAnimate),this.shouldAnimate.subscribe(function(t){e.shouldAnimate=t,this.synchronize()},this),ve.track(this,["systemTime","startTime","stopTime","currentTime","multiplier","clockStep","clockRange","canAnimate","shouldAnimate"])}Object.defineProperties(E8.prototype,{clock:{get:function(){return this._clock}}});E8.prototype.synchronize=function(){let e=this._clock;this.systemTime=K.now(),this.startTime=e.startTime,this.stopTime=e.stopTime,this.currentTime=e.currentTime,this.multiplier=e.multiplier,this.clockStep=e.clockStep,this.clockRange=e.clockRange,this.canAnimate=e.canAnimate,this.shouldAnimate=e.shouldAnimate};E8.prototype.isDestroyed=function(){return!1};E8.prototype.destroy=function(){this._eventHelper.removeAll(),le(this)};var C8=E8;function i5t(){this.canExecute=void 0,this.beforeExecute=void 0,this.afterExecute=void 0,pe.throwInstantiationError()}var Rle=i5t;function r5t(e,t){t=t??!0;let n=new be,i=new be;function r(){let o={args:arguments,cancel:!1},s;return n.raiseEvent(o),o.cancel||(s=e.apply(null,arguments),i.raiseEvent(s)),s}return r.canExecute=t,ve.track(r,["canExecute"]),Object.defineProperties(r,{beforeExecute:{value:n},afterExecute:{value:i}}),r}var Rn=r5t;var QP={};QP.createCheckbox=function(e,t,n){let i=document.createElement("div"),r=document.createElement("label"),o=document.createElement("input");o.type="checkbox";let s=`checked: ${t}`;return l(n)&&(s+=`, enable: ${n}`),o.setAttribute("data-bind",s),r.appendChild(o),r.appendChild(document.createTextNode(e)),i.appendChild(r),i};QP.createSection=function(e,t,n,i){let r=document.createElement("div");r.className="cesium-cesiumInspector-section",r.setAttribute("data-bind",`css: { "cesium-cesiumInspector-section-collapsed": !${n} }`),e.appendChild(r);let o=document.createElement("h3");o.className="cesium-cesiumInspector-sectionHeader",o.appendChild(document.createTextNode(t)),o.setAttribute("data-bind",`click: ${i}`),r.appendChild(o);let s=document.createElement("div");return s.className="cesium-cesiumInspector-sectionContent",r.appendChild(s),s};QP.createRangeInput=function(e,t,n,i,r,o){o=o??t;let s=document.createElement("input");s.setAttribute("data-bind",`value: ${o}`),s.type="number";let a=document.createElement("input");a.type="range",a.min=n,a.max=i,a.step=r??"any",a.setAttribute("data-bind",`valueUpdate: "input", value: ${t}`);let c=document.createElement("div");c.appendChild(a);let u=document.createElement("div");return u.className="cesium-cesiumInspector-slider",u.appendChild(document.createTextNode(e)),u.appendChild(s),u.appendChild(c),u};QP.createRangeInputWithDynamicMinMax=function(e,t,n,i){i=i??t;let r=document.createElement("input");r.setAttribute("data-bind",`value: ${i}`),r.type="number";let o=document.createElement("input");o.type="range",o.step=n??"any",o.setAttribute("data-bind",`valueUpdate: "input", value: ${t}, attr: { min: ${t}Min, max: ${t}Max }`);let s=document.createElement("div");s.appendChild(o);let a=document.createElement("div");return a.className="cesium-cesiumInspector-slider",a.appendChild(document.createTextNode(e)),a.appendChild(r),a.appendChild(s),a};QP.createButton=function(e,t,n){let i=document.createElement("button");i.type="button",i.textContent=e,i.className="cesium-cesiumInspector-pickButton";let r=`click: ${t}`;return l(n)&&(r+=`, css: {"cesium-cesiumInspector-pickButtonHighlight" : ${n}}`),i.setAttribute("data-bind",r),i};var Af=QP;function o5t(e,t,n,i,r){return n.call(i,e[t]),ve.getObservable(e,t).subscribe(n,i,r)}var Cc=o5t;function qke(e,t){this._command=e,t=t??H.EMPTY_OBJECT,this.toggled=t.toggled??!1,this.tooltip=t.tooltip??"",ve.track(this,["toggled","tooltip"])}Object.defineProperties(qke.prototype,{command:{get:function(){return this._command}}});var Wb=qke;var Rl="http://www.w3.org/2000/svg",$ke="http://www.w3.org/1999/xlink",tq,v8=z.fromCssColorString("rgba(247,250,255,0.384)"),nq=z.fromCssColorString("rgba(143,191,255,0.216)"),Ole=z.fromCssColorString("rgba(153,197,255,0.098)"),iq=z.fromCssColorString("rgba(255,255,255,0.086)"),s5t=z.fromCssColorString("rgba(255,255,255,0.267)"),a5t=z.fromCssColorString("rgba(255,255,255,0)"),Yke=z.fromCssColorString("rgba(66,67,68,0.3)"),Xke=z.fromCssColorString("rgba(0,0,0,0.5)");function qb(e){return z.fromCssColorString(window.getComputedStyle(e).getPropertyValue("color"))}var S8={animation_pathReset:{tagName:"path",transform:"translate(16,16) scale(0.85) translate(-16,-16)",d:"M24.316,5.318,9.833,13.682,9.833,5.5,5.5,5.5,5.5,25.5,9.833,25.5,9.833,17.318,24.316,25.682z"},animation_pathPause:{tagName:"path",transform:"translate(16,16) scale(0.85) translate(-16,-16)",d:"M13,5.5,7.5,5.5,7.5,25.5,13,25.5zM24.5,5.5,19,5.5,19,25.5,24.5,25.5z"},animation_pathPlay:{tagName:"path",transform:"translate(16,16) scale(0.85) translate(-16,-16)",d:"M6.684,25.682L24.316,15.5L6.684,5.318V25.682z"},animation_pathPlayReverse:{tagName:"path",transform:"translate(16,16) scale(-0.85,0.85) translate(-16,-16)",d:"M6.684,25.682L24.316,15.5L6.684,5.318V25.682z"},animation_pathLoop:{tagName:"path",transform:"translate(16,16) scale(0.85) translate(-16,-16)",d:"M24.249,15.499c-0.009,4.832-3.918,8.741-8.75,8.75c-2.515,0-4.768-1.064-6.365-2.763l2.068-1.442l-7.901-3.703l0.744,8.694l2.193-1.529c2.244,2.594,5.562,4.242,9.26,4.242c6.767,0,12.249-5.482,12.249-12.249H24.249zM15.499,6.75c2.516,0,4.769,1.065,6.367,2.764l-2.068,1.443l7.901,3.701l-0.746-8.693l-2.192,1.529c-2.245-2.594-5.562-4.245-9.262-4.245C8.734,3.25,3.25,8.734,3.249,15.499H6.75C6.758,10.668,10.668,6.758,15.499,6.75z"},animation_pathClock:{tagName:"path",transform:"translate(16,16) scale(0.85) translate(-16,-15.5)",d:"M15.5,2.374C8.251,2.375,2.376,8.251,2.374,15.5C2.376,22.748,8.251,28.623,15.5,28.627c7.249-0.004,13.124-5.879,13.125-13.127C28.624,8.251,22.749,2.375,15.5,2.374zM15.5,25.623C9.909,25.615,5.385,21.09,5.375,15.5C5.385,9.909,9.909,5.384,15.5,5.374c5.59,0.01,10.115,4.535,10.124,10.125C25.615,21.09,21.091,25.615,15.5,25.623zM8.625,15.5c-0.001-0.552-0.448-0.999-1.001-1c-0.553,0-1,0.448-1,1c0,0.553,0.449,1,1,1C8.176,16.5,8.624,16.053,8.625,15.5zM8.179,18.572c-0.478,0.277-0.642,0.889-0.365,1.367c0.275,0.479,0.889,0.641,1.365,0.365c0.479-0.275,0.643-0.887,0.367-1.367C9.27,18.461,8.658,18.297,8.179,18.572zM9.18,10.696c-0.479-0.276-1.09-0.112-1.366,0.366s-0.111,1.09,0.365,1.366c0.479,0.276,1.09,0.113,1.367-0.366C9.821,11.584,9.657,10.973,9.18,10.696zM22.822,12.428c0.478-0.275,0.643-0.888,0.366-1.366c-0.275-0.478-0.89-0.642-1.366-0.366c-0.479,0.278-0.642,0.89-0.366,1.367C21.732,12.54,22.344,12.705,22.822,12.428zM12.062,21.455c-0.478-0.275-1.089-0.111-1.366,0.367c-0.275,0.479-0.111,1.09,0.366,1.365c0.478,0.277,1.091,0.111,1.365-0.365C12.704,22.344,12.54,21.732,12.062,21.455zM12.062,9.545c0.479-0.276,0.642-0.888,0.366-1.366c-0.276-0.478-0.888-0.642-1.366-0.366s-0.642,0.888-0.366,1.366C10.973,9.658,11.584,9.822,12.062,9.545zM22.823,18.572c-0.48-0.275-1.092-0.111-1.367,0.365c-0.275,0.479-0.112,1.092,0.367,1.367c0.477,0.275,1.089,0.113,1.365-0.365C23.464,19.461,23.3,18.848,22.823,18.572zM19.938,7.813c-0.477-0.276-1.091-0.111-1.365,0.366c-0.275,0.48-0.111,1.091,0.366,1.367s1.089,0.112,1.366-0.366C20.581,8.702,20.418,8.089,19.938,7.813zM23.378,14.5c-0.554,0.002-1.001,0.45-1.001,1c0.001,0.552,0.448,1,1.001,1c0.551,0,1-0.447,1-1C24.378,14.949,23.929,14.5,23.378,14.5zM15.501,6.624c-0.552,0-1,0.448-1,1l-0.466,7.343l-3.004,1.96c-0.478,0.277-0.642,0.889-0.365,1.365c0.275,0.479,0.889,0.643,1.365,0.367l3.305-1.676C15.39,16.99,15.444,17,15.501,17c0.828,0,1.5-0.671,1.5-1.5l-0.5-7.876C16.501,7.072,16.053,6.624,15.501,6.624zM15.501,22.377c-0.552,0-1,0.447-1,1s0.448,1,1,1s1-0.447,1-1S16.053,22.377,15.501,22.377zM18.939,21.455c-0.479,0.277-0.643,0.889-0.366,1.367c0.275,0.477,0.888,0.643,1.366,0.365c0.478-0.275,0.642-0.889,0.366-1.365C20.028,21.344,19.417,21.18,18.939,21.455z"},animation_pathWingButton:{tagName:"path",d:"m 4.5,0.5 c -2.216,0 -4,1.784 -4,4 l 0,24 c 0,2.216 1.784,4 4,4 l 13.71875,0 C 22.478584,27.272785 27.273681,22.511272 32.5,18.25 l 0,-13.75 c 0,-2.216 -1.784,-4 -4,-4 l -24,0 z"},animation_pathPointer:{tagName:"path",d:"M-15,-65,-15,-55,15,-55,15,-65,0,-95z"},animation_pathSwooshFX:{tagName:"path",d:"m 85,0 c 0,16.617 -4.813944,35.356 -13.131081,48.4508 h 6.099803 c 8.317138,-13.0948 13.13322,-28.5955 13.13322,-45.2124 0,-46.94483 -38.402714,-85.00262 -85.7743869,-85.00262 -1.0218522,0 -2.0373001,0.0241 -3.0506131,0.0589 45.958443,1.59437 82.723058,35.77285 82.723058,81.70532 z"}};function Ap(e){let t=document.createElementNS(Rl,e.tagName);for(let n in e)if(e.hasOwnProperty(n)&&n!=="tagName")if(n==="children"){let i=e.children.length;for(let r=0;r<i;++r)t.appendChild(Ap(e.children[r]))}else n.indexOf("xlink:")===0?t.setAttributeNS($ke,n.substring(6),e[n]):n==="textContent"?t.textContent=e[n]:t.setAttribute(n,e[n]);return t}function Nle(e,t,n){let i=document.createElementNS(Rl,"text");i.setAttribute("x",e),i.setAttribute("y",t),i.setAttribute("class","cesium-animation-svgText");let r=document.createElementNS(Rl,"tspan");return r.textContent=n,i.appendChild(r),i}function c5t(e,t){let n=Nle(e,t,"");n.removeChild(n.firstChild);let i={},r=[],o=["month","day","year"];for(let a=0;a<o.length;++a){if(a>0){let f=document.createElementNS(Rl,"tspan");f.textContent=" ",r.push(f),n.appendChild(f)}let c=o[a],u=document.createElementNS(Rl,"tspan");u.setAttribute("class",`cesium-animation-dateField cesium-animation-dateField-${c}`),u.setAttribute("aria-label",`Adjust ${c} with mouse wheel`),i[c]=u,n.appendChild(u)}let s=document.createElementNS(Rl,"tspan");return n.appendChild(s),{element:n,fallback:s,parts:i,separators:r}}function l5t(e,t){let n=/^(\S+)\s+(\d{1,2})\s+(\d{1,4})$/.exec(t),i=e.parts,r=e.separators;if(n===null){i.month.textContent="",i.day.textContent="",i.year.textContent="",r[0].textContent="",r[1].textContent="",e.fallback.textContent=t;return}i.month.textContent=n[1],i.day.textContent=n[2],i.year.textContent=n[3],r[0].textContent=" ",r[1].textContent=" ",e.fallback.textContent=""}function u5t(e,t){let n=Nle(e,t,"");n.removeChild(n.firstChild);let i={},r=[],o=["hour","minute","second"];for(let f=0;f<o.length;++f){if(f>0){let g=document.createElementNS(Rl,"tspan");g.textContent=":",r.push(g),n.appendChild(g)}let d=o[f],p=document.createElementNS(Rl,"tspan");p.setAttribute("class",`cesium-animation-timeField cesium-animation-timeField-${d}`),p.setAttribute("aria-label",`Adjust ${d} with mouse wheel`),i[d]=p,n.appendChild(p)}let s=document.createElementNS(Rl,"tspan");n.appendChild(s);let a=document.createElementNS(Rl,"tspan");a.setAttribute("class","cesium-animation-timeField cesium-animation-timeField-millisecond"),a.setAttribute("aria-label","Adjust millisecond with mouse wheel"),i.millisecond=a,n.appendChild(a);let c=document.createElementNS(Rl,"tspan");n.appendChild(c);let u=document.createElementNS(Rl,"tspan");return n.appendChild(u),{decimalPoint:s,element:n,fallback:u,parts:i,separators:r,suffix:c}}function f5t(e,t){let n=/^(\d{2}):(\d{2}):(\d{2})(?:\.(\d{3})| UTC)$/.exec(t),i=e.parts,r=e.separators;if(n===null){i.hour.textContent="",i.minute.textContent="",i.second.textContent="",i.millisecond.textContent="",r[0].textContent="",r[1].textContent="",e.decimalPoint.textContent="",e.suffix.textContent="",e.fallback.textContent=t;return}i.hour.textContent=n[1],i.minute.textContent=n[2],i.second.textContent=n[3],r[0].textContent=":",r[1].textContent=":",e.decimalPoint.textContent=l(n[4])?".":"",i.millisecond.textContent=n[4]??"",e.suffix.textContent=l(n[4])?"":" UTC",e.fallback.textContent=""}function Kke(e,t,n){let i=Object.keys(t);for(let r=0;r<i.length;++r){let o=i[r],s=t[o],a=function(c){c.deltaY!==0&&(n(o,c.deltaY<0?1:-1),c.preventDefault(),c.stopPropagation())};s.addEventListener("wheel",a,!1),e._fieldWheelListeners.push({element:s,listener:a})}}function d5t(e,t,n){e.setAttribute("transform",`translate(100,100) rotate(${n})`),t.setAttribute("transform",`rotate(${n})`)}var rq=new z;function Xs(e,t){let n=t.alpha,i=1-n;return rq.red=e.red*i+t.red*n,rq.green=e.green*i+t.green*n,rq.blue=e.blue*i+t.blue*n,rq.toCssColorString()}function Mle(e,t,n){let i=S8[n],r={tagName:"g",class:"cesium-animation-rectButton",transform:`translate(${e},${t})`,children:[{tagName:"rect",class:"cesium-animation-buttonGlow",width:32,height:32,rx:2,ry:2},{tagName:"rect",class:"cesium-animation-buttonMain",width:32,height:32,rx:4,ry:4},{class:"cesium-animation-buttonPath",id:n,tagName:i.tagName,transform:i.transform,d:i.d},{tagName:"title",textContent:""}]};return Ap(r)}function h5t(e,t,n){let i=S8[n],r=S8.animation_pathWingButton,o={tagName:"g",class:"cesium-animation-rectButton",transform:`translate(${e},${t})`,children:[{class:"cesium-animation-buttonGlow",id:"animation_pathWingButton",tagName:r.tagName,d:r.d},{class:"cesium-animation-buttonMain",id:"animation_pathWingButton",tagName:r.tagName,d:r.d},{class:"cesium-animation-buttonPath",id:n,tagName:i.tagName,transform:i.transform,d:i.d},{tagName:"title",textContent:""}]};return Ap(o)}function m5t(e,t){let n=e._viewModel,i=n.shuttleRingDragging;if(!(i&&tq!==e))if(t.type==="mousedown"||i&&t.type==="mousemove"||t.type==="touchstart"&&t.touches.length===1||i&&t.type==="touchmove"&&t.touches.length===1){let r=e._centerX,o=e._centerY,a=e._svgNode.getBoundingClientRect(),c,u;if(t.type==="touchstart"||t.type==="touchmove"?(c=t.touches[0].clientX,u=t.touches[0].clientY):(c=t.clientX,u=t.clientY),!i&&(c>a.right||c<a.left||u<a.top||u>a.bottom))return;let f=e._shuttleRingPointer.getBoundingClientRect(),d=c-r-a.left,p=u-o-a.top,g=Math.atan2(p,d)*180/Math.PI+90;g>180&&(g-=360);let m=n.shuttleRingAngle;i||c<f.right&&c>f.left&&u>f.top&&u<f.bottom?(tq=e,n.shuttleRingDragging=!0,n.shuttleRingAngle=g):g<m?n.slower():g>m&&n.faster(),t.preventDefault()}else e===tq&&(tq=void 0),n.shuttleRingDragging=!1}function Ey(e,t){this._viewModel=t,this.svgElement=e,this._enabled=void 0,this._toggled=void 0;let n=this;this._clickFunction=function(){let i=n._viewModel.command;i.canExecute&&i()},e.addEventListener("click",this._clickFunction,!0),this._subscriptions=[Cc(t,"toggled",this.setToggled,this),Cc(t,"tooltip",this.setTooltip,this),Cc(t.command,"canExecute",this.setEnabled,this)]}Ey.prototype.destroy=function(){this.svgElement.removeEventListener("click",this._clickFunction,!0);let e=this._subscriptions;for(let t=0,n=e.length;t<n;t++)e[t].dispose();le(this)};Ey.prototype.isDestroyed=function(){return!1};Ey.prototype.setEnabled=function(e){if(this._enabled!==e){if(this._enabled=e,!e){this.svgElement.setAttribute("class","cesium-animation-buttonDisabled");return}if(this._toggled){this.svgElement.setAttribute("class","cesium-animation-rectButton cesium-animation-buttonToggled");return}this.svgElement.setAttribute("class","cesium-animation-rectButton")}};Ey.prototype.setToggled=function(e){this._toggled!==e&&(this._toggled=e,this._enabled&&(e?this.svgElement.setAttribute("class","cesium-animation-rectButton cesium-animation-buttonToggled"):this.svgElement.setAttribute("class","cesium-animation-rectButton")))};Ey.prototype.setTooltip=function(e){this.svgElement.getElementsByTagName("title")[0].textContent=e};function eD(e,t){e=Ln(e),this._viewModel=t,this._container=e,this._centerX=0,this._centerY=0,this._defsElement=void 0,this._svgNode=void 0,this._topG=void 0,this._lastHeight=void 0,this._lastWidth=void 0;let n=e.ownerDocument,i=document.createElement("style");i.textContent=".cesium-animation-rectButton .cesium-animation-buttonGlow { filter: url(#animation_blurred); }.cesium-animation-rectButton .cesium-animation-buttonMain { fill: url(#animation_buttonNormal); }.cesium-animation-buttonToggled .cesium-animation-buttonMain { fill: url(#animation_buttonToggled); }.cesium-animation-rectButton:hover .cesium-animation-buttonMain { fill: url(#animation_buttonHovered); }.cesium-animation-buttonDisabled .cesium-animation-buttonMain { fill: url(#animation_buttonDisabled); }.cesium-animation-shuttleRingG .cesium-animation-shuttleRingSwoosh { fill: url(#animation_shuttleRingSwooshGradient); }.cesium-animation-shuttleRingG:hover .cesium-animation-shuttleRingSwoosh { fill: url(#animation_shuttleRingSwooshHovered); }.cesium-animation-shuttleRingPointer { fill: url(#animation_shuttleRingPointerGradient); }.cesium-animation-shuttleRingPausePointer { fill: url(#animation_shuttleRingPointerPaused); }.cesium-animation-knobOuter { fill: url(#animation_knobOuter); }.cesium-animation-knobInner { fill: url(#animation_knobInner); }",n.head.insertBefore(i,n.head.childNodes[0]);let r=document.createElement("div");r.className="cesium-animation-theme",r.innerHTML='<div class="cesium-animation-themeNormal"></div><div class="cesium-animation-themeHover"></div><div class="cesium-animation-themeSelect"></div><div class="cesium-animation-themeDisabled"></div><div class="cesium-animation-themeKnob"></div><div class="cesium-animation-themePointer"></div><div class="cesium-animation-themeSwoosh"></div><div class="cesium-animation-themeSwooshHover"></div>',this._theme=r,this._themeNormal=r.childNodes[0],this._themeHover=r.childNodes[1],this._themeSelect=r.childNodes[2],this._themeDisabled=r.childNodes[3],this._themeKnob=r.childNodes[4],this._themePointer=r.childNodes[5],this._themeSwoosh=r.childNodes[6],this._themeSwooshHover=r.childNodes[7];let o=document.createElementNS(Rl,"svg:svg");this._svgNode=o,o.setAttributeNS("http://www.w3.org/2000/xmlns/","xmlns:xlink",$ke);let s=document.createElementNS(Rl,"g");this._topG=s,this._realtimeSVG=new Ey(h5t(3,4,"animation_pathClock"),t.playRealtimeViewModel),this._playReverseSVG=new Ey(Mle(44,99,"animation_pathPlayReverse"),t.playReverseViewModel),this._playForwardSVG=new Ey(Mle(124,99,"animation_pathPlay"),t.playForwardViewModel),this._pauseSVG=new Ey(Mle(84,99,"animation_pathPause"),t.pauseViewModel);let a=document.createElementNS(Rl,"g");a.appendChild(this._realtimeSVG.svgElement),a.appendChild(this._playReverseSVG.svgElement),a.appendChild(this._playForwardSVG.svgElement),a.appendChild(this._pauseSVG.svgElement);let c=Ap({tagName:"circle",class:"cesium-animation-shuttleRingBack",cx:100,cy:100,r:99});this._shuttleRingBackPanel=c;let u=S8.animation_pathSwooshFX,f=S8.animation_pathPointer,d=Ap({tagName:"g",class:"cesium-animation-shuttleRingSwoosh",children:[{tagName:u.tagName,transform:"translate(100,97) scale(-1,1)",id:"animation_pathSwooshFX",d:u.d},{tagName:u.tagName,transform:"translate(100,97)",id:"animation_pathSwooshFX",d:u.d},{tagName:"line",x1:100,y1:8,x2:100,y2:22}]});this._shuttleRingSwooshG=d,this._shuttleRingPointer=Ap({class:"cesium-animation-shuttleRingPointer",id:"animation_pathPointer",tagName:f.tagName,d:f.d});let p=Ap({tagName:"g",transform:"translate(100,100)"});this._knobOuter=Ap({tagName:"circle",class:"cesium-animation-knobOuter",cx:0,cy:0,r:71});let g=61,m=Ap({tagName:"circle",class:"cesium-animation-knobInner",cx:0,cy:0,r:g}),y=c5t(0,-24);this._knobDate=y.element;let A=u5t(0,-7);this._knobTime=A.element,this._knobStatus=Nle(0,-41,"");let b=Ap({tagName:"circle",class:"cesium-animation-blank",cx:0,cy:0,r:g}),x=document.createElementNS(Rl,"g");x.setAttribute("class","cesium-animation-shuttleRingG"),e.appendChild(r),s.appendChild(x),s.appendChild(p),s.appendChild(a),x.appendChild(c),x.appendChild(d),x.appendChild(this._shuttleRingPointer),p.appendChild(this._knobOuter),p.appendChild(m),p.appendChild(this._knobStatus),p.appendChild(b),p.appendChild(this._knobDate),p.appendChild(this._knobTime),o.appendChild(s),e.appendChild(o);let T=this;function E(I){m5t(T,I)}this._mouseCallback=E,c.addEventListener("mousedown",E,!0),c.addEventListener("touchstart",E,!0),d.addEventListener("mousedown",E,!0),d.addEventListener("touchstart",E,!0),n.addEventListener("mousemove",E,!0),n.addEventListener("touchmove",E,!0),n.addEventListener("mouseup",E,!0),n.addEventListener("touchend",E,!0),n.addEventListener("touchcancel",E,!0),this._shuttleRingPointer.addEventListener("mousedown",E,!0),this._shuttleRingPointer.addEventListener("touchstart",E,!0),this._knobOuter.addEventListener("mousedown",E,!0),this._knobOuter.addEventListener("touchstart",E,!0);let v=this._knobStatus.childNodes[0];this._fieldWheelListeners=[],Kke(this,y.parts,function(I,R){t.adjustDate(I,R)}),Kke(this,A.parts,function(I,R){t.adjustTime(I,R)});let S;this._subscriptions=[Cc(t.pauseViewModel,"toggled",function(I){S!==I&&(S=I,S?T._shuttleRingPointer.setAttribute("class","cesium-animation-shuttleRingPausePointer"):T._shuttleRingPointer.setAttribute("class","cesium-animation-shuttleRingPointer"))}),Cc(t,"shuttleRingAngle",function(I){d5t(T._shuttleRingPointer,T._knobOuter,I)}),Cc(t,"dateLabel",function(I){T._knobDate.textContent!==I&&l5t(y,I)}),Cc(t,"timeLabel",function(I){T._knobTime.textContent!==I&&f5t(A,I)}),Cc(t,"multiplierLabel",function(I){v.textContent!==I&&(v.textContent=I)})],this.applyThemeChanges(),this.resize()}Object.defineProperties(eD.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}}});eD.prototype.isDestroyed=function(){return!1};eD.prototype.destroy=function(){l(this._observer)&&(this._observer.disconnect(),this._observer=void 0);let e=this._container.ownerDocument,t=this._mouseCallback;this._shuttleRingBackPanel.removeEventListener("mousedown",t,!0),this._shuttleRingBackPanel.removeEventListener("touchstart",t,!0),this._shuttleRingSwooshG.removeEventListener("mousedown",t,!0),this._shuttleRingSwooshG.removeEventListener("touchstart",t,!0),e.removeEventListener("mousemove",t,!0),e.removeEventListener("touchmove",t,!0),e.removeEventListener("mouseup",t,!0),e.removeEventListener("touchend",t,!0),e.removeEventListener("touchcancel",t,!0),this._shuttleRingPointer.removeEventListener("mousedown",t,!0),this._shuttleRingPointer.removeEventListener("touchstart",t,!0),this._knobOuter.removeEventListener("mousedown",t,!0),this._knobOuter.removeEventListener("touchstart",t,!0);let n=this._fieldWheelListeners;for(let r=0;r<n.length;++r){let o=n[r];o.element.removeEventListener("wheel",o.listener,!1)}this._container.removeChild(this._svgNode),this._container.removeChild(this._theme),this._realtimeSVG.destroy(),this._playReverseSVG.destroy(),this._playForwardSVG.destroy(),this._pauseSVG.destroy();let i=this._subscriptions;for(let r=0,o=i.length;r<o;r++)i[r].dispose();return le(this)};eD.prototype.resize=function(){let e=this._container.clientWidth,t=this._container.clientHeight;if(e===this._lastWidth&&t===this._lastHeight)return;let n=this._svgNode,i=200,r=132,o=e,s=t;e===0&&t===0?(o=i,s=r):e===0?(s=t,o=i*(t/r)):t===0&&(o=e,s=r*(e/i));let a=o/i,c=s/r;n.style.cssText=`width: ${o}px; height: ${s}px; position: absolute; bottom: 0; left: 0; overflow: hidden;`,n.setAttribute("width",o),n.setAttribute("height",s),n.setAttribute("viewBox",`0 0 ${o} ${s}`),this._topG.setAttribute("transform",`scale(${a},${c})`),this._centerX=Math.max(1,100*a),this._centerY=Math.max(1,100*c),this._lastHeight=e,this._lastWidth=t};eD.prototype.applyThemeChanges=function(){let e=this._container.ownerDocument;if(!e.body.contains(this._container)){if(l(this._observer))return;let f=this;f._observer=new MutationObserver(function(){e.body.contains(f._container)&&(f._observer.disconnect(),f._observer=void 0,f.applyThemeChanges())}),f._observer.observe(e,{childList:!0,subtree:!0});return}let t=qb(this._themeNormal),n=qb(this._themeHover),i=qb(this._themeSelect),r=qb(this._themeDisabled),o=qb(this._themeKnob),s=qb(this._themePointer),a=qb(this._themeSwoosh),c=qb(this._themeSwooshHover),u=Ap({tagName:"defs",children:[{id:"animation_buttonNormal",tagName:"linearGradient",x1:"50%",y1:"0%",x2:"50%",y2:"100%",children:[{tagName:"stop",offset:"0%","stop-color":Xs(t,v8)},{tagName:"stop",offset:"12%","stop-color":Xs(t,nq)},{tagName:"stop",offset:"46%","stop-color":Xs(t,Ole)},{tagName:"stop",offset:"81%","stop-color":Xs(t,iq)}]},{id:"animation_buttonHovered",tagName:"linearGradient",x1:"50%",y1:"0%",x2:"50%",y2:"100%",children:[{tagName:"stop",offset:"0%","stop-color":Xs(n,v8)},{tagName:"stop",offset:"12%","stop-color":Xs(n,nq)},{tagName:"stop",offset:"46%","stop-color":Xs(n,Ole)},{tagName:"stop",offset:"81%","stop-color":Xs(n,iq)}]},{id:"animation_buttonToggled",tagName:"linearGradient",x1:"50%",y1:"0%",x2:"50%",y2:"100%",children:[{tagName:"stop",offset:"0%","stop-color":Xs(i,v8)},{tagName:"stop",offset:"12%","stop-color":Xs(i,nq)},{tagName:"stop",offset:"46%","stop-color":Xs(i,Ole)},{tagName:"stop",offset:"81%","stop-color":Xs(i,iq)}]},{id:"animation_buttonDisabled",tagName:"linearGradient",x1:"50%",y1:"0%",x2:"50%",y2:"100%",children:[{tagName:"stop",offset:"0%","stop-color":Xs(r,s5t)},{tagName:"stop",offset:"75%","stop-color":Xs(r,a5t)}]},{id:"animation_blurred",tagName:"filter",width:"200%",height:"200%",x:"-50%",y:"-50%",children:[{tagName:"feGaussianBlur",stdDeviation:4,in:"SourceGraphic"}]},{id:"animation_shuttleRingSwooshGradient",tagName:"linearGradient",x1:"50%",y1:"0%",x2:"50%",y2:"100%",children:[{tagName:"stop",offset:"0%","stop-opacity":.2,"stop-color":a.toCssColorString()},{tagName:"stop",offset:"85%","stop-opacity":.85,"stop-color":a.toCssColorString()},{tagName:"stop",offset:"95%","stop-opacity":.05,"stop-color":a.toCssColorString()}]},{id:"animation_shuttleRingSwooshHovered",tagName:"linearGradient",x1:"50%",y1:"0%",x2:"50%",y2:"100%",children:[{tagName:"stop",offset:"0%","stop-opacity":.2,"stop-color":c.toCssColorString()},{tagName:"stop",offset:"85%","stop-opacity":.85,"stop-color":c.toCssColorString()},{tagName:"stop",offset:"95%","stop-opacity":.05,"stop-color":c.toCssColorString()}]},{id:"animation_shuttleRingPointerGradient",tagName:"linearGradient",x1:"0%",y1:"50%",x2:"100%",y2:"50%",children:[{tagName:"stop",offset:"0%","stop-color":s.toCssColorString()},{tagName:"stop",offset:"40%","stop-color":s.toCssColorString()},{tagName:"stop",offset:"60%","stop-color":Xs(s,Xke)},{tagName:"stop",offset:"100%","stop-color":Xs(s,Xke)}]},{id:"animation_shuttleRingPointerPaused",tagName:"linearGradient",x1:"0%",y1:"50%",x2:"100%",y2:"50%",children:[{tagName:"stop",offset:"0%","stop-color":"#CCC"},{tagName:"stop",offset:"40%","stop-color":"#CCC"},{tagName:"stop",offset:"60%","stop-color":"#555"},{tagName:"stop",offset:"100%","stop-color":"#555"}]},{id:"animation_knobOuter",tagName:"linearGradient",x1:"20%",y1:"0%",x2:"90%",y2:"100%",children:[{tagName:"stop",offset:"5%","stop-color":Xs(o,v8)},{tagName:"stop",offset:"60%","stop-color":Xs(o,Yke)},{tagName:"stop",offset:"85%","stop-color":Xs(o,nq)}]},{id:"animation_knobInner",tagName:"linearGradient",x1:"20%",y1:"0%",x2:"90%",y2:"100%",children:[{tagName:"stop",offset:"5%","stop-color":Xs(o,Yke)},{tagName:"stop",offset:"60%","stop-color":Xs(o,v8)},{tagName:"stop",offset:"85%","stop-color":Xs(o,iq)}]}]});l(this._defsElement)?this._svgNode.replaceChild(u,this._defsElement):this._svgNode.appendChild(u),this._defsElement=u};var w8=eD;var p5t=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],Yb=15,tD=105,g5t=[31,28,31,30,31,30,31,31,30,31,30,31];function _5t(e,t){return t===2&&kl(e)?29:g5t[t-1]}function Jke(e,t,n){return K.fromGregorianDate(new Bh(t,n,Math.min(e.day,_5t(t,n)),e.hour,e.minute,e.second,e.millisecond,e.isLeapSecond))}function Zke(e,t){return e-t}function Lle(e,t){let n=vr(t,e,Zke);return n<0?~n:n}function y5t(e,t){if(Math.abs(e)<=Yb)return e/Yb;let n=Yb,i=tD,r,o=0,s;return e>0?(r=Math.log(t[t.length-1]),s=(r-o)/(i-n),Math.exp(o+s*(e-n))):(r=Math.log(-t[0]),s=(r-o)/(i-n),-Math.exp(o+s*(Math.abs(e)-n)))}function A5t(e,t,n){if(n.clockStep===zr.SYSTEM_CLOCK)return Yb;if(Math.abs(e)<=1)return e*Yb;let i=t[t.length-1];e>i?e=i:e<-i&&(e=-i);let r=Yb,o=tD,s,a=0,c;return e>0?(s=Math.log(i),c=(s-a)/(o-r),(Math.log(e)-a)/c+r):(s=Math.log(-t[0]),c=(s-a)/(o-r),-((Math.log(Math.abs(e))-a)/c+r))}function bf(e){let t=this;this._clockViewModel=e,this._allShuttleRingTicks=[],this._dateFormatter=bf.defaultDateFormatter,this._timeFormatter=bf.defaultTimeFormatter,this.shuttleRingDragging=!1,this.snapToTicks=!1,ve.track(this,["_allShuttleRingTicks","_dateFormatter","_timeFormatter","shuttleRingDragging","snapToTicks"]),this._sortedFilteredPositiveTicks=[],this.setShuttleRingTicks(bf.defaultTicks),this.timeLabel=void 0,ve.defineProperty(this,"timeLabel",function(){return t._timeFormatter(t._clockViewModel.currentTime,t)}),this.dateLabel=void 0,ve.defineProperty(this,"dateLabel",function(){return t._dateFormatter(t._clockViewModel.currentTime,t)}),this.multiplierLabel=void 0,ve.defineProperty(this,"multiplierLabel",function(){let s=t._clockViewModel;if(s.clockStep===zr.SYSTEM_CLOCK)return"Today";let a=s.multiplier;return a%1===0?`${a.toFixed(0)}x`:`${a.toFixed(3).replace(/0{0,3}$/,"")}x`}),this.shuttleRingAngle=void 0,ve.defineProperty(this,"shuttleRingAngle",{get:function(){return A5t(e.multiplier,t._allShuttleRingTicks,e)},set:function(s){s=Math.max(Math.min(s,tD),-tD);let a=t._allShuttleRingTicks,c=t._clockViewModel;if(c.clockStep=zr.SYSTEM_CLOCK_MULTIPLIER,Math.abs(s)===tD){c.multiplier=s>0?a[a.length-1]:a[0];return}let u=y5t(s,a);if(t.snapToTicks)u=a[Lle(u,a)];else if(u!==0){let f=Math.abs(u);if(f>100){let d=f.toFixed(0).length-2,p=Math.pow(10,d);u=Math.round(u/p)*p|0}else f>Yb?u=Math.round(u):f>1?u=+u.toFixed(1):f>0&&(u=+u.toFixed(2))}c.multiplier=u}}),this._canAnimate=void 0,ve.defineProperty(this,"_canAnimate",function(){let s=t._clockViewModel,a=s.clockRange;if(t.shuttleRingDragging||a===As.UNBOUNDED)return!0;let c=s.multiplier,u=s.currentTime,f=s.startTime,d;if(a===As.LOOP_STOP)d=K.greaterThan(u,f)||u.equals(f)&&c>0;else{let p=s.stopTime;d=K.greaterThan(u,f)&&K.lessThan(u,p)||u.equals(f)&&c>0||u.equals(p)&&c<0}return d||(s.shouldAnimate=!1),d}),this._isSystemTimeAvailable=void 0,ve.defineProperty(this,"_isSystemTimeAvailable",function(){let s=t._clockViewModel;if(s.clockRange===As.UNBOUNDED)return!0;let c=s.systemTime;return K.greaterThanOrEquals(c,s.startTime)&&K.lessThanOrEquals(c,s.stopTime)}),this._isAnimating=void 0,ve.defineProperty(this,"_isAnimating",function(){return t._clockViewModel.shouldAnimate&&(t._canAnimate||t.shuttleRingDragging)});let n=Rn(function(){let s=t._clockViewModel;s.shouldAnimate?s.shouldAnimate=!1:t._canAnimate&&(s.shouldAnimate=!0)});this._pauseViewModel=new Wb(n,{toggled:ve.computed(function(){return!t._isAnimating}),tooltip:"Pause"});let i=Rn(function(){let s=t._clockViewModel,a=s.multiplier;a>0&&(s.multiplier=-a),s.shouldAnimate=!0});this._playReverseViewModel=new Wb(i,{toggled:ve.computed(function(){return t._isAnimating&&e.multiplier<0}),tooltip:"Play Reverse"});let r=Rn(function(){let s=t._clockViewModel,a=s.multiplier;a<0&&(s.multiplier=-a),s.shouldAnimate=!0});this._playForwardViewModel=new Wb(r,{toggled:ve.computed(function(){return t._isAnimating&&e.multiplier>0&&e.clockStep!==zr.SYSTEM_CLOCK}),tooltip:"Play Forward"});let o=Rn(function(){t._clockViewModel.clockStep=zr.SYSTEM_CLOCK},ve.getObservable(this,"_isSystemTimeAvailable"));this._playRealtimeViewModel=new Wb(o,{toggled:ve.computed(function(){return e.clockStep===zr.SYSTEM_CLOCK}),tooltip:ve.computed(function(){return t._isSystemTimeAvailable?"Today (real-time)":"Current time not in range"})}),this._slower=Rn(function(){let s=t._clockViewModel,a=t._allShuttleRingTicks,c=s.multiplier,u=Lle(c,a)-1;u>=0&&(s.multiplier=a[u])}),this._faster=Rn(function(){let s=t._clockViewModel,a=t._allShuttleRingTicks,c=s.multiplier,u=Lle(c,a)+1;u<a.length&&(s.multiplier=a[u])})}bf.defaultDateFormatter=function(e,t){let n=K.toGregorianDate(e);return`${p5t[n.month-1]} ${n.day} ${n.year}`};bf.defaultTicks=[.001,.002,.005,.01,.02,.05,.1,.25,.5,1,2,5,10,15,30,60,120,300,600,900,1800,3600,7200,14400,21600,43200,86400,172800,345600,604800];bf.defaultTimeFormatter=function(e,t){let n=K.toGregorianDate(e),i=Math.round(n.millisecond);return Math.abs(t._clockViewModel.multiplier)<1?`${n.hour.toString().padStart(2,"0")}:${n.minute.toString().padStart(2,"0")}:${n.second.toString().padStart(2,"0")}.${i.toString().padStart(3,"0")}`:`${n.hour.toString().padStart(2,"0")}:${n.minute.toString().padStart(2,"0")}:${n.second.toString().padStart(2,"0")} UTC`};bf.prototype.getShuttleRingTicks=function(){return this._sortedFilteredPositiveTicks.slice(0)};bf.prototype.setShuttleRingTicks=function(e){let t,n,i,r={},o=this._sortedFilteredPositiveTicks;for(o.length=0,t=0,n=e.length;t<n;++t)i=e[t],r.hasOwnProperty(i)||(r[i]=!0,o.push(i));o.sort(Zke);let s=[];for(n=o.length,t=n-1;t>=0;--t)i=o[t],i!==0&&s.push(-i);Zn(s,o),this._allShuttleRingTicks=s};bf.prototype.adjustDate=function(e,t){if(t===0)return;let n=this._clockViewModel,i=n.currentTime,r=K.toGregorianDate(i),o;if(e==="day"){o=K.addDays(i,t,new K);let s=K.toGregorianDate(o);if(s.year<1||s.year>9999)return}else if(e==="month"){let a=Math.min(Math.max((r.year-1)*12+r.month-1+t,0),119987),c=Math.floor(a/12)+1,u=a%12+1;o=Jke(r,c,u)}else{let s=Math.min(Math.max(r.year+t,1),9999);o=Jke(r,s,r.month)}K.equals(i,o)||(n.shouldAnimate=!1,n.currentTime=o)};bf.prototype.adjustTime=function(e,t){if(t===0)return;let n=this._clockViewModel,i=n.currentTime,r;if(e==="hour")r=K.addHours(i,t,new K);else if(e==="minute")r=K.addMinutes(i,t,new K);else{let s=e==="second"?t:t/1e3;r=K.addSeconds(i,s,new K)}let o=K.toGregorianDate(r);o.year<1||o.year>9999||(n.shouldAnimate=!1,n.currentTime=r)};Object.defineProperties(bf.prototype,{slower:{get:function(){return this._slower}},faster:{get:function(){return this._faster}},clockViewModel:{get:function(){return this._clockViewModel}},pauseViewModel:{get:function(){return this._pauseViewModel}},playReverseViewModel:{get:function(){return this._playReverseViewModel}},playForwardViewModel:{get:function(){return this._playForwardViewModel}},playRealtimeViewModel:{get:function(){return this._playRealtimeViewModel}},dateFormatter:{get:function(){return this._dateFormatter},set:function(e){this._dateFormatter=e}},timeFormatter:{get:function(){return this._timeFormatter},set:function(e){this._timeFormatter=e}}});bf._maxShuttleRingAngle=tD;bf._realtimeShuttleRingAngle=Yb;var I8=bf;function b5t(e){return function(t){let n=e._scene.pick(t.position);l(n)&&n.primitive instanceof Xo&&(e.tileset=n.primitive),e.pickActive=!1}}function e3e(e,t){t?e._eventHandler.setInputAction(function(n){let i=e._scene.pick(n.endPosition);l(i)&&i.primitive instanceof Xo&&(e.tileset=i.primitive)},un.MOUSE_MOVE):(e._eventHandler.removeInputAction(un.MOUSE_MOVE),e.picking=e.picking)}var x5t={maximumFractionDigits:3};function P8(e){let t=e/1048576;return t<1?t.toLocaleString(void 0,x5t):Math.round(t).toLocaleString()}function D8(e,t){if(!l(e))return"";let n=t?e._statisticsPerPass[ao.PICK]:e._statisticsPerPass[ao.RENDER],i='<ul class="cesium-cesiumInspector-statistics">';return i+=`<li><strong>Visited: </strong>${n.visited.toLocaleString()}</li><li><strong>Selected: </strong>${n.selected.toLocaleString()}</li><li><strong>Commands: </strong>${n.numberOfCommands.toLocaleString()}</li>`,i+="</ul>",t||(i+='<ul class="cesium-cesiumInspector-statistics">',i+=`<li><strong>Requests: </strong>${n.numberOfPendingRequests.toLocaleString()}</li><li><strong>Attempted: </strong>${n.numberOfAttemptedRequests.toLocaleString()}</li><li><strong>Processing: </strong>${n.numberOfTilesProcessing.toLocaleString()}</li><li><strong>Content Ready: </strong>${n.numberOfTilesWithContentReady.toLocaleString()}</li><li><strong>Total: </strong>${n.numberOfTilesTotal.toLocaleString()}</li>`,i+="</ul>",i+='<ul class="cesium-cesiumInspector-statistics">',i+=`<li><strong>Features Selected: </strong>${n.numberOfFeaturesSelected.toLocaleString()}</li><li><strong>Features Loaded: </strong>${n.numberOfFeaturesLoaded.toLocaleString()}</li><li><strong>Points Selected: </strong>${n.numberOfPointsSelected.toLocaleString()}</li><li><strong>Points Loaded: </strong>${n.numberOfPointsLoaded.toLocaleString()}</li><li><strong>Triangles Selected: </strong>${n.numberOfTrianglesSelected.toLocaleString()}</li>`,i+="</ul>",i+='<ul class="cesium-cesiumInspector-statistics">',i+=`<li><strong>Tiles styled: </strong>${n.numberOfTilesStyled.toLocaleString()}</li><li><strong>Features styled: </strong>${n.numberOfFeaturesStyled.toLocaleString()}</li>`,i+="</ul>",i+='<ul class="cesium-cesiumInspector-statistics">',i+=`<li><strong>Children Union Culled: </strong>${n.numberOfTilesCulledWithChildrenUnion.toLocaleString()}</li>`,i+="</ul>",i+='<ul class="cesium-cesiumInspector-statistics">',i+=`<li><strong>Geometry Memory (MB): </strong>${P8(n.geometryByteLength)}</li><li><strong>Texture Memory (MB): </strong>${P8(n.texturesByteLength)}</li><li><strong>Batch Table Memory (MB): </strong>${P8(n.batchTableByteLength)}</li>`,i+="</ul>"),i}function t3e(){let e=Fi.statistics;return` + <ul class="cesium-cesiumInspector-statistics"> + <li><strong>Geometry Memory (MB): </strong>${P8(e.geometryByteLength)}</li> + <li><strong>Texture Memory (MB): </strong>${P8(e.texturesByteLength)}</li> + </ul> + `}var T5t=[{text:"Highlight",value:qu.HIGHLIGHT},{text:"Replace",value:qu.REPLACE},{text:"Mix",value:qu.MIX}],Qke=new z(1,1,0,.4),E5t=new z,oq=new z;function vc(e,t){let n=this,i=e.canvas;this._eventHandler=new sa(i),this._scene=e,this._performanceContainer=t,this._canvas=i,this._performanceDisplay=new k_({container:t}),this._statisticsText="",this._pickStatisticsText="",this._resourceCacheStatisticsText="",this._editorError="",this.performance=!1,this.showStatistics=!0,this.showPickStatistics=!0,this.showResourceCacheStatistics=!1,this.inspectorVisible=!0,this.tilesetVisible=!1,this.displayVisible=!1,this.updateVisible=!1,this.loggingVisible=!1,this.styleVisible=!1,this.tileDebugLabelsVisible=!1,this.optimizationVisible=!1,this.styleString="{}",this.hasEnabledWireframe=!1,this._tileset=void 0,this._feature=void 0,this._tile=void 0,ve.track(this,["performance","inspectorVisible","_statisticsText","_pickStatisticsText","_resourceCacheStatisticsText","_editorError","showPickStatistics","showStatistics","showResourceCacheStatistics","tilesetVisible","displayVisible","updateVisible","loggingVisible","styleVisible","optimizationVisible","tileDebugLabelsVisible","styleString","_feature","_tile","_tileset","hasEnabledWireframe"]),this._properties=ve.observable({}),this.properties=[],ve.defineProperty(this,"properties",function(){let k=[],G=n._properties();for(let q in G)G.hasOwnProperty(q)&&k.push(q);return k});let r=ve.observable();ve.defineProperty(this,"dynamicScreenSpaceError",{get:function(){return r()},set:function(k){r(k),l(n._tileset)&&(n._tileset.dynamicScreenSpaceError=k)}}),this.dynamicScreenSpaceError=!1;let o=ve.observable();ve.defineProperty(this,"colorBlendMode",{get:function(){return o()},set:function(k){o(k),l(n._tileset)&&(n._tileset.colorBlendMode=k,n._scene.requestRender())}}),this.colorBlendMode=qu.HIGHLIGHT;let s=ve.observable(),a=ve.observable();ve.defineProperty(this,"picking",{get:function(){return a()},set:function(k){a(k),k?n._eventHandler.setInputAction(function(G){let q=e.pick(G.endPosition);if(q instanceof oa?(n.feature=q,n.tile=q.content.tile):l(q)&&l(q.content)?(n.feature=void 0,n.tile=q.content.tile):(n.feature=void 0,n.tile=void 0),!!l(n._tileset)){if(s&&l(q)&&l(q.content)){let Q;e.pickPositionSupported&&(Q=e.pickPosition(G.endPosition),l(Q)&&(n._tileset.debugPickPosition=Q)),n._tileset.debugPickedTile=q.content.tile}else n._tileset.debugPickedTile=void 0;n._scene.requestRender()}},un.MOUSE_MOVE):(n.feature=void 0,n.tile=void 0,n._eventHandler.removeInputAction(un.MOUSE_MOVE))}}),this.picking=!0;let c=ve.observable();ve.defineProperty(this,"colorize",{get:function(){return c()},set:function(k){c(k),l(n._tileset)&&(n._tileset.debugColorizeTiles=k,n._scene.requestRender())}}),this.colorize=!1;let u=ve.observable();ve.defineProperty(this,"wireframe",{get:function(){return u()},set:function(k){u(k),l(n._tileset)&&(n._tileset.debugWireframe=k,n._scene.requestRender())}}),this.wireframe=!1;let f=ve.observable();ve.defineProperty(this,"showBoundingVolumes",{get:function(){return f()},set:function(k){f(k),l(n._tileset)&&(n._tileset.debugShowBoundingVolume=k,n._scene.requestRender())}}),this.showBoundingVolumes=!1;let d=ve.observable();ve.defineProperty(this,"showContentBoundingVolumes",{get:function(){return d()},set:function(k){d(k),l(n._tileset)&&(n._tileset.debugShowContentBoundingVolume=k,n._scene.requestRender())}}),this.showContentBoundingVolumes=!1;let p=ve.observable();ve.defineProperty(this,"showRequestVolumes",{get:function(){return p()},set:function(k){p(k),l(n._tileset)&&(n._tileset.debugShowViewerRequestVolume=k,n._scene.requestRender())}}),this.showRequestVolumes=!1;let g=ve.observable();ve.defineProperty(this,"freezeFrame",{get:function(){return g()},set:function(k){g(k),l(n._tileset)&&(n._tileset.debugFreezeFrame=k,n._scene.debugShowFrustumPlanes=k,n._scene.requestRender())}}),this.freezeFrame=!1,ve.defineProperty(this,"showOnlyPickedTileDebugLabel",{get:function(){return s()},set:function(k){s(k),l(n._tileset)&&(n._tileset.debugPickedTileLabelOnly=k,n._scene.requestRender())}}),this.showOnlyPickedTileDebugLabel=!1;let m=ve.observable();ve.defineProperty(this,"showGeometricError",{get:function(){return m()},set:function(k){m(k),l(n._tileset)&&(n._tileset.debugShowGeometricError=k,n._scene.requestRender())}}),this.showGeometricError=!1;let y=ve.observable();ve.defineProperty(this,"showRenderingStatistics",{get:function(){return y()},set:function(k){y(k),l(n._tileset)&&(n._tileset.debugShowRenderingStatistics=k,n._scene.requestRender())}}),this.showRenderingStatistics=!1;let A=ve.observable();ve.defineProperty(this,"showMemoryUsage",{get:function(){return A()},set:function(k){A(k),l(n._tileset)&&(n._tileset.debugShowMemoryUsage=k,n._scene.requestRender())}}),this.showMemoryUsage=!1;let b=ve.observable();ve.defineProperty(this,"showUrl",{get:function(){return b()},set:function(k){b(k),l(n._tileset)&&(n._tileset.debugShowUrl=k,n._scene.requestRender())}}),this.showUrl=!1;let x=ve.observable();ve.defineProperty(this,"maximumScreenSpaceError",{get:function(){return x()},set:function(k){k=Number(k),isNaN(k)||(x(k),l(n._tileset)&&(n._tileset.maximumScreenSpaceError=k))}}),this.maximumScreenSpaceError=16;let T=ve.observable();ve.defineProperty(this,"dynamicScreenSpaceErrorDensity",{get:function(){return T()},set:function(k){k=Number(k),isNaN(k)||(T(k),l(n._tileset)&&(n._tileset.dynamicScreenSpaceErrorDensity=k))}}),this.dynamicScreenSpaceErrorDensity=2e-4,this.dynamicScreenSpaceErrorDensitySliderValue=void 0,ve.defineProperty(this,"dynamicScreenSpaceErrorDensitySliderValue",{get:function(){return Math.pow(T(),1/6)},set:function(k){let G=Math.pow(k,6);T(G),l(n._tileset)&&(n._tileset.dynamicScreenSpaceErrorDensity=G)}});let E=ve.observable();ve.defineProperty(this,"dynamicScreenSpaceErrorFactor",{get:function(){return E()},set:function(k){k=Number(k),isNaN(k)||(E(k),l(n._tileset)&&(n._tileset.dynamicScreenSpaceErrorFactor=k))}}),this.dynamicScreenSpaceErrorFactor=24;let v=b5t(this),S=ve.observable();ve.defineProperty(this,"pickActive",{get:function(){return S()},set:function(k){S(k),k?n._eventHandler.setInputAction(v,un.LEFT_CLICK):n._eventHandler.removeInputAction(un.LEFT_CLICK)}});let I=ve.observable();ve.defineProperty(this,"pointCloudShading",{get:function(){return I()},set:function(k){I(k),l(n._tileset)&&(n._tileset.pointCloudShading.attenuation=k)}}),this.pointCloudShading=!1;let R=ve.observable();ve.defineProperty(this,"geometricErrorScale",{get:function(){return R()},set:function(k){k=Number(k),isNaN(k)||(R(k),l(n._tileset)&&(n._tileset.pointCloudShading.geometricErrorScale=k))}}),this.geometricErrorScale=1;let O=ve.observable();ve.defineProperty(this,"maximumAttenuation",{get:function(){return O()},set:function(k){k=Number(k),isNaN(k)||(O(k),l(n._tileset)&&(n._tileset.pointCloudShading.maximumAttenuation=k===0?void 0:k))}}),this.maximumAttenuation=0;let L=ve.observable();ve.defineProperty(this,"baseResolution",{get:function(){return L()},set:function(k){k=Number(k),isNaN(k)||(L(k),l(n._tileset)&&(n._tileset.pointCloudShading.baseResolution=k===0?void 0:k))}}),this.baseResolution=0;let _=ve.observable();ve.defineProperty(this,"eyeDomeLighting",{get:function(){return _()},set:function(k){_(k),l(n._tileset)&&(n._tileset.pointCloudShading.eyeDomeLighting=k)}}),this.eyeDomeLighting=!1;let C=ve.observable();ve.defineProperty(this,"eyeDomeLightingStrength",{get:function(){return C()},set:function(k){k=Number(k),isNaN(k)||(C(k),l(n._tileset)&&(n._tileset.pointCloudShading.eyeDomeLightingStrength=k))}}),this.eyeDomeLightingStrength=1;let w=ve.observable();ve.defineProperty(this,"eyeDomeLightingRadius",{get:function(){return w()},set:function(k){k=Number(k),isNaN(k)||(w(k),l(n._tileset)&&(n._tileset.pointCloudShading.eyeDomeLightingRadius=k))}}),this.eyeDomeLightingRadius=1,this.pickActive=!1;let P=ve.observable();ve.defineProperty(this,"skipLevelOfDetail",{get:function(){return P()},set:function(k){P(k),l(n._tileset)&&(n._tileset.skipLevelOfDetail=k)}}),this.skipLevelOfDetail=!0;let M=ve.observable();ve.defineProperty(this,"skipScreenSpaceErrorFactor",{get:function(){return M()},set:function(k){k=Number(k),isNaN(k)||(M(k),l(n._tileset)&&(n._tileset.skipScreenSpaceErrorFactor=k))}}),this.skipScreenSpaceErrorFactor=16;let F=ve.observable();ve.defineProperty(this,"baseScreenSpaceError",{get:function(){return F()},set:function(k){k=Number(k),isNaN(k)||(F(k),l(n._tileset)&&(n._tileset.baseScreenSpaceError=k))}}),this.baseScreenSpaceError=1024;let V=ve.observable();ve.defineProperty(this,"skipLevels",{get:function(){return V()},set:function(k){k=Number(k),isNaN(k)||(V(k),l(n._tileset)&&(n._tileset.skipLevels=k))}}),this.skipLevels=1;let B=ve.observable();ve.defineProperty(this,"immediatelyLoadDesiredLevelOfDetail",{get:function(){return B()},set:function(k){B(k),l(n._tileset)&&(n._tileset.immediatelyLoadDesiredLevelOfDetail=k)}}),this.immediatelyLoadDesiredLevelOfDetail=!1;let j=ve.observable();ve.defineProperty(this,"loadSiblings",{get:function(){return j()},set:function(k){j(k),l(n._tileset)&&(n._tileset.loadSiblings=k)}}),this.loadSiblings=!1,this._style=void 0,this._shouldStyle=!1,this._definedProperties=["properties","dynamicScreenSpaceError","colorBlendMode","picking","colorize","wireframe","showBoundingVolumes","showContentBoundingVolumes","showRequestVolumes","freezeFrame","maximumScreenSpaceError","dynamicScreenSpaceErrorDensity","baseScreenSpaceError","skipScreenSpaceErrorFactor","skipLevelOfDetail","skipLevels","immediatelyLoadDesiredLevelOfDetail","loadSiblings","dynamicScreenSpaceErrorDensitySliderValue","dynamicScreenSpaceErrorFactor","pickActive","showOnlyPickedTileDebugLabel","showGeometricError","showRenderingStatistics","showMemoryUsage","showUrl","pointCloudShading","geometricErrorScale","maximumAttenuation","baseResolution","eyeDomeLighting","eyeDomeLightingStrength","eyeDomeLightingRadius"],this._removePostRenderEvent=e.postRender.addEventListener(function(){n._update()}),l(this._tileset)||e3e(this,!0)}Object.defineProperties(vc.prototype,{scene:{get:function(){return this._scene}},performanceContainer:{get:function(){return this._performanceContainer}},statisticsText:{get:function(){return this._statisticsText}},pickStatisticsText:{get:function(){return this._pickStatisticsText}},resourceCacheStatisticsText:{get:function(){return this._resourceCacheStatisticsText}},colorBlendModes:{get:function(){return T5t}},editorError:{get:function(){return this._editorError}},tileset:{get:function(){return this._tileset},set:function(e){if(this._tileset=e,this._style=void 0,this.styleString="{}",this.feature=void 0,this.tile=void 0,l(e)){this._properties(e.properties);let t=["colorize","wireframe","showBoundingVolumes","showContentBoundingVolumes","showRequestVolumes","freezeFrame","showOnlyPickedTileDebugLabel","showGeometricError","showRenderingStatistics","showMemoryUsage","showUrl"],n=t.length;for(let r=0;r<n;++r){let o=t[r];this[o]=this[o]}this.maximumScreenSpaceError=e.maximumScreenSpaceError,this.dynamicScreenSpaceError=e.dynamicScreenSpaceError,this.dynamicScreenSpaceErrorDensity=e.dynamicScreenSpaceErrorDensity,this.dynamicScreenSpaceErrorFactor=e.dynamicScreenSpaceErrorFactor,this.colorBlendMode=e.colorBlendMode,this.skipLevelOfDetail=e.skipLevelOfDetail,this.skipScreenSpaceErrorFactor=e.skipScreenSpaceErrorFactor,this.baseScreenSpaceError=e.baseScreenSpaceError,this.skipLevels=e.skipLevels,this.immediatelyLoadDesiredLevelOfDetail=e.immediatelyLoadDesiredLevelOfDetail,this.loadSiblings=e.loadSiblings,this.hasEnabledWireframe=e._enableDebugWireframe;let i=e.pointCloudShading;this.pointCloudShading=i.attenuation,this.geometricErrorScale=i.geometricErrorScale,this.maximumAttenuation=i.maximumAttenuation?i.maximumAttenuation:0,this.baseResolution=i.baseResolution?i.baseResolution:0,this.eyeDomeLighting=i.eyeDomeLighting,this.eyeDomeLightingStrength=i.eyeDomeLightingStrength,this.eyeDomeLightingRadius=i.eyeDomeLightingRadius,this._scene.requestRender()}else this._properties({});this._statisticsText=D8(e,!1),this._pickStatisticsText=D8(e,!0),this._resourceCacheStatisticsText=t3e(),e3e(this,!1)}},feature:{get:function(){return this._feature},set:function(e){if(this._feature===e)return;let t=this._feature;l(t)&&!t.content.isDestroyed()&&(!this.colorize&&l(this._style)?t.color=l(this._style.color)?this._style.color.evaluateColor(t,E5t):z.WHITE:t.color=oq,this._scene.requestRender()),l(e)&&(z.clone(e.color,oq),e.color=Qke,this._scene.requestRender()),this._feature=e}},tile:{get:function(){return this._tile},set:function(e){if(this._tile===e)return;let t=this._tile;l(t)&&!t.isDestroyed()&&!Fle(t.content)&&(t.color=oq,this._scene.requestRender()),l(e)&&!Fle(e.content)&&(z.clone(e.color,oq),e.color=Qke,this._scene.requestRender()),this._tile=e}}});function Fle(e){if(!l(e))return!1;if(e.featuresLength>0)return!0;let t=e.innerContents;if(l(t)){let n=t.length;for(let i=0;i<n;++i)if(!Fle(t[i]))return!1;return!0}return!1}vc.prototype.togglePickTileset=function(){this.pickActive=!this.pickActive};vc.prototype.toggleInspector=function(){this.inspectorVisible=!this.inspectorVisible};vc.prototype.toggleTileset=function(){this.tilesetVisible=!this.tilesetVisible};vc.prototype.toggleDisplay=function(){this.displayVisible=!this.displayVisible};vc.prototype.toggleUpdate=function(){this.updateVisible=!this.updateVisible};vc.prototype.toggleLogging=function(){this.loggingVisible=!this.loggingVisible};vc.prototype.toggleStyle=function(){this.styleVisible=!this.styleVisible};vc.prototype.toggleTileDebugLabels=function(){this.tileDebugLabelsVisible=!this.tileDebugLabelsVisible};vc.prototype.toggleOptimization=function(){this.optimizationVisible=!this.optimizationVisible};vc.prototype.trimTilesCache=function(){l(this._tileset)&&this._tileset.trimLoadedTiles()};vc.prototype.compileStyle=function(){let e=this._tileset;if(!(!l(e)||this.styleString===JSON.stringify(e.style))){this._editorError="";try{this.styleString.length===0&&(this.styleString="{}"),this._style=new b_(JSON.parse(this.styleString)),this._shouldStyle=!0,this._scene.requestRender()}catch(t){this._editorError=t.toString()}this.feature=this._feature,this.tile=this._tile}};vc.prototype.styleEditorKeyPress=function(e,t){if(t.keyCode===9){t.preventDefault();let n=t.target,i=n.selectionStart,r=n.selectionEnd,o=r,a=n.value.slice(i,r).split(` +`),c=a.length,u;if(t.shiftKey)for(u=0;u<c;++u)a[u][0]===" "&&(a[u][1]===" "?(a[u]=a[u].substr(2),o-=2):(a[u]=a[u].substr(1),o-=1));else for(u=0;u<c;++u)a[u]=` ${a[u]}`,o+=2;let f=a.join(` +`);n.value=n.value.slice(0,i)+f+n.value.slice(r),n.selectionStart=i!==r?i:o,n.selectionEnd=o}else t.ctrlKey&&(t.keyCode===10||t.keyCode===13)&&this.compileStyle();return!0};vc.prototype._update=function(){let e=this._tileset;if(this.performance&&this._performanceDisplay.update(),l(e)){if(e.isDestroyed()){this.tile=void 0,this.feature=void 0,this.tileset=void 0;return}let t=e.style;this._style!==e.style&&(this._shouldStyle?(e.style=this._style,this._shouldStyle=!1):(this._style=t,this.styleString=JSON.stringify(t.style,null," ")))}this.showStatistics&&(this._statisticsText=D8(e,!1),this._pickStatisticsText=D8(e,!0),this._resourceCacheStatisticsText=t3e())};vc.prototype.isDestroyed=function(){return!1};vc.prototype.destroy=function(){this._eventHandler.destroy(),this._removePostRenderEvent();let e=this;return this._definedProperties.forEach(function(t){ve.getObservable(e,t).dispose()}),le(this)};vc.getStatistics=D8;var R8=vc;function sq(e,t){e=Ln(e);let n=document.createElement("div"),i=document.createElement("div");i.setAttribute("data-bind","visible: performance");let r=new R8(t,i);this._viewModel=r,this._container=e,this._element=n;let o=document.createElement("div");o.textContent="3D Tiles Inspector",o.className="cesium-cesiumInspector-button",o.setAttribute("data-bind","click: toggleInspector"),n.appendChild(o),n.className="cesium-cesiumInspector cesium-3DTilesInspector",n.setAttribute("data-bind",'css: { "cesium-cesiumInspector-visible" : inspectorVisible, "cesium-cesiumInspector-hidden" : !inspectorVisible}'),e.appendChild(n);let s=document.createElement("div");s.className="cesium-cesiumInspector-dropDown",n.appendChild(s);let a=Af.createSection,c=Af.createCheckbox,u=Af.createRangeInput,f=Af.createButton,d=a(s,"Tileset","tilesetVisible","toggleTileset"),p=a(s,"Display","displayVisible","toggleDisplay"),g=a(s,"Update","updateVisible","toggleUpdate"),m=a(s,"Logging","loggingVisible","toggleLogging"),y=a(s,"Tile Debug Labels","tileDebugLabelsVisible","toggleTileDebugLabels"),A=a(s,"Style","styleVisible","toggleStyle"),b=a(s,"Optimization","optimizationVisible","toggleOptimization"),x=document.createElement("div");x.className="field-group";let T=document.createElement("label");T.className="field-label",T.appendChild(document.createTextNode("Properties: "));let E=document.createElement("div");E.setAttribute("data-bind","text: properties"),x.appendChild(T),x.appendChild(E),d.appendChild(x),d.appendChild(f("Pick Tileset","togglePickTileset","pickActive")),d.appendChild(f("Trim Tiles Cache","trimTilesCache")),d.appendChild(c("Enable Picking","picking")),p.appendChild(c("Colorize","colorize"));let v=p.appendChild(c("Wireframe","wireframe","_tileset === undefined || hasEnabledWireframe")),S=document.createElement("p");S.setAttribute("data-bind","visible: _tileset !== undefined && !hasEnabledWireframe"),S.setAttribute("class","cesium-3DTilesInspector-disabledElementsInfo"),S.innerText="Set enableDebugWireframe to true in the tileset constructor to enable this option.",v.appendChild(S),p.appendChild(c("Bounding Volumes","showBoundingVolumes")),p.appendChild(c("Content Volumes","showContentBoundingVolumes")),p.appendChild(c("Request Volumes","showRequestVolumes")),p.appendChild(c("Point Cloud Shading","pointCloudShading"));let I=document.createElement("div");I.setAttribute("data-bind","visible: pointCloudShading"),I.appendChild(u("Geometric Error Scale","geometricErrorScale",0,2,.01)),I.appendChild(u("Maximum Attenuation","maximumAttenuation",0,32,1)),I.appendChild(u("Base Resolution","baseResolution",0,1,.01)),I.appendChild(c("Eye Dome Lighting (EDL)","eyeDomeLighting")),p.appendChild(I);let R=document.createElement("div");R.setAttribute("data-bind","visible: eyeDomeLighting"),R.appendChild(u("EDL Strength","eyeDomeLightingStrength",0,2,.1)),R.appendChild(u("EDL Radius","eyeDomeLightingRadius",0,4,.1)),I.appendChild(R),g.appendChild(c("Freeze Frame","freezeFrame")),g.appendChild(c("Dynamic Screen Space Error","dynamicScreenSpaceError"));let O=document.createElement("div");O.appendChild(u("Maximum Screen Space Error","maximumScreenSpaceError",0,128,1)),g.appendChild(O);let L=document.createElement("div");L.setAttribute("data-bind","visible: dynamicScreenSpaceError"),L.appendChild(u("Screen Space Error Density","dynamicScreenSpaceErrorDensitySliderValue",0,1,.005,"dynamicScreenSpaceErrorDensity")),L.appendChild(u("Screen Space Error Factor","dynamicScreenSpaceErrorFactor",1,32,.1)),g.appendChild(L),m.appendChild(c("Performance","performance")),m.appendChild(i),m.appendChild(c("Statistics","showStatistics"));let _=document.createElement("div");_.className="cesium-3dTilesInspector-statistics",_.setAttribute("data-bind","html: statisticsText, visible: showStatistics"),m.appendChild(_),m.appendChild(c("Pick Statistics","showPickStatistics"));let C=document.createElement("div");C.className="cesium-3dTilesInspector-statistics",C.setAttribute("data-bind","html: pickStatisticsText, visible: showPickStatistics"),m.appendChild(C),m.appendChild(c("Resource Cache Statistics","showResourceCacheStatistics"));let w=document.createElement("div");w.className="cesium-3dTilesInspector-statistics",w.setAttribute("data-bind","html: resourceCacheStatisticsText, visible: showResourceCacheStatistics"),m.appendChild(w);let P=document.createElement("div");A.appendChild(P),P.appendChild(document.createTextNode("Color Blend Mode: "));let M=document.createElement("select");M.setAttribute("data-bind",'options: colorBlendModes, optionsText: "text", optionsValue: "value", value: colorBlendMode'),P.appendChild(M);let F=document.createElement("textarea");F.setAttribute("data-bind","textInput: styleString, event: { keydown: styleEditorKeyPress }"),P.className="cesium-cesiumInspector-styleEditor",P.appendChild(F);let V=f("Compile (Ctrl+Enter)","compileStyle");P.appendChild(V);let B=document.createElement("div");B.className="cesium-cesiumInspector-error",B.setAttribute("data-bind","text: editorError"),P.appendChild(B),y.appendChild(c("Show Picked Only","showOnlyPickedTileDebugLabel")),y.appendChild(c("Geometric Error","showGeometricError")),y.appendChild(c("Rendering Statistics","showRenderingStatistics")),y.appendChild(c("Memory Usage (MB)","showMemoryUsage")),y.appendChild(c("Url","showUrl")),b.appendChild(c("Skip Tile LODs","skipLevelOfDetail"));let j=document.createElement("div");j.appendChild(u("Skip SSE Factor","skipScreenSpaceErrorFactor",1,50,1)),b.appendChild(j);let k=document.createElement("div");k.appendChild(u("SSE before skipping LOD","baseScreenSpaceError",0,4096,1)),b.appendChild(k);let G=document.createElement("div");G.appendChild(u("Min. levels to skip","skipLevels",0,10,1)),b.appendChild(G),b.appendChild(c("Load only tiles that meet the max SSE.","immediatelyLoadDesiredLevelOfDetail")),b.appendChild(c("Load siblings of visible tiles","loadSiblings")),ve.applyBindings(r,n)}Object.defineProperties(sq.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}}});sq.prototype.isDestroyed=function(){return!1};sq.prototype.destroy=function(){return ve.cleanNode(this._element),this._container.removeChild(this._element),this.viewModel.destroy(),le(this)};var O8=sq;function C5t(e){let t;if(l(e)){t="Command Statistics";let n=e.commandsInFrustums;for(let i in n)if(n.hasOwnProperty(i)){let r=parseInt(i,10),o;if(r===7)o="1, 2 and 3";else{let s=[];for(let a=2;a>=0;a--){let c=Math.pow(2,a);r>=c&&(s.push(a+1),r-=c)}o=s.reverse().join(" and ")}t+=`<br>    ${n[i]} in frustum ${o}`}t+=`<br>Total: ${e.totalCommands}`}return t}function Ble(e,t,n){let i=Math.min(n,t);return i=Math.max(i,e),i}var v5t=new pn,S5t=new h;function M8(e,t){let n=this,i=e.canvas,r=new sa(i);this._eventHandler=r,this._scene=e,this._canvas=i,this._primitive=void 0,this._tile=void 0,this._modelMatrixPrimitive=void 0,this._performanceDisplay=void 0,this._performanceContainer=t;let o=this._scene.globe;o.depthTestAgainstTerrain=!0,this.frustums=!1,this.frustumPlanes=!1,this.performance=!1,this.shaderCacheText="",this.primitiveBoundingSphere=!1,this.primitiveReferenceFrame=!1,this.filterPrimitive=!1,this.tileBoundingSphere=!1,this.filterTile=!1,this.wireframe=!1,this.depthFrustum=1,this._numberOfFrustums=1,this.suspendUpdates=!1,this.tileCoordinates=!1,this.frustumStatisticText=!1,this.tileText="",this.hasPickedPrimitive=!1,this.hasPickedTile=!1,this.pickPrimitiveActive=!1,this.pickTileActive=!1,this.dropDownVisible=!0,this.generalVisible=!0,this.primitivesVisible=!1,this.terrainVisible=!1,this.depthFrustumText="",ve.track(this,["frustums","frustumPlanes","performance","shaderCacheText","primitiveBoundingSphere","primitiveReferenceFrame","filterPrimitive","tileBoundingSphere","filterTile","wireframe","depthFrustum","suspendUpdates","tileCoordinates","frustumStatisticText","tileText","hasPickedPrimitive","hasPickedTile","pickPrimitiveActive","pickTileActive","dropDownVisible","generalVisible","primitivesVisible","terrainVisible","depthFrustumText"]),this._toggleDropDown=Rn(function(){n.dropDownVisible=!n.dropDownVisible}),this._toggleGeneral=Rn(function(){n.generalVisible=!n.generalVisible}),this._togglePrimitives=Rn(function(){n.primitivesVisible=!n.primitivesVisible}),this._toggleTerrain=Rn(function(){n.terrainVisible=!n.terrainVisible}),this._frustumsSubscription=ve.getObservable(this,"frustums").subscribe(function(u){n._scene.debugShowFrustums=u,n._scene.requestRender()}),this._frustumPlanesSubscription=ve.getObservable(this,"frustumPlanes").subscribe(function(u){n._scene.debugShowFrustumPlanes=u,n._scene.requestRender()}),this._performanceSubscription=ve.getObservable(this,"performance").subscribe(function(u){u?n._performanceDisplay=new k_({container:n._performanceContainer}):n._performanceContainer.innerHTML=""}),this._showPrimitiveBoundingSphere=Rn(function(){return n._primitive.debugShowBoundingVolume=n.primitiveBoundingSphere,n._scene.requestRender(),!0}),this._primitiveBoundingSphereSubscription=ve.getObservable(this,"primitiveBoundingSphere").subscribe(function(){n._showPrimitiveBoundingSphere()}),this._showPrimitiveReferenceFrame=Rn(function(){if(n.primitiveReferenceFrame){let u=n._primitive.modelMatrix;n._modelMatrixPrimitive=new Z4({modelMatrix:u}),n._scene.primitives.add(n._modelMatrixPrimitive)}else l(n._modelMatrixPrimitive)&&(n._scene.primitives.remove(n._modelMatrixPrimitive),n._modelMatrixPrimitive=void 0);return n._scene.requestRender(),!0}),this._primitiveReferenceFrameSubscription=ve.getObservable(this,"primitiveReferenceFrame").subscribe(function(){n._showPrimitiveReferenceFrame()}),this._doFilterPrimitive=Rn(function(){return n.filterPrimitive?n._scene.debugCommandFilter=function(u){return l(n._modelMatrixPrimitive)&&u.owner===n._modelMatrixPrimitive._primitive?!0:l(n._primitive)?u.owner===n._primitive||u.owner===n._primitive._billboardCollection||u.owner.primitive===n._primitive:!1}:n._scene.debugCommandFilter=void 0,!0}),this._filterPrimitiveSubscription=ve.getObservable(this,"filterPrimitive").subscribe(function(){n._doFilterPrimitive(),n._scene.requestRender()}),this._wireframeSubscription=ve.getObservable(this,"wireframe").subscribe(function(u){o._surface.tileProvider._debug.wireframe=u,n._scene.requestRender()}),this._depthFrustumSubscription=ve.getObservable(this,"depthFrustum").subscribe(function(u){n._scene.debugShowDepthFrustum=u,n._scene.requestRender()}),this._incrementDepthFrustum=Rn(function(){let u=n.depthFrustum+1;return n.depthFrustum=Ble(1,n._numberOfFrustums,u),n._scene.requestRender(),!0}),this._decrementDepthFrustum=Rn(function(){let u=n.depthFrustum-1;return n.depthFrustum=Ble(1,n._numberOfFrustums,u),n._scene.requestRender(),!0}),this._suspendUpdatesSubscription=ve.getObservable(this,"suspendUpdates").subscribe(function(u){o._surface._debug.suspendLodUpdate=u,u||(n.filterTile=!1)});let s;this._showTileCoordinates=Rn(function(){return n.tileCoordinates&&!l(s)?s=e.imageryLayers.addImageryProvider(new _8({tilingScheme:e.terrainProvider.tilingScheme})):!n.tileCoordinates&&l(s)&&(e.imageryLayers.remove(s),s=void 0),!0}),this._tileCoordinatesSubscription=ve.getObservable(this,"tileCoordinates").subscribe(function(){n._showTileCoordinates(),n._scene.requestRender()}),this._tileBoundingSphereSubscription=ve.getObservable(this,"tileBoundingSphere").subscribe(function(){n._showTileBoundingSphere(),n._scene.requestRender()}),this._showTileBoundingSphere=Rn(function(){return n.tileBoundingSphere?o._surface.tileProvider._debug.boundingSphereTile=n._tile:o._surface.tileProvider._debug.boundingSphereTile=void 0,n._scene.requestRender(),!0}),this._doFilterTile=Rn(function(){return n.filterTile?(n.suspendUpdates=!0,o._surface._tilesToRender=[],l(n._tile)&&n._tile.renderable&&o._surface._tilesToRender.push(n._tile)):n.suspendUpdates=!1,!0}),this._filterTileSubscription=ve.getObservable(this,"filterTile").subscribe(function(){n.doFilterTile(),n._scene.requestRender()});function a(u){let f=n._scene.pick({x:u.position.x,y:u.position.y});l(f)&&(n.primitive=l(f.collection)?f.collection:f.primitive),n._scene.requestRender(),n.pickPrimitiveActive=!1}this._pickPrimitive=Rn(function(){n.pickPrimitiveActive=!n.pickPrimitiveActive}),this._pickPrimitiveActiveSubscription=ve.getObservable(this,"pickPrimitiveActive").subscribe(function(u){u?r.setInputAction(a,un.LEFT_CLICK):r.removeInputAction(un.LEFT_CLICK)});function c(u){let f,d=o.ellipsoid,p=n._scene.camera.getPickRay(u.position,v5t),g=o.pick(p,n._scene,S5t);if(l(g)){let m=d.cartesianToCartographic(g),y=o._surface.tileProvider._tilesToRenderByTextureCount;for(let A=0;!f&&A<y.length;++A){let b=y[A];if(l(b))for(let x=0;!f&&x<b.length;++x){let T=b[x];ie.contains(T.rectangle,m)&&(f=T)}}}n.tile=f,n.pickTileActive=!1}this._pickTile=Rn(function(){n.pickTileActive=!n.pickTileActive}),this._pickTileActiveSubscription=ve.getObservable(this,"pickTileActive").subscribe(function(u){u?r.setInputAction(c,un.LEFT_CLICK):r.removeInputAction(un.LEFT_CLICK)}),this._removePostRenderEvent=e.postRender.addEventListener(function(){n._update()})}Object.defineProperties(M8.prototype,{scene:{get:function(){return this._scene}},performanceContainer:{get:function(){return this._performanceContainer}},toggleDropDown:{get:function(){return this._toggleDropDown}},showPrimitiveBoundingSphere:{get:function(){return this._showPrimitiveBoundingSphere}},showPrimitiveReferenceFrame:{get:function(){return this._showPrimitiveReferenceFrame}},doFilterPrimitive:{get:function(){return this._doFilterPrimitive}},incrementDepthFrustum:{get:function(){return this._incrementDepthFrustum}},decrementDepthFrustum:{get:function(){return this._decrementDepthFrustum}},showTileCoordinates:{get:function(){return this._showTileCoordinates}},showTileBoundingSphere:{get:function(){return this._showTileBoundingSphere}},doFilterTile:{get:function(){return this._doFilterTile}},toggleGeneral:{get:function(){return this._toggleGeneral}},togglePrimitives:{get:function(){return this._togglePrimitives}},toggleTerrain:{get:function(){return this._toggleTerrain}},pickPrimitive:{get:function(){return this._pickPrimitive}},pickTile:{get:function(){return this._pickTile}},selectParent:{get:function(){let e=this;return Rn(function(){e.tile=e.tile.parent})}},selectNW:{get:function(){let e=this;return Rn(function(){e.tile=e.tile.northwestChild})}},selectNE:{get:function(){let e=this;return Rn(function(){e.tile=e.tile.northeastChild})}},selectSW:{get:function(){let e=this;return Rn(function(){e.tile=e.tile.southwestChild})}},selectSE:{get:function(){let e=this;return Rn(function(){e.tile=e.tile.southeastChild})}},primitive:{get:function(){return this._primitive},set:function(e){let t=this._primitive;e!==t&&(this.hasPickedPrimitive=!0,l(t)&&(t.debugShowBoundingVolume=!1),this._scene.debugCommandFilter=void 0,l(this._modelMatrixPrimitive)&&(this._scene.primitives.remove(this._modelMatrixPrimitive),this._modelMatrixPrimitive=void 0),this._primitive=e,e.show=!1,setTimeout(function(){e.show=!0},50),this.showPrimitiveBoundingSphere(),this.showPrimitiveReferenceFrame(),this.doFilterPrimitive())}},tile:{get:function(){return this._tile},set:function(e){if(l(e)){this.hasPickedTile=!0;let t=this._tile;if(e!==t){this.tileText=`L: ${e.level} X: ${e.x} Y: ${e.y}`,this.tileText+=`<br>SW corner: ${e.rectangle.west}, ${e.rectangle.south}`,this.tileText+=`<br>NE corner: ${e.rectangle.east}, ${e.rectangle.north}`;let n=e.data;l(n)&&l(n.tileBoundingRegion)?this.tileText+=`<br>Min: ${n.tileBoundingRegion.minimumHeight} Max: ${n.tileBoundingRegion.maximumHeight}`:this.tileText+="<br>(Tile is not loaded)"}this._tile=e,this.showTileBoundingSphere(),this.doFilterTile()}else this.hasPickedTile=!1,this._tile=void 0}}});M8.prototype._update=function(){this.frustums&&(this.frustumStatisticText=C5t(this._scene.debugFrustumStatistics));let e=this._scene.numberOfFrustums;this._numberOfFrustums=e,this.depthFrustum=Ble(1,e,this.depthFrustum),this.depthFrustumText=`${this.depthFrustum} of ${e}`,this.performance&&this._performanceDisplay.update(),this.primitiveReferenceFrame&&(this._modelMatrixPrimitive.modelMatrix=this._primitive.modelMatrix),this.shaderCacheText=`Cached shaders: ${this._scene.context.shaderCache.numberOfShaders}`};M8.prototype.isDestroyed=function(){return!1};M8.prototype.destroy=function(){return this._eventHandler.destroy(),this._removePostRenderEvent(),this._frustumsSubscription.dispose(),this._frustumPlanesSubscription.dispose(),this._performanceSubscription.dispose(),this._primitiveBoundingSphereSubscription.dispose(),this._primitiveReferenceFrameSubscription.dispose(),this._filterPrimitiveSubscription.dispose(),this._wireframeSubscription.dispose(),this._depthFrustumSubscription.dispose(),this._suspendUpdatesSubscription.dispose(),this._tileCoordinatesSubscription.dispose(),this._tileBoundingSphereSubscription.dispose(),this._filterTileSubscription.dispose(),this._pickPrimitiveActiveSubscription.dispose(),this._pickTileActiveSubscription.dispose(),le(this)};var N8=M8;function aq(e,t){e=Ln(e);let n=document.createElement("div"),i=new N8(t,n);this._viewModel=i,this._container=e;let r=document.createElement("div");this._element=r;let o=document.createElement("div");o.textContent="Cesium Inspector",o.className="cesium-cesiumInspector-button",o.setAttribute("data-bind","click: toggleDropDown"),r.appendChild(o),r.className="cesium-cesiumInspector",r.setAttribute("data-bind",'css: { "cesium-cesiumInspector-visible" : dropDownVisible, "cesium-cesiumInspector-hidden" : !dropDownVisible }'),e.appendChild(this._element);let s=document.createElement("div");s.className="cesium-cesiumInspector-dropDown",r.appendChild(s);let a=Af.createSection,c=Af.createCheckbox,u=a(s,"General","generalVisible","toggleGeneral"),f=c("Show Frustums","frustums"),d=document.createElement("div");d.className="cesium-cesiumInspector-frustumStatistics",d.setAttribute("data-bind","visible: frustums, html: frustumStatisticText"),f.appendChild(d),u.appendChild(f),u.appendChild(c("Show Frustum Planes","frustumPlanes")),u.appendChild(c("Performance Display","performance")),n.className="cesium-cesiumInspector-performanceDisplay",u.appendChild(n);let p=document.createElement("div");p.className="cesium-cesiumInspector-shaderCache",p.setAttribute("data-bind","html: shaderCacheText"),u.appendChild(p);let g=document.createElement("div");u.appendChild(g);let m=document.createElement("span");m.setAttribute("data-bind",'html: "     Frustum:"'),g.appendChild(m);let y=document.createElement("span");y.setAttribute("data-bind","text: depthFrustumText"),g.appendChild(y);let A=document.createElement("input");A.type="button",A.value="-",A.className="cesium-cesiumInspector-pickButton",A.setAttribute("data-bind","click: decrementDepthFrustum"),g.appendChild(A);let b=document.createElement("input");b.type="button",b.value="+",b.className="cesium-cesiumInspector-pickButton",b.setAttribute("data-bind","click: incrementDepthFrustum"),g.appendChild(b);let x=a(s,"Primitives","primitivesVisible","togglePrimitives"),T=document.createElement("div");T.className="cesium-cesiumInspector-pickSection",x.appendChild(T);let E=document.createElement("input");E.type="button",E.value="Pick a primitive",E.className="cesium-cesiumInspector-pickButton",E.setAttribute("data-bind",'css: {"cesium-cesiumInspector-pickButtonHighlight" : pickPrimitiveActive}, click: pickPrimitive');let v=document.createElement("div");v.className="cesium-cesiumInspector-center",v.appendChild(E),T.appendChild(v),T.appendChild(c("Show bounding sphere","primitiveBoundingSphere","hasPickedPrimitive")),T.appendChild(c("Show reference frame","primitiveReferenceFrame","hasPickedPrimitive")),this._primitiveOnly=c("Show only selected","filterPrimitive","hasPickedPrimitive"),T.appendChild(this._primitiveOnly);let S=a(s,"Terrain","terrainVisible","toggleTerrain"),I=document.createElement("div");I.className="cesium-cesiumInspector-pickSection",S.appendChild(I);let R=document.createElement("input");R.type="button",R.value="Pick a tile",R.className="cesium-cesiumInspector-pickButton",R.setAttribute("data-bind",'css: {"cesium-cesiumInspector-pickButtonHighlight" : pickTileActive}, click: pickTile'),v=document.createElement("div"),v.appendChild(R),v.className="cesium-cesiumInspector-center",I.appendChild(v);let O=document.createElement("div");I.appendChild(O);let L=document.createElement("input");L.type="button",L.value="Parent",L.className="cesium-cesiumInspector-pickButton",L.setAttribute("data-bind","click: selectParent");let _=document.createElement("input");_.type="button",_.value="NW",_.className="cesium-cesiumInspector-pickButton",_.setAttribute("data-bind","click: selectNW");let C=document.createElement("input");C.type="button",C.value="NE",C.className="cesium-cesiumInspector-pickButton",C.setAttribute("data-bind","click: selectNE");let w=document.createElement("input");w.type="button",w.value="SW",w.className="cesium-cesiumInspector-pickButton",w.setAttribute("data-bind","click: selectSW");let P=document.createElement("input");P.type="button",P.value="SE",P.className="cesium-cesiumInspector-pickButton",P.setAttribute("data-bind","click: selectSE");let M=document.createElement("div");M.className="cesium-cesiumInspector-tileText",O.className="cesium-cesiumInspector-frustumStatistics",O.appendChild(M),O.setAttribute("data-bind","visible: hasPickedTile"),M.setAttribute("data-bind","html: tileText");let F=document.createElement("div");F.className="cesium-cesiumInspector-relativeText",F.textContent="Select relative:",O.appendChild(F);let V=document.createElement("table"),B=document.createElement("tr"),j=document.createElement("tr"),k=document.createElement("td");k.appendChild(L);let G=document.createElement("td");G.appendChild(_);let q=document.createElement("td");q.appendChild(C),B.appendChild(k),B.appendChild(G),B.appendChild(q);let Q=document.createElement("td"),W=document.createElement("td");W.appendChild(w);let J=document.createElement("td");J.appendChild(P),j.appendChild(Q),j.appendChild(W),j.appendChild(J),V.appendChild(B),V.appendChild(j),O.appendChild(V),I.appendChild(c("Show bounding volume","tileBoundingSphere","hasPickedTile")),I.appendChild(c("Show only selected","filterTile","hasPickedTile")),S.appendChild(c("Wireframe","wireframe")),S.appendChild(c("Suspend LOD update","suspendUpdates")),S.appendChild(c("Show tile coordinates","tileCoordinates")),ve.applyBindings(i,this._element)}Object.defineProperties(aq.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}}});aq.prototype.isDestroyed=function(){return!1};aq.prototype.destroy=function(){return ve.cleanNode(this._element),this._container.removeChild(this._element),this.viewModel.destroy(),le(this)};var L8=aq;function n3e(e){e=e??H.EMPTY_OBJECT;let t=e.globe,n=e.imageryProviderViewModels??H.EMPTY_ARRAY,i=e.terrainProviderViewModels??H.EMPTY_ARRAY;this._globe=t,this.imageryProviderViewModels=n.slice(0),this.terrainProviderViewModels=i.slice(0),this.dropDownVisible=!1,ve.track(this,["imageryProviderViewModels","terrainProviderViewModels","dropDownVisible"]);let r=ve.getObservable(this,"imageryProviderViewModels"),o=ve.pureComputed(function(){let d=r(),p={},g;for(g=0;g<d.length;g++){let A=d[g],b=A.category;l(p[b])?p[b].push(A):p[b]=[A]}let m=Object.keys(p),y=[];for(g=0;g<m.length;g++){let A=m[g];y.push({name:A,providers:p[A]})}return y});this._imageryProviders=o;let s=ve.getObservable(this,"terrainProviderViewModels"),a=ve.pureComputed(function(){let d=s(),p={},g;for(g=0;g<d.length;g++){let A=d[g],b=A.category;l(p[b])?p[b].push(A):p[b]=[A]}let m=Object.keys(p),y=[];for(g=0;g<m.length;g++){let A=m[g];y.push({name:A,providers:p[A]})}return y});this._terrainProviders=a,this.buttonTooltip=void 0,ve.defineProperty(this,"buttonTooltip",function(){let d=this.selectedImagery,p=this.selectedTerrain,g=l(d)?d.name:void 0,m=l(p)?p.name:void 0;return l(g)&&l(m)?`${g} +${m}`:l(g)?g:m}),this.buttonImageUrl=void 0,ve.defineProperty(this,"buttonImageUrl",function(){let d=this.selectedImagery;if(l(d))return d.iconUrl}),this.selectedImagery=void 0;let c=ve.observable();this._currentImageryLayers=[],ve.defineProperty(this,"selectedImagery",{get:function(){return c()},set:function(d){if(c()===d){this.dropDownVisible=!1;return}let p,g=this._currentImageryLayers,m=g.length,y=this._globe.imageryLayers,A=!1;for(p=0;p<m;p++){let b=y.length;for(let x=0;x<b;x++){let T=y.get(x);if(T===g[p]){y.remove(T),A=!0;break}}}if(l(d)){let b=d.creationCommand();if(Array.isArray(b)){let x=b.length;for(this._currentImageryLayers=[],p=x-1;p>=0;p--){let T=Is.fromProviderAsync(b[p]);y.add(T,0),this._currentImageryLayers.push(T)}}else{this._currentImageryLayers=[];let x=Is.fromProviderAsync(b);if(x.name=d.name,A)y.add(x,0);else{let T=y.get(0);l(T)&&y.remove(T),y.add(x,0)}this._currentImageryLayers.push(x)}}c(d),this.dropDownVisible=!1}}),this.selectedTerrain=void 0;let u=ve.observable();ve.defineProperty(this,"selectedTerrain",{get:function(){return u()},set:function(d){if(u()===d){this.dropDownVisible=!1;return}let p;if(l(d)&&(p=d.creationCommand()),l(p)&&!l(p.then))this._globe.depthTestAgainstTerrain=!(p instanceof y0),this._globe.terrainProvider=p;else if(l(p)){let g=!1,m=this._globe.terrainProviderChanged.addEventListener(()=>{g=!0,m()}),A=new p8(p).readyEvent.addEventListener(b=>{g||(this._globe.depthTestAgainstTerrain=!(b instanceof y0),this._globe.terrainProvider=b,A())})}u(d),this.dropDownVisible=!1}});let f=this;this._toggleDropDown=Rn(function(){f.dropDownVisible=!f.dropDownVisible}),this.selectedImagery=e.selectedImageryProviderViewModel??n[0],this.selectedTerrain=e.selectedTerrainProviderViewModel}Object.defineProperties(n3e.prototype,{toggleDropDown:{get:function(){return this._toggleDropDown}},globe:{get:function(){return this._globe}}});var F8=n3e;function cq(e,t){e=Ln(e);let n=new F8(t),i=document.createElement("button");i.type="button",i.className="cesium-button cesium-toolbar-button",i.setAttribute("data-bind","attr: { title: buttonTooltip },click: toggleDropDown"),e.appendChild(i);let r=document.createElement("img");r.setAttribute("draggable","false"),r.className="cesium-baseLayerPicker-selected",r.setAttribute("data-bind","attr: { src: buttonImageUrl }, visible: !!buttonImageUrl"),i.appendChild(r);let o=document.createElement("div");o.className="cesium-baseLayerPicker-dropDown",o.setAttribute("data-bind",'css: { "cesium-baseLayerPicker-dropDown-visible" : dropDownVisible }'),e.appendChild(o);let s=document.createElement("div");s.className="cesium-baseLayerPicker-sectionTitle",s.setAttribute("data-bind","visible: imageryProviderViewModels.length > 0"),s.innerHTML="Imagery",o.appendChild(s);let a=document.createElement("div");a.className="cesium-baseLayerPicker-section",a.setAttribute("data-bind","foreach: _imageryProviders"),o.appendChild(a);let c=document.createElement("div");c.className="cesium-baseLayerPicker-category",a.appendChild(c);let u=document.createElement("div");u.className="cesium-baseLayerPicker-categoryTitle",u.setAttribute("data-bind","text: name"),c.appendChild(u);let f=document.createElement("div");f.className="cesium-baseLayerPicker-choices",f.setAttribute("data-bind","foreach: providers"),c.appendChild(f);let d=document.createElement("div");d.className="cesium-baseLayerPicker-item",d.setAttribute("data-bind",'css: { "cesium-baseLayerPicker-selectedItem" : $data === $parents[1].selectedImagery },attr: { title: tooltip },visible: creationCommand.canExecute,click: function($data) { $parents[1].selectedImagery = $data; }'),f.appendChild(d);let p=document.createElement("img");p.className="cesium-baseLayerPicker-itemIcon",p.setAttribute("data-bind","attr: { src: iconUrl }"),p.setAttribute("draggable","false"),d.appendChild(p);let g=document.createElement("div");g.className="cesium-baseLayerPicker-itemLabel",g.setAttribute("data-bind","text: name"),d.appendChild(g);let m=document.createElement("div");m.className="cesium-baseLayerPicker-sectionTitle",m.setAttribute("data-bind","visible: terrainProviderViewModels.length > 0"),m.innerHTML="Terrain",o.appendChild(m);let y=document.createElement("div");y.className="cesium-baseLayerPicker-section",y.setAttribute("data-bind","foreach: _terrainProviders"),o.appendChild(y);let A=document.createElement("div");A.className="cesium-baseLayerPicker-category",y.appendChild(A);let b=document.createElement("div");b.className="cesium-baseLayerPicker-categoryTitle",b.setAttribute("data-bind","text: name"),A.appendChild(b);let x=document.createElement("div");x.className="cesium-baseLayerPicker-choices",x.setAttribute("data-bind","foreach: providers"),A.appendChild(x);let T=document.createElement("div");T.className="cesium-baseLayerPicker-item",T.setAttribute("data-bind",'css: { "cesium-baseLayerPicker-selectedItem" : $data === $parents[1].selectedTerrain },attr: { title: tooltip },visible: creationCommand.canExecute,click: function($data) { $parents[1].selectedTerrain = $data; }'),x.appendChild(T);let E=document.createElement("img");E.className="cesium-baseLayerPicker-itemIcon",E.setAttribute("data-bind","attr: { src: iconUrl }"),E.setAttribute("draggable","false"),T.appendChild(E);let v=document.createElement("div");v.className="cesium-baseLayerPicker-itemLabel",v.setAttribute("data-bind","text: name"),T.appendChild(v),ve.applyBindings(n,i),ve.applyBindings(n,o),this._viewModel=n,this._container=e,this._element=i,this._dropPanel=o,this._closeDropDown=function(S){i.contains(S.target)||o.contains(S.target)||(n.dropDownVisible=!1)},dn.supportsPointerEvents()?document.addEventListener("pointerdown",this._closeDropDown,!0):(document.addEventListener("mousedown",this._closeDropDown,!0),document.addEventListener("touchstart",this._closeDropDown,!0))}Object.defineProperties(cq.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}}});cq.prototype.isDestroyed=function(){return!1};cq.prototype.destroy=function(){return dn.supportsPointerEvents()?document.removeEventListener("pointerdown",this._closeDropDown,!0):(document.removeEventListener("mousedown",this._closeDropDown,!0),document.removeEventListener("touchstart",this._closeDropDown,!0)),ve.cleanNode(this._element),ve.cleanNode(this._dropPanel),this._container.removeChild(this._element),this._container.removeChild(this._dropPanel),le(this)};var B8=cq;function i3e(e){let t=e.creationFunction;l(t.canExecute)||(t=Rn(t)),this._creationCommand=t,this.name=e.name,this.tooltip=e.tooltip,this.iconUrl=e.iconUrl,this._category=e.category??"",ve.track(this,["name","tooltip","iconUrl"])}Object.defineProperties(i3e.prototype,{creationCommand:{get:function(){return this._creationCommand}},category:{get:function(){return this._category}}});var uo=i3e;function w5t(){let e=[],t=devicePixelRatio>=2;return e.push(new uo({name:"Bing Maps Aerial",iconUrl:Zt("Widgets/Images/ImageryProviders/bingAerial.png"),tooltip:"Bing Maps aerial imagery, provided by Cesium ion",category:"Cesium ion",creationFunction:function(){return c_({style:a_.AERIAL})}})),e.push(new uo({name:"Bing Maps Aerial with Labels",iconUrl:Zt("Widgets/Images/ImageryProviders/bingAerialLabels.png"),tooltip:"Bing Maps aerial imagery with labels, provided by Cesium ion",category:"Cesium ion",creationFunction:function(){return c_({style:a_.AERIAL_WITH_LABELS})}})),e.push(new uo({name:"Bing Maps Roads",iconUrl:Zt("Widgets/Images/ImageryProviders/bingRoads.png"),tooltip:"Bing Maps standard road maps, provided by Cesium ion",category:"Cesium ion",creationFunction:function(){return c_({style:a_.ROAD})}})),e.push(new uo({name:"ArcGIS World Imagery",iconUrl:Zt("Widgets/Images/ImageryProviders/ArcGisMapServiceWorldImagery.png"),tooltip:`ArcGIS World Imagery provides one meter or better satellite and aerial imagery in many parts of the world and lower resolution satellite imagery worldwide. The map includes 15m TerraColor imagery at small and mid-scales (~1:591M down to ~1:288k) for the world. The map features Maxar imagery at 0.3m resolution for select metropolitan areas around the world, 0.5m resolution across the United States and parts of Western Europe, and 1m resolution imagery across the rest of the world. In addition to commercial sources, the World Imagery map features high-resolution aerial photography contributed by the GIS User Community. This imagery ranges from 0.3m to 0.03m resolution (down to ~1:280 nin select communities). For more information on this map, including the terms of use, visit us online at +https://www.arcgis.com/home/item.html?id=10df2279f9684e4a9f6a7f08febac2a9`,category:"Other",creationFunction:function(){return o_.fromBasemapType(Pm.SATELLITE,{enablePickFeatures:!1})}})),e.push(new uo({name:"ArcGIS World Hillshade",iconUrl:Zt("Widgets/Images/ImageryProviders/ArcGisMapServiceWorldHillshade.png"),tooltip:`ArcGIS World Hillshade map portrays elevation as an artistic hillshade. This map is designed to be used as a backdrop for topographical, soil, hydro, landcover or other outdoor recreational maps. The map was compiled from a variety of sources from several data providers. The basemap has global coverage down to a scale of ~1:72k. In select areas of the United States and Europe, coverage is available down to ~1:9k. For more information on this map, including the terms of use, visit us online at +https://www.arcgis.com/home/item.html?id=1b243539f4514b6ba35e7d995890db1d`,category:"Other",creationFunction:function(){return o_.fromBasemapType(Pm.HILLSHADE,{enablePickFeatures:!1})}})),e.push(new uo({name:"Esri World Ocean",iconUrl:Zt("Widgets/Images/ImageryProviders/ArcGisMapServiceWorldOcean.png"),tooltip:`ArcGIS World Ocean map is designed to be used as a base map by marine GIS professionals and as a reference map by anyone interested in ocean data. The base map features marine bathymetry. Land features include inland waters and roads overlaid on land cover and shaded relief imagery. The map was compiled from a variety of best available sources from several data providers, including General Bathymetric Chart of the Oceans GEBCO_08 Grid, National Oceanic and Atmospheric Administration (NOAA), and National Geographic, Garmin, HERE, Geonames.org, and Esri, and various other contributors. The base map currently provides coverage for the world down to a scale of ~1:577k, and coverage down to 1:72k in US coastal areas, and various other areas. Coverage down to ~ 1:9k is available limited areas based on regional hydrographic survey data. The base map was designed and developed by Esri. For more information on this map, including our terms of use, visit us online at +https://www.arcgis.com/home/item.html?id=1e126e7520f9466c9ca28b8f28b5e500`,category:"Other",creationFunction:function(){return o_.fromBasemapType(Pm.OCEANS,{enablePickFeatures:!1})}})),e.push(new uo({name:"Open\xADStreet\xADMap",iconUrl:Zt("Widgets/Images/ImageryProviders/openStreetMap.png"),tooltip:`OpenStreetMap (OSM) is a collaborative project to create a free editable map of the world. http://www.openstreetmap.org`,category:"Other",creationFunction:function(){return new xy({url:"https://tile.openstreetmap.org/"})}})),e.push(new uo({name:"Stadia x Stamen Watercolor",iconUrl:Zt("Widgets/Images/ImageryProviders/stamenWatercolor.png"),tooltip:`Based on the original basemaps created for the Knight Foundation and reminiscent of hand drawn maps, the watercolor maps from Stamen Design apply raster effect area washes and organic edges over a paper texture to add warm pop to any map. https://docs.stadiamaps.com/map-styles/stamen-watercolor/`,category:"Other",creationFunction:function(){return new xy({url:"https://tiles.stadiamaps.com/tiles/stamen_watercolor/",fileExtension:"jpg",credit:`© <a href="https://stamen.com/" target="_blank">Stamen Design</a> © <a href="https://www.stadiamaps.com/" target="_blank">Stadia Maps</a> @@ -12763,15 +12770,8 @@ https://docs.stadiamaps.com/map-styles/alidade-smooth/`,category:"Other",creatio © <a href="https://www.openstreetmap.org/about/" target="_blank">OpenStreetMap contributors</a>`})}})),e.push(new uo({name:"Stadia Alidade Smooth Dark",iconUrl:Zt("Widgets/Images/ImageryProviders/stadiaAlidadeSmoothDark.png"),tooltip:`Stadia Alidade Smooth Dark, like its lighter cousin, is also designed to stay out of the way. It just flips the dark mode switch on the color scheme. With the lights out, your data can now literally shine. https://docs.stadiamaps.com/map-styles/alidade-smooth-dark/`,category:"Other",creationFunction:function(){return new xy({url:"https://tiles.stadiamaps.com/tiles/alidade_smooth_dark/",retinaTiles:t,credit:`© <a href="https://www.stadiamaps.com/" target="_blank">Stadia Maps</a> © <a href="https://openmaptiles.org/" target="_blank">OpenMapTiles</a> - © <a href="https://www.openstreetmap.org/about/" target="_blank">OpenStreetMap contributors</a>`})}})),e.push(new uo({name:"Sentinel-2",iconUrl:Zt("Widgets/Images/ImageryProviders/sentinel-2.png"),tooltip:"Sentinel-2 cloudless by EOX IT Services GmbH (Contains modified Copernicus Sentinel data 2016 and 2017).",category:"Cesium ion",creationFunction:function(){return ou.fromAssetId(3954)}})),e.push(new uo({name:"Blue Marble",iconUrl:Zt("Widgets/Images/ImageryProviders/blueMarble.png"),tooltip:"Blue Marble Next Generation July, 2004 imagery from NASA.",category:"Cesium ion",creationFunction:function(){return ou.fromAssetId(3845)}})),e.push(new uo({name:"Earth at night",iconUrl:Zt("Widgets/Images/ImageryProviders/earthAtNight.png"),tooltip:"The Earth at night, also known as The Black Marble, is a 500 meter resolution global composite imagery layer released by NASA.",category:"Cesium ion",creationFunction:function(){return ou.fromAssetId(3812)}})),e.push(new uo({name:"Natural Earth\xA0II",iconUrl:Zt("Widgets/Images/ImageryProviders/naturalEarthII.png"),tooltip:`Natural Earth II, darkened for contrast. -http://www.naturalearthdata.com/`,category:"Cesium ion",creationFunction:function(){return wA.fromUrl(Zt("Assets/Textures/NaturalEarthII"))}})),e.push(new uo({name:"Google Maps Satellite",iconUrl:Zt("Widgets/Images/ImageryProviders/googleSatellite.png"),tooltip:"Imagery from Google Maps",category:"Cesium ion",creationFunction:function(){return ou.fromAssetId(3830182)}})),e.push(new uo({name:"Google Maps Satellite with Labels",iconUrl:Zt("Widgets/Images/ImageryProviders/googleSatelliteLabels.png"),tooltip:"Imagery with place labels from Google Maps",category:"Cesium ion",creationFunction:function(){return ou.fromAssetId(3830183)}})),e.push(new uo({name:"Google Maps Roadmap",iconUrl:Zt("Widgets/Images/ImageryProviders/googleRoadmap.png"),tooltip:"Labeled roads and other features on a base landscape from Google Maps",category:"Cesium ion",creationFunction:function(){return ou.fromAssetId(3830184)}})),e.push(new uo({name:"Google Maps Contour",iconUrl:Zt("Widgets/Images/ImageryProviders/googleContour.png"),tooltip:"Hillshade mapping, contour lines, natural features (roadmap features hidden) from Google Maps",category:"Cesium ion",creationFunction:function(){return ou.fromAssetId(3830186)}})),e.push(new uo({name:"Azure Maps Aerial",iconUrl:Zt("Widgets/Images/ImageryProviders/azureAerial.png"),tooltip:"Imagery from Azure Maps",category:"Cesium ion",creationFunction:function(){return ou.fromAssetId(3891168)}})),e.push(new uo({name:"Azure Maps Roads",iconUrl:Zt("Widgets/Images/ImageryProviders/azureRoads.png"),tooltip:"Labeled roads and other features on a base landscape from Azure Maps",category:"Cesium ion",creationFunction:function(){return ou.fromAssetId(3891169)}})),e}var R8=A5t;function b5t(){let e=[];return e.push(new uo({name:"WGS84 Ellipsoid",iconUrl:Zt("Widgets/Images/TerrainProviders/Ellipsoid.png"),tooltip:"WGS84 standard ellipsoid, also known as EPSG:4326",category:"Cesium ion",creationFunction:function(){return new O0({ellipsoid:ee.WGS84})}})),e.push(new uo({name:"Cesium World Terrain",iconUrl:Zt("Widgets/Images/TerrainProviders/CesiumWorldTerrain.png"),tooltip:"High-resolution global terrain tileset curated from several datasources and hosted by Cesium ion",category:"Cesium ion",creationFunction:function(){return UC({requestWaterMask:!0,requestVertexNormals:!0})}})),e}var O8=b5t;function x5t(e){let t;if(l(e)){t="Command Statistics";let n=e.commandsInFrustums;for(let i in n)if(n.hasOwnProperty(i)){let r=parseInt(i,10),o;if(r===7)o="1, 2 and 3";else{let s=[];for(let a=2;a>=0;a--){let c=Math.pow(2,a);r>=c&&(s.push(a+1),r-=c)}o=s.reverse().join(" and ")}t+=`<br>    ${n[i]} in frustum ${o}`}t+=`<br>Total: ${e.totalCommands}`}return t}function Fle(e,t,n){let i=Math.min(n,t);return i=Math.max(i,e),i}var T5t=new pn,E5t=new h;function M8(e,t){let n=this,i=e.canvas,r=new ca(i);this._eventHandler=r,this._scene=e,this._canvas=i,this._primitive=void 0,this._tile=void 0,this._modelMatrixPrimitive=void 0,this._performanceDisplay=void 0,this._performanceContainer=t;let o=this._scene.globe;o.depthTestAgainstTerrain=!0,this.frustums=!1,this.frustumPlanes=!1,this.performance=!1,this.shaderCacheText="",this.primitiveBoundingSphere=!1,this.primitiveReferenceFrame=!1,this.filterPrimitive=!1,this.tileBoundingSphere=!1,this.filterTile=!1,this.wireframe=!1,this.depthFrustum=1,this._numberOfFrustums=1,this.suspendUpdates=!1,this.tileCoordinates=!1,this.frustumStatisticText=!1,this.tileText="",this.hasPickedPrimitive=!1,this.hasPickedTile=!1,this.pickPrimitiveActive=!1,this.pickTileActive=!1,this.dropDownVisible=!0,this.generalVisible=!0,this.primitivesVisible=!1,this.terrainVisible=!1,this.depthFrustumText="",ve.track(this,["frustums","frustumPlanes","performance","shaderCacheText","primitiveBoundingSphere","primitiveReferenceFrame","filterPrimitive","tileBoundingSphere","filterTile","wireframe","depthFrustum","suspendUpdates","tileCoordinates","frustumStatisticText","tileText","hasPickedPrimitive","hasPickedTile","pickPrimitiveActive","pickTileActive","dropDownVisible","generalVisible","primitivesVisible","terrainVisible","depthFrustumText"]),this._toggleDropDown=Rn(function(){n.dropDownVisible=!n.dropDownVisible}),this._toggleGeneral=Rn(function(){n.generalVisible=!n.generalVisible}),this._togglePrimitives=Rn(function(){n.primitivesVisible=!n.primitivesVisible}),this._toggleTerrain=Rn(function(){n.terrainVisible=!n.terrainVisible}),this._frustumsSubscription=ve.getObservable(this,"frustums").subscribe(function(u){n._scene.debugShowFrustums=u,n._scene.requestRender()}),this._frustumPlanesSubscription=ve.getObservable(this,"frustumPlanes").subscribe(function(u){n._scene.debugShowFrustumPlanes=u,n._scene.requestRender()}),this._performanceSubscription=ve.getObservable(this,"performance").subscribe(function(u){u?n._performanceDisplay=new ny({container:n._performanceContainer}):n._performanceContainer.innerHTML=""}),this._showPrimitiveBoundingSphere=Rn(function(){return n._primitive.debugShowBoundingVolume=n.primitiveBoundingSphere,n._scene.requestRender(),!0}),this._primitiveBoundingSphereSubscription=ve.getObservable(this,"primitiveBoundingSphere").subscribe(function(){n._showPrimitiveBoundingSphere()}),this._showPrimitiveReferenceFrame=Rn(function(){if(n.primitiveReferenceFrame){let u=n._primitive.modelMatrix;n._modelMatrixPrimitive=new $4({modelMatrix:u}),n._scene.primitives.add(n._modelMatrixPrimitive)}else l(n._modelMatrixPrimitive)&&(n._scene.primitives.remove(n._modelMatrixPrimitive),n._modelMatrixPrimitive=void 0);return n._scene.requestRender(),!0}),this._primitiveReferenceFrameSubscription=ve.getObservable(this,"primitiveReferenceFrame").subscribe(function(){n._showPrimitiveReferenceFrame()}),this._doFilterPrimitive=Rn(function(){return n.filterPrimitive?n._scene.debugCommandFilter=function(u){return l(n._modelMatrixPrimitive)&&u.owner===n._modelMatrixPrimitive._primitive?!0:l(n._primitive)?u.owner===n._primitive||u.owner===n._primitive._billboardCollection||u.owner.primitive===n._primitive:!1}:n._scene.debugCommandFilter=void 0,!0}),this._filterPrimitiveSubscription=ve.getObservable(this,"filterPrimitive").subscribe(function(){n._doFilterPrimitive(),n._scene.requestRender()}),this._wireframeSubscription=ve.getObservable(this,"wireframe").subscribe(function(u){o._surface.tileProvider._debug.wireframe=u,n._scene.requestRender()}),this._depthFrustumSubscription=ve.getObservable(this,"depthFrustum").subscribe(function(u){n._scene.debugShowDepthFrustum=u,n._scene.requestRender()}),this._incrementDepthFrustum=Rn(function(){let u=n.depthFrustum+1;return n.depthFrustum=Fle(1,n._numberOfFrustums,u),n._scene.requestRender(),!0}),this._decrementDepthFrustum=Rn(function(){let u=n.depthFrustum-1;return n.depthFrustum=Fle(1,n._numberOfFrustums,u),n._scene.requestRender(),!0}),this._suspendUpdatesSubscription=ve.getObservable(this,"suspendUpdates").subscribe(function(u){o._surface._debug.suspendLodUpdate=u,u||(n.filterTile=!1)});let s;this._showTileCoordinates=Rn(function(){return n.tileCoordinates&&!l(s)?s=e.imageryLayers.addImageryProvider(new _8({tilingScheme:e.terrainProvider.tilingScheme})):!n.tileCoordinates&&l(s)&&(e.imageryLayers.remove(s),s=void 0),!0}),this._tileCoordinatesSubscription=ve.getObservable(this,"tileCoordinates").subscribe(function(){n._showTileCoordinates(),n._scene.requestRender()}),this._tileBoundingSphereSubscription=ve.getObservable(this,"tileBoundingSphere").subscribe(function(){n._showTileBoundingSphere(),n._scene.requestRender()}),this._showTileBoundingSphere=Rn(function(){return n.tileBoundingSphere?o._surface.tileProvider._debug.boundingSphereTile=n._tile:o._surface.tileProvider._debug.boundingSphereTile=void 0,n._scene.requestRender(),!0}),this._doFilterTile=Rn(function(){return n.filterTile?(n.suspendUpdates=!0,o._surface._tilesToRender=[],l(n._tile)&&n._tile.renderable&&o._surface._tilesToRender.push(n._tile)):n.suspendUpdates=!1,!0}),this._filterTileSubscription=ve.getObservable(this,"filterTile").subscribe(function(){n.doFilterTile(),n._scene.requestRender()});function a(u){let f=n._scene.pick({x:u.position.x,y:u.position.y});l(f)&&(n.primitive=l(f.collection)?f.collection:f.primitive),n._scene.requestRender(),n.pickPrimitiveActive=!1}this._pickPrimitive=Rn(function(){n.pickPrimitiveActive=!n.pickPrimitiveActive}),this._pickPrimitiveActiveSubscription=ve.getObservable(this,"pickPrimitiveActive").subscribe(function(u){u?r.setInputAction(a,un.LEFT_CLICK):r.removeInputAction(un.LEFT_CLICK)});function c(u){let f,d=o.ellipsoid,p=n._scene.camera.getPickRay(u.position,T5t),g=o.pick(p,n._scene,E5t);if(l(g)){let m=d.cartesianToCartographic(g),y=o._surface.tileProvider._tilesToRenderByTextureCount;for(let A=0;!f&&A<y.length;++A){let b=y[A];if(l(b))for(let x=0;!f&&x<b.length;++x){let T=b[x];ie.contains(T.rectangle,m)&&(f=T)}}}n.tile=f,n.pickTileActive=!1}this._pickTile=Rn(function(){n.pickTileActive=!n.pickTileActive}),this._pickTileActiveSubscription=ve.getObservable(this,"pickTileActive").subscribe(function(u){u?r.setInputAction(c,un.LEFT_CLICK):r.removeInputAction(un.LEFT_CLICK)}),this._removePostRenderEvent=e.postRender.addEventListener(function(){n._update()})}Object.defineProperties(M8.prototype,{scene:{get:function(){return this._scene}},performanceContainer:{get:function(){return this._performanceContainer}},toggleDropDown:{get:function(){return this._toggleDropDown}},showPrimitiveBoundingSphere:{get:function(){return this._showPrimitiveBoundingSphere}},showPrimitiveReferenceFrame:{get:function(){return this._showPrimitiveReferenceFrame}},doFilterPrimitive:{get:function(){return this._doFilterPrimitive}},incrementDepthFrustum:{get:function(){return this._incrementDepthFrustum}},decrementDepthFrustum:{get:function(){return this._decrementDepthFrustum}},showTileCoordinates:{get:function(){return this._showTileCoordinates}},showTileBoundingSphere:{get:function(){return this._showTileBoundingSphere}},doFilterTile:{get:function(){return this._doFilterTile}},toggleGeneral:{get:function(){return this._toggleGeneral}},togglePrimitives:{get:function(){return this._togglePrimitives}},toggleTerrain:{get:function(){return this._toggleTerrain}},pickPrimitive:{get:function(){return this._pickPrimitive}},pickTile:{get:function(){return this._pickTile}},selectParent:{get:function(){let e=this;return Rn(function(){e.tile=e.tile.parent})}},selectNW:{get:function(){let e=this;return Rn(function(){e.tile=e.tile.northwestChild})}},selectNE:{get:function(){let e=this;return Rn(function(){e.tile=e.tile.northeastChild})}},selectSW:{get:function(){let e=this;return Rn(function(){e.tile=e.tile.southwestChild})}},selectSE:{get:function(){let e=this;return Rn(function(){e.tile=e.tile.southeastChild})}},primitive:{get:function(){return this._primitive},set:function(e){let t=this._primitive;e!==t&&(this.hasPickedPrimitive=!0,l(t)&&(t.debugShowBoundingVolume=!1),this._scene.debugCommandFilter=void 0,l(this._modelMatrixPrimitive)&&(this._scene.primitives.remove(this._modelMatrixPrimitive),this._modelMatrixPrimitive=void 0),this._primitive=e,e.show=!1,setTimeout(function(){e.show=!0},50),this.showPrimitiveBoundingSphere(),this.showPrimitiveReferenceFrame(),this.doFilterPrimitive())}},tile:{get:function(){return this._tile},set:function(e){if(l(e)){this.hasPickedTile=!0;let t=this._tile;if(e!==t){this.tileText=`L: ${e.level} X: ${e.x} Y: ${e.y}`,this.tileText+=`<br>SW corner: ${e.rectangle.west}, ${e.rectangle.south}`,this.tileText+=`<br>NE corner: ${e.rectangle.east}, ${e.rectangle.north}`;let n=e.data;l(n)&&l(n.tileBoundingRegion)?this.tileText+=`<br>Min: ${n.tileBoundingRegion.minimumHeight} Max: ${n.tileBoundingRegion.maximumHeight}`:this.tileText+="<br>(Tile is not loaded)"}this._tile=e,this.showTileBoundingSphere(),this.doFilterTile()}else this.hasPickedTile=!1,this._tile=void 0}}});M8.prototype._update=function(){this.frustums&&(this.frustumStatisticText=x5t(this._scene.debugFrustumStatistics));let e=this._scene.numberOfFrustums;this._numberOfFrustums=e,this.depthFrustum=Fle(1,e,this.depthFrustum),this.depthFrustumText=`${this.depthFrustum} of ${e}`,this.performance&&this._performanceDisplay.update(),this.primitiveReferenceFrame&&(this._modelMatrixPrimitive.modelMatrix=this._primitive.modelMatrix),this.shaderCacheText=`Cached shaders: ${this._scene.context.shaderCache.numberOfShaders}`};M8.prototype.isDestroyed=function(){return!1};M8.prototype.destroy=function(){return this._eventHandler.destroy(),this._removePostRenderEvent(),this._frustumsSubscription.dispose(),this._frustumPlanesSubscription.dispose(),this._performanceSubscription.dispose(),this._primitiveBoundingSphereSubscription.dispose(),this._primitiveReferenceFrameSubscription.dispose(),this._filterPrimitiveSubscription.dispose(),this._wireframeSubscription.dispose(),this._depthFrustumSubscription.dispose(),this._suspendUpdatesSubscription.dispose(),this._tileCoordinatesSubscription.dispose(),this._tileBoundingSphereSubscription.dispose(),this._filterTileSubscription.dispose(),this._pickPrimitiveActiveSubscription.dispose(),this._pickTileActiveSubscription.dispose(),le(this)};var N8=M8;function sq(e,t){e=Ln(e);let n=document.createElement("div"),i=new N8(t,n);this._viewModel=i,this._container=e;let r=document.createElement("div");this._element=r;let o=document.createElement("div");o.textContent="Cesium Inspector",o.className="cesium-cesiumInspector-button",o.setAttribute("data-bind","click: toggleDropDown"),r.appendChild(o),r.className="cesium-cesiumInspector",r.setAttribute("data-bind",'css: { "cesium-cesiumInspector-visible" : dropDownVisible, "cesium-cesiumInspector-hidden" : !dropDownVisible }'),e.appendChild(this._element);let s=document.createElement("div");s.className="cesium-cesiumInspector-dropDown",r.appendChild(s);let a=Af.createSection,c=Af.createCheckbox,u=a(s,"General","generalVisible","toggleGeneral"),f=c("Show Frustums","frustums"),d=document.createElement("div");d.className="cesium-cesiumInspector-frustumStatistics",d.setAttribute("data-bind","visible: frustums, html: frustumStatisticText"),f.appendChild(d),u.appendChild(f),u.appendChild(c("Show Frustum Planes","frustumPlanes")),u.appendChild(c("Performance Display","performance")),n.className="cesium-cesiumInspector-performanceDisplay",u.appendChild(n);let p=document.createElement("div");p.className="cesium-cesiumInspector-shaderCache",p.setAttribute("data-bind","html: shaderCacheText"),u.appendChild(p);let g=document.createElement("div");u.appendChild(g);let m=document.createElement("span");m.setAttribute("data-bind",'html: "     Frustum:"'),g.appendChild(m);let y=document.createElement("span");y.setAttribute("data-bind","text: depthFrustumText"),g.appendChild(y);let A=document.createElement("input");A.type="button",A.value="-",A.className="cesium-cesiumInspector-pickButton",A.setAttribute("data-bind","click: decrementDepthFrustum"),g.appendChild(A);let b=document.createElement("input");b.type="button",b.value="+",b.className="cesium-cesiumInspector-pickButton",b.setAttribute("data-bind","click: incrementDepthFrustum"),g.appendChild(b);let x=a(s,"Primitives","primitivesVisible","togglePrimitives"),T=document.createElement("div");T.className="cesium-cesiumInspector-pickSection",x.appendChild(T);let E=document.createElement("input");E.type="button",E.value="Pick a primitive",E.className="cesium-cesiumInspector-pickButton",E.setAttribute("data-bind",'css: {"cesium-cesiumInspector-pickButtonHighlight" : pickPrimitiveActive}, click: pickPrimitive');let v=document.createElement("div");v.className="cesium-cesiumInspector-center",v.appendChild(E),T.appendChild(v),T.appendChild(c("Show bounding sphere","primitiveBoundingSphere","hasPickedPrimitive")),T.appendChild(c("Show reference frame","primitiveReferenceFrame","hasPickedPrimitive")),this._primitiveOnly=c("Show only selected","filterPrimitive","hasPickedPrimitive"),T.appendChild(this._primitiveOnly);let S=a(s,"Terrain","terrainVisible","toggleTerrain"),I=document.createElement("div");I.className="cesium-cesiumInspector-pickSection",S.appendChild(I);let R=document.createElement("input");R.type="button",R.value="Pick a tile",R.className="cesium-cesiumInspector-pickButton",R.setAttribute("data-bind",'css: {"cesium-cesiumInspector-pickButtonHighlight" : pickTileActive}, click: pickTile'),v=document.createElement("div"),v.appendChild(R),v.className="cesium-cesiumInspector-center",I.appendChild(v);let O=document.createElement("div");I.appendChild(O);let L=document.createElement("input");L.type="button",L.value="Parent",L.className="cesium-cesiumInspector-pickButton",L.setAttribute("data-bind","click: selectParent");let _=document.createElement("input");_.type="button",_.value="NW",_.className="cesium-cesiumInspector-pickButton",_.setAttribute("data-bind","click: selectNW");let C=document.createElement("input");C.type="button",C.value="NE",C.className="cesium-cesiumInspector-pickButton",C.setAttribute("data-bind","click: selectNE");let w=document.createElement("input");w.type="button",w.value="SW",w.className="cesium-cesiumInspector-pickButton",w.setAttribute("data-bind","click: selectSW");let P=document.createElement("input");P.type="button",P.value="SE",P.className="cesium-cesiumInspector-pickButton",P.setAttribute("data-bind","click: selectSE");let M=document.createElement("div");M.className="cesium-cesiumInspector-tileText",O.className="cesium-cesiumInspector-frustumStatistics",O.appendChild(M),O.setAttribute("data-bind","visible: hasPickedTile"),M.setAttribute("data-bind","html: tileText");let F=document.createElement("div");F.className="cesium-cesiumInspector-relativeText",F.textContent="Select relative:",O.appendChild(F);let V=document.createElement("table"),B=document.createElement("tr"),j=document.createElement("tr"),k=document.createElement("td");k.appendChild(L);let G=document.createElement("td");G.appendChild(_);let q=document.createElement("td");q.appendChild(C),B.appendChild(k),B.appendChild(G),B.appendChild(q);let Q=document.createElement("td"),W=document.createElement("td");W.appendChild(w);let J=document.createElement("td");J.appendChild(P),j.appendChild(Q),j.appendChild(W),j.appendChild(J),V.appendChild(B),V.appendChild(j),O.appendChild(V),I.appendChild(c("Show bounding volume","tileBoundingSphere","hasPickedTile")),I.appendChild(c("Show only selected","filterTile","hasPickedTile")),S.appendChild(c("Wireframe","wireframe")),S.appendChild(c("Suspend LOD update","suspendUpdates")),S.appendChild(c("Show tile coordinates","tileCoordinates")),ve.applyBindings(i,this._element)}Object.defineProperties(sq.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}}});sq.prototype.isDestroyed=function(){return!1};sq.prototype.destroy=function(){return ve.cleanNode(this._element),this._container.removeChild(this._element),this.viewModel.destroy(),le(this)};var L8=sq;function aq(e,t){l(t)||(t=document.body),t=Ln(t);let n=this,i=ve.observable(es.fullscreen),r=ve.observable(es.enabled),o=t.ownerDocument;this.isFullscreen=void 0,ve.defineProperty(this,"isFullscreen",{get:function(){return i()}}),this.isFullscreenEnabled=void 0,ve.defineProperty(this,"isFullscreenEnabled",{get:function(){return r()},set:function(s){r(s&&es.enabled)}}),this.tooltip=void 0,ve.defineProperty(this,"tooltip",function(){return this.isFullscreenEnabled?i()?"Exit full screen":"Full screen":"Full screen unavailable"}),this._command=Rn(function(){es.fullscreen?es.exitFullscreen():es.requestFullscreen(n._fullscreenElement)},ve.getObservable(this,"isFullscreenEnabled")),this._fullscreenElement=Ln(e)??o.body,this._callback=function(){i(es.fullscreen)},o.addEventListener(es.changeEventName,this._callback)}Object.defineProperties(aq.prototype,{fullscreenElement:{get:function(){return this._fullscreenElement},set:function(e){this._fullscreenElement=e}},command:{get:function(){return this._command}}});aq.prototype.isDestroyed=function(){return!1};aq.prototype.destroy=function(){document.removeEventListener(es.changeEventName,this._callback),le(this)};var F8=aq;var C5t="M 83.96875 17.5625 L 83.96875 17.59375 L 76.65625 24.875 L 97.09375 24.96875 L 76.09375 45.96875 L 81.9375 51.8125 L 102.78125 30.9375 L 102.875 51.15625 L 110.15625 43.875 L 110.1875 17.59375 L 83.96875 17.5625 z M 44.125 17.59375 L 17.90625 17.625 L 17.9375 43.90625 L 25.21875 51.1875 L 25.3125 30.96875 L 46.15625 51.8125 L 52 45.96875 L 31 25 L 51.4375 24.90625 L 44.125 17.59375 z M 46.0625 76.03125 L 25.1875 96.875 L 25.09375 76.65625 L 17.8125 83.9375 L 17.8125 110.21875 L 44 110.25 L 51.3125 102.9375 L 30.90625 102.84375 L 51.875 81.875 L 46.0625 76.03125 z M 82 76.15625 L 76.15625 82 L 97.15625 103 L 76.71875 103.0625 L 84.03125 110.375 L 110.25 110.34375 L 110.21875 84.0625 L 102.9375 76.8125 L 102.84375 97 L 82 76.15625 z",v5t="M 104.34375 17.5625 L 83.5 38.4375 L 83.40625 18.21875 L 76.125 25.5 L 76.09375 51.78125 L 102.3125 51.8125 L 102.3125 51.78125 L 109.625 44.5 L 89.1875 44.40625 L 110.1875 23.40625 L 104.34375 17.5625 z M 23.75 17.59375 L 17.90625 23.4375 L 38.90625 44.4375 L 18.5 44.53125 L 25.78125 51.8125 L 52 51.78125 L 51.96875 25.53125 L 44.6875 18.25 L 44.625 38.46875 L 23.75 17.59375 z M 25.6875 76.03125 L 18.375 83.3125 L 38.78125 83.40625 L 17.8125 104.40625 L 23.625 110.25 L 44.5 89.375 L 44.59375 109.59375 L 51.875 102.3125 L 51.875 76.0625 L 25.6875 76.03125 z M 102.375 76.15625 L 76.15625 76.1875 L 76.1875 102.4375 L 83.46875 109.71875 L 83.5625 89.53125 L 104.40625 110.375 L 110.25 104.53125 L 89.25 83.53125 L 109.6875 83.46875 L 102.375 76.15625 z";function cq(e,t){e=Ln(e);let n=new F8(t,e);n._exitFullScreenPath=v5t,n._enterFullScreenPath=C5t;let i=document.createElement("button");i.type="button",i.className="cesium-button cesium-fullscreenButton",i.setAttribute("data-bind","attr: { title: tooltip },click: command,enable: isFullscreenEnabled,cesiumSvgPath: { path: isFullscreen ? _exitFullScreenPath : _enterFullScreenPath, width: 128, height: 128 }"),e.appendChild(i),ve.applyBindings(n,i),this._container=e,this._viewModel=n,this._element=i}Object.defineProperties(cq.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}}});cq.prototype.isDestroyed=function(){return!1};cq.prototype.destroy=function(){return this._viewModel.destroy(),ve.cleanNode(this._element),this._container.removeChild(this._element),le(this)};var B8=cq;function e3e(e,t){this._scene=e,this._duration=t;let n=this;this._command=Rn(function(){n._scene.camera.flyHome(n._duration)}),this.tooltip="View Home",ve.track(this,["tooltip"])}Object.defineProperties(e3e.prototype,{scene:{get:function(){return this._scene}},command:{get:function(){return this._command}},duration:{get:function(){return this._duration},set:function(e){this._duration=e}}});var k8=e3e;function lq(e,t,n){e=Ln(e);let i=new k8(t,n);i._svgPath="M14,4l-10,8.75h20l-4.25-3.7188v-4.6562h-2.812v2.1875l-2.938-2.5625zm-7.0938,9.906v10.094h14.094v-10.094h-14.094zm2.1876,2.313h3.3122v4.25h-3.3122v-4.25zm5.8442,1.281h3.406v6.438h-3.406v-6.438z";let r=document.createElement("button");r.type="button",r.className="cesium-button cesium-toolbar-button cesium-home-button",r.setAttribute("data-bind","attr: { title: tooltip },click: command,cesiumSvgPath: { path: _svgPath, width: 28, height: 28 }"),e.appendChild(r),ve.applyBindings(i,r),this._container=e,this._viewModel=i,this._element=r}Object.defineProperties(lq.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}}});lq.prototype.isDestroyed=function(){return!1};lq.prototype.destroy=function(){return ve.cleanNode(this._element),this._container.removeChild(this._element),le(this)};var U8=lq;function S5t(e){return function(t){let n=e._scene.pick(t.position);l(n)&&n.primitive instanceof Yo&&(e.tileset=n.primitive),e.pickActive=!1}}function n3e(e,t){t?e._eventHandler.setInputAction(function(n){let i=e._scene.pick(n.endPosition);l(i)&&i.primitive instanceof Yo&&(e.tileset=i.primitive)},un.MOUSE_MOVE):(e._eventHandler.removeInputAction(un.MOUSE_MOVE),e.picking=e.picking)}var w5t={maximumFractionDigits:3};function z8(e){let t=e/1048576;return t<1?t.toLocaleString(void 0,w5t):Math.round(t).toLocaleString()}function V8(e,t){if(!l(e))return"";let n=t?e._statisticsPerPass[ao.PICK]:e._statisticsPerPass[ao.RENDER],i='<ul class="cesium-cesiumInspector-statistics">';return i+=`<li><strong>Visited: </strong>${n.visited.toLocaleString()}</li><li><strong>Selected: </strong>${n.selected.toLocaleString()}</li><li><strong>Commands: </strong>${n.numberOfCommands.toLocaleString()}</li>`,i+="</ul>",t||(i+='<ul class="cesium-cesiumInspector-statistics">',i+=`<li><strong>Requests: </strong>${n.numberOfPendingRequests.toLocaleString()}</li><li><strong>Attempted: </strong>${n.numberOfAttemptedRequests.toLocaleString()}</li><li><strong>Processing: </strong>${n.numberOfTilesProcessing.toLocaleString()}</li><li><strong>Content Ready: </strong>${n.numberOfTilesWithContentReady.toLocaleString()}</li><li><strong>Total: </strong>${n.numberOfTilesTotal.toLocaleString()}</li>`,i+="</ul>",i+='<ul class="cesium-cesiumInspector-statistics">',i+=`<li><strong>Features Selected: </strong>${n.numberOfFeaturesSelected.toLocaleString()}</li><li><strong>Features Loaded: </strong>${n.numberOfFeaturesLoaded.toLocaleString()}</li><li><strong>Points Selected: </strong>${n.numberOfPointsSelected.toLocaleString()}</li><li><strong>Points Loaded: </strong>${n.numberOfPointsLoaded.toLocaleString()}</li><li><strong>Triangles Selected: </strong>${n.numberOfTrianglesSelected.toLocaleString()}</li>`,i+="</ul>",i+='<ul class="cesium-cesiumInspector-statistics">',i+=`<li><strong>Tiles styled: </strong>${n.numberOfTilesStyled.toLocaleString()}</li><li><strong>Features styled: </strong>${n.numberOfFeaturesStyled.toLocaleString()}</li>`,i+="</ul>",i+='<ul class="cesium-cesiumInspector-statistics">',i+=`<li><strong>Children Union Culled: </strong>${n.numberOfTilesCulledWithChildrenUnion.toLocaleString()}</li>`,i+="</ul>",i+='<ul class="cesium-cesiumInspector-statistics">',i+=`<li><strong>Geometry Memory (MB): </strong>${z8(n.geometryByteLength)}</li><li><strong>Texture Memory (MB): </strong>${z8(n.texturesByteLength)}</li><li><strong>Batch Table Memory (MB): </strong>${z8(n.batchTableByteLength)}</li>`,i+="</ul>"),i}function i3e(){let e=Li.statistics;return` - <ul class="cesium-cesiumInspector-statistics"> - <li><strong>Geometry Memory (MB): </strong>${z8(e.geometryByteLength)}</li> - <li><strong>Texture Memory (MB): </strong>${z8(e.texturesByteLength)}</li> - </ul> - `}var I5t=[{text:"Highlight",value:zu.HIGHLIGHT},{text:"Replace",value:zu.REPLACE},{text:"Mix",value:zu.MIX}],t3e=new z(1,1,0,.4),P5t=new z,uq=new z;function vc(e,t){let n=this,i=e.canvas;this._eventHandler=new ca(i),this._scene=e,this._performanceContainer=t,this._canvas=i,this._performanceDisplay=new ny({container:t}),this._statisticsText="",this._pickStatisticsText="",this._resourceCacheStatisticsText="",this._editorError="",this.performance=!1,this.showStatistics=!0,this.showPickStatistics=!0,this.showResourceCacheStatistics=!1,this.inspectorVisible=!0,this.tilesetVisible=!1,this.displayVisible=!1,this.updateVisible=!1,this.loggingVisible=!1,this.styleVisible=!1,this.tileDebugLabelsVisible=!1,this.optimizationVisible=!1,this.styleString="{}",this.hasEnabledWireframe=!1,this._tileset=void 0,this._feature=void 0,this._tile=void 0,ve.track(this,["performance","inspectorVisible","_statisticsText","_pickStatisticsText","_resourceCacheStatisticsText","_editorError","showPickStatistics","showStatistics","showResourceCacheStatistics","tilesetVisible","displayVisible","updateVisible","loggingVisible","styleVisible","optimizationVisible","tileDebugLabelsVisible","styleString","_feature","_tile","_tileset","hasEnabledWireframe"]),this._properties=ve.observable({}),this.properties=[],ve.defineProperty(this,"properties",function(){let k=[],G=n._properties();for(let q in G)G.hasOwnProperty(q)&&k.push(q);return k});let r=ve.observable();ve.defineProperty(this,"dynamicScreenSpaceError",{get:function(){return r()},set:function(k){r(k),l(n._tileset)&&(n._tileset.dynamicScreenSpaceError=k)}}),this.dynamicScreenSpaceError=!1;let o=ve.observable();ve.defineProperty(this,"colorBlendMode",{get:function(){return o()},set:function(k){o(k),l(n._tileset)&&(n._tileset.colorBlendMode=k,n._scene.requestRender())}}),this.colorBlendMode=zu.HIGHLIGHT;let s=ve.observable(),a=ve.observable();ve.defineProperty(this,"picking",{get:function(){return a()},set:function(k){a(k),k?n._eventHandler.setInputAction(function(G){let q=e.pick(G.endPosition);if(q instanceof na?(n.feature=q,n.tile=q.content.tile):l(q)&&l(q.content)?(n.feature=void 0,n.tile=q.content.tile):(n.feature=void 0,n.tile=void 0),!!l(n._tileset)){if(s&&l(q)&&l(q.content)){let Q;e.pickPositionSupported&&(Q=e.pickPosition(G.endPosition),l(Q)&&(n._tileset.debugPickPosition=Q)),n._tileset.debugPickedTile=q.content.tile}else n._tileset.debugPickedTile=void 0;n._scene.requestRender()}},un.MOUSE_MOVE):(n.feature=void 0,n.tile=void 0,n._eventHandler.removeInputAction(un.MOUSE_MOVE))}}),this.picking=!0;let c=ve.observable();ve.defineProperty(this,"colorize",{get:function(){return c()},set:function(k){c(k),l(n._tileset)&&(n._tileset.debugColorizeTiles=k,n._scene.requestRender())}}),this.colorize=!1;let u=ve.observable();ve.defineProperty(this,"wireframe",{get:function(){return u()},set:function(k){u(k),l(n._tileset)&&(n._tileset.debugWireframe=k,n._scene.requestRender())}}),this.wireframe=!1;let f=ve.observable();ve.defineProperty(this,"showBoundingVolumes",{get:function(){return f()},set:function(k){f(k),l(n._tileset)&&(n._tileset.debugShowBoundingVolume=k,n._scene.requestRender())}}),this.showBoundingVolumes=!1;let d=ve.observable();ve.defineProperty(this,"showContentBoundingVolumes",{get:function(){return d()},set:function(k){d(k),l(n._tileset)&&(n._tileset.debugShowContentBoundingVolume=k,n._scene.requestRender())}}),this.showContentBoundingVolumes=!1;let p=ve.observable();ve.defineProperty(this,"showRequestVolumes",{get:function(){return p()},set:function(k){p(k),l(n._tileset)&&(n._tileset.debugShowViewerRequestVolume=k,n._scene.requestRender())}}),this.showRequestVolumes=!1;let g=ve.observable();ve.defineProperty(this,"freezeFrame",{get:function(){return g()},set:function(k){g(k),l(n._tileset)&&(n._tileset.debugFreezeFrame=k,n._scene.debugShowFrustumPlanes=k,n._scene.requestRender())}}),this.freezeFrame=!1,ve.defineProperty(this,"showOnlyPickedTileDebugLabel",{get:function(){return s()},set:function(k){s(k),l(n._tileset)&&(n._tileset.debugPickedTileLabelOnly=k,n._scene.requestRender())}}),this.showOnlyPickedTileDebugLabel=!1;let m=ve.observable();ve.defineProperty(this,"showGeometricError",{get:function(){return m()},set:function(k){m(k),l(n._tileset)&&(n._tileset.debugShowGeometricError=k,n._scene.requestRender())}}),this.showGeometricError=!1;let y=ve.observable();ve.defineProperty(this,"showRenderingStatistics",{get:function(){return y()},set:function(k){y(k),l(n._tileset)&&(n._tileset.debugShowRenderingStatistics=k,n._scene.requestRender())}}),this.showRenderingStatistics=!1;let A=ve.observable();ve.defineProperty(this,"showMemoryUsage",{get:function(){return A()},set:function(k){A(k),l(n._tileset)&&(n._tileset.debugShowMemoryUsage=k,n._scene.requestRender())}}),this.showMemoryUsage=!1;let b=ve.observable();ve.defineProperty(this,"showUrl",{get:function(){return b()},set:function(k){b(k),l(n._tileset)&&(n._tileset.debugShowUrl=k,n._scene.requestRender())}}),this.showUrl=!1;let x=ve.observable();ve.defineProperty(this,"maximumScreenSpaceError",{get:function(){return x()},set:function(k){k=Number(k),isNaN(k)||(x(k),l(n._tileset)&&(n._tileset.maximumScreenSpaceError=k))}}),this.maximumScreenSpaceError=16;let T=ve.observable();ve.defineProperty(this,"dynamicScreenSpaceErrorDensity",{get:function(){return T()},set:function(k){k=Number(k),isNaN(k)||(T(k),l(n._tileset)&&(n._tileset.dynamicScreenSpaceErrorDensity=k))}}),this.dynamicScreenSpaceErrorDensity=2e-4,this.dynamicScreenSpaceErrorDensitySliderValue=void 0,ve.defineProperty(this,"dynamicScreenSpaceErrorDensitySliderValue",{get:function(){return Math.pow(T(),1/6)},set:function(k){let G=Math.pow(k,6);T(G),l(n._tileset)&&(n._tileset.dynamicScreenSpaceErrorDensity=G)}});let E=ve.observable();ve.defineProperty(this,"dynamicScreenSpaceErrorFactor",{get:function(){return E()},set:function(k){k=Number(k),isNaN(k)||(E(k),l(n._tileset)&&(n._tileset.dynamicScreenSpaceErrorFactor=k))}}),this.dynamicScreenSpaceErrorFactor=24;let v=S5t(this),S=ve.observable();ve.defineProperty(this,"pickActive",{get:function(){return S()},set:function(k){S(k),k?n._eventHandler.setInputAction(v,un.LEFT_CLICK):n._eventHandler.removeInputAction(un.LEFT_CLICK)}});let I=ve.observable();ve.defineProperty(this,"pointCloudShading",{get:function(){return I()},set:function(k){I(k),l(n._tileset)&&(n._tileset.pointCloudShading.attenuation=k)}}),this.pointCloudShading=!1;let R=ve.observable();ve.defineProperty(this,"geometricErrorScale",{get:function(){return R()},set:function(k){k=Number(k),isNaN(k)||(R(k),l(n._tileset)&&(n._tileset.pointCloudShading.geometricErrorScale=k))}}),this.geometricErrorScale=1;let O=ve.observable();ve.defineProperty(this,"maximumAttenuation",{get:function(){return O()},set:function(k){k=Number(k),isNaN(k)||(O(k),l(n._tileset)&&(n._tileset.pointCloudShading.maximumAttenuation=k===0?void 0:k))}}),this.maximumAttenuation=0;let L=ve.observable();ve.defineProperty(this,"baseResolution",{get:function(){return L()},set:function(k){k=Number(k),isNaN(k)||(L(k),l(n._tileset)&&(n._tileset.pointCloudShading.baseResolution=k===0?void 0:k))}}),this.baseResolution=0;let _=ve.observable();ve.defineProperty(this,"eyeDomeLighting",{get:function(){return _()},set:function(k){_(k),l(n._tileset)&&(n._tileset.pointCloudShading.eyeDomeLighting=k)}}),this.eyeDomeLighting=!1;let C=ve.observable();ve.defineProperty(this,"eyeDomeLightingStrength",{get:function(){return C()},set:function(k){k=Number(k),isNaN(k)||(C(k),l(n._tileset)&&(n._tileset.pointCloudShading.eyeDomeLightingStrength=k))}}),this.eyeDomeLightingStrength=1;let w=ve.observable();ve.defineProperty(this,"eyeDomeLightingRadius",{get:function(){return w()},set:function(k){k=Number(k),isNaN(k)||(w(k),l(n._tileset)&&(n._tileset.pointCloudShading.eyeDomeLightingRadius=k))}}),this.eyeDomeLightingRadius=1,this.pickActive=!1;let P=ve.observable();ve.defineProperty(this,"skipLevelOfDetail",{get:function(){return P()},set:function(k){P(k),l(n._tileset)&&(n._tileset.skipLevelOfDetail=k)}}),this.skipLevelOfDetail=!0;let M=ve.observable();ve.defineProperty(this,"skipScreenSpaceErrorFactor",{get:function(){return M()},set:function(k){k=Number(k),isNaN(k)||(M(k),l(n._tileset)&&(n._tileset.skipScreenSpaceErrorFactor=k))}}),this.skipScreenSpaceErrorFactor=16;let F=ve.observable();ve.defineProperty(this,"baseScreenSpaceError",{get:function(){return F()},set:function(k){k=Number(k),isNaN(k)||(F(k),l(n._tileset)&&(n._tileset.baseScreenSpaceError=k))}}),this.baseScreenSpaceError=1024;let V=ve.observable();ve.defineProperty(this,"skipLevels",{get:function(){return V()},set:function(k){k=Number(k),isNaN(k)||(V(k),l(n._tileset)&&(n._tileset.skipLevels=k))}}),this.skipLevels=1;let B=ve.observable();ve.defineProperty(this,"immediatelyLoadDesiredLevelOfDetail",{get:function(){return B()},set:function(k){B(k),l(n._tileset)&&(n._tileset.immediatelyLoadDesiredLevelOfDetail=k)}}),this.immediatelyLoadDesiredLevelOfDetail=!1;let j=ve.observable();ve.defineProperty(this,"loadSiblings",{get:function(){return j()},set:function(k){j(k),l(n._tileset)&&(n._tileset.loadSiblings=k)}}),this.loadSiblings=!1,this._style=void 0,this._shouldStyle=!1,this._definedProperties=["properties","dynamicScreenSpaceError","colorBlendMode","picking","colorize","wireframe","showBoundingVolumes","showContentBoundingVolumes","showRequestVolumes","freezeFrame","maximumScreenSpaceError","dynamicScreenSpaceErrorDensity","baseScreenSpaceError","skipScreenSpaceErrorFactor","skipLevelOfDetail","skipLevels","immediatelyLoadDesiredLevelOfDetail","loadSiblings","dynamicScreenSpaceErrorDensitySliderValue","dynamicScreenSpaceErrorFactor","pickActive","showOnlyPickedTileDebugLabel","showGeometricError","showRenderingStatistics","showMemoryUsage","showUrl","pointCloudShading","geometricErrorScale","maximumAttenuation","baseResolution","eyeDomeLighting","eyeDomeLightingStrength","eyeDomeLightingRadius"],this._removePostRenderEvent=e.postRender.addEventListener(function(){n._update()}),l(this._tileset)||n3e(this,!0)}Object.defineProperties(vc.prototype,{scene:{get:function(){return this._scene}},performanceContainer:{get:function(){return this._performanceContainer}},statisticsText:{get:function(){return this._statisticsText}},pickStatisticsText:{get:function(){return this._pickStatisticsText}},resourceCacheStatisticsText:{get:function(){return this._resourceCacheStatisticsText}},colorBlendModes:{get:function(){return I5t}},editorError:{get:function(){return this._editorError}},tileset:{get:function(){return this._tileset},set:function(e){if(this._tileset=e,this._style=void 0,this.styleString="{}",this.feature=void 0,this.tile=void 0,l(e)){this._properties(e.properties);let t=["colorize","wireframe","showBoundingVolumes","showContentBoundingVolumes","showRequestVolumes","freezeFrame","showOnlyPickedTileDebugLabel","showGeometricError","showRenderingStatistics","showMemoryUsage","showUrl"],n=t.length;for(let r=0;r<n;++r){let o=t[r];this[o]=this[o]}this.maximumScreenSpaceError=e.maximumScreenSpaceError,this.dynamicScreenSpaceError=e.dynamicScreenSpaceError,this.dynamicScreenSpaceErrorDensity=e.dynamicScreenSpaceErrorDensity,this.dynamicScreenSpaceErrorFactor=e.dynamicScreenSpaceErrorFactor,this.colorBlendMode=e.colorBlendMode,this.skipLevelOfDetail=e.skipLevelOfDetail,this.skipScreenSpaceErrorFactor=e.skipScreenSpaceErrorFactor,this.baseScreenSpaceError=e.baseScreenSpaceError,this.skipLevels=e.skipLevels,this.immediatelyLoadDesiredLevelOfDetail=e.immediatelyLoadDesiredLevelOfDetail,this.loadSiblings=e.loadSiblings,this.hasEnabledWireframe=e._enableDebugWireframe;let i=e.pointCloudShading;this.pointCloudShading=i.attenuation,this.geometricErrorScale=i.geometricErrorScale,this.maximumAttenuation=i.maximumAttenuation?i.maximumAttenuation:0,this.baseResolution=i.baseResolution?i.baseResolution:0,this.eyeDomeLighting=i.eyeDomeLighting,this.eyeDomeLightingStrength=i.eyeDomeLightingStrength,this.eyeDomeLightingRadius=i.eyeDomeLightingRadius,this._scene.requestRender()}else this._properties({});this._statisticsText=V8(e,!1),this._pickStatisticsText=V8(e,!0),this._resourceCacheStatisticsText=i3e(),n3e(this,!1)}},feature:{get:function(){return this._feature},set:function(e){if(this._feature===e)return;let t=this._feature;l(t)&&!t.content.isDestroyed()&&(!this.colorize&&l(this._style)?t.color=l(this._style.color)?this._style.color.evaluateColor(t,P5t):z.WHITE:t.color=uq,this._scene.requestRender()),l(e)&&(z.clone(e.color,uq),e.color=t3e,this._scene.requestRender()),this._feature=e}},tile:{get:function(){return this._tile},set:function(e){if(this._tile===e)return;let t=this._tile;l(t)&&!t.isDestroyed()&&!Ble(t.content)&&(t.color=uq,this._scene.requestRender()),l(e)&&!Ble(e.content)&&(z.clone(e.color,uq),e.color=t3e,this._scene.requestRender()),this._tile=e}}});function Ble(e){if(!l(e))return!1;if(e.featuresLength>0)return!0;let t=e.innerContents;if(l(t)){let n=t.length;for(let i=0;i<n;++i)if(!Ble(t[i]))return!1;return!0}return!1}vc.prototype.togglePickTileset=function(){this.pickActive=!this.pickActive};vc.prototype.toggleInspector=function(){this.inspectorVisible=!this.inspectorVisible};vc.prototype.toggleTileset=function(){this.tilesetVisible=!this.tilesetVisible};vc.prototype.toggleDisplay=function(){this.displayVisible=!this.displayVisible};vc.prototype.toggleUpdate=function(){this.updateVisible=!this.updateVisible};vc.prototype.toggleLogging=function(){this.loggingVisible=!this.loggingVisible};vc.prototype.toggleStyle=function(){this.styleVisible=!this.styleVisible};vc.prototype.toggleTileDebugLabels=function(){this.tileDebugLabelsVisible=!this.tileDebugLabelsVisible};vc.prototype.toggleOptimization=function(){this.optimizationVisible=!this.optimizationVisible};vc.prototype.trimTilesCache=function(){l(this._tileset)&&this._tileset.trimLoadedTiles()};vc.prototype.compileStyle=function(){let e=this._tileset;if(!(!l(e)||this.styleString===JSON.stringify(e.style))){this._editorError="";try{this.styleString.length===0&&(this.styleString="{}"),this._style=new u_(JSON.parse(this.styleString)),this._shouldStyle=!0,this._scene.requestRender()}catch(t){this._editorError=t.toString()}this.feature=this._feature,this.tile=this._tile}};vc.prototype.styleEditorKeyPress=function(e,t){if(t.keyCode===9){t.preventDefault();let n=t.target,i=n.selectionStart,r=n.selectionEnd,o=r,a=n.value.slice(i,r).split(` -`),c=a.length,u;if(t.shiftKey)for(u=0;u<c;++u)a[u][0]===" "&&(a[u][1]===" "?(a[u]=a[u].substr(2),o-=2):(a[u]=a[u].substr(1),o-=1));else for(u=0;u<c;++u)a[u]=` ${a[u]}`,o+=2;let f=a.join(` -`);n.value=n.value.slice(0,i)+f+n.value.slice(r),n.selectionStart=i!==r?i:o,n.selectionEnd=o}else t.ctrlKey&&(t.keyCode===10||t.keyCode===13)&&this.compileStyle();return!0};vc.prototype._update=function(){let e=this._tileset;if(this.performance&&this._performanceDisplay.update(),l(e)){if(e.isDestroyed()){this.tile=void 0,this.feature=void 0,this.tileset=void 0;return}let t=e.style;this._style!==e.style&&(this._shouldStyle?(e.style=this._style,this._shouldStyle=!1):(this._style=t,this.styleString=JSON.stringify(t.style,null," ")))}this.showStatistics&&(this._statisticsText=V8(e,!1),this._pickStatisticsText=V8(e,!0),this._resourceCacheStatisticsText=i3e())};vc.prototype.isDestroyed=function(){return!1};vc.prototype.destroy=function(){this._eventHandler.destroy(),this._removePostRenderEvent();let e=this;return this._definedProperties.forEach(function(t){ve.getObservable(e,t).dispose()}),le(this)};vc.getStatistics=V8;var j8=vc;function fq(e,t){e=Ln(e);let n=document.createElement("div"),i=document.createElement("div");i.setAttribute("data-bind","visible: performance");let r=new j8(t,i);this._viewModel=r,this._container=e,this._element=n;let o=document.createElement("div");o.textContent="3D Tiles Inspector",o.className="cesium-cesiumInspector-button",o.setAttribute("data-bind","click: toggleInspector"),n.appendChild(o),n.className="cesium-cesiumInspector cesium-3DTilesInspector",n.setAttribute("data-bind",'css: { "cesium-cesiumInspector-visible" : inspectorVisible, "cesium-cesiumInspector-hidden" : !inspectorVisible}'),e.appendChild(n);let s=document.createElement("div");s.className="cesium-cesiumInspector-dropDown",n.appendChild(s);let a=Af.createSection,c=Af.createCheckbox,u=Af.createRangeInput,f=Af.createButton,d=a(s,"Tileset","tilesetVisible","toggleTileset"),p=a(s,"Display","displayVisible","toggleDisplay"),g=a(s,"Update","updateVisible","toggleUpdate"),m=a(s,"Logging","loggingVisible","toggleLogging"),y=a(s,"Tile Debug Labels","tileDebugLabelsVisible","toggleTileDebugLabels"),A=a(s,"Style","styleVisible","toggleStyle"),b=a(s,"Optimization","optimizationVisible","toggleOptimization"),x=document.createElement("div");x.className="field-group";let T=document.createElement("label");T.className="field-label",T.appendChild(document.createTextNode("Properties: "));let E=document.createElement("div");E.setAttribute("data-bind","text: properties"),x.appendChild(T),x.appendChild(E),d.appendChild(x),d.appendChild(f("Pick Tileset","togglePickTileset","pickActive")),d.appendChild(f("Trim Tiles Cache","trimTilesCache")),d.appendChild(c("Enable Picking","picking")),p.appendChild(c("Colorize","colorize"));let v=p.appendChild(c("Wireframe","wireframe","_tileset === undefined || hasEnabledWireframe")),S=document.createElement("p");S.setAttribute("data-bind","visible: _tileset !== undefined && !hasEnabledWireframe"),S.setAttribute("class","cesium-3DTilesInspector-disabledElementsInfo"),S.innerText="Set enableDebugWireframe to true in the tileset constructor to enable this option.",v.appendChild(S),p.appendChild(c("Bounding Volumes","showBoundingVolumes")),p.appendChild(c("Content Volumes","showContentBoundingVolumes")),p.appendChild(c("Request Volumes","showRequestVolumes")),p.appendChild(c("Point Cloud Shading","pointCloudShading"));let I=document.createElement("div");I.setAttribute("data-bind","visible: pointCloudShading"),I.appendChild(u("Geometric Error Scale","geometricErrorScale",0,2,.01)),I.appendChild(u("Maximum Attenuation","maximumAttenuation",0,32,1)),I.appendChild(u("Base Resolution","baseResolution",0,1,.01)),I.appendChild(c("Eye Dome Lighting (EDL)","eyeDomeLighting")),p.appendChild(I);let R=document.createElement("div");R.setAttribute("data-bind","visible: eyeDomeLighting"),R.appendChild(u("EDL Strength","eyeDomeLightingStrength",0,2,.1)),R.appendChild(u("EDL Radius","eyeDomeLightingRadius",0,4,.1)),I.appendChild(R),g.appendChild(c("Freeze Frame","freezeFrame")),g.appendChild(c("Dynamic Screen Space Error","dynamicScreenSpaceError"));let O=document.createElement("div");O.appendChild(u("Maximum Screen Space Error","maximumScreenSpaceError",0,128,1)),g.appendChild(O);let L=document.createElement("div");L.setAttribute("data-bind","visible: dynamicScreenSpaceError"),L.appendChild(u("Screen Space Error Density","dynamicScreenSpaceErrorDensitySliderValue",0,1,.005,"dynamicScreenSpaceErrorDensity")),L.appendChild(u("Screen Space Error Factor","dynamicScreenSpaceErrorFactor",1,32,.1)),g.appendChild(L),m.appendChild(c("Performance","performance")),m.appendChild(i),m.appendChild(c("Statistics","showStatistics"));let _=document.createElement("div");_.className="cesium-3dTilesInspector-statistics",_.setAttribute("data-bind","html: statisticsText, visible: showStatistics"),m.appendChild(_),m.appendChild(c("Pick Statistics","showPickStatistics"));let C=document.createElement("div");C.className="cesium-3dTilesInspector-statistics",C.setAttribute("data-bind","html: pickStatisticsText, visible: showPickStatistics"),m.appendChild(C),m.appendChild(c("Resource Cache Statistics","showResourceCacheStatistics"));let w=document.createElement("div");w.className="cesium-3dTilesInspector-statistics",w.setAttribute("data-bind","html: resourceCacheStatisticsText, visible: showResourceCacheStatistics"),m.appendChild(w);let P=document.createElement("div");A.appendChild(P),P.appendChild(document.createTextNode("Color Blend Mode: "));let M=document.createElement("select");M.setAttribute("data-bind",'options: colorBlendModes, optionsText: "text", optionsValue: "value", value: colorBlendMode'),P.appendChild(M);let F=document.createElement("textarea");F.setAttribute("data-bind","textInput: styleString, event: { keydown: styleEditorKeyPress }"),P.className="cesium-cesiumInspector-styleEditor",P.appendChild(F);let V=f("Compile (Ctrl+Enter)","compileStyle");P.appendChild(V);let B=document.createElement("div");B.className="cesium-cesiumInspector-error",B.setAttribute("data-bind","text: editorError"),P.appendChild(B),y.appendChild(c("Show Picked Only","showOnlyPickedTileDebugLabel")),y.appendChild(c("Geometric Error","showGeometricError")),y.appendChild(c("Rendering Statistics","showRenderingStatistics")),y.appendChild(c("Memory Usage (MB)","showMemoryUsage")),y.appendChild(c("Url","showUrl")),b.appendChild(c("Skip Tile LODs","skipLevelOfDetail"));let j=document.createElement("div");j.appendChild(u("Skip SSE Factor","skipScreenSpaceErrorFactor",1,50,1)),b.appendChild(j);let k=document.createElement("div");k.appendChild(u("SSE before skipping LOD","baseScreenSpaceError",0,4096,1)),b.appendChild(k);let G=document.createElement("div");G.appendChild(u("Min. levels to skip","skipLevels",0,10,1)),b.appendChild(G),b.appendChild(c("Load only tiles that meet the max SSE.","immediatelyLoadDesiredLevelOfDetail")),b.appendChild(c("Load siblings of visible tiles","loadSiblings")),ve.applyBindings(r,n)}Object.defineProperties(fq.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}}});fq.prototype.isDestroyed=function(){return!1};fq.prototype.destroy=function(){return ve.cleanNode(this._element),this._container.removeChild(this._element),this.viewModel.destroy(),le(this)};var H8=fq;function D5t(e,t){t.currentTarget.parentElement.parentElement.querySelector(`#${e.name}-expander`).classList.toggle("active"),t.currentTarget.textContent=t.currentTarget.textContent==="+"?"-":"+"}function o3e(e,t){ve.track(e);for(let n=0;n<e.sublayers.length;n++)o3e(e.sublayers[n],t)}function dq(e){return e.modelName==="FullModel"}function s3e(e){return e.modelName==="Overview"}function a3e(e){return s3e(e)||dq(e)}function r3e(e,t){if(a3e(e)){e.visibility=!1;for(let i=0;i<e.sublayers.length;i++)e.sublayers[i].visibility=!0;let n={name:e.name,modelName:e.modelName,disable:ve.observable(!1),index:t.sublayers.length};return t.topLayers.push(n),t.sublayers.push(e),n}}function R5t(e,t){if(a3e(e)){t.sublayers.forEach(i=>i.visibility=!1),t.sublayers[e.index].visibility=!0;let n=document.getElementById("bsl-wrapper");dq(e)?(t.currentLevel=t.selectedLevel,n.style.display="block"):(t.selectedLevel=t.currentLevel,t.currentLevel="All",n.style.display="none")}}async function O5t(e,t){try{let n=e.getAttributeNames();for(let i=0;i<n.length;i++)if(n[i]==="BldgLevel"){let r=e.getAttributeValues(n[i]);for(let o=0;o<r.length;o++)t.push(r[o])}t.sort((i,r)=>i-r),t.unshift("All")}catch(n){console.log(`There was an error getting attributes: ${n}`)}}function M5t(e){let t=this;this.levels=[],this.viewModel={sublayers:[],levels:this.levels,currentLevel:ve.observable(),selectedLevel:"All",topLayers:[{name:"Select a layer to explore...",disable:ve.observable(!0),index:-1}],currentLayer:ve.observable(),expandClickHandler:D5t,setOptionDisable:function(i,r){ve.applyBindingsToNode(i,{disable:r.disable},r)},defaultLayer:void 0},this.viewModel.currentLayer.subscribe(function(i){R5t(i,t.viewModel)});let n=e.sublayers;for(let i=0;i<n.length;i++){o3e(n[i],this.viewModel);let r=r3e(n[i],this.viewModel);l(r)&&(s3e(r)||!l(this.viewModel.defaultLayer)&&dq(r))&&(this.viewModel.defaultLayer=r)}if(this.viewModel.topLayers.length===1&&n.length>0){e.show=!1;let i={name:"Full Model",modelName:"FullModel",visibility:e.show,sublayers:e.sublayers};this.viewModel.defaultLayer=r3e(i,this.viewModel),this.viewModel.currentLayer.subscribe(function(r){e.show=dq(r)})}else this.viewModel.topLayers.length===1&&(this.viewModel.topLayers[0].name="Building layers not found");return O5t(e,this.levels),this.viewModel.currentLevel.subscribe(function(i){i!=="All"?e.filterByAttributes([{name:"BldgLevel",values:[i]}]):e.filterByAttributes()}),this.viewModel}var G8=M5t;function N5t(e,t){let n=document.getElementById(e),i=document.createElement("div");i.classList.add("cesium-viewer-i3s-explorer"),i.innerHTML=` + © <a href="https://www.openstreetmap.org/about/" target="_blank">OpenStreetMap contributors</a>`})}})),e.push(new uo({name:"Sentinel-2",iconUrl:Zt("Widgets/Images/ImageryProviders/sentinel-2.png"),tooltip:"Sentinel-2 cloudless by EOX IT Services GmbH (Contains modified Copernicus Sentinel data 2016 and 2017).",category:"Cesium ion",creationFunction:function(){return lu.fromAssetId(3954)}})),e.push(new uo({name:"Blue Marble",iconUrl:Zt("Widgets/Images/ImageryProviders/blueMarble.png"),tooltip:"Blue Marble Next Generation July, 2004 imagery from NASA.",category:"Cesium ion",creationFunction:function(){return lu.fromAssetId(3845)}})),e.push(new uo({name:"Earth at night",iconUrl:Zt("Widgets/Images/ImageryProviders/earthAtNight.png"),tooltip:"The Earth at night, also known as The Black Marble, is a 500 meter resolution global composite imagery layer released by NASA.",category:"Cesium ion",creationFunction:function(){return lu.fromAssetId(3812)}})),e.push(new uo({name:"Natural Earth\xA0II",iconUrl:Zt("Widgets/Images/ImageryProviders/naturalEarthII.png"),tooltip:`Natural Earth II, darkened for contrast. +http://www.naturalearthdata.com/`,category:"Cesium ion",creationFunction:function(){return PA.fromUrl(Zt("Assets/Textures/NaturalEarthII"))}})),e.push(new uo({name:"Google Maps Satellite",iconUrl:Zt("Widgets/Images/ImageryProviders/googleSatellite.png"),tooltip:"Imagery from Google Maps",category:"Cesium ion",creationFunction:function(){return lu.fromAssetId(3830182)}})),e.push(new uo({name:"Google Maps Satellite with Labels",iconUrl:Zt("Widgets/Images/ImageryProviders/googleSatelliteLabels.png"),tooltip:"Imagery with place labels from Google Maps",category:"Cesium ion",creationFunction:function(){return lu.fromAssetId(3830183)}})),e.push(new uo({name:"Google Maps Roadmap",iconUrl:Zt("Widgets/Images/ImageryProviders/googleRoadmap.png"),tooltip:"Labeled roads and other features on a base landscape from Google Maps",category:"Cesium ion",creationFunction:function(){return lu.fromAssetId(3830184)}})),e.push(new uo({name:"Google Maps Contour",iconUrl:Zt("Widgets/Images/ImageryProviders/googleContour.png"),tooltip:"Hillshade mapping, contour lines, natural features (roadmap features hidden) from Google Maps",category:"Cesium ion",creationFunction:function(){return lu.fromAssetId(3830186)}})),e.push(new uo({name:"Azure Maps Aerial",iconUrl:Zt("Widgets/Images/ImageryProviders/azureAerial.png"),tooltip:"Imagery from Azure Maps",category:"Cesium ion",creationFunction:function(){return lu.fromAssetId(3891168)}})),e.push(new uo({name:"Azure Maps Roads",iconUrl:Zt("Widgets/Images/ImageryProviders/azureRoads.png"),tooltip:"Labeled roads and other features on a base landscape from Azure Maps",category:"Cesium ion",creationFunction:function(){return lu.fromAssetId(3891169)}})),e}var k8=w5t;function I5t(){let e=[];return e.push(new uo({name:"WGS84 Ellipsoid",iconUrl:Zt("Widgets/Images/TerrainProviders/Ellipsoid.png"),tooltip:"WGS84 standard ellipsoid, also known as EPSG:4326",category:"Cesium ion",creationFunction:function(){return new y0({ellipsoid:ee.WGS84})}})),e.push(new uo({name:"Cesium World Terrain",iconUrl:Zt("Widgets/Images/TerrainProviders/CesiumWorldTerrain.png"),tooltip:"High-resolution global terrain tileset curated from several datasources and hosted by Cesium ion",category:"Cesium ion",creationFunction:function(){return UC({requestWaterMask:!0,requestVertexNormals:!0})}})),e}var U8=I5t;var r3e=1e3;function bp(e){l(e.geocoderServices)?this._geocoderServices=e.geocoderServices:this._geocoderServices=[new VC({scene:e.scene})],this._viewContainer=e.container,this._scene=e.scene,this._flightDuration=e.flightDuration,this._searchText="",this._isSearchInProgress=!1,this._wasGeocodeCancelled=!1,this._previousCredits=[],this._complete=new be,this._suggestions=[],this._selectedSuggestion=void 0,this._showSuggestions=!0,this._handleArrowDown=s3e,this._handleArrowUp=o3e;let t=this;this._suggestionsVisible=ve.pureComputed(function(){let r=ve.getObservable(t,"_suggestions")().length>0,o=ve.getObservable(t,"_showSuggestions")();return r&&o}),this._searchCommand=Rn(function(i){if(i=i??Vb.SEARCH,t._focusTextbox=!1,l(t._selectedSuggestion))return t.activateSuggestion(t._selectedSuggestion),!1;if(t.hideSuggestions(),t.isSearchInProgress)N5t(t);else return O5t(t,t._geocoderServices,i)}),this.deselectSuggestion=function(){t._selectedSuggestion=void 0},this.handleKeyDown=function(i,r){let o=r.key==="ArrowDown"||r.key==="Down"||r.keyCode===40,s=r.key==="ArrowUp"||r.key==="Up"||r.keyCode===38;return(o||s)&&r.preventDefault(),!0},this.handleKeyUp=function(i,r){let o=r.key==="ArrowDown"||r.key==="Down"||r.keyCode===40,s=r.key==="ArrowUp"||r.key==="Up"||r.keyCode===38,a=r.key==="Enter"||r.keyCode===13;return s?o3e(t):o?s3e(t):a&&t._searchCommand(),!0},this.activateSuggestion=function(i){t.hideSuggestions(),t._searchText=i.displayName;let r=i.destination;l3e(t),t.destinationFound(t,r)},this.hideSuggestions=function(){t._showSuggestions=!1,t._selectedSuggestion=void 0},this.showSuggestions=function(){t._showSuggestions=!0},this.handleMouseover=function(i,r){i!==t._selectedSuggestion&&(t._selectedSuggestion=i)},this.keepExpanded=!1,this.autoComplete=e.autocomplete??!0,this.destinationFound=e.destinationFound??bp.flyToDestination,this._focusTextbox=!1,ve.track(this,["_searchText","_isSearchInProgress","keepExpanded","_suggestions","_selectedSuggestion","_showSuggestions","_focusTextbox"]);let n=ve.getObservable(this,"_searchText");n.extend({rateLimit:{timeout:500}}),this._suggestionSubscription=n.subscribe(function(){bp._updateSearchSuggestions(t)}),this.isSearchInProgress=void 0,ve.defineProperty(this,"isSearchInProgress",{get:function(){return this._isSearchInProgress}}),this.searchText=void 0,ve.defineProperty(this,"searchText",{get:function(){return this.isSearchInProgress?"Searching...":this._searchText},set:function(i){this._searchText=i}}),this.flightDuration=void 0,ve.defineProperty(this,"flightDuration",{get:function(){return this._flightDuration},set:function(i){this._flightDuration=i}})}Object.defineProperties(bp.prototype,{complete:{get:function(){return this._complete}},scene:{get:function(){return this._scene}},search:{get:function(){return this._searchCommand}},selectedSuggestion:{get:function(){return this._selectedSuggestion}},suggestions:{get:function(){return this._suggestions}}});function o3e(e){if(e._suggestions.length===0)return;let t=e._suggestions.indexOf(e._selectedSuggestion);if(t===-1||t===0){e._selectedSuggestion=void 0;return}let n=t-1;e._selectedSuggestion=e._suggestions[n],bp._adjustSuggestionsScroll(e,n)}function s3e(e){if(e._suggestions.length===0)return;let t=e._suggestions.length,i=(e._suggestions.indexOf(e._selectedSuggestion)+1)%t;e._selectedSuggestion=e._suggestions[i],bp._adjustSuggestionsScroll(e,i)}function P5t(e,t){let n=l(t)?t.availability:void 0;return l(n)?xE(t,[e]).then(function(i){return e=i[0],e.height+=r3e,e}):(e.height+=r3e,Promise.resolve(e))}function D5t(e,t){let n=e._scene,i=n.ellipsoid,r=n.camera,o=n.terrainProvider,s=t,a;return t instanceof ie?D.equalsEpsilon(t.south,t.north,D.EPSILON7)&&D.equalsEpsilon(t.east,t.west,D.EPSILON7)?t=ie.center(t):a=TE(t,n):t=i.cartesianToCartographic(t),l(a)||(a=P5t(t,o)),a.then(function(c){s=i.cartographicToCartesian(c)}).finally(function(){r.flyTo({destination:s,complete:function(){e._complete.raiseEvent()},duration:e._flightDuration,endTransform:N.IDENTITY})})}async function R5t(e,t,n){try{return{state:"fulfilled",value:await e.geocode(t,n),credits:e.credit}}catch(i){return{state:"rejected",reason:i}}}async function O5t(e,t,n){let i=e._searchText;if(c3e(i)){e.showSuggestions();return}e._isSearchInProgress=!0,e._wasGeocodeCancelled=!1;let r,o;for(r=0;r<t.length;r++){if(e._wasGeocodeCancelled)return;if(o=await R5t(t[r],i,n),l(o)&&o.state==="fulfilled"&&o.value.length>0)break}if(e._wasGeocodeCancelled)return;e._isSearchInProgress=!1,Ule(e);let s=o.value;if(o.state==="fulfilled"&&l(s)&&s.length>0){e._searchText=s[0].displayName,e.destinationFound(e,s[0].destination);let a=a3e(e,UP.getCreditsFromResult(s[0]));l(a)||kle(e,t[r].credit);return}e._searchText=`${i} (not found)`}function kle(e,t){l(t)&&!e._scene.isDestroyed()&&!e._scene.frameState.creditDisplay.isDestroyed()&&(e._scene.frameState.creditDisplay.addStaticCredit(t),e._previousCredits.push(t))}function a3e(e,t){return l(t)&&t.forEach(n=>kle(e,n)),t}function Ule(e){!e._scene.isDestroyed()&&!e._scene.frameState.creditDisplay.isDestroyed()&&e._previousCredits.forEach(t=>{e._scene.frameState.creditDisplay.removeStaticCredit(t)}),e._previousCredits.length=0}function M5t(e,t){let n=Ln(e._viewContainer),i=n.getElementsByClassName("search-results")[0],o=n.getElementsByTagName("li")[t];if(t===0){i.scrollTop=0;return}let s=o.offsetTop;s+o.clientHeight>i.clientHeight?i.scrollTop=s+o.clientHeight:s<i.scrollTop&&(i.scrollTop=s)}function N5t(e){e._isSearchInProgress&&(e._isSearchInProgress=!1,e._wasGeocodeCancelled=!0)}function c3e(e){return/^\s*$/.test(e)}function l3e(e){ve.getObservable(e,"_suggestions").removeAll()}async function L5t(e){if(!e.autoComplete)return;let t=e._searchText;if(l3e(e),Ule(e),!c3e(t))for(let n of e._geocoderServices){let i=await n.geocode(t,Vb.AUTOCOMPLETE);if(e._suggestions=e._suggestions.concat(i),i.length>0){let r=!0;i.forEach(o=>{let s=UP.getCreditsFromResult(o);r=r&&!l(s),a3e(e,s)}),r&&kle(e,n.credit)}if(e._suggestions.length>=5)return}}bp.flyToDestination=D5t;bp._updateSearchSuggestions=L5t;bp._adjustSuggestionsScroll=M5t;bp.prototype.isDestroyed=function(){return!1};bp.prototype.destroy=function(){return this._suggestionSubscription.dispose(),Ule(this),le(this)};var z8=bp;var F5t="M29.772,26.433l-7.126-7.126c0.96-1.583,1.523-3.435,1.524-5.421C24.169,8.093,19.478,3.401,13.688,3.399C7.897,3.401,3.204,8.093,3.204,13.885c0,5.789,4.693,10.481,10.484,10.481c1.987,0,3.839-0.563,5.422-1.523l7.128,7.127L29.772,26.433zM7.203,13.885c0.006-3.582,2.903-6.478,6.484-6.486c3.579,0.008,6.478,2.904,6.484,6.486c-0.007,3.58-2.905,6.476-6.484,6.484C10.106,20.361,7.209,17.465,7.203,13.885z",B5t="M24.778,21.419 19.276,15.917 24.777,10.415 21.949,7.585 16.447,13.087 10.945,7.585 8.117,10.415 13.618,15.917 8.116,21.419 10.946,24.248 16.447,18.746 21.948,24.248z";function lq(e){let t=Ln(e.container),n=new z8(e);n._startSearchPath=F5t,n._stopSearchPath=B5t;let i=document.createElement("form");i.setAttribute("data-bind","submit: search");let r=document.createElement("input");r.type="search",r.className="cesium-geocoder-input",r.setAttribute("placeholder","Enter an address or landmark..."),r.setAttribute("data-bind",'textInput: searchText,disable: isSearchInProgress,event: { keyup: handleKeyUp, keydown: handleKeyDown, mouseover: deselectSuggestion },css: { "cesium-geocoder-input-wide" : keepExpanded || searchText.length > 0 },hasFocus: _focusTextbox'),this._onTextBoxFocus=function(){setTimeout(function(){r.select()},0)},r.addEventListener("focus",this._onTextBoxFocus,!1),i.appendChild(r),this._textBox=r;let o=document.createElement("span");o.className="cesium-geocoder-searchButton",o.setAttribute("data-bind","click: search,cesiumSvgPath: { path: isSearchInProgress ? _stopSearchPath : _startSearchPath, width: 32, height: 32 }"),i.appendChild(o),t.appendChild(i);let s=document.createElement("div");s.className="search-results",s.setAttribute("data-bind","visible: _suggestionsVisible");let a=document.createElement("ul");a.setAttribute("data-bind","foreach: _suggestions");let c=document.createElement("li");a.appendChild(c),c.setAttribute("data-bind","text: $data.displayName, click: $parent.activateSuggestion, event: { mouseover: $parent.handleMouseover}, css: { active: $data === $parent._selectedSuggestion }"),s.appendChild(a),t.appendChild(s),ve.applyBindings(n,i),ve.applyBindings(n,s),this._container=t,this._searchSuggestionsContainer=s,this._viewModel=n,this._form=i,this._onInputBegin=function(u){let f=u.target;typeof u.composedPath=="function"&&(f=u.composedPath()[0]),t.contains(f)||(n._focusTextbox=!1,n.hideSuggestions())},this._onInputEnd=function(u){n._focusTextbox=!0,n.showSuggestions()},dn.supportsPointerEvents()?(document.addEventListener("pointerdown",this._onInputBegin,!0),t.addEventListener("pointerup",this._onInputEnd,!0),t.addEventListener("pointercancel",this._onInputEnd,!0)):(document.addEventListener("mousedown",this._onInputBegin,!0),t.addEventListener("mouseup",this._onInputEnd,!0),document.addEventListener("touchstart",this._onInputBegin,!0),t.addEventListener("touchend",this._onInputEnd,!0),t.addEventListener("touchcancel",this._onInputEnd,!0))}Object.defineProperties(lq.prototype,{container:{get:function(){return this._container}},searchSuggestionsContainer:{get:function(){return this._searchSuggestionsContainer}},viewModel:{get:function(){return this._viewModel}}});lq.prototype.isDestroyed=function(){return!1};lq.prototype.destroy=function(){let e=this._container;return dn.supportsPointerEvents()?(document.removeEventListener("pointerdown",this._onInputBegin,!0),e.removeEventListener("pointerup",this._onInputEnd,!0)):(document.removeEventListener("mousedown",this._onInputBegin,!0),e.removeEventListener("mouseup",this._onInputEnd,!0),document.removeEventListener("touchstart",this._onInputBegin,!0),e.removeEventListener("touchend",this._onInputEnd,!0)),this._viewModel.destroy(),ve.cleanNode(this._form),ve.cleanNode(this._searchSuggestionsContainer),e.removeChild(this._form),e.removeChild(this._searchSuggestionsContainer),this._textBox.removeEventListener("focus",this._onTextBoxFocus,!1),le(this)};var V8=lq;function u3e(e,t){this._scene=e,this._duration=t;let n=this;this._command=Rn(function(){n._scene.camera.flyHome(n._duration)}),this.tooltip="View Home",ve.track(this,["tooltip"])}Object.defineProperties(u3e.prototype,{scene:{get:function(){return this._scene}},command:{get:function(){return this._command}},duration:{get:function(){return this._duration},set:function(e){this._duration=e}}});var j8=u3e;function uq(e,t,n){e=Ln(e);let i=new j8(t,n);i._svgPath="M14,4l-10,8.75h20l-4.25-3.7188v-4.6562h-2.812v2.1875l-2.938-2.5625zm-7.0938,9.906v10.094h14.094v-10.094h-14.094zm2.1876,2.313h3.3122v4.25h-3.3122v-4.25zm5.8442,1.281h3.406v6.438h-3.406v-6.438z";let r=document.createElement("button");r.type="button",r.className="cesium-button cesium-toolbar-button cesium-home-button",r.setAttribute("data-bind","attr: { title: tooltip },click: command,cesiumSvgPath: { path: _svgPath, width: 28, height: 28 }"),e.appendChild(r),ve.applyBindings(i,r),this._container=e,this._viewModel=i,this._element=r}Object.defineProperties(uq.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}}});uq.prototype.isDestroyed=function(){return!1};uq.prototype.destroy=function(){return ve.cleanNode(this._element),this._container.removeChild(this._element),le(this)};var H8=uq;function fq(e,t){l(t)||(t=document.body),t=Ln(t);let n=this,i=ve.observable(es.fullscreen),r=ve.observable(es.enabled),o=t.ownerDocument;this.isFullscreen=void 0,ve.defineProperty(this,"isFullscreen",{get:function(){return i()}}),this.isFullscreenEnabled=void 0,ve.defineProperty(this,"isFullscreenEnabled",{get:function(){return r()},set:function(s){r(s&&es.enabled)}}),this.tooltip=void 0,ve.defineProperty(this,"tooltip",function(){return this.isFullscreenEnabled?i()?"Exit full screen":"Full screen":"Full screen unavailable"}),this._command=Rn(function(){es.fullscreen?es.exitFullscreen():es.requestFullscreen(n._fullscreenElement)},ve.getObservable(this,"isFullscreenEnabled")),this._fullscreenElement=Ln(e)??o.body,this._callback=function(){i(es.fullscreen)},o.addEventListener(es.changeEventName,this._callback)}Object.defineProperties(fq.prototype,{fullscreenElement:{get:function(){return this._fullscreenElement},set:function(e){this._fullscreenElement=e}},command:{get:function(){return this._command}}});fq.prototype.isDestroyed=function(){return!1};fq.prototype.destroy=function(){document.removeEventListener(es.changeEventName,this._callback),le(this)};var G8=fq;var k5t="M 83.96875 17.5625 L 83.96875 17.59375 L 76.65625 24.875 L 97.09375 24.96875 L 76.09375 45.96875 L 81.9375 51.8125 L 102.78125 30.9375 L 102.875 51.15625 L 110.15625 43.875 L 110.1875 17.59375 L 83.96875 17.5625 z M 44.125 17.59375 L 17.90625 17.625 L 17.9375 43.90625 L 25.21875 51.1875 L 25.3125 30.96875 L 46.15625 51.8125 L 52 45.96875 L 31 25 L 51.4375 24.90625 L 44.125 17.59375 z M 46.0625 76.03125 L 25.1875 96.875 L 25.09375 76.65625 L 17.8125 83.9375 L 17.8125 110.21875 L 44 110.25 L 51.3125 102.9375 L 30.90625 102.84375 L 51.875 81.875 L 46.0625 76.03125 z M 82 76.15625 L 76.15625 82 L 97.15625 103 L 76.71875 103.0625 L 84.03125 110.375 L 110.25 110.34375 L 110.21875 84.0625 L 102.9375 76.8125 L 102.84375 97 L 82 76.15625 z",U5t="M 104.34375 17.5625 L 83.5 38.4375 L 83.40625 18.21875 L 76.125 25.5 L 76.09375 51.78125 L 102.3125 51.8125 L 102.3125 51.78125 L 109.625 44.5 L 89.1875 44.40625 L 110.1875 23.40625 L 104.34375 17.5625 z M 23.75 17.59375 L 17.90625 23.4375 L 38.90625 44.4375 L 18.5 44.53125 L 25.78125 51.8125 L 52 51.78125 L 51.96875 25.53125 L 44.6875 18.25 L 44.625 38.46875 L 23.75 17.59375 z M 25.6875 76.03125 L 18.375 83.3125 L 38.78125 83.40625 L 17.8125 104.40625 L 23.625 110.25 L 44.5 89.375 L 44.59375 109.59375 L 51.875 102.3125 L 51.875 76.0625 L 25.6875 76.03125 z M 102.375 76.15625 L 76.15625 76.1875 L 76.1875 102.4375 L 83.46875 109.71875 L 83.5625 89.53125 L 104.40625 110.375 L 110.25 104.53125 L 89.25 83.53125 L 109.6875 83.46875 L 102.375 76.15625 z";function dq(e,t){e=Ln(e);let n=new G8(t,e);n._exitFullScreenPath=U5t,n._enterFullScreenPath=k5t;let i=document.createElement("button");i.type="button",i.className="cesium-button cesium-fullscreenButton",i.setAttribute("data-bind","attr: { title: tooltip },click: command,enable: isFullscreenEnabled,cesiumSvgPath: { path: isFullscreen ? _exitFullScreenPath : _enterFullScreenPath, width: 128, height: 128 }"),e.appendChild(i),ve.applyBindings(n,i),this._container=e,this._viewModel=n,this._element=i}Object.defineProperties(dq.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}}});dq.prototype.isDestroyed=function(){return!1};dq.prototype.destroy=function(){return this._viewModel.destroy(),ve.cleanNode(this._element),this._container.removeChild(this._element),le(this)};var W8=dq;function z5t(e,t){t.currentTarget.parentElement.parentElement.querySelector(`#${e.name}-expander`).classList.toggle("active"),t.currentTarget.textContent=t.currentTarget.textContent==="+"?"-":"+"}function d3e(e,t){ve.track(e);for(let n=0;n<e.sublayers.length;n++)d3e(e.sublayers[n],t)}function hq(e){return e.modelName==="FullModel"}function h3e(e){return e.modelName==="Overview"}function m3e(e){return h3e(e)||hq(e)}function f3e(e,t){if(m3e(e)){e.visibility=!1;for(let i=0;i<e.sublayers.length;i++)e.sublayers[i].visibility=!0;let n={name:e.name,modelName:e.modelName,disable:ve.observable(!1),index:t.sublayers.length};return t.topLayers.push(n),t.sublayers.push(e),n}}function V5t(e,t){if(m3e(e)){t.sublayers.forEach(i=>i.visibility=!1),t.sublayers[e.index].visibility=!0;let n=document.getElementById("bsl-wrapper");hq(e)?(t.currentLevel=t.selectedLevel,n.style.display="block"):(t.selectedLevel=t.currentLevel,t.currentLevel="All",n.style.display="none")}}async function j5t(e,t){try{let n=e.getAttributeNames();for(let i=0;i<n.length;i++)if(n[i]==="BldgLevel"){let r=e.getAttributeValues(n[i]);for(let o=0;o<r.length;o++)t.push(r[o])}t.sort((i,r)=>i-r),t.unshift("All")}catch(n){console.log(`There was an error getting attributes: ${n}`)}}function H5t(e){let t=this;this.levels=[],this.viewModel={sublayers:[],levels:this.levels,currentLevel:ve.observable(),selectedLevel:"All",topLayers:[{name:"Select a layer to explore...",disable:ve.observable(!0),index:-1}],currentLayer:ve.observable(),expandClickHandler:z5t,setOptionDisable:function(i,r){ve.applyBindingsToNode(i,{disable:r.disable},r)},defaultLayer:void 0},this.viewModel.currentLayer.subscribe(function(i){V5t(i,t.viewModel)});let n=e.sublayers;for(let i=0;i<n.length;i++){d3e(n[i],this.viewModel);let r=f3e(n[i],this.viewModel);l(r)&&(h3e(r)||!l(this.viewModel.defaultLayer)&&hq(r))&&(this.viewModel.defaultLayer=r)}if(this.viewModel.topLayers.length===1&&n.length>0){e.show=!1;let i={name:"Full Model",modelName:"FullModel",visibility:e.show,sublayers:e.sublayers};this.viewModel.defaultLayer=f3e(i,this.viewModel),this.viewModel.currentLayer.subscribe(function(r){e.show=hq(r)})}else this.viewModel.topLayers.length===1&&(this.viewModel.topLayers[0].name="Building layers not found");return j5t(e,this.levels),this.viewModel.currentLevel.subscribe(function(i){i!=="All"?e.filterByAttributes([{name:"BldgLevel",values:[i]}]):e.filterByAttributes()}),this.viewModel}var q8=H5t;function G5t(e,t){let n=document.getElementById(e),i=document.createElement("div");i.classList.add("cesium-viewer-i3s-explorer"),i.innerHTML=` <h3>Building explorer</h3> <select data-bind="options: topLayers, optionsText: 'name', optionsAfterRender: setOptionDisable, value: currentLayer" @@ -12813,9 +12813,9 @@ http://www.naturalearthdata.com/`,category:"Cesium ion",creationFunction:functio </li> </ul> </ul> - </div>`,n.appendChild(i);let r=new G8(t);ve.track(r),ve.applyBindings(r,n),l(r.defaultLayer)&&(r.currentLayer=r.defaultLayer)}var kle=N5t;function c3e(){this.showInstructions=!1;let e=this;this._command=Rn(function(){e.showInstructions=!e.showInstructions}),this._showClick=Rn(function(){e._touch=!1}),this._showTouch=Rn(function(){e._touch=!0}),this._touch=!1,this.tooltip="Navigation Instructions",ve.track(this,["tooltip","showInstructions","_touch"])}Object.defineProperties(c3e.prototype,{command:{get:function(){return this._command}},showClick:{get:function(){return this._showClick}},showTouch:{get:function(){return this._showTouch}}});var W8=c3e;function hq(e){let t=Ln(e.container),n=new W8,i=e.instructionsInitiallyVisible??!1;n.showInstructions=i,n._svgPath="M16,1.466C7.973,1.466,1.466,7.973,1.466,16c0,8.027,6.507,14.534,14.534,14.534c8.027,0,14.534-6.507,14.534-14.534C30.534,7.973,24.027,1.466,16,1.466z M17.328,24.371h-2.707v-2.596h2.707V24.371zM17.328,19.003v0.858h-2.707v-1.057c0-3.19,3.63-3.696,3.63-5.963c0-1.034-0.924-1.826-2.134-1.826c-1.254,0-2.354,0.924-2.354,0.924l-1.541-1.915c0,0,1.519-1.584,4.137-1.584c2.487,0,4.796,1.54,4.796,4.136C21.156,16.208,17.328,16.627,17.328,19.003z";let r=document.createElement("span");r.className="cesium-navigationHelpButton-wrapper",t.appendChild(r);let o=document.createElement("button");o.type="button",o.className="cesium-button cesium-toolbar-button cesium-navigation-help-button",o.setAttribute("data-bind","attr: { title: tooltip },click: command,cesiumSvgPath: { path: _svgPath, width: 32, height: 32 }"),r.appendChild(o);let s=document.createElement("div");s.className="cesium-navigation-help",s.setAttribute("data-bind",'css: { "cesium-navigation-help-visible" : showInstructions}'),r.appendChild(s);let a=document.createElement("button");a.type="button",a.className="cesium-navigation-button cesium-navigation-button-left",a.setAttribute("data-bind",'click: showClick, css: {"cesium-navigation-button-selected": !_touch, "cesium-navigation-button-unselected": _touch}');let c=document.createElement("img");c.src=Zt("Widgets/Images/NavigationHelp/Mouse.svg"),c.className="cesium-navigation-button-icon",c.style.width="25px",c.style.height="25px",a.appendChild(c),a.appendChild(document.createTextNode("Mouse"));let u=document.createElement("button");u.type="button",u.className="cesium-navigation-button cesium-navigation-button-right",u.setAttribute("data-bind",'click: showTouch, css: {"cesium-navigation-button-selected": _touch, "cesium-navigation-button-unselected": !_touch}');let f=document.createElement("img");f.src=Zt("Widgets/Images/NavigationHelp/Touch.svg"),f.className="cesium-navigation-button-icon",f.style.width="25px",f.style.height="25px",u.appendChild(f),u.appendChild(document.createTextNode("Touch")),s.appendChild(a),s.appendChild(u);let d=document.createElement("div");d.className="cesium-click-navigation-help cesium-navigation-help-instructions",d.setAttribute("data-bind",'css: { "cesium-click-navigation-help-visible" : !_touch}'),d.innerHTML=` <table> <tr> <td><img src="${Zt("Widgets/Images/NavigationHelp/MouseLeft.svg")}" width="48" height="48" /></td> <td> <div class="cesium-navigation-help-pan">Pan view</div> <div class="cesium-navigation-help-details">Left click + drag</div> </td> </tr> <tr> <td><img src="${Zt("Widgets/Images/NavigationHelp/MouseRight.svg")}" width="48" height="48" /></td> <td> <div class="cesium-navigation-help-zoom">Zoom view</div> <div class="cesium-navigation-help-details">Right click + drag, or</div> <div class="cesium-navigation-help-details">Mouse wheel scroll</div> </td> </tr> <tr> <td><img src="${Zt("Widgets/Images/NavigationHelp/MouseMiddle.svg")}" width="48" height="48" /></td> <td> <div class="cesium-navigation-help-rotate">Rotate view</div> <div class="cesium-navigation-help-details">Middle click + drag, or</div> <div class="cesium-navigation-help-details">CTRL + Left/Right click + drag</div> </td> </tr> </table>`,s.appendChild(d);let p=document.createElement("div");p.className="cesium-touch-navigation-help cesium-navigation-help-instructions",p.setAttribute("data-bind",'css: { "cesium-touch-navigation-help-visible" : _touch}'),p.innerHTML=` <table> <tr> <td><img src="${Zt("Widgets/Images/NavigationHelp/TouchDrag.svg")}" width="70" height="48" /></td> <td> <div class="cesium-navigation-help-pan">Pan view</div> <div class="cesium-navigation-help-details">One finger drag</div> </td> </tr> <tr> <td><img src="${Zt("Widgets/Images/NavigationHelp/TouchZoom.svg")}" width="70" height="48" /></td> <td> <div class="cesium-navigation-help-zoom">Zoom view</div> <div class="cesium-navigation-help-details">Two finger pinch</div> </td> </tr> <tr> <td><img src="${Zt("Widgets/Images/NavigationHelp/TouchTilt.svg")}" width="70" height="48" /></td> <td> <div class="cesium-navigation-help-rotate">Tilt view</div> <div class="cesium-navigation-help-details">Two finger drag, same direction</div> </td> </tr> <tr> <td><img src="${Zt("Widgets/Images/NavigationHelp/TouchRotate.svg")}" width="70" height="48" /></td> <td> <div class="cesium-navigation-help-tilt">Rotate view</div> <div class="cesium-navigation-help-details">Two finger drag, opposite direction</div> </td> </tr> </table>`,s.appendChild(p),ve.applyBindings(n,r),this._container=t,this._viewModel=n,this._wrapper=r,this._closeInstructions=function(g){r.contains(g.target)||(n.showInstructions=!1)},dn.supportsPointerEvents()?document.addEventListener("pointerdown",this._closeInstructions,!0):(document.addEventListener("mousedown",this._closeInstructions,!0),document.addEventListener("touchstart",this._closeInstructions,!0))}Object.defineProperties(hq.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}}});hq.prototype.isDestroyed=function(){return!1};hq.prototype.destroy=function(){return dn.supportsPointerEvents()?document.removeEventListener("pointerdown",this._closeInstructions,!0):(document.removeEventListener("mousedown",this._closeInstructions,!0),document.removeEventListener("touchstart",this._closeInstructions,!0)),ve.cleanNode(this._wrapper),this._container.removeChild(this._wrapper),le(this)};var q8=hq;var L5t="M 13.84375 7.03125 C 11.412798 7.03125 9.46875 8.975298 9.46875 11.40625 L 9.46875 11.59375 L 2.53125 7.21875 L 2.53125 24.0625 L 9.46875 19.6875 C 9.4853444 22.104033 11.423165 24.0625 13.84375 24.0625 L 25.875 24.0625 C 28.305952 24.0625 30.28125 22.087202 30.28125 19.65625 L 30.28125 11.40625 C 30.28125 8.975298 28.305952 7.03125 25.875 7.03125 L 13.84375 7.03125 z",F5t="M 27.34375 1.65625 L 5.28125 27.9375 L 8.09375 30.3125 L 30.15625 4.03125 L 27.34375 1.65625 z M 13.84375 7.03125 C 11.412798 7.03125 9.46875 8.975298 9.46875 11.40625 L 9.46875 11.59375 L 2.53125 7.21875 L 2.53125 24.0625 L 9.46875 19.6875 C 9.4724893 20.232036 9.5676108 20.7379 9.75 21.21875 L 21.65625 7.03125 L 13.84375 7.03125 z M 28.21875 7.71875 L 14.53125 24.0625 L 25.875 24.0625 C 28.305952 24.0625 30.28125 22.087202 30.28125 19.65625 L 30.28125 11.40625 C 30.28125 9.8371439 29.456025 8.4902779 28.21875 7.71875 z";function Ule(){this._cameraClicked=new be,this._closeClicked=new be,this.maxHeight=500,this.enableCamera=!1,this.isCameraTracking=!1,this.showInfo=!1,this.titleText="",this.description="",ve.track(this,["showInfo","titleText","description","maxHeight","enableCamera","isCameraTracking"]),this._loadingIndicatorHtml='<div class="cesium-infoBox-loadingContainer"><span class="cesium-infoBox-loading"></span></div>',this.cameraIconPath=void 0,ve.defineProperty(this,"cameraIconPath",{get:function(){return!this.enableCamera||this.isCameraTracking?F5t:L5t}}),ve.defineProperty(this,"_bodyless",{get:function(){return!l(this.description)||this.description.length===0}})}Ule.prototype.maxHeightOffset=function(e){return`${this.maxHeight-e}px`};Object.defineProperties(Ule.prototype,{cameraClicked:{get:function(){return this._cameraClicked}},closeClicked:{get:function(){return this._closeClicked}}});var Y8=Ule;function mq(e){e=Ln(e);let t=document.createElement("div");t.className="cesium-infoBox",t.setAttribute("data-bind",'css: { "cesium-infoBox-visible" : showInfo, "cesium-infoBox-bodyless" : _bodyless }'),e.appendChild(t);let n=document.createElement("div");n.className="cesium-infoBox-title",n.setAttribute("data-bind","text: titleText"),t.appendChild(n);let i=t.ownerDocument,r,o,s,a,c;function u(b){!l(r)||l(b)&&b.pointerId!==r||(r=void 0,t.classList.remove("cesium-infoBox-dragging"))}function f(b){if(!(b.button!==0||b.isPrimary===!1)){r=b.pointerId,o=b.clientX,s=b.clientY,a=t.offsetLeft,c=t.offsetTop,t.style.left=`${a}px`,t.style.top=`${c}px`,t.style.right="auto",t.classList.add("cesium-infoBox-dragging");try{n.setPointerCapture(b.pointerId)}catch{}b.preventDefault()}}function d(b){!l(r)||b.pointerId!==r||(t.style.left=`${a+b.clientX-o}px`,t.style.top=`${c+b.clientY-s}px`,b.preventDefault())}n.addEventListener("pointerdown",f),i.addEventListener("pointermove",d),i.addEventListener("pointerup",u),i.addEventListener("pointercancel",u);let p=document.createElement("button");p.type="button",p.className="cesium-button cesium-infoBox-camera",p.setAttribute("data-bind",'attr: { title: "Focus camera on object" },click: function () { cameraClicked.raiseEvent(this); },enable: enableCamera,cesiumSvgPath: { path: cameraIconPath, width: 32, height: 32 }'),t.appendChild(p);let g=document.createElement("button");g.type="button",g.className="cesium-infoBox-close",g.setAttribute("data-bind","click: function () { closeClicked.raiseEvent(this); }"),g.innerHTML="×",t.appendChild(g);let m=document.createElement("iframe");m.className="cesium-infoBox-iframe",m.setAttribute("sandbox","allow-same-origin allow-popups allow-forms"),m.setAttribute("data-bind","style : { maxHeight : maxHeightOffset(40) }"),m.setAttribute("allowfullscreen",!0),t.appendChild(m);let y=new Y8;ve.applyBindings(y,t),this._container=e,this._element=t,this._frame=m,this._viewModel=y,this._descriptionSubscription=void 0,this._titleElement=n,this._ownerDocument=i,this._handlePointerDown=f,this._handlePointerMove=d,this._stopDragging=u;let A=this;m.addEventListener("load",function(){let b=m.contentDocument,x=b.createElement("link");x.href=Zt("Widgets/InfoBox/InfoBoxDescription.css"),x.rel="stylesheet",x.type="text/css";let T=b.createElement("div");T.className="cesium-infoBox-description",b.head.appendChild(x),b.body.appendChild(T),A._descriptionSubscription=Cc(y,"description",function(E){m.style.height="5px",T.innerHTML=E;let v=null,S=T.firstElementChild;if(S!==null&&T.childNodes.length===1){let R=window.getComputedStyle(S);if(R!==null){let O=R["background-color"],L=z.fromCssColorString(O);l(L)&&L.alpha!==0&&(v=R["background-color"])}}t.style["background-color"]=v;let I=T.getBoundingClientRect().height;m.style.height=`${I}px`})}),m.setAttribute("src","about:blank")}Object.defineProperties(mq.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}},frame:{get:function(){return this._frame}}});mq.prototype.isDestroyed=function(){return!1};mq.prototype.destroy=function(){let e=this._container,t=this._ownerDocument;return this._titleElement.removeEventListener("pointerdown",this._handlePointerDown),t.removeEventListener("pointermove",this._handlePointerMove),t.removeEventListener("pointerup",this._stopDragging),t.removeEventListener("pointercancel",this._stopDragging),ve.cleanNode(this._element),e.removeChild(this._element),l(this._descriptionSubscription)&&this._descriptionSubscription.dispose(),le(this)};var X8=mq;function zle(e){this._scene=e.scene,this.lowFrameRateMessage=e.lowFrameRateMessage??"This application appears to be performing poorly on your system. Please try using a different web browser or updating your video drivers.",this.lowFrameRateMessageDismissed=!1,this.showingLowFrameRateMessage=!1,ve.track(this,["lowFrameRateMessage","lowFrameRateMessageDismissed","showingLowFrameRateMessage"]);let t=this;this._dismissMessage=Rn(function(){t.showingLowFrameRateMessage=!1,t.lowFrameRateMessageDismissed=!0});let n=n8.fromScene(e.scene);this._unsubscribeLowFrameRate=n.lowFrameRate.addEventListener(function(){t.lowFrameRateMessageDismissed||(t.showingLowFrameRateMessage=!0)}),this._unsubscribeNominalFrameRate=n.nominalFrameRate.addEventListener(function(){t.showingLowFrameRateMessage=!1})}Object.defineProperties(zle.prototype,{scene:{get:function(){return this._scene}},dismissMessage:{get:function(){return this._dismissMessage}}});zle.prototype.destroy=function(){return this._unsubscribeLowFrameRate(),this._unsubscribeNominalFrameRate(),le(this)};var K8=zle;function pq(e){let t=Ln(e.container),n=new K8(e),i=document.createElement("div");i.className="cesium-performance-watchdog-message-area",i.setAttribute("data-bind","visible: showingLowFrameRateMessage");let r=document.createElement("button");r.setAttribute("type","button"),r.className="cesium-performance-watchdog-message-dismiss",r.innerHTML="×",r.setAttribute("data-bind","click: dismissMessage"),i.appendChild(r);let o=document.createElement("div");o.className="cesium-performance-watchdog-message",o.setAttribute("data-bind","html: lowFrameRateMessage"),i.appendChild(o),t.appendChild(i),ve.applyBindings(n,i),this._container=t,this._viewModel=n,this._element=i}Object.defineProperties(pq.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}}});pq.prototype.isDestroyed=function(){return!1};pq.prototype.destroy=function(){return this._viewModel.destroy(),ve.cleanNode(this._element),this._container.removeChild(this._element),le(this)};var $8=pq;function gq(e){this._scene=e,this._orthographic=e.camera.frustum instanceof gn,this._flightInProgress=!1,this.dropDownVisible=!1,this.tooltipPerspective="Perspective Projection",this.tooltipOrthographic="Orthographic Projection",this.selectedTooltip=void 0,this.sceneMode=e.mode,ve.track(this,["_orthographic","_flightInProgress","sceneMode","dropDownVisible","tooltipPerspective","tooltipOrthographic"]);let t=this;ve.defineProperty(this,"selectedTooltip",function(){return t._orthographic?t.tooltipOrthographic:t.tooltipPerspective}),this._toggleDropDown=Rn(function(){t.sceneMode===re.SCENE2D||t._flightInProgress||(t.dropDownVisible=!t.dropDownVisible)}),this._eventHelper=new Xo,this._eventHelper.add(e.morphComplete,function(n,i,r,o){t.sceneMode=r,t._orthographic=r===re.SCENE2D||t._scene.camera.frustum instanceof gn}),this._eventHelper.add(e.preRender,function(){t._flightInProgress=l(e.camera._currentFlight)}),this._switchToPerspective=Rn(function(){t.sceneMode!==re.SCENE2D&&(t._scene.camera.switchToPerspectiveFrustum(),t._orthographic=!1,t.dropDownVisible=!1)}),this._switchToOrthographic=Rn(function(){t.sceneMode!==re.SCENE2D&&(t._scene.camera.switchToOrthographicFrustum(),t._orthographic=!0,t.dropDownVisible=!1)}),this._sceneMode=re}Object.defineProperties(gq.prototype,{scene:{get:function(){return this._scene}},toggleDropDown:{get:function(){return this._toggleDropDown}},switchToPerspective:{get:function(){return this._switchToPerspective}},switchToOrthographic:{get:function(){return this._switchToOrthographic}},isOrthographicProjection:{get:function(){return this._orthographic}}});gq.prototype.isDestroyed=function(){return!1};gq.prototype.destroy=function(){this._eventHelper.removeAll(),le(this)};var J8=gq;var B5t="M 28.15625,10.4375 9.125,13.21875 13.75,43.25 41.75,55.09375 50.8125,37 54.5,11.9375 z m 0.125,3 19.976451,0.394265 L 43.03125,16.875 22.6875,14.28125 z M 50.971746,15.705477 47.90625,36.03125 42.53125,46 44.84375,19.3125 z M 12.625,16.03125 l 29.15625,3.6875 -2.65625,31 L 16.4375,41.125 z",k5t="m 31.560594,6.5254438 -20.75,12.4687502 0.1875,24.5625 22.28125,11.8125 19.5,-12 0.65625,-0.375 0,-0.75 0.0312,-23.21875 z m 0.0625,3.125 16.65625,9.5000002 -16.125,10.28125 -17.34375,-9.71875 z m 18.96875,11.1875002 0.15625,20.65625 -17.46875,10.59375 0.15625,-20.28125 z m -37.0625,1.25 17.21875,9.625 -0.15625,19.21875 -16.9375,-9 z";function _q(e,t){e=Ln(e);let n=new J8(t);n._perspectivePath=B5t,n._orthographicPath=k5t;let i=document.createElement("span");i.className="cesium-projectionPicker-wrapper cesium-toolbar-button",e.appendChild(i);let r=document.createElement("button");r.type="button",r.className="cesium-button cesium-toolbar-button",r.setAttribute("data-bind",'css: { "cesium-projectionPicker-buttonPerspective": !_orthographic, "cesium-projectionPicker-buttonOrthographic": _orthographic, "cesium-button-disabled" : sceneMode === _sceneMode.SCENE2D || _flightInProgress, "cesium-projectionPicker-selected": dropDownVisible },attr: { title: selectedTooltip },click: toggleDropDown'),r.innerHTML='<!-- ko cesiumSvgPath: { path: _perspectivePath, width: 64, height: 64, css: "cesium-projectionPicker-iconPerspective" } --><!-- /ko --><!-- ko cesiumSvgPath: { path: _orthographicPath, width: 64, height: 64, css: "cesium-projectionPicker-iconOrthographic" } --><!-- /ko -->',i.appendChild(r);let o=document.createElement("button");o.type="button",o.className="cesium-button cesium-toolbar-button cesium-projectionPicker-dropDown-icon",o.setAttribute("data-bind",'css: { "cesium-projectionPicker-visible" : (dropDownVisible && _orthographic), "cesium-projectionPicker-none" : !_orthographic, "cesium-projectionPicker-hidden" : !dropDownVisible },attr: { title: tooltipPerspective },click: switchToPerspective,cesiumSvgPath: { path: _perspectivePath, width: 64, height: 64 }'),i.appendChild(o);let s=document.createElement("button");s.type="button",s.className="cesium-button cesium-toolbar-button cesium-projectionPicker-dropDown-icon",s.setAttribute("data-bind",'css: { "cesium-projectionPicker-visible" : (dropDownVisible && !_orthographic), "cesium-projectionPicker-none" : _orthographic, "cesium-projectionPicker-hidden" : !dropDownVisible},attr: { title: tooltipOrthographic },click: switchToOrthographic,cesiumSvgPath: { path: _orthographicPath, width: 64, height: 64 }'),i.appendChild(s),ve.applyBindings(n,i),this._viewModel=n,this._container=e,this._wrapper=i,this._closeDropDown=function(a){i.contains(a.target)||(n.dropDownVisible=!1)},dn.supportsPointerEvents()?document.addEventListener("pointerdown",this._closeDropDown,!0):(document.addEventListener("mousedown",this._closeDropDown,!0),document.addEventListener("touchstart",this._closeDropDown,!0))}Object.defineProperties(_q.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}}});_q.prototype.isDestroyed=function(){return!1};_q.prototype.destroy=function(){return this._viewModel.destroy(),dn.supportsPointerEvents()?document.removeEventListener("pointerdown",this._closeDropDown,!0):(document.removeEventListener("mousedown",this._closeDropDown,!0),document.removeEventListener("touchstart",this._closeDropDown,!0)),ve.cleanNode(this._wrapper),this._container.removeChild(this._wrapper),le(this)};var Z8=_q;function yq(e,t){this._scene=e;let n=this,i=function(r,o,s,a){n.sceneMode=s,n.dropDownVisible=!1};this._eventHelper=new Xo,this._eventHelper.add(e.morphStart,i),this._duration=t??2,this.sceneMode=e.mode,this.dropDownVisible=!1,this.tooltip2D="2D",this.tooltip3D="3D",this.tooltipColumbusView="Columbus View",ve.track(this,["sceneMode","dropDownVisible","tooltip2D","tooltip3D","tooltipColumbusView"]),this.selectedTooltip=void 0,ve.defineProperty(this,"selectedTooltip",function(){let r=n.sceneMode;return r===re.SCENE2D?n.tooltip2D:r===re.SCENE3D?n.tooltip3D:n.tooltipColumbusView}),this._toggleDropDown=Rn(function(){n.dropDownVisible=!n.dropDownVisible}),this._morphTo2D=Rn(function(){e.morphTo2D(n._duration)}),this._morphTo3D=Rn(function(){e.morphTo3D(n._duration)}),this._morphToColumbusView=Rn(function(){e.morphToColumbusView(n._duration)}),this._sceneMode=re}Object.defineProperties(yq.prototype,{scene:{get:function(){return this._scene}},duration:{get:function(){return this._duration},set:function(e){this._duration=e}},toggleDropDown:{get:function(){return this._toggleDropDown}},morphTo2D:{get:function(){return this._morphTo2D}},morphTo3D:{get:function(){return this._morphTo3D}},morphToColumbusView:{get:function(){return this._morphToColumbusView}}});yq.prototype.isDestroyed=function(){return!1};yq.prototype.destroy=function(){this._eventHelper.removeAll(),le(this)};var Q8=yq;var U5t="m 32.401392,4.9330437 c -7.087603,0 -14.096095,2.884602 -19.10793,7.8946843 -5.0118352,5.010083 -7.9296167,11.987468 -7.9296167,19.072999 0,7.085531 2.9177815,14.097848 7.9296167,19.107931 4.837653,4.835961 11.541408,7.631372 18.374354,7.82482 0.05712,0.01231 0.454119,0.139729 0.454119,0.139729 l 0.03493,-0.104797 c 0.08246,7.84e-4 0.162033,0.03493 0.244525,0.03493 0.08304,0 0.161515,-0.03414 0.244526,-0.03493 l 0.03493,0.104797 c 0,0 0.309474,-0.129487 0.349323,-0.139729 6.867765,-0.168094 13.582903,-2.965206 18.444218,-7.82482 2.558195,-2.5573 4.551081,-5.638134 5.903547,-8.977584 1.297191,-3.202966 2.02607,-6.661489 2.02607,-10.130347 0,-6.237309 -2.366261,-12.31219 -6.322734,-17.116794 -0.0034,-0.02316 0.0049,-0.04488 0,-0.06986 -0.01733,-0.08745 -0.104529,-0.278855 -0.104797,-0.279458 -5.31e-4,-0.0012 -0.522988,-0.628147 -0.523984,-0.62878 -3.47e-4,-2.2e-4 -0.133444,-0.03532 -0.244525,-0.06987 C 51.944299,13.447603 51.751076,13.104317 51.474391,12.827728 46.462556,7.8176457 39.488996,4.9330437 32.401392,4.9330437 z m -2.130866,3.5281554 0.104797,9.6762289 c -4.111695,-0.08361 -7.109829,-0.423664 -9.257041,-0.943171 1.198093,-2.269271 2.524531,-4.124404 3.91241,-5.414496 2.167498,-2.0147811 3.950145,-2.8540169 5.239834,-3.3185619 z m 2.794579,0 c 1.280302,0.4754953 3.022186,1.3285948 5.065173,3.2486979 1.424667,1.338973 2.788862,3.303645 3.982275,5.728886 -2.29082,0.403367 -5.381258,0.621049 -8.942651,0.698645 L 33.065105,8.4611991 z m 5.728886,0.2445256 c 4.004072,1.1230822 7.793098,3.1481363 10.724195,6.0782083 0.03468,0.03466 0.07033,0.06991 0.104797,0.104797 -0.45375,0.313891 -0.923054,0.663002 -1.956205,1.082899 -0.647388,0.263114 -1.906242,0.477396 -2.829511,0.733577 -1.382296,-2.988132 -3.027146,-5.368585 -4.785716,-7.0213781 -0.422866,-0.397432 -0.835818,-0.6453247 -1.25756,-0.9781032 z m -15.33525,0.7685092 c -0.106753,0.09503 -0.207753,0.145402 -0.31439,0.244526 -1.684973,1.5662541 -3.298068,3.8232211 -4.680919,6.5672591 -0.343797,-0.14942 -1.035052,-0.273198 -1.292493,-0.419186 -0.956528,-0.542427 -1.362964,-1.022024 -1.537018,-1.292493 -0.0241,-0.03745 -0.01868,-0.0401 -0.03493,-0.06986 2.250095,-2.163342 4.948824,-3.869984 7.859752,-5.0302421 z m -9.641296,7.0912431 c 0.464973,0.571618 0.937729,1.169056 1.956205,1.746612 0.349907,0.198425 1.107143,0.335404 1.537018,0.523983 -1.20166,3.172984 -1.998037,7.051901 -2.165798,11.772162 C 14.256557,30.361384 12.934823,30.161483 12.280427,29.90959 10.644437,29.279855 9.6888882,28.674891 9.1714586,28.267775 8.6540289,27.860658 8.6474751,27.778724 8.6474751,27.778724 l -0.069864,0.03493 C 9.3100294,23.691285 11.163248,19.798527 13.817445,16.565477 z m 37.552149,0.523984 c 2.548924,3.289983 4.265057,7.202594 4.890513,11.318043 -0.650428,0.410896 -1.756876,1.001936 -3.563088,1.606882 -1.171552,0.392383 -3.163859,0.759153 -4.960377,1.117832 -0.04367,-4.752703 -0.784809,-8.591423 -1.88634,-11.807094 0.917574,-0.263678 2.170552,-0.486495 2.864443,-0.76851 1.274693,-0.518066 2.003942,-1.001558 2.654849,-1.467153 z m -31.439008,2.619917 c 2.487341,0.672766 5.775813,1.137775 10.479669,1.222628 l 0.104797,10.689263 0,0.03493 0,0.733577 c -5.435005,-0.09059 -9.512219,-0.519044 -12.610536,-1.117831 0.106127,-4.776683 0.879334,-8.55791 2.02607,-11.562569 z m 23.264866,0.31439 c 1.073459,3.067541 1.833795,6.821314 1.816476,11.702298 -3.054474,0.423245 -7.062018,0.648559 -11.702298,0.698644 l 0,-0.838373 -0.104796,-10.654331 c 4.082416,-0.0864 7.404468,-0.403886 9.990618,-0.908238 z M 8.2632205,30.922625 c 0.7558676,0.510548 1.5529563,1.013339 3.0041715,1.57195 0.937518,0.360875 2.612202,0.647642 3.91241,0.978102 0.112814,3.85566 0.703989,7.107756 1.606883,9.920754 -1.147172,-0.324262 -2.644553,-0.640648 -3.423359,-0.978102 -1.516688,-0.657177 -2.386627,-1.287332 -2.864443,-1.71168 -0.477816,-0.424347 -0.489051,-0.489051 -0.489051,-0.489051 L 9.8002387,40.319395 C 8.791691,37.621767 8.1584238,34.769583 8.1584238,31.900727 c 0,-0.330153 0.090589,-0.648169 0.1047967,-0.978102 z m 48.2763445,0.419186 c 0.0047,0.188973 0.06986,0.36991 0.06986,0.558916 0,2.938869 -0.620228,5.873558 -1.676747,8.628261 -0.07435,0.07583 -0.06552,0.07411 -0.454119,0.349323 -0.606965,0.429857 -1.631665,1.042044 -3.318562,1.676747 -1.208528,0.454713 -3.204964,0.850894 -5.135038,1.25756 0.84593,-2.765726 1.41808,-6.005357 1.606883,-9.815957 2.232369,-0.413371 4.483758,-0.840201 5.938479,-1.327425 1.410632,-0.472457 2.153108,-0.89469 2.96924,-1.327425 z m -38.530252,2.864443 c 3.208141,0.56697 7.372279,0.898588 12.575603,0.978103 l 0.174662,9.885821 c -4.392517,-0.06139 -8.106722,-0.320566 -10.863925,-0.803441 -1.051954,-2.664695 -1.692909,-6.043794 -1.88634,-10.060483 z m 26.793022,0.31439 c -0.246298,3.923551 -0.877762,7.263679 -1.816476,9.885822 -2.561957,0.361954 -5.766249,0.560708 -9.431703,0.62878 l -0.174661,-9.815957 c 4.491734,-0.04969 8.334769,-0.293032 11.42284,-0.698645 z M 12.035901,44.860585 c 0.09977,0.04523 0.105535,0.09465 0.209594,0.139729 1.337656,0.579602 3.441099,1.058072 5.589157,1.537018 1.545042,3.399208 3.548524,5.969402 5.589157,7.789888 -3.034411,-1.215537 -5.871615,-3.007978 -8.174142,-5.309699 -1.245911,-1.245475 -2.271794,-2.662961 -3.213766,-4.156936 z m 40.69605,0 c -0.941972,1.493975 -1.967855,2.911461 -3.213765,4.156936 -2.74253,2.741571 -6.244106,4.696717 -9.955686,5.868615 0.261347,-0.241079 0.507495,-0.394491 0.768509,-0.663713 1.674841,-1.727516 3.320792,-4.181056 4.645987,-7.265904 2.962447,-0.503021 5.408965,-1.122293 7.161107,-1.781544 0.284034,-0.106865 0.337297,-0.207323 0.593848,-0.31439 z m -31.404076,2.305527 c 2.645807,0.376448 5.701178,0.649995 9.466635,0.698645 l 0.139729,7.789888 c -1.38739,-0.480844 -3.316218,-1.29837 -5.659022,-3.388427 -1.388822,-1.238993 -2.743668,-3.0113 -3.947342,-5.100106 z m 20.365491,0.104797 c -1.04872,2.041937 -2.174337,3.779068 -3.353494,4.995309 -1.853177,1.911459 -3.425515,2.82679 -4.611055,3.353494 l -0.139729,-7.789887 c 3.13091,-0.05714 5.728238,-0.278725 8.104278,-0.558916 z",z5t="m 2.9825053,17.550598 0,1.368113 0,26.267766 0,1.368113 1.36811,0 54.9981397,0 1.36811,0 0,-1.368113 0,-26.267766 0,-1.368113 -1.36811,0 -54.9981397,0 -1.36811,0 z m 2.73623,2.736226 10.3292497,0 0,10.466063 -10.3292497,0 0,-10.466063 z m 13.0654697,0 11.69737,0 0,10.466063 -11.69737,0 0,-10.466063 z m 14.43359,0 11.69737,0 0,10.466063 -11.69737,0 0,-10.466063 z m 14.43359,0 10.32926,0 0,10.466063 -10.32926,0 0,-10.466063 z m -41.9326497,13.202288 10.3292497,0 0,10.329252 -10.3292497,0 0,-10.329252 z m 13.0654697,0 11.69737,0 0,10.329252 -11.69737,0 0,-10.329252 z m 14.43359,0 11.69737,0 0,10.329252 -11.69737,0 0,-10.329252 z m 14.43359,0 10.32926,0 0,10.329252 -10.32926,0 0,-10.329252 z",V5t="m 14.723969,17.675598 -0.340489,0.817175 -11.1680536,26.183638 -0.817175,1.872692 2.076986,0 54.7506996,0 2.07698,0 -0.81717,-1.872692 -11.16805,-26.183638 -0.34049,-0.817175 -0.91933,0 -32.414586,0 -0.919322,0 z m 1.838643,2.723916 6.196908,0 -2.928209,10.418977 -7.729111,0 4.460412,-10.418977 z m 9.02297,0 4.903049,0 0,10.418977 -7.831258,0 2.928209,-10.418977 z m 7.626964,0 5.584031,0 2.62176,10.418977 -8.205791,0 0,-10.418977 z m 8.410081,0 5.51593,0 4.46042,10.418977 -7.38863,0 -2.58772,-10.418977 z m -30.678091,13.142892 8.103649,0 -2.89416,10.282782 -9.6018026,0 4.3923136,-10.282782 z m 10.929711,0 8.614384,0 0,10.282782 -11.508544,0 2.89416,-10.282782 z m 11.338299,0 8.852721,0 2.58772,10.282782 -11.440441,0 0,-10.282782 z m 11.678781,0 7.86531,0 4.39231,10.282782 -9.6699,0 -2.58772,-10.282782 z";function Aq(e,t,n){e=Ln(e);let i=new Q8(t,n);i._globePath=U5t,i._flatMapPath=z5t,i._columbusViewPath=V5t;let r=document.createElement("span");r.className="cesium-sceneModePicker-wrapper cesium-toolbar-button",e.appendChild(r);let o=document.createElement("button");o.type="button",o.className="cesium-button cesium-toolbar-button",o.setAttribute("data-bind",'css: { "cesium-sceneModePicker-button2D": sceneMode === _sceneMode.SCENE2D, "cesium-sceneModePicker-button3D": sceneMode === _sceneMode.SCENE3D, "cesium-sceneModePicker-buttonColumbusView": sceneMode === _sceneMode.COLUMBUS_VIEW, "cesium-sceneModePicker-selected": dropDownVisible },attr: { title: selectedTooltip },click: toggleDropDown'),o.innerHTML='<!-- ko cesiumSvgPath: { path: _globePath, width: 64, height: 64, css: "cesium-sceneModePicker-slide-svg cesium-sceneModePicker-icon3D" } --><!-- /ko --><!-- ko cesiumSvgPath: { path: _flatMapPath, width: 64, height: 64, css: "cesium-sceneModePicker-slide-svg cesium-sceneModePicker-icon2D" } --><!-- /ko --><!-- ko cesiumSvgPath: { path: _columbusViewPath, width: 64, height: 64, css: "cesium-sceneModePicker-slide-svg cesium-sceneModePicker-iconColumbusView" } --><!-- /ko -->',r.appendChild(o);let s=document.createElement("button");s.type="button",s.className="cesium-button cesium-toolbar-button cesium-sceneModePicker-dropDown-icon",s.setAttribute("data-bind",'css: { "cesium-sceneModePicker-visible" : (dropDownVisible && (sceneMode !== _sceneMode.SCENE3D)) || (!dropDownVisible && (sceneMode === _sceneMode.SCENE3D)), "cesium-sceneModePicker-none" : sceneMode === _sceneMode.SCENE3D, "cesium-sceneModePicker-hidden" : !dropDownVisible },attr: { title: tooltip3D },click: morphTo3D,cesiumSvgPath: { path: _globePath, width: 64, height: 64 }'),r.appendChild(s);let a=document.createElement("button");a.type="button",a.className="cesium-button cesium-toolbar-button cesium-sceneModePicker-dropDown-icon",a.setAttribute("data-bind",'css: { "cesium-sceneModePicker-visible" : (dropDownVisible && (sceneMode !== _sceneMode.SCENE2D)), "cesium-sceneModePicker-none" : sceneMode === _sceneMode.SCENE2D, "cesium-sceneModePicker-hidden" : !dropDownVisible },attr: { title: tooltip2D },click: morphTo2D,cesiumSvgPath: { path: _flatMapPath, width: 64, height: 64 }'),r.appendChild(a);let c=document.createElement("button");c.type="button",c.className="cesium-button cesium-toolbar-button cesium-sceneModePicker-dropDown-icon",c.setAttribute("data-bind",'css: { "cesium-sceneModePicker-visible" : (dropDownVisible && (sceneMode !== _sceneMode.COLUMBUS_VIEW)) || (!dropDownVisible && (sceneMode === _sceneMode.COLUMBUS_VIEW)), "cesium-sceneModePicker-none" : sceneMode === _sceneMode.COLUMBUS_VIEW, "cesium-sceneModePicker-hidden" : !dropDownVisible},attr: { title: tooltipColumbusView },click: morphToColumbusView,cesiumSvgPath: { path: _columbusViewPath, width: 64, height: 64 }'),r.appendChild(c),ve.applyBindings(i,r),this._viewModel=i,this._container=e,this._wrapper=r,this._closeDropDown=function(u){r.contains(u.target)||(i.dropDownVisible=!1)},dn.supportsPointerEvents()?document.addEventListener("pointerdown",this._closeDropDown,!0):(document.addEventListener("mousedown",this._closeDropDown,!0),document.addEventListener("touchstart",this._closeDropDown,!0))}Object.defineProperties(Aq.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}}});Aq.prototype.isDestroyed=function(){return!1};Aq.prototype.destroy=function(){return this._viewModel.destroy(),dn.supportsPointerEvents()?document.removeEventListener("pointerdown",this._closeDropDown,!0):(document.removeEventListener("mousedown",this._closeDropDown,!0),document.removeEventListener("touchstart",this._closeDropDown,!0)),ve.cleanNode(this._wrapper),this._container.removeChild(this._wrapper),le(this)};var ej=Aq;var j5t=new U,bq="-1000px";function tj(e,t,n){this._scene=e,this._screenPositionX=bq,this._screenPositionY=bq,this._tweens=e.tweens,this._container=n??document.body,this._selectionIndicatorElement=t,this._scale=1,this.position=void 0,this.showSelection=!1,ve.track(this,["position","_screenPositionX","_screenPositionY","_scale","showSelection"]),this.isVisible=void 0,ve.defineProperty(this,"isVisible",{get:function(){return this.showSelection&&l(this.position)}}),ve.defineProperty(this,"_transform",{get:function(){return`scale(${this._scale})`}}),this.computeScreenSpacePosition=function(i,r){return dr.worldToWindowCoordinates(e,i,r)}}tj.prototype.update=function(){if(this.showSelection&&l(this.position)){let e=this.computeScreenSpacePosition(this.position,j5t);if(!l(e))this._screenPositionX=bq,this._screenPositionY=bq;else{let t=this._container,n=t.parentNode.clientWidth,i=t.parentNode.clientHeight,r=this._selectionIndicatorElement.clientWidth,o=r*.5;e.x=Math.min(Math.max(e.x,-r),n+r)-o,e.y=Math.min(Math.max(e.y,-r),i+r)-o,this._screenPositionX=`${Math.floor(e.x+.25)}px`,this._screenPositionY=`${Math.floor(e.y+.25)}px`}}};tj.prototype.animateAppear=function(){this._tweens.addProperty({object:this,property:"_scale",startValue:2,stopValue:1,duration:.8,easingFunction:Ls.EXPONENTIAL_OUT})};tj.prototype.animateDepart=function(){this._tweens.addProperty({object:this,property:"_scale",startValue:this._scale,stopValue:1.5,duration:.8,easingFunction:Ls.EXPONENTIAL_OUT})};Object.defineProperties(tj.prototype,{container:{get:function(){return this._container}},selectionIndicatorElement:{get:function(){return this._selectionIndicatorElement}},scene:{get:function(){return this._scene}}});var nj=tj;function xq(e,t){e=Ln(e),this._container=e;let n=document.createElement("div");n.className="cesium-selection-wrapper",n.setAttribute("data-bind",'style: { "top" : _screenPositionY, "left" : _screenPositionX },css: { "cesium-selection-wrapper-visible" : isVisible }'),e.appendChild(n),this._element=n;let i="http://www.w3.org/2000/svg",r="M -34 -34 L -34 -11.25 L -30 -15.25 L -30 -30 L -15.25 -30 L -11.25 -34 L -34 -34 z M 11.25 -34 L 15.25 -30 L 30 -30 L 30 -15.25 L 34 -11.25 L 34 -34 L 11.25 -34 z M -34 11.25 L -34 34 L -11.25 34 L -15.25 30 L -30 30 L -30 15.25 L -34 11.25 z M 34 11.25 L 30 15.25 L 30 30 L 15.25 30 L 11.25 34 L 34 34 L 34 11.25 z",o=document.createElementNS(i,"svg:svg");o.setAttribute("width",160),o.setAttribute("height",160),o.setAttribute("viewBox","0 0 160 160");let s=document.createElementNS(i,"g");s.setAttribute("transform","translate(80,80)"),o.appendChild(s);let a=document.createElementNS(i,"path");a.setAttribute("data-bind","attr: { transform: _transform }"),a.setAttribute("d",r),s.appendChild(a),n.appendChild(o);let c=new nj(t,this._element,this._container);this._viewModel=c,ve.applyBindings(this._viewModel,this._element)}Object.defineProperties(xq.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}}});xq.prototype.isDestroyed=function(){return!1};xq.prototype.destroy=function(){let e=this._container;return ve.cleanNode(this._element),e.removeChild(this._element),le(this)};var ij=xq;function JC(e,t,n){this._color=e,this._height=t,this._base=n??0}JC.prototype.getHeight=function(){return this._height};JC.prototype.getBase=function(){return this._base};JC.prototype.getStartTime=function(){return this._start};JC.prototype.getStopTime=function(){return this._stop};JC.prototype.setRange=function(e,t){this._start=e,this._stop=t};JC.prototype.render=function(e){let t="";if(this._start&&this._stop&&this._color){let n=K.secondsDifference(this._start,e.epochJulian),i=Math.round(e.timeBarWidth*e.getAlpha(n)),r=K.secondsDifference(this._stop,e.epochJulian),o=Math.round(e.timeBarWidth*e.getAlpha(r))-i;i<0&&(o+=i,i=0),i+o>e.timeBarWidth&&(o=e.timeBarWidth-i),o>0&&(t=`<span class="cesium-timeline-highlight" style="left: ${i.toString()}px; width: ${o.toString()}px; bottom: ${this._base.toString()}px; height: ${this._height}px; background-color: ${this._color};"></span>`)}return t};var rj=JC;function l3e(e,t,n,i){this.interval=e,this.height=t,this.color=n||new z(.5,.5,.5,1),this.backgroundColor=i||new z(0,0,0,0)}l3e.prototype.render=function(e,t){let n=this.interval.start,i=this.interval.stop,r=t.startJulian,o=K.addSeconds(t.startJulian,t.duration,new K);if(K.lessThan(n,r)&&K.greaterThan(i,o))e.fillStyle=this.color.toCssColorString(),e.fillRect(0,t.y,t.timeBarWidth,this.height);else if(K.lessThanOrEquals(n,o)&&K.greaterThanOrEquals(i,r)){let s,a,c;for(s=0;s<t.timeBarWidth;++s){let u=K.addSeconds(t.startJulian,s/t.timeBarWidth*t.duration,new K);!l(a)&&K.greaterThanOrEquals(u,n)?a=s:!l(c)&&K.greaterThanOrEquals(u,i)&&(c=s)}e.fillStyle=this.backgroundColor.toCssColorString(),e.fillRect(0,t.y,t.timeBarWidth,this.height),l(a)&&(l(c)||(c=t.timeBarWidth),e.fillStyle=this.color.toCssColorString(),e.fillRect(a,t.y,Math.max(c-a,1),this.height))}};var oj=l3e;var Vle=1e12,Oh={none:0,scrub:1,slide:2,zoom:3,touchOnly:4},Eu={none:0,scrub:1,slideZoom:2,singleTap:3,ignore:4},Xb=[.001,.002,.005,.01,.02,.05,.1,.25,.5,1,2,5,10,15,30,60,120,300,600,900,1800,3600,7200,14400,21600,43200,86400,172800,345600,604800,1296e3,2592e3,5184e3,7776e3,15552e3,31536e3,63072e3,126144e3,15768e4,31536e4,63072e4,126144e4,15768e5,31536e5,63072e5,126144e5,15768e6,31536e6],H5t=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function Cu(e,t){e=Ln(e);let n=e.ownerDocument;this.container=e;let i=n.createElement("div");i.className="cesium-timeline-main",e.appendChild(i),this._topDiv=i,this._endJulian=void 0,this._epochJulian=void 0,this._lastXPos=void 0,this._scrubElement=void 0,this._startJulian=void 0,this._timeBarSecondsSpan=void 0,this._clock=t,this._scrubJulian=t.currentTime,this._mainTicSpan=-1,this._mouseMode=Oh.none,this._touchMode=Eu.none,this._touchState={centerX:0,spanX:0},this._mouseX=0,this._timelineDrag=0,this._timelineDragLocation=void 0,this._lastHeight=void 0,this._lastWidth=void 0,this._topDiv.innerHTML='<div class="cesium-timeline-bar"></div><div class="cesium-timeline-trackContainer"><canvas class="cesium-timeline-tracks" width="10" height="1"></canvas></div><div class="cesium-timeline-needle"></div><span class="cesium-timeline-ruler"></span>',this._timeBarEle=this._topDiv.childNodes[0],this._trackContainer=this._topDiv.childNodes[1],this._trackListEle=this._topDiv.childNodes[1].childNodes[0],this._needleEle=this._topDiv.childNodes[2],this._rulerEle=this._topDiv.childNodes[3],this._context=this._trackListEle.getContext("2d"),this._trackList=[],this._highlightRanges=[],this.zoomTo(t.startTime,t.stopTime),this._onMouseDown=G5t(this),this._onMouseUp=W5t(this),this._onMouseMove=q5t(this),this._onMouseWheel=Y5t(this),this._onTouchStart=X5t(this),this._onTouchMove=$5t(this),this._onTouchEnd=K5t(this);let r=this._timeBarEle;n.addEventListener("mouseup",this._onMouseUp,!1),n.addEventListener("mousemove",this._onMouseMove,!1),r.addEventListener("mousedown",this._onMouseDown,!1),r.addEventListener("DOMMouseScroll",this._onMouseWheel,!1),r.addEventListener("mousewheel",this._onMouseWheel,!1),r.addEventListener("touchstart",this._onTouchStart,!1),r.addEventListener("touchmove",this._onTouchMove,!1),r.addEventListener("touchend",this._onTouchEnd,!1),r.addEventListener("touchcancel",this._onTouchEnd,!1),this._topDiv.oncontextmenu=function(){return!1},t.onTick.addEventListener(this.updateFromClock,this),this.updateFromClock()}Cu.prototype.addEventListener=function(e,t,n){this._topDiv.addEventListener(e,t,n)};Cu.prototype.removeEventListener=function(e,t,n){this._topDiv.removeEventListener(e,t,n)};Cu.prototype.isDestroyed=function(){return!1};Cu.prototype.destroy=function(){this._clock.onTick.removeEventListener(this.updateFromClock,this);let e=this.container.ownerDocument;e.removeEventListener("mouseup",this._onMouseUp,!1),e.removeEventListener("mousemove",this._onMouseMove,!1);let t=this._timeBarEle;t.removeEventListener("mousedown",this._onMouseDown,!1),t.removeEventListener("DOMMouseScroll",this._onMouseWheel,!1),t.removeEventListener("mousewheel",this._onMouseWheel,!1),t.removeEventListener("touchstart",this._onTouchStart,!1),t.removeEventListener("touchmove",this._onTouchMove,!1),t.removeEventListener("touchend",this._onTouchEnd,!1),t.removeEventListener("touchcancel",this._onTouchEnd,!1),this.container.removeChild(this._topDiv),le(this)};Cu.prototype.addHighlightRange=function(e,t,n){let i=new rj(e,t,n);return this._highlightRanges.push(i),this.resize(),i};Cu.prototype.addTrack=function(e,t,n,i){let r=new oj(e,t,n,i);return this._trackList.push(r),this._lastHeight=void 0,this.resize(),r};Cu.prototype.zoomTo=function(e,t){if(this._startJulian=e,this._endJulian=t,this._timeBarSecondsSpan=K.secondsDifference(t,e),this._clock&&this._clock.clockRange!==Rs.UNBOUNDED){let i=this._clock.startTime,r=this._clock.stopTime,o=K.secondsDifference(r,i),s=K.secondsDifference(i,this._startJulian),a=K.secondsDifference(r,this._endJulian);this._timeBarSecondsSpan>=o?(this._timeBarSecondsSpan=o,this._startJulian=this._clock.startTime,this._endJulian=this._clock.stopTime):s>0?(this._endJulian=K.addSeconds(this._endJulian,s,new K),this._startJulian=i,this._timeBarSecondsSpan=K.secondsDifference(this._endJulian,this._startJulian)):a<0&&(this._startJulian=K.addSeconds(this._startJulian,a,new K),this._endJulian=r,this._timeBarSecondsSpan=K.secondsDifference(this._endJulian,this._startJulian))}this._makeTics();let n=document.createEvent("Event");n.initEvent("setzoom",!0,!0),n.startJulian=this._startJulian,n.endJulian=this._endJulian,n.epochJulian=this._epochJulian,n.totalSpan=this._timeBarSecondsSpan,n.mainTicSpan=this._mainTicSpan,this._topDiv.dispatchEvent(n)};Cu.prototype.zoomFrom=function(e){let t=K.secondsDifference(this._scrubJulian,this._startJulian);e>1||t<0||t>this._timeBarSecondsSpan?t=this._timeBarSecondsSpan*.5:t+=t-this._timeBarSecondsSpan*.5;let n=this._timeBarSecondsSpan-t;this.zoomTo(K.addSeconds(this._startJulian,t-t*e,new K),K.addSeconds(this._endJulian,n*e-n,new K))};function jle(e){return e<10?`0${e.toString()}`:e.toString()}Cu.prototype.makeLabel=function(e){let t=K.toGregorianDate(e),n=t.millisecond,i=" UTC";if(n>0&&this._timeBarSecondsSpan<3600){for(i=Math.floor(n).toString();i.length<3;)i=`0${i}`;i=`.${i}`}return`${H5t[t.month-1]} ${t.day} ${t.year} ${jle(t.hour)}:${jle(t.minute)}:${jle(t.second)}${i}`};Cu.prototype.smallestTicInPixels=7;Cu.prototype._makeTics=function(){let e=this._timeBarEle,t=K.secondsDifference(this._scrubJulian,this._startJulian),n=Math.round(t*this._topDiv.clientWidth/this._timeBarSecondsSpan),i=n-8,r,o=this;this._needleEle.style.left=`${n.toString()}px`;let s="",a=.01,c=31536e6,u=1e-10,f=0,d=this._timeBarSecondsSpan;d<a?(d=a,this._timeBarSecondsSpan=a,this._endJulian=K.addSeconds(this._startJulian,a,new K)):d>c&&(d=c,this._timeBarSecondsSpan=c,this._endJulian=K.addSeconds(this._startJulian,c,new K));let p=this._timeBarEle.clientWidth;p<10&&(p=10);let g=this._startJulian,m=Math.min(d/p*1e-5,.4),y,A=K.toGregorianDate(g);d>31536e4?y=K.fromDate(new Date(Date.UTC(Math.floor(A.year/100)*100,0))):d>31536e3?y=K.fromDate(new Date(Date.UTC(Math.floor(A.year/10)*10,0))):d>86400?y=K.fromDate(new Date(Date.UTC(A.year,0))):y=K.fromDate(new Date(Date.UTC(A.year,A.month,A.day)));let b=K.secondsDifference(this._startJulian,K.addSeconds(y,m,new K)),x=b+d;this._epochJulian=y;function T(k){return Math.floor(b/k)*k}function E(k,G){return Math.ceil(k/G+.5)*G}function v(k){return(k-b)/d}function S(k,G){return k-G*Math.round(k/G)}this._rulerEle.innerHTML=this.makeLabel(K.addSeconds(this._endJulian,-a,new K));let I=this._rulerEle.offsetWidth+20;I<30&&(I=180);let R=f;f-=u;let O={startTime:b,startJulian:g,epochJulian:y,duration:d,timeBarWidth:p,getAlpha:v};this._highlightRanges.forEach(function(k){s+=k.render(O)});let L=0,_=0,C=0,w=I/p;w>1&&(w=1),w*=this._timeBarSecondsSpan;let P=-1,M=-1,F=Xb.length,V;for(V=0;V<F;++V){let k=Xb[V];if(++P,L=k,k>w&&k>f)break;M<0&&p*(k/this._timeBarSecondsSpan)>=this.smallestTicInPixels&&(M=P)}if(P>0){for(;P>0;)if(--P,Math.abs(S(L,Xb[P]))<1e-5){Xb[P]>=f&&(_=Xb[P]);break}if(M>=0)for(;M<P;){if(Math.abs(S(_,Xb[M]))<1e-5&&Xb[M]>=f){C=Xb[M];break}++M}}f=R,f>u&&C<1e-5&&Math.abs(f-L)>u&&(C=f,f<=L+u&&(_=0));let B=-999999,j;if(p*(C/this._timeBarSecondsSpan)>=3)for(r=T(C);r<=x;r=E(r,C))s+=`<span class="cesium-timeline-ticTiny" style="left: ${Math.round(p*v(r)).toString()}px;"></span>`;if(p*(_/this._timeBarSecondsSpan)>=3)for(r=T(_);r<=x;r=E(r,_))s+=`<span class="cesium-timeline-ticSub" style="left: ${Math.round(p*v(r)).toString()}px;"></span>`;if(p*(L/this._timeBarSecondsSpan)>=2){this._mainTicSpan=L,x+=L,r=T(L);let k=K.computeTaiMinusUtc(y);for(;r<=x;){let G=K.addSeconds(g,r-b,new K);if(L>2.1){let J=K.computeTaiMinusUtc(G);Math.abs(J-k)>.1&&(r+=J-k,G=K.addSeconds(g,r-b,new K))}let q=Math.round(p*v(r)),Q=this.makeLabel(G);this._rulerEle.innerHTML=Q,j=this._rulerEle.offsetWidth,j<10&&(j=I);let W=q-(j/2-1);W>B?(B=W+j+5,s+=`<span class="cesium-timeline-ticMain" style="left: ${q.toString()}px;"></span><span class="cesium-timeline-ticLabel" style="left: ${W.toString()}px;">${Q}</span>`):s+=`<span class="cesium-timeline-ticSub" style="left: ${q.toString()}px;"></span>`,r=E(r,L)}}else this._mainTicSpan=-1;s+=`<span class="cesium-timeline-icon16" style="left:${i}px;bottom:0;background-position: 0 0;"></span>`,e.innerHTML=s,this._scrubElement=e.lastChild,this._context.clearRect(0,0,this._trackListEle.width,this._trackListEle.height),O.y=0,this._trackList.forEach(function(k){k.render(o._context,O),O.y+=k.height})};Cu.prototype.updateFromClock=function(){this._scrubJulian=this._clock.currentTime;let e=this._scrubElement;if(l(this._scrubElement)){let t=K.secondsDifference(this._scrubJulian,this._startJulian),n=Math.round(t*this._topDiv.clientWidth/this._timeBarSecondsSpan);this._lastXPos!==n&&(this._lastXPos=n,e.style.left=`${n-8}px`,this._needleEle.style.left=`${n}px`)}l(this._timelineDragLocation)&&(this._setTimeBarTime(this._timelineDragLocation,this._timelineDragLocation*this._timeBarSecondsSpan/this._topDiv.clientWidth),this.zoomTo(K.addSeconds(this._startJulian,this._timelineDrag,new K),K.addSeconds(this._endJulian,this._timelineDrag,new K)))};Cu.prototype._setTimeBarTime=function(e,t){if(e=Math.round(e),this._scrubJulian=K.addSeconds(this._startJulian,t,new K),this._scrubElement){let i=e-8;this._scrubElement.style.left=`${i.toString()}px`,this._needleEle.style.left=`${e.toString()}px`}let n=document.createEvent("Event");n.initEvent("settime",!0,!0),n.clientX=e,n.timeSeconds=t,n.timeJulian=this._scrubJulian,n.clock=this._clock,this._topDiv.dispatchEvent(n)};function G5t(e){return function(t){e._mouseMode!==Oh.touchOnly&&(t.button===0?(e._mouseMode=Oh.scrub,e._scrubElement&&(e._scrubElement.style.backgroundPosition="-16px 0"),e._onMouseMove(t)):(e._mouseX=t.clientX,t.button===2?e._mouseMode=Oh.zoom:e._mouseMode=Oh.slide)),t.preventDefault()}}function W5t(e){return function(t){e._mouseMode=Oh.none,e._scrubElement&&(e._scrubElement.style.backgroundPosition="0 0"),e._timelineDrag=0,e._timelineDragLocation=void 0}}function q5t(e){return function(t){let n;if(e._mouseMode===Oh.scrub){t.preventDefault();let i=t.clientX-e._topDiv.getBoundingClientRect().left;i<0?(e._timelineDragLocation=0,e._timelineDrag=-.01*e._timeBarSecondsSpan):i>e._topDiv.clientWidth?(e._timelineDragLocation=e._topDiv.clientWidth,e._timelineDrag=.01*e._timeBarSecondsSpan):(e._timelineDragLocation=void 0,e._setTimeBarTime(i,i*e._timeBarSecondsSpan/e._topDiv.clientWidth))}else if(e._mouseMode===Oh.slide){if(n=e._mouseX-t.clientX,e._mouseX=t.clientX,n!==0){let i=n*e._timeBarSecondsSpan/e._topDiv.clientWidth;e.zoomTo(K.addSeconds(e._startJulian,i,new K),K.addSeconds(e._endJulian,i,new K))}}else e._mouseMode===Oh.zoom&&(n=e._mouseX-t.clientX,e._mouseX=t.clientX,n!==0&&e.zoomFrom(Math.pow(1.01,n)))}}function Y5t(e){return function(t){let n=t.wheelDeltaY||t.wheelDelta||-t.detail;Vle=Math.max(Math.min(Math.abs(n),Vle),1),n/=Vle,e.zoomFrom(Math.pow(1.05,-n))}}function X5t(e){return function(t){let n=t.touches.length,i,r,o=e._topDiv.getBoundingClientRect().left;t.preventDefault(),e._mouseMode=Oh.touchOnly,n===1?(i=K.secondsDifference(e._scrubJulian,e._startJulian),r=Math.round(i*e._topDiv.clientWidth/e._timeBarSecondsSpan+o),Math.abs(t.touches[0].clientX-r)<50?(e._touchMode=Eu.scrub,e._scrubElement&&(e._scrubElement.style.backgroundPosition=n===1?"-16px 0":"0 0")):(e._touchMode=Eu.singleTap,e._touchState.centerX=t.touches[0].clientX-o)):n===2?(e._touchMode=Eu.slideZoom,e._touchState.centerX=(t.touches[0].clientX+t.touches[1].clientX)*.5-o,e._touchState.spanX=Math.abs(t.touches[0].clientX-t.touches[1].clientX)):e._touchMode=Eu.ignore}}function K5t(e){return function(t){let n=t.touches.length,i=e._topDiv.getBoundingClientRect().left;e._touchMode===Eu.singleTap?(e._touchMode=Eu.scrub,e._onTouchMove(t)):e._touchMode===Eu.scrub&&e._onTouchMove(t),e._mouseMode=Oh.touchOnly,n!==1?e._touchMode=n>0?Eu.ignore:Eu.none:e._touchMode===Eu.slideZoom&&(e._touchState.centerX=t.touches[0].clientX-i),e._scrubElement&&(e._scrubElement.style.backgroundPosition="0 0")}}function $5t(e){return function(t){let n,i,r,o,s,a,c=1,u=e._topDiv.getBoundingClientRect().left;e._touchMode===Eu.singleTap&&(e._touchMode=Eu.slideZoom),e._mouseMode=Oh.touchOnly,e._touchMode===Eu.scrub?(t.preventDefault(),t.changedTouches.length===1&&(i=t.changedTouches[0].clientX-u,i>=0&&i<=e._topDiv.clientWidth&&e._setTimeBarTime(i,i*e._timeBarSecondsSpan/e._topDiv.clientWidth))):e._touchMode===Eu.slideZoom&&(r=t.touches.length,r===2?(o=(t.touches[0].clientX+t.touches[1].clientX)*.5-u,s=Math.abs(t.touches[0].clientX-t.touches[1].clientX)):r===1&&(o=t.touches[0].clientX-u,s=0),l(o)&&(s>0&&e._touchState.spanX>0?(c=e._touchState.spanX/s,a=K.addSeconds(e._startJulian,(e._touchState.centerX*e._timeBarSecondsSpan-o*e._timeBarSecondsSpan*c)/e._topDiv.clientWidth,new K)):(n=e._touchState.centerX-o,a=K.addSeconds(e._startJulian,n*e._timeBarSecondsSpan/e._topDiv.clientWidth,new K)),e.zoomTo(a,K.addSeconds(a,e._timeBarSecondsSpan*c,new K)),e._touchState.centerX=o,e._touchState.spanX=s))}}Cu.prototype.resize=function(){let e=this.container.clientWidth,t=this.container.clientHeight;if(e===this._lastWidth&&t===this._lastHeight)return;this._trackContainer.style.height=`${t}px`;let n=1;this._trackList.forEach(function(i){n+=i.height}),this._trackListEle.style.height=`${n.toString()}px`,this._trackListEle.width=this._trackListEle.clientWidth,this._trackListEle.height=n,this._makeTics(),this._lastXPos=void 0,this._lastWidth=e,this._lastHeight=t};var sj=Cu;var u3e=1e3;function bp(e){l(e.geocoderServices)?this._geocoderServices=e.geocoderServices:this._geocoderServices=[new VC({scene:e.scene})],this._viewContainer=e.container,this._scene=e.scene,this._flightDuration=e.flightDuration,this._searchText="",this._isSearchInProgress=!1,this._wasGeocodeCancelled=!1,this._previousCredits=[],this._complete=new be,this._suggestions=[],this._selectedSuggestion=void 0,this._showSuggestions=!0,this._handleArrowDown=d3e,this._handleArrowUp=f3e;let t=this;this._suggestionsVisible=ve.pureComputed(function(){let r=ve.getObservable(t,"_suggestions")().length>0,o=ve.getObservable(t,"_showSuggestions")();return r&&o}),this._searchCommand=Rn(function(i){if(i=i??Vb.SEARCH,t._focusTextbox=!1,l(t._selectedSuggestion))return t.activateSuggestion(t._selectedSuggestion),!1;if(t.hideSuggestions(),t.isSearchInProgress)n9t(t);else return e9t(t,t._geocoderServices,i)}),this.deselectSuggestion=function(){t._selectedSuggestion=void 0},this.handleKeyDown=function(i,r){let o=r.key==="ArrowDown"||r.key==="Down"||r.keyCode===40,s=r.key==="ArrowUp"||r.key==="Up"||r.keyCode===38;return(o||s)&&r.preventDefault(),!0},this.handleKeyUp=function(i,r){let o=r.key==="ArrowDown"||r.key==="Down"||r.keyCode===40,s=r.key==="ArrowUp"||r.key==="Up"||r.keyCode===38,a=r.key==="Enter"||r.keyCode===13;return s?f3e(t):o?d3e(t):a&&t._searchCommand(),!0},this.activateSuggestion=function(i){t.hideSuggestions(),t._searchText=i.displayName;let r=i.destination;p3e(t),t.destinationFound(t,r)},this.hideSuggestions=function(){t._showSuggestions=!1,t._selectedSuggestion=void 0},this.showSuggestions=function(){t._showSuggestions=!0},this.handleMouseover=function(i,r){i!==t._selectedSuggestion&&(t._selectedSuggestion=i)},this.keepExpanded=!1,this.autoComplete=e.autocomplete??!0,this.destinationFound=e.destinationFound??bp.flyToDestination,this._focusTextbox=!1,ve.track(this,["_searchText","_isSearchInProgress","keepExpanded","_suggestions","_selectedSuggestion","_showSuggestions","_focusTextbox"]);let n=ve.getObservable(this,"_searchText");n.extend({rateLimit:{timeout:500}}),this._suggestionSubscription=n.subscribe(function(){bp._updateSearchSuggestions(t)}),this.isSearchInProgress=void 0,ve.defineProperty(this,"isSearchInProgress",{get:function(){return this._isSearchInProgress}}),this.searchText=void 0,ve.defineProperty(this,"searchText",{get:function(){return this.isSearchInProgress?"Searching...":this._searchText},set:function(i){this._searchText=i}}),this.flightDuration=void 0,ve.defineProperty(this,"flightDuration",{get:function(){return this._flightDuration},set:function(i){this._flightDuration=i}})}Object.defineProperties(bp.prototype,{complete:{get:function(){return this._complete}},scene:{get:function(){return this._scene}},search:{get:function(){return this._searchCommand}},selectedSuggestion:{get:function(){return this._selectedSuggestion}},suggestions:{get:function(){return this._suggestions}}});function f3e(e){if(e._suggestions.length===0)return;let t=e._suggestions.indexOf(e._selectedSuggestion);if(t===-1||t===0){e._selectedSuggestion=void 0;return}let n=t-1;e._selectedSuggestion=e._suggestions[n],bp._adjustSuggestionsScroll(e,n)}function d3e(e){if(e._suggestions.length===0)return;let t=e._suggestions.length,i=(e._suggestions.indexOf(e._selectedSuggestion)+1)%t;e._selectedSuggestion=e._suggestions[i],bp._adjustSuggestionsScroll(e,i)}function J5t(e,t){let n=l(t)?t.availability:void 0;return l(n)?ZE(t,[e]).then(function(i){return e=i[0],e.height+=u3e,e}):(e.height+=u3e,Promise.resolve(e))}function Z5t(e,t){let n=e._scene,i=n.ellipsoid,r=n.camera,o=n.terrainProvider,s=t,a;return t instanceof ie?D.equalsEpsilon(t.south,t.north,D.EPSILON7)&&D.equalsEpsilon(t.east,t.west,D.EPSILON7)?t=ie.center(t):a=QE(t,n):t=i.cartesianToCartographic(t),l(a)||(a=J5t(t,o)),a.then(function(c){s=i.cartographicToCartesian(c)}).finally(function(){r.flyTo({destination:s,complete:function(){e._complete.raiseEvent()},duration:e._flightDuration,endTransform:N.IDENTITY})})}async function Q5t(e,t,n){try{return{state:"fulfilled",value:await e.geocode(t,n),credits:e.credit}}catch(i){return{state:"rejected",reason:i}}}async function e9t(e,t,n){let i=e._searchText;if(m3e(i)){e.showSuggestions();return}e._isSearchInProgress=!0,e._wasGeocodeCancelled=!1;let r,o;for(r=0;r<t.length;r++){if(e._wasGeocodeCancelled)return;if(o=await Q5t(t[r],i,n),l(o)&&o.state==="fulfilled"&&o.value.length>0)break}if(e._wasGeocodeCancelled)return;e._isSearchInProgress=!1,Gle(e);let s=o.value;if(o.state==="fulfilled"&&l(s)&&s.length>0){e._searchText=s[0].displayName,e.destinationFound(e,s[0].destination);let a=h3e(e,UP.getCreditsFromResult(s[0]));l(a)||Hle(e,t[r].credit);return}e._searchText=`${i} (not found)`}function Hle(e,t){l(t)&&!e._scene.isDestroyed()&&!e._scene.frameState.creditDisplay.isDestroyed()&&(e._scene.frameState.creditDisplay.addStaticCredit(t),e._previousCredits.push(t))}function h3e(e,t){return l(t)&&t.forEach(n=>Hle(e,n)),t}function Gle(e){!e._scene.isDestroyed()&&!e._scene.frameState.creditDisplay.isDestroyed()&&e._previousCredits.forEach(t=>{e._scene.frameState.creditDisplay.removeStaticCredit(t)}),e._previousCredits.length=0}function t9t(e,t){let n=Ln(e._viewContainer),i=n.getElementsByClassName("search-results")[0],o=n.getElementsByTagName("li")[t];if(t===0){i.scrollTop=0;return}let s=o.offsetTop;s+o.clientHeight>i.clientHeight?i.scrollTop=s+o.clientHeight:s<i.scrollTop&&(i.scrollTop=s)}function n9t(e){e._isSearchInProgress&&(e._isSearchInProgress=!1,e._wasGeocodeCancelled=!0)}function m3e(e){return/^\s*$/.test(e)}function p3e(e){ve.getObservable(e,"_suggestions").removeAll()}async function i9t(e){if(!e.autoComplete)return;let t=e._searchText;if(p3e(e),Gle(e),!m3e(t))for(let n of e._geocoderServices){let i=await n.geocode(t,Vb.AUTOCOMPLETE);if(e._suggestions=e._suggestions.concat(i),i.length>0){let r=!0;i.forEach(o=>{let s=UP.getCreditsFromResult(o);r=r&&!l(s),h3e(e,s)}),r&&Hle(e,n.credit)}if(e._suggestions.length>=5)return}}bp.flyToDestination=Z5t;bp._updateSearchSuggestions=i9t;bp._adjustSuggestionsScroll=t9t;bp.prototype.isDestroyed=function(){return!1};bp.prototype.destroy=function(){return this._suggestionSubscription.dispose(),Gle(this),le(this)};var aj=bp;var r9t="M29.772,26.433l-7.126-7.126c0.96-1.583,1.523-3.435,1.524-5.421C24.169,8.093,19.478,3.401,13.688,3.399C7.897,3.401,3.204,8.093,3.204,13.885c0,5.789,4.693,10.481,10.484,10.481c1.987,0,3.839-0.563,5.422-1.523l7.128,7.127L29.772,26.433zM7.203,13.885c0.006-3.582,2.903-6.478,6.484-6.486c3.579,0.008,6.478,2.904,6.484,6.486c-0.007,3.58-2.905,6.476-6.484,6.484C10.106,20.361,7.209,17.465,7.203,13.885z",o9t="M24.778,21.419 19.276,15.917 24.777,10.415 21.949,7.585 16.447,13.087 10.945,7.585 8.117,10.415 13.618,15.917 8.116,21.419 10.946,24.248 16.447,18.746 21.948,24.248z";function Tq(e){let t=Ln(e.container),n=new aj(e);n._startSearchPath=r9t,n._stopSearchPath=o9t;let i=document.createElement("form");i.setAttribute("data-bind","submit: search");let r=document.createElement("input");r.type="search",r.className="cesium-geocoder-input",r.setAttribute("placeholder","Enter an address or landmark..."),r.setAttribute("data-bind",'textInput: searchText,disable: isSearchInProgress,event: { keyup: handleKeyUp, keydown: handleKeyDown, mouseover: deselectSuggestion },css: { "cesium-geocoder-input-wide" : keepExpanded || searchText.length > 0 },hasFocus: _focusTextbox'),this._onTextBoxFocus=function(){setTimeout(function(){r.select()},0)},r.addEventListener("focus",this._onTextBoxFocus,!1),i.appendChild(r),this._textBox=r;let o=document.createElement("span");o.className="cesium-geocoder-searchButton",o.setAttribute("data-bind","click: search,cesiumSvgPath: { path: isSearchInProgress ? _stopSearchPath : _startSearchPath, width: 32, height: 32 }"),i.appendChild(o),t.appendChild(i);let s=document.createElement("div");s.className="search-results",s.setAttribute("data-bind","visible: _suggestionsVisible");let a=document.createElement("ul");a.setAttribute("data-bind","foreach: _suggestions");let c=document.createElement("li");a.appendChild(c),c.setAttribute("data-bind","text: $data.displayName, click: $parent.activateSuggestion, event: { mouseover: $parent.handleMouseover}, css: { active: $data === $parent._selectedSuggestion }"),s.appendChild(a),t.appendChild(s),ve.applyBindings(n,i),ve.applyBindings(n,s),this._container=t,this._searchSuggestionsContainer=s,this._viewModel=n,this._form=i,this._onInputBegin=function(u){let f=u.target;typeof u.composedPath=="function"&&(f=u.composedPath()[0]),t.contains(f)||(n._focusTextbox=!1,n.hideSuggestions())},this._onInputEnd=function(u){n._focusTextbox=!0,n.showSuggestions()},dn.supportsPointerEvents()?(document.addEventListener("pointerdown",this._onInputBegin,!0),t.addEventListener("pointerup",this._onInputEnd,!0),t.addEventListener("pointercancel",this._onInputEnd,!0)):(document.addEventListener("mousedown",this._onInputBegin,!0),t.addEventListener("mouseup",this._onInputEnd,!0),document.addEventListener("touchstart",this._onInputBegin,!0),t.addEventListener("touchend",this._onInputEnd,!0),t.addEventListener("touchcancel",this._onInputEnd,!0))}Object.defineProperties(Tq.prototype,{container:{get:function(){return this._container}},searchSuggestionsContainer:{get:function(){return this._searchSuggestionsContainer}},viewModel:{get:function(){return this._viewModel}}});Tq.prototype.isDestroyed=function(){return!1};Tq.prototype.destroy=function(){let e=this._container;return dn.supportsPointerEvents()?(document.removeEventListener("pointerdown",this._onInputBegin,!0),e.removeEventListener("pointerup",this._onInputEnd,!0)):(document.removeEventListener("mousedown",this._onInputBegin,!0),e.removeEventListener("mouseup",this._onInputEnd,!0),document.removeEventListener("touchstart",this._onInputBegin,!0),e.removeEventListener("touchend",this._onInputEnd,!0)),this._viewModel.destroy(),ve.cleanNode(this._form),ve.cleanNode(this._searchSuggestionsContainer),e.removeChild(this._form),e.removeChild(this._searchSuggestionsContainer),this._textBox.removeEventListener("focus",this._onTextBoxFocus,!1),le(this)};var cj=Tq;var _3e=Qo(g3e(),1);function s9t(e){let t=!1,n=window.screen;return l(n)&&(l(n.lockOrientation)?t=n.lockOrientation(e):l(n.mozLockOrientation)?t=n.mozLockOrientation(e):l(n.msLockOrientation)?t=n.msLockOrientation(e):l(n.orientation&&n.orientation.lock)&&(t=n.orientation.lock(e))),t}function y3e(){let e=window.screen;l(e)&&(l(e.unlockOrientation)?e.unlockOrientation():l(e.mozUnlockOrientation)?e.mozUnlockOrientation():l(e.msUnlockOrientation)?e.msUnlockOrientation():l(e.orientation&&e.orientation.unlock)&&e.orientation.unlock())}function a9t(e,t,n,i){i()||(n()?(t.useWebVR=!1,e._locked&&(y3e(),e._locked=!1),e._noSleep.disable(),es.exitFullscreen(),n(!1)):(es.fullscreen||es.requestFullscreen(e._vrElement),e._noSleep.enable(),e._locked||(e._locked=s9t("landscape")),t.useWebVR=!0,n(!0)))}function Eq(e,t){let n=this,i=ve.observable(es.enabled),r=ve.observable(!1);this.isVRMode=void 0,ve.defineProperty(this,"isVRMode",{get:function(){return r()}}),this.isVREnabled=void 0,ve.defineProperty(this,"isVREnabled",{get:function(){return i()},set:function(s){i(s&&es.enabled)}}),this.tooltip=void 0,ve.defineProperty(this,"tooltip",function(){return i()?r()?"Exit VR mode":"Enter VR mode":"VR mode is unavailable"});let o=ve.observable(!1);this._isOrthographic=void 0,ve.defineProperty(this,"_isOrthographic",{get:function(){return o()}}),this._eventHelper=new Xo,this._eventHelper.add(e.preRender,function(){o(e.camera.frustum instanceof gn)}),this._locked=!1,this._noSleep=new _3e.default,this._command=Rn(function(){a9t(n,e,r,o)},ve.getObservable(this,"isVREnabled")),this._vrElement=Ln(t)??document.body,this._callback=function(){!es.fullscreen&&r()&&(e.useWebVR=!1,n._locked&&(y3e(),n._locked=!1),n._noSleep.disable(),r(!1))},document.addEventListener(es.changeEventName,this._callback)}Object.defineProperties(Eq.prototype,{vrElement:{get:function(){return this._vrElement},set:function(e){this._vrElement=e}},command:{get:function(){return this._command}}});Eq.prototype.isDestroyed=function(){return!1};Eq.prototype.destroy=function(){this._eventHelper.removeAll(),document.removeEventListener(es.changeEventName,this._callback),le(this)};var uj=Eq;var c9t="M 5.3125 6.375 C 4.008126 6.375 2.96875 7.4141499 2.96875 8.71875 L 2.96875 19.5 C 2.96875 20.8043 4.008126 21.875 5.3125 21.875 L 13.65625 21.875 C 13.71832 20.0547 14.845166 18.59375 16.21875 18.59375 C 17.592088 18.59375 18.71881 20.0552 18.78125 21.875 L 27.09375 21.875 C 28.398125 21.875 29.4375 20.8043 29.4375 19.5 L 29.4375 8.71875 C 29.4375 7.4141499 28.398125 6.375 27.09375 6.375 L 5.3125 6.375 z M 9.625 10.4375 C 11.55989 10.4375 13.125 12.03385 13.125 13.96875 C 13.125 15.90365 11.55989 17.46875 9.625 17.46875 C 7.69011 17.46875 6.125 15.90365 6.125 13.96875 C 6.125 12.03385 7.69011 10.4375 9.625 10.4375 z M 22.46875 10.4375 C 24.40364 10.4375 25.96875 12.03385 25.96875 13.96875 C 25.96875 15.90365 24.40364 17.46875 22.46875 17.46875 C 20.53386 17.46875 18.96875 15.90365 18.96875 13.96875 C 18.96875 12.03385 20.53386 10.4375 22.46875 10.4375 z",l9t="M 25.770585,2.4552065 C 15.72282,13.962707 10.699956,19.704407 8.1768352,22.580207 c -1.261561,1.4379 -1.902282,2.1427 -2.21875,2.5 -0.141624,0.1599 -0.208984,0.2355 -0.25,0.2813 l 0.6875,0.75 c 10e-5,-10e-5 0.679191,0.727 0.6875,0.7187 0.01662,-0.016 0.02451,-0.024 0.03125,-0.031 0.01348,-0.014 0.04013,-0.038 0.0625,-0.062 0.04474,-0.05 0.120921,-0.1315 0.28125,-0.3126 0.320657,-0.3619 0.956139,-1.0921 2.2187499,-2.5312 2.5252219,-2.8781 7.5454589,-8.6169 17.5937499,-20.1250005 l -1.5,-1.3125 z m -20.5624998,3.9063 c -1.304375,0 -2.34375,1.0391 -2.34375,2.3437 l 0,10.8125005 c 0,1.3043 1.039375,2.375 2.34375,2.375 l 2.25,0 c 1.9518039,-2.2246 7.4710958,-8.5584 13.5624998,-15.5312005 l -15.8124998,0 z m 21.1249998,0 c -1.855467,2.1245 -2.114296,2.4005 -3.59375,4.0936995 1.767282,0.1815 3.15625,1.685301 3.15625,3.500001 0,1.9349 -1.56511,3.5 -3.5,3.5 -1.658043,0 -3.043426,-1.1411 -3.40625,-2.6875 -1.089617,1.2461 -2.647139,2.9988 -3.46875,3.9375 0.191501,-0.062 0.388502,-0.094 0.59375,-0.094 1.373338,0 2.50006,1.4614 2.5625,3.2812 l 8.3125,0 c 1.304375,0 2.34375,-1.0707 2.34375,-2.375 l 0,-10.8125005 c 0,-1.3046 -1.039375,-2.3437 -2.34375,-2.3437 l -0.65625,0 z M 9.5518351,10.423906 c 1.9348899,0 3.4999999,1.596401 3.4999999,3.531301 0,1.9349 -1.56511,3.5 -3.4999999,3.5 -1.9348899,0 -3.4999999,-1.5651 -3.4999999,-3.5 0,-1.9349 1.56511,-3.531301 3.4999999,-3.531301 z m 4.2187499,10.312601 c -0.206517,0.2356 -0.844218,0.9428 -1.03125,1.1562 l 0.8125,0 c 0.01392,-0.4081 0.107026,-0.7968 0.21875,-1.1562 z";function Cq(e,t,n){e=Ln(e);let i=new uj(t,n);i._exitVRPath=l9t,i._enterVRPath=c9t;let r=document.createElement("button");r.type="button",r.className="cesium-button cesium-vrButton",r.setAttribute("data-bind",'css: { "cesium-button-disabled" : _isOrthographic }, attr: { title: tooltip },click: command,enable: isVREnabled,cesiumSvgPath: { path: isVRMode ? _exitVRPath : _enterVRPath, width: 32, height: 32 }'),e.appendChild(r),ve.applyBindings(i,r),this._container=e,this._viewModel=i,this._element=r}Object.defineProperties(Cq.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}}});Cq.prototype.isDestroyed=function(){return!1};Cq.prototype.destroy=function(){return this._viewModel.destroy(),ve.cleanNode(this._element),this._container.removeChild(this._element),le(this)};var fj=Cq;var A3e=new ue;function T3e(e){let t=e.clock;t.currentTime=e.timeJulian,t.shouldAnimate=!1}function u9t(e){let t=e.getPropertyIds(),n="";return t.forEach(function(i){let r=e.getProperty(i);l(r)&&(n+=`<tr><th>${i}</th><td>${r}</td></tr>`)}),n.length>0&&(n=`<table class="cesium-infoBox-defaultTable"><tbody>${n}</tbody></table>`),n}function f9t(e){let t,n=[],i=e.getPropertyIds();for(t=0;t<i.length;t++){let o=i[t];/^name$/i.test(o)?n[0]=e.getProperty(o):/name/i.test(o)?n[1]=e.getProperty(o):/^title$/i.test(o)?n[2]=e.getProperty(o):/^(id|identifier)$/i.test(o)?n[3]=e.getProperty(o):/element/i.test(o)?n[4]=e.getProperty(o):/(id|identifier)$/i.test(o)&&(n[5]=e.getProperty(o))}let r=n.length;for(t=0;t<r;t++){let o=n[t];if(l(o)&&o!=="")return o}return"Unnamed Feature"}function b3e(e,t){let n=e.scene.pick(t.position);if(l(n)){let i=n.id??n.primitive.id;if(i instanceof Jr)return i;if(n instanceof na||n instanceof kT)return new Jr({name:f9t(n),description:u9t(n),feature:n})}return p9t(e,t.position)}var d9t=new K;function qle(e,t){if(l(t)){let n=t.clock;if(l(n)&&l(e)){let i=n.startTime,r=n.stopTime;K.equals(i,r)&&(r=K.addSeconds(i,D.EPSILON2,d9t)),e.updateFromClock(),e.zoomTo(i,r)}}}var h9t=new h;function m9t(e){let t=e.length;for(let n=0;n<t;++n){let i=e.get(n);if(i instanceof Yo)return i}}function p9t(e,t){let n=e.scene,i=n.camera.getPickRay(t);if(!l(i))return;let r=n.imageryLayers;if(!l(r)){let a=m9t(n.primitives);if(!l(a))return;r=a.imageryLayers}let o=r.pickImageryLayerFeatures(i,n);if(!l(o))return;let s=new Jr({id:"Loading...",description:"Loading feature information..."});return o.then(function(a){if(e.selectedEntity!==s)return;if(!l(a)||a.length===0){e.selectedEntity=x3e();return}let c=a[0],u=new Jr({id:c.name,description:c.description});if(l(c.position)){let f=e.scene.ellipsoid.cartographicToCartesian(c.position,h9t);u.position=new Xl(f)}e.selectedEntity=u},function(){e.selectedEntity===s&&(e.selectedEntity=x3e())}),s}function x3e(){return new Jr({id:"None",description:"No features found."})}function g9t(e,t){let n=e._geocoder,i=e._homeButton,r=e._sceneModePicker,o=e._projectionPicker,s=e._baseLayerPicker,a=e._animation,c=e._timeline,u=e._fullscreenButton,f=e._infoBox,d=e._selectionIndicator,p=t?"hidden":"visible";if(l(n)&&(n.container.style.visibility=p),l(i)&&(i.container.style.visibility=p),l(r)&&(r.container.style.visibility=p),l(o)&&(o.container.style.visibility=p),l(s)&&(s.container.style.visibility=p),l(a)&&(a.container.style.visibility=p),l(c)&&(c.container.style.visibility=p),l(u)&&u.viewModel.isFullscreenEnabled&&(u.container.style.visibility=p),l(f)&&(f.container.style.visibility=p),l(d)&&(d.container.style.visibility=p),e._container){let g=t||!l(u)?0:u.container.clientWidth;e._vrButton.container.style.right=`${g}px`,e.forceResize()}}function lr(e,t){e=Ln(e),t=t??H.EMPTY_OBJECT;let n=(!l(t.globe)||t.globe!==!1)&&(!l(t.baseLayerPicker)||t.baseLayerPicker!==!1),i=this,r=document.createElement("div");r.className="cesium-viewer",e.appendChild(r);let o=document.createElement("div");o.className="cesium-viewer-cesiumWidgetContainer",r.appendChild(o);let s=document.createElement("div");s.className="cesium-viewer-bottom",r.appendChild(s);let a=t.scene3DOnly??!1,c,u,f=!1;l(t.clockViewModel)?(u=t.clockViewModel,c=u.clock):(c=new Lm,u=new C8(c),f=!0);let d=new P4(o,{baseLayer:n&&l(t.selectedImageryProviderViewModel)||l(t.baseLayer)||l(t.imageryProvider)?!1:void 0,clock:c,shouldAnimate:t.shouldAnimate,skyBox:t.skyBox,skyAtmosphere:t.skyAtmosphere,sceneMode:t.sceneMode,ellipsoid:t.ellipsoid,mapProjection:t.mapProjection,globe:t.globe,orderIndependentTranslucency:t.orderIndependentTranslucency,automaticallyTrackDataSourceClocks:t.automaticallyTrackDataSourceClocks,contextOptions:t.contextOptions,useDefaultRenderLoop:t.useDefaultRenderLoop,targetFrameRate:t.targetFrameRate,showRenderLoopErrors:t.showRenderLoopErrors,useBrowserRecommendedResolution:t.useBrowserRecommendedResolution,creditContainer:l(t.creditContainer)?t.creditContainer:s,creditViewport:t.creditViewport,dataSources:t.dataSources,scene3DOnly:a,shadows:t.shadows,terrainShadows:t.terrainShadows,mapMode2D:t.mapMode2D,blurActiveElementOnCanvasFocus:t.blurActiveElementOnCanvasFocus,requestRenderMode:t.requestRenderMode,maximumRenderTimeChange:t.maximumRenderTimeChange,depthPlaneEllipsoidOffset:t.depthPlaneEllipsoidOffset,msaaSamples:t.msaaSamples}),p=d.scene,g=new Xo;g.add(c.onTick,lr.prototype._onTick,this);let m;if(!l(t.selectionIndicator)||t.selectionIndicator!==!1){let G=document.createElement("div");G.className="cesium-viewer-selectionIndicatorContainer",r.appendChild(G),m=new ij(G,p)}let y;if(!l(t.infoBox)||t.infoBox!==!1){let G=document.createElement("div");G.className="cesium-viewer-infoBoxContainer",r.appendChild(G),y=new X8(G);let q=y.viewModel;g.add(q.cameraClicked,lr.prototype._onInfoBoxCameraClicked,this),g.add(q.closeClicked,lr.prototype._onInfoBoxClockClicked,this)}let A=document.createElement("div");A.className="cesium-viewer-toolbar",r.appendChild(A);let b;if(!l(t.geocoder)||t.geocoder!==!1){let G=document.createElement("div");G.className="cesium-viewer-geocoderContainer",A.appendChild(G);let q;typeof t.geocoder=="string"?q=[new VC({scene:p,geocodeProviderType:t.geocoder})]:l(t.geocoder)&&typeof t.geocoder!="boolean"&&(q=Array.isArray(t.geocoder)?t.geocoder:[t.geocoder]),b=new cj({container:G,geocoderServices:q,scene:p}),g.add(b.viewModel.search.beforeExecute,lr.prototype._clearObjects,this)}let x;(!l(t.homeButton)||t.homeButton!==!1)&&(x=new U8(A,p),l(b)&&g.add(x.viewModel.command.afterExecute,function(){let G=b.viewModel;G.searchText="",G.isSearchInProgress&&G.search()}),g.add(x.viewModel.command.beforeExecute,lr.prototype._clearTrackedObject,this));let T;!a&&(!l(t.sceneModePicker)||t.sceneModePicker!==!1)&&(T=new ej(A,p));let E;t.projectionPicker&&(E=new Z8(A,p));let v,S;if(n){let G=t.imageryProviderViewModels??R8(),q=t.terrainProviderViewModels??O8();v=new D8(A,{globe:p.globe,imageryProviderViewModels:G,selectedImageryProviderViewModel:t.selectedImageryProviderViewModel,terrainProviderViewModels:q,selectedTerrainProviderViewModel:t.selectedTerrainProviderViewModel}),S=A.getElementsByClassName("cesium-baseLayerPicker-dropDown")[0]}l(t.baseLayer)&&t.baseLayer!==!1&&(n&&(v.viewModel.selectedImagery=void 0),p.imageryLayers.removeAll(),p.imageryLayers.add(t.baseLayer)),l(t.terrainProvider)&&(n&&(v.viewModel.selectedTerrain=void 0),p.terrainProvider=t.terrainProvider),l(t.terrain)&&(n&&(p.globe.depthTestAgainstTerrain=!0),p.setTerrain(t.terrain));let I;if(!l(t.navigationHelpButton)||t.navigationHelpButton!==!1){let G=!0;try{if(l(window.localStorage)){let q=window.localStorage.getItem("cesium-hasSeenNavHelp");l(q)&&q?G=!1:window.localStorage.setItem("cesium-hasSeenNavHelp","true")}}catch{}I=new q8({container:A,instructionsInitiallyVisible:t.navigationInstructionsInitiallyVisible??G})}let R;if(!l(t.animation)||t.animation!==!1){let G=document.createElement("div");G.className="cesium-viewer-animationContainer",r.appendChild(G),R=new w8(G,new I8(u))}let O;if(!l(t.timeline)||t.timeline!==!1){let G=document.createElement("div");G.className="cesium-viewer-timelineContainer",r.appendChild(G),O=new sj(G,c),O.addEventListener("settime",T3e,!1),O.zoomTo(c.startTime,c.stopTime)}let L,_,C;(!l(t.fullscreenButton)||t.fullscreenButton!==!1)&&(C=document.createElement("div"),C.className="cesium-viewer-fullscreenContainer",r.appendChild(C),L=new B8(C,t.fullscreenElement),_=Cc(L.viewModel,"isFullscreenEnabled",function(G){C.style.display=G?"block":"none",l(O)&&(O.container.style.right=`${C.clientWidth}px`,O.resize())}));let w,P,M;if(t.vrButton){let G=document.createElement("div");G.className="cesium-viewer-vrContainer",r.appendChild(G),w=new fj(G,p,t.fullScreenElement),P=Cc(w.viewModel,"isVREnabled",function(q){G.style.display=q?"block":"none",l(L)&&(G.style.right=`${C.clientWidth}px`),l(O)&&(O.container.style.right=`${G.clientWidth}px`,O.resize())}),M=Cc(w.viewModel,"isVRMode",function(q){g9t(i,q)})}this._baseLayerPickerDropDown=S,this._fullscreenSubscription=_,this._vrSubscription=P,this._vrModeSubscription=M,this._dataSourceChangedListeners={},this._container=e,this._bottomContainer=s,this._element=r,this._cesiumWidget=d,this._selectionIndicator=m,this._infoBox=y,this._clockViewModel=u,this._destroyClockViewModel=f,this._toolbar=A,this._homeButton=x,this._sceneModePicker=T,this._projectionPicker=E,this._baseLayerPicker=v,this._navigationHelpButton=I,this._animation=R,this._timeline=O,this._fullscreenButton=L,this._vrButton=w,this._geocoder=b,this._eventHelper=g,this._lastWidth=0,this._lastHeight=0,this._enableInfoOrSelection=l(y)||l(m),this._selectedEntity=void 0,this._selectedEntityChanged=new be;let F=this._cesiumWidget.dataSources,V=this._cesiumWidget.dataSourceDisplay;g.add(F.dataSourceAdded,lr.prototype._onDataSourceAdded,this),g.add(F.dataSourceRemoved,lr.prototype._onDataSourceRemoved,this),g.add(p.postUpdate,lr.prototype.resize,this);let B=F.length;for(let G=0;G<B;G++)this._dataSourceAdded(F,F.get(G));this._dataSourceAdded(void 0,V.defaultDataSource),g.add(F.dataSourceAdded,lr.prototype._dataSourceAdded,this),g.add(F.dataSourceRemoved,lr.prototype._dataSourceRemoved,this);function j(G){let q=b3e(i,G);l(q)?X.getValueOrUndefined(q.position,i.clock.currentTime)?i.trackedEntity=q:i.zoomTo(q):l(i.trackedEntity)&&(i.trackedEntity=void 0)}function k(G){i.selectedEntity=b3e(i,G)}d.screenSpaceEventHandler.setInputAction(k,un.LEFT_CLICK),d.screenSpaceEventHandler.setInputAction(j,un.LEFT_DOUBLE_CLICK),d._canAnimateUpdateCallback=this._updateCanAnimate(this)}Object.defineProperties(lr.prototype,{container:{get:function(){return this._container}},creditDisplay:{get:function(){return this._cesiumWidget.creditDisplay}},bottomContainer:{get:function(){return this._bottomContainer}},cesiumWidget:{get:function(){return this._cesiumWidget}},selectionIndicator:{get:function(){return this._selectionIndicator}},infoBox:{get:function(){return this._infoBox}},geocoder:{get:function(){return this._geocoder}},homeButton:{get:function(){return this._homeButton}},sceneModePicker:{get:function(){return this._sceneModePicker}},projectionPicker:{get:function(){return this._projectionPicker}},baseLayerPicker:{get:function(){return this._baseLayerPicker}},navigationHelpButton:{get:function(){return this._navigationHelpButton}},animation:{get:function(){return this._animation}},timeline:{get:function(){return this._timeline}},fullscreenButton:{get:function(){return this._fullscreenButton}},vrButton:{get:function(){return this._vrButton}},dataSourceDisplay:{get:function(){return this._cesiumWidget.dataSourceDisplay}},entities:{get:function(){return this._cesiumWidget.entities}},dataSources:{get:function(){return this._cesiumWidget.dataSources}},canvas:{get:function(){return this._cesiumWidget.canvas}},scene:{get:function(){return this._cesiumWidget.scene}},shadows:{get:function(){return this.scene.shadowMap.enabled},set:function(e){this.scene.shadowMap.enabled=e}},terrainShadows:{get:function(){return this.scene.globe.shadows},set:function(e){this.scene.globe.shadows=e}},shadowMap:{get:function(){return this.scene.shadowMap}},imageryLayers:{get:function(){return this.scene.imageryLayers}},terrainProvider:{get:function(){return this.scene.terrainProvider},set:function(e){this.scene.terrainProvider=e}},camera:{get:function(){return this.scene.camera}},ellipsoid:{get:function(){return this.scene.ellipsoid}},postProcessStages:{get:function(){return this.scene.postProcessStages}},clock:{get:function(){return this._clockViewModel.clock}},clockViewModel:{get:function(){return this._clockViewModel}},screenSpaceEventHandler:{get:function(){return this._cesiumWidget.screenSpaceEventHandler}},targetFrameRate:{get:function(){return this._cesiumWidget.targetFrameRate},set:function(e){this._cesiumWidget.targetFrameRate=e}},useDefaultRenderLoop:{get:function(){return this._cesiumWidget.useDefaultRenderLoop},set:function(e){this._cesiumWidget.useDefaultRenderLoop=e}},resolutionScale:{get:function(){return this._cesiumWidget.resolutionScale},set:function(e){this._cesiumWidget.resolutionScale=e}},useBrowserRecommendedResolution:{get:function(){return this._cesiumWidget.useBrowserRecommendedResolution},set:function(e){this._cesiumWidget.useBrowserRecommendedResolution=e}},allowDataSourcesToSuspendAnimation:{get:function(){return this._cesiumWidget.allowDataSourcesToSuspendAnimation},set:function(e){this._cesiumWidget.allowDataSourcesToSuspendAnimation=e}},trackedEntity:{get:function(){return this._cesiumWidget.trackedEntity},set:function(e){this._cesiumWidget.trackedEntity=e}},selectedEntity:{get:function(){return this._selectedEntity},set:function(e){if(this._selectedEntity!==e){this._selectedEntity=e;let t=l(this._selectionIndicator)?this._selectionIndicator.viewModel:void 0;l(e)?l(t)&&t.animateAppear():l(t)&&t.animateDepart(),this._selectedEntityChanged.raiseEvent(e)}}},selectedEntityChanged:{get:function(){return this._selectedEntityChanged}},trackedEntityChanged:{get:function(){return this._cesiumWidget.trackedEntityChanged}},clockTrackedDataSource:{get:function(){return this._cesiumWidget.clockTrackedDataSource},set:function(e){this._cesiumWidget.clockTrackedDataSource!==e&&(this._cesiumWidget.clockTrackedDataSource=e,qle(this._timeline,e))}}});lr.prototype.extend=function(e,t){e(this,t)};lr.prototype.resize=function(){let e=this._cesiumWidget,t=this._container,n=t.clientWidth,i=t.clientHeight,r=l(this._animation),o=l(this._timeline);if(e.resize(),n===this._lastWidth&&i===this._lastHeight)return;let s=i-125,a=this._baseLayerPickerDropDown;if(l(a)&&(a.style.maxHeight=`${s}px`),l(this._geocoder)){let m=this._geocoder.searchSuggestionsContainer;m.style.maxHeight=`${s}px`}l(this._infoBox)&&(this._infoBox.viewModel.maxHeight=s);let c=this._timeline,u,f=0,d=5,p=3,g=0;if(r&&window.getComputedStyle(this._animation.container).visibility!=="hidden"){let m=this._lastWidth;u=this._animation.container,n>900?(f=169,m<=900&&(u.style.width="169px",u.style.height="112px",this._animation.resize())):n>=600?(f=136,(m<600||m>900)&&(u.style.width="136px",u.style.height="90px",this._animation.resize())):(f=106,(m>600||m===0)&&(u.style.width="106px",u.style.height="70px",this._animation.resize())),d=f+5}if(o&&window.getComputedStyle(this._timeline.container).visibility!=="hidden"){let m=this._fullscreenButton,y=this._vrButton,A=c.container,b=A.style;p=A.clientHeight+3,b.left=`${f}px`;let x=0;l(m)&&(x+=m.container.clientWidth),l(y)&&(x+=y.container.clientWidth),b.right=`${x}px`,c.resize()}!o&&l(this._fullscreenButton)&&(g=this._fullscreenButton.container.clientWidth),this._bottomContainer.style.left=`${d}px`,this._bottomContainer.style.bottom=`${p}px`,this._bottomContainer.style.right=`${g}px`,this._lastWidth=n,this._lastHeight=i};lr.prototype.forceResize=function(){this._lastWidth=0,this.resize()};lr.prototype.render=function(){this._cesiumWidget.render()};lr.prototype.isDestroyed=function(){return!1};lr.prototype.destroy=function(){return l(this.screenSpaceEventHandler)&&!this.screenSpaceEventHandler.isDestroyed()&&(this.screenSpaceEventHandler.removeInputAction(un.LEFT_CLICK),this.screenSpaceEventHandler.removeInputAction(un.LEFT_DOUBLE_CLICK)),this._container.removeChild(this._element),this._element.removeChild(this._toolbar),this._eventHelper.removeAll(),l(this._geocoder)&&(this._geocoder=this._geocoder.destroy()),l(this._homeButton)&&(this._homeButton=this._homeButton.destroy()),l(this._sceneModePicker)&&(this._sceneModePicker=this._sceneModePicker.destroy()),l(this._projectionPicker)&&(this._projectionPicker=this._projectionPicker.destroy()),l(this._baseLayerPicker)&&(this._baseLayerPicker=this._baseLayerPicker.destroy()),l(this._animation)&&(this._element.removeChild(this._animation.container),this._animation=this._animation.destroy()),l(this._timeline)&&(this._timeline.removeEventListener("settime",T3e,!1),this._element.removeChild(this._timeline.container),this._timeline=this._timeline.destroy()),l(this._fullscreenButton)&&(this._fullscreenSubscription.dispose(),this._element.removeChild(this._fullscreenButton.container),this._fullscreenButton=this._fullscreenButton.destroy()),l(this._vrButton)&&(this._vrSubscription.dispose(),this._vrModeSubscription.dispose(),this._element.removeChild(this._vrButton.container),this._vrButton=this._vrButton.destroy()),l(this._infoBox)&&(this._element.removeChild(this._infoBox.container),this._infoBox=this._infoBox.destroy()),l(this._selectionIndicator)&&(this._element.removeChild(this._selectionIndicator.container),this._selectionIndicator=this._selectionIndicator.destroy()),this._destroyClockViewModel&&(this._clockViewModel=this._clockViewModel.destroy()),this._cesiumWidget=this._cesiumWidget.destroy(),le(this)};lr.prototype._dataSourceAdded=function(e,t){t.entities.collectionChanged.addEventListener(lr.prototype._onEntityCollectionChanged,this)};lr.prototype._dataSourceRemoved=function(e,t){let n=t.entities;n.collectionChanged.removeEventListener(lr.prototype._onEntityCollectionChanged,this),l(this.selectedEntity)&&n.getById(this.selectedEntity.id)===this.selectedEntity&&(this.selectedEntity=void 0)};lr.prototype._updateCanAnimate=function(e){return function(t){e._clockViewModel.canAnimate=t}};lr.prototype._onTick=function(e){let t=e.currentTime,n,i=!1,r=this.selectedEntity,o=l(r)&&this._enableInfoOrSelection;o&&r.isShowing&&r.isAvailable(t)&&(this._cesiumWidget.dataSourceDisplay.getBoundingSphere(r,!0,A3e)!==Pt.FAILED?n=A3e.center:l(r.position)&&(n=r.position.getValue(t,n)),i=l(n));let s=l(this._selectionIndicator)?this._selectionIndicator.viewModel:void 0;l(s)&&(s.position=h.clone(n,s.position),s.showSelection=o&&i,s.update());let a=l(this._infoBox)?this._infoBox.viewModel:void 0;l(a)&&(a.showInfo=o,a.enableCamera=i,a.isCameraTracking=this.trackedEntity===this.selectedEntity,o?(a.titleText=r.name??r.id,a.description=X.getValueOrDefault(r.description,t,"")):(a.titleText="",a.description=""))};lr.prototype._onEntityCollectionChanged=function(e,t,n){let i=n.length;for(let r=0;r<i;r++){let o=n[r];this.selectedEntity===o&&(this.selectedEntity=void 0)}};lr.prototype._onInfoBoxCameraClicked=function(e){if(e.isCameraTracking&&this.trackedEntity===this.selectedEntity)this.trackedEntity=void 0;else{let n=this.selectedEntity.position;l(n)?this.trackedEntity=this.selectedEntity:this.zoomTo(this.selectedEntity)}};lr.prototype._clearTrackedObject=function(){this.trackedEntity=void 0};lr.prototype._onInfoBoxClockClicked=function(e){this.selectedEntity=void 0};lr.prototype._clearObjects=function(){this.trackedEntity=void 0,this.selectedEntity=void 0};lr.prototype._onDataSourceChanged=function(e){this.clockTrackedDataSource===e&&qle(this.timeline,e)};lr.prototype._onDataSourceAdded=function(e,t){this._cesiumWidget._automaticallyTrackDataSourceClocks&&t===this.clockTrackedDataSource&&qle(this._timeline,t);let n=t.entities.id,i=this._eventHelper.add(t.changedEvent,lr.prototype._onDataSourceChanged,this);this._dataSourceChangedListeners[n]=i};lr.prototype._onDataSourceRemoved=function(e,t){let n=t.entities.id;this._dataSourceChangedListeners[n](),this._dataSourceChangedListeners[n]=void 0};lr.prototype.addController=function(e){return this._cesiumWidget.addController(e)};lr.prototype.removeController=function(e){return this._cesiumWidget.removeController(e)};lr.prototype.zoomTo=function(e,t){return this._cesiumWidget.zoomTo(e,t)};lr.prototype.flyTo=function(e,t){return this._cesiumWidget.flyTo(e,t)};var Yle=lr;function _9t(e){let t=document.createElement("div");t.className="cesium-viewer-cesium3DTilesInspectorContainer",e.container.appendChild(t);let n=new H8(t,e.scene);Object.defineProperties(e,{cesium3DTilesInspector:{get:function(){return n}}})}var Xle=_9t;function y9t(e){let t=document.createElement("div");t.className="cesium-viewer-cesiumInspectorContainer",e.container.appendChild(t);let n=new L8(t,e.scene);Object.defineProperties(e,{cesiumInspector:{get:function(){return n}}})}var Kle=y9t;function A9t(e,t){t=t??H.EMPTY_OBJECT;let n=!0,i=t.flyToOnDrop??!0,r=new be,o=t.clearOnDrop??!0,s=t.dropTarget??e.container,a=t.clampToGround??!0,c=t.proxy;s=Ln(s),Object.defineProperties(e,{dropTarget:{get:function(){return s},set:function(f){E3e(s,u),s=f,$le(s,u)}},dropEnabled:{get:function(){return n},set:function(f){f!==n&&(f?$le(s,u):E3e(s,u),n=f)}},dropError:{get:function(){return r}},clearOnDrop:{get:function(){return o},set:function(f){o=f}},flyToOnDrop:{get:function(){return i},set:function(f){i=f}},proxy:{get:function(){return c},set:function(f){c=f}},clampToGround:{get:function(){return a},set:function(f){a=f}}});function u(f){ZC(f),o&&(e.entities.removeAll(),e.dataSources.removeAll());let d=f.dataTransfer.files,p=d.length;for(let g=0;g<p;g++){let m=d[g],y=new FileReader;y.onload=b9t(e,m,c,a),y.onerror=x9t(e,m),y.readAsText(m)}}$le(s,u),e.destroy=j4(e,e.destroy,function(){e.dropEnabled=!1}),e._handleDrop=u}function ZC(e){e.stopPropagation(),e.preventDefault()}function E3e(e,t){let n=e;l(n)&&(n.removeEventListener("drop",t,!1),n.removeEventListener("dragenter",ZC,!1),n.removeEventListener("dragover",ZC,!1),n.removeEventListener("dragexit",ZC,!1))}function $le(e,t){e.addEventListener("drop",t,!1),e.addEventListener("dragenter",ZC,!1),e.addEventListener("dragover",ZC,!1),e.addEventListener("dragexit",ZC,!1)}function b9t(e,t,n,i){let r=e.scene;return function(o){let s=t.name;try{let a;if(/\.czml$/i.test(s))a=Kk.load(JSON.parse(o.target.result),{sourceUri:s});else if(/\.geojson$/i.test(s)||/\.json$/i.test(s)||/\.topojson$/i.test(s))a=gb.load(JSON.parse(o.target.result),{sourceUri:s,clampToGround:i});else if(/\.(kml|kmz)$/i.test(s))a=JE.load(t,{sourceUri:s,proxy:n,camera:r.camera,canvas:r.canvas,clampToGround:i,screenOverlayContainer:e.container});else if(/\.gpx$/i.test(s))a=FU.load(t,{sourceUri:s,proxy:n});else{e.dropError.raiseEvent(e,s,`Unrecognized file: ${s}`);return}l(a)&&e.dataSources.add(a).then(function(c){e.flyToOnDrop&&e.flyTo(c)}).catch(function(c){e.dropError.raiseEvent(e,s,c)})}catch(a){e.dropError.raiseEvent(e,s,a)}}}function x9t(e,t){return function(n){e.dropError.raiseEvent(e,t.name,n.target.error)}}var Jle=A9t;function T9t(e,t){t=t??H.EMPTY_OBJECT;let n=new $8({scene:e.scene,container:e.bottomContainer,lowFrameRateMessage:t.lowFrameRateMessage});Object.defineProperties(e,{performanceWatchdog:{get:function(){return n}}})}var Zle=T9t;function C3e(e){let t=e.split(` + </div>`,n.appendChild(i);let r=new q8(t);ve.track(r),ve.applyBindings(r,n),l(r.defaultLayer)&&(r.currentLayer=r.defaultLayer)}var zle=G5t;var W5t="M 13.84375 7.03125 C 11.412798 7.03125 9.46875 8.975298 9.46875 11.40625 L 9.46875 11.59375 L 2.53125 7.21875 L 2.53125 24.0625 L 9.46875 19.6875 C 9.4853444 22.104033 11.423165 24.0625 13.84375 24.0625 L 25.875 24.0625 C 28.305952 24.0625 30.28125 22.087202 30.28125 19.65625 L 30.28125 11.40625 C 30.28125 8.975298 28.305952 7.03125 25.875 7.03125 L 13.84375 7.03125 z",q5t="M 27.34375 1.65625 L 5.28125 27.9375 L 8.09375 30.3125 L 30.15625 4.03125 L 27.34375 1.65625 z M 13.84375 7.03125 C 11.412798 7.03125 9.46875 8.975298 9.46875 11.40625 L 9.46875 11.59375 L 2.53125 7.21875 L 2.53125 24.0625 L 9.46875 19.6875 C 9.4724893 20.232036 9.5676108 20.7379 9.75 21.21875 L 21.65625 7.03125 L 13.84375 7.03125 z M 28.21875 7.71875 L 14.53125 24.0625 L 25.875 24.0625 C 28.305952 24.0625 30.28125 22.087202 30.28125 19.65625 L 30.28125 11.40625 C 30.28125 9.8371439 29.456025 8.4902779 28.21875 7.71875 z";function Vle(){this._cameraClicked=new be,this._closeClicked=new be,this.maxHeight=500,this.enableCamera=!1,this.isCameraTracking=!1,this.showInfo=!1,this.titleText="",this.description="",ve.track(this,["showInfo","titleText","description","maxHeight","enableCamera","isCameraTracking"]),this._loadingIndicatorHtml='<div class="cesium-infoBox-loadingContainer"><span class="cesium-infoBox-loading"></span></div>',this.cameraIconPath=void 0,ve.defineProperty(this,"cameraIconPath",{get:function(){return!this.enableCamera||this.isCameraTracking?q5t:W5t}}),ve.defineProperty(this,"_bodyless",{get:function(){return!l(this.description)||this.description.length===0}})}Vle.prototype.maxHeightOffset=function(e){return`${this.maxHeight-e}px`};Object.defineProperties(Vle.prototype,{cameraClicked:{get:function(){return this._cameraClicked}},closeClicked:{get:function(){return this._closeClicked}}});var Y8=Vle;function mq(e){e=Ln(e);let t=document.createElement("div");t.className="cesium-infoBox",t.setAttribute("data-bind",'css: { "cesium-infoBox-visible" : showInfo, "cesium-infoBox-bodyless" : _bodyless }'),e.appendChild(t);let n=document.createElement("div");n.className="cesium-infoBox-title",n.setAttribute("data-bind","text: titleText"),t.appendChild(n);let i=t.ownerDocument,r,o,s,a,c;function u(b){!l(r)||l(b)&&b.pointerId!==r||(r=void 0,t.classList.remove("cesium-infoBox-dragging"))}function f(b){if(!(b.button!==0||b.isPrimary===!1)){r=b.pointerId,o=b.clientX,s=b.clientY,a=t.offsetLeft,c=t.offsetTop,t.style.left=`${a}px`,t.style.top=`${c}px`,t.style.right="auto",t.classList.add("cesium-infoBox-dragging");try{n.setPointerCapture(b.pointerId)}catch{}b.preventDefault()}}function d(b){!l(r)||b.pointerId!==r||(t.style.left=`${a+b.clientX-o}px`,t.style.top=`${c+b.clientY-s}px`,b.preventDefault())}n.addEventListener("pointerdown",f),i.addEventListener("pointermove",d),i.addEventListener("pointerup",u),i.addEventListener("pointercancel",u);let p=document.createElement("button");p.type="button",p.className="cesium-button cesium-infoBox-camera",p.setAttribute("data-bind",'attr: { title: "Focus camera on object" },click: function () { cameraClicked.raiseEvent(this); },enable: enableCamera,cesiumSvgPath: { path: cameraIconPath, width: 32, height: 32 }'),t.appendChild(p);let g=document.createElement("button");g.type="button",g.className="cesium-infoBox-close",g.setAttribute("data-bind","click: function () { closeClicked.raiseEvent(this); }"),g.innerHTML="×",t.appendChild(g);let m=document.createElement("iframe");m.className="cesium-infoBox-iframe",m.setAttribute("sandbox","allow-same-origin allow-popups allow-forms"),m.setAttribute("data-bind","style : { maxHeight : maxHeightOffset(40) }"),m.setAttribute("allowfullscreen",!0),t.appendChild(m);let y=new Y8;ve.applyBindings(y,t),this._container=e,this._element=t,this._frame=m,this._viewModel=y,this._descriptionSubscription=void 0,this._titleElement=n,this._ownerDocument=i,this._handlePointerDown=f,this._handlePointerMove=d,this._stopDragging=u;let A=this;m.addEventListener("load",function(){let b=m.contentDocument,x=b.createElement("link");x.href=Zt("Widgets/InfoBox/InfoBoxDescription.css"),x.rel="stylesheet",x.type="text/css";let T=b.createElement("div");T.className="cesium-infoBox-description",b.head.appendChild(x),b.body.appendChild(T),A._descriptionSubscription=Cc(y,"description",function(E){m.style.height="5px",T.innerHTML=E;let v=null,S=T.firstElementChild;if(S!==null&&T.childNodes.length===1){let R=window.getComputedStyle(S);if(R!==null){let O=R["background-color"],L=z.fromCssColorString(O);l(L)&&L.alpha!==0&&(v=R["background-color"])}}t.style["background-color"]=v;let I=T.getBoundingClientRect().height;m.style.height=`${I}px`})}),m.setAttribute("src","about:blank")}Object.defineProperties(mq.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}},frame:{get:function(){return this._frame}}});mq.prototype.isDestroyed=function(){return!1};mq.prototype.destroy=function(){let e=this._container,t=this._ownerDocument;return this._titleElement.removeEventListener("pointerdown",this._handlePointerDown),t.removeEventListener("pointermove",this._handlePointerMove),t.removeEventListener("pointerup",this._stopDragging),t.removeEventListener("pointercancel",this._stopDragging),ve.cleanNode(this._element),e.removeChild(this._element),l(this._descriptionSubscription)&&this._descriptionSubscription.dispose(),le(this)};var X8=mq;function p3e(){this.showInstructions=!1;let e=this;this._command=Rn(function(){e.showInstructions=!e.showInstructions}),this._showClick=Rn(function(){e._touch=!1}),this._showTouch=Rn(function(){e._touch=!0}),this._touch=!1,this.tooltip="Navigation Instructions",ve.track(this,["tooltip","showInstructions","_touch"])}Object.defineProperties(p3e.prototype,{command:{get:function(){return this._command}},showClick:{get:function(){return this._showClick}},showTouch:{get:function(){return this._showTouch}}});var K8=p3e;function pq(e){let t=Ln(e.container),n=new K8,i=e.instructionsInitiallyVisible??!1;n.showInstructions=i,n._svgPath="M16,1.466C7.973,1.466,1.466,7.973,1.466,16c0,8.027,6.507,14.534,14.534,14.534c8.027,0,14.534-6.507,14.534-14.534C30.534,7.973,24.027,1.466,16,1.466z M17.328,24.371h-2.707v-2.596h2.707V24.371zM17.328,19.003v0.858h-2.707v-1.057c0-3.19,3.63-3.696,3.63-5.963c0-1.034-0.924-1.826-2.134-1.826c-1.254,0-2.354,0.924-2.354,0.924l-1.541-1.915c0,0,1.519-1.584,4.137-1.584c2.487,0,4.796,1.54,4.796,4.136C21.156,16.208,17.328,16.627,17.328,19.003z";let r=document.createElement("span");r.className="cesium-navigationHelpButton-wrapper",t.appendChild(r);let o=document.createElement("button");o.type="button",o.className="cesium-button cesium-toolbar-button cesium-navigation-help-button",o.setAttribute("data-bind","attr: { title: tooltip },click: command,cesiumSvgPath: { path: _svgPath, width: 32, height: 32 }"),r.appendChild(o);let s=document.createElement("div");s.className="cesium-navigation-help",s.setAttribute("data-bind",'css: { "cesium-navigation-help-visible" : showInstructions}'),r.appendChild(s);let a=document.createElement("button");a.type="button",a.className="cesium-navigation-button cesium-navigation-button-left",a.setAttribute("data-bind",'click: showClick, css: {"cesium-navigation-button-selected": !_touch, "cesium-navigation-button-unselected": _touch}');let c=document.createElement("img");c.src=Zt("Widgets/Images/NavigationHelp/Mouse.svg"),c.className="cesium-navigation-button-icon",c.style.width="25px",c.style.height="25px",a.appendChild(c),a.appendChild(document.createTextNode("Mouse"));let u=document.createElement("button");u.type="button",u.className="cesium-navigation-button cesium-navigation-button-right",u.setAttribute("data-bind",'click: showTouch, css: {"cesium-navigation-button-selected": _touch, "cesium-navigation-button-unselected": !_touch}');let f=document.createElement("img");f.src=Zt("Widgets/Images/NavigationHelp/Touch.svg"),f.className="cesium-navigation-button-icon",f.style.width="25px",f.style.height="25px",u.appendChild(f),u.appendChild(document.createTextNode("Touch")),s.appendChild(a),s.appendChild(u);let d=document.createElement("div");d.className="cesium-click-navigation-help cesium-navigation-help-instructions",d.setAttribute("data-bind",'css: { "cesium-click-navigation-help-visible" : !_touch}'),d.innerHTML=` <table> <tr> <td><img src="${Zt("Widgets/Images/NavigationHelp/MouseLeft.svg")}" width="48" height="48" /></td> <td> <div class="cesium-navigation-help-pan">Pan view</div> <div class="cesium-navigation-help-details">Left click + drag</div> </td> </tr> <tr> <td><img src="${Zt("Widgets/Images/NavigationHelp/MouseRight.svg")}" width="48" height="48" /></td> <td> <div class="cesium-navigation-help-zoom">Zoom view</div> <div class="cesium-navigation-help-details">Right click + drag, or</div> <div class="cesium-navigation-help-details">Mouse wheel scroll</div> </td> </tr> <tr> <td><img src="${Zt("Widgets/Images/NavigationHelp/MouseMiddle.svg")}" width="48" height="48" /></td> <td> <div class="cesium-navigation-help-rotate">Rotate view</div> <div class="cesium-navigation-help-details">Middle click + drag, or</div> <div class="cesium-navigation-help-details">CTRL + Left/Right click + drag</div> </td> </tr> </table>`,s.appendChild(d);let p=document.createElement("div");p.className="cesium-touch-navigation-help cesium-navigation-help-instructions",p.setAttribute("data-bind",'css: { "cesium-touch-navigation-help-visible" : _touch}'),p.innerHTML=` <table> <tr> <td><img src="${Zt("Widgets/Images/NavigationHelp/TouchDrag.svg")}" width="70" height="48" /></td> <td> <div class="cesium-navigation-help-pan">Pan view</div> <div class="cesium-navigation-help-details">One finger drag</div> </td> </tr> <tr> <td><img src="${Zt("Widgets/Images/NavigationHelp/TouchZoom.svg")}" width="70" height="48" /></td> <td> <div class="cesium-navigation-help-zoom">Zoom view</div> <div class="cesium-navigation-help-details">Two finger pinch</div> </td> </tr> <tr> <td><img src="${Zt("Widgets/Images/NavigationHelp/TouchTilt.svg")}" width="70" height="48" /></td> <td> <div class="cesium-navigation-help-rotate">Tilt view</div> <div class="cesium-navigation-help-details">Two finger drag, same direction</div> </td> </tr> <tr> <td><img src="${Zt("Widgets/Images/NavigationHelp/TouchRotate.svg")}" width="70" height="48" /></td> <td> <div class="cesium-navigation-help-tilt">Rotate view</div> <div class="cesium-navigation-help-details">Two finger drag, opposite direction</div> </td> </tr> </table>`,s.appendChild(p),ve.applyBindings(n,r),this._container=t,this._viewModel=n,this._wrapper=r,this._closeInstructions=function(g){r.contains(g.target)||(n.showInstructions=!1)},dn.supportsPointerEvents()?document.addEventListener("pointerdown",this._closeInstructions,!0):(document.addEventListener("mousedown",this._closeInstructions,!0),document.addEventListener("touchstart",this._closeInstructions,!0))}Object.defineProperties(pq.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}}});pq.prototype.isDestroyed=function(){return!1};pq.prototype.destroy=function(){return dn.supportsPointerEvents()?document.removeEventListener("pointerdown",this._closeInstructions,!0):(document.removeEventListener("mousedown",this._closeInstructions,!0),document.removeEventListener("touchstart",this._closeInstructions,!0)),ve.cleanNode(this._wrapper),this._container.removeChild(this._wrapper),le(this)};var $8=pq;function jle(e){this._scene=e.scene,this.lowFrameRateMessage=e.lowFrameRateMessage??"This application appears to be performing poorly on your system. Please try using a different web browser or updating your video drivers.",this.lowFrameRateMessageDismissed=!1,this.showingLowFrameRateMessage=!1,ve.track(this,["lowFrameRateMessage","lowFrameRateMessageDismissed","showingLowFrameRateMessage"]);let t=this;this._dismissMessage=Rn(function(){t.showingLowFrameRateMessage=!1,t.lowFrameRateMessageDismissed=!0});let n=n8.fromScene(e.scene);this._unsubscribeLowFrameRate=n.lowFrameRate.addEventListener(function(){t.lowFrameRateMessageDismissed||(t.showingLowFrameRateMessage=!0)}),this._unsubscribeNominalFrameRate=n.nominalFrameRate.addEventListener(function(){t.showingLowFrameRateMessage=!1})}Object.defineProperties(jle.prototype,{scene:{get:function(){return this._scene}},dismissMessage:{get:function(){return this._dismissMessage}}});jle.prototype.destroy=function(){return this._unsubscribeLowFrameRate(),this._unsubscribeNominalFrameRate(),le(this)};var J8=jle;function gq(e){let t=Ln(e.container),n=new J8(e),i=document.createElement("div");i.className="cesium-performance-watchdog-message-area",i.setAttribute("data-bind","visible: showingLowFrameRateMessage");let r=document.createElement("button");r.setAttribute("type","button"),r.className="cesium-performance-watchdog-message-dismiss",r.innerHTML="×",r.setAttribute("data-bind","click: dismissMessage"),i.appendChild(r);let o=document.createElement("div");o.className="cesium-performance-watchdog-message",o.setAttribute("data-bind","html: lowFrameRateMessage"),i.appendChild(o),t.appendChild(i),ve.applyBindings(n,i),this._container=t,this._viewModel=n,this._element=i}Object.defineProperties(gq.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}}});gq.prototype.isDestroyed=function(){return!1};gq.prototype.destroy=function(){return this._viewModel.destroy(),ve.cleanNode(this._element),this._container.removeChild(this._element),le(this)};var Z8=gq;function _q(e){this._scene=e,this._orthographic=e.camera.frustum instanceof gn,this._flightInProgress=!1,this.dropDownVisible=!1,this.tooltipPerspective="Perspective Projection",this.tooltipOrthographic="Orthographic Projection",this.selectedTooltip=void 0,this.sceneMode=e.mode,ve.track(this,["_orthographic","_flightInProgress","sceneMode","dropDownVisible","tooltipPerspective","tooltipOrthographic"]);let t=this;ve.defineProperty(this,"selectedTooltip",function(){return t._orthographic?t.tooltipOrthographic:t.tooltipPerspective}),this._toggleDropDown=Rn(function(){t.sceneMode===re.SCENE2D||t._flightInProgress||(t.dropDownVisible=!t.dropDownVisible)}),this._eventHelper=new jo,this._eventHelper.add(e.morphComplete,function(n,i,r,o){t.sceneMode=r,t._orthographic=r===re.SCENE2D||t._scene.camera.frustum instanceof gn}),this._eventHelper.add(e.preRender,function(){t._flightInProgress=l(e.camera._currentFlight)}),this._switchToPerspective=Rn(function(){t.sceneMode!==re.SCENE2D&&(t._scene.camera.switchToPerspectiveFrustum(),t._orthographic=!1,t.dropDownVisible=!1)}),this._switchToOrthographic=Rn(function(){t.sceneMode!==re.SCENE2D&&(t._scene.camera.switchToOrthographicFrustum(),t._orthographic=!0,t.dropDownVisible=!1)}),this._sceneMode=re}Object.defineProperties(_q.prototype,{scene:{get:function(){return this._scene}},toggleDropDown:{get:function(){return this._toggleDropDown}},switchToPerspective:{get:function(){return this._switchToPerspective}},switchToOrthographic:{get:function(){return this._switchToOrthographic}},isOrthographicProjection:{get:function(){return this._orthographic}}});_q.prototype.isDestroyed=function(){return!1};_q.prototype.destroy=function(){this._eventHelper.removeAll(),le(this)};var Q8=_q;var Y5t="M 28.15625,10.4375 9.125,13.21875 13.75,43.25 41.75,55.09375 50.8125,37 54.5,11.9375 z m 0.125,3 19.976451,0.394265 L 43.03125,16.875 22.6875,14.28125 z M 50.971746,15.705477 47.90625,36.03125 42.53125,46 44.84375,19.3125 z M 12.625,16.03125 l 29.15625,3.6875 -2.65625,31 L 16.4375,41.125 z",X5t="m 31.560594,6.5254438 -20.75,12.4687502 0.1875,24.5625 22.28125,11.8125 19.5,-12 0.65625,-0.375 0,-0.75 0.0312,-23.21875 z m 0.0625,3.125 16.65625,9.5000002 -16.125,10.28125 -17.34375,-9.71875 z m 18.96875,11.1875002 0.15625,20.65625 -17.46875,10.59375 0.15625,-20.28125 z m -37.0625,1.25 17.21875,9.625 -0.15625,19.21875 -16.9375,-9 z";function yq(e,t){e=Ln(e);let n=new Q8(t);n._perspectivePath=Y5t,n._orthographicPath=X5t;let i=document.createElement("span");i.className="cesium-projectionPicker-wrapper cesium-toolbar-button",e.appendChild(i);let r=document.createElement("button");r.type="button",r.className="cesium-button cesium-toolbar-button",r.setAttribute("data-bind",'css: { "cesium-projectionPicker-buttonPerspective": !_orthographic, "cesium-projectionPicker-buttonOrthographic": _orthographic, "cesium-button-disabled" : sceneMode === _sceneMode.SCENE2D || _flightInProgress, "cesium-projectionPicker-selected": dropDownVisible },attr: { title: selectedTooltip },click: toggleDropDown'),r.innerHTML='<!-- ko cesiumSvgPath: { path: _perspectivePath, width: 64, height: 64, css: "cesium-projectionPicker-iconPerspective" } --><!-- /ko --><!-- ko cesiumSvgPath: { path: _orthographicPath, width: 64, height: 64, css: "cesium-projectionPicker-iconOrthographic" } --><!-- /ko -->',i.appendChild(r);let o=document.createElement("button");o.type="button",o.className="cesium-button cesium-toolbar-button cesium-projectionPicker-dropDown-icon",o.setAttribute("data-bind",'css: { "cesium-projectionPicker-visible" : (dropDownVisible && _orthographic), "cesium-projectionPicker-none" : !_orthographic, "cesium-projectionPicker-hidden" : !dropDownVisible },attr: { title: tooltipPerspective },click: switchToPerspective,cesiumSvgPath: { path: _perspectivePath, width: 64, height: 64 }'),i.appendChild(o);let s=document.createElement("button");s.type="button",s.className="cesium-button cesium-toolbar-button cesium-projectionPicker-dropDown-icon",s.setAttribute("data-bind",'css: { "cesium-projectionPicker-visible" : (dropDownVisible && !_orthographic), "cesium-projectionPicker-none" : _orthographic, "cesium-projectionPicker-hidden" : !dropDownVisible},attr: { title: tooltipOrthographic },click: switchToOrthographic,cesiumSvgPath: { path: _orthographicPath, width: 64, height: 64 }'),i.appendChild(s),ve.applyBindings(n,i),this._viewModel=n,this._container=e,this._wrapper=i,this._closeDropDown=function(a){i.contains(a.target)||(n.dropDownVisible=!1)},dn.supportsPointerEvents()?document.addEventListener("pointerdown",this._closeDropDown,!0):(document.addEventListener("mousedown",this._closeDropDown,!0),document.addEventListener("touchstart",this._closeDropDown,!0))}Object.defineProperties(yq.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}}});yq.prototype.isDestroyed=function(){return!1};yq.prototype.destroy=function(){return this._viewModel.destroy(),dn.supportsPointerEvents()?document.removeEventListener("pointerdown",this._closeDropDown,!0):(document.removeEventListener("mousedown",this._closeDropDown,!0),document.removeEventListener("touchstart",this._closeDropDown,!0)),ve.cleanNode(this._wrapper),this._container.removeChild(this._wrapper),le(this)};var ej=yq;function Aq(e,t){this._scene=e;let n=this,i=function(r,o,s,a){n.sceneMode=s,n.dropDownVisible=!1};this._eventHelper=new jo,this._eventHelper.add(e.morphStart,i),this._duration=t??2,this.sceneMode=e.mode,this.dropDownVisible=!1,this.tooltip2D="2D",this.tooltip3D="3D",this.tooltipColumbusView="Columbus View",ve.track(this,["sceneMode","dropDownVisible","tooltip2D","tooltip3D","tooltipColumbusView"]),this.selectedTooltip=void 0,ve.defineProperty(this,"selectedTooltip",function(){let r=n.sceneMode;return r===re.SCENE2D?n.tooltip2D:r===re.SCENE3D?n.tooltip3D:n.tooltipColumbusView}),this._toggleDropDown=Rn(function(){n.dropDownVisible=!n.dropDownVisible}),this._morphTo2D=Rn(function(){e.morphTo2D(n._duration)}),this._morphTo3D=Rn(function(){e.morphTo3D(n._duration)}),this._morphToColumbusView=Rn(function(){e.morphToColumbusView(n._duration)}),this._sceneMode=re}Object.defineProperties(Aq.prototype,{scene:{get:function(){return this._scene}},duration:{get:function(){return this._duration},set:function(e){this._duration=e}},toggleDropDown:{get:function(){return this._toggleDropDown}},morphTo2D:{get:function(){return this._morphTo2D}},morphTo3D:{get:function(){return this._morphTo3D}},morphToColumbusView:{get:function(){return this._morphToColumbusView}}});Aq.prototype.isDestroyed=function(){return!1};Aq.prototype.destroy=function(){this._eventHelper.removeAll(),le(this)};var tj=Aq;var K5t="m 32.401392,4.9330437 c -7.087603,0 -14.096095,2.884602 -19.10793,7.8946843 -5.0118352,5.010083 -7.9296167,11.987468 -7.9296167,19.072999 0,7.085531 2.9177815,14.097848 7.9296167,19.107931 4.837653,4.835961 11.541408,7.631372 18.374354,7.82482 0.05712,0.01231 0.454119,0.139729 0.454119,0.139729 l 0.03493,-0.104797 c 0.08246,7.84e-4 0.162033,0.03493 0.244525,0.03493 0.08304,0 0.161515,-0.03414 0.244526,-0.03493 l 0.03493,0.104797 c 0,0 0.309474,-0.129487 0.349323,-0.139729 6.867765,-0.168094 13.582903,-2.965206 18.444218,-7.82482 2.558195,-2.5573 4.551081,-5.638134 5.903547,-8.977584 1.297191,-3.202966 2.02607,-6.661489 2.02607,-10.130347 0,-6.237309 -2.366261,-12.31219 -6.322734,-17.116794 -0.0034,-0.02316 0.0049,-0.04488 0,-0.06986 -0.01733,-0.08745 -0.104529,-0.278855 -0.104797,-0.279458 -5.31e-4,-0.0012 -0.522988,-0.628147 -0.523984,-0.62878 -3.47e-4,-2.2e-4 -0.133444,-0.03532 -0.244525,-0.06987 C 51.944299,13.447603 51.751076,13.104317 51.474391,12.827728 46.462556,7.8176457 39.488996,4.9330437 32.401392,4.9330437 z m -2.130866,3.5281554 0.104797,9.6762289 c -4.111695,-0.08361 -7.109829,-0.423664 -9.257041,-0.943171 1.198093,-2.269271 2.524531,-4.124404 3.91241,-5.414496 2.167498,-2.0147811 3.950145,-2.8540169 5.239834,-3.3185619 z m 2.794579,0 c 1.280302,0.4754953 3.022186,1.3285948 5.065173,3.2486979 1.424667,1.338973 2.788862,3.303645 3.982275,5.728886 -2.29082,0.403367 -5.381258,0.621049 -8.942651,0.698645 L 33.065105,8.4611991 z m 5.728886,0.2445256 c 4.004072,1.1230822 7.793098,3.1481363 10.724195,6.0782083 0.03468,0.03466 0.07033,0.06991 0.104797,0.104797 -0.45375,0.313891 -0.923054,0.663002 -1.956205,1.082899 -0.647388,0.263114 -1.906242,0.477396 -2.829511,0.733577 -1.382296,-2.988132 -3.027146,-5.368585 -4.785716,-7.0213781 -0.422866,-0.397432 -0.835818,-0.6453247 -1.25756,-0.9781032 z m -15.33525,0.7685092 c -0.106753,0.09503 -0.207753,0.145402 -0.31439,0.244526 -1.684973,1.5662541 -3.298068,3.8232211 -4.680919,6.5672591 -0.343797,-0.14942 -1.035052,-0.273198 -1.292493,-0.419186 -0.956528,-0.542427 -1.362964,-1.022024 -1.537018,-1.292493 -0.0241,-0.03745 -0.01868,-0.0401 -0.03493,-0.06986 2.250095,-2.163342 4.948824,-3.869984 7.859752,-5.0302421 z m -9.641296,7.0912431 c 0.464973,0.571618 0.937729,1.169056 1.956205,1.746612 0.349907,0.198425 1.107143,0.335404 1.537018,0.523983 -1.20166,3.172984 -1.998037,7.051901 -2.165798,11.772162 C 14.256557,30.361384 12.934823,30.161483 12.280427,29.90959 10.644437,29.279855 9.6888882,28.674891 9.1714586,28.267775 8.6540289,27.860658 8.6474751,27.778724 8.6474751,27.778724 l -0.069864,0.03493 C 9.3100294,23.691285 11.163248,19.798527 13.817445,16.565477 z m 37.552149,0.523984 c 2.548924,3.289983 4.265057,7.202594 4.890513,11.318043 -0.650428,0.410896 -1.756876,1.001936 -3.563088,1.606882 -1.171552,0.392383 -3.163859,0.759153 -4.960377,1.117832 -0.04367,-4.752703 -0.784809,-8.591423 -1.88634,-11.807094 0.917574,-0.263678 2.170552,-0.486495 2.864443,-0.76851 1.274693,-0.518066 2.003942,-1.001558 2.654849,-1.467153 z m -31.439008,2.619917 c 2.487341,0.672766 5.775813,1.137775 10.479669,1.222628 l 0.104797,10.689263 0,0.03493 0,0.733577 c -5.435005,-0.09059 -9.512219,-0.519044 -12.610536,-1.117831 0.106127,-4.776683 0.879334,-8.55791 2.02607,-11.562569 z m 23.264866,0.31439 c 1.073459,3.067541 1.833795,6.821314 1.816476,11.702298 -3.054474,0.423245 -7.062018,0.648559 -11.702298,0.698644 l 0,-0.838373 -0.104796,-10.654331 c 4.082416,-0.0864 7.404468,-0.403886 9.990618,-0.908238 z M 8.2632205,30.922625 c 0.7558676,0.510548 1.5529563,1.013339 3.0041715,1.57195 0.937518,0.360875 2.612202,0.647642 3.91241,0.978102 0.112814,3.85566 0.703989,7.107756 1.606883,9.920754 -1.147172,-0.324262 -2.644553,-0.640648 -3.423359,-0.978102 -1.516688,-0.657177 -2.386627,-1.287332 -2.864443,-1.71168 -0.477816,-0.424347 -0.489051,-0.489051 -0.489051,-0.489051 L 9.8002387,40.319395 C 8.791691,37.621767 8.1584238,34.769583 8.1584238,31.900727 c 0,-0.330153 0.090589,-0.648169 0.1047967,-0.978102 z m 48.2763445,0.419186 c 0.0047,0.188973 0.06986,0.36991 0.06986,0.558916 0,2.938869 -0.620228,5.873558 -1.676747,8.628261 -0.07435,0.07583 -0.06552,0.07411 -0.454119,0.349323 -0.606965,0.429857 -1.631665,1.042044 -3.318562,1.676747 -1.208528,0.454713 -3.204964,0.850894 -5.135038,1.25756 0.84593,-2.765726 1.41808,-6.005357 1.606883,-9.815957 2.232369,-0.413371 4.483758,-0.840201 5.938479,-1.327425 1.410632,-0.472457 2.153108,-0.89469 2.96924,-1.327425 z m -38.530252,2.864443 c 3.208141,0.56697 7.372279,0.898588 12.575603,0.978103 l 0.174662,9.885821 c -4.392517,-0.06139 -8.106722,-0.320566 -10.863925,-0.803441 -1.051954,-2.664695 -1.692909,-6.043794 -1.88634,-10.060483 z m 26.793022,0.31439 c -0.246298,3.923551 -0.877762,7.263679 -1.816476,9.885822 -2.561957,0.361954 -5.766249,0.560708 -9.431703,0.62878 l -0.174661,-9.815957 c 4.491734,-0.04969 8.334769,-0.293032 11.42284,-0.698645 z M 12.035901,44.860585 c 0.09977,0.04523 0.105535,0.09465 0.209594,0.139729 1.337656,0.579602 3.441099,1.058072 5.589157,1.537018 1.545042,3.399208 3.548524,5.969402 5.589157,7.789888 -3.034411,-1.215537 -5.871615,-3.007978 -8.174142,-5.309699 -1.245911,-1.245475 -2.271794,-2.662961 -3.213766,-4.156936 z m 40.69605,0 c -0.941972,1.493975 -1.967855,2.911461 -3.213765,4.156936 -2.74253,2.741571 -6.244106,4.696717 -9.955686,5.868615 0.261347,-0.241079 0.507495,-0.394491 0.768509,-0.663713 1.674841,-1.727516 3.320792,-4.181056 4.645987,-7.265904 2.962447,-0.503021 5.408965,-1.122293 7.161107,-1.781544 0.284034,-0.106865 0.337297,-0.207323 0.593848,-0.31439 z m -31.404076,2.305527 c 2.645807,0.376448 5.701178,0.649995 9.466635,0.698645 l 0.139729,7.789888 c -1.38739,-0.480844 -3.316218,-1.29837 -5.659022,-3.388427 -1.388822,-1.238993 -2.743668,-3.0113 -3.947342,-5.100106 z m 20.365491,0.104797 c -1.04872,2.041937 -2.174337,3.779068 -3.353494,4.995309 -1.853177,1.911459 -3.425515,2.82679 -4.611055,3.353494 l -0.139729,-7.789887 c 3.13091,-0.05714 5.728238,-0.278725 8.104278,-0.558916 z",$5t="m 2.9825053,17.550598 0,1.368113 0,26.267766 0,1.368113 1.36811,0 54.9981397,0 1.36811,0 0,-1.368113 0,-26.267766 0,-1.368113 -1.36811,0 -54.9981397,0 -1.36811,0 z m 2.73623,2.736226 10.3292497,0 0,10.466063 -10.3292497,0 0,-10.466063 z m 13.0654697,0 11.69737,0 0,10.466063 -11.69737,0 0,-10.466063 z m 14.43359,0 11.69737,0 0,10.466063 -11.69737,0 0,-10.466063 z m 14.43359,0 10.32926,0 0,10.466063 -10.32926,0 0,-10.466063 z m -41.9326497,13.202288 10.3292497,0 0,10.329252 -10.3292497,0 0,-10.329252 z m 13.0654697,0 11.69737,0 0,10.329252 -11.69737,0 0,-10.329252 z m 14.43359,0 11.69737,0 0,10.329252 -11.69737,0 0,-10.329252 z m 14.43359,0 10.32926,0 0,10.329252 -10.32926,0 0,-10.329252 z",J5t="m 14.723969,17.675598 -0.340489,0.817175 -11.1680536,26.183638 -0.817175,1.872692 2.076986,0 54.7506996,0 2.07698,0 -0.81717,-1.872692 -11.16805,-26.183638 -0.34049,-0.817175 -0.91933,0 -32.414586,0 -0.919322,0 z m 1.838643,2.723916 6.196908,0 -2.928209,10.418977 -7.729111,0 4.460412,-10.418977 z m 9.02297,0 4.903049,0 0,10.418977 -7.831258,0 2.928209,-10.418977 z m 7.626964,0 5.584031,0 2.62176,10.418977 -8.205791,0 0,-10.418977 z m 8.410081,0 5.51593,0 4.46042,10.418977 -7.38863,0 -2.58772,-10.418977 z m -30.678091,13.142892 8.103649,0 -2.89416,10.282782 -9.6018026,0 4.3923136,-10.282782 z m 10.929711,0 8.614384,0 0,10.282782 -11.508544,0 2.89416,-10.282782 z m 11.338299,0 8.852721,0 2.58772,10.282782 -11.440441,0 0,-10.282782 z m 11.678781,0 7.86531,0 4.39231,10.282782 -9.6699,0 -2.58772,-10.282782 z";function bq(e,t,n){e=Ln(e);let i=new tj(t,n);i._globePath=K5t,i._flatMapPath=$5t,i._columbusViewPath=J5t;let r=document.createElement("span");r.className="cesium-sceneModePicker-wrapper cesium-toolbar-button",e.appendChild(r);let o=document.createElement("button");o.type="button",o.className="cesium-button cesium-toolbar-button",o.setAttribute("data-bind",'css: { "cesium-sceneModePicker-button2D": sceneMode === _sceneMode.SCENE2D, "cesium-sceneModePicker-button3D": sceneMode === _sceneMode.SCENE3D, "cesium-sceneModePicker-buttonColumbusView": sceneMode === _sceneMode.COLUMBUS_VIEW, "cesium-sceneModePicker-selected": dropDownVisible },attr: { title: selectedTooltip },click: toggleDropDown'),o.innerHTML='<!-- ko cesiumSvgPath: { path: _globePath, width: 64, height: 64, css: "cesium-sceneModePicker-slide-svg cesium-sceneModePicker-icon3D" } --><!-- /ko --><!-- ko cesiumSvgPath: { path: _flatMapPath, width: 64, height: 64, css: "cesium-sceneModePicker-slide-svg cesium-sceneModePicker-icon2D" } --><!-- /ko --><!-- ko cesiumSvgPath: { path: _columbusViewPath, width: 64, height: 64, css: "cesium-sceneModePicker-slide-svg cesium-sceneModePicker-iconColumbusView" } --><!-- /ko -->',r.appendChild(o);let s=document.createElement("button");s.type="button",s.className="cesium-button cesium-toolbar-button cesium-sceneModePicker-dropDown-icon",s.setAttribute("data-bind",'css: { "cesium-sceneModePicker-visible" : (dropDownVisible && (sceneMode !== _sceneMode.SCENE3D)) || (!dropDownVisible && (sceneMode === _sceneMode.SCENE3D)), "cesium-sceneModePicker-none" : sceneMode === _sceneMode.SCENE3D, "cesium-sceneModePicker-hidden" : !dropDownVisible },attr: { title: tooltip3D },click: morphTo3D,cesiumSvgPath: { path: _globePath, width: 64, height: 64 }'),r.appendChild(s);let a=document.createElement("button");a.type="button",a.className="cesium-button cesium-toolbar-button cesium-sceneModePicker-dropDown-icon",a.setAttribute("data-bind",'css: { "cesium-sceneModePicker-visible" : (dropDownVisible && (sceneMode !== _sceneMode.SCENE2D)), "cesium-sceneModePicker-none" : sceneMode === _sceneMode.SCENE2D, "cesium-sceneModePicker-hidden" : !dropDownVisible },attr: { title: tooltip2D },click: morphTo2D,cesiumSvgPath: { path: _flatMapPath, width: 64, height: 64 }'),r.appendChild(a);let c=document.createElement("button");c.type="button",c.className="cesium-button cesium-toolbar-button cesium-sceneModePicker-dropDown-icon",c.setAttribute("data-bind",'css: { "cesium-sceneModePicker-visible" : (dropDownVisible && (sceneMode !== _sceneMode.COLUMBUS_VIEW)) || (!dropDownVisible && (sceneMode === _sceneMode.COLUMBUS_VIEW)), "cesium-sceneModePicker-none" : sceneMode === _sceneMode.COLUMBUS_VIEW, "cesium-sceneModePicker-hidden" : !dropDownVisible},attr: { title: tooltipColumbusView },click: morphToColumbusView,cesiumSvgPath: { path: _columbusViewPath, width: 64, height: 64 }'),r.appendChild(c),ve.applyBindings(i,r),this._viewModel=i,this._container=e,this._wrapper=r,this._closeDropDown=function(u){r.contains(u.target)||(i.dropDownVisible=!1)},dn.supportsPointerEvents()?document.addEventListener("pointerdown",this._closeDropDown,!0):(document.addEventListener("mousedown",this._closeDropDown,!0),document.addEventListener("touchstart",this._closeDropDown,!0))}Object.defineProperties(bq.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}}});bq.prototype.isDestroyed=function(){return!1};bq.prototype.destroy=function(){return this._viewModel.destroy(),dn.supportsPointerEvents()?document.removeEventListener("pointerdown",this._closeDropDown,!0):(document.removeEventListener("mousedown",this._closeDropDown,!0),document.removeEventListener("touchstart",this._closeDropDown,!0)),ve.cleanNode(this._wrapper),this._container.removeChild(this._wrapper),le(this)};var nj=bq;var Z5t=new U,xq="-1000px";function ij(e,t,n){this._scene=e,this._screenPositionX=xq,this._screenPositionY=xq,this._tweens=e.tweens,this._container=n??document.body,this._selectionIndicatorElement=t,this._scale=1,this.position=void 0,this.showSelection=!1,ve.track(this,["position","_screenPositionX","_screenPositionY","_scale","showSelection"]),this.isVisible=void 0,ve.defineProperty(this,"isVisible",{get:function(){return this.showSelection&&l(this.position)}}),ve.defineProperty(this,"_transform",{get:function(){return`scale(${this._scale})`}}),this.computeScreenSpacePosition=function(i,r){return dr.worldToWindowCoordinates(e,i,r)}}ij.prototype.update=function(){if(this.showSelection&&l(this.position)){let e=this.computeScreenSpacePosition(this.position,Z5t);if(!l(e))this._screenPositionX=xq,this._screenPositionY=xq;else{let t=this._container,n=t.parentNode.clientWidth,i=t.parentNode.clientHeight,r=this._selectionIndicatorElement.clientWidth,o=r*.5;e.x=Math.min(Math.max(e.x,-r),n+r)-o,e.y=Math.min(Math.max(e.y,-r),i+r)-o,this._screenPositionX=`${Math.floor(e.x+.25)}px`,this._screenPositionY=`${Math.floor(e.y+.25)}px`}}};ij.prototype.animateAppear=function(){this._tweens.addProperty({object:this,property:"_scale",startValue:2,stopValue:1,duration:.8,easingFunction:Rs.EXPONENTIAL_OUT})};ij.prototype.animateDepart=function(){this._tweens.addProperty({object:this,property:"_scale",startValue:this._scale,stopValue:1.5,duration:.8,easingFunction:Rs.EXPONENTIAL_OUT})};Object.defineProperties(ij.prototype,{container:{get:function(){return this._container}},selectionIndicatorElement:{get:function(){return this._selectionIndicatorElement}},scene:{get:function(){return this._scene}}});var rj=ij;function Tq(e,t){e=Ln(e),this._container=e;let n=document.createElement("div");n.className="cesium-selection-wrapper",n.setAttribute("data-bind",'style: { "top" : _screenPositionY, "left" : _screenPositionX },css: { "cesium-selection-wrapper-visible" : isVisible }'),e.appendChild(n),this._element=n;let i="http://www.w3.org/2000/svg",r="M -34 -34 L -34 -11.25 L -30 -15.25 L -30 -30 L -15.25 -30 L -11.25 -34 L -34 -34 z M 11.25 -34 L 15.25 -30 L 30 -30 L 30 -15.25 L 34 -11.25 L 34 -34 L 11.25 -34 z M -34 11.25 L -34 34 L -11.25 34 L -15.25 30 L -30 30 L -30 15.25 L -34 11.25 z M 34 11.25 L 30 15.25 L 30 30 L 15.25 30 L 11.25 34 L 34 34 L 34 11.25 z",o=document.createElementNS(i,"svg:svg");o.setAttribute("width",160),o.setAttribute("height",160),o.setAttribute("viewBox","0 0 160 160");let s=document.createElementNS(i,"g");s.setAttribute("transform","translate(80,80)"),o.appendChild(s);let a=document.createElementNS(i,"path");a.setAttribute("data-bind","attr: { transform: _transform }"),a.setAttribute("d",r),s.appendChild(a),n.appendChild(o);let c=new rj(t,this._element,this._container);this._viewModel=c,ve.applyBindings(this._viewModel,this._element)}Object.defineProperties(Tq.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}}});Tq.prototype.isDestroyed=function(){return!1};Tq.prototype.destroy=function(){let e=this._container;return ve.cleanNode(this._element),e.removeChild(this._element),le(this)};var oj=Tq;function JC(e,t,n){this._color=e,this._height=t,this._base=n??0}JC.prototype.getHeight=function(){return this._height};JC.prototype.getBase=function(){return this._base};JC.prototype.getStartTime=function(){return this._start};JC.prototype.getStopTime=function(){return this._stop};JC.prototype.setRange=function(e,t){this._start=e,this._stop=t};JC.prototype.render=function(e){let t="";if(this._start&&this._stop&&this._color){let n=K.secondsDifference(this._start,e.epochJulian),i=Math.round(e.timeBarWidth*e.getAlpha(n)),r=K.secondsDifference(this._stop,e.epochJulian),o=Math.round(e.timeBarWidth*e.getAlpha(r))-i;i<0&&(o+=i,i=0),i+o>e.timeBarWidth&&(o=e.timeBarWidth-i),o>0&&(t=`<span class="cesium-timeline-highlight" style="left: ${i.toString()}px; width: ${o.toString()}px; bottom: ${this._base.toString()}px; height: ${this._height}px; background-color: ${this._color};"></span>`)}return t};var sj=JC;function g3e(e,t,n,i){this.interval=e,this.height=t,this.color=n||new z(.5,.5,.5,1),this.backgroundColor=i||new z(0,0,0,0)}g3e.prototype.render=function(e,t){let n=this.interval.start,i=this.interval.stop,r=t.startJulian,o=K.addSeconds(t.startJulian,t.duration,new K);if(K.lessThan(n,r)&&K.greaterThan(i,o))e.fillStyle=this.color.toCssColorString(),e.fillRect(0,t.y,t.timeBarWidth,this.height);else if(K.lessThanOrEquals(n,o)&&K.greaterThanOrEquals(i,r)){let s,a,c;for(s=0;s<t.timeBarWidth;++s){let u=K.addSeconds(t.startJulian,s/t.timeBarWidth*t.duration,new K);!l(a)&&K.greaterThanOrEquals(u,n)?a=s:!l(c)&&K.greaterThanOrEquals(u,i)&&(c=s)}e.fillStyle=this.backgroundColor.toCssColorString(),e.fillRect(0,t.y,t.timeBarWidth,this.height),l(a)&&(l(c)||(c=t.timeBarWidth),e.fillStyle=this.color.toCssColorString(),e.fillRect(a,t.y,Math.max(c-a,1),this.height))}};var aj=g3e;var Hle=1e12,Oh={none:0,scrub:1,slide:2,zoom:3,touchOnly:4},Eu={none:0,scrub:1,slideZoom:2,singleTap:3,ignore:4},Xb=[.001,.002,.005,.01,.02,.05,.1,.25,.5,1,2,5,10,15,30,60,120,300,600,900,1800,3600,7200,14400,21600,43200,86400,172800,345600,604800,1296e3,2592e3,5184e3,7776e3,15552e3,31536e3,63072e3,126144e3,15768e4,31536e4,63072e4,126144e4,15768e5,31536e5,63072e5,126144e5,15768e6,31536e6],Q5t=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function Cu(e,t){e=Ln(e);let n=e.ownerDocument;this.container=e;let i=n.createElement("div");i.className="cesium-timeline-main",e.appendChild(i),this._topDiv=i,this._endJulian=void 0,this._epochJulian=void 0,this._lastXPos=void 0,this._scrubElement=void 0,this._startJulian=void 0,this._timeBarSecondsSpan=void 0,this._clock=t,this._scrubJulian=t.currentTime,this._mainTicSpan=-1,this._mouseMode=Oh.none,this._touchMode=Eu.none,this._touchState={centerX:0,spanX:0},this._mouseX=0,this._timelineDrag=0,this._timelineDragLocation=void 0,this._lastHeight=void 0,this._lastWidth=void 0,this._topDiv.innerHTML='<div class="cesium-timeline-bar"></div><div class="cesium-timeline-trackContainer"><canvas class="cesium-timeline-tracks" width="10" height="1"></canvas></div><div class="cesium-timeline-needle"></div><span class="cesium-timeline-ruler"></span>',this._timeBarEle=this._topDiv.childNodes[0],this._trackContainer=this._topDiv.childNodes[1],this._trackListEle=this._topDiv.childNodes[1].childNodes[0],this._needleEle=this._topDiv.childNodes[2],this._rulerEle=this._topDiv.childNodes[3],this._context=this._trackListEle.getContext("2d"),this._trackList=[],this._highlightRanges=[],this.zoomTo(t.startTime,t.stopTime),this._onMouseDown=e9t(this),this._onMouseUp=t9t(this),this._onMouseMove=n9t(this),this._onMouseWheel=i9t(this),this._onTouchStart=r9t(this),this._onTouchMove=s9t(this),this._onTouchEnd=o9t(this);let r=this._timeBarEle;n.addEventListener("mouseup",this._onMouseUp,!1),n.addEventListener("mousemove",this._onMouseMove,!1),r.addEventListener("mousedown",this._onMouseDown,!1),r.addEventListener("DOMMouseScroll",this._onMouseWheel,!1),r.addEventListener("mousewheel",this._onMouseWheel,!1),r.addEventListener("touchstart",this._onTouchStart,!1),r.addEventListener("touchmove",this._onTouchMove,!1),r.addEventListener("touchend",this._onTouchEnd,!1),r.addEventListener("touchcancel",this._onTouchEnd,!1),this._topDiv.oncontextmenu=function(){return!1},t.onTick.addEventListener(this.updateFromClock,this),this.updateFromClock()}Cu.prototype.addEventListener=function(e,t,n){this._topDiv.addEventListener(e,t,n)};Cu.prototype.removeEventListener=function(e,t,n){this._topDiv.removeEventListener(e,t,n)};Cu.prototype.isDestroyed=function(){return!1};Cu.prototype.destroy=function(){this._clock.onTick.removeEventListener(this.updateFromClock,this);let e=this.container.ownerDocument;e.removeEventListener("mouseup",this._onMouseUp,!1),e.removeEventListener("mousemove",this._onMouseMove,!1);let t=this._timeBarEle;t.removeEventListener("mousedown",this._onMouseDown,!1),t.removeEventListener("DOMMouseScroll",this._onMouseWheel,!1),t.removeEventListener("mousewheel",this._onMouseWheel,!1),t.removeEventListener("touchstart",this._onTouchStart,!1),t.removeEventListener("touchmove",this._onTouchMove,!1),t.removeEventListener("touchend",this._onTouchEnd,!1),t.removeEventListener("touchcancel",this._onTouchEnd,!1),this.container.removeChild(this._topDiv),le(this)};Cu.prototype.addHighlightRange=function(e,t,n){let i=new sj(e,t,n);return this._highlightRanges.push(i),this.resize(),i};Cu.prototype.addTrack=function(e,t,n,i){let r=new aj(e,t,n,i);return this._trackList.push(r),this._lastHeight=void 0,this.resize(),r};Cu.prototype.zoomTo=function(e,t){if(this._startJulian=e,this._endJulian=t,this._timeBarSecondsSpan=K.secondsDifference(t,e),this._clock&&this._clock.clockRange!==As.UNBOUNDED){let i=this._clock.startTime,r=this._clock.stopTime,o=K.secondsDifference(r,i),s=K.secondsDifference(i,this._startJulian),a=K.secondsDifference(r,this._endJulian);this._timeBarSecondsSpan>=o?(this._timeBarSecondsSpan=o,this._startJulian=this._clock.startTime,this._endJulian=this._clock.stopTime):s>0?(this._endJulian=K.addSeconds(this._endJulian,s,new K),this._startJulian=i,this._timeBarSecondsSpan=K.secondsDifference(this._endJulian,this._startJulian)):a<0&&(this._startJulian=K.addSeconds(this._startJulian,a,new K),this._endJulian=r,this._timeBarSecondsSpan=K.secondsDifference(this._endJulian,this._startJulian))}this._makeTics();let n=document.createEvent("Event");n.initEvent("setzoom",!0,!0),n.startJulian=this._startJulian,n.endJulian=this._endJulian,n.epochJulian=this._epochJulian,n.totalSpan=this._timeBarSecondsSpan,n.mainTicSpan=this._mainTicSpan,this._topDiv.dispatchEvent(n)};Cu.prototype.zoomFrom=function(e){let t=K.secondsDifference(this._scrubJulian,this._startJulian);e>1||t<0||t>this._timeBarSecondsSpan?t=this._timeBarSecondsSpan*.5:t+=t-this._timeBarSecondsSpan*.5;let n=this._timeBarSecondsSpan-t;this.zoomTo(K.addSeconds(this._startJulian,t-t*e,new K),K.addSeconds(this._endJulian,n*e-n,new K))};function Gle(e){return e<10?`0${e.toString()}`:e.toString()}Cu.prototype.makeLabel=function(e){let t=K.toGregorianDate(e),n=t.millisecond,i=" UTC";if(n>0&&this._timeBarSecondsSpan<3600){for(i=Math.floor(n).toString();i.length<3;)i=`0${i}`;i=`.${i}`}return`${Q5t[t.month-1]} ${t.day} ${t.year} ${Gle(t.hour)}:${Gle(t.minute)}:${Gle(t.second)}${i}`};Cu.prototype.smallestTicInPixels=7;Cu.prototype._makeTics=function(){let e=this._timeBarEle,t=K.secondsDifference(this._scrubJulian,this._startJulian),n=Math.round(t*this._topDiv.clientWidth/this._timeBarSecondsSpan),i=n-8,r,o=this;this._needleEle.style.left=`${n.toString()}px`;let s="",a=.01,c=31536e6,u=1e-10,f=0,d=this._timeBarSecondsSpan;d<a?(d=a,this._timeBarSecondsSpan=a,this._endJulian=K.addSeconds(this._startJulian,a,new K)):d>c&&(d=c,this._timeBarSecondsSpan=c,this._endJulian=K.addSeconds(this._startJulian,c,new K));let p=this._timeBarEle.clientWidth;p<10&&(p=10);let g=this._startJulian,m=Math.min(d/p*1e-5,.4),y,A=K.toGregorianDate(g);d>31536e4?y=K.fromDate(new Date(Date.UTC(Math.floor(A.year/100)*100,0))):d>31536e3?y=K.fromDate(new Date(Date.UTC(Math.floor(A.year/10)*10,0))):d>86400?y=K.fromDate(new Date(Date.UTC(A.year,0))):y=K.fromDate(new Date(Date.UTC(A.year,A.month,A.day)));let b=K.secondsDifference(this._startJulian,K.addSeconds(y,m,new K)),x=b+d;this._epochJulian=y;function T(k){return Math.floor(b/k)*k}function E(k,G){return Math.ceil(k/G+.5)*G}function v(k){return(k-b)/d}function S(k,G){return k-G*Math.round(k/G)}this._rulerEle.innerHTML=this.makeLabel(K.addSeconds(this._endJulian,-a,new K));let I=this._rulerEle.offsetWidth+20;I<30&&(I=180);let R=f;f-=u;let O={startTime:b,startJulian:g,epochJulian:y,duration:d,timeBarWidth:p,getAlpha:v};this._highlightRanges.forEach(function(k){s+=k.render(O)});let L=0,_=0,C=0,w=I/p;w>1&&(w=1),w*=this._timeBarSecondsSpan;let P=-1,M=-1,F=Xb.length,V;for(V=0;V<F;++V){let k=Xb[V];if(++P,L=k,k>w&&k>f)break;M<0&&p*(k/this._timeBarSecondsSpan)>=this.smallestTicInPixels&&(M=P)}if(P>0){for(;P>0;)if(--P,Math.abs(S(L,Xb[P]))<1e-5){Xb[P]>=f&&(_=Xb[P]);break}if(M>=0)for(;M<P;){if(Math.abs(S(_,Xb[M]))<1e-5&&Xb[M]>=f){C=Xb[M];break}++M}}f=R,f>u&&C<1e-5&&Math.abs(f-L)>u&&(C=f,f<=L+u&&(_=0));let B=-999999,j;if(p*(C/this._timeBarSecondsSpan)>=3)for(r=T(C);r<=x;r=E(r,C))s+=`<span class="cesium-timeline-ticTiny" style="left: ${Math.round(p*v(r)).toString()}px;"></span>`;if(p*(_/this._timeBarSecondsSpan)>=3)for(r=T(_);r<=x;r=E(r,_))s+=`<span class="cesium-timeline-ticSub" style="left: ${Math.round(p*v(r)).toString()}px;"></span>`;if(p*(L/this._timeBarSecondsSpan)>=2){this._mainTicSpan=L,x+=L,r=T(L);let k=K.computeTaiMinusUtc(y);for(;r<=x;){let G=K.addSeconds(g,r-b,new K);if(L>2.1){let J=K.computeTaiMinusUtc(G);Math.abs(J-k)>.1&&(r+=J-k,G=K.addSeconds(g,r-b,new K))}let q=Math.round(p*v(r)),Q=this.makeLabel(G);this._rulerEle.innerHTML=Q,j=this._rulerEle.offsetWidth,j<10&&(j=I);let W=q-(j/2-1);W>B?(B=W+j+5,s+=`<span class="cesium-timeline-ticMain" style="left: ${q.toString()}px;"></span><span class="cesium-timeline-ticLabel" style="left: ${W.toString()}px;">${Q}</span>`):s+=`<span class="cesium-timeline-ticSub" style="left: ${q.toString()}px;"></span>`,r=E(r,L)}}else this._mainTicSpan=-1;s+=`<span class="cesium-timeline-icon16" style="left:${i}px;bottom:0;background-position: 0 0;"></span>`,e.innerHTML=s,this._scrubElement=e.lastChild,this._context.clearRect(0,0,this._trackListEle.width,this._trackListEle.height),O.y=0,this._trackList.forEach(function(k){k.render(o._context,O),O.y+=k.height})};Cu.prototype.updateFromClock=function(){this._scrubJulian=this._clock.currentTime;let e=this._scrubElement;if(l(this._scrubElement)){let t=K.secondsDifference(this._scrubJulian,this._startJulian),n=Math.round(t*this._topDiv.clientWidth/this._timeBarSecondsSpan);this._lastXPos!==n&&(this._lastXPos=n,e.style.left=`${n-8}px`,this._needleEle.style.left=`${n}px`)}l(this._timelineDragLocation)&&(this._setTimeBarTime(this._timelineDragLocation,this._timelineDragLocation*this._timeBarSecondsSpan/this._topDiv.clientWidth),this.zoomTo(K.addSeconds(this._startJulian,this._timelineDrag,new K),K.addSeconds(this._endJulian,this._timelineDrag,new K)))};Cu.prototype._setTimeBarTime=function(e,t){if(e=Math.round(e),this._scrubJulian=K.addSeconds(this._startJulian,t,new K),this._scrubElement){let i=e-8;this._scrubElement.style.left=`${i.toString()}px`,this._needleEle.style.left=`${e.toString()}px`}let n=document.createEvent("Event");n.initEvent("settime",!0,!0),n.clientX=e,n.timeSeconds=t,n.timeJulian=this._scrubJulian,n.clock=this._clock,this._topDiv.dispatchEvent(n)};function e9t(e){return function(t){e._mouseMode!==Oh.touchOnly&&(t.button===0?(e._mouseMode=Oh.scrub,e._scrubElement&&(e._scrubElement.style.backgroundPosition="-16px 0"),e._onMouseMove(t)):(e._mouseX=t.clientX,t.button===2?e._mouseMode=Oh.zoom:e._mouseMode=Oh.slide)),t.preventDefault()}}function t9t(e){return function(t){e._mouseMode=Oh.none,e._scrubElement&&(e._scrubElement.style.backgroundPosition="0 0"),e._timelineDrag=0,e._timelineDragLocation=void 0}}function n9t(e){return function(t){let n;if(e._mouseMode===Oh.scrub){t.preventDefault();let i=t.clientX-e._topDiv.getBoundingClientRect().left;i<0?(e._timelineDragLocation=0,e._timelineDrag=-.01*e._timeBarSecondsSpan):i>e._topDiv.clientWidth?(e._timelineDragLocation=e._topDiv.clientWidth,e._timelineDrag=.01*e._timeBarSecondsSpan):(e._timelineDragLocation=void 0,e._setTimeBarTime(i,i*e._timeBarSecondsSpan/e._topDiv.clientWidth))}else if(e._mouseMode===Oh.slide){if(n=e._mouseX-t.clientX,e._mouseX=t.clientX,n!==0){let i=n*e._timeBarSecondsSpan/e._topDiv.clientWidth;e.zoomTo(K.addSeconds(e._startJulian,i,new K),K.addSeconds(e._endJulian,i,new K))}}else e._mouseMode===Oh.zoom&&(n=e._mouseX-t.clientX,e._mouseX=t.clientX,n!==0&&e.zoomFrom(Math.pow(1.01,n)))}}function i9t(e){return function(t){let n=t.wheelDeltaY||t.wheelDelta||-t.detail;Hle=Math.max(Math.min(Math.abs(n),Hle),1),n/=Hle,e.zoomFrom(Math.pow(1.05,-n))}}function r9t(e){return function(t){let n=t.touches.length,i,r,o=e._topDiv.getBoundingClientRect().left;t.preventDefault(),e._mouseMode=Oh.touchOnly,n===1?(i=K.secondsDifference(e._scrubJulian,e._startJulian),r=Math.round(i*e._topDiv.clientWidth/e._timeBarSecondsSpan+o),Math.abs(t.touches[0].clientX-r)<50?(e._touchMode=Eu.scrub,e._scrubElement&&(e._scrubElement.style.backgroundPosition=n===1?"-16px 0":"0 0")):(e._touchMode=Eu.singleTap,e._touchState.centerX=t.touches[0].clientX-o)):n===2?(e._touchMode=Eu.slideZoom,e._touchState.centerX=(t.touches[0].clientX+t.touches[1].clientX)*.5-o,e._touchState.spanX=Math.abs(t.touches[0].clientX-t.touches[1].clientX)):e._touchMode=Eu.ignore}}function o9t(e){return function(t){let n=t.touches.length,i=e._topDiv.getBoundingClientRect().left;e._touchMode===Eu.singleTap?(e._touchMode=Eu.scrub,e._onTouchMove(t)):e._touchMode===Eu.scrub&&e._onTouchMove(t),e._mouseMode=Oh.touchOnly,n!==1?e._touchMode=n>0?Eu.ignore:Eu.none:e._touchMode===Eu.slideZoom&&(e._touchState.centerX=t.touches[0].clientX-i),e._scrubElement&&(e._scrubElement.style.backgroundPosition="0 0")}}function s9t(e){return function(t){let n,i,r,o,s,a,c=1,u=e._topDiv.getBoundingClientRect().left;e._touchMode===Eu.singleTap&&(e._touchMode=Eu.slideZoom),e._mouseMode=Oh.touchOnly,e._touchMode===Eu.scrub?(t.preventDefault(),t.changedTouches.length===1&&(i=t.changedTouches[0].clientX-u,i>=0&&i<=e._topDiv.clientWidth&&e._setTimeBarTime(i,i*e._timeBarSecondsSpan/e._topDiv.clientWidth))):e._touchMode===Eu.slideZoom&&(r=t.touches.length,r===2?(o=(t.touches[0].clientX+t.touches[1].clientX)*.5-u,s=Math.abs(t.touches[0].clientX-t.touches[1].clientX)):r===1&&(o=t.touches[0].clientX-u,s=0),l(o)&&(s>0&&e._touchState.spanX>0?(c=e._touchState.spanX/s,a=K.addSeconds(e._startJulian,(e._touchState.centerX*e._timeBarSecondsSpan-o*e._timeBarSecondsSpan*c)/e._topDiv.clientWidth,new K)):(n=e._touchState.centerX-o,a=K.addSeconds(e._startJulian,n*e._timeBarSecondsSpan/e._topDiv.clientWidth,new K)),e.zoomTo(a,K.addSeconds(a,e._timeBarSecondsSpan*c,new K)),e._touchState.centerX=o,e._touchState.spanX=s))}}Cu.prototype.resize=function(){let e=this.container.clientWidth,t=this.container.clientHeight;if(e===this._lastWidth&&t===this._lastHeight)return;this._trackContainer.style.height=`${t}px`;let n=1;this._trackList.forEach(function(i){n+=i.height}),this._trackListEle.style.height=`${n.toString()}px`,this._trackListEle.width=this._trackListEle.clientWidth,this._trackListEle.height=n,this._makeTics(),this._lastXPos=void 0,this._lastWidth=e,this._lastHeight=t};var cj=Cu;var y3e=Qo(_3e(),1);function a9t(e){let t=!1,n=window.screen;return l(n)&&(l(n.lockOrientation)?t=n.lockOrientation(e):l(n.mozLockOrientation)?t=n.mozLockOrientation(e):l(n.msLockOrientation)?t=n.msLockOrientation(e):l(n.orientation&&n.orientation.lock)&&(t=n.orientation.lock(e))),t}function A3e(){let e=window.screen;l(e)&&(l(e.unlockOrientation)?e.unlockOrientation():l(e.mozUnlockOrientation)?e.mozUnlockOrientation():l(e.msUnlockOrientation)?e.msUnlockOrientation():l(e.orientation&&e.orientation.unlock)&&e.orientation.unlock())}function c9t(e,t,n,i){i()||(n()?(t.useWebVR=!1,e._locked&&(A3e(),e._locked=!1),e._noSleep.disable(),es.exitFullscreen(),n(!1)):(es.fullscreen||es.requestFullscreen(e._vrElement),e._noSleep.enable(),e._locked||(e._locked=a9t("landscape")),t.useWebVR=!0,n(!0)))}function Eq(e,t){let n=this,i=ve.observable(es.enabled),r=ve.observable(!1);this.isVRMode=void 0,ve.defineProperty(this,"isVRMode",{get:function(){return r()}}),this.isVREnabled=void 0,ve.defineProperty(this,"isVREnabled",{get:function(){return i()},set:function(s){i(s&&es.enabled)}}),this.tooltip=void 0,ve.defineProperty(this,"tooltip",function(){return i()?r()?"Exit VR mode":"Enter VR mode":"VR mode is unavailable"});let o=ve.observable(!1);this._isOrthographic=void 0,ve.defineProperty(this,"_isOrthographic",{get:function(){return o()}}),this._eventHelper=new jo,this._eventHelper.add(e.preRender,function(){o(e.camera.frustum instanceof gn)}),this._locked=!1,this._noSleep=new y3e.default,this._command=Rn(function(){c9t(n,e,r,o)},ve.getObservable(this,"isVREnabled")),this._vrElement=Ln(t)??document.body,this._callback=function(){!es.fullscreen&&r()&&(e.useWebVR=!1,n._locked&&(A3e(),n._locked=!1),n._noSleep.disable(),r(!1))},document.addEventListener(es.changeEventName,this._callback)}Object.defineProperties(Eq.prototype,{vrElement:{get:function(){return this._vrElement},set:function(e){this._vrElement=e}},command:{get:function(){return this._command}}});Eq.prototype.isDestroyed=function(){return!1};Eq.prototype.destroy=function(){this._eventHelper.removeAll(),document.removeEventListener(es.changeEventName,this._callback),le(this)};var uj=Eq;var l9t="M 5.3125 6.375 C 4.008126 6.375 2.96875 7.4141499 2.96875 8.71875 L 2.96875 19.5 C 2.96875 20.8043 4.008126 21.875 5.3125 21.875 L 13.65625 21.875 C 13.71832 20.0547 14.845166 18.59375 16.21875 18.59375 C 17.592088 18.59375 18.71881 20.0552 18.78125 21.875 L 27.09375 21.875 C 28.398125 21.875 29.4375 20.8043 29.4375 19.5 L 29.4375 8.71875 C 29.4375 7.4141499 28.398125 6.375 27.09375 6.375 L 5.3125 6.375 z M 9.625 10.4375 C 11.55989 10.4375 13.125 12.03385 13.125 13.96875 C 13.125 15.90365 11.55989 17.46875 9.625 17.46875 C 7.69011 17.46875 6.125 15.90365 6.125 13.96875 C 6.125 12.03385 7.69011 10.4375 9.625 10.4375 z M 22.46875 10.4375 C 24.40364 10.4375 25.96875 12.03385 25.96875 13.96875 C 25.96875 15.90365 24.40364 17.46875 22.46875 17.46875 C 20.53386 17.46875 18.96875 15.90365 18.96875 13.96875 C 18.96875 12.03385 20.53386 10.4375 22.46875 10.4375 z",u9t="M 25.770585,2.4552065 C 15.72282,13.962707 10.699956,19.704407 8.1768352,22.580207 c -1.261561,1.4379 -1.902282,2.1427 -2.21875,2.5 -0.141624,0.1599 -0.208984,0.2355 -0.25,0.2813 l 0.6875,0.75 c 10e-5,-10e-5 0.679191,0.727 0.6875,0.7187 0.01662,-0.016 0.02451,-0.024 0.03125,-0.031 0.01348,-0.014 0.04013,-0.038 0.0625,-0.062 0.04474,-0.05 0.120921,-0.1315 0.28125,-0.3126 0.320657,-0.3619 0.956139,-1.0921 2.2187499,-2.5312 2.5252219,-2.8781 7.5454589,-8.6169 17.5937499,-20.1250005 l -1.5,-1.3125 z m -20.5624998,3.9063 c -1.304375,0 -2.34375,1.0391 -2.34375,2.3437 l 0,10.8125005 c 0,1.3043 1.039375,2.375 2.34375,2.375 l 2.25,0 c 1.9518039,-2.2246 7.4710958,-8.5584 13.5624998,-15.5312005 l -15.8124998,0 z m 21.1249998,0 c -1.855467,2.1245 -2.114296,2.4005 -3.59375,4.0936995 1.767282,0.1815 3.15625,1.685301 3.15625,3.500001 0,1.9349 -1.56511,3.5 -3.5,3.5 -1.658043,0 -3.043426,-1.1411 -3.40625,-2.6875 -1.089617,1.2461 -2.647139,2.9988 -3.46875,3.9375 0.191501,-0.062 0.388502,-0.094 0.59375,-0.094 1.373338,0 2.50006,1.4614 2.5625,3.2812 l 8.3125,0 c 1.304375,0 2.34375,-1.0707 2.34375,-2.375 l 0,-10.8125005 c 0,-1.3046 -1.039375,-2.3437 -2.34375,-2.3437 l -0.65625,0 z M 9.5518351,10.423906 c 1.9348899,0 3.4999999,1.596401 3.4999999,3.531301 0,1.9349 -1.56511,3.5 -3.4999999,3.5 -1.9348899,0 -3.4999999,-1.5651 -3.4999999,-3.5 0,-1.9349 1.56511,-3.531301 3.4999999,-3.531301 z m 4.2187499,10.312601 c -0.206517,0.2356 -0.844218,0.9428 -1.03125,1.1562 l 0.8125,0 c 0.01392,-0.4081 0.107026,-0.7968 0.21875,-1.1562 z";function Cq(e,t,n){e=Ln(e);let i=new uj(t,n);i._exitVRPath=u9t,i._enterVRPath=l9t;let r=document.createElement("button");r.type="button",r.className="cesium-button cesium-vrButton",r.setAttribute("data-bind",'css: { "cesium-button-disabled" : _isOrthographic }, attr: { title: tooltip },click: command,enable: isVREnabled,cesiumSvgPath: { path: isVRMode ? _exitVRPath : _enterVRPath, width: 32, height: 32 }'),e.appendChild(r),ve.applyBindings(i,r),this._container=e,this._viewModel=i,this._element=r}Object.defineProperties(Cq.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}}});Cq.prototype.isDestroyed=function(){return!1};Cq.prototype.destroy=function(){return this._viewModel.destroy(),ve.cleanNode(this._element),this._container.removeChild(this._element),le(this)};var fj=Cq;var b3e=new ue;function E3e(e){let t=e.clock;t.currentTime=e.timeJulian,t.shouldAnimate=!1}function f9t(e){let t=e.getPropertyIds(),n="";return t.forEach(function(i){let r=e.getProperty(i);l(r)&&(n+=`<tr><th>${i}</th><td>${r}</td></tr>`)}),n.length>0&&(n=`<table class="cesium-infoBox-defaultTable"><tbody>${n}</tbody></table>`),n}function d9t(e){let t,n=[],i=e.getPropertyIds();for(t=0;t<i.length;t++){let o=i[t];/^name$/i.test(o)?n[0]=e.getProperty(o):/name/i.test(o)?n[1]=e.getProperty(o):/^title$/i.test(o)?n[2]=e.getProperty(o):/^(id|identifier)$/i.test(o)?n[3]=e.getProperty(o):/element/i.test(o)?n[4]=e.getProperty(o):/(id|identifier)$/i.test(o)&&(n[5]=e.getProperty(o))}let r=n.length;for(t=0;t<r;t++){let o=n[t];if(l(o)&&o!=="")return o}return"Unnamed Feature"}function x3e(e,t){let n=e.scene.pick(t.position);if(l(n)){let i=n.id??n.primitive.id;if(i instanceof Jr)return i;if(n instanceof oa||n instanceof iE)return new Jr({name:d9t(n),description:f9t(n),feature:n})}return g9t(e,t.position)}var h9t=new K;function qle(e,t){if(l(t)){let n=t.clock;if(l(n)&&l(e)){let i=n.startTime,r=n.stopTime;K.equals(i,r)&&(r=K.addSeconds(i,D.EPSILON2,h9t)),e.updateFromClock(),e.zoomTo(i,r)}}}var m9t=new h;function p9t(e){let t=e.length;for(let n=0;n<t;++n){let i=e.get(n);if(i instanceof Xo)return i}}function g9t(e,t){let n=e.scene,i=n.camera.getPickRay(t);if(!l(i))return;let r=n.imageryLayers;if(!l(r)){let a=p9t(n.primitives);if(!l(a))return;r=a.imageryLayers}let o=r.pickImageryLayerFeatures(i,n);if(!l(o))return;let s=new Jr({id:"Loading...",description:"Loading feature information..."});return o.then(function(a){if(e.selectedEntity!==s)return;if(!l(a)||a.length===0){e.selectedEntity=T3e();return}let c=a[0],u=new Jr({id:c.name,description:c.description});if(l(c.position)){let f=e.scene.ellipsoid.cartographicToCartesian(c.position,m9t);u.position=new Kl(f)}e.selectedEntity=u},function(){e.selectedEntity===s&&(e.selectedEntity=T3e())}),s}function T3e(){return new Jr({id:"None",description:"No features found."})}function _9t(e,t){let n=e._geocoder,i=e._homeButton,r=e._sceneModePicker,o=e._projectionPicker,s=e._baseLayerPicker,a=e._animation,c=e._timeline,u=e._fullscreenButton,f=e._infoBox,d=e._selectionIndicator,p=t?"hidden":"visible";if(l(n)&&(n.container.style.visibility=p),l(i)&&(i.container.style.visibility=p),l(r)&&(r.container.style.visibility=p),l(o)&&(o.container.style.visibility=p),l(s)&&(s.container.style.visibility=p),l(a)&&(a.container.style.visibility=p),l(c)&&(c.container.style.visibility=p),l(u)&&u.viewModel.isFullscreenEnabled&&(u.container.style.visibility=p),l(f)&&(f.container.style.visibility=p),l(d)&&(d.container.style.visibility=p),e._container){let g=t||!l(u)?0:u.container.clientWidth;e._vrButton.container.style.right=`${g}px`,e.forceResize()}}function lr(e,t){e=Ln(e),t=t??H.EMPTY_OBJECT;let n=(!l(t.globe)||t.globe!==!1)&&(!l(t.baseLayerPicker)||t.baseLayerPicker!==!1),i=this,r=document.createElement("div");r.className="cesium-viewer",e.appendChild(r);let o=document.createElement("div");o.className="cesium-viewer-cesiumWidgetContainer",r.appendChild(o);let s=document.createElement("div");s.className="cesium-viewer-bottom",r.appendChild(s);let a=t.scene3DOnly??!1,c,u,f=!1;l(t.clockViewModel)?(u=t.clockViewModel,c=u.clock):(c=new Xh,u=new C8(c),f=!0);let d=new yV(o,{baseLayer:n&&l(t.selectedImageryProviderViewModel)||l(t.baseLayer)||l(t.imageryProvider)?!1:void 0,clock:c,shouldAnimate:t.shouldAnimate,skyBox:t.skyBox,skyAtmosphere:t.skyAtmosphere,sceneMode:t.sceneMode,ellipsoid:t.ellipsoid,mapProjection:t.mapProjection,globe:t.globe,orderIndependentTranslucency:t.orderIndependentTranslucency,automaticallyTrackDataSourceClocks:t.automaticallyTrackDataSourceClocks,contextOptions:t.contextOptions,useDefaultRenderLoop:t.useDefaultRenderLoop,targetFrameRate:t.targetFrameRate,showRenderLoopErrors:t.showRenderLoopErrors,useBrowserRecommendedResolution:t.useBrowserRecommendedResolution,creditContainer:l(t.creditContainer)?t.creditContainer:s,creditViewport:t.creditViewport,dataSources:t.dataSources,scene3DOnly:a,shadows:t.shadows,terrainShadows:t.terrainShadows,mapMode2D:t.mapMode2D,blurActiveElementOnCanvasFocus:t.blurActiveElementOnCanvasFocus,requestRenderMode:t.requestRenderMode,maximumRenderTimeChange:t.maximumRenderTimeChange,depthPlaneEllipsoidOffset:t.depthPlaneEllipsoidOffset,msaaSamples:t.msaaSamples}),p=d.scene,g=new jo;g.add(c.onTick,lr.prototype._onTick,this);let m;if(!l(t.selectionIndicator)||t.selectionIndicator!==!1){let G=document.createElement("div");G.className="cesium-viewer-selectionIndicatorContainer",r.appendChild(G),m=new oj(G,p)}let y;if(!l(t.infoBox)||t.infoBox!==!1){let G=document.createElement("div");G.className="cesium-viewer-infoBoxContainer",r.appendChild(G),y=new X8(G);let q=y.viewModel;g.add(q.cameraClicked,lr.prototype._onInfoBoxCameraClicked,this),g.add(q.closeClicked,lr.prototype._onInfoBoxClockClicked,this)}let A=document.createElement("div");A.className="cesium-viewer-toolbar",r.appendChild(A);let b;if(!l(t.geocoder)||t.geocoder!==!1){let G=document.createElement("div");G.className="cesium-viewer-geocoderContainer",A.appendChild(G);let q;typeof t.geocoder=="string"?q=[new VC({scene:p,geocodeProviderType:t.geocoder})]:l(t.geocoder)&&typeof t.geocoder!="boolean"&&(q=Array.isArray(t.geocoder)?t.geocoder:[t.geocoder]),b=new V8({container:G,geocoderServices:q,scene:p}),g.add(b.viewModel.search.beforeExecute,lr.prototype._clearObjects,this)}let x;(!l(t.homeButton)||t.homeButton!==!1)&&(x=new H8(A,p),l(b)&&g.add(x.viewModel.command.afterExecute,function(){let G=b.viewModel;G.searchText="",G.isSearchInProgress&&G.search()}),g.add(x.viewModel.command.beforeExecute,lr.prototype._clearTrackedObject,this));let T;!a&&(!l(t.sceneModePicker)||t.sceneModePicker!==!1)&&(T=new nj(A,p));let E;t.projectionPicker&&(E=new ej(A,p));let v,S;if(n){let G=t.imageryProviderViewModels??k8(),q=t.terrainProviderViewModels??U8();v=new B8(A,{globe:p.globe,imageryProviderViewModels:G,selectedImageryProviderViewModel:t.selectedImageryProviderViewModel,terrainProviderViewModels:q,selectedTerrainProviderViewModel:t.selectedTerrainProviderViewModel}),S=A.getElementsByClassName("cesium-baseLayerPicker-dropDown")[0]}l(t.baseLayer)&&t.baseLayer!==!1&&(n&&(v.viewModel.selectedImagery=void 0),p.imageryLayers.removeAll(),p.imageryLayers.add(t.baseLayer)),l(t.terrainProvider)&&(n&&(v.viewModel.selectedTerrain=void 0),p.terrainProvider=t.terrainProvider),l(t.terrain)&&(n&&(p.globe.depthTestAgainstTerrain=!0),p.setTerrain(t.terrain));let I;if(!l(t.navigationHelpButton)||t.navigationHelpButton!==!1){let G=!0;try{if(l(window.localStorage)){let q=window.localStorage.getItem("cesium-hasSeenNavHelp");l(q)&&q?G=!1:window.localStorage.setItem("cesium-hasSeenNavHelp","true")}}catch{}I=new $8({container:A,instructionsInitiallyVisible:t.navigationInstructionsInitiallyVisible??G})}let R;if(!l(t.animation)||t.animation!==!1){let G=document.createElement("div");G.className="cesium-viewer-animationContainer",r.appendChild(G),R=new w8(G,new I8(u))}let O;if(!l(t.timeline)||t.timeline!==!1){let G=document.createElement("div");G.className="cesium-viewer-timelineContainer",r.appendChild(G),O=new cj(G,c),O.addEventListener("settime",E3e,!1),O.zoomTo(c.startTime,c.stopTime)}let L,_,C;(!l(t.fullscreenButton)||t.fullscreenButton!==!1)&&(C=document.createElement("div"),C.className="cesium-viewer-fullscreenContainer",r.appendChild(C),L=new W8(C,t.fullscreenElement),_=Cc(L.viewModel,"isFullscreenEnabled",function(G){C.style.display=G?"block":"none",l(O)&&(O.container.style.right=`${C.clientWidth}px`,O.resize())}));let w,P,M;if(t.vrButton){let G=document.createElement("div");G.className="cesium-viewer-vrContainer",r.appendChild(G),w=new fj(G,p,t.fullScreenElement),P=Cc(w.viewModel,"isVREnabled",function(q){G.style.display=q?"block":"none",l(L)&&(G.style.right=`${C.clientWidth}px`),l(O)&&(O.container.style.right=`${G.clientWidth}px`,O.resize())}),M=Cc(w.viewModel,"isVRMode",function(q){_9t(i,q)})}this._baseLayerPickerDropDown=S,this._fullscreenSubscription=_,this._vrSubscription=P,this._vrModeSubscription=M,this._dataSourceChangedListeners={},this._container=e,this._bottomContainer=s,this._element=r,this._cesiumWidget=d,this._selectionIndicator=m,this._infoBox=y,this._clockViewModel=u,this._destroyClockViewModel=f,this._toolbar=A,this._homeButton=x,this._sceneModePicker=T,this._projectionPicker=E,this._baseLayerPicker=v,this._navigationHelpButton=I,this._animation=R,this._timeline=O,this._fullscreenButton=L,this._vrButton=w,this._geocoder=b,this._eventHelper=g,this._lastWidth=0,this._lastHeight=0,this._enableInfoOrSelection=l(y)||l(m),this._selectedEntity=void 0,this._selectedEntityChanged=new be;let F=this._cesiumWidget.dataSources,V=this._cesiumWidget.dataSourceDisplay;g.add(F.dataSourceAdded,lr.prototype._onDataSourceAdded,this),g.add(F.dataSourceRemoved,lr.prototype._onDataSourceRemoved,this),g.add(p.postUpdate,lr.prototype.resize,this);let B=F.length;for(let G=0;G<B;G++)this._dataSourceAdded(F,F.get(G));this._dataSourceAdded(void 0,V.defaultDataSource),g.add(F.dataSourceAdded,lr.prototype._dataSourceAdded,this),g.add(F.dataSourceRemoved,lr.prototype._dataSourceRemoved,this);function j(G){let q=x3e(i,G);l(q)?X.getValueOrUndefined(q.position,i.clock.currentTime)?i.trackedEntity=q:i.zoomTo(q):l(i.trackedEntity)&&(i.trackedEntity=void 0)}function k(G){i.selectedEntity=x3e(i,G)}d.screenSpaceEventHandler.setInputAction(k,un.LEFT_CLICK),d.screenSpaceEventHandler.setInputAction(j,un.LEFT_DOUBLE_CLICK),d._canAnimateUpdateCallback=this._updateCanAnimate(this)}Object.defineProperties(lr.prototype,{container:{get:function(){return this._container}},creditDisplay:{get:function(){return this._cesiumWidget.creditDisplay}},bottomContainer:{get:function(){return this._bottomContainer}},cesiumWidget:{get:function(){return this._cesiumWidget}},selectionIndicator:{get:function(){return this._selectionIndicator}},infoBox:{get:function(){return this._infoBox}},geocoder:{get:function(){return this._geocoder}},homeButton:{get:function(){return this._homeButton}},sceneModePicker:{get:function(){return this._sceneModePicker}},projectionPicker:{get:function(){return this._projectionPicker}},baseLayerPicker:{get:function(){return this._baseLayerPicker}},navigationHelpButton:{get:function(){return this._navigationHelpButton}},animation:{get:function(){return this._animation}},timeline:{get:function(){return this._timeline}},fullscreenButton:{get:function(){return this._fullscreenButton}},vrButton:{get:function(){return this._vrButton}},dataSourceDisplay:{get:function(){return this._cesiumWidget.dataSourceDisplay}},entities:{get:function(){return this._cesiumWidget.entities}},dataSources:{get:function(){return this._cesiumWidget.dataSources}},canvas:{get:function(){return this._cesiumWidget.canvas}},scene:{get:function(){return this._cesiumWidget.scene}},shadows:{get:function(){return this.scene.shadowMap.enabled},set:function(e){this.scene.shadowMap.enabled=e}},terrainShadows:{get:function(){return this.scene.globe.shadows},set:function(e){this.scene.globe.shadows=e}},shadowMap:{get:function(){return this.scene.shadowMap}},imageryLayers:{get:function(){return this.scene.imageryLayers}},terrainProvider:{get:function(){return this.scene.terrainProvider},set:function(e){this.scene.terrainProvider=e}},camera:{get:function(){return this.scene.camera}},ellipsoid:{get:function(){return this.scene.ellipsoid}},postProcessStages:{get:function(){return this.scene.postProcessStages}},clock:{get:function(){return this._clockViewModel.clock}},clockViewModel:{get:function(){return this._clockViewModel}},screenSpaceEventHandler:{get:function(){return this._cesiumWidget.screenSpaceEventHandler}},targetFrameRate:{get:function(){return this._cesiumWidget.targetFrameRate},set:function(e){this._cesiumWidget.targetFrameRate=e}},useDefaultRenderLoop:{get:function(){return this._cesiumWidget.useDefaultRenderLoop},set:function(e){this._cesiumWidget.useDefaultRenderLoop=e}},resolutionScale:{get:function(){return this._cesiumWidget.resolutionScale},set:function(e){this._cesiumWidget.resolutionScale=e}},useBrowserRecommendedResolution:{get:function(){return this._cesiumWidget.useBrowserRecommendedResolution},set:function(e){this._cesiumWidget.useBrowserRecommendedResolution=e}},allowDataSourcesToSuspendAnimation:{get:function(){return this._cesiumWidget.allowDataSourcesToSuspendAnimation},set:function(e){this._cesiumWidget.allowDataSourcesToSuspendAnimation=e}},trackedEntity:{get:function(){return this._cesiumWidget.trackedEntity},set:function(e){this._cesiumWidget.trackedEntity=e}},selectedEntity:{get:function(){return this._selectedEntity},set:function(e){if(this._selectedEntity!==e){this._selectedEntity=e;let t=l(this._selectionIndicator)?this._selectionIndicator.viewModel:void 0;l(e)?l(t)&&t.animateAppear():l(t)&&t.animateDepart(),this._selectedEntityChanged.raiseEvent(e)}}},selectedEntityChanged:{get:function(){return this._selectedEntityChanged}},trackedEntityChanged:{get:function(){return this._cesiumWidget.trackedEntityChanged}},clockTrackedDataSource:{get:function(){return this._cesiumWidget.clockTrackedDataSource},set:function(e){this._cesiumWidget.clockTrackedDataSource!==e&&(this._cesiumWidget.clockTrackedDataSource=e,qle(this._timeline,e))}}});lr.prototype.extend=function(e,t){e(this,t)};lr.prototype.resize=function(){let e=this._cesiumWidget,t=this._container,n=t.clientWidth,i=t.clientHeight,r=l(this._animation),o=l(this._timeline);if(e.resize(),n===this._lastWidth&&i===this._lastHeight)return;let s=i-125,a=this._baseLayerPickerDropDown;if(l(a)&&(a.style.maxHeight=`${s}px`),l(this._geocoder)){let m=this._geocoder.searchSuggestionsContainer;m.style.maxHeight=`${s}px`}l(this._infoBox)&&(this._infoBox.viewModel.maxHeight=s);let c=this._timeline,u,f=0,d=5,p=3,g=0;if(r&&window.getComputedStyle(this._animation.container).visibility!=="hidden"){let m=this._lastWidth;u=this._animation.container,n>900?(f=169,m<=900&&(u.style.width="169px",u.style.height="112px",this._animation.resize())):n>=600?(f=136,(m<600||m>900)&&(u.style.width="136px",u.style.height="90px",this._animation.resize())):(f=106,(m>600||m===0)&&(u.style.width="106px",u.style.height="70px",this._animation.resize())),d=f+5}if(o&&window.getComputedStyle(this._timeline.container).visibility!=="hidden"){let m=this._fullscreenButton,y=this._vrButton,A=c.container,b=A.style;p=A.clientHeight+3,b.left=`${f}px`;let x=0;l(m)&&(x+=m.container.clientWidth),l(y)&&(x+=y.container.clientWidth),b.right=`${x}px`,c.resize()}!o&&l(this._fullscreenButton)&&(g=this._fullscreenButton.container.clientWidth),this._bottomContainer.style.left=`${d}px`,this._bottomContainer.style.bottom=`${p}px`,this._bottomContainer.style.right=`${g}px`,this._lastWidth=n,this._lastHeight=i};lr.prototype.forceResize=function(){this._lastWidth=0,this.resize()};lr.prototype.render=function(){this._cesiumWidget.render()};lr.prototype.isDestroyed=function(){return!1};lr.prototype.destroy=function(){return l(this.screenSpaceEventHandler)&&!this.screenSpaceEventHandler.isDestroyed()&&(this.screenSpaceEventHandler.removeInputAction(un.LEFT_CLICK),this.screenSpaceEventHandler.removeInputAction(un.LEFT_DOUBLE_CLICK)),this._container.removeChild(this._element),this._element.removeChild(this._toolbar),this._eventHelper.removeAll(),l(this._geocoder)&&(this._geocoder=this._geocoder.destroy()),l(this._homeButton)&&(this._homeButton=this._homeButton.destroy()),l(this._sceneModePicker)&&(this._sceneModePicker=this._sceneModePicker.destroy()),l(this._projectionPicker)&&(this._projectionPicker=this._projectionPicker.destroy()),l(this._baseLayerPicker)&&(this._baseLayerPicker=this._baseLayerPicker.destroy()),l(this._animation)&&(this._element.removeChild(this._animation.container),this._animation=this._animation.destroy()),l(this._timeline)&&(this._timeline.removeEventListener("settime",E3e,!1),this._element.removeChild(this._timeline.container),this._timeline=this._timeline.destroy()),l(this._fullscreenButton)&&(this._fullscreenSubscription.dispose(),this._element.removeChild(this._fullscreenButton.container),this._fullscreenButton=this._fullscreenButton.destroy()),l(this._vrButton)&&(this._vrSubscription.dispose(),this._vrModeSubscription.dispose(),this._element.removeChild(this._vrButton.container),this._vrButton=this._vrButton.destroy()),l(this._infoBox)&&(this._element.removeChild(this._infoBox.container),this._infoBox=this._infoBox.destroy()),l(this._selectionIndicator)&&(this._element.removeChild(this._selectionIndicator.container),this._selectionIndicator=this._selectionIndicator.destroy()),this._destroyClockViewModel&&(this._clockViewModel=this._clockViewModel.destroy()),this._cesiumWidget=this._cesiumWidget.destroy(),le(this)};lr.prototype._dataSourceAdded=function(e,t){t.entities.collectionChanged.addEventListener(lr.prototype._onEntityCollectionChanged,this)};lr.prototype._dataSourceRemoved=function(e,t){let n=t.entities;n.collectionChanged.removeEventListener(lr.prototype._onEntityCollectionChanged,this),l(this.selectedEntity)&&n.getById(this.selectedEntity.id)===this.selectedEntity&&(this.selectedEntity=void 0)};lr.prototype._updateCanAnimate=function(e){return function(t){e._clockViewModel.canAnimate=t}};lr.prototype._onTick=function(e){let t=e.currentTime,n,i=!1,r=this.selectedEntity,o=l(r)&&this._enableInfoOrSelection;o&&r.isShowing&&r.isAvailable(t)&&(this._cesiumWidget.dataSourceDisplay.getBoundingSphere(r,!0,b3e)!==Pt.FAILED?n=b3e.center:l(r.position)&&(n=r.position.getValue(t,n)),i=l(n));let s=l(this._selectionIndicator)?this._selectionIndicator.viewModel:void 0;l(s)&&(s.position=h.clone(n,s.position),s.showSelection=o&&i,s.update());let a=l(this._infoBox)?this._infoBox.viewModel:void 0;l(a)&&(a.showInfo=o,a.enableCamera=i,a.isCameraTracking=this.trackedEntity===this.selectedEntity,o?(a.titleText=r.name??r.id,a.description=X.getValueOrDefault(r.description,t,"")):(a.titleText="",a.description=""))};lr.prototype._onEntityCollectionChanged=function(e,t,n){let i=n.length;for(let r=0;r<i;r++){let o=n[r];this.selectedEntity===o&&(this.selectedEntity=void 0)}};lr.prototype._onInfoBoxCameraClicked=function(e){if(e.isCameraTracking&&this.trackedEntity===this.selectedEntity)this.trackedEntity=void 0;else{let n=this.selectedEntity.position;l(n)?this.trackedEntity=this.selectedEntity:this.zoomTo(this.selectedEntity)}};lr.prototype._clearTrackedObject=function(){this.trackedEntity=void 0};lr.prototype._onInfoBoxClockClicked=function(e){this.selectedEntity=void 0};lr.prototype._clearObjects=function(){this.trackedEntity=void 0,this.selectedEntity=void 0};lr.prototype._onDataSourceChanged=function(e){this.clockTrackedDataSource===e&&qle(this.timeline,e)};lr.prototype._onDataSourceAdded=function(e,t){this._cesiumWidget._automaticallyTrackDataSourceClocks&&t===this.clockTrackedDataSource&&qle(this._timeline,t);let n=t.entities.id,i=this._eventHelper.add(t.changedEvent,lr.prototype._onDataSourceChanged,this);this._dataSourceChangedListeners[n]=i};lr.prototype._onDataSourceRemoved=function(e,t){let n=t.entities.id;this._dataSourceChangedListeners[n](),this._dataSourceChangedListeners[n]=void 0};lr.prototype.addController=function(e){return this._cesiumWidget.addController(e)};lr.prototype.removeController=function(e){return this._cesiumWidget.removeController(e)};lr.prototype.zoomTo=function(e,t){return this._cesiumWidget.zoomTo(e,t)};lr.prototype.flyTo=function(e,t){return this._cesiumWidget.flyTo(e,t)};var Yle=lr;function y9t(e){let t=document.createElement("div");t.className="cesium-viewer-cesium3DTilesInspectorContainer",e.container.appendChild(t);let n=new O8(t,e.scene);Object.defineProperties(e,{cesium3DTilesInspector:{get:function(){return n}}})}var Xle=y9t;function A9t(e){let t=document.createElement("div");t.className="cesium-viewer-cesiumInspectorContainer",e.container.appendChild(t);let n=new L8(t,e.scene);Object.defineProperties(e,{cesiumInspector:{get:function(){return n}}})}var Kle=A9t;function b9t(e,t){t=t??H.EMPTY_OBJECT;let n=!0,i=t.flyToOnDrop??!0,r=new be,o=t.clearOnDrop??!0,s=t.dropTarget??e.container,a=t.clampToGround??!0,c=t.proxy;s=Ln(s),Object.defineProperties(e,{dropTarget:{get:function(){return s},set:function(f){C3e(s,u),s=f,$le(s,u)}},dropEnabled:{get:function(){return n},set:function(f){f!==n&&(f?$le(s,u):C3e(s,u),n=f)}},dropError:{get:function(){return r}},clearOnDrop:{get:function(){return o},set:function(f){o=f}},flyToOnDrop:{get:function(){return i},set:function(f){i=f}},proxy:{get:function(){return c},set:function(f){c=f}},clampToGround:{get:function(){return a},set:function(f){a=f}}});function u(f){ZC(f),o&&(e.entities.removeAll(),e.dataSources.removeAll());let d=f.dataTransfer.files,p=d.length;for(let g=0;g<p;g++){let m=d[g],y=new FileReader;y.onload=x9t(e,m,c,a),y.onerror=T9t(e,m),y.readAsText(m)}}$le(s,u),e.destroy=G4(e,e.destroy,function(){e.dropEnabled=!1}),e._handleDrop=u}function ZC(e){e.stopPropagation(),e.preventDefault()}function C3e(e,t){let n=e;l(n)&&(n.removeEventListener("drop",t,!1),n.removeEventListener("dragenter",ZC,!1),n.removeEventListener("dragover",ZC,!1),n.removeEventListener("dragexit",ZC,!1))}function $le(e,t){e.addEventListener("drop",t,!1),e.addEventListener("dragenter",ZC,!1),e.addEventListener("dragover",ZC,!1),e.addEventListener("dragexit",ZC,!1)}function x9t(e,t,n,i){let r=e.scene;return function(o){let s=t.name;try{let a;if(/\.czml$/i.test(s))a=IV.load(JSON.parse(o.target.result),{sourceUri:s});else if(/\.geojson$/i.test(s)||/\.json$/i.test(s)||/\.topojson$/i.test(s))a=Rb.load(JSON.parse(o.target.result),{sourceUri:s,clampToGround:i});else if(/\.(kml|kmz)$/i.test(s))a=NC.load(t,{sourceUri:s,proxy:n,camera:r.camera,canvas:r.canvas,clampToGround:i,screenOverlayContainer:e.container});else if(/\.gpx$/i.test(s))a=x4.load(t,{sourceUri:s,proxy:n});else{e.dropError.raiseEvent(e,s,`Unrecognized file: ${s}`);return}l(a)&&e.dataSources.add(a).then(function(c){e.flyToOnDrop&&e.flyTo(c)}).catch(function(c){e.dropError.raiseEvent(e,s,c)})}catch(a){e.dropError.raiseEvent(e,s,a)}}}function T9t(e,t){return function(n){e.dropError.raiseEvent(e,t.name,n.target.error)}}var Jle=b9t;function E9t(e,t){t=t??H.EMPTY_OBJECT;let n=new Z8({scene:e.scene,container:e.bottomContainer,lowFrameRateMessage:t.lowFrameRateMessage});Object.defineProperties(e,{performanceWatchdog:{get:function(){return n}}})}var Zle=E9t;function v3e(e){let t=e.split(` `),n;for(n=0;n<t.length&&!t[n].match(/\S/);n++);if(n===t.length)return"";let i="",r=/^\s*/,s=t[n].match(r)[0].length;for(let a=n;a<t.length;a++){let c=t[a];c.match(r)[0].length>=s&&(c=c.slice(s)),i+=`${c} -`}return i}function Mh(e){this._scene=e,this._voxelPrimitive=void 0,this._customShaderCompilationRemoveCallback=void 0,this._definedProperties=[],this._getPrimitiveFunctions=[],this._modelMatrixReady=!1;let t=this;function n(r){let{name:o,initialValue:s}=r;t._definedProperties.push(o);let a=r.setPrimitiveFunction;a===!0&&(a=function(f){t._voxelPrimitive[o]=f});let c=r.getPrimitiveFunction;c===!0&&(c=function(){t[o]=t._voxelPrimitive[o]}),l(c)&&t._getPrimitiveFunctions.push(c);let u=ve.observable();return ve.defineProperty(t,o,{get:function(){return u()},set:function(f){typeof s=="number"&&typeof f=="string"&&(f=Number(f),isNaN(f)&&(f=s)),typeof s=="boolean"&&typeof f=="number"&&(f=f===1),u(f),l(a)&&l(t._voxelPrimitive)&&(a(f),e.requestRender())}}),t[o]=s,u}function i(r,o){return function(s){let a=t._voxelPrimitive[r].clone();a[o]=s,t._voxelPrimitive[r]=a}}n({name:"inspectorVisible",initialValue:!0}),n({name:"displayVisible",initialValue:!1}),n({name:"transformVisible",initialValue:!1}),n({name:"boundsVisible",initialValue:!1}),n({name:"clippingVisible",initialValue:!1}),n({name:"shaderVisible",initialValue:!1}),n({name:"shaderString",initialValue:"",getPrimitiveFunction:function(){let r=t._voxelPrimitive.customShader.fragmentShaderText;t.shaderString=C3e(r)}}),n({name:"shaderCompilationMessage",initialValue:""}),n({name:"shaderCompilationSuccess",initialValue:!0}),n({name:"depthTest",initialValue:!1,setPrimitiveFunction:!0,getPrimitiveFunction:!0}),n({name:"show",initialValue:!0,setPrimitiveFunction:!0,getPrimitiveFunction:!0}),n({name:"disableUpdate",initialValue:!1,setPrimitiveFunction:!0,getPrimitiveFunction:!0}),n({name:"debugDraw",initialValue:!1,setPrimitiveFunction:!0,getPrimitiveFunction:!0}),n({name:"jitter",initialValue:!0,setPrimitiveFunction:!0,getPrimitiveFunction:!0}),n({name:"nearestSampling",initialValue:!0,setPrimitiveFunction:!0,getPrimitiveFunction:!0}),n({name:"screenSpaceError",initialValue:4,setPrimitiveFunction:!0,getPrimitiveFunction:!0}),n({name:"stepSize",initialValue:1,setPrimitiveFunction:!0,getPrimitiveFunction:!0}),n({name:"shapeIsBox",getPrimitiveFunction:function(){let r=t._voxelPrimitive.shape;t.shapeIsBox=r===Ec.BOX}}),n({name:"shapeIsEllipsoid",getPrimitiveFunction:function(){let r=t._voxelPrimitive.shape;t.shapeIsEllipsoid=r===Ec.ELLIPSOID}}),n({name:"shapeIsCylinder",getPrimitiveFunction:function(){let r=t._voxelPrimitive.shape;t.shapeIsCylinder=r===Ec.CYLINDER}}),n({name:"clippingBoxMaxXMin",initialValue:0,getPrimitiveFunction:function(){t.clippingBoxMaxXMin=t._voxelPrimitive.minBounds.x}}),n({name:"clippingBoxMaxXMax",initialValue:1,getPrimitiveFunction:function(){t.clippingBoxMaxXMax=t._voxelPrimitive.maxBounds.x}}),n({name:"clippingBoxMaxX",initialValue:0,setPrimitiveFunction:i("maxClippingBounds","x"),getPrimitiveFunction:function(){t.clippingBoxMaxX=t._voxelPrimitive.maxClippingBounds.x}}),n({name:"clippingBoxMinXMin",initialValue:0,getPrimitiveFunction:function(){t.clippingBoxMinXMin=t._voxelPrimitive.minBounds.x}}),n({name:"clippingBoxMinXMax",initialValue:1,getPrimitiveFunction:function(){t.clippingBoxMinXMax=t._voxelPrimitive.maxBounds.x}}),n({name:"clippingBoxMinX",initialValue:0,setPrimitiveFunction:i("minClippingBounds","x"),getPrimitiveFunction:function(){t.clippingBoxMinX=t._voxelPrimitive.minClippingBounds.x}}),n({name:"clippingBoxMaxYMin",initialValue:0,getPrimitiveFunction:function(){t.clippingBoxMaxYMin=t._voxelPrimitive.minBounds.y}}),n({name:"clippingBoxMaxYMax",initialValue:1,getPrimitiveFunction:function(){t.clippingBoxMaxYMax=t._voxelPrimitive.maxBounds.y}}),n({name:"clippingBoxMaxY",initialValue:0,setPrimitiveFunction:i("maxClippingBounds","y"),getPrimitiveFunction:function(){t.clippingBoxMaxY=t._voxelPrimitive.maxClippingBounds.y}}),n({name:"clippingBoxMinYMin",initialValue:0,getPrimitiveFunction:function(){t.clippingBoxMinYMin=t._voxelPrimitive.minBounds.y}}),n({name:"clippingBoxMinYMax",initialValue:1,getPrimitiveFunction:function(){t.clippingBoxMinYMax=t._voxelPrimitive.maxBounds.y}}),n({name:"clippingBoxMinY",initialValue:0,setPrimitiveFunction:i("minClippingBounds","y"),getPrimitiveFunction:function(){t.clippingBoxMinY=t._voxelPrimitive.minClippingBounds.y}}),n({name:"clippingBoxMaxZMin",initialValue:0,getPrimitiveFunction:function(){t.clippingBoxMaxZMin=t._voxelPrimitive.minBounds.z}}),n({name:"clippingBoxMaxZMax",initialValue:1,getPrimitiveFunction:function(){t.clippingBoxMaxZMax=t._voxelPrimitive.maxBounds.z}}),n({name:"clippingBoxMaxZ",initialValue:0,setPrimitiveFunction:i("maxClippingBounds","z"),getPrimitiveFunction:function(){t.clippingBoxMaxZ=t._voxelPrimitive.maxClippingBounds.z}}),n({name:"clippingBoxMinZMin",initialValue:0,getPrimitiveFunction:function(){t.clippingBoxMinZMin=t._voxelPrimitive.minBounds.z}}),n({name:"clippingBoxMinZMax",initialValue:1,getPrimitiveFunction:function(){t.clippingBoxMinZMax=t._voxelPrimitive.maxBounds.z}}),n({name:"clippingBoxMinZ",initialValue:0,setPrimitiveFunction:i("minClippingBounds","z"),getPrimitiveFunction:function(){t.clippingBoxMinZ=t._voxelPrimitive.minClippingBounds.z}}),n({name:"clippingEllipsoidMaxLongitudeMin",initialValue:-D.PI,getPrimitiveFunction:function(){t.clippingEllipsoidMaxLongitudeMin=t._voxelPrimitive.minBounds.x}}),n({name:"clippingEllipsoidMaxLongitudeMax",initialValue:D.PI,getPrimitiveFunction:function(){t.clippingEllipsoidMaxLongitudeMax=t._voxelPrimitive.maxBounds.x}}),n({name:"clippingEllipsoidMaxLongitude",initialValue:0,setPrimitiveFunction:i("maxClippingBounds","x"),getPrimitiveFunction:function(){t.clippingEllipsoidMaxLongitude=t._voxelPrimitive.maxClippingBounds.x}}),n({name:"clippingEllipsoidMinLongitudeMin",initialValue:-D.PI,getPrimitiveFunction:function(){t.clippingEllipsoidMinLongitudeMin=t._voxelPrimitive.minBounds.x}}),n({name:"clippingEllipsoidMinLongitudeMax",initialValue:D.PI,getPrimitiveFunction:function(){t.clippingEllipsoidMinLongitudeMax=t._voxelPrimitive.maxBounds.x}}),n({name:"clippingEllipsoidMinLongitude",initialValue:0,setPrimitiveFunction:i("minClippingBounds","x"),getPrimitiveFunction:function(){t.clippingEllipsoidMinLongitude=t._voxelPrimitive.minClippingBounds.x}}),n({name:"clippingEllipsoidMaxLatitudeMin",initialValue:-D.PI_OVER_TWO,getPrimitiveFunction:function(){t.clippingEllipsoidMaxLatitudeMin=t._voxelPrimitive.minBounds.y}}),n({name:"clippingEllipsoidMaxLatitudeMax",initialValue:D.PI_OVER_TWO,getPrimitiveFunction:function(){t.clippingEllipsoidMaxLatitudeMax=t._voxelPrimitive.maxBounds.y}}),n({name:"clippingEllipsoidMaxLatitude",initialValue:0,setPrimitiveFunction:i("maxClippingBounds","y"),getPrimitiveFunction:function(){t.clippingEllipsoidMaxLatitude=t._voxelPrimitive.maxClippingBounds.y}}),n({name:"clippingEllipsoidMinLatitudeMin",initialValue:-D.PI_OVER_TWO,getPrimitiveFunction:function(){t.clippingEllipsoidMinLatitudeMin=t._voxelPrimitive.minBounds.y}}),n({name:"clippingEllipsoidMinLatitudeMax",initialValue:D.PI_OVER_TWO,getPrimitiveFunction:function(){t.clippingEllipsoidMinLatitudeMax=t._voxelPrimitive.maxBounds.y}}),n({name:"clippingEllipsoidMinLatitude",initialValue:0,setPrimitiveFunction:i("minClippingBounds","y"),getPrimitiveFunction:function(){t.clippingEllipsoidMinLatitude=t._voxelPrimitive.minClippingBounds.y}}),n({name:"clippingEllipsoidMaxHeightMin",initialValue:0,getPrimitiveFunction:function(){t.clippingEllipsoidMaxHeightMin=t._voxelPrimitive.minBounds.z}}),n({name:"clippingEllipsoidMaxHeightMax",initialValue:1e5,getPrimitiveFunction:function(){t.clippingEllipsoidMaxHeightMax=t._voxelPrimitive.maxBounds.z}}),n({name:"clippingEllipsoidMaxHeight",initialValue:0,setPrimitiveFunction:i("maxClippingBounds","z"),getPrimitiveFunction:function(){t.clippingEllipsoidMaxHeight=t._voxelPrimitive.maxClippingBounds.z}}),n({name:"clippingEllipsoidMinHeightMin",initialValue:-1e5,getPrimitiveFunction:function(){t.clippingEllipsoidMinHeightMin=t._voxelPrimitive.minBounds.z}}),n({name:"clippingEllipsoidMinHeightMax",initialValue:0,getPrimitiveFunction:function(){t.clippingEllipsoidMinHeightMax=t._voxelPrimitive.maxBounds.z}}),n({name:"clippingEllipsoidMinHeight",initialValue:0,setPrimitiveFunction:i("minClippingBounds","z"),getPrimitiveFunction:function(){t.clippingEllipsoidMinHeight=t._voxelPrimitive.minClippingBounds.z}}),n({name:"clippingCylinderMaxRadiusMin",initialValue:0,getPrimitiveFunction:function(){t.clippingCylinderMaxRadiusMin=t._voxelPrimitive.minBounds.x}}),n({name:"clippingCylinderMaxRadiusMax",initialValue:1,getPrimitiveFunction:function(){t.clippingCylinderMaxRadiusMax=t._voxelPrimitive.maxBounds.x}}),n({name:"clippingCylinderMaxRadius",initialValue:0,setPrimitiveFunction:i("maxClippingBounds","x"),getPrimitiveFunction:function(){t.clippingCylinderMaxRadius=t._voxelPrimitive.maxClippingBounds.x}}),n({name:"clippingCylinderMinRadiusMin",initialValue:0,getPrimitiveFunction:function(){t.clippingCylinderMinRadiusMin=t._voxelPrimitive.minBounds.x}}),n({name:"clippingCylinderMinRadiusMax",initialValue:1,getPrimitiveFunction:function(){t.clippingCylinderMinRadiusMax=t._voxelPrimitive.maxBounds.x}}),n({name:"clippingCylinderMinRadius",initialValue:0,setPrimitiveFunction:i("minClippingBounds","x"),getPrimitiveFunction:function(){t.clippingCylinderMinRadius=t._voxelPrimitive.minClippingBounds.x}}),n({name:"clippingCylinderMaxAngleMin",initialValue:-D.PI,getPrimitiveFunction:function(){t.clippingCylinderMaxAngleMin=t._voxelPrimitive.minBounds.y}}),n({name:"clippingCylinderMaxAngleMax",initialValue:D.PI,getPrimitiveFunction:function(){t.clippingCylinderMaxAngleMax=t._voxelPrimitive.maxBounds.y}}),n({name:"clippingCylinderMaxAngle",initialValue:0,setPrimitiveFunction:i("maxClippingBounds","y"),getPrimitiveFunction:function(){t.clippingCylinderMaxAngle=t._voxelPrimitive.maxClippingBounds.y}}),n({name:"clippingCylinderMinAngleMin",initialValue:-D.PI}),n({name:"clippingCylinderMinAngleMax",initialValue:D.PI}),n({name:"clippingCylinderMinAngle",initialValue:0,setPrimitiveFunction:i("minClippingBounds","y"),getPrimitiveFunction:function(){t.clippingCylinderMinAngle=t._voxelPrimitive.minClippingBounds.y}}),n({name:"clippingCylinderMaxHeightMin",initialValue:-1,getPrimitiveFunction:function(){t.clippingCylinderMaxHeightMin=t._voxelPrimitive.minBounds.z}}),n({name:"clippingCylinderMaxHeightMax",initialValue:1,getPrimitiveFunction:function(){t.clippingCylinderMaxHeightMax=t._voxelPrimitive.maxBounds.z}}),n({name:"clippingCylinderMaxHeight",initialValue:0,setPrimitiveFunction:i("maxClippingBounds","z"),getPrimitiveFunction:function(){t.clippingCylinderMaxHeight=t._voxelPrimitive.maxClippingBounds.z}}),n({name:"clippingCylinderMinHeightMin",initialValue:-1,getPrimitiveFunction:function(){t.clippingCylinderMinHeightMin=t._voxelPrimitive.minBounds.z}}),n({name:"clippingCylinderMinHeightMax",initialValue:1,getPrimitiveFunction:function(){t.clippingCylinderMinHeightMax=t._voxelPrimitive.maxBounds.z}}),n({name:"clippingCylinderMinHeight",initialValue:0,setPrimitiveFunction:i("minClippingBounds","z"),getPrimitiveFunction:function(){t.clippingCylinderMinHeight=t._voxelPrimitive.minClippingBounds.z}}),n({name:"translationX",initialValue:0,setPrimitiveFunction:function(){t._modelMatrixReady&&J0(t)},getPrimitiveFunction:function(){t.translationX=N.getTranslation(t._voxelPrimitive.modelMatrix,new h).x}}),n({name:"translationY",initialValue:0,setPrimitiveFunction:function(){t._modelMatrixReady&&J0(t)},getPrimitiveFunction:function(){t.translationY=N.getTranslation(t._voxelPrimitive.modelMatrix,new h).y}}),n({name:"translationZ",initialValue:0,setPrimitiveFunction:function(){t._modelMatrixReady&&J0(t)},getPrimitiveFunction:function(){t.translationZ=N.getTranslation(t._voxelPrimitive.modelMatrix,new h).z}}),n({name:"scaleX",initialValue:1,setPrimitiveFunction:function(){t._modelMatrixReady&&J0(t)},getPrimitiveFunction:function(){t.scaleX=N.getScale(t._voxelPrimitive.modelMatrix,new h).x}}),n({name:"scaleY",initialValue:1,setPrimitiveFunction:function(){t._modelMatrixReady&&J0(t)},getPrimitiveFunction:function(){t.scaleY=N.getScale(t._voxelPrimitive.modelMatrix,new h).y}}),n({name:"scaleZ",initialValue:1,setPrimitiveFunction:function(){t._modelMatrixReady&&J0(t)},getPrimitiveFunction:function(){t.scaleZ=N.getScale(t._voxelPrimitive.modelMatrix,new h).z}}),n({name:"angleX",initialValue:0,setPrimitiveFunction:function(){t._modelMatrixReady&&J0(t)}}),n({name:"angleY",initialValue:0,setPrimitiveFunction:function(){t._modelMatrixReady&&J0(t)}}),n({name:"angleZ",initialValue:0,setPrimitiveFunction:function(){t._modelMatrixReady&&J0(t)}})}var E9t=new h,C9t=new h,v9t=new wc,S9t=new $;function J0(e){let t=h.fromElements(e.translationX,e.translationY,e.translationZ,E9t),n=h.fromElements(e.scaleX,e.scaleY,e.scaleZ,C9t),i=v9t;i.heading=e.angleX,i.pitch=e.angleY,i.roll=e.angleZ;let r=$.fromHeadingPitchRoll(i,S9t),o=$.multiplyByScale(r,n,r);e._voxelPrimitive.modelMatrix=N.fromRotationTranslation(o,t,e._voxelPrimitive.modelMatrix)}Object.defineProperties(Mh.prototype,{scene:{get:function(){return this._scene}},voxelPrimitive:{get:function(){return this._voxelPrimitive},set:function(e){if(l(this._customShaderCompilationRemoveCallback)&&this._customShaderCompilationRemoveCallback(),!l(e))return;this._voxelPrimitive=e;let t=this;t._customShaderCompilationRemoveCallback=t._voxelPrimitive.customShaderCompilationEvent.addEventListener(function(n){let i=t._voxelPrimitive.customShader.fragmentShaderText;t.shaderString=C3e(i),l(n)?(t.shaderCompilationMessage=n.message,t.shaderCompilationSuccess=!1):(t.shaderCompilationMessage="Shader compiled successfully!",t.shaderCompilationSuccess=!0)}),t._modelMatrixReady=!1;for(let n=0;n<t._getPrimitiveFunctions.length;n++)t._getPrimitiveFunctions[n]();t._modelMatrixReady=!0,J0(t)}}});Mh.prototype.toggleInspector=function(){this.inspectorVisible=!this.inspectorVisible};Mh.prototype.toggleDisplay=function(){this.displayVisible=!this.displayVisible};Mh.prototype.toggleTransform=function(){this.transformVisible=!this.transformVisible};Mh.prototype.toggleBounds=function(){this.boundsVisible=!this.boundsVisible};Mh.prototype.toggleClipping=function(){this.clippingVisible=!this.clippingVisible};Mh.prototype.toggleShader=function(){this.shaderVisible=!this.shaderVisible};Mh.prototype.compileShader=function(){l(this._voxelPrimitive)&&(this._voxelPrimitive.customShader=new H0({fragmentShaderText:this.shaderString,uniforms:this._voxelPrimitive.customShader.uniforms}))};Mh.prototype.shaderEditorKeyPress=function(e,t){if(t.keyCode===9){t.preventDefault();let n=t.target,i=n.selectionStart,r=n.selectionEnd,o=r,a=n.value.slice(i,r).split(` +`}return i}function Mh(e){this._scene=e,this._voxelPrimitive=void 0,this._customShaderCompilationRemoveCallback=void 0,this._definedProperties=[],this._getPrimitiveFunctions=[],this._modelMatrixReady=!1;let t=this;function n(r){let{name:o,initialValue:s}=r;t._definedProperties.push(o);let a=r.setPrimitiveFunction;a===!0&&(a=function(f){t._voxelPrimitive[o]=f});let c=r.getPrimitiveFunction;c===!0&&(c=function(){t[o]=t._voxelPrimitive[o]}),l(c)&&t._getPrimitiveFunctions.push(c);let u=ve.observable();return ve.defineProperty(t,o,{get:function(){return u()},set:function(f){typeof s=="number"&&typeof f=="string"&&(f=Number(f),isNaN(f)&&(f=s)),typeof s=="boolean"&&typeof f=="number"&&(f=f===1),u(f),l(a)&&l(t._voxelPrimitive)&&(a(f),e.requestRender())}}),t[o]=s,u}function i(r,o){return function(s){let a=t._voxelPrimitive[r].clone();a[o]=s,t._voxelPrimitive[r]=a}}n({name:"inspectorVisible",initialValue:!0}),n({name:"displayVisible",initialValue:!1}),n({name:"transformVisible",initialValue:!1}),n({name:"boundsVisible",initialValue:!1}),n({name:"clippingVisible",initialValue:!1}),n({name:"shaderVisible",initialValue:!1}),n({name:"shaderString",initialValue:"",getPrimitiveFunction:function(){let r=t._voxelPrimitive.customShader.fragmentShaderText;t.shaderString=v3e(r)}}),n({name:"shaderCompilationMessage",initialValue:""}),n({name:"shaderCompilationSuccess",initialValue:!0}),n({name:"depthTest",initialValue:!1,setPrimitiveFunction:!0,getPrimitiveFunction:!0}),n({name:"show",initialValue:!0,setPrimitiveFunction:!0,getPrimitiveFunction:!0}),n({name:"disableUpdate",initialValue:!1,setPrimitiveFunction:!0,getPrimitiveFunction:!0}),n({name:"debugDraw",initialValue:!1,setPrimitiveFunction:!0,getPrimitiveFunction:!0}),n({name:"jitter",initialValue:!0,setPrimitiveFunction:!0,getPrimitiveFunction:!0}),n({name:"nearestSampling",initialValue:!0,setPrimitiveFunction:!0,getPrimitiveFunction:!0}),n({name:"screenSpaceError",initialValue:4,setPrimitiveFunction:!0,getPrimitiveFunction:!0}),n({name:"stepSize",initialValue:1,setPrimitiveFunction:!0,getPrimitiveFunction:!0}),n({name:"shapeIsBox",getPrimitiveFunction:function(){let r=t._voxelPrimitive.shape;t.shapeIsBox=r===Tc.BOX}}),n({name:"shapeIsEllipsoid",getPrimitiveFunction:function(){let r=t._voxelPrimitive.shape;t.shapeIsEllipsoid=r===Tc.ELLIPSOID}}),n({name:"shapeIsCylinder",getPrimitiveFunction:function(){let r=t._voxelPrimitive.shape;t.shapeIsCylinder=r===Tc.CYLINDER}}),n({name:"clippingBoxMaxXMin",initialValue:0,getPrimitiveFunction:function(){t.clippingBoxMaxXMin=t._voxelPrimitive.minBounds.x}}),n({name:"clippingBoxMaxXMax",initialValue:1,getPrimitiveFunction:function(){t.clippingBoxMaxXMax=t._voxelPrimitive.maxBounds.x}}),n({name:"clippingBoxMaxX",initialValue:0,setPrimitiveFunction:i("maxClippingBounds","x"),getPrimitiveFunction:function(){t.clippingBoxMaxX=t._voxelPrimitive.maxClippingBounds.x}}),n({name:"clippingBoxMinXMin",initialValue:0,getPrimitiveFunction:function(){t.clippingBoxMinXMin=t._voxelPrimitive.minBounds.x}}),n({name:"clippingBoxMinXMax",initialValue:1,getPrimitiveFunction:function(){t.clippingBoxMinXMax=t._voxelPrimitive.maxBounds.x}}),n({name:"clippingBoxMinX",initialValue:0,setPrimitiveFunction:i("minClippingBounds","x"),getPrimitiveFunction:function(){t.clippingBoxMinX=t._voxelPrimitive.minClippingBounds.x}}),n({name:"clippingBoxMaxYMin",initialValue:0,getPrimitiveFunction:function(){t.clippingBoxMaxYMin=t._voxelPrimitive.minBounds.y}}),n({name:"clippingBoxMaxYMax",initialValue:1,getPrimitiveFunction:function(){t.clippingBoxMaxYMax=t._voxelPrimitive.maxBounds.y}}),n({name:"clippingBoxMaxY",initialValue:0,setPrimitiveFunction:i("maxClippingBounds","y"),getPrimitiveFunction:function(){t.clippingBoxMaxY=t._voxelPrimitive.maxClippingBounds.y}}),n({name:"clippingBoxMinYMin",initialValue:0,getPrimitiveFunction:function(){t.clippingBoxMinYMin=t._voxelPrimitive.minBounds.y}}),n({name:"clippingBoxMinYMax",initialValue:1,getPrimitiveFunction:function(){t.clippingBoxMinYMax=t._voxelPrimitive.maxBounds.y}}),n({name:"clippingBoxMinY",initialValue:0,setPrimitiveFunction:i("minClippingBounds","y"),getPrimitiveFunction:function(){t.clippingBoxMinY=t._voxelPrimitive.minClippingBounds.y}}),n({name:"clippingBoxMaxZMin",initialValue:0,getPrimitiveFunction:function(){t.clippingBoxMaxZMin=t._voxelPrimitive.minBounds.z}}),n({name:"clippingBoxMaxZMax",initialValue:1,getPrimitiveFunction:function(){t.clippingBoxMaxZMax=t._voxelPrimitive.maxBounds.z}}),n({name:"clippingBoxMaxZ",initialValue:0,setPrimitiveFunction:i("maxClippingBounds","z"),getPrimitiveFunction:function(){t.clippingBoxMaxZ=t._voxelPrimitive.maxClippingBounds.z}}),n({name:"clippingBoxMinZMin",initialValue:0,getPrimitiveFunction:function(){t.clippingBoxMinZMin=t._voxelPrimitive.minBounds.z}}),n({name:"clippingBoxMinZMax",initialValue:1,getPrimitiveFunction:function(){t.clippingBoxMinZMax=t._voxelPrimitive.maxBounds.z}}),n({name:"clippingBoxMinZ",initialValue:0,setPrimitiveFunction:i("minClippingBounds","z"),getPrimitiveFunction:function(){t.clippingBoxMinZ=t._voxelPrimitive.minClippingBounds.z}}),n({name:"clippingEllipsoidMaxLongitudeMin",initialValue:-D.PI,getPrimitiveFunction:function(){t.clippingEllipsoidMaxLongitudeMin=t._voxelPrimitive.minBounds.x}}),n({name:"clippingEllipsoidMaxLongitudeMax",initialValue:D.PI,getPrimitiveFunction:function(){t.clippingEllipsoidMaxLongitudeMax=t._voxelPrimitive.maxBounds.x}}),n({name:"clippingEllipsoidMaxLongitude",initialValue:0,setPrimitiveFunction:i("maxClippingBounds","x"),getPrimitiveFunction:function(){t.clippingEllipsoidMaxLongitude=t._voxelPrimitive.maxClippingBounds.x}}),n({name:"clippingEllipsoidMinLongitudeMin",initialValue:-D.PI,getPrimitiveFunction:function(){t.clippingEllipsoidMinLongitudeMin=t._voxelPrimitive.minBounds.x}}),n({name:"clippingEllipsoidMinLongitudeMax",initialValue:D.PI,getPrimitiveFunction:function(){t.clippingEllipsoidMinLongitudeMax=t._voxelPrimitive.maxBounds.x}}),n({name:"clippingEllipsoidMinLongitude",initialValue:0,setPrimitiveFunction:i("minClippingBounds","x"),getPrimitiveFunction:function(){t.clippingEllipsoidMinLongitude=t._voxelPrimitive.minClippingBounds.x}}),n({name:"clippingEllipsoidMaxLatitudeMin",initialValue:-D.PI_OVER_TWO,getPrimitiveFunction:function(){t.clippingEllipsoidMaxLatitudeMin=t._voxelPrimitive.minBounds.y}}),n({name:"clippingEllipsoidMaxLatitudeMax",initialValue:D.PI_OVER_TWO,getPrimitiveFunction:function(){t.clippingEllipsoidMaxLatitudeMax=t._voxelPrimitive.maxBounds.y}}),n({name:"clippingEllipsoidMaxLatitude",initialValue:0,setPrimitiveFunction:i("maxClippingBounds","y"),getPrimitiveFunction:function(){t.clippingEllipsoidMaxLatitude=t._voxelPrimitive.maxClippingBounds.y}}),n({name:"clippingEllipsoidMinLatitudeMin",initialValue:-D.PI_OVER_TWO,getPrimitiveFunction:function(){t.clippingEllipsoidMinLatitudeMin=t._voxelPrimitive.minBounds.y}}),n({name:"clippingEllipsoidMinLatitudeMax",initialValue:D.PI_OVER_TWO,getPrimitiveFunction:function(){t.clippingEllipsoidMinLatitudeMax=t._voxelPrimitive.maxBounds.y}}),n({name:"clippingEllipsoidMinLatitude",initialValue:0,setPrimitiveFunction:i("minClippingBounds","y"),getPrimitiveFunction:function(){t.clippingEllipsoidMinLatitude=t._voxelPrimitive.minClippingBounds.y}}),n({name:"clippingEllipsoidMaxHeightMin",initialValue:0,getPrimitiveFunction:function(){t.clippingEllipsoidMaxHeightMin=t._voxelPrimitive.minBounds.z}}),n({name:"clippingEllipsoidMaxHeightMax",initialValue:1e5,getPrimitiveFunction:function(){t.clippingEllipsoidMaxHeightMax=t._voxelPrimitive.maxBounds.z}}),n({name:"clippingEllipsoidMaxHeight",initialValue:0,setPrimitiveFunction:i("maxClippingBounds","z"),getPrimitiveFunction:function(){t.clippingEllipsoidMaxHeight=t._voxelPrimitive.maxClippingBounds.z}}),n({name:"clippingEllipsoidMinHeightMin",initialValue:-1e5,getPrimitiveFunction:function(){t.clippingEllipsoidMinHeightMin=t._voxelPrimitive.minBounds.z}}),n({name:"clippingEllipsoidMinHeightMax",initialValue:0,getPrimitiveFunction:function(){t.clippingEllipsoidMinHeightMax=t._voxelPrimitive.maxBounds.z}}),n({name:"clippingEllipsoidMinHeight",initialValue:0,setPrimitiveFunction:i("minClippingBounds","z"),getPrimitiveFunction:function(){t.clippingEllipsoidMinHeight=t._voxelPrimitive.minClippingBounds.z}}),n({name:"clippingCylinderMaxRadiusMin",initialValue:0,getPrimitiveFunction:function(){t.clippingCylinderMaxRadiusMin=t._voxelPrimitive.minBounds.x}}),n({name:"clippingCylinderMaxRadiusMax",initialValue:1,getPrimitiveFunction:function(){t.clippingCylinderMaxRadiusMax=t._voxelPrimitive.maxBounds.x}}),n({name:"clippingCylinderMaxRadius",initialValue:0,setPrimitiveFunction:i("maxClippingBounds","x"),getPrimitiveFunction:function(){t.clippingCylinderMaxRadius=t._voxelPrimitive.maxClippingBounds.x}}),n({name:"clippingCylinderMinRadiusMin",initialValue:0,getPrimitiveFunction:function(){t.clippingCylinderMinRadiusMin=t._voxelPrimitive.minBounds.x}}),n({name:"clippingCylinderMinRadiusMax",initialValue:1,getPrimitiveFunction:function(){t.clippingCylinderMinRadiusMax=t._voxelPrimitive.maxBounds.x}}),n({name:"clippingCylinderMinRadius",initialValue:0,setPrimitiveFunction:i("minClippingBounds","x"),getPrimitiveFunction:function(){t.clippingCylinderMinRadius=t._voxelPrimitive.minClippingBounds.x}}),n({name:"clippingCylinderMaxAngleMin",initialValue:-D.PI,getPrimitiveFunction:function(){t.clippingCylinderMaxAngleMin=t._voxelPrimitive.minBounds.y}}),n({name:"clippingCylinderMaxAngleMax",initialValue:D.PI,getPrimitiveFunction:function(){t.clippingCylinderMaxAngleMax=t._voxelPrimitive.maxBounds.y}}),n({name:"clippingCylinderMaxAngle",initialValue:0,setPrimitiveFunction:i("maxClippingBounds","y"),getPrimitiveFunction:function(){t.clippingCylinderMaxAngle=t._voxelPrimitive.maxClippingBounds.y}}),n({name:"clippingCylinderMinAngleMin",initialValue:-D.PI}),n({name:"clippingCylinderMinAngleMax",initialValue:D.PI}),n({name:"clippingCylinderMinAngle",initialValue:0,setPrimitiveFunction:i("minClippingBounds","y"),getPrimitiveFunction:function(){t.clippingCylinderMinAngle=t._voxelPrimitive.minClippingBounds.y}}),n({name:"clippingCylinderMaxHeightMin",initialValue:-1,getPrimitiveFunction:function(){t.clippingCylinderMaxHeightMin=t._voxelPrimitive.minBounds.z}}),n({name:"clippingCylinderMaxHeightMax",initialValue:1,getPrimitiveFunction:function(){t.clippingCylinderMaxHeightMax=t._voxelPrimitive.maxBounds.z}}),n({name:"clippingCylinderMaxHeight",initialValue:0,setPrimitiveFunction:i("maxClippingBounds","z"),getPrimitiveFunction:function(){t.clippingCylinderMaxHeight=t._voxelPrimitive.maxClippingBounds.z}}),n({name:"clippingCylinderMinHeightMin",initialValue:-1,getPrimitiveFunction:function(){t.clippingCylinderMinHeightMin=t._voxelPrimitive.minBounds.z}}),n({name:"clippingCylinderMinHeightMax",initialValue:1,getPrimitiveFunction:function(){t.clippingCylinderMinHeightMax=t._voxelPrimitive.maxBounds.z}}),n({name:"clippingCylinderMinHeight",initialValue:0,setPrimitiveFunction:i("minClippingBounds","z"),getPrimitiveFunction:function(){t.clippingCylinderMinHeight=t._voxelPrimitive.minClippingBounds.z}}),n({name:"translationX",initialValue:0,setPrimitiveFunction:function(){t._modelMatrixReady&&J0(t)},getPrimitiveFunction:function(){t.translationX=N.getTranslation(t._voxelPrimitive.modelMatrix,new h).x}}),n({name:"translationY",initialValue:0,setPrimitiveFunction:function(){t._modelMatrixReady&&J0(t)},getPrimitiveFunction:function(){t.translationY=N.getTranslation(t._voxelPrimitive.modelMatrix,new h).y}}),n({name:"translationZ",initialValue:0,setPrimitiveFunction:function(){t._modelMatrixReady&&J0(t)},getPrimitiveFunction:function(){t.translationZ=N.getTranslation(t._voxelPrimitive.modelMatrix,new h).z}}),n({name:"scaleX",initialValue:1,setPrimitiveFunction:function(){t._modelMatrixReady&&J0(t)},getPrimitiveFunction:function(){t.scaleX=N.getScale(t._voxelPrimitive.modelMatrix,new h).x}}),n({name:"scaleY",initialValue:1,setPrimitiveFunction:function(){t._modelMatrixReady&&J0(t)},getPrimitiveFunction:function(){t.scaleY=N.getScale(t._voxelPrimitive.modelMatrix,new h).y}}),n({name:"scaleZ",initialValue:1,setPrimitiveFunction:function(){t._modelMatrixReady&&J0(t)},getPrimitiveFunction:function(){t.scaleZ=N.getScale(t._voxelPrimitive.modelMatrix,new h).z}}),n({name:"angleX",initialValue:0,setPrimitiveFunction:function(){t._modelMatrixReady&&J0(t)}}),n({name:"angleY",initialValue:0,setPrimitiveFunction:function(){t._modelMatrixReady&&J0(t)}}),n({name:"angleZ",initialValue:0,setPrimitiveFunction:function(){t._modelMatrixReady&&J0(t)}})}var C9t=new h,v9t=new h,S9t=new wc,w9t=new $;function J0(e){let t=h.fromElements(e.translationX,e.translationY,e.translationZ,C9t),n=h.fromElements(e.scaleX,e.scaleY,e.scaleZ,v9t),i=S9t;i.heading=e.angleX,i.pitch=e.angleY,i.roll=e.angleZ;let r=$.fromHeadingPitchRoll(i,w9t),o=$.multiplyByScale(r,n,r);e._voxelPrimitive.modelMatrix=N.fromRotationTranslation(o,t,e._voxelPrimitive.modelMatrix)}Object.defineProperties(Mh.prototype,{scene:{get:function(){return this._scene}},voxelPrimitive:{get:function(){return this._voxelPrimitive},set:function(e){if(l(this._customShaderCompilationRemoveCallback)&&this._customShaderCompilationRemoveCallback(),!l(e))return;this._voxelPrimitive=e;let t=this;t._customShaderCompilationRemoveCallback=t._voxelPrimitive.customShaderCompilationEvent.addEventListener(function(n){let i=t._voxelPrimitive.customShader.fragmentShaderText;t.shaderString=v3e(i),l(n)?(t.shaderCompilationMessage=n.message,t.shaderCompilationSuccess=!1):(t.shaderCompilationMessage="Shader compiled successfully!",t.shaderCompilationSuccess=!0)}),t._modelMatrixReady=!1;for(let n=0;n<t._getPrimitiveFunctions.length;n++)t._getPrimitiveFunctions[n]();t._modelMatrixReady=!0,J0(t)}}});Mh.prototype.toggleInspector=function(){this.inspectorVisible=!this.inspectorVisible};Mh.prototype.toggleDisplay=function(){this.displayVisible=!this.displayVisible};Mh.prototype.toggleTransform=function(){this.transformVisible=!this.transformVisible};Mh.prototype.toggleBounds=function(){this.boundsVisible=!this.boundsVisible};Mh.prototype.toggleClipping=function(){this.clippingVisible=!this.clippingVisible};Mh.prototype.toggleShader=function(){this.shaderVisible=!this.shaderVisible};Mh.prototype.compileShader=function(){l(this._voxelPrimitive)&&(this._voxelPrimitive.customShader=new D0({fragmentShaderText:this.shaderString,uniforms:this._voxelPrimitive.customShader.uniforms}))};Mh.prototype.shaderEditorKeyPress=function(e,t){if(t.keyCode===9){t.preventDefault();let n=t.target,i=n.selectionStart,r=n.selectionEnd,o=r,a=n.value.slice(i,r).split(` `),c=a.length,u;if(t.shiftKey)for(u=0;u<c;++u)a[u][0]===" "&&(a[u][1]===" "?(a[u]=a[u].substr(2),o-=2):(a[u]=a[u].substr(1),o-=1));else for(u=0;u<c;++u)a[u]=` ${a[u]}`,o+=2;let f=a.join(` -`);n.value=n.value.slice(0,i)+f+n.value.slice(r),n.selectionStart=i!==r?i:o,n.selectionEnd=o}else t.ctrlKey&&(t.keyCode===10||t.keyCode===13)&&this.compileShader();return!0};Mh.prototype.isDestroyed=function(){return!1};Mh.prototype.destroy=function(){let e=this;return this._definedProperties.forEach(function(t){ve.getObservable(e,t).dispose()}),le(this)};var dj=Mh;function vq(e,t){e=Ln(e);let n=document.createElement("div"),i=new dj(t);this._viewModel=i,this._container=e,this._element=n;let r=document.createElement("div");r.textContent="Voxel Inspector",r.className="cesium-cesiumInspector-button",r.setAttribute("data-bind","click: toggleInspector"),n.appendChild(r),n.className="cesium-cesiumInspector cesium-VoxelInspector",n.setAttribute("data-bind",'css: { "cesium-cesiumInspector-visible" : inspectorVisible, "cesium-cesiumInspector-hidden" : !inspectorVisible}'),e.appendChild(n);let o=document.createElement("div");o.className="cesium-cesiumInspector-dropDown",n.appendChild(o);let{createSection:s,createCheckbox:a,createRangeInput:c,createButton:u}=Af,f=s(o,"Display","displayVisible","toggleDisplay"),d=s(o,"Transform","transformVisible","toggleTransform"),p=s(o,"Clipping","clippingVisible","toggleClipping"),g=s(o,"Shader","shaderVisible","toggleShader");f.appendChild(a("Depth Test","depthTest")),f.appendChild(a("Show","show")),f.appendChild(a("Disable Update","disableUpdate")),f.appendChild(a("Debug Draw","debugDraw")),f.appendChild(a("Jitter","jitter")),f.appendChild(a("Nearest Sampling","nearestSampling")),f.appendChild(c("Screen Space Error","screenSpaceError",0,128)),f.appendChild(c("Step Size","stepSize",0,2));let m=10,y=10,A=D.PI;d.appendChild(c("Translation X","translationX",-m,+m)),d.appendChild(c("Translation Y","translationY",-m,+m)),d.appendChild(c("Translation Z","translationZ",-m,+m)),d.appendChild(c("Scale X","scaleX",0,+y)),d.appendChild(c("Scale Y","scaleY",0,+y)),d.appendChild(c("Scale Z","scaleZ",0,+y)),d.appendChild(c("Heading","angleX",-A,+A)),d.appendChild(c("Pitch","angleY",-A,+A)),d.appendChild(c("Roll","angleZ",-A,+A)),Qle("Max X","Min X","Max Y","Min Y","Max Z","Min Z","clippingBoxMaxX","clippingBoxMinX","clippingBoxMaxY","clippingBoxMinY","clippingBoxMaxZ","clippingBoxMinZ","shapeIsBox",p),Qle("Max Longitude","Min Longitude","Max Latitude","Min Latitude","Max Height","Min Height","clippingEllipsoidMaxLongitude","clippingEllipsoidMinLongitude","clippingEllipsoidMaxLatitude","clippingEllipsoidMinLatitude","clippingEllipsoidMaxHeight","clippingEllipsoidMinHeight","shapeIsEllipsoid",p),Qle("Max Radius","Min Radius","Max Angle","Min Angle","Max Height","Min Height","clippingCylinderMaxRadius","clippingCylinderMinRadius","clippingCylinderMaxAngle","clippingCylinderMinAngle","clippingCylinderMaxHeight","clippingCylinderMinHeight","shapeIsCylinder",p);let b=document.createElement("div");g.appendChild(b);let x=document.createElement("textarea");x.setAttribute("data-bind","textInput: shaderString, event: { keydown: shaderEditorKeyPress }"),b.className="cesium-cesiumInspector-styleEditor",b.appendChild(x);let T=u("Compile (Ctrl+Enter)","compileShader");b.appendChild(T);let E=document.createElement("label");E.style.display="block",E.setAttribute("data-bind","text: shaderCompilationMessage, style: {color: shaderCompilationSuccess ? 'green' : 'red'}"),b.appendChild(E),ve.applyBindings(i,n)}Object.defineProperties(vq.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}}});vq.prototype.isDestroyed=function(){return!1};vq.prototype.destroy=function(){return ve.cleanNode(this._element),this._container.removeChild(this._element),this.viewModel.destroy(),le(this)};function Qle(e,t,n,i,r,o,s,a,c,u,f,d,p,g){let m=Af.createRangeInputWithDynamicMinMax,y=g.appendChild(document.createElement("div"));y.setAttribute("data-bind",`if: ${p}`),y.appendChild(m(e,s)),y.appendChild(m(t,a)),y.appendChild(m(n,c)),y.appendChild(m(i,u)),y.appendChild(m(r,f)),y.appendChild(m(o,d))}var hj=vq;function w9t(e){let t=document.createElement("div");t.className="cesium-viewer-voxelInspectorContainer",e.container.appendChild(t);let n=new hj(t,e.scene);Object.defineProperties(e,{voxelInspector:{get:function(){return n}}})}var eue=w9t;globalThis.CESIUM_VERSION="1.145.0";var I9t="1.145.0";0&&(module.exports={AlphaMode,AlphaPipelineStage,AnchorPointDirect,AnchorPointIndirect,Animation,AnimationViewModel,Appearance,ApproximateTerrainHeights,ArcGISTiledElevationTerrainProvider,ArcGisBaseMapType,ArcGisMapServerImageryProvider,ArcGisMapService,ArcType,ArticulationStageType,AssociativeArray,Atmosphere,AtmospherePipelineStage,AttributeCompression,AttributeType,AutoExposure,AutomaticUniforms,Axis,AxisAlignedBoundingBox,Azure2DImageryProvider,B3dmLoader,B3dmParser,BaseLayerPicker,BaseLayerPickerViewModel,BatchTable,BatchTableHierarchy,BatchTexture,BatchTexturePipelineStage,Billboard,BillboardCollection,BillboardGraphics,BillboardLoadState,BillboardTexture,BillboardVisualizer,BingMapsGeocoderService,BingMapsImageryProvider,BingMapsStyle,BlendEquation,BlendFunction,BlendOption,BlendingState,BoundingRectangle,BoundingSphere,BoundingSphereState,BoundingVolumeSemantics,BoxEmitter,BoxGeometry,BoxGeometryUpdater,BoxGraphics,BoxOutlineGeometry,BrdfLutGenerator,Buffer,BufferLoader,BufferPoint,BufferPointCollection,BufferPointMaterial,BufferPolygon,BufferPolygonCollection,BufferPolygonMaterial,BufferPolyline,BufferPolylineCollection,BufferPolylineMaterial,BufferPrimitive,BufferPrimitiveCollection,BufferPrimitiveMaterial,BufferUsage,CPUStylingPipelineStage,CallbackPositionProperty,CallbackProperty,Camera,CameraEventAggregator,CameraEventType,CameraFlightPath,Cartesian2,Cartesian3,Cartesian4,CartesianRectangle,Cartographic,CartographicGeocoderService,CatmullRomSpline,Cesium3DContentGroup,Cesium3DTile,Cesium3DTileBatchTable,Cesium3DTileColorBlendMode,Cesium3DTileContent,Cesium3DTileContentFactory,Cesium3DTileContentState,Cesium3DTileContentType,Cesium3DTileFeature,Cesium3DTileFeatureTable,Cesium3DTileOptimizationHint,Cesium3DTileOptimizations,Cesium3DTilePass,Cesium3DTilePassState,Cesium3DTilePointFeature,Cesium3DTileRefine,Cesium3DTileStyle,Cesium3DTileStyleEngine,Cesium3DTileVectorFeature,Cesium3DTilesInspector,Cesium3DTilesInspectorViewModel,Cesium3DTilesTerrainData,Cesium3DTilesTerrainGeometryProcessor,Cesium3DTilesTerrainProvider,Cesium3DTilesVoxelProvider,Cesium3DTileset,Cesium3DTilesetBaseTraversal,Cesium3DTilesetCache,Cesium3DTilesetGraphics,Cesium3DTilesetHeatmap,Cesium3DTilesetMetadata,Cesium3DTilesetMostDetailedTraversal,Cesium3DTilesetSkipTraversal,Cesium3DTilesetStatistics,Cesium3DTilesetTraversal,Cesium3DTilesetVisualizer,CesiumInspector,CesiumInspectorViewModel,CesiumTerrainProvider,CesiumWidget,Check,CheckerboardMaterialProperty,CircleEmitter,CircleGeometry,CircleOutlineGeometry,ClassificationModelDrawCommand,ClassificationPipelineStage,ClassificationPrimitive,ClassificationType,ClearCommand,ClippingPlane,ClippingPlaneCollection,ClippingPolygon,ClippingPolygonCollection,Clock,ClockRange,ClockStep,ClockViewModel,CloudCollection,CloudType,Color,ColorBlendMode,ColorGeometryInstanceAttribute,ColorMaterialProperty,Command,ComponentDatatype,Composite3DTileContent,CompositeEntityCollection,CompositeMaterialProperty,CompositePositionProperty,CompositeProperty,CompressedTextureBuffer,ComputeCommand,ComputeEngine,ConditionsExpression,ConeEmitter,ConstantPositionProperty,ConstantProperty,ConstantSpline,ContentMetadata,Context,ContextLimits,Controller,ControllerHost,CoplanarPolygonGeometry,CoplanarPolygonGeometryLibrary,CoplanarPolygonOutlineGeometry,CornerType,CorrelationGroup,CorridorGeometry,CorridorGeometryLibrary,CorridorGeometryUpdater,CorridorGraphics,CorridorOutlineGeometry,Credit,CreditDisplay,CubeMap,CubeMapFace,CubeMapPanorama,CubicRealPolynomial,CullFace,CullingVolume,CumulusCloud,CustomDataSource,CustomHeightmapTerrainProvider,CustomShader,CustomShaderMode,CustomShaderPipelineStage,CustomShaderTranslucencyMode,CylinderGeometry,CylinderGeometryLibrary,CylinderGeometryUpdater,CylinderGraphics,CylinderOutlineGeometry,CzmlDataSource,DataSource,DataSourceClock,DataSourceCollection,DataSourceDisplay,DebugAppearance,DebugCameraPrimitive,DebugInspector,DebugModelMatrixPrimitive,DefaultProxy,DepthFunction,DepthPlane,DequantizationPipelineStage,DerivedCommand,DeveloperError,DeviceOrientationCameraController,DirectionalLight,DiscardEmptyTileImagePolicy,DiscardMissingTileImagePolicy,DistanceDisplayCondition,DistanceDisplayConditionGeometryInstanceAttribute,DoubleEndedPriorityQueue,DoublyLinkedList,DracoLoader,DrawCommand,DynamicAtmosphereLightingType,DynamicEnvironmentMapManager,DynamicGeometryBatch,DynamicGeometryUpdater,EarthOrientationParameters,EarthOrientationParametersSample,EasingFunction,EdgeDetectionPipelineStage,EdgeDisplayMode,EdgeFramebuffer,EdgeVisibilityPipelineStage,EllipseGeometry,EllipseGeometryLibrary,EllipseGeometryUpdater,EllipseGraphics,EllipseOutlineGeometry,Ellipsoid,EllipsoidGeodesic,EllipsoidGeometry,EllipsoidGeometryUpdater,EllipsoidGraphics,EllipsoidOutlineGeometry,EllipsoidPrimitive,EllipsoidRhumbLine,EllipsoidSurfaceAppearance,EllipsoidTangentPlane,EllipsoidTerrainProvider,EllipsoidalOccluder,Empty3DTileContent,EncodedCartesian3,Entity,EntityCluster,EntityCollection,EntityView,EquirectangularPanorama,Event,EventHelper,Expression,ExpressionNodeType,ExtrapolationType,FeatureDetection,FeatureIdPipelineStage,Fog,ForEach,FrameRateMonitor,FrameState,Framebuffer,FramebufferManager,Frozen,FrustumCommands,FrustumGeometry,FrustumOutlineGeometry,Fullscreen,FullscreenButton,FullscreenButtonViewModel,GaussianSplat3DTileContent,GaussianSplatPrimitive,GaussianSplatRenderResources,GaussianSplatSorter,GaussianSplatTextureGenerator,GeoJsonDataSource,GeoJsonLoader,GeoJsonPrimitive,GeocodeType,Geocoder,GeocoderService,GeocoderViewModel,GeographicProjection,GeographicTilingScheme,Geometry,Geometry3DTileContent,GeometryAttribute,GeometryAttributes,GeometryFactory,GeometryInstance,GeometryInstanceAttribute,GeometryOffsetAttribute,GeometryPipeline,GeometryPipelineStage,GeometryType,GeometryUpdater,GeometryUpdaterSet,GeometryVisualizer,GetFeatureInfoFormat,Globe,GlobeDepth,GlobeSurfaceShaderSet,GlobeSurfaceTile,GlobeSurfaceTileProvider,GlobeTranslucency,GlobeTranslucencyFramebuffer,GlobeTranslucencyState,GltfBufferViewLoader,GltfDracoLoader,GltfGpmLoader,GltfGpmLocal,GltfImageLoader,GltfIndexBufferLoader,GltfJsonLoader,GltfLoader,GltfLoaderUtil,GltfMeshPrimitiveGpmLoader,GltfSpzLoader,GltfStructuralMetadataLoader,GltfTextureLoader,GltfVertexBufferLoader,Google2DImageryProvider,GoogleEarthEnterpriseImageryProvider,GoogleEarthEnterpriseMapsProvider,GoogleEarthEnterpriseMetadata,GoogleEarthEnterpriseTerrainData,GoogleEarthEnterpriseTerrainProvider,GoogleEarthEnterpriseTileInformation,GoogleGeocoderService,GoogleMaps,GoogleStreetViewCubeMapPanoramaProvider,GpxDataSource,GregorianDate,GridImageryProvider,GridMaterialProperty,GroundGeometryUpdater,GroundPolylineGeometry,GroundPolylinePrimitive,GroundPrimitive,GroupMetadata,HeadingPitchRange,HeadingPitchRoll,Heap,HeightReference,HeightmapEncoding,HeightmapTerrainData,HeightmapTessellator,HermitePolynomialApproximation,HermiteSpline,HilbertOrder,HomeButton,HomeButtonViewModel,HorizontalOrigin,HybridScreenSpacePanCameraController,I3SBuildingSceneLayerExplorer,I3SBuildingSceneLayerExplorerViewModel,I3SDataProvider,I3SDecoder,I3SFeature,I3SField,I3SGeometry,I3SLayer,I3SNode,I3SStatistics,I3SSublayer,I3SSymbology,I3dmLoader,I3dmParser,ITwinData,ITwinPlatform,Iau2000Orientation,Iau2006XysData,Iau2006XysSample,IauOrientationAxes,IauOrientationParameters,ImageBasedLighting,ImageBasedLightingPipelineStage,ImageMaterialProperty,Imagery,ImageryConfiguration,ImageryCoverage,ImageryFlags,ImageryInput,ImageryLayer,ImageryLayerCollection,ImageryLayerFeatureInfo,ImageryPipelineStage,ImageryProvider,ImageryState,Implicit3DTileContent,ImplicitAvailabilityBitstream,ImplicitMetadataView,ImplicitSubdivisionScheme,ImplicitSubtree,ImplicitSubtreeCache,ImplicitSubtreeMetadata,ImplicitTileCoordinates,ImplicitTileset,IndexDatatype,InfoBox,InfoBoxViewModel,InspectorShared,InstanceAttributeSemantic,InstancingPipelineStage,InterpolationAlgorithm,InterpolationType,Intersect,IntersectionTests,Intersections2D,Interval,InvertClassification,Ion,IonGeocodeProviderType,IonGeocoderService,IonImageryProvider,IonImageryProviderFactory,IonResource,IonSnapGeometryType,IonSnapHeat,IonSnapMode,IonSnapParentGeometryType,IonSnapService,IonWorldImageryStyle,Iso8601,JobScheduler,JobType,JsonMetadataTable,JulianDate,KTX2Transcoder,KeyboardEventModifier,KeyframeNode,KmlCamera,KmlDataSource,KmlLookAt,KmlTour,KmlTourFlyTo,KmlTourWait,Label,LabelCollection,LabelGraphics,LabelStyle,LabelVisualizer,LagrangePolynomialApproximation,LeapSecond,Light,LightingModel,LightingPipelineStage,LinearApproximation,LinearSpline,MVTDataProvider,ManagedArray,MapMode2D,MapProjection,MapboxImageryProvider,MapboxStyleImageryProvider,MappedPositions,Material,MaterialAppearance,MaterialPipelineStage,MaterialProperty,Math,Matrix2,Matrix3,Matrix4,Megatexture,MeshPrimitiveGpmLocal,MetadataClass,MetadataClassProperty,MetadataComponentType,MetadataEntity,MetadataEnum,MetadataEnumValue,MetadataPicking,MetadataPickingPipelineStage,MetadataPipelineStage,MetadataSchema,MetadataSchemaLoader,MetadataSemantic,MetadataTable,MetadataTableProperty,MetadataType,MipmapHint,Model,Model3DTileContent,ModelAlphaOptions,ModelAnimation,ModelAnimationChannel,ModelAnimationCollection,ModelAnimationLoop,ModelAnimationState,ModelArticulation,ModelArticulationStage,ModelClippingPlanesPipelineStage,ModelClippingPolygonsPipelineStage,ModelColorPipelineStage,ModelComponents,ModelDrawCommand,ModelDrawCommands,ModelFeature,ModelFeatureTable,ModelGraphics,ModelImagery,ModelImageryMapping,ModelLightingOptions,ModelMatrixUpdateStage,ModelNode,ModelPrimitiveImagery,ModelReader,ModelRenderResources,ModelRuntimeNode,ModelRuntimePrimitive,ModelSceneGraph,ModelSilhouettePipelineStage,ModelSkin,ModelSplitterPipelineStage,ModelStatistics,ModelType,ModelUtility,ModelVectorLookupPipelineStage,ModelVisualizer,Moon,MorphTargetsPipelineStage,MorphWeightSpline,MortonOrder,MouseButton,Multiple3DTileContent,MultisampleFramebuffer,NavigationHelpButton,NavigationHelpButtonViewModel,NearFarScalar,NeverTileDiscardPolicy,NodeRenderResources,NodeStatisticsPipelineStage,NodeTransformationProperty,OIT,Occluder,OffsetGeometryInstanceAttribute,OpenCageGeocoderService,OpenStreetMapImageryProvider,OrderedGroundPrimitiveCollection,OrientedBoundingBox,OrthographicFrustum,OrthographicOffCenterFrustum,Packable,PackableForInterpolation,Panorama,PanoramaProvider,Particle,ParticleBurst,ParticleEmitter,ParticleSystem,Pass,PassState,PathGraphics,PathMode,PathVisualizer,PeliasGeocoderService,PerInstanceColorAppearance,PerformanceDisplay,PerformanceWatchdog,PerformanceWatchdogViewModel,PerspectiveFrustum,PerspectiveOffCenterFrustum,PickDepth,PickDepthFramebuffer,PickFramebuffer,PickId,PickedMetadataInfo,Picking,PickingPipelineStage,PinBuilder,PixelDatatype,PixelFormat,PlanarFillIdFramebuffer,Plane,PlaneGeometry,PlaneGeometryUpdater,PlaneGraphics,PlaneOutlineGeometry,PntsLoader,PntsParser,PointCloud,PointCloudEyeDomeLighting,PointCloudShading,PointCloudStylingPipelineStage,PointGraphics,PointPrimitive,PointPrimitiveCollection,PointVisualizer,PolygonGeometry,PolygonGeometryLibrary,PolygonGeometryUpdater,PolygonGraphics,PolygonHierarchy,PolygonOutlineGeometry,PolygonPipeline,Polyline,PolylineArrowMaterialProperty,PolylineCollection,PolylineColorAppearance,PolylineDashMaterialProperty,PolylineGeometry,PolylineGeometryUpdater,PolylineGlowMaterialProperty,PolylineGraphics,PolylineMaterialAppearance,PolylineOutlineMaterialProperty,PolylinePipeline,PolylineVisualizer,PolylineVolumeGeometry,PolylineVolumeGeometryLibrary,PolylineVolumeGeometryUpdater,PolylineVolumeGraphics,PolylineVolumeOutlineGeometry,PositionProperty,PositionPropertyArray,PostProcessStage,PostProcessStageCollection,PostProcessStageComposite,PostProcessStageLibrary,PostProcessStageSampleMode,PostProcessStageTextureCache,PpeMetadata,PpeSource,PpeTexture,Primitive,PrimitiveCollection,PrimitiveLoadPlan,PrimitiveOutlineGenerator,PrimitiveOutlinePipelineStage,PrimitivePipeline,PrimitiveRenderResources,PrimitiveState,PrimitiveStatisticsPipelineStage,PrimitiveType,ProjectionPicker,ProjectionPickerViewModel,Property,PropertyArray,PropertyAttribute,PropertyAttributeProperty,PropertyBag,PropertyTable,PropertyTexture,PropertyTextureProperty,ProviderViewModel,Proxy,QuadraticRealPolynomial,QuadtreeOccluders,QuadtreePrimitive,QuadtreeTile,QuadtreeTileLoadState,QuadtreeTileProvider,QuantizedMeshTerrainData,QuarticRealPolynomial,Quaternion,QuaternionSpline,Queue,Ray,Rectangle,RectangleCollisionChecker,RectangleGeometry,RectangleGeometryLibrary,RectangleGeometryUpdater,RectangleGraphics,RectangleOutlineGeometry,ReferenceFrame,ReferenceProperty,RenderState,Renderbuffer,RenderbufferFormat,Request,RequestErrorEvent,RequestScheduler,RequestState,RequestType,Resource,ResourceCache,ResourceCacheKey,ResourceCacheStatistics,ResourceLoader,ResourceLoaderState,Rotation,RuntimeError,S2Cell,SDFSettings,SampledPositionProperty,SampledProperty,Sampler,ScaledPositionProperty,Scene,SceneFramebuffer,SceneMode,SceneMode2DPipelineStage,SceneModePicker,SceneModePickerViewModel,SceneTransforms,SceneTransitioner,ScreenSpaceCameraController,ScreenSpaceElevatorCameraController,ScreenSpaceEventHandler,ScreenSpaceEventType,ScreenSpaceInputBindings,ScreenSpaceMapCameraController,ScreenSpaceTiltOrbitCameraController,ScreenSpaceZoomCameraController,SelectedFeatureIdPipelineStage,SelectionIndicator,SelectionIndicatorViewModel,SensorVolumePortionToDisplay,ShaderBuilder,ShaderCache,ShaderDestination,ShaderFunction,ShaderProgram,ShaderSource,ShaderStruct,ShadowMap,ShadowMapShader,ShadowMode,ShadowVolumeAppearance,SharedContext,ShowGeometryInstanceAttribute,Simon1994PlanetaryPositions,SimplePolylineGeometry,SingleTileImageryProvider,SkinningPipelineStage,SkyAtmosphere,SkyBox,SnapFramebuffer,SnapService,Snapping,SpatialNode,Spdcf,SpecularEnvironmentCubeMap,SphereEmitter,SphereGeometry,SphereOutlineGeometry,Spherical,Spline,SplitDirection,Splitter,StaticGeometryColorBatch,StaticGeometryPerMaterialBatch,StaticGroundGeometryColorBatch,StaticGroundGeometryPerMaterialBatch,StaticGroundPolylinePerMaterialBatch,StaticOutlineGeometryBatch,StencilConstants,StencilFunction,StencilOperation,SteppedSpline,Stereographic,StorageType,StripeMaterialProperty,StripeOrientation,StructuralMetadata,StyleCommandsNeeded,StyleExpression,Sun,SunLight,SunPostProcess,SupportedImageFormats,SvgPathBindingHandler,Sync,TaskProcessor,Terrain,TerrainData,TerrainEncoding,TerrainFillMesh,TerrainMesh,TerrainOffsetProperty,TerrainPicker,TerrainProvider,TerrainQuantization,TerrainState,Texture,Texture3D,TextureAtlas,TextureCache,TextureMagnificationFilter,TextureManager,TextureMinificationFilter,TexturePacker,TextureUniform,TextureWrap,TileAvailability,TileBoundingRegion,TileBoundingS2Cell,TileBoundingSphere,TileBoundingVolume,TileCoordinatesImageryProvider,TileDiscardPolicy,TileEdge,TileImagery,TileMapServiceImageryProvider,TileMetadata,TileOrientedBoundingBox,TileProviderError,TileReplacementQueue,TileSelectionResult,TileState,Tileset3DTileContent,TilesetMetadata,TilesetPipelineStage,TilingScheme,TimeConstants,TimeDynamicImagery,TimeDynamicPointCloud,TimeInterval,TimeIntervalCollection,TimeIntervalCollectionPositionProperty,TimeIntervalCollectionProperty,TimeStandard,Timeline,TimelineHighlightRange,TimelineTrack,Tipsify,ToggleButtonViewModel,Tonemapper,TrackingReferenceFrame,Transforms,TranslationRotationScale,TranslucentTileClassification,TridiagonalSystemSolver,TrustedServers,TweenCollection,UniformState,UniformType,UrlTemplate3DTilesDataProvider,UrlTemplateImageryProvider,VERSION,VRButton,VRButtonViewModel,VRTheWorldTerrainProvider,VaryingType,Vector3DTileBatch,Vector3DTileClampedPolylines,Vector3DTileContent,Vector3DTileGeometry,Vector3DTilePoints,Vector3DTilePolygons,Vector3DTilePolylines,Vector3DTilePrimitive,VectorGltf3DTileContent,VectorPipeline,VectorProvider,VelocityOrientationProperty,VelocityVectorProperty,VertexArray,VertexArrayFacade,VertexAttributeSemantic,VertexFormat,VerticalExaggeration,VerticalExaggerationPipelineStage,VerticalOrigin,VideoSynchronizer,View,Viewer,ViewportQuad,Visibility,Visualizer,VoxelBoundsCollection,VoxelBoxShape,VoxelCell,VoxelContent,VoxelCylinderShape,VoxelEllipsoidShape,VoxelInspector,VoxelInspectorViewModel,VoxelMetadataOrder,VoxelPrimitive,VoxelProvider,VoxelRenderResources,VoxelShape,VoxelShapeType,VoxelTraversal,VulkanConstants,WallGeometry,WallGeometryLibrary,WallGeometryUpdater,WallGraphics,WallOutlineGeometry,WebGLConstants,WebMapServiceImageryProvider,WebMapTileServiceImageryProvider,WebMercatorProjection,WebMercatorTilingScheme,WindingOrder,WireframeIndexGenerator,WireframePipelineStage,_shadersAcesTonemappingStage,_shadersAdditiveBlend,_shadersAdjustTranslucentFS,_shadersAllMaterialAppearanceFS,_shadersAllMaterialAppearanceVS,_shadersAmbientOcclusionGenerate,_shadersAmbientOcclusionModulate,_shadersAspectRampMaterial,_shadersAtmosphereCommon,_shadersAtmosphereStageFS,_shadersAtmosphereStageVS,_shadersBasicMaterialAppearanceFS,_shadersBasicMaterialAppearanceVS,_shadersBillboardCollectionFS,_shadersBillboardCollectionVS,_shadersBlackAndWhite,_shadersBloomComposite,_shadersBrdfLutGeneratorFS,_shadersBrightPass,_shadersBrightness,_shadersBufferPointMaterialFS,_shadersBufferPointMaterialVS,_shadersBufferPolygonMaterialFS,_shadersBufferPolygonMaterialVS,_shadersBufferPolylineMaterialFS,_shadersBufferPolylineMaterialVS,_shadersBumpMapMaterial,_shadersCPUStylingStageFS,_shadersCPUStylingStageVS,_shadersCheckerboardMaterial,_shadersCloudCollectionFS,_shadersCloudCollectionVS,_shadersCloudNoiseFS,_shadersCloudNoiseVS,_shadersCompareAndPackTranslucentDepth,_shadersCompositeOITFS,_shadersCompositeTranslucentClassification,_shadersComputeIrradianceFS,_shadersComputeRadianceMapFS,_shadersConstantLodStageFS,_shadersConstantLodStageVS,_shadersContrastBias,_shadersConvolveSpecularMapFS,_shadersConvolveSpecularMapVS,_shadersCubeMapPanoramaVS,_shadersCustomShaderStageFS,_shadersCustomShaderStageVS,_shadersCzmBuiltins,_shadersDepthOfField,_shadersDepthPlaneFS,_shadersDepthPlaneVS,_shadersDepthView,_shadersDepthViewPacked,_shadersDotMaterial,_shadersEdgeDetection,_shadersEdgeDetectionStageFS,_shadersEdgeVisibilityStageFS,_shadersEdgeVisibilityStageVS,_shadersElevationBandMaterial,_shadersElevationContourMaterial,_shadersElevationRampMaterial,_shadersEllipsoidFS,_shadersEllipsoidSurfaceAppearanceFS,_shadersEllipsoidSurfaceAppearanceVS,_shadersEllipsoidVS,_shadersFXAA,_shadersFXAA3_11,_shadersFadeMaterial,_shadersFeatureIdStageFS,_shadersFeatureIdStageVS,_shadersFilmicTonemapping,_shadersGaussianBlur1D,_shadersGeometryStageFS,_shadersGeometryStageVS,_shadersGlobeFS,_shadersGlobeVS,_shadersGridMaterial,_shadersGroundAtmosphere,_shadersHSBToRGB,_shadersHSLToRGB,_shadersImageBasedLightingStageFS,_shadersInstancingStageCommon,_shadersInstancingStageVS,_shadersIntersectBox,_shadersIntersectCylinder,_shadersIntersectDepth,_shadersIntersectEllipsoid,_shadersIntersectLongitude,_shadersIntersectPlane,_shadersIntersection,_shadersIntersectionUtils,_shadersLegacyInstancingStageVS,_shadersLensFlare,_shadersLightingStageFS,_shadersMaterialStageFS,_shadersMegatexture,_shadersMetadataStageFS,_shadersMetadataStageVS,_shadersModelClippingPlanesStageFS,_shadersModelClippingPolygonsStageFS,_shadersModelClippingPolygonsStageVS,_shadersModelColorStageFS,_shadersModelFS,_shadersModelSilhouetteStageFS,_shadersModelSilhouetteStageVS,_shadersModelSplitterStageFS,_shadersModelVS,_shadersModelVectorLookupStageFS,_shadersModelVectorLookupStageVS,_shadersModifiedReinhardTonemapping,_shadersMorphTargetsStageVS,_shadersNightVision,_shadersNormalMapMaterial,_shadersOctree,_shadersPassThrough,_shadersPassThroughDepth,_shadersPbrNeutralTonemapping,_shadersPerInstanceColorAppearanceFS,_shadersPerInstanceColorAppearanceVS,_shadersPerInstanceFlatColorAppearanceFS,_shadersPerInstanceFlatColorAppearanceVS,_shadersPointCloudEyeDomeLighting,_shadersPointCloudStylingStageVS,_shadersPointPrimitiveCollectionFS,_shadersPointPrimitiveCollectionVS,_shadersPolylineArrowMaterial,_shadersPolylineColorAppearanceVS,_shadersPolylineCommon,_shadersPolylineDashMaterial,_shadersPolylineFS,_shadersPolylineGlowMaterial,_shadersPolylineMaterialAppearanceVS,_shadersPolylineOutlineMaterial,_shadersPolylineShadowVolumeFS,_shadersPolylineShadowVolumeMorphFS,_shadersPolylineShadowVolumeMorphVS,_shadersPolylineShadowVolumeVS,_shadersPolylineVS,_shadersPrimitiveGaussianSplatFS,_shadersPrimitiveGaussianSplatVS,_shadersPrimitiveOutlineStageFS,_shadersPrimitiveOutlineStageVS,_shadersRGBToHSB,_shadersRGBToHSL,_shadersRGBToXYZ,_shadersReinhardTonemapping,_shadersReprojectWebMercatorFS,_shadersReprojectWebMercatorVS,_shadersRimLightingMaterial,_shadersSelectedFeatureIdStageCommon,_shadersShadowVolumeAppearanceFS,_shadersShadowVolumeAppearanceVS,_shadersShadowVolumeFS,_shadersSilhouette,_shadersSkinningStageVS,_shadersSkyAtmosphereCommon,_shadersSkyAtmosphereFS,_shadersSkyAtmosphereVS,_shadersSkyBoxFS,_shadersSkyBoxVS,_shadersSlopeRampMaterial,_shadersStripeMaterial,_shadersSunFS,_shadersSunTextureFS,_shadersSunVS,_shadersTexturedMaterialAppearanceFS,_shadersTexturedMaterialAppearanceVS,_shadersVector3DTileClampedPolylinesFS,_shadersVector3DTileClampedPolylinesVS,_shadersVector3DTilePolylinesVS,_shadersVectorCommon,_shadersVectorTileVS,_shadersVerticalExaggerationStageVS,_shadersViewportQuadFS,_shadersViewportQuadVS,_shadersVoxelFS,_shadersVoxelUtils,_shadersVoxelVS,_shadersWater,_shadersWaterMaskMaterial,_shadersXYZToRGB,_shadersacesTonemapping,_shadersalphaWeight,_shadersantialias,_shadersapplyHSBShift,_shadersapproximateSphericalCoordinates,_shadersapproximateTanh,_shadersbackFacing,_shadersbranchFreeTernary,_shaderscascadeColor,_shaderscascadeDistance,_shaderscascadeMatrix,_shaderscascadeWeights,_shaderscolumbusViewMorph,_shaderscomputeAtmosphereColor,_shaderscomputeGroundAtmosphereScattering,_shaderscomputePosition,_shaderscomputeScattering,_shaderscomputeTextureTransform,_shadersconvertLocalToBoxUv,_shadersconvertLocalToCylinderUv,_shadersconvertLocalToEllipsoidUv,_shaderscosineAndSine,_shadersdecodeRGB8,_shadersdecompressTextureCoordinates,_shadersdegreesPerRadian,_shadersdepthClamp,_shadersdepthRange,_shadersdepthRangeStruct,_shaderseastNorthUpToEyeCoordinates,_shadersellipsoidContainsPoint,_shadersellipsoidTextureCoordinates,_shadersepsilon1,_shadersepsilon2,_shadersepsilon3,_shadersepsilon4,_shadersepsilon5,_shadersepsilon6,_shadersepsilon7,_shadersequalsEpsilon,_shaderseyeOffset,_shaderseyeToCartographicDelta,_shaderseyeToWindowCoordinates,_shadersfastApproximateAtan,_shadersfog,_shadersgammaCorrect,_shadersgeodeticSurfaceNormal,_shadersgetDefaultMaterial,_shadersgetDynamicAtmosphereLightDirection,_shadersgetLambertDiffuse,_shadersgetSpecular,_shadersgetWaterNoise,_shadershue,_shadersinfinity,_shadersinverseGamma,_shadersisEmpty,_shadersisFull,_shaderslatitudeToWebMercatorFraction,_shaderslineDistance,_shaderslinearToSrgb,_shadersluminance,_shadersmaterial,_shadersmaterialInput,_shadersmaximumComponent,_shadersmetersPerPixel,_shadersmodelMaterial,_shadersmodelToWindowCoordinates,_shadersmodelVertexOutput,_shadersmultiplyWithColorBalance,_shadersnearFarScalar,_shadersoctDecode,_shadersoneOverPi,_shadersoneOverTwoPi,_shaderspackDepth,_shaderspassCesium3DTile,_shaderspassCesium3DTileClassification,_shaderspassCesium3DTileClassificationIgnoreShow,_shaderspassCesium3DTileEdges,_shaderspassCesium3DTileEdgesDirect,_shaderspassCesium3DTilePlanarFillId,_shaderspassClassification,_shaderspassCompute,_shaderspassEnvironment,_shaderspassGaussianSplats,_shaderspassGlobe,_shaderspassOpaque,_shaderspassOverlay,_shaderspassTerrainClassification,_shaderspassTranslucent,_shaderspassVoxels,_shaderspbrLighting,_shaderspbrNeutralTonemapping,_shadersphong,_shaderspi,_shaderspiOverFour,_shaderspiOverSix,_shaderspiOverThree,_shaderspiOverTwo,_shadersplaneDistance,_shaderspointAlongRay,_shadersradiansPerDegree,_shadersray,_shadersrayEllipsoidIntersectionInterval,_shadersraySegment,_shadersraySphereIntersectionInterval,_shadersreadDepth,_shadersreadNonPerspective,_shadersreverseLogDepth,_shadersround,_shaderssaturation,_shaderssceneMode2D,_shaderssceneMode3D,_shaderssceneModeColumbusView,_shaderssceneModeMorphing,_shadersshadowDepthCompare,_shadersshadowParameters,_shadersshadowVisibility,_shaderssignNotZero,_shaderssolarRadius,_shaderssphericalHarmonics,_shaderssrgbToLinear,_shaderstangentToEyeSpaceMatrix,_shaderstextureCube,_shadersthreePiOver2,_shaderstransformPlane,_shaderstranslateRelativeToEye,_shaderstranslucentPhong,_shaderstranspose,_shaderstwoPi,_shadersunpackDepth,_shadersunpackFloat,_shadersunpackTexture,_shadersunpackUint,_shadersvalueTransform,_shadersvertexLogDepth,_shaderswebMercatorMaxLatitude,_shaderswindowToEyeCoordinates,_shaderswriteDepthClamp,_shaderswriteLogDepth,_shaderswriteNonPerspective,addAllToArray,addBuffer,addDefaults,addExtensionsRequired,addExtensionsUsed,addPipelineExtras,addToArray,appendForwardSlash,arrayRemoveDuplicates,assert,barycentricCoordinates,binarySearch,buildModuleUrl,buildVectorGltfFromMVT,buildVoxelCustomShader,buildVoxelDrawCommands,clone,combine,computeFlyToLocationForRectangle,createBillboardPointCallback,createColorRamp,createCommand,createDefaultImageryProviderViewModels,createDefaultTerrainProviderViewModels,createElevationBandMaterial,createGooglePhotorealistic3DTileset,createGuid,createMaterialPropertyDescriptor,createOsmBuildingsAsync,createPropertyDescriptor,createRawPropertyDescriptor,createTangentSpaceDebugPrimitive,createTaskProcessorWorker,createUniform,createUniformArray,createVectorTileBuffersFromModelComponents,createWorldBathymetryAsync,createWorldImageryAsync,createWorldTerrainAsync,decodeGoogleEarthEnterpriseData,decodeMVT,decodeVectorPolylinePositions,defaultPickWorldPosition,defer,defined,demodernizeShader,deprecationWarning,destroyObject,exportKml,findAccessorMinMax,findContentMetadata,findGroupMetadata,findMeshoptExtension,findTileMetadata,forEachTextureInMaterial,formatError,freezeRenderState,getAbsoluteUri,getAccessorByteStride,getBaseUri,getBinaryAccessor,getClipAndStyleCode,getClippingFunction,getComponentReader,getElement,getExtensionFromUri,getFilenameFromUri,getImageFromTypedArray,getImagePixels,getJsonFromTypedArray,getMagic,getMeshPrimitives,getMetadataClassProperty,getMetadataProperty,getStringFromTypedArray,getTimestamp,hasExtension,heightReferenceOnEntityPropertyChanged,isBitSet,isBlobUri,isCrossOriginUrl,isDataUri,isLeapYear,knockout,knockout_3_5_1,knockout_es5,loadAndExecuteScript,loadCubeMap,loadImageFromTypedArray,loadKTX2,mergeSort,mostDetailedSurfaceHeight,moveTechniqueRenderStates,moveTechniquesToExtension,numberOfComponentsForType,objectToQuery,oneTimeWarning,parseBatchTable,parseFeatureMetadataLegacy,parseGlb,parseResponseHeaders,parseStructuralMetadata,pickModel,pointInsideTriangle,positionForSurfaceHeight,preprocess3DTileContent,processVoxelProperties,queryToObject,readAccessorPacked,removeExtension,removeExtensionsRequired,removeExtensionsUsed,removePipelineExtras,removeUnusedElements,renderBufferPointCollection,renderBufferPolygonCollection,renderBufferPolylineCollection,resizeImageToNextPowerOfTwo,sampleTerrain,sampleTerrainMostDetailed,scaleToGeodeticSurface,srgbToLinear,subdivideArray,subscribeAndEvaluate,updateAccessorComponentTypes,updateVersion,usesExtension,viewerCesium3DTilesInspectorMixin,viewerCesiumInspectorMixin,viewerDragDropMixin,viewerPerformanceWatchdogMixin,viewerVoxelInspectorMixin,webGLConstantToGlslType,wrapFunction,writeTextToCanvas}); +`);n.value=n.value.slice(0,i)+f+n.value.slice(r),n.selectionStart=i!==r?i:o,n.selectionEnd=o}else t.ctrlKey&&(t.keyCode===10||t.keyCode===13)&&this.compileShader();return!0};Mh.prototype.isDestroyed=function(){return!1};Mh.prototype.destroy=function(){let e=this;return this._definedProperties.forEach(function(t){ve.getObservable(e,t).dispose()}),le(this)};var dj=Mh;function vq(e,t){e=Ln(e);let n=document.createElement("div"),i=new dj(t);this._viewModel=i,this._container=e,this._element=n;let r=document.createElement("div");r.textContent="Voxel Inspector",r.className="cesium-cesiumInspector-button",r.setAttribute("data-bind","click: toggleInspector"),n.appendChild(r),n.className="cesium-cesiumInspector cesium-VoxelInspector",n.setAttribute("data-bind",'css: { "cesium-cesiumInspector-visible" : inspectorVisible, "cesium-cesiumInspector-hidden" : !inspectorVisible}'),e.appendChild(n);let o=document.createElement("div");o.className="cesium-cesiumInspector-dropDown",n.appendChild(o);let{createSection:s,createCheckbox:a,createRangeInput:c,createButton:u}=Af,f=s(o,"Display","displayVisible","toggleDisplay"),d=s(o,"Transform","transformVisible","toggleTransform"),p=s(o,"Clipping","clippingVisible","toggleClipping"),g=s(o,"Shader","shaderVisible","toggleShader");f.appendChild(a("Depth Test","depthTest")),f.appendChild(a("Show","show")),f.appendChild(a("Disable Update","disableUpdate")),f.appendChild(a("Debug Draw","debugDraw")),f.appendChild(a("Jitter","jitter")),f.appendChild(a("Nearest Sampling","nearestSampling")),f.appendChild(c("Screen Space Error","screenSpaceError",0,128)),f.appendChild(c("Step Size","stepSize",0,2));let m=10,y=10,A=D.PI;d.appendChild(c("Translation X","translationX",-m,+m)),d.appendChild(c("Translation Y","translationY",-m,+m)),d.appendChild(c("Translation Z","translationZ",-m,+m)),d.appendChild(c("Scale X","scaleX",0,+y)),d.appendChild(c("Scale Y","scaleY",0,+y)),d.appendChild(c("Scale Z","scaleZ",0,+y)),d.appendChild(c("Heading","angleX",-A,+A)),d.appendChild(c("Pitch","angleY",-A,+A)),d.appendChild(c("Roll","angleZ",-A,+A)),Qle("Max X","Min X","Max Y","Min Y","Max Z","Min Z","clippingBoxMaxX","clippingBoxMinX","clippingBoxMaxY","clippingBoxMinY","clippingBoxMaxZ","clippingBoxMinZ","shapeIsBox",p),Qle("Max Longitude","Min Longitude","Max Latitude","Min Latitude","Max Height","Min Height","clippingEllipsoidMaxLongitude","clippingEllipsoidMinLongitude","clippingEllipsoidMaxLatitude","clippingEllipsoidMinLatitude","clippingEllipsoidMaxHeight","clippingEllipsoidMinHeight","shapeIsEllipsoid",p),Qle("Max Radius","Min Radius","Max Angle","Min Angle","Max Height","Min Height","clippingCylinderMaxRadius","clippingCylinderMinRadius","clippingCylinderMaxAngle","clippingCylinderMinAngle","clippingCylinderMaxHeight","clippingCylinderMinHeight","shapeIsCylinder",p);let b=document.createElement("div");g.appendChild(b);let x=document.createElement("textarea");x.setAttribute("data-bind","textInput: shaderString, event: { keydown: shaderEditorKeyPress }"),b.className="cesium-cesiumInspector-styleEditor",b.appendChild(x);let T=u("Compile (Ctrl+Enter)","compileShader");b.appendChild(T);let E=document.createElement("label");E.style.display="block",E.setAttribute("data-bind","text: shaderCompilationMessage, style: {color: shaderCompilationSuccess ? 'green' : 'red'}"),b.appendChild(E),ve.applyBindings(i,n)}Object.defineProperties(vq.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}}});vq.prototype.isDestroyed=function(){return!1};vq.prototype.destroy=function(){return ve.cleanNode(this._element),this._container.removeChild(this._element),this.viewModel.destroy(),le(this)};function Qle(e,t,n,i,r,o,s,a,c,u,f,d,p,g){let m=Af.createRangeInputWithDynamicMinMax,y=g.appendChild(document.createElement("div"));y.setAttribute("data-bind",`if: ${p}`),y.appendChild(m(e,s)),y.appendChild(m(t,a)),y.appendChild(m(n,c)),y.appendChild(m(i,u)),y.appendChild(m(r,f)),y.appendChild(m(o,d))}var hj=vq;function I9t(e){let t=document.createElement("div");t.className="cesium-viewer-voxelInspectorContainer",e.container.appendChild(t);let n=new hj(t,e.scene);Object.defineProperties(e,{voxelInspector:{get:function(){return n}}})}var eue=I9t;globalThis.CESIUM_VERSION="1.145.0";var P9t="1.145.0";0&&(module.exports={AlphaMode,AlphaPipelineStage,AnchorPointDirect,AnchorPointIndirect,Animation,AnimationViewModel,Appearance,ApproximateTerrainHeights,ArcGISTiledElevationTerrainProvider,ArcGisBaseMapType,ArcGisMapServerImageryProvider,ArcGisMapService,ArcType,ArticulationStageType,AssociativeArray,Atmosphere,AtmospherePipelineStage,AttributeCompression,AttributeType,AutoExposure,AutomaticUniforms,Axis,AxisAlignedBoundingBox,Azure2DImageryProvider,B3dmLoader,B3dmParser,BaseLayerPicker,BaseLayerPickerViewModel,BatchTable,BatchTableHierarchy,BatchTexture,BatchTexturePipelineStage,Billboard,BillboardCollection,BillboardGraphics,BillboardLoadState,BillboardTexture,BillboardVisualizer,BingMapsGeocoderService,BingMapsImageryProvider,BingMapsStyle,BlendEquation,BlendFunction,BlendOption,BlendingState,BoundingRectangle,BoundingSphere,BoundingSphereState,BoundingVolumeSemantics,BoxEmitter,BoxGeometry,BoxGeometryUpdater,BoxGraphics,BoxOutlineGeometry,BrdfLutGenerator,Buffer,BufferLoader,BufferPoint,BufferPointCollection,BufferPointMaterial,BufferPolygon,BufferPolygonCollection,BufferPolygonMaterial,BufferPolyline,BufferPolylineCollection,BufferPolylineMaterial,BufferPrimitive,BufferPrimitiveCollection,BufferPrimitiveMaterial,BufferUsage,CPUStylingPipelineStage,CallbackPositionProperty,CallbackProperty,Camera,CameraEventAggregator,CameraEventType,CameraFlightPath,Cartesian2,Cartesian3,Cartesian4,CartesianRectangle,Cartographic,CartographicGeocoderService,CatmullRomSpline,Cesium3DContentGroup,Cesium3DTile,Cesium3DTileBatchTable,Cesium3DTileColorBlendMode,Cesium3DTileContent,Cesium3DTileContentFactory,Cesium3DTileContentState,Cesium3DTileContentType,Cesium3DTileFeature,Cesium3DTileFeatureTable,Cesium3DTileOptimizationHint,Cesium3DTileOptimizations,Cesium3DTilePass,Cesium3DTilePassState,Cesium3DTilePointFeature,Cesium3DTileRefine,Cesium3DTileStyle,Cesium3DTileStyleEngine,Cesium3DTileVectorFeature,Cesium3DTilesInspector,Cesium3DTilesInspectorViewModel,Cesium3DTilesTerrainData,Cesium3DTilesTerrainGeometryProcessor,Cesium3DTilesTerrainProvider,Cesium3DTilesVoxelProvider,Cesium3DTileset,Cesium3DTilesetBaseTraversal,Cesium3DTilesetCache,Cesium3DTilesetGraphics,Cesium3DTilesetHeatmap,Cesium3DTilesetMetadata,Cesium3DTilesetMostDetailedTraversal,Cesium3DTilesetSkipTraversal,Cesium3DTilesetStatistics,Cesium3DTilesetTraversal,Cesium3DTilesetVisualizer,CesiumInspector,CesiumInspectorViewModel,CesiumTerrainProvider,CesiumWidget,Check,CheckerboardMaterialProperty,CircleEmitter,CircleGeometry,CircleOutlineGeometry,ClassificationModelDrawCommand,ClassificationPipelineStage,ClassificationPrimitive,ClassificationType,ClearCommand,ClippingPlane,ClippingPlaneCollection,ClippingPolygon,ClippingPolygonCollection,Clock,ClockRange,ClockStep,ClockViewModel,CloudCollection,CloudType,Color,ColorBlendMode,ColorGeometryInstanceAttribute,ColorMaterialProperty,Command,ComponentDatatype,Composite3DTileContent,CompositeEntityCollection,CompositeMaterialProperty,CompositePositionProperty,CompositeProperty,CompressedTextureBuffer,ComputeCommand,ComputeEngine,ConditionsExpression,ConeEmitter,ConstantPositionProperty,ConstantProperty,ConstantSpline,ContentMetadata,Context,ContextLimits,Controller,ControllerHost,CoplanarPolygonGeometry,CoplanarPolygonGeometryLibrary,CoplanarPolygonOutlineGeometry,CornerType,CorrelationGroup,CorridorGeometry,CorridorGeometryLibrary,CorridorGeometryUpdater,CorridorGraphics,CorridorOutlineGeometry,Credit,CreditDisplay,CubeMap,CubeMapFace,CubeMapPanorama,CubicRealPolynomial,CullFace,CullingVolume,CumulusCloud,CustomDataSource,CustomHeightmapTerrainProvider,CustomShader,CustomShaderMode,CustomShaderPipelineStage,CustomShaderTranslucencyMode,CylinderGeometry,CylinderGeometryLibrary,CylinderGeometryUpdater,CylinderGraphics,CylinderOutlineGeometry,CzmlDataSource,DataSource,DataSourceClock,DataSourceCollection,DataSourceDisplay,DebugAppearance,DebugCameraPrimitive,DebugInspector,DebugModelMatrixPrimitive,DefaultProxy,DepthFunction,DepthPlane,DequantizationPipelineStage,DerivedCommand,DeveloperError,DeviceOrientationCameraController,DirectionalLight,DiscardEmptyTileImagePolicy,DiscardMissingTileImagePolicy,DistanceDisplayCondition,DistanceDisplayConditionGeometryInstanceAttribute,DoubleEndedPriorityQueue,DoublyLinkedList,DracoLoader,DrawCommand,DynamicAtmosphereLightingType,DynamicEnvironmentMapManager,DynamicGeometryBatch,DynamicGeometryUpdater,EarthOrientationParameters,EarthOrientationParametersSample,EasingFunction,EdgeDetectionPipelineStage,EdgeDisplayMode,EdgeFramebuffer,EdgeVisibilityPipelineStage,EllipseGeometry,EllipseGeometryLibrary,EllipseGeometryUpdater,EllipseGraphics,EllipseOutlineGeometry,Ellipsoid,EllipsoidGeodesic,EllipsoidGeometry,EllipsoidGeometryUpdater,EllipsoidGraphics,EllipsoidOutlineGeometry,EllipsoidPrimitive,EllipsoidRhumbLine,EllipsoidSurfaceAppearance,EllipsoidTangentPlane,EllipsoidTerrainProvider,EllipsoidalOccluder,Empty3DTileContent,EncodedCartesian3,Entity,EntityCluster,EntityCollection,EntityView,EquirectangularPanorama,Event,EventHelper,Expression,ExpressionNodeType,ExtrapolationType,FeatureDetection,FeatureIdPipelineStage,Fog,ForEach,FrameRateMonitor,FrameState,Framebuffer,FramebufferManager,Frozen,FrustumCommands,FrustumGeometry,FrustumOutlineGeometry,Fullscreen,FullscreenButton,FullscreenButtonViewModel,GaussianSplat3DTileContent,GaussianSplatPrimitive,GaussianSplatRenderResources,GaussianSplatSorter,GaussianSplatTextureGenerator,GeoJsonDataSource,GeoJsonLoader,GeoJsonPrimitive,GeocodeType,Geocoder,GeocoderService,GeocoderViewModel,GeographicProjection,GeographicTilingScheme,Geometry,Geometry3DTileContent,GeometryAttribute,GeometryAttributes,GeometryFactory,GeometryInstance,GeometryInstanceAttribute,GeometryOffsetAttribute,GeometryPipeline,GeometryPipelineStage,GeometryType,GeometryUpdater,GeometryUpdaterSet,GeometryVisualizer,GetFeatureInfoFormat,Globe,GlobeDepth,GlobeSurfaceShaderSet,GlobeSurfaceTile,GlobeSurfaceTileProvider,GlobeTranslucency,GlobeTranslucencyFramebuffer,GlobeTranslucencyState,GltfBufferViewLoader,GltfDracoLoader,GltfGpmLoader,GltfGpmLocal,GltfImageLoader,GltfIndexBufferLoader,GltfJsonLoader,GltfLoader,GltfLoaderUtil,GltfMeshPrimitiveGpmLoader,GltfSpzLoader,GltfStructuralMetadataLoader,GltfTextureLoader,GltfVertexBufferLoader,Google2DImageryProvider,GoogleEarthEnterpriseImageryProvider,GoogleEarthEnterpriseMapsProvider,GoogleEarthEnterpriseMetadata,GoogleEarthEnterpriseTerrainData,GoogleEarthEnterpriseTerrainProvider,GoogleEarthEnterpriseTileInformation,GoogleGeocoderService,GoogleMaps,GoogleStreetViewCubeMapPanoramaProvider,GpxDataSource,GregorianDate,GridImageryProvider,GridMaterialProperty,GroundGeometryUpdater,GroundPolylineGeometry,GroundPolylinePrimitive,GroundPrimitive,GroupMetadata,HeadingPitchRange,HeadingPitchRoll,Heap,HeightReference,HeightmapEncoding,HeightmapTerrainData,HeightmapTessellator,HermitePolynomialApproximation,HermiteSpline,HilbertOrder,HomeButton,HomeButtonViewModel,HorizontalOrigin,HybridScreenSpacePanCameraController,I3SBuildingSceneLayerExplorer,I3SBuildingSceneLayerExplorerViewModel,I3SDataProvider,I3SDecoder,I3SFeature,I3SField,I3SGeometry,I3SLayer,I3SNode,I3SStatistics,I3SSublayer,I3SSymbology,I3dmLoader,I3dmParser,ITwinData,ITwinPlatform,Iau2000Orientation,Iau2006XysData,Iau2006XysSample,IauOrientationAxes,IauOrientationParameters,ImageBasedLighting,ImageBasedLightingPipelineStage,ImageMaterialProperty,Imagery,ImageryConfiguration,ImageryCoverage,ImageryFlags,ImageryInput,ImageryLayer,ImageryLayerCollection,ImageryLayerFeatureInfo,ImageryPipelineStage,ImageryProvider,ImageryState,Implicit3DTileContent,ImplicitAvailabilityBitstream,ImplicitMetadataView,ImplicitSubdivisionScheme,ImplicitSubtree,ImplicitSubtreeCache,ImplicitSubtreeMetadata,ImplicitTileCoordinates,ImplicitTileset,IndexDatatype,InfoBox,InfoBoxViewModel,InspectorShared,InstanceAttributeSemantic,InstancingPipelineStage,InterpolationAlgorithm,InterpolationType,Intersect,IntersectionTests,Intersections2D,Interval,InvertClassification,Ion,IonGeocodeProviderType,IonGeocoderService,IonImageryProvider,IonImageryProviderFactory,IonResource,IonSnapGeometryType,IonSnapHeat,IonSnapMode,IonSnapParentGeometryType,IonSnapService,IonWorldImageryStyle,Iso8601,JobScheduler,JobType,JsonMetadataTable,JulianDate,KTX2Transcoder,KeyboardEventModifier,KeyframeNode,KmlCamera,KmlDataSource,KmlLookAt,KmlTour,KmlTourFlyTo,KmlTourWait,Label,LabelCollection,LabelGraphics,LabelStyle,LabelVisualizer,LagrangePolynomialApproximation,LeapSecond,Light,LightingModel,LightingPipelineStage,LinearApproximation,LinearSpline,MVTDataProvider,ManagedArray,MapMode2D,MapProjection,MapboxImageryProvider,MapboxStyleImageryProvider,MappedPositions,Material,MaterialAppearance,MaterialPipelineStage,MaterialProperty,Math,Matrix2,Matrix3,Matrix4,Megatexture,MeshPrimitiveGpmLocal,MetadataClass,MetadataClassProperty,MetadataComponentType,MetadataEntity,MetadataEnum,MetadataEnumValue,MetadataPicking,MetadataPickingPipelineStage,MetadataPipelineStage,MetadataSchema,MetadataSchemaLoader,MetadataSemantic,MetadataTable,MetadataTableProperty,MetadataType,MipmapHint,Model,Model3DTileContent,ModelAlphaOptions,ModelAnimation,ModelAnimationChannel,ModelAnimationCollection,ModelAnimationLoop,ModelAnimationState,ModelArticulation,ModelArticulationStage,ModelClippingPlanesPipelineStage,ModelClippingPolygonsPipelineStage,ModelColorPipelineStage,ModelComponents,ModelDrawCommand,ModelDrawCommands,ModelFeature,ModelFeatureTable,ModelGraphics,ModelImagery,ModelImageryMapping,ModelLightingOptions,ModelMatrixUpdateStage,ModelNode,ModelPrimitiveImagery,ModelReader,ModelRenderResources,ModelRuntimeNode,ModelRuntimePrimitive,ModelSceneGraph,ModelSilhouettePipelineStage,ModelSkin,ModelSplitterPipelineStage,ModelStatistics,ModelType,ModelUtility,ModelVectorLookupPipelineStage,ModelVisualizer,Moon,MorphTargetsPipelineStage,MorphWeightSpline,MortonOrder,MouseButton,Multiple3DTileContent,MultisampleFramebuffer,NavigationHelpButton,NavigationHelpButtonViewModel,NearFarScalar,NeverTileDiscardPolicy,NodeRenderResources,NodeStatisticsPipelineStage,NodeTransformationProperty,OIT,Occluder,OffsetGeometryInstanceAttribute,OpenCageGeocoderService,OpenStreetMapImageryProvider,OrderedGroundPrimitiveCollection,OrientedBoundingBox,OrthographicFrustum,OrthographicOffCenterFrustum,Packable,PackableForInterpolation,Panorama,PanoramaProvider,Particle,ParticleBurst,ParticleEmitter,ParticleSystem,Pass,PassState,PathGraphics,PathMode,PathVisualizer,PeliasGeocoderService,PerInstanceColorAppearance,PerformanceDisplay,PerformanceWatchdog,PerformanceWatchdogViewModel,PerspectiveFrustum,PerspectiveOffCenterFrustum,PickDepth,PickDepthFramebuffer,PickFramebuffer,PickId,PickedMetadataInfo,Picking,PickingPipelineStage,PinBuilder,PixelDatatype,PixelFormat,PlanarFillIdFramebuffer,Plane,PlaneGeometry,PlaneGeometryUpdater,PlaneGraphics,PlaneOutlineGeometry,PntsLoader,PntsParser,PointCloud,PointCloudEyeDomeLighting,PointCloudShading,PointCloudStylingPipelineStage,PointGraphics,PointPrimitive,PointPrimitiveCollection,PointVisualizer,PolygonGeometry,PolygonGeometryLibrary,PolygonGeometryUpdater,PolygonGraphics,PolygonHierarchy,PolygonOutlineGeometry,PolygonPipeline,Polyline,PolylineArrowMaterialProperty,PolylineCollection,PolylineColorAppearance,PolylineDashMaterialProperty,PolylineGeometry,PolylineGeometryUpdater,PolylineGlowMaterialProperty,PolylineGraphics,PolylineMaterialAppearance,PolylineOutlineMaterialProperty,PolylinePipeline,PolylineVisualizer,PolylineVolumeGeometry,PolylineVolumeGeometryLibrary,PolylineVolumeGeometryUpdater,PolylineVolumeGraphics,PolylineVolumeOutlineGeometry,PositionProperty,PositionPropertyArray,PostProcessStage,PostProcessStageCollection,PostProcessStageComposite,PostProcessStageLibrary,PostProcessStageSampleMode,PostProcessStageTextureCache,PpeMetadata,PpeSource,PpeTexture,Primitive,PrimitiveCollection,PrimitiveLoadPlan,PrimitiveOutlineGenerator,PrimitiveOutlinePipelineStage,PrimitivePipeline,PrimitiveRenderResources,PrimitiveState,PrimitiveStatisticsPipelineStage,PrimitiveType,ProjectionPicker,ProjectionPickerViewModel,Property,PropertyArray,PropertyAttribute,PropertyAttributeProperty,PropertyBag,PropertyTable,PropertyTexture,PropertyTextureProperty,ProviderViewModel,Proxy,QuadraticRealPolynomial,QuadtreeOccluders,QuadtreePrimitive,QuadtreeTile,QuadtreeTileLoadState,QuadtreeTileProvider,QuantizedMeshTerrainData,QuarticRealPolynomial,Quaternion,QuaternionSpline,Queue,Ray,Rectangle,RectangleCollisionChecker,RectangleGeometry,RectangleGeometryLibrary,RectangleGeometryUpdater,RectangleGraphics,RectangleOutlineGeometry,ReferenceFrame,ReferenceProperty,RenderState,Renderbuffer,RenderbufferFormat,Request,RequestErrorEvent,RequestScheduler,RequestState,RequestType,Resource,ResourceCache,ResourceCacheKey,ResourceCacheStatistics,ResourceLoader,ResourceLoaderState,Rotation,RuntimeError,S2Cell,SDFSettings,SampledPositionProperty,SampledProperty,Sampler,ScaledPositionProperty,Scene,SceneFramebuffer,SceneMode,SceneMode2DPipelineStage,SceneModePicker,SceneModePickerViewModel,SceneTransforms,SceneTransitioner,ScreenSpaceCameraController,ScreenSpaceElevatorCameraController,ScreenSpaceEventHandler,ScreenSpaceEventType,ScreenSpaceInputBindings,ScreenSpaceMapCameraController,ScreenSpaceTiltOrbitCameraController,ScreenSpaceZoomCameraController,SelectedFeatureIdPipelineStage,SelectionIndicator,SelectionIndicatorViewModel,SensorVolumePortionToDisplay,ShaderBuilder,ShaderCache,ShaderDestination,ShaderFunction,ShaderProgram,ShaderSource,ShaderStruct,ShadowMap,ShadowMapShader,ShadowMode,ShadowVolumeAppearance,SharedContext,ShowGeometryInstanceAttribute,Simon1994PlanetaryPositions,SimplePolylineGeometry,SingleTileImageryProvider,SkinningPipelineStage,SkyAtmosphere,SkyBox,SnapFramebuffer,SnapService,Snapping,SpatialNode,Spdcf,SpecularEnvironmentCubeMap,SphereEmitter,SphereGeometry,SphereOutlineGeometry,Spherical,Spline,SplitDirection,Splitter,StaticGeometryColorBatch,StaticGeometryPerMaterialBatch,StaticGroundGeometryColorBatch,StaticGroundGeometryPerMaterialBatch,StaticGroundPolylinePerMaterialBatch,StaticOutlineGeometryBatch,StencilConstants,StencilFunction,StencilOperation,SteppedSpline,Stereographic,StorageType,StripeMaterialProperty,StripeOrientation,StructuralMetadata,StyleCommandsNeeded,StyleExpression,Sun,SunLight,SunPostProcess,SupportedImageFormats,SvgPathBindingHandler,Sync,TaskProcessor,Terrain,TerrainData,TerrainEncoding,TerrainFillMesh,TerrainMesh,TerrainOffsetProperty,TerrainPicker,TerrainProvider,TerrainQuantization,TerrainState,Texture,Texture3D,TextureAtlas,TextureCache,TextureMagnificationFilter,TextureManager,TextureMinificationFilter,TexturePacker,TextureUniform,TextureWrap,TileAvailability,TileBoundingRegion,TileBoundingS2Cell,TileBoundingSphere,TileBoundingVolume,TileCoordinatesImageryProvider,TileDiscardPolicy,TileEdge,TileImagery,TileMapServiceImageryProvider,TileMetadata,TileOrientedBoundingBox,TileProviderError,TileReplacementQueue,TileSelectionResult,TileState,Tileset3DTileContent,TilesetMetadata,TilesetPipelineStage,TilingScheme,TimeConstants,TimeDynamicImagery,TimeDynamicPointCloud,TimeInterval,TimeIntervalCollection,TimeIntervalCollectionPositionProperty,TimeIntervalCollectionProperty,TimeStandard,Timeline,TimelineHighlightRange,TimelineTrack,Tipsify,ToggleButtonViewModel,Tonemapper,TrackingReferenceFrame,Transforms,TranslationRotationScale,TranslucentTileClassification,TridiagonalSystemSolver,TrustedServers,TweenCollection,UniformState,UniformType,UrlTemplate3DTilesDataProvider,UrlTemplateImageryProvider,VERSION,VRButton,VRButtonViewModel,VRTheWorldTerrainProvider,VaryingType,Vector3DTileBatch,Vector3DTileClampedPolylines,Vector3DTileContent,Vector3DTileGeometry,Vector3DTilePoints,Vector3DTilePolygons,Vector3DTilePolylines,Vector3DTilePrimitive,VectorGltf3DTileContent,VectorPipeline,VectorProvider,VelocityOrientationProperty,VelocityVectorProperty,VertexArray,VertexArrayFacade,VertexAttributeSemantic,VertexFormat,VerticalExaggeration,VerticalExaggerationPipelineStage,VerticalOrigin,VideoSynchronizer,View,Viewer,ViewportQuad,Visibility,Visualizer,VoxelBoundsCollection,VoxelBoxShape,VoxelCell,VoxelContent,VoxelCylinderShape,VoxelEllipsoidShape,VoxelInspector,VoxelInspectorViewModel,VoxelMetadataOrder,VoxelPrimitive,VoxelProvider,VoxelRenderResources,VoxelShape,VoxelShapeType,VoxelTraversal,VulkanConstants,WallGeometry,WallGeometryLibrary,WallGeometryUpdater,WallGraphics,WallOutlineGeometry,WebGLConstants,WebMapServiceImageryProvider,WebMapTileServiceImageryProvider,WebMercatorProjection,WebMercatorTilingScheme,WindingOrder,WireframeIndexGenerator,WireframePipelineStage,_shadersAcesTonemappingStage,_shadersAdditiveBlend,_shadersAdjustTranslucentFS,_shadersAllMaterialAppearanceFS,_shadersAllMaterialAppearanceVS,_shadersAmbientOcclusionGenerate,_shadersAmbientOcclusionModulate,_shadersAspectRampMaterial,_shadersAtmosphereCommon,_shadersAtmosphereStageFS,_shadersAtmosphereStageVS,_shadersBasicMaterialAppearanceFS,_shadersBasicMaterialAppearanceVS,_shadersBillboardCollectionFS,_shadersBillboardCollectionVS,_shadersBlackAndWhite,_shadersBloomComposite,_shadersBrdfLutGeneratorFS,_shadersBrightPass,_shadersBrightness,_shadersBufferPointMaterialFS,_shadersBufferPointMaterialVS,_shadersBufferPolygonMaterialFS,_shadersBufferPolygonMaterialVS,_shadersBufferPolylineMaterialFS,_shadersBufferPolylineMaterialVS,_shadersBumpMapMaterial,_shadersCPUStylingStageFS,_shadersCPUStylingStageVS,_shadersCheckerboardMaterial,_shadersCloudCollectionFS,_shadersCloudCollectionVS,_shadersCloudNoiseFS,_shadersCloudNoiseVS,_shadersCompareAndPackTranslucentDepth,_shadersCompositeOITFS,_shadersCompositeTranslucentClassification,_shadersComputeIrradianceFS,_shadersComputeRadianceMapFS,_shadersConstantLodStageFS,_shadersConstantLodStageVS,_shadersContrastBias,_shadersConvolveSpecularMapFS,_shadersConvolveSpecularMapVS,_shadersCubeMapPanoramaVS,_shadersCustomShaderStageFS,_shadersCustomShaderStageVS,_shadersCzmBuiltins,_shadersDepthOfField,_shadersDepthPlaneFS,_shadersDepthPlaneVS,_shadersDepthView,_shadersDepthViewPacked,_shadersDotMaterial,_shadersEdgeDetection,_shadersEdgeDetectionStageFS,_shadersEdgeVisibilityStageFS,_shadersEdgeVisibilityStageVS,_shadersElevationBandMaterial,_shadersElevationContourMaterial,_shadersElevationRampMaterial,_shadersEllipsoidFS,_shadersEllipsoidSurfaceAppearanceFS,_shadersEllipsoidSurfaceAppearanceVS,_shadersEllipsoidVS,_shadersFXAA,_shadersFXAA3_11,_shadersFadeMaterial,_shadersFeatureIdStageFS,_shadersFeatureIdStageVS,_shadersFilmicTonemapping,_shadersGaussianBlur1D,_shadersGeometryStageFS,_shadersGeometryStageVS,_shadersGlobeFS,_shadersGlobeVS,_shadersGridMaterial,_shadersGroundAtmosphere,_shadersHSBToRGB,_shadersHSLToRGB,_shadersImageBasedLightingStageFS,_shadersInstancingStageCommon,_shadersInstancingStageVS,_shadersIntersectBox,_shadersIntersectCylinder,_shadersIntersectDepth,_shadersIntersectEllipsoid,_shadersIntersectLongitude,_shadersIntersectPlane,_shadersIntersection,_shadersIntersectionUtils,_shadersLegacyInstancingStageVS,_shadersLensFlare,_shadersLightingStageFS,_shadersMaterialStageFS,_shadersMegatexture,_shadersMetadataStageFS,_shadersMetadataStageVS,_shadersModelClippingPlanesStageFS,_shadersModelClippingPolygonsStageFS,_shadersModelClippingPolygonsStageVS,_shadersModelColorStageFS,_shadersModelFS,_shadersModelSilhouetteStageFS,_shadersModelSilhouetteStageVS,_shadersModelSplitterStageFS,_shadersModelVS,_shadersModelVectorLookupStageFS,_shadersModelVectorLookupStageVS,_shadersModifiedReinhardTonemapping,_shadersMorphTargetsStageVS,_shadersNightVision,_shadersNormalMapMaterial,_shadersOctree,_shadersPassThrough,_shadersPassThroughDepth,_shadersPbrNeutralTonemapping,_shadersPerInstanceColorAppearanceFS,_shadersPerInstanceColorAppearanceVS,_shadersPerInstanceFlatColorAppearanceFS,_shadersPerInstanceFlatColorAppearanceVS,_shadersPointCloudEyeDomeLighting,_shadersPointCloudStylingStageVS,_shadersPointPrimitiveCollectionFS,_shadersPointPrimitiveCollectionVS,_shadersPolylineArrowMaterial,_shadersPolylineColorAppearanceVS,_shadersPolylineCommon,_shadersPolylineDashMaterial,_shadersPolylineFS,_shadersPolylineGlowMaterial,_shadersPolylineMaterialAppearanceVS,_shadersPolylineOutlineMaterial,_shadersPolylineShadowVolumeFS,_shadersPolylineShadowVolumeMorphFS,_shadersPolylineShadowVolumeMorphVS,_shadersPolylineShadowVolumeVS,_shadersPolylineVS,_shadersPrimitiveGaussianSplatFS,_shadersPrimitiveGaussianSplatVS,_shadersPrimitiveOutlineStageFS,_shadersPrimitiveOutlineStageVS,_shadersRGBToHSB,_shadersRGBToHSL,_shadersRGBToXYZ,_shadersReinhardTonemapping,_shadersReprojectWebMercatorFS,_shadersReprojectWebMercatorVS,_shadersRimLightingMaterial,_shadersSelectedFeatureIdStageCommon,_shadersShadowVolumeAppearanceFS,_shadersShadowVolumeAppearanceVS,_shadersShadowVolumeFS,_shadersSilhouette,_shadersSkinningStageVS,_shadersSkyAtmosphereCommon,_shadersSkyAtmosphereFS,_shadersSkyAtmosphereVS,_shadersSkyBoxFS,_shadersSkyBoxVS,_shadersSlopeRampMaterial,_shadersStripeMaterial,_shadersSunFS,_shadersSunTextureFS,_shadersSunVS,_shadersTexturedMaterialAppearanceFS,_shadersTexturedMaterialAppearanceVS,_shadersVector3DTileClampedPolylinesFS,_shadersVector3DTileClampedPolylinesVS,_shadersVector3DTilePolylinesVS,_shadersVectorCommon,_shadersVectorTileVS,_shadersVerticalExaggerationStageVS,_shadersViewportQuadFS,_shadersViewportQuadVS,_shadersVoxelFS,_shadersVoxelUtils,_shadersVoxelVS,_shadersWater,_shadersWaterMaskMaterial,_shadersXYZToRGB,_shadersacesTonemapping,_shadersalphaWeight,_shadersantialias,_shadersapplyHSBShift,_shadersapproximateSphericalCoordinates,_shadersapproximateTanh,_shadersbackFacing,_shadersbranchFreeTernary,_shaderscascadeColor,_shaderscascadeDistance,_shaderscascadeMatrix,_shaderscascadeWeights,_shaderscolumbusViewMorph,_shaderscomputeAtmosphereColor,_shaderscomputeGroundAtmosphereScattering,_shaderscomputePosition,_shaderscomputeScattering,_shaderscomputeTextureTransform,_shadersconvertLocalToBoxUv,_shadersconvertLocalToCylinderUv,_shadersconvertLocalToEllipsoidUv,_shaderscosineAndSine,_shadersdecodeRGB8,_shadersdecompressTextureCoordinates,_shadersdegreesPerRadian,_shadersdepthClamp,_shadersdepthRange,_shadersdepthRangeStruct,_shaderseastNorthUpToEyeCoordinates,_shadersellipsoidContainsPoint,_shadersellipsoidTextureCoordinates,_shadersepsilon1,_shadersepsilon2,_shadersepsilon3,_shadersepsilon4,_shadersepsilon5,_shadersepsilon6,_shadersepsilon7,_shadersequalsEpsilon,_shaderseyeOffset,_shaderseyeToCartographicDelta,_shaderseyeToWindowCoordinates,_shadersfastApproximateAtan,_shadersfog,_shadersgammaCorrect,_shadersgeodeticSurfaceNormal,_shadersgetDefaultMaterial,_shadersgetDynamicAtmosphereLightDirection,_shadersgetLambertDiffuse,_shadersgetSpecular,_shadersgetWaterNoise,_shadershue,_shadersinfinity,_shadersinverseGamma,_shadersisEmpty,_shadersisFull,_shaderslatitudeToWebMercatorFraction,_shaderslineDistance,_shaderslinearToSrgb,_shadersluminance,_shadersmaterial,_shadersmaterialInput,_shadersmaximumComponent,_shadersmetersPerPixel,_shadersmodelMaterial,_shadersmodelToWindowCoordinates,_shadersmodelVertexOutput,_shadersmultiplyWithColorBalance,_shadersnearFarScalar,_shadersoctDecode,_shadersoneOverPi,_shadersoneOverTwoPi,_shaderspackDepth,_shaderspassCesium3DTile,_shaderspassCesium3DTileClassification,_shaderspassCesium3DTileClassificationIgnoreShow,_shaderspassCesium3DTileEdges,_shaderspassCesium3DTileEdgesDirect,_shaderspassCesium3DTilePlanarFillId,_shaderspassClassification,_shaderspassCompute,_shaderspassEnvironment,_shaderspassGaussianSplats,_shaderspassGlobe,_shaderspassOpaque,_shaderspassOverlay,_shaderspassTerrainClassification,_shaderspassTranslucent,_shaderspassVoxels,_shaderspbrLighting,_shaderspbrNeutralTonemapping,_shadersphong,_shaderspi,_shaderspiOverFour,_shaderspiOverSix,_shaderspiOverThree,_shaderspiOverTwo,_shadersplaneDistance,_shaderspointAlongRay,_shadersradiansPerDegree,_shadersray,_shadersrayEllipsoidIntersectionInterval,_shadersraySegment,_shadersraySphereIntersectionInterval,_shadersreadDepth,_shadersreadNonPerspective,_shadersreverseLogDepth,_shadersround,_shaderssaturation,_shaderssceneMode2D,_shaderssceneMode3D,_shaderssceneModeColumbusView,_shaderssceneModeMorphing,_shadersshadowDepthCompare,_shadersshadowParameters,_shadersshadowVisibility,_shaderssignNotZero,_shaderssolarRadius,_shaderssphericalHarmonics,_shaderssrgbToLinear,_shaderstangentToEyeSpaceMatrix,_shaderstextureCube,_shadersthreePiOver2,_shaderstransformPlane,_shaderstranslateRelativeToEye,_shaderstranslucentPhong,_shaderstranspose,_shaderstwoPi,_shadersunpackDepth,_shadersunpackFloat,_shadersunpackTexture,_shadersunpackUint,_shadersvalueTransform,_shadersvertexLogDepth,_shaderswebMercatorMaxLatitude,_shaderswindowToEyeCoordinates,_shaderswriteDepthClamp,_shaderswriteLogDepth,_shaderswriteNonPerspective,addAllToArray,addBuffer,addDefaults,addExtensionsRequired,addExtensionsUsed,addPipelineExtras,addToArray,appendForwardSlash,arrayRemoveDuplicates,assert,barycentricCoordinates,binarySearch,buildModuleUrl,buildVectorGltfFromMVT,buildVoxelCustomShader,buildVoxelDrawCommands,clone,combine,computeFlyToLocationForRectangle,createBillboardPointCallback,createColorRamp,createCommand,createDefaultImageryProviderViewModels,createDefaultTerrainProviderViewModels,createElevationBandMaterial,createGooglePhotorealistic3DTileset,createGuid,createMaterialPropertyDescriptor,createOsmBuildingsAsync,createPropertyDescriptor,createRawPropertyDescriptor,createTangentSpaceDebugPrimitive,createTaskProcessorWorker,createUniform,createUniformArray,createVectorTileBuffersFromModelComponents,createWorldBathymetryAsync,createWorldImageryAsync,createWorldTerrainAsync,decodeGoogleEarthEnterpriseData,decodeMVT,decodeVectorPolylinePositions,defaultPickWorldPosition,defer,defined,demodernizeShader,deprecationWarning,destroyObject,exportKml,findAccessorMinMax,findContentMetadata,findGroupMetadata,findMeshoptExtension,findTileMetadata,forEachTextureInMaterial,formatError,freezeRenderState,getAbsoluteUri,getAccessorByteStride,getBaseUri,getBinaryAccessor,getClipAndStyleCode,getClippingFunction,getComponentReader,getElement,getExtensionFromUri,getFilenameFromUri,getImageFromTypedArray,getImagePixels,getJsonFromTypedArray,getMagic,getMeshPrimitives,getMetadataClassProperty,getMetadataProperty,getStringFromTypedArray,getTimestamp,hasExtension,heightReferenceOnEntityPropertyChanged,isBitSet,isBlobUri,isCrossOriginUrl,isDataUri,isLeapYear,knockout,knockout_3_5_1,knockout_es5,loadAndExecuteScript,loadCubeMap,loadImageFromTypedArray,loadKTX2,mergeSort,mostDetailedSurfaceHeight,moveTechniqueRenderStates,moveTechniquesToExtension,numberOfComponentsForType,objectToQuery,oneTimeWarning,parseBatchTable,parseFeatureMetadataLegacy,parseGlb,parseResponseHeaders,parseStructuralMetadata,pickModel,pointInsideTriangle,positionForSurfaceHeight,preprocess3DTileContent,processVoxelProperties,queryToObject,readAccessorPacked,removeExtension,removeExtensionsRequired,removeExtensionsUsed,removePipelineExtras,removeUnusedElements,renderBufferPointCollection,renderBufferPolygonCollection,renderBufferPolylineCollection,resizeImageToNextPowerOfTwo,sampleTerrain,sampleTerrainMostDetailed,scaleToGeodeticSurface,srgbToLinear,subdivideArray,subscribeAndEvaluate,updateAccessorComponentTypes,updateVersion,usesExtension,viewerCesium3DTilesInspectorMixin,viewerCesiumInspectorMixin,viewerDragDropMixin,viewerPerformanceWatchdogMixin,viewerVoxelInspectorMixin,webGLConstantToGlslType,wrapFunction,writeTextToCanvas}); //# sourceMappingURL=index.cjs.map diff --git a/plugins/feature/map/Cesium/index.js b/plugins/feature/map/Cesium/index.js index 76fc64df7..d998f3d17 100644 --- a/plugins/feature/map/Cesium/index.js +++ b/plugins/feature/map/Cesium/index.js @@ -23,7 +23,7 @@ * See https://github.com/CesiumGS/cesium/blob/main/LICENSE.md for full licensing details. */ -var Mke=Object.create;var nN=Object.defineProperty;var Nke=Object.getOwnPropertyDescriptor;var Lke=Object.getOwnPropertyNames;var Fke=Object.getPrototypeOf,Bke=Object.prototype.hasOwnProperty;var kke=(e,t,n)=>t in e?nN(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var iN=(e=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(e,{get:(t,n)=>(typeof require<"u"?require:t)[n]}):e)(function(e){if(typeof require<"u")return require.apply(this,arguments);throw Error('Dynamic require of "'+e+'" is not supported')});var Cs=(e,t,n)=>()=>{if(n)throw n[0];try{return e&&(t=e(e=0)),t}catch(i){throw n=[i],i}};var uh=(e,t)=>()=>{try{return t||e((t={exports:{}}).exports,t),t.exports}catch(n){throw t=0,n}},Uke=(e,t)=>{for(var n in t)nN(e,n,{get:t[n],enumerable:!0})},zke=(e,t,n,i)=>{if(t&&typeof t=="object"||typeof t=="function")for(let r of Lke(t))!Bke.call(e,r)&&r!==n&&nN(e,r,{get:()=>t[r],enumerable:!(i=Nke(t,r))||i.enumerable});return e};var js=(e,t,n)=>(n=e!=null?Mke(Fke(e)):{},zke(t||!e||!e.__esModule?nN(n,"default",{value:e,enumerable:!0}):n,e));var ut=(e,t,n)=>kke(e,typeof t!="symbol"?t+"":t,n);var rN=uh((vGt,Gae)=>{var P0=function(e){e==null&&(e=new Date().getTime()),this.N=624,this.M=397,this.MATRIX_A=2567483615,this.UPPER_MASK=2147483648,this.LOWER_MASK=2147483647,this.mt=new Array(this.N),this.mti=this.N+1,e.constructor==Array?this.init_by_array(e,e.length):this.init_seed(e)};P0.prototype.init_seed=function(e){for(this.mt[0]=e>>>0,this.mti=1;this.mti<this.N;this.mti++){var e=this.mt[this.mti-1]^this.mt[this.mti-1]>>>30;this.mt[this.mti]=(((e&4294901760)>>>16)*1812433253<<16)+(e&65535)*1812433253+this.mti,this.mt[this.mti]>>>=0}};P0.prototype.init_by_array=function(e,t){var n,i,r;for(this.init_seed(19650218),n=1,i=0,r=this.N>t?this.N:t;r;r--){var o=this.mt[n-1]^this.mt[n-1]>>>30;this.mt[n]=(this.mt[n]^(((o&4294901760)>>>16)*1664525<<16)+(o&65535)*1664525)+e[i]+i,this.mt[n]>>>=0,n++,i++,n>=this.N&&(this.mt[0]=this.mt[this.N-1],n=1),i>=t&&(i=0)}for(r=this.N-1;r;r--){var o=this.mt[n-1]^this.mt[n-1]>>>30;this.mt[n]=(this.mt[n]^(((o&4294901760)>>>16)*1566083941<<16)+(o&65535)*1566083941)-n,this.mt[n]>>>=0,n++,n>=this.N&&(this.mt[0]=this.mt[this.N-1],n=1)}this.mt[0]=2147483648};P0.prototype.random_int=function(){var e,t=new Array(0,this.MATRIX_A);if(this.mti>=this.N){var n;for(this.mti==this.N+1&&this.init_seed(5489),n=0;n<this.N-this.M;n++)e=this.mt[n]&this.UPPER_MASK|this.mt[n+1]&this.LOWER_MASK,this.mt[n]=this.mt[n+this.M]^e>>>1^t[e&1];for(;n<this.N-1;n++)e=this.mt[n]&this.UPPER_MASK|this.mt[n+1]&this.LOWER_MASK,this.mt[n]=this.mt[n+(this.M-this.N)]^e>>>1^t[e&1];e=this.mt[this.N-1]&this.UPPER_MASK|this.mt[0]&this.LOWER_MASK,this.mt[this.N-1]=this.mt[this.M-1]^e>>>1^t[e&1],this.mti=0}return e=this.mt[this.mti++],e^=e>>>11,e^=e<<7&2636928640,e^=e<<15&4022730752,e^=e>>>18,e>>>0};P0.prototype.random_int31=function(){return this.random_int()>>>1};P0.prototype.random_incl=function(){return this.random_int()*(1/4294967295)};P0.prototype.random=function(){return this.random_int()*(1/4294967296)};P0.prototype.random_excl=function(){return(this.random_int()+.5)*(1/4294967296)};P0.prototype.random_long=function(){var e=this.random_int()>>>5,t=this.random_int()>>>6;return(e*67108864+t)*(1/9007199254740992)};Gae.exports=P0});var Ece=uh((EE,CE)=>{/*! https://mths.be/punycode v1.4.0 by @mathias */(function(e){var t=typeof EE=="object"&&EE&&!EE.nodeType&&EE,n=typeof CE=="object"&&CE&&!CE.nodeType&&CE,i=typeof global=="object"&&global;(i.global===i||i.window===i||i.self===i)&&(e=i);var r,o=2147483647,s=36,a=1,c=26,u=38,f=700,d=72,p=128,g="-",m=/^xn--/,y=/[^\x20-\x7E]/,A=/[\x2E\u3002\uFF0E\uFF61]/g,b={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},x=s-a,T=Math.floor,E=String.fromCharCode,v;function S(B){throw new RangeError(b[B])}function I(B,j){for(var k=B.length,G=[];k--;)G[k]=j(B[k]);return G}function R(B,j){var k=B.split("@"),G="";k.length>1&&(G=k[0]+"@",B=k[1]),B=B.replace(A,".");var q=B.split("."),Q=I(q,j).join(".");return G+Q}function O(B){for(var j=[],k=0,G=B.length,q,Q;k<G;)q=B.charCodeAt(k++),q>=55296&&q<=56319&&k<G?(Q=B.charCodeAt(k++),(Q&64512)==56320?j.push(((q&1023)<<10)+(Q&1023)+65536):(j.push(q),k--)):j.push(q);return j}function L(B){return I(B,function(j){var k="";return j>65535&&(j-=65536,k+=E(j>>>10&1023|55296),j=56320|j&1023),k+=E(j),k}).join("")}function _(B){return B-48<10?B-22:B-65<26?B-65:B-97<26?B-97:s}function C(B,j){return B+22+75*(B<26)-((j!=0)<<5)}function w(B,j,k){var G=0;for(B=k?T(B/f):B>>1,B+=T(B/j);B>x*c>>1;G+=s)B=T(B/x);return T(G+(x+1)*B/(B+u))}function D(B){var j=[],k=B.length,G,q=0,Q=p,W=d,J,Z,ae,Ae,fe,xe,ge,we,ve;for(J=B.lastIndexOf(g),J<0&&(J=0),Z=0;Z<J;++Z)B.charCodeAt(Z)>=128&&S("not-basic"),j.push(B.charCodeAt(Z));for(ae=J>0?J+1:0;ae<k;){for(Ae=q,fe=1,xe=s;ae>=k&&S("invalid-input"),ge=_(B.charCodeAt(ae++)),(ge>=s||ge>T((o-q)/fe))&&S("overflow"),q+=ge*fe,we=xe<=W?a:xe>=W+c?c:xe-W,!(ge<we);xe+=s)ve=s-we,fe>T(o/ve)&&S("overflow"),fe*=ve;G=j.length+1,W=w(q-Ae,G,Ae==0),T(q/G)>o-Q&&S("overflow"),Q+=T(q/G),q%=G,j.splice(q++,0,Q)}return L(j)}function N(B){var j,k,G,q,Q,W,J,Z,ae,Ae,fe,xe=[],ge,we,ve,Re;for(B=O(B),ge=B.length,j=p,k=0,Q=d,W=0;W<ge;++W)fe=B[W],fe<128&&xe.push(E(fe));for(G=q=xe.length,q&&xe.push(g);G<ge;){for(J=o,W=0;W<ge;++W)fe=B[W],fe>=j&&fe<J&&(J=fe);for(we=G+1,J-j>T((o-k)/we)&&S("overflow"),k+=(J-j)*we,j=J,W=0;W<ge;++W)if(fe=B[W],fe<j&&++k>o&&S("overflow"),fe==j){for(Z=k,ae=s;Ae=ae<=Q?a:ae>=Q+c?c:ae-Q,!(Z<Ae);ae+=s)Re=Z-Ae,ve=s-Ae,xe.push(E(C(Ae+Re%ve,0))),Z=T(Re/ve);xe.push(E(C(Z,0))),Q=w(k,we,G==q),k=0,++G}++k,++j}return xe.join("")}function F(B){return R(B,function(j){return m.test(j)?D(j.slice(4).toLowerCase()):j})}function V(B){return R(B,function(j){return y.test(j)?"xn--"+N(j):j})}if(r={version:"1.3.2",ucs2:{decode:O,encode:L},decode:D,encode:N,toASCII:V,toUnicode:F},typeof define=="function"&&typeof define.amd=="object"&&define.amd)define("punycode",function(){return r});else if(t&&n)if(CE.exports==t)n.exports=r;else for(v in r)r.hasOwnProperty(v)&&(t[v]=r[v]);else e.punycode=r})(EE)});var vce=uh((Cce,CN)=>{/*! +var Nke=Object.create;var nN=Object.defineProperty;var Lke=Object.getOwnPropertyDescriptor;var Fke=Object.getOwnPropertyNames;var Bke=Object.getPrototypeOf,kke=Object.prototype.hasOwnProperty;var Uke=(e,t,n)=>t in e?nN(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var iN=(e=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(e,{get:(t,n)=>(typeof require<"u"?require:t)[n]}):e)(function(e){if(typeof require<"u")return require.apply(this,arguments);throw Error('Dynamic require of "'+e+'" is not supported')});var Cs=(e,t,n)=>()=>{if(n)throw n[0];try{return e&&(t=e(e=0)),t}catch(i){throw n=[i],i}};var uh=(e,t)=>()=>{try{return t||e((t={exports:{}}).exports,t),t.exports}catch(n){throw t=0,n}},zke=(e,t)=>{for(var n in t)nN(e,n,{get:t[n],enumerable:!0})},Vke=(e,t,n,i)=>{if(t&&typeof t=="object"||typeof t=="function")for(let r of Fke(t))!kke.call(e,r)&&r!==n&&nN(e,r,{get:()=>t[r],enumerable:!(i=Lke(t,r))||i.enumerable});return e};var js=(e,t,n)=>(n=e!=null?Nke(Bke(e)):{},Vke(t||!e||!e.__esModule?nN(n,"default",{value:e,enumerable:!0}):n,e));var ut=(e,t,n)=>Uke(e,typeof t!="symbol"?t+"":t,n);var rN=uh((SGt,Gae)=>{var P0=function(e){e==null&&(e=new Date().getTime()),this.N=624,this.M=397,this.MATRIX_A=2567483615,this.UPPER_MASK=2147483648,this.LOWER_MASK=2147483647,this.mt=new Array(this.N),this.mti=this.N+1,e.constructor==Array?this.init_by_array(e,e.length):this.init_seed(e)};P0.prototype.init_seed=function(e){for(this.mt[0]=e>>>0,this.mti=1;this.mti<this.N;this.mti++){var e=this.mt[this.mti-1]^this.mt[this.mti-1]>>>30;this.mt[this.mti]=(((e&4294901760)>>>16)*1812433253<<16)+(e&65535)*1812433253+this.mti,this.mt[this.mti]>>>=0}};P0.prototype.init_by_array=function(e,t){var n,i,r;for(this.init_seed(19650218),n=1,i=0,r=this.N>t?this.N:t;r;r--){var o=this.mt[n-1]^this.mt[n-1]>>>30;this.mt[n]=(this.mt[n]^(((o&4294901760)>>>16)*1664525<<16)+(o&65535)*1664525)+e[i]+i,this.mt[n]>>>=0,n++,i++,n>=this.N&&(this.mt[0]=this.mt[this.N-1],n=1),i>=t&&(i=0)}for(r=this.N-1;r;r--){var o=this.mt[n-1]^this.mt[n-1]>>>30;this.mt[n]=(this.mt[n]^(((o&4294901760)>>>16)*1566083941<<16)+(o&65535)*1566083941)-n,this.mt[n]>>>=0,n++,n>=this.N&&(this.mt[0]=this.mt[this.N-1],n=1)}this.mt[0]=2147483648};P0.prototype.random_int=function(){var e,t=new Array(0,this.MATRIX_A);if(this.mti>=this.N){var n;for(this.mti==this.N+1&&this.init_seed(5489),n=0;n<this.N-this.M;n++)e=this.mt[n]&this.UPPER_MASK|this.mt[n+1]&this.LOWER_MASK,this.mt[n]=this.mt[n+this.M]^e>>>1^t[e&1];for(;n<this.N-1;n++)e=this.mt[n]&this.UPPER_MASK|this.mt[n+1]&this.LOWER_MASK,this.mt[n]=this.mt[n+(this.M-this.N)]^e>>>1^t[e&1];e=this.mt[this.N-1]&this.UPPER_MASK|this.mt[0]&this.LOWER_MASK,this.mt[this.N-1]=this.mt[this.M-1]^e>>>1^t[e&1],this.mti=0}return e=this.mt[this.mti++],e^=e>>>11,e^=e<<7&2636928640,e^=e<<15&4022730752,e^=e>>>18,e>>>0};P0.prototype.random_int31=function(){return this.random_int()>>>1};P0.prototype.random_incl=function(){return this.random_int()*(1/4294967295)};P0.prototype.random=function(){return this.random_int()*(1/4294967296)};P0.prototype.random_excl=function(){return(this.random_int()+.5)*(1/4294967296)};P0.prototype.random_long=function(){var e=this.random_int()>>>5,t=this.random_int()>>>6;return(e*67108864+t)*(1/9007199254740992)};Gae.exports=P0});var Ece=uh((EE,CE)=>{/*! https://mths.be/punycode v1.4.0 by @mathias */(function(e){var t=typeof EE=="object"&&EE&&!EE.nodeType&&EE,n=typeof CE=="object"&&CE&&!CE.nodeType&&CE,i=typeof global=="object"&&global;(i.global===i||i.window===i||i.self===i)&&(e=i);var r,o=2147483647,s=36,a=1,c=26,u=38,f=700,d=72,p=128,g="-",m=/^xn--/,y=/[^\x20-\x7E]/,A=/[\x2E\u3002\uFF0E\uFF61]/g,b={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},x=s-a,T=Math.floor,E=String.fromCharCode,v;function S(B){throw new RangeError(b[B])}function I(B,j){for(var k=B.length,G=[];k--;)G[k]=j(B[k]);return G}function R(B,j){var k=B.split("@"),G="";k.length>1&&(G=k[0]+"@",B=k[1]),B=B.replace(A,".");var q=B.split("."),Q=I(q,j).join(".");return G+Q}function O(B){for(var j=[],k=0,G=B.length,q,Q;k<G;)q=B.charCodeAt(k++),q>=55296&&q<=56319&&k<G?(Q=B.charCodeAt(k++),(Q&64512)==56320?j.push(((q&1023)<<10)+(Q&1023)+65536):(j.push(q),k--)):j.push(q);return j}function L(B){return I(B,function(j){var k="";return j>65535&&(j-=65536,k+=E(j>>>10&1023|55296),j=56320|j&1023),k+=E(j),k}).join("")}function _(B){return B-48<10?B-22:B-65<26?B-65:B-97<26?B-97:s}function C(B,j){return B+22+75*(B<26)-((j!=0)<<5)}function w(B,j,k){var G=0;for(B=k?T(B/f):B>>1,B+=T(B/j);B>x*c>>1;G+=s)B=T(B/x);return T(G+(x+1)*B/(B+u))}function D(B){var j=[],k=B.length,G,q=0,Q=p,W=d,J,Z,ae,Ae,fe,xe,ge,we,ve;for(J=B.lastIndexOf(g),J<0&&(J=0),Z=0;Z<J;++Z)B.charCodeAt(Z)>=128&&S("not-basic"),j.push(B.charCodeAt(Z));for(ae=J>0?J+1:0;ae<k;){for(Ae=q,fe=1,xe=s;ae>=k&&S("invalid-input"),ge=_(B.charCodeAt(ae++)),(ge>=s||ge>T((o-q)/fe))&&S("overflow"),q+=ge*fe,we=xe<=W?a:xe>=W+c?c:xe-W,!(ge<we);xe+=s)ve=s-we,fe>T(o/ve)&&S("overflow"),fe*=ve;G=j.length+1,W=w(q-Ae,G,Ae==0),T(q/G)>o-Q&&S("overflow"),Q+=T(q/G),q%=G,j.splice(q++,0,Q)}return L(j)}function N(B){var j,k,G,q,Q,W,J,Z,ae,Ae,fe,xe=[],ge,we,ve,Re;for(B=O(B),ge=B.length,j=p,k=0,Q=d,W=0;W<ge;++W)fe=B[W],fe<128&&xe.push(E(fe));for(G=q=xe.length,q&&xe.push(g);G<ge;){for(J=o,W=0;W<ge;++W)fe=B[W],fe>=j&&fe<J&&(J=fe);for(we=G+1,J-j>T((o-k)/we)&&S("overflow"),k+=(J-j)*we,j=J,W=0;W<ge;++W)if(fe=B[W],fe<j&&++k>o&&S("overflow"),fe==j){for(Z=k,ae=s;Ae=ae<=Q?a:ae>=Q+c?c:ae-Q,!(Z<Ae);ae+=s)Re=Z-Ae,ve=s-Ae,xe.push(E(C(Ae+Re%ve,0))),Z=T(Re/ve);xe.push(E(C(Z,0))),Q=w(k,we,G==q),k=0,++G}++k,++j}return xe.join("")}function F(B){return R(B,function(j){return m.test(j)?D(j.slice(4).toLowerCase()):j})}function V(B){return R(B,function(j){return y.test(j)?"xn--"+N(j):j})}if(r={version:"1.3.2",ucs2:{decode:O,encode:L},decode:D,encode:N,toASCII:V,toUnicode:F},typeof define=="function"&&typeof define.amd=="object"&&define.amd)define("punycode",function(){return r});else if(t&&n)if(CE.exports==t)n.exports=r;else for(v in r)r.hasOwnProperty(v)&&(t[v]=r[v]);else e.punycode=r})(EE)});var vce=uh((Cce,CN)=>{/*! * URI.js - Mutating URLs * IPv6 Support * @@ -58,26 +58,26 @@ var Mke=Object.create;var nN=Object.defineProperty;var Nke=Object.getOwnProperty * Licensed under * MIT License http://www.opensource.org/licenses/mit-license * - */(function(e,t){"use strict";typeof SN=="object"&&SN.exports?SN.exports=t(Ece(),vce(),wce()):typeof define=="function"&&define.amd?define(["./punycode","./IPv6","./SecondLevelDomains"],t):e.URI=t(e.punycode,e.IPv6,e.SecondLevelDomains,e)})(Ice,function(e,t,n,i){"use strict";var r=i&&i.URI;function o(C,w){var D=arguments.length>=1,N=arguments.length>=2;if(!(this instanceof o))return D?N?new o(C,w):new o(C):new o;if(C===void 0){if(D)throw new TypeError("undefined is not a valid argument for URI");typeof location<"u"?C=location.href+"":C=""}if(C===null&&D)throw new TypeError("null is not a valid argument for URI");return this.href(C),w!==void 0?this.absoluteTo(w):this}function s(C){return/^[0-9]+$/.test(C)}o.version="1.19.11";var a=o.prototype,c=Object.prototype.hasOwnProperty;function u(C){return C.replace(/([.*+?^=!:${}()|[\]\/\\])/g,"\\$1")}function f(C){return C===void 0?"Undefined":String(Object.prototype.toString.call(C)).slice(8,-1)}function d(C){return f(C)==="Array"}function p(C,w){var D={},N,F;if(f(w)==="RegExp")D=null;else if(d(w))for(N=0,F=w.length;N<F;N++)D[w[N]]=!0;else D[w]=!0;for(N=0,F=C.length;N<F;N++){var V=D&&D[C[N]]!==void 0||!D&&w.test(C[N]);V&&(C.splice(N,1),F--,N--)}return C}function g(C,w){var D,N;if(d(w)){for(D=0,N=w.length;D<N;D++)if(!g(C,w[D]))return!1;return!0}var F=f(w);for(D=0,N=C.length;D<N;D++)if(F==="RegExp"){if(typeof C[D]=="string"&&C[D].match(w))return!0}else if(C[D]===w)return!0;return!1}function m(C,w){if(!d(C)||!d(w)||C.length!==w.length)return!1;C.sort(),w.sort();for(var D=0,N=C.length;D<N;D++)if(C[D]!==w[D])return!1;return!0}function y(C){var w=/^\/+|\/+$/g;return C.replace(w,"")}o._parts=function(){return{protocol:null,username:null,password:null,hostname:null,urn:null,port:null,path:null,query:null,fragment:null,preventInvalidHostname:o.preventInvalidHostname,duplicateQueryParameters:o.duplicateQueryParameters,escapeQuerySpace:o.escapeQuerySpace}},o.preventInvalidHostname=!1,o.duplicateQueryParameters=!1,o.escapeQuerySpace=!0,o.protocol_expression=/^[a-z][a-z0-9.+-]*$/i,o.idn_expression=/[^a-z0-9\._-]/i,o.punycode_expression=/(xn--)/i,o.ip4_expression=/^\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}$/,o.ip6_expression=/^\s*((([0-9A-Fa-f]{1,4}:){7}([0-9A-Fa-f]{1,4}|:))|(([0-9A-Fa-f]{1,4}:){6}(:[0-9A-Fa-f]{1,4}|((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9A-Fa-f]{1,4}:){5}(((:[0-9A-Fa-f]{1,4}){1,2})|:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9A-Fa-f]{1,4}:){4}(((:[0-9A-Fa-f]{1,4}){1,3})|((:[0-9A-Fa-f]{1,4})?:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){3}(((:[0-9A-Fa-f]{1,4}){1,4})|((:[0-9A-Fa-f]{1,4}){0,2}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){2}(((:[0-9A-Fa-f]{1,4}){1,5})|((:[0-9A-Fa-f]{1,4}){0,3}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){1}(((:[0-9A-Fa-f]{1,4}){1,6})|((:[0-9A-Fa-f]{1,4}){0,4}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(:(((:[0-9A-Fa-f]{1,4}){1,7})|((:[0-9A-Fa-f]{1,4}){0,5}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:)))(%.+)?\s*$/,o.find_uri_expression=/\b((?:[a-z][\w-]+:(?:\/{1,3}|[a-z0-9%])|www\d{0,3}[.]|[a-z0-9.\-]+[.][a-z]{2,4}\/)(?:[^\s()<>]+|\(([^\s()<>]+|(\([^\s()<>]+\)))*\))+(?:\(([^\s()<>]+|(\([^\s()<>]+\)))*\)|[^\s`!()\[\]{};:'".,<>?«»“”‘’]))/ig,o.findUri={start:/\b(?:([a-z][a-z0-9.+-]*:\/\/)|www\.)/gi,end:/[\s\r\n]|$/,trim:/[`!()\[\]{};:'".,<>?«»“”„‘’]+$/,parens:/(\([^\)]*\)|\[[^\]]*\]|\{[^}]*\}|<[^>]*>)/g},o.leading_whitespace_expression=/^[\x00-\x20\u00a0\u1680\u2000-\u200a\u2028\u2029\u202f\u205f\u3000\ufeff]+/,o.ascii_tab_whitespace=/[\u0009\u000A\u000D]+/g,o.defaultPorts={http:"80",https:"443",ftp:"21",gopher:"70",ws:"80",wss:"443"},o.hostProtocols=["http","https"],o.invalid_hostname_characters=/[^a-zA-Z0-9\.\-:_]/,o.domAttributes={a:"href",blockquote:"cite",link:"href",base:"href",script:"src",form:"action",img:"src",area:"href",iframe:"src",embed:"src",source:"src",track:"src",input:"src",audio:"src",video:"src"},o.getDomAttribute=function(C){if(!(!C||!C.nodeName)){var w=C.nodeName.toLowerCase();if(!(w==="input"&&C.type!=="image"))return o.domAttributes[w]}};function A(C){return escape(C)}function b(C){return encodeURIComponent(C).replace(/[!'()*]/g,A).replace(/\*/g,"%2A")}o.encode=b,o.decode=decodeURIComponent,o.iso8859=function(){o.encode=escape,o.decode=unescape},o.unicode=function(){o.encode=b,o.decode=decodeURIComponent},o.characters={pathname:{encode:{expression:/%(24|26|2B|2C|3B|3D|3A|40)/ig,map:{"%24":"$","%26":"&","%2B":"+","%2C":",","%3B":";","%3D":"=","%3A":":","%40":"@"}},decode:{expression:/[\/\?#]/g,map:{"/":"%2F","?":"%3F","#":"%23"}}},reserved:{encode:{expression:/%(21|23|24|26|27|28|29|2A|2B|2C|2F|3A|3B|3D|3F|40|5B|5D)/ig,map:{"%3A":":","%2F":"/","%3F":"?","%23":"#","%5B":"[","%5D":"]","%40":"@","%21":"!","%24":"$","%26":"&","%27":"'","%28":"(","%29":")","%2A":"*","%2B":"+","%2C":",","%3B":";","%3D":"="}}},urnpath:{encode:{expression:/%(21|24|27|28|29|2A|2B|2C|3B|3D|40)/ig,map:{"%21":"!","%24":"$","%27":"'","%28":"(","%29":")","%2A":"*","%2B":"+","%2C":",","%3B":";","%3D":"=","%40":"@"}},decode:{expression:/[\/\?#:]/g,map:{"/":"%2F","?":"%3F","#":"%23",":":"%3A"}}}},o.encodeQuery=function(C,w){var D=o.encode(C+"");return w===void 0&&(w=o.escapeQuerySpace),w?D.replace(/%20/g,"+"):D},o.decodeQuery=function(C,w){C+="",w===void 0&&(w=o.escapeQuerySpace);try{return o.decode(w?C.replace(/\+/g,"%20"):C)}catch{return C}};var x={encode:"encode",decode:"decode"},T,E=function(C,w){return function(D){try{return o[w](D+"").replace(o.characters[C][w].expression,function(N){return o.characters[C][w].map[N]})}catch{return D}}};for(T in x)o[T+"PathSegment"]=E("pathname",x[T]),o[T+"UrnPathSegment"]=E("urnpath",x[T]);var v=function(C,w,D){return function(N){var F;D?F=function(k){return o[w](o[D](k))}:F=o[w];for(var V=(N+"").split(C),B=0,j=V.length;B<j;B++)V[B]=F(V[B]);return V.join(C)}};o.decodePath=v("/","decodePathSegment"),o.decodeUrnPath=v(":","decodeUrnPathSegment"),o.recodePath=v("/","encodePathSegment","decode"),o.recodeUrnPath=v(":","encodeUrnPathSegment","decode"),o.encodeReserved=E("reserved","encode"),o.parse=function(C,w){var D;return w||(w={preventInvalidHostname:o.preventInvalidHostname}),C=C.replace(o.leading_whitespace_expression,""),C=C.replace(o.ascii_tab_whitespace,""),D=C.indexOf("#"),D>-1&&(w.fragment=C.substring(D+1)||null,C=C.substring(0,D)),D=C.indexOf("?"),D>-1&&(w.query=C.substring(D+1)||null,C=C.substring(0,D)),C=C.replace(/^(https?|ftp|wss?)?:+[/\\]*/i,"$1://"),C=C.replace(/^[/\\]{2,}/i,"//"),C.substring(0,2)==="//"?(w.protocol=null,C=C.substring(2),C=o.parseAuthority(C,w)):(D=C.indexOf(":"),D>-1&&(w.protocol=C.substring(0,D)||null,w.protocol&&!w.protocol.match(o.protocol_expression)?w.protocol=void 0:C.substring(D+1,D+3).replace(/\\/g,"/")==="//"?(C=C.substring(D+3),C=o.parseAuthority(C,w)):(C=C.substring(D+1),w.urn=!0))),w.path=C,w},o.parseHost=function(C,w){C||(C=""),C=C.replace(/\\/g,"/");var D=C.indexOf("/"),N,F;if(D===-1&&(D=C.length),C.charAt(0)==="[")N=C.indexOf("]"),w.hostname=C.substring(1,N)||null,w.port=C.substring(N+2,D)||null,w.port==="/"&&(w.port=null);else{var V=C.indexOf(":"),B=C.indexOf("/"),j=C.indexOf(":",V+1);j!==-1&&(B===-1||j<B)?(w.hostname=C.substring(0,D)||null,w.port=null):(F=C.substring(0,D).split(":"),w.hostname=F[0]||null,w.port=F[1]||null)}return w.hostname&&C.substring(D).charAt(0)!=="/"&&(D++,C="/"+C),w.preventInvalidHostname&&o.ensureValidHostname(w.hostname,w.protocol),w.port&&o.ensureValidPort(w.port),C.substring(D)||"/"},o.parseAuthority=function(C,w){return C=o.parseUserinfo(C,w),o.parseHost(C,w)},o.parseUserinfo=function(C,w){var D=C,N=C.indexOf("\\");N!==-1&&(C=C.replace(/\\/g,"/"));var F=C.indexOf("/"),V=C.lastIndexOf("@",F>-1?F:C.length-1),B;return V>-1&&(F===-1||V<F)?(B=C.substring(0,V).split(":"),w.username=B[0]?o.decode(B[0]):null,B.shift(),w.password=B[0]?o.decode(B.join(":")):null,C=D.substring(V+1)):(w.username=null,w.password=null),C},o.parseQuery=function(C,w){if(!C)return{};if(C=C.replace(/&+/g,"&").replace(/^\?*&*|&+$/g,""),!C)return{};for(var D={},N=C.split("&"),F=N.length,V,B,j,k=0;k<F;k++)V=N[k].split("="),B=o.decodeQuery(V.shift(),w),j=V.length?o.decodeQuery(V.join("="),w):null,B!=="__proto__"&&(c.call(D,B)?((typeof D[B]=="string"||D[B]===null)&&(D[B]=[D[B]]),D[B].push(j)):D[B]=j);return D},o.build=function(C){var w="",D=!1;return C.protocol&&(w+=C.protocol+":"),!C.urn&&(w||C.hostname)&&(w+="//",D=!0),w+=o.buildAuthority(C)||"",typeof C.path=="string"&&(C.path.charAt(0)!=="/"&&D&&(w+="/"),w+=C.path),typeof C.query=="string"&&C.query&&(w+="?"+C.query),typeof C.fragment=="string"&&C.fragment&&(w+="#"+C.fragment),w},o.buildHost=function(C){var w="";if(C.hostname)o.ip6_expression.test(C.hostname)?w+="["+C.hostname+"]":w+=C.hostname;else return"";return C.port&&(w+=":"+C.port),w},o.buildAuthority=function(C){return o.buildUserinfo(C)+o.buildHost(C)},o.buildUserinfo=function(C){var w="";return C.username&&(w+=o.encode(C.username)),C.password&&(w+=":"+o.encode(C.password)),w&&(w+="@"),w},o.buildQuery=function(C,w,D){var N="",F,V,B,j;for(V in C)if(V!=="__proto__"&&c.call(C,V))if(d(C[V]))for(F={},B=0,j=C[V].length;B<j;B++)C[V][B]!==void 0&&F[C[V][B]+""]===void 0&&(N+="&"+o.buildQueryParameter(V,C[V][B],D),w!==!0&&(F[C[V][B]+""]=!0));else C[V]!==void 0&&(N+="&"+o.buildQueryParameter(V,C[V],D));return N.substring(1)},o.buildQueryParameter=function(C,w,D){return o.encodeQuery(C,D)+(w!==null?"="+o.encodeQuery(w,D):"")},o.addQuery=function(C,w,D){if(typeof w=="object")for(var N in w)c.call(w,N)&&o.addQuery(C,N,w[N]);else if(typeof w=="string"){if(C[w]===void 0){C[w]=D;return}else typeof C[w]=="string"&&(C[w]=[C[w]]);d(D)||(D=[D]),C[w]=(C[w]||[]).concat(D)}else throw new TypeError("URI.addQuery() accepts an object, string as the name parameter")},o.setQuery=function(C,w,D){if(typeof w=="object")for(var N in w)c.call(w,N)&&o.setQuery(C,N,w[N]);else if(typeof w=="string")C[w]=D===void 0?null:D;else throw new TypeError("URI.setQuery() accepts an object, string as the name parameter")},o.removeQuery=function(C,w,D){var N,F,V;if(d(w))for(N=0,F=w.length;N<F;N++)C[w[N]]=void 0;else if(f(w)==="RegExp")for(V in C)w.test(V)&&(C[V]=void 0);else if(typeof w=="object")for(V in w)c.call(w,V)&&o.removeQuery(C,V,w[V]);else if(typeof w=="string")D!==void 0?f(D)==="RegExp"?!d(C[w])&&D.test(C[w])?C[w]=void 0:C[w]=p(C[w],D):C[w]===String(D)&&(!d(D)||D.length===1)?C[w]=void 0:d(C[w])&&(C[w]=p(C[w],D)):C[w]=void 0;else throw new TypeError("URI.removeQuery() accepts an object, string, RegExp as the first parameter")},o.hasQuery=function(C,w,D,N){switch(f(w)){case"String":break;case"RegExp":for(var F in C)if(c.call(C,F)&&w.test(F)&&(D===void 0||o.hasQuery(C,F,D)))return!0;return!1;case"Object":for(var V in w)if(c.call(w,V)&&!o.hasQuery(C,V,w[V]))return!1;return!0;default:throw new TypeError("URI.hasQuery() accepts a string, regular expression or object as the name parameter")}switch(f(D)){case"Undefined":return w in C;case"Boolean":var B=!!(d(C[w])?C[w].length:C[w]);return D===B;case"Function":return!!D(C[w],w,C);case"Array":if(!d(C[w]))return!1;var j=N?g:m;return j(C[w],D);case"RegExp":return d(C[w])?N?g(C[w],D):!1:!!(C[w]&&C[w].match(D));case"Number":D=String(D);case"String":return d(C[w])?N?g(C[w],D):!1:C[w]===D;default:throw new TypeError("URI.hasQuery() accepts undefined, boolean, string, number, RegExp, Function as the value parameter")}},o.joinPaths=function(){for(var C=[],w=[],D=0,N=0;N<arguments.length;N++){var F=new o(arguments[N]);C.push(F);for(var V=F.segment(),B=0;B<V.length;B++)typeof V[B]=="string"&&w.push(V[B]),V[B]&&D++}if(!w.length||!D)return new o("");var j=new o("").segment(w);return(C[0].path()===""||C[0].path().slice(0,1)==="/")&&j.path("/"+j.path()),j.normalize()},o.commonPath=function(C,w){var D=Math.min(C.length,w.length),N;for(N=0;N<D;N++)if(C.charAt(N)!==w.charAt(N)){N--;break}return N<1?C.charAt(0)===w.charAt(0)&&C.charAt(0)==="/"?"/":"":((C.charAt(N)!=="/"||w.charAt(N)!=="/")&&(N=C.substring(0,N).lastIndexOf("/")),C.substring(0,N+1))},o.withinString=function(C,w,D){D||(D={});var N=D.start||o.findUri.start,F=D.end||o.findUri.end,V=D.trim||o.findUri.trim,B=D.parens||o.findUri.parens,j=/[a-z0-9-]=["']?$/i;for(N.lastIndex=0;;){var k=N.exec(C);if(!k)break;var G=k.index;if(D.ignoreHtml){var q=C.slice(Math.max(G-3,0),G);if(q&&j.test(q))continue}for(var Q=G+C.slice(G).search(F),W=C.slice(G,Q),J=-1;;){var Z=B.exec(W);if(!Z)break;var ae=Z.index+Z[0].length;J=Math.max(J,ae)}if(J>-1?W=W.slice(0,J)+W.slice(J).replace(V,""):W=W.replace(V,""),!(W.length<=k[0].length)&&!(D.ignore&&D.ignore.test(W))){Q=G+W.length;var Ae=w(W,G,Q,C);if(Ae===void 0){N.lastIndex=Q;continue}Ae=String(Ae),C=C.slice(0,G)+Ae+C.slice(Q),N.lastIndex=G+Ae.length}}return N.lastIndex=0,C},o.ensureValidHostname=function(C,w){var D=!!C,N=!!w,F=!1;if(N&&(F=g(o.hostProtocols,w)),F&&!D)throw new TypeError("Hostname cannot be empty, if protocol is "+w);if(C&&C.match(o.invalid_hostname_characters)){if(!e)throw new TypeError('Hostname "'+C+'" contains characters other than [A-Z0-9.-:_] and Punycode.js is not available');if(e.toASCII(C).match(o.invalid_hostname_characters))throw new TypeError('Hostname "'+C+'" contains characters other than [A-Z0-9.-:_]')}},o.ensureValidPort=function(C){if(C){var w=Number(C);if(!(s(w)&&w>0&&w<65536))throw new TypeError('Port "'+C+'" is not a valid port')}},o.noConflict=function(C){if(C){var w={URI:this.noConflict()};return i.URITemplate&&typeof i.URITemplate.noConflict=="function"&&(w.URITemplate=i.URITemplate.noConflict()),i.IPv6&&typeof i.IPv6.noConflict=="function"&&(w.IPv6=i.IPv6.noConflict()),i.SecondLevelDomains&&typeof i.SecondLevelDomains.noConflict=="function"&&(w.SecondLevelDomains=i.SecondLevelDomains.noConflict()),w}else i.URI===this&&(i.URI=r);return this},a.build=function(C){return C===!0?this._deferred_build=!0:(C===void 0||this._deferred_build)&&(this._string=o.build(this._parts),this._deferred_build=!1),this},a.clone=function(){return new o(this)},a.valueOf=a.toString=function(){return this.build(!1)._string};function S(C){return function(w,D){return w===void 0?this._parts[C]||"":(this._parts[C]=w||null,this.build(!D),this)}}function I(C,w){return function(D,N){return D===void 0?this._parts[C]||"":(D!==null&&(D=D+"",D.charAt(0)===w&&(D=D.substring(1))),this._parts[C]=D,this.build(!N),this)}}a.protocol=S("protocol"),a.username=S("username"),a.password=S("password"),a.hostname=S("hostname"),a.port=S("port"),a.query=I("query","?"),a.fragment=I("fragment","#"),a.search=function(C,w){var D=this.query(C,w);return typeof D=="string"&&D.length?"?"+D:D},a.hash=function(C,w){var D=this.fragment(C,w);return typeof D=="string"&&D.length?"#"+D:D},a.pathname=function(C,w){if(C===void 0||C===!0){var D=this._parts.path||(this._parts.hostname?"/":"");return C?(this._parts.urn?o.decodeUrnPath:o.decodePath)(D):D}else return this._parts.urn?this._parts.path=C?o.recodeUrnPath(C):"":this._parts.path=C?o.recodePath(C):"/",this.build(!w),this},a.path=a.pathname,a.href=function(C,w){var D;if(C===void 0)return this.toString();this._string="",this._parts=o._parts();var N=C instanceof o,F=typeof C=="object"&&(C.hostname||C.path||C.pathname);if(C.nodeName){var V=o.getDomAttribute(C);C=C[V]||"",F=!1}if(!N&&F&&C.pathname!==void 0&&(C=C.toString()),typeof C=="string"||C instanceof String)this._parts=o.parse(String(C),this._parts);else if(N||F){var B=N?C._parts:C;for(D in B)D!=="query"&&c.call(this._parts,D)&&(this._parts[D]=B[D]);B.query&&this.query(B.query,!1)}else throw new TypeError("invalid input");return this.build(!w),this},a.is=function(C){var w=!1,D=!1,N=!1,F=!1,V=!1,B=!1,j=!1,k=!this._parts.urn;switch(this._parts.hostname&&(k=!1,D=o.ip4_expression.test(this._parts.hostname),N=o.ip6_expression.test(this._parts.hostname),w=D||N,F=!w,V=F&&n&&n.has(this._parts.hostname),B=F&&o.idn_expression.test(this._parts.hostname),j=F&&o.punycode_expression.test(this._parts.hostname)),C.toLowerCase()){case"relative":return k;case"absolute":return!k;case"domain":case"name":return F;case"sld":return V;case"ip":return w;case"ip4":case"ipv4":case"inet4":return D;case"ip6":case"ipv6":case"inet6":return N;case"idn":return B;case"url":return!this._parts.urn;case"urn":return!!this._parts.urn;case"punycode":return j}return null};var R=a.protocol,O=a.port,L=a.hostname;a.protocol=function(C,w){if(C&&(C=C.replace(/:(\/\/)?$/,""),!C.match(o.protocol_expression)))throw new TypeError('Protocol "'+C+`" contains characters other than [A-Z0-9.+-] or doesn't start with [A-Z]`);return R.call(this,C,w)},a.scheme=a.protocol,a.port=function(C,w){return this._parts.urn?C===void 0?"":this:(C!==void 0&&(C===0&&(C=null),C&&(C+="",C.charAt(0)===":"&&(C=C.substring(1)),o.ensureValidPort(C))),O.call(this,C,w))},a.hostname=function(C,w){if(this._parts.urn)return C===void 0?"":this;if(C!==void 0){var D={preventInvalidHostname:this._parts.preventInvalidHostname},N=o.parseHost(C,D);if(N!=="/")throw new TypeError('Hostname "'+C+'" contains characters other than [A-Z0-9.-]');C=D.hostname,this._parts.preventInvalidHostname&&o.ensureValidHostname(C,this._parts.protocol)}return L.call(this,C,w)},a.origin=function(C,w){if(this._parts.urn)return C===void 0?"":this;if(C===void 0){var D=this.protocol(),N=this.authority();return N?(D?D+"://":"")+this.authority():""}else{var F=o(C);return this.protocol(F.protocol()).authority(F.authority()).build(!w),this}},a.host=function(C,w){if(this._parts.urn)return C===void 0?"":this;if(C===void 0)return this._parts.hostname?o.buildHost(this._parts):"";var D=o.parseHost(C,this._parts);if(D!=="/")throw new TypeError('Hostname "'+C+'" contains characters other than [A-Z0-9.-]');return this.build(!w),this},a.authority=function(C,w){if(this._parts.urn)return C===void 0?"":this;if(C===void 0)return this._parts.hostname?o.buildAuthority(this._parts):"";var D=o.parseAuthority(C,this._parts);if(D!=="/")throw new TypeError('Hostname "'+C+'" contains characters other than [A-Z0-9.-]');return this.build(!w),this},a.userinfo=function(C,w){if(this._parts.urn)return C===void 0?"":this;if(C===void 0){var D=o.buildUserinfo(this._parts);return D&&D.substring(0,D.length-1)}else return C[C.length-1]!=="@"&&(C+="@"),o.parseUserinfo(C,this._parts),this.build(!w),this},a.resource=function(C,w){var D;return C===void 0?this.path()+this.search()+this.hash():(D=o.parse(C),this._parts.path=D.path,this._parts.query=D.query,this._parts.fragment=D.fragment,this.build(!w),this)},a.subdomain=function(C,w){if(this._parts.urn)return C===void 0?"":this;if(C===void 0){if(!this._parts.hostname||this.is("IP"))return"";var D=this._parts.hostname.length-this.domain().length-1;return this._parts.hostname.substring(0,D)||""}else{var N=this._parts.hostname.length-this.domain().length,F=this._parts.hostname.substring(0,N),V=new RegExp("^"+u(F));if(C&&C.charAt(C.length-1)!=="."&&(C+="."),C.indexOf(":")!==-1)throw new TypeError("Domains cannot contain colons");return C&&o.ensureValidHostname(C,this._parts.protocol),this._parts.hostname=this._parts.hostname.replace(V,C),this.build(!w),this}},a.domain=function(C,w){if(this._parts.urn)return C===void 0?"":this;if(typeof C=="boolean"&&(w=C,C=void 0),C===void 0){if(!this._parts.hostname||this.is("IP"))return"";var D=this._parts.hostname.match(/\./g);if(D&&D.length<2)return this._parts.hostname;var N=this._parts.hostname.length-this.tld(w).length-1;return N=this._parts.hostname.lastIndexOf(".",N-1)+1,this._parts.hostname.substring(N)||""}else{if(!C)throw new TypeError("cannot set domain empty");if(C.indexOf(":")!==-1)throw new TypeError("Domains cannot contain colons");if(o.ensureValidHostname(C,this._parts.protocol),!this._parts.hostname||this.is("IP"))this._parts.hostname=C;else{var F=new RegExp(u(this.domain())+"$");this._parts.hostname=this._parts.hostname.replace(F,C)}return this.build(!w),this}},a.tld=function(C,w){if(this._parts.urn)return C===void 0?"":this;if(typeof C=="boolean"&&(w=C,C=void 0),C===void 0){if(!this._parts.hostname||this.is("IP"))return"";var D=this._parts.hostname.lastIndexOf("."),N=this._parts.hostname.substring(D+1);return w!==!0&&n&&n.list[N.toLowerCase()]&&n.get(this._parts.hostname)||N}else{var F;if(C)if(C.match(/[^a-zA-Z0-9-]/))if(n&&n.is(C))F=new RegExp(u(this.tld())+"$"),this._parts.hostname=this._parts.hostname.replace(F,C);else throw new TypeError('TLD "'+C+'" contains characters other than [A-Z0-9]');else{if(!this._parts.hostname||this.is("IP"))throw new ReferenceError("cannot set TLD on non-domain host");F=new RegExp(u(this.tld())+"$"),this._parts.hostname=this._parts.hostname.replace(F,C)}else throw new TypeError("cannot set TLD empty");return this.build(!w),this}},a.directory=function(C,w){if(this._parts.urn)return C===void 0?"":this;if(C===void 0||C===!0){if(!this._parts.path&&!this._parts.hostname)return"";if(this._parts.path==="/")return"/";var D=this._parts.path.length-this.filename().length-1,N=this._parts.path.substring(0,D)||(this._parts.hostname?"/":"");return C?o.decodePath(N):N}else{var F=this._parts.path.length-this.filename().length,V=this._parts.path.substring(0,F),B=new RegExp("^"+u(V));return this.is("relative")||(C||(C="/"),C.charAt(0)!=="/"&&(C="/"+C)),C&&C.charAt(C.length-1)!=="/"&&(C+="/"),C=o.recodePath(C),this._parts.path=this._parts.path.replace(B,C),this.build(!w),this}},a.filename=function(C,w){if(this._parts.urn)return C===void 0?"":this;if(typeof C!="string"){if(!this._parts.path||this._parts.path==="/")return"";var D=this._parts.path.lastIndexOf("/"),N=this._parts.path.substring(D+1);return C?o.decodePathSegment(N):N}else{var F=!1;C.charAt(0)==="/"&&(C=C.substring(1)),C.match(/\.?\//)&&(F=!0);var V=new RegExp(u(this.filename())+"$");return C=o.recodePath(C),this._parts.path=this._parts.path.replace(V,C),F?this.normalizePath(w):this.build(!w),this}},a.suffix=function(C,w){if(this._parts.urn)return C===void 0?"":this;if(C===void 0||C===!0){if(!this._parts.path||this._parts.path==="/")return"";var D=this.filename(),N=D.lastIndexOf("."),F,V;return N===-1?"":(F=D.substring(N+1),V=/^[a-z0-9%]+$/i.test(F)?F:"",C?o.decodePathSegment(V):V)}else{C.charAt(0)==="."&&(C=C.substring(1));var B=this.suffix(),j;if(B)C?j=new RegExp(u(B)+"$"):j=new RegExp(u("."+B)+"$");else{if(!C)return this;this._parts.path+="."+o.recodePath(C)}return j&&(C=o.recodePath(C),this._parts.path=this._parts.path.replace(j,C)),this.build(!w),this}},a.segment=function(C,w,D){var N=this._parts.urn?":":"/",F=this.path(),V=F.substring(0,1)==="/",B=F.split(N);if(C!==void 0&&typeof C!="number"&&(D=w,w=C,C=void 0),C!==void 0&&typeof C!="number")throw new Error('Bad segment "'+C+'", must be 0-based integer');if(V&&B.shift(),C<0&&(C=Math.max(B.length+C,0)),w===void 0)return C===void 0?B:B[C];if(C===null||B[C]===void 0)if(d(w)){B=[];for(var j=0,k=w.length;j<k;j++)!w[j].length&&(!B.length||!B[B.length-1].length)||(B.length&&!B[B.length-1].length&&B.pop(),B.push(y(w[j])))}else(w||typeof w=="string")&&(w=y(w),B[B.length-1]===""?B[B.length-1]=w:B.push(w));else w?B[C]=y(w):B.splice(C,1);return V&&B.unshift(""),this.path(B.join(N),D)},a.segmentCoded=function(C,w,D){var N,F,V;if(typeof C!="number"&&(D=w,w=C,C=void 0),w===void 0){if(N=this.segment(C,w,D),!d(N))N=N!==void 0?o.decode(N):void 0;else for(F=0,V=N.length;F<V;F++)N[F]=o.decode(N[F]);return N}if(!d(w))w=typeof w=="string"||w instanceof String?o.encode(w):w;else for(F=0,V=w.length;F<V;F++)w[F]=o.encode(w[F]);return this.segment(C,w,D)};var _=a.query;return a.query=function(C,w){if(C===!0)return o.parseQuery(this._parts.query,this._parts.escapeQuerySpace);if(typeof C=="function"){var D=o.parseQuery(this._parts.query,this._parts.escapeQuerySpace),N=C.call(this,D);return this._parts.query=o.buildQuery(N||D,this._parts.duplicateQueryParameters,this._parts.escapeQuerySpace),this.build(!w),this}else return C!==void 0&&typeof C!="string"?(this._parts.query=o.buildQuery(C,this._parts.duplicateQueryParameters,this._parts.escapeQuerySpace),this.build(!w),this):_.call(this,C,w)},a.setQuery=function(C,w,D){var N=o.parseQuery(this._parts.query,this._parts.escapeQuerySpace);if(typeof C=="string"||C instanceof String)N[C]=w!==void 0?w:null;else if(typeof C=="object")for(var F in C)c.call(C,F)&&(N[F]=C[F]);else throw new TypeError("URI.addQuery() accepts an object, string as the name parameter");return this._parts.query=o.buildQuery(N,this._parts.duplicateQueryParameters,this._parts.escapeQuerySpace),typeof C!="string"&&(D=w),this.build(!D),this},a.addQuery=function(C,w,D){var N=o.parseQuery(this._parts.query,this._parts.escapeQuerySpace);return o.addQuery(N,C,w===void 0?null:w),this._parts.query=o.buildQuery(N,this._parts.duplicateQueryParameters,this._parts.escapeQuerySpace),typeof C!="string"&&(D=w),this.build(!D),this},a.removeQuery=function(C,w,D){var N=o.parseQuery(this._parts.query,this._parts.escapeQuerySpace);return o.removeQuery(N,C,w),this._parts.query=o.buildQuery(N,this._parts.duplicateQueryParameters,this._parts.escapeQuerySpace),typeof C!="string"&&(D=w),this.build(!D),this},a.hasQuery=function(C,w,D){var N=o.parseQuery(this._parts.query,this._parts.escapeQuerySpace);return o.hasQuery(N,C,w,D)},a.setSearch=a.setQuery,a.addSearch=a.addQuery,a.removeSearch=a.removeQuery,a.hasSearch=a.hasQuery,a.normalize=function(){return this._parts.urn?this.normalizeProtocol(!1).normalizePath(!1).normalizeQuery(!1).normalizeFragment(!1).build():this.normalizeProtocol(!1).normalizeHostname(!1).normalizePort(!1).normalizePath(!1).normalizeQuery(!1).normalizeFragment(!1).build()},a.normalizeProtocol=function(C){return typeof this._parts.protocol=="string"&&(this._parts.protocol=this._parts.protocol.toLowerCase(),this.build(!C)),this},a.normalizeHostname=function(C){return this._parts.hostname&&(this.is("IDN")&&e?this._parts.hostname=e.toASCII(this._parts.hostname):this.is("IPv6")&&t&&(this._parts.hostname=t.best(this._parts.hostname)),this._parts.hostname=this._parts.hostname.toLowerCase(),this.build(!C)),this},a.normalizePort=function(C){return typeof this._parts.protocol=="string"&&this._parts.port===o.defaultPorts[this._parts.protocol]&&(this._parts.port=null,this.build(!C)),this},a.normalizePath=function(C){var w=this._parts.path;if(!w)return this;if(this._parts.urn)return this._parts.path=o.recodeUrnPath(this._parts.path),this.build(!C),this;if(this._parts.path==="/")return this;w=o.recodePath(w);var D,N="",F,V;for(w.charAt(0)!=="/"&&(D=!0,w="/"+w),(w.slice(-3)==="/.."||w.slice(-2)==="/.")&&(w+="/"),w=w.replace(/(\/(\.\/)+)|(\/\.$)/g,"/").replace(/\/{2,}/g,"/"),D&&(N=w.substring(1).match(/^(\.\.\/)+/)||"",N&&(N=N[0]));F=w.search(/\/\.\.(\/|$)/),F!==-1;){if(F===0){w=w.substring(3);continue}V=w.substring(0,F).lastIndexOf("/"),V===-1&&(V=F),w=w.substring(0,V)+w.substring(F+3)}return D&&this.is("relative")&&(w=N+w.substring(1)),this._parts.path=w,this.build(!C),this},a.normalizePathname=a.normalizePath,a.normalizeQuery=function(C){return typeof this._parts.query=="string"&&(this._parts.query.length?this.query(o.parseQuery(this._parts.query,this._parts.escapeQuerySpace)):this._parts.query=null,this.build(!C)),this},a.normalizeFragment=function(C){return this._parts.fragment||(this._parts.fragment=null,this.build(!C)),this},a.normalizeSearch=a.normalizeQuery,a.normalizeHash=a.normalizeFragment,a.iso8859=function(){var C=o.encode,w=o.decode;o.encode=escape,o.decode=decodeURIComponent;try{this.normalize()}finally{o.encode=C,o.decode=w}return this},a.unicode=function(){var C=o.encode,w=o.decode;o.encode=b,o.decode=unescape;try{this.normalize()}finally{o.encode=C,o.decode=w}return this},a.readable=function(){var C=this.clone();C.username("").password("").normalize();var w="";if(C._parts.protocol&&(w+=C._parts.protocol+"://"),C._parts.hostname&&(C.is("punycode")&&e?(w+=e.toUnicode(C._parts.hostname),C._parts.port&&(w+=":"+C._parts.port)):w+=C.host()),C._parts.hostname&&C._parts.path&&C._parts.path.charAt(0)!=="/"&&(w+="/"),w+=C.path(!0),C._parts.query){for(var D="",N=0,F=C._parts.query.split("&"),V=F.length;N<V;N++){var B=(F[N]||"").split("=");D+="&"+o.decodeQuery(B[0],this._parts.escapeQuerySpace).replace(/&/g,"%26"),B[1]!==void 0&&(D+="="+o.decodeQuery(B[1],this._parts.escapeQuerySpace).replace(/&/g,"%26"))}w+="?"+D.substring(1)}return w+=o.decodeQuery(C.hash(),!0),w},a.absoluteTo=function(C){var w=this.clone(),D=["protocol","username","password","hostname","port"],N,F,V;if(this._parts.urn)throw new Error("URNs do not have any generally defined hierarchical components");if(C instanceof o||(C=new o(C)),w._parts.protocol||(w._parts.protocol=C._parts.protocol,this._parts.hostname))return w;for(F=0;V=D[F];F++)w._parts[V]=C._parts[V];return w._parts.path?(w._parts.path.substring(-2)===".."&&(w._parts.path+="/"),w.path().charAt(0)!=="/"&&(N=C.directory(),N=N||(C.path().indexOf("/")===0?"/":""),w._parts.path=(N?N+"/":"")+w._parts.path,w.normalizePath())):(w._parts.path=C._parts.path,w._parts.query||(w._parts.query=C._parts.query)),w.build(),w},a.relativeTo=function(C){var w=this.clone().normalize(),D,N,F,V,B;if(w._parts.urn)throw new Error("URNs do not have any generally defined hierarchical components");if(C=new o(C).normalize(),D=w._parts,N=C._parts,V=w.path(),B=C.path(),V.charAt(0)!=="/")throw new Error("URI is already relative");if(B.charAt(0)!=="/")throw new Error("Cannot calculate a URI relative to another relative URI");if(D.protocol===N.protocol&&(D.protocol=null),D.username!==N.username||D.password!==N.password||D.protocol!==null||D.username!==null||D.password!==null)return w.build();if(D.hostname===N.hostname&&D.port===N.port)D.hostname=null,D.port=null;else return w.build();if(V===B)return D.path="",w.build();if(F=o.commonPath(V,B),!F)return w.build();var j=N.path.substring(F.length).replace(/[^\/]*$/,"").replace(/.*?\//g,"../");return D.path=j+D.path.substring(F.length)||"./",w.build()},a.equals=function(C){var w=this.clone(),D=new o(C),N={},F={},V={},B,j,k;if(w.normalize(),D.normalize(),w.toString()===D.toString())return!0;if(B=w.query(),j=D.query(),w.query(""),D.query(""),w.toString()!==D.toString()||B.length!==j.length)return!1;N=o.parseQuery(B,this._parts.escapeQuerySpace),F=o.parseQuery(j,this._parts.escapeQuerySpace);for(k in N)if(c.call(N,k)){if(d(N[k])){if(!m(N[k],F[k]))return!1}else if(N[k]!==F[k])return!1;V[k]=!0}for(k in F)if(c.call(F,k)&&!V[k])return!1;return!0},a.preventInvalidHostname=function(C){return this._parts.preventInvalidHostname=!!C,this},a.duplicateQueryParameters=function(C){return this._parts.duplicateQueryParameters=!!C,this},a.escapeQuerySpace=function(C){return this._parts.escapeQuerySpace=!!C,this},o})});var yAe=uh((eZn,_Ae)=>{"use strict";_Ae.exports=Olt;var l1=1e20;function Olt(e,t){t||(t={});var n=t.cutoff==null?.25:t.cutoff,i=t.radius==null?8:t.radius,r=t.channel||0,o,s,a,c,u,f,d,p,g,m,y;if(ArrayBuffer.isView(e)||Array.isArray(e)){if(!t.width||!t.height)throw Error("For raw data width and height should be provided by options");o=t.width,s=t.height,c=e,t.stride?f=t.stride:f=Math.floor(e.length/o/s)}else window.HTMLCanvasElement&&e instanceof window.HTMLCanvasElement?(p=e,d=p.getContext("2d"),o=p.width,s=p.height,g=d.getImageData(0,0,o,s),c=g.data,f=4):window.CanvasRenderingContext2D&&e instanceof window.CanvasRenderingContext2D?(p=e.canvas,d=e,o=p.width,s=p.height,g=d.getImageData(0,0,o,s),c=g.data,f=4):window.ImageData&&e instanceof window.ImageData&&(g=e,o=e.width,s=e.height,c=g.data,f=4);if(a=Math.max(o,s),window.Uint8ClampedArray&&c instanceof window.Uint8ClampedArray||window.Uint8Array&&c instanceof window.Uint8Array)for(u=c,c=Array(o*s),m=0,y=Math.floor(u.length/f);m<y;m++)c[m]=u[m*f+r]/255;else if(f!==1)throw Error("Raw data can have only 1 value per pixel");var A=Array(o*s),b=Array(o*s),x=Array(a),T=Array(a),E=Array(a+1),v=Array(a);for(m=0,y=o*s;m<y;m++){var S=c[m];A[m]=S===1?0:S===0?l1:Math.pow(Math.max(0,.5-S),2),b[m]=S===1?l1:S===0?0:Math.pow(Math.max(0,S-.5),2)}pAe(A,o,s,x,T,v,E),pAe(b,o,s,x,T,v,E);var I=window.Float32Array?new Float32Array(o*s):new Array(o*s);for(m=0,y=o*s;m<y;m++)I[m]=Math.min(Math.max(1-((A[m]-b[m])/i+n),0),1);return I}function pAe(e,t,n,i,r,o,s){for(var a=0;a<t;a++){for(var c=0;c<n;c++)i[c]=e[c*t+a];for(gAe(i,r,o,s,n),c=0;c<n;c++)e[c*t+a]=r[c]}for(c=0;c<n;c++){for(a=0;a<t;a++)i[a]=e[c*t+a];for(gAe(i,r,o,s,t),a=0;a<t;a++)e[c*t+a]=Math.sqrt(r[a])}}function gAe(e,t,n,i,r){n[0]=0,i[0]=-l1,i[1]=+l1;for(var o=1,s=0;o<r;o++){for(var a=(e[o]+o*o-(e[n[s]]+n[s]*n[s]))/(2*o-2*n[s]);a<=i[s];)s--,a=(e[o]+o*o-(e[n[s]]+n[s]*n[s]))/(2*o-2*n[s]);s++,n[s]=o,i[s]=a,i[s+1]=+l1}for(o=0,s=0;o<r;o++){for(;i[s+1]<o;)s++;t[o]=(o-n[s])*(o-n[s])+e[n[s]]}}});var CAe=uh((_Zn,s4)=>{function jlt(){var e=0,t=1,n=2,i=3,r=4,o=5,s=6,a=7,c=8,u=9,f=10,d=11,p=12,g=13,m=14,y=15,A=16,b=17,x=0,T=1,E=2,v=3,S=4;function I(_,C){return 55296<=_.charCodeAt(C)&&_.charCodeAt(C)<=56319&&56320<=_.charCodeAt(C+1)&&_.charCodeAt(C+1)<=57343}function R(_,C){C===void 0&&(C=0);var w=_.charCodeAt(C);if(55296<=w&&w<=56319&&C<_.length-1){var D=w,N=_.charCodeAt(C+1);return 56320<=N&&N<=57343?(D-55296)*1024+(N-56320)+65536:D}if(56320<=w&&w<=57343&&C>=1){var D=_.charCodeAt(C-1),N=w;return 55296<=D&&D<=56319?(D-55296)*1024+(N-56320)+65536:N}return w}function O(_,C,w){var D=[_].concat(C).concat([w]),N=D[D.length-2],F=w,V=D.lastIndexOf(m);if(V>1&&D.slice(1,V).every(function(k){return k==i})&&[i,g,b].indexOf(_)==-1)return E;var B=D.lastIndexOf(r);if(B>0&&D.slice(1,B).every(function(k){return k==r})&&[p,r].indexOf(N)==-1)return D.filter(function(k){return k==r}).length%2==1?v:S;if(N==e&&F==t)return x;if(N==n||N==e||N==t)return F==m&&C.every(function(k){return k==i})?E:T;if(F==n||F==e||F==t)return T;if(N==s&&(F==s||F==a||F==u||F==f))return x;if((N==u||N==a)&&(F==a||F==c))return x;if((N==f||N==c)&&F==c)return x;if(F==i||F==y)return x;if(F==o)return x;if(N==p)return x;var j=D.indexOf(i)!=-1?D.lastIndexOf(i)-1:D.length-2;return[g,b].indexOf(D[j])!=-1&&D.slice(j+1,-1).every(function(k){return k==i})&&F==m||N==y&&[A,b].indexOf(F)!=-1?x:C.indexOf(r)!=-1?E:N==r&&F==r?x:T}this.nextBreak=function(_,C){if(C===void 0&&(C=0),C<0)return 0;if(C>=_.length-1)return _.length;for(var w=L(R(_,C)),D=[],N=C+1;N<_.length;N++)if(!I(_,N-1)){var F=L(R(_,N));if(O(w,D,F))return N;D.push(F)}return _.length},this.splitGraphemes=function(_){for(var C=[],w=0,D;(D=this.nextBreak(_,w))<_.length;)C.push(_.slice(w,D)),w=D;return w<_.length&&C.push(_.slice(w)),C},this.iterateGraphemes=function(_){var C=0,w={next:(function(){var D,N;return(N=this.nextBreak(_,C))<_.length?(D=_.slice(C,N),C=N,{value:D,done:!1}):C<_.length?(D=_.slice(C),C=_.length,{value:D,done:!1}):{value:void 0,done:!0}}).bind(this)};return typeof Symbol<"u"&&Symbol.iterator&&(w[Symbol.iterator]=function(){return w}),w},this.countGraphemes=function(_){for(var C=0,w=0,D;(D=this.nextBreak(_,w))<_.length;)w=D,C++;return w<_.length&&C++,C};function L(_){return 1536<=_&&_<=1541||_==1757||_==1807||_==2274||_==3406||_==69821||70082<=_&&_<=70083||_==72250||72326<=_&&_<=72329||_==73030?p:_==13?e:_==10?t:0<=_&&_<=9||11<=_&&_<=12||14<=_&&_<=31||127<=_&&_<=159||_==173||_==1564||_==6158||_==8203||8206<=_&&_<=8207||_==8232||_==8233||8234<=_&&_<=8238||8288<=_&&_<=8292||_==8293||8294<=_&&_<=8303||55296<=_&&_<=57343||_==65279||65520<=_&&_<=65528||65529<=_&&_<=65531||113824<=_&&_<=113827||119155<=_&&_<=119162||_==917504||_==917505||917506<=_&&_<=917535||917632<=_&&_<=917759||918e3<=_&&_<=921599?n:768<=_&&_<=879||1155<=_&&_<=1159||1160<=_&&_<=1161||1425<=_&&_<=1469||_==1471||1473<=_&&_<=1474||1476<=_&&_<=1477||_==1479||1552<=_&&_<=1562||1611<=_&&_<=1631||_==1648||1750<=_&&_<=1756||1759<=_&&_<=1764||1767<=_&&_<=1768||1770<=_&&_<=1773||_==1809||1840<=_&&_<=1866||1958<=_&&_<=1968||2027<=_&&_<=2035||2070<=_&&_<=2073||2075<=_&&_<=2083||2085<=_&&_<=2087||2089<=_&&_<=2093||2137<=_&&_<=2139||2260<=_&&_<=2273||2275<=_&&_<=2306||_==2362||_==2364||2369<=_&&_<=2376||_==2381||2385<=_&&_<=2391||2402<=_&&_<=2403||_==2433||_==2492||_==2494||2497<=_&&_<=2500||_==2509||_==2519||2530<=_&&_<=2531||2561<=_&&_<=2562||_==2620||2625<=_&&_<=2626||2631<=_&&_<=2632||2635<=_&&_<=2637||_==2641||2672<=_&&_<=2673||_==2677||2689<=_&&_<=2690||_==2748||2753<=_&&_<=2757||2759<=_&&_<=2760||_==2765||2786<=_&&_<=2787||2810<=_&&_<=2815||_==2817||_==2876||_==2878||_==2879||2881<=_&&_<=2884||_==2893||_==2902||_==2903||2914<=_&&_<=2915||_==2946||_==3006||_==3008||_==3021||_==3031||_==3072||3134<=_&&_<=3136||3142<=_&&_<=3144||3146<=_&&_<=3149||3157<=_&&_<=3158||3170<=_&&_<=3171||_==3201||_==3260||_==3263||_==3266||_==3270||3276<=_&&_<=3277||3285<=_&&_<=3286||3298<=_&&_<=3299||3328<=_&&_<=3329||3387<=_&&_<=3388||_==3390||3393<=_&&_<=3396||_==3405||_==3415||3426<=_&&_<=3427||_==3530||_==3535||3538<=_&&_<=3540||_==3542||_==3551||_==3633||3636<=_&&_<=3642||3655<=_&&_<=3662||_==3761||3764<=_&&_<=3769||3771<=_&&_<=3772||3784<=_&&_<=3789||3864<=_&&_<=3865||_==3893||_==3895||_==3897||3953<=_&&_<=3966||3968<=_&&_<=3972||3974<=_&&_<=3975||3981<=_&&_<=3991||3993<=_&&_<=4028||_==4038||4141<=_&&_<=4144||4146<=_&&_<=4151||4153<=_&&_<=4154||4157<=_&&_<=4158||4184<=_&&_<=4185||4190<=_&&_<=4192||4209<=_&&_<=4212||_==4226||4229<=_&&_<=4230||_==4237||_==4253||4957<=_&&_<=4959||5906<=_&&_<=5908||5938<=_&&_<=5940||5970<=_&&_<=5971||6002<=_&&_<=6003||6068<=_&&_<=6069||6071<=_&&_<=6077||_==6086||6089<=_&&_<=6099||_==6109||6155<=_&&_<=6157||6277<=_&&_<=6278||_==6313||6432<=_&&_<=6434||6439<=_&&_<=6440||_==6450||6457<=_&&_<=6459||6679<=_&&_<=6680||_==6683||_==6742||6744<=_&&_<=6750||_==6752||_==6754||6757<=_&&_<=6764||6771<=_&&_<=6780||_==6783||6832<=_&&_<=6845||_==6846||6912<=_&&_<=6915||_==6964||6966<=_&&_<=6970||_==6972||_==6978||7019<=_&&_<=7027||7040<=_&&_<=7041||7074<=_&&_<=7077||7080<=_&&_<=7081||7083<=_&&_<=7085||_==7142||7144<=_&&_<=7145||_==7149||7151<=_&&_<=7153||7212<=_&&_<=7219||7222<=_&&_<=7223||7376<=_&&_<=7378||7380<=_&&_<=7392||7394<=_&&_<=7400||_==7405||_==7412||7416<=_&&_<=7417||7616<=_&&_<=7673||7675<=_&&_<=7679||_==8204||8400<=_&&_<=8412||8413<=_&&_<=8416||_==8417||8418<=_&&_<=8420||8421<=_&&_<=8432||11503<=_&&_<=11505||_==11647||11744<=_&&_<=11775||12330<=_&&_<=12333||12334<=_&&_<=12335||12441<=_&&_<=12442||_==42607||42608<=_&&_<=42610||42612<=_&&_<=42621||42654<=_&&_<=42655||42736<=_&&_<=42737||_==43010||_==43014||_==43019||43045<=_&&_<=43046||43204<=_&&_<=43205||43232<=_&&_<=43249||43302<=_&&_<=43309||43335<=_&&_<=43345||43392<=_&&_<=43394||_==43443||43446<=_&&_<=43449||_==43452||_==43493||43561<=_&&_<=43566||43569<=_&&_<=43570||43573<=_&&_<=43574||_==43587||_==43596||_==43644||_==43696||43698<=_&&_<=43700||43703<=_&&_<=43704||43710<=_&&_<=43711||_==43713||43756<=_&&_<=43757||_==43766||_==44005||_==44008||_==44013||_==64286||65024<=_&&_<=65039||65056<=_&&_<=65071||65438<=_&&_<=65439||_==66045||_==66272||66422<=_&&_<=66426||68097<=_&&_<=68099||68101<=_&&_<=68102||68108<=_&&_<=68111||68152<=_&&_<=68154||_==68159||68325<=_&&_<=68326||_==69633||69688<=_&&_<=69702||69759<=_&&_<=69761||69811<=_&&_<=69814||69817<=_&&_<=69818||69888<=_&&_<=69890||69927<=_&&_<=69931||69933<=_&&_<=69940||_==70003||70016<=_&&_<=70017||70070<=_&&_<=70078||70090<=_&&_<=70092||70191<=_&&_<=70193||_==70196||70198<=_&&_<=70199||_==70206||_==70367||70371<=_&&_<=70378||70400<=_&&_<=70401||_==70460||_==70462||_==70464||_==70487||70502<=_&&_<=70508||70512<=_&&_<=70516||70712<=_&&_<=70719||70722<=_&&_<=70724||_==70726||_==70832||70835<=_&&_<=70840||_==70842||_==70845||70847<=_&&_<=70848||70850<=_&&_<=70851||_==71087||71090<=_&&_<=71093||71100<=_&&_<=71101||71103<=_&&_<=71104||71132<=_&&_<=71133||71219<=_&&_<=71226||_==71229||71231<=_&&_<=71232||_==71339||_==71341||71344<=_&&_<=71349||_==71351||71453<=_&&_<=71455||71458<=_&&_<=71461||71463<=_&&_<=71467||72193<=_&&_<=72198||72201<=_&&_<=72202||72243<=_&&_<=72248||72251<=_&&_<=72254||_==72263||72273<=_&&_<=72278||72281<=_&&_<=72283||72330<=_&&_<=72342||72344<=_&&_<=72345||72752<=_&&_<=72758||72760<=_&&_<=72765||_==72767||72850<=_&&_<=72871||72874<=_&&_<=72880||72882<=_&&_<=72883||72885<=_&&_<=72886||73009<=_&&_<=73014||_==73018||73020<=_&&_<=73021||73023<=_&&_<=73029||_==73031||92912<=_&&_<=92916||92976<=_&&_<=92982||94095<=_&&_<=94098||113821<=_&&_<=113822||_==119141||119143<=_&&_<=119145||119150<=_&&_<=119154||119163<=_&&_<=119170||119173<=_&&_<=119179||119210<=_&&_<=119213||119362<=_&&_<=119364||121344<=_&&_<=121398||121403<=_&&_<=121452||_==121461||_==121476||121499<=_&&_<=121503||121505<=_&&_<=121519||122880<=_&&_<=122886||122888<=_&&_<=122904||122907<=_&&_<=122913||122915<=_&&_<=122916||122918<=_&&_<=122922||125136<=_&&_<=125142||125252<=_&&_<=125258||917536<=_&&_<=917631||917760<=_&&_<=917999?i:127462<=_&&_<=127487?r:_==2307||_==2363||2366<=_&&_<=2368||2377<=_&&_<=2380||2382<=_&&_<=2383||2434<=_&&_<=2435||2495<=_&&_<=2496||2503<=_&&_<=2504||2507<=_&&_<=2508||_==2563||2622<=_&&_<=2624||_==2691||2750<=_&&_<=2752||_==2761||2763<=_&&_<=2764||2818<=_&&_<=2819||_==2880||2887<=_&&_<=2888||2891<=_&&_<=2892||_==3007||3009<=_&&_<=3010||3014<=_&&_<=3016||3018<=_&&_<=3020||3073<=_&&_<=3075||3137<=_&&_<=3140||3202<=_&&_<=3203||_==3262||3264<=_&&_<=3265||3267<=_&&_<=3268||3271<=_&&_<=3272||3274<=_&&_<=3275||3330<=_&&_<=3331||3391<=_&&_<=3392||3398<=_&&_<=3400||3402<=_&&_<=3404||3458<=_&&_<=3459||3536<=_&&_<=3537||3544<=_&&_<=3550||3570<=_&&_<=3571||_==3635||_==3763||3902<=_&&_<=3903||_==3967||_==4145||4155<=_&&_<=4156||4182<=_&&_<=4183||_==4228||_==6070||6078<=_&&_<=6085||6087<=_&&_<=6088||6435<=_&&_<=6438||6441<=_&&_<=6443||6448<=_&&_<=6449||6451<=_&&_<=6456||6681<=_&&_<=6682||_==6741||_==6743||6765<=_&&_<=6770||_==6916||_==6965||_==6971||6973<=_&&_<=6977||6979<=_&&_<=6980||_==7042||_==7073||7078<=_&&_<=7079||_==7082||_==7143||7146<=_&&_<=7148||_==7150||7154<=_&&_<=7155||7204<=_&&_<=7211||7220<=_&&_<=7221||_==7393||7410<=_&&_<=7411||_==7415||43043<=_&&_<=43044||_==43047||43136<=_&&_<=43137||43188<=_&&_<=43203||43346<=_&&_<=43347||_==43395||43444<=_&&_<=43445||43450<=_&&_<=43451||43453<=_&&_<=43456||43567<=_&&_<=43568||43571<=_&&_<=43572||_==43597||_==43755||43758<=_&&_<=43759||_==43765||44003<=_&&_<=44004||44006<=_&&_<=44007||44009<=_&&_<=44010||_==44012||_==69632||_==69634||_==69762||69808<=_&&_<=69810||69815<=_&&_<=69816||_==69932||_==70018||70067<=_&&_<=70069||70079<=_&&_<=70080||70188<=_&&_<=70190||70194<=_&&_<=70195||_==70197||70368<=_&&_<=70370||70402<=_&&_<=70403||_==70463||70465<=_&&_<=70468||70471<=_&&_<=70472||70475<=_&&_<=70477||70498<=_&&_<=70499||70709<=_&&_<=70711||70720<=_&&_<=70721||_==70725||70833<=_&&_<=70834||_==70841||70843<=_&&_<=70844||_==70846||_==70849||71088<=_&&_<=71089||71096<=_&&_<=71099||_==71102||71216<=_&&_<=71218||71227<=_&&_<=71228||_==71230||_==71340||71342<=_&&_<=71343||_==71350||71456<=_&&_<=71457||_==71462||72199<=_&&_<=72200||_==72249||72279<=_&&_<=72280||_==72343||_==72751||_==72766||_==72873||_==72881||_==72884||94033<=_&&_<=94078||_==119142||_==119149?o:4352<=_&&_<=4447||43360<=_&&_<=43388?s:4448<=_&&_<=4519||55216<=_&&_<=55238?a:4520<=_&&_<=4607||55243<=_&&_<=55291?c:_==44032||_==44060||_==44088||_==44116||_==44144||_==44172||_==44200||_==44228||_==44256||_==44284||_==44312||_==44340||_==44368||_==44396||_==44424||_==44452||_==44480||_==44508||_==44536||_==44564||_==44592||_==44620||_==44648||_==44676||_==44704||_==44732||_==44760||_==44788||_==44816||_==44844||_==44872||_==44900||_==44928||_==44956||_==44984||_==45012||_==45040||_==45068||_==45096||_==45124||_==45152||_==45180||_==45208||_==45236||_==45264||_==45292||_==45320||_==45348||_==45376||_==45404||_==45432||_==45460||_==45488||_==45516||_==45544||_==45572||_==45600||_==45628||_==45656||_==45684||_==45712||_==45740||_==45768||_==45796||_==45824||_==45852||_==45880||_==45908||_==45936||_==45964||_==45992||_==46020||_==46048||_==46076||_==46104||_==46132||_==46160||_==46188||_==46216||_==46244||_==46272||_==46300||_==46328||_==46356||_==46384||_==46412||_==46440||_==46468||_==46496||_==46524||_==46552||_==46580||_==46608||_==46636||_==46664||_==46692||_==46720||_==46748||_==46776||_==46804||_==46832||_==46860||_==46888||_==46916||_==46944||_==46972||_==47e3||_==47028||_==47056||_==47084||_==47112||_==47140||_==47168||_==47196||_==47224||_==47252||_==47280||_==47308||_==47336||_==47364||_==47392||_==47420||_==47448||_==47476||_==47504||_==47532||_==47560||_==47588||_==47616||_==47644||_==47672||_==47700||_==47728||_==47756||_==47784||_==47812||_==47840||_==47868||_==47896||_==47924||_==47952||_==47980||_==48008||_==48036||_==48064||_==48092||_==48120||_==48148||_==48176||_==48204||_==48232||_==48260||_==48288||_==48316||_==48344||_==48372||_==48400||_==48428||_==48456||_==48484||_==48512||_==48540||_==48568||_==48596||_==48624||_==48652||_==48680||_==48708||_==48736||_==48764||_==48792||_==48820||_==48848||_==48876||_==48904||_==48932||_==48960||_==48988||_==49016||_==49044||_==49072||_==49100||_==49128||_==49156||_==49184||_==49212||_==49240||_==49268||_==49296||_==49324||_==49352||_==49380||_==49408||_==49436||_==49464||_==49492||_==49520||_==49548||_==49576||_==49604||_==49632||_==49660||_==49688||_==49716||_==49744||_==49772||_==49800||_==49828||_==49856||_==49884||_==49912||_==49940||_==49968||_==49996||_==50024||_==50052||_==50080||_==50108||_==50136||_==50164||_==50192||_==50220||_==50248||_==50276||_==50304||_==50332||_==50360||_==50388||_==50416||_==50444||_==50472||_==50500||_==50528||_==50556||_==50584||_==50612||_==50640||_==50668||_==50696||_==50724||_==50752||_==50780||_==50808||_==50836||_==50864||_==50892||_==50920||_==50948||_==50976||_==51004||_==51032||_==51060||_==51088||_==51116||_==51144||_==51172||_==51200||_==51228||_==51256||_==51284||_==51312||_==51340||_==51368||_==51396||_==51424||_==51452||_==51480||_==51508||_==51536||_==51564||_==51592||_==51620||_==51648||_==51676||_==51704||_==51732||_==51760||_==51788||_==51816||_==51844||_==51872||_==51900||_==51928||_==51956||_==51984||_==52012||_==52040||_==52068||_==52096||_==52124||_==52152||_==52180||_==52208||_==52236||_==52264||_==52292||_==52320||_==52348||_==52376||_==52404||_==52432||_==52460||_==52488||_==52516||_==52544||_==52572||_==52600||_==52628||_==52656||_==52684||_==52712||_==52740||_==52768||_==52796||_==52824||_==52852||_==52880||_==52908||_==52936||_==52964||_==52992||_==53020||_==53048||_==53076||_==53104||_==53132||_==53160||_==53188||_==53216||_==53244||_==53272||_==53300||_==53328||_==53356||_==53384||_==53412||_==53440||_==53468||_==53496||_==53524||_==53552||_==53580||_==53608||_==53636||_==53664||_==53692||_==53720||_==53748||_==53776||_==53804||_==53832||_==53860||_==53888||_==53916||_==53944||_==53972||_==54e3||_==54028||_==54056||_==54084||_==54112||_==54140||_==54168||_==54196||_==54224||_==54252||_==54280||_==54308||_==54336||_==54364||_==54392||_==54420||_==54448||_==54476||_==54504||_==54532||_==54560||_==54588||_==54616||_==54644||_==54672||_==54700||_==54728||_==54756||_==54784||_==54812||_==54840||_==54868||_==54896||_==54924||_==54952||_==54980||_==55008||_==55036||_==55064||_==55092||_==55120||_==55148||_==55176?u:44033<=_&&_<=44059||44061<=_&&_<=44087||44089<=_&&_<=44115||44117<=_&&_<=44143||44145<=_&&_<=44171||44173<=_&&_<=44199||44201<=_&&_<=44227||44229<=_&&_<=44255||44257<=_&&_<=44283||44285<=_&&_<=44311||44313<=_&&_<=44339||44341<=_&&_<=44367||44369<=_&&_<=44395||44397<=_&&_<=44423||44425<=_&&_<=44451||44453<=_&&_<=44479||44481<=_&&_<=44507||44509<=_&&_<=44535||44537<=_&&_<=44563||44565<=_&&_<=44591||44593<=_&&_<=44619||44621<=_&&_<=44647||44649<=_&&_<=44675||44677<=_&&_<=44703||44705<=_&&_<=44731||44733<=_&&_<=44759||44761<=_&&_<=44787||44789<=_&&_<=44815||44817<=_&&_<=44843||44845<=_&&_<=44871||44873<=_&&_<=44899||44901<=_&&_<=44927||44929<=_&&_<=44955||44957<=_&&_<=44983||44985<=_&&_<=45011||45013<=_&&_<=45039||45041<=_&&_<=45067||45069<=_&&_<=45095||45097<=_&&_<=45123||45125<=_&&_<=45151||45153<=_&&_<=45179||45181<=_&&_<=45207||45209<=_&&_<=45235||45237<=_&&_<=45263||45265<=_&&_<=45291||45293<=_&&_<=45319||45321<=_&&_<=45347||45349<=_&&_<=45375||45377<=_&&_<=45403||45405<=_&&_<=45431||45433<=_&&_<=45459||45461<=_&&_<=45487||45489<=_&&_<=45515||45517<=_&&_<=45543||45545<=_&&_<=45571||45573<=_&&_<=45599||45601<=_&&_<=45627||45629<=_&&_<=45655||45657<=_&&_<=45683||45685<=_&&_<=45711||45713<=_&&_<=45739||45741<=_&&_<=45767||45769<=_&&_<=45795||45797<=_&&_<=45823||45825<=_&&_<=45851||45853<=_&&_<=45879||45881<=_&&_<=45907||45909<=_&&_<=45935||45937<=_&&_<=45963||45965<=_&&_<=45991||45993<=_&&_<=46019||46021<=_&&_<=46047||46049<=_&&_<=46075||46077<=_&&_<=46103||46105<=_&&_<=46131||46133<=_&&_<=46159||46161<=_&&_<=46187||46189<=_&&_<=46215||46217<=_&&_<=46243||46245<=_&&_<=46271||46273<=_&&_<=46299||46301<=_&&_<=46327||46329<=_&&_<=46355||46357<=_&&_<=46383||46385<=_&&_<=46411||46413<=_&&_<=46439||46441<=_&&_<=46467||46469<=_&&_<=46495||46497<=_&&_<=46523||46525<=_&&_<=46551||46553<=_&&_<=46579||46581<=_&&_<=46607||46609<=_&&_<=46635||46637<=_&&_<=46663||46665<=_&&_<=46691||46693<=_&&_<=46719||46721<=_&&_<=46747||46749<=_&&_<=46775||46777<=_&&_<=46803||46805<=_&&_<=46831||46833<=_&&_<=46859||46861<=_&&_<=46887||46889<=_&&_<=46915||46917<=_&&_<=46943||46945<=_&&_<=46971||46973<=_&&_<=46999||47001<=_&&_<=47027||47029<=_&&_<=47055||47057<=_&&_<=47083||47085<=_&&_<=47111||47113<=_&&_<=47139||47141<=_&&_<=47167||47169<=_&&_<=47195||47197<=_&&_<=47223||47225<=_&&_<=47251||47253<=_&&_<=47279||47281<=_&&_<=47307||47309<=_&&_<=47335||47337<=_&&_<=47363||47365<=_&&_<=47391||47393<=_&&_<=47419||47421<=_&&_<=47447||47449<=_&&_<=47475||47477<=_&&_<=47503||47505<=_&&_<=47531||47533<=_&&_<=47559||47561<=_&&_<=47587||47589<=_&&_<=47615||47617<=_&&_<=47643||47645<=_&&_<=47671||47673<=_&&_<=47699||47701<=_&&_<=47727||47729<=_&&_<=47755||47757<=_&&_<=47783||47785<=_&&_<=47811||47813<=_&&_<=47839||47841<=_&&_<=47867||47869<=_&&_<=47895||47897<=_&&_<=47923||47925<=_&&_<=47951||47953<=_&&_<=47979||47981<=_&&_<=48007||48009<=_&&_<=48035||48037<=_&&_<=48063||48065<=_&&_<=48091||48093<=_&&_<=48119||48121<=_&&_<=48147||48149<=_&&_<=48175||48177<=_&&_<=48203||48205<=_&&_<=48231||48233<=_&&_<=48259||48261<=_&&_<=48287||48289<=_&&_<=48315||48317<=_&&_<=48343||48345<=_&&_<=48371||48373<=_&&_<=48399||48401<=_&&_<=48427||48429<=_&&_<=48455||48457<=_&&_<=48483||48485<=_&&_<=48511||48513<=_&&_<=48539||48541<=_&&_<=48567||48569<=_&&_<=48595||48597<=_&&_<=48623||48625<=_&&_<=48651||48653<=_&&_<=48679||48681<=_&&_<=48707||48709<=_&&_<=48735||48737<=_&&_<=48763||48765<=_&&_<=48791||48793<=_&&_<=48819||48821<=_&&_<=48847||48849<=_&&_<=48875||48877<=_&&_<=48903||48905<=_&&_<=48931||48933<=_&&_<=48959||48961<=_&&_<=48987||48989<=_&&_<=49015||49017<=_&&_<=49043||49045<=_&&_<=49071||49073<=_&&_<=49099||49101<=_&&_<=49127||49129<=_&&_<=49155||49157<=_&&_<=49183||49185<=_&&_<=49211||49213<=_&&_<=49239||49241<=_&&_<=49267||49269<=_&&_<=49295||49297<=_&&_<=49323||49325<=_&&_<=49351||49353<=_&&_<=49379||49381<=_&&_<=49407||49409<=_&&_<=49435||49437<=_&&_<=49463||49465<=_&&_<=49491||49493<=_&&_<=49519||49521<=_&&_<=49547||49549<=_&&_<=49575||49577<=_&&_<=49603||49605<=_&&_<=49631||49633<=_&&_<=49659||49661<=_&&_<=49687||49689<=_&&_<=49715||49717<=_&&_<=49743||49745<=_&&_<=49771||49773<=_&&_<=49799||49801<=_&&_<=49827||49829<=_&&_<=49855||49857<=_&&_<=49883||49885<=_&&_<=49911||49913<=_&&_<=49939||49941<=_&&_<=49967||49969<=_&&_<=49995||49997<=_&&_<=50023||50025<=_&&_<=50051||50053<=_&&_<=50079||50081<=_&&_<=50107||50109<=_&&_<=50135||50137<=_&&_<=50163||50165<=_&&_<=50191||50193<=_&&_<=50219||50221<=_&&_<=50247||50249<=_&&_<=50275||50277<=_&&_<=50303||50305<=_&&_<=50331||50333<=_&&_<=50359||50361<=_&&_<=50387||50389<=_&&_<=50415||50417<=_&&_<=50443||50445<=_&&_<=50471||50473<=_&&_<=50499||50501<=_&&_<=50527||50529<=_&&_<=50555||50557<=_&&_<=50583||50585<=_&&_<=50611||50613<=_&&_<=50639||50641<=_&&_<=50667||50669<=_&&_<=50695||50697<=_&&_<=50723||50725<=_&&_<=50751||50753<=_&&_<=50779||50781<=_&&_<=50807||50809<=_&&_<=50835||50837<=_&&_<=50863||50865<=_&&_<=50891||50893<=_&&_<=50919||50921<=_&&_<=50947||50949<=_&&_<=50975||50977<=_&&_<=51003||51005<=_&&_<=51031||51033<=_&&_<=51059||51061<=_&&_<=51087||51089<=_&&_<=51115||51117<=_&&_<=51143||51145<=_&&_<=51171||51173<=_&&_<=51199||51201<=_&&_<=51227||51229<=_&&_<=51255||51257<=_&&_<=51283||51285<=_&&_<=51311||51313<=_&&_<=51339||51341<=_&&_<=51367||51369<=_&&_<=51395||51397<=_&&_<=51423||51425<=_&&_<=51451||51453<=_&&_<=51479||51481<=_&&_<=51507||51509<=_&&_<=51535||51537<=_&&_<=51563||51565<=_&&_<=51591||51593<=_&&_<=51619||51621<=_&&_<=51647||51649<=_&&_<=51675||51677<=_&&_<=51703||51705<=_&&_<=51731||51733<=_&&_<=51759||51761<=_&&_<=51787||51789<=_&&_<=51815||51817<=_&&_<=51843||51845<=_&&_<=51871||51873<=_&&_<=51899||51901<=_&&_<=51927||51929<=_&&_<=51955||51957<=_&&_<=51983||51985<=_&&_<=52011||52013<=_&&_<=52039||52041<=_&&_<=52067||52069<=_&&_<=52095||52097<=_&&_<=52123||52125<=_&&_<=52151||52153<=_&&_<=52179||52181<=_&&_<=52207||52209<=_&&_<=52235||52237<=_&&_<=52263||52265<=_&&_<=52291||52293<=_&&_<=52319||52321<=_&&_<=52347||52349<=_&&_<=52375||52377<=_&&_<=52403||52405<=_&&_<=52431||52433<=_&&_<=52459||52461<=_&&_<=52487||52489<=_&&_<=52515||52517<=_&&_<=52543||52545<=_&&_<=52571||52573<=_&&_<=52599||52601<=_&&_<=52627||52629<=_&&_<=52655||52657<=_&&_<=52683||52685<=_&&_<=52711||52713<=_&&_<=52739||52741<=_&&_<=52767||52769<=_&&_<=52795||52797<=_&&_<=52823||52825<=_&&_<=52851||52853<=_&&_<=52879||52881<=_&&_<=52907||52909<=_&&_<=52935||52937<=_&&_<=52963||52965<=_&&_<=52991||52993<=_&&_<=53019||53021<=_&&_<=53047||53049<=_&&_<=53075||53077<=_&&_<=53103||53105<=_&&_<=53131||53133<=_&&_<=53159||53161<=_&&_<=53187||53189<=_&&_<=53215||53217<=_&&_<=53243||53245<=_&&_<=53271||53273<=_&&_<=53299||53301<=_&&_<=53327||53329<=_&&_<=53355||53357<=_&&_<=53383||53385<=_&&_<=53411||53413<=_&&_<=53439||53441<=_&&_<=53467||53469<=_&&_<=53495||53497<=_&&_<=53523||53525<=_&&_<=53551||53553<=_&&_<=53579||53581<=_&&_<=53607||53609<=_&&_<=53635||53637<=_&&_<=53663||53665<=_&&_<=53691||53693<=_&&_<=53719||53721<=_&&_<=53747||53749<=_&&_<=53775||53777<=_&&_<=53803||53805<=_&&_<=53831||53833<=_&&_<=53859||53861<=_&&_<=53887||53889<=_&&_<=53915||53917<=_&&_<=53943||53945<=_&&_<=53971||53973<=_&&_<=53999||54001<=_&&_<=54027||54029<=_&&_<=54055||54057<=_&&_<=54083||54085<=_&&_<=54111||54113<=_&&_<=54139||54141<=_&&_<=54167||54169<=_&&_<=54195||54197<=_&&_<=54223||54225<=_&&_<=54251||54253<=_&&_<=54279||54281<=_&&_<=54307||54309<=_&&_<=54335||54337<=_&&_<=54363||54365<=_&&_<=54391||54393<=_&&_<=54419||54421<=_&&_<=54447||54449<=_&&_<=54475||54477<=_&&_<=54503||54505<=_&&_<=54531||54533<=_&&_<=54559||54561<=_&&_<=54587||54589<=_&&_<=54615||54617<=_&&_<=54643||54645<=_&&_<=54671||54673<=_&&_<=54699||54701<=_&&_<=54727||54729<=_&&_<=54755||54757<=_&&_<=54783||54785<=_&&_<=54811||54813<=_&&_<=54839||54841<=_&&_<=54867||54869<=_&&_<=54895||54897<=_&&_<=54923||54925<=_&&_<=54951||54953<=_&&_<=54979||54981<=_&&_<=55007||55009<=_&&_<=55035||55037<=_&&_<=55063||55065<=_&&_<=55091||55093<=_&&_<=55119||55121<=_&&_<=55147||55149<=_&&_<=55175||55177<=_&&_<=55203?f:_==9757||_==9977||9994<=_&&_<=9997||_==127877||127938<=_&&_<=127940||_==127943||127946<=_&&_<=127948||128066<=_&&_<=128067||128070<=_&&_<=128080||_==128110||128112<=_&&_<=128120||_==128124||128129<=_&&_<=128131||128133<=_&&_<=128135||_==128170||128372<=_&&_<=128373||_==128378||_==128400||128405<=_&&_<=128406||128581<=_&&_<=128583||128587<=_&&_<=128591||_==128675||128692<=_&&_<=128694||_==128704||_==128716||129304<=_&&_<=129308||129310<=_&&_<=129311||_==129318||129328<=_&&_<=129337||129341<=_&&_<=129342||129489<=_&&_<=129501?g:127995<=_&&_<=127999?m:_==8205?y:_==9792||_==9794||9877<=_&&_<=9878||_==9992||_==10084||_==127752||_==127806||_==127859||_==127891||_==127908||_==127912||_==127979||_==127981||_==128139||128187<=_&&_<=128188||_==128295||_==128300||_==128488||_==128640||_==128658?A:128102<=_&&_<=128105?b:d}return this}typeof s4<"u"&&s4.exports&&(s4.exports=jlt)});var Kee,KS,ke,oT,Uu,Po,Xve,sT,Kve,$ve,dr,cc=Cs(()=>{Kee=new Date(2107,11,31,23,59,58),KS=new Date(1980,0,1),ke=void 0,oT=1/0,Uu="undefined",Po="function",Xve="object",sT="string",Kve="number",$ve="boolean",dr=new Uint8Array});function JS(e){if(e&&typeof e!=Po)throw new Error(PSe);return e}function Vj(e){if(e&&(typeof e.addEventListener!=Po||typeof e.aborted!=$ve))throw new Error(DSe);return e||ke}function jj(e,t){if(e&&typeof e!=sT||t&&!(t instanceof Uint8Array))throw new Error(Zee)}function Qee(e,t,n){if(!Number.isInteger(e)||e<0||e>t)throw new Error(n)}function ZS(e,t,n){e!==ke&&Qee(e,t,n)}function aT(e){return typeof e==sT&&e.trim()?Number(e):e}var Jve,Zve,Qve,eSe,tSe,Dj,Rj,Oj,Mj,nSe,iSe,rSe,oSe,sSe,aSe,cSe,lSe,Nj,Lj,Fj,Bj,uSe,fSe,dSe,hSe,mSe,pSe,gSe,_Se,ySe,$ee,ASe,bSe,OR,$S,xSe,TSe,ESe,CSe,vSe,SSe,Jee,wSe,ISe,kj,Uj,AA,zj,zg,PSe,DSe,Zee,MR=Cs(()=>{cc();Jve="filenameEncoding",Zve="commentEncoding",Qve="decodeText",eSe="extractPrependedData",tSe="extractAppendedData",Dj="password",Rj="rawPassword",Oj="passThrough",Mj="signal",nSe="checkPasswordOnly",iSe="checkOverlappingEntryOnly",rSe="checkOverlappingEntry",oSe="checkAmbiguity",sSe="checkLocalDirectory",aSe="checkSignature",cSe="checkCrc32",lSe="checkAuthenticationCode",Nj="useWebWorkers",Lj="useCompressionStream",Fj="transferStreams",Bj="preventClose",uSe="encryptionStrength",fSe="extendedTimestamp",dSe="ntfsTimestamp",hSe="keepOrder",mSe="level",pSe="bufferedWrite",gSe="createTempStream",_Se="dataDescriptorSignature",ySe="useUnicodeFileNames",$ee="dataDescriptor",ASe="supportZip64SplitFile",bSe="encodeText",OR="offset",$S="usdz",xSe="unixExtraFieldType",TSe="localExtraField",ESe="centralExtraField",CSe="strictness",vSe="filenameValidation",SSe="normalizeFilename",Jee="maxAppendedDataSize",wSe="decryptCentralDirectory",ISe="signCentralDirectory",kj="filename",Uj="comment",AA="strict",zj="balanced",zg="tolerant",PSe="Invalid option (must be a function)",DSe="Invalid signal (must be an AbortSignal instance)",Zee="Invalid password (password must be a string, rawPassword must be a Uint8Array)"});function Vg(){return ete}function NR(e){return tte(e.chunkSize)}function tte(e){return e=aT(e),Number.isInteger(e)&&e>=OSe?Math.max(e,fxt):RSe}function LR(e){Object.assign(ete,USe(zSe(e)))}function USe(e){let t={};for(let n of mxt){let i=e[n];i!==ke&&(t[n]=pxt(n,i))}return t}function pxt(e,t){if(BSe.includes(e)){if(t=aT(t),e==FSe&&(!Number.isInteger(t)||t<OSe))throw new Error(MSe)}else kSe.includes(e)&&JS(t);return t}function zSe(e){e=e||{};let{CompressionStreamZlib:t,DecompressionStreamZlib:n}=e;if(t===ke&&n===ke)return e;let i=Object.assign({},e);return i.CompressionStreamFallback===ke&&(i.CompressionStreamFallback=t),i.DecompressionStreamFallback===ke&&(i.DecompressionStreamFallback=n),i}function QS(e){let t=USe(zSe(e));Object.assign(LSe,t),Object.assign(ete,t)}var RSe,fxt,OSe,MSe,NSe,LSe,FSe,dxt,hxt,BSe,kSe,mxt,ete,Gp=Cs(()=>{cc();MR();RSe=64*1024,fxt=64,OSe=1,MSe="Invalid maxWorkers (must be an integer greater than 0)",NSe=2;try{typeof navigator!=Uu&&navigator.hardwareConcurrency&&(NSe=navigator.hardwareConcurrency)}catch{}LSe={workerURI:"./core/web-worker-wasm.js",wasmURI:"./core/streams/zlib-wasm/zlib-streams.wasm",chunkSize:RSe,maxWorkers:NSe,terminateWorkerTimeout:5e3,workerStarvationTimeout:5e3,workerStartupTimeout:5e3,useWebWorkers:!0,useCompressionStream:!0,transferStreams:!0,CompressionStream:typeof CompressionStream!=Uu&&CompressionStream,DecompressionStream:typeof DecompressionStream!=Uu&&DecompressionStream},FSe="maxWorkers",dxt=["baseURI","wasmURI","workerURI"],hxt=["useCompressionStream","useWebWorkers","transferStreams"],BSe=["chunkSize",FSe,"terminateWorkerTimeout","workerStarvationTimeout","workerStartupTimeout"],kSe=["createWorker","CompressionStream","DecompressionStream","CompressionStreamFallback","DecompressionStreamFallback"],mxt=[...dxt,...hxt,...BSe,...kSe],ete={...LSe}});function Gd(e,t){let n=new Uint8Array(e.length+t.length);return n.set(e),n.set(t,e.length),n}function Hj(e){return e.byteOffset||e.byteLength!=e.buffer.byteLength?new Uint8Array(e):e}function li(e){return new DataView(e.buffer,e.byteOffset,e.byteLength)}var cT=Cs(()=>{});var FR,VSe,gxt,_xt,yxt,Axt,bxt,xxt,Txt,sm,BR=Cs(()=>{FR=[[],[],[],[],[],[],[],[]];for(let e=0;e<256;e++){let t=e;for(let n=0;n<8;n++)t=t&1?t>>>1^3988292384:t>>>1;FR[0][e]=t}for(let e=0;e<256;e++)for(let t=1;t<8;t++){let n=FR[t-1][e];FR[t][e]=n>>>8^FR[0][n&255]}[VSe,gxt,_xt,yxt,Axt,bxt,xxt,Txt]=FR,sm=class{constructor(t){this.crc=t||-1}append(t){let n=this.crc|0,i=t.length|0,r=0;if(i>=8&&t.buffer){let o=new DataView(t.buffer,t.byteOffset,i),s=i-8;for(;r<=s;r+=8){let a=n^o.getInt32(r,!0),c=o.getInt32(r+4,!0);n=Txt[a&255]^xxt[a>>>8&255]^bxt[a>>>16&255]^Axt[a>>>24&255]^yxt[c&255]^_xt[c>>>8&255]^gxt[c>>>16&255]^VSe[c>>>24&255]}}for(;r<i;r++)n=n>>>8^VSe[(n^t[r])&255];this.crc=n}get(){return~this.crc}}});var kR,jSe=Cs(()=>{BR();kR=class extends TransformStream{constructor(){let t,n=new sm;super({transform(i,r){n.append(i),r.enqueue(i)},flush(){let i=new Uint8Array(4);new DataView(i.buffer).setUint32(0,n.get()),t.value=i}}),t=this}}});function ew(e){if(typeof TextEncoder==Uu){e=unescape(encodeURIComponent(e));let t=new Uint8Array(e.length);for(let n=0;n<t.length;n++)t[n]=e.charCodeAt(n);return t}else return new TextEncoder().encode(e)}var nte=Cs(()=>{cc()});var Yl,UR,HSe,ite,rte,bA,GSe=Cs(()=>{Yl={concat(e,t){if(e.length===0||t.length===0)return e.concat(t);let n=e[e.length-1],i=Yl.getPartial(n);return i===32?e.concat(t):Yl._shiftRight(t,i,n|0,e.slice(0,e.length-1))},bitLength(e){let t=e.length;if(t===0)return 0;let n=e[t-1];return(t-1)*32+Yl.getPartial(n)},clamp(e,t){if(e.length*32<t)return e;e=e.slice(0,Math.ceil(t/32));let n=e.length;return t=t&31,n>0&&t&&(e[n-1]=Yl.partial(t,e[n-1]&2147483648>>t-1,1)),e},partial(e,t,n){return e===32?t:(n?t|0:t<<32-e)+e*1099511627776},getPartial(e){return Math.round(e/1099511627776)||32},_shiftRight(e,t,n,i){for(i===void 0&&(i=[]);t>=32;t-=32)i.push(n),n=0;if(t===0)return i.concat(e);for(let s=0;s<e.length;s++)i.push(n|e[s]>>>t),n=e[s]<<32-t;let r=e.length?e[e.length-1]:0,o=Yl.getPartial(r);return i.push(Yl.partial(t+o&31,t+o>32?n:i.pop(),1)),i}},UR={bytes:{fromBits(e){let n=Yl.bitLength(e)/8,i=new Uint8Array(n),r;for(let o=0;o<n;o++)(o&3)===0&&(r=e[o/4]),i[o]=r>>>24,r<<=8;return i},toBits(e){let t=[],n,i=0;for(n=0;n<e.length;n++)i=i<<8|e[n],(n&3)===3&&(t.push(i),i=0);return n&3&&t.push(Yl.partial(8*(n&3),i)),t}}},HSe={};HSe.sha1=class{constructor(e){let t=this;t.blockSize=512,t._init=[1732584193,4023233417,2562383102,271733878,3285377520],t._key=[1518500249,1859775393,2400959708,3395469782],e?(t._h=e._h.slice(0),t._buffer=e._buffer.slice(0),t._length=e._length):t.reset()}reset(){let e=this;return e._h=e._init.slice(0),e._buffer=[],e._length=0,e}update(e){let t=this;typeof e=="string"&&(e=UR.utf8String.toBits(e));let n=t._buffer=Yl.concat(t._buffer,e),i=t._length,r=t._length=i+Yl.bitLength(e);if(r>9007199254740991)throw new Error("Cannot hash more than 2^53 - 1 bits");let o=new Uint32Array(n),s=0;for(let a=t.blockSize+i-(t.blockSize+i&t.blockSize-1);a<=r;a+=t.blockSize)t._block(o.subarray(16*s,16*(s+1))),s+=1;return n.splice(0,16*s),t}finalize(){let e=this,t=e._buffer,n=e._h;t=Yl.concat(t,[Yl.partial(1,1)]);for(let i=t.length+2;i&15;i++)t.push(0);for(t.push(Math.floor(e._length/4294967296)),t.push(e._length|0);t.length;)e._block(t.splice(0,16));return e.reset(),n}_f(e,t,n,i){if(e<=19)return t&n|~t&i;if(e<=39)return t^n^i;if(e<=59)return t&n|t&i|n&i;if(e<=79)return t^n^i}_S(e,t){return t<<e|t>>>32-e}_block(e){let t=this,n=t._h,i=Array(80);for(let u=0;u<16;u++)i[u]=e[u];let r=n[0],o=n[1],s=n[2],a=n[3],c=n[4];for(let u=0;u<=79;u++){u>=16&&(i[u]=t._S(1,i[u-3]^i[u-8]^i[u-14]^i[u-16]));let f=t._S(5,r)+t._f(u,o,s,a)+c+i[u]+t._key[Math.floor(u/20)]|0;c=a,a=s,s=t._S(30,o),o=r,r=f}n[0]=n[0]+r|0,n[1]=n[1]+o|0,n[2]=n[2]+s|0,n[3]=n[3]+a|0,n[4]=n[4]+c|0}};ite={};ite.aes=class{constructor(e){let t=this;t._tables=[[[],[],[],[],[]],[[],[],[],[],[]]],t._tables[0][0][0]||t._precompute();let n=t._tables[0][4],i=t._tables[1],r=e.length,o,s,a,c=1;if(r!==4&&r!==6&&r!==8)throw new Error("invalid aes key size");for(t._key=[s=e.slice(0),a=[]],o=r;o<4*r+28;o++){let u=s[o-1];(o%r===0||r===8&&o%r===4)&&(u=n[u>>>24]<<24^n[u>>16&255]<<16^n[u>>8&255]<<8^n[u&255],o%r===0&&(u=u<<8^u>>>24^c<<24,c=c<<1^(c>>7)*283)),s[o]=s[o-r]^u}for(let u=0;o;u++,o--){let f=s[u&3?o:o-4];o<=4||u<4?a[u]=f:a[u]=i[0][n[f>>>24]]^i[1][n[f>>16&255]]^i[2][n[f>>8&255]]^i[3][n[f&255]]}}encrypt(e){return this._crypt(e,0)}decrypt(e){return this._crypt(e,1)}_precompute(){let e=this._tables[0],t=this._tables[1],n=e[4],i=t[4],r=[],o=[],s,a,c,u;for(let f=0;f<256;f++)o[(r[f]=f<<1^(f>>7)*283)^f]=f;for(let f=s=0;!n[f];f^=a||1,s=o[s]||1){let d=s^s<<1^s<<2^s<<3^s<<4;d=d>>8^d&255^99,n[f]=d,i[d]=f,u=r[c=r[a=r[f]]];let p=u*16843009^c*65537^a*257^f*16843008,g=r[d]*257^d*16843008;for(let m=0;m<4;m++)e[m][f]=g=g<<24^g>>>8,t[m][d]=p=p<<24^p>>>8}for(let f=0;f<5;f++)e[f]=e[f].slice(0),t[f]=t[f].slice(0)}_crypt(e,t){if(e.length!==4)throw new Error("invalid aes block size");let n=this._key[t],i=n.length/4-2,r=[0,0,0,0],o=this._tables[t],s=o[0],a=o[1],c=o[2],u=o[3],f=o[4],d=e[0]^n[0],p=e[t?3:1]^n[1],g=e[2]^n[2],m=e[t?1:3]^n[3],y=4,A,b,x;for(let T=0;T<i;T++)A=s[d>>>24]^a[p>>16&255]^c[g>>8&255]^u[m&255]^n[y],b=s[p>>>24]^a[g>>16&255]^c[m>>8&255]^u[d&255]^n[y+1],x=s[g>>>24]^a[m>>16&255]^c[d>>8&255]^u[p&255]^n[y+2],m=s[m>>>24]^a[d>>16&255]^c[p>>8&255]^u[g&255]^n[y+3],y+=4,d=A,p=b,g=x;for(let T=0;T<4;T++)r[t?3&-T:T]=f[d>>>24]<<24^f[p>>16&255]<<16^f[g>>8&255]<<8^f[m&255]^n[y++],A=d,d=p,p=g,g=m,m=A;return r}};rte={};rte.ctrGladman=class{constructor(e,t){this._prf=e,this._initIv=t,this._iv=t}reset(){this._iv=this._initIv}update(e){return this.calculate(this._prf,e,this._iv)}incWord(e){if((e>>24&255)===255){let t=e>>16&255,n=e>>8&255,i=e&255;t===255?(t=0,n===255?(n=0,i===255?i=0:++i):++n):++t,e=0,e+=t<<16,e+=n<<8,e+=i}else e+=1<<24;return e}incCounter(e){(e[0]=this.incWord(e[0]))===0&&(e[1]=this.incWord(e[1]))}calculate(e,t,n){let i;if(!(i=t.length))return[];let r=Yl.bitLength(t);for(let o=0;o<i;o+=4){this.incCounter(n);let s=e.encrypt(n);t[o]^=s[0],t[o+1]^=s[1],t[o+2]^=s[2],t[o+3]^=s[3]}return Yl.clamp(t,r)}};bA={importKey(e){return new bA.hmacSha1(UR.bytes.toBits(e))},pbkdf2(e,t,n,i){if(n=n||1e4,i<0||n<0)throw new Error("invalid params to pbkdf2");let r=(i>>5)+1<<2,o,s,a,c,u,f=new ArrayBuffer(r),d=new DataView(f),p=0,g=Yl;for(t=UR.bytes.toBits(t),u=1;p<(r||1);u++){for(o=s=e.encrypt(g.concat(t,[u])),a=1;a<n;a++)for(s=e.encrypt(s),c=0;c<s.length;c++)o[c]^=s[c];for(a=0;p<(r||1)&&a<o.length;a++)d.setInt32(p,o[a]),p+=4}return f.slice(0,i/8)}};bA.hmacSha1=class{constructor(e){let t=this,n=t._hash=HSe.sha1,i=[[],[]];t._baseHash=[new n,new n];let r=t._baseHash[0].blockSize/32;e.length>r&&(e=new n().update(e).finalize());for(let o=0;o<r;o++)i[0][o]=e[o]^909522486,i[1][o]=e[o]^1549556828;t._baseHash[0].update(i[0]),t._baseHash[1].update(i[1]),t._resultHash=new n(t._baseHash[0])}reset(){let e=this;e._resultHash=new e._hash(e._baseHash[0]),e._updated=!1}update(e){let t=this;t._updated=!0,t._resultHash.update(e)}digest(){let e=this,t=e._resultHash.finalize(),n=new e._hash(e._baseHash[1]).update(t).finalize();return e.reset(),n}encrypt(e){if(this._updated)throw new Error("encrypt on already updated hmac called!");return this.update(e),this.digest(e)}}});function Gj(e){if(Ext)return crypto.getRandomValues(e);throw new Error(tw)}var Ext,Wp,xA,TA,jg,tw,Wj=Cs(()=>{cc();Ext=typeof crypto!=Uu&&typeof crypto.getRandomValues==Po,Wp="Invalid password",xA="Invalid signature",TA=xA,jg="zipjs-abort-check-password",tw="Crypto API not supported"});function KSe(e,t,n,i){Object.assign(e,{ready:new Promise(r=>e.resolveReady=r),password:Bxt(t,n),strength:i-1,pendingInput:dr})}function $Se(e,t,n,i,r,o){let{ctr:s,hmac:a,pendingInput:c}=e;c.length&&(t=Gd(c,t));let u=t.length-r;n=kxt(n,i+(u-u%nw));let f;for(f=0;f<=u-nw;f+=nw){let d=HR(qp,Wd(t,f,f+nw));o&&a.update(d);let p=s.update(d);o||a.update(p),n.set(jR(qp,p),f+i)}return e.pendingInput=Wd(t,f),n}async function Mxt(e,t,n,i){let r=await JSe(e,t,n,Wd(i,0,VR[t])),o=Wd(i,VR[t]);if(r[0]!=o[0]||r[1]!=o[1])throw new Error(Wp)}async function Nxt(e,t,n){let i=Gj(new Uint8Array(VR[t])),r=await JSe(e,t,n,i);return Gd(i,r)}async function JSe(e,t,n,i){e.password=null;let r=await Lxt(Cxt,n,wxt,!1,Ixt),o=await Fxt(Object.assign({salt:i},ote),r,8*(zR[t]*2+2)),s=new Uint8Array(o),a=HR(qp,Wd(s,0,zR[t])),c=HR(qp,Wd(s,zR[t],zR[t]*2)),u=Wd(s,zR[t]*2);return Object.assign(e,{keys:{key:a,authentication:c,passwordVerification:u},ctr:new Rxt(new Dxt(a),Array.from(Pxt)),hmac:new Oxt(c)}),u}async function Lxt(e,t,n,i,r){if(WSe)try{return await GR.importKey(e,t,n,i,r)}catch{return WSe=!1,bA.importKey(t)}else return bA.importKey(t)}async function Fxt(e,t,n){if(qSe)try{return await GR.deriveBits(e,t,n)}catch{return qSe=!1,bA.pbkdf2(t,e.salt,ote.iterations,n)}else return bA.pbkdf2(t,e.salt,ote.iterations,n)}function Bxt(e,t){return t===ke?ew(e):t}function kxt(e,t){if(t&&t>e.length){let n=e;e=new Uint8Array(t),e.set(n,0)}return e}function Wd(e,t,n){return e.subarray(t,n)}function jR(e,t){return e.fromBits(t)}function HR(e,t){return e.toBits(t)}var nw,Cxt,YSe,vxt,Sxt,wxt,ote,Ixt,VR,zR,Hg,Pxt,Xj,GR,XSe,qp,Dxt,Rxt,Oxt,WSe,qSe,qj,Yj,ZSe=Cs(()=>{cc();nte();cT();GSe();Wj();nw=16,Cxt="raw",YSe={name:"PBKDF2"},vxt={name:"HMAC"},Sxt="SHA-1",wxt=Object.assign({hash:vxt},YSe),ote=Object.assign({iterations:1e3,hash:{name:Sxt}},YSe),Ixt=["deriveBits"],VR=[8,12,16],zR=[16,24,32],Hg=10,Pxt=[0,0,0,0],Xj=typeof crypto!=Uu,GR=Xj&&crypto.subtle,XSe=Xj&&typeof GR!=Uu,qp=UR.bytes,Dxt=ite.aes,Rxt=rte.ctrGladman,Oxt=bA.hmacSha1,WSe=Xj&&XSe&&typeof GR.importKey==Po,qSe=Xj&&XSe&&typeof GR.deriveBits==Po,qj=class extends TransformStream{constructor({password:t,rawPassword:n,encryptionStrength:i,checkPasswordOnly:r,checkAuthenticationCode:o=!0}){super({start(){KSe(this,t,n,i)},async transform(s,a){let c=this,{password:u,strength:f,resolveReady:d,ready:p}=c;u?(await Mxt(c,f,u,Wd(s,0,VR[f]+2)),s=Wd(s,VR[f]+2),r?a.error(new Error(jg)):d()):await p;let g=new Uint8Array(s.length-Hg-(s.length-Hg)%nw);a.enqueue($Se(c,s,g,0,Hg,!0))},async flush(s){let{ctr:a,hmac:c,pendingInput:u,ready:f}=this;if(c&&a){await f;let d=Wd(u,0,u.length-Hg),p=Wd(u,u.length-Hg),g=dr;if(d.length){let A=HR(qp,d);c.update(A);let b=a.update(A);g=jR(qp,b)}let m=Wd(jR(qp,c.digest()),0,Hg),y=u.length<Hg?1:0;for(let A=0;A<Hg;A++)y|=m[A]^p[A];if(y&&o)throw new Error(TA);s.enqueue(g)}}})}},Yj=class extends TransformStream{constructor({password:t,rawPassword:n,encryptionStrength:i}){super({start(){KSe(this,t,n,i)},async transform(r,o){let s=this,{password:a,strength:c,resolveReady:u,ready:f}=s,d=dr;a?(d=await Nxt(s,c,a),u()):await f;let p=new Uint8Array(d.length+r.length-r.length%nw);p.set(d,0),o.enqueue($Se(s,r,p,d.length,0))},async flush(r){let{ctr:o,hmac:s,pendingInput:a,ready:c}=this;if(s&&o){await c;let u=dr;if(a.length){let d=o.update(HR(qp,a));s.update(d),u=jR(qp,d)}let f=jR(qp,s.digest()).slice(0,Hg);r.enqueue(Gd(u,f))}}})}}});function nwe(e,t,n,i){Object.assign(e,{password:t,rawPassword:n,passwordVerification:i}),Uxt(e,t,n)}function QSe(e,t){let n=new Uint8Array(t.length);for(let i=0;i<t.length;i++)n[i]=iwe(e)^t[i],Jj(e,n[i]);return n}function ewe(e,t){let n=new Uint8Array(t.length);for(let i=0;i<t.length;i++)n[i]=iwe(e)^t[i],Jj(e,t[i]);return n}function Uxt(e,t,n){let i=[305419896,591751049,878082192];if(Object.assign(e,{keys:i,crcKey0:new sm(i[0]),crcKey2:new sm(i[2])}),n)for(let r=0;r<n.length;r++)Jj(e,n[r]);else for(let r=0;r<t.length;r++)Jj(e,t.charCodeAt(r))}function Jj(e,t){let[,n]=e.keys;e.crcKey0.append([t]);let i=~e.crcKey0.get();n=twe(Math.imul(twe(n+rwe(i)),134775813)+1),e.crcKey2.append([n>>>24]);let r=~e.crcKey2.get();e.keys=[i,n,r]}function iwe(e){let t=e.keys[2]|2;return rwe(Math.imul(t,t^1)>>>8)}function rwe(e){return e&255}function twe(e){return e&4294967295}var iw,Kj,$j,owe=Cs(()=>{BR();Wj();iw=12,Kj=class extends TransformStream{constructor({password:t,rawPassword:n,passwordVerification:i,checkPasswordOnly:r}){super({start(){nwe(this,t,n,i)},transform(o,s){let a=this;if(a.password||a.rawPassword){let c=QSe(a,o.subarray(0,iw));if(a.password=a.rawPassword=null,(c[iw-1]^a.passwordVerification)!=0)throw new Error(Wp);o=o.subarray(iw)}r?s.error(new Error(jg)):s.enqueue(QSe(a,o))}})}},$j=class extends TransformStream{constructor({password:t,rawPassword:n,passwordVerification:i}){super({start(){nwe(this,t,n,i)},transform(r,o){let s=this,a,c;if(s.password||s.rawPassword){s.password=s.rawPassword=null;let u=Gj(new Uint8Array(iw));u[iw-1]=s.passwordVerification,a=new Uint8Array(r.length+u.length),a.set(ewe(s,u),0),c=iw}else a=new Uint8Array(r.length),c=0;a.set(ewe(s,r),c),o.enqueue(a)}})}}});function am(e){if(e instanceof ReadableStream)return e;let t=e.getReader();return new ReadableStream({async pull(n){let{value:i,done:r}=await t.read();r?n.close():n.enqueue(i)},cancel(n){return t.cancel(n)}})}function Yp(e,t){e=am(e);let n=t?{type:t}:{};if(zxt())return new Response(e).blob().then(r=>t?new Blob([r],n):r);let i=[];return e.pipeTo(new WritableStream({write(r){i.push(r)}})).then(()=>new Blob(i,n))}function zxt(){return typeof Blob.prototype.stream!=Po||new Blob([]).stream()instanceof ReadableStream}function swe(e){if(e instanceof WritableStream)return e;let t=e.getWriter();return new WritableStream({write(n){return t.write(n)},close(){return t.close()},abort(n){return t.abort(n)}})}var rw=Cs(()=>{cc()});function Zj(e){return Vxt.get(e)}function Qj(e){return ste.get(e)}function jxt(e,t){let{CompressionStream:n,DecompressionStream:i}=t;if(typeof n!=Po&&typeof i!=Po)throw new Error(awe);ste.set(e,{CompressionStream:n,DecompressionStream:i})}async function cwe(e,t){!ste.has(e)&&t&&jxt(e,await import(t))}var awe,Vxt,ste,uT=Cs(()=>{cc();awe="Invalid codec module",Vxt=new Map,ste=new Map});function qxt(e,t,n){let i=new sm,r=0,o=!1,s,a,c,u=new Promise((m,y)=>{a=m,c=y});u.catch(()=>{}),n||a();let f=new TransformStream({start(m){let y=new Uint8Array(fwe);y.set(Gxt),m.enqueue(y)},transform(m,y){y.enqueue(m)},async flush(m){o=!0,p();try{await u}finally{g()}let y=new Uint8Array(ate),A=li(y);A.setUint32(0,i.get(),!0),A.setUint32(4,n,!0),m.enqueue(y)},cancel(m){c(m)}}),d=new TransformStream({transform(m,y){i.append(m),r+=m.length,r>=n?a():o&&p(),y.enqueue(m)},cancel(m){c(m)}});return e=cm(e,f),e=sw(e,t),cm(e,d);function p(){g(),s=setTimeout(()=>c(new Error(EA)),Wxt)}function g(){clearTimeout(s)}}function lte(e,t){if(!e)return!1;let n=lwe.get(e);n||(n=new Map,lwe.set(e,n));let i=n.get(t);if(i===ke){try{new e(t),i=!0}catch{i=!1}n.set(t,i)}return i}function i6(e){return lte(e,cte)}function ute(e){return lte(e,qR)}function dwe(e,t,n){t=cm(t,new TransformStream({flush:n})),Object.defineProperty(e,"readable",{get(){return t}})}function hwe(e,t,n){if(!e)throw new Error(Hxt);return new e(t,n)}function mwe(e,t,n,i,r){let o=t&&i?i:r||i,s=n.deflate64?uwe:cte,a;try{a=new o(s,n)}catch(c){if(t&&r&&o!=r)a=new r(s,n);else throw c}return sw(e,a)}function cm(e,t){return am(e).pipeThrough(t)}function sw(e,t){let n=t.writable.getWriter(),i=e.getReader();return r(),t.readable;async function r(){try{for(;;){await n.ready;let o=await i.read();if(o.done){await n.close();break}await n.write(o.value)}}catch(o){await Yxt(n,o),await Xxt(i,o)}}}async function Yxt(e,t){try{await e.abort(t)}catch{}}async function Xxt(e,t){try{await e.cancel(t)}catch{}}function Kxt(e){let t=e.getReader();return new ReadableStream({async pull(n){let i;try{i=await t.read()}catch(s){if(s&&s.message)throw s;let a=new Error(aw);throw a.cause=s,a}let{value:r,done:o}=i;o?n.close():n.enqueue(r)},cancel(n){return t.cancel(n)}})}var EA,aw,cw,Hxt,cte,uwe,qR,fwe,ate,Gxt,Wxt,e6,t6,n6,lwe,fte=Cs(()=>{BR();jSe();ZSe();owe();Wj();cc();cT();rw();uT();EA="Invalid uncompressed size",aw="Invalid compressed data",cw=xA,Hxt="Compression method not supported",cte="deflate-raw",uwe="deflate64-raw",qR="gzip",fwe=10,ate=8,Gxt=[31,139,8],Wxt=5e3,e6=class extends TransformStream{constructor(t,{chunkSize:n,CompressionStreamFallback:i,CompressionStream:r}){super({});let{compressed:o,encrypted:s,useCompressionStream:a,zipCrypto:c,computeCrc32:u,level:f,deflate64:d,format:p,compressionMethod:g,inputSize:m}=t,y=this,A,b,x,T=super.readable,E=p&&Qj(p),v=u&&o&&!d&&!E&&(!s||c)&&!!(a&&r);if((!s||c)&&u&&!v&&(A=new kR,T=cm(T,A)),o)if(E)T=sw(T,hwe(E.CompressionStream,p,{level:f,chunkSize:n,compressionMethod:g,uncompressedSize:m}));else if(v)x=new t6,T=sw(T,new r(qR)),T=cm(T,x);else try{T=mwe(T,a,{level:f,chunkSize:n},r,i)}catch(S){let I;try{I=new r(qR)}catch{throw S}T=sw(T,I),T=cm(T,new t6)}s&&(c?T=cm(T,new $j(t)):(b=new Yj(t),T=cm(T,b))),dwe(y,T,()=>{(!s||c)&&u&&(y.crc32=v?x.crc32:new DataView(A.value.buffer).getUint32(0))})}},t6=class extends TransformStream{constructor(){let t,n=fwe,i=new Uint8Array(0);super({transform(r,o){if(n){let u=Math.min(n,r.length);if(n-=u,r=r.subarray(u),!r.length)return}let s=i.length+r.length;if(s<=ate){i=Gd(i,r);return}let a=s-ate,c=Math.min(a,i.length);o.enqueue(Gd(i.subarray(0,c),r.subarray(0,a-c))),i=Gd(i.subarray(c),r.subarray(a-c))},flush(){let r=li(i);t.crc32=r.getUint32(0,!0),t.uncompressedSize=r.getUint32(4,!0)}}),t=this}};n6=class extends TransformStream{constructor(t,{chunkSize:n,DecompressionStreamFallback:i,DecompressionStream:r}){super({});let{zipCrypto:o,encrypted:s,checkCrc32:a,crc32:c,compressed:u,useCompressionStream:f,deflate64:d,format:p,compressionMethod:g,rawBitFlag:m,outputSize:y}=t,A,b,x=super.readable;if(s&&(o?x=cm(x,new Kj(t)):(b=new qj(t),x=cm(x,b))),u){let T=p&&Qj(p);if(T)x=sw(x,hwe(T.DecompressionStream,p,{chunkSize:n,compressionMethod:g,rawBitFlag:m,uncompressedSize:y}));else try{x=mwe(x,f,{chunkSize:n,deflate64:d},r,i)}catch(E){if(d||y===ke)throw E;let v;try{v=new r(qR)}catch{throw E}x=qxt(x,v,y)}x=Kxt(x)}a&&(A=new kR,x=cm(x,A)),dwe(this,x,()=>{if(a){let T=new DataView(A.value.buffer);if(c!=T.getUint32(0,!1))throw new Error(cw)}})}},lwe=new Map});var $xt,pwe,gwe,_we,dte,ywe,Awe,lw,o6,r6,YR,s6=Cs(()=>{cc();fte();$xt=64*1024,pwe="message",gwe="start",_we="pull",dte="data",ywe="ack",Awe="close",lw="deflate",o6="inflate",r6=class extends TransformStream{constructor(t,n){super({});let i=this,{codecType:r}=t,o;r.startsWith(lw)?o=e6:r.startsWith(o6)&&(o=n6),i.outputSize=0;let s=0,a=new o(t,n),c=super.readable,u=new TransformStream({transform(d,p){d&&d.length&&(s+=d.length,p.enqueue(d))},flush(){Object.assign(i,{inputSize:s})}}),f=new TransformStream({transform(d,p){if(d&&d.length&&(p.enqueue(d),i.outputSize+=d.length,t.outputSize!==ke&&i.outputSize>t.outputSize))throw new Error(EA)},flush(){let{crc32:d}=a;Object.assign(i,{crc32:d,inputSize:s})}});Object.defineProperty(i,"readable",{get(){return c.pipeThrough(u).pipeThrough(a).pipeThrough(f)}})}},YR=class extends TransformStream{constructor(t){let n=[],i=0;(!Number.isFinite(t)||t<1)&&(t=$xt),super({transform(s,a){for(n.push(s),i+=s.length;i>t;)a.enqueue(r())},flush(s){i&&s.enqueue(o(n,i))}});function r(){let s=new Uint8Array(t),a=0;for(;a<t;){let c=n[0],u=t-a;c.length<=u?(s.set(c,a),a+=c.length,n.shift()):(s.set(c.subarray(0,u),a),n[0]=c.subarray(u),a+=u)}return i-=t,s}function o(s,a){let c=new Uint8Array(a),u=0;for(let f of s)c.set(f,u),u+=f.length;return c}}}});function xwe({initModule:e}){c6=e}function Twe(e){mte=e}async function Ewe(e){let{CompressionStream:t,CompressionStreamFallback:n}=e;if(n&&!n.requiresModule||i6(t)||ute(t))return!0;if(n)try{return await c6(e),!0}catch{return!1}return!1}function gte(e){e.createWorker?bwe=!0:a6=!1}async function hte(e,...t){try{await e(...t)}catch{}}function _te(e,t){return{run:()=>l6(e,t)}}async function l6({options:e,readable:t,writable:n,onTaskFinished:i},r){let o;try{if(e.compressed&&!e.format){let u=e.codecType.startsWith(lw),f=u?r.CompressionStreamFallback:r.DecompressionStreamFallback,d=u?r.CompressionStream:r.DecompressionStream;if(e.useCompressionStream){if(f&&f.requiresModule&&!i6(d))try{await c6(r)}catch{}}else try{await c6(r)}catch{(!f||f.requiresModule)&&(e.useCompressionStream=!0)}}o=new r6(e,r),await t.pipeThrough(o).pipeThrough(new YR(NR(r))).pipeTo(n,{preventClose:!0,preventAbort:!0});let{crc32:s,inputSize:a,outputSize:c}=o;return{crc32:s,inputSize:a,outputSize:c}}catch(s){throw o&&(s.outputSize=o.outputSize),s}finally{i()}}var dT,a6,bwe,mte,c6,fT,pte,XR=Cs(()=>{cc();Gp();s6();dT="Worker startup timeout",c6=()=>{};fT=class{constructor(t,{readable:n,writable:i},{options:r,config:o,streamOptions:s,useWebWorkers:a,transferStreams:c,workerURI:u,createWorker:f},d){let{signal:p}=s;return bwe&&(f=ke),Object.assign(t,{busy:!0,generation:(t.generation||0)+1,readable:n.pipeThrough(new YR(NR(o))).pipeThrough(new pte(s),{signal:p}),writable:i,options:Object.assign({},r),workerURI:u,createWorker:f,transferStreams:c,terminate(){return new Promise(g=>{let{worker:m,busy:y}=t;m?(y?t.resolveTerminated=g:(m.terminate(),g()),t.interface=null):g()})},onTaskFinished(){if(t.busy){let{resolveTerminated:g}=t;g&&(t.resolveTerminated=null,t.terminated=!0,t.worker.terminate(),g()),t.busy=!1,d(t)}}}),a6===ke&&(a6=typeof Worker!=Uu),(a&&mte&&(a6&&u||f)?mte:_te)(t,o)}},pte=class extends TransformStream{constructor({onstart:t,onprogress:n,size:i,onend:r}){let o=0;super({async start(){t&&await hte(t,i)},async transform(s,a){o+=s.length,n&&await hte(n,o,i),a.enqueue(s)},async flush(){r&&await hte(r,o)}})}}});async function h6(e,t){let{options:n,config:i}=t,{transferStreams:r,useWebWorkers:o,useCompressionStream:s,compressed:a,checkCrc32:c,computeCrc32:u,encrypted:f,format:d,codecURI:p}=n,{workerURI:g,createWorker:m,maxWorkers:y}=i;d&&(p&&(n.codecURI=iTt(p,i.baseURI)),await cwe(d,n.codecURI)),t.transferStreams=!d&&(r||r===ke&&i.transferStreams);let A=!a&&!c&&!u&&!f,b=d===ke||!!n.codecURI;return t.useWebWorkers=!A&&b&&(o||o===ke&&i.useWebWorkers),t.workerURI=t.useWebWorkers&&g?g:ke,t.createWorker=t.useWebWorkers&&m?m:ke,n.useCompressionStream=s||s===ke&&i.useCompressionStream,(await x()).run();async function x(){let E=hT.find(v=>!v.busy);if(E)return Rwe(E),new fT(E,e,t,T);if(hT.length<y){let v={indexWorker:Dwe};return Dwe++,hT.push(v),new fT(v,e,t,T)}else return new Promise(v=>{uw.push({resolve:v,stream:e,workerOptions:t}),f6=i.workerStarvationTimeout,d6()})}function T(E){if(Owe(),uw.length){let[{resolve:v,stream:S,workerOptions:I}]=uw.splice(0,1);v(new fT(E,S,I,T)),d6()}else E.worker?(Rwe(E),sTt(E,t)):hT=hT.filter(v=>v!=E)}}function iTt(e,t){try{return new URL(e,t).toString()}catch{return e}}function d6(){!fw&&uw.length&&Number.isFinite(f6)&&f6>=0&&(fw=setTimeout(rTt,f6))}function Owe(){fw&&(clearTimeout(fw),fw=null)}function rTt(){if(fw=null,uw.length){let[{resolve:e,stream:t,workerOptions:n}]=uw.splice(0,1),i=Object.assign({},n,{useWebWorkers:!1,workerURI:ke,createWorker:ke});e(new fT({},t,i,oTt)),d6()}}function oTt(){Owe(),d6()}function sTt(e,t){let{config:n}=t,{terminateWorkerTimeout:i}=n;Number.isFinite(i)&&i>=0&&(e.terminated?e.terminated=!1:e.terminateTimeout=setTimeout(async()=>{hT=hT.filter(r=>r!=e);try{await e.terminate()}catch{}},i))}function Rwe(e){let{terminateTimeout:t}=e;t&&(clearTimeout(t),e.terminateTimeout=null)}var hT,uw,fw,f6,Dwe,m6=Cs(()=>{cc();s6();uT();XR();hT=[],uw=[],Dwe=0});function Nwe(e){if(aTt){let t="";for(let n=0;n<e.length;n++)t+=Mwe[e[n]];return t}else return new TextDecoder().decode(e)}var Mwe,aTt,Lwe=Cs(()=>{Mwe="\0\u263A\u263B\u2665\u2666\u2663\u2660\u2022\u25D8\u25CB\u25D9\u2642\u2640\u266A\u266B\u263C\u25BA\u25C4\u2195\u203C\xB6\xA7\u25AC\u21A8\u2191\u2193\u2192\u2190\u221F\u2194\u25B2\u25BC !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~\u2302\xC7\xFC\xE9\xE2\xE4\xE0\xE5\xE7\xEA\xEB\xE8\xEF\xEE\xEC\xC4\xC5\xC9\xE6\xC6\xF4\xF6\xF2\xFB\xF9\xFF\xD6\xDC\xA2\xA3\xA5\u20A7\u0192\xE1\xED\xF3\xFA\xF1\xD1\xAA\xBA\xBF\u2310\xAC\xBD\xBC\xA1\xAB\xBB\u2591\u2592\u2593\u2502\u2524\u2561\u2562\u2556\u2555\u2563\u2551\u2557\u255D\u255C\u255B\u2510\u2514\u2534\u252C\u251C\u2500\u253C\u255E\u255F\u255A\u2554\u2569\u2566\u2560\u2550\u256C\u2567\u2568\u2564\u2565\u2559\u2558\u2552\u2553\u256B\u256A\u2518\u250C\u2588\u2584\u258C\u2590\u2580\u03B1\xDF\u0393\u03C0\u03A3\u03C3\xB5\u03C4\u03A6\u0398\u03A9\u03B4\u221E\u03C6\u03B5\u2229\u2261\xB1\u2265\u2264\u2320\u2321\xF7\u2248\xB0\u2219\xB7\u221A\u207F\xB2\u25A0\xA0".split(""),aTt=Mwe.length==256});function KR(e,t){return Bwe(e,t,!0)}function Fwe(e,t){return Bwe(e,t,!1)}function Bwe(e,t,n){return t&&t.trim().toLowerCase()=="cp437"?Nwe(e):new TextDecoder(t,{ignoreBOM:n}).decode(e)}var Ete=Cs(()=>{Lwe()});function lTt(){Vwe=(async()=>{try{let t=new Blob([new Uint8Array(3)]).slice(1,2).stream().getReader(),n=0,i=await t.read();for(;!i.done;)n+=i.value.length,i=await t.read();Cte=n==1}catch{Cte=!1}})()}function y6(e){return!!(e&&e.getData)}async function vc(e,t){if(e.init&&!e.initialized)await e.init(t);else return Promise.resolve()}async function uTt(e){return e=new Gg(e),await vc(e),(e.size===ke||!e.readUint8Array)&&(e=new zu(await Yp(e.readable)),await vc(e)),e}function Do(e,t,n){return e.readUint8Array(t,n)}function Ste(e,t){return e.createReadable?e.createReadable(t):e.readUint8Array?hw.prototype.createReadable.call(e,t):e.readable}var Uwe,zwe,cTt,zNi,VNi,vte,kwe,dw,hw,p6,$R,Cte,Vwe,zu,mw,JR,ZR,g6,_6,Gg,pw,A6=Cs(()=>{cc();Gp();cT();rw();Ete();Uwe="Writer iterator completed too soon",zwe="Writer not initialized",cTt="text/plain",zNi=256*1024,VNi=16*1024*1024,vte="writable",kwe=Symbol(),dw=class{constructor(){this.size=0}init(){this.initialized=!0}},hw=class extends dw{get readable(){return this.createReadable()}createReadable({offset:t=0,size:n,chunkSize:i=NR(Vg())}={}){let r=this,o=0;return i=tte(i),new ReadableStream({async pull(s){let a=n===ke?i:Math.min(i,n-o),c=await Do(r,t+o,a);c.length&&s.enqueue(c),o+i>=n||!c.length&&a?s.close():o+=i}})}},p6=class extends dw{constructor(){super();let t=this,n=new WritableStream({write(i){if(!t.initialized)throw new Error(zwe);return t.writeUint8Array(Hj(i))}});Object.defineProperty(t,vte,{get(){return n}})}writeUint8Array(){}},$R=class extends p6{constructor(t){super(),Object.assign(this,{contentType:t,data:"data:"+(t||"")+";base64,",pendingCharacters:""})}writeUint8Array(t){let n=this,i,r=n.pendingCharacters,o=n.pendingCharacters.length;for(n.pendingCharacters="",i=0;i<Math.floor((o+t.length)/3)*3-o;i++)r+=String.fromCharCode(t[i]);for(;i<t.length;i++)n.pendingCharacters+=String.fromCharCode(t[i]);r.length>2?n.data+=btoa(r):n.pendingCharacters=r+n.pendingCharacters}getData(){return this.data+btoa(this.pendingCharacters)}};zu=class extends hw{constructor(t){super(),Object.assign(this,{sourceBlob:t,size:t.size}),Vwe||lTt()}createReadable(t){let n=this,{sourceBlob:i,size:r}=n,{offset:o=0,size:s=r-o}=t||{};return!o&&s>=r?am(i.stream()):Cte?am(i.slice(o,o+s).stream()):super.createReadable(t)}async readUint8Array(t,n){let i=this,r=t+n,a=await(!t&&r>=i.size?i.sourceBlob:i.sourceBlob.slice(t,r)).arrayBuffer();return a.byteLength>n&&(a=a.slice(t,r)),new Uint8Array(a)}},mw=class extends dw{constructor(t){super();let n=this,i=new TransformStream;Object.defineProperty(n,vte,{get(){return i.writable}}),n.contentType=t,n.blobPromise=Yp(i.readable,t),n.blobPromise.catch(()=>{})}getData(){return this.blobPromise}},JR=class extends zu{constructor(t){super(new Blob([t],{type:cTt}))}},ZR=class extends mw{constructor(t){super(),Object.assign(this,{encoding:t,utf8:!t||t.toLowerCase()=="utf-8"})}async getData(){let{encoding:t,utf8:n}=this,i=await super.getData();return i.text&&n?i.text():Fwe(new Uint8Array(await i.arrayBuffer()),t)}},g6=class extends hw{constructor(t){super(),this.readers=t}async init(){let t=this;t.lastDiskNumber=0;let n=t.readers=await Promise.all(t.readers.map(uTt));t.diskOffsets=n.map(i=>{let r=t.size;return t.size+=i.size,r}),super.init()}getDiskOffset(t){let{diskOffsets:n,size:i}=this,r=n[t];return r===ke?i:r}async readUint8Array(t,n){let i=this,{readers:r}=this,o,s=0,a=t;for(;r[s]&&a>=r[s].size;)a-=r[s].size,s++;let c=r[s];if(c){let u=c.size;if(a+n<=u)o=await Do(c,a,n);else{let f=u-a,d=await Do(c,a,f),p=await i.readUint8Array(t+f,n-f);o=Gd(d,p)}}else o=dr;return i.lastDiskNumber=Math.max(s,i.lastDiskNumber),o}},_6=class extends dw{constructor(t,n=4294967295){super();let i=this;Object.assign(i,{diskNumber:0,diskOffset:0,size:0,maxSize:n,availableSize:n});let r,o,s,a=new WritableStream({async write(d){if(d===kwe){s&&await u();return}let{availableSize:p}=i;if(s)d.length>=p?(await c(d.subarray(0,p)),await u(),d.length>p&&await this.write(d.subarray(p))):await c(d);else{let{value:g,done:m}=await t.next();if(m&&!g)throw new Error(Uwe);r=g,r.size=0,r.maxSize&&(i.maxSize=r.maxSize),i.availableSize=i.maxSize,await vc(r),o=g.writable,s=o.getWriter(),await this.write(d)}},async close(){s&&(await s.ready,await f())},async abort(d){s&&await s.abort(d)}});Object.defineProperty(i,vte,{get(){return a}});async function c(d){let p=d.length;p&&(await s.ready,await s.write(d),r.size+=p,i.availableSize-=p)}async function u(){await f(),i.diskOffset+=r.size,i.diskNumber++,s=null,i.availableSize=i.maxSize}async function f(){await s.close()}}async closeDisk(){let t=this.writable.getWriter();try{await t.ready,await t.write(kwe)}finally{t.releaseLock()}}},Gg=class{constructor(t){return Array.isArray(t)&&(t=new g6(t)),(t instanceof ReadableStream||typeof t.getReader==Po)&&(t={readable:am(t)}),t}},pw=class{constructor(t){return t.writable===ke&&typeof t.next==Po&&(t=new _6(t)),(t instanceof WritableStream||typeof t.getWriter==Po)&&(t={writable:swe(t)}),t.size===ke&&(t.size=0),t}}});var wte,Ite,QR,Pte,eO,Dte,Rte,Ote,gw,_w,tO,Mte,nO,Nte,Lte,Fte,b6,x6,Bte,kte,Ute,T6,zte,Vte,jte,Hte,mT,Gte,fTt,Wte,E6,dTt,C6,hTt,mTt,pTt,gTt,qte,Yte,Xte,Kte,_Tt,yTt,ATt,bTt,xTt,TTt,ETt,CTt,vTt,STt,wTt,ITt,PTt,DTt,RTt,OTt,CA,$te=Cs(()=>{wte="filename",Ite="rawFilename",QR="comment",Pte="rawComment",eO="uncompressedSize",Dte="compressedSize",Rte="offset",Ote="diskNumberStart",gw="lastModDate",_w="rawLastModDate",tO="lastAccessDate",Mte="rawLastAccessDate",nO="creationDate",Nte="rawCreationDate",Lte="internalFileAttributes",Fte="externalFileAttributes",b6="internalFileAttribute",x6="externalFileAttribute",Bte="msdosAttributesRaw",kte="msdosAttributes",Ute="msDosCompatible",T6="zip64",zte="encrypted",Vte="version",jte="versionMadeBy",Hte="zipCrypto",mT="directory",Gte="executable",fTt="symlink",Wte="compressionMethod",E6="signature",dTt="crc32",C6="extraField",hTt="extraFieldInfoZip",mTt="extraFieldUnix",pTt="extraFieldUnixType1",gTt="extraFieldPkwareUnix",qte="unixMode",Yte="setuid",Xte="setgid",Kte="sticky",_Tt="bitFlag",yTt="rawBitFlag",ATt="filenameLength",bTt="extraFieldLength",xTt="unixExternalUpper",TTt="filenameUTF8",ETt="commentUTF8",CTt="rawExtraField",vTt="extraFieldZip64",STt="extraFieldUnicodePath",wTt="extraFieldUnicodeComment",ITt="extraFieldAES",PTt="extraFieldNTFS",DTt="extraFieldExtendedTimestamp",RTt="extraFieldUSDZ",OTt=[wte,Ite,eO,Dte,gw,_w,QR,Pte,tO,Mte,nO,Nte,Rte,Ote,Lte,Fte,b6,x6,Bte,kte,Ute,T6,zte,Vte,jte,Hte,mT,Gte,fTt,Wte,E6,dTt,C6,mTt,hTt,pTt,gTt,"uid","gid",qte,xTt,Yte,Xte,Kte,_Tt,yTt,ATt,bTt,TTt,ETt,CTt,vTt,STt,wTt,ITt,PTt,DTt,RTt],CA=class{constructor(t){OTt.forEach(n=>this[n]=t[n])}}});var pIe={};Uke(pIe,{ERR_AMBIGUOUS_ARCHIVE:()=>Cne,ERR_BAD_FORMAT:()=>yw,ERR_CENTRAL_DIRECTORY_NOT_FOUND:()=>yne,ERR_ENCRYPTED:()=>xne,ERR_ENCRYPTED_CENTRAL_DIRECTORY:()=>vne,ERR_ENTRY_DATA_OUT_OF_BOUNDS:()=>Ene,ERR_EOCDR_LOCATOR_ZIP64_NOT_FOUND:()=>_ne,ERR_EOCDR_NOT_FOUND:()=>gne,ERR_EXTRAFIELD_ZIP64_NOT_FOUND:()=>bne,ERR_INVALID_AUTHENTICATION_CODE:()=>TA,ERR_INVALID_COMPRESSED_DATA:()=>aw,ERR_INVALID_CRC32:()=>cw,ERR_INVALID_FILENAME_VALIDATION:()=>Ine,ERR_INVALID_MAX_APPENDED_DATA_SIZE:()=>Pne,ERR_INVALID_PASSWORD:()=>Wp,ERR_INVALID_SIGNATURE:()=>xA,ERR_INVALID_STRICTNESS:()=>wne,ERR_INVALID_UNCOMPRESSED_SIZE:()=>EA,ERR_LOCAL_FILE_HEADER_NOT_FOUND:()=>Ane,ERR_OVERLAPPING_ENTRY:()=>Tne,ERR_SPLIT_ZIP_FILE:()=>P6,ERR_UNSAFE_FILENAME:()=>Sne,ERR_UNSUPPORTED_COMPRESSION:()=>I6,ERR_UNSUPPORTED_ENCRYPTION:()=>w6,ERR_UNSUPPORTED_UINT64:()=>Dne,ERR_WORKER_STARTUP_TIMEOUT:()=>dT,WARNING_APPENDED_DATA:()=>R6,WARNING_COMPRESSED_PATCHED_DATA:()=>Mne,WARNING_DUPLICATE_FILENAME:()=>Bne,WARNING_MALFORMED_EXTRA_FIELD:()=>G6,WARNING_MISMATCHED_LOCAL_FILE_HEADER_BIT_FLAG:()=>kne,WARNING_MISMATCHED_LOCAL_FILE_HEADER_COMPRESSION_METHOD:()=>Une,WARNING_MISMATCHED_LOCAL_FILE_HEADER_CRC32_OR_SIZES:()=>zne,WARNING_MISMATCHED_ZIP64_END_OF_CENTRAL_DIRECTORY:()=>Aw,WARNING_PREPENDED_CENTRAL_DIRECTORY:()=>Lne,WARNING_PREPENDED_DATA:()=>O6,WARNING_TRAILING_CENTRAL_DIRECTORY_DATA:()=>Fne,WARNING_UNKNOWN_VERSION:()=>One,WARNING_UNKNOWN_ZIP64_EXTENSIBLE_DATA:()=>Nne,WARNING_UNSORTED_CENTRAL_DIRECTORY:()=>Rne,WARNING_WRAPPED_ENTRIES_COUNT:()=>D6,ZipReader:()=>yT,ZipReaderStream:()=>N6,isZipFile:()=>sIe});async function sIe(e,t={}){if(e=new Gg(e),await vc(e),(e.size===ke||!e.readUint8Array)&&(e=new zu(await Yp(e.readable)),await vc(e)),e.size<22)return!1;let n=jne(t,{}),i=n!=zg,r=fIe(t[Jee],n),{endOfDirectoryInfo:o,endOfDirectoryReachingEndCount:s}=await dIe(e,i,r);if(!o||n==AA&&s>1)return!1;let a=hr(li(o),20),c=o.offset+22+a;return e.size-c<=r}function Jte(e){let t=Math.min(e.byteLength,1024)-3;for(let n=0;n<t;n++)if(Pi(e,n)==134630224)return!0;return!1}function $we(e,t,n){let i=0;for(;n+46<=t.length&&Pi(e,n)==33639248;)n+=46+hr(e,n+28)+hr(e,n+30)+hr(e,n+32),i++;return i%65536?0:i}function Zte(e){if(e.length>=6){let t=li(e);if(Pi(t,0)==84233040){let n=hr(t,4);if(6+n<=e.length)return e.subarray(6,6+n)}}}function qTt(e,t,n){let i=e&&e.compressedSize?e.compressedSize:t;return i>0&&i<=n?i:n}function YTt(e){let t={rawExtensibleData:e};if(e.length>=28){let n=li(e),i=hr(n,26);Object.assign(t,{compressionMethod:hr(n,0),compressedSize:Pf(n,2),uncompressedSize:Pf(n,10),encryptionAlgorithm:hr(n,18),bitLength:hr(n,20),flags:hr(n,22),hashAlgorithm:hr(n,24),hashData:e.subarray(28,28+i)})}return t}function aIe(e,t,n){let i=e.rawBitFlag=hr(t,n+2),r=(i&1)==1,o=Pi(t,n+6);Object.assign(e,{encrypted:r,version:hr(t,n),bitFlag:{level:(i&6)>>1,dataDescriptor:(i&8)==8,languageEncodingFlag:(i&2048)==2048},rawLastModDate:o,lastModDate:cEt(o),filenameLength:hr(t,n+22),extraFieldLength:hr(t,n+24)})}function cIe(e,t,n,i,r){let{rawExtraField:o}=t,s=t.extraField=new Map,a=li(o),c=0,u=!1;try{for(;c<o.length;){let S=hr(a,c),I=hr(a,c+2);s.set(S,{type:S,data:o.slice(c+4,c+4+I)}),c+=4+I}}catch{u=!0}c>o.length&&(u=!0);let f=hr(n,i+4);Object.assign(t,{signature:Pi(n,i+10),crc32:Pi(n,i+10),compressedSize:Pi(n,i+14),uncompressedSize:Pi(n,i+18)});let d=s.get(1);d&&(XTt(d,t),t.extraFieldZip64=d);let p=s.get(28789);p&&(Jwe(p,wte,Ite,t,e),t.extraFieldUnicodePath=p);let g=s.get(25461);g&&(Jwe(g,QR,Pte,t,e),t.extraFieldUnicodeComment=g);let m=s.get(39169);m&&m.data.length>=7?(KTt(m,t,f),t.extraFieldAES=m):t.compressionMethod=f;let y=s.get(13);y&&(Zwe(y,t),t.extraFieldPkwareUnix=y);let A=s.get(22613);A&&(Zwe(A,t),t.extraFieldUnixType1=A);let b=s.get(10);b&&($Tt(b,t),t.extraFieldNTFS=b);let x=s.get(30805),T;if(x&&(T=Qwe(x,t,!1),t.extraFieldUnix=x),!T){let S=s.get(30837);S&&(Qwe(S,t,!0),t.extraFieldInfoZip=S)}let E=s.get(21589);E&&(JTt(E,t,r),t.extraFieldExtendedTimestamp=E);let v=s.get(6534);return v&&(t.extraFieldUSDZ=v),u}function XTt(e,t){t.zip64=!0;let n=li(e.data),i=jTt.filter(([o,s])=>t[o]==s),r=i.reduce((o,[,s])=>o+Xwe[s].bytes,0);if(e.data.length<r)throw new Error(bne);for(let o=0,s=0;o<i.length;o++){let[a,c]=i[o],u=Xwe[c];t[a]=e[a]=u.getValue(n,s),s+=u.bytes}}function Jwe(e,t,n,i,r){if(e.data.length<5){e.valid=!1;return}let o=li(e.data),s=new sm;s.append(r[n]);let a=li(new Uint8Array(4));a.setUint32(0,s.get(),!0);let c=Pi(o,1),u=SA(o,0);Object.assign(e,{version:u,[t]:KR(e.data.subarray(5)),valid:u==1&&!r.bitFlag.languageEncodingFlag&&c==Pi(a,0)}),e.valid&&(i[t]=e[t],i[t+VTt]=!0)}function KTt(e,t,n){let i=li(e.data),r=SA(i,4);Object.assign(e,{vendorVersion:SA(i,0),vendorId:SA(i,2),strength:r,originalCompressionMethod:n,compressionMethod:hr(i,5)}),t.compressionMethod=e.compressionMethod,e.vendorVersion!=oIe&&(t.crc32=ke)}function $Tt(e,t){let n=li(e.data),i=4,r;try{for(;i<e.data.length&&!r;){let o=hr(n,i),s=hr(n,i+2);o==1&&(r=e.data.slice(i+4,i+4+s)),i+=4+s}}catch{}if(r&&r.length==24){let o=li(r),s=o.getBigUint64(0,!0),a=o.getBigUint64(8,!0),c=o.getBigUint64(16,!0);Object.assign(e,{rawLastModDate:s,rawLastAccessDate:a,rawCreationDate:c});let u=Qte(s),f=Qte(a),d=Qte(c),p={lastModDate:u,lastAccessDate:f,creationDate:d};Object.assign(e,p),Object.assign(t,p,{rawLastAccessDate:a,rawCreationDate:c})}}function Zwe(e,t){if(e.data.length<8)return;let n=li(e.data),i=new Date((Pi(n,0)|0)*1e3),r=new Date((Pi(n,4)|0)*1e3),o={lastAccessDate:i,lastModDate:r};e.data.length>=12&&(o.uid=hr(n,8),o.gid=hr(n,10)),Object.assign(e,o),Object.assign(t,o)}function Qwe(e,t,n){try{let i=li(e.data),r,o;if(n){let s=0,a=SA(i,s++),c=SA(i,s++);r=eIe(e.data.subarray(s,s+c)),s+=c;let u=SA(i,s++);o=eIe(e.data.subarray(s,s+u)),Object.assign(e,{version:a,uid:r,gid:o})}else e.data.length>=4&&(r=hr(i,0),o=hr(i,2),Object.assign(e,{uid:r,gid:o}));return r!==ke&&(t.uid=r),o!==ke&&(t.gid=o),r!==ke||o!==ke}catch{}}function eIe(e){let t=new Uint8Array(4);return t.set(e,0),new DataView(t.buffer,t.byteOffset,4).getUint32(0,!0)}function JTt(e,t,n){if(!e.data.length)return;let i=li(e.data),r=SA(i,0),o=[],s=[];n?((r&1)==1&&(o.push(gw),s.push(_w)),(r&2)==2&&(o.push(tO),s.push(Mte)),(r&4)==4&&(o.push(nO),s.push(Nte))):e.data.length>=5&&(o.push(gw),s.push(_w));let a=1;o.forEach((c,u)=>{if(e.data.length>=a+4){let f=Pi(i,a);t[c]=e[c]=new Date((f|0)*1e3);let d=s[u];e[d]=f}a+=4})}async function ZTt({reader:e,fileEntry:t,index:n,offset:i,crc32:r,compressedSize:o,uncompressedSize:s,dataOffset:a,dataDescriptor:c,extraFieldZip64:u,readRanges:f}){let d=0;if(c&&(u?d=20:d=12),d){let g=await Do(e,a+o,d+4),m=li(g),y=g.length==d+4&&Pi(m,0)==134695760;if(y){let A=tIe(m,4,u);(t.encrypted&&!t.zipCrypto||A.crc32==r)&&A.compressedSize==o&&A.uncompressedSize==s?d+=4:y=!1}if(g.length>=d){let A=tIe(m,y?4:0,u);A.signature=y,t.localDirectory.dataDescriptor=A}}let p={start:i,end:a+o+d,fileEntry:t};for(let[g,m]of f)if(g!=n&&p.start<m.end&&m.start<p.end){let y=new Error(Tne);throw y.overlappingEntry=m.fileEntry,y}f.set(n,p)}function tIe(e,t,n){let i=Pi(e,t),r,o;return n?(r=Pf(e,t+4),o=Pf(e,t+12)):(r=Pi(e,t+4),o=Pi(e,t+8)),{crc32:i,compressedSize:r,uncompressedSize:o}}function bw(e,t){return e.getDiskOffset?e.getDiskOffset(t):0}async function QTt(e){return await lIe(e)==134695760}async function eEt(e){let t=await lIe(e);return t==134695760||t==808471376}async function lIe(e){let t=await Do(e,0,4);return Pi(li(t))}function uIe(e){return e===AA||e===zj||e===zg}function tEt(e,t,n){return Math.min(e,n?t*WTt:t)}function jne(e,t){return nIe(e,nIe(t,zj))}function nIe(e,t){let n=e[CSe];if(n!==ke){if(!uIe(n))throw new Error(wne);return n}let i=e[oSe];return i===ke?t:i?AA:t==zg?zg:zj}function nEt(e,t){return e===ke?t!=zg:!!e}function iEt(e,t){return e===ke?t==AA:!!e}function rEt(e,t){if(e===ke)return t;if(!uIe(e))throw new Error(Ine);return e}function oEt(e,t){if(t==zg)return!1;let n=e.split("/");return n.length>1&&n[n.length-1]===""&&n.pop(),n.includes("..")||e.startsWith("/")||e.startsWith("\\\\")||zTt.test(e)?!0:t==AA&&(n.includes(".")||n.includes(""))}function fIe(e,t){if(e!==ke){let n=aT(e);if(typeof n!=Kve||Number.isNaN(n)||n<0)throw new Error(Pne);return n}return t==AA?0:t==zg?1/0:65535}async function dIe(e,t,n){let{size:i}=e,r=Math.min(i,65557),o={count:GTt},s,a,c=0;for await(let[u,f,d,p,g]of hIe(e,r)){let m=hr(u,p+20);if(g+22+m==i){let y=await mIe(e,u,f,p,g,i,o);if(y==M6){if(s||(s=tne(d,p,g)),c++,!t||c>1)break}else y==Vne&&!a&&(a=tne(d,p,g))}}return s||(s=a),s||(s=await sEt(e,n,o)),{endOfDirectoryInfo:s,endOfDirectoryReachingEndCount:c}}async function sEt(e,t,n){let{size:i}=e,r=Math.min(i,t==1/0?i:65557+t),o,s;for await(let[a,c,u,f,d]of hIe(e,r)){let p=tne(u,f,d);o||(o=p);let g=await mIe(e,a,c,f,d,i,n);if(g==M6)return p;g==Vne&&!s&&(s=p)}return s||o}async function*hIe(e,t){let n=e.size-t,i=await Do(e,n,t),r=li(i);for(let o=i.length-22;o>=0;o--)Pi(r,o)==101010256&&(yield[r,n,i,o,n+o])}function tne(e,t,n){return{offset:n,buffer:e.slice(t,t+22).buffer}}async function mIe(e,t,n,i,r,o,s){let a=hr(t,i+10),c=Pi(t,i+12),u=Pi(t,i+16);if(a==65535||c==4294967295||u==4294967295)return await iIe(e,t,n,r-20,o,s)==117853008?M6:Kwe;if(!a&&!c)return Vne;let f=hr(t,i+6);for(let d of[r-c,bw(e,f)+u])if(await iIe(e,t,n,d,o,s)==33639248)return M6;return Kwe}async function iIe(e,t,n,i,r,o){if(i<0||i+4>r)return ke;if(i>=n)return Pi(t,i-n);if(o.count>0){o.count--;let s=await Do(e,i,4);return Pi(li(s),0)}return ke}function aEt(e,t,n,i,r){let{rawFilename:o}=e,s=!r,a=e.decryptedDirectory&&(t.rawBitFlag&8192)==8192;i&&!a&&(n.length!=o.length||n.some((c,u)=>c!=o[u]))&&$p(s,r,"mismatched local file header (filename)"),(t.rawBitFlag&Ywe)!=(e.rawBitFlag&Ywe)&&$p(s,r,kne),t.compressionMethod!=e.compressionMethod&&$p(s,r,Une),!t.bitFlag.dataDescriptor&&!a&&(t.crc32||t.compressedSize||t.uncompressedSize)&&(t.crc32!=e.crc32||t.compressedSize!=e.compressedSize||t.uncompressedSize!=e.uncompressedSize)&&$p(s,r,zne)}function $p(e,t,n){e?v6(n):qd(t,n)}function qd(e,t,n){if(!e.some(i=>i.reason==t)){let i={reason:t};n!==ke&&(i.filename=n),e.push(i)}}function v6(e){let t=new Error(Cne);throw t.reason=e,t}function ys(e,t,n){return t[n]===ke?e.options[n]:t[n]}function rIe(e,t,n){return JS(ys(e,t,n))}function cEt(e){let t=(e&4294901760)>>16,n=e&65535,i=new Date(1980+((t&65024)>>9),((t&480)>>5)-1,t&31,(n&63488)>>11,(n&2016)>>5,(n&31)*2,0);return i<KS?KS:i}function Qte(e){return new Date(Number(e/BigInt(1e4)-BigInt(116444736e5)))}function SA(e,t){return e.getUint8(t)}function hr(e,t){return e.getUint16(t,!0)}function Pi(e,t){return e.getUint32(t,!0)}function Pf(e,t){let n=e.getBigUint64(t,!0);if(n>HTt)throw new Error(Dne);return Number(n)}var yw,gne,_ne,yne,Ane,bne,xne,w6,I6,P6,Tne,Ene,Cne,vne,Sne,wne,Ine,Pne,Dne,Rne,One,Mne,G6,Nne,D6,R6,O6,Lne,Fne,Bne,Aw,kne,Une,zne,UTt,zTt,Wwe,VTt,qwe,Ywe,oIe,jTt,Xwe,HTt,GTt,WTt,Kwe,Vne,M6,yT,N6,ene,Hne=Cs(()=>{cc();Gp();uT();m6();A6();Ete();cT();rw();BR();$te();MR();yw="File format is not recognized",gne="End of central directory not found",_ne="End of Zip64 central directory locator not found",yne="Central directory header not found",Ane="Local file header not found",bne="Zip64 extra field not found",xne="File contains encrypted entry",w6="Encryption method not supported",I6="Compression method not supported",P6="Split zip file",Tne="Overlapping entry found",Ene="Entry data out of bounds",Cne="Ambiguous archive",vne="Encrypted central directory is not supported",Sne="Unsafe filename",wne="Invalid strictness (must be 'strict', 'balanced' or 'tolerant')",Ine="Invalid filenameValidation (must be 'strict', 'balanced' or 'tolerant')",Pne="Invalid maxAppendedDataSize (must be a number greater than or equal to 0)",Dne="64-bit value exceeds Number.MAX_SAFE_INTEGER",Rne="unsorted central directory",One="unknown version needed to extract",Mne="compressed patched data",G6="malformed extra field",Nne="unknown zip64 extensible data",D6="wrapped entries count",R6="appended data",O6="prepended data",Lne="prepended central directory",Fne="trailing central directory data",Bne="duplicate filename",Aw="mismatched zip64 end of central directory record",kne="mismatched local file header (general purpose bit flag)",Une="mismatched local file header (compression method)",zne="mismatched local file header (crc32 or sizes)",UTt=63,zTt=/^[a-zA-Z]:/,Wwe="utf-8",VTt="UTF8",qwe="cp437",Ywe=2057,oIe=1,jTt=[[eO,4294967295],[Dte,4294967295],[Rte,4294967295],[Ote,65535]],Xwe={65535:{getValue:Pi,bytes:4},4294967295:{getValue:Pf,bytes:8}},HTt=BigInt(Number.MAX_SAFE_INTEGER),GTt=64,WTt=1032,Kwe=0,Vne=1,M6=2,yT=class{constructor(t,n={}){Object.assign(this,{reader:new Gg(t),options:n,readRanges:new Map})}async*getEntriesGenerator(t={}){let n=this,{reader:i}=n;if(await vc(i),(i.size===ke||!i.readUint8Array)&&(i=new zu(await Yp(i.readable)),await vc(i)),i.size<22)throw new Error(yw);let r=n.warnings=[],o=jne(t,n.options),s=o==AA,a=o!=zg,c=fIe(ys(n,t,Jee),o),u=rEt(ys(n,t,vSe),o),f=ys(n,t,SSe),{endOfDirectoryInfo:d,endOfDirectoryReachingEndCount:p}=await dIe(i,a,c);if(!d)throw await QTt(i)?new Error(P6):new Error(gne);a&&p>1&&v6("multiple end of central directory records");let g=li(d),m=Pi(g,12),y=Pi(g,16),A=d.offset,b=hr(g,20),x=A+22+b,T=i.size-x;T>c&&v6(R6),T>0&&qd(r,R6);let E=hr(g,4),v=i.lastDiskNumber||0,S=hr(g,6),I=hr(g,10),R=0,O,L,_,C,w=56,D,N=y==4294967295||m==4294967295||I==65535||S==65535;if(y!=4294967295&&S!=65535&&(y+=bw(i,S)),N){let He=d.offset>=20?await Do(i,d.offset-20,20):dr,Ye=li(He);if(He.length==20&&Pi(Ye,0)==117853008){y=bw(i,Pi(Ye,4))+Pf(Ye,8);let Ke=await Do(i,y,56),Pe=li(Ke),qe=d.offset-20-56;if((Ke.length<56||Pi(Pe,0)!=101075792)&&y!=qe&&qe>=0){let st=y;y=qe,y>st&&(R=y-st),Ke=await Do(i,y,56),Pe=li(Ke)}if(Ke.length<56||Pi(Pe,0)!=101075792)throw new Error(_ne);if(_=!0,C=Pf(Pe,4)>44,C){let st=Math.min(Pf(Pe,4)-44,i.size-y-56);if(st>0){w+=st;let vt=await Do(i,y+56,st);D=YTt(vt)}}E==65535?E=Pi(Pe,16):E!=Pi(Pe,16)&&$p(s,r,Aw),S==65535?S=Pi(Pe,20):S!=Pi(Pe,20)&&$p(s,r,Aw),I==65535?I=Pf(Pe,32):I!=Pf(Pe,32)&&$p(s,r,Aw),m==4294967295?m=Pf(Pe,40):m!=Pf(Pe,40)&&$p(s,r,Aw),y=bw(i,S)+Pf(Pe,48)+R}}let F=m,V=d.offset-(_?w+20:0);if(y>=i.size&&(R=i.size-y-m-22,y=i.size-m-22),v!=E)throw new Error(P6);if(y<0)throw new Error(yw);let B=0,j=await Do(i,y,m),k=li(j);if(m){if(j.length<4)throw new Error(yw);let He=V-m;if(y!=He&&S==E){let Ye=Pi(k,B)==33639248||!!(D&&D.compressedSize)||Jte(k),Ke=!Ye;if(!Ke&&He>=0&&He+4<=i.size){let Pe=await Do(i,He,4);Ke=Pi(li(Pe),0)==33639248}if(Ke){let Pe=y;y=He,y>Pe&&(R+=y-Pe,O=Ye),j=await Do(i,y,m),k=li(j)}}}let G=V-y;if(m!=G&&G>=0&&S==E&&(m=G,j=await Do(i,y,m),k=li(j)),y<0||y>=i.size)throw new Error(yw);n.directoryOffset=y,n.directoryLength=F;let q=rIe(n,t,wSe),Q,W;if(q&&I&&j.length>=4&&Pi(k,0)!=33639248&&(C||Jte(k))){let He=qTt(D,F,j.length);W=j.subarray(He),j=await q(j.subarray(0,He),D),k=li(j),F=j.length,Q=!0}D&&!Q&&(j.length<4||Pi(k,0)==33639248)&&qd(r,Nne),L=y;let J=ys(n,t,Jve),Z=ys(n,t,Zve),ae=new Set,Ae,fe=-1,xe=!s&&!_;!I&&xe&&(I=$we(k,j,B),I&&qd(r,D6));for(let He=0;He<I;He++){let Ye=new ene(i,n.options);if(B+46>j.length||Pi(k,B)!=33639248)throw He==0&&!Q&&(C||Jte(k))?new Error(vne):new Error(yne);aIe(Ye,k,B+6);let Ke=!!Ye.bitFlag.languageEncodingFlag,Pe=B+46,qe=Pe+Ye.filenameLength,st=qe+Ye.extraFieldLength,vt=hr(k,B+4),jt=vt>>8==0,lt=vt>>8==3,mt=j.subarray(Pe,qe),ft=hr(k,B+32),Yt=st+ft,rt=j.subarray(st,Yt),ht=Ke,Li=Ke,Yn=Pi(k,B+38),yi=Yn&255,zi={readOnly:!!(yi&1),hidden:!!(yi&2),system:!!(yi&4),directory:!!(yi&16),archive:!!(yi&32)},Si=Pi(k,B+42),ui=rIe(n,t,Qve)||KR,Ai=ht?Wwe:J||qwe,zn=Li?Wwe:Z||qwe,tn=ui(mt,Ai,kj);if(tn===ke&&(tn=KR(mt,Ai)),f){let Fi=f(tn);Fi!==ke&&(tn=Fi)}if(oEt(tn,u)){let Fi=new Error(Sne);throw Fi.filename=tn,Fi}let Hn=ui(rt,zn,Uj);Hn===ke&&(Hn=KR(rt,zn)),Object.assign(Ye,{index:He,decryptedDirectory:Q,versionMadeBy:vt,msDosCompatible:jt,zip64:!1,compressedSize:0,uncompressedSize:0,commentLength:ft,offset:Si,diskNumberStart:hr(k,B+34),internalFileAttributes:hr(k,B+36),externalFileAttributes:Yn,msdosAttributesRaw:yi,msdosAttributes:zi,rawFilename:mt,filenameUTF8:ht,commentUTF8:Li,rawExtraField:j.subarray(qe,st),rawComment:rt,filename:tn,comment:Hn}),cIe(Ye,Ye,k,B+6)&&qd(r,G6,tn),Ye.offset+=R;let Ki=bw(i,Ye.diskNumberStart)+Ye.offset;L=Math.min(Ki,L),Ki<fe&&qd(r,Rne,tn),fe=Ki,(Ye.version&255)>UTt&&qd(r,One,tn),(Ye.rawBitFlag&32)==32&&qd(r,Mne,tn),ae.has(Ye.filename)&&(Ae=!0),ae.add(Ye.filename);let wr=Ye.externalFileAttributes>>16&65535;Ye.unixMode===ke&&(wr&16877)!=0&&(Ye.unixMode=wr);let so=!!(Ye.unixMode&2048),Ts=!!(Ye.unixMode&1024),zs=!!(Ye.unixMode&512),pi=((Ye.unixMode===ke?wr:Ye.unixMode)&61440)==40960,ao=!pi&&(Ye.unixMode!==ke?(Ye.unixMode&73)!=0:lt&&(wr&73)!=0),nr=Ye.unixMode!==ke&&(Ye.unixMode&61440)==16384,jo=(wr&61440)==16384;Object.assign(Ye,{setuid:so,setgid:Ts,sticky:zs,symlink:pi,unixExternalUpper:wr,internalFileAttribute:Ye.internalFileAttributes,externalFileAttribute:Ye.externalFileAttributes,executable:ao,directory:nr||jo||jt&&zi.directory||Ye.filename.endsWith("/"),zipCrypto:Ye.encrypted&&!Ye.extraFieldAES});let Fn=new CA(Ye);if(Fn.getData=(Fi,Ir)=>Ye.getData(Fi,Fn,n.readRanges,Ir),Fn.arrayBuffer=async Fi=>{let Ir=new TransformStream,Mc=Yp(Ir.readable).then(Yf=>Yf.arrayBuffer());return Mc.catch(()=>{}),await Ye.getData(Ir,Fn,n.readRanges,Fi),Mc},B=Yt,He==I-1&&xe){let Fi=$we(k,j,B);Fi&&(I+=Fi,qd(r,D6))}let{onprogress:Vi}=t;if(Vi)try{await Vi(He+1,I,new CA(Ye))}catch{}yield Fn}let ge=B,we=Zte(j.subarray(B))||(Q?Zte(W):ke);if(!we&&!Q){let He=y+B,Ye=Math.min(V-He,65541);Ye>=6&&(we=Zte(await Do(i,He,Ye)))}we&&(n.digitalSignature=we,ge=B+6+we.length),(B!=F&&ge!=F||!Q&&B!=m&&ge!=m)&&$p(s,r,Fne),Ae&&$p(s,r,Bne);let ve=ys(n,t,eSe),Re=ys(n,t,tSe),Qe=(s||ve)&&I&&L==4&&await eEt(i)?4:0;return s&&(R||I&&L>Qe)&&v6(O6),(R||I&&L>4)&&qd(r,O6),O&&qd(r,Lne),ve&&(n.prependedData=L>Qe?await Do(i,Qe,L-Qe):dr),n.comment=b?await Do(i,A+22,b):dr,Re&&(n.appendedData=x<i.size?await Do(i,x,i.size-x):dr),!0}async getEntries(t={}){let n=[];for await(let i of this.getEntriesGenerator(t))n.push(i);return n}async close(){let{reader:t}=this;!t.readUint8Array&&t.readable&&!t.readable.locked&&await t.readable.cancel()}},N6=class{constructor(t={}){let{readable:n,writable:i}=new TransformStream,r=new yT(n,t).getEntriesGenerator();this.readable=new ReadableStream({async pull(o){let{done:s,value:a}=await r.next();if(s)return o.close();let c={...a,readable:(function(){let{readable:u,writable:f}=new TransformStream;if(a.getData)return d(),u;async function d(){try{await a.getData(f)}catch(p){try{await f.abort(p)}catch{}}}})()};delete c.getData,o.enqueue(c)}}),this.writable=i}};ene=class{constructor(t,n){Object.assign(this,{reader:t,options:n})}async getData(t,n,i,r={}){let o=this,s=Vg(),{reader:a,index:c,offset:u,diskNumberStart:f,extraFieldAES:d,extraFieldZip64:p,compressionMethod:g,bitFlag:m,rawBitFlag:y,crc32:A,rawLastModDate:b,uncompressedSize:x,compressedSize:T}=o,{dataDescriptor:E}=m,v=n.localDirectory={},S=n.warnings=[],I=bw(a,f)+u,R=await Do(a,I,30),O=li(R),L=ys(o,r,Dj),_=ys(o,r,Rj),C=ys(o,r,Oj);if(jj(L,_),L=L&&L.length&&L,_=_&&_.length&&_,d&&d.originalCompressionMethod!=99)throw new Error(I6);if(R.length<30||Pi(O,0)!=67324752)throw new Error(Ane);aIe(v,O,4);let{extraFieldLength:w,filenameLength:D}=v,N=v.dataOffset=I+30+D+w,F=ys(o,r,sSe),V=jne(r,o.options),B=nEt(F,V),j=iEt(F,V),k=dr;if(j&&(D||w)){let ft=await Do(a,I+30,D+w);k=ft.subarray(0,D),v.rawExtraField=ft.subarray(D)}else v.rawExtraField=w?await Do(a,I+30+D,w):dr;j&&(v.rawFilename=k),cIe(o,v,O,4,!0)&&qd(S,G6),aEt(o,v,k,j,B?ke:S);let{lastAccessDate:G,creationDate:q,uid:Q,gid:W}=v;G&&(n.lastAccessDate=G),q&&(n.creationDate=q),Q!==ke&&n.uid===ke&&(n.uid=Q),W!==ke&&n.gid===ke&&(n.gid=W);let J=o.encrypted&&v.encrypted&&!C,Z=J&&!d;if(C||(n.zipCrypto=Z),J&&(v.rawBitFlag&64)==64)throw new Error(w6);let ae=C?ke:Zj(g);if(g!=0&&g!=8&&g!=9&&!ae&&!C)throw new Error(I6);if(J){if(!Z&&(d.strength<1||d.strength>3))throw new Error(w6);if(!L&&!_)throw new Error(xne)}if(N+T>a.size)throw new Error(Ene);let Ae=T,fe=am(a.createReadable({offset:N,size:Ae})),xe=Vj(ys(o,r,Mj)),ge=ys(o,r,nSe),we=ys(o,r,rSe),ve=ys(o,r,iSe);ve&&(we=!0);let{onstart:Re,onprogress:Qe,onend:He}=r,Ye=g!=0&&!C,Ke=C?T:x,Pe=g==9,qe=ys(o,r,Lj);Pe&&(qe=!1);let st=ys(o,r,cSe),vt=(st===ke?ys(o,r,aSe):st)&&!C&&(!J||Z||d&&d.vendorVersion==oIe),jt={options:{codecType:o6,password:L,rawPassword:_,zipCrypto:Z,encryptionStrength:d&&d.strength,checkCrc32:vt,checkAuthenticationCode:ys(o,r,lSe),passwordVerification:Z&&(E?b>>>8&255:A>>>24&255),outputSize:Ke,crc32:A,compressed:Ye,encrypted:J,useWebWorkers:ys(o,r,Nj),useCompressionStream:qe,transferStreams:ys(o,r,Fj),deflate64:Pe,format:ae?ae.format:ke,codecURI:ae?ae.codecURI:ke,compressionMethod:g,rawBitFlag:y,checkPasswordOnly:ge},config:s,streamOptions:{signal:xe,size:Ae,onstart:Re,onprogress:Qe,onend:He}};we&&await ZTt({reader:a,fileEntry:n,index:c,offset:I,crc32:A,compressedSize:T,uncompressedSize:x,dataOffset:N,dataDescriptor:E||v.bitFlag.dataDescriptor,extraFieldZip64:p||v.extraFieldZip64,readRanges:i});let lt,mt;try{if(!ve){ge&&(t=new WritableStream),t=new pw(t),await vc(t,tEt(Ke,T,Ye)),{writable:lt}=t;let{outputSize:ft}=await h6({readable:fe,writable:lt},jt);if(t.size+=ft,ft!=Ke)throw new Error(EA)}}catch(ft){if(ft.outputSize!==ke&&(t.size+=ft.outputSize),!ge||ft.message!=jg)throw mt=ft,ft}finally{if(!(!y6(t)&&ys(o,r,Bj))&<&&!lt.locked){let Yt=lt.getWriter();if(mt)try{await Yt.abort(mt)}catch{}else await Yt.close()}}return ge||ve?ke:t.getData?t.getData():lt}}});var Ose=uh((Efr,PM)=>{/*! + */(function(e,t){"use strict";typeof SN=="object"&&SN.exports?SN.exports=t(Ece(),vce(),wce()):typeof define=="function"&&define.amd?define(["./punycode","./IPv6","./SecondLevelDomains"],t):e.URI=t(e.punycode,e.IPv6,e.SecondLevelDomains,e)})(Ice,function(e,t,n,i){"use strict";var r=i&&i.URI;function o(C,w){var D=arguments.length>=1,N=arguments.length>=2;if(!(this instanceof o))return D?N?new o(C,w):new o(C):new o;if(C===void 0){if(D)throw new TypeError("undefined is not a valid argument for URI");typeof location<"u"?C=location.href+"":C=""}if(C===null&&D)throw new TypeError("null is not a valid argument for URI");return this.href(C),w!==void 0?this.absoluteTo(w):this}function s(C){return/^[0-9]+$/.test(C)}o.version="1.19.11";var a=o.prototype,c=Object.prototype.hasOwnProperty;function u(C){return C.replace(/([.*+?^=!:${}()|[\]\/\\])/g,"\\$1")}function f(C){return C===void 0?"Undefined":String(Object.prototype.toString.call(C)).slice(8,-1)}function d(C){return f(C)==="Array"}function p(C,w){var D={},N,F;if(f(w)==="RegExp")D=null;else if(d(w))for(N=0,F=w.length;N<F;N++)D[w[N]]=!0;else D[w]=!0;for(N=0,F=C.length;N<F;N++){var V=D&&D[C[N]]!==void 0||!D&&w.test(C[N]);V&&(C.splice(N,1),F--,N--)}return C}function g(C,w){var D,N;if(d(w)){for(D=0,N=w.length;D<N;D++)if(!g(C,w[D]))return!1;return!0}var F=f(w);for(D=0,N=C.length;D<N;D++)if(F==="RegExp"){if(typeof C[D]=="string"&&C[D].match(w))return!0}else if(C[D]===w)return!0;return!1}function m(C,w){if(!d(C)||!d(w)||C.length!==w.length)return!1;C.sort(),w.sort();for(var D=0,N=C.length;D<N;D++)if(C[D]!==w[D])return!1;return!0}function y(C){var w=/^\/+|\/+$/g;return C.replace(w,"")}o._parts=function(){return{protocol:null,username:null,password:null,hostname:null,urn:null,port:null,path:null,query:null,fragment:null,preventInvalidHostname:o.preventInvalidHostname,duplicateQueryParameters:o.duplicateQueryParameters,escapeQuerySpace:o.escapeQuerySpace}},o.preventInvalidHostname=!1,o.duplicateQueryParameters=!1,o.escapeQuerySpace=!0,o.protocol_expression=/^[a-z][a-z0-9.+-]*$/i,o.idn_expression=/[^a-z0-9\._-]/i,o.punycode_expression=/(xn--)/i,o.ip4_expression=/^\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}$/,o.ip6_expression=/^\s*((([0-9A-Fa-f]{1,4}:){7}([0-9A-Fa-f]{1,4}|:))|(([0-9A-Fa-f]{1,4}:){6}(:[0-9A-Fa-f]{1,4}|((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9A-Fa-f]{1,4}:){5}(((:[0-9A-Fa-f]{1,4}){1,2})|:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9A-Fa-f]{1,4}:){4}(((:[0-9A-Fa-f]{1,4}){1,3})|((:[0-9A-Fa-f]{1,4})?:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){3}(((:[0-9A-Fa-f]{1,4}){1,4})|((:[0-9A-Fa-f]{1,4}){0,2}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){2}(((:[0-9A-Fa-f]{1,4}){1,5})|((:[0-9A-Fa-f]{1,4}){0,3}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){1}(((:[0-9A-Fa-f]{1,4}){1,6})|((:[0-9A-Fa-f]{1,4}){0,4}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(:(((:[0-9A-Fa-f]{1,4}){1,7})|((:[0-9A-Fa-f]{1,4}){0,5}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:)))(%.+)?\s*$/,o.find_uri_expression=/\b((?:[a-z][\w-]+:(?:\/{1,3}|[a-z0-9%])|www\d{0,3}[.]|[a-z0-9.\-]+[.][a-z]{2,4}\/)(?:[^\s()<>]+|\(([^\s()<>]+|(\([^\s()<>]+\)))*\))+(?:\(([^\s()<>]+|(\([^\s()<>]+\)))*\)|[^\s`!()\[\]{};:'".,<>?«»“”‘’]))/ig,o.findUri={start:/\b(?:([a-z][a-z0-9.+-]*:\/\/)|www\.)/gi,end:/[\s\r\n]|$/,trim:/[`!()\[\]{};:'".,<>?«»“”„‘’]+$/,parens:/(\([^\)]*\)|\[[^\]]*\]|\{[^}]*\}|<[^>]*>)/g},o.leading_whitespace_expression=/^[\x00-\x20\u00a0\u1680\u2000-\u200a\u2028\u2029\u202f\u205f\u3000\ufeff]+/,o.ascii_tab_whitespace=/[\u0009\u000A\u000D]+/g,o.defaultPorts={http:"80",https:"443",ftp:"21",gopher:"70",ws:"80",wss:"443"},o.hostProtocols=["http","https"],o.invalid_hostname_characters=/[^a-zA-Z0-9\.\-:_]/,o.domAttributes={a:"href",blockquote:"cite",link:"href",base:"href",script:"src",form:"action",img:"src",area:"href",iframe:"src",embed:"src",source:"src",track:"src",input:"src",audio:"src",video:"src"},o.getDomAttribute=function(C){if(!(!C||!C.nodeName)){var w=C.nodeName.toLowerCase();if(!(w==="input"&&C.type!=="image"))return o.domAttributes[w]}};function A(C){return escape(C)}function b(C){return encodeURIComponent(C).replace(/[!'()*]/g,A).replace(/\*/g,"%2A")}o.encode=b,o.decode=decodeURIComponent,o.iso8859=function(){o.encode=escape,o.decode=unescape},o.unicode=function(){o.encode=b,o.decode=decodeURIComponent},o.characters={pathname:{encode:{expression:/%(24|26|2B|2C|3B|3D|3A|40)/ig,map:{"%24":"$","%26":"&","%2B":"+","%2C":",","%3B":";","%3D":"=","%3A":":","%40":"@"}},decode:{expression:/[\/\?#]/g,map:{"/":"%2F","?":"%3F","#":"%23"}}},reserved:{encode:{expression:/%(21|23|24|26|27|28|29|2A|2B|2C|2F|3A|3B|3D|3F|40|5B|5D)/ig,map:{"%3A":":","%2F":"/","%3F":"?","%23":"#","%5B":"[","%5D":"]","%40":"@","%21":"!","%24":"$","%26":"&","%27":"'","%28":"(","%29":")","%2A":"*","%2B":"+","%2C":",","%3B":";","%3D":"="}}},urnpath:{encode:{expression:/%(21|24|27|28|29|2A|2B|2C|3B|3D|40)/ig,map:{"%21":"!","%24":"$","%27":"'","%28":"(","%29":")","%2A":"*","%2B":"+","%2C":",","%3B":";","%3D":"=","%40":"@"}},decode:{expression:/[\/\?#:]/g,map:{"/":"%2F","?":"%3F","#":"%23",":":"%3A"}}}},o.encodeQuery=function(C,w){var D=o.encode(C+"");return w===void 0&&(w=o.escapeQuerySpace),w?D.replace(/%20/g,"+"):D},o.decodeQuery=function(C,w){C+="",w===void 0&&(w=o.escapeQuerySpace);try{return o.decode(w?C.replace(/\+/g,"%20"):C)}catch{return C}};var x={encode:"encode",decode:"decode"},T,E=function(C,w){return function(D){try{return o[w](D+"").replace(o.characters[C][w].expression,function(N){return o.characters[C][w].map[N]})}catch{return D}}};for(T in x)o[T+"PathSegment"]=E("pathname",x[T]),o[T+"UrnPathSegment"]=E("urnpath",x[T]);var v=function(C,w,D){return function(N){var F;D?F=function(k){return o[w](o[D](k))}:F=o[w];for(var V=(N+"").split(C),B=0,j=V.length;B<j;B++)V[B]=F(V[B]);return V.join(C)}};o.decodePath=v("/","decodePathSegment"),o.decodeUrnPath=v(":","decodeUrnPathSegment"),o.recodePath=v("/","encodePathSegment","decode"),o.recodeUrnPath=v(":","encodeUrnPathSegment","decode"),o.encodeReserved=E("reserved","encode"),o.parse=function(C,w){var D;return w||(w={preventInvalidHostname:o.preventInvalidHostname}),C=C.replace(o.leading_whitespace_expression,""),C=C.replace(o.ascii_tab_whitespace,""),D=C.indexOf("#"),D>-1&&(w.fragment=C.substring(D+1)||null,C=C.substring(0,D)),D=C.indexOf("?"),D>-1&&(w.query=C.substring(D+1)||null,C=C.substring(0,D)),C=C.replace(/^(https?|ftp|wss?)?:+[/\\]*/i,"$1://"),C=C.replace(/^[/\\]{2,}/i,"//"),C.substring(0,2)==="//"?(w.protocol=null,C=C.substring(2),C=o.parseAuthority(C,w)):(D=C.indexOf(":"),D>-1&&(w.protocol=C.substring(0,D)||null,w.protocol&&!w.protocol.match(o.protocol_expression)?w.protocol=void 0:C.substring(D+1,D+3).replace(/\\/g,"/")==="//"?(C=C.substring(D+3),C=o.parseAuthority(C,w)):(C=C.substring(D+1),w.urn=!0))),w.path=C,w},o.parseHost=function(C,w){C||(C=""),C=C.replace(/\\/g,"/");var D=C.indexOf("/"),N,F;if(D===-1&&(D=C.length),C.charAt(0)==="[")N=C.indexOf("]"),w.hostname=C.substring(1,N)||null,w.port=C.substring(N+2,D)||null,w.port==="/"&&(w.port=null);else{var V=C.indexOf(":"),B=C.indexOf("/"),j=C.indexOf(":",V+1);j!==-1&&(B===-1||j<B)?(w.hostname=C.substring(0,D)||null,w.port=null):(F=C.substring(0,D).split(":"),w.hostname=F[0]||null,w.port=F[1]||null)}return w.hostname&&C.substring(D).charAt(0)!=="/"&&(D++,C="/"+C),w.preventInvalidHostname&&o.ensureValidHostname(w.hostname,w.protocol),w.port&&o.ensureValidPort(w.port),C.substring(D)||"/"},o.parseAuthority=function(C,w){return C=o.parseUserinfo(C,w),o.parseHost(C,w)},o.parseUserinfo=function(C,w){var D=C,N=C.indexOf("\\");N!==-1&&(C=C.replace(/\\/g,"/"));var F=C.indexOf("/"),V=C.lastIndexOf("@",F>-1?F:C.length-1),B;return V>-1&&(F===-1||V<F)?(B=C.substring(0,V).split(":"),w.username=B[0]?o.decode(B[0]):null,B.shift(),w.password=B[0]?o.decode(B.join(":")):null,C=D.substring(V+1)):(w.username=null,w.password=null),C},o.parseQuery=function(C,w){if(!C)return{};if(C=C.replace(/&+/g,"&").replace(/^\?*&*|&+$/g,""),!C)return{};for(var D={},N=C.split("&"),F=N.length,V,B,j,k=0;k<F;k++)V=N[k].split("="),B=o.decodeQuery(V.shift(),w),j=V.length?o.decodeQuery(V.join("="),w):null,B!=="__proto__"&&(c.call(D,B)?((typeof D[B]=="string"||D[B]===null)&&(D[B]=[D[B]]),D[B].push(j)):D[B]=j);return D},o.build=function(C){var w="",D=!1;return C.protocol&&(w+=C.protocol+":"),!C.urn&&(w||C.hostname)&&(w+="//",D=!0),w+=o.buildAuthority(C)||"",typeof C.path=="string"&&(C.path.charAt(0)!=="/"&&D&&(w+="/"),w+=C.path),typeof C.query=="string"&&C.query&&(w+="?"+C.query),typeof C.fragment=="string"&&C.fragment&&(w+="#"+C.fragment),w},o.buildHost=function(C){var w="";if(C.hostname)o.ip6_expression.test(C.hostname)?w+="["+C.hostname+"]":w+=C.hostname;else return"";return C.port&&(w+=":"+C.port),w},o.buildAuthority=function(C){return o.buildUserinfo(C)+o.buildHost(C)},o.buildUserinfo=function(C){var w="";return C.username&&(w+=o.encode(C.username)),C.password&&(w+=":"+o.encode(C.password)),w&&(w+="@"),w},o.buildQuery=function(C,w,D){var N="",F,V,B,j;for(V in C)if(V!=="__proto__"&&c.call(C,V))if(d(C[V]))for(F={},B=0,j=C[V].length;B<j;B++)C[V][B]!==void 0&&F[C[V][B]+""]===void 0&&(N+="&"+o.buildQueryParameter(V,C[V][B],D),w!==!0&&(F[C[V][B]+""]=!0));else C[V]!==void 0&&(N+="&"+o.buildQueryParameter(V,C[V],D));return N.substring(1)},o.buildQueryParameter=function(C,w,D){return o.encodeQuery(C,D)+(w!==null?"="+o.encodeQuery(w,D):"")},o.addQuery=function(C,w,D){if(typeof w=="object")for(var N in w)c.call(w,N)&&o.addQuery(C,N,w[N]);else if(typeof w=="string"){if(C[w]===void 0){C[w]=D;return}else typeof C[w]=="string"&&(C[w]=[C[w]]);d(D)||(D=[D]),C[w]=(C[w]||[]).concat(D)}else throw new TypeError("URI.addQuery() accepts an object, string as the name parameter")},o.setQuery=function(C,w,D){if(typeof w=="object")for(var N in w)c.call(w,N)&&o.setQuery(C,N,w[N]);else if(typeof w=="string")C[w]=D===void 0?null:D;else throw new TypeError("URI.setQuery() accepts an object, string as the name parameter")},o.removeQuery=function(C,w,D){var N,F,V;if(d(w))for(N=0,F=w.length;N<F;N++)C[w[N]]=void 0;else if(f(w)==="RegExp")for(V in C)w.test(V)&&(C[V]=void 0);else if(typeof w=="object")for(V in w)c.call(w,V)&&o.removeQuery(C,V,w[V]);else if(typeof w=="string")D!==void 0?f(D)==="RegExp"?!d(C[w])&&D.test(C[w])?C[w]=void 0:C[w]=p(C[w],D):C[w]===String(D)&&(!d(D)||D.length===1)?C[w]=void 0:d(C[w])&&(C[w]=p(C[w],D)):C[w]=void 0;else throw new TypeError("URI.removeQuery() accepts an object, string, RegExp as the first parameter")},o.hasQuery=function(C,w,D,N){switch(f(w)){case"String":break;case"RegExp":for(var F in C)if(c.call(C,F)&&w.test(F)&&(D===void 0||o.hasQuery(C,F,D)))return!0;return!1;case"Object":for(var V in w)if(c.call(w,V)&&!o.hasQuery(C,V,w[V]))return!1;return!0;default:throw new TypeError("URI.hasQuery() accepts a string, regular expression or object as the name parameter")}switch(f(D)){case"Undefined":return w in C;case"Boolean":var B=!!(d(C[w])?C[w].length:C[w]);return D===B;case"Function":return!!D(C[w],w,C);case"Array":if(!d(C[w]))return!1;var j=N?g:m;return j(C[w],D);case"RegExp":return d(C[w])?N?g(C[w],D):!1:!!(C[w]&&C[w].match(D));case"Number":D=String(D);case"String":return d(C[w])?N?g(C[w],D):!1:C[w]===D;default:throw new TypeError("URI.hasQuery() accepts undefined, boolean, string, number, RegExp, Function as the value parameter")}},o.joinPaths=function(){for(var C=[],w=[],D=0,N=0;N<arguments.length;N++){var F=new o(arguments[N]);C.push(F);for(var V=F.segment(),B=0;B<V.length;B++)typeof V[B]=="string"&&w.push(V[B]),V[B]&&D++}if(!w.length||!D)return new o("");var j=new o("").segment(w);return(C[0].path()===""||C[0].path().slice(0,1)==="/")&&j.path("/"+j.path()),j.normalize()},o.commonPath=function(C,w){var D=Math.min(C.length,w.length),N;for(N=0;N<D;N++)if(C.charAt(N)!==w.charAt(N)){N--;break}return N<1?C.charAt(0)===w.charAt(0)&&C.charAt(0)==="/"?"/":"":((C.charAt(N)!=="/"||w.charAt(N)!=="/")&&(N=C.substring(0,N).lastIndexOf("/")),C.substring(0,N+1))},o.withinString=function(C,w,D){D||(D={});var N=D.start||o.findUri.start,F=D.end||o.findUri.end,V=D.trim||o.findUri.trim,B=D.parens||o.findUri.parens,j=/[a-z0-9-]=["']?$/i;for(N.lastIndex=0;;){var k=N.exec(C);if(!k)break;var G=k.index;if(D.ignoreHtml){var q=C.slice(Math.max(G-3,0),G);if(q&&j.test(q))continue}for(var Q=G+C.slice(G).search(F),W=C.slice(G,Q),J=-1;;){var Z=B.exec(W);if(!Z)break;var ae=Z.index+Z[0].length;J=Math.max(J,ae)}if(J>-1?W=W.slice(0,J)+W.slice(J).replace(V,""):W=W.replace(V,""),!(W.length<=k[0].length)&&!(D.ignore&&D.ignore.test(W))){Q=G+W.length;var Ae=w(W,G,Q,C);if(Ae===void 0){N.lastIndex=Q;continue}Ae=String(Ae),C=C.slice(0,G)+Ae+C.slice(Q),N.lastIndex=G+Ae.length}}return N.lastIndex=0,C},o.ensureValidHostname=function(C,w){var D=!!C,N=!!w,F=!1;if(N&&(F=g(o.hostProtocols,w)),F&&!D)throw new TypeError("Hostname cannot be empty, if protocol is "+w);if(C&&C.match(o.invalid_hostname_characters)){if(!e)throw new TypeError('Hostname "'+C+'" contains characters other than [A-Z0-9.-:_] and Punycode.js is not available');if(e.toASCII(C).match(o.invalid_hostname_characters))throw new TypeError('Hostname "'+C+'" contains characters other than [A-Z0-9.-:_]')}},o.ensureValidPort=function(C){if(C){var w=Number(C);if(!(s(w)&&w>0&&w<65536))throw new TypeError('Port "'+C+'" is not a valid port')}},o.noConflict=function(C){if(C){var w={URI:this.noConflict()};return i.URITemplate&&typeof i.URITemplate.noConflict=="function"&&(w.URITemplate=i.URITemplate.noConflict()),i.IPv6&&typeof i.IPv6.noConflict=="function"&&(w.IPv6=i.IPv6.noConflict()),i.SecondLevelDomains&&typeof i.SecondLevelDomains.noConflict=="function"&&(w.SecondLevelDomains=i.SecondLevelDomains.noConflict()),w}else i.URI===this&&(i.URI=r);return this},a.build=function(C){return C===!0?this._deferred_build=!0:(C===void 0||this._deferred_build)&&(this._string=o.build(this._parts),this._deferred_build=!1),this},a.clone=function(){return new o(this)},a.valueOf=a.toString=function(){return this.build(!1)._string};function S(C){return function(w,D){return w===void 0?this._parts[C]||"":(this._parts[C]=w||null,this.build(!D),this)}}function I(C,w){return function(D,N){return D===void 0?this._parts[C]||"":(D!==null&&(D=D+"",D.charAt(0)===w&&(D=D.substring(1))),this._parts[C]=D,this.build(!N),this)}}a.protocol=S("protocol"),a.username=S("username"),a.password=S("password"),a.hostname=S("hostname"),a.port=S("port"),a.query=I("query","?"),a.fragment=I("fragment","#"),a.search=function(C,w){var D=this.query(C,w);return typeof D=="string"&&D.length?"?"+D:D},a.hash=function(C,w){var D=this.fragment(C,w);return typeof D=="string"&&D.length?"#"+D:D},a.pathname=function(C,w){if(C===void 0||C===!0){var D=this._parts.path||(this._parts.hostname?"/":"");return C?(this._parts.urn?o.decodeUrnPath:o.decodePath)(D):D}else return this._parts.urn?this._parts.path=C?o.recodeUrnPath(C):"":this._parts.path=C?o.recodePath(C):"/",this.build(!w),this},a.path=a.pathname,a.href=function(C,w){var D;if(C===void 0)return this.toString();this._string="",this._parts=o._parts();var N=C instanceof o,F=typeof C=="object"&&(C.hostname||C.path||C.pathname);if(C.nodeName){var V=o.getDomAttribute(C);C=C[V]||"",F=!1}if(!N&&F&&C.pathname!==void 0&&(C=C.toString()),typeof C=="string"||C instanceof String)this._parts=o.parse(String(C),this._parts);else if(N||F){var B=N?C._parts:C;for(D in B)D!=="query"&&c.call(this._parts,D)&&(this._parts[D]=B[D]);B.query&&this.query(B.query,!1)}else throw new TypeError("invalid input");return this.build(!w),this},a.is=function(C){var w=!1,D=!1,N=!1,F=!1,V=!1,B=!1,j=!1,k=!this._parts.urn;switch(this._parts.hostname&&(k=!1,D=o.ip4_expression.test(this._parts.hostname),N=o.ip6_expression.test(this._parts.hostname),w=D||N,F=!w,V=F&&n&&n.has(this._parts.hostname),B=F&&o.idn_expression.test(this._parts.hostname),j=F&&o.punycode_expression.test(this._parts.hostname)),C.toLowerCase()){case"relative":return k;case"absolute":return!k;case"domain":case"name":return F;case"sld":return V;case"ip":return w;case"ip4":case"ipv4":case"inet4":return D;case"ip6":case"ipv6":case"inet6":return N;case"idn":return B;case"url":return!this._parts.urn;case"urn":return!!this._parts.urn;case"punycode":return j}return null};var R=a.protocol,O=a.port,L=a.hostname;a.protocol=function(C,w){if(C&&(C=C.replace(/:(\/\/)?$/,""),!C.match(o.protocol_expression)))throw new TypeError('Protocol "'+C+`" contains characters other than [A-Z0-9.+-] or doesn't start with [A-Z]`);return R.call(this,C,w)},a.scheme=a.protocol,a.port=function(C,w){return this._parts.urn?C===void 0?"":this:(C!==void 0&&(C===0&&(C=null),C&&(C+="",C.charAt(0)===":"&&(C=C.substring(1)),o.ensureValidPort(C))),O.call(this,C,w))},a.hostname=function(C,w){if(this._parts.urn)return C===void 0?"":this;if(C!==void 0){var D={preventInvalidHostname:this._parts.preventInvalidHostname},N=o.parseHost(C,D);if(N!=="/")throw new TypeError('Hostname "'+C+'" contains characters other than [A-Z0-9.-]');C=D.hostname,this._parts.preventInvalidHostname&&o.ensureValidHostname(C,this._parts.protocol)}return L.call(this,C,w)},a.origin=function(C,w){if(this._parts.urn)return C===void 0?"":this;if(C===void 0){var D=this.protocol(),N=this.authority();return N?(D?D+"://":"")+this.authority():""}else{var F=o(C);return this.protocol(F.protocol()).authority(F.authority()).build(!w),this}},a.host=function(C,w){if(this._parts.urn)return C===void 0?"":this;if(C===void 0)return this._parts.hostname?o.buildHost(this._parts):"";var D=o.parseHost(C,this._parts);if(D!=="/")throw new TypeError('Hostname "'+C+'" contains characters other than [A-Z0-9.-]');return this.build(!w),this},a.authority=function(C,w){if(this._parts.urn)return C===void 0?"":this;if(C===void 0)return this._parts.hostname?o.buildAuthority(this._parts):"";var D=o.parseAuthority(C,this._parts);if(D!=="/")throw new TypeError('Hostname "'+C+'" contains characters other than [A-Z0-9.-]');return this.build(!w),this},a.userinfo=function(C,w){if(this._parts.urn)return C===void 0?"":this;if(C===void 0){var D=o.buildUserinfo(this._parts);return D&&D.substring(0,D.length-1)}else return C[C.length-1]!=="@"&&(C+="@"),o.parseUserinfo(C,this._parts),this.build(!w),this},a.resource=function(C,w){var D;return C===void 0?this.path()+this.search()+this.hash():(D=o.parse(C),this._parts.path=D.path,this._parts.query=D.query,this._parts.fragment=D.fragment,this.build(!w),this)},a.subdomain=function(C,w){if(this._parts.urn)return C===void 0?"":this;if(C===void 0){if(!this._parts.hostname||this.is("IP"))return"";var D=this._parts.hostname.length-this.domain().length-1;return this._parts.hostname.substring(0,D)||""}else{var N=this._parts.hostname.length-this.domain().length,F=this._parts.hostname.substring(0,N),V=new RegExp("^"+u(F));if(C&&C.charAt(C.length-1)!=="."&&(C+="."),C.indexOf(":")!==-1)throw new TypeError("Domains cannot contain colons");return C&&o.ensureValidHostname(C,this._parts.protocol),this._parts.hostname=this._parts.hostname.replace(V,C),this.build(!w),this}},a.domain=function(C,w){if(this._parts.urn)return C===void 0?"":this;if(typeof C=="boolean"&&(w=C,C=void 0),C===void 0){if(!this._parts.hostname||this.is("IP"))return"";var D=this._parts.hostname.match(/\./g);if(D&&D.length<2)return this._parts.hostname;var N=this._parts.hostname.length-this.tld(w).length-1;return N=this._parts.hostname.lastIndexOf(".",N-1)+1,this._parts.hostname.substring(N)||""}else{if(!C)throw new TypeError("cannot set domain empty");if(C.indexOf(":")!==-1)throw new TypeError("Domains cannot contain colons");if(o.ensureValidHostname(C,this._parts.protocol),!this._parts.hostname||this.is("IP"))this._parts.hostname=C;else{var F=new RegExp(u(this.domain())+"$");this._parts.hostname=this._parts.hostname.replace(F,C)}return this.build(!w),this}},a.tld=function(C,w){if(this._parts.urn)return C===void 0?"":this;if(typeof C=="boolean"&&(w=C,C=void 0),C===void 0){if(!this._parts.hostname||this.is("IP"))return"";var D=this._parts.hostname.lastIndexOf("."),N=this._parts.hostname.substring(D+1);return w!==!0&&n&&n.list[N.toLowerCase()]&&n.get(this._parts.hostname)||N}else{var F;if(C)if(C.match(/[^a-zA-Z0-9-]/))if(n&&n.is(C))F=new RegExp(u(this.tld())+"$"),this._parts.hostname=this._parts.hostname.replace(F,C);else throw new TypeError('TLD "'+C+'" contains characters other than [A-Z0-9]');else{if(!this._parts.hostname||this.is("IP"))throw new ReferenceError("cannot set TLD on non-domain host");F=new RegExp(u(this.tld())+"$"),this._parts.hostname=this._parts.hostname.replace(F,C)}else throw new TypeError("cannot set TLD empty");return this.build(!w),this}},a.directory=function(C,w){if(this._parts.urn)return C===void 0?"":this;if(C===void 0||C===!0){if(!this._parts.path&&!this._parts.hostname)return"";if(this._parts.path==="/")return"/";var D=this._parts.path.length-this.filename().length-1,N=this._parts.path.substring(0,D)||(this._parts.hostname?"/":"");return C?o.decodePath(N):N}else{var F=this._parts.path.length-this.filename().length,V=this._parts.path.substring(0,F),B=new RegExp("^"+u(V));return this.is("relative")||(C||(C="/"),C.charAt(0)!=="/"&&(C="/"+C)),C&&C.charAt(C.length-1)!=="/"&&(C+="/"),C=o.recodePath(C),this._parts.path=this._parts.path.replace(B,C),this.build(!w),this}},a.filename=function(C,w){if(this._parts.urn)return C===void 0?"":this;if(typeof C!="string"){if(!this._parts.path||this._parts.path==="/")return"";var D=this._parts.path.lastIndexOf("/"),N=this._parts.path.substring(D+1);return C?o.decodePathSegment(N):N}else{var F=!1;C.charAt(0)==="/"&&(C=C.substring(1)),C.match(/\.?\//)&&(F=!0);var V=new RegExp(u(this.filename())+"$");return C=o.recodePath(C),this._parts.path=this._parts.path.replace(V,C),F?this.normalizePath(w):this.build(!w),this}},a.suffix=function(C,w){if(this._parts.urn)return C===void 0?"":this;if(C===void 0||C===!0){if(!this._parts.path||this._parts.path==="/")return"";var D=this.filename(),N=D.lastIndexOf("."),F,V;return N===-1?"":(F=D.substring(N+1),V=/^[a-z0-9%]+$/i.test(F)?F:"",C?o.decodePathSegment(V):V)}else{C.charAt(0)==="."&&(C=C.substring(1));var B=this.suffix(),j;if(B)C?j=new RegExp(u(B)+"$"):j=new RegExp(u("."+B)+"$");else{if(!C)return this;this._parts.path+="."+o.recodePath(C)}return j&&(C=o.recodePath(C),this._parts.path=this._parts.path.replace(j,C)),this.build(!w),this}},a.segment=function(C,w,D){var N=this._parts.urn?":":"/",F=this.path(),V=F.substring(0,1)==="/",B=F.split(N);if(C!==void 0&&typeof C!="number"&&(D=w,w=C,C=void 0),C!==void 0&&typeof C!="number")throw new Error('Bad segment "'+C+'", must be 0-based integer');if(V&&B.shift(),C<0&&(C=Math.max(B.length+C,0)),w===void 0)return C===void 0?B:B[C];if(C===null||B[C]===void 0)if(d(w)){B=[];for(var j=0,k=w.length;j<k;j++)!w[j].length&&(!B.length||!B[B.length-1].length)||(B.length&&!B[B.length-1].length&&B.pop(),B.push(y(w[j])))}else(w||typeof w=="string")&&(w=y(w),B[B.length-1]===""?B[B.length-1]=w:B.push(w));else w?B[C]=y(w):B.splice(C,1);return V&&B.unshift(""),this.path(B.join(N),D)},a.segmentCoded=function(C,w,D){var N,F,V;if(typeof C!="number"&&(D=w,w=C,C=void 0),w===void 0){if(N=this.segment(C,w,D),!d(N))N=N!==void 0?o.decode(N):void 0;else for(F=0,V=N.length;F<V;F++)N[F]=o.decode(N[F]);return N}if(!d(w))w=typeof w=="string"||w instanceof String?o.encode(w):w;else for(F=0,V=w.length;F<V;F++)w[F]=o.encode(w[F]);return this.segment(C,w,D)};var _=a.query;return a.query=function(C,w){if(C===!0)return o.parseQuery(this._parts.query,this._parts.escapeQuerySpace);if(typeof C=="function"){var D=o.parseQuery(this._parts.query,this._parts.escapeQuerySpace),N=C.call(this,D);return this._parts.query=o.buildQuery(N||D,this._parts.duplicateQueryParameters,this._parts.escapeQuerySpace),this.build(!w),this}else return C!==void 0&&typeof C!="string"?(this._parts.query=o.buildQuery(C,this._parts.duplicateQueryParameters,this._parts.escapeQuerySpace),this.build(!w),this):_.call(this,C,w)},a.setQuery=function(C,w,D){var N=o.parseQuery(this._parts.query,this._parts.escapeQuerySpace);if(typeof C=="string"||C instanceof String)N[C]=w!==void 0?w:null;else if(typeof C=="object")for(var F in C)c.call(C,F)&&(N[F]=C[F]);else throw new TypeError("URI.addQuery() accepts an object, string as the name parameter");return this._parts.query=o.buildQuery(N,this._parts.duplicateQueryParameters,this._parts.escapeQuerySpace),typeof C!="string"&&(D=w),this.build(!D),this},a.addQuery=function(C,w,D){var N=o.parseQuery(this._parts.query,this._parts.escapeQuerySpace);return o.addQuery(N,C,w===void 0?null:w),this._parts.query=o.buildQuery(N,this._parts.duplicateQueryParameters,this._parts.escapeQuerySpace),typeof C!="string"&&(D=w),this.build(!D),this},a.removeQuery=function(C,w,D){var N=o.parseQuery(this._parts.query,this._parts.escapeQuerySpace);return o.removeQuery(N,C,w),this._parts.query=o.buildQuery(N,this._parts.duplicateQueryParameters,this._parts.escapeQuerySpace),typeof C!="string"&&(D=w),this.build(!D),this},a.hasQuery=function(C,w,D){var N=o.parseQuery(this._parts.query,this._parts.escapeQuerySpace);return o.hasQuery(N,C,w,D)},a.setSearch=a.setQuery,a.addSearch=a.addQuery,a.removeSearch=a.removeQuery,a.hasSearch=a.hasQuery,a.normalize=function(){return this._parts.urn?this.normalizeProtocol(!1).normalizePath(!1).normalizeQuery(!1).normalizeFragment(!1).build():this.normalizeProtocol(!1).normalizeHostname(!1).normalizePort(!1).normalizePath(!1).normalizeQuery(!1).normalizeFragment(!1).build()},a.normalizeProtocol=function(C){return typeof this._parts.protocol=="string"&&(this._parts.protocol=this._parts.protocol.toLowerCase(),this.build(!C)),this},a.normalizeHostname=function(C){return this._parts.hostname&&(this.is("IDN")&&e?this._parts.hostname=e.toASCII(this._parts.hostname):this.is("IPv6")&&t&&(this._parts.hostname=t.best(this._parts.hostname)),this._parts.hostname=this._parts.hostname.toLowerCase(),this.build(!C)),this},a.normalizePort=function(C){return typeof this._parts.protocol=="string"&&this._parts.port===o.defaultPorts[this._parts.protocol]&&(this._parts.port=null,this.build(!C)),this},a.normalizePath=function(C){var w=this._parts.path;if(!w)return this;if(this._parts.urn)return this._parts.path=o.recodeUrnPath(this._parts.path),this.build(!C),this;if(this._parts.path==="/")return this;w=o.recodePath(w);var D,N="",F,V;for(w.charAt(0)!=="/"&&(D=!0,w="/"+w),(w.slice(-3)==="/.."||w.slice(-2)==="/.")&&(w+="/"),w=w.replace(/(\/(\.\/)+)|(\/\.$)/g,"/").replace(/\/{2,}/g,"/"),D&&(N=w.substring(1).match(/^(\.\.\/)+/)||"",N&&(N=N[0]));F=w.search(/\/\.\.(\/|$)/),F!==-1;){if(F===0){w=w.substring(3);continue}V=w.substring(0,F).lastIndexOf("/"),V===-1&&(V=F),w=w.substring(0,V)+w.substring(F+3)}return D&&this.is("relative")&&(w=N+w.substring(1)),this._parts.path=w,this.build(!C),this},a.normalizePathname=a.normalizePath,a.normalizeQuery=function(C){return typeof this._parts.query=="string"&&(this._parts.query.length?this.query(o.parseQuery(this._parts.query,this._parts.escapeQuerySpace)):this._parts.query=null,this.build(!C)),this},a.normalizeFragment=function(C){return this._parts.fragment||(this._parts.fragment=null,this.build(!C)),this},a.normalizeSearch=a.normalizeQuery,a.normalizeHash=a.normalizeFragment,a.iso8859=function(){var C=o.encode,w=o.decode;o.encode=escape,o.decode=decodeURIComponent;try{this.normalize()}finally{o.encode=C,o.decode=w}return this},a.unicode=function(){var C=o.encode,w=o.decode;o.encode=b,o.decode=unescape;try{this.normalize()}finally{o.encode=C,o.decode=w}return this},a.readable=function(){var C=this.clone();C.username("").password("").normalize();var w="";if(C._parts.protocol&&(w+=C._parts.protocol+"://"),C._parts.hostname&&(C.is("punycode")&&e?(w+=e.toUnicode(C._parts.hostname),C._parts.port&&(w+=":"+C._parts.port)):w+=C.host()),C._parts.hostname&&C._parts.path&&C._parts.path.charAt(0)!=="/"&&(w+="/"),w+=C.path(!0),C._parts.query){for(var D="",N=0,F=C._parts.query.split("&"),V=F.length;N<V;N++){var B=(F[N]||"").split("=");D+="&"+o.decodeQuery(B[0],this._parts.escapeQuerySpace).replace(/&/g,"%26"),B[1]!==void 0&&(D+="="+o.decodeQuery(B[1],this._parts.escapeQuerySpace).replace(/&/g,"%26"))}w+="?"+D.substring(1)}return w+=o.decodeQuery(C.hash(),!0),w},a.absoluteTo=function(C){var w=this.clone(),D=["protocol","username","password","hostname","port"],N,F,V;if(this._parts.urn)throw new Error("URNs do not have any generally defined hierarchical components");if(C instanceof o||(C=new o(C)),w._parts.protocol||(w._parts.protocol=C._parts.protocol,this._parts.hostname))return w;for(F=0;V=D[F];F++)w._parts[V]=C._parts[V];return w._parts.path?(w._parts.path.substring(-2)===".."&&(w._parts.path+="/"),w.path().charAt(0)!=="/"&&(N=C.directory(),N=N||(C.path().indexOf("/")===0?"/":""),w._parts.path=(N?N+"/":"")+w._parts.path,w.normalizePath())):(w._parts.path=C._parts.path,w._parts.query||(w._parts.query=C._parts.query)),w.build(),w},a.relativeTo=function(C){var w=this.clone().normalize(),D,N,F,V,B;if(w._parts.urn)throw new Error("URNs do not have any generally defined hierarchical components");if(C=new o(C).normalize(),D=w._parts,N=C._parts,V=w.path(),B=C.path(),V.charAt(0)!=="/")throw new Error("URI is already relative");if(B.charAt(0)!=="/")throw new Error("Cannot calculate a URI relative to another relative URI");if(D.protocol===N.protocol&&(D.protocol=null),D.username!==N.username||D.password!==N.password||D.protocol!==null||D.username!==null||D.password!==null)return w.build();if(D.hostname===N.hostname&&D.port===N.port)D.hostname=null,D.port=null;else return w.build();if(V===B)return D.path="",w.build();if(F=o.commonPath(V,B),!F)return w.build();var j=N.path.substring(F.length).replace(/[^\/]*$/,"").replace(/.*?\//g,"../");return D.path=j+D.path.substring(F.length)||"./",w.build()},a.equals=function(C){var w=this.clone(),D=new o(C),N={},F={},V={},B,j,k;if(w.normalize(),D.normalize(),w.toString()===D.toString())return!0;if(B=w.query(),j=D.query(),w.query(""),D.query(""),w.toString()!==D.toString()||B.length!==j.length)return!1;N=o.parseQuery(B,this._parts.escapeQuerySpace),F=o.parseQuery(j,this._parts.escapeQuerySpace);for(k in N)if(c.call(N,k)){if(d(N[k])){if(!m(N[k],F[k]))return!1}else if(N[k]!==F[k])return!1;V[k]=!0}for(k in F)if(c.call(F,k)&&!V[k])return!1;return!0},a.preventInvalidHostname=function(C){return this._parts.preventInvalidHostname=!!C,this},a.duplicateQueryParameters=function(C){return this._parts.duplicateQueryParameters=!!C,this},a.escapeQuerySpace=function(C){return this._parts.escapeQuerySpace=!!C,this},o})});var yme=uh((wgn,_me)=>{"use strict";_me.exports=S7e;var MP=1e20;function S7e(e,t){t||(t={});var n=t.cutoff==null?.25:t.cutoff,i=t.radius==null?8:t.radius,r=t.channel||0,o,s,a,c,u,f,d,p,g,m,y;if(ArrayBuffer.isView(e)||Array.isArray(e)){if(!t.width||!t.height)throw Error("For raw data width and height should be provided by options");o=t.width,s=t.height,c=e,t.stride?f=t.stride:f=Math.floor(e.length/o/s)}else window.HTMLCanvasElement&&e instanceof window.HTMLCanvasElement?(p=e,d=p.getContext("2d"),o=p.width,s=p.height,g=d.getImageData(0,0,o,s),c=g.data,f=4):window.CanvasRenderingContext2D&&e instanceof window.CanvasRenderingContext2D?(p=e.canvas,d=e,o=p.width,s=p.height,g=d.getImageData(0,0,o,s),c=g.data,f=4):window.ImageData&&e instanceof window.ImageData&&(g=e,o=e.width,s=e.height,c=g.data,f=4);if(a=Math.max(o,s),window.Uint8ClampedArray&&c instanceof window.Uint8ClampedArray||window.Uint8Array&&c instanceof window.Uint8Array)for(u=c,c=Array(o*s),m=0,y=Math.floor(u.length/f);m<y;m++)c[m]=u[m*f+r]/255;else if(f!==1)throw Error("Raw data can have only 1 value per pixel");var A=Array(o*s),b=Array(o*s),x=Array(a),T=Array(a),E=Array(a+1),v=Array(a);for(m=0,y=o*s;m<y;m++){var S=c[m];A[m]=S===1?0:S===0?MP:Math.pow(Math.max(0,.5-S),2),b[m]=S===1?MP:S===0?0:Math.pow(Math.max(0,S-.5),2)}pme(A,o,s,x,T,v,E),pme(b,o,s,x,T,v,E);var I=window.Float32Array?new Float32Array(o*s):new Array(o*s);for(m=0,y=o*s;m<y;m++)I[m]=Math.min(Math.max(1-((A[m]-b[m])/i+n),0),1);return I}function pme(e,t,n,i,r,o,s){for(var a=0;a<t;a++){for(var c=0;c<n;c++)i[c]=e[c*t+a];for(gme(i,r,o,s,n),c=0;c<n;c++)e[c*t+a]=r[c]}for(c=0;c<n;c++){for(a=0;a<t;a++)i[a]=e[c*t+a];for(gme(i,r,o,s,t),a=0;a<t;a++)e[c*t+a]=Math.sqrt(r[a])}}function gme(e,t,n,i,r){n[0]=0,i[0]=-MP,i[1]=+MP;for(var o=1,s=0;o<r;o++){for(var a=(e[o]+o*o-(e[n[s]]+n[s]*n[s]))/(2*o-2*n[s]);a<=i[s];)s--,a=(e[o]+o*o-(e[n[s]]+n[s]*n[s]))/(2*o-2*n[s]);s++,n[s]=o,i[s]=a,i[s+1]=+MP}for(o=0,s=0;o<r;o++){for(;i[s+1]<o;)s++;t[o]=(o-n[s])*(o-n[s])+e[n[s]]}}});var Ame=uh((Ign,Qk)=>{function w7e(){var e=0,t=1,n=2,i=3,r=4,o=5,s=6,a=7,c=8,u=9,f=10,d=11,p=12,g=13,m=14,y=15,A=16,b=17,x=0,T=1,E=2,v=3,S=4;function I(_,C){return 55296<=_.charCodeAt(C)&&_.charCodeAt(C)<=56319&&56320<=_.charCodeAt(C+1)&&_.charCodeAt(C+1)<=57343}function R(_,C){C===void 0&&(C=0);var w=_.charCodeAt(C);if(55296<=w&&w<=56319&&C<_.length-1){var D=w,N=_.charCodeAt(C+1);return 56320<=N&&N<=57343?(D-55296)*1024+(N-56320)+65536:D}if(56320<=w&&w<=57343&&C>=1){var D=_.charCodeAt(C-1),N=w;return 55296<=D&&D<=56319?(D-55296)*1024+(N-56320)+65536:N}return w}function O(_,C,w){var D=[_].concat(C).concat([w]),N=D[D.length-2],F=w,V=D.lastIndexOf(m);if(V>1&&D.slice(1,V).every(function(k){return k==i})&&[i,g,b].indexOf(_)==-1)return E;var B=D.lastIndexOf(r);if(B>0&&D.slice(1,B).every(function(k){return k==r})&&[p,r].indexOf(N)==-1)return D.filter(function(k){return k==r}).length%2==1?v:S;if(N==e&&F==t)return x;if(N==n||N==e||N==t)return F==m&&C.every(function(k){return k==i})?E:T;if(F==n||F==e||F==t)return T;if(N==s&&(F==s||F==a||F==u||F==f))return x;if((N==u||N==a)&&(F==a||F==c))return x;if((N==f||N==c)&&F==c)return x;if(F==i||F==y)return x;if(F==o)return x;if(N==p)return x;var j=D.indexOf(i)!=-1?D.lastIndexOf(i)-1:D.length-2;return[g,b].indexOf(D[j])!=-1&&D.slice(j+1,-1).every(function(k){return k==i})&&F==m||N==y&&[A,b].indexOf(F)!=-1?x:C.indexOf(r)!=-1?E:N==r&&F==r?x:T}this.nextBreak=function(_,C){if(C===void 0&&(C=0),C<0)return 0;if(C>=_.length-1)return _.length;for(var w=L(R(_,C)),D=[],N=C+1;N<_.length;N++)if(!I(_,N-1)){var F=L(R(_,N));if(O(w,D,F))return N;D.push(F)}return _.length},this.splitGraphemes=function(_){for(var C=[],w=0,D;(D=this.nextBreak(_,w))<_.length;)C.push(_.slice(w,D)),w=D;return w<_.length&&C.push(_.slice(w)),C},this.iterateGraphemes=function(_){var C=0,w={next:(function(){var D,N;return(N=this.nextBreak(_,C))<_.length?(D=_.slice(C,N),C=N,{value:D,done:!1}):C<_.length?(D=_.slice(C),C=_.length,{value:D,done:!1}):{value:void 0,done:!0}}).bind(this)};return typeof Symbol<"u"&&Symbol.iterator&&(w[Symbol.iterator]=function(){return w}),w},this.countGraphemes=function(_){for(var C=0,w=0,D;(D=this.nextBreak(_,w))<_.length;)w=D,C++;return w<_.length&&C++,C};function L(_){return 1536<=_&&_<=1541||_==1757||_==1807||_==2274||_==3406||_==69821||70082<=_&&_<=70083||_==72250||72326<=_&&_<=72329||_==73030?p:_==13?e:_==10?t:0<=_&&_<=9||11<=_&&_<=12||14<=_&&_<=31||127<=_&&_<=159||_==173||_==1564||_==6158||_==8203||8206<=_&&_<=8207||_==8232||_==8233||8234<=_&&_<=8238||8288<=_&&_<=8292||_==8293||8294<=_&&_<=8303||55296<=_&&_<=57343||_==65279||65520<=_&&_<=65528||65529<=_&&_<=65531||113824<=_&&_<=113827||119155<=_&&_<=119162||_==917504||_==917505||917506<=_&&_<=917535||917632<=_&&_<=917759||918e3<=_&&_<=921599?n:768<=_&&_<=879||1155<=_&&_<=1159||1160<=_&&_<=1161||1425<=_&&_<=1469||_==1471||1473<=_&&_<=1474||1476<=_&&_<=1477||_==1479||1552<=_&&_<=1562||1611<=_&&_<=1631||_==1648||1750<=_&&_<=1756||1759<=_&&_<=1764||1767<=_&&_<=1768||1770<=_&&_<=1773||_==1809||1840<=_&&_<=1866||1958<=_&&_<=1968||2027<=_&&_<=2035||2070<=_&&_<=2073||2075<=_&&_<=2083||2085<=_&&_<=2087||2089<=_&&_<=2093||2137<=_&&_<=2139||2260<=_&&_<=2273||2275<=_&&_<=2306||_==2362||_==2364||2369<=_&&_<=2376||_==2381||2385<=_&&_<=2391||2402<=_&&_<=2403||_==2433||_==2492||_==2494||2497<=_&&_<=2500||_==2509||_==2519||2530<=_&&_<=2531||2561<=_&&_<=2562||_==2620||2625<=_&&_<=2626||2631<=_&&_<=2632||2635<=_&&_<=2637||_==2641||2672<=_&&_<=2673||_==2677||2689<=_&&_<=2690||_==2748||2753<=_&&_<=2757||2759<=_&&_<=2760||_==2765||2786<=_&&_<=2787||2810<=_&&_<=2815||_==2817||_==2876||_==2878||_==2879||2881<=_&&_<=2884||_==2893||_==2902||_==2903||2914<=_&&_<=2915||_==2946||_==3006||_==3008||_==3021||_==3031||_==3072||3134<=_&&_<=3136||3142<=_&&_<=3144||3146<=_&&_<=3149||3157<=_&&_<=3158||3170<=_&&_<=3171||_==3201||_==3260||_==3263||_==3266||_==3270||3276<=_&&_<=3277||3285<=_&&_<=3286||3298<=_&&_<=3299||3328<=_&&_<=3329||3387<=_&&_<=3388||_==3390||3393<=_&&_<=3396||_==3405||_==3415||3426<=_&&_<=3427||_==3530||_==3535||3538<=_&&_<=3540||_==3542||_==3551||_==3633||3636<=_&&_<=3642||3655<=_&&_<=3662||_==3761||3764<=_&&_<=3769||3771<=_&&_<=3772||3784<=_&&_<=3789||3864<=_&&_<=3865||_==3893||_==3895||_==3897||3953<=_&&_<=3966||3968<=_&&_<=3972||3974<=_&&_<=3975||3981<=_&&_<=3991||3993<=_&&_<=4028||_==4038||4141<=_&&_<=4144||4146<=_&&_<=4151||4153<=_&&_<=4154||4157<=_&&_<=4158||4184<=_&&_<=4185||4190<=_&&_<=4192||4209<=_&&_<=4212||_==4226||4229<=_&&_<=4230||_==4237||_==4253||4957<=_&&_<=4959||5906<=_&&_<=5908||5938<=_&&_<=5940||5970<=_&&_<=5971||6002<=_&&_<=6003||6068<=_&&_<=6069||6071<=_&&_<=6077||_==6086||6089<=_&&_<=6099||_==6109||6155<=_&&_<=6157||6277<=_&&_<=6278||_==6313||6432<=_&&_<=6434||6439<=_&&_<=6440||_==6450||6457<=_&&_<=6459||6679<=_&&_<=6680||_==6683||_==6742||6744<=_&&_<=6750||_==6752||_==6754||6757<=_&&_<=6764||6771<=_&&_<=6780||_==6783||6832<=_&&_<=6845||_==6846||6912<=_&&_<=6915||_==6964||6966<=_&&_<=6970||_==6972||_==6978||7019<=_&&_<=7027||7040<=_&&_<=7041||7074<=_&&_<=7077||7080<=_&&_<=7081||7083<=_&&_<=7085||_==7142||7144<=_&&_<=7145||_==7149||7151<=_&&_<=7153||7212<=_&&_<=7219||7222<=_&&_<=7223||7376<=_&&_<=7378||7380<=_&&_<=7392||7394<=_&&_<=7400||_==7405||_==7412||7416<=_&&_<=7417||7616<=_&&_<=7673||7675<=_&&_<=7679||_==8204||8400<=_&&_<=8412||8413<=_&&_<=8416||_==8417||8418<=_&&_<=8420||8421<=_&&_<=8432||11503<=_&&_<=11505||_==11647||11744<=_&&_<=11775||12330<=_&&_<=12333||12334<=_&&_<=12335||12441<=_&&_<=12442||_==42607||42608<=_&&_<=42610||42612<=_&&_<=42621||42654<=_&&_<=42655||42736<=_&&_<=42737||_==43010||_==43014||_==43019||43045<=_&&_<=43046||43204<=_&&_<=43205||43232<=_&&_<=43249||43302<=_&&_<=43309||43335<=_&&_<=43345||43392<=_&&_<=43394||_==43443||43446<=_&&_<=43449||_==43452||_==43493||43561<=_&&_<=43566||43569<=_&&_<=43570||43573<=_&&_<=43574||_==43587||_==43596||_==43644||_==43696||43698<=_&&_<=43700||43703<=_&&_<=43704||43710<=_&&_<=43711||_==43713||43756<=_&&_<=43757||_==43766||_==44005||_==44008||_==44013||_==64286||65024<=_&&_<=65039||65056<=_&&_<=65071||65438<=_&&_<=65439||_==66045||_==66272||66422<=_&&_<=66426||68097<=_&&_<=68099||68101<=_&&_<=68102||68108<=_&&_<=68111||68152<=_&&_<=68154||_==68159||68325<=_&&_<=68326||_==69633||69688<=_&&_<=69702||69759<=_&&_<=69761||69811<=_&&_<=69814||69817<=_&&_<=69818||69888<=_&&_<=69890||69927<=_&&_<=69931||69933<=_&&_<=69940||_==70003||70016<=_&&_<=70017||70070<=_&&_<=70078||70090<=_&&_<=70092||70191<=_&&_<=70193||_==70196||70198<=_&&_<=70199||_==70206||_==70367||70371<=_&&_<=70378||70400<=_&&_<=70401||_==70460||_==70462||_==70464||_==70487||70502<=_&&_<=70508||70512<=_&&_<=70516||70712<=_&&_<=70719||70722<=_&&_<=70724||_==70726||_==70832||70835<=_&&_<=70840||_==70842||_==70845||70847<=_&&_<=70848||70850<=_&&_<=70851||_==71087||71090<=_&&_<=71093||71100<=_&&_<=71101||71103<=_&&_<=71104||71132<=_&&_<=71133||71219<=_&&_<=71226||_==71229||71231<=_&&_<=71232||_==71339||_==71341||71344<=_&&_<=71349||_==71351||71453<=_&&_<=71455||71458<=_&&_<=71461||71463<=_&&_<=71467||72193<=_&&_<=72198||72201<=_&&_<=72202||72243<=_&&_<=72248||72251<=_&&_<=72254||_==72263||72273<=_&&_<=72278||72281<=_&&_<=72283||72330<=_&&_<=72342||72344<=_&&_<=72345||72752<=_&&_<=72758||72760<=_&&_<=72765||_==72767||72850<=_&&_<=72871||72874<=_&&_<=72880||72882<=_&&_<=72883||72885<=_&&_<=72886||73009<=_&&_<=73014||_==73018||73020<=_&&_<=73021||73023<=_&&_<=73029||_==73031||92912<=_&&_<=92916||92976<=_&&_<=92982||94095<=_&&_<=94098||113821<=_&&_<=113822||_==119141||119143<=_&&_<=119145||119150<=_&&_<=119154||119163<=_&&_<=119170||119173<=_&&_<=119179||119210<=_&&_<=119213||119362<=_&&_<=119364||121344<=_&&_<=121398||121403<=_&&_<=121452||_==121461||_==121476||121499<=_&&_<=121503||121505<=_&&_<=121519||122880<=_&&_<=122886||122888<=_&&_<=122904||122907<=_&&_<=122913||122915<=_&&_<=122916||122918<=_&&_<=122922||125136<=_&&_<=125142||125252<=_&&_<=125258||917536<=_&&_<=917631||917760<=_&&_<=917999?i:127462<=_&&_<=127487?r:_==2307||_==2363||2366<=_&&_<=2368||2377<=_&&_<=2380||2382<=_&&_<=2383||2434<=_&&_<=2435||2495<=_&&_<=2496||2503<=_&&_<=2504||2507<=_&&_<=2508||_==2563||2622<=_&&_<=2624||_==2691||2750<=_&&_<=2752||_==2761||2763<=_&&_<=2764||2818<=_&&_<=2819||_==2880||2887<=_&&_<=2888||2891<=_&&_<=2892||_==3007||3009<=_&&_<=3010||3014<=_&&_<=3016||3018<=_&&_<=3020||3073<=_&&_<=3075||3137<=_&&_<=3140||3202<=_&&_<=3203||_==3262||3264<=_&&_<=3265||3267<=_&&_<=3268||3271<=_&&_<=3272||3274<=_&&_<=3275||3330<=_&&_<=3331||3391<=_&&_<=3392||3398<=_&&_<=3400||3402<=_&&_<=3404||3458<=_&&_<=3459||3536<=_&&_<=3537||3544<=_&&_<=3550||3570<=_&&_<=3571||_==3635||_==3763||3902<=_&&_<=3903||_==3967||_==4145||4155<=_&&_<=4156||4182<=_&&_<=4183||_==4228||_==6070||6078<=_&&_<=6085||6087<=_&&_<=6088||6435<=_&&_<=6438||6441<=_&&_<=6443||6448<=_&&_<=6449||6451<=_&&_<=6456||6681<=_&&_<=6682||_==6741||_==6743||6765<=_&&_<=6770||_==6916||_==6965||_==6971||6973<=_&&_<=6977||6979<=_&&_<=6980||_==7042||_==7073||7078<=_&&_<=7079||_==7082||_==7143||7146<=_&&_<=7148||_==7150||7154<=_&&_<=7155||7204<=_&&_<=7211||7220<=_&&_<=7221||_==7393||7410<=_&&_<=7411||_==7415||43043<=_&&_<=43044||_==43047||43136<=_&&_<=43137||43188<=_&&_<=43203||43346<=_&&_<=43347||_==43395||43444<=_&&_<=43445||43450<=_&&_<=43451||43453<=_&&_<=43456||43567<=_&&_<=43568||43571<=_&&_<=43572||_==43597||_==43755||43758<=_&&_<=43759||_==43765||44003<=_&&_<=44004||44006<=_&&_<=44007||44009<=_&&_<=44010||_==44012||_==69632||_==69634||_==69762||69808<=_&&_<=69810||69815<=_&&_<=69816||_==69932||_==70018||70067<=_&&_<=70069||70079<=_&&_<=70080||70188<=_&&_<=70190||70194<=_&&_<=70195||_==70197||70368<=_&&_<=70370||70402<=_&&_<=70403||_==70463||70465<=_&&_<=70468||70471<=_&&_<=70472||70475<=_&&_<=70477||70498<=_&&_<=70499||70709<=_&&_<=70711||70720<=_&&_<=70721||_==70725||70833<=_&&_<=70834||_==70841||70843<=_&&_<=70844||_==70846||_==70849||71088<=_&&_<=71089||71096<=_&&_<=71099||_==71102||71216<=_&&_<=71218||71227<=_&&_<=71228||_==71230||_==71340||71342<=_&&_<=71343||_==71350||71456<=_&&_<=71457||_==71462||72199<=_&&_<=72200||_==72249||72279<=_&&_<=72280||_==72343||_==72751||_==72766||_==72873||_==72881||_==72884||94033<=_&&_<=94078||_==119142||_==119149?o:4352<=_&&_<=4447||43360<=_&&_<=43388?s:4448<=_&&_<=4519||55216<=_&&_<=55238?a:4520<=_&&_<=4607||55243<=_&&_<=55291?c:_==44032||_==44060||_==44088||_==44116||_==44144||_==44172||_==44200||_==44228||_==44256||_==44284||_==44312||_==44340||_==44368||_==44396||_==44424||_==44452||_==44480||_==44508||_==44536||_==44564||_==44592||_==44620||_==44648||_==44676||_==44704||_==44732||_==44760||_==44788||_==44816||_==44844||_==44872||_==44900||_==44928||_==44956||_==44984||_==45012||_==45040||_==45068||_==45096||_==45124||_==45152||_==45180||_==45208||_==45236||_==45264||_==45292||_==45320||_==45348||_==45376||_==45404||_==45432||_==45460||_==45488||_==45516||_==45544||_==45572||_==45600||_==45628||_==45656||_==45684||_==45712||_==45740||_==45768||_==45796||_==45824||_==45852||_==45880||_==45908||_==45936||_==45964||_==45992||_==46020||_==46048||_==46076||_==46104||_==46132||_==46160||_==46188||_==46216||_==46244||_==46272||_==46300||_==46328||_==46356||_==46384||_==46412||_==46440||_==46468||_==46496||_==46524||_==46552||_==46580||_==46608||_==46636||_==46664||_==46692||_==46720||_==46748||_==46776||_==46804||_==46832||_==46860||_==46888||_==46916||_==46944||_==46972||_==47e3||_==47028||_==47056||_==47084||_==47112||_==47140||_==47168||_==47196||_==47224||_==47252||_==47280||_==47308||_==47336||_==47364||_==47392||_==47420||_==47448||_==47476||_==47504||_==47532||_==47560||_==47588||_==47616||_==47644||_==47672||_==47700||_==47728||_==47756||_==47784||_==47812||_==47840||_==47868||_==47896||_==47924||_==47952||_==47980||_==48008||_==48036||_==48064||_==48092||_==48120||_==48148||_==48176||_==48204||_==48232||_==48260||_==48288||_==48316||_==48344||_==48372||_==48400||_==48428||_==48456||_==48484||_==48512||_==48540||_==48568||_==48596||_==48624||_==48652||_==48680||_==48708||_==48736||_==48764||_==48792||_==48820||_==48848||_==48876||_==48904||_==48932||_==48960||_==48988||_==49016||_==49044||_==49072||_==49100||_==49128||_==49156||_==49184||_==49212||_==49240||_==49268||_==49296||_==49324||_==49352||_==49380||_==49408||_==49436||_==49464||_==49492||_==49520||_==49548||_==49576||_==49604||_==49632||_==49660||_==49688||_==49716||_==49744||_==49772||_==49800||_==49828||_==49856||_==49884||_==49912||_==49940||_==49968||_==49996||_==50024||_==50052||_==50080||_==50108||_==50136||_==50164||_==50192||_==50220||_==50248||_==50276||_==50304||_==50332||_==50360||_==50388||_==50416||_==50444||_==50472||_==50500||_==50528||_==50556||_==50584||_==50612||_==50640||_==50668||_==50696||_==50724||_==50752||_==50780||_==50808||_==50836||_==50864||_==50892||_==50920||_==50948||_==50976||_==51004||_==51032||_==51060||_==51088||_==51116||_==51144||_==51172||_==51200||_==51228||_==51256||_==51284||_==51312||_==51340||_==51368||_==51396||_==51424||_==51452||_==51480||_==51508||_==51536||_==51564||_==51592||_==51620||_==51648||_==51676||_==51704||_==51732||_==51760||_==51788||_==51816||_==51844||_==51872||_==51900||_==51928||_==51956||_==51984||_==52012||_==52040||_==52068||_==52096||_==52124||_==52152||_==52180||_==52208||_==52236||_==52264||_==52292||_==52320||_==52348||_==52376||_==52404||_==52432||_==52460||_==52488||_==52516||_==52544||_==52572||_==52600||_==52628||_==52656||_==52684||_==52712||_==52740||_==52768||_==52796||_==52824||_==52852||_==52880||_==52908||_==52936||_==52964||_==52992||_==53020||_==53048||_==53076||_==53104||_==53132||_==53160||_==53188||_==53216||_==53244||_==53272||_==53300||_==53328||_==53356||_==53384||_==53412||_==53440||_==53468||_==53496||_==53524||_==53552||_==53580||_==53608||_==53636||_==53664||_==53692||_==53720||_==53748||_==53776||_==53804||_==53832||_==53860||_==53888||_==53916||_==53944||_==53972||_==54e3||_==54028||_==54056||_==54084||_==54112||_==54140||_==54168||_==54196||_==54224||_==54252||_==54280||_==54308||_==54336||_==54364||_==54392||_==54420||_==54448||_==54476||_==54504||_==54532||_==54560||_==54588||_==54616||_==54644||_==54672||_==54700||_==54728||_==54756||_==54784||_==54812||_==54840||_==54868||_==54896||_==54924||_==54952||_==54980||_==55008||_==55036||_==55064||_==55092||_==55120||_==55148||_==55176?u:44033<=_&&_<=44059||44061<=_&&_<=44087||44089<=_&&_<=44115||44117<=_&&_<=44143||44145<=_&&_<=44171||44173<=_&&_<=44199||44201<=_&&_<=44227||44229<=_&&_<=44255||44257<=_&&_<=44283||44285<=_&&_<=44311||44313<=_&&_<=44339||44341<=_&&_<=44367||44369<=_&&_<=44395||44397<=_&&_<=44423||44425<=_&&_<=44451||44453<=_&&_<=44479||44481<=_&&_<=44507||44509<=_&&_<=44535||44537<=_&&_<=44563||44565<=_&&_<=44591||44593<=_&&_<=44619||44621<=_&&_<=44647||44649<=_&&_<=44675||44677<=_&&_<=44703||44705<=_&&_<=44731||44733<=_&&_<=44759||44761<=_&&_<=44787||44789<=_&&_<=44815||44817<=_&&_<=44843||44845<=_&&_<=44871||44873<=_&&_<=44899||44901<=_&&_<=44927||44929<=_&&_<=44955||44957<=_&&_<=44983||44985<=_&&_<=45011||45013<=_&&_<=45039||45041<=_&&_<=45067||45069<=_&&_<=45095||45097<=_&&_<=45123||45125<=_&&_<=45151||45153<=_&&_<=45179||45181<=_&&_<=45207||45209<=_&&_<=45235||45237<=_&&_<=45263||45265<=_&&_<=45291||45293<=_&&_<=45319||45321<=_&&_<=45347||45349<=_&&_<=45375||45377<=_&&_<=45403||45405<=_&&_<=45431||45433<=_&&_<=45459||45461<=_&&_<=45487||45489<=_&&_<=45515||45517<=_&&_<=45543||45545<=_&&_<=45571||45573<=_&&_<=45599||45601<=_&&_<=45627||45629<=_&&_<=45655||45657<=_&&_<=45683||45685<=_&&_<=45711||45713<=_&&_<=45739||45741<=_&&_<=45767||45769<=_&&_<=45795||45797<=_&&_<=45823||45825<=_&&_<=45851||45853<=_&&_<=45879||45881<=_&&_<=45907||45909<=_&&_<=45935||45937<=_&&_<=45963||45965<=_&&_<=45991||45993<=_&&_<=46019||46021<=_&&_<=46047||46049<=_&&_<=46075||46077<=_&&_<=46103||46105<=_&&_<=46131||46133<=_&&_<=46159||46161<=_&&_<=46187||46189<=_&&_<=46215||46217<=_&&_<=46243||46245<=_&&_<=46271||46273<=_&&_<=46299||46301<=_&&_<=46327||46329<=_&&_<=46355||46357<=_&&_<=46383||46385<=_&&_<=46411||46413<=_&&_<=46439||46441<=_&&_<=46467||46469<=_&&_<=46495||46497<=_&&_<=46523||46525<=_&&_<=46551||46553<=_&&_<=46579||46581<=_&&_<=46607||46609<=_&&_<=46635||46637<=_&&_<=46663||46665<=_&&_<=46691||46693<=_&&_<=46719||46721<=_&&_<=46747||46749<=_&&_<=46775||46777<=_&&_<=46803||46805<=_&&_<=46831||46833<=_&&_<=46859||46861<=_&&_<=46887||46889<=_&&_<=46915||46917<=_&&_<=46943||46945<=_&&_<=46971||46973<=_&&_<=46999||47001<=_&&_<=47027||47029<=_&&_<=47055||47057<=_&&_<=47083||47085<=_&&_<=47111||47113<=_&&_<=47139||47141<=_&&_<=47167||47169<=_&&_<=47195||47197<=_&&_<=47223||47225<=_&&_<=47251||47253<=_&&_<=47279||47281<=_&&_<=47307||47309<=_&&_<=47335||47337<=_&&_<=47363||47365<=_&&_<=47391||47393<=_&&_<=47419||47421<=_&&_<=47447||47449<=_&&_<=47475||47477<=_&&_<=47503||47505<=_&&_<=47531||47533<=_&&_<=47559||47561<=_&&_<=47587||47589<=_&&_<=47615||47617<=_&&_<=47643||47645<=_&&_<=47671||47673<=_&&_<=47699||47701<=_&&_<=47727||47729<=_&&_<=47755||47757<=_&&_<=47783||47785<=_&&_<=47811||47813<=_&&_<=47839||47841<=_&&_<=47867||47869<=_&&_<=47895||47897<=_&&_<=47923||47925<=_&&_<=47951||47953<=_&&_<=47979||47981<=_&&_<=48007||48009<=_&&_<=48035||48037<=_&&_<=48063||48065<=_&&_<=48091||48093<=_&&_<=48119||48121<=_&&_<=48147||48149<=_&&_<=48175||48177<=_&&_<=48203||48205<=_&&_<=48231||48233<=_&&_<=48259||48261<=_&&_<=48287||48289<=_&&_<=48315||48317<=_&&_<=48343||48345<=_&&_<=48371||48373<=_&&_<=48399||48401<=_&&_<=48427||48429<=_&&_<=48455||48457<=_&&_<=48483||48485<=_&&_<=48511||48513<=_&&_<=48539||48541<=_&&_<=48567||48569<=_&&_<=48595||48597<=_&&_<=48623||48625<=_&&_<=48651||48653<=_&&_<=48679||48681<=_&&_<=48707||48709<=_&&_<=48735||48737<=_&&_<=48763||48765<=_&&_<=48791||48793<=_&&_<=48819||48821<=_&&_<=48847||48849<=_&&_<=48875||48877<=_&&_<=48903||48905<=_&&_<=48931||48933<=_&&_<=48959||48961<=_&&_<=48987||48989<=_&&_<=49015||49017<=_&&_<=49043||49045<=_&&_<=49071||49073<=_&&_<=49099||49101<=_&&_<=49127||49129<=_&&_<=49155||49157<=_&&_<=49183||49185<=_&&_<=49211||49213<=_&&_<=49239||49241<=_&&_<=49267||49269<=_&&_<=49295||49297<=_&&_<=49323||49325<=_&&_<=49351||49353<=_&&_<=49379||49381<=_&&_<=49407||49409<=_&&_<=49435||49437<=_&&_<=49463||49465<=_&&_<=49491||49493<=_&&_<=49519||49521<=_&&_<=49547||49549<=_&&_<=49575||49577<=_&&_<=49603||49605<=_&&_<=49631||49633<=_&&_<=49659||49661<=_&&_<=49687||49689<=_&&_<=49715||49717<=_&&_<=49743||49745<=_&&_<=49771||49773<=_&&_<=49799||49801<=_&&_<=49827||49829<=_&&_<=49855||49857<=_&&_<=49883||49885<=_&&_<=49911||49913<=_&&_<=49939||49941<=_&&_<=49967||49969<=_&&_<=49995||49997<=_&&_<=50023||50025<=_&&_<=50051||50053<=_&&_<=50079||50081<=_&&_<=50107||50109<=_&&_<=50135||50137<=_&&_<=50163||50165<=_&&_<=50191||50193<=_&&_<=50219||50221<=_&&_<=50247||50249<=_&&_<=50275||50277<=_&&_<=50303||50305<=_&&_<=50331||50333<=_&&_<=50359||50361<=_&&_<=50387||50389<=_&&_<=50415||50417<=_&&_<=50443||50445<=_&&_<=50471||50473<=_&&_<=50499||50501<=_&&_<=50527||50529<=_&&_<=50555||50557<=_&&_<=50583||50585<=_&&_<=50611||50613<=_&&_<=50639||50641<=_&&_<=50667||50669<=_&&_<=50695||50697<=_&&_<=50723||50725<=_&&_<=50751||50753<=_&&_<=50779||50781<=_&&_<=50807||50809<=_&&_<=50835||50837<=_&&_<=50863||50865<=_&&_<=50891||50893<=_&&_<=50919||50921<=_&&_<=50947||50949<=_&&_<=50975||50977<=_&&_<=51003||51005<=_&&_<=51031||51033<=_&&_<=51059||51061<=_&&_<=51087||51089<=_&&_<=51115||51117<=_&&_<=51143||51145<=_&&_<=51171||51173<=_&&_<=51199||51201<=_&&_<=51227||51229<=_&&_<=51255||51257<=_&&_<=51283||51285<=_&&_<=51311||51313<=_&&_<=51339||51341<=_&&_<=51367||51369<=_&&_<=51395||51397<=_&&_<=51423||51425<=_&&_<=51451||51453<=_&&_<=51479||51481<=_&&_<=51507||51509<=_&&_<=51535||51537<=_&&_<=51563||51565<=_&&_<=51591||51593<=_&&_<=51619||51621<=_&&_<=51647||51649<=_&&_<=51675||51677<=_&&_<=51703||51705<=_&&_<=51731||51733<=_&&_<=51759||51761<=_&&_<=51787||51789<=_&&_<=51815||51817<=_&&_<=51843||51845<=_&&_<=51871||51873<=_&&_<=51899||51901<=_&&_<=51927||51929<=_&&_<=51955||51957<=_&&_<=51983||51985<=_&&_<=52011||52013<=_&&_<=52039||52041<=_&&_<=52067||52069<=_&&_<=52095||52097<=_&&_<=52123||52125<=_&&_<=52151||52153<=_&&_<=52179||52181<=_&&_<=52207||52209<=_&&_<=52235||52237<=_&&_<=52263||52265<=_&&_<=52291||52293<=_&&_<=52319||52321<=_&&_<=52347||52349<=_&&_<=52375||52377<=_&&_<=52403||52405<=_&&_<=52431||52433<=_&&_<=52459||52461<=_&&_<=52487||52489<=_&&_<=52515||52517<=_&&_<=52543||52545<=_&&_<=52571||52573<=_&&_<=52599||52601<=_&&_<=52627||52629<=_&&_<=52655||52657<=_&&_<=52683||52685<=_&&_<=52711||52713<=_&&_<=52739||52741<=_&&_<=52767||52769<=_&&_<=52795||52797<=_&&_<=52823||52825<=_&&_<=52851||52853<=_&&_<=52879||52881<=_&&_<=52907||52909<=_&&_<=52935||52937<=_&&_<=52963||52965<=_&&_<=52991||52993<=_&&_<=53019||53021<=_&&_<=53047||53049<=_&&_<=53075||53077<=_&&_<=53103||53105<=_&&_<=53131||53133<=_&&_<=53159||53161<=_&&_<=53187||53189<=_&&_<=53215||53217<=_&&_<=53243||53245<=_&&_<=53271||53273<=_&&_<=53299||53301<=_&&_<=53327||53329<=_&&_<=53355||53357<=_&&_<=53383||53385<=_&&_<=53411||53413<=_&&_<=53439||53441<=_&&_<=53467||53469<=_&&_<=53495||53497<=_&&_<=53523||53525<=_&&_<=53551||53553<=_&&_<=53579||53581<=_&&_<=53607||53609<=_&&_<=53635||53637<=_&&_<=53663||53665<=_&&_<=53691||53693<=_&&_<=53719||53721<=_&&_<=53747||53749<=_&&_<=53775||53777<=_&&_<=53803||53805<=_&&_<=53831||53833<=_&&_<=53859||53861<=_&&_<=53887||53889<=_&&_<=53915||53917<=_&&_<=53943||53945<=_&&_<=53971||53973<=_&&_<=53999||54001<=_&&_<=54027||54029<=_&&_<=54055||54057<=_&&_<=54083||54085<=_&&_<=54111||54113<=_&&_<=54139||54141<=_&&_<=54167||54169<=_&&_<=54195||54197<=_&&_<=54223||54225<=_&&_<=54251||54253<=_&&_<=54279||54281<=_&&_<=54307||54309<=_&&_<=54335||54337<=_&&_<=54363||54365<=_&&_<=54391||54393<=_&&_<=54419||54421<=_&&_<=54447||54449<=_&&_<=54475||54477<=_&&_<=54503||54505<=_&&_<=54531||54533<=_&&_<=54559||54561<=_&&_<=54587||54589<=_&&_<=54615||54617<=_&&_<=54643||54645<=_&&_<=54671||54673<=_&&_<=54699||54701<=_&&_<=54727||54729<=_&&_<=54755||54757<=_&&_<=54783||54785<=_&&_<=54811||54813<=_&&_<=54839||54841<=_&&_<=54867||54869<=_&&_<=54895||54897<=_&&_<=54923||54925<=_&&_<=54951||54953<=_&&_<=54979||54981<=_&&_<=55007||55009<=_&&_<=55035||55037<=_&&_<=55063||55065<=_&&_<=55091||55093<=_&&_<=55119||55121<=_&&_<=55147||55149<=_&&_<=55175||55177<=_&&_<=55203?f:_==9757||_==9977||9994<=_&&_<=9997||_==127877||127938<=_&&_<=127940||_==127943||127946<=_&&_<=127948||128066<=_&&_<=128067||128070<=_&&_<=128080||_==128110||128112<=_&&_<=128120||_==128124||128129<=_&&_<=128131||128133<=_&&_<=128135||_==128170||128372<=_&&_<=128373||_==128378||_==128400||128405<=_&&_<=128406||128581<=_&&_<=128583||128587<=_&&_<=128591||_==128675||128692<=_&&_<=128694||_==128704||_==128716||129304<=_&&_<=129308||129310<=_&&_<=129311||_==129318||129328<=_&&_<=129337||129341<=_&&_<=129342||129489<=_&&_<=129501?g:127995<=_&&_<=127999?m:_==8205?y:_==9792||_==9794||9877<=_&&_<=9878||_==9992||_==10084||_==127752||_==127806||_==127859||_==127891||_==127908||_==127912||_==127979||_==127981||_==128139||128187<=_&&_<=128188||_==128295||_==128300||_==128488||_==128640||_==128658?A:128102<=_&&_<=128105?b:d}return this}typeof Qk<"u"&&Qk.exports&&(Qk.exports=w7e)});var lie,Sw,ke,DT,Hu,Do,h1e,RT,m1e,p1e,hr,dc=Cs(()=>{lie=new Date(2107,11,31,23,59,58),Sw=new Date(1980,0,1),ke=void 0,DT=1/0,Hu="undefined",Do="function",h1e="object",RT="string",m1e="number",p1e="boolean",hr=new Uint8Array});function Iw(e){if(e&&typeof e!=Do)throw new Error(X1e);return e}function YG(e){if(e&&(typeof e.addEventListener!=Do||typeof e.aborted!=p1e))throw new Error(K1e);return e||ke}function XG(e,t){if(e&&typeof e!=RT||t&&!(t instanceof Uint8Array))throw new Error(die)}function hie(e,t,n){if(!Number.isInteger(e)||e<0||e>t)throw new Error(n)}function Pw(e,t,n){e!==ke&&hie(e,t,n)}function OT(e){return typeof e==RT&&e.trim()?Number(e):e}var g1e,_1e,y1e,A1e,b1e,FG,BG,kG,UG,x1e,T1e,E1e,C1e,v1e,S1e,w1e,I1e,zG,VG,jG,HG,P1e,D1e,R1e,O1e,M1e,N1e,L1e,F1e,B1e,uie,k1e,U1e,DO,ww,z1e,V1e,j1e,H1e,G1e,W1e,fie,q1e,Y1e,GG,WG,FA,qG,t_,X1e,K1e,die,RO=Cs(()=>{dc();g1e="filenameEncoding",_1e="commentEncoding",y1e="decodeText",A1e="extractPrependedData",b1e="extractAppendedData",FG="password",BG="rawPassword",kG="passThrough",UG="signal",x1e="checkPasswordOnly",T1e="checkOverlappingEntryOnly",E1e="checkOverlappingEntry",C1e="checkAmbiguity",v1e="checkLocalDirectory",S1e="checkSignature",w1e="checkCrc32",I1e="checkAuthenticationCode",zG="useWebWorkers",VG="useCompressionStream",jG="transferStreams",HG="preventClose",P1e="encryptionStrength",D1e="extendedTimestamp",R1e="ntfsTimestamp",O1e="keepOrder",M1e="level",N1e="bufferedWrite",L1e="createTempStream",F1e="dataDescriptorSignature",B1e="useUnicodeFileNames",uie="dataDescriptor",k1e="supportZip64SplitFile",U1e="encodeText",DO="offset",ww="usdz",z1e="unixExtraFieldType",V1e="localExtraField",j1e="centralExtraField",H1e="strictness",G1e="filenameValidation",W1e="normalizeFilename",fie="maxAppendedDataSize",q1e="decryptCentralDirectory",Y1e="signCentralDirectory",GG="filename",WG="comment",FA="strict",qG="balanced",t_="tolerant",X1e="Invalid option (must be a function)",K1e="Invalid signal (must be an AbortSignal instance)",die="Invalid password (password must be a string, rawPassword must be a Uint8Array)"});function n_(){return mie}function OO(e){return pie(e.chunkSize)}function pie(e){return e=OT(e),Number.isInteger(e)&&e>=J1e?Math.max(e,WLt):$1e}function MO(e){Object.assign(mie,rRe(oRe(e)))}function rRe(e){let t={};for(let n of XLt){let i=e[n];i!==ke&&(t[n]=KLt(n,i))}return t}function KLt(e,t){if(nRe.includes(e)){if(t=OT(t),e==tRe&&(!Number.isInteger(t)||t<J1e))throw new Error(Z1e)}else iRe.includes(e)&&Iw(t);return t}function oRe(e){e=e||{};let{CompressionStreamZlib:t,DecompressionStreamZlib:n}=e;if(t===ke&&n===ke)return e;let i=Object.assign({},e);return i.CompressionStreamFallback===ke&&(i.CompressionStreamFallback=t),i.DecompressionStreamFallback===ke&&(i.DecompressionStreamFallback=n),i}function Dw(e){let t=rRe(oRe(e));Object.assign(eRe,t),Object.assign(mie,t)}var $1e,WLt,J1e,Z1e,Q1e,eRe,tRe,qLt,YLt,nRe,iRe,XLt,mie,i0=Cs(()=>{dc();RO();$1e=64*1024,WLt=64,J1e=1,Z1e="Invalid maxWorkers (must be an integer greater than 0)",Q1e=2;try{typeof navigator!=Hu&&navigator.hardwareConcurrency&&(Q1e=navigator.hardwareConcurrency)}catch{}eRe={workerURI:"./core/web-worker-wasm.js",wasmURI:"./core/streams/zlib-wasm/zlib-streams.wasm",chunkSize:$1e,maxWorkers:Q1e,terminateWorkerTimeout:5e3,workerStarvationTimeout:5e3,workerStartupTimeout:5e3,useWebWorkers:!0,useCompressionStream:!0,transferStreams:!0,CompressionStream:typeof CompressionStream!=Hu&&CompressionStream,DecompressionStream:typeof DecompressionStream!=Hu&&DecompressionStream},tRe="maxWorkers",qLt=["baseURI","wasmURI","workerURI"],YLt=["useCompressionStream","useWebWorkers","transferStreams"],nRe=["chunkSize",tRe,"terminateWorkerTimeout","workerStarvationTimeout","workerStartupTimeout"],iRe=["createWorker","CompressionStream","DecompressionStream","CompressionStreamFallback","DecompressionStreamFallback"],XLt=[...qLt,...YLt,...nRe,...iRe],mie={...eRe}});function Qd(e,t){let n=new Uint8Array(e.length+t.length);return n.set(e),n.set(t,e.length),n}function KG(e){return e.byteOffset||e.byteLength!=e.buffer.byteLength?new Uint8Array(e):e}function li(e){return new DataView(e.buffer,e.byteOffset,e.byteLength)}var MT=Cs(()=>{});var NO,sRe,$Lt,JLt,ZLt,QLt,eFt,tFt,nFt,gm,LO=Cs(()=>{NO=[[],[],[],[],[],[],[],[]];for(let e=0;e<256;e++){let t=e;for(let n=0;n<8;n++)t=t&1?t>>>1^3988292384:t>>>1;NO[0][e]=t}for(let e=0;e<256;e++)for(let t=1;t<8;t++){let n=NO[t-1][e];NO[t][e]=n>>>8^NO[0][n&255]}[sRe,$Lt,JLt,ZLt,QLt,eFt,tFt,nFt]=NO,gm=class{constructor(t){this.crc=t||-1}append(t){let n=this.crc|0,i=t.length|0,r=0;if(i>=8&&t.buffer){let o=new DataView(t.buffer,t.byteOffset,i),s=i-8;for(;r<=s;r+=8){let a=n^o.getInt32(r,!0),c=o.getInt32(r+4,!0);n=nFt[a&255]^tFt[a>>>8&255]^eFt[a>>>16&255]^QLt[a>>>24&255]^ZLt[c&255]^JLt[c>>>8&255]^$Lt[c>>>16&255]^sRe[c>>>24&255]}}for(;r<i;r++)n=n>>>8^sRe[(n^t[r])&255];this.crc=n}get(){return~this.crc}}});var FO,aRe=Cs(()=>{LO();FO=class extends TransformStream{constructor(){let t,n=new gm;super({transform(i,r){n.append(i),r.enqueue(i)},flush(){let i=new Uint8Array(4);new DataView(i.buffer).setUint32(0,n.get()),t.value=i}}),t=this}}});function Rw(e){if(typeof TextEncoder==Hu){e=unescape(encodeURIComponent(e));let t=new Uint8Array(e.length);for(let n=0;n<t.length;n++)t[n]=e.charCodeAt(n);return t}else return new TextEncoder().encode(e)}var gie=Cs(()=>{dc()});var $l,BO,cRe,_ie,yie,BA,lRe=Cs(()=>{$l={concat(e,t){if(e.length===0||t.length===0)return e.concat(t);let n=e[e.length-1],i=$l.getPartial(n);return i===32?e.concat(t):$l._shiftRight(t,i,n|0,e.slice(0,e.length-1))},bitLength(e){let t=e.length;if(t===0)return 0;let n=e[t-1];return(t-1)*32+$l.getPartial(n)},clamp(e,t){if(e.length*32<t)return e;e=e.slice(0,Math.ceil(t/32));let n=e.length;return t=t&31,n>0&&t&&(e[n-1]=$l.partial(t,e[n-1]&2147483648>>t-1,1)),e},partial(e,t,n){return e===32?t:(n?t|0:t<<32-e)+e*1099511627776},getPartial(e){return Math.round(e/1099511627776)||32},_shiftRight(e,t,n,i){for(i===void 0&&(i=[]);t>=32;t-=32)i.push(n),n=0;if(t===0)return i.concat(e);for(let s=0;s<e.length;s++)i.push(n|e[s]>>>t),n=e[s]<<32-t;let r=e.length?e[e.length-1]:0,o=$l.getPartial(r);return i.push($l.partial(t+o&31,t+o>32?n:i.pop(),1)),i}},BO={bytes:{fromBits(e){let n=$l.bitLength(e)/8,i=new Uint8Array(n),r;for(let o=0;o<n;o++)(o&3)===0&&(r=e[o/4]),i[o]=r>>>24,r<<=8;return i},toBits(e){let t=[],n,i=0;for(n=0;n<e.length;n++)i=i<<8|e[n],(n&3)===3&&(t.push(i),i=0);return n&3&&t.push($l.partial(8*(n&3),i)),t}}},cRe={};cRe.sha1=class{constructor(e){let t=this;t.blockSize=512,t._init=[1732584193,4023233417,2562383102,271733878,3285377520],t._key=[1518500249,1859775393,2400959708,3395469782],e?(t._h=e._h.slice(0),t._buffer=e._buffer.slice(0),t._length=e._length):t.reset()}reset(){let e=this;return e._h=e._init.slice(0),e._buffer=[],e._length=0,e}update(e){let t=this;typeof e=="string"&&(e=BO.utf8String.toBits(e));let n=t._buffer=$l.concat(t._buffer,e),i=t._length,r=t._length=i+$l.bitLength(e);if(r>9007199254740991)throw new Error("Cannot hash more than 2^53 - 1 bits");let o=new Uint32Array(n),s=0;for(let a=t.blockSize+i-(t.blockSize+i&t.blockSize-1);a<=r;a+=t.blockSize)t._block(o.subarray(16*s,16*(s+1))),s+=1;return n.splice(0,16*s),t}finalize(){let e=this,t=e._buffer,n=e._h;t=$l.concat(t,[$l.partial(1,1)]);for(let i=t.length+2;i&15;i++)t.push(0);for(t.push(Math.floor(e._length/4294967296)),t.push(e._length|0);t.length;)e._block(t.splice(0,16));return e.reset(),n}_f(e,t,n,i){if(e<=19)return t&n|~t&i;if(e<=39)return t^n^i;if(e<=59)return t&n|t&i|n&i;if(e<=79)return t^n^i}_S(e,t){return t<<e|t>>>32-e}_block(e){let t=this,n=t._h,i=Array(80);for(let u=0;u<16;u++)i[u]=e[u];let r=n[0],o=n[1],s=n[2],a=n[3],c=n[4];for(let u=0;u<=79;u++){u>=16&&(i[u]=t._S(1,i[u-3]^i[u-8]^i[u-14]^i[u-16]));let f=t._S(5,r)+t._f(u,o,s,a)+c+i[u]+t._key[Math.floor(u/20)]|0;c=a,a=s,s=t._S(30,o),o=r,r=f}n[0]=n[0]+r|0,n[1]=n[1]+o|0,n[2]=n[2]+s|0,n[3]=n[3]+a|0,n[4]=n[4]+c|0}};_ie={};_ie.aes=class{constructor(e){let t=this;t._tables=[[[],[],[],[],[]],[[],[],[],[],[]]],t._tables[0][0][0]||t._precompute();let n=t._tables[0][4],i=t._tables[1],r=e.length,o,s,a,c=1;if(r!==4&&r!==6&&r!==8)throw new Error("invalid aes key size");for(t._key=[s=e.slice(0),a=[]],o=r;o<4*r+28;o++){let u=s[o-1];(o%r===0||r===8&&o%r===4)&&(u=n[u>>>24]<<24^n[u>>16&255]<<16^n[u>>8&255]<<8^n[u&255],o%r===0&&(u=u<<8^u>>>24^c<<24,c=c<<1^(c>>7)*283)),s[o]=s[o-r]^u}for(let u=0;o;u++,o--){let f=s[u&3?o:o-4];o<=4||u<4?a[u]=f:a[u]=i[0][n[f>>>24]]^i[1][n[f>>16&255]]^i[2][n[f>>8&255]]^i[3][n[f&255]]}}encrypt(e){return this._crypt(e,0)}decrypt(e){return this._crypt(e,1)}_precompute(){let e=this._tables[0],t=this._tables[1],n=e[4],i=t[4],r=[],o=[],s,a,c,u;for(let f=0;f<256;f++)o[(r[f]=f<<1^(f>>7)*283)^f]=f;for(let f=s=0;!n[f];f^=a||1,s=o[s]||1){let d=s^s<<1^s<<2^s<<3^s<<4;d=d>>8^d&255^99,n[f]=d,i[d]=f,u=r[c=r[a=r[f]]];let p=u*16843009^c*65537^a*257^f*16843008,g=r[d]*257^d*16843008;for(let m=0;m<4;m++)e[m][f]=g=g<<24^g>>>8,t[m][d]=p=p<<24^p>>>8}for(let f=0;f<5;f++)e[f]=e[f].slice(0),t[f]=t[f].slice(0)}_crypt(e,t){if(e.length!==4)throw new Error("invalid aes block size");let n=this._key[t],i=n.length/4-2,r=[0,0,0,0],o=this._tables[t],s=o[0],a=o[1],c=o[2],u=o[3],f=o[4],d=e[0]^n[0],p=e[t?3:1]^n[1],g=e[2]^n[2],m=e[t?1:3]^n[3],y=4,A,b,x;for(let T=0;T<i;T++)A=s[d>>>24]^a[p>>16&255]^c[g>>8&255]^u[m&255]^n[y],b=s[p>>>24]^a[g>>16&255]^c[m>>8&255]^u[d&255]^n[y+1],x=s[g>>>24]^a[m>>16&255]^c[d>>8&255]^u[p&255]^n[y+2],m=s[m>>>24]^a[d>>16&255]^c[p>>8&255]^u[g&255]^n[y+3],y+=4,d=A,p=b,g=x;for(let T=0;T<4;T++)r[t?3&-T:T]=f[d>>>24]<<24^f[p>>16&255]<<16^f[g>>8&255]<<8^f[m&255]^n[y++],A=d,d=p,p=g,g=m,m=A;return r}};yie={};yie.ctrGladman=class{constructor(e,t){this._prf=e,this._initIv=t,this._iv=t}reset(){this._iv=this._initIv}update(e){return this.calculate(this._prf,e,this._iv)}incWord(e){if((e>>24&255)===255){let t=e>>16&255,n=e>>8&255,i=e&255;t===255?(t=0,n===255?(n=0,i===255?i=0:++i):++n):++t,e=0,e+=t<<16,e+=n<<8,e+=i}else e+=1<<24;return e}incCounter(e){(e[0]=this.incWord(e[0]))===0&&(e[1]=this.incWord(e[1]))}calculate(e,t,n){let i;if(!(i=t.length))return[];let r=$l.bitLength(t);for(let o=0;o<i;o+=4){this.incCounter(n);let s=e.encrypt(n);t[o]^=s[0],t[o+1]^=s[1],t[o+2]^=s[2],t[o+3]^=s[3]}return $l.clamp(t,r)}};BA={importKey(e){return new BA.hmacSha1(BO.bytes.toBits(e))},pbkdf2(e,t,n,i){if(n=n||1e4,i<0||n<0)throw new Error("invalid params to pbkdf2");let r=(i>>5)+1<<2,o,s,a,c,u,f=new ArrayBuffer(r),d=new DataView(f),p=0,g=$l;for(t=BO.bytes.toBits(t),u=1;p<(r||1);u++){for(o=s=e.encrypt(g.concat(t,[u])),a=1;a<n;a++)for(s=e.encrypt(s),c=0;c<s.length;c++)o[c]^=s[c];for(a=0;p<(r||1)&&a<o.length;a++)d.setInt32(p,o[a]),p+=4}return f.slice(0,i/8)}};BA.hmacSha1=class{constructor(e){let t=this,n=t._hash=cRe.sha1,i=[[],[]];t._baseHash=[new n,new n];let r=t._baseHash[0].blockSize/32;e.length>r&&(e=new n().update(e).finalize());for(let o=0;o<r;o++)i[0][o]=e[o]^909522486,i[1][o]=e[o]^1549556828;t._baseHash[0].update(i[0]),t._baseHash[1].update(i[1]),t._resultHash=new n(t._baseHash[0])}reset(){let e=this;e._resultHash=new e._hash(e._baseHash[0]),e._updated=!1}update(e){let t=this;t._updated=!0,t._resultHash.update(e)}digest(){let e=this,t=e._resultHash.finalize(),n=new e._hash(e._baseHash[1]).update(t).finalize();return e.reset(),n}encrypt(e){if(this._updated)throw new Error("encrypt on already updated hmac called!");return this.update(e),this.digest(e)}}});function $G(e){if(iFt)return crypto.getRandomValues(e);throw new Error(Ow)}var iFt,r0,kA,UA,i_,Ow,JG=Cs(()=>{dc();iFt=typeof crypto!=Hu&&typeof crypto.getRandomValues==Do,r0="Invalid password",kA="Invalid signature",UA=kA,i_="zipjs-abort-check-password",Ow="Crypto API not supported"});function mRe(e,t,n,i){Object.assign(e,{ready:new Promise(r=>e.resolveReady=r),password:_Ft(t,n),strength:i-1,pendingInput:hr})}function pRe(e,t,n,i,r,o){let{ctr:s,hmac:a,pendingInput:c}=e;c.length&&(t=Qd(c,t));let u=t.length-r;n=yFt(n,i+(u-u%Mw));let f;for(f=0;f<=u-Mw;f+=Mw){let d=VO(o0,eh(t,f,f+Mw));o&&a.update(d);let p=s.update(d);o||a.update(p),n.set(zO(o0,p),f+i)}return e.pendingInput=eh(t,f),n}async function hFt(e,t,n,i){let r=await gRe(e,t,n,eh(i,0,UO[t])),o=eh(i,UO[t]);if(r[0]!=o[0]||r[1]!=o[1])throw new Error(r0)}async function mFt(e,t,n){let i=$G(new Uint8Array(UO[t])),r=await gRe(e,t,n,i);return Qd(i,r)}async function gRe(e,t,n,i){e.password=null;let r=await pFt(rFt,n,aFt,!1,cFt),o=await gFt(Object.assign({salt:i},Aie),r,8*(kO[t]*2+2)),s=new Uint8Array(o),a=VO(o0,eh(s,0,kO[t])),c=VO(o0,eh(s,kO[t],kO[t]*2)),u=eh(s,kO[t]*2);return Object.assign(e,{keys:{key:a,authentication:c,passwordVerification:u},ctr:new fFt(new uFt(a),Array.from(lFt)),hmac:new dFt(c)}),u}async function pFt(e,t,n,i,r){if(uRe)try{return await jO.importKey(e,t,n,i,r)}catch{return uRe=!1,BA.importKey(t)}else return BA.importKey(t)}async function gFt(e,t,n){if(fRe)try{return await jO.deriveBits(e,t,n)}catch{return fRe=!1,BA.pbkdf2(t,e.salt,Aie.iterations,n)}else return BA.pbkdf2(t,e.salt,Aie.iterations,n)}function _Ft(e,t){return t===ke?Rw(e):t}function yFt(e,t){if(t&&t>e.length){let n=e;e=new Uint8Array(t),e.set(n,0)}return e}function eh(e,t,n){return e.subarray(t,n)}function zO(e,t){return e.fromBits(t)}function VO(e,t){return e.toBits(t)}var Mw,rFt,dRe,oFt,sFt,aFt,Aie,cFt,UO,kO,r_,lFt,e5,jO,hRe,o0,uFt,fFt,dFt,uRe,fRe,ZG,QG,_Re=Cs(()=>{dc();gie();MT();lRe();JG();Mw=16,rFt="raw",dRe={name:"PBKDF2"},oFt={name:"HMAC"},sFt="SHA-1",aFt=Object.assign({hash:oFt},dRe),Aie=Object.assign({iterations:1e3,hash:{name:sFt}},dRe),cFt=["deriveBits"],UO=[8,12,16],kO=[16,24,32],r_=10,lFt=[0,0,0,0],e5=typeof crypto!=Hu,jO=e5&&crypto.subtle,hRe=e5&&typeof jO!=Hu,o0=BO.bytes,uFt=_ie.aes,fFt=yie.ctrGladman,dFt=BA.hmacSha1,uRe=e5&&hRe&&typeof jO.importKey==Do,fRe=e5&&hRe&&typeof jO.deriveBits==Do,ZG=class extends TransformStream{constructor({password:t,rawPassword:n,encryptionStrength:i,checkPasswordOnly:r,checkAuthenticationCode:o=!0}){super({start(){mRe(this,t,n,i)},async transform(s,a){let c=this,{password:u,strength:f,resolveReady:d,ready:p}=c;u?(await hFt(c,f,u,eh(s,0,UO[f]+2)),s=eh(s,UO[f]+2),r?a.error(new Error(i_)):d()):await p;let g=new Uint8Array(s.length-r_-(s.length-r_)%Mw);a.enqueue(pRe(c,s,g,0,r_,!0))},async flush(s){let{ctr:a,hmac:c,pendingInput:u,ready:f}=this;if(c&&a){await f;let d=eh(u,0,u.length-r_),p=eh(u,u.length-r_),g=hr;if(d.length){let A=VO(o0,d);c.update(A);let b=a.update(A);g=zO(o0,b)}let m=eh(zO(o0,c.digest()),0,r_),y=u.length<r_?1:0;for(let A=0;A<r_;A++)y|=m[A]^p[A];if(y&&o)throw new Error(UA);s.enqueue(g)}}})}},QG=class extends TransformStream{constructor({password:t,rawPassword:n,encryptionStrength:i}){super({start(){mRe(this,t,n,i)},async transform(r,o){let s=this,{password:a,strength:c,resolveReady:u,ready:f}=s,d=hr;a?(d=await mFt(s,c,a),u()):await f;let p=new Uint8Array(d.length+r.length-r.length%Mw);p.set(d,0),o.enqueue(pRe(s,r,p,d.length,0))},async flush(r){let{ctr:o,hmac:s,pendingInput:a,ready:c}=this;if(s&&o){await c;let u=hr;if(a.length){let d=o.update(VO(o0,a));s.update(d),u=zO(o0,d)}let f=zO(o0,s.digest()).slice(0,r_);r.enqueue(Qd(u,f))}}})}}});function xRe(e,t,n,i){Object.assign(e,{password:t,rawPassword:n,passwordVerification:i}),AFt(e,t,n)}function yRe(e,t){let n=new Uint8Array(t.length);for(let i=0;i<t.length;i++)n[i]=TRe(e)^t[i],i5(e,n[i]);return n}function ARe(e,t){let n=new Uint8Array(t.length);for(let i=0;i<t.length;i++)n[i]=TRe(e)^t[i],i5(e,t[i]);return n}function AFt(e,t,n){let i=[305419896,591751049,878082192];if(Object.assign(e,{keys:i,crcKey0:new gm(i[0]),crcKey2:new gm(i[2])}),n)for(let r=0;r<n.length;r++)i5(e,n[r]);else for(let r=0;r<t.length;r++)i5(e,t.charCodeAt(r))}function i5(e,t){let[,n]=e.keys;e.crcKey0.append([t]);let i=~e.crcKey0.get();n=bRe(Math.imul(bRe(n+ERe(i)),134775813)+1),e.crcKey2.append([n>>>24]);let r=~e.crcKey2.get();e.keys=[i,n,r]}function TRe(e){let t=e.keys[2]|2;return ERe(Math.imul(t,t^1)>>>8)}function ERe(e){return e&255}function bRe(e){return e&4294967295}var Nw,t5,n5,CRe=Cs(()=>{LO();JG();Nw=12,t5=class extends TransformStream{constructor({password:t,rawPassword:n,passwordVerification:i,checkPasswordOnly:r}){super({start(){xRe(this,t,n,i)},transform(o,s){let a=this;if(a.password||a.rawPassword){let c=yRe(a,o.subarray(0,Nw));if(a.password=a.rawPassword=null,(c[Nw-1]^a.passwordVerification)!=0)throw new Error(r0);o=o.subarray(Nw)}r?s.error(new Error(i_)):s.enqueue(yRe(a,o))}})}},n5=class extends TransformStream{constructor({password:t,rawPassword:n,passwordVerification:i}){super({start(){xRe(this,t,n,i)},transform(r,o){let s=this,a,c;if(s.password||s.rawPassword){s.password=s.rawPassword=null;let u=$G(new Uint8Array(Nw));u[Nw-1]=s.passwordVerification,a=new Uint8Array(r.length+u.length),a.set(ARe(s,u),0),c=Nw}else a=new Uint8Array(r.length),c=0;a.set(ARe(s,r),c),o.enqueue(a)}})}}});function _m(e){if(e instanceof ReadableStream)return e;let t=e.getReader();return new ReadableStream({async pull(n){let{value:i,done:r}=await t.read();r?n.close():n.enqueue(i)},cancel(n){return t.cancel(n)}})}function s0(e,t){e=_m(e);let n=t?{type:t}:{};if(bFt())return new Response(e).blob().then(r=>t?new Blob([r],n):r);let i=[];return e.pipeTo(new WritableStream({write(r){i.push(r)}})).then(()=>new Blob(i,n))}function bFt(){return typeof Blob.prototype.stream!=Do||new Blob([]).stream()instanceof ReadableStream}function vRe(e){if(e instanceof WritableStream)return e;let t=e.getWriter();return new WritableStream({write(n){return t.write(n)},close(){return t.close()},abort(n){return t.abort(n)}})}var Lw=Cs(()=>{dc()});function r5(e){return xFt.get(e)}function o5(e){return bie.get(e)}function TFt(e,t){let{CompressionStream:n,DecompressionStream:i}=t;if(typeof n!=Do&&typeof i!=Do)throw new Error(SRe);bie.set(e,{CompressionStream:n,DecompressionStream:i})}async function wRe(e,t){!bie.has(e)&&t&&TFt(e,await import(t))}var SRe,xFt,bie,LT=Cs(()=>{dc();SRe="Invalid codec module",xFt=new Map,bie=new Map});function SFt(e,t,n){let i=new gm,r=0,o=!1,s,a,c,u=new Promise((m,y)=>{a=m,c=y});u.catch(()=>{}),n||a();let f=new TransformStream({start(m){let y=new Uint8Array(DRe);y.set(CFt),m.enqueue(y)},transform(m,y){y.enqueue(m)},async flush(m){o=!0,p();try{await u}finally{g()}let y=new Uint8Array(xie),A=li(y);A.setUint32(0,i.get(),!0),A.setUint32(4,n,!0),m.enqueue(y)},cancel(m){c(m)}}),d=new TransformStream({transform(m,y){i.append(m),r+=m.length,r>=n?a():o&&p(),y.enqueue(m)},cancel(m){c(m)}});return e=ym(e,f),e=Bw(e,t),ym(e,d);function p(){g(),s=setTimeout(()=>c(new Error(zA)),vFt)}function g(){clearTimeout(s)}}function Eie(e,t){if(!e)return!1;let n=IRe.get(e);n||(n=new Map,IRe.set(e,n));let i=n.get(t);if(i===ke){try{new e(t),i=!0}catch{i=!1}n.set(t,i)}return i}function l5(e){return Eie(e,Tie)}function Cie(e){return Eie(e,GO)}function RRe(e,t,n){t=ym(t,new TransformStream({flush:n})),Object.defineProperty(e,"readable",{get(){return t}})}function ORe(e,t,n){if(!e)throw new Error(EFt);return new e(t,n)}function MRe(e,t,n,i,r){let o=t&&i?i:r||i,s=n.deflate64?PRe:Tie,a;try{a=new o(s,n)}catch(c){if(t&&r&&o!=r)a=new r(s,n);else throw c}return Bw(e,a)}function ym(e,t){return _m(e).pipeThrough(t)}function Bw(e,t){let n=t.writable.getWriter(),i=e.getReader();return r(),t.readable;async function r(){try{for(;;){await n.ready;let o=await i.read();if(o.done){await n.close();break}await n.write(o.value)}}catch(o){await wFt(n,o),await IFt(i,o)}}}async function wFt(e,t){try{await e.abort(t)}catch{}}async function IFt(e,t){try{await e.cancel(t)}catch{}}function PFt(e){let t=e.getReader();return new ReadableStream({async pull(n){let i;try{i=await t.read()}catch(s){if(s&&s.message)throw s;let a=new Error(kw);throw a.cause=s,a}let{value:r,done:o}=i;o?n.close():n.enqueue(r)},cancel(n){return t.cancel(n)}})}var zA,kw,Uw,EFt,Tie,PRe,GO,DRe,xie,CFt,vFt,s5,a5,c5,IRe,vie=Cs(()=>{LO();aRe();_Re();CRe();JG();dc();MT();Lw();LT();zA="Invalid uncompressed size",kw="Invalid compressed data",Uw=kA,EFt="Compression method not supported",Tie="deflate-raw",PRe="deflate64-raw",GO="gzip",DRe=10,xie=8,CFt=[31,139,8],vFt=5e3,s5=class extends TransformStream{constructor(t,{chunkSize:n,CompressionStreamFallback:i,CompressionStream:r}){super({});let{compressed:o,encrypted:s,useCompressionStream:a,zipCrypto:c,computeCrc32:u,level:f,deflate64:d,format:p,compressionMethod:g,inputSize:m}=t,y=this,A,b,x,T=super.readable,E=p&&o5(p),v=u&&o&&!d&&!E&&(!s||c)&&!!(a&&r);if((!s||c)&&u&&!v&&(A=new FO,T=ym(T,A)),o)if(E)T=Bw(T,ORe(E.CompressionStream,p,{level:f,chunkSize:n,compressionMethod:g,uncompressedSize:m}));else if(v)x=new a5,T=Bw(T,new r(GO)),T=ym(T,x);else try{T=MRe(T,a,{level:f,chunkSize:n},r,i)}catch(S){let I;try{I=new r(GO)}catch{throw S}T=Bw(T,I),T=ym(T,new a5)}s&&(c?T=ym(T,new n5(t)):(b=new QG(t),T=ym(T,b))),RRe(y,T,()=>{(!s||c)&&u&&(y.crc32=v?x.crc32:new DataView(A.value.buffer).getUint32(0))})}},a5=class extends TransformStream{constructor(){let t,n=DRe,i=new Uint8Array(0);super({transform(r,o){if(n){let u=Math.min(n,r.length);if(n-=u,r=r.subarray(u),!r.length)return}let s=i.length+r.length;if(s<=xie){i=Qd(i,r);return}let a=s-xie,c=Math.min(a,i.length);o.enqueue(Qd(i.subarray(0,c),r.subarray(0,a-c))),i=Qd(i.subarray(c),r.subarray(a-c))},flush(){let r=li(i);t.crc32=r.getUint32(0,!0),t.uncompressedSize=r.getUint32(4,!0)}}),t=this}};c5=class extends TransformStream{constructor(t,{chunkSize:n,DecompressionStreamFallback:i,DecompressionStream:r}){super({});let{zipCrypto:o,encrypted:s,checkCrc32:a,crc32:c,compressed:u,useCompressionStream:f,deflate64:d,format:p,compressionMethod:g,rawBitFlag:m,outputSize:y}=t,A,b,x=super.readable;if(s&&(o?x=ym(x,new t5(t)):(b=new ZG(t),x=ym(x,b))),u){let T=p&&o5(p);if(T)x=Bw(x,ORe(T.DecompressionStream,p,{chunkSize:n,compressionMethod:g,rawBitFlag:m,uncompressedSize:y}));else try{x=MRe(x,f,{chunkSize:n,deflate64:d},r,i)}catch(E){if(d||y===ke)throw E;let v;try{v=new r(GO)}catch{throw E}x=SFt(x,v,y)}x=PFt(x)}a&&(A=new FO,x=ym(x,A)),RRe(this,x,()=>{if(a){let T=new DataView(A.value.buffer);if(c!=T.getUint32(0,!1))throw new Error(Uw)}})}},IRe=new Map});var DFt,NRe,LRe,FRe,Sie,BRe,kRe,zw,f5,u5,WO,d5=Cs(()=>{dc();vie();DFt=64*1024,NRe="message",LRe="start",FRe="pull",Sie="data",BRe="ack",kRe="close",zw="deflate",f5="inflate",u5=class extends TransformStream{constructor(t,n){super({});let i=this,{codecType:r}=t,o;r.startsWith(zw)?o=s5:r.startsWith(f5)&&(o=c5),i.outputSize=0;let s=0,a=new o(t,n),c=super.readable,u=new TransformStream({transform(d,p){d&&d.length&&(s+=d.length,p.enqueue(d))},flush(){Object.assign(i,{inputSize:s})}}),f=new TransformStream({transform(d,p){if(d&&d.length&&(p.enqueue(d),i.outputSize+=d.length,t.outputSize!==ke&&i.outputSize>t.outputSize))throw new Error(zA)},flush(){let{crc32:d}=a;Object.assign(i,{crc32:d,inputSize:s})}});Object.defineProperty(i,"readable",{get(){return c.pipeThrough(u).pipeThrough(a).pipeThrough(f)}})}},WO=class extends TransformStream{constructor(t){let n=[],i=0;(!Number.isFinite(t)||t<1)&&(t=DFt),super({transform(s,a){for(n.push(s),i+=s.length;i>t;)a.enqueue(r())},flush(s){i&&s.enqueue(o(n,i))}});function r(){let s=new Uint8Array(t),a=0;for(;a<t;){let c=n[0],u=t-a;c.length<=u?(s.set(c,a),a+=c.length,n.shift()):(s.set(c.subarray(0,u),a),n[0]=c.subarray(u),a+=u)}return i-=t,s}function o(s,a){let c=new Uint8Array(a),u=0;for(let f of s)c.set(f,u),u+=f.length;return c}}}});function zRe({initModule:e}){m5=e}function VRe(e){Iie=e}async function jRe(e){let{CompressionStream:t,CompressionStreamFallback:n}=e;if(n&&!n.requiresModule||l5(t)||Cie(t))return!0;if(n)try{return await m5(e),!0}catch{return!1}return!1}function Die(e){e.createWorker?URe=!0:h5=!1}async function wie(e,...t){try{await e(...t)}catch{}}function Rie(e,t){return{run:()=>p5(e,t)}}async function p5({options:e,readable:t,writable:n,onTaskFinished:i},r){let o;try{if(e.compressed&&!e.format){let u=e.codecType.startsWith(zw),f=u?r.CompressionStreamFallback:r.DecompressionStreamFallback,d=u?r.CompressionStream:r.DecompressionStream;if(e.useCompressionStream){if(f&&f.requiresModule&&!l5(d))try{await m5(r)}catch{}}else try{await m5(r)}catch{(!f||f.requiresModule)&&(e.useCompressionStream=!0)}}o=new u5(e,r),await t.pipeThrough(o).pipeThrough(new WO(OO(r))).pipeTo(n,{preventClose:!0,preventAbort:!0});let{crc32:s,inputSize:a,outputSize:c}=o;return{crc32:s,inputSize:a,outputSize:c}}catch(s){throw o&&(s.outputSize=o.outputSize),s}finally{i()}}var BT,h5,URe,Iie,m5,FT,Pie,qO=Cs(()=>{dc();i0();d5();BT="Worker startup timeout",m5=()=>{};FT=class{constructor(t,{readable:n,writable:i},{options:r,config:o,streamOptions:s,useWebWorkers:a,transferStreams:c,workerURI:u,createWorker:f},d){let{signal:p}=s;return URe&&(f=ke),Object.assign(t,{busy:!0,generation:(t.generation||0)+1,readable:n.pipeThrough(new WO(OO(o))).pipeThrough(new Pie(s),{signal:p}),writable:i,options:Object.assign({},r),workerURI:u,createWorker:f,transferStreams:c,terminate(){return new Promise(g=>{let{worker:m,busy:y}=t;m?(y?t.resolveTerminated=g:(m.terminate(),g()),t.interface=null):g()})},onTaskFinished(){if(t.busy){let{resolveTerminated:g}=t;g&&(t.resolveTerminated=null,t.terminated=!0,t.worker.terminate(),g()),t.busy=!1,d(t)}}}),h5===ke&&(h5=typeof Worker!=Hu),(a&&Iie&&(h5&&u||f)?Iie:Rie)(t,o)}},Pie=class extends TransformStream{constructor({onstart:t,onprogress:n,size:i,onend:r}){let o=0;super({async start(){t&&await wie(t,i)},async transform(s,a){o+=s.length,n&&await wie(n,o,i),a.enqueue(s)},async flush(){r&&await wie(r,o)}})}}});async function A5(e,t){let{options:n,config:i}=t,{transferStreams:r,useWebWorkers:o,useCompressionStream:s,compressed:a,checkCrc32:c,computeCrc32:u,encrypted:f,format:d,codecURI:p}=n,{workerURI:g,createWorker:m,maxWorkers:y}=i;d&&(p&&(n.codecURI=BFt(p,i.baseURI)),await wRe(d,n.codecURI)),t.transferStreams=!d&&(r||r===ke&&i.transferStreams);let A=!a&&!c&&!u&&!f,b=d===ke||!!n.codecURI;return t.useWebWorkers=!A&&b&&(o||o===ke&&i.useWebWorkers),t.workerURI=t.useWebWorkers&&g?g:ke,t.createWorker=t.useWebWorkers&&m?m:ke,n.useCompressionStream=s||s===ke&&i.useCompressionStream,(await x()).run();async function x(){let E=kT.find(v=>!v.busy);if(E)return $Re(E),new FT(E,e,t,T);if(kT.length<y){let v={indexWorker:KRe};return KRe++,kT.push(v),new FT(v,e,t,T)}else return new Promise(v=>{Vw.push({resolve:v,stream:e,workerOptions:t}),_5=i.workerStarvationTimeout,y5()})}function T(E){if(JRe(),Vw.length){let[{resolve:v,stream:S,workerOptions:I}]=Vw.splice(0,1);v(new FT(E,S,I,T)),y5()}else E.worker?($Re(E),zFt(E,t)):kT=kT.filter(v=>v!=E)}}function BFt(e,t){try{return new URL(e,t).toString()}catch{return e}}function y5(){!jw&&Vw.length&&Number.isFinite(_5)&&_5>=0&&(jw=setTimeout(kFt,_5))}function JRe(){jw&&(clearTimeout(jw),jw=null)}function kFt(){if(jw=null,Vw.length){let[{resolve:e,stream:t,workerOptions:n}]=Vw.splice(0,1),i=Object.assign({},n,{useWebWorkers:!1,workerURI:ke,createWorker:ke});e(new FT({},t,i,UFt)),y5()}}function UFt(){JRe(),y5()}function zFt(e,t){let{config:n}=t,{terminateWorkerTimeout:i}=n;Number.isFinite(i)&&i>=0&&(e.terminated?e.terminated=!1:e.terminateTimeout=setTimeout(async()=>{kT=kT.filter(r=>r!=e);try{await e.terminate()}catch{}},i))}function $Re(e){let{terminateTimeout:t}=e;t&&(clearTimeout(t),e.terminateTimeout=null)}var kT,Vw,jw,_5,KRe,b5=Cs(()=>{dc();d5();LT();qO();kT=[],Vw=[],KRe=0});function QRe(e){if(VFt){let t="";for(let n=0;n<e.length;n++)t+=ZRe[e[n]];return t}else return new TextDecoder().decode(e)}var ZRe,VFt,eOe=Cs(()=>{ZRe="\0\u263A\u263B\u2665\u2666\u2663\u2660\u2022\u25D8\u25CB\u25D9\u2642\u2640\u266A\u266B\u263C\u25BA\u25C4\u2195\u203C\xB6\xA7\u25AC\u21A8\u2191\u2193\u2192\u2190\u221F\u2194\u25B2\u25BC !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~\u2302\xC7\xFC\xE9\xE2\xE4\xE0\xE5\xE7\xEA\xEB\xE8\xEF\xEE\xEC\xC4\xC5\xC9\xE6\xC6\xF4\xF6\xF2\xFB\xF9\xFF\xD6\xDC\xA2\xA3\xA5\u20A7\u0192\xE1\xED\xF3\xFA\xF1\xD1\xAA\xBA\xBF\u2310\xAC\xBD\xBC\xA1\xAB\xBB\u2591\u2592\u2593\u2502\u2524\u2561\u2562\u2556\u2555\u2563\u2551\u2557\u255D\u255C\u255B\u2510\u2514\u2534\u252C\u251C\u2500\u253C\u255E\u255F\u255A\u2554\u2569\u2566\u2560\u2550\u256C\u2567\u2568\u2564\u2565\u2559\u2558\u2552\u2553\u256B\u256A\u2518\u250C\u2588\u2584\u258C\u2590\u2580\u03B1\xDF\u0393\u03C0\u03A3\u03C3\xB5\u03C4\u03A6\u0398\u03A9\u03B4\u221E\u03C6\u03B5\u2229\u2261\xB1\u2265\u2264\u2320\u2321\xF7\u2248\xB0\u2219\xB7\u221A\u207F\xB2\u25A0\xA0".split(""),VFt=ZRe.length==256});function YO(e,t){return nOe(e,t,!0)}function tOe(e,t){return nOe(e,t,!1)}function nOe(e,t,n){return t&&t.trim().toLowerCase()=="cp437"?QRe(e):new TextDecoder(t,{ignoreBOM:n}).decode(e)}var Bie=Cs(()=>{eOe()});function HFt(){sOe=(async()=>{try{let t=new Blob([new Uint8Array(3)]).slice(1,2).stream().getReader(),n=0,i=await t.read();for(;!i.done;)n+=i.value.length,i=await t.read();kie=n==1}catch{kie=!1}})()}function C5(e){return!!(e&&e.getData)}async function Pc(e,t){if(e.init&&!e.initialized)await e.init(t);else return Promise.resolve()}async function GFt(e){return e=new o_(e),await Pc(e),(e.size===ke||!e.readUint8Array)&&(e=new Gu(await s0(e.readable)),await Pc(e)),e}function Ro(e,t,n){return e.readUint8Array(t,n)}function zie(e,t){return e.createReadable?e.createReadable(t):e.readUint8Array?Gw.prototype.createReadable.call(e,t):e.readable}var rOe,oOe,jFt,_er,yer,Uie,iOe,Hw,Gw,x5,XO,kie,sOe,Gu,Ww,KO,$O,T5,E5,o_,qw,v5=Cs(()=>{dc();i0();MT();Lw();Bie();rOe="Writer iterator completed too soon",oOe="Writer not initialized",jFt="text/plain",_er=256*1024,yer=16*1024*1024,Uie="writable",iOe=Symbol(),Hw=class{constructor(){this.size=0}init(){this.initialized=!0}},Gw=class extends Hw{get readable(){return this.createReadable()}createReadable({offset:t=0,size:n,chunkSize:i=OO(n_())}={}){let r=this,o=0;return i=pie(i),new ReadableStream({async pull(s){let a=n===ke?i:Math.min(i,n-o),c=await Ro(r,t+o,a);c.length&&s.enqueue(c),o+i>=n||!c.length&&a?s.close():o+=i}})}},x5=class extends Hw{constructor(){super();let t=this,n=new WritableStream({write(i){if(!t.initialized)throw new Error(oOe);return t.writeUint8Array(KG(i))}});Object.defineProperty(t,Uie,{get(){return n}})}writeUint8Array(){}},XO=class extends x5{constructor(t){super(),Object.assign(this,{contentType:t,data:"data:"+(t||"")+";base64,",pendingCharacters:""})}writeUint8Array(t){let n=this,i,r=n.pendingCharacters,o=n.pendingCharacters.length;for(n.pendingCharacters="",i=0;i<Math.floor((o+t.length)/3)*3-o;i++)r+=String.fromCharCode(t[i]);for(;i<t.length;i++)n.pendingCharacters+=String.fromCharCode(t[i]);r.length>2?n.data+=btoa(r):n.pendingCharacters=r+n.pendingCharacters}getData(){return this.data+btoa(this.pendingCharacters)}};Gu=class extends Gw{constructor(t){super(),Object.assign(this,{sourceBlob:t,size:t.size}),sOe||HFt()}createReadable(t){let n=this,{sourceBlob:i,size:r}=n,{offset:o=0,size:s=r-o}=t||{};return!o&&s>=r?_m(i.stream()):kie?_m(i.slice(o,o+s).stream()):super.createReadable(t)}async readUint8Array(t,n){let i=this,r=t+n,a=await(!t&&r>=i.size?i.sourceBlob:i.sourceBlob.slice(t,r)).arrayBuffer();return a.byteLength>n&&(a=a.slice(t,r)),new Uint8Array(a)}},Ww=class extends Hw{constructor(t){super();let n=this,i=new TransformStream;Object.defineProperty(n,Uie,{get(){return i.writable}}),n.contentType=t,n.blobPromise=s0(i.readable,t),n.blobPromise.catch(()=>{})}getData(){return this.blobPromise}},KO=class extends Gu{constructor(t){super(new Blob([t],{type:jFt}))}},$O=class extends Ww{constructor(t){super(),Object.assign(this,{encoding:t,utf8:!t||t.toLowerCase()=="utf-8"})}async getData(){let{encoding:t,utf8:n}=this,i=await super.getData();return i.text&&n?i.text():tOe(new Uint8Array(await i.arrayBuffer()),t)}},T5=class extends Gw{constructor(t){super(),this.readers=t}async init(){let t=this;t.lastDiskNumber=0;let n=t.readers=await Promise.all(t.readers.map(GFt));t.diskOffsets=n.map(i=>{let r=t.size;return t.size+=i.size,r}),super.init()}getDiskOffset(t){let{diskOffsets:n,size:i}=this,r=n[t];return r===ke?i:r}async readUint8Array(t,n){let i=this,{readers:r}=this,o,s=0,a=t;for(;r[s]&&a>=r[s].size;)a-=r[s].size,s++;let c=r[s];if(c){let u=c.size;if(a+n<=u)o=await Ro(c,a,n);else{let f=u-a,d=await Ro(c,a,f),p=await i.readUint8Array(t+f,n-f);o=Qd(d,p)}}else o=hr;return i.lastDiskNumber=Math.max(s,i.lastDiskNumber),o}},E5=class extends Hw{constructor(t,n=4294967295){super();let i=this;Object.assign(i,{diskNumber:0,diskOffset:0,size:0,maxSize:n,availableSize:n});let r,o,s,a=new WritableStream({async write(d){if(d===iOe){s&&await u();return}let{availableSize:p}=i;if(s)d.length>=p?(await c(d.subarray(0,p)),await u(),d.length>p&&await this.write(d.subarray(p))):await c(d);else{let{value:g,done:m}=await t.next();if(m&&!g)throw new Error(rOe);r=g,r.size=0,r.maxSize&&(i.maxSize=r.maxSize),i.availableSize=i.maxSize,await Pc(r),o=g.writable,s=o.getWriter(),await this.write(d)}},async close(){s&&(await s.ready,await f())},async abort(d){s&&await s.abort(d)}});Object.defineProperty(i,Uie,{get(){return a}});async function c(d){let p=d.length;p&&(await s.ready,await s.write(d),r.size+=p,i.availableSize-=p)}async function u(){await f(),i.diskOffset+=r.size,i.diskNumber++,s=null,i.availableSize=i.maxSize}async function f(){await s.close()}}async closeDisk(){let t=this.writable.getWriter();try{await t.ready,await t.write(iOe)}finally{t.releaseLock()}}},o_=class{constructor(t){return Array.isArray(t)&&(t=new T5(t)),(t instanceof ReadableStream||typeof t.getReader==Do)&&(t={readable:_m(t)}),t}},qw=class{constructor(t){return t.writable===ke&&typeof t.next==Do&&(t=new E5(t)),(t instanceof WritableStream||typeof t.getWriter==Do)&&(t={writable:vRe(t)}),t.size===ke&&(t.size=0),t}}});var Vie,jie,JO,Hie,ZO,Gie,Wie,qie,Yw,Xw,QO,Yie,eM,Xie,Kie,$ie,S5,w5,Jie,Zie,Qie,I5,ere,tre,nre,ire,UT,rre,WFt,ore,P5,qFt,D5,YFt,XFt,KFt,$Ft,sre,are,cre,lre,JFt,ZFt,QFt,eBt,tBt,nBt,iBt,rBt,oBt,sBt,aBt,cBt,lBt,uBt,fBt,dBt,VA,ure=Cs(()=>{Vie="filename",jie="rawFilename",JO="comment",Hie="rawComment",ZO="uncompressedSize",Gie="compressedSize",Wie="offset",qie="diskNumberStart",Yw="lastModDate",Xw="rawLastModDate",QO="lastAccessDate",Yie="rawLastAccessDate",eM="creationDate",Xie="rawCreationDate",Kie="internalFileAttributes",$ie="externalFileAttributes",S5="internalFileAttribute",w5="externalFileAttribute",Jie="msdosAttributesRaw",Zie="msdosAttributes",Qie="msDosCompatible",I5="zip64",ere="encrypted",tre="version",nre="versionMadeBy",ire="zipCrypto",UT="directory",rre="executable",WFt="symlink",ore="compressionMethod",P5="signature",qFt="crc32",D5="extraField",YFt="extraFieldInfoZip",XFt="extraFieldUnix",KFt="extraFieldUnixType1",$Ft="extraFieldPkwareUnix",sre="unixMode",are="setuid",cre="setgid",lre="sticky",JFt="bitFlag",ZFt="rawBitFlag",QFt="filenameLength",eBt="extraFieldLength",tBt="unixExternalUpper",nBt="filenameUTF8",iBt="commentUTF8",rBt="rawExtraField",oBt="extraFieldZip64",sBt="extraFieldUnicodePath",aBt="extraFieldUnicodeComment",cBt="extraFieldAES",lBt="extraFieldNTFS",uBt="extraFieldExtendedTimestamp",fBt="extraFieldUSDZ",dBt=[Vie,jie,ZO,Gie,Yw,Xw,JO,Hie,QO,Yie,eM,Xie,Wie,qie,Kie,$ie,S5,w5,Jie,Zie,Qie,I5,ere,tre,nre,ire,UT,rre,WFt,ore,P5,qFt,D5,XFt,YFt,KFt,$Ft,"uid","gid",sre,tBt,are,cre,lre,JFt,ZFt,QFt,eBt,nBt,iBt,rBt,oBt,sBt,aBt,cBt,lBt,uBt,fBt],VA=class{constructor(t){dBt.forEach(n=>this[n]=t[n])}}});var NOe={};zke(NOe,{ERR_AMBIGUOUS_ARCHIVE:()=>kre,ERR_BAD_FORMAT:()=>Kw,ERR_CENTRAL_DIRECTORY_NOT_FOUND:()=>Ore,ERR_ENCRYPTED:()=>Lre,ERR_ENCRYPTED_CENTRAL_DIRECTORY:()=>Ure,ERR_ENTRY_DATA_OUT_OF_BOUNDS:()=>Bre,ERR_EOCDR_LOCATOR_ZIP64_NOT_FOUND:()=>Rre,ERR_EOCDR_NOT_FOUND:()=>Dre,ERR_EXTRAFIELD_ZIP64_NOT_FOUND:()=>Nre,ERR_INVALID_AUTHENTICATION_CODE:()=>UA,ERR_INVALID_COMPRESSED_DATA:()=>kw,ERR_INVALID_CRC32:()=>Uw,ERR_INVALID_FILENAME_VALIDATION:()=>jre,ERR_INVALID_MAX_APPENDED_DATA_SIZE:()=>Hre,ERR_INVALID_PASSWORD:()=>r0,ERR_INVALID_SIGNATURE:()=>kA,ERR_INVALID_STRICTNESS:()=>Vre,ERR_INVALID_UNCOMPRESSED_SIZE:()=>zA,ERR_LOCAL_FILE_HEADER_NOT_FOUND:()=>Mre,ERR_OVERLAPPING_ENTRY:()=>Fre,ERR_SPLIT_ZIP_FILE:()=>L5,ERR_UNSAFE_FILENAME:()=>zre,ERR_UNSUPPORTED_COMPRESSION:()=>N5,ERR_UNSUPPORTED_ENCRYPTION:()=>M5,ERR_UNSUPPORTED_UINT64:()=>Gre,ERR_WORKER_STARTUP_TIMEOUT:()=>BT,WARNING_APPENDED_DATA:()=>B5,WARNING_COMPRESSED_PATCHED_DATA:()=>Yre,WARNING_DUPLICATE_FILENAME:()=>Jre,WARNING_MALFORMED_EXTRA_FIELD:()=>$5,WARNING_MISMATCHED_LOCAL_FILE_HEADER_BIT_FLAG:()=>Zre,WARNING_MISMATCHED_LOCAL_FILE_HEADER_COMPRESSION_METHOD:()=>Qre,WARNING_MISMATCHED_LOCAL_FILE_HEADER_CRC32_OR_SIZES:()=>eoe,WARNING_MISMATCHED_ZIP64_END_OF_CENTRAL_DIRECTORY:()=>$w,WARNING_PREPENDED_CENTRAL_DIRECTORY:()=>Kre,WARNING_PREPENDED_DATA:()=>k5,WARNING_TRAILING_CENTRAL_DIRECTORY_DATA:()=>$re,WARNING_UNKNOWN_VERSION:()=>qre,WARNING_UNKNOWN_ZIP64_EXTENSIBLE_DATA:()=>Xre,WARNING_UNSORTED_CENTRAL_DIRECTORY:()=>Wre,WARNING_WRAPPED_ENTRIES_COUNT:()=>F5,ZipReader:()=>HT,ZipReaderStream:()=>z5,isZipFile:()=>vOe});async function vOe(e,t={}){if(e=new o_(e),await Pc(e),(e.size===ke||!e.readUint8Array)&&(e=new Gu(await s0(e.readable)),await Pc(e)),e.size<22)return!1;let n=noe(t,{}),i=n!=t_,r=DOe(t[fie],n),{endOfDirectoryInfo:o,endOfDirectoryReachingEndCount:s}=await ROe(e,i,r);if(!o||n==FA&&s>1)return!1;let a=mr(li(o),20),c=o.offset+22+a;return e.size-c<=r}function fre(e){let t=Math.min(e.byteLength,1024)-3;for(let n=0;n<t;n++)if(Pi(e,n)==134630224)return!0;return!1}function pOe(e,t,n){let i=0;for(;n+46<=t.length&&Pi(e,n)==33639248;)n+=46+mr(e,n+28)+mr(e,n+30)+mr(e,n+32),i++;return i%65536?0:i}function dre(e){if(e.length>=6){let t=li(e);if(Pi(t,0)==84233040){let n=mr(t,4);if(6+n<=e.length)return e.subarray(6,6+n)}}}function SBt(e,t,n){let i=e&&e.compressedSize?e.compressedSize:t;return i>0&&i<=n?i:n}function wBt(e){let t={rawExtensibleData:e};if(e.length>=28){let n=li(e),i=mr(n,26);Object.assign(t,{compressionMethod:mr(n,0),compressedSize:Ff(n,2),uncompressedSize:Ff(n,10),encryptionAlgorithm:mr(n,18),bitLength:mr(n,20),flags:mr(n,22),hashAlgorithm:mr(n,24),hashData:e.subarray(28,28+i)})}return t}function SOe(e,t,n){let i=e.rawBitFlag=mr(t,n+2),r=(i&1)==1,o=Pi(t,n+6);Object.assign(e,{encrypted:r,version:mr(t,n),bitFlag:{level:(i&6)>>1,dataDescriptor:(i&8)==8,languageEncodingFlag:(i&2048)==2048},rawLastModDate:o,lastModDate:jBt(o),filenameLength:mr(t,n+22),extraFieldLength:mr(t,n+24)})}function wOe(e,t,n,i,r){let{rawExtraField:o}=t,s=t.extraField=new Map,a=li(o),c=0,u=!1;try{for(;c<o.length;){let S=mr(a,c),I=mr(a,c+2);s.set(S,{type:S,data:o.slice(c+4,c+4+I)}),c+=4+I}}catch{u=!0}c>o.length&&(u=!0);let f=mr(n,i+4);Object.assign(t,{signature:Pi(n,i+10),crc32:Pi(n,i+10),compressedSize:Pi(n,i+14),uncompressedSize:Pi(n,i+18)});let d=s.get(1);d&&(IBt(d,t),t.extraFieldZip64=d);let p=s.get(28789);p&&(gOe(p,Vie,jie,t,e),t.extraFieldUnicodePath=p);let g=s.get(25461);g&&(gOe(g,JO,Hie,t,e),t.extraFieldUnicodeComment=g);let m=s.get(39169);m&&m.data.length>=7?(PBt(m,t,f),t.extraFieldAES=m):t.compressionMethod=f;let y=s.get(13);y&&(_Oe(y,t),t.extraFieldPkwareUnix=y);let A=s.get(22613);A&&(_Oe(A,t),t.extraFieldUnixType1=A);let b=s.get(10);b&&(DBt(b,t),t.extraFieldNTFS=b);let x=s.get(30805),T;if(x&&(T=yOe(x,t,!1),t.extraFieldUnix=x),!T){let S=s.get(30837);S&&(yOe(S,t,!0),t.extraFieldInfoZip=S)}let E=s.get(21589);E&&(RBt(E,t,r),t.extraFieldExtendedTimestamp=E);let v=s.get(6534);return v&&(t.extraFieldUSDZ=v),u}function IBt(e,t){t.zip64=!0;let n=li(e.data),i=TBt.filter(([o,s])=>t[o]==s),r=i.reduce((o,[,s])=>o+hOe[s].bytes,0);if(e.data.length<r)throw new Error(Nre);for(let o=0,s=0;o<i.length;o++){let[a,c]=i[o],u=hOe[c];t[a]=e[a]=u.getValue(n,s),s+=u.bytes}}function gOe(e,t,n,i,r){if(e.data.length<5){e.valid=!1;return}let o=li(e.data),s=new gm;s.append(r[n]);let a=li(new Uint8Array(4));a.setUint32(0,s.get(),!0);let c=Pi(o,1),u=HA(o,0);Object.assign(e,{version:u,[t]:YO(e.data.subarray(5)),valid:u==1&&!r.bitFlag.languageEncodingFlag&&c==Pi(a,0)}),e.valid&&(i[t]=e[t],i[t+xBt]=!0)}function PBt(e,t,n){let i=li(e.data),r=HA(i,4);Object.assign(e,{vendorVersion:HA(i,0),vendorId:HA(i,2),strength:r,originalCompressionMethod:n,compressionMethod:mr(i,5)}),t.compressionMethod=e.compressionMethod,e.vendorVersion!=COe&&(t.crc32=ke)}function DBt(e,t){let n=li(e.data),i=4,r;try{for(;i<e.data.length&&!r;){let o=mr(n,i),s=mr(n,i+2);o==1&&(r=e.data.slice(i+4,i+4+s)),i+=4+s}}catch{}if(r&&r.length==24){let o=li(r),s=o.getBigUint64(0,!0),a=o.getBigUint64(8,!0),c=o.getBigUint64(16,!0);Object.assign(e,{rawLastModDate:s,rawLastAccessDate:a,rawCreationDate:c});let u=hre(s),f=hre(a),d=hre(c),p={lastModDate:u,lastAccessDate:f,creationDate:d};Object.assign(e,p),Object.assign(t,p,{rawLastAccessDate:a,rawCreationDate:c})}}function _Oe(e,t){if(e.data.length<8)return;let n=li(e.data),i=new Date((Pi(n,0)|0)*1e3),r=new Date((Pi(n,4)|0)*1e3),o={lastAccessDate:i,lastModDate:r};e.data.length>=12&&(o.uid=mr(n,8),o.gid=mr(n,10)),Object.assign(e,o),Object.assign(t,o)}function yOe(e,t,n){try{let i=li(e.data),r,o;if(n){let s=0,a=HA(i,s++),c=HA(i,s++);r=AOe(e.data.subarray(s,s+c)),s+=c;let u=HA(i,s++);o=AOe(e.data.subarray(s,s+u)),Object.assign(e,{version:a,uid:r,gid:o})}else e.data.length>=4&&(r=mr(i,0),o=mr(i,2),Object.assign(e,{uid:r,gid:o}));return r!==ke&&(t.uid=r),o!==ke&&(t.gid=o),r!==ke||o!==ke}catch{}}function AOe(e){let t=new Uint8Array(4);return t.set(e,0),new DataView(t.buffer,t.byteOffset,4).getUint32(0,!0)}function RBt(e,t,n){if(!e.data.length)return;let i=li(e.data),r=HA(i,0),o=[],s=[];n?((r&1)==1&&(o.push(Yw),s.push(Xw)),(r&2)==2&&(o.push(QO),s.push(Yie)),(r&4)==4&&(o.push(eM),s.push(Xie))):e.data.length>=5&&(o.push(Yw),s.push(Xw));let a=1;o.forEach((c,u)=>{if(e.data.length>=a+4){let f=Pi(i,a);t[c]=e[c]=new Date((f|0)*1e3);let d=s[u];e[d]=f}a+=4})}async function OBt({reader:e,fileEntry:t,index:n,offset:i,crc32:r,compressedSize:o,uncompressedSize:s,dataOffset:a,dataDescriptor:c,extraFieldZip64:u,readRanges:f}){let d=0;if(c&&(u?d=20:d=12),d){let g=await Ro(e,a+o,d+4),m=li(g),y=g.length==d+4&&Pi(m,0)==134695760;if(y){let A=bOe(m,4,u);(t.encrypted&&!t.zipCrypto||A.crc32==r)&&A.compressedSize==o&&A.uncompressedSize==s?d+=4:y=!1}if(g.length>=d){let A=bOe(m,y?4:0,u);A.signature=y,t.localDirectory.dataDescriptor=A}}let p={start:i,end:a+o+d,fileEntry:t};for(let[g,m]of f)if(g!=n&&p.start<m.end&&m.start<p.end){let y=new Error(Fre);throw y.overlappingEntry=m.fileEntry,y}f.set(n,p)}function bOe(e,t,n){let i=Pi(e,t),r,o;return n?(r=Ff(e,t+4),o=Ff(e,t+12)):(r=Pi(e,t+4),o=Pi(e,t+8)),{crc32:i,compressedSize:r,uncompressedSize:o}}function Jw(e,t){return e.getDiskOffset?e.getDiskOffset(t):0}async function MBt(e){return await IOe(e)==134695760}async function NBt(e){let t=await IOe(e);return t==134695760||t==808471376}async function IOe(e){let t=await Ro(e,0,4);return Pi(li(t))}function POe(e){return e===FA||e===qG||e===t_}function LBt(e,t,n){return Math.min(e,n?t*vBt:t)}function noe(e,t){return xOe(e,xOe(t,qG))}function xOe(e,t){let n=e[H1e];if(n!==ke){if(!POe(n))throw new Error(Vre);return n}let i=e[C1e];return i===ke?t:i?FA:t==t_?t_:qG}function FBt(e,t){return e===ke?t!=t_:!!e}function BBt(e,t){return e===ke?t==FA:!!e}function kBt(e,t){if(e===ke)return t;if(!POe(e))throw new Error(jre);return e}function UBt(e,t){if(t==t_)return!1;let n=e.split("/");return n.length>1&&n[n.length-1]===""&&n.pop(),n.includes("..")||e.startsWith("/")||e.startsWith("\\\\")||bBt.test(e)?!0:t==FA&&(n.includes(".")||n.includes(""))}function DOe(e,t){if(e!==ke){let n=OT(e);if(typeof n!=m1e||Number.isNaN(n)||n<0)throw new Error(Hre);return n}return t==FA?0:t==t_?1/0:65535}async function ROe(e,t,n){let{size:i}=e,r=Math.min(i,65557),o={count:CBt},s,a,c=0;for await(let[u,f,d,p,g]of OOe(e,r)){let m=mr(u,p+20);if(g+22+m==i){let y=await MOe(e,u,f,p,g,i,o);if(y==U5){if(s||(s=pre(d,p,g)),c++,!t||c>1)break}else y==toe&&!a&&(a=pre(d,p,g))}}return s||(s=a),s||(s=await zBt(e,n,o)),{endOfDirectoryInfo:s,endOfDirectoryReachingEndCount:c}}async function zBt(e,t,n){let{size:i}=e,r=Math.min(i,t==1/0?i:65557+t),o,s;for await(let[a,c,u,f,d]of OOe(e,r)){let p=pre(u,f,d);o||(o=p);let g=await MOe(e,a,c,f,d,i,n);if(g==U5)return p;g==toe&&!s&&(s=p)}return s||o}async function*OOe(e,t){let n=e.size-t,i=await Ro(e,n,t),r=li(i);for(let o=i.length-22;o>=0;o--)Pi(r,o)==101010256&&(yield[r,n,i,o,n+o])}function pre(e,t,n){return{offset:n,buffer:e.slice(t,t+22).buffer}}async function MOe(e,t,n,i,r,o,s){let a=mr(t,i+10),c=Pi(t,i+12),u=Pi(t,i+16);if(a==65535||c==4294967295||u==4294967295)return await TOe(e,t,n,r-20,o,s)==117853008?U5:mOe;if(!a&&!c)return toe;let f=mr(t,i+6);for(let d of[r-c,Jw(e,f)+u])if(await TOe(e,t,n,d,o,s)==33639248)return U5;return mOe}async function TOe(e,t,n,i,r,o){if(i<0||i+4>r)return ke;if(i>=n)return Pi(t,i-n);if(o.count>0){o.count--;let s=await Ro(e,i,4);return Pi(li(s),0)}return ke}function VBt(e,t,n,i,r){let{rawFilename:o}=e,s=!r,a=e.decryptedDirectory&&(t.rawBitFlag&8192)==8192;i&&!a&&(n.length!=o.length||n.some((c,u)=>c!=o[u]))&&l0(s,r,"mismatched local file header (filename)"),(t.rawBitFlag&dOe)!=(e.rawBitFlag&dOe)&&l0(s,r,Zre),t.compressionMethod!=e.compressionMethod&&l0(s,r,Qre),!t.bitFlag.dataDescriptor&&!a&&(t.crc32||t.compressedSize||t.uncompressedSize)&&(t.crc32!=e.crc32||t.compressedSize!=e.compressedSize||t.uncompressedSize!=e.uncompressedSize)&&l0(s,r,eoe)}function l0(e,t,n){e?R5(n):th(t,n)}function th(e,t,n){if(!e.some(i=>i.reason==t)){let i={reason:t};n!==ke&&(i.filename=n),e.push(i)}}function R5(e){let t=new Error(kre);throw t.reason=e,t}function As(e,t,n){return t[n]===ke?e.options[n]:t[n]}function EOe(e,t,n){return Iw(As(e,t,n))}function jBt(e){let t=(e&4294901760)>>16,n=e&65535,i=new Date(1980+((t&65024)>>9),((t&480)>>5)-1,t&31,(n&63488)>>11,(n&2016)>>5,(n&31)*2,0);return i<Sw?Sw:i}function hre(e){return new Date(Number(e/BigInt(1e4)-BigInt(116444736e5)))}function HA(e,t){return e.getUint8(t)}function mr(e,t){return e.getUint16(t,!0)}function Pi(e,t){return e.getUint32(t,!0)}function Ff(e,t){let n=e.getBigUint64(t,!0);if(n>EBt)throw new Error(Gre);return Number(n)}var Kw,Dre,Rre,Ore,Mre,Nre,Lre,M5,N5,L5,Fre,Bre,kre,Ure,zre,Vre,jre,Hre,Gre,Wre,qre,Yre,$5,Xre,F5,B5,k5,Kre,$re,Jre,$w,Zre,Qre,eoe,ABt,bBt,uOe,xBt,fOe,dOe,COe,TBt,hOe,EBt,CBt,vBt,mOe,toe,U5,HT,z5,mre,ioe=Cs(()=>{dc();i0();LT();b5();v5();Bie();MT();Lw();LO();ure();RO();Kw="File format is not recognized",Dre="End of central directory not found",Rre="End of Zip64 central directory locator not found",Ore="Central directory header not found",Mre="Local file header not found",Nre="Zip64 extra field not found",Lre="File contains encrypted entry",M5="Encryption method not supported",N5="Compression method not supported",L5="Split zip file",Fre="Overlapping entry found",Bre="Entry data out of bounds",kre="Ambiguous archive",Ure="Encrypted central directory is not supported",zre="Unsafe filename",Vre="Invalid strictness (must be 'strict', 'balanced' or 'tolerant')",jre="Invalid filenameValidation (must be 'strict', 'balanced' or 'tolerant')",Hre="Invalid maxAppendedDataSize (must be a number greater than or equal to 0)",Gre="64-bit value exceeds Number.MAX_SAFE_INTEGER",Wre="unsorted central directory",qre="unknown version needed to extract",Yre="compressed patched data",$5="malformed extra field",Xre="unknown zip64 extensible data",F5="wrapped entries count",B5="appended data",k5="prepended data",Kre="prepended central directory",$re="trailing central directory data",Jre="duplicate filename",$w="mismatched zip64 end of central directory record",Zre="mismatched local file header (general purpose bit flag)",Qre="mismatched local file header (compression method)",eoe="mismatched local file header (crc32 or sizes)",ABt=63,bBt=/^[a-zA-Z]:/,uOe="utf-8",xBt="UTF8",fOe="cp437",dOe=2057,COe=1,TBt=[[ZO,4294967295],[Gie,4294967295],[Wie,4294967295],[qie,65535]],hOe={65535:{getValue:Pi,bytes:4},4294967295:{getValue:Ff,bytes:8}},EBt=BigInt(Number.MAX_SAFE_INTEGER),CBt=64,vBt=1032,mOe=0,toe=1,U5=2,HT=class{constructor(t,n={}){Object.assign(this,{reader:new o_(t),options:n,readRanges:new Map})}async*getEntriesGenerator(t={}){let n=this,{reader:i}=n;if(await Pc(i),(i.size===ke||!i.readUint8Array)&&(i=new Gu(await s0(i.readable)),await Pc(i)),i.size<22)throw new Error(Kw);let r=n.warnings=[],o=noe(t,n.options),s=o==FA,a=o!=t_,c=DOe(As(n,t,fie),o),u=kBt(As(n,t,G1e),o),f=As(n,t,W1e),{endOfDirectoryInfo:d,endOfDirectoryReachingEndCount:p}=await ROe(i,a,c);if(!d)throw await MBt(i)?new Error(L5):new Error(Dre);a&&p>1&&R5("multiple end of central directory records");let g=li(d),m=Pi(g,12),y=Pi(g,16),A=d.offset,b=mr(g,20),x=A+22+b,T=i.size-x;T>c&&R5(B5),T>0&&th(r,B5);let E=mr(g,4),v=i.lastDiskNumber||0,S=mr(g,6),I=mr(g,10),R=0,O,L,_,C,w=56,D,N=y==4294967295||m==4294967295||I==65535||S==65535;if(y!=4294967295&&S!=65535&&(y+=Jw(i,S)),N){let He=d.offset>=20?await Ro(i,d.offset-20,20):hr,Ye=li(He);if(He.length==20&&Pi(Ye,0)==117853008){y=Jw(i,Pi(Ye,4))+Ff(Ye,8);let Ke=await Ro(i,y,56),Pe=li(Ke),qe=d.offset-20-56;if((Ke.length<56||Pi(Pe,0)!=101075792)&&y!=qe&&qe>=0){let st=y;y=qe,y>st&&(R=y-st),Ke=await Ro(i,y,56),Pe=li(Ke)}if(Ke.length<56||Pi(Pe,0)!=101075792)throw new Error(Rre);if(_=!0,C=Ff(Pe,4)>44,C){let st=Math.min(Ff(Pe,4)-44,i.size-y-56);if(st>0){w+=st;let vt=await Ro(i,y+56,st);D=wBt(vt)}}E==65535?E=Pi(Pe,16):E!=Pi(Pe,16)&&l0(s,r,$w),S==65535?S=Pi(Pe,20):S!=Pi(Pe,20)&&l0(s,r,$w),I==65535?I=Ff(Pe,32):I!=Ff(Pe,32)&&l0(s,r,$w),m==4294967295?m=Ff(Pe,40):m!=Ff(Pe,40)&&l0(s,r,$w),y=Jw(i,S)+Ff(Pe,48)+R}}let F=m,V=d.offset-(_?w+20:0);if(y>=i.size&&(R=i.size-y-m-22,y=i.size-m-22),v!=E)throw new Error(L5);if(y<0)throw new Error(Kw);let B=0,j=await Ro(i,y,m),k=li(j);if(m){if(j.length<4)throw new Error(Kw);let He=V-m;if(y!=He&&S==E){let Ye=Pi(k,B)==33639248||!!(D&&D.compressedSize)||fre(k),Ke=!Ye;if(!Ke&&He>=0&&He+4<=i.size){let Pe=await Ro(i,He,4);Ke=Pi(li(Pe),0)==33639248}if(Ke){let Pe=y;y=He,y>Pe&&(R+=y-Pe,O=Ye),j=await Ro(i,y,m),k=li(j)}}}let G=V-y;if(m!=G&&G>=0&&S==E&&(m=G,j=await Ro(i,y,m),k=li(j)),y<0||y>=i.size)throw new Error(Kw);n.directoryOffset=y,n.directoryLength=F;let q=EOe(n,t,q1e),Q,W;if(q&&I&&j.length>=4&&Pi(k,0)!=33639248&&(C||fre(k))){let He=SBt(D,F,j.length);W=j.subarray(He),j=await q(j.subarray(0,He),D),k=li(j),F=j.length,Q=!0}D&&!Q&&(j.length<4||Pi(k,0)==33639248)&&th(r,Xre),L=y;let J=As(n,t,g1e),Z=As(n,t,_1e),ae=new Set,Ae,fe=-1,xe=!s&&!_;!I&&xe&&(I=pOe(k,j,B),I&&th(r,F5));for(let He=0;He<I;He++){let Ye=new mre(i,n.options);if(B+46>j.length||Pi(k,B)!=33639248)throw He==0&&!Q&&(C||fre(k))?new Error(Ure):new Error(Ore);SOe(Ye,k,B+6);let Ke=!!Ye.bitFlag.languageEncodingFlag,Pe=B+46,qe=Pe+Ye.filenameLength,st=qe+Ye.extraFieldLength,vt=mr(k,B+4),jt=vt>>8==0,lt=vt>>8==3,mt=j.subarray(Pe,qe),ft=mr(k,B+32),Yt=st+ft,rt=j.subarray(st,Yt),ht=Ke,Li=Ke,Yn=Pi(k,B+38),yi=Yn&255,zi={readOnly:!!(yi&1),hidden:!!(yi&2),system:!!(yi&4),directory:!!(yi&16),archive:!!(yi&32)},Si=Pi(k,B+42),ui=EOe(n,t,y1e)||YO,Ai=ht?uOe:J||fOe,zn=Li?uOe:Z||fOe,tn=ui(mt,Ai,GG);if(tn===ke&&(tn=YO(mt,Ai)),f){let Fi=f(tn);Fi!==ke&&(tn=Fi)}if(UBt(tn,u)){let Fi=new Error(zre);throw Fi.filename=tn,Fi}let Hn=ui(rt,zn,WG);Hn===ke&&(Hn=YO(rt,zn)),Object.assign(Ye,{index:He,decryptedDirectory:Q,versionMadeBy:vt,msDosCompatible:jt,zip64:!1,compressedSize:0,uncompressedSize:0,commentLength:ft,offset:Si,diskNumberStart:mr(k,B+34),internalFileAttributes:mr(k,B+36),externalFileAttributes:Yn,msdosAttributesRaw:yi,msdosAttributes:zi,rawFilename:mt,filenameUTF8:ht,commentUTF8:Li,rawExtraField:j.subarray(qe,st),rawComment:rt,filename:tn,comment:Hn}),wOe(Ye,Ye,k,B+6)&&th(r,$5,tn),Ye.offset+=R;let Ki=Jw(i,Ye.diskNumberStart)+Ye.offset;L=Math.min(Ki,L),Ki<fe&&th(r,Wre,tn),fe=Ki,(Ye.version&255)>ABt&&th(r,qre,tn),(Ye.rawBitFlag&32)==32&&th(r,Yre,tn),ae.has(Ye.filename)&&(Ae=!0),ae.add(Ye.filename);let wr=Ye.externalFileAttributes>>16&65535;Ye.unixMode===ke&&(wr&16877)!=0&&(Ye.unixMode=wr);let so=!!(Ye.unixMode&2048),Ts=!!(Ye.unixMode&1024),zs=!!(Ye.unixMode&512),pi=((Ye.unixMode===ke?wr:Ye.unixMode)&61440)==40960,ao=!pi&&(Ye.unixMode!==ke?(Ye.unixMode&73)!=0:lt&&(wr&73)!=0),nr=Ye.unixMode!==ke&&(Ye.unixMode&61440)==16384,jo=(wr&61440)==16384;Object.assign(Ye,{setuid:so,setgid:Ts,sticky:zs,symlink:pi,unixExternalUpper:wr,internalFileAttribute:Ye.internalFileAttributes,externalFileAttribute:Ye.externalFileAttributes,executable:ao,directory:nr||jo||jt&&zi.directory||Ye.filename.endsWith("/"),zipCrypto:Ye.encrypted&&!Ye.extraFieldAES});let Fn=new VA(Ye);if(Fn.getData=(Fi,Ir)=>Ye.getData(Fi,Fn,n.readRanges,Ir),Fn.arrayBuffer=async Fi=>{let Ir=new TransformStream,Mc=s0(Ir.readable).then(qf=>qf.arrayBuffer());return Mc.catch(()=>{}),await Ye.getData(Ir,Fn,n.readRanges,Fi),Mc},B=Yt,He==I-1&&xe){let Fi=pOe(k,j,B);Fi&&(I+=Fi,th(r,F5))}let{onprogress:Vi}=t;if(Vi)try{await Vi(He+1,I,new VA(Ye))}catch{}yield Fn}let ge=B,we=dre(j.subarray(B))||(Q?dre(W):ke);if(!we&&!Q){let He=y+B,Ye=Math.min(V-He,65541);Ye>=6&&(we=dre(await Ro(i,He,Ye)))}we&&(n.digitalSignature=we,ge=B+6+we.length),(B!=F&&ge!=F||!Q&&B!=m&&ge!=m)&&l0(s,r,$re),Ae&&l0(s,r,Jre);let ve=As(n,t,A1e),Re=As(n,t,b1e),Qe=(s||ve)&&I&&L==4&&await NBt(i)?4:0;return s&&(R||I&&L>Qe)&&R5(k5),(R||I&&L>4)&&th(r,k5),O&&th(r,Kre),ve&&(n.prependedData=L>Qe?await Ro(i,Qe,L-Qe):hr),n.comment=b?await Ro(i,A+22,b):hr,Re&&(n.appendedData=x<i.size?await Ro(i,x,i.size-x):hr),!0}async getEntries(t={}){let n=[];for await(let i of this.getEntriesGenerator(t))n.push(i);return n}async close(){let{reader:t}=this;!t.readUint8Array&&t.readable&&!t.readable.locked&&await t.readable.cancel()}},z5=class{constructor(t={}){let{readable:n,writable:i}=new TransformStream,r=new HT(n,t).getEntriesGenerator();this.readable=new ReadableStream({async pull(o){let{done:s,value:a}=await r.next();if(s)return o.close();let c={...a,readable:(function(){let{readable:u,writable:f}=new TransformStream;if(a.getData)return d(),u;async function d(){try{await a.getData(f)}catch(p){try{await f.abort(p)}catch{}}}})()};delete c.getData,o.enqueue(c)}}),this.writable=i}};mre=class{constructor(t,n){Object.assign(this,{reader:t,options:n})}async getData(t,n,i,r={}){let o=this,s=n_(),{reader:a,index:c,offset:u,diskNumberStart:f,extraFieldAES:d,extraFieldZip64:p,compressionMethod:g,bitFlag:m,rawBitFlag:y,crc32:A,rawLastModDate:b,uncompressedSize:x,compressedSize:T}=o,{dataDescriptor:E}=m,v=n.localDirectory={},S=n.warnings=[],I=Jw(a,f)+u,R=await Ro(a,I,30),O=li(R),L=As(o,r,FG),_=As(o,r,BG),C=As(o,r,kG);if(XG(L,_),L=L&&L.length&&L,_=_&&_.length&&_,d&&d.originalCompressionMethod!=99)throw new Error(N5);if(R.length<30||Pi(O,0)!=67324752)throw new Error(Mre);SOe(v,O,4);let{extraFieldLength:w,filenameLength:D}=v,N=v.dataOffset=I+30+D+w,F=As(o,r,v1e),V=noe(r,o.options),B=FBt(F,V),j=BBt(F,V),k=hr;if(j&&(D||w)){let ft=await Ro(a,I+30,D+w);k=ft.subarray(0,D),v.rawExtraField=ft.subarray(D)}else v.rawExtraField=w?await Ro(a,I+30+D,w):hr;j&&(v.rawFilename=k),wOe(o,v,O,4,!0)&&th(S,$5),VBt(o,v,k,j,B?ke:S);let{lastAccessDate:G,creationDate:q,uid:Q,gid:W}=v;G&&(n.lastAccessDate=G),q&&(n.creationDate=q),Q!==ke&&n.uid===ke&&(n.uid=Q),W!==ke&&n.gid===ke&&(n.gid=W);let J=o.encrypted&&v.encrypted&&!C,Z=J&&!d;if(C||(n.zipCrypto=Z),J&&(v.rawBitFlag&64)==64)throw new Error(M5);let ae=C?ke:r5(g);if(g!=0&&g!=8&&g!=9&&!ae&&!C)throw new Error(N5);if(J){if(!Z&&(d.strength<1||d.strength>3))throw new Error(M5);if(!L&&!_)throw new Error(Lre)}if(N+T>a.size)throw new Error(Bre);let Ae=T,fe=_m(a.createReadable({offset:N,size:Ae})),xe=YG(As(o,r,UG)),ge=As(o,r,x1e),we=As(o,r,E1e),ve=As(o,r,T1e);ve&&(we=!0);let{onstart:Re,onprogress:Qe,onend:He}=r,Ye=g!=0&&!C,Ke=C?T:x,Pe=g==9,qe=As(o,r,VG);Pe&&(qe=!1);let st=As(o,r,w1e),vt=(st===ke?As(o,r,S1e):st)&&!C&&(!J||Z||d&&d.vendorVersion==COe),jt={options:{codecType:f5,password:L,rawPassword:_,zipCrypto:Z,encryptionStrength:d&&d.strength,checkCrc32:vt,checkAuthenticationCode:As(o,r,I1e),passwordVerification:Z&&(E?b>>>8&255:A>>>24&255),outputSize:Ke,crc32:A,compressed:Ye,encrypted:J,useWebWorkers:As(o,r,zG),useCompressionStream:qe,transferStreams:As(o,r,jG),deflate64:Pe,format:ae?ae.format:ke,codecURI:ae?ae.codecURI:ke,compressionMethod:g,rawBitFlag:y,checkPasswordOnly:ge},config:s,streamOptions:{signal:xe,size:Ae,onstart:Re,onprogress:Qe,onend:He}};we&&await OBt({reader:a,fileEntry:n,index:c,offset:I,crc32:A,compressedSize:T,uncompressedSize:x,dataOffset:N,dataDescriptor:E||v.bitFlag.dataDescriptor,extraFieldZip64:p||v.extraFieldZip64,readRanges:i});let lt,mt;try{if(!ve){ge&&(t=new WritableStream),t=new qw(t),await Pc(t,LBt(Ke,T,Ye)),{writable:lt}=t;let{outputSize:ft}=await A5({readable:fe,writable:lt},jt);if(t.size+=ft,ft!=Ke)throw new Error(zA)}}catch(ft){if(ft.outputSize!==ke&&(t.size+=ft.outputSize),!ge||ft.message!=i_)throw mt=ft,ft}finally{if(!(!C5(t)&&As(o,r,HG))&<&&!lt.locked){let Yt=lt.getWriter();if(mt)try{await Yt.abort(mt)}catch{}else await Yt.close()}}return ge||ve?ke:t.getData?t.getData():lt}}});var Ose=uh((wfr,PM)=>{/*! * protobuf.js v8.8.0 (c) 2016, daniel wirtz * compiled thu, 27 aug 2026 00:01:05 utc * licensed under the bsd-3-clause license * see: https://github.com/dcodeio/protobuf.js for details - */(function(e){"use strict";(function(n,i,r){function o(a){var c=i[a];return c||n[a][0].call(c=i[a]={exports:{}},o,c,c.exports),c.exports}var s=o(r[0]);s.util.global.protobuf=s,typeof define=="function"&&define.amd&&define(["long"],function(a){return a&&a.isLong&&(s.util.Long=a,s.configure()),s}),typeof PM=="object"&&PM&&PM.exports&&(PM.exports=s)})({1:[function(t,n,i){"use strict";i.build="minimal",i.Writer=t(15),i.BufferWriter=t(16),i.Reader=t(2),i.BufferReader=t(3),i.util=t(12),i.rpc=t(5),i.roots=t(4),i.configure=r;function r(){i.util.LongBits._configure(i.util.Long),i.Writer._configure(i.BufferWriter),i.Reader._configure(i.BufferReader)}r()},{12:12,15:15,16:16,2:2,3:3,4:4,5:5}],2:[function(t,n,i){"use strict";n.exports=u;var r=t(12),o,s=r.LongBits,a=r.utf8;function c(T,E){return RangeError("index out of range: "+T.pos+" + "+(E||1)+" > "+T.len)}function u(T){this.buf=T,this.pos=0,this.len=T.length,this.view=null,this.discardUnknown=u.discardUnknown}function f(T){if(Array.isArray(T)&&(T=new Uint8Array(T)),T instanceof Uint8Array)return new u(T);throw Error("illegal buffer")}var d=function(){return r.Buffer?function(v){return(u.create=function(I){return r.Buffer.isBuffer(I)?new o(I):f(I)})(v)}:f};u.create=d(),u.prototype.raw=function(E,v){return this.buf.subarray(E,v)};function p(T){for(var E=0,v=0;v<4;++v){if(T.pos>=T.len)throw c(T);var S=T.buf[T.pos++];if(E=(E|(S&127)<<v*7)>>>0,S<128)return E}throw c(T)}u.prototype.uint32=function(){if(this.len-this.pos<5){if(this.pos>=this.len)throw c(this);if(this.buf[this.pos]>=128)return p(this)}var E=this.buf,v=this.pos,S=(E[v]&127)>>>0;if(E[v++]<128)return this.pos=v,S;if(S=(S|(E[v]&127)<<7)>>>0,E[v++]<128)return this.pos=v,S;if(S=(S|(E[v]&127)<<14)>>>0,E[v++]<128)return this.pos=v,S;if(S=(S|(E[v]&127)<<21)>>>0,E[v++]<128)return this.pos=v,S;if(S=(S|(E[v]&15)<<28)>>>0,E[v++]<128)return this.pos=v,S;for(var I=0;I<5;++I){if(v>=this.len)throw this.pos=v,c(this);if(E[v++]<128)return this.pos=v,S}throw this.pos=v,Error("invalid varint encoding")},u.prototype.tag=function(){if(this.len-this.pos<5){if(this.pos>=this.len)throw c(this);if(this.buf[this.pos]>=128)return p(this)}var E=this.buf,v=this.pos,S=(E[v]&127)>>>0;if(E[v++]<128)return this.pos=v,S;if(S=(S|(E[v]&127)<<7)>>>0,E[v++]<128)return this.pos=v,S;if(S=(S|(E[v]&127)<<14)>>>0,E[v++]<128)return this.pos=v,S;if(S=(S|(E[v]&127)<<21)>>>0,E[v++]<128)return this.pos=v,S;if(S=(S|(E[v]&15)<<28)>>>0,E[v]<128&&(E[v]&112)===0)return this.pos=v+1,S;throw this.pos=v+1,Error("invalid tag encoding")},u.prototype.int32=function(){return this.uint32()|0},u.prototype.sint32=function(){var E=this.uint32();return E>>>1^-(E&1)|0};function g(){var T=new s(0,0),E=0;if(this.len-this.pos>4){for(;E<4;++E)if(T.lo=(T.lo|(this.buf[this.pos]&127)<<E*7)>>>0,this.buf[this.pos++]<128)return T;if(T.lo=(T.lo|(this.buf[this.pos]&127)<<28)>>>0,T.hi=(T.hi|(this.buf[this.pos]&127)>>4)>>>0,this.buf[this.pos++]<128)return T;E=0}else{for(;E<4;++E){if(this.pos>=this.len)throw c(this);if(T.lo=(T.lo|(this.buf[this.pos]&127)<<E*7)>>>0,this.buf[this.pos++]<128)return T}throw c(this)}if(this.len-this.pos>4){for(;E<5;++E)if(T.hi=(T.hi|(this.buf[this.pos]&127)<<E*7+3)>>>0,this.buf[this.pos++]<128)return T}else for(;E<5;++E){if(this.pos>=this.len)throw c(this);if(T.hi=(T.hi|(this.buf[this.pos]&127)<<E*7+3)>>>0,this.buf[this.pos++]<128)return T}throw Error("invalid varint encoding")}u.prototype.bool=function(){for(var E=!1,v,S=0;S<10;++S){if(this.pos>=this.len)throw c(this);if(v=this.buf[this.pos++],v&127&&(E=!0),v<128)return E}throw Error("invalid varint encoding")};function m(T,E){return(T[E-4]|T[E-3]<<8|T[E-2]<<16|T[E-1]<<24)>>>0}u.prototype.fixed32=function(){if(this.pos+4>this.len)throw c(this,4);return m(this.buf,this.pos+=4)},u.prototype.sfixed32=function(){if(this.pos+4>this.len)throw c(this,4);return m(this.buf,this.pos+=4)|0};function y(){if(this.pos+8>this.len)throw c(this,8);return new s(m(this.buf,this.pos+=4),m(this.buf,this.pos+=4))}u.prototype.float=function(){if(this.pos+4>this.len)throw c(this,4);var E=r.float.readFloatLE(this.buf,this.pos);return this.pos+=4,E},u.prototype.double=function(){if(this.pos+8>this.len)throw c(this,4);var E=r.float.readDoubleLE(this.buf,this.pos);return this.pos+=8,E},u.prototype.uint32s=function(E){E===e&&(E=[]);var v=this.uint32()+this.pos,S=this.len,I=this.buf,R=this.pos,O;if(v>S)throw c(this,v-this.pos);for(this.len=v;R<v;)O=I[R++],O<128?E.push(O):(this.pos=R-1,E.push(this.uint32()),R=this.pos);if(this.pos=R,R!==v)throw RangeError("index out of range");return this.len=S,E},u.prototype.int32s=function(E){E===e&&(E=[]);var v=this.uint32()+this.pos,S=this.len,I=this.buf,R=this.pos,O;if(v>S)throw c(this,v-this.pos);for(this.len=v;R<v;)O=I[R++],O<128?E.push(O):(this.pos=R-1,E.push(this.int32()),R=this.pos);if(this.pos=R,R!==v)throw RangeError("index out of range");return this.len=S,E},u.prototype.sint32s=function(E){E===e&&(E=[]);var v=this.uint32()+this.pos,S=this.len;if(v>S)throw c(this,v-this.pos);for(this.len=v;this.pos<v;)E.push(this.sint32());if(this.pos!==v)throw RangeError("index out of range");return this.len=S,E},u.prototype.bools=function(E){E===e&&(E=[]);var v=this.uint32()+this.pos,S=this.len,I=this.buf,R=this.pos,O;if(v>S)throw c(this,v-this.pos);for(this.len=v;R<v;)O=I[R++],O<128?E.push(O!==0):(this.pos=R-1,E.push(this.bool()),R=this.pos);if(this.pos=R,R!==v)throw RangeError("index out of range");return this.len=S,E};var A=8,b=128;function x(T,E,v){var S=T.view;if(S||E<v)return S;var I=T.buf;return T.view=new DataView(I.buffer,I.byteOffset,I.byteLength)}u.prototype.fixed32s=function(E){E===e&&(E=[]);var v=this.uint32(),S=this.pos+v;if(S>this.len)throw c(this,v);var I=v>>>2,R=E.length,O=this.pos;E.length=R+I;var L=x(this,I,b);if(L)for(var _=0;_<I;++_,O+=4)E[R++]=L.getUint32(O,!0);else for(var C=this.buf,w=0;w<I;++w,O+=4)E[R++]=m(C,O+4);if(this.pos=O,O!==S)throw c(this,4);return E},u.prototype.sfixed32s=function(E){E===e&&(E=[]);var v=this.uint32(),S=this.pos+v;if(S>this.len)throw c(this,v);var I=v>>>2,R=E.length,O=this.pos;E.length=R+I;var L=x(this,I,b);if(L)for(var _=0;_<I;++_,O+=4)E[R++]=L.getInt32(O,!0);else for(var C=this.buf,w=0;w<I;++w,O+=4)E[R++]=m(C,O+4)|0;if(this.pos=O,O!==S)throw c(this,4);return E},u.prototype.floats=function(E){E===e&&(E=[]);var v=this.uint32(),S=this.pos+v;if(S>this.len)throw c(this,v);var I=v>>>2,R=E.length,O=this.pos;E.length=R+I;var L=x(this,I,A);if(L)for(var _=0;_<I;++_,O+=4)E[R++]=L.getFloat32(O,!0);else for(var C=this.buf,w=0;w<I;++w,O+=4)E[R++]=r.float.readFloatLE(C,O);if(this.pos=O,O!==S)throw c(this,4);return E},u.prototype.doubles=function(E){E===e&&(E=[]);var v=this.uint32(),S=this.pos+v;if(S>this.len)throw c(this,v);var I=v>>>3,R=E.length,O=this.pos;E.length=R+I;var L=x(this,I,A);if(L)for(var _=0;_<I;++_,O+=8)E[R++]=L.getFloat64(O,!0);else for(var C=this.buf,w=0;w<I;++w,O+=8)E[R++]=r.float.readDoubleLE(C,O);if(this.pos=O,O!==S)throw c(this,8);return E},u.prototype.uint64s=function(E){E===e&&(E=[]);var v=this.uint32()+this.pos,S=this.len;if(v>S)throw c(this,v-this.pos);for(this.len=v;this.pos<v;)E.push(this.uint64());if(this.pos!==v)throw RangeError("index out of range");return this.len=S,E},u.prototype.int64s=function(E){E===e&&(E=[]);var v=this.uint32()+this.pos,S=this.len;if(v>S)throw c(this,v-this.pos);for(this.len=v;this.pos<v;)E.push(this.int64());if(this.pos!==v)throw RangeError("index out of range");return this.len=S,E},u.prototype.sint64s=function(E){E===e&&(E=[]);var v=this.uint32()+this.pos,S=this.len;if(v>S)throw c(this,v-this.pos);for(this.len=v;this.pos<v;)E.push(this.sint64());if(this.pos!==v)throw RangeError("index out of range");return this.len=S,E},u.prototype.fixed64s=function(E){E===e&&(E=[]);var v=this.uint32(),S=this.pos+v,I=E.length;if(S>this.len)throw c(this,v);var R=v>>>3;E.length=I+R;for(var O=0;O<R;++O)E[I++]=this.fixed64();if(this.pos!==S)throw c(this,8);return E},u.prototype.sfixed64s=function(E){E===e&&(E=[]);var v=this.uint32(),S=this.pos+v,I=E.length;if(S>this.len)throw c(this,v);var R=v>>>3;E.length=I+R;for(var O=0;O<R;++O)E[I++]=this.sfixed64();if(this.pos!==S)throw c(this,8);return E},u.prototype.bytes=function(){var E=this.uint32(),v=this.pos,S=this.pos+E;if(S>this.len)throw c(this,E);return this.pos=S,this.raw(v,S)},u.prototype.string=function(){var E=this.uint32(),v=this.pos,S=this.pos+E;if(S>this.len)throw c(this,E);return this.pos=S,a.read(this.buf,v,S)},u.prototype.stringVerify=function(){var E=this.uint32(),v=this.pos,S=this.pos+E;if(S>this.len)throw c(this,E);return this.pos=S,a.readStrict(this.buf,v,S)},u.prototype.skip=function(E){if(typeof E=="number"){if(this.pos+E>this.len)throw c(this,E);this.pos+=E}else do if(this.pos>=this.len)throw c(this);while(this.buf[this.pos++]&128);return this},u.recursionLimit=r.recursionLimit,u.discardUnknown=!0,u.prototype.skipType=function(T,E,v){if(E===e&&(E=0),E>u.recursionLimit)throw Error("max depth exceeded");if(v===0)throw Error("illegal tag: field number 0");switch(T){case 0:this.skip();break;case 1:this.skip(8);break;case 2:this.skip(this.uint32());break;case 3:for(;;){var S=this.tag(),I=S>>>3;if(T=S&7,!I)throw Error("illegal tag: field number 0");if(T===4){if(v!==e&&I!==v)throw Error("invalid end group tag");break}this.skipType(T,E+1,I)}break;case 5:this.skip(4);break;default:throw Error("invalid wire type "+T+" at offset "+this.pos)}return this},u._configure=function(T){o=T,u.create=d(),o._configure();var E=r.Long?"toLong":"toNumber";r.merge(u.prototype,{int64:function(){return g.call(this)[E](!1)},uint64:function(){return g.call(this)[E](!0)},sint64:function(){return g.call(this).zzDecode()[E](!1)},fixed64:function(){return y.call(this)[E](!0)},sfixed64:function(){return y.call(this)[E](!1)}})}},{12:12}],3:[function(t,n,i){"use strict";n.exports=s;var r=t(2);s.prototype=Object.create(r.prototype,{constructor:{value:s,writable:!0,enumerable:!1,configurable:!0}});var o=t(12);function s(a){r.call(this,a)}s._configure=function(){o.Buffer&&(s.prototype._slice=o.Buffer.prototype.slice)},s.prototype.raw=function(c,u){return this._slice.call(this.buf,c,u)},s.prototype.string=function(){var c=this.uint32(),u=this.pos,f=this.pos+c;if(f>this.len)throw RangeError("index out of range: "+this.pos+" + "+c+" > "+this.len);return this.pos=f,this.buf.utf8Slice?this.buf.utf8Slice(u,f):this.buf.toString("utf-8",u,f)},s._configure()},{12:12,2:2}],4:[function(t,n,i){"use strict";n.exports=Object.create(null)},{}],5:[function(t,n,i){"use strict";var r=i;r.Service=t(6)},{6:6}],6:[function(t,n,i){"use strict";n.exports=o;var r=t(12);o.prototype=Object.create(r.EventEmitter.prototype,{constructor:{value:o,writable:!0,enumerable:!1,configurable:!0}});function o(s,a,c){if(typeof s!="function")throw TypeError("rpcImpl must be a function");r.EventEmitter.call(this),this.rpcImpl=s,this.requestDelimited=!!a,this.responseDelimited=!!c}o.prototype.rpcCall=function s(a,c,u,f,d){if(!f)throw TypeError("request must be specified");var p=this;if(!d)return r.asPromise(s,p,a,c,u,f);if(!p.rpcImpl)return setTimeout(function(){d(Error("already ended"))},0),e;try{return p.rpcImpl(a,c[p.requestDelimited?"encodeDelimited":"encode"](f).finish(),function(m,y){if(m)return p.emit("error",m,a),d(m);if(y===null)return p.end(!0),e;if(!(y instanceof u))try{y=u[p.responseDelimited?"decodeDelimited":"decode"](y)}catch(A){return p.emit("error",A,a),d(A)}return p.emit("data",y,a),d(null,y)})}catch(g){return p.emit("error",g,a),setTimeout(function(){d(g)},0),e}},o.prototype.end=function(a){return this.rpcImpl&&(a||this.rpcImpl(null,null,null),this.rpcImpl=null,this.emit("end").off()),this}},{12:12}],7:[function(t,n,i){"use strict";n.exports=r;function r(o,s){for(var a=new Array(arguments.length-1),c=0,u=2,f=!0;u<arguments.length;)a[c++]=arguments[u++];return new Promise(function(p,g){a[c]=function(y){if(f)if(f=!1,y)g(y);else{for(var A=new Array(arguments.length-1),b=0;b<A.length;)A[b++]=arguments[b];p.apply(null,A)}};try{o.apply(s||null,a)}catch(m){f&&(f=!1,g(m))}})}},{}],8:[function(t,n,i){"use strict";var r=i;r.length=function(g){var m=g.length;if(!m)return 0;for(;m>0&&g.charAt(m-1)==="=";)--m;return Math.floor(m*3/4)};for(var o=new Array(64),s=new Array(123),a=0;a<64;)s[o[a]=a<26?a+65:a<52?a+71:a<62?a-4:a-59|43]=a++;s[45]=62,s[95]=63,r.encode=function(g,m,y){for(var A=null,b=[],x=0,T=0,E;m<y;){var v=g[m++];switch(T){case 0:b[x++]=o[v>>2],E=(v&3)<<4,T=1;break;case 1:b[x++]=o[E|v>>4],E=(v&15)<<2,T=2;break;case 2:b[x++]=o[E|v>>6],b[x++]=o[v&63],T=0;break}x>8191&&((A||(A=[])).push(String.fromCharCode.apply(String,b)),x=0)}return T&&(b[x++]=o[E],b[x++]=61,T===1&&(b[x++]=61)),A?(x&&A.push(String.fromCharCode.apply(String,b.slice(0,x))),A.join("")):String.fromCharCode.apply(String,b.slice(0,x))};var c="invalid encoding";r.decode=function(g,m,y){for(var A=y,b=0,x,T=0;T<g.length;){var E=g.charCodeAt(T++);if(E===61&&b>1)break;if((E=s[E])===e)throw Error(c);switch(b){case 0:x=E,b=1;break;case 1:m[y++]=x<<2|(E&48)>>4,x=E,b=2;break;case 2:m[y++]=(x&15)<<4|(E&60)>>2,x=E,b=3;break;case 3:m[y++]=(x&3)<<6|E,b=0;break}}if(b===1)throw Error(c);return y-A};var u=/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/,f=/[-_]/,d=/^(?:[A-Za-z0-9_-]{4})*(?:[A-Za-z0-9_-]{2}(?:==)?|[A-Za-z0-9_-]{3}=?)?$/;r.test=function(g){return u.test(g)||f.test(g)&&d.test(g)}},{}],9:[function(t,n,i){"use strict";n.exports=r;function r(){this._listeners=Object.create(null)}r.prototype.on=function(s,a,c){return(this._listeners[s]||(this._listeners[s]=[])).push({fn:a,ctx:c||this}),this},r.prototype.off=function(s,a){if(s===e)this._listeners=Object.create(null);else if(a===e)this._listeners[s]=[];else{var c=this._listeners[s];if(!c)return this;for(var u=0;u<c.length;)c[u].fn===a?c.splice(u,1):++u}return this},r.prototype.emit=function(s){var a=this._listeners[s];if(a){for(var c=[],u=1;u<arguments.length;)c.push(arguments[u++]);for(u=0;u<a.length;)a[u].fn.apply(a[u++].ctx,c)}return this}},{}],10:[function(t,n,i){"use strict";n.exports=r(r);function r(u){return typeof Float32Array<"u"?(function(){var f=new Float32Array([-0]),d=new Uint8Array(f.buffer),p=d[3]===128;function g(b,x,T){f[0]=b,x[T]=d[0],x[T+1]=d[1],x[T+2]=d[2],x[T+3]=d[3]}function m(b,x,T){f[0]=b,x[T]=d[3],x[T+1]=d[2],x[T+2]=d[1],x[T+3]=d[0]}u.writeFloatLE=p?g:m,u.writeFloatBE=p?m:g;function y(b,x){return d[0]=b[x],d[1]=b[x+1],d[2]=b[x+2],d[3]=b[x+3],f[0]}function A(b,x){return d[3]=b[x],d[2]=b[x+1],d[1]=b[x+2],d[0]=b[x+3],f[0]}u.readFloatLE=p?y:A,u.readFloatBE=p?A:y})():(function(){function f(p,g,m,y){var A=g<0?1:0;if(A&&(g=-g),g===0)p(1/g>0?0:2147483648,m,y);else if(isNaN(g))p(2143289344,m,y);else if(g>34028234663852886e22)p((A<<31|2139095040)>>>0,m,y);else if(g<11754943508222875e-54)p((A<<31|Math.round(g/1401298464324817e-60))>>>0,m,y);else{var b=Math.floor(Math.log(g)/Math.LN2),x=Math.round(g*Math.pow(2,-b)*8388608)&8388607;p((A<<31|b+127<<23|x)>>>0,m,y)}}u.writeFloatLE=f.bind(null,o),u.writeFloatBE=f.bind(null,s);function d(p,g,m){var y=p(g,m),A=(y>>31)*2+1,b=y>>>23&255,x=y&8388607;return b===255?x?NaN:A*(1/0):b===0?A*1401298464324817e-60*x:A*Math.pow(2,b-150)*(x+8388608)}u.readFloatLE=d.bind(null,a),u.readFloatBE=d.bind(null,c)})(),typeof Float64Array<"u"?(function(){var f=new Float64Array([-0]),d=new Uint8Array(f.buffer),p=d[7]===128;function g(b,x,T){f[0]=b,x[T]=d[0],x[T+1]=d[1],x[T+2]=d[2],x[T+3]=d[3],x[T+4]=d[4],x[T+5]=d[5],x[T+6]=d[6],x[T+7]=d[7]}function m(b,x,T){f[0]=b,x[T]=d[7],x[T+1]=d[6],x[T+2]=d[5],x[T+3]=d[4],x[T+4]=d[3],x[T+5]=d[2],x[T+6]=d[1],x[T+7]=d[0]}u.writeDoubleLE=p?g:m,u.writeDoubleBE=p?m:g;function y(b,x){return d[0]=b[x],d[1]=b[x+1],d[2]=b[x+2],d[3]=b[x+3],d[4]=b[x+4],d[5]=b[x+5],d[6]=b[x+6],d[7]=b[x+7],f[0]}function A(b,x){return d[7]=b[x],d[6]=b[x+1],d[5]=b[x+2],d[4]=b[x+3],d[3]=b[x+4],d[2]=b[x+5],d[1]=b[x+6],d[0]=b[x+7],f[0]}u.readDoubleLE=p?y:A,u.readDoubleBE=p?A:y})():(function(){function f(p,g,m,y,A,b){var x=y<0?1:0;if(x&&(y=-y),y===0)p(0,A,b+g),p(1/y>0?0:2147483648,A,b+m);else if(isNaN(y))p(0,A,b+g),p(2146959360,A,b+m);else if(y>17976931348623157e292)p(0,A,b+g),p((x<<31|2146435072)>>>0,A,b+m);else{var T;if(y<22250738585072014e-324)T=y/5e-324,p(T>>>0,A,b+g),p((x<<31|T/4294967296)>>>0,A,b+m);else{var E=Math.floor(Math.log(y)/Math.LN2);E===1024&&(E=1023),T=y*Math.pow(2,-E),p(T*4503599627370496>>>0,A,b+g),p((x<<31|E+1023<<20|T*1048576&1048575)>>>0,A,b+m)}}}u.writeDoubleLE=f.bind(null,o,0,4),u.writeDoubleBE=f.bind(null,s,4,0);function d(p,g,m,y,A){var b=p(y,A+g),x=p(y,A+m),T=(x>>31)*2+1,E=x>>>20&2047,v=4294967296*(x&1048575)+b;return E===2047?v?NaN:T*(1/0):E===0?T*5e-324*v:T*Math.pow(2,E-1075)*(v+4503599627370496)}u.readDoubleLE=d.bind(null,a,0,4),u.readDoubleBE=d.bind(null,c,4,0)})(),u}function o(u,f,d){f[d]=u&255,f[d+1]=u>>>8&255,f[d+2]=u>>>16&255,f[d+3]=u>>>24}function s(u,f,d){f[d]=u>>>24,f[d+1]=u>>>16&255,f[d+2]=u>>>8&255,f[d+3]=u&255}function a(u,f){return(u[f]|u[f+1]<<8|u[f+2]<<16|u[f+3]<<24)>>>0}function c(u,f){return(u[f]<<24|u[f+1]<<16|u[f+2]<<8|u[f+3])>>>0}},{}],11:[function(t,n,i){"use strict";n.exports=o;var r;function o(u,f){this.lo=u>>>0,this.hi=f>>>0}var s=o.zero=new o(0,0);s.toNumber=function(){return 0},s.zzEncode=s.zzDecode=function(){return this},s.length=function(){return 1};var a=o.zeroHash="\0\0\0\0\0\0\0\0";o.fromNumber=function(f){if(f===0)return s;var d=f<0;d&&(f=-f);var p=f>>>0,g=(f-p)/4294967296>>>0;return d&&(g=~g>>>0,p=~p>>>0,++p>4294967295&&(p=0,++g>4294967295&&(g=0))),new o(p,g)},o.from=function(f){if(typeof f=="number")return o.fromNumber(f);if(typeof f=="string"||f instanceof String)if(r)f=r.fromString(f);else return o.fromNumber(parseInt(f,10));return f.low||f.high?new o(f.low>>>0,f.high>>>0):s},o.prototype.toNumber=function(f){if(!f&&this.hi>>>31){var d=~this.lo+1>>>0,p=~this.hi>>>0;return d||(p=p+1>>>0),-(d+p*4294967296)}return this.lo+this.hi*4294967296},o.prototype.toLong=function(f){return r?new r(this.lo|0,this.hi|0,!!f):{low:this.lo|0,high:this.hi|0,unsigned:!!f}};var c=String.prototype.charCodeAt;o.fromHash=function(f){return f===a?s:new o((c.call(f,0)|c.call(f,1)<<8|c.call(f,2)<<16|c.call(f,3)<<24)>>>0,(c.call(f,4)|c.call(f,5)<<8|c.call(f,6)<<16|c.call(f,7)<<24)>>>0)},o.prototype.toHash=function(){return String.fromCharCode(this.lo&255,this.lo>>>8&255,this.lo>>>16&255,this.lo>>>24,this.hi&255,this.hi>>>8&255,this.hi>>>16&255,this.hi>>>24)},o.prototype.zzEncode=function(){var f=this.hi>>31;return this.hi=((this.hi<<1|this.lo>>>31)^f)>>>0,this.lo=(this.lo<<1^f)>>>0,this},o.prototype.zzDecode=function(){var f=-(this.lo&1);return this.lo=((this.lo>>>1|this.hi<<31)^f)>>>0,this.hi=(this.hi>>>1^f)>>>0,this},o.prototype.length=function(){var f=this.lo,d=(this.lo>>>28|this.hi<<4)>>>0,p=this.hi>>>24;return p===0?d===0?f<16384?f<128?1:2:f<2097152?3:4:d<16384?d<128?5:6:d<2097152?7:8:p<128?9:10},o._configure=function(u){r=u}},{}],12:[function(t,n,i){"use strict";var r=i;r.asPromise=t(7),r.base64=t(8),r.EventEmitter=t(9),r.float=t(10),r.utf8=t(14),r.pool=t(13),r.LongBits=t(11);function o(c){return c==="__proto__"||c==="prototype"||c==="constructor"}r.isUnsafeProperty=o,r.isNode=!!(typeof global<"u"&&global&&global.process&&global.process.versions&&global.process.versions.node),r.global=r.isNode&&global||typeof window<"u"&&window||typeof self<"u"&&self||typeof globalThis<"u"&&globalThis||this,r.emptyArray=Object.freeze?Object.freeze([]):[],r.emptyObject=Object.freeze?Object.freeze({}):{},r.isInteger=Number.isInteger||function(u){return typeof u=="number"&&isFinite(u)&&Math.floor(u)===u},r.isString=function(u){return typeof u=="string"||u instanceof String},r.isObject=function(u){return u&&typeof u=="object"},r.isset=r.isSet=function(u,f){var d=u[f];return d!=null&&Object.hasOwnProperty.call(u,f)?typeof d!="object"||(Array.isArray(d)?d.length:Object.keys(d).length)>0:!1},r.Buffer=(function(){try{var c=r.global.Buffer;return c.prototype.utf8Write||r.isNode?c:null}catch{return null}})(),r.newBuffer=function(u){var f=r.Buffer;return typeof u=="number"?f?f.allocUnsafe(u):new Uint8Array(u):f?f.from(u):new Uint8Array(u)},r.rawField=function(u,f,d){var p=[],g=u<<3|f;for(g>>>=0;g>127;)p.push(g&127|128),g>>>=7;p.push(g);for(var m=0;m<d.length;++m)p.push(d[m]);return r.newBuffer(p)},r.Array=Uint8Array,r.Long=r.global.dcodeIO&&r.global.dcodeIO.Long||r.global.Long||(function(){try{var c=t("long");return c&&c.isLong?c:null}catch{return null}})(),r.key2Re=/^(?:true|false|0|1)$/,r.key32Re=/^-?(?:0|[1-9][0-9]*)$/,r.key64Re=/^(?:[\x00-\xff]{8}|-?(?:0|[1-9][0-9]*))$/,r.longToHash=function(u){return u?r.LongBits.from(u).toHash():r.LongBits.zeroHash},r.longFromHash=function(u,f){var d=r.LongBits.fromHash(u);return r.Long?r.Long.fromBits(d.lo,d.hi,f):d.toNumber(!!f)},r.longFromKey=function(u,f){return r.key64Re.test(u)&&!r.key32Re.test(u)?r.longFromHash(u,f):u},r.boolFromKey=function(u){return u==="true"||u==="1"};function s(c){var u=typeof arguments[arguments.length-1]=="boolean",f=u?arguments.length-1:arguments.length;u=u&&arguments[arguments.length-1];for(var d=1;d<f;++d){var p=arguments[d];if(p)for(var g=Object.keys(p),m=0;m<g.length;++m)!o(g[m])&&(!u||!Object.prototype.hasOwnProperty.call(c,g[m])||c[g[m]]===e)&&(c[g[m]]=p[g[m]])}return c}r.merge=s,r.nestingLimit=32,r.recursionLimit=100,r.makeProp=function(u,f,d){Object.prototype.hasOwnProperty.call(u,f)||Object.defineProperty(u,f,{enumerable:d===e?!0:d,configurable:!0,writable:!0})},r.lcFirst=function(u){return u.charAt(0).toLowerCase()+u.substring(1)};function a(c){function u(f,d){if(!(this instanceof u))return new u(f,d);Object.defineProperty(this,"message",{get:function(){return f}}),Error.captureStackTrace?Error.captureStackTrace(this,u):Object.defineProperty(this,"stack",{value:new Error().stack||""}),d&&s(this,d)}return u.prototype=Object.create(Error.prototype,{constructor:{value:u,writable:!0,enumerable:!1,configurable:!0},name:{get:function(){return c},set:e,enumerable:!1,configurable:!0},toString:{value:function(){return this.name+": "+this.message},writable:!0,enumerable:!1,configurable:!0}}),u}r.newError=a,r.ProtocolError=a("ProtocolError"),r.oneOfGetter=function(u){for(var f={},d=0;d<u.length;++d)f[u[d]]=1;return function(){for(var p=Object.keys(this),g=p.length-1;g>-1;--g)if(f[p[g]]===1&&this[p[g]]!==e&&this[p[g]]!==null)return p[g]}},r.oneOfSetter=function(u){return function(f){for(var d=0;d<u.length;++d)u[d]!==f&&delete this[u[d]]}},r.toJSONOptions={longs:String,enums:String,bytes:String,json:!0}},{10:10,11:11,13:13,14:14,7:7,8:8,9:9,long:"long"}],13:[function(t,n,i){"use strict";n.exports=r;function r(o,s,a){var c=a||8192,u=c>>>1,f=null,d=c;return function(g){if(g<1||g>u)return o(g);d+g>c&&(f=o(c),d=0);var m=s.call(f,d,d+=g);return d&7&&(d=(d|7)+1),m}}},{}],14:[function(t,n,i){"use strict";var r=i,o=new TextDecoder("utf-8",{ignoreBOM:!0}),s,a=64;try{s=new TextDecoder("utf-8",{fatal:!0,ignoreBOM:!0})}catch{s=o}r.length=function(f){for(var d=0,p=0,g=0;g<f.length;++g)p=f.charCodeAt(g),p<128?d+=1:p<2048?d+=2:(p&64512)===55296&&(f.charCodeAt(g+1)&64512)===56320?(++g,d+=4):d+=3;return d};function c(u,f,d,p){var g=d===0&&p===f.length?f:f.subarray(d,p);return u.decode(g)}r.read=function(f,d,p){if(p-d<1)return"";if(p-d>=a)return c(o,f,d,p);for(var g="",m=d,y,A,b,x,T,E,v,S;m+7<p;m+=8){if(y=f[m],A=f[m+1],b=f[m+2],x=f[m+3],T=f[m+4],E=f[m+5],v=f[m+6],S=f[m+7],(y|A|b|x|T|E|v|S)&128)return g+c(o,f,m,p);g+=String.fromCharCode(y,A,b,x,T,E,v,S)}for(;m<p;++m){if(y=f[m],y&128)return g+c(o,f,m,p);g+=String.fromCharCode(y)}return g},r.readStrict=function(f,d,p){if(p-d<1)return"";if(p-d>=a)return c(s,f,d,p);for(var g="",m=d,y,A,b,x,T,E,v,S;m+7<p;m+=8){if(y=f[m],A=f[m+1],b=f[m+2],x=f[m+3],T=f[m+4],E=f[m+5],v=f[m+6],S=f[m+7],(y|A|b|x|T|E|v|S)&128)return g+c(s,f,m,p);g+=String.fromCharCode(y,A,b,x,T,E,v,S)}for(;m<p;++m){if(y=f[m],y&128)return g+c(s,f,m,p);g+=String.fromCharCode(y)}return g},r.write=function(f,d,p){for(var g=p,m,y,A=0;A<f.length;++A)m=f.charCodeAt(A),m<128?d[p++]=m:m<2048?(d[p++]=m>>6|192,d[p++]=m&63|128):(m&64512)===55296&&((y=f.charCodeAt(A+1))&64512)===56320?(m=65536+((m&1023)<<10)+(y&1023),++A,d[p++]=m>>18|240,d[p++]=m>>12&63|128,d[p++]=m>>6&63|128,d[p++]=m&63|128):(d[p++]=m>>12|224,d[p++]=m>>6&63|128,d[p++]=m&63|128);return p-g}},{}],15:[function(t,n,i){"use strict";n.exports=u;var r=t(12),o,s=r.LongBits,a=r.base64,c=r.utf8;function u(){this.pos=0,this.buf=this.constructor.alloc(u.initialBufferSize),this.view=null,this.states=null}u.initialBufferSize=128,Object.defineProperty(u.prototype,"len",{configurable:!0,enumerable:!0,get:function(){return this.pos}});var f=function(){return r.Buffer?function(){return(u.create=function(){return new o})()}:function(){return new u}};u.create=f(),u.alloc=function(E){return new Uint8Array(E)},u.alloc=r.pool(u.alloc,Uint8Array.prototype.subarray);function d(T){return T<128?1:T<16384?2:T<2097152?3:T<268435456?4:5}u.prototype._reserve=function(E){var v=this.pos+E;if(v>this.buf.length){var S=this.buf.length<<1;S<v&&(S=v);var I=this.constructor.alloc(S);I.set(this.buf.subarray(0,this.pos),0),this.buf=I,this.view=null}};function p(T,E,v){for(var S=0;S<T.length;)E[v++]=T.charCodeAt(S++)}function g(T,E,v){for(;T>127;)E[v++]=T&127|128,T>>>=7;return E[v]=T,v+1}u.prototype.uint32=function(E){E=E>>>0,this._reserve(5);var v=this.pos;return this.pos=g(E,this.buf,v),this},u.prototype.int32=function(E){return(E|=0)<0?(this._reserve(10),m(s.fromNumber(E),this.buf,this.pos),this.pos+=10,this):this.uint32(E)},u.prototype.sint32=function(E){return this.uint32((E<<1^E>>31)>>>0)};function m(T,E,v){for(var S=T.lo,I=T.hi;I;)E[v++]=S&127|128,S=(S>>>7|I<<25)>>>0,I>>>=7;for(;S>127;)E[v++]=S&127|128,S=S>>>7;return E[v]=S,v+1}u.prototype.uint64=function(E){var v=s.from(E);this._reserve(10);var S=this.pos;return this.pos=m(v,this.buf,S),this},u.prototype.int64=u.prototype.uint64,u.prototype.sint64=function(E){var v=s.from(E).zzEncode();this._reserve(10);var S=this.pos;return this.pos=m(v,this.buf,S),this},u.prototype.bool=function(E){return this._reserve(1),this.buf[this.pos++]=E?1:0,this};function y(T,E,v){E[v]=T&255,E[v+1]=T>>>8&255,E[v+2]=T>>>16&255,E[v+3]=T>>>24}u.prototype.fixed32=function(E){return this._reserve(4),y(E>>>0,this.buf,this.pos),this.pos+=4,this},u.prototype.sfixed32=u.prototype.fixed32,u.prototype.fixed64=function(E){var v=s.from(E);return this._reserve(8),y(v.lo,this.buf,this.pos),y(v.hi,this.buf,this.pos+4),this.pos+=8,this},u.prototype.sfixed64=u.prototype.fixed64,u.prototype.float=function(E){return this._reserve(4),r.float.writeFloatLE(E,this.buf,this.pos),this.pos+=4,this},u.prototype.double=function(E){return this._reserve(8),r.float.writeDoubleLE(E,this.buf,this.pos),this.pos+=8,this},u.prototype.bytes=function(E){var v=E.length>>>0;if(!v)return this._reserve(1),this.buf[this.pos++]=0,this;if(r.isString(E)){var S=u.alloc(v=a.length(E));a.decode(E,S,0),E=S}return this.uint32(v),this._reserve(v),this.buf.set(E,this.pos),this.pos+=v,this},u.prototype.raw=function(E){var v=E.length>>>0;return v?(this._reserve(v),this.buf.set(E,this.pos),this.pos+=v,this):this},u.prototype._delim=function(E,v){var S=d(v);return S>1&&this.buf.copyWithin(E+S,E+1,E+1+v),g(v,this.buf,E),this.pos=E+S+v,this},u.prototype.string=function(E){var v=E.length;if(!v)return this._reserve(1),this.buf[this.pos++]=0,this;if(v<128){this._reserve(v*3+5);var S=this.pos;return this._delim(S,c.write(E,this.buf,S+1))}var I=c.length(E);return this.uint32(I),this._reserve(I),I===E.length?p(E,this.buf,this.pos):c.write(E,this.buf,this.pos),this.pos+=I,this},u.prototype.uint32s=function(E){var v=E.length;this._reserve(v*5+5);for(var S=this.buf,I=this.pos,R=I+1,O=0;O<v;++O)R=g(E[O]>>>0,S,R);return this._delim(I,R-I-1)},u.prototype.int32s=function(E){var v=E.length;this._reserve(v*10+5);for(var S=this.buf,I=this.pos,R=I+1,O,L=0;L<v;++L)(O=E[L]|0)<0?R=m(s.fromNumber(O),S,R):R=g(O,S,R);return this._delim(I,R-I-1)},u.prototype.sint32s=function(E){var v=E.length;this._reserve(v*5+5);for(var S=this.buf,I=this.pos,R=I+1,O=0;O<v;++O)R=g((E[O]<<1^E[O]>>31)>>>0,S,R);return this._delim(I,R-I-1)},u.prototype.uint64s=function(E){var v=E.length;this._reserve(v*10+5);for(var S=this.buf,I=this.pos,R=I+1,O=0;O<v;++O)R=m(s.from(E[O]),S,R);return this._delim(I,R-I-1)},u.prototype.int64s=u.prototype.uint64s,u.prototype.sint64s=function(E){var v=E.length;this._reserve(v*10+5);for(var S=this.buf,I=this.pos,R=I+1,O=0;O<v;++O)R=m(s.from(E[O]).zzEncode(),S,R);return this._delim(I,R-I-1)},u.prototype.bools=function(E){var v=E.length;this.uint32(v),this._reserve(v);for(var S=this.buf,I=this.pos,R=0;R<v;++R)S[I++]=E[R]?1:0;return this.pos+=v,this};var A=16,b=128;function x(T,E,v){var S=T.view;if(S||E<v)return S;var I=T.buf;return T.view=new DataView(I.buffer,I.byteOffset,I.byteLength)}u.prototype.fixed32s=function(E){var v=E.length,S=v*4;this.uint32(S),this._reserve(S);var I=this.pos,R,O=x(this,v,b);if(O)for(R=0;R<v;++R)O.setUint32(I,E[R]>>>0,!0),I+=4;else{var L=this.buf;for(R=0;R<v;++R)y(E[R]>>>0,L,I),I+=4}return this.pos+=S,this},u.prototype.sfixed32s=u.prototype.fixed32s,u.prototype.fixed64s=function(E){var v=E.length,S=v*8;this.uint32(S),this._reserve(S);var I=this.pos,R,O,L=x(this,v,b);if(L)for(R=0;R<v;++R)O=s.from(E[R]),L.setUint32(I,O.lo,!0),L.setUint32(I+4,O.hi,!0),I+=8;else{var _=this.buf;for(R=0;R<v;++R)O=s.from(E[R]),y(O.lo,_,I),y(O.hi,_,I+4),I+=8}return this.pos+=S,this},u.prototype.sfixed64s=u.prototype.fixed64s,u.prototype.floats=function(E){var v=E.length,S=v*4;this.uint32(S),this._reserve(S);var I=this.pos,R,O=x(this,v,A);if(O)for(R=0;R<v;++R)O.setFloat32(I,E[R],!0),I+=4;else{var L=this.buf;for(R=0;R<v;++R)r.float.writeFloatLE(E[R],L,I),I+=4}return this.pos+=S,this},u.prototype.doubles=function(E){var v=E.length,S=v*8;this.uint32(S),this._reserve(S);var I=this.pos,R,O=x(this,v,A);if(O)for(R=0;R<v;++R)O.setFloat64(I,E[R],!0),I+=8;else{var L=this.buf;for(R=0;R<v;++R)r.float.writeDoubleLE(E[R],L,I),I+=8}return this.pos+=S,this},u.prototype.fork=function(){return this._reserve(1),(this.states||(this.states=[])).push(this.pos),this.pos+=1,this},u.prototype.reset=function(){var E=this.states;return E&&E.length?this.pos=E.pop():this.pos=0,this},u.prototype.ldelim=function(){var E=this.states,v,S;if(E&&E.length){var I=E.pop();v=this.pos-I-1,S=d(v),S>1?(this._reserve(S-1),this.buf.copyWithin(I+S,I+1,I+1+v),this.pos+=S-1,g(v,this.buf,I)):this.buf[I]=v}else v=this.pos,S=d(v),this._reserve(S),this.buf.copyWithin(S,0,v),g(v,this.buf,0),this.pos+=S;return this},u.prototype.finish=function(E){if(E)return this.buf.subarray(0,this.pos);var v=this.constructor.alloc(this.pos);return v.set(this.buf.subarray(0,this.pos),0),v},u.prototype.finishInto=function(E,v){return v===e&&(v=0),E.set(this.buf.subarray(0,this.pos),v),E},u._configure=function(T){o=T,u.create=f(),o._configure()}},{12:12}],16:[function(t,n,i){"use strict";n.exports=s;var r=t(15);s.prototype=Object.create(r.prototype,{constructor:{value:s,writable:!0,enumerable:!1,configurable:!0}});var o=t(12);function s(){r.call(this)}var a;s._configure=function(){s.alloc=o.Buffer&&o.Buffer.allocUnsafe,a=o.Buffer&&o.Buffer.prototype.utf8Write?function(u,f,d){return f.utf8Write(u,d)}:function(u,f,d){return f.write(u,d)}},s.prototype.bytes=function(u){o.isString(u)&&(u=o.Buffer.from(u,"base64"));var f=u.length>>>0;return this.uint32(f),f&&(this._reserve(f),this.buf.set(u,this.pos),this.pos+=f),this},s.prototype.string=function(u){var f=u.length;if(!f)return this._reserve(1),this.buf[this.pos++]=0,this;if(f<128){this._reserve(f*3+5);var d=this.pos,p=this.buf;return this._delim(d,f<40?o.utf8.write(u,p,d+1):a(u,p,d+1))}var g=o.Buffer.byteLength(u);return this.uint32(g),this._reserve(g),a(u,this.buf,this.pos),this.pos+=g,this},s._configure()},{12:12,15:15}]},{},[1])})()});var GBe=uh((tAr,F7)=>{/* Copyright 2015-2018 Esri. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 @preserve */(function(){var e=(function(){var r={};r.defaultNoDataValue=-34027999387901484e22,r.decode=function(f,d){d=d||{};var p=d.encodedMaskData||d.encodedMaskData===null,g=c(f,d.inputOffset||0,p),m=d.noDataValue!==null?d.noDataValue:r.defaultNoDataValue,y=o(g,d.pixelType||Float32Array,d.encodedMaskData,m,d.returnMask),A={width:g.width,height:g.height,pixelData:y.resultPixels,minValue:y.minValue,maxValue:g.pixels.maxValue,noDataValue:m};return y.resultMask&&(A.maskData=y.resultMask),d.returnEncodedMask&&g.mask&&(A.encodedMaskData=g.mask.bitset?g.mask.bitset:null),d.returnFileInfo&&(A.fileInfo=s(g),d.computeUsedBitDepths&&(A.fileInfo.bitDepths=a(g))),A};var o=function(f,d,p,g,m){var y=0,A=f.pixels.numBlocksX,b=f.pixels.numBlocksY,x=Math.floor(f.width/A),T=Math.floor(f.height/b),E=2*f.maxZError,v=Number.MAX_VALUE,S;p=p||(f.mask?f.mask.bitset:null);var I,R;I=new d(f.width*f.height),m&&p&&(R=new Uint8Array(f.width*f.height));for(var O=new Float32Array(x*T),L,_,C=0;C<=b;C++){var w=C!==b?T:f.height%b;if(w!==0)for(var D=0;D<=A;D++){var N=D!==A?x:f.width%A;if(N!==0){var F=C*f.width*T+D*x,V=f.width-N,B=f.pixels.blocks[y],j,k,G;B.encoding<2?(B.encoding===0?j=B.rawData:(u(B.stuffedData,B.bitsPerPixel,B.numValidPixels,B.offset,E,O,f.pixels.maxValue),j=O),k=0):B.encoding===2?G=0:G=B.offset;var q;if(p)for(_=0;_<w;_++){for(F&7&&(q=p[F>>3],q<<=F&7),L=0;L<N;L++)F&7||(q=p[F>>3]),q&128?(R&&(R[F]=1),S=B.encoding<2?j[k++]:G,v=v>S?S:v,I[F++]=S):(R&&(R[F]=0),I[F++]=g),q<<=1;F+=V}else if(B.encoding<2)for(_=0;_<w;_++){for(L=0;L<N;L++)S=j[k++],v=v>S?S:v,I[F++]=S;F+=V}else for(v=v>G?G:v,_=0;_<w;_++){for(L=0;L<N;L++)I[F++]=G;F+=V}if(B.encoding===1&&k!==B.numValidPixels)throw"Block and Mask do not match";y++}}}return{resultPixels:I,resultMask:R,minValue:v}},s=function(f){return{fileIdentifierString:f.fileIdentifierString,fileVersion:f.fileVersion,imageType:f.imageType,height:f.height,width:f.width,maxZError:f.maxZError,eofOffset:f.eofOffset,mask:f.mask?{numBlocksX:f.mask.numBlocksX,numBlocksY:f.mask.numBlocksY,numBytes:f.mask.numBytes,maxValue:f.mask.maxValue}:null,pixels:{numBlocksX:f.pixels.numBlocksX,numBlocksY:f.pixels.numBlocksY,numBytes:f.pixels.numBytes,maxValue:f.pixels.maxValue,noDataValue:f.noDataValue}}},a=function(f){for(var d=f.pixels.numBlocksX*f.pixels.numBlocksY,p={},g=0;g<d;g++){var m=f.pixels.blocks[g];m.encoding===0?p.float32=!0:m.encoding===1?p[m.bitsPerPixel]=!0:p[0]=!0}return Object.keys(p)},c=function(f,d,p){var g={},m=new Uint8Array(f,d,10);if(g.fileIdentifierString=String.fromCharCode.apply(null,m),g.fileIdentifierString.trim()!=="CntZImage")throw"Unexpected file identifier string: "+g.fileIdentifierString;d+=10;var y=new DataView(f,d,24);if(g.fileVersion=y.getInt32(0,!0),g.imageType=y.getInt32(4,!0),g.height=y.getUint32(8,!0),g.width=y.getUint32(12,!0),g.maxZError=y.getFloat64(16,!0),d+=24,!p)if(y=new DataView(f,d,16),g.mask={},g.mask.numBlocksY=y.getUint32(0,!0),g.mask.numBlocksX=y.getUint32(4,!0),g.mask.numBytes=y.getUint32(8,!0),g.mask.maxValue=y.getFloat32(12,!0),d+=16,g.mask.numBytes>0){var A=new Uint8Array(Math.ceil(g.width*g.height/8));y=new DataView(f,d,g.mask.numBytes);var b=y.getInt16(0,!0),x=2,T=0;do{if(b>0)for(;b--;)A[T++]=y.getUint8(x++);else{var E=y.getUint8(x++);for(b=-b;b--;)A[T++]=E}b=y.getInt16(x,!0),x+=2}while(x<g.mask.numBytes);if(b!==-32768||T<A.length)throw"Unexpected end of mask RLE encoding";g.mask.bitset=A,d+=g.mask.numBytes}else(g.mask.numBytes|g.mask.numBlocksY|g.mask.maxValue)===0&&(g.mask.bitset=new Uint8Array(Math.ceil(g.width*g.height/8)));y=new DataView(f,d,16),g.pixels={},g.pixels.numBlocksY=y.getUint32(0,!0),g.pixels.numBlocksX=y.getUint32(4,!0),g.pixels.numBytes=y.getUint32(8,!0),g.pixels.maxValue=y.getFloat32(12,!0),d+=16;var v=g.pixels.numBlocksX,S=g.pixels.numBlocksY,I=v+(g.width%v>0?1:0),R=S+(g.height%S>0?1:0);g.pixels.blocks=new Array(I*R);for(var O=0,L=0;L<R;L++)for(var _=0;_<I;_++){var C=0,w=f.byteLength-d;y=new DataView(f,d,Math.min(10,w));var D={};g.pixels.blocks[O++]=D;var N=y.getUint8(0);if(C++,D.encoding=N&63,D.encoding>3)throw"Invalid block encoding ("+D.encoding+")";if(D.encoding===2){d++;continue}if(N!==0&&N!==2){if(N>>=6,D.offsetType=N,N===2)D.offset=y.getInt8(1),C++;else if(N===1)D.offset=y.getInt16(1,!0),C+=2;else if(N===0)D.offset=y.getFloat32(1,!0),C+=4;else throw"Invalid block offset type";if(D.encoding===1)if(N=y.getUint8(C),C++,D.bitsPerPixel=N&63,N>>=6,D.numValidPixelsType=N,N===2)D.numValidPixels=y.getUint8(C),C++;else if(N===1)D.numValidPixels=y.getUint16(C,!0),C+=2;else if(N===0)D.numValidPixels=y.getUint32(C,!0),C+=4;else throw"Invalid valid pixel count type"}if(d+=C,D.encoding!==3){var F,V;if(D.encoding===0){var B=(g.pixels.numBytes-1)/4;if(B!==Math.floor(B))throw"uncompressed block has invalid length";F=new ArrayBuffer(B*4),V=new Uint8Array(F),V.set(new Uint8Array(f,d,B*4));var j=new Float32Array(F);D.rawData=j,d+=B*4}else if(D.encoding===1){var k=Math.ceil(D.numValidPixels*D.bitsPerPixel/8),G=Math.ceil(k/4);F=new ArrayBuffer(G*4),V=new Uint8Array(F),V.set(new Uint8Array(f,d,k)),D.stuffedData=new Uint32Array(F),d+=k}}}return g.eofOffset=d,g},u=function(f,d,p,g,m,y,A){var b=(1<<d)-1,x=0,T,E=0,v,S,I=Math.ceil((A-g)/m),R=f.length*4-Math.ceil(d*p/8);for(f[f.length-1]<<=8*R,T=0;T<p;T++){if(E===0&&(S=f[x++],E=32),E>=d)v=S>>>E-d&b,E-=d;else{var O=d-E;v=(S&b)<<O&b,S=f[x++],E=32-O,v+=S>>>E}y[T]=v<I?g+v*m:A}return y};return r})(),t=(function(){"use strict";var r={unstuff:function(c,u,f,d,p,g,m,y){var A=(1<<f)-1,b=0,x,T=0,E,v,S,I,R=c.length*4-Math.ceil(f*d/8);if(c[c.length-1]<<=8*R,p)for(x=0;x<d;x++)T===0&&(v=c[b++],T=32),T>=f?(E=v>>>T-f&A,T-=f):(S=f-T,E=(v&A)<<S&A,v=c[b++],T=32-S,E+=v>>>T),u[x]=p[E];else for(I=Math.ceil((y-g)/m),x=0;x<d;x++)T===0&&(v=c[b++],T=32),T>=f?(E=v>>>T-f&A,T-=f):(S=f-T,E=(v&A)<<S&A,v=c[b++],T=32-S,E+=v>>>T),u[x]=E<I?g+E*m:y},unstuffLUT:function(c,u,f,d,p,g){var m=(1<<u)-1,y=0,A=0,b=0,x=0,T=0,E,v=[],S=c.length*4-Math.ceil(u*f/8);c[c.length-1]<<=8*S;var I=Math.ceil((g-d)/p);for(A=0;A<f;A++)x===0&&(E=c[y++],x=32),x>=u?(T=E>>>x-u&m,x-=u):(b=u-x,T=(E&m)<<b&m,E=c[y++],x=32-b,T+=E>>>x),v[A]=T<I?d+T*p:g;return v.unshift(d),v},unstuff2:function(c,u,f,d,p,g,m,y){var A=(1<<f)-1,b=0,x,T=0,E=0,v,S,I;if(p)for(x=0;x<d;x++)T===0&&(S=c[b++],T=32,E=0),T>=f?(v=S>>>E&A,T-=f,E+=f):(I=f-T,v=S>>>E&A,S=c[b++],T=32-I,v|=(S&(1<<I)-1)<<f-I,E=I),u[x]=p[v];else{var R=Math.ceil((y-g)/m);for(x=0;x<d;x++)T===0&&(S=c[b++],T=32,E=0),T>=f?(v=S>>>E&A,T-=f,E+=f):(I=f-T,v=S>>>E&A,S=c[b++],T=32-I,v|=(S&(1<<I)-1)<<f-I,E=I),u[x]=v<R?g+v*m:y}return u},unstuffLUT2:function(c,u,f,d,p,g){var m=(1<<u)-1,y=0,A=0,b=0,x=0,T=0,E=0,v,S=[],I=Math.ceil((g-d)/p);for(A=0;A<f;A++)x===0&&(v=c[y++],x=32,E=0),x>=u?(T=v>>>E&m,x-=u,E+=u):(b=u-x,T=v>>>E&m,v=c[y++],x=32-b,T|=(v&(1<<b)-1)<<u-b,E=b),S[A]=T<I?d+T*p:g;return S.unshift(d),S},originalUnstuff:function(c,u,f,d){var p=(1<<f)-1,g=0,m,y=0,A,b,x,T=c.length*4-Math.ceil(f*d/8);for(c[c.length-1]<<=8*T,m=0;m<d;m++)y===0&&(b=c[g++],y=32),y>=f?(A=b>>>y-f&p,y-=f):(x=f-y,A=(b&p)<<x&p,b=c[g++],y=32-x,A+=b>>>y),u[m]=A;return u},originalUnstuff2:function(c,u,f,d){var p=(1<<f)-1,g=0,m,y=0,A=0,b,x,T;for(m=0;m<d;m++)y===0&&(x=c[g++],y=32,A=0),y>=f?(b=x>>>A&p,y-=f,A+=f):(T=f-y,b=x>>>A&p,x=c[g++],y=32-T,b|=(x&(1<<T)-1)<<f-T,A=T),u[m]=b;return u}},o={HUFFMAN_LUT_BITS_MAX:12,computeChecksumFletcher32:function(c){for(var u=65535,f=65535,d=c.length,p=Math.floor(d/2),g=0;p;){var m=p>=359?359:p;p-=m;do u+=c[g++]<<8,f+=u+=c[g++];while(--m);u=(u&65535)+(u>>>16),f=(f&65535)+(f>>>16)}return d&1&&(f+=u+=c[g]<<8),u=(u&65535)+(u>>>16),f=(f&65535)+(f>>>16),(f<<16|u)>>>0},readHeaderInfo:function(c,u){var f=u.ptr,d=new Uint8Array(c,f,6),p={};if(p.fileIdentifierString=String.fromCharCode.apply(null,d),p.fileIdentifierString.lastIndexOf("Lerc2",0)!==0)throw"Unexpected file identifier string (expect Lerc2 ): "+p.fileIdentifierString;f+=6;var g=new DataView(c,f,8),m=g.getInt32(0,!0);p.fileVersion=m,f+=4,m>=3&&(p.checksum=g.getUint32(4,!0),f+=4),g=new DataView(c,f,12),p.height=g.getUint32(0,!0),p.width=g.getUint32(4,!0),f+=8,m>=4?(p.numDims=g.getUint32(8,!0),f+=4):p.numDims=1,g=new DataView(c,f,40),p.numValidPixel=g.getUint32(0,!0),p.microBlockSize=g.getInt32(4,!0),p.blobSize=g.getInt32(8,!0),p.imageType=g.getInt32(12,!0),p.maxZError=g.getFloat64(16,!0),p.zMin=g.getFloat64(24,!0),p.zMax=g.getFloat64(32,!0),f+=40,u.headerInfo=p,u.ptr=f;var y,A;if(m>=3&&(A=m>=4?52:48,y=this.computeChecksumFletcher32(new Uint8Array(c,f-A,p.blobSize-14)),y!==p.checksum))throw"Checksum failed.";return!0},checkMinMaxRanges:function(c,u){var f=u.headerInfo,d=this.getDataTypeArray(f.imageType),p=f.numDims*this.getDataTypeSize(f.imageType),g=this.readSubArray(c,u.ptr,d,p),m=this.readSubArray(c,u.ptr+p,d,p);u.ptr+=2*p;var y,A=!0;for(y=0;y<f.numDims;y++)if(g[y]!==m[y]){A=!1;break}return f.minValues=g,f.maxValues=m,A},readSubArray:function(c,u,f,d){var p;if(f===Uint8Array)p=new Uint8Array(c,u,d);else{var g=new ArrayBuffer(d),m=new Uint8Array(g);m.set(new Uint8Array(c,u,d)),p=new f(g)}return p},readMask:function(c,u){var f=u.ptr,d=u.headerInfo,p=d.width*d.height,g=d.numValidPixel,m=new DataView(c,f,4),y={};if(y.numBytes=m.getUint32(0,!0),f+=4,(g===0||p===g)&&y.numBytes!==0)throw"invalid mask";var A,b;if(g===0)A=new Uint8Array(Math.ceil(p/8)),y.bitset=A,b=new Uint8Array(p),u.pixels.resultMask=b,f+=y.numBytes;else if(y.numBytes>0){A=new Uint8Array(Math.ceil(p/8)),m=new DataView(c,f,y.numBytes);var x=m.getInt16(0,!0),T=2,E=0,v=0;do{if(x>0)for(;x--;)A[E++]=m.getUint8(T++);else for(v=m.getUint8(T++),x=-x;x--;)A[E++]=v;x=m.getInt16(T,!0),T+=2}while(T<y.numBytes);if(x!==-32768||E<A.length)throw"Unexpected end of mask RLE encoding";b=new Uint8Array(p);var S=0,I=0;for(I=0;I<p;I++)I&7?(S=A[I>>3],S<<=I&7):S=A[I>>3],S&128&&(b[I]=1);u.pixels.resultMask=b,y.bitset=A,f+=y.numBytes}return u.ptr=f,u.mask=y,!0},readDataOneSweep:function(c,u,f){var d=u.ptr,p=u.headerInfo,g=p.numDims,m=p.width*p.height,y=p.imageType,A=p.numValidPixel*o.getDataTypeSize(y)*g,b,x=u.pixels.resultMask;if(f===Uint8Array)b=new Uint8Array(c,d,A);else{var T=new ArrayBuffer(A),E=new Uint8Array(T);E.set(new Uint8Array(c,d,A)),b=new f(T)}if(b.length===m*g)u.pixels.resultPixels=b;else{u.pixels.resultPixels=new f(m*g);var v=0,S=0,I=0,R=0;if(g>1)for(I=0;I<g;I++)for(R=I*m,S=0;S<m;S++)x[S]&&(u.pixels.resultPixels[R+S]=b[v++]);else for(S=0;S<m;S++)x[S]&&(u.pixels.resultPixels[S]=b[v++])}return d+=A,u.ptr=d,!0},readHuffmanTree:function(c,u){var f=this.HUFFMAN_LUT_BITS_MAX,d=new DataView(c,u.ptr,16);u.ptr+=16;var p=d.getInt32(0,!0);if(p<2)throw"unsupported Huffman version";var g=d.getInt32(4,!0),m=d.getInt32(8,!0),y=d.getInt32(12,!0);if(m>=y)return!1;var A=new Uint32Array(y-m);o.decodeBits(c,u,A);var b=[],x,T,E,v;for(x=m;x<y;x++)T=x-(x<g?0:g),b[T]={first:A[x-m],second:null};var S=c.byteLength-u.ptr,I=Math.ceil(S/4),R=new ArrayBuffer(I*4),O=new Uint8Array(R);O.set(new Uint8Array(c,u.ptr,S));var L=new Uint32Array(R),_=0,C,w=0;for(C=L[0],x=m;x<y;x++)T=x-(x<g?0:g),v=b[T].first,v>0&&(b[T].second=C<<_>>>32-v,32-_>=v?(_+=v,_===32&&(_=0,w++,C=L[w])):(_+=v-32,w++,C=L[w],b[T].second|=C>>>32-_));var D=0,N=0,F=new s;for(x=0;x<b.length;x++)b[x]!==void 0&&(D=Math.max(D,b[x].first));D>=f?N=f:N=D,D>=30&&console.log("WARning, large NUM LUT BITS IS "+D);var V=[],B,j,k,G,q,Q;for(x=m;x<y;x++)if(T=x-(x<g?0:g),v=b[T].first,v>0)if(B=[v,T],v<=N)for(j=b[T].second<<N-v,k=1<<N-v,E=0;E<k;E++)V[j|E]=B;else for(j=b[T].second,Q=F,G=v-1;G>=0;G--)q=j>>>G&1,q?(Q.right||(Q.right=new s),Q=Q.right):(Q.left||(Q.left=new s),Q=Q.left),G===0&&!Q.val&&(Q.val=B[1]);return{decodeLut:V,numBitsLUTQick:N,numBitsLUT:D,tree:F,stuffedData:L,srcPtr:w,bitPos:_}},readHuffman:function(c,u,f){var d=u.headerInfo,p=d.numDims,g=u.headerInfo.height,m=u.headerInfo.width,y=m*g,A=this.readHuffmanTree(c,u),b=A.decodeLut,x=A.tree,T=A.stuffedData,E=A.srcPtr,v=A.bitPos,S=A.numBitsLUTQick,I=A.numBitsLUT,R=u.headerInfo.imageType===0?128:0,O,L,_,C=u.pixels.resultMask,w,D,N,F,V,B,j,k=0;v>0&&(E++,v=0);var G=T[E],q=u.encodeMode===1,Q=new f(y*p),W=Q,J;for(J=0;J<d.numDims;J++){if(p>1&&(W=new f(Q.buffer,y*J,y),k=0),u.headerInfo.numValidPixel===m*g)for(B=0,F=0;F<g;F++)for(V=0;V<m;V++,B++){if(L=0,w=G<<v>>>32-S,D=w,32-v<S&&(w|=T[E+1]>>>64-v-S,D=w),b[D])L=b[D][1],v+=b[D][0];else for(w=G<<v>>>32-I,D=w,32-v<I&&(w|=T[E+1]>>>64-v-I,D=w),O=x,j=0;j<I;j++)if(N=w>>>I-j-1&1,O=N?O.right:O.left,!(O.left||O.right)){L=O.val,v=v+j+1;break}v>=32&&(v-=32,E++,G=T[E]),_=L-R,q?(V>0?_+=k:F>0?_+=W[B-m]:_+=k,_&=255,W[B]=_,k=_):W[B]=_}else for(B=0,F=0;F<g;F++)for(V=0;V<m;V++,B++)if(C[B]){if(L=0,w=G<<v>>>32-S,D=w,32-v<S&&(w|=T[E+1]>>>64-v-S,D=w),b[D])L=b[D][1],v+=b[D][0];else for(w=G<<v>>>32-I,D=w,32-v<I&&(w|=T[E+1]>>>64-v-I,D=w),O=x,j=0;j<I;j++)if(N=w>>>I-j-1&1,O=N?O.right:O.left,!(O.left||O.right)){L=O.val,v=v+j+1;break}v>=32&&(v-=32,E++,G=T[E]),_=L-R,q?(V>0&&C[B-1]?_+=k:F>0&&C[B-m]?_+=W[B-m]:_+=k,_&=255,W[B]=_,k=_):W[B]=_}u.ptr=u.ptr+(E+1)*4+(v>0?4:0)}u.pixels.resultPixels=Q},decodeBits:function(c,u,f,d,p){{var g=u.headerInfo,m=g.fileVersion,y=0,A=new DataView(c,u.ptr,5),b=A.getUint8(0);y++;var x=b>>6,T=x===0?4:3-x,E=(b&32)>0,v=b&31,S=0;if(T===1)S=A.getUint8(y),y++;else if(T===2)S=A.getUint16(y,!0),y+=2;else if(T===4)S=A.getUint32(y,!0),y+=4;else throw"Invalid valid pixel count type";var I=2*g.maxZError,R,O,L,_,C,w,D,N,F,V,B=g.numDims>1?g.maxValues[p]:g.zMax;if(E){for(u.counter.lut++,N=A.getUint8(y),F=v,y++,_=Math.ceil((N-1)*v/8),C=Math.ceil(_/4),O=new ArrayBuffer(C*4),L=new Uint8Array(O),u.ptr+=y,L.set(new Uint8Array(c,u.ptr,_)),D=new Uint32Array(O),u.ptr+=_,V=0;N-1>>>V;)V++;_=Math.ceil(S*V/8),C=Math.ceil(_/4),O=new ArrayBuffer(C*4),L=new Uint8Array(O),L.set(new Uint8Array(c,u.ptr,_)),R=new Uint32Array(O),u.ptr+=_,m>=3?w=r.unstuffLUT2(D,v,N-1,d,I,B):w=r.unstuffLUT(D,v,N-1,d,I,B),m>=3?r.unstuff2(R,f,V,S,w):r.unstuff(R,f,V,S,w)}else u.counter.bitstuffer++,V=v,u.ptr+=y,V>0&&(_=Math.ceil(S*V/8),C=Math.ceil(_/4),O=new ArrayBuffer(C*4),L=new Uint8Array(O),L.set(new Uint8Array(c,u.ptr,_)),R=new Uint32Array(O),u.ptr+=_,m>=3?d==null?r.originalUnstuff2(R,f,V,S):r.unstuff2(R,f,V,S,!1,d,I,B):d==null?r.originalUnstuff(R,f,V,S):r.unstuff(R,f,V,S,!1,d,I,B))}},readTiles:function(c,u,f){var d=u.headerInfo,p=d.width,g=d.height,m=d.microBlockSize,y=d.imageType,A=o.getDataTypeSize(y),b=Math.ceil(p/m),x=Math.ceil(g/m);u.pixels.numBlocksY=x,u.pixels.numBlocksX=b,u.pixels.ptr=0;var T=0,E=0,v=0,S=0,I=0,R=0,O=0,L=0,_=0,C=0,w=0,D=0,N=0,F=0,V=0,B=0,j,k,G,q,Q,W,J=new f(m*m),Z=g%m||m,ae=p%m||m,Ae,fe,xe=d.numDims,ge,we=u.pixels.resultMask,ve=u.pixels.resultPixels;for(v=0;v<x;v++)for(I=v!==x-1?m:Z,S=0;S<b;S++)for(R=S!==b-1?m:ae,w=v*p*m+S*m,D=p-R,ge=0;ge<xe;ge++){if(xe>1&&(ve=new f(u.pixels.resultPixels.buffer,p*g*ge*A,p*g)),O=c.byteLength-u.ptr,j=new DataView(c,u.ptr,Math.min(10,O)),k={},B=0,L=j.getUint8(0),B++,_=L>>6&255,C=L>>2&15,C!==(S*m>>3&15))throw"integrity issue";if(W=L&3,W>3)throw u.ptr+=B,"Invalid block encoding ("+W+")";if(W===2){u.counter.constant++,u.ptr+=B;continue}else if(W===0){if(u.counter.uncompressed++,u.ptr+=B,N=I*R*A,F=c.byteLength-u.ptr,N=N<F?N:F,G=new ArrayBuffer(N%A===0?N:N+A-N%A),q=new Uint8Array(G),q.set(new Uint8Array(c,u.ptr,N)),Q=new f(G),V=0,we)for(T=0;T<I;T++){for(E=0;E<R;E++)we[w]&&(ve[w]=Q[V++]),w++;w+=D}else for(T=0;T<I;T++){for(E=0;E<R;E++)ve[w++]=Q[V++];w+=D}u.ptr+=V*A}else if(Ae=o.getDataTypeUsed(y,_),fe=o.getOnePixel(k,B,Ae,j),B+=o.getDataTypeSize(Ae),W===3)if(u.ptr+=B,u.counter.constantoffset++,we)for(T=0;T<I;T++){for(E=0;E<R;E++)we[w]&&(ve[w]=fe),w++;w+=D}else for(T=0;T<I;T++){for(E=0;E<R;E++)ve[w++]=fe;w+=D}else if(u.ptr+=B,o.decodeBits(c,u,J,fe,ge),B=0,we)for(T=0;T<I;T++){for(E=0;E<R;E++)we[w]&&(ve[w]=J[B++]),w++;w+=D}else for(T=0;T<I;T++){for(E=0;E<R;E++)ve[w++]=J[B++];w+=D}}},formatFileInfo:function(c){return{fileIdentifierString:c.headerInfo.fileIdentifierString,fileVersion:c.headerInfo.fileVersion,imageType:c.headerInfo.imageType,height:c.headerInfo.height,width:c.headerInfo.width,numValidPixel:c.headerInfo.numValidPixel,microBlockSize:c.headerInfo.microBlockSize,blobSize:c.headerInfo.blobSize,maxZError:c.headerInfo.maxZError,pixelType:o.getPixelType(c.headerInfo.imageType),eofOffset:c.eofOffset,mask:c.mask?{numBytes:c.mask.numBytes}:null,pixels:{numBlocksX:c.pixels.numBlocksX,numBlocksY:c.pixels.numBlocksY,maxValue:c.headerInfo.zMax,minValue:c.headerInfo.zMin,noDataValue:c.noDataValue}}},constructConstantSurface:function(c){var u=c.headerInfo.zMax,f=c.headerInfo.numDims,d=c.headerInfo.height*c.headerInfo.width,p=d*f,g=0,m=0,y=0,A=c.pixels.resultMask;if(A)if(f>1)for(g=0;g<f;g++)for(y=g*d,m=0;m<d;m++)A[m]&&(c.pixels.resultPixels[y+m]=u);else for(m=0;m<d;m++)A[m]&&(c.pixels.resultPixels[m]=u);else if(c.pixels.resultPixels.fill)c.pixels.resultPixels.fill(u);else for(m=0;m<p;m++)c.pixels.resultPixels[m]=u},getDataTypeArray:function(c){var u;switch(c){case 0:u=Int8Array;break;case 1:u=Uint8Array;break;case 2:u=Int16Array;break;case 3:u=Uint16Array;break;case 4:u=Int32Array;break;case 5:u=Uint32Array;break;case 6:u=Float32Array;break;case 7:u=Float64Array;break;default:u=Float32Array}return u},getPixelType:function(c){var u;switch(c){case 0:u="S8";break;case 1:u="U8";break;case 2:u="S16";break;case 3:u="U16";break;case 4:u="S32";break;case 5:u="U32";break;case 6:u="F32";break;case 7:u="F64";break;default:u="F32"}return u},isValidPixelValue:function(c,u){if(u==null)return!1;var f;switch(c){case 0:f=u>=-128&&u<=127;break;case 1:f=u>=0&&u<=255;break;case 2:f=u>=-32768&&u<=32767;break;case 3:f=u>=0&&u<=65536;break;case 4:f=u>=-2147483648&&u<=2147483647;break;case 5:f=u>=0&&u<=4294967296;break;case 6:f=u>=-34027999387901484e22&&u<=34027999387901484e22;break;case 7:f=u>=5e-324&&u<=17976931348623157e292;break;default:f=!1}return f},getDataTypeSize:function(c){var u=0;switch(c){case 0:case 1:u=1;break;case 2:case 3:u=2;break;case 4:case 5:case 6:u=4;break;case 7:u=8;break;default:u=c}return u},getDataTypeUsed:function(c,u){var f=c;switch(c){case 2:case 4:f=c-u;break;case 3:case 5:f=c-2*u;break;case 6:u===0?f=c:u===1?f=2:f=1;break;case 7:u===0?f=c:f=c-2*u+1;break;default:f=c;break}return f},getOnePixel:function(c,u,f,d){var p=0;switch(f){case 0:p=d.getInt8(u);break;case 1:p=d.getUint8(u);break;case 2:p=d.getInt16(u,!0);break;case 3:p=d.getUint16(u,!0);break;case 4:p=d.getInt32(u,!0);break;case 5:p=d.getUInt32(u,!0);break;case 6:p=d.getFloat32(u,!0);break;case 7:p=d.getFloat64(u,!0);break;default:throw"the decoder does not understand this pixel type"}return p}},s=function(c,u,f){this.val=c,this.left=u,this.right=f},a={decode:function(c,u){u=u||{};var f=u.noDataValue,d=0,p={};if(p.ptr=u.inputOffset||0,p.pixels={},!!o.readHeaderInfo(c,p)){var g=p.headerInfo,m=g.fileVersion,y=o.getDataTypeArray(g.imageType);o.readMask(c,p),g.numValidPixel!==g.width*g.height&&!p.pixels.resultMask&&(p.pixels.resultMask=u.maskData);var A=g.width*g.height;if(p.pixels.resultPixels=new y(A*g.numDims),p.counter={onesweep:0,uncompressed:0,lut:0,bitstuffer:0,constant:0,constantoffset:0},g.numValidPixel!==0)if(g.zMax===g.zMin)o.constructConstantSurface(p);else if(m>=4&&o.checkMinMaxRanges(c,p))o.constructConstantSurface(p);else{var b=new DataView(c,p.ptr,2),x=b.getUint8(0);if(p.ptr++,x)o.readDataOneSweep(c,p,y);else if(m>1&&g.imageType<=1&&Math.abs(g.maxZError-.5)<1e-5){var T=b.getUint8(1);if(p.ptr++,p.encodeMode=T,T>2||m<4&&T>1)throw"Invalid Huffman flag "+T;T?o.readHuffman(c,p,y):o.readTiles(c,p,y)}else o.readTiles(c,p,y)}p.eofOffset=p.ptr;var E;u.inputOffset?(E=p.headerInfo.blobSize+u.inputOffset-p.ptr,Math.abs(E)>=1&&(p.eofOffset=u.inputOffset+p.headerInfo.blobSize)):(E=p.headerInfo.blobSize-p.ptr,Math.abs(E)>=1&&(p.eofOffset=p.headerInfo.blobSize));var v={width:g.width,height:g.height,pixelData:p.pixels.resultPixels,minValue:g.zMin,maxValue:g.zMax,validPixelCount:g.numValidPixel,dimCount:g.numDims,dimStats:{minValues:g.minValues,maxValues:g.maxValues},maskData:p.pixels.resultMask};if(p.pixels.resultMask&&o.isValidPixelValue(g.imageType,f)){var S=p.pixels.resultMask;for(d=0;d<A;d++)S[d]||(v.pixelData[d]=f);v.noDataValue=f}return p.noDataValue=f,u.returnFileInfo&&(v.fileInfo=o.formatFileInfo(p)),v}},getBandCount:function(c){var u=0,f=0,d={};for(d.ptr=0,d.pixels={};f<c.byteLength-58;)o.readHeaderInfo(c,d),f+=d.headerInfo.blobSize,u++,d.ptr=f;return u}};return a})(),n=(function(){var r=new ArrayBuffer(4),o=new Uint8Array(r),s=new Uint32Array(r);return s[0]=1,o[0]===1})(),i={decode:function(r,o){if(!n)throw"Big endian system is not supported.";o=o||{};var s=o.inputOffset||0,a=new Uint8Array(r,s,10),c=String.fromCharCode.apply(null,a),u,f;if(c.trim()==="CntZImage")u=e,f=1;else if(c.substring(0,5)==="Lerc2")u=t,f=2;else throw"Unexpected file identifier string: "+c;for(var d=0,p=r.byteLength-10,g,m=[],y,A,b={width:0,height:0,pixels:[],pixelType:o.pixelType,mask:null,statistics:[]};s<p;){var x=u.decode(r,{inputOffset:s,encodedMaskData:g,maskData:A,returnMask:d===0,returnEncodedMask:d===0,returnFileInfo:!0,pixelType:o.pixelType||null,noDataValue:o.noDataValue||null});s=x.fileInfo.eofOffset,d===0&&(g=x.encodedMaskData,A=x.maskData,b.width=x.width,b.height=x.height,b.dimCount=x.dimCount||1,b.pixelType=x.pixelType||x.fileInfo.pixelType,b.mask=x.maskData),f>1&&x.fileInfo.mask&&x.fileInfo.mask.numBytes>0&&m.push(x.maskData),d++,b.pixels.push(x.pixelData),b.statistics.push({minValue:x.minValue,maxValue:x.maxValue,noDataValue:x.noDataValue,dimStats:x.dimStats})}var T,E,v;if(f>1&&m.length>1){for(v=b.width*b.height,b.bandMasks=m,A=new Uint8Array(v),A.set(m[0]),T=1;T<m.length;T++)for(y=m[T],E=0;E<v;E++)A[E]=A[E]&y[E];b.maskData=A}return b}};typeof define=="function"&&define.amd?define([],function(){return i}):typeof F7<"u"&&F7.exports?F7.exports=i:this.Lerc=i})()});var gke=uh((wGr,pke)=>{pke.exports={webm:"data:video/webm;base64,GkXfowEAAAAAAAAfQoaBAUL3gQFC8oEEQvOBCEKChHdlYm1Ch4EEQoWBAhhTgGcBAAAAAAAVkhFNm3RALE27i1OrhBVJqWZTrIHfTbuMU6uEFlSua1OsggEwTbuMU6uEHFO7a1OsghV17AEAAAAAAACkAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAVSalmAQAAAAAAAEUq17GDD0JATYCNTGF2ZjU1LjMzLjEwMFdBjUxhdmY1NS4zMy4xMDBzpJBlrrXf3DCDVB8KcgbMpcr+RImIQJBgAAAAAAAWVK5rAQAAAAAAD++uAQAAAAAAADLXgQFzxYEBnIEAIrWcg3VuZIaFVl9WUDiDgQEj44OEAmJaAOABAAAAAAAABrCBsLqB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""+(/CPU.*OS ([0-9_]{3,4})[0-9_]{0,1}|(CPU like).*AppleWebKit.*Mobile/i.exec(navigator.userAgent)||[0,""])[1]).replace("undefined","3_2").replace("_",".").replace("_",""))<10&&!window.MSStream,Uae=()=>"wakeLock"in navigator,zae=class{constructor(){if(this.enabled=!1,Uae()){this._wakeLock=null;let t=()=>{this._wakeLock!==null&&document.visibilityState==="visible"&&this.enable()};document.addEventListener("visibilitychange",t),document.addEventListener("fullscreenchange",t)}else kae()?this.noSleepTimer=null:(this.noSleepVideo=document.createElement("video"),this.noSleepVideo.setAttribute("title","No Sleep"),this.noSleepVideo.setAttribute("playsinline",""),this._addSourceToVideo(this.noSleepVideo,"webm",XHt),this._addSourceToVideo(this.noSleepVideo,"mp4",KHt),this.noSleepVideo.addEventListener("loadedmetadata",()=>{this.noSleepVideo.duration<=1?this.noSleepVideo.setAttribute("loop",""):this.noSleepVideo.addEventListener("timeupdate",()=>{this.noSleepVideo.currentTime>.5&&(this.noSleepVideo.currentTime=Math.random())})}))}_addSourceToVideo(t,n,i){var r=document.createElement("source");r.src=i,r.type=`video/${n}`,t.appendChild(r)}get isEnabled(){return this.enabled}enable(){return Uae()?navigator.wakeLock.request("screen").then(t=>{this._wakeLock=t,this.enabled=!0,console.log("Wake Lock active."),this._wakeLock.addEventListener("release",()=>{console.log("Wake Lock released.")})}).catch(t=>{throw this.enabled=!1,console.error(`${t.name}, ${t.message}`),t}):kae()?(this.disable(),console.warn(` + */(function(e){"use strict";(function(n,i,r){function o(a){var c=i[a];return c||n[a][0].call(c=i[a]={exports:{}},o,c,c.exports),c.exports}var s=o(r[0]);s.util.global.protobuf=s,typeof define=="function"&&define.amd&&define(["long"],function(a){return a&&a.isLong&&(s.util.Long=a,s.configure()),s}),typeof PM=="object"&&PM&&PM.exports&&(PM.exports=s)})({1:[function(t,n,i){"use strict";i.build="minimal",i.Writer=t(15),i.BufferWriter=t(16),i.Reader=t(2),i.BufferReader=t(3),i.util=t(12),i.rpc=t(5),i.roots=t(4),i.configure=r;function r(){i.util.LongBits._configure(i.util.Long),i.Writer._configure(i.BufferWriter),i.Reader._configure(i.BufferReader)}r()},{12:12,15:15,16:16,2:2,3:3,4:4,5:5}],2:[function(t,n,i){"use strict";n.exports=u;var r=t(12),o,s=r.LongBits,a=r.utf8;function c(T,E){return RangeError("index out of range: "+T.pos+" + "+(E||1)+" > "+T.len)}function u(T){this.buf=T,this.pos=0,this.len=T.length,this.view=null,this.discardUnknown=u.discardUnknown}function f(T){if(Array.isArray(T)&&(T=new Uint8Array(T)),T instanceof Uint8Array)return new u(T);throw Error("illegal buffer")}var d=function(){return r.Buffer?function(v){return(u.create=function(I){return r.Buffer.isBuffer(I)?new o(I):f(I)})(v)}:f};u.create=d(),u.prototype.raw=function(E,v){return this.buf.subarray(E,v)};function p(T){for(var E=0,v=0;v<4;++v){if(T.pos>=T.len)throw c(T);var S=T.buf[T.pos++];if(E=(E|(S&127)<<v*7)>>>0,S<128)return E}throw c(T)}u.prototype.uint32=function(){if(this.len-this.pos<5){if(this.pos>=this.len)throw c(this);if(this.buf[this.pos]>=128)return p(this)}var E=this.buf,v=this.pos,S=(E[v]&127)>>>0;if(E[v++]<128)return this.pos=v,S;if(S=(S|(E[v]&127)<<7)>>>0,E[v++]<128)return this.pos=v,S;if(S=(S|(E[v]&127)<<14)>>>0,E[v++]<128)return this.pos=v,S;if(S=(S|(E[v]&127)<<21)>>>0,E[v++]<128)return this.pos=v,S;if(S=(S|(E[v]&15)<<28)>>>0,E[v++]<128)return this.pos=v,S;for(var I=0;I<5;++I){if(v>=this.len)throw this.pos=v,c(this);if(E[v++]<128)return this.pos=v,S}throw this.pos=v,Error("invalid varint encoding")},u.prototype.tag=function(){if(this.len-this.pos<5){if(this.pos>=this.len)throw c(this);if(this.buf[this.pos]>=128)return p(this)}var E=this.buf,v=this.pos,S=(E[v]&127)>>>0;if(E[v++]<128)return this.pos=v,S;if(S=(S|(E[v]&127)<<7)>>>0,E[v++]<128)return this.pos=v,S;if(S=(S|(E[v]&127)<<14)>>>0,E[v++]<128)return this.pos=v,S;if(S=(S|(E[v]&127)<<21)>>>0,E[v++]<128)return this.pos=v,S;if(S=(S|(E[v]&15)<<28)>>>0,E[v]<128&&(E[v]&112)===0)return this.pos=v+1,S;throw this.pos=v+1,Error("invalid tag encoding")},u.prototype.int32=function(){return this.uint32()|0},u.prototype.sint32=function(){var E=this.uint32();return E>>>1^-(E&1)|0};function g(){var T=new s(0,0),E=0;if(this.len-this.pos>4){for(;E<4;++E)if(T.lo=(T.lo|(this.buf[this.pos]&127)<<E*7)>>>0,this.buf[this.pos++]<128)return T;if(T.lo=(T.lo|(this.buf[this.pos]&127)<<28)>>>0,T.hi=(T.hi|(this.buf[this.pos]&127)>>4)>>>0,this.buf[this.pos++]<128)return T;E=0}else{for(;E<4;++E){if(this.pos>=this.len)throw c(this);if(T.lo=(T.lo|(this.buf[this.pos]&127)<<E*7)>>>0,this.buf[this.pos++]<128)return T}throw c(this)}if(this.len-this.pos>4){for(;E<5;++E)if(T.hi=(T.hi|(this.buf[this.pos]&127)<<E*7+3)>>>0,this.buf[this.pos++]<128)return T}else for(;E<5;++E){if(this.pos>=this.len)throw c(this);if(T.hi=(T.hi|(this.buf[this.pos]&127)<<E*7+3)>>>0,this.buf[this.pos++]<128)return T}throw Error("invalid varint encoding")}u.prototype.bool=function(){for(var E=!1,v,S=0;S<10;++S){if(this.pos>=this.len)throw c(this);if(v=this.buf[this.pos++],v&127&&(E=!0),v<128)return E}throw Error("invalid varint encoding")};function m(T,E){return(T[E-4]|T[E-3]<<8|T[E-2]<<16|T[E-1]<<24)>>>0}u.prototype.fixed32=function(){if(this.pos+4>this.len)throw c(this,4);return m(this.buf,this.pos+=4)},u.prototype.sfixed32=function(){if(this.pos+4>this.len)throw c(this,4);return m(this.buf,this.pos+=4)|0};function y(){if(this.pos+8>this.len)throw c(this,8);return new s(m(this.buf,this.pos+=4),m(this.buf,this.pos+=4))}u.prototype.float=function(){if(this.pos+4>this.len)throw c(this,4);var E=r.float.readFloatLE(this.buf,this.pos);return this.pos+=4,E},u.prototype.double=function(){if(this.pos+8>this.len)throw c(this,4);var E=r.float.readDoubleLE(this.buf,this.pos);return this.pos+=8,E},u.prototype.uint32s=function(E){E===e&&(E=[]);var v=this.uint32()+this.pos,S=this.len,I=this.buf,R=this.pos,O;if(v>S)throw c(this,v-this.pos);for(this.len=v;R<v;)O=I[R++],O<128?E.push(O):(this.pos=R-1,E.push(this.uint32()),R=this.pos);if(this.pos=R,R!==v)throw RangeError("index out of range");return this.len=S,E},u.prototype.int32s=function(E){E===e&&(E=[]);var v=this.uint32()+this.pos,S=this.len,I=this.buf,R=this.pos,O;if(v>S)throw c(this,v-this.pos);for(this.len=v;R<v;)O=I[R++],O<128?E.push(O):(this.pos=R-1,E.push(this.int32()),R=this.pos);if(this.pos=R,R!==v)throw RangeError("index out of range");return this.len=S,E},u.prototype.sint32s=function(E){E===e&&(E=[]);var v=this.uint32()+this.pos,S=this.len;if(v>S)throw c(this,v-this.pos);for(this.len=v;this.pos<v;)E.push(this.sint32());if(this.pos!==v)throw RangeError("index out of range");return this.len=S,E},u.prototype.bools=function(E){E===e&&(E=[]);var v=this.uint32()+this.pos,S=this.len,I=this.buf,R=this.pos,O;if(v>S)throw c(this,v-this.pos);for(this.len=v;R<v;)O=I[R++],O<128?E.push(O!==0):(this.pos=R-1,E.push(this.bool()),R=this.pos);if(this.pos=R,R!==v)throw RangeError("index out of range");return this.len=S,E};var A=8,b=128;function x(T,E,v){var S=T.view;if(S||E<v)return S;var I=T.buf;return T.view=new DataView(I.buffer,I.byteOffset,I.byteLength)}u.prototype.fixed32s=function(E){E===e&&(E=[]);var v=this.uint32(),S=this.pos+v;if(S>this.len)throw c(this,v);var I=v>>>2,R=E.length,O=this.pos;E.length=R+I;var L=x(this,I,b);if(L)for(var _=0;_<I;++_,O+=4)E[R++]=L.getUint32(O,!0);else for(var C=this.buf,w=0;w<I;++w,O+=4)E[R++]=m(C,O+4);if(this.pos=O,O!==S)throw c(this,4);return E},u.prototype.sfixed32s=function(E){E===e&&(E=[]);var v=this.uint32(),S=this.pos+v;if(S>this.len)throw c(this,v);var I=v>>>2,R=E.length,O=this.pos;E.length=R+I;var L=x(this,I,b);if(L)for(var _=0;_<I;++_,O+=4)E[R++]=L.getInt32(O,!0);else for(var C=this.buf,w=0;w<I;++w,O+=4)E[R++]=m(C,O+4)|0;if(this.pos=O,O!==S)throw c(this,4);return E},u.prototype.floats=function(E){E===e&&(E=[]);var v=this.uint32(),S=this.pos+v;if(S>this.len)throw c(this,v);var I=v>>>2,R=E.length,O=this.pos;E.length=R+I;var L=x(this,I,A);if(L)for(var _=0;_<I;++_,O+=4)E[R++]=L.getFloat32(O,!0);else for(var C=this.buf,w=0;w<I;++w,O+=4)E[R++]=r.float.readFloatLE(C,O);if(this.pos=O,O!==S)throw c(this,4);return E},u.prototype.doubles=function(E){E===e&&(E=[]);var v=this.uint32(),S=this.pos+v;if(S>this.len)throw c(this,v);var I=v>>>3,R=E.length,O=this.pos;E.length=R+I;var L=x(this,I,A);if(L)for(var _=0;_<I;++_,O+=8)E[R++]=L.getFloat64(O,!0);else for(var C=this.buf,w=0;w<I;++w,O+=8)E[R++]=r.float.readDoubleLE(C,O);if(this.pos=O,O!==S)throw c(this,8);return E},u.prototype.uint64s=function(E){E===e&&(E=[]);var v=this.uint32()+this.pos,S=this.len;if(v>S)throw c(this,v-this.pos);for(this.len=v;this.pos<v;)E.push(this.uint64());if(this.pos!==v)throw RangeError("index out of range");return this.len=S,E},u.prototype.int64s=function(E){E===e&&(E=[]);var v=this.uint32()+this.pos,S=this.len;if(v>S)throw c(this,v-this.pos);for(this.len=v;this.pos<v;)E.push(this.int64());if(this.pos!==v)throw RangeError("index out of range");return this.len=S,E},u.prototype.sint64s=function(E){E===e&&(E=[]);var v=this.uint32()+this.pos,S=this.len;if(v>S)throw c(this,v-this.pos);for(this.len=v;this.pos<v;)E.push(this.sint64());if(this.pos!==v)throw RangeError("index out of range");return this.len=S,E},u.prototype.fixed64s=function(E){E===e&&(E=[]);var v=this.uint32(),S=this.pos+v,I=E.length;if(S>this.len)throw c(this,v);var R=v>>>3;E.length=I+R;for(var O=0;O<R;++O)E[I++]=this.fixed64();if(this.pos!==S)throw c(this,8);return E},u.prototype.sfixed64s=function(E){E===e&&(E=[]);var v=this.uint32(),S=this.pos+v,I=E.length;if(S>this.len)throw c(this,v);var R=v>>>3;E.length=I+R;for(var O=0;O<R;++O)E[I++]=this.sfixed64();if(this.pos!==S)throw c(this,8);return E},u.prototype.bytes=function(){var E=this.uint32(),v=this.pos,S=this.pos+E;if(S>this.len)throw c(this,E);return this.pos=S,this.raw(v,S)},u.prototype.string=function(){var E=this.uint32(),v=this.pos,S=this.pos+E;if(S>this.len)throw c(this,E);return this.pos=S,a.read(this.buf,v,S)},u.prototype.stringVerify=function(){var E=this.uint32(),v=this.pos,S=this.pos+E;if(S>this.len)throw c(this,E);return this.pos=S,a.readStrict(this.buf,v,S)},u.prototype.skip=function(E){if(typeof E=="number"){if(this.pos+E>this.len)throw c(this,E);this.pos+=E}else do if(this.pos>=this.len)throw c(this);while(this.buf[this.pos++]&128);return this},u.recursionLimit=r.recursionLimit,u.discardUnknown=!0,u.prototype.skipType=function(T,E,v){if(E===e&&(E=0),E>u.recursionLimit)throw Error("max depth exceeded");if(v===0)throw Error("illegal tag: field number 0");switch(T){case 0:this.skip();break;case 1:this.skip(8);break;case 2:this.skip(this.uint32());break;case 3:for(;;){var S=this.tag(),I=S>>>3;if(T=S&7,!I)throw Error("illegal tag: field number 0");if(T===4){if(v!==e&&I!==v)throw Error("invalid end group tag");break}this.skipType(T,E+1,I)}break;case 5:this.skip(4);break;default:throw Error("invalid wire type "+T+" at offset "+this.pos)}return this},u._configure=function(T){o=T,u.create=d(),o._configure();var E=r.Long?"toLong":"toNumber";r.merge(u.prototype,{int64:function(){return g.call(this)[E](!1)},uint64:function(){return g.call(this)[E](!0)},sint64:function(){return g.call(this).zzDecode()[E](!1)},fixed64:function(){return y.call(this)[E](!0)},sfixed64:function(){return y.call(this)[E](!1)}})}},{12:12}],3:[function(t,n,i){"use strict";n.exports=s;var r=t(2);s.prototype=Object.create(r.prototype,{constructor:{value:s,writable:!0,enumerable:!1,configurable:!0}});var o=t(12);function s(a){r.call(this,a)}s._configure=function(){o.Buffer&&(s.prototype._slice=o.Buffer.prototype.slice)},s.prototype.raw=function(c,u){return this._slice.call(this.buf,c,u)},s.prototype.string=function(){var c=this.uint32(),u=this.pos,f=this.pos+c;if(f>this.len)throw RangeError("index out of range: "+this.pos+" + "+c+" > "+this.len);return this.pos=f,this.buf.utf8Slice?this.buf.utf8Slice(u,f):this.buf.toString("utf-8",u,f)},s._configure()},{12:12,2:2}],4:[function(t,n,i){"use strict";n.exports=Object.create(null)},{}],5:[function(t,n,i){"use strict";var r=i;r.Service=t(6)},{6:6}],6:[function(t,n,i){"use strict";n.exports=o;var r=t(12);o.prototype=Object.create(r.EventEmitter.prototype,{constructor:{value:o,writable:!0,enumerable:!1,configurable:!0}});function o(s,a,c){if(typeof s!="function")throw TypeError("rpcImpl must be a function");r.EventEmitter.call(this),this.rpcImpl=s,this.requestDelimited=!!a,this.responseDelimited=!!c}o.prototype.rpcCall=function s(a,c,u,f,d){if(!f)throw TypeError("request must be specified");var p=this;if(!d)return r.asPromise(s,p,a,c,u,f);if(!p.rpcImpl)return setTimeout(function(){d(Error("already ended"))},0),e;try{return p.rpcImpl(a,c[p.requestDelimited?"encodeDelimited":"encode"](f).finish(),function(m,y){if(m)return p.emit("error",m,a),d(m);if(y===null)return p.end(!0),e;if(!(y instanceof u))try{y=u[p.responseDelimited?"decodeDelimited":"decode"](y)}catch(A){return p.emit("error",A,a),d(A)}return p.emit("data",y,a),d(null,y)})}catch(g){return p.emit("error",g,a),setTimeout(function(){d(g)},0),e}},o.prototype.end=function(a){return this.rpcImpl&&(a||this.rpcImpl(null,null,null),this.rpcImpl=null,this.emit("end").off()),this}},{12:12}],7:[function(t,n,i){"use strict";n.exports=r;function r(o,s){for(var a=new Array(arguments.length-1),c=0,u=2,f=!0;u<arguments.length;)a[c++]=arguments[u++];return new Promise(function(p,g){a[c]=function(y){if(f)if(f=!1,y)g(y);else{for(var A=new Array(arguments.length-1),b=0;b<A.length;)A[b++]=arguments[b];p.apply(null,A)}};try{o.apply(s||null,a)}catch(m){f&&(f=!1,g(m))}})}},{}],8:[function(t,n,i){"use strict";var r=i;r.length=function(g){var m=g.length;if(!m)return 0;for(;m>0&&g.charAt(m-1)==="=";)--m;return Math.floor(m*3/4)};for(var o=new Array(64),s=new Array(123),a=0;a<64;)s[o[a]=a<26?a+65:a<52?a+71:a<62?a-4:a-59|43]=a++;s[45]=62,s[95]=63,r.encode=function(g,m,y){for(var A=null,b=[],x=0,T=0,E;m<y;){var v=g[m++];switch(T){case 0:b[x++]=o[v>>2],E=(v&3)<<4,T=1;break;case 1:b[x++]=o[E|v>>4],E=(v&15)<<2,T=2;break;case 2:b[x++]=o[E|v>>6],b[x++]=o[v&63],T=0;break}x>8191&&((A||(A=[])).push(String.fromCharCode.apply(String,b)),x=0)}return T&&(b[x++]=o[E],b[x++]=61,T===1&&(b[x++]=61)),A?(x&&A.push(String.fromCharCode.apply(String,b.slice(0,x))),A.join("")):String.fromCharCode.apply(String,b.slice(0,x))};var c="invalid encoding";r.decode=function(g,m,y){for(var A=y,b=0,x,T=0;T<g.length;){var E=g.charCodeAt(T++);if(E===61&&b>1)break;if((E=s[E])===e)throw Error(c);switch(b){case 0:x=E,b=1;break;case 1:m[y++]=x<<2|(E&48)>>4,x=E,b=2;break;case 2:m[y++]=(x&15)<<4|(E&60)>>2,x=E,b=3;break;case 3:m[y++]=(x&3)<<6|E,b=0;break}}if(b===1)throw Error(c);return y-A};var u=/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/,f=/[-_]/,d=/^(?:[A-Za-z0-9_-]{4})*(?:[A-Za-z0-9_-]{2}(?:==)?|[A-Za-z0-9_-]{3}=?)?$/;r.test=function(g){return u.test(g)||f.test(g)&&d.test(g)}},{}],9:[function(t,n,i){"use strict";n.exports=r;function r(){this._listeners=Object.create(null)}r.prototype.on=function(s,a,c){return(this._listeners[s]||(this._listeners[s]=[])).push({fn:a,ctx:c||this}),this},r.prototype.off=function(s,a){if(s===e)this._listeners=Object.create(null);else if(a===e)this._listeners[s]=[];else{var c=this._listeners[s];if(!c)return this;for(var u=0;u<c.length;)c[u].fn===a?c.splice(u,1):++u}return this},r.prototype.emit=function(s){var a=this._listeners[s];if(a){for(var c=[],u=1;u<arguments.length;)c.push(arguments[u++]);for(u=0;u<a.length;)a[u].fn.apply(a[u++].ctx,c)}return this}},{}],10:[function(t,n,i){"use strict";n.exports=r(r);function r(u){return typeof Float32Array<"u"?(function(){var f=new Float32Array([-0]),d=new Uint8Array(f.buffer),p=d[3]===128;function g(b,x,T){f[0]=b,x[T]=d[0],x[T+1]=d[1],x[T+2]=d[2],x[T+3]=d[3]}function m(b,x,T){f[0]=b,x[T]=d[3],x[T+1]=d[2],x[T+2]=d[1],x[T+3]=d[0]}u.writeFloatLE=p?g:m,u.writeFloatBE=p?m:g;function y(b,x){return d[0]=b[x],d[1]=b[x+1],d[2]=b[x+2],d[3]=b[x+3],f[0]}function A(b,x){return d[3]=b[x],d[2]=b[x+1],d[1]=b[x+2],d[0]=b[x+3],f[0]}u.readFloatLE=p?y:A,u.readFloatBE=p?A:y})():(function(){function f(p,g,m,y){var A=g<0?1:0;if(A&&(g=-g),g===0)p(1/g>0?0:2147483648,m,y);else if(isNaN(g))p(2143289344,m,y);else if(g>34028234663852886e22)p((A<<31|2139095040)>>>0,m,y);else if(g<11754943508222875e-54)p((A<<31|Math.round(g/1401298464324817e-60))>>>0,m,y);else{var b=Math.floor(Math.log(g)/Math.LN2),x=Math.round(g*Math.pow(2,-b)*8388608)&8388607;p((A<<31|b+127<<23|x)>>>0,m,y)}}u.writeFloatLE=f.bind(null,o),u.writeFloatBE=f.bind(null,s);function d(p,g,m){var y=p(g,m),A=(y>>31)*2+1,b=y>>>23&255,x=y&8388607;return b===255?x?NaN:A*(1/0):b===0?A*1401298464324817e-60*x:A*Math.pow(2,b-150)*(x+8388608)}u.readFloatLE=d.bind(null,a),u.readFloatBE=d.bind(null,c)})(),typeof Float64Array<"u"?(function(){var f=new Float64Array([-0]),d=new Uint8Array(f.buffer),p=d[7]===128;function g(b,x,T){f[0]=b,x[T]=d[0],x[T+1]=d[1],x[T+2]=d[2],x[T+3]=d[3],x[T+4]=d[4],x[T+5]=d[5],x[T+6]=d[6],x[T+7]=d[7]}function m(b,x,T){f[0]=b,x[T]=d[7],x[T+1]=d[6],x[T+2]=d[5],x[T+3]=d[4],x[T+4]=d[3],x[T+5]=d[2],x[T+6]=d[1],x[T+7]=d[0]}u.writeDoubleLE=p?g:m,u.writeDoubleBE=p?m:g;function y(b,x){return d[0]=b[x],d[1]=b[x+1],d[2]=b[x+2],d[3]=b[x+3],d[4]=b[x+4],d[5]=b[x+5],d[6]=b[x+6],d[7]=b[x+7],f[0]}function A(b,x){return d[7]=b[x],d[6]=b[x+1],d[5]=b[x+2],d[4]=b[x+3],d[3]=b[x+4],d[2]=b[x+5],d[1]=b[x+6],d[0]=b[x+7],f[0]}u.readDoubleLE=p?y:A,u.readDoubleBE=p?A:y})():(function(){function f(p,g,m,y,A,b){var x=y<0?1:0;if(x&&(y=-y),y===0)p(0,A,b+g),p(1/y>0?0:2147483648,A,b+m);else if(isNaN(y))p(0,A,b+g),p(2146959360,A,b+m);else if(y>17976931348623157e292)p(0,A,b+g),p((x<<31|2146435072)>>>0,A,b+m);else{var T;if(y<22250738585072014e-324)T=y/5e-324,p(T>>>0,A,b+g),p((x<<31|T/4294967296)>>>0,A,b+m);else{var E=Math.floor(Math.log(y)/Math.LN2);E===1024&&(E=1023),T=y*Math.pow(2,-E),p(T*4503599627370496>>>0,A,b+g),p((x<<31|E+1023<<20|T*1048576&1048575)>>>0,A,b+m)}}}u.writeDoubleLE=f.bind(null,o,0,4),u.writeDoubleBE=f.bind(null,s,4,0);function d(p,g,m,y,A){var b=p(y,A+g),x=p(y,A+m),T=(x>>31)*2+1,E=x>>>20&2047,v=4294967296*(x&1048575)+b;return E===2047?v?NaN:T*(1/0):E===0?T*5e-324*v:T*Math.pow(2,E-1075)*(v+4503599627370496)}u.readDoubleLE=d.bind(null,a,0,4),u.readDoubleBE=d.bind(null,c,4,0)})(),u}function o(u,f,d){f[d]=u&255,f[d+1]=u>>>8&255,f[d+2]=u>>>16&255,f[d+3]=u>>>24}function s(u,f,d){f[d]=u>>>24,f[d+1]=u>>>16&255,f[d+2]=u>>>8&255,f[d+3]=u&255}function a(u,f){return(u[f]|u[f+1]<<8|u[f+2]<<16|u[f+3]<<24)>>>0}function c(u,f){return(u[f]<<24|u[f+1]<<16|u[f+2]<<8|u[f+3])>>>0}},{}],11:[function(t,n,i){"use strict";n.exports=o;var r;function o(u,f){this.lo=u>>>0,this.hi=f>>>0}var s=o.zero=new o(0,0);s.toNumber=function(){return 0},s.zzEncode=s.zzDecode=function(){return this},s.length=function(){return 1};var a=o.zeroHash="\0\0\0\0\0\0\0\0";o.fromNumber=function(f){if(f===0)return s;var d=f<0;d&&(f=-f);var p=f>>>0,g=(f-p)/4294967296>>>0;return d&&(g=~g>>>0,p=~p>>>0,++p>4294967295&&(p=0,++g>4294967295&&(g=0))),new o(p,g)},o.from=function(f){if(typeof f=="number")return o.fromNumber(f);if(typeof f=="string"||f instanceof String)if(r)f=r.fromString(f);else return o.fromNumber(parseInt(f,10));return f.low||f.high?new o(f.low>>>0,f.high>>>0):s},o.prototype.toNumber=function(f){if(!f&&this.hi>>>31){var d=~this.lo+1>>>0,p=~this.hi>>>0;return d||(p=p+1>>>0),-(d+p*4294967296)}return this.lo+this.hi*4294967296},o.prototype.toLong=function(f){return r?new r(this.lo|0,this.hi|0,!!f):{low:this.lo|0,high:this.hi|0,unsigned:!!f}};var c=String.prototype.charCodeAt;o.fromHash=function(f){return f===a?s:new o((c.call(f,0)|c.call(f,1)<<8|c.call(f,2)<<16|c.call(f,3)<<24)>>>0,(c.call(f,4)|c.call(f,5)<<8|c.call(f,6)<<16|c.call(f,7)<<24)>>>0)},o.prototype.toHash=function(){return String.fromCharCode(this.lo&255,this.lo>>>8&255,this.lo>>>16&255,this.lo>>>24,this.hi&255,this.hi>>>8&255,this.hi>>>16&255,this.hi>>>24)},o.prototype.zzEncode=function(){var f=this.hi>>31;return this.hi=((this.hi<<1|this.lo>>>31)^f)>>>0,this.lo=(this.lo<<1^f)>>>0,this},o.prototype.zzDecode=function(){var f=-(this.lo&1);return this.lo=((this.lo>>>1|this.hi<<31)^f)>>>0,this.hi=(this.hi>>>1^f)>>>0,this},o.prototype.length=function(){var f=this.lo,d=(this.lo>>>28|this.hi<<4)>>>0,p=this.hi>>>24;return p===0?d===0?f<16384?f<128?1:2:f<2097152?3:4:d<16384?d<128?5:6:d<2097152?7:8:p<128?9:10},o._configure=function(u){r=u}},{}],12:[function(t,n,i){"use strict";var r=i;r.asPromise=t(7),r.base64=t(8),r.EventEmitter=t(9),r.float=t(10),r.utf8=t(14),r.pool=t(13),r.LongBits=t(11);function o(c){return c==="__proto__"||c==="prototype"||c==="constructor"}r.isUnsafeProperty=o,r.isNode=!!(typeof global<"u"&&global&&global.process&&global.process.versions&&global.process.versions.node),r.global=r.isNode&&global||typeof window<"u"&&window||typeof self<"u"&&self||typeof globalThis<"u"&&globalThis||this,r.emptyArray=Object.freeze?Object.freeze([]):[],r.emptyObject=Object.freeze?Object.freeze({}):{},r.isInteger=Number.isInteger||function(u){return typeof u=="number"&&isFinite(u)&&Math.floor(u)===u},r.isString=function(u){return typeof u=="string"||u instanceof String},r.isObject=function(u){return u&&typeof u=="object"},r.isset=r.isSet=function(u,f){var d=u[f];return d!=null&&Object.hasOwnProperty.call(u,f)?typeof d!="object"||(Array.isArray(d)?d.length:Object.keys(d).length)>0:!1},r.Buffer=(function(){try{var c=r.global.Buffer;return c.prototype.utf8Write||r.isNode?c:null}catch{return null}})(),r.newBuffer=function(u){var f=r.Buffer;return typeof u=="number"?f?f.allocUnsafe(u):new Uint8Array(u):f?f.from(u):new Uint8Array(u)},r.rawField=function(u,f,d){var p=[],g=u<<3|f;for(g>>>=0;g>127;)p.push(g&127|128),g>>>=7;p.push(g);for(var m=0;m<d.length;++m)p.push(d[m]);return r.newBuffer(p)},r.Array=Uint8Array,r.Long=r.global.dcodeIO&&r.global.dcodeIO.Long||r.global.Long||(function(){try{var c=t("long");return c&&c.isLong?c:null}catch{return null}})(),r.key2Re=/^(?:true|false|0|1)$/,r.key32Re=/^-?(?:0|[1-9][0-9]*)$/,r.key64Re=/^(?:[\x00-\xff]{8}|-?(?:0|[1-9][0-9]*))$/,r.longToHash=function(u){return u?r.LongBits.from(u).toHash():r.LongBits.zeroHash},r.longFromHash=function(u,f){var d=r.LongBits.fromHash(u);return r.Long?r.Long.fromBits(d.lo,d.hi,f):d.toNumber(!!f)},r.longFromKey=function(u,f){return r.key64Re.test(u)&&!r.key32Re.test(u)?r.longFromHash(u,f):u},r.boolFromKey=function(u){return u==="true"||u==="1"};function s(c){var u=typeof arguments[arguments.length-1]=="boolean",f=u?arguments.length-1:arguments.length;u=u&&arguments[arguments.length-1];for(var d=1;d<f;++d){var p=arguments[d];if(p)for(var g=Object.keys(p),m=0;m<g.length;++m)!o(g[m])&&(!u||!Object.prototype.hasOwnProperty.call(c,g[m])||c[g[m]]===e)&&(c[g[m]]=p[g[m]])}return c}r.merge=s,r.nestingLimit=32,r.recursionLimit=100,r.makeProp=function(u,f,d){Object.prototype.hasOwnProperty.call(u,f)||Object.defineProperty(u,f,{enumerable:d===e?!0:d,configurable:!0,writable:!0})},r.lcFirst=function(u){return u.charAt(0).toLowerCase()+u.substring(1)};function a(c){function u(f,d){if(!(this instanceof u))return new u(f,d);Object.defineProperty(this,"message",{get:function(){return f}}),Error.captureStackTrace?Error.captureStackTrace(this,u):Object.defineProperty(this,"stack",{value:new Error().stack||""}),d&&s(this,d)}return u.prototype=Object.create(Error.prototype,{constructor:{value:u,writable:!0,enumerable:!1,configurable:!0},name:{get:function(){return c},set:e,enumerable:!1,configurable:!0},toString:{value:function(){return this.name+": "+this.message},writable:!0,enumerable:!1,configurable:!0}}),u}r.newError=a,r.ProtocolError=a("ProtocolError"),r.oneOfGetter=function(u){for(var f={},d=0;d<u.length;++d)f[u[d]]=1;return function(){for(var p=Object.keys(this),g=p.length-1;g>-1;--g)if(f[p[g]]===1&&this[p[g]]!==e&&this[p[g]]!==null)return p[g]}},r.oneOfSetter=function(u){return function(f){for(var d=0;d<u.length;++d)u[d]!==f&&delete this[u[d]]}},r.toJSONOptions={longs:String,enums:String,bytes:String,json:!0}},{10:10,11:11,13:13,14:14,7:7,8:8,9:9,long:"long"}],13:[function(t,n,i){"use strict";n.exports=r;function r(o,s,a){var c=a||8192,u=c>>>1,f=null,d=c;return function(g){if(g<1||g>u)return o(g);d+g>c&&(f=o(c),d=0);var m=s.call(f,d,d+=g);return d&7&&(d=(d|7)+1),m}}},{}],14:[function(t,n,i){"use strict";var r=i,o=new TextDecoder("utf-8",{ignoreBOM:!0}),s,a=64;try{s=new TextDecoder("utf-8",{fatal:!0,ignoreBOM:!0})}catch{s=o}r.length=function(f){for(var d=0,p=0,g=0;g<f.length;++g)p=f.charCodeAt(g),p<128?d+=1:p<2048?d+=2:(p&64512)===55296&&(f.charCodeAt(g+1)&64512)===56320?(++g,d+=4):d+=3;return d};function c(u,f,d,p){var g=d===0&&p===f.length?f:f.subarray(d,p);return u.decode(g)}r.read=function(f,d,p){if(p-d<1)return"";if(p-d>=a)return c(o,f,d,p);for(var g="",m=d,y,A,b,x,T,E,v,S;m+7<p;m+=8){if(y=f[m],A=f[m+1],b=f[m+2],x=f[m+3],T=f[m+4],E=f[m+5],v=f[m+6],S=f[m+7],(y|A|b|x|T|E|v|S)&128)return g+c(o,f,m,p);g+=String.fromCharCode(y,A,b,x,T,E,v,S)}for(;m<p;++m){if(y=f[m],y&128)return g+c(o,f,m,p);g+=String.fromCharCode(y)}return g},r.readStrict=function(f,d,p){if(p-d<1)return"";if(p-d>=a)return c(s,f,d,p);for(var g="",m=d,y,A,b,x,T,E,v,S;m+7<p;m+=8){if(y=f[m],A=f[m+1],b=f[m+2],x=f[m+3],T=f[m+4],E=f[m+5],v=f[m+6],S=f[m+7],(y|A|b|x|T|E|v|S)&128)return g+c(s,f,m,p);g+=String.fromCharCode(y,A,b,x,T,E,v,S)}for(;m<p;++m){if(y=f[m],y&128)return g+c(s,f,m,p);g+=String.fromCharCode(y)}return g},r.write=function(f,d,p){for(var g=p,m,y,A=0;A<f.length;++A)m=f.charCodeAt(A),m<128?d[p++]=m:m<2048?(d[p++]=m>>6|192,d[p++]=m&63|128):(m&64512)===55296&&((y=f.charCodeAt(A+1))&64512)===56320?(m=65536+((m&1023)<<10)+(y&1023),++A,d[p++]=m>>18|240,d[p++]=m>>12&63|128,d[p++]=m>>6&63|128,d[p++]=m&63|128):(d[p++]=m>>12|224,d[p++]=m>>6&63|128,d[p++]=m&63|128);return p-g}},{}],15:[function(t,n,i){"use strict";n.exports=u;var r=t(12),o,s=r.LongBits,a=r.base64,c=r.utf8;function u(){this.pos=0,this.buf=this.constructor.alloc(u.initialBufferSize),this.view=null,this.states=null}u.initialBufferSize=128,Object.defineProperty(u.prototype,"len",{configurable:!0,enumerable:!0,get:function(){return this.pos}});var f=function(){return r.Buffer?function(){return(u.create=function(){return new o})()}:function(){return new u}};u.create=f(),u.alloc=function(E){return new Uint8Array(E)},u.alloc=r.pool(u.alloc,Uint8Array.prototype.subarray);function d(T){return T<128?1:T<16384?2:T<2097152?3:T<268435456?4:5}u.prototype._reserve=function(E){var v=this.pos+E;if(v>this.buf.length){var S=this.buf.length<<1;S<v&&(S=v);var I=this.constructor.alloc(S);I.set(this.buf.subarray(0,this.pos),0),this.buf=I,this.view=null}};function p(T,E,v){for(var S=0;S<T.length;)E[v++]=T.charCodeAt(S++)}function g(T,E,v){for(;T>127;)E[v++]=T&127|128,T>>>=7;return E[v]=T,v+1}u.prototype.uint32=function(E){E=E>>>0,this._reserve(5);var v=this.pos;return this.pos=g(E,this.buf,v),this},u.prototype.int32=function(E){return(E|=0)<0?(this._reserve(10),m(s.fromNumber(E),this.buf,this.pos),this.pos+=10,this):this.uint32(E)},u.prototype.sint32=function(E){return this.uint32((E<<1^E>>31)>>>0)};function m(T,E,v){for(var S=T.lo,I=T.hi;I;)E[v++]=S&127|128,S=(S>>>7|I<<25)>>>0,I>>>=7;for(;S>127;)E[v++]=S&127|128,S=S>>>7;return E[v]=S,v+1}u.prototype.uint64=function(E){var v=s.from(E);this._reserve(10);var S=this.pos;return this.pos=m(v,this.buf,S),this},u.prototype.int64=u.prototype.uint64,u.prototype.sint64=function(E){var v=s.from(E).zzEncode();this._reserve(10);var S=this.pos;return this.pos=m(v,this.buf,S),this},u.prototype.bool=function(E){return this._reserve(1),this.buf[this.pos++]=E?1:0,this};function y(T,E,v){E[v]=T&255,E[v+1]=T>>>8&255,E[v+2]=T>>>16&255,E[v+3]=T>>>24}u.prototype.fixed32=function(E){return this._reserve(4),y(E>>>0,this.buf,this.pos),this.pos+=4,this},u.prototype.sfixed32=u.prototype.fixed32,u.prototype.fixed64=function(E){var v=s.from(E);return this._reserve(8),y(v.lo,this.buf,this.pos),y(v.hi,this.buf,this.pos+4),this.pos+=8,this},u.prototype.sfixed64=u.prototype.fixed64,u.prototype.float=function(E){return this._reserve(4),r.float.writeFloatLE(E,this.buf,this.pos),this.pos+=4,this},u.prototype.double=function(E){return this._reserve(8),r.float.writeDoubleLE(E,this.buf,this.pos),this.pos+=8,this},u.prototype.bytes=function(E){var v=E.length>>>0;if(!v)return this._reserve(1),this.buf[this.pos++]=0,this;if(r.isString(E)){var S=u.alloc(v=a.length(E));a.decode(E,S,0),E=S}return this.uint32(v),this._reserve(v),this.buf.set(E,this.pos),this.pos+=v,this},u.prototype.raw=function(E){var v=E.length>>>0;return v?(this._reserve(v),this.buf.set(E,this.pos),this.pos+=v,this):this},u.prototype._delim=function(E,v){var S=d(v);return S>1&&this.buf.copyWithin(E+S,E+1,E+1+v),g(v,this.buf,E),this.pos=E+S+v,this},u.prototype.string=function(E){var v=E.length;if(!v)return this._reserve(1),this.buf[this.pos++]=0,this;if(v<128){this._reserve(v*3+5);var S=this.pos;return this._delim(S,c.write(E,this.buf,S+1))}var I=c.length(E);return this.uint32(I),this._reserve(I),I===E.length?p(E,this.buf,this.pos):c.write(E,this.buf,this.pos),this.pos+=I,this},u.prototype.uint32s=function(E){var v=E.length;this._reserve(v*5+5);for(var S=this.buf,I=this.pos,R=I+1,O=0;O<v;++O)R=g(E[O]>>>0,S,R);return this._delim(I,R-I-1)},u.prototype.int32s=function(E){var v=E.length;this._reserve(v*10+5);for(var S=this.buf,I=this.pos,R=I+1,O,L=0;L<v;++L)(O=E[L]|0)<0?R=m(s.fromNumber(O),S,R):R=g(O,S,R);return this._delim(I,R-I-1)},u.prototype.sint32s=function(E){var v=E.length;this._reserve(v*5+5);for(var S=this.buf,I=this.pos,R=I+1,O=0;O<v;++O)R=g((E[O]<<1^E[O]>>31)>>>0,S,R);return this._delim(I,R-I-1)},u.prototype.uint64s=function(E){var v=E.length;this._reserve(v*10+5);for(var S=this.buf,I=this.pos,R=I+1,O=0;O<v;++O)R=m(s.from(E[O]),S,R);return this._delim(I,R-I-1)},u.prototype.int64s=u.prototype.uint64s,u.prototype.sint64s=function(E){var v=E.length;this._reserve(v*10+5);for(var S=this.buf,I=this.pos,R=I+1,O=0;O<v;++O)R=m(s.from(E[O]).zzEncode(),S,R);return this._delim(I,R-I-1)},u.prototype.bools=function(E){var v=E.length;this.uint32(v),this._reserve(v);for(var S=this.buf,I=this.pos,R=0;R<v;++R)S[I++]=E[R]?1:0;return this.pos+=v,this};var A=16,b=128;function x(T,E,v){var S=T.view;if(S||E<v)return S;var I=T.buf;return T.view=new DataView(I.buffer,I.byteOffset,I.byteLength)}u.prototype.fixed32s=function(E){var v=E.length,S=v*4;this.uint32(S),this._reserve(S);var I=this.pos,R,O=x(this,v,b);if(O)for(R=0;R<v;++R)O.setUint32(I,E[R]>>>0,!0),I+=4;else{var L=this.buf;for(R=0;R<v;++R)y(E[R]>>>0,L,I),I+=4}return this.pos+=S,this},u.prototype.sfixed32s=u.prototype.fixed32s,u.prototype.fixed64s=function(E){var v=E.length,S=v*8;this.uint32(S),this._reserve(S);var I=this.pos,R,O,L=x(this,v,b);if(L)for(R=0;R<v;++R)O=s.from(E[R]),L.setUint32(I,O.lo,!0),L.setUint32(I+4,O.hi,!0),I+=8;else{var _=this.buf;for(R=0;R<v;++R)O=s.from(E[R]),y(O.lo,_,I),y(O.hi,_,I+4),I+=8}return this.pos+=S,this},u.prototype.sfixed64s=u.prototype.fixed64s,u.prototype.floats=function(E){var v=E.length,S=v*4;this.uint32(S),this._reserve(S);var I=this.pos,R,O=x(this,v,A);if(O)for(R=0;R<v;++R)O.setFloat32(I,E[R],!0),I+=4;else{var L=this.buf;for(R=0;R<v;++R)r.float.writeFloatLE(E[R],L,I),I+=4}return this.pos+=S,this},u.prototype.doubles=function(E){var v=E.length,S=v*8;this.uint32(S),this._reserve(S);var I=this.pos,R,O=x(this,v,A);if(O)for(R=0;R<v;++R)O.setFloat64(I,E[R],!0),I+=8;else{var L=this.buf;for(R=0;R<v;++R)r.float.writeDoubleLE(E[R],L,I),I+=8}return this.pos+=S,this},u.prototype.fork=function(){return this._reserve(1),(this.states||(this.states=[])).push(this.pos),this.pos+=1,this},u.prototype.reset=function(){var E=this.states;return E&&E.length?this.pos=E.pop():this.pos=0,this},u.prototype.ldelim=function(){var E=this.states,v,S;if(E&&E.length){var I=E.pop();v=this.pos-I-1,S=d(v),S>1?(this._reserve(S-1),this.buf.copyWithin(I+S,I+1,I+1+v),this.pos+=S-1,g(v,this.buf,I)):this.buf[I]=v}else v=this.pos,S=d(v),this._reserve(S),this.buf.copyWithin(S,0,v),g(v,this.buf,0),this.pos+=S;return this},u.prototype.finish=function(E){if(E)return this.buf.subarray(0,this.pos);var v=this.constructor.alloc(this.pos);return v.set(this.buf.subarray(0,this.pos),0),v},u.prototype.finishInto=function(E,v){return v===e&&(v=0),E.set(this.buf.subarray(0,this.pos),v),E},u._configure=function(T){o=T,u.create=f(),o._configure()}},{12:12}],16:[function(t,n,i){"use strict";n.exports=s;var r=t(15);s.prototype=Object.create(r.prototype,{constructor:{value:s,writable:!0,enumerable:!1,configurable:!0}});var o=t(12);function s(){r.call(this)}var a;s._configure=function(){s.alloc=o.Buffer&&o.Buffer.allocUnsafe,a=o.Buffer&&o.Buffer.prototype.utf8Write?function(u,f,d){return f.utf8Write(u,d)}:function(u,f,d){return f.write(u,d)}},s.prototype.bytes=function(u){o.isString(u)&&(u=o.Buffer.from(u,"base64"));var f=u.length>>>0;return this.uint32(f),f&&(this._reserve(f),this.buf.set(u,this.pos),this.pos+=f),this},s.prototype.string=function(u){var f=u.length;if(!f)return this._reserve(1),this.buf[this.pos++]=0,this;if(f<128){this._reserve(f*3+5);var d=this.pos,p=this.buf;return this._delim(d,f<40?o.utf8.write(u,p,d+1):a(u,p,d+1))}var g=o.Buffer.byteLength(u);return this.uint32(g),this._reserve(g),a(u,this.buf,this.pos),this.pos+=g,this},s._configure()},{12:12,15:15}]},{},[1])})()});var qBe=uh((iAr,F7)=>{/* Copyright 2015-2018 Esri. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 @preserve */(function(){var e=(function(){var r={};r.defaultNoDataValue=-34027999387901484e22,r.decode=function(f,d){d=d||{};var p=d.encodedMaskData||d.encodedMaskData===null,g=c(f,d.inputOffset||0,p),m=d.noDataValue!==null?d.noDataValue:r.defaultNoDataValue,y=o(g,d.pixelType||Float32Array,d.encodedMaskData,m,d.returnMask),A={width:g.width,height:g.height,pixelData:y.resultPixels,minValue:y.minValue,maxValue:g.pixels.maxValue,noDataValue:m};return y.resultMask&&(A.maskData=y.resultMask),d.returnEncodedMask&&g.mask&&(A.encodedMaskData=g.mask.bitset?g.mask.bitset:null),d.returnFileInfo&&(A.fileInfo=s(g),d.computeUsedBitDepths&&(A.fileInfo.bitDepths=a(g))),A};var o=function(f,d,p,g,m){var y=0,A=f.pixels.numBlocksX,b=f.pixels.numBlocksY,x=Math.floor(f.width/A),T=Math.floor(f.height/b),E=2*f.maxZError,v=Number.MAX_VALUE,S;p=p||(f.mask?f.mask.bitset:null);var I,R;I=new d(f.width*f.height),m&&p&&(R=new Uint8Array(f.width*f.height));for(var O=new Float32Array(x*T),L,_,C=0;C<=b;C++){var w=C!==b?T:f.height%b;if(w!==0)for(var D=0;D<=A;D++){var N=D!==A?x:f.width%A;if(N!==0){var F=C*f.width*T+D*x,V=f.width-N,B=f.pixels.blocks[y],j,k,G;B.encoding<2?(B.encoding===0?j=B.rawData:(u(B.stuffedData,B.bitsPerPixel,B.numValidPixels,B.offset,E,O,f.pixels.maxValue),j=O),k=0):B.encoding===2?G=0:G=B.offset;var q;if(p)for(_=0;_<w;_++){for(F&7&&(q=p[F>>3],q<<=F&7),L=0;L<N;L++)F&7||(q=p[F>>3]),q&128?(R&&(R[F]=1),S=B.encoding<2?j[k++]:G,v=v>S?S:v,I[F++]=S):(R&&(R[F]=0),I[F++]=g),q<<=1;F+=V}else if(B.encoding<2)for(_=0;_<w;_++){for(L=0;L<N;L++)S=j[k++],v=v>S?S:v,I[F++]=S;F+=V}else for(v=v>G?G:v,_=0;_<w;_++){for(L=0;L<N;L++)I[F++]=G;F+=V}if(B.encoding===1&&k!==B.numValidPixels)throw"Block and Mask do not match";y++}}}return{resultPixels:I,resultMask:R,minValue:v}},s=function(f){return{fileIdentifierString:f.fileIdentifierString,fileVersion:f.fileVersion,imageType:f.imageType,height:f.height,width:f.width,maxZError:f.maxZError,eofOffset:f.eofOffset,mask:f.mask?{numBlocksX:f.mask.numBlocksX,numBlocksY:f.mask.numBlocksY,numBytes:f.mask.numBytes,maxValue:f.mask.maxValue}:null,pixels:{numBlocksX:f.pixels.numBlocksX,numBlocksY:f.pixels.numBlocksY,numBytes:f.pixels.numBytes,maxValue:f.pixels.maxValue,noDataValue:f.noDataValue}}},a=function(f){for(var d=f.pixels.numBlocksX*f.pixels.numBlocksY,p={},g=0;g<d;g++){var m=f.pixels.blocks[g];m.encoding===0?p.float32=!0:m.encoding===1?p[m.bitsPerPixel]=!0:p[0]=!0}return Object.keys(p)},c=function(f,d,p){var g={},m=new Uint8Array(f,d,10);if(g.fileIdentifierString=String.fromCharCode.apply(null,m),g.fileIdentifierString.trim()!=="CntZImage")throw"Unexpected file identifier string: "+g.fileIdentifierString;d+=10;var y=new DataView(f,d,24);if(g.fileVersion=y.getInt32(0,!0),g.imageType=y.getInt32(4,!0),g.height=y.getUint32(8,!0),g.width=y.getUint32(12,!0),g.maxZError=y.getFloat64(16,!0),d+=24,!p)if(y=new DataView(f,d,16),g.mask={},g.mask.numBlocksY=y.getUint32(0,!0),g.mask.numBlocksX=y.getUint32(4,!0),g.mask.numBytes=y.getUint32(8,!0),g.mask.maxValue=y.getFloat32(12,!0),d+=16,g.mask.numBytes>0){var A=new Uint8Array(Math.ceil(g.width*g.height/8));y=new DataView(f,d,g.mask.numBytes);var b=y.getInt16(0,!0),x=2,T=0;do{if(b>0)for(;b--;)A[T++]=y.getUint8(x++);else{var E=y.getUint8(x++);for(b=-b;b--;)A[T++]=E}b=y.getInt16(x,!0),x+=2}while(x<g.mask.numBytes);if(b!==-32768||T<A.length)throw"Unexpected end of mask RLE encoding";g.mask.bitset=A,d+=g.mask.numBytes}else(g.mask.numBytes|g.mask.numBlocksY|g.mask.maxValue)===0&&(g.mask.bitset=new Uint8Array(Math.ceil(g.width*g.height/8)));y=new DataView(f,d,16),g.pixels={},g.pixels.numBlocksY=y.getUint32(0,!0),g.pixels.numBlocksX=y.getUint32(4,!0),g.pixels.numBytes=y.getUint32(8,!0),g.pixels.maxValue=y.getFloat32(12,!0),d+=16;var v=g.pixels.numBlocksX,S=g.pixels.numBlocksY,I=v+(g.width%v>0?1:0),R=S+(g.height%S>0?1:0);g.pixels.blocks=new Array(I*R);for(var O=0,L=0;L<R;L++)for(var _=0;_<I;_++){var C=0,w=f.byteLength-d;y=new DataView(f,d,Math.min(10,w));var D={};g.pixels.blocks[O++]=D;var N=y.getUint8(0);if(C++,D.encoding=N&63,D.encoding>3)throw"Invalid block encoding ("+D.encoding+")";if(D.encoding===2){d++;continue}if(N!==0&&N!==2){if(N>>=6,D.offsetType=N,N===2)D.offset=y.getInt8(1),C++;else if(N===1)D.offset=y.getInt16(1,!0),C+=2;else if(N===0)D.offset=y.getFloat32(1,!0),C+=4;else throw"Invalid block offset type";if(D.encoding===1)if(N=y.getUint8(C),C++,D.bitsPerPixel=N&63,N>>=6,D.numValidPixelsType=N,N===2)D.numValidPixels=y.getUint8(C),C++;else if(N===1)D.numValidPixels=y.getUint16(C,!0),C+=2;else if(N===0)D.numValidPixels=y.getUint32(C,!0),C+=4;else throw"Invalid valid pixel count type"}if(d+=C,D.encoding!==3){var F,V;if(D.encoding===0){var B=(g.pixels.numBytes-1)/4;if(B!==Math.floor(B))throw"uncompressed block has invalid length";F=new ArrayBuffer(B*4),V=new Uint8Array(F),V.set(new Uint8Array(f,d,B*4));var j=new Float32Array(F);D.rawData=j,d+=B*4}else if(D.encoding===1){var k=Math.ceil(D.numValidPixels*D.bitsPerPixel/8),G=Math.ceil(k/4);F=new ArrayBuffer(G*4),V=new Uint8Array(F),V.set(new Uint8Array(f,d,k)),D.stuffedData=new Uint32Array(F),d+=k}}}return g.eofOffset=d,g},u=function(f,d,p,g,m,y,A){var b=(1<<d)-1,x=0,T,E=0,v,S,I=Math.ceil((A-g)/m),R=f.length*4-Math.ceil(d*p/8);for(f[f.length-1]<<=8*R,T=0;T<p;T++){if(E===0&&(S=f[x++],E=32),E>=d)v=S>>>E-d&b,E-=d;else{var O=d-E;v=(S&b)<<O&b,S=f[x++],E=32-O,v+=S>>>E}y[T]=v<I?g+v*m:A}return y};return r})(),t=(function(){"use strict";var r={unstuff:function(c,u,f,d,p,g,m,y){var A=(1<<f)-1,b=0,x,T=0,E,v,S,I,R=c.length*4-Math.ceil(f*d/8);if(c[c.length-1]<<=8*R,p)for(x=0;x<d;x++)T===0&&(v=c[b++],T=32),T>=f?(E=v>>>T-f&A,T-=f):(S=f-T,E=(v&A)<<S&A,v=c[b++],T=32-S,E+=v>>>T),u[x]=p[E];else for(I=Math.ceil((y-g)/m),x=0;x<d;x++)T===0&&(v=c[b++],T=32),T>=f?(E=v>>>T-f&A,T-=f):(S=f-T,E=(v&A)<<S&A,v=c[b++],T=32-S,E+=v>>>T),u[x]=E<I?g+E*m:y},unstuffLUT:function(c,u,f,d,p,g){var m=(1<<u)-1,y=0,A=0,b=0,x=0,T=0,E,v=[],S=c.length*4-Math.ceil(u*f/8);c[c.length-1]<<=8*S;var I=Math.ceil((g-d)/p);for(A=0;A<f;A++)x===0&&(E=c[y++],x=32),x>=u?(T=E>>>x-u&m,x-=u):(b=u-x,T=(E&m)<<b&m,E=c[y++],x=32-b,T+=E>>>x),v[A]=T<I?d+T*p:g;return v.unshift(d),v},unstuff2:function(c,u,f,d,p,g,m,y){var A=(1<<f)-1,b=0,x,T=0,E=0,v,S,I;if(p)for(x=0;x<d;x++)T===0&&(S=c[b++],T=32,E=0),T>=f?(v=S>>>E&A,T-=f,E+=f):(I=f-T,v=S>>>E&A,S=c[b++],T=32-I,v|=(S&(1<<I)-1)<<f-I,E=I),u[x]=p[v];else{var R=Math.ceil((y-g)/m);for(x=0;x<d;x++)T===0&&(S=c[b++],T=32,E=0),T>=f?(v=S>>>E&A,T-=f,E+=f):(I=f-T,v=S>>>E&A,S=c[b++],T=32-I,v|=(S&(1<<I)-1)<<f-I,E=I),u[x]=v<R?g+v*m:y}return u},unstuffLUT2:function(c,u,f,d,p,g){var m=(1<<u)-1,y=0,A=0,b=0,x=0,T=0,E=0,v,S=[],I=Math.ceil((g-d)/p);for(A=0;A<f;A++)x===0&&(v=c[y++],x=32,E=0),x>=u?(T=v>>>E&m,x-=u,E+=u):(b=u-x,T=v>>>E&m,v=c[y++],x=32-b,T|=(v&(1<<b)-1)<<u-b,E=b),S[A]=T<I?d+T*p:g;return S.unshift(d),S},originalUnstuff:function(c,u,f,d){var p=(1<<f)-1,g=0,m,y=0,A,b,x,T=c.length*4-Math.ceil(f*d/8);for(c[c.length-1]<<=8*T,m=0;m<d;m++)y===0&&(b=c[g++],y=32),y>=f?(A=b>>>y-f&p,y-=f):(x=f-y,A=(b&p)<<x&p,b=c[g++],y=32-x,A+=b>>>y),u[m]=A;return u},originalUnstuff2:function(c,u,f,d){var p=(1<<f)-1,g=0,m,y=0,A=0,b,x,T;for(m=0;m<d;m++)y===0&&(x=c[g++],y=32,A=0),y>=f?(b=x>>>A&p,y-=f,A+=f):(T=f-y,b=x>>>A&p,x=c[g++],y=32-T,b|=(x&(1<<T)-1)<<f-T,A=T),u[m]=b;return u}},o={HUFFMAN_LUT_BITS_MAX:12,computeChecksumFletcher32:function(c){for(var u=65535,f=65535,d=c.length,p=Math.floor(d/2),g=0;p;){var m=p>=359?359:p;p-=m;do u+=c[g++]<<8,f+=u+=c[g++];while(--m);u=(u&65535)+(u>>>16),f=(f&65535)+(f>>>16)}return d&1&&(f+=u+=c[g]<<8),u=(u&65535)+(u>>>16),f=(f&65535)+(f>>>16),(f<<16|u)>>>0},readHeaderInfo:function(c,u){var f=u.ptr,d=new Uint8Array(c,f,6),p={};if(p.fileIdentifierString=String.fromCharCode.apply(null,d),p.fileIdentifierString.lastIndexOf("Lerc2",0)!==0)throw"Unexpected file identifier string (expect Lerc2 ): "+p.fileIdentifierString;f+=6;var g=new DataView(c,f,8),m=g.getInt32(0,!0);p.fileVersion=m,f+=4,m>=3&&(p.checksum=g.getUint32(4,!0),f+=4),g=new DataView(c,f,12),p.height=g.getUint32(0,!0),p.width=g.getUint32(4,!0),f+=8,m>=4?(p.numDims=g.getUint32(8,!0),f+=4):p.numDims=1,g=new DataView(c,f,40),p.numValidPixel=g.getUint32(0,!0),p.microBlockSize=g.getInt32(4,!0),p.blobSize=g.getInt32(8,!0),p.imageType=g.getInt32(12,!0),p.maxZError=g.getFloat64(16,!0),p.zMin=g.getFloat64(24,!0),p.zMax=g.getFloat64(32,!0),f+=40,u.headerInfo=p,u.ptr=f;var y,A;if(m>=3&&(A=m>=4?52:48,y=this.computeChecksumFletcher32(new Uint8Array(c,f-A,p.blobSize-14)),y!==p.checksum))throw"Checksum failed.";return!0},checkMinMaxRanges:function(c,u){var f=u.headerInfo,d=this.getDataTypeArray(f.imageType),p=f.numDims*this.getDataTypeSize(f.imageType),g=this.readSubArray(c,u.ptr,d,p),m=this.readSubArray(c,u.ptr+p,d,p);u.ptr+=2*p;var y,A=!0;for(y=0;y<f.numDims;y++)if(g[y]!==m[y]){A=!1;break}return f.minValues=g,f.maxValues=m,A},readSubArray:function(c,u,f,d){var p;if(f===Uint8Array)p=new Uint8Array(c,u,d);else{var g=new ArrayBuffer(d),m=new Uint8Array(g);m.set(new Uint8Array(c,u,d)),p=new f(g)}return p},readMask:function(c,u){var f=u.ptr,d=u.headerInfo,p=d.width*d.height,g=d.numValidPixel,m=new DataView(c,f,4),y={};if(y.numBytes=m.getUint32(0,!0),f+=4,(g===0||p===g)&&y.numBytes!==0)throw"invalid mask";var A,b;if(g===0)A=new Uint8Array(Math.ceil(p/8)),y.bitset=A,b=new Uint8Array(p),u.pixels.resultMask=b,f+=y.numBytes;else if(y.numBytes>0){A=new Uint8Array(Math.ceil(p/8)),m=new DataView(c,f,y.numBytes);var x=m.getInt16(0,!0),T=2,E=0,v=0;do{if(x>0)for(;x--;)A[E++]=m.getUint8(T++);else for(v=m.getUint8(T++),x=-x;x--;)A[E++]=v;x=m.getInt16(T,!0),T+=2}while(T<y.numBytes);if(x!==-32768||E<A.length)throw"Unexpected end of mask RLE encoding";b=new Uint8Array(p);var S=0,I=0;for(I=0;I<p;I++)I&7?(S=A[I>>3],S<<=I&7):S=A[I>>3],S&128&&(b[I]=1);u.pixels.resultMask=b,y.bitset=A,f+=y.numBytes}return u.ptr=f,u.mask=y,!0},readDataOneSweep:function(c,u,f){var d=u.ptr,p=u.headerInfo,g=p.numDims,m=p.width*p.height,y=p.imageType,A=p.numValidPixel*o.getDataTypeSize(y)*g,b,x=u.pixels.resultMask;if(f===Uint8Array)b=new Uint8Array(c,d,A);else{var T=new ArrayBuffer(A),E=new Uint8Array(T);E.set(new Uint8Array(c,d,A)),b=new f(T)}if(b.length===m*g)u.pixels.resultPixels=b;else{u.pixels.resultPixels=new f(m*g);var v=0,S=0,I=0,R=0;if(g>1)for(I=0;I<g;I++)for(R=I*m,S=0;S<m;S++)x[S]&&(u.pixels.resultPixels[R+S]=b[v++]);else for(S=0;S<m;S++)x[S]&&(u.pixels.resultPixels[S]=b[v++])}return d+=A,u.ptr=d,!0},readHuffmanTree:function(c,u){var f=this.HUFFMAN_LUT_BITS_MAX,d=new DataView(c,u.ptr,16);u.ptr+=16;var p=d.getInt32(0,!0);if(p<2)throw"unsupported Huffman version";var g=d.getInt32(4,!0),m=d.getInt32(8,!0),y=d.getInt32(12,!0);if(m>=y)return!1;var A=new Uint32Array(y-m);o.decodeBits(c,u,A);var b=[],x,T,E,v;for(x=m;x<y;x++)T=x-(x<g?0:g),b[T]={first:A[x-m],second:null};var S=c.byteLength-u.ptr,I=Math.ceil(S/4),R=new ArrayBuffer(I*4),O=new Uint8Array(R);O.set(new Uint8Array(c,u.ptr,S));var L=new Uint32Array(R),_=0,C,w=0;for(C=L[0],x=m;x<y;x++)T=x-(x<g?0:g),v=b[T].first,v>0&&(b[T].second=C<<_>>>32-v,32-_>=v?(_+=v,_===32&&(_=0,w++,C=L[w])):(_+=v-32,w++,C=L[w],b[T].second|=C>>>32-_));var D=0,N=0,F=new s;for(x=0;x<b.length;x++)b[x]!==void 0&&(D=Math.max(D,b[x].first));D>=f?N=f:N=D,D>=30&&console.log("WARning, large NUM LUT BITS IS "+D);var V=[],B,j,k,G,q,Q;for(x=m;x<y;x++)if(T=x-(x<g?0:g),v=b[T].first,v>0)if(B=[v,T],v<=N)for(j=b[T].second<<N-v,k=1<<N-v,E=0;E<k;E++)V[j|E]=B;else for(j=b[T].second,Q=F,G=v-1;G>=0;G--)q=j>>>G&1,q?(Q.right||(Q.right=new s),Q=Q.right):(Q.left||(Q.left=new s),Q=Q.left),G===0&&!Q.val&&(Q.val=B[1]);return{decodeLut:V,numBitsLUTQick:N,numBitsLUT:D,tree:F,stuffedData:L,srcPtr:w,bitPos:_}},readHuffman:function(c,u,f){var d=u.headerInfo,p=d.numDims,g=u.headerInfo.height,m=u.headerInfo.width,y=m*g,A=this.readHuffmanTree(c,u),b=A.decodeLut,x=A.tree,T=A.stuffedData,E=A.srcPtr,v=A.bitPos,S=A.numBitsLUTQick,I=A.numBitsLUT,R=u.headerInfo.imageType===0?128:0,O,L,_,C=u.pixels.resultMask,w,D,N,F,V,B,j,k=0;v>0&&(E++,v=0);var G=T[E],q=u.encodeMode===1,Q=new f(y*p),W=Q,J;for(J=0;J<d.numDims;J++){if(p>1&&(W=new f(Q.buffer,y*J,y),k=0),u.headerInfo.numValidPixel===m*g)for(B=0,F=0;F<g;F++)for(V=0;V<m;V++,B++){if(L=0,w=G<<v>>>32-S,D=w,32-v<S&&(w|=T[E+1]>>>64-v-S,D=w),b[D])L=b[D][1],v+=b[D][0];else for(w=G<<v>>>32-I,D=w,32-v<I&&(w|=T[E+1]>>>64-v-I,D=w),O=x,j=0;j<I;j++)if(N=w>>>I-j-1&1,O=N?O.right:O.left,!(O.left||O.right)){L=O.val,v=v+j+1;break}v>=32&&(v-=32,E++,G=T[E]),_=L-R,q?(V>0?_+=k:F>0?_+=W[B-m]:_+=k,_&=255,W[B]=_,k=_):W[B]=_}else for(B=0,F=0;F<g;F++)for(V=0;V<m;V++,B++)if(C[B]){if(L=0,w=G<<v>>>32-S,D=w,32-v<S&&(w|=T[E+1]>>>64-v-S,D=w),b[D])L=b[D][1],v+=b[D][0];else for(w=G<<v>>>32-I,D=w,32-v<I&&(w|=T[E+1]>>>64-v-I,D=w),O=x,j=0;j<I;j++)if(N=w>>>I-j-1&1,O=N?O.right:O.left,!(O.left||O.right)){L=O.val,v=v+j+1;break}v>=32&&(v-=32,E++,G=T[E]),_=L-R,q?(V>0&&C[B-1]?_+=k:F>0&&C[B-m]?_+=W[B-m]:_+=k,_&=255,W[B]=_,k=_):W[B]=_}u.ptr=u.ptr+(E+1)*4+(v>0?4:0)}u.pixels.resultPixels=Q},decodeBits:function(c,u,f,d,p){{var g=u.headerInfo,m=g.fileVersion,y=0,A=new DataView(c,u.ptr,5),b=A.getUint8(0);y++;var x=b>>6,T=x===0?4:3-x,E=(b&32)>0,v=b&31,S=0;if(T===1)S=A.getUint8(y),y++;else if(T===2)S=A.getUint16(y,!0),y+=2;else if(T===4)S=A.getUint32(y,!0),y+=4;else throw"Invalid valid pixel count type";var I=2*g.maxZError,R,O,L,_,C,w,D,N,F,V,B=g.numDims>1?g.maxValues[p]:g.zMax;if(E){for(u.counter.lut++,N=A.getUint8(y),F=v,y++,_=Math.ceil((N-1)*v/8),C=Math.ceil(_/4),O=new ArrayBuffer(C*4),L=new Uint8Array(O),u.ptr+=y,L.set(new Uint8Array(c,u.ptr,_)),D=new Uint32Array(O),u.ptr+=_,V=0;N-1>>>V;)V++;_=Math.ceil(S*V/8),C=Math.ceil(_/4),O=new ArrayBuffer(C*4),L=new Uint8Array(O),L.set(new Uint8Array(c,u.ptr,_)),R=new Uint32Array(O),u.ptr+=_,m>=3?w=r.unstuffLUT2(D,v,N-1,d,I,B):w=r.unstuffLUT(D,v,N-1,d,I,B),m>=3?r.unstuff2(R,f,V,S,w):r.unstuff(R,f,V,S,w)}else u.counter.bitstuffer++,V=v,u.ptr+=y,V>0&&(_=Math.ceil(S*V/8),C=Math.ceil(_/4),O=new ArrayBuffer(C*4),L=new Uint8Array(O),L.set(new Uint8Array(c,u.ptr,_)),R=new Uint32Array(O),u.ptr+=_,m>=3?d==null?r.originalUnstuff2(R,f,V,S):r.unstuff2(R,f,V,S,!1,d,I,B):d==null?r.originalUnstuff(R,f,V,S):r.unstuff(R,f,V,S,!1,d,I,B))}},readTiles:function(c,u,f){var d=u.headerInfo,p=d.width,g=d.height,m=d.microBlockSize,y=d.imageType,A=o.getDataTypeSize(y),b=Math.ceil(p/m),x=Math.ceil(g/m);u.pixels.numBlocksY=x,u.pixels.numBlocksX=b,u.pixels.ptr=0;var T=0,E=0,v=0,S=0,I=0,R=0,O=0,L=0,_=0,C=0,w=0,D=0,N=0,F=0,V=0,B=0,j,k,G,q,Q,W,J=new f(m*m),Z=g%m||m,ae=p%m||m,Ae,fe,xe=d.numDims,ge,we=u.pixels.resultMask,ve=u.pixels.resultPixels;for(v=0;v<x;v++)for(I=v!==x-1?m:Z,S=0;S<b;S++)for(R=S!==b-1?m:ae,w=v*p*m+S*m,D=p-R,ge=0;ge<xe;ge++){if(xe>1&&(ve=new f(u.pixels.resultPixels.buffer,p*g*ge*A,p*g)),O=c.byteLength-u.ptr,j=new DataView(c,u.ptr,Math.min(10,O)),k={},B=0,L=j.getUint8(0),B++,_=L>>6&255,C=L>>2&15,C!==(S*m>>3&15))throw"integrity issue";if(W=L&3,W>3)throw u.ptr+=B,"Invalid block encoding ("+W+")";if(W===2){u.counter.constant++,u.ptr+=B;continue}else if(W===0){if(u.counter.uncompressed++,u.ptr+=B,N=I*R*A,F=c.byteLength-u.ptr,N=N<F?N:F,G=new ArrayBuffer(N%A===0?N:N+A-N%A),q=new Uint8Array(G),q.set(new Uint8Array(c,u.ptr,N)),Q=new f(G),V=0,we)for(T=0;T<I;T++){for(E=0;E<R;E++)we[w]&&(ve[w]=Q[V++]),w++;w+=D}else for(T=0;T<I;T++){for(E=0;E<R;E++)ve[w++]=Q[V++];w+=D}u.ptr+=V*A}else if(Ae=o.getDataTypeUsed(y,_),fe=o.getOnePixel(k,B,Ae,j),B+=o.getDataTypeSize(Ae),W===3)if(u.ptr+=B,u.counter.constantoffset++,we)for(T=0;T<I;T++){for(E=0;E<R;E++)we[w]&&(ve[w]=fe),w++;w+=D}else for(T=0;T<I;T++){for(E=0;E<R;E++)ve[w++]=fe;w+=D}else if(u.ptr+=B,o.decodeBits(c,u,J,fe,ge),B=0,we)for(T=0;T<I;T++){for(E=0;E<R;E++)we[w]&&(ve[w]=J[B++]),w++;w+=D}else for(T=0;T<I;T++){for(E=0;E<R;E++)ve[w++]=J[B++];w+=D}}},formatFileInfo:function(c){return{fileIdentifierString:c.headerInfo.fileIdentifierString,fileVersion:c.headerInfo.fileVersion,imageType:c.headerInfo.imageType,height:c.headerInfo.height,width:c.headerInfo.width,numValidPixel:c.headerInfo.numValidPixel,microBlockSize:c.headerInfo.microBlockSize,blobSize:c.headerInfo.blobSize,maxZError:c.headerInfo.maxZError,pixelType:o.getPixelType(c.headerInfo.imageType),eofOffset:c.eofOffset,mask:c.mask?{numBytes:c.mask.numBytes}:null,pixels:{numBlocksX:c.pixels.numBlocksX,numBlocksY:c.pixels.numBlocksY,maxValue:c.headerInfo.zMax,minValue:c.headerInfo.zMin,noDataValue:c.noDataValue}}},constructConstantSurface:function(c){var u=c.headerInfo.zMax,f=c.headerInfo.numDims,d=c.headerInfo.height*c.headerInfo.width,p=d*f,g=0,m=0,y=0,A=c.pixels.resultMask;if(A)if(f>1)for(g=0;g<f;g++)for(y=g*d,m=0;m<d;m++)A[m]&&(c.pixels.resultPixels[y+m]=u);else for(m=0;m<d;m++)A[m]&&(c.pixels.resultPixels[m]=u);else if(c.pixels.resultPixels.fill)c.pixels.resultPixels.fill(u);else for(m=0;m<p;m++)c.pixels.resultPixels[m]=u},getDataTypeArray:function(c){var u;switch(c){case 0:u=Int8Array;break;case 1:u=Uint8Array;break;case 2:u=Int16Array;break;case 3:u=Uint16Array;break;case 4:u=Int32Array;break;case 5:u=Uint32Array;break;case 6:u=Float32Array;break;case 7:u=Float64Array;break;default:u=Float32Array}return u},getPixelType:function(c){var u;switch(c){case 0:u="S8";break;case 1:u="U8";break;case 2:u="S16";break;case 3:u="U16";break;case 4:u="S32";break;case 5:u="U32";break;case 6:u="F32";break;case 7:u="F64";break;default:u="F32"}return u},isValidPixelValue:function(c,u){if(u==null)return!1;var f;switch(c){case 0:f=u>=-128&&u<=127;break;case 1:f=u>=0&&u<=255;break;case 2:f=u>=-32768&&u<=32767;break;case 3:f=u>=0&&u<=65536;break;case 4:f=u>=-2147483648&&u<=2147483647;break;case 5:f=u>=0&&u<=4294967296;break;case 6:f=u>=-34027999387901484e22&&u<=34027999387901484e22;break;case 7:f=u>=5e-324&&u<=17976931348623157e292;break;default:f=!1}return f},getDataTypeSize:function(c){var u=0;switch(c){case 0:case 1:u=1;break;case 2:case 3:u=2;break;case 4:case 5:case 6:u=4;break;case 7:u=8;break;default:u=c}return u},getDataTypeUsed:function(c,u){var f=c;switch(c){case 2:case 4:f=c-u;break;case 3:case 5:f=c-2*u;break;case 6:u===0?f=c:u===1?f=2:f=1;break;case 7:u===0?f=c:f=c-2*u+1;break;default:f=c;break}return f},getOnePixel:function(c,u,f,d){var p=0;switch(f){case 0:p=d.getInt8(u);break;case 1:p=d.getUint8(u);break;case 2:p=d.getInt16(u,!0);break;case 3:p=d.getUint16(u,!0);break;case 4:p=d.getInt32(u,!0);break;case 5:p=d.getUInt32(u,!0);break;case 6:p=d.getFloat32(u,!0);break;case 7:p=d.getFloat64(u,!0);break;default:throw"the decoder does not understand this pixel type"}return p}},s=function(c,u,f){this.val=c,this.left=u,this.right=f},a={decode:function(c,u){u=u||{};var f=u.noDataValue,d=0,p={};if(p.ptr=u.inputOffset||0,p.pixels={},!!o.readHeaderInfo(c,p)){var g=p.headerInfo,m=g.fileVersion,y=o.getDataTypeArray(g.imageType);o.readMask(c,p),g.numValidPixel!==g.width*g.height&&!p.pixels.resultMask&&(p.pixels.resultMask=u.maskData);var A=g.width*g.height;if(p.pixels.resultPixels=new y(A*g.numDims),p.counter={onesweep:0,uncompressed:0,lut:0,bitstuffer:0,constant:0,constantoffset:0},g.numValidPixel!==0)if(g.zMax===g.zMin)o.constructConstantSurface(p);else if(m>=4&&o.checkMinMaxRanges(c,p))o.constructConstantSurface(p);else{var b=new DataView(c,p.ptr,2),x=b.getUint8(0);if(p.ptr++,x)o.readDataOneSweep(c,p,y);else if(m>1&&g.imageType<=1&&Math.abs(g.maxZError-.5)<1e-5){var T=b.getUint8(1);if(p.ptr++,p.encodeMode=T,T>2||m<4&&T>1)throw"Invalid Huffman flag "+T;T?o.readHuffman(c,p,y):o.readTiles(c,p,y)}else o.readTiles(c,p,y)}p.eofOffset=p.ptr;var E;u.inputOffset?(E=p.headerInfo.blobSize+u.inputOffset-p.ptr,Math.abs(E)>=1&&(p.eofOffset=u.inputOffset+p.headerInfo.blobSize)):(E=p.headerInfo.blobSize-p.ptr,Math.abs(E)>=1&&(p.eofOffset=p.headerInfo.blobSize));var v={width:g.width,height:g.height,pixelData:p.pixels.resultPixels,minValue:g.zMin,maxValue:g.zMax,validPixelCount:g.numValidPixel,dimCount:g.numDims,dimStats:{minValues:g.minValues,maxValues:g.maxValues},maskData:p.pixels.resultMask};if(p.pixels.resultMask&&o.isValidPixelValue(g.imageType,f)){var S=p.pixels.resultMask;for(d=0;d<A;d++)S[d]||(v.pixelData[d]=f);v.noDataValue=f}return p.noDataValue=f,u.returnFileInfo&&(v.fileInfo=o.formatFileInfo(p)),v}},getBandCount:function(c){var u=0,f=0,d={};for(d.ptr=0,d.pixels={};f<c.byteLength-58;)o.readHeaderInfo(c,d),f+=d.headerInfo.blobSize,u++,d.ptr=f;return u}};return a})(),n=(function(){var r=new ArrayBuffer(4),o=new Uint8Array(r),s=new Uint32Array(r);return s[0]=1,o[0]===1})(),i={decode:function(r,o){if(!n)throw"Big endian system is not supported.";o=o||{};var s=o.inputOffset||0,a=new Uint8Array(r,s,10),c=String.fromCharCode.apply(null,a),u,f;if(c.trim()==="CntZImage")u=e,f=1;else if(c.substring(0,5)==="Lerc2")u=t,f=2;else throw"Unexpected file identifier string: "+c;for(var d=0,p=r.byteLength-10,g,m=[],y,A,b={width:0,height:0,pixels:[],pixelType:o.pixelType,mask:null,statistics:[]};s<p;){var x=u.decode(r,{inputOffset:s,encodedMaskData:g,maskData:A,returnMask:d===0,returnEncodedMask:d===0,returnFileInfo:!0,pixelType:o.pixelType||null,noDataValue:o.noDataValue||null});s=x.fileInfo.eofOffset,d===0&&(g=x.encodedMaskData,A=x.maskData,b.width=x.width,b.height=x.height,b.dimCount=x.dimCount||1,b.pixelType=x.pixelType||x.fileInfo.pixelType,b.mask=x.maskData),f>1&&x.fileInfo.mask&&x.fileInfo.mask.numBytes>0&&m.push(x.maskData),d++,b.pixels.push(x.pixelData),b.statistics.push({minValue:x.minValue,maxValue:x.maxValue,noDataValue:x.noDataValue,dimStats:x.dimStats})}var T,E,v;if(f>1&&m.length>1){for(v=b.width*b.height,b.bandMasks=m,A=new Uint8Array(v),A.set(m[0]),T=1;T<m.length;T++)for(y=m[T],E=0;E<v;E++)A[E]=A[E]&y[E];b.maskData=A}return b}};typeof define=="function"&&define.amd?define([],function(){return i}):typeof F7<"u"&&F7.exports?F7.exports=i:this.Lerc=i})()});var _ke=uh((IGr,gke)=>{gke.exports={webm:"data:video/webm;base64,GkXfowEAAAAAAAAfQoaBAUL3gQFC8oEEQvOBCEKChHdlYm1Ch4EEQoWBAhhTgGcBAAAAAAAVkhFNm3RALE27i1OrhBVJqWZTrIHfTbuMU6uEFlSua1OsggEwTbuMU6uEHFO7a1OsghV17AEAAAAAAACkAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAVSalmAQAAAAAAAEUq17GDD0JATYCNTGF2ZjU1LjMzLjEwMFdBjUxhdmY1NS4zMy4xMDBzpJBlrrXf3DCDVB8Kc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ZXneZ4oiqJpqirXFUXTNE1VVV2yLIqmaZqq6rowTdNUVdd1XZimaaqq67oubFtVVdV1ZRm2raqq6rqyDFzXdWXZloEsu67s2rIAAPAEBwCgAhtWRzgpGgssNGQlAJABAEAYg5BCCCFlEEIKIYSUUggJAAAYcAAACDChDBQashIASAUAAIyx1lprrbXWQGettdZaa62AzFprrbXWWmuttdZaa6211lJrrbXWWmuttdZaa6211lprrbXWWmuttdZaa6211lprrbXWWmuttdZaa6211lprrbXWWmstpZRSSimllFJKKaWUUkoppZRSSgUA+lU4APg/2LA6wknRWGChISsBgHAAAMAYpRhzDEIppVQIMeacdFRai7FCiDHnJKTUWmzFc85BKCGV1mIsnnMOQikpxVZjUSmEUlJKLbZYi0qho5JSSq3VWIwxqaTWWoutxmKMSSm01FqLMRYjbE2ptdhqq7EYY2sqLbQYY4zFCF9kbC2m2moNxggjWywt1VprMMYY3VuLpbaaizE++NpSLDHWXAAAd4MDAESCjTOsJJ0VjgYXGrISAAgJACAQUooxxhhzzjnnpFKMOeaccw5CCKFUijHGnHMOQgghlIwx5pxzEEIIIYRSSsaccxBCCCGEkFLqnHMQQgghhBBKKZ1zDkIIIYQQQimlgxBCCCGEEEoopaQUQgghhBBCCKmklEIIIYRSQighlZRSCCGEEEIpJaSUUgohhFJCCKGElFJKKYUQQgillJJSSimlEkoJJYQSUikppRRKCCGUUkpKKaVUSgmhhBJKKSWllFJKIYQQSikFAAAcOAAABBhBJxlVFmGjCRcegEJDVgIAZAAAkKKUUiktRYIipRikGEtGFXNQWoqocgxSzalSziDmJJaIMYSUk1Qy5hRCDELqHHVMKQYtlRhCxhik2HJLoXMOAAAAQQCAgJAAAAMEBTMAwOAA4XMQdAIERxsAgCBEZohEw0JweFAJEBFTAUBigkIuAFRYXKRdXECXAS7o4q4DIQQhCEEsDqCABByccMMTb3jCDU7QKSp1IAAAAAAADADwAACQXAAREdHMYWRobHB0eHyAhIiMkAgAAAAAABcAfAAAJCVAREQ0cxgZGhscHR4fICEiI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XRvbwAAAB1kYXRhAAAAAQAAAABMYXZmNTUuMzMuMTAw"}});var Ake=uh((PGr,yke)=>{var{webm:KHt,mp4:$Ht}=_ke(),kae=()=>typeof navigator<"u"&&parseFloat((""+(/CPU.*OS ([0-9_]{3,4})[0-9_]{0,1}|(CPU like).*AppleWebKit.*Mobile/i.exec(navigator.userAgent)||[0,""])[1]).replace("undefined","3_2").replace("_",".").replace("_",""))<10&&!window.MSStream,Uae=()=>"wakeLock"in navigator,zae=class{constructor(){if(this.enabled=!1,Uae()){this._wakeLock=null;let t=()=>{this._wakeLock!==null&&document.visibilityState==="visible"&&this.enable()};document.addEventListener("visibilitychange",t),document.addEventListener("fullscreenchange",t)}else kae()?this.noSleepTimer=null:(this.noSleepVideo=document.createElement("video"),this.noSleepVideo.setAttribute("title","No Sleep"),this.noSleepVideo.setAttribute("playsinline",""),this._addSourceToVideo(this.noSleepVideo,"webm",KHt),this._addSourceToVideo(this.noSleepVideo,"mp4",$Ht),this.noSleepVideo.addEventListener("loadedmetadata",()=>{this.noSleepVideo.duration<=1?this.noSleepVideo.setAttribute("loop",""):this.noSleepVideo.addEventListener("timeupdate",()=>{this.noSleepVideo.currentTime>.5&&(this.noSleepVideo.currentTime=Math.random())})}))}_addSourceToVideo(t,n,i){var r=document.createElement("source");r.src=i,r.type=`video/${n}`,t.appendChild(r)}get isEnabled(){return this.enabled}enable(){return Uae()?navigator.wakeLock.request("screen").then(t=>{this._wakeLock=t,this.enabled=!0,console.log("Wake Lock active."),this._wakeLock.addEventListener("release",()=>{console.log("Wake Lock released.")})}).catch(t=>{throw this.enabled=!1,console.error(`${t.name}, ${t.message}`),t}):kae()?(this.disable(),console.warn(` NoSleep enabled for older iOS devices. This can interrupt active or long-running network requests from completing successfully. See https://github.com/richtr/NoSleep.js/issues/15 for more details. `),this.noSleepTimer=window.setInterval(()=>{document.hidden||(window.location.href=window.location.href.split("#")[0],window.setTimeout(window.stop,0))},15e3),this.enabled=!0,Promise.resolve()):this.noSleepVideo.play().then(n=>(this.enabled=!0,n)).catch(n=>{throw this.enabled=!1,n})}disable(){Uae()?(this._wakeLock&&this._wakeLock.release(),this._wakeLock=null):kae()?this.noSleepTimer&&(console.warn(` NoSleep now disabled for older iOS devices. - `),window.clearInterval(this.noSleepTimer),this.noSleepTimer=null):this.noSleepVideo.pause(),this.enabled=!1}};_ke.exports=zae});function Vke(e){return e!=null}var l=Vke;function mb(e){this.name="DeveloperError",this.message=e;let t;try{throw new Error}catch(n){t=n.stack}this.stack=t}l(Object.create)&&(mb.prototype=Object.create(Error.prototype),mb.prototype.constructor=mb);mb.prototype.toString=function(){let e=`${this.name}: ${this.message}`;return l(this.stack)&&(e+=` -${this.stack.toString()}`),e};mb.throwInstantiationError=function(){throw new mb("This function defines an interface and should not be called directly.")};var pe=mb;var ia={};ia.typeOf={};function jke(e){return`${e} is required, actual value was undefined`}function gE(e,t,n){return`Expected ${n} to be typeof ${t}, actual typeof was ${e}`}ia.defined=function(e,t){if(!l(t))throw new pe(jke(e))};ia.typeOf.func=function(e,t){if(typeof t!="function")throw new pe(gE(typeof t,"function",e))};ia.typeOf.string=function(e,t){if(typeof t!="string")throw new pe(gE(typeof t,"string",e))};ia.typeOf.number=function(e,t){if(typeof t!="number")throw new pe(gE(typeof t,"number",e))};ia.typeOf.number.lessThan=function(e,t,n){if(ia.typeOf.number(e,t),t>=n)throw new pe(`Expected ${e} to be less than ${n}, actual value was ${t}`)};ia.typeOf.number.lessThanOrEquals=function(e,t,n){if(ia.typeOf.number(e,t),t>n)throw new pe(`Expected ${e} to be less than or equal to ${n}, actual value was ${t}`)};ia.typeOf.number.greaterThan=function(e,t,n){if(ia.typeOf.number(e,t),t<=n)throw new pe(`Expected ${e} to be greater than ${n}, actual value was ${t}`)};ia.typeOf.number.greaterThanOrEquals=function(e,t,n){if(ia.typeOf.number(e,t),t<n)throw new pe(`Expected ${e} to be greater than or equal to ${n}, actual value was ${t}`)};ia.typeOf.object=function(e,t){if(typeof t!="object")throw new pe(gE(typeof t,"object",e))};ia.typeOf.bool=function(e,t){if(typeof t!="boolean")throw new pe(gE(typeof t,"boolean",e))};ia.typeOf.bigint=function(e,t){if(typeof t!="bigint")throw new pe(gE(typeof t,"bigint",e))};ia.typeOf.number.equals=function(e,t,n,i){if(ia.typeOf.number(e,n),ia.typeOf.number(t,i),n!==i)throw new pe(`${e} must be equal to ${t}, the actual values are ${n} and ${i}`)};var qr=ia;var lq=js(rN(),1);var _t={};_t.EPSILON1=.1;_t.EPSILON2=.01;_t.EPSILON3=.001;_t.EPSILON4=1e-4;_t.EPSILON5=1e-5;_t.EPSILON6=1e-6;_t.EPSILON7=1e-7;_t.EPSILON8=1e-8;_t.EPSILON9=1e-9;_t.EPSILON10=1e-10;_t.EPSILON11=1e-11;_t.EPSILON12=1e-12;_t.EPSILON13=1e-13;_t.EPSILON14=1e-14;_t.EPSILON15=1e-15;_t.EPSILON16=1e-16;_t.EPSILON17=1e-17;_t.EPSILON18=1e-18;_t.EPSILON19=1e-19;_t.EPSILON20=1e-20;_t.EPSILON21=1e-21;_t.GRAVITATIONALPARAMETER=3986004418e5;_t.SOLAR_RADIUS=6955e5;_t.LUNAR_RADIUS=1737400;_t.SIXTY_FOUR_KILOBYTES=64*1024;_t.FOUR_GIGABYTES=4*1024*1024*1024;_t.sign=Math.sign??function(t){return t=+t,t===0||t!==t?t:t>0?1:-1};_t.signNotZero=function(e){return e<0?-1:1};_t.toSNorm=function(e,t){return t=t??255,Math.round((_t.clamp(e,-1,1)*.5+.5)*t)};_t.fromSNorm=function(e,t){return t=t??255,_t.clamp(e,0,t)/t*2-1};_t.normalize=function(e,t,n){return n=Math.max(n-t,0),n===0?0:_t.clamp((e-t)/n,0,1)};_t.sinh=Math.sinh??function(t){return(Math.exp(t)-Math.exp(-t))/2};_t.cosh=Math.cosh??function(t){return(Math.exp(t)+Math.exp(-t))/2};_t.lerp=function(e,t,n){return(1-n)*e+n*t};_t.smoothDamp=function(e,t,n,i=0,r=Number.POSITIVE_INFINITY,o=1e-4,s={}){o=Math.max(1e-4,o);let a=2/o,c=a*i,u=1/(1+c+.48*c*c+.235*c*c*c),f=r*o,d=e-t;d=_t.clamp(d,-f,f);let p=e-d,g=(n+a*d)*i;return n=(n-a*g)*u,s.value=p+(d+g)*u,s.velocity=n,s};_t.PI=Math.PI;_t.ONE_OVER_PI=1/Math.PI;_t.PI_OVER_TWO=Math.PI/2;_t.PI_OVER_THREE=Math.PI/3;_t.PI_OVER_FOUR=Math.PI/4;_t.PI_OVER_SIX=Math.PI/6;_t.THREE_PI_OVER_TWO=3*Math.PI/2;_t.TWO_PI=2*Math.PI;_t.ONE_OVER_TWO_PI=1/(2*Math.PI);_t.RADIANS_PER_DEGREE=Math.PI/180;_t.DEGREES_PER_RADIAN=180/Math.PI;_t.RADIANS_PER_ARCSECOND=_t.RADIANS_PER_DEGREE/3600;_t.toRadians=function(e){return e*_t.RADIANS_PER_DEGREE};_t.toDegrees=function(e){return e*_t.DEGREES_PER_RADIAN};_t.convertLongitudeRange=function(e){let t=_t.TWO_PI,n=e-Math.floor(e/t)*t;return n<-Math.PI?n+t:n>=Math.PI?n-t:n};_t.clampToLatitudeRange=function(e){return _t.clamp(e,-1*_t.PI_OVER_TWO,_t.PI_OVER_TWO)};_t.negativePiToPi=function(e){return e>=-_t.PI&&e<=_t.PI?e:_t.zeroToTwoPi(e+_t.PI)-_t.PI};_t.zeroToTwoPi=function(e){if(e>=0&&e<=_t.TWO_PI)return e;let t=_t.mod(e,_t.TWO_PI);return Math.abs(t)<_t.EPSILON14&&Math.abs(e)>_t.EPSILON14?_t.TWO_PI:t};_t.mod=function(e,t){return _t.sign(e)===_t.sign(t)&&Math.abs(e)<Math.abs(t)?e:(e%t+t)%t};_t.equalsEpsilon=function(e,t,n,i){n=n??0,i=i??n;let r=Math.abs(e-t);return r<=i||r<=n*Math.max(Math.abs(e),Math.abs(t))};_t.lessThan=function(e,t,n){return e-t<-n};_t.lessThanOrEquals=function(e,t,n){return e-t<n};_t.greaterThan=function(e,t,n){return e-t>n};_t.greaterThanOrEquals=function(e,t,n){return e-t>-n};var oN=[1];_t.factorial=function(e){let t=oN.length;if(e>=t){let n=oN[t-1];for(let i=t;i<=e;i++){let r=n*i;oN.push(r),n=r}}return oN[e]};_t.incrementWrap=function(e,t,n){return n=n??0,++e,e>t&&(e=n),e};_t.isPowerOfTwo=function(e){return e!==0&&(e&e-1)===0};_t.nextPowerOfTwo=function(e){return--e,e|=e>>1,e|=e>>2,e|=e>>4,e|=e>>8,e|=e>>16,++e,e};_t.previousPowerOfTwo=function(e){return e|=e>>1,e|=e>>2,e|=e>>4,e|=e>>8,e|=e>>16,e|=e>>32,e=(e>>>0)-(e>>>1),e};_t.clamp=function(e,t,n){return e<t?t:e>n?n:e};var Wae=new lq.default;_t.setRandomNumberSeed=function(e){Wae=new lq.default(e)};_t.nextRandomNumber=function(){return Wae.random()};_t.randomBetween=function(e,t){return _t.nextRandomNumber()*(t-e)+e};_t.acosClamped=function(e){return Math.acos(_t.clamp(e,-1,1))};_t.asinClamped=function(e){return Math.asin(_t.clamp(e,-1,1))};_t.chordLength=function(e,t){return 2*t*Math.sin(e*.5)};_t.logBase=function(e,t){return Math.log(e)/Math.log(t)};_t.cbrt=Math.cbrt??function(t){let n=Math.pow(Math.abs(t),.3333333333333333);return t<0?-n:n};_t.log2=Math.log2??function(t){return Math.log(t)*Math.LOG2E};_t.fog=function(e,t){let n=e*t;return 1-Math.exp(-(n*n))};_t.fastApproximateAtan=function(e){return e*(-.1784*Math.abs(e)-.0663*e*e+1.0301)};_t.fastApproximateAtan2=function(e,t){let n,i=Math.abs(e);n=Math.abs(t);let r=Math.max(i,n);n=Math.min(i,n);let o=n/r;return i=_t.fastApproximateAtan(o),i=Math.abs(t)>Math.abs(e)?_t.PI_OVER_TWO-i:i,i=e<0?_t.PI-i:i,i=t<0?-i:i,i};var P=_t;var lo=class e{constructor(t,n,i){this.x=t??0,this.y=n??0,this.z=i??0}static fromSpherical(t,n){l(n)||(n=new e);let i=t.clock,r=t.cone,o=t.magnitude??1,s=o*Math.sin(r);return n.x=s*Math.cos(i),n.y=s*Math.sin(i),n.z=o*Math.cos(r),n}static fromElements(t,n,i,r){return l(r)?(r.x=t,r.y=n,r.z=i,r):new e(t,n,i)}static clone(t,n){if(l(t))return l(n)?(n.x=t.x,n.y=t.y,n.z=t.z,n):new e(t.x,t.y,t.z)}static pack(t,n,i){return i=i??0,n[i++]=t.x,n[i++]=t.y,n[i]=t.z,n}static unpack(t,n,i){return n=n??0,l(i)||(i=new e),i.x=t[n++],i.y=t[n++],i.z=t[n],i}static packArray(t,n){let i=t.length,r=i*3;l(n)?!Array.isArray(n)&&n.length!==r||n.length!==r&&(n.length=r):n=new Array(r);for(let o=0;o<i;++o)e.pack(t[o],n,o*3);return n}static unpackArray(t,n){let i=t.length;l(n)?n.length=i/3:n=new Array(i/3);for(let r=0;r<i;r+=3){let o=r/3;n[o]=e.unpack(t,r,n[o])}return n}static maximumComponent(t){return Math.max(t.x,t.y,t.z)}static minimumComponent(t){return Math.min(t.x,t.y,t.z)}static minimumByComponent(t,n,i){return i.x=Math.min(t.x,n.x),i.y=Math.min(t.y,n.y),i.z=Math.min(t.z,n.z),i}static maximumByComponent(t,n,i){return i.x=Math.max(t.x,n.x),i.y=Math.max(t.y,n.y),i.z=Math.max(t.z,n.z),i}static clamp(t,n,i,r){let o=P.clamp(t.x,n.x,i.x),s=P.clamp(t.y,n.y,i.y),a=P.clamp(t.z,n.z,i.z);return r.x=o,r.y=s,r.z=a,r}static magnitudeSquared(t){return t.x*t.x+t.y*t.y+t.z*t.z}static magnitude(t){return Math.sqrt(e.magnitudeSquared(t))}static distance(t,n){return e.subtract(t,n,sN),e.magnitude(sN)}static distanceSquared(t,n){return e.subtract(t,n,sN),e.magnitudeSquared(sN)}static normalize(t,n){let i=e.magnitude(t);return n.x=t.x/i,n.y=t.y/i,n.z=t.z/i,n}static dot(t,n){return t.x*n.x+t.y*n.y+t.z*n.z}static multiplyComponents(t,n,i){return i.x=t.x*n.x,i.y=t.y*n.y,i.z=t.z*n.z,i}static divideComponents(t,n,i){return i.x=t.x/n.x,i.y=t.y/n.y,i.z=t.z/n.z,i}static add(t,n,i){return i.x=t.x+n.x,i.y=t.y+n.y,i.z=t.z+n.z,i}static subtract(t,n,i){return i.x=t.x-n.x,i.y=t.y-n.y,i.z=t.z-n.z,i}static multiplyByScalar(t,n,i){return i.x=t.x*n,i.y=t.y*n,i.z=t.z*n,i}static divideByScalar(t,n,i){return i.x=t.x/n,i.y=t.y/n,i.z=t.z/n,i}static negate(t,n){return n.x=-t.x,n.y=-t.y,n.z=-t.z,n}static abs(t,n){return n.x=Math.abs(t.x),n.y=Math.abs(t.y),n.z=Math.abs(t.z),n}static lerp(t,n,i,r){return e.multiplyByScalar(n,i,qae),r=e.multiplyByScalar(t,1-i,r),e.add(qae,r,r)}static angleBetween(t,n){e.normalize(t,aN),e.normalize(n,uq);let i=e.dot(aN,uq),r=e.magnitude(e.cross(aN,uq,aN));return Math.atan2(r,i)}static mostOrthogonalAxis(t,n){let i=e.normalize(t,Hke);return e.abs(i,i),i.x<=i.y?i.x<=i.z?n=e.clone(e.UNIT_X,n):n=e.clone(e.UNIT_Z,n):i.y<=i.z?n=e.clone(e.UNIT_Y,n):n=e.clone(e.UNIT_Z,n),n}static projectVector(t,n,i){let r=e.dot(t,n)/e.dot(n,n);return e.multiplyByScalar(n,r,i)}static equals(t,n){return t===n||l(t)&&l(n)&&t.x===n.x&&t.y===n.y&&t.z===n.z}static equalsArray(t,n,i){return t.x===n[i]&&t.y===n[i+1]&&t.z===n[i+2]}static equalsEpsilon(t,n,i,r){return t===n||l(t)&&l(n)&&P.equalsEpsilon(t.x,n.x,i,r)&&P.equalsEpsilon(t.y,n.y,i,r)&&P.equalsEpsilon(t.z,n.z,i,r)}static cross(t,n,i){let r=t.x,o=t.y,s=t.z,a=n.x,c=n.y,u=n.z,f=o*u-s*c,d=s*a-r*u,p=r*c-o*a;return i.x=f,i.y=d,i.z=p,i}static midpoint(t,n,i){return i.x=(t.x+n.x)*.5,i.y=(t.y+n.y)*.5,i.z=(t.z+n.z)*.5,i}static fromDegrees(t,n,i,r,o){return t=P.toRadians(t),n=P.toRadians(n),e.fromRadians(t,n,i,r,o)}static fromRadians(t,n,i,r,o){i=i??0;let s=l(r)?r.radiiSquared:e._ellipsoidRadiiSquared,a=Math.cos(n);Xf.x=a*Math.cos(t),Xf.y=a*Math.sin(t),Xf.z=Math.sin(n),Xf=e.normalize(Xf,Xf),e.multiplyComponents(s,Xf,_E);let c=Math.sqrt(e.dot(Xf,_E));return _E=e.divideByScalar(_E,c,_E),Xf=e.multiplyByScalar(Xf,i,Xf),l(o)||(o=new e),e.add(_E,Xf,o)}static fromDegreesArray(t,n,i){let r=t.length;l(i)?i.length=r/2:i=new Array(r/2);for(let o=0;o<r;o+=2){let s=t[o],a=t[o+1],c=o/2;i[c]=e.fromDegrees(s,a,0,n,i[c])}return i}static fromRadiansArray(t,n,i){let r=t.length;l(i)?i.length=r/2:i=new Array(r/2);for(let o=0;o<r;o+=2){let s=t[o],a=t[o+1],c=o/2;i[c]=e.fromRadians(s,a,0,n,i[c])}return i}static fromDegreesArrayHeights(t,n,i){let r=t.length;l(i)?i.length=r/3:i=new Array(r/3);for(let o=0;o<r;o+=3){let s=t[o],a=t[o+1],c=t[o+2],u=o/3;i[u]=e.fromDegrees(s,a,c,n,i[u])}return i}static fromRadiansArrayHeights(t,n,i){let r=t.length;l(i)?i.length=r/3:i=new Array(r/3);for(let o=0;o<r;o+=3){let s=t[o],a=t[o+1],c=t[o+2],u=o/3;i[u]=e.fromRadians(s,a,c,n,i[u])}return i}clone(t){return e.clone(this,t)}equals(t){return e.equals(this,t)}equalsEpsilon(t,n,i){return e.equalsEpsilon(this,t,n,i)}toString(){return`(${this.x}, ${this.y}, ${this.z})`}};lo.fromCartesian4=lo.clone;lo.packedLength=3;lo.fromArray=lo.unpack;var sN=new lo,qae=new lo,aN=new lo,uq=new lo,Hke=new lo,Xf=new lo,_E=new lo;lo._ellipsoidRadiiSquared=new lo(6378137*6378137,6378137*6378137,6356752314245179e-9*6356752314245179e-9);lo.ZERO=Object.freeze(new lo(0,0,0));lo.ONE=Object.freeze(new lo(1,1,1));lo.UNIT_X=Object.freeze(new lo(1,0,0));lo.UNIT_Y=Object.freeze(new lo(0,1,0));lo.UNIT_Z=Object.freeze(new lo(0,0,1));var h=lo;var Hs=class e{constructor(t,n,i,r){this.x=t??0,this.y=n??0,this.z=i??0,this.w=r??0}static fromElements(t,n,i,r,o){return l(o)?(o.x=t,o.y=n,o.z=i,o.w=r,o):new e(t,n,i,r)}static fromColor(t,n){return l(n)?(n.x=t.red,n.y=t.green,n.z=t.blue,n.w=t.alpha,n):new e(t.red,t.green,t.blue,t.alpha)}static clone(t,n){if(l(t))return l(n)?(n.x=t.x,n.y=t.y,n.z=t.z,n.w=t.w,n):new e(t.x,t.y,t.z,t.w)}static pack(t,n,i){return i=i??0,n[i++]=t.x,n[i++]=t.y,n[i++]=t.z,n[i]=t.w,n}static unpack(t,n,i){return n=n??0,l(i)||(i=new e),i.x=t[n++],i.y=t[n++],i.z=t[n++],i.w=t[n],i}static packArray(t,n){let i=t.length,r=i*4;l(n)?!Array.isArray(n)&&n.length!==r||n.length!==r&&(n.length=r):n=new Array(r);for(let o=0;o<i;++o)e.pack(t[o],n,o*4);return n}static unpackArray(t,n){let i=t.length;l(n)?n.length=i/4:n=new Array(i/4);for(let r=0;r<i;r+=4){let o=r/4;n[o]=e.unpack(t,r,n[o])}return n}static maximumComponent(t){return Math.max(t.x,t.y,t.z,t.w)}static minimumComponent(t){return Math.min(t.x,t.y,t.z,t.w)}static minimumByComponent(t,n,i){return i.x=Math.min(t.x,n.x),i.y=Math.min(t.y,n.y),i.z=Math.min(t.z,n.z),i.w=Math.min(t.w,n.w),i}static maximumByComponent(t,n,i){return i.x=Math.max(t.x,n.x),i.y=Math.max(t.y,n.y),i.z=Math.max(t.z,n.z),i.w=Math.max(t.w,n.w),i}static clamp(t,n,i,r){let o=P.clamp(t.x,n.x,i.x),s=P.clamp(t.y,n.y,i.y),a=P.clamp(t.z,n.z,i.z),c=P.clamp(t.w,n.w,i.w);return r.x=o,r.y=s,r.z=a,r.w=c,r}static magnitudeSquared(t){return t.x*t.x+t.y*t.y+t.z*t.z+t.w*t.w}static magnitude(t){return Math.sqrt(e.magnitudeSquared(t))}static distance(t,n){return e.subtract(t,n,cN),e.magnitude(cN)}static distanceSquared(t,n){return e.subtract(t,n,cN),e.magnitudeSquared(cN)}static normalize(t,n){let i=e.magnitude(t);return n.x=t.x/i,n.y=t.y/i,n.z=t.z/i,n.w=t.w/i,n}static dot(t,n){return t.x*n.x+t.y*n.y+t.z*n.z+t.w*n.w}static multiplyComponents(t,n,i){return i.x=t.x*n.x,i.y=t.y*n.y,i.z=t.z*n.z,i.w=t.w*n.w,i}static divideComponents(t,n,i){return i.x=t.x/n.x,i.y=t.y/n.y,i.z=t.z/n.z,i.w=t.w/n.w,i}static add(t,n,i){return i.x=t.x+n.x,i.y=t.y+n.y,i.z=t.z+n.z,i.w=t.w+n.w,i}static subtract(t,n,i){return i.x=t.x-n.x,i.y=t.y-n.y,i.z=t.z-n.z,i.w=t.w-n.w,i}static multiplyByScalar(t,n,i){return i.x=t.x*n,i.y=t.y*n,i.z=t.z*n,i.w=t.w*n,i}static divideByScalar(t,n,i){return i.x=t.x/n,i.y=t.y/n,i.z=t.z/n,i.w=t.w/n,i}static negate(t,n){return n.x=-t.x,n.y=-t.y,n.z=-t.z,n.w=-t.w,n}static abs(t,n){return n.x=Math.abs(t.x),n.y=Math.abs(t.y),n.z=Math.abs(t.z),n.w=Math.abs(t.w),n}static lerp(t,n,i,r){return e.multiplyByScalar(n,i,Yae),r=e.multiplyByScalar(t,1-i,r),e.add(Yae,r,r)}static mostOrthogonalAxis(t,n){let i=e.normalize(t,Gke);return e.abs(i,i),i.x<=i.y?i.x<=i.z?i.x<=i.w?n=e.clone(e.UNIT_X,n):n=e.clone(e.UNIT_W,n):i.z<=i.w?n=e.clone(e.UNIT_Z,n):n=e.clone(e.UNIT_W,n):i.y<=i.z?i.y<=i.w?n=e.clone(e.UNIT_Y,n):n=e.clone(e.UNIT_W,n):i.z<=i.w?n=e.clone(e.UNIT_Z,n):n=e.clone(e.UNIT_W,n),n}static equals(t,n){return t===n||l(t)&&l(n)&&t.x===n.x&&t.y===n.y&&t.z===n.z&&t.w===n.w}static equalsArray(t,n,i){return t.x===n[i]&&t.y===n[i+1]&&t.z===n[i+2]&&t.w===n[i+3]}static equalsEpsilon(t,n,i,r){return t===n||l(t)&&l(n)&&P.equalsEpsilon(t.x,n.x,i,r)&&P.equalsEpsilon(t.y,n.y,i,r)&&P.equalsEpsilon(t.z,n.z,i,r)&&P.equalsEpsilon(t.w,n.w,i,r)}clone(t){return e.clone(this,t)}equals(t){return e.equals(this,t)}equalsEpsilon(t,n,i){return e.equalsEpsilon(this,t,n,i)}toString(){return`(${this.x}, ${this.y}, ${this.z}, ${this.w})`}static packFloat(t,n){return l(n)||(n=new e),fq[0]=t,Xae?(n.x=Nc[0],n.y=Nc[1],n.z=Nc[2],n.w=Nc[3]):(n.x=Nc[3],n.y=Nc[2],n.z=Nc[1],n.w=Nc[0]),n}static unpackFloat(t){return Xae?(Nc[0]=t.x,Nc[1]=t.y,Nc[2]=t.z,Nc[3]=t.w):(Nc[0]=t.w,Nc[1]=t.z,Nc[2]=t.y,Nc[3]=t.x),fq[0]}};Hs.packedLength=4;Hs.fromArray=Hs.unpack;var cN=new Hs,Yae=new Hs,Gke=new Hs;Hs.ZERO=Object.freeze(new Hs(0,0,0,0));Hs.ONE=Object.freeze(new Hs(1,1,1,1));Hs.UNIT_X=Object.freeze(new Hs(1,0,0,0));Hs.UNIT_Y=Object.freeze(new Hs(0,1,0,0));Hs.UNIT_Z=Object.freeze(new Hs(0,0,1,0));Hs.UNIT_W=Object.freeze(new Hs(0,0,0,1));var fq=new Float32Array(1),Nc=new Uint8Array(fq.buffer),Wke=new Uint32Array([287454020]),qke=new Uint8Array(Wke.buffer),Xae=qke[0]===68,se=Hs;var dq={};dq.EMPTY_OBJECT=Object.freeze({});dq.EMPTY_ARRAY=Object.freeze([]);var H=dq;var Yke=Object.freeze([NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN]),_r=class e{constructor(t,n,i,r,o,s,a,c,u){let f=Reflect.construct(Array,Yke,new.target);return f[0]=t??0,f[1]=r??0,f[2]=a??0,f[3]=n??0,f[4]=o??0,f[5]=c??0,f[6]=i??0,f[7]=s??0,f[8]=u??0,f}static pack(t,n,i){return i=i??0,n[i++]=t[0],n[i++]=t[1],n[i++]=t[2],n[i++]=t[3],n[i++]=t[4],n[i++]=t[5],n[i++]=t[6],n[i++]=t[7],n[i]=t[8],n}static unpack(t,n,i){return n=n??0,l(i)||(i=new e),i[0]=t[n++],i[1]=t[n++],i[2]=t[n++],i[3]=t[n++],i[4]=t[n++],i[5]=t[n++],i[6]=t[n++],i[7]=t[n++],i[8]=t[n],i}static packArray(t,n){let i=t.length,r=i*9;l(n)?!Array.isArray(n)&&n.length!==r||n.length!==r&&(n.length=r):n=new Array(r);for(let o=0;o<i;++o)e.pack(t[o],n,o*9);return n}static unpackArray(t,n){let i=t.length;l(n)?n.length=i/9:n=new Array(i/9);for(let r=0;r<i;r+=9){let o=r/9;n[o]=e.unpack(t,r,n[o])}return n}static clone(t,n){if(l(t))return l(n)?(n[0]=t[0],n[1]=t[1],n[2]=t[2],n[3]=t[3],n[4]=t[4],n[5]=t[5],n[6]=t[6],n[7]=t[7],n[8]=t[8],n):new e(t[0],t[3],t[6],t[1],t[4],t[7],t[2],t[5],t[8])}static fromColumnMajorArray(t,n){return e.clone(t,n)}static fromRowMajorArray(t,n){return l(n)?(n[0]=t[0],n[1]=t[3],n[2]=t[6],n[3]=t[1],n[4]=t[4],n[5]=t[7],n[6]=t[2],n[7]=t[5],n[8]=t[8],n):new e(t[0],t[1],t[2],t[3],t[4],t[5],t[6],t[7],t[8])}static fromQuaternion(t,n){let i=t.x*t.x,r=t.x*t.y,o=t.x*t.z,s=t.x*t.w,a=t.y*t.y,c=t.y*t.z,u=t.y*t.w,f=t.z*t.z,d=t.z*t.w,p=t.w*t.w,g=i-a-f+p,m=2*(r-d),y=2*(o+u),A=2*(r+d),b=-i+a-f+p,x=2*(c-s),T=2*(o-u),E=2*(c+s),v=-i-a+f+p;return l(n)?(n[0]=g,n[1]=A,n[2]=T,n[3]=m,n[4]=b,n[5]=E,n[6]=y,n[7]=x,n[8]=v,n):new e(g,m,y,A,b,x,T,E,v)}static fromHeadingPitchRoll(t,n){let i=Math.cos(-t.pitch),r=Math.cos(-t.heading),o=Math.cos(t.roll),s=Math.sin(-t.pitch),a=Math.sin(-t.heading),c=Math.sin(t.roll),u=i*r,f=-o*a+c*s*r,d=c*a+o*s*r,p=i*a,g=o*r+c*s*a,m=-c*r+o*s*a,y=-s,A=c*i,b=o*i;return l(n)?(n[0]=u,n[1]=p,n[2]=y,n[3]=f,n[4]=g,n[5]=A,n[6]=d,n[7]=m,n[8]=b,n):new e(u,f,d,p,g,m,y,A,b)}static fromScale(t,n){return l(n)?(n[0]=t.x,n[1]=0,n[2]=0,n[3]=0,n[4]=t.y,n[5]=0,n[6]=0,n[7]=0,n[8]=t.z,n):new e(t.x,0,0,0,t.y,0,0,0,t.z)}static fromUniformScale(t,n){return l(n)?(n[0]=t,n[1]=0,n[2]=0,n[3]=0,n[4]=t,n[5]=0,n[6]=0,n[7]=0,n[8]=t,n):new e(t,0,0,0,t,0,0,0,t)}static fromCrossProduct(t,n){return l(n)?(n[0]=0,n[1]=t.z,n[2]=-t.y,n[3]=-t.z,n[4]=0,n[5]=t.x,n[6]=t.y,n[7]=-t.x,n[8]=0,n):new e(0,-t.z,t.y,t.z,0,-t.x,-t.y,t.x,0)}static fromRotationX(t,n){let i=Math.cos(t),r=Math.sin(t);return l(n)?(n[0]=1,n[1]=0,n[2]=0,n[3]=0,n[4]=i,n[5]=r,n[6]=0,n[7]=-r,n[8]=i,n):new e(1,0,0,0,i,-r,0,r,i)}static fromRotationY(t,n){let i=Math.cos(t),r=Math.sin(t);return l(n)?(n[0]=i,n[1]=0,n[2]=-r,n[3]=0,n[4]=1,n[5]=0,n[6]=r,n[7]=0,n[8]=i,n):new e(i,0,r,0,1,0,-r,0,i)}static fromRotationZ(t,n){let i=Math.cos(t),r=Math.sin(t);return l(n)?(n[0]=i,n[1]=r,n[2]=0,n[3]=-r,n[4]=i,n[5]=0,n[6]=0,n[7]=0,n[8]=1,n):new e(i,-r,0,r,i,0,0,0,1)}static toArray(t,n){return l(n)?(n[0]=t[0],n[1]=t[1],n[2]=t[2],n[3]=t[3],n[4]=t[4],n[5]=t[5],n[6]=t[6],n[7]=t[7],n[8]=t[8],n):[t[0],t[1],t[2],t[3],t[4],t[5],t[6],t[7],t[8]]}static getElementIndex(t,n){return t*3+n}static getColumn(t,n,i){let r=n*3,o=t[r],s=t[r+1],a=t[r+2];return i.x=o,i.y=s,i.z=a,i}static setColumn(t,n,i,r){r=e.clone(t,r);let o=n*3;return r[o]=i.x,r[o+1]=i.y,r[o+2]=i.z,r}static getRow(t,n,i){let r=t[n],o=t[n+3],s=t[n+6];return i.x=r,i.y=o,i.z=s,i}static setRow(t,n,i,r){return r=e.clone(t,r),r[n]=i.x,r[n+3]=i.y,r[n+6]=i.z,r}static setScale(t,n,i){let r=e.getScale(t,Xke),o=n.x/r.x,s=n.y/r.y,a=n.z/r.z;return i[0]=t[0]*o,i[1]=t[1]*o,i[2]=t[2]*o,i[3]=t[3]*s,i[4]=t[4]*s,i[5]=t[5]*s,i[6]=t[6]*a,i[7]=t[7]*a,i[8]=t[8]*a,i}static setUniformScale(t,n,i){let r=e.getScale(t,Kke),o=n/r.x,s=n/r.y,a=n/r.z;return i[0]=t[0]*o,i[1]=t[1]*o,i[2]=t[2]*o,i[3]=t[3]*s,i[4]=t[4]*s,i[5]=t[5]*s,i[6]=t[6]*a,i[7]=t[7]*a,i[8]=t[8]*a,i}static getScale(t,n){return n.x=h.magnitude(h.fromElements(t[0],t[1],t[2],hq)),n.y=h.magnitude(h.fromElements(t[3],t[4],t[5],hq)),n.z=h.magnitude(h.fromElements(t[6],t[7],t[8],hq)),n}static getMaximumScale(t){return e.getScale(t,Kae),h.maximumComponent(Kae)}static setRotation(t,n,i){let r=e.getScale(t,$ke);return i[0]=n[0]*r.x,i[1]=n[1]*r.x,i[2]=n[2]*r.x,i[3]=n[3]*r.y,i[4]=n[4]*r.y,i[5]=n[5]*r.y,i[6]=n[6]*r.z,i[7]=n[7]*r.z,i[8]=n[8]*r.z,i}static getRotation(t,n){let i=e.getScale(t,Jke);return n[0]=t[0]/i.x,n[1]=t[1]/i.x,n[2]=t[2]/i.x,n[3]=t[3]/i.y,n[4]=t[4]/i.y,n[5]=t[5]/i.y,n[6]=t[6]/i.z,n[7]=t[7]/i.z,n[8]=t[8]/i.z,n}static multiply(t,n,i){let r=t[0]*n[0]+t[3]*n[1]+t[6]*n[2],o=t[1]*n[0]+t[4]*n[1]+t[7]*n[2],s=t[2]*n[0]+t[5]*n[1]+t[8]*n[2],a=t[0]*n[3]+t[3]*n[4]+t[6]*n[5],c=t[1]*n[3]+t[4]*n[4]+t[7]*n[5],u=t[2]*n[3]+t[5]*n[4]+t[8]*n[5],f=t[0]*n[6]+t[3]*n[7]+t[6]*n[8],d=t[1]*n[6]+t[4]*n[7]+t[7]*n[8],p=t[2]*n[6]+t[5]*n[7]+t[8]*n[8];return i[0]=r,i[1]=o,i[2]=s,i[3]=a,i[4]=c,i[5]=u,i[6]=f,i[7]=d,i[8]=p,i}static add(t,n,i){return i[0]=t[0]+n[0],i[1]=t[1]+n[1],i[2]=t[2]+n[2],i[3]=t[3]+n[3],i[4]=t[4]+n[4],i[5]=t[5]+n[5],i[6]=t[6]+n[6],i[7]=t[7]+n[7],i[8]=t[8]+n[8],i}static subtract(t,n,i){return i[0]=t[0]-n[0],i[1]=t[1]-n[1],i[2]=t[2]-n[2],i[3]=t[3]-n[3],i[4]=t[4]-n[4],i[5]=t[5]-n[5],i[6]=t[6]-n[6],i[7]=t[7]-n[7],i[8]=t[8]-n[8],i}static multiplyByVector(t,n,i){let r=n.x,o=n.y,s=n.z,a=t[0]*r+t[3]*o+t[6]*s,c=t[1]*r+t[4]*o+t[7]*s,u=t[2]*r+t[5]*o+t[8]*s;return i.x=a,i.y=c,i.z=u,i}static multiplyByScalar(t,n,i){return i[0]=t[0]*n,i[1]=t[1]*n,i[2]=t[2]*n,i[3]=t[3]*n,i[4]=t[4]*n,i[5]=t[5]*n,i[6]=t[6]*n,i[7]=t[7]*n,i[8]=t[8]*n,i}static multiplyByScale(t,n,i){return i[0]=t[0]*n.x,i[1]=t[1]*n.x,i[2]=t[2]*n.x,i[3]=t[3]*n.y,i[4]=t[4]*n.y,i[5]=t[5]*n.y,i[6]=t[6]*n.z,i[7]=t[7]*n.z,i[8]=t[8]*n.z,i}static multiplyByUniformScale(t,n,i){return i[0]=t[0]*n,i[1]=t[1]*n,i[2]=t[2]*n,i[3]=t[3]*n,i[4]=t[4]*n,i[5]=t[5]*n,i[6]=t[6]*n,i[7]=t[7]*n,i[8]=t[8]*n,i}static negate(t,n){return n[0]=-t[0],n[1]=-t[1],n[2]=-t[2],n[3]=-t[3],n[4]=-t[4],n[5]=-t[5],n[6]=-t[6],n[7]=-t[7],n[8]=-t[8],n}static transpose(t,n){let i=t[0],r=t[3],o=t[6],s=t[1],a=t[4],c=t[7],u=t[2],f=t[5],d=t[8];return n[0]=i,n[1]=r,n[2]=o,n[3]=s,n[4]=a,n[5]=c,n[6]=u,n[7]=f,n[8]=d,n}static computeEigenDecomposition(t,n){let i=P.EPSILON20,r=10,o=0,s=0;l(n)||(n={});let a=n.unitary=e.clone(e.IDENTITY,n.unitary),c=n.diagonal=e.clone(t,n.diagonal),u=i*Qke(c);for(;s<r&&e3e(c)>u;)t3e(c,lN),e.transpose(lN,$ae),e.multiply(c,lN,c),e.multiply($ae,c,c),e.multiply(a,lN,a),++o>2&&(++s,o=0);return n}static abs(t,n){return n[0]=Math.abs(t[0]),n[1]=Math.abs(t[1]),n[2]=Math.abs(t[2]),n[3]=Math.abs(t[3]),n[4]=Math.abs(t[4]),n[5]=Math.abs(t[5]),n[6]=Math.abs(t[6]),n[7]=Math.abs(t[7]),n[8]=Math.abs(t[8]),n}static determinant(t){let n=t[0],i=t[3],r=t[6],o=t[1],s=t[4],a=t[7],c=t[2],u=t[5],f=t[8];return n*(s*f-u*a)+o*(u*r-i*f)+c*(i*a-s*r)}static inverse(t,n){let i=t[0],r=t[1],o=t[2],s=t[3],a=t[4],c=t[5],u=t[6],f=t[7],d=t[8],p=e.determinant(t);n[0]=a*d-f*c,n[1]=f*o-r*d,n[2]=r*c-a*o,n[3]=u*c-s*d,n[4]=i*d-u*o,n[5]=s*o-i*c,n[6]=s*f-u*a,n[7]=u*r-i*f,n[8]=i*a-s*r;let g=1/p;return e.multiplyByScalar(n,g,n)}static inverseTranspose(t,n){return e.inverse(e.transpose(t,Zke),n)}static equals(t,n){return t===n||l(t)&&l(n)&&t[0]===n[0]&&t[1]===n[1]&&t[2]===n[2]&&t[3]===n[3]&&t[4]===n[4]&&t[5]===n[5]&&t[6]===n[6]&&t[7]===n[7]&&t[8]===n[8]}static equalsEpsilon(t,n,i){return i=i??0,t===n||l(t)&&l(n)&&Math.abs(t[0]-n[0])<=i&&Math.abs(t[1]-n[1])<=i&&Math.abs(t[2]-n[2])<=i&&Math.abs(t[3]-n[3])<=i&&Math.abs(t[4]-n[4])<=i&&Math.abs(t[5]-n[5])<=i&&Math.abs(t[6]-n[6])<=i&&Math.abs(t[7]-n[7])<=i&&Math.abs(t[8]-n[8])<=i}get length(){return e.packedLength}clone(t){return e.clone(this,t)}equals(t){return e.equals(this,t)}static equalsArray(t,n,i){return t[0]===n[i]&&t[1]===n[i+1]&&t[2]===n[i+2]&&t[3]===n[i+3]&&t[4]===n[i+4]&&t[5]===n[i+5]&&t[6]===n[i+6]&&t[7]===n[i+7]&&t[8]===n[i+8]}equalsEpsilon(t,n){return e.equalsEpsilon(this,t,n)}toString(){return`(${this[0]}, ${this[3]}, ${this[6]}) + `),window.clearInterval(this.noSleepTimer),this.noSleepTimer=null):this.noSleepVideo.pause(),this.enabled=!1}};yke.exports=zae});function jke(e){return e!=null}var l=jke;function mb(e){this.name="DeveloperError",this.message=e;let t;try{throw new Error}catch(n){t=n.stack}this.stack=t}l(Object.create)&&(mb.prototype=Object.create(Error.prototype),mb.prototype.constructor=mb);mb.prototype.toString=function(){let e=`${this.name}: ${this.message}`;return l(this.stack)&&(e+=` +${this.stack.toString()}`),e};mb.throwInstantiationError=function(){throw new mb("This function defines an interface and should not be called directly.")};var pe=mb;var ia={};ia.typeOf={};function Hke(e){return`${e} is required, actual value was undefined`}function gE(e,t,n){return`Expected ${n} to be typeof ${t}, actual typeof was ${e}`}ia.defined=function(e,t){if(!l(t))throw new pe(Hke(e))};ia.typeOf.func=function(e,t){if(typeof t!="function")throw new pe(gE(typeof t,"function",e))};ia.typeOf.string=function(e,t){if(typeof t!="string")throw new pe(gE(typeof t,"string",e))};ia.typeOf.number=function(e,t){if(typeof t!="number")throw new pe(gE(typeof t,"number",e))};ia.typeOf.number.lessThan=function(e,t,n){if(ia.typeOf.number(e,t),t>=n)throw new pe(`Expected ${e} to be less than ${n}, actual value was ${t}`)};ia.typeOf.number.lessThanOrEquals=function(e,t,n){if(ia.typeOf.number(e,t),t>n)throw new pe(`Expected ${e} to be less than or equal to ${n}, actual value was ${t}`)};ia.typeOf.number.greaterThan=function(e,t,n){if(ia.typeOf.number(e,t),t<=n)throw new pe(`Expected ${e} to be greater than ${n}, actual value was ${t}`)};ia.typeOf.number.greaterThanOrEquals=function(e,t,n){if(ia.typeOf.number(e,t),t<n)throw new pe(`Expected ${e} to be greater than or equal to ${n}, actual value was ${t}`)};ia.typeOf.object=function(e,t){if(typeof t!="object")throw new pe(gE(typeof t,"object",e))};ia.typeOf.bool=function(e,t){if(typeof t!="boolean")throw new pe(gE(typeof t,"boolean",e))};ia.typeOf.bigint=function(e,t){if(typeof t!="bigint")throw new pe(gE(typeof t,"bigint",e))};ia.typeOf.number.equals=function(e,t,n,i){if(ia.typeOf.number(e,n),ia.typeOf.number(t,i),n!==i)throw new pe(`${e} must be equal to ${t}, the actual values are ${n} and ${i}`)};var qr=ia;var lq=js(rN(),1);var _t={};_t.EPSILON1=.1;_t.EPSILON2=.01;_t.EPSILON3=.001;_t.EPSILON4=1e-4;_t.EPSILON5=1e-5;_t.EPSILON6=1e-6;_t.EPSILON7=1e-7;_t.EPSILON8=1e-8;_t.EPSILON9=1e-9;_t.EPSILON10=1e-10;_t.EPSILON11=1e-11;_t.EPSILON12=1e-12;_t.EPSILON13=1e-13;_t.EPSILON14=1e-14;_t.EPSILON15=1e-15;_t.EPSILON16=1e-16;_t.EPSILON17=1e-17;_t.EPSILON18=1e-18;_t.EPSILON19=1e-19;_t.EPSILON20=1e-20;_t.EPSILON21=1e-21;_t.GRAVITATIONALPARAMETER=3986004418e5;_t.SOLAR_RADIUS=6955e5;_t.LUNAR_RADIUS=1737400;_t.SIXTY_FOUR_KILOBYTES=64*1024;_t.FOUR_GIGABYTES=4*1024*1024*1024;_t.sign=Math.sign??function(t){return t=+t,t===0||t!==t?t:t>0?1:-1};_t.signNotZero=function(e){return e<0?-1:1};_t.toSNorm=function(e,t){return t=t??255,Math.round((_t.clamp(e,-1,1)*.5+.5)*t)};_t.fromSNorm=function(e,t){return t=t??255,_t.clamp(e,0,t)/t*2-1};_t.normalize=function(e,t,n){return n=Math.max(n-t,0),n===0?0:_t.clamp((e-t)/n,0,1)};_t.sinh=Math.sinh??function(t){return(Math.exp(t)-Math.exp(-t))/2};_t.cosh=Math.cosh??function(t){return(Math.exp(t)+Math.exp(-t))/2};_t.lerp=function(e,t,n){return(1-n)*e+n*t};_t.smoothDamp=function(e,t,n,i=0,r=Number.POSITIVE_INFINITY,o=1e-4,s={}){o=Math.max(1e-4,o);let a=2/o,c=a*i,u=1/(1+c+.48*c*c+.235*c*c*c),f=r*o,d=e-t;d=_t.clamp(d,-f,f);let p=e-d,g=(n+a*d)*i;return n=(n-a*g)*u,s.value=p+(d+g)*u,s.velocity=n,s};_t.PI=Math.PI;_t.ONE_OVER_PI=1/Math.PI;_t.PI_OVER_TWO=Math.PI/2;_t.PI_OVER_THREE=Math.PI/3;_t.PI_OVER_FOUR=Math.PI/4;_t.PI_OVER_SIX=Math.PI/6;_t.THREE_PI_OVER_TWO=3*Math.PI/2;_t.TWO_PI=2*Math.PI;_t.ONE_OVER_TWO_PI=1/(2*Math.PI);_t.RADIANS_PER_DEGREE=Math.PI/180;_t.DEGREES_PER_RADIAN=180/Math.PI;_t.RADIANS_PER_ARCSECOND=_t.RADIANS_PER_DEGREE/3600;_t.toRadians=function(e){return e*_t.RADIANS_PER_DEGREE};_t.toDegrees=function(e){return e*_t.DEGREES_PER_RADIAN};_t.convertLongitudeRange=function(e){let t=_t.TWO_PI,n=e-Math.floor(e/t)*t;return n<-Math.PI?n+t:n>=Math.PI?n-t:n};_t.clampToLatitudeRange=function(e){return _t.clamp(e,-1*_t.PI_OVER_TWO,_t.PI_OVER_TWO)};_t.negativePiToPi=function(e){return e>=-_t.PI&&e<=_t.PI?e:_t.zeroToTwoPi(e+_t.PI)-_t.PI};_t.zeroToTwoPi=function(e){if(e>=0&&e<=_t.TWO_PI)return e;let t=_t.mod(e,_t.TWO_PI);return Math.abs(t)<_t.EPSILON14&&Math.abs(e)>_t.EPSILON14?_t.TWO_PI:t};_t.mod=function(e,t){return _t.sign(e)===_t.sign(t)&&Math.abs(e)<Math.abs(t)?e:(e%t+t)%t};_t.equalsEpsilon=function(e,t,n,i){n=n??0,i=i??n;let r=Math.abs(e-t);return r<=i||r<=n*Math.max(Math.abs(e),Math.abs(t))};_t.lessThan=function(e,t,n){return e-t<-n};_t.lessThanOrEquals=function(e,t,n){return e-t<n};_t.greaterThan=function(e,t,n){return e-t>n};_t.greaterThanOrEquals=function(e,t,n){return e-t>-n};var oN=[1];_t.factorial=function(e){let t=oN.length;if(e>=t){let n=oN[t-1];for(let i=t;i<=e;i++){let r=n*i;oN.push(r),n=r}}return oN[e]};_t.incrementWrap=function(e,t,n){return n=n??0,++e,e>t&&(e=n),e};_t.isPowerOfTwo=function(e){return e!==0&&(e&e-1)===0};_t.nextPowerOfTwo=function(e){return--e,e|=e>>1,e|=e>>2,e|=e>>4,e|=e>>8,e|=e>>16,++e,e};_t.previousPowerOfTwo=function(e){return e|=e>>1,e|=e>>2,e|=e>>4,e|=e>>8,e|=e>>16,e|=e>>32,e=(e>>>0)-(e>>>1),e};_t.clamp=function(e,t,n){return e<t?t:e>n?n:e};var Wae=new lq.default;_t.setRandomNumberSeed=function(e){Wae=new lq.default(e)};_t.nextRandomNumber=function(){return Wae.random()};_t.randomBetween=function(e,t){return _t.nextRandomNumber()*(t-e)+e};_t.acosClamped=function(e){return Math.acos(_t.clamp(e,-1,1))};_t.asinClamped=function(e){return Math.asin(_t.clamp(e,-1,1))};_t.chordLength=function(e,t){return 2*t*Math.sin(e*.5)};_t.logBase=function(e,t){return Math.log(e)/Math.log(t)};_t.cbrt=Math.cbrt??function(t){let n=Math.pow(Math.abs(t),.3333333333333333);return t<0?-n:n};_t.log2=Math.log2??function(t){return Math.log(t)*Math.LOG2E};_t.fog=function(e,t){let n=e*t;return 1-Math.exp(-(n*n))};_t.fastApproximateAtan=function(e){return e*(-.1784*Math.abs(e)-.0663*e*e+1.0301)};_t.fastApproximateAtan2=function(e,t){let n,i=Math.abs(e);n=Math.abs(t);let r=Math.max(i,n);n=Math.min(i,n);let o=n/r;return i=_t.fastApproximateAtan(o),i=Math.abs(t)>Math.abs(e)?_t.PI_OVER_TWO-i:i,i=e<0?_t.PI-i:i,i=t<0?-i:i,i};var P=_t;var lo=class e{constructor(t,n,i){this.x=t??0,this.y=n??0,this.z=i??0}static fromSpherical(t,n){l(n)||(n=new e);let i=t.clock,r=t.cone,o=t.magnitude??1,s=o*Math.sin(r);return n.x=s*Math.cos(i),n.y=s*Math.sin(i),n.z=o*Math.cos(r),n}static fromElements(t,n,i,r){return l(r)?(r.x=t,r.y=n,r.z=i,r):new e(t,n,i)}static clone(t,n){if(l(t))return l(n)?(n.x=t.x,n.y=t.y,n.z=t.z,n):new e(t.x,t.y,t.z)}static pack(t,n,i){return i=i??0,n[i++]=t.x,n[i++]=t.y,n[i]=t.z,n}static unpack(t,n,i){return n=n??0,l(i)||(i=new e),i.x=t[n++],i.y=t[n++],i.z=t[n],i}static packArray(t,n){let i=t.length,r=i*3;l(n)?!Array.isArray(n)&&n.length!==r||n.length!==r&&(n.length=r):n=new Array(r);for(let o=0;o<i;++o)e.pack(t[o],n,o*3);return n}static unpackArray(t,n){let i=t.length;l(n)?n.length=i/3:n=new Array(i/3);for(let r=0;r<i;r+=3){let o=r/3;n[o]=e.unpack(t,r,n[o])}return n}static maximumComponent(t){return Math.max(t.x,t.y,t.z)}static minimumComponent(t){return Math.min(t.x,t.y,t.z)}static minimumByComponent(t,n,i){return i.x=Math.min(t.x,n.x),i.y=Math.min(t.y,n.y),i.z=Math.min(t.z,n.z),i}static maximumByComponent(t,n,i){return i.x=Math.max(t.x,n.x),i.y=Math.max(t.y,n.y),i.z=Math.max(t.z,n.z),i}static clamp(t,n,i,r){let o=P.clamp(t.x,n.x,i.x),s=P.clamp(t.y,n.y,i.y),a=P.clamp(t.z,n.z,i.z);return r.x=o,r.y=s,r.z=a,r}static magnitudeSquared(t){return t.x*t.x+t.y*t.y+t.z*t.z}static magnitude(t){return Math.sqrt(e.magnitudeSquared(t))}static distance(t,n){return e.subtract(t,n,sN),e.magnitude(sN)}static distanceSquared(t,n){return e.subtract(t,n,sN),e.magnitudeSquared(sN)}static normalize(t,n){let i=e.magnitude(t);return n.x=t.x/i,n.y=t.y/i,n.z=t.z/i,n}static dot(t,n){return t.x*n.x+t.y*n.y+t.z*n.z}static multiplyComponents(t,n,i){return i.x=t.x*n.x,i.y=t.y*n.y,i.z=t.z*n.z,i}static divideComponents(t,n,i){return i.x=t.x/n.x,i.y=t.y/n.y,i.z=t.z/n.z,i}static add(t,n,i){return i.x=t.x+n.x,i.y=t.y+n.y,i.z=t.z+n.z,i}static subtract(t,n,i){return i.x=t.x-n.x,i.y=t.y-n.y,i.z=t.z-n.z,i}static multiplyByScalar(t,n,i){return i.x=t.x*n,i.y=t.y*n,i.z=t.z*n,i}static divideByScalar(t,n,i){return i.x=t.x/n,i.y=t.y/n,i.z=t.z/n,i}static negate(t,n){return n.x=-t.x,n.y=-t.y,n.z=-t.z,n}static abs(t,n){return n.x=Math.abs(t.x),n.y=Math.abs(t.y),n.z=Math.abs(t.z),n}static lerp(t,n,i,r){return e.multiplyByScalar(n,i,qae),r=e.multiplyByScalar(t,1-i,r),e.add(qae,r,r)}static angleBetween(t,n){e.normalize(t,aN),e.normalize(n,uq);let i=e.dot(aN,uq),r=e.magnitude(e.cross(aN,uq,aN));return Math.atan2(r,i)}static mostOrthogonalAxis(t,n){let i=e.normalize(t,Gke);return e.abs(i,i),i.x<=i.y?i.x<=i.z?n=e.clone(e.UNIT_X,n):n=e.clone(e.UNIT_Z,n):i.y<=i.z?n=e.clone(e.UNIT_Y,n):n=e.clone(e.UNIT_Z,n),n}static projectVector(t,n,i){let r=e.dot(t,n)/e.dot(n,n);return e.multiplyByScalar(n,r,i)}static equals(t,n){return t===n||l(t)&&l(n)&&t.x===n.x&&t.y===n.y&&t.z===n.z}static equalsArray(t,n,i){return t.x===n[i]&&t.y===n[i+1]&&t.z===n[i+2]}static equalsEpsilon(t,n,i,r){return t===n||l(t)&&l(n)&&P.equalsEpsilon(t.x,n.x,i,r)&&P.equalsEpsilon(t.y,n.y,i,r)&&P.equalsEpsilon(t.z,n.z,i,r)}static cross(t,n,i){let r=t.x,o=t.y,s=t.z,a=n.x,c=n.y,u=n.z,f=o*u-s*c,d=s*a-r*u,p=r*c-o*a;return i.x=f,i.y=d,i.z=p,i}static midpoint(t,n,i){return i.x=(t.x+n.x)*.5,i.y=(t.y+n.y)*.5,i.z=(t.z+n.z)*.5,i}static fromDegrees(t,n,i,r,o){return t=P.toRadians(t),n=P.toRadians(n),e.fromRadians(t,n,i,r,o)}static fromRadians(t,n,i,r,o){i=i??0;let s=l(r)?r.radiiSquared:e._ellipsoidRadiiSquared,a=Math.cos(n);Yf.x=a*Math.cos(t),Yf.y=a*Math.sin(t),Yf.z=Math.sin(n),Yf=e.normalize(Yf,Yf),e.multiplyComponents(s,Yf,_E);let c=Math.sqrt(e.dot(Yf,_E));return _E=e.divideByScalar(_E,c,_E),Yf=e.multiplyByScalar(Yf,i,Yf),l(o)||(o=new e),e.add(_E,Yf,o)}static fromDegreesArray(t,n,i){let r=t.length;l(i)?i.length=r/2:i=new Array(r/2);for(let o=0;o<r;o+=2){let s=t[o],a=t[o+1],c=o/2;i[c]=e.fromDegrees(s,a,0,n,i[c])}return i}static fromRadiansArray(t,n,i){let r=t.length;l(i)?i.length=r/2:i=new Array(r/2);for(let o=0;o<r;o+=2){let s=t[o],a=t[o+1],c=o/2;i[c]=e.fromRadians(s,a,0,n,i[c])}return i}static fromDegreesArrayHeights(t,n,i){let r=t.length;l(i)?i.length=r/3:i=new Array(r/3);for(let o=0;o<r;o+=3){let s=t[o],a=t[o+1],c=t[o+2],u=o/3;i[u]=e.fromDegrees(s,a,c,n,i[u])}return i}static fromRadiansArrayHeights(t,n,i){let r=t.length;l(i)?i.length=r/3:i=new Array(r/3);for(let o=0;o<r;o+=3){let s=t[o],a=t[o+1],c=t[o+2],u=o/3;i[u]=e.fromRadians(s,a,c,n,i[u])}return i}clone(t){return e.clone(this,t)}equals(t){return e.equals(this,t)}equalsEpsilon(t,n,i){return e.equalsEpsilon(this,t,n,i)}toString(){return`(${this.x}, ${this.y}, ${this.z})`}};lo.fromCartesian4=lo.clone;lo.packedLength=3;lo.fromArray=lo.unpack;var sN=new lo,qae=new lo,aN=new lo,uq=new lo,Gke=new lo,Yf=new lo,_E=new lo;lo._ellipsoidRadiiSquared=new lo(6378137*6378137,6378137*6378137,6356752314245179e-9*6356752314245179e-9);lo.ZERO=Object.freeze(new lo(0,0,0));lo.ONE=Object.freeze(new lo(1,1,1));lo.UNIT_X=Object.freeze(new lo(1,0,0));lo.UNIT_Y=Object.freeze(new lo(0,1,0));lo.UNIT_Z=Object.freeze(new lo(0,0,1));var h=lo;var Hs=class e{constructor(t,n,i,r){this.x=t??0,this.y=n??0,this.z=i??0,this.w=r??0}static fromElements(t,n,i,r,o){return l(o)?(o.x=t,o.y=n,o.z=i,o.w=r,o):new e(t,n,i,r)}static fromColor(t,n){return l(n)?(n.x=t.red,n.y=t.green,n.z=t.blue,n.w=t.alpha,n):new e(t.red,t.green,t.blue,t.alpha)}static clone(t,n){if(l(t))return l(n)?(n.x=t.x,n.y=t.y,n.z=t.z,n.w=t.w,n):new e(t.x,t.y,t.z,t.w)}static pack(t,n,i){return i=i??0,n[i++]=t.x,n[i++]=t.y,n[i++]=t.z,n[i]=t.w,n}static unpack(t,n,i){return n=n??0,l(i)||(i=new e),i.x=t[n++],i.y=t[n++],i.z=t[n++],i.w=t[n],i}static packArray(t,n){let i=t.length,r=i*4;l(n)?!Array.isArray(n)&&n.length!==r||n.length!==r&&(n.length=r):n=new Array(r);for(let o=0;o<i;++o)e.pack(t[o],n,o*4);return n}static unpackArray(t,n){let i=t.length;l(n)?n.length=i/4:n=new Array(i/4);for(let r=0;r<i;r+=4){let o=r/4;n[o]=e.unpack(t,r,n[o])}return n}static maximumComponent(t){return Math.max(t.x,t.y,t.z,t.w)}static minimumComponent(t){return Math.min(t.x,t.y,t.z,t.w)}static minimumByComponent(t,n,i){return i.x=Math.min(t.x,n.x),i.y=Math.min(t.y,n.y),i.z=Math.min(t.z,n.z),i.w=Math.min(t.w,n.w),i}static maximumByComponent(t,n,i){return i.x=Math.max(t.x,n.x),i.y=Math.max(t.y,n.y),i.z=Math.max(t.z,n.z),i.w=Math.max(t.w,n.w),i}static clamp(t,n,i,r){let o=P.clamp(t.x,n.x,i.x),s=P.clamp(t.y,n.y,i.y),a=P.clamp(t.z,n.z,i.z),c=P.clamp(t.w,n.w,i.w);return r.x=o,r.y=s,r.z=a,r.w=c,r}static magnitudeSquared(t){return t.x*t.x+t.y*t.y+t.z*t.z+t.w*t.w}static magnitude(t){return Math.sqrt(e.magnitudeSquared(t))}static distance(t,n){return e.subtract(t,n,cN),e.magnitude(cN)}static distanceSquared(t,n){return e.subtract(t,n,cN),e.magnitudeSquared(cN)}static normalize(t,n){let i=e.magnitude(t);return n.x=t.x/i,n.y=t.y/i,n.z=t.z/i,n.w=t.w/i,n}static dot(t,n){return t.x*n.x+t.y*n.y+t.z*n.z+t.w*n.w}static multiplyComponents(t,n,i){return i.x=t.x*n.x,i.y=t.y*n.y,i.z=t.z*n.z,i.w=t.w*n.w,i}static divideComponents(t,n,i){return i.x=t.x/n.x,i.y=t.y/n.y,i.z=t.z/n.z,i.w=t.w/n.w,i}static add(t,n,i){return i.x=t.x+n.x,i.y=t.y+n.y,i.z=t.z+n.z,i.w=t.w+n.w,i}static subtract(t,n,i){return i.x=t.x-n.x,i.y=t.y-n.y,i.z=t.z-n.z,i.w=t.w-n.w,i}static multiplyByScalar(t,n,i){return i.x=t.x*n,i.y=t.y*n,i.z=t.z*n,i.w=t.w*n,i}static divideByScalar(t,n,i){return i.x=t.x/n,i.y=t.y/n,i.z=t.z/n,i.w=t.w/n,i}static negate(t,n){return n.x=-t.x,n.y=-t.y,n.z=-t.z,n.w=-t.w,n}static abs(t,n){return n.x=Math.abs(t.x),n.y=Math.abs(t.y),n.z=Math.abs(t.z),n.w=Math.abs(t.w),n}static lerp(t,n,i,r){return e.multiplyByScalar(n,i,Yae),r=e.multiplyByScalar(t,1-i,r),e.add(Yae,r,r)}static mostOrthogonalAxis(t,n){let i=e.normalize(t,Wke);return e.abs(i,i),i.x<=i.y?i.x<=i.z?i.x<=i.w?n=e.clone(e.UNIT_X,n):n=e.clone(e.UNIT_W,n):i.z<=i.w?n=e.clone(e.UNIT_Z,n):n=e.clone(e.UNIT_W,n):i.y<=i.z?i.y<=i.w?n=e.clone(e.UNIT_Y,n):n=e.clone(e.UNIT_W,n):i.z<=i.w?n=e.clone(e.UNIT_Z,n):n=e.clone(e.UNIT_W,n),n}static equals(t,n){return t===n||l(t)&&l(n)&&t.x===n.x&&t.y===n.y&&t.z===n.z&&t.w===n.w}static equalsArray(t,n,i){return t.x===n[i]&&t.y===n[i+1]&&t.z===n[i+2]&&t.w===n[i+3]}static equalsEpsilon(t,n,i,r){return t===n||l(t)&&l(n)&&P.equalsEpsilon(t.x,n.x,i,r)&&P.equalsEpsilon(t.y,n.y,i,r)&&P.equalsEpsilon(t.z,n.z,i,r)&&P.equalsEpsilon(t.w,n.w,i,r)}clone(t){return e.clone(this,t)}equals(t){return e.equals(this,t)}equalsEpsilon(t,n,i){return e.equalsEpsilon(this,t,n,i)}toString(){return`(${this.x}, ${this.y}, ${this.z}, ${this.w})`}static packFloat(t,n){return l(n)||(n=new e),fq[0]=t,Xae?(n.x=Nc[0],n.y=Nc[1],n.z=Nc[2],n.w=Nc[3]):(n.x=Nc[3],n.y=Nc[2],n.z=Nc[1],n.w=Nc[0]),n}static unpackFloat(t){return Xae?(Nc[0]=t.x,Nc[1]=t.y,Nc[2]=t.z,Nc[3]=t.w):(Nc[0]=t.w,Nc[1]=t.z,Nc[2]=t.y,Nc[3]=t.x),fq[0]}};Hs.packedLength=4;Hs.fromArray=Hs.unpack;var cN=new Hs,Yae=new Hs,Wke=new Hs;Hs.ZERO=Object.freeze(new Hs(0,0,0,0));Hs.ONE=Object.freeze(new Hs(1,1,1,1));Hs.UNIT_X=Object.freeze(new Hs(1,0,0,0));Hs.UNIT_Y=Object.freeze(new Hs(0,1,0,0));Hs.UNIT_Z=Object.freeze(new Hs(0,0,1,0));Hs.UNIT_W=Object.freeze(new Hs(0,0,0,1));var fq=new Float32Array(1),Nc=new Uint8Array(fq.buffer),qke=new Uint32Array([287454020]),Yke=new Uint8Array(qke.buffer),Xae=Yke[0]===68,se=Hs;var dq={};dq.EMPTY_OBJECT=Object.freeze({});dq.EMPTY_ARRAY=Object.freeze([]);var H=dq;var Xke=Object.freeze([NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN]),_r=class e{constructor(t,n,i,r,o,s,a,c,u){let f=Reflect.construct(Array,Xke,new.target);return f[0]=t??0,f[1]=r??0,f[2]=a??0,f[3]=n??0,f[4]=o??0,f[5]=c??0,f[6]=i??0,f[7]=s??0,f[8]=u??0,f}static pack(t,n,i){return i=i??0,n[i++]=t[0],n[i++]=t[1],n[i++]=t[2],n[i++]=t[3],n[i++]=t[4],n[i++]=t[5],n[i++]=t[6],n[i++]=t[7],n[i]=t[8],n}static unpack(t,n,i){return n=n??0,l(i)||(i=new e),i[0]=t[n++],i[1]=t[n++],i[2]=t[n++],i[3]=t[n++],i[4]=t[n++],i[5]=t[n++],i[6]=t[n++],i[7]=t[n++],i[8]=t[n],i}static packArray(t,n){let i=t.length,r=i*9;l(n)?!Array.isArray(n)&&n.length!==r||n.length!==r&&(n.length=r):n=new Array(r);for(let o=0;o<i;++o)e.pack(t[o],n,o*9);return n}static unpackArray(t,n){let i=t.length;l(n)?n.length=i/9:n=new Array(i/9);for(let r=0;r<i;r+=9){let o=r/9;n[o]=e.unpack(t,r,n[o])}return n}static clone(t,n){if(l(t))return l(n)?(n[0]=t[0],n[1]=t[1],n[2]=t[2],n[3]=t[3],n[4]=t[4],n[5]=t[5],n[6]=t[6],n[7]=t[7],n[8]=t[8],n):new e(t[0],t[3],t[6],t[1],t[4],t[7],t[2],t[5],t[8])}static fromColumnMajorArray(t,n){return e.clone(t,n)}static fromRowMajorArray(t,n){return l(n)?(n[0]=t[0],n[1]=t[3],n[2]=t[6],n[3]=t[1],n[4]=t[4],n[5]=t[7],n[6]=t[2],n[7]=t[5],n[8]=t[8],n):new e(t[0],t[1],t[2],t[3],t[4],t[5],t[6],t[7],t[8])}static fromQuaternion(t,n){let i=t.x*t.x,r=t.x*t.y,o=t.x*t.z,s=t.x*t.w,a=t.y*t.y,c=t.y*t.z,u=t.y*t.w,f=t.z*t.z,d=t.z*t.w,p=t.w*t.w,g=i-a-f+p,m=2*(r-d),y=2*(o+u),A=2*(r+d),b=-i+a-f+p,x=2*(c-s),T=2*(o-u),E=2*(c+s),v=-i-a+f+p;return l(n)?(n[0]=g,n[1]=A,n[2]=T,n[3]=m,n[4]=b,n[5]=E,n[6]=y,n[7]=x,n[8]=v,n):new e(g,m,y,A,b,x,T,E,v)}static fromHeadingPitchRoll(t,n){let i=Math.cos(-t.pitch),r=Math.cos(-t.heading),o=Math.cos(t.roll),s=Math.sin(-t.pitch),a=Math.sin(-t.heading),c=Math.sin(t.roll),u=i*r,f=-o*a+c*s*r,d=c*a+o*s*r,p=i*a,g=o*r+c*s*a,m=-c*r+o*s*a,y=-s,A=c*i,b=o*i;return l(n)?(n[0]=u,n[1]=p,n[2]=y,n[3]=f,n[4]=g,n[5]=A,n[6]=d,n[7]=m,n[8]=b,n):new e(u,f,d,p,g,m,y,A,b)}static fromScale(t,n){return l(n)?(n[0]=t.x,n[1]=0,n[2]=0,n[3]=0,n[4]=t.y,n[5]=0,n[6]=0,n[7]=0,n[8]=t.z,n):new e(t.x,0,0,0,t.y,0,0,0,t.z)}static fromUniformScale(t,n){return l(n)?(n[0]=t,n[1]=0,n[2]=0,n[3]=0,n[4]=t,n[5]=0,n[6]=0,n[7]=0,n[8]=t,n):new e(t,0,0,0,t,0,0,0,t)}static fromCrossProduct(t,n){return l(n)?(n[0]=0,n[1]=t.z,n[2]=-t.y,n[3]=-t.z,n[4]=0,n[5]=t.x,n[6]=t.y,n[7]=-t.x,n[8]=0,n):new e(0,-t.z,t.y,t.z,0,-t.x,-t.y,t.x,0)}static fromRotationX(t,n){let i=Math.cos(t),r=Math.sin(t);return l(n)?(n[0]=1,n[1]=0,n[2]=0,n[3]=0,n[4]=i,n[5]=r,n[6]=0,n[7]=-r,n[8]=i,n):new e(1,0,0,0,i,-r,0,r,i)}static fromRotationY(t,n){let i=Math.cos(t),r=Math.sin(t);return l(n)?(n[0]=i,n[1]=0,n[2]=-r,n[3]=0,n[4]=1,n[5]=0,n[6]=r,n[7]=0,n[8]=i,n):new e(i,0,r,0,1,0,-r,0,i)}static fromRotationZ(t,n){let i=Math.cos(t),r=Math.sin(t);return l(n)?(n[0]=i,n[1]=r,n[2]=0,n[3]=-r,n[4]=i,n[5]=0,n[6]=0,n[7]=0,n[8]=1,n):new e(i,-r,0,r,i,0,0,0,1)}static toArray(t,n){return l(n)?(n[0]=t[0],n[1]=t[1],n[2]=t[2],n[3]=t[3],n[4]=t[4],n[5]=t[5],n[6]=t[6],n[7]=t[7],n[8]=t[8],n):[t[0],t[1],t[2],t[3],t[4],t[5],t[6],t[7],t[8]]}static getElementIndex(t,n){return t*3+n}static getColumn(t,n,i){let r=n*3,o=t[r],s=t[r+1],a=t[r+2];return i.x=o,i.y=s,i.z=a,i}static setColumn(t,n,i,r){r=e.clone(t,r);let o=n*3;return r[o]=i.x,r[o+1]=i.y,r[o+2]=i.z,r}static getRow(t,n,i){let r=t[n],o=t[n+3],s=t[n+6];return i.x=r,i.y=o,i.z=s,i}static setRow(t,n,i,r){return r=e.clone(t,r),r[n]=i.x,r[n+3]=i.y,r[n+6]=i.z,r}static setScale(t,n,i){let r=e.getScale(t,Kke),o=n.x/r.x,s=n.y/r.y,a=n.z/r.z;return i[0]=t[0]*o,i[1]=t[1]*o,i[2]=t[2]*o,i[3]=t[3]*s,i[4]=t[4]*s,i[5]=t[5]*s,i[6]=t[6]*a,i[7]=t[7]*a,i[8]=t[8]*a,i}static setUniformScale(t,n,i){let r=e.getScale(t,$ke),o=n/r.x,s=n/r.y,a=n/r.z;return i[0]=t[0]*o,i[1]=t[1]*o,i[2]=t[2]*o,i[3]=t[3]*s,i[4]=t[4]*s,i[5]=t[5]*s,i[6]=t[6]*a,i[7]=t[7]*a,i[8]=t[8]*a,i}static getScale(t,n){return n.x=h.magnitude(h.fromElements(t[0],t[1],t[2],hq)),n.y=h.magnitude(h.fromElements(t[3],t[4],t[5],hq)),n.z=h.magnitude(h.fromElements(t[6],t[7],t[8],hq)),n}static getMaximumScale(t){return e.getScale(t,Kae),h.maximumComponent(Kae)}static setRotation(t,n,i){let r=e.getScale(t,Jke);return i[0]=n[0]*r.x,i[1]=n[1]*r.x,i[2]=n[2]*r.x,i[3]=n[3]*r.y,i[4]=n[4]*r.y,i[5]=n[5]*r.y,i[6]=n[6]*r.z,i[7]=n[7]*r.z,i[8]=n[8]*r.z,i}static getRotation(t,n){let i=e.getScale(t,Zke);return n[0]=t[0]/i.x,n[1]=t[1]/i.x,n[2]=t[2]/i.x,n[3]=t[3]/i.y,n[4]=t[4]/i.y,n[5]=t[5]/i.y,n[6]=t[6]/i.z,n[7]=t[7]/i.z,n[8]=t[8]/i.z,n}static multiply(t,n,i){let r=t[0]*n[0]+t[3]*n[1]+t[6]*n[2],o=t[1]*n[0]+t[4]*n[1]+t[7]*n[2],s=t[2]*n[0]+t[5]*n[1]+t[8]*n[2],a=t[0]*n[3]+t[3]*n[4]+t[6]*n[5],c=t[1]*n[3]+t[4]*n[4]+t[7]*n[5],u=t[2]*n[3]+t[5]*n[4]+t[8]*n[5],f=t[0]*n[6]+t[3]*n[7]+t[6]*n[8],d=t[1]*n[6]+t[4]*n[7]+t[7]*n[8],p=t[2]*n[6]+t[5]*n[7]+t[8]*n[8];return i[0]=r,i[1]=o,i[2]=s,i[3]=a,i[4]=c,i[5]=u,i[6]=f,i[7]=d,i[8]=p,i}static add(t,n,i){return i[0]=t[0]+n[0],i[1]=t[1]+n[1],i[2]=t[2]+n[2],i[3]=t[3]+n[3],i[4]=t[4]+n[4],i[5]=t[5]+n[5],i[6]=t[6]+n[6],i[7]=t[7]+n[7],i[8]=t[8]+n[8],i}static subtract(t,n,i){return i[0]=t[0]-n[0],i[1]=t[1]-n[1],i[2]=t[2]-n[2],i[3]=t[3]-n[3],i[4]=t[4]-n[4],i[5]=t[5]-n[5],i[6]=t[6]-n[6],i[7]=t[7]-n[7],i[8]=t[8]-n[8],i}static multiplyByVector(t,n,i){let r=n.x,o=n.y,s=n.z,a=t[0]*r+t[3]*o+t[6]*s,c=t[1]*r+t[4]*o+t[7]*s,u=t[2]*r+t[5]*o+t[8]*s;return i.x=a,i.y=c,i.z=u,i}static multiplyByScalar(t,n,i){return i[0]=t[0]*n,i[1]=t[1]*n,i[2]=t[2]*n,i[3]=t[3]*n,i[4]=t[4]*n,i[5]=t[5]*n,i[6]=t[6]*n,i[7]=t[7]*n,i[8]=t[8]*n,i}static multiplyByScale(t,n,i){return i[0]=t[0]*n.x,i[1]=t[1]*n.x,i[2]=t[2]*n.x,i[3]=t[3]*n.y,i[4]=t[4]*n.y,i[5]=t[5]*n.y,i[6]=t[6]*n.z,i[7]=t[7]*n.z,i[8]=t[8]*n.z,i}static multiplyByUniformScale(t,n,i){return i[0]=t[0]*n,i[1]=t[1]*n,i[2]=t[2]*n,i[3]=t[3]*n,i[4]=t[4]*n,i[5]=t[5]*n,i[6]=t[6]*n,i[7]=t[7]*n,i[8]=t[8]*n,i}static negate(t,n){return n[0]=-t[0],n[1]=-t[1],n[2]=-t[2],n[3]=-t[3],n[4]=-t[4],n[5]=-t[5],n[6]=-t[6],n[7]=-t[7],n[8]=-t[8],n}static transpose(t,n){let i=t[0],r=t[3],o=t[6],s=t[1],a=t[4],c=t[7],u=t[2],f=t[5],d=t[8];return n[0]=i,n[1]=r,n[2]=o,n[3]=s,n[4]=a,n[5]=c,n[6]=u,n[7]=f,n[8]=d,n}static computeEigenDecomposition(t,n){let i=P.EPSILON20,r=10,o=0,s=0;l(n)||(n={});let a=n.unitary=e.clone(e.IDENTITY,n.unitary),c=n.diagonal=e.clone(t,n.diagonal),u=i*e3e(c);for(;s<r&&t3e(c)>u;)n3e(c,lN),e.transpose(lN,$ae),e.multiply(c,lN,c),e.multiply($ae,c,c),e.multiply(a,lN,a),++o>2&&(++s,o=0);return n}static abs(t,n){return n[0]=Math.abs(t[0]),n[1]=Math.abs(t[1]),n[2]=Math.abs(t[2]),n[3]=Math.abs(t[3]),n[4]=Math.abs(t[4]),n[5]=Math.abs(t[5]),n[6]=Math.abs(t[6]),n[7]=Math.abs(t[7]),n[8]=Math.abs(t[8]),n}static determinant(t){let n=t[0],i=t[3],r=t[6],o=t[1],s=t[4],a=t[7],c=t[2],u=t[5],f=t[8];return n*(s*f-u*a)+o*(u*r-i*f)+c*(i*a-s*r)}static inverse(t,n){let i=t[0],r=t[1],o=t[2],s=t[3],a=t[4],c=t[5],u=t[6],f=t[7],d=t[8],p=e.determinant(t);n[0]=a*d-f*c,n[1]=f*o-r*d,n[2]=r*c-a*o,n[3]=u*c-s*d,n[4]=i*d-u*o,n[5]=s*o-i*c,n[6]=s*f-u*a,n[7]=u*r-i*f,n[8]=i*a-s*r;let g=1/p;return e.multiplyByScalar(n,g,n)}static inverseTranspose(t,n){return e.inverse(e.transpose(t,Qke),n)}static equals(t,n){return t===n||l(t)&&l(n)&&t[0]===n[0]&&t[1]===n[1]&&t[2]===n[2]&&t[3]===n[3]&&t[4]===n[4]&&t[5]===n[5]&&t[6]===n[6]&&t[7]===n[7]&&t[8]===n[8]}static equalsEpsilon(t,n,i){return i=i??0,t===n||l(t)&&l(n)&&Math.abs(t[0]-n[0])<=i&&Math.abs(t[1]-n[1])<=i&&Math.abs(t[2]-n[2])<=i&&Math.abs(t[3]-n[3])<=i&&Math.abs(t[4]-n[4])<=i&&Math.abs(t[5]-n[5])<=i&&Math.abs(t[6]-n[6])<=i&&Math.abs(t[7]-n[7])<=i&&Math.abs(t[8]-n[8])<=i}get length(){return e.packedLength}clone(t){return e.clone(this,t)}equals(t){return e.equals(this,t)}static equalsArray(t,n,i){return t[0]===n[i]&&t[1]===n[i+1]&&t[2]===n[i+2]&&t[3]===n[i+3]&&t[4]===n[i+4]&&t[5]===n[i+5]&&t[6]===n[i+6]&&t[7]===n[i+7]&&t[8]===n[i+8]}equalsEpsilon(t,n){return e.equalsEpsilon(this,t,n)}toString(){return`(${this[0]}, ${this[3]}, ${this[6]}) (${this[1]}, ${this[4]}, ${this[7]}) -(${this[2]}, ${this[5]}, ${this[8]})`}};_r.packedLength=9;_r.fromArray=_r.unpack;_r.IDENTITY=new _r(1,0,0,0,1,0,0,0,1);_r.ZERO=new _r(0,0,0,0,0,0,0,0,0);_r.COLUMN0ROW0=0;_r.COLUMN0ROW1=1;_r.COLUMN0ROW2=2;_r.COLUMN1ROW0=3;_r.COLUMN1ROW1=4;_r.COLUMN1ROW2=5;_r.COLUMN2ROW0=6;_r.COLUMN2ROW1=7;_r.COLUMN2ROW2=8;var Xke=new h,Kke=new h,hq=new h,Kae=new h,$ke=new h,Jke=new h,lN=new _r,$ae=new _r,Zke=new _r;function Qke(e){let t=0;for(let n=0;n<9;++n){let i=e[n];t+=i*i}return Math.sqrt(t)}var mq=[1,0,0],pq=[2,2,1];function e3e(e){let t=0;for(let n=0;n<3;++n){let i=e[_r.getElementIndex(pq[n],mq[n])];t+=2*i*i}return Math.sqrt(t)}function t3e(e,t){let n=P.EPSILON15,i=0,r=1;for(let u=0;u<3;++u){let f=Math.abs(e[_r.getElementIndex(pq[u],mq[u])]);f>i&&(r=u,i=f)}let o=1,s=0,a=mq[r],c=pq[r];if(Math.abs(e[_r.getElementIndex(c,a)])>n){let u=e[_r.getElementIndex(c,c)],f=e[_r.getElementIndex(a,a)],d=e[_r.getElementIndex(c,a)],p=(u-f)/2/d,g;p<0?g=-1/(-p+Math.sqrt(1+p*p)):g=1/(p+Math.sqrt(1+p*p)),o=1/Math.sqrt(1+g*g),s=g*o}return t=_r.clone(_r.IDENTITY,t),t[_r.getElementIndex(a,a)]=t[_r.getElementIndex(c,c)]=o,t[_r.getElementIndex(c,a)]=s,t[_r.getElementIndex(a,c)]=-s,t}var $=_r;function LI(e){this.name="RuntimeError",this.message=e;let t;try{throw new Error}catch(n){t=n.stack}this.stack=t}l(Object.create)&&(LI.prototype=Object.create(Error.prototype),LI.prototype.constructor=LI);LI.prototype.toString=function(){let e=`${this.name}: ${this.message}`;return l(this.stack)&&(e+=` -${this.stack.toString()}`),e};var oe=LI;var n3e=Object.freeze([NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN]),uo=class e{constructor(t,n,i,r,o,s,a,c,u,f,d,p,g,m,y,A){let b=Reflect.construct(Array,n3e,new.target);return b[0]=t??0,b[1]=o??0,b[2]=u??0,b[3]=g??0,b[4]=n??0,b[5]=s??0,b[6]=f??0,b[7]=m??0,b[8]=i??0,b[9]=a??0,b[10]=d??0,b[11]=y??0,b[12]=r??0,b[13]=c??0,b[14]=p??0,b[15]=A??0,b}static pack(t,n,i){return i=i??0,n[i++]=t[0],n[i++]=t[1],n[i++]=t[2],n[i++]=t[3],n[i++]=t[4],n[i++]=t[5],n[i++]=t[6],n[i++]=t[7],n[i++]=t[8],n[i++]=t[9],n[i++]=t[10],n[i++]=t[11],n[i++]=t[12],n[i++]=t[13],n[i++]=t[14],n[i]=t[15],n}static unpack(t,n,i){return n=n??0,l(i)||(i=new e),i[0]=t[n++],i[1]=t[n++],i[2]=t[n++],i[3]=t[n++],i[4]=t[n++],i[5]=t[n++],i[6]=t[n++],i[7]=t[n++],i[8]=t[n++],i[9]=t[n++],i[10]=t[n++],i[11]=t[n++],i[12]=t[n++],i[13]=t[n++],i[14]=t[n++],i[15]=t[n],i}static packArray(t,n){let i=t.length,r=i*16;l(n)?!Array.isArray(n)&&n.length!==r||n.length!==r&&(n.length=r):n=new Array(r);for(let o=0;o<i;++o)e.pack(t[o],n,o*16);return n}static unpackArray(t,n){let i=t.length;l(n)?n.length=i/16:n=new Array(i/16);for(let r=0;r<i;r+=16){let o=r/16;n[o]=e.unpack(t,r,n[o])}return n}static clone(t,n){if(l(t))return l(n)?(n[0]=t[0],n[1]=t[1],n[2]=t[2],n[3]=t[3],n[4]=t[4],n[5]=t[5],n[6]=t[6],n[7]=t[7],n[8]=t[8],n[9]=t[9],n[10]=t[10],n[11]=t[11],n[12]=t[12],n[13]=t[13],n[14]=t[14],n[15]=t[15],n):new e(t[0],t[4],t[8],t[12],t[1],t[5],t[9],t[13],t[2],t[6],t[10],t[14],t[3],t[7],t[11],t[15])}static fromColumnMajorArray(t,n){return e.clone(t,n)}static fromRowMajorArray(t,n){return l(n)?(n[0]=t[0],n[1]=t[4],n[2]=t[8],n[3]=t[12],n[4]=t[1],n[5]=t[5],n[6]=t[9],n[7]=t[13],n[8]=t[2],n[9]=t[6],n[10]=t[10],n[11]=t[14],n[12]=t[3],n[13]=t[7],n[14]=t[11],n[15]=t[15],n):new e(t[0],t[1],t[2],t[3],t[4],t[5],t[6],t[7],t[8],t[9],t[10],t[11],t[12],t[13],t[14],t[15])}static fromRotationTranslation(t,n,i){return n=n??h.ZERO,l(i)?(i[0]=t[0],i[1]=t[1],i[2]=t[2],i[3]=0,i[4]=t[3],i[5]=t[4],i[6]=t[5],i[7]=0,i[8]=t[6],i[9]=t[7],i[10]=t[8],i[11]=0,i[12]=n.x,i[13]=n.y,i[14]=n.z,i[15]=1,i):new e(t[0],t[3],t[6],n.x,t[1],t[4],t[7],n.y,t[2],t[5],t[8],n.z,0,0,0,1)}static fromTranslationQuaternionRotationScale(t,n,i,r){l(r)||(r=new e);let o=i.x,s=i.y,a=i.z,c=n.x*n.x,u=n.x*n.y,f=n.x*n.z,d=n.x*n.w,p=n.y*n.y,g=n.y*n.z,m=n.y*n.w,y=n.z*n.z,A=n.z*n.w,b=n.w*n.w,x=c-p-y+b,T=2*(u-A),E=2*(f+m),v=2*(u+A),S=-c+p-y+b,I=2*(g-d),R=2*(f-m),O=2*(g+d),L=-c-p+y+b;return r[0]=x*o,r[1]=v*o,r[2]=R*o,r[3]=0,r[4]=T*s,r[5]=S*s,r[6]=O*s,r[7]=0,r[8]=E*a,r[9]=I*a,r[10]=L*a,r[11]=0,r[12]=t.x,r[13]=t.y,r[14]=t.z,r[15]=1,r}static fromTranslationRotationScale(t,n){return e.fromTranslationQuaternionRotationScale(t.translation,t.rotation,t.scale,n)}static fromTranslation(t,n){return e.fromRotationTranslation($.IDENTITY,t,n)}static fromScale(t,n){return l(n)?(n[0]=t.x,n[1]=0,n[2]=0,n[3]=0,n[4]=0,n[5]=t.y,n[6]=0,n[7]=0,n[8]=0,n[9]=0,n[10]=t.z,n[11]=0,n[12]=0,n[13]=0,n[14]=0,n[15]=1,n):new e(t.x,0,0,0,0,t.y,0,0,0,0,t.z,0,0,0,0,1)}static fromUniformScale(t,n){return l(n)?(n[0]=t,n[1]=0,n[2]=0,n[3]=0,n[4]=0,n[5]=t,n[6]=0,n[7]=0,n[8]=0,n[9]=0,n[10]=t,n[11]=0,n[12]=0,n[13]=0,n[14]=0,n[15]=1,n):new e(t,0,0,0,0,t,0,0,0,0,t,0,0,0,0,1)}static fromRotation(t,n){return l(n)||(n=new e),n[0]=t[0],n[1]=t[1],n[2]=t[2],n[3]=0,n[4]=t[3],n[5]=t[4],n[6]=t[5],n[7]=0,n[8]=t[6],n[9]=t[7],n[10]=t[8],n[11]=0,n[12]=0,n[13]=0,n[14]=0,n[15]=1,n}static fromCamera(t,n){let i=t.position,r=t.direction,o=t.up;h.normalize(r,yE),h.normalize(h.cross(yE,o,AE),AE),h.normalize(h.cross(AE,yE,FI),FI);let s=AE.x,a=AE.y,c=AE.z,u=yE.x,f=yE.y,d=yE.z,p=FI.x,g=FI.y,m=FI.z,y=i.x,A=i.y,b=i.z,x=s*-y+a*-A+c*-b,T=p*-y+g*-A+m*-b,E=u*y+f*A+d*b;return l(n)?(n[0]=s,n[1]=p,n[2]=-u,n[3]=0,n[4]=a,n[5]=g,n[6]=-f,n[7]=0,n[8]=c,n[9]=m,n[10]=-d,n[11]=0,n[12]=x,n[13]=T,n[14]=E,n[15]=1,n):new e(s,a,c,x,p,g,m,T,-u,-f,-d,E,0,0,0,1)}static computePerspectiveFieldOfView(t,n,i,r,o){let a=1/Math.tan(t*.5),c=a/n,u=(r+i)/(i-r),f=2*r*i/(i-r);return o[0]=c,o[1]=0,o[2]=0,o[3]=0,o[4]=0,o[5]=a,o[6]=0,o[7]=0,o[8]=0,o[9]=0,o[10]=u,o[11]=-1,o[12]=0,o[13]=0,o[14]=f,o[15]=0,o}static computeOrthographicOffCenter(t,n,i,r,o,s,a){let c=1/(n-t),u=1/(r-i),f=1/(s-o),d=-(n+t)*c,p=-(r+i)*u,g=-(s+o)*f;return c*=2,u*=2,f*=-2,a[0]=c,a[1]=0,a[2]=0,a[3]=0,a[4]=0,a[5]=u,a[6]=0,a[7]=0,a[8]=0,a[9]=0,a[10]=f,a[11]=0,a[12]=d,a[13]=p,a[14]=g,a[15]=1,a}static computePerspectiveOffCenter(t,n,i,r,o,s,a){let c=2*o/(n-t),u=2*o/(r-i),f=(n+t)/(n-t),d=(r+i)/(r-i),p=-(s+o)/(s-o),g=-1,m=-2*s*o/(s-o);return a[0]=c,a[1]=0,a[2]=0,a[3]=0,a[4]=0,a[5]=u,a[6]=0,a[7]=0,a[8]=f,a[9]=d,a[10]=p,a[11]=g,a[12]=0,a[13]=0,a[14]=m,a[15]=0,a}static computeInfinitePerspectiveOffCenter(t,n,i,r,o,s){let a=2*o/(n-t),c=2*o/(r-i),u=(n+t)/(n-t),f=(r+i)/(r-i),d=-1,p=-1,g=-2*o;return s[0]=a,s[1]=0,s[2]=0,s[3]=0,s[4]=0,s[5]=c,s[6]=0,s[7]=0,s[8]=u,s[9]=f,s[10]=d,s[11]=p,s[12]=0,s[13]=0,s[14]=g,s[15]=0,s}static computeViewportTransformation(t,n,i,r){l(r)||(r=new e),t=t??H.EMPTY_OBJECT;let o=t.x??0,s=t.y??0,a=t.width??0,c=t.height??0;n=n??0,i=i??1;let u=a*.5,f=c*.5,d=(i-n)*.5,p=u,g=f,m=d,y=o+u,A=s+f,b=n+d,x=1;return r[0]=p,r[1]=0,r[2]=0,r[3]=0,r[4]=0,r[5]=g,r[6]=0,r[7]=0,r[8]=0,r[9]=0,r[10]=m,r[11]=0,r[12]=y,r[13]=A,r[14]=b,r[15]=x,r}static computeView(t,n,i,r,o){return o[0]=r.x,o[1]=i.x,o[2]=-n.x,o[3]=0,o[4]=r.y,o[5]=i.y,o[6]=-n.y,o[7]=0,o[8]=r.z,o[9]=i.z,o[10]=-n.z,o[11]=0,o[12]=-h.dot(r,t),o[13]=-h.dot(i,t),o[14]=h.dot(n,t),o[15]=1,o}static toArray(t,n){return l(n)?(n[0]=t[0],n[1]=t[1],n[2]=t[2],n[3]=t[3],n[4]=t[4],n[5]=t[5],n[6]=t[6],n[7]=t[7],n[8]=t[8],n[9]=t[9],n[10]=t[10],n[11]=t[11],n[12]=t[12],n[13]=t[13],n[14]=t[14],n[15]=t[15],n):[t[0],t[1],t[2],t[3],t[4],t[5],t[6],t[7],t[8],t[9],t[10],t[11],t[12],t[13],t[14],t[15]]}static getElementIndex(t,n){return t*4+n}static getColumn(t,n,i){let r=n*4,o=t[r],s=t[r+1],a=t[r+2],c=t[r+3];return i.x=o,i.y=s,i.z=a,i.w=c,i}static setColumn(t,n,i,r){r=e.clone(t,r);let o=n*4;return r[o]=i.x,r[o+1]=i.y,r[o+2]=i.z,r[o+3]=i.w,r}static getRow(t,n,i){let r=t[n],o=t[n+4],s=t[n+8],a=t[n+12];return i.x=r,i.y=o,i.z=s,i.w=a,i}static setRow(t,n,i,r){return r=e.clone(t,r),r[n]=i.x,r[n+4]=i.y,r[n+8]=i.z,r[n+12]=i.w,r}static setTranslation(t,n,i){return i[0]=t[0],i[1]=t[1],i[2]=t[2],i[3]=t[3],i[4]=t[4],i[5]=t[5],i[6]=t[6],i[7]=t[7],i[8]=t[8],i[9]=t[9],i[10]=t[10],i[11]=t[11],i[12]=n.x,i[13]=n.y,i[14]=n.z,i[15]=t[15],i}static setScale(t,n,i){let r=e.getScale(t,i3e),o=n.x/r.x,s=n.y/r.y,a=n.z/r.z;return i[0]=t[0]*o,i[1]=t[1]*o,i[2]=t[2]*o,i[3]=t[3],i[4]=t[4]*s,i[5]=t[5]*s,i[6]=t[6]*s,i[7]=t[7],i[8]=t[8]*a,i[9]=t[9]*a,i[10]=t[10]*a,i[11]=t[11],i[12]=t[12],i[13]=t[13],i[14]=t[14],i[15]=t[15],i}static setUniformScale(t,n,i){let r=e.getScale(t,r3e),o=n/r.x,s=n/r.y,a=n/r.z;return i[0]=t[0]*o,i[1]=t[1]*o,i[2]=t[2]*o,i[3]=t[3],i[4]=t[4]*s,i[5]=t[5]*s,i[6]=t[6]*s,i[7]=t[7],i[8]=t[8]*a,i[9]=t[9]*a,i[10]=t[10]*a,i[11]=t[11],i[12]=t[12],i[13]=t[13],i[14]=t[14],i[15]=t[15],i}static getScale(t,n){return n.x=h.magnitude(h.fromElements(t[0],t[1],t[2],gq)),n.y=h.magnitude(h.fromElements(t[4],t[5],t[6],gq)),n.z=h.magnitude(h.fromElements(t[8],t[9],t[10],gq)),n}static getMaximumScale(t){return e.getScale(t,Jae),h.maximumComponent(Jae)}static setRotation(t,n,i){let r=e.getScale(t,o3e);return i[0]=n[0]*r.x,i[1]=n[1]*r.x,i[2]=n[2]*r.x,i[3]=t[3],i[4]=n[3]*r.y,i[5]=n[4]*r.y,i[6]=n[5]*r.y,i[7]=t[7],i[8]=n[6]*r.z,i[9]=n[7]*r.z,i[10]=n[8]*r.z,i[11]=t[11],i[12]=t[12],i[13]=t[13],i[14]=t[14],i[15]=t[15],i}static getRotation(t,n){let i=e.getScale(t,s3e);return n[0]=t[0]/i.x,n[1]=t[1]/i.x,n[2]=t[2]/i.x,n[3]=t[4]/i.y,n[4]=t[5]/i.y,n[5]=t[6]/i.y,n[6]=t[8]/i.z,n[7]=t[9]/i.z,n[8]=t[10]/i.z,n}static multiply(t,n,i){let r=t[0],o=t[1],s=t[2],a=t[3],c=t[4],u=t[5],f=t[6],d=t[7],p=t[8],g=t[9],m=t[10],y=t[11],A=t[12],b=t[13],x=t[14],T=t[15],E=n[0],v=n[1],S=n[2],I=n[3],R=n[4],O=n[5],L=n[6],_=n[7],C=n[8],w=n[9],D=n[10],N=n[11],F=n[12],V=n[13],B=n[14],j=n[15],k=r*E+c*v+p*S+A*I,G=o*E+u*v+g*S+b*I,q=s*E+f*v+m*S+x*I,Q=a*E+d*v+y*S+T*I,W=r*R+c*O+p*L+A*_,J=o*R+u*O+g*L+b*_,Z=s*R+f*O+m*L+x*_,ae=a*R+d*O+y*L+T*_,Ae=r*C+c*w+p*D+A*N,fe=o*C+u*w+g*D+b*N,xe=s*C+f*w+m*D+x*N,ge=a*C+d*w+y*D+T*N,we=r*F+c*V+p*B+A*j,ve=o*F+u*V+g*B+b*j,Re=s*F+f*V+m*B+x*j,Qe=a*F+d*V+y*B+T*j;return i[0]=k,i[1]=G,i[2]=q,i[3]=Q,i[4]=W,i[5]=J,i[6]=Z,i[7]=ae,i[8]=Ae,i[9]=fe,i[10]=xe,i[11]=ge,i[12]=we,i[13]=ve,i[14]=Re,i[15]=Qe,i}static add(t,n,i){return i[0]=t[0]+n[0],i[1]=t[1]+n[1],i[2]=t[2]+n[2],i[3]=t[3]+n[3],i[4]=t[4]+n[4],i[5]=t[5]+n[5],i[6]=t[6]+n[6],i[7]=t[7]+n[7],i[8]=t[8]+n[8],i[9]=t[9]+n[9],i[10]=t[10]+n[10],i[11]=t[11]+n[11],i[12]=t[12]+n[12],i[13]=t[13]+n[13],i[14]=t[14]+n[14],i[15]=t[15]+n[15],i}static subtract(t,n,i){return i[0]=t[0]-n[0],i[1]=t[1]-n[1],i[2]=t[2]-n[2],i[3]=t[3]-n[3],i[4]=t[4]-n[4],i[5]=t[5]-n[5],i[6]=t[6]-n[6],i[7]=t[7]-n[7],i[8]=t[8]-n[8],i[9]=t[9]-n[9],i[10]=t[10]-n[10],i[11]=t[11]-n[11],i[12]=t[12]-n[12],i[13]=t[13]-n[13],i[14]=t[14]-n[14],i[15]=t[15]-n[15],i}static multiplyTransformation(t,n,i){let r=t[0],o=t[1],s=t[2],a=t[4],c=t[5],u=t[6],f=t[8],d=t[9],p=t[10],g=t[12],m=t[13],y=t[14],A=n[0],b=n[1],x=n[2],T=n[4],E=n[5],v=n[6],S=n[8],I=n[9],R=n[10],O=n[12],L=n[13],_=n[14],C=r*A+a*b+f*x,w=o*A+c*b+d*x,D=s*A+u*b+p*x,N=r*T+a*E+f*v,F=o*T+c*E+d*v,V=s*T+u*E+p*v,B=r*S+a*I+f*R,j=o*S+c*I+d*R,k=s*S+u*I+p*R,G=r*O+a*L+f*_+g,q=o*O+c*L+d*_+m,Q=s*O+u*L+p*_+y;return i[0]=C,i[1]=w,i[2]=D,i[3]=0,i[4]=N,i[5]=F,i[6]=V,i[7]=0,i[8]=B,i[9]=j,i[10]=k,i[11]=0,i[12]=G,i[13]=q,i[14]=Q,i[15]=1,i}static multiplyByMatrix3(t,n,i){let r=t[0],o=t[1],s=t[2],a=t[4],c=t[5],u=t[6],f=t[8],d=t[9],p=t[10],g=n[0],m=n[1],y=n[2],A=n[3],b=n[4],x=n[5],T=n[6],E=n[7],v=n[8],S=r*g+a*m+f*y,I=o*g+c*m+d*y,R=s*g+u*m+p*y,O=r*A+a*b+f*x,L=o*A+c*b+d*x,_=s*A+u*b+p*x,C=r*T+a*E+f*v,w=o*T+c*E+d*v,D=s*T+u*E+p*v;return i[0]=S,i[1]=I,i[2]=R,i[3]=0,i[4]=O,i[5]=L,i[6]=_,i[7]=0,i[8]=C,i[9]=w,i[10]=D,i[11]=0,i[12]=t[12],i[13]=t[13],i[14]=t[14],i[15]=t[15],i}static multiplyByTranslation(t,n,i){let r=n.x,o=n.y,s=n.z,a=r*t[0]+o*t[4]+s*t[8]+t[12],c=r*t[1]+o*t[5]+s*t[9]+t[13],u=r*t[2]+o*t[6]+s*t[10]+t[14];return i[0]=t[0],i[1]=t[1],i[2]=t[2],i[3]=t[3],i[4]=t[4],i[5]=t[5],i[6]=t[6],i[7]=t[7],i[8]=t[8],i[9]=t[9],i[10]=t[10],i[11]=t[11],i[12]=a,i[13]=c,i[14]=u,i[15]=t[15],i}static multiplyByScale(t,n,i){let r=n.x,o=n.y,s=n.z;return r===1&&o===1&&s===1?e.clone(t,i):(i[0]=r*t[0],i[1]=r*t[1],i[2]=r*t[2],i[3]=t[3],i[4]=o*t[4],i[5]=o*t[5],i[6]=o*t[6],i[7]=t[7],i[8]=s*t[8],i[9]=s*t[9],i[10]=s*t[10],i[11]=t[11],i[12]=t[12],i[13]=t[13],i[14]=t[14],i[15]=t[15],i)}static multiplyByUniformScale(t,n,i){return i[0]=t[0]*n,i[1]=t[1]*n,i[2]=t[2]*n,i[3]=t[3],i[4]=t[4]*n,i[5]=t[5]*n,i[6]=t[6]*n,i[7]=t[7],i[8]=t[8]*n,i[9]=t[9]*n,i[10]=t[10]*n,i[11]=t[11],i[12]=t[12],i[13]=t[13],i[14]=t[14],i[15]=t[15],i}static multiplyByVector(t,n,i){let r=n.x,o=n.y,s=n.z,a=n.w,c=t[0]*r+t[4]*o+t[8]*s+t[12]*a,u=t[1]*r+t[5]*o+t[9]*s+t[13]*a,f=t[2]*r+t[6]*o+t[10]*s+t[14]*a,d=t[3]*r+t[7]*o+t[11]*s+t[15]*a;return i.x=c,i.y=u,i.z=f,i.w=d,i}static multiplyByPointAsVector(t,n,i){let r=n.x,o=n.y,s=n.z,a=t[0]*r+t[4]*o+t[8]*s,c=t[1]*r+t[5]*o+t[9]*s,u=t[2]*r+t[6]*o+t[10]*s;return i.x=a,i.y=c,i.z=u,i}static multiplyByPoint(t,n,i){let r=n.x,o=n.y,s=n.z,a=t[0]*r+t[4]*o+t[8]*s+t[12],c=t[1]*r+t[5]*o+t[9]*s+t[13],u=t[2]*r+t[6]*o+t[10]*s+t[14];return i.x=a,i.y=c,i.z=u,i}static multiplyByScalar(t,n,i){return i[0]=t[0]*n,i[1]=t[1]*n,i[2]=t[2]*n,i[3]=t[3]*n,i[4]=t[4]*n,i[5]=t[5]*n,i[6]=t[6]*n,i[7]=t[7]*n,i[8]=t[8]*n,i[9]=t[9]*n,i[10]=t[10]*n,i[11]=t[11]*n,i[12]=t[12]*n,i[13]=t[13]*n,i[14]=t[14]*n,i[15]=t[15]*n,i}static negate(t,n){return n[0]=-t[0],n[1]=-t[1],n[2]=-t[2],n[3]=-t[3],n[4]=-t[4],n[5]=-t[5],n[6]=-t[6],n[7]=-t[7],n[8]=-t[8],n[9]=-t[9],n[10]=-t[10],n[11]=-t[11],n[12]=-t[12],n[13]=-t[13],n[14]=-t[14],n[15]=-t[15],n}static transpose(t,n){let i=t[1],r=t[2],o=t[3],s=t[6],a=t[7],c=t[11];return n[0]=t[0],n[1]=t[4],n[2]=t[8],n[3]=t[12],n[4]=i,n[5]=t[5],n[6]=t[9],n[7]=t[13],n[8]=r,n[9]=s,n[10]=t[10],n[11]=t[14],n[12]=o,n[13]=a,n[14]=c,n[15]=t[15],n}static abs(t,n){return n[0]=Math.abs(t[0]),n[1]=Math.abs(t[1]),n[2]=Math.abs(t[2]),n[3]=Math.abs(t[3]),n[4]=Math.abs(t[4]),n[5]=Math.abs(t[5]),n[6]=Math.abs(t[6]),n[7]=Math.abs(t[7]),n[8]=Math.abs(t[8]),n[9]=Math.abs(t[9]),n[10]=Math.abs(t[10]),n[11]=Math.abs(t[11]),n[12]=Math.abs(t[12]),n[13]=Math.abs(t[13]),n[14]=Math.abs(t[14]),n[15]=Math.abs(t[15]),n}static equals(t,n){return t===n||l(t)&&l(n)&&t[12]===n[12]&&t[13]===n[13]&&t[14]===n[14]&&t[0]===n[0]&&t[1]===n[1]&&t[2]===n[2]&&t[4]===n[4]&&t[5]===n[5]&&t[6]===n[6]&&t[8]===n[8]&&t[9]===n[9]&&t[10]===n[10]&&t[3]===n[3]&&t[7]===n[7]&&t[11]===n[11]&&t[15]===n[15]}static equalsEpsilon(t,n,i){return i=i??0,t===n||l(t)&&l(n)&&Math.abs(t[0]-n[0])<=i&&Math.abs(t[1]-n[1])<=i&&Math.abs(t[2]-n[2])<=i&&Math.abs(t[3]-n[3])<=i&&Math.abs(t[4]-n[4])<=i&&Math.abs(t[5]-n[5])<=i&&Math.abs(t[6]-n[6])<=i&&Math.abs(t[7]-n[7])<=i&&Math.abs(t[8]-n[8])<=i&&Math.abs(t[9]-n[9])<=i&&Math.abs(t[10]-n[10])<=i&&Math.abs(t[11]-n[11])<=i&&Math.abs(t[12]-n[12])<=i&&Math.abs(t[13]-n[13])<=i&&Math.abs(t[14]-n[14])<=i&&Math.abs(t[15]-n[15])<=i}static getTranslation(t,n){return n.x=t[12],n.y=t[13],n.z=t[14],n}static getMatrix3(t,n){return n[0]=t[0],n[1]=t[1],n[2]=t[2],n[3]=t[4],n[4]=t[5],n[5]=t[6],n[6]=t[8],n[7]=t[9],n[8]=t[10],n}static inverse(t,n){let i=t[0],r=t[4],o=t[8],s=t[12],a=t[1],c=t[5],u=t[9],f=t[13],d=t[2],p=t[6],g=t[10],m=t[14],y=t[3],A=t[7],b=t[11],x=t[15],T=g*x,E=m*b,v=p*x,S=m*A,I=p*b,R=g*A,O=d*x,L=m*y,_=d*b,C=g*y,w=d*A,D=p*y,N=T*c+S*u+I*f-(E*c+v*u+R*f),F=E*a+O*u+C*f-(T*a+L*u+_*f),V=v*a+L*c+w*f-(S*a+O*c+D*f),B=R*a+_*c+D*u-(I*a+C*c+w*u),j=E*r+v*o+R*s-(T*r+S*o+I*s),k=T*i+L*o+_*s-(E*i+O*o+C*s),G=S*i+O*r+D*s-(v*i+L*r+w*s),q=I*i+C*r+w*o-(R*i+_*r+D*o);T=o*f,E=s*u,v=r*f,S=s*c,I=r*u,R=o*c,O=i*f,L=s*a,_=i*u,C=o*a,w=i*c,D=r*a;let Q=T*A+S*b+I*x-(E*A+v*b+R*x),W=E*y+O*b+C*x-(T*y+L*b+_*x),J=v*y+L*A+w*x-(S*y+O*A+D*x),Z=R*y+_*A+D*b-(I*y+C*A+w*b),ae=v*g+R*m+E*p-(I*m+T*p+S*g),Ae=_*m+T*d+L*g-(O*g+C*m+E*d),fe=O*p+D*m+S*d-(w*m+v*d+L*p),xe=w*g+I*d+C*p-(_*p+D*g+R*d),ge=i*N+r*F+o*V+s*B;if(Math.abs(ge)<P.EPSILON21){if($.equalsEpsilon(e.getMatrix3(t,a3e),c3e,P.EPSILON7)&&se.equals(e.getRow(t,3,l3e),u3e))return n[0]=0,n[1]=0,n[2]=0,n[3]=0,n[4]=0,n[5]=0,n[6]=0,n[7]=0,n[8]=0,n[9]=0,n[10]=0,n[11]=0,n[12]=-t[12],n[13]=-t[13],n[14]=-t[14],n[15]=1,n;throw new oe("matrix is not invertible because its determinate is zero.")}return ge=1/ge,n[0]=N*ge,n[1]=F*ge,n[2]=V*ge,n[3]=B*ge,n[4]=j*ge,n[5]=k*ge,n[6]=G*ge,n[7]=q*ge,n[8]=Q*ge,n[9]=W*ge,n[10]=J*ge,n[11]=Z*ge,n[12]=ae*ge,n[13]=Ae*ge,n[14]=fe*ge,n[15]=xe*ge,n}static inverseTransformation(t,n){let i=t[0],r=t[1],o=t[2],s=t[4],a=t[5],c=t[6],u=t[8],f=t[9],d=t[10],p=t[12],g=t[13],m=t[14],y=-i*p-r*g-o*m,A=-s*p-a*g-c*m,b=-u*p-f*g-d*m;return n[0]=i,n[1]=s,n[2]=u,n[3]=0,n[4]=r,n[5]=a,n[6]=f,n[7]=0,n[8]=o,n[9]=c,n[10]=d,n[11]=0,n[12]=y,n[13]=A,n[14]=b,n[15]=1,n}static inverseTranspose(t,n){return e.inverse(e.transpose(t,f3e),n)}get length(){return e.packedLength}clone(t){return e.clone(this,t)}equals(t){return e.equals(this,t)}static equalsArray(t,n,i){return t[0]===n[i]&&t[1]===n[i+1]&&t[2]===n[i+2]&&t[3]===n[i+3]&&t[4]===n[i+4]&&t[5]===n[i+5]&&t[6]===n[i+6]&&t[7]===n[i+7]&&t[8]===n[i+8]&&t[9]===n[i+9]&&t[10]===n[i+10]&&t[11]===n[i+11]&&t[12]===n[i+12]&&t[13]===n[i+13]&&t[14]===n[i+14]&&t[15]===n[i+15]}equalsEpsilon(t,n){return e.equalsEpsilon(this,t,n)}toString(){return`(${this[0]}, ${this[4]}, ${this[8]}, ${this[12]}) +(${this[2]}, ${this[5]}, ${this[8]})`}};_r.packedLength=9;_r.fromArray=_r.unpack;_r.IDENTITY=new _r(1,0,0,0,1,0,0,0,1);_r.ZERO=new _r(0,0,0,0,0,0,0,0,0);_r.COLUMN0ROW0=0;_r.COLUMN0ROW1=1;_r.COLUMN0ROW2=2;_r.COLUMN1ROW0=3;_r.COLUMN1ROW1=4;_r.COLUMN1ROW2=5;_r.COLUMN2ROW0=6;_r.COLUMN2ROW1=7;_r.COLUMN2ROW2=8;var Kke=new h,$ke=new h,hq=new h,Kae=new h,Jke=new h,Zke=new h,lN=new _r,$ae=new _r,Qke=new _r;function e3e(e){let t=0;for(let n=0;n<9;++n){let i=e[n];t+=i*i}return Math.sqrt(t)}var mq=[1,0,0],pq=[2,2,1];function t3e(e){let t=0;for(let n=0;n<3;++n){let i=e[_r.getElementIndex(pq[n],mq[n])];t+=2*i*i}return Math.sqrt(t)}function n3e(e,t){let n=P.EPSILON15,i=0,r=1;for(let u=0;u<3;++u){let f=Math.abs(e[_r.getElementIndex(pq[u],mq[u])]);f>i&&(r=u,i=f)}let o=1,s=0,a=mq[r],c=pq[r];if(Math.abs(e[_r.getElementIndex(c,a)])>n){let u=e[_r.getElementIndex(c,c)],f=e[_r.getElementIndex(a,a)],d=e[_r.getElementIndex(c,a)],p=(u-f)/2/d,g;p<0?g=-1/(-p+Math.sqrt(1+p*p)):g=1/(p+Math.sqrt(1+p*p)),o=1/Math.sqrt(1+g*g),s=g*o}return t=_r.clone(_r.IDENTITY,t),t[_r.getElementIndex(a,a)]=t[_r.getElementIndex(c,c)]=o,t[_r.getElementIndex(c,a)]=s,t[_r.getElementIndex(a,c)]=-s,t}var $=_r;function LI(e){this.name="RuntimeError",this.message=e;let t;try{throw new Error}catch(n){t=n.stack}this.stack=t}l(Object.create)&&(LI.prototype=Object.create(Error.prototype),LI.prototype.constructor=LI);LI.prototype.toString=function(){let e=`${this.name}: ${this.message}`;return l(this.stack)&&(e+=` +${this.stack.toString()}`),e};var oe=LI;var i3e=Object.freeze([NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN,NaN]),uo=class e{constructor(t,n,i,r,o,s,a,c,u,f,d,p,g,m,y,A){let b=Reflect.construct(Array,i3e,new.target);return b[0]=t??0,b[1]=o??0,b[2]=u??0,b[3]=g??0,b[4]=n??0,b[5]=s??0,b[6]=f??0,b[7]=m??0,b[8]=i??0,b[9]=a??0,b[10]=d??0,b[11]=y??0,b[12]=r??0,b[13]=c??0,b[14]=p??0,b[15]=A??0,b}static pack(t,n,i){return i=i??0,n[i++]=t[0],n[i++]=t[1],n[i++]=t[2],n[i++]=t[3],n[i++]=t[4],n[i++]=t[5],n[i++]=t[6],n[i++]=t[7],n[i++]=t[8],n[i++]=t[9],n[i++]=t[10],n[i++]=t[11],n[i++]=t[12],n[i++]=t[13],n[i++]=t[14],n[i]=t[15],n}static unpack(t,n,i){return n=n??0,l(i)||(i=new e),i[0]=t[n++],i[1]=t[n++],i[2]=t[n++],i[3]=t[n++],i[4]=t[n++],i[5]=t[n++],i[6]=t[n++],i[7]=t[n++],i[8]=t[n++],i[9]=t[n++],i[10]=t[n++],i[11]=t[n++],i[12]=t[n++],i[13]=t[n++],i[14]=t[n++],i[15]=t[n],i}static packArray(t,n){let i=t.length,r=i*16;l(n)?!Array.isArray(n)&&n.length!==r||n.length!==r&&(n.length=r):n=new Array(r);for(let o=0;o<i;++o)e.pack(t[o],n,o*16);return n}static unpackArray(t,n){let i=t.length;l(n)?n.length=i/16:n=new Array(i/16);for(let r=0;r<i;r+=16){let o=r/16;n[o]=e.unpack(t,r,n[o])}return n}static clone(t,n){if(l(t))return l(n)?(n[0]=t[0],n[1]=t[1],n[2]=t[2],n[3]=t[3],n[4]=t[4],n[5]=t[5],n[6]=t[6],n[7]=t[7],n[8]=t[8],n[9]=t[9],n[10]=t[10],n[11]=t[11],n[12]=t[12],n[13]=t[13],n[14]=t[14],n[15]=t[15],n):new e(t[0],t[4],t[8],t[12],t[1],t[5],t[9],t[13],t[2],t[6],t[10],t[14],t[3],t[7],t[11],t[15])}static fromColumnMajorArray(t,n){return e.clone(t,n)}static fromRowMajorArray(t,n){return l(n)?(n[0]=t[0],n[1]=t[4],n[2]=t[8],n[3]=t[12],n[4]=t[1],n[5]=t[5],n[6]=t[9],n[7]=t[13],n[8]=t[2],n[9]=t[6],n[10]=t[10],n[11]=t[14],n[12]=t[3],n[13]=t[7],n[14]=t[11],n[15]=t[15],n):new e(t[0],t[1],t[2],t[3],t[4],t[5],t[6],t[7],t[8],t[9],t[10],t[11],t[12],t[13],t[14],t[15])}static fromRotationTranslation(t,n,i){return n=n??h.ZERO,l(i)?(i[0]=t[0],i[1]=t[1],i[2]=t[2],i[3]=0,i[4]=t[3],i[5]=t[4],i[6]=t[5],i[7]=0,i[8]=t[6],i[9]=t[7],i[10]=t[8],i[11]=0,i[12]=n.x,i[13]=n.y,i[14]=n.z,i[15]=1,i):new e(t[0],t[3],t[6],n.x,t[1],t[4],t[7],n.y,t[2],t[5],t[8],n.z,0,0,0,1)}static fromTranslationQuaternionRotationScale(t,n,i,r){l(r)||(r=new e);let o=i.x,s=i.y,a=i.z,c=n.x*n.x,u=n.x*n.y,f=n.x*n.z,d=n.x*n.w,p=n.y*n.y,g=n.y*n.z,m=n.y*n.w,y=n.z*n.z,A=n.z*n.w,b=n.w*n.w,x=c-p-y+b,T=2*(u-A),E=2*(f+m),v=2*(u+A),S=-c+p-y+b,I=2*(g-d),R=2*(f-m),O=2*(g+d),L=-c-p+y+b;return r[0]=x*o,r[1]=v*o,r[2]=R*o,r[3]=0,r[4]=T*s,r[5]=S*s,r[6]=O*s,r[7]=0,r[8]=E*a,r[9]=I*a,r[10]=L*a,r[11]=0,r[12]=t.x,r[13]=t.y,r[14]=t.z,r[15]=1,r}static fromTranslationRotationScale(t,n){return e.fromTranslationQuaternionRotationScale(t.translation,t.rotation,t.scale,n)}static fromTranslation(t,n){return e.fromRotationTranslation($.IDENTITY,t,n)}static fromScale(t,n){return l(n)?(n[0]=t.x,n[1]=0,n[2]=0,n[3]=0,n[4]=0,n[5]=t.y,n[6]=0,n[7]=0,n[8]=0,n[9]=0,n[10]=t.z,n[11]=0,n[12]=0,n[13]=0,n[14]=0,n[15]=1,n):new e(t.x,0,0,0,0,t.y,0,0,0,0,t.z,0,0,0,0,1)}static fromUniformScale(t,n){return l(n)?(n[0]=t,n[1]=0,n[2]=0,n[3]=0,n[4]=0,n[5]=t,n[6]=0,n[7]=0,n[8]=0,n[9]=0,n[10]=t,n[11]=0,n[12]=0,n[13]=0,n[14]=0,n[15]=1,n):new e(t,0,0,0,0,t,0,0,0,0,t,0,0,0,0,1)}static fromRotation(t,n){return l(n)||(n=new e),n[0]=t[0],n[1]=t[1],n[2]=t[2],n[3]=0,n[4]=t[3],n[5]=t[4],n[6]=t[5],n[7]=0,n[8]=t[6],n[9]=t[7],n[10]=t[8],n[11]=0,n[12]=0,n[13]=0,n[14]=0,n[15]=1,n}static fromCamera(t,n){let i=t.position,r=t.direction,o=t.up;h.normalize(r,yE),h.normalize(h.cross(yE,o,AE),AE),h.normalize(h.cross(AE,yE,FI),FI);let s=AE.x,a=AE.y,c=AE.z,u=yE.x,f=yE.y,d=yE.z,p=FI.x,g=FI.y,m=FI.z,y=i.x,A=i.y,b=i.z,x=s*-y+a*-A+c*-b,T=p*-y+g*-A+m*-b,E=u*y+f*A+d*b;return l(n)?(n[0]=s,n[1]=p,n[2]=-u,n[3]=0,n[4]=a,n[5]=g,n[6]=-f,n[7]=0,n[8]=c,n[9]=m,n[10]=-d,n[11]=0,n[12]=x,n[13]=T,n[14]=E,n[15]=1,n):new e(s,a,c,x,p,g,m,T,-u,-f,-d,E,0,0,0,1)}static computePerspectiveFieldOfView(t,n,i,r,o){let a=1/Math.tan(t*.5),c=a/n,u=(r+i)/(i-r),f=2*r*i/(i-r);return o[0]=c,o[1]=0,o[2]=0,o[3]=0,o[4]=0,o[5]=a,o[6]=0,o[7]=0,o[8]=0,o[9]=0,o[10]=u,o[11]=-1,o[12]=0,o[13]=0,o[14]=f,o[15]=0,o}static computeOrthographicOffCenter(t,n,i,r,o,s,a){let c=1/(n-t),u=1/(r-i),f=1/(s-o),d=-(n+t)*c,p=-(r+i)*u,g=-(s+o)*f;return c*=2,u*=2,f*=-2,a[0]=c,a[1]=0,a[2]=0,a[3]=0,a[4]=0,a[5]=u,a[6]=0,a[7]=0,a[8]=0,a[9]=0,a[10]=f,a[11]=0,a[12]=d,a[13]=p,a[14]=g,a[15]=1,a}static computePerspectiveOffCenter(t,n,i,r,o,s,a){let c=2*o/(n-t),u=2*o/(r-i),f=(n+t)/(n-t),d=(r+i)/(r-i),p=-(s+o)/(s-o),g=-1,m=-2*s*o/(s-o);return a[0]=c,a[1]=0,a[2]=0,a[3]=0,a[4]=0,a[5]=u,a[6]=0,a[7]=0,a[8]=f,a[9]=d,a[10]=p,a[11]=g,a[12]=0,a[13]=0,a[14]=m,a[15]=0,a}static computeInfinitePerspectiveOffCenter(t,n,i,r,o,s){let a=2*o/(n-t),c=2*o/(r-i),u=(n+t)/(n-t),f=(r+i)/(r-i),d=-1,p=-1,g=-2*o;return s[0]=a,s[1]=0,s[2]=0,s[3]=0,s[4]=0,s[5]=c,s[6]=0,s[7]=0,s[8]=u,s[9]=f,s[10]=d,s[11]=p,s[12]=0,s[13]=0,s[14]=g,s[15]=0,s}static computeViewportTransformation(t,n,i,r){l(r)||(r=new e),t=t??H.EMPTY_OBJECT;let o=t.x??0,s=t.y??0,a=t.width??0,c=t.height??0;n=n??0,i=i??1;let u=a*.5,f=c*.5,d=(i-n)*.5,p=u,g=f,m=d,y=o+u,A=s+f,b=n+d,x=1;return r[0]=p,r[1]=0,r[2]=0,r[3]=0,r[4]=0,r[5]=g,r[6]=0,r[7]=0,r[8]=0,r[9]=0,r[10]=m,r[11]=0,r[12]=y,r[13]=A,r[14]=b,r[15]=x,r}static computeView(t,n,i,r,o){return o[0]=r.x,o[1]=i.x,o[2]=-n.x,o[3]=0,o[4]=r.y,o[5]=i.y,o[6]=-n.y,o[7]=0,o[8]=r.z,o[9]=i.z,o[10]=-n.z,o[11]=0,o[12]=-h.dot(r,t),o[13]=-h.dot(i,t),o[14]=h.dot(n,t),o[15]=1,o}static toArray(t,n){return l(n)?(n[0]=t[0],n[1]=t[1],n[2]=t[2],n[3]=t[3],n[4]=t[4],n[5]=t[5],n[6]=t[6],n[7]=t[7],n[8]=t[8],n[9]=t[9],n[10]=t[10],n[11]=t[11],n[12]=t[12],n[13]=t[13],n[14]=t[14],n[15]=t[15],n):[t[0],t[1],t[2],t[3],t[4],t[5],t[6],t[7],t[8],t[9],t[10],t[11],t[12],t[13],t[14],t[15]]}static getElementIndex(t,n){return t*4+n}static getColumn(t,n,i){let r=n*4,o=t[r],s=t[r+1],a=t[r+2],c=t[r+3];return i.x=o,i.y=s,i.z=a,i.w=c,i}static setColumn(t,n,i,r){r=e.clone(t,r);let o=n*4;return r[o]=i.x,r[o+1]=i.y,r[o+2]=i.z,r[o+3]=i.w,r}static getRow(t,n,i){let r=t[n],o=t[n+4],s=t[n+8],a=t[n+12];return i.x=r,i.y=o,i.z=s,i.w=a,i}static setRow(t,n,i,r){return r=e.clone(t,r),r[n]=i.x,r[n+4]=i.y,r[n+8]=i.z,r[n+12]=i.w,r}static setTranslation(t,n,i){return i[0]=t[0],i[1]=t[1],i[2]=t[2],i[3]=t[3],i[4]=t[4],i[5]=t[5],i[6]=t[6],i[7]=t[7],i[8]=t[8],i[9]=t[9],i[10]=t[10],i[11]=t[11],i[12]=n.x,i[13]=n.y,i[14]=n.z,i[15]=t[15],i}static setScale(t,n,i){let r=e.getScale(t,r3e),o=n.x/r.x,s=n.y/r.y,a=n.z/r.z;return i[0]=t[0]*o,i[1]=t[1]*o,i[2]=t[2]*o,i[3]=t[3],i[4]=t[4]*s,i[5]=t[5]*s,i[6]=t[6]*s,i[7]=t[7],i[8]=t[8]*a,i[9]=t[9]*a,i[10]=t[10]*a,i[11]=t[11],i[12]=t[12],i[13]=t[13],i[14]=t[14],i[15]=t[15],i}static setUniformScale(t,n,i){let r=e.getScale(t,o3e),o=n/r.x,s=n/r.y,a=n/r.z;return i[0]=t[0]*o,i[1]=t[1]*o,i[2]=t[2]*o,i[3]=t[3],i[4]=t[4]*s,i[5]=t[5]*s,i[6]=t[6]*s,i[7]=t[7],i[8]=t[8]*a,i[9]=t[9]*a,i[10]=t[10]*a,i[11]=t[11],i[12]=t[12],i[13]=t[13],i[14]=t[14],i[15]=t[15],i}static getScale(t,n){return n.x=h.magnitude(h.fromElements(t[0],t[1],t[2],gq)),n.y=h.magnitude(h.fromElements(t[4],t[5],t[6],gq)),n.z=h.magnitude(h.fromElements(t[8],t[9],t[10],gq)),n}static getMaximumScale(t){return e.getScale(t,Jae),h.maximumComponent(Jae)}static setRotation(t,n,i){let r=e.getScale(t,s3e);return i[0]=n[0]*r.x,i[1]=n[1]*r.x,i[2]=n[2]*r.x,i[3]=t[3],i[4]=n[3]*r.y,i[5]=n[4]*r.y,i[6]=n[5]*r.y,i[7]=t[7],i[8]=n[6]*r.z,i[9]=n[7]*r.z,i[10]=n[8]*r.z,i[11]=t[11],i[12]=t[12],i[13]=t[13],i[14]=t[14],i[15]=t[15],i}static getRotation(t,n){let i=e.getScale(t,a3e);return n[0]=t[0]/i.x,n[1]=t[1]/i.x,n[2]=t[2]/i.x,n[3]=t[4]/i.y,n[4]=t[5]/i.y,n[5]=t[6]/i.y,n[6]=t[8]/i.z,n[7]=t[9]/i.z,n[8]=t[10]/i.z,n}static multiply(t,n,i){let r=t[0],o=t[1],s=t[2],a=t[3],c=t[4],u=t[5],f=t[6],d=t[7],p=t[8],g=t[9],m=t[10],y=t[11],A=t[12],b=t[13],x=t[14],T=t[15],E=n[0],v=n[1],S=n[2],I=n[3],R=n[4],O=n[5],L=n[6],_=n[7],C=n[8],w=n[9],D=n[10],N=n[11],F=n[12],V=n[13],B=n[14],j=n[15],k=r*E+c*v+p*S+A*I,G=o*E+u*v+g*S+b*I,q=s*E+f*v+m*S+x*I,Q=a*E+d*v+y*S+T*I,W=r*R+c*O+p*L+A*_,J=o*R+u*O+g*L+b*_,Z=s*R+f*O+m*L+x*_,ae=a*R+d*O+y*L+T*_,Ae=r*C+c*w+p*D+A*N,fe=o*C+u*w+g*D+b*N,xe=s*C+f*w+m*D+x*N,ge=a*C+d*w+y*D+T*N,we=r*F+c*V+p*B+A*j,ve=o*F+u*V+g*B+b*j,Re=s*F+f*V+m*B+x*j,Qe=a*F+d*V+y*B+T*j;return i[0]=k,i[1]=G,i[2]=q,i[3]=Q,i[4]=W,i[5]=J,i[6]=Z,i[7]=ae,i[8]=Ae,i[9]=fe,i[10]=xe,i[11]=ge,i[12]=we,i[13]=ve,i[14]=Re,i[15]=Qe,i}static add(t,n,i){return i[0]=t[0]+n[0],i[1]=t[1]+n[1],i[2]=t[2]+n[2],i[3]=t[3]+n[3],i[4]=t[4]+n[4],i[5]=t[5]+n[5],i[6]=t[6]+n[6],i[7]=t[7]+n[7],i[8]=t[8]+n[8],i[9]=t[9]+n[9],i[10]=t[10]+n[10],i[11]=t[11]+n[11],i[12]=t[12]+n[12],i[13]=t[13]+n[13],i[14]=t[14]+n[14],i[15]=t[15]+n[15],i}static subtract(t,n,i){return i[0]=t[0]-n[0],i[1]=t[1]-n[1],i[2]=t[2]-n[2],i[3]=t[3]-n[3],i[4]=t[4]-n[4],i[5]=t[5]-n[5],i[6]=t[6]-n[6],i[7]=t[7]-n[7],i[8]=t[8]-n[8],i[9]=t[9]-n[9],i[10]=t[10]-n[10],i[11]=t[11]-n[11],i[12]=t[12]-n[12],i[13]=t[13]-n[13],i[14]=t[14]-n[14],i[15]=t[15]-n[15],i}static multiplyTransformation(t,n,i){let r=t[0],o=t[1],s=t[2],a=t[4],c=t[5],u=t[6],f=t[8],d=t[9],p=t[10],g=t[12],m=t[13],y=t[14],A=n[0],b=n[1],x=n[2],T=n[4],E=n[5],v=n[6],S=n[8],I=n[9],R=n[10],O=n[12],L=n[13],_=n[14],C=r*A+a*b+f*x,w=o*A+c*b+d*x,D=s*A+u*b+p*x,N=r*T+a*E+f*v,F=o*T+c*E+d*v,V=s*T+u*E+p*v,B=r*S+a*I+f*R,j=o*S+c*I+d*R,k=s*S+u*I+p*R,G=r*O+a*L+f*_+g,q=o*O+c*L+d*_+m,Q=s*O+u*L+p*_+y;return i[0]=C,i[1]=w,i[2]=D,i[3]=0,i[4]=N,i[5]=F,i[6]=V,i[7]=0,i[8]=B,i[9]=j,i[10]=k,i[11]=0,i[12]=G,i[13]=q,i[14]=Q,i[15]=1,i}static multiplyByMatrix3(t,n,i){let r=t[0],o=t[1],s=t[2],a=t[4],c=t[5],u=t[6],f=t[8],d=t[9],p=t[10],g=n[0],m=n[1],y=n[2],A=n[3],b=n[4],x=n[5],T=n[6],E=n[7],v=n[8],S=r*g+a*m+f*y,I=o*g+c*m+d*y,R=s*g+u*m+p*y,O=r*A+a*b+f*x,L=o*A+c*b+d*x,_=s*A+u*b+p*x,C=r*T+a*E+f*v,w=o*T+c*E+d*v,D=s*T+u*E+p*v;return i[0]=S,i[1]=I,i[2]=R,i[3]=0,i[4]=O,i[5]=L,i[6]=_,i[7]=0,i[8]=C,i[9]=w,i[10]=D,i[11]=0,i[12]=t[12],i[13]=t[13],i[14]=t[14],i[15]=t[15],i}static multiplyByTranslation(t,n,i){let r=n.x,o=n.y,s=n.z,a=r*t[0]+o*t[4]+s*t[8]+t[12],c=r*t[1]+o*t[5]+s*t[9]+t[13],u=r*t[2]+o*t[6]+s*t[10]+t[14];return i[0]=t[0],i[1]=t[1],i[2]=t[2],i[3]=t[3],i[4]=t[4],i[5]=t[5],i[6]=t[6],i[7]=t[7],i[8]=t[8],i[9]=t[9],i[10]=t[10],i[11]=t[11],i[12]=a,i[13]=c,i[14]=u,i[15]=t[15],i}static multiplyByScale(t,n,i){let r=n.x,o=n.y,s=n.z;return r===1&&o===1&&s===1?e.clone(t,i):(i[0]=r*t[0],i[1]=r*t[1],i[2]=r*t[2],i[3]=t[3],i[4]=o*t[4],i[5]=o*t[5],i[6]=o*t[6],i[7]=t[7],i[8]=s*t[8],i[9]=s*t[9],i[10]=s*t[10],i[11]=t[11],i[12]=t[12],i[13]=t[13],i[14]=t[14],i[15]=t[15],i)}static multiplyByUniformScale(t,n,i){return i[0]=t[0]*n,i[1]=t[1]*n,i[2]=t[2]*n,i[3]=t[3],i[4]=t[4]*n,i[5]=t[5]*n,i[6]=t[6]*n,i[7]=t[7],i[8]=t[8]*n,i[9]=t[9]*n,i[10]=t[10]*n,i[11]=t[11],i[12]=t[12],i[13]=t[13],i[14]=t[14],i[15]=t[15],i}static multiplyByVector(t,n,i){let r=n.x,o=n.y,s=n.z,a=n.w,c=t[0]*r+t[4]*o+t[8]*s+t[12]*a,u=t[1]*r+t[5]*o+t[9]*s+t[13]*a,f=t[2]*r+t[6]*o+t[10]*s+t[14]*a,d=t[3]*r+t[7]*o+t[11]*s+t[15]*a;return i.x=c,i.y=u,i.z=f,i.w=d,i}static multiplyByPointAsVector(t,n,i){let r=n.x,o=n.y,s=n.z,a=t[0]*r+t[4]*o+t[8]*s,c=t[1]*r+t[5]*o+t[9]*s,u=t[2]*r+t[6]*o+t[10]*s;return i.x=a,i.y=c,i.z=u,i}static multiplyByPoint(t,n,i){let r=n.x,o=n.y,s=n.z,a=t[0]*r+t[4]*o+t[8]*s+t[12],c=t[1]*r+t[5]*o+t[9]*s+t[13],u=t[2]*r+t[6]*o+t[10]*s+t[14];return i.x=a,i.y=c,i.z=u,i}static multiplyByScalar(t,n,i){return i[0]=t[0]*n,i[1]=t[1]*n,i[2]=t[2]*n,i[3]=t[3]*n,i[4]=t[4]*n,i[5]=t[5]*n,i[6]=t[6]*n,i[7]=t[7]*n,i[8]=t[8]*n,i[9]=t[9]*n,i[10]=t[10]*n,i[11]=t[11]*n,i[12]=t[12]*n,i[13]=t[13]*n,i[14]=t[14]*n,i[15]=t[15]*n,i}static negate(t,n){return n[0]=-t[0],n[1]=-t[1],n[2]=-t[2],n[3]=-t[3],n[4]=-t[4],n[5]=-t[5],n[6]=-t[6],n[7]=-t[7],n[8]=-t[8],n[9]=-t[9],n[10]=-t[10],n[11]=-t[11],n[12]=-t[12],n[13]=-t[13],n[14]=-t[14],n[15]=-t[15],n}static transpose(t,n){let i=t[1],r=t[2],o=t[3],s=t[6],a=t[7],c=t[11];return n[0]=t[0],n[1]=t[4],n[2]=t[8],n[3]=t[12],n[4]=i,n[5]=t[5],n[6]=t[9],n[7]=t[13],n[8]=r,n[9]=s,n[10]=t[10],n[11]=t[14],n[12]=o,n[13]=a,n[14]=c,n[15]=t[15],n}static abs(t,n){return n[0]=Math.abs(t[0]),n[1]=Math.abs(t[1]),n[2]=Math.abs(t[2]),n[3]=Math.abs(t[3]),n[4]=Math.abs(t[4]),n[5]=Math.abs(t[5]),n[6]=Math.abs(t[6]),n[7]=Math.abs(t[7]),n[8]=Math.abs(t[8]),n[9]=Math.abs(t[9]),n[10]=Math.abs(t[10]),n[11]=Math.abs(t[11]),n[12]=Math.abs(t[12]),n[13]=Math.abs(t[13]),n[14]=Math.abs(t[14]),n[15]=Math.abs(t[15]),n}static equals(t,n){return t===n||l(t)&&l(n)&&t[12]===n[12]&&t[13]===n[13]&&t[14]===n[14]&&t[0]===n[0]&&t[1]===n[1]&&t[2]===n[2]&&t[4]===n[4]&&t[5]===n[5]&&t[6]===n[6]&&t[8]===n[8]&&t[9]===n[9]&&t[10]===n[10]&&t[3]===n[3]&&t[7]===n[7]&&t[11]===n[11]&&t[15]===n[15]}static equalsEpsilon(t,n,i){return i=i??0,t===n||l(t)&&l(n)&&Math.abs(t[0]-n[0])<=i&&Math.abs(t[1]-n[1])<=i&&Math.abs(t[2]-n[2])<=i&&Math.abs(t[3]-n[3])<=i&&Math.abs(t[4]-n[4])<=i&&Math.abs(t[5]-n[5])<=i&&Math.abs(t[6]-n[6])<=i&&Math.abs(t[7]-n[7])<=i&&Math.abs(t[8]-n[8])<=i&&Math.abs(t[9]-n[9])<=i&&Math.abs(t[10]-n[10])<=i&&Math.abs(t[11]-n[11])<=i&&Math.abs(t[12]-n[12])<=i&&Math.abs(t[13]-n[13])<=i&&Math.abs(t[14]-n[14])<=i&&Math.abs(t[15]-n[15])<=i}static getTranslation(t,n){return n.x=t[12],n.y=t[13],n.z=t[14],n}static getMatrix3(t,n){return n[0]=t[0],n[1]=t[1],n[2]=t[2],n[3]=t[4],n[4]=t[5],n[5]=t[6],n[6]=t[8],n[7]=t[9],n[8]=t[10],n}static inverse(t,n){let i=t[0],r=t[4],o=t[8],s=t[12],a=t[1],c=t[5],u=t[9],f=t[13],d=t[2],p=t[6],g=t[10],m=t[14],y=t[3],A=t[7],b=t[11],x=t[15],T=g*x,E=m*b,v=p*x,S=m*A,I=p*b,R=g*A,O=d*x,L=m*y,_=d*b,C=g*y,w=d*A,D=p*y,N=T*c+S*u+I*f-(E*c+v*u+R*f),F=E*a+O*u+C*f-(T*a+L*u+_*f),V=v*a+L*c+w*f-(S*a+O*c+D*f),B=R*a+_*c+D*u-(I*a+C*c+w*u),j=E*r+v*o+R*s-(T*r+S*o+I*s),k=T*i+L*o+_*s-(E*i+O*o+C*s),G=S*i+O*r+D*s-(v*i+L*r+w*s),q=I*i+C*r+w*o-(R*i+_*r+D*o);T=o*f,E=s*u,v=r*f,S=s*c,I=r*u,R=o*c,O=i*f,L=s*a,_=i*u,C=o*a,w=i*c,D=r*a;let Q=T*A+S*b+I*x-(E*A+v*b+R*x),W=E*y+O*b+C*x-(T*y+L*b+_*x),J=v*y+L*A+w*x-(S*y+O*A+D*x),Z=R*y+_*A+D*b-(I*y+C*A+w*b),ae=v*g+R*m+E*p-(I*m+T*p+S*g),Ae=_*m+T*d+L*g-(O*g+C*m+E*d),fe=O*p+D*m+S*d-(w*m+v*d+L*p),xe=w*g+I*d+C*p-(_*p+D*g+R*d),ge=i*N+r*F+o*V+s*B;if(Math.abs(ge)<P.EPSILON21){if($.equalsEpsilon(e.getMatrix3(t,c3e),l3e,P.EPSILON7)&&se.equals(e.getRow(t,3,u3e),f3e))return n[0]=0,n[1]=0,n[2]=0,n[3]=0,n[4]=0,n[5]=0,n[6]=0,n[7]=0,n[8]=0,n[9]=0,n[10]=0,n[11]=0,n[12]=-t[12],n[13]=-t[13],n[14]=-t[14],n[15]=1,n;throw new oe("matrix is not invertible because its determinate is zero.")}return ge=1/ge,n[0]=N*ge,n[1]=F*ge,n[2]=V*ge,n[3]=B*ge,n[4]=j*ge,n[5]=k*ge,n[6]=G*ge,n[7]=q*ge,n[8]=Q*ge,n[9]=W*ge,n[10]=J*ge,n[11]=Z*ge,n[12]=ae*ge,n[13]=Ae*ge,n[14]=fe*ge,n[15]=xe*ge,n}static inverseTransformation(t,n){let i=t[0],r=t[1],o=t[2],s=t[4],a=t[5],c=t[6],u=t[8],f=t[9],d=t[10],p=t[12],g=t[13],m=t[14],y=-i*p-r*g-o*m,A=-s*p-a*g-c*m,b=-u*p-f*g-d*m;return n[0]=i,n[1]=s,n[2]=u,n[3]=0,n[4]=r,n[5]=a,n[6]=f,n[7]=0,n[8]=o,n[9]=c,n[10]=d,n[11]=0,n[12]=y,n[13]=A,n[14]=b,n[15]=1,n}static inverseTranspose(t,n){return e.inverse(e.transpose(t,d3e),n)}get length(){return e.packedLength}clone(t){return e.clone(this,t)}equals(t){return e.equals(this,t)}static equalsArray(t,n,i){return t[0]===n[i]&&t[1]===n[i+1]&&t[2]===n[i+2]&&t[3]===n[i+3]&&t[4]===n[i+4]&&t[5]===n[i+5]&&t[6]===n[i+6]&&t[7]===n[i+7]&&t[8]===n[i+8]&&t[9]===n[i+9]&&t[10]===n[i+10]&&t[11]===n[i+11]&&t[12]===n[i+12]&&t[13]===n[i+13]&&t[14]===n[i+14]&&t[15]===n[i+15]}equalsEpsilon(t,n){return e.equalsEpsilon(this,t,n)}toString(){return`(${this[0]}, ${this[4]}, ${this[8]}, ${this[12]}) (${this[1]}, ${this[5]}, ${this[9]}, ${this[13]}) (${this[2]}, ${this[6]}, ${this[10]}, ${this[14]}) -(${this[3]}, ${this[7]}, ${this[11]}, ${this[15]})`}};uo.packedLength=16;uo.fromArray=uo.unpack;uo.IDENTITY=new uo(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1);uo.ZERO=new uo(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0);uo.COLUMN0ROW0=0;uo.COLUMN0ROW1=1;uo.COLUMN0ROW2=2;uo.COLUMN0ROW3=3;uo.COLUMN1ROW0=4;uo.COLUMN1ROW1=5;uo.COLUMN1ROW2=6;uo.COLUMN1ROW3=7;uo.COLUMN2ROW0=8;uo.COLUMN2ROW1=9;uo.COLUMN2ROW2=10;uo.COLUMN2ROW3=11;uo.COLUMN3ROW0=12;uo.COLUMN3ROW1=13;uo.COLUMN3ROW2=14;uo.COLUMN3ROW3=15;var yE=new h,AE=new h,FI=new h,i3e=new h,r3e=new h,gq=new h,Jae=new h,o3e=new h,s3e=new h,a3e=new $,c3e=new $,l3e=new se,u3e=new se(0,0,0,1),f3e=new uo,M=uo;var Zae={DEPTH_BUFFER_BIT:256,STENCIL_BUFFER_BIT:1024,COLOR_BUFFER_BIT:16384,POINTS:0,LINES:1,LINE_LOOP:2,LINE_STRIP:3,TRIANGLES:4,TRIANGLE_STRIP:5,TRIANGLE_FAN:6,ZERO:0,ONE:1,SRC_COLOR:768,ONE_MINUS_SRC_COLOR:769,SRC_ALPHA:770,ONE_MINUS_SRC_ALPHA:771,DST_ALPHA:772,ONE_MINUS_DST_ALPHA:773,DST_COLOR:774,ONE_MINUS_DST_COLOR:775,SRC_ALPHA_SATURATE:776,FUNC_ADD:32774,BLEND_EQUATION:32777,BLEND_EQUATION_RGB:32777,BLEND_EQUATION_ALPHA:34877,FUNC_SUBTRACT:32778,FUNC_REVERSE_SUBTRACT:32779,BLEND_DST_RGB:32968,BLEND_SRC_RGB:32969,BLEND_DST_ALPHA:32970,BLEND_SRC_ALPHA:32971,CONSTANT_COLOR:32769,ONE_MINUS_CONSTANT_COLOR:32770,CONSTANT_ALPHA:32771,ONE_MINUS_CONSTANT_ALPHA:32772,BLEND_COLOR:32773,ARRAY_BUFFER:34962,ELEMENT_ARRAY_BUFFER:34963,ARRAY_BUFFER_BINDING:34964,ELEMENT_ARRAY_BUFFER_BINDING:34965,STREAM_DRAW:35040,STATIC_DRAW:35044,DYNAMIC_DRAW:35048,BUFFER_SIZE:34660,BUFFER_USAGE:34661,CURRENT_VERTEX_ATTRIB:34342,FRONT:1028,BACK:1029,FRONT_AND_BACK:1032,CULL_FACE:2884,BLEND:3042,DITHER:3024,STENCIL_TEST:2960,DEPTH_TEST:2929,SCISSOR_TEST:3089,POLYGON_OFFSET_FILL:32823,SAMPLE_ALPHA_TO_COVERAGE:32926,SAMPLE_COVERAGE:32928,NO_ERROR:0,INVALID_ENUM:1280,INVALID_VALUE:1281,INVALID_OPERATION:1282,OUT_OF_MEMORY:1285,CW:2304,CCW:2305,LINE_WIDTH:2849,ALIASED_POINT_SIZE_RANGE:33901,ALIASED_LINE_WIDTH_RANGE:33902,CULL_FACE_MODE:2885,FRONT_FACE:2886,DEPTH_RANGE:2928,DEPTH_WRITEMASK:2930,DEPTH_CLEAR_VALUE:2931,DEPTH_FUNC:2932,STENCIL_CLEAR_VALUE:2961,STENCIL_FUNC:2962,STENCIL_FAIL:2964,STENCIL_PASS_DEPTH_FAIL:2965,STENCIL_PASS_DEPTH_PASS:2966,STENCIL_REF:2967,STENCIL_VALUE_MASK:2963,STENCIL_WRITEMASK:2968,STENCIL_BACK_FUNC:34816,STENCIL_BACK_FAIL:34817,STENCIL_BACK_PASS_DEPTH_FAIL:34818,STENCIL_BACK_PASS_DEPTH_PASS:34819,STENCIL_BACK_REF:36003,STENCIL_BACK_VALUE_MASK:36004,STENCIL_BACK_WRITEMASK:36005,VIEWPORT:2978,SCISSOR_BOX:3088,COLOR_CLEAR_VALUE:3106,COLOR_WRITEMASK:3107,UNPACK_ALIGNMENT:3317,PACK_ALIGNMENT:3333,MAX_TEXTURE_SIZE:3379,MAX_VIEWPORT_DIMS:3386,SUBPIXEL_BITS:3408,RED_BITS:3410,GREEN_BITS:3411,BLUE_BITS:3412,ALPHA_BITS:3413,DEPTH_BITS:3414,STENCIL_BITS:3415,POLYGON_OFFSET_UNITS:10752,POLYGON_OFFSET_FACTOR:32824,TEXTURE_BINDING_2D:32873,SAMPLE_BUFFERS:32936,SAMPLES:32937,SAMPLE_COVERAGE_VALUE:32938,SAMPLE_COVERAGE_INVERT:32939,COMPRESSED_TEXTURE_FORMATS:34467,DONT_CARE:4352,FASTEST:4353,NICEST:4354,GENERATE_MIPMAP_HINT:33170,BYTE:5120,UNSIGNED_BYTE:5121,SHORT:5122,UNSIGNED_SHORT:5123,INT:5124,UNSIGNED_INT:5125,FLOAT:5126,DEPTH_COMPONENT:6402,ALPHA:6406,RGB:6407,RGBA:6408,LUMINANCE:6409,LUMINANCE_ALPHA:6410,UNSIGNED_SHORT_4_4_4_4:32819,UNSIGNED_SHORT_5_5_5_1:32820,UNSIGNED_SHORT_5_6_5:33635,FRAGMENT_SHADER:35632,VERTEX_SHADER:35633,MAX_VERTEX_ATTRIBS:34921,MAX_VERTEX_UNIFORM_VECTORS:36347,MAX_VARYING_VECTORS:36348,MAX_COMBINED_TEXTURE_IMAGE_UNITS:35661,MAX_VERTEX_TEXTURE_IMAGE_UNITS:35660,MAX_TEXTURE_IMAGE_UNITS:34930,MAX_FRAGMENT_UNIFORM_VECTORS:36349,SHADER_TYPE:35663,DELETE_STATUS:35712,LINK_STATUS:35714,VALIDATE_STATUS:35715,ATTACHED_SHADERS:35717,ACTIVE_UNIFORMS:35718,ACTIVE_ATTRIBUTES:35721,SHADING_LANGUAGE_VERSION:35724,CURRENT_PROGRAM:35725,NEVER:512,LESS:513,EQUAL:514,LEQUAL:515,GREATER:516,NOTEQUAL:517,GEQUAL:518,ALWAYS:519,KEEP:7680,REPLACE:7681,INCR:7682,DECR:7683,INVERT:5386,INCR_WRAP:34055,DECR_WRAP:34056,VENDOR:7936,RENDERER:7937,VERSION:7938,NEAREST:9728,LINEAR:9729,NEAREST_MIPMAP_NEAREST:9984,LINEAR_MIPMAP_NEAREST:9985,NEAREST_MIPMAP_LINEAR:9986,LINEAR_MIPMAP_LINEAR:9987,TEXTURE_MAG_FILTER:10240,TEXTURE_MIN_FILTER:10241,TEXTURE_WRAP_S:10242,TEXTURE_WRAP_T:10243,TEXTURE_2D:3553,TEXTURE:5890,TEXTURE_CUBE_MAP:34067,TEXTURE_BINDING_CUBE_MAP:34068,TEXTURE_CUBE_MAP_POSITIVE_X:34069,TEXTURE_CUBE_MAP_NEGATIVE_X:34070,TEXTURE_CUBE_MAP_POSITIVE_Y:34071,TEXTURE_CUBE_MAP_NEGATIVE_Y:34072,TEXTURE_CUBE_MAP_POSITIVE_Z:34073,TEXTURE_CUBE_MAP_NEGATIVE_Z:34074,MAX_CUBE_MAP_TEXTURE_SIZE:34076,TEXTURE0:33984,TEXTURE1:33985,TEXTURE2:33986,TEXTURE3:33987,TEXTURE4:33988,TEXTURE5:33989,TEXTURE6:33990,TEXTURE7:33991,TEXTURE8:33992,TEXTURE9:33993,TEXTURE10:33994,TEXTURE11:33995,TEXTURE12:33996,TEXTURE13:33997,TEXTURE14:33998,TEXTURE15:33999,TEXTURE16:34e3,TEXTURE17:34001,TEXTURE18:34002,TEXTURE19:34003,TEXTURE20:34004,TEXTURE21:34005,TEXTURE22:34006,TEXTURE23:34007,TEXTURE24:34008,TEXTURE25:34009,TEXTURE26:34010,TEXTURE27:34011,TEXTURE28:34012,TEXTURE29:34013,TEXTURE30:34014,TEXTURE31:34015,ACTIVE_TEXTURE:34016,REPEAT:10497,CLAMP_TO_EDGE:33071,MIRRORED_REPEAT:33648,FLOAT_VEC2:35664,FLOAT_VEC3:35665,FLOAT_VEC4:35666,INT_VEC2:35667,INT_VEC3:35668,INT_VEC4:35669,BOOL:35670,BOOL_VEC2:35671,BOOL_VEC3:35672,BOOL_VEC4:35673,FLOAT_MAT2:35674,FLOAT_MAT3:35675,FLOAT_MAT4:35676,SAMPLER_2D:35678,SAMPLER_CUBE:35680,VERTEX_ATTRIB_ARRAY_ENABLED:34338,VERTEX_ATTRIB_ARRAY_SIZE:34339,VERTEX_ATTRIB_ARRAY_STRIDE:34340,VERTEX_ATTRIB_ARRAY_TYPE:34341,VERTEX_ATTRIB_ARRAY_NORMALIZED:34922,VERTEX_ATTRIB_ARRAY_POINTER:34373,VERTEX_ATTRIB_ARRAY_BUFFER_BINDING:34975,IMPLEMENTATION_COLOR_READ_TYPE:35738,IMPLEMENTATION_COLOR_READ_FORMAT:35739,COMPILE_STATUS:35713,LOW_FLOAT:36336,MEDIUM_FLOAT:36337,HIGH_FLOAT:36338,LOW_INT:36339,MEDIUM_INT:36340,HIGH_INT:36341,FRAMEBUFFER:36160,RENDERBUFFER:36161,RGBA4:32854,RGB5_A1:32855,RGB565:36194,DEPTH_COMPONENT16:33189,STENCIL_INDEX:6401,STENCIL_INDEX8:36168,DEPTH_STENCIL:34041,RENDERBUFFER_WIDTH:36162,RENDERBUFFER_HEIGHT:36163,RENDERBUFFER_INTERNAL_FORMAT:36164,RENDERBUFFER_RED_SIZE:36176,RENDERBUFFER_GREEN_SIZE:36177,RENDERBUFFER_BLUE_SIZE:36178,RENDERBUFFER_ALPHA_SIZE:36179,RENDERBUFFER_DEPTH_SIZE:36180,RENDERBUFFER_STENCIL_SIZE:36181,FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE:36048,FRAMEBUFFER_ATTACHMENT_OBJECT_NAME:36049,FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL:36050,FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE:36051,COLOR_ATTACHMENT0:36064,DEPTH_ATTACHMENT:36096,STENCIL_ATTACHMENT:36128,DEPTH_STENCIL_ATTACHMENT:33306,NONE:0,FRAMEBUFFER_COMPLETE:36053,FRAMEBUFFER_INCOMPLETE_ATTACHMENT:36054,FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT:36055,FRAMEBUFFER_INCOMPLETE_DIMENSIONS:36057,FRAMEBUFFER_UNSUPPORTED:36061,FRAMEBUFFER_BINDING:36006,RENDERBUFFER_BINDING:36007,MAX_RENDERBUFFER_SIZE:34024,INVALID_FRAMEBUFFER_OPERATION:1286,UNPACK_FLIP_Y_WEBGL:37440,UNPACK_PREMULTIPLY_ALPHA_WEBGL:37441,CONTEXT_LOST_WEBGL:37442,UNPACK_COLORSPACE_CONVERSION_WEBGL:37443,BROWSER_DEFAULT_WEBGL:37444,COMPRESSED_RGB_S3TC_DXT1_EXT:33776,COMPRESSED_RGBA_S3TC_DXT1_EXT:33777,COMPRESSED_RGBA_S3TC_DXT3_EXT:33778,COMPRESSED_RGBA_S3TC_DXT5_EXT:33779,COMPRESSED_RGB_PVRTC_4BPPV1_IMG:35840,COMPRESSED_RGB_PVRTC_2BPPV1_IMG:35841,COMPRESSED_RGBA_PVRTC_4BPPV1_IMG:35842,COMPRESSED_RGBA_PVRTC_2BPPV1_IMG:35843,COMPRESSED_RGBA_ASTC_4x4_WEBGL:37808,COMPRESSED_RGB_ETC1_WEBGL:36196,COMPRESSED_RGBA_BPTC_UNORM:36492,HALF_FLOAT_OES:36193,DOUBLE:5130,READ_BUFFER:3074,UNPACK_ROW_LENGTH:3314,UNPACK_SKIP_ROWS:3315,UNPACK_SKIP_PIXELS:3316,PACK_ROW_LENGTH:3330,PACK_SKIP_ROWS:3331,PACK_SKIP_PIXELS:3332,COLOR:6144,DEPTH:6145,STENCIL:6146,RED:6403,RGB8:32849,RGBA8:32856,RGB10_A2:32857,TEXTURE_BINDING_3D:32874,UNPACK_SKIP_IMAGES:32877,UNPACK_IMAGE_HEIGHT:32878,TEXTURE_3D:32879,TEXTURE_WRAP_R:32882,MAX_3D_TEXTURE_SIZE:32883,UNSIGNED_INT_2_10_10_10_REV:33640,MAX_ELEMENTS_VERTICES:33e3,MAX_ELEMENTS_INDICES:33001,TEXTURE_MIN_LOD:33082,TEXTURE_MAX_LOD:33083,TEXTURE_BASE_LEVEL:33084,TEXTURE_MAX_LEVEL:33085,MIN:32775,MAX:32776,DEPTH_COMPONENT24:33190,MAX_TEXTURE_LOD_BIAS:34045,TEXTURE_COMPARE_MODE:34892,TEXTURE_COMPARE_FUNC:34893,CURRENT_QUERY:34917,QUERY_RESULT:34918,QUERY_RESULT_AVAILABLE:34919,STREAM_READ:35041,STREAM_COPY:35042,STATIC_READ:35045,STATIC_COPY:35046,DYNAMIC_READ:35049,DYNAMIC_COPY:35050,MAX_DRAW_BUFFERS:34852,DRAW_BUFFER0:34853,DRAW_BUFFER1:34854,DRAW_BUFFER2:34855,DRAW_BUFFER3:34856,DRAW_BUFFER4:34857,DRAW_BUFFER5:34858,DRAW_BUFFER6:34859,DRAW_BUFFER7:34860,DRAW_BUFFER8:34861,DRAW_BUFFER9:34862,DRAW_BUFFER10:34863,DRAW_BUFFER11:34864,DRAW_BUFFER12:34865,DRAW_BUFFER13:34866,DRAW_BUFFER14:34867,DRAW_BUFFER15:34868,MAX_FRAGMENT_UNIFORM_COMPONENTS:35657,MAX_VERTEX_UNIFORM_COMPONENTS:35658,SAMPLER_3D:35679,SAMPLER_2D_SHADOW:35682,FRAGMENT_SHADER_DERIVATIVE_HINT:35723,PIXEL_PACK_BUFFER:35051,PIXEL_UNPACK_BUFFER:35052,PIXEL_PACK_BUFFER_BINDING:35053,PIXEL_UNPACK_BUFFER_BINDING:35055,FLOAT_MAT2x3:35685,FLOAT_MAT2x4:35686,FLOAT_MAT3x2:35687,FLOAT_MAT3x4:35688,FLOAT_MAT4x2:35689,FLOAT_MAT4x3:35690,SRGB:35904,SRGB8:35905,SRGB8_ALPHA8:35907,COMPARE_REF_TO_TEXTURE:34894,RGBA32F:34836,RGB32F:34837,RGBA16F:34842,RGB16F:34843,VERTEX_ATTRIB_ARRAY_INTEGER:35069,MAX_ARRAY_TEXTURE_LAYERS:35071,MIN_PROGRAM_TEXEL_OFFSET:35076,MAX_PROGRAM_TEXEL_OFFSET:35077,MAX_VARYING_COMPONENTS:35659,TEXTURE_2D_ARRAY:35866,TEXTURE_BINDING_2D_ARRAY:35869,R11F_G11F_B10F:35898,UNSIGNED_INT_10F_11F_11F_REV:35899,RGB9_E5:35901,UNSIGNED_INT_5_9_9_9_REV:35902,TRANSFORM_FEEDBACK_BUFFER_MODE:35967,MAX_TRANSFORM_FEEDBACK_SEPARATE_COMPONENTS:35968,TRANSFORM_FEEDBACK_VARYINGS:35971,TRANSFORM_FEEDBACK_BUFFER_START:35972,TRANSFORM_FEEDBACK_BUFFER_SIZE:35973,TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN:35976,RASTERIZER_DISCARD:35977,MAX_TRANSFORM_FEEDBACK_INTERLEAVED_COMPONENTS:35978,MAX_TRANSFORM_FEEDBACK_SEPARATE_ATTRIBS:35979,INTERLEAVED_ATTRIBS:35980,SEPARATE_ATTRIBS:35981,TRANSFORM_FEEDBACK_BUFFER:35982,TRANSFORM_FEEDBACK_BUFFER_BINDING:35983,RGBA32UI:36208,RGB32UI:36209,RGBA16UI:36214,RGB16UI:36215,RGBA8UI:36220,RGB8UI:36221,RGBA32I:36226,RGB32I:36227,RGBA16I:36232,RGB16I:36233,RGBA8I:36238,RGB8I:36239,RED_INTEGER:36244,RGB_INTEGER:36248,RGBA_INTEGER:36249,SAMPLER_2D_ARRAY:36289,SAMPLER_2D_ARRAY_SHADOW:36292,SAMPLER_CUBE_SHADOW:36293,UNSIGNED_INT_VEC2:36294,UNSIGNED_INT_VEC3:36295,UNSIGNED_INT_VEC4:36296,INT_SAMPLER_2D:36298,INT_SAMPLER_3D:36299,INT_SAMPLER_CUBE:36300,INT_SAMPLER_2D_ARRAY:36303,UNSIGNED_INT_SAMPLER_2D:36306,UNSIGNED_INT_SAMPLER_3D:36307,UNSIGNED_INT_SAMPLER_CUBE:36308,UNSIGNED_INT_SAMPLER_2D_ARRAY:36311,DEPTH_COMPONENT32F:36012,DEPTH32F_STENCIL8:36013,FLOAT_32_UNSIGNED_INT_24_8_REV:36269,FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING:33296,FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE:33297,FRAMEBUFFER_ATTACHMENT_RED_SIZE:33298,FRAMEBUFFER_ATTACHMENT_GREEN_SIZE:33299,FRAMEBUFFER_ATTACHMENT_BLUE_SIZE:33300,FRAMEBUFFER_ATTACHMENT_ALPHA_SIZE:33301,FRAMEBUFFER_ATTACHMENT_DEPTH_SIZE:33302,FRAMEBUFFER_ATTACHMENT_STENCIL_SIZE:33303,FRAMEBUFFER_DEFAULT:33304,UNSIGNED_INT_24_8:34042,DEPTH24_STENCIL8:35056,UNSIGNED_NORMALIZED:35863,DRAW_FRAMEBUFFER_BINDING:36006,READ_FRAMEBUFFER:36008,DRAW_FRAMEBUFFER:36009,READ_FRAMEBUFFER_BINDING:36010,RENDERBUFFER_SAMPLES:36011,FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER:36052,MAX_COLOR_ATTACHMENTS:36063,COLOR_ATTACHMENT1:36065,COLOR_ATTACHMENT2:36066,COLOR_ATTACHMENT3:36067,COLOR_ATTACHMENT4:36068,COLOR_ATTACHMENT5:36069,COLOR_ATTACHMENT6:36070,COLOR_ATTACHMENT7:36071,COLOR_ATTACHMENT8:36072,COLOR_ATTACHMENT9:36073,COLOR_ATTACHMENT10:36074,COLOR_ATTACHMENT11:36075,COLOR_ATTACHMENT12:36076,COLOR_ATTACHMENT13:36077,COLOR_ATTACHMENT14:36078,COLOR_ATTACHMENT15:36079,FRAMEBUFFER_INCOMPLETE_MULTISAMPLE:36182,MAX_SAMPLES:36183,HALF_FLOAT:5131,RG:33319,RG_INTEGER:33320,R8:33321,RG8:33323,R16F:33325,R32F:33326,RG16F:33327,RG32F:33328,R8I:33329,R8UI:33330,R16I:33331,R16UI:33332,R32I:33333,R32UI:33334,RG8I:33335,RG8UI:33336,RG16I:33337,RG16UI:33338,RG32I:33339,RG32UI:33340,VERTEX_ARRAY_BINDING:34229,R8_SNORM:36756,RG8_SNORM:36757,RGB8_SNORM:36758,RGBA8_SNORM:36759,SIGNED_NORMALIZED:36764,COPY_READ_BUFFER:36662,COPY_WRITE_BUFFER:36663,COPY_READ_BUFFER_BINDING:36662,COPY_WRITE_BUFFER_BINDING:36663,UNIFORM_BUFFER:35345,UNIFORM_BUFFER_BINDING:35368,UNIFORM_BUFFER_START:35369,UNIFORM_BUFFER_SIZE:35370,MAX_VERTEX_UNIFORM_BLOCKS:35371,MAX_FRAGMENT_UNIFORM_BLOCKS:35373,MAX_COMBINED_UNIFORM_BLOCKS:35374,MAX_UNIFORM_BUFFER_BINDINGS:35375,MAX_UNIFORM_BLOCK_SIZE:35376,MAX_COMBINED_VERTEX_UNIFORM_COMPONENTS:35377,MAX_COMBINED_FRAGMENT_UNIFORM_COMPONENTS:35379,UNIFORM_BUFFER_OFFSET_ALIGNMENT:35380,ACTIVE_UNIFORM_BLOCKS:35382,UNIFORM_TYPE:35383,UNIFORM_SIZE:35384,UNIFORM_BLOCK_INDEX:35386,UNIFORM_OFFSET:35387,UNIFORM_ARRAY_STRIDE:35388,UNIFORM_MATRIX_STRIDE:35389,UNIFORM_IS_ROW_MAJOR:35390,UNIFORM_BLOCK_BINDING:35391,UNIFORM_BLOCK_DATA_SIZE:35392,UNIFORM_BLOCK_ACTIVE_UNIFORMS:35394,UNIFORM_BLOCK_ACTIVE_UNIFORM_INDICES:35395,UNIFORM_BLOCK_REFERENCED_BY_VERTEX_SHADER:35396,UNIFORM_BLOCK_REFERENCED_BY_FRAGMENT_SHADER:35398,INVALID_INDEX:4294967295,MAX_VERTEX_OUTPUT_COMPONENTS:37154,MAX_FRAGMENT_INPUT_COMPONENTS:37157,MAX_SERVER_WAIT_TIMEOUT:37137,OBJECT_TYPE:37138,SYNC_CONDITION:37139,SYNC_STATUS:37140,SYNC_FLAGS:37141,SYNC_FENCE:37142,SYNC_GPU_COMMANDS_COMPLETE:37143,UNSIGNALED:37144,SIGNALED:37145,ALREADY_SIGNALED:37146,TIMEOUT_EXPIRED:37147,CONDITION_SATISFIED:37148,WAIT_FAILED:37149,SYNC_FLUSH_COMMANDS_BIT:1,VERTEX_ATTRIB_ARRAY_DIVISOR:35070,ANY_SAMPLES_PASSED:35887,ANY_SAMPLES_PASSED_CONSERVATIVE:36202,SAMPLER_BINDING:35097,RGB10_A2UI:36975,INT_2_10_10_10_REV:36255,TRANSFORM_FEEDBACK:36386,TRANSFORM_FEEDBACK_PAUSED:36387,TRANSFORM_FEEDBACK_ACTIVE:36388,TRANSFORM_FEEDBACK_BINDING:36389,COMPRESSED_R11_EAC:37488,COMPRESSED_SIGNED_R11_EAC:37489,COMPRESSED_RG11_EAC:37490,COMPRESSED_SIGNED_RG11_EAC:37491,COMPRESSED_RGB8_ETC2:37492,COMPRESSED_SRGB8_ETC2:37493,COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2:37494,COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2:37495,COMPRESSED_RGBA8_ETC2_EAC:37496,COMPRESSED_SRGB8_ALPHA8_ETC2_EAC:37497,TEXTURE_IMMUTABLE_FORMAT:37167,MAX_ELEMENT_INDEX:36203,TEXTURE_IMMUTABLE_LEVELS:33503,MAX_TEXTURE_MAX_ANISOTROPY_EXT:34047};Object.freeze(Zae);var te=Zae;var d3e=new h;function Ot(e){this._size=e.size,this._datatype=e.datatype,this.getValue=e.getValue}var Ga={};Ga[te.FLOAT]="float";Ga[te.FLOAT_VEC2]="vec2";Ga[te.FLOAT_VEC3]="vec3";Ga[te.FLOAT_VEC4]="vec4";Ga[te.INT]="int";Ga[te.INT_VEC2]="ivec2";Ga[te.INT_VEC3]="ivec3";Ga[te.INT_VEC4]="ivec4";Ga[te.BOOL]="bool";Ga[te.BOOL_VEC2]="bvec2";Ga[te.BOOL_VEC3]="bvec3";Ga[te.BOOL_VEC4]="bvec4";Ga[te.FLOAT_MAT2]="mat2";Ga[te.FLOAT_MAT3]="mat3";Ga[te.FLOAT_MAT4]="mat4";Ga[te.SAMPLER_2D]="sampler2D";Ga[te.SAMPLER_CUBE]="samplerCube";Ot.prototype.getDeclaration=function(e){let t=`uniform ${Ga[this._datatype]} ${e}`,n=this._size;return n===1?t+=";":t+=`[${n.toString()}];`,t};var h3e={czm_viewport:new Ot({size:1,datatype:te.FLOAT_VEC4,getValue:function(e){return e.viewportCartesian4}}),czm_viewportOrthographic:new Ot({size:1,datatype:te.FLOAT_MAT4,getValue:function(e){return e.viewportOrthographic}}),czm_viewportTransformation:new Ot({size:1,datatype:te.FLOAT_MAT4,getValue:function(e){return e.viewportTransformation}}),czm_globeDepthTexture:new Ot({size:1,datatype:te.SAMPLER_2D,getValue:function(e){return e.globeDepthTexture}}),czm_edgeIdTexture:new Ot({size:1,datatype:te.SAMPLER_2D,getValue:function(e){return e.edgeIdTexture}}),czm_edgeColorTexture:new Ot({size:1,datatype:te.SAMPLER_2D,getValue:function(e){return e.edgeColorTexture}}),czm_edgeDepthTexture:new Ot({size:1,datatype:te.SAMPLER_2D,getValue:function(e){return e.edgeDepthTexture}}),czm_planarFillIdTexture:new Ot({size:1,datatype:te.SAMPLER_2D,getValue:function(e){return e.planarFillIdTexture}}),czm_model:new Ot({size:1,datatype:te.FLOAT_MAT4,getValue:function(e){return e.model}}),czm_inverseModel:new Ot({size:1,datatype:te.FLOAT_MAT4,getValue:function(e){return e.inverseModel}}),czm_view:new Ot({size:1,datatype:te.FLOAT_MAT4,getValue:function(e){return e.view}}),czm_view3D:new Ot({size:1,datatype:te.FLOAT_MAT4,getValue:function(e){return e.view3D}}),czm_viewRotation:new Ot({size:1,datatype:te.FLOAT_MAT3,getValue:function(e){return e.viewRotation}}),czm_viewRotation3D:new Ot({size:1,datatype:te.FLOAT_MAT3,getValue:function(e){return e.viewRotation3D}}),czm_inverseView:new Ot({size:1,datatype:te.FLOAT_MAT4,getValue:function(e){return e.inverseView}}),czm_inverseView3D:new Ot({size:1,datatype:te.FLOAT_MAT4,getValue:function(e){return e.inverseView3D}}),czm_inverseViewRotation:new Ot({size:1,datatype:te.FLOAT_MAT3,getValue:function(e){return e.inverseViewRotation}}),czm_inverseViewRotation3D:new Ot({size:1,datatype:te.FLOAT_MAT3,getValue:function(e){return e.inverseViewRotation3D}}),czm_projection:new Ot({size:1,datatype:te.FLOAT_MAT4,getValue:function(e){return e.projection}}),czm_inverseProjection:new Ot({size:1,datatype:te.FLOAT_MAT4,getValue:function(e){return e.inverseProjection}}),czm_infiniteProjection:new Ot({size:1,datatype:te.FLOAT_MAT4,getValue:function(e){return e.infiniteProjection}}),czm_modelView:new Ot({size:1,datatype:te.FLOAT_MAT4,getValue:function(e){return e.modelView}}),czm_modelView3D:new Ot({size:1,datatype:te.FLOAT_MAT4,getValue:function(e){return e.modelView3D}}),czm_modelViewRelativeToEye:new Ot({size:1,datatype:te.FLOAT_MAT4,getValue:function(e){return e.modelViewRelativeToEye}}),czm_inverseModelView:new Ot({size:1,datatype:te.FLOAT_MAT4,getValue:function(e){return e.inverseModelView}}),czm_inverseModelView3D:new Ot({size:1,datatype:te.FLOAT_MAT4,getValue:function(e){return e.inverseModelView3D}}),czm_viewProjection:new Ot({size:1,datatype:te.FLOAT_MAT4,getValue:function(e){return e.viewProjection}}),czm_inverseViewProjection:new Ot({size:1,datatype:te.FLOAT_MAT4,getValue:function(e){return e.inverseViewProjection}}),czm_modelViewProjection:new Ot({size:1,datatype:te.FLOAT_MAT4,getValue:function(e){return e.modelViewProjection}}),czm_inverseModelViewProjection:new Ot({size:1,datatype:te.FLOAT_MAT4,getValue:function(e){return e.inverseModelViewProjection}}),czm_modelViewProjectionRelativeToEye:new Ot({size:1,datatype:te.FLOAT_MAT4,getValue:function(e){return e.modelViewProjectionRelativeToEye}}),czm_modelViewInfiniteProjection:new Ot({size:1,datatype:te.FLOAT_MAT4,getValue:function(e){return e.modelViewInfiniteProjection}}),czm_orthographicIn3D:new Ot({size:1,datatype:te.FLOAT,getValue:function(e){return e.orthographicIn3D?1:0}}),czm_normal:new Ot({size:1,datatype:te.FLOAT_MAT3,getValue:function(e){return e.normal}}),czm_normal3D:new Ot({size:1,datatype:te.FLOAT_MAT3,getValue:function(e){return e.normal3D}}),czm_inverseNormal:new Ot({size:1,datatype:te.FLOAT_MAT3,getValue:function(e){return e.inverseNormal}}),czm_inverseNormal3D:new Ot({size:1,datatype:te.FLOAT_MAT3,getValue:function(e){return e.inverseNormal3D}}),czm_eyeHeight:new Ot({size:1,datatype:te.FLOAT,getValue:function(e){return e.eyeHeight}}),czm_eyeCartographic:new Ot({size:1,datatype:te.FLOAT_VEC3,getValue:function(e){return e.eyeCartographic}}),czm_eyeHeight2D:new Ot({size:1,datatype:te.FLOAT_VEC2,getValue:function(e){return e.eyeHeight2D}}),czm_eyeEllipsoidNormalEC:new Ot({size:1,datatype:te.FLOAT_VEC3,getValue:function(e){return e.eyeEllipsoidNormalEC}}),czm_eyeEllipsoidCurvature:new Ot({size:1,datatype:te.FLOAT_VEC2,getValue:function(e){return e.eyeEllipsoidCurvature}}),czm_eyeToEnu:new Ot({size:1,datatype:te.FLOAT_MAT3,getValue:function(e){return e.eyeToEnu}}),czm_modelToEnu:new Ot({size:1,datatype:te.FLOAT_MAT4,getValue:function(e){return e.modelToEnu}}),czm_enuToModel:new Ot({size:1,datatype:te.FLOAT_MAT4,getValue:function(e){return e.enuToModel}}),czm_entireFrustum:new Ot({size:1,datatype:te.FLOAT_VEC2,getValue:function(e){return e.entireFrustum}}),czm_currentFrustum:new Ot({size:1,datatype:te.FLOAT_VEC2,getValue:function(e){return e.currentFrustum}}),czm_frustumPlanes:new Ot({size:1,datatype:te.FLOAT_VEC4,getValue:function(e){return e.frustumPlanes}}),czm_farDepthFromNearPlusOne:new Ot({size:1,datatype:te.FLOAT,getValue:function(e){return e.farDepthFromNearPlusOne}}),czm_log2FarDepthFromNearPlusOne:new Ot({size:1,datatype:te.FLOAT,getValue:function(e){return e.log2FarDepthFromNearPlusOne}}),czm_oneOverLog2FarDepthFromNearPlusOne:new Ot({size:1,datatype:te.FLOAT,getValue:function(e){return e.oneOverLog2FarDepthFromNearPlusOne}}),czm_sunPositionWC:new Ot({size:1,datatype:te.FLOAT_VEC3,getValue:function(e){return e.sunPositionWC}}),czm_sunPositionColumbusView:new Ot({size:1,datatype:te.FLOAT_VEC3,getValue:function(e){return e.sunPositionColumbusView}}),czm_sunDirectionEC:new Ot({size:1,datatype:te.FLOAT_VEC3,getValue:function(e){return e.sunDirectionEC}}),czm_sunDirectionWC:new Ot({size:1,datatype:te.FLOAT_VEC3,getValue:function(e){return e.sunDirectionWC}}),czm_moonDirectionEC:new Ot({size:1,datatype:te.FLOAT_VEC3,getValue:function(e){return e.moonDirectionEC}}),czm_lightDirectionEC:new Ot({size:1,datatype:te.FLOAT_VEC3,getValue:function(e){return e.lightDirectionEC}}),czm_lightDirectionWC:new Ot({size:1,datatype:te.FLOAT_VEC3,getValue:function(e){return e.lightDirectionWC}}),czm_lightColor:new Ot({size:1,datatype:te.FLOAT_VEC3,getValue:function(e){return e.lightColor}}),czm_lightColorHdr:new Ot({size:1,datatype:te.FLOAT_VEC3,getValue:function(e){return e.lightColorHdr}}),czm_encodedCameraPositionMCHigh:new Ot({size:1,datatype:te.FLOAT_VEC3,getValue:function(e){return e.encodedCameraPositionMCHigh}}),czm_encodedCameraPositionMCLow:new Ot({size:1,datatype:te.FLOAT_VEC3,getValue:function(e){return e.encodedCameraPositionMCLow}}),czm_viewerPositionWC:new Ot({size:1,datatype:te.FLOAT_VEC3,getValue:function(e){return M.getTranslation(e.inverseView,d3e)}}),czm_frameNumber:new Ot({size:1,datatype:te.FLOAT,getValue:function(e){return e.frameState.frameNumber}}),czm_morphTime:new Ot({size:1,datatype:te.FLOAT,getValue:function(e){return e.frameState.morphTime}}),czm_sceneMode:new Ot({size:1,datatype:te.FLOAT,getValue:function(e){return e.frameState.mode}}),czm_pass:new Ot({size:1,datatype:te.FLOAT,getValue:function(e){return e.pass}}),czm_backgroundColor:new Ot({size:1,datatype:te.FLOAT_VEC4,getValue:function(e){return e.backgroundColor}}),czm_brdfLut:new Ot({size:1,datatype:te.SAMPLER_2D,getValue:function(e){return e.brdfLut}}),czm_environmentMap:new Ot({size:1,datatype:te.SAMPLER_CUBE,getValue:function(e){return e.environmentMap}}),czm_specularEnvironmentMaps:new Ot({size:1,datatype:te.SAMPLER_CUBE,getValue:function(e){return e.specularEnvironmentMaps}}),czm_specularEnvironmentMapsMaximumLOD:new Ot({size:1,datatype:te.FLOAT,getValue:function(e){return e.specularEnvironmentMapsMaximumLOD}}),czm_sphericalHarmonicCoefficients:new Ot({size:9,datatype:te.FLOAT_VEC3,getValue:function(e){return e.sphericalHarmonicCoefficients}}),czm_temeToPseudoFixed:new Ot({size:1,datatype:te.FLOAT_MAT3,getValue:function(e){return e.temeToPseudoFixedMatrix}}),czm_pixelRatio:new Ot({size:1,datatype:te.FLOAT,getValue:function(e){return e.pixelRatio}}),czm_fogDensity:new Ot({size:1,datatype:te.FLOAT,getValue:function(e){return e.fogDensity}}),czm_fogVisualDensityScalar:new Ot({size:1,datatype:te.FLOAT,getValue:function(e){return e.fogVisualDensityScalar}}),czm_fogMinimumBrightness:new Ot({size:1,datatype:te.FLOAT,getValue:function(e){return e.fogMinimumBrightness}}),czm_atmosphereHsbShift:new Ot({size:1,datatype:te.FLOAT_VEC3,getValue:function(e){return e.atmosphereHsbShift}}),czm_atmosphereLightIntensity:new Ot({size:1,datatype:te.FLOAT,getValue:function(e){return e.atmosphereLightIntensity}}),czm_atmosphereRayleighCoefficient:new Ot({size:1,datatype:te.FLOAT_VEC3,getValue:function(e){return e.atmosphereRayleighCoefficient}}),czm_atmosphereRayleighScaleHeight:new Ot({size:1,datatype:te.FLOAT,getValue:function(e){return e.atmosphereRayleighScaleHeight}}),czm_atmosphereMieCoefficient:new Ot({size:1,datatype:te.FLOAT_VEC3,getValue:function(e){return e.atmosphereMieCoefficient}}),czm_atmosphereMieScaleHeight:new Ot({size:1,datatype:te.FLOAT,getValue:function(e){return e.atmosphereMieScaleHeight}}),czm_atmosphereMieAnisotropy:new Ot({size:1,datatype:te.FLOAT,getValue:function(e){return e.atmosphereMieAnisotropy}}),czm_atmosphereDynamicLighting:new Ot({size:1,datatype:te.FLOAT,getValue:function(e){return e.atmosphereDynamicLighting}}),czm_splitPosition:new Ot({size:1,datatype:te.FLOAT,getValue:function(e){return e.splitPosition}}),czm_geometricToleranceOverMeter:new Ot({size:1,datatype:te.FLOAT,getValue:function(e){return e.geometricToleranceOverMeter}}),czm_minimumDisableDepthTestDistance:new Ot({size:1,datatype:te.FLOAT,getValue:function(e){return e.minimumDisableDepthTestDistance}}),czm_invertClassificationColor:new Ot({size:1,datatype:te.FLOAT_VEC4,getValue:function(e){return e.invertClassificationColor}}),czm_gamma:new Ot({size:1,datatype:te.FLOAT,getValue:function(e){return e.gamma}}),czm_ellipsoidRadii:new Ot({size:1,datatype:te.FLOAT_VEC3,getValue:function(e){return e.ellipsoid.radii}}),czm_ellipsoidInverseRadii:new Ot({size:1,datatype:te.FLOAT_VEC3,getValue:function(e){return e.ellipsoid.oneOverRadii}})},T_=h3e;function m3e(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(e){let t=Math.random()*16|0;return(e==="x"?t:t&3|8).toString(16)})}var Kn=m3e;function p3e(){return!0}function g3e(e,t){t=t??"This object was destroyed, i.e., destroy() was called.";function n(){}for(let i in e)typeof e[i]=="function"&&(e[i]=n);e.isDestroyed=p3e}var le=g3e;var ra={UNSIGNED_BYTE:te.UNSIGNED_BYTE,UNSIGNED_SHORT:te.UNSIGNED_SHORT,UNSIGNED_INT:te.UNSIGNED_INT};ra.getSizeInBytes=function(e){switch(e){case ra.UNSIGNED_BYTE:return Uint8Array.BYTES_PER_ELEMENT;case ra.UNSIGNED_SHORT:return Uint16Array.BYTES_PER_ELEMENT;case ra.UNSIGNED_INT:return Uint32Array.BYTES_PER_ELEMENT}};ra.fromSizeInBytes=function(e){switch(e){case 2:return ra.UNSIGNED_SHORT;case 4:return ra.UNSIGNED_INT;case 1:return ra.UNSIGNED_BYTE}};ra.validate=function(e){return l(e)&&(e===ra.UNSIGNED_BYTE||e===ra.UNSIGNED_SHORT||e===ra.UNSIGNED_INT)};ra.createTypedArray=function(e,t){return e>=P.SIXTY_FOUR_KILOBYTES?new Uint32Array(t):new Uint16Array(t)};ra.createTypedArrayFromArrayBuffer=function(e,t,n,i){return e>=P.SIXTY_FOUR_KILOBYTES?new Uint32Array(t,n,i):new Uint16Array(t,n,i)};ra.fromTypedArray=function(e){if(e instanceof Uint8Array)return ra.UNSIGNED_BYTE;if(e instanceof Uint16Array)return ra.UNSIGNED_SHORT;if(e instanceof Uint32Array)return ra.UNSIGNED_INT};Object.freeze(ra);var je=ra;var pb={STREAM_DRAW:te.STREAM_DRAW,STATIC_DRAW:te.STATIC_DRAW,DYNAMIC_DRAW:te.DYNAMIC_DRAW,DYNAMIC_READ:te.DYNAMIC_READ};pb.validate=function(e){return e===pb.STREAM_DRAW||e===pb.STATIC_DRAW||e===pb.DYNAMIC_DRAW||e===pb.DYNAMIC_READ};Object.freeze(pb);var Me=pb;function Lc(e){e=e??H.EMPTY_OBJECT;let t=e.context._gl,n=e.bufferTarget,i=e.typedArray,r=e.sizeInBytes,o=e.usage,s=l(i);s&&(r=i.byteLength);let a=t.createBuffer();t.bindBuffer(n,a),t.bufferData(n,s?i:r,o),t.bindBuffer(n,null),this._id=Kn(),this._gl=t,this._webgl2=e.context._webgl2,this._bufferTarget=n,this._sizeInBytes=r,this._usage=o,this._buffer=a,this.vertexArrayDestroyable=!0}Lc.createPixelBuffer=function(e){if(!e.context._webgl2)throw new pe("A WebGL 2 context is required to create PixelBuffers.");return new Lc({context:e.context,bufferTarget:te.PIXEL_PACK_BUFFER,typedArray:e.typedArray,sizeInBytes:e.sizeInBytes,usage:e.usage})};Lc.createVertexBuffer=function(e){return new Lc({context:e.context,bufferTarget:te.ARRAY_BUFFER,typedArray:e.typedArray,sizeInBytes:e.sizeInBytes,usage:e.usage})};Lc.createIndexBuffer=function(e){let t=e.context,n=e.indexDatatype,i=je.getSizeInBytes(n),r=new Lc({context:t,bufferTarget:te.ELEMENT_ARRAY_BUFFER,typedArray:e.typedArray,sizeInBytes:e.sizeInBytes,usage:e.usage}),o=r.sizeInBytes/i;return Object.defineProperties(r,{indexDatatype:{get:function(){return n}},bytesPerIndex:{get:function(){return i}},numberOfIndices:{get:function(){return o}}}),r};Object.defineProperties(Lc.prototype,{sizeInBytes:{get:function(){return this._sizeInBytes}},usage:{get:function(){return this._usage}}});Lc.prototype._getBuffer=function(){return this._buffer};Lc.prototype._bind=function(){let e=this._gl,t=this._bufferTarget;e.bindBuffer(t,this._buffer)};Lc.prototype._unBind=function(){let e=this._gl,t=this._bufferTarget;e.bindBuffer(t,null)};Lc.prototype.copyFromArrayView=function(e,t){t=t??0;let n=this._gl,i=this._bufferTarget;n.bindBuffer(i,this._buffer),n.bufferSubData(i,t,e),n.bindBuffer(i,null)};Lc.prototype.copyFromBuffer=function(e,t,n,i){let r=te.COPY_READ_BUFFER,o=te.COPY_WRITE_BUFFER,s=this._gl;s.bindBuffer(o,this._buffer),s.bindBuffer(r,e._buffer),s.copyBufferSubData(r,o,t,n,i),s.bindBuffer(o,null),s.bindBuffer(r,null)};Lc.prototype.getBufferData=function(e,t,n,i){t=t??0,n=n??0;let r=this._gl,o=te.COPY_READ_BUFFER;r.bindBuffer(o,this._buffer),r.getBufferSubData(o,t,e,n,i),r.bindBuffer(o,null)};Lc.prototype.isDestroyed=function(){return!1};Lc.prototype.destroy=function(){return this._gl.deleteBuffer(this._buffer),le(this)};var tt=Lc;var E_,os={requestFullscreen:void 0,exitFullscreen:void 0,fullscreenEnabled:void 0,fullscreenElement:void 0,fullscreenchange:void 0,fullscreenerror:void 0},ru={};Object.defineProperties(ru,{element:{get:function(){if(ru.supportsFullscreen())return document[os.fullscreenElement]}},changeEventName:{get:function(){if(ru.supportsFullscreen())return os.fullscreenchange}},errorEventName:{get:function(){if(ru.supportsFullscreen())return os.fullscreenerror}},enabled:{get:function(){if(ru.supportsFullscreen())return document[os.fullscreenEnabled]}},fullscreen:{get:function(){if(ru.supportsFullscreen())return ru.element!==null}}});ru.supportsFullscreen=function(){if(l(E_))return E_;E_=!1;let e=document.body;if(typeof e.requestFullscreen=="function")return os.requestFullscreen="requestFullscreen",os.exitFullscreen="exitFullscreen",os.fullscreenEnabled="fullscreenEnabled",os.fullscreenElement="fullscreenElement",os.fullscreenchange="fullscreenchange",os.fullscreenerror="fullscreenerror",E_=!0,E_;let t=["webkit","moz","o","ms","khtml"],n;for(let i=0,r=t.length;i<r;++i){let o=t[i];n=`${o}RequestFullscreen`,typeof e[n]=="function"?(os.requestFullscreen=n,E_=!0):(n=`${o}RequestFullScreen`,typeof e[n]=="function"&&(os.requestFullscreen=n,E_=!0)),n=`${o}ExitFullscreen`,typeof document[n]=="function"?os.exitFullscreen=n:(n=`${o}CancelFullScreen`,typeof document[n]=="function"&&(os.exitFullscreen=n)),n=`${o}FullscreenEnabled`,document[n]!==void 0?os.fullscreenEnabled=n:(n=`${o}FullScreenEnabled`,document[n]!==void 0&&(os.fullscreenEnabled=n)),n=`${o}FullscreenElement`,document[n]!==void 0?os.fullscreenElement=n:(n=`${o}FullScreenElement`,document[n]!==void 0&&(os.fullscreenElement=n)),n=`${o}fullscreenchange`,document[`on${n}`]!==void 0&&(o==="ms"&&(n="MSFullscreenChange"),os.fullscreenchange=n),n=`${o}fullscreenerror`,document[`on${n}`]!==void 0&&(o==="ms"&&(n="MSFullscreenError"),os.fullscreenerror=n)}return E_};ru.requestFullscreen=function(e,t){ru.supportsFullscreen()&&e[os.requestFullscreen]({vrDisplay:t})};ru.exitFullscreen=function(){ru.supportsFullscreen()&&document[os.exitFullscreen]()};ru._names=os;var ss=ru;var Kf;typeof navigator<"u"?Kf=navigator:Kf={};function BI(e){let t=e.split(".");for(let n=0,i=t.length;n<i;++n)t[n]=parseInt(t[n],10);return t}var uN,Qae;function xq(){if(!l(uN)&&(uN=!1,!gN())){let e=/ Chrome\/([\.0-9]+)/.exec(Kf.userAgent);e!==null&&(uN=!0,Qae=BI(e[1]))}return uN}function _3e(){return xq()&&Qae}var fN,ece;function tce(){if(!l(fN)&&(fN=!1,!xq()&&!gN()&&/ Safari\/[\.0-9]+/.test(Kf.userAgent))){let e=/ Version\/([\.0-9]+)/.exec(Kf.userAgent);e!==null&&(fN=!0,ece=BI(e[1]))}return fN}function y3e(){return tce()&&ece}var dN,bq;function nce(){if(!l(dN)){dN=!1;let e=/ AppleWebKit\/([\.0-9]+)(\+?)/.exec(Kf.userAgent);e!==null&&(dN=!0,bq=BI(e[1]),bq.isNightly=!!e[2])}return dN}function A3e(){return nce()&&bq}var hN,ice;function gN(){if(!l(hN)){hN=!1;let e=/ Edg\/([\.0-9]+)/.exec(Kf.userAgent);e!==null&&(hN=!0,ice=BI(e[1]))}return hN}function b3e(){return gN()&&ice}var mN,Tq;function _N(){if(!l(mN)){mN=!1;let e=/Firefox\/([\.0-9]+)/.exec(Kf.userAgent);e!==null&&(mN=!0,Tq=BI(e[1]))}return mN}var _q;function x3e(){return l(_q)||(_q=/Windows/i.test(Kf.appVersion)),_q}var yq;function T3e(){return l(yq)||(yq=navigator.platform==="iPhone"||navigator.platform==="iPod"||navigator.platform==="iPad"),yq}function E3e(){return _N()&&Tq}var Aq;function C3e(){return l(Aq)||(Aq=!_N()&&typeof PointerEvent<"u"&&(!l(Kf.pointerEnabled)||Kf.pointerEnabled)),Aq}var rce,pN;function oce(){if(!l(pN)){let e=document.createElement("canvas");e.setAttribute("style","image-rendering: -moz-crisp-edges;image-rendering: pixelated;");let t=e.style.imageRendering;pN=l(t)&&t!=="",pN&&(rce=t)}return pN}function v3e(){return oce()?rce:void 0}function bl(){return bl._result}bl._promise=void 0;bl._result=void 0;bl.initialize=function(){return l(bl._promise)||(bl._promise=new Promise(e=>{let t=new Image;t.onload=function(){bl._result=t.width>0&&t.height>0,e(bl._result)},t.onerror=function(){bl._result=!1,e(bl._result)},t.src="data:image/webp;base64,UklGRiIAAABXRUJQVlA4IBYAAAAwAQCdASoBAAEADsD+JaQAA3AAAAAA"})),bl._promise};Object.defineProperties(bl,{initialized:{get:function(){return l(bl._result)}}});var bE=[];typeof ArrayBuffer<"u"&&(bE.push(Int8Array,Uint8Array,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array),typeof Uint8ClampedArray<"u"&&bE.push(Uint8ClampedArray),typeof Uint8ClampedArray<"u"&&bE.push(Uint8ClampedArray),typeof BigInt64Array<"u"&&bE.push(BigInt64Array),typeof BigUint64Array<"u"&&bE.push(BigUint64Array));var $f={isChrome:xq,chromeVersion:_3e,isSafari:tce,safariVersion:y3e,isWebkit:nce,webkitVersion:A3e,isEdge:gN,edgeVersion:b3e,isFirefox:_N,firefoxVersion:E3e,isWindows:x3e,isIPadOrIOS:T3e,hardwareConcurrency:Kf.hardwareConcurrency??3,supportsPointerEvents:C3e,supportsImageRenderingPixelated:oce,supportsWebP:bl,imageRenderingValue:v3e,typedArrayTypes:bE};$f.supportsBasis=function(e){return $f.supportsWebAssembly()&&e.context.supportsBasis};$f.supportsFullscreen=function(){return ss.supportsFullscreen()};$f.supportsTypedArrays=function(){return typeof ArrayBuffer<"u"};$f.supportsBigInt64Array=function(){return typeof BigInt64Array<"u"};$f.supportsBigUint64Array=function(){return typeof BigUint64Array<"u"};$f.supportsBigInt=function(){return typeof BigInt<"u"};$f.supportsWebWorkers=function(){return typeof Worker<"u"};$f.supportsWebAssembly=function(){return typeof WebAssembly<"u"};$f.supportsWebgl2=function(e){return e.context.webgl2};$f.supportsEsmWebWorkers=function(){return!_N()||parseInt(Tq)>=114};var dn=$f;function Eq(e,t,n){return n<0&&(n+=1),n>1&&(n-=1),n*6<1?e+(t-e)*6*n:n*2<1?t:n*3<2?e+(t-e)*(2/3-n)*6:e}var _e=class e{constructor(t,n,i,r){this.red=t??1,this.green=n??1,this.blue=i??1,this.alpha=r??1}static fromCartesian4(t,n){return l(n)?(n.red=t.x,n.green=t.y,n.blue=t.z,n.alpha=t.w,n):new e(t.x,t.y,t.z,t.w)}static fromBytes(t,n,i,r,o){return t=e.byteToFloat(t??255),n=e.byteToFloat(n??255),i=e.byteToFloat(i??255),r=e.byteToFloat(r??255),l(o)?(o.red=t,o.green=n,o.blue=i,o.alpha=r,o):new e(t,n,i,r)}static fromAlpha(t,n,i){return l(i)?(i.red=t.red,i.green=t.green,i.blue=t.blue,i.alpha=n,i):new e(t.red,t.green,t.blue,n)}static fromRgba(t,n){return vq[0]=t,e.fromBytes(D0[0],D0[1],D0[2],D0[3],n)}static fromHsl(t,n,i,r,o){t=(t??0)%1,n=n??0,i=i??0,r=r??1;let s=i,a=i,c=i;if(n!==0){let u;i<.5?u=i*(1+n):u=i+n-i*n;let f=2*i-u;s=Eq(f,u,t+1/3),a=Eq(f,u,t),c=Eq(f,u,t-1/3)}return l(o)?(o.red=s,o.green=a,o.blue=c,o.alpha=r,o):new e(s,a,c,r)}static fromRandom(t,n){t=t??H.EMPTY_OBJECT;let i=t.red;if(!l(i)){let a=t.minimumRed??0,c=t.maximumRed??1;i=a+P.nextRandomNumber()*(c-a)}let r=t.green;if(!l(r)){let a=t.minimumGreen??0,c=t.maximumGreen??1;r=a+P.nextRandomNumber()*(c-a)}let o=t.blue;if(!l(o)){let a=t.minimumBlue??0,c=t.maximumBlue??1;o=a+P.nextRandomNumber()*(c-a)}let s=t.alpha;if(!l(s)){let a=t.minimumAlpha??0,c=t.maximumAlpha??1;s=a+P.nextRandomNumber()*(c-a)}return l(n)?(n.red=i,n.green=r,n.blue=o,n.alpha=s,n):new e(i,r,o,s)}static fromCssColorString(t,n){l(n)||(n=new e),t=t.trim();let i=e[t.toUpperCase()];if(l(i))return e.clone(i,n),n;let r=S3e.exec(t);return r!==null?(n.red=parseInt(r[1],16)/15,n.green=parseInt(r[2],16)/15,n.blue=parseInt(r[3],16)/15,n.alpha=parseInt(r[4]??"f",16)/15,n):(r=w3e.exec(t),r!==null?(n.red=parseInt(r[1],16)/255,n.green=parseInt(r[2],16)/255,n.blue=parseInt(r[3],16)/255,n.alpha=parseInt(r[4]??"ff",16)/255,n):(r=I3e.exec(t),r!==null?(n.red=parseFloat(r[1])/(r[1].substr(-1)==="%"?100:255),n.green=parseFloat(r[2])/(r[2].substr(-1)==="%"?100:255),n.blue=parseFloat(r[3])/(r[3].substr(-1)==="%"?100:255),n.alpha=parseFloat(r[4]??"1.0"),n):(r=P3e.exec(t),r!==null?e.fromHsl(parseFloat(r[1])/360,parseFloat(r[2])/100,parseFloat(r[3])/100,parseFloat(r[4]??"1.0"),n):(n=void 0,n))))}static pack(t,n,i){return i=i??0,n[i++]=t.red,n[i++]=t.green,n[i++]=t.blue,n[i]=t.alpha,n}static unpack(t,n,i){return n=n??0,l(i)||(i=new e),i.red=t[n++],i.green=t[n++],i.blue=t[n++],i.alpha=t[n],i}static byteToFloat(t){return t/255}static floatToByte(t){return t===1?255:t*256|0}static clone(t,n){if(l(t))return l(n)?(n.red=t.red,n.green=t.green,n.blue=t.blue,n.alpha=t.alpha,n):new e(t.red,t.green,t.blue,t.alpha)}static equals(t,n){return t===n||l(t)&&l(n)&&t.red===n.red&&t.green===n.green&&t.blue===n.blue&&t.alpha===n.alpha}static equalsArray(t,n,i){return t.red===n[i]&&t.green===n[i+1]&&t.blue===n[i+2]&&t.alpha===n[i+3]}clone(t){return e.clone(this,t)}equals(t){return e.equals(this,t)}equalsEpsilon(t,n){return this===t||l(t)&&Math.abs(this.red-t.red)<=n&&Math.abs(this.green-t.green)<=n&&Math.abs(this.blue-t.blue)<=n&&Math.abs(this.alpha-t.alpha)<=n}toString(){return`(${this.red}, ${this.green}, ${this.blue}, ${this.alpha})`}toCssColorString(){let t=e.floatToByte(this.red),n=e.floatToByte(this.green),i=e.floatToByte(this.blue);return this.alpha===1?`rgb(${t},${n},${i})`:`rgba(${t},${n},${i},${this.alpha})`}toCssHexString(){let t=e.floatToByte(this.red).toString(16);t.length<2&&(t=`0${t}`);let n=e.floatToByte(this.green).toString(16);n.length<2&&(n=`0${n}`);let i=e.floatToByte(this.blue).toString(16);if(i.length<2&&(i=`0${i}`),this.alpha<1){let r=e.floatToByte(this.alpha).toString(16);return r.length<2&&(r=`0${r}`),`#${t}${n}${i}${r}`}return`#${t}${n}${i}`}toBytes(t){let n=e.floatToByte(this.red),i=e.floatToByte(this.green),r=e.floatToByte(this.blue),o=e.floatToByte(this.alpha);return l(t)?(t[0]=n,t[1]=i,t[2]=r,t[3]=o,t):[n,i,r,o]}static bytesToRgba(t,n,i,r){return D0[0]=t,D0[1]=n,D0[2]=i,D0[3]=r,vq[0]}toRgba(){return e.bytesToRgba(e.floatToByte(this.red),e.floatToByte(this.green),e.floatToByte(this.blue),e.floatToByte(this.alpha))}brighten(t,n){return t=1-t,n.red=1-(1-this.red)*t,n.green=1-(1-this.green)*t,n.blue=1-(1-this.blue)*t,n.alpha=this.alpha,n}darken(t,n){return t=1-t,n.red=this.red*t,n.green=this.green*t,n.blue=this.blue*t,n.alpha=this.alpha,n}withAlpha(t,n){return e.fromAlpha(this,t,n)}static add(t,n,i){return i.red=t.red+n.red,i.green=t.green+n.green,i.blue=t.blue+n.blue,i.alpha=t.alpha+n.alpha,i}static subtract(t,n,i){return i.red=t.red-n.red,i.green=t.green-n.green,i.blue=t.blue-n.blue,i.alpha=t.alpha-n.alpha,i}static multiply(t,n,i){return i.red=t.red*n.red,i.green=t.green*n.green,i.blue=t.blue*n.blue,i.alpha=t.alpha*n.alpha,i}static divide(t,n,i){return i.red=t.red/n.red,i.green=t.green/n.green,i.blue=t.blue/n.blue,i.alpha=t.alpha/n.alpha,i}static mod(t,n,i){return i.red=t.red%n.red,i.green=t.green%n.green,i.blue=t.blue%n.blue,i.alpha=t.alpha%n.alpha,i}static lerp(t,n,i,r){return r.red=P.lerp(t.red,n.red,i),r.green=P.lerp(t.green,n.green,i),r.blue=P.lerp(t.blue,n.blue,i),r.alpha=P.lerp(t.alpha,n.alpha,i),r}static multiplyByScalar(t,n,i){return i.red=t.red*n,i.green=t.green*n,i.blue=t.blue*n,i.alpha=t.alpha*n,i}static divideByScalar(t,n,i){return i.red=t.red/n,i.green=t.green/n,i.blue=t.blue/n,i.alpha=t.alpha/n,i}},Cq,vq,D0;dn.supportsTypedArrays()&&(Cq=new ArrayBuffer(4),vq=new Uint32Array(Cq),D0=new Uint8Array(Cq));var S3e=/^#([0-9a-f])([0-9a-f])([0-9a-f])([0-9a-f])?$/i,w3e=/^#([0-9a-f]{2})([0-9a-f]{2})([0-9a-f]{2})([0-9a-f]{2})?$/i,I3e=/^rgba?\s*\(\s*([0-9.]+%?)\s*[,\s]+\s*([0-9.]+%?)\s*[,\s]+\s*([0-9.]+%?)(?:\s*[,\s/]+\s*([0-9.]+))?\s*\)$/i,P3e=/^hsla?\s*\(\s*([0-9.]+)\s*[,\s]+\s*([0-9.]+%)\s*[,\s]+\s*([0-9.]+%)(?:\s*[,\s/]+\s*([0-9.]+))?\s*\)$/i;_e.packedLength=4;_e.ALICEBLUE=Object.freeze(_e.fromCssColorString("#F0F8FF"));_e.ANTIQUEWHITE=Object.freeze(_e.fromCssColorString("#FAEBD7"));_e.AQUA=Object.freeze(_e.fromCssColorString("#00FFFF"));_e.AQUAMARINE=Object.freeze(_e.fromCssColorString("#7FFFD4"));_e.AZURE=Object.freeze(_e.fromCssColorString("#F0FFFF"));_e.BEIGE=Object.freeze(_e.fromCssColorString("#F5F5DC"));_e.BISQUE=Object.freeze(_e.fromCssColorString("#FFE4C4"));_e.BLACK=Object.freeze(_e.fromCssColorString("#000000"));_e.BLANCHEDALMOND=Object.freeze(_e.fromCssColorString("#FFEBCD"));_e.BLUE=Object.freeze(_e.fromCssColorString("#0000FF"));_e.BLUEVIOLET=Object.freeze(_e.fromCssColorString("#8A2BE2"));_e.BROWN=Object.freeze(_e.fromCssColorString("#A52A2A"));_e.BURLYWOOD=Object.freeze(_e.fromCssColorString("#DEB887"));_e.CADETBLUE=Object.freeze(_e.fromCssColorString("#5F9EA0"));_e.CHARTREUSE=Object.freeze(_e.fromCssColorString("#7FFF00"));_e.CHOCOLATE=Object.freeze(_e.fromCssColorString("#D2691E"));_e.CORAL=Object.freeze(_e.fromCssColorString("#FF7F50"));_e.CORNFLOWERBLUE=Object.freeze(_e.fromCssColorString("#6495ED"));_e.CORNSILK=Object.freeze(_e.fromCssColorString("#FFF8DC"));_e.CRIMSON=Object.freeze(_e.fromCssColorString("#DC143C"));_e.CYAN=Object.freeze(_e.fromCssColorString("#00FFFF"));_e.DARKBLUE=Object.freeze(_e.fromCssColorString("#00008B"));_e.DARKCYAN=Object.freeze(_e.fromCssColorString("#008B8B"));_e.DARKGOLDENROD=Object.freeze(_e.fromCssColorString("#B8860B"));_e.DARKGRAY=Object.freeze(_e.fromCssColorString("#A9A9A9"));_e.DARKGREEN=Object.freeze(_e.fromCssColorString("#006400"));_e.DARKGREY=_e.DARKGRAY;_e.DARKKHAKI=Object.freeze(_e.fromCssColorString("#BDB76B"));_e.DARKMAGENTA=Object.freeze(_e.fromCssColorString("#8B008B"));_e.DARKOLIVEGREEN=Object.freeze(_e.fromCssColorString("#556B2F"));_e.DARKORANGE=Object.freeze(_e.fromCssColorString("#FF8C00"));_e.DARKORCHID=Object.freeze(_e.fromCssColorString("#9932CC"));_e.DARKRED=Object.freeze(_e.fromCssColorString("#8B0000"));_e.DARKSALMON=Object.freeze(_e.fromCssColorString("#E9967A"));_e.DARKSEAGREEN=Object.freeze(_e.fromCssColorString("#8FBC8F"));_e.DARKSLATEBLUE=Object.freeze(_e.fromCssColorString("#483D8B"));_e.DARKSLATEGRAY=Object.freeze(_e.fromCssColorString("#2F4F4F"));_e.DARKSLATEGREY=_e.DARKSLATEGRAY;_e.DARKTURQUOISE=Object.freeze(_e.fromCssColorString("#00CED1"));_e.DARKVIOLET=Object.freeze(_e.fromCssColorString("#9400D3"));_e.DEEPPINK=Object.freeze(_e.fromCssColorString("#FF1493"));_e.DEEPSKYBLUE=Object.freeze(_e.fromCssColorString("#00BFFF"));_e.DIMGRAY=Object.freeze(_e.fromCssColorString("#696969"));_e.DIMGREY=_e.DIMGRAY;_e.DODGERBLUE=Object.freeze(_e.fromCssColorString("#1E90FF"));_e.FIREBRICK=Object.freeze(_e.fromCssColorString("#B22222"));_e.FLORALWHITE=Object.freeze(_e.fromCssColorString("#FFFAF0"));_e.FORESTGREEN=Object.freeze(_e.fromCssColorString("#228B22"));_e.FUCHSIA=Object.freeze(_e.fromCssColorString("#FF00FF"));_e.GAINSBORO=Object.freeze(_e.fromCssColorString("#DCDCDC"));_e.GHOSTWHITE=Object.freeze(_e.fromCssColorString("#F8F8FF"));_e.GOLD=Object.freeze(_e.fromCssColorString("#FFD700"));_e.GOLDENROD=Object.freeze(_e.fromCssColorString("#DAA520"));_e.GRAY=Object.freeze(_e.fromCssColorString("#808080"));_e.GREEN=Object.freeze(_e.fromCssColorString("#008000"));_e.GREENYELLOW=Object.freeze(_e.fromCssColorString("#ADFF2F"));_e.GREY=_e.GRAY;_e.HONEYDEW=Object.freeze(_e.fromCssColorString("#F0FFF0"));_e.HOTPINK=Object.freeze(_e.fromCssColorString("#FF69B4"));_e.INDIANRED=Object.freeze(_e.fromCssColorString("#CD5C5C"));_e.INDIGO=Object.freeze(_e.fromCssColorString("#4B0082"));_e.IVORY=Object.freeze(_e.fromCssColorString("#FFFFF0"));_e.KHAKI=Object.freeze(_e.fromCssColorString("#F0E68C"));_e.LAVENDER=Object.freeze(_e.fromCssColorString("#E6E6FA"));_e.LAVENDAR_BLUSH=Object.freeze(_e.fromCssColorString("#FFF0F5"));_e.LAWNGREEN=Object.freeze(_e.fromCssColorString("#7CFC00"));_e.LEMONCHIFFON=Object.freeze(_e.fromCssColorString("#FFFACD"));_e.LIGHTBLUE=Object.freeze(_e.fromCssColorString("#ADD8E6"));_e.LIGHTCORAL=Object.freeze(_e.fromCssColorString("#F08080"));_e.LIGHTCYAN=Object.freeze(_e.fromCssColorString("#E0FFFF"));_e.LIGHTGOLDENRODYELLOW=Object.freeze(_e.fromCssColorString("#FAFAD2"));_e.LIGHTGRAY=Object.freeze(_e.fromCssColorString("#D3D3D3"));_e.LIGHTGREEN=Object.freeze(_e.fromCssColorString("#90EE90"));_e.LIGHTGREY=_e.LIGHTGRAY;_e.LIGHTPINK=Object.freeze(_e.fromCssColorString("#FFB6C1"));_e.LIGHTSEAGREEN=Object.freeze(_e.fromCssColorString("#20B2AA"));_e.LIGHTSKYBLUE=Object.freeze(_e.fromCssColorString("#87CEFA"));_e.LIGHTSLATEGRAY=Object.freeze(_e.fromCssColorString("#778899"));_e.LIGHTSLATEGREY=_e.LIGHTSLATEGRAY;_e.LIGHTSTEELBLUE=Object.freeze(_e.fromCssColorString("#B0C4DE"));_e.LIGHTYELLOW=Object.freeze(_e.fromCssColorString("#FFFFE0"));_e.LIME=Object.freeze(_e.fromCssColorString("#00FF00"));_e.LIMEGREEN=Object.freeze(_e.fromCssColorString("#32CD32"));_e.LINEN=Object.freeze(_e.fromCssColorString("#FAF0E6"));_e.MAGENTA=Object.freeze(_e.fromCssColorString("#FF00FF"));_e.MAROON=Object.freeze(_e.fromCssColorString("#800000"));_e.MEDIUMAQUAMARINE=Object.freeze(_e.fromCssColorString("#66CDAA"));_e.MEDIUMBLUE=Object.freeze(_e.fromCssColorString("#0000CD"));_e.MEDIUMORCHID=Object.freeze(_e.fromCssColorString("#BA55D3"));_e.MEDIUMPURPLE=Object.freeze(_e.fromCssColorString("#9370DB"));_e.MEDIUMSEAGREEN=Object.freeze(_e.fromCssColorString("#3CB371"));_e.MEDIUMSLATEBLUE=Object.freeze(_e.fromCssColorString("#7B68EE"));_e.MEDIUMSPRINGGREEN=Object.freeze(_e.fromCssColorString("#00FA9A"));_e.MEDIUMTURQUOISE=Object.freeze(_e.fromCssColorString("#48D1CC"));_e.MEDIUMVIOLETRED=Object.freeze(_e.fromCssColorString("#C71585"));_e.MIDNIGHTBLUE=Object.freeze(_e.fromCssColorString("#191970"));_e.MINTCREAM=Object.freeze(_e.fromCssColorString("#F5FFFA"));_e.MISTYROSE=Object.freeze(_e.fromCssColorString("#FFE4E1"));_e.MOCCASIN=Object.freeze(_e.fromCssColorString("#FFE4B5"));_e.NAVAJOWHITE=Object.freeze(_e.fromCssColorString("#FFDEAD"));_e.NAVY=Object.freeze(_e.fromCssColorString("#000080"));_e.OLDLACE=Object.freeze(_e.fromCssColorString("#FDF5E6"));_e.OLIVE=Object.freeze(_e.fromCssColorString("#808000"));_e.OLIVEDRAB=Object.freeze(_e.fromCssColorString("#6B8E23"));_e.ORANGE=Object.freeze(_e.fromCssColorString("#FFA500"));_e.ORANGERED=Object.freeze(_e.fromCssColorString("#FF4500"));_e.ORCHID=Object.freeze(_e.fromCssColorString("#DA70D6"));_e.PALEGOLDENROD=Object.freeze(_e.fromCssColorString("#EEE8AA"));_e.PALEGREEN=Object.freeze(_e.fromCssColorString("#98FB98"));_e.PALETURQUOISE=Object.freeze(_e.fromCssColorString("#AFEEEE"));_e.PALEVIOLETRED=Object.freeze(_e.fromCssColorString("#DB7093"));_e.PAPAYAWHIP=Object.freeze(_e.fromCssColorString("#FFEFD5"));_e.PEACHPUFF=Object.freeze(_e.fromCssColorString("#FFDAB9"));_e.PERU=Object.freeze(_e.fromCssColorString("#CD853F"));_e.PINK=Object.freeze(_e.fromCssColorString("#FFC0CB"));_e.PLUM=Object.freeze(_e.fromCssColorString("#DDA0DD"));_e.POWDERBLUE=Object.freeze(_e.fromCssColorString("#B0E0E6"));_e.PURPLE=Object.freeze(_e.fromCssColorString("#800080"));_e.RED=Object.freeze(_e.fromCssColorString("#FF0000"));_e.ROSYBROWN=Object.freeze(_e.fromCssColorString("#BC8F8F"));_e.ROYALBLUE=Object.freeze(_e.fromCssColorString("#4169E1"));_e.SADDLEBROWN=Object.freeze(_e.fromCssColorString("#8B4513"));_e.SALMON=Object.freeze(_e.fromCssColorString("#FA8072"));_e.SANDYBROWN=Object.freeze(_e.fromCssColorString("#F4A460"));_e.SEAGREEN=Object.freeze(_e.fromCssColorString("#2E8B57"));_e.SEASHELL=Object.freeze(_e.fromCssColorString("#FFF5EE"));_e.SIENNA=Object.freeze(_e.fromCssColorString("#A0522D"));_e.SILVER=Object.freeze(_e.fromCssColorString("#C0C0C0"));_e.SKYBLUE=Object.freeze(_e.fromCssColorString("#87CEEB"));_e.SLATEBLUE=Object.freeze(_e.fromCssColorString("#6A5ACD"));_e.SLATEGRAY=Object.freeze(_e.fromCssColorString("#708090"));_e.SLATEGREY=_e.SLATEGRAY;_e.SNOW=Object.freeze(_e.fromCssColorString("#FFFAFA"));_e.SPRINGGREEN=Object.freeze(_e.fromCssColorString("#00FF7F"));_e.STEELBLUE=Object.freeze(_e.fromCssColorString("#4682B4"));_e.TAN=Object.freeze(_e.fromCssColorString("#D2B48C"));_e.TEAL=Object.freeze(_e.fromCssColorString("#008080"));_e.THISTLE=Object.freeze(_e.fromCssColorString("#D8BFD8"));_e.TOMATO=Object.freeze(_e.fromCssColorString("#FF6347"));_e.TURQUOISE=Object.freeze(_e.fromCssColorString("#40E0D0"));_e.VIOLET=Object.freeze(_e.fromCssColorString("#EE82EE"));_e.WHEAT=Object.freeze(_e.fromCssColorString("#F5DEB3"));_e.WHITE=Object.freeze(_e.fromCssColorString("#FFFFFF"));_e.WHITESMOKE=Object.freeze(_e.fromCssColorString("#F5F5F5"));_e.YELLOW=Object.freeze(_e.fromCssColorString("#FFFF00"));_e.YELLOWGREEN=Object.freeze(_e.fromCssColorString("#9ACD32"));_e.TRANSPARENT=Object.freeze(new _e(0,0,0,0));var z=_e;function yN(e){e=e??H.EMPTY_OBJECT,this.color=e.color,this.depth=e.depth,this.stencil=e.stencil,this.renderState=e.renderState,this.framebuffer=e.framebuffer,this.owner=e.owner,this.pass=e.pass}yN.ALL=Object.freeze(new yN({color:new z(0,0,0,0),depth:1,stencil:0}));yN.prototype.execute=function(e,t){e.clear(this,t)};var fi=yN;var sce={ENVIRONMENT:0,COMPUTE:1,GLOBE:2,TERRAIN_CLASSIFICATION:3,CESIUM_3D_TILE_EDGES:4,CESIUM_3D_TILE_PLANAR_FILL_ID:5,CESIUM_3D_TILE:6,CESIUM_3D_TILE_CLASSIFICATION:7,CESIUM_3D_TILE_CLASSIFICATION_IGNORE_SHOW:8,OPAQUE:9,TRANSLUCENT:10,VOXELS:11,GAUSSIAN_SPLATS:12,CESIUM_3D_TILE_EDGES_DIRECT:13,OVERLAY:14,NUMBER_OF_PASSES:15};Object.freeze(sce);var Ie=sce;function ace(e){e=e??H.EMPTY_OBJECT,this.vertexArray=e.vertexArray,this.fragmentShaderSource=e.fragmentShaderSource,this.shaderProgram=e.shaderProgram,this.uniformMap=e.uniformMap,this.outputTexture=e.outputTexture,this.preExecute=e.preExecute,this.postExecute=e.postExecute,this.canceled=e.canceled,this.persists=e.persists??!1,this.pass=Ie.COMPUTE,this.owner=e.owner}ace.prototype.execute=function(e){e.execute(this)};var Jf=ace;var as=class e{constructor(t,n){this.x=t??0,this.y=n??0}static fromElements(t,n,i){return l(i)?(i.x=t,i.y=n,i):new e(t,n)}static clone(t,n){if(l(t))return l(n)?(n.x=t.x,n.y=t.y,n):new e(t.x,t.y)}static pack(t,n,i){return i=i??0,n[i++]=t.x,n[i]=t.y,n}static unpack(t,n,i){return n=n??0,l(i)||(i=new e),i.x=t[n++],i.y=t[n],i}static packArray(t,n){let i=t.length,r=i*2;l(n)?!Array.isArray(n)&&n.length!==r||n.length!==r&&(n.length=r):n=new Array(r);for(let o=0;o<i;++o)e.pack(t[o],n,o*2);return n}static unpackArray(t,n){let i=t.length;l(n)?n.length=i/2:n=new Array(i/2);for(let r=0;r<i;r+=2){let o=r/2;n[o]=e.unpack(t,r,n[o])}return n}static maximumComponent(t){return Math.max(t.x,t.y)}static minimumComponent(t){return Math.min(t.x,t.y)}static minimumByComponent(t,n,i){return i.x=Math.min(t.x,n.x),i.y=Math.min(t.y,n.y),i}static maximumByComponent(t,n,i){return i.x=Math.max(t.x,n.x),i.y=Math.max(t.y,n.y),i}static clamp(t,n,i,r){let o=P.clamp(t.x,n.x,i.x),s=P.clamp(t.y,n.y,i.y);return r.x=o,r.y=s,r}static magnitudeSquared(t){return t.x*t.x+t.y*t.y}static magnitude(t){return Math.sqrt(e.magnitudeSquared(t))}static distance(t,n){return e.subtract(t,n,AN),e.magnitude(AN)}static distanceSquared(t,n){return e.subtract(t,n,AN),e.magnitudeSquared(AN)}static normalize(t,n){let i=e.magnitude(t);return n.x=t.x/i,n.y=t.y/i,n}static dot(t,n){return t.x*n.x+t.y*n.y}static cross(t,n){return t.x*n.y-t.y*n.x}static multiplyComponents(t,n,i){return i.x=t.x*n.x,i.y=t.y*n.y,i}static divideComponents(t,n,i){return i.x=t.x/n.x,i.y=t.y/n.y,i}static add(t,n,i){return i.x=t.x+n.x,i.y=t.y+n.y,i}static subtract(t,n,i){return i.x=t.x-n.x,i.y=t.y-n.y,i}static multiplyByScalar(t,n,i){return i.x=t.x*n,i.y=t.y*n,i}static divideByScalar(t,n,i){return i.x=t.x/n,i.y=t.y/n,i}static negate(t,n){return n.x=-t.x,n.y=-t.y,n}static abs(t,n){return n.x=Math.abs(t.x),n.y=Math.abs(t.y),n}static lerp(t,n,i,r){return e.multiplyByScalar(n,i,cce),r=e.multiplyByScalar(t,1-i,r),e.add(cce,r,r)}static angleBetween(t,n){return e.normalize(t,lce),e.normalize(n,uce),P.acosClamped(e.dot(lce,uce))}static mostOrthogonalAxis(t,n){let i=e.normalize(t,D3e);return e.abs(i,i),i.x<=i.y?n=e.clone(e.UNIT_X,n):n=e.clone(e.UNIT_Y,n),n}static equals(t,n){return t===n||l(t)&&l(n)&&t.x===n.x&&t.y===n.y}static equalsArray(t,n,i){return t.x===n[i]&&t.y===n[i+1]}static equalsEpsilon(t,n,i,r){return t===n||l(t)&&l(n)&&P.equalsEpsilon(t.x,n.x,i,r)&&P.equalsEpsilon(t.y,n.y,i,r)}clone(t){return e.clone(this,t)}equals(t){return e.equals(this,t)}equalsEpsilon(t,n,i){return e.equalsEpsilon(this,t,n,i)}toString(){return`(${this.x}, ${this.y})`}};as.fromCartesian3=as.clone;as.fromCartesian4=as.clone;as.packedLength=2;as.fromArray=as.unpack;var AN=new as,cce=new as,lce=new as,uce=new as,D3e=new as;as.ZERO=Object.freeze(new as(0,0));as.ONE=Object.freeze(new as(1,1));as.UNIT_X=Object.freeze(new as(1,0));as.UNIT_Y=Object.freeze(new as(0,1));var U=as;var R3e=new h,O3e=new h;function M3e(e,t,n,i,r){let o=e.x,s=e.y,a=e.z,c=t.x,u=t.y,f=t.z,d=o*o*c*c,p=s*s*u*u,g=a*a*f*f,m=d+p+g,y=Math.sqrt(1/m),A=h.multiplyByScalar(e,y,R3e);if(m<i)return isFinite(y)?h.clone(A,r):void 0;let b=n.x,x=n.y,T=n.z,E=O3e;E.x=A.x*b*2,E.y=A.y*x*2,E.z=A.z*T*2;let v=(1-y)*h.magnitude(e)/(.5*h.magnitude(E)),S=0,I,R,O,L,_,C,w,D,N,F,V;do{v-=S,O=1/(1+v*b),L=1/(1+v*x),_=1/(1+v*T),C=O*O,w=L*L,D=_*_,N=C*O,F=w*L,V=D*_,I=d*C+p*w+g*D-1,R=d*N*b+p*F*x+g*V*T;let B=-2*R;S=I/B}while(Math.abs(I)>P.EPSILON12);return l(r)?(r.x=o*O,r.y=s*L,r.z=a*_,r):new h(o*O,s*L,a*_)}var xE=M3e;var xl=class xl{constructor(t,n,i){this.longitude=t??0,this.latitude=n??0,this.height=i??0}static fromRadians(t,n,i,r){return i=i??0,l(r)?(r.longitude=t,r.latitude=n,r.height=i,r):new xl(t,n,i)}static fromDegrees(t,n,i,r){return t=P.toRadians(t),n=P.toRadians(n),xl.fromRadians(t,n,i,r)}static fromCartesian(t,n,i){let r=l(n)?n.oneOverRadii:xl._ellipsoidOneOverRadii,o=l(n)?n.oneOverRadiiSquared:xl._ellipsoidOneOverRadiiSquared,s=l(n)?n._centerToleranceSquared:xl._ellipsoidCenterToleranceSquared,a=xE(t,r,o,s,L3e);if(!l(a))return;let c=h.multiplyComponents(a,o,N3e);c=h.normalize(c,c);let u=h.subtract(t,a,F3e),f=Math.atan2(c.y,c.x),d=Math.asin(c.z),p=P.sign(h.dot(u,t))*h.magnitude(u);return l(i)?(i.longitude=f,i.latitude=d,i.height=p,i):new xl(f,d,p)}static toCartesian(t,n,i){return h.fromRadians(t.longitude,t.latitude,t.height,n,i)}static clone(t,n){if(l(t))return l(n)?(n.longitude=t.longitude,n.latitude=t.latitude,n.height=t.height,n):new xl(t.longitude,t.latitude,t.height)}static equals(t,n){return t===n||l(t)&&l(n)&&t.longitude===n.longitude&&t.latitude===n.latitude&&t.height===n.height}static equalsEpsilon(t,n,i){return i=i??0,t===n||l(t)&&l(n)&&Math.abs(t.longitude-n.longitude)<=i&&Math.abs(t.latitude-n.latitude)<=i&&Math.abs(t.height-n.height)<=i}clone(t){return xl.clone(this,t)}equals(t){return xl.equals(this,t)}equalsEpsilon(t,n){return xl.equalsEpsilon(this,t,n)}toString(){return`(${this.longitude}, ${this.latitude}, ${this.height})`}};ut(xl,"_ellipsoidOneOverRadii",new h(1/6378137,1/6378137,1/6356752314245179e-9)),ut(xl,"_ellipsoidOneOverRadiiSquared",new h(1/(6378137*6378137),1/(6378137*6378137),1/(6356752314245179e-9*6356752314245179e-9))),ut(xl,"_ellipsoidCenterToleranceSquared",P.EPSILON1);var kI=xl;kI.ZERO=Object.freeze(new kI(0,0,0));var N3e=new h,L3e=new h,F3e=new h,he=kI;function fce(e,t,n,i){t=t??0,n=n??0,i=i??0,e._radii=new h(t,n,i),e._radiiSquared=new h(t*t,n*n,i*i),e._radiiToTheFourth=new h(t*t*t*t,n*n*n*n,i*i*i*i),e._oneOverRadii=new h(t===0?0:1/t,n===0?0:1/n,i===0?0:1/i),e._oneOverRadiiSquared=new h(t===0?0:1/(t*t),n===0?0:1/(n*n),i===0?0:1/(i*i)),e._minimumRadius=Math.min(t,n,i),e._maximumRadius=Math.max(t,n,i),e._centerToleranceSquared=P.EPSILON1,e._radiiSquared.z!==0&&(e._squaredXOverSquaredZ=e._radiiSquared.x/e._radiiSquared.z)}var Tl=class e{constructor(t,n,i){this._radii=void 0,this._radiiSquared=void 0,this._radiiToTheFourth=void 0,this._oneOverRadii=void 0,this._oneOverRadiiSquared=void 0,this._minimumRadius=void 0,this._maximumRadius=void 0,this._centerToleranceSquared=void 0,this._squaredXOverSquaredZ=void 0,fce(this,t,n,i)}get radii(){return this._radii}get radiiSquared(){return this._radiiSquared}get radiiToTheFourth(){return this._radiiToTheFourth}get oneOverRadii(){return this._oneOverRadii}get oneOverRadiiSquared(){return this._oneOverRadiiSquared}get minimumRadius(){return this._minimumRadius}get maximumRadius(){return this._maximumRadius}static clone(t,n){if(!l(t))return;let i=t._radii;return l(n)?(h.clone(i,n._radii),h.clone(t._radiiSquared,n._radiiSquared),h.clone(t._radiiToTheFourth,n._radiiToTheFourth),h.clone(t._oneOverRadii,n._oneOverRadii),h.clone(t._oneOverRadiiSquared,n._oneOverRadiiSquared),n._minimumRadius=t._minimumRadius,n._maximumRadius=t._maximumRadius,n._centerToleranceSquared=t._centerToleranceSquared,n):new e(i.x,i.y,i.z)}static fromCartesian3(t,n){return l(n)||(n=new e),l(t)&&fce(n,t.x,t.y,t.z),n}static get default(){return e._default}static set default(t){e._default=t,h._ellipsoidRadiiSquared=t.radiiSquared,he._ellipsoidOneOverRadii=t.oneOverRadii,he._ellipsoidOneOverRadiiSquared=t.oneOverRadiiSquared,he._ellipsoidCenterToleranceSquared=t._centerToleranceSquared}clone(t){return e.clone(this,t)}static pack(t,n,i){return i=i??0,h.pack(t._radii,n,i),n}static unpack(t,n,i){n=n??0;let r=h.unpack(t,n);return e.fromCartesian3(r,i)}geodeticSurfaceNormalCartographic(t,n){let i=t.longitude,r=t.latitude,o=Math.cos(r),s=o*Math.cos(i),a=o*Math.sin(i),c=Math.sin(r);return l(n)||(n=new h),n.x=s,n.y=a,n.z=c,h.normalize(n,n)}geodeticSurfaceNormal(t,n){if(!h.equalsEpsilon(t,h.ZERO,P.EPSILON14))return l(n)||(n=new h),n=h.multiplyComponents(t,this._oneOverRadiiSquared,n),h.normalize(n,n)}cartographicToCartesian(t,n){let i=B3e,r=k3e;this.geodeticSurfaceNormalCartographic(t,i),h.multiplyComponents(this._radiiSquared,i,r);let o=Math.sqrt(h.dot(i,r));return h.divideByScalar(r,o,r),h.multiplyByScalar(i,t.height,i),l(n)||(n=new h),h.add(r,i,n)}cartographicArrayToCartesianArray(t,n){let i=t.length;l(n)?n.length=i:n=new Array(i);for(let r=0;r<i;r++)n[r]=this.cartographicToCartesian(t[r],n[r]);return n}cartesianToCartographic(t,n){let i=this.scaleToGeodeticSurface(t,z3e);if(!l(i))return;let r=this.geodeticSurfaceNormal(i,U3e),o=h.subtract(t,i,V3e),s=Math.atan2(r.y,r.x),a=Math.asin(r.z),c=P.sign(h.dot(o,t))*h.magnitude(o);return l(n)?(n.longitude=s,n.latitude=a,n.height=c,n):new he(s,a,c)}cartesianArrayToCartographicArray(t,n){let i=t.length;l(n)?n.length=i:n=new Array(i);for(let r=0;r<i;++r)n[r]=this.cartesianToCartographic(t[r],n[r]);return n}scaleToGeodeticSurface(t,n){return xE(t,this._oneOverRadii,this._oneOverRadiiSquared,this._centerToleranceSquared,n)}scaleToGeocentricSurface(t,n){l(n)||(n=new h);let i=t.x,r=t.y,o=t.z,s=this._oneOverRadiiSquared,a=1/Math.sqrt(i*i*s.x+r*r*s.y+o*o*s.z);return h.multiplyByScalar(t,a,n)}transformPositionToScaledSpace(t,n){return l(n)||(n=new h),h.multiplyComponents(t,this._oneOverRadii,n)}transformPositionFromScaledSpace(t,n){return l(n)||(n=new h),h.multiplyComponents(t,this._radii,n)}equals(t){return this===t||l(t)&&h.equals(this._radii,t._radii)}toString(){return this._radii.toString()}getSurfaceNormalIntersectionWithZAxis(t,n,i){n=n??0;let r=this._squaredXOverSquaredZ;if(l(i)||(i=new h),i.x=0,i.y=0,i.z=t.z*(1-r),!(Math.abs(i.z)>=this._radii.z-n))return i}getLocalCurvature(t,n){l(n)||(n=new U);let i=this.getSurfaceNormalIntersectionWithZAxis(t,0,j3e),r=h.distance(t,i),o=this.minimumRadius*r/this.maximumRadius**2,s=r*o**2;return U.fromElements(1/r,1/s,n)}surfaceArea(t){let n=t.west,i=t.east,r=t.south,o=t.north;for(;i<n;)i+=P.TWO_PI;let s=this._radiiSquared,a=s.x,c=s.y,u=s.z,f=a*c;return dce(r,o,function(d){let p=Math.cos(d),g=Math.sin(d);return Math.cos(d)*dce(n,i,function(m){let y=Math.cos(m),A=Math.sin(m);return Math.sqrt(f*g*g+u*(c*y*y+a*A*A)*p*p)})})}};Tl.WGS84=Object.freeze(new Tl(6378137,6378137,6356752314245179e-9));Tl.UNIT_SPHERE=Object.freeze(new Tl(1,1,1));Tl.MOON=Object.freeze(new Tl(P.LUNAR_RADIUS,P.LUNAR_RADIUS,P.LUNAR_RADIUS));Tl.MARS=Object.freeze(new Tl(3396190,3396190,3376200));Tl._default=Tl.WGS84;Tl.packedLength=h.packedLength;Tl.prototype.geocentricSurfaceNormal=h.normalize;var B3e=new h,k3e=new h,U3e=new h,z3e=new h,V3e=new h,j3e=new h,H3e=[.14887433898163,.43339539412925,.67940956829902,.86506336668898,.97390652851717,0],G3e=[.29552422471475,.26926671930999,.21908636251598,.14945134915058,.066671344308684,0];function dce(e,t,n){let i=.5*(t+e),r=.5*(t-e),o=0;for(let s=0;s<5;s++){let a=r*H3e[s];o+=G3e[s]*(n(i+a)+n(i-a))}return o*=r,o}var ee=Tl;var Sq=class{constructor(t){this._ellipsoid=t??ee.default,this._semimajorAxis=this._ellipsoid.maximumRadius,this._oneOverSemimajorAxis=1/this._semimajorAxis}get ellipsoid(){return this._ellipsoid}project(t,n){let i=this._semimajorAxis,r=t.longitude*i,o=t.latitude*i,s=t.height;return l(n)?(n.x=r,n.y=o,n.z=s,n):new h(r,o,s)}unproject(t,n){let i=this._oneOverSemimajorAxis,r=t.x*i,o=t.y*i,s=t.z;return l(n)?(n.longitude=r,n.latitude=o,n.height=s,n):new he(r,o,s)}},ji=Sq;var hce={OUTSIDE:-1,INTERSECTING:0,INSIDE:1};Object.freeze(hce);var $t=hce;function W3e(e,t,n){let i=0,r=e.length-1,o,s;for(;i<=r;){if(o=~~((i+r)/2),s=n(e[o],t),s<0){i=o+1;continue}if(s>0){r=o-1;continue}return o}return~(r+1)}var Pr=W3e;function q3e(e,t,n,i,r){this.xPoleWander=e,this.yPoleWander=t,this.xPoleOffset=n,this.yPoleOffset=i,this.ut1MinusUtc=r}var gb=q3e;function Y3e(e){return e%4===0&&e%100!==0||e%400===0}var ou=Y3e;var mce=[31,28,31,30,31,30,31,31,30,31,30,31];function X3e(e,t,n,i,r,o,s,a){e=e??1,t=t??1,n=n??1,i=i??0,r=r??0,o=o??0,s=s??0,a=a??!1,this.year=e,this.month=t,this.day=n,this.hour=i,this.minute=r,this.second=o,this.millisecond=s,this.isLeapSecond=a;function y(){qr.typeOf.number.greaterThanOrEquals("Year",e,1),qr.typeOf.number.lessThanOrEquals("Year",e,9999),qr.typeOf.number.greaterThanOrEquals("Month",t,1),qr.typeOf.number.lessThanOrEquals("Month",t,12),qr.typeOf.number.greaterThanOrEquals("Day",n,1),qr.typeOf.number.lessThanOrEquals("Day",n,31),qr.typeOf.number.greaterThanOrEquals("Hour",i,0),qr.typeOf.number.lessThanOrEquals("Hour",i,23),qr.typeOf.number.greaterThanOrEquals("Minute",r,0),qr.typeOf.number.lessThanOrEquals("Minute",r,59),qr.typeOf.bool("IsLeapSecond",a),qr.typeOf.number.greaterThanOrEquals("Second",o,0),qr.typeOf.number.lessThanOrEquals("Second",o,a?60:59),qr.typeOf.number.greaterThanOrEquals("Millisecond",s,0),qr.typeOf.number.lessThan("Millisecond",s,1e3)}function A(){let b=t===2&&ou(e)?mce[t-1]+1:mce[t-1];if(n>b)throw new pe("Month and Day represents invalid date")}}var Fm=X3e;function K3e(e,t){this.julianDate=e,this.offset=t}var yr=K3e;var pce={SECONDS_PER_MILLISECOND:.001,SECONDS_PER_MINUTE:60,MINUTES_PER_HOUR:60,HOURS_PER_DAY:24,SECONDS_PER_HOUR:3600,MINUTES_PER_DAY:1440,SECONDS_PER_DAY:86400,DAYS_PER_JULIAN_CENTURY:36525,PICOSECOND:1e-9,MODIFIED_JULIAN_DATE_DIFFERENCE:24000005e-1};Object.freeze(pce);var Un=pce;var gce={UTC:0,TAI:1};Object.freeze(gce);var ai=gce;var _ce=new Fm,xN=[31,28,31,30,31,30,31,31,30,31,30,31],TN=29;function Iq(e,t){return di.compare(e.julianDate,t.julianDate)}var TE=new yr;function EN(e){TE.julianDate=e;let t=di.leapSeconds,n=Pr(t,TE,Iq);n<0&&(n=~n),n>=t.length&&(n=t.length-1);let i=t[n].offset;n>0&&di.secondsDifference(t[n].julianDate,e)>i&&(n--,i=t[n].offset),di.addSeconds(e,i,e)}function yce(e,t){TE.julianDate=e;let n=di.leapSeconds,i=Pr(n,TE,Iq);if(i<0&&(i=~i),i===0)return di.addSeconds(e,-n[0].offset,t);if(i>=n.length)return di.addSeconds(e,-n[i-1].offset,t);let r=di.secondsDifference(n[i].julianDate,e);if(r===0)return di.addSeconds(e,-n[i].offset,t);if(!(r<=1))return di.addSeconds(e,-n[i-1].offset,t)}function C_(e,t,n){let i=t/Un.SECONDS_PER_DAY|0;return e+=i,t-=Un.SECONDS_PER_DAY*i,t<0&&(e--,t+=Un.SECONDS_PER_DAY),n.dayNumber=e,n.secondsOfDay=t,n}function wq(e,t,n,i,r,o,s){let a=(t-14)/12|0,c=e+4800+a,u=(1461*c/4|0)+(367*(t-2-12*a)/12|0)-(3*((c+100)/100|0)/4|0)+n-32075;i=i-12,i<0&&(i+=24);let f=o+(i*Un.SECONDS_PER_HOUR+r*Un.SECONDS_PER_MINUTE+s*Un.SECONDS_PER_MILLISECOND);return f>=43200&&(u-=1),[u,f]}var $3e=/^(\d{4})$/,J3e=/^(\d{4})-(\d{2})$/,Z3e=/^(\d{4})-?(\d{3})$/,Q3e=/^(\d{4})-?W(\d{2})-?(\d{1})?$/,eUe=/^(\d{4})-?(\d{2})-?(\d{2})$/,Pq=/([Z+\-])?(\d{2})?:?(\d{2})?$/,tUe=/^(\d{2})(\.\d+)?/.source+Pq.source,nUe=/^(\d{2}):?(\d{2})(\.\d+)?/.source+Pq.source,iUe=/^(\d{2}):?(\d{2}):?(\d{2})(\.\d+)?/.source+Pq.source;var v_={year:0,month:0,day:0,hour:0,minute:0,second:0,millisecond:0},rUe=[1,10,100,1e3,1e4,1e5,1e6,1e7,1e8,1e9,1e10,1e11,1e12,1e13,1e14,1e15];function R0(e,t){let n=e.charCodeAt(t)-48,i=e.charCodeAt(t+1)-48;return n<0||n>9||i<0||i>9?-1:n*10+i}var Ace=NaN,bce=0;function xce(e,t,n,i,r,o,s){v_.year=e,v_.month=t,v_.day=n,v_.hour=i,v_.minute=r,v_.second=o,v_.millisecond=s}function oUe(e){let t=e.length;if(t===4){let m=R0(e,0),y=R0(e,2);return m<0||y<0?!1:(xce(m*100+y,1,1,0,0,0,0),!0)}let n=e.charCodeAt(t-1)===90,i=n?t-1:t;if(i<19||e.charCodeAt(4)!==45||e.charCodeAt(7)!==45||e.charCodeAt(10)!==84||e.charCodeAt(13)!==58||e.charCodeAt(16)!==58)return!1;let r=R0(e,0),o=R0(e,2),s=R0(e,5),a=R0(e,8),c=R0(e,11),u=R0(e,14),f=R0(e,17);if(r<0||o<0||s<1||s>12||a<1||a>31||c<0||c>23||u<0||u>59||f<0||f>60)return!1;let d=0;if(i>19){let m=e.charCodeAt(19),y=i-20;if(m!==46&&m!==44||y<1||y>15)return!1;let A=0;for(let b=20;b<i;b++){let x=e.charCodeAt(b)-48;if(x<0||x>9)return!1;A=A*10+x}d=A/rUe[y]*1e3}let p=r*100+o,g=ou(p);if((s!==2||!g?xN[s-1]:TN)<a)return!1;if(!n){let m=Date.UTC(p,s-1,a,c,u);m!==Ace&&(Ace=m,bce=new Date(m).getTimezoneOffset()),u=u+bce}return xce(p,s,a,c,u,f,d),!0}function Tce(e,t,n,i,r,o,s,a,c){let u,f=o===60;for(f&&o--;r>=60;)r-=60,i++;for(;i>=24;)i-=24,n++;for(u=a&&t===2?TN:xN[t-1];n>u;)n-=u,t++,t>12&&(t-=12,e++),u=a&&t===2?TN:xN[t-1];for(;r<0;)r+=60,i--;for(;i<0;)i+=24,n--;for(;n<1;)t--,t<1&&(t+=12,e--),u=a&&t===2?TN:xN[t-1],n+=u;let d=wq(e,t,n,i,r,o,s);return l(c)?(C_(d[0],d[1],c),EN(c)):c=new di(d[0],d[1],ai.UTC),f&&di.addSeconds(c,1,c),c}var di=class e{constructor(t,n,i){this.dayNumber=void 0,this.secondsOfDay=void 0,t=t??0,n=n??0,i=i??ai.UTC;let r=t|0;n=n+(t-r)*Un.SECONDS_PER_DAY,C_(r,n,this),i===ai.UTC&&EN(this)}static fromGregorianDate(t,n){let i=wq(t.year,t.month,t.day,t.hour,t.minute,t.second,t.millisecond);return l(n)?(C_(i[0],i[1],n),EN(n),n):new e(i[0],i[1],ai.UTC)}static fromDate(t,n){let i=wq(t.getUTCFullYear(),t.getUTCMonth()+1,t.getUTCDate(),t.getUTCHours(),t.getUTCMinutes(),t.getUTCSeconds(),t.getUTCMilliseconds());return l(n)?(C_(i[0],i[1],n),EN(n),n):new e(i[0],i[1],ai.UTC)}static fromIso8601(t,n){if(oUe(t)){let A=v_;return Tce(A.year,A.month,A.day,A.hour,A.minute,A.second,A.millisecond,ou(A.year),n)}t=t.replace(",",".");let i=t.split("T"),r,o=1,s=1,a=0,c=0,u=0,f=0,d=i[0],p=i[1],g,m;if(i=d.match(eUe),i!==null)r=+i[1],o=+i[2],s=+i[3];else if(i=d.match(J3e),i!==null)r=+i[1],o=+i[2];else if(i=d.match($3e),i!==null)r=+i[1];else{let A;if(i=d.match(Z3e),i!==null)r=+i[1],A=+i[2],m=ou(r);else if(i=d.match(Q3e),i!==null){r=+i[1];let b=+i[2],x=+i[3]||0,T=new Date(Date.UTC(r,0,4));A=b*7+x-T.getUTCDay()-3}g=new Date(Date.UTC(r,0,1)),g.setUTCDate(A),o=g.getUTCMonth()+1,s=g.getUTCDate()}m=ou(r);let y;if(l(p)){i=p.match(iUe),i!==null?(a=+i[1],c=+i[2],u=+i[3],f=+(i[4]||0)*1e3,y=5):(i=p.match(nUe),i!==null?(a=+i[1],c=+i[2],u=+(i[3]||0)*60,y=4):(i=p.match(tUe),i!==null&&(a=+i[1],c=+(i[2]||0)*60,y=3)));let A=i[y],b=+i[y+1],x=+(i[y+2]||0);switch(A){case"+":a=a-b,c=c-x;break;case"-":a=a+b,c=c+x;break;case"Z":break;default:c=c+new Date(Date.UTC(r,o-1,s,a,c)).getTimezoneOffset();break}}return Tce(r,o,s,a,c,u,f,m,n)}static now(t){return e.fromDate(new Date,t)}static toGregorianDate(t,n){let i=!1,r=yce(t,bN);l(r)||(e.addSeconds(t,-1,bN),r=yce(bN,bN),i=!0);let o=r.dayNumber,s=r.secondsOfDay;s>=43200&&(o+=1);let a=o+68569|0,c=4*a/146097|0;a=a-((146097*c+3)/4|0)|0;let u=4e3*(a+1)/1461001|0;a=a-(1461*u/4|0)+31|0;let f=80*a/2447|0,d=a-(2447*f/80|0)|0;a=f/11|0;let p=f+2-12*a|0,g=100*(c-49)+u+a|0,m=s/Un.SECONDS_PER_HOUR|0,y=s-m*Un.SECONDS_PER_HOUR,A=y/Un.SECONDS_PER_MINUTE|0;y=y-A*Un.SECONDS_PER_MINUTE;let b=y|0,x=(y-b)/Un.SECONDS_PER_MILLISECOND;return m+=12,m>23&&(m-=24),i&&(b+=1),l(n)?(n.year=g,n.month=p,n.day=d,n.hour=m,n.minute=A,n.second=b,n.millisecond=x,n.isLeapSecond=i,n):new Fm(g,p,d,m,A,b,x,i)}static toDate(t){let n=e.toGregorianDate(t,_ce),i=n.second;return n.isLeapSecond&&(i-=1),new Date(Date.UTC(n.year,n.month-1,n.day,n.hour,n.minute,i,n.millisecond))}static toIso8601(t,n){let i=e.toGregorianDate(t,_ce),r=i.year,o=i.month,s=i.day,a=i.hour,c=i.minute,u=i.second,f=i.millisecond;r===1e4&&o===1&&s===1&&a===0&&c===0&&u===0&&f===0&&(r=9999,o=12,s=31,a=24);let d;if(!l(n)&&f!==0){let p=f*.01;return d=p<1e-6?p.toFixed(20).replace(".","").replace(/0+$/,""):p.toString().replace(".",""),`${r.toString().padStart(4,"0")}-${o.toString().padStart(2,"0")}-${s.toString().padStart(2,"0")}T${a.toString().padStart(2,"0")}:${c.toString().padStart(2,"0")}:${u.toString().padStart(2,"0")}.${d}Z`}return!l(n)||n===0?`${r.toString().padStart(4,"0")}-${o.toString().padStart(2,"0")}-${s.toString().padStart(2,"0")}T${a.toString().padStart(2,"0")}:${c.toString().padStart(2,"0")}:${u.toString().padStart(2,"0")}Z`:(d=(f*.01).toFixed(n).replace(".","").slice(0,n),`${r.toString().padStart(4,"0")}-${o.toString().padStart(2,"0")}-${s.toString().padStart(2,"0")}T${a.toString().padStart(2,"0")}:${c.toString().padStart(2,"0")}:${u.toString().padStart(2,"0")}.${d}Z`)}static clone(t,n){if(l(t))return l(n)?(n.dayNumber=t.dayNumber,n.secondsOfDay=t.secondsOfDay,n):new e(t.dayNumber,t.secondsOfDay,ai.TAI)}static compare(t,n){let i=t.dayNumber-n.dayNumber;return i!==0?i:t.secondsOfDay-n.secondsOfDay}static equals(t,n){return t===n||l(t)&&l(n)&&t.dayNumber===n.dayNumber&&t.secondsOfDay===n.secondsOfDay}static equalsEpsilon(t,n,i){return i=i??0,t===n||l(t)&&l(n)&&Math.abs(e.secondsDifference(t,n))<=i}static totalDays(t){return t.dayNumber+t.secondsOfDay/Un.SECONDS_PER_DAY}static secondsDifference(t,n){return(t.dayNumber-n.dayNumber)*Un.SECONDS_PER_DAY+(t.secondsOfDay-n.secondsOfDay)}static daysDifference(t,n){let i=t.dayNumber-n.dayNumber,r=(t.secondsOfDay-n.secondsOfDay)/Un.SECONDS_PER_DAY;return i+r}static computeTaiMinusUtc(t){TE.julianDate=t;let n=e.leapSeconds,i=Pr(n,TE,Iq);return i<0&&(i=~i,--i,i<0&&(i=0)),n[i].offset}static addSeconds(t,n,i){return C_(t.dayNumber,t.secondsOfDay+n,i)}static addMinutes(t,n,i){let r=t.secondsOfDay+n*Un.SECONDS_PER_MINUTE;return C_(t.dayNumber,r,i)}static addHours(t,n,i){let r=t.secondsOfDay+n*Un.SECONDS_PER_HOUR;return C_(t.dayNumber,r,i)}static addDays(t,n,i){let r=t.dayNumber+n;return C_(r,t.secondsOfDay,i)}static lessThan(t,n){return e.compare(t,n)<0}static lessThanOrEquals(t,n){return e.compare(t,n)<=0}static greaterThan(t,n){return e.compare(t,n)>0}static greaterThanOrEquals(t,n){return e.compare(t,n)>=0}clone(t){return e.clone(this,t)}equals(t){return e.equals(this,t)}equalsEpsilon(t,n){return e.equalsEpsilon(this,t,n)}toString(){return e.toIso8601(this)}},bN=new di(0,0,ai.TAI);di.leapSeconds=[new yr(new di(2441317,43210,ai.TAI),10),new yr(new di(2441499,43211,ai.TAI),11),new yr(new di(2441683,43212,ai.TAI),12),new yr(new di(2442048,43213,ai.TAI),13),new yr(new di(2442413,43214,ai.TAI),14),new yr(new di(2442778,43215,ai.TAI),15),new yr(new di(2443144,43216,ai.TAI),16),new yr(new di(2443509,43217,ai.TAI),17),new yr(new di(2443874,43218,ai.TAI),18),new yr(new di(2444239,43219,ai.TAI),19),new yr(new di(2444786,43220,ai.TAI),20),new yr(new di(2445151,43221,ai.TAI),21),new yr(new di(2445516,43222,ai.TAI),22),new yr(new di(2446247,43223,ai.TAI),23),new yr(new di(2447161,43224,ai.TAI),24),new yr(new di(2447892,43225,ai.TAI),25),new yr(new di(2448257,43226,ai.TAI),26),new yr(new di(2448804,43227,ai.TAI),27),new yr(new di(2449169,43228,ai.TAI),28),new yr(new di(2449534,43229,ai.TAI),29),new yr(new di(2450083,43230,ai.TAI),30),new yr(new di(2450630,43231,ai.TAI),31),new yr(new di(2451179,43232,ai.TAI),32),new yr(new di(2453736,43233,ai.TAI),33),new yr(new di(2454832,43234,ai.TAI),34),new yr(new di(2456109,43235,ai.TAI),35),new yr(new di(2457204,43236,ai.TAI),36),new yr(new di(2457754,43237,ai.TAI),37)];var K=di;var Hce=js(ef(),1);function sUe(e){return(e.length===0||e[e.length-1]!=="/")&&(e=`${e}/`),e}var wN=sUe;function Pce(e,t){if(e===null||typeof e!="object")return e;t=t??!1;let n=new e.constructor;for(let i in e)if(e.hasOwnProperty(i)){let r=e[i];t&&(r=Pce(r,t)),n[i]=r}return n}var Ze=Pce;function Dce(e,t,n){n=n??!1;let i={},r=l(e),o=l(t),s,a,c;if(r)for(s in e)e.hasOwnProperty(s)&&(a=e[s],o&&n&&typeof a=="object"&&t.hasOwnProperty(s)?(c=t[s],typeof c=="object"?i[s]=Dce(a,c,n):i[s]=a):i[s]=a);if(o)for(s in t)t.hasOwnProperty(s)&&!i.hasOwnProperty(s)&&(c=t[s],i[s]=c);return i}var Mt=Dce;function aUe(){let e,t,n=new Promise(function(i,r){e=i,t=r});return{resolve:e,reject:t,promise:n}}var tf=aUe;var Rce=js(ef(),1);function Dq(e,t){let n;return typeof document<"u"&&(n=document),Dq._implementation(e,t,n)}Dq._implementation=function(e,t,n){if(!l(t)){if(typeof n>"u")return e;t=n.baseURI??n.location.href}let i=new Rce.default(e);return i.scheme()!==""?i.toString():i.absoluteTo(t).toString()};var fh=Dq;var Oce=js(ef(),1);function cUe(e,t){let n="",i=e.lastIndexOf("/");return i!==-1&&(n=e.substring(0,i+1)),t&&(e=new Oce.default(e),e.query().length!==0&&(n+=`?${e.query()}`),e.fragment().length!==0&&(n+=`#${e.fragment()}`)),n}var IN=cUe;var Mce=js(ef(),1);function lUe(e){let t=new Mce.default(e);t.normalize();let n=t.path(),i=n.lastIndexOf("/");return i!==-1&&(n=n.substr(i+1)),i=n.lastIndexOf("."),i===-1?n="":n=n.substr(i+1),n}var S_=lUe;var Nce={};function uUe(e,t,n){l(t)||(t=e.width),l(n)||(n=e.height);let i=Nce[t];l(i)||(i={},Nce[t]=i);let r=i[n];if(!l(r)){let o=document.createElement("canvas");o.width=t,o.height=n,r=o.getContext("2d",{willReadFrequently:!0}),r.globalCompositeOperation="copy",i[n]=r}return r.drawImage(e,0,0,t,n),r.getImageData(0,0,t,n).data}var Bm=uUe;var fUe=/^blob:/i;function dUe(e){return fUe.test(e)}var vE=dUe;var km;function hUe(e){l(km)||(km=document.createElement("a")),km.href=window.location.href;let t=km.host,n=km.protocol;return km.href=e,km.href=km.href,n!==km.protocol||t!==km.host}var _b=hUe;var mUe=/^data:/i;function pUe(e){return mUe.test(e)}var Um=pUe;function gUe(e){let t=document.createElement("script");return t.async=!0,t.src=e,new Promise((n,i)=>{window.crossOriginIsolated&&t.setAttribute("crossorigin","anonymous");let r=document.getElementsByTagName("head")[0];t.onload=function(){t.onload=void 0,r.removeChild(t),n()},t.onerror=function(o){i(o)},r.appendChild(t)})}var SE=gUe;function _Ue(e){let t="";for(let n in e)if(e.hasOwnProperty(n)){let i=e[n],r=`${encodeURIComponent(n)}=`;if(Array.isArray(i))for(let o=0,s=i.length;o<s;++o)t+=`${r+encodeURIComponent(i[o])}&`;else t+=`${r+encodeURIComponent(i)}&`}return t=t.slice(0,-1),t}var wE=_Ue;function yUe(e){let t={};if(e==="")return t;let n=e.replace(/\+/g,"%20").split(/[&;]/);for(let i=0,r=n.length;i<r;++i){let o=n[i].split("="),s=decodeURIComponent(o[0]),a=o[1];l(a)?a=decodeURIComponent(a):a="";let c=t[s];typeof c=="string"?t[s]=[c,a]:Array.isArray(c)?c.push(a):t[s]=a}return t}var Zf=yUe;var Lce={UNISSUED:0,ISSUED:1,ACTIVE:2,RECEIVED:3,CANCELLED:4,FAILED:5};Object.freeze(Lce);var wi=Lce;var Fce={TERRAIN:0,IMAGERY:1,TILES3D:2,OTHER:3};Object.freeze(Fce);var oa=Fce;function PN(e){e=e??H.EMPTY_OBJECT;let t=e.throttleByServer??!1,n=e.throttle??!1;this.url=e.url,this.requestFunction=e.requestFunction,this.cancelFunction=e.cancelFunction,this.priorityFunction=e.priorityFunction,this.priority=e.priority??0,this.throttle=n,this.throttleByServer=t,this.type=e.type??oa.OTHER,this.serverKey=e.serverKey,this.state=wi.UNISSUED,this.deferred=void 0,this.cancelled=!1}PN.prototype.cancel=function(){this.cancelled=!0};PN.prototype.clone=function(e){return l(e)?(e.url=this.url,e.requestFunction=this.requestFunction,e.cancelFunction=this.cancelFunction,e.priorityFunction=this.priorityFunction,e.priority=this.priority,e.throttle=this.throttle,e.throttleByServer=this.throttleByServer,e.type=this.type,e.serverKey=this.serverKey,e.state=wi.UNISSUED,e.deferred=void 0,e.cancelled=!1,e):new PN(this)};var Oo=PN;function AUe(e){let t={};if(!e)return t;let n=e.split(`\r -`);for(let i=0;i<n.length;++i){let r=n[i],o=r.indexOf(": ");if(o>0){let s=r.substring(0,o),a=r.substring(o+2);t[s]=a}}return t}var DN=AUe;function Bce(e,t,n){this.statusCode=e,this.response=t,this.responseHeaders=n,typeof this.responseHeaders=="string"&&(this.responseHeaders=DN(this.responseHeaders))}Bce.prototype.toString=function(){let e="Request has failed.";return l(this.statusCode)&&(e+=` Status Code: ${this.statusCode}`),e};var O0=Bce;var NN=js(ef(),1);function UI(){this._listeners=new Map,this._toRemove=new Map,this._toAdd=new Map,this._invokingListeners=!1,this._listenerCount=0}Object.defineProperties(UI.prototype,{numberOfListeners:{get:function(){return this._listenerCount}}});UI.prototype.addEventListener=function(e,t){let n=this,i=n._invokingListeners?n._toAdd:n._listeners;return Oq(this,i,e,t)&&n._listenerCount++,function(){n.removeEventListener(e,t)}};function Oq(e,t,n,i){t.has(n)||t.set(n,new Set);let r=t.get(n);return r.has(i)?!1:(r.add(i),!0)}UI.prototype.removeEventListener=function(e,t){let n=Rq(this,this._listeners,e,t),i=Rq(this,this._toAdd,e,t),r=n||i;return r&&this._listenerCount--,r};function Rq(e,t,n,i){let r=t.get(n);if(!r||!r.has(i))return!1;if(e._invokingListeners){if(!Oq(e,e._toRemove,n,i))return!1}else r.delete(i),r.size===0&&t.delete(n);return!0}var ON,RN;function bUe(e){ON.apply(e,RN)}function xUe(e,t){l(t)&&(ON=t,e.forEach(bUe))}UI.prototype.raiseEvent=function(){this._invokingListeners=!0;let e=ON,t=RN;RN=arguments;try{this._listeners.forEach(xUe)}finally{ON=e,RN=t}if(this._invokingListeners=!1,this._toAdd.size>0){for(let[n,i]of this._toAdd.entries())for(let r of i)Oq(this,this._listeners,n,r);this._toAdd.clear()}if(this._toRemove.size>0){for(let[n,i]of this._toRemove.entries())for(let r of i)Rq(this,this._listeners,n,r);this._toRemove.clear()}};var be=UI;function yb(e){this._comparator=e.comparator,this._array=[],this._length=0,this._maximumLength=void 0}Object.defineProperties(yb.prototype,{length:{get:function(){return this._length}},internalArray:{get:function(){return this._array}},maximumLength:{get:function(){return this._maximumLength},set:function(e){let t=this._length;if(e<t){let n=this._array;for(let i=e;i<t;++i)n[i]=void 0;this._length=e,n.length=e}this._maximumLength=e}},comparator:{get:function(){return this._comparator}}});function Mq(e,t,n){let i=e[t];e[t]=e[n],e[n]=i}yb.prototype.reserve=function(e){e=e??this._length,this._array.length=e};yb.prototype.heapify=function(e){e=e??0;let t=this._length,n=this._comparator,i=this._array,r,o=!0;for(;o;){let s=2*(e+1),a=s-1;a<t&&n(i[a],i[e])<0?r=a:r=e,s<t&&n(i[s],i[r])<0&&(r=s),r!==e?(Mq(i,r,e),e=r):o=!1}};yb.prototype.resort=function(){let e=this._length;for(let t=Math.ceil(e/2);t>=0;--t)this.heapify(t)};yb.prototype.insert=function(e){let t=this._array,n=this._comparator,i=this._maximumLength,r=this._length++;for(r<t.length?t[r]=e:t.push(e);r!==0;){let s=Math.floor((r-1)/2);if(n(t[r],t[s])<0)Mq(t,r,s),r=s;else break}let o;return l(i)&&this._length>i&&(o=t[i],this._length=i),o};yb.prototype.pop=function(e){if(e=e??0,this._length===0)return;let t=this._array,n=t[e];return Mq(t,e,--this._length),this.heapify(e),t[this._length]=void 0,n};var MN=yb;function TUe(e,t){return e.priority-t.priority}var Tr={numberOfAttemptedRequests:0,numberOfActiveRequests:0,numberOfCancelledRequests:0,numberOfCancelledActiveRequests:0,numberOfFailedRequests:0,numberOfActiveRequestsEver:0,lastNumberOfActiveRequests:0},IE=20,Fc=new MN({comparator:TUe});Fc.maximumLength=IE;Fc.reserve(IE);var zm=[],M0={},EUe=typeof document<"u"?new NN.default(document.location.href):new NN.default,LN=new be;function xo(){}xo.maximumRequests=50;xo.maximumRequestsPerServer=18;xo.requestsByServer={};xo.throttleRequests=!0;xo.debugShowStatistics=!1;xo.requestCompletedEvent=LN;Object.defineProperties(xo,{statistics:{get:function(){return Tr}},priorityHeapLength:{get:function(){return IE},set:function(e){if(e<IE)for(;Fc.length>e;){let t=Fc.pop();Ab(t)}IE=e,Fc.maximumLength=e,Fc.reserve(e)}}});function kce(e){l(e.priorityFunction)&&(e.priority=e.priorityFunction())}xo.serverHasOpenSlots=function(e,t){t=t??1;let n=xo.requestsByServer[e]??xo.maximumRequestsPerServer;return M0[e]+t<=n};xo.heapHasOpenSlots=function(e){return Fc.length+e<=IE};function Uce(e){return e.state===wi.UNISSUED&&(e.state=wi.ISSUED,e.deferred=tf()),e.deferred.promise}function CUe(e){return function(t){if(e.state===wi.CANCELLED)return;let n=e.deferred;--Tr.numberOfActiveRequests,--M0[e.serverKey],LN.raiseEvent(),e.state=wi.RECEIVED,e.deferred=void 0,n.resolve(t)}}function vUe(e){return function(t){e.state!==wi.CANCELLED&&(++Tr.numberOfFailedRequests,--Tr.numberOfActiveRequests,--M0[e.serverKey],LN.raiseEvent(t),e.state=wi.FAILED,e.deferred.reject(t))}}function zce(e){let t=Uce(e);return e.state=wi.ACTIVE,zm.push(e),++Tr.numberOfActiveRequests,++Tr.numberOfActiveRequestsEver,++M0[e.serverKey],e.requestFunction().then(CUe(e)).catch(vUe(e)),t}function Ab(e){let t=e.state===wi.ACTIVE;if(e.state=wi.CANCELLED,++Tr.numberOfCancelledRequests,l(e.deferred)){let n=e.deferred;n.promise.catch(()=>{}),e.deferred=void 0,n.reject(new oe(`Request cancelled: "${e.url}"`))}t&&(--Tr.numberOfActiveRequests,--M0[e.serverKey],++Tr.numberOfCancelledActiveRequests),l(e.cancelFunction)&&e.cancelFunction()}xo.update=function(){let e,t,n=0,i=zm.length;for(e=0;e<i;++e){if(t=zm[e],t.cancelled&&Ab(t),t.state!==wi.ACTIVE){++n;continue}n>0&&(zm[e-n]=t)}zm.length-=n;let r=Fc.internalArray,o=Fc.length;for(e=0;e<o;++e)kce(r[e]);Fc.resort();let s=Math.max(xo.maximumRequests-zm.length,0),a=0;for(;a<s&&Fc.length>0;){if(t=Fc.pop(),t.cancelled){Ab(t);continue}if(t.throttleByServer&&!xo.serverHasOpenSlots(t.serverKey)){Ab(t);continue}zce(t),++a}SUe()};xo.getServerKey=function(e){let t=new NN.default(e);t.scheme()===""&&(t=t.absoluteTo(EUe),t.normalize());let n=t.authority();/:/.test(n)||(n=`${n}:${t.scheme()==="https"?"443":"80"}`);let i=M0[n];return l(i)||(M0[n]=0),n};xo.request=function(e){if(Um(e.url)||vE(e.url))return LN.raiseEvent(),e.state=wi.RECEIVED,e.requestFunction();if(++Tr.numberOfAttemptedRequests,l(e.serverKey)||(e.serverKey=xo.getServerKey(e.url)),xo.throttleRequests&&e.throttleByServer&&!xo.serverHasOpenSlots(e.serverKey))return;if(!xo.throttleRequests||!e.throttle)return zce(e);if(zm.length>=xo.maximumRequests)return;kce(e);let t=Fc.insert(e);if(l(t)){if(t===e)return;Ab(t)}return Uce(e)};function SUe(){xo.debugShowStatistics&&(Tr.numberOfActiveRequests===0&&Tr.lastNumberOfActiveRequests>0&&(Tr.numberOfAttemptedRequests>0&&(console.log(`Number of attempted requests: ${Tr.numberOfAttemptedRequests}`),Tr.numberOfAttemptedRequests=0),Tr.numberOfCancelledRequests>0&&(console.log(`Number of cancelled requests: ${Tr.numberOfCancelledRequests}`),Tr.numberOfCancelledRequests=0),Tr.numberOfCancelledActiveRequests>0&&(console.log(`Number of cancelled active requests: ${Tr.numberOfCancelledActiveRequests}`),Tr.numberOfCancelledActiveRequests=0),Tr.numberOfFailedRequests>0&&(console.log(`Number of failed requests: ${Tr.numberOfFailedRequests}`),Tr.numberOfFailedRequests=0)),Tr.lastNumberOfActiveRequests=Tr.numberOfActiveRequests)}xo.clearForSpecs=function(){for(;Fc.length>0;){let t=Fc.pop();Ab(t)}let e=zm.length;for(let t=0;t<e;++t)Ab(zm[t]);zm.length=0,M0={},Tr.numberOfAttemptedRequests=0,Tr.numberOfActiveRequests=0,Tr.numberOfCancelledRequests=0,Tr.numberOfCancelledActiveRequests=0,Tr.numberOfFailedRequests=0,Tr.numberOfActiveRequestsEver=0,Tr.lastNumberOfActiveRequests=0};xo.numberOfActiveRequestsByServer=function(e){return M0[e]};xo.requestHeap=Fc;var El=xo;var Vce=js(ef(),1);var zI={},PE={};zI.add=function(e,t){let n=`${e.toLowerCase()}:${t}`;l(PE[n])||(PE[n]=!0)};zI.remove=function(e,t){let n=`${e.toLowerCase()}:${t}`;l(PE[n])&&delete PE[n]};function wUe(e){let t=new Vce.default(e);t.normalize();let n=t.authority();if(n.length!==0){if(t.authority(n),n.indexOf("@")!==-1&&(n=n.split("@")[1]),n.indexOf(":")===-1){let i=t.scheme();if(i.length===0&&(i=window.location.protocol,i=i.substring(0,i.length-1)),i==="http")n+=":80";else if(i==="https")n+=":443";else return}return n}}zI.contains=function(e){let t=wUe(e);return!!(l(t)&&l(PE[t]))};zI.clear=function(){PE={}};var VI=zI;var Gce=(function(){try{let e=new XMLHttpRequest;return e.open("GET","#",!0),e.responseType="blob",e.responseType==="blob"}catch{return!1}})();function kt(e){e=e??H.EMPTY_OBJECT,typeof e=="string"&&(e={url:e}),this._url=void 0,this._templateValues=Vm(e.templateValues,{}),this._queryParameters=Vm(e.queryParameters,{}),this.headers=Vm(e.headers,{}),this.request=e.request??new Oo,this.proxy=e.proxy,this.retryCallback=e.retryCallback,this.retryAttempts=e.retryAttempts??0,this._retryCount=0,e.parseUrl??!0?this.parseUrl(e.url,!0,!0):this._url=e.url,this._credits=e.credits}function Vm(e,t){return l(e)?Ze(e):t}kt.createIfNeeded=function(e){return e instanceof kt?e.getDerivedResource({request:e.request}):typeof e!="string"?e:new kt({url:e})};var DE;kt.supportsImageBitmapOptions=function(){return l(DE)?DE:typeof createImageBitmap!="function"?(DE=Promise.resolve(!1),DE):(DE=kt.fetchBlob({url:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAIAAACQd1PeAAAABGdBTUEAAE4g3rEiDgAAACBjSFJNAAB6JgAAgIQAAPoAAACA6AAAdTAAAOpgAAA6mAAAF3CculE8AAAADElEQVQI12Ng6GAAAAEUAIngE3ZiAAAAAElFTkSuQmCC"}).then(function(t){let n={imageOrientation:"flipY",premultiplyAlpha:"none",colorSpaceConversion:"none"};return Promise.all([createImageBitmap(t,n),createImageBitmap(t)])}).then(function(t){let n=Bm(t[0]),i=Bm(t[1]);return n[1]!==i[1]}).catch(function(){return!1}),DE)};Object.defineProperties(kt,{isBlobSupported:{get:function(){return Gce}}});Object.defineProperties(kt.prototype,{queryParameters:{get:function(){return this._queryParameters}},templateValues:{get:function(){return this._templateValues}},url:{get:function(){return this.getUrlComponent(!0,!0)},set:function(e){this.parseUrl(e,!1,!1)}},extension:{get:function(){return S_(this._url)}},isDataUri:{get:function(){return Um(this._url)}},isBlobUri:{get:function(){return vE(this._url)}},isCrossOriginUrl:{get:function(){return _b(this._url)}},hasHeaders:{get:function(){return Object.keys(this.headers).length>0}},credits:{get:function(){return this._credits}}});kt.prototype.toString=function(){return this.getUrlComponent(!0,!0)};kt.prototype.parseUrl=function(e,t,n,i){let r=new Hce.default(e),o=IUe(r.query());this._queryParameters=t?BN(o,this.queryParameters,n):o,r.search(""),r.fragment(""),l(i)&&r.scheme()===""&&(r=r.absoluteTo(fh(i))),this._url=r.toString()};function IUe(e){return e.length===0?{}:e.indexOf("=")===-1?{[e]:void 0}:Zf(e)}function BN(e,t,n){if(!n)return Mt(e,t);let i=Ze(e,!0);for(let r in t)if(t.hasOwnProperty(r)){let o=i[r],s=t[r];l(o)?(Array.isArray(o)||(o=i[r]=[o]),i[r]=o.concat(s)):i[r]=Array.isArray(s)?s.slice():s}return i}kt.prototype.getUrlComponent=function(e,t){if(this.isDataUri)return this._url;let n=this._url;e&&(n=`${n}${PUe(this.queryParameters)}`),n=n.replace(/%7B/g,"{").replace(/%7D/g,"}");let i=this._templateValues;return Object.keys(i).length>0&&(n=n.replace(/{(.*?)}/g,function(r,o){let s=i[o];return l(s)?encodeURIComponent(s):r})),t&&l(this.proxy)&&(n=this.proxy.getURL(n)),n};function PUe(e){let t=Object.keys(e);return t.length===0?"":t.length===1&&!l(e[t[0]])?`?${t[0]}`:`?${wE(e)}`}kt.prototype.setQueryParameters=function(e,t){t?this._queryParameters=BN(this._queryParameters,e,!1):this._queryParameters=BN(e,this._queryParameters,!1)};kt.prototype.appendQueryParameters=function(e){this._queryParameters=BN(e,this._queryParameters,!0)};kt.prototype.setTemplateValues=function(e,t){t?this._templateValues=Mt(this._templateValues,e):this._templateValues=Mt(e,this._templateValues)};kt.prototype.getDerivedResource=function(e){let t=this.clone();if(t._retryCount=0,l(e.url)){let n=e.preserveQueryParameters??!1;t.parseUrl(e.url,!0,n,this._url)}return l(e.queryParameters)&&(t._queryParameters=Mt(e.queryParameters,t.queryParameters)),l(e.templateValues)&&(t._templateValues=Mt(e.templateValues,t.templateValues)),l(e.headers)&&(t.headers=Mt(e.headers,t.headers)),l(e.proxy)&&(t.proxy=e.proxy),l(e.request)&&(t.request=e.request),l(e.retryCallback)&&(t.retryCallback=e.retryCallback),l(e.retryAttempts)&&(t.retryAttempts=e.retryAttempts),t};kt.prototype.retryOnError=function(e){let t=this.retryCallback;if(typeof t!="function"||this._retryCount>=this.retryAttempts)return Promise.resolve(!1);let n=this;return Promise.resolve(t(this,e)).then(function(i){return++n._retryCount,i})};kt.prototype.clone=function(e){return l(e)?(e._url=this._url,e._queryParameters=Ze(this._queryParameters),e._templateValues=Ze(this._templateValues),e.headers=Ze(this.headers),e.proxy=this.proxy,e.retryCallback=this.retryCallback,e.retryAttempts=this.retryAttempts,e._retryCount=0,e.request=this.request.clone(),e):new kt({url:this._url,queryParameters:this.queryParameters,templateValues:this.templateValues,headers:this.headers,proxy:this.proxy,retryCallback:this.retryCallback,retryAttempts:this.retryAttempts,request:this.request.clone(),parseUrl:!1,credits:l(this.credits)?this.credits.slice():void 0})};kt.prototype.getBaseUri=function(e){return IN(this.getUrlComponent(e),e)};kt.prototype.appendForwardSlash=function(){this._url=wN(this._url)};kt.prototype.fetchArrayBuffer=function(){return this.fetch({responseType:"arraybuffer"})};kt.fetchArrayBuffer=function(e){return new kt(e).fetchArrayBuffer()};kt.prototype.fetchBlob=function(){return this.fetch({responseType:"blob"})};kt.fetchBlob=function(e){return new kt(e).fetchBlob()};kt.prototype.fetchImage=function(e){e=e??H.EMPTY_OBJECT;let t=e.preferImageBitmap??!1,n=e.preferBlob??!1,i=e.flipY??!1,r=e.skipColorSpaceConversion??!1;if(Nq(this.request),!Gce||this.isDataUri||this.isBlobUri||!this.hasHeaders&&!n)return this._fetchImage({resource:this,flipY:i,skipColorSpaceConversion:r,preferImageBitmap:t});let o=this.fetchBlob();if(!l(o))return;let s,a,c,u;return kt.supportsImageBitmapOptions().then(function(f){return s=f,a=s&&t,o}).then(function(f){if(!l(f))return;if(u=f,a)return kt.createImageBitmapFromBlob(f,{flipY:i,premultiplyAlpha:!1,skipColorSpaceConversion:r});let d=window.URL.createObjectURL(f);return c=new kt({url:d}),c._fetchImage({flipY:i,skipColorSpaceConversion:r,preferImageBitmap:!1})}).then(function(f){if(l(f))return f.blob=u,a||window.URL.revokeObjectURL(c.url),f}).catch(function(f){return l(c)&&window.URL.revokeObjectURL(c.url),f.blob=u,Promise.reject(f)})};kt.prototype._fetchImage=function(e){let t=this,n=e.flipY,i=e.skipColorSpaceConversion,r=e.preferImageBitmap,o=t.request;o.url=t.url,o.requestFunction=function(){let a=!1;!t.isDataUri&&!t.isBlobUri&&(a=t.isCrossOriginUrl);let c=tf();return kt._Implementations.createImage(o,a,c,n,i,r),c.promise};let s=El.request(o);if(l(s))return s.catch(function(a){return o.state!==wi.FAILED?Promise.reject(a):t.retryOnError(a).then(function(c){return c?(o.state=wi.UNISSUED,o.deferred=void 0,t._fetchImage({flipY:n,skipColorSpaceConversion:i,preferImageBitmap:r})):Promise.reject(a)})})};kt.fetchImage=function(e){return new kt(e).fetchImage({flipY:e.flipY,skipColorSpaceConversion:e.skipColorSpaceConversion,preferBlob:e.preferBlob,preferImageBitmap:e.preferImageBitmap})};kt.prototype.fetchText=function(){return this.fetch({responseType:"text"})};kt.fetchText=function(e){return new kt(e).fetchText()};kt.prototype.fetchJson=function(){let e=this.fetch({responseType:"text",headers:{Accept:"application/json,*/*;q=0.01"}});if(l(e))return e.then(function(t){if(l(t))return JSON.parse(t)})};kt.fetchJson=function(e){return new kt(e).fetchJson()};kt.prototype.fetchXML=function(){return this.fetch({responseType:"document",overrideMimeType:"text/xml"})};kt.fetchXML=function(e){return new kt(e).fetchXML()};kt.prototype.fetchJsonp=function(e){e=e??"callback",Nq(this.request);let t;do t=`loadJsonp${P.nextRandomNumber().toString().substring(2,8)}`;while(l(window[t]));return Wce(this,e,t)};function Wce(e,t,n){let i={};i[t]=n,e.setQueryParameters(i);let r=e.request,o=e.url;r.url=o,r.requestFunction=function(){let a=tf();return window[n]=function(c){a.resolve(c);try{delete window[n]}catch{window[n]=void 0}},kt._Implementations.loadAndExecuteScript(o,n,a),a.promise};let s=El.request(r);if(l(s))return s.catch(function(a){return r.state!==wi.FAILED?Promise.reject(a):e.retryOnError(a).then(function(c){return c?(r.state=wi.UNISSUED,r.deferred=void 0,Wce(e,t,n)):Promise.reject(a)})})}kt.fetchJsonp=function(e){return new kt(e).fetchJsonp(e.callbackParameterName)};kt.prototype._makeRequest=function(e){let t=this;Nq(t.request);let n=t.request,i=t.url;n.url=i,n.requestFunction=function(){let o=e.responseType,s=Mt(e.headers,t.headers),a=e.overrideMimeType,c=e.method,u=e.data,f=tf(),d=kt._Implementations.loadWithXhr(i,o,c,u,s,f,a);return l(d)&&l(d.abort)&&(n.cancelFunction=function(){d.abort()}),f.promise};let r=El.request(n);if(l(r))return r.then(function(o){return n.cancelFunction=void 0,o}).catch(function(o){return n.cancelFunction=void 0,n.state!==wi.FAILED?Promise.reject(o):t.retryOnError(o).then(function(s){return s?(n.state=wi.UNISSUED,n.deferred=void 0,t.fetch(e)):Promise.reject(o)})})};function Nq(e){if(e.state===wi.ISSUED||e.state===wi.ACTIVE)throw new oe("The Resource is already being fetched.");e.state=wi.UNISSUED,e.deferred=void 0}var DUe=/^data:(.*?)(;base64)?,(.*)$/;function FN(e,t){let n=decodeURIComponent(t);return e?atob(n):n}function jce(e,t){let n=FN(e,t),i=new ArrayBuffer(n.length),r=new Uint8Array(i);for(let o=0;o<n.length;o++)r[o]=n.charCodeAt(o);return i}function RUe(e,t){t=t??"";let n=e[1],i=!!e[2],r=e[3],o,s;switch(t){case"":case"text":return FN(i,r);case"arraybuffer":return jce(i,r);case"blob":return o=jce(i,r),new Blob([o],{type:n});case"document":return s=new DOMParser,s.parseFromString(FN(i,r),n);case"json":return JSON.parse(FN(i,r));default:}}kt.prototype.fetch=function(e){return e=Vm(e,{}),e.method="GET",this._makeRequest(e)};kt.fetch=function(e){return new kt(e).fetch({responseType:e.responseType,overrideMimeType:e.overrideMimeType})};kt.prototype.delete=function(e){return e=Vm(e,{}),e.method="DELETE",this._makeRequest(e)};kt.delete=function(e){return new kt(e).delete({responseType:e.responseType,overrideMimeType:e.overrideMimeType,data:e.data})};kt.prototype.head=function(e){return e=Vm(e,{}),e.method="HEAD",this._makeRequest(e)};kt.head=function(e){return new kt(e).head({responseType:e.responseType,overrideMimeType:e.overrideMimeType})};kt.prototype.options=function(e){return e=Vm(e,{}),e.method="OPTIONS",this._makeRequest(e)};kt.options=function(e){return new kt(e).options({responseType:e.responseType,overrideMimeType:e.overrideMimeType})};kt.prototype.post=function(e,t){return qr.defined("data",e),t=Vm(t,{}),t.method="POST",t.data=e,this._makeRequest(t)};kt.post=function(e){return new kt(e).post(e.data,{responseType:e.responseType,overrideMimeType:e.overrideMimeType})};kt.prototype.put=function(e,t){return qr.defined("data",e),t=Vm(t,{}),t.method="PUT",t.data=e,this._makeRequest(t)};kt.put=function(e){return new kt(e).put(e.data,{responseType:e.responseType,overrideMimeType:e.overrideMimeType})};kt.prototype.patch=function(e,t){return qr.defined("data",e),t=Vm(t,{}),t.method="PATCH",t.data=e,this._makeRequest(t)};kt.patch=function(e){return new kt(e).patch(e.data,{responseType:e.responseType,overrideMimeType:e.overrideMimeType})};kt._Implementations={};kt._Implementations.loadImageElement=function(e,t,n){let i=new Image;i.onload=function(){i.naturalWidth===0&&i.naturalHeight===0&&i.width===0&&i.height===0&&(i.width=300,i.height=150),n.resolve(i)},i.onerror=function(r){n.reject(r)},t&&(VI.contains(e)?i.crossOrigin="use-credentials":i.crossOrigin=""),i.src=e};kt._Implementations.createImage=function(e,t,n,i,r,o,s){let a=e.url;kt.supportsImageBitmapOptions().then(function(c){if(!(c&&o)){kt._Implementations.loadImageElement(a,t,n);return}let u="blob",f="GET",d=tf(),p=kt._Implementations.loadWithXhr(a,u,f,void 0,s,d,void 0,void 0,void 0);return l(p)&&l(p.abort)&&(e.cancelFunction=function(){p.abort()}),d.promise.then(function(g){if(!l(g)){n.reject(new oe(`Successfully retrieved ${a} but it contained no content.`));return}return kt.createImageBitmapFromBlob(g,{flipY:i,premultiplyAlpha:!1,skipColorSpaceConversion:r})}).then(function(g){n.resolve(g)})}).catch(function(c){n.reject(c)})};kt.createImageBitmapFromBlob=function(e,t){return qr.defined("options",t),qr.typeOf.bool("options.flipY",t.flipY),qr.typeOf.bool("options.premultiplyAlpha",t.premultiplyAlpha),qr.typeOf.bool("options.skipColorSpaceConversion",t.skipColorSpaceConversion),createImageBitmap(e,{imageOrientation:t.flipY?"flipY":"none",premultiplyAlpha:t.premultiplyAlpha?"premultiply":"none",colorSpaceConversion:t.skipColorSpaceConversion?"none":"default"})};function OUe(e,t,n,i,r,o,s){fetch(e,{method:n,headers:r}).then(async a=>{if(!a.ok){let c={};a.headers.forEach((u,f)=>{c[f]=u}),o.reject(new O0(a.status,a,c));return}switch(t){case"text":o.resolve(a.text());break;case"json":o.resolve(a.json());break;default:o.resolve(new Uint8Array(await a.arrayBuffer()).buffer);break}}).catch(()=>{o.reject(new O0)})}var MUe=typeof XMLHttpRequest>"u";kt._Implementations.loadWithXhr=function(e,t,n,i,r,o,s){let a=DUe.exec(e);if(a!==null){o.resolve(RUe(a,t));return}if(MUe){OUe(e,t,n,i,r,o,s);return}let c=new XMLHttpRequest;if(VI.contains(e)&&(c.withCredentials=!0),c.open(n,e,!0),l(s)&&l(c.overrideMimeType)&&c.overrideMimeType(s),l(r))for(let f in r)r.hasOwnProperty(f)&&c.setRequestHeader(f,r[f]);l(t)&&(c.responseType=t);let u=!1;return typeof e=="string"&&(u=e.indexOf("file://")===0||typeof window<"u"&&window.location.origin==="file://"),c.onload=function(){if((c.status<200||c.status>=300)&&!(u&&c.status===0)){o.reject(new O0(c.status,c.response,c.getAllResponseHeaders()));return}let f=c.response,d=c.responseType;if(n==="HEAD"||n==="OPTIONS"){let g=c.getAllResponseHeaders().trim().split(/[\r\n]+/),m={};g.forEach(function(y){let A=y.split(": "),b=A.shift();m[b]=A.join(": ")}),o.resolve(m);return}if(c.status===204)o.resolve(void 0);else if(l(f)&&(!l(t)||d===t))o.resolve(f);else if(t==="json"&&typeof f=="string")try{o.resolve(JSON.parse(f))}catch(p){o.reject(p)}else(d===""||d==="document")&&l(c.responseXML)&&c.responseXML.hasChildNodes()?o.resolve(c.responseXML):(d===""||d==="text")&&l(c.responseText)?o.resolve(c.responseText):o.reject(new oe("Invalid XMLHttpRequest response type."))},c.onerror=function(f){o.reject(new O0)},c.send(i),c};kt._Implementations.loadAndExecuteScript=function(e,t,n){return SE(e,t).catch(function(i){n.reject(i)})};kt._DefaultImplementations={};kt._DefaultImplementations.createImage=kt._Implementations.createImage;kt._DefaultImplementations.loadWithXhr=kt._Implementations.loadWithXhr;kt._DefaultImplementations.loadAndExecuteScript=kt._Implementations.loadAndExecuteScript;kt.DEFAULT=Object.freeze(new kt({url:typeof document>"u"?"":document.location.href.split("?")[0]}));var De=kt;function HI(e){e=e??H.EMPTY_OBJECT,this._dates=void 0,this._samples=void 0,this._dateColumn=-1,this._xPoleWanderRadiansColumn=-1,this._yPoleWanderRadiansColumn=-1,this._ut1MinusUtcSecondsColumn=-1,this._xCelestialPoleOffsetRadiansColumn=-1,this._yCelestialPoleOffsetRadiansColumn=-1,this._taiMinusUtcSecondsColumn=-1,this._columnCount=0,this._lastIndex=-1,this._addNewLeapSeconds=e.addNewLeapSeconds??!0,l(e.data)?qce(this,e.data):qce(this,{columnNames:["dateIso8601","modifiedJulianDateUtc","xPoleWanderRadians","yPoleWanderRadians","ut1MinusUtcSeconds","lengthOfDayCorrectionSeconds","xCelestialPoleOffsetRadians","yCelestialPoleOffsetRadians","taiMinusUtcSeconds"],samples:[]})}HI.fromUrl=async function(e,t){t=t??H.EMPTY_OBJECT;let n=De.createIfNeeded(e),i;try{i=await n.fetchJson()}catch{throw new oe(`An error occurred while retrieving the EOP data from the URL ${n.url}.`)}return new HI({addNewLeapSeconds:t.addNewLeapSeconds,data:i})};HI.NONE=Object.freeze({compute:function(e,t){return l(t)?(t.xPoleWander=0,t.yPoleWander=0,t.xPoleOffset=0,t.yPoleOffset=0,t.ut1MinusUtc=0):t=new gb(0,0,0,0,0),t}});HI.prototype.compute=function(e,t){if(!l(this._samples))return;if(l(t)||(t=new gb(0,0,0,0,0)),this._samples.length===0)return t.xPoleWander=0,t.yPoleWander=0,t.xPoleOffset=0,t.yPoleOffset=0,t.ut1MinusUtc=0,t;let n=this._dates,i=this._lastIndex,r,o;if(l(i)){let a=n[i],c=n[i+1],u=K.lessThanOrEquals(a,e),f=!l(c),d=f||K.greaterThanOrEquals(c,e);if(u&&d)return r=i,!f&&c.equals(e)&&++r,o=r+1,Xce(this,n,this._samples,e,r,o,t),t}let s=Pr(n,e,K.compare,this._dateColumn);return s>=0?(s<n.length-1&&n[s+1].equals(e)&&++s,r=s,o=s):(o=~s,r=o-1,r<0&&(r=0)),this._lastIndex=r,Xce(this,n,this._samples,e,r,o,t),t};function NUe(e,t){return K.compare(e.julianDate,t)}function qce(e,t){if(!l(t.columnNames))throw new oe("Error in loaded EOP data: The columnNames property is required.");if(!l(t.samples))throw new oe("Error in loaded EOP data: The samples property is required.");let n=t.columnNames.indexOf("modifiedJulianDateUtc"),i=t.columnNames.indexOf("xPoleWanderRadians"),r=t.columnNames.indexOf("yPoleWanderRadians"),o=t.columnNames.indexOf("ut1MinusUtcSeconds"),s=t.columnNames.indexOf("xCelestialPoleOffsetRadians"),a=t.columnNames.indexOf("yCelestialPoleOffsetRadians"),c=t.columnNames.indexOf("taiMinusUtcSeconds");if(n<0||i<0||r<0||o<0||s<0||a<0||c<0)throw new oe("Error in loaded EOP data: The columnNames property must include modifiedJulianDateUtc, xPoleWanderRadians, yPoleWanderRadians, ut1MinusUtcSeconds, xCelestialPoleOffsetRadians, yCelestialPoleOffsetRadians, and taiMinusUtcSeconds columns");let u=e._samples=t.samples,f=e._dates=[];e._dateColumn=n,e._xPoleWanderRadiansColumn=i,e._yPoleWanderRadiansColumn=r,e._ut1MinusUtcSecondsColumn=o,e._xCelestialPoleOffsetRadiansColumn=s,e._yCelestialPoleOffsetRadiansColumn=a,e._taiMinusUtcSecondsColumn=c,e._columnCount=t.columnNames.length,e._lastIndex=void 0;let d,p=e._addNewLeapSeconds;for(let g=0,m=u.length;g<m;g+=e._columnCount){let y=u[g+n],A=u[g+c],b=y+Un.MODIFIED_JULIAN_DATE_DIFFERENCE,x=new K(b,A,ai.TAI);if(f.push(x),p){if(A!==d&&l(d)){let T=K.leapSeconds,E=Pr(T,x,NUe);if(E<0){let v=new yr(x,A);T.splice(~E,0,v)}}d=A}}}function Yce(e,t,n,i,r){let o=n*i;r.xPoleWander=t[o+e._xPoleWanderRadiansColumn],r.yPoleWander=t[o+e._yPoleWanderRadiansColumn],r.xPoleOffset=t[o+e._xCelestialPoleOffsetRadiansColumn],r.yPoleOffset=t[o+e._yCelestialPoleOffsetRadiansColumn],r.ut1MinusUtc=t[o+e._ut1MinusUtcSecondsColumn]}function jI(e,t,n){return t+e*(n-t)}function Xce(e,t,n,i,r,o,s){let a=e._columnCount;if(o>t.length-1)return s.xPoleWander=0,s.yPoleWander=0,s.xPoleOffset=0,s.yPoleOffset=0,s.ut1MinusUtc=0,s;let c=t[r],u=t[o];if(c.equals(u)||i.equals(c))return Yce(e,n,r,a,s),s;if(i.equals(u))return Yce(e,n,o,a,s),s;let f=K.secondsDifference(i,c)/K.secondsDifference(u,c),d=r*a,p=o*a,g=n[d+e._ut1MinusUtcSecondsColumn],m=n[p+e._ut1MinusUtcSecondsColumn],y=m-g;if(y>.5||y<-.5){let A=n[d+e._taiMinusUtcSecondsColumn],b=n[p+e._taiMinusUtcSecondsColumn];A!==b&&(u.equals(i)?g=m:m-=b-A)}return s.xPoleWander=jI(f,n[d+e._xPoleWanderRadiansColumn],n[p+e._xPoleWanderRadiansColumn]),s.yPoleWander=jI(f,n[d+e._yPoleWanderRadiansColumn],n[p+e._yPoleWanderRadiansColumn]),s.xPoleOffset=jI(f,n[d+e._xCelestialPoleOffsetRadiansColumn],n[p+e._xCelestialPoleOffsetRadiansColumn]),s.yPoleOffset=jI(f,n[d+e._yCelestialPoleOffsetRadiansColumn],n[p+e._yCelestialPoleOffsetRadiansColumn]),s.ut1MinusUtc=jI(f,g,m),s}var kN=HI;function Bc(e,t,n){this.heading=e??0,this.pitch=t??0,this.roll=n??0}Bc.fromQuaternion=function(e,t){l(t)||(t=new Bc);let n=2*(e.w*e.y-e.z*e.x),i=1-2*(e.x*e.x+e.y*e.y),r=2*(e.w*e.x+e.y*e.z),o=1-2*(e.y*e.y+e.z*e.z),s=2*(e.w*e.z+e.x*e.y);return t.heading=-Math.atan2(s,o),t.roll=Math.atan2(r,i),t.pitch=-P.asinClamped(n),t};Bc.fromDegrees=function(e,t,n,i){return l(i)||(i=new Bc),i.heading=e*P.RADIANS_PER_DEGREE,i.pitch=t*P.RADIANS_PER_DEGREE,i.roll=n*P.RADIANS_PER_DEGREE,i};Bc.clone=function(e,t){if(l(e))return l(t)?(t.heading=e.heading,t.pitch=e.pitch,t.roll=e.roll,t):new Bc(e.heading,e.pitch,e.roll)};Bc.equals=function(e,t){return e===t||l(e)&&l(t)&&e.heading===t.heading&&e.pitch===t.pitch&&e.roll===t.roll};Bc.equalsEpsilon=function(e,t,n,i){return e===t||l(e)&&l(t)&&P.equalsEpsilon(e.heading,t.heading,n,i)&&P.equalsEpsilon(e.pitch,t.pitch,n,i)&&P.equalsEpsilon(e.roll,t.roll,n,i)};Bc.prototype.clone=function(e){return Bc.clone(this,e)};Bc.prototype.equals=function(e){return Bc.equals(this,e)};Bc.prototype.equalsEpsilon=function(e,t,n){return Bc.equalsEpsilon(this,e,t,n)};Bc.prototype.toString=function(){return`(${this.heading}, ${this.pitch}, ${this.roll})`};var kc=Bc;var Kce=/((?:.*\/)|^)Cesium\.js(?:\?|\#|$)/;function LUe(){let e=document.getElementsByTagName("script");for(let t=0,n=e.length;t<n;++t){let i=e[t].getAttribute("src"),r=Kce.exec(i);if(r!==null)return r[1]}}var UN;function $ce(e){return typeof document>"u"?e:(l(UN)||(UN=document.createElement("a")),UN.href=e,UN.href)}var bb;function Jce(){if(l(bb))return bb;let e;return typeof CESIUM_BASE_URL<"u"?e=CESIUM_BASE_URL:l(import.meta?.url)?e=fh(".",import.meta.url):typeof define=="object"&&l(define.amd)&&!define.amd.toUrlUndefined&&l(iN.toUrl)?e=fh("..",xb("Core/buildModuleUrl.js")):e=LUe(),bb=new De({url:$ce(e)}),bb.appendForwardSlash(),bb}function FUe(e){return $ce(iN.toUrl(`../${e}`))}function Zce(e){return Jce().getDerivedResource({url:e}).url}var zN;function xb(e){return l(zN)||(typeof define=="object"&&l(define.amd)&&!define.amd.toUrlUndefined&&l(iN.toUrl)?zN=FUe:zN=Zce),zN(e)}xb._cesiumScriptRegex=Kce;xb._buildModuleUrlFromBaseUrl=Zce;xb._clearBaseResource=function(){bb=void 0};xb.setBaseUrl=function(e){bb=De.DEFAULT.getDerivedResource({url:e})};xb.getCesiumBaseUrl=Jce;var Zt=xb;function BUe(e,t,n){this.x=e,this.y=t,this.s=n}var RE=BUe;function VN(e){e=e??H.EMPTY_OBJECT,this._xysFileUrlTemplate=De.createIfNeeded(e.xysFileUrlTemplate),this._interpolationOrder=e.interpolationOrder??9,this._sampleZeroJulianEphemerisDate=e.sampleZeroJulianEphemerisDate??24423965e-1,this._sampleZeroDateTT=new K(this._sampleZeroJulianEphemerisDate,0,ai.TAI),this._stepSizeDays=e.stepSizeDays??1,this._samplesPerXysFile=e.samplesPerXysFile??1e3,this._totalSamples=e.totalSamples??27426,this._samples=new Array(this._totalSamples*3),this._chunkDownloadsInProgress=[];let t=this._interpolationOrder,n=this._denominators=new Array(t+1),i=this._xTable=new Array(t+1),r=Math.pow(this._stepSizeDays,t);for(let o=0;o<=t;++o){n[o]=r,i[o]=o*this._stepSizeDays;for(let s=0;s<=t;++s)s!==o&&(n[o]*=o-s);n[o]=1/n[o]}this._work=new Array(t+1),this._coef=new Array(t+1)}var kUe=new K(0,0,ai.TAI);function Lq(e,t,n){let i=kUe;return i.dayNumber=t,i.secondsOfDay=n,K.daysDifference(i,e._sampleZeroDateTT)}VN.prototype.preload=function(e,t,n,i){let r=Lq(this,e,t),o=Lq(this,n,i),s=r/this._stepSizeDays-this._interpolationOrder/2|0;s<0&&(s=0);let a=o/this._stepSizeDays-this._interpolationOrder/2|0+this._interpolationOrder;a>=this._totalSamples&&(a=this._totalSamples-1);let c=s/this._samplesPerXysFile|0,u=a/this._samplesPerXysFile|0,f=[];for(let d=c;d<=u;++d)f.push(Fq(this,d));return Promise.all(f)};VN.prototype.computeXysRadians=function(e,t,n){let i=Lq(this,e,t);if(i<0)return;let r=i/this._stepSizeDays|0;if(r>=this._totalSamples)return;let o=this._interpolationOrder,s=r-(o/2|0);s<0&&(s=0);let a=s+o;a>=this._totalSamples&&(a=this._totalSamples-1,s=a-o,s<0&&(s=0));let c=!1,u=this._samples;if(l(u[s*3])||(Fq(this,s/this._samplesPerXysFile|0),c=!0),l(u[a*3])||(Fq(this,a/this._samplesPerXysFile|0),c=!0),c)return;l(n)?(n.x=0,n.y=0,n.s=0):n=new RE(0,0,0);let f=i-s*this._stepSizeDays,d=this._work,p=this._denominators,g=this._coef,m=this._xTable,y,A;for(y=0;y<=o;++y)d[y]=f-m[y];for(y=0;y<=o;++y){for(g[y]=1,A=0;A<=o;++A)A!==y&&(g[y]*=d[A]);g[y]*=p[y];let b=(s+y)*3;n.x+=g[y]*u[b++],n.y+=g[y]*u[b++],n.s+=g[y]*u[b]}return n};VN.prototype._updateChunkData=function(e,{samples:t}){this._chunkDownloadsInProgress[e]=void 0;let n=this._samplesPerXysFile,i=e*n*3;for(let r=0;r<t.length;++r)this._samples[i+r]=t[r]};async function UUe(e,t,n){try{let i=await e.fetchJson();n._updateChunkData(t,i)}catch{}}function Fq(e,t){if(l(e._chunkDownloadsInProgress[t]))return e._chunkDownloadsInProgress[t];let n,i=e._xysFileUrlTemplate;l(i)?n=i.getDerivedResource({templateValues:{0:t}}):n=new De({url:Zt(`Assets/IAU2006_XYS/IAU2006_XYS_${t}.json`)});let r=UUe(n,t,e);return e._chunkDownloadsInProgress[t]=r,r}var jN=VN;function dt(e,t,n,i){this.x=e??0,this.y=t??0,this.z=n??0,this.w=i??0}var GI=new h;dt.fromAxisAngle=function(e,t,n){let i=t/2,r=Math.sin(i);GI=h.normalize(e,GI);let o=GI.x*r,s=GI.y*r,a=GI.z*r,c=Math.cos(i);return l(n)?(n.x=o,n.y=s,n.z=a,n.w=c,n):new dt(o,s,a,c)};var zUe=[1,2,0],VUe=new Array(3);dt.fromRotationMatrix=function(e,t){let n,i,r,o,s,a=e[$.COLUMN0ROW0],c=e[$.COLUMN1ROW1],u=e[$.COLUMN2ROW2],f=a+c+u;if(f>0)n=Math.sqrt(f+1),s=.5*n,n=.5/n,i=(e[$.COLUMN1ROW2]-e[$.COLUMN2ROW1])*n,r=(e[$.COLUMN2ROW0]-e[$.COLUMN0ROW2])*n,o=(e[$.COLUMN0ROW1]-e[$.COLUMN1ROW0])*n;else{let d=zUe,p=0;c>a&&(p=1),u>a&&u>c&&(p=2);let g=d[p],m=d[g];n=Math.sqrt(e[$.getElementIndex(p,p)]-e[$.getElementIndex(g,g)]-e[$.getElementIndex(m,m)]+1);let y=VUe;y[p]=.5*n,n=.5/n,s=(e[$.getElementIndex(m,g)]-e[$.getElementIndex(g,m)])*n,y[g]=(e[$.getElementIndex(g,p)]+e[$.getElementIndex(p,g)])*n,y[m]=(e[$.getElementIndex(m,p)]+e[$.getElementIndex(p,m)])*n,i=-y[0],r=-y[1],o=-y[2]}return l(t)?(t.x=i,t.y=r,t.z=o,t.w=s,t):new dt(i,r,o,s)};var Qce=new dt,ele=new dt,Bq=new dt,tle=new dt;dt.fromHeadingPitchRoll=function(e,t){return tle=dt.fromAxisAngle(h.UNIT_X,e.roll,Qce),Bq=dt.fromAxisAngle(h.UNIT_Y,-e.pitch,t),t=dt.multiply(Bq,tle,Bq),ele=dt.fromAxisAngle(h.UNIT_Z,-e.heading,Qce),dt.multiply(ele,t,t)};var HN=new h,kq=new h,dh=new dt,nle=new dt,GN=new dt;dt.packedLength=4;dt.pack=function(e,t,n){return n=n??0,t[n++]=e.x,t[n++]=e.y,t[n++]=e.z,t[n]=e.w,t};dt.unpack=function(e,t,n){return t=t??0,l(n)||(n=new dt),n.x=e[t],n.y=e[t+1],n.z=e[t+2],n.w=e[t+3],n};dt.packedInterpolationLength=3;dt.convertPackedArrayForInterpolation=function(e,t,n,i){dt.unpack(e,n*4,GN),dt.conjugate(GN,GN);for(let r=0,o=n-t+1;r<o;r++){let s=r*3;dt.unpack(e,(t+r)*4,dh),dt.multiply(dh,GN,dh),dh.w<0&&dt.negate(dh,dh),dt.computeAxis(dh,HN);let a=dt.computeAngle(dh);l(i)||(i=[]),i[s]=HN.x*a,i[s+1]=HN.y*a,i[s+2]=HN.z*a}};dt.unpackInterpolationResult=function(e,t,n,i,r){l(r)||(r=new dt),h.fromArray(e,0,kq);let o=h.magnitude(kq);return dt.unpack(t,i*4,nle),o===0?dt.clone(dt.IDENTITY,dh):dt.fromAxisAngle(kq,o,dh),dt.multiply(dh,nle,r)};dt.clone=function(e,t){if(l(e))return l(t)?(t.x=e.x,t.y=e.y,t.z=e.z,t.w=e.w,t):new dt(e.x,e.y,e.z,e.w)};dt.conjugate=function(e,t){return t.x=-e.x,t.y=-e.y,t.z=-e.z,t.w=e.w,t};dt.magnitudeSquared=function(e){return e.x*e.x+e.y*e.y+e.z*e.z+e.w*e.w};dt.magnitude=function(e){return Math.sqrt(dt.magnitudeSquared(e))};dt.normalize=function(e,t){let n=1/dt.magnitude(e),i=e.x*n,r=e.y*n,o=e.z*n,s=e.w*n;return t.x=i,t.y=r,t.z=o,t.w=s,t};dt.inverse=function(e,t){let n=dt.magnitudeSquared(e);return t=dt.conjugate(e,t),dt.multiplyByScalar(t,1/n,t)};dt.add=function(e,t,n){return n.x=e.x+t.x,n.y=e.y+t.y,n.z=e.z+t.z,n.w=e.w+t.w,n};dt.subtract=function(e,t,n){return n.x=e.x-t.x,n.y=e.y-t.y,n.z=e.z-t.z,n.w=e.w-t.w,n};dt.negate=function(e,t){return t.x=-e.x,t.y=-e.y,t.z=-e.z,t.w=-e.w,t};dt.dot=function(e,t){return e.x*t.x+e.y*t.y+e.z*t.z+e.w*t.w};dt.multiply=function(e,t,n){let i=e.x,r=e.y,o=e.z,s=e.w,a=t.x,c=t.y,u=t.z,f=t.w,d=s*a+i*f+r*u-o*c,p=s*c-i*u+r*f+o*a,g=s*u+i*c-r*a+o*f,m=s*f-i*a-r*c-o*u;return n.x=d,n.y=p,n.z=g,n.w=m,n};dt.multiplyByScalar=function(e,t,n){return n.x=e.x*t,n.y=e.y*t,n.z=e.z*t,n.w=e.w*t,n};dt.divideByScalar=function(e,t,n){return n.x=e.x/t,n.y=e.y/t,n.z=e.z/t,n.w=e.w/t,n};dt.computeAxis=function(e,t){let n=e.w;if(Math.abs(n-1)<P.EPSILON6||Math.abs(n+1)<P.EPSILON6)return t.x=1,t.y=t.z=0,t;let i=1/Math.sqrt(1-n*n);return t.x=e.x*i,t.y=e.y*i,t.z=e.z*i,t};dt.computeAngle=function(e){return Math.abs(e.w-1)<P.EPSILON6?0:2*Math.acos(e.w)};var Uq=new dt;dt.lerp=function(e,t,n,i){return Uq=dt.multiplyByScalar(t,n,Uq),i=dt.multiplyByScalar(e,1-n,i),dt.add(Uq,i,i)};var ile=new dt,zq=new dt,Vq=new dt;dt.slerp=function(e,t,n,i){let r=dt.dot(e,t),o=t;if(r<0&&(r=-r,o=ile=dt.negate(t,ile)),1-r<P.EPSILON6)return dt.lerp(e,o,n,i);let s=Math.acos(r);return zq=dt.multiplyByScalar(e,Math.sin((1-n)*s),zq),Vq=dt.multiplyByScalar(o,Math.sin(n*s),Vq),i=dt.add(zq,Vq,i),dt.multiplyByScalar(i,1/Math.sin(s),i)};dt.log=function(e,t){let n=P.acosClamped(e.w),i=0;return n!==0&&(i=n/Math.sin(n)),h.multiplyByScalar(e,i,t)};dt.exp=function(e,t){let n=h.magnitude(e),i=0;return n!==0&&(i=Math.sin(n)/n),t.x=e.x*i,t.y=e.y*i,t.z=e.z*i,t.w=Math.cos(n),t};var jUe=new h,HUe=new h,WI=new dt,OE=new dt;dt.computeInnerQuadrangle=function(e,t,n,i){let r=dt.conjugate(t,WI);dt.multiply(r,n,OE);let o=dt.log(OE,jUe);dt.multiply(r,e,OE);let s=dt.log(OE,HUe);return h.add(o,s,o),h.multiplyByScalar(o,.25,o),h.negate(o,o),dt.exp(o,WI),dt.multiply(t,WI,i)};dt.squad=function(e,t,n,i,r,o){let s=dt.slerp(e,t,r,WI),a=dt.slerp(n,i,r,OE);return dt.slerp(s,a,2*r*(1-r),o)};var GUe=new dt,rle=1.9011074535173003,WN=dn.supportsTypedArrays()?new Float32Array(8):[],qN=dn.supportsTypedArrays()?new Float32Array(8):[],N0=dn.supportsTypedArrays()?new Float32Array(8):[],L0=dn.supportsTypedArrays()?new Float32Array(8):[];for(let e=0;e<7;++e){let t=e+1,n=2*t+1;WN[e]=1/(t*n),qN[e]=t/n}WN[7]=rle/136;qN[7]=rle*8/17;dt.fastSlerp=function(e,t,n,i){let r=dt.dot(e,t),o;r>=0?o=1:(o=-1,r=-r);let s=r-1,a=1-n,c=n*n,u=a*a;for(let g=7;g>=0;--g)N0[g]=(WN[g]*c-qN[g])*s,L0[g]=(WN[g]*u-qN[g])*s;let f=o*n*(1+N0[0]*(1+N0[1]*(1+N0[2]*(1+N0[3]*(1+N0[4]*(1+N0[5]*(1+N0[6]*(1+N0[7])))))))),d=a*(1+L0[0]*(1+L0[1]*(1+L0[2]*(1+L0[3]*(1+L0[4]*(1+L0[5]*(1+L0[6]*(1+L0[7])))))))),p=dt.multiplyByScalar(e,d,GUe);return dt.multiplyByScalar(t,f,i),dt.add(p,i,i)};dt.fastSquad=function(e,t,n,i,r,o){let s=dt.fastSlerp(e,t,r,WI),a=dt.fastSlerp(n,i,r,OE);return dt.fastSlerp(s,a,2*r*(1-r),o)};dt.equals=function(e,t){return e===t||l(e)&&l(t)&&e.x===t.x&&e.y===t.y&&e.z===t.z&&e.w===t.w};dt.equalsEpsilon=function(e,t,n){return n=n??0,e===t||l(e)&&l(t)&&Math.abs(e.x-t.x)<=n&&Math.abs(e.y-t.y)<=n&&Math.abs(e.z-t.z)<=n&&Math.abs(e.w-t.w)<=n};dt.ZERO=Object.freeze(new dt(0,0,0,0));dt.IDENTITY=Object.freeze(new dt(0,0,0,1));dt.prototype.clone=function(e){return dt.clone(this,e)};dt.prototype.equals=function(e){return dt.equals(this,e)};dt.prototype.equalsEpsilon=function(e,t){return dt.equalsEpsilon(this,e,t)};dt.prototype.toString=function(){return`(${this.x}, ${this.y}, ${this.z}, ${this.w})`};var Le=dt;var bi={},jq={up:{south:"east",north:"west",west:"south",east:"north"},down:{south:"west",north:"east",west:"north",east:"south"},south:{up:"west",down:"east",west:"down",east:"up"},north:{up:"east",down:"west",west:"up",east:"down"},west:{up:"north",down:"south",north:"down",south:"up"},east:{up:"south",down:"north",north:"up",south:"down"}},ME={north:[-1,0,0],east:[0,1,0],up:[0,0,1],south:[1,0,0],west:[0,-1,0],down:[0,0,-1]},Hq={},su={east:new h,north:new h,up:new h,west:new h,south:new h,down:new h},w_=new h,I_=new h,P_=new h;bi.localFrameToFixedFrameGenerator=function(e,t){if(!jq.hasOwnProperty(e)||!jq[e].hasOwnProperty(t))throw new pe("firstAxis and secondAxis must be east, north, up, west, south or down.");let n=jq[e][t],i,r=e+t;return l(Hq[r])?i=Hq[r]:(i=function(o,s,a){if(l(a)||(a=new M),h.equalsEpsilon(o,h.ZERO,P.EPSILON14))h.unpack(ME[e],0,w_),h.unpack(ME[t],0,I_),h.unpack(ME[n],0,P_);else if(P.equalsEpsilon(o.x,0,P.EPSILON14)&&P.equalsEpsilon(o.y,0,P.EPSILON14)){let c=P.sign(o.z);h.unpack(ME[e],0,w_),e!=="east"&&e!=="west"&&h.multiplyByScalar(w_,c,w_),h.unpack(ME[t],0,I_),t!=="east"&&t!=="west"&&h.multiplyByScalar(I_,c,I_),h.unpack(ME[n],0,P_),n!=="east"&&n!=="west"&&h.multiplyByScalar(P_,c,P_)}else{s=s??ee.default,s.geodeticSurfaceNormal(o,su.up);let c=su.up,u=su.east;u.x=-o.y,u.y=o.x,u.z=0,h.normalize(u,su.east),h.cross(c,u,su.north),h.multiplyByScalar(su.up,-1,su.down),h.multiplyByScalar(su.east,-1,su.west),h.multiplyByScalar(su.north,-1,su.south),w_=su[e],I_=su[t],P_=su[n]}return a[0]=w_.x,a[1]=w_.y,a[2]=w_.z,a[3]=0,a[4]=I_.x,a[5]=I_.y,a[6]=I_.z,a[7]=0,a[8]=P_.x,a[9]=P_.y,a[10]=P_.z,a[11]=0,a[12]=o.x,a[13]=o.y,a[14]=o.z,a[15]=1,a},Hq[r]=i),i};bi.eastNorthUpToFixedFrame=bi.localFrameToFixedFrameGenerator("east","north");bi.northEastDownToFixedFrame=bi.localFrameToFixedFrameGenerator("north","east");bi.northUpEastToFixedFrame=bi.localFrameToFixedFrameGenerator("north","up");bi.northWestUpToFixedFrame=bi.localFrameToFixedFrameGenerator("north","west");var WUe=new Le,qUe=new h(1,1,1),YUe=new M;bi.headingPitchRollToFixedFrame=function(e,t,n,i,r){i=i??bi.eastNorthUpToFixedFrame;let o=Le.fromHeadingPitchRoll(t,WUe),s=M.fromTranslationQuaternionRotationScale(h.ZERO,o,qUe,YUe);return r=i(e,n,r),M.multiply(r,s,r)};var XUe=new M,KUe=new $;bi.headingPitchRollQuaternion=function(e,t,n,i,r){let o=bi.headingPitchRollToFixedFrame(e,t,n,i,XUe),s=M.getMatrix3(o,KUe);return Le.fromRotationMatrix(s,r)};var $Ue=new h(1,1,1),JUe=new h,ole=new M,ZUe=new M,QUe=new $,eze=new Le;bi.fixedFrameToHeadingPitchRoll=function(e,t,n,i){t=t??ee.default,n=n??bi.eastNorthUpToFixedFrame,l(i)||(i=new kc);let r=M.getTranslation(e,JUe);if(h.equals(r,h.ZERO))return i.heading=0,i.pitch=0,i.roll=0,i;let o=M.inverseTransformation(n(r,t,ole),ole),s=M.setScale(e,$Ue,ZUe);s=M.setTranslation(s,h.ZERO,s),o=M.multiply(o,s,o);let a=Le.fromRotationMatrix(M.getMatrix3(o,QUe),eze);return a=Le.normalize(a,a),kc.fromQuaternion(a,i)};var tze=6*3600+2460+50.54841,nze=8640184812866e-6,ize=.093104,rze=-62e-7,oze=11772758384668e-32,sze=72921158553e-15,aze=P.TWO_PI/86400,YN=new K;bi.computeIcrfToCentralBodyFixedMatrix=function(e,t){let n=bi.computeIcrfToFixedMatrix(e,t);return l(n)||(n=bi.computeTemeToPseudoFixedMatrix(e,t)),n};bi.computeTemeToPseudoFixedMatrix=function(e,t){YN=K.addSeconds(e,-K.computeTaiMinusUtc(e),YN);let n=YN.dayNumber,i=YN.secondsOfDay,r,o=n-2451545;i>=43200?r=(o+.5)/Un.DAYS_PER_JULIAN_CENTURY:r=(o-.5)/Un.DAYS_PER_JULIAN_CENTURY;let a=(tze+r*(nze+r*(ize+r*rze)))*aze%P.TWO_PI,c=sze+oze*(n-24515455e-1),u=(i+Un.SECONDS_PER_DAY*.5)%Un.SECONDS_PER_DAY,f=a+c*u,d=Math.cos(f),p=Math.sin(f);return l(t)?(t[0]=d,t[1]=-p,t[2]=0,t[3]=p,t[4]=d,t[5]=0,t[6]=0,t[7]=0,t[8]=1,t):new $(d,p,0,-p,d,0,0,0,1)};bi.iau2006XysData=new jN;bi.earthOrientationParameters=kN.NONE;var qq=32.184,cze=2451545;bi.preloadIcrfFixed=function(e){let t=e.start.dayNumber,n=e.start.secondsOfDay+qq,i=e.stop.dayNumber,r=e.stop.secondsOfDay+qq;return bi.iau2006XysData.preload(t,n,i,r)};bi.computeIcrfToFixedMatrix=function(e,t){l(t)||(t=new $);let n=bi.computeFixedToIcrfMatrix(e,t);if(l(n))return $.transpose(n,t)};var lze=32.184,uze=2451545,XN=new kc,fze=new $,dze=new K;bi.computeMoonFixedToIcrfMatrix=function(e,t){l(t)||(t=new $);let n=K.addSeconds(e,lze,dze),i=K.totalDays(n)-uze,r=P.toRadians(12.112)-P.toRadians(.052992)*i,o=P.toRadians(24.224)-P.toRadians(.105984)*i,s=P.toRadians(227.645)+P.toRadians(13.012)*i,a=P.toRadians(261.105)+P.toRadians(13.340716)*i,c=P.toRadians(358)+P.toRadians(.9856)*i;return XN.pitch=P.toRadians(180)-P.toRadians(3.878)*Math.sin(r)-P.toRadians(.12)*Math.sin(o)+P.toRadians(.07)*Math.sin(s)-P.toRadians(.017)*Math.sin(a),XN.roll=P.toRadians(66.53-90)+P.toRadians(1.543)*Math.cos(r)+P.toRadians(.24)*Math.cos(o)-P.toRadians(.028)*Math.cos(s)+P.toRadians(.007)*Math.cos(a),XN.heading=P.toRadians(244.375-90)+P.toRadians(13.17635831)*i+P.toRadians(3.558)*Math.sin(r)+P.toRadians(.121)*Math.sin(o)-P.toRadians(.064)*Math.sin(s)+P.toRadians(.016)*Math.sin(a)+P.toRadians(.025)*Math.sin(c),$.fromHeadingPitchRoll(XN,fze,t)};bi.computeIcrfToMoonFixedMatrix=function(e,t){l(t)||(t=new $);let n=bi.computeMoonFixedToIcrfMatrix(e,t);if(l(n))return $.transpose(n,t)};var hze=new RE(0,0,0),mze=new gb(0,0,0,0,0,0),Gq=new $,Wq=new $;bi.computeFixedToIcrfMatrix=function(e,t){l(t)||(t=new $);let n=bi.earthOrientationParameters.compute(e,mze);if(!l(n))return;let i=e.dayNumber,r=e.secondsOfDay+qq,o=bi.iau2006XysData.computeXysRadians(i,r,hze);if(!l(o))return;let s=o.x+n.xPoleOffset,a=o.y+n.yPoleOffset,c=1/(1+Math.sqrt(1-s*s-a*a)),u=Gq;u[0]=1-c*s*s,u[3]=-c*s*a,u[6]=s,u[1]=-c*s*a,u[4]=1-c*a*a,u[7]=a,u[2]=-s,u[5]=-a,u[8]=1-c*(s*s+a*a);let f=$.fromRotationZ(-o.s,Wq),d=$.multiply(u,f,Gq),p=e.dayNumber,g=e.secondsOfDay-K.computeTaiMinusUtc(e)+n.ut1MinusUtc,m=p-2451545,y=g/Un.SECONDS_PER_DAY,A=.779057273264+y+.00273781191135448*(m+y);A=A%1*P.TWO_PI;let b=$.fromRotationZ(A,Wq),x=$.multiply(d,b,Gq),T=Math.cos(n.xPoleWander),E=Math.cos(n.yPoleWander),v=Math.sin(n.xPoleWander),S=Math.sin(n.yPoleWander),I=i-cze+r/Un.SECONDS_PER_DAY;I/=36525;let R=-47e-6*I*P.RADIANS_PER_DEGREE/3600,O=Math.cos(R),L=Math.sin(R),_=Wq;return _[0]=T*O,_[1]=T*L,_[2]=v,_[3]=-E*L+S*v*O,_[4]=E*O+S*v*L,_[5]=-S*T,_[6]=-S*L-E*v*O,_[7]=S*O-E*v*L,_[8]=E*T,$.multiply(x,_,t)};var pze=new se;bi.pointToWindowCoordinates=function(e,t,n,i){return i=bi.pointToGLWindowCoordinates(e,t,n,i),i.y=2*t[5]-i.y,i};bi.pointToGLWindowCoordinates=function(e,t,n,i){l(i)||(i=new U);let r=pze;return M.multiplyByVector(e,se.fromElements(n.x,n.y,n.z,1,r),r),se.multiplyByScalar(r,1/r.w,r),M.multiplyByVector(t,r,r),U.fromCartesian4(r,i)};var gze=new h,_ze=new h,yze=new h;bi.rotationMatrixFromPositionVelocity=function(e,t,n,i){let r=(n??ee.default).geodeticSurfaceNormal(e,gze),o=h.cross(t,r,_ze);h.equalsEpsilon(o,h.ZERO,P.EPSILON6)&&(o=h.clone(h.UNIT_X,o));let s=h.cross(o,t,yze);return h.normalize(s,s),h.cross(t,s,o),h.negate(o,o),h.normalize(o,o),l(i)||(i=new $),i[0]=t.x,i[1]=t.y,i[2]=t.z,i[3]=o.x,i[4]=o.y,i[5]=o.z,i[6]=s.x,i[7]=s.y,i[8]=s.z,i};bi.SWIZZLE_3D_TO_2D_MATRIX=Object.freeze(new M(0,0,1,0,1,0,0,0,0,1,0,0,0,0,0,1));var sle=new he,Yq=new h,Aze=new h,bze=new $,Xq=new M,ale=new M;bi.basisTo2D=function(e,t,n){let i=M.getTranslation(t,Aze),r=e.ellipsoid,o;if(h.equals(i,h.ZERO))o=h.clone(h.ZERO,Yq);else{let f=r.cartesianToCartographic(i,sle);o=e.project(f,Yq),h.fromElements(o.z,o.x,o.y,o)}let s=bi.eastNorthUpToFixedFrame(i,r,Xq),a=M.inverseTransformation(s,ale),c=M.getMatrix3(t,bze),u=M.multiplyByMatrix3(a,c,n);return M.multiply(bi.SWIZZLE_3D_TO_2D_MATRIX,u,n),M.setTranslation(n,o,n),n};bi.ellipsoidTo2DModelMatrix=function(e,t,n){let i=e.ellipsoid,r=bi.eastNorthUpToFixedFrame(t,i,Xq),o=M.inverseTransformation(r,ale),s=i.cartesianToCartographic(t,sle),a=e.project(s,Yq);h.fromElements(a.z,a.x,a.y,a);let c=M.fromTranslation(a,Xq);return M.multiply(bi.SWIZZLE_3D_TO_2D_MATRIX,o,n),M.multiply(c,n,n),n};var At=bi;var NE=class e{constructor(t,n,i,r){this.west=t??0,this.south=n??0,this.east=i??0,this.north=r??0}get width(){return e.computeWidth(this)}get height(){return e.computeHeight(this)}static pack(t,n,i){return i=i??0,n[i++]=t.west,n[i++]=t.south,n[i++]=t.east,n[i]=t.north,n}static unpack(t,n,i){return n=n??0,l(i)||(i=new e),i.west=t[n++],i.south=t[n++],i.east=t[n++],i.north=t[n],i}static computeWidth(t){let n=t.east,i=t.west;return n<i&&(n+=P.TWO_PI),n-i}static computeHeight(t){return t.north-t.south}static fromDegrees(t,n,i,r,o){return t=P.toRadians(t??0),n=P.toRadians(n??0),i=P.toRadians(i??0),r=P.toRadians(r??0),l(o)?(o.west=t,o.south=n,o.east=i,o.north=r,o):new e(t,n,i,r)}static fromRadians(t,n,i,r,o){return l(o)?(o.west=t??0,o.south=n??0,o.east=i??0,o.north=r??0,o):new e(t,n,i,r)}static fromCartographicArray(t,n){let i=Number.MAX_VALUE,r=-Number.MAX_VALUE,o=Number.MAX_VALUE,s=-Number.MAX_VALUE,a=Number.MAX_VALUE,c=-Number.MAX_VALUE;for(let u=0,f=t.length;u<f;u++){let d=t[u];i=Math.min(i,d.longitude),r=Math.max(r,d.longitude),a=Math.min(a,d.latitude),c=Math.max(c,d.latitude);let p=d.longitude>=0?d.longitude:d.longitude+P.TWO_PI;o=Math.min(o,p),s=Math.max(s,p)}return r-i>s-o&&(i=o,r=s,r>P.PI&&(r=r-P.TWO_PI),i>P.PI&&(i=i-P.TWO_PI)),l(n)?(n.west=i,n.south=a,n.east=r,n.north=c,n):new e(i,a,r,c)}static fromCartesianArray(t,n,i){n=n??ee.default;let r=Number.MAX_VALUE,o=-Number.MAX_VALUE,s=Number.MAX_VALUE,a=-Number.MAX_VALUE,c=Number.MAX_VALUE,u=-Number.MAX_VALUE;for(let f=0,d=t.length;f<d;f++){let p=n.cartesianToCartographic(t[f]);r=Math.min(r,p.longitude),o=Math.max(o,p.longitude),c=Math.min(c,p.latitude),u=Math.max(u,p.latitude);let g=p.longitude>=0?p.longitude:p.longitude+P.TWO_PI;s=Math.min(s,g),a=Math.max(a,g)}return o-r>a-s&&(r=s,o=a,o>P.PI&&(o=o-P.TWO_PI),r>P.PI&&(r=r-P.TWO_PI)),l(i)?(i.west=r,i.south=c,i.east=o,i.north=u,i):new e(r,c,o,u)}static fromBoundingSphere(t,n,i){let r=t.center,o=t.radius;if(l(n)||(n=ee.default),l(i)||(i=new e),h.equals(r,h.ZERO))return e.clone(e.MAX_VALUE,i),i;let s=At.eastNorthUpToFixedFrame(r,n,xze),a=M.multiplyByPointAsVector(s,h.UNIT_X,Tze);h.normalize(a,a);let c=M.multiplyByPointAsVector(s,h.UNIT_Y,Eze);h.normalize(c,c),h.multiplyByScalar(c,o,c),h.multiplyByScalar(a,o,a);let u=h.negate(c,vze),f=h.negate(a,Cze),d=Kq,p=d[0];return h.add(r,c,p),p=d[1],h.add(r,f,p),p=d[2],h.add(r,u,p),p=d[3],h.add(r,a,p),d[4]=r,e.fromCartesianArray(d,n,i)}static clone(t,n){if(l(t))return l(n)?(n.west=t.west,n.south=t.south,n.east=t.east,n.north=t.north,n):new e(t.west,t.south,t.east,t.north)}static equalsEpsilon(t,n,i){return i=i??0,t===n||l(t)&&l(n)&&Math.abs(t.west-n.west)<=i&&Math.abs(t.south-n.south)<=i&&Math.abs(t.east-n.east)<=i&&Math.abs(t.north-n.north)<=i}clone(t){return e.clone(this,t)}equals(t){return e.equals(this,t)}static equals(t,n){return t===n||l(t)&&l(n)&&t.west===n.west&&t.south===n.south&&t.east===n.east&&t.north===n.north}equalsEpsilon(t,n){return e.equalsEpsilon(this,t,n)}static _validate(t){}static southwest(t,n){return l(n)?(n.longitude=t.west,n.latitude=t.south,n.height=0,n):new he(t.west,t.south)}static northwest(t,n){return l(n)?(n.longitude=t.west,n.latitude=t.north,n.height=0,n):new he(t.west,t.north)}static northeast(t,n){return l(n)?(n.longitude=t.east,n.latitude=t.north,n.height=0,n):new he(t.east,t.north)}static southeast(t,n){return l(n)?(n.longitude=t.east,n.latitude=t.south,n.height=0,n):new he(t.east,t.south)}static center(t,n){let i=t.east,r=t.west;i<r&&(i+=P.TWO_PI);let o=P.negativePiToPi((r+i)*.5),s=(t.south+t.north)*.5;return l(n)?(n.longitude=o,n.latitude=s,n.height=0,n):new he(o,s)}static intersection(t,n,i){let r=t.east,o=t.west,s=n.east,a=n.west;r<o&&s>0?r+=P.TWO_PI:s<a&&r>0&&(s+=P.TWO_PI),r<o&&a<0?a+=P.TWO_PI:s<a&&o<0&&(o+=P.TWO_PI);let c=P.negativePiToPi(Math.max(o,a)),u=P.negativePiToPi(Math.min(r,s));if(c===P.PI&&u<P.PI&&(c=-P.PI),(t.west<t.east||n.west<n.east)&&u<=c)return;let f=Math.max(t.south,n.south),d=Math.min(t.north,n.north);if(!(f>=d))return l(i)?(i.west=c,i.south=f,i.east=u,i.north=d,i):new e(c,f,u,d)}static simpleIntersection(t,n,i){let r=Math.max(t.west,n.west),o=Math.max(t.south,n.south),s=Math.min(t.east,n.east),a=Math.min(t.north,n.north);if(!(o>=a||r>=s))return l(i)?(i.west=r,i.south=o,i.east=s,i.north=a,i):new e(r,o,s,a)}static union(t,n,i){l(i)||(i=new e);let r=t.east,o=t.west,s=n.east,a=n.west;r<o&&s>0?r+=P.TWO_PI:s<a&&r>0&&(s+=P.TWO_PI),r<o&&a<0?a+=P.TWO_PI:s<a&&o<0&&(o+=P.TWO_PI);let c=P.negativePiToPi(Math.min(o,a)),u=P.negativePiToPi(Math.max(r,s));return i.west=c,i.south=Math.min(t.south,n.south),i.east=u,i.north=Math.max(t.north,n.north),i}static expand(t,n,i){return l(i)||(i=new e),i.west=Math.min(t.west,n.longitude),i.south=Math.min(t.south,n.latitude),i.east=Math.max(t.east,n.longitude),i.north=Math.max(t.north,n.latitude),i}static contains(t,n){let i=n.longitude,r=n.latitude,o=t.west,s=t.east;return s<o&&(s+=P.TWO_PI,i<0&&(i+=P.TWO_PI)),(i>o||P.equalsEpsilon(i,o,P.EPSILON14))&&(i<s||P.equalsEpsilon(i,s,P.EPSILON14))&&r>=t.south&&r<=t.north}static subsample(t,n,i,r){n=n??ee.default,i=i??0,l(r)||(r=[]);let o=0,s=t.north,a=t.south,c=t.east,u=t.west,f=Sze;f.height=i,f.longitude=u,f.latitude=s,r[o]=n.cartographicToCartesian(f,r[o]),o++,f.longitude=c,r[o]=n.cartographicToCartesian(f,r[o]),o++,f.latitude=a,r[o]=n.cartographicToCartesian(f,r[o]),o++,f.longitude=u,r[o]=n.cartographicToCartesian(f,r[o]),o++,s<0?f.latitude=s:a>0?f.latitude=a:f.latitude=0;for(let d=1;d<8;++d)f.longitude=-Math.PI+d*P.PI_OVER_TWO,e.contains(t,f)&&(r[o]=n.cartographicToCartesian(f,r[o]),o++);return f.latitude===0&&(f.longitude=u,r[o]=n.cartographicToCartesian(f,r[o]),o++,f.longitude=c,r[o]=n.cartographicToCartesian(f,r[o]),o++),r.length=o,r}static subsection(t,n,i,r,o,s){if(l(s)||(s=new e),t.west<=t.east){let c=t.east-t.west;s.west=t.west+n*c,s.east=t.west+r*c}else{let c=P.TWO_PI+t.east-t.west;s.west=P.negativePiToPi(t.west+n*c),s.east=P.negativePiToPi(t.west+r*c)}let a=t.north-t.south;return s.south=t.south+i*a,s.north=t.south+o*a,n===1&&(s.west=t.east),r===1&&(s.east=t.east),i===1&&(s.south=t.north),o===1&&(s.north=t.north),s}};NE.packedLength=4;var xze=new M,Tze=new h,Eze=new h,Cze=new h,vze=new h,Kq=new Array(5);for(let e=0;e<Kq.length;++e)Kq[e]=new h;var Sze=new he;NE.MAX_VALUE=Object.freeze(new NE(-Math.PI,-P.PI_OVER_TWO,Math.PI,P.PI_OVER_TWO));var ie=NE;function cs(e,t,n,i){this.x=e??0,this.y=t??0,this.width=n??0,this.height=i??0}cs.packedLength=4;cs.pack=function(e,t,n){return n=n??0,t[n++]=e.x,t[n++]=e.y,t[n++]=e.width,t[n]=e.height,t};cs.unpack=function(e,t,n){return t=t??0,l(n)||(n=new cs),n.x=e[t++],n.y=e[t++],n.width=e[t++],n.height=e[t],n};cs.fromPoints=function(e,t){if(l(t)||(t=new cs),!l(e)||e.length===0)return t.x=0,t.y=0,t.width=0,t.height=0,t;let n=e.length,i=e[0].x,r=e[0].y,o=e[0].x,s=e[0].y;for(let a=1;a<n;a++){let c=e[a],u=c.x,f=c.y;i=Math.min(u,i),o=Math.max(u,o),r=Math.min(f,r),s=Math.max(f,s)}return t.x=i,t.y=r,t.width=o-i,t.height=s-r,t};var cle=new ji,wze=new he,Ize=new he;cs.fromRectangle=function(e,t,n){if(l(n)||(n=new cs),!l(e))return n.x=0,n.y=0,n.width=0,n.height=0,n;cle._ellipsoid=ee.default,t=t??cle;let i=t.project(ie.southwest(e,wze)),r=t.project(ie.northeast(e,Ize));return U.subtract(r,i,r),n.x=i.x,n.y=i.y,n.width=r.x,n.height=r.y,n};cs.clone=function(e,t){if(l(e))return l(t)?(t.x=e.x,t.y=e.y,t.width=e.width,t.height=e.height,t):new cs(e.x,e.y,e.width,e.height)};cs.union=function(e,t,n){l(n)||(n=new cs);let i=Math.min(e.x,t.x),r=Math.min(e.y,t.y),o=Math.max(e.x+e.width,t.x+t.width),s=Math.max(e.y+e.height,t.y+t.height);return n.x=i,n.y=r,n.width=o-i,n.height=s-r,n};cs.expand=function(e,t,n){n=cs.clone(e,n);let i=t.x-n.x,r=t.y-n.y;return i>n.width?n.width=i:i<0&&(n.width-=i,n.x=t.x),r>n.height?n.height=r:r<0&&(n.height-=r,n.y=t.y),n};cs.intersect=function(e,t){let n=e.x,i=e.y,r=t.x,o=t.y;return n>r+t.width||n+e.width<r||i+e.height<o||i>o+t.height?$t.OUTSIDE:$t.INTERSECTING};cs.equals=function(e,t){return e===t||l(e)&&l(t)&&e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height};cs.prototype.clone=function(e){return cs.clone(this,e)};cs.prototype.intersect=function(e){return cs.intersect(this,e)};cs.prototype.equals=function(e){return cs.equals(this,e)};var et=cs;var Wa={POINTS:te.POINTS,LINES:te.LINES,LINE_LOOP:te.LINE_LOOP,LINE_STRIP:te.LINE_STRIP,TRIANGLES:te.TRIANGLES,TRIANGLE_STRIP:te.TRIANGLE_STRIP,TRIANGLE_FAN:te.TRIANGLE_FAN};Wa.isLines=function(e){return e===Wa.LINES||e===Wa.LINE_LOOP||e===Wa.LINE_STRIP};Wa.isTriangles=function(e){return e===Wa.TRIANGLES||e===Wa.TRIANGLE_STRIP||e===Wa.TRIANGLE_FAN};Wa.validate=function(e){return e===Wa.POINTS||e===Wa.LINES||e===Wa.LINE_LOOP||e===Wa.LINE_STRIP||e===Wa.TRIANGLES||e===Wa.TRIANGLE_STRIP||e===Wa.TRIANGLE_FAN};Object.freeze(Wa);var Oe=Wa;var LE=`in vec4 position; +(${this[3]}, ${this[7]}, ${this[11]}, ${this[15]})`}};uo.packedLength=16;uo.fromArray=uo.unpack;uo.IDENTITY=new uo(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1);uo.ZERO=new uo(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0);uo.COLUMN0ROW0=0;uo.COLUMN0ROW1=1;uo.COLUMN0ROW2=2;uo.COLUMN0ROW3=3;uo.COLUMN1ROW0=4;uo.COLUMN1ROW1=5;uo.COLUMN1ROW2=6;uo.COLUMN1ROW3=7;uo.COLUMN2ROW0=8;uo.COLUMN2ROW1=9;uo.COLUMN2ROW2=10;uo.COLUMN2ROW3=11;uo.COLUMN3ROW0=12;uo.COLUMN3ROW1=13;uo.COLUMN3ROW2=14;uo.COLUMN3ROW3=15;var yE=new h,AE=new h,FI=new h,r3e=new h,o3e=new h,gq=new h,Jae=new h,s3e=new h,a3e=new h,c3e=new $,l3e=new $,u3e=new se,f3e=new se(0,0,0,1),d3e=new uo,M=uo;var Zae={DEPTH_BUFFER_BIT:256,STENCIL_BUFFER_BIT:1024,COLOR_BUFFER_BIT:16384,POINTS:0,LINES:1,LINE_LOOP:2,LINE_STRIP:3,TRIANGLES:4,TRIANGLE_STRIP:5,TRIANGLE_FAN:6,ZERO:0,ONE:1,SRC_COLOR:768,ONE_MINUS_SRC_COLOR:769,SRC_ALPHA:770,ONE_MINUS_SRC_ALPHA:771,DST_ALPHA:772,ONE_MINUS_DST_ALPHA:773,DST_COLOR:774,ONE_MINUS_DST_COLOR:775,SRC_ALPHA_SATURATE:776,FUNC_ADD:32774,BLEND_EQUATION:32777,BLEND_EQUATION_RGB:32777,BLEND_EQUATION_ALPHA:34877,FUNC_SUBTRACT:32778,FUNC_REVERSE_SUBTRACT:32779,BLEND_DST_RGB:32968,BLEND_SRC_RGB:32969,BLEND_DST_ALPHA:32970,BLEND_SRC_ALPHA:32971,CONSTANT_COLOR:32769,ONE_MINUS_CONSTANT_COLOR:32770,CONSTANT_ALPHA:32771,ONE_MINUS_CONSTANT_ALPHA:32772,BLEND_COLOR:32773,ARRAY_BUFFER:34962,ELEMENT_ARRAY_BUFFER:34963,ARRAY_BUFFER_BINDING:34964,ELEMENT_ARRAY_BUFFER_BINDING:34965,STREAM_DRAW:35040,STATIC_DRAW:35044,DYNAMIC_DRAW:35048,BUFFER_SIZE:34660,BUFFER_USAGE:34661,CURRENT_VERTEX_ATTRIB:34342,FRONT:1028,BACK:1029,FRONT_AND_BACK:1032,CULL_FACE:2884,BLEND:3042,DITHER:3024,STENCIL_TEST:2960,DEPTH_TEST:2929,SCISSOR_TEST:3089,POLYGON_OFFSET_FILL:32823,SAMPLE_ALPHA_TO_COVERAGE:32926,SAMPLE_COVERAGE:32928,NO_ERROR:0,INVALID_ENUM:1280,INVALID_VALUE:1281,INVALID_OPERATION:1282,OUT_OF_MEMORY:1285,CW:2304,CCW:2305,LINE_WIDTH:2849,ALIASED_POINT_SIZE_RANGE:33901,ALIASED_LINE_WIDTH_RANGE:33902,CULL_FACE_MODE:2885,FRONT_FACE:2886,DEPTH_RANGE:2928,DEPTH_WRITEMASK:2930,DEPTH_CLEAR_VALUE:2931,DEPTH_FUNC:2932,STENCIL_CLEAR_VALUE:2961,STENCIL_FUNC:2962,STENCIL_FAIL:2964,STENCIL_PASS_DEPTH_FAIL:2965,STENCIL_PASS_DEPTH_PASS:2966,STENCIL_REF:2967,STENCIL_VALUE_MASK:2963,STENCIL_WRITEMASK:2968,STENCIL_BACK_FUNC:34816,STENCIL_BACK_FAIL:34817,STENCIL_BACK_PASS_DEPTH_FAIL:34818,STENCIL_BACK_PASS_DEPTH_PASS:34819,STENCIL_BACK_REF:36003,STENCIL_BACK_VALUE_MASK:36004,STENCIL_BACK_WRITEMASK:36005,VIEWPORT:2978,SCISSOR_BOX:3088,COLOR_CLEAR_VALUE:3106,COLOR_WRITEMASK:3107,UNPACK_ALIGNMENT:3317,PACK_ALIGNMENT:3333,MAX_TEXTURE_SIZE:3379,MAX_VIEWPORT_DIMS:3386,SUBPIXEL_BITS:3408,RED_BITS:3410,GREEN_BITS:3411,BLUE_BITS:3412,ALPHA_BITS:3413,DEPTH_BITS:3414,STENCIL_BITS:3415,POLYGON_OFFSET_UNITS:10752,POLYGON_OFFSET_FACTOR:32824,TEXTURE_BINDING_2D:32873,SAMPLE_BUFFERS:32936,SAMPLES:32937,SAMPLE_COVERAGE_VALUE:32938,SAMPLE_COVERAGE_INVERT:32939,COMPRESSED_TEXTURE_FORMATS:34467,DONT_CARE:4352,FASTEST:4353,NICEST:4354,GENERATE_MIPMAP_HINT:33170,BYTE:5120,UNSIGNED_BYTE:5121,SHORT:5122,UNSIGNED_SHORT:5123,INT:5124,UNSIGNED_INT:5125,FLOAT:5126,DEPTH_COMPONENT:6402,ALPHA:6406,RGB:6407,RGBA:6408,LUMINANCE:6409,LUMINANCE_ALPHA:6410,UNSIGNED_SHORT_4_4_4_4:32819,UNSIGNED_SHORT_5_5_5_1:32820,UNSIGNED_SHORT_5_6_5:33635,FRAGMENT_SHADER:35632,VERTEX_SHADER:35633,MAX_VERTEX_ATTRIBS:34921,MAX_VERTEX_UNIFORM_VECTORS:36347,MAX_VARYING_VECTORS:36348,MAX_COMBINED_TEXTURE_IMAGE_UNITS:35661,MAX_VERTEX_TEXTURE_IMAGE_UNITS:35660,MAX_TEXTURE_IMAGE_UNITS:34930,MAX_FRAGMENT_UNIFORM_VECTORS:36349,SHADER_TYPE:35663,DELETE_STATUS:35712,LINK_STATUS:35714,VALIDATE_STATUS:35715,ATTACHED_SHADERS:35717,ACTIVE_UNIFORMS:35718,ACTIVE_ATTRIBUTES:35721,SHADING_LANGUAGE_VERSION:35724,CURRENT_PROGRAM:35725,NEVER:512,LESS:513,EQUAL:514,LEQUAL:515,GREATER:516,NOTEQUAL:517,GEQUAL:518,ALWAYS:519,KEEP:7680,REPLACE:7681,INCR:7682,DECR:7683,INVERT:5386,INCR_WRAP:34055,DECR_WRAP:34056,VENDOR:7936,RENDERER:7937,VERSION:7938,NEAREST:9728,LINEAR:9729,NEAREST_MIPMAP_NEAREST:9984,LINEAR_MIPMAP_NEAREST:9985,NEAREST_MIPMAP_LINEAR:9986,LINEAR_MIPMAP_LINEAR:9987,TEXTURE_MAG_FILTER:10240,TEXTURE_MIN_FILTER:10241,TEXTURE_WRAP_S:10242,TEXTURE_WRAP_T:10243,TEXTURE_2D:3553,TEXTURE:5890,TEXTURE_CUBE_MAP:34067,TEXTURE_BINDING_CUBE_MAP:34068,TEXTURE_CUBE_MAP_POSITIVE_X:34069,TEXTURE_CUBE_MAP_NEGATIVE_X:34070,TEXTURE_CUBE_MAP_POSITIVE_Y:34071,TEXTURE_CUBE_MAP_NEGATIVE_Y:34072,TEXTURE_CUBE_MAP_POSITIVE_Z:34073,TEXTURE_CUBE_MAP_NEGATIVE_Z:34074,MAX_CUBE_MAP_TEXTURE_SIZE:34076,TEXTURE0:33984,TEXTURE1:33985,TEXTURE2:33986,TEXTURE3:33987,TEXTURE4:33988,TEXTURE5:33989,TEXTURE6:33990,TEXTURE7:33991,TEXTURE8:33992,TEXTURE9:33993,TEXTURE10:33994,TEXTURE11:33995,TEXTURE12:33996,TEXTURE13:33997,TEXTURE14:33998,TEXTURE15:33999,TEXTURE16:34e3,TEXTURE17:34001,TEXTURE18:34002,TEXTURE19:34003,TEXTURE20:34004,TEXTURE21:34005,TEXTURE22:34006,TEXTURE23:34007,TEXTURE24:34008,TEXTURE25:34009,TEXTURE26:34010,TEXTURE27:34011,TEXTURE28:34012,TEXTURE29:34013,TEXTURE30:34014,TEXTURE31:34015,ACTIVE_TEXTURE:34016,REPEAT:10497,CLAMP_TO_EDGE:33071,MIRRORED_REPEAT:33648,FLOAT_VEC2:35664,FLOAT_VEC3:35665,FLOAT_VEC4:35666,INT_VEC2:35667,INT_VEC3:35668,INT_VEC4:35669,BOOL:35670,BOOL_VEC2:35671,BOOL_VEC3:35672,BOOL_VEC4:35673,FLOAT_MAT2:35674,FLOAT_MAT3:35675,FLOAT_MAT4:35676,SAMPLER_2D:35678,SAMPLER_CUBE:35680,VERTEX_ATTRIB_ARRAY_ENABLED:34338,VERTEX_ATTRIB_ARRAY_SIZE:34339,VERTEX_ATTRIB_ARRAY_STRIDE:34340,VERTEX_ATTRIB_ARRAY_TYPE:34341,VERTEX_ATTRIB_ARRAY_NORMALIZED:34922,VERTEX_ATTRIB_ARRAY_POINTER:34373,VERTEX_ATTRIB_ARRAY_BUFFER_BINDING:34975,IMPLEMENTATION_COLOR_READ_TYPE:35738,IMPLEMENTATION_COLOR_READ_FORMAT:35739,COMPILE_STATUS:35713,LOW_FLOAT:36336,MEDIUM_FLOAT:36337,HIGH_FLOAT:36338,LOW_INT:36339,MEDIUM_INT:36340,HIGH_INT:36341,FRAMEBUFFER:36160,RENDERBUFFER:36161,RGBA4:32854,RGB5_A1:32855,RGB565:36194,DEPTH_COMPONENT16:33189,STENCIL_INDEX:6401,STENCIL_INDEX8:36168,DEPTH_STENCIL:34041,RENDERBUFFER_WIDTH:36162,RENDERBUFFER_HEIGHT:36163,RENDERBUFFER_INTERNAL_FORMAT:36164,RENDERBUFFER_RED_SIZE:36176,RENDERBUFFER_GREEN_SIZE:36177,RENDERBUFFER_BLUE_SIZE:36178,RENDERBUFFER_ALPHA_SIZE:36179,RENDERBUFFER_DEPTH_SIZE:36180,RENDERBUFFER_STENCIL_SIZE:36181,FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE:36048,FRAMEBUFFER_ATTACHMENT_OBJECT_NAME:36049,FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL:36050,FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE:36051,COLOR_ATTACHMENT0:36064,DEPTH_ATTACHMENT:36096,STENCIL_ATTACHMENT:36128,DEPTH_STENCIL_ATTACHMENT:33306,NONE:0,FRAMEBUFFER_COMPLETE:36053,FRAMEBUFFER_INCOMPLETE_ATTACHMENT:36054,FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT:36055,FRAMEBUFFER_INCOMPLETE_DIMENSIONS:36057,FRAMEBUFFER_UNSUPPORTED:36061,FRAMEBUFFER_BINDING:36006,RENDERBUFFER_BINDING:36007,MAX_RENDERBUFFER_SIZE:34024,INVALID_FRAMEBUFFER_OPERATION:1286,UNPACK_FLIP_Y_WEBGL:37440,UNPACK_PREMULTIPLY_ALPHA_WEBGL:37441,CONTEXT_LOST_WEBGL:37442,UNPACK_COLORSPACE_CONVERSION_WEBGL:37443,BROWSER_DEFAULT_WEBGL:37444,COMPRESSED_RGB_S3TC_DXT1_EXT:33776,COMPRESSED_RGBA_S3TC_DXT1_EXT:33777,COMPRESSED_RGBA_S3TC_DXT3_EXT:33778,COMPRESSED_RGBA_S3TC_DXT5_EXT:33779,COMPRESSED_RGB_PVRTC_4BPPV1_IMG:35840,COMPRESSED_RGB_PVRTC_2BPPV1_IMG:35841,COMPRESSED_RGBA_PVRTC_4BPPV1_IMG:35842,COMPRESSED_RGBA_PVRTC_2BPPV1_IMG:35843,COMPRESSED_RGBA_ASTC_4x4_WEBGL:37808,COMPRESSED_RGB_ETC1_WEBGL:36196,COMPRESSED_RGBA_BPTC_UNORM:36492,HALF_FLOAT_OES:36193,DOUBLE:5130,READ_BUFFER:3074,UNPACK_ROW_LENGTH:3314,UNPACK_SKIP_ROWS:3315,UNPACK_SKIP_PIXELS:3316,PACK_ROW_LENGTH:3330,PACK_SKIP_ROWS:3331,PACK_SKIP_PIXELS:3332,COLOR:6144,DEPTH:6145,STENCIL:6146,RED:6403,RGB8:32849,RGBA8:32856,RGB10_A2:32857,TEXTURE_BINDING_3D:32874,UNPACK_SKIP_IMAGES:32877,UNPACK_IMAGE_HEIGHT:32878,TEXTURE_3D:32879,TEXTURE_WRAP_R:32882,MAX_3D_TEXTURE_SIZE:32883,UNSIGNED_INT_2_10_10_10_REV:33640,MAX_ELEMENTS_VERTICES:33e3,MAX_ELEMENTS_INDICES:33001,TEXTURE_MIN_LOD:33082,TEXTURE_MAX_LOD:33083,TEXTURE_BASE_LEVEL:33084,TEXTURE_MAX_LEVEL:33085,MIN:32775,MAX:32776,DEPTH_COMPONENT24:33190,MAX_TEXTURE_LOD_BIAS:34045,TEXTURE_COMPARE_MODE:34892,TEXTURE_COMPARE_FUNC:34893,CURRENT_QUERY:34917,QUERY_RESULT:34918,QUERY_RESULT_AVAILABLE:34919,STREAM_READ:35041,STREAM_COPY:35042,STATIC_READ:35045,STATIC_COPY:35046,DYNAMIC_READ:35049,DYNAMIC_COPY:35050,MAX_DRAW_BUFFERS:34852,DRAW_BUFFER0:34853,DRAW_BUFFER1:34854,DRAW_BUFFER2:34855,DRAW_BUFFER3:34856,DRAW_BUFFER4:34857,DRAW_BUFFER5:34858,DRAW_BUFFER6:34859,DRAW_BUFFER7:34860,DRAW_BUFFER8:34861,DRAW_BUFFER9:34862,DRAW_BUFFER10:34863,DRAW_BUFFER11:34864,DRAW_BUFFER12:34865,DRAW_BUFFER13:34866,DRAW_BUFFER14:34867,DRAW_BUFFER15:34868,MAX_FRAGMENT_UNIFORM_COMPONENTS:35657,MAX_VERTEX_UNIFORM_COMPONENTS:35658,SAMPLER_3D:35679,SAMPLER_2D_SHADOW:35682,FRAGMENT_SHADER_DERIVATIVE_HINT:35723,PIXEL_PACK_BUFFER:35051,PIXEL_UNPACK_BUFFER:35052,PIXEL_PACK_BUFFER_BINDING:35053,PIXEL_UNPACK_BUFFER_BINDING:35055,FLOAT_MAT2x3:35685,FLOAT_MAT2x4:35686,FLOAT_MAT3x2:35687,FLOAT_MAT3x4:35688,FLOAT_MAT4x2:35689,FLOAT_MAT4x3:35690,SRGB:35904,SRGB8:35905,SRGB8_ALPHA8:35907,COMPARE_REF_TO_TEXTURE:34894,RGBA32F:34836,RGB32F:34837,RGBA16F:34842,RGB16F:34843,VERTEX_ATTRIB_ARRAY_INTEGER:35069,MAX_ARRAY_TEXTURE_LAYERS:35071,MIN_PROGRAM_TEXEL_OFFSET:35076,MAX_PROGRAM_TEXEL_OFFSET:35077,MAX_VARYING_COMPONENTS:35659,TEXTURE_2D_ARRAY:35866,TEXTURE_BINDING_2D_ARRAY:35869,R11F_G11F_B10F:35898,UNSIGNED_INT_10F_11F_11F_REV:35899,RGB9_E5:35901,UNSIGNED_INT_5_9_9_9_REV:35902,TRANSFORM_FEEDBACK_BUFFER_MODE:35967,MAX_TRANSFORM_FEEDBACK_SEPARATE_COMPONENTS:35968,TRANSFORM_FEEDBACK_VARYINGS:35971,TRANSFORM_FEEDBACK_BUFFER_START:35972,TRANSFORM_FEEDBACK_BUFFER_SIZE:35973,TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN:35976,RASTERIZER_DISCARD:35977,MAX_TRANSFORM_FEEDBACK_INTERLEAVED_COMPONENTS:35978,MAX_TRANSFORM_FEEDBACK_SEPARATE_ATTRIBS:35979,INTERLEAVED_ATTRIBS:35980,SEPARATE_ATTRIBS:35981,TRANSFORM_FEEDBACK_BUFFER:35982,TRANSFORM_FEEDBACK_BUFFER_BINDING:35983,RGBA32UI:36208,RGB32UI:36209,RGBA16UI:36214,RGB16UI:36215,RGBA8UI:36220,RGB8UI:36221,RGBA32I:36226,RGB32I:36227,RGBA16I:36232,RGB16I:36233,RGBA8I:36238,RGB8I:36239,RED_INTEGER:36244,RGB_INTEGER:36248,RGBA_INTEGER:36249,SAMPLER_2D_ARRAY:36289,SAMPLER_2D_ARRAY_SHADOW:36292,SAMPLER_CUBE_SHADOW:36293,UNSIGNED_INT_VEC2:36294,UNSIGNED_INT_VEC3:36295,UNSIGNED_INT_VEC4:36296,INT_SAMPLER_2D:36298,INT_SAMPLER_3D:36299,INT_SAMPLER_CUBE:36300,INT_SAMPLER_2D_ARRAY:36303,UNSIGNED_INT_SAMPLER_2D:36306,UNSIGNED_INT_SAMPLER_3D:36307,UNSIGNED_INT_SAMPLER_CUBE:36308,UNSIGNED_INT_SAMPLER_2D_ARRAY:36311,DEPTH_COMPONENT32F:36012,DEPTH32F_STENCIL8:36013,FLOAT_32_UNSIGNED_INT_24_8_REV:36269,FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING:33296,FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE:33297,FRAMEBUFFER_ATTACHMENT_RED_SIZE:33298,FRAMEBUFFER_ATTACHMENT_GREEN_SIZE:33299,FRAMEBUFFER_ATTACHMENT_BLUE_SIZE:33300,FRAMEBUFFER_ATTACHMENT_ALPHA_SIZE:33301,FRAMEBUFFER_ATTACHMENT_DEPTH_SIZE:33302,FRAMEBUFFER_ATTACHMENT_STENCIL_SIZE:33303,FRAMEBUFFER_DEFAULT:33304,UNSIGNED_INT_24_8:34042,DEPTH24_STENCIL8:35056,UNSIGNED_NORMALIZED:35863,DRAW_FRAMEBUFFER_BINDING:36006,READ_FRAMEBUFFER:36008,DRAW_FRAMEBUFFER:36009,READ_FRAMEBUFFER_BINDING:36010,RENDERBUFFER_SAMPLES:36011,FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER:36052,MAX_COLOR_ATTACHMENTS:36063,COLOR_ATTACHMENT1:36065,COLOR_ATTACHMENT2:36066,COLOR_ATTACHMENT3:36067,COLOR_ATTACHMENT4:36068,COLOR_ATTACHMENT5:36069,COLOR_ATTACHMENT6:36070,COLOR_ATTACHMENT7:36071,COLOR_ATTACHMENT8:36072,COLOR_ATTACHMENT9:36073,COLOR_ATTACHMENT10:36074,COLOR_ATTACHMENT11:36075,COLOR_ATTACHMENT12:36076,COLOR_ATTACHMENT13:36077,COLOR_ATTACHMENT14:36078,COLOR_ATTACHMENT15:36079,FRAMEBUFFER_INCOMPLETE_MULTISAMPLE:36182,MAX_SAMPLES:36183,HALF_FLOAT:5131,RG:33319,RG_INTEGER:33320,R8:33321,RG8:33323,R16F:33325,R32F:33326,RG16F:33327,RG32F:33328,R8I:33329,R8UI:33330,R16I:33331,R16UI:33332,R32I:33333,R32UI:33334,RG8I:33335,RG8UI:33336,RG16I:33337,RG16UI:33338,RG32I:33339,RG32UI:33340,VERTEX_ARRAY_BINDING:34229,R8_SNORM:36756,RG8_SNORM:36757,RGB8_SNORM:36758,RGBA8_SNORM:36759,SIGNED_NORMALIZED:36764,COPY_READ_BUFFER:36662,COPY_WRITE_BUFFER:36663,COPY_READ_BUFFER_BINDING:36662,COPY_WRITE_BUFFER_BINDING:36663,UNIFORM_BUFFER:35345,UNIFORM_BUFFER_BINDING:35368,UNIFORM_BUFFER_START:35369,UNIFORM_BUFFER_SIZE:35370,MAX_VERTEX_UNIFORM_BLOCKS:35371,MAX_FRAGMENT_UNIFORM_BLOCKS:35373,MAX_COMBINED_UNIFORM_BLOCKS:35374,MAX_UNIFORM_BUFFER_BINDINGS:35375,MAX_UNIFORM_BLOCK_SIZE:35376,MAX_COMBINED_VERTEX_UNIFORM_COMPONENTS:35377,MAX_COMBINED_FRAGMENT_UNIFORM_COMPONENTS:35379,UNIFORM_BUFFER_OFFSET_ALIGNMENT:35380,ACTIVE_UNIFORM_BLOCKS:35382,UNIFORM_TYPE:35383,UNIFORM_SIZE:35384,UNIFORM_BLOCK_INDEX:35386,UNIFORM_OFFSET:35387,UNIFORM_ARRAY_STRIDE:35388,UNIFORM_MATRIX_STRIDE:35389,UNIFORM_IS_ROW_MAJOR:35390,UNIFORM_BLOCK_BINDING:35391,UNIFORM_BLOCK_DATA_SIZE:35392,UNIFORM_BLOCK_ACTIVE_UNIFORMS:35394,UNIFORM_BLOCK_ACTIVE_UNIFORM_INDICES:35395,UNIFORM_BLOCK_REFERENCED_BY_VERTEX_SHADER:35396,UNIFORM_BLOCK_REFERENCED_BY_FRAGMENT_SHADER:35398,INVALID_INDEX:4294967295,MAX_VERTEX_OUTPUT_COMPONENTS:37154,MAX_FRAGMENT_INPUT_COMPONENTS:37157,MAX_SERVER_WAIT_TIMEOUT:37137,OBJECT_TYPE:37138,SYNC_CONDITION:37139,SYNC_STATUS:37140,SYNC_FLAGS:37141,SYNC_FENCE:37142,SYNC_GPU_COMMANDS_COMPLETE:37143,UNSIGNALED:37144,SIGNALED:37145,ALREADY_SIGNALED:37146,TIMEOUT_EXPIRED:37147,CONDITION_SATISFIED:37148,WAIT_FAILED:37149,SYNC_FLUSH_COMMANDS_BIT:1,VERTEX_ATTRIB_ARRAY_DIVISOR:35070,ANY_SAMPLES_PASSED:35887,ANY_SAMPLES_PASSED_CONSERVATIVE:36202,SAMPLER_BINDING:35097,RGB10_A2UI:36975,INT_2_10_10_10_REV:36255,TRANSFORM_FEEDBACK:36386,TRANSFORM_FEEDBACK_PAUSED:36387,TRANSFORM_FEEDBACK_ACTIVE:36388,TRANSFORM_FEEDBACK_BINDING:36389,COMPRESSED_R11_EAC:37488,COMPRESSED_SIGNED_R11_EAC:37489,COMPRESSED_RG11_EAC:37490,COMPRESSED_SIGNED_RG11_EAC:37491,COMPRESSED_RGB8_ETC2:37492,COMPRESSED_SRGB8_ETC2:37493,COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2:37494,COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2:37495,COMPRESSED_RGBA8_ETC2_EAC:37496,COMPRESSED_SRGB8_ALPHA8_ETC2_EAC:37497,TEXTURE_IMMUTABLE_FORMAT:37167,MAX_ELEMENT_INDEX:36203,TEXTURE_IMMUTABLE_LEVELS:33503,MAX_TEXTURE_MAX_ANISOTROPY_EXT:34047};Object.freeze(Zae);var te=Zae;var h3e=new h;function Ot(e){this._size=e.size,this._datatype=e.datatype,this.getValue=e.getValue}var Ga={};Ga[te.FLOAT]="float";Ga[te.FLOAT_VEC2]="vec2";Ga[te.FLOAT_VEC3]="vec3";Ga[te.FLOAT_VEC4]="vec4";Ga[te.INT]="int";Ga[te.INT_VEC2]="ivec2";Ga[te.INT_VEC3]="ivec3";Ga[te.INT_VEC4]="ivec4";Ga[te.BOOL]="bool";Ga[te.BOOL_VEC2]="bvec2";Ga[te.BOOL_VEC3]="bvec3";Ga[te.BOOL_VEC4]="bvec4";Ga[te.FLOAT_MAT2]="mat2";Ga[te.FLOAT_MAT3]="mat3";Ga[te.FLOAT_MAT4]="mat4";Ga[te.SAMPLER_2D]="sampler2D";Ga[te.SAMPLER_CUBE]="samplerCube";Ot.prototype.getDeclaration=function(e){let t=`uniform ${Ga[this._datatype]} ${e}`,n=this._size;return n===1?t+=";":t+=`[${n.toString()}];`,t};var m3e={czm_viewport:new Ot({size:1,datatype:te.FLOAT_VEC4,getValue:function(e){return e.viewportCartesian4}}),czm_viewportOrthographic:new Ot({size:1,datatype:te.FLOAT_MAT4,getValue:function(e){return e.viewportOrthographic}}),czm_viewportTransformation:new Ot({size:1,datatype:te.FLOAT_MAT4,getValue:function(e){return e.viewportTransformation}}),czm_globeDepthTexture:new Ot({size:1,datatype:te.SAMPLER_2D,getValue:function(e){return e.globeDepthTexture}}),czm_edgeIdTexture:new Ot({size:1,datatype:te.SAMPLER_2D,getValue:function(e){return e.edgeIdTexture}}),czm_edgeColorTexture:new Ot({size:1,datatype:te.SAMPLER_2D,getValue:function(e){return e.edgeColorTexture}}),czm_edgeDepthTexture:new Ot({size:1,datatype:te.SAMPLER_2D,getValue:function(e){return e.edgeDepthTexture}}),czm_planarFillIdTexture:new Ot({size:1,datatype:te.SAMPLER_2D,getValue:function(e){return e.planarFillIdTexture}}),czm_model:new Ot({size:1,datatype:te.FLOAT_MAT4,getValue:function(e){return e.model}}),czm_inverseModel:new Ot({size:1,datatype:te.FLOAT_MAT4,getValue:function(e){return e.inverseModel}}),czm_view:new Ot({size:1,datatype:te.FLOAT_MAT4,getValue:function(e){return e.view}}),czm_view3D:new Ot({size:1,datatype:te.FLOAT_MAT4,getValue:function(e){return e.view3D}}),czm_viewRotation:new Ot({size:1,datatype:te.FLOAT_MAT3,getValue:function(e){return e.viewRotation}}),czm_viewRotation3D:new Ot({size:1,datatype:te.FLOAT_MAT3,getValue:function(e){return e.viewRotation3D}}),czm_inverseView:new Ot({size:1,datatype:te.FLOAT_MAT4,getValue:function(e){return e.inverseView}}),czm_inverseView3D:new Ot({size:1,datatype:te.FLOAT_MAT4,getValue:function(e){return e.inverseView3D}}),czm_inverseViewRotation:new Ot({size:1,datatype:te.FLOAT_MAT3,getValue:function(e){return e.inverseViewRotation}}),czm_inverseViewRotation3D:new Ot({size:1,datatype:te.FLOAT_MAT3,getValue:function(e){return e.inverseViewRotation3D}}),czm_projection:new Ot({size:1,datatype:te.FLOAT_MAT4,getValue:function(e){return e.projection}}),czm_inverseProjection:new Ot({size:1,datatype:te.FLOAT_MAT4,getValue:function(e){return e.inverseProjection}}),czm_infiniteProjection:new Ot({size:1,datatype:te.FLOAT_MAT4,getValue:function(e){return e.infiniteProjection}}),czm_modelView:new Ot({size:1,datatype:te.FLOAT_MAT4,getValue:function(e){return e.modelView}}),czm_modelView3D:new Ot({size:1,datatype:te.FLOAT_MAT4,getValue:function(e){return e.modelView3D}}),czm_modelViewRelativeToEye:new Ot({size:1,datatype:te.FLOAT_MAT4,getValue:function(e){return e.modelViewRelativeToEye}}),czm_inverseModelView:new Ot({size:1,datatype:te.FLOAT_MAT4,getValue:function(e){return e.inverseModelView}}),czm_inverseModelView3D:new Ot({size:1,datatype:te.FLOAT_MAT4,getValue:function(e){return e.inverseModelView3D}}),czm_viewProjection:new Ot({size:1,datatype:te.FLOAT_MAT4,getValue:function(e){return e.viewProjection}}),czm_inverseViewProjection:new Ot({size:1,datatype:te.FLOAT_MAT4,getValue:function(e){return e.inverseViewProjection}}),czm_modelViewProjection:new Ot({size:1,datatype:te.FLOAT_MAT4,getValue:function(e){return e.modelViewProjection}}),czm_inverseModelViewProjection:new Ot({size:1,datatype:te.FLOAT_MAT4,getValue:function(e){return e.inverseModelViewProjection}}),czm_modelViewProjectionRelativeToEye:new Ot({size:1,datatype:te.FLOAT_MAT4,getValue:function(e){return e.modelViewProjectionRelativeToEye}}),czm_modelViewInfiniteProjection:new Ot({size:1,datatype:te.FLOAT_MAT4,getValue:function(e){return e.modelViewInfiniteProjection}}),czm_orthographicIn3D:new Ot({size:1,datatype:te.FLOAT,getValue:function(e){return e.orthographicIn3D?1:0}}),czm_normal:new Ot({size:1,datatype:te.FLOAT_MAT3,getValue:function(e){return e.normal}}),czm_normal3D:new Ot({size:1,datatype:te.FLOAT_MAT3,getValue:function(e){return e.normal3D}}),czm_inverseNormal:new Ot({size:1,datatype:te.FLOAT_MAT3,getValue:function(e){return e.inverseNormal}}),czm_inverseNormal3D:new Ot({size:1,datatype:te.FLOAT_MAT3,getValue:function(e){return e.inverseNormal3D}}),czm_eyeHeight:new Ot({size:1,datatype:te.FLOAT,getValue:function(e){return e.eyeHeight}}),czm_eyeCartographic:new Ot({size:1,datatype:te.FLOAT_VEC3,getValue:function(e){return e.eyeCartographic}}),czm_eyeHeight2D:new Ot({size:1,datatype:te.FLOAT_VEC2,getValue:function(e){return e.eyeHeight2D}}),czm_eyeEllipsoidNormalEC:new Ot({size:1,datatype:te.FLOAT_VEC3,getValue:function(e){return e.eyeEllipsoidNormalEC}}),czm_eyeEllipsoidCurvature:new Ot({size:1,datatype:te.FLOAT_VEC2,getValue:function(e){return e.eyeEllipsoidCurvature}}),czm_eyeToEnu:new Ot({size:1,datatype:te.FLOAT_MAT3,getValue:function(e){return e.eyeToEnu}}),czm_modelToEnu:new Ot({size:1,datatype:te.FLOAT_MAT4,getValue:function(e){return e.modelToEnu}}),czm_enuToModel:new Ot({size:1,datatype:te.FLOAT_MAT4,getValue:function(e){return e.enuToModel}}),czm_entireFrustum:new Ot({size:1,datatype:te.FLOAT_VEC2,getValue:function(e){return e.entireFrustum}}),czm_currentFrustum:new Ot({size:1,datatype:te.FLOAT_VEC2,getValue:function(e){return e.currentFrustum}}),czm_frustumPlanes:new Ot({size:1,datatype:te.FLOAT_VEC4,getValue:function(e){return e.frustumPlanes}}),czm_farDepthFromNearPlusOne:new Ot({size:1,datatype:te.FLOAT,getValue:function(e){return e.farDepthFromNearPlusOne}}),czm_log2FarDepthFromNearPlusOne:new Ot({size:1,datatype:te.FLOAT,getValue:function(e){return e.log2FarDepthFromNearPlusOne}}),czm_oneOverLog2FarDepthFromNearPlusOne:new Ot({size:1,datatype:te.FLOAT,getValue:function(e){return e.oneOverLog2FarDepthFromNearPlusOne}}),czm_sunPositionWC:new Ot({size:1,datatype:te.FLOAT_VEC3,getValue:function(e){return e.sunPositionWC}}),czm_sunPositionColumbusView:new Ot({size:1,datatype:te.FLOAT_VEC3,getValue:function(e){return e.sunPositionColumbusView}}),czm_sunDirectionEC:new Ot({size:1,datatype:te.FLOAT_VEC3,getValue:function(e){return e.sunDirectionEC}}),czm_sunDirectionWC:new Ot({size:1,datatype:te.FLOAT_VEC3,getValue:function(e){return e.sunDirectionWC}}),czm_moonDirectionEC:new Ot({size:1,datatype:te.FLOAT_VEC3,getValue:function(e){return e.moonDirectionEC}}),czm_lightDirectionEC:new Ot({size:1,datatype:te.FLOAT_VEC3,getValue:function(e){return e.lightDirectionEC}}),czm_lightDirectionWC:new Ot({size:1,datatype:te.FLOAT_VEC3,getValue:function(e){return e.lightDirectionWC}}),czm_lightColor:new Ot({size:1,datatype:te.FLOAT_VEC3,getValue:function(e){return e.lightColor}}),czm_lightColorHdr:new Ot({size:1,datatype:te.FLOAT_VEC3,getValue:function(e){return e.lightColorHdr}}),czm_encodedCameraPositionMCHigh:new Ot({size:1,datatype:te.FLOAT_VEC3,getValue:function(e){return e.encodedCameraPositionMCHigh}}),czm_encodedCameraPositionMCLow:new Ot({size:1,datatype:te.FLOAT_VEC3,getValue:function(e){return e.encodedCameraPositionMCLow}}),czm_viewerPositionWC:new Ot({size:1,datatype:te.FLOAT_VEC3,getValue:function(e){return M.getTranslation(e.inverseView,h3e)}}),czm_frameNumber:new Ot({size:1,datatype:te.FLOAT,getValue:function(e){return e.frameState.frameNumber}}),czm_morphTime:new Ot({size:1,datatype:te.FLOAT,getValue:function(e){return e.frameState.morphTime}}),czm_sceneMode:new Ot({size:1,datatype:te.FLOAT,getValue:function(e){return e.frameState.mode}}),czm_pass:new Ot({size:1,datatype:te.FLOAT,getValue:function(e){return e.pass}}),czm_backgroundColor:new Ot({size:1,datatype:te.FLOAT_VEC4,getValue:function(e){return e.backgroundColor}}),czm_brdfLut:new Ot({size:1,datatype:te.SAMPLER_2D,getValue:function(e){return e.brdfLut}}),czm_environmentMap:new Ot({size:1,datatype:te.SAMPLER_CUBE,getValue:function(e){return e.environmentMap}}),czm_specularEnvironmentMaps:new Ot({size:1,datatype:te.SAMPLER_CUBE,getValue:function(e){return e.specularEnvironmentMaps}}),czm_specularEnvironmentMapsMaximumLOD:new Ot({size:1,datatype:te.FLOAT,getValue:function(e){return e.specularEnvironmentMapsMaximumLOD}}),czm_sphericalHarmonicCoefficients:new Ot({size:9,datatype:te.FLOAT_VEC3,getValue:function(e){return e.sphericalHarmonicCoefficients}}),czm_temeToPseudoFixed:new Ot({size:1,datatype:te.FLOAT_MAT3,getValue:function(e){return e.temeToPseudoFixedMatrix}}),czm_pixelRatio:new Ot({size:1,datatype:te.FLOAT,getValue:function(e){return e.pixelRatio}}),czm_fogDensity:new Ot({size:1,datatype:te.FLOAT,getValue:function(e){return e.fogDensity}}),czm_fogVisualDensityScalar:new Ot({size:1,datatype:te.FLOAT,getValue:function(e){return e.fogVisualDensityScalar}}),czm_fogMinimumBrightness:new Ot({size:1,datatype:te.FLOAT,getValue:function(e){return e.fogMinimumBrightness}}),czm_atmosphereHsbShift:new Ot({size:1,datatype:te.FLOAT_VEC3,getValue:function(e){return e.atmosphereHsbShift}}),czm_atmosphereLightIntensity:new Ot({size:1,datatype:te.FLOAT,getValue:function(e){return e.atmosphereLightIntensity}}),czm_atmosphereRayleighCoefficient:new Ot({size:1,datatype:te.FLOAT_VEC3,getValue:function(e){return e.atmosphereRayleighCoefficient}}),czm_atmosphereRayleighScaleHeight:new Ot({size:1,datatype:te.FLOAT,getValue:function(e){return e.atmosphereRayleighScaleHeight}}),czm_atmosphereMieCoefficient:new Ot({size:1,datatype:te.FLOAT_VEC3,getValue:function(e){return e.atmosphereMieCoefficient}}),czm_atmosphereMieScaleHeight:new Ot({size:1,datatype:te.FLOAT,getValue:function(e){return e.atmosphereMieScaleHeight}}),czm_atmosphereMieAnisotropy:new Ot({size:1,datatype:te.FLOAT,getValue:function(e){return e.atmosphereMieAnisotropy}}),czm_atmosphereDynamicLighting:new Ot({size:1,datatype:te.FLOAT,getValue:function(e){return e.atmosphereDynamicLighting}}),czm_splitPosition:new Ot({size:1,datatype:te.FLOAT,getValue:function(e){return e.splitPosition}}),czm_geometricToleranceOverMeter:new Ot({size:1,datatype:te.FLOAT,getValue:function(e){return e.geometricToleranceOverMeter}}),czm_minimumDisableDepthTestDistance:new Ot({size:1,datatype:te.FLOAT,getValue:function(e){return e.minimumDisableDepthTestDistance}}),czm_invertClassificationColor:new Ot({size:1,datatype:te.FLOAT_VEC4,getValue:function(e){return e.invertClassificationColor}}),czm_gamma:new Ot({size:1,datatype:te.FLOAT,getValue:function(e){return e.gamma}}),czm_ellipsoidRadii:new Ot({size:1,datatype:te.FLOAT_VEC3,getValue:function(e){return e.ellipsoid.radii}}),czm_ellipsoidInverseRadii:new Ot({size:1,datatype:te.FLOAT_VEC3,getValue:function(e){return e.ellipsoid.oneOverRadii}})},T_=m3e;function p3e(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(e){let t=Math.random()*16|0;return(e==="x"?t:t&3|8).toString(16)})}var Kn=p3e;function g3e(){return!0}function _3e(e,t){t=t??"This object was destroyed, i.e., destroy() was called.";function n(){}for(let i in e)typeof e[i]=="function"&&(e[i]=n);e.isDestroyed=g3e}var le=_3e;var ra={UNSIGNED_BYTE:te.UNSIGNED_BYTE,UNSIGNED_SHORT:te.UNSIGNED_SHORT,UNSIGNED_INT:te.UNSIGNED_INT};ra.getSizeInBytes=function(e){switch(e){case ra.UNSIGNED_BYTE:return Uint8Array.BYTES_PER_ELEMENT;case ra.UNSIGNED_SHORT:return Uint16Array.BYTES_PER_ELEMENT;case ra.UNSIGNED_INT:return Uint32Array.BYTES_PER_ELEMENT}};ra.fromSizeInBytes=function(e){switch(e){case 2:return ra.UNSIGNED_SHORT;case 4:return ra.UNSIGNED_INT;case 1:return ra.UNSIGNED_BYTE}};ra.validate=function(e){return l(e)&&(e===ra.UNSIGNED_BYTE||e===ra.UNSIGNED_SHORT||e===ra.UNSIGNED_INT)};ra.createTypedArray=function(e,t){return e>=P.SIXTY_FOUR_KILOBYTES?new Uint32Array(t):new Uint16Array(t)};ra.createTypedArrayFromArrayBuffer=function(e,t,n,i){return e>=P.SIXTY_FOUR_KILOBYTES?new Uint32Array(t,n,i):new Uint16Array(t,n,i)};ra.fromTypedArray=function(e){if(e instanceof Uint8Array)return ra.UNSIGNED_BYTE;if(e instanceof Uint16Array)return ra.UNSIGNED_SHORT;if(e instanceof Uint32Array)return ra.UNSIGNED_INT};Object.freeze(ra);var je=ra;var pb={STREAM_DRAW:te.STREAM_DRAW,STATIC_DRAW:te.STATIC_DRAW,DYNAMIC_DRAW:te.DYNAMIC_DRAW,DYNAMIC_READ:te.DYNAMIC_READ};pb.validate=function(e){return e===pb.STREAM_DRAW||e===pb.STATIC_DRAW||e===pb.DYNAMIC_DRAW||e===pb.DYNAMIC_READ};Object.freeze(pb);var Me=pb;function Lc(e){e=e??H.EMPTY_OBJECT;let t=e.context._gl,n=e.bufferTarget,i=e.typedArray,r=e.sizeInBytes,o=e.usage,s=l(i);s&&(r=i.byteLength);let a=t.createBuffer();t.bindBuffer(n,a),t.bufferData(n,s?i:r,o),t.bindBuffer(n,null),this._id=Kn(),this._gl=t,this._webgl2=e.context._webgl2,this._bufferTarget=n,this._sizeInBytes=r,this._usage=o,this._buffer=a,this.vertexArrayDestroyable=!0}Lc.createPixelBuffer=function(e){if(!e.context._webgl2)throw new pe("A WebGL 2 context is required to create PixelBuffers.");return new Lc({context:e.context,bufferTarget:te.PIXEL_PACK_BUFFER,typedArray:e.typedArray,sizeInBytes:e.sizeInBytes,usage:e.usage})};Lc.createVertexBuffer=function(e){return new Lc({context:e.context,bufferTarget:te.ARRAY_BUFFER,typedArray:e.typedArray,sizeInBytes:e.sizeInBytes,usage:e.usage})};Lc.createIndexBuffer=function(e){let t=e.context,n=e.indexDatatype,i=je.getSizeInBytes(n),r=new Lc({context:t,bufferTarget:te.ELEMENT_ARRAY_BUFFER,typedArray:e.typedArray,sizeInBytes:e.sizeInBytes,usage:e.usage}),o=r.sizeInBytes/i;return Object.defineProperties(r,{indexDatatype:{get:function(){return n}},bytesPerIndex:{get:function(){return i}},numberOfIndices:{get:function(){return o}}}),r};Object.defineProperties(Lc.prototype,{sizeInBytes:{get:function(){return this._sizeInBytes}},usage:{get:function(){return this._usage}}});Lc.prototype._getBuffer=function(){return this._buffer};Lc.prototype._bind=function(){let e=this._gl,t=this._bufferTarget;e.bindBuffer(t,this._buffer)};Lc.prototype._unBind=function(){let e=this._gl,t=this._bufferTarget;e.bindBuffer(t,null)};Lc.prototype.copyFromArrayView=function(e,t){t=t??0;let n=this._gl,i=this._bufferTarget;n.bindBuffer(i,this._buffer),n.bufferSubData(i,t,e),n.bindBuffer(i,null)};Lc.prototype.copyFromBuffer=function(e,t,n,i){let r=te.COPY_READ_BUFFER,o=te.COPY_WRITE_BUFFER,s=this._gl;s.bindBuffer(o,this._buffer),s.bindBuffer(r,e._buffer),s.copyBufferSubData(r,o,t,n,i),s.bindBuffer(o,null),s.bindBuffer(r,null)};Lc.prototype.getBufferData=function(e,t,n,i){t=t??0,n=n??0;let r=this._gl,o=te.COPY_READ_BUFFER;r.bindBuffer(o,this._buffer),r.getBufferSubData(o,t,e,n,i),r.bindBuffer(o,null)};Lc.prototype.isDestroyed=function(){return!1};Lc.prototype.destroy=function(){return this._gl.deleteBuffer(this._buffer),le(this)};var tt=Lc;var E_,os={requestFullscreen:void 0,exitFullscreen:void 0,fullscreenEnabled:void 0,fullscreenElement:void 0,fullscreenchange:void 0,fullscreenerror:void 0},ru={};Object.defineProperties(ru,{element:{get:function(){if(ru.supportsFullscreen())return document[os.fullscreenElement]}},changeEventName:{get:function(){if(ru.supportsFullscreen())return os.fullscreenchange}},errorEventName:{get:function(){if(ru.supportsFullscreen())return os.fullscreenerror}},enabled:{get:function(){if(ru.supportsFullscreen())return document[os.fullscreenEnabled]}},fullscreen:{get:function(){if(ru.supportsFullscreen())return ru.element!==null}}});ru.supportsFullscreen=function(){if(l(E_))return E_;E_=!1;let e=document.body;if(typeof e.requestFullscreen=="function")return os.requestFullscreen="requestFullscreen",os.exitFullscreen="exitFullscreen",os.fullscreenEnabled="fullscreenEnabled",os.fullscreenElement="fullscreenElement",os.fullscreenchange="fullscreenchange",os.fullscreenerror="fullscreenerror",E_=!0,E_;let t=["webkit","moz","o","ms","khtml"],n;for(let i=0,r=t.length;i<r;++i){let o=t[i];n=`${o}RequestFullscreen`,typeof e[n]=="function"?(os.requestFullscreen=n,E_=!0):(n=`${o}RequestFullScreen`,typeof e[n]=="function"&&(os.requestFullscreen=n,E_=!0)),n=`${o}ExitFullscreen`,typeof document[n]=="function"?os.exitFullscreen=n:(n=`${o}CancelFullScreen`,typeof document[n]=="function"&&(os.exitFullscreen=n)),n=`${o}FullscreenEnabled`,document[n]!==void 0?os.fullscreenEnabled=n:(n=`${o}FullScreenEnabled`,document[n]!==void 0&&(os.fullscreenEnabled=n)),n=`${o}FullscreenElement`,document[n]!==void 0?os.fullscreenElement=n:(n=`${o}FullScreenElement`,document[n]!==void 0&&(os.fullscreenElement=n)),n=`${o}fullscreenchange`,document[`on${n}`]!==void 0&&(o==="ms"&&(n="MSFullscreenChange"),os.fullscreenchange=n),n=`${o}fullscreenerror`,document[`on${n}`]!==void 0&&(o==="ms"&&(n="MSFullscreenError"),os.fullscreenerror=n)}return E_};ru.requestFullscreen=function(e,t){ru.supportsFullscreen()&&e[os.requestFullscreen]({vrDisplay:t})};ru.exitFullscreen=function(){ru.supportsFullscreen()&&document[os.exitFullscreen]()};ru._names=os;var ss=ru;var Xf;typeof navigator<"u"?Xf=navigator:Xf={};function BI(e){let t=e.split(".");for(let n=0,i=t.length;n<i;++n)t[n]=parseInt(t[n],10);return t}var uN,Qae;function xq(){if(!l(uN)&&(uN=!1,!gN())){let e=/ Chrome\/([\.0-9]+)/.exec(Xf.userAgent);e!==null&&(uN=!0,Qae=BI(e[1]))}return uN}function y3e(){return xq()&&Qae}var fN,ece;function tce(){if(!l(fN)&&(fN=!1,!xq()&&!gN()&&/ Safari\/[\.0-9]+/.test(Xf.userAgent))){let e=/ Version\/([\.0-9]+)/.exec(Xf.userAgent);e!==null&&(fN=!0,ece=BI(e[1]))}return fN}function A3e(){return tce()&&ece}var dN,bq;function nce(){if(!l(dN)){dN=!1;let e=/ AppleWebKit\/([\.0-9]+)(\+?)/.exec(Xf.userAgent);e!==null&&(dN=!0,bq=BI(e[1]),bq.isNightly=!!e[2])}return dN}function b3e(){return nce()&&bq}var hN,ice;function gN(){if(!l(hN)){hN=!1;let e=/ Edg\/([\.0-9]+)/.exec(Xf.userAgent);e!==null&&(hN=!0,ice=BI(e[1]))}return hN}function x3e(){return gN()&&ice}var mN,Tq;function _N(){if(!l(mN)){mN=!1;let e=/Firefox\/([\.0-9]+)/.exec(Xf.userAgent);e!==null&&(mN=!0,Tq=BI(e[1]))}return mN}var _q;function T3e(){return l(_q)||(_q=/Windows/i.test(Xf.appVersion)),_q}var yq;function E3e(){return l(yq)||(yq=navigator.platform==="iPhone"||navigator.platform==="iPod"||navigator.platform==="iPad"),yq}function C3e(){return _N()&&Tq}var Aq;function v3e(){return l(Aq)||(Aq=!_N()&&typeof PointerEvent<"u"&&(!l(Xf.pointerEnabled)||Xf.pointerEnabled)),Aq}var rce,pN;function oce(){if(!l(pN)){let e=document.createElement("canvas");e.setAttribute("style","image-rendering: -moz-crisp-edges;image-rendering: pixelated;");let t=e.style.imageRendering;pN=l(t)&&t!=="",pN&&(rce=t)}return pN}function S3e(){return oce()?rce:void 0}function bl(){return bl._result}bl._promise=void 0;bl._result=void 0;bl.initialize=function(){return l(bl._promise)||(bl._promise=new Promise(e=>{let t=new Image;t.onload=function(){bl._result=t.width>0&&t.height>0,e(bl._result)},t.onerror=function(){bl._result=!1,e(bl._result)},t.src="data:image/webp;base64,UklGRiIAAABXRUJQVlA4IBYAAAAwAQCdASoBAAEADsD+JaQAA3AAAAAA"})),bl._promise};Object.defineProperties(bl,{initialized:{get:function(){return l(bl._result)}}});var bE=[];typeof ArrayBuffer<"u"&&(bE.push(Int8Array,Uint8Array,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array),typeof Uint8ClampedArray<"u"&&bE.push(Uint8ClampedArray),typeof Uint8ClampedArray<"u"&&bE.push(Uint8ClampedArray),typeof BigInt64Array<"u"&&bE.push(BigInt64Array),typeof BigUint64Array<"u"&&bE.push(BigUint64Array));var Kf={isChrome:xq,chromeVersion:y3e,isSafari:tce,safariVersion:A3e,isWebkit:nce,webkitVersion:b3e,isEdge:gN,edgeVersion:x3e,isFirefox:_N,firefoxVersion:C3e,isWindows:T3e,isIPadOrIOS:E3e,hardwareConcurrency:Xf.hardwareConcurrency??3,supportsPointerEvents:v3e,supportsImageRenderingPixelated:oce,supportsWebP:bl,imageRenderingValue:S3e,typedArrayTypes:bE};Kf.supportsBasis=function(e){return Kf.supportsWebAssembly()&&e.context.supportsBasis};Kf.supportsFullscreen=function(){return ss.supportsFullscreen()};Kf.supportsTypedArrays=function(){return typeof ArrayBuffer<"u"};Kf.supportsBigInt64Array=function(){return typeof BigInt64Array<"u"};Kf.supportsBigUint64Array=function(){return typeof BigUint64Array<"u"};Kf.supportsBigInt=function(){return typeof BigInt<"u"};Kf.supportsWebWorkers=function(){return typeof Worker<"u"};Kf.supportsWebAssembly=function(){return typeof WebAssembly<"u"};Kf.supportsWebgl2=function(e){return e.context.webgl2};Kf.supportsEsmWebWorkers=function(){return!_N()||parseInt(Tq)>=114};var dn=Kf;function Eq(e,t,n){return n<0&&(n+=1),n>1&&(n-=1),n*6<1?e+(t-e)*6*n:n*2<1?t:n*3<2?e+(t-e)*(2/3-n)*6:e}var _e=class e{constructor(t,n,i,r){this.red=t??1,this.green=n??1,this.blue=i??1,this.alpha=r??1}static fromCartesian4(t,n){return l(n)?(n.red=t.x,n.green=t.y,n.blue=t.z,n.alpha=t.w,n):new e(t.x,t.y,t.z,t.w)}static fromBytes(t,n,i,r,o){return t=e.byteToFloat(t??255),n=e.byteToFloat(n??255),i=e.byteToFloat(i??255),r=e.byteToFloat(r??255),l(o)?(o.red=t,o.green=n,o.blue=i,o.alpha=r,o):new e(t,n,i,r)}static fromAlpha(t,n,i){return l(i)?(i.red=t.red,i.green=t.green,i.blue=t.blue,i.alpha=n,i):new e(t.red,t.green,t.blue,n)}static fromRgba(t,n){return vq[0]=t,e.fromBytes(D0[0],D0[1],D0[2],D0[3],n)}static fromHsl(t,n,i,r,o){t=(t??0)%1,n=n??0,i=i??0,r=r??1;let s=i,a=i,c=i;if(n!==0){let u;i<.5?u=i*(1+n):u=i+n-i*n;let f=2*i-u;s=Eq(f,u,t+1/3),a=Eq(f,u,t),c=Eq(f,u,t-1/3)}return l(o)?(o.red=s,o.green=a,o.blue=c,o.alpha=r,o):new e(s,a,c,r)}static fromRandom(t,n){t=t??H.EMPTY_OBJECT;let i=t.red;if(!l(i)){let a=t.minimumRed??0,c=t.maximumRed??1;i=a+P.nextRandomNumber()*(c-a)}let r=t.green;if(!l(r)){let a=t.minimumGreen??0,c=t.maximumGreen??1;r=a+P.nextRandomNumber()*(c-a)}let o=t.blue;if(!l(o)){let a=t.minimumBlue??0,c=t.maximumBlue??1;o=a+P.nextRandomNumber()*(c-a)}let s=t.alpha;if(!l(s)){let a=t.minimumAlpha??0,c=t.maximumAlpha??1;s=a+P.nextRandomNumber()*(c-a)}return l(n)?(n.red=i,n.green=r,n.blue=o,n.alpha=s,n):new e(i,r,o,s)}static fromCssColorString(t,n){l(n)||(n=new e),t=t.trim();let i=e[t.toUpperCase()];if(l(i))return e.clone(i,n),n;let r=w3e.exec(t);return r!==null?(n.red=parseInt(r[1],16)/15,n.green=parseInt(r[2],16)/15,n.blue=parseInt(r[3],16)/15,n.alpha=parseInt(r[4]??"f",16)/15,n):(r=I3e.exec(t),r!==null?(n.red=parseInt(r[1],16)/255,n.green=parseInt(r[2],16)/255,n.blue=parseInt(r[3],16)/255,n.alpha=parseInt(r[4]??"ff",16)/255,n):(r=P3e.exec(t),r!==null?(n.red=parseFloat(r[1])/(r[1].substr(-1)==="%"?100:255),n.green=parseFloat(r[2])/(r[2].substr(-1)==="%"?100:255),n.blue=parseFloat(r[3])/(r[3].substr(-1)==="%"?100:255),n.alpha=parseFloat(r[4]??"1.0"),n):(r=D3e.exec(t),r!==null?e.fromHsl(parseFloat(r[1])/360,parseFloat(r[2])/100,parseFloat(r[3])/100,parseFloat(r[4]??"1.0"),n):(n=void 0,n))))}static pack(t,n,i){return i=i??0,n[i++]=t.red,n[i++]=t.green,n[i++]=t.blue,n[i]=t.alpha,n}static unpack(t,n,i){return n=n??0,l(i)||(i=new e),i.red=t[n++],i.green=t[n++],i.blue=t[n++],i.alpha=t[n],i}static byteToFloat(t){return t/255}static floatToByte(t){return t===1?255:t*256|0}static clone(t,n){if(l(t))return l(n)?(n.red=t.red,n.green=t.green,n.blue=t.blue,n.alpha=t.alpha,n):new e(t.red,t.green,t.blue,t.alpha)}static equals(t,n){return t===n||l(t)&&l(n)&&t.red===n.red&&t.green===n.green&&t.blue===n.blue&&t.alpha===n.alpha}static equalsArray(t,n,i){return t.red===n[i]&&t.green===n[i+1]&&t.blue===n[i+2]&&t.alpha===n[i+3]}clone(t){return e.clone(this,t)}equals(t){return e.equals(this,t)}equalsEpsilon(t,n){return this===t||l(t)&&Math.abs(this.red-t.red)<=n&&Math.abs(this.green-t.green)<=n&&Math.abs(this.blue-t.blue)<=n&&Math.abs(this.alpha-t.alpha)<=n}toString(){return`(${this.red}, ${this.green}, ${this.blue}, ${this.alpha})`}toCssColorString(){let t=e.floatToByte(this.red),n=e.floatToByte(this.green),i=e.floatToByte(this.blue);return this.alpha===1?`rgb(${t},${n},${i})`:`rgba(${t},${n},${i},${this.alpha})`}toCssHexString(){let t=e.floatToByte(this.red).toString(16);t.length<2&&(t=`0${t}`);let n=e.floatToByte(this.green).toString(16);n.length<2&&(n=`0${n}`);let i=e.floatToByte(this.blue).toString(16);if(i.length<2&&(i=`0${i}`),this.alpha<1){let r=e.floatToByte(this.alpha).toString(16);return r.length<2&&(r=`0${r}`),`#${t}${n}${i}${r}`}return`#${t}${n}${i}`}toBytes(t){let n=e.floatToByte(this.red),i=e.floatToByte(this.green),r=e.floatToByte(this.blue),o=e.floatToByte(this.alpha);return l(t)?(t[0]=n,t[1]=i,t[2]=r,t[3]=o,t):[n,i,r,o]}static bytesToRgba(t,n,i,r){return D0[0]=t,D0[1]=n,D0[2]=i,D0[3]=r,vq[0]}toRgba(){return e.bytesToRgba(e.floatToByte(this.red),e.floatToByte(this.green),e.floatToByte(this.blue),e.floatToByte(this.alpha))}brighten(t,n){return t=1-t,n.red=1-(1-this.red)*t,n.green=1-(1-this.green)*t,n.blue=1-(1-this.blue)*t,n.alpha=this.alpha,n}darken(t,n){return t=1-t,n.red=this.red*t,n.green=this.green*t,n.blue=this.blue*t,n.alpha=this.alpha,n}withAlpha(t,n){return e.fromAlpha(this,t,n)}static add(t,n,i){return i.red=t.red+n.red,i.green=t.green+n.green,i.blue=t.blue+n.blue,i.alpha=t.alpha+n.alpha,i}static subtract(t,n,i){return i.red=t.red-n.red,i.green=t.green-n.green,i.blue=t.blue-n.blue,i.alpha=t.alpha-n.alpha,i}static multiply(t,n,i){return i.red=t.red*n.red,i.green=t.green*n.green,i.blue=t.blue*n.blue,i.alpha=t.alpha*n.alpha,i}static divide(t,n,i){return i.red=t.red/n.red,i.green=t.green/n.green,i.blue=t.blue/n.blue,i.alpha=t.alpha/n.alpha,i}static mod(t,n,i){return i.red=t.red%n.red,i.green=t.green%n.green,i.blue=t.blue%n.blue,i.alpha=t.alpha%n.alpha,i}static lerp(t,n,i,r){return r.red=P.lerp(t.red,n.red,i),r.green=P.lerp(t.green,n.green,i),r.blue=P.lerp(t.blue,n.blue,i),r.alpha=P.lerp(t.alpha,n.alpha,i),r}static multiplyByScalar(t,n,i){return i.red=t.red*n,i.green=t.green*n,i.blue=t.blue*n,i.alpha=t.alpha*n,i}static divideByScalar(t,n,i){return i.red=t.red/n,i.green=t.green/n,i.blue=t.blue/n,i.alpha=t.alpha/n,i}},Cq,vq,D0;dn.supportsTypedArrays()&&(Cq=new ArrayBuffer(4),vq=new Uint32Array(Cq),D0=new Uint8Array(Cq));var w3e=/^#([0-9a-f])([0-9a-f])([0-9a-f])([0-9a-f])?$/i,I3e=/^#([0-9a-f]{2})([0-9a-f]{2})([0-9a-f]{2})([0-9a-f]{2})?$/i,P3e=/^rgba?\s*\(\s*([0-9.]+%?)\s*[,\s]+\s*([0-9.]+%?)\s*[,\s]+\s*([0-9.]+%?)(?:\s*[,\s/]+\s*([0-9.]+))?\s*\)$/i,D3e=/^hsla?\s*\(\s*([0-9.]+)\s*[,\s]+\s*([0-9.]+%)\s*[,\s]+\s*([0-9.]+%)(?:\s*[,\s/]+\s*([0-9.]+))?\s*\)$/i;_e.packedLength=4;_e.ALICEBLUE=Object.freeze(_e.fromCssColorString("#F0F8FF"));_e.ANTIQUEWHITE=Object.freeze(_e.fromCssColorString("#FAEBD7"));_e.AQUA=Object.freeze(_e.fromCssColorString("#00FFFF"));_e.AQUAMARINE=Object.freeze(_e.fromCssColorString("#7FFFD4"));_e.AZURE=Object.freeze(_e.fromCssColorString("#F0FFFF"));_e.BEIGE=Object.freeze(_e.fromCssColorString("#F5F5DC"));_e.BISQUE=Object.freeze(_e.fromCssColorString("#FFE4C4"));_e.BLACK=Object.freeze(_e.fromCssColorString("#000000"));_e.BLANCHEDALMOND=Object.freeze(_e.fromCssColorString("#FFEBCD"));_e.BLUE=Object.freeze(_e.fromCssColorString("#0000FF"));_e.BLUEVIOLET=Object.freeze(_e.fromCssColorString("#8A2BE2"));_e.BROWN=Object.freeze(_e.fromCssColorString("#A52A2A"));_e.BURLYWOOD=Object.freeze(_e.fromCssColorString("#DEB887"));_e.CADETBLUE=Object.freeze(_e.fromCssColorString("#5F9EA0"));_e.CHARTREUSE=Object.freeze(_e.fromCssColorString("#7FFF00"));_e.CHOCOLATE=Object.freeze(_e.fromCssColorString("#D2691E"));_e.CORAL=Object.freeze(_e.fromCssColorString("#FF7F50"));_e.CORNFLOWERBLUE=Object.freeze(_e.fromCssColorString("#6495ED"));_e.CORNSILK=Object.freeze(_e.fromCssColorString("#FFF8DC"));_e.CRIMSON=Object.freeze(_e.fromCssColorString("#DC143C"));_e.CYAN=Object.freeze(_e.fromCssColorString("#00FFFF"));_e.DARKBLUE=Object.freeze(_e.fromCssColorString("#00008B"));_e.DARKCYAN=Object.freeze(_e.fromCssColorString("#008B8B"));_e.DARKGOLDENROD=Object.freeze(_e.fromCssColorString("#B8860B"));_e.DARKGRAY=Object.freeze(_e.fromCssColorString("#A9A9A9"));_e.DARKGREEN=Object.freeze(_e.fromCssColorString("#006400"));_e.DARKGREY=_e.DARKGRAY;_e.DARKKHAKI=Object.freeze(_e.fromCssColorString("#BDB76B"));_e.DARKMAGENTA=Object.freeze(_e.fromCssColorString("#8B008B"));_e.DARKOLIVEGREEN=Object.freeze(_e.fromCssColorString("#556B2F"));_e.DARKORANGE=Object.freeze(_e.fromCssColorString("#FF8C00"));_e.DARKORCHID=Object.freeze(_e.fromCssColorString("#9932CC"));_e.DARKRED=Object.freeze(_e.fromCssColorString("#8B0000"));_e.DARKSALMON=Object.freeze(_e.fromCssColorString("#E9967A"));_e.DARKSEAGREEN=Object.freeze(_e.fromCssColorString("#8FBC8F"));_e.DARKSLATEBLUE=Object.freeze(_e.fromCssColorString("#483D8B"));_e.DARKSLATEGRAY=Object.freeze(_e.fromCssColorString("#2F4F4F"));_e.DARKSLATEGREY=_e.DARKSLATEGRAY;_e.DARKTURQUOISE=Object.freeze(_e.fromCssColorString("#00CED1"));_e.DARKVIOLET=Object.freeze(_e.fromCssColorString("#9400D3"));_e.DEEPPINK=Object.freeze(_e.fromCssColorString("#FF1493"));_e.DEEPSKYBLUE=Object.freeze(_e.fromCssColorString("#00BFFF"));_e.DIMGRAY=Object.freeze(_e.fromCssColorString("#696969"));_e.DIMGREY=_e.DIMGRAY;_e.DODGERBLUE=Object.freeze(_e.fromCssColorString("#1E90FF"));_e.FIREBRICK=Object.freeze(_e.fromCssColorString("#B22222"));_e.FLORALWHITE=Object.freeze(_e.fromCssColorString("#FFFAF0"));_e.FORESTGREEN=Object.freeze(_e.fromCssColorString("#228B22"));_e.FUCHSIA=Object.freeze(_e.fromCssColorString("#FF00FF"));_e.GAINSBORO=Object.freeze(_e.fromCssColorString("#DCDCDC"));_e.GHOSTWHITE=Object.freeze(_e.fromCssColorString("#F8F8FF"));_e.GOLD=Object.freeze(_e.fromCssColorString("#FFD700"));_e.GOLDENROD=Object.freeze(_e.fromCssColorString("#DAA520"));_e.GRAY=Object.freeze(_e.fromCssColorString("#808080"));_e.GREEN=Object.freeze(_e.fromCssColorString("#008000"));_e.GREENYELLOW=Object.freeze(_e.fromCssColorString("#ADFF2F"));_e.GREY=_e.GRAY;_e.HONEYDEW=Object.freeze(_e.fromCssColorString("#F0FFF0"));_e.HOTPINK=Object.freeze(_e.fromCssColorString("#FF69B4"));_e.INDIANRED=Object.freeze(_e.fromCssColorString("#CD5C5C"));_e.INDIGO=Object.freeze(_e.fromCssColorString("#4B0082"));_e.IVORY=Object.freeze(_e.fromCssColorString("#FFFFF0"));_e.KHAKI=Object.freeze(_e.fromCssColorString("#F0E68C"));_e.LAVENDER=Object.freeze(_e.fromCssColorString("#E6E6FA"));_e.LAVENDAR_BLUSH=Object.freeze(_e.fromCssColorString("#FFF0F5"));_e.LAWNGREEN=Object.freeze(_e.fromCssColorString("#7CFC00"));_e.LEMONCHIFFON=Object.freeze(_e.fromCssColorString("#FFFACD"));_e.LIGHTBLUE=Object.freeze(_e.fromCssColorString("#ADD8E6"));_e.LIGHTCORAL=Object.freeze(_e.fromCssColorString("#F08080"));_e.LIGHTCYAN=Object.freeze(_e.fromCssColorString("#E0FFFF"));_e.LIGHTGOLDENRODYELLOW=Object.freeze(_e.fromCssColorString("#FAFAD2"));_e.LIGHTGRAY=Object.freeze(_e.fromCssColorString("#D3D3D3"));_e.LIGHTGREEN=Object.freeze(_e.fromCssColorString("#90EE90"));_e.LIGHTGREY=_e.LIGHTGRAY;_e.LIGHTPINK=Object.freeze(_e.fromCssColorString("#FFB6C1"));_e.LIGHTSEAGREEN=Object.freeze(_e.fromCssColorString("#20B2AA"));_e.LIGHTSKYBLUE=Object.freeze(_e.fromCssColorString("#87CEFA"));_e.LIGHTSLATEGRAY=Object.freeze(_e.fromCssColorString("#778899"));_e.LIGHTSLATEGREY=_e.LIGHTSLATEGRAY;_e.LIGHTSTEELBLUE=Object.freeze(_e.fromCssColorString("#B0C4DE"));_e.LIGHTYELLOW=Object.freeze(_e.fromCssColorString("#FFFFE0"));_e.LIME=Object.freeze(_e.fromCssColorString("#00FF00"));_e.LIMEGREEN=Object.freeze(_e.fromCssColorString("#32CD32"));_e.LINEN=Object.freeze(_e.fromCssColorString("#FAF0E6"));_e.MAGENTA=Object.freeze(_e.fromCssColorString("#FF00FF"));_e.MAROON=Object.freeze(_e.fromCssColorString("#800000"));_e.MEDIUMAQUAMARINE=Object.freeze(_e.fromCssColorString("#66CDAA"));_e.MEDIUMBLUE=Object.freeze(_e.fromCssColorString("#0000CD"));_e.MEDIUMORCHID=Object.freeze(_e.fromCssColorString("#BA55D3"));_e.MEDIUMPURPLE=Object.freeze(_e.fromCssColorString("#9370DB"));_e.MEDIUMSEAGREEN=Object.freeze(_e.fromCssColorString("#3CB371"));_e.MEDIUMSLATEBLUE=Object.freeze(_e.fromCssColorString("#7B68EE"));_e.MEDIUMSPRINGGREEN=Object.freeze(_e.fromCssColorString("#00FA9A"));_e.MEDIUMTURQUOISE=Object.freeze(_e.fromCssColorString("#48D1CC"));_e.MEDIUMVIOLETRED=Object.freeze(_e.fromCssColorString("#C71585"));_e.MIDNIGHTBLUE=Object.freeze(_e.fromCssColorString("#191970"));_e.MINTCREAM=Object.freeze(_e.fromCssColorString("#F5FFFA"));_e.MISTYROSE=Object.freeze(_e.fromCssColorString("#FFE4E1"));_e.MOCCASIN=Object.freeze(_e.fromCssColorString("#FFE4B5"));_e.NAVAJOWHITE=Object.freeze(_e.fromCssColorString("#FFDEAD"));_e.NAVY=Object.freeze(_e.fromCssColorString("#000080"));_e.OLDLACE=Object.freeze(_e.fromCssColorString("#FDF5E6"));_e.OLIVE=Object.freeze(_e.fromCssColorString("#808000"));_e.OLIVEDRAB=Object.freeze(_e.fromCssColorString("#6B8E23"));_e.ORANGE=Object.freeze(_e.fromCssColorString("#FFA500"));_e.ORANGERED=Object.freeze(_e.fromCssColorString("#FF4500"));_e.ORCHID=Object.freeze(_e.fromCssColorString("#DA70D6"));_e.PALEGOLDENROD=Object.freeze(_e.fromCssColorString("#EEE8AA"));_e.PALEGREEN=Object.freeze(_e.fromCssColorString("#98FB98"));_e.PALETURQUOISE=Object.freeze(_e.fromCssColorString("#AFEEEE"));_e.PALEVIOLETRED=Object.freeze(_e.fromCssColorString("#DB7093"));_e.PAPAYAWHIP=Object.freeze(_e.fromCssColorString("#FFEFD5"));_e.PEACHPUFF=Object.freeze(_e.fromCssColorString("#FFDAB9"));_e.PERU=Object.freeze(_e.fromCssColorString("#CD853F"));_e.PINK=Object.freeze(_e.fromCssColorString("#FFC0CB"));_e.PLUM=Object.freeze(_e.fromCssColorString("#DDA0DD"));_e.POWDERBLUE=Object.freeze(_e.fromCssColorString("#B0E0E6"));_e.PURPLE=Object.freeze(_e.fromCssColorString("#800080"));_e.RED=Object.freeze(_e.fromCssColorString("#FF0000"));_e.ROSYBROWN=Object.freeze(_e.fromCssColorString("#BC8F8F"));_e.ROYALBLUE=Object.freeze(_e.fromCssColorString("#4169E1"));_e.SADDLEBROWN=Object.freeze(_e.fromCssColorString("#8B4513"));_e.SALMON=Object.freeze(_e.fromCssColorString("#FA8072"));_e.SANDYBROWN=Object.freeze(_e.fromCssColorString("#F4A460"));_e.SEAGREEN=Object.freeze(_e.fromCssColorString("#2E8B57"));_e.SEASHELL=Object.freeze(_e.fromCssColorString("#FFF5EE"));_e.SIENNA=Object.freeze(_e.fromCssColorString("#A0522D"));_e.SILVER=Object.freeze(_e.fromCssColorString("#C0C0C0"));_e.SKYBLUE=Object.freeze(_e.fromCssColorString("#87CEEB"));_e.SLATEBLUE=Object.freeze(_e.fromCssColorString("#6A5ACD"));_e.SLATEGRAY=Object.freeze(_e.fromCssColorString("#708090"));_e.SLATEGREY=_e.SLATEGRAY;_e.SNOW=Object.freeze(_e.fromCssColorString("#FFFAFA"));_e.SPRINGGREEN=Object.freeze(_e.fromCssColorString("#00FF7F"));_e.STEELBLUE=Object.freeze(_e.fromCssColorString("#4682B4"));_e.TAN=Object.freeze(_e.fromCssColorString("#D2B48C"));_e.TEAL=Object.freeze(_e.fromCssColorString("#008080"));_e.THISTLE=Object.freeze(_e.fromCssColorString("#D8BFD8"));_e.TOMATO=Object.freeze(_e.fromCssColorString("#FF6347"));_e.TURQUOISE=Object.freeze(_e.fromCssColorString("#40E0D0"));_e.VIOLET=Object.freeze(_e.fromCssColorString("#EE82EE"));_e.WHEAT=Object.freeze(_e.fromCssColorString("#F5DEB3"));_e.WHITE=Object.freeze(_e.fromCssColorString("#FFFFFF"));_e.WHITESMOKE=Object.freeze(_e.fromCssColorString("#F5F5F5"));_e.YELLOW=Object.freeze(_e.fromCssColorString("#FFFF00"));_e.YELLOWGREEN=Object.freeze(_e.fromCssColorString("#9ACD32"));_e.TRANSPARENT=Object.freeze(new _e(0,0,0,0));var z=_e;function yN(e){e=e??H.EMPTY_OBJECT,this.color=e.color,this.depth=e.depth,this.stencil=e.stencil,this.renderState=e.renderState,this.framebuffer=e.framebuffer,this.owner=e.owner,this.pass=e.pass}yN.ALL=Object.freeze(new yN({color:new z(0,0,0,0),depth:1,stencil:0}));yN.prototype.execute=function(e,t){e.clear(this,t)};var fi=yN;var sce={ENVIRONMENT:0,COMPUTE:1,GLOBE:2,TERRAIN_CLASSIFICATION:3,CESIUM_3D_TILE_EDGES:4,CESIUM_3D_TILE_PLANAR_FILL_ID:5,CESIUM_3D_TILE:6,CESIUM_3D_TILE_CLASSIFICATION:7,CESIUM_3D_TILE_CLASSIFICATION_IGNORE_SHOW:8,OPAQUE:9,TRANSLUCENT:10,VOXELS:11,GAUSSIAN_SPLATS:12,CESIUM_3D_TILE_EDGES_DIRECT:13,OVERLAY:14,NUMBER_OF_PASSES:15};Object.freeze(sce);var Ie=sce;function ace(e){e=e??H.EMPTY_OBJECT,this.vertexArray=e.vertexArray,this.fragmentShaderSource=e.fragmentShaderSource,this.shaderProgram=e.shaderProgram,this.uniformMap=e.uniformMap,this.outputTexture=e.outputTexture,this.preExecute=e.preExecute,this.postExecute=e.postExecute,this.canceled=e.canceled,this.persists=e.persists??!1,this.pass=Ie.COMPUTE,this.owner=e.owner}ace.prototype.execute=function(e){e.execute(this)};var $f=ace;var as=class e{constructor(t,n){this.x=t??0,this.y=n??0}static fromElements(t,n,i){return l(i)?(i.x=t,i.y=n,i):new e(t,n)}static clone(t,n){if(l(t))return l(n)?(n.x=t.x,n.y=t.y,n):new e(t.x,t.y)}static pack(t,n,i){return i=i??0,n[i++]=t.x,n[i]=t.y,n}static unpack(t,n,i){return n=n??0,l(i)||(i=new e),i.x=t[n++],i.y=t[n],i}static packArray(t,n){let i=t.length,r=i*2;l(n)?!Array.isArray(n)&&n.length!==r||n.length!==r&&(n.length=r):n=new Array(r);for(let o=0;o<i;++o)e.pack(t[o],n,o*2);return n}static unpackArray(t,n){let i=t.length;l(n)?n.length=i/2:n=new Array(i/2);for(let r=0;r<i;r+=2){let o=r/2;n[o]=e.unpack(t,r,n[o])}return n}static maximumComponent(t){return Math.max(t.x,t.y)}static minimumComponent(t){return Math.min(t.x,t.y)}static minimumByComponent(t,n,i){return i.x=Math.min(t.x,n.x),i.y=Math.min(t.y,n.y),i}static maximumByComponent(t,n,i){return i.x=Math.max(t.x,n.x),i.y=Math.max(t.y,n.y),i}static clamp(t,n,i,r){let o=P.clamp(t.x,n.x,i.x),s=P.clamp(t.y,n.y,i.y);return r.x=o,r.y=s,r}static magnitudeSquared(t){return t.x*t.x+t.y*t.y}static magnitude(t){return Math.sqrt(e.magnitudeSquared(t))}static distance(t,n){return e.subtract(t,n,AN),e.magnitude(AN)}static distanceSquared(t,n){return e.subtract(t,n,AN),e.magnitudeSquared(AN)}static normalize(t,n){let i=e.magnitude(t);return n.x=t.x/i,n.y=t.y/i,n}static dot(t,n){return t.x*n.x+t.y*n.y}static cross(t,n){return t.x*n.y-t.y*n.x}static multiplyComponents(t,n,i){return i.x=t.x*n.x,i.y=t.y*n.y,i}static divideComponents(t,n,i){return i.x=t.x/n.x,i.y=t.y/n.y,i}static add(t,n,i){return i.x=t.x+n.x,i.y=t.y+n.y,i}static subtract(t,n,i){return i.x=t.x-n.x,i.y=t.y-n.y,i}static multiplyByScalar(t,n,i){return i.x=t.x*n,i.y=t.y*n,i}static divideByScalar(t,n,i){return i.x=t.x/n,i.y=t.y/n,i}static negate(t,n){return n.x=-t.x,n.y=-t.y,n}static abs(t,n){return n.x=Math.abs(t.x),n.y=Math.abs(t.y),n}static lerp(t,n,i,r){return e.multiplyByScalar(n,i,cce),r=e.multiplyByScalar(t,1-i,r),e.add(cce,r,r)}static angleBetween(t,n){return e.normalize(t,lce),e.normalize(n,uce),P.acosClamped(e.dot(lce,uce))}static mostOrthogonalAxis(t,n){let i=e.normalize(t,R3e);return e.abs(i,i),i.x<=i.y?n=e.clone(e.UNIT_X,n):n=e.clone(e.UNIT_Y,n),n}static equals(t,n){return t===n||l(t)&&l(n)&&t.x===n.x&&t.y===n.y}static equalsArray(t,n,i){return t.x===n[i]&&t.y===n[i+1]}static equalsEpsilon(t,n,i,r){return t===n||l(t)&&l(n)&&P.equalsEpsilon(t.x,n.x,i,r)&&P.equalsEpsilon(t.y,n.y,i,r)}clone(t){return e.clone(this,t)}equals(t){return e.equals(this,t)}equalsEpsilon(t,n,i){return e.equalsEpsilon(this,t,n,i)}toString(){return`(${this.x}, ${this.y})`}};as.fromCartesian3=as.clone;as.fromCartesian4=as.clone;as.packedLength=2;as.fromArray=as.unpack;var AN=new as,cce=new as,lce=new as,uce=new as,R3e=new as;as.ZERO=Object.freeze(new as(0,0));as.ONE=Object.freeze(new as(1,1));as.UNIT_X=Object.freeze(new as(1,0));as.UNIT_Y=Object.freeze(new as(0,1));var U=as;var O3e=new h,M3e=new h;function N3e(e,t,n,i,r){let o=e.x,s=e.y,a=e.z,c=t.x,u=t.y,f=t.z,d=o*o*c*c,p=s*s*u*u,g=a*a*f*f,m=d+p+g,y=Math.sqrt(1/m),A=h.multiplyByScalar(e,y,O3e);if(m<i)return isFinite(y)?h.clone(A,r):void 0;let b=n.x,x=n.y,T=n.z,E=M3e;E.x=A.x*b*2,E.y=A.y*x*2,E.z=A.z*T*2;let v=(1-y)*h.magnitude(e)/(.5*h.magnitude(E)),S=0,I,R,O,L,_,C,w,D,N,F,V;do{v-=S,O=1/(1+v*b),L=1/(1+v*x),_=1/(1+v*T),C=O*O,w=L*L,D=_*_,N=C*O,F=w*L,V=D*_,I=d*C+p*w+g*D-1,R=d*N*b+p*F*x+g*V*T;let B=-2*R;S=I/B}while(Math.abs(I)>P.EPSILON12);return l(r)?(r.x=o*O,r.y=s*L,r.z=a*_,r):new h(o*O,s*L,a*_)}var xE=N3e;var xl=class xl{constructor(t,n,i){this.longitude=t??0,this.latitude=n??0,this.height=i??0}static fromRadians(t,n,i,r){return i=i??0,l(r)?(r.longitude=t,r.latitude=n,r.height=i,r):new xl(t,n,i)}static fromDegrees(t,n,i,r){return t=P.toRadians(t),n=P.toRadians(n),xl.fromRadians(t,n,i,r)}static fromCartesian(t,n,i){let r=l(n)?n.oneOverRadii:xl._ellipsoidOneOverRadii,o=l(n)?n.oneOverRadiiSquared:xl._ellipsoidOneOverRadiiSquared,s=l(n)?n._centerToleranceSquared:xl._ellipsoidCenterToleranceSquared,a=xE(t,r,o,s,F3e);if(!l(a))return;let c=h.multiplyComponents(a,o,L3e);c=h.normalize(c,c);let u=h.subtract(t,a,B3e),f=Math.atan2(c.y,c.x),d=Math.asin(c.z),p=P.sign(h.dot(u,t))*h.magnitude(u);return l(i)?(i.longitude=f,i.latitude=d,i.height=p,i):new xl(f,d,p)}static toCartesian(t,n,i){return h.fromRadians(t.longitude,t.latitude,t.height,n,i)}static clone(t,n){if(l(t))return l(n)?(n.longitude=t.longitude,n.latitude=t.latitude,n.height=t.height,n):new xl(t.longitude,t.latitude,t.height)}static equals(t,n){return t===n||l(t)&&l(n)&&t.longitude===n.longitude&&t.latitude===n.latitude&&t.height===n.height}static equalsEpsilon(t,n,i){return i=i??0,t===n||l(t)&&l(n)&&Math.abs(t.longitude-n.longitude)<=i&&Math.abs(t.latitude-n.latitude)<=i&&Math.abs(t.height-n.height)<=i}clone(t){return xl.clone(this,t)}equals(t){return xl.equals(this,t)}equalsEpsilon(t,n){return xl.equalsEpsilon(this,t,n)}toString(){return`(${this.longitude}, ${this.latitude}, ${this.height})`}};ut(xl,"_ellipsoidOneOverRadii",new h(1/6378137,1/6378137,1/6356752314245179e-9)),ut(xl,"_ellipsoidOneOverRadiiSquared",new h(1/(6378137*6378137),1/(6378137*6378137),1/(6356752314245179e-9*6356752314245179e-9))),ut(xl,"_ellipsoidCenterToleranceSquared",P.EPSILON1);var kI=xl;kI.ZERO=Object.freeze(new kI(0,0,0));var L3e=new h,F3e=new h,B3e=new h,he=kI;function fce(e,t,n,i){t=t??0,n=n??0,i=i??0,e._radii=new h(t,n,i),e._radiiSquared=new h(t*t,n*n,i*i),e._radiiToTheFourth=new h(t*t*t*t,n*n*n*n,i*i*i*i),e._oneOverRadii=new h(t===0?0:1/t,n===0?0:1/n,i===0?0:1/i),e._oneOverRadiiSquared=new h(t===0?0:1/(t*t),n===0?0:1/(n*n),i===0?0:1/(i*i)),e._minimumRadius=Math.min(t,n,i),e._maximumRadius=Math.max(t,n,i),e._centerToleranceSquared=P.EPSILON1,e._radiiSquared.z!==0&&(e._squaredXOverSquaredZ=e._radiiSquared.x/e._radiiSquared.z)}var Tl=class e{constructor(t,n,i){this._radii=void 0,this._radiiSquared=void 0,this._radiiToTheFourth=void 0,this._oneOverRadii=void 0,this._oneOverRadiiSquared=void 0,this._minimumRadius=void 0,this._maximumRadius=void 0,this._centerToleranceSquared=void 0,this._squaredXOverSquaredZ=void 0,fce(this,t,n,i)}get radii(){return this._radii}get radiiSquared(){return this._radiiSquared}get radiiToTheFourth(){return this._radiiToTheFourth}get oneOverRadii(){return this._oneOverRadii}get oneOverRadiiSquared(){return this._oneOverRadiiSquared}get minimumRadius(){return this._minimumRadius}get maximumRadius(){return this._maximumRadius}static clone(t,n){if(!l(t))return;let i=t._radii;return l(n)?(h.clone(i,n._radii),h.clone(t._radiiSquared,n._radiiSquared),h.clone(t._radiiToTheFourth,n._radiiToTheFourth),h.clone(t._oneOverRadii,n._oneOverRadii),h.clone(t._oneOverRadiiSquared,n._oneOverRadiiSquared),n._minimumRadius=t._minimumRadius,n._maximumRadius=t._maximumRadius,n._centerToleranceSquared=t._centerToleranceSquared,n):new e(i.x,i.y,i.z)}static fromCartesian3(t,n){return l(n)||(n=new e),l(t)&&fce(n,t.x,t.y,t.z),n}static get default(){return e._default}static set default(t){e._default=t,h._ellipsoidRadiiSquared=t.radiiSquared,he._ellipsoidOneOverRadii=t.oneOverRadii,he._ellipsoidOneOverRadiiSquared=t.oneOverRadiiSquared,he._ellipsoidCenterToleranceSquared=t._centerToleranceSquared}clone(t){return e.clone(this,t)}static pack(t,n,i){return i=i??0,h.pack(t._radii,n,i),n}static unpack(t,n,i){n=n??0;let r=h.unpack(t,n);return e.fromCartesian3(r,i)}geodeticSurfaceNormalCartographic(t,n){let i=t.longitude,r=t.latitude,o=Math.cos(r),s=o*Math.cos(i),a=o*Math.sin(i),c=Math.sin(r);return l(n)||(n=new h),n.x=s,n.y=a,n.z=c,h.normalize(n,n)}geodeticSurfaceNormal(t,n){if(!h.equalsEpsilon(t,h.ZERO,P.EPSILON14))return l(n)||(n=new h),n=h.multiplyComponents(t,this._oneOverRadiiSquared,n),h.normalize(n,n)}cartographicToCartesian(t,n){let i=k3e,r=U3e;this.geodeticSurfaceNormalCartographic(t,i),h.multiplyComponents(this._radiiSquared,i,r);let o=Math.sqrt(h.dot(i,r));return h.divideByScalar(r,o,r),h.multiplyByScalar(i,t.height,i),l(n)||(n=new h),h.add(r,i,n)}cartographicArrayToCartesianArray(t,n){let i=t.length;l(n)?n.length=i:n=new Array(i);for(let r=0;r<i;r++)n[r]=this.cartographicToCartesian(t[r],n[r]);return n}cartesianToCartographic(t,n){let i=this.scaleToGeodeticSurface(t,V3e);if(!l(i))return;let r=this.geodeticSurfaceNormal(i,z3e),o=h.subtract(t,i,j3e),s=Math.atan2(r.y,r.x),a=Math.asin(r.z),c=P.sign(h.dot(o,t))*h.magnitude(o);return l(n)?(n.longitude=s,n.latitude=a,n.height=c,n):new he(s,a,c)}cartesianArrayToCartographicArray(t,n){let i=t.length;l(n)?n.length=i:n=new Array(i);for(let r=0;r<i;++r)n[r]=this.cartesianToCartographic(t[r],n[r]);return n}scaleToGeodeticSurface(t,n){return xE(t,this._oneOverRadii,this._oneOverRadiiSquared,this._centerToleranceSquared,n)}scaleToGeocentricSurface(t,n){l(n)||(n=new h);let i=t.x,r=t.y,o=t.z,s=this._oneOverRadiiSquared,a=1/Math.sqrt(i*i*s.x+r*r*s.y+o*o*s.z);return h.multiplyByScalar(t,a,n)}transformPositionToScaledSpace(t,n){return l(n)||(n=new h),h.multiplyComponents(t,this._oneOverRadii,n)}transformPositionFromScaledSpace(t,n){return l(n)||(n=new h),h.multiplyComponents(t,this._radii,n)}equals(t){return this===t||l(t)&&h.equals(this._radii,t._radii)}toString(){return this._radii.toString()}getSurfaceNormalIntersectionWithZAxis(t,n,i){n=n??0;let r=this._squaredXOverSquaredZ;if(l(i)||(i=new h),i.x=0,i.y=0,i.z=t.z*(1-r),!(Math.abs(i.z)>=this._radii.z-n))return i}getLocalCurvature(t,n){l(n)||(n=new U);let i=this.getSurfaceNormalIntersectionWithZAxis(t,0,H3e),r=h.distance(t,i),o=this.minimumRadius*r/this.maximumRadius**2,s=r*o**2;return U.fromElements(1/r,1/s,n)}surfaceArea(t){let n=t.west,i=t.east,r=t.south,o=t.north;for(;i<n;)i+=P.TWO_PI;let s=this._radiiSquared,a=s.x,c=s.y,u=s.z,f=a*c;return dce(r,o,function(d){let p=Math.cos(d),g=Math.sin(d);return Math.cos(d)*dce(n,i,function(m){let y=Math.cos(m),A=Math.sin(m);return Math.sqrt(f*g*g+u*(c*y*y+a*A*A)*p*p)})})}};Tl.WGS84=Object.freeze(new Tl(6378137,6378137,6356752314245179e-9));Tl.UNIT_SPHERE=Object.freeze(new Tl(1,1,1));Tl.MOON=Object.freeze(new Tl(P.LUNAR_RADIUS,P.LUNAR_RADIUS,P.LUNAR_RADIUS));Tl.MARS=Object.freeze(new Tl(3396190,3396190,3376200));Tl._default=Tl.WGS84;Tl.packedLength=h.packedLength;Tl.prototype.geocentricSurfaceNormal=h.normalize;var k3e=new h,U3e=new h,z3e=new h,V3e=new h,j3e=new h,H3e=new h,G3e=[.14887433898163,.43339539412925,.67940956829902,.86506336668898,.97390652851717,0],W3e=[.29552422471475,.26926671930999,.21908636251598,.14945134915058,.066671344308684,0];function dce(e,t,n){let i=.5*(t+e),r=.5*(t-e),o=0;for(let s=0;s<5;s++){let a=r*G3e[s];o+=W3e[s]*(n(i+a)+n(i-a))}return o*=r,o}var ee=Tl;var Sq=class{constructor(t){this._ellipsoid=t??ee.default,this._semimajorAxis=this._ellipsoid.maximumRadius,this._oneOverSemimajorAxis=1/this._semimajorAxis}get ellipsoid(){return this._ellipsoid}project(t,n){let i=this._semimajorAxis,r=t.longitude*i,o=t.latitude*i,s=t.height;return l(n)?(n.x=r,n.y=o,n.z=s,n):new h(r,o,s)}unproject(t,n){let i=this._oneOverSemimajorAxis,r=t.x*i,o=t.y*i,s=t.z;return l(n)?(n.longitude=r,n.latitude=o,n.height=s,n):new he(r,o,s)}},ji=Sq;var hce={OUTSIDE:-1,INTERSECTING:0,INSIDE:1};Object.freeze(hce);var $t=hce;function q3e(e,t,n){let i=0,r=e.length-1,o,s;for(;i<=r;){if(o=~~((i+r)/2),s=n(e[o],t),s<0){i=o+1;continue}if(s>0){r=o-1;continue}return o}return~(r+1)}var Pr=q3e;function Y3e(e,t,n,i,r){this.xPoleWander=e,this.yPoleWander=t,this.xPoleOffset=n,this.yPoleOffset=i,this.ut1MinusUtc=r}var gb=Y3e;function X3e(e){return e%4===0&&e%100!==0||e%400===0}var ou=X3e;var mce=[31,28,31,30,31,30,31,31,30,31,30,31];function K3e(e,t,n,i,r,o,s,a){e=e??1,t=t??1,n=n??1,i=i??0,r=r??0,o=o??0,s=s??0,a=a??!1,this.year=e,this.month=t,this.day=n,this.hour=i,this.minute=r,this.second=o,this.millisecond=s,this.isLeapSecond=a;function y(){qr.typeOf.number.greaterThanOrEquals("Year",e,1),qr.typeOf.number.lessThanOrEquals("Year",e,9999),qr.typeOf.number.greaterThanOrEquals("Month",t,1),qr.typeOf.number.lessThanOrEquals("Month",t,12),qr.typeOf.number.greaterThanOrEquals("Day",n,1),qr.typeOf.number.lessThanOrEquals("Day",n,31),qr.typeOf.number.greaterThanOrEquals("Hour",i,0),qr.typeOf.number.lessThanOrEquals("Hour",i,23),qr.typeOf.number.greaterThanOrEquals("Minute",r,0),qr.typeOf.number.lessThanOrEquals("Minute",r,59),qr.typeOf.bool("IsLeapSecond",a),qr.typeOf.number.greaterThanOrEquals("Second",o,0),qr.typeOf.number.lessThanOrEquals("Second",o,a?60:59),qr.typeOf.number.greaterThanOrEquals("Millisecond",s,0),qr.typeOf.number.lessThan("Millisecond",s,1e3)}function A(){let b=t===2&&ou(e)?mce[t-1]+1:mce[t-1];if(n>b)throw new pe("Month and Day represents invalid date")}}var Fm=K3e;function $3e(e,t){this.julianDate=e,this.offset=t}var yr=$3e;var pce={SECONDS_PER_MILLISECOND:.001,SECONDS_PER_MINUTE:60,MINUTES_PER_HOUR:60,HOURS_PER_DAY:24,SECONDS_PER_HOUR:3600,MINUTES_PER_DAY:1440,SECONDS_PER_DAY:86400,DAYS_PER_JULIAN_CENTURY:36525,PICOSECOND:1e-9,MODIFIED_JULIAN_DATE_DIFFERENCE:24000005e-1};Object.freeze(pce);var Un=pce;var gce={UTC:0,TAI:1};Object.freeze(gce);var ai=gce;var _ce=new Fm,xN=[31,28,31,30,31,30,31,31,30,31,30,31],TN=29;function Iq(e,t){return di.compare(e.julianDate,t.julianDate)}var TE=new yr;function EN(e){TE.julianDate=e;let t=di.leapSeconds,n=Pr(t,TE,Iq);n<0&&(n=~n),n>=t.length&&(n=t.length-1);let i=t[n].offset;n>0&&di.secondsDifference(t[n].julianDate,e)>i&&(n--,i=t[n].offset),di.addSeconds(e,i,e)}function yce(e,t){TE.julianDate=e;let n=di.leapSeconds,i=Pr(n,TE,Iq);if(i<0&&(i=~i),i===0)return di.addSeconds(e,-n[0].offset,t);if(i>=n.length)return di.addSeconds(e,-n[i-1].offset,t);let r=di.secondsDifference(n[i].julianDate,e);if(r===0)return di.addSeconds(e,-n[i].offset,t);if(!(r<=1))return di.addSeconds(e,-n[i-1].offset,t)}function C_(e,t,n){let i=t/Un.SECONDS_PER_DAY|0;return e+=i,t-=Un.SECONDS_PER_DAY*i,t<0&&(e--,t+=Un.SECONDS_PER_DAY),n.dayNumber=e,n.secondsOfDay=t,n}function wq(e,t,n,i,r,o,s){let a=(t-14)/12|0,c=e+4800+a,u=(1461*c/4|0)+(367*(t-2-12*a)/12|0)-(3*((c+100)/100|0)/4|0)+n-32075;i=i-12,i<0&&(i+=24);let f=o+(i*Un.SECONDS_PER_HOUR+r*Un.SECONDS_PER_MINUTE+s*Un.SECONDS_PER_MILLISECOND);return f>=43200&&(u-=1),[u,f]}var J3e=/^(\d{4})$/,Z3e=/^(\d{4})-(\d{2})$/,Q3e=/^(\d{4})-?(\d{3})$/,eUe=/^(\d{4})-?W(\d{2})-?(\d{1})?$/,tUe=/^(\d{4})-?(\d{2})-?(\d{2})$/,Pq=/([Z+\-])?(\d{2})?:?(\d{2})?$/,nUe=/^(\d{2})(\.\d+)?/.source+Pq.source,iUe=/^(\d{2}):?(\d{2})(\.\d+)?/.source+Pq.source,rUe=/^(\d{2}):?(\d{2}):?(\d{2})(\.\d+)?/.source+Pq.source;var v_={year:0,month:0,day:0,hour:0,minute:0,second:0,millisecond:0},oUe=[1,10,100,1e3,1e4,1e5,1e6,1e7,1e8,1e9,1e10,1e11,1e12,1e13,1e14,1e15];function R0(e,t){let n=e.charCodeAt(t)-48,i=e.charCodeAt(t+1)-48;return n<0||n>9||i<0||i>9?-1:n*10+i}var Ace=NaN,bce=0;function xce(e,t,n,i,r,o,s){v_.year=e,v_.month=t,v_.day=n,v_.hour=i,v_.minute=r,v_.second=o,v_.millisecond=s}function sUe(e){let t=e.length;if(t===4){let m=R0(e,0),y=R0(e,2);return m<0||y<0?!1:(xce(m*100+y,1,1,0,0,0,0),!0)}let n=e.charCodeAt(t-1)===90,i=n?t-1:t;if(i<19||e.charCodeAt(4)!==45||e.charCodeAt(7)!==45||e.charCodeAt(10)!==84||e.charCodeAt(13)!==58||e.charCodeAt(16)!==58)return!1;let r=R0(e,0),o=R0(e,2),s=R0(e,5),a=R0(e,8),c=R0(e,11),u=R0(e,14),f=R0(e,17);if(r<0||o<0||s<1||s>12||a<1||a>31||c<0||c>23||u<0||u>59||f<0||f>60)return!1;let d=0;if(i>19){let m=e.charCodeAt(19),y=i-20;if(m!==46&&m!==44||y<1||y>15)return!1;let A=0;for(let b=20;b<i;b++){let x=e.charCodeAt(b)-48;if(x<0||x>9)return!1;A=A*10+x}d=A/oUe[y]*1e3}let p=r*100+o,g=ou(p);if((s!==2||!g?xN[s-1]:TN)<a)return!1;if(!n){let m=Date.UTC(p,s-1,a,c,u);m!==Ace&&(Ace=m,bce=new Date(m).getTimezoneOffset()),u=u+bce}return xce(p,s,a,c,u,f,d),!0}function Tce(e,t,n,i,r,o,s,a,c){let u,f=o===60;for(f&&o--;r>=60;)r-=60,i++;for(;i>=24;)i-=24,n++;for(u=a&&t===2?TN:xN[t-1];n>u;)n-=u,t++,t>12&&(t-=12,e++),u=a&&t===2?TN:xN[t-1];for(;r<0;)r+=60,i--;for(;i<0;)i+=24,n--;for(;n<1;)t--,t<1&&(t+=12,e--),u=a&&t===2?TN:xN[t-1],n+=u;let d=wq(e,t,n,i,r,o,s);return l(c)?(C_(d[0],d[1],c),EN(c)):c=new di(d[0],d[1],ai.UTC),f&&di.addSeconds(c,1,c),c}var di=class e{constructor(t,n,i){this.dayNumber=void 0,this.secondsOfDay=void 0,t=t??0,n=n??0,i=i??ai.UTC;let r=t|0;n=n+(t-r)*Un.SECONDS_PER_DAY,C_(r,n,this),i===ai.UTC&&EN(this)}static fromGregorianDate(t,n){let i=wq(t.year,t.month,t.day,t.hour,t.minute,t.second,t.millisecond);return l(n)?(C_(i[0],i[1],n),EN(n),n):new e(i[0],i[1],ai.UTC)}static fromDate(t,n){let i=wq(t.getUTCFullYear(),t.getUTCMonth()+1,t.getUTCDate(),t.getUTCHours(),t.getUTCMinutes(),t.getUTCSeconds(),t.getUTCMilliseconds());return l(n)?(C_(i[0],i[1],n),EN(n),n):new e(i[0],i[1],ai.UTC)}static fromIso8601(t,n){if(sUe(t)){let A=v_;return Tce(A.year,A.month,A.day,A.hour,A.minute,A.second,A.millisecond,ou(A.year),n)}t=t.replace(",",".");let i=t.split("T"),r,o=1,s=1,a=0,c=0,u=0,f=0,d=i[0],p=i[1],g,m;if(i=d.match(tUe),i!==null)r=+i[1],o=+i[2],s=+i[3];else if(i=d.match(Z3e),i!==null)r=+i[1],o=+i[2];else if(i=d.match(J3e),i!==null)r=+i[1];else{let A;if(i=d.match(Q3e),i!==null)r=+i[1],A=+i[2],m=ou(r);else if(i=d.match(eUe),i!==null){r=+i[1];let b=+i[2],x=+i[3]||0,T=new Date(Date.UTC(r,0,4));A=b*7+x-T.getUTCDay()-3}g=new Date(Date.UTC(r,0,1)),g.setUTCDate(A),o=g.getUTCMonth()+1,s=g.getUTCDate()}m=ou(r);let y;if(l(p)){i=p.match(rUe),i!==null?(a=+i[1],c=+i[2],u=+i[3],f=+(i[4]||0)*1e3,y=5):(i=p.match(iUe),i!==null?(a=+i[1],c=+i[2],u=+(i[3]||0)*60,y=4):(i=p.match(nUe),i!==null&&(a=+i[1],c=+(i[2]||0)*60,y=3)));let A=i[y],b=+i[y+1],x=+(i[y+2]||0);switch(A){case"+":a=a-b,c=c-x;break;case"-":a=a+b,c=c+x;break;case"Z":break;default:c=c+new Date(Date.UTC(r,o-1,s,a,c)).getTimezoneOffset();break}}return Tce(r,o,s,a,c,u,f,m,n)}static now(t){return e.fromDate(new Date,t)}static toGregorianDate(t,n){let i=!1,r=yce(t,bN);l(r)||(e.addSeconds(t,-1,bN),r=yce(bN,bN),i=!0);let o=r.dayNumber,s=r.secondsOfDay;s>=43200&&(o+=1);let a=o+68569|0,c=4*a/146097|0;a=a-((146097*c+3)/4|0)|0;let u=4e3*(a+1)/1461001|0;a=a-(1461*u/4|0)+31|0;let f=80*a/2447|0,d=a-(2447*f/80|0)|0;a=f/11|0;let p=f+2-12*a|0,g=100*(c-49)+u+a|0,m=s/Un.SECONDS_PER_HOUR|0,y=s-m*Un.SECONDS_PER_HOUR,A=y/Un.SECONDS_PER_MINUTE|0;y=y-A*Un.SECONDS_PER_MINUTE;let b=y|0,x=(y-b)/Un.SECONDS_PER_MILLISECOND;return m+=12,m>23&&(m-=24),i&&(b+=1),l(n)?(n.year=g,n.month=p,n.day=d,n.hour=m,n.minute=A,n.second=b,n.millisecond=x,n.isLeapSecond=i,n):new Fm(g,p,d,m,A,b,x,i)}static toDate(t){let n=e.toGregorianDate(t,_ce),i=n.second;return n.isLeapSecond&&(i-=1),new Date(Date.UTC(n.year,n.month-1,n.day,n.hour,n.minute,i,n.millisecond))}static toIso8601(t,n){let i=e.toGregorianDate(t,_ce),r=i.year,o=i.month,s=i.day,a=i.hour,c=i.minute,u=i.second,f=i.millisecond;r===1e4&&o===1&&s===1&&a===0&&c===0&&u===0&&f===0&&(r=9999,o=12,s=31,a=24);let d;if(!l(n)&&f!==0){let p=f*.01;return d=p<1e-6?p.toFixed(20).replace(".","").replace(/0+$/,""):p.toString().replace(".",""),`${r.toString().padStart(4,"0")}-${o.toString().padStart(2,"0")}-${s.toString().padStart(2,"0")}T${a.toString().padStart(2,"0")}:${c.toString().padStart(2,"0")}:${u.toString().padStart(2,"0")}.${d}Z`}return!l(n)||n===0?`${r.toString().padStart(4,"0")}-${o.toString().padStart(2,"0")}-${s.toString().padStart(2,"0")}T${a.toString().padStart(2,"0")}:${c.toString().padStart(2,"0")}:${u.toString().padStart(2,"0")}Z`:(d=(f*.01).toFixed(n).replace(".","").slice(0,n),`${r.toString().padStart(4,"0")}-${o.toString().padStart(2,"0")}-${s.toString().padStart(2,"0")}T${a.toString().padStart(2,"0")}:${c.toString().padStart(2,"0")}:${u.toString().padStart(2,"0")}.${d}Z`)}static clone(t,n){if(l(t))return l(n)?(n.dayNumber=t.dayNumber,n.secondsOfDay=t.secondsOfDay,n):new e(t.dayNumber,t.secondsOfDay,ai.TAI)}static compare(t,n){let i=t.dayNumber-n.dayNumber;return i!==0?i:t.secondsOfDay-n.secondsOfDay}static equals(t,n){return t===n||l(t)&&l(n)&&t.dayNumber===n.dayNumber&&t.secondsOfDay===n.secondsOfDay}static equalsEpsilon(t,n,i){return i=i??0,t===n||l(t)&&l(n)&&Math.abs(e.secondsDifference(t,n))<=i}static totalDays(t){return t.dayNumber+t.secondsOfDay/Un.SECONDS_PER_DAY}static secondsDifference(t,n){return(t.dayNumber-n.dayNumber)*Un.SECONDS_PER_DAY+(t.secondsOfDay-n.secondsOfDay)}static daysDifference(t,n){let i=t.dayNumber-n.dayNumber,r=(t.secondsOfDay-n.secondsOfDay)/Un.SECONDS_PER_DAY;return i+r}static computeTaiMinusUtc(t){TE.julianDate=t;let n=e.leapSeconds,i=Pr(n,TE,Iq);return i<0&&(i=~i,--i,i<0&&(i=0)),n[i].offset}static addSeconds(t,n,i){return C_(t.dayNumber,t.secondsOfDay+n,i)}static addMinutes(t,n,i){let r=t.secondsOfDay+n*Un.SECONDS_PER_MINUTE;return C_(t.dayNumber,r,i)}static addHours(t,n,i){let r=t.secondsOfDay+n*Un.SECONDS_PER_HOUR;return C_(t.dayNumber,r,i)}static addDays(t,n,i){let r=t.dayNumber+n;return C_(r,t.secondsOfDay,i)}static lessThan(t,n){return e.compare(t,n)<0}static lessThanOrEquals(t,n){return e.compare(t,n)<=0}static greaterThan(t,n){return e.compare(t,n)>0}static greaterThanOrEquals(t,n){return e.compare(t,n)>=0}clone(t){return e.clone(this,t)}equals(t){return e.equals(this,t)}equalsEpsilon(t,n){return e.equalsEpsilon(this,t,n)}toString(){return e.toIso8601(this)}},bN=new di(0,0,ai.TAI);di.leapSeconds=[new yr(new di(2441317,43210,ai.TAI),10),new yr(new di(2441499,43211,ai.TAI),11),new yr(new di(2441683,43212,ai.TAI),12),new yr(new di(2442048,43213,ai.TAI),13),new yr(new di(2442413,43214,ai.TAI),14),new yr(new di(2442778,43215,ai.TAI),15),new yr(new di(2443144,43216,ai.TAI),16),new yr(new di(2443509,43217,ai.TAI),17),new yr(new di(2443874,43218,ai.TAI),18),new yr(new di(2444239,43219,ai.TAI),19),new yr(new di(2444786,43220,ai.TAI),20),new yr(new di(2445151,43221,ai.TAI),21),new yr(new di(2445516,43222,ai.TAI),22),new yr(new di(2446247,43223,ai.TAI),23),new yr(new di(2447161,43224,ai.TAI),24),new yr(new di(2447892,43225,ai.TAI),25),new yr(new di(2448257,43226,ai.TAI),26),new yr(new di(2448804,43227,ai.TAI),27),new yr(new di(2449169,43228,ai.TAI),28),new yr(new di(2449534,43229,ai.TAI),29),new yr(new di(2450083,43230,ai.TAI),30),new yr(new di(2450630,43231,ai.TAI),31),new yr(new di(2451179,43232,ai.TAI),32),new yr(new di(2453736,43233,ai.TAI),33),new yr(new di(2454832,43234,ai.TAI),34),new yr(new di(2456109,43235,ai.TAI),35),new yr(new di(2457204,43236,ai.TAI),36),new yr(new di(2457754,43237,ai.TAI),37)];var K=di;var Hce=js(ef(),1);function aUe(e){return(e.length===0||e[e.length-1]!=="/")&&(e=`${e}/`),e}var wN=aUe;function Pce(e,t){if(e===null||typeof e!="object")return e;t=t??!1;let n=new e.constructor;for(let i in e)if(e.hasOwnProperty(i)){let r=e[i];t&&(r=Pce(r,t)),n[i]=r}return n}var Ze=Pce;function Dce(e,t,n){n=n??!1;let i={},r=l(e),o=l(t),s,a,c;if(r)for(s in e)e.hasOwnProperty(s)&&(a=e[s],o&&n&&typeof a=="object"&&t.hasOwnProperty(s)?(c=t[s],typeof c=="object"?i[s]=Dce(a,c,n):i[s]=a):i[s]=a);if(o)for(s in t)t.hasOwnProperty(s)&&!i.hasOwnProperty(s)&&(c=t[s],i[s]=c);return i}var Mt=Dce;function cUe(){let e,t,n=new Promise(function(i,r){e=i,t=r});return{resolve:e,reject:t,promise:n}}var tf=cUe;var Rce=js(ef(),1);function Dq(e,t){let n;return typeof document<"u"&&(n=document),Dq._implementation(e,t,n)}Dq._implementation=function(e,t,n){if(!l(t)){if(typeof n>"u")return e;t=n.baseURI??n.location.href}let i=new Rce.default(e);return i.scheme()!==""?i.toString():i.absoluteTo(t).toString()};var fh=Dq;var Oce=js(ef(),1);function lUe(e,t){let n="",i=e.lastIndexOf("/");return i!==-1&&(n=e.substring(0,i+1)),t&&(e=new Oce.default(e),e.query().length!==0&&(n+=`?${e.query()}`),e.fragment().length!==0&&(n+=`#${e.fragment()}`)),n}var IN=lUe;var Mce=js(ef(),1);function uUe(e){let t=new Mce.default(e);t.normalize();let n=t.path(),i=n.lastIndexOf("/");return i!==-1&&(n=n.substr(i+1)),i=n.lastIndexOf("."),i===-1?n="":n=n.substr(i+1),n}var S_=uUe;var Nce={};function fUe(e,t,n){l(t)||(t=e.width),l(n)||(n=e.height);let i=Nce[t];l(i)||(i={},Nce[t]=i);let r=i[n];if(!l(r)){let o=document.createElement("canvas");o.width=t,o.height=n,r=o.getContext("2d",{willReadFrequently:!0}),r.globalCompositeOperation="copy",i[n]=r}return r.drawImage(e,0,0,t,n),r.getImageData(0,0,t,n).data}var Bm=fUe;var dUe=/^blob:/i;function hUe(e){return dUe.test(e)}var vE=hUe;var km;function mUe(e){l(km)||(km=document.createElement("a")),km.href=window.location.href;let t=km.host,n=km.protocol;return km.href=e,km.href=km.href,n!==km.protocol||t!==km.host}var _b=mUe;var pUe=/^data:/i;function gUe(e){return pUe.test(e)}var Um=gUe;function _Ue(e){let t=document.createElement("script");return t.async=!0,t.src=e,new Promise((n,i)=>{window.crossOriginIsolated&&t.setAttribute("crossorigin","anonymous");let r=document.getElementsByTagName("head")[0];t.onload=function(){t.onload=void 0,r.removeChild(t),n()},t.onerror=function(o){i(o)},r.appendChild(t)})}var SE=_Ue;function yUe(e){let t="";for(let n in e)if(e.hasOwnProperty(n)){let i=e[n],r=`${encodeURIComponent(n)}=`;if(Array.isArray(i))for(let o=0,s=i.length;o<s;++o)t+=`${r+encodeURIComponent(i[o])}&`;else t+=`${r+encodeURIComponent(i)}&`}return t=t.slice(0,-1),t}var wE=yUe;function AUe(e){let t={};if(e==="")return t;let n=e.replace(/\+/g,"%20").split(/[&;]/);for(let i=0,r=n.length;i<r;++i){let o=n[i].split("="),s=decodeURIComponent(o[0]),a=o[1];l(a)?a=decodeURIComponent(a):a="";let c=t[s];typeof c=="string"?t[s]=[c,a]:Array.isArray(c)?c.push(a):t[s]=a}return t}var Jf=AUe;var Lce={UNISSUED:0,ISSUED:1,ACTIVE:2,RECEIVED:3,CANCELLED:4,FAILED:5};Object.freeze(Lce);var wi=Lce;var Fce={TERRAIN:0,IMAGERY:1,TILES3D:2,OTHER:3};Object.freeze(Fce);var oa=Fce;function PN(e){e=e??H.EMPTY_OBJECT;let t=e.throttleByServer??!1,n=e.throttle??!1;this.url=e.url,this.requestFunction=e.requestFunction,this.cancelFunction=e.cancelFunction,this.priorityFunction=e.priorityFunction,this.priority=e.priority??0,this.throttle=n,this.throttleByServer=t,this.type=e.type??oa.OTHER,this.serverKey=e.serverKey,this.state=wi.UNISSUED,this.deferred=void 0,this.cancelled=!1}PN.prototype.cancel=function(){this.cancelled=!0};PN.prototype.clone=function(e){return l(e)?(e.url=this.url,e.requestFunction=this.requestFunction,e.cancelFunction=this.cancelFunction,e.priorityFunction=this.priorityFunction,e.priority=this.priority,e.throttle=this.throttle,e.throttleByServer=this.throttleByServer,e.type=this.type,e.serverKey=this.serverKey,e.state=wi.UNISSUED,e.deferred=void 0,e.cancelled=!1,e):new PN(this)};var Oo=PN;function bUe(e){let t={};if(!e)return t;let n=e.split(`\r +`);for(let i=0;i<n.length;++i){let r=n[i],o=r.indexOf(": ");if(o>0){let s=r.substring(0,o),a=r.substring(o+2);t[s]=a}}return t}var DN=bUe;function Bce(e,t,n){this.statusCode=e,this.response=t,this.responseHeaders=n,typeof this.responseHeaders=="string"&&(this.responseHeaders=DN(this.responseHeaders))}Bce.prototype.toString=function(){let e="Request has failed.";return l(this.statusCode)&&(e+=` Status Code: ${this.statusCode}`),e};var O0=Bce;var NN=js(ef(),1);function UI(){this._listeners=new Map,this._toRemove=new Map,this._toAdd=new Map,this._invokingListeners=!1,this._listenerCount=0}Object.defineProperties(UI.prototype,{numberOfListeners:{get:function(){return this._listenerCount}}});UI.prototype.addEventListener=function(e,t){let n=this,i=n._invokingListeners?n._toAdd:n._listeners;return Oq(this,i,e,t)&&n._listenerCount++,function(){n.removeEventListener(e,t)}};function Oq(e,t,n,i){t.has(n)||t.set(n,new Set);let r=t.get(n);return r.has(i)?!1:(r.add(i),!0)}UI.prototype.removeEventListener=function(e,t){let n=Rq(this,this._listeners,e,t),i=Rq(this,this._toAdd,e,t),r=n||i;return r&&this._listenerCount--,r};function Rq(e,t,n,i){let r=t.get(n);if(!r||!r.has(i))return!1;if(e._invokingListeners){if(!Oq(e,e._toRemove,n,i))return!1}else r.delete(i),r.size===0&&t.delete(n);return!0}var ON,RN;function xUe(e){ON.apply(e,RN)}function TUe(e,t){l(t)&&(ON=t,e.forEach(xUe))}UI.prototype.raiseEvent=function(){this._invokingListeners=!0;let e=ON,t=RN;RN=arguments;try{this._listeners.forEach(TUe)}finally{ON=e,RN=t}if(this._invokingListeners=!1,this._toAdd.size>0){for(let[n,i]of this._toAdd.entries())for(let r of i)Oq(this,this._listeners,n,r);this._toAdd.clear()}if(this._toRemove.size>0){for(let[n,i]of this._toRemove.entries())for(let r of i)Rq(this,this._listeners,n,r);this._toRemove.clear()}};var be=UI;function yb(e){this._comparator=e.comparator,this._array=[],this._length=0,this._maximumLength=void 0}Object.defineProperties(yb.prototype,{length:{get:function(){return this._length}},internalArray:{get:function(){return this._array}},maximumLength:{get:function(){return this._maximumLength},set:function(e){let t=this._length;if(e<t){let n=this._array;for(let i=e;i<t;++i)n[i]=void 0;this._length=e,n.length=e}this._maximumLength=e}},comparator:{get:function(){return this._comparator}}});function Mq(e,t,n){let i=e[t];e[t]=e[n],e[n]=i}yb.prototype.reserve=function(e){e=e??this._length,this._array.length=e};yb.prototype.heapify=function(e){e=e??0;let t=this._length,n=this._comparator,i=this._array,r,o=!0;for(;o;){let s=2*(e+1),a=s-1;a<t&&n(i[a],i[e])<0?r=a:r=e,s<t&&n(i[s],i[r])<0&&(r=s),r!==e?(Mq(i,r,e),e=r):o=!1}};yb.prototype.resort=function(){let e=this._length;for(let t=Math.ceil(e/2);t>=0;--t)this.heapify(t)};yb.prototype.insert=function(e){let t=this._array,n=this._comparator,i=this._maximumLength,r=this._length++;for(r<t.length?t[r]=e:t.push(e);r!==0;){let s=Math.floor((r-1)/2);if(n(t[r],t[s])<0)Mq(t,r,s),r=s;else break}let o;return l(i)&&this._length>i&&(o=t[i],this._length=i),o};yb.prototype.pop=function(e){if(e=e??0,this._length===0)return;let t=this._array,n=t[e];return Mq(t,e,--this._length),this.heapify(e),t[this._length]=void 0,n};var MN=yb;function EUe(e,t){return e.priority-t.priority}var Tr={numberOfAttemptedRequests:0,numberOfActiveRequests:0,numberOfCancelledRequests:0,numberOfCancelledActiveRequests:0,numberOfFailedRequests:0,numberOfActiveRequestsEver:0,lastNumberOfActiveRequests:0},IE=20,Fc=new MN({comparator:EUe});Fc.maximumLength=IE;Fc.reserve(IE);var zm=[],M0={},CUe=typeof document<"u"?new NN.default(document.location.href):new NN.default,LN=new be;function xo(){}xo.maximumRequests=50;xo.maximumRequestsPerServer=18;xo.requestsByServer={};xo.throttleRequests=!0;xo.debugShowStatistics=!1;xo.requestCompletedEvent=LN;Object.defineProperties(xo,{statistics:{get:function(){return Tr}},priorityHeapLength:{get:function(){return IE},set:function(e){if(e<IE)for(;Fc.length>e;){let t=Fc.pop();Ab(t)}IE=e,Fc.maximumLength=e,Fc.reserve(e)}}});function kce(e){l(e.priorityFunction)&&(e.priority=e.priorityFunction())}xo.serverHasOpenSlots=function(e,t){t=t??1;let n=xo.requestsByServer[e]??xo.maximumRequestsPerServer;return M0[e]+t<=n};xo.heapHasOpenSlots=function(e){return Fc.length+e<=IE};function Uce(e){return e.state===wi.UNISSUED&&(e.state=wi.ISSUED,e.deferred=tf()),e.deferred.promise}function vUe(e){return function(t){if(e.state===wi.CANCELLED)return;let n=e.deferred;--Tr.numberOfActiveRequests,--M0[e.serverKey],LN.raiseEvent(),e.state=wi.RECEIVED,e.deferred=void 0,n.resolve(t)}}function SUe(e){return function(t){e.state!==wi.CANCELLED&&(++Tr.numberOfFailedRequests,--Tr.numberOfActiveRequests,--M0[e.serverKey],LN.raiseEvent(t),e.state=wi.FAILED,e.deferred.reject(t))}}function zce(e){let t=Uce(e);return e.state=wi.ACTIVE,zm.push(e),++Tr.numberOfActiveRequests,++Tr.numberOfActiveRequestsEver,++M0[e.serverKey],e.requestFunction().then(vUe(e)).catch(SUe(e)),t}function Ab(e){let t=e.state===wi.ACTIVE;if(e.state=wi.CANCELLED,++Tr.numberOfCancelledRequests,l(e.deferred)){let n=e.deferred;n.promise.catch(()=>{}),e.deferred=void 0,n.reject(new oe(`Request cancelled: "${e.url}"`))}t&&(--Tr.numberOfActiveRequests,--M0[e.serverKey],++Tr.numberOfCancelledActiveRequests),l(e.cancelFunction)&&e.cancelFunction()}xo.update=function(){let e,t,n=0,i=zm.length;for(e=0;e<i;++e){if(t=zm[e],t.cancelled&&Ab(t),t.state!==wi.ACTIVE){++n;continue}n>0&&(zm[e-n]=t)}zm.length-=n;let r=Fc.internalArray,o=Fc.length;for(e=0;e<o;++e)kce(r[e]);Fc.resort();let s=Math.max(xo.maximumRequests-zm.length,0),a=0;for(;a<s&&Fc.length>0;){if(t=Fc.pop(),t.cancelled){Ab(t);continue}if(t.throttleByServer&&!xo.serverHasOpenSlots(t.serverKey)){Ab(t);continue}zce(t),++a}wUe()};xo.getServerKey=function(e){let t=new NN.default(e);t.scheme()===""&&(t=t.absoluteTo(CUe),t.normalize());let n=t.authority();/:/.test(n)||(n=`${n}:${t.scheme()==="https"?"443":"80"}`);let i=M0[n];return l(i)||(M0[n]=0),n};xo.request=function(e){if(Um(e.url)||vE(e.url))return LN.raiseEvent(),e.state=wi.RECEIVED,e.requestFunction();if(++Tr.numberOfAttemptedRequests,l(e.serverKey)||(e.serverKey=xo.getServerKey(e.url)),xo.throttleRequests&&e.throttleByServer&&!xo.serverHasOpenSlots(e.serverKey))return;if(!xo.throttleRequests||!e.throttle)return zce(e);if(zm.length>=xo.maximumRequests)return;kce(e);let t=Fc.insert(e);if(l(t)){if(t===e)return;Ab(t)}return Uce(e)};function wUe(){xo.debugShowStatistics&&(Tr.numberOfActiveRequests===0&&Tr.lastNumberOfActiveRequests>0&&(Tr.numberOfAttemptedRequests>0&&(console.log(`Number of attempted requests: ${Tr.numberOfAttemptedRequests}`),Tr.numberOfAttemptedRequests=0),Tr.numberOfCancelledRequests>0&&(console.log(`Number of cancelled requests: ${Tr.numberOfCancelledRequests}`),Tr.numberOfCancelledRequests=0),Tr.numberOfCancelledActiveRequests>0&&(console.log(`Number of cancelled active requests: ${Tr.numberOfCancelledActiveRequests}`),Tr.numberOfCancelledActiveRequests=0),Tr.numberOfFailedRequests>0&&(console.log(`Number of failed requests: ${Tr.numberOfFailedRequests}`),Tr.numberOfFailedRequests=0)),Tr.lastNumberOfActiveRequests=Tr.numberOfActiveRequests)}xo.clearForSpecs=function(){for(;Fc.length>0;){let t=Fc.pop();Ab(t)}let e=zm.length;for(let t=0;t<e;++t)Ab(zm[t]);zm.length=0,M0={},Tr.numberOfAttemptedRequests=0,Tr.numberOfActiveRequests=0,Tr.numberOfCancelledRequests=0,Tr.numberOfCancelledActiveRequests=0,Tr.numberOfFailedRequests=0,Tr.numberOfActiveRequestsEver=0,Tr.lastNumberOfActiveRequests=0};xo.numberOfActiveRequestsByServer=function(e){return M0[e]};xo.requestHeap=Fc;var El=xo;var Vce=js(ef(),1);var zI={},PE={};zI.add=function(e,t){let n=`${e.toLowerCase()}:${t}`;l(PE[n])||(PE[n]=!0)};zI.remove=function(e,t){let n=`${e.toLowerCase()}:${t}`;l(PE[n])&&delete PE[n]};function IUe(e){let t=new Vce.default(e);t.normalize();let n=t.authority();if(n.length!==0){if(t.authority(n),n.indexOf("@")!==-1&&(n=n.split("@")[1]),n.indexOf(":")===-1){let i=t.scheme();if(i.length===0&&(i=window.location.protocol,i=i.substring(0,i.length-1)),i==="http")n+=":80";else if(i==="https")n+=":443";else return}return n}}zI.contains=function(e){let t=IUe(e);return!!(l(t)&&l(PE[t]))};zI.clear=function(){PE={}};var VI=zI;var Gce=(function(){try{let e=new XMLHttpRequest;return e.open("GET","#",!0),e.responseType="blob",e.responseType==="blob"}catch{return!1}})();function kt(e){e=e??H.EMPTY_OBJECT,typeof e=="string"&&(e={url:e}),this._url=void 0,this._templateValues=Vm(e.templateValues,{}),this._queryParameters=Vm(e.queryParameters,{}),this.headers=Vm(e.headers,{}),this.request=e.request??new Oo,this.proxy=e.proxy,this.retryCallback=e.retryCallback,this.retryAttempts=e.retryAttempts??0,this._retryCount=0,e.parseUrl??!0?this.parseUrl(e.url,!0,!0):this._url=e.url,this._credits=e.credits}function Vm(e,t){return l(e)?Ze(e):t}kt.createIfNeeded=function(e){return e instanceof kt?e.getDerivedResource({request:e.request}):typeof e!="string"?e:new kt({url:e})};var DE;kt.supportsImageBitmapOptions=function(){return l(DE)?DE:typeof createImageBitmap!="function"?(DE=Promise.resolve(!1),DE):(DE=kt.fetchBlob({url:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAIAAACQd1PeAAAABGdBTUEAAE4g3rEiDgAAACBjSFJNAAB6JgAAgIQAAPoAAACA6AAAdTAAAOpgAAA6mAAAF3CculE8AAAADElEQVQI12Ng6GAAAAEUAIngE3ZiAAAAAElFTkSuQmCC"}).then(function(t){let n={imageOrientation:"flipY",premultiplyAlpha:"none",colorSpaceConversion:"none"};return Promise.all([createImageBitmap(t,n),createImageBitmap(t)])}).then(function(t){let n=Bm(t[0]),i=Bm(t[1]);return n[1]!==i[1]}).catch(function(){return!1}),DE)};Object.defineProperties(kt,{isBlobSupported:{get:function(){return Gce}}});Object.defineProperties(kt.prototype,{queryParameters:{get:function(){return this._queryParameters}},templateValues:{get:function(){return this._templateValues}},url:{get:function(){return this.getUrlComponent(!0,!0)},set:function(e){this.parseUrl(e,!1,!1)}},extension:{get:function(){return S_(this._url)}},isDataUri:{get:function(){return Um(this._url)}},isBlobUri:{get:function(){return vE(this._url)}},isCrossOriginUrl:{get:function(){return _b(this._url)}},hasHeaders:{get:function(){return Object.keys(this.headers).length>0}},credits:{get:function(){return this._credits}}});kt.prototype.toString=function(){return this.getUrlComponent(!0,!0)};kt.prototype.parseUrl=function(e,t,n,i){let r=new Hce.default(e),o=PUe(r.query());this._queryParameters=t?BN(o,this.queryParameters,n):o,r.search(""),r.fragment(""),l(i)&&r.scheme()===""&&(r=r.absoluteTo(fh(i))),this._url=r.toString()};function PUe(e){return e.length===0?{}:e.indexOf("=")===-1?{[e]:void 0}:Jf(e)}function BN(e,t,n){if(!n)return Mt(e,t);let i=Ze(e,!0);for(let r in t)if(t.hasOwnProperty(r)){let o=i[r],s=t[r];l(o)?(Array.isArray(o)||(o=i[r]=[o]),i[r]=o.concat(s)):i[r]=Array.isArray(s)?s.slice():s}return i}kt.prototype.getUrlComponent=function(e,t){if(this.isDataUri)return this._url;let n=this._url;e&&(n=`${n}${DUe(this.queryParameters)}`),n=n.replace(/%7B/g,"{").replace(/%7D/g,"}");let i=this._templateValues;return Object.keys(i).length>0&&(n=n.replace(/{(.*?)}/g,function(r,o){let s=i[o];return l(s)?encodeURIComponent(s):r})),t&&l(this.proxy)&&(n=this.proxy.getURL(n)),n};function DUe(e){let t=Object.keys(e);return t.length===0?"":t.length===1&&!l(e[t[0]])?`?${t[0]}`:`?${wE(e)}`}kt.prototype.setQueryParameters=function(e,t){t?this._queryParameters=BN(this._queryParameters,e,!1):this._queryParameters=BN(e,this._queryParameters,!1)};kt.prototype.appendQueryParameters=function(e){this._queryParameters=BN(e,this._queryParameters,!0)};kt.prototype.setTemplateValues=function(e,t){t?this._templateValues=Mt(this._templateValues,e):this._templateValues=Mt(e,this._templateValues)};kt.prototype.getDerivedResource=function(e){let t=this.clone();if(t._retryCount=0,l(e.url)){let n=e.preserveQueryParameters??!1;t.parseUrl(e.url,!0,n,this._url)}return l(e.queryParameters)&&(t._queryParameters=Mt(e.queryParameters,t.queryParameters)),l(e.templateValues)&&(t._templateValues=Mt(e.templateValues,t.templateValues)),l(e.headers)&&(t.headers=Mt(e.headers,t.headers)),l(e.proxy)&&(t.proxy=e.proxy),l(e.request)&&(t.request=e.request),l(e.retryCallback)&&(t.retryCallback=e.retryCallback),l(e.retryAttempts)&&(t.retryAttempts=e.retryAttempts),t};kt.prototype.retryOnError=function(e){let t=this.retryCallback;if(typeof t!="function"||this._retryCount>=this.retryAttempts)return Promise.resolve(!1);let n=this;return Promise.resolve(t(this,e)).then(function(i){return++n._retryCount,i})};kt.prototype.clone=function(e){return l(e)?(e._url=this._url,e._queryParameters=Ze(this._queryParameters),e._templateValues=Ze(this._templateValues),e.headers=Ze(this.headers),e.proxy=this.proxy,e.retryCallback=this.retryCallback,e.retryAttempts=this.retryAttempts,e._retryCount=0,e.request=this.request.clone(),e):new kt({url:this._url,queryParameters:this.queryParameters,templateValues:this.templateValues,headers:this.headers,proxy:this.proxy,retryCallback:this.retryCallback,retryAttempts:this.retryAttempts,request:this.request.clone(),parseUrl:!1,credits:l(this.credits)?this.credits.slice():void 0})};kt.prototype.getBaseUri=function(e){return IN(this.getUrlComponent(e),e)};kt.prototype.appendForwardSlash=function(){this._url=wN(this._url)};kt.prototype.fetchArrayBuffer=function(){return this.fetch({responseType:"arraybuffer"})};kt.fetchArrayBuffer=function(e){return new kt(e).fetchArrayBuffer()};kt.prototype.fetchBlob=function(){return this.fetch({responseType:"blob"})};kt.fetchBlob=function(e){return new kt(e).fetchBlob()};kt.prototype.fetchImage=function(e){e=e??H.EMPTY_OBJECT;let t=e.preferImageBitmap??!1,n=e.preferBlob??!1,i=e.flipY??!1,r=e.skipColorSpaceConversion??!1;if(Nq(this.request),!Gce||this.isDataUri||this.isBlobUri||!this.hasHeaders&&!n)return this._fetchImage({resource:this,flipY:i,skipColorSpaceConversion:r,preferImageBitmap:t});let o=this.fetchBlob();if(!l(o))return;let s,a,c,u;return kt.supportsImageBitmapOptions().then(function(f){return s=f,a=s&&t,o}).then(function(f){if(!l(f))return;if(u=f,a)return kt.createImageBitmapFromBlob(f,{flipY:i,premultiplyAlpha:!1,skipColorSpaceConversion:r});let d=window.URL.createObjectURL(f);return c=new kt({url:d}),c._fetchImage({flipY:i,skipColorSpaceConversion:r,preferImageBitmap:!1})}).then(function(f){if(l(f))return f.blob=u,a||window.URL.revokeObjectURL(c.url),f}).catch(function(f){return l(c)&&window.URL.revokeObjectURL(c.url),f.blob=u,Promise.reject(f)})};kt.prototype._fetchImage=function(e){let t=this,n=e.flipY,i=e.skipColorSpaceConversion,r=e.preferImageBitmap,o=t.request;o.url=t.url,o.requestFunction=function(){let a=!1;!t.isDataUri&&!t.isBlobUri&&(a=t.isCrossOriginUrl);let c=tf();return kt._Implementations.createImage(o,a,c,n,i,r),c.promise};let s=El.request(o);if(l(s))return s.catch(function(a){return o.state!==wi.FAILED?Promise.reject(a):t.retryOnError(a).then(function(c){return c?(o.state=wi.UNISSUED,o.deferred=void 0,t._fetchImage({flipY:n,skipColorSpaceConversion:i,preferImageBitmap:r})):Promise.reject(a)})})};kt.fetchImage=function(e){return new kt(e).fetchImage({flipY:e.flipY,skipColorSpaceConversion:e.skipColorSpaceConversion,preferBlob:e.preferBlob,preferImageBitmap:e.preferImageBitmap})};kt.prototype.fetchText=function(){return this.fetch({responseType:"text"})};kt.fetchText=function(e){return new kt(e).fetchText()};kt.prototype.fetchJson=function(){let e=this.fetch({responseType:"text",headers:{Accept:"application/json,*/*;q=0.01"}});if(l(e))return e.then(function(t){if(l(t))return JSON.parse(t)})};kt.fetchJson=function(e){return new kt(e).fetchJson()};kt.prototype.fetchXML=function(){return this.fetch({responseType:"document",overrideMimeType:"text/xml"})};kt.fetchXML=function(e){return new kt(e).fetchXML()};kt.prototype.fetchJsonp=function(e){e=e??"callback",Nq(this.request);let t;do t=`loadJsonp${P.nextRandomNumber().toString().substring(2,8)}`;while(l(window[t]));return Wce(this,e,t)};function Wce(e,t,n){let i={};i[t]=n,e.setQueryParameters(i);let r=e.request,o=e.url;r.url=o,r.requestFunction=function(){let a=tf();return window[n]=function(c){a.resolve(c);try{delete window[n]}catch{window[n]=void 0}},kt._Implementations.loadAndExecuteScript(o,n,a),a.promise};let s=El.request(r);if(l(s))return s.catch(function(a){return r.state!==wi.FAILED?Promise.reject(a):e.retryOnError(a).then(function(c){return c?(r.state=wi.UNISSUED,r.deferred=void 0,Wce(e,t,n)):Promise.reject(a)})})}kt.fetchJsonp=function(e){return new kt(e).fetchJsonp(e.callbackParameterName)};kt.prototype._makeRequest=function(e){let t=this;Nq(t.request);let n=t.request,i=t.url;n.url=i,n.requestFunction=function(){let o=e.responseType,s=Mt(e.headers,t.headers),a=e.overrideMimeType,c=e.method,u=e.data,f=tf(),d=kt._Implementations.loadWithXhr(i,o,c,u,s,f,a);return l(d)&&l(d.abort)&&(n.cancelFunction=function(){d.abort()}),f.promise};let r=El.request(n);if(l(r))return r.then(function(o){return n.cancelFunction=void 0,o}).catch(function(o){return n.cancelFunction=void 0,n.state!==wi.FAILED?Promise.reject(o):t.retryOnError(o).then(function(s){return s?(n.state=wi.UNISSUED,n.deferred=void 0,t.fetch(e)):Promise.reject(o)})})};function Nq(e){if(e.state===wi.ISSUED||e.state===wi.ACTIVE)throw new oe("The Resource is already being fetched.");e.state=wi.UNISSUED,e.deferred=void 0}var RUe=/^data:(.*?)(;base64)?,(.*)$/;function FN(e,t){let n=decodeURIComponent(t);return e?atob(n):n}function jce(e,t){let n=FN(e,t),i=new ArrayBuffer(n.length),r=new Uint8Array(i);for(let o=0;o<n.length;o++)r[o]=n.charCodeAt(o);return i}function OUe(e,t){t=t??"";let n=e[1],i=!!e[2],r=e[3],o,s;switch(t){case"":case"text":return FN(i,r);case"arraybuffer":return jce(i,r);case"blob":return o=jce(i,r),new Blob([o],{type:n});case"document":return s=new DOMParser,s.parseFromString(FN(i,r),n);case"json":return JSON.parse(FN(i,r));default:}}kt.prototype.fetch=function(e){return e=Vm(e,{}),e.method="GET",this._makeRequest(e)};kt.fetch=function(e){return new kt(e).fetch({responseType:e.responseType,overrideMimeType:e.overrideMimeType})};kt.prototype.delete=function(e){return e=Vm(e,{}),e.method="DELETE",this._makeRequest(e)};kt.delete=function(e){return new kt(e).delete({responseType:e.responseType,overrideMimeType:e.overrideMimeType,data:e.data})};kt.prototype.head=function(e){return e=Vm(e,{}),e.method="HEAD",this._makeRequest(e)};kt.head=function(e){return new kt(e).head({responseType:e.responseType,overrideMimeType:e.overrideMimeType})};kt.prototype.options=function(e){return e=Vm(e,{}),e.method="OPTIONS",this._makeRequest(e)};kt.options=function(e){return new kt(e).options({responseType:e.responseType,overrideMimeType:e.overrideMimeType})};kt.prototype.post=function(e,t){return qr.defined("data",e),t=Vm(t,{}),t.method="POST",t.data=e,this._makeRequest(t)};kt.post=function(e){return new kt(e).post(e.data,{responseType:e.responseType,overrideMimeType:e.overrideMimeType})};kt.prototype.put=function(e,t){return qr.defined("data",e),t=Vm(t,{}),t.method="PUT",t.data=e,this._makeRequest(t)};kt.put=function(e){return new kt(e).put(e.data,{responseType:e.responseType,overrideMimeType:e.overrideMimeType})};kt.prototype.patch=function(e,t){return qr.defined("data",e),t=Vm(t,{}),t.method="PATCH",t.data=e,this._makeRequest(t)};kt.patch=function(e){return new kt(e).patch(e.data,{responseType:e.responseType,overrideMimeType:e.overrideMimeType})};kt._Implementations={};kt._Implementations.loadImageElement=function(e,t,n){let i=new Image;i.onload=function(){i.naturalWidth===0&&i.naturalHeight===0&&i.width===0&&i.height===0&&(i.width=300,i.height=150),n.resolve(i)},i.onerror=function(r){n.reject(r)},t&&(VI.contains(e)?i.crossOrigin="use-credentials":i.crossOrigin=""),i.src=e};kt._Implementations.createImage=function(e,t,n,i,r,o,s){let a=e.url;kt.supportsImageBitmapOptions().then(function(c){if(!(c&&o)){kt._Implementations.loadImageElement(a,t,n);return}let u="blob",f="GET",d=tf(),p=kt._Implementations.loadWithXhr(a,u,f,void 0,s,d,void 0,void 0,void 0);return l(p)&&l(p.abort)&&(e.cancelFunction=function(){p.abort()}),d.promise.then(function(g){if(!l(g)){n.reject(new oe(`Successfully retrieved ${a} but it contained no content.`));return}return kt.createImageBitmapFromBlob(g,{flipY:i,premultiplyAlpha:!1,skipColorSpaceConversion:r})}).then(function(g){n.resolve(g)})}).catch(function(c){n.reject(c)})};kt.createImageBitmapFromBlob=function(e,t){return qr.defined("options",t),qr.typeOf.bool("options.flipY",t.flipY),qr.typeOf.bool("options.premultiplyAlpha",t.premultiplyAlpha),qr.typeOf.bool("options.skipColorSpaceConversion",t.skipColorSpaceConversion),createImageBitmap(e,{imageOrientation:t.flipY?"flipY":"none",premultiplyAlpha:t.premultiplyAlpha?"premultiply":"none",colorSpaceConversion:t.skipColorSpaceConversion?"none":"default"})};function MUe(e,t,n,i,r,o,s){fetch(e,{method:n,headers:r}).then(async a=>{if(!a.ok){let c={};a.headers.forEach((u,f)=>{c[f]=u}),o.reject(new O0(a.status,a,c));return}switch(t){case"text":o.resolve(a.text());break;case"json":o.resolve(a.json());break;default:o.resolve(new Uint8Array(await a.arrayBuffer()).buffer);break}}).catch(()=>{o.reject(new O0)})}var NUe=typeof XMLHttpRequest>"u";kt._Implementations.loadWithXhr=function(e,t,n,i,r,o,s){let a=RUe.exec(e);if(a!==null){o.resolve(OUe(a,t));return}if(NUe){MUe(e,t,n,i,r,o,s);return}let c=new XMLHttpRequest;if(VI.contains(e)&&(c.withCredentials=!0),c.open(n,e,!0),l(s)&&l(c.overrideMimeType)&&c.overrideMimeType(s),l(r))for(let f in r)r.hasOwnProperty(f)&&c.setRequestHeader(f,r[f]);l(t)&&(c.responseType=t);let u=!1;return typeof e=="string"&&(u=e.indexOf("file://")===0||typeof window<"u"&&window.location.origin==="file://"),c.onload=function(){if((c.status<200||c.status>=300)&&!(u&&c.status===0)){o.reject(new O0(c.status,c.response,c.getAllResponseHeaders()));return}let f=c.response,d=c.responseType;if(n==="HEAD"||n==="OPTIONS"){let g=c.getAllResponseHeaders().trim().split(/[\r\n]+/),m={};g.forEach(function(y){let A=y.split(": "),b=A.shift();m[b]=A.join(": ")}),o.resolve(m);return}if(c.status===204)o.resolve(void 0);else if(l(f)&&(!l(t)||d===t))o.resolve(f);else if(t==="json"&&typeof f=="string")try{o.resolve(JSON.parse(f))}catch(p){o.reject(p)}else(d===""||d==="document")&&l(c.responseXML)&&c.responseXML.hasChildNodes()?o.resolve(c.responseXML):(d===""||d==="text")&&l(c.responseText)?o.resolve(c.responseText):o.reject(new oe("Invalid XMLHttpRequest response type."))},c.onerror=function(f){o.reject(new O0)},c.send(i),c};kt._Implementations.loadAndExecuteScript=function(e,t,n){return SE(e,t).catch(function(i){n.reject(i)})};kt._DefaultImplementations={};kt._DefaultImplementations.createImage=kt._Implementations.createImage;kt._DefaultImplementations.loadWithXhr=kt._Implementations.loadWithXhr;kt._DefaultImplementations.loadAndExecuteScript=kt._Implementations.loadAndExecuteScript;kt.DEFAULT=Object.freeze(new kt({url:typeof document>"u"?"":document.location.href.split("?")[0]}));var De=kt;function HI(e){e=e??H.EMPTY_OBJECT,this._dates=void 0,this._samples=void 0,this._dateColumn=-1,this._xPoleWanderRadiansColumn=-1,this._yPoleWanderRadiansColumn=-1,this._ut1MinusUtcSecondsColumn=-1,this._xCelestialPoleOffsetRadiansColumn=-1,this._yCelestialPoleOffsetRadiansColumn=-1,this._taiMinusUtcSecondsColumn=-1,this._columnCount=0,this._lastIndex=-1,this._addNewLeapSeconds=e.addNewLeapSeconds??!0,l(e.data)?qce(this,e.data):qce(this,{columnNames:["dateIso8601","modifiedJulianDateUtc","xPoleWanderRadians","yPoleWanderRadians","ut1MinusUtcSeconds","lengthOfDayCorrectionSeconds","xCelestialPoleOffsetRadians","yCelestialPoleOffsetRadians","taiMinusUtcSeconds"],samples:[]})}HI.fromUrl=async function(e,t){t=t??H.EMPTY_OBJECT;let n=De.createIfNeeded(e),i;try{i=await n.fetchJson()}catch{throw new oe(`An error occurred while retrieving the EOP data from the URL ${n.url}.`)}return new HI({addNewLeapSeconds:t.addNewLeapSeconds,data:i})};HI.NONE=Object.freeze({compute:function(e,t){return l(t)?(t.xPoleWander=0,t.yPoleWander=0,t.xPoleOffset=0,t.yPoleOffset=0,t.ut1MinusUtc=0):t=new gb(0,0,0,0,0),t}});HI.prototype.compute=function(e,t){if(!l(this._samples))return;if(l(t)||(t=new gb(0,0,0,0,0)),this._samples.length===0)return t.xPoleWander=0,t.yPoleWander=0,t.xPoleOffset=0,t.yPoleOffset=0,t.ut1MinusUtc=0,t;let n=this._dates,i=this._lastIndex,r,o;if(l(i)){let a=n[i],c=n[i+1],u=K.lessThanOrEquals(a,e),f=!l(c),d=f||K.greaterThanOrEquals(c,e);if(u&&d)return r=i,!f&&c.equals(e)&&++r,o=r+1,Xce(this,n,this._samples,e,r,o,t),t}let s=Pr(n,e,K.compare,this._dateColumn);return s>=0?(s<n.length-1&&n[s+1].equals(e)&&++s,r=s,o=s):(o=~s,r=o-1,r<0&&(r=0)),this._lastIndex=r,Xce(this,n,this._samples,e,r,o,t),t};function LUe(e,t){return K.compare(e.julianDate,t)}function qce(e,t){if(!l(t.columnNames))throw new oe("Error in loaded EOP data: The columnNames property is required.");if(!l(t.samples))throw new oe("Error in loaded EOP data: The samples property is required.");let n=t.columnNames.indexOf("modifiedJulianDateUtc"),i=t.columnNames.indexOf("xPoleWanderRadians"),r=t.columnNames.indexOf("yPoleWanderRadians"),o=t.columnNames.indexOf("ut1MinusUtcSeconds"),s=t.columnNames.indexOf("xCelestialPoleOffsetRadians"),a=t.columnNames.indexOf("yCelestialPoleOffsetRadians"),c=t.columnNames.indexOf("taiMinusUtcSeconds");if(n<0||i<0||r<0||o<0||s<0||a<0||c<0)throw new oe("Error in loaded EOP data: The columnNames property must include modifiedJulianDateUtc, xPoleWanderRadians, yPoleWanderRadians, ut1MinusUtcSeconds, xCelestialPoleOffsetRadians, yCelestialPoleOffsetRadians, and taiMinusUtcSeconds columns");let u=e._samples=t.samples,f=e._dates=[];e._dateColumn=n,e._xPoleWanderRadiansColumn=i,e._yPoleWanderRadiansColumn=r,e._ut1MinusUtcSecondsColumn=o,e._xCelestialPoleOffsetRadiansColumn=s,e._yCelestialPoleOffsetRadiansColumn=a,e._taiMinusUtcSecondsColumn=c,e._columnCount=t.columnNames.length,e._lastIndex=void 0;let d,p=e._addNewLeapSeconds;for(let g=0,m=u.length;g<m;g+=e._columnCount){let y=u[g+n],A=u[g+c],b=y+Un.MODIFIED_JULIAN_DATE_DIFFERENCE,x=new K(b,A,ai.TAI);if(f.push(x),p){if(A!==d&&l(d)){let T=K.leapSeconds,E=Pr(T,x,LUe);if(E<0){let v=new yr(x,A);T.splice(~E,0,v)}}d=A}}}function Yce(e,t,n,i,r){let o=n*i;r.xPoleWander=t[o+e._xPoleWanderRadiansColumn],r.yPoleWander=t[o+e._yPoleWanderRadiansColumn],r.xPoleOffset=t[o+e._xCelestialPoleOffsetRadiansColumn],r.yPoleOffset=t[o+e._yCelestialPoleOffsetRadiansColumn],r.ut1MinusUtc=t[o+e._ut1MinusUtcSecondsColumn]}function jI(e,t,n){return t+e*(n-t)}function Xce(e,t,n,i,r,o,s){let a=e._columnCount;if(o>t.length-1)return s.xPoleWander=0,s.yPoleWander=0,s.xPoleOffset=0,s.yPoleOffset=0,s.ut1MinusUtc=0,s;let c=t[r],u=t[o];if(c.equals(u)||i.equals(c))return Yce(e,n,r,a,s),s;if(i.equals(u))return Yce(e,n,o,a,s),s;let f=K.secondsDifference(i,c)/K.secondsDifference(u,c),d=r*a,p=o*a,g=n[d+e._ut1MinusUtcSecondsColumn],m=n[p+e._ut1MinusUtcSecondsColumn],y=m-g;if(y>.5||y<-.5){let A=n[d+e._taiMinusUtcSecondsColumn],b=n[p+e._taiMinusUtcSecondsColumn];A!==b&&(u.equals(i)?g=m:m-=b-A)}return s.xPoleWander=jI(f,n[d+e._xPoleWanderRadiansColumn],n[p+e._xPoleWanderRadiansColumn]),s.yPoleWander=jI(f,n[d+e._yPoleWanderRadiansColumn],n[p+e._yPoleWanderRadiansColumn]),s.xPoleOffset=jI(f,n[d+e._xCelestialPoleOffsetRadiansColumn],n[p+e._xCelestialPoleOffsetRadiansColumn]),s.yPoleOffset=jI(f,n[d+e._yCelestialPoleOffsetRadiansColumn],n[p+e._yCelestialPoleOffsetRadiansColumn]),s.ut1MinusUtc=jI(f,g,m),s}var kN=HI;function Bc(e,t,n){this.heading=e??0,this.pitch=t??0,this.roll=n??0}Bc.fromQuaternion=function(e,t){l(t)||(t=new Bc);let n=2*(e.w*e.y-e.z*e.x),i=1-2*(e.x*e.x+e.y*e.y),r=2*(e.w*e.x+e.y*e.z),o=1-2*(e.y*e.y+e.z*e.z),s=2*(e.w*e.z+e.x*e.y);return t.heading=-Math.atan2(s,o),t.roll=Math.atan2(r,i),t.pitch=-P.asinClamped(n),t};Bc.fromDegrees=function(e,t,n,i){return l(i)||(i=new Bc),i.heading=e*P.RADIANS_PER_DEGREE,i.pitch=t*P.RADIANS_PER_DEGREE,i.roll=n*P.RADIANS_PER_DEGREE,i};Bc.clone=function(e,t){if(l(e))return l(t)?(t.heading=e.heading,t.pitch=e.pitch,t.roll=e.roll,t):new Bc(e.heading,e.pitch,e.roll)};Bc.equals=function(e,t){return e===t||l(e)&&l(t)&&e.heading===t.heading&&e.pitch===t.pitch&&e.roll===t.roll};Bc.equalsEpsilon=function(e,t,n,i){return e===t||l(e)&&l(t)&&P.equalsEpsilon(e.heading,t.heading,n,i)&&P.equalsEpsilon(e.pitch,t.pitch,n,i)&&P.equalsEpsilon(e.roll,t.roll,n,i)};Bc.prototype.clone=function(e){return Bc.clone(this,e)};Bc.prototype.equals=function(e){return Bc.equals(this,e)};Bc.prototype.equalsEpsilon=function(e,t,n){return Bc.equalsEpsilon(this,e,t,n)};Bc.prototype.toString=function(){return`(${this.heading}, ${this.pitch}, ${this.roll})`};var kc=Bc;var Kce=/((?:.*\/)|^)Cesium\.js(?:\?|\#|$)/;function FUe(){let e=document.getElementsByTagName("script");for(let t=0,n=e.length;t<n;++t){let i=e[t].getAttribute("src"),r=Kce.exec(i);if(r!==null)return r[1]}}var UN;function $ce(e){return typeof document>"u"?e:(l(UN)||(UN=document.createElement("a")),UN.href=e,UN.href)}var bb;function Jce(){if(l(bb))return bb;let e;return typeof CESIUM_BASE_URL<"u"?e=CESIUM_BASE_URL:l(import.meta?.url)?e=fh(".",import.meta.url):typeof define=="object"&&l(define.amd)&&!define.amd.toUrlUndefined&&l(iN.toUrl)?e=fh("..",xb("Core/buildModuleUrl.js")):e=FUe(),bb=new De({url:$ce(e)}),bb.appendForwardSlash(),bb}function BUe(e){return $ce(iN.toUrl(`../${e}`))}function Zce(e){return Jce().getDerivedResource({url:e}).url}var zN;function xb(e){return l(zN)||(typeof define=="object"&&l(define.amd)&&!define.amd.toUrlUndefined&&l(iN.toUrl)?zN=BUe:zN=Zce),zN(e)}xb._cesiumScriptRegex=Kce;xb._buildModuleUrlFromBaseUrl=Zce;xb._clearBaseResource=function(){bb=void 0};xb.setBaseUrl=function(e){bb=De.DEFAULT.getDerivedResource({url:e})};xb.getCesiumBaseUrl=Jce;var Zt=xb;function kUe(e,t,n){this.x=e,this.y=t,this.s=n}var RE=kUe;function VN(e){e=e??H.EMPTY_OBJECT,this._xysFileUrlTemplate=De.createIfNeeded(e.xysFileUrlTemplate),this._interpolationOrder=e.interpolationOrder??9,this._sampleZeroJulianEphemerisDate=e.sampleZeroJulianEphemerisDate??24423965e-1,this._sampleZeroDateTT=new K(this._sampleZeroJulianEphemerisDate,0,ai.TAI),this._stepSizeDays=e.stepSizeDays??1,this._samplesPerXysFile=e.samplesPerXysFile??1e3,this._totalSamples=e.totalSamples??27426,this._samples=new Array(this._totalSamples*3),this._chunkDownloadsInProgress=[];let t=this._interpolationOrder,n=this._denominators=new Array(t+1),i=this._xTable=new Array(t+1),r=Math.pow(this._stepSizeDays,t);for(let o=0;o<=t;++o){n[o]=r,i[o]=o*this._stepSizeDays;for(let s=0;s<=t;++s)s!==o&&(n[o]*=o-s);n[o]=1/n[o]}this._work=new Array(t+1),this._coef=new Array(t+1)}var UUe=new K(0,0,ai.TAI);function Lq(e,t,n){let i=UUe;return i.dayNumber=t,i.secondsOfDay=n,K.daysDifference(i,e._sampleZeroDateTT)}VN.prototype.preload=function(e,t,n,i){let r=Lq(this,e,t),o=Lq(this,n,i),s=r/this._stepSizeDays-this._interpolationOrder/2|0;s<0&&(s=0);let a=o/this._stepSizeDays-this._interpolationOrder/2|0+this._interpolationOrder;a>=this._totalSamples&&(a=this._totalSamples-1);let c=s/this._samplesPerXysFile|0,u=a/this._samplesPerXysFile|0,f=[];for(let d=c;d<=u;++d)f.push(Fq(this,d));return Promise.all(f)};VN.prototype.computeXysRadians=function(e,t,n){let i=Lq(this,e,t);if(i<0)return;let r=i/this._stepSizeDays|0;if(r>=this._totalSamples)return;let o=this._interpolationOrder,s=r-(o/2|0);s<0&&(s=0);let a=s+o;a>=this._totalSamples&&(a=this._totalSamples-1,s=a-o,s<0&&(s=0));let c=!1,u=this._samples;if(l(u[s*3])||(Fq(this,s/this._samplesPerXysFile|0),c=!0),l(u[a*3])||(Fq(this,a/this._samplesPerXysFile|0),c=!0),c)return;l(n)?(n.x=0,n.y=0,n.s=0):n=new RE(0,0,0);let f=i-s*this._stepSizeDays,d=this._work,p=this._denominators,g=this._coef,m=this._xTable,y,A;for(y=0;y<=o;++y)d[y]=f-m[y];for(y=0;y<=o;++y){for(g[y]=1,A=0;A<=o;++A)A!==y&&(g[y]*=d[A]);g[y]*=p[y];let b=(s+y)*3;n.x+=g[y]*u[b++],n.y+=g[y]*u[b++],n.s+=g[y]*u[b]}return n};VN.prototype._updateChunkData=function(e,{samples:t}){this._chunkDownloadsInProgress[e]=void 0;let n=this._samplesPerXysFile,i=e*n*3;for(let r=0;r<t.length;++r)this._samples[i+r]=t[r]};async function zUe(e,t,n){try{let i=await e.fetchJson();n._updateChunkData(t,i)}catch{}}function Fq(e,t){if(l(e._chunkDownloadsInProgress[t]))return e._chunkDownloadsInProgress[t];let n,i=e._xysFileUrlTemplate;l(i)?n=i.getDerivedResource({templateValues:{0:t}}):n=new De({url:Zt(`Assets/IAU2006_XYS/IAU2006_XYS_${t}.json`)});let r=zUe(n,t,e);return e._chunkDownloadsInProgress[t]=r,r}var jN=VN;function dt(e,t,n,i){this.x=e??0,this.y=t??0,this.z=n??0,this.w=i??0}var GI=new h;dt.fromAxisAngle=function(e,t,n){let i=t/2,r=Math.sin(i);GI=h.normalize(e,GI);let o=GI.x*r,s=GI.y*r,a=GI.z*r,c=Math.cos(i);return l(n)?(n.x=o,n.y=s,n.z=a,n.w=c,n):new dt(o,s,a,c)};var VUe=[1,2,0],jUe=new Array(3);dt.fromRotationMatrix=function(e,t){let n,i,r,o,s,a=e[$.COLUMN0ROW0],c=e[$.COLUMN1ROW1],u=e[$.COLUMN2ROW2],f=a+c+u;if(f>0)n=Math.sqrt(f+1),s=.5*n,n=.5/n,i=(e[$.COLUMN1ROW2]-e[$.COLUMN2ROW1])*n,r=(e[$.COLUMN2ROW0]-e[$.COLUMN0ROW2])*n,o=(e[$.COLUMN0ROW1]-e[$.COLUMN1ROW0])*n;else{let d=VUe,p=0;c>a&&(p=1),u>a&&u>c&&(p=2);let g=d[p],m=d[g];n=Math.sqrt(e[$.getElementIndex(p,p)]-e[$.getElementIndex(g,g)]-e[$.getElementIndex(m,m)]+1);let y=jUe;y[p]=.5*n,n=.5/n,s=(e[$.getElementIndex(m,g)]-e[$.getElementIndex(g,m)])*n,y[g]=(e[$.getElementIndex(g,p)]+e[$.getElementIndex(p,g)])*n,y[m]=(e[$.getElementIndex(m,p)]+e[$.getElementIndex(p,m)])*n,i=-y[0],r=-y[1],o=-y[2]}return l(t)?(t.x=i,t.y=r,t.z=o,t.w=s,t):new dt(i,r,o,s)};var Qce=new dt,ele=new dt,Bq=new dt,tle=new dt;dt.fromHeadingPitchRoll=function(e,t){return tle=dt.fromAxisAngle(h.UNIT_X,e.roll,Qce),Bq=dt.fromAxisAngle(h.UNIT_Y,-e.pitch,t),t=dt.multiply(Bq,tle,Bq),ele=dt.fromAxisAngle(h.UNIT_Z,-e.heading,Qce),dt.multiply(ele,t,t)};var HN=new h,kq=new h,dh=new dt,nle=new dt,GN=new dt;dt.packedLength=4;dt.pack=function(e,t,n){return n=n??0,t[n++]=e.x,t[n++]=e.y,t[n++]=e.z,t[n]=e.w,t};dt.unpack=function(e,t,n){return t=t??0,l(n)||(n=new dt),n.x=e[t],n.y=e[t+1],n.z=e[t+2],n.w=e[t+3],n};dt.packedInterpolationLength=3;dt.convertPackedArrayForInterpolation=function(e,t,n,i){dt.unpack(e,n*4,GN),dt.conjugate(GN,GN);for(let r=0,o=n-t+1;r<o;r++){let s=r*3;dt.unpack(e,(t+r)*4,dh),dt.multiply(dh,GN,dh),dh.w<0&&dt.negate(dh,dh),dt.computeAxis(dh,HN);let a=dt.computeAngle(dh);l(i)||(i=[]),i[s]=HN.x*a,i[s+1]=HN.y*a,i[s+2]=HN.z*a}};dt.unpackInterpolationResult=function(e,t,n,i,r){l(r)||(r=new dt),h.fromArray(e,0,kq);let o=h.magnitude(kq);return dt.unpack(t,i*4,nle),o===0?dt.clone(dt.IDENTITY,dh):dt.fromAxisAngle(kq,o,dh),dt.multiply(dh,nle,r)};dt.clone=function(e,t){if(l(e))return l(t)?(t.x=e.x,t.y=e.y,t.z=e.z,t.w=e.w,t):new dt(e.x,e.y,e.z,e.w)};dt.conjugate=function(e,t){return t.x=-e.x,t.y=-e.y,t.z=-e.z,t.w=e.w,t};dt.magnitudeSquared=function(e){return e.x*e.x+e.y*e.y+e.z*e.z+e.w*e.w};dt.magnitude=function(e){return Math.sqrt(dt.magnitudeSquared(e))};dt.normalize=function(e,t){let n=1/dt.magnitude(e),i=e.x*n,r=e.y*n,o=e.z*n,s=e.w*n;return t.x=i,t.y=r,t.z=o,t.w=s,t};dt.inverse=function(e,t){let n=dt.magnitudeSquared(e);return t=dt.conjugate(e,t),dt.multiplyByScalar(t,1/n,t)};dt.add=function(e,t,n){return n.x=e.x+t.x,n.y=e.y+t.y,n.z=e.z+t.z,n.w=e.w+t.w,n};dt.subtract=function(e,t,n){return n.x=e.x-t.x,n.y=e.y-t.y,n.z=e.z-t.z,n.w=e.w-t.w,n};dt.negate=function(e,t){return t.x=-e.x,t.y=-e.y,t.z=-e.z,t.w=-e.w,t};dt.dot=function(e,t){return e.x*t.x+e.y*t.y+e.z*t.z+e.w*t.w};dt.multiply=function(e,t,n){let i=e.x,r=e.y,o=e.z,s=e.w,a=t.x,c=t.y,u=t.z,f=t.w,d=s*a+i*f+r*u-o*c,p=s*c-i*u+r*f+o*a,g=s*u+i*c-r*a+o*f,m=s*f-i*a-r*c-o*u;return n.x=d,n.y=p,n.z=g,n.w=m,n};dt.multiplyByScalar=function(e,t,n){return n.x=e.x*t,n.y=e.y*t,n.z=e.z*t,n.w=e.w*t,n};dt.divideByScalar=function(e,t,n){return n.x=e.x/t,n.y=e.y/t,n.z=e.z/t,n.w=e.w/t,n};dt.computeAxis=function(e,t){let n=e.w;if(Math.abs(n-1)<P.EPSILON6||Math.abs(n+1)<P.EPSILON6)return t.x=1,t.y=t.z=0,t;let i=1/Math.sqrt(1-n*n);return t.x=e.x*i,t.y=e.y*i,t.z=e.z*i,t};dt.computeAngle=function(e){return Math.abs(e.w-1)<P.EPSILON6?0:2*Math.acos(e.w)};var Uq=new dt;dt.lerp=function(e,t,n,i){return Uq=dt.multiplyByScalar(t,n,Uq),i=dt.multiplyByScalar(e,1-n,i),dt.add(Uq,i,i)};var ile=new dt,zq=new dt,Vq=new dt;dt.slerp=function(e,t,n,i){let r=dt.dot(e,t),o=t;if(r<0&&(r=-r,o=ile=dt.negate(t,ile)),1-r<P.EPSILON6)return dt.lerp(e,o,n,i);let s=Math.acos(r);return zq=dt.multiplyByScalar(e,Math.sin((1-n)*s),zq),Vq=dt.multiplyByScalar(o,Math.sin(n*s),Vq),i=dt.add(zq,Vq,i),dt.multiplyByScalar(i,1/Math.sin(s),i)};dt.log=function(e,t){let n=P.acosClamped(e.w),i=0;return n!==0&&(i=n/Math.sin(n)),h.multiplyByScalar(e,i,t)};dt.exp=function(e,t){let n=h.magnitude(e),i=0;return n!==0&&(i=Math.sin(n)/n),t.x=e.x*i,t.y=e.y*i,t.z=e.z*i,t.w=Math.cos(n),t};var HUe=new h,GUe=new h,WI=new dt,OE=new dt;dt.computeInnerQuadrangle=function(e,t,n,i){let r=dt.conjugate(t,WI);dt.multiply(r,n,OE);let o=dt.log(OE,HUe);dt.multiply(r,e,OE);let s=dt.log(OE,GUe);return h.add(o,s,o),h.multiplyByScalar(o,.25,o),h.negate(o,o),dt.exp(o,WI),dt.multiply(t,WI,i)};dt.squad=function(e,t,n,i,r,o){let s=dt.slerp(e,t,r,WI),a=dt.slerp(n,i,r,OE);return dt.slerp(s,a,2*r*(1-r),o)};var WUe=new dt,rle=1.9011074535173003,WN=dn.supportsTypedArrays()?new Float32Array(8):[],qN=dn.supportsTypedArrays()?new Float32Array(8):[],N0=dn.supportsTypedArrays()?new Float32Array(8):[],L0=dn.supportsTypedArrays()?new Float32Array(8):[];for(let e=0;e<7;++e){let t=e+1,n=2*t+1;WN[e]=1/(t*n),qN[e]=t/n}WN[7]=rle/136;qN[7]=rle*8/17;dt.fastSlerp=function(e,t,n,i){let r=dt.dot(e,t),o;r>=0?o=1:(o=-1,r=-r);let s=r-1,a=1-n,c=n*n,u=a*a;for(let g=7;g>=0;--g)N0[g]=(WN[g]*c-qN[g])*s,L0[g]=(WN[g]*u-qN[g])*s;let f=o*n*(1+N0[0]*(1+N0[1]*(1+N0[2]*(1+N0[3]*(1+N0[4]*(1+N0[5]*(1+N0[6]*(1+N0[7])))))))),d=a*(1+L0[0]*(1+L0[1]*(1+L0[2]*(1+L0[3]*(1+L0[4]*(1+L0[5]*(1+L0[6]*(1+L0[7])))))))),p=dt.multiplyByScalar(e,d,WUe);return dt.multiplyByScalar(t,f,i),dt.add(p,i,i)};dt.fastSquad=function(e,t,n,i,r,o){let s=dt.fastSlerp(e,t,r,WI),a=dt.fastSlerp(n,i,r,OE);return dt.fastSlerp(s,a,2*r*(1-r),o)};dt.equals=function(e,t){return e===t||l(e)&&l(t)&&e.x===t.x&&e.y===t.y&&e.z===t.z&&e.w===t.w};dt.equalsEpsilon=function(e,t,n){return n=n??0,e===t||l(e)&&l(t)&&Math.abs(e.x-t.x)<=n&&Math.abs(e.y-t.y)<=n&&Math.abs(e.z-t.z)<=n&&Math.abs(e.w-t.w)<=n};dt.ZERO=Object.freeze(new dt(0,0,0,0));dt.IDENTITY=Object.freeze(new dt(0,0,0,1));dt.prototype.clone=function(e){return dt.clone(this,e)};dt.prototype.equals=function(e){return dt.equals(this,e)};dt.prototype.equalsEpsilon=function(e,t){return dt.equalsEpsilon(this,e,t)};dt.prototype.toString=function(){return`(${this.x}, ${this.y}, ${this.z}, ${this.w})`};var Le=dt;var bi={},jq={up:{south:"east",north:"west",west:"south",east:"north"},down:{south:"west",north:"east",west:"north",east:"south"},south:{up:"west",down:"east",west:"down",east:"up"},north:{up:"east",down:"west",west:"up",east:"down"},west:{up:"north",down:"south",north:"down",south:"up"},east:{up:"south",down:"north",north:"up",south:"down"}},ME={north:[-1,0,0],east:[0,1,0],up:[0,0,1],south:[1,0,0],west:[0,-1,0],down:[0,0,-1]},Hq={},su={east:new h,north:new h,up:new h,west:new h,south:new h,down:new h},w_=new h,I_=new h,P_=new h;bi.localFrameToFixedFrameGenerator=function(e,t){if(!jq.hasOwnProperty(e)||!jq[e].hasOwnProperty(t))throw new pe("firstAxis and secondAxis must be east, north, up, west, south or down.");let n=jq[e][t],i,r=e+t;return l(Hq[r])?i=Hq[r]:(i=function(o,s,a){if(l(a)||(a=new M),h.equalsEpsilon(o,h.ZERO,P.EPSILON14))h.unpack(ME[e],0,w_),h.unpack(ME[t],0,I_),h.unpack(ME[n],0,P_);else if(P.equalsEpsilon(o.x,0,P.EPSILON14)&&P.equalsEpsilon(o.y,0,P.EPSILON14)){let c=P.sign(o.z);h.unpack(ME[e],0,w_),e!=="east"&&e!=="west"&&h.multiplyByScalar(w_,c,w_),h.unpack(ME[t],0,I_),t!=="east"&&t!=="west"&&h.multiplyByScalar(I_,c,I_),h.unpack(ME[n],0,P_),n!=="east"&&n!=="west"&&h.multiplyByScalar(P_,c,P_)}else{s=s??ee.default,s.geodeticSurfaceNormal(o,su.up);let c=su.up,u=su.east;u.x=-o.y,u.y=o.x,u.z=0,h.normalize(u,su.east),h.cross(c,u,su.north),h.multiplyByScalar(su.up,-1,su.down),h.multiplyByScalar(su.east,-1,su.west),h.multiplyByScalar(su.north,-1,su.south),w_=su[e],I_=su[t],P_=su[n]}return a[0]=w_.x,a[1]=w_.y,a[2]=w_.z,a[3]=0,a[4]=I_.x,a[5]=I_.y,a[6]=I_.z,a[7]=0,a[8]=P_.x,a[9]=P_.y,a[10]=P_.z,a[11]=0,a[12]=o.x,a[13]=o.y,a[14]=o.z,a[15]=1,a},Hq[r]=i),i};bi.eastNorthUpToFixedFrame=bi.localFrameToFixedFrameGenerator("east","north");bi.northEastDownToFixedFrame=bi.localFrameToFixedFrameGenerator("north","east");bi.northUpEastToFixedFrame=bi.localFrameToFixedFrameGenerator("north","up");bi.northWestUpToFixedFrame=bi.localFrameToFixedFrameGenerator("north","west");var qUe=new Le,YUe=new h(1,1,1),XUe=new M;bi.headingPitchRollToFixedFrame=function(e,t,n,i,r){i=i??bi.eastNorthUpToFixedFrame;let o=Le.fromHeadingPitchRoll(t,qUe),s=M.fromTranslationQuaternionRotationScale(h.ZERO,o,YUe,XUe);return r=i(e,n,r),M.multiply(r,s,r)};var KUe=new M,$Ue=new $;bi.headingPitchRollQuaternion=function(e,t,n,i,r){let o=bi.headingPitchRollToFixedFrame(e,t,n,i,KUe),s=M.getMatrix3(o,$Ue);return Le.fromRotationMatrix(s,r)};var JUe=new h(1,1,1),ZUe=new h,ole=new M,QUe=new M,eze=new $,tze=new Le;bi.fixedFrameToHeadingPitchRoll=function(e,t,n,i){t=t??ee.default,n=n??bi.eastNorthUpToFixedFrame,l(i)||(i=new kc);let r=M.getTranslation(e,ZUe);if(h.equals(r,h.ZERO))return i.heading=0,i.pitch=0,i.roll=0,i;let o=M.inverseTransformation(n(r,t,ole),ole),s=M.setScale(e,JUe,QUe);s=M.setTranslation(s,h.ZERO,s),o=M.multiply(o,s,o);let a=Le.fromRotationMatrix(M.getMatrix3(o,eze),tze);return a=Le.normalize(a,a),kc.fromQuaternion(a,i)};var nze=6*3600+2460+50.54841,ize=8640184812866e-6,rze=.093104,oze=-62e-7,sze=11772758384668e-32,aze=72921158553e-15,cze=P.TWO_PI/86400,YN=new K;bi.computeIcrfToCentralBodyFixedMatrix=function(e,t){let n=bi.computeIcrfToFixedMatrix(e,t);return l(n)||(n=bi.computeTemeToPseudoFixedMatrix(e,t)),n};bi.computeTemeToPseudoFixedMatrix=function(e,t){YN=K.addSeconds(e,-K.computeTaiMinusUtc(e),YN);let n=YN.dayNumber,i=YN.secondsOfDay,r,o=n-2451545;i>=43200?r=(o+.5)/Un.DAYS_PER_JULIAN_CENTURY:r=(o-.5)/Un.DAYS_PER_JULIAN_CENTURY;let a=(nze+r*(ize+r*(rze+r*oze)))*cze%P.TWO_PI,c=aze+sze*(n-24515455e-1),u=(i+Un.SECONDS_PER_DAY*.5)%Un.SECONDS_PER_DAY,f=a+c*u,d=Math.cos(f),p=Math.sin(f);return l(t)?(t[0]=d,t[1]=-p,t[2]=0,t[3]=p,t[4]=d,t[5]=0,t[6]=0,t[7]=0,t[8]=1,t):new $(d,p,0,-p,d,0,0,0,1)};bi.iau2006XysData=new jN;bi.earthOrientationParameters=kN.NONE;var qq=32.184,lze=2451545;bi.preloadIcrfFixed=function(e){let t=e.start.dayNumber,n=e.start.secondsOfDay+qq,i=e.stop.dayNumber,r=e.stop.secondsOfDay+qq;return bi.iau2006XysData.preload(t,n,i,r)};bi.computeIcrfToFixedMatrix=function(e,t){l(t)||(t=new $);let n=bi.computeFixedToIcrfMatrix(e,t);if(l(n))return $.transpose(n,t)};var uze=32.184,fze=2451545,XN=new kc,dze=new $,hze=new K;bi.computeMoonFixedToIcrfMatrix=function(e,t){l(t)||(t=new $);let n=K.addSeconds(e,uze,hze),i=K.totalDays(n)-fze,r=P.toRadians(12.112)-P.toRadians(.052992)*i,o=P.toRadians(24.224)-P.toRadians(.105984)*i,s=P.toRadians(227.645)+P.toRadians(13.012)*i,a=P.toRadians(261.105)+P.toRadians(13.340716)*i,c=P.toRadians(358)+P.toRadians(.9856)*i;return XN.pitch=P.toRadians(180)-P.toRadians(3.878)*Math.sin(r)-P.toRadians(.12)*Math.sin(o)+P.toRadians(.07)*Math.sin(s)-P.toRadians(.017)*Math.sin(a),XN.roll=P.toRadians(66.53-90)+P.toRadians(1.543)*Math.cos(r)+P.toRadians(.24)*Math.cos(o)-P.toRadians(.028)*Math.cos(s)+P.toRadians(.007)*Math.cos(a),XN.heading=P.toRadians(244.375-90)+P.toRadians(13.17635831)*i+P.toRadians(3.558)*Math.sin(r)+P.toRadians(.121)*Math.sin(o)-P.toRadians(.064)*Math.sin(s)+P.toRadians(.016)*Math.sin(a)+P.toRadians(.025)*Math.sin(c),$.fromHeadingPitchRoll(XN,dze,t)};bi.computeIcrfToMoonFixedMatrix=function(e,t){l(t)||(t=new $);let n=bi.computeMoonFixedToIcrfMatrix(e,t);if(l(n))return $.transpose(n,t)};var mze=new RE(0,0,0),pze=new gb(0,0,0,0,0,0),Gq=new $,Wq=new $;bi.computeFixedToIcrfMatrix=function(e,t){l(t)||(t=new $);let n=bi.earthOrientationParameters.compute(e,pze);if(!l(n))return;let i=e.dayNumber,r=e.secondsOfDay+qq,o=bi.iau2006XysData.computeXysRadians(i,r,mze);if(!l(o))return;let s=o.x+n.xPoleOffset,a=o.y+n.yPoleOffset,c=1/(1+Math.sqrt(1-s*s-a*a)),u=Gq;u[0]=1-c*s*s,u[3]=-c*s*a,u[6]=s,u[1]=-c*s*a,u[4]=1-c*a*a,u[7]=a,u[2]=-s,u[5]=-a,u[8]=1-c*(s*s+a*a);let f=$.fromRotationZ(-o.s,Wq),d=$.multiply(u,f,Gq),p=e.dayNumber,g=e.secondsOfDay-K.computeTaiMinusUtc(e)+n.ut1MinusUtc,m=p-2451545,y=g/Un.SECONDS_PER_DAY,A=.779057273264+y+.00273781191135448*(m+y);A=A%1*P.TWO_PI;let b=$.fromRotationZ(A,Wq),x=$.multiply(d,b,Gq),T=Math.cos(n.xPoleWander),E=Math.cos(n.yPoleWander),v=Math.sin(n.xPoleWander),S=Math.sin(n.yPoleWander),I=i-lze+r/Un.SECONDS_PER_DAY;I/=36525;let R=-47e-6*I*P.RADIANS_PER_DEGREE/3600,O=Math.cos(R),L=Math.sin(R),_=Wq;return _[0]=T*O,_[1]=T*L,_[2]=v,_[3]=-E*L+S*v*O,_[4]=E*O+S*v*L,_[5]=-S*T,_[6]=-S*L-E*v*O,_[7]=S*O-E*v*L,_[8]=E*T,$.multiply(x,_,t)};var gze=new se;bi.pointToWindowCoordinates=function(e,t,n,i){return i=bi.pointToGLWindowCoordinates(e,t,n,i),i.y=2*t[5]-i.y,i};bi.pointToGLWindowCoordinates=function(e,t,n,i){l(i)||(i=new U);let r=gze;return M.multiplyByVector(e,se.fromElements(n.x,n.y,n.z,1,r),r),se.multiplyByScalar(r,1/r.w,r),M.multiplyByVector(t,r,r),U.fromCartesian4(r,i)};var _ze=new h,yze=new h,Aze=new h;bi.rotationMatrixFromPositionVelocity=function(e,t,n,i){let r=(n??ee.default).geodeticSurfaceNormal(e,_ze),o=h.cross(t,r,yze);h.equalsEpsilon(o,h.ZERO,P.EPSILON6)&&(o=h.clone(h.UNIT_X,o));let s=h.cross(o,t,Aze);return h.normalize(s,s),h.cross(t,s,o),h.negate(o,o),h.normalize(o,o),l(i)||(i=new $),i[0]=t.x,i[1]=t.y,i[2]=t.z,i[3]=o.x,i[4]=o.y,i[5]=o.z,i[6]=s.x,i[7]=s.y,i[8]=s.z,i};bi.SWIZZLE_3D_TO_2D_MATRIX=Object.freeze(new M(0,0,1,0,1,0,0,0,0,1,0,0,0,0,0,1));var sle=new he,Yq=new h,bze=new h,xze=new $,Xq=new M,ale=new M;bi.basisTo2D=function(e,t,n){let i=M.getTranslation(t,bze),r=e.ellipsoid,o;if(h.equals(i,h.ZERO))o=h.clone(h.ZERO,Yq);else{let f=r.cartesianToCartographic(i,sle);o=e.project(f,Yq),h.fromElements(o.z,o.x,o.y,o)}let s=bi.eastNorthUpToFixedFrame(i,r,Xq),a=M.inverseTransformation(s,ale),c=M.getMatrix3(t,xze),u=M.multiplyByMatrix3(a,c,n);return M.multiply(bi.SWIZZLE_3D_TO_2D_MATRIX,u,n),M.setTranslation(n,o,n),n};bi.ellipsoidTo2DModelMatrix=function(e,t,n){let i=e.ellipsoid,r=bi.eastNorthUpToFixedFrame(t,i,Xq),o=M.inverseTransformation(r,ale),s=i.cartesianToCartographic(t,sle),a=e.project(s,Yq);h.fromElements(a.z,a.x,a.y,a);let c=M.fromTranslation(a,Xq);return M.multiply(bi.SWIZZLE_3D_TO_2D_MATRIX,o,n),M.multiply(c,n,n),n};var At=bi;var NE=class e{constructor(t,n,i,r){this.west=t??0,this.south=n??0,this.east=i??0,this.north=r??0}get width(){return e.computeWidth(this)}get height(){return e.computeHeight(this)}static pack(t,n,i){return i=i??0,n[i++]=t.west,n[i++]=t.south,n[i++]=t.east,n[i]=t.north,n}static unpack(t,n,i){return n=n??0,l(i)||(i=new e),i.west=t[n++],i.south=t[n++],i.east=t[n++],i.north=t[n],i}static computeWidth(t){let n=t.east,i=t.west;return n<i&&(n+=P.TWO_PI),n-i}static computeHeight(t){return t.north-t.south}static fromDegrees(t,n,i,r,o){return t=P.toRadians(t??0),n=P.toRadians(n??0),i=P.toRadians(i??0),r=P.toRadians(r??0),l(o)?(o.west=t,o.south=n,o.east=i,o.north=r,o):new e(t,n,i,r)}static fromRadians(t,n,i,r,o){return l(o)?(o.west=t??0,o.south=n??0,o.east=i??0,o.north=r??0,o):new e(t,n,i,r)}static fromCartographicArray(t,n){let i=Number.MAX_VALUE,r=-Number.MAX_VALUE,o=Number.MAX_VALUE,s=-Number.MAX_VALUE,a=Number.MAX_VALUE,c=-Number.MAX_VALUE;for(let u=0,f=t.length;u<f;u++){let d=t[u];i=Math.min(i,d.longitude),r=Math.max(r,d.longitude),a=Math.min(a,d.latitude),c=Math.max(c,d.latitude);let p=d.longitude>=0?d.longitude:d.longitude+P.TWO_PI;o=Math.min(o,p),s=Math.max(s,p)}return r-i>s-o&&(i=o,r=s,r>P.PI&&(r=r-P.TWO_PI),i>P.PI&&(i=i-P.TWO_PI)),l(n)?(n.west=i,n.south=a,n.east=r,n.north=c,n):new e(i,a,r,c)}static fromCartesianArray(t,n,i){n=n??ee.default;let r=Number.MAX_VALUE,o=-Number.MAX_VALUE,s=Number.MAX_VALUE,a=-Number.MAX_VALUE,c=Number.MAX_VALUE,u=-Number.MAX_VALUE;for(let f=0,d=t.length;f<d;f++){let p=n.cartesianToCartographic(t[f]);r=Math.min(r,p.longitude),o=Math.max(o,p.longitude),c=Math.min(c,p.latitude),u=Math.max(u,p.latitude);let g=p.longitude>=0?p.longitude:p.longitude+P.TWO_PI;s=Math.min(s,g),a=Math.max(a,g)}return o-r>a-s&&(r=s,o=a,o>P.PI&&(o=o-P.TWO_PI),r>P.PI&&(r=r-P.TWO_PI)),l(i)?(i.west=r,i.south=c,i.east=o,i.north=u,i):new e(r,c,o,u)}static fromBoundingSphere(t,n,i){let r=t.center,o=t.radius;if(l(n)||(n=ee.default),l(i)||(i=new e),h.equals(r,h.ZERO))return e.clone(e.MAX_VALUE,i),i;let s=At.eastNorthUpToFixedFrame(r,n,Tze),a=M.multiplyByPointAsVector(s,h.UNIT_X,Eze);h.normalize(a,a);let c=M.multiplyByPointAsVector(s,h.UNIT_Y,Cze);h.normalize(c,c),h.multiplyByScalar(c,o,c),h.multiplyByScalar(a,o,a);let u=h.negate(c,Sze),f=h.negate(a,vze),d=Kq,p=d[0];return h.add(r,c,p),p=d[1],h.add(r,f,p),p=d[2],h.add(r,u,p),p=d[3],h.add(r,a,p),d[4]=r,e.fromCartesianArray(d,n,i)}static clone(t,n){if(l(t))return l(n)?(n.west=t.west,n.south=t.south,n.east=t.east,n.north=t.north,n):new e(t.west,t.south,t.east,t.north)}static equalsEpsilon(t,n,i){return i=i??0,t===n||l(t)&&l(n)&&Math.abs(t.west-n.west)<=i&&Math.abs(t.south-n.south)<=i&&Math.abs(t.east-n.east)<=i&&Math.abs(t.north-n.north)<=i}clone(t){return e.clone(this,t)}equals(t){return e.equals(this,t)}static equals(t,n){return t===n||l(t)&&l(n)&&t.west===n.west&&t.south===n.south&&t.east===n.east&&t.north===n.north}equalsEpsilon(t,n){return e.equalsEpsilon(this,t,n)}static _validate(t){}static southwest(t,n){return l(n)?(n.longitude=t.west,n.latitude=t.south,n.height=0,n):new he(t.west,t.south)}static northwest(t,n){return l(n)?(n.longitude=t.west,n.latitude=t.north,n.height=0,n):new he(t.west,t.north)}static northeast(t,n){return l(n)?(n.longitude=t.east,n.latitude=t.north,n.height=0,n):new he(t.east,t.north)}static southeast(t,n){return l(n)?(n.longitude=t.east,n.latitude=t.south,n.height=0,n):new he(t.east,t.south)}static center(t,n){let i=t.east,r=t.west;i<r&&(i+=P.TWO_PI);let o=P.negativePiToPi((r+i)*.5),s=(t.south+t.north)*.5;return l(n)?(n.longitude=o,n.latitude=s,n.height=0,n):new he(o,s)}static intersection(t,n,i){let r=t.east,o=t.west,s=n.east,a=n.west;r<o&&s>0?r+=P.TWO_PI:s<a&&r>0&&(s+=P.TWO_PI),r<o&&a<0?a+=P.TWO_PI:s<a&&o<0&&(o+=P.TWO_PI);let c=P.negativePiToPi(Math.max(o,a)),u=P.negativePiToPi(Math.min(r,s));if(c===P.PI&&u<P.PI&&(c=-P.PI),(t.west<t.east||n.west<n.east)&&u<=c)return;let f=Math.max(t.south,n.south),d=Math.min(t.north,n.north);if(!(f>=d))return l(i)?(i.west=c,i.south=f,i.east=u,i.north=d,i):new e(c,f,u,d)}static simpleIntersection(t,n,i){let r=Math.max(t.west,n.west),o=Math.max(t.south,n.south),s=Math.min(t.east,n.east),a=Math.min(t.north,n.north);if(!(o>=a||r>=s))return l(i)?(i.west=r,i.south=o,i.east=s,i.north=a,i):new e(r,o,s,a)}static union(t,n,i){l(i)||(i=new e);let r=t.east,o=t.west,s=n.east,a=n.west;r<o&&s>0?r+=P.TWO_PI:s<a&&r>0&&(s+=P.TWO_PI),r<o&&a<0?a+=P.TWO_PI:s<a&&o<0&&(o+=P.TWO_PI);let c=P.negativePiToPi(Math.min(o,a)),u=P.negativePiToPi(Math.max(r,s));return i.west=c,i.south=Math.min(t.south,n.south),i.east=u,i.north=Math.max(t.north,n.north),i}static expand(t,n,i){return l(i)||(i=new e),i.west=Math.min(t.west,n.longitude),i.south=Math.min(t.south,n.latitude),i.east=Math.max(t.east,n.longitude),i.north=Math.max(t.north,n.latitude),i}static contains(t,n){let i=n.longitude,r=n.latitude,o=t.west,s=t.east;return s<o&&(s+=P.TWO_PI,i<0&&(i+=P.TWO_PI)),(i>o||P.equalsEpsilon(i,o,P.EPSILON14))&&(i<s||P.equalsEpsilon(i,s,P.EPSILON14))&&r>=t.south&&r<=t.north}static subsample(t,n,i,r){n=n??ee.default,i=i??0,l(r)||(r=[]);let o=0,s=t.north,a=t.south,c=t.east,u=t.west,f=wze;f.height=i,f.longitude=u,f.latitude=s,r[o]=n.cartographicToCartesian(f,r[o]),o++,f.longitude=c,r[o]=n.cartographicToCartesian(f,r[o]),o++,f.latitude=a,r[o]=n.cartographicToCartesian(f,r[o]),o++,f.longitude=u,r[o]=n.cartographicToCartesian(f,r[o]),o++,s<0?f.latitude=s:a>0?f.latitude=a:f.latitude=0;for(let d=1;d<8;++d)f.longitude=-Math.PI+d*P.PI_OVER_TWO,e.contains(t,f)&&(r[o]=n.cartographicToCartesian(f,r[o]),o++);return f.latitude===0&&(f.longitude=u,r[o]=n.cartographicToCartesian(f,r[o]),o++,f.longitude=c,r[o]=n.cartographicToCartesian(f,r[o]),o++),r.length=o,r}static subsection(t,n,i,r,o,s){if(l(s)||(s=new e),t.west<=t.east){let c=t.east-t.west;s.west=t.west+n*c,s.east=t.west+r*c}else{let c=P.TWO_PI+t.east-t.west;s.west=P.negativePiToPi(t.west+n*c),s.east=P.negativePiToPi(t.west+r*c)}let a=t.north-t.south;return s.south=t.south+i*a,s.north=t.south+o*a,n===1&&(s.west=t.east),r===1&&(s.east=t.east),i===1&&(s.south=t.north),o===1&&(s.north=t.north),s}};NE.packedLength=4;var Tze=new M,Eze=new h,Cze=new h,vze=new h,Sze=new h,Kq=new Array(5);for(let e=0;e<Kq.length;++e)Kq[e]=new h;var wze=new he;NE.MAX_VALUE=Object.freeze(new NE(-Math.PI,-P.PI_OVER_TWO,Math.PI,P.PI_OVER_TWO));var ie=NE;function cs(e,t,n,i){this.x=e??0,this.y=t??0,this.width=n??0,this.height=i??0}cs.packedLength=4;cs.pack=function(e,t,n){return n=n??0,t[n++]=e.x,t[n++]=e.y,t[n++]=e.width,t[n]=e.height,t};cs.unpack=function(e,t,n){return t=t??0,l(n)||(n=new cs),n.x=e[t++],n.y=e[t++],n.width=e[t++],n.height=e[t],n};cs.fromPoints=function(e,t){if(l(t)||(t=new cs),!l(e)||e.length===0)return t.x=0,t.y=0,t.width=0,t.height=0,t;let n=e.length,i=e[0].x,r=e[0].y,o=e[0].x,s=e[0].y;for(let a=1;a<n;a++){let c=e[a],u=c.x,f=c.y;i=Math.min(u,i),o=Math.max(u,o),r=Math.min(f,r),s=Math.max(f,s)}return t.x=i,t.y=r,t.width=o-i,t.height=s-r,t};var cle=new ji,Ize=new he,Pze=new he;cs.fromRectangle=function(e,t,n){if(l(n)||(n=new cs),!l(e))return n.x=0,n.y=0,n.width=0,n.height=0,n;cle._ellipsoid=ee.default,t=t??cle;let i=t.project(ie.southwest(e,Ize)),r=t.project(ie.northeast(e,Pze));return U.subtract(r,i,r),n.x=i.x,n.y=i.y,n.width=r.x,n.height=r.y,n};cs.clone=function(e,t){if(l(e))return l(t)?(t.x=e.x,t.y=e.y,t.width=e.width,t.height=e.height,t):new cs(e.x,e.y,e.width,e.height)};cs.union=function(e,t,n){l(n)||(n=new cs);let i=Math.min(e.x,t.x),r=Math.min(e.y,t.y),o=Math.max(e.x+e.width,t.x+t.width),s=Math.max(e.y+e.height,t.y+t.height);return n.x=i,n.y=r,n.width=o-i,n.height=s-r,n};cs.expand=function(e,t,n){n=cs.clone(e,n);let i=t.x-n.x,r=t.y-n.y;return i>n.width?n.width=i:i<0&&(n.width-=i,n.x=t.x),r>n.height?n.height=r:r<0&&(n.height-=r,n.y=t.y),n};cs.intersect=function(e,t){let n=e.x,i=e.y,r=t.x,o=t.y;return n>r+t.width||n+e.width<r||i+e.height<o||i>o+t.height?$t.OUTSIDE:$t.INTERSECTING};cs.equals=function(e,t){return e===t||l(e)&&l(t)&&e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height};cs.prototype.clone=function(e){return cs.clone(this,e)};cs.prototype.intersect=function(e){return cs.intersect(this,e)};cs.prototype.equals=function(e){return cs.equals(this,e)};var et=cs;var Wa={POINTS:te.POINTS,LINES:te.LINES,LINE_LOOP:te.LINE_LOOP,LINE_STRIP:te.LINE_STRIP,TRIANGLES:te.TRIANGLES,TRIANGLE_STRIP:te.TRIANGLE_STRIP,TRIANGLE_FAN:te.TRIANGLE_FAN};Wa.isLines=function(e){return e===Wa.LINES||e===Wa.LINE_LOOP||e===Wa.LINE_STRIP};Wa.isTriangles=function(e){return e===Wa.TRIANGLES||e===Wa.TRIANGLE_STRIP||e===Wa.TRIANGLE_FAN};Wa.validate=function(e){return e===Wa.POINTS||e===Wa.LINES||e===Wa.LINE_LOOP||e===Wa.LINE_STRIP||e===Wa.TRIANGLES||e===Wa.TRIANGLE_STRIP||e===Wa.TRIANGLE_FAN};Object.freeze(Wa);var Oe=Wa;var LE=`in vec4 position; in vec2 textureCoordinates; out vec2 v_textureCoordinates; void main() @@ -85,14 +85,14 @@ void main() gl_Position = position; v_textureCoordinates = textureCoordinates; } -`;var Ho={CULL:1,OCCLUDE:2,EXECUTE_IN_CLOSEST_FRUSTUM:4,DEBUG_SHOW_BOUNDING_VOLUME:8,CAST_SHADOWS:16,RECEIVE_SHADOWS:32,PICK_ONLY:64,DEPTH_FOR_TRANSLUCENT_CLASSIFICATION:128},$q=class e{constructor(t=H.EMPTY_OBJECT){this._boundingVolume=t.boundingVolume,this._orientedBoundingBox=t.orientedBoundingBox,this._modelMatrix=t.modelMatrix,this._primitiveType=t.primitiveType??Oe.TRIANGLES,this._vertexArray=t.vertexArray,this._count=t.count,this._offset=t.offset??0,this._instanceCount=t.instanceCount??0,this._shaderProgram=t.shaderProgram,this._uniformMap=t.uniformMap,this._renderState=t.renderState,this._framebuffer=t.framebuffer,this._pass=t.pass,this._owner=t.owner,this._debugOverlappingFrustums=0,this._pickId=t.pickId,this._snapId=t.snapId,this._pickMetadataAllowed=t.pickMetadataAllowed===!0,this._pickedMetadataInfo=void 0,this._flags=0,this.cull=t.cull??!0,this.occlude=t.occlude??!0,this.executeInClosestFrustum=t.executeInClosestFrustum??!1,this.debugShowBoundingVolume=t.debugShowBoundingVolume??!1,this.castShadows=t.castShadows??!1,this.receiveShadows=t.receiveShadows??!1,this.pickOnly=t.pickOnly??!1,this.depthForTranslucentClassification=t.depthForTranslucentClassification??!1,this.dirty=!0,this.lastDirtyTime=0,this.derivedCommands={}}get boundingVolume(){return this._boundingVolume}set boundingVolume(t){this._boundingVolume!==t&&(this._boundingVolume=t,this.dirty=!0)}get orientedBoundingBox(){return this._orientedBoundingBox}set orientedBoundingBox(t){this._orientedBoundingBox!==t&&(this._orientedBoundingBox=t,this.dirty=!0)}get cull(){return Uc(this,Ho.CULL)}set cull(t){Uc(this,Ho.CULL)!==t&&(D_(this,Ho.CULL,t),this.dirty=!0)}get occlude(){return Uc(this,Ho.OCCLUDE)}set occlude(t){Uc(this,Ho.OCCLUDE)!==t&&(D_(this,Ho.OCCLUDE,t),this.dirty=!0)}get modelMatrix(){return this._modelMatrix}set modelMatrix(t){this._modelMatrix!==t&&(this._modelMatrix=t,this.dirty=!0)}get primitiveType(){return this._primitiveType}set primitiveType(t){this._primitiveType!==t&&(this._primitiveType=t,this.dirty=!0)}get vertexArray(){return this._vertexArray}set vertexArray(t){this._vertexArray!==t&&(this._vertexArray=t,this.dirty=!0)}get count(){return this._count}set count(t){this._count!==t&&(this._count=t,this.dirty=!0)}get offset(){return this._offset}set offset(t){this._offset!==t&&(this._offset=t,this.dirty=!0)}get instanceCount(){return this._instanceCount}set instanceCount(t){this._instanceCount!==t&&(this._instanceCount=t,this.dirty=!0)}get shaderProgram(){return this._shaderProgram}set shaderProgram(t){this._shaderProgram!==t&&(this._shaderProgram=t,this.dirty=!0)}get castShadows(){return Uc(this,Ho.CAST_SHADOWS)}set castShadows(t){Uc(this,Ho.CAST_SHADOWS)!==t&&(D_(this,Ho.CAST_SHADOWS,t),this.dirty=!0)}get receiveShadows(){return Uc(this,Ho.RECEIVE_SHADOWS)}set receiveShadows(t){Uc(this,Ho.RECEIVE_SHADOWS)!==t&&(D_(this,Ho.RECEIVE_SHADOWS,t),this.dirty=!0)}get uniformMap(){return this._uniformMap}set uniformMap(t){this._uniformMap!==t&&(this._uniformMap=t,this.dirty=!0)}get renderState(){return this._renderState}set renderState(t){this._renderState!==t&&(this._renderState=t,this.dirty=!0)}get framebuffer(){return this._framebuffer}set framebuffer(t){this._framebuffer!==t&&(this._framebuffer=t,this.dirty=!0)}get pass(){return this._pass}set pass(t){this._pass!==t&&(this._pass=t,this.dirty=!0)}get executeInClosestFrustum(){return Uc(this,Ho.EXECUTE_IN_CLOSEST_FRUSTUM)}set executeInClosestFrustum(t){Uc(this,Ho.EXECUTE_IN_CLOSEST_FRUSTUM)!==t&&(D_(this,Ho.EXECUTE_IN_CLOSEST_FRUSTUM,t),this.dirty=!0)}get owner(){return this._owner}set owner(t){this._owner!==t&&(this._owner=t,this.dirty=!0)}get debugShowBoundingVolume(){return Uc(this,Ho.DEBUG_SHOW_BOUNDING_VOLUME)}set debugShowBoundingVolume(t){Uc(this,Ho.DEBUG_SHOW_BOUNDING_VOLUME)!==t&&(D_(this,Ho.DEBUG_SHOW_BOUNDING_VOLUME,t),this.dirty=!0)}get debugOverlappingFrustums(){return this._debugOverlappingFrustums}set debugOverlappingFrustums(t){this._debugOverlappingFrustums!==t&&(this._debugOverlappingFrustums=t,this.dirty=!0)}get pickId(){return this._pickId}set pickId(t){this._pickId!==t&&(this._pickId=t,this.dirty=!0)}get snapId(){return this._snapId}set snapId(t){this._snapId!==t&&(this._snapId=t,this.dirty=!0)}get pickMetadataAllowed(){return this._pickMetadataAllowed}get pickedMetadataInfo(){return this._pickedMetadataInfo}set pickedMetadataInfo(t){this._pickedMetadataInfo!==t&&(this._pickedMetadataInfo=t,this.dirty=!0)}get pickOnly(){return Uc(this,Ho.PICK_ONLY)}set pickOnly(t){Uc(this,Ho.PICK_ONLY)!==t&&(D_(this,Ho.PICK_ONLY,t),this.dirty=!0)}get depthForTranslucentClassification(){return Uc(this,Ho.DEPTH_FOR_TRANSLUCENT_CLASSIFICATION)}set depthForTranslucentClassification(t){Uc(this,Ho.DEPTH_FOR_TRANSLUCENT_CLASSIFICATION)!==t&&(D_(this,Ho.DEPTH_FOR_TRANSLUCENT_CLASSIFICATION,t),this.dirty=!0)}static shallowClone(t,n){if(l(t))return l(n)||(n=new e),n._boundingVolume=t._boundingVolume,n._orientedBoundingBox=t._orientedBoundingBox,n._modelMatrix=t._modelMatrix,n._primitiveType=t._primitiveType,n._vertexArray=t._vertexArray,n._count=t._count,n._offset=t._offset,n._instanceCount=t._instanceCount,n._shaderProgram=t._shaderProgram,n._uniformMap=t._uniformMap,n._renderState=t._renderState,n._framebuffer=t._framebuffer,n._pass=t._pass,n._owner=t._owner,n._debugOverlappingFrustums=t._debugOverlappingFrustums,n._pickId=t._pickId,n._snapId=t._snapId,n._pickMetadataAllowed=t._pickMetadataAllowed,n._pickedMetadataInfo=t._pickedMetadataInfo,n._flags=t._flags,n.dirty=!0,n.lastDirtyTime=0,n}execute(t,n){t.draw(this,n)}};function Uc(e,t){return(e._flags&t)===t}function D_(e,t,n){n?e._flags|=t:e._flags&=~t}var at=$q;var Di={UNSIGNED_BYTE:te.UNSIGNED_BYTE,UNSIGNED_SHORT:te.UNSIGNED_SHORT,UNSIGNED_INT:te.UNSIGNED_INT,FLOAT:te.FLOAT,HALF_FLOAT:te.HALF_FLOAT_OES,UNSIGNED_INT_24_8:te.UNSIGNED_INT_24_8,UNSIGNED_SHORT_4_4_4_4:te.UNSIGNED_SHORT_4_4_4_4,UNSIGNED_SHORT_5_5_5_1:te.UNSIGNED_SHORT_5_5_5_1,UNSIGNED_SHORT_5_6_5:te.UNSIGNED_SHORT_5_6_5};Di.toWebGLConstant=function(e,t){switch(e){case Di.UNSIGNED_BYTE:return te.UNSIGNED_BYTE;case Di.UNSIGNED_SHORT:return te.UNSIGNED_SHORT;case Di.UNSIGNED_INT:return te.UNSIGNED_INT;case Di.FLOAT:return te.FLOAT;case Di.HALF_FLOAT:return t.webgl2?te.HALF_FLOAT:te.HALF_FLOAT_OES;case Di.UNSIGNED_INT_24_8:return te.UNSIGNED_INT_24_8;case Di.UNSIGNED_SHORT_4_4_4_4:return te.UNSIGNED_SHORT_4_4_4_4;case Di.UNSIGNED_SHORT_5_5_5_1:return te.UNSIGNED_SHORT_5_5_5_1;case Di.UNSIGNED_SHORT_5_6_5:return Di.UNSIGNED_SHORT_5_6_5}};Di.isPacked=function(e){return e===Di.UNSIGNED_INT_24_8||e===Di.UNSIGNED_SHORT_4_4_4_4||e===Di.UNSIGNED_SHORT_5_5_5_1||e===Di.UNSIGNED_SHORT_5_6_5};Di.sizeInBytes=function(e){switch(e){case Di.UNSIGNED_BYTE:return 1;case Di.UNSIGNED_SHORT:case Di.UNSIGNED_SHORT_4_4_4_4:case Di.UNSIGNED_SHORT_5_5_5_1:case Di.UNSIGNED_SHORT_5_6_5:case Di.HALF_FLOAT:return 2;case Di.UNSIGNED_INT:case Di.FLOAT:case Di.UNSIGNED_INT_24_8:return 4}};Di.validate=function(e){return e===Di.UNSIGNED_BYTE||e===Di.UNSIGNED_SHORT||e===Di.UNSIGNED_INT||e===Di.FLOAT||e===Di.HALF_FLOAT||e===Di.UNSIGNED_INT_24_8||e===Di.UNSIGNED_SHORT_4_4_4_4||e===Di.UNSIGNED_SHORT_5_5_5_1||e===Di.UNSIGNED_SHORT_5_6_5};Di.getTypedArrayConstructor=function(e){let t=Di.sizeInBytes(e);return t===Uint8Array.BYTES_PER_ELEMENT?Uint8Array:t===Uint16Array.BYTES_PER_ELEMENT?Uint16Array:t===Float32Array.BYTES_PER_ELEMENT&&e===Di.FLOAT?Float32Array:Uint32Array};Object.freeze(Di);var ze=Di;var ot={DEPTH_COMPONENT:te.DEPTH_COMPONENT,DEPTH_STENCIL:te.DEPTH_STENCIL,ALPHA:te.ALPHA,RED:te.RED,RG:te.RG,RGB:te.RGB,RGBA:te.RGBA,RED_INTEGER:te.RED_INTEGER,RG_INTEGER:te.RG_INTEGER,RGB_INTEGER:te.RGB_INTEGER,RGBA_INTEGER:te.RGBA_INTEGER,LUMINANCE:te.LUMINANCE,LUMINANCE_ALPHA:te.LUMINANCE_ALPHA,RGB_DXT1:te.COMPRESSED_RGB_S3TC_DXT1_EXT,RGBA_DXT1:te.COMPRESSED_RGBA_S3TC_DXT1_EXT,RGBA_DXT3:te.COMPRESSED_RGBA_S3TC_DXT3_EXT,RGBA_DXT5:te.COMPRESSED_RGBA_S3TC_DXT5_EXT,RGB_PVRTC_4BPPV1:te.COMPRESSED_RGB_PVRTC_4BPPV1_IMG,RGB_PVRTC_2BPPV1:te.COMPRESSED_RGB_PVRTC_2BPPV1_IMG,RGBA_PVRTC_4BPPV1:te.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG,RGBA_PVRTC_2BPPV1:te.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG,RGBA_ASTC:te.COMPRESSED_RGBA_ASTC_4x4_WEBGL,RGB_ETC1:te.COMPRESSED_RGB_ETC1_WEBGL,RGB8_ETC2:te.COMPRESSED_RGB8_ETC2,RGBA8_ETC2_EAC:te.COMPRESSED_RGBA8_ETC2_EAC,RGBA_BC7:te.COMPRESSED_RGBA_BPTC_UNORM};ot.componentsLength=function(e){switch(e){case ot.RGB:case ot.RGB_INTEGER:return 3;case ot.RGBA:case ot.RGBA_INTEGER:return 4;case ot.LUMINANCE_ALPHA:case ot.RG:case ot.RG_INTEGER:return 2;case ot.ALPHA:case ot.RED:case ot.RED_INTEGER:case ot.LUMINANCE:return 1;default:return 1}};ot.validate=function(e){return e===ot.DEPTH_COMPONENT||e===ot.DEPTH_STENCIL||e===ot.ALPHA||e===ot.RED||e===ot.RG||e===ot.RGB||e===ot.RGBA||e===ot.RED_INTEGER||e===ot.RG_INTEGER||e===ot.RGB_INTEGER||e===ot.RGBA_INTEGER||e===ot.LUMINANCE||e===ot.LUMINANCE_ALPHA||e===ot.RGB_DXT1||e===ot.RGBA_DXT1||e===ot.RGBA_DXT3||e===ot.RGBA_DXT5||e===ot.RGB_PVRTC_4BPPV1||e===ot.RGB_PVRTC_2BPPV1||e===ot.RGBA_PVRTC_4BPPV1||e===ot.RGBA_PVRTC_2BPPV1||e===ot.RGBA_ASTC||e===ot.RGB_ETC1||e===ot.RGB8_ETC2||e===ot.RGBA8_ETC2_EAC||e===ot.RGBA_BC7};ot.isColorFormat=function(e){return e===ot.RED||e===ot.ALPHA||e===ot.RGB||e===ot.RGBA||e===ot.LUMINANCE||e===ot.LUMINANCE_ALPHA};ot.isDepthFormat=function(e){return e===ot.DEPTH_COMPONENT||e===ot.DEPTH_STENCIL};ot.isCompressedFormat=function(e){return e===ot.RGB_DXT1||e===ot.RGBA_DXT1||e===ot.RGBA_DXT3||e===ot.RGBA_DXT5||e===ot.RGB_PVRTC_4BPPV1||e===ot.RGB_PVRTC_2BPPV1||e===ot.RGBA_PVRTC_4BPPV1||e===ot.RGBA_PVRTC_2BPPV1||e===ot.RGBA_ASTC||e===ot.RGB_ETC1||e===ot.RGB8_ETC2||e===ot.RGBA8_ETC2_EAC||e===ot.RGBA_BC7};ot.isDXTFormat=function(e){return e===ot.RGB_DXT1||e===ot.RGBA_DXT1||e===ot.RGBA_DXT3||e===ot.RGBA_DXT5};ot.isPVRTCFormat=function(e){return e===ot.RGB_PVRTC_4BPPV1||e===ot.RGB_PVRTC_2BPPV1||e===ot.RGBA_PVRTC_4BPPV1||e===ot.RGBA_PVRTC_2BPPV1};ot.isASTCFormat=function(e){return e===ot.RGBA_ASTC};ot.isETC1Format=function(e){return e===ot.RGB_ETC1};ot.isETC2Format=function(e){return e===ot.RGB8_ETC2||e===ot.RGBA8_ETC2_EAC};ot.isBC7Format=function(e){return e===ot.RGBA_BC7};ot.compressedTextureSizeInBytes=function(e,t,n){switch(e){case ot.RGB_DXT1:case ot.RGBA_DXT1:case ot.RGB_ETC1:case ot.RGB8_ETC2:return Math.floor((t+3)/4)*Math.floor((n+3)/4)*8;case ot.RGBA_DXT3:case ot.RGBA_DXT5:case ot.RGBA_ASTC:case ot.RGBA8_ETC2_EAC:return Math.floor((t+3)/4)*Math.floor((n+3)/4)*16;case ot.RGB_PVRTC_4BPPV1:case ot.RGBA_PVRTC_4BPPV1:return Math.floor((Math.max(t,8)*Math.max(n,8)*4+7)/8);case ot.RGB_PVRTC_2BPPV1:case ot.RGBA_PVRTC_2BPPV1:return Math.floor((Math.max(t,16)*Math.max(n,8)*2+7)/8);case ot.RGBA_BC7:return Math.ceil(t/4)*Math.ceil(n/4)*16;default:return 0}};ot.textureSizeInBytes=function(e,t,n,i){let r=ot.componentsLength(e);return ze.isPacked(t)&&(r=1),r*ze.sizeInBytes(t)*n*i};ot.texture3DSizeInBytes=function(e,t,n,i,r){let o=ot.componentsLength(e);return ze.isPacked(t)&&(o=1),o*ze.sizeInBytes(t)*n*i*r};ot.alignmentInBytes=function(e,t,n){let i=ot.textureSizeInBytes(e,t,n,1)%4;return i===0?4:i===2?2:1};ot.createTypedArray=function(e,t,n,i){let r=ze.getTypedArrayConstructor(t),o=ot.componentsLength(e)*n*i;return new r(o)};ot.flipY=function(e,t,n,i,r){if(r===1)return e;let o=ot.createTypedArray(t,n,i,r),s=ot.componentsLength(t),a=i*s;for(let c=0;c<r;++c){let u=c*i*s,f=(r-c-1)*i*s;for(let d=0;d<a;++d)o[f+d]=e[u+d]}return o};ot.toInternalFormat=function(e,t,n){if(!n.webgl2)return e;if(e===ot.DEPTH_STENCIL)return te.DEPTH24_STENCIL8;if(e===ot.DEPTH_COMPONENT){if(t===ze.UNSIGNED_SHORT)return te.DEPTH_COMPONENT16;if(t===ze.UNSIGNED_INT)return te.DEPTH_COMPONENT24}if(t===ze.FLOAT)switch(e){case ot.RGBA:return te.RGBA32F;case ot.RGB:return te.RGB32F;case ot.RG:return te.RG32F;case ot.RED:return te.R32F}if(t===ze.HALF_FLOAT)switch(e){case ot.RGBA:return te.RGBA16F;case ot.RGB:return te.RGB16F;case ot.RG:return te.RG16F;case ot.RED:return te.R16F}if(t===ze.UNSIGNED_BYTE)switch(e){case ot.RGBA:return te.RGBA8;case ot.RGB:return te.RGB8;case ot.RG:return te.RG8;case ot.RED:return te.R8}if(t===ze.INT)switch(e){case ot.RGBA_INTEGER:return te.RGBA32I;case ot.RGB_INTEGER:return te.RGB32I;case ot.RG_INTEGER:return te.RG32I;case ot.RED_INTEGER:return te.R32I}if(t===ze.UNSIGNED_INT)switch(e){case ot.RGBA_INTEGER:return te.RGBA32UI;case ot.RGB_INTEGER:return te.RGB32UI;case ot.RG_INTEGER:return te.RG32UI;case ot.RED_INTEGER:return te.R32UI}return e};Object.freeze(ot);var $e=ot;var Mo={_maximumCombinedTextureImageUnits:0,_maximumCubeMapSize:0,_maximumFragmentUniformVectors:0,_maximumTextureImageUnits:0,_maximumRenderbufferSize:0,_maximumTextureSize:0,_maximum3DTextureSize:0,_maximumVaryingVectors:0,_maximumVertexAttributes:0,_maximumVertexTextureImageUnits:0,_maximumVertexUniformVectors:0,_minimumAliasedLineWidth:0,_maximumAliasedLineWidth:0,_minimumAliasedPointSize:0,_maximumAliasedPointSize:0,_maximumViewportWidth:0,_maximumViewportHeight:0,_maximumTextureFilterAnisotropy:0,_maximumDrawBuffers:0,_maximumColorAttachments:0,_maximumSamples:0,_highpFloatSupported:!1,_highpIntSupported:!1};Object.defineProperties(Mo,{maximumCombinedTextureImageUnits:{get:function(){return Mo._maximumCombinedTextureImageUnits}},maximumCubeMapSize:{get:function(){return Mo._maximumCubeMapSize}},maximumFragmentUniformVectors:{get:function(){return Mo._maximumFragmentUniformVectors}},maximumTextureImageUnits:{get:function(){return Mo._maximumTextureImageUnits}},maximumRenderbufferSize:{get:function(){return Mo._maximumRenderbufferSize}},maximumTextureSize:{get:function(){return Mo._maximumTextureSize}},maximum3DTextureSize:{get:function(){return Mo._maximum3DTextureSize}},maximumVaryingVectors:{get:function(){return Mo._maximumVaryingVectors}},maximumVertexAttributes:{get:function(){return Mo._maximumVertexAttributes}},maximumVertexTextureImageUnits:{get:function(){return Mo._maximumVertexTextureImageUnits}},maximumVertexUniformVectors:{get:function(){return Mo._maximumVertexUniformVectors}},minimumAliasedLineWidth:{get:function(){return Mo._minimumAliasedLineWidth}},maximumAliasedLineWidth:{get:function(){return Mo._maximumAliasedLineWidth}},minimumAliasedPointSize:{get:function(){return Mo._minimumAliasedPointSize}},maximumAliasedPointSize:{get:function(){return Mo._maximumAliasedPointSize}},maximumViewportWidth:{get:function(){return Mo._maximumViewportWidth}},maximumViewportHeight:{get:function(){return Mo._maximumViewportHeight}},maximumTextureFilterAnisotropy:{get:function(){return Mo._maximumTextureFilterAnisotropy}},maximumDrawBuffers:{get:function(){return Mo._maximumDrawBuffers}},maximumColorAttachments:{get:function(){return Mo._maximumColorAttachments}},maximumSamples:{get:function(){return Mo._maximumSamples}},highpFloatSupported:{get:function(){return Mo._highpFloatSupported}},highpIntSupported:{get:function(){return Mo._highpIntSupported}}});var Ut=Mo;function Jq(e,t,n){let i=e._gl;i.framebufferTexture2D(i.FRAMEBUFFER,t,n._target,n._texture,0)}function KN(e,t,n){let i=e._gl;i.framebufferRenderbuffer(i.FRAMEBUFFER,t,i.RENDERBUFFER,n._getRenderbuffer())}function hh(e){e=e??H.EMPTY_OBJECT;let t=e.context,n=t._gl,i=Ut.maximumColorAttachments;if(this._gl=n,this._framebuffer=n.createFramebuffer(),this._colorTextures=[],this._colorRenderbuffers=[],this._activeColorAttachments=[],this._depthTexture=void 0,this._depthRenderbuffer=void 0,this._stencilRenderbuffer=void 0,this._depthStencilTexture=void 0,this._depthStencilRenderbuffer=void 0,this.destroyAttachments=e.destroyAttachments??!0,this._bind(),l(e.colorTextures)){let r=e.colorTextures,o=this._colorTextures.length=this._activeColorAttachments.length=r.length;for(let s=0;s<o;++s){let a=r[s],c=this._gl.COLOR_ATTACHMENT0+s;Jq(this,c,a),this._activeColorAttachments[s]=c,this._colorTextures[s]=a}}if(l(e.colorRenderbuffers)){let r=e.colorRenderbuffers,o=this._colorRenderbuffers.length=this._activeColorAttachments.length=r.length;for(let s=0;s<o;++s){let a=r[s],c=this._gl.COLOR_ATTACHMENT0+s;KN(this,c,a),this._activeColorAttachments[s]=c,this._colorRenderbuffers[s]=a}}if(l(e.depthTexture)){let r=e.depthTexture;Jq(this,this._gl.DEPTH_ATTACHMENT,r),this._depthTexture=r}if(l(e.depthRenderbuffer)){let r=e.depthRenderbuffer;KN(this,this._gl.DEPTH_ATTACHMENT,r),this._depthRenderbuffer=r}if(l(e.stencilRenderbuffer)){let r=e.stencilRenderbuffer;KN(this,this._gl.STENCIL_ATTACHMENT,r),this._stencilRenderbuffer=r}if(l(e.depthStencilTexture)){let r=e.depthStencilTexture;Jq(this,this._gl.DEPTH_STENCIL_ATTACHMENT,r),this._depthStencilTexture=r}if(l(e.depthStencilRenderbuffer)){let r=e.depthStencilRenderbuffer;KN(this,this._gl.DEPTH_STENCIL_ATTACHMENT,r),this._depthStencilRenderbuffer=r}this._unBind(),t._currentFramebuffer=void 0}Object.defineProperties(hh.prototype,{status:{get:function(){this._bind();let e=this._gl.checkFramebufferStatus(this._gl.FRAMEBUFFER);return this._unBind(),e}},numberOfColorAttachments:{get:function(){return this._activeColorAttachments.length}},depthTexture:{get:function(){return this._depthTexture}},depthRenderbuffer:{get:function(){return this._depthRenderbuffer}},stencilRenderbuffer:{get:function(){return this._stencilRenderbuffer}},depthStencilTexture:{get:function(){return this._depthStencilTexture}},depthStencilRenderbuffer:{get:function(){return this._depthStencilRenderbuffer}},hasDepthAttachment:{get:function(){return!!(this.depthTexture||this.depthRenderbuffer||this.depthStencilTexture||this.depthStencilRenderbuffer)}}});hh.prototype._bind=function(){let e=this._gl;e.bindFramebuffer(e.FRAMEBUFFER,this._framebuffer)};hh.prototype._unBind=function(){let e=this._gl;e.bindFramebuffer(e.FRAMEBUFFER,null)};hh.prototype.bindDraw=function(){let e=this._gl;e.bindFramebuffer(e.DRAW_FRAMEBUFFER,this._framebuffer)};hh.prototype.bindRead=function(){let e=this._gl;e.bindFramebuffer(e.READ_FRAMEBUFFER,this._framebuffer)};hh.prototype._getActiveColorAttachments=function(){return this._activeColorAttachments};hh.prototype.getColorTexture=function(e){return this._colorTextures[e]};hh.prototype.getColorRenderbuffer=function(e){return this._colorRenderbuffers[e]};hh.prototype.isDestroyed=function(){return!1};hh.prototype.destroy=function(){if(this.destroyAttachments){let e=this._colorTextures;for(let n=0;n<e.length;++n){let i=e[n];l(i)&&i.destroy()}let t=this._colorRenderbuffers;for(let n=0;n<t.length;++n){let i=t[n];l(i)&&i.destroy()}this._depthTexture=this._depthTexture&&this._depthTexture.destroy(),this._depthRenderbuffer=this._depthRenderbuffer&&this._depthRenderbuffer.destroy(),this._stencilRenderbuffer=this._stencilRenderbuffer&&this._stencilRenderbuffer.destroy(),this._depthStencilTexture=this._depthStencilTexture&&this._depthStencilTexture.destroy(),this._depthStencilRenderbuffer=this._depthStencilRenderbuffer&&this._depthStencilRenderbuffer.destroy()}return this._gl.deleteFramebuffer(this._framebuffer),le(this)};var vs=hh;var qI={CLOCKWISE:te.CW,COUNTER_CLOCKWISE:te.CCW};qI.validate=function(e){return e===qI.CLOCKWISE||e===qI.COUNTER_CLOCKWISE};Object.freeze(qI);var sa=qI;function lle(e){if(typeof e!="object"||e===null)return e;let t,n=Object.keys(e);for(let i=0;i<n.length;i++)t=n[i],e.hasOwnProperty(t)&&t!=="_applyFunctions"&&(e[t]=lle(e[t]));return Object.freeze(e)}var ule=lle;function Hm(e){let t=e??H.EMPTY_OBJECT,n=t.cull??H.EMPTY_OBJECT,i=t.polygonOffset??H.EMPTY_OBJECT,r=t.scissorTest??H.EMPTY_OBJECT,o=r.rectangle??H.EMPTY_OBJECT,s=t.depthRange??H.EMPTY_OBJECT,a=t.depthTest??H.EMPTY_OBJECT,c=t.colorMask??H.EMPTY_OBJECT,u=t.blending??H.EMPTY_OBJECT,f=u.color??H.EMPTY_OBJECT,d=t.stencilTest??H.EMPTY_OBJECT,p=d.frontOperation??H.EMPTY_OBJECT,g=d.backOperation??H.EMPTY_OBJECT,m=t.sampleCoverage??H.EMPTY_OBJECT,y=t.viewport;this.frontFace=t.frontFace??sa.COUNTER_CLOCKWISE,this.cull={enabled:n.enabled??!1,face:n.face??te.BACK},this.lineWidth=t.lineWidth??1,this.polygonOffset={enabled:i.enabled??!1,factor:i.factor??0,units:i.units??0},this.scissorTest={enabled:r.enabled??!1,rectangle:et.clone(o)},this.depthRange={near:s.near??0,far:s.far??1},this.depthTest={enabled:a.enabled??!1,func:a.func??te.LESS},this.colorMask={red:c.red??!0,green:c.green??!0,blue:c.blue??!0,alpha:c.alpha??!0},this.depthMask=t.depthMask??!0,this.stencilMask=t.stencilMask??-1,this.blending={enabled:u.enabled??!1,color:new z(f.red??0,f.green??0,f.blue??0,f.alpha??0),equationRgb:u.equationRgb??te.FUNC_ADD,equationAlpha:u.equationAlpha??te.FUNC_ADD,functionSourceRgb:u.functionSourceRgb??te.ONE,functionSourceAlpha:u.functionSourceAlpha??te.ONE,functionDestinationRgb:u.functionDestinationRgb??te.ZERO,functionDestinationAlpha:u.functionDestinationAlpha??te.ZERO},this.stencilTest={enabled:d.enabled??!1,frontFunction:d.frontFunction??te.ALWAYS,backFunction:d.backFunction??te.ALWAYS,reference:d.reference??0,mask:d.mask??-1,frontOperation:{fail:p.fail??te.KEEP,zFail:p.zFail??te.KEEP,zPass:p.zPass??te.KEEP},backOperation:{fail:g.fail??te.KEEP,zFail:g.zFail??te.KEEP,zPass:g.zPass??te.KEEP}},this.sampleCoverage={enabled:m.enabled??!1,value:m.value??1,invert:m.invert??!1},this.viewport=l(y)?new et(y.x,y.y,y.width,y.height):void 0,this.id=0,this._applyFunctions=[]}var Pze=0,jm={};Hm.fromCache=function(e){let t=JSON.stringify(e),n=jm[t];if(l(n))return++n.referenceCount,n.state;let i=new Hm(e),r=JSON.stringify(i);return n=jm[r],l(n)||(i.id=Pze++,n={referenceCount:0,state:i},jm[r]=n),++n.referenceCount,jm[t]={referenceCount:1,state:n.state},n.state};Hm.removeFromCache=function(e){let t=new Hm(e),n=JSON.stringify(t),i=jm[n],r=JSON.stringify(e),o=jm[r];l(o)&&(--o.referenceCount,o.referenceCount===0&&(delete jm[r],l(i)&&--i.referenceCount)),l(i)&&i.referenceCount===0&&delete jm[n]};Hm.getCache=function(){return jm};Hm.clearCache=function(){jm={}};function Tb(e,t,n){n?e.enable(t):e.disable(t)}function fle(e,t){e.frontFace(t.frontFace)}function dle(e,t){let n=t.cull,i=n.enabled;Tb(e,e.CULL_FACE,i),i&&e.cullFace(n.face)}function hle(e,t){e.lineWidth(t.lineWidth)}function mle(e,t){let n=t.polygonOffset,i=n.enabled;Tb(e,e.POLYGON_OFFSET_FILL,i),i&&e.polygonOffset(n.factor,n.units)}function ple(e,t,n){let i=t.scissorTest,r=l(n.scissorTest)?n.scissorTest.enabled:i.enabled;if(Tb(e,e.SCISSOR_TEST,r),r){let o=l(n.scissorTest)?n.scissorTest.rectangle:i.rectangle;e.scissor(o.x,o.y,o.width,o.height)}}function gle(e,t){let n=t.depthRange;e.depthRange(n.near,n.far)}function _le(e,t){let n=t.depthTest,i=n.enabled;Tb(e,e.DEPTH_TEST,i),i&&e.depthFunc(n.func)}function yle(e,t){let n=t.colorMask;e.colorMask(n.red,n.green,n.blue,n.alpha)}function Ale(e,t){e.depthMask(t.depthMask)}function ble(e,t){e.stencilMask(t.stencilMask)}function Dze(e,t){e.blendColor(t.red,t.green,t.blue,t.alpha)}function xle(e,t,n){let i=t.blending,r=l(n.blendingEnabled)?n.blendingEnabled:i.enabled;Tb(e,e.BLEND,r),r&&(Dze(e,i.color),e.blendEquationSeparate(i.equationRgb,i.equationAlpha),e.blendFuncSeparate(i.functionSourceRgb,i.functionDestinationRgb,i.functionSourceAlpha,i.functionDestinationAlpha))}function Tle(e,t){let n=t.stencilTest,i=n.enabled;if(Tb(e,e.STENCIL_TEST,i),i){let r=n.frontFunction,o=n.backFunction,s=n.reference,a=n.mask;e.stencilFunc(r,s,a),e.stencilFuncSeparate(e.BACK,o,s,a),e.stencilFuncSeparate(e.FRONT,r,s,a);let c=n.frontOperation,u=c.fail,f=c.zFail,d=c.zPass;e.stencilOpSeparate(e.FRONT,u,f,d);let p=n.backOperation,g=p.fail,m=p.zFail,y=p.zPass;e.stencilOpSeparate(e.BACK,g,m,y)}}function Ele(e,t){let n=t.sampleCoverage,i=n.enabled;Tb(e,e.SAMPLE_COVERAGE,i),i&&e.sampleCoverage(n.value,n.invert)}var Rze=new et;function Cle(e,t,n){let i=t.viewport??n.viewport;l(i)||(i=Rze,i.width=n.context.drawingBufferWidth,i.height=n.context.drawingBufferHeight),n.context.uniformState.viewport=i,e.viewport(i.x,i.y,i.width,i.height)}Hm.apply=function(e,t,n){fle(e,t),dle(e,t),hle(e,t),mle(e,t),gle(e,t),_le(e,t),yle(e,t),Ale(e,t),ble(e,t),Tle(e,t),Ele(e,t),ple(e,t,n),xle(e,t,n),Cle(e,t,n)};function Oze(e,t){let n=[];return e.frontFace!==t.frontFace&&n.push(fle),(e.cull.enabled!==t.cull.enabled||e.cull.face!==t.cull.face)&&n.push(dle),e.lineWidth!==t.lineWidth&&n.push(hle),(e.polygonOffset.enabled!==t.polygonOffset.enabled||e.polygonOffset.factor!==t.polygonOffset.factor||e.polygonOffset.units!==t.polygonOffset.units)&&n.push(mle),(e.depthRange.near!==t.depthRange.near||e.depthRange.far!==t.depthRange.far)&&n.push(gle),(e.depthTest.enabled!==t.depthTest.enabled||e.depthTest.func!==t.depthTest.func)&&n.push(_le),(e.colorMask.red!==t.colorMask.red||e.colorMask.green!==t.colorMask.green||e.colorMask.blue!==t.colorMask.blue||e.colorMask.alpha!==t.colorMask.alpha)&&n.push(yle),e.depthMask!==t.depthMask&&n.push(Ale),e.stencilMask!==t.stencilMask&&n.push(ble),(e.stencilTest.enabled!==t.stencilTest.enabled||e.stencilTest.frontFunction!==t.stencilTest.frontFunction||e.stencilTest.backFunction!==t.stencilTest.backFunction||e.stencilTest.reference!==t.stencilTest.reference||e.stencilTest.mask!==t.stencilTest.mask||e.stencilTest.frontOperation.fail!==t.stencilTest.frontOperation.fail||e.stencilTest.frontOperation.zFail!==t.stencilTest.frontOperation.zFail||e.stencilTest.backOperation.fail!==t.stencilTest.backOperation.fail||e.stencilTest.backOperation.zFail!==t.stencilTest.backOperation.zFail||e.stencilTest.backOperation.zPass!==t.stencilTest.backOperation.zPass)&&n.push(Tle),(e.sampleCoverage.enabled!==t.sampleCoverage.enabled||e.sampleCoverage.value!==t.sampleCoverage.value||e.sampleCoverage.invert!==t.sampleCoverage.invert)&&n.push(Ele),n}Hm.partialApply=function(e,t,n,i,r,o){if(t!==n){let f=n._applyFunctions[t.id];l(f)||(f=Oze(t,n),n._applyFunctions[t.id]=f);let d=f.length;for(let p=0;p<d;++p)f[p](e,n)}let s=l(i.scissorTest)?i.scissorTest:t.scissorTest,a=l(r.scissorTest)?r.scissorTest:n.scissorTest;(s!==a||o)&&ple(e,n,r);let c=l(i.blendingEnabled)?i.blendingEnabled:t.blending.enabled,u=l(r.blendingEnabled)?r.blendingEnabled:n.blending.enabled;(c!==u||u&&t.blending!==n.blending)&&xle(e,n,r),(t!==n||i!==r||i.context!==r.context)&&Cle(e,n,r)};Hm.getState=function(e){return{frontFace:e.frontFace,cull:{enabled:e.cull.enabled,face:e.cull.face},lineWidth:e.lineWidth,polygonOffset:{enabled:e.polygonOffset.enabled,factor:e.polygonOffset.factor,units:e.polygonOffset.units},scissorTest:{enabled:e.scissorTest.enabled,rectangle:et.clone(e.scissorTest.rectangle)},depthRange:{near:e.depthRange.near,far:e.depthRange.far},depthTest:{enabled:e.depthTest.enabled,func:e.depthTest.func},colorMask:{red:e.colorMask.red,green:e.colorMask.green,blue:e.colorMask.blue,alpha:e.colorMask.alpha},depthMask:e.depthMask,stencilMask:e.stencilMask,blending:{enabled:e.blending.enabled,color:z.clone(e.blending.color),equationRgb:e.blending.equationRgb,equationAlpha:e.blending.equationAlpha,functionSourceRgb:e.blending.functionSourceRgb,functionSourceAlpha:e.blending.functionSourceAlpha,functionDestinationRgb:e.blending.functionDestinationRgb,functionDestinationAlpha:e.blending.functionDestinationAlpha},stencilTest:{enabled:e.stencilTest.enabled,frontFunction:e.stencilTest.frontFunction,backFunction:e.stencilTest.backFunction,reference:e.stencilTest.reference,mask:e.stencilTest.mask,frontOperation:{fail:e.stencilTest.frontOperation.fail,zFail:e.stencilTest.frontOperation.zFail,zPass:e.stencilTest.frontOperation.zPass},backOperation:{fail:e.stencilTest.backOperation.fail,zFail:e.stencilTest.backOperation.zFail,zPass:e.stencilTest.backOperation.zPass}},sampleCoverage:{enabled:e.sampleCoverage.enabled,value:e.sampleCoverage.value,invert:e.sampleCoverage.invert},viewport:l(e.viewport)?et.clone(e.viewport):void 0}};var Ge=Hm;var Mze=Object.freeze([NaN,NaN,NaN,NaN]),au=class e{constructor(t,n,i,r){let o=Reflect.construct(Array,Mze,new.target);return o[0]=t??0,o[1]=i??0,o[2]=n??0,o[3]=r??0,o}static pack(t,n,i){return i=i??0,n[i++]=t[0],n[i++]=t[1],n[i++]=t[2],n[i]=t[3],n}static unpack(t,n,i){return n=n??0,l(i)||(i=new e),i[0]=t[n++],i[1]=t[n++],i[2]=t[n++],i[3]=t[n],i}static packArray(t,n){let i=t.length,r=i*4;l(n)?!Array.isArray(n)&&n.length!==r||n.length!==r&&(n.length=r):n=new Array(r);for(let o=0;o<i;++o)e.pack(t[o],n,o*4);return n}static unpackArray(t,n){let i=t.length;l(n)?n.length=i/4:n=new Array(i/4);for(let r=0;r<i;r+=4){let o=r/4;n[o]=e.unpack(t,r,n[o])}return n}static clone(t,n){if(l(t))return l(n)?(n[0]=t[0],n[1]=t[1],n[2]=t[2],n[3]=t[3],n):new e(t[0],t[2],t[1],t[3])}static fromColumnMajorArray(t,n){return e.clone(t,n)}static fromRowMajorArray(t,n){return l(n)?(n[0]=t[0],n[1]=t[2],n[2]=t[1],n[3]=t[3],n):new e(t[0],t[1],t[2],t[3])}static fromScale(t,n){return l(n)?(n[0]=t.x,n[1]=0,n[2]=0,n[3]=t.y,n):new e(t.x,0,0,t.y)}static fromUniformScale(t,n){return l(n)?(n[0]=t,n[1]=0,n[2]=0,n[3]=t,n):new e(t,0,0,t)}static fromRotation(t,n){let i=Math.cos(t),r=Math.sin(t);return l(n)?(n[0]=i,n[1]=r,n[2]=-r,n[3]=i,n):new e(i,-r,r,i)}static toArray(t,n){return l(n)?(n[0]=t[0],n[1]=t[1],n[2]=t[2],n[3]=t[3],n):[t[0],t[1],t[2],t[3]]}static getElementIndex(t,n){return t*2+n}static getColumn(t,n,i){let r=n*2,o=t[r],s=t[r+1];return i.x=o,i.y=s,i}static setColumn(t,n,i,r){r=e.clone(t,r);let o=n*2;return r[o]=i.x,r[o+1]=i.y,r}static getRow(t,n,i){let r=t[n],o=t[n+2];return i.x=r,i.y=o,i}static setRow(t,n,i,r){return r=e.clone(t,r),r[n]=i.x,r[n+2]=i.y,r}static setScale(t,n,i){let r=e.getScale(t,Nze),o=n.x/r.x,s=n.y/r.y;return i[0]=t[0]*o,i[1]=t[1]*o,i[2]=t[2]*s,i[3]=t[3]*s,i}static setUniformScale(t,n,i){let r=e.getScale(t,Lze),o=n/r.x,s=n/r.y;return i[0]=t[0]*o,i[1]=t[1]*o,i[2]=t[2]*s,i[3]=t[3]*s,i}static getScale(t,n){return n.x=U.magnitude(U.fromElements(t[0],t[1],vle)),n.y=U.magnitude(U.fromElements(t[2],t[3],vle)),n}static getMaximumScale(t){return e.getScale(t,Sle),U.maximumComponent(Sle)}static setRotation(t,n,i){let r=e.getScale(t,Fze);return i[0]=n[0]*r.x,i[1]=n[1]*r.x,i[2]=n[2]*r.y,i[3]=n[3]*r.y,i}static getRotation(t,n){let i=e.getScale(t,Bze);return n[0]=t[0]/i.x,n[1]=t[1]/i.x,n[2]=t[2]/i.y,n[3]=t[3]/i.y,n}static multiply(t,n,i){let r=t[0]*n[0]+t[2]*n[1],o=t[0]*n[2]+t[2]*n[3],s=t[1]*n[0]+t[3]*n[1],a=t[1]*n[2]+t[3]*n[3];return i[0]=r,i[1]=s,i[2]=o,i[3]=a,i}static add(t,n,i){return i[0]=t[0]+n[0],i[1]=t[1]+n[1],i[2]=t[2]+n[2],i[3]=t[3]+n[3],i}static subtract(t,n,i){return i[0]=t[0]-n[0],i[1]=t[1]-n[1],i[2]=t[2]-n[2],i[3]=t[3]-n[3],i}static multiplyByVector(t,n,i){let r=t[0]*n.x+t[2]*n.y,o=t[1]*n.x+t[3]*n.y;return i.x=r,i.y=o,i}static multiplyByScalar(t,n,i){return i[0]=t[0]*n,i[1]=t[1]*n,i[2]=t[2]*n,i[3]=t[3]*n,i}static multiplyByScale(t,n,i){return i[0]=t[0]*n.x,i[1]=t[1]*n.x,i[2]=t[2]*n.y,i[3]=t[3]*n.y,i}static multiplyByUniformScale(t,n,i){return i[0]=t[0]*n,i[1]=t[1]*n,i[2]=t[2]*n,i[3]=t[3]*n,i}static negate(t,n){return n[0]=-t[0],n[1]=-t[1],n[2]=-t[2],n[3]=-t[3],n}static transpose(t,n){let i=t[0],r=t[2],o=t[1],s=t[3];return n[0]=i,n[1]=r,n[2]=o,n[3]=s,n}static abs(t,n){return n[0]=Math.abs(t[0]),n[1]=Math.abs(t[1]),n[2]=Math.abs(t[2]),n[3]=Math.abs(t[3]),n}static equals(t,n){return t===n||l(t)&&l(n)&&t[0]===n[0]&&t[1]===n[1]&&t[2]===n[2]&&t[3]===n[3]}static equalsArray(t,n,i){return t[0]===n[i]&&t[1]===n[i+1]&&t[2]===n[i+2]&&t[3]===n[i+3]}static equalsEpsilon(t,n,i){return i=i??0,t===n||l(t)&&l(n)&&Math.abs(t[0]-n[0])<=i&&Math.abs(t[1]-n[1])<=i&&Math.abs(t[2]-n[2])<=i&&Math.abs(t[3]-n[3])<=i}get length(){return e.packedLength}clone(t){return e.clone(this,t)}equals(t){return e.equals(this,t)}equalsEpsilon(t,n){return e.equalsEpsilon(this,t,n)}toString(){return`(${this[0]}, ${this[2]}) -(${this[1]}, ${this[3]})`}};au.packedLength=4;au.fromArray=au.unpack;au.IDENTITY=new au(1,0,0,1);au.ZERO=new au(0,0,0,0);au.COLUMN0ROW0=0;au.COLUMN0ROW1=1;au.COLUMN1ROW0=2;au.COLUMN1ROW1=3;var Nze=new U,Lze=new U,vle=new U,Sle=new U,Fze=new U,Bze=new U,$i=au;function kze(e,t,n,i){switch(t.type){case e.FLOAT:return new Zq(e,t,n,i);case e.FLOAT_VEC2:return new Qq(e,t,n,i);case e.FLOAT_VEC3:return new eY(e,t,n,i);case e.FLOAT_VEC4:return new tY(e,t,n,i);case e.SAMPLER_2D:case e.SAMPLER_3D:case e.SAMPLER_CUBE:return new $N(e,t,n,i);case e.UNSIGNED_INT_SAMPLER_2D:return new $N(e,t,n,i);case e.INT:case e.BOOL:return new nY(e,t,n,i);case e.INT_VEC2:case e.BOOL_VEC2:return new iY(e,t,n,i);case e.INT_VEC3:case e.BOOL_VEC3:return new rY(e,t,n,i);case e.INT_VEC4:case e.BOOL_VEC4:return new oY(e,t,n,i);case e.FLOAT_MAT2:return new sY(e,t,n,i);case e.FLOAT_MAT3:return new aY(e,t,n,i);case e.FLOAT_MAT4:return new cY(e,t,n,i);default:throw new oe(`Unrecognized uniform type: ${t.type} for uniform "${n}".`)}}var Zq=class{constructor(t,n,i,r){this.name=i,this.value=void 0,this._value=0,this._gl=t,this._location=r}set(){this.value!==this._value&&(this._value=this.value,this._gl.uniform1f(this._location,this.value))}},Qq=class{constructor(t,n,i,r){this.name=i,this.value=void 0,this._value=new U,this._gl=t,this._location=r}set(){let t=this.value;U.equals(t,this._value)||(U.clone(t,this._value),this._gl.uniform2f(this._location,t.x,t.y))}},eY=class{constructor(t,n,i,r){this.name=i,this.value=void 0,this._value=void 0,this._gl=t,this._location=r}set(){let t=this.value;l(t.red)?z.equals(t,this._value)||(this._value=z.clone(t,this._value),this._gl.uniform3f(this._location,t.red,t.green,t.blue)):l(t.x)&&(h.equals(t,this._value)||(this._value=h.clone(t,this._value),this._gl.uniform3f(this._location,t.x,t.y,t.z)))}},tY=class{constructor(t,n,i,r){this.name=i,this.value=void 0,this._value=void 0,this._gl=t,this._location=r}set(){let t=this.value;l(t.red)?z.equals(t,this._value)||(this._value=z.clone(t,this._value),this._gl.uniform4f(this._location,t.red,t.green,t.blue,t.alpha)):l(t.x)&&(se.equals(t,this._value)||(this._value=se.clone(t,this._value),this._gl.uniform4f(this._location,t.x,t.y,t.z,t.w)))}},$N=class{constructor(t,n,i,r){this.name=i,this.value=void 0,this._gl=t,this._location=r,this.textureUnitIndex=void 0}set(){let t=this._gl;t.activeTexture(t.TEXTURE0+this.textureUnitIndex);let n=this.value;t.bindTexture(n._target,n._texture)}_setSampler(t){return this.textureUnitIndex=t,this._gl.uniform1i(this._location,t),t+1}},nY=class{constructor(t,n,i,r){this.name=i,this.value=void 0,this._value=0,this._gl=t,this._location=r}set(){this.value!==this._value&&(this._value=this.value,this._gl.uniform1i(this._location,this.value))}},iY=class{constructor(t,n,i,r){this.name=i,this.value=void 0,this._value=new U,this._gl=t,this._location=r}set(){let t=this.value;U.equals(t,this._value)||(U.clone(t,this._value),this._gl.uniform2i(this._location,t.x,t.y))}},rY=class{constructor(t,n,i,r){this.name=i,this.value=void 0,this._value=new h,this._gl=t,this._location=r}set(){let t=this.value;h.equals(t,this._value)||(h.clone(t,this._value),this._gl.uniform3i(this._location,t.x,t.y,t.z))}},oY=class{constructor(t,n,i,r){this.name=i,this.value=void 0,this._value=new se,this._gl=t,this._location=r}set(){let t=this.value;se.equals(t,this._value)||(se.clone(t,this._value),this._gl.uniform4i(this._location,t.x,t.y,t.z,t.w))}},Uze=new Float32Array(4),sY=class{constructor(t,n,i,r){this.name=i,this.value=void 0,this._value=new $i,this._gl=t,this._location=r}set(){if(!$i.equalsArray(this.value,this._value,0)){$i.clone(this.value,this._value);let t=$i.toArray(this.value,Uze);this._gl.uniformMatrix2fv(this._location,!1,t)}}},zze=new Float32Array(9),aY=class{constructor(t,n,i,r){this.name=i,this.value=void 0,this._value=new $,this._gl=t,this._location=r}set(){if(!$.equalsArray(this.value,this._value,0)){$.clone(this.value,this._value);let t=$.toArray(this.value,zze);this._gl.uniformMatrix3fv(this._location,!1,t)}}},Vze=new Float32Array(16),cY=class{constructor(t,n,i,r){this.name=i,this.value=void 0,this._value=new M,this._gl=t,this._location=r}set(){if(!M.equalsArray(this.value,this._value,0)){M.clone(this.value,this._value);let t=M.toArray(this.value,Vze);this._gl.uniformMatrix4fv(this._location,!1,t)}}},JN=kze;function jze(e,t,n,i){switch(t.type){case e.FLOAT:return new lY(e,t,n,i);case e.FLOAT_VEC2:return new uY(e,t,n,i);case e.FLOAT_VEC3:return new fY(e,t,n,i);case e.FLOAT_VEC4:return new dY(e,t,n,i);case e.SAMPLER_2D:case e.SAMPLER_3D:case e.SAMPLER_CUBE:return new hY(e,t,n,i);case e.INT:case e.BOOL:return new mY(e,t,n,i);case e.INT_VEC2:case e.BOOL_VEC2:return new pY(e,t,n,i);case e.INT_VEC3:case e.BOOL_VEC3:return new gY(e,t,n,i);case e.INT_VEC4:case e.BOOL_VEC4:return new _Y(e,t,n,i);case e.FLOAT_MAT2:return new yY(e,t,n,i);case e.FLOAT_MAT3:return new AY(e,t,n,i);case e.FLOAT_MAT4:return new bY(e,t,n,i);default:throw new oe(`Unrecognized uniform type: ${t.type} for uniform "${n}".`)}}var lY=class{constructor(t,n,i,r){let o=r.length;this.name=i,this.value=new Array(o),this._value=new Float32Array(o),this._gl=t,this._location=r[0]}set(){let t=this.value,n=t.length,i=this._value,r=!1;for(let o=0;o<n;++o){let s=t[o];s!==i[o]&&(i[o]=s,r=!0)}r&&this._gl.uniform1fv(this._location,i)}},uY=class{constructor(t,n,i,r){let o=r.length;this.name=i,this.value=new Array(o),this._value=new Float32Array(o*2),this._gl=t,this._location=r[0]}set(){let t=this.value,n=t.length,i=this._value,r=!1,o=0;for(let s=0;s<n;++s){let a=t[s];U.equalsArray(a,i,o)||(U.pack(a,i,o),r=!0),o+=2}r&&this._gl.uniform2fv(this._location,i)}},fY=class{constructor(t,n,i,r){let o=r.length;this.name=i,this.value=new Array(o),this._value=new Float32Array(o*3),this._gl=t,this._location=r[0]}set(){let t=this.value,n=t.length,i=this._value,r=!1,o=0;for(let s=0;s<n;++s){let a=t[s];l(a.red)?(a.red!==i[o]||a.green!==i[o+1]||a.blue!==i[o+2])&&(i[o]=a.red,i[o+1]=a.green,i[o+2]=a.blue,r=!0):l(a.x)&&(h.equalsArray(a,i,o)||(h.pack(a,i,o),r=!0)),o+=3}r&&this._gl.uniform3fv(this._location,i)}},dY=class{constructor(t,n,i,r){let o=r.length;this.name=i,this.value=new Array(o),this._value=new Float32Array(o*4),this._gl=t,this._location=r[0]}set(){let t=this.value,n=t.length,i=this._value,r=!1,o=0;for(let s=0;s<n;++s){let a=t[s];l(a.red)?z.equalsArray(a,i,o)||(z.pack(a,i,o),r=!0):l(a.x)&&(se.equalsArray(a,i,o)||(se.pack(a,i,o),r=!0)),o+=4}r&&this._gl.uniform4fv(this._location,i)}},hY=class{constructor(t,n,i,r){let o=r.length;this.name=i,this.value=new Array(o),this._value=new Float32Array(o),this._gl=t,this._locations=r,this.textureUnitIndex=void 0}set(){let t=this._gl,n=t.TEXTURE0+this.textureUnitIndex,i=this.value,r=i.length;for(let o=0;o<r;++o){let s=i[o];t.activeTexture(n+o),t.bindTexture(s._target,s._texture)}}_setSampler(t){this.textureUnitIndex=t;let n=this._locations,i=n.length;for(let r=0;r<i;++r){let o=t+r;this._gl.uniform1i(n[r],o)}return t+i}},mY=class{constructor(t,n,i,r){let o=r.length;this.name=i,this.value=new Array(o),this._value=new Int32Array(o),this._gl=t,this._location=r[0]}set(){let t=this.value,n=t.length,i=this._value,r=!1;for(let o=0;o<n;++o){let s=t[o];s!==i[o]&&(i[o]=s,r=!0)}r&&this._gl.uniform1iv(this._location,i)}},pY=class{constructor(t,n,i,r){let o=r.length;this.name=i,this.value=new Array(o),this._value=new Int32Array(o*2),this._gl=t,this._location=r[0]}set(){let t=this.value,n=t.length,i=this._value,r=!1,o=0;for(let s=0;s<n;++s){let a=t[s];U.equalsArray(a,i,o)||(U.pack(a,i,o),r=!0),o+=2}r&&this._gl.uniform2iv(this._location,i)}},gY=class{constructor(t,n,i,r){let o=r.length;this.name=i,this.value=new Array(o),this._value=new Int32Array(o*3),this._gl=t,this._location=r[0]}set(){let t=this.value,n=t.length,i=this._value,r=!1,o=0;for(let s=0;s<n;++s){let a=t[s];h.equalsArray(a,i,o)||(h.pack(a,i,o),r=!0),o+=3}r&&this._gl.uniform3iv(this._location,i)}},_Y=class{constructor(t,n,i,r){let o=r.length;this.name=i,this.value=new Array(o),this._value=new Int32Array(o*4),this._gl=t,this._location=r[0]}set(){let t=this.value,n=t.length,i=this._value,r=!1,o=0;for(let s=0;s<n;++s){let a=t[s];se.equalsArray(a,i,o)||(se.pack(a,i,o),r=!0),o+=4}r&&this._gl.uniform4iv(this._location,i)}},yY=class{constructor(t,n,i,r){let o=r.length;this.name=i,this.value=new Array(o),this._value=new Float32Array(o*4),this._gl=t,this._location=r[0]}set(){let t=this.value,n=t.length,i=this._value,r=!1,o=0;for(let s=0;s<n;++s){let a=t[s];$i.equalsArray(a,i,o)||($i.pack(a,i,o),r=!0),o+=4}r&&this._gl.uniformMatrix2fv(this._location,!1,i)}},AY=class{constructor(t,n,i,r){let o=r.length;this.name=i,this.value=new Array(o),this._value=new Float32Array(o*9),this._gl=t,this._location=r[0]}set(){let t=this.value,n=t.length,i=this._value,r=!1,o=0;for(let s=0;s<n;++s){let a=t[s];$.equalsArray(a,i,o)||($.pack(a,i,o),r=!0),o+=9}r&&this._gl.uniformMatrix3fv(this._location,!1,i)}},bY=class{constructor(t,n,i,r){let o=r.length;this.name=i,this.value=new Array(o),this._value=new Float32Array(o*16),this._gl=t,this._location=r[0]}set(){let t=this.value,n=t.length,i=this._value,r=!1,o=0;for(let s=0;s<n;++s){let a=t[s];M.equalsArray(a,i,o)||(M.pack(a,i,o),r=!0),o+=16}r&&this._gl.uniformMatrix4fv(this._location,!1,i)}},ZN=jze;var Hze=0;function F0(e){let t=e.vertexShaderText,n=e.fragmentShaderText;typeof spector<"u"&&(t=t.replace(/^#line/gm,"//#line"),n=n.replace(/^#line/gm,"//#line"));let i=Gze(t,n);this._gl=e.gl,this._logShaderCompilation=e.logShaderCompilation,this._debugShaders=e.debugShaders,this._attributeLocations=e.attributeLocations,this._program=void 0,this._numberOfVertexAttributes=void 0,this._vertexAttributes=void 0,this._uniformsByName=void 0,this._uniforms=void 0,this._automaticUniforms=void 0,this._manualUniforms=void 0,this._duplicateUniformNames=i.duplicateUniformNames,this._cachedShader=void 0,this.maximumTextureUnitIndex=void 0,this._vertexShaderSource=e.vertexShaderSource,this._vertexShaderText=e.vertexShaderText,this._fragmentShaderSource=e.fragmentShaderSource,this._fragmentShaderText=i.fragmentShaderText,this.id=Hze++}F0.fromCache=function(e){return e=e??H.EMPTY_OBJECT,e.context.shaderCache.getShaderProgram(e)};F0.replaceCache=function(e){return e=e??H.EMPTY_OBJECT,e.context.shaderCache.replaceShaderProgram(e)};Object.defineProperties(F0.prototype,{vertexShaderSource:{get:function(){return this._vertexShaderSource}},fragmentShaderSource:{get:function(){return this._fragmentShaderSource}},vertexAttributes:{get:function(){return QN(this),this._vertexAttributes}},numberOfVertexAttributes:{get:function(){return QN(this),this._numberOfVertexAttributes}},allUniforms:{get:function(){return QN(this),this._uniformsByName}}});function wle(e){let t=[],n=e.match(/uniform.*?(?![^{]*})(?=[=\[;])/g);if(l(n)){let i=n.length;for(let r=0;r<i;r++){let o=n[r].trim(),s=o.slice(o.lastIndexOf(" ")+1);t.push(s)}}return t}function Gze(e,t){let n={};if(!Ut.highpFloatSupported||!Ut.highpIntSupported){let i,r,o,s,a=wle(e),c=wle(t),u=a.length,f=c.length;for(i=0;i<u;i++)for(r=0;r<f;r++)if(a[i]===c[r]){o=a[i],s=`czm_mediump_${o}`;let d=new RegExp(`${o}\\b`,"g");t=t.replace(d,s),n[s]=o}}return{fragmentShaderText:t,duplicateUniformNames:n}}var Gm="[Cesium WebGL] ";function Wze(e,t){let n=t._vertexShaderText,i=t._fragmentShaderText,r=e.createShader(e.VERTEX_SHADER);e.shaderSource(r,n),e.compileShader(r);let o=e.createShader(e.FRAGMENT_SHADER);e.shaderSource(o,i),e.compileShader(o);let s=e.createProgram();e.attachShader(s,r),e.attachShader(s,o);let a=t._attributeLocations;if(l(a))for(let p in a)a.hasOwnProperty(p)&&e.bindAttribLocation(s,a[p],p);e.linkProgram(s);let c;if(e.getProgramParameter(s,e.LINK_STATUS))return t._logShaderCompilation&&(c=e.getShaderInfoLog(r),l(c)&&c.length>0&&console.log(`${Gm}Vertex shader compile log: ${c}`),c=e.getShaderInfoLog(o),l(c)&&c.length>0&&console.log(`${Gm}Fragment shader compile log: ${c}`),c=e.getProgramInfoLog(s),l(c)&&c.length>0&&console.log(`${Gm}Shader program link log: ${c}`)),e.deleteShader(r),e.deleteShader(o),s;let u,f=t._debugShaders;throw e.getShaderParameter(o,e.COMPILE_STATUS)?e.getShaderParameter(r,e.COMPILE_STATUS)?(c=e.getProgramInfoLog(s),console.error(`${Gm}Shader program link log: ${c}`),d(r,"vertex"),d(o,"fragment"),u=`Program failed to link. Link log: ${c}`):(c=e.getShaderInfoLog(r),console.error(`${Gm}Vertex shader compile log: ${c}`),console.error(`${Gm} Vertex shader source: +`;var Ho={CULL:1,OCCLUDE:2,EXECUTE_IN_CLOSEST_FRUSTUM:4,DEBUG_SHOW_BOUNDING_VOLUME:8,CAST_SHADOWS:16,RECEIVE_SHADOWS:32,PICK_ONLY:64,DEPTH_FOR_TRANSLUCENT_CLASSIFICATION:128},$q=class e{constructor(t=H.EMPTY_OBJECT){this._boundingVolume=t.boundingVolume,this._orientedBoundingBox=t.orientedBoundingBox,this._modelMatrix=t.modelMatrix,this._primitiveType=t.primitiveType??Oe.TRIANGLES,this._vertexArray=t.vertexArray,this._count=t.count,this._offset=t.offset??0,this._instanceCount=t.instanceCount??0,this._shaderProgram=t.shaderProgram,this._uniformMap=t.uniformMap,this._renderState=t.renderState,this._framebuffer=t.framebuffer,this._pass=t.pass,this._owner=t.owner,this._debugOverlappingFrustums=0,this._pickId=t.pickId,this._snapId=t.snapId,this._pickMetadataAllowed=t.pickMetadataAllowed===!0,this._pickedMetadataInfo=void 0,this._flags=0,this.cull=t.cull??!0,this.occlude=t.occlude??!0,this.executeInClosestFrustum=t.executeInClosestFrustum??!1,this.debugShowBoundingVolume=t.debugShowBoundingVolume??!1,this.castShadows=t.castShadows??!1,this.receiveShadows=t.receiveShadows??!1,this.pickOnly=t.pickOnly??!1,this.depthForTranslucentClassification=t.depthForTranslucentClassification??!1,this.dirty=!0,this.lastDirtyTime=0,this.derivedCommands={}}get boundingVolume(){return this._boundingVolume}set boundingVolume(t){this._boundingVolume!==t&&(this._boundingVolume=t,this.dirty=!0)}get orientedBoundingBox(){return this._orientedBoundingBox}set orientedBoundingBox(t){this._orientedBoundingBox!==t&&(this._orientedBoundingBox=t,this.dirty=!0)}get cull(){return Uc(this,Ho.CULL)}set cull(t){Uc(this,Ho.CULL)!==t&&(D_(this,Ho.CULL,t),this.dirty=!0)}get occlude(){return Uc(this,Ho.OCCLUDE)}set occlude(t){Uc(this,Ho.OCCLUDE)!==t&&(D_(this,Ho.OCCLUDE,t),this.dirty=!0)}get modelMatrix(){return this._modelMatrix}set modelMatrix(t){this._modelMatrix!==t&&(this._modelMatrix=t,this.dirty=!0)}get primitiveType(){return this._primitiveType}set primitiveType(t){this._primitiveType!==t&&(this._primitiveType=t,this.dirty=!0)}get vertexArray(){return this._vertexArray}set vertexArray(t){this._vertexArray!==t&&(this._vertexArray=t,this.dirty=!0)}get count(){return this._count}set count(t){this._count!==t&&(this._count=t,this.dirty=!0)}get offset(){return this._offset}set offset(t){this._offset!==t&&(this._offset=t,this.dirty=!0)}get instanceCount(){return this._instanceCount}set instanceCount(t){this._instanceCount!==t&&(this._instanceCount=t,this.dirty=!0)}get shaderProgram(){return this._shaderProgram}set shaderProgram(t){this._shaderProgram!==t&&(this._shaderProgram=t,this.dirty=!0)}get castShadows(){return Uc(this,Ho.CAST_SHADOWS)}set castShadows(t){Uc(this,Ho.CAST_SHADOWS)!==t&&(D_(this,Ho.CAST_SHADOWS,t),this.dirty=!0)}get receiveShadows(){return Uc(this,Ho.RECEIVE_SHADOWS)}set receiveShadows(t){Uc(this,Ho.RECEIVE_SHADOWS)!==t&&(D_(this,Ho.RECEIVE_SHADOWS,t),this.dirty=!0)}get uniformMap(){return this._uniformMap}set uniformMap(t){this._uniformMap!==t&&(this._uniformMap=t,this.dirty=!0)}get renderState(){return this._renderState}set renderState(t){this._renderState!==t&&(this._renderState=t,this.dirty=!0)}get framebuffer(){return this._framebuffer}set framebuffer(t){this._framebuffer!==t&&(this._framebuffer=t,this.dirty=!0)}get pass(){return this._pass}set pass(t){this._pass!==t&&(this._pass=t,this.dirty=!0)}get executeInClosestFrustum(){return Uc(this,Ho.EXECUTE_IN_CLOSEST_FRUSTUM)}set executeInClosestFrustum(t){Uc(this,Ho.EXECUTE_IN_CLOSEST_FRUSTUM)!==t&&(D_(this,Ho.EXECUTE_IN_CLOSEST_FRUSTUM,t),this.dirty=!0)}get owner(){return this._owner}set owner(t){this._owner!==t&&(this._owner=t,this.dirty=!0)}get debugShowBoundingVolume(){return Uc(this,Ho.DEBUG_SHOW_BOUNDING_VOLUME)}set debugShowBoundingVolume(t){Uc(this,Ho.DEBUG_SHOW_BOUNDING_VOLUME)!==t&&(D_(this,Ho.DEBUG_SHOW_BOUNDING_VOLUME,t),this.dirty=!0)}get debugOverlappingFrustums(){return this._debugOverlappingFrustums}set debugOverlappingFrustums(t){this._debugOverlappingFrustums!==t&&(this._debugOverlappingFrustums=t,this.dirty=!0)}get pickId(){return this._pickId}set pickId(t){this._pickId!==t&&(this._pickId=t,this.dirty=!0)}get snapId(){return this._snapId}set snapId(t){this._snapId!==t&&(this._snapId=t,this.dirty=!0)}get pickMetadataAllowed(){return this._pickMetadataAllowed}get pickedMetadataInfo(){return this._pickedMetadataInfo}set pickedMetadataInfo(t){this._pickedMetadataInfo!==t&&(this._pickedMetadataInfo=t,this.dirty=!0)}get pickOnly(){return Uc(this,Ho.PICK_ONLY)}set pickOnly(t){Uc(this,Ho.PICK_ONLY)!==t&&(D_(this,Ho.PICK_ONLY,t),this.dirty=!0)}get depthForTranslucentClassification(){return Uc(this,Ho.DEPTH_FOR_TRANSLUCENT_CLASSIFICATION)}set depthForTranslucentClassification(t){Uc(this,Ho.DEPTH_FOR_TRANSLUCENT_CLASSIFICATION)!==t&&(D_(this,Ho.DEPTH_FOR_TRANSLUCENT_CLASSIFICATION,t),this.dirty=!0)}static shallowClone(t,n){if(l(t))return l(n)||(n=new e),n._boundingVolume=t._boundingVolume,n._orientedBoundingBox=t._orientedBoundingBox,n._modelMatrix=t._modelMatrix,n._primitiveType=t._primitiveType,n._vertexArray=t._vertexArray,n._count=t._count,n._offset=t._offset,n._instanceCount=t._instanceCount,n._shaderProgram=t._shaderProgram,n._uniformMap=t._uniformMap,n._renderState=t._renderState,n._framebuffer=t._framebuffer,n._pass=t._pass,n._owner=t._owner,n._debugOverlappingFrustums=t._debugOverlappingFrustums,n._pickId=t._pickId,n._snapId=t._snapId,n._pickMetadataAllowed=t._pickMetadataAllowed,n._pickedMetadataInfo=t._pickedMetadataInfo,n._flags=t._flags,n.dirty=!0,n.lastDirtyTime=0,n}execute(t,n){t.draw(this,n)}};function Uc(e,t){return(e._flags&t)===t}function D_(e,t,n){n?e._flags|=t:e._flags&=~t}var at=$q;var Di={UNSIGNED_BYTE:te.UNSIGNED_BYTE,UNSIGNED_SHORT:te.UNSIGNED_SHORT,UNSIGNED_INT:te.UNSIGNED_INT,FLOAT:te.FLOAT,HALF_FLOAT:te.HALF_FLOAT_OES,UNSIGNED_INT_24_8:te.UNSIGNED_INT_24_8,UNSIGNED_SHORT_4_4_4_4:te.UNSIGNED_SHORT_4_4_4_4,UNSIGNED_SHORT_5_5_5_1:te.UNSIGNED_SHORT_5_5_5_1,UNSIGNED_SHORT_5_6_5:te.UNSIGNED_SHORT_5_6_5};Di.toWebGLConstant=function(e,t){switch(e){case Di.UNSIGNED_BYTE:return te.UNSIGNED_BYTE;case Di.UNSIGNED_SHORT:return te.UNSIGNED_SHORT;case Di.UNSIGNED_INT:return te.UNSIGNED_INT;case Di.FLOAT:return te.FLOAT;case Di.HALF_FLOAT:return t.webgl2?te.HALF_FLOAT:te.HALF_FLOAT_OES;case Di.UNSIGNED_INT_24_8:return te.UNSIGNED_INT_24_8;case Di.UNSIGNED_SHORT_4_4_4_4:return te.UNSIGNED_SHORT_4_4_4_4;case Di.UNSIGNED_SHORT_5_5_5_1:return te.UNSIGNED_SHORT_5_5_5_1;case Di.UNSIGNED_SHORT_5_6_5:return Di.UNSIGNED_SHORT_5_6_5}};Di.isPacked=function(e){return e===Di.UNSIGNED_INT_24_8||e===Di.UNSIGNED_SHORT_4_4_4_4||e===Di.UNSIGNED_SHORT_5_5_5_1||e===Di.UNSIGNED_SHORT_5_6_5};Di.sizeInBytes=function(e){switch(e){case Di.UNSIGNED_BYTE:return 1;case Di.UNSIGNED_SHORT:case Di.UNSIGNED_SHORT_4_4_4_4:case Di.UNSIGNED_SHORT_5_5_5_1:case Di.UNSIGNED_SHORT_5_6_5:case Di.HALF_FLOAT:return 2;case Di.UNSIGNED_INT:case Di.FLOAT:case Di.UNSIGNED_INT_24_8:return 4}};Di.validate=function(e){return e===Di.UNSIGNED_BYTE||e===Di.UNSIGNED_SHORT||e===Di.UNSIGNED_INT||e===Di.FLOAT||e===Di.HALF_FLOAT||e===Di.UNSIGNED_INT_24_8||e===Di.UNSIGNED_SHORT_4_4_4_4||e===Di.UNSIGNED_SHORT_5_5_5_1||e===Di.UNSIGNED_SHORT_5_6_5};Di.getTypedArrayConstructor=function(e){let t=Di.sizeInBytes(e);return t===Uint8Array.BYTES_PER_ELEMENT?Uint8Array:t===Uint16Array.BYTES_PER_ELEMENT?Uint16Array:t===Float32Array.BYTES_PER_ELEMENT&&e===Di.FLOAT?Float32Array:Uint32Array};Object.freeze(Di);var ze=Di;var ot={DEPTH_COMPONENT:te.DEPTH_COMPONENT,DEPTH_STENCIL:te.DEPTH_STENCIL,ALPHA:te.ALPHA,RED:te.RED,RG:te.RG,RGB:te.RGB,RGBA:te.RGBA,RED_INTEGER:te.RED_INTEGER,RG_INTEGER:te.RG_INTEGER,RGB_INTEGER:te.RGB_INTEGER,RGBA_INTEGER:te.RGBA_INTEGER,LUMINANCE:te.LUMINANCE,LUMINANCE_ALPHA:te.LUMINANCE_ALPHA,RGB_DXT1:te.COMPRESSED_RGB_S3TC_DXT1_EXT,RGBA_DXT1:te.COMPRESSED_RGBA_S3TC_DXT1_EXT,RGBA_DXT3:te.COMPRESSED_RGBA_S3TC_DXT3_EXT,RGBA_DXT5:te.COMPRESSED_RGBA_S3TC_DXT5_EXT,RGB_PVRTC_4BPPV1:te.COMPRESSED_RGB_PVRTC_4BPPV1_IMG,RGB_PVRTC_2BPPV1:te.COMPRESSED_RGB_PVRTC_2BPPV1_IMG,RGBA_PVRTC_4BPPV1:te.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG,RGBA_PVRTC_2BPPV1:te.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG,RGBA_ASTC:te.COMPRESSED_RGBA_ASTC_4x4_WEBGL,RGB_ETC1:te.COMPRESSED_RGB_ETC1_WEBGL,RGB8_ETC2:te.COMPRESSED_RGB8_ETC2,RGBA8_ETC2_EAC:te.COMPRESSED_RGBA8_ETC2_EAC,RGBA_BC7:te.COMPRESSED_RGBA_BPTC_UNORM};ot.componentsLength=function(e){switch(e){case ot.RGB:case ot.RGB_INTEGER:return 3;case ot.RGBA:case ot.RGBA_INTEGER:return 4;case ot.LUMINANCE_ALPHA:case ot.RG:case ot.RG_INTEGER:return 2;case ot.ALPHA:case ot.RED:case ot.RED_INTEGER:case ot.LUMINANCE:return 1;default:return 1}};ot.validate=function(e){return e===ot.DEPTH_COMPONENT||e===ot.DEPTH_STENCIL||e===ot.ALPHA||e===ot.RED||e===ot.RG||e===ot.RGB||e===ot.RGBA||e===ot.RED_INTEGER||e===ot.RG_INTEGER||e===ot.RGB_INTEGER||e===ot.RGBA_INTEGER||e===ot.LUMINANCE||e===ot.LUMINANCE_ALPHA||e===ot.RGB_DXT1||e===ot.RGBA_DXT1||e===ot.RGBA_DXT3||e===ot.RGBA_DXT5||e===ot.RGB_PVRTC_4BPPV1||e===ot.RGB_PVRTC_2BPPV1||e===ot.RGBA_PVRTC_4BPPV1||e===ot.RGBA_PVRTC_2BPPV1||e===ot.RGBA_ASTC||e===ot.RGB_ETC1||e===ot.RGB8_ETC2||e===ot.RGBA8_ETC2_EAC||e===ot.RGBA_BC7};ot.isColorFormat=function(e){return e===ot.RED||e===ot.ALPHA||e===ot.RGB||e===ot.RGBA||e===ot.LUMINANCE||e===ot.LUMINANCE_ALPHA};ot.isDepthFormat=function(e){return e===ot.DEPTH_COMPONENT||e===ot.DEPTH_STENCIL};ot.isCompressedFormat=function(e){return e===ot.RGB_DXT1||e===ot.RGBA_DXT1||e===ot.RGBA_DXT3||e===ot.RGBA_DXT5||e===ot.RGB_PVRTC_4BPPV1||e===ot.RGB_PVRTC_2BPPV1||e===ot.RGBA_PVRTC_4BPPV1||e===ot.RGBA_PVRTC_2BPPV1||e===ot.RGBA_ASTC||e===ot.RGB_ETC1||e===ot.RGB8_ETC2||e===ot.RGBA8_ETC2_EAC||e===ot.RGBA_BC7};ot.isDXTFormat=function(e){return e===ot.RGB_DXT1||e===ot.RGBA_DXT1||e===ot.RGBA_DXT3||e===ot.RGBA_DXT5};ot.isPVRTCFormat=function(e){return e===ot.RGB_PVRTC_4BPPV1||e===ot.RGB_PVRTC_2BPPV1||e===ot.RGBA_PVRTC_4BPPV1||e===ot.RGBA_PVRTC_2BPPV1};ot.isASTCFormat=function(e){return e===ot.RGBA_ASTC};ot.isETC1Format=function(e){return e===ot.RGB_ETC1};ot.isETC2Format=function(e){return e===ot.RGB8_ETC2||e===ot.RGBA8_ETC2_EAC};ot.isBC7Format=function(e){return e===ot.RGBA_BC7};ot.compressedTextureSizeInBytes=function(e,t,n){switch(e){case ot.RGB_DXT1:case ot.RGBA_DXT1:case ot.RGB_ETC1:case ot.RGB8_ETC2:return Math.floor((t+3)/4)*Math.floor((n+3)/4)*8;case ot.RGBA_DXT3:case ot.RGBA_DXT5:case ot.RGBA_ASTC:case ot.RGBA8_ETC2_EAC:return Math.floor((t+3)/4)*Math.floor((n+3)/4)*16;case ot.RGB_PVRTC_4BPPV1:case ot.RGBA_PVRTC_4BPPV1:return Math.floor((Math.max(t,8)*Math.max(n,8)*4+7)/8);case ot.RGB_PVRTC_2BPPV1:case ot.RGBA_PVRTC_2BPPV1:return Math.floor((Math.max(t,16)*Math.max(n,8)*2+7)/8);case ot.RGBA_BC7:return Math.ceil(t/4)*Math.ceil(n/4)*16;default:return 0}};ot.textureSizeInBytes=function(e,t,n,i){let r=ot.componentsLength(e);return ze.isPacked(t)&&(r=1),r*ze.sizeInBytes(t)*n*i};ot.texture3DSizeInBytes=function(e,t,n,i,r){let o=ot.componentsLength(e);return ze.isPacked(t)&&(o=1),o*ze.sizeInBytes(t)*n*i*r};ot.alignmentInBytes=function(e,t,n){let i=ot.textureSizeInBytes(e,t,n,1)%4;return i===0?4:i===2?2:1};ot.createTypedArray=function(e,t,n,i){let r=ze.getTypedArrayConstructor(t),o=ot.componentsLength(e)*n*i;return new r(o)};ot.flipY=function(e,t,n,i,r){if(r===1)return e;let o=ot.createTypedArray(t,n,i,r),s=ot.componentsLength(t),a=i*s;for(let c=0;c<r;++c){let u=c*i*s,f=(r-c-1)*i*s;for(let d=0;d<a;++d)o[f+d]=e[u+d]}return o};ot.toInternalFormat=function(e,t,n){if(!n.webgl2)return e;if(e===ot.DEPTH_STENCIL)return te.DEPTH24_STENCIL8;if(e===ot.DEPTH_COMPONENT){if(t===ze.UNSIGNED_SHORT)return te.DEPTH_COMPONENT16;if(t===ze.UNSIGNED_INT)return te.DEPTH_COMPONENT24}if(t===ze.FLOAT)switch(e){case ot.RGBA:return te.RGBA32F;case ot.RGB:return te.RGB32F;case ot.RG:return te.RG32F;case ot.RED:return te.R32F}if(t===ze.HALF_FLOAT)switch(e){case ot.RGBA:return te.RGBA16F;case ot.RGB:return te.RGB16F;case ot.RG:return te.RG16F;case ot.RED:return te.R16F}if(t===ze.UNSIGNED_BYTE)switch(e){case ot.RGBA:return te.RGBA8;case ot.RGB:return te.RGB8;case ot.RG:return te.RG8;case ot.RED:return te.R8}if(t===ze.INT)switch(e){case ot.RGBA_INTEGER:return te.RGBA32I;case ot.RGB_INTEGER:return te.RGB32I;case ot.RG_INTEGER:return te.RG32I;case ot.RED_INTEGER:return te.R32I}if(t===ze.UNSIGNED_INT)switch(e){case ot.RGBA_INTEGER:return te.RGBA32UI;case ot.RGB_INTEGER:return te.RGB32UI;case ot.RG_INTEGER:return te.RG32UI;case ot.RED_INTEGER:return te.R32UI}return e};Object.freeze(ot);var $e=ot;var Mo={_maximumCombinedTextureImageUnits:0,_maximumCubeMapSize:0,_maximumFragmentUniformVectors:0,_maximumTextureImageUnits:0,_maximumRenderbufferSize:0,_maximumTextureSize:0,_maximum3DTextureSize:0,_maximumVaryingVectors:0,_maximumVertexAttributes:0,_maximumVertexTextureImageUnits:0,_maximumVertexUniformVectors:0,_minimumAliasedLineWidth:0,_maximumAliasedLineWidth:0,_minimumAliasedPointSize:0,_maximumAliasedPointSize:0,_maximumViewportWidth:0,_maximumViewportHeight:0,_maximumTextureFilterAnisotropy:0,_maximumDrawBuffers:0,_maximumColorAttachments:0,_maximumSamples:0,_highpFloatSupported:!1,_highpIntSupported:!1};Object.defineProperties(Mo,{maximumCombinedTextureImageUnits:{get:function(){return Mo._maximumCombinedTextureImageUnits}},maximumCubeMapSize:{get:function(){return Mo._maximumCubeMapSize}},maximumFragmentUniformVectors:{get:function(){return Mo._maximumFragmentUniformVectors}},maximumTextureImageUnits:{get:function(){return Mo._maximumTextureImageUnits}},maximumRenderbufferSize:{get:function(){return Mo._maximumRenderbufferSize}},maximumTextureSize:{get:function(){return Mo._maximumTextureSize}},maximum3DTextureSize:{get:function(){return Mo._maximum3DTextureSize}},maximumVaryingVectors:{get:function(){return Mo._maximumVaryingVectors}},maximumVertexAttributes:{get:function(){return Mo._maximumVertexAttributes}},maximumVertexTextureImageUnits:{get:function(){return Mo._maximumVertexTextureImageUnits}},maximumVertexUniformVectors:{get:function(){return Mo._maximumVertexUniformVectors}},minimumAliasedLineWidth:{get:function(){return Mo._minimumAliasedLineWidth}},maximumAliasedLineWidth:{get:function(){return Mo._maximumAliasedLineWidth}},minimumAliasedPointSize:{get:function(){return Mo._minimumAliasedPointSize}},maximumAliasedPointSize:{get:function(){return Mo._maximumAliasedPointSize}},maximumViewportWidth:{get:function(){return Mo._maximumViewportWidth}},maximumViewportHeight:{get:function(){return Mo._maximumViewportHeight}},maximumTextureFilterAnisotropy:{get:function(){return Mo._maximumTextureFilterAnisotropy}},maximumDrawBuffers:{get:function(){return Mo._maximumDrawBuffers}},maximumColorAttachments:{get:function(){return Mo._maximumColorAttachments}},maximumSamples:{get:function(){return Mo._maximumSamples}},highpFloatSupported:{get:function(){return Mo._highpFloatSupported}},highpIntSupported:{get:function(){return Mo._highpIntSupported}}});var Ut=Mo;function Jq(e,t,n){let i=e._gl;i.framebufferTexture2D(i.FRAMEBUFFER,t,n._target,n._texture,0)}function KN(e,t,n){let i=e._gl;i.framebufferRenderbuffer(i.FRAMEBUFFER,t,i.RENDERBUFFER,n._getRenderbuffer())}function hh(e){e=e??H.EMPTY_OBJECT;let t=e.context,n=t._gl,i=Ut.maximumColorAttachments;if(this._gl=n,this._framebuffer=n.createFramebuffer(),this._colorTextures=[],this._colorRenderbuffers=[],this._activeColorAttachments=[],this._depthTexture=void 0,this._depthRenderbuffer=void 0,this._stencilRenderbuffer=void 0,this._depthStencilTexture=void 0,this._depthStencilRenderbuffer=void 0,this.destroyAttachments=e.destroyAttachments??!0,this._bind(),l(e.colorTextures)){let r=e.colorTextures,o=this._colorTextures.length=this._activeColorAttachments.length=r.length;for(let s=0;s<o;++s){let a=r[s],c=this._gl.COLOR_ATTACHMENT0+s;Jq(this,c,a),this._activeColorAttachments[s]=c,this._colorTextures[s]=a}}if(l(e.colorRenderbuffers)){let r=e.colorRenderbuffers,o=this._colorRenderbuffers.length=this._activeColorAttachments.length=r.length;for(let s=0;s<o;++s){let a=r[s],c=this._gl.COLOR_ATTACHMENT0+s;KN(this,c,a),this._activeColorAttachments[s]=c,this._colorRenderbuffers[s]=a}}if(l(e.depthTexture)){let r=e.depthTexture;Jq(this,this._gl.DEPTH_ATTACHMENT,r),this._depthTexture=r}if(l(e.depthRenderbuffer)){let r=e.depthRenderbuffer;KN(this,this._gl.DEPTH_ATTACHMENT,r),this._depthRenderbuffer=r}if(l(e.stencilRenderbuffer)){let r=e.stencilRenderbuffer;KN(this,this._gl.STENCIL_ATTACHMENT,r),this._stencilRenderbuffer=r}if(l(e.depthStencilTexture)){let r=e.depthStencilTexture;Jq(this,this._gl.DEPTH_STENCIL_ATTACHMENT,r),this._depthStencilTexture=r}if(l(e.depthStencilRenderbuffer)){let r=e.depthStencilRenderbuffer;KN(this,this._gl.DEPTH_STENCIL_ATTACHMENT,r),this._depthStencilRenderbuffer=r}this._unBind(),t._currentFramebuffer=void 0}Object.defineProperties(hh.prototype,{status:{get:function(){this._bind();let e=this._gl.checkFramebufferStatus(this._gl.FRAMEBUFFER);return this._unBind(),e}},numberOfColorAttachments:{get:function(){return this._activeColorAttachments.length}},depthTexture:{get:function(){return this._depthTexture}},depthRenderbuffer:{get:function(){return this._depthRenderbuffer}},stencilRenderbuffer:{get:function(){return this._stencilRenderbuffer}},depthStencilTexture:{get:function(){return this._depthStencilTexture}},depthStencilRenderbuffer:{get:function(){return this._depthStencilRenderbuffer}},hasDepthAttachment:{get:function(){return!!(this.depthTexture||this.depthRenderbuffer||this.depthStencilTexture||this.depthStencilRenderbuffer)}}});hh.prototype._bind=function(){let e=this._gl;e.bindFramebuffer(e.FRAMEBUFFER,this._framebuffer)};hh.prototype._unBind=function(){let e=this._gl;e.bindFramebuffer(e.FRAMEBUFFER,null)};hh.prototype.bindDraw=function(){let e=this._gl;e.bindFramebuffer(e.DRAW_FRAMEBUFFER,this._framebuffer)};hh.prototype.bindRead=function(){let e=this._gl;e.bindFramebuffer(e.READ_FRAMEBUFFER,this._framebuffer)};hh.prototype._getActiveColorAttachments=function(){return this._activeColorAttachments};hh.prototype.getColorTexture=function(e){return this._colorTextures[e]};hh.prototype.getColorRenderbuffer=function(e){return this._colorRenderbuffers[e]};hh.prototype.isDestroyed=function(){return!1};hh.prototype.destroy=function(){if(this.destroyAttachments){let e=this._colorTextures;for(let n=0;n<e.length;++n){let i=e[n];l(i)&&i.destroy()}let t=this._colorRenderbuffers;for(let n=0;n<t.length;++n){let i=t[n];l(i)&&i.destroy()}this._depthTexture=this._depthTexture&&this._depthTexture.destroy(),this._depthRenderbuffer=this._depthRenderbuffer&&this._depthRenderbuffer.destroy(),this._stencilRenderbuffer=this._stencilRenderbuffer&&this._stencilRenderbuffer.destroy(),this._depthStencilTexture=this._depthStencilTexture&&this._depthStencilTexture.destroy(),this._depthStencilRenderbuffer=this._depthStencilRenderbuffer&&this._depthStencilRenderbuffer.destroy()}return this._gl.deleteFramebuffer(this._framebuffer),le(this)};var vs=hh;var qI={CLOCKWISE:te.CW,COUNTER_CLOCKWISE:te.CCW};qI.validate=function(e){return e===qI.CLOCKWISE||e===qI.COUNTER_CLOCKWISE};Object.freeze(qI);var sa=qI;function lle(e){if(typeof e!="object"||e===null)return e;let t,n=Object.keys(e);for(let i=0;i<n.length;i++)t=n[i],e.hasOwnProperty(t)&&t!=="_applyFunctions"&&(e[t]=lle(e[t]));return Object.freeze(e)}var ule=lle;function Hm(e){let t=e??H.EMPTY_OBJECT,n=t.cull??H.EMPTY_OBJECT,i=t.polygonOffset??H.EMPTY_OBJECT,r=t.scissorTest??H.EMPTY_OBJECT,o=r.rectangle??H.EMPTY_OBJECT,s=t.depthRange??H.EMPTY_OBJECT,a=t.depthTest??H.EMPTY_OBJECT,c=t.colorMask??H.EMPTY_OBJECT,u=t.blending??H.EMPTY_OBJECT,f=u.color??H.EMPTY_OBJECT,d=t.stencilTest??H.EMPTY_OBJECT,p=d.frontOperation??H.EMPTY_OBJECT,g=d.backOperation??H.EMPTY_OBJECT,m=t.sampleCoverage??H.EMPTY_OBJECT,y=t.viewport;this.frontFace=t.frontFace??sa.COUNTER_CLOCKWISE,this.cull={enabled:n.enabled??!1,face:n.face??te.BACK},this.lineWidth=t.lineWidth??1,this.polygonOffset={enabled:i.enabled??!1,factor:i.factor??0,units:i.units??0},this.scissorTest={enabled:r.enabled??!1,rectangle:et.clone(o)},this.depthRange={near:s.near??0,far:s.far??1},this.depthTest={enabled:a.enabled??!1,func:a.func??te.LESS},this.colorMask={red:c.red??!0,green:c.green??!0,blue:c.blue??!0,alpha:c.alpha??!0},this.depthMask=t.depthMask??!0,this.stencilMask=t.stencilMask??-1,this.blending={enabled:u.enabled??!1,color:new z(f.red??0,f.green??0,f.blue??0,f.alpha??0),equationRgb:u.equationRgb??te.FUNC_ADD,equationAlpha:u.equationAlpha??te.FUNC_ADD,functionSourceRgb:u.functionSourceRgb??te.ONE,functionSourceAlpha:u.functionSourceAlpha??te.ONE,functionDestinationRgb:u.functionDestinationRgb??te.ZERO,functionDestinationAlpha:u.functionDestinationAlpha??te.ZERO},this.stencilTest={enabled:d.enabled??!1,frontFunction:d.frontFunction??te.ALWAYS,backFunction:d.backFunction??te.ALWAYS,reference:d.reference??0,mask:d.mask??-1,frontOperation:{fail:p.fail??te.KEEP,zFail:p.zFail??te.KEEP,zPass:p.zPass??te.KEEP},backOperation:{fail:g.fail??te.KEEP,zFail:g.zFail??te.KEEP,zPass:g.zPass??te.KEEP}},this.sampleCoverage={enabled:m.enabled??!1,value:m.value??1,invert:m.invert??!1},this.viewport=l(y)?new et(y.x,y.y,y.width,y.height):void 0,this.id=0,this._applyFunctions=[]}var Dze=0,jm={};Hm.fromCache=function(e){let t=JSON.stringify(e),n=jm[t];if(l(n))return++n.referenceCount,n.state;let i=new Hm(e),r=JSON.stringify(i);return n=jm[r],l(n)||(i.id=Dze++,n={referenceCount:0,state:i},jm[r]=n),++n.referenceCount,jm[t]={referenceCount:1,state:n.state},n.state};Hm.removeFromCache=function(e){let t=new Hm(e),n=JSON.stringify(t),i=jm[n],r=JSON.stringify(e),o=jm[r];l(o)&&(--o.referenceCount,o.referenceCount===0&&(delete jm[r],l(i)&&--i.referenceCount)),l(i)&&i.referenceCount===0&&delete jm[n]};Hm.getCache=function(){return jm};Hm.clearCache=function(){jm={}};function Tb(e,t,n){n?e.enable(t):e.disable(t)}function fle(e,t){e.frontFace(t.frontFace)}function dle(e,t){let n=t.cull,i=n.enabled;Tb(e,e.CULL_FACE,i),i&&e.cullFace(n.face)}function hle(e,t){e.lineWidth(t.lineWidth)}function mle(e,t){let n=t.polygonOffset,i=n.enabled;Tb(e,e.POLYGON_OFFSET_FILL,i),i&&e.polygonOffset(n.factor,n.units)}function ple(e,t,n){let i=t.scissorTest,r=l(n.scissorTest)?n.scissorTest.enabled:i.enabled;if(Tb(e,e.SCISSOR_TEST,r),r){let o=l(n.scissorTest)?n.scissorTest.rectangle:i.rectangle;e.scissor(o.x,o.y,o.width,o.height)}}function gle(e,t){let n=t.depthRange;e.depthRange(n.near,n.far)}function _le(e,t){let n=t.depthTest,i=n.enabled;Tb(e,e.DEPTH_TEST,i),i&&e.depthFunc(n.func)}function yle(e,t){let n=t.colorMask;e.colorMask(n.red,n.green,n.blue,n.alpha)}function Ale(e,t){e.depthMask(t.depthMask)}function ble(e,t){e.stencilMask(t.stencilMask)}function Rze(e,t){e.blendColor(t.red,t.green,t.blue,t.alpha)}function xle(e,t,n){let i=t.blending,r=l(n.blendingEnabled)?n.blendingEnabled:i.enabled;Tb(e,e.BLEND,r),r&&(Rze(e,i.color),e.blendEquationSeparate(i.equationRgb,i.equationAlpha),e.blendFuncSeparate(i.functionSourceRgb,i.functionDestinationRgb,i.functionSourceAlpha,i.functionDestinationAlpha))}function Tle(e,t){let n=t.stencilTest,i=n.enabled;if(Tb(e,e.STENCIL_TEST,i),i){let r=n.frontFunction,o=n.backFunction,s=n.reference,a=n.mask;e.stencilFunc(r,s,a),e.stencilFuncSeparate(e.BACK,o,s,a),e.stencilFuncSeparate(e.FRONT,r,s,a);let c=n.frontOperation,u=c.fail,f=c.zFail,d=c.zPass;e.stencilOpSeparate(e.FRONT,u,f,d);let p=n.backOperation,g=p.fail,m=p.zFail,y=p.zPass;e.stencilOpSeparate(e.BACK,g,m,y)}}function Ele(e,t){let n=t.sampleCoverage,i=n.enabled;Tb(e,e.SAMPLE_COVERAGE,i),i&&e.sampleCoverage(n.value,n.invert)}var Oze=new et;function Cle(e,t,n){let i=t.viewport??n.viewport;l(i)||(i=Oze,i.width=n.context.drawingBufferWidth,i.height=n.context.drawingBufferHeight),n.context.uniformState.viewport=i,e.viewport(i.x,i.y,i.width,i.height)}Hm.apply=function(e,t,n){fle(e,t),dle(e,t),hle(e,t),mle(e,t),gle(e,t),_le(e,t),yle(e,t),Ale(e,t),ble(e,t),Tle(e,t),Ele(e,t),ple(e,t,n),xle(e,t,n),Cle(e,t,n)};function Mze(e,t){let n=[];return e.frontFace!==t.frontFace&&n.push(fle),(e.cull.enabled!==t.cull.enabled||e.cull.face!==t.cull.face)&&n.push(dle),e.lineWidth!==t.lineWidth&&n.push(hle),(e.polygonOffset.enabled!==t.polygonOffset.enabled||e.polygonOffset.factor!==t.polygonOffset.factor||e.polygonOffset.units!==t.polygonOffset.units)&&n.push(mle),(e.depthRange.near!==t.depthRange.near||e.depthRange.far!==t.depthRange.far)&&n.push(gle),(e.depthTest.enabled!==t.depthTest.enabled||e.depthTest.func!==t.depthTest.func)&&n.push(_le),(e.colorMask.red!==t.colorMask.red||e.colorMask.green!==t.colorMask.green||e.colorMask.blue!==t.colorMask.blue||e.colorMask.alpha!==t.colorMask.alpha)&&n.push(yle),e.depthMask!==t.depthMask&&n.push(Ale),e.stencilMask!==t.stencilMask&&n.push(ble),(e.stencilTest.enabled!==t.stencilTest.enabled||e.stencilTest.frontFunction!==t.stencilTest.frontFunction||e.stencilTest.backFunction!==t.stencilTest.backFunction||e.stencilTest.reference!==t.stencilTest.reference||e.stencilTest.mask!==t.stencilTest.mask||e.stencilTest.frontOperation.fail!==t.stencilTest.frontOperation.fail||e.stencilTest.frontOperation.zFail!==t.stencilTest.frontOperation.zFail||e.stencilTest.backOperation.fail!==t.stencilTest.backOperation.fail||e.stencilTest.backOperation.zFail!==t.stencilTest.backOperation.zFail||e.stencilTest.backOperation.zPass!==t.stencilTest.backOperation.zPass)&&n.push(Tle),(e.sampleCoverage.enabled!==t.sampleCoverage.enabled||e.sampleCoverage.value!==t.sampleCoverage.value||e.sampleCoverage.invert!==t.sampleCoverage.invert)&&n.push(Ele),n}Hm.partialApply=function(e,t,n,i,r,o){if(t!==n){let f=n._applyFunctions[t.id];l(f)||(f=Mze(t,n),n._applyFunctions[t.id]=f);let d=f.length;for(let p=0;p<d;++p)f[p](e,n)}let s=l(i.scissorTest)?i.scissorTest:t.scissorTest,a=l(r.scissorTest)?r.scissorTest:n.scissorTest;(s!==a||o)&&ple(e,n,r);let c=l(i.blendingEnabled)?i.blendingEnabled:t.blending.enabled,u=l(r.blendingEnabled)?r.blendingEnabled:n.blending.enabled;(c!==u||u&&t.blending!==n.blending)&&xle(e,n,r),(t!==n||i!==r||i.context!==r.context)&&Cle(e,n,r)};Hm.getState=function(e){return{frontFace:e.frontFace,cull:{enabled:e.cull.enabled,face:e.cull.face},lineWidth:e.lineWidth,polygonOffset:{enabled:e.polygonOffset.enabled,factor:e.polygonOffset.factor,units:e.polygonOffset.units},scissorTest:{enabled:e.scissorTest.enabled,rectangle:et.clone(e.scissorTest.rectangle)},depthRange:{near:e.depthRange.near,far:e.depthRange.far},depthTest:{enabled:e.depthTest.enabled,func:e.depthTest.func},colorMask:{red:e.colorMask.red,green:e.colorMask.green,blue:e.colorMask.blue,alpha:e.colorMask.alpha},depthMask:e.depthMask,stencilMask:e.stencilMask,blending:{enabled:e.blending.enabled,color:z.clone(e.blending.color),equationRgb:e.blending.equationRgb,equationAlpha:e.blending.equationAlpha,functionSourceRgb:e.blending.functionSourceRgb,functionSourceAlpha:e.blending.functionSourceAlpha,functionDestinationRgb:e.blending.functionDestinationRgb,functionDestinationAlpha:e.blending.functionDestinationAlpha},stencilTest:{enabled:e.stencilTest.enabled,frontFunction:e.stencilTest.frontFunction,backFunction:e.stencilTest.backFunction,reference:e.stencilTest.reference,mask:e.stencilTest.mask,frontOperation:{fail:e.stencilTest.frontOperation.fail,zFail:e.stencilTest.frontOperation.zFail,zPass:e.stencilTest.frontOperation.zPass},backOperation:{fail:e.stencilTest.backOperation.fail,zFail:e.stencilTest.backOperation.zFail,zPass:e.stencilTest.backOperation.zPass}},sampleCoverage:{enabled:e.sampleCoverage.enabled,value:e.sampleCoverage.value,invert:e.sampleCoverage.invert},viewport:l(e.viewport)?et.clone(e.viewport):void 0}};var Ge=Hm;var Nze=Object.freeze([NaN,NaN,NaN,NaN]),au=class e{constructor(t,n,i,r){let o=Reflect.construct(Array,Nze,new.target);return o[0]=t??0,o[1]=i??0,o[2]=n??0,o[3]=r??0,o}static pack(t,n,i){return i=i??0,n[i++]=t[0],n[i++]=t[1],n[i++]=t[2],n[i]=t[3],n}static unpack(t,n,i){return n=n??0,l(i)||(i=new e),i[0]=t[n++],i[1]=t[n++],i[2]=t[n++],i[3]=t[n],i}static packArray(t,n){let i=t.length,r=i*4;l(n)?!Array.isArray(n)&&n.length!==r||n.length!==r&&(n.length=r):n=new Array(r);for(let o=0;o<i;++o)e.pack(t[o],n,o*4);return n}static unpackArray(t,n){let i=t.length;l(n)?n.length=i/4:n=new Array(i/4);for(let r=0;r<i;r+=4){let o=r/4;n[o]=e.unpack(t,r,n[o])}return n}static clone(t,n){if(l(t))return l(n)?(n[0]=t[0],n[1]=t[1],n[2]=t[2],n[3]=t[3],n):new e(t[0],t[2],t[1],t[3])}static fromColumnMajorArray(t,n){return e.clone(t,n)}static fromRowMajorArray(t,n){return l(n)?(n[0]=t[0],n[1]=t[2],n[2]=t[1],n[3]=t[3],n):new e(t[0],t[1],t[2],t[3])}static fromScale(t,n){return l(n)?(n[0]=t.x,n[1]=0,n[2]=0,n[3]=t.y,n):new e(t.x,0,0,t.y)}static fromUniformScale(t,n){return l(n)?(n[0]=t,n[1]=0,n[2]=0,n[3]=t,n):new e(t,0,0,t)}static fromRotation(t,n){let i=Math.cos(t),r=Math.sin(t);return l(n)?(n[0]=i,n[1]=r,n[2]=-r,n[3]=i,n):new e(i,-r,r,i)}static toArray(t,n){return l(n)?(n[0]=t[0],n[1]=t[1],n[2]=t[2],n[3]=t[3],n):[t[0],t[1],t[2],t[3]]}static getElementIndex(t,n){return t*2+n}static getColumn(t,n,i){let r=n*2,o=t[r],s=t[r+1];return i.x=o,i.y=s,i}static setColumn(t,n,i,r){r=e.clone(t,r);let o=n*2;return r[o]=i.x,r[o+1]=i.y,r}static getRow(t,n,i){let r=t[n],o=t[n+2];return i.x=r,i.y=o,i}static setRow(t,n,i,r){return r=e.clone(t,r),r[n]=i.x,r[n+2]=i.y,r}static setScale(t,n,i){let r=e.getScale(t,Lze),o=n.x/r.x,s=n.y/r.y;return i[0]=t[0]*o,i[1]=t[1]*o,i[2]=t[2]*s,i[3]=t[3]*s,i}static setUniformScale(t,n,i){let r=e.getScale(t,Fze),o=n/r.x,s=n/r.y;return i[0]=t[0]*o,i[1]=t[1]*o,i[2]=t[2]*s,i[3]=t[3]*s,i}static getScale(t,n){return n.x=U.magnitude(U.fromElements(t[0],t[1],vle)),n.y=U.magnitude(U.fromElements(t[2],t[3],vle)),n}static getMaximumScale(t){return e.getScale(t,Sle),U.maximumComponent(Sle)}static setRotation(t,n,i){let r=e.getScale(t,Bze);return i[0]=n[0]*r.x,i[1]=n[1]*r.x,i[2]=n[2]*r.y,i[3]=n[3]*r.y,i}static getRotation(t,n){let i=e.getScale(t,kze);return n[0]=t[0]/i.x,n[1]=t[1]/i.x,n[2]=t[2]/i.y,n[3]=t[3]/i.y,n}static multiply(t,n,i){let r=t[0]*n[0]+t[2]*n[1],o=t[0]*n[2]+t[2]*n[3],s=t[1]*n[0]+t[3]*n[1],a=t[1]*n[2]+t[3]*n[3];return i[0]=r,i[1]=s,i[2]=o,i[3]=a,i}static add(t,n,i){return i[0]=t[0]+n[0],i[1]=t[1]+n[1],i[2]=t[2]+n[2],i[3]=t[3]+n[3],i}static subtract(t,n,i){return i[0]=t[0]-n[0],i[1]=t[1]-n[1],i[2]=t[2]-n[2],i[3]=t[3]-n[3],i}static multiplyByVector(t,n,i){let r=t[0]*n.x+t[2]*n.y,o=t[1]*n.x+t[3]*n.y;return i.x=r,i.y=o,i}static multiplyByScalar(t,n,i){return i[0]=t[0]*n,i[1]=t[1]*n,i[2]=t[2]*n,i[3]=t[3]*n,i}static multiplyByScale(t,n,i){return i[0]=t[0]*n.x,i[1]=t[1]*n.x,i[2]=t[2]*n.y,i[3]=t[3]*n.y,i}static multiplyByUniformScale(t,n,i){return i[0]=t[0]*n,i[1]=t[1]*n,i[2]=t[2]*n,i[3]=t[3]*n,i}static negate(t,n){return n[0]=-t[0],n[1]=-t[1],n[2]=-t[2],n[3]=-t[3],n}static transpose(t,n){let i=t[0],r=t[2],o=t[1],s=t[3];return n[0]=i,n[1]=r,n[2]=o,n[3]=s,n}static abs(t,n){return n[0]=Math.abs(t[0]),n[1]=Math.abs(t[1]),n[2]=Math.abs(t[2]),n[3]=Math.abs(t[3]),n}static equals(t,n){return t===n||l(t)&&l(n)&&t[0]===n[0]&&t[1]===n[1]&&t[2]===n[2]&&t[3]===n[3]}static equalsArray(t,n,i){return t[0]===n[i]&&t[1]===n[i+1]&&t[2]===n[i+2]&&t[3]===n[i+3]}static equalsEpsilon(t,n,i){return i=i??0,t===n||l(t)&&l(n)&&Math.abs(t[0]-n[0])<=i&&Math.abs(t[1]-n[1])<=i&&Math.abs(t[2]-n[2])<=i&&Math.abs(t[3]-n[3])<=i}get length(){return e.packedLength}clone(t){return e.clone(this,t)}equals(t){return e.equals(this,t)}equalsEpsilon(t,n){return e.equalsEpsilon(this,t,n)}toString(){return`(${this[0]}, ${this[2]}) +(${this[1]}, ${this[3]})`}};au.packedLength=4;au.fromArray=au.unpack;au.IDENTITY=new au(1,0,0,1);au.ZERO=new au(0,0,0,0);au.COLUMN0ROW0=0;au.COLUMN0ROW1=1;au.COLUMN1ROW0=2;au.COLUMN1ROW1=3;var Lze=new U,Fze=new U,vle=new U,Sle=new U,Bze=new U,kze=new U,$i=au;function Uze(e,t,n,i){switch(t.type){case e.FLOAT:return new Zq(e,t,n,i);case e.FLOAT_VEC2:return new Qq(e,t,n,i);case e.FLOAT_VEC3:return new eY(e,t,n,i);case e.FLOAT_VEC4:return new tY(e,t,n,i);case e.SAMPLER_2D:case e.SAMPLER_3D:case e.SAMPLER_CUBE:return new $N(e,t,n,i);case e.UNSIGNED_INT_SAMPLER_2D:return new $N(e,t,n,i);case e.INT:case e.BOOL:return new nY(e,t,n,i);case e.INT_VEC2:case e.BOOL_VEC2:return new iY(e,t,n,i);case e.INT_VEC3:case e.BOOL_VEC3:return new rY(e,t,n,i);case e.INT_VEC4:case e.BOOL_VEC4:return new oY(e,t,n,i);case e.FLOAT_MAT2:return new sY(e,t,n,i);case e.FLOAT_MAT3:return new aY(e,t,n,i);case e.FLOAT_MAT4:return new cY(e,t,n,i);default:throw new oe(`Unrecognized uniform type: ${t.type} for uniform "${n}".`)}}var Zq=class{constructor(t,n,i,r){this.name=i,this.value=void 0,this._value=0,this._gl=t,this._location=r}set(){this.value!==this._value&&(this._value=this.value,this._gl.uniform1f(this._location,this.value))}},Qq=class{constructor(t,n,i,r){this.name=i,this.value=void 0,this._value=new U,this._gl=t,this._location=r}set(){let t=this.value;U.equals(t,this._value)||(U.clone(t,this._value),this._gl.uniform2f(this._location,t.x,t.y))}},eY=class{constructor(t,n,i,r){this.name=i,this.value=void 0,this._value=void 0,this._gl=t,this._location=r}set(){let t=this.value;l(t.red)?z.equals(t,this._value)||(this._value=z.clone(t,this._value),this._gl.uniform3f(this._location,t.red,t.green,t.blue)):l(t.x)&&(h.equals(t,this._value)||(this._value=h.clone(t,this._value),this._gl.uniform3f(this._location,t.x,t.y,t.z)))}},tY=class{constructor(t,n,i,r){this.name=i,this.value=void 0,this._value=void 0,this._gl=t,this._location=r}set(){let t=this.value;l(t.red)?z.equals(t,this._value)||(this._value=z.clone(t,this._value),this._gl.uniform4f(this._location,t.red,t.green,t.blue,t.alpha)):l(t.x)&&(se.equals(t,this._value)||(this._value=se.clone(t,this._value),this._gl.uniform4f(this._location,t.x,t.y,t.z,t.w)))}},$N=class{constructor(t,n,i,r){this.name=i,this.value=void 0,this._gl=t,this._location=r,this.textureUnitIndex=void 0}set(){let t=this._gl;t.activeTexture(t.TEXTURE0+this.textureUnitIndex);let n=this.value;t.bindTexture(n._target,n._texture)}_setSampler(t){return this.textureUnitIndex=t,this._gl.uniform1i(this._location,t),t+1}},nY=class{constructor(t,n,i,r){this.name=i,this.value=void 0,this._value=0,this._gl=t,this._location=r}set(){this.value!==this._value&&(this._value=this.value,this._gl.uniform1i(this._location,this.value))}},iY=class{constructor(t,n,i,r){this.name=i,this.value=void 0,this._value=new U,this._gl=t,this._location=r}set(){let t=this.value;U.equals(t,this._value)||(U.clone(t,this._value),this._gl.uniform2i(this._location,t.x,t.y))}},rY=class{constructor(t,n,i,r){this.name=i,this.value=void 0,this._value=new h,this._gl=t,this._location=r}set(){let t=this.value;h.equals(t,this._value)||(h.clone(t,this._value),this._gl.uniform3i(this._location,t.x,t.y,t.z))}},oY=class{constructor(t,n,i,r){this.name=i,this.value=void 0,this._value=new se,this._gl=t,this._location=r}set(){let t=this.value;se.equals(t,this._value)||(se.clone(t,this._value),this._gl.uniform4i(this._location,t.x,t.y,t.z,t.w))}},zze=new Float32Array(4),sY=class{constructor(t,n,i,r){this.name=i,this.value=void 0,this._value=new $i,this._gl=t,this._location=r}set(){if(!$i.equalsArray(this.value,this._value,0)){$i.clone(this.value,this._value);let t=$i.toArray(this.value,zze);this._gl.uniformMatrix2fv(this._location,!1,t)}}},Vze=new Float32Array(9),aY=class{constructor(t,n,i,r){this.name=i,this.value=void 0,this._value=new $,this._gl=t,this._location=r}set(){if(!$.equalsArray(this.value,this._value,0)){$.clone(this.value,this._value);let t=$.toArray(this.value,Vze);this._gl.uniformMatrix3fv(this._location,!1,t)}}},jze=new Float32Array(16),cY=class{constructor(t,n,i,r){this.name=i,this.value=void 0,this._value=new M,this._gl=t,this._location=r}set(){if(!M.equalsArray(this.value,this._value,0)){M.clone(this.value,this._value);let t=M.toArray(this.value,jze);this._gl.uniformMatrix4fv(this._location,!1,t)}}},JN=Uze;function Hze(e,t,n,i){switch(t.type){case e.FLOAT:return new lY(e,t,n,i);case e.FLOAT_VEC2:return new uY(e,t,n,i);case e.FLOAT_VEC3:return new fY(e,t,n,i);case e.FLOAT_VEC4:return new dY(e,t,n,i);case e.SAMPLER_2D:case e.SAMPLER_3D:case e.SAMPLER_CUBE:return new hY(e,t,n,i);case e.INT:case e.BOOL:return new mY(e,t,n,i);case e.INT_VEC2:case e.BOOL_VEC2:return new pY(e,t,n,i);case e.INT_VEC3:case e.BOOL_VEC3:return new gY(e,t,n,i);case e.INT_VEC4:case e.BOOL_VEC4:return new _Y(e,t,n,i);case e.FLOAT_MAT2:return new yY(e,t,n,i);case e.FLOAT_MAT3:return new AY(e,t,n,i);case e.FLOAT_MAT4:return new bY(e,t,n,i);default:throw new oe(`Unrecognized uniform type: ${t.type} for uniform "${n}".`)}}var lY=class{constructor(t,n,i,r){let o=r.length;this.name=i,this.value=new Array(o),this._value=new Float32Array(o),this._gl=t,this._location=r[0]}set(){let t=this.value,n=t.length,i=this._value,r=!1;for(let o=0;o<n;++o){let s=t[o];s!==i[o]&&(i[o]=s,r=!0)}r&&this._gl.uniform1fv(this._location,i)}},uY=class{constructor(t,n,i,r){let o=r.length;this.name=i,this.value=new Array(o),this._value=new Float32Array(o*2),this._gl=t,this._location=r[0]}set(){let t=this.value,n=t.length,i=this._value,r=!1,o=0;for(let s=0;s<n;++s){let a=t[s];U.equalsArray(a,i,o)||(U.pack(a,i,o),r=!0),o+=2}r&&this._gl.uniform2fv(this._location,i)}},fY=class{constructor(t,n,i,r){let o=r.length;this.name=i,this.value=new Array(o),this._value=new Float32Array(o*3),this._gl=t,this._location=r[0]}set(){let t=this.value,n=t.length,i=this._value,r=!1,o=0;for(let s=0;s<n;++s){let a=t[s];l(a.red)?(a.red!==i[o]||a.green!==i[o+1]||a.blue!==i[o+2])&&(i[o]=a.red,i[o+1]=a.green,i[o+2]=a.blue,r=!0):l(a.x)&&(h.equalsArray(a,i,o)||(h.pack(a,i,o),r=!0)),o+=3}r&&this._gl.uniform3fv(this._location,i)}},dY=class{constructor(t,n,i,r){let o=r.length;this.name=i,this.value=new Array(o),this._value=new Float32Array(o*4),this._gl=t,this._location=r[0]}set(){let t=this.value,n=t.length,i=this._value,r=!1,o=0;for(let s=0;s<n;++s){let a=t[s];l(a.red)?z.equalsArray(a,i,o)||(z.pack(a,i,o),r=!0):l(a.x)&&(se.equalsArray(a,i,o)||(se.pack(a,i,o),r=!0)),o+=4}r&&this._gl.uniform4fv(this._location,i)}},hY=class{constructor(t,n,i,r){let o=r.length;this.name=i,this.value=new Array(o),this._value=new Float32Array(o),this._gl=t,this._locations=r,this.textureUnitIndex=void 0}set(){let t=this._gl,n=t.TEXTURE0+this.textureUnitIndex,i=this.value,r=i.length;for(let o=0;o<r;++o){let s=i[o];t.activeTexture(n+o),t.bindTexture(s._target,s._texture)}}_setSampler(t){this.textureUnitIndex=t;let n=this._locations,i=n.length;for(let r=0;r<i;++r){let o=t+r;this._gl.uniform1i(n[r],o)}return t+i}},mY=class{constructor(t,n,i,r){let o=r.length;this.name=i,this.value=new Array(o),this._value=new Int32Array(o),this._gl=t,this._location=r[0]}set(){let t=this.value,n=t.length,i=this._value,r=!1;for(let o=0;o<n;++o){let s=t[o];s!==i[o]&&(i[o]=s,r=!0)}r&&this._gl.uniform1iv(this._location,i)}},pY=class{constructor(t,n,i,r){let o=r.length;this.name=i,this.value=new Array(o),this._value=new Int32Array(o*2),this._gl=t,this._location=r[0]}set(){let t=this.value,n=t.length,i=this._value,r=!1,o=0;for(let s=0;s<n;++s){let a=t[s];U.equalsArray(a,i,o)||(U.pack(a,i,o),r=!0),o+=2}r&&this._gl.uniform2iv(this._location,i)}},gY=class{constructor(t,n,i,r){let o=r.length;this.name=i,this.value=new Array(o),this._value=new Int32Array(o*3),this._gl=t,this._location=r[0]}set(){let t=this.value,n=t.length,i=this._value,r=!1,o=0;for(let s=0;s<n;++s){let a=t[s];h.equalsArray(a,i,o)||(h.pack(a,i,o),r=!0),o+=3}r&&this._gl.uniform3iv(this._location,i)}},_Y=class{constructor(t,n,i,r){let o=r.length;this.name=i,this.value=new Array(o),this._value=new Int32Array(o*4),this._gl=t,this._location=r[0]}set(){let t=this.value,n=t.length,i=this._value,r=!1,o=0;for(let s=0;s<n;++s){let a=t[s];se.equalsArray(a,i,o)||(se.pack(a,i,o),r=!0),o+=4}r&&this._gl.uniform4iv(this._location,i)}},yY=class{constructor(t,n,i,r){let o=r.length;this.name=i,this.value=new Array(o),this._value=new Float32Array(o*4),this._gl=t,this._location=r[0]}set(){let t=this.value,n=t.length,i=this._value,r=!1,o=0;for(let s=0;s<n;++s){let a=t[s];$i.equalsArray(a,i,o)||($i.pack(a,i,o),r=!0),o+=4}r&&this._gl.uniformMatrix2fv(this._location,!1,i)}},AY=class{constructor(t,n,i,r){let o=r.length;this.name=i,this.value=new Array(o),this._value=new Float32Array(o*9),this._gl=t,this._location=r[0]}set(){let t=this.value,n=t.length,i=this._value,r=!1,o=0;for(let s=0;s<n;++s){let a=t[s];$.equalsArray(a,i,o)||($.pack(a,i,o),r=!0),o+=9}r&&this._gl.uniformMatrix3fv(this._location,!1,i)}},bY=class{constructor(t,n,i,r){let o=r.length;this.name=i,this.value=new Array(o),this._value=new Float32Array(o*16),this._gl=t,this._location=r[0]}set(){let t=this.value,n=t.length,i=this._value,r=!1,o=0;for(let s=0;s<n;++s){let a=t[s];M.equalsArray(a,i,o)||(M.pack(a,i,o),r=!0),o+=16}r&&this._gl.uniformMatrix4fv(this._location,!1,i)}},ZN=Hze;var Gze=0;function F0(e){let t=e.vertexShaderText,n=e.fragmentShaderText;typeof spector<"u"&&(t=t.replace(/^#line/gm,"//#line"),n=n.replace(/^#line/gm,"//#line"));let i=Wze(t,n);this._gl=e.gl,this._logShaderCompilation=e.logShaderCompilation,this._debugShaders=e.debugShaders,this._attributeLocations=e.attributeLocations,this._program=void 0,this._numberOfVertexAttributes=void 0,this._vertexAttributes=void 0,this._uniformsByName=void 0,this._uniforms=void 0,this._automaticUniforms=void 0,this._manualUniforms=void 0,this._duplicateUniformNames=i.duplicateUniformNames,this._cachedShader=void 0,this.maximumTextureUnitIndex=void 0,this._vertexShaderSource=e.vertexShaderSource,this._vertexShaderText=e.vertexShaderText,this._fragmentShaderSource=e.fragmentShaderSource,this._fragmentShaderText=i.fragmentShaderText,this.id=Gze++}F0.fromCache=function(e){return e=e??H.EMPTY_OBJECT,e.context.shaderCache.getShaderProgram(e)};F0.replaceCache=function(e){return e=e??H.EMPTY_OBJECT,e.context.shaderCache.replaceShaderProgram(e)};Object.defineProperties(F0.prototype,{vertexShaderSource:{get:function(){return this._vertexShaderSource}},fragmentShaderSource:{get:function(){return this._fragmentShaderSource}},vertexAttributes:{get:function(){return QN(this),this._vertexAttributes}},numberOfVertexAttributes:{get:function(){return QN(this),this._numberOfVertexAttributes}},allUniforms:{get:function(){return QN(this),this._uniformsByName}}});function wle(e){let t=[],n=e.match(/uniform.*?(?![^{]*})(?=[=\[;])/g);if(l(n)){let i=n.length;for(let r=0;r<i;r++){let o=n[r].trim(),s=o.slice(o.lastIndexOf(" ")+1);t.push(s)}}return t}function Wze(e,t){let n={};if(!Ut.highpFloatSupported||!Ut.highpIntSupported){let i,r,o,s,a=wle(e),c=wle(t),u=a.length,f=c.length;for(i=0;i<u;i++)for(r=0;r<f;r++)if(a[i]===c[r]){o=a[i],s=`czm_mediump_${o}`;let d=new RegExp(`${o}\\b`,"g");t=t.replace(d,s),n[s]=o}}return{fragmentShaderText:t,duplicateUniformNames:n}}var Gm="[Cesium WebGL] ";function qze(e,t){let n=t._vertexShaderText,i=t._fragmentShaderText,r=e.createShader(e.VERTEX_SHADER);e.shaderSource(r,n),e.compileShader(r);let o=e.createShader(e.FRAGMENT_SHADER);e.shaderSource(o,i),e.compileShader(o);let s=e.createProgram();e.attachShader(s,r),e.attachShader(s,o);let a=t._attributeLocations;if(l(a))for(let p in a)a.hasOwnProperty(p)&&e.bindAttribLocation(s,a[p],p);e.linkProgram(s);let c;if(e.getProgramParameter(s,e.LINK_STATUS))return t._logShaderCompilation&&(c=e.getShaderInfoLog(r),l(c)&&c.length>0&&console.log(`${Gm}Vertex shader compile log: ${c}`),c=e.getShaderInfoLog(o),l(c)&&c.length>0&&console.log(`${Gm}Fragment shader compile log: ${c}`),c=e.getProgramInfoLog(s),l(c)&&c.length>0&&console.log(`${Gm}Shader program link log: ${c}`)),e.deleteShader(r),e.deleteShader(o),s;let u,f=t._debugShaders;throw e.getShaderParameter(o,e.COMPILE_STATUS)?e.getShaderParameter(r,e.COMPILE_STATUS)?(c=e.getProgramInfoLog(s),console.error(`${Gm}Shader program link log: ${c}`),d(r,"vertex"),d(o,"fragment"),u=`Program failed to link. Link log: ${c}`):(c=e.getShaderInfoLog(r),console.error(`${Gm}Vertex shader compile log: ${c}`),console.error(`${Gm} Vertex shader source: ${n}`),u=`Vertex shader failed to compile. Compile log: ${c}`):(c=e.getShaderInfoLog(o),console.error(`${Gm}Fragment shader compile log: ${c}`),console.error(`${Gm} Fragment shader source: ${i}`),u=`Fragment shader failed to compile. Compile log: ${c}`),e.deleteShader(r),e.deleteShader(o),e.deleteProgram(s),new oe(u);function d(p,g){if(!l(f))return;let m=f.getTranslatedShaderSource(p);if(m===""){console.error(`${Gm}${g} shader translation failed.`);return}console.error(`${Gm}Translated ${g} shaderSource: -${m}`)}}function qze(e,t,n){let i={};for(let r=0;r<n;++r){let o=e.getActiveAttrib(t,r),s=e.getAttribLocation(t,o.name);i[o.name]={name:o.name,type:o.type,index:s}}return i}function Yze(e,t){let n={},i=[],r=[],o=e.getProgramParameter(t,e.ACTIVE_UNIFORMS);for(let s=0;s<o;++s){let a=e.getActiveUniform(t,s),c="[0]",u=a.name.indexOf(c,a.name.length-c.length)!==-1?a.name.slice(0,a.name.length-3):a.name;if(u.indexOf("gl_")!==0)if(a.name.indexOf("[")<0){let f=e.getUniformLocation(t,u);if(f!==null){let d=JN(e,a,u,f);n[u]=d,i.push(d),d._setSampler&&r.push(d)}}else{let f,d,p,g,m=u.indexOf("[");if(m>=0){if(f=n[u.slice(0,m)],!l(f))continue;d=f._locations,d.length<=1&&(p=f.value,g=e.getUniformLocation(t,u),g!==null&&(d.push(g),p.push(e.getUniform(t,g))))}else{d=[];for(let y=0;y<a.size;++y)g=e.getUniformLocation(t,`${u}[${y}]`),g!==null&&d.push(g);f=ZN(e,a,u,d),n[u]=f,i.push(f),f._setSampler&&r.push(f)}}}return{uniformsByName:n,uniforms:i,samplerUniforms:r}}function Xze(e,t){let n=[],i=[];for(let r in t)if(t.hasOwnProperty(r)){let o=t[r],s=r,a=e._duplicateUniformNames[s];l(a)&&(o.name=a,s=a);let c=T_[s];l(c)?n.push({uniform:o,automaticUniform:c}):i.push(o)}return{automaticUniforms:n,manualUniforms:i}}function Kze(e,t,n){e.useProgram(t);let i=0,r=n.length;for(let o=0;o<r;++o)i=n[o]._setSampler(i);return e.useProgram(null),i}function QN(e){l(e._program)||Ile(e)}function Ile(e){let t=e._program,n=e._gl,i=Wze(n,e,e._debugShaders),r=n.getProgramParameter(i,n.ACTIVE_ATTRIBUTES),o=Yze(n,i),s=Xze(e,o.uniformsByName);e._program=i,e._numberOfVertexAttributes=r,e._vertexAttributes=qze(n,i,r),e._uniformsByName=o.uniformsByName,e._uniforms=o.uniforms,e._automaticUniforms=s.automaticUniforms,e._manualUniforms=s.manualUniforms,e.maximumTextureUnitIndex=Kze(n,i,o.samplerUniforms),t&&e._gl.deleteProgram(t),typeof spector<"u"&&(e._program.__SPECTOR_rebuildProgram=function(a,c,u,f){let d=e._vertexShaderText,p=e._fragmentShaderText,g=/ ! = /g;e._vertexShaderText=a.replace(g," != "),e._fragmentShaderText=c.replace(g," != ");try{Ile(e),u(e._program)}catch(m){e._vertexShaderText=d,e._fragmentShaderText=p;let A=/(?:Compile|Link) error: ([^]*)/.exec(m.message);f(A?A[1]:m.message)}})}F0.prototype._bind=function(){QN(this),this._gl.useProgram(this._program)};F0.prototype._setUniforms=function(e,t,n){let i,r;if(l(e)){let a=this._manualUniforms;for(i=a.length,r=0;r<i;++r){let c=a[r];c.value=e[c.name]()}}let o=this._automaticUniforms;for(i=o.length,r=0;r<i;++r){let a=o[r];a.uniform.value=a.automaticUniform.getValue(t)}let s=this._uniforms;for(i=s.length,r=0;r<i;++r)s[r].set();if(n){let a=this._gl,c=this._program;a.validateProgram(c)}};F0.prototype.isDestroyed=function(){return!1};F0.prototype.destroy=function(){this._cachedShader.cache.releaseShaderProgram(this)};F0.prototype.finalDestroy=function(){return this._gl.deleteProgram(this._program),le(this)};var Qt=F0;function eL(e){this._context=e}var YI,$ze=new at({primitiveType:Oe.TRIANGLES}),Jze=new fi({color:new z(0,0,0,0)});function Zze(e,t){return new vs({context:e,colorTextures:[t],destroyAttachments:!1})}function Qze(e,t){return Qt.fromCache({context:e,vertexShaderSource:LE,fragmentShaderSource:t,attributeLocations:{position:0,textureCoordinates:1}})}function eVe(e,t){return(!l(YI)||YI.viewport.width!==e||YI.viewport.height!==t)&&(YI=Ge.fromCache({viewport:new et(0,0,e,t)})),YI}eL.prototype.execute=function(e){l(e.preExecute)&&e.preExecute(e);let t=e.outputTexture,n=t.width,i=t.height,r=this._context,o=l(e.vertexArray)?e.vertexArray:r.getViewportQuadVertexArray(),s=l(e.shaderProgram)?e.shaderProgram:Qze(r,e.fragmentShaderSource),a=Zze(r,t),c=eVe(n,i),u=e.uniformMap,f=Jze;f.framebuffer=a,f.renderState=c,f.execute(r);let d=$ze;d.vertexArray=o,d.renderState=c,d.shaderProgram=s,d.uniformMap=u,d.framebuffer=a,d.execute(r),a.destroy(),e.persists||(s.destroy(),l(e.vertexArray)&&o.destroy()),l(e.postExecute)&&e.postExecute(t)};eL.prototype.isDestroyed=function(){return!1};eL.prototype.destroy=function(){return le(this)};var tL=eL;var yn={BYTE:te.BYTE,UNSIGNED_BYTE:te.UNSIGNED_BYTE,SHORT:te.SHORT,UNSIGNED_SHORT:te.UNSIGNED_SHORT,INT:te.INT,UNSIGNED_INT:te.UNSIGNED_INT,FLOAT:te.FLOAT,DOUBLE:te.DOUBLE};yn.getSizeInBytes=function(e){switch(e){case yn.BYTE:return Int8Array.BYTES_PER_ELEMENT;case yn.UNSIGNED_BYTE:return Uint8Array.BYTES_PER_ELEMENT;case yn.SHORT:return Int16Array.BYTES_PER_ELEMENT;case yn.UNSIGNED_SHORT:return Uint16Array.BYTES_PER_ELEMENT;case yn.INT:return Int32Array.BYTES_PER_ELEMENT;case yn.UNSIGNED_INT:return Uint32Array.BYTES_PER_ELEMENT;case yn.FLOAT:return Float32Array.BYTES_PER_ELEMENT;case yn.DOUBLE:return Float64Array.BYTES_PER_ELEMENT}};yn.fromTypedArray=function(e){if(e instanceof Int8Array)return yn.BYTE;if(e instanceof Uint8Array)return yn.UNSIGNED_BYTE;if(e instanceof Int16Array)return yn.SHORT;if(e instanceof Uint16Array)return yn.UNSIGNED_SHORT;if(e instanceof Int32Array)return yn.INT;if(e instanceof Uint32Array)return yn.UNSIGNED_INT;if(e instanceof Float32Array)return yn.FLOAT;if(e instanceof Float64Array)return yn.DOUBLE};yn.validate=function(e){return l(e)&&(e===yn.BYTE||e===yn.UNSIGNED_BYTE||e===yn.SHORT||e===yn.UNSIGNED_SHORT||e===yn.INT||e===yn.UNSIGNED_INT||e===yn.FLOAT||e===yn.DOUBLE)};yn.createTypedArray=function(e,t){switch(e){case yn.BYTE:return new Int8Array(t);case yn.UNSIGNED_BYTE:return new Uint8Array(t);case yn.SHORT:return new Int16Array(t);case yn.UNSIGNED_SHORT:return new Uint16Array(t);case yn.INT:return new Int32Array(t);case yn.UNSIGNED_INT:return new Uint32Array(t);case yn.FLOAT:return new Float32Array(t);case yn.DOUBLE:return new Float64Array(t)}};yn.createArrayBufferView=function(e,t,n,i){switch(n=n??0,i=i??(t.byteLength-n)/yn.getSizeInBytes(e),e){case yn.BYTE:return new Int8Array(t,n,i);case yn.UNSIGNED_BYTE:return new Uint8Array(t,n,i);case yn.SHORT:return new Int16Array(t,n,i);case yn.UNSIGNED_SHORT:return new Uint16Array(t,n,i);case yn.INT:return new Int32Array(t,n,i);case yn.UNSIGNED_INT:return new Uint32Array(t,n,i);case yn.FLOAT:return new Float32Array(t,n,i);case yn.DOUBLE:return new Float64Array(t,n,i)}};yn.fromName=function(e){switch(e){case"BYTE":return yn.BYTE;case"UNSIGNED_BYTE":return yn.UNSIGNED_BYTE;case"SHORT":return yn.SHORT;case"UNSIGNED_SHORT":return yn.UNSIGNED_SHORT;case"INT":return yn.INT;case"UNSIGNED_INT":return yn.UNSIGNED_INT;case"FLOAT":return yn.FLOAT;case"DOUBLE":return yn.DOUBLE}};yn.dequantize=function(e,t){switch(t){case yn.BYTE:return Math.max(e/127,-1);case yn.UNSIGNED_BYTE:return e/255;case yn.SHORT:return Math.max(e/32767,-1);case yn.UNSIGNED_SHORT:return e/65535;case yn.INT:return Math.max(e/2147483647,-1);case yn.UNSIGNED_INT:return e/4294967295}};Object.freeze(yn);var Y=yn;var Ple={NONE:0,TRIANGLES:1,LINES:2,POLYLINES:3};Object.freeze(Ple);var mh=Ple;function xY(e){e=e??H.EMPTY_OBJECT,this.attributes=e.attributes,this.indices=e.indices,this.primitiveType=e.primitiveType??Oe.TRIANGLES,this.boundingSphere=e.boundingSphere,this.geometryType=e.geometryType??mh.NONE,this.boundingSphereCV=e.boundingSphereCV,this.offsetAttribute=e.offsetAttribute}xY.computeNumberOfVertices=function(e){let t=-1;for(let n in e.attributes)if(e.attributes.hasOwnProperty(n)&&l(e.attributes[n])&&l(e.attributes[n].values)){let i=e.attributes[n];t=i.values.length/i.componentsPerAttribute}return t};var tVe=new he,nVe=new h,Dle=new M,iVe=[new he,new he,new he],rVe=[new U,new U,new U],oVe=[new U,new U,new U],sVe=new h,aVe=new Le,cVe=new M,lVe=new $i;xY._textureCoordinateRotationPoints=function(e,t,n,i){let r,o=ie.center(i,tVe),s=he.toCartesian(o,n,nVe),a=At.eastNorthUpToFixedFrame(s,n,Dle),c=M.inverse(a,Dle),u=rVe,f=iVe;f[0].longitude=i.west,f[0].latitude=i.south,f[1].longitude=i.west,f[1].latitude=i.north,f[2].longitude=i.east,f[2].latitude=i.south;let d=sVe;for(r=0;r<3;r++)he.toCartesian(f[r],n,d),d=M.multiplyByPointAsVector(c,d,d),u[r].x=d.x,u[r].y=d.y;let p=Le.fromAxisAngle(h.UNIT_Z,-t,aVe),g=$.fromQuaternion(p,cVe),m=e.length,y=Number.POSITIVE_INFINITY,A=Number.POSITIVE_INFINITY,b=Number.NEGATIVE_INFINITY,x=Number.NEGATIVE_INFINITY;for(r=0;r<m;r++)d=M.multiplyByPointAsVector(c,e[r],d),d=$.multiplyByVector(g,d,d),y=Math.min(y,d.x),A=Math.min(A,d.y),b=Math.max(b,d.x),x=Math.max(x,d.y);let T=$i.fromRotation(t,lVe),E=oVe;E[0].x=y,E[0].y=A,E[1].x=y,E[1].y=x,E[2].x=b,E[2].y=A;let v=u[0],S=u[2].x-v.x,I=u[1].y-v.y;for(r=0;r<3;r++){let C=E[r];$i.multiplyByVector(T,C,C),C.x=(C.x-v.x)/S,C.y=(C.y-v.y)/I}let R=E[0],O=E[1],L=E[2],_=new Array(6);return U.pack(R,_),U.pack(O,_,2),U.pack(L,_,4),_};var wt=xY;function uVe(e){e=e??H.EMPTY_OBJECT,this.componentDatatype=e.componentDatatype,this.componentsPerAttribute=e.componentsPerAttribute,this.normalize=e.normalize??!1,this.values=e.values}var Ne=uVe;function FE(e,t,n,i,r){this._format=e,this._datatype=t,this._width=n,this._height=i,this._buffer=r}Object.defineProperties(FE.prototype,{internalFormat:{get:function(){return this._format}},pixelDatatype:{get:function(){return this._datatype}},width:{get:function(){return this._width}},height:{get:function(){return this._height}},bufferView:{get:function(){return this._buffer}},arrayBufferView:{get:function(){return this._buffer}}});FE.clone=function(e){if(l(e))return new FE(e._format,e._datatype,e._width,e._height,e._buffer)};FE.prototype.clone=function(){return FE.clone(this)};var nL=FE;var Rle=js(ef(),1);function Ole(){if(!l(qa._canTransferArrayBuffer)){let e=CY("transferTypedArrayTest");e.postMessage=e.webkitPostMessage??e.postMessage;let t=99,n=new Int8Array([t]);try{e.postMessage({array:n},[n.buffer])}catch{return qa._canTransferArrayBuffer=!1,qa._canTransferArrayBuffer}qa._canTransferArrayBuffer=new Promise(i=>{e.onmessage=function(r){let o=r.data.array,s=l(o)&&o[0]===t;i(s),e.terminate(),qa._canTransferArrayBuffer=s}})}return qa._canTransferArrayBuffer}var EY=new be;function TY(e){let t;try{t=new Blob([e],{type:"application/javascript"})}catch{let r=window.BlobBuilder||window.WebKitBlobBuilder||window.MozBlobBuilder||window.MSBlobBuilder,o=new r;o.append(e),t=o.getBlob("application/javascript")}return(window.URL||window.webkitURL).createObjectURL(t)}function CY(e){let t=new Rle.default(e),n=t.scheme().length!==0&&t.fragment().length===0,i=e.replace(/\.js$/,""),r={},o,s;if(_b(e))s=e;else if(!n){let a=Zt(`${qa._workerModulePrefix}/${i}.js`);_b(a)&&(s=a)}if(s){let a=`import "${s}";`;return o=TY(a),r.type="module",new Worker(o,r)}if(!n&&typeof CESIUM_WORKERS<"u"){let a=` +${m}`)}}function Yze(e,t,n){let i={};for(let r=0;r<n;++r){let o=e.getActiveAttrib(t,r),s=e.getAttribLocation(t,o.name);i[o.name]={name:o.name,type:o.type,index:s}}return i}function Xze(e,t){let n={},i=[],r=[],o=e.getProgramParameter(t,e.ACTIVE_UNIFORMS);for(let s=0;s<o;++s){let a=e.getActiveUniform(t,s),c="[0]",u=a.name.indexOf(c,a.name.length-c.length)!==-1?a.name.slice(0,a.name.length-3):a.name;if(u.indexOf("gl_")!==0)if(a.name.indexOf("[")<0){let f=e.getUniformLocation(t,u);if(f!==null){let d=JN(e,a,u,f);n[u]=d,i.push(d),d._setSampler&&r.push(d)}}else{let f,d,p,g,m=u.indexOf("[");if(m>=0){if(f=n[u.slice(0,m)],!l(f))continue;d=f._locations,d.length<=1&&(p=f.value,g=e.getUniformLocation(t,u),g!==null&&(d.push(g),p.push(e.getUniform(t,g))))}else{d=[];for(let y=0;y<a.size;++y)g=e.getUniformLocation(t,`${u}[${y}]`),g!==null&&d.push(g);f=ZN(e,a,u,d),n[u]=f,i.push(f),f._setSampler&&r.push(f)}}}return{uniformsByName:n,uniforms:i,samplerUniforms:r}}function Kze(e,t){let n=[],i=[];for(let r in t)if(t.hasOwnProperty(r)){let o=t[r],s=r,a=e._duplicateUniformNames[s];l(a)&&(o.name=a,s=a);let c=T_[s];l(c)?n.push({uniform:o,automaticUniform:c}):i.push(o)}return{automaticUniforms:n,manualUniforms:i}}function $ze(e,t,n){e.useProgram(t);let i=0,r=n.length;for(let o=0;o<r;++o)i=n[o]._setSampler(i);return e.useProgram(null),i}function QN(e){l(e._program)||Ile(e)}function Ile(e){let t=e._program,n=e._gl,i=qze(n,e,e._debugShaders),r=n.getProgramParameter(i,n.ACTIVE_ATTRIBUTES),o=Xze(n,i),s=Kze(e,o.uniformsByName);e._program=i,e._numberOfVertexAttributes=r,e._vertexAttributes=Yze(n,i,r),e._uniformsByName=o.uniformsByName,e._uniforms=o.uniforms,e._automaticUniforms=s.automaticUniforms,e._manualUniforms=s.manualUniforms,e.maximumTextureUnitIndex=$ze(n,i,o.samplerUniforms),t&&e._gl.deleteProgram(t),typeof spector<"u"&&(e._program.__SPECTOR_rebuildProgram=function(a,c,u,f){let d=e._vertexShaderText,p=e._fragmentShaderText,g=/ ! = /g;e._vertexShaderText=a.replace(g," != "),e._fragmentShaderText=c.replace(g," != ");try{Ile(e),u(e._program)}catch(m){e._vertexShaderText=d,e._fragmentShaderText=p;let A=/(?:Compile|Link) error: ([^]*)/.exec(m.message);f(A?A[1]:m.message)}})}F0.prototype._bind=function(){QN(this),this._gl.useProgram(this._program)};F0.prototype._setUniforms=function(e,t,n){let i,r;if(l(e)){let a=this._manualUniforms;for(i=a.length,r=0;r<i;++r){let c=a[r];c.value=e[c.name]()}}let o=this._automaticUniforms;for(i=o.length,r=0;r<i;++r){let a=o[r];a.uniform.value=a.automaticUniform.getValue(t)}let s=this._uniforms;for(i=s.length,r=0;r<i;++r)s[r].set();if(n){let a=this._gl,c=this._program;a.validateProgram(c)}};F0.prototype.isDestroyed=function(){return!1};F0.prototype.destroy=function(){this._cachedShader.cache.releaseShaderProgram(this)};F0.prototype.finalDestroy=function(){return this._gl.deleteProgram(this._program),le(this)};var Qt=F0;function eL(e){this._context=e}var YI,Jze=new at({primitiveType:Oe.TRIANGLES}),Zze=new fi({color:new z(0,0,0,0)});function Qze(e,t){return new vs({context:e,colorTextures:[t],destroyAttachments:!1})}function eVe(e,t){return Qt.fromCache({context:e,vertexShaderSource:LE,fragmentShaderSource:t,attributeLocations:{position:0,textureCoordinates:1}})}function tVe(e,t){return(!l(YI)||YI.viewport.width!==e||YI.viewport.height!==t)&&(YI=Ge.fromCache({viewport:new et(0,0,e,t)})),YI}eL.prototype.execute=function(e){l(e.preExecute)&&e.preExecute(e);let t=e.outputTexture,n=t.width,i=t.height,r=this._context,o=l(e.vertexArray)?e.vertexArray:r.getViewportQuadVertexArray(),s=l(e.shaderProgram)?e.shaderProgram:eVe(r,e.fragmentShaderSource),a=Qze(r,t),c=tVe(n,i),u=e.uniformMap,f=Zze;f.framebuffer=a,f.renderState=c,f.execute(r);let d=Jze;d.vertexArray=o,d.renderState=c,d.shaderProgram=s,d.uniformMap=u,d.framebuffer=a,d.execute(r),a.destroy(),e.persists||(s.destroy(),l(e.vertexArray)&&o.destroy()),l(e.postExecute)&&e.postExecute(t)};eL.prototype.isDestroyed=function(){return!1};eL.prototype.destroy=function(){return le(this)};var tL=eL;var yn={BYTE:te.BYTE,UNSIGNED_BYTE:te.UNSIGNED_BYTE,SHORT:te.SHORT,UNSIGNED_SHORT:te.UNSIGNED_SHORT,INT:te.INT,UNSIGNED_INT:te.UNSIGNED_INT,FLOAT:te.FLOAT,DOUBLE:te.DOUBLE};yn.getSizeInBytes=function(e){switch(e){case yn.BYTE:return Int8Array.BYTES_PER_ELEMENT;case yn.UNSIGNED_BYTE:return Uint8Array.BYTES_PER_ELEMENT;case yn.SHORT:return Int16Array.BYTES_PER_ELEMENT;case yn.UNSIGNED_SHORT:return Uint16Array.BYTES_PER_ELEMENT;case yn.INT:return Int32Array.BYTES_PER_ELEMENT;case yn.UNSIGNED_INT:return Uint32Array.BYTES_PER_ELEMENT;case yn.FLOAT:return Float32Array.BYTES_PER_ELEMENT;case yn.DOUBLE:return Float64Array.BYTES_PER_ELEMENT}};yn.fromTypedArray=function(e){if(e instanceof Int8Array)return yn.BYTE;if(e instanceof Uint8Array)return yn.UNSIGNED_BYTE;if(e instanceof Int16Array)return yn.SHORT;if(e instanceof Uint16Array)return yn.UNSIGNED_SHORT;if(e instanceof Int32Array)return yn.INT;if(e instanceof Uint32Array)return yn.UNSIGNED_INT;if(e instanceof Float32Array)return yn.FLOAT;if(e instanceof Float64Array)return yn.DOUBLE};yn.validate=function(e){return l(e)&&(e===yn.BYTE||e===yn.UNSIGNED_BYTE||e===yn.SHORT||e===yn.UNSIGNED_SHORT||e===yn.INT||e===yn.UNSIGNED_INT||e===yn.FLOAT||e===yn.DOUBLE)};yn.createTypedArray=function(e,t){switch(e){case yn.BYTE:return new Int8Array(t);case yn.UNSIGNED_BYTE:return new Uint8Array(t);case yn.SHORT:return new Int16Array(t);case yn.UNSIGNED_SHORT:return new Uint16Array(t);case yn.INT:return new Int32Array(t);case yn.UNSIGNED_INT:return new Uint32Array(t);case yn.FLOAT:return new Float32Array(t);case yn.DOUBLE:return new Float64Array(t)}};yn.createArrayBufferView=function(e,t,n,i){switch(n=n??0,i=i??(t.byteLength-n)/yn.getSizeInBytes(e),e){case yn.BYTE:return new Int8Array(t,n,i);case yn.UNSIGNED_BYTE:return new Uint8Array(t,n,i);case yn.SHORT:return new Int16Array(t,n,i);case yn.UNSIGNED_SHORT:return new Uint16Array(t,n,i);case yn.INT:return new Int32Array(t,n,i);case yn.UNSIGNED_INT:return new Uint32Array(t,n,i);case yn.FLOAT:return new Float32Array(t,n,i);case yn.DOUBLE:return new Float64Array(t,n,i)}};yn.fromName=function(e){switch(e){case"BYTE":return yn.BYTE;case"UNSIGNED_BYTE":return yn.UNSIGNED_BYTE;case"SHORT":return yn.SHORT;case"UNSIGNED_SHORT":return yn.UNSIGNED_SHORT;case"INT":return yn.INT;case"UNSIGNED_INT":return yn.UNSIGNED_INT;case"FLOAT":return yn.FLOAT;case"DOUBLE":return yn.DOUBLE}};yn.dequantize=function(e,t){switch(t){case yn.BYTE:return Math.max(e/127,-1);case yn.UNSIGNED_BYTE:return e/255;case yn.SHORT:return Math.max(e/32767,-1);case yn.UNSIGNED_SHORT:return e/65535;case yn.INT:return Math.max(e/2147483647,-1);case yn.UNSIGNED_INT:return e/4294967295}};Object.freeze(yn);var Y=yn;var Ple={NONE:0,TRIANGLES:1,LINES:2,POLYLINES:3};Object.freeze(Ple);var mh=Ple;function xY(e){e=e??H.EMPTY_OBJECT,this.attributes=e.attributes,this.indices=e.indices,this.primitiveType=e.primitiveType??Oe.TRIANGLES,this.boundingSphere=e.boundingSphere,this.geometryType=e.geometryType??mh.NONE,this.boundingSphereCV=e.boundingSphereCV,this.offsetAttribute=e.offsetAttribute}xY.computeNumberOfVertices=function(e){let t=-1;for(let n in e.attributes)if(e.attributes.hasOwnProperty(n)&&l(e.attributes[n])&&l(e.attributes[n].values)){let i=e.attributes[n];t=i.values.length/i.componentsPerAttribute}return t};var nVe=new he,iVe=new h,Dle=new M,rVe=[new he,new he,new he],oVe=[new U,new U,new U],sVe=[new U,new U,new U],aVe=new h,cVe=new Le,lVe=new M,uVe=new $i;xY._textureCoordinateRotationPoints=function(e,t,n,i){let r,o=ie.center(i,nVe),s=he.toCartesian(o,n,iVe),a=At.eastNorthUpToFixedFrame(s,n,Dle),c=M.inverse(a,Dle),u=oVe,f=rVe;f[0].longitude=i.west,f[0].latitude=i.south,f[1].longitude=i.west,f[1].latitude=i.north,f[2].longitude=i.east,f[2].latitude=i.south;let d=aVe;for(r=0;r<3;r++)he.toCartesian(f[r],n,d),d=M.multiplyByPointAsVector(c,d,d),u[r].x=d.x,u[r].y=d.y;let p=Le.fromAxisAngle(h.UNIT_Z,-t,cVe),g=$.fromQuaternion(p,lVe),m=e.length,y=Number.POSITIVE_INFINITY,A=Number.POSITIVE_INFINITY,b=Number.NEGATIVE_INFINITY,x=Number.NEGATIVE_INFINITY;for(r=0;r<m;r++)d=M.multiplyByPointAsVector(c,e[r],d),d=$.multiplyByVector(g,d,d),y=Math.min(y,d.x),A=Math.min(A,d.y),b=Math.max(b,d.x),x=Math.max(x,d.y);let T=$i.fromRotation(t,uVe),E=sVe;E[0].x=y,E[0].y=A,E[1].x=y,E[1].y=x,E[2].x=b,E[2].y=A;let v=u[0],S=u[2].x-v.x,I=u[1].y-v.y;for(r=0;r<3;r++){let C=E[r];$i.multiplyByVector(T,C,C),C.x=(C.x-v.x)/S,C.y=(C.y-v.y)/I}let R=E[0],O=E[1],L=E[2],_=new Array(6);return U.pack(R,_),U.pack(O,_,2),U.pack(L,_,4),_};var wt=xY;function fVe(e){e=e??H.EMPTY_OBJECT,this.componentDatatype=e.componentDatatype,this.componentsPerAttribute=e.componentsPerAttribute,this.normalize=e.normalize??!1,this.values=e.values}var Ne=fVe;function FE(e,t,n,i,r){this._format=e,this._datatype=t,this._width=n,this._height=i,this._buffer=r}Object.defineProperties(FE.prototype,{internalFormat:{get:function(){return this._format}},pixelDatatype:{get:function(){return this._datatype}},width:{get:function(){return this._width}},height:{get:function(){return this._height}},bufferView:{get:function(){return this._buffer}},arrayBufferView:{get:function(){return this._buffer}}});FE.clone=function(e){if(l(e))return new FE(e._format,e._datatype,e._width,e._height,e._buffer)};FE.prototype.clone=function(){return FE.clone(this)};var nL=FE;var Rle=js(ef(),1);function Ole(){if(!l(qa._canTransferArrayBuffer)){let e=CY("transferTypedArrayTest");e.postMessage=e.webkitPostMessage??e.postMessage;let t=99,n=new Int8Array([t]);try{e.postMessage({array:n},[n.buffer])}catch{return qa._canTransferArrayBuffer=!1,qa._canTransferArrayBuffer}qa._canTransferArrayBuffer=new Promise(i=>{e.onmessage=function(r){let o=r.data.array,s=l(o)&&o[0]===t;i(s),e.terminate(),qa._canTransferArrayBuffer=s}})}return qa._canTransferArrayBuffer}var EY=new be;function TY(e){let t;try{t=new Blob([e],{type:"application/javascript"})}catch{let r=window.BlobBuilder||window.WebKitBlobBuilder||window.MozBlobBuilder||window.MSBlobBuilder,o=new r;o.append(e),t=o.getBlob("application/javascript")}return(window.URL||window.webkitURL).createObjectURL(t)}function CY(e){let t=new Rle.default(e),n=t.scheme().length!==0&&t.fragment().length===0,i=e.replace(/\.js$/,""),r={},o,s;if(_b(e))s=e;else if(!n){let a=Zt(`${qa._workerModulePrefix}/${i}.js`);_b(a)&&(s=a)}if(s){let a=`import "${s}";`;return o=TY(a),r.type="module",new Worker(o,r)}if(!n&&typeof CESIUM_WORKERS<"u"){let a=` importScripts("${TY(CESIUM_WORKERS)}"); CesiumWorkers["${i}"](); - `;return o=TY(a),new Worker(o,r)}if(o=e,n||(o=Zt(`${qa._workerModulePrefix+i}.js`)),!dn.supportsEsmWebWorkers())throw new oe("This browser is not supported. Please update your browser to continue.");return r.type="module",new Worker(o,r)}async function fVe(e,t){let n={modulePath:void 0,wasmBinaryFile:void 0,wasmBinary:void 0};if(!dn.supportsWebAssembly()){if(!l(t.fallbackModulePath))throw new oe(`This browser does not support Web Assembly, and no backup module was provided for ${e._workerPath}`);return n.modulePath=Zt(t.fallbackModulePath),n}n.wasmBinaryFile=Zt(t.wasmBinaryFile);let i=await De.fetchArrayBuffer({url:n.wasmBinaryFile});return n.wasmBinary=i,n}function qa(e,t){this._workerPath=e,this._maximumActiveTasks=t??Number.POSITIVE_INFINITY,this._activeTasks=0,this._nextID=0,this._webAssemblyPromise=void 0}var dVe=(e,t,n,i)=>{let r=({data:o})=>{if(o.id===t){if(l(o.error)){let s=o.error;s.name==="RuntimeError"?(s=new oe(o.error.message),s.stack=o.error.stack):s.name==="DeveloperError"?(s=new pe(o.error.message),s.stack=o.error.stack):s.name==="Error"&&(s=new Error(o.error.message),s.stack=o.error.stack),EY.raiseEvent(s),i(s)}else EY.raiseEvent(),n(o.result);e.removeEventListener("message",r)}};return r},hVe=[];async function mVe(e,t,n){let i=await Promise.resolve(Ole());l(n)?i||(n.length=0):n=hVe;let r=e._nextID++,o=new Promise((s,a)=>{e._worker.addEventListener("message",dVe(e._worker,r,s,a))});return e._worker.postMessage({id:r,baseUrl:Zt.getCesiumBaseUrl().url,parameters:t,canTransferArrayBuffer:i},n),o}async function pVe(e,t,n){++e._activeTasks;try{let i=await mVe(e,t,n);return--e._activeTasks,i}catch(i){throw--e._activeTasks,i}}qa.prototype.scheduleTask=function(e,t){if(l(this._worker)||(this._worker=CY(this._workerPath)),!(this._activeTasks>=this._maximumActiveTasks))return pVe(this,e,t)};qa.prototype.initWebAssemblyModule=async function(e){if(l(this._webAssemblyPromise))return this._webAssemblyPromise;let t=async()=>{let n=this._worker=CY(this._workerPath),i=await fVe(this,e),r=await Promise.resolve(Ole()),o,s=i.wasmBinary;l(s)&&r&&(o=[s]);let a=new Promise((c,u)=>{n.onmessage=function({data:f}){l(f)?c(f.result):u(new oe("Could not configure wasm module"))}});return n.postMessage({canTransferArrayBuffer:r,parameters:{webAssemblyConfig:i}},o),a};return this._webAssemblyPromise=t(),this._webAssemblyPromise};qa.prototype.isDestroyed=function(){return!1};qa.prototype.destroy=function(){return l(this._worker)&&this._worker.terminate(),le(this)};qa.taskCompletedEvent=EY;qa._defaultWorkerModulePrefix="Workers/";qa._workerModulePrefix=qa._defaultWorkerModulePrefix;qa._canTransferArrayBuffer=void 0;var $n=qa;function B0(){}B0._transcodeTaskProcessor=new $n("transcodeKTX2",Number.POSITIVE_INFINITY);B0._readyPromise=void 0;function gVe(){let e=B0._transcodeTaskProcessor.initWebAssemblyModule({wasmBinaryFile:"ThirdParty/basis_transcoder.wasm"}).then(function(t){if(t)return B0._transcodeTaskProcessor;throw new oe("KTX2 transcoder could not be initialized.")});B0._readyPromise=e}B0.transcode=function(e,t){return l(B0._readyPromise)||gVe(),B0._readyPromise.then(function(n){let i=e;e instanceof ArrayBuffer&&(i=new Uint8Array(e));let r={supportedTargetFormats:t,ktx2Buffer:i};return n.scheduleTask(r,[i.buffer])}).then(function(n){let i=n.length,r=Object.keys(n[0]);for(let o=0;o<i;o++){let s=n[o];for(let a=0;a<r.length;a++){let c=s[r[a]];s[r[a]]=new nL(c.internalFormat,c.datatype,c.width,c.height,c.levelBuffer)}}if(r.length===1){for(let o=0;o<i;++o)n[o]=n[o][r[0]];i===1&&(n=n[0])}return n}).catch(function(n){throw n})};var iL=B0;var Mle;Nle.setKTX2SupportedFormats=function(e,t,n,i,r,o){Mle={s3tc:e,pvrtc:t,astc:n,etc:i,etc1:r,bc7:o}};function Nle(e){let t;return e instanceof ArrayBuffer||ArrayBuffer.isView(e)?t=Promise.resolve(e):t=De.createIfNeeded(e).fetchArrayBuffer(),t.then(function(n){return iL.transcode(n,Mle)})}var nf=Nle;function _Ve(e,t){this.start=e??0,this.stop=t??0}var Gs=_Ve;var rL=class e{constructor(t,n){this.center=h.clone(t??h.ZERO),this.radius=n??0}static fromPoints(t,n){if(l(n)||(n=new e),!l(t)||t.length===0)return n.center=h.clone(h.ZERO,n.center),n.radius=0,n;let i=h.clone(t[0],RY),r=h.clone(i,vY),o=h.clone(i,SY),s=h.clone(i,wY),a=h.clone(i,IY),c=h.clone(i,PY),u=h.clone(i,DY),f=t.length,d;for(d=1;d<f;d++){h.clone(t[d],i);let O=i.x,L=i.y,_=i.z;O<r.x&&h.clone(i,r),O>a.x&&h.clone(i,a),L<o.y&&h.clone(i,o),L>c.y&&h.clone(i,c),_<s.z&&h.clone(i,s),_>u.z&&h.clone(i,u)}let p=h.magnitudeSquared(h.subtract(a,r,Ya)),g=h.magnitudeSquared(h.subtract(c,o,Ya)),m=h.magnitudeSquared(h.subtract(u,s,Ya)),y=r,A=a,b=p;g>b&&(b=g,y=o,A=c),m>b&&(y=s,A=u);let x=OY;x.x=(y.x+A.x)*.5,x.y=(y.y+A.y)*.5,x.z=(y.z+A.z)*.5;let T=h.magnitudeSquared(h.subtract(A,x,Ya)),E=Math.sqrt(T),v=MY;v.x=r.x,v.y=o.y,v.z=s.z;let S=NY;S.x=a.x,S.y=c.y,S.z=u.z;let I=h.midpoint(v,S,LY),R=0;for(d=0;d<f;d++){h.clone(t[d],i);let O=h.magnitude(h.subtract(i,I,Ya));O>R&&(R=O);let L=h.magnitudeSquared(h.subtract(i,x,Ya));if(L>T){let _=Math.sqrt(L);E=(E+_)*.5,T=E*E;let C=_-E;x.x=(E*x.x+C*i.x)/_,x.y=(E*x.y+C*i.y)/_,x.z=(E*x.z+C*i.z)/_}}return E<R?(h.clone(x,n.center),n.radius=E):(h.clone(I,n.center),n.radius=R),n}static fromRectangle2D(t,n,i){return e.fromRectangleWithHeights2D(t,n,0,0,i)}static fromRectangleWithHeights2D(t,n,i,r,o){if(l(o)||(o=new e),!l(t))return o.center=h.clone(h.ZERO,o.center),o.radius=0,o;Lle._ellipsoid=ee.default,n=n??Lle,ie.southwest(t,FY),FY.height=i,ie.northeast(t,BY),BY.height=r;let s=n.project(FY,AVe),a=n.project(BY,bVe),c=a.x-s.x,u=a.y-s.y,f=a.z-s.z;o.radius=Math.sqrt(c*c+u*u+f*f)*.5;let d=o.center;return d.x=s.x+c*.5,d.y=s.y+u*.5,d.z=s.z+f*.5,o}static fromRectangle3D(t,n,i,r){if(n=n??ee.default,i=i??0,l(r)||(r=new e),!l(t))return r.center=h.clone(h.ZERO,r.center),r.radius=0,r;let o=ie.subsample(t,n,i,xVe);return e.fromPoints(o,r)}static fromVertices(t,n,i,r){if(l(r)||(r=new e),!l(t)||t.length===0)return r.center=h.clone(h.ZERO,r.center),r.radius=0,r;n=n??h.ZERO,i=i??3;let o=RY;o.x=t[0]+n.x,o.y=t[1]+n.y,o.z=t[2]+n.z;let s=h.clone(o,vY),a=h.clone(o,SY),c=h.clone(o,wY),u=h.clone(o,IY),f=h.clone(o,PY),d=h.clone(o,DY),p=t.length,g;for(g=0;g<p;g+=i){let _=t[g]+n.x,C=t[g+1]+n.y,w=t[g+2]+n.z;o.x=_,o.y=C,o.z=w,_<s.x&&h.clone(o,s),_>u.x&&h.clone(o,u),C<a.y&&h.clone(o,a),C>f.y&&h.clone(o,f),w<c.z&&h.clone(o,c),w>d.z&&h.clone(o,d)}let m=h.magnitudeSquared(h.subtract(u,s,Ya)),y=h.magnitudeSquared(h.subtract(f,a,Ya)),A=h.magnitudeSquared(h.subtract(d,c,Ya)),b=s,x=u,T=m;y>T&&(T=y,b=a,x=f),A>T&&(b=c,x=d);let E=OY;E.x=(b.x+x.x)*.5,E.y=(b.y+x.y)*.5,E.z=(b.z+x.z)*.5;let v=h.magnitudeSquared(h.subtract(x,E,Ya)),S=Math.sqrt(v),I=MY;I.x=s.x,I.y=a.y,I.z=c.z;let R=NY;R.x=u.x,R.y=f.y,R.z=d.z;let O=h.midpoint(I,R,LY),L=0;for(g=0;g<p;g+=i){o.x=t[g]+n.x,o.y=t[g+1]+n.y,o.z=t[g+2]+n.z;let _=h.magnitude(h.subtract(o,O,Ya));_>L&&(L=_);let C=h.magnitudeSquared(h.subtract(o,E,Ya));if(C>v){let w=Math.sqrt(C);S=(S+w)*.5,v=S*S;let D=w-S;E.x=(S*E.x+D*o.x)/w,E.y=(S*E.y+D*o.y)/w,E.z=(S*E.z+D*o.z)/w}}return S<L?(h.clone(E,r.center),r.radius=S):(h.clone(O,r.center),r.radius=L),r}static fromEncodedCartesianVertices(t,n,i){if(l(i)||(i=new e),!l(t)||!l(n)||t.length!==n.length||t.length===0)return i.center=h.clone(h.ZERO,i.center),i.radius=0,i;let r=RY;r.x=t[0]+n[0],r.y=t[1]+n[1],r.z=t[2]+n[2];let o=h.clone(r,vY),s=h.clone(r,SY),a=h.clone(r,wY),c=h.clone(r,IY),u=h.clone(r,PY),f=h.clone(r,DY),d=t.length,p;for(p=0;p<d;p+=3){let L=t[p]+n[p],_=t[p+1]+n[p+1],C=t[p+2]+n[p+2];r.x=L,r.y=_,r.z=C,L<o.x&&h.clone(r,o),L>c.x&&h.clone(r,c),_<s.y&&h.clone(r,s),_>u.y&&h.clone(r,u),C<a.z&&h.clone(r,a),C>f.z&&h.clone(r,f)}let g=h.magnitudeSquared(h.subtract(c,o,Ya)),m=h.magnitudeSquared(h.subtract(u,s,Ya)),y=h.magnitudeSquared(h.subtract(f,a,Ya)),A=o,b=c,x=g;m>x&&(x=m,A=s,b=u),y>x&&(A=a,b=f);let T=OY;T.x=(A.x+b.x)*.5,T.y=(A.y+b.y)*.5,T.z=(A.z+b.z)*.5;let E=h.magnitudeSquared(h.subtract(b,T,Ya)),v=Math.sqrt(E),S=MY;S.x=o.x,S.y=s.y,S.z=a.z;let I=NY;I.x=c.x,I.y=u.y,I.z=f.z;let R=h.midpoint(S,I,LY),O=0;for(p=0;p<d;p+=3){r.x=t[p]+n[p],r.y=t[p+1]+n[p+1],r.z=t[p+2]+n[p+2];let L=h.magnitude(h.subtract(r,R,Ya));L>O&&(O=L);let _=h.magnitudeSquared(h.subtract(r,T,Ya));if(_>E){let C=Math.sqrt(_);v=(v+C)*.5,E=v*v;let w=C-v;T.x=(v*T.x+w*r.x)/C,T.y=(v*T.y+w*r.y)/C,T.z=(v*T.z+w*r.z)/C}}return v<O?(h.clone(T,i.center),i.radius=v):(h.clone(R,i.center),i.radius=O),i}static fromCornerPoints(t,n,i){l(i)||(i=new e);let r=h.midpoint(t,n,i.center);return i.radius=h.distance(r,n),i}static fromEllipsoid(t,n){return l(n)||(n=new e),h.clone(h.ZERO,n.center),n.radius=t.maximumRadius,n}static fromBoundingSpheres(t,n){if(l(n)||(n=new e),!l(t)||t.length===0)return n.center=h.clone(h.ZERO,n.center),n.radius=0,n;let i=t.length;if(i===1)return e.clone(t[0],n);if(i===2)return e.union(t[0],t[1],n);let r=[],o;for(o=0;o<i;o++)r.push(t[o].center);n=e.fromPoints(r,n);let s=n.center,a=n.radius;for(o=0;o<i;o++){let c=t[o];a=Math.max(a,h.distance(s,c.center)+c.radius)}return n.radius=a,n}static fromOrientedBoundingBox(t,n){l(n)||(n=new e);let i=t.halfAxes,r=$.getColumn(i,0,TVe),o=$.getColumn(i,1,EVe),s=$.getColumn(i,2,CVe);return h.add(r,o,r),h.add(r,s,r),n.center=h.clone(t.center,n.center),n.radius=h.magnitude(r),n}static fromTransformation(t,n){l(n)||(n=new e);let i=M.getTranslation(t,vVe),r=M.getScale(t,SVe),o=.5*h.magnitude(r);return n.center=h.clone(i,n.center),n.radius=o,n}static clone(t,n){if(l(t))return l(n)?(n.center=h.clone(t.center,n.center),n.radius=t.radius,n):new e(t.center,t.radius)}static pack(t,n,i){i=i??0;let r=t.center;return n[i++]=r.x,n[i++]=r.y,n[i++]=r.z,n[i]=t.radius,n}static unpack(t,n,i){n=n??0,l(i)||(i=new e);let r=i.center;return r.x=t[n++],r.y=t[n++],r.z=t[n++],i.radius=t[n],i}static union(t,n,i){l(i)||(i=new e);let r=t.center,o=t.radius,s=n.center,a=n.radius,c=h.subtract(s,r,wVe),u=h.magnitude(c);if(o>=u+a)return t.clone(i),i;if(a>=u+o)return n.clone(i),i;let f=(o+u+a)*.5,d=h.multiplyByScalar(c,(-o+f)/u,IVe);return h.add(d,r,d),h.clone(d,i.center),i.radius=f,i}static expand(t,n,i){i=e.clone(t,i);let r=h.magnitude(h.subtract(n,i.center,PVe));return r>i.radius&&(i.radius=r),i}static intersectPlane(t,n){let i=t.center,r=t.radius,o=n.normal,s=h.dot(o,i)+n.distance;return s<-r?$t.OUTSIDE:s<r?$t.INTERSECTING:$t.INSIDE}static transform(t,n,i){return l(i)||(i=new e),i.center=M.multiplyByPoint(n,t.center,i.center),i.radius=M.getMaximumScale(n)*t.radius,i}static distanceSquaredTo(t,n){let i=h.subtract(t.center,n,DVe),r=h.magnitude(i)-t.radius;return r<=0?0:r*r}static transformWithoutScale(t,n,i){return l(i)||(i=new e),i.center=M.multiplyByPoint(n,t.center,i.center),i.radius=t.radius,i}static computePlaneDistances(t,n,i,r){l(r)||(r=new Gs);let o=h.subtract(t.center,n,RVe),s=h.dot(i,o);return r.start=s-t.radius,r.stop=s+t.radius,r}static projectTo2D(t,n,i){Ble._ellipsoid=ee.default,n=n??Ble;let r=n.ellipsoid,o=t.center,s=t.radius,a;h.equals(o,h.ZERO)?a=h.clone(h.UNIT_X,Fle):a=r.geodeticSurfaceNormal(o,Fle);let c=h.cross(h.UNIT_Z,a,OVe);h.normalize(c,c);let u=h.cross(a,c,MVe);h.normalize(u,u),h.multiplyByScalar(a,s,a),h.multiplyByScalar(u,s,u),h.multiplyByScalar(c,s,c);let f=h.negate(u,LVe),d=h.negate(c,NVe),p=kle,g=p[0];h.add(a,u,g),h.add(g,c,g),g=p[1],h.add(a,u,g),h.add(g,d,g),g=p[2],h.add(a,f,g),h.add(g,d,g),g=p[3],h.add(a,f,g),h.add(g,c,g),h.negate(a,a),g=p[4],h.add(a,u,g),h.add(g,c,g),g=p[5],h.add(a,u,g),h.add(g,d,g),g=p[6],h.add(a,f,g),h.add(g,d,g),g=p[7],h.add(a,f,g),h.add(g,c,g);let m=p.length;for(let x=0;x<m;++x){let T=p[x];h.add(o,T,T);let E=r.cartesianToCartographic(T,FVe);n.project(E,T)}i=e.fromPoints(p,i),o=i.center;let y=o.x,A=o.y,b=o.z;return o.x=b,o.y=y,o.z=A,i}static isOccluded(t,n){return!n.isBoundingSphereVisible(t)}static equals(t,n){return t===n||l(t)&&l(n)&&h.equals(t.center,n.center)&&t.radius===n.radius}intersectPlane(t){return e.intersectPlane(this,t)}distanceSquaredTo(t){return e.distanceSquaredTo(this,t)}computePlaneDistances(t,n,i){return e.computePlaneDistances(this,t,n,i)}isOccluded(t){return e.isOccluded(this,t)}equals(t){return e.equals(this,t)}clone(t){return e.clone(this,t)}volume(){let t=this.radius;return yVe*t*t*t}};rL.packedLength=4;var vY=new h,SY=new h,wY=new h,IY=new h,PY=new h,DY=new h,RY=new h,Ya=new h,OY=new h,MY=new h,NY=new h,LY=new h,yVe=4/3*P.PI,Lle=new ji,AVe=new h,bVe=new h,FY=new he,BY=new he,xVe=[],TVe=new h,EVe=new h,CVe=new h,vVe=new h,SVe=new h,wVe=new h,IVe=new h,PVe=new h,DVe=new h,RVe=new h,Fle=new h,OVe=new h,MVe=new h,NVe=new h,LVe=new h,FVe=new he,kle=new Array(8);for(let e=0;e<8;++e)kle[e]=new h;var Ble=new ji,ue=rL;function BVe(e){e=e??H.EMPTY_OBJECT,this.position=e.position,this.normal=e.normal,this.st=e.st,this.bitangent=e.bitangent,this.tangent=e.tangent,this.color=e.color}var En=BVe;var Ule={NONE:0,TOP:1,ALL:2};Object.freeze(Ule);var pn=Ule;function Ws(e){e=e??H.EMPTY_OBJECT,this.position=e.position??!1,this.normal=e.normal??!1,this.st=e.st??!1,this.bitangent=e.bitangent??!1,this.tangent=e.tangent??!1,this.color=e.color??!1}Ws.POSITION_ONLY=Object.freeze(new Ws({position:!0}));Ws.POSITION_AND_NORMAL=Object.freeze(new Ws({position:!0,normal:!0}));Ws.POSITION_NORMAL_AND_ST=Object.freeze(new Ws({position:!0,normal:!0,st:!0}));Ws.POSITION_AND_ST=Object.freeze(new Ws({position:!0,st:!0}));Ws.POSITION_AND_COLOR=Object.freeze(new Ws({position:!0,color:!0}));Ws.ALL=Object.freeze(new Ws({position:!0,normal:!0,st:!0,tangent:!0,bitangent:!0}));Ws.DEFAULT=Ws.POSITION_NORMAL_AND_ST;Ws.packedLength=6;Ws.pack=function(e,t,n){return n=n??0,t[n++]=e.position?1:0,t[n++]=e.normal?1:0,t[n++]=e.st?1:0,t[n++]=e.tangent?1:0,t[n++]=e.bitangent?1:0,t[n]=e.color?1:0,t};Ws.unpack=function(e,t,n){return t=t??0,l(n)||(n=new Ws),n.position=e[t++]===1,n.normal=e[t++]===1,n.st=e[t++]===1,n.tangent=e[t++]===1,n.bitangent=e[t++]===1,n.color=e[t]===1,n};Ws.clone=function(e,t){if(l(e))return l(t)||(t=new Ws),t.position=e.position,t.normal=e.normal,t.st=e.st,t.tangent=e.tangent,t.bitangent=e.bitangent,t.color=e.color,t};var Be=Ws;var kVe=new h;function rf(e){e=e??H.EMPTY_OBJECT;let t=e.minimum,n=e.maximum,i=e.vertexFormat??Be.DEFAULT;this._minimum=h.clone(t),this._maximum=h.clone(n),this._vertexFormat=i,this._offsetAttribute=e.offsetAttribute,this._workerName="createBoxGeometry"}rf.fromDimensions=function(e){e=e??H.EMPTY_OBJECT;let t=e.dimensions,n=h.multiplyByScalar(t,.5,new h);return new rf({minimum:h.negate(n,new h),maximum:n,vertexFormat:e.vertexFormat,offsetAttribute:e.offsetAttribute})};rf.fromAxisAlignedBoundingBox=function(e){return new rf({minimum:e.minimum,maximum:e.maximum})};rf.packedLength=2*h.packedLength+Be.packedLength+1;rf.pack=function(e,t,n){return n=n??0,h.pack(e._minimum,t,n),h.pack(e._maximum,t,n+h.packedLength),Be.pack(e._vertexFormat,t,n+2*h.packedLength),t[n+2*h.packedLength+Be.packedLength]=e._offsetAttribute??-1,t};var Vle=new h,jle=new h,Hle=new Be,zle={minimum:Vle,maximum:jle,vertexFormat:Hle,offsetAttribute:void 0};rf.unpack=function(e,t,n){t=t??0;let i=h.unpack(e,t,Vle),r=h.unpack(e,t+h.packedLength,jle),o=Be.unpack(e,t+2*h.packedLength,Hle),s=e[t+2*h.packedLength+Be.packedLength];return l(n)?(n._minimum=h.clone(i,n._minimum),n._maximum=h.clone(r,n._maximum),n._vertexFormat=Be.clone(o,n._vertexFormat),n._offsetAttribute=s===-1?void 0:s,n):(zle.offsetAttribute=s===-1?void 0:s,new rf(zle))};rf.createGeometry=function(e){let t=e._minimum,n=e._maximum,i=e._vertexFormat;if(h.equals(t,n))return;let r=new En,o,s;if(i.position&&(i.st||i.normal||i.tangent||i.bitangent)){if(i.position&&(s=new Float64Array(72),s[0]=t.x,s[1]=t.y,s[2]=n.z,s[3]=n.x,s[4]=t.y,s[5]=n.z,s[6]=n.x,s[7]=n.y,s[8]=n.z,s[9]=t.x,s[10]=n.y,s[11]=n.z,s[12]=t.x,s[13]=t.y,s[14]=t.z,s[15]=n.x,s[16]=t.y,s[17]=t.z,s[18]=n.x,s[19]=n.y,s[20]=t.z,s[21]=t.x,s[22]=n.y,s[23]=t.z,s[24]=n.x,s[25]=t.y,s[26]=t.z,s[27]=n.x,s[28]=n.y,s[29]=t.z,s[30]=n.x,s[31]=n.y,s[32]=n.z,s[33]=n.x,s[34]=t.y,s[35]=n.z,s[36]=t.x,s[37]=t.y,s[38]=t.z,s[39]=t.x,s[40]=n.y,s[41]=t.z,s[42]=t.x,s[43]=n.y,s[44]=n.z,s[45]=t.x,s[46]=t.y,s[47]=n.z,s[48]=t.x,s[49]=n.y,s[50]=t.z,s[51]=n.x,s[52]=n.y,s[53]=t.z,s[54]=n.x,s[55]=n.y,s[56]=n.z,s[57]=t.x,s[58]=n.y,s[59]=n.z,s[60]=t.x,s[61]=t.y,s[62]=t.z,s[63]=n.x,s[64]=t.y,s[65]=t.z,s[66]=n.x,s[67]=t.y,s[68]=n.z,s[69]=t.x,s[70]=t.y,s[71]=n.z,r.position=new Ne({componentDatatype:Y.DOUBLE,componentsPerAttribute:3,values:s})),i.normal){let u=new Float32Array(72);u[0]=0,u[1]=0,u[2]=1,u[3]=0,u[4]=0,u[5]=1,u[6]=0,u[7]=0,u[8]=1,u[9]=0,u[10]=0,u[11]=1,u[12]=0,u[13]=0,u[14]=-1,u[15]=0,u[16]=0,u[17]=-1,u[18]=0,u[19]=0,u[20]=-1,u[21]=0,u[22]=0,u[23]=-1,u[24]=1,u[25]=0,u[26]=0,u[27]=1,u[28]=0,u[29]=0,u[30]=1,u[31]=0,u[32]=0,u[33]=1,u[34]=0,u[35]=0,u[36]=-1,u[37]=0,u[38]=0,u[39]=-1,u[40]=0,u[41]=0,u[42]=-1,u[43]=0,u[44]=0,u[45]=-1,u[46]=0,u[47]=0,u[48]=0,u[49]=1,u[50]=0,u[51]=0,u[52]=1,u[53]=0,u[54]=0,u[55]=1,u[56]=0,u[57]=0,u[58]=1,u[59]=0,u[60]=0,u[61]=-1,u[62]=0,u[63]=0,u[64]=-1,u[65]=0,u[66]=0,u[67]=-1,u[68]=0,u[69]=0,u[70]=-1,u[71]=0,r.normal=new Ne({componentDatatype:Y.FLOAT,componentsPerAttribute:3,values:u})}if(i.st){let u=new Float32Array(48);u[0]=0,u[1]=0,u[2]=1,u[3]=0,u[4]=1,u[5]=1,u[6]=0,u[7]=1,u[8]=1,u[9]=0,u[10]=0,u[11]=0,u[12]=0,u[13]=1,u[14]=1,u[15]=1,u[16]=0,u[17]=0,u[18]=1,u[19]=0,u[20]=1,u[21]=1,u[22]=0,u[23]=1,u[24]=1,u[25]=0,u[26]=0,u[27]=0,u[28]=0,u[29]=1,u[30]=1,u[31]=1,u[32]=1,u[33]=0,u[34]=0,u[35]=0,u[36]=0,u[37]=1,u[38]=1,u[39]=1,u[40]=0,u[41]=0,u[42]=1,u[43]=0,u[44]=1,u[45]=1,u[46]=0,u[47]=1,r.st=new Ne({componentDatatype:Y.FLOAT,componentsPerAttribute:2,values:u})}if(i.tangent){let u=new Float32Array(72);u[0]=1,u[1]=0,u[2]=0,u[3]=1,u[4]=0,u[5]=0,u[6]=1,u[7]=0,u[8]=0,u[9]=1,u[10]=0,u[11]=0,u[12]=-1,u[13]=0,u[14]=0,u[15]=-1,u[16]=0,u[17]=0,u[18]=-1,u[19]=0,u[20]=0,u[21]=-1,u[22]=0,u[23]=0,u[24]=0,u[25]=1,u[26]=0,u[27]=0,u[28]=1,u[29]=0,u[30]=0,u[31]=1,u[32]=0,u[33]=0,u[34]=1,u[35]=0,u[36]=0,u[37]=-1,u[38]=0,u[39]=0,u[40]=-1,u[41]=0,u[42]=0,u[43]=-1,u[44]=0,u[45]=0,u[46]=-1,u[47]=0,u[48]=-1,u[49]=0,u[50]=0,u[51]=-1,u[52]=0,u[53]=0,u[54]=-1,u[55]=0,u[56]=0,u[57]=-1,u[58]=0,u[59]=0,u[60]=1,u[61]=0,u[62]=0,u[63]=1,u[64]=0,u[65]=0,u[66]=1,u[67]=0,u[68]=0,u[69]=1,u[70]=0,u[71]=0,r.tangent=new Ne({componentDatatype:Y.FLOAT,componentsPerAttribute:3,values:u})}if(i.bitangent){let u=new Float32Array(72);u[0]=0,u[1]=1,u[2]=0,u[3]=0,u[4]=1,u[5]=0,u[6]=0,u[7]=1,u[8]=0,u[9]=0,u[10]=1,u[11]=0,u[12]=0,u[13]=1,u[14]=0,u[15]=0,u[16]=1,u[17]=0,u[18]=0,u[19]=1,u[20]=0,u[21]=0,u[22]=1,u[23]=0,u[24]=0,u[25]=0,u[26]=1,u[27]=0,u[28]=0,u[29]=1,u[30]=0,u[31]=0,u[32]=1,u[33]=0,u[34]=0,u[35]=1,u[36]=0,u[37]=0,u[38]=1,u[39]=0,u[40]=0,u[41]=1,u[42]=0,u[43]=0,u[44]=1,u[45]=0,u[46]=0,u[47]=1,u[48]=0,u[49]=0,u[50]=1,u[51]=0,u[52]=0,u[53]=1,u[54]=0,u[55]=0,u[56]=1,u[57]=0,u[58]=0,u[59]=1,u[60]=0,u[61]=0,u[62]=1,u[63]=0,u[64]=0,u[65]=1,u[66]=0,u[67]=0,u[68]=1,u[69]=0,u[70]=0,u[71]=1,r.bitangent=new Ne({componentDatatype:Y.FLOAT,componentsPerAttribute:3,values:u})}o=new Uint16Array(36),o[0]=0,o[1]=1,o[2]=2,o[3]=0,o[4]=2,o[5]=3,o[6]=6,o[7]=5,o[8]=4,o[9]=7,o[10]=6,o[11]=4,o[12]=8,o[13]=9,o[14]=10,o[15]=8,o[16]=10,o[17]=11,o[18]=14,o[19]=13,o[20]=12,o[21]=15,o[22]=14,o[23]=12,o[24]=18,o[25]=17,o[26]=16,o[27]=19,o[28]=18,o[29]=16,o[30]=20,o[31]=21,o[32]=22,o[33]=20,o[34]=22,o[35]=23}else s=new Float64Array(24),s[0]=t.x,s[1]=t.y,s[2]=t.z,s[3]=n.x,s[4]=t.y,s[5]=t.z,s[6]=n.x,s[7]=n.y,s[8]=t.z,s[9]=t.x,s[10]=n.y,s[11]=t.z,s[12]=t.x,s[13]=t.y,s[14]=n.z,s[15]=n.x,s[16]=t.y,s[17]=n.z,s[18]=n.x,s[19]=n.y,s[20]=n.z,s[21]=t.x,s[22]=n.y,s[23]=n.z,r.position=new Ne({componentDatatype:Y.DOUBLE,componentsPerAttribute:3,values:s}),o=new Uint16Array(36),o[0]=4,o[1]=5,o[2]=6,o[3]=4,o[4]=6,o[5]=7,o[6]=1,o[7]=0,o[8]=3,o[9]=1,o[10]=3,o[11]=2,o[12]=1,o[13]=6,o[14]=5,o[15]=1,o[16]=2,o[17]=6,o[18]=2,o[19]=3,o[20]=7,o[21]=2,o[22]=7,o[23]=6,o[24]=3,o[25]=0,o[26]=4,o[27]=3,o[28]=4,o[29]=7,o[30]=0,o[31]=1,o[32]=5,o[33]=0,o[34]=5,o[35]=4;let a=h.subtract(n,t,kVe),c=h.magnitude(a)*.5;if(l(e._offsetAttribute)){let u=s.length,f=e._offsetAttribute===pn.NONE?0:1,d=new Uint8Array(u/3).fill(f);r.applyOffset=new Ne({componentDatatype:Y.UNSIGNED_BYTE,componentsPerAttribute:1,values:d})}return new wt({attributes:r,indices:o,primitiveType:Oe.TRIANGLES,boundingSphere:new ue(h.ZERO,c),offsetAttribute:e._offsetAttribute})};var kY;rf.getUnitBox=function(){return l(kY)||(kY=rf.createGeometry(rf.fromDimensions({dimensions:new h(1,1,1),vertexFormat:Be.POSITION_ONLY}))),kY};var zc=rf;var Ar={SCALAR:"SCALAR",VEC2:"VEC2",VEC3:"VEC3",VEC4:"VEC4",MAT2:"MAT2",MAT3:"MAT3",MAT4:"MAT4"};Ar.getMathType=function(e){switch(e){case Ar.SCALAR:return Number;case Ar.VEC2:return U;case Ar.VEC3:return h;case Ar.VEC4:return se;case Ar.MAT2:return $i;case Ar.MAT3:return $;case Ar.MAT4:return M}};Ar.getNumberOfComponents=function(e){switch(e){case Ar.SCALAR:return 1;case Ar.VEC2:return 2;case Ar.VEC3:return 3;case Ar.VEC4:case Ar.MAT2:return 4;case Ar.MAT3:return 9;case Ar.MAT4:return 16}};Ar.getAttributeLocationCount=function(e){switch(e){case Ar.SCALAR:case Ar.VEC2:case Ar.VEC3:case Ar.VEC4:return 1;case Ar.MAT2:return 2;case Ar.MAT3:return 3;case Ar.MAT4:return 4}};Ar.getGlslType=function(e){switch(e){case Ar.SCALAR:return"float";case Ar.VEC2:return"vec2";case Ar.VEC3:return"vec3";case Ar.VEC4:return"vec4";case Ar.MAT2:return"mat2";case Ar.MAT3:return"mat3";case Ar.MAT4:return"mat4"}};Object.freeze(Ar);var Vt=Ar;var Gle=1/256,UVe=65536,zY=256,Dr={};Dr.octEncodeInRange=function(e,t,n){if(n.x=e.x/(Math.abs(e.x)+Math.abs(e.y)+Math.abs(e.z)),n.y=e.y/(Math.abs(e.x)+Math.abs(e.y)+Math.abs(e.z)),e.z<0){let i=n.x,r=n.y;n.x=(1-Math.abs(r))*P.signNotZero(i),n.y=(1-Math.abs(i))*P.signNotZero(r)}return n.x=P.toSNorm(n.x,t),n.y=P.toSNorm(n.y,t),n};Dr.octEncode=function(e,t){return Dr.octEncodeInRange(e,255,t)};var XI=new U,Wle=new Uint8Array(1);function oL(e){return Wle[0]=e,Wle[0]}Dr.octEncodeToCartesian4=function(e,t){return Dr.octEncodeInRange(e,65535,XI),t.x=oL(XI.x*Gle),t.y=oL(XI.x),t.z=oL(XI.y*Gle),t.w=oL(XI.y),t};Dr.octDecodeInRange=function(e,t,n,i){if(i.x=P.fromSNorm(e,n),i.y=P.fromSNorm(t,n),i.z=1-(Math.abs(i.x)+Math.abs(i.y)),i.z<0){let r=i.x;i.x=(1-Math.abs(i.y))*P.signNotZero(r),i.y=(1-Math.abs(r))*P.signNotZero(i.y)}return h.normalize(i,i)};Dr.octDecode=function(e,t,n){return Dr.octDecodeInRange(e,t,255,n)};Dr.octDecodeFromCartesian4=function(e,t){let n=e.x,i=e.y,r=e.z,o=e.w,s=n*zY+i,a=r*zY+o;return Dr.octDecodeInRange(s,a,65535,t)};Dr.octPackFloat=function(e){return 256*e.x+e.y};var VY=new U;Dr.octEncodeFloat=function(e){return Dr.octEncode(e,VY),Dr.octPackFloat(VY)};Dr.octDecodeFloat=function(e,t){let n=e/256,i=Math.floor(n),r=(n-i)*256;return Dr.octDecode(i,r,t)};Dr.octPack=function(e,t,n,i){let r=Dr.octEncodeFloat(e),o=Dr.octEncodeFloat(t),s=Dr.octEncode(n,VY);return i.x=65536*s.x+r,i.y=65536*s.y+o,i};Dr.octUnpack=function(e,t,n,i){let r=e.x/65536,o=Math.floor(r),s=(r-o)*65536;r=e.y/65536;let a=Math.floor(r),c=(r-a)*65536;Dr.octDecodeFloat(s,t),Dr.octDecodeFloat(c,n),Dr.octDecode(o,a,i)};Dr.compressTextureCoordinates=function(e){let t=e.x*4095|0,n=e.y*4095|0;return 4096*t+n};Dr.decompressTextureCoordinates=function(e,t){let n=e/4096,i=Math.floor(n);return t.x=i/4095,t.y=(e-i*4096)/4095,t};function UY(e){return e>>1^-(e&1)}Dr.zigZagDeltaDecode=function(e,t,n){let i=e.length,r=0,o=0,s=0;for(let a=0;a<i;++a)r+=UY(e[a]),o+=UY(t[a]),e[a]=r,t[a]=o,l(n)&&(s+=UY(n[a]),n[a]=s)};Dr.dequantize=function(e,t,n,i){let r=Vt.getNumberOfComponents(n),o;switch(t){case Y.BYTE:o=127;break;case Y.UNSIGNED_BYTE:o=255;break;case Y.SHORT:o=32767;break;case Y.UNSIGNED_SHORT:o=65535;break;case Y.INT:o=2147483647;break;case Y.UNSIGNED_INT:o=4294967295;break}let s=new Float32Array(i*r);for(let a=0;a<i;a++)for(let c=0;c<r;c++){let u=a*r+c;s[u]=Math.max(e[u]/o,-1)}return s};Dr.encodeRGB8=function(e){return Math.round(P.clamp(e.red*255,0,255))*UVe+Math.round(P.clamp(e.green*255,0,255))*zY+Math.round(P.clamp(e.blue*255,0,255))};Dr.decodeRGB8=function(e,t){return e=Math.floor(e),t.red=(e>>16&255)/255,t.green=(e>>8&255)/255,t.blue=(e&255)/255,t};Dr.decodeRGB565=function(e,t){let n=e.length;l(t)||(t=new Float32Array(n*3));let i=31,r=63,o=1/31,s=1/63;for(let a=0;a<n;a++){let c=e[a],u=c>>11,f=c>>5&r,d=c&i,p=3*a;t[p]=u*o,t[p+1]=f*s,t[p+2]=d*o}return t};var cn=Dr;var qle=new h,Yle=new h,Xle=new h;function zVe(e,t,n,i,r){l(r)||(r=new h);let o,s,a,c,u,f,d,p;if(l(t.z)){if(h.equalsEpsilon(e,t,P.EPSILON14))return h.clone(h.UNIT_X,r);if(h.equalsEpsilon(e,n,P.EPSILON14))return h.clone(h.UNIT_Y,r);if(h.equalsEpsilon(e,i,P.EPSILON14))return h.clone(h.UNIT_Z,r);o=h.subtract(n,t,qle),s=h.subtract(i,t,Yle),a=h.subtract(e,t,Xle),c=h.dot(o,o),u=h.dot(o,s),f=h.dot(o,a),d=h.dot(s,s),p=h.dot(s,a)}else{if(U.equalsEpsilon(e,t,P.EPSILON14))return h.clone(h.UNIT_X,r);if(U.equalsEpsilon(e,n,P.EPSILON14))return h.clone(h.UNIT_Y,r);if(U.equalsEpsilon(e,i,P.EPSILON14))return h.clone(h.UNIT_Z,r);o=U.subtract(n,t,qle),s=U.subtract(i,t,Yle),a=U.subtract(e,t,Xle),c=U.dot(o,o),u=U.dot(o,s),f=U.dot(o,a),d=U.dot(s,s),p=U.dot(s,a)}r.y=d*f-u*p,r.z=c*p-u*f;let g=c*d-u*u;if(g!==0)return r.y/=g,r.z/=g,r.x=1-r.y-r.z,r}var BE=zVe;function Wm(){this.high=h.clone(h.ZERO),this.low=h.clone(h.ZERO)}Wm.encode=function(e,t){l(t)||(t={high:0,low:0});let n;return e>=0?(n=Math.floor(e/65536)*65536,t.high=n,t.low=e-n):(n=Math.floor(-e/65536)*65536,t.high=-n,t.low=e+n),t};var k0={high:0,low:0};Wm.fromCartesian=function(e,t){l(t)||(t=new Wm);let n=t.high,i=t.low;return Wm.encode(e.x,k0),n.x=k0.high,i.x=k0.low,Wm.encode(e.y,k0),n.y=k0.high,i.y=k0.low,Wm.encode(e.z,k0),n.z=k0.high,i.z=k0.low,t};var jY=new Wm;Wm.writeElements=function(e,t,n){Wm.fromCartesian(e,jY);let i=jY.high,r=jY.low;t[n]=i.x,t[n+1]=i.y,t[n+2]=i.z,t[n+3]=r.x,t[n+4]=r.y,t[n+5]=r.z};var Sn=Wm;var HY={};HY.computeDiscriminant=function(e,t,n){return t*t-4*e*n};function Kle(e,t,n){let i=e+t;return P.sign(e)!==P.sign(t)&&Math.abs(i/Math.max(Math.abs(e),Math.abs(t)))<n?0:i}HY.computeRealRoots=function(e,t,n){let i;if(e===0)return t===0?[]:[-n/t];if(t===0){if(n===0)return[0,0];let c=Math.abs(n),u=Math.abs(e);if(c<u&&c/u<P.EPSILON14)return[0,0];if(c>u&&u/c<P.EPSILON14)return[];if(i=-n/e,i<0)return[];let f=Math.sqrt(i);return[-f,f]}else if(n===0)return i=-t/e,i<0?[i,0]:[0,i];let r=t*t,o=4*e*n,s=Kle(r,-o,P.EPSILON14);if(s<0)return[];let a=-.5*Kle(t,P.sign(t)*Math.sqrt(s),P.EPSILON14);return t>0?[a/e,n/a]:[n/a,a/e]};var cu=HY;var WY={};WY.computeDiscriminant=function(e,t,n,i){let r=e*e,o=t*t,s=n*n,a=i*i;return 18*e*t*n*i+o*s-27*r*a-4*(e*s*n+o*t*i)};function GY(e,t,n,i){let r=e,o=t/3,s=n/3,a=i,c=r*s,u=o*a,f=o*o,d=s*s,p=r*s-f,g=r*a-o*s,m=o*a-d,y=4*p*m-g*g,A,b;if(y<0){let G,q,Q;f*u>=c*d?(G=r,q=p,Q=-2*o*p+r*g):(G=a,q=m,Q=-a*g+2*s*m);let J=-(Q<0?-1:1)*Math.abs(G)*Math.sqrt(-y);b=-Q+J;let Z=b/2,ae=Z<0?-Math.pow(-Z,1/3):Math.pow(Z,1/3),Ae=b===J?-ae:-q/ae;return A=q<=0?ae+Ae:-Q/(ae*ae+Ae*Ae+q),f*u>=c*d?[(A-o)/r]:[-a/(A+s)]}let x=p,T=-2*o*p+r*g,E=m,v=-a*g+2*s*m,S=Math.sqrt(y),I=Math.sqrt(3)/2,R=Math.abs(Math.atan2(r*S,-T)/3);A=2*Math.sqrt(-x);let O=Math.cos(R);b=A*O;let L=A*(-O/2-I*Math.sin(R)),_=b+L>2*o?b-o:L-o,C=r,w=_/C;R=Math.abs(Math.atan2(a*S,-v)/3),A=2*Math.sqrt(-E),O=Math.cos(R),b=A*O,L=A*(-O/2-I*Math.sin(R));let D=-a,N=b+L<2*s?b+s:L+s,F=D/N,V=C*N,B=-_*N-C*D,j=_*D,k=(s*B-o*j)/(-o*B+s*V);return w<=k?w<=F?k<=F?[w,k,F]:[w,F,k]:[F,w,k]:w<=F?[k,w,F]:k<=F?[k,F,w]:[F,k,w]}WY.computeRealRoots=function(e,t,n,i){let r,o;if(e===0)return cu.computeRealRoots(t,n,i);if(t===0){if(n===0){if(i===0)return[0,0,0];o=-i/e;let s=o<0?-Math.pow(-o,1/3):Math.pow(o,1/3);return[s,s,s]}else if(i===0)return r=cu.computeRealRoots(e,0,n),r.Length===0?[0]:[r[0],0,r[1]];return GY(e,0,n,i)}else{if(n===0)return i===0?(o=-t/e,o<0?[o,0,0]:[0,0,o]):GY(e,t,0,i);if(i===0)return r=cu.computeRealRoots(e,t,n),r.length===0?[0]:r[1]<=0?[r[0],r[1],0]:r[0]>=0?[0,r[0],r[1]]:[r[0],0,r[1]]}return GY(e,t,n,i)};var kE=WY;var qY={};qY.computeDiscriminant=function(e,t,n,i,r){let o=e*e,s=o*e,a=t*t,c=a*t,u=n*n,f=u*n,d=i*i,p=d*i,g=r*r,m=g*r;return a*u*d-4*c*p-4*e*f*d+18*e*t*n*p-27*o*d*d+256*s*m+r*(18*c*n*i-4*a*f+16*e*u*u-80*e*t*u*i-6*e*a*d+144*o*n*d)+g*(144*e*a*n-27*a*a-128*o*u-192*o*t*i)};function ph(e,t,n,i){let r=e*e,o=t-3*r/8,s=n-t*e/2+r*e/8,a=i-n*e/4+t*r/16-3*r*r/256,c=kE.computeRealRoots(1,2*o,o*o-4*a,-s*s);if(c.length>0){let u=-e/4,f=c[c.length-1];if(Math.abs(f)<P.EPSILON14){let d=cu.computeRealRoots(1,o,a);if(d.length===2){let p=d[0],g=d[1],m;if(p>=0&&g>=0){let y=Math.sqrt(p),A=Math.sqrt(g);return[u-A,u-y,u+y,u+A]}else{if(p>=0&&g<0)return m=Math.sqrt(p),[u-m,u+m];if(p<0&&g>=0)return m=Math.sqrt(g),[u-m,u+m]}}return[]}else if(f>0){let d=Math.sqrt(f),p=(o+f-s/d)/2,g=(o+f+s/d)/2,m=cu.computeRealRoots(1,d,p),y=cu.computeRealRoots(1,-d,g);return m.length!==0?(m[0]+=u,m[1]+=u,y.length!==0?(y[0]+=u,y[1]+=u,m[1]<=y[0]?[m[0],m[1],y[0],y[1]]:y[1]<=m[0]?[y[0],y[1],m[0],m[1]]:m[0]>=y[0]&&m[1]<=y[1]?[y[0],m[0],m[1],y[1]]:y[0]>=m[0]&&y[1]<=m[1]?[m[0],y[0],y[1],m[1]]:m[0]>y[0]&&m[0]<y[1]?[y[0],m[0],y[1],m[1]]:[m[0],y[0],m[1],y[1]]):m):y.length!==0?(y[0]+=u,y[1]+=u,y):[]}}return[]}function KI(e,t,n,i){let r=n*n,o=t*t,s=e*e,a=-2*t,c=n*e+o-4*i,u=s*i-n*t*e+r,f=kE.computeRealRoots(1,a,c,u);if(f.length>0){let d=f[0],p=t-d,g=p*p,m=e/2,y=p/2,A=g-4*i,b=g+4*Math.abs(i),x=s-4*d,T=s+4*Math.abs(d),E,v;if(d<0||A*T<x*b){let C=Math.sqrt(x);E=C/2,v=C===0?0:(e*y-n)/C}else{let C=Math.sqrt(A);E=C===0?0:(e*y-n)/C,v=C/2}let S,I;m===0&&E===0?(S=0,I=0):P.sign(m)===P.sign(E)?(S=m+E,I=d/S):(I=m-E,S=d/I);let R,O;y===0&&v===0?(R=0,O=0):P.sign(y)===P.sign(v)?(R=y+v,O=i/R):(O=y-v,R=i/O);let L=cu.computeRealRoots(1,S,R),_=cu.computeRealRoots(1,I,O);if(L.length!==0)return _.length!==0?L[1]<=_[0]?[L[0],L[1],_[0],_[1]]:_[1]<=L[0]?[_[0],_[1],L[0],L[1]]:L[0]>=_[0]&&L[1]<=_[1]?[_[0],L[0],L[1],_[1]]:_[0]>=L[0]&&_[1]<=L[1]?[L[0],_[0],_[1],L[1]]:L[0]>_[0]&&L[0]<_[1]?[_[0],L[0],_[1],L[1]]:[L[0],_[0],L[1],_[1]]:L;if(_.length!==0)return _}return[]}qY.computeRealRoots=function(e,t,n,i,r){if(Math.abs(e)<P.EPSILON15)return kE.computeRealRoots(t,n,i,r);let o=t/e,s=n/e,a=i/e,c=r/e,u=o<0?1:0;switch(u+=s<0?u+1:u,u+=a<0?u+1:u,u+=c<0?u+1:u,u){case 0:return ph(o,s,a,c);case 1:return KI(o,s,a,c);case 2:return KI(o,s,a,c);case 3:return ph(o,s,a,c);case 4:return ph(o,s,a,c);case 5:return KI(o,s,a,c);case 6:return ph(o,s,a,c);case 7:return ph(o,s,a,c);case 8:return KI(o,s,a,c);case 9:return ph(o,s,a,c);case 10:return ph(o,s,a,c);case 11:return KI(o,s,a,c);case 12:return ph(o,s,a,c);case 13:return ph(o,s,a,c);case 14:return ph(o,s,a,c);case 15:return ph(o,s,a,c);default:return}};var sL=qY;var YY=class e{constructor(t,n){n=h.clone(n??h.ZERO),h.equals(n,h.ZERO)||h.normalize(n,n),this.origin=h.clone(t??h.ZERO),this.direction=n}static clone(t,n){if(l(t))return l(n)?(n.origin=h.clone(t.origin),n.direction=h.clone(t.direction),n):new e(t.origin,t.direction)}static getPoint(t,n,i){return l(i)||(i=new h),i=h.multiplyByScalar(t.direction,n,i),h.add(t.origin,i,i)}},gn=YY;var Jr={};Jr.rayPlane=function(e,t,n){l(n)||(n=new h);let i=e.origin,r=e.direction,o=t.normal,s=h.dot(o,r);if(Math.abs(s)<P.EPSILON15)return;let a=(-t.distance-h.dot(o,i))/s;if(!(a<0))return n=h.multiplyByScalar(r,a,n),h.add(i,n,n)};var VVe=new h,jVe=new h,iue=new h,$le=new h,Jle=new h;Jr.rayTriangleParametric=function(e,t,n,i,r){r=r??!1;let o=e.origin,s=e.direction,a=h.subtract(n,t,VVe),c=h.subtract(i,t,jVe),u=h.cross(s,c,iue),f=h.dot(a,u),d,p,g,m,y;if(r){if(f<P.EPSILON6||(d=h.subtract(o,t,$le),g=h.dot(d,u),g<0||g>f)||(p=h.cross(d,a,Jle),m=h.dot(s,p),m<0||g+m>f))return;y=h.dot(c,p)/f}else{if(Math.abs(f)<P.EPSILON6)return;let A=1/f;if(d=h.subtract(o,t,$le),g=h.dot(d,u)*A,g<0||g>1||(p=h.cross(d,a,Jle),m=h.dot(s,p)*A,m<0||g+m>1))return;y=h.dot(c,p)*A}return y};Jr.rayTriangle=function(e,t,n,i,r,o){let s=Jr.rayTriangleParametric(e,t,n,i,r);if(!(!l(s)||s<0))return l(o)||(o=new h),h.multiplyByScalar(e.direction,s,o),h.add(e.origin,o,o)};var HVe=new gn;Jr.lineSegmentTriangle=function(e,t,n,i,r,o,s){let a=HVe;h.clone(e,a.origin),h.subtract(t,e,a.direction),h.normalize(a.direction,a.direction);let c=Jr.rayTriangleParametric(a,n,i,r,o);if(!(!l(c)||c<0||c>h.distance(e,t)))return l(s)||(s=new h),h.multiplyByScalar(a.direction,c,s),h.add(a.origin,s,s)};function GVe(e,t,n,i){let r=t*t-4*e*n;if(r<0)return;if(r>0){let s=1/(2*e),a=Math.sqrt(r),c=(-t+a)*s,u=(-t-a)*s;return c<u?(i.root0=c,i.root1=u):(i.root0=u,i.root1=c),i}let o=-t/(2*e);if(o!==0)return i.root0=i.root1=o,i}var WVe={root0:0,root1:0};function rue(e,t,n){l(n)||(n=new Gs);let i=e.origin,r=e.direction,o=t.center,s=t.radius*t.radius,a=h.subtract(i,o,iue),c=h.dot(r,r),u=2*h.dot(r,a),f=h.magnitudeSquared(a)-s,d=GVe(c,u,f,WVe);if(l(d))return n.start=d.root0,n.stop=d.root1,n}Jr.raySphere=function(e,t,n){if(n=rue(e,t,n),!(!l(n)||n.stop<0))return n.start=Math.max(n.start,0),n};var qVe=new gn;Jr.lineSegmentSphere=function(e,t,n,i){let r=qVe;h.clone(e,r.origin);let o=h.subtract(t,e,r.direction),s=h.magnitude(o);if(h.normalize(o,o),i=rue(r,n,i),!(!l(i)||i.stop<0||i.start>s))return i.start=Math.max(i.start,0),i.stop=Math.min(i.stop,s),i};var YVe=new h,XVe=new h;Jr.rayEllipsoid=function(e,t){let n=t.oneOverRadii,i=h.multiplyComponents(n,e.origin,YVe),r=h.multiplyComponents(n,e.direction,XVe),o=h.magnitudeSquared(i),s=h.dot(i,r),a,c,u,f,d;if(o>1){if(s>=0)return;let p=s*s;if(a=o-1,c=h.magnitudeSquared(r),u=c*a,p<u)return;if(p>u){f=s*s-u,d=-s+Math.sqrt(f);let m=d/c,y=a/d;return m<y?new Gs(m,y):{start:y,stop:m}}let g=Math.sqrt(a/c);return new Gs(g,g)}else if(o<1)return a=o-1,c=h.magnitudeSquared(r),u=c*a,f=s*s-u,d=-s+Math.sqrt(f),new Gs(0,d/c);if(s<0)return c=h.magnitudeSquared(r),new Gs(0,-s/c)};var KVe=new Gs,$Ve=new Gs,JVe=new Gs;Jr.rayAxisAlignedBoundingBox=function(e,t,n){l(n)||(n=new Gs);let i=XY(e.origin.x,e.direction.x,t.minimum.x,t.maximum.x,KVe),r=XY(e.origin.y,e.direction.y,t.minimum.y,t.maximum.y,$Ve),o=XY(e.origin.z,e.direction.z,t.minimum.z,t.maximum.z,JVe);if(n.start=i.start>r.start?i.start:r.start,n.stop=i.stop<r.stop?i.stop:r.stop,!(i.start>r.stop||r.start>i.stop)&&!(n.start>o.stop||o.start>n.stop))return o.start>n.start&&(n.start=o.start),o.stop<n.stop&&(n.stop=o.stop),n};function XY(e,t,n,i,r){if(r.start=(n-e)/t,r.stop=(i-e)/t,r.stop<r.start){let o=r.stop;r.stop=r.start,r.start=o}return r}function Eb(e,t,n){let i=e+t;return P.sign(e)!==P.sign(t)&&Math.abs(i/Math.max(Math.abs(e),Math.abs(t)))<n?0:i}Jr.quadraticVectorExpression=function(e,t,n,i,r){let o=i*i,s=r*r,a=(e[$.COLUMN1ROW1]-e[$.COLUMN2ROW2])*s,c=r*(i*Eb(e[$.COLUMN1ROW0],e[$.COLUMN0ROW1],P.EPSILON15)+t.y),u=e[$.COLUMN0ROW0]*o+e[$.COLUMN2ROW2]*s+i*t.x+n,f=s*Eb(e[$.COLUMN2ROW1],e[$.COLUMN1ROW2],P.EPSILON15),d=r*(i*Eb(e[$.COLUMN2ROW0],e[$.COLUMN0ROW2])+t.z),p,g=[];if(d===0&&f===0){if(p=cu.computeRealRoots(a,c,u),p.length===0)return g;let R=p[0],O=Math.sqrt(Math.max(1-R*R,0));if(g.push(new h(i,r*R,r*-O)),g.push(new h(i,r*R,r*O)),p.length===2){let L=p[1],_=Math.sqrt(Math.max(1-L*L,0));g.push(new h(i,r*L,r*-_)),g.push(new h(i,r*L,r*_))}return g}let m=d*d,y=f*f,A=a*a,b=d*f,x=A+y,T=2*(c*a+b),E=2*u*a+c*c-y+m,v=2*(u*c-b),S=u*u-m;if(x===0&&T===0&&E===0&&v===0)return g;p=sL.computeRealRoots(x,T,E,v,S);let I=p.length;if(I===0)return g;for(let R=0;R<I;++R){let O=p[R],L=O*O,_=Math.max(1-L,0),C=Math.sqrt(_),w;P.sign(a)===P.sign(u)?w=Eb(a*L+u,c*O,P.EPSILON12):P.sign(u)===P.sign(c*O)?w=Eb(a*L,c*O+u,P.EPSILON12):w=Eb(a*L+c*O,u,P.EPSILON12);let D=Eb(f*O,d,P.EPSILON15),N=w*D;N<0?g.push(new h(i,r*O,r*C)):N>0?g.push(new h(i,r*O,r*-C)):C!==0?(g.push(new h(i,r*O,r*-C)),g.push(new h(i,r*O,r*C)),++R):g.push(new h(i,r*O,r*C))}return g};var KY=new h,Zle=new h,Qle=new h,aL=new h,ZVe=new h,QVe=new $,e4e=new $,t4e=new $,n4e=new $,i4e=new $,eue=new $,tue=new $,nue=new h,r4e=new h,o4e=new he;Jr.grazingAltitudeLocation=function(e,t){let n=e.origin,i=e.direction;if(!h.equals(n,h.ZERO)){let S=t.geodeticSurfaceNormal(n,KY);if(h.dot(i,S)>=0)return n}let r=l(this.rayEllipsoid(e,t)),o=t.transformPositionToScaledSpace(i,KY),s=h.normalize(o,o),a=h.mostOrthogonalAxis(o,aL),c=h.normalize(h.cross(a,s,Zle),Zle),u=h.normalize(h.cross(s,c,Qle),Qle),f=QVe;f[0]=s.x,f[1]=s.y,f[2]=s.z,f[3]=c.x,f[4]=c.y,f[5]=c.z,f[6]=u.x,f[7]=u.y,f[8]=u.z;let d=$.transpose(f,e4e),p=$.fromScale(t.radii,t4e),g=$.fromScale(t.oneOverRadii,n4e),m=i4e;m[0]=0,m[1]=-i.z,m[2]=i.y,m[3]=i.z,m[4]=0,m[5]=-i.x,m[6]=-i.y,m[7]=i.x,m[8]=0;let y=$.multiply($.multiply(d,g,eue),m,eue),A=$.multiply($.multiply(y,p,tue),f,tue),b=$.multiplyByVector(y,n,ZVe),x=Jr.quadraticVectorExpression(A,h.negate(b,KY),0,0,1),T,E,v=x.length;if(v>0){let S=h.clone(h.ZERO,r4e),I=Number.NEGATIVE_INFINITY;for(let O=0;O<v;++O){T=$.multiplyByVector(p,$.multiplyByVector(f,x[O],nue),nue);let L=h.normalize(h.subtract(T,n,aL),aL),_=h.dot(L,i);_>I&&(I=_,S=h.clone(T,S))}let R=t.cartesianToCartographic(S,o4e);return I=P.clamp(I,0,1),E=h.magnitude(h.subtract(S,n,aL))*Math.sqrt(1-I*I),E=r?-E:E,R.height=E,t.cartographicToCartesian(R,new h)}};var s4e=new h;Jr.lineSegmentPlane=function(e,t,n,i){l(i)||(i=new h);let r=h.subtract(t,e,s4e),o=n.normal,s=h.dot(o,r);if(Math.abs(s)<P.EPSILON6)return;let a=h.dot(o,e),c=-(n.distance+a)/s;if(!(c<0||c>1))return h.multiplyByScalar(r,c,i),h.add(e,i,i),i};Jr.trianglePlaneIntersection=function(e,t,n,i){let r=i.normal,o=i.distance,s=h.dot(r,e)+o<0,a=h.dot(r,t)+o<0,c=h.dot(r,n)+o<0,u=0;u+=s?1:0,u+=a?1:0,u+=c?1:0;let f,d;if((u===1||u===2)&&(f=new h,d=new h),u===1){if(s)return Jr.lineSegmentPlane(e,t,i,f),Jr.lineSegmentPlane(e,n,i,d),{positions:[e,t,n,f,d],indices:[0,3,4,1,2,4,1,4,3]};if(a)return Jr.lineSegmentPlane(t,n,i,f),Jr.lineSegmentPlane(t,e,i,d),{positions:[e,t,n,f,d],indices:[1,3,4,2,0,4,2,4,3]};if(c)return Jr.lineSegmentPlane(n,e,i,f),Jr.lineSegmentPlane(n,t,i,d),{positions:[e,t,n,f,d],indices:[2,3,4,0,1,4,0,4,3]}}else if(u===2)if(s)if(a){if(!c)return Jr.lineSegmentPlane(e,n,i,f),Jr.lineSegmentPlane(t,n,i,d),{positions:[e,t,n,f,d],indices:[0,1,4,0,4,3,2,3,4]}}else return Jr.lineSegmentPlane(n,t,i,f),Jr.lineSegmentPlane(e,t,i,d),{positions:[e,t,n,f,d],indices:[2,0,4,2,4,3,1,3,4]};else return Jr.lineSegmentPlane(t,e,i,f),Jr.lineSegmentPlane(n,e,i,d),{positions:[e,t,n,f,d],indices:[1,2,4,1,4,3,0,3,4]}};var xi=Jr;function va(e,t){this.normal=h.clone(e),this.distance=t}va.fromPointNormal=function(e,t,n){let i=-h.dot(t,e);return l(n)?(h.clone(t,n.normal),n.distance=i,n):new va(t,i)};var a4e=new h;va.fromCartesian4=function(e,t){let n=h.fromCartesian4(e,a4e),i=e.w;return l(t)?(h.clone(n,t.normal),t.distance=i,t):new va(n,i)};va.getPointDistance=function(e,t){return h.dot(e.normal,t)+e.distance};var c4e=new h;va.projectPointOntoPlane=function(e,t,n){l(n)||(n=new h);let i=va.getPointDistance(e,t),r=h.multiplyByScalar(e.normal,i,c4e);return h.subtract(t,r,n)};var l4e=new M,u4e=new se,f4e=new h;va.transform=function(e,t,n){let i=e.normal,r=e.distance,o=M.inverseTranspose(t,l4e),s=se.fromElements(i.x,i.y,i.z,r,u4e);s=M.multiplyByVector(o,s,s);let a=h.fromCartesian4(s,f4e);return s=se.divideByScalar(s,h.magnitude(a),s),va.fromCartesian4(s,n)};va.clone=function(e,t){return l(t)?(h.clone(e.normal,t.normal),t.distance=e.distance,t):new va(e.normal,e.distance)};va.equals=function(e,t){return e.distance===t.distance&&h.equals(e.normal,t.normal)};va.ORIGIN_XY_PLANE=Object.freeze(new va(h.UNIT_Z,0));va.ORIGIN_YZ_PLANE=Object.freeze(new va(h.UNIT_X,0));va.ORIGIN_ZX_PLANE=Object.freeze(new va(h.UNIT_Y,0));var sn=va;var $Y={};$Y.calculateACMR=function(e){e=e??H.EMPTY_OBJECT;let t=e.indices,n=e.maximumIndex,i=e.cacheSize??24,r=t.length;if(!l(n)){n=0;let a=0,c=t[a];for(;a<r;)c>n&&(n=c),++a,c=t[a]}let o=[];for(let a=0;a<n+1;a++)o[a]=0;let s=i+1;for(let a=0;a<r;++a)s-o[t[a]]>i&&(o[t[a]]=s,++s);return(s-i+1)/(r/3)};$Y.tipsify=function(e){e=e??H.EMPTY_OBJECT;let t=e.indices,n=e.maximumIndex,i=e.cacheSize??24,r;function o(_,C,w,D){for(;C.length>=1;){let N=C[C.length-1];if(C.splice(C.length-1,1),_[N].numLiveTriangles>0)return N}for(;r<D;){if(_[r].numLiveTriangles>0)return++r,r-1;++r}return-1}function s(_,C,w,D,N,F,V){let B=-1,j,k=-1,G=0;for(;G<w.length;){let q=w[G];D[q].numLiveTriangles&&(j=0,N-D[q].timeStamp+2*D[q].numLiveTriangles<=C&&(j=N-D[q].timeStamp),(j>k||k===-1)&&(k=j,B=q)),++G}return B===-1?o(D,F,_,V):B}let a=t.length,c=0,u=0,f=t[u],d=a;if(l(n))c=n+1;else{for(;u<d;)f>c&&(c=f),++u,f=t[u];if(c===-1)return 0;++c}let p=[],g;for(g=0;g<c;g++)p[g]={numLiveTriangles:0,timeStamp:0,vertexTriangles:[]};u=0;let m=0;for(;u<d;)p[t[u]].vertexTriangles.push(m),++p[t[u]].numLiveTriangles,p[t[u+1]].vertexTriangles.push(m),++p[t[u+1]].numLiveTriangles,p[t[u+2]].vertexTriangles.push(m),++p[t[u+2]].numLiveTriangles,++m,u+=3;let y=0,A=i+1;r=1;let b,x=[],T,E,v=0,S=[],I=a/3,R=[];for(g=0;g<I;g++)R[g]=!1;let O,L;for(;y!==-1;){b=[],E=p[y],L=E.vertexTriangles.length;for(let _=0;_<L;++_)if(m=E.vertexTriangles[_],!R[m]){R[m]=!0,u=m+m+m;for(let C=0;C<3;++C)O=t[u],b.push(O),x.push(O),S[v]=O,++v,T=p[O],--T.numLiveTriangles,A-T.timeStamp>i&&(T.timeStamp=A,++A),++u}y=s(t,i,b,p,A,x,c)}return S};var cL=$Y;var Cl={};function pL(e,t,n,i,r){e[t++]=n,e[t++]=i,e[t++]=i,e[t++]=r,e[t++]=r,e[t]=n}function d4e(e){let t=e.length,n=t/3*6,i=je.createTypedArray(t,n),r=0;for(let o=0;o<t;o+=3,r+=6)pL(i,r,e[o],e[o+1],e[o+2]);return i}function h4e(e){let t=e.length;if(t>=3){let n=(t-2)*6,i=je.createTypedArray(t,n);pL(i,0,e[0],e[1],e[2]);let r=6;for(let o=3;o<t;++o,r+=6)pL(i,r,e[o-1],e[o],e[o-2]);return i}return new Uint16Array}function m4e(e){if(e.length>0){let t=e.length-1,n=(t-1)*6,i=je.createTypedArray(t,n),r=e[0],o=0;for(let s=1;s<t;++s,o+=6)pL(i,o,r,e[s],e[s+1]);return i}return new Uint16Array}Cl.toWireframe=function(e){let t=e.indices;if(l(t)){switch(e.primitiveType){case Oe.TRIANGLES:e.indices=d4e(t);break;case Oe.TRIANGLE_STRIP:e.indices=h4e(t);break;case Oe.TRIANGLE_FAN:e.indices=m4e(t);break}e.primitiveType=Oe.LINES}return e};Cl.createLineSegmentsForVectors=function(e,t,n){t=t??"normal",n=n??1e4;let i=e.attributes.position.values,r=e.attributes[t].values,o=i.length,s=new Float64Array(2*o),a=0;for(let f=0;f<o;f+=3)s[a++]=i[f],s[a++]=i[f+1],s[a++]=i[f+2],s[a++]=i[f]+r[f]*n,s[a++]=i[f+1]+r[f+1]*n,s[a++]=i[f+2]+r[f+2]*n;let c,u=e.boundingSphere;return l(u)&&(c=new ue(u.center,u.radius+n)),new wt({attributes:{position:new Ne({componentDatatype:Y.DOUBLE,componentsPerAttribute:3,values:s})},primitiveType:Oe.LINES,boundingSphere:c})};Cl.createAttributeLocations=function(e){let t=["position","positionHigh","positionLow","position3DHigh","position3DLow","position2DHigh","position2DLow","pickColor","normal","st","tangent","bitangent","extrudeDirection","compressedAttributes"],n=e.attributes,i={},r=0,o,s=t.length;for(o=0;o<s;++o){let a=t[o];l(n[a])&&(i[a]=r++)}for(let a in n)n.hasOwnProperty(a)&&!l(i[a])&&(i[a]=r++);return i};Cl.reorderForPreVertexCache=function(e){let t=wt.computeNumberOfVertices(e),n=e.indices;if(l(n)){let i=new Int32Array(t);for(let p=0;p<t;p++)i[p]=-1;let r=n,o=r.length,s=je.createTypedArray(t,o),a=0,c=0,u=0,f;for(;a<o;)f=i[r[a]],f!==-1?s[c]=f:(f=r[a],i[f]=u,s[c]=u,++u),++a,++c;e.indices=s;let d=e.attributes;for(let p in d)if(d.hasOwnProperty(p)&&l(d[p])&&l(d[p].values)){let g=d[p],m=g.values,y=0,A=g.componentsPerAttribute,b=Y.createTypedArray(g.componentDatatype,u*A);for(;y<t;){let x=i[y];if(x!==-1)for(let T=0;T<A;T++)b[A*x+T]=m[A*y+T];++y}g.values=b}}return e};Cl.reorderForPostVertexCache=function(e,t){let n=e.indices;if(e.primitiveType===Oe.TRIANGLES&&l(n)){let i=n.length,r=0;for(let o=0;o<i;o++)n[o]>r&&(r=n[o]);e.indices=cL.tipsify({indices:n,maximumIndex:r,cacheSize:t})}return e};function oue(e){let t={};for(let n in e)if(e.hasOwnProperty(n)&&l(e[n])&&l(e[n].values)){let i=e[n];t[n]=new Ne({componentDatatype:i.componentDatatype,componentsPerAttribute:i.componentsPerAttribute,normalize:i.normalize,values:[]})}return t}function p4e(e,t,n){for(let i in t)if(t.hasOwnProperty(i)&&l(t[i])&&l(t[i].values)){let r=t[i];for(let o=0;o<r.componentsPerAttribute;++o)e[i].values.push(r.values[n*r.componentsPerAttribute+o])}}Cl.fitToUnsignedShortIndices=function(e){let t=[],n=wt.computeNumberOfVertices(e);if(l(e.indices)&&n>=P.SIXTY_FOUR_KILOBYTES){let i=[],r=[],o=0,s=oue(e.attributes),a=e.indices,c=a.length,u;e.primitiveType===Oe.TRIANGLES?u=3:e.primitiveType===Oe.LINES?u=2:e.primitiveType===Oe.POINTS&&(u=1);for(let f=0;f<c;f+=u){for(let d=0;d<u;++d){let p=a[f+d],g=i[p];l(g)||(g=o++,i[p]=g,p4e(s,e.attributes,p)),r.push(g)}o+u>=P.SIXTY_FOUR_KILOBYTES&&(t.push(new wt({attributes:s,indices:r,primitiveType:e.primitiveType,boundingSphere:e.boundingSphere,boundingSphereCV:e.boundingSphereCV})),i=[],r=[],o=0,s=oue(e.attributes))}r.length!==0&&t.push(new wt({attributes:s,indices:r,primitiveType:e.primitiveType,boundingSphere:e.boundingSphere,boundingSphereCV:e.boundingSphereCV}))}else t.push(e);return t};var sue=new h,g4e=new he;Cl.projectTo2D=function(e,t,n,i,r){let o=e.attributes[t];r=l(r)?r:new ji;let s=r.ellipsoid,a=o.values,c=new Float64Array(a.length),u=0;for(let f=0;f<a.length;f+=3){let d=h.fromArray(a,f,sue),p=s.cartesianToCartographic(d,g4e),g=r.project(p,sue);c[u++]=g.x,c[u++]=g.y,c[u++]=g.z}return e.attributes[n]=o,e.attributes[i]=new Ne({componentDatatype:Y.DOUBLE,componentsPerAttribute:3,values:c}),delete e.attributes[t],e};var JY={high:0,low:0};Cl.encodeAttribute=function(e,t,n,i){let r=e.attributes[t],o=r.values,s=o.length,a=new Float32Array(s),c=new Float32Array(s);for(let f=0;f<s;++f)Sn.encode(o[f],JY),a[f]=JY.high,c[f]=JY.low;let u=r.componentsPerAttribute;return e.attributes[n]=new Ne({componentDatatype:Y.FLOAT,componentsPerAttribute:u,values:a}),e.attributes[i]=new Ne({componentDatatype:Y.FLOAT,componentsPerAttribute:u,values:c}),delete e.attributes[t],e};var _h=new h;function ZY(e,t){if(l(t)){let n=t.values,i=n.length;for(let r=0;r<i;r+=3)h.unpack(n,r,_h),M.multiplyByPoint(e,_h,_h),h.pack(_h,n,r)}}function QY(e,t){if(l(t)){let n=t.values,i=n.length;for(let r=0;r<i;r+=3)h.unpack(n,r,_h),$.multiplyByVector(e,_h,_h),_h=h.normalize(_h,_h),h.pack(_h,n,r)}}var lL=new M,uL=new $;Cl.transformToWorldCoordinates=function(e){let t=e.modelMatrix;if(M.equals(t,M.IDENTITY))return e;let n=e.geometry.attributes;ZY(t,n.position),ZY(t,n.prevPosition),ZY(t,n.nextPosition),(l(n.normal)||l(n.tangent)||l(n.bitangent))&&(M.inverse(t,lL),M.transpose(lL,lL),M.getMatrix3(lL,uL),QY(uL,n.normal),QY(uL,n.tangent),QY(uL,n.bitangent));let i=e.geometry.boundingSphere;return l(i)&&(e.geometry.boundingSphere=ue.transform(i,t,i)),e.modelMatrix=M.clone(M.IDENTITY),e};function _4e(e,t){let n=e.length,i={},r=e[0][t].attributes,o;for(o in r)if(r.hasOwnProperty(o)&&l(r[o])&&l(r[o].values)){let s=r[o],a=s.values.length,c=!0;for(let u=1;u<n;++u){let f=e[u][t].attributes[o];if(!l(f)||s.componentDatatype!==f.componentDatatype||s.componentsPerAttribute!==f.componentsPerAttribute||s.normalize!==f.normalize){c=!1;break}a+=f.values.length}c&&(i[o]=new Ne({componentDatatype:s.componentDatatype,componentsPerAttribute:s.componentsPerAttribute,normalize:s.normalize,values:Y.createTypedArray(s.componentDatatype,a)}))}return i}var y4e=new h;function eX(e,t){let n=e.length,i,r,o,s,a=e[0].modelMatrix,c=l(e[0][t].indices),u=e[0][t].primitiveType,f=_4e(e,t),d,p,g;for(i in f)if(f.hasOwnProperty(i))for(d=f[i].values,s=0,r=0;r<n;++r)for(p=e[r][t].attributes[i].values,g=p.length,o=0;o<g;++o)d[s++]=p[o];let m;if(c){let x=0;for(r=0;r<n;++r)x+=e[r][t].indices.length;let T=wt.computeNumberOfVertices(new wt({attributes:f,primitiveType:Oe.POINTS})),E=je.createTypedArray(T,x),v=0,S=0;for(r=0;r<n;++r){let I=e[r][t].indices,R=I.length;for(s=0;s<R;++s)E[v++]=S+I[s];S+=wt.computeNumberOfVertices(e[r][t])}m=E}let y=new h,A=0,b;for(r=0;r<n;++r){if(b=e[r][t].boundingSphere,!l(b)){y=void 0;break}h.add(b.center,y,y)}if(l(y))for(h.divideByScalar(y,n,y),r=0;r<n;++r){b=e[r][t].boundingSphere;let x=h.magnitude(h.subtract(b.center,y,y4e))+b.radius;x>A&&(A=x)}return new wt({attributes:f,indices:m,primitiveType:u,boundingSphere:l(y)?new ue(y,A):void 0})}Cl.combineInstances=function(e){let t=[],n=[],i=e.length;for(let o=0;o<i;++o){let s=e[o];l(s.geometry)?t.push(s):l(s.westHemisphereGeometry)&&l(s.eastHemisphereGeometry)&&n.push(s)}let r=[];return t.length>0&&r.push(eX(t,"geometry")),n.length>0&&(r.push(eX(n,"westHemisphereGeometry")),r.push(eX(n,"eastHemisphereGeometry"))),r};var Qf=new h,$I=new h,UE=new h,zE=new h;Cl.computeNormal=function(e){let t=e.indices,n=e.attributes,i=n.position.values,r=n.position.values.length/3,o=t.length,s=new Array(r),a=new Array(o/3),c=new Array(o),u;for(u=0;u<r;u++)s[u]={indexOffset:0,count:0,currentCount:0};let f=0;for(u=0;u<o;u+=3){let m=t[u],y=t[u+1],A=t[u+2],b=m*3,x=y*3,T=A*3;$I.x=i[b],$I.y=i[b+1],$I.z=i[b+2],UE.x=i[x],UE.y=i[x+1],UE.z=i[x+2],zE.x=i[T],zE.y=i[T+1],zE.z=i[T+2],s[m].count++,s[y].count++,s[A].count++,h.subtract(UE,$I,UE),h.subtract(zE,$I,zE),a[f]=h.cross(UE,zE,new h),f++}let d=0;for(u=0;u<r;u++)s[u].indexOffset+=d,d+=s[u].count;f=0;let p;for(u=0;u<o;u+=3){p=s[t[u]];let m=p.indexOffset+p.currentCount;c[m]=f,p.currentCount++,p=s[t[u+1]],m=p.indexOffset+p.currentCount,c[m]=f,p.currentCount++,p=s[t[u+2]],m=p.indexOffset+p.currentCount,c[m]=f,p.currentCount++,f++}let g=new Float32Array(r*3);for(u=0;u<r;u++){let m=u*3;if(p=s[u],h.clone(h.ZERO,Qf),p.count>0){for(f=0;f<p.count;f++)h.add(Qf,a[c[p.indexOffset+f]],Qf);h.equalsEpsilon(h.ZERO,Qf,P.EPSILON10)&&h.clone(a[c[p.indexOffset]],Qf)}h.equalsEpsilon(h.ZERO,Qf,P.EPSILON10)&&(Qf.z=1),h.normalize(Qf,Qf),g[m]=Qf.x,g[m+1]=Qf.y,g[m+2]=Qf.z}return e.attributes.normal=new Ne({componentDatatype:Y.FLOAT,componentsPerAttribute:3,values:g}),e};var A4e=new h,aue=new h,b4e=new h;Cl.computeTangentAndBitangent=function(e){let t=e.attributes,n=e.indices,i=e.attributes.position.values,r=e.attributes.normal.values,o=e.attributes.st.values,s=e.attributes.position.values.length/3,a=n.length,c=new Array(s*3),u;for(u=0;u<c.length;u++)c[u]=0;let f,d,p;for(u=0;u<a;u+=3){let y=n[u],A=n[u+1],b=n[u+2];f=y*3,d=A*3,p=b*3;let x=y*2,T=A*2,E=b*2,v=i[f],S=i[f+1],I=i[f+2],R=o[x],O=o[x+1],L=o[T+1]-O,_=o[E+1]-O,C=1/((o[T]-R)*_-(o[E]-R)*L),w=(_*(i[d]-v)-L*(i[p]-v))*C,D=(_*(i[d+1]-S)-L*(i[p+1]-S))*C,N=(_*(i[d+2]-I)-L*(i[p+2]-I))*C;c[f]+=w,c[f+1]+=D,c[f+2]+=N,c[d]+=w,c[d+1]+=D,c[d+2]+=N,c[p]+=w,c[p+1]+=D,c[p+2]+=N}let g=new Float32Array(s*3),m=new Float32Array(s*3);for(u=0;u<s;u++){f=u*3,d=f+1,p=f+2;let y=h.fromArray(r,f,A4e),A=h.fromArray(c,f,b4e),b=h.dot(y,A);h.multiplyByScalar(y,b,aue),h.normalize(h.subtract(A,aue,A),A),g[f]=A.x,g[d]=A.y,g[p]=A.z,h.normalize(h.cross(y,A,A),A),m[f]=A.x,m[d]=A.y,m[p]=A.z}return e.attributes.tangent=new Ne({componentDatatype:Y.FLOAT,componentsPerAttribute:3,values:g}),e.attributes.bitangent=new Ne({componentDatatype:Y.FLOAT,componentsPerAttribute:3,values:m}),e};var JI=new U,gh=new h,cue=new h,lue=new h,fL=new U;Cl.compressVertices=function(e){let t=e.attributes.extrudeDirection,n,i;if(l(t)){let S=t.values;i=S.length/3;let I=new Float32Array(i*2),R=0;for(n=0;n<i;++n){if(h.fromArray(S,n*3,gh),h.equals(gh,h.ZERO)){R+=2;continue}fL=cn.octEncodeInRange(gh,65535,fL),I[R++]=fL.x,I[R++]=fL.y}return e.attributes.compressedAttributes=new Ne({componentDatatype:Y.FLOAT,componentsPerAttribute:2,values:I}),delete e.attributes.extrudeDirection,e}let r=e.attributes.normal,o=e.attributes.st,s=l(r),a=l(o);if(!s&&!a)return e;let c=e.attributes.tangent,u=e.attributes.bitangent,f=l(c),d=l(u),p,g,m,y;s&&(p=r.values),a&&(g=o.values),f&&(m=c.values),d&&(y=u.values),i=(s?p.length:g.length)/(s?3:2);let x=i,T=a&&s?2:1;T+=f||d?1:0,x*=T;let E=new Float32Array(x),v=0;for(n=0;n<i;++n){a&&(U.fromArray(g,n*2,JI),E[v++]=cn.compressTextureCoordinates(JI));let S=n*3;s&&l(m)&&l(y)?(h.fromArray(p,S,gh),h.fromArray(m,S,cue),h.fromArray(y,S,lue),cn.octPack(gh,cue,lue,JI),E[v++]=JI.x,E[v++]=JI.y):(s&&(h.fromArray(p,S,gh),E[v++]=cn.octEncodeFloat(gh)),f&&(h.fromArray(m,S,gh),E[v++]=cn.octEncodeFloat(gh)),d&&(h.fromArray(y,S,gh),E[v++]=cn.octEncodeFloat(gh)))}return e.attributes.compressedAttributes=new Ne({componentDatatype:Y.FLOAT,componentsPerAttribute:T,values:E}),s&&delete e.attributes.normal,a&&delete e.attributes.st,d&&delete e.attributes.bitangent,f&&delete e.attributes.tangent,e};function x4e(e){if(l(e.indices))return e;let t=wt.computeNumberOfVertices(e),n=je.createTypedArray(t,t);for(let i=0;i<t;++i)n[i]=i;return e.indices=n,e}function T4e(e){let t=wt.computeNumberOfVertices(e),n=je.createTypedArray(t,(t-2)*3);n[0]=1,n[1]=0,n[2]=2;let i=3;for(let r=3;r<t;++r)n[i++]=r-1,n[i++]=0,n[i++]=r;return e.indices=n,e.primitiveType=Oe.TRIANGLES,e}function E4e(e){let t=wt.computeNumberOfVertices(e),n=je.createTypedArray(t,(t-2)*3);n[0]=0,n[1]=1,n[2]=2,t>3&&(n[3]=0,n[4]=2,n[5]=3);let i=6;for(let r=3;r<t-1;r+=2)n[i++]=r,n[i++]=r-1,n[i++]=r+1,r+2<t&&(n[i++]=r,n[i++]=r+1,n[i++]=r+2);return e.indices=n,e.primitiveType=Oe.TRIANGLES,e}function C4e(e){if(l(e.indices))return e;let t=wt.computeNumberOfVertices(e),n=je.createTypedArray(t,t);for(let i=0;i<t;++i)n[i]=i;return e.indices=n,e}function v4e(e){let t=wt.computeNumberOfVertices(e),n=je.createTypedArray(t,(t-1)*2);n[0]=0,n[1]=1;let i=2;for(let r=2;r<t;++r)n[i++]=r-1,n[i++]=r;return e.indices=n,e.primitiveType=Oe.LINES,e}function S4e(e){let t=wt.computeNumberOfVertices(e),n=je.createTypedArray(t,t*2);n[0]=0,n[1]=1;let i=2;for(let r=2;r<t;++r)n[i++]=r-1,n[i++]=r;return n[i++]=t-1,n[i]=0,e.indices=n,e.primitiveType=Oe.LINES,e}function w4e(e){switch(e.primitiveType){case Oe.TRIANGLE_FAN:return T4e(e);case Oe.TRIANGLE_STRIP:return E4e(e);case Oe.TRIANGLES:return x4e(e);case Oe.LINE_STRIP:return v4e(e);case Oe.LINE_LOOP:return S4e(e);case Oe.LINES:return C4e(e)}return e}function R_(e,t){Math.abs(e.y)<P.EPSILON6&&(t?e.y=-P.EPSILON6:e.y=P.EPSILON6)}function I4e(e,t,n){if(e.y!==0&&t.y!==0&&n.y!==0){R_(e,e.y<0),R_(t,t.y<0),R_(n,n.y<0);return}let i=Math.abs(e.y),r=Math.abs(t.y),o=Math.abs(n.y),s;i>r?i>o?s=P.sign(e.y):s=P.sign(n.y):r>o?s=P.sign(t.y):s=P.sign(n.y);let a=s<0;R_(e,a),R_(t,a),R_(n,a)}var uue=new h;function ed(e,t,n,i){h.add(e,h.multiplyByScalar(h.subtract(t,e,uue),e.y/(e.y-t.y),uue),n),h.clone(n,i),R_(n,!0),R_(i,!1)}var Cb=new h,vb=new h,Sb=new h,wb=new h,tX={positions:new Array(7),indices:new Array(9)};function P4e(e,t,n){if(e.x>=0||t.x>=0||n.x>=0)return;I4e(e,t,n);let i=e.y<0,r=t.y<0,o=n.y<0,s=0;s+=i?1:0,s+=r?1:0,s+=o?1:0;let a=tX.indices;s===1?(a[1]=3,a[2]=4,a[5]=6,a[7]=6,a[8]=5,i?(ed(e,t,Cb,Sb),ed(e,n,vb,wb),a[0]=0,a[3]=1,a[4]=2,a[6]=1):r?(ed(t,n,Cb,Sb),ed(t,e,vb,wb),a[0]=1,a[3]=2,a[4]=0,a[6]=2):o&&(ed(n,e,Cb,Sb),ed(n,t,vb,wb),a[0]=2,a[3]=0,a[4]=1,a[6]=0)):s===2&&(a[2]=4,a[4]=4,a[5]=3,a[7]=5,a[8]=6,i?r?o||(ed(n,e,Cb,Sb),ed(n,t,vb,wb),a[0]=0,a[1]=1,a[3]=0,a[6]=2):(ed(t,n,Cb,Sb),ed(t,e,vb,wb),a[0]=2,a[1]=0,a[3]=2,a[6]=1):(ed(e,t,Cb,Sb),ed(e,n,vb,wb),a[0]=1,a[1]=2,a[3]=1,a[6]=0));let c=tX.positions;return c[0]=e,c[1]=t,c[2]=n,c.length=3,(s===1||s===2)&&(c[3]=Cb,c[4]=vb,c[5]=Sb,c[6]=wb,c.length=7),tX}function fue(e,t){let n=e.attributes;if(n.position.values.length===0)return;for(let r in n)if(n.hasOwnProperty(r)&&l(n[r])&&l(n[r].values)){let o=n[r];o.values=Y.createTypedArray(o.componentDatatype,o.values)}let i=wt.computeNumberOfVertices(e);return e.indices=je.createTypedArray(i,e.indices),t&&(e.boundingSphere=ue.fromVertices(n.position.values)),e}function jE(e){let t=e.attributes,n={};for(let i in t)if(t.hasOwnProperty(i)&&l(t[i])&&l(t[i].values)){let r=t[i];n[i]=new Ne({componentDatatype:r.componentDatatype,componentsPerAttribute:r.componentsPerAttribute,normalize:r.normalize,values:[]})}return new wt({attributes:n,indices:[],primitiveType:e.primitiveType})}function oX(e,t,n){let i=l(e.geometry.boundingSphere);t=fue(t,i),n=fue(n,i),l(n)&&!l(t)?e.geometry=n:!l(n)&&l(t)?e.geometry=t:(e.westHemisphereGeometry=t,e.eastHemisphereGeometry=n,e.geometry=void 0)}function sX(e,t){let n=new e,i=new e,r=new e;return function(o,s,a,c,u,f,d,p){let g=e.fromArray(u,o*t,n),m=e.fromArray(u,s*t,i),y=e.fromArray(u,a*t,r);e.multiplyByScalar(g,c.x,g),e.multiplyByScalar(m,c.y,m),e.multiplyByScalar(y,c.z,y);let A=e.add(g,m,g);e.add(A,y,A),p&&e.normalize(A,A),e.pack(A,f,d*t)}}var D4e=sX(se,4),mL=sX(h,3),_ue=sX(U,2),R4e=function(e,t,n,i,r,o,s){let a=r[e]*i.x,c=r[t]*i.y,u=r[n]*i.z;o[s]=a+c+u>P.EPSILON6?1:0},ZI=new h,nX=new h,iX=new h,O4e=new h;function dL(e,t,n,i,r,o,s,a,c,u,f,d,p,g,m,y){if(!l(o)&&!l(s)&&!l(a)&&!l(c)&&!l(u)&&g===0)return;let A=h.fromArray(r,e*3,ZI),b=h.fromArray(r,t*3,nX),x=h.fromArray(r,n*3,iX),T=BE(i,A,b,x,O4e);if(l(T)){if(l(o)&&mL(e,t,n,T,o,d.normal.values,y,!0),l(u)){let E=h.fromArray(u,e*3,ZI),v=h.fromArray(u,t*3,nX),S=h.fromArray(u,n*3,iX);h.multiplyByScalar(E,T.x,E),h.multiplyByScalar(v,T.y,v),h.multiplyByScalar(S,T.z,S);let I;!h.equals(E,h.ZERO)||!h.equals(v,h.ZERO)||!h.equals(S,h.ZERO)?(I=h.add(E,v,E),h.add(I,S,I),h.normalize(I,I)):(I=ZI,I.x=0,I.y=0,I.z=0),h.pack(I,d.extrudeDirection.values,y*3)}if(l(f)&&R4e(e,t,n,T,f,d.applyOffset.values,y),l(s)&&mL(e,t,n,T,s,d.tangent.values,y,!0),l(a)&&mL(e,t,n,T,a,d.bitangent.values,y,!0),l(c)&&_ue(e,t,n,T,c,d.st.values,y),g>0)for(let E=0;E<g;E++){let v=p[E];M4e(e,t,n,T,y,m[v],d[v])}}}function M4e(e,t,n,i,r,o,s){let a=o.componentsPerAttribute,c=o.values,u=s.values;switch(a){case 4:D4e(e,t,n,i,c,u,r,!1);break;case 3:mL(e,t,n,i,c,u,r,!1);break;case 2:_ue(e,t,n,i,c,u,r,!1);break;default:u[r]=c[e]*i.x+c[t]*i.y+c[n]*i.z}}function qm(e,t,n,i,r,o){let s=e.position.values.length/3;if(r!==-1){let a=i[r],c=n[a];return c===-1?(n[a]=s,e.position.values.push(o.x,o.y,o.z),t.push(s),s):(t.push(c),c)}return e.position.values.push(o.x,o.y,o.z),t.push(s),s}var N4e={position:!0,normal:!0,bitangent:!0,tangent:!0,st:!0,extrudeDirection:!0,applyOffset:!0};function due(e){let t=e.geometry,n=t.attributes,i=n.position.values,r=l(n.normal)?n.normal.values:void 0,o=l(n.bitangent)?n.bitangent.values:void 0,s=l(n.tangent)?n.tangent.values:void 0,a=l(n.st)?n.st.values:void 0,c=l(n.extrudeDirection)?n.extrudeDirection.values:void 0,u=l(n.applyOffset)?n.applyOffset.values:void 0,f=t.indices,d=[];for(let I in n)n.hasOwnProperty(I)&&!N4e[I]&&l(n[I])&&d.push(I);let p=d.length,g=jE(t),m=jE(t),y,A,b,x,T,E=[];E.length=i.length/3;let v=[];for(v.length=i.length/3,T=0;T<E.length;++T)E[T]=-1,v[T]=-1;let S=f.length;for(T=0;T<S;T+=3){let I=f[T],R=f[T+1],O=f[T+2],L=h.fromArray(i,I*3),_=h.fromArray(i,R*3),C=h.fromArray(i,O*3),w=P4e(L,_,C);if(l(w)&&w.positions.length>3){let D=w.positions,N=w.indices,F=N.length;for(let V=0;V<F;++V){let B=N[V],j=D[B];j.y<0?(y=m.attributes,A=m.indices,b=E):(y=g.attributes,A=g.indices,b=v),x=qm(y,A,b,f,B<3?T+B:-1,j),dL(I,R,O,j,i,r,s,o,a,c,u,y,d,p,n,x)}}else l(w)&&(L=w.positions[0],_=w.positions[1],C=w.positions[2]),L.y<0?(y=m.attributes,A=m.indices,b=E):(y=g.attributes,A=g.indices,b=v),x=qm(y,A,b,f,T,L),dL(I,R,O,L,i,r,s,o,a,c,u,y,d,p,n,x),x=qm(y,A,b,f,T+1,_),dL(I,R,O,_,i,r,s,o,a,c,u,y,d,p,n,x),x=qm(y,A,b,f,T+2,C),dL(I,R,O,C,i,r,s,o,a,c,u,y,d,p,n,x)}oX(e,m,g)}var yue=sn.fromPointNormal(h.ZERO,h.UNIT_Y),L4e=new h,F4e=new h;function VE(e,t,n,i,r,o,s){if(!l(s))return;let a=h.fromArray(i,e*3,ZI);h.equalsEpsilon(a,n,P.EPSILON10)?o.applyOffset.values[r]=s[e]:o.applyOffset.values[r]=s[t]}function hue(e){let t=e.geometry,n=t.attributes,i=n.position.values,r=l(n.applyOffset)?n.applyOffset.values:void 0,o=t.indices,s=jE(t),a=jE(t),c,u=o.length,f=[];f.length=i.length/3;let d=[];for(d.length=i.length/3,c=0;c<f.length;++c)f[c]=-1,d[c]=-1;for(c=0;c<u;c+=2){let p=o[c],g=o[c+1],m=h.fromArray(i,p*3,ZI),y=h.fromArray(i,g*3,nX),A;Math.abs(m.y)<P.EPSILON6&&(m.y<0?m.y=-P.EPSILON6:m.y=P.EPSILON6),Math.abs(y.y)<P.EPSILON6&&(y.y<0?y.y=-P.EPSILON6:y.y=P.EPSILON6);let b=s.attributes,x=s.indices,T=d,E=a.attributes,v=a.indices,S=f,I=xi.lineSegmentPlane(m,y,yue,iX);if(l(I)){let R=h.multiplyByScalar(h.UNIT_Y,5*P.EPSILON9,L4e);m.y<0&&(h.negate(R,R),b=a.attributes,x=a.indices,T=f,E=s.attributes,v=s.indices,S=d);let O=h.add(I,R,F4e);A=qm(b,x,T,o,c,m),VE(p,g,m,i,A,b,r),A=qm(b,x,T,o,-1,O),VE(p,g,O,i,A,b,r),h.negate(R,R),h.add(I,R,O),A=qm(E,v,S,o,-1,O),VE(p,g,O,i,A,E,r),A=qm(E,v,S,o,c+1,y),VE(p,g,y,i,A,E,r)}else{let R,O,L;m.y<0?(R=a.attributes,O=a.indices,L=f):(R=s.attributes,O=s.indices,L=d),A=qm(R,O,L,o,c,m),VE(p,g,m,i,A,R,r),A=qm(R,O,L,o,c+1,y),VE(p,g,y,i,A,R,r)}}oX(e,a,s)}var mue=new U,B4e=new U,Aue=new h,bue=new h,rX=new h,k4e=new h,U4e=new h,z4e=new h,pue=new se;function gue(e){let t=e.attributes,n=t.position.values,i=t.prevPosition.values,r=t.nextPosition.values,o=n.length;for(let s=0;s<o;s+=3){let a=h.unpack(n,s,Aue);if(a.x>0)continue;let c=h.unpack(i,s,bue);(a.y<0&&c.y>0||a.y>0&&c.y<0)&&(s-3>0?(i[s]=n[s-3],i[s+1]=n[s-2],i[s+2]=n[s-1]):h.pack(a,i,s));let u=h.unpack(r,s,rX);(a.y<0&&u.y>0||a.y>0&&u.y<0)&&(s+3<o?(r[s]=n[s+3],r[s+1]=n[s+4],r[s+2]=n[s+5]):h.pack(a,r,s))}}var V4e=5*P.EPSILON9,hL=P.EPSILON6;function j4e(e){let t=e.geometry,n=t.attributes,i=n.position.values,r=n.prevPosition.values,o=n.nextPosition.values,s=n.expandAndWidth.values,a=l(n.st)?n.st.values:void 0,c=l(n.color)?n.color.values:void 0,u=jE(t),f=jE(t),d,p,g,m=!1,y=i.length/3;for(d=0;d<y;d+=4){let A=d,b=d+2,x=h.fromArray(i,A*3,Aue),T=h.fromArray(i,b*3,bue);if(Math.abs(x.y)<hL)for(x.y=hL*(T.y<0?-1:1),i[d*3+1]=x.y,i[(d+1)*3+1]=x.y,p=A*3;p<A*3+12;p+=3)r[p]=i[d*3],r[p+1]=i[d*3+1],r[p+2]=i[d*3+2];if(Math.abs(T.y)<hL)for(T.y=hL*(x.y<0?-1:1),i[(d+2)*3+1]=T.y,i[(d+3)*3+1]=T.y,p=A*3;p<A*3+12;p+=3)o[p]=i[(d+2)*3],o[p+1]=i[(d+2)*3+1],o[p+2]=i[(d+2)*3+2];let E=u.attributes,v=u.indices,S=f.attributes,I=f.indices,R=xi.lineSegmentPlane(x,T,yue,k4e);if(l(R)){m=!0;let O=h.multiplyByScalar(h.UNIT_Y,V4e,U4e);x.y<0&&(h.negate(O,O),E=f.attributes,v=f.indices,S=u.attributes,I=u.indices);let L=h.add(R,O,z4e);E.position.values.push(x.x,x.y,x.z,x.x,x.y,x.z),E.position.values.push(L.x,L.y,L.z),E.position.values.push(L.x,L.y,L.z),E.prevPosition.values.push(r[A*3],r[A*3+1],r[A*3+2]),E.prevPosition.values.push(r[A*3+3],r[A*3+4],r[A*3+5]),E.prevPosition.values.push(x.x,x.y,x.z,x.x,x.y,x.z),E.nextPosition.values.push(L.x,L.y,L.z),E.nextPosition.values.push(L.x,L.y,L.z),E.nextPosition.values.push(L.x,L.y,L.z),E.nextPosition.values.push(L.x,L.y,L.z),h.negate(O,O),h.add(R,O,L),S.position.values.push(L.x,L.y,L.z),S.position.values.push(L.x,L.y,L.z),S.position.values.push(T.x,T.y,T.z,T.x,T.y,T.z),S.prevPosition.values.push(L.x,L.y,L.z),S.prevPosition.values.push(L.x,L.y,L.z),S.prevPosition.values.push(L.x,L.y,L.z),S.prevPosition.values.push(L.x,L.y,L.z),S.nextPosition.values.push(T.x,T.y,T.z,T.x,T.y,T.z),S.nextPosition.values.push(o[b*3],o[b*3+1],o[b*3+2]),S.nextPosition.values.push(o[b*3+3],o[b*3+4],o[b*3+5]);let _=U.fromArray(s,A*2,mue),C=Math.abs(_.y);E.expandAndWidth.values.push(-1,C,1,C),E.expandAndWidth.values.push(-1,-C,1,-C),S.expandAndWidth.values.push(-1,C,1,C),S.expandAndWidth.values.push(-1,-C,1,-C);let w=h.magnitudeSquared(h.subtract(R,x,rX));if(w/=h.magnitudeSquared(h.subtract(T,x,rX)),l(c)){let D=se.fromArray(c,A*4,pue),N=se.fromArray(c,b*4,pue),F=P.lerp(D.x,N.x,w),V=P.lerp(D.y,N.y,w),B=P.lerp(D.z,N.z,w),j=P.lerp(D.w,N.w,w);for(p=A*4;p<A*4+8;++p)E.color.values.push(c[p]);for(E.color.values.push(F,V,B,j),E.color.values.push(F,V,B,j),S.color.values.push(F,V,B,j),S.color.values.push(F,V,B,j),p=b*4;p<b*4+8;++p)S.color.values.push(c[p])}if(l(a)){let D=U.fromArray(a,A*2,mue),N=U.fromArray(a,(d+3)*2,B4e),F=P.lerp(D.x,N.x,w);for(p=A*2;p<A*2+4;++p)E.st.values.push(a[p]);for(E.st.values.push(F,D.y),E.st.values.push(F,N.y),S.st.values.push(F,D.y),S.st.values.push(F,N.y),p=b*2;p<b*2+4;++p)S.st.values.push(a[p])}g=E.position.values.length/3-4,v.push(g,g+2,g+1),v.push(g+1,g+2,g+3),g=S.position.values.length/3-4,I.push(g,g+2,g+1),I.push(g+1,g+2,g+3)}else{let O,L;for(x.y<0?(O=f.attributes,L=f.indices):(O=u.attributes,L=u.indices),O.position.values.push(x.x,x.y,x.z),O.position.values.push(x.x,x.y,x.z),O.position.values.push(T.x,T.y,T.z),O.position.values.push(T.x,T.y,T.z),p=d*3;p<d*3+12;++p)O.prevPosition.values.push(r[p]),O.nextPosition.values.push(o[p]);for(p=d*2;p<d*2+8;++p)O.expandAndWidth.values.push(s[p]),l(a)&&O.st.values.push(a[p]);if(l(c))for(p=d*4;p<d*4+16;++p)O.color.values.push(c[p]);g=O.position.values.length/3-4,L.push(g,g+2,g+1),L.push(g+1,g+2,g+3)}}m&&(gue(f),gue(u)),oX(e,f,u)}Cl.splitLongitude=function(e){let t=e.geometry,n=t.boundingSphere;if(l(n)&&(n.center.x-n.radius>0||ue.intersectPlane(n,sn.ORIGIN_ZX_PLANE)!==$t.INTERSECTING))return e;if(t.geometryType!==mh.NONE)switch(t.geometryType){case mh.POLYLINES:j4e(e);break;case mh.TRIANGLES:due(e);break;case mh.LINES:hue(e);break}else w4e(t),t.primitiveType===Oe.TRIANGLES?due(e):t.primitiveType===Oe.LINES&&hue(e);return e};var Wn=Cl;function QI(e,t,n,i,r,o,s,a,c,u,f){this._context=e,this._texture=t,this._textureTarget=n,this._targetFace=i,this._pixelDatatype=s,this._internalFormat=r,this._pixelFormat=o,this._size=a,this._preMultiplyAlpha=c,this._flipY=u,this._initialized=f}Object.defineProperties(QI.prototype,{pixelFormat:{get:function(){return this._pixelFormat}},pixelDatatype:{get:function(){return this._pixelDatatype}},_target:{get:function(){return this._targetFace}}});QI.prototype.copyFrom=function(e){let{xOffset:t=0,yOffset:n=0,source:i,skipColorSpaceConversion:r=!1}=e,{width:o,height:s}=i,a=this._context._gl,c=this._textureTarget,u=this._targetFace;a.activeTexture(a.TEXTURE0),a.bindTexture(c,this._texture);let f=i.arrayBufferView,d=this._size,p=this._pixelFormat,g=this._internalFormat,m=this._pixelDatatype,y=this._preMultiplyAlpha,A=this._flipY,b=4;l(f)&&(b=$e.alignmentInBytes(p,m,o)),a.pixelStorei(a.UNPACK_ALIGNMENT,b),r?a.pixelStorei(a.UNPACK_COLORSPACE_CONVERSION_WEBGL,a.NONE):a.pixelStorei(a.UNPACK_COLORSPACE_CONVERSION_WEBGL,a.BROWSER_DEFAULT_WEBGL);let x=!1;if(!this._initialized){let T;t===0&&n===0&&o===d&&s===d?(l(f)?(a.pixelStorei(a.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!1),a.pixelStorei(a.UNPACK_FLIP_Y_WEBGL,!1),A&&(f=$e.flipY(f,p,m,d,d)),T=f):(a.pixelStorei(a.UNPACK_PREMULTIPLY_ALPHA_WEBGL,y),a.pixelStorei(a.UNPACK_FLIP_Y_WEBGL,A),T=i),x=!0):(a.pixelStorei(a.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!1),a.pixelStorei(a.UNPACK_FLIP_Y_WEBGL,!1),T=$e.createTypedArray(p,m,d,d)),a.texImage2D(u,0,g,d,d,0,p,ze.toWebGLConstant(m,this._context),T),this._initialized=!0}x||(l(f)?(a.pixelStorei(a.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!1),a.pixelStorei(a.UNPACK_FLIP_Y_WEBGL,!1),A&&(f=$e.flipY(f,p,m,o,s)),a.texSubImage2D(u,0,t,n,o,s,p,ze.toWebGLConstant(m,this._context),f)):(a.pixelStorei(a.UNPACK_PREMULTIPLY_ALPHA_WEBGL,y),a.pixelStorei(a.UNPACK_FLIP_Y_WEBGL,A),a.texSubImage2D(u,0,t,n,p,ze.toWebGLConstant(m,this._context),i))),a.bindTexture(c,null)};QI.prototype.copyFromFramebuffer=function(e,t,n,i,r,o){e=e??0,t=t??0,n=n??0,i=i??0,r=r??this._size,o=o??this._size;let s=this._context._gl,a=this._textureTarget;s.activeTexture(s.TEXTURE0),s.bindTexture(a,this._texture),s.copyTexSubImage2D(this._targetFace,0,e,t,n,i,r,o),s.bindTexture(a,null),this._initialized=!0};QI.prototype.copyMipmapFromFramebuffer=function(e,t,n,i,r){e=e??0,t=t??0,n=n??this._size,i=i??this._size,r=r??0;let o=this._context._gl,s=this._textureTarget;o.activeTexture(o.TEXTURE0),o.bindTexture(s,this._texture),o.copyTexImage2D(this._targetFace,r,this._internalFormat,e,t,n,i,0),o.bindTexture(s,null),this._initialized=!0};var gL=QI;var eP={DONT_CARE:te.DONT_CARE,FASTEST:te.FASTEST,NICEST:te.NICEST,validate:function(e){return e===eP.DONT_CARE||e===eP.FASTEST||e===eP.NICEST}};Object.freeze(eP);var yh=eP;var tP={NEAREST:te.NEAREST,LINEAR:te.LINEAR};tP.validate=function(e){return e===tP.NEAREST||e===tP.LINEAR};Object.freeze(tP);var Jn=tP;var U0={NEAREST:te.NEAREST,LINEAR:te.LINEAR,NEAREST_MIPMAP_NEAREST:te.NEAREST_MIPMAP_NEAREST,LINEAR_MIPMAP_NEAREST:te.LINEAR_MIPMAP_NEAREST,NEAREST_MIPMAP_LINEAR:te.NEAREST_MIPMAP_LINEAR,LINEAR_MIPMAP_LINEAR:te.LINEAR_MIPMAP_LINEAR};U0.validate=function(e){return e===U0.NEAREST||e===U0.LINEAR||e===U0.NEAREST_MIPMAP_NEAREST||e===U0.LINEAR_MIPMAP_NEAREST||e===U0.NEAREST_MIPMAP_LINEAR||e===U0.LINEAR_MIPMAP_LINEAR};Object.freeze(U0);var Wt=U0;var nP={CLAMP_TO_EDGE:te.CLAMP_TO_EDGE,REPEAT:te.REPEAT,MIRRORED_REPEAT:te.MIRRORED_REPEAT,validate:function(e){return e===nP.CLAMP_TO_EDGE||e===nP.REPEAT||e===nP.MIRRORED_REPEAT}};Object.freeze(nP);var hn=nP;function iP(e){e=e??H.EMPTY_OBJECT;let{wrapR:t=hn.CLAMP_TO_EDGE,wrapS:n=hn.CLAMP_TO_EDGE,wrapT:i=hn.CLAMP_TO_EDGE,minificationFilter:r=Wt.LINEAR,magnificationFilter:o=Jn.LINEAR,maximumAnisotropy:s=1}=e;this._wrapR=t,this._wrapS=n,this._wrapT=i,this._minificationFilter=r,this._magnificationFilter=o,this._maximumAnisotropy=s}Object.defineProperties(iP.prototype,{wrapR:{get:function(){return this._wrapR}},wrapS:{get:function(){return this._wrapS}},wrapT:{get:function(){return this._wrapT}},minificationFilter:{get:function(){return this._minificationFilter}},magnificationFilter:{get:function(){return this._magnificationFilter}},maximumAnisotropy:{get:function(){return this._maximumAnisotropy}}});iP.equals=function(e,t){return e===t||l(e)&&l(t)&&e._wrapR===t._wrapR&&e._wrapS===t._wrapS&&e._wrapT===t._wrapT&&e._minificationFilter===t._minificationFilter&&e._magnificationFilter===t._magnificationFilter&&e._maximumAnisotropy===t._maximumAnisotropy};iP.NEAREST=Object.freeze(new iP({wrapR:hn.CLAMP_TO_EDGE,wrapS:hn.CLAMP_TO_EDGE,wrapT:hn.CLAMP_TO_EDGE,minificationFilter:Wt.NEAREST,magnificationFilter:Jn.NEAREST}));var Ht=iP;function H4e(e,t){if(!e)throw new pe(t)}var xue=H4e;function G4e(e,t,n,i){let r=l(t.vertexBuffer),o=l(t.value),s=t.value?t.value.length:t.componentsPerAttribute,a={index:t.index??n,enabled:t.enabled??!0,vertexBuffer:t.vertexBuffer,value:o?t.value.slice(0):void 0,componentsPerAttribute:s,componentDatatype:t.componentDatatype??Y.FLOAT,normalize:t.normalize??!1,offsetInBytes:t.offsetInBytes??0,strideInBytes:t.strideInBytes??0,instanceDivisor:t.instanceDivisor??0};if(r)a.vertexAttrib=function(c){let u=this.index;c.bindBuffer(c.ARRAY_BUFFER,this.vertexBuffer._getBuffer()),c.vertexAttribPointer(u,this.componentsPerAttribute,this.componentDatatype,this.normalize,this.strideInBytes,this.offsetInBytes),c.enableVertexAttribArray(u),this.instanceDivisor>0&&(i.glVertexAttribDivisor(u,this.instanceDivisor),i._vertexAttribDivisors[u]=this.instanceDivisor,i._previousDrawInstanced=!0)},a.disableVertexAttribArray=function(c){c.disableVertexAttribArray(this.index),this.instanceDivisor>0&&i.glVertexAttribDivisor(n,0)};else{switch(a.componentsPerAttribute){case 1:a.vertexAttrib=function(c){c.vertexAttrib1fv(this.index,this.value)};break;case 2:a.vertexAttrib=function(c){c.vertexAttrib2fv(this.index,this.value)};break;case 3:a.vertexAttrib=function(c){c.vertexAttrib3fv(this.index,this.value)};break;case 4:a.vertexAttrib=function(c){c.vertexAttrib4fv(this.index,this.value)};break}a.disableVertexAttribArray=function(c){}}e.push(a)}function Eue(e,t,n){for(let i=0;i<t.length;++i){let r=t[i];r.enabled&&r.vertexAttrib(e)}l(n)&&e.bindBuffer(e.ELEMENT_ARRAY_BUFFER,n._getBuffer())}function Ah(e){e=e??H.EMPTY_OBJECT;let t=e.context,n=t._gl,i=e.attributes,r=e.indexBuffer,o,s=[],a=1,c=!1,u=!1,f=i.length;for(o=0;o<f;++o)G4e(s,i[o],o,t);for(f=s.length,o=0;o<f;++o){let p=s[o];if(l(p.vertexBuffer)&&p.instanceDivisor===0){let g=p.strideInBytes||p.componentsPerAttribute*Y.getSizeInBytes(p.componentDatatype);a=p.vertexBuffer.sizeInBytes/g;break}}for(o=0;o<f;++o)s[o].instanceDivisor>0&&(c=!0),l(s[o].value)&&(u=!0);let d;t.vertexArrayObject&&(d=t.glCreateVertexArray(),t.glBindVertexArray(d),Eue(n,s,r),t.glBindVertexArray(null)),this._numberOfVertices=a,this._hasInstancedAttributes=c,this._hasConstantAttributes=u,this._context=t,this._gl=n,this._vao=d,this._attributes=s,this._indexBuffer=r}function Tue(e){return e.values.length/e.componentsPerAttribute}function W4e(e){return Y.getSizeInBytes(e.componentDatatype)*e.componentsPerAttribute}function q4e(e){let t,n,i,r=[];for(n in e)e.hasOwnProperty(n)&&l(e[n])&&l(e[n].values)&&(r.push(n),e[n].componentDatatype===Y.DOUBLE&&(e[n].componentDatatype=Y.FLOAT,e[n].values=Y.createTypedArray(Y.FLOAT,e[n].values)));let o,s=r.length;if(s>0)for(o=Tue(e[r[0]]),t=1;t<s;++t){let u=Tue(e[r[t]]);if(u!==o)throw new oe(`Each attribute list must have the same number of vertices. Attribute ${r[t]} has a different number of vertices (${u.toString()}) than attribute ${r[0]} (${o.toString()}).`)}r.sort(function(u,f){return Y.getSizeInBytes(e[f].componentDatatype)-Y.getSizeInBytes(e[u].componentDatatype)});let a=0,c={};for(t=0;t<s;++t)n=r[t],i=e[n],c[n]=a,a+=W4e(i);if(a>0){let u=Y.getSizeInBytes(e[r[0]].componentDatatype),f=a%u;f!==0&&(a+=u-f);let d=o*a,p=new ArrayBuffer(d),g={};for(t=0;t<s;++t){n=r[t];let m=Y.getSizeInBytes(e[n].componentDatatype);g[n]={pointer:Y.createTypedArray(e[n].componentDatatype,p),index:c[n]/m,strideInComponentType:a/m}}for(t=0;t<o;++t)for(let m=0;m<s;++m){n=r[m],i=e[n];let y=i.values,A=g[n],b=A.pointer,x=i.componentsPerAttribute;for(let T=0;T<x;++T)b[A.index+T]=y[t*x+T];A.index+=A.strideInComponentType}return{buffer:p,offsetsInBytes:c,vertexSizeInBytes:a}}}Ah.fromGeometry=function(e){e=e??H.EMPTY_OBJECT;let t=e.context,n=e.geometry??H.EMPTY_OBJECT,i=e.bufferUsage??Me.DYNAMIC_DRAW,r=e.attributeLocations??H.EMPTY_OBJECT,o=e.interleave??!1,s=e.vertexArrayAttributes,a,c,u,f=l(s)?s:[],d=n.attributes;if(o){let m=q4e(d);if(l(m)){u=tt.createVertexBuffer({context:t,typedArray:m.buffer,usage:i});let y=m.offsetsInBytes,A=m.vertexSizeInBytes;for(a in d)d.hasOwnProperty(a)&&l(d[a])&&(c=d[a],l(c.values)?f.push({index:r[a],vertexBuffer:u,componentDatatype:c.componentDatatype,componentsPerAttribute:c.componentsPerAttribute,normalize:c.normalize,offsetInBytes:y[a],strideInBytes:A}):f.push({index:r[a],value:c.value,componentDatatype:c.componentDatatype,normalize:c.normalize}))}}else for(a in d)if(d.hasOwnProperty(a)&&l(d[a])){c=d[a];let m=c.componentDatatype;m===Y.DOUBLE&&(m=Y.FLOAT);let y={};l(c.values)&&(u=tt.createVertexBuffer({context:t,typedArray:Y.createTypedArray(m,c.values),usage:i}),y={index:r[a],vertexBuffer:u,value:c.value,componentDatatype:m,componentsPerAttribute:c.componentsPerAttribute,normalize:c.normalize}),l(c.typedArray)&&(u=tt.createVertexBuffer({context:t,typedArray:c.typedArray,usage:i}),y={index:r[a],vertexBuffer:u,value:void 0,componentDatatype:m,componentsPerAttribute:Vt.getNumberOfComponents(c.type),normalize:c.normalized,instanceDivisor:c.instanceDivisor}),f.push(y)}let p,g=n.indices;return l(g)&&(wt.computeNumberOfVertices(n)>=P.SIXTY_FOUR_KILOBYTES&&t.elementIndexUint?p=tt.createIndexBuffer({context:t,typedArray:new Uint32Array(g),usage:i,indexDatatype:je.UNSIGNED_INT}):p=tt.createIndexBuffer({context:t,typedArray:new Uint16Array(g),usage:i,indexDatatype:je.UNSIGNED_SHORT})),new Ah({context:t,attributes:f,indexBuffer:p})};Object.defineProperties(Ah.prototype,{numberOfAttributes:{get:function(){return this._attributes.length}},numberOfVertices:{get:function(){return this._numberOfVertices}},indexBuffer:{get:function(){return this._indexBuffer}}});Ah.prototype.getAttribute=function(e){return this._attributes[e]};function Y4e(e){let t=e._context,n=e._hasInstancedAttributes;if(!n&&!t._previousDrawInstanced)return;t._previousDrawInstanced=n;let i=t._vertexAttribDivisors,r=e._attributes,o=Ut.maximumVertexAttributes,s;if(n){let a=r.length;for(s=0;s<a;++s){let c=r[s];if(c.enabled){let u=c.instanceDivisor,f=c.index;u!==i[f]&&(t.glVertexAttribDivisor(f,u),i[f]=u)}}}else for(s=0;s<o;++s)i[s]>0&&(t.glVertexAttribDivisor(s,0),i[s]=0)}function X4e(e,t){let n=e._attributes,i=n.length;for(let r=0;r<i;++r){let o=n[r];o.enabled&&l(o.value)&&o.vertexAttrib(t)}}Ah.prototype.copyAttributeFromRange=function(e,t,n,i){let r=this.getAttribute(e),o=r.vertexBuffer,s=r.componentsPerAttribute,a=t.constructor,c=n*s*a.BYTES_PER_ELEMENT,u=new a(t.buffer,t.byteOffset+c,i*s);o.copyFromArrayView(u,c)};Ah.prototype.copyIndexFromRange=function(e,t,n){let i=this._indexBuffer,r=e.constructor,o=t*r.BYTES_PER_ELEMENT,s=new r(e.buffer,e.byteOffset+o,n);i.copyFromArrayView(s,o)};Ah.prototype._bind=function(){l(this._vao)?(this._context.glBindVertexArray(this._vao),this._context.instancedArrays&&Y4e(this),this._hasConstantAttributes&&X4e(this,this._gl)):Eue(this._gl,this._attributes,this._indexBuffer)};Ah.prototype._unBind=function(){if(l(this._vao))this._context.glBindVertexArray(null);else{let e=this._attributes,t=this._gl;for(let n=0;n<e.length;++n){let i=e[n];i.enabled&&i.disableVertexAttribArray(t)}this._indexBuffer&&t.bindBuffer(t.ELEMENT_ARRAY_BUFFER,null)}};Ah.prototype.isDestroyed=function(){return!1};Ah.prototype.destroy=function(){let e=this._attributes;for(let n=0;n<e.length;++n){let i=e[n].vertexBuffer;l(i)&&!i.isDestroyed()&&i.vertexArrayDestroyable&&i.destroy()}let t=this._indexBuffer;return l(t)&&!t.isDestroyed()&&t.vertexArrayDestroyable&&t.destroy(),l(this._vao)&&this._context.glDeleteVertexArray(this._vao),le(this)};var Vn=Ah;function To(e){e=e??H.EMPTY_OBJECT;let{context:t,source:n,pixelFormat:i=$e.RGBA,pixelDatatype:r=ze.UNSIGNED_BYTE,flipY:o=!0,skipColorSpaceConversion:s=!1,sampler:a=new Ht}=e,c=e.preMultiplyAlpha||i===$e.RGB||i===$e.LUMINANCE,{width:u,height:f}=e;l(n)&&({width:u,height:f}=n.positiveX);let d=u,p=$e.textureSizeInBytes(i,r,d,d)*6,g=$e.toInternalFormat(i,r,t),m=t._gl,y=m.TEXTURE_CUBE_MAP,A=m.createTexture();this._context=t,this._textureFilterAnisotropic=t._textureFilterAnisotropic,this._textureTarget=y,this._texture=A,this._pixelFormat=i,this._pixelDatatype=r,this._size=d,this._hasMipmap=!1,this._sizeInBytes=p,this._preMultiplyAlpha=c,this._flipY=o;let b=l(n);function x(T){return new gL(t,A,y,T,g,i,r,d,c,o,b)}this._positiveX=x(m.TEXTURE_CUBE_MAP_POSITIVE_X),this._negativeX=x(m.TEXTURE_CUBE_MAP_NEGATIVE_X),this._positiveY=x(m.TEXTURE_CUBE_MAP_POSITIVE_Y),this._negativeY=x(m.TEXTURE_CUBE_MAP_NEGATIVE_Y),this._positiveZ=x(m.TEXTURE_CUBE_MAP_POSITIVE_Z),this._negativeZ=x(m.TEXTURE_CUBE_MAP_NEGATIVE_Z),this._sampler=a,Cue(this,a),m.activeTexture(m.TEXTURE0),m.bindTexture(y,A),s?m.pixelStorei(m.UNPACK_COLORSPACE_CONVERSION_WEBGL,m.NONE):m.pixelStorei(m.UNPACK_COLORSPACE_CONVERSION_WEBGL,m.BROWSER_DEFAULT_WEBGL);for(let T of To.faceNames())aX(this[T],n?.[T],0);m.bindTexture(y,null)}To.prototype.copyFace=function(e,t,n,i){let r=e.context,o=new vs({context:r,colorTextures:[t],destroyAttachments:!1});o._bind(),this[n].copyMipmapFromFramebuffer(0,0,t.width,t.height,i??0),o._unBind(),o.destroy()};To.FaceName=Object.freeze({POSITIVEX:"positiveX",NEGATIVEX:"negativeX",POSITIVEY:"positiveY",NEGATIVEY:"negativeY",POSITIVEZ:"positiveZ",NEGATIVEZ:"negativeZ"});function*K4e(){yield To.FaceName.POSITIVEX,yield To.FaceName.NEGATIVEX,yield To.FaceName.POSITIVEY,yield To.FaceName.NEGATIVEY,yield To.FaceName.POSITIVEZ,yield To.FaceName.NEGATIVEZ}To.faceNames=function(){return K4e()};function aX(e,t,n){n=n??0;let i=e._targetFace,r=Math.max(Math.floor(e._size/2**n),1),o=e._pixelFormat,s=e._pixelDatatype,a=e._internalFormat,c=e._flipY,u=e._preMultiplyAlpha,f=e._context,d=f._gl;if(!l(t)){d.texImage2D(i,n,a,r,r,0,o,ze.toWebGLConstant(s,f),null);return}let{arrayBufferView:p}=t,g=4;l(p)&&(g=$e.alignmentInBytes(o,s,r)),d.pixelStorei(d.UNPACK_ALIGNMENT,g),l(p)?(d.pixelStorei(d.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!1),d.pixelStorei(d.UNPACK_FLIP_Y_WEBGL,!1),c&&(p=$e.flipY(p,o,s,r,r)),d.texImage2D(i,n,a,r,r,0,o,ze.toWebGLConstant(s,f),p)):(d.pixelStorei(d.UNPACK_PREMULTIPLY_ALPHA_WEBGL,u),d.pixelStorei(d.UNPACK_FLIP_Y_WEBGL,c),d.texImage2D(i,n,a,o,ze.toWebGLConstant(s,f),t))}To.loadFace=aX;Object.defineProperties(To.prototype,{positiveX:{get:function(){return this._positiveX}},negativeX:{get:function(){return this._negativeX}},positiveY:{get:function(){return this._positiveY}},negativeY:{get:function(){return this._negativeY}},positiveZ:{get:function(){return this._positiveZ}},negativeZ:{get:function(){return this._negativeZ}},sampler:{get:function(){return this._sampler},set:function(e){Cue(this,e),this._sampler=e}},pixelFormat:{get:function(){return this._pixelFormat}},pixelDatatype:{get:function(){return this._pixelDatatype}},width:{get:function(){return this._size}},height:{get:function(){return this._size}},sizeInBytes:{get:function(){return this._hasMipmap?Math.floor(this._sizeInBytes*4/3):this._sizeInBytes}},preMultiplyAlpha:{get:function(){return this._preMultiplyAlpha}},flipY:{get:function(){return this._flipY}},_target:{get:function(){return this._textureTarget}}});To.getDirection=function(e,t){switch(e){case To.FaceName.POSITIVEX:return h.clone(h.UNIT_X,t);case To.FaceName.NEGATIVEX:return h.negate(h.UNIT_X,t);case To.FaceName.POSITIVEY:return h.clone(h.UNIT_Y,t);case To.FaceName.NEGATIVEY:return h.negate(h.UNIT_Y,t);case To.FaceName.POSITIVEZ:return h.clone(h.UNIT_Z,t);case To.FaceName.NEGATIVEZ:return h.negate(h.UNIT_Z,t)}};function Cue(e,t){let{minificationFilter:n,magnificationFilter:i}=t,r=[Wt.NEAREST_MIPMAP_NEAREST,Wt.NEAREST_MIPMAP_LINEAR,Wt.LINEAR_MIPMAP_NEAREST,Wt.LINEAR_MIPMAP_LINEAR].includes(n),o=e._context,s=e._pixelDatatype;(s===ze.FLOAT&&!o.textureFloatLinear||s===ze.HALF_FLOAT&&!o.textureHalfFloatLinear)&&(n=r?Wt.NEAREST_MIPMAP_NEAREST:Wt.NEAREST,i=Jn.NEAREST);let a=o._gl,c=e._textureTarget;a.activeTexture(a.TEXTURE0),a.bindTexture(c,e._texture),a.texParameteri(c,a.TEXTURE_MIN_FILTER,a.LINEAR),a.texParameteri(c,a.TEXTURE_MAG_FILTER,i),a.texParameteri(c,a.TEXTURE_WRAP_S,t.wrapS),a.texParameteri(c,a.TEXTURE_WRAP_T,t.wrapT),l(e._textureFilterAnisotropic)&&a.texParameteri(c,e._textureFilterAnisotropic.TEXTURE_MAX_ANISOTROPY_EXT,t.maximumAnisotropy),a.bindTexture(c,null)}To.prototype.loadMipmaps=function(e,t){t=t??!1;let n=this._context._gl,i=this._texture,r=this._textureTarget;n.activeTexture(n.TEXTURE0),n.bindTexture(r,i),t?n.pixelStorei(n.UNPACK_COLORSPACE_CONVERSION_WEBGL,n.NONE):n.pixelStorei(n.UNPACK_COLORSPACE_CONVERSION_WEBGL,n.BROWSER_DEFAULT_WEBGL);for(let o=0;o<e.length;o++){let s=e[o],a=o+1;for(let c of To.faceNames())aX(this[c],s[c],a)}n.bindTexture(r,null),this._hasMipmap=!0};To.prototype.generateMipmap=function(e){e=e??yh.DONT_CARE,this._hasMipmap=!0;let t=this._context._gl,n=this._textureTarget;t.hint(t.GENERATE_MIPMAP_HINT,e),t.activeTexture(t.TEXTURE0),t.bindTexture(n,this._texture),t.generateMipmap(n),t.bindTexture(n,null)};To.createVertexArray=function(e){let t=zc.createGeometry(zc.fromDimensions({dimensions:new h(2,2,2),vertexFormat:Be.POSITION_ONLY})),n=this._attributeLocations=Wn.createAttributeLocations(t);return Vn.fromGeometry({context:e,geometry:t,attributeLocations:n,bufferUsage:Me.STATIC_DRAW})};To.prototype.isDestroyed=function(){return!1};To.prototype.destroy=function(){return this._context._gl.deleteTexture(this._texture),this._positiveX=le(this._positiveX),this._negativeX=le(this._negativeX),this._positiveY=le(this._positiveY),this._negativeY=le(this._negativeY),this._positiveZ=le(this._positiveZ),this._negativeZ=le(this._negativeZ),le(this)};var ls=To;function $4e(e){this.context=e,this.framebuffer=void 0,this.blendingEnabled=void 0,this.scissorTest=void 0,this.viewport=void 0}var gc=$4e;var cX=class{constructor(t,n,i){this._pickObjects=t,this.key=n,this.color=i}get object(){return this._pickObjects.get(this.key)}set object(t){this._pickObjects.set(this.key,t)}destroy(){this._pickObjects.delete(this.key)}},_L=cX;var yL=`const float czm_degreesPerRadian = 57.29577951308232; + `;return o=TY(a),new Worker(o,r)}if(o=e,n||(o=Zt(`${qa._workerModulePrefix+i}.js`)),!dn.supportsEsmWebWorkers())throw new oe("This browser is not supported. Please update your browser to continue.");return r.type="module",new Worker(o,r)}async function dVe(e,t){let n={modulePath:void 0,wasmBinaryFile:void 0,wasmBinary:void 0};if(!dn.supportsWebAssembly()){if(!l(t.fallbackModulePath))throw new oe(`This browser does not support Web Assembly, and no backup module was provided for ${e._workerPath}`);return n.modulePath=Zt(t.fallbackModulePath),n}n.wasmBinaryFile=Zt(t.wasmBinaryFile);let i=await De.fetchArrayBuffer({url:n.wasmBinaryFile});return n.wasmBinary=i,n}function qa(e,t){this._workerPath=e,this._maximumActiveTasks=t??Number.POSITIVE_INFINITY,this._activeTasks=0,this._nextID=0,this._webAssemblyPromise=void 0}var hVe=(e,t,n,i)=>{let r=({data:o})=>{if(o.id===t){if(l(o.error)){let s=o.error;s.name==="RuntimeError"?(s=new oe(o.error.message),s.stack=o.error.stack):s.name==="DeveloperError"?(s=new pe(o.error.message),s.stack=o.error.stack):s.name==="Error"&&(s=new Error(o.error.message),s.stack=o.error.stack),EY.raiseEvent(s),i(s)}else EY.raiseEvent(),n(o.result);e.removeEventListener("message",r)}};return r},mVe=[];async function pVe(e,t,n){let i=await Promise.resolve(Ole());l(n)?i||(n.length=0):n=mVe;let r=e._nextID++,o=new Promise((s,a)=>{e._worker.addEventListener("message",hVe(e._worker,r,s,a))});return e._worker.postMessage({id:r,baseUrl:Zt.getCesiumBaseUrl().url,parameters:t,canTransferArrayBuffer:i},n),o}async function gVe(e,t,n){++e._activeTasks;try{let i=await pVe(e,t,n);return--e._activeTasks,i}catch(i){throw--e._activeTasks,i}}qa.prototype.scheduleTask=function(e,t){if(l(this._worker)||(this._worker=CY(this._workerPath)),!(this._activeTasks>=this._maximumActiveTasks))return gVe(this,e,t)};qa.prototype.initWebAssemblyModule=async function(e){if(l(this._webAssemblyPromise))return this._webAssemblyPromise;let t=async()=>{let n=this._worker=CY(this._workerPath),i=await dVe(this,e),r=await Promise.resolve(Ole()),o,s=i.wasmBinary;l(s)&&r&&(o=[s]);let a=new Promise((c,u)=>{n.onmessage=function({data:f}){l(f)?c(f.result):u(new oe("Could not configure wasm module"))}});return n.postMessage({canTransferArrayBuffer:r,parameters:{webAssemblyConfig:i}},o),a};return this._webAssemblyPromise=t(),this._webAssemblyPromise};qa.prototype.isDestroyed=function(){return!1};qa.prototype.destroy=function(){return l(this._worker)&&this._worker.terminate(),le(this)};qa.taskCompletedEvent=EY;qa._defaultWorkerModulePrefix="Workers/";qa._workerModulePrefix=qa._defaultWorkerModulePrefix;qa._canTransferArrayBuffer=void 0;var $n=qa;function B0(){}B0._transcodeTaskProcessor=new $n("transcodeKTX2",Number.POSITIVE_INFINITY);B0._readyPromise=void 0;function _Ve(){let e=B0._transcodeTaskProcessor.initWebAssemblyModule({wasmBinaryFile:"ThirdParty/basis_transcoder.wasm"}).then(function(t){if(t)return B0._transcodeTaskProcessor;throw new oe("KTX2 transcoder could not be initialized.")});B0._readyPromise=e}B0.transcode=function(e,t){return l(B0._readyPromise)||_Ve(),B0._readyPromise.then(function(n){let i=e;e instanceof ArrayBuffer&&(i=new Uint8Array(e));let r={supportedTargetFormats:t,ktx2Buffer:i};return n.scheduleTask(r,[i.buffer])}).then(function(n){let i=n.length,r=Object.keys(n[0]);for(let o=0;o<i;o++){let s=n[o];for(let a=0;a<r.length;a++){let c=s[r[a]];s[r[a]]=new nL(c.internalFormat,c.datatype,c.width,c.height,c.levelBuffer)}}if(r.length===1){for(let o=0;o<i;++o)n[o]=n[o][r[0]];i===1&&(n=n[0])}return n}).catch(function(n){throw n})};var iL=B0;var Mle;Nle.setKTX2SupportedFormats=function(e,t,n,i,r,o){Mle={s3tc:e,pvrtc:t,astc:n,etc:i,etc1:r,bc7:o}};function Nle(e){let t;return e instanceof ArrayBuffer||ArrayBuffer.isView(e)?t=Promise.resolve(e):t=De.createIfNeeded(e).fetchArrayBuffer(),t.then(function(n){return iL.transcode(n,Mle)})}var nf=Nle;function yVe(e,t){this.start=e??0,this.stop=t??0}var Gs=yVe;var rL=class e{constructor(t,n){this.center=h.clone(t??h.ZERO),this.radius=n??0}static fromPoints(t,n){if(l(n)||(n=new e),!l(t)||t.length===0)return n.center=h.clone(h.ZERO,n.center),n.radius=0,n;let i=h.clone(t[0],RY),r=h.clone(i,vY),o=h.clone(i,SY),s=h.clone(i,wY),a=h.clone(i,IY),c=h.clone(i,PY),u=h.clone(i,DY),f=t.length,d;for(d=1;d<f;d++){h.clone(t[d],i);let O=i.x,L=i.y,_=i.z;O<r.x&&h.clone(i,r),O>a.x&&h.clone(i,a),L<o.y&&h.clone(i,o),L>c.y&&h.clone(i,c),_<s.z&&h.clone(i,s),_>u.z&&h.clone(i,u)}let p=h.magnitudeSquared(h.subtract(a,r,Ya)),g=h.magnitudeSquared(h.subtract(c,o,Ya)),m=h.magnitudeSquared(h.subtract(u,s,Ya)),y=r,A=a,b=p;g>b&&(b=g,y=o,A=c),m>b&&(y=s,A=u);let x=OY;x.x=(y.x+A.x)*.5,x.y=(y.y+A.y)*.5,x.z=(y.z+A.z)*.5;let T=h.magnitudeSquared(h.subtract(A,x,Ya)),E=Math.sqrt(T),v=MY;v.x=r.x,v.y=o.y,v.z=s.z;let S=NY;S.x=a.x,S.y=c.y,S.z=u.z;let I=h.midpoint(v,S,LY),R=0;for(d=0;d<f;d++){h.clone(t[d],i);let O=h.magnitude(h.subtract(i,I,Ya));O>R&&(R=O);let L=h.magnitudeSquared(h.subtract(i,x,Ya));if(L>T){let _=Math.sqrt(L);E=(E+_)*.5,T=E*E;let C=_-E;x.x=(E*x.x+C*i.x)/_,x.y=(E*x.y+C*i.y)/_,x.z=(E*x.z+C*i.z)/_}}return E<R?(h.clone(x,n.center),n.radius=E):(h.clone(I,n.center),n.radius=R),n}static fromRectangle2D(t,n,i){return e.fromRectangleWithHeights2D(t,n,0,0,i)}static fromRectangleWithHeights2D(t,n,i,r,o){if(l(o)||(o=new e),!l(t))return o.center=h.clone(h.ZERO,o.center),o.radius=0,o;Lle._ellipsoid=ee.default,n=n??Lle,ie.southwest(t,FY),FY.height=i,ie.northeast(t,BY),BY.height=r;let s=n.project(FY,bVe),a=n.project(BY,xVe),c=a.x-s.x,u=a.y-s.y,f=a.z-s.z;o.radius=Math.sqrt(c*c+u*u+f*f)*.5;let d=o.center;return d.x=s.x+c*.5,d.y=s.y+u*.5,d.z=s.z+f*.5,o}static fromRectangle3D(t,n,i,r){if(n=n??ee.default,i=i??0,l(r)||(r=new e),!l(t))return r.center=h.clone(h.ZERO,r.center),r.radius=0,r;let o=ie.subsample(t,n,i,TVe);return e.fromPoints(o,r)}static fromVertices(t,n,i,r){if(l(r)||(r=new e),!l(t)||t.length===0)return r.center=h.clone(h.ZERO,r.center),r.radius=0,r;n=n??h.ZERO,i=i??3;let o=RY;o.x=t[0]+n.x,o.y=t[1]+n.y,o.z=t[2]+n.z;let s=h.clone(o,vY),a=h.clone(o,SY),c=h.clone(o,wY),u=h.clone(o,IY),f=h.clone(o,PY),d=h.clone(o,DY),p=t.length,g;for(g=0;g<p;g+=i){let _=t[g]+n.x,C=t[g+1]+n.y,w=t[g+2]+n.z;o.x=_,o.y=C,o.z=w,_<s.x&&h.clone(o,s),_>u.x&&h.clone(o,u),C<a.y&&h.clone(o,a),C>f.y&&h.clone(o,f),w<c.z&&h.clone(o,c),w>d.z&&h.clone(o,d)}let m=h.magnitudeSquared(h.subtract(u,s,Ya)),y=h.magnitudeSquared(h.subtract(f,a,Ya)),A=h.magnitudeSquared(h.subtract(d,c,Ya)),b=s,x=u,T=m;y>T&&(T=y,b=a,x=f),A>T&&(b=c,x=d);let E=OY;E.x=(b.x+x.x)*.5,E.y=(b.y+x.y)*.5,E.z=(b.z+x.z)*.5;let v=h.magnitudeSquared(h.subtract(x,E,Ya)),S=Math.sqrt(v),I=MY;I.x=s.x,I.y=a.y,I.z=c.z;let R=NY;R.x=u.x,R.y=f.y,R.z=d.z;let O=h.midpoint(I,R,LY),L=0;for(g=0;g<p;g+=i){o.x=t[g]+n.x,o.y=t[g+1]+n.y,o.z=t[g+2]+n.z;let _=h.magnitude(h.subtract(o,O,Ya));_>L&&(L=_);let C=h.magnitudeSquared(h.subtract(o,E,Ya));if(C>v){let w=Math.sqrt(C);S=(S+w)*.5,v=S*S;let D=w-S;E.x=(S*E.x+D*o.x)/w,E.y=(S*E.y+D*o.y)/w,E.z=(S*E.z+D*o.z)/w}}return S<L?(h.clone(E,r.center),r.radius=S):(h.clone(O,r.center),r.radius=L),r}static fromEncodedCartesianVertices(t,n,i){if(l(i)||(i=new e),!l(t)||!l(n)||t.length!==n.length||t.length===0)return i.center=h.clone(h.ZERO,i.center),i.radius=0,i;let r=RY;r.x=t[0]+n[0],r.y=t[1]+n[1],r.z=t[2]+n[2];let o=h.clone(r,vY),s=h.clone(r,SY),a=h.clone(r,wY),c=h.clone(r,IY),u=h.clone(r,PY),f=h.clone(r,DY),d=t.length,p;for(p=0;p<d;p+=3){let L=t[p]+n[p],_=t[p+1]+n[p+1],C=t[p+2]+n[p+2];r.x=L,r.y=_,r.z=C,L<o.x&&h.clone(r,o),L>c.x&&h.clone(r,c),_<s.y&&h.clone(r,s),_>u.y&&h.clone(r,u),C<a.z&&h.clone(r,a),C>f.z&&h.clone(r,f)}let g=h.magnitudeSquared(h.subtract(c,o,Ya)),m=h.magnitudeSquared(h.subtract(u,s,Ya)),y=h.magnitudeSquared(h.subtract(f,a,Ya)),A=o,b=c,x=g;m>x&&(x=m,A=s,b=u),y>x&&(A=a,b=f);let T=OY;T.x=(A.x+b.x)*.5,T.y=(A.y+b.y)*.5,T.z=(A.z+b.z)*.5;let E=h.magnitudeSquared(h.subtract(b,T,Ya)),v=Math.sqrt(E),S=MY;S.x=o.x,S.y=s.y,S.z=a.z;let I=NY;I.x=c.x,I.y=u.y,I.z=f.z;let R=h.midpoint(S,I,LY),O=0;for(p=0;p<d;p+=3){r.x=t[p]+n[p],r.y=t[p+1]+n[p+1],r.z=t[p+2]+n[p+2];let L=h.magnitude(h.subtract(r,R,Ya));L>O&&(O=L);let _=h.magnitudeSquared(h.subtract(r,T,Ya));if(_>E){let C=Math.sqrt(_);v=(v+C)*.5,E=v*v;let w=C-v;T.x=(v*T.x+w*r.x)/C,T.y=(v*T.y+w*r.y)/C,T.z=(v*T.z+w*r.z)/C}}return v<O?(h.clone(T,i.center),i.radius=v):(h.clone(R,i.center),i.radius=O),i}static fromCornerPoints(t,n,i){l(i)||(i=new e);let r=h.midpoint(t,n,i.center);return i.radius=h.distance(r,n),i}static fromEllipsoid(t,n){return l(n)||(n=new e),h.clone(h.ZERO,n.center),n.radius=t.maximumRadius,n}static fromBoundingSpheres(t,n){if(l(n)||(n=new e),!l(t)||t.length===0)return n.center=h.clone(h.ZERO,n.center),n.radius=0,n;let i=t.length;if(i===1)return e.clone(t[0],n);if(i===2)return e.union(t[0],t[1],n);let r=[],o;for(o=0;o<i;o++)r.push(t[o].center);n=e.fromPoints(r,n);let s=n.center,a=n.radius;for(o=0;o<i;o++){let c=t[o];a=Math.max(a,h.distance(s,c.center)+c.radius)}return n.radius=a,n}static fromOrientedBoundingBox(t,n){l(n)||(n=new e);let i=t.halfAxes,r=$.getColumn(i,0,EVe),o=$.getColumn(i,1,CVe),s=$.getColumn(i,2,vVe);return h.add(r,o,r),h.add(r,s,r),n.center=h.clone(t.center,n.center),n.radius=h.magnitude(r),n}static fromTransformation(t,n){l(n)||(n=new e);let i=M.getTranslation(t,SVe),r=M.getScale(t,wVe),o=.5*h.magnitude(r);return n.center=h.clone(i,n.center),n.radius=o,n}static clone(t,n){if(l(t))return l(n)?(n.center=h.clone(t.center,n.center),n.radius=t.radius,n):new e(t.center,t.radius)}static pack(t,n,i){i=i??0;let r=t.center;return n[i++]=r.x,n[i++]=r.y,n[i++]=r.z,n[i]=t.radius,n}static unpack(t,n,i){n=n??0,l(i)||(i=new e);let r=i.center;return r.x=t[n++],r.y=t[n++],r.z=t[n++],i.radius=t[n],i}static union(t,n,i){l(i)||(i=new e);let r=t.center,o=t.radius,s=n.center,a=n.radius,c=h.subtract(s,r,IVe),u=h.magnitude(c);if(o>=u+a)return t.clone(i),i;if(a>=u+o)return n.clone(i),i;let f=(o+u+a)*.5,d=h.multiplyByScalar(c,(-o+f)/u,PVe);return h.add(d,r,d),h.clone(d,i.center),i.radius=f,i}static expand(t,n,i){i=e.clone(t,i);let r=h.magnitude(h.subtract(n,i.center,DVe));return r>i.radius&&(i.radius=r),i}static intersectPlane(t,n){let i=t.center,r=t.radius,o=n.normal,s=h.dot(o,i)+n.distance;return s<-r?$t.OUTSIDE:s<r?$t.INTERSECTING:$t.INSIDE}static transform(t,n,i){return l(i)||(i=new e),i.center=M.multiplyByPoint(n,t.center,i.center),i.radius=M.getMaximumScale(n)*t.radius,i}static distanceSquaredTo(t,n){let i=h.subtract(t.center,n,RVe),r=h.magnitude(i)-t.radius;return r<=0?0:r*r}static transformWithoutScale(t,n,i){return l(i)||(i=new e),i.center=M.multiplyByPoint(n,t.center,i.center),i.radius=t.radius,i}static computePlaneDistances(t,n,i,r){l(r)||(r=new Gs);let o=h.subtract(t.center,n,OVe),s=h.dot(i,o);return r.start=s-t.radius,r.stop=s+t.radius,r}static projectTo2D(t,n,i){Ble._ellipsoid=ee.default,n=n??Ble;let r=n.ellipsoid,o=t.center,s=t.radius,a;h.equals(o,h.ZERO)?a=h.clone(h.UNIT_X,Fle):a=r.geodeticSurfaceNormal(o,Fle);let c=h.cross(h.UNIT_Z,a,MVe);h.normalize(c,c);let u=h.cross(a,c,NVe);h.normalize(u,u),h.multiplyByScalar(a,s,a),h.multiplyByScalar(u,s,u),h.multiplyByScalar(c,s,c);let f=h.negate(u,FVe),d=h.negate(c,LVe),p=kle,g=p[0];h.add(a,u,g),h.add(g,c,g),g=p[1],h.add(a,u,g),h.add(g,d,g),g=p[2],h.add(a,f,g),h.add(g,d,g),g=p[3],h.add(a,f,g),h.add(g,c,g),h.negate(a,a),g=p[4],h.add(a,u,g),h.add(g,c,g),g=p[5],h.add(a,u,g),h.add(g,d,g),g=p[6],h.add(a,f,g),h.add(g,d,g),g=p[7],h.add(a,f,g),h.add(g,c,g);let m=p.length;for(let x=0;x<m;++x){let T=p[x];h.add(o,T,T);let E=r.cartesianToCartographic(T,BVe);n.project(E,T)}i=e.fromPoints(p,i),o=i.center;let y=o.x,A=o.y,b=o.z;return o.x=b,o.y=y,o.z=A,i}static isOccluded(t,n){return!n.isBoundingSphereVisible(t)}static equals(t,n){return t===n||l(t)&&l(n)&&h.equals(t.center,n.center)&&t.radius===n.radius}intersectPlane(t){return e.intersectPlane(this,t)}distanceSquaredTo(t){return e.distanceSquaredTo(this,t)}computePlaneDistances(t,n,i){return e.computePlaneDistances(this,t,n,i)}isOccluded(t){return e.isOccluded(this,t)}equals(t){return e.equals(this,t)}clone(t){return e.clone(this,t)}volume(){let t=this.radius;return AVe*t*t*t}};rL.packedLength=4;var vY=new h,SY=new h,wY=new h,IY=new h,PY=new h,DY=new h,RY=new h,Ya=new h,OY=new h,MY=new h,NY=new h,LY=new h,AVe=4/3*P.PI,Lle=new ji,bVe=new h,xVe=new h,FY=new he,BY=new he,TVe=[],EVe=new h,CVe=new h,vVe=new h,SVe=new h,wVe=new h,IVe=new h,PVe=new h,DVe=new h,RVe=new h,OVe=new h,Fle=new h,MVe=new h,NVe=new h,LVe=new h,FVe=new h,BVe=new he,kle=new Array(8);for(let e=0;e<8;++e)kle[e]=new h;var Ble=new ji,ue=rL;function kVe(e){e=e??H.EMPTY_OBJECT,this.position=e.position,this.normal=e.normal,this.st=e.st,this.bitangent=e.bitangent,this.tangent=e.tangent,this.color=e.color}var En=kVe;var Ule={NONE:0,TOP:1,ALL:2};Object.freeze(Ule);var pn=Ule;function Ws(e){e=e??H.EMPTY_OBJECT,this.position=e.position??!1,this.normal=e.normal??!1,this.st=e.st??!1,this.bitangent=e.bitangent??!1,this.tangent=e.tangent??!1,this.color=e.color??!1}Ws.POSITION_ONLY=Object.freeze(new Ws({position:!0}));Ws.POSITION_AND_NORMAL=Object.freeze(new Ws({position:!0,normal:!0}));Ws.POSITION_NORMAL_AND_ST=Object.freeze(new Ws({position:!0,normal:!0,st:!0}));Ws.POSITION_AND_ST=Object.freeze(new Ws({position:!0,st:!0}));Ws.POSITION_AND_COLOR=Object.freeze(new Ws({position:!0,color:!0}));Ws.ALL=Object.freeze(new Ws({position:!0,normal:!0,st:!0,tangent:!0,bitangent:!0}));Ws.DEFAULT=Ws.POSITION_NORMAL_AND_ST;Ws.packedLength=6;Ws.pack=function(e,t,n){return n=n??0,t[n++]=e.position?1:0,t[n++]=e.normal?1:0,t[n++]=e.st?1:0,t[n++]=e.tangent?1:0,t[n++]=e.bitangent?1:0,t[n]=e.color?1:0,t};Ws.unpack=function(e,t,n){return t=t??0,l(n)||(n=new Ws),n.position=e[t++]===1,n.normal=e[t++]===1,n.st=e[t++]===1,n.tangent=e[t++]===1,n.bitangent=e[t++]===1,n.color=e[t]===1,n};Ws.clone=function(e,t){if(l(e))return l(t)||(t=new Ws),t.position=e.position,t.normal=e.normal,t.st=e.st,t.tangent=e.tangent,t.bitangent=e.bitangent,t.color=e.color,t};var Be=Ws;var UVe=new h;function rf(e){e=e??H.EMPTY_OBJECT;let t=e.minimum,n=e.maximum,i=e.vertexFormat??Be.DEFAULT;this._minimum=h.clone(t),this._maximum=h.clone(n),this._vertexFormat=i,this._offsetAttribute=e.offsetAttribute,this._workerName="createBoxGeometry"}rf.fromDimensions=function(e){e=e??H.EMPTY_OBJECT;let t=e.dimensions,n=h.multiplyByScalar(t,.5,new h);return new rf({minimum:h.negate(n,new h),maximum:n,vertexFormat:e.vertexFormat,offsetAttribute:e.offsetAttribute})};rf.fromAxisAlignedBoundingBox=function(e){return new rf({minimum:e.minimum,maximum:e.maximum})};rf.packedLength=2*h.packedLength+Be.packedLength+1;rf.pack=function(e,t,n){return n=n??0,h.pack(e._minimum,t,n),h.pack(e._maximum,t,n+h.packedLength),Be.pack(e._vertexFormat,t,n+2*h.packedLength),t[n+2*h.packedLength+Be.packedLength]=e._offsetAttribute??-1,t};var Vle=new h,jle=new h,Hle=new Be,zle={minimum:Vle,maximum:jle,vertexFormat:Hle,offsetAttribute:void 0};rf.unpack=function(e,t,n){t=t??0;let i=h.unpack(e,t,Vle),r=h.unpack(e,t+h.packedLength,jle),o=Be.unpack(e,t+2*h.packedLength,Hle),s=e[t+2*h.packedLength+Be.packedLength];return l(n)?(n._minimum=h.clone(i,n._minimum),n._maximum=h.clone(r,n._maximum),n._vertexFormat=Be.clone(o,n._vertexFormat),n._offsetAttribute=s===-1?void 0:s,n):(zle.offsetAttribute=s===-1?void 0:s,new rf(zle))};rf.createGeometry=function(e){let t=e._minimum,n=e._maximum,i=e._vertexFormat;if(h.equals(t,n))return;let r=new En,o,s;if(i.position&&(i.st||i.normal||i.tangent||i.bitangent)){if(i.position&&(s=new Float64Array(72),s[0]=t.x,s[1]=t.y,s[2]=n.z,s[3]=n.x,s[4]=t.y,s[5]=n.z,s[6]=n.x,s[7]=n.y,s[8]=n.z,s[9]=t.x,s[10]=n.y,s[11]=n.z,s[12]=t.x,s[13]=t.y,s[14]=t.z,s[15]=n.x,s[16]=t.y,s[17]=t.z,s[18]=n.x,s[19]=n.y,s[20]=t.z,s[21]=t.x,s[22]=n.y,s[23]=t.z,s[24]=n.x,s[25]=t.y,s[26]=t.z,s[27]=n.x,s[28]=n.y,s[29]=t.z,s[30]=n.x,s[31]=n.y,s[32]=n.z,s[33]=n.x,s[34]=t.y,s[35]=n.z,s[36]=t.x,s[37]=t.y,s[38]=t.z,s[39]=t.x,s[40]=n.y,s[41]=t.z,s[42]=t.x,s[43]=n.y,s[44]=n.z,s[45]=t.x,s[46]=t.y,s[47]=n.z,s[48]=t.x,s[49]=n.y,s[50]=t.z,s[51]=n.x,s[52]=n.y,s[53]=t.z,s[54]=n.x,s[55]=n.y,s[56]=n.z,s[57]=t.x,s[58]=n.y,s[59]=n.z,s[60]=t.x,s[61]=t.y,s[62]=t.z,s[63]=n.x,s[64]=t.y,s[65]=t.z,s[66]=n.x,s[67]=t.y,s[68]=n.z,s[69]=t.x,s[70]=t.y,s[71]=n.z,r.position=new Ne({componentDatatype:Y.DOUBLE,componentsPerAttribute:3,values:s})),i.normal){let u=new Float32Array(72);u[0]=0,u[1]=0,u[2]=1,u[3]=0,u[4]=0,u[5]=1,u[6]=0,u[7]=0,u[8]=1,u[9]=0,u[10]=0,u[11]=1,u[12]=0,u[13]=0,u[14]=-1,u[15]=0,u[16]=0,u[17]=-1,u[18]=0,u[19]=0,u[20]=-1,u[21]=0,u[22]=0,u[23]=-1,u[24]=1,u[25]=0,u[26]=0,u[27]=1,u[28]=0,u[29]=0,u[30]=1,u[31]=0,u[32]=0,u[33]=1,u[34]=0,u[35]=0,u[36]=-1,u[37]=0,u[38]=0,u[39]=-1,u[40]=0,u[41]=0,u[42]=-1,u[43]=0,u[44]=0,u[45]=-1,u[46]=0,u[47]=0,u[48]=0,u[49]=1,u[50]=0,u[51]=0,u[52]=1,u[53]=0,u[54]=0,u[55]=1,u[56]=0,u[57]=0,u[58]=1,u[59]=0,u[60]=0,u[61]=-1,u[62]=0,u[63]=0,u[64]=-1,u[65]=0,u[66]=0,u[67]=-1,u[68]=0,u[69]=0,u[70]=-1,u[71]=0,r.normal=new Ne({componentDatatype:Y.FLOAT,componentsPerAttribute:3,values:u})}if(i.st){let u=new Float32Array(48);u[0]=0,u[1]=0,u[2]=1,u[3]=0,u[4]=1,u[5]=1,u[6]=0,u[7]=1,u[8]=1,u[9]=0,u[10]=0,u[11]=0,u[12]=0,u[13]=1,u[14]=1,u[15]=1,u[16]=0,u[17]=0,u[18]=1,u[19]=0,u[20]=1,u[21]=1,u[22]=0,u[23]=1,u[24]=1,u[25]=0,u[26]=0,u[27]=0,u[28]=0,u[29]=1,u[30]=1,u[31]=1,u[32]=1,u[33]=0,u[34]=0,u[35]=0,u[36]=0,u[37]=1,u[38]=1,u[39]=1,u[40]=0,u[41]=0,u[42]=1,u[43]=0,u[44]=1,u[45]=1,u[46]=0,u[47]=1,r.st=new Ne({componentDatatype:Y.FLOAT,componentsPerAttribute:2,values:u})}if(i.tangent){let u=new Float32Array(72);u[0]=1,u[1]=0,u[2]=0,u[3]=1,u[4]=0,u[5]=0,u[6]=1,u[7]=0,u[8]=0,u[9]=1,u[10]=0,u[11]=0,u[12]=-1,u[13]=0,u[14]=0,u[15]=-1,u[16]=0,u[17]=0,u[18]=-1,u[19]=0,u[20]=0,u[21]=-1,u[22]=0,u[23]=0,u[24]=0,u[25]=1,u[26]=0,u[27]=0,u[28]=1,u[29]=0,u[30]=0,u[31]=1,u[32]=0,u[33]=0,u[34]=1,u[35]=0,u[36]=0,u[37]=-1,u[38]=0,u[39]=0,u[40]=-1,u[41]=0,u[42]=0,u[43]=-1,u[44]=0,u[45]=0,u[46]=-1,u[47]=0,u[48]=-1,u[49]=0,u[50]=0,u[51]=-1,u[52]=0,u[53]=0,u[54]=-1,u[55]=0,u[56]=0,u[57]=-1,u[58]=0,u[59]=0,u[60]=1,u[61]=0,u[62]=0,u[63]=1,u[64]=0,u[65]=0,u[66]=1,u[67]=0,u[68]=0,u[69]=1,u[70]=0,u[71]=0,r.tangent=new Ne({componentDatatype:Y.FLOAT,componentsPerAttribute:3,values:u})}if(i.bitangent){let u=new Float32Array(72);u[0]=0,u[1]=1,u[2]=0,u[3]=0,u[4]=1,u[5]=0,u[6]=0,u[7]=1,u[8]=0,u[9]=0,u[10]=1,u[11]=0,u[12]=0,u[13]=1,u[14]=0,u[15]=0,u[16]=1,u[17]=0,u[18]=0,u[19]=1,u[20]=0,u[21]=0,u[22]=1,u[23]=0,u[24]=0,u[25]=0,u[26]=1,u[27]=0,u[28]=0,u[29]=1,u[30]=0,u[31]=0,u[32]=1,u[33]=0,u[34]=0,u[35]=1,u[36]=0,u[37]=0,u[38]=1,u[39]=0,u[40]=0,u[41]=1,u[42]=0,u[43]=0,u[44]=1,u[45]=0,u[46]=0,u[47]=1,u[48]=0,u[49]=0,u[50]=1,u[51]=0,u[52]=0,u[53]=1,u[54]=0,u[55]=0,u[56]=1,u[57]=0,u[58]=0,u[59]=1,u[60]=0,u[61]=0,u[62]=1,u[63]=0,u[64]=0,u[65]=1,u[66]=0,u[67]=0,u[68]=1,u[69]=0,u[70]=0,u[71]=1,r.bitangent=new Ne({componentDatatype:Y.FLOAT,componentsPerAttribute:3,values:u})}o=new Uint16Array(36),o[0]=0,o[1]=1,o[2]=2,o[3]=0,o[4]=2,o[5]=3,o[6]=6,o[7]=5,o[8]=4,o[9]=7,o[10]=6,o[11]=4,o[12]=8,o[13]=9,o[14]=10,o[15]=8,o[16]=10,o[17]=11,o[18]=14,o[19]=13,o[20]=12,o[21]=15,o[22]=14,o[23]=12,o[24]=18,o[25]=17,o[26]=16,o[27]=19,o[28]=18,o[29]=16,o[30]=20,o[31]=21,o[32]=22,o[33]=20,o[34]=22,o[35]=23}else s=new Float64Array(24),s[0]=t.x,s[1]=t.y,s[2]=t.z,s[3]=n.x,s[4]=t.y,s[5]=t.z,s[6]=n.x,s[7]=n.y,s[8]=t.z,s[9]=t.x,s[10]=n.y,s[11]=t.z,s[12]=t.x,s[13]=t.y,s[14]=n.z,s[15]=n.x,s[16]=t.y,s[17]=n.z,s[18]=n.x,s[19]=n.y,s[20]=n.z,s[21]=t.x,s[22]=n.y,s[23]=n.z,r.position=new Ne({componentDatatype:Y.DOUBLE,componentsPerAttribute:3,values:s}),o=new Uint16Array(36),o[0]=4,o[1]=5,o[2]=6,o[3]=4,o[4]=6,o[5]=7,o[6]=1,o[7]=0,o[8]=3,o[9]=1,o[10]=3,o[11]=2,o[12]=1,o[13]=6,o[14]=5,o[15]=1,o[16]=2,o[17]=6,o[18]=2,o[19]=3,o[20]=7,o[21]=2,o[22]=7,o[23]=6,o[24]=3,o[25]=0,o[26]=4,o[27]=3,o[28]=4,o[29]=7,o[30]=0,o[31]=1,o[32]=5,o[33]=0,o[34]=5,o[35]=4;let a=h.subtract(n,t,UVe),c=h.magnitude(a)*.5;if(l(e._offsetAttribute)){let u=s.length,f=e._offsetAttribute===pn.NONE?0:1,d=new Uint8Array(u/3).fill(f);r.applyOffset=new Ne({componentDatatype:Y.UNSIGNED_BYTE,componentsPerAttribute:1,values:d})}return new wt({attributes:r,indices:o,primitiveType:Oe.TRIANGLES,boundingSphere:new ue(h.ZERO,c),offsetAttribute:e._offsetAttribute})};var kY;rf.getUnitBox=function(){return l(kY)||(kY=rf.createGeometry(rf.fromDimensions({dimensions:new h(1,1,1),vertexFormat:Be.POSITION_ONLY}))),kY};var zc=rf;var Ar={SCALAR:"SCALAR",VEC2:"VEC2",VEC3:"VEC3",VEC4:"VEC4",MAT2:"MAT2",MAT3:"MAT3",MAT4:"MAT4"};Ar.getMathType=function(e){switch(e){case Ar.SCALAR:return Number;case Ar.VEC2:return U;case Ar.VEC3:return h;case Ar.VEC4:return se;case Ar.MAT2:return $i;case Ar.MAT3:return $;case Ar.MAT4:return M}};Ar.getNumberOfComponents=function(e){switch(e){case Ar.SCALAR:return 1;case Ar.VEC2:return 2;case Ar.VEC3:return 3;case Ar.VEC4:case Ar.MAT2:return 4;case Ar.MAT3:return 9;case Ar.MAT4:return 16}};Ar.getAttributeLocationCount=function(e){switch(e){case Ar.SCALAR:case Ar.VEC2:case Ar.VEC3:case Ar.VEC4:return 1;case Ar.MAT2:return 2;case Ar.MAT3:return 3;case Ar.MAT4:return 4}};Ar.getGlslType=function(e){switch(e){case Ar.SCALAR:return"float";case Ar.VEC2:return"vec2";case Ar.VEC3:return"vec3";case Ar.VEC4:return"vec4";case Ar.MAT2:return"mat2";case Ar.MAT3:return"mat3";case Ar.MAT4:return"mat4"}};Object.freeze(Ar);var Vt=Ar;var Gle=1/256,zVe=65536,zY=256,Dr={};Dr.octEncodeInRange=function(e,t,n){if(n.x=e.x/(Math.abs(e.x)+Math.abs(e.y)+Math.abs(e.z)),n.y=e.y/(Math.abs(e.x)+Math.abs(e.y)+Math.abs(e.z)),e.z<0){let i=n.x,r=n.y;n.x=(1-Math.abs(r))*P.signNotZero(i),n.y=(1-Math.abs(i))*P.signNotZero(r)}return n.x=P.toSNorm(n.x,t),n.y=P.toSNorm(n.y,t),n};Dr.octEncode=function(e,t){return Dr.octEncodeInRange(e,255,t)};var XI=new U,Wle=new Uint8Array(1);function oL(e){return Wle[0]=e,Wle[0]}Dr.octEncodeToCartesian4=function(e,t){return Dr.octEncodeInRange(e,65535,XI),t.x=oL(XI.x*Gle),t.y=oL(XI.x),t.z=oL(XI.y*Gle),t.w=oL(XI.y),t};Dr.octDecodeInRange=function(e,t,n,i){if(i.x=P.fromSNorm(e,n),i.y=P.fromSNorm(t,n),i.z=1-(Math.abs(i.x)+Math.abs(i.y)),i.z<0){let r=i.x;i.x=(1-Math.abs(i.y))*P.signNotZero(r),i.y=(1-Math.abs(r))*P.signNotZero(i.y)}return h.normalize(i,i)};Dr.octDecode=function(e,t,n){return Dr.octDecodeInRange(e,t,255,n)};Dr.octDecodeFromCartesian4=function(e,t){let n=e.x,i=e.y,r=e.z,o=e.w,s=n*zY+i,a=r*zY+o;return Dr.octDecodeInRange(s,a,65535,t)};Dr.octPackFloat=function(e){return 256*e.x+e.y};var VY=new U;Dr.octEncodeFloat=function(e){return Dr.octEncode(e,VY),Dr.octPackFloat(VY)};Dr.octDecodeFloat=function(e,t){let n=e/256,i=Math.floor(n),r=(n-i)*256;return Dr.octDecode(i,r,t)};Dr.octPack=function(e,t,n,i){let r=Dr.octEncodeFloat(e),o=Dr.octEncodeFloat(t),s=Dr.octEncode(n,VY);return i.x=65536*s.x+r,i.y=65536*s.y+o,i};Dr.octUnpack=function(e,t,n,i){let r=e.x/65536,o=Math.floor(r),s=(r-o)*65536;r=e.y/65536;let a=Math.floor(r),c=(r-a)*65536;Dr.octDecodeFloat(s,t),Dr.octDecodeFloat(c,n),Dr.octDecode(o,a,i)};Dr.compressTextureCoordinates=function(e){let t=e.x*4095|0,n=e.y*4095|0;return 4096*t+n};Dr.decompressTextureCoordinates=function(e,t){let n=e/4096,i=Math.floor(n);return t.x=i/4095,t.y=(e-i*4096)/4095,t};function UY(e){return e>>1^-(e&1)}Dr.zigZagDeltaDecode=function(e,t,n){let i=e.length,r=0,o=0,s=0;for(let a=0;a<i;++a)r+=UY(e[a]),o+=UY(t[a]),e[a]=r,t[a]=o,l(n)&&(s+=UY(n[a]),n[a]=s)};Dr.dequantize=function(e,t,n,i){let r=Vt.getNumberOfComponents(n),o;switch(t){case Y.BYTE:o=127;break;case Y.UNSIGNED_BYTE:o=255;break;case Y.SHORT:o=32767;break;case Y.UNSIGNED_SHORT:o=65535;break;case Y.INT:o=2147483647;break;case Y.UNSIGNED_INT:o=4294967295;break}let s=new Float32Array(i*r);for(let a=0;a<i;a++)for(let c=0;c<r;c++){let u=a*r+c;s[u]=Math.max(e[u]/o,-1)}return s};Dr.encodeRGB8=function(e){return Math.round(P.clamp(e.red*255,0,255))*zVe+Math.round(P.clamp(e.green*255,0,255))*zY+Math.round(P.clamp(e.blue*255,0,255))};Dr.decodeRGB8=function(e,t){return e=Math.floor(e),t.red=(e>>16&255)/255,t.green=(e>>8&255)/255,t.blue=(e&255)/255,t};Dr.decodeRGB565=function(e,t){let n=e.length;l(t)||(t=new Float32Array(n*3));let i=31,r=63,o=1/31,s=1/63;for(let a=0;a<n;a++){let c=e[a],u=c>>11,f=c>>5&r,d=c&i,p=3*a;t[p]=u*o,t[p+1]=f*s,t[p+2]=d*o}return t};var cn=Dr;var qle=new h,Yle=new h,Xle=new h;function VVe(e,t,n,i,r){l(r)||(r=new h);let o,s,a,c,u,f,d,p;if(l(t.z)){if(h.equalsEpsilon(e,t,P.EPSILON14))return h.clone(h.UNIT_X,r);if(h.equalsEpsilon(e,n,P.EPSILON14))return h.clone(h.UNIT_Y,r);if(h.equalsEpsilon(e,i,P.EPSILON14))return h.clone(h.UNIT_Z,r);o=h.subtract(n,t,qle),s=h.subtract(i,t,Yle),a=h.subtract(e,t,Xle),c=h.dot(o,o),u=h.dot(o,s),f=h.dot(o,a),d=h.dot(s,s),p=h.dot(s,a)}else{if(U.equalsEpsilon(e,t,P.EPSILON14))return h.clone(h.UNIT_X,r);if(U.equalsEpsilon(e,n,P.EPSILON14))return h.clone(h.UNIT_Y,r);if(U.equalsEpsilon(e,i,P.EPSILON14))return h.clone(h.UNIT_Z,r);o=U.subtract(n,t,qle),s=U.subtract(i,t,Yle),a=U.subtract(e,t,Xle),c=U.dot(o,o),u=U.dot(o,s),f=U.dot(o,a),d=U.dot(s,s),p=U.dot(s,a)}r.y=d*f-u*p,r.z=c*p-u*f;let g=c*d-u*u;if(g!==0)return r.y/=g,r.z/=g,r.x=1-r.y-r.z,r}var BE=VVe;function Wm(){this.high=h.clone(h.ZERO),this.low=h.clone(h.ZERO)}Wm.encode=function(e,t){l(t)||(t={high:0,low:0});let n;return e>=0?(n=Math.floor(e/65536)*65536,t.high=n,t.low=e-n):(n=Math.floor(-e/65536)*65536,t.high=-n,t.low=e+n),t};var k0={high:0,low:0};Wm.fromCartesian=function(e,t){l(t)||(t=new Wm);let n=t.high,i=t.low;return Wm.encode(e.x,k0),n.x=k0.high,i.x=k0.low,Wm.encode(e.y,k0),n.y=k0.high,i.y=k0.low,Wm.encode(e.z,k0),n.z=k0.high,i.z=k0.low,t};var jY=new Wm;Wm.writeElements=function(e,t,n){Wm.fromCartesian(e,jY);let i=jY.high,r=jY.low;t[n]=i.x,t[n+1]=i.y,t[n+2]=i.z,t[n+3]=r.x,t[n+4]=r.y,t[n+5]=r.z};var Sn=Wm;var HY={};HY.computeDiscriminant=function(e,t,n){return t*t-4*e*n};function Kle(e,t,n){let i=e+t;return P.sign(e)!==P.sign(t)&&Math.abs(i/Math.max(Math.abs(e),Math.abs(t)))<n?0:i}HY.computeRealRoots=function(e,t,n){let i;if(e===0)return t===0?[]:[-n/t];if(t===0){if(n===0)return[0,0];let c=Math.abs(n),u=Math.abs(e);if(c<u&&c/u<P.EPSILON14)return[0,0];if(c>u&&u/c<P.EPSILON14)return[];if(i=-n/e,i<0)return[];let f=Math.sqrt(i);return[-f,f]}else if(n===0)return i=-t/e,i<0?[i,0]:[0,i];let r=t*t,o=4*e*n,s=Kle(r,-o,P.EPSILON14);if(s<0)return[];let a=-.5*Kle(t,P.sign(t)*Math.sqrt(s),P.EPSILON14);return t>0?[a/e,n/a]:[n/a,a/e]};var cu=HY;var WY={};WY.computeDiscriminant=function(e,t,n,i){let r=e*e,o=t*t,s=n*n,a=i*i;return 18*e*t*n*i+o*s-27*r*a-4*(e*s*n+o*t*i)};function GY(e,t,n,i){let r=e,o=t/3,s=n/3,a=i,c=r*s,u=o*a,f=o*o,d=s*s,p=r*s-f,g=r*a-o*s,m=o*a-d,y=4*p*m-g*g,A,b;if(y<0){let G,q,Q;f*u>=c*d?(G=r,q=p,Q=-2*o*p+r*g):(G=a,q=m,Q=-a*g+2*s*m);let J=-(Q<0?-1:1)*Math.abs(G)*Math.sqrt(-y);b=-Q+J;let Z=b/2,ae=Z<0?-Math.pow(-Z,1/3):Math.pow(Z,1/3),Ae=b===J?-ae:-q/ae;return A=q<=0?ae+Ae:-Q/(ae*ae+Ae*Ae+q),f*u>=c*d?[(A-o)/r]:[-a/(A+s)]}let x=p,T=-2*o*p+r*g,E=m,v=-a*g+2*s*m,S=Math.sqrt(y),I=Math.sqrt(3)/2,R=Math.abs(Math.atan2(r*S,-T)/3);A=2*Math.sqrt(-x);let O=Math.cos(R);b=A*O;let L=A*(-O/2-I*Math.sin(R)),_=b+L>2*o?b-o:L-o,C=r,w=_/C;R=Math.abs(Math.atan2(a*S,-v)/3),A=2*Math.sqrt(-E),O=Math.cos(R),b=A*O,L=A*(-O/2-I*Math.sin(R));let D=-a,N=b+L<2*s?b+s:L+s,F=D/N,V=C*N,B=-_*N-C*D,j=_*D,k=(s*B-o*j)/(-o*B+s*V);return w<=k?w<=F?k<=F?[w,k,F]:[w,F,k]:[F,w,k]:w<=F?[k,w,F]:k<=F?[k,F,w]:[F,k,w]}WY.computeRealRoots=function(e,t,n,i){let r,o;if(e===0)return cu.computeRealRoots(t,n,i);if(t===0){if(n===0){if(i===0)return[0,0,0];o=-i/e;let s=o<0?-Math.pow(-o,1/3):Math.pow(o,1/3);return[s,s,s]}else if(i===0)return r=cu.computeRealRoots(e,0,n),r.Length===0?[0]:[r[0],0,r[1]];return GY(e,0,n,i)}else{if(n===0)return i===0?(o=-t/e,o<0?[o,0,0]:[0,0,o]):GY(e,t,0,i);if(i===0)return r=cu.computeRealRoots(e,t,n),r.length===0?[0]:r[1]<=0?[r[0],r[1],0]:r[0]>=0?[0,r[0],r[1]]:[r[0],0,r[1]]}return GY(e,t,n,i)};var kE=WY;var qY={};qY.computeDiscriminant=function(e,t,n,i,r){let o=e*e,s=o*e,a=t*t,c=a*t,u=n*n,f=u*n,d=i*i,p=d*i,g=r*r,m=g*r;return a*u*d-4*c*p-4*e*f*d+18*e*t*n*p-27*o*d*d+256*s*m+r*(18*c*n*i-4*a*f+16*e*u*u-80*e*t*u*i-6*e*a*d+144*o*n*d)+g*(144*e*a*n-27*a*a-128*o*u-192*o*t*i)};function ph(e,t,n,i){let r=e*e,o=t-3*r/8,s=n-t*e/2+r*e/8,a=i-n*e/4+t*r/16-3*r*r/256,c=kE.computeRealRoots(1,2*o,o*o-4*a,-s*s);if(c.length>0){let u=-e/4,f=c[c.length-1];if(Math.abs(f)<P.EPSILON14){let d=cu.computeRealRoots(1,o,a);if(d.length===2){let p=d[0],g=d[1],m;if(p>=0&&g>=0){let y=Math.sqrt(p),A=Math.sqrt(g);return[u-A,u-y,u+y,u+A]}else{if(p>=0&&g<0)return m=Math.sqrt(p),[u-m,u+m];if(p<0&&g>=0)return m=Math.sqrt(g),[u-m,u+m]}}return[]}else if(f>0){let d=Math.sqrt(f),p=(o+f-s/d)/2,g=(o+f+s/d)/2,m=cu.computeRealRoots(1,d,p),y=cu.computeRealRoots(1,-d,g);return m.length!==0?(m[0]+=u,m[1]+=u,y.length!==0?(y[0]+=u,y[1]+=u,m[1]<=y[0]?[m[0],m[1],y[0],y[1]]:y[1]<=m[0]?[y[0],y[1],m[0],m[1]]:m[0]>=y[0]&&m[1]<=y[1]?[y[0],m[0],m[1],y[1]]:y[0]>=m[0]&&y[1]<=m[1]?[m[0],y[0],y[1],m[1]]:m[0]>y[0]&&m[0]<y[1]?[y[0],m[0],y[1],m[1]]:[m[0],y[0],m[1],y[1]]):m):y.length!==0?(y[0]+=u,y[1]+=u,y):[]}}return[]}function KI(e,t,n,i){let r=n*n,o=t*t,s=e*e,a=-2*t,c=n*e+o-4*i,u=s*i-n*t*e+r,f=kE.computeRealRoots(1,a,c,u);if(f.length>0){let d=f[0],p=t-d,g=p*p,m=e/2,y=p/2,A=g-4*i,b=g+4*Math.abs(i),x=s-4*d,T=s+4*Math.abs(d),E,v;if(d<0||A*T<x*b){let C=Math.sqrt(x);E=C/2,v=C===0?0:(e*y-n)/C}else{let C=Math.sqrt(A);E=C===0?0:(e*y-n)/C,v=C/2}let S,I;m===0&&E===0?(S=0,I=0):P.sign(m)===P.sign(E)?(S=m+E,I=d/S):(I=m-E,S=d/I);let R,O;y===0&&v===0?(R=0,O=0):P.sign(y)===P.sign(v)?(R=y+v,O=i/R):(O=y-v,R=i/O);let L=cu.computeRealRoots(1,S,R),_=cu.computeRealRoots(1,I,O);if(L.length!==0)return _.length!==0?L[1]<=_[0]?[L[0],L[1],_[0],_[1]]:_[1]<=L[0]?[_[0],_[1],L[0],L[1]]:L[0]>=_[0]&&L[1]<=_[1]?[_[0],L[0],L[1],_[1]]:_[0]>=L[0]&&_[1]<=L[1]?[L[0],_[0],_[1],L[1]]:L[0]>_[0]&&L[0]<_[1]?[_[0],L[0],_[1],L[1]]:[L[0],_[0],L[1],_[1]]:L;if(_.length!==0)return _}return[]}qY.computeRealRoots=function(e,t,n,i,r){if(Math.abs(e)<P.EPSILON15)return kE.computeRealRoots(t,n,i,r);let o=t/e,s=n/e,a=i/e,c=r/e,u=o<0?1:0;switch(u+=s<0?u+1:u,u+=a<0?u+1:u,u+=c<0?u+1:u,u){case 0:return ph(o,s,a,c);case 1:return KI(o,s,a,c);case 2:return KI(o,s,a,c);case 3:return ph(o,s,a,c);case 4:return ph(o,s,a,c);case 5:return KI(o,s,a,c);case 6:return ph(o,s,a,c);case 7:return ph(o,s,a,c);case 8:return KI(o,s,a,c);case 9:return ph(o,s,a,c);case 10:return ph(o,s,a,c);case 11:return KI(o,s,a,c);case 12:return ph(o,s,a,c);case 13:return ph(o,s,a,c);case 14:return ph(o,s,a,c);case 15:return ph(o,s,a,c);default:return}};var sL=qY;var YY=class e{constructor(t,n){n=h.clone(n??h.ZERO),h.equals(n,h.ZERO)||h.normalize(n,n),this.origin=h.clone(t??h.ZERO),this.direction=n}static clone(t,n){if(l(t))return l(n)?(n.origin=h.clone(t.origin),n.direction=h.clone(t.direction),n):new e(t.origin,t.direction)}static getPoint(t,n,i){return l(i)||(i=new h),i=h.multiplyByScalar(t.direction,n,i),h.add(t.origin,i,i)}},gn=YY;var Jr={};Jr.rayPlane=function(e,t,n){l(n)||(n=new h);let i=e.origin,r=e.direction,o=t.normal,s=h.dot(o,r);if(Math.abs(s)<P.EPSILON15)return;let a=(-t.distance-h.dot(o,i))/s;if(!(a<0))return n=h.multiplyByScalar(r,a,n),h.add(i,n,n)};var jVe=new h,HVe=new h,iue=new h,$le=new h,Jle=new h;Jr.rayTriangleParametric=function(e,t,n,i,r){r=r??!1;let o=e.origin,s=e.direction,a=h.subtract(n,t,jVe),c=h.subtract(i,t,HVe),u=h.cross(s,c,iue),f=h.dot(a,u),d,p,g,m,y;if(r){if(f<P.EPSILON6||(d=h.subtract(o,t,$le),g=h.dot(d,u),g<0||g>f)||(p=h.cross(d,a,Jle),m=h.dot(s,p),m<0||g+m>f))return;y=h.dot(c,p)/f}else{if(Math.abs(f)<P.EPSILON6)return;let A=1/f;if(d=h.subtract(o,t,$le),g=h.dot(d,u)*A,g<0||g>1||(p=h.cross(d,a,Jle),m=h.dot(s,p)*A,m<0||g+m>1))return;y=h.dot(c,p)*A}return y};Jr.rayTriangle=function(e,t,n,i,r,o){let s=Jr.rayTriangleParametric(e,t,n,i,r);if(!(!l(s)||s<0))return l(o)||(o=new h),h.multiplyByScalar(e.direction,s,o),h.add(e.origin,o,o)};var GVe=new gn;Jr.lineSegmentTriangle=function(e,t,n,i,r,o,s){let a=GVe;h.clone(e,a.origin),h.subtract(t,e,a.direction),h.normalize(a.direction,a.direction);let c=Jr.rayTriangleParametric(a,n,i,r,o);if(!(!l(c)||c<0||c>h.distance(e,t)))return l(s)||(s=new h),h.multiplyByScalar(a.direction,c,s),h.add(a.origin,s,s)};function WVe(e,t,n,i){let r=t*t-4*e*n;if(r<0)return;if(r>0){let s=1/(2*e),a=Math.sqrt(r),c=(-t+a)*s,u=(-t-a)*s;return c<u?(i.root0=c,i.root1=u):(i.root0=u,i.root1=c),i}let o=-t/(2*e);if(o!==0)return i.root0=i.root1=o,i}var qVe={root0:0,root1:0};function rue(e,t,n){l(n)||(n=new Gs);let i=e.origin,r=e.direction,o=t.center,s=t.radius*t.radius,a=h.subtract(i,o,iue),c=h.dot(r,r),u=2*h.dot(r,a),f=h.magnitudeSquared(a)-s,d=WVe(c,u,f,qVe);if(l(d))return n.start=d.root0,n.stop=d.root1,n}Jr.raySphere=function(e,t,n){if(n=rue(e,t,n),!(!l(n)||n.stop<0))return n.start=Math.max(n.start,0),n};var YVe=new gn;Jr.lineSegmentSphere=function(e,t,n,i){let r=YVe;h.clone(e,r.origin);let o=h.subtract(t,e,r.direction),s=h.magnitude(o);if(h.normalize(o,o),i=rue(r,n,i),!(!l(i)||i.stop<0||i.start>s))return i.start=Math.max(i.start,0),i.stop=Math.min(i.stop,s),i};var XVe=new h,KVe=new h;Jr.rayEllipsoid=function(e,t){let n=t.oneOverRadii,i=h.multiplyComponents(n,e.origin,XVe),r=h.multiplyComponents(n,e.direction,KVe),o=h.magnitudeSquared(i),s=h.dot(i,r),a,c,u,f,d;if(o>1){if(s>=0)return;let p=s*s;if(a=o-1,c=h.magnitudeSquared(r),u=c*a,p<u)return;if(p>u){f=s*s-u,d=-s+Math.sqrt(f);let m=d/c,y=a/d;return m<y?new Gs(m,y):{start:y,stop:m}}let g=Math.sqrt(a/c);return new Gs(g,g)}else if(o<1)return a=o-1,c=h.magnitudeSquared(r),u=c*a,f=s*s-u,d=-s+Math.sqrt(f),new Gs(0,d/c);if(s<0)return c=h.magnitudeSquared(r),new Gs(0,-s/c)};var $Ve=new Gs,JVe=new Gs,ZVe=new Gs;Jr.rayAxisAlignedBoundingBox=function(e,t,n){l(n)||(n=new Gs);let i=XY(e.origin.x,e.direction.x,t.minimum.x,t.maximum.x,$Ve),r=XY(e.origin.y,e.direction.y,t.minimum.y,t.maximum.y,JVe),o=XY(e.origin.z,e.direction.z,t.minimum.z,t.maximum.z,ZVe);if(n.start=i.start>r.start?i.start:r.start,n.stop=i.stop<r.stop?i.stop:r.stop,!(i.start>r.stop||r.start>i.stop)&&!(n.start>o.stop||o.start>n.stop))return o.start>n.start&&(n.start=o.start),o.stop<n.stop&&(n.stop=o.stop),n};function XY(e,t,n,i,r){if(r.start=(n-e)/t,r.stop=(i-e)/t,r.stop<r.start){let o=r.stop;r.stop=r.start,r.start=o}return r}function Eb(e,t,n){let i=e+t;return P.sign(e)!==P.sign(t)&&Math.abs(i/Math.max(Math.abs(e),Math.abs(t)))<n?0:i}Jr.quadraticVectorExpression=function(e,t,n,i,r){let o=i*i,s=r*r,a=(e[$.COLUMN1ROW1]-e[$.COLUMN2ROW2])*s,c=r*(i*Eb(e[$.COLUMN1ROW0],e[$.COLUMN0ROW1],P.EPSILON15)+t.y),u=e[$.COLUMN0ROW0]*o+e[$.COLUMN2ROW2]*s+i*t.x+n,f=s*Eb(e[$.COLUMN2ROW1],e[$.COLUMN1ROW2],P.EPSILON15),d=r*(i*Eb(e[$.COLUMN2ROW0],e[$.COLUMN0ROW2])+t.z),p,g=[];if(d===0&&f===0){if(p=cu.computeRealRoots(a,c,u),p.length===0)return g;let R=p[0],O=Math.sqrt(Math.max(1-R*R,0));if(g.push(new h(i,r*R,r*-O)),g.push(new h(i,r*R,r*O)),p.length===2){let L=p[1],_=Math.sqrt(Math.max(1-L*L,0));g.push(new h(i,r*L,r*-_)),g.push(new h(i,r*L,r*_))}return g}let m=d*d,y=f*f,A=a*a,b=d*f,x=A+y,T=2*(c*a+b),E=2*u*a+c*c-y+m,v=2*(u*c-b),S=u*u-m;if(x===0&&T===0&&E===0&&v===0)return g;p=sL.computeRealRoots(x,T,E,v,S);let I=p.length;if(I===0)return g;for(let R=0;R<I;++R){let O=p[R],L=O*O,_=Math.max(1-L,0),C=Math.sqrt(_),w;P.sign(a)===P.sign(u)?w=Eb(a*L+u,c*O,P.EPSILON12):P.sign(u)===P.sign(c*O)?w=Eb(a*L,c*O+u,P.EPSILON12):w=Eb(a*L+c*O,u,P.EPSILON12);let D=Eb(f*O,d,P.EPSILON15),N=w*D;N<0?g.push(new h(i,r*O,r*C)):N>0?g.push(new h(i,r*O,r*-C)):C!==0?(g.push(new h(i,r*O,r*-C)),g.push(new h(i,r*O,r*C)),++R):g.push(new h(i,r*O,r*C))}return g};var KY=new h,Zle=new h,Qle=new h,aL=new h,QVe=new h,e4e=new $,t4e=new $,n4e=new $,i4e=new $,r4e=new $,eue=new $,tue=new $,nue=new h,o4e=new h,s4e=new he;Jr.grazingAltitudeLocation=function(e,t){let n=e.origin,i=e.direction;if(!h.equals(n,h.ZERO)){let S=t.geodeticSurfaceNormal(n,KY);if(h.dot(i,S)>=0)return n}let r=l(this.rayEllipsoid(e,t)),o=t.transformPositionToScaledSpace(i,KY),s=h.normalize(o,o),a=h.mostOrthogonalAxis(o,aL),c=h.normalize(h.cross(a,s,Zle),Zle),u=h.normalize(h.cross(s,c,Qle),Qle),f=e4e;f[0]=s.x,f[1]=s.y,f[2]=s.z,f[3]=c.x,f[4]=c.y,f[5]=c.z,f[6]=u.x,f[7]=u.y,f[8]=u.z;let d=$.transpose(f,t4e),p=$.fromScale(t.radii,n4e),g=$.fromScale(t.oneOverRadii,i4e),m=r4e;m[0]=0,m[1]=-i.z,m[2]=i.y,m[3]=i.z,m[4]=0,m[5]=-i.x,m[6]=-i.y,m[7]=i.x,m[8]=0;let y=$.multiply($.multiply(d,g,eue),m,eue),A=$.multiply($.multiply(y,p,tue),f,tue),b=$.multiplyByVector(y,n,QVe),x=Jr.quadraticVectorExpression(A,h.negate(b,KY),0,0,1),T,E,v=x.length;if(v>0){let S=h.clone(h.ZERO,o4e),I=Number.NEGATIVE_INFINITY;for(let O=0;O<v;++O){T=$.multiplyByVector(p,$.multiplyByVector(f,x[O],nue),nue);let L=h.normalize(h.subtract(T,n,aL),aL),_=h.dot(L,i);_>I&&(I=_,S=h.clone(T,S))}let R=t.cartesianToCartographic(S,s4e);return I=P.clamp(I,0,1),E=h.magnitude(h.subtract(S,n,aL))*Math.sqrt(1-I*I),E=r?-E:E,R.height=E,t.cartographicToCartesian(R,new h)}};var a4e=new h;Jr.lineSegmentPlane=function(e,t,n,i){l(i)||(i=new h);let r=h.subtract(t,e,a4e),o=n.normal,s=h.dot(o,r);if(Math.abs(s)<P.EPSILON6)return;let a=h.dot(o,e),c=-(n.distance+a)/s;if(!(c<0||c>1))return h.multiplyByScalar(r,c,i),h.add(e,i,i),i};Jr.trianglePlaneIntersection=function(e,t,n,i){let r=i.normal,o=i.distance,s=h.dot(r,e)+o<0,a=h.dot(r,t)+o<0,c=h.dot(r,n)+o<0,u=0;u+=s?1:0,u+=a?1:0,u+=c?1:0;let f,d;if((u===1||u===2)&&(f=new h,d=new h),u===1){if(s)return Jr.lineSegmentPlane(e,t,i,f),Jr.lineSegmentPlane(e,n,i,d),{positions:[e,t,n,f,d],indices:[0,3,4,1,2,4,1,4,3]};if(a)return Jr.lineSegmentPlane(t,n,i,f),Jr.lineSegmentPlane(t,e,i,d),{positions:[e,t,n,f,d],indices:[1,3,4,2,0,4,2,4,3]};if(c)return Jr.lineSegmentPlane(n,e,i,f),Jr.lineSegmentPlane(n,t,i,d),{positions:[e,t,n,f,d],indices:[2,3,4,0,1,4,0,4,3]}}else if(u===2)if(s)if(a){if(!c)return Jr.lineSegmentPlane(e,n,i,f),Jr.lineSegmentPlane(t,n,i,d),{positions:[e,t,n,f,d],indices:[0,1,4,0,4,3,2,3,4]}}else return Jr.lineSegmentPlane(n,t,i,f),Jr.lineSegmentPlane(e,t,i,d),{positions:[e,t,n,f,d],indices:[2,0,4,2,4,3,1,3,4]};else return Jr.lineSegmentPlane(t,e,i,f),Jr.lineSegmentPlane(n,e,i,d),{positions:[e,t,n,f,d],indices:[1,2,4,1,4,3,0,3,4]}};var xi=Jr;function va(e,t){this.normal=h.clone(e),this.distance=t}va.fromPointNormal=function(e,t,n){let i=-h.dot(t,e);return l(n)?(h.clone(t,n.normal),n.distance=i,n):new va(t,i)};var c4e=new h;va.fromCartesian4=function(e,t){let n=h.fromCartesian4(e,c4e),i=e.w;return l(t)?(h.clone(n,t.normal),t.distance=i,t):new va(n,i)};va.getPointDistance=function(e,t){return h.dot(e.normal,t)+e.distance};var l4e=new h;va.projectPointOntoPlane=function(e,t,n){l(n)||(n=new h);let i=va.getPointDistance(e,t),r=h.multiplyByScalar(e.normal,i,l4e);return h.subtract(t,r,n)};var u4e=new M,f4e=new se,d4e=new h;va.transform=function(e,t,n){let i=e.normal,r=e.distance,o=M.inverseTranspose(t,u4e),s=se.fromElements(i.x,i.y,i.z,r,f4e);s=M.multiplyByVector(o,s,s);let a=h.fromCartesian4(s,d4e);return s=se.divideByScalar(s,h.magnitude(a),s),va.fromCartesian4(s,n)};va.clone=function(e,t){return l(t)?(h.clone(e.normal,t.normal),t.distance=e.distance,t):new va(e.normal,e.distance)};va.equals=function(e,t){return e.distance===t.distance&&h.equals(e.normal,t.normal)};va.ORIGIN_XY_PLANE=Object.freeze(new va(h.UNIT_Z,0));va.ORIGIN_YZ_PLANE=Object.freeze(new va(h.UNIT_X,0));va.ORIGIN_ZX_PLANE=Object.freeze(new va(h.UNIT_Y,0));var sn=va;var $Y={};$Y.calculateACMR=function(e){e=e??H.EMPTY_OBJECT;let t=e.indices,n=e.maximumIndex,i=e.cacheSize??24,r=t.length;if(!l(n)){n=0;let a=0,c=t[a];for(;a<r;)c>n&&(n=c),++a,c=t[a]}let o=[];for(let a=0;a<n+1;a++)o[a]=0;let s=i+1;for(let a=0;a<r;++a)s-o[t[a]]>i&&(o[t[a]]=s,++s);return(s-i+1)/(r/3)};$Y.tipsify=function(e){e=e??H.EMPTY_OBJECT;let t=e.indices,n=e.maximumIndex,i=e.cacheSize??24,r;function o(_,C,w,D){for(;C.length>=1;){let N=C[C.length-1];if(C.splice(C.length-1,1),_[N].numLiveTriangles>0)return N}for(;r<D;){if(_[r].numLiveTriangles>0)return++r,r-1;++r}return-1}function s(_,C,w,D,N,F,V){let B=-1,j,k=-1,G=0;for(;G<w.length;){let q=w[G];D[q].numLiveTriangles&&(j=0,N-D[q].timeStamp+2*D[q].numLiveTriangles<=C&&(j=N-D[q].timeStamp),(j>k||k===-1)&&(k=j,B=q)),++G}return B===-1?o(D,F,_,V):B}let a=t.length,c=0,u=0,f=t[u],d=a;if(l(n))c=n+1;else{for(;u<d;)f>c&&(c=f),++u,f=t[u];if(c===-1)return 0;++c}let p=[],g;for(g=0;g<c;g++)p[g]={numLiveTriangles:0,timeStamp:0,vertexTriangles:[]};u=0;let m=0;for(;u<d;)p[t[u]].vertexTriangles.push(m),++p[t[u]].numLiveTriangles,p[t[u+1]].vertexTriangles.push(m),++p[t[u+1]].numLiveTriangles,p[t[u+2]].vertexTriangles.push(m),++p[t[u+2]].numLiveTriangles,++m,u+=3;let y=0,A=i+1;r=1;let b,x=[],T,E,v=0,S=[],I=a/3,R=[];for(g=0;g<I;g++)R[g]=!1;let O,L;for(;y!==-1;){b=[],E=p[y],L=E.vertexTriangles.length;for(let _=0;_<L;++_)if(m=E.vertexTriangles[_],!R[m]){R[m]=!0,u=m+m+m;for(let C=0;C<3;++C)O=t[u],b.push(O),x.push(O),S[v]=O,++v,T=p[O],--T.numLiveTriangles,A-T.timeStamp>i&&(T.timeStamp=A,++A),++u}y=s(t,i,b,p,A,x,c)}return S};var cL=$Y;var Cl={};function pL(e,t,n,i,r){e[t++]=n,e[t++]=i,e[t++]=i,e[t++]=r,e[t++]=r,e[t]=n}function h4e(e){let t=e.length,n=t/3*6,i=je.createTypedArray(t,n),r=0;for(let o=0;o<t;o+=3,r+=6)pL(i,r,e[o],e[o+1],e[o+2]);return i}function m4e(e){let t=e.length;if(t>=3){let n=(t-2)*6,i=je.createTypedArray(t,n);pL(i,0,e[0],e[1],e[2]);let r=6;for(let o=3;o<t;++o,r+=6)pL(i,r,e[o-1],e[o],e[o-2]);return i}return new Uint16Array}function p4e(e){if(e.length>0){let t=e.length-1,n=(t-1)*6,i=je.createTypedArray(t,n),r=e[0],o=0;for(let s=1;s<t;++s,o+=6)pL(i,o,r,e[s],e[s+1]);return i}return new Uint16Array}Cl.toWireframe=function(e){let t=e.indices;if(l(t)){switch(e.primitiveType){case Oe.TRIANGLES:e.indices=h4e(t);break;case Oe.TRIANGLE_STRIP:e.indices=m4e(t);break;case Oe.TRIANGLE_FAN:e.indices=p4e(t);break}e.primitiveType=Oe.LINES}return e};Cl.createLineSegmentsForVectors=function(e,t,n){t=t??"normal",n=n??1e4;let i=e.attributes.position.values,r=e.attributes[t].values,o=i.length,s=new Float64Array(2*o),a=0;for(let f=0;f<o;f+=3)s[a++]=i[f],s[a++]=i[f+1],s[a++]=i[f+2],s[a++]=i[f]+r[f]*n,s[a++]=i[f+1]+r[f+1]*n,s[a++]=i[f+2]+r[f+2]*n;let c,u=e.boundingSphere;return l(u)&&(c=new ue(u.center,u.radius+n)),new wt({attributes:{position:new Ne({componentDatatype:Y.DOUBLE,componentsPerAttribute:3,values:s})},primitiveType:Oe.LINES,boundingSphere:c})};Cl.createAttributeLocations=function(e){let t=["position","positionHigh","positionLow","position3DHigh","position3DLow","position2DHigh","position2DLow","pickColor","normal","st","tangent","bitangent","extrudeDirection","compressedAttributes"],n=e.attributes,i={},r=0,o,s=t.length;for(o=0;o<s;++o){let a=t[o];l(n[a])&&(i[a]=r++)}for(let a in n)n.hasOwnProperty(a)&&!l(i[a])&&(i[a]=r++);return i};Cl.reorderForPreVertexCache=function(e){let t=wt.computeNumberOfVertices(e),n=e.indices;if(l(n)){let i=new Int32Array(t);for(let p=0;p<t;p++)i[p]=-1;let r=n,o=r.length,s=je.createTypedArray(t,o),a=0,c=0,u=0,f;for(;a<o;)f=i[r[a]],f!==-1?s[c]=f:(f=r[a],i[f]=u,s[c]=u,++u),++a,++c;e.indices=s;let d=e.attributes;for(let p in d)if(d.hasOwnProperty(p)&&l(d[p])&&l(d[p].values)){let g=d[p],m=g.values,y=0,A=g.componentsPerAttribute,b=Y.createTypedArray(g.componentDatatype,u*A);for(;y<t;){let x=i[y];if(x!==-1)for(let T=0;T<A;T++)b[A*x+T]=m[A*y+T];++y}g.values=b}}return e};Cl.reorderForPostVertexCache=function(e,t){let n=e.indices;if(e.primitiveType===Oe.TRIANGLES&&l(n)){let i=n.length,r=0;for(let o=0;o<i;o++)n[o]>r&&(r=n[o]);e.indices=cL.tipsify({indices:n,maximumIndex:r,cacheSize:t})}return e};function oue(e){let t={};for(let n in e)if(e.hasOwnProperty(n)&&l(e[n])&&l(e[n].values)){let i=e[n];t[n]=new Ne({componentDatatype:i.componentDatatype,componentsPerAttribute:i.componentsPerAttribute,normalize:i.normalize,values:[]})}return t}function g4e(e,t,n){for(let i in t)if(t.hasOwnProperty(i)&&l(t[i])&&l(t[i].values)){let r=t[i];for(let o=0;o<r.componentsPerAttribute;++o)e[i].values.push(r.values[n*r.componentsPerAttribute+o])}}Cl.fitToUnsignedShortIndices=function(e){let t=[],n=wt.computeNumberOfVertices(e);if(l(e.indices)&&n>=P.SIXTY_FOUR_KILOBYTES){let i=[],r=[],o=0,s=oue(e.attributes),a=e.indices,c=a.length,u;e.primitiveType===Oe.TRIANGLES?u=3:e.primitiveType===Oe.LINES?u=2:e.primitiveType===Oe.POINTS&&(u=1);for(let f=0;f<c;f+=u){for(let d=0;d<u;++d){let p=a[f+d],g=i[p];l(g)||(g=o++,i[p]=g,g4e(s,e.attributes,p)),r.push(g)}o+u>=P.SIXTY_FOUR_KILOBYTES&&(t.push(new wt({attributes:s,indices:r,primitiveType:e.primitiveType,boundingSphere:e.boundingSphere,boundingSphereCV:e.boundingSphereCV})),i=[],r=[],o=0,s=oue(e.attributes))}r.length!==0&&t.push(new wt({attributes:s,indices:r,primitiveType:e.primitiveType,boundingSphere:e.boundingSphere,boundingSphereCV:e.boundingSphereCV}))}else t.push(e);return t};var sue=new h,_4e=new he;Cl.projectTo2D=function(e,t,n,i,r){let o=e.attributes[t];r=l(r)?r:new ji;let s=r.ellipsoid,a=o.values,c=new Float64Array(a.length),u=0;for(let f=0;f<a.length;f+=3){let d=h.fromArray(a,f,sue),p=s.cartesianToCartographic(d,_4e),g=r.project(p,sue);c[u++]=g.x,c[u++]=g.y,c[u++]=g.z}return e.attributes[n]=o,e.attributes[i]=new Ne({componentDatatype:Y.DOUBLE,componentsPerAttribute:3,values:c}),delete e.attributes[t],e};var JY={high:0,low:0};Cl.encodeAttribute=function(e,t,n,i){let r=e.attributes[t],o=r.values,s=o.length,a=new Float32Array(s),c=new Float32Array(s);for(let f=0;f<s;++f)Sn.encode(o[f],JY),a[f]=JY.high,c[f]=JY.low;let u=r.componentsPerAttribute;return e.attributes[n]=new Ne({componentDatatype:Y.FLOAT,componentsPerAttribute:u,values:a}),e.attributes[i]=new Ne({componentDatatype:Y.FLOAT,componentsPerAttribute:u,values:c}),delete e.attributes[t],e};var _h=new h;function ZY(e,t){if(l(t)){let n=t.values,i=n.length;for(let r=0;r<i;r+=3)h.unpack(n,r,_h),M.multiplyByPoint(e,_h,_h),h.pack(_h,n,r)}}function QY(e,t){if(l(t)){let n=t.values,i=n.length;for(let r=0;r<i;r+=3)h.unpack(n,r,_h),$.multiplyByVector(e,_h,_h),_h=h.normalize(_h,_h),h.pack(_h,n,r)}}var lL=new M,uL=new $;Cl.transformToWorldCoordinates=function(e){let t=e.modelMatrix;if(M.equals(t,M.IDENTITY))return e;let n=e.geometry.attributes;ZY(t,n.position),ZY(t,n.prevPosition),ZY(t,n.nextPosition),(l(n.normal)||l(n.tangent)||l(n.bitangent))&&(M.inverse(t,lL),M.transpose(lL,lL),M.getMatrix3(lL,uL),QY(uL,n.normal),QY(uL,n.tangent),QY(uL,n.bitangent));let i=e.geometry.boundingSphere;return l(i)&&(e.geometry.boundingSphere=ue.transform(i,t,i)),e.modelMatrix=M.clone(M.IDENTITY),e};function y4e(e,t){let n=e.length,i={},r=e[0][t].attributes,o;for(o in r)if(r.hasOwnProperty(o)&&l(r[o])&&l(r[o].values)){let s=r[o],a=s.values.length,c=!0;for(let u=1;u<n;++u){let f=e[u][t].attributes[o];if(!l(f)||s.componentDatatype!==f.componentDatatype||s.componentsPerAttribute!==f.componentsPerAttribute||s.normalize!==f.normalize){c=!1;break}a+=f.values.length}c&&(i[o]=new Ne({componentDatatype:s.componentDatatype,componentsPerAttribute:s.componentsPerAttribute,normalize:s.normalize,values:Y.createTypedArray(s.componentDatatype,a)}))}return i}var A4e=new h;function eX(e,t){let n=e.length,i,r,o,s,a=e[0].modelMatrix,c=l(e[0][t].indices),u=e[0][t].primitiveType,f=y4e(e,t),d,p,g;for(i in f)if(f.hasOwnProperty(i))for(d=f[i].values,s=0,r=0;r<n;++r)for(p=e[r][t].attributes[i].values,g=p.length,o=0;o<g;++o)d[s++]=p[o];let m;if(c){let x=0;for(r=0;r<n;++r)x+=e[r][t].indices.length;let T=wt.computeNumberOfVertices(new wt({attributes:f,primitiveType:Oe.POINTS})),E=je.createTypedArray(T,x),v=0,S=0;for(r=0;r<n;++r){let I=e[r][t].indices,R=I.length;for(s=0;s<R;++s)E[v++]=S+I[s];S+=wt.computeNumberOfVertices(e[r][t])}m=E}let y=new h,A=0,b;for(r=0;r<n;++r){if(b=e[r][t].boundingSphere,!l(b)){y=void 0;break}h.add(b.center,y,y)}if(l(y))for(h.divideByScalar(y,n,y),r=0;r<n;++r){b=e[r][t].boundingSphere;let x=h.magnitude(h.subtract(b.center,y,A4e))+b.radius;x>A&&(A=x)}return new wt({attributes:f,indices:m,primitiveType:u,boundingSphere:l(y)?new ue(y,A):void 0})}Cl.combineInstances=function(e){let t=[],n=[],i=e.length;for(let o=0;o<i;++o){let s=e[o];l(s.geometry)?t.push(s):l(s.westHemisphereGeometry)&&l(s.eastHemisphereGeometry)&&n.push(s)}let r=[];return t.length>0&&r.push(eX(t,"geometry")),n.length>0&&(r.push(eX(n,"westHemisphereGeometry")),r.push(eX(n,"eastHemisphereGeometry"))),r};var Zf=new h,$I=new h,UE=new h,zE=new h;Cl.computeNormal=function(e){let t=e.indices,n=e.attributes,i=n.position.values,r=n.position.values.length/3,o=t.length,s=new Array(r),a=new Array(o/3),c=new Array(o),u;for(u=0;u<r;u++)s[u]={indexOffset:0,count:0,currentCount:0};let f=0;for(u=0;u<o;u+=3){let m=t[u],y=t[u+1],A=t[u+2],b=m*3,x=y*3,T=A*3;$I.x=i[b],$I.y=i[b+1],$I.z=i[b+2],UE.x=i[x],UE.y=i[x+1],UE.z=i[x+2],zE.x=i[T],zE.y=i[T+1],zE.z=i[T+2],s[m].count++,s[y].count++,s[A].count++,h.subtract(UE,$I,UE),h.subtract(zE,$I,zE),a[f]=h.cross(UE,zE,new h),f++}let d=0;for(u=0;u<r;u++)s[u].indexOffset+=d,d+=s[u].count;f=0;let p;for(u=0;u<o;u+=3){p=s[t[u]];let m=p.indexOffset+p.currentCount;c[m]=f,p.currentCount++,p=s[t[u+1]],m=p.indexOffset+p.currentCount,c[m]=f,p.currentCount++,p=s[t[u+2]],m=p.indexOffset+p.currentCount,c[m]=f,p.currentCount++,f++}let g=new Float32Array(r*3);for(u=0;u<r;u++){let m=u*3;if(p=s[u],h.clone(h.ZERO,Zf),p.count>0){for(f=0;f<p.count;f++)h.add(Zf,a[c[p.indexOffset+f]],Zf);h.equalsEpsilon(h.ZERO,Zf,P.EPSILON10)&&h.clone(a[c[p.indexOffset]],Zf)}h.equalsEpsilon(h.ZERO,Zf,P.EPSILON10)&&(Zf.z=1),h.normalize(Zf,Zf),g[m]=Zf.x,g[m+1]=Zf.y,g[m+2]=Zf.z}return e.attributes.normal=new Ne({componentDatatype:Y.FLOAT,componentsPerAttribute:3,values:g}),e};var b4e=new h,aue=new h,x4e=new h;Cl.computeTangentAndBitangent=function(e){let t=e.attributes,n=e.indices,i=e.attributes.position.values,r=e.attributes.normal.values,o=e.attributes.st.values,s=e.attributes.position.values.length/3,a=n.length,c=new Array(s*3),u;for(u=0;u<c.length;u++)c[u]=0;let f,d,p;for(u=0;u<a;u+=3){let y=n[u],A=n[u+1],b=n[u+2];f=y*3,d=A*3,p=b*3;let x=y*2,T=A*2,E=b*2,v=i[f],S=i[f+1],I=i[f+2],R=o[x],O=o[x+1],L=o[T+1]-O,_=o[E+1]-O,C=1/((o[T]-R)*_-(o[E]-R)*L),w=(_*(i[d]-v)-L*(i[p]-v))*C,D=(_*(i[d+1]-S)-L*(i[p+1]-S))*C,N=(_*(i[d+2]-I)-L*(i[p+2]-I))*C;c[f]+=w,c[f+1]+=D,c[f+2]+=N,c[d]+=w,c[d+1]+=D,c[d+2]+=N,c[p]+=w,c[p+1]+=D,c[p+2]+=N}let g=new Float32Array(s*3),m=new Float32Array(s*3);for(u=0;u<s;u++){f=u*3,d=f+1,p=f+2;let y=h.fromArray(r,f,b4e),A=h.fromArray(c,f,x4e),b=h.dot(y,A);h.multiplyByScalar(y,b,aue),h.normalize(h.subtract(A,aue,A),A),g[f]=A.x,g[d]=A.y,g[p]=A.z,h.normalize(h.cross(y,A,A),A),m[f]=A.x,m[d]=A.y,m[p]=A.z}return e.attributes.tangent=new Ne({componentDatatype:Y.FLOAT,componentsPerAttribute:3,values:g}),e.attributes.bitangent=new Ne({componentDatatype:Y.FLOAT,componentsPerAttribute:3,values:m}),e};var JI=new U,gh=new h,cue=new h,lue=new h,fL=new U;Cl.compressVertices=function(e){let t=e.attributes.extrudeDirection,n,i;if(l(t)){let S=t.values;i=S.length/3;let I=new Float32Array(i*2),R=0;for(n=0;n<i;++n){if(h.fromArray(S,n*3,gh),h.equals(gh,h.ZERO)){R+=2;continue}fL=cn.octEncodeInRange(gh,65535,fL),I[R++]=fL.x,I[R++]=fL.y}return e.attributes.compressedAttributes=new Ne({componentDatatype:Y.FLOAT,componentsPerAttribute:2,values:I}),delete e.attributes.extrudeDirection,e}let r=e.attributes.normal,o=e.attributes.st,s=l(r),a=l(o);if(!s&&!a)return e;let c=e.attributes.tangent,u=e.attributes.bitangent,f=l(c),d=l(u),p,g,m,y;s&&(p=r.values),a&&(g=o.values),f&&(m=c.values),d&&(y=u.values),i=(s?p.length:g.length)/(s?3:2);let x=i,T=a&&s?2:1;T+=f||d?1:0,x*=T;let E=new Float32Array(x),v=0;for(n=0;n<i;++n){a&&(U.fromArray(g,n*2,JI),E[v++]=cn.compressTextureCoordinates(JI));let S=n*3;s&&l(m)&&l(y)?(h.fromArray(p,S,gh),h.fromArray(m,S,cue),h.fromArray(y,S,lue),cn.octPack(gh,cue,lue,JI),E[v++]=JI.x,E[v++]=JI.y):(s&&(h.fromArray(p,S,gh),E[v++]=cn.octEncodeFloat(gh)),f&&(h.fromArray(m,S,gh),E[v++]=cn.octEncodeFloat(gh)),d&&(h.fromArray(y,S,gh),E[v++]=cn.octEncodeFloat(gh)))}return e.attributes.compressedAttributes=new Ne({componentDatatype:Y.FLOAT,componentsPerAttribute:T,values:E}),s&&delete e.attributes.normal,a&&delete e.attributes.st,d&&delete e.attributes.bitangent,f&&delete e.attributes.tangent,e};function T4e(e){if(l(e.indices))return e;let t=wt.computeNumberOfVertices(e),n=je.createTypedArray(t,t);for(let i=0;i<t;++i)n[i]=i;return e.indices=n,e}function E4e(e){let t=wt.computeNumberOfVertices(e),n=je.createTypedArray(t,(t-2)*3);n[0]=1,n[1]=0,n[2]=2;let i=3;for(let r=3;r<t;++r)n[i++]=r-1,n[i++]=0,n[i++]=r;return e.indices=n,e.primitiveType=Oe.TRIANGLES,e}function C4e(e){let t=wt.computeNumberOfVertices(e),n=je.createTypedArray(t,(t-2)*3);n[0]=0,n[1]=1,n[2]=2,t>3&&(n[3]=0,n[4]=2,n[5]=3);let i=6;for(let r=3;r<t-1;r+=2)n[i++]=r,n[i++]=r-1,n[i++]=r+1,r+2<t&&(n[i++]=r,n[i++]=r+1,n[i++]=r+2);return e.indices=n,e.primitiveType=Oe.TRIANGLES,e}function v4e(e){if(l(e.indices))return e;let t=wt.computeNumberOfVertices(e),n=je.createTypedArray(t,t);for(let i=0;i<t;++i)n[i]=i;return e.indices=n,e}function S4e(e){let t=wt.computeNumberOfVertices(e),n=je.createTypedArray(t,(t-1)*2);n[0]=0,n[1]=1;let i=2;for(let r=2;r<t;++r)n[i++]=r-1,n[i++]=r;return e.indices=n,e.primitiveType=Oe.LINES,e}function w4e(e){let t=wt.computeNumberOfVertices(e),n=je.createTypedArray(t,t*2);n[0]=0,n[1]=1;let i=2;for(let r=2;r<t;++r)n[i++]=r-1,n[i++]=r;return n[i++]=t-1,n[i]=0,e.indices=n,e.primitiveType=Oe.LINES,e}function I4e(e){switch(e.primitiveType){case Oe.TRIANGLE_FAN:return E4e(e);case Oe.TRIANGLE_STRIP:return C4e(e);case Oe.TRIANGLES:return T4e(e);case Oe.LINE_STRIP:return S4e(e);case Oe.LINE_LOOP:return w4e(e);case Oe.LINES:return v4e(e)}return e}function R_(e,t){Math.abs(e.y)<P.EPSILON6&&(t?e.y=-P.EPSILON6:e.y=P.EPSILON6)}function P4e(e,t,n){if(e.y!==0&&t.y!==0&&n.y!==0){R_(e,e.y<0),R_(t,t.y<0),R_(n,n.y<0);return}let i=Math.abs(e.y),r=Math.abs(t.y),o=Math.abs(n.y),s;i>r?i>o?s=P.sign(e.y):s=P.sign(n.y):r>o?s=P.sign(t.y):s=P.sign(n.y);let a=s<0;R_(e,a),R_(t,a),R_(n,a)}var uue=new h;function Qf(e,t,n,i){h.add(e,h.multiplyByScalar(h.subtract(t,e,uue),e.y/(e.y-t.y),uue),n),h.clone(n,i),R_(n,!0),R_(i,!1)}var Cb=new h,vb=new h,Sb=new h,wb=new h,tX={positions:new Array(7),indices:new Array(9)};function D4e(e,t,n){if(e.x>=0||t.x>=0||n.x>=0)return;P4e(e,t,n);let i=e.y<0,r=t.y<0,o=n.y<0,s=0;s+=i?1:0,s+=r?1:0,s+=o?1:0;let a=tX.indices;s===1?(a[1]=3,a[2]=4,a[5]=6,a[7]=6,a[8]=5,i?(Qf(e,t,Cb,Sb),Qf(e,n,vb,wb),a[0]=0,a[3]=1,a[4]=2,a[6]=1):r?(Qf(t,n,Cb,Sb),Qf(t,e,vb,wb),a[0]=1,a[3]=2,a[4]=0,a[6]=2):o&&(Qf(n,e,Cb,Sb),Qf(n,t,vb,wb),a[0]=2,a[3]=0,a[4]=1,a[6]=0)):s===2&&(a[2]=4,a[4]=4,a[5]=3,a[7]=5,a[8]=6,i?r?o||(Qf(n,e,Cb,Sb),Qf(n,t,vb,wb),a[0]=0,a[1]=1,a[3]=0,a[6]=2):(Qf(t,n,Cb,Sb),Qf(t,e,vb,wb),a[0]=2,a[1]=0,a[3]=2,a[6]=1):(Qf(e,t,Cb,Sb),Qf(e,n,vb,wb),a[0]=1,a[1]=2,a[3]=1,a[6]=0));let c=tX.positions;return c[0]=e,c[1]=t,c[2]=n,c.length=3,(s===1||s===2)&&(c[3]=Cb,c[4]=vb,c[5]=Sb,c[6]=wb,c.length=7),tX}function fue(e,t){let n=e.attributes;if(n.position.values.length===0)return;for(let r in n)if(n.hasOwnProperty(r)&&l(n[r])&&l(n[r].values)){let o=n[r];o.values=Y.createTypedArray(o.componentDatatype,o.values)}let i=wt.computeNumberOfVertices(e);return e.indices=je.createTypedArray(i,e.indices),t&&(e.boundingSphere=ue.fromVertices(n.position.values)),e}function jE(e){let t=e.attributes,n={};for(let i in t)if(t.hasOwnProperty(i)&&l(t[i])&&l(t[i].values)){let r=t[i];n[i]=new Ne({componentDatatype:r.componentDatatype,componentsPerAttribute:r.componentsPerAttribute,normalize:r.normalize,values:[]})}return new wt({attributes:n,indices:[],primitiveType:e.primitiveType})}function oX(e,t,n){let i=l(e.geometry.boundingSphere);t=fue(t,i),n=fue(n,i),l(n)&&!l(t)?e.geometry=n:!l(n)&&l(t)?e.geometry=t:(e.westHemisphereGeometry=t,e.eastHemisphereGeometry=n,e.geometry=void 0)}function sX(e,t){let n=new e,i=new e,r=new e;return function(o,s,a,c,u,f,d,p){let g=e.fromArray(u,o*t,n),m=e.fromArray(u,s*t,i),y=e.fromArray(u,a*t,r);e.multiplyByScalar(g,c.x,g),e.multiplyByScalar(m,c.y,m),e.multiplyByScalar(y,c.z,y);let A=e.add(g,m,g);e.add(A,y,A),p&&e.normalize(A,A),e.pack(A,f,d*t)}}var R4e=sX(se,4),mL=sX(h,3),_ue=sX(U,2),O4e=function(e,t,n,i,r,o,s){let a=r[e]*i.x,c=r[t]*i.y,u=r[n]*i.z;o[s]=a+c+u>P.EPSILON6?1:0},ZI=new h,nX=new h,iX=new h,M4e=new h;function dL(e,t,n,i,r,o,s,a,c,u,f,d,p,g,m,y){if(!l(o)&&!l(s)&&!l(a)&&!l(c)&&!l(u)&&g===0)return;let A=h.fromArray(r,e*3,ZI),b=h.fromArray(r,t*3,nX),x=h.fromArray(r,n*3,iX),T=BE(i,A,b,x,M4e);if(l(T)){if(l(o)&&mL(e,t,n,T,o,d.normal.values,y,!0),l(u)){let E=h.fromArray(u,e*3,ZI),v=h.fromArray(u,t*3,nX),S=h.fromArray(u,n*3,iX);h.multiplyByScalar(E,T.x,E),h.multiplyByScalar(v,T.y,v),h.multiplyByScalar(S,T.z,S);let I;!h.equals(E,h.ZERO)||!h.equals(v,h.ZERO)||!h.equals(S,h.ZERO)?(I=h.add(E,v,E),h.add(I,S,I),h.normalize(I,I)):(I=ZI,I.x=0,I.y=0,I.z=0),h.pack(I,d.extrudeDirection.values,y*3)}if(l(f)&&O4e(e,t,n,T,f,d.applyOffset.values,y),l(s)&&mL(e,t,n,T,s,d.tangent.values,y,!0),l(a)&&mL(e,t,n,T,a,d.bitangent.values,y,!0),l(c)&&_ue(e,t,n,T,c,d.st.values,y),g>0)for(let E=0;E<g;E++){let v=p[E];N4e(e,t,n,T,y,m[v],d[v])}}}function N4e(e,t,n,i,r,o,s){let a=o.componentsPerAttribute,c=o.values,u=s.values;switch(a){case 4:R4e(e,t,n,i,c,u,r,!1);break;case 3:mL(e,t,n,i,c,u,r,!1);break;case 2:_ue(e,t,n,i,c,u,r,!1);break;default:u[r]=c[e]*i.x+c[t]*i.y+c[n]*i.z}}function qm(e,t,n,i,r,o){let s=e.position.values.length/3;if(r!==-1){let a=i[r],c=n[a];return c===-1?(n[a]=s,e.position.values.push(o.x,o.y,o.z),t.push(s),s):(t.push(c),c)}return e.position.values.push(o.x,o.y,o.z),t.push(s),s}var L4e={position:!0,normal:!0,bitangent:!0,tangent:!0,st:!0,extrudeDirection:!0,applyOffset:!0};function due(e){let t=e.geometry,n=t.attributes,i=n.position.values,r=l(n.normal)?n.normal.values:void 0,o=l(n.bitangent)?n.bitangent.values:void 0,s=l(n.tangent)?n.tangent.values:void 0,a=l(n.st)?n.st.values:void 0,c=l(n.extrudeDirection)?n.extrudeDirection.values:void 0,u=l(n.applyOffset)?n.applyOffset.values:void 0,f=t.indices,d=[];for(let I in n)n.hasOwnProperty(I)&&!L4e[I]&&l(n[I])&&d.push(I);let p=d.length,g=jE(t),m=jE(t),y,A,b,x,T,E=[];E.length=i.length/3;let v=[];for(v.length=i.length/3,T=0;T<E.length;++T)E[T]=-1,v[T]=-1;let S=f.length;for(T=0;T<S;T+=3){let I=f[T],R=f[T+1],O=f[T+2],L=h.fromArray(i,I*3),_=h.fromArray(i,R*3),C=h.fromArray(i,O*3),w=D4e(L,_,C);if(l(w)&&w.positions.length>3){let D=w.positions,N=w.indices,F=N.length;for(let V=0;V<F;++V){let B=N[V],j=D[B];j.y<0?(y=m.attributes,A=m.indices,b=E):(y=g.attributes,A=g.indices,b=v),x=qm(y,A,b,f,B<3?T+B:-1,j),dL(I,R,O,j,i,r,s,o,a,c,u,y,d,p,n,x)}}else l(w)&&(L=w.positions[0],_=w.positions[1],C=w.positions[2]),L.y<0?(y=m.attributes,A=m.indices,b=E):(y=g.attributes,A=g.indices,b=v),x=qm(y,A,b,f,T,L),dL(I,R,O,L,i,r,s,o,a,c,u,y,d,p,n,x),x=qm(y,A,b,f,T+1,_),dL(I,R,O,_,i,r,s,o,a,c,u,y,d,p,n,x),x=qm(y,A,b,f,T+2,C),dL(I,R,O,C,i,r,s,o,a,c,u,y,d,p,n,x)}oX(e,m,g)}var yue=sn.fromPointNormal(h.ZERO,h.UNIT_Y),F4e=new h,B4e=new h;function VE(e,t,n,i,r,o,s){if(!l(s))return;let a=h.fromArray(i,e*3,ZI);h.equalsEpsilon(a,n,P.EPSILON10)?o.applyOffset.values[r]=s[e]:o.applyOffset.values[r]=s[t]}function hue(e){let t=e.geometry,n=t.attributes,i=n.position.values,r=l(n.applyOffset)?n.applyOffset.values:void 0,o=t.indices,s=jE(t),a=jE(t),c,u=o.length,f=[];f.length=i.length/3;let d=[];for(d.length=i.length/3,c=0;c<f.length;++c)f[c]=-1,d[c]=-1;for(c=0;c<u;c+=2){let p=o[c],g=o[c+1],m=h.fromArray(i,p*3,ZI),y=h.fromArray(i,g*3,nX),A;Math.abs(m.y)<P.EPSILON6&&(m.y<0?m.y=-P.EPSILON6:m.y=P.EPSILON6),Math.abs(y.y)<P.EPSILON6&&(y.y<0?y.y=-P.EPSILON6:y.y=P.EPSILON6);let b=s.attributes,x=s.indices,T=d,E=a.attributes,v=a.indices,S=f,I=xi.lineSegmentPlane(m,y,yue,iX);if(l(I)){let R=h.multiplyByScalar(h.UNIT_Y,5*P.EPSILON9,F4e);m.y<0&&(h.negate(R,R),b=a.attributes,x=a.indices,T=f,E=s.attributes,v=s.indices,S=d);let O=h.add(I,R,B4e);A=qm(b,x,T,o,c,m),VE(p,g,m,i,A,b,r),A=qm(b,x,T,o,-1,O),VE(p,g,O,i,A,b,r),h.negate(R,R),h.add(I,R,O),A=qm(E,v,S,o,-1,O),VE(p,g,O,i,A,E,r),A=qm(E,v,S,o,c+1,y),VE(p,g,y,i,A,E,r)}else{let R,O,L;m.y<0?(R=a.attributes,O=a.indices,L=f):(R=s.attributes,O=s.indices,L=d),A=qm(R,O,L,o,c,m),VE(p,g,m,i,A,R,r),A=qm(R,O,L,o,c+1,y),VE(p,g,y,i,A,R,r)}}oX(e,a,s)}var mue=new U,k4e=new U,Aue=new h,bue=new h,rX=new h,U4e=new h,z4e=new h,V4e=new h,pue=new se;function gue(e){let t=e.attributes,n=t.position.values,i=t.prevPosition.values,r=t.nextPosition.values,o=n.length;for(let s=0;s<o;s+=3){let a=h.unpack(n,s,Aue);if(a.x>0)continue;let c=h.unpack(i,s,bue);(a.y<0&&c.y>0||a.y>0&&c.y<0)&&(s-3>0?(i[s]=n[s-3],i[s+1]=n[s-2],i[s+2]=n[s-1]):h.pack(a,i,s));let u=h.unpack(r,s,rX);(a.y<0&&u.y>0||a.y>0&&u.y<0)&&(s+3<o?(r[s]=n[s+3],r[s+1]=n[s+4],r[s+2]=n[s+5]):h.pack(a,r,s))}}var j4e=5*P.EPSILON9,hL=P.EPSILON6;function H4e(e){let t=e.geometry,n=t.attributes,i=n.position.values,r=n.prevPosition.values,o=n.nextPosition.values,s=n.expandAndWidth.values,a=l(n.st)?n.st.values:void 0,c=l(n.color)?n.color.values:void 0,u=jE(t),f=jE(t),d,p,g,m=!1,y=i.length/3;for(d=0;d<y;d+=4){let A=d,b=d+2,x=h.fromArray(i,A*3,Aue),T=h.fromArray(i,b*3,bue);if(Math.abs(x.y)<hL)for(x.y=hL*(T.y<0?-1:1),i[d*3+1]=x.y,i[(d+1)*3+1]=x.y,p=A*3;p<A*3+12;p+=3)r[p]=i[d*3],r[p+1]=i[d*3+1],r[p+2]=i[d*3+2];if(Math.abs(T.y)<hL)for(T.y=hL*(x.y<0?-1:1),i[(d+2)*3+1]=T.y,i[(d+3)*3+1]=T.y,p=A*3;p<A*3+12;p+=3)o[p]=i[(d+2)*3],o[p+1]=i[(d+2)*3+1],o[p+2]=i[(d+2)*3+2];let E=u.attributes,v=u.indices,S=f.attributes,I=f.indices,R=xi.lineSegmentPlane(x,T,yue,U4e);if(l(R)){m=!0;let O=h.multiplyByScalar(h.UNIT_Y,j4e,z4e);x.y<0&&(h.negate(O,O),E=f.attributes,v=f.indices,S=u.attributes,I=u.indices);let L=h.add(R,O,V4e);E.position.values.push(x.x,x.y,x.z,x.x,x.y,x.z),E.position.values.push(L.x,L.y,L.z),E.position.values.push(L.x,L.y,L.z),E.prevPosition.values.push(r[A*3],r[A*3+1],r[A*3+2]),E.prevPosition.values.push(r[A*3+3],r[A*3+4],r[A*3+5]),E.prevPosition.values.push(x.x,x.y,x.z,x.x,x.y,x.z),E.nextPosition.values.push(L.x,L.y,L.z),E.nextPosition.values.push(L.x,L.y,L.z),E.nextPosition.values.push(L.x,L.y,L.z),E.nextPosition.values.push(L.x,L.y,L.z),h.negate(O,O),h.add(R,O,L),S.position.values.push(L.x,L.y,L.z),S.position.values.push(L.x,L.y,L.z),S.position.values.push(T.x,T.y,T.z,T.x,T.y,T.z),S.prevPosition.values.push(L.x,L.y,L.z),S.prevPosition.values.push(L.x,L.y,L.z),S.prevPosition.values.push(L.x,L.y,L.z),S.prevPosition.values.push(L.x,L.y,L.z),S.nextPosition.values.push(T.x,T.y,T.z,T.x,T.y,T.z),S.nextPosition.values.push(o[b*3],o[b*3+1],o[b*3+2]),S.nextPosition.values.push(o[b*3+3],o[b*3+4],o[b*3+5]);let _=U.fromArray(s,A*2,mue),C=Math.abs(_.y);E.expandAndWidth.values.push(-1,C,1,C),E.expandAndWidth.values.push(-1,-C,1,-C),S.expandAndWidth.values.push(-1,C,1,C),S.expandAndWidth.values.push(-1,-C,1,-C);let w=h.magnitudeSquared(h.subtract(R,x,rX));if(w/=h.magnitudeSquared(h.subtract(T,x,rX)),l(c)){let D=se.fromArray(c,A*4,pue),N=se.fromArray(c,b*4,pue),F=P.lerp(D.x,N.x,w),V=P.lerp(D.y,N.y,w),B=P.lerp(D.z,N.z,w),j=P.lerp(D.w,N.w,w);for(p=A*4;p<A*4+8;++p)E.color.values.push(c[p]);for(E.color.values.push(F,V,B,j),E.color.values.push(F,V,B,j),S.color.values.push(F,V,B,j),S.color.values.push(F,V,B,j),p=b*4;p<b*4+8;++p)S.color.values.push(c[p])}if(l(a)){let D=U.fromArray(a,A*2,mue),N=U.fromArray(a,(d+3)*2,k4e),F=P.lerp(D.x,N.x,w);for(p=A*2;p<A*2+4;++p)E.st.values.push(a[p]);for(E.st.values.push(F,D.y),E.st.values.push(F,N.y),S.st.values.push(F,D.y),S.st.values.push(F,N.y),p=b*2;p<b*2+4;++p)S.st.values.push(a[p])}g=E.position.values.length/3-4,v.push(g,g+2,g+1),v.push(g+1,g+2,g+3),g=S.position.values.length/3-4,I.push(g,g+2,g+1),I.push(g+1,g+2,g+3)}else{let O,L;for(x.y<0?(O=f.attributes,L=f.indices):(O=u.attributes,L=u.indices),O.position.values.push(x.x,x.y,x.z),O.position.values.push(x.x,x.y,x.z),O.position.values.push(T.x,T.y,T.z),O.position.values.push(T.x,T.y,T.z),p=d*3;p<d*3+12;++p)O.prevPosition.values.push(r[p]),O.nextPosition.values.push(o[p]);for(p=d*2;p<d*2+8;++p)O.expandAndWidth.values.push(s[p]),l(a)&&O.st.values.push(a[p]);if(l(c))for(p=d*4;p<d*4+16;++p)O.color.values.push(c[p]);g=O.position.values.length/3-4,L.push(g,g+2,g+1),L.push(g+1,g+2,g+3)}}m&&(gue(f),gue(u)),oX(e,f,u)}Cl.splitLongitude=function(e){let t=e.geometry,n=t.boundingSphere;if(l(n)&&(n.center.x-n.radius>0||ue.intersectPlane(n,sn.ORIGIN_ZX_PLANE)!==$t.INTERSECTING))return e;if(t.geometryType!==mh.NONE)switch(t.geometryType){case mh.POLYLINES:H4e(e);break;case mh.TRIANGLES:due(e);break;case mh.LINES:hue(e);break}else I4e(t),t.primitiveType===Oe.TRIANGLES?due(e):t.primitiveType===Oe.LINES&&hue(e);return e};var Wn=Cl;function QI(e,t,n,i,r,o,s,a,c,u,f){this._context=e,this._texture=t,this._textureTarget=n,this._targetFace=i,this._pixelDatatype=s,this._internalFormat=r,this._pixelFormat=o,this._size=a,this._preMultiplyAlpha=c,this._flipY=u,this._initialized=f}Object.defineProperties(QI.prototype,{pixelFormat:{get:function(){return this._pixelFormat}},pixelDatatype:{get:function(){return this._pixelDatatype}},_target:{get:function(){return this._targetFace}}});QI.prototype.copyFrom=function(e){let{xOffset:t=0,yOffset:n=0,source:i,skipColorSpaceConversion:r=!1}=e,{width:o,height:s}=i,a=this._context._gl,c=this._textureTarget,u=this._targetFace;a.activeTexture(a.TEXTURE0),a.bindTexture(c,this._texture);let f=i.arrayBufferView,d=this._size,p=this._pixelFormat,g=this._internalFormat,m=this._pixelDatatype,y=this._preMultiplyAlpha,A=this._flipY,b=4;l(f)&&(b=$e.alignmentInBytes(p,m,o)),a.pixelStorei(a.UNPACK_ALIGNMENT,b),r?a.pixelStorei(a.UNPACK_COLORSPACE_CONVERSION_WEBGL,a.NONE):a.pixelStorei(a.UNPACK_COLORSPACE_CONVERSION_WEBGL,a.BROWSER_DEFAULT_WEBGL);let x=!1;if(!this._initialized){let T;t===0&&n===0&&o===d&&s===d?(l(f)?(a.pixelStorei(a.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!1),a.pixelStorei(a.UNPACK_FLIP_Y_WEBGL,!1),A&&(f=$e.flipY(f,p,m,d,d)),T=f):(a.pixelStorei(a.UNPACK_PREMULTIPLY_ALPHA_WEBGL,y),a.pixelStorei(a.UNPACK_FLIP_Y_WEBGL,A),T=i),x=!0):(a.pixelStorei(a.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!1),a.pixelStorei(a.UNPACK_FLIP_Y_WEBGL,!1),T=$e.createTypedArray(p,m,d,d)),a.texImage2D(u,0,g,d,d,0,p,ze.toWebGLConstant(m,this._context),T),this._initialized=!0}x||(l(f)?(a.pixelStorei(a.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!1),a.pixelStorei(a.UNPACK_FLIP_Y_WEBGL,!1),A&&(f=$e.flipY(f,p,m,o,s)),a.texSubImage2D(u,0,t,n,o,s,p,ze.toWebGLConstant(m,this._context),f)):(a.pixelStorei(a.UNPACK_PREMULTIPLY_ALPHA_WEBGL,y),a.pixelStorei(a.UNPACK_FLIP_Y_WEBGL,A),a.texSubImage2D(u,0,t,n,p,ze.toWebGLConstant(m,this._context),i))),a.bindTexture(c,null)};QI.prototype.copyFromFramebuffer=function(e,t,n,i,r,o){e=e??0,t=t??0,n=n??0,i=i??0,r=r??this._size,o=o??this._size;let s=this._context._gl,a=this._textureTarget;s.activeTexture(s.TEXTURE0),s.bindTexture(a,this._texture),s.copyTexSubImage2D(this._targetFace,0,e,t,n,i,r,o),s.bindTexture(a,null),this._initialized=!0};QI.prototype.copyMipmapFromFramebuffer=function(e,t,n,i,r){e=e??0,t=t??0,n=n??this._size,i=i??this._size,r=r??0;let o=this._context._gl,s=this._textureTarget;o.activeTexture(o.TEXTURE0),o.bindTexture(s,this._texture),o.copyTexImage2D(this._targetFace,r,this._internalFormat,e,t,n,i,0),o.bindTexture(s,null),this._initialized=!0};var gL=QI;var eP={DONT_CARE:te.DONT_CARE,FASTEST:te.FASTEST,NICEST:te.NICEST,validate:function(e){return e===eP.DONT_CARE||e===eP.FASTEST||e===eP.NICEST}};Object.freeze(eP);var yh=eP;var tP={NEAREST:te.NEAREST,LINEAR:te.LINEAR};tP.validate=function(e){return e===tP.NEAREST||e===tP.LINEAR};Object.freeze(tP);var Jn=tP;var U0={NEAREST:te.NEAREST,LINEAR:te.LINEAR,NEAREST_MIPMAP_NEAREST:te.NEAREST_MIPMAP_NEAREST,LINEAR_MIPMAP_NEAREST:te.LINEAR_MIPMAP_NEAREST,NEAREST_MIPMAP_LINEAR:te.NEAREST_MIPMAP_LINEAR,LINEAR_MIPMAP_LINEAR:te.LINEAR_MIPMAP_LINEAR};U0.validate=function(e){return e===U0.NEAREST||e===U0.LINEAR||e===U0.NEAREST_MIPMAP_NEAREST||e===U0.LINEAR_MIPMAP_NEAREST||e===U0.NEAREST_MIPMAP_LINEAR||e===U0.LINEAR_MIPMAP_LINEAR};Object.freeze(U0);var Wt=U0;var nP={CLAMP_TO_EDGE:te.CLAMP_TO_EDGE,REPEAT:te.REPEAT,MIRRORED_REPEAT:te.MIRRORED_REPEAT,validate:function(e){return e===nP.CLAMP_TO_EDGE||e===nP.REPEAT||e===nP.MIRRORED_REPEAT}};Object.freeze(nP);var hn=nP;function iP(e){e=e??H.EMPTY_OBJECT;let{wrapR:t=hn.CLAMP_TO_EDGE,wrapS:n=hn.CLAMP_TO_EDGE,wrapT:i=hn.CLAMP_TO_EDGE,minificationFilter:r=Wt.LINEAR,magnificationFilter:o=Jn.LINEAR,maximumAnisotropy:s=1}=e;this._wrapR=t,this._wrapS=n,this._wrapT=i,this._minificationFilter=r,this._magnificationFilter=o,this._maximumAnisotropy=s}Object.defineProperties(iP.prototype,{wrapR:{get:function(){return this._wrapR}},wrapS:{get:function(){return this._wrapS}},wrapT:{get:function(){return this._wrapT}},minificationFilter:{get:function(){return this._minificationFilter}},magnificationFilter:{get:function(){return this._magnificationFilter}},maximumAnisotropy:{get:function(){return this._maximumAnisotropy}}});iP.equals=function(e,t){return e===t||l(e)&&l(t)&&e._wrapR===t._wrapR&&e._wrapS===t._wrapS&&e._wrapT===t._wrapT&&e._minificationFilter===t._minificationFilter&&e._magnificationFilter===t._magnificationFilter&&e._maximumAnisotropy===t._maximumAnisotropy};iP.NEAREST=Object.freeze(new iP({wrapR:hn.CLAMP_TO_EDGE,wrapS:hn.CLAMP_TO_EDGE,wrapT:hn.CLAMP_TO_EDGE,minificationFilter:Wt.NEAREST,magnificationFilter:Jn.NEAREST}));var Ht=iP;function G4e(e,t){if(!e)throw new pe(t)}var xue=G4e;function W4e(e,t,n,i){let r=l(t.vertexBuffer),o=l(t.value),s=t.value?t.value.length:t.componentsPerAttribute,a={index:t.index??n,enabled:t.enabled??!0,vertexBuffer:t.vertexBuffer,value:o?t.value.slice(0):void 0,componentsPerAttribute:s,componentDatatype:t.componentDatatype??Y.FLOAT,normalize:t.normalize??!1,offsetInBytes:t.offsetInBytes??0,strideInBytes:t.strideInBytes??0,instanceDivisor:t.instanceDivisor??0};if(r)a.vertexAttrib=function(c){let u=this.index;c.bindBuffer(c.ARRAY_BUFFER,this.vertexBuffer._getBuffer()),c.vertexAttribPointer(u,this.componentsPerAttribute,this.componentDatatype,this.normalize,this.strideInBytes,this.offsetInBytes),c.enableVertexAttribArray(u),this.instanceDivisor>0&&(i.glVertexAttribDivisor(u,this.instanceDivisor),i._vertexAttribDivisors[u]=this.instanceDivisor,i._previousDrawInstanced=!0)},a.disableVertexAttribArray=function(c){c.disableVertexAttribArray(this.index),this.instanceDivisor>0&&i.glVertexAttribDivisor(n,0)};else{switch(a.componentsPerAttribute){case 1:a.vertexAttrib=function(c){c.vertexAttrib1fv(this.index,this.value)};break;case 2:a.vertexAttrib=function(c){c.vertexAttrib2fv(this.index,this.value)};break;case 3:a.vertexAttrib=function(c){c.vertexAttrib3fv(this.index,this.value)};break;case 4:a.vertexAttrib=function(c){c.vertexAttrib4fv(this.index,this.value)};break}a.disableVertexAttribArray=function(c){}}e.push(a)}function Eue(e,t,n){for(let i=0;i<t.length;++i){let r=t[i];r.enabled&&r.vertexAttrib(e)}l(n)&&e.bindBuffer(e.ELEMENT_ARRAY_BUFFER,n._getBuffer())}function Ah(e){e=e??H.EMPTY_OBJECT;let t=e.context,n=t._gl,i=e.attributes,r=e.indexBuffer,o,s=[],a=1,c=!1,u=!1,f=i.length;for(o=0;o<f;++o)W4e(s,i[o],o,t);for(f=s.length,o=0;o<f;++o){let p=s[o];if(l(p.vertexBuffer)&&p.instanceDivisor===0){let g=p.strideInBytes||p.componentsPerAttribute*Y.getSizeInBytes(p.componentDatatype);a=p.vertexBuffer.sizeInBytes/g;break}}for(o=0;o<f;++o)s[o].instanceDivisor>0&&(c=!0),l(s[o].value)&&(u=!0);let d;t.vertexArrayObject&&(d=t.glCreateVertexArray(),t.glBindVertexArray(d),Eue(n,s,r),t.glBindVertexArray(null)),this._numberOfVertices=a,this._hasInstancedAttributes=c,this._hasConstantAttributes=u,this._context=t,this._gl=n,this._vao=d,this._attributes=s,this._indexBuffer=r}function Tue(e){return e.values.length/e.componentsPerAttribute}function q4e(e){return Y.getSizeInBytes(e.componentDatatype)*e.componentsPerAttribute}function Y4e(e){let t,n,i,r=[];for(n in e)e.hasOwnProperty(n)&&l(e[n])&&l(e[n].values)&&(r.push(n),e[n].componentDatatype===Y.DOUBLE&&(e[n].componentDatatype=Y.FLOAT,e[n].values=Y.createTypedArray(Y.FLOAT,e[n].values)));let o,s=r.length;if(s>0)for(o=Tue(e[r[0]]),t=1;t<s;++t){let u=Tue(e[r[t]]);if(u!==o)throw new oe(`Each attribute list must have the same number of vertices. Attribute ${r[t]} has a different number of vertices (${u.toString()}) than attribute ${r[0]} (${o.toString()}).`)}r.sort(function(u,f){return Y.getSizeInBytes(e[f].componentDatatype)-Y.getSizeInBytes(e[u].componentDatatype)});let a=0,c={};for(t=0;t<s;++t)n=r[t],i=e[n],c[n]=a,a+=q4e(i);if(a>0){let u=Y.getSizeInBytes(e[r[0]].componentDatatype),f=a%u;f!==0&&(a+=u-f);let d=o*a,p=new ArrayBuffer(d),g={};for(t=0;t<s;++t){n=r[t];let m=Y.getSizeInBytes(e[n].componentDatatype);g[n]={pointer:Y.createTypedArray(e[n].componentDatatype,p),index:c[n]/m,strideInComponentType:a/m}}for(t=0;t<o;++t)for(let m=0;m<s;++m){n=r[m],i=e[n];let y=i.values,A=g[n],b=A.pointer,x=i.componentsPerAttribute;for(let T=0;T<x;++T)b[A.index+T]=y[t*x+T];A.index+=A.strideInComponentType}return{buffer:p,offsetsInBytes:c,vertexSizeInBytes:a}}}Ah.fromGeometry=function(e){e=e??H.EMPTY_OBJECT;let t=e.context,n=e.geometry??H.EMPTY_OBJECT,i=e.bufferUsage??Me.DYNAMIC_DRAW,r=e.attributeLocations??H.EMPTY_OBJECT,o=e.interleave??!1,s=e.vertexArrayAttributes,a,c,u,f=l(s)?s:[],d=n.attributes;if(o){let m=Y4e(d);if(l(m)){u=tt.createVertexBuffer({context:t,typedArray:m.buffer,usage:i});let y=m.offsetsInBytes,A=m.vertexSizeInBytes;for(a in d)d.hasOwnProperty(a)&&l(d[a])&&(c=d[a],l(c.values)?f.push({index:r[a],vertexBuffer:u,componentDatatype:c.componentDatatype,componentsPerAttribute:c.componentsPerAttribute,normalize:c.normalize,offsetInBytes:y[a],strideInBytes:A}):f.push({index:r[a],value:c.value,componentDatatype:c.componentDatatype,normalize:c.normalize}))}}else for(a in d)if(d.hasOwnProperty(a)&&l(d[a])){c=d[a];let m=c.componentDatatype;m===Y.DOUBLE&&(m=Y.FLOAT);let y={};l(c.values)&&(u=tt.createVertexBuffer({context:t,typedArray:Y.createTypedArray(m,c.values),usage:i}),y={index:r[a],vertexBuffer:u,value:c.value,componentDatatype:m,componentsPerAttribute:c.componentsPerAttribute,normalize:c.normalize}),l(c.typedArray)&&(u=tt.createVertexBuffer({context:t,typedArray:c.typedArray,usage:i}),y={index:r[a],vertexBuffer:u,value:void 0,componentDatatype:m,componentsPerAttribute:Vt.getNumberOfComponents(c.type),normalize:c.normalized,instanceDivisor:c.instanceDivisor}),f.push(y)}let p,g=n.indices;return l(g)&&(wt.computeNumberOfVertices(n)>=P.SIXTY_FOUR_KILOBYTES&&t.elementIndexUint?p=tt.createIndexBuffer({context:t,typedArray:new Uint32Array(g),usage:i,indexDatatype:je.UNSIGNED_INT}):p=tt.createIndexBuffer({context:t,typedArray:new Uint16Array(g),usage:i,indexDatatype:je.UNSIGNED_SHORT})),new Ah({context:t,attributes:f,indexBuffer:p})};Object.defineProperties(Ah.prototype,{numberOfAttributes:{get:function(){return this._attributes.length}},numberOfVertices:{get:function(){return this._numberOfVertices}},indexBuffer:{get:function(){return this._indexBuffer}}});Ah.prototype.getAttribute=function(e){return this._attributes[e]};function X4e(e){let t=e._context,n=e._hasInstancedAttributes;if(!n&&!t._previousDrawInstanced)return;t._previousDrawInstanced=n;let i=t._vertexAttribDivisors,r=e._attributes,o=Ut.maximumVertexAttributes,s;if(n){let a=r.length;for(s=0;s<a;++s){let c=r[s];if(c.enabled){let u=c.instanceDivisor,f=c.index;u!==i[f]&&(t.glVertexAttribDivisor(f,u),i[f]=u)}}}else for(s=0;s<o;++s)i[s]>0&&(t.glVertexAttribDivisor(s,0),i[s]=0)}function K4e(e,t){let n=e._attributes,i=n.length;for(let r=0;r<i;++r){let o=n[r];o.enabled&&l(o.value)&&o.vertexAttrib(t)}}Ah.prototype.copyAttributeFromRange=function(e,t,n,i){let r=this.getAttribute(e),o=r.vertexBuffer,s=r.componentsPerAttribute,a=t.constructor,c=n*s*a.BYTES_PER_ELEMENT,u=new a(t.buffer,t.byteOffset+c,i*s);o.copyFromArrayView(u,c)};Ah.prototype.copyIndexFromRange=function(e,t,n){let i=this._indexBuffer,r=e.constructor,o=t*r.BYTES_PER_ELEMENT,s=new r(e.buffer,e.byteOffset+o,n);i.copyFromArrayView(s,o)};Ah.prototype._bind=function(){l(this._vao)?(this._context.glBindVertexArray(this._vao),this._context.instancedArrays&&X4e(this),this._hasConstantAttributes&&K4e(this,this._gl)):Eue(this._gl,this._attributes,this._indexBuffer)};Ah.prototype._unBind=function(){if(l(this._vao))this._context.glBindVertexArray(null);else{let e=this._attributes,t=this._gl;for(let n=0;n<e.length;++n){let i=e[n];i.enabled&&i.disableVertexAttribArray(t)}this._indexBuffer&&t.bindBuffer(t.ELEMENT_ARRAY_BUFFER,null)}};Ah.prototype.isDestroyed=function(){return!1};Ah.prototype.destroy=function(){let e=this._attributes;for(let n=0;n<e.length;++n){let i=e[n].vertexBuffer;l(i)&&!i.isDestroyed()&&i.vertexArrayDestroyable&&i.destroy()}let t=this._indexBuffer;return l(t)&&!t.isDestroyed()&&t.vertexArrayDestroyable&&t.destroy(),l(this._vao)&&this._context.glDeleteVertexArray(this._vao),le(this)};var Vn=Ah;function To(e){e=e??H.EMPTY_OBJECT;let{context:t,source:n,pixelFormat:i=$e.RGBA,pixelDatatype:r=ze.UNSIGNED_BYTE,flipY:o=!0,skipColorSpaceConversion:s=!1,sampler:a=new Ht}=e,c=e.preMultiplyAlpha||i===$e.RGB||i===$e.LUMINANCE,{width:u,height:f}=e;l(n)&&({width:u,height:f}=n.positiveX);let d=u,p=$e.textureSizeInBytes(i,r,d,d)*6,g=$e.toInternalFormat(i,r,t),m=t._gl,y=m.TEXTURE_CUBE_MAP,A=m.createTexture();this._context=t,this._textureFilterAnisotropic=t._textureFilterAnisotropic,this._textureTarget=y,this._texture=A,this._pixelFormat=i,this._pixelDatatype=r,this._size=d,this._hasMipmap=!1,this._sizeInBytes=p,this._preMultiplyAlpha=c,this._flipY=o;let b=l(n);function x(T){return new gL(t,A,y,T,g,i,r,d,c,o,b)}this._positiveX=x(m.TEXTURE_CUBE_MAP_POSITIVE_X),this._negativeX=x(m.TEXTURE_CUBE_MAP_NEGATIVE_X),this._positiveY=x(m.TEXTURE_CUBE_MAP_POSITIVE_Y),this._negativeY=x(m.TEXTURE_CUBE_MAP_NEGATIVE_Y),this._positiveZ=x(m.TEXTURE_CUBE_MAP_POSITIVE_Z),this._negativeZ=x(m.TEXTURE_CUBE_MAP_NEGATIVE_Z),this._sampler=a,Cue(this,a),m.activeTexture(m.TEXTURE0),m.bindTexture(y,A),s?m.pixelStorei(m.UNPACK_COLORSPACE_CONVERSION_WEBGL,m.NONE):m.pixelStorei(m.UNPACK_COLORSPACE_CONVERSION_WEBGL,m.BROWSER_DEFAULT_WEBGL);for(let T of To.faceNames())aX(this[T],n?.[T],0);m.bindTexture(y,null)}To.prototype.copyFace=function(e,t,n,i){let r=e.context,o=new vs({context:r,colorTextures:[t],destroyAttachments:!1});o._bind(),this[n].copyMipmapFromFramebuffer(0,0,t.width,t.height,i??0),o._unBind(),o.destroy()};To.FaceName=Object.freeze({POSITIVEX:"positiveX",NEGATIVEX:"negativeX",POSITIVEY:"positiveY",NEGATIVEY:"negativeY",POSITIVEZ:"positiveZ",NEGATIVEZ:"negativeZ"});function*$4e(){yield To.FaceName.POSITIVEX,yield To.FaceName.NEGATIVEX,yield To.FaceName.POSITIVEY,yield To.FaceName.NEGATIVEY,yield To.FaceName.POSITIVEZ,yield To.FaceName.NEGATIVEZ}To.faceNames=function(){return $4e()};function aX(e,t,n){n=n??0;let i=e._targetFace,r=Math.max(Math.floor(e._size/2**n),1),o=e._pixelFormat,s=e._pixelDatatype,a=e._internalFormat,c=e._flipY,u=e._preMultiplyAlpha,f=e._context,d=f._gl;if(!l(t)){d.texImage2D(i,n,a,r,r,0,o,ze.toWebGLConstant(s,f),null);return}let{arrayBufferView:p}=t,g=4;l(p)&&(g=$e.alignmentInBytes(o,s,r)),d.pixelStorei(d.UNPACK_ALIGNMENT,g),l(p)?(d.pixelStorei(d.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!1),d.pixelStorei(d.UNPACK_FLIP_Y_WEBGL,!1),c&&(p=$e.flipY(p,o,s,r,r)),d.texImage2D(i,n,a,r,r,0,o,ze.toWebGLConstant(s,f),p)):(d.pixelStorei(d.UNPACK_PREMULTIPLY_ALPHA_WEBGL,u),d.pixelStorei(d.UNPACK_FLIP_Y_WEBGL,c),d.texImage2D(i,n,a,o,ze.toWebGLConstant(s,f),t))}To.loadFace=aX;Object.defineProperties(To.prototype,{positiveX:{get:function(){return this._positiveX}},negativeX:{get:function(){return this._negativeX}},positiveY:{get:function(){return this._positiveY}},negativeY:{get:function(){return this._negativeY}},positiveZ:{get:function(){return this._positiveZ}},negativeZ:{get:function(){return this._negativeZ}},sampler:{get:function(){return this._sampler},set:function(e){Cue(this,e),this._sampler=e}},pixelFormat:{get:function(){return this._pixelFormat}},pixelDatatype:{get:function(){return this._pixelDatatype}},width:{get:function(){return this._size}},height:{get:function(){return this._size}},sizeInBytes:{get:function(){return this._hasMipmap?Math.floor(this._sizeInBytes*4/3):this._sizeInBytes}},preMultiplyAlpha:{get:function(){return this._preMultiplyAlpha}},flipY:{get:function(){return this._flipY}},_target:{get:function(){return this._textureTarget}}});To.getDirection=function(e,t){switch(e){case To.FaceName.POSITIVEX:return h.clone(h.UNIT_X,t);case To.FaceName.NEGATIVEX:return h.negate(h.UNIT_X,t);case To.FaceName.POSITIVEY:return h.clone(h.UNIT_Y,t);case To.FaceName.NEGATIVEY:return h.negate(h.UNIT_Y,t);case To.FaceName.POSITIVEZ:return h.clone(h.UNIT_Z,t);case To.FaceName.NEGATIVEZ:return h.negate(h.UNIT_Z,t)}};function Cue(e,t){let{minificationFilter:n,magnificationFilter:i}=t,r=[Wt.NEAREST_MIPMAP_NEAREST,Wt.NEAREST_MIPMAP_LINEAR,Wt.LINEAR_MIPMAP_NEAREST,Wt.LINEAR_MIPMAP_LINEAR].includes(n),o=e._context,s=e._pixelDatatype;(s===ze.FLOAT&&!o.textureFloatLinear||s===ze.HALF_FLOAT&&!o.textureHalfFloatLinear)&&(n=r?Wt.NEAREST_MIPMAP_NEAREST:Wt.NEAREST,i=Jn.NEAREST);let a=o._gl,c=e._textureTarget;a.activeTexture(a.TEXTURE0),a.bindTexture(c,e._texture),a.texParameteri(c,a.TEXTURE_MIN_FILTER,a.LINEAR),a.texParameteri(c,a.TEXTURE_MAG_FILTER,i),a.texParameteri(c,a.TEXTURE_WRAP_S,t.wrapS),a.texParameteri(c,a.TEXTURE_WRAP_T,t.wrapT),l(e._textureFilterAnisotropic)&&a.texParameteri(c,e._textureFilterAnisotropic.TEXTURE_MAX_ANISOTROPY_EXT,t.maximumAnisotropy),a.bindTexture(c,null)}To.prototype.loadMipmaps=function(e,t){t=t??!1;let n=this._context._gl,i=this._texture,r=this._textureTarget;n.activeTexture(n.TEXTURE0),n.bindTexture(r,i),t?n.pixelStorei(n.UNPACK_COLORSPACE_CONVERSION_WEBGL,n.NONE):n.pixelStorei(n.UNPACK_COLORSPACE_CONVERSION_WEBGL,n.BROWSER_DEFAULT_WEBGL);for(let o=0;o<e.length;o++){let s=e[o],a=o+1;for(let c of To.faceNames())aX(this[c],s[c],a)}n.bindTexture(r,null),this._hasMipmap=!0};To.prototype.generateMipmap=function(e){e=e??yh.DONT_CARE,this._hasMipmap=!0;let t=this._context._gl,n=this._textureTarget;t.hint(t.GENERATE_MIPMAP_HINT,e),t.activeTexture(t.TEXTURE0),t.bindTexture(n,this._texture),t.generateMipmap(n),t.bindTexture(n,null)};To.createVertexArray=function(e){let t=zc.createGeometry(zc.fromDimensions({dimensions:new h(2,2,2),vertexFormat:Be.POSITION_ONLY})),n=this._attributeLocations=Wn.createAttributeLocations(t);return Vn.fromGeometry({context:e,geometry:t,attributeLocations:n,bufferUsage:Me.STATIC_DRAW})};To.prototype.isDestroyed=function(){return!1};To.prototype.destroy=function(){return this._context._gl.deleteTexture(this._texture),this._positiveX=le(this._positiveX),this._negativeX=le(this._negativeX),this._positiveY=le(this._positiveY),this._negativeY=le(this._negativeY),this._positiveZ=le(this._positiveZ),this._negativeZ=le(this._negativeZ),le(this)};var ls=To;function J4e(e){this.context=e,this.framebuffer=void 0,this.blendingEnabled=void 0,this.scissorTest=void 0,this.viewport=void 0}var gc=J4e;var cX=class{constructor(t,n,i){this._pickObjects=t,this.key=n,this.color=i}get object(){return this._pickObjects.get(this.key)}set object(t){this._pickObjects.set(this.key,t)}destroy(){this._pickObjects.delete(this.key)}},_L=cX;var yL=`const float czm_degreesPerRadian = 57.29577951308232; `;var AL=`const czm_depthRangeStruct czm_depthRange = czm_depthRangeStruct(0.0, 1.0); `;var bL=`const float czm_epsilon1 = 0.1; `;var xL=`const float czm_epsilon2 = 0.01; @@ -1738,7 +1738,7 @@ xyz.g = Yxy.r; xyz.b = Yxy.r * (1.0 - Yxy.g - Yxy.b) / Yxy.b; return XYZ2RGB * xyz; } -`;var HE={czm_degreesPerRadian:yL,czm_depthRange:AL,czm_epsilon1:bL,czm_epsilon2:xL,czm_epsilon3:TL,czm_epsilon4:EL,czm_epsilon5:CL,czm_epsilon6:vL,czm_epsilon7:SL,czm_infinity:wL,czm_oneOverPi:IL,czm_oneOverTwoPi:PL,czm_passCesium3DTile:DL,czm_passCesium3DTileClassification:RL,czm_passCesium3DTileClassificationIgnoreShow:OL,czm_passCesium3DTileEdges:ML,czm_passCesium3DTileEdgesDirect:NL,czm_passCesium3DTilePlanarFillId:LL,czm_passClassification:FL,czm_passCompute:BL,czm_passEnvironment:kL,czm_passGaussianSplats:UL,czm_passGlobe:zL,czm_passOpaque:VL,czm_passOverlay:jL,czm_passTerrainClassification:HL,czm_passTranslucent:GL,czm_passVoxels:WL,czm_pi:qL,czm_piOverFour:YL,czm_piOverSix:XL,czm_piOverThree:KL,czm_piOverTwo:$L,czm_radiansPerDegree:JL,czm_sceneMode2D:ZL,czm_sceneMode3D:QL,czm_sceneModeColumbusView:eF,czm_sceneModeMorphing:tF,czm_solarRadius:nF,czm_threePiOver2:iF,czm_twoPi:rF,czm_webMercatorMaxLatitude:oF,czm_depthRangeStruct:sF,czm_material:aF,czm_materialInput:cF,czm_modelMaterial:lF,czm_modelVertexOutput:uF,czm_ray:fF,czm_raySegment:dF,czm_shadowParameters:hF,czm_acesTonemapping:mF,czm_alphaWeight:pF,czm_antialias:gF,czm_applyHSBShift:_F,czm_approximateSphericalCoordinates:yF,czm_approximateTanh:AF,czm_backFacing:bF,czm_branchFreeTernary:xF,czm_cascadeColor:TF,czm_cascadeDistance:EF,czm_cascadeMatrix:CF,czm_cascadeWeights:vF,czm_columbusViewMorph:SF,czm_computeAtmosphereColor:wF,czm_computeGroundAtmosphereScattering:IF,czm_computePosition:PF,czm_computeScattering:DF,czm_computeTextureTransform:RF,czm_cosineAndSine:OF,czm_decodeRGB8:MF,czm_decompressTextureCoordinates:NF,czm_depthClamp:LF,czm_eastNorthUpToEyeCoordinates:FF,czm_ellipsoidContainsPoint:BF,czm_ellipsoidTextureCoordinates:kF,czm_equalsEpsilon:UF,czm_eyeOffset:zF,czm_eyeToCartographicDelta:VF,czm_eyeToWindowCoordinates:jF,czm_fastApproximateAtan:HF,czm_fog:GF,czm_gammaCorrect:WF,czm_geodeticSurfaceNormal:qF,czm_getDefaultMaterial:YF,czm_getDynamicAtmosphereLightDirection:XF,czm_getLambertDiffuse:KF,czm_getSpecular:$F,czm_getWaterNoise:JF,czm_HSBToRGB:ZF,czm_HSLToRGB:QF,czm_hue:eB,czm_inverseGamma:tB,czm_isEmpty:nB,czm_isFull:iB,czm_latitudeToWebMercatorFraction:rB,czm_linearToSrgb:oB,czm_lineDistance:sB,czm_luminance:aB,czm_maximumComponent:cB,czm_metersPerPixel:lB,czm_modelToWindowCoordinates:uB,czm_multiplyWithColorBalance:fB,czm_nearFarScalar:dB,czm_octDecode:hB,czm_packDepth:mB,czm_pbrLighting:pB,czm_pbrNeutralTonemapping:gB,czm_phong:_B,czm_planeDistance:yB,czm_pointAlongRay:AB,czm_rayEllipsoidIntersectionInterval:bB,czm_raySphereIntersectionInterval:xB,czm_readDepth:TB,czm_readNonPerspective:EB,czm_reverseLogDepth:CB,czm_RGBToHSB:vB,czm_RGBToHSL:SB,czm_RGBToXYZ:wB,czm_round:IB,czm_saturation:PB,czm_shadowDepthCompare:DB,czm_shadowVisibility:RB,czm_signNotZero:OB,czm_sphericalHarmonics:MB,czm_srgbToLinear:NB,czm_tangentToEyeSpaceMatrix:LB,czm_textureCube:FB,czm_transformPlane:BB,czm_translateRelativeToEye:kB,czm_translucentPhong:UB,czm_transpose:zB,czm_unpackDepth:VB,czm_unpackFloat:jB,czm_unpackTexture:HB,czm_unpackUint:GB,czm_valueTransform:WB,czm_vertexLogDepth:qB,czm_windowToEyeCoordinates:YB,czm_writeDepthClamp:XB,czm_writeLogDepth:KB,czm_writeNonPerspective:$B,czm_XYZToRGB:JB};function J4e(e,t){let n=e;return n=n.replaceAll("version 300 es",""),n=n.replaceAll(/(texture\()/g,"texture2D("),t?(n=n.replaceAll(/\n\s*(in)\s+(vec\d|mat\d|float)/g,` +`;var HE={czm_degreesPerRadian:yL,czm_depthRange:AL,czm_epsilon1:bL,czm_epsilon2:xL,czm_epsilon3:TL,czm_epsilon4:EL,czm_epsilon5:CL,czm_epsilon6:vL,czm_epsilon7:SL,czm_infinity:wL,czm_oneOverPi:IL,czm_oneOverTwoPi:PL,czm_passCesium3DTile:DL,czm_passCesium3DTileClassification:RL,czm_passCesium3DTileClassificationIgnoreShow:OL,czm_passCesium3DTileEdges:ML,czm_passCesium3DTileEdgesDirect:NL,czm_passCesium3DTilePlanarFillId:LL,czm_passClassification:FL,czm_passCompute:BL,czm_passEnvironment:kL,czm_passGaussianSplats:UL,czm_passGlobe:zL,czm_passOpaque:VL,czm_passOverlay:jL,czm_passTerrainClassification:HL,czm_passTranslucent:GL,czm_passVoxels:WL,czm_pi:qL,czm_piOverFour:YL,czm_piOverSix:XL,czm_piOverThree:KL,czm_piOverTwo:$L,czm_radiansPerDegree:JL,czm_sceneMode2D:ZL,czm_sceneMode3D:QL,czm_sceneModeColumbusView:eF,czm_sceneModeMorphing:tF,czm_solarRadius:nF,czm_threePiOver2:iF,czm_twoPi:rF,czm_webMercatorMaxLatitude:oF,czm_depthRangeStruct:sF,czm_material:aF,czm_materialInput:cF,czm_modelMaterial:lF,czm_modelVertexOutput:uF,czm_ray:fF,czm_raySegment:dF,czm_shadowParameters:hF,czm_acesTonemapping:mF,czm_alphaWeight:pF,czm_antialias:gF,czm_applyHSBShift:_F,czm_approximateSphericalCoordinates:yF,czm_approximateTanh:AF,czm_backFacing:bF,czm_branchFreeTernary:xF,czm_cascadeColor:TF,czm_cascadeDistance:EF,czm_cascadeMatrix:CF,czm_cascadeWeights:vF,czm_columbusViewMorph:SF,czm_computeAtmosphereColor:wF,czm_computeGroundAtmosphereScattering:IF,czm_computePosition:PF,czm_computeScattering:DF,czm_computeTextureTransform:RF,czm_cosineAndSine:OF,czm_decodeRGB8:MF,czm_decompressTextureCoordinates:NF,czm_depthClamp:LF,czm_eastNorthUpToEyeCoordinates:FF,czm_ellipsoidContainsPoint:BF,czm_ellipsoidTextureCoordinates:kF,czm_equalsEpsilon:UF,czm_eyeOffset:zF,czm_eyeToCartographicDelta:VF,czm_eyeToWindowCoordinates:jF,czm_fastApproximateAtan:HF,czm_fog:GF,czm_gammaCorrect:WF,czm_geodeticSurfaceNormal:qF,czm_getDefaultMaterial:YF,czm_getDynamicAtmosphereLightDirection:XF,czm_getLambertDiffuse:KF,czm_getSpecular:$F,czm_getWaterNoise:JF,czm_HSBToRGB:ZF,czm_HSLToRGB:QF,czm_hue:eB,czm_inverseGamma:tB,czm_isEmpty:nB,czm_isFull:iB,czm_latitudeToWebMercatorFraction:rB,czm_linearToSrgb:oB,czm_lineDistance:sB,czm_luminance:aB,czm_maximumComponent:cB,czm_metersPerPixel:lB,czm_modelToWindowCoordinates:uB,czm_multiplyWithColorBalance:fB,czm_nearFarScalar:dB,czm_octDecode:hB,czm_packDepth:mB,czm_pbrLighting:pB,czm_pbrNeutralTonemapping:gB,czm_phong:_B,czm_planeDistance:yB,czm_pointAlongRay:AB,czm_rayEllipsoidIntersectionInterval:bB,czm_raySphereIntersectionInterval:xB,czm_readDepth:TB,czm_readNonPerspective:EB,czm_reverseLogDepth:CB,czm_RGBToHSB:vB,czm_RGBToHSL:SB,czm_RGBToXYZ:wB,czm_round:IB,czm_saturation:PB,czm_shadowDepthCompare:DB,czm_shadowVisibility:RB,czm_signNotZero:OB,czm_sphericalHarmonics:MB,czm_srgbToLinear:NB,czm_tangentToEyeSpaceMatrix:LB,czm_textureCube:FB,czm_transformPlane:BB,czm_translateRelativeToEye:kB,czm_translucentPhong:UB,czm_transpose:zB,czm_unpackDepth:VB,czm_unpackFloat:jB,czm_unpackTexture:HB,czm_unpackUint:GB,czm_valueTransform:WB,czm_vertexLogDepth:qB,czm_windowToEyeCoordinates:YB,czm_writeDepthClamp:XB,czm_writeLogDepth:KB,czm_writeNonPerspective:$B,czm_XYZToRGB:JB};function Z4e(e,t){let n=e;return n=n.replaceAll("version 300 es",""),n=n.replaceAll(/(texture\()/g,"texture2D("),t?(n=n.replaceAll(/\n\s*(in)\s+(vec\d|mat\d|float)/g,` varying $2`),/out_FragData_(\d+)/.test(n)&&(n=`#extension GL_EXT_draw_buffers : enable ${n}`,n=n.replaceAll(/layout\s+\(location\s*=\s*\d+\)\s*out\s+vec4\s+out_FragData_\d+;/g,""),n=n.replaceAll(/out_FragData_(\d+)/g,"gl_FragData[$1]")),n=n.replaceAll(/layout\s+\(location\s*=\s*0\)\s*out\s+vec4\s+out_FragColor;/g,""),n=n.replaceAll(/out_FragColor/g,"gl_FragColor"),n=n.replaceAll(/out_FragColor\[(\d+)\]/g,"gl_FragColor[$1]"),/gl_FragDepth/.test(n)&&(n=`#extension GL_EXT_frag_depth : enable ${n}`,n=n.replaceAll(/gl_FragDepth/g,"gl_FragDepthEXT")),n=`#ifdef GL_EXT_shader_texture_lod @@ -1748,8 +1748,8 @@ ${n}`,n=`#ifdef GL_OES_standard_derivatives #extension GL_OES_standard_derivatives : enable #endif ${n}`):(n=n.replaceAll(/(in)\s+(vec\d|mat\d|float)/g,"attribute $2"),n=n.replaceAll(/(out)\s+(vec\d|mat\d|float)\s+([\w]+);/g,"varying $2 $3;")),n=`#version 100 -${n}`,n}var ZB=J4e;function vue(e){return e=e.replace(/\/\/.*/g,""),e.replace(/\/\*\*[\s\S]*?\*\//gm,function(t){let n=t.match(/\n/gm).length,i="";for(let r=0;r<n;++r)i+=` -`;return i})}function Sue(e,t,n){let i;for(let r=0;r<n.length;++r)n[r].name===e&&(i=n[r]);return l(i)||(t=vue(t),i={name:e,glslSource:t,dependsOn:[],requiredBy:[],evaluated:!1},n.push(i)),i}function wue(e,t){if(e.evaluated)return;e.evaluated=!0;let n=e.glslSource.match(/\bczm_[a-zA-Z0-9_]*/g);l(n)&&n!==null&&(n=n.filter(function(i,r){return n.indexOf(i)===r}),n.forEach(function(i){if(i!==e.name&&Sa._czmBuiltinsAndUniforms.hasOwnProperty(i)){let r=Sue(i,Sa._czmBuiltinsAndUniforms[i],t);e.dependsOn.push(r),r.requiredBy.push(e),wue(r,t)}}))}function Z4e(e){let t=[],n=[];for(;e.length>0;){let r=e.pop();n.push(r),r.requiredBy.length===0&&t.push(r)}for(;t.length>0;){let r=t.shift();e.push(r);for(let o=0;o<r.dependsOn.length;++o){let s=r.dependsOn[o],a=s.requiredBy.indexOf(r);s.requiredBy.splice(a,1),s.requiredBy.length===0&&t.push(s)}}let i=[];for(let r=0;r<n.length;++r)n[r].requiredBy.length!==0&&i.push(n[r])}function Q4e(e){let t=[],n=Sue("main",e,t);wue(n,t),Z4e(t);let i="";for(let r=t.length-1;r>=0;--r)i=`${i+t[r].glslSource} +${n}`,n}var ZB=Z4e;function vue(e){return e=e.replace(/\/\/.*/g,""),e.replace(/\/\*\*[\s\S]*?\*\//gm,function(t){let n=t.match(/\n/gm).length,i="";for(let r=0;r<n;++r)i+=` +`;return i})}function Sue(e,t,n){let i;for(let r=0;r<n.length;++r)n[r].name===e&&(i=n[r]);return l(i)||(t=vue(t),i={name:e,glslSource:t,dependsOn:[],requiredBy:[],evaluated:!1},n.push(i)),i}function wue(e,t){if(e.evaluated)return;e.evaluated=!0;let n=e.glslSource.match(/\bczm_[a-zA-Z0-9_]*/g);l(n)&&n!==null&&(n=n.filter(function(i,r){return n.indexOf(i)===r}),n.forEach(function(i){if(i!==e.name&&Sa._czmBuiltinsAndUniforms.hasOwnProperty(i)){let r=Sue(i,Sa._czmBuiltinsAndUniforms[i],t);e.dependsOn.push(r),r.requiredBy.push(e),wue(r,t)}}))}function Q4e(e){let t=[],n=[];for(;e.length>0;){let r=e.pop();n.push(r),r.requiredBy.length===0&&t.push(r)}for(;t.length>0;){let r=t.shift();e.push(r);for(let o=0;o<r.dependsOn.length;++o){let s=r.dependsOn[o],a=s.requiredBy.indexOf(r);s.requiredBy.splice(a,1),s.requiredBy.length===0&&t.push(s)}}let i=[];for(let r=0;r<n.length;++r)n[r].requiredBy.length!==0&&i.push(n[r])}function e8e(e){let t=[],n=Sue("main",e,t);wue(n,t),Q4e(t);let i="";for(let r=t.length-1;r>=0;--r)i=`${i+t[r].glslSource} `;return i.replace(n.glslSource,"")}function Iue(e,t,n){let i="",r=e.sources;if(l(r))for(let g=0;g<r.length;++g)i+=` #line 0 ${r[g]}`;i=vue(i);let o;i=i.replace(/#version\s+(.*?)\n/gm,function(g,m){return o=m,` @@ -1770,7 +1770,7 @@ ${r[g]}`;i=vue(i);let o;i=i.replace(/#version\s+(.*?)\n/gm,function(g,m){return `),n.floatingPointTexture&&(c+=`#define OES_texture_float -`);let d="";e.includeBuiltIns&&(d=Q4e(i)),c+=` +`);let d="";e.includeBuiltIns&&(d=e8e(i)),c+=` #line 0 `;let p=d+i;return n.webgl2&&t&&!/layout\s*\(location\s*=\s*0\)\s*out\s+vec4\s+out_FragColor;/g.test(p)&&!/czm_out_FragColor/g.test(p)&&/out_FragColor/g.test(p)&&(c+=`layout(location = 0) out vec4 out_FragColor; @@ -1792,9 +1792,9 @@ void main() } out_FragColor = czm_pickColor; }`;return`${n} -${i}`};function e8e(e,t){let n=e.defines,i=n.length;for(let r=0;r<i;++r)if(n[r]===t)return!0;return!1}function Pue(e,t){let n=e.sources,i=n.length;for(let r=0;r<i;++r)if(n[r].indexOf(t)!==-1)return!0;return!1}function Due(e,t){let n=t.length;for(let i=0;i<n;++i){let r=t[i];if(Pue(e,r))return r}}var t8e=["v_normalEC","v_normal"];Sa.findNormalVarying=function(e){return Pue(e,"#ifdef HAS_NORMALS")?e8e(e,"HAS_NORMALS")?"v_normalEC":void 0:Due(e,t8e)};var n8e=["v_positionEC"];Sa.findPositionVarying=function(e){return Due(e,n8e)};var Xe=Sa;function bh(e){this._context=e,this._shaders={},this._numberOfShaders=0,this._shadersToRelease={}}Object.defineProperties(bh.prototype,{numberOfShaders:{get:function(){return this._numberOfShaders}}});bh.prototype.replaceShaderProgram=function(e){return l(e.shaderProgram)&&e.shaderProgram.destroy(),this.getShaderProgram(e)};function i8e(e){let t=Object.keys(e).sort();return JSON.stringify(e,t)}bh.prototype.getShaderProgram=function(e){let t=e.vertexShaderSource,n=e.fragmentShaderSource,i=e.attributeLocations;typeof t=="string"&&(t=new Xe({sources:[t]})),typeof n=="string"&&(n=new Xe({sources:[n]}));let r=t.getCacheKey(),o=n.getCacheKey(),s=l(i)?i8e(i):"",a=`${r}:${o}:${s}`,c;if(l(this._shaders[a]))c=this._shaders[a],delete this._shadersToRelease[a];else{let u=this._context,f=t.createCombinedVertexShader(u),d=n.createCombinedFragmentShader(u),p=new Qt({gl:u._gl,logShaderCompilation:u.logShaderCompilation,debugShaders:u.debugShaders,vertexShaderSource:t,vertexShaderText:f,fragmentShaderSource:n,fragmentShaderText:d,attributeLocations:i});c={cache:this,shaderProgram:p,keyword:a,derivedKeywords:[],count:0},p._cachedShader=c,this._shaders[a]=c,++this._numberOfShaders}return++c.count,c.shaderProgram};bh.prototype.replaceDerivedShaderProgram=function(e,t,n){let i=e._cachedShader,r=t+i.keyword,o=this._shaders[r];if(l(o)){lX(this,o);let s=i.derivedKeywords.indexOf(t);s>-1&&i.derivedKeywords.splice(s,1)}return this.createDerivedShaderProgram(e,t,n)};bh.prototype.getDerivedShaderProgram=function(e,t){let n=e._cachedShader,i=t+n.keyword,r=this._shaders[i];if(l(r))return r.shaderProgram};bh.prototype.createDerivedShaderProgram=function(e,t,n){let i=e._cachedShader,r=t+i.keyword,o=n.vertexShaderSource,s=n.fragmentShaderSource,a=n.attributeLocations;typeof o=="string"&&(o=new Xe({sources:[o]})),typeof s=="string"&&(s=new Xe({sources:[s]}));let c=this._context,u=o.createCombinedVertexShader(c),f=s.createCombinedFragmentShader(c),d=new Qt({gl:c._gl,logShaderCompilation:c.logShaderCompilation,debugShaders:c.debugShaders,vertexShaderSource:o,vertexShaderText:u,fragmentShaderSource:s,fragmentShaderText:f,attributeLocations:a}),p={cache:this,shaderProgram:d,keyword:r,derivedKeywords:[],count:0};return i.derivedKeywords.push(t),d._cachedShader=p,this._shaders[r]=p,d};function lX(e,t){let n=t.derivedKeywords,i=n.length;for(let r=0;r<i;++r){let o=n[r]+t.keyword,s=e._shaders[o];lX(e,s)}delete e._shaders[t.keyword],t.shaderProgram.finalDestroy()}bh.prototype.destroyReleasedShaderPrograms=function(){let e=this._shadersToRelease;for(let t in e)if(e.hasOwnProperty(t)){let n=e[t];lX(this,n),--this._numberOfShaders}this._shadersToRelease={}};bh.prototype.releaseShaderProgram=function(e){if(l(e)){let t=e._cachedShader;t&&--t.count===0&&(this._shadersToRelease[t.keyword]=t)}};bh.prototype.isDestroyed=function(){return!1};bh.prototype.destroy=function(){let e=this._shaders;for(let t in e)e.hasOwnProperty(t)&&e[t].shaderProgram.finalDestroy();return le(this)};var QB=bh;function td(e){e=e??H.EMPTY_OBJECT;let{context:t,source:n,pixelFormat:i=$e.RGBA,pixelDatatype:r=ze.UNSIGNED_BYTE,flipY:o=!0,skipColorSpaceConversion:s=!1,sampler:a=new Ht}=e,{width:c,height:u}=e;l(n)&&(l(c)||(c=n.videoWidth??n.naturalWidth??n.width),l(u)||(u=n.videoHeight??n.naturalHeight??n.height));let f=e.preMultiplyAlpha||i===$e.RGB||i===$e.LUMINANCE,d=$e.toInternalFormat(i,r,t),p=$e.isCompressedFormat(d),g=t._gl,m=p?$e.compressedTextureSizeInBytes(i,c,u):$e.textureSizeInBytes(i,r,c,u);this._id=e.id??Kn(),this._context=t,this._textureFilterAnisotropic=t._textureFilterAnisotropic,this._textureTarget=g.TEXTURE_2D,this._texture=g.createTexture(),this._internalFormat=d,this._pixelFormat=i,this._pixelDatatype=r,this._width=c,this._height=u,this._dimensions=new U(c,u),this._hasMipmap=!1,this._sizeInBytes=m,this._preMultiplyAlpha=f,this._flipY=o,this._initialized=!1,this._sampler=void 0,this._sampler=a,Nue(this,a),g.activeTexture(g.TEXTURE0),g.bindTexture(this._textureTarget,this._texture),l(n)?(s?g.pixelStorei(g.UNPACK_COLORSPACE_CONVERSION_WEBGL,g.NONE):g.pixelStorei(g.UNPACK_COLORSPACE_CONVERSION_WEBGL,g.BROWSER_DEFAULT_WEBGL),l(n.arrayBufferView)?$e.isCompressedFormat(d)?r8e(this,n):Rue(this,n):l(n.framebuffer)?s8e(this,n):Oue(this,n),this._initialized=!0):Mue(this),g.bindTexture(this._textureTarget,null)}function r8e(e,t){let i=e._context._gl,r=e._textureTarget,o=e._internalFormat,{width:s,height:a}=e;if(i.pixelStorei(i.UNPACK_ALIGNMENT,4),i.pixelStorei(i.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!1),i.pixelStorei(i.UNPACK_FLIP_Y_WEBGL,!1),i.compressedTexImage2D(r,0,o,s,a,0,t.arrayBufferView),l(t.mipLevels)){let c=s,u=a;for(let f=0;f<t.mipLevels.length;++f)c=e2(c),u=e2(u),i.compressedTexImage2D(r,f+1,o,c,u,0,t.mipLevels[f])}}function Rue(e,t){let n=e._context,i=n._gl,r=e._textureTarget,o=e._internalFormat,{width:s,height:a,pixelFormat:c,pixelDatatype:u,flipY:f}=e,d=$e.alignmentInBytes(c,u,s);i.pixelStorei(i.UNPACK_ALIGNMENT,d),i.pixelStorei(i.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!1),i.pixelStorei(i.UNPACK_FLIP_Y_WEBGL,!1);let{arrayBufferView:p}=t;if(f&&(p=$e.flipY(p,c,u,s,a)),i.texImage2D(r,0,o,s,a,0,c,ze.toWebGLConstant(u,n),p),l(t.mipLevels)){let g=s,m=a;for(let y=0;y<t.mipLevels.length;++y)g=e2(g),m=e2(m),i.texImage2D(r,y+1,o,g,m,0,c,ze.toWebGLConstant(u,n),t.mipLevels[y])}}function o8e(e,t,n,i,r,o){let s=e._context,a=s._gl,{pixelFormat:c,pixelDatatype:u}=e,f=$e.alignmentInBytes(c,u,r);a.pixelStorei(a.UNPACK_ALIGNMENT,f),a.pixelStorei(a.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!1),a.pixelStorei(a.UNPACK_FLIP_Y_WEBGL,!1),e.flipY&&(t=$e.flipY(t,c,u,r,o)),a.texSubImage2D(e._textureTarget,0,n,i,r,o,c,ze.toWebGLConstant(u,s),t)}function s8e(e,t){let n=e._context,i=n._gl;i.pixelStorei(i.UNPACK_ALIGNMENT,4),i.pixelStorei(i.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!1),i.pixelStorei(i.UNPACK_FLIP_Y_WEBGL,!1),t.framebuffer!==n.defaultFramebuffer&&t.framebuffer._bind(),i.copyTexImage2D(e._textureTarget,0,e._internalFormat,t.xOffset,t.yOffset,e.width,e.height,0),t.framebuffer!==n.defaultFramebuffer&&t.framebuffer._unBind()}function Oue(e,t){let n=e._context,i=n._gl;i.pixelStorei(i.UNPACK_ALIGNMENT,4),i.pixelStorei(i.UNPACK_PREMULTIPLY_ALPHA_WEBGL,e.preMultiplyAlpha),i.pixelStorei(i.UNPACK_FLIP_Y_WEBGL,e.flipY),i.texImage2D(e._textureTarget,0,e._internalFormat,e.pixelFormat,ze.toWebGLConstant(e.pixelDatatype,n),t)}function a8e(e,t,n,i){let r=e._context,o=r._gl;o.pixelStorei(o.UNPACK_ALIGNMENT,4),o.pixelStorei(o.UNPACK_PREMULTIPLY_ALPHA_WEBGL,e.preMultiplyAlpha),o.pixelStorei(o.UNPACK_FLIP_Y_WEBGL,e.flipY),o.texSubImage2D(e._textureTarget,0,n,i,e.pixelFormat,ze.toWebGLConstant(e.pixelDatatype,r),t)}function e2(e){let t=Math.floor(e/2)|0;return Math.max(t,1)}function Mue(e){let t=e._context;t._gl.texImage2D(e._textureTarget,0,e._internalFormat,e._width,e._height,0,e._pixelFormat,ze.toWebGLConstant(e._pixelDatatype,t),null)}td.create=function(e){return new td(e)};td.fromFramebuffer=function(e){e=e??H.EMPTY_OBJECT;let t=e.context,{pixelFormat:n=$e.RGB,framebufferXOffset:i=0,framebufferYOffset:r=0,width:o=t.drawingBufferWidth,height:s=t.drawingBufferHeight,framebuffer:a}=e;return new td({context:t,width:o,height:s,pixelFormat:n,source:{framebuffer:l(a)?a:t.defaultFramebuffer,xOffset:i,yOffset:r,width:o,height:s}})};Object.defineProperties(td.prototype,{id:{get:function(){return this._id}},sampler:{get:function(){return this._sampler},set:function(e){Nue(this,e),this._sampler=e}},pixelFormat:{get:function(){return this._pixelFormat}},pixelDatatype:{get:function(){return this._pixelDatatype}},dimensions:{get:function(){return this._dimensions}},preMultiplyAlpha:{get:function(){return this._preMultiplyAlpha}},flipY:{get:function(){return this._flipY}},width:{get:function(){return this._width}},height:{get:function(){return this._height}},sizeInBytes:{get:function(){return this._hasMipmap?Math.floor(this._sizeInBytes*4/3):this._sizeInBytes}},_target:{get:function(){return this._textureTarget}}});function Nue(e,t){let{minificationFilter:n,magnificationFilter:i}=t,r=[Wt.NEAREST_MIPMAP_NEAREST,Wt.NEAREST_MIPMAP_LINEAR,Wt.LINEAR_MIPMAP_NEAREST,Wt.LINEAR_MIPMAP_LINEAR].includes(n),o=e._context,s=e._pixelFormat,a=e._pixelDatatype;(a===ze.FLOAT&&!o.textureFloatLinear||a===ze.HALF_FLOAT&&!o.textureHalfFloatLinear)&&(n=r?Wt.NEAREST_MIPMAP_NEAREST:Wt.NEAREST,i=Jn.NEAREST),o.webgl2&&$e.isDepthFormat(s)&&(n=Wt.NEAREST,i=Jn.NEAREST);let c=o._gl,u=e._textureTarget;c.activeTexture(c.TEXTURE0),c.bindTexture(u,e._texture),c.texParameteri(u,c.TEXTURE_MIN_FILTER,n),c.texParameteri(u,c.TEXTURE_MAG_FILTER,i),c.texParameteri(u,c.TEXTURE_WRAP_S,t.wrapS),c.texParameteri(u,c.TEXTURE_WRAP_T,t.wrapT),l(e._textureFilterAnisotropic)&&c.texParameteri(u,e._textureFilterAnisotropic.TEXTURE_MAX_ANISOTROPY_EXT,t.maximumAnisotropy),c.bindTexture(u,null)}td.prototype.copyFrom=function(e){let{xOffset:t=0,yOffset:n=0,source:i,skipColorSpaceConversion:r=!1}=e,s=this._context._gl,a=this._textureTarget;s.activeTexture(s.TEXTURE0),s.bindTexture(a,this._texture);let{width:c,height:u}=i;l(i.videoWidth)&&l(i.videoHeight)?(c=i.videoWidth,u=i.videoHeight):l(i.naturalWidth)&&l(i.naturalHeight)&&(c=i.naturalWidth,u=i.naturalHeight),r?s.pixelStorei(s.UNPACK_COLORSPACE_CONVERSION_WEBGL,s.NONE):s.pixelStorei(s.UNPACK_COLORSPACE_CONVERSION_WEBGL,s.BROWSER_DEFAULT_WEBGL);let f=!1;this._initialized||(t===0&&n===0&&c===this._width&&u===this._height?(l(i.arrayBufferView)?Rue(this,i):Oue(this,i),f=!0):(s.pixelStorei(s.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!1),s.pixelStorei(s.UNPACK_FLIP_Y_WEBGL,!1),Mue(this)),this._initialized=!0),f||(l(i.arrayBufferView)?o8e(this,i.arrayBufferView,t,n,c,u):a8e(this,i,t,n)),s.bindTexture(a,null)};td.prototype.copyFromFramebuffer=function(e,t,n,i,r,o){e=e??0,t=t??0,n=n??0,i=i??0,r=r??this._width,o=o??this._height;let s=this._context._gl,a=this._textureTarget;s.activeTexture(s.TEXTURE0),s.bindTexture(a,this._texture),s.copyTexSubImage2D(a,0,e,t,n,i,r,o),s.bindTexture(a,null),this._initialized=!0};td.prototype.generateMipmap=function(e){e=e??yh.DONT_CARE,this._hasMipmap=!0;let t=this._context._gl,n=this._textureTarget;t.hint(t.GENERATE_MIPMAP_HINT,e),t.activeTexture(t.TEXTURE0),t.bindTexture(n,this._texture),t.generateMipmap(n),t.bindTexture(n,null)};td.prototype.isDestroyed=function(){return!1};td.prototype.destroy=function(){return this._context._gl.deleteTexture(this._texture),le(this)};td.defaultColor=z.WHITE;var Dt=td;function Ib(){this._textures={},this._numberOfTextures=0,this._texturesToRelease={}}Object.defineProperties(Ib.prototype,{numberOfTextures:{get:function(){return this._numberOfTextures}}});Ib.prototype.getTexture=function(e){let t=this._textures[e];if(l(t))return delete this._texturesToRelease[e],++t.count,t.texture};Ib.prototype.addTexture=function(e,t){let n={texture:t,count:1};t.finalDestroy=t.destroy;let i=this;t.destroy=function(){--n.count===0&&(i._texturesToRelease[e]=n)},this._textures[e]=n,++this._numberOfTextures};Ib.prototype.destroyReleasedTextures=function(){let e=this._texturesToRelease;for(let t in e)if(e.hasOwnProperty(t)){let n=e[t];delete this._textures[t],n.texture.finalDestroy(),--this._numberOfTextures}this._texturesToRelease={}};Ib.prototype.isDestroyed=function(){return!1};Ib.prototype.destroy=function(){let e=this._textures;for(let t in e)e.hasOwnProperty(t)&&e[t].texture.finalDestroy();return le(this)};var t2=Ib;function nd(e){this.planes=e??[]}var rP=[new h,new h,new h];h.clone(h.UNIT_X,rP[0]);h.clone(h.UNIT_Y,rP[1]);h.clone(h.UNIT_Z,rP[2]);var O_=new h,c8e=new h,Lue=new sn(new h(1,0,0),0);function Fue(e,t){let n=t.normal;return n.x=e.x,n.y=e.y,n.z=e.z,t.distance=e.w,t}nd.fromBoundingSphere=function(e,t){l(t)||(t=new nd);let n=rP.length,i=t.planes;i.length=2*n;let r=e.center,o=e.radius,s=0;for(let a=0;a<n;++a){let c=rP[a],u=i[s],f=i[s+1];l(u)||(u=i[s]=new se),l(f)||(f=i[s+1]=new se),h.multiplyByScalar(c,-o,O_),h.add(r,O_,O_),u.x=c.x,u.y=c.y,u.z=c.z,u.w=-h.dot(c,O_),h.multiplyByScalar(c,o,O_),h.add(r,O_,O_),f.x=-c.x,f.y=-c.y,f.z=-c.z,f.w=-h.dot(h.negate(c,c8e),O_),s+=2}return t};nd.prototype.computeVisibility=function(e){let t=this.planes,n=!1;for(let i=0,r=t.length;i<r;++i){let o=e.intersectPlane(Fue(t[i],Lue));if(o===$t.OUTSIDE)return $t.OUTSIDE;o===$t.INTERSECTING&&(n=!0)}return n?$t.INTERSECTING:$t.INSIDE};nd.prototype.computeVisibilityWithPlaneMask=function(e,t){if(t===nd.MASK_OUTSIDE||t===nd.MASK_INSIDE)return t;let n=nd.MASK_INSIDE,i=this.planes;for(let r=0,o=i.length;r<o;++r){let s=r<31?1<<r:0;if(r<31&&(t&s)===0)continue;let a=e.intersectPlane(Fue(i[r],Lue));if(a===$t.OUTSIDE)return nd.MASK_OUTSIDE;a===$t.INTERSECTING&&(n|=s)}return n};nd.MASK_OUTSIDE=4294967295;nd.MASK_INSIDE=0;nd.MASK_INDETERMINATE=2147483647;var aa=nd;function Ym(e){e=e??H.EMPTY_OBJECT,this.left=e.left,this._left=void 0,this.right=e.right,this._right=void 0,this.top=e.top,this._top=void 0,this.bottom=e.bottom,this._bottom=void 0,this.near=e.near??1,this._near=this.near,this.far=e.far??5e8,this._far=this.far,this._cullingVolume=new aa,this._orthographicMatrix=new M}function Bue(e){(e.top!==e._top||e.bottom!==e._bottom||e.left!==e._left||e.right!==e._right||e.near!==e._near||e.far!==e._far)&&(e._left=e.left,e._right=e.right,e._top=e.top,e._bottom=e.bottom,e._near=e.near,e._far=e.far,e._orthographicMatrix=M.computeOrthographicOffCenter(e.left,e.right,e.bottom,e.top,e.near,e.far,e._orthographicMatrix))}Object.defineProperties(Ym.prototype,{projectionMatrix:{get:function(){return Bue(this),this._orthographicMatrix}}});var l8e=new h,u8e=new h,f8e=new h,uX=new h;Ym.prototype.computeCullingVolume=function(e,t,n){let i=this._cullingVolume.planes,r=this.top,o=this.bottom,s=this.right,a=this.left,c=this.near,u=this.far,f=h.cross(t,n,l8e);h.normalize(f,f);let d=u8e;h.multiplyByScalar(t,c,d),h.add(e,d,d);let p=f8e;h.multiplyByScalar(f,a,p),h.add(d,p,p);let g=i[0];return l(g)||(g=i[0]=new se),g.x=f.x,g.y=f.y,g.z=f.z,g.w=-h.dot(f,p),h.multiplyByScalar(f,s,p),h.add(d,p,p),g=i[1],l(g)||(g=i[1]=new se),g.x=-f.x,g.y=-f.y,g.z=-f.z,g.w=-h.dot(h.negate(f,uX),p),h.multiplyByScalar(n,o,p),h.add(d,p,p),g=i[2],l(g)||(g=i[2]=new se),g.x=n.x,g.y=n.y,g.z=n.z,g.w=-h.dot(n,p),h.multiplyByScalar(n,r,p),h.add(d,p,p),g=i[3],l(g)||(g=i[3]=new se),g.x=-n.x,g.y=-n.y,g.z=-n.z,g.w=-h.dot(h.negate(n,uX),p),g=i[4],l(g)||(g=i[4]=new se),g.x=t.x,g.y=t.y,g.z=t.z,g.w=-h.dot(t,d),h.multiplyByScalar(t,u,p),h.add(e,p,p),g=i[5],l(g)||(g=i[5]=new se),g.x=-t.x,g.y=-t.y,g.z=-t.z,g.w=-h.dot(h.negate(t,uX),p),this._cullingVolume};Ym.prototype.getPixelDimensions=function(e,t,n,i,r){Bue(this);let o=this.right-this.left,s=this.top-this.bottom,a=i*o/e,c=i*s/t;return r.x=a,r.y=c,r};Ym.prototype.clone=function(e){return l(e)||(e=new Ym),e.left=this.left,e.right=this.right,e.top=this.top,e.bottom=this.bottom,e.near=this.near,e.far=this.far,e._left=void 0,e._right=void 0,e._top=void 0,e._bottom=void 0,e._near=void 0,e._far=void 0,e};Ym.prototype.equals=function(e){return l(e)&&e instanceof Ym&&this.right===e.right&&this.left===e.left&&this.top===e.top&&this.bottom===e.bottom&&this.near===e.near&&this.far===e.far};Ym.prototype.equalsEpsilon=function(e,t,n){return e===this||l(e)&&e instanceof Ym&&P.equalsEpsilon(this.right,e.right,t,n)&&P.equalsEpsilon(this.left,e.left,t,n)&&P.equalsEpsilon(this.top,e.top,t,n)&&P.equalsEpsilon(this.bottom,e.bottom,t,n)&&P.equalsEpsilon(this.near,e.near,t,n)&&P.equalsEpsilon(this.far,e.far,t,n)};var Ss=Ym;function lu(e){e=e??H.EMPTY_OBJECT,this._offCenterFrustum=new Ss,this.width=e.width,this._width=void 0,this.aspectRatio=e.aspectRatio,this._aspectRatio=void 0,this.near=e.near??1,this._near=this.near,this.far=e.far??5e8,this._far=this.far}lu.packedLength=4;lu.pack=function(e,t,n){return n=n??0,t[n++]=e.width,t[n++]=e.aspectRatio,t[n++]=e.near,t[n]=e.far,t};lu.unpack=function(e,t,n){return t=t??0,l(n)||(n=new lu),n.width=e[t++],n.aspectRatio=e[t++],n.near=e[t++],n.far=e[t],n};function M_(e){let t=e._offCenterFrustum;if(e.width!==e._width||e.aspectRatio!==e._aspectRatio||e.near!==e._near||e.far!==e._far){e._aspectRatio=e.aspectRatio,e._width=e.width,e._near=e.near,e._far=e.far;let n=1/e.aspectRatio;t.right=e.width*.5,t.left=-t.right,t.top=n*t.right,t.bottom=-t.top,t.near=e.near,t.far=e.far}}Object.defineProperties(lu.prototype,{projectionMatrix:{get:function(){return M_(this),this._offCenterFrustum.projectionMatrix}},offCenterFrustum:{get:function(){return M_(this),this._offCenterFrustum}}});lu.prototype.computeCullingVolume=function(e,t,n){return M_(this),this._offCenterFrustum.computeCullingVolume(e,t,n)};lu.prototype.getPixelDimensions=function(e,t,n,i,r){return M_(this),this._offCenterFrustum.getPixelDimensions(e,t,n,i,r)};lu.prototype.clone=function(e){return l(e)||(e=new lu),e.aspectRatio=this.aspectRatio,e.width=this.width,e.near=this.near,e.far=this.far,e._aspectRatio=void 0,e._width=void 0,e._near=void 0,e._far=void 0,this._offCenterFrustum.clone(e._offCenterFrustum),e};lu.prototype.equals=function(e){return!l(e)||!(e instanceof lu)?!1:(M_(this),M_(e),this.width===e.width&&this.aspectRatio===e.aspectRatio&&this._offCenterFrustum.equals(e._offCenterFrustum))};lu.prototype.equalsEpsilon=function(e,t,n){return!l(e)||!(e instanceof lu)?!1:(M_(this),M_(e),P.equalsEpsilon(this.width,e.width,t,n)&&P.equalsEpsilon(this.aspectRatio,e.aspectRatio,t,n)&&this._offCenterFrustum.equalsEpsilon(e._offCenterFrustum,t,n))};var _n=lu;var fX={};function d8e(e){let t=6.239996+.0172019696544*e;return .001657*Math.sin(t+.01671*Math.sin(t))}var h8e=32.184,m8e=2451545;function nfe(e,t){t=K.addSeconds(e,h8e,t);let n=K.totalDays(t)-m8e;return t=K.addSeconds(t,d8e(n),t),t}var n2=new K(2451545,0,ai.TAI),p8e=1e3,id=P.RADIANS_PER_DEGREE,of=P.RADIANS_PER_ARCSECOND,_c=14959787e4,kue=new $;function ife(e,t,n,i,r,o,s){n<0&&(n=-n,r+=P.PI);let a=e*(1-t),c=i-r,u=r,f=_8e(o-i,t),d=g8e(t,0);T8e(c,n,u,kue);let p=a*(1+t),g=Math.cos(f),m=Math.sin(f),y=1+t*g,A=p/y;return l(s)?(s.x=A*g,s.y=A*m,s.z=0):s=new h(A*g,A*m,0),$.multiplyByVector(kue,s,s)}function g8e(e,t){return e<=t?"Circular":e<1-t?"Elliptical":e<=1+t?"Parabolic":"Hyperbolic"}function _8e(e,t){let n=b8e(e,t);return x8e(n,t)}var y8e=50,A8e=P.EPSILON8;function b8e(e,t){let n=Math.floor(e/P.TWO_PI);e-=n*P.TWO_PI;let i=e+t*Math.sin(e)/(1-Math.sin(e+t)+Math.sin(e)),r=Number.MAX_VALUE,o;for(o=0;o<y8e&&Math.abs(r-i)>A8e;++o){r=i;let s=r-t*Math.sin(r)-e,a=1-t*Math.cos(r);i=r-s/a}return r=i+n*P.TWO_PI,r}function x8e(e,t){let n=Math.floor(e/P.TWO_PI);e-=n*P.TWO_PI;let i=Math.cos(e)-t,r=Math.sin(e)*Math.sqrt(1-t*t),o=Math.atan2(r,i);return o=P.zeroToTwoPi(o),e<0&&(o-=P.TWO_PI),o+=n*P.TWO_PI,o}function T8e(e,t,n,i){let r=Math.cos(e),o=Math.sin(e),s=Math.cos(t),a=Math.sin(t),c=Math.cos(n),u=Math.sin(n);return l(i)?(i[0]=c*r-u*o*s,i[1]=u*r+c*o*s,i[2]=o*a,i[3]=-c*o-u*r*s,i[4]=-u*o+c*r*s,i[5]=r*a,i[6]=u*a,i[7]=-c*a,i[8]=s):i=new $(c*r-u*o*s,-c*o-u*r*s,u*a,u*r+c*o*s,-u*o+c*r*s,-c*a,o*a,r*a,s),i}var E8e=1.0000010178*_c,C8e=100.46645683*id,v8e=129597742283429e-5*of,Uue=16002,zue=21863,Vue=32004,jue=10931,Hue=14529,Gue=16368,Wue=15318,que=32794,S8e=64*1e-7*_c,w8e=-152*1e-7*_c,I8e=62*1e-7*_c,P8e=-8*1e-7*_c,D8e=32*1e-7*_c,R8e=-41*1e-7*_c,O8e=19*1e-7*_c,M8e=-11*1e-7*_c,N8e=-150*1e-7*_c,L8e=-46*1e-7*_c,F8e=68*1e-7*_c,B8e=54*1e-7*_c,k8e=14*1e-7*_c,U8e=24*1e-7*_c,z8e=-28*1e-7*_c,V8e=22*1e-7*_c,Yue=10,Xue=16002,Kue=21863,$ue=10931,Jue=1473,Zue=32004,Que=4387,efe=73,j8e=-325*1e-7,H8e=-322*1e-7,G8e=-79*1e-7,W8e=232*1e-7,q8e=-52*1e-7,Y8e=97*1e-7,X8e=55*1e-7,K8e=-41*1e-7,$8e=-105*1e-7,J8e=-137*1e-7,Z8e=258*1e-7,Q8e=35*1e-7,eje=-116*1e-7,tje=-88*1e-7,nje=-112*1e-7,ije=-80*1e-7,GE=new K(0,0,ai.TAI);function rje(e,t){nfe(e,GE);let i=(GE.dayNumber-n2.dayNumber+(GE.secondsOfDay-n2.secondsOfDay)/Un.SECONDS_PER_DAY)/(Un.DAYS_PER_JULIAN_CENTURY*10),r=.3595362*i,o=E8e+S8e*Math.cos(Uue*r)+N8e*Math.sin(Uue*r)+w8e*Math.cos(zue*r)+L8e*Math.sin(zue*r)+I8e*Math.cos(Vue*r)+F8e*Math.sin(Vue*r)+P8e*Math.cos(jue*r)+B8e*Math.sin(jue*r)+D8e*Math.cos(Hue*r)+k8e*Math.sin(Hue*r)+R8e*Math.cos(Gue*r)+U8e*Math.sin(Gue*r)+O8e*Math.cos(Wue*r)+z8e*Math.sin(Wue*r)+M8e*Math.cos(que*r)+V8e*Math.sin(que*r),s=C8e+v8e*i+j8e*Math.cos(Yue*r)+$8e*Math.sin(Yue*r)+H8e*Math.cos(Xue*r)+J8e*Math.sin(Xue*r)+G8e*Math.cos(Kue*r)+Z8e*Math.sin(Kue*r)+W8e*Math.cos($ue*r)+Q8e*Math.sin($ue*r)+q8e*Math.cos(Jue*r)+eje*Math.sin(Jue*r)+Y8e*Math.cos(Zue*r)+tje*Math.sin(Zue*r)+X8e*Math.cos(Que*r)+nje*Math.sin(Que*r)+K8e*Math.cos(efe*r)+ije*Math.sin(efe*r),a=.0167086342-.0004203654*i,c=102.93734808*id+11612.3529*of*i,u=469.97289*of*i,f=174.87317577*id-8679.27034*of*i;return ife(o,a,u,c,f,s,t)}function rfe(e,t){nfe(e,GE);let i=(GE.dayNumber-n2.dayNumber+(GE.secondsOfDay-n2.secondsOfDay)/Un.SECONDS_PER_DAY)/Un.DAYS_PER_JULIAN_CENTURY,r=i*i,o=r*i,s=o*i,a=383397.7725+.004*i,c=.055545526-16e-9*i,u=5.15668983*id,f=-8e-5*i+.02966*r-42e-6*o-13e-8*s,d=83.35324312*id,p=146434202669e-4*i-38.2702*r-.045047*o+21301e-8*s,g=125.04455501*id,m=-69679193631e-4*i+6.3602*r+.007625*o-3586e-8*s,y=218.31664563*id,A=17325593434847e-4*i-6.391*r+.006588*o-3169e-8*s,b=297.85019547*id+of*(1602961601209e-3*i-6.3706*r+.006593*o-3169e-8*s),x=93.27209062*id+of*(17395272628478e-4*i-12.7512*r-.001037*o+417e-8*s),T=134.96340251*id+of*(17179159232178e-4*i+31.8792*r+.051635*o-2447e-7*s),E=357.52910918*id+of*(1295965810481e-4*i-.5532*r+136e-6*o-1149e-8*s),v=310.17137918*id-of*(6967051436e-3*i+6.2068*r+.007618*o-3219e-8*s),S=2*b,I=4*b,R=6*b,O=2*T,L=3*T,_=4*T,C=2*x;a+=3400.4*Math.cos(S)-635.6*Math.cos(S-T)-235.6*Math.cos(T)+218.1*Math.cos(S-E)+181*Math.cos(S+T),c+=.014216*Math.cos(S-T)+.008551*Math.cos(S-O)-.001383*Math.cos(T)+.001356*Math.cos(S+T)-.001147*Math.cos(I-L)-914e-6*Math.cos(I-O)+869e-6*Math.cos(S-E-T)-627e-6*Math.cos(S)-394e-6*Math.cos(I-_)+282e-6*Math.cos(S-E-O)-279e-6*Math.cos(b-T)-236e-6*Math.cos(O)+231e-6*Math.cos(I)+229e-6*Math.cos(R-_)-201e-6*Math.cos(O-C),f+=486.26*Math.cos(S-C)-40.13*Math.cos(S)+37.51*Math.cos(C)+25.73*Math.cos(O-C)+19.97*Math.cos(S-E-C),p+=-55609*Math.sin(S-T)-34711*Math.sin(S-O)-9792*Math.sin(T)+9385*Math.sin(I-L)+7505*Math.sin(I-O)+5318*Math.sin(S+T)+3484*Math.sin(I-_)-3417*Math.sin(S-E-T)-2530*Math.sin(R-_)-2376*Math.sin(S)-2075*Math.sin(S-L)-1883*Math.sin(O)-1736*Math.sin(R-5*T)+1626*Math.sin(E)-1370*Math.sin(R-L),m+=-5392*Math.sin(S-C)-540*Math.sin(E)-441*Math.sin(S)+423*Math.sin(C)-288*Math.sin(O-C),A+=-3332.9*Math.sin(S)+1197.4*Math.sin(S-T)-662.5*Math.sin(E)+396.3*Math.sin(T)-218*Math.sin(S-E);let w=2*v,D=3*v;f+=46.997*Math.cos(v)*i-.614*Math.cos(S-C+v)*i+.614*Math.cos(S-C-v)*i-.0297*Math.cos(w)*r-.0335*Math.cos(v)*r+.0012*Math.cos(S-C+w)*r-16e-5*Math.cos(v)*o+4e-5*Math.cos(D)*o+4e-5*Math.cos(w)*o;let N=2.116*Math.sin(v)*i-.111*Math.sin(S-C-v)*i-.0015*Math.sin(v)*r;p+=N,A+=N,m+=-520.77*Math.sin(v)*i+13.66*Math.sin(S-C+v)*i+1.12*Math.sin(S-v)*i-1.06*Math.sin(C-v)*i+.66*Math.sin(w)*r+.371*Math.sin(v)*r-.035*Math.sin(S-C+w)*r-.015*Math.sin(S-C+v)*r+.0014*Math.sin(v)*o-.0011*Math.sin(D)*o-9e-4*Math.sin(w)*o,a*=p8e;let F=u+f*of,V=d+p*of,B=y+A*of,j=g+m*of;return ife(a,c,F,V,j,B,t)}var tfe=.012300034,oje=tfe/(tfe+1)*-1;function sje(e,t){return t=rfe(e,t),h.multiplyByScalar(t,oje,t)}var ofe=new $(1.0000000000000002,5619723173785822e-31,4690511510146299e-34,-5154129427414611e-31,.9174820620691819,-.39777715593191376,-223970096136568e-30,.39777715593191376,.9174820620691819),oP=new h;fX.computeSunPositionInEarthInertialFrame=function(e,t){return l(e)||(e=K.now()),l(t)||(t=new h),oP=rje(e,oP),t=h.negate(oP,t),sje(e,oP),h.subtract(t,oP,t),$.multiplyByVector(ofe,t,t),t};fX.computeMoonPositionInEarthInertialFrame=function(e,t){return l(e)||(e=K.now()),t=rfe(e,t),$.multiplyByVector(ofe,t,t),t};var Pb=fX;var sP={MORPHING:0,COLUMBUS_VIEW:1,SCENE2D:2,SCENE3D:3};sP.getMorphTime=function(e){return e===sP.SCENE3D?1:e===sP.MORPHING?void 0:0};Object.freeze(sP);var re=sP;function aje(e){e=e??H.EMPTY_OBJECT,this.color=z.clone(e.color??z.WHITE),this.intensity=e.intensity??2}var N_=aje;function WE(){this.globeDepthTexture=void 0,this.edgeIdTexture=void 0,this.edgeColorTexture=void 0,this.edgeDepthTexture=void 0,this.planarFillIdTexture=void 0,this.gamma=void 0,this._viewport=new et,this._viewportCartesian4=new se,this._viewportDirty=!1,this._viewportOrthographicMatrix=M.clone(M.IDENTITY),this._viewportTransformation=M.clone(M.IDENTITY),this._model=M.clone(M.IDENTITY),this._view=M.clone(M.IDENTITY),this._inverseView=M.clone(M.IDENTITY),this._projection=M.clone(M.IDENTITY),this._infiniteProjection=M.clone(M.IDENTITY),this._entireFrustum=new U,this._currentFrustum=new U,this._frustumPlanes=new se,this._farDepthFromNearPlusOne=void 0,this._log2FarDepthFromNearPlusOne=void 0,this._oneOverLog2FarDepthFromNearPlusOne=void 0,this._frameState=void 0,this._temeToPseudoFixed=$.clone(M.IDENTITY),this._view3DDirty=!0,this._view3D=new M,this._inverseView3DDirty=!0,this._inverseView3D=new M,this._inverseModelDirty=!0,this._inverseModel=new M,this._inverseTransposeModelDirty=!0,this._inverseTransposeModel=new $,this._viewRotation=new $,this._inverseViewRotation=new $,this._viewRotation3D=new $,this._inverseViewRotation3D=new $,this._inverseProjectionDirty=!0,this._inverseProjection=new M,this._modelViewDirty=!0,this._modelView=new M,this._modelView3DDirty=!0,this._modelView3D=new M,this._modelViewRelativeToEyeDirty=!0,this._modelViewRelativeToEye=new M,this._inverseModelViewDirty=!0,this._inverseModelView=new M,this._inverseModelView3DDirty=!0,this._inverseModelView3D=new M,this._viewProjectionDirty=!0,this._viewProjection=new M,this._inverseViewProjectionDirty=!0,this._inverseViewProjection=new M,this._modelViewProjectionDirty=!0,this._modelViewProjection=new M,this._inverseModelViewProjectionDirty=!0,this._inverseModelViewProjection=new M,this._modelViewProjectionRelativeToEyeDirty=!0,this._modelViewProjectionRelativeToEye=new M,this._modelViewInfiniteProjectionDirty=!0,this._modelViewInfiniteProjection=new M,this._normalDirty=!0,this._normal=new $,this._normal3DDirty=!0,this._normal3D=new $,this._inverseNormalDirty=!0,this._inverseNormal=new $,this._inverseNormal3DDirty=!0,this._inverseNormal3D=new $,this._encodedCameraPositionMCDirty=!0,this._encodedCameraPositionMC=new Sn,this._cameraPosition=new h,this._sunPositionWC=new h,this._sunPositionColumbusView=new h,this._sunDirectionWC=new h,this._sunDirectionEC=new h,this._moonDirectionEC=new h,this._lightDirectionWC=new h,this._lightDirectionEC=new h,this._lightColor=new h,this._lightColorHdr=new h,this._pass=void 0,this._mode=void 0,this._mapProjection=void 0,this._ellipsoid=void 0,this._cameraDirection=new h,this._cameraRight=new h,this._cameraUp=new h,this._frustum2DWidth=0,this._eyeHeight=0,this._eyeHeight2D=new U,this._eyeCartographic=new h,this._eyeEllipsoidNormalEC=new h,this._eyeEllipsoidCurvature=new U,this._eyeToEnu=new $,this._modelToEnu=new M,this._enuToModel=new M,this._pixelRatio=1,this._orthographicIn3D=!1,this._backgroundColor=new z,this._brdfLut=void 0,this._environmentMap=void 0,this._sphericalHarmonicCoefficients=void 0,this._specularEnvironmentMaps=void 0,this._specularEnvironmentMapsMaximumLOD=void 0,this._fogDensity=void 0,this._fogVisualDensityScalar=void 0,this._fogMinimumBrightness=void 0,this._atmosphereHsbShift=void 0,this._atmosphereLightIntensity=void 0,this._atmosphereRayleighCoefficient=new h,this._atmosphereRayleighScaleHeight=new h,this._atmosphereMieCoefficient=new h,this._atmosphereMieScaleHeight=void 0,this._atmosphereMieAnisotropy=void 0,this._atmosphereDynamicLighting=void 0,this._invertClassificationColor=void 0,this._splitPosition=0,this._pixelSizePerMeter=void 0,this._geometricToleranceOverMeter=void 0,this._minimumDisableDepthTestDistance=void 0}Object.defineProperties(WE.prototype,{frameState:{get:function(){return this._frameState}},viewport:{get:function(){return this._viewport},set:function(e){if(!et.equals(e,this._viewport)){et.clone(e,this._viewport);let t=this._viewport,n=this._viewportCartesian4;n.x=t.x,n.y=t.y,n.z=t.width,n.w=t.height,this._viewportDirty=!0}}},viewportCartesian4:{get:function(){return this._viewportCartesian4}},viewportOrthographic:{get:function(){return cfe(this),this._viewportOrthographicMatrix}},viewportTransformation:{get:function(){return cfe(this),this._viewportTransformation}},model:{get:function(){return this._model},set:function(e){M.clone(e,this._model),this._modelView3DDirty=!0,this._inverseModelView3DDirty=!0,this._inverseModelDirty=!0,this._inverseTransposeModelDirty=!0,this._modelViewDirty=!0,this._inverseModelViewDirty=!0,this._modelViewRelativeToEyeDirty=!0,this._inverseModelViewDirty=!0,this._modelViewProjectionDirty=!0,this._inverseModelViewProjectionDirty=!0,this._modelViewProjectionRelativeToEyeDirty=!0,this._modelViewInfiniteProjectionDirty=!0,this._normalDirty=!0,this._inverseNormalDirty=!0,this._normal3DDirty=!0,this._inverseNormal3DDirty=!0,this._encodedCameraPositionMCDirty=!0}},inverseModel:{get:function(){return this._inverseModelDirty&&(this._inverseModelDirty=!1,M.inverse(this._model,this._inverseModel)),this._inverseModel}},inverseTransposeModel:{get:function(){let e=this._inverseTransposeModel;return this._inverseTransposeModelDirty&&(this._inverseTransposeModelDirty=!1,M.getMatrix3(this.inverseModel,e),$.transpose(e,e)),e}},view:{get:function(){return this._view}},view3D:{get:function(){return hX(this),this._view3D}},viewRotation:{get:function(){return hX(this),this._viewRotation}},viewRotation3D:{get:function(){return hX(this),this._viewRotation3D}},inverseView:{get:function(){return this._inverseView}},inverseView3D:{get:function(){return ffe(this),this._inverseView3D}},inverseViewRotation:{get:function(){return this._inverseViewRotation}},inverseViewRotation3D:{get:function(){return ffe(this),this._inverseViewRotation3D}},projection:{get:function(){return this._projection}},inverseProjection:{get:function(){return yje(this),this._inverseProjection}},infiniteProjection:{get:function(){return this._infiniteProjection}},modelView:{get:function(){return Aje(this),this._modelView}},modelView3D:{get:function(){return bje(this),this._modelView3D}},modelViewRelativeToEye:{get:function(){return Sje(this),this._modelViewRelativeToEye}},inverseModelView:{get:function(){return xje(this),this._inverseModelView}},inverseModelView3D:{get:function(){return Tje(this),this._inverseModelView3D}},viewProjection:{get:function(){return Eje(this),this._viewProjection}},inverseViewProjection:{get:function(){return Cje(this),this._inverseViewProjection}},modelViewProjection:{get:function(){return vje(this),this._modelViewProjection}},inverseModelViewProjection:{get:function(){return wje(this),this._inverseModelViewProjection}},modelViewProjectionRelativeToEye:{get:function(){return Ije(this),this._modelViewProjectionRelativeToEye}},modelViewInfiniteProjection:{get:function(){return Pje(this),this._modelViewInfiniteProjection}},normal:{get:function(){return Dje(this),this._normal}},normal3D:{get:function(){return Rje(this),this._normal3D}},inverseNormal:{get:function(){return Oje(this),this._inverseNormal}},inverseNormal3D:{get:function(){return Mje(this),this._inverseNormal3D}},entireFrustum:{get:function(){return this._entireFrustum}},currentFrustum:{get:function(){return this._currentFrustum}},frustumPlanes:{get:function(){return this._frustumPlanes}},farDepthFromNearPlusOne:{get:function(){return this._farDepthFromNearPlusOne}},log2FarDepthFromNearPlusOne:{get:function(){return this._log2FarDepthFromNearPlusOne}},oneOverLog2FarDepthFromNearPlusOne:{get:function(){return this._oneOverLog2FarDepthFromNearPlusOne}},eyeHeight:{get:function(){return this._eyeHeight}},eyeCartographic:{get:function(){return this._eyeCartographic}},eyeHeight2D:{get:function(){return this._eyeHeight2D}},eyeEllipsoidNormalEC:{get:function(){return this._eyeEllipsoidNormalEC}},eyeEllipsoidCurvature:{get:function(){return this._eyeEllipsoidCurvature}},eyeToEnu:{get:function(){return this._eyeToEnu}},modelToEnu:{get:function(){return this._modelToEnu}},enuToModel:{get:function(){return this._enuToModel}},sunPositionWC:{get:function(){return this._sunPositionWC}},sunPositionColumbusView:{get:function(){return this._sunPositionColumbusView}},sunDirectionWC:{get:function(){return this._sunDirectionWC}},sunDirectionEC:{get:function(){return this._sunDirectionEC}},moonDirectionEC:{get:function(){return this._moonDirectionEC}},lightDirectionWC:{get:function(){return this._lightDirectionWC}},lightDirectionEC:{get:function(){return this._lightDirectionEC}},lightColor:{get:function(){return this._lightColor}},lightColorHdr:{get:function(){return this._lightColorHdr}},encodedCameraPositionMCHigh:{get:function(){return ufe(this),this._encodedCameraPositionMC.high}},encodedCameraPositionMCLow:{get:function(){return ufe(this),this._encodedCameraPositionMC.low}},temeToPseudoFixedMatrix:{get:function(){return this._temeToPseudoFixed}},pixelRatio:{get:function(){return this._pixelRatio}},fogDensity:{get:function(){return this._fogDensity}},fogVisualDensityScalar:{get:function(){return this._fogVisualDensityScalar}},fogMinimumBrightness:{get:function(){return this._fogMinimumBrightness}},atmosphereHsbShift:{get:function(){return this._atmosphereHsbShift}},atmosphereLightIntensity:{get:function(){return this._atmosphereLightIntensity}},atmosphereRayleighCoefficient:{get:function(){return this._atmosphereRayleighCoefficient}},atmosphereRayleighScaleHeight:{get:function(){return this._atmosphereRayleighScaleHeight}},atmosphereMieCoefficient:{get:function(){return this._atmosphereMieCoefficient}},atmosphereMieScaleHeight:{get:function(){return this._atmosphereMieScaleHeight}},atmosphereMieAnisotropy:{get:function(){return this._atmosphereMieAnisotropy}},atmosphereDynamicLighting:{get:function(){return this._atmosphereDynamicLighting}},geometricToleranceOverMeter:{get:function(){return this._geometricToleranceOverMeter}},pass:{get:function(){return this._pass}},backgroundColor:{get:function(){return this._backgroundColor}},brdfLut:{get:function(){return this._brdfLut}},environmentMap:{get:function(){return this._environmentMap}},sphericalHarmonicCoefficients:{get:function(){return this._sphericalHarmonicCoefficients}},specularEnvironmentMaps:{get:function(){return this._specularEnvironmentMaps}},specularEnvironmentMapsMaximumLOD:{get:function(){return this._specularEnvironmentMapsMaximumLOD}},splitPosition:{get:function(){return this._splitPosition}},minimumDisableDepthTestDistance:{get:function(){return this._minimumDisableDepthTestDistance}},invertClassificationColor:{get:function(){return this._invertClassificationColor}},orthographicIn3D:{get:function(){return this._orthographicIn3D}},ellipsoid:{get:function(){return this._ellipsoid??ee.default}}});function cje(e,t){M.clone(t,e._view),M.getMatrix3(t,e._viewRotation),e._view3DDirty=!0,e._inverseView3DDirty=!0,e._modelViewDirty=!0,e._modelView3DDirty=!0,e._modelViewRelativeToEyeDirty=!0,e._inverseModelViewDirty=!0,e._inverseModelView3DDirty=!0,e._viewProjectionDirty=!0,e._inverseViewProjectionDirty=!0,e._modelViewProjectionDirty=!0,e._modelViewProjectionRelativeToEyeDirty=!0,e._modelViewInfiniteProjectionDirty=!0,e._normalDirty=!0,e._inverseNormalDirty=!0,e._normal3DDirty=!0,e._inverseNormal3DDirty=!0}function lje(e,t){M.clone(t,e._inverseView),M.getMatrix3(t,e._inverseViewRotation)}function uje(e,t){M.clone(t,e._projection),e._inverseProjectionDirty=!0,e._viewProjectionDirty=!0,e._inverseViewProjectionDirty=!0,e._modelViewProjectionDirty=!0,e._modelViewProjectionRelativeToEyeDirty=!0}function fje(e,t){M.clone(t,e._infiniteProjection),e._modelViewInfiniteProjectionDirty=!0}var sfe=new h,dje=new M,afe=new $;function hje(e,t){h.clone(t.positionWC,e._cameraPosition),h.clone(t.directionWC,e._cameraDirection),h.clone(t.rightWC,e._cameraRight),h.clone(t.upWC,e._cameraUp);let n=e._ellipsoid,i,r=t.positionCartographic;if(l(r)?(e._eyeHeight=r.height,e._eyeCartographic=h.fromElements(r.longitude,r.latitude,r.height,e._eyeCartographic),e._eyeEllipsoidNormalEC=n.geodeticSurfaceNormalCartographic(r,e._eyeEllipsoidNormalEC),i=h.fromRadians(r.longitude,r.latitude,0,n,sfe)):(e._eyeHeight=-n.maximumRadius,h.magnitude(t.positionWC)>0&&(e._eyeEllipsoidNormalEC=h.normalize(t.positionWC,e._eyeEllipsoidNormalEC)),i=n.scaleToGeodeticSurface(t.positionWC,sfe)),e._encodedCameraPositionMCDirty=!0,!l(i))return;e._eyeEllipsoidNormalEC=$.multiplyByVector(e._viewRotation,e._eyeEllipsoidNormalEC,e._eyeEllipsoidNormalEC);let o=At.eastNorthUpToFixedFrame(i,n,dje);e._enuToModel=M.multiplyTransformation(e.inverseModel,o,e._enuToModel),e._modelToEnu=M.inverseTransformation(e._enuToModel,e._modelToEnu);let s=M.getRotation(o,afe),a=$.multiply(e._viewRotation,s,afe);e._eyeToEnu=$.transpose(a,e._eyeToEnu),P.equalsEpsilon(n._radii.x,n._radii.y,P.EPSILON15)&&(e._eyeEllipsoidCurvature=n.getLocalCurvature(i,e._eyeEllipsoidCurvature))}var dX=new $,mje=new he;function pje(e,t){At.computeIcrfToCentralBodyFixedMatrix(t.time,dX);let n=Pb.computeSunPositionInEarthInertialFrame(t.time,e._sunPositionWC);$.multiplyByVector(dX,n,n),h.normalize(n,e._sunDirectionWC),n=$.multiplyByVector(e.viewRotation3D,n,e._sunDirectionEC),h.normalize(n,n),n=Pb.computeMoonPositionInEarthInertialFrame(t.time,e._moonDirectionEC),$.multiplyByVector(dX,n,n),$.multiplyByVector(e.viewRotation3D,n,n),h.normalize(n,n);let i=t.mapProjection,o=i.ellipsoid.cartesianToCartographic(e._sunPositionWC,mje);i.project(o,e._sunPositionColumbusView)}WE.prototype.updateCamera=function(e){cje(this,e.viewMatrix),lje(this,e.inverseViewMatrix),hje(this,e),this._entireFrustum.x=e.frustum.near,this._entireFrustum.y=e.frustum.far,this.updateFrustum(e.frustum),this._orthographicIn3D=this._mode!==re.SCENE2D&&e.frustum instanceof _n};WE.prototype.updateFrustum=function(e){uje(this,e.projectionMatrix),l(e.infiniteProjectionMatrix)&&fje(this,e.infiniteProjectionMatrix),this._currentFrustum.x=e.near,this._currentFrustum.y=e.far,this._farDepthFromNearPlusOne=e.far-e.near+1,this._log2FarDepthFromNearPlusOne=P.log2(this._farDepthFromNearPlusOne),this._oneOverLog2FarDepthFromNearPlusOne=1/this._log2FarDepthFromNearPlusOne;let t=e.offCenterFrustum;l(t)&&(e=t),this._frustumPlanes.x=e.top,this._frustumPlanes.y=e.bottom,this._frustumPlanes.z=e.left,this._frustumPlanes.w=e.right};WE.prototype.updatePass=function(e){this._pass=e};var gje=[],_je=new N_;WE.prototype.update=function(e){this._mode=e.mode,this._mapProjection=e.mapProjection,this._ellipsoid=e.mapProjection.ellipsoid,this._pixelRatio=e.pixelRatio;let t=e.camera;this.updateCamera(t),e.mode===re.SCENE2D?(this._frustum2DWidth=t.frustum.right-t.frustum.left,this._eyeHeight2D.x=this._frustum2DWidth*.5,this._eyeHeight2D.y=this._eyeHeight2D.x*this._eyeHeight2D.x):(this._frustum2DWidth=0,this._eyeHeight2D.x=0,this._eyeHeight2D.y=0),pje(this,e);let n=e.light??_je;n instanceof N_?(this._lightDirectionWC=h.clone(this._sunDirectionWC,this._lightDirectionWC),this._lightDirectionEC=h.clone(this._sunDirectionEC,this._lightDirectionEC)):(this._lightDirectionWC=h.normalize(h.negate(n.direction,this._lightDirectionWC),this._lightDirectionWC),this._lightDirectionEC=$.multiplyByVector(this.viewRotation3D,this._lightDirectionWC,this._lightDirectionEC));let i=n.color,r=h.fromElements(i.red,i.green,i.blue,this._lightColorHdr);r=h.multiplyByScalar(r,n.intensity,r);let o=h.maximumComponent(r);o>1?h.divideByScalar(r,o,this._lightColor):h.clone(r,this._lightColor);let s=e.brdfLutGenerator,a=l(s)?s.colorTexture:void 0;this._brdfLut=a,this._environmentMap=e.environmentMap??e.context.defaultCubeMap,this._sphericalHarmonicCoefficients=e.sphericalHarmonicCoefficients??gje,this._specularEnvironmentMaps=e.specularEnvironmentMaps,this._specularEnvironmentMapsMaximumLOD=e.specularEnvironmentMapsMaximumLOD,this._fogDensity=e.fog.density,this._fogVisualDensityScalar=e.fog.visualDensityScalar,this._fogMinimumBrightness=e.fog.minimumBrightness;let c=e.atmosphere;l(c)&&(this._atmosphereHsbShift=h.fromElements(c.hueShift,c.saturationShift,c.brightnessShift,this._atmosphereHsbShift),this._atmosphereLightIntensity=c.lightIntensity,this._atmosphereRayleighCoefficient=h.clone(c.rayleighCoefficient,this._atmosphereRayleighCoefficient),this._atmosphereRayleighScaleHeight=c.rayleighScaleHeight,this._atmosphereMieCoefficient=h.clone(c.mieCoefficient,this._atmosphereMieCoefficient),this._atmosphereMieScaleHeight=c.mieScaleHeight,this._atmosphereMieAnisotropy=c.mieAnisotropy,this._atmosphereDynamicLighting=c.dynamicLighting),this._invertClassificationColor=e.invertClassificationColor,this._frameState=e,this._temeToPseudoFixed=At.computeTemeToPseudoFixedMatrix(e.time,this._temeToPseudoFixed),this._splitPosition=e.splitPosition*e.context.drawingBufferWidth;let u=t.frustum.fov,f=this._viewport,d;l(u)?f.height>f.width?d=Math.tan(.5*u)*2/f.height:d=Math.tan(.5*u)*2/f.width:d=1/Math.max(f.width,f.height),this._geometricToleranceOverMeter=d*e.maximumScreenSpaceError,z.clone(e.backgroundColor,this._backgroundColor),this._minimumDisableDepthTestDistance=e.minimumDisableDepthTestDistance,this._minimumDisableDepthTestDistance*=this._minimumDisableDepthTestDistance,this._minimumDisableDepthTestDistance===Number.POSITIVE_INFINITY&&(this._minimumDisableDepthTestDistance=-1)};function cfe(e){if(e._viewportDirty){let t=e._viewport;M.computeOrthographicOffCenter(t.x,t.x+t.width,t.y,t.y+t.height,0,1,e._viewportOrthographicMatrix),M.computeViewportTransformation(t,0,1,e._viewportTransformation),e._viewportDirty=!1}}function yje(e){e._inverseProjectionDirty&&(e._inverseProjectionDirty=!1,e._mode!==re.SCENE2D&&e._mode!==re.MORPHING&&!e._orthographicIn3D?M.inverse(e._projection,e._inverseProjection):M.clone(M.ZERO,e._inverseProjection))}function Aje(e){e._modelViewDirty&&(e._modelViewDirty=!1,M.multiplyTransformation(e._view,e._model,e._modelView))}function bje(e){e._modelView3DDirty&&(e._modelView3DDirty=!1,M.multiplyTransformation(e.view3D,e._model,e._modelView3D))}function xje(e){e._inverseModelViewDirty&&(e._inverseModelViewDirty=!1,M.inverse(e.modelView,e._inverseModelView))}function Tje(e){e._inverseModelView3DDirty&&(e._inverseModelView3DDirty=!1,M.inverse(e.modelView3D,e._inverseModelView3D))}function Eje(e){e._viewProjectionDirty&&(e._viewProjectionDirty=!1,M.multiply(e._projection,e._view,e._viewProjection))}function Cje(e){e._inverseViewProjectionDirty&&(e._inverseViewProjectionDirty=!1,M.inverse(e.viewProjection,e._inverseViewProjection))}function vje(e){e._modelViewProjectionDirty&&(e._modelViewProjectionDirty=!1,M.multiply(e._projection,e.modelView,e._modelViewProjection))}function Sje(e){if(e._modelViewRelativeToEyeDirty){e._modelViewRelativeToEyeDirty=!1;let t=e.modelView,n=e._modelViewRelativeToEye;n[0]=t[0],n[1]=t[1],n[2]=t[2],n[3]=t[3],n[4]=t[4],n[5]=t[5],n[6]=t[6],n[7]=t[7],n[8]=t[8],n[9]=t[9],n[10]=t[10],n[11]=t[11],n[12]=0,n[13]=0,n[14]=0,n[15]=t[15]}}function wje(e){e._inverseModelViewProjectionDirty&&(e._inverseModelViewProjectionDirty=!1,M.inverse(e.modelViewProjection,e._inverseModelViewProjection))}function Ije(e){e._modelViewProjectionRelativeToEyeDirty&&(e._modelViewProjectionRelativeToEyeDirty=!1,M.multiply(e._projection,e.modelViewRelativeToEye,e._modelViewProjectionRelativeToEye))}function Pje(e){e._modelViewInfiniteProjectionDirty&&(e._modelViewInfiniteProjectionDirty=!1,M.multiply(e._infiniteProjection,e.modelView,e._modelViewInfiniteProjection))}function Dje(e){if(e._normalDirty){e._normalDirty=!1;let t=e._normal;M.getMatrix3(e.inverseModelView,t),$.transpose(t,t)}}function Rje(e){if(e._normal3DDirty){e._normal3DDirty=!1;let t=e._normal3D;M.getMatrix3(e.inverseModelView3D,t),$.transpose(t,t)}}function Oje(e){if(e._inverseNormalDirty){e._inverseNormalDirty=!1;let t=e._inverseNormal;M.getMatrix3(e.modelView,t),$.transpose(t,t)}}function Mje(e){if(e._inverseNormal3DDirty){e._inverseNormal3DDirty=!1;let t=e._inverseNormal3D;M.getMatrix3(e.modelView3D,t),$.transpose(t,t)}}var lfe=new h;function ufe(e){e._encodedCameraPositionMCDirty&&(e._encodedCameraPositionMCDirty=!1,M.multiplyByPoint(e.inverseModel,e._cameraPosition,lfe),Sn.fromCartesian(lfe,e._encodedCameraPositionMC))}var Nje=new h,Lje=new h,Fje=new h,Bje=new h,kje=new he,Uje=new h,zje=new M;function Vje(e,t,n,i,r,o,s,a){let c=Nje;c.x=e.y,c.y=e.z,c.z=e.x;let u=Lje;u.x=n.y,u.y=n.z,u.z=n.x;let f=Fje;f.x=i.y,f.y=i.z,f.z=i.x;let d=Bje;d.x=t.y,d.y=t.z,d.z=t.x,o===re.SCENE2D&&(c.z=r*.5);let p=s.unproject(c,kje);p.longitude=P.clamp(p.longitude,-Math.PI,Math.PI),p.latitude=P.clamp(p.latitude,-P.PI_OVER_TWO,P.PI_OVER_TWO);let g=s.ellipsoid,m=g.cartographicToCartesian(p,Uje),y=At.eastNorthUpToFixedFrame(m,g,zje);return M.multiplyByPointAsVector(y,u,u),M.multiplyByPointAsVector(y,f,f),M.multiplyByPointAsVector(y,d,d),l(a)||(a=new M),a[0]=u.x,a[1]=f.x,a[2]=-d.x,a[3]=0,a[4]=u.y,a[5]=f.y,a[6]=-d.y,a[7]=0,a[8]=u.z,a[9]=f.z,a[10]=-d.z,a[11]=0,a[12]=-h.dot(u,m),a[13]=-h.dot(f,m),a[14]=h.dot(d,m),a[15]=1,a}function hX(e){e._view3DDirty&&(e._mode===re.SCENE3D?M.clone(e._view,e._view3D):Vje(e._cameraPosition,e._cameraDirection,e._cameraRight,e._cameraUp,e._frustum2DWidth,e._mode,e._mapProjection,e._view3D),M.getMatrix3(e._view3D,e._viewRotation3D),e._view3DDirty=!1)}function ffe(e){e._inverseView3DDirty&&(M.inverseTransformation(e.view3D,e._inverseView3D),M.getMatrix3(e._inverseView3D,e._inverseViewRotation3D),e._inverseView3DDirty=!1)}var i2=WE;function uu(e,t){let{getWebGLStub:n,requestWebgl1:i,webgl:r={},allowTextureFilterAnisotropic:o=!0,transparentDefaultTexture:s=!1}=t??{};r.alpha=r.alpha??!1,r.stencil=r.stencil??!0,r.powerPreference=r.powerPreference??"high-performance";let a=l(n)?n(e,r):jje(e,r,i),u=typeof WebGL2RenderingContext<"u"&&a instanceof WebGL2RenderingContext;this._canvas=e,this._originalGLContext=a,this._gl=a,this._webgl2=u,this._id=Kn(),this.validateFramebuffer=!1,this.validateShaderProgram=!1,this.logShaderCompilation=!1,this._throwOnWebGLError=!1,this._shaderCache=new QB(this),this._textureCache=new t2,this._transparentDefaultTexture=s;let f=a;this._stencilBits=f.getParameter(f.STENCIL_BITS),Ut._maximumCombinedTextureImageUnits=f.getParameter(f.MAX_COMBINED_TEXTURE_IMAGE_UNITS),Ut._maximumCubeMapSize=f.getParameter(f.MAX_CUBE_MAP_TEXTURE_SIZE),Ut._maximumFragmentUniformVectors=f.getParameter(f.MAX_FRAGMENT_UNIFORM_VECTORS),Ut._maximumTextureImageUnits=f.getParameter(f.MAX_TEXTURE_IMAGE_UNITS),Ut._maximumRenderbufferSize=f.getParameter(f.MAX_RENDERBUFFER_SIZE),Ut._maximumTextureSize=f.getParameter(f.MAX_TEXTURE_SIZE),Ut._maximum3DTextureSize=f.getParameter(f.MAX_3D_TEXTURE_SIZE),Ut._maximumVaryingVectors=f.getParameter(f.MAX_VARYING_VECTORS),Ut._maximumVertexAttributes=f.getParameter(f.MAX_VERTEX_ATTRIBS),Ut._maximumVertexTextureImageUnits=f.getParameter(f.MAX_VERTEX_TEXTURE_IMAGE_UNITS),Ut._maximumVertexUniformVectors=f.getParameter(f.MAX_VERTEX_UNIFORM_VECTORS),Ut._maximumSamples=this._webgl2?f.getParameter(f.MAX_SAMPLES):0;let d=f.getParameter(f.ALIASED_LINE_WIDTH_RANGE);Ut._minimumAliasedLineWidth=d[0],Ut._maximumAliasedLineWidth=d[1];let p=f.getParameter(f.ALIASED_POINT_SIZE_RANGE);Ut._minimumAliasedPointSize=p[0],Ut._maximumAliasedPointSize=p[1];let g=f.getParameter(f.MAX_VIEWPORT_DIMS);Ut._maximumViewportWidth=g[0],Ut._maximumViewportHeight=g[1];let m=f.getShaderPrecisionFormat(f.FRAGMENT_SHADER,f.HIGH_FLOAT);Ut._highpFloatSupported=m.precision!==0;let y=f.getShaderPrecisionFormat(f.FRAGMENT_SHADER,f.HIGH_INT);Ut._highpIntSupported=y.rangeMax!==0,this._antialias=f.getContextAttributes().antialias,this._standardDerivatives=!!Go(f,["OES_standard_derivatives"]),this._blendMinmax=!!Go(f,["EXT_blend_minmax"]),this._elementIndexUint=!!Go(f,["OES_element_index_uint"]),this._depthTexture=!!Go(f,["WEBGL_depth_texture","WEBKIT_WEBGL_depth_texture"]),this._fragDepth=!!Go(f,["EXT_frag_depth"]),this._debugShaders=Go(f,["WEBGL_debug_shaders"]),this._textureFloat=!!Go(f,["OES_texture_float"]),this._textureHalfFloat=!!Go(f,["OES_texture_half_float"]),this._textureFloatLinear=!!Go(f,["OES_texture_float_linear"]),this._textureHalfFloatLinear=!!Go(f,["OES_texture_half_float_linear"]),this._supportsTextureLod=!!Go(f,["EXT_shader_texture_lod"]),this._colorBufferFloat=!!Go(f,["EXT_color_buffer_float","WEBGL_color_buffer_float"]),this._floatBlend=!!Go(f,["EXT_float_blend"]),this._colorBufferHalfFloat=!!Go(f,["EXT_color_buffer_half_float"]),this._s3tc=!!Go(f,["WEBGL_compressed_texture_s3tc","MOZ_WEBGL_compressed_texture_s3tc","WEBKIT_WEBGL_compressed_texture_s3tc"]),this._pvrtc=!!Go(f,["WEBGL_compressed_texture_pvrtc","WEBKIT_WEBGL_compressed_texture_pvrtc"]),this._astc=!!Go(f,["WEBGL_compressed_texture_astc"]),this._etc=!!Go(f,["WEBG_compressed_texture_etc"]),this._etc1=!!Go(f,["WEBGL_compressed_texture_etc1"]),this._bc7=!!Go(f,["EXT_texture_compression_bptc"]),nf.setKTX2SupportedFormats(this._s3tc,this._pvrtc,this._astc,this._etc,this._etc1,this._bc7);let A=o?Go(f,["EXT_texture_filter_anisotropic","WEBKIT_EXT_texture_filter_anisotropic"]):void 0;this._textureFilterAnisotropic=A,Ut._maximumTextureFilterAnisotropy=l(A)?f.getParameter(A.MAX_TEXTURE_MAX_ANISOTROPY_EXT):1;let b,x,T,E,v,S,I,R,O,L;if(u){let D=this;b=function(){return D._gl.createVertexArray()},x=function(N){D._gl.bindVertexArray(N)},T=function(N){D._gl.deleteVertexArray(N)},E=function(N,F,V,B,j){f.drawElementsInstanced(N,F,V,B,j)},v=function(N,F,V,B){f.drawArraysInstanced(N,F,V,B)},S=function(N,F){f.vertexAttribDivisor(N,F)},I=function(N){f.drawBuffers(N)}}else R=Go(f,["OES_vertex_array_object"]),l(R)&&(b=function(){return R.createVertexArrayOES()},x=function(D){R.bindVertexArrayOES(D)},T=function(D){R.deleteVertexArrayOES(D)}),O=Go(f,["ANGLE_instanced_arrays"]),l(O)&&(E=function(D,N,F,V,B){O.drawElementsInstancedANGLE(D,N,F,V,B)},v=function(D,N,F,V){O.drawArraysInstancedANGLE(D,N,F,V)},S=function(D,N){O.vertexAttribDivisorANGLE(D,N)}),L=Go(f,["WEBGL_draw_buffers"]),l(L)&&(I=function(D){L.drawBuffersWEBGL(D)});this.glCreateVertexArray=b,this.glBindVertexArray=x,this.glDeleteVertexArray=T,this.glDrawElementsInstanced=E,this.glDrawArraysInstanced=v,this.glVertexAttribDivisor=S,this.glDrawBuffers=I,this._vertexArrayObject=!!R,this._instancedArrays=!!O,this._drawBuffers=!!L,Ut._maximumDrawBuffers=this.drawBuffers?f.getParameter(te.MAX_DRAW_BUFFERS):1,Ut._maximumColorAttachments=this.drawBuffers?f.getParameter(te.MAX_COLOR_ATTACHMENTS):1,this._clearColor=new z(0,0,0,0),this._clearDepth=1,this._clearStencil=0;let _=new i2,C=new gc(this),w=Ge.fromCache();this._defaultPassState=C,this._defaultRenderState=w,this._defaultTexture=void 0,this._defaultEmissiveTexture=void 0,this._defaultNormalTexture=void 0,this._defaultCubeMap=void 0,this._us=_,this._currentRenderState=w,this._currentPassState=C,this._currentFramebuffer=void 0,this._maxFrameTextureUnitIndex=0,this._vertexAttribDivisors=[],this._previousDrawInstanced=!1;for(let D=0;D<Ut._maximumVertexAttributes;D++)this._vertexAttribDivisors.push(0);this._pickObjects=new Map,this._nextPickColor=new Uint32Array(1),this.options={getWebGLStub:n,requestWebgl1:i,webgl:r,allowTextureFilterAnisotropic:o,transparentDefaultTexture:s},this.cache={},Ge.apply(f,w,C)}function jje(e,t,n){if(typeof WebGLRenderingContext>"u")throw new oe("The browser does not support WebGL. Visit http://get.webgl.org.");!n&&!(typeof WebGL2RenderingContext<"u")&&(n=!0);let r=n?"webgl":"webgl2",o=e.getContext(r,t);if(!l(o))throw new oe("The browser supports WebGL, but initialization failed.");return o}function Hje(e,t){let n="WebGL Error: ";switch(t){case e.INVALID_ENUM:n+="INVALID_ENUM";break;case e.INVALID_VALUE:n+="INVALID_VALUE";break;case e.INVALID_OPERATION:n+="INVALID_OPERATION";break;case e.OUT_OF_MEMORY:n+="OUT_OF_MEMORY";break;case e.CONTEXT_LOST_WEBGL:n+="CONTEXT_LOST_WEBGL lost";break;default:n+=`Unknown (${t})`}return n}function Gje(e,t,n,i){let r=`${Hje(e,i)}: ${t.name}(`;for(let o=0;o<n.length;++o)o!==0&&(r+=", "),r+=n[o];return r+=");",r}function Wje(e,t,n){let i=e.getError();if(i!==e.NO_ERROR)throw new oe(Gje(e,t,n,i))}function qje(e,t,n){return{get:function(){let i=e[t];return n(e,`get: ${t}`,i),e[t]},set:function(i){e[t]=i,n(e,`set: ${t}`,i)}}}function Yje(e,t){if(!l(t))return e;function n(r){return function(){let o=r.apply(e,arguments);return t(e,r,arguments),o}}let i={};for(let r in e){let o=e[r];o instanceof Function?i[r]=n(o):Object.defineProperty(i,r,qje(e,r,t))}return i}function Go(e,t){let n=t.length;for(let i=0;i<n;++i){let r=e.getExtension(t[i]);if(r)return r}}var Xje={};Object.defineProperties(uu.prototype,{id:{get:function(){return this._id}},webgl2:{get:function(){return this._webgl2}},canvas:{get:function(){return this._canvas}},shaderCache:{get:function(){return this._shaderCache}},textureCache:{get:function(){return this._textureCache}},uniformState:{get:function(){return this._us}},stencilBits:{get:function(){return this._stencilBits}},stencilBuffer:{get:function(){return this._stencilBits>=8}},antialias:{get:function(){return this._antialias}},msaa:{get:function(){return this._webgl2}},standardDerivatives:{get:function(){return this._standardDerivatives||this._webgl2}},floatBlend:{get:function(){return this._floatBlend}},blendMinmax:{get:function(){return this._blendMinmax||this._webgl2}},elementIndexUint:{get:function(){return this._elementIndexUint||this._webgl2}},depthTexture:{get:function(){return this._depthTexture||this._webgl2}},floatingPointTexture:{get:function(){return this._webgl2||this._textureFloat}},halfFloatingPointTexture:{get:function(){return this._webgl2||this._textureHalfFloat}},textureFloatLinear:{get:function(){return this._textureFloatLinear}},textureHalfFloatLinear:{get:function(){return this._webgl2&&this._textureFloatLinear||!this._webgl2&&this._textureHalfFloatLinear}},supportsTextureLod:{get:function(){return this._webgl2||this._supportsTextureLod}},textureFilterAnisotropic:{get:function(){return!!this._textureFilterAnisotropic}},s3tc:{get:function(){return this._s3tc}},pvrtc:{get:function(){return this._pvrtc}},astc:{get:function(){return this._astc}},etc:{get:function(){return this._etc}},etc1:{get:function(){return this._etc1}},bc7:{get:function(){return this._bc7}},supportsBasis:{get:function(){return this._s3tc||this._pvrtc||this._astc||this._etc||this._etc1||this._bc7}},vertexArrayObject:{get:function(){return this._vertexArrayObject||this._webgl2}},fragmentDepth:{get:function(){return this._fragDepth||this._webgl2}},instancedArrays:{get:function(){return this._instancedArrays||this._webgl2}},colorBufferFloat:{get:function(){return this._colorBufferFloat}},colorBufferHalfFloat:{get:function(){return this._webgl2&&this._colorBufferFloat||!this._webgl2&&this._colorBufferHalfFloat}},drawBuffers:{get:function(){return this._drawBuffers||this._webgl2}},debugShaders:{get:function(){return this._debugShaders}},throwOnWebGLError:{get:function(){return this._throwOnWebGLError},set:function(e){this._throwOnWebGLError=e,this._gl=Yje(this._originalGLContext,e?Wje:void 0)}},defaultTexture:{get:function(){if(this._defaultTexture===void 0){let e=Dt.defaultColor;this._defaultTexture=new Dt({context:this,source:{width:1,height:1,arrayBufferView:new Uint8Array([e.red*255,e.green*255,e.blue*255,this._transparentDefaultTexture?0:e.alpha*255])},flipY:!1})}return this._defaultTexture}},defaultEmissiveTexture:{get:function(){return this._defaultEmissiveTexture===void 0&&(this._defaultEmissiveTexture=new Dt({context:this,pixelFormat:$e.RGB,source:{width:1,height:1,arrayBufferView:new Uint8Array([0,0,0])},flipY:!1})),this._defaultEmissiveTexture}},defaultNormalTexture:{get:function(){return this._defaultNormalTexture===void 0&&(this._defaultNormalTexture=new Dt({context:this,pixelFormat:$e.RGB,source:{width:1,height:1,arrayBufferView:new Uint8Array([128,128,255])},flipY:!1})),this._defaultNormalTexture}},defaultCubeMap:{get:function(){if(this._defaultCubeMap===void 0){let e={width:1,height:1,arrayBufferView:new Uint8Array([255,255,255,255])};this._defaultCubeMap=new ls({context:this,source:{positiveX:e,negativeX:e,positiveY:e,negativeY:e,positiveZ:e,negativeZ:e},flipY:!1})}return this._defaultCubeMap}},drawingBufferHeight:{get:function(){return this._gl.drawingBufferHeight}},drawingBufferWidth:{get:function(){return this._gl.drawingBufferWidth}},defaultFramebuffer:{get:function(){return Xje}}});function dfe(e,t,n,i){let r=e._currentRenderState,o=e._currentPassState;e._currentRenderState=t,e._currentPassState=n,Ge.partialApply(e._gl,r,t,o,n,i)}var mX;typeof WebGLRenderingContext<"u"&&(mX=[te.BACK]);function r2(e,t){if(t!==e._currentFramebuffer){e._currentFramebuffer=t;let n=mX;if(l(t))t._bind(),n=t._getActiveColorAttachments();else{let i=e._gl;i.bindFramebuffer(i.FRAMEBUFFER,null)}e.drawBuffers&&e.glDrawBuffers(n)}}var Kje=new fi;uu.prototype.clear=function(e,t){e=e??Kje,t=t??this._defaultPassState;let n=this._gl,i=0,r=e.color,o=e.depth,s=e.stencil;l(r)&&(z.equals(this._clearColor,r)||(z.clone(r,this._clearColor),n.clearColor(r.red,r.green,r.blue,r.alpha)),i|=n.COLOR_BUFFER_BIT),l(o)&&(o!==this._clearDepth&&(this._clearDepth=o,n.clearDepth(o)),i|=n.DEPTH_BUFFER_BIT),l(s)&&(s!==this._clearStencil&&(this._clearStencil=s,n.clearStencil(s)),i|=n.STENCIL_BUFFER_BIT);let a=e.renderState??this._defaultRenderState;dfe(this,a,t,!0);let c=e.framebuffer??t.framebuffer;r2(this,c),n.clear(i)};function $je(e,t,n,i,r){r2(e,t),dfe(e,r,n,!1),i._bind(),e._maxFrameTextureUnitIndex=Math.max(e._maxFrameTextureUnitIndex,i.maximumTextureUnitIndex)}function Jje(e,t,n,i){let r=t._primitiveType,o=t._vertexArray,s=t._offset,a=t._count,c=t.instanceCount;e._us.model=t._modelMatrix??M.IDENTITY,n._setUniforms(i,e._us,e.validateShaderProgram),o._bind();let u=o.indexBuffer;l(u)?(s=s*u.bytesPerIndex,l(a)?a=Math.min(a,u.numberOfIndices):a=u.numberOfIndices,c===0?e._gl.drawElements(r,a,u.indexDatatype,s):e.glDrawElementsInstanced(r,a,u.indexDatatype,s,c)):(l(a)?a=Math.min(a,o.numberOfVertices):a=o.numberOfVertices,c===0?e._gl.drawArrays(r,s,a):e.glDrawArraysInstanced(r,s,a,c)),o._unBind()}uu.prototype.draw=function(e,t,n,i){t=t??this._defaultPassState;let r=e._framebuffer??t.framebuffer,o=e._renderState??this._defaultRenderState;n=n??e._shaderProgram,i=i??e._uniformMap,$je(this,r,t,n,o),Jje(this,e,n,i)};uu.prototype.beginFrame=function(){};uu.prototype.endFrame=function(){let e=this._gl;e.useProgram(null),this._currentFramebuffer=void 0,e.bindFramebuffer(e.FRAMEBUFFER,null);let t=mX;this.drawBuffers&&this.glDrawBuffers(t);let n=this._maxFrameTextureUnitIndex;this._maxFrameTextureUnitIndex=0;for(let i=0;i<n;++i)e.activeTexture(e.TEXTURE0+i),e.bindTexture(e.TEXTURE_2D,null),e.bindTexture(e.TEXTURE_CUBE_MAP,null)};uu.prototype.readPixelsToPBO=function(e){let t=this._gl;e=e??H.EMPTY_OBJECT;let n=Math.max(e.x??0,0),i=Math.max(e.y??0,0),r=e.width??this.drawingBufferWidth,o=e.height??this.drawingBufferHeight,s=e.framebuffer;if(!this._webgl2)throw new pe("A WebGL 2 context is required to read pixels using a PBO.");let a=ze.UNSIGNED_BYTE,c=$e.RGBA;l(s)&&s.numberOfColorAttachments>0&&(a=s.getColorTexture(0).pixelDatatype,c=s.getColorTexture(0).pixelFormat);let u=tt.createPixelBuffer({context:this,sizeInBytes:$e.textureSizeInBytes(c,a,r,o),usage:Me.DYNAMIC_READ});return r2(this,s),u._bind(),t.readPixels(n,i,r,o,c,ze.toWebGLConstant(a,this),0),u._unBind(),u};uu.prototype.readPixels=function(e){let t=this._gl;e=e??H.EMPTY_OBJECT;let n=Math.max(e.x??0,0),i=Math.max(e.y??0,0),r=e.width??this.drawingBufferWidth,o=e.height??this.drawingBufferHeight,s=e.framebuffer,a=ze.UNSIGNED_BYTE,c=$e.RGBA;l(s)&&s.numberOfColorAttachments>0&&(a=s.getColorTexture(0).pixelDatatype,c=s.getColorTexture(0).pixelFormat);let u=$e.createTypedArray(c,a,r,o);return r2(this,s),t.readPixels(n,i,r,o,$e.RGBA,ze.toWebGLConstant(a,this),u),u};var hfe={position:0,textureCoordinates:1};uu.prototype.getViewportQuadVertexArray=function(){let e=this.cache.viewportQuad_vertexArray;if(!l(e)){let t=new wt({attributes:{position:new Ne({componentDatatype:Y.FLOAT,componentsPerAttribute:2,values:[-1,-1,1,-1,1,1,-1,1]}),textureCoordinates:new Ne({componentDatatype:Y.FLOAT,componentsPerAttribute:2,values:[0,0,1,0,1,1,0,1]})},indices:new Uint16Array([0,1,2,0,2,3]),primitiveType:Oe.TRIANGLES});e=Vn.fromGeometry({context:this,geometry:t,attributeLocations:hfe,bufferUsage:Me.STATIC_DRAW,interleave:!0}),this.cache.viewportQuad_vertexArray=e}return e};uu.prototype.createViewportQuadCommand=function(e,t){return t=t??H.EMPTY_OBJECT,new at({vertexArray:this.getViewportQuadVertexArray(),primitiveType:Oe.TRIANGLES,renderState:t.renderState,shaderProgram:Qt.fromCache({context:this,vertexShaderSource:LE,fragmentShaderSource:e,attributeLocations:hfe}),uniformMap:t.uniformMap,owner:t.owner,framebuffer:t.framebuffer,pass:t.pass})};uu.prototype.getObjectByPickColor=function(e){return this._pickObjects.get(e)};uu.prototype.createPickId=function(e){++this._nextPickColor[0];let t=this._nextPickColor[0];if(t===0)throw new oe("Out of unique Pick IDs.");return this._pickObjects.set(t,e),new _L(this._pickObjects,t,z.fromRgba(t))};uu.prototype.isDestroyed=function(){return!1};uu.prototype.destroy=function(){let e=this.cache;for(let t in e)if(e.hasOwnProperty(t)){let n=e[t];l(n.destroy)&&n.destroy()}return this._shaderCache=this._shaderCache.destroy(),this._textureCache=this._textureCache.destroy(),this._defaultTexture=this._defaultTexture&&this._defaultTexture.destroy(),this._defaultEmissiveTexture=this._defaultEmissiveTexture&&this._defaultEmissiveTexture.destroy(),this._defaultNormalTexture=this._defaultNormalTexture&&this._defaultNormalTexture.destroy(),this._defaultCubeMap=this._defaultCubeMap&&this._defaultCubeMap.destroy(),le(this)};var qE=uu;function YE(e){e=e??H.EMPTY_OBJECT;let{context:t,width:n,height:i,colorRenderbuffers:r,colorTextures:o,depthStencilRenderbuffer:s,depthStencilTexture:a,destroyAttachments:c}=e;if(this._width=n,this._height=i,l(r)!==l(o))throw new pe("Both color renderbuffer and texture attachments must be provided.");if(l(s)!==l(a))throw new pe("Both depth-stencil renderbuffer and texture attachments must be provided.");this._renderFramebuffer=new vs({context:t,colorRenderbuffers:r,depthStencilRenderbuffer:s,destroyAttachments:c}),this._colorFramebuffer=new vs({context:t,colorTextures:o,depthStencilTexture:a,destroyAttachments:c})}YE.prototype.getRenderFramebuffer=function(){return this._renderFramebuffer};YE.prototype.getColorFramebuffer=function(){return this._colorFramebuffer};YE.prototype.blitFramebuffers=function(e,t){this._renderFramebuffer.bindRead(),this._colorFramebuffer.bindDraw();let n=e._gl,i=0;this._colorFramebuffer._colorTextures.length>0&&(i|=n.COLOR_BUFFER_BIT),l(this._colorFramebuffer.depthStencilTexture)&&(i|=n.DEPTH_BUFFER_BIT|(t?n.STENCIL_BUFFER_BIT:0)),n.blitFramebuffer(0,0,this._width,this._height,0,0,this._width,this._height,i,n.NEAREST),n.bindFramebuffer(n.READ_FRAMEBUFFER,null),n.bindFramebuffer(n.DRAW_FRAMEBUFFER,null)};YE.prototype.isDestroyed=function(){return!1};YE.prototype.destroy=function(){return this._renderFramebuffer.destroy(),this._colorFramebuffer.destroy(),le(this)};var o2=YE;var vl={RGBA4:te.RGBA4,RGBA8:te.RGBA8,RGBA16F:te.RGBA16F,RGBA32F:te.RGBA32F,RGB5_A1:te.RGB5_A1,RGB565:te.RGB565,DEPTH_COMPONENT16:te.DEPTH_COMPONENT16,STENCIL_INDEX8:te.STENCIL_INDEX8,DEPTH_STENCIL:te.DEPTH_STENCIL,DEPTH24_STENCIL8:te.DEPTH24_STENCIL8,validate:function(e){return e===vl.RGBA4||e===vl.RGBA8||e===vl.RGBA16F||e===vl.RGBA32F||e===vl.RGB5_A1||e===vl.RGB565||e===vl.DEPTH_COMPONENT16||e===vl.STENCIL_INDEX8||e===vl.DEPTH_STENCIL||e===vl.DEPTH24_STENCIL8},getColorFormat:function(e){return e===te.FLOAT?vl.RGBA32F:e===te.HALF_FLOAT_OES?vl.RGBA16F:vl.RGBA8}};Object.freeze(vl);var fu=vl;function aP(e){e=e??H.EMPTY_OBJECT;let t=e.context,n=t._gl,i=Ut.maximumRenderbufferSize,r=e.format??fu.RGBA4,o=l(e.width)?e.width:t.drawingBufferWidth,s=l(e.height)?e.height:t.drawingBufferHeight,a=e.numSamples??1;this._gl=n,this._format=r,this._width=o,this._height=s,this._renderbuffer=this._gl.createRenderbuffer(),n.bindRenderbuffer(n.RENDERBUFFER,this._renderbuffer),a>1?n.renderbufferStorageMultisample(n.RENDERBUFFER,a,r,o,s):n.renderbufferStorage(n.RENDERBUFFER,r,o,s),n.bindRenderbuffer(n.RENDERBUFFER,null)}Object.defineProperties(aP.prototype,{format:{get:function(){return this._format}},width:{get:function(){return this._width}},height:{get:function(){return this._height}}});aP.prototype._getRenderbuffer=function(){return this._renderbuffer};aP.prototype.isDestroyed=function(){return!1};aP.prototype.destroy=function(){return this._gl.deleteRenderbuffer(this._renderbuffer),le(this)};var rd=aP;function ca(e){e=e??H.EMPTY_OBJECT,this._numSamples=e.numSamples??1,this._colorAttachmentsLength=e.colorAttachmentsLength??1,this._color=e.color??!0,this._depth=e.depth??!1,this._depthStencil=e.depthStencil??!1,this._supportsDepthTexture=e.supportsDepthTexture??!1,this._createColorAttachments=e.createColorAttachments??!0,this._createDepthAttachments=e.createDepthAttachments??!0,this._pixelDatatype=e.pixelDatatype,this._pixelFormat=e.pixelFormat,this._width=void 0,this._height=void 0,this._framebuffer=void 0,this._multisampleFramebuffer=void 0,this._colorTextures=void 0,this._color&&(this._colorTextures=new Array(this._colorAttachmentsLength),this._colorRenderbuffers=new Array(this._colorAttachmentsLength)),this._colorRenderbuffer=void 0,this._depthStencilRenderbuffer=void 0,this._depthStencilTexture=void 0,this._depthRenderbuffer=void 0,this._depthTexture=void 0,this._attachmentsDirty=!1}Object.defineProperties(ca.prototype,{framebuffer:{get:function(){return this._numSamples>1?this._multisampleFramebuffer.getRenderFramebuffer():this._framebuffer}},numSamples:{get:function(){return this._numSamples}},status:{get:function(){return this.framebuffer.status}}});ca.prototype.isDirty=function(e,t,n,i,r){n=n??1;let o=this._width!==e||this._height!==t,s=this._numSamples!==n,a=l(i)&&this._pixelDatatype!==i||l(r)&&this._pixelFormat!==r,c=n===1?l(this._framebuffer):l(this._multisampleFramebuffer);return this._attachmentsDirty||o||s||a||!c||this._color&&!l(this._colorTextures[0])};ca.prototype.update=function(e,t,n,i,r,o){if(i=e.msaa?i??1:1,r=r??(this._color?this._pixelDatatype??ze.UNSIGNED_BYTE:void 0),o=o??(this._color?this._pixelFormat??$e.RGBA:void 0),this.isDirty(t,n,i,r,o)){if(this.destroy(),this._width=t,this._height=n,this._numSamples=i,this._pixelDatatype=r,this._pixelFormat=o,this._attachmentsDirty=!1,this._color&&this._createColorAttachments){for(let s=0;s<this._colorAttachmentsLength;++s)if(this._colorTextures[s]=new Dt({context:e,width:t,height:n,pixelFormat:o,pixelDatatype:r,sampler:Ht.NEAREST}),this._numSamples>1){let a=fu.getColorFormat(r);this._colorRenderbuffers[s]=new rd({context:e,width:t,height:n,format:a,numSamples:this._numSamples})}}this._depthStencil&&this._createDepthAttachments&&(this._supportsDepthTexture&&e.depthTexture?(this._depthStencilTexture=new Dt({context:e,width:t,height:n,pixelFormat:$e.DEPTH_STENCIL,pixelDatatype:ze.UNSIGNED_INT_24_8,sampler:Ht.NEAREST}),this._numSamples>1&&(this._depthStencilRenderbuffer=new rd({context:e,width:t,height:n,format:fu.DEPTH24_STENCIL8,numSamples:this._numSamples}))):this._depthStencilRenderbuffer=new rd({context:e,width:t,height:n,format:fu.DEPTH_STENCIL})),this._depth&&this._createDepthAttachments&&(this._supportsDepthTexture&&e.depthTexture?this._depthTexture=new Dt({context:e,width:t,height:n,pixelFormat:$e.DEPTH_COMPONENT,pixelDatatype:ze.UNSIGNED_INT,sampler:Ht.NEAREST}):this._depthRenderbuffer=new rd({context:e,width:t,height:n,format:fu.DEPTH_COMPONENT16})),this._numSamples>1?this._multisampleFramebuffer=new o2({context:e,width:this._width,height:this._height,colorTextures:this._colorTextures,colorRenderbuffers:this._colorRenderbuffers,depthStencilTexture:this._depthStencilTexture,depthStencilRenderbuffer:this._depthStencilRenderbuffer,destroyAttachments:!1}):this._framebuffer=new vs({context:e,colorTextures:this._colorTextures,depthTexture:this._depthTexture,depthRenderbuffer:this._depthRenderbuffer,depthStencilTexture:this._depthStencilTexture,depthStencilRenderbuffer:this._depthStencilRenderbuffer,destroyAttachments:!1})}};ca.prototype.getColorTexture=function(e){return e=e??0,this._colorTextures[e]};ca.prototype.setColorTexture=function(e,t){t=t??0,this._attachmentsDirty=e!==this._colorTextures[t],this._colorTextures[t]=e};ca.prototype.getColorRenderbuffer=function(e){return e=e??0,this._colorRenderbuffers[e]};ca.prototype.setColorRenderbuffer=function(e,t){t=t??0,this._attachmentsDirty=e!==this._colorRenderbuffers[t],this._colorRenderbuffers[t]=e};ca.prototype.getDepthRenderbuffer=function(){return this._depthRenderbuffer};ca.prototype.setDepthRenderbuffer=function(e){this._attachmentsDirty=e!==this._depthRenderbuffer,this._depthRenderbuffer=e};ca.prototype.getDepthTexture=function(){return this._depthTexture};ca.prototype.setDepthTexture=function(e){this._attachmentsDirty=e!==this._depthTexture,this._depthTexture=e};ca.prototype.getDepthStencilRenderbuffer=function(){return this._depthStencilRenderbuffer};ca.prototype.setDepthStencilRenderbuffer=function(e){this._attachmentsDirty=e!==this._depthStencilRenderbuffer,this._depthStencilRenderbuffer=e};ca.prototype.getDepthStencilTexture=function(){return this._depthStencilTexture};ca.prototype.setDepthStencilTexture=function(e){this._attachmentsDirty=e!==this._depthStencilTexture,this._depthStencilTexture=e};ca.prototype.prepareTextures=function(e,t){this._numSamples>1&&this._multisampleFramebuffer.blitFramebuffers(e,t)};ca.prototype.clear=function(e,t,n){let i=t.framebuffer;t.framebuffer=this.framebuffer,t.execute(e,n),t.framebuffer=i};ca.prototype.destroyFramebuffer=function(){this._framebuffer=this._framebuffer&&this._framebuffer.destroy(),this._multisampleFramebuffer=this._multisampleFramebuffer&&this._multisampleFramebuffer.destroy()};ca.prototype.destroy=function(){if(this._color){let e=this._colorTextures,t=this._colorRenderbuffers;for(let n=0;n<e.length;++n){let i=e[n];this._createColorAttachments&&l(i)&&!i.isDestroyed()&&i.destroy(),l(i)&&i.isDestroyed()&&(e[n]=void 0);let r=t[n];this._createColorAttachments&&l(r)&&!r.isDestroyed()&&r.destroy(),l(r)&&r.isDestroyed()&&(t[n]=void 0)}}this._depthStencil&&(this._createDepthAttachments&&(this._depthStencilTexture=this._depthStencilTexture&&this._depthStencilTexture.destroy(),this._depthStencilRenderbuffer=this._depthStencilRenderbuffer&&this._depthStencilRenderbuffer.destroy()),l(this._depthStencilTexture)&&this._depthStencilTexture.isDestroyed()&&(this._depthStencilTexture=void 0),l(this._depthStencilRenderbuffer)&&this._depthStencilRenderbuffer.isDestroyed()&&(this._depthStencilRenderbuffer=void 0)),this._depth&&(this._createDepthAttachments&&(this._depthTexture=this._depthTexture&&this._depthTexture.destroy(),this._depthRenderbuffer=this._depthRenderbuffer&&this._depthRenderbuffer.destroy()),l(this._depthTexture)&&this._depthTexture.isDestroyed()&&(this._depthTexture=void 0),l(this._depthRenderbuffer)&&this._depthRenderbuffer.isDestroyed()&&(this._depthRenderbuffer=void 0)),this.destroyFramebuffer()};var ci=ca;function Zje(e,t,n){let i={flipY:!0,skipColorSpaceConversion:n,preferImageBitmap:!0},r=[De.createIfNeeded(t.positiveX).fetchImage(i),De.createIfNeeded(t.negativeX).fetchImage(i),De.createIfNeeded(t.positiveY).fetchImage(i),De.createIfNeeded(t.negativeY).fetchImage(i),De.createIfNeeded(t.positiveZ).fetchImage(i),De.createIfNeeded(t.negativeZ).fetchImage(i)];return Promise.all(r).then(function(o){return new ls({context:e,source:{positiveX:o[0],negativeX:o[1],positiveY:o[2],negativeY:o[3],positiveZ:o[4],negativeZ:o[5]}})})}var s2=Zje;var L_={NONE:0,VERTEX:1,FRAGMENT:2,BOTH:3};L_.includesVertexShader=function(e){return(e&L_.VERTEX)!==0};L_.includesFragmentShader=function(e){return(e&L_.FRAGMENT)!==0};L_.union=function(...e){let t=0;for(let n=0;n<e.length;n++)t|=e[n];return t};L_.intersection=function(...e){let t=e[0];for(let n=1;n<e.length;n++)t&=e[n];return t};Object.freeze(L_);var de=L_;function pX(e){this.name=e,this.fields=[]}pX.prototype.addField=function(e,t){let n=` ${e} ${t};`;this.fields.push(n)};pX.prototype.generateGlslLines=function(){let e=this.fields;return e.length===0&&(e=[" float _empty;"]),[].concat(`struct ${this.name}`,"{",e,"};")};var a2=pX;function gX(e){this.signature=e,this.body=[]}gX.prototype.addLines=function(e){let t=this.body;if(Array.isArray(e)){let n=e.length;for(let i=0;i<n;i++)t.push(` ${e[i]}`)}else t.push(` ${e}`)};gX.prototype.generateGlslLines=function(){return[].concat(this.signature,"{",this.body,"}")};var c2=gX;function Qje(e,t){if(!l(t))return;let n=t.length;if(n===0)return;let i=e.length;e.length+=n;for(let r=0;r<n;r++)e[i+r]=t[r]}var Zn=Qje;function Sl(){this._positionAttributeLine=void 0,this._nextAttributeLocation=1,this._attributeLocations={},this._attributeLines=[],this._structs={},this._functions={},this._vertexShaderParts={defineLines:[],uniformLines:[],shaderLines:[],varyingLines:[],structIds:[],functionIds:[]},this._fragmentShaderParts={defineLines:[],uniformLines:[],shaderLines:[],varyingLines:[],structIds:[],functionIds:[]}}Object.defineProperties(Sl.prototype,{attributeLocations:{get:function(){return this._attributeLocations}}});Sl.prototype.addDefine=function(e,t,n){n=n??de.BOTH;let i=e;l(t)&&(i+=` ${t.toString()}`),de.includesVertexShader(n)&&this._vertexShaderParts.defineLines.push(i),de.includesFragmentShader(n)&&this._fragmentShaderParts.defineLines.push(i)};Sl.prototype.addStruct=function(e,t,n){this._structs[e]=new a2(t),de.includesVertexShader(n)&&this._vertexShaderParts.structIds.push(e),de.includesFragmentShader(n)&&this._fragmentShaderParts.structIds.push(e)};Sl.prototype.addStructField=function(e,t,n){this._structs[e].addField(t,n)};Sl.prototype.addFunction=function(e,t,n){this._functions[e]=new c2(t),de.includesVertexShader(n)&&this._vertexShaderParts.functionIds.push(e),de.includesFragmentShader(n)&&this._fragmentShaderParts.functionIds.push(e)};Sl.prototype.addFunctionLines=function(e,t){this._functions[e].addLines(t)};Sl.prototype.addUniform=function(e,t,n){n=n??de.BOTH;let i=`uniform ${e} ${t};`;de.includesVertexShader(n)&&this._vertexShaderParts.uniformLines.push(i),de.includesFragmentShader(n)&&this._fragmentShaderParts.uniformLines.push(i)};Sl.prototype.setPositionAttribute=function(e,t){return this._positionAttributeLine=`in ${e} ${t};`,this._attributeLocations[t]=0,0};Sl.prototype.addAttribute=function(e,t){let n=`in ${e} ${t};`;this._attributeLines.push(n);let i=this._nextAttributeLocation;return this._attributeLocations[t]=i,this._nextAttributeLocation+=t6e(e),i};Sl.prototype.addVarying=function(e,t,n){n=l(n)?`${n} `:"";let i=`${e} ${t};`;this._vertexShaderParts.varyingLines.push(`${n}out ${i}`),this._fragmentShaderParts.varyingLines.push(`${n}in ${i}`)};Sl.prototype.addVertexLines=function(e){let t=this._vertexShaderParts.shaderLines;Array.isArray(e)?Zn(t,e):t.push(e)};Sl.prototype.addFragmentLines=function(e){let t=this._fragmentShaderParts.shaderLines;Array.isArray(e)?Zn(t,e):t.push(e)};Sl.prototype.buildShaderProgram=function(e){let t=l(this._positionAttributeLine)?[this._positionAttributeLine]:[],n=e6e(this),i=n6e(this),r=t.concat(this._attributeLines,this._vertexShaderParts.uniformLines,this._vertexShaderParts.varyingLines,n.vertexLines,i.vertexLines,this._vertexShaderParts.shaderLines).join(` +${i}`};function t8e(e,t){let n=e.defines,i=n.length;for(let r=0;r<i;++r)if(n[r]===t)return!0;return!1}function Pue(e,t){let n=e.sources,i=n.length;for(let r=0;r<i;++r)if(n[r].indexOf(t)!==-1)return!0;return!1}function Due(e,t){let n=t.length;for(let i=0;i<n;++i){let r=t[i];if(Pue(e,r))return r}}var n8e=["v_normalEC","v_normal"];Sa.findNormalVarying=function(e){return Pue(e,"#ifdef HAS_NORMALS")?t8e(e,"HAS_NORMALS")?"v_normalEC":void 0:Due(e,n8e)};var i8e=["v_positionEC"];Sa.findPositionVarying=function(e){return Due(e,i8e)};var Xe=Sa;function bh(e){this._context=e,this._shaders={},this._numberOfShaders=0,this._shadersToRelease={}}Object.defineProperties(bh.prototype,{numberOfShaders:{get:function(){return this._numberOfShaders}}});bh.prototype.replaceShaderProgram=function(e){return l(e.shaderProgram)&&e.shaderProgram.destroy(),this.getShaderProgram(e)};function r8e(e){let t=Object.keys(e).sort();return JSON.stringify(e,t)}bh.prototype.getShaderProgram=function(e){let t=e.vertexShaderSource,n=e.fragmentShaderSource,i=e.attributeLocations;typeof t=="string"&&(t=new Xe({sources:[t]})),typeof n=="string"&&(n=new Xe({sources:[n]}));let r=t.getCacheKey(),o=n.getCacheKey(),s=l(i)?r8e(i):"",a=`${r}:${o}:${s}`,c;if(l(this._shaders[a]))c=this._shaders[a],delete this._shadersToRelease[a];else{let u=this._context,f=t.createCombinedVertexShader(u),d=n.createCombinedFragmentShader(u),p=new Qt({gl:u._gl,logShaderCompilation:u.logShaderCompilation,debugShaders:u.debugShaders,vertexShaderSource:t,vertexShaderText:f,fragmentShaderSource:n,fragmentShaderText:d,attributeLocations:i});c={cache:this,shaderProgram:p,keyword:a,derivedKeywords:[],count:0},p._cachedShader=c,this._shaders[a]=c,++this._numberOfShaders}return++c.count,c.shaderProgram};bh.prototype.replaceDerivedShaderProgram=function(e,t,n){let i=e._cachedShader,r=t+i.keyword,o=this._shaders[r];if(l(o)){lX(this,o);let s=i.derivedKeywords.indexOf(t);s>-1&&i.derivedKeywords.splice(s,1)}return this.createDerivedShaderProgram(e,t,n)};bh.prototype.getDerivedShaderProgram=function(e,t){let n=e._cachedShader,i=t+n.keyword,r=this._shaders[i];if(l(r))return r.shaderProgram};bh.prototype.createDerivedShaderProgram=function(e,t,n){let i=e._cachedShader,r=t+i.keyword,o=n.vertexShaderSource,s=n.fragmentShaderSource,a=n.attributeLocations;typeof o=="string"&&(o=new Xe({sources:[o]})),typeof s=="string"&&(s=new Xe({sources:[s]}));let c=this._context,u=o.createCombinedVertexShader(c),f=s.createCombinedFragmentShader(c),d=new Qt({gl:c._gl,logShaderCompilation:c.logShaderCompilation,debugShaders:c.debugShaders,vertexShaderSource:o,vertexShaderText:u,fragmentShaderSource:s,fragmentShaderText:f,attributeLocations:a}),p={cache:this,shaderProgram:d,keyword:r,derivedKeywords:[],count:0};return i.derivedKeywords.push(t),d._cachedShader=p,this._shaders[r]=p,d};function lX(e,t){let n=t.derivedKeywords,i=n.length;for(let r=0;r<i;++r){let o=n[r]+t.keyword,s=e._shaders[o];lX(e,s)}delete e._shaders[t.keyword],t.shaderProgram.finalDestroy()}bh.prototype.destroyReleasedShaderPrograms=function(){let e=this._shadersToRelease;for(let t in e)if(e.hasOwnProperty(t)){let n=e[t];lX(this,n),--this._numberOfShaders}this._shadersToRelease={}};bh.prototype.releaseShaderProgram=function(e){if(l(e)){let t=e._cachedShader;t&&--t.count===0&&(this._shadersToRelease[t.keyword]=t)}};bh.prototype.isDestroyed=function(){return!1};bh.prototype.destroy=function(){let e=this._shaders;for(let t in e)e.hasOwnProperty(t)&&e[t].shaderProgram.finalDestroy();return le(this)};var QB=bh;function ed(e){e=e??H.EMPTY_OBJECT;let{context:t,source:n,pixelFormat:i=$e.RGBA,pixelDatatype:r=ze.UNSIGNED_BYTE,flipY:o=!0,skipColorSpaceConversion:s=!1,sampler:a=new Ht}=e,{width:c,height:u}=e;l(n)&&(l(c)||(c=n.videoWidth??n.naturalWidth??n.width),l(u)||(u=n.videoHeight??n.naturalHeight??n.height));let f=e.preMultiplyAlpha||i===$e.RGB||i===$e.LUMINANCE,d=$e.toInternalFormat(i,r,t),p=$e.isCompressedFormat(d),g=t._gl,m=p?$e.compressedTextureSizeInBytes(i,c,u):$e.textureSizeInBytes(i,r,c,u);this._id=e.id??Kn(),this._context=t,this._textureFilterAnisotropic=t._textureFilterAnisotropic,this._textureTarget=g.TEXTURE_2D,this._texture=g.createTexture(),this._internalFormat=d,this._pixelFormat=i,this._pixelDatatype=r,this._width=c,this._height=u,this._dimensions=new U(c,u),this._hasMipmap=!1,this._sizeInBytes=m,this._preMultiplyAlpha=f,this._flipY=o,this._initialized=!1,this._sampler=void 0,this._sampler=a,Nue(this,a),g.activeTexture(g.TEXTURE0),g.bindTexture(this._textureTarget,this._texture),l(n)?(s?g.pixelStorei(g.UNPACK_COLORSPACE_CONVERSION_WEBGL,g.NONE):g.pixelStorei(g.UNPACK_COLORSPACE_CONVERSION_WEBGL,g.BROWSER_DEFAULT_WEBGL),l(n.arrayBufferView)?$e.isCompressedFormat(d)?o8e(this,n):Rue(this,n):l(n.framebuffer)?a8e(this,n):Oue(this,n),this._initialized=!0):Mue(this),g.bindTexture(this._textureTarget,null)}function o8e(e,t){let i=e._context._gl,r=e._textureTarget,o=e._internalFormat,{width:s,height:a}=e;if(i.pixelStorei(i.UNPACK_ALIGNMENT,4),i.pixelStorei(i.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!1),i.pixelStorei(i.UNPACK_FLIP_Y_WEBGL,!1),i.compressedTexImage2D(r,0,o,s,a,0,t.arrayBufferView),l(t.mipLevels)){let c=s,u=a;for(let f=0;f<t.mipLevels.length;++f)c=e2(c),u=e2(u),i.compressedTexImage2D(r,f+1,o,c,u,0,t.mipLevels[f])}}function Rue(e,t){let n=e._context,i=n._gl,r=e._textureTarget,o=e._internalFormat,{width:s,height:a,pixelFormat:c,pixelDatatype:u,flipY:f}=e,d=$e.alignmentInBytes(c,u,s);i.pixelStorei(i.UNPACK_ALIGNMENT,d),i.pixelStorei(i.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!1),i.pixelStorei(i.UNPACK_FLIP_Y_WEBGL,!1);let{arrayBufferView:p}=t;if(f&&(p=$e.flipY(p,c,u,s,a)),i.texImage2D(r,0,o,s,a,0,c,ze.toWebGLConstant(u,n),p),l(t.mipLevels)){let g=s,m=a;for(let y=0;y<t.mipLevels.length;++y)g=e2(g),m=e2(m),i.texImage2D(r,y+1,o,g,m,0,c,ze.toWebGLConstant(u,n),t.mipLevels[y])}}function s8e(e,t,n,i,r,o){let s=e._context,a=s._gl,{pixelFormat:c,pixelDatatype:u}=e,f=$e.alignmentInBytes(c,u,r);a.pixelStorei(a.UNPACK_ALIGNMENT,f),a.pixelStorei(a.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!1),a.pixelStorei(a.UNPACK_FLIP_Y_WEBGL,!1),e.flipY&&(t=$e.flipY(t,c,u,r,o)),a.texSubImage2D(e._textureTarget,0,n,i,r,o,c,ze.toWebGLConstant(u,s),t)}function a8e(e,t){let n=e._context,i=n._gl;i.pixelStorei(i.UNPACK_ALIGNMENT,4),i.pixelStorei(i.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!1),i.pixelStorei(i.UNPACK_FLIP_Y_WEBGL,!1),t.framebuffer!==n.defaultFramebuffer&&t.framebuffer._bind(),i.copyTexImage2D(e._textureTarget,0,e._internalFormat,t.xOffset,t.yOffset,e.width,e.height,0),t.framebuffer!==n.defaultFramebuffer&&t.framebuffer._unBind()}function Oue(e,t){let n=e._context,i=n._gl;i.pixelStorei(i.UNPACK_ALIGNMENT,4),i.pixelStorei(i.UNPACK_PREMULTIPLY_ALPHA_WEBGL,e.preMultiplyAlpha),i.pixelStorei(i.UNPACK_FLIP_Y_WEBGL,e.flipY),i.texImage2D(e._textureTarget,0,e._internalFormat,e.pixelFormat,ze.toWebGLConstant(e.pixelDatatype,n),t)}function c8e(e,t,n,i){let r=e._context,o=r._gl;o.pixelStorei(o.UNPACK_ALIGNMENT,4),o.pixelStorei(o.UNPACK_PREMULTIPLY_ALPHA_WEBGL,e.preMultiplyAlpha),o.pixelStorei(o.UNPACK_FLIP_Y_WEBGL,e.flipY),o.texSubImage2D(e._textureTarget,0,n,i,e.pixelFormat,ze.toWebGLConstant(e.pixelDatatype,r),t)}function e2(e){let t=Math.floor(e/2)|0;return Math.max(t,1)}function Mue(e){let t=e._context;t._gl.texImage2D(e._textureTarget,0,e._internalFormat,e._width,e._height,0,e._pixelFormat,ze.toWebGLConstant(e._pixelDatatype,t),null)}ed.create=function(e){return new ed(e)};ed.fromFramebuffer=function(e){e=e??H.EMPTY_OBJECT;let t=e.context,{pixelFormat:n=$e.RGB,framebufferXOffset:i=0,framebufferYOffset:r=0,width:o=t.drawingBufferWidth,height:s=t.drawingBufferHeight,framebuffer:a}=e;return new ed({context:t,width:o,height:s,pixelFormat:n,source:{framebuffer:l(a)?a:t.defaultFramebuffer,xOffset:i,yOffset:r,width:o,height:s}})};Object.defineProperties(ed.prototype,{id:{get:function(){return this._id}},sampler:{get:function(){return this._sampler},set:function(e){Nue(this,e),this._sampler=e}},pixelFormat:{get:function(){return this._pixelFormat}},pixelDatatype:{get:function(){return this._pixelDatatype}},dimensions:{get:function(){return this._dimensions}},preMultiplyAlpha:{get:function(){return this._preMultiplyAlpha}},flipY:{get:function(){return this._flipY}},width:{get:function(){return this._width}},height:{get:function(){return this._height}},sizeInBytes:{get:function(){return this._hasMipmap?Math.floor(this._sizeInBytes*4/3):this._sizeInBytes}},_target:{get:function(){return this._textureTarget}}});function Nue(e,t){let{minificationFilter:n,magnificationFilter:i}=t,r=[Wt.NEAREST_MIPMAP_NEAREST,Wt.NEAREST_MIPMAP_LINEAR,Wt.LINEAR_MIPMAP_NEAREST,Wt.LINEAR_MIPMAP_LINEAR].includes(n),o=e._context,s=e._pixelFormat,a=e._pixelDatatype;(a===ze.FLOAT&&!o.textureFloatLinear||a===ze.HALF_FLOAT&&!o.textureHalfFloatLinear)&&(n=r?Wt.NEAREST_MIPMAP_NEAREST:Wt.NEAREST,i=Jn.NEAREST),o.webgl2&&$e.isDepthFormat(s)&&(n=Wt.NEAREST,i=Jn.NEAREST);let c=o._gl,u=e._textureTarget;c.activeTexture(c.TEXTURE0),c.bindTexture(u,e._texture),c.texParameteri(u,c.TEXTURE_MIN_FILTER,n),c.texParameteri(u,c.TEXTURE_MAG_FILTER,i),c.texParameteri(u,c.TEXTURE_WRAP_S,t.wrapS),c.texParameteri(u,c.TEXTURE_WRAP_T,t.wrapT),l(e._textureFilterAnisotropic)&&c.texParameteri(u,e._textureFilterAnisotropic.TEXTURE_MAX_ANISOTROPY_EXT,t.maximumAnisotropy),c.bindTexture(u,null)}ed.prototype.copyFrom=function(e){let{xOffset:t=0,yOffset:n=0,source:i,skipColorSpaceConversion:r=!1}=e,s=this._context._gl,a=this._textureTarget;s.activeTexture(s.TEXTURE0),s.bindTexture(a,this._texture);let{width:c,height:u}=i;l(i.videoWidth)&&l(i.videoHeight)?(c=i.videoWidth,u=i.videoHeight):l(i.naturalWidth)&&l(i.naturalHeight)&&(c=i.naturalWidth,u=i.naturalHeight),r?s.pixelStorei(s.UNPACK_COLORSPACE_CONVERSION_WEBGL,s.NONE):s.pixelStorei(s.UNPACK_COLORSPACE_CONVERSION_WEBGL,s.BROWSER_DEFAULT_WEBGL);let f=!1;this._initialized||(t===0&&n===0&&c===this._width&&u===this._height?(l(i.arrayBufferView)?Rue(this,i):Oue(this,i),f=!0):(s.pixelStorei(s.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!1),s.pixelStorei(s.UNPACK_FLIP_Y_WEBGL,!1),Mue(this)),this._initialized=!0),f||(l(i.arrayBufferView)?s8e(this,i.arrayBufferView,t,n,c,u):c8e(this,i,t,n)),s.bindTexture(a,null)};ed.prototype.copyFromFramebuffer=function(e,t,n,i,r,o){e=e??0,t=t??0,n=n??0,i=i??0,r=r??this._width,o=o??this._height;let s=this._context._gl,a=this._textureTarget;s.activeTexture(s.TEXTURE0),s.bindTexture(a,this._texture),s.copyTexSubImage2D(a,0,e,t,n,i,r,o),s.bindTexture(a,null),this._initialized=!0};ed.prototype.generateMipmap=function(e){e=e??yh.DONT_CARE,this._hasMipmap=!0;let t=this._context._gl,n=this._textureTarget;t.hint(t.GENERATE_MIPMAP_HINT,e),t.activeTexture(t.TEXTURE0),t.bindTexture(n,this._texture),t.generateMipmap(n),t.bindTexture(n,null)};ed.prototype.isDestroyed=function(){return!1};ed.prototype.destroy=function(){return this._context._gl.deleteTexture(this._texture),le(this)};ed.defaultColor=z.WHITE;var Dt=ed;function Ib(){this._textures={},this._numberOfTextures=0,this._texturesToRelease={}}Object.defineProperties(Ib.prototype,{numberOfTextures:{get:function(){return this._numberOfTextures}}});Ib.prototype.getTexture=function(e){let t=this._textures[e];if(l(t))return delete this._texturesToRelease[e],++t.count,t.texture};Ib.prototype.addTexture=function(e,t){let n={texture:t,count:1};t.finalDestroy=t.destroy;let i=this;t.destroy=function(){--n.count===0&&(i._texturesToRelease[e]=n)},this._textures[e]=n,++this._numberOfTextures};Ib.prototype.destroyReleasedTextures=function(){let e=this._texturesToRelease;for(let t in e)if(e.hasOwnProperty(t)){let n=e[t];delete this._textures[t],n.texture.finalDestroy(),--this._numberOfTextures}this._texturesToRelease={}};Ib.prototype.isDestroyed=function(){return!1};Ib.prototype.destroy=function(){let e=this._textures;for(let t in e)e.hasOwnProperty(t)&&e[t].texture.finalDestroy();return le(this)};var t2=Ib;function td(e){this.planes=e??[]}var rP=[new h,new h,new h];h.clone(h.UNIT_X,rP[0]);h.clone(h.UNIT_Y,rP[1]);h.clone(h.UNIT_Z,rP[2]);var O_=new h,l8e=new h,Lue=new sn(new h(1,0,0),0);function Fue(e,t){let n=t.normal;return n.x=e.x,n.y=e.y,n.z=e.z,t.distance=e.w,t}td.fromBoundingSphere=function(e,t){l(t)||(t=new td);let n=rP.length,i=t.planes;i.length=2*n;let r=e.center,o=e.radius,s=0;for(let a=0;a<n;++a){let c=rP[a],u=i[s],f=i[s+1];l(u)||(u=i[s]=new se),l(f)||(f=i[s+1]=new se),h.multiplyByScalar(c,-o,O_),h.add(r,O_,O_),u.x=c.x,u.y=c.y,u.z=c.z,u.w=-h.dot(c,O_),h.multiplyByScalar(c,o,O_),h.add(r,O_,O_),f.x=-c.x,f.y=-c.y,f.z=-c.z,f.w=-h.dot(h.negate(c,l8e),O_),s+=2}return t};td.prototype.computeVisibility=function(e){let t=this.planes,n=!1;for(let i=0,r=t.length;i<r;++i){let o=e.intersectPlane(Fue(t[i],Lue));if(o===$t.OUTSIDE)return $t.OUTSIDE;o===$t.INTERSECTING&&(n=!0)}return n?$t.INTERSECTING:$t.INSIDE};td.prototype.computeVisibilityWithPlaneMask=function(e,t){if(t===td.MASK_OUTSIDE||t===td.MASK_INSIDE)return t;let n=td.MASK_INSIDE,i=this.planes;for(let r=0,o=i.length;r<o;++r){let s=r<31?1<<r:0;if(r<31&&(t&s)===0)continue;let a=e.intersectPlane(Fue(i[r],Lue));if(a===$t.OUTSIDE)return td.MASK_OUTSIDE;a===$t.INTERSECTING&&(n|=s)}return n};td.MASK_OUTSIDE=4294967295;td.MASK_INSIDE=0;td.MASK_INDETERMINATE=2147483647;var aa=td;function Ym(e){e=e??H.EMPTY_OBJECT,this.left=e.left,this._left=void 0,this.right=e.right,this._right=void 0,this.top=e.top,this._top=void 0,this.bottom=e.bottom,this._bottom=void 0,this.near=e.near??1,this._near=this.near,this.far=e.far??5e8,this._far=this.far,this._cullingVolume=new aa,this._orthographicMatrix=new M}function Bue(e){(e.top!==e._top||e.bottom!==e._bottom||e.left!==e._left||e.right!==e._right||e.near!==e._near||e.far!==e._far)&&(e._left=e.left,e._right=e.right,e._top=e.top,e._bottom=e.bottom,e._near=e.near,e._far=e.far,e._orthographicMatrix=M.computeOrthographicOffCenter(e.left,e.right,e.bottom,e.top,e.near,e.far,e._orthographicMatrix))}Object.defineProperties(Ym.prototype,{projectionMatrix:{get:function(){return Bue(this),this._orthographicMatrix}}});var u8e=new h,f8e=new h,d8e=new h,uX=new h;Ym.prototype.computeCullingVolume=function(e,t,n){let i=this._cullingVolume.planes,r=this.top,o=this.bottom,s=this.right,a=this.left,c=this.near,u=this.far,f=h.cross(t,n,u8e);h.normalize(f,f);let d=f8e;h.multiplyByScalar(t,c,d),h.add(e,d,d);let p=d8e;h.multiplyByScalar(f,a,p),h.add(d,p,p);let g=i[0];return l(g)||(g=i[0]=new se),g.x=f.x,g.y=f.y,g.z=f.z,g.w=-h.dot(f,p),h.multiplyByScalar(f,s,p),h.add(d,p,p),g=i[1],l(g)||(g=i[1]=new se),g.x=-f.x,g.y=-f.y,g.z=-f.z,g.w=-h.dot(h.negate(f,uX),p),h.multiplyByScalar(n,o,p),h.add(d,p,p),g=i[2],l(g)||(g=i[2]=new se),g.x=n.x,g.y=n.y,g.z=n.z,g.w=-h.dot(n,p),h.multiplyByScalar(n,r,p),h.add(d,p,p),g=i[3],l(g)||(g=i[3]=new se),g.x=-n.x,g.y=-n.y,g.z=-n.z,g.w=-h.dot(h.negate(n,uX),p),g=i[4],l(g)||(g=i[4]=new se),g.x=t.x,g.y=t.y,g.z=t.z,g.w=-h.dot(t,d),h.multiplyByScalar(t,u,p),h.add(e,p,p),g=i[5],l(g)||(g=i[5]=new se),g.x=-t.x,g.y=-t.y,g.z=-t.z,g.w=-h.dot(h.negate(t,uX),p),this._cullingVolume};Ym.prototype.getPixelDimensions=function(e,t,n,i,r){Bue(this);let o=this.right-this.left,s=this.top-this.bottom,a=i*o/e,c=i*s/t;return r.x=a,r.y=c,r};Ym.prototype.clone=function(e){return l(e)||(e=new Ym),e.left=this.left,e.right=this.right,e.top=this.top,e.bottom=this.bottom,e.near=this.near,e.far=this.far,e._left=void 0,e._right=void 0,e._top=void 0,e._bottom=void 0,e._near=void 0,e._far=void 0,e};Ym.prototype.equals=function(e){return l(e)&&e instanceof Ym&&this.right===e.right&&this.left===e.left&&this.top===e.top&&this.bottom===e.bottom&&this.near===e.near&&this.far===e.far};Ym.prototype.equalsEpsilon=function(e,t,n){return e===this||l(e)&&e instanceof Ym&&P.equalsEpsilon(this.right,e.right,t,n)&&P.equalsEpsilon(this.left,e.left,t,n)&&P.equalsEpsilon(this.top,e.top,t,n)&&P.equalsEpsilon(this.bottom,e.bottom,t,n)&&P.equalsEpsilon(this.near,e.near,t,n)&&P.equalsEpsilon(this.far,e.far,t,n)};var Ss=Ym;function lu(e){e=e??H.EMPTY_OBJECT,this._offCenterFrustum=new Ss,this.width=e.width,this._width=void 0,this.aspectRatio=e.aspectRatio,this._aspectRatio=void 0,this.near=e.near??1,this._near=this.near,this.far=e.far??5e8,this._far=this.far}lu.packedLength=4;lu.pack=function(e,t,n){return n=n??0,t[n++]=e.width,t[n++]=e.aspectRatio,t[n++]=e.near,t[n]=e.far,t};lu.unpack=function(e,t,n){return t=t??0,l(n)||(n=new lu),n.width=e[t++],n.aspectRatio=e[t++],n.near=e[t++],n.far=e[t],n};function M_(e){let t=e._offCenterFrustum;if(e.width!==e._width||e.aspectRatio!==e._aspectRatio||e.near!==e._near||e.far!==e._far){e._aspectRatio=e.aspectRatio,e._width=e.width,e._near=e.near,e._far=e.far;let n=1/e.aspectRatio;t.right=e.width*.5,t.left=-t.right,t.top=n*t.right,t.bottom=-t.top,t.near=e.near,t.far=e.far}}Object.defineProperties(lu.prototype,{projectionMatrix:{get:function(){return M_(this),this._offCenterFrustum.projectionMatrix}},offCenterFrustum:{get:function(){return M_(this),this._offCenterFrustum}}});lu.prototype.computeCullingVolume=function(e,t,n){return M_(this),this._offCenterFrustum.computeCullingVolume(e,t,n)};lu.prototype.getPixelDimensions=function(e,t,n,i,r){return M_(this),this._offCenterFrustum.getPixelDimensions(e,t,n,i,r)};lu.prototype.clone=function(e){return l(e)||(e=new lu),e.aspectRatio=this.aspectRatio,e.width=this.width,e.near=this.near,e.far=this.far,e._aspectRatio=void 0,e._width=void 0,e._near=void 0,e._far=void 0,this._offCenterFrustum.clone(e._offCenterFrustum),e};lu.prototype.equals=function(e){return!l(e)||!(e instanceof lu)?!1:(M_(this),M_(e),this.width===e.width&&this.aspectRatio===e.aspectRatio&&this._offCenterFrustum.equals(e._offCenterFrustum))};lu.prototype.equalsEpsilon=function(e,t,n){return!l(e)||!(e instanceof lu)?!1:(M_(this),M_(e),P.equalsEpsilon(this.width,e.width,t,n)&&P.equalsEpsilon(this.aspectRatio,e.aspectRatio,t,n)&&this._offCenterFrustum.equalsEpsilon(e._offCenterFrustum,t,n))};var _n=lu;var fX={};function h8e(e){let t=6.239996+.0172019696544*e;return .001657*Math.sin(t+.01671*Math.sin(t))}var m8e=32.184,p8e=2451545;function nfe(e,t){t=K.addSeconds(e,m8e,t);let n=K.totalDays(t)-p8e;return t=K.addSeconds(t,h8e(n),t),t}var n2=new K(2451545,0,ai.TAI),g8e=1e3,nd=P.RADIANS_PER_DEGREE,of=P.RADIANS_PER_ARCSECOND,_c=14959787e4,kue=new $;function ife(e,t,n,i,r,o,s){n<0&&(n=-n,r+=P.PI);let a=e*(1-t),c=i-r,u=r,f=y8e(o-i,t),d=_8e(t,0);E8e(c,n,u,kue);let p=a*(1+t),g=Math.cos(f),m=Math.sin(f),y=1+t*g,A=p/y;return l(s)?(s.x=A*g,s.y=A*m,s.z=0):s=new h(A*g,A*m,0),$.multiplyByVector(kue,s,s)}function _8e(e,t){return e<=t?"Circular":e<1-t?"Elliptical":e<=1+t?"Parabolic":"Hyperbolic"}function y8e(e,t){let n=x8e(e,t);return T8e(n,t)}var A8e=50,b8e=P.EPSILON8;function x8e(e,t){let n=Math.floor(e/P.TWO_PI);e-=n*P.TWO_PI;let i=e+t*Math.sin(e)/(1-Math.sin(e+t)+Math.sin(e)),r=Number.MAX_VALUE,o;for(o=0;o<A8e&&Math.abs(r-i)>b8e;++o){r=i;let s=r-t*Math.sin(r)-e,a=1-t*Math.cos(r);i=r-s/a}return r=i+n*P.TWO_PI,r}function T8e(e,t){let n=Math.floor(e/P.TWO_PI);e-=n*P.TWO_PI;let i=Math.cos(e)-t,r=Math.sin(e)*Math.sqrt(1-t*t),o=Math.atan2(r,i);return o=P.zeroToTwoPi(o),e<0&&(o-=P.TWO_PI),o+=n*P.TWO_PI,o}function E8e(e,t,n,i){let r=Math.cos(e),o=Math.sin(e),s=Math.cos(t),a=Math.sin(t),c=Math.cos(n),u=Math.sin(n);return l(i)?(i[0]=c*r-u*o*s,i[1]=u*r+c*o*s,i[2]=o*a,i[3]=-c*o-u*r*s,i[4]=-u*o+c*r*s,i[5]=r*a,i[6]=u*a,i[7]=-c*a,i[8]=s):i=new $(c*r-u*o*s,-c*o-u*r*s,u*a,u*r+c*o*s,-u*o+c*r*s,-c*a,o*a,r*a,s),i}var C8e=1.0000010178*_c,v8e=100.46645683*nd,S8e=129597742283429e-5*of,Uue=16002,zue=21863,Vue=32004,jue=10931,Hue=14529,Gue=16368,Wue=15318,que=32794,w8e=64*1e-7*_c,I8e=-152*1e-7*_c,P8e=62*1e-7*_c,D8e=-8*1e-7*_c,R8e=32*1e-7*_c,O8e=-41*1e-7*_c,M8e=19*1e-7*_c,N8e=-11*1e-7*_c,L8e=-150*1e-7*_c,F8e=-46*1e-7*_c,B8e=68*1e-7*_c,k8e=54*1e-7*_c,U8e=14*1e-7*_c,z8e=24*1e-7*_c,V8e=-28*1e-7*_c,j8e=22*1e-7*_c,Yue=10,Xue=16002,Kue=21863,$ue=10931,Jue=1473,Zue=32004,Que=4387,efe=73,H8e=-325*1e-7,G8e=-322*1e-7,W8e=-79*1e-7,q8e=232*1e-7,Y8e=-52*1e-7,X8e=97*1e-7,K8e=55*1e-7,$8e=-41*1e-7,J8e=-105*1e-7,Z8e=-137*1e-7,Q8e=258*1e-7,eje=35*1e-7,tje=-116*1e-7,nje=-88*1e-7,ije=-112*1e-7,rje=-80*1e-7,GE=new K(0,0,ai.TAI);function oje(e,t){nfe(e,GE);let i=(GE.dayNumber-n2.dayNumber+(GE.secondsOfDay-n2.secondsOfDay)/Un.SECONDS_PER_DAY)/(Un.DAYS_PER_JULIAN_CENTURY*10),r=.3595362*i,o=C8e+w8e*Math.cos(Uue*r)+L8e*Math.sin(Uue*r)+I8e*Math.cos(zue*r)+F8e*Math.sin(zue*r)+P8e*Math.cos(Vue*r)+B8e*Math.sin(Vue*r)+D8e*Math.cos(jue*r)+k8e*Math.sin(jue*r)+R8e*Math.cos(Hue*r)+U8e*Math.sin(Hue*r)+O8e*Math.cos(Gue*r)+z8e*Math.sin(Gue*r)+M8e*Math.cos(Wue*r)+V8e*Math.sin(Wue*r)+N8e*Math.cos(que*r)+j8e*Math.sin(que*r),s=v8e+S8e*i+H8e*Math.cos(Yue*r)+J8e*Math.sin(Yue*r)+G8e*Math.cos(Xue*r)+Z8e*Math.sin(Xue*r)+W8e*Math.cos(Kue*r)+Q8e*Math.sin(Kue*r)+q8e*Math.cos($ue*r)+eje*Math.sin($ue*r)+Y8e*Math.cos(Jue*r)+tje*Math.sin(Jue*r)+X8e*Math.cos(Zue*r)+nje*Math.sin(Zue*r)+K8e*Math.cos(Que*r)+ije*Math.sin(Que*r)+$8e*Math.cos(efe*r)+rje*Math.sin(efe*r),a=.0167086342-.0004203654*i,c=102.93734808*nd+11612.3529*of*i,u=469.97289*of*i,f=174.87317577*nd-8679.27034*of*i;return ife(o,a,u,c,f,s,t)}function rfe(e,t){nfe(e,GE);let i=(GE.dayNumber-n2.dayNumber+(GE.secondsOfDay-n2.secondsOfDay)/Un.SECONDS_PER_DAY)/Un.DAYS_PER_JULIAN_CENTURY,r=i*i,o=r*i,s=o*i,a=383397.7725+.004*i,c=.055545526-16e-9*i,u=5.15668983*nd,f=-8e-5*i+.02966*r-42e-6*o-13e-8*s,d=83.35324312*nd,p=146434202669e-4*i-38.2702*r-.045047*o+21301e-8*s,g=125.04455501*nd,m=-69679193631e-4*i+6.3602*r+.007625*o-3586e-8*s,y=218.31664563*nd,A=17325593434847e-4*i-6.391*r+.006588*o-3169e-8*s,b=297.85019547*nd+of*(1602961601209e-3*i-6.3706*r+.006593*o-3169e-8*s),x=93.27209062*nd+of*(17395272628478e-4*i-12.7512*r-.001037*o+417e-8*s),T=134.96340251*nd+of*(17179159232178e-4*i+31.8792*r+.051635*o-2447e-7*s),E=357.52910918*nd+of*(1295965810481e-4*i-.5532*r+136e-6*o-1149e-8*s),v=310.17137918*nd-of*(6967051436e-3*i+6.2068*r+.007618*o-3219e-8*s),S=2*b,I=4*b,R=6*b,O=2*T,L=3*T,_=4*T,C=2*x;a+=3400.4*Math.cos(S)-635.6*Math.cos(S-T)-235.6*Math.cos(T)+218.1*Math.cos(S-E)+181*Math.cos(S+T),c+=.014216*Math.cos(S-T)+.008551*Math.cos(S-O)-.001383*Math.cos(T)+.001356*Math.cos(S+T)-.001147*Math.cos(I-L)-914e-6*Math.cos(I-O)+869e-6*Math.cos(S-E-T)-627e-6*Math.cos(S)-394e-6*Math.cos(I-_)+282e-6*Math.cos(S-E-O)-279e-6*Math.cos(b-T)-236e-6*Math.cos(O)+231e-6*Math.cos(I)+229e-6*Math.cos(R-_)-201e-6*Math.cos(O-C),f+=486.26*Math.cos(S-C)-40.13*Math.cos(S)+37.51*Math.cos(C)+25.73*Math.cos(O-C)+19.97*Math.cos(S-E-C),p+=-55609*Math.sin(S-T)-34711*Math.sin(S-O)-9792*Math.sin(T)+9385*Math.sin(I-L)+7505*Math.sin(I-O)+5318*Math.sin(S+T)+3484*Math.sin(I-_)-3417*Math.sin(S-E-T)-2530*Math.sin(R-_)-2376*Math.sin(S)-2075*Math.sin(S-L)-1883*Math.sin(O)-1736*Math.sin(R-5*T)+1626*Math.sin(E)-1370*Math.sin(R-L),m+=-5392*Math.sin(S-C)-540*Math.sin(E)-441*Math.sin(S)+423*Math.sin(C)-288*Math.sin(O-C),A+=-3332.9*Math.sin(S)+1197.4*Math.sin(S-T)-662.5*Math.sin(E)+396.3*Math.sin(T)-218*Math.sin(S-E);let w=2*v,D=3*v;f+=46.997*Math.cos(v)*i-.614*Math.cos(S-C+v)*i+.614*Math.cos(S-C-v)*i-.0297*Math.cos(w)*r-.0335*Math.cos(v)*r+.0012*Math.cos(S-C+w)*r-16e-5*Math.cos(v)*o+4e-5*Math.cos(D)*o+4e-5*Math.cos(w)*o;let N=2.116*Math.sin(v)*i-.111*Math.sin(S-C-v)*i-.0015*Math.sin(v)*r;p+=N,A+=N,m+=-520.77*Math.sin(v)*i+13.66*Math.sin(S-C+v)*i+1.12*Math.sin(S-v)*i-1.06*Math.sin(C-v)*i+.66*Math.sin(w)*r+.371*Math.sin(v)*r-.035*Math.sin(S-C+w)*r-.015*Math.sin(S-C+v)*r+.0014*Math.sin(v)*o-.0011*Math.sin(D)*o-9e-4*Math.sin(w)*o,a*=g8e;let F=u+f*of,V=d+p*of,B=y+A*of,j=g+m*of;return ife(a,c,F,V,j,B,t)}var tfe=.012300034,sje=tfe/(tfe+1)*-1;function aje(e,t){return t=rfe(e,t),h.multiplyByScalar(t,sje,t)}var ofe=new $(1.0000000000000002,5619723173785822e-31,4690511510146299e-34,-5154129427414611e-31,.9174820620691819,-.39777715593191376,-223970096136568e-30,.39777715593191376,.9174820620691819),oP=new h;fX.computeSunPositionInEarthInertialFrame=function(e,t){return l(e)||(e=K.now()),l(t)||(t=new h),oP=oje(e,oP),t=h.negate(oP,t),aje(e,oP),h.subtract(t,oP,t),$.multiplyByVector(ofe,t,t),t};fX.computeMoonPositionInEarthInertialFrame=function(e,t){return l(e)||(e=K.now()),t=rfe(e,t),$.multiplyByVector(ofe,t,t),t};var Pb=fX;var sP={MORPHING:0,COLUMBUS_VIEW:1,SCENE2D:2,SCENE3D:3};sP.getMorphTime=function(e){return e===sP.SCENE3D?1:e===sP.MORPHING?void 0:0};Object.freeze(sP);var re=sP;function cje(e){e=e??H.EMPTY_OBJECT,this.color=z.clone(e.color??z.WHITE),this.intensity=e.intensity??2}var N_=cje;function WE(){this.globeDepthTexture=void 0,this.edgeIdTexture=void 0,this.edgeColorTexture=void 0,this.edgeDepthTexture=void 0,this.planarFillIdTexture=void 0,this.gamma=void 0,this._viewport=new et,this._viewportCartesian4=new se,this._viewportDirty=!1,this._viewportOrthographicMatrix=M.clone(M.IDENTITY),this._viewportTransformation=M.clone(M.IDENTITY),this._model=M.clone(M.IDENTITY),this._view=M.clone(M.IDENTITY),this._inverseView=M.clone(M.IDENTITY),this._projection=M.clone(M.IDENTITY),this._infiniteProjection=M.clone(M.IDENTITY),this._entireFrustum=new U,this._currentFrustum=new U,this._frustumPlanes=new se,this._farDepthFromNearPlusOne=void 0,this._log2FarDepthFromNearPlusOne=void 0,this._oneOverLog2FarDepthFromNearPlusOne=void 0,this._frameState=void 0,this._temeToPseudoFixed=$.clone(M.IDENTITY),this._view3DDirty=!0,this._view3D=new M,this._inverseView3DDirty=!0,this._inverseView3D=new M,this._inverseModelDirty=!0,this._inverseModel=new M,this._inverseTransposeModelDirty=!0,this._inverseTransposeModel=new $,this._viewRotation=new $,this._inverseViewRotation=new $,this._viewRotation3D=new $,this._inverseViewRotation3D=new $,this._inverseProjectionDirty=!0,this._inverseProjection=new M,this._modelViewDirty=!0,this._modelView=new M,this._modelView3DDirty=!0,this._modelView3D=new M,this._modelViewRelativeToEyeDirty=!0,this._modelViewRelativeToEye=new M,this._inverseModelViewDirty=!0,this._inverseModelView=new M,this._inverseModelView3DDirty=!0,this._inverseModelView3D=new M,this._viewProjectionDirty=!0,this._viewProjection=new M,this._inverseViewProjectionDirty=!0,this._inverseViewProjection=new M,this._modelViewProjectionDirty=!0,this._modelViewProjection=new M,this._inverseModelViewProjectionDirty=!0,this._inverseModelViewProjection=new M,this._modelViewProjectionRelativeToEyeDirty=!0,this._modelViewProjectionRelativeToEye=new M,this._modelViewInfiniteProjectionDirty=!0,this._modelViewInfiniteProjection=new M,this._normalDirty=!0,this._normal=new $,this._normal3DDirty=!0,this._normal3D=new $,this._inverseNormalDirty=!0,this._inverseNormal=new $,this._inverseNormal3DDirty=!0,this._inverseNormal3D=new $,this._encodedCameraPositionMCDirty=!0,this._encodedCameraPositionMC=new Sn,this._cameraPosition=new h,this._sunPositionWC=new h,this._sunPositionColumbusView=new h,this._sunDirectionWC=new h,this._sunDirectionEC=new h,this._moonDirectionEC=new h,this._lightDirectionWC=new h,this._lightDirectionEC=new h,this._lightColor=new h,this._lightColorHdr=new h,this._pass=void 0,this._mode=void 0,this._mapProjection=void 0,this._ellipsoid=void 0,this._cameraDirection=new h,this._cameraRight=new h,this._cameraUp=new h,this._frustum2DWidth=0,this._eyeHeight=0,this._eyeHeight2D=new U,this._eyeCartographic=new h,this._eyeEllipsoidNormalEC=new h,this._eyeEllipsoidCurvature=new U,this._eyeToEnu=new $,this._modelToEnu=new M,this._enuToModel=new M,this._pixelRatio=1,this._orthographicIn3D=!1,this._backgroundColor=new z,this._brdfLut=void 0,this._environmentMap=void 0,this._sphericalHarmonicCoefficients=void 0,this._specularEnvironmentMaps=void 0,this._specularEnvironmentMapsMaximumLOD=void 0,this._fogDensity=void 0,this._fogVisualDensityScalar=void 0,this._fogMinimumBrightness=void 0,this._atmosphereHsbShift=void 0,this._atmosphereLightIntensity=void 0,this._atmosphereRayleighCoefficient=new h,this._atmosphereRayleighScaleHeight=new h,this._atmosphereMieCoefficient=new h,this._atmosphereMieScaleHeight=void 0,this._atmosphereMieAnisotropy=void 0,this._atmosphereDynamicLighting=void 0,this._invertClassificationColor=void 0,this._splitPosition=0,this._pixelSizePerMeter=void 0,this._geometricToleranceOverMeter=void 0,this._minimumDisableDepthTestDistance=void 0}Object.defineProperties(WE.prototype,{frameState:{get:function(){return this._frameState}},viewport:{get:function(){return this._viewport},set:function(e){if(!et.equals(e,this._viewport)){et.clone(e,this._viewport);let t=this._viewport,n=this._viewportCartesian4;n.x=t.x,n.y=t.y,n.z=t.width,n.w=t.height,this._viewportDirty=!0}}},viewportCartesian4:{get:function(){return this._viewportCartesian4}},viewportOrthographic:{get:function(){return cfe(this),this._viewportOrthographicMatrix}},viewportTransformation:{get:function(){return cfe(this),this._viewportTransformation}},model:{get:function(){return this._model},set:function(e){M.clone(e,this._model),this._modelView3DDirty=!0,this._inverseModelView3DDirty=!0,this._inverseModelDirty=!0,this._inverseTransposeModelDirty=!0,this._modelViewDirty=!0,this._inverseModelViewDirty=!0,this._modelViewRelativeToEyeDirty=!0,this._inverseModelViewDirty=!0,this._modelViewProjectionDirty=!0,this._inverseModelViewProjectionDirty=!0,this._modelViewProjectionRelativeToEyeDirty=!0,this._modelViewInfiniteProjectionDirty=!0,this._normalDirty=!0,this._inverseNormalDirty=!0,this._normal3DDirty=!0,this._inverseNormal3DDirty=!0,this._encodedCameraPositionMCDirty=!0}},inverseModel:{get:function(){return this._inverseModelDirty&&(this._inverseModelDirty=!1,M.inverse(this._model,this._inverseModel)),this._inverseModel}},inverseTransposeModel:{get:function(){let e=this._inverseTransposeModel;return this._inverseTransposeModelDirty&&(this._inverseTransposeModelDirty=!1,M.getMatrix3(this.inverseModel,e),$.transpose(e,e)),e}},view:{get:function(){return this._view}},view3D:{get:function(){return hX(this),this._view3D}},viewRotation:{get:function(){return hX(this),this._viewRotation}},viewRotation3D:{get:function(){return hX(this),this._viewRotation3D}},inverseView:{get:function(){return this._inverseView}},inverseView3D:{get:function(){return ffe(this),this._inverseView3D}},inverseViewRotation:{get:function(){return this._inverseViewRotation}},inverseViewRotation3D:{get:function(){return ffe(this),this._inverseViewRotation3D}},projection:{get:function(){return this._projection}},inverseProjection:{get:function(){return Aje(this),this._inverseProjection}},infiniteProjection:{get:function(){return this._infiniteProjection}},modelView:{get:function(){return bje(this),this._modelView}},modelView3D:{get:function(){return xje(this),this._modelView3D}},modelViewRelativeToEye:{get:function(){return wje(this),this._modelViewRelativeToEye}},inverseModelView:{get:function(){return Tje(this),this._inverseModelView}},inverseModelView3D:{get:function(){return Eje(this),this._inverseModelView3D}},viewProjection:{get:function(){return Cje(this),this._viewProjection}},inverseViewProjection:{get:function(){return vje(this),this._inverseViewProjection}},modelViewProjection:{get:function(){return Sje(this),this._modelViewProjection}},inverseModelViewProjection:{get:function(){return Ije(this),this._inverseModelViewProjection}},modelViewProjectionRelativeToEye:{get:function(){return Pje(this),this._modelViewProjectionRelativeToEye}},modelViewInfiniteProjection:{get:function(){return Dje(this),this._modelViewInfiniteProjection}},normal:{get:function(){return Rje(this),this._normal}},normal3D:{get:function(){return Oje(this),this._normal3D}},inverseNormal:{get:function(){return Mje(this),this._inverseNormal}},inverseNormal3D:{get:function(){return Nje(this),this._inverseNormal3D}},entireFrustum:{get:function(){return this._entireFrustum}},currentFrustum:{get:function(){return this._currentFrustum}},frustumPlanes:{get:function(){return this._frustumPlanes}},farDepthFromNearPlusOne:{get:function(){return this._farDepthFromNearPlusOne}},log2FarDepthFromNearPlusOne:{get:function(){return this._log2FarDepthFromNearPlusOne}},oneOverLog2FarDepthFromNearPlusOne:{get:function(){return this._oneOverLog2FarDepthFromNearPlusOne}},eyeHeight:{get:function(){return this._eyeHeight}},eyeCartographic:{get:function(){return this._eyeCartographic}},eyeHeight2D:{get:function(){return this._eyeHeight2D}},eyeEllipsoidNormalEC:{get:function(){return this._eyeEllipsoidNormalEC}},eyeEllipsoidCurvature:{get:function(){return this._eyeEllipsoidCurvature}},eyeToEnu:{get:function(){return this._eyeToEnu}},modelToEnu:{get:function(){return this._modelToEnu}},enuToModel:{get:function(){return this._enuToModel}},sunPositionWC:{get:function(){return this._sunPositionWC}},sunPositionColumbusView:{get:function(){return this._sunPositionColumbusView}},sunDirectionWC:{get:function(){return this._sunDirectionWC}},sunDirectionEC:{get:function(){return this._sunDirectionEC}},moonDirectionEC:{get:function(){return this._moonDirectionEC}},lightDirectionWC:{get:function(){return this._lightDirectionWC}},lightDirectionEC:{get:function(){return this._lightDirectionEC}},lightColor:{get:function(){return this._lightColor}},lightColorHdr:{get:function(){return this._lightColorHdr}},encodedCameraPositionMCHigh:{get:function(){return ufe(this),this._encodedCameraPositionMC.high}},encodedCameraPositionMCLow:{get:function(){return ufe(this),this._encodedCameraPositionMC.low}},temeToPseudoFixedMatrix:{get:function(){return this._temeToPseudoFixed}},pixelRatio:{get:function(){return this._pixelRatio}},fogDensity:{get:function(){return this._fogDensity}},fogVisualDensityScalar:{get:function(){return this._fogVisualDensityScalar}},fogMinimumBrightness:{get:function(){return this._fogMinimumBrightness}},atmosphereHsbShift:{get:function(){return this._atmosphereHsbShift}},atmosphereLightIntensity:{get:function(){return this._atmosphereLightIntensity}},atmosphereRayleighCoefficient:{get:function(){return this._atmosphereRayleighCoefficient}},atmosphereRayleighScaleHeight:{get:function(){return this._atmosphereRayleighScaleHeight}},atmosphereMieCoefficient:{get:function(){return this._atmosphereMieCoefficient}},atmosphereMieScaleHeight:{get:function(){return this._atmosphereMieScaleHeight}},atmosphereMieAnisotropy:{get:function(){return this._atmosphereMieAnisotropy}},atmosphereDynamicLighting:{get:function(){return this._atmosphereDynamicLighting}},geometricToleranceOverMeter:{get:function(){return this._geometricToleranceOverMeter}},pass:{get:function(){return this._pass}},backgroundColor:{get:function(){return this._backgroundColor}},brdfLut:{get:function(){return this._brdfLut}},environmentMap:{get:function(){return this._environmentMap}},sphericalHarmonicCoefficients:{get:function(){return this._sphericalHarmonicCoefficients}},specularEnvironmentMaps:{get:function(){return this._specularEnvironmentMaps}},specularEnvironmentMapsMaximumLOD:{get:function(){return this._specularEnvironmentMapsMaximumLOD}},splitPosition:{get:function(){return this._splitPosition}},minimumDisableDepthTestDistance:{get:function(){return this._minimumDisableDepthTestDistance}},invertClassificationColor:{get:function(){return this._invertClassificationColor}},orthographicIn3D:{get:function(){return this._orthographicIn3D}},ellipsoid:{get:function(){return this._ellipsoid??ee.default}}});function lje(e,t){M.clone(t,e._view),M.getMatrix3(t,e._viewRotation),e._view3DDirty=!0,e._inverseView3DDirty=!0,e._modelViewDirty=!0,e._modelView3DDirty=!0,e._modelViewRelativeToEyeDirty=!0,e._inverseModelViewDirty=!0,e._inverseModelView3DDirty=!0,e._viewProjectionDirty=!0,e._inverseViewProjectionDirty=!0,e._modelViewProjectionDirty=!0,e._modelViewProjectionRelativeToEyeDirty=!0,e._modelViewInfiniteProjectionDirty=!0,e._normalDirty=!0,e._inverseNormalDirty=!0,e._normal3DDirty=!0,e._inverseNormal3DDirty=!0}function uje(e,t){M.clone(t,e._inverseView),M.getMatrix3(t,e._inverseViewRotation)}function fje(e,t){M.clone(t,e._projection),e._inverseProjectionDirty=!0,e._viewProjectionDirty=!0,e._inverseViewProjectionDirty=!0,e._modelViewProjectionDirty=!0,e._modelViewProjectionRelativeToEyeDirty=!0}function dje(e,t){M.clone(t,e._infiniteProjection),e._modelViewInfiniteProjectionDirty=!0}var sfe=new h,hje=new M,afe=new $;function mje(e,t){h.clone(t.positionWC,e._cameraPosition),h.clone(t.directionWC,e._cameraDirection),h.clone(t.rightWC,e._cameraRight),h.clone(t.upWC,e._cameraUp);let n=e._ellipsoid,i,r=t.positionCartographic;if(l(r)?(e._eyeHeight=r.height,e._eyeCartographic=h.fromElements(r.longitude,r.latitude,r.height,e._eyeCartographic),e._eyeEllipsoidNormalEC=n.geodeticSurfaceNormalCartographic(r,e._eyeEllipsoidNormalEC),i=h.fromRadians(r.longitude,r.latitude,0,n,sfe)):(e._eyeHeight=-n.maximumRadius,h.magnitude(t.positionWC)>0&&(e._eyeEllipsoidNormalEC=h.normalize(t.positionWC,e._eyeEllipsoidNormalEC)),i=n.scaleToGeodeticSurface(t.positionWC,sfe)),e._encodedCameraPositionMCDirty=!0,!l(i))return;e._eyeEllipsoidNormalEC=$.multiplyByVector(e._viewRotation,e._eyeEllipsoidNormalEC,e._eyeEllipsoidNormalEC);let o=At.eastNorthUpToFixedFrame(i,n,hje);e._enuToModel=M.multiplyTransformation(e.inverseModel,o,e._enuToModel),e._modelToEnu=M.inverseTransformation(e._enuToModel,e._modelToEnu);let s=M.getRotation(o,afe),a=$.multiply(e._viewRotation,s,afe);e._eyeToEnu=$.transpose(a,e._eyeToEnu),P.equalsEpsilon(n._radii.x,n._radii.y,P.EPSILON15)&&(e._eyeEllipsoidCurvature=n.getLocalCurvature(i,e._eyeEllipsoidCurvature))}var dX=new $,pje=new he;function gje(e,t){At.computeIcrfToCentralBodyFixedMatrix(t.time,dX);let n=Pb.computeSunPositionInEarthInertialFrame(t.time,e._sunPositionWC);$.multiplyByVector(dX,n,n),h.normalize(n,e._sunDirectionWC),n=$.multiplyByVector(e.viewRotation3D,n,e._sunDirectionEC),h.normalize(n,n),n=Pb.computeMoonPositionInEarthInertialFrame(t.time,e._moonDirectionEC),$.multiplyByVector(dX,n,n),$.multiplyByVector(e.viewRotation3D,n,n),h.normalize(n,n);let i=t.mapProjection,o=i.ellipsoid.cartesianToCartographic(e._sunPositionWC,pje);i.project(o,e._sunPositionColumbusView)}WE.prototype.updateCamera=function(e){lje(this,e.viewMatrix),uje(this,e.inverseViewMatrix),mje(this,e),this._entireFrustum.x=e.frustum.near,this._entireFrustum.y=e.frustum.far,this.updateFrustum(e.frustum),this._orthographicIn3D=this._mode!==re.SCENE2D&&e.frustum instanceof _n};WE.prototype.updateFrustum=function(e){fje(this,e.projectionMatrix),l(e.infiniteProjectionMatrix)&&dje(this,e.infiniteProjectionMatrix),this._currentFrustum.x=e.near,this._currentFrustum.y=e.far,this._farDepthFromNearPlusOne=e.far-e.near+1,this._log2FarDepthFromNearPlusOne=P.log2(this._farDepthFromNearPlusOne),this._oneOverLog2FarDepthFromNearPlusOne=1/this._log2FarDepthFromNearPlusOne;let t=e.offCenterFrustum;l(t)&&(e=t),this._frustumPlanes.x=e.top,this._frustumPlanes.y=e.bottom,this._frustumPlanes.z=e.left,this._frustumPlanes.w=e.right};WE.prototype.updatePass=function(e){this._pass=e};var _je=[],yje=new N_;WE.prototype.update=function(e){this._mode=e.mode,this._mapProjection=e.mapProjection,this._ellipsoid=e.mapProjection.ellipsoid,this._pixelRatio=e.pixelRatio;let t=e.camera;this.updateCamera(t),e.mode===re.SCENE2D?(this._frustum2DWidth=t.frustum.right-t.frustum.left,this._eyeHeight2D.x=this._frustum2DWidth*.5,this._eyeHeight2D.y=this._eyeHeight2D.x*this._eyeHeight2D.x):(this._frustum2DWidth=0,this._eyeHeight2D.x=0,this._eyeHeight2D.y=0),gje(this,e);let n=e.light??yje;n instanceof N_?(this._lightDirectionWC=h.clone(this._sunDirectionWC,this._lightDirectionWC),this._lightDirectionEC=h.clone(this._sunDirectionEC,this._lightDirectionEC)):(this._lightDirectionWC=h.normalize(h.negate(n.direction,this._lightDirectionWC),this._lightDirectionWC),this._lightDirectionEC=$.multiplyByVector(this.viewRotation3D,this._lightDirectionWC,this._lightDirectionEC));let i=n.color,r=h.fromElements(i.red,i.green,i.blue,this._lightColorHdr);r=h.multiplyByScalar(r,n.intensity,r);let o=h.maximumComponent(r);o>1?h.divideByScalar(r,o,this._lightColor):h.clone(r,this._lightColor);let s=e.brdfLutGenerator,a=l(s)?s.colorTexture:void 0;this._brdfLut=a,this._environmentMap=e.environmentMap??e.context.defaultCubeMap,this._sphericalHarmonicCoefficients=e.sphericalHarmonicCoefficients??_je,this._specularEnvironmentMaps=e.specularEnvironmentMaps,this._specularEnvironmentMapsMaximumLOD=e.specularEnvironmentMapsMaximumLOD,this._fogDensity=e.fog.density,this._fogVisualDensityScalar=e.fog.visualDensityScalar,this._fogMinimumBrightness=e.fog.minimumBrightness;let c=e.atmosphere;l(c)&&(this._atmosphereHsbShift=h.fromElements(c.hueShift,c.saturationShift,c.brightnessShift,this._atmosphereHsbShift),this._atmosphereLightIntensity=c.lightIntensity,this._atmosphereRayleighCoefficient=h.clone(c.rayleighCoefficient,this._atmosphereRayleighCoefficient),this._atmosphereRayleighScaleHeight=c.rayleighScaleHeight,this._atmosphereMieCoefficient=h.clone(c.mieCoefficient,this._atmosphereMieCoefficient),this._atmosphereMieScaleHeight=c.mieScaleHeight,this._atmosphereMieAnisotropy=c.mieAnisotropy,this._atmosphereDynamicLighting=c.dynamicLighting),this._invertClassificationColor=e.invertClassificationColor,this._frameState=e,this._temeToPseudoFixed=At.computeTemeToPseudoFixedMatrix(e.time,this._temeToPseudoFixed),this._splitPosition=e.splitPosition*e.context.drawingBufferWidth;let u=t.frustum.fov,f=this._viewport,d;l(u)?f.height>f.width?d=Math.tan(.5*u)*2/f.height:d=Math.tan(.5*u)*2/f.width:d=1/Math.max(f.width,f.height),this._geometricToleranceOverMeter=d*e.maximumScreenSpaceError,z.clone(e.backgroundColor,this._backgroundColor),this._minimumDisableDepthTestDistance=e.minimumDisableDepthTestDistance,this._minimumDisableDepthTestDistance*=this._minimumDisableDepthTestDistance,this._minimumDisableDepthTestDistance===Number.POSITIVE_INFINITY&&(this._minimumDisableDepthTestDistance=-1)};function cfe(e){if(e._viewportDirty){let t=e._viewport;M.computeOrthographicOffCenter(t.x,t.x+t.width,t.y,t.y+t.height,0,1,e._viewportOrthographicMatrix),M.computeViewportTransformation(t,0,1,e._viewportTransformation),e._viewportDirty=!1}}function Aje(e){e._inverseProjectionDirty&&(e._inverseProjectionDirty=!1,e._mode!==re.SCENE2D&&e._mode!==re.MORPHING&&!e._orthographicIn3D?M.inverse(e._projection,e._inverseProjection):M.clone(M.ZERO,e._inverseProjection))}function bje(e){e._modelViewDirty&&(e._modelViewDirty=!1,M.multiplyTransformation(e._view,e._model,e._modelView))}function xje(e){e._modelView3DDirty&&(e._modelView3DDirty=!1,M.multiplyTransformation(e.view3D,e._model,e._modelView3D))}function Tje(e){e._inverseModelViewDirty&&(e._inverseModelViewDirty=!1,M.inverse(e.modelView,e._inverseModelView))}function Eje(e){e._inverseModelView3DDirty&&(e._inverseModelView3DDirty=!1,M.inverse(e.modelView3D,e._inverseModelView3D))}function Cje(e){e._viewProjectionDirty&&(e._viewProjectionDirty=!1,M.multiply(e._projection,e._view,e._viewProjection))}function vje(e){e._inverseViewProjectionDirty&&(e._inverseViewProjectionDirty=!1,M.inverse(e.viewProjection,e._inverseViewProjection))}function Sje(e){e._modelViewProjectionDirty&&(e._modelViewProjectionDirty=!1,M.multiply(e._projection,e.modelView,e._modelViewProjection))}function wje(e){if(e._modelViewRelativeToEyeDirty){e._modelViewRelativeToEyeDirty=!1;let t=e.modelView,n=e._modelViewRelativeToEye;n[0]=t[0],n[1]=t[1],n[2]=t[2],n[3]=t[3],n[4]=t[4],n[5]=t[5],n[6]=t[6],n[7]=t[7],n[8]=t[8],n[9]=t[9],n[10]=t[10],n[11]=t[11],n[12]=0,n[13]=0,n[14]=0,n[15]=t[15]}}function Ije(e){e._inverseModelViewProjectionDirty&&(e._inverseModelViewProjectionDirty=!1,M.inverse(e.modelViewProjection,e._inverseModelViewProjection))}function Pje(e){e._modelViewProjectionRelativeToEyeDirty&&(e._modelViewProjectionRelativeToEyeDirty=!1,M.multiply(e._projection,e.modelViewRelativeToEye,e._modelViewProjectionRelativeToEye))}function Dje(e){e._modelViewInfiniteProjectionDirty&&(e._modelViewInfiniteProjectionDirty=!1,M.multiply(e._infiniteProjection,e.modelView,e._modelViewInfiniteProjection))}function Rje(e){if(e._normalDirty){e._normalDirty=!1;let t=e._normal;M.getMatrix3(e.inverseModelView,t),$.transpose(t,t)}}function Oje(e){if(e._normal3DDirty){e._normal3DDirty=!1;let t=e._normal3D;M.getMatrix3(e.inverseModelView3D,t),$.transpose(t,t)}}function Mje(e){if(e._inverseNormalDirty){e._inverseNormalDirty=!1;let t=e._inverseNormal;M.getMatrix3(e.modelView,t),$.transpose(t,t)}}function Nje(e){if(e._inverseNormal3DDirty){e._inverseNormal3DDirty=!1;let t=e._inverseNormal3D;M.getMatrix3(e.modelView3D,t),$.transpose(t,t)}}var lfe=new h;function ufe(e){e._encodedCameraPositionMCDirty&&(e._encodedCameraPositionMCDirty=!1,M.multiplyByPoint(e.inverseModel,e._cameraPosition,lfe),Sn.fromCartesian(lfe,e._encodedCameraPositionMC))}var Lje=new h,Fje=new h,Bje=new h,kje=new h,Uje=new he,zje=new h,Vje=new M;function jje(e,t,n,i,r,o,s,a){let c=Lje;c.x=e.y,c.y=e.z,c.z=e.x;let u=Fje;u.x=n.y,u.y=n.z,u.z=n.x;let f=Bje;f.x=i.y,f.y=i.z,f.z=i.x;let d=kje;d.x=t.y,d.y=t.z,d.z=t.x,o===re.SCENE2D&&(c.z=r*.5);let p=s.unproject(c,Uje);p.longitude=P.clamp(p.longitude,-Math.PI,Math.PI),p.latitude=P.clamp(p.latitude,-P.PI_OVER_TWO,P.PI_OVER_TWO);let g=s.ellipsoid,m=g.cartographicToCartesian(p,zje),y=At.eastNorthUpToFixedFrame(m,g,Vje);return M.multiplyByPointAsVector(y,u,u),M.multiplyByPointAsVector(y,f,f),M.multiplyByPointAsVector(y,d,d),l(a)||(a=new M),a[0]=u.x,a[1]=f.x,a[2]=-d.x,a[3]=0,a[4]=u.y,a[5]=f.y,a[6]=-d.y,a[7]=0,a[8]=u.z,a[9]=f.z,a[10]=-d.z,a[11]=0,a[12]=-h.dot(u,m),a[13]=-h.dot(f,m),a[14]=h.dot(d,m),a[15]=1,a}function hX(e){e._view3DDirty&&(e._mode===re.SCENE3D?M.clone(e._view,e._view3D):jje(e._cameraPosition,e._cameraDirection,e._cameraRight,e._cameraUp,e._frustum2DWidth,e._mode,e._mapProjection,e._view3D),M.getMatrix3(e._view3D,e._viewRotation3D),e._view3DDirty=!1)}function ffe(e){e._inverseView3DDirty&&(M.inverseTransformation(e.view3D,e._inverseView3D),M.getMatrix3(e._inverseView3D,e._inverseViewRotation3D),e._inverseView3DDirty=!1)}var i2=WE;function uu(e,t){let{getWebGLStub:n,requestWebgl1:i,webgl:r={},allowTextureFilterAnisotropic:o=!0,transparentDefaultTexture:s=!1}=t??{};r.alpha=r.alpha??!1,r.stencil=r.stencil??!0,r.powerPreference=r.powerPreference??"high-performance";let a=l(n)?n(e,r):Hje(e,r,i),u=typeof WebGL2RenderingContext<"u"&&a instanceof WebGL2RenderingContext;this._canvas=e,this._originalGLContext=a,this._gl=a,this._webgl2=u,this._id=Kn(),this.validateFramebuffer=!1,this.validateShaderProgram=!1,this.logShaderCompilation=!1,this._throwOnWebGLError=!1,this._shaderCache=new QB(this),this._textureCache=new t2,this._transparentDefaultTexture=s;let f=a;this._stencilBits=f.getParameter(f.STENCIL_BITS),Ut._maximumCombinedTextureImageUnits=f.getParameter(f.MAX_COMBINED_TEXTURE_IMAGE_UNITS),Ut._maximumCubeMapSize=f.getParameter(f.MAX_CUBE_MAP_TEXTURE_SIZE),Ut._maximumFragmentUniformVectors=f.getParameter(f.MAX_FRAGMENT_UNIFORM_VECTORS),Ut._maximumTextureImageUnits=f.getParameter(f.MAX_TEXTURE_IMAGE_UNITS),Ut._maximumRenderbufferSize=f.getParameter(f.MAX_RENDERBUFFER_SIZE),Ut._maximumTextureSize=f.getParameter(f.MAX_TEXTURE_SIZE),Ut._maximum3DTextureSize=f.getParameter(f.MAX_3D_TEXTURE_SIZE),Ut._maximumVaryingVectors=f.getParameter(f.MAX_VARYING_VECTORS),Ut._maximumVertexAttributes=f.getParameter(f.MAX_VERTEX_ATTRIBS),Ut._maximumVertexTextureImageUnits=f.getParameter(f.MAX_VERTEX_TEXTURE_IMAGE_UNITS),Ut._maximumVertexUniformVectors=f.getParameter(f.MAX_VERTEX_UNIFORM_VECTORS),Ut._maximumSamples=this._webgl2?f.getParameter(f.MAX_SAMPLES):0;let d=f.getParameter(f.ALIASED_LINE_WIDTH_RANGE);Ut._minimumAliasedLineWidth=d[0],Ut._maximumAliasedLineWidth=d[1];let p=f.getParameter(f.ALIASED_POINT_SIZE_RANGE);Ut._minimumAliasedPointSize=p[0],Ut._maximumAliasedPointSize=p[1];let g=f.getParameter(f.MAX_VIEWPORT_DIMS);Ut._maximumViewportWidth=g[0],Ut._maximumViewportHeight=g[1];let m=f.getShaderPrecisionFormat(f.FRAGMENT_SHADER,f.HIGH_FLOAT);Ut._highpFloatSupported=m.precision!==0;let y=f.getShaderPrecisionFormat(f.FRAGMENT_SHADER,f.HIGH_INT);Ut._highpIntSupported=y.rangeMax!==0,this._antialias=f.getContextAttributes().antialias,this._standardDerivatives=!!Go(f,["OES_standard_derivatives"]),this._blendMinmax=!!Go(f,["EXT_blend_minmax"]),this._elementIndexUint=!!Go(f,["OES_element_index_uint"]),this._depthTexture=!!Go(f,["WEBGL_depth_texture","WEBKIT_WEBGL_depth_texture"]),this._fragDepth=!!Go(f,["EXT_frag_depth"]),this._debugShaders=Go(f,["WEBGL_debug_shaders"]),this._textureFloat=!!Go(f,["OES_texture_float"]),this._textureHalfFloat=!!Go(f,["OES_texture_half_float"]),this._textureFloatLinear=!!Go(f,["OES_texture_float_linear"]),this._textureHalfFloatLinear=!!Go(f,["OES_texture_half_float_linear"]),this._supportsTextureLod=!!Go(f,["EXT_shader_texture_lod"]),this._colorBufferFloat=!!Go(f,["EXT_color_buffer_float","WEBGL_color_buffer_float"]),this._floatBlend=!!Go(f,["EXT_float_blend"]),this._colorBufferHalfFloat=!!Go(f,["EXT_color_buffer_half_float"]),this._s3tc=!!Go(f,["WEBGL_compressed_texture_s3tc","MOZ_WEBGL_compressed_texture_s3tc","WEBKIT_WEBGL_compressed_texture_s3tc"]),this._pvrtc=!!Go(f,["WEBGL_compressed_texture_pvrtc","WEBKIT_WEBGL_compressed_texture_pvrtc"]),this._astc=!!Go(f,["WEBGL_compressed_texture_astc"]),this._etc=!!Go(f,["WEBG_compressed_texture_etc"]),this._etc1=!!Go(f,["WEBGL_compressed_texture_etc1"]),this._bc7=!!Go(f,["EXT_texture_compression_bptc"]),nf.setKTX2SupportedFormats(this._s3tc,this._pvrtc,this._astc,this._etc,this._etc1,this._bc7);let A=o?Go(f,["EXT_texture_filter_anisotropic","WEBKIT_EXT_texture_filter_anisotropic"]):void 0;this._textureFilterAnisotropic=A,Ut._maximumTextureFilterAnisotropy=l(A)?f.getParameter(A.MAX_TEXTURE_MAX_ANISOTROPY_EXT):1;let b,x,T,E,v,S,I,R,O,L;if(u){let D=this;b=function(){return D._gl.createVertexArray()},x=function(N){D._gl.bindVertexArray(N)},T=function(N){D._gl.deleteVertexArray(N)},E=function(N,F,V,B,j){f.drawElementsInstanced(N,F,V,B,j)},v=function(N,F,V,B){f.drawArraysInstanced(N,F,V,B)},S=function(N,F){f.vertexAttribDivisor(N,F)},I=function(N){f.drawBuffers(N)}}else R=Go(f,["OES_vertex_array_object"]),l(R)&&(b=function(){return R.createVertexArrayOES()},x=function(D){R.bindVertexArrayOES(D)},T=function(D){R.deleteVertexArrayOES(D)}),O=Go(f,["ANGLE_instanced_arrays"]),l(O)&&(E=function(D,N,F,V,B){O.drawElementsInstancedANGLE(D,N,F,V,B)},v=function(D,N,F,V){O.drawArraysInstancedANGLE(D,N,F,V)},S=function(D,N){O.vertexAttribDivisorANGLE(D,N)}),L=Go(f,["WEBGL_draw_buffers"]),l(L)&&(I=function(D){L.drawBuffersWEBGL(D)});this.glCreateVertexArray=b,this.glBindVertexArray=x,this.glDeleteVertexArray=T,this.glDrawElementsInstanced=E,this.glDrawArraysInstanced=v,this.glVertexAttribDivisor=S,this.glDrawBuffers=I,this._vertexArrayObject=!!R,this._instancedArrays=!!O,this._drawBuffers=!!L,Ut._maximumDrawBuffers=this.drawBuffers?f.getParameter(te.MAX_DRAW_BUFFERS):1,Ut._maximumColorAttachments=this.drawBuffers?f.getParameter(te.MAX_COLOR_ATTACHMENTS):1,this._clearColor=new z(0,0,0,0),this._clearDepth=1,this._clearStencil=0;let _=new i2,C=new gc(this),w=Ge.fromCache();this._defaultPassState=C,this._defaultRenderState=w,this._defaultTexture=void 0,this._defaultEmissiveTexture=void 0,this._defaultNormalTexture=void 0,this._defaultCubeMap=void 0,this._us=_,this._currentRenderState=w,this._currentPassState=C,this._currentFramebuffer=void 0,this._maxFrameTextureUnitIndex=0,this._vertexAttribDivisors=[],this._previousDrawInstanced=!1;for(let D=0;D<Ut._maximumVertexAttributes;D++)this._vertexAttribDivisors.push(0);this._pickObjects=new Map,this._nextPickColor=new Uint32Array(1),this.options={getWebGLStub:n,requestWebgl1:i,webgl:r,allowTextureFilterAnisotropic:o,transparentDefaultTexture:s},this.cache={},Ge.apply(f,w,C)}function Hje(e,t,n){if(typeof WebGLRenderingContext>"u")throw new oe("The browser does not support WebGL. Visit http://get.webgl.org.");!n&&!(typeof WebGL2RenderingContext<"u")&&(n=!0);let r=n?"webgl":"webgl2",o=e.getContext(r,t);if(!l(o))throw new oe("The browser supports WebGL, but initialization failed.");return o}function Gje(e,t){let n="WebGL Error: ";switch(t){case e.INVALID_ENUM:n+="INVALID_ENUM";break;case e.INVALID_VALUE:n+="INVALID_VALUE";break;case e.INVALID_OPERATION:n+="INVALID_OPERATION";break;case e.OUT_OF_MEMORY:n+="OUT_OF_MEMORY";break;case e.CONTEXT_LOST_WEBGL:n+="CONTEXT_LOST_WEBGL lost";break;default:n+=`Unknown (${t})`}return n}function Wje(e,t,n,i){let r=`${Gje(e,i)}: ${t.name}(`;for(let o=0;o<n.length;++o)o!==0&&(r+=", "),r+=n[o];return r+=");",r}function qje(e,t,n){let i=e.getError();if(i!==e.NO_ERROR)throw new oe(Wje(e,t,n,i))}function Yje(e,t,n){return{get:function(){let i=e[t];return n(e,`get: ${t}`,i),e[t]},set:function(i){e[t]=i,n(e,`set: ${t}`,i)}}}function Xje(e,t){if(!l(t))return e;function n(r){return function(){let o=r.apply(e,arguments);return t(e,r,arguments),o}}let i={};for(let r in e){let o=e[r];o instanceof Function?i[r]=n(o):Object.defineProperty(i,r,Yje(e,r,t))}return i}function Go(e,t){let n=t.length;for(let i=0;i<n;++i){let r=e.getExtension(t[i]);if(r)return r}}var Kje={};Object.defineProperties(uu.prototype,{id:{get:function(){return this._id}},webgl2:{get:function(){return this._webgl2}},canvas:{get:function(){return this._canvas}},shaderCache:{get:function(){return this._shaderCache}},textureCache:{get:function(){return this._textureCache}},uniformState:{get:function(){return this._us}},stencilBits:{get:function(){return this._stencilBits}},stencilBuffer:{get:function(){return this._stencilBits>=8}},antialias:{get:function(){return this._antialias}},msaa:{get:function(){return this._webgl2}},standardDerivatives:{get:function(){return this._standardDerivatives||this._webgl2}},floatBlend:{get:function(){return this._floatBlend}},blendMinmax:{get:function(){return this._blendMinmax||this._webgl2}},elementIndexUint:{get:function(){return this._elementIndexUint||this._webgl2}},depthTexture:{get:function(){return this._depthTexture||this._webgl2}},floatingPointTexture:{get:function(){return this._webgl2||this._textureFloat}},halfFloatingPointTexture:{get:function(){return this._webgl2||this._textureHalfFloat}},textureFloatLinear:{get:function(){return this._textureFloatLinear}},textureHalfFloatLinear:{get:function(){return this._webgl2&&this._textureFloatLinear||!this._webgl2&&this._textureHalfFloatLinear}},supportsTextureLod:{get:function(){return this._webgl2||this._supportsTextureLod}},textureFilterAnisotropic:{get:function(){return!!this._textureFilterAnisotropic}},s3tc:{get:function(){return this._s3tc}},pvrtc:{get:function(){return this._pvrtc}},astc:{get:function(){return this._astc}},etc:{get:function(){return this._etc}},etc1:{get:function(){return this._etc1}},bc7:{get:function(){return this._bc7}},supportsBasis:{get:function(){return this._s3tc||this._pvrtc||this._astc||this._etc||this._etc1||this._bc7}},vertexArrayObject:{get:function(){return this._vertexArrayObject||this._webgl2}},fragmentDepth:{get:function(){return this._fragDepth||this._webgl2}},instancedArrays:{get:function(){return this._instancedArrays||this._webgl2}},colorBufferFloat:{get:function(){return this._colorBufferFloat}},colorBufferHalfFloat:{get:function(){return this._webgl2&&this._colorBufferFloat||!this._webgl2&&this._colorBufferHalfFloat}},drawBuffers:{get:function(){return this._drawBuffers||this._webgl2}},debugShaders:{get:function(){return this._debugShaders}},throwOnWebGLError:{get:function(){return this._throwOnWebGLError},set:function(e){this._throwOnWebGLError=e,this._gl=Xje(this._originalGLContext,e?qje:void 0)}},defaultTexture:{get:function(){if(this._defaultTexture===void 0){let e=Dt.defaultColor;this._defaultTexture=new Dt({context:this,source:{width:1,height:1,arrayBufferView:new Uint8Array([e.red*255,e.green*255,e.blue*255,this._transparentDefaultTexture?0:e.alpha*255])},flipY:!1})}return this._defaultTexture}},defaultEmissiveTexture:{get:function(){return this._defaultEmissiveTexture===void 0&&(this._defaultEmissiveTexture=new Dt({context:this,pixelFormat:$e.RGB,source:{width:1,height:1,arrayBufferView:new Uint8Array([0,0,0])},flipY:!1})),this._defaultEmissiveTexture}},defaultNormalTexture:{get:function(){return this._defaultNormalTexture===void 0&&(this._defaultNormalTexture=new Dt({context:this,pixelFormat:$e.RGB,source:{width:1,height:1,arrayBufferView:new Uint8Array([128,128,255])},flipY:!1})),this._defaultNormalTexture}},defaultCubeMap:{get:function(){if(this._defaultCubeMap===void 0){let e={width:1,height:1,arrayBufferView:new Uint8Array([255,255,255,255])};this._defaultCubeMap=new ls({context:this,source:{positiveX:e,negativeX:e,positiveY:e,negativeY:e,positiveZ:e,negativeZ:e},flipY:!1})}return this._defaultCubeMap}},drawingBufferHeight:{get:function(){return this._gl.drawingBufferHeight}},drawingBufferWidth:{get:function(){return this._gl.drawingBufferWidth}},defaultFramebuffer:{get:function(){return Kje}}});function dfe(e,t,n,i){let r=e._currentRenderState,o=e._currentPassState;e._currentRenderState=t,e._currentPassState=n,Ge.partialApply(e._gl,r,t,o,n,i)}var mX;typeof WebGLRenderingContext<"u"&&(mX=[te.BACK]);function r2(e,t){if(t!==e._currentFramebuffer){e._currentFramebuffer=t;let n=mX;if(l(t))t._bind(),n=t._getActiveColorAttachments();else{let i=e._gl;i.bindFramebuffer(i.FRAMEBUFFER,null)}e.drawBuffers&&e.glDrawBuffers(n)}}var $je=new fi;uu.prototype.clear=function(e,t){e=e??$je,t=t??this._defaultPassState;let n=this._gl,i=0,r=e.color,o=e.depth,s=e.stencil;l(r)&&(z.equals(this._clearColor,r)||(z.clone(r,this._clearColor),n.clearColor(r.red,r.green,r.blue,r.alpha)),i|=n.COLOR_BUFFER_BIT),l(o)&&(o!==this._clearDepth&&(this._clearDepth=o,n.clearDepth(o)),i|=n.DEPTH_BUFFER_BIT),l(s)&&(s!==this._clearStencil&&(this._clearStencil=s,n.clearStencil(s)),i|=n.STENCIL_BUFFER_BIT);let a=e.renderState??this._defaultRenderState;dfe(this,a,t,!0);let c=e.framebuffer??t.framebuffer;r2(this,c),n.clear(i)};function Jje(e,t,n,i,r){r2(e,t),dfe(e,r,n,!1),i._bind(),e._maxFrameTextureUnitIndex=Math.max(e._maxFrameTextureUnitIndex,i.maximumTextureUnitIndex)}function Zje(e,t,n,i){let r=t._primitiveType,o=t._vertexArray,s=t._offset,a=t._count,c=t.instanceCount;e._us.model=t._modelMatrix??M.IDENTITY,n._setUniforms(i,e._us,e.validateShaderProgram),o._bind();let u=o.indexBuffer;l(u)?(s=s*u.bytesPerIndex,l(a)?a=Math.min(a,u.numberOfIndices):a=u.numberOfIndices,c===0?e._gl.drawElements(r,a,u.indexDatatype,s):e.glDrawElementsInstanced(r,a,u.indexDatatype,s,c)):(l(a)?a=Math.min(a,o.numberOfVertices):a=o.numberOfVertices,c===0?e._gl.drawArrays(r,s,a):e.glDrawArraysInstanced(r,s,a,c)),o._unBind()}uu.prototype.draw=function(e,t,n,i){t=t??this._defaultPassState;let r=e._framebuffer??t.framebuffer,o=e._renderState??this._defaultRenderState;n=n??e._shaderProgram,i=i??e._uniformMap,Jje(this,r,t,n,o),Zje(this,e,n,i)};uu.prototype.beginFrame=function(){};uu.prototype.endFrame=function(){let e=this._gl;e.useProgram(null),this._currentFramebuffer=void 0,e.bindFramebuffer(e.FRAMEBUFFER,null);let t=mX;this.drawBuffers&&this.glDrawBuffers(t);let n=this._maxFrameTextureUnitIndex;this._maxFrameTextureUnitIndex=0;for(let i=0;i<n;++i)e.activeTexture(e.TEXTURE0+i),e.bindTexture(e.TEXTURE_2D,null),e.bindTexture(e.TEXTURE_CUBE_MAP,null)};uu.prototype.readPixelsToPBO=function(e){let t=this._gl;e=e??H.EMPTY_OBJECT;let n=Math.max(e.x??0,0),i=Math.max(e.y??0,0),r=e.width??this.drawingBufferWidth,o=e.height??this.drawingBufferHeight,s=e.framebuffer;if(!this._webgl2)throw new pe("A WebGL 2 context is required to read pixels using a PBO.");let a=ze.UNSIGNED_BYTE,c=$e.RGBA;l(s)&&s.numberOfColorAttachments>0&&(a=s.getColorTexture(0).pixelDatatype,c=s.getColorTexture(0).pixelFormat);let u=tt.createPixelBuffer({context:this,sizeInBytes:$e.textureSizeInBytes(c,a,r,o),usage:Me.DYNAMIC_READ});return r2(this,s),u._bind(),t.readPixels(n,i,r,o,c,ze.toWebGLConstant(a,this),0),u._unBind(),u};uu.prototype.readPixels=function(e){let t=this._gl;e=e??H.EMPTY_OBJECT;let n=Math.max(e.x??0,0),i=Math.max(e.y??0,0),r=e.width??this.drawingBufferWidth,o=e.height??this.drawingBufferHeight,s=e.framebuffer,a=ze.UNSIGNED_BYTE,c=$e.RGBA;l(s)&&s.numberOfColorAttachments>0&&(a=s.getColorTexture(0).pixelDatatype,c=s.getColorTexture(0).pixelFormat);let u=$e.createTypedArray(c,a,r,o);return r2(this,s),t.readPixels(n,i,r,o,$e.RGBA,ze.toWebGLConstant(a,this),u),u};var hfe={position:0,textureCoordinates:1};uu.prototype.getViewportQuadVertexArray=function(){let e=this.cache.viewportQuad_vertexArray;if(!l(e)){let t=new wt({attributes:{position:new Ne({componentDatatype:Y.FLOAT,componentsPerAttribute:2,values:[-1,-1,1,-1,1,1,-1,1]}),textureCoordinates:new Ne({componentDatatype:Y.FLOAT,componentsPerAttribute:2,values:[0,0,1,0,1,1,0,1]})},indices:new Uint16Array([0,1,2,0,2,3]),primitiveType:Oe.TRIANGLES});e=Vn.fromGeometry({context:this,geometry:t,attributeLocations:hfe,bufferUsage:Me.STATIC_DRAW,interleave:!0}),this.cache.viewportQuad_vertexArray=e}return e};uu.prototype.createViewportQuadCommand=function(e,t){return t=t??H.EMPTY_OBJECT,new at({vertexArray:this.getViewportQuadVertexArray(),primitiveType:Oe.TRIANGLES,renderState:t.renderState,shaderProgram:Qt.fromCache({context:this,vertexShaderSource:LE,fragmentShaderSource:e,attributeLocations:hfe}),uniformMap:t.uniformMap,owner:t.owner,framebuffer:t.framebuffer,pass:t.pass})};uu.prototype.getObjectByPickColor=function(e){return this._pickObjects.get(e)};uu.prototype.createPickId=function(e){++this._nextPickColor[0];let t=this._nextPickColor[0];if(t===0)throw new oe("Out of unique Pick IDs.");return this._pickObjects.set(t,e),new _L(this._pickObjects,t,z.fromRgba(t))};uu.prototype.isDestroyed=function(){return!1};uu.prototype.destroy=function(){let e=this.cache;for(let t in e)if(e.hasOwnProperty(t)){let n=e[t];l(n.destroy)&&n.destroy()}return this._shaderCache=this._shaderCache.destroy(),this._textureCache=this._textureCache.destroy(),this._defaultTexture=this._defaultTexture&&this._defaultTexture.destroy(),this._defaultEmissiveTexture=this._defaultEmissiveTexture&&this._defaultEmissiveTexture.destroy(),this._defaultNormalTexture=this._defaultNormalTexture&&this._defaultNormalTexture.destroy(),this._defaultCubeMap=this._defaultCubeMap&&this._defaultCubeMap.destroy(),le(this)};var qE=uu;function YE(e){e=e??H.EMPTY_OBJECT;let{context:t,width:n,height:i,colorRenderbuffers:r,colorTextures:o,depthStencilRenderbuffer:s,depthStencilTexture:a,destroyAttachments:c}=e;if(this._width=n,this._height=i,l(r)!==l(o))throw new pe("Both color renderbuffer and texture attachments must be provided.");if(l(s)!==l(a))throw new pe("Both depth-stencil renderbuffer and texture attachments must be provided.");this._renderFramebuffer=new vs({context:t,colorRenderbuffers:r,depthStencilRenderbuffer:s,destroyAttachments:c}),this._colorFramebuffer=new vs({context:t,colorTextures:o,depthStencilTexture:a,destroyAttachments:c})}YE.prototype.getRenderFramebuffer=function(){return this._renderFramebuffer};YE.prototype.getColorFramebuffer=function(){return this._colorFramebuffer};YE.prototype.blitFramebuffers=function(e,t){this._renderFramebuffer.bindRead(),this._colorFramebuffer.bindDraw();let n=e._gl,i=0;this._colorFramebuffer._colorTextures.length>0&&(i|=n.COLOR_BUFFER_BIT),l(this._colorFramebuffer.depthStencilTexture)&&(i|=n.DEPTH_BUFFER_BIT|(t?n.STENCIL_BUFFER_BIT:0)),n.blitFramebuffer(0,0,this._width,this._height,0,0,this._width,this._height,i,n.NEAREST),n.bindFramebuffer(n.READ_FRAMEBUFFER,null),n.bindFramebuffer(n.DRAW_FRAMEBUFFER,null)};YE.prototype.isDestroyed=function(){return!1};YE.prototype.destroy=function(){return this._renderFramebuffer.destroy(),this._colorFramebuffer.destroy(),le(this)};var o2=YE;var vl={RGBA4:te.RGBA4,RGBA8:te.RGBA8,RGBA16F:te.RGBA16F,RGBA32F:te.RGBA32F,RGB5_A1:te.RGB5_A1,RGB565:te.RGB565,DEPTH_COMPONENT16:te.DEPTH_COMPONENT16,STENCIL_INDEX8:te.STENCIL_INDEX8,DEPTH_STENCIL:te.DEPTH_STENCIL,DEPTH24_STENCIL8:te.DEPTH24_STENCIL8,validate:function(e){return e===vl.RGBA4||e===vl.RGBA8||e===vl.RGBA16F||e===vl.RGBA32F||e===vl.RGB5_A1||e===vl.RGB565||e===vl.DEPTH_COMPONENT16||e===vl.STENCIL_INDEX8||e===vl.DEPTH_STENCIL||e===vl.DEPTH24_STENCIL8},getColorFormat:function(e){return e===te.FLOAT?vl.RGBA32F:e===te.HALF_FLOAT_OES?vl.RGBA16F:vl.RGBA8}};Object.freeze(vl);var fu=vl;function aP(e){e=e??H.EMPTY_OBJECT;let t=e.context,n=t._gl,i=Ut.maximumRenderbufferSize,r=e.format??fu.RGBA4,o=l(e.width)?e.width:t.drawingBufferWidth,s=l(e.height)?e.height:t.drawingBufferHeight,a=e.numSamples??1;this._gl=n,this._format=r,this._width=o,this._height=s,this._renderbuffer=this._gl.createRenderbuffer(),n.bindRenderbuffer(n.RENDERBUFFER,this._renderbuffer),a>1?n.renderbufferStorageMultisample(n.RENDERBUFFER,a,r,o,s):n.renderbufferStorage(n.RENDERBUFFER,r,o,s),n.bindRenderbuffer(n.RENDERBUFFER,null)}Object.defineProperties(aP.prototype,{format:{get:function(){return this._format}},width:{get:function(){return this._width}},height:{get:function(){return this._height}}});aP.prototype._getRenderbuffer=function(){return this._renderbuffer};aP.prototype.isDestroyed=function(){return!1};aP.prototype.destroy=function(){return this._gl.deleteRenderbuffer(this._renderbuffer),le(this)};var id=aP;function ca(e){e=e??H.EMPTY_OBJECT,this._numSamples=e.numSamples??1,this._colorAttachmentsLength=e.colorAttachmentsLength??1,this._color=e.color??!0,this._depth=e.depth??!1,this._depthStencil=e.depthStencil??!1,this._supportsDepthTexture=e.supportsDepthTexture??!1,this._createColorAttachments=e.createColorAttachments??!0,this._createDepthAttachments=e.createDepthAttachments??!0,this._pixelDatatype=e.pixelDatatype,this._pixelFormat=e.pixelFormat,this._width=void 0,this._height=void 0,this._framebuffer=void 0,this._multisampleFramebuffer=void 0,this._colorTextures=void 0,this._color&&(this._colorTextures=new Array(this._colorAttachmentsLength),this._colorRenderbuffers=new Array(this._colorAttachmentsLength)),this._colorRenderbuffer=void 0,this._depthStencilRenderbuffer=void 0,this._depthStencilTexture=void 0,this._depthRenderbuffer=void 0,this._depthTexture=void 0,this._attachmentsDirty=!1}Object.defineProperties(ca.prototype,{framebuffer:{get:function(){return this._numSamples>1?this._multisampleFramebuffer.getRenderFramebuffer():this._framebuffer}},numSamples:{get:function(){return this._numSamples}},status:{get:function(){return this.framebuffer.status}}});ca.prototype.isDirty=function(e,t,n,i,r){n=n??1;let o=this._width!==e||this._height!==t,s=this._numSamples!==n,a=l(i)&&this._pixelDatatype!==i||l(r)&&this._pixelFormat!==r,c=n===1?l(this._framebuffer):l(this._multisampleFramebuffer);return this._attachmentsDirty||o||s||a||!c||this._color&&!l(this._colorTextures[0])};ca.prototype.update=function(e,t,n,i,r,o){if(i=e.msaa?i??1:1,r=r??(this._color?this._pixelDatatype??ze.UNSIGNED_BYTE:void 0),o=o??(this._color?this._pixelFormat??$e.RGBA:void 0),this.isDirty(t,n,i,r,o)){if(this.destroy(),this._width=t,this._height=n,this._numSamples=i,this._pixelDatatype=r,this._pixelFormat=o,this._attachmentsDirty=!1,this._color&&this._createColorAttachments){for(let s=0;s<this._colorAttachmentsLength;++s)if(this._colorTextures[s]=new Dt({context:e,width:t,height:n,pixelFormat:o,pixelDatatype:r,sampler:Ht.NEAREST}),this._numSamples>1){let a=fu.getColorFormat(r);this._colorRenderbuffers[s]=new id({context:e,width:t,height:n,format:a,numSamples:this._numSamples})}}this._depthStencil&&this._createDepthAttachments&&(this._supportsDepthTexture&&e.depthTexture?(this._depthStencilTexture=new Dt({context:e,width:t,height:n,pixelFormat:$e.DEPTH_STENCIL,pixelDatatype:ze.UNSIGNED_INT_24_8,sampler:Ht.NEAREST}),this._numSamples>1&&(this._depthStencilRenderbuffer=new id({context:e,width:t,height:n,format:fu.DEPTH24_STENCIL8,numSamples:this._numSamples}))):this._depthStencilRenderbuffer=new id({context:e,width:t,height:n,format:fu.DEPTH_STENCIL})),this._depth&&this._createDepthAttachments&&(this._supportsDepthTexture&&e.depthTexture?this._depthTexture=new Dt({context:e,width:t,height:n,pixelFormat:$e.DEPTH_COMPONENT,pixelDatatype:ze.UNSIGNED_INT,sampler:Ht.NEAREST}):this._depthRenderbuffer=new id({context:e,width:t,height:n,format:fu.DEPTH_COMPONENT16})),this._numSamples>1?this._multisampleFramebuffer=new o2({context:e,width:this._width,height:this._height,colorTextures:this._colorTextures,colorRenderbuffers:this._colorRenderbuffers,depthStencilTexture:this._depthStencilTexture,depthStencilRenderbuffer:this._depthStencilRenderbuffer,destroyAttachments:!1}):this._framebuffer=new vs({context:e,colorTextures:this._colorTextures,depthTexture:this._depthTexture,depthRenderbuffer:this._depthRenderbuffer,depthStencilTexture:this._depthStencilTexture,depthStencilRenderbuffer:this._depthStencilRenderbuffer,destroyAttachments:!1})}};ca.prototype.getColorTexture=function(e){return e=e??0,this._colorTextures[e]};ca.prototype.setColorTexture=function(e,t){t=t??0,this._attachmentsDirty=e!==this._colorTextures[t],this._colorTextures[t]=e};ca.prototype.getColorRenderbuffer=function(e){return e=e??0,this._colorRenderbuffers[e]};ca.prototype.setColorRenderbuffer=function(e,t){t=t??0,this._attachmentsDirty=e!==this._colorRenderbuffers[t],this._colorRenderbuffers[t]=e};ca.prototype.getDepthRenderbuffer=function(){return this._depthRenderbuffer};ca.prototype.setDepthRenderbuffer=function(e){this._attachmentsDirty=e!==this._depthRenderbuffer,this._depthRenderbuffer=e};ca.prototype.getDepthTexture=function(){return this._depthTexture};ca.prototype.setDepthTexture=function(e){this._attachmentsDirty=e!==this._depthTexture,this._depthTexture=e};ca.prototype.getDepthStencilRenderbuffer=function(){return this._depthStencilRenderbuffer};ca.prototype.setDepthStencilRenderbuffer=function(e){this._attachmentsDirty=e!==this._depthStencilRenderbuffer,this._depthStencilRenderbuffer=e};ca.prototype.getDepthStencilTexture=function(){return this._depthStencilTexture};ca.prototype.setDepthStencilTexture=function(e){this._attachmentsDirty=e!==this._depthStencilTexture,this._depthStencilTexture=e};ca.prototype.prepareTextures=function(e,t){this._numSamples>1&&this._multisampleFramebuffer.blitFramebuffers(e,t)};ca.prototype.clear=function(e,t,n){let i=t.framebuffer;t.framebuffer=this.framebuffer,t.execute(e,n),t.framebuffer=i};ca.prototype.destroyFramebuffer=function(){this._framebuffer=this._framebuffer&&this._framebuffer.destroy(),this._multisampleFramebuffer=this._multisampleFramebuffer&&this._multisampleFramebuffer.destroy()};ca.prototype.destroy=function(){if(this._color){let e=this._colorTextures,t=this._colorRenderbuffers;for(let n=0;n<e.length;++n){let i=e[n];this._createColorAttachments&&l(i)&&!i.isDestroyed()&&i.destroy(),l(i)&&i.isDestroyed()&&(e[n]=void 0);let r=t[n];this._createColorAttachments&&l(r)&&!r.isDestroyed()&&r.destroy(),l(r)&&r.isDestroyed()&&(t[n]=void 0)}}this._depthStencil&&(this._createDepthAttachments&&(this._depthStencilTexture=this._depthStencilTexture&&this._depthStencilTexture.destroy(),this._depthStencilRenderbuffer=this._depthStencilRenderbuffer&&this._depthStencilRenderbuffer.destroy()),l(this._depthStencilTexture)&&this._depthStencilTexture.isDestroyed()&&(this._depthStencilTexture=void 0),l(this._depthStencilRenderbuffer)&&this._depthStencilRenderbuffer.isDestroyed()&&(this._depthStencilRenderbuffer=void 0)),this._depth&&(this._createDepthAttachments&&(this._depthTexture=this._depthTexture&&this._depthTexture.destroy(),this._depthRenderbuffer=this._depthRenderbuffer&&this._depthRenderbuffer.destroy()),l(this._depthTexture)&&this._depthTexture.isDestroyed()&&(this._depthTexture=void 0),l(this._depthRenderbuffer)&&this._depthRenderbuffer.isDestroyed()&&(this._depthRenderbuffer=void 0)),this.destroyFramebuffer()};var ci=ca;function Qje(e,t,n){let i={flipY:!0,skipColorSpaceConversion:n,preferImageBitmap:!0},r=[De.createIfNeeded(t.positiveX).fetchImage(i),De.createIfNeeded(t.negativeX).fetchImage(i),De.createIfNeeded(t.positiveY).fetchImage(i),De.createIfNeeded(t.negativeY).fetchImage(i),De.createIfNeeded(t.positiveZ).fetchImage(i),De.createIfNeeded(t.negativeZ).fetchImage(i)];return Promise.all(r).then(function(o){return new ls({context:e,source:{positiveX:o[0],negativeX:o[1],positiveY:o[2],negativeY:o[3],positiveZ:o[4],negativeZ:o[5]}})})}var s2=Qje;var L_={NONE:0,VERTEX:1,FRAGMENT:2,BOTH:3};L_.includesVertexShader=function(e){return(e&L_.VERTEX)!==0};L_.includesFragmentShader=function(e){return(e&L_.FRAGMENT)!==0};L_.union=function(...e){let t=0;for(let n=0;n<e.length;n++)t|=e[n];return t};L_.intersection=function(...e){let t=e[0];for(let n=1;n<e.length;n++)t&=e[n];return t};Object.freeze(L_);var de=L_;function pX(e){this.name=e,this.fields=[]}pX.prototype.addField=function(e,t){let n=` ${e} ${t};`;this.fields.push(n)};pX.prototype.generateGlslLines=function(){let e=this.fields;return e.length===0&&(e=[" float _empty;"]),[].concat(`struct ${this.name}`,"{",e,"};")};var a2=pX;function gX(e){this.signature=e,this.body=[]}gX.prototype.addLines=function(e){let t=this.body;if(Array.isArray(e)){let n=e.length;for(let i=0;i<n;i++)t.push(` ${e[i]}`)}else t.push(` ${e}`)};gX.prototype.generateGlslLines=function(){return[].concat(this.signature,"{",this.body,"}")};var c2=gX;function e6e(e,t){if(!l(t))return;let n=t.length;if(n===0)return;let i=e.length;e.length+=n;for(let r=0;r<n;r++)e[i+r]=t[r]}var Zn=e6e;function Sl(){this._positionAttributeLine=void 0,this._nextAttributeLocation=1,this._attributeLocations={},this._attributeLines=[],this._structs={},this._functions={},this._vertexShaderParts={defineLines:[],uniformLines:[],shaderLines:[],varyingLines:[],structIds:[],functionIds:[]},this._fragmentShaderParts={defineLines:[],uniformLines:[],shaderLines:[],varyingLines:[],structIds:[],functionIds:[]}}Object.defineProperties(Sl.prototype,{attributeLocations:{get:function(){return this._attributeLocations}}});Sl.prototype.addDefine=function(e,t,n){n=n??de.BOTH;let i=e;l(t)&&(i+=` ${t.toString()}`),de.includesVertexShader(n)&&this._vertexShaderParts.defineLines.push(i),de.includesFragmentShader(n)&&this._fragmentShaderParts.defineLines.push(i)};Sl.prototype.addStruct=function(e,t,n){this._structs[e]=new a2(t),de.includesVertexShader(n)&&this._vertexShaderParts.structIds.push(e),de.includesFragmentShader(n)&&this._fragmentShaderParts.structIds.push(e)};Sl.prototype.addStructField=function(e,t,n){this._structs[e].addField(t,n)};Sl.prototype.addFunction=function(e,t,n){this._functions[e]=new c2(t),de.includesVertexShader(n)&&this._vertexShaderParts.functionIds.push(e),de.includesFragmentShader(n)&&this._fragmentShaderParts.functionIds.push(e)};Sl.prototype.addFunctionLines=function(e,t){this._functions[e].addLines(t)};Sl.prototype.addUniform=function(e,t,n){n=n??de.BOTH;let i=`uniform ${e} ${t};`;de.includesVertexShader(n)&&this._vertexShaderParts.uniformLines.push(i),de.includesFragmentShader(n)&&this._fragmentShaderParts.uniformLines.push(i)};Sl.prototype.setPositionAttribute=function(e,t){return this._positionAttributeLine=`in ${e} ${t};`,this._attributeLocations[t]=0,0};Sl.prototype.addAttribute=function(e,t){let n=`in ${e} ${t};`;this._attributeLines.push(n);let i=this._nextAttributeLocation;return this._attributeLocations[t]=i,this._nextAttributeLocation+=n6e(e),i};Sl.prototype.addVarying=function(e,t,n){n=l(n)?`${n} `:"";let i=`${e} ${t};`;this._vertexShaderParts.varyingLines.push(`${n}out ${i}`),this._fragmentShaderParts.varyingLines.push(`${n}in ${i}`)};Sl.prototype.addVertexLines=function(e){let t=this._vertexShaderParts.shaderLines;Array.isArray(e)?Zn(t,e):t.push(e)};Sl.prototype.addFragmentLines=function(e){let t=this._fragmentShaderParts.shaderLines;Array.isArray(e)?Zn(t,e):t.push(e)};Sl.prototype.buildShaderProgram=function(e){let t=l(this._positionAttributeLine)?[this._positionAttributeLine]:[],n=t6e(this),i=i6e(this),r=t.concat(this._attributeLines,this._vertexShaderParts.uniformLines,this._vertexShaderParts.varyingLines,n.vertexLines,i.vertexLines,this._vertexShaderParts.shaderLines).join(` `),o=new Xe({defines:this._vertexShaderParts.defineLines,sources:[r]}),s=this._fragmentShaderParts.uniformLines.concat(this._fragmentShaderParts.varyingLines,n.fragmentLines,i.fragmentLines,this._fragmentShaderParts.shaderLines).join(` -`),a=new Xe({defines:this._fragmentShaderParts.defineLines,sources:[s]});return Qt.fromCache({context:e,vertexShaderSource:o,fragmentShaderSource:a,attributeLocations:this._attributeLocations})};Sl.prototype.clone=function(){return Ze(this,!0)};function e6e(e){let t=[],n=[],i,r=e._vertexShaderParts.structIds,o,s,a;for(i=0;i<r.length;i++)o=r[i],s=e._structs[o],a=s.generateGlslLines(),Zn(t,a);for(r=e._fragmentShaderParts.structIds,i=0;i<r.length;i++)o=r[i],s=e._structs[o],a=s.generateGlslLines(),Zn(n,a);return{vertexLines:t,fragmentLines:n}}function t6e(e){switch(e){case"mat2":return 2;case"mat3":return 3;case"mat4":return 4;default:return 1}}function n6e(e){let t=[],n=[],i,r=e._vertexShaderParts.functionIds,o,s,a;for(i=0;i<r.length;i++)o=r[i],s=e._functions[o],a=s.generateGlslLines(),Zn(t,a);for(r=e._fragmentShaderParts.functionIds,i=0;i<r.length;i++)o=r[i],s=e._functions[o],a=s.generateGlslLines(),Zn(n,a);return{vertexLines:t,fragmentLines:n}}var F_=Sl;function l2(e){this._autoDestroy=e?.autoDestroy??!0,this._canvas=document.createElement("canvas"),this._context=new qE(this._canvas,Ze(e?.contextOptions)),this._canvases=[]}l2.prototype.createSceneContext=function(e){let t=e.getContext("2d",{alpha:!0}),n=this;n._canvases.push(e);let i=!1,r=function(){i=!0;let c=n._canvases.indexOf(e);c!==-1&&(n._canvases.splice(c,1),n._autoDestroy&&n._canvases.length===0&&n.destroy())},o=function(){let c=n._context.canvas,u=this.drawingBufferWidth;c.width<u&&(c.width=u);let f=this.drawingBufferHeight;c.height<f&&(c.height=f)},s=function(){let c=this.drawingBufferWidth,u=this.drawingBufferHeight,f=n._context.canvas.height-u;t.drawImage(n._context.canvas,0,f,c,u,0,0,c,u),n._context.endFrame()};return new Proxy(this._context,{get(c,u,f){if(u==="isDestroyed")return function(){return i};switch(u){case"_canvas":return e;case"destroy":return r;case"drawingBufferWidth":return e.width;case"drawingBufferHeight":return e.height;case"beginFrame":return o;case"endFrame":return s;default:return Reflect.get(c,u,f)}}})};l2.prototype.destroy=function(){this._context.destroy(),le(this)};l2.prototype.isDestroyed=function(){return!1};var u2=l2;function Db(e){e=e??H.EMPTY_OBJECT;let t=e.context;if(!t._webgl2)throw new pe("A WebGL 2 context is required to use Sync operations.");let n=t._gl,i=n.fenceSync(te.SYNC_GPU_COMMANDS_COMPLETE,0);this._gl=n,this._sync=i}Db.create=function(e){return new Db(e)};Db.prototype.getStatus=function(){return this._gl.getSyncParameter(this._sync,te.SYNC_STATUS)};Db.prototype.isDestroyed=function(){return!1};Db.prototype.destroy=function(){return this._gl.deleteSync(this._sync),le(this)};Db.prototype.waitForSignal=async function(e,t){let n=this;t=t??10;function i(r,o,s){return()=>{n.getStatus()===te.SIGNALED?r():s<=0?o(new oe("Wait for signal timeout")):e(i(r,o,s-1))}}return new Promise((r,o)=>{e(i(r,o,t))})};var f2=Db;function B_(e){e=e??H.EMPTY_OBJECT;let{context:t,source:n,pixelFormat:i=$e.RGBA,pixelDatatype:r=ze.UNSIGNED_BYTE,flipY:o=!0,skipColorSpaceConversion:s=!1,sampler:a=new Ht}=e;if(!t.webgl2&&!l(t.options.getWebGLStub))throw new pe("WebGL1 does not support texture3D. Please use a WebGL2 context.");let{width:c,height:u,depth:f}=e;l(n)&&(l(c)||(c=n.width),l(u)||(u=n.height),l(f)||(f=n.depth));let d=e.preMultiplyAlpha||i===$e.RGB||i===$e.LUMINANCE,p=$e.toInternalFormat(i,r,t),g=$e.isCompressedFormat(p),m=t._gl,y=$e.texture3DSizeInBytes(i,r,c,u,f);if(this._id=e.id??Kn(),this._context=t,this._textureFilterAnisotropic=t._textureFilterAnisotropic,this._textureTarget=m.TEXTURE_3D,this._texture=m.createTexture(),this._internalFormat=p,this._pixelFormat=i,this._pixelDatatype=r,this._width=c,this._height=u,this._depth=f,this._dimensions=new h(c,u,f),this._hasMipmap=!1,this._sizeInBytes=y,this._preMultiplyAlpha=d,this._flipY=o,this._initialized=!1,this._sampler=void 0,this._sampler=a,gfe(this,a),m.activeTexture(m.TEXTURE0),m.bindTexture(this._textureTarget,this._texture),l(n)){if(s?m.pixelStorei(m.UNPACK_COLORSPACE_CONVERSION_WEBGL,m.NONE):m.pixelStorei(m.UNPACK_COLORSPACE_CONVERSION_WEBGL,m.BROWSER_DEFAULT_WEBGL),!l(n.arrayBufferView))throw new pe("For Texture3D, options.source.arrayBufferView must be defined");mfe(this,n),this._initialized=!0}else pfe(this);m.bindTexture(this._textureTarget,null)}function mfe(e,t){let n=e._context,i=n._gl,r=e._textureTarget,o=e._internalFormat,{width:s,height:a,depth:c,pixelFormat:u,pixelDatatype:f,flipY:d}=e,p=$e.alignmentInBytes(u,f,s);i.pixelStorei(i.UNPACK_ALIGNMENT,p),i.pixelStorei(i.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!1),i.pixelStorei(i.UNPACK_FLIP_Y_WEBGL,!1);let{arrayBufferView:g}=t;d&&console.warn("texture3D.flipY is not supported.");let m=1;if(t.mipLevels&&t.mipLevels.length&&(m=t.mipLevels.length+1),i.texStorage3D(r,m,o,s,a,c),i.texSubImage3D(r,0,0,0,0,s,a,c,u,ze.toWebGLConstant(f,n),g),m>1){let y=s,A=a,b=c;for(let x=0;x<t.mipLevels.length;++x)y=_X(y),A=_X(A),b=_X(b),i.texSubImage3D(r,x+1,0,0,0,y,A,b,u,ze.toWebGLConstant(f,n),t.mipLevels[x])}}B_.prototype.copyFrom=function(e){e=e??H.EMPTY_OBJECT;let{source:t,xOffset:n=0,yOffset:i=0,zOffset:r=0}=e,s=this._context._gl,a=this._textureTarget;s.activeTexture(s.TEXTURE0),s.bindTexture(a,this._texture);let{width:c,height:u,depth:f}=t,d=!1;this._initialized||(n===0&&i===0&&r===0&&c===this._width&&u===this._height&&f===this._depth?(mfe(this,t),d=!0):(s.pixelStorei(s.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!1),s.pixelStorei(s.UNPACK_FLIP_Y_WEBGL,!1),pfe(this)),this._initialized=!0),d||i6e(this,t.arrayBufferView,n,i,r,c,u,f),s.bindTexture(a,null)};function i6e(e,t,n,i,r,o,s,a){let c=e._context,u=c._gl,{pixelFormat:f,pixelDatatype:d}=e,p=$e.alignmentInBytes(f,d,o);u.pixelStorei(u.UNPACK_ALIGNMENT,p),u.pixelStorei(u.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!1),u.pixelStorei(u.UNPACK_FLIP_Y_WEBGL,!1),u.texSubImage3D(e._textureTarget,0,n,i,r,o,s,a,f,ze.toWebGLConstant(d,c),t)}function _X(e){let t=Math.floor(e/2)|0;return Math.max(t,1)}function pfe(e){let t=e._context;t._gl.texImage3D(e._textureTarget,0,e._internalFormat,e._width,e._height,e._depth,0,e._pixelFormat,ze.toWebGLConstant(e._pixelDatatype,t),null)}B_.create=function(e){return new B_(e)};Object.defineProperties(B_.prototype,{id:{get:function(){return this._id}},sampler:{get:function(){return this._sampler},set:function(e){gfe(this,e),this._sampler=e}},pixelFormat:{get:function(){return this._pixelFormat}},pixelDatatype:{get:function(){return this._pixelDatatype}},dimensions:{get:function(){return this._dimensions}},preMultiplyAlpha:{get:function(){return this._preMultiplyAlpha}},flipY:{get:function(){return this._flipY}},width:{get:function(){return this._width}},height:{get:function(){return this._height}},depth:{get:function(){return this._depth}},sizeInBytes:{get:function(){return this._hasMipmap?Math.floor(this._sizeInBytes*8/7):this._sizeInBytes}},_target:{get:function(){return this._textureTarget}}});function gfe(e,t){let{minificationFilter:n,magnificationFilter:i}=t,r=[Wt.NEAREST_MIPMAP_NEAREST,Wt.NEAREST_MIPMAP_LINEAR,Wt.LINEAR_MIPMAP_NEAREST,Wt.LINEAR_MIPMAP_LINEAR].includes(n),o=e._context,s=e._pixelFormat,a=e._pixelDatatype;(a===ze.FLOAT&&!o.textureFloatLinear||a===ze.HALF_FLOAT&&!o.textureHalfFloatLinear)&&(n=r?Wt.NEAREST_MIPMAP_NEAREST:Wt.NEAREST,i=Jn.NEAREST),$e.isDepthFormat(s)&&(n=Wt.NEAREST,i=Jn.NEAREST);let c=o._gl,u=e._textureTarget;c.activeTexture(c.TEXTURE0),c.bindTexture(u,e._texture),c.texParameteri(u,c.TEXTURE_MIN_FILTER,n),c.texParameteri(u,c.TEXTURE_MAG_FILTER,i),c.texParameteri(u,c.TEXTURE_WRAP_R,t.wrapR),c.texParameteri(u,c.TEXTURE_WRAP_S,t.wrapS),c.texParameteri(u,c.TEXTURE_WRAP_T,t.wrapT),l(e._textureFilterAnisotropic)&&c.texParameteri(u,e._textureFilterAnisotropic.TEXTURE_MAX_ANISOTROPY_EXT,t.maximumAnisotropy),c.bindTexture(u,null)}B_.prototype.generateMipmap=function(e){e=e??yh.DONT_CARE,this._hasMipmap=!0;let t=this._context._gl,n=this._textureTarget;t.hint(t.GENERATE_MIPMAP_HINT,e),t.activeTexture(t.TEXTURE0),t.bindTexture(n,this._texture),t.generateMipmap(n),t.bindTexture(n,null)};B_.prototype.isDestroyed=function(){return!1};B_.prototype.destroy=function(){return this._context._gl.deleteTexture(this._texture),le(this)};var d2=B_;function cP({x:e,y:t,width:n,height:i}){this.rectangle=new et(e,t,n,i),this.childNode1=void 0,this.childNode2=void 0,this.index=void 0}function yX({width:e,height:t,borderPadding:n}){this._width=e,this._height=t,this._borderPadding=n,this._root=new cP({x:n,y:n,width:e-2*n,height:t-2*n})}yX.prototype.pack=function(e,{width:t,height:n}){let i=this._findNode(this._root,{width:t,height:n});if(l(i))return i.index=e,i};yX.prototype._findNode=function(e,{width:t,height:n}){if(l(e)){if(!l(e.childNode1)&&!l(e.childNode2)){if(l(e.index))return;let{rectangle:i}=e,r=i.width,o=i.height,s=r-t,a=o-n;if(s<0||a<0)return;if(s===0&&a===0)return e;let c=this._borderPadding;if(s>a){e.childNode1=new cP({x:i.x,y:i.y,width:t,height:o});let f=s-c;return f>0&&(e.childNode2=new cP({x:i.x+t+c,y:i.y,width:f,height:o})),this._findNode(e.childNode1,{width:t,height:n})}e.childNode1=new cP({x:i.x,y:i.y,width:r,height:n});let u=a-c;return u>0&&(e.childNode2=new cP({x:i.x,y:i.y+n+c,width:r,height:u})),this._findNode(e.childNode1,{width:t,height:n})}return this._findNode(e.childNode1,{width:t,height:n})||this._findNode(e.childNode2,{width:t,height:n})}};var lP=yX;var _fe=16;function wl(e){e=e??H.EMPTY_OBJECT;let t=e.borderWidthInPixels??1,n=e.initialSize??new U(_fe,_fe);this._pixelFormat=e.pixelFormat??$e.RGBA,this._sampler=e.sampler,this._borderWidthInPixels=t,this._initialSize=n,this._texturePacker=void 0,this._rectangles=[],this._subRegions=new Map,this._guid=Kn(),this._imagesToAddQueue=[],this._indexById=new Map,this._indexPromiseById=new Map,this._nextIndex=0}Object.defineProperties(wl.prototype,{borderWidthInPixels:{get:function(){return this._borderWidthInPixels}},rectangles:{get:function(){return this._rectangles}},texture:{get:function(){return this._texture}},pixelFormat:{get:function(){return this._pixelFormat}},sampler:{get:function(){return this._sampler}},numberOfImages:{get:function(){return this._nextIndex}},guid:{get:function(){return this._guid}},sizeInBytes:{get:function(){return l(this._texture)?this._texture.sizeInBytes:0}}});wl.prototype.computeTextureCoordinates=function(e,t){let n=this._texture,i=this._rectangles[e];if(l(t)||(t=new et),!l(i))return t.x=0,t.y=0,t.width=0,t.height=0,t;let r=n.width,o=n.height,s=i.width,a=i.height,c=i.x,u=i.y,f=this._subRegions.get(e);if(l(f)){let d=this._rectangles[f];c+=d.x,u+=d.y}return t.x=c/r,t.y=u/o,t.width=s/r,t.height=a/o,t};wl.prototype._copyFromTexture=function(e,t,n,i){let r=this._pixelFormat,o=this._sampler,s=new Dt({context:e,height:n,width:t,pixelFormat:r,sampler:o}),a=e._gl,c=s._textureTarget,u=this._texture,f=new vs({context:e,colorTextures:[u],destroyAttachments:!1});a.activeTexture(a.TEXTURE0),a.bindTexture(c,s._texture),f._bind();let d=this.rectangles,p=this._subRegions;for(let g=0;g<d.length;++g){let m=i[g],y=d[g];if(!l(m)||!l(y)||l(p.get(g)))continue;let{x:A,y:b,width:x,height:T}=m;a.copyTexSubImage2D(c,0,A,b,y.x,y.y,x,T)}return a.bindTexture(c,null),s._initialized=!0,f._unBind(),f.destroy(),s};wl.prototype._resize=function(e,t=0){let n=this._borderWidthInPixels,i=this._rectangles,r=this._imagesToAddQueue,o=this._texture,s=o.width,a=o.height,c=this._subRegions,u=i.map((A,b)=>new yfe({index:b,image:A})).filter((A,b)=>l(A.image)&&!l(c.get(b))),f=0,d=0,p=0;for(let A=t;A<r.length;++A){let{width:b,height:x}=r[A].image;f=Math.max(f,b),d=Math.max(d,x),p+=b*x,u.push(r[A])}for(s=P.nextPowerOfTwo(Math.max(f,s)),a=P.nextPowerOfTwo(Math.max(d,a));p>=s*a;)s>a?a*=2:s*=2;u.sort(({image:A},{image:b})=>b.height*b.width-A.height*A.width);let g=new Array(this._nextIndex);for(let A of this._subRegions.keys())l(c.get(A))&&(g[A]=i[A]);let m,y=!1;for(;!y;){m=new lP({height:a,width:s,borderPadding:n});let A;for(A=0;A<u.length;++A){let{index:b,image:x}=u[A];if(!l(x))continue;let T=m.pack(b,x);if(!l(T)){s>a?a*=2:s*=2;break}g[b]=T.rectangle}y=A===u.length}this._texturePacker=m,this._texture=this._copyFromTexture(e,s,a,g),o.destroy(),this._rectangles=g,this._guid=Kn()};wl.prototype.getImageIndex=function(e){return this._indexById.get(e)};wl.prototype._copyImageToTexture=function({index:e,image:t,resolve:n,reject:i}){let r=this._texture,o=this._rectangles[e];try{r.copyFrom({source:t,xOffset:o.x,yOffset:o.y}),l(n)&&n(e)}catch(s){if(l(i)){i(s);return}}};function yfe({index:e,image:t,resolve:n,reject:i}){this.index=e,this.image=t,this.resolve=n,this.reject=i,this.rectangle=void 0}wl.prototype._addImage=function(e,t){return new Promise((n,i)=>{this._imagesToAddQueue.push(new yfe({index:e,image:t,resolve:n,reject:i})),this._imagesToAddQueue.sort(({image:r},{image:o})=>o.height*o.width-r.height*r.width)})};wl.prototype._processImageQueue=function(e){let t=this._imagesToAddQueue;if(t.length===0)return!1;this._rectangles.length=this._nextIndex;let n,i;for(n=0;n<t.length;++n){let r=t[n],{image:o,index:s}=r,a=this._texturePacker.pack(s,o);if(!l(a)){try{this._resize(e,n)}catch(c){i=c,l(r.reject)&&r.reject(i)}break}this._rectangles[s]=a.rectangle}if(l(i)){for(n=n+1;n<t.length;++n){let{resolve:r}=t[n];l(r)&&r(-1)}return t.length=0,!1}for(let r=0;r<t.length;++r)this._copyImageToTexture(t[r]);return t.length=0,!0};wl.prototype.update=function(e){if(!l(this._texture)){let t=this._initialSize.x,n=this._initialSize.y,i=this._pixelFormat,r=this._sampler,o=this._borderWidthInPixels;this._texture=new Dt({context:e,width:t,height:n,pixelFormat:i,sampler:r}),this._texturePacker=new lP({height:n,width:t,borderPadding:o})}return this._processImageQueue(e)};async function r6e(e,t){return typeof e=="function"&&(e=e(t)),(typeof e=="string"||e instanceof De)&&(e=De.createIfNeeded(e).fetchImage()),e}wl.prototype.addImage=function(e,t,n,i){let r=this._indexPromiseById.get(e),o=this._indexById.get(e);return l(r)?r:l(o)?o:(o=this._nextIndex++,this._indexById.set(e,o),r=(async()=>{let a=await r6e(t,e);if(this.isDestroyed()||!l(a))return this._indexPromiseById.delete(e),-1;l(n)&&(a.width=n),l(i)&&(a.height=i);let c=await this._addImage(o,a);return this._indexPromiseById.delete(e),c})(),this._indexPromiseById.set(e,r),r)};wl.prototype.getCachedImageSubRegion=function(e,t,n){let i=this._indexPromiseById.get(e);for(let[r,o]of this._subRegions.entries())if(n===o&&this._rectangles[r].equals(t))return i?i.then(a=>a===-1?-1:r):r};wl.prototype.addImageSubRegion=function(e,t){let n=this._indexById.get(e);if(!l(n))throw new oe(`image with id "${e}" not found in the atlas.`);let i=this.getCachedImageSubRegion(e,t,n);return l(i)?i:(i=this._nextIndex++,this._subRegions.set(i,n),this._rectangles[i]=t.clone(),(this._indexPromiseById.get(e)??Promise.resolve(n)).then(o=>{if(o===-1)return-1;let s=this._rectangles[o];return i}))};wl.prototype.isDestroyed=function(){return!1};wl.prototype.destroy=function(){return this._texture=this._texture&&this._texture.destroy(),this._imagesToAddQueue.forEach(({resolve:e})=>{l(e)&&e(-1)}),le(this)};var XE=wl;function wa(e,t,n,i){let r=wa._verifyAttributes(t);n=n??0;let o=[],s={},a,c,u=r.length;for(let d=0;d<u;++d){let p=r[d];if(p.vertexBuffer){o.push(p);continue}c=p.usage,a=s[c],l(a)||(a=s[c]=[]),a.push(p)}function f(d,p){return Y.getSizeInBytes(p.componentDatatype)-Y.getSizeInBytes(d.componentDatatype)}this._allBuffers=[];for(c in s)if(s.hasOwnProperty(c)){a=s[c],a.sort(f);let d=wa._vertexSizeInBytes(a),p=a[0].usage,g={vertexSizeInBytes:d,vertexBuffer:void 0,usage:p,needsCommit:!1,arrayBuffer:void 0,arrayViews:wa._createArrayViews(a,d)};this._allBuffers.push(g)}this._size=0,this._instanced=i??!1,this._precreated=o,this._context=e,this.writers=void 0,this.va=void 0,this.resize(n)}wa._verifyAttributes=function(e){let t=[];for(let i=0;i<e.length;++i){let r=e[i],o={index:r.index??i,enabled:r.enabled??!0,componentsPerAttribute:r.componentsPerAttribute,componentDatatype:r.componentDatatype??Y.FLOAT,normalize:r.normalize??!1,vertexBuffer:r.vertexBuffer,usage:r.usage??Me.STATIC_DRAW};t.push(o)}let n=new Array(t.length);for(let i=0;i<t.length;++i){let o=t[i].index;n[o]=!0}return t};wa._vertexSizeInBytes=function(e){let t=0,n=e.length;for(let s=0;s<n;++s){let a=e[s];t+=a.componentsPerAttribute*Y.getSizeInBytes(a.componentDatatype)}let i=n>0?Y.getSizeInBytes(e[0].componentDatatype):0,r=i>0?t%i:0,o=r===0?0:i-r;return t+=o,t};wa._createArrayViews=function(e,t){let n=[],i=0,r=e.length;for(let o=0;o<r;++o){let s=e[o],a=s.componentDatatype;n.push({index:s.index,enabled:s.enabled,componentsPerAttribute:s.componentsPerAttribute,componentDatatype:a,normalize:s.normalize,offsetInBytes:i,vertexSizeInComponentType:t/Y.getSizeInBytes(a),view:void 0}),i+=s.componentsPerAttribute*Y.getSizeInBytes(a)}return n};wa.prototype.resize=function(e){this._size=e;let t=this._allBuffers;this.writers=[];for(let n=0,i=t.length;n<i;++n){let r=t[n];wa._resize(r,this._size),wa._appendWriters(this.writers,r)}AX(this)};wa._resize=function(e,t){if(e.vertexSizeInBytes>0){let n=new ArrayBuffer(t*e.vertexSizeInBytes);if(l(e.arrayBuffer)){let o=new Uint8Array(n),s=new Uint8Array(e.arrayBuffer),a=s.length;for(let c=0;c<a;++c)o[c]=s[c]}let i=e.arrayViews,r=i.length;for(let o=0;o<r;++o){let s=i[o];s.view=Y.createArrayBufferView(s.componentDatatype,n,s.offsetInBytes)}e.arrayBuffer=n}};var o6e=[function(e,t,n){return function(i,r){t[i*n]=r,e.needsCommit=!0}},function(e,t,n){return function(i,r,o){let s=i*n;t[s]=r,t[s+1]=o,e.needsCommit=!0}},function(e,t,n){return function(i,r,o,s){let a=i*n;t[a]=r,t[a+1]=o,t[a+2]=s,e.needsCommit=!0}},function(e,t,n){return function(i,r,o,s,a){let c=i*n;t[c]=r,t[c+1]=o,t[c+2]=s,t[c+3]=a,e.needsCommit=!0}}];wa._appendWriters=function(e,t){let n=t.arrayViews,i=n.length;for(let r=0;r<i;++r){let o=n[r];e[o.index]=o6e[o.componentsPerAttribute-1](t,o.view,o.vertexSizeInComponentType)}};wa.prototype.commit=function(e){let t=!1,n=this._allBuffers,i,r,o;for(r=0,o=n.length;r<o;++r)i=n[r],t=s6e(this,i)||t;if(t||!l(this.va)){AX(this);let s=this.va=[],a=P.SIXTY_FOUR_KILOBYTES-4,c=l(e)&&!this._instanced?Math.ceil(this._size/a):1;for(let u=0;u<c;++u){let f=[];for(r=0,o=n.length;r<o;++r){i=n[r];let d=u*(i.vertexSizeInBytes*a);wa._appendAttributes(f,i,d,this._instanced)}f=f.concat(this._precreated),s.push({va:new Vn({context:this._context,attributes:f,indexBuffer:e}),indicesCount:1.5*(u!==c-1?a:this._size%a)})}}};function s6e(e,t){if(t.needsCommit&&t.vertexSizeInBytes>0){t.needsCommit=!1;let n=t.vertexBuffer,i=e._size*t.vertexSizeInBytes,r=l(n);if(!r||n.sizeInBytes<i)return r&&n.destroy(),t.vertexBuffer=tt.createVertexBuffer({context:e._context,typedArray:t.arrayBuffer,usage:t.usage}),t.vertexBuffer.vertexArrayDestroyable=!1,!0;t.vertexBuffer.copyFromArrayView(t.arrayBuffer)}return!1}wa._appendAttributes=function(e,t,n,i){let r=t.arrayViews,o=r.length;for(let s=0;s<o;++s){let a=r[s];e.push({index:a.index,enabled:a.enabled,componentsPerAttribute:a.componentsPerAttribute,componentDatatype:a.componentDatatype,normalize:a.normalize,vertexBuffer:t.vertexBuffer,offsetInBytes:n+a.offsetInBytes,strideInBytes:t.vertexSizeInBytes,instanceDivisor:i?1:0})}};wa.prototype.subCommit=function(e,t){let n=this._allBuffers;for(let i=0,r=n.length;i<r;++i)a6e(n[i],e,t)};function a6e(e,t,n){if(e.needsCommit&&e.vertexSizeInBytes>0){let i=e.vertexSizeInBytes*t,r=e.vertexSizeInBytes*n;e.vertexBuffer.copyFromArrayView(new Uint8Array(e.arrayBuffer,i,r),i)}}wa.prototype.endSubCommits=function(){let e=this._allBuffers;for(let t=0,n=e.length;t<n;++t)e[t].needsCommit=!1};function AX(e){let t=e.va;if(!l(t))return;let n=t.length;for(let i=0;i<n;++i)t[i].va.destroy();e.va=void 0}wa.prototype.isDestroyed=function(){return!1};wa.prototype.destroy=function(){let e=this._allBuffers;for(let t=0,n=e.length;t<n;++t){let i=e[t];i.vertexBuffer=i.vertexBuffer&&i.vertexBuffer.destroy()}return AX(this),le(this)};var k_=wa;var uP=`#ifdef MRT +`),a=new Xe({defines:this._fragmentShaderParts.defineLines,sources:[s]});return Qt.fromCache({context:e,vertexShaderSource:o,fragmentShaderSource:a,attributeLocations:this._attributeLocations})};Sl.prototype.clone=function(){return Ze(this,!0)};function t6e(e){let t=[],n=[],i,r=e._vertexShaderParts.structIds,o,s,a;for(i=0;i<r.length;i++)o=r[i],s=e._structs[o],a=s.generateGlslLines(),Zn(t,a);for(r=e._fragmentShaderParts.structIds,i=0;i<r.length;i++)o=r[i],s=e._structs[o],a=s.generateGlslLines(),Zn(n,a);return{vertexLines:t,fragmentLines:n}}function n6e(e){switch(e){case"mat2":return 2;case"mat3":return 3;case"mat4":return 4;default:return 1}}function i6e(e){let t=[],n=[],i,r=e._vertexShaderParts.functionIds,o,s,a;for(i=0;i<r.length;i++)o=r[i],s=e._functions[o],a=s.generateGlslLines(),Zn(t,a);for(r=e._fragmentShaderParts.functionIds,i=0;i<r.length;i++)o=r[i],s=e._functions[o],a=s.generateGlslLines(),Zn(n,a);return{vertexLines:t,fragmentLines:n}}var F_=Sl;function l2(e){this._autoDestroy=e?.autoDestroy??!0,this._canvas=document.createElement("canvas"),this._context=new qE(this._canvas,Ze(e?.contextOptions)),this._canvases=[]}l2.prototype.createSceneContext=function(e){let t=e.getContext("2d",{alpha:!0}),n=this;n._canvases.push(e);let i=!1,r=function(){i=!0;let c=n._canvases.indexOf(e);c!==-1&&(n._canvases.splice(c,1),n._autoDestroy&&n._canvases.length===0&&n.destroy())},o=function(){let c=n._context.canvas,u=this.drawingBufferWidth;c.width<u&&(c.width=u);let f=this.drawingBufferHeight;c.height<f&&(c.height=f)},s=function(){let c=this.drawingBufferWidth,u=this.drawingBufferHeight,f=n._context.canvas.height-u;t.drawImage(n._context.canvas,0,f,c,u,0,0,c,u),n._context.endFrame()};return new Proxy(this._context,{get(c,u,f){if(u==="isDestroyed")return function(){return i};switch(u){case"_canvas":return e;case"destroy":return r;case"drawingBufferWidth":return e.width;case"drawingBufferHeight":return e.height;case"beginFrame":return o;case"endFrame":return s;default:return Reflect.get(c,u,f)}}})};l2.prototype.destroy=function(){this._context.destroy(),le(this)};l2.prototype.isDestroyed=function(){return!1};var u2=l2;function Db(e){e=e??H.EMPTY_OBJECT;let t=e.context;if(!t._webgl2)throw new pe("A WebGL 2 context is required to use Sync operations.");let n=t._gl,i=n.fenceSync(te.SYNC_GPU_COMMANDS_COMPLETE,0);this._gl=n,this._sync=i}Db.create=function(e){return new Db(e)};Db.prototype.getStatus=function(){return this._gl.getSyncParameter(this._sync,te.SYNC_STATUS)};Db.prototype.isDestroyed=function(){return!1};Db.prototype.destroy=function(){return this._gl.deleteSync(this._sync),le(this)};Db.prototype.waitForSignal=async function(e,t){let n=this;t=t??10;function i(r,o,s){return()=>{n.getStatus()===te.SIGNALED?r():s<=0?o(new oe("Wait for signal timeout")):e(i(r,o,s-1))}}return new Promise((r,o)=>{e(i(r,o,t))})};var f2=Db;function B_(e){e=e??H.EMPTY_OBJECT;let{context:t,source:n,pixelFormat:i=$e.RGBA,pixelDatatype:r=ze.UNSIGNED_BYTE,flipY:o=!0,skipColorSpaceConversion:s=!1,sampler:a=new Ht}=e;if(!t.webgl2&&!l(t.options.getWebGLStub))throw new pe("WebGL1 does not support texture3D. Please use a WebGL2 context.");let{width:c,height:u,depth:f}=e;l(n)&&(l(c)||(c=n.width),l(u)||(u=n.height),l(f)||(f=n.depth));let d=e.preMultiplyAlpha||i===$e.RGB||i===$e.LUMINANCE,p=$e.toInternalFormat(i,r,t),g=$e.isCompressedFormat(p),m=t._gl,y=$e.texture3DSizeInBytes(i,r,c,u,f);if(this._id=e.id??Kn(),this._context=t,this._textureFilterAnisotropic=t._textureFilterAnisotropic,this._textureTarget=m.TEXTURE_3D,this._texture=m.createTexture(),this._internalFormat=p,this._pixelFormat=i,this._pixelDatatype=r,this._width=c,this._height=u,this._depth=f,this._dimensions=new h(c,u,f),this._hasMipmap=!1,this._sizeInBytes=y,this._preMultiplyAlpha=d,this._flipY=o,this._initialized=!1,this._sampler=void 0,this._sampler=a,gfe(this,a),m.activeTexture(m.TEXTURE0),m.bindTexture(this._textureTarget,this._texture),l(n)){if(s?m.pixelStorei(m.UNPACK_COLORSPACE_CONVERSION_WEBGL,m.NONE):m.pixelStorei(m.UNPACK_COLORSPACE_CONVERSION_WEBGL,m.BROWSER_DEFAULT_WEBGL),!l(n.arrayBufferView))throw new pe("For Texture3D, options.source.arrayBufferView must be defined");mfe(this,n),this._initialized=!0}else pfe(this);m.bindTexture(this._textureTarget,null)}function mfe(e,t){let n=e._context,i=n._gl,r=e._textureTarget,o=e._internalFormat,{width:s,height:a,depth:c,pixelFormat:u,pixelDatatype:f,flipY:d}=e,p=$e.alignmentInBytes(u,f,s);i.pixelStorei(i.UNPACK_ALIGNMENT,p),i.pixelStorei(i.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!1),i.pixelStorei(i.UNPACK_FLIP_Y_WEBGL,!1);let{arrayBufferView:g}=t;d&&console.warn("texture3D.flipY is not supported.");let m=1;if(t.mipLevels&&t.mipLevels.length&&(m=t.mipLevels.length+1),i.texStorage3D(r,m,o,s,a,c),i.texSubImage3D(r,0,0,0,0,s,a,c,u,ze.toWebGLConstant(f,n),g),m>1){let y=s,A=a,b=c;for(let x=0;x<t.mipLevels.length;++x)y=_X(y),A=_X(A),b=_X(b),i.texSubImage3D(r,x+1,0,0,0,y,A,b,u,ze.toWebGLConstant(f,n),t.mipLevels[x])}}B_.prototype.copyFrom=function(e){e=e??H.EMPTY_OBJECT;let{source:t,xOffset:n=0,yOffset:i=0,zOffset:r=0}=e,s=this._context._gl,a=this._textureTarget;s.activeTexture(s.TEXTURE0),s.bindTexture(a,this._texture);let{width:c,height:u,depth:f}=t,d=!1;this._initialized||(n===0&&i===0&&r===0&&c===this._width&&u===this._height&&f===this._depth?(mfe(this,t),d=!0):(s.pixelStorei(s.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!1),s.pixelStorei(s.UNPACK_FLIP_Y_WEBGL,!1),pfe(this)),this._initialized=!0),d||r6e(this,t.arrayBufferView,n,i,r,c,u,f),s.bindTexture(a,null)};function r6e(e,t,n,i,r,o,s,a){let c=e._context,u=c._gl,{pixelFormat:f,pixelDatatype:d}=e,p=$e.alignmentInBytes(f,d,o);u.pixelStorei(u.UNPACK_ALIGNMENT,p),u.pixelStorei(u.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!1),u.pixelStorei(u.UNPACK_FLIP_Y_WEBGL,!1),u.texSubImage3D(e._textureTarget,0,n,i,r,o,s,a,f,ze.toWebGLConstant(d,c),t)}function _X(e){let t=Math.floor(e/2)|0;return Math.max(t,1)}function pfe(e){let t=e._context;t._gl.texImage3D(e._textureTarget,0,e._internalFormat,e._width,e._height,e._depth,0,e._pixelFormat,ze.toWebGLConstant(e._pixelDatatype,t),null)}B_.create=function(e){return new B_(e)};Object.defineProperties(B_.prototype,{id:{get:function(){return this._id}},sampler:{get:function(){return this._sampler},set:function(e){gfe(this,e),this._sampler=e}},pixelFormat:{get:function(){return this._pixelFormat}},pixelDatatype:{get:function(){return this._pixelDatatype}},dimensions:{get:function(){return this._dimensions}},preMultiplyAlpha:{get:function(){return this._preMultiplyAlpha}},flipY:{get:function(){return this._flipY}},width:{get:function(){return this._width}},height:{get:function(){return this._height}},depth:{get:function(){return this._depth}},sizeInBytes:{get:function(){return this._hasMipmap?Math.floor(this._sizeInBytes*8/7):this._sizeInBytes}},_target:{get:function(){return this._textureTarget}}});function gfe(e,t){let{minificationFilter:n,magnificationFilter:i}=t,r=[Wt.NEAREST_MIPMAP_NEAREST,Wt.NEAREST_MIPMAP_LINEAR,Wt.LINEAR_MIPMAP_NEAREST,Wt.LINEAR_MIPMAP_LINEAR].includes(n),o=e._context,s=e._pixelFormat,a=e._pixelDatatype;(a===ze.FLOAT&&!o.textureFloatLinear||a===ze.HALF_FLOAT&&!o.textureHalfFloatLinear)&&(n=r?Wt.NEAREST_MIPMAP_NEAREST:Wt.NEAREST,i=Jn.NEAREST),$e.isDepthFormat(s)&&(n=Wt.NEAREST,i=Jn.NEAREST);let c=o._gl,u=e._textureTarget;c.activeTexture(c.TEXTURE0),c.bindTexture(u,e._texture),c.texParameteri(u,c.TEXTURE_MIN_FILTER,n),c.texParameteri(u,c.TEXTURE_MAG_FILTER,i),c.texParameteri(u,c.TEXTURE_WRAP_R,t.wrapR),c.texParameteri(u,c.TEXTURE_WRAP_S,t.wrapS),c.texParameteri(u,c.TEXTURE_WRAP_T,t.wrapT),l(e._textureFilterAnisotropic)&&c.texParameteri(u,e._textureFilterAnisotropic.TEXTURE_MAX_ANISOTROPY_EXT,t.maximumAnisotropy),c.bindTexture(u,null)}B_.prototype.generateMipmap=function(e){e=e??yh.DONT_CARE,this._hasMipmap=!0;let t=this._context._gl,n=this._textureTarget;t.hint(t.GENERATE_MIPMAP_HINT,e),t.activeTexture(t.TEXTURE0),t.bindTexture(n,this._texture),t.generateMipmap(n),t.bindTexture(n,null)};B_.prototype.isDestroyed=function(){return!1};B_.prototype.destroy=function(){return this._context._gl.deleteTexture(this._texture),le(this)};var d2=B_;function cP({x:e,y:t,width:n,height:i}){this.rectangle=new et(e,t,n,i),this.childNode1=void 0,this.childNode2=void 0,this.index=void 0}function yX({width:e,height:t,borderPadding:n}){this._width=e,this._height=t,this._borderPadding=n,this._root=new cP({x:n,y:n,width:e-2*n,height:t-2*n})}yX.prototype.pack=function(e,{width:t,height:n}){let i=this._findNode(this._root,{width:t,height:n});if(l(i))return i.index=e,i};yX.prototype._findNode=function(e,{width:t,height:n}){if(l(e)){if(!l(e.childNode1)&&!l(e.childNode2)){if(l(e.index))return;let{rectangle:i}=e,r=i.width,o=i.height,s=r-t,a=o-n;if(s<0||a<0)return;if(s===0&&a===0)return e;let c=this._borderPadding;if(s>a){e.childNode1=new cP({x:i.x,y:i.y,width:t,height:o});let f=s-c;return f>0&&(e.childNode2=new cP({x:i.x+t+c,y:i.y,width:f,height:o})),this._findNode(e.childNode1,{width:t,height:n})}e.childNode1=new cP({x:i.x,y:i.y,width:r,height:n});let u=a-c;return u>0&&(e.childNode2=new cP({x:i.x,y:i.y+n+c,width:r,height:u})),this._findNode(e.childNode1,{width:t,height:n})}return this._findNode(e.childNode1,{width:t,height:n})||this._findNode(e.childNode2,{width:t,height:n})}};var lP=yX;var _fe=16;function wl(e){e=e??H.EMPTY_OBJECT;let t=e.borderWidthInPixels??1,n=e.initialSize??new U(_fe,_fe);this._pixelFormat=e.pixelFormat??$e.RGBA,this._sampler=e.sampler,this._borderWidthInPixels=t,this._initialSize=n,this._texturePacker=void 0,this._rectangles=[],this._subRegions=new Map,this._guid=Kn(),this._imagesToAddQueue=[],this._indexById=new Map,this._indexPromiseById=new Map,this._nextIndex=0}Object.defineProperties(wl.prototype,{borderWidthInPixels:{get:function(){return this._borderWidthInPixels}},rectangles:{get:function(){return this._rectangles}},texture:{get:function(){return this._texture}},pixelFormat:{get:function(){return this._pixelFormat}},sampler:{get:function(){return this._sampler}},numberOfImages:{get:function(){return this._nextIndex}},guid:{get:function(){return this._guid}},sizeInBytes:{get:function(){return l(this._texture)?this._texture.sizeInBytes:0}}});wl.prototype.computeTextureCoordinates=function(e,t){let n=this._texture,i=this._rectangles[e];if(l(t)||(t=new et),!l(i))return t.x=0,t.y=0,t.width=0,t.height=0,t;let r=n.width,o=n.height,s=i.width,a=i.height,c=i.x,u=i.y,f=this._subRegions.get(e);if(l(f)){let d=this._rectangles[f];c+=d.x,u+=d.y}return t.x=c/r,t.y=u/o,t.width=s/r,t.height=a/o,t};wl.prototype._copyFromTexture=function(e,t,n,i){let r=this._pixelFormat,o=this._sampler,s=new Dt({context:e,height:n,width:t,pixelFormat:r,sampler:o}),a=e._gl,c=s._textureTarget,u=this._texture,f=new vs({context:e,colorTextures:[u],destroyAttachments:!1});a.activeTexture(a.TEXTURE0),a.bindTexture(c,s._texture),f._bind();let d=this.rectangles,p=this._subRegions;for(let g=0;g<d.length;++g){let m=i[g],y=d[g];if(!l(m)||!l(y)||l(p.get(g)))continue;let{x:A,y:b,width:x,height:T}=m;a.copyTexSubImage2D(c,0,A,b,y.x,y.y,x,T)}return a.bindTexture(c,null),s._initialized=!0,f._unBind(),f.destroy(),s};wl.prototype._resize=function(e,t=0){let n=this._borderWidthInPixels,i=this._rectangles,r=this._imagesToAddQueue,o=this._texture,s=o.width,a=o.height,c=this._subRegions,u=i.map((A,b)=>new yfe({index:b,image:A})).filter((A,b)=>l(A.image)&&!l(c.get(b))),f=0,d=0,p=0;for(let A=t;A<r.length;++A){let{width:b,height:x}=r[A].image;f=Math.max(f,b),d=Math.max(d,x),p+=b*x,u.push(r[A])}for(s=P.nextPowerOfTwo(Math.max(f,s)),a=P.nextPowerOfTwo(Math.max(d,a));p>=s*a;)s>a?a*=2:s*=2;u.sort(({image:A},{image:b})=>b.height*b.width-A.height*A.width);let g=new Array(this._nextIndex);for(let A of this._subRegions.keys())l(c.get(A))&&(g[A]=i[A]);let m,y=!1;for(;!y;){m=new lP({height:a,width:s,borderPadding:n});let A;for(A=0;A<u.length;++A){let{index:b,image:x}=u[A];if(!l(x))continue;let T=m.pack(b,x);if(!l(T)){s>a?a*=2:s*=2;break}g[b]=T.rectangle}y=A===u.length}this._texturePacker=m,this._texture=this._copyFromTexture(e,s,a,g),o.destroy(),this._rectangles=g,this._guid=Kn()};wl.prototype.getImageIndex=function(e){return this._indexById.get(e)};wl.prototype._copyImageToTexture=function({index:e,image:t,resolve:n,reject:i}){let r=this._texture,o=this._rectangles[e];try{r.copyFrom({source:t,xOffset:o.x,yOffset:o.y}),l(n)&&n(e)}catch(s){if(l(i)){i(s);return}}};function yfe({index:e,image:t,resolve:n,reject:i}){this.index=e,this.image=t,this.resolve=n,this.reject=i,this.rectangle=void 0}wl.prototype._addImage=function(e,t){return new Promise((n,i)=>{this._imagesToAddQueue.push(new yfe({index:e,image:t,resolve:n,reject:i})),this._imagesToAddQueue.sort(({image:r},{image:o})=>o.height*o.width-r.height*r.width)})};wl.prototype._processImageQueue=function(e){let t=this._imagesToAddQueue;if(t.length===0)return!1;this._rectangles.length=this._nextIndex;let n,i;for(n=0;n<t.length;++n){let r=t[n],{image:o,index:s}=r,a=this._texturePacker.pack(s,o);if(!l(a)){try{this._resize(e,n)}catch(c){i=c,l(r.reject)&&r.reject(i)}break}this._rectangles[s]=a.rectangle}if(l(i)){for(n=n+1;n<t.length;++n){let{resolve:r}=t[n];l(r)&&r(-1)}return t.length=0,!1}for(let r=0;r<t.length;++r)this._copyImageToTexture(t[r]);return t.length=0,!0};wl.prototype.update=function(e){if(!l(this._texture)){let t=this._initialSize.x,n=this._initialSize.y,i=this._pixelFormat,r=this._sampler,o=this._borderWidthInPixels;this._texture=new Dt({context:e,width:t,height:n,pixelFormat:i,sampler:r}),this._texturePacker=new lP({height:n,width:t,borderPadding:o})}return this._processImageQueue(e)};async function o6e(e,t){return typeof e=="function"&&(e=e(t)),(typeof e=="string"||e instanceof De)&&(e=De.createIfNeeded(e).fetchImage()),e}wl.prototype.addImage=function(e,t,n,i){let r=this._indexPromiseById.get(e),o=this._indexById.get(e);return l(r)?r:l(o)?o:(o=this._nextIndex++,this._indexById.set(e,o),r=(async()=>{let a=await o6e(t,e);if(this.isDestroyed()||!l(a))return this._indexPromiseById.delete(e),-1;l(n)&&(a.width=n),l(i)&&(a.height=i);let c=await this._addImage(o,a);return this._indexPromiseById.delete(e),c})(),this._indexPromiseById.set(e,r),r)};wl.prototype.getCachedImageSubRegion=function(e,t,n){let i=this._indexPromiseById.get(e);for(let[r,o]of this._subRegions.entries())if(n===o&&this._rectangles[r].equals(t))return i?i.then(a=>a===-1?-1:r):r};wl.prototype.addImageSubRegion=function(e,t){let n=this._indexById.get(e);if(!l(n))throw new oe(`image with id "${e}" not found in the atlas.`);let i=this.getCachedImageSubRegion(e,t,n);return l(i)?i:(i=this._nextIndex++,this._subRegions.set(i,n),this._rectangles[i]=t.clone(),(this._indexPromiseById.get(e)??Promise.resolve(n)).then(o=>{if(o===-1)return-1;let s=this._rectangles[o];return i}))};wl.prototype.isDestroyed=function(){return!1};wl.prototype.destroy=function(){return this._texture=this._texture&&this._texture.destroy(),this._imagesToAddQueue.forEach(({resolve:e})=>{l(e)&&e(-1)}),le(this)};var XE=wl;function wa(e,t,n,i){let r=wa._verifyAttributes(t);n=n??0;let o=[],s={},a,c,u=r.length;for(let d=0;d<u;++d){let p=r[d];if(p.vertexBuffer){o.push(p);continue}c=p.usage,a=s[c],l(a)||(a=s[c]=[]),a.push(p)}function f(d,p){return Y.getSizeInBytes(p.componentDatatype)-Y.getSizeInBytes(d.componentDatatype)}this._allBuffers=[];for(c in s)if(s.hasOwnProperty(c)){a=s[c],a.sort(f);let d=wa._vertexSizeInBytes(a),p=a[0].usage,g={vertexSizeInBytes:d,vertexBuffer:void 0,usage:p,needsCommit:!1,arrayBuffer:void 0,arrayViews:wa._createArrayViews(a,d)};this._allBuffers.push(g)}this._size=0,this._instanced=i??!1,this._precreated=o,this._context=e,this.writers=void 0,this.va=void 0,this.resize(n)}wa._verifyAttributes=function(e){let t=[];for(let i=0;i<e.length;++i){let r=e[i],o={index:r.index??i,enabled:r.enabled??!0,componentsPerAttribute:r.componentsPerAttribute,componentDatatype:r.componentDatatype??Y.FLOAT,normalize:r.normalize??!1,vertexBuffer:r.vertexBuffer,usage:r.usage??Me.STATIC_DRAW};t.push(o)}let n=new Array(t.length);for(let i=0;i<t.length;++i){let o=t[i].index;n[o]=!0}return t};wa._vertexSizeInBytes=function(e){let t=0,n=e.length;for(let s=0;s<n;++s){let a=e[s];t+=a.componentsPerAttribute*Y.getSizeInBytes(a.componentDatatype)}let i=n>0?Y.getSizeInBytes(e[0].componentDatatype):0,r=i>0?t%i:0,o=r===0?0:i-r;return t+=o,t};wa._createArrayViews=function(e,t){let n=[],i=0,r=e.length;for(let o=0;o<r;++o){let s=e[o],a=s.componentDatatype;n.push({index:s.index,enabled:s.enabled,componentsPerAttribute:s.componentsPerAttribute,componentDatatype:a,normalize:s.normalize,offsetInBytes:i,vertexSizeInComponentType:t/Y.getSizeInBytes(a),view:void 0}),i+=s.componentsPerAttribute*Y.getSizeInBytes(a)}return n};wa.prototype.resize=function(e){this._size=e;let t=this._allBuffers;this.writers=[];for(let n=0,i=t.length;n<i;++n){let r=t[n];wa._resize(r,this._size),wa._appendWriters(this.writers,r)}AX(this)};wa._resize=function(e,t){if(e.vertexSizeInBytes>0){let n=new ArrayBuffer(t*e.vertexSizeInBytes);if(l(e.arrayBuffer)){let o=new Uint8Array(n),s=new Uint8Array(e.arrayBuffer),a=s.length;for(let c=0;c<a;++c)o[c]=s[c]}let i=e.arrayViews,r=i.length;for(let o=0;o<r;++o){let s=i[o];s.view=Y.createArrayBufferView(s.componentDatatype,n,s.offsetInBytes)}e.arrayBuffer=n}};var s6e=[function(e,t,n){return function(i,r){t[i*n]=r,e.needsCommit=!0}},function(e,t,n){return function(i,r,o){let s=i*n;t[s]=r,t[s+1]=o,e.needsCommit=!0}},function(e,t,n){return function(i,r,o,s){let a=i*n;t[a]=r,t[a+1]=o,t[a+2]=s,e.needsCommit=!0}},function(e,t,n){return function(i,r,o,s,a){let c=i*n;t[c]=r,t[c+1]=o,t[c+2]=s,t[c+3]=a,e.needsCommit=!0}}];wa._appendWriters=function(e,t){let n=t.arrayViews,i=n.length;for(let r=0;r<i;++r){let o=n[r];e[o.index]=s6e[o.componentsPerAttribute-1](t,o.view,o.vertexSizeInComponentType)}};wa.prototype.commit=function(e){let t=!1,n=this._allBuffers,i,r,o;for(r=0,o=n.length;r<o;++r)i=n[r],t=a6e(this,i)||t;if(t||!l(this.va)){AX(this);let s=this.va=[],a=P.SIXTY_FOUR_KILOBYTES-4,c=l(e)&&!this._instanced?Math.ceil(this._size/a):1;for(let u=0;u<c;++u){let f=[];for(r=0,o=n.length;r<o;++r){i=n[r];let d=u*(i.vertexSizeInBytes*a);wa._appendAttributes(f,i,d,this._instanced)}f=f.concat(this._precreated),s.push({va:new Vn({context:this._context,attributes:f,indexBuffer:e}),indicesCount:1.5*(u!==c-1?a:this._size%a)})}}};function a6e(e,t){if(t.needsCommit&&t.vertexSizeInBytes>0){t.needsCommit=!1;let n=t.vertexBuffer,i=e._size*t.vertexSizeInBytes,r=l(n);if(!r||n.sizeInBytes<i)return r&&n.destroy(),t.vertexBuffer=tt.createVertexBuffer({context:e._context,typedArray:t.arrayBuffer,usage:t.usage}),t.vertexBuffer.vertexArrayDestroyable=!1,!0;t.vertexBuffer.copyFromArrayView(t.arrayBuffer)}return!1}wa._appendAttributes=function(e,t,n,i){let r=t.arrayViews,o=r.length;for(let s=0;s<o;++s){let a=r[s];e.push({index:a.index,enabled:a.enabled,componentsPerAttribute:a.componentsPerAttribute,componentDatatype:a.componentDatatype,normalize:a.normalize,vertexBuffer:t.vertexBuffer,offsetInBytes:n+a.offsetInBytes,strideInBytes:t.vertexSizeInBytes,instanceDivisor:i?1:0})}};wa.prototype.subCommit=function(e,t){let n=this._allBuffers;for(let i=0,r=n.length;i<r;++i)c6e(n[i],e,t)};function c6e(e,t,n){if(e.needsCommit&&e.vertexSizeInBytes>0){let i=e.vertexSizeInBytes*t,r=e.vertexSizeInBytes*n;e.vertexBuffer.copyFromArrayView(new Uint8Array(e.arrayBuffer,i,r),i)}}wa.prototype.endSubCommits=function(){let e=this._allBuffers;for(let t=0,n=e.length;t<n;++t)e[t].needsCommit=!1};function AX(e){let t=e.va;if(!l(t))return;let n=t.length;for(let i=0;i<n;++i)t[i].va.destroy();e.va=void 0}wa.prototype.isDestroyed=function(){return!1};wa.prototype.destroy=function(){let e=this._allBuffers;for(let t=0,n=e.length;t<n;++t){let i=e[t];i.vertexBuffer=i.vertexBuffer&&i.vertexBuffer.destroy()}return AX(this),le(this)};var k_=wa;var uP=`#ifdef MRT layout (location = 0) out vec4 out_FragData_0; layout (location = 1) out vec4 out_FragData_1; #else @@ -6122,124 +6122,67 @@ materialInput.normalEC = vec3(0.0, 0.0, -1.0); czm_material material = czm_getMaterial(materialInput); out_FragColor = vec4(material.diffuse + material.emission, material.alpha); } -`;function z_(e){this._value=void 0,this._hasClone=!1,this._hasEquals=!1,this._definitionChanged=new be,this.setValue(e)}Object.defineProperties(z_.prototype,{isConstant:{value:!0},definitionChanged:{get:function(){return this._definitionChanged}}});z_.prototype.getValue=function(e,t){return this._hasClone?this._value.clone(t):this._value};z_.prototype.setValue=function(e){let t=this._value;if(t!==e){let n=l(e),i=n&&typeof e.clone=="function",r=n&&typeof e.equals=="function";(!r||!e.equals(t))&&(this._hasClone=i,this._hasEquals=r,this._value=i?e.clone(this._value):e,this._definitionChanged.raiseEvent(this))}};z_.prototype.equals=function(e){return this===e||e instanceof z_&&(!this._hasEquals&&this._value===e._value||this._hasEquals&&this._value.equals(e._value))};z_.prototype.valueOf=function(){return this._value};z_.prototype.toString=function(){return String(this._value)};var hi=z_;function c6e(e,t,n,i,r){return{configurable:i,get:function(){return this[t]},set:function(o){let s=this[t],a=this[n];l(a)&&(a(),this[n]=void 0),o!==void 0&&(!l(o)||!l(o.getValue))&&l(r)&&(o=r(o)),s!==o&&(this[t]=o,this._definitionChanged.raiseEvent(this,e,o,s)),l(o)&&l(o.definitionChanged)&&(this[n]=o.definitionChanged.addEventListener(function(){this._definitionChanged.raiseEvent(this,e,o,o)},this))}}}function l6e(e){return new hi(e)}function u6e(e,t,n){return c6e(e,`_${e.toString()}`,`_${e.toString()}Subscription`,t??!1,n??l6e)}var me=u6e;function _P(e){this._definitionChanged=new be,this._show=void 0,this._showSubscription=void 0,this._image=void 0,this._imageSubscription=void 0,this._scale=void 0,this._scaleSubscription=void 0,this._pixelOffset=void 0,this._pixelOffsetSubscription=void 0,this._eyeOffset=void 0,this._eyeOffsetSubscription=void 0,this._horizontalOrigin=void 0,this._horizontalOriginSubscription=void 0,this._verticalOrigin=void 0,this._verticalOriginSubscription=void 0,this._heightReference=void 0,this._heightReferenceSubscription=void 0,this._color=void 0,this._colorSubscription=void 0,this._rotation=void 0,this._rotationSubscription=void 0,this._alignedAxis=void 0,this._alignedAxisSubscription=void 0,this._sizeInMeters=void 0,this._sizeInMetersSubscription=void 0,this._width=void 0,this._widthSubscription=void 0,this._height=void 0,this._heightSubscription=void 0,this._scaleByDistance=void 0,this._scaleByDistanceSubscription=void 0,this._translucencyByDistance=void 0,this._translucencyByDistanceSubscription=void 0,this._pixelOffsetScaleByDistance=void 0,this._pixelOffsetScaleByDistanceSubscription=void 0,this._imageSubRegion=void 0,this._imageSubRegionSubscription=void 0,this._distanceDisplayCondition=void 0,this._distanceDisplayConditionSubscription=void 0,this._disableDepthTestDistance=void 0,this._disableDepthTestDistanceSubscription=void 0,this._splitDirection=void 0,this._splitDirectionSubscription=void 0,this.merge(e??H.EMPTY_OBJECT)}Object.defineProperties(_P.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:me("show"),image:me("image"),scale:me("scale"),pixelOffset:me("pixelOffset"),eyeOffset:me("eyeOffset"),horizontalOrigin:me("horizontalOrigin"),verticalOrigin:me("verticalOrigin"),heightReference:me("heightReference"),color:me("color"),rotation:me("rotation"),alignedAxis:me("alignedAxis"),sizeInMeters:me("sizeInMeters"),width:me("width"),height:me("height"),scaleByDistance:me("scaleByDistance"),translucencyByDistance:me("translucencyByDistance"),pixelOffsetScaleByDistance:me("pixelOffsetScaleByDistance"),imageSubRegion:me("imageSubRegion"),distanceDisplayCondition:me("distanceDisplayCondition"),disableDepthTestDistance:me("disableDepthTestDistance"),splitDirection:me("splitDirection")});_P.prototype.clone=function(e){return l(e)?(e.show=this._show,e.image=this._image,e.scale=this._scale,e.pixelOffset=this._pixelOffset,e.eyeOffset=this._eyeOffset,e.horizontalOrigin=this._horizontalOrigin,e.verticalOrigin=this._verticalOrigin,e.heightReference=this._heightReference,e.color=this._color,e.rotation=this._rotation,e.alignedAxis=this._alignedAxis,e.sizeInMeters=this._sizeInMeters,e.width=this._width,e.height=this._height,e.scaleByDistance=this._scaleByDistance,e.translucencyByDistance=this._translucencyByDistance,e.pixelOffsetScaleByDistance=this._pixelOffsetScaleByDistance,e.imageSubRegion=this._imageSubRegion,e.distanceDisplayCondition=this._distanceDisplayCondition,e.disableDepthTestDistance=this._disableDepthTestDistance,e.splitDirection=this._splitDirection,e):new _P(this)};_P.prototype.merge=function(e){this.show=this._show??e.show,this.image=this._image??e.image,this.scale=this._scale??e.scale,this.pixelOffset=this._pixelOffset??e.pixelOffset,this.eyeOffset=this._eyeOffset??e.eyeOffset,this.horizontalOrigin=this._horizontalOrigin??e.horizontalOrigin,this.verticalOrigin=this._verticalOrigin??e.verticalOrigin,this.heightReference=this._heightReference??e.heightReference,this.color=this._color??e.color,this.rotation=this._rotation??e.rotation,this.alignedAxis=this._alignedAxis??e.alignedAxis,this.sizeInMeters=this._sizeInMeters??e.sizeInMeters,this.width=this._width??e.width,this.height=this._height??e.height,this.scaleByDistance=this._scaleByDistance??e.scaleByDistance,this.translucencyByDistance=this._translucencyByDistance??e.translucencyByDistance,this.pixelOffsetScaleByDistance=this._pixelOffsetScaleByDistance??e.pixelOffsetScaleByDistance,this.imageSubRegion=this._imageSubRegion??e.imageSubRegion,this.distanceDisplayCondition=this._distanceDisplayCondition??e.distanceDisplayCondition,this.disableDepthTestDistance=this._disableDepthTestDistance??e.disableDepthTestDistance,this.splitDirection=this.splitDirection??e.splitDirection};var Il=_P;var bX=class{constructor(){this._array=[],this._hash={}}get length(){return this._array.length}get values(){return this._array}contains(t){return l(this._hash[t])}set(t,n){let i=this._hash[t];n!==i&&(this.remove(t),this._hash[t]=n,this._array.push(n))}get(t){return this._hash[t]}remove(t){let n=this._hash[t],i=l(n);if(i){let r=this._array;r.splice(r.indexOf(n),1),delete this._hash[t]}return i}removeAll(){let t=this._array;t.length>0&&(this._hash={},t.length=0)}},zt=bX;function sf(e,t){e=e??0,this._near=e,t=t??Number.MAX_VALUE,this._far=t}Object.defineProperties(sf.prototype,{near:{get:function(){return this._near},set:function(e){this._near=e}},far:{get:function(){return this._far},set:function(e){this._far=e}}});sf.packedLength=2;sf.pack=function(e,t,n){return n=n??0,t[n++]=e.near,t[n]=e.far,t};sf.unpack=function(e,t,n){return t=t??0,l(n)||(n=new sf),n.near=e[t++],n.far=e[t],n};sf.equals=function(e,t){return e===t||l(e)&&l(t)&&e.near===t.near&&e.far===t.far};sf.clone=function(e,t){if(l(e))return l(t)||(t=new sf),t.near=e.near,t.far=e.far,t};sf.prototype.clone=function(e){return sf.clone(this,e)};sf.prototype.equals=function(e){return sf.equals(this,e)};var Gt=sf;function od(e,t,n,i){this.near=e??0,this.nearValue=t??0,this.far=n??1,this.farValue=i??0}od.clone=function(e,t){if(l(e))return l(t)?(t.near=e.near,t.nearValue=e.nearValue,t.far=e.far,t.farValue=e.farValue,t):new od(e.near,e.nearValue,e.far,e.farValue)};od.packedLength=4;od.pack=function(e,t,n){return n=n??0,t[n++]=e.near,t[n++]=e.nearValue,t[n++]=e.far,t[n]=e.farValue,t};od.unpack=function(e,t,n){return t=t??0,l(n)||(n=new od),n.near=e[t++],n.nearValue=e[t++],n.far=e[t++],n.farValue=e[t],n};od.equals=function(e,t){return e===t||l(e)&&l(t)&&e.near===t.near&&e.nearValue===t.nearValue&&e.far===t.far&&e.farValue===t.farValue};od.prototype.clone=function(e){return od.clone(this,e)};od.prototype.equals=function(e){return od.equals(this,e)};var qt=od;var V_={NONE:0,CLAMP_TO_GROUND:1,RELATIVE_TO_GROUND:2,CLAMP_TO_TERRAIN:3,RELATIVE_TO_TERRAIN:4,CLAMP_TO_3D_TILE:5,RELATIVE_TO_3D_TILE:6,CLIP_TO_GROUND:7};Object.freeze(V_);var We=V_;function us(e){return e===V_.CLAMP_TO_GROUND||e===V_.CLAMP_TO_3D_TILE||e===V_.CLAMP_TO_TERRAIN}function j_(e){return e===V_.RELATIVE_TO_GROUND||e===V_.RELATIVE_TO_3D_TILE||e===V_.RELATIVE_TO_TERRAIN}var Afe={CENTER:0,LEFT:1,RIGHT:-1};Object.freeze(Afe);var Hi=Afe;var bfe={CENTER:0,BOTTOM:1,BASELINE:2,TOP:-1};Object.freeze(bfe);var qn=bfe;var f6e=Object.freeze({DONE:0,PENDING:1,FAILED:2}),Pt=f6e;function xh(){pe.throwInstantiationError()}Object.defineProperties(xh.prototype,{isConstant:{get:pe.throwInstantiationError},definitionChanged:{get:pe.throwInstantiationError}});xh.prototype.getValue=pe.throwInstantiationError;xh.prototype.equals=pe.throwInstantiationError;xh.equals=function(e,t){return e===t||l(e)&&e.equals(t)};xh.arrayEquals=function(e,t){if(e===t)return!0;if(!l(e)||!l(t)||e.length!==t.length)return!1;let n=e.length;for(let i=0;i<n;i++)if(!xh.equals(e[i],t[i]))return!1;return!0};xh.isConstant=function(e){return!l(e)||e.isConstant};xh.getValueOrUndefined=function(e,t,n){return l(e)?e.getValue(t,n):void 0};xh.getValueOrDefault=function(e,t,n,i){return l(e)?e.getValue(t,i)??n:n};xh.getValueOrClonedDefault=function(e,t,n,i){let r;return l(e)&&(r=e.getValue(t,i)),l(r)||(r=n.clone(r)),r};var X=xh;var d6e=500;function h6e(e,t,n,i,r){let o=t.mostDetailedHeightPosition;if(l(o)&&h.distance(o,n)>d6e&&(l(t.mostDetailedHeight)&&(t.mostDetailedHeightPrevious=t.mostDetailedHeight),t.mostDetailedHeightPosition=void 0,t.mostDetailedHeight=void 0),!l(t.mostDetailedHeightPosition))if(t.mostDetailedHeightPosition=h.clone(n),!l(e)||!e.sampleHeightSupported||e.mode!==re.SCENE3D)t.mostDetailedHeight=null;else{t.mostDetailedHeight=void 0;let a=(e.ellipsoid??ee.default).cartesianToCartographic(n);e.sampleHeightMostDetailed([a],i).then(function(c){r()&&(t.mostDetailedHeight=c[0].height??null)}).catch(function(){r()&&(t.mostDetailedHeight=null)})}return t.mostDetailedHeight===void 0?t.mostDetailedHeightPrevious:t.mostDetailedHeight}var Km=h6e;var m6e=new he;function p6e(e,t,n,i,r){let o=i.cartesianToCartographic(e,m6e);return n===We.CLIP_TO_GROUND?o.height<t&&(o.height=t):us(n)?o.height=t:j_(n)&&(o.height+=t),i.cartographicToCartesian(o,r)}var H_=p6e;var xfe={LEFT:-1,NONE:0,RIGHT:1};Object.freeze(xfe);var Wo=xfe;var g6e=z.WHITE,_6e=h.ZERO,y6e=We.NONE,A6e=U.ZERO,b6e=1,x6e=0,T6e=h.ZERO,E6e=Hi.CENTER,C6e=qn.CENTER,v6e=!1,S6e=Wo.NONE,w6e=new h,I6e=new z,P6e=new h,D6e=new U,R6e=new qt,O6e=new qt,M6e=new qt,N6e=new et,L6e=new Gt;function Tfe(e){this.entity=e,this.billboard=void 0,this.textureValue=void 0}function G_(e,t){t.collectionChanged.addEventListener(G_.prototype._onCollectionChanged,this),this._cluster=e,this._entityCollection=t,this._items=new zt,this._onCollectionChanged(t,t.values,[],[])}G_.prototype.update=function(e){let t=this._items.values,n=this._cluster;for(let i=0,r=t.length;i<r;i++){let o=t[i],s=o.entity,a=s._billboard,c,u=o.billboard,f=s.isShowing&&s.isAvailable(e)&&X.getValueOrDefault(a._show,e,!0),d;if(f&&(d=X.getValueOrUndefined(s._position,e,w6e),c=X.getValueOrUndefined(a._image,e),f=l(d)&&l(c)),!f){xX(o,s,n);continue}X.isConstant(s._position)||(n._clusterDirty=!0),l(u)||(u=n.getBillboard(s),u.id=s,o.billboard=u,o.textureValue=void 0),u.show=f,u.position=d,u.color=X.getValueOrDefault(a._color,e,g6e,I6e),u.eyeOffset=X.getValueOrDefault(a._eyeOffset,e,_6e,P6e),u.heightReference=X.getValueOrDefault(a._heightReference,e,y6e),u.pixelOffset=X.getValueOrDefault(a._pixelOffset,e,A6e,D6e),u.scale=X.getValueOrDefault(a._scale,e,b6e),u.rotation=X.getValueOrDefault(a._rotation,e,x6e),u.alignedAxis=X.getValueOrDefault(a._alignedAxis,e,T6e),u.horizontalOrigin=X.getValueOrDefault(a._horizontalOrigin,e,E6e),u.verticalOrigin=X.getValueOrDefault(a._verticalOrigin,e,C6e),u.width=X.getValueOrUndefined(a._width,e),u.height=X.getValueOrUndefined(a._height,e),u.scaleByDistance=X.getValueOrUndefined(a._scaleByDistance,e,R6e),u.translucencyByDistance=X.getValueOrUndefined(a._translucencyByDistance,e,O6e),u.pixelOffsetScaleByDistance=X.getValueOrUndefined(a._pixelOffsetScaleByDistance,e,M6e),u.sizeInMeters=X.getValueOrDefault(a._sizeInMeters,e,v6e),u.distanceDisplayCondition=X.getValueOrUndefined(a._distanceDisplayCondition,e,L6e),u.disableDepthTestDistance=X.getValueOrUndefined(a._disableDepthTestDistance,e),u.splitDirection=X.getValueOrDefault(a._splitDirection,e,S6e),o.textureValue!==c&&(u.image=c,o.textureValue=c);let p=X.getValueOrUndefined(a._imageSubRegion,e,N6e);l(p)&&u.setImageSubRegion(u.image,p)}return!0};G_.prototype.getBoundingSphere=function(e,t){let n=this._items.get(e.id);if(!l(n)||!l(n.billboard))return Pt.FAILED;let i=n.billboard;if(i.heightReference===We.NONE)t.center=h.clone(i.position,t.center);else if(i._clampedToSurface)t.center=h.clone(i._clampedPosition,t.center);else{let r=this._cluster._scene,o=this._items,s=Km(r,n,i.position,[i],()=>o.get(e.id)===n);if(s===void 0)return Pt.PENDING;s===null?t.center=h.clone(i.position,t.center):t.center=H_(i.position,s,i.heightReference,r.ellipsoid??ee.default,t.center)}return t.radius=0,Pt.DONE};G_.prototype.isDestroyed=function(){return!1};G_.prototype.destroy=function(){this._entityCollection.collectionChanged.removeEventListener(G_.prototype._onCollectionChanged,this);let e=this._entityCollection.values;for(let t=0;t<e.length;t++)this._cluster.removeBillboard(e[t]);return le(this)};G_.prototype._onCollectionChanged=function(e,t,n,i){let r,o,s=this._items,a=this._cluster;for(r=t.length-1;r>-1;r--)o=t[r],l(o._billboard)&&l(o._position)&&s.set(o.id,new Tfe(o));for(r=i.length-1;r>-1;r--)o=i[r],l(o._billboard)&&l(o._position)?s.contains(o.id)||s.set(o.id,new Tfe(o)):(xX(s.get(o.id),o,a),s.remove(o.id));for(r=n.length-1;r>-1;r--)o=n[r],xX(s.get(o.id),o,a),s.remove(o.id)};function xX(e,t,n){l(e)&&(e.billboard=void 0,n.removeBillboard(t))}var sk=G_;var F6e=new h;function $m(e){e=e??H.EMPTY_OBJECT;let t=e.minimum,n=e.maximum;this._min=h.clone(t),this._max=h.clone(n),this._offsetAttribute=e.offsetAttribute,this._workerName="createBoxOutlineGeometry"}$m.fromDimensions=function(e){e=e??H.EMPTY_OBJECT;let t=e.dimensions,n=h.multiplyByScalar(t,.5,new h);return new $m({minimum:h.negate(n,new h),maximum:n,offsetAttribute:e.offsetAttribute})};$m.fromAxisAlignedBoundingBox=function(e){return new $m({minimum:e.minimum,maximum:e.maximum})};$m.packedLength=2*h.packedLength+1;$m.pack=function(e,t,n){return n=n??0,h.pack(e._min,t,n),h.pack(e._max,t,n+h.packedLength),t[n+h.packedLength*2]=e._offsetAttribute??-1,t};var Cfe=new h,vfe=new h,Efe={minimum:Cfe,maximum:vfe,offsetAttribute:void 0};$m.unpack=function(e,t,n){t=t??0;let i=h.unpack(e,t,Cfe),r=h.unpack(e,t+h.packedLength,vfe),o=e[t+h.packedLength*2];return l(n)?(n._min=h.clone(i,n._min),n._max=h.clone(r,n._max),n._offsetAttribute=o===-1?void 0:o,n):(Efe.offsetAttribute=o===-1?void 0:o,new $m(Efe))};$m.createGeometry=function(e){let t=e._min,n=e._max;if(h.equals(t,n))return;let i=new En,r=new Uint16Array(24),o=new Float64Array(24);o[0]=t.x,o[1]=t.y,o[2]=t.z,o[3]=n.x,o[4]=t.y,o[5]=t.z,o[6]=n.x,o[7]=n.y,o[8]=t.z,o[9]=t.x,o[10]=n.y,o[11]=t.z,o[12]=t.x,o[13]=t.y,o[14]=n.z,o[15]=n.x,o[16]=t.y,o[17]=n.z,o[18]=n.x,o[19]=n.y,o[20]=n.z,o[21]=t.x,o[22]=n.y,o[23]=n.z,i.position=new Ne({componentDatatype:Y.DOUBLE,componentsPerAttribute:3,values:o}),r[0]=4,r[1]=5,r[2]=5,r[3]=6,r[4]=6,r[5]=7,r[6]=7,r[7]=4,r[8]=0,r[9]=1,r[10]=1,r[11]=2,r[12]=2,r[13]=3,r[14]=3,r[15]=0,r[16]=0,r[17]=4,r[18]=1,r[19]=5,r[20]=2,r[21]=6,r[22]=3,r[23]=7;let s=h.subtract(n,t,F6e),a=h.magnitude(s)*.5;if(l(e._offsetAttribute)){let c=o.length,u=e._offsetAttribute===pn.NONE?0:1,f=new Uint8Array(c/3).fill(u);i.applyOffset=new Ne({componentDatatype:Y.UNSIGNED_BYTE,componentsPerAttribute:1,values:f})}return new wt({attributes:i,indices:r,primitiveType:Oe.LINES,boundingSphere:new ue(h.ZERO,a),offsetAttribute:e._offsetAttribute})};var Jm=$m;function $E(e,t,n,i){e=e??1,t=t??1,n=n??1,i=i??1,this.value=new Uint8Array([z.floatToByte(e),z.floatToByte(t),z.floatToByte(n),z.floatToByte(i)])}Object.defineProperties($E.prototype,{componentDatatype:{get:function(){return Y.UNSIGNED_BYTE}},componentsPerAttribute:{get:function(){return 4}},normalize:{get:function(){return!0}}});$E.fromColor=function(e){return new $E(e.red,e.green,e.blue,e.alpha)};$E.toValue=function(e,t){return l(t)?e.toBytes(t):new Uint8Array(e.toBytes())};$E.equals=function(e,t){return e===t||l(e)&&l(t)&&e.value[0]===t.value[0]&&e.value[1]===t.value[1]&&e.value[2]===t.value[2]&&e.value[3]===t.value[3]};var Jt=$E;function yP(e,t){e=e??0,t=t??Number.MAX_VALUE,this.value=new Float32Array([e,t])}Object.defineProperties(yP.prototype,{componentDatatype:{get:function(){return Y.FLOAT}},componentsPerAttribute:{get:function(){return 2}},normalize:{get:function(){return!1}}});yP.fromDistanceDisplayCondition=function(e){return new yP(e.near,e.far)};yP.toValue=function(e,t){return l(t)?(t[0]=e.near,t[1]=e.far,t):new Float32Array([e.near,e.far])};var Qn=yP;function B6e(e){e=e??H.EMPTY_OBJECT,this.geometry=e.geometry,this.modelMatrix=M.clone(e.modelMatrix??M.IDENTITY),this.id=e.id,this.pickPrimitive=e.pickPrimitive,this.attributes=e.attributes??{},this.westHemisphereGeometry=void 0,this.eastHemisphereGeometry=void 0}var Bt=B6e;function Eo(e){e=e??H.EMPTY_OBJECT,this.start=l(e.start)?K.clone(e.start):new K,this.stop=l(e.stop)?K.clone(e.stop):new K,this.data=e.data,this.isStartIncluded=e.isStartIncluded??!0,this.isStopIncluded=e.isStopIncluded??!0}Object.defineProperties(Eo.prototype,{isEmpty:{get:function(){let e=K.compare(this.stop,this.start);return e<0||e===0&&(!this.isStartIncluded||!this.isStopIncluded)}}});var JE={start:void 0,stop:void 0,isStartIncluded:void 0,isStopIncluded:void 0,data:void 0};Eo.fromIso8601=function(e,t){let n=e.iso8601.split("/");if(n.length!==2)throw new pe("options.iso8601 is an invalid ISO 8601 interval.");let i=K.fromIso8601(n[0]),r=K.fromIso8601(n[1]),o=e.isStartIncluded??!0,s=e.isStopIncluded??!0,a=e.data;return l(t)?(t.start=i,t.stop=r,t.isStartIncluded=o,t.isStopIncluded=s,t.data=a,t):(JE.start=i,JE.stop=r,JE.isStartIncluded=o,JE.isStopIncluded=s,JE.data=a,new Eo(JE))};Eo.toIso8601=function(e,t){return`${K.toIso8601(e.start,t)}/${K.toIso8601(e.stop,t)}`};Eo.clone=function(e,t){if(l(e))return l(t)?(t.start=e.start,t.stop=e.stop,t.isStartIncluded=e.isStartIncluded,t.isStopIncluded=e.isStopIncluded,t.data=e.data,t):new Eo(e)};Eo.equals=function(e,t,n){return e===t||l(e)&&l(t)&&(e.isEmpty&&t.isEmpty||e.isStartIncluded===t.isStartIncluded&&e.isStopIncluded===t.isStopIncluded&&K.equals(e.start,t.start)&&K.equals(e.stop,t.stop)&&(e.data===t.data||l(n)&&n(e.data,t.data)))};Eo.equalsEpsilon=function(e,t,n,i){return n=n??0,e===t||l(e)&&l(t)&&(e.isEmpty&&t.isEmpty||e.isStartIncluded===t.isStartIncluded&&e.isStopIncluded===t.isStopIncluded&&K.equalsEpsilon(e.start,t.start,n)&&K.equalsEpsilon(e.stop,t.stop,n)&&(e.data===t.data||l(i)&&i(e.data,t.data)))};Eo.intersect=function(e,t,n,i){if(!l(t))return Eo.clone(Eo.EMPTY,n);let r=e.start,o=e.stop,s=t.start,a=t.stop,c=K.greaterThanOrEquals(s,r)&&K.greaterThanOrEquals(o,s),u=!c&&K.lessThanOrEquals(s,r)&&K.lessThanOrEquals(r,a);if(!c&&!u)return Eo.clone(Eo.EMPTY,n);let f=e.isStartIncluded,d=e.isStopIncluded,p=t.isStartIncluded,g=t.isStopIncluded,m=K.lessThan(o,a);return l(n)||(n=new Eo),n.start=c?s:r,n.isStartIncluded=f&&p||!K.equals(s,r)&&(c&&p||u&&f),n.stop=m?o:a,n.isStopIncluded=m?d:d&&g||!K.equals(a,o)&&g,n.data=l(i)?i(e.data,t.data):e.data,n};Eo.contains=function(e,t){if(e.isEmpty)return!1;let n=K.compare(e.start,t);if(n===0)return e.isStartIncluded;let i=K.compare(t,e.stop);return i===0?e.isStopIncluded:n<0&&i<0};Eo.prototype.clone=function(e){return Eo.clone(this,e)};Eo.prototype.equals=function(e,t){return Eo.equals(this,e,t)};Eo.prototype.equalsEpsilon=function(e,t,n){return Eo.equalsEpsilon(this,e,t,n)};Eo.prototype.toString=function(){return Eo.toIso8601(this)};Eo.EMPTY=Object.freeze(new Eo({start:new K,stop:new K,isStartIncluded:!1,isStopIncluded:!1}));var Cn=Eo;var Sfe=Object.freeze(K.fromIso8601("0000-01-01T00:00:00Z")),wfe=Object.freeze(K.fromIso8601("9999-12-31T24:00:00Z")),k6e=Object.freeze(new Cn({start:Sfe,stop:wfe})),U6e={MINIMUM_VALUE:Sfe,MAXIMUM_VALUE:wfe,MAXIMUM_INTERVAL:k6e},nt=U6e;function AP(e,t,n){e=e??0,t=t??0,n=n??0,this.value=new Float32Array([e,t,n])}Object.defineProperties(AP.prototype,{componentDatatype:{get:function(){return Y.FLOAT}},componentsPerAttribute:{get:function(){return 3}},normalize:{get:function(){return!1}}});AP.fromCartesian3=function(e){return new AP(e.x,e.y,e.z)};AP.toValue=function(e,t){return l(t)||(t=new Float32Array([e.x,e.y,e.z])),t[0]=e.x,t[1]=e.y,t[2]=e.z,t};var Er=AP;function ak(e){e=e??!0,this.value=ak.toValue(e)}Object.defineProperties(ak.prototype,{componentDatatype:{get:function(){return Y.UNSIGNED_BYTE}},componentsPerAttribute:{get:function(){return 1}},normalize:{get:function(){return!1}}});ak.toValue=function(e,t){return l(t)?(t[0]=e,t):new Uint8Array([e])};var Pn=ak;var ck=`in vec3 v_positionEC; -in vec3 v_normalEC; -in vec3 v_tangentEC; -in vec3 v_bitangentEC; -in vec2 v_st; +`;var Afe={UNBOUNDED:0,CLAMPED:1,LOOP_STOP:2};Object.freeze(Afe);var ws=Afe;var bfe={TICK_DEPENDENT:0,SYSTEM_CLOCK_MULTIPLIER:1,SYSTEM_CLOCK:2};Object.freeze(bfe);var jr=bfe;var bX;typeof performance<"u"&&typeof performance.now=="function"&&isFinite(performance.now())?bX=function(){return performance.now()}:bX=function(){return Date.now()};var xn=bX;function xX(e){e=e??H.EMPTY_OBJECT;let t=e.currentTime,n=e.startTime,i=e.stopTime;l(t)?t=K.clone(t):l(n)?t=K.clone(n):l(i)?t=K.addDays(i,-1,new K):t=K.now(),l(n)?n=K.clone(n):n=K.clone(t),l(i)?i=K.clone(i):i=K.addDays(n,1,new K),this.startTime=n,this.stopTime=i,this.clockRange=e.clockRange??ws.UNBOUNDED,this.canAnimate=e.canAnimate??!0,this.onTick=new be,this.onStop=new be,this._currentTime=void 0,this._multiplier=void 0,this._clockStep=void 0,this._shouldAnimate=void 0,this._lastSystemTime=xn(),this.currentTime=t,this.multiplier=e.multiplier??1,this.shouldAnimate=e.shouldAnimate??!1,this.clockStep=e.clockStep??jr.SYSTEM_CLOCK_MULTIPLIER}Object.defineProperties(xX.prototype,{currentTime:{get:function(){return this._currentTime},set:function(e){K.equals(this._currentTime,e)||(this._clockStep===jr.SYSTEM_CLOCK&&(this._clockStep=jr.SYSTEM_CLOCK_MULTIPLIER),this._currentTime=e)}},multiplier:{get:function(){return this._multiplier},set:function(e){this._multiplier!==e&&(this._clockStep===jr.SYSTEM_CLOCK&&(this._clockStep=jr.SYSTEM_CLOCK_MULTIPLIER),this._multiplier=e)}},clockStep:{get:function(){return this._clockStep},set:function(e){e===jr.SYSTEM_CLOCK&&(this._multiplier=1,this._shouldAnimate=!0,this._currentTime=K.now()),this._clockStep=e}},shouldAnimate:{get:function(){return this._shouldAnimate},set:function(e){this._shouldAnimate!==e&&(this._clockStep===jr.SYSTEM_CLOCK&&(this._clockStep=jr.SYSTEM_CLOCK_MULTIPLIER),this._shouldAnimate=e)}}});xX.prototype.tick=function(){let e=xn(),t=K.clone(this._currentTime);if(this.canAnimate&&this._shouldAnimate){let n=this._clockStep;if(n===jr.SYSTEM_CLOCK)t=K.now(t);else{let i=this._multiplier;if(n===jr.TICK_DEPENDENT)t=K.addSeconds(t,i,t);else{let a=e-this._lastSystemTime;t=K.addSeconds(t,i*(a/1e3),t)}let r=this.clockRange,o=this.startTime,s=this.stopTime;if(r===ws.CLAMPED)K.lessThan(t,o)?t=K.clone(o,t):K.greaterThan(t,s)&&(t=K.clone(s,t),this.onStop.raiseEvent(this));else if(r===ws.LOOP_STOP)for(K.lessThan(t,o)&&(t=K.clone(o,t));K.greaterThan(t,s);)t=K.addSeconds(o,K.secondsDifference(t,s),t),this.onStop.raiseEvent(this)}}return this._currentTime=t,this._lastSystemTime=e,this.onTick.raiseEvent(this),t};var Km=xX;function TX(){this._removalFunctions=[]}TX.prototype.add=function(e,t,n){let i=e.addEventListener(t,n);this._removalFunctions.push(i);let r=this;return function(){i();let o=r._removalFunctions;o.splice(o.indexOf(i),1)}};TX.prototype.removeAll=function(){let e=this._removalFunctions;for(let t=0,n=e.length;t<n;++t)e[t]();e.length=0};var Wo=TX;function l6e(e){let t,n=e.name,i=e.message;l(n)&&l(i)?t=`${n}: ${i}`:t=e.toString();let r=e.stack;return l(r)&&(t+=` +${r}`),t}var z0=l6e;function EX(e,t,n){this.heading=e??0,this.pitch=t??0,this.range=n??0}EX.clone=function(e,t){if(l(e))return l(t)||(t=new EX),t.heading=e.heading,t.pitch=e.pitch,t.range=e.range,t};var xh=EX;var u6e=Object.freeze({DONE:0,PENDING:1,FAILED:2}),Pt=u6e;function Il(){this._dataSources=[],this._dataSourceAdded=new be,this._dataSourceRemoved=new be,this._dataSourceMoved=new be}Object.defineProperties(Il.prototype,{length:{get:function(){return this._dataSources.length}},dataSourceAdded:{get:function(){return this._dataSourceAdded}},dataSourceRemoved:{get:function(){return this._dataSourceRemoved}},dataSourceMoved:{get:function(){return this._dataSourceMoved}}});Il.prototype.add=function(e){let t=this,n=this._dataSources;return Promise.resolve(e).then(function(i){return n===t._dataSources&&(t._dataSources.push(i),t._dataSourceAdded.raiseEvent(t,i)),i})};Il.prototype.remove=function(e,t){t=t??!1;let n=this._dataSources.indexOf(e);return n!==-1?(this._dataSources.splice(n,1),this._dataSourceRemoved.raiseEvent(this,e),t&&typeof e.destroy=="function"&&e.destroy(),!0):!1};Il.prototype.removeAll=function(e){e=e??!1;let t=this._dataSources;for(let n=0,i=t.length;n<i;++n){let r=t[n];this._dataSourceRemoved.raiseEvent(this,r),e&&typeof r.destroy=="function"&&r.destroy()}this._dataSources=[]};Il.prototype.contains=function(e){return this.indexOf(e)!==-1};Il.prototype.indexOf=function(e){return this._dataSources.indexOf(e)};Il.prototype.get=function(e){return this._dataSources[e]};Il.prototype.getByName=function(e){return this._dataSources.filter(function(t){return t.name===e})};function sk(e,t){return e.indexOf(t)}function xfe(e,t,n){let i=e._dataSources,r=i.length-1;if(t=P.clamp(t,0,r),n=P.clamp(n,0,r),t===n)return;let o=i[t];i[t]=i[n],i[n]=o,e.dataSourceMoved.raiseEvent(o,n,t)}Il.prototype.raise=function(e){let t=sk(this._dataSources,e);xfe(this,t,t+1)};Il.prototype.lower=function(e){let t=sk(this._dataSources,e);xfe(this,t,t-1)};Il.prototype.raiseToTop=function(e){let t=sk(this._dataSources,e);t!==this._dataSources.length-1&&(this._dataSources.splice(t,1),this._dataSources.push(e),this.dataSourceMoved.raiseEvent(e,this._dataSources.length-1,t))};Il.prototype.lowerToBottom=function(e){let t=sk(this._dataSources,e);t!==0&&(this._dataSources.splice(t,1),this._dataSources.splice(0,0,e),this.dataSourceMoved.raiseEvent(e,0,t))};Il.prototype.isDestroyed=function(){return!1};Il.prototype.destroy=function(){return this.removeAll(!0),le(this)};var ak=Il;var CX=class{constructor(t){t=t??H.EMPTY_OBJECT,this._ellipsoid=t.ellipsoid??ee.default,this._rectangle=t.rectangle??ie.MAX_VALUE,this._projection=new ji(this._ellipsoid),this._numberOfLevelZeroTilesX=t.numberOfLevelZeroTilesX??2,this._numberOfLevelZeroTilesY=t.numberOfLevelZeroTilesY??1}get ellipsoid(){return this._ellipsoid}get rectangle(){return this._rectangle}get projection(){return this._projection}getNumberOfXTilesAtLevel(t){return this._numberOfLevelZeroTilesX<<t}getNumberOfYTilesAtLevel(t){return this._numberOfLevelZeroTilesY<<t}rectangleToNativeRectangle(t,n){let i=P.toDegrees(t.west),r=P.toDegrees(t.south),o=P.toDegrees(t.east),s=P.toDegrees(t.north);return l(n)?(n.west=i,n.south=r,n.east=o,n.north=s,n):new ie(i,r,o,s)}tileXYToNativeRectangle(t,n,i,r){let o=this.tileXYToRectangle(t,n,i,r);return o.west=P.toDegrees(o.west),o.south=P.toDegrees(o.south),o.east=P.toDegrees(o.east),o.north=P.toDegrees(o.north),o}tileXYToRectangle(t,n,i,r){let o=this._rectangle,s=this.getNumberOfXTilesAtLevel(i),a=this.getNumberOfYTilesAtLevel(i),c=o.width/s,u=t*c+o.west,f=(t+1)*c+o.west,d=o.height/a,p=o.north-n*d,g=o.north-(n+1)*d;return l(r)||(r=new ie(u,g,f,p)),r.west=u,r.south=g,r.east=f,r.north=p,r}positionToTileXY(t,n,i){let r=this._rectangle;if(!ie.contains(r,t))return;let o=this.getNumberOfXTilesAtLevel(n),s=this.getNumberOfYTilesAtLevel(n),a=r.width/o,c=r.height/s,u=t.longitude;r.east<r.west&&(u+=P.TWO_PI);let f=(u-r.west)/a|0;f>=o&&(f=o-1);let d=(r.north-t.latitude)/c|0;return d>=s&&(d=s-1),l(i)?(i.x=f,i.y=d,i):new U(f,d)}},ir=CX;var Tfe=new h,Efe=new h,Cfe=new he,vX=new h,f6e=new h,vfe=new ue,d6e=new ir,_P=[new he,new he,new he,new he],yP=new U,Is={};Is.initialize=function(){let e=Is._initPromise;return l(e)||(e=De.fetchJson(Zt("Assets/approximateTerrainHeights.json")).then(function(t){Is._terrainHeights=t}),Is._initPromise=e),e};Is.getMinimumMaximumHeights=function(e,t){t=t??ee.default;let n=Sfe(e),i=Is._defaultMinTerrainHeight,r=Is._defaultMaxTerrainHeight;if(l(n)){let o=`${n.level}-${n.x}-${n.y}`,s=Is._terrainHeights[o];l(s)&&(i=s[0],r=s[1]),t.cartographicToCartesian(ie.northeast(e,Cfe),Tfe),t.cartographicToCartesian(ie.southwest(e,Cfe),Efe),h.midpoint(Efe,Tfe,vX);let a=t.scaleToGeodeticSurface(vX,f6e);if(l(a)){let c=h.distance(vX,a);i=Math.min(i,-c)}else i=Is._defaultMinTerrainHeight}return i=Math.max(Is._defaultMinTerrainHeight,i),{minimumTerrainHeight:i,maximumTerrainHeight:r}};Is.getBoundingSphere=function(e,t){t=t??ee.default;let n=Sfe(e),i=Is._defaultMaxTerrainHeight;if(l(n)){let o=`${n.level}-${n.x}-${n.y}`,s=Is._terrainHeights[o];l(s)&&(i=s[1])}let r=ue.fromRectangle3D(e,t,0);return ue.fromRectangle3D(e,t,i,vfe),ue.union(r,vfe,r)};function Sfe(e){he.fromRadians(e.east,e.north,0,_P[0]),he.fromRadians(e.west,e.north,0,_P[1]),he.fromRadians(e.east,e.south,0,_P[2]),he.fromRadians(e.west,e.south,0,_P[3]);let t=0,n=0,i=0,r=0,o=Is._terrainHeightsMaxLevel,s;for(s=0;s<=o;++s){let a=!1;for(let c=0;c<4;++c){let u=_P[c];if(d6e.positionToTileXY(u,s,yP),c===0)i=yP.x,r=yP.y;else if(i!==yP.x||r!==yP.y){a=!0;break}}if(a)break;t=i,n=r}if(s!==0)return{x:t,y:n,level:s>o?o:s-1}}Is._terrainHeightsMaxLevel=6;Is._defaultMaxTerrainHeight=9e3;Is._defaultMinTerrainHeight=-1e5;Is._terrainHeights=void 0;Is._initPromise=void 0;Object.defineProperties(Is,{initialized:{get:function(){return l(Is._terrainHeights)}}});var Ni=Is;function h6e(e){e=e??H.EMPTY_OBJECT,this.geometry=e.geometry,this.modelMatrix=M.clone(e.modelMatrix??M.IDENTITY),this.id=e.id,this.pickPrimitive=e.pickPrimitive,this.attributes=e.attributes??{},this.westHemisphereGeometry=void 0,this.eastHemisphereGeometry=void 0}var Bt=h6e;function m6e(e){e=e??H.EMPTY_OBJECT,this.componentDatatype=e.componentDatatype,this.componentsPerAttribute=e.componentsPerAttribute,this.normalize=e.normalize??!1,this.value=e.value}var Pl=m6e;var wfe={NONE:0,GEODESIC:1,RHUMB:2};Object.freeze(wfe);var ln=wfe;var Ife=P.EPSILON10;function p6e(e,t,n,i){if(!l(e))return;n=n??!1;let r=l(i),o=e.length;if(o<2)return e;let s,a=e[0],c,u,f=0,d=-1;for(s=1;s<o;++s)c=e[s],t(a,c,Ife)?(l(u)||(u=e.slice(0,s),f=s-1,d=0),r&&i.push(s)):(l(u)&&(u.push(c),f=s,r&&(d=i.length)),a=c);return n&&t(e[0],e[o-1],Ife)&&(r&&(l(u)?i.splice(d,0,f):i.push(o-1)),l(u)?u.length-=1:u=e.slice(0,-1)),l(u)?u:e}var Lr=p6e;function g6e(e){let t=e._uSquared,n=e._ellipsoid.maximumRadius,i=e._ellipsoid.minimumRadius,r=(n-i)/n,o=Math.cos(e._startHeading),s=Math.sin(e._startHeading),a=(1-r)*Math.tan(e._start.latitude),c=1/Math.sqrt(1+a*a),u=c*a,f=Math.atan2(a,o),d=c*s,p=d*d,g=1-p,m=Math.sqrt(g),y=t/4,A=y*y,b=A*y,x=A*A,T=1+y-3*A/4+5*b/4-175*x/64,E=1-y+15*A/8-35*b/8,v=1-3*y+35*A/4,S=1-5*y,I=T*f-E*Math.sin(2*f)*y/2-v*Math.sin(4*f)*A/16-S*Math.sin(6*f)*b/48-Math.sin(8*f)*5*x/512,R=e._constants;R.a=n,R.b=i,R.f=r,R.cosineHeading=o,R.sineHeading=s,R.tanU=a,R.cosineU=c,R.sineU=u,R.sigma=f,R.sineAlpha=d,R.sineSquaredAlpha=p,R.cosineSquaredAlpha=g,R.cosineAlpha=m,R.u2Over4=y,R.u4Over16=A,R.u6Over64=b,R.u8Over256=x,R.a0=T,R.a1=E,R.a2=v,R.a3=S,R.distanceRatio=I}function _6e(e,t){return e*t*(4+e*(4-3*t))/16}function Pfe(e,t,n,i,r,o,s){let a=_6e(e,n);return(1-a)*e*t*(i+a*r*(s+a*o*(2*s*s-1)))}function y6e(e,t,n,i,r,o,s){let a=(t-n)/t,c=o-i,u=Math.atan((1-a)*Math.tan(r)),f=Math.atan((1-a)*Math.tan(s)),d=Math.cos(u),p=Math.sin(u),g=Math.cos(f),m=Math.sin(f),y=d*g,A=d*m,b=p*m,x=p*g,T=c,E,v,S,I,R,O,L,_;do{v=Math.cos(T),S=Math.sin(T);let k=A-x*v;O=Math.sqrt(g*g*S*S+k*k),R=b+y*v,I=Math.atan2(O,R);let G;O===0?(G=0,L=1):(G=y*S/O,L=1-G*G),E=T,_=R-2*b/L,isFinite(_)||(_=0),T=c+Pfe(a,G,L,I,O,R,_)}while(Math.abs(T-E)>P.EPSILON12);let C=L*(t*t-n*n)/(n*n),w=1+C*(4096+C*(C*(320-175*C)-768))/16384,D=C*(256+C*(C*(74-47*C)-128))/1024,N=_*_,F=D*O*(_+D*(R*(2*N-1)-D*_*(4*O*O-3)*(4*N-3)/6)/4),V=n*w*(I-F),B=Math.atan2(g*S,A-x*v),j=Math.atan2(d*S,A*v-x);e._distance=V,e._startHeading=B,e._endHeading=j,e._uSquared=C}var A6e=new h,SX=new h;function Dfe(e,t,n,i){let r=h.normalize(i.cartographicToCartesian(t,SX),A6e),o=h.normalize(i.cartographicToCartesian(n,SX),SX);y6e(e,i.maximumRadius,i.minimumRadius,t.longitude,t.latitude,n.longitude,n.latitude),e._start=he.clone(t,e._start),e._end=he.clone(n,e._end),e._start.height=0,e._end.height=0,g6e(e)}function AP(e,t,n){let i=n??ee.default;this._ellipsoid=i,this._start=new he,this._end=new he,this._constants={},this._startHeading=void 0,this._endHeading=void 0,this._distance=void 0,this._uSquared=void 0,l(e)&&l(t)&&Dfe(this,e,t,i)}Object.defineProperties(AP.prototype,{ellipsoid:{get:function(){return this._ellipsoid}},surfaceDistance:{get:function(){return this._distance}},start:{get:function(){return this._start}},end:{get:function(){return this._end}},startHeading:{get:function(){return this._startHeading}},endHeading:{get:function(){return this._endHeading}}});AP.prototype.setEndPoints=function(e,t){Dfe(this,e,t,this._ellipsoid)};AP.prototype.interpolateUsingFraction=function(e,t){return this.interpolateUsingSurfaceDistance(this._distance*e,t)};AP.prototype.interpolateUsingSurfaceDistance=function(e,t){let n=this._constants,i=n.distanceRatio+e/n.b,r=Math.cos(2*i),o=Math.cos(4*i),s=Math.cos(6*i),a=Math.sin(2*i),c=Math.sin(4*i),u=Math.sin(6*i),f=Math.sin(8*i),d=i*i,p=i*d,g=n.u8Over256,m=n.u2Over4,y=n.u6Over64,A=n.u4Over16,b=2*p*g*r/3+i*(1-m+7*A/4-15*y/4+579*g/64-(A-15*y/4+187*g/16)*r-(5*y/4-115*g/16)*o-29*g*s/16)+(m/2-A+71*y/32-85*g/16)*a+(5*A/16-5*y/4+383*g/96)*c-d*((y-11*g/2)*a+5*g*c/2)+(29*y/96-29*g/16)*u+539*g*f/1536,x=Math.asin(Math.sin(b)*n.cosineAlpha),T=Math.atan(n.a/n.b*Math.tan(x));b=b-n.sigma;let E=Math.cos(2*n.sigma+b),v=Math.sin(b),S=Math.cos(b),I=n.cosineU*S,R=n.sineU*v,L=Math.atan2(v*n.sineHeading,I-R*n.cosineHeading)-Pfe(n.f,n.sineAlpha,n.cosineSquaredAlpha,b,v,S,E);return l(t)?(t.longitude=this._start.longitude+L,t.latitude=T,t.height=0,t):new he(this._start.longitude+L,T,0)};var z_=AP;function IX(e,t,n){if(e===0)return t*n;let i=e*e,r=i*i,o=r*i,s=o*i,a=s*i,c=a*i,u=n,f=Math.sin(2*u),d=Math.sin(4*u),p=Math.sin(6*u),g=Math.sin(8*u),m=Math.sin(10*u),y=Math.sin(12*u);return t*((1-i/4-3*r/64-5*o/256-175*s/16384-441*a/65536-4851*c/1048576)*u-(3*i/8+3*r/32+45*o/1024+105*s/4096+2205*a/131072+6237*c/524288)*f+(15*r/256+45*o/1024+525*s/16384+1575*a/65536+155925*c/8388608)*d-(35*o/3072+175*s/12288+3675*a/262144+13475*c/1048576)*p+(315*s/131072+2205*a/524288+43659*c/8388608)*g-(693*a/1310720+6237*c/5242880)*m+1001*c/8388608*y)}function b6e(e,t,n){let i=e/n;if(t===0)return i;let r=i*i,o=r*i,s=o*i,a=t,c=a*a,u=c*c,f=u*c,d=f*c,p=d*c,g=p*c,m=Math.sin(2*i),y=Math.cos(2*i),A=Math.sin(4*i),b=Math.cos(4*i),x=Math.sin(6*i),T=Math.cos(6*i),E=Math.sin(8*i),v=Math.cos(8*i),S=Math.sin(10*i),I=Math.cos(10*i),R=Math.sin(12*i);return i+i*c/4+7*i*u/64+15*i*f/256+579*i*d/16384+1515*i*p/65536+16837*i*g/1048576+(3*i*u/16+45*i*f/256-i*(32*r-561)*d/4096-i*(232*r-1677)*p/16384+i*(399985-90560*r+512*s)*g/5242880)*y+(21*i*f/256+483*i*d/4096-i*(224*r-1969)*p/16384-i*(33152*r-112599)*g/1048576)*b+(151*i*d/4096+4681*i*p/65536+1479*i*g/16384-453*o*g/32768)*T+(1097*i*p/65536+42783*i*g/1048576)*v+8011*i*g/1048576*I+(3*c/8+3*u/16+213*f/2048-3*r*f/64+255*d/4096-33*r*d/512+20861*p/524288-33*r*p/512+s*p/1024+28273*g/1048576-471*r*g/8192+9*s*g/4096)*m+(21*u/256+21*f/256+533*d/8192-21*r*d/512+197*p/4096-315*r*p/4096+584039*g/16777216-12517*r*g/131072+7*s*g/2048)*A+(151*f/6144+151*d/4096+5019*p/131072-453*r*p/16384+26965*g/786432-8607*r*g/131072)*x+(1097*d/131072+1097*p/65536+225797*g/10485760-1097*r*g/65536)*E+(8011*p/2621440+8011*g/1048576)*S+293393*g/251658240*R}function $E(e,t){if(e===0)return Math.log(Math.tan(.5*(P.PI_OVER_TWO+t)));let n=e*Math.sin(t);return Math.log(Math.tan(.5*(P.PI_OVER_TWO+t)))-e/2*Math.log((1+n)/(1-n))}function x6e(e,t,n,i,r){let o=$E(e._ellipticity,n),s=$E(e._ellipticity,r);return Math.atan2(P.negativePiToPi(i-t),s-o)}function T6e(e,t,n,i,r,o,s){let a=e._heading,c=o-i,u;if(P.equalsEpsilon(Math.abs(a),P.PI_OVER_TWO,P.EPSILON8))if(t===n)u=t*Math.cos(r)*P.negativePiToPi(c);else{let f=Math.sin(r);u=t*Math.cos(r)*P.negativePiToPi(c)/Math.sqrt(1-e._ellipticitySquared*f*f)}else{let f=IX(e._ellipticity,t,r);u=(IX(e._ellipticity,t,s)-f)/Math.cos(a)}return Math.abs(u)}var E6e=new h,wX=new h;function Rfe(e,t,n,i){let r=h.normalize(i.cartographicToCartesian(t,wX),E6e),o=h.normalize(i.cartographicToCartesian(n,wX),wX),s=i.maximumRadius,a=i.minimumRadius,c=s*s,u=a*a;e._ellipticitySquared=(c-u)/c,e._ellipticity=Math.sqrt(e._ellipticitySquared),e._start=he.clone(t,e._start),e._start.height=0,e._end=he.clone(n,e._end),e._end.height=0,e._heading=x6e(e,t.longitude,t.latitude,n.longitude,n.latitude),e._distance=T6e(e,i.maximumRadius,i.minimumRadius,t.longitude,t.latitude,n.longitude,n.latitude)}function Ofe(e,t,n,i,r,o){if(n===0)return he.clone(e,o);let s=r*r,a,c,u;if(Math.abs(P.PI_OVER_TWO-Math.abs(t))>P.EPSILON8){let f=IX(r,i,e.latitude),d=n*Math.cos(t),p=f+d;if(c=b6e(p,r,i),Math.abs(t)<P.EPSILON10)a=P.negativePiToPi(e.longitude);else{let g=$E(r,e.latitude),m=$E(r,c);u=Math.tan(t)*(m-g),a=P.negativePiToPi(e.longitude+u)}}else{c=e.latitude;let f;if(r===0)f=i*Math.cos(e.latitude);else{let d=Math.sin(e.latitude);f=i*Math.cos(e.latitude)/Math.sqrt(1-s*d*d)}u=n/f,t>0?a=P.negativePiToPi(e.longitude+u):a=P.negativePiToPi(e.longitude-u)}return l(o)?(o.longitude=a,o.latitude=c,o.height=0,o):new he(a,c,0)}function V0(e,t,n){let i=n??ee.default;this._ellipsoid=i,this._start=new he,this._end=new he,this._heading=void 0,this._distance=void 0,this._ellipticity=void 0,this._ellipticitySquared=void 0,l(e)&&l(t)&&Rfe(this,e,t,i)}Object.defineProperties(V0.prototype,{ellipsoid:{get:function(){return this._ellipsoid}},surfaceDistance:{get:function(){return this._distance}},start:{get:function(){return this._start}},end:{get:function(){return this._end}},heading:{get:function(){return this._heading}}});V0.fromStartHeadingDistance=function(e,t,n,i,r){let o=i??ee.default,s=o.maximumRadius,a=o.minimumRadius,c=s*s,u=a*a,f=Math.sqrt((c-u)/c);t=P.negativePiToPi(t);let d=Ofe(e,t,n,o.maximumRadius,f);return!l(r)||l(i)&&!i.equals(r.ellipsoid)?new V0(e,d,o):(r.setEndPoints(e,d),r)};V0.prototype.setEndPoints=function(e,t){Rfe(this,e,t,this._ellipsoid)};V0.prototype.interpolateUsingFraction=function(e,t){return this.interpolateUsingSurfaceDistance(e*this._distance,t)};V0.prototype.interpolateUsingSurfaceDistance=function(e,t){return Ofe(this._start,this._heading,e,this._ellipsoid.maximumRadius,this._ellipticity,t)};V0.prototype.findIntersectionWithLongitude=function(e,t){let n=this._ellipticity,i=this._heading,r=Math.abs(i),o=this._start;if(e=P.negativePiToPi(e),P.equalsEpsilon(Math.abs(e),Math.PI,P.EPSILON14)&&(e=P.sign(o.longitude)*Math.PI),l(t)||(t=new he),Math.abs(P.PI_OVER_TWO-r)<=P.EPSILON8)return t.longitude=e,t.latitude=o.latitude,t.height=0,t;if(P.equalsEpsilon(Math.abs(P.PI_OVER_TWO-r),P.PI_OVER_TWO,P.EPSILON8))return P.equalsEpsilon(e,o.longitude,P.EPSILON12)?void 0:(t.longitude=e,t.latitude=P.PI_OVER_TWO*P.sign(P.PI_OVER_TWO-i),t.height=0,t);let s=o.latitude,a=n*Math.sin(s),c=Math.tan(.5*(P.PI_OVER_TWO+s))*Math.exp((e-o.longitude)/Math.tan(i)),u=(1+a)/(1-a),f=o.latitude,d;do{d=f;let p=n*Math.sin(d),g=(1+p)/(1-p);f=2*Math.atan(c*Math.pow(g/u,n/2))-P.PI_OVER_TWO}while(!P.equalsEpsilon(f,d,P.EPSILON12));return t.longitude=e,t.latitude=f,t.height=0,t};V0.prototype.findIntersectionWithLatitude=function(e,t){let n=this._ellipticity,i=this._heading,r=this._start;if(P.equalsEpsilon(Math.abs(i),P.PI_OVER_TWO,P.EPSILON8))return;let o=$E(n,r.latitude),s=$E(n,e),a=Math.tan(i)*(s-o),c=P.negativePiToPi(r.longitude+a);return l(t)?(t.longitude=c,t.latitude=e,t.height=0,t):new he(c,e,0)};var Vc=V0;var bP=class e{constructor(t){this._ellipsoid=t??ee.WGS84,this._semimajorAxis=this._ellipsoid.maximumRadius,this._oneOverSemimajorAxis=1/this._semimajorAxis}get ellipsoid(){return this._ellipsoid}static mercatorAngleToGeodeticLatitude(t){return P.PI_OVER_TWO-2*Math.atan(Math.exp(-t))}static geodeticLatitudeToMercatorAngle(t){t>e.MaximumLatitude?t=e.MaximumLatitude:t<-e.MaximumLatitude&&(t=-e.MaximumLatitude);let n=Math.sin(t);return .5*Math.log((1+n)/(1-n))}project(t,n){let i=this._semimajorAxis,r=t.longitude*i,o=e.geodeticLatitudeToMercatorAngle(t.latitude)*i,s=t.height;return l(n)?(n.x=r,n.y=o,n.z=s,n):new h(r,o,s)}unproject(t,n){let i=this._oneOverSemimajorAxis,r=t.x*i,o=e.mercatorAngleToGeodeticLatitude(t.y*i),s=t.z;return l(n)?(n.longitude=r,n.latitude=o,n.height=s,n):new he(r,o,s)}};bP.MaximumLatitude=bP.mercatorAngleToGeodeticLatitude(Math.PI);var Ti=bP;var FX=[ji,Ti],C6e=FX.length,Zfe=Math.cos(P.toRadians(30)),Mfe=Math.cos(P.toRadians(150)),Qfe=0,ede=1e3;function j_(e){e=e??H.EMPTY_OBJECT;let t=e.positions;this.width=e.width??1,this._positions=t,this.granularity=e.granularity??9999,this.loop=e.loop??!1,this.arcType=e.arcType??ln.GEODESIC,this._ellipsoid=ee.default,this._projectionIndex=0,this._workerName="createGroundPolylineGeometry",this._scene3DOnly=!1}Object.defineProperties(j_.prototype,{packedLength:{get:function(){return 1+this._positions.length*3+1+1+1+ee.packedLength+1+1}}});j_.setProjectionAndEllipsoid=function(e,t){let n=0;for(let i=0;i<C6e;i++)if(t instanceof FX[i]){n=i;break}e._projectionIndex=n,e._ellipsoid=t.ellipsoid};var v6e=new h,Nfe=new h,Lfe=new h;function LX(e,t,n,i,r){let o=Dl(i,e,0,v6e),s=Dl(i,e,n,Nfe),a=Dl(i,t,0,Lfe),c=j0(s,o,Nfe),u=j0(a,o,Lfe);return h.cross(u,c,r),h.normalize(r,r)}var S6e=new he,w6e=new h,I6e=new h,P6e=new h;function PX(e,t,n,i,r,o,s,a,c,u,f){if(r===0)return;let d;o===ln.GEODESIC?d=new z_(e,t,s):o===ln.RHUMB&&(d=new Vc(e,t,s));let p=d.surfaceDistance;if(p<r)return;let g=LX(e,t,i,s,P6e),m=Math.ceil(p/r),y=p/m,A=y,b=m-1,x=a.length;for(let T=0;T<b;T++){let E=d.interpolateUsingSurfaceDistance(A,S6e),v=Dl(s,E,n,w6e),S=Dl(s,E,i,I6e);h.pack(g,a,x),h.pack(v,c,x),h.pack(S,u,x),f.push(E.latitude),f.push(E.longitude),x+=3,A+=y}}var DX=new he;function Dl(e,t,n,i){return he.clone(t,DX),DX.height=n,he.toCartesian(DX,e,i)}j_.pack=function(e,t,n){let i=n??0,r=e._positions,o=r.length;t[i++]=o;for(let s=0;s<o;++s){let a=r[s];h.pack(a,t,i),i+=3}return t[i++]=e.granularity,t[i++]=e.loop?1:0,t[i++]=e.arcType,ee.pack(e._ellipsoid,t,i),i+=ee.packedLength,t[i++]=e._projectionIndex,t[i]=e._scene3DOnly?1:0,t};j_.unpack=function(e,t,n){let i=t??0,r=e[i++],o=new Array(r);for(let p=0;p<r;p++)o[p]=h.unpack(e,i),i+=3;let s=e[i++],a=e[i++]===1,c=e[i++],u=ee.unpack(e,i);i+=ee.packedLength;let f=e[i++],d=e[i]===1;return l(n)||(n=new j_({positions:o})),n._positions=o,n.granularity=s,n.loop=a,n.arcType=c,n._ellipsoid=u,n._projectionIndex=f,n._scene3DOnly=d,n};function j0(e,t,n){return h.subtract(e,t,n),h.normalize(n,n),n}function Ffe(e,t,n,i){return i=j0(e,t,i),i=h.cross(i,n,i),i=h.normalize(i,i),i=h.cross(n,i,i),i}var D6e=new h,R6e=new h,O6e=new h,tde=new h,M6e=0,N6e=-1;function RX(e,t,n,i,r){let o=j0(n,t,tde),s=Ffe(e,t,o,D6e),a=Ffe(i,t,o,R6e);if(P.equalsEpsilon(h.dot(s,a),N6e,P.EPSILON5))return r=h.cross(o,s,r),r=h.normalize(r,r),r;r=h.add(a,s,r),r=h.normalize(r,r);let c=h.cross(o,r,O6e);return h.dot(a,c)<M6e&&(r=h.negate(r,r)),r}var fk=sn.fromPointNormal(h.ZERO,h.UNIT_Y),L6e=new h,F6e=new h,B6e=new h,k6e=new h,U6e=new h,ck=new h,lk=new he,Bfe=new he,kfe=new he;j_.createGeometry=function(e){let t=!e._scene3DOnly,n=e.loop,i=e._ellipsoid,r=e.granularity,o=e.arcType,s=new FX[e._projectionIndex](i),a=Qfe,c=ede,u,f,d=e._positions,p=d.length;p===2&&(n=!1);let g,m,y,A,b=new Vc(void 0,void 0,i),x,T,E,v=[d[0]];for(f=0;f<p-1;f++)g=d[f],m=d[f+1],x=xi.lineSegmentPlane(g,m,fk,ck),l(x)&&!h.equalsEpsilon(x,g,P.EPSILON7)&&!h.equalsEpsilon(x,m,P.EPSILON7)&&(e.arcType===ln.GEODESIC?v.push(h.clone(x)):e.arcType===ln.RHUMB&&(E=i.cartesianToCartographic(x,lk).longitude,y=i.cartesianToCartographic(g,lk),A=i.cartesianToCartographic(m,Bfe),b.setEndPoints(y,A),T=b.findIntersectionWithLongitude(E,kfe),x=i.cartographicToCartesian(T,ck),l(x)&&!h.equalsEpsilon(x,g,P.EPSILON7)&&!h.equalsEpsilon(x,m,P.EPSILON7)&&v.push(h.clone(x)))),v.push(m);n&&(g=d[p-1],m=d[0],x=xi.lineSegmentPlane(g,m,fk,ck),l(x)&&!h.equalsEpsilon(x,g,P.EPSILON7)&&!h.equalsEpsilon(x,m,P.EPSILON7)&&(e.arcType===ln.GEODESIC?v.push(h.clone(x)):e.arcType===ln.RHUMB&&(E=i.cartesianToCartographic(x,lk).longitude,y=i.cartesianToCartographic(g,lk),A=i.cartesianToCartographic(m,Bfe),b.setEndPoints(y,A),T=b.findIntersectionWithLongitude(E,kfe),x=i.cartographicToCartesian(T,ck),l(x)&&!h.equalsEpsilon(x,g,P.EPSILON7)&&!h.equalsEpsilon(x,m,P.EPSILON7)&&v.push(h.clone(x)))));let S=v.length,I=new Array(S);for(f=0;f<S;f++){let q=he.fromCartesian(v[f],i);q.height=0,I[f]=q}if(I=Lr(I,he.equalsEpsilon),S=I.length,S<2)return;let R=[],O=[],L=[],_=[],C=L6e,w=F6e,D=B6e,N=k6e,F=U6e,V=I[0],B=I[1],j=I[S-1];for(C=Dl(i,j,a,C),N=Dl(i,B,a,N),w=Dl(i,V,a,w),D=Dl(i,V,c,D),n?F=RX(C,w,D,N,F):F=LX(V,B,c,i,F),h.pack(F,O,0),h.pack(w,L,0),h.pack(D,_,0),R.push(V.latitude),R.push(V.longitude),PX(V,B,a,c,r,o,i,O,L,_,R),f=1;f<S-1;++f){C=h.clone(w,C),w=h.clone(N,w);let q=I[f];Dl(i,q,c,D),Dl(i,I[f+1],a,N),RX(C,w,D,N,F),u=O.length,h.pack(F,O,u),h.pack(w,L,u),h.pack(D,_,u),R.push(q.latitude),R.push(q.longitude),PX(I[f],I[f+1],a,c,r,o,i,O,L,_,R)}let k=I[S-1],G=I[S-2];if(w=Dl(i,k,a,w),D=Dl(i,k,c,D),n){let q=I[0];C=Dl(i,G,a,C),N=Dl(i,q,a,N),F=RX(C,w,D,N,F)}else F=LX(G,k,c,i,F);if(u=O.length,h.pack(F,O,u),h.pack(w,L,u),h.pack(D,_,u),R.push(k.latitude),R.push(k.longitude),n){for(PX(k,V,a,c,r,o,i,O,L,_,R),u=O.length,f=0;f<3;++f)O[u+f]=O[f],L[u+f]=L[f],_[u+f]=_[f];R.push(V.latitude),R.push(V.longitude)}return fHe(n,s,L,_,O,R,t)};var z6e=new h,V6e=new $,j6e=new Le;function Ufe(e,t,n,i){let r=j0(n,t,z6e),o=h.dot(r,e);if(o>Zfe||o<Mfe){let s=j0(i,n,tde),a=o<Mfe?P.PI_OVER_TWO:-P.PI_OVER_TWO,c=Le.fromAxisAngle(s,a,j6e),u=$.fromQuaternion(c,V6e);return $.multiplyByVector(u,e,e),!0}return!1}var zfe=new he,H6e=new h,Vfe=new h;function xP(e,t,n,i,r){let o=he.toCartesian(t,e._ellipsoid,H6e),s=h.add(o,n,Vfe),a=!1,c=e._ellipsoid,u=c.cartesianToCartographic(s,zfe);Math.abs(t.longitude-u.longitude)>P.PI_OVER_TWO&&(a=!0,s=h.subtract(o,n,Vfe),u=c.cartesianToCartographic(s,zfe)),u.height=0;let f=e.project(u,r);return r=h.subtract(f,i,r),r.z=0,r=h.normalize(r,r),a&&h.negate(r,r),r}var G6e=new h,jfe=new h;function Hfe(e,t,n,i,r,o){let s=h.subtract(t,e,G6e);h.normalize(s,s);let a=n-Qfe,c=h.multiplyByScalar(s,a,jfe);h.add(e,c,r);let u=i-ede;c=h.multiplyByScalar(s,u,jfe),h.add(t,c,o)}var W6e=new h;function uk(e,t){let n=sn.getPointDistance(fk,e),i=sn.getPointDistance(fk,t),r=W6e;P.equalsEpsilon(n,0,P.EPSILON2)?(r=j0(t,e,r),h.multiplyByScalar(r,P.EPSILON2,r),h.add(e,r,e)):P.equalsEpsilon(i,0,P.EPSILON2)&&(r=j0(e,t,r),h.multiplyByScalar(r,P.EPSILON2,r),h.add(t,r,t))}function q6e(e,t){let n=Math.abs(e.longitude),i=Math.abs(t.longitude);if(P.equalsEpsilon(n,P.PI,P.EPSILON11)){let r=P.sign(t.longitude);return e.longitude=r*(n-P.EPSILON11),1}else if(P.equalsEpsilon(i,P.PI,P.EPSILON11)){let r=P.sign(e.longitude);return t.longitude=r*(i-P.EPSILON11),2}return 0}var nde=new he,ide=new he,Gfe=new h,OX=new h,Wfe=new h,qfe=new h,Y6e=new h,Yfe=new h,X6e=[nde,ide],K6e=new ie,$6e=new h,J6e=new h,Z6e=new h,Q6e=new h,eHe=new h,tHe=new h,MX=new h,NX=new h,nHe=new h,iHe=new h,rHe=new h,Xfe=new h,oHe=new h,sHe=new h,aHe=new Sn,cHe=new Sn,Kfe=new h,lHe=new h,$fe=new h,uHe=[new ue,new ue],rde=[0,2,1,0,3,2,0,7,3,0,4,7,0,5,4,0,1,5,5,7,4,5,6,7,5,2,6,5,1,2,3,6,2,3,7,6],Jfe=rde.length;function fHe(e,t,n,i,r,o,s){let a,c,u=t._ellipsoid,f=n.length/3-1,d=f*8,p=d*4,g=f*36,m=d>65535?new Uint32Array(g):new Uint16Array(g),y=new Float64Array(d*3),A=new Float32Array(p),b=new Float32Array(p),x=new Float32Array(p),T=new Float32Array(p),E=new Float32Array(p),v,S,I,R;s&&(v=new Float32Array(p),S=new Float32Array(p),I=new Float32Array(p),R=new Float32Array(d*2));let O=o.length/2,L=0,_=nde;_.height=0;let C=ide;C.height=0;let w=Gfe,D=OX;if(s)for(c=0,a=1;a<O;a++)_.latitude=o[c],_.longitude=o[c+1],C.latitude=o[c+2],C.longitude=o[c+3],w=t.project(_,w),D=t.project(C,D),L+=h.distance(w,D),c+=2;let N=i.length/3;D=h.unpack(i,0,D);let F=0;for(c=3,a=1;a<N;a++)w=h.clone(D,w),D=h.unpack(i,c,D),F+=h.distance(w,D),c+=3;let V;c=3;let B=0,j=0,k=0,G=0,q=!1,Q=h.unpack(n,0,qfe),W=h.unpack(i,0,OX),J=h.unpack(r,0,Yfe);if(e){let ve=h.unpack(n,n.length-6,Wfe);Ufe(J,ve,Q,W)&&(J=h.negate(J,J))}let Z=0,ae=0,Ae=0;for(a=0;a<f;a++){let ve=h.clone(Q,Wfe),Re=h.clone(W,Gfe),Qe=h.clone(J,Y6e);q&&(Qe=h.negate(Qe,Qe)),Q=h.unpack(n,c,qfe),W=h.unpack(i,c,OX),J=h.unpack(r,c,Yfe),q=Ufe(J,ve,Q,W),_.latitude=o[B],_.longitude=o[B+1],C.latitude=o[B+2],C.longitude=o[B+3];let He,Ye,Ke,Pe;if(s){let pi=q6e(_,C);He=t.project(_,eHe),Ye=t.project(C,tHe);let ao=j0(Ye,He,Kfe);ao.y=Math.abs(ao.y),Ke=MX,Pe=NX,pi===0||h.dot(ao,h.UNIT_Y)>Zfe?(Ke=xP(t,_,Qe,He,MX),Pe=xP(t,C,J,Ye,NX)):pi===1?(Pe=xP(t,C,J,Ye,NX),Ke.x=0,Ke.y=P.sign(_.longitude-Math.abs(C.longitude)),Ke.z=0):(Ke=xP(t,_,Qe,He,MX),Pe.x=0,Pe.y=P.sign(_.longitude-C.longitude),Pe.z=0)}let qe=h.distance(Re,W),st=Sn.fromCartesian(ve,aHe),vt=h.subtract(Q,ve,nHe),jt=h.normalize(vt,Xfe),lt=h.subtract(Re,ve,iHe);lt=h.normalize(lt,lt);let mt=h.cross(jt,lt,Xfe);mt=h.normalize(mt,mt);let ft=h.cross(lt,Qe,oHe);ft=h.normalize(ft,ft);let Yt=h.subtract(W,Q,rHe);Yt=h.normalize(Yt,Yt);let rt=h.cross(J,Yt,sHe);rt=h.normalize(rt,rt);let ht=qe/F,Li=Z/F,Yn=0,yi,zi,Si,ui=0,Ai=0;if(s){Yn=h.distance(He,Ye),yi=Sn.fromCartesian(He,cHe),zi=h.subtract(Ye,He,Kfe),Si=h.normalize(zi,lHe);let pi=Si.x;Si.x=Si.y,Si.y=-pi,ui=Yn/L,Ai=ae/L}for(V=0;V<8;V++){let pi=G+V*4,ao=j+V*2,nr=pi+3,jo=V<4?1:-1,Fn=V===2||V===3||V===6||V===7?1:-1;h.pack(st.high,A,pi),A[nr]=vt.x,h.pack(st.low,b,pi),b[nr]=vt.y,h.pack(ft,x,pi),x[nr]=vt.z,h.pack(rt,T,pi),T[nr]=ht*jo,h.pack(mt,E,pi);let Vi=Li*Fn;Vi===0&&Fn<0&&(Vi=9),E[nr]=Vi,s&&(v[pi]=yi.high.x,v[pi+1]=yi.high.y,v[pi+2]=yi.low.x,v[pi+3]=yi.low.y,I[pi]=-Ke.y,I[pi+1]=Ke.x,I[pi+2]=Pe.y,I[pi+3]=-Pe.x,S[pi]=zi.x,S[pi+1]=zi.y,S[pi+2]=Si.x,S[pi+3]=Si.y,R[ao]=ui*jo,Vi=Ai*Fn,Vi===0&&Fn<0&&(Vi=9),R[ao+1]=Vi)}let zn=Z6e,tn=Q6e,Hn=$6e,Ki=J6e,wr=ie.fromCartographicArray(X6e,K6e),so=Ni.getMinimumMaximumHeights(wr,u),Ts=so.minimumTerrainHeight,zs=so.maximumTerrainHeight;Ae+=Math.abs(Ts),Ae+=Math.abs(zs),Hfe(ve,Re,Ts,zs,zn,Hn),Hfe(Q,W,Ts,zs,tn,Ki);let $r=h.multiplyByScalar(mt,P.EPSILON5,$fe);h.add(zn,$r,zn),h.add(tn,$r,tn),h.add(Hn,$r,Hn),h.add(Ki,$r,Ki),uk(zn,tn),uk(Hn,Ki),h.pack(zn,y,k),h.pack(tn,y,k+3),h.pack(Ki,y,k+6),h.pack(Hn,y,k+9),$r=h.multiplyByScalar(mt,-2*P.EPSILON5,$fe),h.add(zn,$r,zn),h.add(tn,$r,tn),h.add(Hn,$r,Hn),h.add(Ki,$r,Ki),uk(zn,tn),uk(Hn,Ki),h.pack(zn,y,k+12),h.pack(tn,y,k+15),h.pack(Ki,y,k+18),h.pack(Hn,y,k+21),B+=2,c+=3,j+=16,k+=24,G+=32,Z+=qe,ae+=Yn}c=0;let fe=0;for(a=0;a<f;a++){for(V=0;V<Jfe;V++)m[c+V]=rde[V]+fe;fe+=8,c+=Jfe}let xe=uHe;ue.fromVertices(n,h.ZERO,3,xe[0]),ue.fromVertices(i,h.ZERO,3,xe[1]);let ge=ue.fromBoundingSpheres(xe);ge.radius+=Ae/(f*2);let we={position:new Ne({componentDatatype:Y.DOUBLE,componentsPerAttribute:3,normalize:!1,values:y}),startHiAndForwardOffsetX:V_(A),startLoAndForwardOffsetY:V_(b),startNormalAndForwardOffsetZ:V_(x),endNormalAndTextureCoordinateNormalizationX:V_(T),rightNormalAndTextureCoordinateNormalizationY:V_(E)};return s&&(we.startHiLo2D=V_(v),we.offsetAndRight2D=V_(S),we.startEndNormals2D=V_(I),we.texcoordNormalization2D=new Ne({componentDatatype:Y.FLOAT,componentsPerAttribute:2,normalize:!1,values:R})),new wt({attributes:we,indices:m,boundingSphere:ge})}function V_(e){return new Ne({componentDatatype:Y.FLOAT,componentsPerAttribute:4,normalize:!1,values:e})}j_._projectNormal=xP;var JE=j_;var ode={ADD:te.FUNC_ADD,SUBTRACT:te.FUNC_SUBTRACT,REVERSE_SUBTRACT:te.FUNC_REVERSE_SUBTRACT,MIN:te.MIN,MAX:te.MAX};Object.freeze(ode);var jc=ode;var sde={ZERO:te.ZERO,ONE:te.ONE,SOURCE_COLOR:te.SRC_COLOR,ONE_MINUS_SOURCE_COLOR:te.ONE_MINUS_SRC_COLOR,DESTINATION_COLOR:te.DST_COLOR,ONE_MINUS_DESTINATION_COLOR:te.ONE_MINUS_DST_COLOR,SOURCE_ALPHA:te.SRC_ALPHA,ONE_MINUS_SOURCE_ALPHA:te.ONE_MINUS_SRC_ALPHA,DESTINATION_ALPHA:te.DST_ALPHA,ONE_MINUS_DESTINATION_ALPHA:te.ONE_MINUS_DST_ALPHA,CONSTANT_COLOR:te.CONSTANT_COLOR,ONE_MINUS_CONSTANT_COLOR:te.ONE_MINUS_CONSTANT_COLOR,CONSTANT_ALPHA:te.CONSTANT_ALPHA,ONE_MINUS_CONSTANT_ALPHA:te.ONE_MINUS_CONSTANT_ALPHA,SOURCE_ALPHA_SATURATE:te.SRC_ALPHA_SATURATE};Object.freeze(sde);var Zr=sde;var ade={DISABLED:Object.freeze({enabled:!1}),ALPHA_BLEND:Object.freeze({enabled:!0,equationRgb:jc.ADD,equationAlpha:jc.ADD,functionSourceRgb:Zr.SOURCE_ALPHA,functionSourceAlpha:Zr.ONE,functionDestinationRgb:Zr.ONE_MINUS_SOURCE_ALPHA,functionDestinationAlpha:Zr.ONE_MINUS_SOURCE_ALPHA}),PRE_MULTIPLIED_ALPHA_BLEND:Object.freeze({enabled:!0,equationRgb:jc.ADD,equationAlpha:jc.ADD,functionSourceRgb:Zr.ONE,functionSourceAlpha:Zr.ONE,functionDestinationRgb:Zr.ONE_MINUS_SOURCE_ALPHA,functionDestinationAlpha:Zr.ONE_MINUS_SOURCE_ALPHA}),ADDITIVE_BLEND:Object.freeze({enabled:!0,equationRgb:jc.ADD,equationAlpha:jc.ADD,functionSourceRgb:Zr.SOURCE_ALPHA,functionSourceAlpha:Zr.ONE,functionDestinationRgb:Zr.ONE,functionDestinationAlpha:Zr.ONE})};Object.freeze(ade);var nn=ade;var BX={TERRAIN:0,CESIUM_3D_TILE:1,BOTH:2};BX.NUMBER_OF_CLASSIFICATION_TYPES=3;Object.freeze(BX);var Qn=BX;var cde={FRONT:te.FRONT,BACK:te.BACK,FRONT_AND_BACK:te.FRONT_AND_BACK};Object.freeze(cde);var Hi=cde;var ZE=`in vec4 v_color; void main() { -vec3 positionToEyeEC = -v_positionEC; -mat3 tangentToEyeMatrix = czm_tangentToEyeSpaceMatrix(v_normalEC, v_tangentEC, v_bitangentEC); -vec3 normalEC = normalize(v_normalEC); -#ifdef FACE_FORWARD -normalEC = faceforward(normalEC, vec3(0.0, 0.0, 1.0), -normalEC); -#endif -czm_materialInput materialInput; -materialInput.normalEC = normalEC; -materialInput.tangentToEyeMatrix = tangentToEyeMatrix; -materialInput.positionToEyeEC = positionToEyeEC; -materialInput.st = v_st; -czm_material material = czm_getMaterial(materialInput); -#ifdef FLAT -out_FragColor = vec4(material.diffuse + material.emission, material.alpha); -#else -out_FragColor = czm_phong(normalize(positionToEyeEC), material, czm_lightDirectionEC); -#endif -} -`;var lk=`in vec3 position3DHigh; -in vec3 position3DLow; -in vec3 normal; -in vec3 tangent; -in vec3 bitangent; -in vec2 st; -in float batchId; -out vec3 v_positionEC; -out vec3 v_normalEC; -out vec3 v_tangentEC; -out vec3 v_bitangentEC; -out vec2 v_st; -void main() -{ -vec4 p = czm_computePosition(); -v_positionEC = (czm_modelViewRelativeToEye * p).xyz; -v_normalEC = czm_normal * normal; -v_tangentEC = czm_normal * tangent; -v_bitangentEC = czm_normal * bitangent; -v_st = st; -gl_Position = czm_modelViewProjectionRelativeToEye * p; -} -`;var uk=`in vec3 v_positionEC; -in vec3 v_normalEC; -void main() -{ -vec3 positionToEyeEC = -v_positionEC; -vec3 normalEC = normalize(v_normalEC); -#ifdef FACE_FORWARD -normalEC = faceforward(normalEC, vec3(0.0, 0.0, 1.0), -normalEC); -#endif -czm_materialInput materialInput; -materialInput.normalEC = normalEC; -materialInput.positionToEyeEC = positionToEyeEC; -czm_material material = czm_getMaterial(materialInput); -#ifdef FLAT -out_FragColor = vec4(material.diffuse + material.emission, material.alpha); -#else -out_FragColor = czm_phong(normalize(positionToEyeEC), material, czm_lightDirectionEC); -#endif +out_FragColor = czm_gammaCorrect(v_color); } -`;var fk=`in vec3 position3DHigh; +`;var dk=`in vec3 position3DHigh; in vec3 position3DLow; -in vec3 normal; +in vec3 prevPosition3DHigh; +in vec3 prevPosition3DLow; +in vec3 nextPosition3DHigh; +in vec3 nextPosition3DLow; +in vec2 expandAndWidth; +in vec4 color; in float batchId; -out vec3 v_positionEC; -out vec3 v_normalEC; +out vec4 v_color; void main() { +float expandDir = expandAndWidth.x; +float width = abs(expandAndWidth.y) + 0.5; +bool usePrev = expandAndWidth.y < 0.0; vec4 p = czm_computePosition(); -v_positionEC = (czm_modelViewRelativeToEye * p).xyz; -v_normalEC = czm_normal * normal; -gl_Position = czm_modelViewProjectionRelativeToEye * p; -} -`;var dk=`in vec3 v_positionEC; -in vec3 v_normalEC; -in vec2 v_st; -void main() -{ -vec3 positionToEyeEC = -v_positionEC; -vec3 normalEC = normalize(v_normalEC); -#ifdef FACE_FORWARD -normalEC = faceforward(normalEC, vec3(0.0, 0.0, 1.0), -normalEC); -#endif -czm_materialInput materialInput; -materialInput.normalEC = normalEC; -materialInput.positionToEyeEC = positionToEyeEC; -materialInput.st = v_st; -czm_material material = czm_getMaterial(materialInput); -#ifdef FLAT -out_FragColor = vec4(material.diffuse + material.emission, material.alpha); -#else -out_FragColor = czm_phong(normalize(positionToEyeEC), material, czm_lightDirectionEC); -#endif +vec4 prev = czm_computePrevPosition(); +vec4 next = czm_computeNextPosition(); +float angle; +vec4 positionWC = getPolylineWindowCoordinates(p, prev, next, expandDir, width, usePrev, angle); +gl_Position = czm_viewportOrthographic * positionWC; +v_color = color; } -`;var hk=`in vec3 position3DHigh; +`;function QE(e){e=e??H.EMPTY_OBJECT,this.material=e.material,this.translucent=e.translucent??!0,this._vertexShaderSource=e.vertexShaderSource,this._fragmentShaderSource=e.fragmentShaderSource,this._renderState=e.renderState,this._closed=e.closed??!1}Object.defineProperties(QE.prototype,{vertexShaderSource:{get:function(){return this._vertexShaderSource}},fragmentShaderSource:{get:function(){return this._fragmentShaderSource}},renderState:{get:function(){return this._renderState}},closed:{get:function(){return this._closed}}});QE.prototype.getFragmentShaderSource=function(){let e=[];return this.flat&&e.push("#define FLAT"),this.faceForward&&e.push("#define FACE_FORWARD"),l(this.material)&&e.push(this.material.shaderSource),e.push(this.fragmentShaderSource),e.join(` +`)};QE.prototype.isTranslucent=function(){return l(this.material)&&this.material.isTranslucent()||!l(this.material)&&this.translucent};QE.prototype.getRenderState=function(){let e=this.isTranslucent(),t=Ze(this.renderState,!1);return e?(t.depthMask=!1,t.blending=nn.ALPHA_BLEND):t.depthMask=!0,t};QE.getDefaultRenderState=function(e,t,n){let i={depthTest:{enabled:!0}};return e&&(i.depthMask=!1,i.blending=nn.ALPHA_BLEND),t&&(i.cull={enabled:!0,face:Hi.BACK}),l(n)&&(i=Mt(n,i,!0)),i};var Rr=QE;var dHe=`#define CLIP_POLYLINE +${du} +${dk}`,hHe=ZE;function Mb(e){e=e??H.EMPTY_OBJECT;let t=e.translucent??!0,n=!1,i=Mb.VERTEX_FORMAT;this.material=void 0,this.translucent=t,this._vertexShaderSource=e.vertexShaderSource??dHe,this._fragmentShaderSource=e.fragmentShaderSource??hHe,this._renderState=Rr.getDefaultRenderState(t,n,e.renderState),this._closed=n,this._vertexFormat=i}Object.defineProperties(Mb.prototype,{vertexShaderSource:{get:function(){return this._vertexShaderSource}},fragmentShaderSource:{get:function(){return this._fragmentShaderSource}},renderState:{get:function(){return this._renderState}},closed:{get:function(){return this._closed}},vertexFormat:{get:function(){return this._vertexFormat}}});Mb.VERTEX_FORMAT=Be.POSITION_ONLY;Mb.prototype.getFragmentShaderSource=Rr.prototype.getFragmentShaderSource;Mb.prototype.isTranslucent=Rr.prototype.isTranslucent;Mb.prototype.getRenderState=Rr.prototype.getRenderState;var qs=Mb;var hk=`in vec3 position3DHigh; in vec3 position3DLow; -in vec3 normal; +in vec3 prevPosition3DHigh; +in vec3 prevPosition3DLow; +in vec3 nextPosition3DHigh; +in vec3 nextPosition3DLow; +in vec2 expandAndWidth; in vec2 st; in float batchId; -out vec3 v_positionEC; -out vec3 v_normalEC; +out float v_width; out vec2 v_st; +out float v_polylineAngle; void main() { +float expandDir = expandAndWidth.x; +float width = abs(expandAndWidth.y) + 0.5; +bool usePrev = expandAndWidth.y < 0.0; vec4 p = czm_computePosition(); -v_positionEC = (czm_modelViewRelativeToEye * p).xyz; -v_normalEC = czm_normal * normal; -v_st = st; -gl_Position = czm_modelViewProjectionRelativeToEye * p; +vec4 prev = czm_computePrevPosition(); +vec4 next = czm_computeNextPosition(); +float angle; +vec4 positionWC = getPolylineWindowCoordinates(p, prev, next, expandDir, width, usePrev, angle); +gl_Position = czm_viewportOrthographic * positionWC; +v_width = width; +v_st.s = st.s; +v_st.t = czm_writeNonPerspective(st.t, gl_Position.w); +v_polylineAngle = angle; } -`;var Ife={ADD:te.FUNC_ADD,SUBTRACT:te.FUNC_SUBTRACT,REVERSE_SUBTRACT:te.FUNC_REVERSE_SUBTRACT,MIN:te.MIN,MAX:te.MAX};Object.freeze(Ife);var Vc=Ife;var Pfe={ZERO:te.ZERO,ONE:te.ONE,SOURCE_COLOR:te.SRC_COLOR,ONE_MINUS_SOURCE_COLOR:te.ONE_MINUS_SRC_COLOR,DESTINATION_COLOR:te.DST_COLOR,ONE_MINUS_DESTINATION_COLOR:te.ONE_MINUS_DST_COLOR,SOURCE_ALPHA:te.SRC_ALPHA,ONE_MINUS_SOURCE_ALPHA:te.ONE_MINUS_SRC_ALPHA,DESTINATION_ALPHA:te.DST_ALPHA,ONE_MINUS_DESTINATION_ALPHA:te.ONE_MINUS_DST_ALPHA,CONSTANT_COLOR:te.CONSTANT_COLOR,ONE_MINUS_CONSTANT_COLOR:te.ONE_MINUS_CONSTANT_COLOR,CONSTANT_ALPHA:te.CONSTANT_ALPHA,ONE_MINUS_CONSTANT_ALPHA:te.ONE_MINUS_CONSTANT_ALPHA,SOURCE_ALPHA_SATURATE:te.SRC_ALPHA_SATURATE};Object.freeze(Pfe);var Zr=Pfe;var Dfe={DISABLED:Object.freeze({enabled:!1}),ALPHA_BLEND:Object.freeze({enabled:!0,equationRgb:Vc.ADD,equationAlpha:Vc.ADD,functionSourceRgb:Zr.SOURCE_ALPHA,functionSourceAlpha:Zr.ONE,functionDestinationRgb:Zr.ONE_MINUS_SOURCE_ALPHA,functionDestinationAlpha:Zr.ONE_MINUS_SOURCE_ALPHA}),PRE_MULTIPLIED_ALPHA_BLEND:Object.freeze({enabled:!0,equationRgb:Vc.ADD,equationAlpha:Vc.ADD,functionSourceRgb:Zr.ONE,functionSourceAlpha:Zr.ONE,functionDestinationRgb:Zr.ONE_MINUS_SOURCE_ALPHA,functionDestinationAlpha:Zr.ONE_MINUS_SOURCE_ALPHA}),ADDITIVE_BLEND:Object.freeze({enabled:!0,equationRgb:Vc.ADD,equationAlpha:Vc.ADD,functionSourceRgb:Zr.SOURCE_ALPHA,functionSourceAlpha:Zr.ONE,functionDestinationRgb:Zr.ONE,functionDestinationAlpha:Zr.ONE})};Object.freeze(Dfe);var nn=Dfe;var Rfe={FRONT:te.FRONT,BACK:te.BACK,FRONT_AND_BACK:te.FRONT_AND_BACK};Object.freeze(Rfe);var Gi=Rfe;function ZE(e){e=e??H.EMPTY_OBJECT,this.material=e.material,this.translucent=e.translucent??!0,this._vertexShaderSource=e.vertexShaderSource,this._fragmentShaderSource=e.fragmentShaderSource,this._renderState=e.renderState,this._closed=e.closed??!1}Object.defineProperties(ZE.prototype,{vertexShaderSource:{get:function(){return this._vertexShaderSource}},fragmentShaderSource:{get:function(){return this._fragmentShaderSource}},renderState:{get:function(){return this._renderState}},closed:{get:function(){return this._closed}}});ZE.prototype.getFragmentShaderSource=function(){let e=[];return this.flat&&e.push("#define FLAT"),this.faceForward&&e.push("#define FACE_FORWARD"),l(this.material)&&e.push(this.material.shaderSource),e.push(this.fragmentShaderSource),e.join(` -`)};ZE.prototype.isTranslucent=function(){return l(this.material)&&this.material.isTranslucent()||!l(this.material)&&this.translucent};ZE.prototype.getRenderState=function(){let e=this.isTranslucent(),t=Ze(this.renderState,!1);return e?(t.depthMask=!1,t.blending=nn.ALPHA_BLEND):t.depthMask=!0,t};ZE.getDefaultRenderState=function(e,t,n){let i={depthTest:{enabled:!0}};return e&&(i.depthMask=!1,i.blending=nn.ALPHA_BLEND),t&&(i.cull={enabled:!0,face:Gi.BACK}),l(n)&&(i=Mt(n,i,!0)),i};var Rr=ZE;var mk=`uniform sampler2D image; +`;var mk=`uniform sampler2D image; czm_material czm_getMaterial(czm_materialInput materialInput) { czm_material material = czm_getDefaultMaterial(materialInput); @@ -6683,67 +6626,19 @@ material.specular = specularIntensity; material.shininess = 10.0; return material; } -`;function it(e){this.type=void 0,this.shaderSource=void 0,this.materials=void 0,this.uniforms=void 0,this._uniforms=void 0,this.translucent=void 0,this._minificationFilter=e.minificationFilter??Wt.LINEAR,this._magnificationFilter=e.magnificationFilter??Jn.LINEAR,this._strict=void 0,this._template=void 0,this._count=void 0,this._texturePaths={},this._loadedImages=[],this._loadedCubeMaps=[],this._textures={},this._updateFunctions=[],this._defaultTexture=void 0,this._initializationPromises=[],this._initializationError=void 0,z6e(e,this),Object.defineProperties(this,{type:{value:this.type,writable:!1},minificationFilter:{get:function(){return this._minificationFilter},set:function(t){this._minificationFilter=t}},magnificationFilter:{get:function(){return this._magnificationFilter},set:function(t){this._magnificationFilter=t}}}),l(it._uniformList[this.type])||(it._uniformList[this.type]=Object.keys(this._uniforms))}it._uniformList={};it.fromType=function(e,t){let n=new it({fabric:{type:e}});if(l(t))for(let i in t)t.hasOwnProperty(i)&&(n.uniforms[i]=t[i]);return n};it.fromTypeAsync=async function(e,t){let n=[],i=new it({fabric:{type:e,uniforms:t}});if(Nfe(i,n),await Promise.all(n),n.length=0,l(i._initializationError))throw i._initializationError;return i};function Nfe(e,t){t.push(...e._initializationPromises);let n=e.materials;for(let i in n)if(n.hasOwnProperty(i)){let r=n[i];Nfe(r,t)}}it.prototype.isTranslucent=function(){if(l(this.translucent))return typeof this.translucent=="function"?this.translucent():this.translucent;let e=!0,t=this._translucentFunctions,n=t.length;for(let i=0;i<n;++i){let r=t[i];if(typeof r=="function"?e=e&&r():e=e&&r,!e)break}return e};it.prototype.update=function(e){this._defaultTexture=e.defaultTexture;let t,n,i=this._loadedImages,r=i.length;for(t=0;t<r;++t){let c=i[t];n=c.id;let u=c.image,f;Array.isArray(u)&&(f=u.slice(1,u.length).map(function(y){return y.bufferView}),u=u[0]);let d=new Ht({minificationFilter:this._minificationFilter,magnificationFilter:this._magnificationFilter}),p;l(u.internalFormat)?p=new Dt({context:e,pixelFormat:u.internalFormat,width:u.width,height:u.height,source:{arrayBufferView:u.bufferView,mipLevels:f},sampler:d}):p=new Dt({context:e,source:u,sampler:d});let g=this._textures[n];l(g)&&g!==this._defaultTexture&&g.destroy(),this._textures[n]=p;let m=`${n}Dimensions`;if(this.uniforms.hasOwnProperty(m)){let y=this.uniforms[m];y.x=p._width,y.y=p._height}}i.length=0;let o=this._loadedCubeMaps;for(r=o.length,t=0;t<r;++t){let c=o[t];n=c.id;let u=c.images,f=new ls({context:e,source:{positiveX:u[0],negativeX:u[1],positiveY:u[2],negativeY:u[3],positiveZ:u[4],negativeZ:u[5]},sampler:new Ht({minificationFilter:this._minificationFilter,magnificationFilter:this._magnificationFilter})});this._textures[n]=f}o.length=0;let s=this._updateFunctions;for(r=s.length,t=0;t<r;++t)s[t](this,e);let a=this.materials;for(let c in a)a.hasOwnProperty(c)&&a[c].update(e)};it.prototype.isDestroyed=function(){return!1};it.prototype.destroy=function(){let e=this._textures;for(let n in e)if(e.hasOwnProperty(n)){let i=e[n];i!==this._defaultTexture&&i.destroy()}let t=this.materials;for(let n in t)t.hasOwnProperty(n)&&t[n].destroy();return le(this)};function z6e(e,t){e=e??H.EMPTY_OBJECT,t._strict=e.strict??!1,t._count=e.count??0,t._template=Ze(e.fabric??H.EMPTY_OBJECT),t.fabric=Ze(e.fabric??H.EMPTY_OBJECT),t._template.uniforms=Ze(t._template.uniforms??H.EMPTY_OBJECT),t._template.materials=Ze(t._template.materials??H.EMPTY_OBJECT),t.type=l(t._template.type)?t._template.type:Kn(),t.shaderSource="",t.materials={},t.uniforms={},t._uniforms={},t._translucentFunctions=[];let n,i=it._materialCache.getMaterial(t.type);if(l(i)){let o=Ze(i.fabric,!0);t._template=Mt(t._template,o,!0),n=i.translucent}G6e(t),q6e(t),$6e(t),Z6e(t),l(i)||it._materialCache.addMaterial(t.type,t);let r=t._translucentFunctions.length===0?!0:void 0;if(n=n??r,n=e.translucent??n,l(n))if(typeof n=="function"){let o=function(){return n(t)};t._translucentFunctions.push(o)}else t._translucentFunctions.push(n)}function TX(e,t,n,i){if(l(e)){for(let r in e)if(e.hasOwnProperty(r)){let o=t.indexOf(r)!==-1;(i&&!o||!i&&o)&&n(r,t)}}}function Ofe(e,t){}function V6e(e,t){}var j6e=["type","materials","uniforms","components","source"],H6e=["diffuse","specular","shininess","normal","emission","alpha"];function G6e(e){let t=e._template,n=t.uniforms,i=t.materials,r=t.components;TX(t,j6e,Ofe,!0),TX(r,H6e,Ofe,!0);let o=[];for(let s in i)i.hasOwnProperty(s)&&o.push(s);TX(n,o,V6e,!1)}function W6e(e,t){let n=t._template.materials;for(let i in n)if(n.hasOwnProperty(i)&&e.indexOf(i)>-1)return!0;return!1}function q6e(e){let t=e._template.components,n=e._template.source;if(l(n))e.shaderSource+=`${n} +`;function nt(e){this.type=void 0,this.shaderSource=void 0,this.materials=void 0,this.uniforms=void 0,this._uniforms=void 0,this.translucent=void 0,this._minificationFilter=e.minificationFilter??Wt.LINEAR,this._magnificationFilter=e.magnificationFilter??Jn.LINEAR,this._strict=void 0,this._template=void 0,this._count=void 0,this._texturePaths={},this._loadedImages=[],this._loadedCubeMaps=[],this._textures={},this._updateFunctions=[],this._defaultTexture=void 0,this._initializationPromises=[],this._initializationError=void 0,mHe(e,this),Object.defineProperties(this,{type:{value:this.type,writable:!1},minificationFilter:{get:function(){return this._minificationFilter},set:function(t){this._minificationFilter=t}},magnificationFilter:{get:function(){return this._magnificationFilter},set:function(t){this._magnificationFilter=t}}}),l(nt._uniformList[this.type])||(nt._uniformList[this.type]=Object.keys(this._uniforms))}nt._uniformList={};nt.fromType=function(e,t){let n=new nt({fabric:{type:e}});if(l(t))for(let i in t)t.hasOwnProperty(i)&&(n.uniforms[i]=t[i]);return n};nt.fromTypeAsync=async function(e,t){let n=[],i=new nt({fabric:{type:e,uniforms:t}});if(fde(i,n),await Promise.all(n),n.length=0,l(i._initializationError))throw i._initializationError;return i};function fde(e,t){t.push(...e._initializationPromises);let n=e.materials;for(let i in n)if(n.hasOwnProperty(i)){let r=n[i];fde(r,t)}}nt.prototype.isTranslucent=function(){if(l(this.translucent))return typeof this.translucent=="function"?this.translucent():this.translucent;let e=!0,t=this._translucentFunctions,n=t.length;for(let i=0;i<n;++i){let r=t[i];if(typeof r=="function"?e=e&&r():e=e&&r,!e)break}return e};nt.prototype.update=function(e){this._defaultTexture=e.defaultTexture;let t,n,i=this._loadedImages,r=i.length;for(t=0;t<r;++t){let c=i[t];n=c.id;let u=c.image,f;Array.isArray(u)&&(f=u.slice(1,u.length).map(function(y){return y.bufferView}),u=u[0]);let d=new Ht({minificationFilter:this._minificationFilter,magnificationFilter:this._magnificationFilter}),p;l(u.internalFormat)?p=new Dt({context:e,pixelFormat:u.internalFormat,width:u.width,height:u.height,source:{arrayBufferView:u.bufferView,mipLevels:f},sampler:d}):p=new Dt({context:e,source:u,sampler:d});let g=this._textures[n];l(g)&&g!==this._defaultTexture&&g.destroy(),this._textures[n]=p;let m=`${n}Dimensions`;if(this.uniforms.hasOwnProperty(m)){let y=this.uniforms[m];y.x=p._width,y.y=p._height}}i.length=0;let o=this._loadedCubeMaps;for(r=o.length,t=0;t<r;++t){let c=o[t];n=c.id;let u=c.images,f=new ls({context:e,source:{positiveX:u[0],negativeX:u[1],positiveY:u[2],negativeY:u[3],positiveZ:u[4],negativeZ:u[5]},sampler:new Ht({minificationFilter:this._minificationFilter,magnificationFilter:this._magnificationFilter})});this._textures[n]=f}o.length=0;let s=this._updateFunctions;for(r=s.length,t=0;t<r;++t)s[t](this,e);let a=this.materials;for(let c in a)a.hasOwnProperty(c)&&a[c].update(e)};nt.prototype.isDestroyed=function(){return!1};nt.prototype.destroy=function(){let e=this._textures;for(let n in e)if(e.hasOwnProperty(n)){let i=e[n];i!==this._defaultTexture&&i.destroy()}let t=this.materials;for(let n in t)t.hasOwnProperty(n)&&t[n].destroy();return le(this)};function mHe(e,t){e=e??H.EMPTY_OBJECT,t._strict=e.strict??!1,t._count=e.count??0,t._template=Ze(e.fabric??H.EMPTY_OBJECT),t.fabric=Ze(e.fabric??H.EMPTY_OBJECT),t._template.uniforms=Ze(t._template.uniforms??H.EMPTY_OBJECT),t._template.materials=Ze(t._template.materials??H.EMPTY_OBJECT),t.type=l(t._template.type)?t._template.type:Kn(),t.shaderSource="",t.materials={},t.uniforms={},t._uniforms={},t._translucentFunctions=[];let n,i=nt._materialCache.getMaterial(t.type);if(l(i)){let o=Ze(i.fabric,!0);t._template=Mt(t._template,o,!0),n=i.translucent}yHe(t),bHe(t),CHe(t),SHe(t),l(i)||nt._materialCache.addMaterial(t.type,t);let r=t._translucentFunctions.length===0?!0:void 0;if(n=n??r,n=e.translucent??n,l(n))if(typeof n=="function"){let o=function(){return n(t)};t._translucentFunctions.push(o)}else t._translucentFunctions.push(n)}function kX(e,t,n,i){if(l(e)){for(let r in e)if(e.hasOwnProperty(r)){let o=t.indexOf(r)!==-1;(i&&!o||!i&&o)&&n(r,t)}}}function lde(e,t){}function pHe(e,t){}var gHe=["type","materials","uniforms","components","source"],_He=["diffuse","specular","shininess","normal","emission","alpha"];function yHe(e){let t=e._template,n=t.uniforms,i=t.materials,r=t.components;kX(t,gHe,lde,!0),kX(r,_He,lde,!0);let o=[];for(let s in i)i.hasOwnProperty(s)&&o.push(s);kX(n,o,pHe,!1)}function AHe(e,t){let n=t._template.materials;for(let i in n)if(n.hasOwnProperty(i)&&e.indexOf(i)>-1)return!0;return!1}function bHe(e){let t=e._template.components,n=e._template.source;if(l(n))e.shaderSource+=`${n} `;else{if(e.shaderSource+=`czm_material czm_getMaterial(czm_materialInput materialInput) { `,e.shaderSource+=`czm_material material = czm_getDefaultMaterial(materialInput); -`,l(t)){let i=Object.keys(e._template.materials).length>0;for(let r in t)if(t.hasOwnProperty(r))if(r==="diffuse"||r==="emission"){let s=i&&W6e(t[r],e)?t[r]:`czm_gammaCorrect(${t[r]})`;e.shaderSource+=`material.${r} = ${s}; +`,l(t)){let i=Object.keys(e._template.materials).length>0;for(let r in t)if(t.hasOwnProperty(r))if(r==="diffuse"||r==="emission"){let s=i&&AHe(t[r],e)?t[r]:`czm_gammaCorrect(${t[r]})`;e.shaderSource+=`material.${r} = ${s}; `}else r==="alpha"?e.shaderSource+=`material.alpha = ${t.alpha}; `:e.shaderSource+=`material.${r} = ${t[r]}; `}e.shaderSource+=`return material; } -`}}var Mfe={mat2:$i,mat3:$,mat4:M},Y6e=/\.ktx2$/i;function X6e(e){let t;return function(n,i){let r=n.uniforms,o=r[e],s=t!==o,a=!l(o)||o===it.DefaultImageId;t=o;let c=n._textures[e],u,f;if(o instanceof HTMLVideoElement){if(o.readyState>=2){if(s&&l(c)&&(c!==i.defaultTexture&&c.destroy(),c=void 0),!l(c)||c===i.defaultTexture){let d=new Ht({minificationFilter:n._minificationFilter,magnificationFilter:n._magnificationFilter});c=new Dt({context:i,source:o,sampler:d}),n._textures[e]=c;return}c.copyFrom({source:o})}else l(c)||(n._textures[e]=i.defaultTexture);return}if(o instanceof Dt&&o!==c){n._texturePaths[e]=void 0;let d=n._textures[e];l(d)&&d!==n._defaultTexture&&d.destroy(),n._textures[e]=o,u=`${e}Dimensions`,r.hasOwnProperty(u)&&(f=r[u],f.x=o._width,f.y=o._height);return}if(s&&l(c)&&a&&(c!==n._defaultTexture&&c.destroy(),c=void 0,n._texturePaths[e]=void 0),l(c)||(c=n._textures[e]=n._defaultTexture,u=`${e}Dimensions`,r.hasOwnProperty(u)&&(f=r[u],f.x=c._width,f.y=c._height)),!a){if((o instanceof HTMLCanvasElement||o instanceof HTMLImageElement||o instanceof ImageBitmap||o instanceof OffscreenCanvas)&&o!==n._texturePaths[e]){n._loadedImages.push({id:e,image:o}),n._texturePaths[e]=o;return}Lfe(n,e)}}}function Lfe(e,t){let i=e.uniforms[t];if(i===it.DefaultImageId)return Promise.resolve();let r=De.createIfNeeded(i);if(!(r instanceof De))return Promise.resolve();let o=De.createIfNeeded(e._texturePaths[t]);if(!(!l(o)||o.url!==r.url))return Promise.resolve();let a;return Y6e.test(r.url)?a=nf(r.url):a=r.fetchImage(),Promise.resolve(a).then(function(c){e._loadedImages.push({id:t,image:c})}).catch(function(c){e._initializationError=c;let u=e._textures[t];l(u)&&u!==e._defaultTexture&&u.destroy(),e._textures[t]=e._defaultTexture}),e._texturePaths[t]=i,a}function K6e(e){return function(t,n){let i=t.uniforms[e];if(i instanceof ls){let r=t._textures[e];r!==t._defaultTexture&&r.destroy(),t._texturePaths[e]=void 0,t._textures[e]=i;return}l(t._textures[e])||(t._textures[e]=n.defaultCubeMap),Ffe(t,e)}}function Ffe(e,t){let i=e.uniforms[t];if(i===it.DefaultCubeMapId)return Promise.resolve();let r=i.positiveX+i.negativeX+i.positiveY+i.negativeY+i.positiveZ+i.negativeZ;if(r===e._texturePaths[t])return Promise.resolve();let o=[De.createIfNeeded(i.positiveX).fetchImage(),De.createIfNeeded(i.negativeX).fetchImage(),De.createIfNeeded(i.positiveY).fetchImage(),De.createIfNeeded(i.negativeY).fetchImage(),De.createIfNeeded(i.positiveZ).fetchImage(),De.createIfNeeded(i.negativeZ).fetchImage()],s=Promise.all(o);return s.then(function(a){e._loadedCubeMaps.push({id:t,images:a})}).catch(function(a){e._initializationError=a}),e._texturePaths[t]=r,s}function $6e(e){let t=e._template.uniforms;for(let n in t)t.hasOwnProperty(n)&&Bfe(e,n)}function Bfe(e,t){let n=e._strict,i=e._template.uniforms,r=i[t],o=J6e(r),s;if(o==="channels")s=bP(e,t,r,!1);else{if(o==="sampler2D"){let u=`${t}Dimensions`;Q6e(e,u)>0&&(i[u]={type:"ivec3",x:1,y:1},Bfe(e,u))}if(!new RegExp(`uniform\\s+${o}\\s+${t}\\s*;`).test(e.shaderSource)){let u=`uniform ${o} ${t};`;e.shaderSource=u+e.shaderSource}let c=`${t}_${e._count++}`;if(s=bP(e,t,c),e.uniforms[t]=r,o==="sampler2D")e._uniforms[c]=function(){return e._textures[t]},e._updateFunctions.push(X6e(t)),e._initializationPromises.push(Lfe(e,t));else if(o==="samplerCube")e._uniforms[c]=function(){return e._textures[t]},e._updateFunctions.push(K6e(t)),e._initializationPromises.push(Ffe(e,t));else if(o.indexOf("mat")!==-1){let u=new Mfe[o];e._uniforms[c]=function(){return Mfe[o].fromColumnMajorArray(e.uniforms[t],u)}}else e._uniforms[c]=function(){return e.uniforms[t]}}}function J6e(e){let t=e.type;if(!l(t)){let n=typeof e;if(n==="number")t="float";else if(n==="boolean")t="bool";else if(n==="string"||e instanceof De||e instanceof HTMLCanvasElement||e instanceof HTMLImageElement||e instanceof ImageBitmap||e instanceof OffscreenCanvas)/^([rgba]){1,4}$/i.test(e)?t="channels":e===it.DefaultCubeMapId?t="samplerCube":t="sampler2D";else if(n==="object")if(Array.isArray(e))(e.length===4||e.length===9||e.length===16)&&(t=`mat${Math.sqrt(e.length)}`);else{let i=0;for(let r in e)e.hasOwnProperty(r)&&(i+=1);i>=2&&i<=4?t=`vec${i}`:i===6&&(t="samplerCube")}}return t}function Z6e(e){let t=e._strict,n=e._template.materials;for(let i in n)if(n.hasOwnProperty(i)){let r=new it({strict:t,fabric:n[i],count:e._count});e._count=r._count,e._uniforms=Mt(e._uniforms,r._uniforms,!0),e.materials[i]=r,e._translucentFunctions=e._translucentFunctions.concat(r._translucentFunctions);let o="czm_getMaterial",s=`${o}_${e._count++}`;bP(r,o,s),e.shaderSource=r.shaderSource+e.shaderSource;let a=`${s}(materialInput)`,c=bP(e,i,a)}}function bP(e,t,n,i){i=i??!0;let r=0,o="([\\w])?",s=`([\\w${i?".":""}])?`,a=new RegExp(s+t+o,"g");return e.shaderSource=e.shaderSource.replace(a,function(c,u,f){return u||f?c:(r+=1,n)}),r}function Q6e(e,t,n){return bP(e,t,t,n)}it._materialCache={_materials:{},addMaterial:function(e,t){this._materials[e]=t},getMaterial:function(e){return this._materials[e]}};it.DefaultImageId="czm_defaultImage";it.DefaultCubeMapId="czm_defaultCubeMap";it.ColorType="Color";it._materialCache.addMaterial(it.ColorType,{fabric:{type:it.ColorType,uniforms:{color:new z(1,0,0,.5)},components:{diffuse:"color.rgb",alpha:"color.a"}},translucent:function(e){return e.uniforms.color.alpha<1}});it.ImageType="Image";it._materialCache.addMaterial(it.ImageType,{fabric:{type:it.ImageType,uniforms:{image:it.DefaultImageId,repeat:new U(1,1),color:new z(1,1,1,1)},components:{diffuse:"texture(image, fract(repeat * materialInput.st)).rgb * color.rgb",alpha:"texture(image, fract(repeat * materialInput.st)).a * color.a"}},translucent:function(e){return e.uniforms.color.alpha<1}});it.DiffuseMapType="DiffuseMap";it._materialCache.addMaterial(it.DiffuseMapType,{fabric:{type:it.DiffuseMapType,uniforms:{image:it.DefaultImageId,channels:"rgb",repeat:new U(1,1)},components:{diffuse:"texture(image, fract(repeat * materialInput.st)).channels"}},translucent:!1});it.AlphaMapType="AlphaMap";it._materialCache.addMaterial(it.AlphaMapType,{fabric:{type:it.AlphaMapType,uniforms:{image:it.DefaultImageId,channel:"a",repeat:new U(1,1)},components:{alpha:"texture(image, fract(repeat * materialInput.st)).channel"}},translucent:!0});it.SpecularMapType="SpecularMap";it._materialCache.addMaterial(it.SpecularMapType,{fabric:{type:it.SpecularMapType,uniforms:{image:it.DefaultImageId,channel:"r",repeat:new U(1,1)},components:{specular:"texture(image, fract(repeat * materialInput.st)).channel"}},translucent:!1});it.EmissionMapType="EmissionMap";it._materialCache.addMaterial(it.EmissionMapType,{fabric:{type:it.EmissionMapType,uniforms:{image:it.DefaultImageId,channels:"rgb",repeat:new U(1,1)},components:{emission:"texture(image, fract(repeat * materialInput.st)).channels"}},translucent:!1});it.BumpMapType="BumpMap";it._materialCache.addMaterial(it.BumpMapType,{fabric:{type:it.BumpMapType,uniforms:{image:it.DefaultImageId,channel:"r",strength:.8,repeat:new U(1,1)},source:pk},translucent:!1});it.NormalMapType="NormalMap";it._materialCache.addMaterial(it.NormalMapType,{fabric:{type:it.NormalMapType,uniforms:{image:it.DefaultImageId,channels:"rgb",strength:.8,repeat:new U(1,1)},source:Ek},translucent:!1});it.GridType="Grid";it._materialCache.addMaterial(it.GridType,{fabric:{type:it.GridType,uniforms:{color:new z(0,1,0,1),cellAlpha:.1,lineCount:new U(8,8),lineThickness:new U(1,1),lineOffset:new U(0,0)},source:Tk},translucent:function(e){let t=e.uniforms;return t.color.alpha<1||t.cellAlpha<1}});it.StripeType="Stripe";it._materialCache.addMaterial(it.StripeType,{fabric:{type:it.StripeType,uniforms:{horizontal:!0,evenColor:new z(1,1,1,.5),oddColor:new z(0,0,1,.5),offset:0,repeat:5},source:Dk},translucent:function(e){let t=e.uniforms;return t.evenColor.alpha<1||t.oddColor.alpha<1}});it.CheckerboardType="Checkerboard";it._materialCache.addMaterial(it.CheckerboardType,{fabric:{type:it.CheckerboardType,uniforms:{lightColor:new z(1,1,1,.5),darkColor:new z(0,0,0,.5),repeat:new U(5,5)},source:gk},translucent:function(e){let t=e.uniforms;return t.lightColor.alpha<1||t.darkColor.alpha<1}});it.DotType="Dot";it._materialCache.addMaterial(it.DotType,{fabric:{type:it.DotType,uniforms:{lightColor:new z(1,1,0,.75),darkColor:new z(0,1,1,.75),repeat:new U(5,5)},source:_k},translucent:function(e){let t=e.uniforms;return t.lightColor.alpha<1||t.darkColor.alpha<1}});it.WaterType="Water";it._materialCache.addMaterial(it.WaterType,{fabric:{type:it.WaterType,uniforms:{baseWaterColor:new z(.2,.3,.6,1),blendColor:new z(0,1,.699,1),specularMap:it.DefaultImageId,normalMap:it.DefaultImageId,frequency:10,animationSpeed:.01,amplitude:1,specularIntensity:.5,fadeFactor:1},source:Ok},translucent:function(e){let t=e.uniforms;return t.baseWaterColor.alpha<1||t.blendColor.alpha<1}});it.RimLightingType="RimLighting";it._materialCache.addMaterial(it.RimLightingType,{fabric:{type:it.RimLightingType,uniforms:{color:new z(1,0,0,.7),rimColor:new z(1,1,1,.4),width:.3},source:Ik},translucent:function(e){let t=e.uniforms;return t.color.alpha<1||t.rimColor.alpha<1}});it.FadeType="Fade";it._materialCache.addMaterial(it.FadeType,{fabric:{type:it.FadeType,uniforms:{fadeInColor:new z(1,0,0,1),fadeOutColor:new z(0,0,0,0),maximumDistance:.5,repeat:!0,fadeDirection:{x:!0,y:!0},time:new U(.5,.5)},source:xk},translucent:function(e){let t=e.uniforms;return t.fadeInColor.alpha<1||t.fadeOutColor.alpha<1}});it.PolylineArrowType="PolylineArrow";it._materialCache.addMaterial(it.PolylineArrowType,{fabric:{type:it.PolylineArrowType,uniforms:{color:new z(1,1,1,1)},source:Ck},translucent:!0});it.PolylineDashType="PolylineDash";it._materialCache.addMaterial(it.PolylineDashType,{fabric:{type:it.PolylineDashType,uniforms:{color:new z(1,0,1,1),gapColor:new z(0,0,0,0),dashLength:16,dashPattern:255},source:vk},translucent:!0});it.PolylineGlowType="PolylineGlow";it._materialCache.addMaterial(it.PolylineGlowType,{fabric:{type:it.PolylineGlowType,uniforms:{color:new z(0,.5,1,1),glowPower:.25,taperPower:1},source:Sk},translucent:!0});it.PolylineOutlineType="PolylineOutline";it._materialCache.addMaterial(it.PolylineOutlineType,{fabric:{type:it.PolylineOutlineType,uniforms:{color:new z(1,1,1,1),outlineColor:new z(1,0,0,1),outlineWidth:1},source:wk},translucent:function(e){let t=e.uniforms;return t.color.alpha<1||t.outlineColor.alpha<1}});it.ElevationContourType="ElevationContour";it._materialCache.addMaterial(it.ElevationContourType,{fabric:{type:it.ElevationContourType,uniforms:{spacing:100,color:new z(1,0,0,1),width:1},source:Ak},translucent:!1});it.ElevationRampType="ElevationRamp";it._materialCache.addMaterial(it.ElevationRampType,{fabric:{type:it.ElevationRampType,uniforms:{image:it.DefaultImageId,minimumHeight:0,maximumHeight:1e4},source:bk},translucent:!1});it.SlopeRampMaterialType="SlopeRamp";it._materialCache.addMaterial(it.SlopeRampMaterialType,{fabric:{type:it.SlopeRampMaterialType,uniforms:{image:it.DefaultImageId},source:Pk},translucent:!1});it.AspectRampMaterialType="AspectRamp";it._materialCache.addMaterial(it.AspectRampMaterialType,{fabric:{type:it.AspectRampMaterialType,uniforms:{image:it.DefaultImageId},source:mk},translucent:!1});it.ElevationBandType="ElevationBand";it._materialCache.addMaterial(it.ElevationBandType,{fabric:{type:it.ElevationBandType,uniforms:{heights:it.DefaultImageId,colors:it.DefaultImageId},source:yk},translucent:!0});it.WaterMaskType="WaterMask";it._materialCache.addMaterial(it.WaterMaskType,{fabric:{type:it.WaterMaskType,source:Rk,uniforms:{waterColor:new z(1,1,1,1),landColor:new z(0,0,0,0)}},translucent:!1});var ir=it;function Mb(e){e=e??H.EMPTY_OBJECT;let t=e.translucent??!0,n=e.closed??!1,i=e.materialSupport??Mb.MaterialSupport.TEXTURED;this.material=l(e.material)?e.material:ir.fromType(ir.ColorType),this.translucent=t,this._vertexShaderSource=e.vertexShaderSource??i.vertexShaderSource,this._fragmentShaderSource=e.fragmentShaderSource??i.fragmentShaderSource,this._renderState=Rr.getDefaultRenderState(t,n,e.renderState),this._closed=n,this._materialSupport=i,this._vertexFormat=i.vertexFormat,this._flat=e.flat??!1,this._faceForward=e.faceForward??!n}Object.defineProperties(Mb.prototype,{vertexShaderSource:{get:function(){return this._vertexShaderSource}},fragmentShaderSource:{get:function(){return this._fragmentShaderSource}},renderState:{get:function(){return this._renderState}},closed:{get:function(){return this._closed}},materialSupport:{get:function(){return this._materialSupport}},vertexFormat:{get:function(){return this._vertexFormat}},flat:{get:function(){return this._flat}},faceForward:{get:function(){return this._faceForward}}});Mb.prototype.getFragmentShaderSource=Rr.prototype.getFragmentShaderSource;Mb.prototype.isTranslucent=Rr.prototype.isTranslucent;Mb.prototype.getRenderState=Rr.prototype.getRenderState;Mb.MaterialSupport={BASIC:Object.freeze({vertexFormat:Be.POSITION_AND_NORMAL,vertexShaderSource:fk,fragmentShaderSource:uk}),TEXTURED:Object.freeze({vertexFormat:Be.POSITION_NORMAL_AND_ST,vertexShaderSource:hk,fragmentShaderSource:dk}),ALL:Object.freeze({vertexFormat:Be.ALL,vertexShaderSource:lk,fragmentShaderSource:ck})};var Cr=Mb;var Mk=`in vec3 v_positionEC; -in vec3 v_normalEC; -in vec4 v_color; -void main() -{ -vec3 positionToEyeEC = -v_positionEC; -vec3 normalEC = normalize(v_normalEC); -#ifdef FACE_FORWARD -normalEC = faceforward(normalEC, vec3(0.0, 0.0, 1.0), -normalEC); -#endif -vec4 color = czm_gammaCorrect(v_color); -czm_materialInput materialInput; -materialInput.normalEC = normalEC; -materialInput.positionToEyeEC = positionToEyeEC; -czm_material material = czm_getDefaultMaterial(materialInput); -material.diffuse = color.rgb; -material.alpha = color.a; -out_FragColor = czm_phong(normalize(positionToEyeEC), material, czm_lightDirectionEC); -} -`;var Nk=`in vec3 position3DHigh; -in vec3 position3DLow; -in vec3 normal; -in vec4 color; -in float batchId; -out vec3 v_positionEC; -out vec3 v_normalEC; -out vec4 v_color; -void main() -{ -vec4 p = czm_computePosition(); -v_positionEC = (czm_modelViewRelativeToEye * p).xyz; -v_normalEC = czm_normal * normal; -v_color = color; -gl_Position = czm_modelViewProjectionRelativeToEye * p; -} -`;var QE=`in vec4 v_color; -void main() -{ -out_FragColor = czm_gammaCorrect(v_color); -} -`;var Lk=`in vec3 position3DHigh; -in vec3 position3DLow; -in vec4 color; -in float batchId; -out vec4 v_color; -void main() -{ -vec4 p = czm_computePosition(); -v_color = color; -gl_Position = czm_modelViewProjectionRelativeToEye * p; -} -`;function z0(e){e=e??H.EMPTY_OBJECT;let t=e.translucent??!0,n=e.closed??!1,i=e.flat??!1,r=i?Lk:Nk,o=i?QE:Mk,s=i?z0.FLAT_VERTEX_FORMAT:z0.VERTEX_FORMAT;this.material=void 0,this.translucent=t,this._vertexShaderSource=e.vertexShaderSource??r,this._fragmentShaderSource=e.fragmentShaderSource??o,this._renderState=Rr.getDefaultRenderState(t,n,e.renderState),this._closed=n,this._vertexFormat=s,this._flat=i,this._faceForward=e.faceForward??!n}Object.defineProperties(z0.prototype,{vertexShaderSource:{get:function(){return this._vertexShaderSource}},fragmentShaderSource:{get:function(){return this._fragmentShaderSource}},renderState:{get:function(){return this._renderState}},closed:{get:function(){return this._closed}},vertexFormat:{get:function(){return this._vertexFormat}},flat:{get:function(){return this._flat}},faceForward:{get:function(){return this._faceForward}}});z0.VERTEX_FORMAT=Be.POSITION_AND_NORMAL;z0.FLAT_VERTEX_FORMAT=Be.POSITION_ONLY;z0.prototype.getFragmentShaderSource=Rr.prototype.getFragmentShaderSource;z0.prototype.isTranslucent=Rr.prototype.isTranslucent;z0.prototype.getRenderState=Rr.prototype.getRenderState;var An=z0;function eC(e){this._definitionChanged=new be,this._color=void 0,this._colorSubscription=void 0,this.color=e}Object.defineProperties(eC.prototype,{isConstant:{get:function(){return X.isConstant(this._color)}},definitionChanged:{get:function(){return this._definitionChanged}},color:me("color")});eC.prototype.getType=function(e){return"Color"};var eHe=new K;eC.prototype.getValue=function(e,t){return l(e)||(e=K.now(eHe)),l(t)||(t={}),t.color=X.getValueOrClonedDefault(this._color,e,z.WHITE,t.color),t};eC.prototype.equals=function(e){return this===e||e instanceof eC&&X.equals(this._color,e._color)};var Kt=eC;var EX=class{constructor(t){t=t??H.EMPTY_OBJECT,this._ellipsoid=t.ellipsoid??ee.default,this._rectangle=t.rectangle??ie.MAX_VALUE,this._projection=new ji(this._ellipsoid),this._numberOfLevelZeroTilesX=t.numberOfLevelZeroTilesX??2,this._numberOfLevelZeroTilesY=t.numberOfLevelZeroTilesY??1}get ellipsoid(){return this._ellipsoid}get rectangle(){return this._rectangle}get projection(){return this._projection}getNumberOfXTilesAtLevel(t){return this._numberOfLevelZeroTilesX<<t}getNumberOfYTilesAtLevel(t){return this._numberOfLevelZeroTilesY<<t}rectangleToNativeRectangle(t,n){let i=P.toDegrees(t.west),r=P.toDegrees(t.south),o=P.toDegrees(t.east),s=P.toDegrees(t.north);return l(n)?(n.west=i,n.south=r,n.east=o,n.north=s,n):new ie(i,r,o,s)}tileXYToNativeRectangle(t,n,i,r){let o=this.tileXYToRectangle(t,n,i,r);return o.west=P.toDegrees(o.west),o.south=P.toDegrees(o.south),o.east=P.toDegrees(o.east),o.north=P.toDegrees(o.north),o}tileXYToRectangle(t,n,i,r){let o=this._rectangle,s=this.getNumberOfXTilesAtLevel(i),a=this.getNumberOfYTilesAtLevel(i),c=o.width/s,u=t*c+o.west,f=(t+1)*c+o.west,d=o.height/a,p=o.north-n*d,g=o.north-(n+1)*d;return l(r)||(r=new ie(u,g,f,p)),r.west=u,r.south=g,r.east=f,r.north=p,r}positionToTileXY(t,n,i){let r=this._rectangle;if(!ie.contains(r,t))return;let o=this.getNumberOfXTilesAtLevel(n),s=this.getNumberOfYTilesAtLevel(n),a=r.width/o,c=r.height/s,u=t.longitude;r.east<r.west&&(u+=P.TWO_PI);let f=(u-r.west)/a|0;f>=o&&(f=o-1);let d=(r.north-t.latitude)/c|0;return d>=s&&(d=s-1),l(i)?(i.x=f,i.y=d,i):new U(f,d)}},rr=EX;var kfe=new h,Ufe=new h,zfe=new he,CX=new h,tHe=new h,Vfe=new ue,nHe=new rr,xP=[new he,new he,new he,new he],TP=new U,ws={};ws.initialize=function(){let e=ws._initPromise;return l(e)||(e=De.fetchJson(Zt("Assets/approximateTerrainHeights.json")).then(function(t){ws._terrainHeights=t}),ws._initPromise=e),e};ws.getMinimumMaximumHeights=function(e,t){t=t??ee.default;let n=jfe(e),i=ws._defaultMinTerrainHeight,r=ws._defaultMaxTerrainHeight;if(l(n)){let o=`${n.level}-${n.x}-${n.y}`,s=ws._terrainHeights[o];l(s)&&(i=s[0],r=s[1]),t.cartographicToCartesian(ie.northeast(e,zfe),kfe),t.cartographicToCartesian(ie.southwest(e,zfe),Ufe),h.midpoint(Ufe,kfe,CX);let a=t.scaleToGeodeticSurface(CX,tHe);if(l(a)){let c=h.distance(CX,a);i=Math.min(i,-c)}else i=ws._defaultMinTerrainHeight}return i=Math.max(ws._defaultMinTerrainHeight,i),{minimumTerrainHeight:i,maximumTerrainHeight:r}};ws.getBoundingSphere=function(e,t){t=t??ee.default;let n=jfe(e),i=ws._defaultMaxTerrainHeight;if(l(n)){let o=`${n.level}-${n.x}-${n.y}`,s=ws._terrainHeights[o];l(s)&&(i=s[1])}let r=ue.fromRectangle3D(e,t,0);return ue.fromRectangle3D(e,t,i,Vfe),ue.union(r,Vfe,r)};function jfe(e){he.fromRadians(e.east,e.north,0,xP[0]),he.fromRadians(e.west,e.north,0,xP[1]),he.fromRadians(e.east,e.south,0,xP[2]),he.fromRadians(e.west,e.south,0,xP[3]);let t=0,n=0,i=0,r=0,o=ws._terrainHeightsMaxLevel,s;for(s=0;s<=o;++s){let a=!1;for(let c=0;c<4;++c){let u=xP[c];if(nHe.positionToTileXY(u,s,TP),c===0)i=TP.x,r=TP.y;else if(i!==TP.x||r!==TP.y){a=!0;break}}if(a)break;t=i,n=r}if(s!==0)return{x:t,y:n,level:s>o?o:s-1}}ws._terrainHeightsMaxLevel=6;ws._defaultMaxTerrainHeight=9e3;ws._defaultMinTerrainHeight=-1e5;ws._terrainHeights=void 0;ws._initPromise=void 0;Object.defineProperties(ws,{initialized:{get:function(){return l(ws._terrainHeights)}}});var Ni=ws;function Xa(e,t,n){this.minimum=h.clone(e??h.ZERO),this.maximum=h.clone(t??h.ZERO),l(n)?n=h.clone(n):n=h.midpoint(this.minimum,this.maximum,new h),this.center=n}Xa.fromCorners=function(e,t,n){return l(n)||(n=new Xa),n.minimum=h.clone(e,n.minimum),n.maximum=h.clone(t,n.maximum),n.center=h.midpoint(e,t,n.center),n};Xa.fromPoints=function(e,t){if(l(t)||(t=new Xa),!l(e)||e.length===0)return t.minimum=h.clone(h.ZERO,t.minimum),t.maximum=h.clone(h.ZERO,t.maximum),t.center=h.clone(h.ZERO,t.center),t;let n=e[0].x,i=e[0].y,r=e[0].z,o=e[0].x,s=e[0].y,a=e[0].z,c=e.length;for(let d=1;d<c;d++){let p=e[d],g=p.x,m=p.y,y=p.z;n=Math.min(g,n),o=Math.max(g,o),i=Math.min(m,i),s=Math.max(m,s),r=Math.min(y,r),a=Math.max(y,a)}let u=t.minimum;u.x=n,u.y=i,u.z=r;let f=t.maximum;return f.x=o,f.y=s,f.z=a,t.center=h.midpoint(u,f,t.center),t};Xa.clone=function(e,t){if(l(e))return l(t)?(t.minimum=h.clone(e.minimum,t.minimum),t.maximum=h.clone(e.maximum,t.maximum),t.center=h.clone(e.center,t.center),t):new Xa(e.minimum,e.maximum,e.center)};Xa.equals=function(e,t){return e===t||l(e)&&l(t)&&h.equals(e.center,t.center)&&h.equals(e.minimum,t.minimum)&&h.equals(e.maximum,t.maximum)};var Fk=new h;Xa.intersectPlane=function(e,t){Fk=h.subtract(e.maximum,e.minimum,Fk);let n=h.multiplyByScalar(Fk,.5,Fk),i=t.normal,r=n.x*Math.abs(i.x)+n.y*Math.abs(i.y)+n.z*Math.abs(i.z),o=h.dot(e.center,i)+t.distance;return o-r>0?$t.INSIDE:o+r<0?$t.OUTSIDE:$t.INTERSECTING};Xa.intersectAxisAlignedBoundingBox=function(e,t){return e.minimum.x<=t.maximum.x&&e.maximum.x>=t.minimum.x&&e.minimum.y<=t.maximum.y&&e.maximum.y>=t.minimum.y&&e.minimum.z<=t.maximum.z&&e.maximum.z>=t.minimum.z};Xa.prototype.clone=function(e){return Xa.clone(this,e)};Xa.prototype.intersectPlane=function(e){return Xa.intersectPlane(this,e)};Xa.prototype.intersectAxisAlignedBoundingBox=function(e){return Xa.intersectAxisAlignedBoundingBox(this,e)};Xa.prototype.equals=function(e){return Xa.equals(this,e)};var sd=Xa;var vX=new se;function Zm(e,t){t=t??ee.default,e=t.scaleToGeodeticSurface(e);let n=At.eastNorthUpToFixedFrame(e,t);this._ellipsoid=t,this._origin=e,this._xAxis=h.fromCartesian4(M.getColumn(n,0,vX)),this._yAxis=h.fromCartesian4(M.getColumn(n,1,vX));let i=h.fromCartesian4(M.getColumn(n,2,vX));this._plane=sn.fromPointNormal(e,i)}Object.defineProperties(Zm.prototype,{ellipsoid:{get:function(){return this._ellipsoid}},origin:{get:function(){return this._origin}},plane:{get:function(){return this._plane}},xAxis:{get:function(){return this._xAxis}},yAxis:{get:function(){return this._yAxis}},zAxis:{get:function(){return this._plane.normal}}});var iHe=new sd;Zm.fromPoints=function(e,t){let n=sd.fromPoints(e,iHe);return new Zm(n.center,t)};var Hfe=new gn,Bk=new h;Zm.prototype.projectPointOntoPlane=function(e,t){let n=Hfe;n.origin=e,h.normalize(e,n.direction);let i=xi.rayPlane(n,this._plane,Bk);if(l(i)||(h.negate(n.direction,n.direction),i=xi.rayPlane(n,this._plane,Bk)),l(i)){let r=h.subtract(i,this._origin,i),o=h.dot(this._xAxis,r),s=h.dot(this._yAxis,r);return l(t)?(t.x=o,t.y=s,t):new U(o,s)}};Zm.prototype.projectPointsOntoPlane=function(e,t){l(t)||(t=[]);let n=0,i=e.length;for(let r=0;r<i;r++){let o=this.projectPointOntoPlane(e[r],t[n]);l(o)&&(t[n]=o,n++)}return t.length=n,t};Zm.prototype.projectPointToNearestOnPlane=function(e,t){l(t)||(t=new U);let n=Hfe;n.origin=e,h.clone(this._plane.normal,n.direction);let i=xi.rayPlane(n,this._plane,Bk);l(i)||(h.negate(n.direction,n.direction),i=xi.rayPlane(n,this._plane,Bk));let r=h.subtract(i,this._origin,i),o=h.dot(this._xAxis,r),s=h.dot(this._yAxis,r);return t.x=o,t.y=s,t};Zm.prototype.projectPointsToNearestOnPlane=function(e,t){l(t)||(t=[]);let n=e.length;t.length=n;for(let i=0;i<n;i++)t[i]=this.projectPointToNearestOnPlane(e[i],t[i]);return t};var rHe=new h;Zm.prototype.projectPointOntoEllipsoid=function(e,t){l(t)||(t=new h);let n=this._ellipsoid,i=this._origin,r=this._xAxis,o=this._yAxis,s=rHe;return h.multiplyByScalar(r,e.x,s),t=h.add(i,s,t),h.multiplyByScalar(o,e.y,s),h.add(t,s,t),n.scaleToGeocentricSurface(t,t),t};Zm.prototype.projectPointsOntoEllipsoid=function(e,t){let n=e.length;l(t)?t.length=n:t=new Array(n);for(let i=0;i<n;++i)t[i]=this.projectPointOntoEllipsoid(e[i],t[i]);return t};var qs=Zm;function or(e,t){this.center=h.clone(e??h.ZERO),this.halfAxes=$.clone(t??$.ZERO)}or.packedLength=h.packedLength+$.packedLength;or.pack=function(e,t,n){return n=n??0,h.pack(e.center,t,n),$.pack(e.halfAxes,t,n+h.packedLength),t};or.unpack=function(e,t,n){return t=t??0,l(n)||(n=new or),h.unpack(e,t,n.center),$.unpack(e,t+h.packedLength,n.halfAxes),n};var oHe=new h,sHe=new h,aHe=new h,cHe=new h,lHe=new h,uHe=new h,fHe=new $,dHe={unitary:new $,diagonal:new $};or.fromPoints=function(e,t){if(l(t)||(t=new or),!l(e)||e.length===0)return t.halfAxes=$.ZERO,t.center=h.ZERO,t;let n,i=e.length,r=h.clone(e[0],oHe);for(n=1;n<i;n++)h.add(r,e[n],r);let o=1/i;h.multiplyByScalar(r,o,r);let s=0,a=0,c=0,u=0,f=0,d=0,p;for(n=0;n<i;n++)p=h.subtract(e[n],r,sHe),s+=p.x*p.x,a+=p.x*p.y,c+=p.x*p.z,u+=p.y*p.y,f+=p.y*p.z,d+=p.z*p.z;s*=o,a*=o,c*=o,u*=o,f*=o,d*=o;let g=fHe;g[0]=s,g[1]=a,g[2]=c,g[3]=a,g[4]=u,g[5]=f,g[6]=c,g[7]=f,g[8]=d;let m=$.computeEigenDecomposition(g,dHe),y=$.clone(m.unitary,t.halfAxes),A=$.getColumn(y,0,cHe),b=$.getColumn(y,1,lHe),x=$.getColumn(y,2,uHe),T=-Number.MAX_VALUE,E=-Number.MAX_VALUE,v=-Number.MAX_VALUE,S=Number.MAX_VALUE,I=Number.MAX_VALUE,R=Number.MAX_VALUE;for(n=0;n<i;n++)p=e[n],T=Math.max(h.dot(A,p),T),E=Math.max(h.dot(b,p),E),v=Math.max(h.dot(x,p),v),S=Math.min(h.dot(A,p),S),I=Math.min(h.dot(b,p),I),R=Math.min(h.dot(x,p),R);A=h.multiplyByScalar(A,.5*(S+T),A),b=h.multiplyByScalar(b,.5*(I+E),b),x=h.multiplyByScalar(x,.5*(R+v),x);let O=h.add(A,b,t.center);h.add(O,x,O);let L=aHe;return L.x=T-S,L.y=E-I,L.z=v-R,h.multiplyByScalar(L,.5,L),$.multiplyByScale(t.halfAxes,L,t.halfAxes),t};var Kfe=new h,hHe=new h;function Gfe(e,t,n,i,r,o,s,a,c,u,f){l(f)||(f=new or);let d=f.halfAxes;$.setColumn(d,0,t,d),$.setColumn(d,1,n,d),$.setColumn(d,2,i,d);let p=Kfe;p.x=(r+o)/2,p.y=(s+a)/2,p.z=(c+u)/2;let g=hHe;g.x=(o-r)/2,g.y=(a-s)/2,g.z=(u-c)/2;let m=f.center;return p=$.multiplyByVector(d,p,p),h.add(e,p,m),$.multiplyByScale(d,g,d),f}var Wfe=new he,mHe=new h,pHe=new he,gHe=new he,_He=new he,yHe=new he,AHe=new he,bHe=new h,qfe=new h,xHe=new h,Yfe=new h,THe=new h,EHe=new U,CHe=new U,vHe=new U,SHe=new U,wHe=new U,IHe=new h,PHe=new h,DHe=new h,RHe=new h,OHe=new U,MHe=new h,NHe=new h,LHe=new h,FHe=new sn(h.UNIT_X,0);or.fromRectangle=function(e,t,n,i,r){t=t??0,n=n??0,i=i??ee.default;let o,s,a,c,u,f,d;if(e.width<=P.PI){let I=ie.center(e,Wfe),R=i.cartographicToCartesian(I,mHe),O=new qs(R,i);d=O.plane;let L=I.longitude,_=e.south<0&&e.north>0?0:I.latitude,C=he.fromRadians(L,e.north,n,pHe),w=he.fromRadians(e.west,e.north,n,gHe),D=he.fromRadians(e.west,_,n,_He),N=he.fromRadians(e.west,e.south,n,yHe),F=he.fromRadians(L,e.south,n,AHe),V=i.cartographicToCartesian(C,bHe),B=i.cartographicToCartesian(w,qfe),j=i.cartographicToCartesian(D,xHe),k=i.cartographicToCartesian(N,Yfe),G=i.cartographicToCartesian(F,THe),q=O.projectPointToNearestOnPlane(V,EHe),Q=O.projectPointToNearestOnPlane(B,CHe),W=O.projectPointToNearestOnPlane(j,vHe),J=O.projectPointToNearestOnPlane(k,SHe),Z=O.projectPointToNearestOnPlane(G,wHe);return o=Math.min(Q.x,W.x,J.x),s=-o,c=Math.max(Q.y,q.y),a=Math.min(J.y,Z.y),w.height=N.height=t,B=i.cartographicToCartesian(w,qfe),k=i.cartographicToCartesian(N,Yfe),u=Math.min(sn.getPointDistance(d,B),sn.getPointDistance(d,k)),f=n,Gfe(O.origin,O.xAxis,O.yAxis,O.zAxis,o,s,a,c,u,f,r)}let p=e.south>0,g=e.north<0,m=p?e.south:g?e.north:0,y=ie.center(e,Wfe).longitude,A=h.fromRadians(y,m,n,i,IHe);A.z=0;let x=Math.abs(A.x)<P.EPSILON10&&Math.abs(A.y)<P.EPSILON10?h.UNIT_X:h.normalize(A,PHe),T=h.UNIT_Z,E=h.cross(x,T,DHe);d=sn.fromPointNormal(A,x,FHe);let v=h.fromRadians(y+P.PI_OVER_TWO,m,n,i,RHe);s=h.dot(sn.projectPointOntoPlane(d,v,OHe),E),o=-s,c=h.fromRadians(0,e.north,g?t:n,i,MHe).z,a=h.fromRadians(0,e.south,p?t:n,i,NHe).z;let S=h.fromRadians(e.east,m,n,i,LHe);return u=sn.getPointDistance(d,S),f=0,Gfe(A,E,T,x,o,s,a,c,u,f,r)};or.fromTransformation=function(e,t){return l(t)||(t=new or),t.center=M.getTranslation(e,t.center),t.halfAxes=M.getMatrix3(e,t.halfAxes),t.halfAxes=$.multiplyByScalar(t.halfAxes,.5,t.halfAxes),t};or.clone=function(e,t){if(l(e))return l(t)?(h.clone(e.center,t.center),$.clone(e.halfAxes,t.halfAxes),t):new or(e.center,e.halfAxes)};or.intersectPlane=function(e,t){let n=e.center,i=t.normal,r=e.halfAxes,o=i.x,s=i.y,a=i.z,c=Math.abs(o*r[$.COLUMN0ROW0]+s*r[$.COLUMN0ROW1]+a*r[$.COLUMN0ROW2])+Math.abs(o*r[$.COLUMN1ROW0]+s*r[$.COLUMN1ROW1]+a*r[$.COLUMN1ROW2])+Math.abs(o*r[$.COLUMN2ROW0]+s*r[$.COLUMN2ROW1]+a*r[$.COLUMN2ROW2]),u=h.dot(i,n)+t.distance;return u<=-c?$t.OUTSIDE:u>=c?$t.INSIDE:$t.INTERSECTING};var $fe=new h,Jfe=new h,Zfe=new h,BHe=new h,Xfe=new h,kHe=new h;or.distanceSquaredTo=function(e,t){let n=h.subtract(t,e.center,Kfe),i=e.halfAxes,r=$.getColumn(i,0,$fe),o=$.getColumn(i,1,Jfe),s=$.getColumn(i,2,Zfe),a=h.magnitude(r),c=h.magnitude(o),u=h.magnitude(s),f=!0,d=!0,p=!0;a>0?h.divideByScalar(r,a,r):f=!1,c>0?h.divideByScalar(o,c,o):d=!1,u>0?h.divideByScalar(s,u,s):p=!1;let g=!f+!d+!p,m,y,A;if(g===1){let E=r;m=o,y=s,d?p||(E=s,y=r):(E=o,m=r),A=h.cross(m,y,Xfe),E===r?r=A:E===o?o=A:E===s&&(s=A)}else if(g===2){m=r,d?m=o:p&&(m=s);let E=h.UNIT_Y;E.equalsEpsilon(m,P.EPSILON3)&&(E=h.UNIT_X),y=h.cross(m,E,BHe),h.normalize(y,y),A=h.cross(m,y,Xfe),h.normalize(A,A),m===r?(o=y,s=A):m===o?(s=y,r=A):m===s&&(r=y,o=A)}else g===3&&(r=h.UNIT_X,o=h.UNIT_Y,s=h.UNIT_Z);let b=kHe;b.x=h.dot(n,r),b.y=h.dot(n,o),b.z=h.dot(n,s);let x=0,T;return b.x<-a?(T=b.x+a,x+=T*T):b.x>a&&(T=b.x-a,x+=T*T),b.y<-c?(T=b.y+c,x+=T*T):b.y>c&&(T=b.y-c,x+=T*T),b.z<-u?(T=b.z+u,x+=T*T):b.z>u&&(T=b.z-u,x+=T*T),x};var UHe=new h,zHe=new h;or.computePlaneDistances=function(e,t,n,i){l(i)||(i=new Gs);let r=Number.POSITIVE_INFINITY,o=Number.NEGATIVE_INFINITY,s=e.center,a=e.halfAxes,c=$.getColumn(a,0,$fe),u=$.getColumn(a,1,Jfe),f=$.getColumn(a,2,Zfe),d=h.add(c,u,UHe);h.add(d,f,d),h.add(d,s,d);let p=h.subtract(d,t,zHe),g=h.dot(n,p);return r=Math.min(g,r),o=Math.max(g,o),h.add(s,c,d),h.add(d,u,d),h.subtract(d,f,d),h.subtract(d,t,p),g=h.dot(n,p),r=Math.min(g,r),o=Math.max(g,o),h.add(s,c,d),h.subtract(d,u,d),h.add(d,f,d),h.subtract(d,t,p),g=h.dot(n,p),r=Math.min(g,r),o=Math.max(g,o),h.add(s,c,d),h.subtract(d,u,d),h.subtract(d,f,d),h.subtract(d,t,p),g=h.dot(n,p),r=Math.min(g,r),o=Math.max(g,o),h.subtract(s,c,d),h.add(d,u,d),h.add(d,f,d),h.subtract(d,t,p),g=h.dot(n,p),r=Math.min(g,r),o=Math.max(g,o),h.subtract(s,c,d),h.add(d,u,d),h.subtract(d,f,d),h.subtract(d,t,p),g=h.dot(n,p),r=Math.min(g,r),o=Math.max(g,o),h.subtract(s,c,d),h.subtract(d,u,d),h.add(d,f,d),h.subtract(d,t,p),g=h.dot(n,p),r=Math.min(g,r),o=Math.max(g,o),h.subtract(s,c,d),h.subtract(d,u,d),h.subtract(d,f,d),h.subtract(d,t,p),g=h.dot(n,p),r=Math.min(g,r),o=Math.max(g,o),i.start=r,i.stop=o,i};var VHe=new h,jHe=new h,HHe=new h;or.computeCorners=function(e,t){l(t)||(t=[new h,new h,new h,new h,new h,new h,new h,new h]);let n=e.center,i=e.halfAxes,r=$.getColumn(i,0,VHe),o=$.getColumn(i,1,jHe),s=$.getColumn(i,2,HHe);return h.clone(n,t[0]),h.subtract(t[0],r,t[0]),h.subtract(t[0],o,t[0]),h.subtract(t[0],s,t[0]),h.clone(n,t[1]),h.subtract(t[1],r,t[1]),h.subtract(t[1],o,t[1]),h.add(t[1],s,t[1]),h.clone(n,t[2]),h.subtract(t[2],r,t[2]),h.add(t[2],o,t[2]),h.subtract(t[2],s,t[2]),h.clone(n,t[3]),h.subtract(t[3],r,t[3]),h.add(t[3],o,t[3]),h.add(t[3],s,t[3]),h.clone(n,t[4]),h.add(t[4],r,t[4]),h.subtract(t[4],o,t[4]),h.subtract(t[4],s,t[4]),h.clone(n,t[5]),h.add(t[5],r,t[5]),h.subtract(t[5],o,t[5]),h.add(t[5],s,t[5]),h.clone(n,t[6]),h.add(t[6],r,t[6]),h.add(t[6],o,t[6]),h.subtract(t[6],s,t[6]),h.clone(n,t[7]),h.add(t[7],r,t[7]),h.add(t[7],o,t[7]),h.add(t[7],s,t[7]),t};var GHe=new $;or.computeTransformation=function(e,t){l(t)||(t=new M);let n=e.center,i=$.multiplyByUniformScale(e.halfAxes,2,GHe);return M.fromRotationTranslation(i,n,t)};var WHe=new ue;or.isOccluded=function(e,t){let n=ue.fromOrientedBoundingBox(e,WHe);return!t.isBoundingSphereVisible(n)};or.prototype.intersectPlane=function(e){return or.intersectPlane(this,e)};or.prototype.distanceSquaredTo=function(e){return or.distanceSquaredTo(this,e)};or.prototype.computePlaneDistances=function(e,t,n){return or.computePlaneDistances(this,e,t,n)};or.prototype.computeCorners=function(e){return or.computeCorners(this,e)};or.prototype.computeTransformation=function(e){return or.computeTransformation(this,e)};or.prototype.isOccluded=function(e){return or.isOccluded(this,e)};or.equals=function(e,t){return e===t||l(e)&&l(t)&&h.equals(e.center,t.center)&&$.equals(e.halfAxes,t.halfAxes)};or.prototype.clone=function(e){return or.clone(this,e)};or.prototype.equals=function(e){return or.equals(this,e)};var en=or;var kk={};kk.getHeight=function(e,t,n){return(e-n)*t+n};var qHe=new he;kk.getPosition=function(e,t,n,i,r){let o=t.cartesianToCartographic(e,qHe);if(!l(o))return h.clone(e,r);let s=kk.getHeight(o.height,n,i);return h.fromRadians(o.longitude,o.latitude,s,t,r)};var br=kk;var SX={TERRAIN:0,CESIUM_3D_TILE:1,BOTH:2};SX.NUMBER_OF_CLASSIFICATION_TYPES=3;Object.freeze(SX);var ei=SX;var Qfe={NEVER:te.NEVER,LESS:te.LESS,EQUAL:te.EQUAL,LESS_OR_EQUAL:te.LEQUAL,GREATER:te.GREATER,NOT_EQUAL:te.NOTEQUAL,GREATER_OR_EQUAL:te.GEQUAL,ALWAYS:te.ALWAYS};Object.freeze(Qfe);var yc=Qfe;function YHe(e,t){let n=[],i=e.length,r=0;for(;r<i;){let o=Math.ceil((i-r)/t--);n.push(e.slice(r,r+o)),r+=o}return n}var Uk=YHe;function V0(e,t,n){if(this._attributes=t,this._numberOfInstances=n,t.length===0)return;let i=XHe(t),r=e.floatingPointTexture,o=i===ze.FLOAT&&!r,s=KHe(t,o),a=$He(s,t,o),c=Math.floor(Ut.maximumTextureSize/a),u=Math.min(n,c),f=a*u,d=Math.ceil(n/u),p=1/f,g=p*.5,m=1/d,y=m*.5;this._textureDimensions=new U(f,d),this._textureStep=new se(p,g,m,y),this._pixelDatatype=o?ze.UNSIGNED_BYTE:i,this._packFloats=o,this._offsets=s,this._stride=a,this._texture=void 0;let A=4*f*d;this._batchValues=i===ze.FLOAT&&!o?new Float32Array(A):new Uint8Array(A),this._batchValuesDirty=!1}Object.defineProperties(V0.prototype,{attributes:{get:function(){return this._attributes}},numberOfInstances:{get:function(){return this._numberOfInstances}}});function XHe(e){let t=!1,n=e.length;for(let i=0;i<n;++i)if(e[i].componentDatatype!==Y.UNSIGNED_BYTE){t=!0;break}return t?ze.FLOAT:ze.UNSIGNED_BYTE}function tde(e,t){let n=e[t].componentsPerAttribute;return n===2?U:n===3?h:n===4?se:Number}function KHe(e,t){let n=new Array(e.length),i=0,r=e.length;for(let o=0;o<r;++o){let a=e[o].componentDatatype;n[o]=i,a!==Y.UNSIGNED_BYTE&&t?i+=4:++i}return n}function $He(e,t,n){let i=e.length,r=e[i-1];return t[i-1].componentDatatype!==Y.UNSIGNED_BYTE&&n?r+4:r+1}var EP=new se;function JHe(e,t,n){let i=se.unpack(e,t,EP),r=se.unpackFloat(i);i=se.unpack(e,t+4,EP);let o=se.unpackFloat(i);i=se.unpack(e,t+8,EP);let s=se.unpackFloat(i);i=se.unpack(e,t+12,EP);let a=se.unpackFloat(i);return se.fromElements(r,o,s,a,n)}function ZHe(e,t,n){let i=se.packFloat(e.x,EP);se.pack(i,t,n),i=se.packFloat(e.y,i),se.pack(i,t,n+4),i=se.packFloat(e.z,i),se.pack(i,t,n+8),i=se.packFloat(e.w,i),se.pack(i,t,n+12)}var ede=new se;V0.prototype.getBatchedAttribute=function(e,t,n){let i=this._attributes,r=this._offsets[t],s=4*this._stride*e+4*r,a;this._packFloats&&i[t].componentDatatype!==ze.UNSIGNED_BYTE?a=JHe(this._batchValues,s,ede):a=se.unpack(this._batchValues,s,ede);let c=tde(i,t);return l(c.fromCartesian4)?c.fromCartesian4(a,n):l(c.clone)?c.clone(a,n):a.x};var QHe=[void 0,void 0,new U,new h,new se],eGe=new se;V0.prototype.setBatchedAttribute=function(e,t,n){let i=this._attributes,r=QHe[i[t].componentsPerAttribute],o=this.getBatchedAttribute(e,t,r),s=tde(this._attributes,t);if(l(s.equals)?s.equals(o,n):o===n)return;let c=eGe;c.x=l(n.x)?n.x:n,c.y=l(n.y)?n.y:0,c.z=l(n.z)?n.z:0,c.w=l(n.w)?n.w:0;let u=this._offsets[t],d=4*this._stride*e+4*u;this._packFloats&&i[t].componentDatatype!==ze.UNSIGNED_BYTE?ZHe(c,this._batchValues,d):se.pack(c,this._batchValues,d),this._batchValuesDirty=!0};function tGe(e,t){let n=e._textureDimensions;e._texture=new Dt({context:t,pixelFormat:$e.RGBA,pixelDatatype:e._pixelDatatype,width:n.x,height:n.y,sampler:Ht.NEAREST,flipY:!1})}function nGe(e){let t=e._textureDimensions;e._texture.copyFrom({source:{width:t.x,height:t.y,arrayBufferView:e._batchValues}})}V0.prototype.update=function(e){l(this._texture)&&!this._batchValuesDirty||this._attributes.length===0||(this._batchValuesDirty=!1,l(this._texture)||tGe(this,e.context),nGe(this))};V0.prototype.getUniformMapCallback=function(){let e=this;return function(t){return e._attributes.length===0?t:Mt(t,{batchTexture:function(){return e._texture},batchTextureDimensions:function(){return e._textureDimensions},batchTextureStep:function(){return e._textureStep}})}};function iGe(e){let t=e._stride;return e._textureDimensions.y===1?`uniform vec4 batchTextureStep; +`}}var ude={mat2:$i,mat3:$,mat4:M},xHe=/\.ktx2$/i;function THe(e){let t;return function(n,i){let r=n.uniforms,o=r[e],s=t!==o,a=!l(o)||o===nt.DefaultImageId;t=o;let c=n._textures[e],u,f;if(o instanceof HTMLVideoElement){if(o.readyState>=2){if(s&&l(c)&&(c!==i.defaultTexture&&c.destroy(),c=void 0),!l(c)||c===i.defaultTexture){let d=new Ht({minificationFilter:n._minificationFilter,magnificationFilter:n._magnificationFilter});c=new Dt({context:i,source:o,sampler:d}),n._textures[e]=c;return}c.copyFrom({source:o})}else l(c)||(n._textures[e]=i.defaultTexture);return}if(o instanceof Dt&&o!==c){n._texturePaths[e]=void 0;let d=n._textures[e];l(d)&&d!==n._defaultTexture&&d.destroy(),n._textures[e]=o,u=`${e}Dimensions`,r.hasOwnProperty(u)&&(f=r[u],f.x=o._width,f.y=o._height);return}if(s&&l(c)&&a&&(c!==n._defaultTexture&&c.destroy(),c=void 0,n._texturePaths[e]=void 0),l(c)||(c=n._textures[e]=n._defaultTexture,u=`${e}Dimensions`,r.hasOwnProperty(u)&&(f=r[u],f.x=c._width,f.y=c._height)),!a){if((o instanceof HTMLCanvasElement||o instanceof HTMLImageElement||o instanceof ImageBitmap||o instanceof OffscreenCanvas)&&o!==n._texturePaths[e]){n._loadedImages.push({id:e,image:o}),n._texturePaths[e]=o;return}dde(n,e)}}}function dde(e,t){let i=e.uniforms[t];if(i===nt.DefaultImageId)return Promise.resolve();let r=De.createIfNeeded(i);if(!(r instanceof De))return Promise.resolve();let o=De.createIfNeeded(e._texturePaths[t]);if(!(!l(o)||o.url!==r.url))return Promise.resolve();let a;return xHe.test(r.url)?a=nf(r.url):a=r.fetchImage(),Promise.resolve(a).then(function(c){e._loadedImages.push({id:t,image:c})}).catch(function(c){e._initializationError=c;let u=e._textures[t];l(u)&&u!==e._defaultTexture&&u.destroy(),e._textures[t]=e._defaultTexture}),e._texturePaths[t]=i,a}function EHe(e){return function(t,n){let i=t.uniforms[e];if(i instanceof ls){let r=t._textures[e];r!==t._defaultTexture&&r.destroy(),t._texturePaths[e]=void 0,t._textures[e]=i;return}l(t._textures[e])||(t._textures[e]=n.defaultCubeMap),hde(t,e)}}function hde(e,t){let i=e.uniforms[t];if(i===nt.DefaultCubeMapId)return Promise.resolve();let r=i.positiveX+i.negativeX+i.positiveY+i.negativeY+i.positiveZ+i.negativeZ;if(r===e._texturePaths[t])return Promise.resolve();let o=[De.createIfNeeded(i.positiveX).fetchImage(),De.createIfNeeded(i.negativeX).fetchImage(),De.createIfNeeded(i.positiveY).fetchImage(),De.createIfNeeded(i.negativeY).fetchImage(),De.createIfNeeded(i.positiveZ).fetchImage(),De.createIfNeeded(i.negativeZ).fetchImage()],s=Promise.all(o);return s.then(function(a){e._loadedCubeMaps.push({id:t,images:a})}).catch(function(a){e._initializationError=a}),e._texturePaths[t]=r,s}function CHe(e){let t=e._template.uniforms;for(let n in t)t.hasOwnProperty(n)&&mde(e,n)}function mde(e,t){let n=e._strict,i=e._template.uniforms,r=i[t],o=vHe(r),s;if(o==="channels")s=TP(e,t,r,!1);else{if(o==="sampler2D"){let u=`${t}Dimensions`;wHe(e,u)>0&&(i[u]={type:"ivec3",x:1,y:1},mde(e,u))}if(!new RegExp(`uniform\\s+${o}\\s+${t}\\s*;`).test(e.shaderSource)){let u=`uniform ${o} ${t};`;e.shaderSource=u+e.shaderSource}let c=`${t}_${e._count++}`;if(s=TP(e,t,c),e.uniforms[t]=r,o==="sampler2D")e._uniforms[c]=function(){return e._textures[t]},e._updateFunctions.push(THe(t)),e._initializationPromises.push(dde(e,t));else if(o==="samplerCube")e._uniforms[c]=function(){return e._textures[t]},e._updateFunctions.push(EHe(t)),e._initializationPromises.push(hde(e,t));else if(o.indexOf("mat")!==-1){let u=new ude[o];e._uniforms[c]=function(){return ude[o].fromColumnMajorArray(e.uniforms[t],u)}}else e._uniforms[c]=function(){return e.uniforms[t]}}}function vHe(e){let t=e.type;if(!l(t)){let n=typeof e;if(n==="number")t="float";else if(n==="boolean")t="bool";else if(n==="string"||e instanceof De||e instanceof HTMLCanvasElement||e instanceof HTMLImageElement||e instanceof ImageBitmap||e instanceof OffscreenCanvas)/^([rgba]){1,4}$/i.test(e)?t="channels":e===nt.DefaultCubeMapId?t="samplerCube":t="sampler2D";else if(n==="object")if(Array.isArray(e))(e.length===4||e.length===9||e.length===16)&&(t=`mat${Math.sqrt(e.length)}`);else{let i=0;for(let r in e)e.hasOwnProperty(r)&&(i+=1);i>=2&&i<=4?t=`vec${i}`:i===6&&(t="samplerCube")}}return t}function SHe(e){let t=e._strict,n=e._template.materials;for(let i in n)if(n.hasOwnProperty(i)){let r=new nt({strict:t,fabric:n[i],count:e._count});e._count=r._count,e._uniforms=Mt(e._uniforms,r._uniforms,!0),e.materials[i]=r,e._translucentFunctions=e._translucentFunctions.concat(r._translucentFunctions);let o="czm_getMaterial",s=`${o}_${e._count++}`;TP(r,o,s),e.shaderSource=r.shaderSource+e.shaderSource;let a=`${s}(materialInput)`,c=TP(e,i,a)}}function TP(e,t,n,i){i=i??!0;let r=0,o="([\\w])?",s=`([\\w${i?".":""}])?`,a=new RegExp(s+t+o,"g");return e.shaderSource=e.shaderSource.replace(a,function(c,u,f){return u||f?c:(r+=1,n)}),r}function wHe(e,t,n){return TP(e,t,t,n)}nt._materialCache={_materials:{},addMaterial:function(e,t){this._materials[e]=t},getMaterial:function(e){return this._materials[e]}};nt.DefaultImageId="czm_defaultImage";nt.DefaultCubeMapId="czm_defaultCubeMap";nt.ColorType="Color";nt._materialCache.addMaterial(nt.ColorType,{fabric:{type:nt.ColorType,uniforms:{color:new z(1,0,0,.5)},components:{diffuse:"color.rgb",alpha:"color.a"}},translucent:function(e){return e.uniforms.color.alpha<1}});nt.ImageType="Image";nt._materialCache.addMaterial(nt.ImageType,{fabric:{type:nt.ImageType,uniforms:{image:nt.DefaultImageId,repeat:new U(1,1),color:new z(1,1,1,1)},components:{diffuse:"texture(image, fract(repeat * materialInput.st)).rgb * color.rgb",alpha:"texture(image, fract(repeat * materialInput.st)).a * color.a"}},translucent:function(e){return e.uniforms.color.alpha<1}});nt.DiffuseMapType="DiffuseMap";nt._materialCache.addMaterial(nt.DiffuseMapType,{fabric:{type:nt.DiffuseMapType,uniforms:{image:nt.DefaultImageId,channels:"rgb",repeat:new U(1,1)},components:{diffuse:"texture(image, fract(repeat * materialInput.st)).channels"}},translucent:!1});nt.AlphaMapType="AlphaMap";nt._materialCache.addMaterial(nt.AlphaMapType,{fabric:{type:nt.AlphaMapType,uniforms:{image:nt.DefaultImageId,channel:"a",repeat:new U(1,1)},components:{alpha:"texture(image, fract(repeat * materialInput.st)).channel"}},translucent:!0});nt.SpecularMapType="SpecularMap";nt._materialCache.addMaterial(nt.SpecularMapType,{fabric:{type:nt.SpecularMapType,uniforms:{image:nt.DefaultImageId,channel:"r",repeat:new U(1,1)},components:{specular:"texture(image, fract(repeat * materialInput.st)).channel"}},translucent:!1});nt.EmissionMapType="EmissionMap";nt._materialCache.addMaterial(nt.EmissionMapType,{fabric:{type:nt.EmissionMapType,uniforms:{image:nt.DefaultImageId,channels:"rgb",repeat:new U(1,1)},components:{emission:"texture(image, fract(repeat * materialInput.st)).channels"}},translucent:!1});nt.BumpMapType="BumpMap";nt._materialCache.addMaterial(nt.BumpMapType,{fabric:{type:nt.BumpMapType,uniforms:{image:nt.DefaultImageId,channel:"r",strength:.8,repeat:new U(1,1)},source:pk},translucent:!1});nt.NormalMapType="NormalMap";nt._materialCache.addMaterial(nt.NormalMapType,{fabric:{type:nt.NormalMapType,uniforms:{image:nt.DefaultImageId,channels:"rgb",strength:.8,repeat:new U(1,1)},source:Ek},translucent:!1});nt.GridType="Grid";nt._materialCache.addMaterial(nt.GridType,{fabric:{type:nt.GridType,uniforms:{color:new z(0,1,0,1),cellAlpha:.1,lineCount:new U(8,8),lineThickness:new U(1,1),lineOffset:new U(0,0)},source:Tk},translucent:function(e){let t=e.uniforms;return t.color.alpha<1||t.cellAlpha<1}});nt.StripeType="Stripe";nt._materialCache.addMaterial(nt.StripeType,{fabric:{type:nt.StripeType,uniforms:{horizontal:!0,evenColor:new z(1,1,1,.5),oddColor:new z(0,0,1,.5),offset:0,repeat:5},source:Dk},translucent:function(e){let t=e.uniforms;return t.evenColor.alpha<1||t.oddColor.alpha<1}});nt.CheckerboardType="Checkerboard";nt._materialCache.addMaterial(nt.CheckerboardType,{fabric:{type:nt.CheckerboardType,uniforms:{lightColor:new z(1,1,1,.5),darkColor:new z(0,0,0,.5),repeat:new U(5,5)},source:gk},translucent:function(e){let t=e.uniforms;return t.lightColor.alpha<1||t.darkColor.alpha<1}});nt.DotType="Dot";nt._materialCache.addMaterial(nt.DotType,{fabric:{type:nt.DotType,uniforms:{lightColor:new z(1,1,0,.75),darkColor:new z(0,1,1,.75),repeat:new U(5,5)},source:_k},translucent:function(e){let t=e.uniforms;return t.lightColor.alpha<1||t.darkColor.alpha<1}});nt.WaterType="Water";nt._materialCache.addMaterial(nt.WaterType,{fabric:{type:nt.WaterType,uniforms:{baseWaterColor:new z(.2,.3,.6,1),blendColor:new z(0,1,.699,1),specularMap:nt.DefaultImageId,normalMap:nt.DefaultImageId,frequency:10,animationSpeed:.01,amplitude:1,specularIntensity:.5,fadeFactor:1},source:Ok},translucent:function(e){let t=e.uniforms;return t.baseWaterColor.alpha<1||t.blendColor.alpha<1}});nt.RimLightingType="RimLighting";nt._materialCache.addMaterial(nt.RimLightingType,{fabric:{type:nt.RimLightingType,uniforms:{color:new z(1,0,0,.7),rimColor:new z(1,1,1,.4),width:.3},source:Ik},translucent:function(e){let t=e.uniforms;return t.color.alpha<1||t.rimColor.alpha<1}});nt.FadeType="Fade";nt._materialCache.addMaterial(nt.FadeType,{fabric:{type:nt.FadeType,uniforms:{fadeInColor:new z(1,0,0,1),fadeOutColor:new z(0,0,0,0),maximumDistance:.5,repeat:!0,fadeDirection:{x:!0,y:!0},time:new U(.5,.5)},source:xk},translucent:function(e){let t=e.uniforms;return t.fadeInColor.alpha<1||t.fadeOutColor.alpha<1}});nt.PolylineArrowType="PolylineArrow";nt._materialCache.addMaterial(nt.PolylineArrowType,{fabric:{type:nt.PolylineArrowType,uniforms:{color:new z(1,1,1,1)},source:Ck},translucent:!0});nt.PolylineDashType="PolylineDash";nt._materialCache.addMaterial(nt.PolylineDashType,{fabric:{type:nt.PolylineDashType,uniforms:{color:new z(1,0,1,1),gapColor:new z(0,0,0,0),dashLength:16,dashPattern:255},source:vk},translucent:!0});nt.PolylineGlowType="PolylineGlow";nt._materialCache.addMaterial(nt.PolylineGlowType,{fabric:{type:nt.PolylineGlowType,uniforms:{color:new z(0,.5,1,1),glowPower:.25,taperPower:1},source:Sk},translucent:!0});nt.PolylineOutlineType="PolylineOutline";nt._materialCache.addMaterial(nt.PolylineOutlineType,{fabric:{type:nt.PolylineOutlineType,uniforms:{color:new z(1,1,1,1),outlineColor:new z(1,0,0,1),outlineWidth:1},source:wk},translucent:function(e){let t=e.uniforms;return t.color.alpha<1||t.outlineColor.alpha<1}});nt.ElevationContourType="ElevationContour";nt._materialCache.addMaterial(nt.ElevationContourType,{fabric:{type:nt.ElevationContourType,uniforms:{spacing:100,color:new z(1,0,0,1),width:1},source:Ak},translucent:!1});nt.ElevationRampType="ElevationRamp";nt._materialCache.addMaterial(nt.ElevationRampType,{fabric:{type:nt.ElevationRampType,uniforms:{image:nt.DefaultImageId,minimumHeight:0,maximumHeight:1e4},source:bk},translucent:!1});nt.SlopeRampMaterialType="SlopeRamp";nt._materialCache.addMaterial(nt.SlopeRampMaterialType,{fabric:{type:nt.SlopeRampMaterialType,uniforms:{image:nt.DefaultImageId},source:Pk},translucent:!1});nt.AspectRampMaterialType="AspectRamp";nt._materialCache.addMaterial(nt.AspectRampMaterialType,{fabric:{type:nt.AspectRampMaterialType,uniforms:{image:nt.DefaultImageId},source:mk},translucent:!1});nt.ElevationBandType="ElevationBand";nt._materialCache.addMaterial(nt.ElevationBandType,{fabric:{type:nt.ElevationBandType,uniforms:{heights:nt.DefaultImageId,colors:nt.DefaultImageId},source:yk},translucent:!0});nt.WaterMaskType="WaterMask";nt._materialCache.addMaterial(nt.WaterMaskType,{fabric:{type:nt.WaterMaskType,source:Rk,uniforms:{waterColor:new z(1,1,1,1),landColor:new z(0,0,0,0)}},translucent:!1});var rr=nt;var IHe=`#define CLIP_POLYLINE +${du} +${hk}`,PHe=KE;function Nb(e){e=e??H.EMPTY_OBJECT;let t=e.translucent??!0,n=!1,i=Nb.VERTEX_FORMAT;this.material=l(e.material)?e.material:rr.fromType(rr.ColorType),this.translucent=t,this._vertexShaderSource=e.vertexShaderSource??IHe,this._fragmentShaderSource=e.fragmentShaderSource??PHe,this._renderState=Rr.getDefaultRenderState(t,n,e.renderState),this._closed=n,this._vertexFormat=i}Object.defineProperties(Nb.prototype,{vertexShaderSource:{get:function(){let e=this._vertexShaderSource;return this.material.shaderSource.search(/in\s+float\s+v_polylineAngle;/g)!==-1&&(e=`#define POLYLINE_DASH +${e}`),e}},fragmentShaderSource:{get:function(){return this._fragmentShaderSource}},renderState:{get:function(){return this._renderState}},closed:{get:function(){return this._closed}},vertexFormat:{get:function(){return this._vertexFormat}}});Nb.VERTEX_FORMAT=Be.POSITION_AND_ST;Nb.prototype.getFragmentShaderSource=Rr.prototype.getFragmentShaderSource;Nb.prototype.isTranslucent=Rr.prototype.isTranslucent;Nb.prototype.getRenderState=Rr.prototype.getRenderState;var yc=Nb;function DHe(e,t){let n=[],i=e.length,r=0;for(;r<i;){let o=Math.ceil((i-r)/t--);n.push(e.slice(r,r+o)),r+=o}return n}var Mk=DHe;function H0(e,t,n){if(this._attributes=t,this._numberOfInstances=n,t.length===0)return;let i=RHe(t),r=e.floatingPointTexture,o=i===ze.FLOAT&&!r,s=OHe(t,o),a=MHe(s,t,o),c=Math.floor(Ut.maximumTextureSize/a),u=Math.min(n,c),f=a*u,d=Math.ceil(n/u),p=1/f,g=p*.5,m=1/d,y=m*.5;this._textureDimensions=new U(f,d),this._textureStep=new se(p,g,m,y),this._pixelDatatype=o?ze.UNSIGNED_BYTE:i,this._packFloats=o,this._offsets=s,this._stride=a,this._texture=void 0;let A=4*f*d;this._batchValues=i===ze.FLOAT&&!o?new Float32Array(A):new Uint8Array(A),this._batchValuesDirty=!1}Object.defineProperties(H0.prototype,{attributes:{get:function(){return this._attributes}},numberOfInstances:{get:function(){return this._numberOfInstances}}});function RHe(e){let t=!1,n=e.length;for(let i=0;i<n;++i)if(e[i].componentDatatype!==Y.UNSIGNED_BYTE){t=!0;break}return t?ze.FLOAT:ze.UNSIGNED_BYTE}function gde(e,t){let n=e[t].componentsPerAttribute;return n===2?U:n===3?h:n===4?se:Number}function OHe(e,t){let n=new Array(e.length),i=0,r=e.length;for(let o=0;o<r;++o){let a=e[o].componentDatatype;n[o]=i,a!==Y.UNSIGNED_BYTE&&t?i+=4:++i}return n}function MHe(e,t,n){let i=e.length,r=e[i-1];return t[i-1].componentDatatype!==Y.UNSIGNED_BYTE&&n?r+4:r+1}var EP=new se;function NHe(e,t,n){let i=se.unpack(e,t,EP),r=se.unpackFloat(i);i=se.unpack(e,t+4,EP);let o=se.unpackFloat(i);i=se.unpack(e,t+8,EP);let s=se.unpackFloat(i);i=se.unpack(e,t+12,EP);let a=se.unpackFloat(i);return se.fromElements(r,o,s,a,n)}function LHe(e,t,n){let i=se.packFloat(e.x,EP);se.pack(i,t,n),i=se.packFloat(e.y,i),se.pack(i,t,n+4),i=se.packFloat(e.z,i),se.pack(i,t,n+8),i=se.packFloat(e.w,i),se.pack(i,t,n+12)}var pde=new se;H0.prototype.getBatchedAttribute=function(e,t,n){let i=this._attributes,r=this._offsets[t],s=4*this._stride*e+4*r,a;this._packFloats&&i[t].componentDatatype!==ze.UNSIGNED_BYTE?a=NHe(this._batchValues,s,pde):a=se.unpack(this._batchValues,s,pde);let c=gde(i,t);return l(c.fromCartesian4)?c.fromCartesian4(a,n):l(c.clone)?c.clone(a,n):a.x};var FHe=[void 0,void 0,new U,new h,new se],BHe=new se;H0.prototype.setBatchedAttribute=function(e,t,n){let i=this._attributes,r=FHe[i[t].componentsPerAttribute],o=this.getBatchedAttribute(e,t,r),s=gde(this._attributes,t);if(l(s.equals)?s.equals(o,n):o===n)return;let c=BHe;c.x=l(n.x)?n.x:n,c.y=l(n.y)?n.y:0,c.z=l(n.z)?n.z:0,c.w=l(n.w)?n.w:0;let u=this._offsets[t],d=4*this._stride*e+4*u;this._packFloats&&i[t].componentDatatype!==ze.UNSIGNED_BYTE?LHe(c,this._batchValues,d):se.pack(c,this._batchValues,d),this._batchValuesDirty=!0};function kHe(e,t){let n=e._textureDimensions;e._texture=new Dt({context:t,pixelFormat:$e.RGBA,pixelDatatype:e._pixelDatatype,width:n.x,height:n.y,sampler:Ht.NEAREST,flipY:!1})}function UHe(e){let t=e._textureDimensions;e._texture.copyFrom({source:{width:t.x,height:t.y,arrayBufferView:e._batchValues}})}H0.prototype.update=function(e){l(this._texture)&&!this._batchValuesDirty||this._attributes.length===0||(this._batchValuesDirty=!1,l(this._texture)||kHe(this,e.context),UHe(this))};H0.prototype.getUniformMapCallback=function(){let e=this;return function(t){return e._attributes.length===0?t:Mt(t,{batchTexture:function(){return e._texture},batchTextureDimensions:function(){return e._textureDimensions},batchTextureStep:function(){return e._textureStep}})}};function zHe(e){let t=e._stride;return e._textureDimensions.y===1?`uniform vec4 batchTextureStep; vec2 computeSt(float batchId) { float stepX = batchTextureStep.x; @@ -6764,7 +6659,7 @@ vec2 computeSt(float batchId) float yId = floor(batchId * numberOfAttributes / batchTextureDimensions.x); return vec2(centerX + (xId * stepX), centerY + (yId * stepY)); } -`}function rGe(e){return e===1?"float":`vec${e}`}function oGe(e){return e===1?".x":e===2?".xy":e===3?".xyz":""}function sGe(e,t){let i=e._attributes[t],r=i.componentsPerAttribute,o=i.functionName,s=rGe(r),a=oGe(r),c=e._offsets[t],u=`${s} ${o}(float batchId) +`}function VHe(e){return e===1?"float":`vec${e}`}function jHe(e){return e===1?".x":e===2?".xy":e===3?".xyz":""}function HHe(e,t){let i=e._attributes[t],r=i.componentsPerAttribute,o=i.functionName,s=VHe(r),a=jHe(r),c=e._offsets[t],u=`${s} ${o}(float batchId) { vec2 st = computeSt(batchId); st.x += batchTextureStep.x * float(${c}); @@ -6779,11 +6674,11 @@ textureValue.w = czm_unpackFloat(texture(batchTexture, st + vec2(batchTextureSte `:e._pixelDatatype===ze.FLOAT&&i.componentDatatype===Y.UNSIGNED_BYTE&&i.normalize&&(u+=`value /= 255.0; `),u+=` return value; } -`,u}V0.prototype.getVertexShaderCallback=function(){let e=this._attributes;if(e.length===0)return function(i){return i};let t=`uniform highp sampler2D batchTexture; -`;t+=`${iGe(this)} -`;let n=e.length;for(let i=0;i<n;++i)t+=sGe(this,i);return function(i){let r=i.indexOf("void main"),o=i.substring(0,r),s=i.substring(r);return`${o} +`,u}H0.prototype.getVertexShaderCallback=function(){let e=this._attributes;if(e.length===0)return function(i){return i};let t=`uniform highp sampler2D batchTexture; +`;t+=`${zHe(this)} +`;let n=e.length;for(let i=0;i<n;++i)t+=HHe(this,i);return function(i){let r=i.indexOf("void main"),o=i.substring(0,r),s=i.substring(r);return`${o} ${t} -${s}`}};V0.prototype.isDestroyed=function(){return!1};V0.prototype.destroy=function(){return this._texture=this._texture&&this._texture.destroy(),le(this)};var tC=V0;var CP=class e{constructor(t){this._ellipsoid=t??ee.WGS84,this._semimajorAxis=this._ellipsoid.maximumRadius,this._oneOverSemimajorAxis=1/this._semimajorAxis}get ellipsoid(){return this._ellipsoid}static mercatorAngleToGeodeticLatitude(t){return P.PI_OVER_TWO-2*Math.atan(Math.exp(-t))}static geodeticLatitudeToMercatorAngle(t){t>e.MaximumLatitude?t=e.MaximumLatitude:t<-e.MaximumLatitude&&(t=-e.MaximumLatitude);let n=Math.sin(t);return .5*Math.log((1+n)/(1-n))}project(t,n){let i=this._semimajorAxis,r=t.longitude*i,o=e.geodeticLatitudeToMercatorAngle(t.latitude)*i,s=t.height;return l(n)?(n.x=r,n.y=o,n.z=s,n):new h(r,o,s)}unproject(t,n){let i=this._oneOverSemimajorAxis,r=t.x*i,o=e.mercatorAngleToGeodeticLatitude(t.y*i),s=t.z;return l(n)?(n.longitude=r,n.latitude=o,n.height=s,n):new he(r,o,s)}};CP.MaximumLatitude=CP.mercatorAngleToGeodeticLatitude(Math.PI);var Ti=CP;function aGe(e,t,n){let i=!n,r=e.length,o;if(!i&&r>1){let s=e[0].modelMatrix;for(o=1;o<r;++o)if(!M.equals(s,e[o].modelMatrix)){i=!0;break}}if(i)for(o=0;o<r;++o)l(e[o].geometry)&&Wn.transformToWorldCoordinates(e[o]);else M.multiplyTransformation(t,e[0].modelMatrix,t)}function wX(e,t){let n=e.attributes,i=n.position,r=i.values.length/i.componentsPerAttribute;n.batchId=new Ne({componentDatatype:Y.FLOAT,componentsPerAttribute:1,values:new Float32Array(r)});let o=n.batchId.values;for(let s=0;s<r;++s)o[s]=t}function cGe(e){let t=e.length;for(let n=0;n<t;++n){let i=e[n];l(i.geometry)?wX(i.geometry,n):l(i.westHemisphereGeometry)&&l(i.eastHemisphereGeometry)&&(wX(i.westHemisphereGeometry,n),wX(i.eastHemisphereGeometry,n))}}function lGe(e){let t=e.instances,n=e.projection,i=e.elementIndexUintSupported,r=e.scene3DOnly,o=e.vertexCacheOptimize,s=e.compressVertices,a=e.modelMatrix,c,u,f,d=t.length;for(c=0;c<d;++c)if(l(t[c].geometry)){f=t[c].geometry.primitiveType;break}if(aGe(t,a,r),!r)for(c=0;c<d;++c)l(t[c].geometry)&&Wn.splitLongitude(t[c]);if(cGe(t),o)for(c=0;c<d;++c){let g=t[c];l(g.geometry)?(Wn.reorderForPostVertexCache(g.geometry),Wn.reorderForPreVertexCache(g.geometry)):l(g.westHemisphereGeometry)&&l(g.eastHemisphereGeometry)&&(Wn.reorderForPostVertexCache(g.westHemisphereGeometry),Wn.reorderForPreVertexCache(g.westHemisphereGeometry),Wn.reorderForPostVertexCache(g.eastHemisphereGeometry),Wn.reorderForPreVertexCache(g.eastHemisphereGeometry))}let p=Wn.combineInstances(t);for(d=p.length,c=0;c<d;++c){u=p[c];let g=u.attributes;if(r)for(let m in g)g.hasOwnProperty(m)&&g[m].componentDatatype===Y.DOUBLE&&Wn.encodeAttribute(u,m,`${m}3DHigh`,`${m}3DLow`);else for(let m in g)if(g.hasOwnProperty(m)&&g[m].componentDatatype===Y.DOUBLE){let y=`${m}3D`,A=`${m}2D`;Wn.projectTo2D(u,m,y,A,n),l(u.boundingSphere)&&m==="position"&&(u.boundingSphereCV=ue.fromVertices(u.attributes.position2D.values)),Wn.encodeAttribute(u,y,`${y}High`,`${y}Low`),Wn.encodeAttribute(u,A,`${A}High`,`${A}Low`)}s&&Wn.compressVertices(u)}if(!i){let g=[];for(d=p.length,c=0;c<d;++c)u=p[c],g=g.concat(Wn.fitToUnsignedShortIndices(u));p=g}return p}function IX(e,t,n,i){let r,o,s,a=i.length-1;if(a>=0){let u=i[a];r=u.offset+u.count,s=u.index,o=n[s].indices.length}else r=0,s=0,o=n[s].indices.length;let c=e.length;for(let u=0;u<c;++u){let d=e[u][t];if(!l(d))continue;let p=d.indices.length;r+p>o&&(r=0,o=n[++s].indices.length),i.push({index:s,offset:r,count:p}),r+=p}}function uGe(e,t){let n=[];return IX(e,"geometry",t,n),IX(e,"westHemisphereGeometry",t,n),IX(e,"eastHemisphereGeometry",t,n),n}var j0={};j0.combineGeometry=function(e){let t,n,i=e.instances,r=i.length,o,s,a=!1;r>0&&(t=lGe(e),t.length>0&&(n=Wn.createAttributeLocations(t[0]),e.createPickOffsets&&(o=uGe(i,t))),l(i[0].attributes)&&l(i[0].attributes.offset)&&(s=new Array(r),a=!0));let c=new Array(r),u=new Array(r);for(let f=0;f<r;++f){let d=i[f],p=d.geometry;l(p)&&(c[f]=p.boundingSphere,u[f]=p.boundingSphereCV,a&&(s[f]=d.geometry.offsetAttribute));let g=d.eastHemisphereGeometry,m=d.westHemisphereGeometry;l(g)&&l(m)&&(l(g.boundingSphere)&&l(m.boundingSphere)&&(c[f]=ue.union(g.boundingSphere,m.boundingSphere)),l(g.boundingSphereCV)&&l(m.boundingSphereCV)&&(u[f]=ue.union(g.boundingSphereCV,m.boundingSphereCV)))}return{geometries:t,modelMatrix:e.modelMatrix,attributeLocations:n,pickOffsets:o,offsetInstanceExtend:s,boundingSpheres:c,boundingSpheresCV:u}};function fGe(e,t){let n=e.attributes;for(let i in n)if(n.hasOwnProperty(i)){let r=n[i];l(r)&&l(r.values)&&t.push(r.values.buffer)}l(e.indices)&&t.push(e.indices.buffer)}function dGe(e,t){let n=e.length;for(let i=0;i<n;++i)fGe(e[i],t)}function hGe(e){let t=1,n=e.length;for(let i=0;i<n;i++){let r=e[i];if(++t,!l(r))continue;let o=r.attributes;t+=7+2*ue.packedLength+(l(r.indices)?r.indices.length:0);for(let s in o)if(o.hasOwnProperty(s)&&l(o[s])){let a=o[s];t+=5+a.values.length}}return t}j0.packCreateGeometryResults=function(e,t){let n=new Float64Array(hGe(e)),i=[],r={},o=e.length,s=0;n[s++]=o;for(let a=0;a<o;a++){let c=e[a],u=l(c);if(n[s++]=u?1:0,!u)continue;n[s++]=c.primitiveType,n[s++]=c.geometryType,n[s++]=c.offsetAttribute??-1;let f=l(c.boundingSphere)?1:0;n[s++]=f,f&&ue.pack(c.boundingSphere,n,s),s+=ue.packedLength;let d=l(c.boundingSphereCV)?1:0;n[s++]=d,d&&ue.pack(c.boundingSphereCV,n,s),s+=ue.packedLength;let p=c.attributes,g=[];for(let y in p)p.hasOwnProperty(y)&&l(p[y])&&(g.push(y),l(r[y])||(r[y]=i.length,i.push(y)));n[s++]=g.length;for(let y=0;y<g.length;y++){let A=g[y],b=p[A];n[s++]=r[A],n[s++]=b.componentDatatype,n[s++]=b.componentsPerAttribute,n[s++]=b.normalize?1:0,n[s++]=b.values.length,n.set(b.values,s),s+=b.values.length}let m=l(c.indices)?c.indices.length:0;n[s++]=m,m>0&&(n.set(c.indices,s),s+=m)}return t.push(n.buffer),{stringTable:i,packedData:n}};j0.unpackCreateGeometryResults=function(e){let t=e.stringTable,n=e.packedData,i,r=new Array(n[0]),o=0,s=1;for(;s<n.length;){if(!(n[s++]===1)){r[o++]=void 0;continue}let c=n[s++],u=n[s++],f=n[s++];f===-1&&(f=void 0);let d,p;n[s++]===1&&(d=ue.unpack(n,s)),s+=ue.packedLength,n[s++]===1&&(p=ue.unpack(n,s)),s+=ue.packedLength;let y,A,b,x=new En,T=n[s++];for(i=0;i<T;i++){let v=t[n[s++]],S=n[s++];b=n[s++];let I=n[s++]!==0;y=n[s++],A=Y.createTypedArray(S,y);for(let R=0;R<y;R++)A[R]=n[s++];x[v]=new Ne({componentDatatype:S,componentsPerAttribute:b,normalize:I,values:A})}let E;if(y=n[s++],y>0){let v=A.length/b;for(E=je.createTypedArray(v,y),i=0;i<y;i++)E[i]=n[s++]}r[o++]=new wt({primitiveType:c,geometryType:u,boundingSphere:d,boundingSphereCV:p,indices:E,attributes:x,offsetAttribute:f})}return r};function mGe(e,t){let n=e.length,i=new Float64Array(1+n*19),r=0;i[r++]=n;for(let o=0;o<n;o++){let s=e[o];if(M.pack(s.modelMatrix,i,r),r+=M.packedLength,l(s.attributes)&&l(s.attributes.offset)){let a=s.attributes.offset.value;i[r]=a[0],i[r+1]=a[1],i[r+2]=a[2]}r+=3}return t.push(i.buffer),i}function pGe(e){let t=e,n=new Array(t[0]),i=0,r=1;for(;r<t.length;){let o=M.unpack(t,r),s;r+=M.packedLength,l(t[r])&&(s={offset:new Er(t[r],t[r+1],t[r+2])}),r+=3,n[i++]={modelMatrix:o,attributes:s}}return n}j0.packCombineGeometryParameters=function(e,t){let n=e.createGeometryResults,i=n.length;for(let r=0;r<i;r++)t.push(n[r].packedData.buffer);return{createGeometryResults:e.createGeometryResults,packedInstances:mGe(e.instances,t),ellipsoid:e.ellipsoid,isGeographic:e.projection instanceof ji,elementIndexUintSupported:e.elementIndexUintSupported,scene3DOnly:e.scene3DOnly,vertexCacheOptimize:e.vertexCacheOptimize,compressVertices:e.compressVertices,modelMatrix:e.modelMatrix,createPickOffsets:e.createPickOffsets}};j0.unpackCombineGeometryParameters=function(e){let t=pGe(e.packedInstances),n=e.createGeometryResults,i=n.length,r=0;for(let a=0;a<i;a++){let c=j0.unpackCreateGeometryResults(n[a]),u=c.length;for(let f=0;f<u;f++){let d=c[f],p=t[r];p.geometry=d,++r}}let o=ee.clone(e.ellipsoid),s=e.isGeographic?new ji(o):new Ti(o);return{instances:t,ellipsoid:o,projection:s,elementIndexUintSupported:e.elementIndexUintSupported,scene3DOnly:e.scene3DOnly,vertexCacheOptimize:e.vertexCacheOptimize,compressVertices:e.compressVertices,modelMatrix:M.clone(e.modelMatrix),createPickOffsets:e.createPickOffsets}};function nde(e){let t=e.length,n=1+(ue.packedLength+1)*t,i=new Float32Array(n),r=0;i[r++]=t;for(let o=0;o<t;++o){let s=e[o];l(s)?(i[r++]=1,ue.pack(e[o],i,r)):i[r++]=0,r+=ue.packedLength}return i}function ide(e){let t=new Array(e[0]),n=0,i=1;for(;i<e.length;)e[i++]===1&&(t[n]=ue.unpack(e,i)),++n,i+=ue.packedLength;return t}j0.packCombineGeometryResults=function(e,t){l(e.geometries)&&dGe(e.geometries,t);let n=nde(e.boundingSpheres),i=nde(e.boundingSpheresCV);return t.push(n.buffer,i.buffer),{geometries:e.geometries,attributeLocations:e.attributeLocations,modelMatrix:e.modelMatrix,pickOffsets:e.pickOffsets,offsetInstanceExtend:e.offsetInstanceExtend,boundingSpheres:n,boundingSpheresCV:i}};j0.unpackCombineGeometryResults=function(e){return{geometries:e.geometries,attributeLocations:e.attributeLocations,modelMatrix:e.modelMatrix,pickOffsets:e.pickOffsets,offsetInstanceExtend:e.offsetInstanceExtend,boundingSpheres:ide(e.boundingSpheres),boundingSpheresCV:ide(e.boundingSpheresCV)}};var nC=j0;var rde={READY:0,CREATING:1,CREATED:2,COMBINING:3,COMBINED:4,COMPLETE:5,FAILED:6};Object.freeze(rde);var fs=rde;var hu={DISABLED:0,ENABLED:1,CAST_ONLY:2,RECEIVE_ONLY:3};hu.NUMBER_OF_SHADOW_MODES=4;hu.castShadows=function(e){return e===hu.ENABLED||e===hu.CAST_ONLY};hu.receiveShadows=function(e){return e===hu.ENABLED||e===hu.RECEIVE_ONLY};hu.fromCastReceive=function(e,t){return e&&t?hu.ENABLED:e?hu.CAST_ONLY:t?hu.RECEIVE_ONLY:hu.DISABLED};Object.freeze(hu);var Dn=hu;function qo(e){e=e??H.EMPTY_OBJECT,this.geometryInstances=e.geometryInstances,this.appearance=e.appearance,this._appearance=void 0,this._material=void 0,this.depthFailAppearance=e.depthFailAppearance,this._depthFailAppearance=void 0,this._depthFailMaterial=void 0,this.modelMatrix=M.clone(e.modelMatrix??M.IDENTITY),this._modelMatrix=new M,this.show=e.show??!0,this._vertexCacheOptimize=e.vertexCacheOptimize??!1,this._interleave=e.interleave??!1,this._releaseGeometryInstances=e.releaseGeometryInstances??!0,this._allowPicking=e.allowPicking??!0,this._asynchronous=e.asynchronous??!0,this._compressVertices=e.compressVertices??!0,this.cull=e.cull??!0,this.debugShowBoundingVolume=e.debugShowBoundingVolume??!1,this.rtcCenter=e.rtcCenter,this.shadows=e.shadows??Dn.DISABLED,this._translucent=void 0,this._state=fs.READY,this._geometries=[],this._error=void 0,this._numberOfInstances=0,this._boundingSpheres=[],this._boundingSphereWC=[],this._boundingSphereCV=[],this._boundingSphere2D=[],this._boundingSphereMorph=[],this._perInstanceAttributeCache=new Map,this._instanceIds=[],this._lastPerInstanceAttributeIndex=0,this._va=[],this._attributeLocations=void 0,this._primitiveType=void 0,this._frontFaceRS=void 0,this._backFaceRS=void 0,this._sp=void 0,this._depthFailAppearance=void 0,this._spDepthFail=void 0,this._frontFaceDepthFailRS=void 0,this._backFaceDepthFailRS=void 0,this._pickIds=[],this._colorCommands=[],this._pickCommands=[],this._createBoundingVolumeFunction=e._createBoundingVolumeFunction,this._createRenderStatesFunction=e._createRenderStatesFunction,this._createShaderProgramFunction=e._createShaderProgramFunction,this._createCommandsFunction=e._createCommandsFunction,this._updateAndQueueCommandsFunction=e._updateAndQueueCommandsFunction,this._createPickOffsets=e._createPickOffsets,this._pickOffsets=void 0,this._createGeometryResults=void 0,this._ready=!1,this._batchTable=void 0,this._batchTableAttributeIndices=void 0,this._offsetInstanceExtend=void 0,this._batchTableOffsetAttribute2DIndex=void 0,this._batchTableOffsetsUpdated=!1,this._instanceBoundingSpheres=void 0,this._instanceBoundingSpheresCV=void 0,this._tempBoundingSpheres=void 0,this._recomputeBoundingSpheres=!1,this._batchTableBoundingSpheresUpdated=!1,this._batchTableBoundingSphereAttributeIndices=void 0}Object.defineProperties(qo.prototype,{vertexCacheOptimize:{get:function(){return this._vertexCacheOptimize}},interleave:{get:function(){return this._interleave}},releaseGeometryInstances:{get:function(){return this._releaseGeometryInstances}},allowPicking:{get:function(){return this._allowPicking}},asynchronous:{get:function(){return this._asynchronous}},compressVertices:{get:function(){return this._compressVertices}},ready:{get:function(){return this._ready}}});function gGe(e){let t=e.length,n=[],i=e[0].attributes,r;for(r in i)if(i.hasOwnProperty(r)&&l(i[r])){let o=i[r],s=!0;for(let a=1;a<t;++a){let c=e[a].attributes[r];if(!l(c)||o.componentDatatype!==c.componentDatatype||o.componentsPerAttribute!==c.componentsPerAttribute||o.normalize!==c.normalize){s=!1;break}}s&&n.push(r)}return n}var _Ge=new U,yGe=new h,hde=new se;function mde(e){let t=e.length;if(t===1)return e[0];if(t===2)return U.unpack(e,0,_Ge);if(t===3)return h.unpack(e,0,yGe);if(t===4)return se.unpack(e,0,hde)}function AGe(e,t){let n=e.geometryInstances,i=Array.isArray(n)?n:[n],r=i.length;if(r===0)return;let o=gGe(i),s=o.length,a=[],c={},u={},f,p=i[0].attributes,g,m,y;for(g=0;g<s;++g)m=o[g],y=p[m],c[m]=g,a.push({functionName:`czm_batchTable_${m}`,componentDatatype:y.componentDatatype,componentsPerAttribute:y.componentsPerAttribute,normalize:y.normalize});o.indexOf("distanceDisplayCondition")!==-1&&(a.push({functionName:"czm_batchTable_boundingSphereCenter3DHigh",componentDatatype:Y.FLOAT,componentsPerAttribute:3},{functionName:"czm_batchTable_boundingSphereCenter3DLow",componentDatatype:Y.FLOAT,componentsPerAttribute:3},{functionName:"czm_batchTable_boundingSphereCenter2DHigh",componentDatatype:Y.FLOAT,componentsPerAttribute:3},{functionName:"czm_batchTable_boundingSphereCenter2DLow",componentDatatype:Y.FLOAT,componentsPerAttribute:3},{functionName:"czm_batchTable_boundingSphereRadius",componentDatatype:Y.FLOAT,componentsPerAttribute:1}),u.center3DHigh=a.length-5,u.center3DLow=a.length-4,u.center2DHigh=a.length-3,u.center2DLow=a.length-2,u.radius=a.length-1),o.indexOf("offset")!==-1&&(a.push({functionName:"czm_batchTable_offset2D",componentDatatype:Y.FLOAT,componentsPerAttribute:3}),f=a.length-1),a.push({functionName:"czm_batchTable_pickColor",componentDatatype:Y.UNSIGNED_BYTE,componentsPerAttribute:4,normalize:!0});let A=a.length,b=new tC(t,a,r);for(g=0;g<r;++g){let x=i[g];p=x.attributes;for(let I=0;I<s;++I){m=o[I],y=p[m];let R=mde(y.value),O=c[m];b.setBatchedAttribute(g,O,R)}let T={primitive:x.pickPrimitive??e};l(x.id)&&(T.id=x.id);let E=t.createPickId(T);e._pickIds.push(E);let v=E.color,S=hde;S.x=z.floatToByte(v.red),S.y=z.floatToByte(v.green),S.z=z.floatToByte(v.blue),S.w=z.floatToByte(v.alpha),b.setBatchedAttribute(g,A-1,S)}e._batchTable=b,e._batchTableAttributeIndices=c,e._batchTableBoundingSphereAttributeIndices=u,e._batchTableOffsetAttribute2DIndex=f}function bGe(e){let t;return Array.isArray(e.values)?t=e.values.slice(0):t=new e.values.constructor(e.values),new Ne({componentDatatype:e.componentDatatype,componentsPerAttribute:e.componentsPerAttribute,normalize:e.normalize,values:t})}function xGe(e){let t=e.attributes,n=new En;for(let r in t)t.hasOwnProperty(r)&&l(t[r])&&(n[r]=bGe(t[r]));let i;if(l(e.indices)){let r=e.indices;Array.isArray(r)?i=r.slice(0):i=new r.constructor(r)}return new wt({attributes:n,indices:i,primitiveType:e.primitiveType,boundingSphere:ue.clone(e.boundingSphere)})}function TGe(e,t){return{geometry:t,attributes:e.attributes,modelMatrix:M.clone(e.modelMatrix),pickPrimitive:e.pickPrimitive,id:e.id}}var EGe=/in\s+vec(?:3|4)\s+(.*)3DHigh;/g;qo._modifyShaderPosition=function(e,t,n){let i,r="",o="",s="";for(;(i=EGe.exec(t))!==null;){let a=i[1],c=`vec4 czm_compute${a[0].toUpperCase()}${a.substr(1)}()`;c!=="vec4 czm_computePosition()"&&(r+=`${c}; +${s}`}};H0.prototype.isDestroyed=function(){return!1};H0.prototype.destroy=function(){return this._texture=this._texture&&this._texture.destroy(),le(this)};var eC=H0;var _de={NEVER:te.NEVER,LESS:te.LESS,EQUAL:te.EQUAL,LESS_OR_EQUAL:te.LEQUAL,GREATER:te.GREATER,NOT_EQUAL:te.NOTEQUAL,GREATER_OR_EQUAL:te.GEQUAL,ALWAYS:te.ALWAYS};Object.freeze(_de);var Ac=_de;function CP(e,t,n){e=e??0,t=t??0,n=n??0,this.value=new Float32Array([e,t,n])}Object.defineProperties(CP.prototype,{componentDatatype:{get:function(){return Y.FLOAT}},componentsPerAttribute:{get:function(){return 3}},normalize:{get:function(){return!1}}});CP.fromCartesian3=function(e){return new CP(e.x,e.y,e.z)};CP.toValue=function(e,t){return l(t)||(t=new Float32Array([e.x,e.y,e.z])),t[0]=e.x,t[1]=e.y,t[2]=e.z,t};var Er=CP;function GHe(e,t,n){let i=!n,r=e.length,o;if(!i&&r>1){let s=e[0].modelMatrix;for(o=1;o<r;++o)if(!M.equals(s,e[o].modelMatrix)){i=!0;break}}if(i)for(o=0;o<r;++o)l(e[o].geometry)&&Wn.transformToWorldCoordinates(e[o]);else M.multiplyTransformation(t,e[0].modelMatrix,t)}function UX(e,t){let n=e.attributes,i=n.position,r=i.values.length/i.componentsPerAttribute;n.batchId=new Ne({componentDatatype:Y.FLOAT,componentsPerAttribute:1,values:new Float32Array(r)});let o=n.batchId.values;for(let s=0;s<r;++s)o[s]=t}function WHe(e){let t=e.length;for(let n=0;n<t;++n){let i=e[n];l(i.geometry)?UX(i.geometry,n):l(i.westHemisphereGeometry)&&l(i.eastHemisphereGeometry)&&(UX(i.westHemisphereGeometry,n),UX(i.eastHemisphereGeometry,n))}}function qHe(e){let t=e.instances,n=e.projection,i=e.elementIndexUintSupported,r=e.scene3DOnly,o=e.vertexCacheOptimize,s=e.compressVertices,a=e.modelMatrix,c,u,f,d=t.length;for(c=0;c<d;++c)if(l(t[c].geometry)){f=t[c].geometry.primitiveType;break}if(GHe(t,a,r),!r)for(c=0;c<d;++c)l(t[c].geometry)&&Wn.splitLongitude(t[c]);if(WHe(t),o)for(c=0;c<d;++c){let g=t[c];l(g.geometry)?(Wn.reorderForPostVertexCache(g.geometry),Wn.reorderForPreVertexCache(g.geometry)):l(g.westHemisphereGeometry)&&l(g.eastHemisphereGeometry)&&(Wn.reorderForPostVertexCache(g.westHemisphereGeometry),Wn.reorderForPreVertexCache(g.westHemisphereGeometry),Wn.reorderForPostVertexCache(g.eastHemisphereGeometry),Wn.reorderForPreVertexCache(g.eastHemisphereGeometry))}let p=Wn.combineInstances(t);for(d=p.length,c=0;c<d;++c){u=p[c];let g=u.attributes;if(r)for(let m in g)g.hasOwnProperty(m)&&g[m].componentDatatype===Y.DOUBLE&&Wn.encodeAttribute(u,m,`${m}3DHigh`,`${m}3DLow`);else for(let m in g)if(g.hasOwnProperty(m)&&g[m].componentDatatype===Y.DOUBLE){let y=`${m}3D`,A=`${m}2D`;Wn.projectTo2D(u,m,y,A,n),l(u.boundingSphere)&&m==="position"&&(u.boundingSphereCV=ue.fromVertices(u.attributes.position2D.values)),Wn.encodeAttribute(u,y,`${y}High`,`${y}Low`),Wn.encodeAttribute(u,A,`${A}High`,`${A}Low`)}s&&Wn.compressVertices(u)}if(!i){let g=[];for(d=p.length,c=0;c<d;++c)u=p[c],g=g.concat(Wn.fitToUnsignedShortIndices(u));p=g}return p}function zX(e,t,n,i){let r,o,s,a=i.length-1;if(a>=0){let u=i[a];r=u.offset+u.count,s=u.index,o=n[s].indices.length}else r=0,s=0,o=n[s].indices.length;let c=e.length;for(let u=0;u<c;++u){let d=e[u][t];if(!l(d))continue;let p=d.indices.length;r+p>o&&(r=0,o=n[++s].indices.length),i.push({index:s,offset:r,count:p}),r+=p}}function YHe(e,t){let n=[];return zX(e,"geometry",t,n),zX(e,"westHemisphereGeometry",t,n),zX(e,"eastHemisphereGeometry",t,n),n}var G0={};G0.combineGeometry=function(e){let t,n,i=e.instances,r=i.length,o,s,a=!1;r>0&&(t=qHe(e),t.length>0&&(n=Wn.createAttributeLocations(t[0]),e.createPickOffsets&&(o=YHe(i,t))),l(i[0].attributes)&&l(i[0].attributes.offset)&&(s=new Array(r),a=!0));let c=new Array(r),u=new Array(r);for(let f=0;f<r;++f){let d=i[f],p=d.geometry;l(p)&&(c[f]=p.boundingSphere,u[f]=p.boundingSphereCV,a&&(s[f]=d.geometry.offsetAttribute));let g=d.eastHemisphereGeometry,m=d.westHemisphereGeometry;l(g)&&l(m)&&(l(g.boundingSphere)&&l(m.boundingSphere)&&(c[f]=ue.union(g.boundingSphere,m.boundingSphere)),l(g.boundingSphereCV)&&l(m.boundingSphereCV)&&(u[f]=ue.union(g.boundingSphereCV,m.boundingSphereCV)))}return{geometries:t,modelMatrix:e.modelMatrix,attributeLocations:n,pickOffsets:o,offsetInstanceExtend:s,boundingSpheres:c,boundingSpheresCV:u}};function XHe(e,t){let n=e.attributes;for(let i in n)if(n.hasOwnProperty(i)){let r=n[i];l(r)&&l(r.values)&&t.push(r.values.buffer)}l(e.indices)&&t.push(e.indices.buffer)}function KHe(e,t){let n=e.length;for(let i=0;i<n;++i)XHe(e[i],t)}function $He(e){let t=1,n=e.length;for(let i=0;i<n;i++){let r=e[i];if(++t,!l(r))continue;let o=r.attributes;t+=7+2*ue.packedLength+(l(r.indices)?r.indices.length:0);for(let s in o)if(o.hasOwnProperty(s)&&l(o[s])){let a=o[s];t+=5+a.values.length}}return t}G0.packCreateGeometryResults=function(e,t){let n=new Float64Array($He(e)),i=[],r={},o=e.length,s=0;n[s++]=o;for(let a=0;a<o;a++){let c=e[a],u=l(c);if(n[s++]=u?1:0,!u)continue;n[s++]=c.primitiveType,n[s++]=c.geometryType,n[s++]=c.offsetAttribute??-1;let f=l(c.boundingSphere)?1:0;n[s++]=f,f&&ue.pack(c.boundingSphere,n,s),s+=ue.packedLength;let d=l(c.boundingSphereCV)?1:0;n[s++]=d,d&&ue.pack(c.boundingSphereCV,n,s),s+=ue.packedLength;let p=c.attributes,g=[];for(let y in p)p.hasOwnProperty(y)&&l(p[y])&&(g.push(y),l(r[y])||(r[y]=i.length,i.push(y)));n[s++]=g.length;for(let y=0;y<g.length;y++){let A=g[y],b=p[A];n[s++]=r[A],n[s++]=b.componentDatatype,n[s++]=b.componentsPerAttribute,n[s++]=b.normalize?1:0,n[s++]=b.values.length,n.set(b.values,s),s+=b.values.length}let m=l(c.indices)?c.indices.length:0;n[s++]=m,m>0&&(n.set(c.indices,s),s+=m)}return t.push(n.buffer),{stringTable:i,packedData:n}};G0.unpackCreateGeometryResults=function(e){let t=e.stringTable,n=e.packedData,i,r=new Array(n[0]),o=0,s=1;for(;s<n.length;){if(!(n[s++]===1)){r[o++]=void 0;continue}let c=n[s++],u=n[s++],f=n[s++];f===-1&&(f=void 0);let d,p;n[s++]===1&&(d=ue.unpack(n,s)),s+=ue.packedLength,n[s++]===1&&(p=ue.unpack(n,s)),s+=ue.packedLength;let y,A,b,x=new En,T=n[s++];for(i=0;i<T;i++){let v=t[n[s++]],S=n[s++];b=n[s++];let I=n[s++]!==0;y=n[s++],A=Y.createTypedArray(S,y);for(let R=0;R<y;R++)A[R]=n[s++];x[v]=new Ne({componentDatatype:S,componentsPerAttribute:b,normalize:I,values:A})}let E;if(y=n[s++],y>0){let v=A.length/b;for(E=je.createTypedArray(v,y),i=0;i<y;i++)E[i]=n[s++]}r[o++]=new wt({primitiveType:c,geometryType:u,boundingSphere:d,boundingSphereCV:p,indices:E,attributes:x,offsetAttribute:f})}return r};function JHe(e,t){let n=e.length,i=new Float64Array(1+n*19),r=0;i[r++]=n;for(let o=0;o<n;o++){let s=e[o];if(M.pack(s.modelMatrix,i,r),r+=M.packedLength,l(s.attributes)&&l(s.attributes.offset)){let a=s.attributes.offset.value;i[r]=a[0],i[r+1]=a[1],i[r+2]=a[2]}r+=3}return t.push(i.buffer),i}function ZHe(e){let t=e,n=new Array(t[0]),i=0,r=1;for(;r<t.length;){let o=M.unpack(t,r),s;r+=M.packedLength,l(t[r])&&(s={offset:new Er(t[r],t[r+1],t[r+2])}),r+=3,n[i++]={modelMatrix:o,attributes:s}}return n}G0.packCombineGeometryParameters=function(e,t){let n=e.createGeometryResults,i=n.length;for(let r=0;r<i;r++)t.push(n[r].packedData.buffer);return{createGeometryResults:e.createGeometryResults,packedInstances:JHe(e.instances,t),ellipsoid:e.ellipsoid,isGeographic:e.projection instanceof ji,elementIndexUintSupported:e.elementIndexUintSupported,scene3DOnly:e.scene3DOnly,vertexCacheOptimize:e.vertexCacheOptimize,compressVertices:e.compressVertices,modelMatrix:e.modelMatrix,createPickOffsets:e.createPickOffsets}};G0.unpackCombineGeometryParameters=function(e){let t=ZHe(e.packedInstances),n=e.createGeometryResults,i=n.length,r=0;for(let a=0;a<i;a++){let c=G0.unpackCreateGeometryResults(n[a]),u=c.length;for(let f=0;f<u;f++){let d=c[f],p=t[r];p.geometry=d,++r}}let o=ee.clone(e.ellipsoid),s=e.isGeographic?new ji(o):new Ti(o);return{instances:t,ellipsoid:o,projection:s,elementIndexUintSupported:e.elementIndexUintSupported,scene3DOnly:e.scene3DOnly,vertexCacheOptimize:e.vertexCacheOptimize,compressVertices:e.compressVertices,modelMatrix:M.clone(e.modelMatrix),createPickOffsets:e.createPickOffsets}};function yde(e){let t=e.length,n=1+(ue.packedLength+1)*t,i=new Float32Array(n),r=0;i[r++]=t;for(let o=0;o<t;++o){let s=e[o];l(s)?(i[r++]=1,ue.pack(e[o],i,r)):i[r++]=0,r+=ue.packedLength}return i}function Ade(e){let t=new Array(e[0]),n=0,i=1;for(;i<e.length;)e[i++]===1&&(t[n]=ue.unpack(e,i)),++n,i+=ue.packedLength;return t}G0.packCombineGeometryResults=function(e,t){l(e.geometries)&&KHe(e.geometries,t);let n=yde(e.boundingSpheres),i=yde(e.boundingSpheresCV);return t.push(n.buffer,i.buffer),{geometries:e.geometries,attributeLocations:e.attributeLocations,modelMatrix:e.modelMatrix,pickOffsets:e.pickOffsets,offsetInstanceExtend:e.offsetInstanceExtend,boundingSpheres:n,boundingSpheresCV:i}};G0.unpackCombineGeometryResults=function(e){return{geometries:e.geometries,attributeLocations:e.attributeLocations,modelMatrix:e.modelMatrix,pickOffsets:e.pickOffsets,offsetInstanceExtend:e.offsetInstanceExtend,boundingSpheres:Ade(e.boundingSpheres),boundingSpheresCV:Ade(e.boundingSpheresCV)}};var tC=G0;var bde={READY:0,CREATING:1,CREATED:2,COMBINING:3,COMBINED:4,COMPLETE:5,FAILED:6};Object.freeze(bde);var us=bde;var hu={DISABLED:0,ENABLED:1,CAST_ONLY:2,RECEIVE_ONLY:3};hu.NUMBER_OF_SHADOW_MODES=4;hu.castShadows=function(e){return e===hu.ENABLED||e===hu.CAST_ONLY};hu.receiveShadows=function(e){return e===hu.ENABLED||e===hu.RECEIVE_ONLY};hu.fromCastReceive=function(e,t){return e&&t?hu.ENABLED:e?hu.CAST_ONLY:t?hu.RECEIVE_ONLY:hu.DISABLED};Object.freeze(hu);var Pn=hu;function qo(e){e=e??H.EMPTY_OBJECT,this.geometryInstances=e.geometryInstances,this.appearance=e.appearance,this._appearance=void 0,this._material=void 0,this.depthFailAppearance=e.depthFailAppearance,this._depthFailAppearance=void 0,this._depthFailMaterial=void 0,this.modelMatrix=M.clone(e.modelMatrix??M.IDENTITY),this._modelMatrix=new M,this.show=e.show??!0,this._vertexCacheOptimize=e.vertexCacheOptimize??!1,this._interleave=e.interleave??!1,this._releaseGeometryInstances=e.releaseGeometryInstances??!0,this._allowPicking=e.allowPicking??!0,this._asynchronous=e.asynchronous??!0,this._compressVertices=e.compressVertices??!0,this.cull=e.cull??!0,this.debugShowBoundingVolume=e.debugShowBoundingVolume??!1,this.rtcCenter=e.rtcCenter,this.shadows=e.shadows??Pn.DISABLED,this._translucent=void 0,this._state=us.READY,this._geometries=[],this._error=void 0,this._numberOfInstances=0,this._boundingSpheres=[],this._boundingSphereWC=[],this._boundingSphereCV=[],this._boundingSphere2D=[],this._boundingSphereMorph=[],this._perInstanceAttributeCache=new Map,this._instanceIds=[],this._lastPerInstanceAttributeIndex=0,this._va=[],this._attributeLocations=void 0,this._primitiveType=void 0,this._frontFaceRS=void 0,this._backFaceRS=void 0,this._sp=void 0,this._depthFailAppearance=void 0,this._spDepthFail=void 0,this._frontFaceDepthFailRS=void 0,this._backFaceDepthFailRS=void 0,this._pickIds=[],this._colorCommands=[],this._pickCommands=[],this._createBoundingVolumeFunction=e._createBoundingVolumeFunction,this._createRenderStatesFunction=e._createRenderStatesFunction,this._createShaderProgramFunction=e._createShaderProgramFunction,this._createCommandsFunction=e._createCommandsFunction,this._updateAndQueueCommandsFunction=e._updateAndQueueCommandsFunction,this._createPickOffsets=e._createPickOffsets,this._pickOffsets=void 0,this._createGeometryResults=void 0,this._ready=!1,this._batchTable=void 0,this._batchTableAttributeIndices=void 0,this._offsetInstanceExtend=void 0,this._batchTableOffsetAttribute2DIndex=void 0,this._batchTableOffsetsUpdated=!1,this._instanceBoundingSpheres=void 0,this._instanceBoundingSpheresCV=void 0,this._tempBoundingSpheres=void 0,this._recomputeBoundingSpheres=!1,this._batchTableBoundingSpheresUpdated=!1,this._batchTableBoundingSphereAttributeIndices=void 0}Object.defineProperties(qo.prototype,{vertexCacheOptimize:{get:function(){return this._vertexCacheOptimize}},interleave:{get:function(){return this._interleave}},releaseGeometryInstances:{get:function(){return this._releaseGeometryInstances}},allowPicking:{get:function(){return this._allowPicking}},asynchronous:{get:function(){return this._asynchronous}},compressVertices:{get:function(){return this._compressVertices}},ready:{get:function(){return this._ready}}});function QHe(e){let t=e.length,n=[],i=e[0].attributes,r;for(r in i)if(i.hasOwnProperty(r)&&l(i[r])){let o=i[r],s=!0;for(let a=1;a<t;++a){let c=e[a].attributes[r];if(!l(c)||o.componentDatatype!==c.componentDatatype||o.componentsPerAttribute!==c.componentsPerAttribute||o.normalize!==c.normalize){s=!1;break}}s&&n.push(r)}return n}var eGe=new U,tGe=new h,Pde=new se;function Dde(e){let t=e.length;if(t===1)return e[0];if(t===2)return U.unpack(e,0,eGe);if(t===3)return h.unpack(e,0,tGe);if(t===4)return se.unpack(e,0,Pde)}function nGe(e,t){let n=e.geometryInstances,i=Array.isArray(n)?n:[n],r=i.length;if(r===0)return;let o=QHe(i),s=o.length,a=[],c={},u={},f,p=i[0].attributes,g,m,y;for(g=0;g<s;++g)m=o[g],y=p[m],c[m]=g,a.push({functionName:`czm_batchTable_${m}`,componentDatatype:y.componentDatatype,componentsPerAttribute:y.componentsPerAttribute,normalize:y.normalize});o.indexOf("distanceDisplayCondition")!==-1&&(a.push({functionName:"czm_batchTable_boundingSphereCenter3DHigh",componentDatatype:Y.FLOAT,componentsPerAttribute:3},{functionName:"czm_batchTable_boundingSphereCenter3DLow",componentDatatype:Y.FLOAT,componentsPerAttribute:3},{functionName:"czm_batchTable_boundingSphereCenter2DHigh",componentDatatype:Y.FLOAT,componentsPerAttribute:3},{functionName:"czm_batchTable_boundingSphereCenter2DLow",componentDatatype:Y.FLOAT,componentsPerAttribute:3},{functionName:"czm_batchTable_boundingSphereRadius",componentDatatype:Y.FLOAT,componentsPerAttribute:1}),u.center3DHigh=a.length-5,u.center3DLow=a.length-4,u.center2DHigh=a.length-3,u.center2DLow=a.length-2,u.radius=a.length-1),o.indexOf("offset")!==-1&&(a.push({functionName:"czm_batchTable_offset2D",componentDatatype:Y.FLOAT,componentsPerAttribute:3}),f=a.length-1),a.push({functionName:"czm_batchTable_pickColor",componentDatatype:Y.UNSIGNED_BYTE,componentsPerAttribute:4,normalize:!0});let A=a.length,b=new eC(t,a,r);for(g=0;g<r;++g){let x=i[g];p=x.attributes;for(let I=0;I<s;++I){m=o[I],y=p[m];let R=Dde(y.value),O=c[m];b.setBatchedAttribute(g,O,R)}let T={primitive:x.pickPrimitive??e};l(x.id)&&(T.id=x.id);let E=t.createPickId(T);e._pickIds.push(E);let v=E.color,S=Pde;S.x=z.floatToByte(v.red),S.y=z.floatToByte(v.green),S.z=z.floatToByte(v.blue),S.w=z.floatToByte(v.alpha),b.setBatchedAttribute(g,A-1,S)}e._batchTable=b,e._batchTableAttributeIndices=c,e._batchTableBoundingSphereAttributeIndices=u,e._batchTableOffsetAttribute2DIndex=f}function iGe(e){let t;return Array.isArray(e.values)?t=e.values.slice(0):t=new e.values.constructor(e.values),new Ne({componentDatatype:e.componentDatatype,componentsPerAttribute:e.componentsPerAttribute,normalize:e.normalize,values:t})}function rGe(e){let t=e.attributes,n=new En;for(let r in t)t.hasOwnProperty(r)&&l(t[r])&&(n[r]=iGe(t[r]));let i;if(l(e.indices)){let r=e.indices;Array.isArray(r)?i=r.slice(0):i=new r.constructor(r)}return new wt({attributes:n,indices:i,primitiveType:e.primitiveType,boundingSphere:ue.clone(e.boundingSphere)})}function oGe(e,t){return{geometry:t,attributes:e.attributes,modelMatrix:M.clone(e.modelMatrix),pickPrimitive:e.pickPrimitive,id:e.id}}var sGe=/in\s+vec(?:3|4)\s+(.*)3DHigh;/g;qo._modifyShaderPosition=function(e,t,n){let i,r="",o="",s="";for(;(i=sGe.exec(t))!==null;){let a=i[1],c=`vec4 czm_compute${a[0].toUpperCase()}${a.substr(1)}()`;c!=="vec4 czm_computePosition()"&&(r+=`${c}; `),l(e.rtcCenter)?(t=t.replace(/in\s+vec(?:3|4)\s+position3DHigh;/g,""),t=t.replace(/in\s+vec(?:3|4)\s+position3DLow;/g,""),r+=`uniform mat4 u_modifiedModelView; `,o+=`in vec4 position; `,s+=`${c} @@ -6825,13 +6720,13 @@ void main() { czm_non_show_main(); gl_Position *= czm_batchTable_show(batchId); -}`:t};qo._updateColorAttribute=function(e,t,n){if(!l(e._batchTableAttributeIndices.color)&&!l(e._batchTableAttributeIndices.depthFailColor)||t.search(/in\s+vec4\s+color;/g)===-1)return t;let i=t;return i=i.replace(/in\s+vec4\s+color;/g,""),n?i=i.replace(/(\b)color(\b)/g,"$1czm_batchTable_depthFailColor(batchId)$2"):i=i.replace(/(\b)color(\b)/g,"$1czm_batchTable_color(batchId)$2"),i};function ode(e){return`${Xe.replaceMain(e,"czm_non_pick_main")} +}`:t};qo._updateColorAttribute=function(e,t,n){if(!l(e._batchTableAttributeIndices.color)&&!l(e._batchTableAttributeIndices.depthFailColor)||t.search(/in\s+vec4\s+color;/g)===-1)return t;let i=t;return i=i.replace(/in\s+vec4\s+color;/g,""),n?i=i.replace(/(\b)color(\b)/g,"$1czm_batchTable_depthFailColor(batchId)$2"):i=i.replace(/(\b)color(\b)/g,"$1czm_batchTable_color(batchId)$2"),i};function xde(e){return`${Xe.replaceMain(e,"czm_non_pick_main")} out vec4 v_pickColor; void main() { czm_non_pick_main(); v_pickColor = czm_batchTable_pickColor(batchId); -}`}function sde(e){return`in vec4 v_pickColor; +}`}function Tde(e){return`in vec4 v_pickColor; ${e}`}qo._updatePickColorAttribute=function(e){let t=e.replace(/in\s+vec4\s+pickColor;/g,"");return t=t.replace(/(\b)pickColor(\b)/g,"$1czm_batchTable_pickColor(batchId)$2"),t};qo._appendOffsetToShader=function(e,t){if(!l(e._batchTableAttributeIndices.offset))return t;let n=`in float batchId; `;n+="in float applyOffset;";let i=t.replace(/in\s+float\s+batchId;/g,n),r=`vec4 $1 = czm_computePosition(); `;return r+=` if (czm_sceneMode == czm_sceneMode3D) @@ -6882,7 +6777,7 @@ ${e}`}qo._updatePickColorAttribute=function(e){let t=e.replace(/in\s+vec4\s+pick float show = (distanceSq >= nearSq && distanceSq <= farSq) ? 1.0 : 0.0; gl_Position *= show; }`,`${i} -${r}`};function ade(e,t){if(!e.compressVertices)return t;let n=t.search(/in\s+vec3\s+normal;/g)!==-1,i=t.search(/in\s+vec2\s+st;/g)!==-1;if(!n&&!i)return t;let r=t.search(/in\s+vec3\s+tangent;/g)!==-1,o=t.search(/in\s+vec3\s+bitangent;/g)!==-1,s=i&&n?2:1;s+=r||o?1:0;let a=s>1?`vec${s}`:"float",c="compressedAttributes",u=`in ${a} ${c};`,f="",d="";if(i){f+=`vec2 st; +${r}`};function Ede(e,t){if(!e.compressVertices)return t;let n=t.search(/in\s+vec3\s+normal;/g)!==-1,i=t.search(/in\s+vec2\s+st;/g)!==-1;if(!n&&!i)return t;let r=t.search(/in\s+vec3\s+tangent;/g)!==-1,o=t.search(/in\s+vec3\s+bitangent;/g)!==-1,s=i&&n?2:1;s+=r||o?1:0;let a=s>1?`vec${s}`:"float",c="compressedAttributes",u=`in ${a} ${c};`,f="",d="";if(i){f+=`vec2 st; `;let m=s>1?`${c}.x`:c;d+=` st = czm_decompressTextureCoordinates(${m}); `}n&&r&&o?(f+=`vec3 normal; vec3 tangent; @@ -6898,10 +6793,10 @@ vec3 bitangent; { ${d} czm_non_compressed_main(); }`;return[u,f,p,g].join(` -`)}function CGe(e){let t=Xe.replaceMain(e,"czm_non_depth_clamp_main");return t+=`void main() { +`)}function aGe(e){let t=Xe.replaceMain(e,"czm_non_depth_clamp_main");return t+=`void main() { czm_non_depth_clamp_main(); gl_Position = czm_depthClamp(gl_Position);} -`,t}function vGe(e){let t=Xe.replaceMain(e,"czm_non_depth_clamp_main");return t+=`void main() { +`,t}function cGe(e){let t=Xe.replaceMain(e,"czm_non_depth_clamp_main");return t+=`void main() { czm_non_depth_clamp_main(); #if defined(LOG_DEPTH) czm_writeLogDepth(); @@ -6909,223 +6804,198 @@ ${d} czm_non_compressed_main(); czm_writeDepthClamp(); #endif } -`,t}function cde(e,t){let n=e.vertexAttributes}function SGe(e,t){return function(){return e[t]}}var PX=Math.max(dn.hardwareConcurrency-1,1),zk,wGe=new $n("combineGeometry");function IGe(e,t){let n,i,r,o,s=e._instanceIds;if(e._state===fs.READY){n=Array.isArray(e.geometryInstances)?e.geometryInstances:[e.geometryInstances];let a=e._numberOfInstances=n.length,c=[],u=[];for(r=0;r<a;++r)i=n[r].geometry,s.push(n[r].id),u.push({moduleName:i._workerName,modulePath:i._workerPath,geometry:i});if(!l(zk))for(zk=new Array(PX),r=0;r<PX;r++)zk[r]=new $n("createGeometry");let f;for(u=Uk(u,PX),r=0;r<u.length;r++){let d=0,p=u[r],g=p.length;for(o=0;o<g;++o)f=p[o],i=f.geometry,l(i.constructor.pack)&&(f.offset=d,d+=i.constructor.packedLength??i.packedLength);let m;if(d>0){let y=new Float64Array(d);for(m=[y.buffer],o=0;o<g;++o)f=p[o],i=f.geometry,l(i.constructor.pack)&&(i.constructor.pack(i,y,f.offset),f.geometry=y)}c.push(zk[r].scheduleTask({subTasks:u[r]},m))}e._state=fs.CREATING,Promise.all(c).then(function(d){e._createGeometryResults=d,e._state=fs.CREATED}).catch(function(d){SP(e,t,fs.FAILED,d)})}else if(e._state===fs.CREATED){let a=[];n=Array.isArray(e.geometryInstances)?e.geometryInstances:[e.geometryInstances];let c=t.scene3DOnly,u=t.mapProjection,f=wGe.scheduleTask(nC.packCombineGeometryParameters({createGeometryResults:e._createGeometryResults,instances:n,ellipsoid:u.ellipsoid,projection:u,elementIndexUintSupported:t.context.elementIndexUint,scene3DOnly:c,vertexCacheOptimize:e.vertexCacheOptimize,compressVertices:e.compressVertices,modelMatrix:e.modelMatrix,createPickOffsets:e._createPickOffsets},a),a);e._createGeometryResults=void 0,e._state=fs.COMBINING,Promise.resolve(f).then(function(d){let p=nC.unpackCombineGeometryResults(d);e._geometries=p.geometries,e._attributeLocations=p.attributeLocations,e.modelMatrix=M.clone(p.modelMatrix,e.modelMatrix),e._pickOffsets=p.pickOffsets,e._offsetInstanceExtend=p.offsetInstanceExtend,e._instanceBoundingSpheres=p.boundingSpheres,e._instanceBoundingSpheresCV=p.boundingSpheresCV,l(e._geometries)&&e._geometries.length>0?(e._recomputeBoundingSpheres=!0,e._state=fs.COMBINED):SP(e,t,fs.FAILED,void 0)}).catch(function(d){SP(e,t,fs.FAILED,d)})}}function PGe(e,t){let n=Array.isArray(e.geometryInstances)?e.geometryInstances:[e.geometryInstances],i=e._numberOfInstances=n.length,r=new Array(i),o=e._instanceIds,s,a,c=0;for(a=0;a<i;a++){s=n[a];let p=s.geometry,g;l(p.attributes)&&l(p.primitiveType)?g=xGe(p):g=p.constructor.createGeometry(p),r[c++]=TGe(s,g),o.push(s.id)}r.length=c;let u=t.scene3DOnly,f=t.mapProjection,d=nC.combineGeometry({instances:r,ellipsoid:f.ellipsoid,projection:f,elementIndexUintSupported:t.context.elementIndexUint,scene3DOnly:u,vertexCacheOptimize:e.vertexCacheOptimize,compressVertices:e.compressVertices,modelMatrix:e.modelMatrix,createPickOffsets:e._createPickOffsets});e._geometries=d.geometries,e._attributeLocations=d.attributeLocations,e.modelMatrix=M.clone(d.modelMatrix,e.modelMatrix),e._pickOffsets=d.pickOffsets,e._offsetInstanceExtend=d.offsetInstanceExtend,e._instanceBoundingSpheres=d.boundingSpheres,e._instanceBoundingSpheresCV=d.boundingSpheresCV,l(e._geometries)&&e._geometries.length>0?(e._recomputeBoundingSpheres=!0,e._state=fs.COMBINED):SP(e,t,fs.FAILED,void 0)}function DGe(e,t){let n=e._batchTableAttributeIndices.offset;if(!e._recomputeBoundingSpheres||!l(n)){e._recomputeBoundingSpheres=!1;return}let i,r=e._offsetInstanceExtend,o=e._instanceBoundingSpheres,s=o.length,a=e._tempBoundingSpheres;if(!l(a)){for(a=new Array(s),i=0;i<s;i++)a[i]=new ue;e._tempBoundingSpheres=a}for(i=0;i<s;++i){let y=a[i],A=e._batchTable.getBatchedAttribute(i,n,new h);y=o[i].clone(y),yde(y,A,r[i])}let c=[],u=[],f=[];for(i=0;i<s;++i){let y=a[i];y.center.x-y.radius>0||ue.intersectPlane(y,sn.ORIGIN_ZX_PLANE)!==$t.INTERSECTING?c.push(y):(u.push(y),f.push(y))}let d=c[0],p=f[0],g=u[0];for(i=1;i<c.length;i++)d=ue.union(d,c[i]);for(i=1;i<f.length;i++)p=ue.union(p,f[i]);for(i=1;i<u.length;i++)g=ue.union(g,u[i]);let m=[];for(l(d)&&m.push(d),l(p)&&m.push(p),l(g)&&m.push(g),i=0;i<m.length;i++){let y=m[i].clone(e._boundingSpheres[i]);e._boundingSpheres[i]=y,e._boundingSphereCV[i]=ue.projectTo2D(y,t.mapProjection,e._boundingSphereCV[i])}qo._updateBoundingVolumes(e,t,e.modelMatrix,!0),e._recomputeBoundingSpheres=!1}var lde=new Sn,pde=new he,gde=new h,_de=new ue;function RGe(e,t){if(!l(e._batchTableAttributeIndices.distanceDisplayCondition)||e._batchTableBoundingSpheresUpdated)return;let i=e._batchTableBoundingSphereAttributeIndices,r=i.center3DHigh,o=i.center3DLow,s=i.center2DHigh,a=i.center2DLow,c=i.radius,u=t.mapProjection,f=u.ellipsoid,d=e._batchTable,p=e._instanceBoundingSpheres,g=p.length;for(let m=0;m<g;++m){let y=p[m];if(!l(y))continue;let A=e.modelMatrix;l(A)&&(y=ue.transform(y,A,_de));let b=y.center,x=y.radius,T=Sn.fromCartesian(b,lde);if(d.setBatchedAttribute(m,r,T.high),d.setBatchedAttribute(m,o,T.low),!t.scene3DOnly){let E=f.cartesianToCartographic(b,pde),v=u.project(E,gde);T=Sn.fromCartesian(v,lde),d.setBatchedAttribute(m,s,T.high),d.setBatchedAttribute(m,a,T.low)}d.setBatchedAttribute(m,c,x)}e._batchTableBoundingSpheresUpdated=!0}var DX=new h,OGe=new h;function ude(e,t){if(!l(e._batchTableAttributeIndices.offset)||e._batchTableOffsetsUpdated||t.scene3DOnly)return;let i=e._batchTableOffsetAttribute2DIndex,r=t.mapProjection,o=r.ellipsoid,s=e._batchTable,a=e._instanceBoundingSpheres,c=a.length;for(let u=0;u<c;++u){let f=a[u];if(!l(f))continue;let d=s.getBatchedAttribute(u,e._batchTableAttributeIndices.offset);if(h.equals(d,h.ZERO)){s.setBatchedAttribute(u,i,h.ZERO);continue}let p=e.modelMatrix;l(p)&&(f=ue.transform(f,p,_de));let g=f.center;g=o.scaleToGeodeticSurface(g,OGe);let m=o.cartesianToCartographic(g,pde),y=r.project(m,gde),A=h.add(d,g,DX);m=o.cartesianToCartographic(A,m);let b=r.project(m,DX),x=h.subtract(b,y,DX),T=x.x;x.x=x.z,x.z=x.y,x.y=T,s.setBatchedAttribute(u,i,x)}e._batchTableOffsetsUpdated=!0}function MGe(e,t){let n=e._attributeLocations,i=e._geometries,r=t.scene3DOnly,o=t.context,s=[],a=i.length;for(let c=0;c<a;++c){let u=i[c];if(s.push(Vn.fromGeometry({context:o,geometry:u,attributeLocations:n,bufferUsage:Me.STATIC_DRAW,interleave:e._interleave})),l(e._createBoundingVolumeFunction))e._createBoundingVolumeFunction(t,u);else if(e._boundingSpheres.push(ue.clone(u.boundingSphere)),e._boundingSphereWC.push(new ue),!r){let f=u.boundingSphereCV.center,d=f.x,p=f.y,g=f.z;f.x=g,f.y=d,f.z=p,e._boundingSphereCV.push(ue.clone(u.boundingSphereCV)),e._boundingSphere2D.push(new ue),e._boundingSphereMorph.push(new ue)}}e._va=s,e._primitiveType=i[0].primitiveType,e.releaseGeometryInstances&&(e.geometryInstances=void 0),e._geometries=void 0,SP(e,t,fs.COMPLETE,void 0)}function NGe(e,t,n,i){let r=n.getRenderState(),o;i?(o=Ze(r,!1),o.cull={enabled:!0,face:Gi.BACK},e._frontFaceRS=Ge.fromCache(o),o.cull.face=Gi.FRONT,e._backFaceRS=Ge.fromCache(o)):(e._frontFaceRS=Ge.fromCache(r),e._backFaceRS=e._frontFaceRS),o=Ze(r,!1),l(e._depthFailAppearance)&&(o.depthTest.enabled=!1),l(e._depthFailAppearance)&&(r=e._depthFailAppearance.getRenderState(),o=Ze(r,!1),o.depthTest.func=yc.GREATER,i?(o.cull={enabled:!0,face:Gi.BACK},e._frontFaceDepthFailRS=Ge.fromCache(o),o.cull.face=Gi.FRONT,e._backFaceDepthFailRS=Ge.fromCache(o)):(e._frontFaceDepthFailRS=Ge.fromCache(o),e._backFaceDepthFailRS=e._frontFaceRS))}function LGe(e,t,n){let i=t.context,r=e._attributeLocations,o=e._batchTable.getVertexShaderCallback()(n.vertexShaderSource);o=qo._appendOffsetToShader(e,o),o=qo._appendShowToShader(e,o),o=qo._appendDistanceDisplayConditionToShader(e,o,t.scene3DOnly),o=ode(o),o=qo._updateColorAttribute(e,o,!1),o=ade(e,o),o=qo._modifyShaderPosition(e,o,t.scene3DOnly);let s=n.getFragmentShaderSource();s=sde(s),e._sp=Qt.replaceCache({context:i,shaderProgram:e._sp,vertexShaderSource:o,fragmentShaderSource:s,attributeLocations:r}),cde(e._sp,r),l(e._depthFailAppearance)&&(o=e._batchTable.getVertexShaderCallback()(e._depthFailAppearance.vertexShaderSource),o=qo._appendShowToShader(e,o),o=qo._appendDistanceDisplayConditionToShader(e,o,t.scene3DOnly),o=ode(o),o=qo._updateColorAttribute(e,o,!0),o=ade(e,o),o=qo._modifyShaderPosition(e,o,t.scene3DOnly),o=CGe(o),s=e._depthFailAppearance.getFragmentShaderSource(),s=sde(s),s=vGe(s),e._spDepthFail=Qt.replaceCache({context:i,shaderProgram:e._spDepthFail,vertexShaderSource:o,fragmentShaderSource:s,attributeLocations:r}),cde(e._spDepthFail,r))}var vP=new M,fde=new h;function dde(e,t,n,i){let r=l(n)?n._uniforms:void 0,o={},s=t.uniforms;if(l(s))for(let c in s)s.hasOwnProperty(c)&&(o[c]=SGe(s,c));let a=Mt(o,r);return a=e._batchTable.getUniformMapCallback()(a),l(e.rtcCenter)&&(a.u_modifiedModelView=function(){let c=i.context.uniformState.view;return M.multiply(c,e._modelMatrix,vP),M.multiplyByPoint(vP,e.rtcCenter,fde),M.setTranslation(vP,fde,vP),vP}),a}function FGe(e,t,n,i,r,o,s,a){let c=dde(e,t,n,a),u;l(e._depthFailAppearance)&&(u=dde(e,e._depthFailAppearance,e._depthFailAppearance.material,a));let f=i?Ie.TRANSLUCENT:Ie.OPAQUE,d=r?2:1;d*=l(e._depthFailAppearance)?2:1,o.length=e._va.length*d;let p=o.length,g=0;for(let m=0;m<p;++m){let y;r&&(y=o[m],l(y)||(y=o[m]=new at({owner:e,primitiveType:e._primitiveType})),y.vertexArray=e._va[g],y.renderState=e._backFaceRS,y.shaderProgram=e._sp,y.uniformMap=c,y.pass=f,++m),y=o[m],l(y)||(y=o[m]=new at({owner:e,primitiveType:e._primitiveType})),y.vertexArray=e._va[g],y.renderState=e._frontFaceRS,y.shaderProgram=e._sp,y.uniformMap=c,y.pass=f,l(e._depthFailAppearance)&&(r&&(++m,y=o[m],l(y)||(y=o[m]=new at({owner:e,primitiveType:e._primitiveType})),y.vertexArray=e._va[g],y.renderState=e._backFaceDepthFailRS,y.shaderProgram=e._spDepthFail,y.uniformMap=u,y.pass=f),++m,y=o[m],l(y)||(y=o[m]=new at({owner:e,primitiveType:e._primitiveType})),y.vertexArray=e._va[g],y.renderState=e._frontFaceDepthFailRS,y.shaderProgram=e._spDepthFail,y.uniformMap=u,y.pass=f),++g}}qo._updateBoundingVolumes=function(e,t,n,i){let r,o,s;if(i||!M.equals(n,e._modelMatrix))for(M.clone(n,e._modelMatrix),o=e._boundingSpheres.length,r=0;r<o;++r)s=e._boundingSpheres[r],l(s)&&(e._boundingSphereWC[r]=ue.transform(s,n,e._boundingSphereWC[r]),t.scene3DOnly||(e._boundingSphere2D[r]=ue.clone(e._boundingSphereCV[r],e._boundingSphere2D[r]),e._boundingSphereMorph[r]=ue.union(e._boundingSphereWC[r],e._boundingSphereCV[r])));let a=e.appearance.pixelSize;if(l(a))for(o=e._boundingSpheres.length,r=0;r<o;++r){s=e._boundingSpheres[r];let c=e._boundingSphereWC[r],f=t.camera.getPixelSize(s,t.context.drawingBufferWidth,t.context.drawingBufferHeight)*a;c.radius=s.radius+f}};function BGe(e,t,n,i,r,o,s,a){qo._updateBoundingVolumes(e,t,r);let c;t.mode===re.SCENE3D?c=e._boundingSphereWC:t.mode===re.COLUMBUS_VIEW?c=e._boundingSphereCV:t.mode===re.SCENE2D&&l(e._boundingSphere2D)?c=e._boundingSphere2D:l(e._boundingSphereMorph)&&(c=e._boundingSphereMorph);let u=t.commandList,f=t.passes;if(f.render||f.pick){let d=e.allowPicking,p=Dn.castShadows(e.shadows),g=Dn.receiveShadows(e.shadows),m=n.length,y=a?2:1;y*=l(e._depthFailAppearance)?2:1;for(let A=0;A<m;++A){let b=Math.floor(A/y),x=n[A];x.modelMatrix=r,x.boundingVolume=c[b],x.cull=o,x.debugShowBoundingVolume=s,x.castShadows=p,x.receiveShadows=g,d?x.pickId="v_pickColor":x.pickId=void 0,u.push(x)}}}qo.prototype.update=function(e){if(!l(this.geometryInstances)&&this._va.length===0||l(this.geometryInstances)&&Array.isArray(this.geometryInstances)&&this.geometryInstances.length===0||!l(this.appearance)||e.mode!==re.SCENE3D&&e.scene3DOnly||!e.passes.render&&!e.passes.pick)return;if(l(this._error))throw this._error;if(this._state===fs.FAILED)return;let t=e.context;if(l(this._batchTable)||AGe(this,t),this._batchTable.attributes.length>0){if(Ut.maximumVertexTextureImageUnits===0)throw new oe("Vertex texture fetch support is required to render primitives with per-instance attributes. The maximum number of vertex texture image units must be greater than zero.");this._batchTable.update(e)}if(this._state!==fs.COMPLETE&&this._state!==fs.COMBINED&&(this.asynchronous?IGe(this,e):PGe(this,e)),this._state===fs.COMBINED&&(RGe(this,e),ude(this,e),MGe(this,e)),!this.show||this._state!==fs.COMPLETE)return;this._batchTableOffsetsUpdated||ude(this,e),this._recomputeBoundingSpheres&&DGe(this,e);let n=this.appearance,i=n.material,r=!1,o=!1;this._appearance!==n?(this._appearance=n,this._material=i,r=!0,o=!0):this._material!==i&&(this._material=i,o=!0);let s=this.depthFailAppearance,a=l(s)?s.material:void 0;this._depthFailAppearance!==s?(this._depthFailAppearance=s,this._depthFailMaterial=a,r=!0,o=!0):this._depthFailMaterial!==a&&(this._depthFailMaterial=a,o=!0);let c=this._appearance.isTranslucent();this._translucent!==c&&(this._translucent=c,r=!0),l(this._material)&&this._material.update(t);let u=n.closed&&c;r&&(this._createRenderStatesFunction??NGe)(this,t,n,u),o&&(this._createShaderProgramFunction??LGe)(this,e,n),(r||o)&&(this._createCommandsFunction??FGe)(this,n,i,c,u,this._colorCommands,this._pickCommands,e),(this._updateAndQueueCommandsFunction??BGe)(this,e,this._colorCommands,this._pickCommands,this.modelMatrix,this.cull,this.debugShowBoundingVolume,u)};var kGe=new ue,UGe=new ue;function yde(e,t,n){if(n===pn.TOP){let i=ue.clone(e,kGe),r=ue.clone(e,UGe);r.center=h.add(r.center,t,r.center),e=ue.union(i,r,e)}else n===pn.ALL&&(e.center=h.add(e.center,t,e.center));return e}function zGe(e,t,n){return function(){let i=e.getBatchedAttribute(t,n),r=e.attributes[n],o=r.componentsPerAttribute,s=Y.createTypedArray(r.componentDatatype,o);return l(i.constructor.pack)?i.constructor.pack(i,s,0):s[0]=i,s}}function VGe(e,t,n,i,r){return function(o){let s=mde(o);e.setBatchedAttribute(t,n,s),r==="offset"&&(i._recomputeBoundingSpheres=!0,i._batchTableOffsetsUpdated=!1)}}var jGe=new h;function HGe(e,t,n){t.boundingSphere={get:function(){let i=e._instanceBoundingSpheres[n];if(l(i)){i=i.clone();let r=e.modelMatrix,o=t.offset;l(o)&&yde(i,h.fromArray(o.get(),0,jGe),e._offsetInstanceExtend[n]),l(r)&&(i=ue.transform(i,r))}return i}},t.boundingSphereCV={get:function(){return e._instanceBoundingSpheresCV[n]}}}function GGe(e,t,n){t.pickId={get:function(){return e._pickIds[n]}}}qo.prototype.getGeometryInstanceAttributes=function(e){let t=this._perInstanceAttributeCache.get(e);if(l(t))return t;let n=-1,i=this._lastPerInstanceAttributeIndex,r=this._instanceIds,o=r.length;for(let u=0;u<o;++u){let f=(i+u)%o;if(e===r[f]){n=f;break}}if(n===-1)return;let s=this._batchTable,a=this._batchTableAttributeIndices;t={};let c={};for(let u in a)if(a.hasOwnProperty(u)){let f=a[u];c[u]={get:zGe(s,n,f),set:VGe(s,n,f,this,u)}}return HGe(this,c,n),GGe(this,c,n),Object.defineProperties(t,c),this._lastPerInstanceAttributeIndex=n,this._perInstanceAttributeCache.set(e,t),t};qo.prototype.isDestroyed=function(){return!1};qo.prototype.destroy=function(){let e,t;this._sp=this._sp&&this._sp.destroy(),this._spDepthFail=this._spDepthFail&&this._spDepthFail.destroy();let n=this._va;for(e=n.length,t=0;t<e;++t)n[t].destroy();this._va=void 0;let i=this._pickIds;for(e=i.length,t=0;t<e;++t)i[t].destroy();return this._pickIds=void 0,this._batchTable=this._batchTable&&this._batchTable.destroy(),this._instanceIds=void 0,this._perInstanceAttributeCache=void 0,this._attributeLocations=void 0,le(this)};function SP(e,t,n,i){e._error=i,e._state=n,t.afterRender.push(function(){return e._ready=e._state===fs.COMPLETE||e._state===fs.FAILED,!0})}var Mn=qo;function WGe(e){e=e??H.EMPTY_OBJECT,this.componentDatatype=e.componentDatatype,this.componentsPerAttribute=e.componentsPerAttribute,this.normalize=e.normalize??!1,this.value=e.value}var Pl=WGe;function ad(e,t,n){this._projectionExtentDefines={eastMostYhighDefine:"",eastMostYlowDefine:"",westMostYhighDefine:"",westMostYlowDefine:""};let i=new RX;i.requiresTextureCoordinates=e,i.requiresEC=!n.flat;let r=new RX;if(r.requiresTextureCoordinates=e,n instanceof An)i.requiresNormalEC=!n.flat;else{let o=`${n.material.shaderSource} -${n.fragmentShaderSource}`;i.normalEC=o.indexOf("materialInput.normalEC")!==-1||o.indexOf("czm_getDefaultMaterial")!==-1,i.positionToEyeEC=o.indexOf("materialInput.positionToEyeEC")!==-1,i.tangentToEyeMatrix=o.indexOf("materialInput.tangentToEyeMatrix")!==-1,i.st=o.indexOf("materialInput.st")!==-1}this._colorShaderDependencies=i,this._pickShaderDependencies=r,this._appearance=n,this._extentsCulling=e,this._planarExtents=t}ad.prototype.createFragmentShader=function(e){let t=this._appearance,n=this._colorShaderDependencies,i=[];!e&&!this._planarExtents&&i.push("SPHERICAL"),n.requiresEC&&i.push("REQUIRES_EC"),n.requiresWC&&i.push("REQUIRES_WC"),n.requiresTextureCoordinates&&i.push("TEXTURE_COORDINATES"),this._extentsCulling&&i.push("CULL_FRAGMENTS"),n.requiresNormalEC&&i.push("NORMAL_EC"),t instanceof An&&i.push("PER_INSTANCE_COLOR"),n.normalEC&&i.push("USES_NORMAL_EC"),n.positionToEyeEC&&i.push("USES_POSITION_TO_EYE_EC"),n.tangentToEyeMatrix&&i.push("USES_TANGENT_TO_EYE"),n.st&&i.push("USES_ST"),t.flat&&i.push("FLAT");let r="";return t instanceof An||(r=t.material.shaderSource),new Xe({defines:i,sources:[r,mP]})};ad.prototype.createPickFragmentShader=function(e){let t=this._pickShaderDependencies,n=["PICK"];return!e&&!this._planarExtents&&n.push("SPHERICAL"),t.requiresEC&&n.push("REQUIRES_EC"),t.requiresWC&&n.push("REQUIRES_WC"),t.requiresTextureCoordinates&&n.push("TEXTURE_COORDINATES"),this._extentsCulling&&n.push("CULL_FRAGMENTS"),new Xe({defines:n,sources:[mP],pickColorQualifier:"in"})};ad.prototype.createVertexShader=function(e,t,n,i){return Sde(this._colorShaderDependencies,this._planarExtents,n,e,t,this._appearance,i,this._projectionExtentDefines)};ad.prototype.createPickVertexShader=function(e,t,n,i){return Sde(this._pickShaderDependencies,this._planarExtents,n,e,t,void 0,i,this._projectionExtentDefines)};var Ade=new h,bde=new he,xde={high:0,low:0};function Sde(e,t,n,i,r,o,s,a){let c=i.slice();if(a.eastMostYhighDefine===""){let u=bde;u.longitude=P.PI,u.latitude=0,u.height=0;let f=s.project(u,Ade),d=Sn.encode(f.x,xde);a.eastMostYhighDefine=`EAST_MOST_X_HIGH ${d.high.toFixed(`${d.high}`.length+1)}`,a.eastMostYlowDefine=`EAST_MOST_X_LOW ${d.low.toFixed(`${d.low}`.length+1)}`;let p=bde;p.longitude=-P.PI,p.latitude=0,p.height=0;let g=s.project(p,Ade);d=Sn.encode(g.x,xde),a.westMostYhighDefine=`WEST_MOST_X_HIGH ${d.high.toFixed(`${d.high}`.length+1)}`,a.westMostYlowDefine=`WEST_MOST_X_LOW ${d.low.toFixed(`${d.low}`.length+1)}`}return n&&(c.push(a.eastMostYhighDefine),c.push(a.eastMostYlowDefine),c.push(a.westMostYhighDefine),c.push(a.westMostYlowDefine)),l(o)&&o instanceof An&&c.push("PER_INSTANCE_COLOR"),e.requiresTextureCoordinates&&(c.push("TEXTURE_COORDINATES"),t||n||c.push("SPHERICAL"),n&&c.push("COLUMBUS_VIEW_2D")),new Xe({defines:c,sources:[r]})}function RX(){this._requiresEC=!1,this._requiresWC=!1,this._requiresNormalEC=!1,this._requiresTextureCoordinates=!1,this._usesNormalEC=!1,this._usesPositionToEyeEC=!1,this._usesTangentToEyeMat=!1,this._usesSt=!1}Object.defineProperties(RX.prototype,{requiresEC:{get:function(){return this._requiresEC},set:function(e){this._requiresEC=e||this._requiresEC}},requiresWC:{get:function(){return this._requiresWC},set:function(e){this._requiresWC=e||this._requiresWC,this.requiresEC=this._requiresWC}},requiresNormalEC:{get:function(){return this._requiresNormalEC},set:function(e){this._requiresNormalEC=e||this._requiresNormalEC,this.requiresEC=this._requiresNormalEC}},requiresTextureCoordinates:{get:function(){return this._requiresTextureCoordinates},set:function(e){this._requiresTextureCoordinates=e||this._requiresTextureCoordinates,this.requiresWC=this._requiresTextureCoordinates}},normalEC:{set:function(e){this.requiresNormalEC=e,this._usesNormalEC=e},get:function(){return this._usesNormalEC}},tangentToEyeMatrix:{set:function(e){this.requiresWC=e,this.requiresNormalEC=e,this._usesTangentToEyeMat=e},get:function(){return this._usesTangentToEyeMat}},positionToEyeEC:{set:function(e){this.requiresEC=e,this._usesPositionToEyeEC=e},get:function(){return this._usesPositionToEyeEC}},st:{set:function(e){this.requiresTextureCoordinates=e,this._usesSt=e},get:function(){return this._usesSt}}});function Tde(e,t,n){return Math.abs((t.y-e.y)*n.x-(t.x-e.x)*n.y+t.x*e.y-t.y*e.x)/U.distance(t,e)}var qGe=[new U,new U,new U,new U];function wde(e,t){let n=qGe,i=U.unpack(t,0,n[0]),r=U.unpack(t,2,n[1]),o=U.unpack(t,4,n[2]);e.uMaxVmax=new Pl({componentDatatype:Y.FLOAT,componentsPerAttribute:4,normalize:!1,value:[r.x,r.y,o.x,o.y]});let s=1/Tde(i,r,o),a=1/Tde(i,o,r);e.uvMinAndExtents=new Pl({componentDatatype:Y.FLOAT,componentsPerAttribute:4,normalize:!1,value:[i.x,i.y,s,a]})}var Ide=new he,Pde=new h,YGe=new h,XGe=new h,Vk={high:0,low:0};function Dde(e,t,n){let i=Ide;i.height=0,i.longitude=e.west,i.latitude=e.south;let r=t.project(i,Pde);i.latitude=e.north;let o=t.project(i,YGe);i.longitude=e.east,i.latitude=e.south;let s=t.project(i,XGe),a=[0,0,0,0],c=[0,0,0,0],u=Sn.encode(r.x,Vk);a[0]=u.high,c[0]=u.low,u=Sn.encode(r.y,Vk),a[1]=u.high,c[1]=u.low,u=Sn.encode(o.y,Vk),a[2]=u.high,c[2]=u.low,u=Sn.encode(s.x,Vk),a[3]=u.high,c[3]=u.low,n.planes2D_HIGH=new Pl({componentDatatype:Y.FLOAT,componentsPerAttribute:4,normalize:!1,value:a}),n.planes2D_LOW=new Pl({componentDatatype:Y.FLOAT,componentsPerAttribute:4,normalize:!1,value:c})}var KGe=new M,$Ge=new M,Ede=new h,JGe=new he,ZGe=[new he,new he,new he,new he,new he,new he,new he,new he];function QGe(e,t,n,i,r,o){let s=ie.center(e,JGe);s.height=n;let a=he.toCartesian(s,t,Ede),c=At.eastNorthUpToFixedFrame(a,t,KGe),u=M.inverse(c,$Ge),f=e.west,d=e.east,p=e.north,g=e.south,m=ZGe;m[0].latitude=g,m[0].longitude=f,m[1].latitude=p,m[1].longitude=f,m[2].latitude=p,m[2].longitude=d,m[3].latitude=g,m[3].longitude=d;let y=(f+d)*.5,A=(p+g)*.5;m[4].latitude=g,m[4].longitude=y,m[5].latitude=p,m[5].longitude=y,m[6].latitude=A,m[6].longitude=f,m[7].latitude=A,m[7].longitude=d;let b=Number.POSITIVE_INFINITY,x=Number.NEGATIVE_INFINITY,T=Number.POSITIVE_INFINITY,E=Number.NEGATIVE_INFINITY;for(let R=0;R<8;R++){m[R].height=n;let O=he.toCartesian(m[R],t,Ede);M.multiplyByPoint(u,O,O),O.z=0,b=Math.min(b,O.x),x=Math.max(x,O.x),T=Math.min(T,O.y),E=Math.max(E,O.y)}let v=i;v.x=b,v.y=T,v.z=0,M.multiplyByPoint(c,v,v);let S=r;S.x=x,S.y=T,S.z=0,M.multiplyByPoint(c,S,S),h.subtract(S,v,r);let I=o;I.x=b,I.y=E,I.z=0,M.multiplyByPoint(c,I,I),h.subtract(I,v,o)}var e5e=new h,t5e=new h,n5e=new Sn;ad.getPlanarTextureCoordinateAttributes=function(e,t,n,i,r){let o=Pde,s=e5e,a=t5e;QGe(e,n,r??0,o,s,a);let c={};wde(c,t);let u=Sn.fromCartesian(o,n5e);return c.southWest_HIGH=new Pl({componentDatatype:Y.FLOAT,componentsPerAttribute:3,normalize:!1,value:h.pack(u.high,[0,0,0])}),c.southWest_LOW=new Pl({componentDatatype:Y.FLOAT,componentsPerAttribute:3,normalize:!1,value:h.pack(u.low,[0,0,0])}),c.eastward=new Pl({componentDatatype:Y.FLOAT,componentsPerAttribute:3,normalize:!1,value:h.pack(s,[0,0,0])}),c.northward=new Pl({componentDatatype:Y.FLOAT,componentsPerAttribute:3,normalize:!1,value:h.pack(a,[0,0,0])}),Dde(e,i,c),c};var i5e=new h;function Cde(e,t,n,i){let r=Ide;r.latitude=e,r.longitude=t,r.height=0;let o=he.toCartesian(r,n,i5e),s=Math.sqrt(o.x*o.x+o.y*o.y),a=P.fastApproximateAtan2(s,o.z),c=P.fastApproximateAtan2(o.x,o.y);return i.x=a,i.y=c,i}var vde=new U;ad.getSphericalExtentGeometryInstanceAttributes=function(e,t,n,i){let r=Cde(e.south,e.west,n,vde),o=r.x,s=r.y,a=Cde(e.north,e.east,n,vde),c=a.x,u=a.y,f=0;s>u&&(f=P.PI-s,s=-P.PI,u+=f),o-=P.EPSILON5,s-=P.EPSILON5,c+=P.EPSILON5,u+=P.EPSILON5;let d=1/(u-s),p=1/(c-o),g={sphericalExtents:new Pl({componentDatatype:Y.FLOAT,componentsPerAttribute:4,normalize:!1,value:[o,s,p,d]}),longitudeRotation:new Pl({componentDatatype:Y.FLOAT,componentsPerAttribute:1,normalize:!1,value:[f]})};return wde(g,t),Dde(e,i,g),g};ad.hasAttributesForTextureCoordinatePlanes=function(e){return l(e.southWest_HIGH)&&l(e.southWest_LOW)&&l(e.northward)&&l(e.eastward)&&l(e.planes2D_HIGH)&&l(e.planes2D_LOW)&&l(e.uMaxVmax)&&l(e.uvMinAndExtents)};ad.hasAttributesForSphericalExtents=function(e){return l(e.sphericalExtents)&&l(e.longitudeRotation)&&l(e.planes2D_HIGH)&&l(e.planes2D_LOW)&&l(e.uMaxVmax)&&l(e.uvMinAndExtents)};function r5e(e){return Math.max(e.width,e.height)>ad.MAX_WIDTH_FOR_PLANAR_EXTENTS}ad.shouldUseSphericalCoordinates=function(e){return r5e(e)};ad.MAX_WIDTH_FOR_PLANAR_EXTENTS=P.toRadians(1);var cd=ad;var Rde={NEVER:te.NEVER,LESS:te.LESS,EQUAL:te.EQUAL,LESS_OR_EQUAL:te.LEQUAL,GREATER:te.GREATER,NOT_EQUAL:te.NOTEQUAL,GREATER_OR_EQUAL:te.GEQUAL,ALWAYS:te.ALWAYS};Object.freeze(Rde);var ti=Rde;var Ode={ZERO:te.ZERO,KEEP:te.KEEP,REPLACE:te.REPLACE,INCREMENT:te.INCR,DECREMENT:te.DECR,INVERT:te.INVERT,INCREMENT_WRAP:te.INCR_WRAP,DECREMENT_WRAP:te.DECR_WRAP};Object.freeze(Ode);var Rt=Ode;var jk={CESIUM_3D_TILE_MASK:128,SKIP_LOD_MASK:112,SKIP_LOD_BIT_SHIFT:4,CLASSIFICATION_MASK:15};jk.setCesium3DTileBit=function(){return{enabled:!0,frontFunction:ti.ALWAYS,frontOperation:{fail:Rt.KEEP,zFail:Rt.KEEP,zPass:Rt.REPLACE},backFunction:ti.ALWAYS,backOperation:{fail:Rt.KEEP,zFail:Rt.KEEP,zPass:Rt.REPLACE},reference:jk.CESIUM_3D_TILE_MASK,mask:jk.CESIUM_3D_TILE_MASK}};var Xt=Object.freeze(jk);function Nb(e){e=e??H.EMPTY_OBJECT;let t=e.geometryInstances;this.geometryInstances=t,this.show=e.show??!0,this.classificationType=e.classificationType??ei.BOTH,this.debugShowBoundingVolume=e.debugShowBoundingVolume??!1,this.debugShowShadowVolume=e.debugShowShadowVolume??!1,this._debugShowShadowVolume=!1,this._extruded=e._extruded??!1,this._uniformMap=e._uniformMap,this._sp=void 0,this._spStencil=void 0,this._spPick=void 0,this._spColor=void 0,this._spPick2D=void 0,this._spColor2D=void 0,this._rsStencilDepthPass=void 0,this._rsStencilDepthPass3DTiles=void 0,this._rsColorPass=void 0,this._rsPickPass=void 0,this._commandsIgnoreShow=[],this._ready=!1,this._primitive=void 0,this._pickPrimitive=e._pickPrimitive,this._hasSphericalExtentsAttribute=!1,this._hasPlanarExtentsAttributes=!1,this._hasPerColorAttribute=!1,this.appearance=e.appearance,this._createBoundingVolumeFunction=e._createBoundingVolumeFunction,this._updateAndQueueCommandsFunction=e._updateAndQueueCommandsFunction,this._usePickOffsets=!1,this._primitiveOptions={geometryInstances:void 0,appearance:void 0,vertexCacheOptimize:e.vertexCacheOptimize??!1,interleave:e.interleave??!1,releaseGeometryInstances:e.releaseGeometryInstances??!0,allowPicking:e.allowPicking??!0,asynchronous:e.asynchronous??!0,compressVertices:e.compressVertices??!0,_createBoundingVolumeFunction:void 0,_createRenderStatesFunction:void 0,_createShaderProgramFunction:void 0,_createCommandsFunction:void 0,_updateAndQueueCommandsFunction:void 0,_createPickOffsets:!0}}Object.defineProperties(Nb.prototype,{vertexCacheOptimize:{get:function(){return this._primitiveOptions.vertexCacheOptimize}},interleave:{get:function(){return this._primitiveOptions.interleave}},releaseGeometryInstances:{get:function(){return this._primitiveOptions.releaseGeometryInstances}},allowPicking:{get:function(){return this._primitiveOptions.allowPicking}},asynchronous:{get:function(){return this._primitiveOptions.asynchronous}},compressVertices:{get:function(){return this._primitiveOptions.compressVertices}},ready:{get:function(){return this._ready}},_needs2DShader:{get:function(){return this._hasPlanarExtentsAttributes||this._hasSphericalExtentsAttribute}}});Nb.isSupported=function(e){return e.context.stencilBuffer};function iC(e,t){let n=t?ti.EQUAL:ti.ALWAYS;return{colorMask:{red:!1,green:!1,blue:!1,alpha:!1},stencilTest:{enabled:e,frontFunction:n,frontOperation:{fail:Rt.KEEP,zFail:Rt.DECREMENT_WRAP,zPass:Rt.KEEP},backFunction:n,backOperation:{fail:Rt.KEEP,zFail:Rt.INCREMENT_WRAP,zPass:Rt.KEEP},reference:Xt.CESIUM_3D_TILE_MASK,mask:Xt.CESIUM_3D_TILE_MASK},stencilMask:Xt.CLASSIFICATION_MASK,depthTest:{enabled:!0,func:yc.LESS_OR_EQUAL},depthMask:!1}}function MX(e){return{stencilTest:{enabled:e,frontFunction:ti.NOT_EQUAL,frontOperation:{fail:Rt.ZERO,zFail:Rt.ZERO,zPass:Rt.ZERO},backFunction:ti.NOT_EQUAL,backOperation:{fail:Rt.ZERO,zFail:Rt.ZERO,zPass:Rt.ZERO},reference:0,mask:Xt.CLASSIFICATION_MASK},stencilMask:Xt.CLASSIFICATION_MASK,depthTest:{enabled:!1},depthMask:!1,blending:nn.PRE_MULTIPLIED_ALPHA_BLEND}}var o5e={stencilTest:{enabled:!0,frontFunction:ti.NOT_EQUAL,frontOperation:{fail:Rt.ZERO,zFail:Rt.ZERO,zPass:Rt.ZERO},backFunction:ti.NOT_EQUAL,backOperation:{fail:Rt.ZERO,zFail:Rt.ZERO,zPass:Rt.ZERO},reference:0,mask:Xt.CLASSIFICATION_MASK},stencilMask:Xt.CLASSIFICATION_MASK,depthTest:{enabled:!1},depthMask:!1};function s5e(e,t,n,i){if(l(e._rsStencilDepthPass))return;let r=!e.debugShowShadowVolume;e._rsStencilDepthPass=Ge.fromCache(iC(r,!1)),e._rsStencilDepthPass3DTiles=Ge.fromCache(iC(r,!0)),e._rsColorPass=Ge.fromCache(MX(r,!1)),e._rsPickPass=Ge.fromCache(o5e)}function a5e(e,t){if(!e.compressVertices)return t;if(t.search(/in\s+vec3\s+extrudeDirection;/g)!==-1){let n="compressedAttributes",i=`in vec2 ${n};`,r=`vec3 extrudeDirection; -`,o=` extrudeDirection = czm_octDecode(${n}, 65535.0); -`,s=t;s=s.replace(/in\s+vec3\s+extrudeDirection;/g,""),s=Xe.replaceMain(s,"czm_non_compressed_main");let a=`void main() -{ -${o} czm_non_compressed_main(); -}`;return[i,r,s,a].join(` -`)}}function c5e(e,t){let n=t.context,i=e._primitive,r=X2;r=e._primitive._batchTable.getVertexShaderCallback()(r),r=Mn._appendDistanceDisplayConditionToShader(i,r),r=Mn._modifyShaderPosition(e,r,t.scene3DOnly),r=Mn._updateColorAttribute(i,r);let o=e._hasPlanarExtentsAttributes,s=o||e._hasSphericalExtentsAttribute;e._extruded&&(r=a5e(i,r));let a=e._extruded?"EXTRUDED_GEOMETRY":"",c=new Xe({defines:[a],sources:[r]}),u=new Xe({sources:[Ob]}),f=e._primitive._attributeLocations,d=new cd(s,o,e.appearance);if(e._spStencil=Qt.replaceCache({context:n,shaderProgram:e._spStencil,vertexShaderSource:c,fragmentShaderSource:u,attributeLocations:f}),e._primitive.allowPicking){let m=Xe.createPickVertexShaderSource(r);m=Mn._appendShowToShader(i,m),m=Mn._updatePickColorAttribute(m);let y=d.createPickFragmentShader(!1),A=d.createPickVertexShader([a],m,!1,t.mapProjection);if(e._spPick=Qt.replaceCache({context:n,shaderProgram:e._spPick,vertexShaderSource:A,fragmentShaderSource:y,attributeLocations:f}),s){let b=n.shaderCache.getDerivedShaderProgram(e._spPick,"2dPick");if(!l(b)){let x=d.createPickFragmentShader(!0),T=d.createPickVertexShader([a],m,!0,t.mapProjection);b=n.shaderCache.createDerivedShaderProgram(e._spPick,"2dPick",{vertexShaderSource:T,fragmentShaderSource:x,attributeLocations:f})}e._spPick2D=b}}else e._spPick=Qt.fromCache({context:n,vertexShaderSource:c,fragmentShaderSource:u,attributeLocations:f});r=Mn._appendShowToShader(i,r),c=new Xe({defines:[a],sources:[r]}),e._sp=Qt.replaceCache({context:n,shaderProgram:e._sp,vertexShaderSource:c,fragmentShaderSource:u,attributeLocations:f});let p=d.createFragmentShader(!1),g=d.createVertexShader([a],r,!1,t.mapProjection);if(e._spColor=Qt.replaceCache({context:n,shaderProgram:e._spColor,vertexShaderSource:g,fragmentShaderSource:p,attributeLocations:f}),s){let m=n.shaderCache.getDerivedShaderProgram(e._spColor,"2dColor");if(!l(m)){let y=d.createFragmentShader(!0),A=d.createVertexShader([a],r,!0,t.mapProjection);m=n.shaderCache.createDerivedShaderProgram(e._spColor,"2dColor",{vertexShaderSource:A,fragmentShaderSource:y,attributeLocations:f})}e._spColor2D=m}}function l5e(e,t){let n=e._primitive,i=n._va.length*2;t.length=i;let r,o,s,a=0,c=n._batchTable.getUniformMapCallback()(e._uniformMap),u=e._needs2DShader;for(r=0;r<i;r+=2){let g=n._va[a++];o=t[r],l(o)||(o=t[r]=new at({owner:e,primitiveType:n._primitiveType})),o.vertexArray=g,o.renderState=e._rsStencilDepthPass,o.shaderProgram=e._sp,o.uniformMap=c,o.pass=Ie.TERRAIN_CLASSIFICATION,s=at.shallowClone(o,o.derivedCommands.tileset),s.renderState=e._rsStencilDepthPass3DTiles,s.pass=Ie.CESIUM_3D_TILE_CLASSIFICATION,o.derivedCommands.tileset=s,o=t[r+1],l(o)||(o=t[r+1]=new at({owner:e,primitiveType:n._primitiveType})),o.vertexArray=g,o.renderState=e._rsColorPass,o.shaderProgram=e._spColor,o.pass=Ie.TERRAIN_CLASSIFICATION;let y=e.appearance.material;if(l(y)&&(c=Mt(c,y._uniforms)),o.uniformMap=c,s=at.shallowClone(o,o.derivedCommands.tileset),s.pass=Ie.CESIUM_3D_TILE_CLASSIFICATION,o.derivedCommands.tileset=s,u){let A=at.shallowClone(o,o.derivedCommands.appearance2D);A.shaderProgram=e._spColor2D,o.derivedCommands.appearance2D=A,A=at.shallowClone(s,s.derivedCommands.appearance2D),A.shaderProgram=e._spColor2D,s.derivedCommands.appearance2D=A}}let f=e._commandsIgnoreShow,d=e._spStencil,p=0;i=f.length=i/2;for(let g=0;g<i;++g){let m=f[g]=at.shallowClone(t[p],f[g]);m.shaderProgram=d,m.pass=Ie.CESIUM_3D_TILE_CLASSIFICATION_IGNORE_SHOW,p+=2}}function u5e(e,t){let n=e._usePickOffsets,i=e._primitive,r=i._va.length*2,o,s=0,a;n&&(o=i._pickOffsets,r=o.length*2),t.length=r;let c,u,f,d=0,p=i._batchTable.getUniformMapCallback()(e._uniformMap),g=e._needs2DShader;for(c=0;c<r;c+=2){let m=i._va[d++];if(n&&(a=o[s++],m=i._va[a.index]),u=t[c],l(u)||(u=t[c]=new at({owner:e,primitiveType:i._primitiveType,pickOnly:!0})),u.vertexArray=m,u.renderState=e._rsStencilDepthPass,u.shaderProgram=e._sp,u.uniformMap=p,u.pass=Ie.TERRAIN_CLASSIFICATION,n&&(u.offset=a.offset,u.count=a.count),f=at.shallowClone(u,u.derivedCommands.tileset),f.renderState=e._rsStencilDepthPass3DTiles,f.pass=Ie.CESIUM_3D_TILE_CLASSIFICATION,u.derivedCommands.tileset=f,u=t[c+1],l(u)||(u=t[c+1]=new at({owner:e,primitiveType:i._primitiveType,pickOnly:!0})),u.vertexArray=m,u.renderState=e._rsPickPass,u.shaderProgram=e._spPick,u.uniformMap=p,u.pass=Ie.TERRAIN_CLASSIFICATION,n&&(u.offset=a.offset,u.count=a.count),f=at.shallowClone(u,u.derivedCommands.tileset),f.pass=Ie.CESIUM_3D_TILE_CLASSIFICATION,u.derivedCommands.tileset=f,g){let y=at.shallowClone(u,u.derivedCommands.pick2D);y.shaderProgram=e._spPick2D,u.derivedCommands.pick2D=y,y=at.shallowClone(f,f.derivedCommands.pick2D),y.shaderProgram=e._spPick2D,f.derivedCommands.pick2D=y}}}function f5e(e,t,n,i,r,o,s){l5e(e,o),u5e(e,s)}function Mde(e,t){return Math.floor(e%t/2)}function OX(e,t,n,i,r,o){e.modelMatrix=n,e.boundingVolume=r,e.cull=i,e.debugShowBoundingVolume=o,t.commandList.push(e)}function Nde(e,t,n,i,r){e.modelMatrix=n,e.boundingVolume=r,e.cull=i,t.commandList.push(e)}function d5e(e,t,n,i,r,o,s,a){let c=e._primitive;Mn._updateBoundingVolumes(c,t,r);let u;t.mode===re.SCENE3D?u=c._boundingSphereWC:t.mode===re.COLUMBUS_VIEW?u=c._boundingSphereCV:t.mode===re.SCENE2D&&l(c._boundingSphere2D)?u=c._boundingSphere2D:l(c._boundingSphereMorph)&&(u=c._boundingSphereMorph);let f=e.classificationType,d=f!==ei.CESIUM_3D_TILE,p=f!==ei.TERRAIN,g=t.passes,m,y,A;if(g.render){let b=n.length;for(m=0;m<b;++m)y=u[Mde(m,b)],d&&(A=n[m],OX(A,t,r,o,y,s)),p&&(A=n[m].derivedCommands.tileset,OX(A,t,r,o,y,s));if(t.invertClassification){let x=e._commandsIgnoreShow,T=x.length;for(m=0;m<T;++m)y=u[m],A=x[m],OX(A,t,r,o,y,s)}}if(g.pick){let b=i.length,x=c._pickOffsets;for(m=0;m<b;++m){let T=x[Mde(m,b)];y=u[T.index],d&&(A=i[m],Nde(A,t,r,o,y)),p&&(A=i[m].derivedCommands.tileset,Nde(A,t,r,o,y))}}}Nb.prototype.update=function(e){if(!l(this._primitive)&&!l(this.geometryInstances))return;let t=this.appearance;l(t)&&l(t.material)&&t.material.update(e.context);let n=this,i=this._primitiveOptions;if(!l(this._primitive)){let r=Array.isArray(this.geometryInstances)?this.geometryInstances:[this.geometryInstances],o=r.length,s,a,c,u=!1,f=!0,d,p=!1,g=!1;for(o>0&&(c=r[0].attributes,p=cd.hasAttributesForSphericalExtents(c),g=cd.hasAttributesForTextureCoordinatePlanes(c),d=c.color),s=0;s<o;s++){a=r[s];let y=a.attributes.color;l(y)&&(u=!0),f=f&&l(y)&&Jt.equals(d,y)}if(!f&&!p&&!g)throw new pe("All GeometryInstances must have the same color attribute except via GroundPrimitives");u&&!l(t)&&(t=new An({flat:!0}),this.appearance=t),this._usePickOffsets=!p&&!g,this._hasSphericalExtentsAttribute=p,this._hasPlanarExtentsAttributes=g,this._hasPerColorAttribute=u;let m=new Array(o);for(s=0;s<o;++s)a=r[s],m[s]=new Bt({geometry:a.geometry,attributes:a.attributes,modelMatrix:a.modelMatrix,id:a.id,pickPrimitive:this._pickPrimitive??n});i.appearance=t,i.geometryInstances=m,l(this._createBoundingVolumeFunction)&&(i._createBoundingVolumeFunction=function(y,A){n._createBoundingVolumeFunction(y,A)}),i._createRenderStatesFunction=function(y,A,b,x){s5e(n,A)},i._createShaderProgramFunction=function(y,A,b){c5e(n,A)},i._createCommandsFunction=function(y,A,b,x,T,E,v){f5e(n,void 0,void 0,!0,!1,E,v)},l(this._updateAndQueueCommandsFunction)?i._updateAndQueueCommandsFunction=function(y,A,b,x,T,E,v,S){n._updateAndQueueCommandsFunction(y,A,b,x,T,E,v,S)}:i._updateAndQueueCommandsFunction=function(y,A,b,x,T,E,v,S){d5e(n,A,b,x,T,E,v,S)},this._primitive=new Mn(i)}this.debugShowShadowVolume&&!this._debugShowShadowVolume&&this._ready?(this._debugShowShadowVolume=!0,this._rsStencilDepthPass=Ge.fromCache(iC(!1,!1)),this._rsStencilDepthPass3DTiles=Ge.fromCache(iC(!1,!0)),this._rsColorPass=Ge.fromCache(MX(!1))):!this.debugShowShadowVolume&&this._debugShowShadowVolume&&(this._debugShowShadowVolume=!1,this._rsStencilDepthPass=Ge.fromCache(iC(!0,!1)),this._rsStencilDepthPass3DTiles=Ge.fromCache(iC(!0,!0)),this._rsColorPass=Ge.fromCache(MX(!0))),this._primitive.appearance!==t&&(this._primitive.appearance=t),this._primitive.show=this.show,this._primitive.debugShowBoundingVolume=this.debugShowBoundingVolume,this._primitive.update(e),e.afterRender.push(()=>{l(this._primitive)&&this._primitive.ready&&(this._ready=!0,this.releaseGeometryInstances&&(this.geometryInstances=void 0))})};Nb.prototype.getGeometryInstanceAttributes=function(e){return this._primitive.getGeometryInstanceAttributes(e)};Nb.prototype.isDestroyed=function(){return!1};Nb.prototype.destroy=function(){return this._primitive=this._primitive&&this._primitive.destroy(),this._sp=this._sp&&this._sp.destroy(),this._spPick=this._spPick&&this._spPick.destroy(),this._spColor=this._spColor&&this._spColor.destroy(),this._spPick2D=void 0,this._spColor2D=void 0,le(this)};var wP=Nb;var h5e={u_globeMinimumAltitude:function(){return 55e3}};function mu(e){e=e??H.EMPTY_OBJECT;let t=e.appearance,n=e.geometryInstances;if(!l(t)&&l(n)){let r=Array.isArray(n)?n:[n],o=r.length;for(let s=0;s<o;s++){let a=r[s].attributes;if(l(a)&&l(a.color)){t=new An({flat:!0});break}}}this.appearance=t,this.geometryInstances=e.geometryInstances,this.show=e.show??!0,this.classificationType=e.classificationType??ei.BOTH,this.debugShowBoundingVolume=e.debugShowBoundingVolume??!1,this.debugShowShadowVolume=e.debugShowShadowVolume??!1,this._boundingVolumes=[],this._boundingVolumes2D=[],this._ready=!1,this._primitive=void 0,this._maxHeight=void 0,this._minHeight=void 0,this._maxTerrainHeight=Ni._defaultMaxTerrainHeight,this._minTerrainHeight=Ni._defaultMinTerrainHeight,this._boundingSpheresKeys=[],this._boundingSpheres=[],this._useFragmentCulling=!1,this._zIndex=void 0;let i=this;this._classificationPrimitiveOptions={geometryInstances:void 0,appearance:void 0,vertexCacheOptimize:e.vertexCacheOptimize??!1,interleave:e.interleave??!1,releaseGeometryInstances:e.releaseGeometryInstances??!0,allowPicking:e.allowPicking??!0,asynchronous:e.asynchronous??!0,compressVertices:e.compressVertices??!0,_createBoundingVolumeFunction:void 0,_updateAndQueueCommandsFunction:void 0,_pickPrimitive:i,_extruded:!0,_uniformMap:h5e}}Object.defineProperties(mu.prototype,{vertexCacheOptimize:{get:function(){return this._classificationPrimitiveOptions.vertexCacheOptimize}},interleave:{get:function(){return this._classificationPrimitiveOptions.interleave}},releaseGeometryInstances:{get:function(){return this._classificationPrimitiveOptions.releaseGeometryInstances}},allowPicking:{get:function(){return this._classificationPrimitiveOptions.allowPicking}},asynchronous:{get:function(){return this._classificationPrimitiveOptions.asynchronous}},compressVertices:{get:function(){return this._classificationPrimitiveOptions.compressVertices}},ready:{get:function(){return this._ready}}});mu.isSupported=wP.isSupported;function Lde(e){return function(t,n){let i=n.maximumRadius,r=i/Math.cos(t*.5)-i;return e._maxHeight+r}}function Fde(e){return function(t,n){return e._minHeight}}var m5e=new h,p5e=new h,g5e=new h,_5e=new he,y5e=new ie;function Hk(e,t){let n=e.mapProjection.ellipsoid;if(!l(t.attributes)||!l(t.attributes.position3DHigh))return l(t.rectangle)?t.rectangle:void 0;let i=t.attributes.position3DHigh.values,r=t.attributes.position3DLow.values,o=i.length,s=Number.POSITIVE_INFINITY,a=Number.POSITIVE_INFINITY,c=Number.NEGATIVE_INFINITY,u=Number.NEGATIVE_INFINITY;for(let d=0;d<o;d+=3){let p=h.unpack(i,d,m5e),g=h.unpack(r,d,p5e),m=h.add(p,g,g5e),y=n.cartesianToCartographic(m,_5e),A=y.latitude,b=y.longitude;s=Math.min(s,A),a=Math.min(a,b),c=Math.max(c,A),u=Math.max(u,b)}let f=y5e;return f.north=c,f.south=s,f.east=u,f.west=a,f}function A5e(e,t,n){let i=Ni.getMinimumMaximumHeights(t,n);e._minTerrainHeight=i.minimumTerrainHeight,e._maxTerrainHeight=i.maximumTerrainHeight}function b5e(e,t,n){let i=t.mapProjection.ellipsoid,r=Hk(t,n),o=en.fromRectangle(r,e._minHeight,e._maxHeight,i);if(e._boundingVolumes.push(o),!t.scene3DOnly){let s=t.mapProjection,a=ue.fromRectangleWithHeights2D(r,s,e._maxHeight,e._minHeight);h.fromElements(a.center.z,a.center.x,a.center.y,a.center),e._boundingVolumes2D.push(a)}}function NX(e,t){return Math.floor(e%t/2)}function LX(e,t,n,i,r,o,s){let a=e._primitive;n.mode!==re.SCENE3D&&t.shaderProgram===a._spColor&&a._needs2DShader&&(t=t.derivedCommands.appearance2D),t.owner=e,t.modelMatrix=i,t.boundingVolume=o,t.cull=r,t.debugShowBoundingVolume=s,n.commandList.push(t)}function Bde(e,t,n,i,r,o){let s=e._primitive;n.mode!==re.SCENE3D&&t.shaderProgram===s._spPick&&s._needs2DShader&&(t=t.derivedCommands.pick2D),t.owner=e,t.modelMatrix=i,t.boundingVolume=o,t.cull=r,n.commandList.push(t)}function x5e(e,t,n,i,r,o,s,a){let c;t.mode===re.SCENE3D?c=e._boundingVolumes:c=e._boundingVolumes2D;let u=e.classificationType,f=u!==ei.CESIUM_3D_TILE,d=u!==ei.TERRAIN,p=t.passes,g=e._primitive,m,y,A;if(p.render){let b=n.length;for(m=0;m<b;++m)y=c[NX(m,b)],f&&(A=n[m],LX(e,A,t,r,o,y,s)),d&&(A=n[m].derivedCommands.tileset,LX(e,A,t,r,o,y,s));if(t.invertClassification){let x=g._commandsIgnoreShow,T=x.length;for(m=0;m<T;++m)y=c[m],A=x[m],LX(e,A,t,r,o,y,s)}}if(p.pick){let b=i.length,x;for(e._useFragmentCulling||(x=g._primitive._pickOffsets),m=0;m<b;++m){if(y=c[NX(m,b)],!e._useFragmentCulling){let T=x[NX(m,b)];y=c[T.index]}f&&(A=i[m],Bde(e,A,t,r,o,y)),d&&(A=i[m].derivedCommands.tileset,Bde(e,A,t,r,o,y))}}}mu.initializeTerrainHeights=function(){return Ni.initialize()};mu.prototype.update=function(e){if(!l(this._primitive)&&!l(this.geometryInstances))return;if(!Ni.initialized){mu.initializeTerrainHeights();return}let t=this,n=this._classificationPrimitiveOptions;if(!l(this._primitive)){let i=e.mapProjection.ellipsoid,r,o,s,a=Array.isArray(this.geometryInstances)?this.geometryInstances:[this.geometryInstances],c=a.length,u=new Array(c),f,d;for(f=0;f<c;++f){r=a[f],o=r.geometry;let y=Hk(e,o);l(d)?l(y)&&ie.union(d,y,d):d=ie.clone(y);let A=r.id;if(l(A)&&l(y)){let b=Ni.getBoundingSphere(y,i);this._boundingSpheresKeys.push(A),this._boundingSpheres.push(b)}s=o.constructor,!l(s)||l(s.createShadowVolume)}A5e(this,d,i);let p=e.verticalExaggeration,g=e.verticalExaggerationRelativeHeight;this._minHeight=br.getHeight(this._minTerrainHeight,p,g),this._maxHeight=br.getHeight(this._maxTerrainHeight,p,g);let m=mu._supportsMaterials(e.context);if(this._useFragmentCulling=m,m){let y,A=!0;for(f=0;f<c;++f)if(r=a[f],o=r.geometry,d=Hk(e,o),cd.shouldUseSphericalCoordinates(d)){A=!1;break}for(f=0;f<c;++f){r=a[f],o=r.geometry,s=o.constructor;let b=Hk(e,o),x=o.textureCoordinateRotationPoints;A?y=cd.getPlanarTextureCoordinateAttributes(b,x,i,e.mapProjection,this._maxHeight):y=cd.getSphericalExtentGeometryInstanceAttributes(b,x,i,e.mapProjection);let T=r.attributes;for(let E in T)T.hasOwnProperty(E)&&(y[E]=T[E]);u[f]=new Bt({geometry:s.createShadowVolume(o,Fde(this),Lde(this)),attributes:y,id:r.id})}}else for(f=0;f<c;++f)r=a[f],o=r.geometry,s=o.constructor,u[f]=new Bt({geometry:s.createShadowVolume(o,Fde(this),Lde(this)),attributes:r.attributes,id:r.id});n.geometryInstances=u,n.appearance=this.appearance,n._createBoundingVolumeFunction=function(y,A){b5e(t,y,A)},n._updateAndQueueCommandsFunction=function(y,A,b,x,T,E,v,S){x5e(t,A,b,x,T,E,v,S)},this._primitive=new wP(n)}this._primitive.appearance=this.appearance,this._primitive.show=this.show,this._primitive.debugShowShadowVolume=this.debugShowShadowVolume,this._primitive.debugShowBoundingVolume=this.debugShowBoundingVolume,this._primitive.update(e),e.afterRender.push(()=>{!this._ready&&l(this._primitive)&&this._primitive.ready&&(this._ready=!0,this.releaseGeometryInstances&&(this.geometryInstances=void 0))})};mu.prototype.getBoundingSphere=function(e){let t=this._boundingSpheresKeys.indexOf(e);if(t!==-1)return this._boundingSpheres[t]};mu.prototype.getGeometryInstanceAttributes=function(e){return this._primitive.getGeometryInstanceAttributes(e)};mu.prototype.isDestroyed=function(){return!1};mu.prototype.destroy=function(){return this._primitive=this._primitive&&this._primitive.destroy(),le(this)};mu._supportsMaterials=function(e){return e.depthTexture};mu.supportsMaterials=function(e){return mu._supportsMaterials(e.frameState.context)};var pu=mu;function rC(){pe.throwInstantiationError()}Object.defineProperties(rC.prototype,{isConstant:{get:pe.throwInstantiationError},definitionChanged:{get:pe.throwInstantiationError}});rC.prototype.getType=pe.throwInstantiationError;rC.prototype.getValue=pe.throwInstantiationError;rC.prototype.equals=pe.throwInstantiationError;var T5e=new K;rC.getValue=function(e,t,n){let i;return l(e)||(e=K.now(T5e)),l(t)&&(i=t.getType(e),l(i))?((!l(n)||n.type!==i)&&(n=ir.fromType(i)),t.getValue(e,n.uniforms),n):((!l(n)||n.type!==ir.ColorType)&&(n=ir.fromType(ir.ColorType)),z.clone(z.WHITE,n.uniforms.color),n)};var Co=rC;function Lb(e,t,n){this._primitives=t,this._orderedGroundPrimitives=n,this._primitive=void 0,this._outlinePrimitive=void 0,this._geometryUpdater=e,this._options=e._options,this._entity=e._entity,this._material=void 0}Lb.prototype._isHidden=function(e,t,n){return!e.isShowing||!e.isAvailable(n)||!X.getValueOrDefault(t.show,n,!0)};Lb.prototype._setOptions=pe.throwInstantiationError;Lb.prototype.update=function(e){let t=this._geometryUpdater,n=t._onTerrain,i=this._primitives,r=this._orderedGroundPrimitives;n?r.remove(this._primitive):(i.removeAndDestroy(this._primitive),i.removeAndDestroy(this._outlinePrimitive),this._outlinePrimitive=void 0),this._primitive=void 0;let o=this._entity,s=o[this._geometryUpdater._geometryPropertyName];if(this._setOptions(o,s,e),this._isHidden(o,s,e))return;let a=this._geometryUpdater.shadowsProperty.getValue(e),c=this._options;if(!l(s.fill)||s.fill.getValue(e)){let u=t.fillMaterialProperty,f=u instanceof Kt,d,p=t._getIsClosed(c);if(f)d=new An({closed:p,flat:n&&!t._supportsMaterialsforEntitiesOnTerrain});else{let g=Co.getValue(e,u,this._material);this._material=g,d=new Cr({material:g,translucent:g.isTranslucent(),closed:p})}if(n)c.vertexFormat=An.VERTEX_FORMAT,this._primitive=r.add(new pu({geometryInstances:this._geometryUpdater.createFillGeometryInstance(e),appearance:d,asynchronous:!1,shadows:a,classificationType:this._geometryUpdater.classificationTypeProperty.getValue(e)}),X.getValueOrUndefined(this._geometryUpdater.zIndex,e));else{c.vertexFormat=d.vertexFormat;let g=this._geometryUpdater.createFillGeometryInstance(e);f&&(d.translucent=g.attributes.color.value[3]!==255),this._primitive=i.add(new Mn({geometryInstances:g,appearance:d,asynchronous:!1,shadows:a}))}}if(!n&&l(s.outline)&&s.outline.getValue(e)){let u=this._geometryUpdater.createOutlineGeometryInstance(e),f=X.getValueOrDefault(s.outlineWidth,e,1);this._outlinePrimitive=i.add(new Mn({geometryInstances:u,appearance:new An({flat:!0,translucent:u.attributes.color.value[3]!==255,renderState:{lineWidth:t._scene.clampLineWidth(f)}}),asynchronous:!1,shadows:a}))}};Lb.prototype.getBoundingSphere=function(e){let t=this._entity,n=this._primitive,i=this._outlinePrimitive,r;return l(n)&&n.show&&n.ready&&(r=n.getGeometryInstanceAttributes(t),l(r)&&l(r.boundingSphere))?(ue.clone(r.boundingSphere,e),Pt.DONE):l(i)&&i.show&&i.ready&&(r=i.getGeometryInstanceAttributes(t),l(r)&&l(r.boundingSphere))?(ue.clone(r.boundingSphere,e),Pt.DONE):l(n)&&!n.ready||l(i)&&!i.ready?Pt.PENDING:Pt.FAILED};Lb.prototype.isDestroyed=function(){return!1};Lb.prototype.destroy=function(){let e=this._primitives,t=this._orderedGroundPrimitives;this._geometryUpdater._onTerrain?t.remove(this._primitive):e.removeAndDestroy(this._primitive),e.removeAndDestroy(this._outlinePrimitive),le(this)};var Ri=Lb;var kde={};function IP(e,t){l(kde[e])||(kde[e]=!0,console.warn(t??e))}IP.geometryOutlines="Entity geometry outlines are unsupported on terrain. Outlines will be disabled. To enable outlines, disable geometry terrain clamping by explicitly setting height to 0.";IP.geometryZIndex="Entity geometry with zIndex are unsupported when height or extrudedHeight are defined. zIndex will be ignored";IP.geometryHeightReference="Entity corridor, ellipse, polygon or rectangle with heightReference must also have a defined height. heightReference will be ignored";IP.geometryExtrudedHeightReference="Entity corridor, ellipse, polygon or rectangle with extrudedHeightReference must also have a defined extrudedHeight. extrudedHeightReference will be ignored";var yt=IP;var Ude={AUTODETECT:0,ENU:1,INERTIAL:2,VELOCITY:3};Object.freeze(Ude);var W_=Ude;var zde={NONE:0,GEODESIC:1,RHUMB:2};Object.freeze(zde);var ln=zde;var Vde=P.EPSILON10;function E5e(e,t,n,i){if(!l(e))return;n=n??!1;let r=l(i),o=e.length;if(o<2)return e;let s,a=e[0],c,u,f=0,d=-1;for(s=1;s<o;++s)c=e[s],t(a,c,Vde)?(l(u)||(u=e.slice(0,s),f=s-1,d=0),r&&i.push(s)):(l(u)&&(u.push(c),f=s,r&&(d=i.length)),a=c);return n&&t(e[0],e[o-1],Vde)&&(r&&(l(u)?i.splice(d,0,f):i.push(o-1)),l(u)?u.length-=1:u=e.slice(0,-1)),l(u)?u:e}var Lr=E5e;function C5e(e){let t=e._uSquared,n=e._ellipsoid.maximumRadius,i=e._ellipsoid.minimumRadius,r=(n-i)/n,o=Math.cos(e._startHeading),s=Math.sin(e._startHeading),a=(1-r)*Math.tan(e._start.latitude),c=1/Math.sqrt(1+a*a),u=c*a,f=Math.atan2(a,o),d=c*s,p=d*d,g=1-p,m=Math.sqrt(g),y=t/4,A=y*y,b=A*y,x=A*A,T=1+y-3*A/4+5*b/4-175*x/64,E=1-y+15*A/8-35*b/8,v=1-3*y+35*A/4,S=1-5*y,I=T*f-E*Math.sin(2*f)*y/2-v*Math.sin(4*f)*A/16-S*Math.sin(6*f)*b/48-Math.sin(8*f)*5*x/512,R=e._constants;R.a=n,R.b=i,R.f=r,R.cosineHeading=o,R.sineHeading=s,R.tanU=a,R.cosineU=c,R.sineU=u,R.sigma=f,R.sineAlpha=d,R.sineSquaredAlpha=p,R.cosineSquaredAlpha=g,R.cosineAlpha=m,R.u2Over4=y,R.u4Over16=A,R.u6Over64=b,R.u8Over256=x,R.a0=T,R.a1=E,R.a2=v,R.a3=S,R.distanceRatio=I}function v5e(e,t){return e*t*(4+e*(4-3*t))/16}function jde(e,t,n,i,r,o,s){let a=v5e(e,n);return(1-a)*e*t*(i+a*r*(s+a*o*(2*s*s-1)))}function S5e(e,t,n,i,r,o,s){let a=(t-n)/t,c=o-i,u=Math.atan((1-a)*Math.tan(r)),f=Math.atan((1-a)*Math.tan(s)),d=Math.cos(u),p=Math.sin(u),g=Math.cos(f),m=Math.sin(f),y=d*g,A=d*m,b=p*m,x=p*g,T=c,E,v,S,I,R,O,L,_;do{v=Math.cos(T),S=Math.sin(T);let k=A-x*v;O=Math.sqrt(g*g*S*S+k*k),R=b+y*v,I=Math.atan2(O,R);let G;O===0?(G=0,L=1):(G=y*S/O,L=1-G*G),E=T,_=R-2*b/L,isFinite(_)||(_=0),T=c+jde(a,G,L,I,O,R,_)}while(Math.abs(T-E)>P.EPSILON12);let C=L*(t*t-n*n)/(n*n),w=1+C*(4096+C*(C*(320-175*C)-768))/16384,D=C*(256+C*(C*(74-47*C)-128))/1024,N=_*_,F=D*O*(_+D*(R*(2*N-1)-D*_*(4*O*O-3)*(4*N-3)/6)/4),V=n*w*(I-F),B=Math.atan2(g*S,A-x*v),j=Math.atan2(d*S,A*v-x);e._distance=V,e._startHeading=B,e._endHeading=j,e._uSquared=C}var w5e=new h,FX=new h;function Hde(e,t,n,i){let r=h.normalize(i.cartographicToCartesian(t,FX),w5e),o=h.normalize(i.cartographicToCartesian(n,FX),FX);S5e(e,i.maximumRadius,i.minimumRadius,t.longitude,t.latitude,n.longitude,n.latitude),e._start=he.clone(t,e._start),e._end=he.clone(n,e._end),e._start.height=0,e._end.height=0,C5e(e)}function PP(e,t,n){let i=n??ee.default;this._ellipsoid=i,this._start=new he,this._end=new he,this._constants={},this._startHeading=void 0,this._endHeading=void 0,this._distance=void 0,this._uSquared=void 0,l(e)&&l(t)&&Hde(this,e,t,i)}Object.defineProperties(PP.prototype,{ellipsoid:{get:function(){return this._ellipsoid}},surfaceDistance:{get:function(){return this._distance}},start:{get:function(){return this._start}},end:{get:function(){return this._end}},startHeading:{get:function(){return this._startHeading}},endHeading:{get:function(){return this._endHeading}}});PP.prototype.setEndPoints=function(e,t){Hde(this,e,t,this._ellipsoid)};PP.prototype.interpolateUsingFraction=function(e,t){return this.interpolateUsingSurfaceDistance(this._distance*e,t)};PP.prototype.interpolateUsingSurfaceDistance=function(e,t){let n=this._constants,i=n.distanceRatio+e/n.b,r=Math.cos(2*i),o=Math.cos(4*i),s=Math.cos(6*i),a=Math.sin(2*i),c=Math.sin(4*i),u=Math.sin(6*i),f=Math.sin(8*i),d=i*i,p=i*d,g=n.u8Over256,m=n.u2Over4,y=n.u6Over64,A=n.u4Over16,b=2*p*g*r/3+i*(1-m+7*A/4-15*y/4+579*g/64-(A-15*y/4+187*g/16)*r-(5*y/4-115*g/16)*o-29*g*s/16)+(m/2-A+71*y/32-85*g/16)*a+(5*A/16-5*y/4+383*g/96)*c-d*((y-11*g/2)*a+5*g*c/2)+(29*y/96-29*g/16)*u+539*g*f/1536,x=Math.asin(Math.sin(b)*n.cosineAlpha),T=Math.atan(n.a/n.b*Math.tan(x));b=b-n.sigma;let E=Math.cos(2*n.sigma+b),v=Math.sin(b),S=Math.cos(b),I=n.cosineU*S,R=n.sineU*v,L=Math.atan2(v*n.sineHeading,I-R*n.cosineHeading)-jde(n.f,n.sineAlpha,n.cosineSquaredAlpha,b,v,S,E);return l(t)?(t.longitude=this._start.longitude+L,t.latitude=T,t.height=0,t):new he(this._start.longitude+L,T,0)};var q_=PP;function kX(e,t,n){if(e===0)return t*n;let i=e*e,r=i*i,o=r*i,s=o*i,a=s*i,c=a*i,u=n,f=Math.sin(2*u),d=Math.sin(4*u),p=Math.sin(6*u),g=Math.sin(8*u),m=Math.sin(10*u),y=Math.sin(12*u);return t*((1-i/4-3*r/64-5*o/256-175*s/16384-441*a/65536-4851*c/1048576)*u-(3*i/8+3*r/32+45*o/1024+105*s/4096+2205*a/131072+6237*c/524288)*f+(15*r/256+45*o/1024+525*s/16384+1575*a/65536+155925*c/8388608)*d-(35*o/3072+175*s/12288+3675*a/262144+13475*c/1048576)*p+(315*s/131072+2205*a/524288+43659*c/8388608)*g-(693*a/1310720+6237*c/5242880)*m+1001*c/8388608*y)}function I5e(e,t,n){let i=e/n;if(t===0)return i;let r=i*i,o=r*i,s=o*i,a=t,c=a*a,u=c*c,f=u*c,d=f*c,p=d*c,g=p*c,m=Math.sin(2*i),y=Math.cos(2*i),A=Math.sin(4*i),b=Math.cos(4*i),x=Math.sin(6*i),T=Math.cos(6*i),E=Math.sin(8*i),v=Math.cos(8*i),S=Math.sin(10*i),I=Math.cos(10*i),R=Math.sin(12*i);return i+i*c/4+7*i*u/64+15*i*f/256+579*i*d/16384+1515*i*p/65536+16837*i*g/1048576+(3*i*u/16+45*i*f/256-i*(32*r-561)*d/4096-i*(232*r-1677)*p/16384+i*(399985-90560*r+512*s)*g/5242880)*y+(21*i*f/256+483*i*d/4096-i*(224*r-1969)*p/16384-i*(33152*r-112599)*g/1048576)*b+(151*i*d/4096+4681*i*p/65536+1479*i*g/16384-453*o*g/32768)*T+(1097*i*p/65536+42783*i*g/1048576)*v+8011*i*g/1048576*I+(3*c/8+3*u/16+213*f/2048-3*r*f/64+255*d/4096-33*r*d/512+20861*p/524288-33*r*p/512+s*p/1024+28273*g/1048576-471*r*g/8192+9*s*g/4096)*m+(21*u/256+21*f/256+533*d/8192-21*r*d/512+197*p/4096-315*r*p/4096+584039*g/16777216-12517*r*g/131072+7*s*g/2048)*A+(151*f/6144+151*d/4096+5019*p/131072-453*r*p/16384+26965*g/786432-8607*r*g/131072)*x+(1097*d/131072+1097*p/65536+225797*g/10485760-1097*r*g/65536)*E+(8011*p/2621440+8011*g/1048576)*S+293393*g/251658240*R}function oC(e,t){if(e===0)return Math.log(Math.tan(.5*(P.PI_OVER_TWO+t)));let n=e*Math.sin(t);return Math.log(Math.tan(.5*(P.PI_OVER_TWO+t)))-e/2*Math.log((1+n)/(1-n))}function P5e(e,t,n,i,r){let o=oC(e._ellipticity,n),s=oC(e._ellipticity,r);return Math.atan2(P.negativePiToPi(i-t),s-o)}function D5e(e,t,n,i,r,o,s){let a=e._heading,c=o-i,u;if(P.equalsEpsilon(Math.abs(a),P.PI_OVER_TWO,P.EPSILON8))if(t===n)u=t*Math.cos(r)*P.negativePiToPi(c);else{let f=Math.sin(r);u=t*Math.cos(r)*P.negativePiToPi(c)/Math.sqrt(1-e._ellipticitySquared*f*f)}else{let f=kX(e._ellipticity,t,r);u=(kX(e._ellipticity,t,s)-f)/Math.cos(a)}return Math.abs(u)}var R5e=new h,BX=new h;function Gde(e,t,n,i){let r=h.normalize(i.cartographicToCartesian(t,BX),R5e),o=h.normalize(i.cartographicToCartesian(n,BX),BX),s=i.maximumRadius,a=i.minimumRadius,c=s*s,u=a*a;e._ellipticitySquared=(c-u)/c,e._ellipticity=Math.sqrt(e._ellipticitySquared),e._start=he.clone(t,e._start),e._start.height=0,e._end=he.clone(n,e._end),e._end.height=0,e._heading=P5e(e,t.longitude,t.latitude,n.longitude,n.latitude),e._distance=D5e(e,i.maximumRadius,i.minimumRadius,t.longitude,t.latitude,n.longitude,n.latitude)}function Wde(e,t,n,i,r,o){if(n===0)return he.clone(e,o);let s=r*r,a,c,u;if(Math.abs(P.PI_OVER_TWO-Math.abs(t))>P.EPSILON8){let f=kX(r,i,e.latitude),d=n*Math.cos(t),p=f+d;if(c=I5e(p,r,i),Math.abs(t)<P.EPSILON10)a=P.negativePiToPi(e.longitude);else{let g=oC(r,e.latitude),m=oC(r,c);u=Math.tan(t)*(m-g),a=P.negativePiToPi(e.longitude+u)}}else{c=e.latitude;let f;if(r===0)f=i*Math.cos(e.latitude);else{let d=Math.sin(e.latitude);f=i*Math.cos(e.latitude)/Math.sqrt(1-s*d*d)}u=n/f,t>0?a=P.negativePiToPi(e.longitude+u):a=P.negativePiToPi(e.longitude-u)}return l(o)?(o.longitude=a,o.latitude=c,o.height=0,o):new he(a,c,0)}function H0(e,t,n){let i=n??ee.default;this._ellipsoid=i,this._start=new he,this._end=new he,this._heading=void 0,this._distance=void 0,this._ellipticity=void 0,this._ellipticitySquared=void 0,l(e)&&l(t)&&Gde(this,e,t,i)}Object.defineProperties(H0.prototype,{ellipsoid:{get:function(){return this._ellipsoid}},surfaceDistance:{get:function(){return this._distance}},start:{get:function(){return this._start}},end:{get:function(){return this._end}},heading:{get:function(){return this._heading}}});H0.fromStartHeadingDistance=function(e,t,n,i,r){let o=i??ee.default,s=o.maximumRadius,a=o.minimumRadius,c=s*s,u=a*a,f=Math.sqrt((c-u)/c);t=P.negativePiToPi(t);let d=Wde(e,t,n,o.maximumRadius,f);return!l(r)||l(i)&&!i.equals(r.ellipsoid)?new H0(e,d,o):(r.setEndPoints(e,d),r)};H0.prototype.setEndPoints=function(e,t){Gde(this,e,t,this._ellipsoid)};H0.prototype.interpolateUsingFraction=function(e,t){return this.interpolateUsingSurfaceDistance(e*this._distance,t)};H0.prototype.interpolateUsingSurfaceDistance=function(e,t){return Wde(this._start,this._heading,e,this._ellipsoid.maximumRadius,this._ellipticity,t)};H0.prototype.findIntersectionWithLongitude=function(e,t){let n=this._ellipticity,i=this._heading,r=Math.abs(i),o=this._start;if(e=P.negativePiToPi(e),P.equalsEpsilon(Math.abs(e),Math.PI,P.EPSILON14)&&(e=P.sign(o.longitude)*Math.PI),l(t)||(t=new he),Math.abs(P.PI_OVER_TWO-r)<=P.EPSILON8)return t.longitude=e,t.latitude=o.latitude,t.height=0,t;if(P.equalsEpsilon(Math.abs(P.PI_OVER_TWO-r),P.PI_OVER_TWO,P.EPSILON8))return P.equalsEpsilon(e,o.longitude,P.EPSILON12)?void 0:(t.longitude=e,t.latitude=P.PI_OVER_TWO*P.sign(P.PI_OVER_TWO-i),t.height=0,t);let s=o.latitude,a=n*Math.sin(s),c=Math.tan(.5*(P.PI_OVER_TWO+s))*Math.exp((e-o.longitude)/Math.tan(i)),u=(1+a)/(1-a),f=o.latitude,d;do{d=f;let p=n*Math.sin(d),g=(1+p)/(1-p);f=2*Math.atan(c*Math.pow(g/u,n/2))-P.PI_OVER_TWO}while(!P.equalsEpsilon(f,d,P.EPSILON12));return t.longitude=e,t.latitude=f,t.height=0,t};H0.prototype.findIntersectionWithLatitude=function(e,t){let n=this._ellipticity,i=this._heading,r=this._start;if(P.equalsEpsilon(Math.abs(i),P.PI_OVER_TWO,P.EPSILON8))return;let o=oC(n,r.latitude),s=oC(n,e),a=Math.tan(i)*(s-o),c=P.negativePiToPi(r.longitude+a);return l(t)?(t.longitude=c,t.latitude=e,t.height=0,t):new he(c,e,0)};var jc=H0;var qX=[ji,Ti],O5e=qX.length,fhe=Math.cos(P.toRadians(30)),qde=Math.cos(P.toRadians(150)),dhe=0,hhe=1e3;function X_(e){e=e??H.EMPTY_OBJECT;let t=e.positions;this.width=e.width??1,this._positions=t,this.granularity=e.granularity??9999,this.loop=e.loop??!1,this.arcType=e.arcType??ln.GEODESIC,this._ellipsoid=ee.default,this._projectionIndex=0,this._workerName="createGroundPolylineGeometry",this._scene3DOnly=!1}Object.defineProperties(X_.prototype,{packedLength:{get:function(){return 1+this._positions.length*3+1+1+1+ee.packedLength+1+1}}});X_.setProjectionAndEllipsoid=function(e,t){let n=0;for(let i=0;i<O5e;i++)if(t instanceof qX[i]){n=i;break}e._projectionIndex=n,e._ellipsoid=t.ellipsoid};var M5e=new h,Yde=new h,Xde=new h;function WX(e,t,n,i,r){let o=Dl(i,e,0,M5e),s=Dl(i,e,n,Yde),a=Dl(i,t,0,Xde),c=G0(s,o,Yde),u=G0(a,o,Xde);return h.cross(u,c,r),h.normalize(r,r)}var N5e=new he,L5e=new h,F5e=new h,B5e=new h;function UX(e,t,n,i,r,o,s,a,c,u,f){if(r===0)return;let d;o===ln.GEODESIC?d=new q_(e,t,s):o===ln.RHUMB&&(d=new jc(e,t,s));let p=d.surfaceDistance;if(p<r)return;let g=WX(e,t,i,s,B5e),m=Math.ceil(p/r),y=p/m,A=y,b=m-1,x=a.length;for(let T=0;T<b;T++){let E=d.interpolateUsingSurfaceDistance(A,N5e),v=Dl(s,E,n,L5e),S=Dl(s,E,i,F5e);h.pack(g,a,x),h.pack(v,c,x),h.pack(S,u,x),f.push(E.latitude),f.push(E.longitude),x+=3,A+=y}}var zX=new he;function Dl(e,t,n,i){return he.clone(t,zX),zX.height=n,he.toCartesian(zX,e,i)}X_.pack=function(e,t,n){let i=n??0,r=e._positions,o=r.length;t[i++]=o;for(let s=0;s<o;++s){let a=r[s];h.pack(a,t,i),i+=3}return t[i++]=e.granularity,t[i++]=e.loop?1:0,t[i++]=e.arcType,ee.pack(e._ellipsoid,t,i),i+=ee.packedLength,t[i++]=e._projectionIndex,t[i]=e._scene3DOnly?1:0,t};X_.unpack=function(e,t,n){let i=t??0,r=e[i++],o=new Array(r);for(let p=0;p<r;p++)o[p]=h.unpack(e,i),i+=3;let s=e[i++],a=e[i++]===1,c=e[i++],u=ee.unpack(e,i);i+=ee.packedLength;let f=e[i++],d=e[i]===1;return l(n)||(n=new X_({positions:o})),n._positions=o,n.granularity=s,n.loop=a,n.arcType=c,n._ellipsoid=u,n._projectionIndex=f,n._scene3DOnly=d,n};function G0(e,t,n){return h.subtract(e,t,n),h.normalize(n,n),n}function Kde(e,t,n,i){return i=G0(e,t,i),i=h.cross(i,n,i),i=h.normalize(i,i),i=h.cross(n,i,i),i}var k5e=new h,U5e=new h,z5e=new h,mhe=new h,V5e=0,j5e=-1;function VX(e,t,n,i,r){let o=G0(n,t,mhe),s=Kde(e,t,o,k5e),a=Kde(i,t,o,U5e);if(P.equalsEpsilon(h.dot(s,a),j5e,P.EPSILON5))return r=h.cross(o,s,r),r=h.normalize(r,r),r;r=h.add(a,s,r),r=h.normalize(r,r);let c=h.cross(o,r,z5e);return h.dot(a,c)<V5e&&(r=h.negate(r,r)),r}var Yk=sn.fromPointNormal(h.ZERO,h.UNIT_Y),H5e=new h,G5e=new h,W5e=new h,q5e=new h,Y5e=new h,Gk=new h,Wk=new he,$de=new he,Jde=new he;X_.createGeometry=function(e){let t=!e._scene3DOnly,n=e.loop,i=e._ellipsoid,r=e.granularity,o=e.arcType,s=new qX[e._projectionIndex](i),a=dhe,c=hhe,u,f,d=e._positions,p=d.length;p===2&&(n=!1);let g,m,y,A,b=new jc(void 0,void 0,i),x,T,E,v=[d[0]];for(f=0;f<p-1;f++)g=d[f],m=d[f+1],x=xi.lineSegmentPlane(g,m,Yk,Gk),l(x)&&!h.equalsEpsilon(x,g,P.EPSILON7)&&!h.equalsEpsilon(x,m,P.EPSILON7)&&(e.arcType===ln.GEODESIC?v.push(h.clone(x)):e.arcType===ln.RHUMB&&(E=i.cartesianToCartographic(x,Wk).longitude,y=i.cartesianToCartographic(g,Wk),A=i.cartesianToCartographic(m,$de),b.setEndPoints(y,A),T=b.findIntersectionWithLongitude(E,Jde),x=i.cartographicToCartesian(T,Gk),l(x)&&!h.equalsEpsilon(x,g,P.EPSILON7)&&!h.equalsEpsilon(x,m,P.EPSILON7)&&v.push(h.clone(x)))),v.push(m);n&&(g=d[p-1],m=d[0],x=xi.lineSegmentPlane(g,m,Yk,Gk),l(x)&&!h.equalsEpsilon(x,g,P.EPSILON7)&&!h.equalsEpsilon(x,m,P.EPSILON7)&&(e.arcType===ln.GEODESIC?v.push(h.clone(x)):e.arcType===ln.RHUMB&&(E=i.cartesianToCartographic(x,Wk).longitude,y=i.cartesianToCartographic(g,Wk),A=i.cartesianToCartographic(m,$de),b.setEndPoints(y,A),T=b.findIntersectionWithLongitude(E,Jde),x=i.cartographicToCartesian(T,Gk),l(x)&&!h.equalsEpsilon(x,g,P.EPSILON7)&&!h.equalsEpsilon(x,m,P.EPSILON7)&&v.push(h.clone(x)))));let S=v.length,I=new Array(S);for(f=0;f<S;f++){let q=he.fromCartesian(v[f],i);q.height=0,I[f]=q}if(I=Lr(I,he.equalsEpsilon),S=I.length,S<2)return;let R=[],O=[],L=[],_=[],C=H5e,w=G5e,D=W5e,N=q5e,F=Y5e,V=I[0],B=I[1],j=I[S-1];for(C=Dl(i,j,a,C),N=Dl(i,B,a,N),w=Dl(i,V,a,w),D=Dl(i,V,c,D),n?F=VX(C,w,D,N,F):F=WX(V,B,c,i,F),h.pack(F,O,0),h.pack(w,L,0),h.pack(D,_,0),R.push(V.latitude),R.push(V.longitude),UX(V,B,a,c,r,o,i,O,L,_,R),f=1;f<S-1;++f){C=h.clone(w,C),w=h.clone(N,w);let q=I[f];Dl(i,q,c,D),Dl(i,I[f+1],a,N),VX(C,w,D,N,F),u=O.length,h.pack(F,O,u),h.pack(w,L,u),h.pack(D,_,u),R.push(q.latitude),R.push(q.longitude),UX(I[f],I[f+1],a,c,r,o,i,O,L,_,R)}let k=I[S-1],G=I[S-2];if(w=Dl(i,k,a,w),D=Dl(i,k,c,D),n){let q=I[0];C=Dl(i,G,a,C),N=Dl(i,q,a,N),F=VX(C,w,D,N,F)}else F=WX(G,k,c,i,F);if(u=O.length,h.pack(F,O,u),h.pack(w,L,u),h.pack(D,_,u),R.push(k.latitude),R.push(k.longitude),n){for(UX(k,V,a,c,r,o,i,O,L,_,R),u=O.length,f=0;f<3;++f)O[u+f]=O[f],L[u+f]=L[f],_[u+f]=_[f];R.push(V.latitude),R.push(V.longitude)}return A9e(n,s,L,_,O,R,t)};var X5e=new h,K5e=new $,$5e=new Le;function Zde(e,t,n,i){let r=G0(n,t,X5e),o=h.dot(r,e);if(o>fhe||o<qde){let s=G0(i,n,mhe),a=o<qde?P.PI_OVER_TWO:-P.PI_OVER_TWO,c=Le.fromAxisAngle(s,a,$5e),u=$.fromQuaternion(c,K5e);return $.multiplyByVector(u,e,e),!0}return!1}var Qde=new he,J5e=new h,ehe=new h;function DP(e,t,n,i,r){let o=he.toCartesian(t,e._ellipsoid,J5e),s=h.add(o,n,ehe),a=!1,c=e._ellipsoid,u=c.cartesianToCartographic(s,Qde);Math.abs(t.longitude-u.longitude)>P.PI_OVER_TWO&&(a=!0,s=h.subtract(o,n,ehe),u=c.cartesianToCartographic(s,Qde)),u.height=0;let f=e.project(u,r);return r=h.subtract(f,i,r),r.z=0,r=h.normalize(r,r),a&&h.negate(r,r),r}var Z5e=new h,the=new h;function nhe(e,t,n,i,r,o){let s=h.subtract(t,e,Z5e);h.normalize(s,s);let a=n-dhe,c=h.multiplyByScalar(s,a,the);h.add(e,c,r);let u=i-hhe;c=h.multiplyByScalar(s,u,the),h.add(t,c,o)}var Q5e=new h;function qk(e,t){let n=sn.getPointDistance(Yk,e),i=sn.getPointDistance(Yk,t),r=Q5e;P.equalsEpsilon(n,0,P.EPSILON2)?(r=G0(t,e,r),h.multiplyByScalar(r,P.EPSILON2,r),h.add(e,r,e)):P.equalsEpsilon(i,0,P.EPSILON2)&&(r=G0(e,t,r),h.multiplyByScalar(r,P.EPSILON2,r),h.add(t,r,t))}function e9e(e,t){let n=Math.abs(e.longitude),i=Math.abs(t.longitude);if(P.equalsEpsilon(n,P.PI,P.EPSILON11)){let r=P.sign(t.longitude);return e.longitude=r*(n-P.EPSILON11),1}else if(P.equalsEpsilon(i,P.PI,P.EPSILON11)){let r=P.sign(e.longitude);return t.longitude=r*(i-P.EPSILON11),2}return 0}var phe=new he,ghe=new he,ihe=new h,jX=new h,rhe=new h,ohe=new h,t9e=new h,she=new h,n9e=[phe,ghe],i9e=new ie,r9e=new h,o9e=new h,s9e=new h,a9e=new h,c9e=new h,l9e=new h,HX=new h,GX=new h,u9e=new h,f9e=new h,d9e=new h,ahe=new h,h9e=new h,m9e=new h,p9e=new Sn,g9e=new Sn,che=new h,_9e=new h,lhe=new h,y9e=[new ue,new ue],_he=[0,2,1,0,3,2,0,7,3,0,4,7,0,5,4,0,1,5,5,7,4,5,6,7,5,2,6,5,1,2,3,6,2,3,7,6],uhe=_he.length;function A9e(e,t,n,i,r,o,s){let a,c,u=t._ellipsoid,f=n.length/3-1,d=f*8,p=d*4,g=f*36,m=d>65535?new Uint32Array(g):new Uint16Array(g),y=new Float64Array(d*3),A=new Float32Array(p),b=new Float32Array(p),x=new Float32Array(p),T=new Float32Array(p),E=new Float32Array(p),v,S,I,R;s&&(v=new Float32Array(p),S=new Float32Array(p),I=new Float32Array(p),R=new Float32Array(d*2));let O=o.length/2,L=0,_=phe;_.height=0;let C=ghe;C.height=0;let w=ihe,D=jX;if(s)for(c=0,a=1;a<O;a++)_.latitude=o[c],_.longitude=o[c+1],C.latitude=o[c+2],C.longitude=o[c+3],w=t.project(_,w),D=t.project(C,D),L+=h.distance(w,D),c+=2;let N=i.length/3;D=h.unpack(i,0,D);let F=0;for(c=3,a=1;a<N;a++)w=h.clone(D,w),D=h.unpack(i,c,D),F+=h.distance(w,D),c+=3;let V;c=3;let B=0,j=0,k=0,G=0,q=!1,Q=h.unpack(n,0,ohe),W=h.unpack(i,0,jX),J=h.unpack(r,0,she);if(e){let ve=h.unpack(n,n.length-6,rhe);Zde(J,ve,Q,W)&&(J=h.negate(J,J))}let Z=0,ae=0,Ae=0;for(a=0;a<f;a++){let ve=h.clone(Q,rhe),Re=h.clone(W,ihe),Qe=h.clone(J,t9e);q&&(Qe=h.negate(Qe,Qe)),Q=h.unpack(n,c,ohe),W=h.unpack(i,c,jX),J=h.unpack(r,c,she),q=Zde(J,ve,Q,W),_.latitude=o[B],_.longitude=o[B+1],C.latitude=o[B+2],C.longitude=o[B+3];let He,Ye,Ke,Pe;if(s){let pi=e9e(_,C);He=t.project(_,c9e),Ye=t.project(C,l9e);let ao=G0(Ye,He,che);ao.y=Math.abs(ao.y),Ke=HX,Pe=GX,pi===0||h.dot(ao,h.UNIT_Y)>fhe?(Ke=DP(t,_,Qe,He,HX),Pe=DP(t,C,J,Ye,GX)):pi===1?(Pe=DP(t,C,J,Ye,GX),Ke.x=0,Ke.y=P.sign(_.longitude-Math.abs(C.longitude)),Ke.z=0):(Ke=DP(t,_,Qe,He,HX),Pe.x=0,Pe.y=P.sign(_.longitude-C.longitude),Pe.z=0)}let qe=h.distance(Re,W),st=Sn.fromCartesian(ve,p9e),vt=h.subtract(Q,ve,u9e),jt=h.normalize(vt,ahe),lt=h.subtract(Re,ve,f9e);lt=h.normalize(lt,lt);let mt=h.cross(jt,lt,ahe);mt=h.normalize(mt,mt);let ft=h.cross(lt,Qe,h9e);ft=h.normalize(ft,ft);let Yt=h.subtract(W,Q,d9e);Yt=h.normalize(Yt,Yt);let rt=h.cross(J,Yt,m9e);rt=h.normalize(rt,rt);let ht=qe/F,Li=Z/F,Yn=0,yi,zi,Si,ui=0,Ai=0;if(s){Yn=h.distance(He,Ye),yi=Sn.fromCartesian(He,g9e),zi=h.subtract(Ye,He,che),Si=h.normalize(zi,_9e);let pi=Si.x;Si.x=Si.y,Si.y=-pi,ui=Yn/L,Ai=ae/L}for(V=0;V<8;V++){let pi=G+V*4,ao=j+V*2,nr=pi+3,jo=V<4?1:-1,Fn=V===2||V===3||V===6||V===7?1:-1;h.pack(st.high,A,pi),A[nr]=vt.x,h.pack(st.low,b,pi),b[nr]=vt.y,h.pack(ft,x,pi),x[nr]=vt.z,h.pack(rt,T,pi),T[nr]=ht*jo,h.pack(mt,E,pi);let Vi=Li*Fn;Vi===0&&Fn<0&&(Vi=9),E[nr]=Vi,s&&(v[pi]=yi.high.x,v[pi+1]=yi.high.y,v[pi+2]=yi.low.x,v[pi+3]=yi.low.y,I[pi]=-Ke.y,I[pi+1]=Ke.x,I[pi+2]=Pe.y,I[pi+3]=-Pe.x,S[pi]=zi.x,S[pi+1]=zi.y,S[pi+2]=Si.x,S[pi+3]=Si.y,R[ao]=ui*jo,Vi=Ai*Fn,Vi===0&&Fn<0&&(Vi=9),R[ao+1]=Vi)}let zn=s9e,tn=a9e,Hn=r9e,Ki=o9e,wr=ie.fromCartographicArray(n9e,i9e),so=Ni.getMinimumMaximumHeights(wr,u),Ts=so.minimumTerrainHeight,zs=so.maximumTerrainHeight;Ae+=Math.abs(Ts),Ae+=Math.abs(zs),nhe(ve,Re,Ts,zs,zn,Hn),nhe(Q,W,Ts,zs,tn,Ki);let $r=h.multiplyByScalar(mt,P.EPSILON5,lhe);h.add(zn,$r,zn),h.add(tn,$r,tn),h.add(Hn,$r,Hn),h.add(Ki,$r,Ki),qk(zn,tn),qk(Hn,Ki),h.pack(zn,y,k),h.pack(tn,y,k+3),h.pack(Ki,y,k+6),h.pack(Hn,y,k+9),$r=h.multiplyByScalar(mt,-2*P.EPSILON5,lhe),h.add(zn,$r,zn),h.add(tn,$r,tn),h.add(Hn,$r,Hn),h.add(Ki,$r,Ki),qk(zn,tn),qk(Hn,Ki),h.pack(zn,y,k+12),h.pack(tn,y,k+15),h.pack(Ki,y,k+18),h.pack(Hn,y,k+21),B+=2,c+=3,j+=16,k+=24,G+=32,Z+=qe,ae+=Yn}c=0;let fe=0;for(a=0;a<f;a++){for(V=0;V<uhe;V++)m[c+V]=_he[V]+fe;fe+=8,c+=uhe}let xe=y9e;ue.fromVertices(n,h.ZERO,3,xe[0]),ue.fromVertices(i,h.ZERO,3,xe[1]);let ge=ue.fromBoundingSpheres(xe);ge.radius+=Ae/(f*2);let we={position:new Ne({componentDatatype:Y.DOUBLE,componentsPerAttribute:3,normalize:!1,values:y}),startHiAndForwardOffsetX:Y_(A),startLoAndForwardOffsetY:Y_(b),startNormalAndForwardOffsetZ:Y_(x),endNormalAndTextureCoordinateNormalizationX:Y_(T),rightNormalAndTextureCoordinateNormalizationY:Y_(E)};return s&&(we.startHiLo2D=Y_(v),we.offsetAndRight2D=Y_(S),we.startEndNormals2D=Y_(I),we.texcoordNormalization2D=new Ne({componentDatatype:Y.FLOAT,componentsPerAttribute:2,normalize:!1,values:R})),new wt({attributes:we,indices:m,boundingSphere:ge})}function Y_(e){return new Ne({componentDatatype:Y.FLOAT,componentsPerAttribute:4,normalize:!1,values:e})}X_._projectNormal=DP;var sC=X_;var Xk=`in vec3 position3DHigh; +`,t}function Cde(e,t){let n=e.vertexAttributes}function lGe(e,t){return function(){return e[t]}}var VX=Math.max(dn.hardwareConcurrency-1,1),Nk,uGe=new $n("combineGeometry");function fGe(e,t){let n,i,r,o,s=e._instanceIds;if(e._state===us.READY){n=Array.isArray(e.geometryInstances)?e.geometryInstances:[e.geometryInstances];let a=e._numberOfInstances=n.length,c=[],u=[];for(r=0;r<a;++r)i=n[r].geometry,s.push(n[r].id),u.push({moduleName:i._workerName,modulePath:i._workerPath,geometry:i});if(!l(Nk))for(Nk=new Array(VX),r=0;r<VX;r++)Nk[r]=new $n("createGeometry");let f;for(u=Mk(u,VX),r=0;r<u.length;r++){let d=0,p=u[r],g=p.length;for(o=0;o<g;++o)f=p[o],i=f.geometry,l(i.constructor.pack)&&(f.offset=d,d+=i.constructor.packedLength??i.packedLength);let m;if(d>0){let y=new Float64Array(d);for(m=[y.buffer],o=0;o<g;++o)f=p[o],i=f.geometry,l(i.constructor.pack)&&(i.constructor.pack(i,y,f.offset),f.geometry=y)}c.push(Nk[r].scheduleTask({subTasks:u[r]},m))}e._state=us.CREATING,Promise.all(c).then(function(d){e._createGeometryResults=d,e._state=us.CREATED}).catch(function(d){SP(e,t,us.FAILED,d)})}else if(e._state===us.CREATED){let a=[];n=Array.isArray(e.geometryInstances)?e.geometryInstances:[e.geometryInstances];let c=t.scene3DOnly,u=t.mapProjection,f=uGe.scheduleTask(tC.packCombineGeometryParameters({createGeometryResults:e._createGeometryResults,instances:n,ellipsoid:u.ellipsoid,projection:u,elementIndexUintSupported:t.context.elementIndexUint,scene3DOnly:c,vertexCacheOptimize:e.vertexCacheOptimize,compressVertices:e.compressVertices,modelMatrix:e.modelMatrix,createPickOffsets:e._createPickOffsets},a),a);e._createGeometryResults=void 0,e._state=us.COMBINING,Promise.resolve(f).then(function(d){let p=tC.unpackCombineGeometryResults(d);e._geometries=p.geometries,e._attributeLocations=p.attributeLocations,e.modelMatrix=M.clone(p.modelMatrix,e.modelMatrix),e._pickOffsets=p.pickOffsets,e._offsetInstanceExtend=p.offsetInstanceExtend,e._instanceBoundingSpheres=p.boundingSpheres,e._instanceBoundingSpheresCV=p.boundingSpheresCV,l(e._geometries)&&e._geometries.length>0?(e._recomputeBoundingSpheres=!0,e._state=us.COMBINED):SP(e,t,us.FAILED,void 0)}).catch(function(d){SP(e,t,us.FAILED,d)})}}function dGe(e,t){let n=Array.isArray(e.geometryInstances)?e.geometryInstances:[e.geometryInstances],i=e._numberOfInstances=n.length,r=new Array(i),o=e._instanceIds,s,a,c=0;for(a=0;a<i;a++){s=n[a];let p=s.geometry,g;l(p.attributes)&&l(p.primitiveType)?g=rGe(p):g=p.constructor.createGeometry(p),r[c++]=oGe(s,g),o.push(s.id)}r.length=c;let u=t.scene3DOnly,f=t.mapProjection,d=tC.combineGeometry({instances:r,ellipsoid:f.ellipsoid,projection:f,elementIndexUintSupported:t.context.elementIndexUint,scene3DOnly:u,vertexCacheOptimize:e.vertexCacheOptimize,compressVertices:e.compressVertices,modelMatrix:e.modelMatrix,createPickOffsets:e._createPickOffsets});e._geometries=d.geometries,e._attributeLocations=d.attributeLocations,e.modelMatrix=M.clone(d.modelMatrix,e.modelMatrix),e._pickOffsets=d.pickOffsets,e._offsetInstanceExtend=d.offsetInstanceExtend,e._instanceBoundingSpheres=d.boundingSpheres,e._instanceBoundingSpheresCV=d.boundingSpheresCV,l(e._geometries)&&e._geometries.length>0?(e._recomputeBoundingSpheres=!0,e._state=us.COMBINED):SP(e,t,us.FAILED,void 0)}function hGe(e,t){let n=e._batchTableAttributeIndices.offset;if(!e._recomputeBoundingSpheres||!l(n)){e._recomputeBoundingSpheres=!1;return}let i,r=e._offsetInstanceExtend,o=e._instanceBoundingSpheres,s=o.length,a=e._tempBoundingSpheres;if(!l(a)){for(a=new Array(s),i=0;i<s;i++)a[i]=new ue;e._tempBoundingSpheres=a}for(i=0;i<s;++i){let y=a[i],A=e._batchTable.getBatchedAttribute(i,n,new h);y=o[i].clone(y),Nde(y,A,r[i])}let c=[],u=[],f=[];for(i=0;i<s;++i){let y=a[i];y.center.x-y.radius>0||ue.intersectPlane(y,sn.ORIGIN_ZX_PLANE)!==$t.INTERSECTING?c.push(y):(u.push(y),f.push(y))}let d=c[0],p=f[0],g=u[0];for(i=1;i<c.length;i++)d=ue.union(d,c[i]);for(i=1;i<f.length;i++)p=ue.union(p,f[i]);for(i=1;i<u.length;i++)g=ue.union(g,u[i]);let m=[];for(l(d)&&m.push(d),l(p)&&m.push(p),l(g)&&m.push(g),i=0;i<m.length;i++){let y=m[i].clone(e._boundingSpheres[i]);e._boundingSpheres[i]=y,e._boundingSphereCV[i]=ue.projectTo2D(y,t.mapProjection,e._boundingSphereCV[i])}qo._updateBoundingVolumes(e,t,e.modelMatrix,!0),e._recomputeBoundingSpheres=!1}var vde=new Sn,Rde=new he,Ode=new h,Mde=new ue;function mGe(e,t){if(!l(e._batchTableAttributeIndices.distanceDisplayCondition)||e._batchTableBoundingSpheresUpdated)return;let i=e._batchTableBoundingSphereAttributeIndices,r=i.center3DHigh,o=i.center3DLow,s=i.center2DHigh,a=i.center2DLow,c=i.radius,u=t.mapProjection,f=u.ellipsoid,d=e._batchTable,p=e._instanceBoundingSpheres,g=p.length;for(let m=0;m<g;++m){let y=p[m];if(!l(y))continue;let A=e.modelMatrix;l(A)&&(y=ue.transform(y,A,Mde));let b=y.center,x=y.radius,T=Sn.fromCartesian(b,vde);if(d.setBatchedAttribute(m,r,T.high),d.setBatchedAttribute(m,o,T.low),!t.scene3DOnly){let E=f.cartesianToCartographic(b,Rde),v=u.project(E,Ode);T=Sn.fromCartesian(v,vde),d.setBatchedAttribute(m,s,T.high),d.setBatchedAttribute(m,a,T.low)}d.setBatchedAttribute(m,c,x)}e._batchTableBoundingSpheresUpdated=!0}var jX=new h,pGe=new h;function Sde(e,t){if(!l(e._batchTableAttributeIndices.offset)||e._batchTableOffsetsUpdated||t.scene3DOnly)return;let i=e._batchTableOffsetAttribute2DIndex,r=t.mapProjection,o=r.ellipsoid,s=e._batchTable,a=e._instanceBoundingSpheres,c=a.length;for(let u=0;u<c;++u){let f=a[u];if(!l(f))continue;let d=s.getBatchedAttribute(u,e._batchTableAttributeIndices.offset);if(h.equals(d,h.ZERO)){s.setBatchedAttribute(u,i,h.ZERO);continue}let p=e.modelMatrix;l(p)&&(f=ue.transform(f,p,Mde));let g=f.center;g=o.scaleToGeodeticSurface(g,pGe);let m=o.cartesianToCartographic(g,Rde),y=r.project(m,Ode),A=h.add(d,g,jX);m=o.cartesianToCartographic(A,m);let b=r.project(m,jX),x=h.subtract(b,y,jX),T=x.x;x.x=x.z,x.z=x.y,x.y=T,s.setBatchedAttribute(u,i,x)}e._batchTableOffsetsUpdated=!0}function gGe(e,t){let n=e._attributeLocations,i=e._geometries,r=t.scene3DOnly,o=t.context,s=[],a=i.length;for(let c=0;c<a;++c){let u=i[c];if(s.push(Vn.fromGeometry({context:o,geometry:u,attributeLocations:n,bufferUsage:Me.STATIC_DRAW,interleave:e._interleave})),l(e._createBoundingVolumeFunction))e._createBoundingVolumeFunction(t,u);else if(e._boundingSpheres.push(ue.clone(u.boundingSphere)),e._boundingSphereWC.push(new ue),!r){let f=u.boundingSphereCV.center,d=f.x,p=f.y,g=f.z;f.x=g,f.y=d,f.z=p,e._boundingSphereCV.push(ue.clone(u.boundingSphereCV)),e._boundingSphere2D.push(new ue),e._boundingSphereMorph.push(new ue)}}e._va=s,e._primitiveType=i[0].primitiveType,e.releaseGeometryInstances&&(e.geometryInstances=void 0),e._geometries=void 0,SP(e,t,us.COMPLETE,void 0)}function _Ge(e,t,n,i){let r=n.getRenderState(),o;i?(o=Ze(r,!1),o.cull={enabled:!0,face:Hi.BACK},e._frontFaceRS=Ge.fromCache(o),o.cull.face=Hi.FRONT,e._backFaceRS=Ge.fromCache(o)):(e._frontFaceRS=Ge.fromCache(r),e._backFaceRS=e._frontFaceRS),o=Ze(r,!1),l(e._depthFailAppearance)&&(o.depthTest.enabled=!1),l(e._depthFailAppearance)&&(r=e._depthFailAppearance.getRenderState(),o=Ze(r,!1),o.depthTest.func=Ac.GREATER,i?(o.cull={enabled:!0,face:Hi.BACK},e._frontFaceDepthFailRS=Ge.fromCache(o),o.cull.face=Hi.FRONT,e._backFaceDepthFailRS=Ge.fromCache(o)):(e._frontFaceDepthFailRS=Ge.fromCache(o),e._backFaceDepthFailRS=e._frontFaceRS))}function yGe(e,t,n){let i=t.context,r=e._attributeLocations,o=e._batchTable.getVertexShaderCallback()(n.vertexShaderSource);o=qo._appendOffsetToShader(e,o),o=qo._appendShowToShader(e,o),o=qo._appendDistanceDisplayConditionToShader(e,o,t.scene3DOnly),o=xde(o),o=qo._updateColorAttribute(e,o,!1),o=Ede(e,o),o=qo._modifyShaderPosition(e,o,t.scene3DOnly);let s=n.getFragmentShaderSource();s=Tde(s),e._sp=Qt.replaceCache({context:i,shaderProgram:e._sp,vertexShaderSource:o,fragmentShaderSource:s,attributeLocations:r}),Cde(e._sp,r),l(e._depthFailAppearance)&&(o=e._batchTable.getVertexShaderCallback()(e._depthFailAppearance.vertexShaderSource),o=qo._appendShowToShader(e,o),o=qo._appendDistanceDisplayConditionToShader(e,o,t.scene3DOnly),o=xde(o),o=qo._updateColorAttribute(e,o,!0),o=Ede(e,o),o=qo._modifyShaderPosition(e,o,t.scene3DOnly),o=aGe(o),s=e._depthFailAppearance.getFragmentShaderSource(),s=Tde(s),s=cGe(s),e._spDepthFail=Qt.replaceCache({context:i,shaderProgram:e._spDepthFail,vertexShaderSource:o,fragmentShaderSource:s,attributeLocations:r}),Cde(e._spDepthFail,r))}var vP=new M,wde=new h;function Ide(e,t,n,i){let r=l(n)?n._uniforms:void 0,o={},s=t.uniforms;if(l(s))for(let c in s)s.hasOwnProperty(c)&&(o[c]=lGe(s,c));let a=Mt(o,r);return a=e._batchTable.getUniformMapCallback()(a),l(e.rtcCenter)&&(a.u_modifiedModelView=function(){let c=i.context.uniformState.view;return M.multiply(c,e._modelMatrix,vP),M.multiplyByPoint(vP,e.rtcCenter,wde),M.setTranslation(vP,wde,vP),vP}),a}function AGe(e,t,n,i,r,o,s,a){let c=Ide(e,t,n,a),u;l(e._depthFailAppearance)&&(u=Ide(e,e._depthFailAppearance,e._depthFailAppearance.material,a));let f=i?Ie.TRANSLUCENT:Ie.OPAQUE,d=r?2:1;d*=l(e._depthFailAppearance)?2:1,o.length=e._va.length*d;let p=o.length,g=0;for(let m=0;m<p;++m){let y;r&&(y=o[m],l(y)||(y=o[m]=new at({owner:e,primitiveType:e._primitiveType})),y.vertexArray=e._va[g],y.renderState=e._backFaceRS,y.shaderProgram=e._sp,y.uniformMap=c,y.pass=f,++m),y=o[m],l(y)||(y=o[m]=new at({owner:e,primitiveType:e._primitiveType})),y.vertexArray=e._va[g],y.renderState=e._frontFaceRS,y.shaderProgram=e._sp,y.uniformMap=c,y.pass=f,l(e._depthFailAppearance)&&(r&&(++m,y=o[m],l(y)||(y=o[m]=new at({owner:e,primitiveType:e._primitiveType})),y.vertexArray=e._va[g],y.renderState=e._backFaceDepthFailRS,y.shaderProgram=e._spDepthFail,y.uniformMap=u,y.pass=f),++m,y=o[m],l(y)||(y=o[m]=new at({owner:e,primitiveType:e._primitiveType})),y.vertexArray=e._va[g],y.renderState=e._frontFaceDepthFailRS,y.shaderProgram=e._spDepthFail,y.uniformMap=u,y.pass=f),++g}}qo._updateBoundingVolumes=function(e,t,n,i){let r,o,s;if(i||!M.equals(n,e._modelMatrix))for(M.clone(n,e._modelMatrix),o=e._boundingSpheres.length,r=0;r<o;++r)s=e._boundingSpheres[r],l(s)&&(e._boundingSphereWC[r]=ue.transform(s,n,e._boundingSphereWC[r]),t.scene3DOnly||(e._boundingSphere2D[r]=ue.clone(e._boundingSphereCV[r],e._boundingSphere2D[r]),e._boundingSphereMorph[r]=ue.union(e._boundingSphereWC[r],e._boundingSphereCV[r])));let a=e.appearance.pixelSize;if(l(a))for(o=e._boundingSpheres.length,r=0;r<o;++r){s=e._boundingSpheres[r];let c=e._boundingSphereWC[r],f=t.camera.getPixelSize(s,t.context.drawingBufferWidth,t.context.drawingBufferHeight)*a;c.radius=s.radius+f}};function bGe(e,t,n,i,r,o,s,a){qo._updateBoundingVolumes(e,t,r);let c;t.mode===re.SCENE3D?c=e._boundingSphereWC:t.mode===re.COLUMBUS_VIEW?c=e._boundingSphereCV:t.mode===re.SCENE2D&&l(e._boundingSphere2D)?c=e._boundingSphere2D:l(e._boundingSphereMorph)&&(c=e._boundingSphereMorph);let u=t.commandList,f=t.passes;if(f.render||f.pick){let d=e.allowPicking,p=Pn.castShadows(e.shadows),g=Pn.receiveShadows(e.shadows),m=n.length,y=a?2:1;y*=l(e._depthFailAppearance)?2:1;for(let A=0;A<m;++A){let b=Math.floor(A/y),x=n[A];x.modelMatrix=r,x.boundingVolume=c[b],x.cull=o,x.debugShowBoundingVolume=s,x.castShadows=p,x.receiveShadows=g,d?x.pickId="v_pickColor":x.pickId=void 0,u.push(x)}}}qo.prototype.update=function(e){if(!l(this.geometryInstances)&&this._va.length===0||l(this.geometryInstances)&&Array.isArray(this.geometryInstances)&&this.geometryInstances.length===0||!l(this.appearance)||e.mode!==re.SCENE3D&&e.scene3DOnly||!e.passes.render&&!e.passes.pick)return;if(l(this._error))throw this._error;if(this._state===us.FAILED)return;let t=e.context;if(l(this._batchTable)||nGe(this,t),this._batchTable.attributes.length>0){if(Ut.maximumVertexTextureImageUnits===0)throw new oe("Vertex texture fetch support is required to render primitives with per-instance attributes. The maximum number of vertex texture image units must be greater than zero.");this._batchTable.update(e)}if(this._state!==us.COMPLETE&&this._state!==us.COMBINED&&(this.asynchronous?fGe(this,e):dGe(this,e)),this._state===us.COMBINED&&(mGe(this,e),Sde(this,e),gGe(this,e)),!this.show||this._state!==us.COMPLETE)return;this._batchTableOffsetsUpdated||Sde(this,e),this._recomputeBoundingSpheres&&hGe(this,e);let n=this.appearance,i=n.material,r=!1,o=!1;this._appearance!==n?(this._appearance=n,this._material=i,r=!0,o=!0):this._material!==i&&(this._material=i,o=!0);let s=this.depthFailAppearance,a=l(s)?s.material:void 0;this._depthFailAppearance!==s?(this._depthFailAppearance=s,this._depthFailMaterial=a,r=!0,o=!0):this._depthFailMaterial!==a&&(this._depthFailMaterial=a,o=!0);let c=this._appearance.isTranslucent();this._translucent!==c&&(this._translucent=c,r=!0),l(this._material)&&this._material.update(t);let u=n.closed&&c;r&&(this._createRenderStatesFunction??_Ge)(this,t,n,u),o&&(this._createShaderProgramFunction??yGe)(this,e,n),(r||o)&&(this._createCommandsFunction??AGe)(this,n,i,c,u,this._colorCommands,this._pickCommands,e),(this._updateAndQueueCommandsFunction??bGe)(this,e,this._colorCommands,this._pickCommands,this.modelMatrix,this.cull,this.debugShowBoundingVolume,u)};var xGe=new ue,TGe=new ue;function Nde(e,t,n){if(n===pn.TOP){let i=ue.clone(e,xGe),r=ue.clone(e,TGe);r.center=h.add(r.center,t,r.center),e=ue.union(i,r,e)}else n===pn.ALL&&(e.center=h.add(e.center,t,e.center));return e}function EGe(e,t,n){return function(){let i=e.getBatchedAttribute(t,n),r=e.attributes[n],o=r.componentsPerAttribute,s=Y.createTypedArray(r.componentDatatype,o);return l(i.constructor.pack)?i.constructor.pack(i,s,0):s[0]=i,s}}function CGe(e,t,n,i,r){return function(o){let s=Dde(o);e.setBatchedAttribute(t,n,s),r==="offset"&&(i._recomputeBoundingSpheres=!0,i._batchTableOffsetsUpdated=!1)}}var vGe=new h;function SGe(e,t,n){t.boundingSphere={get:function(){let i=e._instanceBoundingSpheres[n];if(l(i)){i=i.clone();let r=e.modelMatrix,o=t.offset;l(o)&&Nde(i,h.fromArray(o.get(),0,vGe),e._offsetInstanceExtend[n]),l(r)&&(i=ue.transform(i,r))}return i}},t.boundingSphereCV={get:function(){return e._instanceBoundingSpheresCV[n]}}}function wGe(e,t,n){t.pickId={get:function(){return e._pickIds[n]}}}qo.prototype.getGeometryInstanceAttributes=function(e){let t=this._perInstanceAttributeCache.get(e);if(l(t))return t;let n=-1,i=this._lastPerInstanceAttributeIndex,r=this._instanceIds,o=r.length;for(let u=0;u<o;++u){let f=(i+u)%o;if(e===r[f]){n=f;break}}if(n===-1)return;let s=this._batchTable,a=this._batchTableAttributeIndices;t={};let c={};for(let u in a)if(a.hasOwnProperty(u)){let f=a[u];c[u]={get:EGe(s,n,f),set:CGe(s,n,f,this,u)}}return SGe(this,c,n),wGe(this,c,n),Object.defineProperties(t,c),this._lastPerInstanceAttributeIndex=n,this._perInstanceAttributeCache.set(e,t),t};qo.prototype.isDestroyed=function(){return!1};qo.prototype.destroy=function(){let e,t;this._sp=this._sp&&this._sp.destroy(),this._spDepthFail=this._spDepthFail&&this._spDepthFail.destroy();let n=this._va;for(e=n.length,t=0;t<e;++t)n[t].destroy();this._va=void 0;let i=this._pickIds;for(e=i.length,t=0;t<e;++t)i[t].destroy();return this._pickIds=void 0,this._batchTable=this._batchTable&&this._batchTable.destroy(),this._instanceIds=void 0,this._perInstanceAttributeCache=void 0,this._attributeLocations=void 0,le(this)};function SP(e,t,n,i){e._error=i,e._state=n,t.afterRender.push(function(){return e._ready=e._state===us.COMPLETE||e._state===us.FAILED,!0})}var Mn=qo;var Lde={NEVER:te.NEVER,LESS:te.LESS,EQUAL:te.EQUAL,LESS_OR_EQUAL:te.LEQUAL,GREATER:te.GREATER,NOT_EQUAL:te.NOTEQUAL,GREATER_OR_EQUAL:te.GEQUAL,ALWAYS:te.ALWAYS};Object.freeze(Lde);var ei=Lde;var Fde={ZERO:te.ZERO,KEEP:te.KEEP,REPLACE:te.REPLACE,INCREMENT:te.INCR,DECREMENT:te.DECR,INVERT:te.INVERT,INCREMENT_WRAP:te.INCR_WRAP,DECREMENT_WRAP:te.DECR_WRAP};Object.freeze(Fde);var Rt=Fde;var Lk={CESIUM_3D_TILE_MASK:128,SKIP_LOD_MASK:112,SKIP_LOD_BIT_SHIFT:4,CLASSIFICATION_MASK:15};Lk.setCesium3DTileBit=function(){return{enabled:!0,frontFunction:ei.ALWAYS,frontOperation:{fail:Rt.KEEP,zFail:Rt.KEEP,zPass:Rt.REPLACE},backFunction:ei.ALWAYS,backOperation:{fail:Rt.KEEP,zFail:Rt.KEEP,zPass:Rt.REPLACE},reference:Lk.CESIUM_3D_TILE_MASK,mask:Lk.CESIUM_3D_TILE_MASK}};var Xt=Object.freeze(Lk);function W0(e){e=e??H.EMPTY_OBJECT,this.geometryInstances=e.geometryInstances,this._hasPerInstanceColors=!0;let t=e.appearance;l(t)||(t=new yc),this.appearance=t,this.show=e.show??!0,this.classificationType=e.classificationType??Qn.BOTH,this.debugShowBoundingVolume=e.debugShowBoundingVolume??!1,this._debugShowShadowVolume=e.debugShowShadowVolume??!1,this._primitiveOptions={geometryInstances:void 0,appearance:void 0,vertexCacheOptimize:!1,interleave:e.interleave??!1,releaseGeometryInstances:e.releaseGeometryInstances??!0,allowPicking:e.allowPicking??!0,asynchronous:e.asynchronous??!0,compressVertices:!1,_createShaderProgramFunction:void 0,_createCommandsFunction:void 0,_updateAndQueueCommandsFunction:void 0},this._zIndex=void 0,this._ready=!1,this._primitive=void 0,this._sp=void 0,this._sp2D=void 0,this._spMorph=void 0,this._renderState=Bde(!1),this._renderState3DTiles=Bde(!0),this._renderStateMorph=Ge.fromCache({cull:{enabled:!0,face:Hi.FRONT},depthTest:{enabled:!0},blending:nn.PRE_MULTIPLIED_ALPHA_BLEND,depthMask:!1})}Object.defineProperties(W0.prototype,{interleave:{get:function(){return this._primitiveOptions.interleave}},releaseGeometryInstances:{get:function(){return this._primitiveOptions.releaseGeometryInstances}},allowPicking:{get:function(){return this._primitiveOptions.allowPicking}},asynchronous:{get:function(){return this._primitiveOptions.asynchronous}},ready:{get:function(){return this._ready}},debugShowShadowVolume:{get:function(){return this._debugShowShadowVolume}}});W0.initializeTerrainHeights=function(){return Ni.initialize()};function IGe(e,t,n){let i=t.context,r=e._primitive,o=r._attributeLocations,s=r._batchTable.getVertexShaderCallback()(j2);s=Mn._appendShowToShader(r,s),s=Mn._appendDistanceDisplayConditionToShader(r,s),s=Mn._modifyShaderPosition(e,s,t.scene3DOnly);let a=r._batchTable.getVertexShaderCallback()(V2);a=Mn._appendShowToShader(r,a),a=Mn._appendDistanceDisplayConditionToShader(r,a),a=Mn._modifyShaderPosition(e,a,t.scene3DOnly);let c=r._batchTable.getVertexShaderCallback()(U2),u=[`GLOBE_MINIMUM_ALTITUDE ${t.mapProjection.ellipsoid.minimumRadius.toFixed(1)}`],f="",d="";l(n.material)?(d=l(n.material)?n.material.shaderSource:"",d.search(/in\s+float\s+v_polylineAngle;/g)!==-1&&u.push("ANGLE_VARYING"),d.search(/in\s+float\s+v_width;/g)!==-1&&u.push("WIDTH_VARYING")):f="PER_INSTANCE_COLOR",u.push(f);let p=e.debugShowShadowVolume?["DEBUG_SHOW_VOLUME",f]:[f],g=new Xe({defines:u,sources:[s]}),m=new Xe({defines:p,sources:[d,c]});e._sp=Qt.replaceCache({context:i,shaderProgram:r._sp,vertexShaderSource:g,fragmentShaderSource:m,attributeLocations:o});let y=i.shaderCache.getDerivedShaderProgram(e._sp,"2dColor");if(!l(y)){let b=new Xe({defines:u.concat(["COLUMBUS_VIEW_2D"]),sources:[s]});y=i.shaderCache.createDerivedShaderProgram(e._sp,"2dColor",{context:i,shaderProgram:e._sp2D,vertexShaderSource:b,fragmentShaderSource:m,attributeLocations:o})}e._sp2D=y;let A=i.shaderCache.getDerivedShaderProgram(e._sp,"MorphColor");if(!l(A)){let b=new Xe({defines:u.concat([`MAX_TERRAIN_HEIGHT ${Ni._defaultMaxTerrainHeight.toFixed(1)}`]),sources:[a]});c=r._batchTable.getVertexShaderCallback()(z2);let x=new Xe({defines:p,sources:[d,c]});A=i.shaderCache.createDerivedShaderProgram(e._sp,"MorphColor",{context:i,shaderProgram:e._spMorph,vertexShaderSource:b,fragmentShaderSource:x,attributeLocations:o})}e._spMorph=A}function Bde(e){return Ge.fromCache({cull:{enabled:!0},blending:nn.PRE_MULTIPLIED_ALPHA_BLEND,depthMask:!1,stencilTest:{enabled:e,frontFunction:ei.EQUAL,frontOperation:{fail:Rt.KEEP,zFail:Rt.KEEP,zPass:Rt.KEEP},backFunction:ei.EQUAL,backOperation:{fail:Rt.KEEP,zFail:Rt.KEEP,zPass:Rt.KEEP},reference:Xt.CESIUM_3D_TILE_MASK,mask:Xt.CESIUM_3D_TILE_MASK}})}function PGe(e,t,n,i,r,o){let s=e._primitive,a=s._va.length;r.length=a,o.length=a;let u=t instanceof qs?{}:n._uniforms,f=s._batchTable.getUniformMapCallback()(u);for(let d=0;d<a;d++){let p=s._va[d],g=r[d];l(g)||(g=r[d]=new at({owner:e,primitiveType:s._primitiveType})),g.vertexArray=p,g.renderState=e._renderState,g.shaderProgram=e._sp,g.uniformMap=f,g.pass=Ie.TERRAIN_CLASSIFICATION,g.pickId="czm_batchTable_pickColor(v_endPlaneNormalEcAndBatchId.w)";let m=at.shallowClone(g,g.derivedCommands.tileset);m.renderState=e._renderState3DTiles,m.pass=Ie.CESIUM_3D_TILE_CLASSIFICATION,g.derivedCommands.tileset=m;let y=at.shallowClone(g,g.derivedCommands.color2D);y.shaderProgram=e._sp2D,g.derivedCommands.color2D=y;let A=at.shallowClone(m,m.derivedCommands.color2D);A.shaderProgram=e._sp2D,m.derivedCommands.color2D=A;let b=at.shallowClone(g,g.derivedCommands.colorMorph);b.renderState=e._renderStateMorph,b.shaderProgram=e._spMorph,b.pickId="czm_batchTable_pickColor(v_batchId)",g.derivedCommands.colorMorph=b}}function kde(e,t,n,i,r,o,s){n.mode===re.MORPHING?t=t.derivedCommands.colorMorph:n.mode!==re.SCENE3D&&(t=t.derivedCommands.color2D),t.modelMatrix=i,t.boundingVolume=o,t.cull=r,t.debugShowBoundingVolume=s,n.commandList.push(t)}function DGe(e,t,n,i,r,o,s){let a=e._primitive;Mn._updateBoundingVolumes(a,t,r);let c;t.mode===re.SCENE3D?c=a._boundingSphereWC:t.mode===re.COLUMBUS_VIEW?c=a._boundingSphereCV:t.mode===re.SCENE2D&&l(a._boundingSphere2D)?c=a._boundingSphere2D:l(a._boundingSphereMorph)&&(c=a._boundingSphereMorph);let u=t.mode===re.MORPHING,f=e.classificationType,d=f!==Qn.CESIUM_3D_TILE,p=f!==Qn.TERRAIN&&!u,g,m=t.passes;if(m.render||m.pick&&a.allowPicking){let y=n.length;for(let A=0;A<y;++A){let b=c[A];d&&(g=n[A],kde(e,g,t,r,o,b,s)),p&&(g=n[A].derivedCommands.tileset,kde(e,g,t,r,o,b,s))}}}W0.prototype.update=function(e){if(!l(this._primitive)&&!l(this.geometryInstances))return;if(!Ni.initialized){W0.initializeTerrainHeights();return}let t,n=this,i=this._primitiveOptions;if(!l(this._primitive)){let r=Array.isArray(this.geometryInstances)?this.geometryInstances:[this.geometryInstances],o=r.length,s=new Array(o),a;for(t=0;t<o;++t)if(a=r[t].attributes,!l(a)||!l(a.color)){this._hasPerInstanceColors=!1;break}for(t=0;t<o;++t){let c=r[t];a={};let u=c.attributes;for(let f in u)u.hasOwnProperty(f)&&(a[f]=u[f]);l(a.width)||(a.width=new Pl({componentDatatype:Y.UNSIGNED_BYTE,componentsPerAttribute:1,value:[c.geometry.width]})),c.geometry._scene3DOnly=e.scene3DOnly,JE.setProjectionAndEllipsoid(c.geometry,e.mapProjection),s[t]=new Bt({geometry:c.geometry,attributes:a,id:c.id,pickPrimitive:n})}i.geometryInstances=s,i.appearance=this.appearance,i._createShaderProgramFunction=function(c,u,f){IGe(n,u,f)},i._createCommandsFunction=function(c,u,f,d,p,g,m){PGe(n,u,f,d,g,m)},i._updateAndQueueCommandsFunction=function(c,u,f,d,p,g,m,y){DGe(n,u,f,d,p,g,m)},this._primitive=new Mn(i)}if(this.appearance instanceof qs&&!this._hasPerInstanceColors)throw new pe("All GeometryInstances must have color attributes to use PolylineColorAppearance with GroundPolylinePrimitive.");this._primitive.appearance=this.appearance,this._primitive.show=this.show,this._primitive.debugShowBoundingVolume=this.debugShowBoundingVolume,this._primitive.update(e),e.afterRender.push(()=>{!this._ready&&l(this._primitive)&&this._primitive.ready&&(this._ready=!0,this.releaseGeometryInstances&&(this.geometryInstances=void 0))})};W0.prototype.getGeometryInstanceAttributes=function(e){return this._primitive.getGeometryInstanceAttributes(e)};W0.isSupported=function(e){return e.frameState.context.depthTexture};W0.prototype.isDestroyed=function(){return!1};W0.prototype.destroy=function(){return this._primitive=this._primitive&&this._primitive.destroy(),this._sp=this._sp&&this._sp.destroy(),this._sp2D=void 0,this._spMorph=void 0,le(this)};var $m=W0;function Xa(e,t,n){this.minimum=h.clone(e??h.ZERO),this.maximum=h.clone(t??h.ZERO),l(n)?n=h.clone(n):n=h.midpoint(this.minimum,this.maximum,new h),this.center=n}Xa.fromCorners=function(e,t,n){return l(n)||(n=new Xa),n.minimum=h.clone(e,n.minimum),n.maximum=h.clone(t,n.maximum),n.center=h.midpoint(e,t,n.center),n};Xa.fromPoints=function(e,t){if(l(t)||(t=new Xa),!l(e)||e.length===0)return t.minimum=h.clone(h.ZERO,t.minimum),t.maximum=h.clone(h.ZERO,t.maximum),t.center=h.clone(h.ZERO,t.center),t;let n=e[0].x,i=e[0].y,r=e[0].z,o=e[0].x,s=e[0].y,a=e[0].z,c=e.length;for(let d=1;d<c;d++){let p=e[d],g=p.x,m=p.y,y=p.z;n=Math.min(g,n),o=Math.max(g,o),i=Math.min(m,i),s=Math.max(m,s),r=Math.min(y,r),a=Math.max(y,a)}let u=t.minimum;u.x=n,u.y=i,u.z=r;let f=t.maximum;return f.x=o,f.y=s,f.z=a,t.center=h.midpoint(u,f,t.center),t};Xa.clone=function(e,t){if(l(e))return l(t)?(t.minimum=h.clone(e.minimum,t.minimum),t.maximum=h.clone(e.maximum,t.maximum),t.center=h.clone(e.center,t.center),t):new Xa(e.minimum,e.maximum,e.center)};Xa.equals=function(e,t){return e===t||l(e)&&l(t)&&h.equals(e.center,t.center)&&h.equals(e.minimum,t.minimum)&&h.equals(e.maximum,t.maximum)};var Fk=new h;Xa.intersectPlane=function(e,t){Fk=h.subtract(e.maximum,e.minimum,Fk);let n=h.multiplyByScalar(Fk,.5,Fk),i=t.normal,r=n.x*Math.abs(i.x)+n.y*Math.abs(i.y)+n.z*Math.abs(i.z),o=h.dot(e.center,i)+t.distance;return o-r>0?$t.INSIDE:o+r<0?$t.OUTSIDE:$t.INTERSECTING};Xa.intersectAxisAlignedBoundingBox=function(e,t){return e.minimum.x<=t.maximum.x&&e.maximum.x>=t.minimum.x&&e.minimum.y<=t.maximum.y&&e.maximum.y>=t.minimum.y&&e.minimum.z<=t.maximum.z&&e.maximum.z>=t.minimum.z};Xa.prototype.clone=function(e){return Xa.clone(this,e)};Xa.prototype.intersectPlane=function(e){return Xa.intersectPlane(this,e)};Xa.prototype.intersectAxisAlignedBoundingBox=function(e){return Xa.intersectAxisAlignedBoundingBox(this,e)};Xa.prototype.equals=function(e){return Xa.equals(this,e)};var rd=Xa;var HX=new se;function Jm(e,t){t=t??ee.default,e=t.scaleToGeodeticSurface(e);let n=At.eastNorthUpToFixedFrame(e,t);this._ellipsoid=t,this._origin=e,this._xAxis=h.fromCartesian4(M.getColumn(n,0,HX)),this._yAxis=h.fromCartesian4(M.getColumn(n,1,HX));let i=h.fromCartesian4(M.getColumn(n,2,HX));this._plane=sn.fromPointNormal(e,i)}Object.defineProperties(Jm.prototype,{ellipsoid:{get:function(){return this._ellipsoid}},origin:{get:function(){return this._origin}},plane:{get:function(){return this._plane}},xAxis:{get:function(){return this._xAxis}},yAxis:{get:function(){return this._yAxis}},zAxis:{get:function(){return this._plane.normal}}});var RGe=new rd;Jm.fromPoints=function(e,t){let n=rd.fromPoints(e,RGe);return new Jm(n.center,t)};var Ude=new gn,Bk=new h;Jm.prototype.projectPointOntoPlane=function(e,t){let n=Ude;n.origin=e,h.normalize(e,n.direction);let i=xi.rayPlane(n,this._plane,Bk);if(l(i)||(h.negate(n.direction,n.direction),i=xi.rayPlane(n,this._plane,Bk)),l(i)){let r=h.subtract(i,this._origin,i),o=h.dot(this._xAxis,r),s=h.dot(this._yAxis,r);return l(t)?(t.x=o,t.y=s,t):new U(o,s)}};Jm.prototype.projectPointsOntoPlane=function(e,t){l(t)||(t=[]);let n=0,i=e.length;for(let r=0;r<i;r++){let o=this.projectPointOntoPlane(e[r],t[n]);l(o)&&(t[n]=o,n++)}return t.length=n,t};Jm.prototype.projectPointToNearestOnPlane=function(e,t){l(t)||(t=new U);let n=Ude;n.origin=e,h.clone(this._plane.normal,n.direction);let i=xi.rayPlane(n,this._plane,Bk);l(i)||(h.negate(n.direction,n.direction),i=xi.rayPlane(n,this._plane,Bk));let r=h.subtract(i,this._origin,i),o=h.dot(this._xAxis,r),s=h.dot(this._yAxis,r);return t.x=o,t.y=s,t};Jm.prototype.projectPointsToNearestOnPlane=function(e,t){l(t)||(t=[]);let n=e.length;t.length=n;for(let i=0;i<n;i++)t[i]=this.projectPointToNearestOnPlane(e[i],t[i]);return t};var OGe=new h;Jm.prototype.projectPointOntoEllipsoid=function(e,t){l(t)||(t=new h);let n=this._ellipsoid,i=this._origin,r=this._xAxis,o=this._yAxis,s=OGe;return h.multiplyByScalar(r,e.x,s),t=h.add(i,s,t),h.multiplyByScalar(o,e.y,s),h.add(t,s,t),n.scaleToGeocentricSurface(t,t),t};Jm.prototype.projectPointsOntoEllipsoid=function(e,t){let n=e.length;l(t)?t.length=n:t=new Array(n);for(let i=0;i<n;++i)t[i]=this.projectPointOntoEllipsoid(e[i],t[i]);return t};var Ys=Jm;function or(e,t){this.center=h.clone(e??h.ZERO),this.halfAxes=$.clone(t??$.ZERO)}or.packedLength=h.packedLength+$.packedLength;or.pack=function(e,t,n){return n=n??0,h.pack(e.center,t,n),$.pack(e.halfAxes,t,n+h.packedLength),t};or.unpack=function(e,t,n){return t=t??0,l(n)||(n=new or),h.unpack(e,t,n.center),$.unpack(e,t+h.packedLength,n.halfAxes),n};var MGe=new h,NGe=new h,LGe=new h,FGe=new h,BGe=new h,kGe=new h,UGe=new $,zGe={unitary:new $,diagonal:new $};or.fromPoints=function(e,t){if(l(t)||(t=new or),!l(e)||e.length===0)return t.halfAxes=$.ZERO,t.center=h.ZERO,t;let n,i=e.length,r=h.clone(e[0],MGe);for(n=1;n<i;n++)h.add(r,e[n],r);let o=1/i;h.multiplyByScalar(r,o,r);let s=0,a=0,c=0,u=0,f=0,d=0,p;for(n=0;n<i;n++)p=h.subtract(e[n],r,NGe),s+=p.x*p.x,a+=p.x*p.y,c+=p.x*p.z,u+=p.y*p.y,f+=p.y*p.z,d+=p.z*p.z;s*=o,a*=o,c*=o,u*=o,f*=o,d*=o;let g=UGe;g[0]=s,g[1]=a,g[2]=c,g[3]=a,g[4]=u,g[5]=f,g[6]=c,g[7]=f,g[8]=d;let m=$.computeEigenDecomposition(g,zGe),y=$.clone(m.unitary,t.halfAxes),A=$.getColumn(y,0,FGe),b=$.getColumn(y,1,BGe),x=$.getColumn(y,2,kGe),T=-Number.MAX_VALUE,E=-Number.MAX_VALUE,v=-Number.MAX_VALUE,S=Number.MAX_VALUE,I=Number.MAX_VALUE,R=Number.MAX_VALUE;for(n=0;n<i;n++)p=e[n],T=Math.max(h.dot(A,p),T),E=Math.max(h.dot(b,p),E),v=Math.max(h.dot(x,p),v),S=Math.min(h.dot(A,p),S),I=Math.min(h.dot(b,p),I),R=Math.min(h.dot(x,p),R);A=h.multiplyByScalar(A,.5*(S+T),A),b=h.multiplyByScalar(b,.5*(I+E),b),x=h.multiplyByScalar(x,.5*(R+v),x);let O=h.add(A,b,t.center);h.add(O,x,O);let L=LGe;return L.x=T-S,L.y=E-I,L.z=v-R,h.multiplyByScalar(L,.5,L),$.multiplyByScale(t.halfAxes,L,t.halfAxes),t};var Wde=new h,VGe=new h;function zde(e,t,n,i,r,o,s,a,c,u,f){l(f)||(f=new or);let d=f.halfAxes;$.setColumn(d,0,t,d),$.setColumn(d,1,n,d),$.setColumn(d,2,i,d);let p=Wde;p.x=(r+o)/2,p.y=(s+a)/2,p.z=(c+u)/2;let g=VGe;g.x=(o-r)/2,g.y=(a-s)/2,g.z=(u-c)/2;let m=f.center;return p=$.multiplyByVector(d,p,p),h.add(e,p,m),$.multiplyByScale(d,g,d),f}var Vde=new he,jGe=new h,HGe=new he,GGe=new he,WGe=new he,qGe=new he,YGe=new he,XGe=new h,jde=new h,KGe=new h,Hde=new h,$Ge=new h,JGe=new U,ZGe=new U,QGe=new U,e5e=new U,t5e=new U,n5e=new h,i5e=new h,r5e=new h,o5e=new h,s5e=new U,a5e=new h,c5e=new h,l5e=new h,u5e=new sn(h.UNIT_X,0);or.fromRectangle=function(e,t,n,i,r){t=t??0,n=n??0,i=i??ee.default;let o,s,a,c,u,f,d;if(e.width<=P.PI){let I=ie.center(e,Vde),R=i.cartographicToCartesian(I,jGe),O=new Ys(R,i);d=O.plane;let L=I.longitude,_=e.south<0&&e.north>0?0:I.latitude,C=he.fromRadians(L,e.north,n,HGe),w=he.fromRadians(e.west,e.north,n,GGe),D=he.fromRadians(e.west,_,n,WGe),N=he.fromRadians(e.west,e.south,n,qGe),F=he.fromRadians(L,e.south,n,YGe),V=i.cartographicToCartesian(C,XGe),B=i.cartographicToCartesian(w,jde),j=i.cartographicToCartesian(D,KGe),k=i.cartographicToCartesian(N,Hde),G=i.cartographicToCartesian(F,$Ge),q=O.projectPointToNearestOnPlane(V,JGe),Q=O.projectPointToNearestOnPlane(B,ZGe),W=O.projectPointToNearestOnPlane(j,QGe),J=O.projectPointToNearestOnPlane(k,e5e),Z=O.projectPointToNearestOnPlane(G,t5e);return o=Math.min(Q.x,W.x,J.x),s=-o,c=Math.max(Q.y,q.y),a=Math.min(J.y,Z.y),w.height=N.height=t,B=i.cartographicToCartesian(w,jde),k=i.cartographicToCartesian(N,Hde),u=Math.min(sn.getPointDistance(d,B),sn.getPointDistance(d,k)),f=n,zde(O.origin,O.xAxis,O.yAxis,O.zAxis,o,s,a,c,u,f,r)}let p=e.south>0,g=e.north<0,m=p?e.south:g?e.north:0,y=ie.center(e,Vde).longitude,A=h.fromRadians(y,m,n,i,n5e);A.z=0;let x=Math.abs(A.x)<P.EPSILON10&&Math.abs(A.y)<P.EPSILON10?h.UNIT_X:h.normalize(A,i5e),T=h.UNIT_Z,E=h.cross(x,T,r5e);d=sn.fromPointNormal(A,x,u5e);let v=h.fromRadians(y+P.PI_OVER_TWO,m,n,i,o5e);s=h.dot(sn.projectPointOntoPlane(d,v,s5e),E),o=-s,c=h.fromRadians(0,e.north,g?t:n,i,a5e).z,a=h.fromRadians(0,e.south,p?t:n,i,c5e).z;let S=h.fromRadians(e.east,m,n,i,l5e);return u=sn.getPointDistance(d,S),f=0,zde(A,E,T,x,o,s,a,c,u,f,r)};or.fromTransformation=function(e,t){return l(t)||(t=new or),t.center=M.getTranslation(e,t.center),t.halfAxes=M.getMatrix3(e,t.halfAxes),t.halfAxes=$.multiplyByScalar(t.halfAxes,.5,t.halfAxes),t};or.clone=function(e,t){if(l(e))return l(t)?(h.clone(e.center,t.center),$.clone(e.halfAxes,t.halfAxes),t):new or(e.center,e.halfAxes)};or.intersectPlane=function(e,t){let n=e.center,i=t.normal,r=e.halfAxes,o=i.x,s=i.y,a=i.z,c=Math.abs(o*r[$.COLUMN0ROW0]+s*r[$.COLUMN0ROW1]+a*r[$.COLUMN0ROW2])+Math.abs(o*r[$.COLUMN1ROW0]+s*r[$.COLUMN1ROW1]+a*r[$.COLUMN1ROW2])+Math.abs(o*r[$.COLUMN2ROW0]+s*r[$.COLUMN2ROW1]+a*r[$.COLUMN2ROW2]),u=h.dot(i,n)+t.distance;return u<=-c?$t.OUTSIDE:u>=c?$t.INSIDE:$t.INTERSECTING};var qde=new h,Yde=new h,Xde=new h,f5e=new h,Gde=new h,d5e=new h;or.distanceSquaredTo=function(e,t){let n=h.subtract(t,e.center,Wde),i=e.halfAxes,r=$.getColumn(i,0,qde),o=$.getColumn(i,1,Yde),s=$.getColumn(i,2,Xde),a=h.magnitude(r),c=h.magnitude(o),u=h.magnitude(s),f=!0,d=!0,p=!0;a>0?h.divideByScalar(r,a,r):f=!1,c>0?h.divideByScalar(o,c,o):d=!1,u>0?h.divideByScalar(s,u,s):p=!1;let g=!f+!d+!p,m,y,A;if(g===1){let E=r;m=o,y=s,d?p||(E=s,y=r):(E=o,m=r),A=h.cross(m,y,Gde),E===r?r=A:E===o?o=A:E===s&&(s=A)}else if(g===2){m=r,d?m=o:p&&(m=s);let E=h.UNIT_Y;E.equalsEpsilon(m,P.EPSILON3)&&(E=h.UNIT_X),y=h.cross(m,E,f5e),h.normalize(y,y),A=h.cross(m,y,Gde),h.normalize(A,A),m===r?(o=y,s=A):m===o?(s=y,r=A):m===s&&(r=y,o=A)}else g===3&&(r=h.UNIT_X,o=h.UNIT_Y,s=h.UNIT_Z);let b=d5e;b.x=h.dot(n,r),b.y=h.dot(n,o),b.z=h.dot(n,s);let x=0,T;return b.x<-a?(T=b.x+a,x+=T*T):b.x>a&&(T=b.x-a,x+=T*T),b.y<-c?(T=b.y+c,x+=T*T):b.y>c&&(T=b.y-c,x+=T*T),b.z<-u?(T=b.z+u,x+=T*T):b.z>u&&(T=b.z-u,x+=T*T),x};var h5e=new h,m5e=new h;or.computePlaneDistances=function(e,t,n,i){l(i)||(i=new Gs);let r=Number.POSITIVE_INFINITY,o=Number.NEGATIVE_INFINITY,s=e.center,a=e.halfAxes,c=$.getColumn(a,0,qde),u=$.getColumn(a,1,Yde),f=$.getColumn(a,2,Xde),d=h.add(c,u,h5e);h.add(d,f,d),h.add(d,s,d);let p=h.subtract(d,t,m5e),g=h.dot(n,p);return r=Math.min(g,r),o=Math.max(g,o),h.add(s,c,d),h.add(d,u,d),h.subtract(d,f,d),h.subtract(d,t,p),g=h.dot(n,p),r=Math.min(g,r),o=Math.max(g,o),h.add(s,c,d),h.subtract(d,u,d),h.add(d,f,d),h.subtract(d,t,p),g=h.dot(n,p),r=Math.min(g,r),o=Math.max(g,o),h.add(s,c,d),h.subtract(d,u,d),h.subtract(d,f,d),h.subtract(d,t,p),g=h.dot(n,p),r=Math.min(g,r),o=Math.max(g,o),h.subtract(s,c,d),h.add(d,u,d),h.add(d,f,d),h.subtract(d,t,p),g=h.dot(n,p),r=Math.min(g,r),o=Math.max(g,o),h.subtract(s,c,d),h.add(d,u,d),h.subtract(d,f,d),h.subtract(d,t,p),g=h.dot(n,p),r=Math.min(g,r),o=Math.max(g,o),h.subtract(s,c,d),h.subtract(d,u,d),h.add(d,f,d),h.subtract(d,t,p),g=h.dot(n,p),r=Math.min(g,r),o=Math.max(g,o),h.subtract(s,c,d),h.subtract(d,u,d),h.subtract(d,f,d),h.subtract(d,t,p),g=h.dot(n,p),r=Math.min(g,r),o=Math.max(g,o),i.start=r,i.stop=o,i};var p5e=new h,g5e=new h,_5e=new h;or.computeCorners=function(e,t){l(t)||(t=[new h,new h,new h,new h,new h,new h,new h,new h]);let n=e.center,i=e.halfAxes,r=$.getColumn(i,0,p5e),o=$.getColumn(i,1,g5e),s=$.getColumn(i,2,_5e);return h.clone(n,t[0]),h.subtract(t[0],r,t[0]),h.subtract(t[0],o,t[0]),h.subtract(t[0],s,t[0]),h.clone(n,t[1]),h.subtract(t[1],r,t[1]),h.subtract(t[1],o,t[1]),h.add(t[1],s,t[1]),h.clone(n,t[2]),h.subtract(t[2],r,t[2]),h.add(t[2],o,t[2]),h.subtract(t[2],s,t[2]),h.clone(n,t[3]),h.subtract(t[3],r,t[3]),h.add(t[3],o,t[3]),h.add(t[3],s,t[3]),h.clone(n,t[4]),h.add(t[4],r,t[4]),h.subtract(t[4],o,t[4]),h.subtract(t[4],s,t[4]),h.clone(n,t[5]),h.add(t[5],r,t[5]),h.subtract(t[5],o,t[5]),h.add(t[5],s,t[5]),h.clone(n,t[6]),h.add(t[6],r,t[6]),h.add(t[6],o,t[6]),h.subtract(t[6],s,t[6]),h.clone(n,t[7]),h.add(t[7],r,t[7]),h.add(t[7],o,t[7]),h.add(t[7],s,t[7]),t};var y5e=new $;or.computeTransformation=function(e,t){l(t)||(t=new M);let n=e.center,i=$.multiplyByUniformScale(e.halfAxes,2,y5e);return M.fromRotationTranslation(i,n,t)};var A5e=new ue;or.isOccluded=function(e,t){let n=ue.fromOrientedBoundingBox(e,A5e);return!t.isBoundingSphereVisible(n)};or.prototype.intersectPlane=function(e){return or.intersectPlane(this,e)};or.prototype.distanceSquaredTo=function(e){return or.distanceSquaredTo(this,e)};or.prototype.computePlaneDistances=function(e,t,n){return or.computePlaneDistances(this,e,t,n)};or.prototype.computeCorners=function(e){return or.computeCorners(this,e)};or.prototype.computeTransformation=function(e){return or.computeTransformation(this,e)};or.prototype.isOccluded=function(e){return or.isOccluded(this,e)};or.equals=function(e,t){return e===t||l(e)&&l(t)&&h.equals(e.center,t.center)&&$.equals(e.halfAxes,t.halfAxes)};or.prototype.clone=function(e){return or.clone(this,e)};or.prototype.equals=function(e){return or.equals(this,e)};var en=or;var kk={};kk.getHeight=function(e,t,n){return(e-n)*t+n};var b5e=new he;kk.getPosition=function(e,t,n,i,r){let o=t.cartesianToCartographic(e,b5e);if(!l(o))return h.clone(e,r);let s=kk.getHeight(o.height,n,i);return h.fromRadians(o.longitude,o.latitude,s,t,r)};var br=kk;function nC(e,t,n,i){e=e??1,t=t??1,n=n??1,i=i??1,this.value=new Uint8Array([z.floatToByte(e),z.floatToByte(t),z.floatToByte(n),z.floatToByte(i)])}Object.defineProperties(nC.prototype,{componentDatatype:{get:function(){return Y.UNSIGNED_BYTE}},componentsPerAttribute:{get:function(){return 4}},normalize:{get:function(){return!0}}});nC.fromColor=function(e){return new nC(e.red,e.green,e.blue,e.alpha)};nC.toValue=function(e,t){return l(t)?e.toBytes(t):new Uint8Array(e.toBytes())};nC.equals=function(e,t){return e===t||l(e)&&l(t)&&e.value[0]===t.value[0]&&e.value[1]===t.value[1]&&e.value[2]===t.value[2]&&e.value[3]===t.value[3]};var Jt=nC;var Uk=`in vec3 v_positionEC; +in vec3 v_normalEC; +in vec4 v_color; +void main() +{ +vec3 positionToEyeEC = -v_positionEC; +vec3 normalEC = normalize(v_normalEC); +#ifdef FACE_FORWARD +normalEC = faceforward(normalEC, vec3(0.0, 0.0, 1.0), -normalEC); +#endif +vec4 color = czm_gammaCorrect(v_color); +czm_materialInput materialInput; +materialInput.normalEC = normalEC; +materialInput.positionToEyeEC = positionToEyeEC; +czm_material material = czm_getDefaultMaterial(materialInput); +material.diffuse = color.rgb; +material.alpha = color.a; +out_FragColor = czm_phong(normalize(positionToEyeEC), material, czm_lightDirectionEC); +} +`;var zk=`in vec3 position3DHigh; in vec3 position3DLow; -in vec3 prevPosition3DHigh; -in vec3 prevPosition3DLow; -in vec3 nextPosition3DHigh; -in vec3 nextPosition3DLow; -in vec2 expandAndWidth; +in vec3 normal; in vec4 color; in float batchId; +out vec3 v_positionEC; +out vec3 v_normalEC; out vec4 v_color; void main() { -float expandDir = expandAndWidth.x; -float width = abs(expandAndWidth.y) + 0.5; -bool usePrev = expandAndWidth.y < 0.0; vec4 p = czm_computePosition(); -vec4 prev = czm_computePrevPosition(); -vec4 next = czm_computeNextPosition(); -float angle; -vec4 positionWC = getPolylineWindowCoordinates(p, prev, next, expandDir, width, usePrev, angle); -gl_Position = czm_viewportOrthographic * positionWC; +v_positionEC = (czm_modelViewRelativeToEye * p).xyz; +v_normalEC = czm_normal * normal; v_color = color; +gl_Position = czm_modelViewProjectionRelativeToEye * p; } -`;var b9e=`#define CLIP_POLYLINE -${du} -${Xk}`,x9e=QE;function Fb(e){e=e??H.EMPTY_OBJECT;let t=e.translucent??!0,n=!1,i=Fb.VERTEX_FORMAT;this.material=void 0,this.translucent=t,this._vertexShaderSource=e.vertexShaderSource??b9e,this._fragmentShaderSource=e.fragmentShaderSource??x9e,this._renderState=Rr.getDefaultRenderState(t,n,e.renderState),this._closed=n,this._vertexFormat=i}Object.defineProperties(Fb.prototype,{vertexShaderSource:{get:function(){return this._vertexShaderSource}},fragmentShaderSource:{get:function(){return this._fragmentShaderSource}},renderState:{get:function(){return this._renderState}},closed:{get:function(){return this._closed}},vertexFormat:{get:function(){return this._vertexFormat}}});Fb.VERTEX_FORMAT=Be.POSITION_ONLY;Fb.prototype.getFragmentShaderSource=Rr.prototype.getFragmentShaderSource;Fb.prototype.isTranslucent=Rr.prototype.isTranslucent;Fb.prototype.getRenderState=Rr.prototype.getRenderState;var Ys=Fb;var Kk=`in vec3 position3DHigh; +`;var Vk=`in vec3 position3DHigh; in vec3 position3DLow; -in vec3 prevPosition3DHigh; -in vec3 prevPosition3DLow; -in vec3 nextPosition3DHigh; -in vec3 nextPosition3DLow; -in vec2 expandAndWidth; -in vec2 st; +in vec4 color; in float batchId; -out float v_width; -out vec2 v_st; -out float v_polylineAngle; +out vec4 v_color; void main() { -float expandDir = expandAndWidth.x; -float width = abs(expandAndWidth.y) + 0.5; -bool usePrev = expandAndWidth.y < 0.0; vec4 p = czm_computePosition(); -vec4 prev = czm_computePrevPosition(); -vec4 next = czm_computeNextPosition(); -float angle; -vec4 positionWC = getPolylineWindowCoordinates(p, prev, next, expandDir, width, usePrev, angle); -gl_Position = czm_viewportOrthographic * positionWC; -v_width = width; -v_st.s = st.s; -v_st.t = czm_writeNonPerspective(st.t, gl_Position.w); -v_polylineAngle = angle; +v_color = color; +gl_Position = czm_modelViewProjectionRelativeToEye * p; } -`;var T9e=`#define CLIP_POLYLINE -${du} -${Kk}`,E9e=KE;function Bb(e){e=e??H.EMPTY_OBJECT;let t=e.translucent??!0,n=!1,i=Bb.VERTEX_FORMAT;this.material=l(e.material)?e.material:ir.fromType(ir.ColorType),this.translucent=t,this._vertexShaderSource=e.vertexShaderSource??T9e,this._fragmentShaderSource=e.fragmentShaderSource??E9e,this._renderState=Rr.getDefaultRenderState(t,n,e.renderState),this._closed=n,this._vertexFormat=i}Object.defineProperties(Bb.prototype,{vertexShaderSource:{get:function(){let e=this._vertexShaderSource;return this.material.shaderSource.search(/in\s+float\s+v_polylineAngle;/g)!==-1&&(e=`#define POLYLINE_DASH -${e}`),e}},fragmentShaderSource:{get:function(){return this._fragmentShaderSource}},renderState:{get:function(){return this._renderState}},closed:{get:function(){return this._closed}},vertexFormat:{get:function(){return this._vertexFormat}}});Bb.VERTEX_FORMAT=Be.POSITION_AND_ST;Bb.prototype.getFragmentShaderSource=Rr.prototype.getFragmentShaderSource;Bb.prototype.isTranslucent=Rr.prototype.isTranslucent;Bb.prototype.getRenderState=Rr.prototype.getRenderState;var Ac=Bb;function W0(e){e=e??H.EMPTY_OBJECT,this.geometryInstances=e.geometryInstances,this._hasPerInstanceColors=!0;let t=e.appearance;l(t)||(t=new Ac),this.appearance=t,this.show=e.show??!0,this.classificationType=e.classificationType??ei.BOTH,this.debugShowBoundingVolume=e.debugShowBoundingVolume??!1,this._debugShowShadowVolume=e.debugShowShadowVolume??!1,this._primitiveOptions={geometryInstances:void 0,appearance:void 0,vertexCacheOptimize:!1,interleave:e.interleave??!1,releaseGeometryInstances:e.releaseGeometryInstances??!0,allowPicking:e.allowPicking??!0,asynchronous:e.asynchronous??!0,compressVertices:!1,_createShaderProgramFunction:void 0,_createCommandsFunction:void 0,_updateAndQueueCommandsFunction:void 0},this._zIndex=void 0,this._ready=!1,this._primitive=void 0,this._sp=void 0,this._sp2D=void 0,this._spMorph=void 0,this._renderState=yhe(!1),this._renderState3DTiles=yhe(!0),this._renderStateMorph=Ge.fromCache({cull:{enabled:!0,face:Gi.FRONT},depthTest:{enabled:!0},blending:nn.PRE_MULTIPLIED_ALPHA_BLEND,depthMask:!1})}Object.defineProperties(W0.prototype,{interleave:{get:function(){return this._primitiveOptions.interleave}},releaseGeometryInstances:{get:function(){return this._primitiveOptions.releaseGeometryInstances}},allowPicking:{get:function(){return this._primitiveOptions.allowPicking}},asynchronous:{get:function(){return this._primitiveOptions.asynchronous}},ready:{get:function(){return this._ready}},debugShowShadowVolume:{get:function(){return this._debugShowShadowVolume}}});W0.initializeTerrainHeights=function(){return Ni.initialize()};function C9e(e,t,n){let i=t.context,r=e._primitive,o=r._attributeLocations,s=r._batchTable.getVertexShaderCallback()(j2);s=Mn._appendShowToShader(r,s),s=Mn._appendDistanceDisplayConditionToShader(r,s),s=Mn._modifyShaderPosition(e,s,t.scene3DOnly);let a=r._batchTable.getVertexShaderCallback()(V2);a=Mn._appendShowToShader(r,a),a=Mn._appendDistanceDisplayConditionToShader(r,a),a=Mn._modifyShaderPosition(e,a,t.scene3DOnly);let c=r._batchTable.getVertexShaderCallback()(U2),u=[`GLOBE_MINIMUM_ALTITUDE ${t.mapProjection.ellipsoid.minimumRadius.toFixed(1)}`],f="",d="";l(n.material)?(d=l(n.material)?n.material.shaderSource:"",d.search(/in\s+float\s+v_polylineAngle;/g)!==-1&&u.push("ANGLE_VARYING"),d.search(/in\s+float\s+v_width;/g)!==-1&&u.push("WIDTH_VARYING")):f="PER_INSTANCE_COLOR",u.push(f);let p=e.debugShowShadowVolume?["DEBUG_SHOW_VOLUME",f]:[f],g=new Xe({defines:u,sources:[s]}),m=new Xe({defines:p,sources:[d,c]});e._sp=Qt.replaceCache({context:i,shaderProgram:r._sp,vertexShaderSource:g,fragmentShaderSource:m,attributeLocations:o});let y=i.shaderCache.getDerivedShaderProgram(e._sp,"2dColor");if(!l(y)){let b=new Xe({defines:u.concat(["COLUMBUS_VIEW_2D"]),sources:[s]});y=i.shaderCache.createDerivedShaderProgram(e._sp,"2dColor",{context:i,shaderProgram:e._sp2D,vertexShaderSource:b,fragmentShaderSource:m,attributeLocations:o})}e._sp2D=y;let A=i.shaderCache.getDerivedShaderProgram(e._sp,"MorphColor");if(!l(A)){let b=new Xe({defines:u.concat([`MAX_TERRAIN_HEIGHT ${Ni._defaultMaxTerrainHeight.toFixed(1)}`]),sources:[a]});c=r._batchTable.getVertexShaderCallback()(z2);let x=new Xe({defines:p,sources:[d,c]});A=i.shaderCache.createDerivedShaderProgram(e._sp,"MorphColor",{context:i,shaderProgram:e._spMorph,vertexShaderSource:b,fragmentShaderSource:x,attributeLocations:o})}e._spMorph=A}function yhe(e){return Ge.fromCache({cull:{enabled:!0},blending:nn.PRE_MULTIPLIED_ALPHA_BLEND,depthMask:!1,stencilTest:{enabled:e,frontFunction:ti.EQUAL,frontOperation:{fail:Rt.KEEP,zFail:Rt.KEEP,zPass:Rt.KEEP},backFunction:ti.EQUAL,backOperation:{fail:Rt.KEEP,zFail:Rt.KEEP,zPass:Rt.KEEP},reference:Xt.CESIUM_3D_TILE_MASK,mask:Xt.CESIUM_3D_TILE_MASK}})}function v9e(e,t,n,i,r,o){let s=e._primitive,a=s._va.length;r.length=a,o.length=a;let u=t instanceof Ys?{}:n._uniforms,f=s._batchTable.getUniformMapCallback()(u);for(let d=0;d<a;d++){let p=s._va[d],g=r[d];l(g)||(g=r[d]=new at({owner:e,primitiveType:s._primitiveType})),g.vertexArray=p,g.renderState=e._renderState,g.shaderProgram=e._sp,g.uniformMap=f,g.pass=Ie.TERRAIN_CLASSIFICATION,g.pickId="czm_batchTable_pickColor(v_endPlaneNormalEcAndBatchId.w)";let m=at.shallowClone(g,g.derivedCommands.tileset);m.renderState=e._renderState3DTiles,m.pass=Ie.CESIUM_3D_TILE_CLASSIFICATION,g.derivedCommands.tileset=m;let y=at.shallowClone(g,g.derivedCommands.color2D);y.shaderProgram=e._sp2D,g.derivedCommands.color2D=y;let A=at.shallowClone(m,m.derivedCommands.color2D);A.shaderProgram=e._sp2D,m.derivedCommands.color2D=A;let b=at.shallowClone(g,g.derivedCommands.colorMorph);b.renderState=e._renderStateMorph,b.shaderProgram=e._spMorph,b.pickId="czm_batchTable_pickColor(v_batchId)",g.derivedCommands.colorMorph=b}}function Ahe(e,t,n,i,r,o,s){n.mode===re.MORPHING?t=t.derivedCommands.colorMorph:n.mode!==re.SCENE3D&&(t=t.derivedCommands.color2D),t.modelMatrix=i,t.boundingVolume=o,t.cull=r,t.debugShowBoundingVolume=s,n.commandList.push(t)}function S9e(e,t,n,i,r,o,s){let a=e._primitive;Mn._updateBoundingVolumes(a,t,r);let c;t.mode===re.SCENE3D?c=a._boundingSphereWC:t.mode===re.COLUMBUS_VIEW?c=a._boundingSphereCV:t.mode===re.SCENE2D&&l(a._boundingSphere2D)?c=a._boundingSphere2D:l(a._boundingSphereMorph)&&(c=a._boundingSphereMorph);let u=t.mode===re.MORPHING,f=e.classificationType,d=f!==ei.CESIUM_3D_TILE,p=f!==ei.TERRAIN&&!u,g,m=t.passes;if(m.render||m.pick&&a.allowPicking){let y=n.length;for(let A=0;A<y;++A){let b=c[A];d&&(g=n[A],Ahe(e,g,t,r,o,b,s)),p&&(g=n[A].derivedCommands.tileset,Ahe(e,g,t,r,o,b,s))}}}W0.prototype.update=function(e){if(!l(this._primitive)&&!l(this.geometryInstances))return;if(!Ni.initialized){W0.initializeTerrainHeights();return}let t,n=this,i=this._primitiveOptions;if(!l(this._primitive)){let r=Array.isArray(this.geometryInstances)?this.geometryInstances:[this.geometryInstances],o=r.length,s=new Array(o),a;for(t=0;t<o;++t)if(a=r[t].attributes,!l(a)||!l(a.color)){this._hasPerInstanceColors=!1;break}for(t=0;t<o;++t){let c=r[t];a={};let u=c.attributes;for(let f in u)u.hasOwnProperty(f)&&(a[f]=u[f]);l(a.width)||(a.width=new Pl({componentDatatype:Y.UNSIGNED_BYTE,componentsPerAttribute:1,value:[c.geometry.width]})),c.geometry._scene3DOnly=e.scene3DOnly,sC.setProjectionAndEllipsoid(c.geometry,e.mapProjection),s[t]=new Bt({geometry:c.geometry,attributes:a,id:c.id,pickPrimitive:n})}i.geometryInstances=s,i.appearance=this.appearance,i._createShaderProgramFunction=function(c,u,f){C9e(n,u,f)},i._createCommandsFunction=function(c,u,f,d,p,g,m){v9e(n,u,f,d,g,m)},i._updateAndQueueCommandsFunction=function(c,u,f,d,p,g,m,y){S9e(n,u,f,d,p,g,m)},this._primitive=new Mn(i)}if(this.appearance instanceof Ys&&!this._hasPerInstanceColors)throw new pe("All GeometryInstances must have color attributes to use PolylineColorAppearance with GroundPolylinePrimitive.");this._primitive.appearance=this.appearance,this._primitive.show=this.show,this._primitive.debugShowBoundingVolume=this.debugShowBoundingVolume,this._primitive.update(e),e.afterRender.push(()=>{!this._ready&&l(this._primitive)&&this._primitive.ready&&(this._ready=!0,this.releaseGeometryInstances&&(this.geometryInstances=void 0))})};W0.prototype.getGeometryInstanceAttributes=function(e){return this._primitive.getGeometryInstanceAttributes(e)};W0.isSupported=function(e){return e.frameState.context.depthTexture};W0.prototype.isDestroyed=function(){return!1};W0.prototype.destroy=function(){return this._primitive=this._primitive&&this._primitive.destroy(),this._sp=this._sp&&this._sp.destroy(),this._sp2D=void 0,this._spMorph=void 0,le(this)};var Qm=W0;var w9e=new U(1,1),I9e=!1,P9e=z.WHITE;function aC(e){e=e??H.EMPTY_OBJECT,this._definitionChanged=new be,this._image=void 0,this._imageSubscription=void 0,this._repeat=void 0,this._repeatSubscription=void 0,this._color=void 0,this._colorSubscription=void 0,this._transparent=void 0,this._transparentSubscription=void 0,this.image=e.image,this.repeat=e.repeat,this.color=e.color,this.transparent=e.transparent}Object.defineProperties(aC.prototype,{isConstant:{get:function(){return X.isConstant(this._image)&&X.isConstant(this._repeat)}},definitionChanged:{get:function(){return this._definitionChanged}},image:me("image"),repeat:me("repeat"),color:me("color"),transparent:me("transparent")});aC.prototype.getType=function(e){return"Image"};var D9e=new K;aC.prototype.getValue=function(e,t){return l(e)||(e=K.now(D9e)),l(t)||(t={}),t.image=X.getValueOrUndefined(this._image,e),t.repeat=X.getValueOrClonedDefault(this._repeat,e,w9e,t.repeat),t.color=X.getValueOrClonedDefault(this._color,e,P9e,t.color),X.getValueOrDefault(this._transparent,e,I9e)&&(t.color.alpha=Math.min(.99,t.color.alpha)),t};aC.prototype.equals=function(e){return this===e||e instanceof aC&&X.equals(this._image,e._image)&&X.equals(this._repeat,e._repeat)&&X.equals(this._color,e._color)&&X.equals(this._transparent,e._transparent)};var kb=aC;function R9e(e){if(e instanceof z)return new Kt(e);if(typeof e=="string"||e instanceof De||e instanceof HTMLCanvasElement||e instanceof HTMLVideoElement){let t=new kb;return t.image=e,t}}function O9e(e,t){return me(e,t,R9e)}var fo=O9e;function RP(e){this._definitionChanged=new be,this._show=void 0,this._showSubscription=void 0,this._dimensions=void 0,this._dimensionsSubscription=void 0,this._heightReference=void 0,this._heightReferenceSubscription=void 0,this._fill=void 0,this._fillSubscription=void 0,this._material=void 0,this._materialSubscription=void 0,this._outline=void 0,this._outlineSubscription=void 0,this._outlineColor=void 0,this._outlineColorSubscription=void 0,this._outlineWidth=void 0,this._outlineWidthSubscription=void 0,this._shadows=void 0,this._shadowsSubscription=void 0,this._distanceDisplayCondition=void 0,this._distanceDisplayConditionSubscription=void 0,this.merge(e??H.EMPTY_OBJECT)}Object.defineProperties(RP.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:me("show"),dimensions:me("dimensions"),heightReference:me("heightReference"),fill:me("fill"),material:fo("material"),outline:me("outline"),outlineColor:me("outlineColor"),outlineWidth:me("outlineWidth"),shadows:me("shadows"),distanceDisplayCondition:me("distanceDisplayCondition")});RP.prototype.clone=function(e){return l(e)?(e.show=this.show,e.dimensions=this.dimensions,e.heightReference=this.heightReference,e.fill=this.fill,e.material=this.material,e.outline=this.outline,e.outlineColor=this.outlineColor,e.outlineWidth=this.outlineWidth,e.shadows=this.shadows,e.distanceDisplayCondition=this.distanceDisplayCondition,e):new RP(this)};RP.prototype.merge=function(e){this.show=this.show??e.show,this.dimensions=this.dimensions??e.dimensions,this.heightReference=this.heightReference??e.heightReference,this.fill=this.fill??e.fill,this.material=this.material??e.material,this.outline=this.outline??e.outline,this.outlineColor=this.outlineColor??e.outlineColor,this.outlineWidth=this.outlineWidth??e.outlineWidth,this.shadows=this.shadows??e.shadows,this.distanceDisplayCondition=this.distanceDisplayCondition??e.distanceDisplayCondition};var cC=RP;var bhe={FIXED:0,INERTIAL:1};Object.freeze(bhe);var Wi=bhe;function lC(){pe.throwInstantiationError()}Object.defineProperties(lC.prototype,{isConstant:{get:pe.throwInstantiationError},definitionChanged:{get:pe.throwInstantiationError},referenceFrame:{get:pe.throwInstantiationError}});lC.prototype.getValue=pe.throwInstantiationError;lC.prototype.getValueInReferenceFrame=pe.throwInstantiationError;lC.prototype.equals=pe.throwInstantiationError;var xhe=new $;lC.convertToReferenceFrame=function(e,t,n,i,r){if(!l(t))return t;if(l(r)||(r=new h),n===i)return h.clone(t,r);let o=At.computeIcrfToCentralBodyFixedMatrix(e,xhe);if(n===Wi.INERTIAL)return $.multiplyByVector(o,t,r);if(n===Wi.FIXED)return $.multiplyByVector($.transpose(o,xhe),t,r)};var ep=lC;function Ub(e,t){this._definitionChanged=new be,this._value=h.clone(e),this._referenceFrame=t??Wi.FIXED}Object.defineProperties(Ub.prototype,{isConstant:{get:function(){return!l(this._value)||this._referenceFrame===Wi.FIXED}},definitionChanged:{get:function(){return this._definitionChanged}},referenceFrame:{get:function(){return this._referenceFrame}}});var M9e=new K;Ub.prototype.getValue=function(e,t){return l(e)||(e=K.now(M9e)),this.getValueInReferenceFrame(e,Wi.FIXED,t)};Ub.prototype.setValue=function(e,t){let n=!1;h.equals(this._value,e)||(n=!0,this._value=h.clone(e)),l(t)&&this._referenceFrame!==t&&(n=!0,this._referenceFrame=t),n&&this._definitionChanged.raiseEvent(this)};Ub.prototype.getValueInReferenceFrame=function(e,t,n){return ep.convertToReferenceFrame(e,this._value,this._referenceFrame,t,n)};Ub.prototype.equals=function(e){return this===e||e instanceof Ub&&h.equals(this._value,e._value)&&this._referenceFrame===e._referenceFrame};var gu=Ub;function OP(e){this._definitionChanged=new be,this._show=void 0,this._showSubscription=void 0,this._positions=void 0,this._positionsSubscription=void 0,this._width=void 0,this._widthSubscription=void 0,this._height=void 0,this._heightSubscription=void 0,this._heightReference=void 0,this._heightReferenceSubscription=void 0,this._extrudedHeight=void 0,this._extrudedHeightSubscription=void 0,this._extrudedHeightReference=void 0,this._extrudedHeightReferenceSubscription=void 0,this._cornerType=void 0,this._cornerTypeSubscription=void 0,this._granularity=void 0,this._granularitySubscription=void 0,this._fill=void 0,this._fillSubscription=void 0,this._material=void 0,this._materialSubscription=void 0,this._outline=void 0,this._outlineSubscription=void 0,this._outlineColor=void 0,this._outlineColorSubscription=void 0,this._outlineWidth=void 0,this._outlineWidthSubscription=void 0,this._shadows=void 0,this._shadowsSubscription=void 0,this._distanceDisplayCondition=void 0,this._distanceDisplayConditionSubscription=void 0,this._classificationType=void 0,this._classificationTypeSubscription=void 0,this._zIndex=void 0,this._zIndexSubscription=void 0,this.merge(e??H.EMPTY_OBJECT)}Object.defineProperties(OP.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:me("show"),positions:me("positions"),width:me("width"),height:me("height"),heightReference:me("heightReference"),extrudedHeight:me("extrudedHeight"),extrudedHeightReference:me("extrudedHeightReference"),cornerType:me("cornerType"),granularity:me("granularity"),fill:me("fill"),material:fo("material"),outline:me("outline"),outlineColor:me("outlineColor"),outlineWidth:me("outlineWidth"),shadows:me("shadows"),distanceDisplayCondition:me("distanceDisplayCondition"),classificationType:me("classificationType"),zIndex:me("zIndex")});OP.prototype.clone=function(e){return l(e)?(e.show=this.show,e.positions=this.positions,e.width=this.width,e.height=this.height,e.heightReference=this.heightReference,e.extrudedHeight=this.extrudedHeight,e.extrudedHeightReference=this.extrudedHeightReference,e.cornerType=this.cornerType,e.granularity=this.granularity,e.fill=this.fill,e.material=this.material,e.outline=this.outline,e.outlineColor=this.outlineColor,e.outlineWidth=this.outlineWidth,e.shadows=this.shadows,e.distanceDisplayCondition=this.distanceDisplayCondition,e.classificationType=this.classificationType,e.zIndex=this.zIndex,e):new OP(this)};OP.prototype.merge=function(e){this.show=this.show??e.show,this.positions=this.positions??e.positions,this.width=this.width??e.width,this.height=this.height??e.height,this.heightReference=this.heightReference??e.heightReference,this.extrudedHeight=this.extrudedHeight??e.extrudedHeight,this.extrudedHeightReference=this.extrudedHeightReference??e.extrudedHeightReference,this.cornerType=this.cornerType??e.cornerType,this.granularity=this.granularity??e.granularity,this.fill=this.fill??e.fill,this.material=this.material??e.material,this.outline=this.outline??e.outline,this.outlineColor=this.outlineColor??e.outlineColor,this.outlineWidth=this.outlineWidth??e.outlineWidth,this.shadows=this.shadows??e.shadows,this.distanceDisplayCondition=this.distanceDisplayCondition??e.distanceDisplayCondition,this.classificationType=this.classificationType??e.classificationType,this.zIndex=this.zIndex??e.zIndex};var uC=OP;function N9e(e){return e}function L9e(e,t){return me(e,t,N9e)}var _u=L9e;function MP(e){this._definitionChanged=new be,this._show=void 0,this._showSubscription=void 0,this._length=void 0,this._lengthSubscription=void 0,this._topRadius=void 0,this._topRadiusSubscription=void 0,this._bottomRadius=void 0,this._bottomRadiusSubscription=void 0,this._heightReference=void 0,this._heightReferenceSubscription=void 0,this._fill=void 0,this._fillSubscription=void 0,this._material=void 0,this._materialSubscription=void 0,this._outline=void 0,this._outlineSubscription=void 0,this._outlineColor=void 0,this._outlineColorSubscription=void 0,this._outlineWidth=void 0,this._outlineWidthSubscription=void 0,this._numberOfVerticalLines=void 0,this._numberOfVerticalLinesSubscription=void 0,this._slices=void 0,this._slicesSubscription=void 0,this._shadows=void 0,this._shadowsSubscription=void 0,this._distanceDisplayCondition=void 0,this._distanceDisplayConditionSubscription=void 0,this.merge(e??H.EMPTY_OBJECT)}Object.defineProperties(MP.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:me("show"),length:me("length"),topRadius:me("topRadius"),bottomRadius:me("bottomRadius"),heightReference:me("heightReference"),fill:me("fill"),material:fo("material"),outline:me("outline"),outlineColor:me("outlineColor"),outlineWidth:me("outlineWidth"),numberOfVerticalLines:me("numberOfVerticalLines"),slices:me("slices"),shadows:me("shadows"),distanceDisplayCondition:me("distanceDisplayCondition")});MP.prototype.clone=function(e){return l(e)?(e.show=this.show,e.length=this.length,e.topRadius=this.topRadius,e.bottomRadius=this.bottomRadius,e.heightReference=this.heightReference,e.fill=this.fill,e.material=this.material,e.outline=this.outline,e.outlineColor=this.outlineColor,e.outlineWidth=this.outlineWidth,e.numberOfVerticalLines=this.numberOfVerticalLines,e.slices=this.slices,e.shadows=this.shadows,e.distanceDisplayCondition=this.distanceDisplayCondition,e):new MP(this)};MP.prototype.merge=function(e){this.show=this.show??e.show,this.length=this.length??e.length,this.topRadius=this.topRadius??e.topRadius,this.bottomRadius=this.bottomRadius??e.bottomRadius,this.heightReference=this.heightReference??e.heightReference,this.fill=this.fill??e.fill,this.material=this.material??e.material,this.outline=this.outline??e.outline,this.outlineColor=this.outlineColor??e.outlineColor,this.outlineWidth=this.outlineWidth??e.outlineWidth,this.numberOfVerticalLines=this.numberOfVerticalLines??e.numberOfVerticalLines,this.slices=this.slices??e.slices,this.shadows=this.shadows??e.shadows,this.distanceDisplayCondition=this.distanceDisplayCondition??e.distanceDisplayCondition};var fC=MP;function NP(e){this._definitionChanged=new be,this._show=void 0,this._showSubscription=void 0,this._semiMajorAxis=void 0,this._semiMajorAxisSubscription=void 0,this._semiMinorAxis=void 0,this._semiMinorAxisSubscription=void 0,this._height=void 0,this._heightSubscription=void 0,this._heightReference=void 0,this._heightReferenceSubscription=void 0,this._extrudedHeight=void 0,this._extrudedHeightSubscription=void 0,this._extrudedHeightReference=void 0,this._extrudedHeightReferenceSubscription=void 0,this._rotation=void 0,this._rotationSubscription=void 0,this._stRotation=void 0,this._stRotationSubscription=void 0,this._granularity=void 0,this._granularitySubscription=void 0,this._fill=void 0,this._fillSubscription=void 0,this._material=void 0,this._materialSubscription=void 0,this._outline=void 0,this._outlineSubscription=void 0,this._outlineColor=void 0,this._outlineColorSubscription=void 0,this._outlineWidth=void 0,this._outlineWidthSubscription=void 0,this._numberOfVerticalLines=void 0,this._numberOfVerticalLinesSubscription=void 0,this._shadows=void 0,this._shadowsSubscription=void 0,this._distanceDisplayCondition=void 0,this._distanceDisplayConditionSubscription=void 0,this._classificationType=void 0,this._classificationTypeSubscription=void 0,this._zIndex=void 0,this._zIndexSubscription=void 0,this.merge(e??H.EMPTY_OBJECT)}Object.defineProperties(NP.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:me("show"),semiMajorAxis:me("semiMajorAxis"),semiMinorAxis:me("semiMinorAxis"),height:me("height"),heightReference:me("heightReference"),extrudedHeight:me("extrudedHeight"),extrudedHeightReference:me("extrudedHeightReference"),rotation:me("rotation"),stRotation:me("stRotation"),granularity:me("granularity"),fill:me("fill"),material:fo("material"),outline:me("outline"),outlineColor:me("outlineColor"),outlineWidth:me("outlineWidth"),numberOfVerticalLines:me("numberOfVerticalLines"),shadows:me("shadows"),distanceDisplayCondition:me("distanceDisplayCondition"),classificationType:me("classificationType"),zIndex:me("zIndex")});NP.prototype.clone=function(e){return l(e)?(e.show=this.show,e.semiMajorAxis=this.semiMajorAxis,e.semiMinorAxis=this.semiMinorAxis,e.height=this.height,e.heightReference=this.heightReference,e.extrudedHeight=this.extrudedHeight,e.extrudedHeightReference=this.extrudedHeightReference,e.rotation=this.rotation,e.stRotation=this.stRotation,e.granularity=this.granularity,e.fill=this.fill,e.material=this.material,e.outline=this.outline,e.outlineColor=this.outlineColor,e.outlineWidth=this.outlineWidth,e.numberOfVerticalLines=this.numberOfVerticalLines,e.shadows=this.shadows,e.distanceDisplayCondition=this.distanceDisplayCondition,e.classificationType=this.classificationType,e.zIndex=this.zIndex,e):new NP(this)};NP.prototype.merge=function(e){this.show=this.show??e.show,this.semiMajorAxis=this.semiMajorAxis??e.semiMajorAxis,this.semiMinorAxis=this.semiMinorAxis??e.semiMinorAxis,this.height=this.height??e.height,this.heightReference=this.heightReference??e.heightReference,this.extrudedHeight=this.extrudedHeight??e.extrudedHeight,this.extrudedHeightReference=this.extrudedHeightReference??e.extrudedHeightReference,this.rotation=this.rotation??e.rotation,this.stRotation=this.stRotation??e.stRotation,this.granularity=this.granularity??e.granularity,this.fill=this.fill??e.fill,this.material=this.material??e.material,this.outline=this.outline??e.outline,this.outlineColor=this.outlineColor??e.outlineColor,this.outlineWidth=this.outlineWidth??e.outlineWidth,this.numberOfVerticalLines=this.numberOfVerticalLines??e.numberOfVerticalLines,this.shadows=this.shadows??e.shadows,this.distanceDisplayCondition=this.distanceDisplayCondition??e.distanceDisplayCondition,this.classificationType=this.classificationType??e.classificationType,this.zIndex=this.zIndex??e.zIndex};var dC=NP;function LP(e){this._definitionChanged=new be,this._show=void 0,this._showSubscription=void 0,this._radii=void 0,this._radiiSubscription=void 0,this._innerRadii=void 0,this._innerRadiiSubscription=void 0,this._minimumClock=void 0,this._minimumClockSubscription=void 0,this._maximumClock=void 0,this._maximumClockSubscription=void 0,this._minimumCone=void 0,this._minimumConeSubscription=void 0,this._maximumCone=void 0,this._maximumConeSubscription=void 0,this._heightReference=void 0,this._heightReferenceSubscription=void 0,this._fill=void 0,this._fillSubscription=void 0,this._material=void 0,this._materialSubscription=void 0,this._outline=void 0,this._outlineSubscription=void 0,this._outlineColor=void 0,this._outlineColorSubscription=void 0,this._outlineWidth=void 0,this._outlineWidthSubscription=void 0,this._stackPartitions=void 0,this._stackPartitionsSubscription=void 0,this._slicePartitions=void 0,this._slicePartitionsSubscription=void 0,this._subdivisions=void 0,this._subdivisionsSubscription=void 0,this._shadows=void 0,this._shadowsSubscription=void 0,this._distanceDisplayCondition=void 0,this._distanceDisplayConditionSubscription=void 0,this.merge(e??H.EMPTY_OBJECT)}Object.defineProperties(LP.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:me("show"),radii:me("radii"),innerRadii:me("innerRadii"),minimumClock:me("minimumClock"),maximumClock:me("maximumClock"),minimumCone:me("minimumCone"),maximumCone:me("maximumCone"),heightReference:me("heightReference"),fill:me("fill"),material:fo("material"),outline:me("outline"),outlineColor:me("outlineColor"),outlineWidth:me("outlineWidth"),stackPartitions:me("stackPartitions"),slicePartitions:me("slicePartitions"),subdivisions:me("subdivisions"),shadows:me("shadows"),distanceDisplayCondition:me("distanceDisplayCondition")});LP.prototype.clone=function(e){return l(e)?(e.show=this.show,e.radii=this.radii,e.innerRadii=this.innerRadii,e.minimumClock=this.minimumClock,e.maximumClock=this.maximumClock,e.minimumCone=this.minimumCone,e.maximumCone=this.maximumCone,e.heightReference=this.heightReference,e.fill=this.fill,e.material=this.material,e.outline=this.outline,e.outlineColor=this.outlineColor,e.outlineWidth=this.outlineWidth,e.stackPartitions=this.stackPartitions,e.slicePartitions=this.slicePartitions,e.subdivisions=this.subdivisions,e.shadows=this.shadows,e.distanceDisplayCondition=this.distanceDisplayCondition,e):new LP(this)};LP.prototype.merge=function(e){this.show=this.show??e.show,this.radii=this.radii??e.radii,this.innerRadii=this.innerRadii??e.innerRadii,this.minimumClock=this.minimumClock??e.minimumClock,this.maximumClock=this.maximumClock??e.maximumClock,this.minimumCone=this.minimumCone??e.minimumCone,this.maximumCone=this.maximumCone??e.maximumCone,this.heightReference=this.heightReference??e.heightReference,this.fill=this.fill??e.fill,this.material=this.material??e.material,this.outline=this.outline??e.outline,this.outlineColor=this.outlineColor??e.outlineColor,this.outlineWidth=this.outlineWidth??e.outlineWidth,this.stackPartitions=this.stackPartitions??e.stackPartitions,this.slicePartitions=this.slicePartitions??e.slicePartitions,this.subdivisions=this.subdivisions??e.subdivisions,this.shadows=this.shadows??e.shadows,this.distanceDisplayCondition=this.distanceDisplayCondition??e.distanceDisplayCondition};var hC=LP;function FP(e){this._definitionChanged=new be,this._show=void 0,this._showSubscription=void 0,this._text=void 0,this._textSubscription=void 0,this._font=void 0,this._fontSubscription=void 0,this._style=void 0,this._styleSubscription=void 0,this._scale=void 0,this._scaleSubscription=void 0,this._showBackground=void 0,this._showBackgroundSubscription=void 0,this._backgroundColor=void 0,this._backgroundColorSubscription=void 0,this._backgroundPadding=void 0,this._backgroundPaddingSubscription=void 0,this._pixelOffset=void 0,this._pixelOffsetSubscription=void 0,this._eyeOffset=void 0,this._eyeOffsetSubscription=void 0,this._horizontalOrigin=void 0,this._horizontalOriginSubscription=void 0,this._verticalOrigin=void 0,this._verticalOriginSubscription=void 0,this._heightReference=void 0,this._heightReferenceSubscription=void 0,this._fillColor=void 0,this._fillColorSubscription=void 0,this._outlineColor=void 0,this._outlineColorSubscription=void 0,this._outlineWidth=void 0,this._outlineWidthSubscription=void 0,this._translucencyByDistance=void 0,this._translucencyByDistanceSubscription=void 0,this._pixelOffsetScaleByDistance=void 0,this._pixelOffsetScaleByDistanceSubscription=void 0,this._scaleByDistance=void 0,this._scaleByDistanceSubscription=void 0,this._distanceDisplayCondition=void 0,this._distanceDisplayConditionSubscription=void 0,this._disableDepthTestDistance=void 0,this._disableDepthTestDistanceSubscription=void 0,this.merge(e??H.EMPTY_OBJECT)}Object.defineProperties(FP.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:me("show"),text:me("text"),font:me("font"),style:me("style"),scale:me("scale"),showBackground:me("showBackground"),backgroundColor:me("backgroundColor"),backgroundPadding:me("backgroundPadding"),pixelOffset:me("pixelOffset"),eyeOffset:me("eyeOffset"),horizontalOrigin:me("horizontalOrigin"),verticalOrigin:me("verticalOrigin"),heightReference:me("heightReference"),fillColor:me("fillColor"),outlineColor:me("outlineColor"),outlineWidth:me("outlineWidth"),translucencyByDistance:me("translucencyByDistance"),pixelOffsetScaleByDistance:me("pixelOffsetScaleByDistance"),scaleByDistance:me("scaleByDistance"),distanceDisplayCondition:me("distanceDisplayCondition"),disableDepthTestDistance:me("disableDepthTestDistance")});FP.prototype.clone=function(e){return l(e)?(e.show=this.show,e.text=this.text,e.font=this.font,e.style=this.style,e.scale=this.scale,e.showBackground=this.showBackground,e.backgroundColor=this.backgroundColor,e.backgroundPadding=this.backgroundPadding,e.pixelOffset=this.pixelOffset,e.eyeOffset=this.eyeOffset,e.horizontalOrigin=this.horizontalOrigin,e.verticalOrigin=this.verticalOrigin,e.heightReference=this.heightReference,e.fillColor=this.fillColor,e.outlineColor=this.outlineColor,e.outlineWidth=this.outlineWidth,e.translucencyByDistance=this.translucencyByDistance,e.pixelOffsetScaleByDistance=this.pixelOffsetScaleByDistance,e.scaleByDistance=this.scaleByDistance,e.distanceDisplayCondition=this.distanceDisplayCondition,e.disableDepthTestDistance=this.disableDepthTestDistance,e):new FP(this)};FP.prototype.merge=function(e){this.show=this.show??e.show,this.text=this.text??e.text,this.font=this.font??e.font,this.style=this.style??e.style,this.scale=this.scale??e.scale,this.showBackground=this.showBackground??e.showBackground,this.backgroundColor=this.backgroundColor??e.backgroundColor,this.backgroundPadding=this.backgroundPadding??e.backgroundPadding,this.pixelOffset=this.pixelOffset??e.pixelOffset,this.eyeOffset=this.eyeOffset??e.eyeOffset,this.horizontalOrigin=this.horizontalOrigin??e.horizontalOrigin,this.verticalOrigin=this.verticalOrigin??e.verticalOrigin,this.heightReference=this.heightReference??e.heightReference,this.fillColor=this.fillColor??e.fillColor,this.outlineColor=this.outlineColor??e.outlineColor,this.outlineWidth=this.outlineWidth??e.outlineWidth,this.translucencyByDistance=this.translucencyByDistance??e.translucencyByDistance,this.pixelOffsetScaleByDistance=this.pixelOffsetScaleByDistance??e.pixelOffsetScaleByDistance,this.scaleByDistance=this.scaleByDistance??e.scaleByDistance,this.distanceDisplayCondition=this.distanceDisplayCondition??e.distanceDisplayCondition,this.disableDepthTestDistance=this.disableDepthTestDistance??e.disableDepthTestDistance};var tp=FP;var F9e=new h(1,1,1),B9e=h.ZERO,k9e=Le.IDENTITY;function The(e,t,n){this.translation=h.clone(e??B9e),this.rotation=Le.clone(t??k9e),this.scale=h.clone(n??F9e)}The.prototype.equals=function(e){return this===e||l(e)&&h.equals(this.translation,e.translation)&&Le.equals(this.rotation,e.rotation)&&h.equals(this.scale,e.scale)};var zb=The;var YX=new zb;function BP(e){e=e??H.EMPTY_OBJECT,this._definitionChanged=new be,this._translation=void 0,this._translationSubscription=void 0,this._rotation=void 0,this._rotationSubscription=void 0,this._scale=void 0,this._scaleSubscription=void 0,this.translation=e.translation,this.rotation=e.rotation,this.scale=e.scale}Object.defineProperties(BP.prototype,{isConstant:{get:function(){return X.isConstant(this._translation)&&X.isConstant(this._rotation)&&X.isConstant(this._scale)}},definitionChanged:{get:function(){return this._definitionChanged}},translation:me("translation"),rotation:me("rotation"),scale:me("scale")});var U9e=new K;BP.prototype.getValue=function(e,t){return l(e)||(e=K.now(U9e)),l(t)||(t=new zb),t.translation=X.getValueOrClonedDefault(this._translation,e,YX.translation,t.translation),t.rotation=X.getValueOrClonedDefault(this._rotation,e,YX.rotation,t.rotation),t.scale=X.getValueOrClonedDefault(this._scale,e,YX.scale,t.scale),t};BP.prototype.equals=function(e){return this===e||e instanceof BP&&X.equals(this._translation,e._translation)&&X.equals(this._rotation,e._rotation)&&X.equals(this._scale,e._scale)};var mC=BP;function q0(e,t){this._propertyNames=[],this._definitionChanged=new be,l(e)&&this.merge(e,t)}Object.defineProperties(q0.prototype,{propertyNames:{get:function(){return this._propertyNames}},isConstant:{get:function(){let e=this._propertyNames;for(let t=0,n=e.length;t<n;t++)if(!X.isConstant(this[e[t]]))return!1;return!0}},definitionChanged:{get:function(){return this._definitionChanged}}});q0.prototype.hasProperty=function(e){return this._propertyNames.indexOf(e)!==-1};function z9e(e){return new hi(e)}q0.prototype.addProperty=function(e,t,n){this._propertyNames.push(e),Object.defineProperty(this,e,me(e,!0,n??z9e)),l(t)&&(this[e]=t),this._definitionChanged.raiseEvent(this)};q0.prototype.removeProperty=function(e){let n=this._propertyNames.indexOf(e);this._propertyNames.splice(n,1),delete this[e],this._definitionChanged.raiseEvent(this)};var V9e=new K;q0.prototype.getValue=function(e,t){l(e)||(e=K.now(V9e)),l(t)||(t={});let n=this._propertyNames;for(let i=0,r=n.length;i<r;i++){let o=n[i];t[o]=X.getValueOrUndefined(this[o],e,t[o])}return t};q0.prototype.merge=function(e,t){let n=this._propertyNames,i=l(e._propertyNames)?e._propertyNames:Object.keys(e);for(let r=0,o=i.length;r<o;r++){let s=i[r],a=this[s],c=e[s];a===void 0&&n.indexOf(s)===-1&&this.addProperty(s,void 0,t),c!==void 0&&(a!==void 0?l(a)&&l(a.merge)&&a.merge(c):l(c)&&l(c.merge)&&l(c.clone)?this[s]=c.clone():this[s]=c)}};function j9e(e,t){let n=e._propertyNames,i=t._propertyNames,r=n.length;if(r!==i.length)return!1;for(let o=0;o<r;++o){let s=n[o];if(i.indexOf(s)===-1||!X.equals(e[s],t[s]))return!1}return!0}q0.prototype.equals=function(e){return this===e||e instanceof q0&&j9e(this,e)};var yu=q0;function Ehe(e){return new mC(e)}function H9e(e){return new yu(e,Ehe)}function G9e(e){return new yu(e)}function W9e(e){return new yu(e)}function kP(e){this._definitionChanged=new be,this._show=void 0,this._showSubscription=void 0,this._uri=void 0,this._uriSubscription=void 0,this._scale=void 0,this._scaleSubscription=void 0,this._hasVerticalExaggeration=void 0,this._hasVerticalExaggerationSubscription=void 0,this._enableVerticalExaggeration=void 0,this._enableVerticalExaggerationSubscription=void 0,this._minimumPixelSize=void 0,this._minimumPixelSizeSubscription=void 0,this._maximumScale=void 0,this._maximumScaleSubscription=void 0,this._incrementallyLoadTextures=void 0,this._incrementallyLoadTexturesSubscription=void 0,this._runAnimations=void 0,this._runAnimationsSubscription=void 0,this._clampAnimations=void 0,this._clampAnimationsSubscription=void 0,this._shadows=void 0,this._shadowsSubscription=void 0,this._heightReference=void 0,this._heightReferenceSubscription=void 0,this._silhouetteColor=void 0,this._silhouetteColorSubscription=void 0,this._silhouetteSize=void 0,this._silhouetteSizeSubscription=void 0,this._color=void 0,this._colorSubscription=void 0,this._colorBlendMode=void 0,this._colorBlendModeSubscription=void 0,this._colorBlendAmount=void 0,this._colorBlendAmountSubscription=void 0,this._imageBasedLightingFactor=void 0,this._imageBasedLightingFactorSubscription=void 0,this._environmentMapOptions=void 0,this._environmentMapOptionsSubscription=void 0,this._lightColor=void 0,this._lightColorSubscription=void 0,this._distanceDisplayCondition=void 0,this._distanceDisplayConditionSubscription=void 0,this._nodeTransformations=void 0,this._nodeTransformationsSubscription=void 0,this._articulations=void 0,this._articulationsSubscription=void 0,this._clippingPlanes=void 0,this._clippingPlanesSubscription=void 0,this._customShader=void 0,this._customShaderSubscription=void 0,this.merge(e??H.EMPTY_OBJECT)}Object.defineProperties(kP.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:me("show"),uri:me("uri"),scale:me("scale"),enableVerticalExaggeration:me("enableVerticalExaggeration"),minimumPixelSize:me("minimumPixelSize"),maximumScale:me("maximumScale"),incrementallyLoadTextures:me("incrementallyLoadTextures"),runAnimations:me("runAnimations"),clampAnimations:me("clampAnimations"),shadows:me("shadows"),heightReference:me("heightReference"),silhouetteColor:me("silhouetteColor"),silhouetteSize:me("silhouetteSize"),color:me("color"),colorBlendMode:me("colorBlendMode"),colorBlendAmount:me("colorBlendAmount"),imageBasedLightingFactor:me("imageBasedLightingFactor"),environmentMapOptions:me("environmentMapOptions",void 0,W9e),lightColor:me("lightColor"),distanceDisplayCondition:me("distanceDisplayCondition"),nodeTransformations:me("nodeTransformations",void 0,H9e),articulations:me("articulations",void 0,G9e),clippingPlanes:me("clippingPlanes"),customShader:me("customShader")});kP.prototype.clone=function(e){return l(e)?(e.show=this.show,e.uri=this.uri,e.scale=this.scale,e.enableVerticalExaggeration=this.enableVerticalExaggeration,e.minimumPixelSize=this.minimumPixelSize,e.maximumScale=this.maximumScale,e.incrementallyLoadTextures=this.incrementallyLoadTextures,e.runAnimations=this.runAnimations,e.clampAnimations=this.clampAnimations,e.heightReference=this._heightReference,e.silhouetteColor=this.silhouetteColor,e.silhouetteSize=this.silhouetteSize,e.color=this.color,e.colorBlendMode=this.colorBlendMode,e.colorBlendAmount=this.colorBlendAmount,e.imageBasedLightingFactor=this.imageBasedLightingFactor,e.environmentMapOptions=this.environmentMapOptions,e.lightColor=this.lightColor,e.distanceDisplayCondition=this.distanceDisplayCondition,e.nodeTransformations=this.nodeTransformations,e.articulations=this.articulations,e.clippingPlanes=this.clippingPlanes,e.customShader=this.customShader,e):new kP(this)};kP.prototype.merge=function(e){this.show=this.show??e.show,this.uri=this.uri??e.uri,this.scale=this.scale??e.scale,this.enableVerticalExaggeration=this.enableVerticalExaggeration??e.enableVerticalExaggeration,this.minimumPixelSize=this.minimumPixelSize??e.minimumPixelSize,this.maximumScale=this.maximumScale??e.maximumScale,this.incrementallyLoadTextures=this.incrementallyLoadTextures??e.incrementallyLoadTextures,this.runAnimations=this.runAnimations??e.runAnimations,this.clampAnimations=this.clampAnimations??e.clampAnimations,this.shadows=this.shadows??e.shadows,this.heightReference=this.heightReference??e.heightReference,this.silhouetteColor=this.silhouetteColor??e.silhouetteColor,this.silhouetteSize=this.silhouetteSize??e.silhouetteSize,this.color=this.color??e.color,this.colorBlendMode=this.colorBlendMode??e.colorBlendMode,this.colorBlendAmount=this.colorBlendAmount??e.colorBlendAmount,this.imageBasedLightingFactor=this.imageBasedLightingFactor??e.imageBasedLightingFactor,this.environmentMapOptions=this.environmentMapOptions??e.environmentMapOptions,this.lightColor=this.lightColor??e.lightColor,this.distanceDisplayCondition=this.distanceDisplayCondition??e.distanceDisplayCondition,this.clippingPlanes=this.clippingPlanes??e.clippingPlanes,this.customShader=this.customShader??e.customShader;let t=e.nodeTransformations;if(l(t)){let i=this.nodeTransformations;l(i)?i.merge(t):this.nodeTransformations=new yu(t,Ehe)}let n=e.articulations;if(l(n)){let i=this.articulations;l(i)?i.merge(n):this.articulations=new yu(n)}};var K_=kP;function UP(e){this._definitionChanged=new be,this._show=void 0,this._showSubscription=void 0,this._uri=void 0,this._uriSubscription=void 0,this._maximumScreenSpaceError=void 0,this._maximumScreenSpaceErrorSubscription=void 0,this.merge(e??H.EMPTY_OBJECT)}Object.defineProperties(UP.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:me("show"),uri:me("uri"),maximumScreenSpaceError:me("maximumScreenSpaceError")});UP.prototype.clone=function(e){return l(e)?(e.show=this.show,e.uri=this.uri,e.maximumScreenSpaceError=this.maximumScreenSpaceError,e):new UP(this)};UP.prototype.merge=function(e){this.show=this.show??e.show,this.uri=this.uri??e.uri,this.maximumScreenSpaceError=this.maximumScreenSpaceError??e.maximumScreenSpaceError};var pC=UP;function zP(e){this._definitionChanged=new be,this._show=void 0,this._showSubscription=void 0,this._leadTime=void 0,this._leadTimeSubscription=void 0,this._trailTime=void 0,this._trailTimeSubscription=void 0,this._width=void 0,this._widthSubscription=void 0,this._resolution=void 0,this._resolutionSubscription=void 0,this._material=void 0,this._materialSubscription=void 0,this._distanceDisplayCondition=void 0,this._distanceDisplayConditionSubscription=void 0,this._relativeTo=void 0,this._relativeToSubscription=void 0,this._materialMode=void 0,this._materialModeSubscription=void 0,this.merge(e??H.EMPTY_OBJECT)}Object.defineProperties(zP.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:me("show"),leadTime:me("leadTime"),trailTime:me("trailTime"),width:me("width"),resolution:me("resolution"),material:fo("material"),distanceDisplayCondition:me("distanceDisplayCondition"),relativeTo:me("relativeTo"),materialMode:me("materialMode")});zP.prototype.clone=function(e){return l(e)?(e.show=this.show,e.leadTime=this.leadTime,e.trailTime=this.trailTime,e.width=this.width,e.resolution=this.resolution,e.material=this.material,e.distanceDisplayCondition=this.distanceDisplayCondition,e.relativeTo=this.relativeTo,e.materialMode=this.materialMode,e):new zP(this)};zP.prototype.merge=function(e){this.show=this.show??e.show,this.leadTime=this.leadTime??e.leadTime,this.trailTime=this.trailTime??e.trailTime,this.width=this.width??e.width,this.resolution=this.resolution??e.resolution,this.material=this.material??e.material,this.distanceDisplayCondition=this.distanceDisplayCondition??e.distanceDisplayCondition,this.relativeTo=this.relativeTo??e.relativeTo,this.materialMode=this.materialMode??e.materialMode};var $_=zP;function VP(e){this._definitionChanged=new be,this._show=void 0,this._showSubscription=void 0,this._plane=void 0,this._planeSubscription=void 0,this._dimensions=void 0,this._dimensionsSubscription=void 0,this._fill=void 0,this._fillSubscription=void 0,this._material=void 0,this._materialSubscription=void 0,this._outline=void 0,this._outlineSubscription=void 0,this._outlineColor=void 0,this._outlineColorSubscription=void 0,this._outlineWidth=void 0,this._outlineWidthSubscription=void 0,this._shadows=void 0,this._shadowsSubscription=void 0,this._distanceDisplayCondition=void 0,this._distanceDisplayConditionSubscription=void 0,this.merge(e??H.EMPTY_OBJECT)}Object.defineProperties(VP.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:me("show"),plane:me("plane"),dimensions:me("dimensions"),fill:me("fill"),material:fo("material"),outline:me("outline"),outlineColor:me("outlineColor"),outlineWidth:me("outlineWidth"),shadows:me("shadows"),distanceDisplayCondition:me("distanceDisplayCondition")});VP.prototype.clone=function(e){return l(e)?(e.show=this.show,e.plane=this.plane,e.dimensions=this.dimensions,e.fill=this.fill,e.material=this.material,e.outline=this.outline,e.outlineColor=this.outlineColor,e.outlineWidth=this.outlineWidth,e.shadows=this.shadows,e.distanceDisplayCondition=this.distanceDisplayCondition,e):new VP(this)};VP.prototype.merge=function(e){this.show=this.show??e.show,this.plane=this.plane??e.plane,this.dimensions=this.dimensions??e.dimensions,this.fill=this.fill??e.fill,this.material=this.material??e.material,this.outline=this.outline??e.outline,this.outlineColor=this.outlineColor??e.outlineColor,this.outlineWidth=this.outlineWidth??e.outlineWidth,this.shadows=this.shadows??e.shadows,this.distanceDisplayCondition=this.distanceDisplayCondition??e.distanceDisplayCondition};var $k=VP;function jP(e){this._definitionChanged=new be,this._show=void 0,this._showSubscription=void 0,this._pixelSize=void 0,this._pixelSizeSubscription=void 0,this._heightReference=void 0,this._heightReferenceSubscription=void 0,this._color=void 0,this._colorSubscription=void 0,this._outlineColor=void 0,this._outlineColorSubscription=void 0,this._outlineWidth=void 0,this._outlineWidthSubscription=void 0,this._scaleByDistance=void 0,this._scaleByDistanceSubscription=void 0,this._translucencyByDistance=void 0,this._translucencyByDistanceSubscription=void 0,this._distanceDisplayCondition=void 0,this._distanceDisplayConditionSubscription=void 0,this._disableDepthTestDistance=void 0,this._disableDepthTestDistanceSubscription=void 0,this._splitDirection=void 0,this._splitDirectionSubscription=void 0,this.merge(e??H.EMPTY_OBJECT)}Object.defineProperties(jP.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:me("show"),pixelSize:me("pixelSize"),heightReference:me("heightReference"),color:me("color"),outlineColor:me("outlineColor"),outlineWidth:me("outlineWidth"),scaleByDistance:me("scaleByDistance"),translucencyByDistance:me("translucencyByDistance"),distanceDisplayCondition:me("distanceDisplayCondition"),disableDepthTestDistance:me("disableDepthTestDistance"),splitDirection:me("splitDirection")});jP.prototype.clone=function(e){return l(e)?(e.show=this.show,e.pixelSize=this.pixelSize,e.heightReference=this.heightReference,e.color=this.color,e.outlineColor=this.outlineColor,e.outlineWidth=this.outlineWidth,e.scaleByDistance=this.scaleByDistance,e.translucencyByDistance=this._translucencyByDistance,e.distanceDisplayCondition=this.distanceDisplayCondition,e.disableDepthTestDistance=this.disableDepthTestDistance,e.splitDirection=this.splitDirection,e):new jP(this)};jP.prototype.merge=function(e){this.show=this.show??e.show,this.pixelSize=this.pixelSize??e.pixelSize,this.heightReference=this.heightReference??e.heightReference,this.color=this.color??e.color,this.outlineColor=this.outlineColor??e.outlineColor,this.outlineWidth=this.outlineWidth??e.outlineWidth,this.scaleByDistance=this.scaleByDistance??e.scaleByDistance,this.translucencyByDistance=this._translucencyByDistance??e.translucencyByDistance,this.distanceDisplayCondition=this.distanceDisplayCondition??e.distanceDisplayCondition,this.disableDepthTestDistance=this.disableDepthTestDistance??e.disableDepthTestDistance,this.splitDirection=this.splitDirection??e.splitDirection};var gC=jP;function q9e(e,t){this.positions=l(e)?e:[],this.holes=l(t)?t:[]}var Hc=q9e;function Y9e(e){return Array.isArray(e)&&(e=new Hc(e)),new hi(e)}function HP(e){this._definitionChanged=new be,this._show=void 0,this._showSubscription=void 0,this._hierarchy=void 0,this._hierarchySubscription=void 0,this._height=void 0,this._heightSubscription=void 0,this._heightReference=void 0,this._heightReferenceSubscription=void 0,this._extrudedHeight=void 0,this._extrudedHeightSubscription=void 0,this._extrudedHeightReference=void 0,this._extrudedHeightReferenceSubscription=void 0,this._stRotation=void 0,this._stRotationSubscription=void 0,this._granularity=void 0,this._granularitySubscription=void 0,this._fill=void 0,this._fillSubscription=void 0,this._material=void 0,this._materialSubscription=void 0,this._outline=void 0,this._outlineSubscription=void 0,this._outlineColor=void 0,this._outlineColorSubscription=void 0,this._outlineWidth=void 0,this._outlineWidthSubscription=void 0,this._perPositionHeight=void 0,this._perPositionHeightSubscription=void 0,this._closeTop=void 0,this._closeTopSubscription=void 0,this._closeBottom=void 0,this._closeBottomSubscription=void 0,this._arcType=void 0,this._arcTypeSubscription=void 0,this._shadows=void 0,this._shadowsSubscription=void 0,this._distanceDisplayCondition=void 0,this._distanceDisplayConditionSubscription=void 0,this._classificationType=void 0,this._classificationTypeSubscription=void 0,this._zIndex=void 0,this._zIndexSubscription=void 0,this._textureCoordinates=void 0,this._textureCoordinatesSubscription=void 0,this.merge(e??H.EMPTY_OBJECT)}Object.defineProperties(HP.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:me("show"),hierarchy:me("hierarchy",void 0,Y9e),height:me("height"),heightReference:me("heightReference"),extrudedHeight:me("extrudedHeight"),extrudedHeightReference:me("extrudedHeightReference"),stRotation:me("stRotation"),granularity:me("granularity"),fill:me("fill"),material:fo("material"),outline:me("outline"),outlineColor:me("outlineColor"),outlineWidth:me("outlineWidth"),perPositionHeight:me("perPositionHeight"),closeTop:me("closeTop"),closeBottom:me("closeBottom"),arcType:me("arcType"),shadows:me("shadows"),distanceDisplayCondition:me("distanceDisplayCondition"),classificationType:me("classificationType"),zIndex:me("zIndex"),textureCoordinates:me("textureCoordinates")});HP.prototype.clone=function(e){return l(e)?(e.show=this.show,e.hierarchy=this.hierarchy,e.height=this.height,e.heightReference=this.heightReference,e.extrudedHeight=this.extrudedHeight,e.extrudedHeightReference=this.extrudedHeightReference,e.stRotation=this.stRotation,e.granularity=this.granularity,e.fill=this.fill,e.material=this.material,e.outline=this.outline,e.outlineColor=this.outlineColor,e.outlineWidth=this.outlineWidth,e.perPositionHeight=this.perPositionHeight,e.closeTop=this.closeTop,e.closeBottom=this.closeBottom,e.arcType=this.arcType,e.shadows=this.shadows,e.distanceDisplayCondition=this.distanceDisplayCondition,e.classificationType=this.classificationType,e.zIndex=this.zIndex,e.textureCoordinates=this.textureCoordinates,e):new HP(this)};HP.prototype.merge=function(e){this.show=this.show??e.show,this.hierarchy=this.hierarchy??e.hierarchy,this.height=this.height??e.height,this.heightReference=this.heightReference??e.heightReference,this.extrudedHeight=this.extrudedHeight??e.extrudedHeight,this.extrudedHeightReference=this.extrudedHeightReference??e.extrudedHeightReference,this.stRotation=this.stRotation??e.stRotation,this.granularity=this.granularity??e.granularity,this.fill=this.fill??e.fill,this.material=this.material??e.material,this.outline=this.outline??e.outline,this.outlineColor=this.outlineColor??e.outlineColor,this.outlineWidth=this.outlineWidth??e.outlineWidth,this.perPositionHeight=this.perPositionHeight??e.perPositionHeight,this.closeTop=this.closeTop??e.closeTop,this.closeBottom=this.closeBottom??e.closeBottom,this.arcType=this.arcType??e.arcType,this.shadows=this.shadows??e.shadows,this.distanceDisplayCondition=this.distanceDisplayCondition??e.distanceDisplayCondition,this.classificationType=this.classificationType??e.classificationType,this.zIndex=this.zIndex??e.zIndex,this.textureCoordinates=this.textureCoordinates??e.textureCoordinates};var np=HP;function GP(e){this._definitionChanged=new be,this._show=void 0,this._showSubscription=void 0,this._positions=void 0,this._positionsSubscription=void 0,this._width=void 0,this._widthSubscription=void 0,this._granularity=void 0,this._granularitySubscription=void 0,this._material=void 0,this._materialSubscription=void 0,this._depthFailMaterial=void 0,this._depthFailMaterialSubscription=void 0,this._arcType=void 0,this._arcTypeSubscription=void 0,this._clampToGround=void 0,this._clampToGroundSubscription=void 0,this._shadows=void 0,this._shadowsSubscription=void 0,this._distanceDisplayCondition=void 0,this._distanceDisplayConditionSubscription=void 0,this._classificationType=void 0,this._classificationTypeSubscription=void 0,this._zIndex=void 0,this._zIndexSubscription=void 0,this.merge(e??H.EMPTY_OBJECT)}Object.defineProperties(GP.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:me("show"),positions:me("positions"),width:me("width"),granularity:me("granularity"),material:fo("material"),depthFailMaterial:fo("depthFailMaterial"),arcType:me("arcType"),clampToGround:me("clampToGround"),shadows:me("shadows"),distanceDisplayCondition:me("distanceDisplayCondition"),classificationType:me("classificationType"),zIndex:me("zIndex")});GP.prototype.clone=function(e){return l(e)?(e.show=this.show,e.positions=this.positions,e.width=this.width,e.granularity=this.granularity,e.material=this.material,e.depthFailMaterial=this.depthFailMaterial,e.arcType=this.arcType,e.clampToGround=this.clampToGround,e.shadows=this.shadows,e.distanceDisplayCondition=this.distanceDisplayCondition,e.classificationType=this.classificationType,e.zIndex=this.zIndex,e):new GP(this)};GP.prototype.merge=function(e){this.show=this.show??e.show,this.positions=this.positions??e.positions,this.width=this.width??e.width,this.granularity=this.granularity??e.granularity,this.material=this.material??e.material,this.depthFailMaterial=this.depthFailMaterial??e.depthFailMaterial,this.arcType=this.arcType??e.arcType,this.clampToGround=this.clampToGround??e.clampToGround,this.shadows=this.shadows??e.shadows,this.distanceDisplayCondition=this.distanceDisplayCondition??e.distanceDisplayCondition,this.classificationType=this.classificationType??e.classificationType,this.zIndex=this.zIndex??e.zIndex};var Rl=GP;function WP(e){this._definitionChanged=new be,this._show=void 0,this._showSubscription=void 0,this._positions=void 0,this._positionsSubscription=void 0,this._shape=void 0,this._shapeSubscription=void 0,this._cornerType=void 0,this._cornerTypeSubscription=void 0,this._granularity=void 0,this._granularitySubscription=void 0,this._fill=void 0,this._fillSubscription=void 0,this._material=void 0,this._materialSubscription=void 0,this._outline=void 0,this._outlineSubscription=void 0,this._outlineColor=void 0,this._outlineColorSubscription=void 0,this._outlineWidth=void 0,this._outlineWidthSubscription=void 0,this._shadows=void 0,this._shadowsSubscription=void 0,this._distanceDisplayCondition=void 0,this._distanceDisplayConditionSubsription=void 0,this.merge(e??H.EMPTY_OBJECT)}Object.defineProperties(WP.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:me("show"),positions:me("positions"),shape:me("shape"),cornerType:me("cornerType"),granularity:me("granularity"),fill:me("fill"),material:fo("material"),outline:me("outline"),outlineColor:me("outlineColor"),outlineWidth:me("outlineWidth"),shadows:me("shadows"),distanceDisplayCondition:me("distanceDisplayCondition")});WP.prototype.clone=function(e){return l(e)?(e.show=this.show,e.positions=this.positions,e.shape=this.shape,e.cornerType=this.cornerType,e.granularity=this.granularity,e.fill=this.fill,e.material=this.material,e.outline=this.outline,e.outlineColor=this.outlineColor,e.outlineWidth=this.outlineWidth,e.shadows=this.shadows,e.distanceDisplayCondition=this.distanceDisplayCondition,e):new WP(this)};WP.prototype.merge=function(e){this.show=this.show??e.show,this.positions=this.positions??e.positions,this.shape=this.shape??e.shape,this.cornerType=this.cornerType??e.cornerType,this.granularity=this.granularity??e.granularity,this.fill=this.fill??e.fill,this.material=this.material??e.material,this.outline=this.outline??e.outline,this.outlineColor=this.outlineColor??e.outlineColor,this.outlineWidth=this.outlineWidth??e.outlineWidth,this.shadows=this.shadows??e.shadows,this.distanceDisplayCondition=this.distanceDisplayCondition??e.distanceDisplayCondition};var _C=WP;function qP(e){this._definitionChanged=new be,this._show=void 0,this._showSubscription=void 0,this._coordinates=void 0,this._coordinatesSubscription=void 0,this._height=void 0,this._heightSubscription=void 0,this._heightReference=void 0,this._heightReferenceSubscription=void 0,this._extrudedHeight=void 0,this._extrudedHeightSubscription=void 0,this._extrudedHeightReference=void 0,this._extrudedHeightReferenceSubscription=void 0,this._rotation=void 0,this._rotationSubscription=void 0,this._stRotation=void 0,this._stRotationSubscription=void 0,this._granularity=void 0,this._granularitySubscription=void 0,this._fill=void 0,this._fillSubscription=void 0,this._material=void 0,this._materialSubscription=void 0,this._outline=void 0,this._outlineSubscription=void 0,this._outlineColor=void 0,this._outlineColorSubscription=void 0,this._outlineWidth=void 0,this._outlineWidthSubscription=void 0,this._shadows=void 0,this._shadowsSubscription=void 0,this._distanceDisplayCondition=void 0,this._distancedisplayConditionSubscription=void 0,this._classificationType=void 0,this._classificationTypeSubscription=void 0,this._zIndex=void 0,this._zIndexSubscription=void 0,this.merge(e??H.EMPTY_OBJECT)}Object.defineProperties(qP.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:me("show"),coordinates:me("coordinates"),height:me("height"),heightReference:me("heightReference"),extrudedHeight:me("extrudedHeight"),extrudedHeightReference:me("extrudedHeightReference"),rotation:me("rotation"),stRotation:me("stRotation"),granularity:me("granularity"),fill:me("fill"),material:fo("material"),outline:me("outline"),outlineColor:me("outlineColor"),outlineWidth:me("outlineWidth"),shadows:me("shadows"),distanceDisplayCondition:me("distanceDisplayCondition"),classificationType:me("classificationType"),zIndex:me("zIndex")});qP.prototype.clone=function(e){return l(e)?(e.show=this.show,e.coordinates=this.coordinates,e.height=this.height,e.heightReference=this.heightReference,e.extrudedHeight=this.extrudedHeight,e.extrudedHeightReference=this.extrudedHeightReference,e.rotation=this.rotation,e.stRotation=this.stRotation,e.granularity=this.granularity,e.fill=this.fill,e.material=this.material,e.outline=this.outline,e.outlineColor=this.outlineColor,e.outlineWidth=this.outlineWidth,e.shadows=this.shadows,e.distanceDisplayCondition=this.distanceDisplayCondition,e.classificationType=this.classificationType,e.zIndex=this.zIndex,e):new qP(this)};qP.prototype.merge=function(e){this.show=this.show??e.show,this.coordinates=this.coordinates??e.coordinates,this.height=this.height??e.height,this.heightReference=this.heightReference??e.heightReference,this.extrudedHeight=this.extrudedHeight??e.extrudedHeight,this.extrudedHeightReference=this.extrudedHeightReference??e.extrudedHeightReference,this.rotation=this.rotation??e.rotation,this.stRotation=this.stRotation??e.stRotation,this.granularity=this.granularity??e.granularity,this.fill=this.fill??e.fill,this.material=this.material??e.material,this.outline=this.outline??e.outline,this.outlineColor=this.outlineColor??e.outlineColor,this.outlineWidth=this.outlineWidth??e.outlineWidth,this.shadows=this.shadows??e.shadows,this.distanceDisplayCondition=this.distanceDisplayCondition??e.distanceDisplayCondition,this.classificationType=this.classificationType??e.classificationType,this.zIndex=this.zIndex??e.zIndex};var ip=qP;function YP(e){this._definitionChanged=new be,this._show=void 0,this._showSubscription=void 0,this._positions=void 0,this._positionsSubscription=void 0,this._minimumHeights=void 0,this._minimumHeightsSubscription=void 0,this._maximumHeights=void 0,this._maximumHeightsSubscription=void 0,this._granularity=void 0,this._granularitySubscription=void 0,this._fill=void 0,this._fillSubscription=void 0,this._material=void 0,this._materialSubscription=void 0,this._outline=void 0,this._outlineSubscription=void 0,this._outlineColor=void 0,this._outlineColorSubscription=void 0,this._outlineWidth=void 0,this._outlineWidthSubscription=void 0,this._shadows=void 0,this._shadowsSubscription=void 0,this._distanceDisplayCondition=void 0,this._distanceDisplayConditionSubscription=void 0,this.merge(e??H.EMPTY_OBJECT)}Object.defineProperties(YP.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:me("show"),positions:me("positions"),minimumHeights:me("minimumHeights"),maximumHeights:me("maximumHeights"),granularity:me("granularity"),fill:me("fill"),material:fo("material"),outline:me("outline"),outlineColor:me("outlineColor"),outlineWidth:me("outlineWidth"),shadows:me("shadows"),distanceDisplayCondition:me("distanceDisplayCondition")});YP.prototype.clone=function(e){return l(e)?(e.show=this.show,e.positions=this.positions,e.minimumHeights=this.minimumHeights,e.maximumHeights=this.maximumHeights,e.granularity=this.granularity,e.fill=this.fill,e.material=this.material,e.outline=this.outline,e.outlineColor=this.outlineColor,e.outlineWidth=this.outlineWidth,e.shadows=this.shadows,e.distanceDisplayCondition=this.distanceDisplayCondition,e):new YP(this)};YP.prototype.merge=function(e){this.show=this.show??e.show,this.positions=this.positions??e.positions,this.minimumHeights=this.minimumHeights??e.minimumHeights,this.maximumHeights=this.maximumHeights??e.maximumHeights,this.granularity=this.granularity??e.granularity,this.fill=this.fill??e.fill,this.material=this.material??e.material,this.outline=this.outline??e.outline,this.outlineColor=this.outlineColor??e.outlineColor,this.outlineWidth=this.outlineWidth??e.outlineWidth,this.shadows=this.shadows??e.shadows,this.distanceDisplayCondition=this.distanceDisplayCondition??e.distanceDisplayCondition};var J_=YP;var X9e=new he,XX=[];function K9e(e){return new gu(e)}function $9e(e){return me(e,void 0,K9e)}function Ia(e,t){return me(e,void 0,function(n){return n instanceof t?n:new t(n)})}function ld(e){e=e??H.EMPTY_OBJECT;let t=e.id;l(t)||(t=Kn()),this._availability=void 0,this._id=t,this._definitionChanged=new be,this._name=e.name,this._show=e.show??!0,this._trackingReferenceFrame=e.trackingReferenceFrame??W_.AUTODETECT,this._parent=void 0,this._propertyNames=["billboard","box","corridor","cylinder","description","ellipse","ellipsoid","label","model","tileset","orientation","path","plane","point","polygon","polyline","polylineVolume","position","properties","rectangle","viewFrom","wall",...XX],this._billboard=void 0,this._billboardSubscription=void 0,this._box=void 0,this._boxSubscription=void 0,this._corridor=void 0,this._corridorSubscription=void 0,this._cylinder=void 0,this._cylinderSubscription=void 0,this._description=void 0,this._descriptionSubscription=void 0,this._ellipse=void 0,this._ellipseSubscription=void 0,this._ellipsoid=void 0,this._ellipsoidSubscription=void 0,this._label=void 0,this._labelSubscription=void 0,this._model=void 0,this._modelSubscription=void 0,this._tileset=void 0,this._tilesetSubscription=void 0,this._orientation=void 0,this._orientationSubscription=void 0,this._path=void 0,this._pathSubscription=void 0,this._plane=void 0,this._planeSubscription=void 0,this._point=void 0,this._pointSubscription=void 0,this._polygon=void 0,this._polygonSubscription=void 0,this._polyline=void 0,this._polylineSubscription=void 0,this._polylineVolume=void 0,this._polylineVolumeSubscription=void 0,this._position=void 0,this._positionSubscription=void 0,this._properties=void 0,this._propertiesSubscription=void 0,this._rectangle=void 0,this._rectangleSubscription=void 0,this._viewFrom=void 0,this._viewFromSubscription=void 0,this._wall=void 0,this._wallSubscription=void 0,this._children=[],this.entityCollection=void 0,this.parent=e.parent,this.merge(e)}function KX(e,t,n){let i=t.length;for(let r=0;r<i;r++){let o=t[r],s=o._show;(!n&&s)!==(n&&s)&&KX(o,o._children,n)}e._definitionChanged.raiseEvent(e,"isShowing",n,!n)}Object.defineProperties(ld.prototype,{availability:_u("availability"),id:{get:function(){return this._id}},definitionChanged:{get:function(){return this._definitionChanged}},name:_u("name"),show:{get:function(){return this._show},set:function(e){if(e===this._show)return;let t=this.isShowing;this._show=e;let n=this.isShowing;t!==n&&KX(this,this._children,n),this._definitionChanged.raiseEvent(this,"show",e,!e)}},trackingReferenceFrame:_u("trackingReferenceFrame"),isShowing:{get:function(){return this._show&&(!l(this.entityCollection)||this.entityCollection.show)&&(!l(this._parent)||this._parent.isShowing)}},parent:{get:function(){return this._parent},set:function(e){let t=this._parent;if(t===e)return;let n=this.isShowing;if(l(t)){let r=t._children.indexOf(this);t._children.splice(r,1)}this._parent=e,l(e)&&e._children.push(this);let i=this.isShowing;n!==i&&KX(this,this._children,i),this._definitionChanged.raiseEvent(this,"parent",e,t)}},propertyNames:{get:function(){return this._propertyNames}},billboard:Ia("billboard",Il),box:Ia("box",cC),corridor:Ia("corridor",uC),cylinder:Ia("cylinder",fC),description:me("description"),ellipse:Ia("ellipse",dC),ellipsoid:Ia("ellipsoid",hC),label:Ia("label",tp),model:Ia("model",K_),tileset:Ia("tileset",pC),orientation:me("orientation"),path:Ia("path",$_),plane:Ia("plane",$k),point:Ia("point",gC),polygon:Ia("polygon",np),polyline:Ia("polyline",Rl),polylineVolume:Ia("polylineVolume",_C),properties:Ia("properties",yu),position:$9e("position"),rectangle:Ia("rectangle",ip),viewFrom:me("viewFrom"),wall:Ia("wall",J_)});ld.registerEntityType=function(e,t){Object.defineProperties(ld.prototype,{[e]:Ia(e,t)}),XX.includes(e)||XX.push(e)};ld.prototype.isAvailable=function(e){let t=this._availability;return!l(t)||t.contains(e)};ld.prototype.addProperty=function(e){this._propertyNames.push(e),Object.defineProperty(this,e,_u(e,!0))};ld.prototype.removeProperty=function(e){let n=this._propertyNames.indexOf(e);this._propertyNames.splice(n,1),delete this[e]};ld.prototype.merge=function(e){this.name=this.name??e.name,this.availability=this.availability??e.availability;let t=this._propertyNames,n=l(e._propertyNames)?e._propertyNames:Object.keys(e),i=n.length;for(let r=0;r<i;r++){let o=n[r];if(o==="parent"||o==="name"||o==="availability"||o==="children")continue;let s=this[o],a=e[o];!l(s)&&t.indexOf(o)===-1&&this.addProperty(o),l(a)&&(l(s)?l(s.merge)&&s.merge(a):l(a.merge)&&l(a.clone)?this[o]=a.clone():this[o]=a)}};var Che=new $,vhe=new h,She=new Le;ld.prototype.computeModelMatrix=function(e,t){let n=X.getValueOrUndefined(this._position,e,vhe);if(!l(n))return;let i=X.getValueOrUndefined(this._orientation,e,She);return l(i)?t=M.fromRotationTranslation($.fromQuaternion(i,Che),n,t):t=At.eastNorthUpToFixedFrame(n,void 0,t),t};ld.prototype.computeModelMatrixForHeightReference=function(e,t,n,i,r){let o=X.getValueOrDefault(t,e,We.NONE),s=X.getValueOrUndefined(this._position,e,vhe);if(o===We.NONE||!l(s)||h.equalsEpsilon(s,h.ZERO,P.EPSILON8))return this.computeModelMatrix(e,r);let a=i.cartesianToCartographic(s,X9e);o===We.CLIP_TO_GROUND?a.height<n&&(a.height=n):us(o)?a.height=n:a.height+=n,s=i.cartographicToCartesian(a,s);let c=X.getValueOrUndefined(this._orientation,e,She);return l(c)?r=M.fromRotationTranslation($.fromQuaternion(c,Che),s,r):r=At.eastNorthUpToFixedFrame(s,void 0,r),r};ld.supportsMaterialsforEntitiesOnTerrain=function(e){return pu.supportsMaterials(e)};ld.supportsPolylinesOnTerrain=function(e){return Qm.isSupported(e)};var Qr=ld;var J9e=new Kt(z.WHITE),Z9e=new hi(!0),Q9e=new hi(!0),e7e=new hi(!1),t7e=new hi(z.BLACK),n7e=new hi(Dn.DISABLED),i7e=new hi(new Gt),r7e=new hi(ei.BOTH);function Ol(e){let t=e.entity,n=e.geometryPropertyName;this._entity=t,this._scene=e.scene,this._fillEnabled=!1,this._isClosed=!1,this._onTerrain=!1,this._dynamic=!1,this._outlineEnabled=!1,this._geometryChanged=new be,this._showProperty=void 0,this._materialProperty=void 0,this._showOutlineProperty=void 0,this._outlineColorProperty=void 0,this._outlineWidth=1,this._shadowsProperty=void 0,this._distanceDisplayConditionProperty=void 0,this._classificationTypeProperty=void 0,this._options=e.geometryOptions,this._geometryPropertyName=n,this._id=`${n}-${t.id}`,this._observedPropertyNames=e.observedPropertyNames,this._supportsMaterialsforEntitiesOnTerrain=Qr.supportsMaterialsforEntitiesOnTerrain(e.scene)}Object.defineProperties(Ol.prototype,{id:{get:function(){return this._id}},entity:{get:function(){return this._entity}},fillEnabled:{get:function(){return this._fillEnabled}},hasConstantFill:{get:function(){return!this._fillEnabled||!l(this._entity.availability)&&X.isConstant(this._showProperty)&&X.isConstant(this._fillProperty)}},fillMaterialProperty:{get:function(){return this._materialProperty}},outlineEnabled:{get:function(){return this._outlineEnabled}},hasConstantOutline:{get:function(){return!this._outlineEnabled||!l(this._entity.availability)&&X.isConstant(this._showProperty)&&X.isConstant(this._showOutlineProperty)}},outlineColorProperty:{get:function(){return this._outlineColorProperty}},outlineWidth:{get:function(){return this._outlineWidth}},shadowsProperty:{get:function(){return this._shadowsProperty}},distanceDisplayConditionProperty:{get:function(){return this._distanceDisplayConditionProperty}},classificationTypeProperty:{get:function(){return this._classificationTypeProperty}},isDynamic:{get:function(){return this._dynamic}},isClosed:{get:function(){return this._isClosed}},onTerrain:{get:function(){return this._onTerrain}},geometryChanged:{get:function(){return this._geometryChanged}}});Ol.prototype.isOutlineVisible=function(e){let t=this._entity;return(this._outlineEnabled&&t.isAvailable(e)&&this._showProperty.getValue(e)&&this._showOutlineProperty.getValue(e))??!1};Ol.prototype.isFilled=function(e){let t=this._entity;return(this._fillEnabled&&t.isAvailable(e)&&this._showProperty.getValue(e)&&this._fillProperty.getValue(e))??!1};Ol.prototype.createFillGeometryInstance=pe.throwInstantiationError;Ol.prototype.createOutlineGeometryInstance=pe.throwInstantiationError;Ol.prototype.isDestroyed=function(){return!1};Ol.prototype.destroy=function(){le(this)};Ol.prototype._isHidden=function(e,t){let n=t.show;return l(n)&&n.isConstant&&!n.getValue(nt.MINIMUM_VALUE)};Ol.prototype._isOnTerrain=function(e,t){return!1};Ol.prototype._getIsClosed=function(e){return!0};Ol.prototype._isDynamic=pe.throwInstantiationError;Ol.prototype._setStaticOptions=pe.throwInstantiationError;Ol.prototype._onEntityPropertyChanged=function(e,t,n,i){if(this._observedPropertyNames.indexOf(t)===-1)return;let r=this._entity[this._geometryPropertyName];if(!l(r)){(this._fillEnabled||this._outlineEnabled)&&(this._fillEnabled=!1,this._outlineEnabled=!1,this._geometryChanged.raiseEvent(this));return}let o=r.fill,s=l(o)&&o.isConstant?o.getValue(nt.MINIMUM_VALUE):!0,a=r.outline,c=l(a);if(c&&a.isConstant&&(c=a.getValue(nt.MINIMUM_VALUE)),!s&&!c){(this._fillEnabled||this._outlineEnabled)&&(this._fillEnabled=!1,this._outlineEnabled=!1,this._geometryChanged.raiseEvent(this));return}let u=r.show;if(this._isHidden(e,r)){(this._fillEnabled||this._outlineEnabled)&&(this._fillEnabled=!1,this._outlineEnabled=!1,this._geometryChanged.raiseEvent(this));return}this._materialProperty=r.material??J9e,this._fillProperty=o??Q9e,this._showProperty=u??Z9e,this._showOutlineProperty=r.outline??e7e,this._outlineColorProperty=c?r.outlineColor??t7e:void 0,this._shadowsProperty=r.shadows??n7e,this._distanceDisplayConditionProperty=r.distanceDisplayCondition??i7e,this._classificationTypeProperty=r.classificationType??r7e,this._fillEnabled=s;let f=this._isOnTerrain(e,r)&&(this._supportsMaterialsforEntitiesOnTerrain||this._materialProperty instanceof Kt);if(c&&f&&(yt(yt.geometryOutlines),c=!1),this._onTerrain=f,this._outlineEnabled=c,this._isDynamic(e,r))this._dynamic||(this._dynamic=!0,this._geometryChanged.raiseEvent(this));else{this._setStaticOptions(e,r),this._isClosed=this._getIsClosed(this._options);let d=r.outlineWidth;this._outlineWidth=l(d)?d.getValue(nt.MINIMUM_VALUE):1,this._dynamic=!1,this._geometryChanged.raiseEvent(this)}};Ol.prototype.createDynamicUpdater=function(e,t){return new this.constructor.DynamicGeometryUpdater(this,e,t)};var Oi=Ol;function yC(e,t){this._callback=void 0,this._isConstant=void 0,this._definitionChanged=new be,this.setCallback(e,t)}Object.defineProperties(yC.prototype,{isConstant:{get:function(){return this._isConstant}},definitionChanged:{get:function(){return this._definitionChanged}}});var o7e=new K;yC.prototype.getValue=function(e,t){return l(e)||(e=K.now(o7e)),this._callback(e,t)};yC.prototype.setCallback=function(e,t){let n=this._callback!==e||this._isConstant!==t;this._callback=e,this._isConstant=t,n&&this._definitionChanged.raiseEvent(this)};yC.prototype.equals=function(e){return this===e||e instanceof yC&&this._callback===e._callback&&this._isConstant===e._isConstant};var rp=yC;var whe=new h;function AC(e,t,n,i){this._scene=e,this._heightReference=n,this._extrudedHeightReference=i,this._positionProperty=t,this._position=new h,this._cartographicPosition=new he,this._normal=new h,this._definitionChanged=new be,this._terrainHeight=0,this._removeCallbackFunc=void 0,this._removeEventListener=void 0,this._removeModeListener=void 0;let r=this;if(l(e.globe)&&(this._removeEventListener=e.terrainProviderChanged.addEventListener(function(){r._updateClamping()}),this._removeModeListener=e.morphComplete.addEventListener(function(){r._updateClamping()})),t.isConstant){let o=t.getValue(nt.MINIMUM_VALUE,whe);if(!l(o)||h.equals(o,h.ZERO)||!l(e.globe))return;this._position=h.clone(o,this._position),this._updateClamping(),this._normal=e.ellipsoid.geodeticSurfaceNormal(o,this._normal)}}Object.defineProperties(AC.prototype,{isConstant:{get:function(){return!1}},definitionChanged:{get:function(){return this._definitionChanged}}});AC.prototype._updateClamping=function(){l(this._removeCallbackFunc)&&this._removeCallbackFunc();let e=this._scene,t=this._position;if(h.equals(t,h.ZERO)){this._terrainHeight=0;return}let i=e.ellipsoid.cartesianToCartographic(t,this._cartographicPosition),r=e.getHeight(i,this._heightReference);l(r)?this._terrainHeight=r:this._terrainHeight=0;let o=s=>{this._terrainHeight=s.height,this.definitionChanged.raiseEvent()};this._removeCallbackFunc=e.updateHeight(i,o,this._heightReference)};var s7e=new K;AC.prototype.getValue=function(e,t){l(e)||(e=K.now(s7e));let n=X.getValueOrDefault(this._heightReference,e,We.NONE),i=X.getValueOrDefault(this._extrudedHeightReference,e,We.NONE);if(n===We.NONE&&!j_(i))return this._position=h.clone(h.ZERO,this._position),h.clone(h.ZERO,t);if(this._positionProperty.isConstant&&n!==We.CLIP_TO_GROUND)return h.multiplyByScalar(this._normal,this._terrainHeight,t);let r=this._scene,o=this._positionProperty.getValue(e,whe);if(!l(o)||h.equals(o,h.ZERO)||!l(r.globe))return h.clone(h.ZERO,t);if(h.equalsEpsilon(this._position,o,P.EPSILON10)&&n!==We.CLIP_TO_GROUND)return h.multiplyByScalar(this._normal,this._terrainHeight,t);this._position=h.clone(o,this._position),this._updateClamping();let s=r.ellipsoid.geodeticSurfaceNormal(o,this._normal);if(n===We.CLIP_TO_GROUND){let c=r.globe.ellipsoid.cartesianToCartographic(o,scratchCarto);return this._terrainHeight>=c.height?h.multiplyByScalar(s,this._terrainHeight-c.height,t):h.clone(h.ZERO,t)}return h.multiplyByScalar(s,this._terrainHeight,t)};AC.prototype.isDestroyed=function(){return!1};AC.prototype.destroy=function(){return l(this._removeEventListener)&&this._removeEventListener(),l(this._removeModeListener)&&this._removeModeListener(),l(this._removeCallbackFunc)&&this._removeCallbackFunc(),le(this)};var bC=AC;function a7e(e,t,n,i){if(Oi.prototype._onEntityPropertyChanged.call(this,e,t,n,i),this._observedPropertyNames.indexOf(t)===-1)return;let r=this._entity[this._geometryPropertyName];if(!l(r))return;l(this._terrainOffsetProperty)&&(this._terrainOffsetProperty.destroy(),this._terrainOffsetProperty=void 0);let o=r.heightReference;if(l(o)){let s=new rp(this._computeCenter.bind(this),!this._dynamic);this._terrainOffsetProperty=new bC(this._scene,s,o)}}var Z_=a7e;var Ihe=h.ZERO,Phe=new h,c7e=new h,Dhe=new z;function l7e(e){this.id=e,this.vertexFormat=void 0,this.dimensions=void 0,this.offsetAttribute=void 0}function af(e,t){Oi.call(this,{entity:e,scene:t,geometryOptions:new l7e(e),geometryPropertyName:"box",observedPropertyNames:["availability","position","orientation","box"]}),this._onEntityPropertyChanged(e,"box",e.box,void 0)}l(Object.create)&&(af.prototype=Object.create(Oi.prototype),af.prototype.constructor=af);Object.defineProperties(af.prototype,{terrainOffsetProperty:{get:function(){return this._terrainOffsetProperty}}});af.prototype.createFillGeometryInstance=function(e){let t=this._entity,n=t.isAvailable(e),i=new Pn(n&&t.isShowing&&this._showProperty.getValue(e)&&this._fillProperty.getValue(e)),r=this._distanceDisplayConditionProperty.getValue(e),o=Qn.fromDistanceDisplayCondition(r),s={show:i,distanceDisplayCondition:o,color:void 0,offset:void 0};if(this._materialProperty instanceof Kt){let a;l(this._materialProperty.color)&&(this._materialProperty.color.isConstant||n)&&(a=this._materialProperty.color.getValue(e,Dhe)),l(a)||(a=z.WHITE),s.color=Jt.fromColor(a)}return l(this._options.offsetAttribute)&&(s.offset=Er.fromCartesian3(X.getValueOrDefault(this._terrainOffsetProperty,e,Ihe,Phe))),new Bt({id:t,geometry:zc.fromDimensions(this._options),modelMatrix:t.computeModelMatrixForHeightReference(e,t.box.heightReference,this._options.dimensions.z*.5,this._scene.ellipsoid),attributes:s})};af.prototype.createOutlineGeometryInstance=function(e){let t=this._entity,n=t.isAvailable(e),i=X.getValueOrDefault(this._outlineColorProperty,e,z.BLACK,Dhe),r=this._distanceDisplayConditionProperty.getValue(e),o={show:new Pn(n&&t.isShowing&&this._showProperty.getValue(e)&&this._showOutlineProperty.getValue(e)),color:Jt.fromColor(i),distanceDisplayCondition:Qn.fromDistanceDisplayCondition(r),offset:void 0};return l(this._options.offsetAttribute)&&(o.offset=Er.fromCartesian3(X.getValueOrDefault(this._terrainOffsetProperty,e,Ihe,Phe))),new Bt({id:t,geometry:Jm.fromDimensions(this._options),modelMatrix:t.computeModelMatrixForHeightReference(e,t.box.heightReference,this._options.dimensions.z*.5,this._scene.ellipsoid),attributes:o})};af.prototype._computeCenter=function(e,t){return X.getValueOrUndefined(this._entity.position,e,t)};af.prototype._isHidden=function(e,t){return!l(t.dimensions)||!l(e.position)||Oi.prototype._isHidden.call(this,e,t)};af.prototype._isDynamic=function(e,t){return!e.position.isConstant||!X.isConstant(e.orientation)||!t.dimensions.isConstant||!X.isConstant(t.outlineWidth)};af.prototype._setStaticOptions=function(e,t){let n=X.getValueOrDefault(t.heightReference,nt.MINIMUM_VALUE,We.NONE),i=this._options;i.vertexFormat=this._materialProperty instanceof Kt?An.VERTEX_FORMAT:Cr.MaterialSupport.TEXTURED.vertexFormat,i.dimensions=t.dimensions.getValue(nt.MINIMUM_VALUE,i.dimensions),i.offsetAttribute=n!==We.NONE?pn.ALL:void 0};af.prototype._onEntityPropertyChanged=Z_;af.DynamicGeometryUpdater=xC;function xC(e,t,n){Ri.call(this,e,t,n)}l(Object.create)&&(xC.prototype=Object.create(Ri.prototype),xC.prototype.constructor=xC);xC.prototype._isHidden=function(e,t,n){let i=X.getValueOrUndefined(e.position,n,c7e),r=this._options.dimensions;return!l(i)||!l(r)||Ri.prototype._isHidden.call(this,e,t,n)};xC.prototype._setOptions=function(e,t,n){let i=X.getValueOrDefault(t.heightReference,n,We.NONE),r=this._options;r.dimensions=X.getValueOrUndefined(t.dimensions,n,r.dimensions),r.offsetAttribute=i!==We.NONE?pn.ALL:void 0};var Jk=af;function Vb(e,t,n){this._callback=void 0,this._isConstant=void 0,this._referenceFrame=n??Wi.FIXED,this._definitionChanged=new be,this.setCallback(e,t)}Object.defineProperties(Vb.prototype,{isConstant:{get:function(){return this._isConstant}},definitionChanged:{get:function(){return this._definitionChanged}},referenceFrame:{get:function(){return this._referenceFrame}}});var u7e=new K;Vb.prototype.getValue=function(e,t){return l(e)||(e=K.now(u7e)),this.getValueInReferenceFrame(e,Wi.FIXED,t)};Vb.prototype.setCallback=function(e,t){let n=this._callback!==e||this._isConstant!==t;this._callback=e,this._isConstant=t,n&&this._definitionChanged.raiseEvent(this)};Vb.prototype.getValueInReferenceFrame=function(e,t,n){let i=this._callback(e,n);return ep.convertToReferenceFrame(e,i,this._referenceFrame,t,n)};Vb.prototype.equals=function(e){return this===e||e instanceof Vb&&this._callback===e._callback&&this._isConstant===e._isConstant&&this._referenceFrame===e._referenceFrame};var Zk=Vb;/*! @license DOMPurify 3.4.14 | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/3.4.14/LICENSE */function Rhe(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,i=Array(t);n<t;n++)i[n]=e[n];return i}function f7e(e){if(Array.isArray(e))return e}function d7e(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var i,r,o,s,a=[],c=!0,u=!1;try{if(o=(n=n.call(e)).next,t!==0)for(;!(c=(i=o.call(n)).done)&&(a.push(i.value),a.length!==t);c=!0);}catch(f){u=!0,r=f}finally{try{if(!c&&n.return!=null&&(s=n.return(),Object(s)!==s))return}finally{if(u)throw r}}return a}}function h7e(){throw new TypeError(`Invalid attempt to destructure non-iterable instance. -In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function m7e(e,t){return f7e(e)||d7e(e,t)||p7e(e,t)||h7e()}function p7e(e,t){if(e){if(typeof e=="string")return Rhe(e,t);var n={}.toString.call(e).slice(8,-1);return n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set"?Array.from(e):n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Rhe(e,t):void 0}}var qhe=Object.entries,Ohe=Object.setPrototypeOf,g7e=Object.isFrozen,_7e=Object.getPrototypeOf,y7e=Object.getOwnPropertyDescriptor,Pa=Object.freeze,Ka=Object.seal,TC=Object.create,Yhe=typeof Reflect<"u"&&Reflect,nK=Yhe.apply,iK=Yhe.construct;Pa||(Pa=function(t){return t});Ka||(Ka=function(t){return t});nK||(nK=function(t,n){for(var i=arguments.length,r=new Array(i>2?i-2:0),o=2;o<i;o++)r[o-2]=arguments[o];return t.apply(n,r)});iK||(iK=function(t){for(var n=arguments.length,i=new Array(n>1?n-1:0),r=1;r<n;r++)i[r-1]=arguments[r];return new t(...i)});var Hb=la(Array.prototype.forEach),A7e=la(Array.prototype.lastIndexOf),Mhe=la(Array.prototype.pop),XP=la(Array.prototype.push),b7e=la(Array.prototype.splice),EC=Array.isArray,JP=la(String.prototype.toLowerCase),$X=la(String.prototype.toString),Nhe=la(String.prototype.match),KP=la(String.prototype.replace),Lhe=la(String.prototype.indexOf),x7e=la(String.prototype.trim),T7e=la(Number.prototype.toString),E7e=la(Boolean.prototype.toString),Fhe=typeof BigInt>"u"?null:la(BigInt.prototype.toString),Bhe=typeof Symbol>"u"?null:la(Symbol.prototype.toString),Au=la(Object.prototype.hasOwnProperty),$P=la(Object.prototype.toString),Gc=la(RegExp.prototype.test),jb=C7e(TypeError);function la(e){return function(t){t instanceof RegExp&&(t.lastIndex=0);for(var n=arguments.length,i=new Array(n>1?n-1:0),r=1;r<n;r++)i[r-1]=arguments[r];return nK(e,t,i)}}function C7e(e){return function(){for(var t=arguments.length,n=new Array(t),i=0;i<t;i++)n[i]=arguments[i];return iK(e,n)}}function vr(e,t){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:JP;if(Ohe&&Ohe(e,null),!EC(t))return e;let i=t.length;for(;i--;){let r=t[i];if(typeof r=="string"){let o=n(r);o!==r&&(g7e(t)||(t[i]=o),r=o)}e[r]=!0}return e}function v7e(e){for(let t=0;t<e.length;t++)Au(e,t)||(e[t]=null);return e}function lf(e){let t=TC(null);for(let i of qhe(e)){var n=m7e(i,2);let r=n[0],o=n[1];Au(e,r)&&(EC(o)?t[r]=v7e(o):o&&typeof o=="object"&&o.constructor===Object?t[r]=lf(o):t[r]=o)}return t}function S7e(e){switch(typeof e){case"string":return e;case"number":return T7e(e);case"boolean":return E7e(e);case"bigint":return Fhe?Fhe(e):"0";case"symbol":return Bhe?Bhe(e):"Symbol()";case"undefined":return $P(e);case"function":case"object":{if(e===null)return $P(e);let t=e,n=Th(t,"toString");if(typeof n=="function"){let i=n(t);return typeof i=="string"?i:$P(i)}return $P(e)}default:return $P(e)}}function Th(e,t){for(;e!==null;){let i=y7e(e,t);if(i){if(i.get)return la(i.get);if(typeof i.value=="function")return la(i.value)}e=_7e(e)}function n(){return null}return n}function w7e(e){try{return Gc(e,""),!0}catch{return!1}}var khe=Pa(["a","abbr","acronym","address","area","article","aside","audio","b","bdi","bdo","big","blink","blockquote","body","br","button","canvas","caption","center","cite","code","col","colgroup","content","data","datalist","dd","decorator","del","details","dfn","dialog","dir","div","dl","dt","element","em","fieldset","figcaption","figure","font","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","img","input","ins","kbd","label","legend","li","main","map","mark","marquee","menu","menuitem","meter","nav","nobr","ol","optgroup","option","output","p","picture","pre","progress","q","rp","rt","ruby","s","samp","search","section","select","shadow","slot","small","source","spacer","span","strike","strong","style","sub","summary","sup","table","tbody","td","template","textarea","tfoot","th","thead","time","tr","track","tt","u","ul","var","video","wbr"]),JX=Pa(["svg","a","altglyph","altglyphdef","altglyphitem","animatecolor","animatemotion","animatetransform","circle","clippath","defs","desc","ellipse","enterkeyhint","exportparts","filter","font","g","glyph","glyphref","hkern","image","inputmode","line","lineargradient","marker","mask","metadata","mpath","part","path","pattern","polygon","polyline","radialgradient","rect","stop","style","switch","symbol","text","textpath","title","tref","tspan","view","vkern"]),ZX=Pa(["feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feDropShadow","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence"]),I7e=Pa(["animate","color-profile","cursor","discard","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","foreignobject","hatch","hatchpath","mesh","meshgradient","meshpatch","meshrow","missing-glyph","script","set","solidcolor","unknown","use"]),QX=Pa(["math","menclose","merror","mfenced","mfrac","mglyph","mi","mlabeledtr","mmultiscripts","mn","mo","mover","mpadded","mphantom","mroot","mrow","ms","mspace","msqrt","mstyle","msub","msup","msubsup","mtable","mtd","mtext","mtr","munder","munderover","mprescripts"]),P7e=Pa(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),Uhe=Pa(["#text"]),zhe=Pa(["accept","action","align","alt","autocapitalize","autocomplete","autopictureinpicture","autoplay","background","bgcolor","border","capture","cellpadding","cellspacing","checked","cite","class","clear","color","cols","colspan","command","commandfor","controls","controlslist","coords","crossorigin","datetime","decoding","default","dir","disabled","disablepictureinpicture","disableremoteplayback","download","draggable","enctype","enterkeyhint","exportparts","face","for","headers","height","hidden","high","href","hreflang","id","inert","inputmode","integrity","ismap","kind","label","lang","list","loading","loop","low","max","maxlength","media","method","min","minlength","multiple","muted","name","nonce","noshade","novalidate","nowrap","open","optimum","part","pattern","placeholder","playsinline","popover","popovertarget","popovertargetaction","poster","preload","pubdate","radiogroup","readonly","rel","required","rev","reversed","role","rows","rowspan","spellcheck","scope","selected","shape","size","sizes","slot","span","srclang","start","src","srcset","step","style","summary","tabindex","title","translate","type","usemap","valign","value","width","wrap","xmlns"]),eK=Pa(["accent-height","accumulate","additive","alignment-baseline","amplitude","ascent","attributename","attributetype","azimuth","basefrequency","baseline-shift","begin","bias","by","class","clip","clippathunits","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","cx","cy","d","dx","dy","diffuseconstant","direction","display","divisor","dominant-baseline","dur","edgemode","elevation","end","exponent","fill","fill-opacity","fill-rule","filter","filterunits","flood-color","flood-opacity","font-family","font-size","font-size-adjust","font-stretch","font-style","font-variant","font-weight","fx","fy","g1","g2","glyph-name","glyphref","gradientunits","gradienttransform","height","href","id","image-rendering","in","in2","intercept","k","k1","k2","k3","k4","kerning","keypoints","keysplines","keytimes","lang","lengthadjust","letter-spacing","kernelmatrix","kernelunitlength","lighting-color","local","marker-end","marker-mid","marker-start","markerheight","markerunits","markerwidth","maskcontentunits","maskunits","max","mask","mask-type","media","method","mode","min","name","numoctaves","offset","operator","opacity","order","orient","orientation","origin","overflow","paint-order","path","pathlength","patterncontentunits","patterntransform","patternunits","pointer-events","points","preservealpha","preserveaspectratio","primitiveunits","r","rx","ry","radius","refx","refy","repeatcount","repeatdur","restart","result","rotate","scale","seed","shape-rendering","slope","specularconstant","specularexponent","spreadmethod","startoffset","stddeviation","stitchtiles","stop-color","stop-opacity","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke","stroke-width","style","surfacescale","systemlanguage","tabindex","tablevalues","targetx","targety","transform","transform-origin","text-anchor","text-decoration","text-orientation","text-rendering","textlength","type","u1","u2","unicode","values","vector-effect","viewbox","visibility","version","vert-adv-y","vert-origin-x","vert-origin-y","width","word-spacing","wrap","writing-mode","xchannelselector","ychannelselector","x","x1","x2","xmlns","y","y1","y2","z","zoomandpan"]),Vhe=Pa(["accent","accentunder","align","bevelled","close","columnalign","columnlines","columnspacing","columnspan","denomalign","depth","dir","display","displaystyle","encoding","fence","frame","height","href","id","largeop","length","linethickness","lquote","lspace","mathbackground","mathcolor","mathsize","mathvariant","maxsize","minsize","movablelimits","notation","numalign","open","rowalign","rowlines","rowspacing","rowspan","rspace","rquote","scriptlevel","scriptminsize","scriptsizemultiplier","selection","separator","separators","stretchy","subscriptshift","supscriptshift","symmetric","voffset","width","xmlns"]),Qk=Pa(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),D7e=Ka(/{{[\w\W]*|^[\w\W]*}}/g),R7e=Ka(/<%[\w\W]*|^[\w\W]*%>/g),O7e=Ka(/\${[\w\W]*/g),M7e=Ka(/^data-[\-\w.\u00B7-\uFFFF]+$/),N7e=Ka(/^aria-[\-\w]+$/),jhe=Ka(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),L7e=Ka(/^(?:\w+script|data):/i),F7e=Ka(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),B7e=Ka(/^html$/i),k7e=Ka(/^[a-z][.\w]*(-[.\w]+)+$/i),Hhe=Ka(/<[/\w!]/g),Ghe=Ka(/<[/\w]/g),U7e=Ka(/<\/no(script|embed|frames)/i),z7e=Ka(/\/>/i),cf={element:1,attribute:2,text:3,cdataSection:4,entityReference:5,entityNode:6,processingInstruction:7,comment:8,document:9,documentType:10,documentFragment:11,notation:12},Xhe=["style","script","xmp","iframe","noembed","noframes","plaintext","noscript"],V7e=Pa(vr({},Xhe)),j7e=(function(){let e={};return Hb(Xhe,t=>{e[t]=Ka(new RegExp("</"+t+"(?=[\\t\\n\\f\\r />])","i"))}),Pa(e)})(),H7e=function(){return typeof window>"u"?null:window},G7e=function(t,n){if(typeof t!="object"||typeof t.createPolicy!="function")return null;let i=null,r="data-tt-policy-suffix";n&&n.hasAttribute(r)&&(i=n.getAttribute(r));let o="dompurify"+(i?"#"+i:"");try{return t.createPolicy(o,{createHTML(s){return s},createScriptURL(s){return s}})}catch{return console.warn("TrustedTypes policy "+o+" could not be created."),null}},Whe=function(){return{afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}},Q_=function(t,n,i,r){return Au(t,n)&&EC(t[n])?vr(r.base?lf(r.base):{},t[n],r.transform):i},tK=function(t,n,i){let r=Au(t,n)?t[n]:void 0;return r&&typeof r=="object"?lf(r):i()};function Khe(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:H7e(),t=Et=>Khe(Et);if(t.version="3.4.14",t.removed=[],!e||!e.document||e.document.nodeType!==cf.document||!e.Element)return t.isSupported=!1,t;let n=e.document,i=n,r=i.currentScript;e.DocumentFragment;let o=e.HTMLTemplateElement,s=e.Node,a=e.Element,c=e.NodeFilter,u=e.NamedNodeMap;u===void 0&&(e.NamedNodeMap||e.MozNamedAttrMap),e.HTMLFormElement;let f=e.DOMParser,d=e.trustedTypes,p=a.prototype,g=Th(p,"cloneNode"),m=Th(p,"remove"),y=Th(p,"nextSibling"),A=Th(p,"childNodes"),b=Th(p,"parentNode"),x=Th(p,"shadowRoot"),T=Th(p,"attributes"),E=s&&s.prototype?Th(s.prototype,"nodeType"):null,v=s&&s.prototype?Th(s.prototype,"nodeName"):null,S=s&&s.prototype?Th(s.prototype,"ownerDocument"):null,I=function(ye){return E?E(ye):ye.nodeType},R=function(ye){return v?v(ye):ye.nodeName};if(typeof o=="function"){let Et=n.createElement("template");Et.content&&Et.content.ownerDocument&&(n=Et.content.ownerDocument)}let O,L="",_,C=!1,w=0,D=function(){if(w>0)throw jb('A configured TRUSTED_TYPES_POLICY callback (createHTML or createScriptURL) must not call DOMPurify.sanitize, as that causes infinite recursion. Do not pass a policy whose callbacks wrap DOMPurify as TRUSTED_TYPES_POLICY; see the "DOMPurify and Trusted Types" section of the README.')},N=function(ye){D(),w++;try{return O.createHTML(ye)}finally{w--}},F=function(ye){D(),w++;try{return O.createScriptURL(ye)}finally{w--}},V=function(){return C||(_=G7e(d,r),C=!0),_},B=n,j=B.implementation,k=B.createNodeIterator,G=B.createDocumentFragment,q=B.getElementsByTagName,Q=i.importNode,W=Whe();t.isSupported=typeof qhe=="function"&&typeof b=="function"&&j&&j.createHTMLDocument!==void 0;let J=D7e,Z=R7e,ae=O7e,Ae=M7e,fe=N7e,xe=L7e,ge=F7e,we=k7e,ve=jhe,Re=null,Qe=vr({},[...khe,...JX,...ZX,...QX,...Uhe]),He=null,Ye=vr({},[...zhe,...eK,...Vhe,...Qk]),Ke=Object.seal(TC(null,{tagNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},allowCustomizedBuiltInElements:{writable:!0,configurable:!1,enumerable:!0,value:!1}})),Pe=null,qe=null,st=Object.seal(TC(null,{tagCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeCheck:{writable:!0,configurable:!1,enumerable:!0,value:null}})),vt=!0,jt=!0,lt=!1,mt=!0,ft=!1,Yt=!0,rt=!1,ht=!1,Li=null,Yn=null,yi=!1,zi=!1,Si=!1,ui=!1,Ai=!0,zn=!1,tn="user-content-",Hn=!0,Ki=!1,wr={},so=null,Ts=vr({},["annotation-xml","audio","colgroup","desc","foreignobject","head","iframe","math","mi","mn","mo","ms","mtext","noembed","noframes","noscript","plaintext","script","selectedcontent","style","svg","template","thead","title","video","xmp"]),zs=null,$r=vr({},["audio","video","img","source","image","track"]),pi=null,ao=vr({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),nr="http://www.w3.org/1998/Math/MathML",jo="http://www.w3.org/2000/svg",Fn="http://www.w3.org/1999/xhtml",Vi=Fn,Fi=!1,Ir=null,Mc=vr({},[nr,jo,Fn],$X),Yf=Pa(["mi","mo","mn","ms","mtext"]),Rm=vr({},Yf),ch=Pa(["annotation-xml"]),na=vr({},ch),Om=vr({},["title","style","font","a","script"]),Es=null,Ha=["application/xhtml+xml","text/html"],ub="text/html",ii=null,Wr=null,_l=n.createElement("form"),w0=function(ye){return ye instanceof RegExp||ye instanceof Function},Ca=function(){let ye=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(Wr&&Wr===ye)return;(!ye||typeof ye!="object")&&(ye={}),ye=lf(ye),Es=Ha.indexOf(ye.PARSER_MEDIA_TYPE)===-1?ub:ye.PARSER_MEDIA_TYPE,ii=Es==="application/xhtml+xml"?$X:JP,Re=Q_(ye,"ALLOWED_TAGS",Qe,{transform:ii}),He=Q_(ye,"ALLOWED_ATTR",Ye,{transform:ii}),Ir=Q_(ye,"ALLOWED_NAMESPACES",Mc,{transform:$X}),pi=Q_(ye,"ADD_URI_SAFE_ATTR",ao,{transform:ii,base:ao}),zs=Q_(ye,"ADD_DATA_URI_TAGS",$r,{transform:ii,base:$r}),so=Q_(ye,"FORBID_CONTENTS",Ts,{transform:ii}),Pe=Q_(ye,"FORBID_TAGS",lf({}),{transform:ii}),qe=Q_(ye,"FORBID_ATTR",lf({}),{transform:ii}),wr=Au(ye,"USE_PROFILES")?ye.USE_PROFILES&&typeof ye.USE_PROFILES=="object"?lf(ye.USE_PROFILES):ye.USE_PROFILES:!1,vt=ye.ALLOW_ARIA_ATTR!==!1,jt=ye.ALLOW_DATA_ATTR!==!1,lt=ye.ALLOW_UNKNOWN_PROTOCOLS||!1,mt=ye.ALLOW_SELF_CLOSE_IN_ATTR!==!1,ft=ye.SAFE_FOR_TEMPLATES||!1,Yt=ye.SAFE_FOR_XML!==!1,rt=ye.WHOLE_DOCUMENT||!1,zi=ye.RETURN_DOM||!1,Si=ye.RETURN_DOM_FRAGMENT||!1,ui=ye.RETURN_TRUSTED_TYPE||!1,yi=ye.FORCE_BODY||!1,Ai=ye.SANITIZE_DOM!==!1,zn=ye.SANITIZE_NAMED_PROPS||!1,Hn=ye.KEEP_CONTENT!==!1,Ki=ye.IN_PLACE||!1,ve=w7e(ye.ALLOWED_URI_REGEXP)?ye.ALLOWED_URI_REGEXP:jhe,Vi=typeof ye.NAMESPACE=="string"?ye.NAMESPACE:Fn,Rm=tK(ye,"MATHML_TEXT_INTEGRATION_POINTS",()=>vr({},Yf)),na=tK(ye,"HTML_INTEGRATION_POINTS",()=>vr({},ch));let Fe=tK(ye,"CUSTOM_ELEMENT_HANDLING",()=>TC(null));if(Ke=TC(null),Au(Fe,"tagNameCheck")&&w0(Fe.tagNameCheck)&&(Ke.tagNameCheck=Fe.tagNameCheck),Au(Fe,"attributeNameCheck")&&w0(Fe.attributeNameCheck)&&(Ke.attributeNameCheck=Fe.attributeNameCheck),Au(Fe,"allowCustomizedBuiltInElements")&&typeof Fe.allowCustomizedBuiltInElements=="boolean"&&(Ke.allowCustomizedBuiltInElements=Fe.allowCustomizedBuiltInElements),Ka(Ke),ft&&(jt=!1),Si&&(zi=!0),wr&&(Re=vr({},Uhe),He=TC(null),wr.html===!0&&(vr(Re,khe),vr(He,zhe)),wr.svg===!0&&(vr(Re,JX),vr(He,eK),vr(He,Qk)),wr.svgFilters===!0&&(vr(Re,ZX),vr(He,eK),vr(He,Qk)),wr.mathMl===!0&&(vr(Re,QX),vr(He,Vhe),vr(He,Qk))),st.tagCheck=null,st.attributeCheck=null,Au(ye,"ADD_TAGS")&&(typeof ye.ADD_TAGS=="function"?st.tagCheck=ye.ADD_TAGS:EC(ye.ADD_TAGS)&&(Re===Qe&&(Re=lf(Re)),vr(Re,ye.ADD_TAGS,ii))),Au(ye,"ADD_ATTR")&&(typeof ye.ADD_ATTR=="function"?st.attributeCheck=ye.ADD_ATTR:EC(ye.ADD_ATTR)&&(He===Ye&&(He=lf(He)),vr(He,ye.ADD_ATTR,ii))),Au(ye,"ADD_FORBID_CONTENTS")&&EC(ye.ADD_FORBID_CONTENTS)&&(so===Ts&&(so=lf(so)),vr(so,ye.ADD_FORBID_CONTENTS,ii)),Hn&&(Re["#text"]=!0),rt&&vr(Re,["html","head","body"]),Re.table&&(vr(Re,["tbody"]),delete Pe.tbody),ye.TRUSTED_TYPES_POLICY){if(typeof ye.TRUSTED_TYPES_POLICY.createHTML!="function")throw jb('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if(typeof ye.TRUSTED_TYPES_POLICY.createScriptURL!="function")throw jb('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');let gt=O;O=ye.TRUSTED_TYPES_POLICY;try{L=N("")}catch(on){throw O=gt,on}}else ye.TRUSTED_TYPES_POLICY===null?(O=void 0,L=""):(O===void 0&&(O=V()),O&&typeof L=="string"&&(L=N("")));Pa&&Pa(ye),Wr=ye},Mm=vr({},[...JX,...ZX,...I7e]),b_=vr({},[...QX,...P7e]),iq=function(ye,Fe,gt){return Fe.namespaceURI===Fn?ye==="svg":Fe.namespaceURI===nr?ye==="svg"&&(gt==="annotation-xml"||Rm[gt]):!!Mm[ye]},rq=function(ye,Fe,gt){return Fe.namespaceURI===Fn?ye==="math":Fe.namespaceURI===jo?ye==="math"&&na[gt]:!!b_[ye]},oq=function(ye,Fe,gt){return Fe.namespaceURI===jo&&!na[gt]||Fe.namespaceURI===nr&&!Rm[gt]?!1:!b_[ye]&&(Om[ye]||!Mm[ye])},sq=function(ye){let Fe=b(ye);(!Fe||!Fe.tagName)&&(Fe={namespaceURI:Vi,tagName:"template"});let gt=JP(ye.tagName),on=JP(Fe.tagName);return Ir[ye.namespaceURI]?ye.namespaceURI===jo?iq(gt,Fe,on):ye.namespaceURI===nr?rq(gt,Fe,on):ye.namespaceURI===Fn?oq(gt,Fe,on):!!(Es==="application/xhtml+xml"&&Ir[ye.namespaceURI]):!1},Nm=function(ye){XP(t.removed,{element:ye});try{b(ye).removeChild(ye)}catch{if(m(ye),!b(ye))throw jb("a node selected for removal could not be detached from its tree and cannot be safely returned; refusing to sanitize in place")}},hE=function(ye,Fe,gt){try{ye.removeAttributeNode(Fe)}catch{try{ye.removeAttribute(gt)}catch{}}},fb=function(ye){db(ye);let Fe=A(ye);if(Fe){let on=[];Hb(Fe,wn=>{XP(on,wn)}),Hb(on,wn=>{try{m(wn)}catch{}})}let gt=T(ye);if(gt)for(let on=gt.length-1;on>=0;--on){let wn=gt[on],ri=wn&&wn.name;typeof ri=="string"&&hE(ye,wn,ri)}},lh=function(ye,Fe,gt){if(!gt)try{gt=Fe.getAttributeNode(ye)}catch{gt=null}XP(t.removed,{attribute:gt||null,from:Fe});try{gt?Fe.removeAttributeNode(gt):Fe.removeAttribute(ye)}catch{try{Fe.removeAttribute(ye)}catch{}}if(ye==="is")if(zi||Si)try{Nm(Fe)}catch{}else try{Fe.setAttribute(ye,"")}catch{}},aq=function(ye){let Fe=T(ye);if(Fe)for(let gt=Fe.length-1;gt>=0;--gt){let on=Fe[gt],wn=on&&on.name;typeof wn!="string"||He[ii(wn)]||hE(ye,on,wn)}},db=function(ye){let Fe=[ye];for(;Fe.length>0;){let gt=Fe.pop();I(gt)===cf.element&&aq(gt);let wn=A(gt);if(wn)for(let ri=wn.length-1;ri>=0;--ri)Fe.push(wn[ri])}},mE=function(ye,Fe){return Yt?ye==="patchsrc"?!0:ye==="for"&&Fe!=="label"&&Fe!=="output":!1},Lm=function(ye){if(!Yt)return;let Fe=[ye];for(;Fe.length>0;){let gt=Fe.pop(),on=I(gt);if(on===cf.processingInstruction||on===cf.comment&&Gc(Ghe,gt.data)){try{m(gt)}catch{}continue}if(on===cf.element){let ri=gt,bo=ii(R(gt));try{ri.hasAttribute&&ri.hasAttribute("patchsrc")&&ri.removeAttribute("patchsrc"),ri.hasAttribute&&ri.hasAttribute("for")&&mE("for",bo)&&ri.removeAttribute("for")}catch{}}let wn=A(gt);if(wn)for(let ri=wn.length-1;ri>=0;--ri)Fe.push(wn[ri])}},hb=function(ye){let Fe=null,gt=null;if(yi)ye="<remove></remove>"+ye;else{let ri=Nhe(ye,/^[\r\n\t ]+/);gt=ri&&ri[0]}Es==="application/xhtml+xml"&&Vi===Fn&&(ye='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+ye+"</body></html>");let on=O?N(ye):ye;if(Vi===Fn)try{Fe=new f().parseFromString(on,Es)}catch{}if(!Fe||!Fe.documentElement){Fe=j.createDocument(Vi,"template",null);try{Fe.documentElement.innerHTML=Fi?L:on}catch{}}let wn=Fe.body||Fe.documentElement;return ye&>&&wn.insertBefore(n.createTextNode(gt),wn.childNodes[0]||null),Vi===Fn?q.call(Fe,rt?"html":"body")[0]:rt?Fe.documentElement:wn},NI=function(ye){let Fe=S?S(ye):ye.ownerDocument;return k.call(Fe||ye,ye,c.SHOW_ELEMENT|c.SHOW_COMMENT|c.SHOW_TEXT|c.SHOW_PROCESSING_INSTRUCTION|c.SHOW_CDATA_SECTION,null)},pE=function(ye){return ye=KP(ye,J," "),ye=KP(ye,Z," "),ye=KP(ye,ae," "),ye},x_=function(ye){var Fe;ye.normalize();let gt=S?S(ye):ye.ownerDocument,on=k.call(gt||ye,ye,c.SHOW_TEXT|c.SHOW_COMMENT|c.SHOW_CDATA_SECTION|c.SHOW_PROCESSING_INSTRUCTION,null),wn=on.nextNode();for(;wn;)wn.data=pE(wn.data),wn=on.nextNode();let ri=(Fe=ye.querySelectorAll)===null||Fe===void 0?void 0:Fe.call(ye,"template");ri&&Hb(ri,bo=>{ne(bo.content)&&x_(bo.content)})},ce=function(ye){let Fe=v?v(ye):null;return typeof Fe!="string"||ii(Fe)!=="form"?!1:typeof ye.nodeName!="string"||typeof ye.textContent!="string"||typeof ye.removeChild!="function"||ye.attributes!==T(ye)||typeof ye.removeAttribute!="function"||typeof ye.setAttribute!="function"||typeof ye.namespaceURI!="string"||typeof ye.insertBefore!="function"||typeof ye.hasChildNodes!="function"||ye.nodeType!==E(ye)||ye.childNodes!==A(ye)},ne=function(ye){if(!E||typeof ye!="object"||ye===null)return!1;try{return E(ye)===cf.documentFragment}catch{return!1}},Te=function(ye){if(!E||typeof ye!="object"||ye===null)return!1;try{return typeof E(ye)=="number"}catch{return!1}};function Ce(Et,ye,Fe){Et.length!==0&&Hb(Et,gt=>{gt.call(t,ye,Fe,Wr)})}let Je=function(ye,Fe){return!!(Yt&&ye.hasChildNodes()&&!Te(ye.firstElementChild)&&Gc(Hhe,ye.textContent)&&Gc(Hhe,ye.innerHTML)||Yt&&ye.namespaceURI===Fn&&V7e[Fe]&&(Te(ye.firstElementChild)||typeof ye.textContent=="string"&&Gc(j7e[Fe],ye.textContent))||ye.nodeType===cf.processingInstruction||Yt&&ye.nodeType===cf.comment&&Gc(Ghe,ye.data))},Tt=function(ye,Fe){if(ye instanceof RegExp)return Gc(ye,Fe);if(ye instanceof Function){for(var gt=arguments.length,on=new Array(gt>2?gt-2:0),wn=2;wn<gt;wn++)on[wn-2]=arguments[wn];return!!ye(Fe,...on)}return!1},pt=function(ye,Fe,gt){if(!Pe[Fe]&&co(Fe)&&Tt(Ke.tagNameCheck,Fe))return!1;if(Hn&&!so[Fe]){let on=b(ye),wn=A(ye);if(wn&&on){let ri=wn.length;for(let bo=ri-1;bo>=0;--bo){let rs=ye===gt?g(wn[bo],!0):wn[bo];on.insertBefore(rs,y(ye))}}}return Nm(ye),!0},St=function(ye,Fe,gt,on){return ye.length===0?Fe:Fe===gt||Fe===on?lf(Fe):Fe},bn=function(ye,Fe){return ye===Fe||b(ye)!==null?!1:(Ki&&db(ye),!0)},Gn=function(ye,Fe){if(Ce(W.beforeSanitizeElements,ye,null),bn(ye,Fe))return!0;if(ce(ye))return Nm(ye),!0;let gt=ii(R(ye));if(Re=St(W.uponSanitizeElement,Re,Qe,Li),Ce(W.uponSanitizeElement,ye,{tagName:gt,allowedTags:Re}),bn(ye,Fe))return!0;if(Je(ye,gt))return Nm(ye),!0;if(Pe[gt]||!(st.tagCheck instanceof Function&&st.tagCheck(gt))&&!Re[gt]){let wn=pt(ye,gt,Fe);return wn===!1&&Ce(W.afterSanitizeElements,ye,null),wn}if(I(ye)===cf.element&&!sq(ye)||(gt==="noscript"||gt==="noembed"||gt==="noframes")&&Gc(U7e,ye.innerHTML))return Nm(ye),!0;if(ft&&ye.nodeType===cf.text){let wn=pE(ye.textContent);ye.textContent!==wn&&(XP(t.removed,{element:ye.cloneNode()}),ye.textContent=wn)}return Ce(W.afterSanitizeElements,ye,null),!1},mn=function(ye,Fe,gt){if(qe[Fe]||mE(Fe,ye)||Ai&&(Fe==="id"||Fe==="name")&&(gt in n||gt in _l))return!1;let on=He[Fe]||st.attributeCheck instanceof Function&&st.attributeCheck(Fe,ye);return jt&&Gc(Ae,Fe)||vt&&Gc(fe,Fe)?!0:on?pi[Fe]||Gc(ve,KP(gt,ge,""))||(Fe==="src"||Fe==="xlink:href"||Fe==="href")&&ye!=="script"&&Lhe(gt,"data:")===0&&zs[ye]||lt&&!Gc(xe,KP(gt,ge,""))?!0:!gt:co(ye)&&Tt(Ke.tagNameCheck,ye)&&Tt(Ke.attributeNameCheck,Fe,ye)||Fe==="is"&&Ke.allowCustomizedBuiltInElements&&Tt(Ke.tagNameCheck,gt)},Ao=vr({},["annotation-xml","color-profile","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","missing-glyph"]),co=function(ye){return!Ao[JP(ye)]&&Gc(we,ye)},Vs=function(ye,Fe,gt,on){if(O&&typeof d=="object"&&typeof d.getAttributeType=="function"&&!gt)switch(d.getAttributeType(ye,Fe)){case"TrustedHTML":return N(on);case"TrustedScriptURL":return F(on)}return on},pc=function(ye,Fe,gt,on){try{gt?ye.setAttributeNS(gt,Fe,on):ye.setAttribute(Fe,on),ce(ye)?Nm(ye):Mhe(t.removed)}catch{lh(Fe,ye)}},yl=function(ye){Ce(W.beforeSanitizeAttributes,ye,null);let Fe=ye.attributes;if(!Fe||ce(ye))return;He=St(W.uponSanitizeAttribute,He,Ye,Yn);let gt={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:He,forceKeepAttr:void 0},on=Fe.length,wn=ii(ye.nodeName);for(;on--;){let ri=Fe[on],bo=ri.name,rs=ri.namespaceURI,nu=ri.value,iu=ii(bo),cq=nu,Al=bo==="value"?cq:x7e(cq);if(gt.attrName=iu,gt.attrValue=Al,gt.keepAttr=!0,gt.forceKeepAttr=void 0,Ce(W.uponSanitizeAttribute,ye,gt),Al=gt.attrValue,zn&&(iu==="id"||iu==="name")&&Lhe(Al,tn)!==0&&(lh(bo,ye,ri),Al=tn+Al),Yt&&Gc(/((--!?|])>)|<\/(style|script|title|xmp|textarea|noscript|iframe|noembed|noframes)/i,Al)){lh(bo,ye,ri);continue}if(iu==="attributename"&&Nhe(Al,"href")){lh(bo,ye,ri);continue}if(!gt.forceKeepAttr){if(!gt.keepAttr){lh(bo,ye,ri);continue}if(!mt&&Gc(z7e,Al)){lh(bo,ye,ri);continue}if(ft&&(Al=pE(Al)),!mn(wn,iu,Al)){lh(bo,ye,ri);continue}Al=Vs(wn,iu,rs,Al),Al!==cq&&pc(ye,bo,rs,Al)}}Ce(W.afterSanitizeAttributes,ye,null)},tu=function(ye){let Fe=null,gt=NI(ye);for(Ce(W.beforeSanitizeShadowDOM,ye,null);Fe=gt.nextNode();)if(Ce(W.uponSanitizeShadowNode,Fe,null),Gn(Fe,ye),yl(Fe),ne(Fe.content)&&tu(Fe.content),I(Fe)===cf.element){let on=x(Fe);ne(on)&&(I0(on),tu(on))}Ce(W.afterSanitizeShadowDOM,ye,null)},I0=function(ye){let Fe=[{node:ye,shadow:null}];for(;Fe.length>0;){let gt=Fe.pop();if(gt.shadow){tu(gt.shadow);continue}let on=gt.node,ri=I(on)===cf.element,bo=A(on);if(bo)for(let rs=bo.length-1;rs>=0;--rs)Fe.push({node:bo[rs],shadow:null});if(ri){let rs=v?v(on):null;if(typeof rs=="string"&&ii(rs)==="template"){let nu=on.content;ne(nu)&&Fe.push({node:nu,shadow:null})}}if(ri){let rs=x(on);ne(rs)&&Fe.push({node:null,shadow:rs},{node:rs,shadow:null})}}};return t.sanitize=function(Et){let ye=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},Fe=null,gt=null,on=null,wn=null;if(Fi=!Et,Fi&&(Et="<!-->"),typeof Et!="string"&&!Te(Et)&&(Et=S7e(Et),typeof Et!="string"))throw jb("dirty is not a string, aborting");if(!t.isSupported)return Et;ht?(Re=Li,He=Yn):Ca(ye),(W.uponSanitizeElement.length>0||W.uponSanitizeAttribute.length>0)&&(Re=lf(Re)),W.uponSanitizeAttribute.length>0&&(He=lf(He)),t.removed=[];let ri=Ki&&typeof Et!="string"&&Te(Et);if(ri){Lm(Et);let nu=R(Et);if(typeof nu=="string"){let iu=ii(nu);if(!Re[iu]||Pe[iu])throw fb(Et),jb("root node is forbidden and cannot be sanitized in-place")}if(ce(Et))throw fb(Et),jb("root node is clobbered and cannot be sanitized in-place");try{I0(Et)}catch(iu){throw fb(Et),iu}}else if(Te(Et))Fe=hb("<!---->"),gt=Fe.ownerDocument.importNode(Et,!0),gt.nodeType===cf.element&>.nodeName==="BODY"||gt.nodeName==="HTML"?Fe=gt:Fe.appendChild(gt),I0(gt);else{if(!zi&&!ft&&!rt&&Et.indexOf("<")===-1)return O&&ui?N(Et):Et;if(Fe=hb(Et),!Fe)return zi?null:ui?L:""}Fe&&yi&&Nm(Fe.firstChild);let bo=ri?Et:Fe;try{let nu=NI(bo);for(;on=nu.nextNode();)Gn(on,bo),yl(on),ne(on.content)&&tu(on.content)}catch(nu){throw ri&&(fb(Et),Hb(t.removed,iu=>{iu.element&&db(iu.element)})),nu}if(ri)return Hb(t.removed,nu=>{nu.element&&db(nu.element)}),ft&&x_(Et),Et;if(zi){if(ft&&x_(Fe),Si)for(wn=G.call(Fe.ownerDocument);Fe.firstChild;)wn.appendChild(Fe.firstChild);else wn=Fe;return(He.shadowroot||He.shadowrootmode)&&(wn=Q.call(i,wn,!0)),wn}let rs=rt?Fe.outerHTML:Fe.innerHTML;return rt&&Re["!doctype"]&&Fe.ownerDocument&&Fe.ownerDocument.doctype&&Fe.ownerDocument.doctype.name&&Gc(B7e,Fe.ownerDocument.doctype.name)&&(rs="<!DOCTYPE "+Fe.ownerDocument.doctype.name+`> -`+rs),ft&&(rs=pE(rs)),O&&ui?N(rs):rs},t.setConfig=function(){let Et=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};Ca(Et),ht=!0,Li=Re,Yn=He},t.clearConfig=function(){Wr=null,ht=!1,Li=null,Yn=null,O=_,L=""},t.isValidAttribute=function(Et,ye,Fe){Wr||Ca({});let gt=ii(Et),on=ii(ye);return mn(gt,on,Fe)},t.addHook=function(Et,ye){typeof ye=="function"&&Au(W,Et)&&XP(W[Et],ye)},t.removeHook=function(Et,ye){if(Au(W,Et)){if(ye!==void 0){let Fe=A7e(W[Et],ye);return Fe===-1?void 0:b7e(W[Et],Fe,1)[0]}return Mhe(W[Et])}},t.removeHooks=function(Et){Au(W,Et)&&(W[Et]=[])},t.removeAllHooks=function(){W=Whe()},t}var $he=Khe();var W7e=0,rK={},oK=class e{constructor(t,n){let i,r=t;l(rK[r])?i=rK[r]:(i=W7e++,rK[r]=i),n=n??!1,this._id=i,this._html=t,this._showOnScreen=n,this._element=void 0}get html(){return this._html}get id(){return this._id}get showOnScreen(){return this._showOnScreen}set showOnScreen(t){this._showOnScreen=t}get element(){if(!l(this._element)){let t=$he.sanitize(this._html),n=document.createElement("div");n.className="cesium-credit-wrapper",n._creditId=this._id,n.style.display="inline",n.innerHTML=t;let i=n.querySelectorAll("a");for(let r=0;r<i.length;r++)i[r].setAttribute("target","_blank");this._element=n}return this._element}static equals(t,n){return t===n||l(t)&&l(n)&&t._id===n._id&&t._showOnScreen===n._showOnScreen}equals(t){return e.equals(this,t)}isIon(){return this.html.indexOf("ion-credit.png")!==-1}static getIonCredit(t){let n=l(t.collapsible)&&!t.collapsible;return new e(t.html,n)}static clone(t){if(l(t))return new e(t.html,t.showOnScreen)}},It=oK;function q7e(e,t){yt(e,t)}var Yr=q7e;function Gb(e){this._url=e,this._cubeMapBuffers=void 0,this._texture=void 0,this._maximumMipmapLevel=void 0,this._loading=!1,this._ready=!1,this._errorEvent=new be}Object.defineProperties(Gb.prototype,{url:{get:function(){return this._url}},errorEvent:{get:function(){return this._errorEvent}},texture:{get:function(){return this._texture}},maximumMipmapLevel:{get:function(){return this._maximumMipmapLevel}},ready:{get:function(){return this._ready}}});Gb.isSupported=function(e){return(e.colorBufferHalfFloat&&e.halfFloatingPointTexture||e.floatingPointTexture&&e.colorBufferFloat)&&e.supportsTextureLod};function sK(e){e._cubeMapBuffers=void 0}Gb.prototype.update=function(e){let{context:t}=e;if(!Gb.isSupported(t))return;if(l(this._texture)){sK(this);return}if(!l(this._texture)&&!this._loading){let f=t.textureCache.getTexture(this._url);l(f)&&(sK(this),this._texture=f,this._maximumMipmapLevel=this._texture.maximumMipmapLevel,this._ready=!0)}let n=this._cubeMapBuffers;if(!l(n)&&!this._loading){let f=this;nf(this._url).then(function(d){f._cubeMapBuffers=d,f._loading=!1}).catch(function(d){f.isDestroyed()||f._errorEvent.raiseEvent(d)}),this._loading=!0}if(!l(this._cubeMapBuffers))return;let{pixelDatatype:i}=n[0].positiveX;l(i)||(i=t.halfFloatingPointTexture?ze.HALF_FLOAT:ze.FLOAT);let r=$e.RGBA,o=n.length;this._maximumMipmapLevel=o-1;let s=n[0].positiveX.width,a=Math.log2(s)+1;if(o!==a){let f={};Object.values(ls.FaceName).forEach(d=>{f[d]=void 0});for(let d=o;d<a;d++)n.push(f)}let c=new Ht({minificationFilter:Wt.LINEAR_MIPMAP_LINEAR}),u=new ls({context:t,source:n[0],flipY:!1,pixelDatatype:i,pixelFormat:r,sampler:c});u.loadMipmaps(n.slice(1)),this._texture=u,this._texture.maximumMipmapLevel=this._maximumMipmapLevel,t.textureCache.addTexture(this._url,this._texture),this._ready=!0};Gb.prototype.isDestroyed=function(){return!1};Gb.prototype.destroy=function(){return sK(this),this._texture=this._texture&&this._texture.destroy(),le(this)};var op=Gb;function ZP(e){e=e??H.EMPTY_OBJECT;let t=l(e.imageBasedLightingFactor)?U.clone(e.imageBasedLightingFactor):new U(1,1);this._imageBasedLightingFactor=t;let n=e.sphericalHarmonicCoefficients;this._sphericalHarmonicCoefficients=n,this._specularEnvironmentMaps=e.specularEnvironmentMaps,this._specularEnvironmentCubeMap=void 0,this._specularEnvironmentCubeMapDirty=!0,this._specularEnvironmentMapLoaded=!1,this._previousSpecularEnvironmentMapLoaded=!1,this._useDefaultSpecularMaps=!1,this._useDefaultSphericalHarmonics=!1,this._shouldRegenerateShaders=!1,this._previousFrameNumber=void 0,this._previousFrameContext=void 0,this._previousImageBasedLightingFactor=U.clone(t),this._previousSphericalHarmonicCoefficients=n,this._removeErrorListener=void 0}Object.defineProperties(ZP.prototype,{imageBasedLightingFactor:{get:function(){return this._imageBasedLightingFactor},set:function(e){this._previousImageBasedLightingFactor=U.clone(this._imageBasedLightingFactor,this._previousImageBasedLightingFactor),this._imageBasedLightingFactor=U.clone(e,this._imageBasedLightingFactor)}},sphericalHarmonicCoefficients:{get:function(){return this._sphericalHarmonicCoefficients},set:function(e){this._previousSphericalHarmonicCoefficients=this._sphericalHarmonicCoefficients,this._sphericalHarmonicCoefficients=e}},specularEnvironmentMaps:{get:function(){return this._specularEnvironmentMaps},set:function(e){e!==this._specularEnvironmentMaps&&(this._specularEnvironmentCubeMapDirty=this._specularEnvironmentCubeMapDirty||e!==this._specularEnvironmentMaps,this._specularEnvironmentMapLoaded=!1),this._specularEnvironmentMaps=e}},enabled:{get:function(){return this._imageBasedLightingFactor.x>0||this._imageBasedLightingFactor.y>0}},shouldRegenerateShaders:{get:function(){return this._shouldRegenerateShaders}},specularEnvironmentCubeMap:{get:function(){return this._specularEnvironmentCubeMap}},useDefaultSphericalHarmonics:{get:function(){return this._useDefaultSphericalHarmonics}},useDefaultSpecularMaps:{get:function(){return this._useDefaultSpecularMaps}},useSpecularEnvironmentMaps:{get:function(){return l(this._specularEnvironmentCubeMap)&&this._specularEnvironmentCubeMap.ready||this._useDefaultSpecularMaps}}});function Y7e(e,t){if(op.isSupported(t)){if(e._specularEnvironmentCubeMap=e._specularEnvironmentCubeMap&&e._specularEnvironmentCubeMap.destroy(),l(e._specularEnvironmentMaps)){let n=new op(e._specularEnvironmentMaps);e._specularEnvironmentCubeMap=n,e._removeErrorListener=n.errorEvent.addEventListener(i=>{console.error(`Error loading specularEnvironmentMaps: ${i}`)})}e._shouldRegenerateShaders=!0}}ZP.prototype.update=function(e){if(e.frameNumber===this._previousFrameNumber&&e.context===this._previousFrameContext)return;this._previousFrameNumber=e.frameNumber;let t=this._previousFrameContext=e.context;e.brdfLutGenerator.update(e),this._shouldRegenerateShaders=!1;let n=this._imageBasedLightingFactor,i=this._previousImageBasedLightingFactor;U.equals(n,i)||(this._shouldRegenerateShaders=n.x>0&&i.x===0||n.x===0&&i.x>0,this._shouldRegenerateShaders=this._shouldRegenerateShaders||n.y>0&&i.y===0||n.y===0&&i.y>0,this._previousImageBasedLightingFactor=U.clone(this._imageBasedLightingFactor,this._previousImageBasedLightingFactor)),this._previousSphericalHarmonicCoefficients!==this._sphericalHarmonicCoefficients&&(this._shouldRegenerateShaders=this._shouldRegenerateShaders||l(this._previousSphericalHarmonicCoefficients)!==l(this._sphericalHarmonicCoefficients),this._previousSphericalHarmonicCoefficients=this._sphericalHarmonicCoefficients),this._shouldRegenerateShaders=this._shouldRegenerateShaders||this._previousSpecularEnvironmentMapLoaded!==this._specularEnvironmentMapLoaded,this._previousSpecularEnvironmentMapLoaded=this._specularEnvironmentMapLoaded,this._specularEnvironmentCubeMapDirty&&(Y7e(this,t),this._specularEnvironmentCubeMapDirty=!1),l(this._specularEnvironmentCubeMap)&&(this._specularEnvironmentCubeMap.update(e),this._specularEnvironmentCubeMap.ready&&(this._specularEnvironmentMapLoaded=!0));let r=!l(this._specularEnvironmentCubeMap)&&l(e.specularEnvironmentMaps)&&!this._useDefaultSpecularMaps,o=!l(e.specularEnvironmentMaps)&&this._useDefaultSpecularMaps,s=!l(this._sphericalHarmonicCoefficients)&&l(e.sphericalHarmonicCoefficients)&&!this._useDefaultSphericalHarmonics,a=!l(e.sphericalHarmonicCoefficients)&&this._useDefaultSphericalHarmonics;this._shouldRegenerateShaders=this._shouldRegenerateShaders||r||o||s||a,this._useDefaultSpecularMaps=!l(this._specularEnvironmentCubeMap)&&l(e.specularEnvironmentMaps),this._useDefaultSphericalHarmonics=!l(this._sphericalHarmonicCoefficients)&&l(e.sphericalHarmonicCoefficients)};ZP.prototype.isDestroyed=function(){return!1};ZP.prototype.destroy=function(){return this._specularEnvironmentCubeMap=this._specularEnvironmentCubeMap&&this._specularEnvironmentCubeMap.destroy(),this._removeErrorListener=this._removeErrorListener&&this._removeErrorListener(),le(this)};var CC=ZP;var cK=js(ef(),1);var aK,Jhe="eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJub25jZSI6ImwwendUTkl3UVk5Uk5XdEkiLCJqdGkiOiJjZGFkZDZlNC0wMDI5LTQ5OTMtYWIwMC01ZWY4ZDVlNTBhMzYiLCJpZCI6MjU5LCJzdWIiOiJDZXNpdW1KUyIsImlzcyI6Imh0dHBzOi8vYXBpLmNlc2l1bS5jb20iLCJhdWQiOiIxLjE0NSBSZWxlYXNlIC0gRGVsZXRlIG9uIE5vdmVtYmVyIDEsIDIwMjYiLCJpYXQiOjE3ODc2MzQ3NzV9.3SPieoGxEZ22pnWLETAIFZveR0xXTzvOh8G4NYTxDSo",e3={};e3.defaultAccessToken=Jhe;e3.defaultServer=new De({url:"https://api.cesium.com/"});e3.getDefaultTokenCredit=function(e){if(e===Jhe){if(!l(aK)){let t=`<b> This application is using Cesium's default ion access token. Please assign <i>Cesium.Ion.defaultAccessToken</i> with an access token from your ion account before making any Cesium API calls. You can sign up for a free ion account at <a href="https://cesium.com">https://cesium.com</a>.</b>`;aK=new It(t,!0)}return aK}};var uf=e3;function Wc(e,t){let n,i=e.externalType,r=l(i);if(!r)n={url:e.url,retryAttempts:1,retryCallback:X7e};else if(i==="3DTILES"||i==="STK_TERRAIN_SERVER")n={url:e.options.url};else throw new oe("Ion.createResource does not support external imagery assets; use IonImageryProvider instead.");De.call(this,n),this._ionEndpoint=e,this._ionEndpointDomain=r?void 0:new cK.default(e.url).authority(),this._ionEndpointResource=t,this._ionRoot=void 0,this._pendingPromise=void 0,this._credits=void 0,this._isExternal=r,this.refreshCallback=void 0}l(Object.create)&&(Wc.prototype=Object.create(De.prototype),Wc.prototype.constructor=Wc);Wc.fromAssetId=function(e,t){let n=Wc._createEndpointResource(e,t);return n.fetchJson().then(function(i){return new Wc(i,n)})};Object.defineProperties(Wc.prototype,{credits:{get:function(){return l(this._ionRoot)?this._ionRoot.credits:l(this._credits)?this._credits:(this._credits=Wc.getCreditsFromEndpoint(this._ionEndpoint,this._ionEndpointResource),this._credits)}}});Wc.getCreditsFromEndpoint=function(e,t){let n=e.attributions.map(It.getIonCredit),i=uf.getDefaultTokenCredit(t.queryParameters.access_token);return l(i)&&n.push(It.clone(i)),n};Wc.prototype.clone=function(e){let t=this._ionRoot??this;return l(e)||(e=Object.create(Wc.prototype),De.call(e,{url:this._url,parseUrl:!1}),e._ionEndpoint=t._ionEndpoint,e._ionEndpointDomain=t._ionEndpointDomain,e._ionEndpointResource=t._ionEndpointResource,e._ionRoot=void 0,e._pendingPromise=void 0,e._credits=void 0,e._isExternal=this._isExternal,e.refreshCallback=void 0),e=De.prototype.clone.call(this,e),e._ionRoot=t,e._isExternal=this._isExternal,e};Wc.prototype.fetchImage=function(e){if(!this._isExternal){let t=e;e={preferBlob:!0},l(t)&&(e.flipY=t.flipY,e.preferImageBitmap=t.preferImageBitmap)}return De.prototype.fetchImage.call(this,e)};Wc.prototype._makeRequest=function(e){return this._isExternal||new cK.default(this.url).authority()!==this._ionEndpointDomain?De.prototype._makeRequest.call(this,e):(e.headers=lK(e.headers),e.headers.Authorization=`Bearer ${this._ionEndpoint.accessToken}`,De.prototype._makeRequest.call(this,e))};Wc._createEndpointResource=function(e,t){t=t??H.EMPTY_OBJECT;let n=t.server??uf.defaultServer,i=t.accessToken??uf.defaultAccessToken;n=De.createIfNeeded(n);let r={url:`v1/assets/${e}/endpoint`};return l(i)&&(r.queryParameters={access_token:i}),l(t.queryParameters)&&(r.queryParameters={...r.queryParameters,...t.queryParameters}),r.headers=lK(r.headers),n.getDerivedResource(r)};function lK(e={}){return e["X-Cesium-Client"]="CesiumJS",typeof CESIUM_VERSION<"u"&&(e["X-Cesium-Client-Version"]=CESIUM_VERSION),e}Wc._addClientHeaders=lK;function X7e(e,t){let n=e._ionRoot??e,i=n._ionEndpointResource,r=typeof Image<"u";return!l(t)||t.statusCode!==401&&!(r&&t.target instanceof Image)?Promise.resolve(!1):(l(n._pendingPromise)||(n._pendingPromise=i.fetchJson().then(function(o){let s=e.refreshCallback??n.refreshCallback;return l(s)&&s(n,o),n._ionEndpoint=o,n._ionEndpoint}).finally(function(o){return n._pendingPromise=void 0,o})),n._pendingPromise.then(function(o){return e._ionEndpoint=o,!0}))}var Yo=Wc;function sp(e){e=e??0,this._array=new Array(e),this._length=e}Object.defineProperties(sp.prototype,{length:{get:function(){return this._length},set:function(e){let t=this._array,n=this._length;if(e<n)for(let i=e;i<n;++i)t[i]=void 0;else e>t.length&&(t.length=e);this._length=e}},values:{get:function(){return this._array}}});sp.prototype.get=function(e){return this._array[e]};sp.prototype.set=function(e,t){e>=this._length&&(this.length=e+1),this._array[e]=t};sp.prototype.peek=function(){return this._array[this._length-1]};sp.prototype.push=function(e){let t=this.length++;this._array[t]=e};sp.prototype.pop=function(){if(this._length===0)return;let e=this._array[this._length-1];return--this.length,e};sp.prototype.reserve=function(e){e>this._array.length&&(this._array.length=e)};sp.prototype.resize=function(e){this.length=e};sp.prototype.trim=function(e){e=e??this._length,this._array.length=e};var bu=sp;var ap={X:0,Y:1,Z:2};ap.Y_UP_TO_Z_UP=M.fromRotationTranslation($.fromArray([1,0,0,0,0,1,0,-1,0]));ap.Z_UP_TO_Y_UP=M.fromRotationTranslation($.fromArray([1,0,0,0,0,-1,0,1,0]));ap.X_UP_TO_Z_UP=M.fromRotationTranslation($.fromArray([0,0,1,0,1,0,-1,0,0]));ap.Z_UP_TO_X_UP=M.fromRotationTranslation($.fromArray([0,0,-1,0,1,0,1,0,0]));ap.X_UP_TO_Y_UP=M.fromRotationTranslation($.fromArray([0,1,0,-1,0,0,0,0,1]));ap.Y_UP_TO_X_UP=M.fromRotationTranslation($.fromArray([0,-1,0,1,0,0,0,0,1]));ap.fromName=function(e){return ap[e]};Object.freeze(ap);var qi=ap;function Zhe(e){e=e??H.EMPTY_OBJECT,this._metadata=e.metadata}Object.defineProperties(Zhe.prototype,{metadata:{get:function(){return this._metadata}}});var vC=Zhe;function ey(e,t,n){return t=t??0,n=n??e.byteLength-t,e=e.subarray(t,t+n),ey.decode(e)}ey.decodeWithTextDecoder=function(e){return new TextDecoder("utf-8").decode(e)};ey.decodeWithFromCharCode=function(e){let t="",n=K7e(e),i=n.length;for(let r=0;r<i;++r){let o=n[r];o<=65535?t+=String.fromCharCode(o):(o-=65536,t+=String.fromCharCode((o>>10)+55296,(o&1023)+56320))}return t};function QP(e,t,n){return t<=e&&e<=n}function K7e(e){let t=0,n=0,i=0,r=128,o=191,s=[],a=e.length;for(let c=0;c<a;++c){let u=e[c];if(i===0){if(QP(u,0,127)){s.push(u);continue}if(QP(u,194,223)){i=1,t=u&31;continue}if(QP(u,224,239)){u===224&&(r=160),u===237&&(o=159),i=2,t=u&15;continue}if(QP(u,240,244)){u===240&&(r=144),u===244&&(o=143),i=3,t=u&7;continue}throw new oe("String decoding failed.")}if(!QP(u,r,o)){t=i=n=0,r=128,o=191,--c;continue}r=128,o=191,t=t<<6|u&63,++n,n===i&&(s.push(t),t=i=n=0)}return s}typeof TextDecoder<"u"?ey.decode=ey.decodeWithTextDecoder:ey.decode=ey.decodeWithFromCharCode;var ff=ey;function $7e(e,t){return t=t??0,ff(e,t,Math.min(4,e.length))}var cp=$7e;var uK=class e{constructor(t,n,i,r){this._tileset=t,this._tile=n,this._resource=i,l(r)||(r=[]),this._contents=r,this._metadata=void 0,this._group=void 0,this._ready=!1}get featurePropertiesDirty(){let t=this._contents,n=t.length;for(let i=0;i<n;++i)if(t[i].featurePropertiesDirty)return!0;return!1}set featurePropertiesDirty(t){let n=this._contents,i=n.length;for(let r=0;r<i;++r)n[r].featurePropertiesDirty=t}get featuresLength(){return 0}get pointsLength(){return 0}get trianglesLength(){return 0}get geometryByteLength(){return 0}get texturesByteLength(){return 0}get batchTableByteLength(){return 0}get innerContents(){return this._contents}get ready(){return this._ready}get tileset(){return this._tileset}get tile(){return this._tile}get url(){return this._resource.getUrlComponent(!0)}get metadata(){return this._metadata}set metadata(t){this._metadata=t;let n=this._contents,i=n.length;for(let r=0;r<i;++r)n[r].metadata=t}get batchTable(){}get group(){return this._group}set group(t){this._group=t;let n=this._contents,i=n.length;for(let r=0;r<i;++r)n[r].group=t}static async fromTileType(t,n,i,r,o,s){o=o??0;let a=new Uint8Array(r),c=new DataView(r);o+=eD;let u=c.getUint32(o,!0);if(u!==1)throw new oe(`Only Composite Tile version 1 is supported. Version ${u} is not.`);o+=eD,o+=eD;let f=c.getUint32(o,!0);o+=eD;let d=i.queryParameters.compositeIndex;l(d)?d=`${d}_`:d="";let p=[];p.length=f;for(let y=0;y<f;++y){let A=cp(a,o),b=c.getUint32(o+eD*2,!0),x=s[A],T=`${d}${y}`,E=i.getDerivedResource({queryParameters:{compositeIndex:T}});if(l(x))p[y]=Promise.resolve(x(t,n,E,r,o));else throw new oe(`Unknown tile content type, ${A}, inside Composite tile`);o+=b}let g=await Promise.all(p);return new e(t,n,i,g)}hasProperty(t,n){return!1}getFeature(t){}applyDebugSettings(t,n){let i=this._contents,r=i.length;for(let o=0;o<r;++o)i[o].applyDebugSettings(t,n)}applyStyle(t){let n=this._contents,i=n.length;for(let r=0;r<i;++r)n[r].applyStyle(t)}update(t,n){let i=this._contents,r=i.length,o=!0;for(let s=0;s<r;++s)i[s].update(t,n),o=o&&i[s].ready;!this._ready&&o&&(this._ready=!0)}pick(t,n,i){if(!this._ready)return;let r,o=Number.POSITIVE_INFINITY,s=this._contents,a=s.length;for(let c=0;c<a;++c){let u=s[c].pick(t,n,i);if(!l(u))continue;let f=h.distance(t.origin,u);f<o&&(r=u,o=f)}if(l(r))return i}isDestroyed(){return!1}destroy(){let t=this._contents,n=t.length;for(let i=0;i<n;++i)t[i].destroy();return le(this)}},eD=Uint32Array.BYTES_PER_ELEMENT,t3=uK;function J7e(e,t,n){return JSON.parse(ff(e,t,n))}var No=J7e;function qc(e){this._id=Kn();let t=e.featuresLength;this._showAlphaProperties=void 0,this._batchValues=void 0,this._batchValuesDirty=!1,this._batchTexture=void 0,this._defaultTexture=void 0,this._pickTexture=void 0,this._pickIds=[];let n,i;if(t>0){let r=Math.min(t,Ut.maximumTextureSize),o=Math.ceil(t/Ut.maximumTextureSize),s=1/r,a=s*.5,c=1/o,u=c*.5;n=new U(r,o),i=new se(s,a,c,u)}this._translucentFeaturesLength=0,this._featuresLength=t,this._textureDimensions=n,this._textureStep=i,this._owner=e.owner,this._statistics=e.statistics,this._colorChangedCallback=e.colorChangedCallback}Object.defineProperties(qc.prototype,{translucentFeaturesLength:{get:function(){return this._translucentFeaturesLength}},byteLength:{get:function(){let e=0;return l(this._pickTexture)&&(e+=this._pickTexture.sizeInBytes),l(this._batchTexture)&&(e+=this._batchTexture.sizeInBytes),e}},textureDimensions:{get:function(){return this._textureDimensions}},textureStep:{get:function(){return this._textureStep}},batchTexture:{get:function(){return this._batchTexture}},defaultTexture:{get:function(){return this._defaultTexture}},pickTexture:{get:function(){return this._pickTexture}}});qc.DEFAULT_COLOR_VALUE=z.WHITE;qc.DEFAULT_SHOW_VALUE=!0;function Qhe(e){let t=e._textureDimensions;return t.x*t.y*4}function eme(e){if(!l(e._batchValues)){let t=Qhe(e),n=new Uint8Array(t).fill(255);e._batchValues=n}return e._batchValues}function tme(e){if(!l(e._showAlphaProperties)){let t=2*e._featuresLength,n=new Uint8Array(t).fill(255);e._showAlphaProperties=n}return e._showAlphaProperties}qc.prototype.setShow=function(e,t){if(t&&!l(this._showAlphaProperties))return;let n=tme(this),i=e*2,r=t?255:0;if(n[i]!==r){n[i]=r;let o=eme(this),s=e*4+3;o[s]=t?n[i+1]:0,this._batchValuesDirty=!0}};qc.prototype.setAllShow=function(e){let t=this._featuresLength;for(let n=0;n<t;++n)this.setShow(n,e)};qc.prototype.getShow=function(e){if(!l(this._showAlphaProperties))return!0;let t=e*2;return this._showAlphaProperties[t]===255};var Z7e=new Array(4);qc.prototype.setColor=function(e,t){if(z.equals(t,qc.DEFAULT_COLOR_VALUE)&&!l(this._batchValues))return;let n=t.toBytes(Z7e),i=n[3],r=eme(this),o=e*4,s=tme(this),a=e*2;if(r[o]!==n[0]||r[o+1]!==n[1]||r[o+2]!==n[2]||s[a+1]!==i){r[o]=n[0],r[o+1]=n[1],r[o+2]=n[2];let c=s[a+1]!==255,u=s[a]!==0;r[o+3]=u?i:0,s[a+1]=i;let f=i!==255;f&&!c?++this._translucentFeaturesLength:!f&&c&&--this._translucentFeaturesLength,this._batchValuesDirty=!0,l(this._colorChangedCallback)&&this._colorChangedCallback(e,t)}};qc.prototype.setAllColor=function(e){let t=this._featuresLength;for(let n=0;n<t;++n)this.setColor(n,e)};qc.prototype.getColor=function(e,t){if(!l(this._batchValues))return z.clone(qc.DEFAULT_COLOR_VALUE,t);let n=this._batchValues,i=e*4,r=this._showAlphaProperties,o=e*2;return z.fromBytes(n[i],n[i+1],n[i+2],r[o+1],t)};qc.prototype.getPickColor=function(e){return this._pickIds[e]};function nme(e,t,n){let i=e._textureDimensions;return new Dt({context:t,pixelFormat:$e.RGBA,pixelDatatype:ze.UNSIGNED_BYTE,source:{width:i.x,height:i.y,arrayBufferView:n},flipY:!1,sampler:Ht.NEAREST})}function Q7e(e,t){let n=e._featuresLength;if(!l(e._pickTexture)&&n>0){let i=e._pickIds,r=Qhe(e),o=new Uint8Array(r),s=e._owner,a=e._statistics;for(let c=0;c<n;++c){let u=t.createPickId(s.getFeature(c));i.push(u);let f=u.color,d=c*4;o[d]=z.floatToByte(f.red),o[d+1]=z.floatToByte(f.green),o[d+2]=z.floatToByte(f.blue),o[d+3]=z.floatToByte(f.alpha)}e._pickTexture=nme(e,t,o),l(a)&&(a.batchTableByteLength+=e._pickTexture.sizeInBytes)}}function eWe(e){let t=e._textureDimensions;e._batchTexture.copyFrom({source:{width:t.x,height:t.y,arrayBufferView:e._batchValues}})}qc.prototype.update=function(e,t){let n=t.context;this._defaultTexture=n.defaultTexture;let i=t.passes;(i.pick||i.postProcess)&&Q7e(this,n),this._batchValuesDirty&&(this._batchValuesDirty=!1,l(this._batchTexture)||(this._batchTexture=nme(this,n,this._batchValues),l(this._statistics)&&(this._statistics.batchTableByteLength+=this._batchTexture.sizeInBytes)),eWe(this))};qc.prototype.isDestroyed=function(){return!1};qc.prototype.destroy=function(){this._batchTexture=this._batchTexture&&this._batchTexture.destroy(),this._pickTexture=this._pickTexture&&this._pickTexture.destroy();let e=this._pickIds,t=e.length;for(let n=0;n<t;++n)e[n].destroy();return le(this)};var xu=qc;var tWe={SCALAR:1,VEC2:2,VEC3:3,VEC4:4,MAT2:4,MAT3:9,MAT4:16},nWe={SCALAR:void 0,VEC2:U,VEC3:h,VEC4:se,MAT2:$i,MAT3:$,MAT4:M};function iWe(e){let t=e.componentType,n;typeof t=="string"?n=Y.fromName(t):n=t;let i=tWe[e.type],r=nWe[e.type];return{componentsPerAttribute:i,classType:r,createArrayBufferView:function(o,s,a){return Y.createArrayBufferView(n,o,s,i*a)}}}var Eh=iWe;function Y0(e){this._classes=void 0,this._classIds=void 0,this._classIndexes=void 0,this._parentCounts=void 0,this._parentIndexes=void 0,this._parentIds=void 0,this._byteLength=0,rWe(this,e.extension,e.binaryBody)}Object.defineProperties(Y0.prototype,{byteLength:{get:function(){return this._byteLength}}});function rWe(e,t,n){let i,r,o,s=t.instancesLength,a=t.classes,c=t.classIds,u=t.parentCounts,f=t.parentIds,d=s,p=0;l(c.byteOffset)&&(c.componentType=c.componentType??Y.UNSIGNED_SHORT,c.type=Vt.SCALAR,o=Eh(c),c=o.createArrayBufferView(n.buffer,n.byteOffset+c.byteOffset,s),p+=c.byteLength);let g;if(l(u)){for(l(u.byteOffset)&&(u.componentType=u.componentType??Y.UNSIGNED_SHORT,u.type=Vt.SCALAR,o=Eh(u),u=o.createArrayBufferView(n.buffer,n.byteOffset+u.byteOffset,s),p+=u.byteLength),g=new Uint16Array(s),d=0,i=0;i<s;++i)g[i]=d,d+=u[i];p+=g.byteLength}l(f)&&l(f.byteOffset)&&(f.componentType=f.componentType??Y.UNSIGNED_SHORT,f.type=Vt.SCALAR,o=Eh(f),f=o.createArrayBufferView(n.buffer,n.byteOffset+f.byteOffset,d),p+=f.byteLength);let m=a.length;for(i=0;i<m;++i){let b=a[i].length,x=a[i].instances,T=lp.getBinaryProperties(b,x,n);p+=oWe(T),a[i].instances=Mt(T,x)}let y=new Array(m).fill(0),A=new Uint16Array(s);for(i=0;i<s;++i)r=c[i],A[i]=y[r],++y[r];p+=A.byteLength,e._classes=a,e._classIds=c,e._classIndexes=A,e._parentCounts=u,e._parentIndexes=g,e._parentIds=f,e._byteLength=p}function oWe(e){let t=0;for(let n in e)e.hasOwnProperty(n)&&(t+=e[n].typedArray.byteLength);return t}var sWe=[],aWe=[],cWe=0;function lWe(e,t,n){let i=e._classIds,r=e._parentCounts,o=e._parentIds,s=e._parentIndexes,a=i.length,c=sWe;c.length=Math.max(c.length,a);let u=++cWe,f=aWe;for(f.length=0,f.push(t);f.length>0;){if(t=f.pop(),c[t]===u)continue;c[t]=u;let d=n(e,t);if(l(d))return d;let p=r[t],g=s[t];for(let m=0;m<p;++m){let y=o[g+m];y!==t&&f.push(y)}}}function uWe(e,t,n){let i=!0;for(;i;){let r=n(e,t);if(l(r))return r;let o=e._parentIds[t];i=o!==t,t=o}}function tD(e,t,n){let i=e._parentCounts,r=e._parentIds;if(l(r)){if(l(i))return lWe(e,t,n)}else return n(e,t);return uWe(e,t,n)}Y0.prototype.hasProperty=function(e,t){let n=tD(this,e,function(i,r){let o=i._classIds[r],s=i._classes[o].instances;if(l(s[t]))return!0});return l(n)};Y0.prototype.propertyExists=function(e){let t=this._classes,n=t.length;for(let i=0;i<n;++i){let r=t[i].instances;if(l(r[e]))return!0}return!1};Y0.prototype.getPropertyIds=function(e,t){return t=l(t)?t:[],t.length=0,tD(this,e,function(n,i){let r=n._classIds[i],o=n._classes[r].instances;for(let s in o)o.hasOwnProperty(s)&&t.indexOf(s)===-1&&t.push(s)}),t};Y0.prototype.getProperty=function(e,t){return tD(this,e,function(n,i){let r=n._classIds[i],o=n._classes[r],s=n._classIndexes[i],a=o.instances[t];if(l(a))return l(a.typedArray)?fWe(a,s):Ze(a[s],!0)})};function fWe(e,t){let n=e.typedArray,i=e.componentCount;return i===1?n[t]:e.type.unpack(n,t*i)}Y0.prototype.setProperty=function(e,t,n){let i=tD(this,e,function(r,o){let s=r._classIds[o],a=r._classes[s],c=r._classIndexes[o],u=a.instances[t];if(l(u))return l(u.typedArray)?dWe(u,c,n):u[c]=Ze(n,!0),!0});return l(i)};function dWe(e,t,n){let i=e.typedArray,r=e.componentCount;r===1?i[t]=n:e.type.pack(n,i,t*r)}Y0.prototype.isClass=function(e,t){let n=tD(this,e,function(i,r){let o=i._classIds[r];if(i._classes[o].name===t)return!0});return l(n)};Y0.prototype.getClassName=function(e){let t=this._classIds[e];return this._classes[t].name};var SC=Y0;var ime={HIGHLIGHT:0,REPLACE:1,MIX:2};Object.freeze(ime);var df=ime;var fK=xu.DEFAULT_COLOR_VALUE,dK=xu.DEFAULT_SHOW_VALUE;function jr(e,t,n,i,r){this.featuresLength=t;let o;l(n)&&(o=n.extensions),this._extensions=o??{};let s=hWe(n);this._properties=s,this._batchTableHierarchy=mWe(this,n,i);let a=ome(t,s,i);this._binaryPropertiesByteLength=pWe(a),this._batchTableBinaryProperties=a,this._content=e,this._batchTexture=new xu({featuresLength:t,colorChangedCallback:r,owner:e,statistics:e.tileset.statistics})}jr._deprecationWarning=Yr;Object.defineProperties(jr.prototype,{batchTableByteLength:{get:function(){let e=this._binaryPropertiesByteLength;return l(this._batchTableHierarchy)&&(e+=this._batchTableHierarchy.byteLength),e+=this._batchTexture.byteLength,e}}});function hWe(e){let t={};if(!l(e))return t;for(let n in e)e.hasOwnProperty(n)&&n!=="HIERARCHY"&&n!=="extensions"&&n!=="extras"&&(t[n]=Ze(e[n],!0));return t}function mWe(e,t,n){if(!l(t))return;let i=e._extensions["3DTILES_batch_table_hierarchy"],r=t.HIERARCHY;if(l(r)&&(jr._deprecationWarning("batchTableHierarchyExtension","The batch table HIERARCHY property has been moved to an extension. Use extensions.3DTILES_batch_table_hierarchy instead."),e._extensions["3DTILES_batch_table_hierarchy"]=r,i=r),!!l(i))return new SC({extension:i,binaryBody:n})}function ome(e,t,n){let i;for(let r in t)if(t.hasOwnProperty(r)){let o=t[r],s=o.byteOffset;if(l(s)){let a=o.componentType,c=o.type;if(!l(a))throw new oe("componentType is required.");if(!l(c))throw new oe("type is required.");if(!l(n))throw new oe(`Property ${r} requires a batch table binary.`);let u=Eh(o),f=u.componentsPerAttribute,d=u.classType,p=u.createArrayBufferView(n.buffer,n.byteOffset+s,e);l(i)||(i={}),i[r]={typedArray:p,componentCount:f,type:d}}}return i}function pWe(e){if(!l(e))return 0;let t=0;for(let n in e)e.hasOwnProperty(n)&&(t+=e[n].typedArray.byteLength);return t}jr.getBinaryProperties=function(e,t,n){return ome(e,t,n)};jr.prototype.setShow=function(e,t){this._batchTexture.setShow(e,t)};jr.prototype.setAllShow=function(e){this._batchTexture.setAllShow(e)};jr.prototype.getShow=function(e){return this._batchTexture.getShow(e)};jr.prototype.setColor=function(e,t){this._batchTexture.setColor(e,t)};jr.prototype.setAllColor=function(e){this._batchTexture.setAllColor(e)};jr.prototype.getColor=function(e,t){return this._batchTexture.getColor(e,t)};jr.prototype.getPickColor=function(e){return this._batchTexture.getPickColor(e)};var gWe=new z;jr.prototype.applyStyle=function(e){if(!l(e)){this.setAllColor(fK),this.setAllShow(dK);return}let t=this._content,n=this.featuresLength;for(let i=0;i<n;++i){let r=t.getFeature(i),o=l(e.color)?e.color.evaluateColor(r,gWe)??fK:fK,s=l(e.show)?e.show.evaluate(r)??dK:dK;this.setColor(i,o),this.setShow(i,s)}};function _We(e,t){let n=e.typedArray,i=e.componentCount;return i===1?n[t]:e.type.unpack(n,t*i)}function yWe(e,t,n){let i=e.typedArray,r=e.componentCount;r===1?i[t]=n:e.type.pack(n,i,t*r)}jr.prototype.isClass=function(e,t){let n=this._batchTableHierarchy;return l(n)?n.isClass(e,t):!1};jr.prototype.isExactClass=function(e,t){return this.getExactClassName(e)===t};jr.prototype.getExactClassName=function(e){let t=this._batchTableHierarchy;if(l(t))return t.getClassName(e)};jr.prototype.hasProperty=function(e,t){return l(this._properties[t])||l(this._batchTableHierarchy)&&this._batchTableHierarchy.hasProperty(e,t)};jr.prototype.hasPropertyBySemantic=function(){return!1};jr.prototype.getPropertyIds=function(e,t){t=l(t)?t:[],t.length=0;let n=Object.keys(this._properties);if(Zn(t,n),l(this._batchTableHierarchy)){let i=this._batchTableHierarchy.getPropertyIds(e,n);Zn(t,i)}return t};jr.prototype.getPropertyBySemantic=function(e,t){};jr.prototype.getProperty=function(e,t){if(l(this._batchTableBinaryProperties)){let i=this._batchTableBinaryProperties[t];if(l(i))return _We(i,e)}let n=this._properties[t];if(l(n))return Ze(n[e],!0);if(l(this._batchTableHierarchy)){let i=this._batchTableHierarchy.getProperty(e,t);if(l(i))return i}};jr.prototype.setProperty=function(e,t,n){let i=this.featuresLength;if(l(this._batchTableBinaryProperties)){let o=this._batchTableBinaryProperties[t];if(l(o)){yWe(o,e,n);return}}if(l(this._batchTableHierarchy)&&this._batchTableHierarchy.setProperty(e,t,n))return;let r=this._properties[t];l(r)||(this._properties[t]=new Array(i),r=this._properties[t]),r[e]=Ze(n,!0)};function AWe(e){return e._batchTexture.textureDimensions.y===1?`uniform vec4 tile_textureStep; -vec2 computeSt(float batchId) -{ - float stepX = tile_textureStep.x; - float centerX = tile_textureStep.y; - return vec2(centerX + (batchId * stepX), 0.5); -} -`:`uniform vec4 tile_textureStep; -uniform vec2 tile_textureDimensions; -vec2 computeSt(float batchId) -{ - float stepX = tile_textureStep.x; - float centerX = tile_textureStep.y; - float stepY = tile_textureStep.z; - float centerY = tile_textureStep.w; - float xId = mod(batchId, tile_textureDimensions.x); - float yId = floor(batchId / tile_textureDimensions.x); - return vec2(centerX + (xId * stepX), centerY + (yId * stepY)); -} -`}jr.prototype.getVertexShaderCallback=function(e,t,n){if(this.featuresLength===0)return;let i=this;return function(r){let o=sme(r,n,!1),s;return Ut.maximumVertexTextureImageUnits>0?(s="",e&&(s+=`uniform bool tile_translucentCommand; -`),s+=`uniform sampler2D tile_batchTexture; -out vec4 tile_featureColor; -out vec2 tile_featureSt; -void main() +`;function q0(e){e=e??H.EMPTY_OBJECT;let t=e.translucent??!0,n=e.closed??!1,i=e.flat??!1,r=i?Vk:zk,o=i?ZE:Uk,s=i?q0.FLAT_VERTEX_FORMAT:q0.VERTEX_FORMAT;this.material=void 0,this.translucent=t,this._vertexShaderSource=e.vertexShaderSource??r,this._fragmentShaderSource=e.fragmentShaderSource??o,this._renderState=Rr.getDefaultRenderState(t,n,e.renderState),this._closed=n,this._vertexFormat=s,this._flat=i,this._faceForward=e.faceForward??!n}Object.defineProperties(q0.prototype,{vertexShaderSource:{get:function(){return this._vertexShaderSource}},fragmentShaderSource:{get:function(){return this._fragmentShaderSource}},renderState:{get:function(){return this._renderState}},closed:{get:function(){return this._closed}},vertexFormat:{get:function(){return this._vertexFormat}},flat:{get:function(){return this._flat}},faceForward:{get:function(){return this._faceForward}}});q0.VERTEX_FORMAT=Be.POSITION_AND_NORMAL;q0.FLAT_VERTEX_FORMAT=Be.POSITION_ONLY;q0.prototype.getFragmentShaderSource=Rr.prototype.getFragmentShaderSource;q0.prototype.isTranslucent=Rr.prototype.isTranslucent;q0.prototype.getRenderState=Rr.prototype.getRenderState;var An=q0;function od(e,t,n){this._projectionExtentDefines={eastMostYhighDefine:"",eastMostYlowDefine:"",westMostYhighDefine:"",westMostYlowDefine:""};let i=new GX;i.requiresTextureCoordinates=e,i.requiresEC=!n.flat;let r=new GX;if(r.requiresTextureCoordinates=e,n instanceof An)i.requiresNormalEC=!n.flat;else{let o=`${n.material.shaderSource} +${n.fragmentShaderSource}`;i.normalEC=o.indexOf("materialInput.normalEC")!==-1||o.indexOf("czm_getDefaultMaterial")!==-1,i.positionToEyeEC=o.indexOf("materialInput.positionToEyeEC")!==-1,i.tangentToEyeMatrix=o.indexOf("materialInput.tangentToEyeMatrix")!==-1,i.st=o.indexOf("materialInput.st")!==-1}this._colorShaderDependencies=i,this._pickShaderDependencies=r,this._appearance=n,this._extentsCulling=e,this._planarExtents=t}od.prototype.createFragmentShader=function(e){let t=this._appearance,n=this._colorShaderDependencies,i=[];!e&&!this._planarExtents&&i.push("SPHERICAL"),n.requiresEC&&i.push("REQUIRES_EC"),n.requiresWC&&i.push("REQUIRES_WC"),n.requiresTextureCoordinates&&i.push("TEXTURE_COORDINATES"),this._extentsCulling&&i.push("CULL_FRAGMENTS"),n.requiresNormalEC&&i.push("NORMAL_EC"),t instanceof An&&i.push("PER_INSTANCE_COLOR"),n.normalEC&&i.push("USES_NORMAL_EC"),n.positionToEyeEC&&i.push("USES_POSITION_TO_EYE_EC"),n.tangentToEyeMatrix&&i.push("USES_TANGENT_TO_EYE"),n.st&&i.push("USES_ST"),t.flat&&i.push("FLAT");let r="";return t instanceof An||(r=t.material.shaderSource),new Xe({defines:i,sources:[r,mP]})};od.prototype.createPickFragmentShader=function(e){let t=this._pickShaderDependencies,n=["PICK"];return!e&&!this._planarExtents&&n.push("SPHERICAL"),t.requiresEC&&n.push("REQUIRES_EC"),t.requiresWC&&n.push("REQUIRES_WC"),t.requiresTextureCoordinates&&n.push("TEXTURE_COORDINATES"),this._extentsCulling&&n.push("CULL_FRAGMENTS"),new Xe({defines:n,sources:[mP],pickColorQualifier:"in"})};od.prototype.createVertexShader=function(e,t,n,i){return nhe(this._colorShaderDependencies,this._planarExtents,n,e,t,this._appearance,i,this._projectionExtentDefines)};od.prototype.createPickVertexShader=function(e,t,n,i){return nhe(this._pickShaderDependencies,this._planarExtents,n,e,t,void 0,i,this._projectionExtentDefines)};var Kde=new h,$de=new he,Jde={high:0,low:0};function nhe(e,t,n,i,r,o,s,a){let c=i.slice();if(a.eastMostYhighDefine===""){let u=$de;u.longitude=P.PI,u.latitude=0,u.height=0;let f=s.project(u,Kde),d=Sn.encode(f.x,Jde);a.eastMostYhighDefine=`EAST_MOST_X_HIGH ${d.high.toFixed(`${d.high}`.length+1)}`,a.eastMostYlowDefine=`EAST_MOST_X_LOW ${d.low.toFixed(`${d.low}`.length+1)}`;let p=$de;p.longitude=-P.PI,p.latitude=0,p.height=0;let g=s.project(p,Kde);d=Sn.encode(g.x,Jde),a.westMostYhighDefine=`WEST_MOST_X_HIGH ${d.high.toFixed(`${d.high}`.length+1)}`,a.westMostYlowDefine=`WEST_MOST_X_LOW ${d.low.toFixed(`${d.low}`.length+1)}`}return n&&(c.push(a.eastMostYhighDefine),c.push(a.eastMostYlowDefine),c.push(a.westMostYhighDefine),c.push(a.westMostYlowDefine)),l(o)&&o instanceof An&&c.push("PER_INSTANCE_COLOR"),e.requiresTextureCoordinates&&(c.push("TEXTURE_COORDINATES"),t||n||c.push("SPHERICAL"),n&&c.push("COLUMBUS_VIEW_2D")),new Xe({defines:c,sources:[r]})}function GX(){this._requiresEC=!1,this._requiresWC=!1,this._requiresNormalEC=!1,this._requiresTextureCoordinates=!1,this._usesNormalEC=!1,this._usesPositionToEyeEC=!1,this._usesTangentToEyeMat=!1,this._usesSt=!1}Object.defineProperties(GX.prototype,{requiresEC:{get:function(){return this._requiresEC},set:function(e){this._requiresEC=e||this._requiresEC}},requiresWC:{get:function(){return this._requiresWC},set:function(e){this._requiresWC=e||this._requiresWC,this.requiresEC=this._requiresWC}},requiresNormalEC:{get:function(){return this._requiresNormalEC},set:function(e){this._requiresNormalEC=e||this._requiresNormalEC,this.requiresEC=this._requiresNormalEC}},requiresTextureCoordinates:{get:function(){return this._requiresTextureCoordinates},set:function(e){this._requiresTextureCoordinates=e||this._requiresTextureCoordinates,this.requiresWC=this._requiresTextureCoordinates}},normalEC:{set:function(e){this.requiresNormalEC=e,this._usesNormalEC=e},get:function(){return this._usesNormalEC}},tangentToEyeMatrix:{set:function(e){this.requiresWC=e,this.requiresNormalEC=e,this._usesTangentToEyeMat=e},get:function(){return this._usesTangentToEyeMat}},positionToEyeEC:{set:function(e){this.requiresEC=e,this._usesPositionToEyeEC=e},get:function(){return this._usesPositionToEyeEC}},st:{set:function(e){this.requiresTextureCoordinates=e,this._usesSt=e},get:function(){return this._usesSt}}});function Zde(e,t,n){return Math.abs((t.y-e.y)*n.x-(t.x-e.x)*n.y+t.x*e.y-t.y*e.x)/U.distance(t,e)}var x5e=[new U,new U,new U,new U];function ihe(e,t){let n=x5e,i=U.unpack(t,0,n[0]),r=U.unpack(t,2,n[1]),o=U.unpack(t,4,n[2]);e.uMaxVmax=new Pl({componentDatatype:Y.FLOAT,componentsPerAttribute:4,normalize:!1,value:[r.x,r.y,o.x,o.y]});let s=1/Zde(i,r,o),a=1/Zde(i,o,r);e.uvMinAndExtents=new Pl({componentDatatype:Y.FLOAT,componentsPerAttribute:4,normalize:!1,value:[i.x,i.y,s,a]})}var rhe=new he,ohe=new h,T5e=new h,E5e=new h,jk={high:0,low:0};function she(e,t,n){let i=rhe;i.height=0,i.longitude=e.west,i.latitude=e.south;let r=t.project(i,ohe);i.latitude=e.north;let o=t.project(i,T5e);i.longitude=e.east,i.latitude=e.south;let s=t.project(i,E5e),a=[0,0,0,0],c=[0,0,0,0],u=Sn.encode(r.x,jk);a[0]=u.high,c[0]=u.low,u=Sn.encode(r.y,jk),a[1]=u.high,c[1]=u.low,u=Sn.encode(o.y,jk),a[2]=u.high,c[2]=u.low,u=Sn.encode(s.x,jk),a[3]=u.high,c[3]=u.low,n.planes2D_HIGH=new Pl({componentDatatype:Y.FLOAT,componentsPerAttribute:4,normalize:!1,value:a}),n.planes2D_LOW=new Pl({componentDatatype:Y.FLOAT,componentsPerAttribute:4,normalize:!1,value:c})}var C5e=new M,v5e=new M,Qde=new h,S5e=new he,w5e=[new he,new he,new he,new he,new he,new he,new he,new he];function I5e(e,t,n,i,r,o){let s=ie.center(e,S5e);s.height=n;let a=he.toCartesian(s,t,Qde),c=At.eastNorthUpToFixedFrame(a,t,C5e),u=M.inverse(c,v5e),f=e.west,d=e.east,p=e.north,g=e.south,m=w5e;m[0].latitude=g,m[0].longitude=f,m[1].latitude=p,m[1].longitude=f,m[2].latitude=p,m[2].longitude=d,m[3].latitude=g,m[3].longitude=d;let y=(f+d)*.5,A=(p+g)*.5;m[4].latitude=g,m[4].longitude=y,m[5].latitude=p,m[5].longitude=y,m[6].latitude=A,m[6].longitude=f,m[7].latitude=A,m[7].longitude=d;let b=Number.POSITIVE_INFINITY,x=Number.NEGATIVE_INFINITY,T=Number.POSITIVE_INFINITY,E=Number.NEGATIVE_INFINITY;for(let R=0;R<8;R++){m[R].height=n;let O=he.toCartesian(m[R],t,Qde);M.multiplyByPoint(u,O,O),O.z=0,b=Math.min(b,O.x),x=Math.max(x,O.x),T=Math.min(T,O.y),E=Math.max(E,O.y)}let v=i;v.x=b,v.y=T,v.z=0,M.multiplyByPoint(c,v,v);let S=r;S.x=x,S.y=T,S.z=0,M.multiplyByPoint(c,S,S),h.subtract(S,v,r);let I=o;I.x=b,I.y=E,I.z=0,M.multiplyByPoint(c,I,I),h.subtract(I,v,o)}var P5e=new h,D5e=new h,R5e=new Sn;od.getPlanarTextureCoordinateAttributes=function(e,t,n,i,r){let o=ohe,s=P5e,a=D5e;I5e(e,n,r??0,o,s,a);let c={};ihe(c,t);let u=Sn.fromCartesian(o,R5e);return c.southWest_HIGH=new Pl({componentDatatype:Y.FLOAT,componentsPerAttribute:3,normalize:!1,value:h.pack(u.high,[0,0,0])}),c.southWest_LOW=new Pl({componentDatatype:Y.FLOAT,componentsPerAttribute:3,normalize:!1,value:h.pack(u.low,[0,0,0])}),c.eastward=new Pl({componentDatatype:Y.FLOAT,componentsPerAttribute:3,normalize:!1,value:h.pack(s,[0,0,0])}),c.northward=new Pl({componentDatatype:Y.FLOAT,componentsPerAttribute:3,normalize:!1,value:h.pack(a,[0,0,0])}),she(e,i,c),c};var O5e=new h;function ehe(e,t,n,i){let r=rhe;r.latitude=e,r.longitude=t,r.height=0;let o=he.toCartesian(r,n,O5e),s=Math.sqrt(o.x*o.x+o.y*o.y),a=P.fastApproximateAtan2(s,o.z),c=P.fastApproximateAtan2(o.x,o.y);return i.x=a,i.y=c,i}var the=new U;od.getSphericalExtentGeometryInstanceAttributes=function(e,t,n,i){let r=ehe(e.south,e.west,n,the),o=r.x,s=r.y,a=ehe(e.north,e.east,n,the),c=a.x,u=a.y,f=0;s>u&&(f=P.PI-s,s=-P.PI,u+=f),o-=P.EPSILON5,s-=P.EPSILON5,c+=P.EPSILON5,u+=P.EPSILON5;let d=1/(u-s),p=1/(c-o),g={sphericalExtents:new Pl({componentDatatype:Y.FLOAT,componentsPerAttribute:4,normalize:!1,value:[o,s,p,d]}),longitudeRotation:new Pl({componentDatatype:Y.FLOAT,componentsPerAttribute:1,normalize:!1,value:[f]})};return ihe(g,t),she(e,i,g),g};od.hasAttributesForTextureCoordinatePlanes=function(e){return l(e.southWest_HIGH)&&l(e.southWest_LOW)&&l(e.northward)&&l(e.eastward)&&l(e.planes2D_HIGH)&&l(e.planes2D_LOW)&&l(e.uMaxVmax)&&l(e.uvMinAndExtents)};od.hasAttributesForSphericalExtents=function(e){return l(e.sphericalExtents)&&l(e.longitudeRotation)&&l(e.planes2D_HIGH)&&l(e.planes2D_LOW)&&l(e.uMaxVmax)&&l(e.uvMinAndExtents)};function M5e(e){return Math.max(e.width,e.height)>od.MAX_WIDTH_FOR_PLANAR_EXTENTS}od.shouldUseSphericalCoordinates=function(e){return M5e(e)};od.MAX_WIDTH_FOR_PLANAR_EXTENTS=P.toRadians(1);var sd=od;function Lb(e){e=e??H.EMPTY_OBJECT;let t=e.geometryInstances;this.geometryInstances=t,this.show=e.show??!0,this.classificationType=e.classificationType??Qn.BOTH,this.debugShowBoundingVolume=e.debugShowBoundingVolume??!1,this.debugShowShadowVolume=e.debugShowShadowVolume??!1,this._debugShowShadowVolume=!1,this._extruded=e._extruded??!1,this._uniformMap=e._uniformMap,this._sp=void 0,this._spStencil=void 0,this._spPick=void 0,this._spColor=void 0,this._spPick2D=void 0,this._spColor2D=void 0,this._rsStencilDepthPass=void 0,this._rsStencilDepthPass3DTiles=void 0,this._rsColorPass=void 0,this._rsPickPass=void 0,this._commandsIgnoreShow=[],this._ready=!1,this._primitive=void 0,this._pickPrimitive=e._pickPrimitive,this._hasSphericalExtentsAttribute=!1,this._hasPlanarExtentsAttributes=!1,this._hasPerColorAttribute=!1,this.appearance=e.appearance,this._createBoundingVolumeFunction=e._createBoundingVolumeFunction,this._updateAndQueueCommandsFunction=e._updateAndQueueCommandsFunction,this._usePickOffsets=!1,this._primitiveOptions={geometryInstances:void 0,appearance:void 0,vertexCacheOptimize:e.vertexCacheOptimize??!1,interleave:e.interleave??!1,releaseGeometryInstances:e.releaseGeometryInstances??!0,allowPicking:e.allowPicking??!0,asynchronous:e.asynchronous??!0,compressVertices:e.compressVertices??!0,_createBoundingVolumeFunction:void 0,_createRenderStatesFunction:void 0,_createShaderProgramFunction:void 0,_createCommandsFunction:void 0,_updateAndQueueCommandsFunction:void 0,_createPickOffsets:!0}}Object.defineProperties(Lb.prototype,{vertexCacheOptimize:{get:function(){return this._primitiveOptions.vertexCacheOptimize}},interleave:{get:function(){return this._primitiveOptions.interleave}},releaseGeometryInstances:{get:function(){return this._primitiveOptions.releaseGeometryInstances}},allowPicking:{get:function(){return this._primitiveOptions.allowPicking}},asynchronous:{get:function(){return this._primitiveOptions.asynchronous}},compressVertices:{get:function(){return this._primitiveOptions.compressVertices}},ready:{get:function(){return this._ready}},_needs2DShader:{get:function(){return this._hasPlanarExtentsAttributes||this._hasSphericalExtentsAttribute}}});Lb.isSupported=function(e){return e.context.stencilBuffer};function iC(e,t){let n=t?ei.EQUAL:ei.ALWAYS;return{colorMask:{red:!1,green:!1,blue:!1,alpha:!1},stencilTest:{enabled:e,frontFunction:n,frontOperation:{fail:Rt.KEEP,zFail:Rt.DECREMENT_WRAP,zPass:Rt.KEEP},backFunction:n,backOperation:{fail:Rt.KEEP,zFail:Rt.INCREMENT_WRAP,zPass:Rt.KEEP},reference:Xt.CESIUM_3D_TILE_MASK,mask:Xt.CESIUM_3D_TILE_MASK},stencilMask:Xt.CLASSIFICATION_MASK,depthTest:{enabled:!0,func:Ac.LESS_OR_EQUAL},depthMask:!1}}function qX(e){return{stencilTest:{enabled:e,frontFunction:ei.NOT_EQUAL,frontOperation:{fail:Rt.ZERO,zFail:Rt.ZERO,zPass:Rt.ZERO},backFunction:ei.NOT_EQUAL,backOperation:{fail:Rt.ZERO,zFail:Rt.ZERO,zPass:Rt.ZERO},reference:0,mask:Xt.CLASSIFICATION_MASK},stencilMask:Xt.CLASSIFICATION_MASK,depthTest:{enabled:!1},depthMask:!1,blending:nn.PRE_MULTIPLIED_ALPHA_BLEND}}var N5e={stencilTest:{enabled:!0,frontFunction:ei.NOT_EQUAL,frontOperation:{fail:Rt.ZERO,zFail:Rt.ZERO,zPass:Rt.ZERO},backFunction:ei.NOT_EQUAL,backOperation:{fail:Rt.ZERO,zFail:Rt.ZERO,zPass:Rt.ZERO},reference:0,mask:Xt.CLASSIFICATION_MASK},stencilMask:Xt.CLASSIFICATION_MASK,depthTest:{enabled:!1},depthMask:!1};function L5e(e,t,n,i){if(l(e._rsStencilDepthPass))return;let r=!e.debugShowShadowVolume;e._rsStencilDepthPass=Ge.fromCache(iC(r,!1)),e._rsStencilDepthPass3DTiles=Ge.fromCache(iC(r,!0)),e._rsColorPass=Ge.fromCache(qX(r,!1)),e._rsPickPass=Ge.fromCache(N5e)}function F5e(e,t){if(!e.compressVertices)return t;if(t.search(/in\s+vec3\s+extrudeDirection;/g)!==-1){let n="compressedAttributes",i=`in vec2 ${n};`,r=`vec3 extrudeDirection; +`,o=` extrudeDirection = czm_octDecode(${n}, 65535.0); +`,s=t;s=s.replace(/in\s+vec3\s+extrudeDirection;/g,""),s=Xe.replaceMain(s,"czm_non_compressed_main");let a=`void main() { - vec2 st = computeSt(${t}); - vec4 featureProperties = texture(tile_batchTexture, st); - tile_color(featureProperties); - float show = ceil(featureProperties.a); - gl_Position *= show; -`,e&&(s+=` bool isStyleTranslucent = (featureProperties.a != 1.0); - if (czm_pass == czm_passTranslucent) - { - if (!isStyleTranslucent && !tile_translucentCommand) - { - gl_Position *= 0.0; - } - } - else - { - if (isStyleTranslucent) - { - gl_Position *= 0.0; - } - } -`),s+=` tile_featureColor = featureProperties; - tile_featureSt = st; -}`):s=`out vec2 tile_featureSt; +${o} czm_non_compressed_main(); +}`;return[i,r,s,a].join(` +`)}}function B5e(e,t){let n=t.context,i=e._primitive,r=X2;r=e._primitive._batchTable.getVertexShaderCallback()(r),r=Mn._appendDistanceDisplayConditionToShader(i,r),r=Mn._modifyShaderPosition(e,r,t.scene3DOnly),r=Mn._updateColorAttribute(i,r);let o=e._hasPlanarExtentsAttributes,s=o||e._hasSphericalExtentsAttribute;e._extruded&&(r=F5e(i,r));let a=e._extruded?"EXTRUDED_GEOMETRY":"",c=new Xe({defines:[a],sources:[r]}),u=new Xe({sources:[Ob]}),f=e._primitive._attributeLocations,d=new sd(s,o,e.appearance);if(e._spStencil=Qt.replaceCache({context:n,shaderProgram:e._spStencil,vertexShaderSource:c,fragmentShaderSource:u,attributeLocations:f}),e._primitive.allowPicking){let m=Xe.createPickVertexShaderSource(r);m=Mn._appendShowToShader(i,m),m=Mn._updatePickColorAttribute(m);let y=d.createPickFragmentShader(!1),A=d.createPickVertexShader([a],m,!1,t.mapProjection);if(e._spPick=Qt.replaceCache({context:n,shaderProgram:e._spPick,vertexShaderSource:A,fragmentShaderSource:y,attributeLocations:f}),s){let b=n.shaderCache.getDerivedShaderProgram(e._spPick,"2dPick");if(!l(b)){let x=d.createPickFragmentShader(!0),T=d.createPickVertexShader([a],m,!0,t.mapProjection);b=n.shaderCache.createDerivedShaderProgram(e._spPick,"2dPick",{vertexShaderSource:T,fragmentShaderSource:x,attributeLocations:f})}e._spPick2D=b}}else e._spPick=Qt.fromCache({context:n,vertexShaderSource:c,fragmentShaderSource:u,attributeLocations:f});r=Mn._appendShowToShader(i,r),c=new Xe({defines:[a],sources:[r]}),e._sp=Qt.replaceCache({context:n,shaderProgram:e._sp,vertexShaderSource:c,fragmentShaderSource:u,attributeLocations:f});let p=d.createFragmentShader(!1),g=d.createVertexShader([a],r,!1,t.mapProjection);if(e._spColor=Qt.replaceCache({context:n,shaderProgram:e._spColor,vertexShaderSource:g,fragmentShaderSource:p,attributeLocations:f}),s){let m=n.shaderCache.getDerivedShaderProgram(e._spColor,"2dColor");if(!l(m)){let y=d.createFragmentShader(!0),A=d.createVertexShader([a],r,!0,t.mapProjection);m=n.shaderCache.createDerivedShaderProgram(e._spColor,"2dColor",{vertexShaderSource:A,fragmentShaderSource:y,attributeLocations:f})}e._spColor2D=m}}function k5e(e,t){let n=e._primitive,i=n._va.length*2;t.length=i;let r,o,s,a=0,c=n._batchTable.getUniformMapCallback()(e._uniformMap),u=e._needs2DShader;for(r=0;r<i;r+=2){let g=n._va[a++];o=t[r],l(o)||(o=t[r]=new at({owner:e,primitiveType:n._primitiveType})),o.vertexArray=g,o.renderState=e._rsStencilDepthPass,o.shaderProgram=e._sp,o.uniformMap=c,o.pass=Ie.TERRAIN_CLASSIFICATION,s=at.shallowClone(o,o.derivedCommands.tileset),s.renderState=e._rsStencilDepthPass3DTiles,s.pass=Ie.CESIUM_3D_TILE_CLASSIFICATION,o.derivedCommands.tileset=s,o=t[r+1],l(o)||(o=t[r+1]=new at({owner:e,primitiveType:n._primitiveType})),o.vertexArray=g,o.renderState=e._rsColorPass,o.shaderProgram=e._spColor,o.pass=Ie.TERRAIN_CLASSIFICATION;let y=e.appearance.material;if(l(y)&&(c=Mt(c,y._uniforms)),o.uniformMap=c,s=at.shallowClone(o,o.derivedCommands.tileset),s.pass=Ie.CESIUM_3D_TILE_CLASSIFICATION,o.derivedCommands.tileset=s,u){let A=at.shallowClone(o,o.derivedCommands.appearance2D);A.shaderProgram=e._spColor2D,o.derivedCommands.appearance2D=A,A=at.shallowClone(s,s.derivedCommands.appearance2D),A.shaderProgram=e._spColor2D,s.derivedCommands.appearance2D=A}}let f=e._commandsIgnoreShow,d=e._spStencil,p=0;i=f.length=i/2;for(let g=0;g<i;++g){let m=f[g]=at.shallowClone(t[p],f[g]);m.shaderProgram=d,m.pass=Ie.CESIUM_3D_TILE_CLASSIFICATION_IGNORE_SHOW,p+=2}}function U5e(e,t){let n=e._usePickOffsets,i=e._primitive,r=i._va.length*2,o,s=0,a;n&&(o=i._pickOffsets,r=o.length*2),t.length=r;let c,u,f,d=0,p=i._batchTable.getUniformMapCallback()(e._uniformMap),g=e._needs2DShader;for(c=0;c<r;c+=2){let m=i._va[d++];if(n&&(a=o[s++],m=i._va[a.index]),u=t[c],l(u)||(u=t[c]=new at({owner:e,primitiveType:i._primitiveType,pickOnly:!0})),u.vertexArray=m,u.renderState=e._rsStencilDepthPass,u.shaderProgram=e._sp,u.uniformMap=p,u.pass=Ie.TERRAIN_CLASSIFICATION,n&&(u.offset=a.offset,u.count=a.count),f=at.shallowClone(u,u.derivedCommands.tileset),f.renderState=e._rsStencilDepthPass3DTiles,f.pass=Ie.CESIUM_3D_TILE_CLASSIFICATION,u.derivedCommands.tileset=f,u=t[c+1],l(u)||(u=t[c+1]=new at({owner:e,primitiveType:i._primitiveType,pickOnly:!0})),u.vertexArray=m,u.renderState=e._rsPickPass,u.shaderProgram=e._spPick,u.uniformMap=p,u.pass=Ie.TERRAIN_CLASSIFICATION,n&&(u.offset=a.offset,u.count=a.count),f=at.shallowClone(u,u.derivedCommands.tileset),f.pass=Ie.CESIUM_3D_TILE_CLASSIFICATION,u.derivedCommands.tileset=f,g){let y=at.shallowClone(u,u.derivedCommands.pick2D);y.shaderProgram=e._spPick2D,u.derivedCommands.pick2D=y,y=at.shallowClone(f,f.derivedCommands.pick2D),y.shaderProgram=e._spPick2D,f.derivedCommands.pick2D=y}}}function z5e(e,t,n,i,r,o,s){k5e(e,o),U5e(e,s)}function ahe(e,t){return Math.floor(e%t/2)}function WX(e,t,n,i,r,o){e.modelMatrix=n,e.boundingVolume=r,e.cull=i,e.debugShowBoundingVolume=o,t.commandList.push(e)}function che(e,t,n,i,r){e.modelMatrix=n,e.boundingVolume=r,e.cull=i,t.commandList.push(e)}function V5e(e,t,n,i,r,o,s,a){let c=e._primitive;Mn._updateBoundingVolumes(c,t,r);let u;t.mode===re.SCENE3D?u=c._boundingSphereWC:t.mode===re.COLUMBUS_VIEW?u=c._boundingSphereCV:t.mode===re.SCENE2D&&l(c._boundingSphere2D)?u=c._boundingSphere2D:l(c._boundingSphereMorph)&&(u=c._boundingSphereMorph);let f=e.classificationType,d=f!==Qn.CESIUM_3D_TILE,p=f!==Qn.TERRAIN,g=t.passes,m,y,A;if(g.render){let b=n.length;for(m=0;m<b;++m)y=u[ahe(m,b)],d&&(A=n[m],WX(A,t,r,o,y,s)),p&&(A=n[m].derivedCommands.tileset,WX(A,t,r,o,y,s));if(t.invertClassification){let x=e._commandsIgnoreShow,T=x.length;for(m=0;m<T;++m)y=u[m],A=x[m],WX(A,t,r,o,y,s)}}if(g.pick){let b=i.length,x=c._pickOffsets;for(m=0;m<b;++m){let T=x[ahe(m,b)];y=u[T.index],d&&(A=i[m],che(A,t,r,o,y)),p&&(A=i[m].derivedCommands.tileset,che(A,t,r,o,y))}}}Lb.prototype.update=function(e){if(!l(this._primitive)&&!l(this.geometryInstances))return;let t=this.appearance;l(t)&&l(t.material)&&t.material.update(e.context);let n=this,i=this._primitiveOptions;if(!l(this._primitive)){let r=Array.isArray(this.geometryInstances)?this.geometryInstances:[this.geometryInstances],o=r.length,s,a,c,u=!1,f=!0,d,p=!1,g=!1;for(o>0&&(c=r[0].attributes,p=sd.hasAttributesForSphericalExtents(c),g=sd.hasAttributesForTextureCoordinatePlanes(c),d=c.color),s=0;s<o;s++){a=r[s];let y=a.attributes.color;l(y)&&(u=!0),f=f&&l(y)&&Jt.equals(d,y)}if(!f&&!p&&!g)throw new pe("All GeometryInstances must have the same color attribute except via GroundPrimitives");u&&!l(t)&&(t=new An({flat:!0}),this.appearance=t),this._usePickOffsets=!p&&!g,this._hasSphericalExtentsAttribute=p,this._hasPlanarExtentsAttributes=g,this._hasPerColorAttribute=u;let m=new Array(o);for(s=0;s<o;++s)a=r[s],m[s]=new Bt({geometry:a.geometry,attributes:a.attributes,modelMatrix:a.modelMatrix,id:a.id,pickPrimitive:this._pickPrimitive??n});i.appearance=t,i.geometryInstances=m,l(this._createBoundingVolumeFunction)&&(i._createBoundingVolumeFunction=function(y,A){n._createBoundingVolumeFunction(y,A)}),i._createRenderStatesFunction=function(y,A,b,x){L5e(n,A)},i._createShaderProgramFunction=function(y,A,b){B5e(n,A)},i._createCommandsFunction=function(y,A,b,x,T,E,v){z5e(n,void 0,void 0,!0,!1,E,v)},l(this._updateAndQueueCommandsFunction)?i._updateAndQueueCommandsFunction=function(y,A,b,x,T,E,v,S){n._updateAndQueueCommandsFunction(y,A,b,x,T,E,v,S)}:i._updateAndQueueCommandsFunction=function(y,A,b,x,T,E,v,S){V5e(n,A,b,x,T,E,v,S)},this._primitive=new Mn(i)}this.debugShowShadowVolume&&!this._debugShowShadowVolume&&this._ready?(this._debugShowShadowVolume=!0,this._rsStencilDepthPass=Ge.fromCache(iC(!1,!1)),this._rsStencilDepthPass3DTiles=Ge.fromCache(iC(!1,!0)),this._rsColorPass=Ge.fromCache(qX(!1))):!this.debugShowShadowVolume&&this._debugShowShadowVolume&&(this._debugShowShadowVolume=!1,this._rsStencilDepthPass=Ge.fromCache(iC(!0,!1)),this._rsStencilDepthPass3DTiles=Ge.fromCache(iC(!0,!0)),this._rsColorPass=Ge.fromCache(qX(!0))),this._primitive.appearance!==t&&(this._primitive.appearance=t),this._primitive.show=this.show,this._primitive.debugShowBoundingVolume=this.debugShowBoundingVolume,this._primitive.update(e),e.afterRender.push(()=>{l(this._primitive)&&this._primitive.ready&&(this._ready=!0,this.releaseGeometryInstances&&(this.geometryInstances=void 0))})};Lb.prototype.getGeometryInstanceAttributes=function(e){return this._primitive.getGeometryInstanceAttributes(e)};Lb.prototype.isDestroyed=function(){return!1};Lb.prototype.destroy=function(){return this._primitive=this._primitive&&this._primitive.destroy(),this._sp=this._sp&&this._sp.destroy(),this._spPick=this._spPick&&this._spPick.destroy(),this._spColor=this._spColor&&this._spColor.destroy(),this._spPick2D=void 0,this._spColor2D=void 0,le(this)};var wP=Lb;var j5e={u_globeMinimumAltitude:function(){return 55e3}};function mu(e){e=e??H.EMPTY_OBJECT;let t=e.appearance,n=e.geometryInstances;if(!l(t)&&l(n)){let r=Array.isArray(n)?n:[n],o=r.length;for(let s=0;s<o;s++){let a=r[s].attributes;if(l(a)&&l(a.color)){t=new An({flat:!0});break}}}this.appearance=t,this.geometryInstances=e.geometryInstances,this.show=e.show??!0,this.classificationType=e.classificationType??Qn.BOTH,this.debugShowBoundingVolume=e.debugShowBoundingVolume??!1,this.debugShowShadowVolume=e.debugShowShadowVolume??!1,this._boundingVolumes=[],this._boundingVolumes2D=[],this._ready=!1,this._primitive=void 0,this._maxHeight=void 0,this._minHeight=void 0,this._maxTerrainHeight=Ni._defaultMaxTerrainHeight,this._minTerrainHeight=Ni._defaultMinTerrainHeight,this._boundingSpheresKeys=[],this._boundingSpheres=[],this._useFragmentCulling=!1,this._zIndex=void 0;let i=this;this._classificationPrimitiveOptions={geometryInstances:void 0,appearance:void 0,vertexCacheOptimize:e.vertexCacheOptimize??!1,interleave:e.interleave??!1,releaseGeometryInstances:e.releaseGeometryInstances??!0,allowPicking:e.allowPicking??!0,asynchronous:e.asynchronous??!0,compressVertices:e.compressVertices??!0,_createBoundingVolumeFunction:void 0,_updateAndQueueCommandsFunction:void 0,_pickPrimitive:i,_extruded:!0,_uniformMap:j5e}}Object.defineProperties(mu.prototype,{vertexCacheOptimize:{get:function(){return this._classificationPrimitiveOptions.vertexCacheOptimize}},interleave:{get:function(){return this._classificationPrimitiveOptions.interleave}},releaseGeometryInstances:{get:function(){return this._classificationPrimitiveOptions.releaseGeometryInstances}},allowPicking:{get:function(){return this._classificationPrimitiveOptions.allowPicking}},asynchronous:{get:function(){return this._classificationPrimitiveOptions.asynchronous}},compressVertices:{get:function(){return this._classificationPrimitiveOptions.compressVertices}},ready:{get:function(){return this._ready}}});mu.isSupported=wP.isSupported;function lhe(e){return function(t,n){let i=n.maximumRadius,r=i/Math.cos(t*.5)-i;return e._maxHeight+r}}function uhe(e){return function(t,n){return e._minHeight}}var H5e=new h,G5e=new h,W5e=new h,q5e=new he,Y5e=new ie;function Hk(e,t){let n=e.mapProjection.ellipsoid;if(!l(t.attributes)||!l(t.attributes.position3DHigh))return l(t.rectangle)?t.rectangle:void 0;let i=t.attributes.position3DHigh.values,r=t.attributes.position3DLow.values,o=i.length,s=Number.POSITIVE_INFINITY,a=Number.POSITIVE_INFINITY,c=Number.NEGATIVE_INFINITY,u=Number.NEGATIVE_INFINITY;for(let d=0;d<o;d+=3){let p=h.unpack(i,d,H5e),g=h.unpack(r,d,G5e),m=h.add(p,g,W5e),y=n.cartesianToCartographic(m,q5e),A=y.latitude,b=y.longitude;s=Math.min(s,A),a=Math.min(a,b),c=Math.max(c,A),u=Math.max(u,b)}let f=Y5e;return f.north=c,f.south=s,f.east=u,f.west=a,f}function X5e(e,t,n){let i=Ni.getMinimumMaximumHeights(t,n);e._minTerrainHeight=i.minimumTerrainHeight,e._maxTerrainHeight=i.maximumTerrainHeight}function K5e(e,t,n){let i=t.mapProjection.ellipsoid,r=Hk(t,n),o=en.fromRectangle(r,e._minHeight,e._maxHeight,i);if(e._boundingVolumes.push(o),!t.scene3DOnly){let s=t.mapProjection,a=ue.fromRectangleWithHeights2D(r,s,e._maxHeight,e._minHeight);h.fromElements(a.center.z,a.center.x,a.center.y,a.center),e._boundingVolumes2D.push(a)}}function YX(e,t){return Math.floor(e%t/2)}function XX(e,t,n,i,r,o,s){let a=e._primitive;n.mode!==re.SCENE3D&&t.shaderProgram===a._spColor&&a._needs2DShader&&(t=t.derivedCommands.appearance2D),t.owner=e,t.modelMatrix=i,t.boundingVolume=o,t.cull=r,t.debugShowBoundingVolume=s,n.commandList.push(t)}function fhe(e,t,n,i,r,o){let s=e._primitive;n.mode!==re.SCENE3D&&t.shaderProgram===s._spPick&&s._needs2DShader&&(t=t.derivedCommands.pick2D),t.owner=e,t.modelMatrix=i,t.boundingVolume=o,t.cull=r,n.commandList.push(t)}function $5e(e,t,n,i,r,o,s,a){let c;t.mode===re.SCENE3D?c=e._boundingVolumes:c=e._boundingVolumes2D;let u=e.classificationType,f=u!==Qn.CESIUM_3D_TILE,d=u!==Qn.TERRAIN,p=t.passes,g=e._primitive,m,y,A;if(p.render){let b=n.length;for(m=0;m<b;++m)y=c[YX(m,b)],f&&(A=n[m],XX(e,A,t,r,o,y,s)),d&&(A=n[m].derivedCommands.tileset,XX(e,A,t,r,o,y,s));if(t.invertClassification){let x=g._commandsIgnoreShow,T=x.length;for(m=0;m<T;++m)y=c[m],A=x[m],XX(e,A,t,r,o,y,s)}}if(p.pick){let b=i.length,x;for(e._useFragmentCulling||(x=g._primitive._pickOffsets),m=0;m<b;++m){if(y=c[YX(m,b)],!e._useFragmentCulling){let T=x[YX(m,b)];y=c[T.index]}f&&(A=i[m],fhe(e,A,t,r,o,y)),d&&(A=i[m].derivedCommands.tileset,fhe(e,A,t,r,o,y))}}}mu.initializeTerrainHeights=function(){return Ni.initialize()};mu.prototype.update=function(e){if(!l(this._primitive)&&!l(this.geometryInstances))return;if(!Ni.initialized){mu.initializeTerrainHeights();return}let t=this,n=this._classificationPrimitiveOptions;if(!l(this._primitive)){let i=e.mapProjection.ellipsoid,r,o,s,a=Array.isArray(this.geometryInstances)?this.geometryInstances:[this.geometryInstances],c=a.length,u=new Array(c),f,d;for(f=0;f<c;++f){r=a[f],o=r.geometry;let y=Hk(e,o);l(d)?l(y)&&ie.union(d,y,d):d=ie.clone(y);let A=r.id;if(l(A)&&l(y)){let b=Ni.getBoundingSphere(y,i);this._boundingSpheresKeys.push(A),this._boundingSpheres.push(b)}s=o.constructor,!l(s)||l(s.createShadowVolume)}X5e(this,d,i);let p=e.verticalExaggeration,g=e.verticalExaggerationRelativeHeight;this._minHeight=br.getHeight(this._minTerrainHeight,p,g),this._maxHeight=br.getHeight(this._maxTerrainHeight,p,g);let m=mu._supportsMaterials(e.context);if(this._useFragmentCulling=m,m){let y,A=!0;for(f=0;f<c;++f)if(r=a[f],o=r.geometry,d=Hk(e,o),sd.shouldUseSphericalCoordinates(d)){A=!1;break}for(f=0;f<c;++f){r=a[f],o=r.geometry,s=o.constructor;let b=Hk(e,o),x=o.textureCoordinateRotationPoints;A?y=sd.getPlanarTextureCoordinateAttributes(b,x,i,e.mapProjection,this._maxHeight):y=sd.getSphericalExtentGeometryInstanceAttributes(b,x,i,e.mapProjection);let T=r.attributes;for(let E in T)T.hasOwnProperty(E)&&(y[E]=T[E]);u[f]=new Bt({geometry:s.createShadowVolume(o,uhe(this),lhe(this)),attributes:y,id:r.id})}}else for(f=0;f<c;++f)r=a[f],o=r.geometry,s=o.constructor,u[f]=new Bt({geometry:s.createShadowVolume(o,uhe(this),lhe(this)),attributes:r.attributes,id:r.id});n.geometryInstances=u,n.appearance=this.appearance,n._createBoundingVolumeFunction=function(y,A){K5e(t,y,A)},n._updateAndQueueCommandsFunction=function(y,A,b,x,T,E,v,S){$5e(t,A,b,x,T,E,v,S)},this._primitive=new wP(n)}this._primitive.appearance=this.appearance,this._primitive.show=this.show,this._primitive.debugShowShadowVolume=this.debugShowShadowVolume,this._primitive.debugShowBoundingVolume=this.debugShowBoundingVolume,this._primitive.update(e),e.afterRender.push(()=>{!this._ready&&l(this._primitive)&&this._primitive.ready&&(this._ready=!0,this.releaseGeometryInstances&&(this.geometryInstances=void 0))})};mu.prototype.getBoundingSphere=function(e){let t=this._boundingSpheresKeys.indexOf(e);if(t!==-1)return this._boundingSpheres[t]};mu.prototype.getGeometryInstanceAttributes=function(e){return this._primitive.getGeometryInstanceAttributes(e)};mu.prototype.isDestroyed=function(){return!1};mu.prototype.destroy=function(){return this._primitive=this._primitive&&this._primitive.destroy(),le(this)};mu._supportsMaterials=function(e){return e.depthTexture};mu.supportsMaterials=function(e){return mu._supportsMaterials(e.frameState.context)};var pu=mu;function Ka(e){e=e??H.EMPTY_OBJECT,this._primitives=[],this._guid=Kn(),this._primitiveAdded=new be,this._primitiveRemoved=new be,this._zIndex=void 0,this.show=e.show??!0,this.destroyPrimitives=e.destroyPrimitives??!0,this._countReferences=e.countReferences??!1}Object.defineProperties(Ka.prototype,{length:{get:function(){return this._primitives.length}},primitiveAdded:{get:function(){return this._primitiveAdded}},primitiveRemoved:{get:function(){return this._primitiveRemoved}}});Ka.prototype.add=function(e,t){let n=l(t),i=e._external=e._external||{},r=i._composites=i._composites||{};return r[this._guid]={collection:this},n?this._primitives.splice(t,0,e):this._primitives.push(e),this._countReferences&&(l(i._referenceCount)?++i._referenceCount:i._referenceCount=1),this._primitiveAdded.raiseEvent(e),e};Ka.prototype.remove=function(e){if(this.contains(e)){let t=this._primitives.indexOf(e);if(t!==-1)return this._primitives.splice(t,1),delete e._external._composites[this._guid],this._countReferences&&e._external._referenceCount--,this.destroyPrimitives&&(!this._countReferences||e._external._referenceCount<=0)&&e.destroy(),this._primitiveRemoved.raiseEvent(e),!0}return!1};Ka.prototype.removeAndDestroy=function(e){let t=this.remove(e);return t&&!this.destroyPrimitives&&e.destroy(),t};Ka.prototype.removeAll=function(){let e=this._primitives,t=e.length;for(let n=0;n<t;++n){let i=e[n];delete i._external._composites[this._guid],this._countReferences&&i._external._referenceCount--,this.destroyPrimitives&&(!this._countReferences||i._external._referenceCount<=0)&&i.destroy(),this._primitiveRemoved.raiseEvent(i)}this._primitives=[]};Ka.prototype.contains=function(e){return!!(l(e)&&e._external&&e._external._composites&&e._external._composites[this._guid])};function Gk(e,t){return e._primitives.indexOf(t)}Ka.prototype.raise=function(e){if(l(e)){let t=Gk(this,e),n=this._primitives;if(t!==n.length-1){let i=n[t];n[t]=n[t+1],n[t+1]=i}}};Ka.prototype.raiseToTop=function(e){if(l(e)){let t=Gk(this,e),n=this._primitives;t!==n.length-1&&(n.splice(t,1),n.push(e))}};Ka.prototype.lower=function(e){if(l(e)){let t=Gk(this,e),n=this._primitives;if(t!==0){let i=n[t];n[t]=n[t-1],n[t-1]=i}}};Ka.prototype.lowerToBottom=function(e){if(l(e)){let t=Gk(this,e),n=this._primitives;t!==0&&(n.splice(t,1),n.unshift(e))}};Ka.prototype.get=function(e){return this._primitives[e]};Ka.prototype.update=function(e){if(!this.show)return;let t=this._primitives;for(let n=0;n<t.length;++n)t[n].update(e)};Ka.prototype.prePassesUpdate=function(e){let t=this._primitives;for(let n=0;n<t.length;++n){let i=t[n];l(i.prePassesUpdate)&&i.prePassesUpdate(e)}};Ka.prototype.updateForPass=function(e,t){let n=this._primitives;for(let i=0;i<n.length;++i){let r=n[i];l(r.updateForPass)&&r.updateForPass(e,t)}};Ka.prototype.postPassesUpdate=function(e){let t=this._primitives;for(let n=0;n<t.length;++n){let i=t[n];l(i.postPassesUpdate)&&i.postPassesUpdate(e)}};Ka.prototype.isDestroyed=function(){return!1};Ka.prototype.destroy=function(){return this.removeAll(),le(this)};var Rl=Ka;function Zm(){this._length=0,this._collections={},this._collectionsArray=[],this.show=!0}Object.defineProperties(Zm.prototype,{length:{get:function(){return this._length}}});Zm.prototype.add=function(e,t){t=t??0;let n=this._collections[t];if(!l(n)){n=new Rl({destroyPrimitives:!1}),n._zIndex=t,this._collections[t]=n;let i=this._collectionsArray,r=0;for(;r<i.length&&i[r]._zIndex<t;)r++;i.splice(r,0,n)}return n.add(e),this._length++,e._zIndex=t,e};Zm.prototype.set=function(e,t){return t===e._zIndex||(this.remove(e,!0),this.add(e,t)),e};Zm.prototype.remove=function(e,t){if(this.contains(e)){let n=e._zIndex,i=this._collections[n],r;return t?r=i.remove(e):r=i.removeAndDestroy(e),r&&this._length--,i.length===0&&(this._collectionsArray.splice(this._collectionsArray.indexOf(i),1),this._collections[n]=void 0,i.destroy()),r}return!1};Zm.prototype.removeAll=function(){let e=this._collectionsArray;for(let t=0;t<e.length;t++){let n=e[t];n.destroyPrimitives=!0,n.destroy()}this._collections={},this._collectionsArray=[],this._length=0};Zm.prototype.contains=function(e){if(!l(e))return!1;let t=this._collections[e._zIndex];return l(t)&&t.contains(e)};Zm.prototype.update=function(e){if(!this.show)return;let t=this._collectionsArray;for(let n=0;n<t.length;n++)t[n].update(e)};Zm.prototype.isDestroyed=function(){return!1};Zm.prototype.destroy=function(){return this.removeAll(),le(this)};var Wk=Zm;var KX=class{constructor(){this._array=[],this._hash={}}get length(){return this._array.length}get values(){return this._array}contains(t){return l(this._hash[t])}set(t,n){let i=this._hash[t];n!==i&&(this.remove(t),this._hash[t]=n,this._array.push(n))}get(t){return this._hash[t]}remove(t){let n=this._hash[t],i=l(n);if(i){let r=this._array;r.splice(r.indexOf(n),1),delete this._hash[t]}return i}removeAll(){let t=this._array;t.length>0&&(this._hash={},t.length=0)}},zt=KX;function sf(e,t){e=e??0,this._near=e,t=t??Number.MAX_VALUE,this._far=t}Object.defineProperties(sf.prototype,{near:{get:function(){return this._near},set:function(e){this._near=e}},far:{get:function(){return this._far},set:function(e){this._far=e}}});sf.packedLength=2;sf.pack=function(e,t,n){return n=n??0,t[n++]=e.near,t[n]=e.far,t};sf.unpack=function(e,t,n){return t=t??0,l(n)||(n=new sf),n.near=e[t++],n.far=e[t],n};sf.equals=function(e,t){return e===t||l(e)&&l(t)&&e.near===t.near&&e.far===t.far};sf.clone=function(e,t){if(l(e))return l(t)||(t=new sf),t.near=e.near,t.far=e.far,t};sf.prototype.clone=function(e){return sf.clone(this,e)};sf.prototype.equals=function(e){return sf.equals(this,e)};var Gt=sf;function ad(e,t,n,i){this.near=e??0,this.nearValue=t??0,this.far=n??1,this.farValue=i??0}ad.clone=function(e,t){if(l(e))return l(t)?(t.near=e.near,t.nearValue=e.nearValue,t.far=e.far,t.farValue=e.farValue,t):new ad(e.near,e.nearValue,e.far,e.farValue)};ad.packedLength=4;ad.pack=function(e,t,n){return n=n??0,t[n++]=e.near,t[n++]=e.nearValue,t[n++]=e.far,t[n]=e.farValue,t};ad.unpack=function(e,t,n){return t=t??0,l(n)||(n=new ad),n.near=e[t++],n.nearValue=e[t++],n.far=e[t++],n.farValue=e[t],n};ad.equals=function(e,t){return e===t||l(e)&&l(t)&&e.near===t.near&&e.nearValue===t.nearValue&&e.far===t.far&&e.farValue===t.farValue};ad.prototype.clone=function(e){return ad.clone(this,e)};ad.prototype.equals=function(e){return ad.equals(this,e)};var qt=ad;var H_={NONE:0,CLAMP_TO_GROUND:1,RELATIVE_TO_GROUND:2,CLAMP_TO_TERRAIN:3,RELATIVE_TO_TERRAIN:4,CLAMP_TO_3D_TILE:5,RELATIVE_TO_3D_TILE:6,CLIP_TO_GROUND:7};Object.freeze(H_);var We=H_;function fs(e){return e===H_.CLAMP_TO_GROUND||e===H_.CLAMP_TO_3D_TILE||e===H_.CLAMP_TO_TERRAIN}function G_(e){return e===H_.RELATIVE_TO_GROUND||e===H_.RELATIVE_TO_3D_TILE||e===H_.RELATIVE_TO_TERRAIN}var dhe={CENTER:0,LEFT:1,RIGHT:-1};Object.freeze(dhe);var Gi=dhe;var hhe={CENTER:0,BOTTOM:1,BASELINE:2,TOP:-1};Object.freeze(hhe);var qn=hhe;function Th(){pe.throwInstantiationError()}Object.defineProperties(Th.prototype,{isConstant:{get:pe.throwInstantiationError},definitionChanged:{get:pe.throwInstantiationError}});Th.prototype.getValue=pe.throwInstantiationError;Th.prototype.equals=pe.throwInstantiationError;Th.equals=function(e,t){return e===t||l(e)&&e.equals(t)};Th.arrayEquals=function(e,t){if(e===t)return!0;if(!l(e)||!l(t)||e.length!==t.length)return!1;let n=e.length;for(let i=0;i<n;i++)if(!Th.equals(e[i],t[i]))return!1;return!0};Th.isConstant=function(e){return!l(e)||e.isConstant};Th.getValueOrUndefined=function(e,t,n){return l(e)?e.getValue(t,n):void 0};Th.getValueOrDefault=function(e,t,n,i){return l(e)?e.getValue(t,i)??n:n};Th.getValueOrClonedDefault=function(e,t,n,i){let r;return l(e)&&(r=e.getValue(t,i)),l(r)||(r=n.clone(r)),r};var X=Th;var J5e=500;function Z5e(e,t,n,i,r){let o=t.mostDetailedHeightPosition;if(l(o)&&h.distance(o,n)>J5e&&(l(t.mostDetailedHeight)&&(t.mostDetailedHeightPrevious=t.mostDetailedHeight),t.mostDetailedHeightPosition=void 0,t.mostDetailedHeight=void 0),!l(t.mostDetailedHeightPosition))if(t.mostDetailedHeightPosition=h.clone(n),!l(e)||!e.sampleHeightSupported||e.mode!==re.SCENE3D)t.mostDetailedHeight=null;else{t.mostDetailedHeight=void 0;let a=(e.ellipsoid??ee.default).cartesianToCartographic(n);e.sampleHeightMostDetailed([a],i).then(function(c){r()&&(t.mostDetailedHeight=c[0].height??null)}).catch(function(){r()&&(t.mostDetailedHeight=null)})}return t.mostDetailedHeight===void 0?t.mostDetailedHeightPrevious:t.mostDetailedHeight}var Qm=Z5e;var Q5e=new he;function e9e(e,t,n,i,r){let o=i.cartesianToCartographic(e,Q5e);return n===We.CLIP_TO_GROUND?o.height<t&&(o.height=t):fs(n)?o.height=t:G_(n)&&(o.height+=t),i.cartographicToCartesian(o,r)}var W_=e9e;var mhe={LEFT:-1,NONE:0,RIGHT:1};Object.freeze(mhe);var Yo=mhe;var t9e=z.WHITE,n9e=h.ZERO,i9e=We.NONE,r9e=U.ZERO,o9e=1,s9e=0,a9e=h.ZERO,c9e=Gi.CENTER,l9e=qn.CENTER,u9e=!1,f9e=Yo.NONE,d9e=new h,h9e=new z,m9e=new h,p9e=new U,g9e=new qt,_9e=new qt,y9e=new qt,A9e=new et,b9e=new Gt;function phe(e){this.entity=e,this.billboard=void 0,this.textureValue=void 0}function q_(e,t){t.collectionChanged.addEventListener(q_.prototype._onCollectionChanged,this),this._cluster=e,this._entityCollection=t,this._items=new zt,this._onCollectionChanged(t,t.values,[],[])}q_.prototype.update=function(e){let t=this._items.values,n=this._cluster;for(let i=0,r=t.length;i<r;i++){let o=t[i],s=o.entity,a=s._billboard,c,u=o.billboard,f=s.isShowing&&s.isAvailable(e)&&X.getValueOrDefault(a._show,e,!0),d;if(f&&(d=X.getValueOrUndefined(s._position,e,d9e),c=X.getValueOrUndefined(a._image,e),f=l(d)&&l(c)),!f){$X(o,s,n);continue}X.isConstant(s._position)||(n._clusterDirty=!0),l(u)||(u=n.getBillboard(s),u.id=s,o.billboard=u,o.textureValue=void 0),u.show=f,u.position=d,u.color=X.getValueOrDefault(a._color,e,t9e,h9e),u.eyeOffset=X.getValueOrDefault(a._eyeOffset,e,n9e,m9e),u.heightReference=X.getValueOrDefault(a._heightReference,e,i9e),u.pixelOffset=X.getValueOrDefault(a._pixelOffset,e,r9e,p9e),u.scale=X.getValueOrDefault(a._scale,e,o9e),u.rotation=X.getValueOrDefault(a._rotation,e,s9e),u.alignedAxis=X.getValueOrDefault(a._alignedAxis,e,a9e),u.horizontalOrigin=X.getValueOrDefault(a._horizontalOrigin,e,c9e),u.verticalOrigin=X.getValueOrDefault(a._verticalOrigin,e,l9e),u.width=X.getValueOrUndefined(a._width,e),u.height=X.getValueOrUndefined(a._height,e),u.scaleByDistance=X.getValueOrUndefined(a._scaleByDistance,e,g9e),u.translucencyByDistance=X.getValueOrUndefined(a._translucencyByDistance,e,_9e),u.pixelOffsetScaleByDistance=X.getValueOrUndefined(a._pixelOffsetScaleByDistance,e,y9e),u.sizeInMeters=X.getValueOrDefault(a._sizeInMeters,e,u9e),u.distanceDisplayCondition=X.getValueOrUndefined(a._distanceDisplayCondition,e,b9e),u.disableDepthTestDistance=X.getValueOrUndefined(a._disableDepthTestDistance,e),u.splitDirection=X.getValueOrDefault(a._splitDirection,e,f9e),o.textureValue!==c&&(u.image=c,o.textureValue=c);let p=X.getValueOrUndefined(a._imageSubRegion,e,A9e);l(p)&&u.setImageSubRegion(u.image,p)}return!0};q_.prototype.getBoundingSphere=function(e,t){let n=this._items.get(e.id);if(!l(n)||!l(n.billboard))return Pt.FAILED;let i=n.billboard;if(i.heightReference===We.NONE)t.center=h.clone(i.position,t.center);else if(i._clampedToSurface)t.center=h.clone(i._clampedPosition,t.center);else{let r=this._cluster._scene,o=this._items,s=Qm(r,n,i.position,[i],()=>o.get(e.id)===n);if(s===void 0)return Pt.PENDING;s===null?t.center=h.clone(i.position,t.center):t.center=W_(i.position,s,i.heightReference,r.ellipsoid??ee.default,t.center)}return t.radius=0,Pt.DONE};q_.prototype.isDestroyed=function(){return!1};q_.prototype.destroy=function(){this._entityCollection.collectionChanged.removeEventListener(q_.prototype._onCollectionChanged,this);let e=this._entityCollection.values;for(let t=0;t<e.length;t++)this._cluster.removeBillboard(e[t]);return le(this)};q_.prototype._onCollectionChanged=function(e,t,n,i){let r,o,s=this._items,a=this._cluster;for(r=t.length-1;r>-1;r--)o=t[r],l(o._billboard)&&l(o._position)&&s.set(o.id,new phe(o));for(r=i.length-1;r>-1;r--)o=i[r],l(o._billboard)&&l(o._position)?s.contains(o.id)||s.set(o.id,new phe(o)):($X(s.get(o.id),o,a),s.remove(o.id));for(r=n.length-1;r>-1;r--)o=n[r],$X(s.get(o.id),o,a),s.remove(o.id)};function $X(e,t,n){l(e)&&(e.billboard=void 0,n.removeBillboard(t))}var qk=q_;function Yk(){pe.throwInstantiationError()}Object.defineProperties(Yk.prototype,{name:{get:pe.throwInstantiationError},clock:{get:pe.throwInstantiationError},entities:{get:pe.throwInstantiationError},isLoading:{get:pe.throwInstantiationError},changedEvent:{get:pe.throwInstantiationError},errorEvent:{get:pe.throwInstantiationError},loadingEvent:{get:pe.throwInstantiationError},show:{get:pe.throwInstantiationError},clustering:{get:pe.throwInstantiationError}});Yk.prototype.update=function(e){pe.throwInstantiationError()};Yk.setLoading=function(e,t){e._isLoading!==t&&(t?e._entityCollection.suspendEvents():e._entityCollection.resumeEvents(),e._isLoading=t,e._loading.raiseEvent(e,t))};var Ps=Yk;function ep(e,t){this._ellipsoid=e,this._cameraPosition=new h,this._cameraPositionInScaledSpace=new h,this._distanceToLimbInScaledSpaceSquared=0,l(t)&&(this.cameraPosition=t)}Object.defineProperties(ep.prototype,{ellipsoid:{get:function(){return this._ellipsoid}},cameraPosition:{get:function(){return this._cameraPosition},set:function(e){let n=this._ellipsoid.transformPositionToScaledSpace(e,this._cameraPositionInScaledSpace),i=h.magnitudeSquared(n)-1;h.clone(e,this._cameraPosition),this._cameraPositionInScaledSpace=n,this._distanceToLimbInScaledSpaceSquared=i}}});var ghe=new h;ep.prototype.isPointVisible=function(e){let n=this._ellipsoid.transformPositionToScaledSpace(e,ghe);return ZX(n,this._cameraPositionInScaledSpace,this._distanceToLimbInScaledSpaceSquared)};ep.prototype.isScaledSpacePointVisible=function(e){return ZX(e,this._cameraPositionInScaledSpace,this._distanceToLimbInScaledSpaceSquared)};var x9e=new h;ep.prototype.isScaledSpacePointVisiblePossiblyUnderEllipsoid=function(e,t){let n=this._ellipsoid,i,r;return l(t)&&t<0&&n.minimumRadius>-t?(r=x9e,r.x=this._cameraPosition.x/(n.radii.x+t),r.y=this._cameraPosition.y/(n.radii.y+t),r.z=this._cameraPosition.z/(n.radii.z+t),i=r.x*r.x+r.y*r.y+r.z*r.z-1):(r=this._cameraPositionInScaledSpace,i=this._distanceToLimbInScaledSpaceSquared),ZX(e,r,i)};ep.prototype.computeHorizonCullingPoint=function(e,t,n){return Ahe(this._ellipsoid,e,t,n)};var _he=ee.clone(ee.UNIT_SPHERE);ep.prototype.computeHorizonCullingPointPossiblyUnderEllipsoid=function(e,t,n,i){let r=yhe(this._ellipsoid,n,_he);return Ahe(r,e,t,i)};ep.prototype.computeHorizonCullingPointFromVertices=function(e,t,n,i,r){return bhe(this._ellipsoid,e,t,n,i,r)};ep.prototype.computeHorizonCullingPointFromVerticesPossiblyUnderEllipsoid=function(e,t,n,i,r,o){let s=yhe(this._ellipsoid,r,_he);return bhe(s,e,t,n,i,o)};var T9e=[];ep.prototype.computeHorizonCullingPointFromRectangle=function(e,t,n){let i=ie.subsample(e,t,0,T9e),r=ue.fromPoints(i);if(!(h.magnitude(r.center)<.1*t.minimumRadius))return this.computeHorizonCullingPoint(r.center,i,n)};var E9e=new h;function yhe(e,t,n){if(l(t)&&t<0&&e.minimumRadius>-t){let i=h.fromElements(e.radii.x+t,e.radii.y+t,e.radii.z+t,E9e);e=ee.fromCartesian3(i,n)}return e}function Ahe(e,t,n,i){l(i)||(i=new h);let r=Ehe(e,t),o=0;for(let s=0,a=n.length;s<a;++s){let c=n[s],u=xhe(e,c,r);if(u<0)return;o=Math.max(o,u)}return The(r,o,i)}var Xk=new h;function bhe(e,t,n,i,r,o){l(o)||(o=new h),i=i??3,r=r??h.ZERO;let s=Ehe(e,t),a=0;for(let c=0,u=n.length;c<u;c+=i){Xk.x=n[c]+r.x,Xk.y=n[c+1]+r.y,Xk.z=n[c+2]+r.z;let f=xhe(e,Xk,s);if(f<0)return;a=Math.max(a,f)}return The(s,a,o)}function ZX(e,t,n){let i=t,r=n,o=h.subtract(e,i,ghe),s=-h.dot(o,i);return!(r<0?s>0:s>r&&s*s/h.magnitudeSquared(o)>r)}var C9e=new h,v9e=new h;function xhe(e,t,n){let i=e.transformPositionToScaledSpace(t,C9e),r=h.magnitudeSquared(i),o=Math.sqrt(r),s=h.divideByScalar(i,o,v9e);r=Math.max(1,r),o=Math.max(1,o);let a=h.dot(s,n),c=h.magnitude(h.cross(s,n,s)),u=1/o,f=Math.sqrt(r-1)*u;return 1/(a*u-c*f)}function The(e,t,n){if(!(t<=0||t===1/0||t!==t))return h.multiplyByScalar(e,t,n)}var JX=new h;function Ehe(e,t){return h.equals(t,h.ZERO)?t:(e.transformPositionToScaledSpace(t,JX),h.normalize(JX,JX))}var tp=ep;var S9e=Object.freeze({NONE:0,LOADING:2,LOADED:3,ERROR:4,FAILED:5}),Xs=S9e;function Eh(e){this._billboardCollection=e,this._id=void 0,this._loadState=Xs.NONE,this._loadError=void 0,this._index=-1,this._width=void 0,this._height=void 0,this._hasSubregion=!1,this.dirty=!1}Object.defineProperties(Eh.prototype,{loadError:{get:function(){return this._loadError}},loadState:{get:function(){return this._loadState}},ready:{get:function(){return this._loadState===Xs.LOADED}},hasImage:{get:function(){return this._loadState!==Xs.NONE}},id:{get:function(){return this._id}},width:{get:function(){return this._width}},height:{get:function(){return this._height}}});Eh.prototype.unload=async function(){this._loadState!==Xs.NONE&&(this._id=void 0,this._loadError=void 0,this._loadState=Xs.NONE,this._index=-1,this._width=void 0,this._height=void 0,this.dirty=!0)};Eh.prototype.loadImage=async function(e,t,n,i){if(this._id===e)return;let r=this._billboardCollection,o=r.billboardTextureCache,s=o.get(e);if(l(s)&&t.loadState===Xs.LOADING||t.loadState===Xs.LOADED){Eh.clone(s,this);return}l(s)||(s=new Eh(r),o.set(e,s)),s._id=this._id=e,s._loadState=this._loadState=Xs.LOADING,s._loadError=this._loadError=void 0;let a,c=this._billboardCollection.textureAtlas;try{let f=c.addImage(e,t,n,i);typeof f=="number"?a=f:a=await f}catch(f){if(s._loadState=Xs.ERROR,s._loadError=f,this._id!==e)return;this._loadState=Xs.ERROR,this._loadError=f;return}if(!l(a)||a===-1){if(s._loadState=Xs.FAILED,s._index=-1,this._id!==e)return;this._loadState=Xs.FAILED,this._index=-1;return}s._index=a,s._loadState=Xs.LOADED;let u=c.rectangles[a];s._width=u.width,s._height=u.height,this._id===e&&(this._index=a,this._loadState=Xs.LOADED,this._width=u.width,this._height=u.height,this.dirty=!0)};Eh.prototype.addImageSubRegion=function(e,t){this._id=e,this._loadError=void 0,this._hasSubregion=!0;let i=this._billboardCollection.textureAtlas.addImageSubRegion(e,t);if(typeof i=="number"){this.setImageSubRegion(i,t);return}this.loadImageSubRegion(e,t,i)};Eh.prototype.loadImageSubRegion=async function(e,t,n){let i;try{this._loadState=Xs.LOADING,i=await n}catch(r){this._loadState=Xs.ERROR,this._loadError=r;return}this._id===e&&(this._loadState=Xs.LOADED,this.setImageSubRegion(i,t))};Eh.prototype.setImageSubRegion=function(e,t){if(this._index!==e){if(!l(e)||e===-1){this._loadState=Xs.FAILED,this._index=-1,this._width=void 0,this._height=void 0;return}this._width=t.width,this._height=t.height,this._index=e,this.dirty=!0}};Eh.prototype.computeTextureCoordinates=function(e){return this._billboardCollection.textureAtlas.computeTextureCoordinates(this._index,e)};Eh.clone=function(e,t){if(t._id=e._id,t._loadState=e._loadState,t._loadError=void 0,t._index=e._index,t._width=e._width,t._height=e._height,t._hasSubregion=e._hasSubregion,e.ready){t.dirty=!0;return}return(async()=>{let i=e._id;await e._billboardCollection.textureAtlas._indexPromiseById.get(i),t._id===i&&(e._hasSubregion&&await Promise.resolve(),t._id=i,t._loadState=e._loadState,t._loadError=e._loadError,t._index=e._index,t._width=e._width,t._height=e._height,t.dirty=!0)})(),t};var Y_=Eh;var bc={},w9e=new se(0,0,0,1),Hc=new se,I9e=new et,QX=new U,eK=new U;bc.worldToWindowCoordinates=function(e,t,n){return bc.worldWithEyeOffsetToWindowCoordinates(e,t,h.ZERO,n)};var Che=new se,vhe=new h;function IP(e,t,n,i){let r=n.viewMatrix,o=M.multiplyByVector(r,se.fromElements(e.x,e.y,e.z,1,Che),Che),s=h.multiplyComponents(t,h.normalize(o,vhe),vhe);return o.x+=t.x+s.x,o.y+=t.y+s.y,o.z+=s.z,M.multiplyByVector(n.frustum.projectionMatrix,o,i)}var P9e=new he(Math.PI,P.PI_OVER_TWO),D9e=new h,R9e=new h;bc.worldWithEyeOffsetToWindowCoordinates=function(e,t,n,i){let r=e.frameState,o=bc.computeActualEllipsoidPosition(r,t,w9e);if(!l(o))return;let s=e.canvas,a=I9e;a.x=0,a.y=0,a.width=s.clientWidth,a.height=s.clientHeight;let c=e.camera,u=!1;if(r.mode===re.SCENE2D){let f=e.mapProjection,d=P9e,p=f.project(d,D9e),g=h.clone(c.position,R9e),m=c.frustum.clone(),y=M.computeViewportTransformation(a,0,1,new M),A=c.frustum.projectionMatrix,b=c.positionWC.y,x=h.fromElements(P.sign(b)*p.x-b,0,-c.positionWC.x),T=At.pointToGLWindowCoordinates(A,y,x);if(b===0||T.x<=0||T.x>=s.clientWidth)u=!0;else{if(T.x>s.clientWidth*.5){a.width=T.x,c.frustum.right=p.x-b,Hc=IP(o,n,c,Hc),bc.clipToGLWindowCoordinates(a,Hc,QX),a.x+=T.x,c.position.x=-c.position.x;let E=c.frustum.right;c.frustum.right=-c.frustum.left,c.frustum.left=-E,Hc=IP(o,n,c,Hc),bc.clipToGLWindowCoordinates(a,Hc,eK)}else{a.x+=T.x,a.width-=T.x,c.frustum.left=-p.x-b,Hc=IP(o,n,c,Hc),bc.clipToGLWindowCoordinates(a,Hc,QX),a.x=a.x-a.width,c.position.x=-c.position.x;let E=c.frustum.left;c.frustum.left=-c.frustum.right,c.frustum.right=-E,Hc=IP(o,n,c,Hc),bc.clipToGLWindowCoordinates(a,Hc,eK)}h.clone(g,c.position),c.frustum=m.clone(),i=U.clone(QX,i),(i.x<0||i.x>s.clientWidth)&&(i.x=eK.x)}}if(r.mode!==re.SCENE2D||u){if(Hc=IP(o,n,c,Hc),Hc.z<0&&!(c.frustum instanceof _n)&&!(c.frustum instanceof Ss))return;i=bc.clipToGLWindowCoordinates(a,Hc,i)}return i.y=s.clientHeight-i.y,i};bc.worldToDrawingBufferCoordinates=function(e,t,n){if(n=bc.worldToWindowCoordinates(e,t,n),!!l(n))return bc.transformWindowToDrawingBuffer(e,n,n)};var Y0=new h,O9e=new he;bc.computeActualEllipsoidPosition=function(e,t,n){let i=e.mode;if(i===re.SCENE3D)return h.clone(t,n);let r=e.mapProjection,o=r.ellipsoid.cartesianToCartographic(t,O9e);if(!l(o))return;if(r.project(o,Y0),i===re.COLUMBUS_VIEW)return h.fromElements(Y0.z,Y0.x,Y0.y,n);if(i===re.SCENE2D)return h.fromElements(0,Y0.x,Y0.y,n);let s=e.morphTime;return h.fromElements(P.lerp(Y0.z,t.x,s),P.lerp(Y0.x,t.y,s),P.lerp(Y0.y,t.z,s),n)};var She=new h,whe=new h,Ihe=new M;bc.clipToGLWindowCoordinates=function(e,t,n){return h.divideByScalar(t,t.w,She),M.computeViewportTransformation(e,0,1,Ihe),M.multiplyByPoint(Ihe,She,whe),U.fromCartesian3(whe,n)};bc.transformWindowToDrawingBuffer=function(e,t,n){let i=e.canvas,r=e.drawingBufferWidth/i.clientWidth,o=e.drawingBufferHeight/i.clientHeight;return U.fromElements(t.x*r,t.y*o,n)};var M9e=new se,Phe=new se;bc.drawingBufferToWorldCoordinates=function(e,t,n,i){let o=e.context.uniformState,s=o.currentFrustum,a=s.x,c=s.y;if(e.frameState.useLogDepth){let g=n*o.log2FarDepthFromNearPlusOne,m=Math.pow(2,g)-1;n=c*(1-a/(m+a))/(c-a)}let u=e.view.passState.viewport,f=se.clone(se.UNIT_W,M9e);f.x=(t.x-u.x)/u.width*2-1,f.y=(t.y-u.y)/u.height*2-1,f.z=n*2-1,f.w=1;let d,p=e.camera.frustum;if(l(p.fovy)){d=M.multiplyByVector(o.inverseViewProjection,f,Phe);let g=1/d.w;h.multiplyByScalar(d,g,d)}else{let g=p.offCenterFrustum;l(g)&&(p=g),d=Phe,d.x=(f.x*(p.right-p.left)+p.left+p.right)*.5,d.y=(f.y*(p.top-p.bottom)+p.bottom+p.top)*.5,d.z=(f.z*(a-c)-a-c)*.5,d.w=1,d=M.multiplyByVector(o.inverseView,d,d)}return h.fromCartesian4(d,i)};var pr=bc;function Ri(e,t){e=e??H.EMPTY_OBJECT;let n=e.translucencyByDistance,i=e.pixelOffsetScaleByDistance,r=e.scaleByDistance,o=e.distanceDisplayCondition;l(n)&&(n=qt.clone(n)),l(i)&&(i=qt.clone(i)),l(r)&&(r=qt.clone(r)),l(o)&&(o=Gt.clone(o)),this._show=e.show??!0,this._position=h.clone(e.position??h.ZERO),this._actualPosition=h.clone(this._position),this._pixelOffset=U.clone(e.pixelOffset??U.ZERO),this._translate=new U(0,0),this._eyeOffset=h.clone(e.eyeOffset??h.ZERO),this._heightReference=e.heightReference??We.NONE,this._verticalOrigin=e.verticalOrigin??qn.CENTER,this._horizontalOrigin=e.horizontalOrigin??Gi.CENTER,this._scale=e.scale??1,this._color=z.clone(e.color??z.WHITE),this._rotation=e.rotation??0,this._alignedAxis=h.clone(e.alignedAxis??h.ZERO),this._width=e.width,this._height=e.height,this._scaleByDistance=r,this._translucencyByDistance=n,this._pixelOffsetScaleByDistance=i,this._sizeInMeters=e.sizeInMeters??!1,this._distanceDisplayCondition=o,this._disableDepthTestDistance=e.disableDepthTestDistance,this._id=e.id,this._collection=e.collection??t,this._pickId=void 0,this._pickPrimitive=e._pickPrimitive??this,this._billboardCollection=t,this._dirty=!1,this._index=-1,this._batchIndex=void 0,this._imageTexture=new Y_(t),this._imageId=e.imageId,this._imageWidth=void 0,this._imageHeight=void 0,this._labelDimensions=void 0,this._labelHorizontalOrigin=void 0,this._labelTranslate=void 0;let s=e.image;l(s)&&(this._computeImageTextureProperties(e.imageId,s),this._imageTexture.loadImage(this._imageId,s,this._imageWidth,this._imageHeight)),l(e.imageSubRegion)&&this._imageTexture.addImageSubRegion(this._imageId,e.imageSubRegion),this._actualClampedPosition=void 0,this._removeCallbackFunc=void 0,this._lastSurfaceHeight=void 0,this._lastSurfaceQueryFrame=-1,this._lastSurfaceQueryMissed=!1,this._clampedToSurface=!1,this._clampingCartesian=void 0,this._clampingHeight=0,this._clampingHeightValid=!1,this._mode=re.SCENE3D,this._clusterShow=!0,this._outlineColor=z.clone(e.outlineColor??z.BLACK),this._outlineWidth=e.outlineWidth??0,this._updateClamping(),this._splitDirection=e.splitDirection??Yo.NONE,this._positionFromParent=!1}var Dhe=Ri.SHOW_INDEX=0,$k=Ri.POSITION_INDEX=1,Uhe=Ri.PIXEL_OFFSET_INDEX=2,N9e=Ri.EYE_OFFSET_INDEX=3,L9e=Ri.HORIZONTAL_ORIGIN_INDEX=4,F9e=Ri.VERTICAL_ORIGIN_INDEX=5,B9e=Ri.SCALE_INDEX=6,Rhe=Ri.IMAGE_INDEX_INDEX=7,Ohe=Ri.COLOR_INDEX=8,k9e=Ri.ROTATION_INDEX=9,U9e=Ri.ALIGNED_AXIS_INDEX=10,z9e=Ri.SCALE_BY_DISTANCE_INDEX=11,V9e=Ri.TRANSLUCENCY_BY_DISTANCE_INDEX=12,j9e=Ri.PIXEL_OFFSET_SCALE_BY_DISTANCE_INDEX=13,H9e=Ri.DISTANCE_DISPLAY_CONDITION=14,G9e=Ri.DISABLE_DEPTH_DISTANCE=15;Ri.TEXTURE_COORDINATE_BOUNDS=16;var Mhe=Ri.SDF_INDEX=17,W9e=Ri.SPLIT_DIRECTION_INDEX=18;Ri.NUMBER_OF_PROPERTIES=19;function Eo(e,t){let n=e._billboardCollection;l(n)&&(n._updateBillboard(e,t),e._dirty=!0)}function tK(e,t){return e===t||l(e)&&l(t)&&e.x===t.x&&e.y===t.y&&e.z===t.z}function Fb(e,t){if(l(e))return l(t)?(t.x=e.x,t.y=e.y,t.z=e.z,t):new h(e.x,e.y,e.z)}Object.defineProperties(Ri.prototype,{show:{get:function(){return this._show},set:function(e){this._show!==e&&(this._show=e,Eo(this,Dhe))}},position:{get:function(){return this._position},set:function(e){let t=this._position;tK(t,e)||(Fb(e,t),Fb(e,this._actualPosition),this._updateClamping(),Eo(this,$k))}},heightReference:{get:function(){return this._heightReference},set:function(e){let t=this._heightReference;e!==t&&(this._heightReference=e,this._updateClamping(),Eo(this,$k))}},pixelOffset:{get:function(){return this._pixelOffset},set:function(e){let t=this._pixelOffset;U.equals(t,e)||(U.clone(e,t),Eo(this,Uhe))}},scaleByDistance:{get:function(){return this._scaleByDistance},set:function(e){let t=this._scaleByDistance;qt.equals(t,e)||(this._scaleByDistance=qt.clone(e,t),Eo(this,z9e))}},translucencyByDistance:{get:function(){return this._translucencyByDistance},set:function(e){let t=this._translucencyByDistance;qt.equals(t,e)||(this._translucencyByDistance=qt.clone(e,t),Eo(this,V9e))}},pixelOffsetScaleByDistance:{get:function(){return this._pixelOffsetScaleByDistance},set:function(e){let t=this._pixelOffsetScaleByDistance;qt.equals(t,e)||(this._pixelOffsetScaleByDistance=qt.clone(e,t),Eo(this,j9e))}},eyeOffset:{get:function(){return this._eyeOffset},set:function(e){let t=this._eyeOffset;h.equals(t,e)||(h.clone(e,t),Eo(this,N9e))}},horizontalOrigin:{get:function(){return this._horizontalOrigin},set:function(e){this._horizontalOrigin!==e&&(this._horizontalOrigin=e,Eo(this,L9e))}},verticalOrigin:{get:function(){return this._verticalOrigin},set:function(e){this._verticalOrigin!==e&&(this._verticalOrigin=e,Eo(this,F9e))}},scale:{get:function(){return this._scale},set:function(e){this._scale!==e&&(this._scale=e,Eo(this,B9e))}},color:{get:function(){return this._color},set:function(e){let t=this._color;z.equals(t,e)||(z.clone(e,t),Eo(this,Ohe))}},rotation:{get:function(){return this._rotation},set:function(e){this._rotation!==e&&(this._rotation=e,Eo(this,k9e))}},alignedAxis:{get:function(){return this._alignedAxis},set:function(e){let t=this._alignedAxis;h.equals(t,e)||(h.clone(e,t),Eo(this,U9e))}},width:{get:function(){return this._width??this._imageTexture.width},set:function(e){this._width!==e&&(this._width=e,Eo(this,Rhe))}},height:{get:function(){return this._height??this._imageTexture.height},set:function(e){this._height!==e&&(this._height=e,Eo(this,Rhe))}},sizeInMeters:{get:function(){return this._sizeInMeters},set:function(e){this._sizeInMeters!==e&&(this._sizeInMeters=e,Eo(this,Ohe))}},distanceDisplayCondition:{get:function(){return this._distanceDisplayCondition},set:function(e){Gt.equals(e,this._distanceDisplayCondition)||(this._distanceDisplayCondition=Gt.clone(e,this._distanceDisplayCondition),Eo(this,H9e))}},disableDepthTestDistance:{get:function(){return this._disableDepthTestDistance},set:function(e){this._disableDepthTestDistance!==e&&(this._disableDepthTestDistance=e,Eo(this,G9e))}},id:{get:function(){return this._id},set:function(e){this._id=e,l(this._pickId)&&(this._pickId.object.id=e)}},pickPrimitive:{get:function(){return this._pickPrimitive},set:function(e){this._pickPrimitive=e,l(this._pickId)&&(this._pickId.object.primitive=e)}},pickId:{get:function(){return this._pickId}},image:{get:function(){return this._imageTexture.id},set:function(e){if(!l(e)){this._imageTexture.unload();return}this._computeImageTextureProperties(void 0,e),this._imageTexture.loadImage(this._imageId,e,this._imageWidth,this._imageHeight)}},ready:{get:function(){return this._imageTexture.ready}},loadError:{get:function(){return this._imageTexture.loadError}},textureDirty:{get:function(){return this._imageTexture.dirty},set:function(e){this._imageTexture.dirty=e}},_clampedPosition:{get:function(){return this._actualClampedPosition},set:function(e){this._actualClampedPosition=Fb(e,this._actualClampedPosition),Eo(this,$k)}},clusterShow:{get:function(){return this._clusterShow},set:function(e){this._clusterShow!==e&&(this._clusterShow=e,Eo(this,Dhe))}},outlineColor:{get:function(){return this._outlineColor},set:function(e){let t=this._outlineColor;z.equals(t,e)||(z.clone(e,t),Eo(this,Mhe))}},outlineWidth:{get:function(){return this._outlineWidth},set:function(e){this._outlineWidth!==e&&(this._outlineWidth=e,Eo(this,Mhe))}},splitDirection:{get:function(){return this._splitDirection},set:function(e){this._splitDirection!==e&&(this._splitDirection=e,Eo(this,W9e))}}});Ri.prototype.getPickId=function(e){return l(this._pickId)||(this._pickId=e.createPickId({primitive:this._pickPrimitive,collection:this._collection,id:this._id})),this._pickId};Ri.prototype._updateClamping=function(){Ri._updateClamping(this._billboardCollection,this)};var Jk=new he,q9e=new he,Nhe=200,Lhe=30;function Fhe(e,t,n,i){let r=t.cartographicToCartesian(i,e._clampedPosition);G_(e._heightReference)?e._mode===re.SCENE3D?(i.height+=n.height,t.cartographicToCartesian(i,r)):r.x+=n.height:e._heightReference===We.CLIP_TO_GROUND&&n.height>i.height&&(e._mode===re.SCENE3D?(i.height=n.height,t.cartographicToCartesian(i,r)):r.x=n.height),e._clampedPosition=r}Ri._updateClamping=function(e,t){if(!l(e)||!l(e._scene))return;let n=e._scene,i=n.ellipsoid??ee.default,r=n.frameState.mode,o=r!==t._mode;if(t._mode=r,(t._heightReference===We.NONE||o)&&l(t._removeCallbackFunc)&&(t._removeCallbackFunc(),t._removeCallbackFunc=void 0,t._clampedPosition=void 0,t._lastSurfaceHeight=void 0,t._clampedToSurface=!1),t._heightReference===We.NONE||t._positionFromParent||!l(t._position))return;let s=n.frameState.frameNumber;if(t._clampingHeightValid&&t._heightReference===We.CLIP_TO_GROUND&&r===re.SCENE3D&&l(t._removeCallbackFunc)&&l(t._lastSurfaceHeight)&&s-t._lastSurfaceQueryFrame<Lhe){let A=t._position,b=t._clampingCartesian,x=A.x-b.x,T=A.y-b.y,E=A.z-b.z,v=Math.sqrt(x*x+T*T+E*E);if(t._clampingHeight-v>t._lastSurfaceHeight+Nhe){t._clampedToSurface=!0,t._clampedPosition=A;return}}let a=i.cartesianToCartographic(t._position,q9e);if(!l(a)){t._actualClampedPosition=void 0,t._clampingHeightValid=!1;return}t._clampingCartesian=Fb(t._position,t._clampingCartesian),t._clampingHeight=a.height,t._clampingHeightValid=!0;let c=t._heightReference===We.CLIP_TO_GROUND,u=s-t._lastSurfaceQueryFrame<Lhe,f=c&&l(t._lastSurfaceHeight)&&a.height>t._lastSurfaceHeight+Nhe,d=f&&u,p=c&&u&&t._lastSurfaceQueryMissed;if(!((c&&t._lastSurfaceQueryMissed||f)&&l(t._removeCallbackFunc))){l(t._removeCallbackFunc)&&t._removeCallbackFunc();let A=he.clone(a);t._removeCallbackFunc=n.updateHeight(A,b=>{let x=n.getHeight(A,t._heightReference);l(x)&&(b.height=x,t._lastSurfaceQueryFrame=n.frameState.frameNumber,t._lastSurfaceQueryMissed=!1),t._lastSurfaceHeight=b.height,t._clampedToSurface=!0,Fhe(t,i,A,b)},t._heightReference)}he.clone(a,Jk);let y;d||p?y=t._lastSurfaceHeight:(t._lastSurfaceQueryFrame=s,y=n.getHeight(a,t._heightReference),t._lastSurfaceQueryMissed=!l(y),l(y)?t._lastSurfaceHeight=y:y=t._lastSurfaceHeight),t._clampedToSurface=l(y),l(y)&&(Jk.height=y),Fhe(t,i,a,Jk)};Ri.prototype.computeTextureCoordinates=function(e){return this._imageTexture.computeTextureCoordinates(e)};Ri.prototype.setImage=function(e,t){this._computeImageTextureProperties(e,t),this._imageTexture.loadImage(this._imageId,t,this._imageWidth,this._imageHeight)};Ri.prototype.setImageTexture=function(e){Y_.clone(e,this._imageTexture)};var Bhe=512;Ri.prototype._computeImageTextureProperties=function(e,t){if(this._imageWidth=void 0,this._imageHeight=void 0,!l(t)){this._imageId=Kn();return}let n;typeof t=="string"?n=t:t instanceof De?n=t._url:l(t.src)&&(n=t.src),this._imageId=e??n??Kn(),l(this._width)&&l(this._height)&&!this._sizeInMeters&&Y9e(n)&&(this._imageWidth=Math.min(this._width,Bhe),this._imageHeight=Math.min(this._height,Bhe))};function Y9e(e){return l(e)?Um(e)?e.startsWith("data:image/svg+xml"):S_(e)==="svg":!1}Ri.prototype.setImageSubRegion=function(e,t){this._imageTexture.addImageSubRegion(e,t)};Ri.prototype._setTranslate=function(e){let t=this._translate;U.equals(t,e)||(U.clone(e,t),Eo(this,Uhe))};Ri.prototype._getActualPosition=function(){return l(this._clampedPosition)?this._clampedPosition:this._actualPosition};Ri.prototype._setActualPosition=function(e){l(this._clampedPosition)||h.clone(e,this._actualPosition),Eo(this,$k)};var khe=new se;Ri._computeActualPosition=function(e,t,n,i){return l(e._clampedPosition)?(n.mode!==e._mode&&e._updateClamping(),e._clampedPosition):n.mode===re.SCENE3D?t:(M.multiplyByPoint(i,t,khe),pr.computeActualEllipsoidPosition(n,khe))};var zhe=new h;Ri._computeScreenSpacePosition=function(e,t,n,i,r,o){let s=M.multiplyByPoint(e,t,zhe),a=pr.worldWithEyeOffsetToWindowCoordinates(r,s,n,o);if(l(a))return U.add(a,i,a),a};var Kk=new U(0,0);Ri.prototype.computeScreenSpacePosition=function(e,t){let n=this._billboardCollection;l(t)||(t=new U),U.clone(this._pixelOffset,Kk),U.add(Kk,this._translate,Kk);let i=n.modelMatrix,r=this._position;if(l(this._clampedPosition)&&(r=this._clampedPosition,e.mode!==re.SCENE3D)){let s=e.mapProjection,a=s.ellipsoid,c=s.unproject(r,Jk);r=a.cartographicToCartesian(c,zhe),i=M.IDENTITY}return Ri._computeScreenSpacePosition(i,r,this._eyeOffset,Kk,e,t)};Ri.getScreenSpaceBoundingBox=function(e,t,n){let i=e.width,r=e.height,o=e.scale;i*=o,r*=o;let s=t.x;e.horizontalOrigin===Gi.RIGHT?s-=i:e.horizontalOrigin===Gi.CENTER&&(s-=i*.5);let a=t.y;return e.verticalOrigin===qn.BOTTOM||e.verticalOrigin===qn.BASELINE?a-=r:e.verticalOrigin===qn.CENTER&&(a-=r*.5),l(n)||(n=new et),n.x=s,n.y=a,n.width=i,n.height=r,n};Ri.prototype.equals=function(e){return this===e||l(e)&&this._id===e._id&&h.equals(this._position,e._position)&&this.image===e.image&&this._show===e._show&&this._scale===e._scale&&this._verticalOrigin===e._verticalOrigin&&this._horizontalOrigin===e._horizontalOrigin&&this._heightReference===e._heightReference&&z.equals(this._color,e._color)&&U.equals(this._pixelOffset,e._pixelOffset)&&U.equals(this._translate,e._translate)&&h.equals(this._eyeOffset,e._eyeOffset)&&qt.equals(this._scaleByDistance,e._scaleByDistance)&&qt.equals(this._translucencyByDistance,e._translucencyByDistance)&&qt.equals(this._pixelOffsetScaleByDistance,e._pixelOffsetScaleByDistance)&&Gt.equals(this._distanceDisplayCondition,e._distanceDisplayCondition)&&this._disableDepthTestDistance===e._disableDepthTestDistance&&this._splitDirection===e._splitDirection};Ri.prototype._destroy=function(){l(this._customData)&&(this._billboardCollection._scene.globe._surface.removeTileCustomData(this._customData),this._customData=void 0),l(this._removeCallbackFunc)&&(this._removeCallbackFunc(),this._removeCallbackFunc=void 0),this.image=void 0,this._pickId=this._pickId&&this._pickId.destroy(),this._billboardCollection=void 0};var Fr=Ri;var Vhe={OPAQUE:0,TRANSLUCENT:1,OPAQUE_AND_TRANSLUCENT:2};Object.freeze(Vhe);var Bi=Vhe;var X9e={FONT_SIZE:48,PADDING:10,RADIUS:8,CUTOFF:.25},$a=Object.freeze(X9e);var K9e=Fr.SHOW_INDEX,PP=Fr.POSITION_INDEX,Hhe=Fr.PIXEL_OFFSET_INDEX,Ghe=Fr.EYE_OFFSET_INDEX,$9e=Fr.HORIZONTAL_ORIGIN_INDEX,J9e=Fr.VERTICAL_ORIGIN_INDEX,Z9e=Fr.SCALE_INDEX,Bb=Fr.IMAGE_INDEX_INDEX,Whe=Fr.COLOR_INDEX,Q9e=Fr.ROTATION_INDEX,e7e=Fr.ALIGNED_AXIS_INDEX,qhe=Fr.SCALE_BY_DISTANCE_INDEX,Yhe=Fr.TRANSLUCENCY_BY_DISTANCE_INDEX,Xhe=Fr.PIXEL_OFFSET_SCALE_BY_DISTANCE_INDEX,Khe=Fr.DISTANCE_DISPLAY_CONDITION,t7e=Fr.DISABLE_DEPTH_DISTANCE,n7e=Fr.TEXTURE_COORDINATE_BOUNDS,$he=Fr.SDF_INDEX,Jhe=Fr.SPLIT_DIRECTION_INDEX,aK=Fr.NUMBER_OF_PROPERTIES,Br={direction:0,positionHighAndScale:1,positionLowAndRotation:2,compressedAttribute0:3,compressedAttribute1:4,compressedAttribute2:5,eyeOffset:6,scaleByDistance:7,pixelOffsetScaleByDistance:8,compressedAttribute3:9,textureCoordinateBoundsOrLabelTranslate:10,a_batchId:11,sdf:12,splitDirection:13};function ld(e){e=e??H.EMPTY_OBJECT,this._scene=e.scene,this._batchTable=e.batchTable;let t=e.textureAtlas;l(t)||(t=new XE),this._textureAtlas=t,this._textureAtlasGUID=t.guid,this._destroyTextureAtlas=!0,this._billboardTextureCache=new Map,this._sp=void 0,this._spTranslucent=void 0,this._rsOpaque=void 0,this._rsTranslucent=void 0,this._vaf=void 0,this._billboards=[],this._billboardsToUpdate=[],this._billboardsToUpdateIndex=0,this._billboardsRemoved=!1,this._createVertexArray=!1,this._shaderRotation=!1,this._compiledShaderRotation=!1,this._shaderAlignedAxis=!1,this._compiledShaderAlignedAxis=!1,this._shaderScaleByDistance=!1,this._compiledShaderScaleByDistance=!1,this._shaderTranslucencyByDistance=!1,this._compiledShaderTranslucencyByDistance=!1,this._shaderPixelOffsetScaleByDistance=!1,this._compiledShaderPixelOffsetScaleByDistance=!1,this._shaderDistanceDisplayCondition=!1,this._compiledShaderDistanceDisplayCondition=!1,this._shaderDisableDepthDistance=!1,this._compiledShaderDisableDepthDistance=!1,this._shaderClampToGround=!1,this._compiledShaderClampToGround=!1,this._propertiesChanged=new Uint32Array(aK),this._maxSize=0,this._maxEyeOffset=0,this._maxScale=1,this._maxPixelOffset=0,this._allHorizontalCenter=!0,this._allVerticalCenter=!0,this._allSizedInMeters=!0,this._baseVolume=new ue,this._baseVolumeWC=new ue,this._baseVolume2D=new ue,this._boundingVolume=new ue,this._boundingVolumeDirty=!1,this._colorCommands=[],this._allBillboardsReady=!1,this.show=e.show??!0,this.modelMatrix=M.clone(e.modelMatrix??M.IDENTITY),this._modelMatrix=M.clone(M.IDENTITY),this.debugShowBoundingVolume=e.debugShowBoundingVolume??!1,this.debugShowTextureAtlas=e.debugShowTextureAtlas??!1,this.blendOption=e.blendOption??Bi.OPAQUE_AND_TRANSLUCENT,this._blendOption=void 0,this._mode=re.SCENE3D,this._buffersUsage=[Me.STATIC_DRAW,Me.STATIC_DRAW,Me.STATIC_DRAW,Me.STATIC_DRAW,Me.STATIC_DRAW,Me.STATIC_DRAW,Me.STATIC_DRAW,Me.STATIC_DRAW,Me.STATIC_DRAW,Me.STATIC_DRAW,Me.STATIC_DRAW,Me.STATIC_DRAW,Me.STATIC_DRAW,Me.STATIC_DRAW,Me.STATIC_DRAW,Me.STATIC_DRAW,Me.STATIC_DRAW],this._highlightColor=z.clone(z.WHITE),this._coarseDepthTestDistance=e.coarseDepthTestDistance??ee.default.minimumRadius/10,this._threePointDepthTestDistance=e.threePointDepthTestDistance??ee.default.minimumRadius/1e3,this._uniforms={u_atlas:()=>this.textureAtlas.texture,u_highlightColor:()=>this._highlightColor,u_coarseDepthTestDistance:()=>this._coarseDepthTestDistance,u_threePointDepthTestDistance:()=>this._threePointDepthTestDistance};let n=this._scene;l(n)&&l(n.terrainProviderChanged)&&(this._removeCallbackFunc=n.terrainProviderChanged.addEventListener(function(){let i=this._billboards,r=i.length;for(let o=0;o<r;++o)l(i[o])&&i[o]._updateClamping()},this))}Object.defineProperties(ld.prototype,{length:{get:function(){return cK(this),this._billboards.length}},textureAtlas:{get:function(){return this._textureAtlas},set:function(e){this._textureAtlas!==e&&(this._textureAtlas=this._destroyTextureAtlas&&this._textureAtlas&&this._textureAtlas.destroy(),this._textureAtlas=e)}},destroyTextureAtlas:{get:function(){return this._destroyTextureAtlas},set:function(e){this._destroyTextureAtlas=e}},sizeInBytes:{get:function(){return this._textureAtlas.sizeInBytes}},ready:{get:function(){return this._allBillboardsReady}},billboardTextureCache:{get:function(){return this._billboardTextureCache}},coarseDepthTestDistance:{get:function(){return this._coarseDepthTestDistance},set:function(e){this._coarseDepthTestDistance=e}},threePointDepthTestDistance:{get:function(){return this._threePointDepthTestDistance},set:function(e){this._threePointDepthTestDistance=e}}});function Zhe(e){let t=e.length;for(let n=0;n<t;++n)e[n]&&e[n]._destroy()}ld.prototype.add=function(e){let t=new Fr(e,this);return t._index=this._billboards.length,this._billboards.push(t),this._createVertexArray=!0,t};ld.prototype.remove=function(e){return this.contains(e)?(this._billboards[e._index]=void 0,this._billboardsRemoved=!0,this._createVertexArray=!0,e._destroy(),!0):!1};ld.prototype.removeAll=function(){Zhe(this._billboards),this._billboards=[],this._billboardsToUpdate=[],this._billboardsToUpdateIndex=0,this._billboardsRemoved=!1,this._createVertexArray=!0};function cK(e){if(e._billboardsRemoved){e._billboardsRemoved=!1;let t=[],n=e._billboards,i=n.length;for(let r=0,o=0;r<i;++r){let s=n[r];l(s)&&(s._index=o++,t.push(s))}e._billboards=t}}ld.prototype._updateBillboard=function(e,t){e._dirty||(this._billboardsToUpdate[this._billboardsToUpdateIndex++]=e),++this._propertiesChanged[t]};ld.prototype.contains=function(e){return l(e)&&e._billboardCollection===this};ld.prototype.get=function(e){return cK(this),this._billboards[e]};function jhe(e){let t=e.cache.billboardCollection_indexBufferInstanced;return l(t)||(t=tt.createIndexBuffer({context:e,typedArray:new Uint16Array([0,1,2,0,2,3]),usage:Me.STATIC_DRAW,indexDatatype:je.UNSIGNED_SHORT}),t.vertexArrayDestroyable=!1,e.cache.billboardCollection_indexBufferInstanced=t),t}function i7e(e){let t=e.cache.billboardCollection_vertexBufferInstanced;return l(t)||(t=tt.createVertexBuffer({context:e,typedArray:new Float32Array([0,0,1,0,1,1,0,1]),usage:Me.STATIC_DRAW}),t.vertexArrayDestroyable=!1,e.cache.billboardCollection_vertexBufferInstanced=t),t}ld.prototype.computeNewBuffersUsage=function(){let e=this._buffersUsage,t=!1,n=this._propertiesChanged;for(let i=0;i<aK;++i){let r=n[i]===0?Me.STATIC_DRAW:Me.STREAM_DRAW;t=t||e[i]!==r,e[i]=r}return t};function r7e(e,t,n,i,r){let o=[{index:Br.positionHighAndScale,componentsPerAttribute:4,componentDatatype:Y.FLOAT,usage:n[PP]},{index:Br.positionLowAndRotation,componentsPerAttribute:4,componentDatatype:Y.FLOAT,usage:n[PP]},{index:Br.compressedAttribute0,componentsPerAttribute:4,componentDatatype:Y.FLOAT,usage:n[Hhe]},{index:Br.compressedAttribute1,componentsPerAttribute:4,componentDatatype:Y.FLOAT,usage:n[Yhe]},{index:Br.compressedAttribute2,componentsPerAttribute:4,componentDatatype:Y.FLOAT,usage:n[Whe]},{index:Br.eyeOffset,componentsPerAttribute:4,componentDatatype:Y.FLOAT,usage:n[Ghe]},{index:Br.scaleByDistance,componentsPerAttribute:4,componentDatatype:Y.FLOAT,usage:n[qhe]},{index:Br.pixelOffsetScaleByDistance,componentsPerAttribute:4,componentDatatype:Y.FLOAT,usage:n[Xhe]},{index:Br.compressedAttribute3,componentsPerAttribute:4,componentDatatype:Y.FLOAT,usage:n[Khe]},{index:Br.textureCoordinateBoundsOrLabelTranslate,componentsPerAttribute:4,componentDatatype:Y.FLOAT,usage:n[n7e]},{index:Br.splitDirection,componentsPerAttribute:1,componentDatatype:Y.FLOAT,usage:n[Jhe]},{index:Br.direction,componentsPerAttribute:2,componentDatatype:Y.FLOAT,vertexBuffer:i7e(e)}];return l(i)&&o.push({index:Br.a_batchId,componentsPerAttribute:1,componentDatatype:Y.FLOAT,bufferUsage:Me.STATIC_DRAW}),r&&o.push({index:Br.sdf,componentsPerAttribute:2,componentDatatype:Y.FLOAT,usage:n[$he]}),new k_(e,o,t,!0)}var nK=new Sn;function Qhe(e,t){let n=e.center,i=t.x-n.x,r=t.y-n.y,o=t.z-n.z,s=Math.sqrt(i*i+r*r+o*o);s>e.radius&&(e.radius=s)}function eme(e,t,n,i){let r=n[Br.positionHighAndScale],o=n[Br.positionLowAndRotation],s=i._getActualPosition();e._mode===re.SCENE3D&&(Qhe(e._baseVolume,s),e._boundingVolumeDirty=!0),Sn.fromCartesian(s,nK);let a=i.scale,c=i.rotation;c!==0&&(e._shaderRotation=!0),e._maxScale=Math.max(e._maxScale,a);let u=nK.high,f=nK.low;r(i._index,u.x,u.y,u.z,a),o(i._index,f.x,f.y,f.z,c)}var X_=new U,cd=32768,lK=65536,iK=4096,kb=256,o7e=128,s7e=32,a7e=8,Zk=4,c7e=1/256,tme=new et;function nme(e,t,n,i){let r=n[Br.compressedAttribute0],o=i.pixelOffset,s=o.x,a=o.y,c=i._translate,u=c.x,f=c.y;e._maxPixelOffset=Math.max(e._maxPixelOffset,Math.abs(s+u),Math.abs(-a+f));let d=i.horizontalOrigin,p=i._verticalOrigin,g=i.show&&i.clusterShow;i.color.alpha===0&&(g=!1),p===qn.BASELINE&&(p=qn.BOTTOM),e._allHorizontalCenter=e._allHorizontalCenter&&d===Gi.CENTER,e._allVerticalCenter=e._allVerticalCenter&&p===qn.CENTER;let m=0,y=0;if(i.ready){let I=i.computeTextureCoordinates(tme);m=I.x,y=I.y}let A=Math.floor(P.clamp(s,-cd,cd)+cd)*o7e;A+=(d+1)*s7e,A+=(p+1)*a7e,A+=(g?1:0)*Zk;let b=Math.floor(P.clamp(a,-cd,cd)+cd)*kb,x=Math.floor(P.clamp(u*Zk,-cd,cd)+cd)*kb,T=(P.clamp(f*Zk,-cd,cd)+cd)*c7e,E=Math.floor(T),v=Math.floor((T-E)*kb);b+=E,x+=v,X_.x=m,X_.y=y;let S=cn.compressTextureCoordinates(X_);r(i._index,A,b,x,S)}function ime(e,t,n,i){let r=n[Br.compressedAttribute1],o=i.alignedAxis;h.equals(o,h.ZERO)||(o=h.normalize(o,new h),e._shaderAlignedAxis=!0);let s=0,a=1,c=1,u=1,f=i.translucencyByDistance;l(f)&&(s=f.near,a=f.nearValue,c=f.far,u=f.farValue,(a!==1||u!==1)&&(e._shaderTranslucencyByDistance=!0));let d=Math.round(i.width??0);e._maxSize=Math.max(e._maxSize,d);let p=P.clamp(d,0,lK),g=0;Math.abs(h.magnitudeSquared(o)-1)<P.EPSILON6&&(g=cn.octEncodeFloat(o)),a=P.clamp(a,0,1),a=a===1?255:a*255|0,p=p*kb+a,u=P.clamp(u,0,1),u=u===1?255:u*255|0,g=g*kb+u,r(i._index,p,g,s,c)}function oK(e,t,n,i){let r=n[Br.compressedAttribute2],o=i.color,s=l(e._batchTable)?z.WHITE:i.getPickId(t.context).color,a=i.sizeInMeters?1:0,c=i.alignedAxis,u=h.equals(c,h.ZERO)?c:h.normalize(c,new h),f=Math.abs(h.magnitudeSquared(u)-1)<P.EPSILON6?1:0;e._allSizedInMeters=e._allSizedInMeters&&a===1;let d=i.height??0;e._maxSize=Math.max(e._maxSize,d);let p=i._labelHorizontalOrigin??-2;p+=2;let g=cn.encodeRGB8(o),m=cn.encodeRGB8(s),y=z.floatToByte(o.alpha)*lK+z.floatToByte(s.alpha)*kb+(a*2+f),A=d*Zk+p;r(i._index,g,m,y,A)}function sK(e,t,n,i){let r=n[Br.eyeOffset],o=i.eyeOffset,s=o.z;if(i._heightReference!==We.NONE&&(s*=1.005),e._maxEyeOffset=Math.max(e._maxEyeOffset,Math.abs(o.x),Math.abs(o.y),Math.abs(s)),X_.x=0,X_.y=0,i.ready){let c=i.computeTextureCoordinates(tme);X_.x=c.width,X_.y=c.height}let a=cn.compressTextureCoordinates(X_);r(i._index,o.x,o.y,s,a)}function rme(e,t,n,i){let r=n[Br.scaleByDistance],o=0,s=1,a=1,c=1,u=i.scaleByDistance;l(u)&&(o=u.near,s=u.nearValue,a=u.far,c=u.farValue,(s!==1||c!==1)&&(e._shaderScaleByDistance=!0)),r(i._index,o,s,a,c)}function ome(e,t,n,i){let r=n[Br.pixelOffsetScaleByDistance],o=0,s=1,a=1,c=1,u=i.pixelOffsetScaleByDistance;l(u)&&(o=u.near,s=u.nearValue,a=u.far,c=u.farValue,(s!==1||c!==1)&&(e._shaderPixelOffsetScaleByDistance=!0)),r(i._index,o,s,a,c)}function sme(e,t,n,i){let r=n[Br.compressedAttribute3],o=0,s=Number.MAX_VALUE,a=i.distanceDisplayCondition;l(a)&&(o=a.near,s=a.far,o*=o,s*=s,e._shaderDistanceDisplayCondition=!0);let c=i.disableDepthTestDistance,u=fs(i.heightReference)&&t.context.depthTexture;c*=c,(u||c>0)&&(e._shaderDisableDepthDistance=!0,c===Number.POSITIVE_INFINITY&&(c=-1));let f,d;l(i._labelDimensions)?(d=i._labelDimensions.x,f=i._labelDimensions.y):(d=i.width??0,f=i.height??0);let p=Math.floor(P.clamp(d,0,iK)),g=Math.floor(P.clamp(f,0,iK)),m=p*iK+g;r(i._index,o,s,c,m)}function ame(e,t,n,i){if(fs(i.heightReference)){let a=e._scene,c=t.context,u=t.globeTranslucencyState.translucent,f=l(a.globe)&&a.globe.depthTestAgainstTerrain;e._shaderClampToGround=c.depthTexture&&!u&&f}let r=n[Br.textureCoordinateBoundsOrLabelTranslate],o=0,s=0;l(i._labelTranslate)&&(o=i._labelTranslate.x,s=i._labelTranslate.y),r(i._index,o,s,0,0)}function l7e(e,t,n,i){if(!l(e._batchTable))return;let r=n[Br.a_batchId],o=i._batchIndex;r(i._index,o)}function cme(e,t,n,i){if(!e._sdf)return;let r=n[Br.sdf],o=i.outlineColor,s=i.outlineWidth,a=cn.encodeRGB8(o),c=s/$a.RADIUS,u=z.floatToByte(o.alpha)*lK+z.floatToByte(c)*kb;r(i._index,a,u)}function lme(e,t,n,i){let r=n[Br.splitDirection],o=0,s=i.splitDirection;l(s)&&(o=s),r(i._index,o)}function u7e(e,t,n,i){eme(e,t,n,i),nme(e,t,n,i),ime(e,t,n,i),oK(e,t,n,i),sK(e,t,n,i),rme(e,t,n,i),ome(e,t,n,i),sme(e,t,n,i),ame(e,t,n,i),l7e(e,t,n,i),cme(e,t,n,i),lme(e,t,n,i)}function rK(e,t,n,i,r,o){let s;i.mode===re.SCENE3D?(s=e._baseVolume,e._boundingVolumeDirty=!0):s=e._baseVolume2D;let a=[];for(let c=0;c<n;++c){let u=t[c],f=u.position,d=Fr._computeActualPosition(u,f,i,r);l(d)&&(u._setActualPosition(d),o?a.push(d):Qhe(s,d))}o&&ue.fromPoints(a,s)}function f7e(e,t){let n=t.mode,i=e._billboards,r=e._billboardsToUpdate,o=e._modelMatrix;e._createVertexArray||e._mode!==n||n!==re.SCENE3D&&!M.equals(o,e.modelMatrix)?(e._mode=n,M.clone(e.modelMatrix,o),e._createVertexArray=!0,(n===re.SCENE3D||n===re.SCENE2D||n===re.COLUMBUS_VIEW)&&rK(e,i,i.length,t,o,!0)):n===re.MORPHING?rK(e,i,i.length,t,o,!0):(n===re.SCENE2D||n===re.COLUMBUS_VIEW)&&rK(e,r,e._billboardsToUpdateIndex,t,o,!1)}function d7e(e,t,n){let i=1;(!e._allSizedInMeters||e._maxPixelOffset!==0)&&(i=t.camera.getPixelSize(n,t.context.drawingBufferWidth,t.context.drawingBufferHeight));let r=i*e._maxScale*e._maxSize*2;e._allHorizontalCenter&&e._allVerticalCenter&&(r*=.5);let o=i*e._maxPixelOffset+e._maxEyeOffset;n.radius+=r+o}function h7e(e,t){let i=t.createViewportQuadCommand(`uniform sampler2D billboard_texture; +in vec2 v_textureCoordinates; void main() { - tile_color(vec4(1.0)); - tile_featureSt = computeSt(${t}); -}`,`${o} -${AWe(i)}${s}`}};function rme(e,t){return e=Xe.replaceMain(e,"tile_main"),t?`${e}uniform float tile_colorBlend; -void tile_color(vec4 tile_featureColor) -{ - tile_main(); - tile_featureColor = czm_gammaCorrect(tile_featureColor); - out_FragColor.a *= tile_featureColor.a; - float highlight = ceil(tile_colorBlend); - out_FragColor.rgb *= mix(tile_featureColor.rgb, vec3(1.0), highlight); -} -`:`${e}void tile_color(vec4 tile_featureColor) -{ - tile_main(); -} -`}function bWe(e,t){let n=`texture(${t}`,i=0,r=e.indexOf(n,i),o;for(;r>-1;){let s=0;for(let u=r;u<e.length;++u){let f=e.charAt(u);if(f==="(")++s;else if(f===")"&&(--s,s===0)){o=u+1;break}}let c=`tile_diffuse_final(${e.slice(r,o)}, tile_diffuse)`;e=e.slice(0,r)+c+e.slice(o),i=r+c.length,r=e.indexOf(n,i)}return e}function sme(e,t,n){if(!l(t))return rme(e,n);let i=new RegExp(`(uniform|attribute|in)\\s+(vec[34]|sampler2D)\\s+${t};`),r=e.match(i);if(!l(r))return rme(e,n);let o=r[0],s=r[2];e=Xe.replaceMain(e,"tile_main"),e=e.replace(o,"");let a=`bool isWhite(vec3 color) -{ - return all(greaterThan(color, vec3(1.0 - czm_epsilon3))); -} -vec4 tile_diffuse_final(vec4 sourceDiffuse, vec4 tileDiffuse) -{ - vec4 blendDiffuse = mix(sourceDiffuse, tileDiffuse, tile_colorBlend); - vec4 diffuse = isWhite(tileDiffuse.rgb) ? sourceDiffuse : blendDiffuse; - return vec4(diffuse.rgb, sourceDiffuse.a); + out_FragColor = texture(billboard_texture, v_textureCoordinates); } -`,c=` tile_featureColor = czm_gammaCorrect(tile_featureColor); - out_FragColor.a *= tile_featureColor.a; - float highlight = ceil(tile_colorBlend); - out_FragColor.rgb *= mix(tile_featureColor.rgb, vec3(1.0), highlight); -`,u;if(s==="vec3"||s==="vec4"){let f=s==="vec3"?`vec4(${t}, 1.0)`:t,d=s==="vec3"?"tile_diffuse.xyz":"tile_diffuse";i=new RegExp(t,"g"),e=e.replace(i,d),u=` vec4 source = ${f}; - tile_diffuse = tile_diffuse_final(source, tile_featureColor); - tile_main(); -`}else s==="sampler2D"&&(e=bWe(e,t),u=` tile_diffuse = tile_featureColor; - tile_main(); -`);return e=`uniform float tile_colorBlend; -vec4 tile_diffuse = vec4(1.0); -${a}${o} -${e} -void tile_color(vec4 tile_featureColor) -{ -${u}`,n&&(e+=c),e+=`} -`,e}jr.prototype.getFragmentShaderCallback=function(e,t,n){if(this.featuresLength!==0)return function(i){return i=sme(i,t,!0),Ut.maximumVertexTextureImageUnits>0?(i+=`uniform sampler2D tile_pickTexture; -in vec2 tile_featureSt; -in vec4 tile_featureColor; -void main() -{ - tile_color(tile_featureColor); -`,n&&(i+=` out_FragColor.rgb *= out_FragColor.a; -`),i+="}"):(e&&(i+=`uniform bool tile_translucentCommand; -`),i+=`uniform sampler2D tile_pickTexture; -uniform sampler2D tile_batchTexture; -in vec2 tile_featureSt; -void main() -{ - vec4 featureProperties = texture(tile_batchTexture, tile_featureSt); - if (featureProperties.a == 0.0) { - discard; - } -`,e&&(i+=` bool isStyleTranslucent = (featureProperties.a != 1.0); - if (czm_pass == czm_passTranslucent) - { - if (!isStyleTranslucent && !tile_translucentCommand) - { - discard; - } - } - else - { - if (isStyleTranslucent) - { - discard; - } - } -`),i+=` tile_color(featureProperties); -`,n&&(i+=` out_FragColor.rgb *= out_FragColor.a; -`),i+=`} -`),i}};function xWe(e){let t=e._content.tileset,n=t.colorBlendMode,i=t.colorBlendAmount;if(n===df.HIGHLIGHT)return 0;if(n===df.REPLACE)return 1;if(n===df.MIX)return P.clamp(i,P.EPSILON4,1)}jr.prototype.getUniformMapCallback=function(){if(this.featuresLength===0)return;let e=this;return function(t){return Mt(t,{tile_batchTexture:function(){return e._batchTexture.batchTexture??e._batchTexture.defaultTexture},tile_textureDimensions:function(){return e._batchTexture.textureDimensions},tile_textureStep:function(){return e._batchTexture.textureStep},tile_colorBlend:function(){return xWe(e)},tile_pickTexture:function(){return e._batchTexture.pickTexture}})}};jr.prototype.getPickId=function(){return"texture(tile_pickTexture, tile_featureSt)"};var ty={ALL_OPAQUE:0,ALL_TRANSLUCENT:1,OPAQUE_AND_TRANSLUCENT:2};jr.prototype.addDerivedCommands=function(e,t){let n=e.commandList,i=n.length,r=this._content._tile,o=r._finalResolution,s=r.tileset,a=s.isSkippingLevelOfDetail&&s.hasMixedContent&&e.context.stencilBuffer,c=TWe(this);for(let u=t;u<i;++u){let f=n[u];if(f.pass===Ie.COMPUTE)continue;let d=f.derivedCommands.tileset;(!l(d)||f.dirty)&&(d={},f.derivedCommands.tileset=d,d.originalCommand=EWe(f),f.dirty=!1);let p=d.originalCommand;c!==ty.ALL_OPAQUE&&f.pass!==Ie.TRANSLUCENT&&(l(d.translucent)||(d.translucent=CWe(p))),c!==ty.ALL_TRANSLUCENT&&f.pass!==Ie.TRANSLUCENT&&(l(d.opaque)||(d.opaque=vWe(p)),a&&(o||(l(d.zback)||(d.zback=wWe(e.context,p)),s._backfaceCommands.push(d.zback)),(!l(d.stencil)||r._selectionDepth!==PWe(d.stencil))&&(f.renderState.depthMask?d.stencil=IWe(p,r._selectionDepth):d.stencil=d.opaque)));let g=a?d.stencil:d.opaque,m=d.translucent;f.pass!==Ie.TRANSLUCENT?(c===ty.ALL_OPAQUE&&(n[u]=g),c===ty.ALL_TRANSLUCENT&&(n[u]=m),c===ty.OPAQUE_AND_TRANSLUCENT&&(n[u]=g,n.push(m))):n[u]=p}};function TWe(e){let t=e._batchTexture.translucentFeaturesLength;return t===0?ty.ALL_OPAQUE:t===e.featuresLength?ty.ALL_TRANSLUCENT:ty.OPAQUE_AND_TRANSLUCENT}function EWe(e){let t=at.shallowClone(e),n=t.pass===Ie.TRANSLUCENT;return t.uniformMap=l(t.uniformMap)?t.uniformMap:{},t.uniformMap.tile_translucentCommand=function(){return n},t}function CWe(e){let t=at.shallowClone(e);return t.pass=Ie.TRANSLUCENT,t.renderState=DWe(e.renderState),t}function vWe(e){let t=at.shallowClone(e);return t.renderState=RWe(e.renderState),t}function SWe(e,t){let n=e.shaderCache.getDerivedShaderProgram(t,"zBackfaceLogDepth");if(!l(n)){let i=t.fragmentShaderSource.clone();i.defines=l(i.defines)?i.defines.slice(0):[],i.defines.push("POLYGON_OFFSET"),n=e.shaderCache.createDerivedShaderProgram(t,"zBackfaceLogDepth",{vertexShaderSource:t.vertexShaderSource,fragmentShaderSource:i,attributeLocations:t._attributeLocations})}return n}function wWe(e,t){let n=at.shallowClone(t),i=Ze(n.renderState,!0);i.cull.enabled=!0,i.cull.face=Gi.FRONT,i.colorMask={red:!1,green:!1,blue:!1,alpha:!1},i.polygonOffset={enabled:!0,factor:5,units:5},i.stencilTest=Xt.setCesium3DTileBit(),i.stencilMask=Xt.CESIUM_3D_TILE_MASK,n.renderState=Ge.fromCache(i),n.castShadows=!1,n.receiveShadows=!1,n.uniformMap=Ze(t.uniformMap);let r=new U(5,5);return n.uniformMap.u_polygonOffset=function(){return r},n.shaderProgram=SWe(e,t.shaderProgram),n}function IWe(e,t){let n=at.shallowClone(e),i=Ze(n.renderState,!0);return i.stencilTest.enabled=!0,i.stencilTest.mask=Xt.SKIP_LOD_MASK,i.stencilTest.reference=Xt.CESIUM_3D_TILE_MASK|t<<Xt.SKIP_LOD_BIT_SHIFT,i.stencilTest.frontFunction=ti.GREATER_OR_EQUAL,i.stencilTest.frontOperation.zPass=Rt.REPLACE,i.stencilTest.backFunction=ti.GREATER_OR_EQUAL,i.stencilTest.backOperation.zPass=Rt.REPLACE,i.stencilMask=Xt.CESIUM_3D_TILE_MASK|Xt.SKIP_LOD_MASK,n.renderState=Ge.fromCache(i),n}function PWe(e){return(e.renderState.stencilTest.reference&Xt.SKIP_LOD_MASK)>>>Xt.SKIP_LOD_BIT_SHIFT}function DWe(e){let t=Ze(e,!0);return t.cull.enabled=!1,t.depthTest.enabled=!0,t.depthMask=!1,t.blending=nn.ALPHA_BLEND,t.stencilTest=Xt.setCesium3DTileBit(),t.stencilMask=Xt.CESIUM_3D_TILE_MASK,Ge.fromCache(t)}function RWe(e){let t=Ze(e,!0);return t.stencilTest=Xt.setCesium3DTileBit(),t.stencilMask=Xt.CESIUM_3D_TILE_MASK,Ge.fromCache(t)}jr.prototype.update=function(e,t){this._batchTexture.update(e,t)};jr.prototype.isDestroyed=function(){return!1};jr.prototype.destroy=function(){return this._batchTexture=this._batchTexture&&this._batchTexture.destroy(),le(this)};var lp=jr;function OWe(e){this.offset=e.offset,this.count=e.count,this.color=e.color,this.batchIds=e.batchIds}var X0=OWe;var hK=class e{constructor(t,n){this._content=t,this._batchId=n,this._color=void 0}get show(){return this._content.batchTable.getShow(this._batchId)}set show(t){this._content.batchTable.setShow(this._batchId,t)}get color(){return l(this._color)||(this._color=new z),this._content.batchTable.getColor(this._batchId,this._color)}set color(t){this._content.batchTable.setColor(this._batchId,t)}get polylinePositions(){if(l(this._content.getPolylinePositions))return this._content.getPolylinePositions(this._batchId)}get content(){return this._content}get tileset(){return this._content.tileset}get primitive(){return this._content.tileset}get featureId(){return this._batchId}get pickId(){return this._content.batchTable.getPickColor(this._batchId)}hasProperty(t){return this._content.batchTable.hasProperty(this._batchId,t)}getPropertyIds(t){return this._content.batchTable.getPropertyIds(this._batchId,t)}getProperty(t){return this._content.batchTable.getProperty(this._batchId,t)}static getPropertyInherited(t,n,i,r=t.batchTable){if(l(r)){if(r.hasPropertyBySemantic(n,i))return r.getPropertyBySemantic(n,i);if(r.hasProperty(n,i))return r.getProperty(n,i)}let o=t.metadata;if(l(o)){if(o.hasPropertyBySemantic(i))return o.getPropertyBySemantic(i);if(o.hasProperty(i))return o.getProperty(i)}let s=t.tile,a=s.metadata;if(l(a)){if(a.hasPropertyBySemantic(i))return a.getPropertyBySemantic(i);if(a.hasProperty(i))return a.getProperty(i)}let c;if(l(s.implicitSubtree)&&(c=s.implicitSubtree.metadata),l(c)){if(c.hasPropertyBySemantic(i))return c.getPropertyBySemantic(i);if(c.hasProperty(i))return c.getProperty(i)}let u=l(t.group)?t.group.metadata:void 0;if(l(u)){if(u.hasPropertyBySemantic(i))return u.getPropertyBySemantic(i);if(u.hasProperty(i))return u.getProperty(i)}let f=t.tileset.metadata;if(l(f)){if(f.hasPropertyBySemantic(i))return f.getPropertyBySemantic(i);if(f.hasProperty(i))return f.getProperty(i)}}getPropertyInherited(t){return e.getPropertyInherited(this._content,this._batchId,t)}setProperty(t,n){this._content.batchTable.setProperty(this._batchId,t,n),this._content.featurePropertiesDirty=!0}isExactClass(t){return this._content.batchTable.isExactClass(this._batchId,t)}isClass(t){return this._content.batchTable.isClass(this._batchId,t)}getExactClassName(){return this._content.batchTable.getExactClassName(this._batchId)}},ua=hK;var mK=class{add(t,n,i){if(typeof arguments[0]!="string")for(let r in arguments[0])this.add(r,arguments[0][r],arguments[1]);else(Array.isArray(t)?t:[t]).forEach(function(r){this[r]=this[r]||[],n&&this[r][i?"unshift":"push"](n)},this)}run(t,n){this[t]=this[t]||[],this[t].forEach(function(i){i.call(n&&n.context?n.context:n,n)})}},pK=class{constructor(t){this.jsep=t,this.registered={}}register(...t){t.forEach(n=>{if(typeof n!="object"||!n.name||!n.init)throw new Error("Invalid JSEP plugin format");this.registered[n.name]||(n.init(this.jsep),this.registered[n.name]=n)})}},Tu=class e{static get version(){return"1.4.0"}static toString(){return"JavaScript Expression Parser (JSEP) v"+e.version}static addUnaryOp(t){return e.max_unop_len=Math.max(t.length,e.max_unop_len),e.unary_ops[t]=1,e}static addBinaryOp(t,n,i){return e.max_binop_len=Math.max(t.length,e.max_binop_len),e.binary_ops[t]=n,i?e.right_associative.add(t):e.right_associative.delete(t),e}static addIdentifierChar(t){return e.additional_identifier_chars.add(t),e}static addLiteral(t,n){return e.literals[t]=n,e}static removeUnaryOp(t){return delete e.unary_ops[t],t.length===e.max_unop_len&&(e.max_unop_len=e.getMaxKeyLen(e.unary_ops)),e}static removeAllUnaryOps(){return e.unary_ops={},e.max_unop_len=0,e}static removeIdentifierChar(t){return e.additional_identifier_chars.delete(t),e}static removeBinaryOp(t){return delete e.binary_ops[t],t.length===e.max_binop_len&&(e.max_binop_len=e.getMaxKeyLen(e.binary_ops)),e.right_associative.delete(t),e}static removeAllBinaryOps(){return e.binary_ops={},e.max_binop_len=0,e}static removeLiteral(t){return delete e.literals[t],e}static removeAllLiterals(){return e.literals={},e}get char(){return this.expr.charAt(this.index)}get code(){return this.expr.charCodeAt(this.index)}constructor(t){this.expr=t,this.index=0}static parse(t){return new e(t).parse()}static getMaxKeyLen(t){return Math.max(0,...Object.keys(t).map(n=>n.length))}static isDecimalDigit(t){return t>=48&&t<=57}static binaryPrecedence(t){return e.binary_ops[t]||0}static isIdentifierStart(t){return t>=65&&t<=90||t>=97&&t<=122||t>=128&&!e.binary_ops[String.fromCharCode(t)]||e.additional_identifier_chars.has(String.fromCharCode(t))}static isIdentifierPart(t){return e.isIdentifierStart(t)||e.isDecimalDigit(t)}throwError(t){let n=new Error(t+" at character "+this.index);throw n.index=this.index,n.description=t,n}runHook(t,n){if(e.hooks[t]){let i={context:this,node:n};return e.hooks.run(t,i),i.node}return n}searchHook(t){if(e.hooks[t]){let n={context:this};return e.hooks[t].find(function(i){return i.call(n.context,n),n.node}),n.node}}gobbleSpaces(){let t=this.code;for(;t===e.SPACE_CODE||t===e.TAB_CODE||t===e.LF_CODE||t===e.CR_CODE;)t=this.expr.charCodeAt(++this.index);this.runHook("gobble-spaces")}parse(){this.runHook("before-all");let t=this.gobbleExpressions(),n=t.length===1?t[0]:{type:e.COMPOUND,body:t};return this.runHook("after-all",n)}gobbleExpressions(t){let n=[],i,r;for(;this.index<this.expr.length;)if(i=this.code,i===e.SEMCOL_CODE||i===e.COMMA_CODE)this.index++;else if(r=this.gobbleExpression())n.push(r);else if(this.index<this.expr.length){if(i===t)break;this.throwError('Unexpected "'+this.char+'"')}return n}gobbleExpression(){let t=this.searchHook("gobble-expression")||this.gobbleBinaryExpression();return this.gobbleSpaces(),this.runHook("after-expression",t)}gobbleBinaryOp(){this.gobbleSpaces();let t=this.expr.substr(this.index,e.max_binop_len),n=t.length;for(;n>0;){if(e.binary_ops.hasOwnProperty(t)&&(!e.isIdentifierStart(this.code)||this.index+t.length<this.expr.length&&!e.isIdentifierPart(this.expr.charCodeAt(this.index+t.length))))return this.index+=n,t;t=t.substr(0,--n)}return!1}gobbleBinaryExpression(){let t,n,i,r,o,s,a,c,u;if(s=this.gobbleToken(),!s||(n=this.gobbleBinaryOp(),!n))return s;for(o={value:n,prec:e.binaryPrecedence(n),right_a:e.right_associative.has(n)},a=this.gobbleToken(),a||this.throwError("Expected expression after "+n),r=[s,o,a];n=this.gobbleBinaryOp();){if(i=e.binaryPrecedence(n),i===0){this.index-=n.length;break}o={value:n,prec:i,right_a:e.right_associative.has(n)},u=n;let f=d=>o.right_a&&d.right_a?i>d.prec:i<=d.prec;for(;r.length>2&&f(r[r.length-2]);)a=r.pop(),n=r.pop().value,s=r.pop(),t={type:e.BINARY_EXP,operator:n,left:s,right:a},r.push(t);t=this.gobbleToken(),t||this.throwError("Expected expression after "+u),r.push(o,t)}for(c=r.length-1,t=r[c];c>1;)t={type:e.BINARY_EXP,operator:r[c-1].value,left:r[c-2],right:t},c-=2;return t}gobbleToken(){let t,n,i,r;if(this.gobbleSpaces(),r=this.searchHook("gobble-token"),r)return this.runHook("after-token",r);if(t=this.code,e.isDecimalDigit(t)||t===e.PERIOD_CODE)return this.gobbleNumericLiteral();if(t===e.SQUOTE_CODE||t===e.DQUOTE_CODE)r=this.gobbleStringLiteral();else if(t===e.OBRACK_CODE)r=this.gobbleArray();else{for(n=this.expr.substr(this.index,e.max_unop_len),i=n.length;i>0;){if(e.unary_ops.hasOwnProperty(n)&&(!e.isIdentifierStart(this.code)||this.index+n.length<this.expr.length&&!e.isIdentifierPart(this.expr.charCodeAt(this.index+n.length)))){this.index+=i;let o=this.gobbleToken();return o||this.throwError("missing unaryOp argument"),this.runHook("after-token",{type:e.UNARY_EXP,operator:n,argument:o,prefix:!0})}n=n.substr(0,--i)}e.isIdentifierStart(t)?(r=this.gobbleIdentifier(),e.literals.hasOwnProperty(r.name)?r={type:e.LITERAL,value:e.literals[r.name],raw:r.name}:r.name===e.this_str&&(r={type:e.THIS_EXP})):t===e.OPAREN_CODE&&(r=this.gobbleGroup())}return r?(r=this.gobbleTokenProperty(r),this.runHook("after-token",r)):this.runHook("after-token",!1)}gobbleTokenProperty(t){this.gobbleSpaces();let n=this.code;for(;n===e.PERIOD_CODE||n===e.OBRACK_CODE||n===e.OPAREN_CODE||n===e.QUMARK_CODE;){let i;if(n===e.QUMARK_CODE){if(this.expr.charCodeAt(this.index+1)!==e.PERIOD_CODE)break;i=!0,this.index+=2,this.gobbleSpaces(),n=this.code}this.index++,n===e.OBRACK_CODE?(t={type:e.MEMBER_EXP,computed:!0,object:t,property:this.gobbleExpression()},t.property||this.throwError('Unexpected "'+this.char+'"'),this.gobbleSpaces(),n=this.code,n!==e.CBRACK_CODE&&this.throwError("Unclosed ["),this.index++):n===e.OPAREN_CODE?t={type:e.CALL_EXP,arguments:this.gobbleArguments(e.CPAREN_CODE),callee:t}:(n===e.PERIOD_CODE||i)&&(i&&this.index--,this.gobbleSpaces(),t={type:e.MEMBER_EXP,computed:!1,object:t,property:this.gobbleIdentifier()}),i&&(t.optional=!0),this.gobbleSpaces(),n=this.code}return t}gobbleNumericLiteral(){let t="",n,i;for(;e.isDecimalDigit(this.code);)t+=this.expr.charAt(this.index++);if(this.code===e.PERIOD_CODE)for(t+=this.expr.charAt(this.index++);e.isDecimalDigit(this.code);)t+=this.expr.charAt(this.index++);if(n=this.char,n==="e"||n==="E"){for(t+=this.expr.charAt(this.index++),n=this.char,(n==="+"||n==="-")&&(t+=this.expr.charAt(this.index++));e.isDecimalDigit(this.code);)t+=this.expr.charAt(this.index++);e.isDecimalDigit(this.expr.charCodeAt(this.index-1))||this.throwError("Expected exponent ("+t+this.char+")")}return i=this.code,e.isIdentifierStart(i)?this.throwError("Variable names cannot start with a number ("+t+this.char+")"):(i===e.PERIOD_CODE||t.length===1&&t.charCodeAt(0)===e.PERIOD_CODE)&&this.throwError("Unexpected period"),{type:e.LITERAL,value:parseFloat(t),raw:t}}gobbleStringLiteral(){let t="",n=this.index,i=this.expr.charAt(this.index++),r=!1;for(;this.index<this.expr.length;){let o=this.expr.charAt(this.index++);if(o===i){r=!0;break}else if(o==="\\")switch(o=this.expr.charAt(this.index++),o){case"n":t+=` -`;break;case"r":t+="\r";break;case"t":t+=" ";break;case"b":t+="\b";break;case"f":t+="\f";break;case"v":t+="\v";break;default:t+=o}else t+=o}return r||this.throwError('Unclosed quote after "'+t+'"'),{type:e.LITERAL,value:t,raw:this.expr.substring(n,this.index)}}gobbleIdentifier(){let t=this.code,n=this.index;for(e.isIdentifierStart(t)?this.index++:this.throwError("Unexpected "+this.char);this.index<this.expr.length&&(t=this.code,e.isIdentifierPart(t));)this.index++;return{type:e.IDENTIFIER,name:this.expr.slice(n,this.index)}}gobbleArguments(t){let n=[],i=!1,r=0;for(;this.index<this.expr.length;){this.gobbleSpaces();let o=this.code;if(o===t){i=!0,this.index++,t===e.CPAREN_CODE&&r&&r>=n.length&&this.throwError("Unexpected token "+String.fromCharCode(t));break}else if(o===e.COMMA_CODE){if(this.index++,r++,r!==n.length){if(t===e.CPAREN_CODE)this.throwError("Unexpected token ,");else if(t===e.CBRACK_CODE)for(let s=n.length;s<r;s++)n.push(null)}}else if(n.length!==r&&r!==0)this.throwError("Expected comma");else{let s=this.gobbleExpression();(!s||s.type===e.COMPOUND)&&this.throwError("Expected comma"),n.push(s)}}return i||this.throwError("Expected "+String.fromCharCode(t)),n}gobbleGroup(){this.index++;let t=this.gobbleExpressions(e.CPAREN_CODE);if(this.code===e.CPAREN_CODE)return this.index++,t.length===1?t[0]:t.length?{type:e.SEQUENCE_EXP,expressions:t}:!1;this.throwError("Unclosed (")}gobbleArray(){return this.index++,{type:e.ARRAY_EXP,elements:this.gobbleArguments(e.CBRACK_CODE)}}},MWe=new mK;Object.assign(Tu,{hooks:MWe,plugins:new pK(Tu),COMPOUND:"Compound",SEQUENCE_EXP:"SequenceExpression",IDENTIFIER:"Identifier",MEMBER_EXP:"MemberExpression",LITERAL:"Literal",THIS_EXP:"ThisExpression",CALL_EXP:"CallExpression",UNARY_EXP:"UnaryExpression",BINARY_EXP:"BinaryExpression",ARRAY_EXP:"ArrayExpression",TAB_CODE:9,LF_CODE:10,CR_CODE:13,SPACE_CODE:32,PERIOD_CODE:46,COMMA_CODE:44,SQUOTE_CODE:39,DQUOTE_CODE:34,OPAREN_CODE:40,CPAREN_CODE:41,OBRACK_CODE:91,CBRACK_CODE:93,QUMARK_CODE:63,SEMCOL_CODE:59,COLON_CODE:58,unary_ops:{"-":1,"!":1,"~":1,"+":1},binary_ops:{"||":1,"??":1,"&&":2,"|":3,"^":4,"&":5,"==":6,"!=":6,"===":6,"!==":6,"<":7,">":7,"<=":7,">=":7,"<<":8,">>":8,">>>":8,"+":9,"-":9,"*":10,"/":10,"%":10,"**":11},right_associative:new Set(["**"]),additional_identifier_chars:new Set(["$","_"]),literals:{true:!0,false:!1,null:null},this_str:"this"});Tu.max_unop_len=Tu.getMaxKeyLen(Tu.unary_ops);Tu.max_binop_len=Tu.getMaxKeyLen(Tu.binary_ops);var ny=e=>new Tu(e).parse(),NWe=Object.getOwnPropertyNames(class{});Object.getOwnPropertyNames(Tu).filter(e=>!NWe.includes(e)&&ny[e]===void 0).forEach(e=>{ny[e]=Tu[e]});ny.Jsep=Tu;var LWe="ConditionalExpression",FWe={name:"ternary",init(e){e.hooks.add("after-expression",function(n){if(n.node&&this.code===e.QUMARK_CODE){this.index++;let i=n.node,r=this.gobbleExpression();if(r||this.throwError("Expected expression"),this.gobbleSpaces(),this.code===e.COLON_CODE){this.index++;let o=this.gobbleExpression();if(o||this.throwError("Expected expression"),n.node={type:LWe,test:i,consequent:r,alternate:o},i.operator&&e.binary_ops[i.operator]<=.9){let s=i;for(;s.right.operator&&e.binary_ops[s.right.operator]<=.9;)s=s.right;n.node.test=s.right,s.right=n.node,n.node=i}}else this.throwError("Expected :")}})}};ny.plugins.register(FWe);var ame={VARIABLE:0,UNARY:1,BINARY:2,TERNARY:3,CONDITIONAL:4,MEMBER:5,FUNCTION_CALL:6,ARRAY:7,REGEX:8,VARIABLE_IN_STRING:9,LITERAL_NULL:10,LITERAL_BOOLEAN:11,LITERAL_NUMBER:12,LITERAL_STRING:13,LITERAL_COLOR:14,LITERAL_VECTOR:15,LITERAL_REGEX:16,LITERAL_UNDEFINED:17,BUILTIN_VARIABLE:18};Object.freeze(ame);var Nt=ame;function Ch(e,t){this._expression=e,e=KWe(e,t),e=JWe($We(e)),ny.addBinaryOp("=~",0),ny.addBinaryOp("!~",0);let n;try{n=ny(e)}catch(i){throw new oe(i)}this._runtimeAst=Yi(this,n)}Object.defineProperties(Ch.prototype,{expression:{get:function(){return this._expression}}});var Bn={arrayIndex:0,arrayArray:[[]],cartesian2Index:0,cartesian3Index:0,cartesian4Index:0,cartesian2Array:[new U],cartesian3Array:[new h],cartesian4Array:[new se],reset:function(){this.arrayIndex=0,this.cartesian2Index=0,this.cartesian3Index=0,this.cartesian4Index=0},getArray:function(){this.arrayIndex>=this.arrayArray.length&&this.arrayArray.push([]);let e=this.arrayArray[this.arrayIndex++];return e.length=0,e},getCartesian2:function(){return this.cartesian2Index>=this.cartesian2Array.length&&this.cartesian2Array.push(new U),this.cartesian2Array[this.cartesian2Index++]},getCartesian3:function(){return this.cartesian3Index>=this.cartesian3Array.length&&this.cartesian3Array.push(new h),this.cartesian3Array[this.cartesian3Index++]},getCartesian4:function(){return this.cartesian4Index>=this.cartesian4Array.length&&this.cartesian4Array.push(new se),this.cartesian4Array[this.cartesian4Index++]}};Ch.prototype.evaluate=function(e,t){Bn.reset();let n=this._runtimeAst.evaluate(e);return t instanceof z&&n instanceof se?z.fromCartesian4(n,t):n instanceof U||n instanceof h||n instanceof se?n.clone(t):n};Ch.prototype.evaluateColor=function(e,t){Bn.reset();let n=this._runtimeAst.evaluate(e);return z.fromCartesian4(n,t)};Ch.prototype.getShaderFunction=function(e,t,n,i){let r=this.getShaderExpression(t,n);return r=`${i} ${e} +`,{uniformMap:{billboard_texture:function(){return e.textureAtlas.texture}}});return i.pass=Ie.OVERLAY,i}var m7e=[];ld.prototype.update=function(e){if(cK(this),!this.show)return;let t=e.context;if(!t.instancedArrays||!(Ut.maximumVertexTextureImageUnits>0))throw new pe("Beginning in CesiumJS 1.140, billboards and labels require device support for WebGL 2, or WebGL 1 with ANGLE_instanced_arrays and MAX_VERTEX_TEXTURE_IMAGE_UNITS > 0. For more information or to share feedback, see: https://github.com/CesiumGS/cesium/issues/13053");let n=this._billboards,i=n.length,r=!0;for(let I=0;I<i;++I){let R=n[I];l(R.loadError)&&(console.error(`Error loading image for billboard: ${R.loadError}`),R.image=void 0),R.textureDirty&&this._updateBillboard(R,Bb),R.show&&(r=r&&R.ready)}let o=this._textureAtlas;if(e.afterRender.push(()=>{if(!this.isDestroyed())return o.update(e.context)}),!l(o.texture))return;f7e(this,e),n=this._billboards,i=n.length;let s=this._billboardsToUpdate,a=this._billboardsToUpdateIndex,c=this._propertiesChanged,u=o.guid,f=this._createVertexArray||this._textureAtlasGUID!==u;this._textureAtlasGUID=u;let d,p=e.passes,g=p.pick;if(f||!g&&this.computeNewBuffersUsage()){this._createVertexArray=!1;for(let I=0;I<aK;++I)c[I]=0;if(this._vaf=this._vaf&&this._vaf.destroy(),i>0){this._vaf=r7e(t,i,this._buffersUsage,this._batchTable,this._sdf),d=this._vaf.writers;for(let I=0;I<i;++I){let R=this._billboards[I];R._dirty=!1,R.textureDirty=!1,u7e(this,e,d,R)}this._vaf.commit(jhe(t))}this._billboardsToUpdateIndex=0}else if(a>0){let I=m7e;I.length=0,(c[PP]||c[Q9e]||c[Z9e])&&I.push(eme),(c[Bb]||c[Hhe]||c[$9e]||c[J9e]||c[K9e])&&(I.push(nme),I.push(sK)),(c[Bb]||c[e7e]||c[Yhe])&&(I.push(ime),I.push(oK)),(c[Bb]||c[Whe])&&I.push(oK),(c[Bb]||c[Ghe])&&I.push(sK),c[qhe]&&I.push(rme),c[Xhe]&&I.push(ome),(c[Khe]||c[t7e]||c[Bb]||c[PP])&&I.push(sme),(c[Bb]||c[PP])&&I.push(ame),c[$he]&&I.push(cme),c[Jhe]&&I.push(lme);let R=I.length;if(d=this._vaf.writers,a/i>.1){for(let O=0;O<a;++O){let L=s[O];L._dirty=!1,L.textureDirty=!1;for(let _=0;_<R;++_)I[_](this,e,d,L)}this._vaf.commit(jhe(t))}else{for(let O=0;O<a;++O){let L=s[O];L._dirty=!1,L.textureDirty=!1;for(let _=0;_<R;++_)I[_](this,e,d,L);this._vaf.subCommit(L._index,1)}this._vaf.endSubCommits()}this._billboardsToUpdateIndex=0}if(a>i*1.5&&(s.length=i),!l(this._vaf)||!l(this._vaf.va))return;this._boundingVolumeDirty&&(this._boundingVolumeDirty=!1,ue.transform(this._baseVolume,this.modelMatrix,this._baseVolumeWC));let m,y=M.IDENTITY;e.mode===re.SCENE3D?(y=this.modelMatrix,m=ue.clone(this._baseVolumeWC,this._boundingVolume)):m=ue.clone(this._baseVolume2D,this._boundingVolume),d7e(this,e,m);let A=this._blendOption!==this.blendOption;if(this._blendOption=this.blendOption,A){this._blendOption===Bi.OPAQUE||this._blendOption===Bi.OPAQUE_AND_TRANSLUCENT?this._rsOpaque=Ge.fromCache({depthTest:{enabled:!0,func:te.LESS},depthMask:!0}):this._rsOpaque=void 0;let I=this._blendOption===Bi.TRANSLUCENT;this._blendOption===Bi.TRANSLUCENT||this._blendOption===Bi.OPAQUE_AND_TRANSLUCENT?this._rsTranslucent=Ge.fromCache({depthTest:{enabled:!0,func:I?te.LEQUAL:te.LESS},depthMask:I,blending:nn.ALPHA_BLEND}):this._rsTranslucent=void 0}this._shaderDisableDepthDistance=this._shaderDisableDepthDistance||e.minimumDisableDepthTestDistance!==0;let b,x,T,E,v;if(A||this._shaderRotation!==this._compiledShaderRotation||this._shaderAlignedAxis!==this._compiledShaderAlignedAxis||this._shaderScaleByDistance!==this._compiledShaderScaleByDistance||this._shaderTranslucencyByDistance!==this._compiledShaderTranslucencyByDistance||this._shaderPixelOffsetScaleByDistance!==this._compiledShaderPixelOffsetScaleByDistance||this._shaderDistanceDisplayCondition!==this._compiledShaderDistanceDisplayCondition||this._shaderDisableDepthDistance!==this._compiledShaderDisableDepthDistance||this._shaderClampToGround!==this._compiledShaderClampToGround||this._sdf!==this._compiledSDF){b=m2,x=h2,v=["INSTANCED"],l(this._batchTable)&&(v.push("VECTOR_TILE"),b=this._batchTable.getVertexShaderCallback(!1,"a_batchId",void 0)(b),x=this._batchTable.getFragmentShaderCallback(!1,void 0)(x)),T=new Xe({defines:v,sources:[b]}),this._shaderRotation&&T.defines.push("ROTATION"),this._shaderAlignedAxis&&T.defines.push("ALIGNED_AXIS"),this._shaderScaleByDistance&&T.defines.push("EYE_DISTANCE_SCALING"),this._shaderTranslucencyByDistance&&T.defines.push("EYE_DISTANCE_TRANSLUCENCY"),this._shaderPixelOffsetScaleByDistance&&T.defines.push("EYE_DISTANCE_PIXEL_OFFSET"),this._shaderDistanceDisplayCondition&&T.defines.push("DISTANCE_DISPLAY_CONDITION"),this._shaderDisableDepthDistance&&T.defines.push("DISABLE_DEPTH_DISTANCE"),this._shaderClampToGround&&T.defines.push("VS_THREE_POINT_DEPTH_CHECK");let I=1-$a.CUTOFF;this._sdf&&T.defines.push("SDF");let R=l(this._batchTable)?"VECTOR_TILE":"";this._blendOption===Bi.OPAQUE_AND_TRANSLUCENT&&(E=new Xe({defines:["OPAQUE",R],sources:[x]}),this._shaderClampToGround&&E.defines.push("VS_THREE_POINT_DEPTH_CHECK"),this._sdf&&(E.defines.push("SDF"),E.defines.push(`SDF_EDGE ${I}`)),this._sp=Qt.replaceCache({context:t,shaderProgram:this._sp,vertexShaderSource:T,fragmentShaderSource:E,attributeLocations:Br}),E=new Xe({defines:["TRANSLUCENT",R],sources:[x]}),this._shaderClampToGround&&E.defines.push("VS_THREE_POINT_DEPTH_CHECK"),this._sdf&&(E.defines.push("SDF"),E.defines.push(`SDF_EDGE ${I}`)),this._spTranslucent=Qt.replaceCache({context:t,shaderProgram:this._spTranslucent,vertexShaderSource:T,fragmentShaderSource:E,attributeLocations:Br})),this._blendOption===Bi.OPAQUE&&(E=new Xe({defines:[R],sources:[x]}),this._shaderClampToGround&&E.defines.push("VS_THREE_POINT_DEPTH_CHECK"),this._sdf&&(E.defines.push("SDF"),E.defines.push(`SDF_EDGE ${I}`)),this._sp=Qt.replaceCache({context:t,shaderProgram:this._sp,vertexShaderSource:T,fragmentShaderSource:E,attributeLocations:Br})),this._blendOption===Bi.TRANSLUCENT&&(E=new Xe({defines:[R],sources:[x]}),this._shaderClampToGround&&E.defines.push("VS_THREE_POINT_DEPTH_CHECK"),this._sdf&&(E.defines.push("SDF"),E.defines.push(`SDF_EDGE ${I}`)),this._spTranslucent=Qt.replaceCache({context:t,shaderProgram:this._spTranslucent,vertexShaderSource:T,fragmentShaderSource:E,attributeLocations:Br})),this._compiledShaderRotation=this._shaderRotation,this._compiledShaderAlignedAxis=this._shaderAlignedAxis,this._compiledShaderScaleByDistance=this._shaderScaleByDistance,this._compiledShaderTranslucencyByDistance=this._shaderTranslucencyByDistance,this._compiledShaderPixelOffsetScaleByDistance=this._shaderPixelOffsetScaleByDistance,this._compiledShaderDistanceDisplayCondition=this._shaderDistanceDisplayCondition,this._compiledShaderDisableDepthDistance=this._shaderDisableDepthDistance,this._compiledShaderClampToGround=this._shaderClampToGround,this._compiledSDF=this._sdf}let S=e.commandList;if(p.render||p.pick){let I=this._colorCommands,R=this._blendOption===Bi.OPAQUE,O=this._blendOption===Bi.OPAQUE_AND_TRANSLUCENT,L=this._vaf.va,_=L.length,C=this._uniforms,w;l(this._batchTable)?(C=this._batchTable.getUniformMapCallback()(C),w=this._batchTable.getPickId()):w="v_pickColor",I.length=_;let D=O?_*2:_;for(let N=0;N<D;++N){let F=I[N];l(F)||(F=I[N]=new at);let V=R||O&&N%2===0;F.pass=V||!O?Ie.OPAQUE:Ie.TRANSLUCENT,F.owner=this;let B=O?Math.floor(N/2):N;F.boundingVolume=m,F.modelMatrix=y,F.count=L[B].indicesCount,F.shaderProgram=V?this._sp:this._spTranslucent,F.uniformMap=C,F.vertexArray=L[B].va,F.renderState=V?this._rsOpaque:this._rsTranslucent,F.debugShowBoundingVolume=this.debugShowBoundingVolume,F.pickId=w,F.count=6,F.instanceCount=i,S.push(F)}this.debugShowTextureAtlas&&(l(this.debugCommand)||(this.debugCommand=h7e(this,e.context)),S.push(this.debugCommand))}this._allBillboardsReady=r};ld.prototype.isDestroyed=function(){return!1};ld.prototype.destroy=function(){return l(this._removeCallbackFunc)&&(this._removeCallbackFunc(),this._removeCallbackFunc=void 0),this._textureAtlas=this._destroyTextureAtlas&&this._textureAtlas&&this._textureAtlas.destroy(),this._sp=this._sp&&this._sp.destroy(),this._spTranslucent=this._spTranslucent&&this._spTranslucent.destroy(),this._vaf=this._vaf&&this._vaf.destroy(),Zhe(this._billboards),le(this)};var ud=ld;var ume={FILL:0,OUTLINE:1,FILL_AND_OUTLINE:2};Object.freeze(ume);var Co=ume;var fme={},dme=0,p7e=256,g7e=new z(.165,.165,.165,.8),_7e=new U(7,5),Ks=Object.freeze({LTR:0,RTL:1,WEAK:2,BRACKETS:3});function Ub(e){!e._rebindAllGlyphs&&!e._repositionAllGlyphs&&e._labelCollection._labelsToUpdate.push(e),e._rebindAllGlyphs=!0}function DP(e){!e._rebindAllGlyphs&&!e._repositionAllGlyphs&&e._labelCollection._labelsToUpdate.push(e),e._repositionAllGlyphs=!0}function RP(e,t){return document.defaultView.getComputedStyle(e,null).getPropertyValue(t)}function mme(e){let t=fme[e._font];if(!l(t)){let n=document.createElement("div");n.style.position="absolute",n.style.opacity=0,n.style.font=e._font,document.body.appendChild(n);let i=parseFloat(RP(n,"line-height"));isNaN(i)&&(i=void 0),t={family:RP(n,"font-family"),size:RP(n,"font-size").replace("px",""),style:RP(n,"font-style"),weight:RP(n,"font-weight"),lineHeight:i},document.body.removeChild(n),dme<p7e&&(fme[e._font]=t,dme++)}e._fontFamily=t.family,e._fontSize=t.size,e._fontStyle=t.style,e._fontWeight=t.weight,e._lineHeight=t.lineHeight}function Ch(e,t){e=e??H.EMPTY_OBJECT;let n=e.translucencyByDistance,i=e.pixelOffsetScaleByDistance,r=e.scaleByDistance,o=e.distanceDisplayCondition;l(n)&&(n=qt.clone(n)),l(i)&&(i=qt.clone(i)),l(r)&&(r=qt.clone(r)),l(o)&&(o=Gt.clone(o)),this._renderedText=void 0,this._text=void 0,this._show=e.show??!0,this._font=e.font??"30px sans-serif",this._fillColor=z.clone(e.fillColor??z.WHITE),this._outlineColor=z.clone(e.outlineColor??z.BLACK),this._outlineWidth=e.outlineWidth??1,this._showBackground=e.showBackground??!1,this._backgroundColor=z.clone(e.backgroundColor??g7e),this._backgroundPadding=U.clone(e.backgroundPadding??_7e),this._style=e.style??Co.FILL,this._verticalOrigin=e.verticalOrigin??qn.BASELINE,this._horizontalOrigin=e.horizontalOrigin??Gi.LEFT,this._pixelOffset=U.clone(e.pixelOffset??U.ZERO),this._eyeOffset=h.clone(e.eyeOffset??h.ZERO),this._position=h.clone(e.position??h.ZERO),this._scale=e.scale??1,this._id=e.id,this._translucencyByDistance=n,this._pixelOffsetScaleByDistance=i,this._scaleByDistance=r,this._heightReference=e.heightReference??We.NONE,this._distanceDisplayCondition=o,this._disableDepthTestDistance=e.disableDepthTestDistance,this._labelCollection=t,this._glyphs=[],this._backgroundBillboard=void 0,this._batchIndex=void 0,this._rebindAllGlyphs=!0,this._repositionAllGlyphs=!0,this._actualClampedPosition=void 0,this._removeCallbackFunc=void 0,this._lastSurfaceHeight=void 0,this._lastSurfaceQueryFrame=-1,this._lastSurfaceQueryMissed=!1,this._clampedToSurface=!1,this._clampingCartesian=void 0,this._clampingHeight=0,this._clampingHeightValid=!1,this._mode=void 0,this._clusterShow=!0,this.text=e.text??"",this._relativeSize=1,mme(this),this._updateClamping()}Object.defineProperties(Ch.prototype,{show:{get:function(){return this._show},set:function(e){if(this._show!==e){this._show=e;let t=this._glyphs;for(let i=0,r=t.length;i<r;i++){let o=t[i].billboard;l(o)&&(o.show=e)}let n=this._backgroundBillboard;l(n)&&(n.show=e)}}},position:{get:function(){return this._position},set:function(e){let t=this._position;if(!tK(t,e)){Fb(e,t);let n=this._glyphs;for(let r=0,o=n.length;r<o;r++){let s=n[r].billboard;l(s)&&(s.position=e)}let i=this._backgroundBillboard;l(i)&&(i.position=e),this._updateClamping()}}},heightReference:{get:function(){return this._heightReference},set:function(e){if(e!==this._heightReference){this._heightReference=e;let t=this._glyphs;for(let i=0,r=t.length;i<r;i++){let o=t[i].billboard;l(o)&&(o.heightReference=e)}let n=this._backgroundBillboard;l(n)&&(n.heightReference=e),DP(this),this._updateClamping()}}},text:{get:function(){return this._text},set:function(e){if(this._text!==e){this._text=e;let t=Ch.filterUnsupportedCharacters(e);this._renderedText=Ch.enableRightToLeftDetection?E7e(t):t,Ub(this)}}},font:{get:function(){return this._font},set:function(e){this._font!==e&&(this._font=e,Ub(this),mme(this))}},fillColor:{get:function(){return this._fillColor},set:function(e){let t=this._fillColor;z.equals(t,e)||(z.clone(e,t),Ub(this))}},outlineColor:{get:function(){return this._outlineColor},set:function(e){let t=this._outlineColor;z.equals(t,e)||(z.clone(e,t),Ub(this))}},outlineWidth:{get:function(){return this._outlineWidth},set:function(e){this._outlineWidth!==e&&(this._outlineWidth=e,Ub(this))}},showBackground:{get:function(){return this._showBackground},set:function(e){this._showBackground!==e&&(this._showBackground=e,Ub(this))}},backgroundColor:{get:function(){return this._backgroundColor},set:function(e){let t=this._backgroundColor;if(!z.equals(t,e)){z.clone(e,t);let n=this._backgroundBillboard;l(n)&&(n.color=t)}}},backgroundPadding:{get:function(){return this._backgroundPadding},set:function(e){let t=this._backgroundPadding;U.equals(t,e)||(U.clone(e,t),DP(this))}},style:{get:function(){return this._style},set:function(e){this._style!==e&&(this._style=e,Ub(this))}},pixelOffset:{get:function(){return this._pixelOffset},set:function(e){let t=this._pixelOffset;if(!U.equals(t,e)){U.clone(e,t);let n=this._glyphs;for(let r=0,o=n.length;r<o;r++){let s=n[r];l(s.billboard)&&(s.billboard.pixelOffset=e)}let i=this._backgroundBillboard;l(i)&&(i.pixelOffset=e)}}},translucencyByDistance:{get:function(){return this._translucencyByDistance},set:function(e){let t=this._translucencyByDistance;if(!qt.equals(t,e)){this._translucencyByDistance=qt.clone(e,t);let n=this._glyphs;for(let r=0,o=n.length;r<o;r++){let s=n[r];l(s.billboard)&&(s.billboard.translucencyByDistance=e)}let i=this._backgroundBillboard;l(i)&&(i.translucencyByDistance=e)}}},pixelOffsetScaleByDistance:{get:function(){return this._pixelOffsetScaleByDistance},set:function(e){let t=this._pixelOffsetScaleByDistance;if(!qt.equals(t,e)){this._pixelOffsetScaleByDistance=qt.clone(e,t);let n=this._glyphs;for(let r=0,o=n.length;r<o;r++){let s=n[r];l(s.billboard)&&(s.billboard.pixelOffsetScaleByDistance=e)}let i=this._backgroundBillboard;l(i)&&(i.pixelOffsetScaleByDistance=e)}}},scaleByDistance:{get:function(){return this._scaleByDistance},set:function(e){let t=this._scaleByDistance;if(!qt.equals(t,e)){this._scaleByDistance=qt.clone(e,t);let n=this._glyphs;for(let r=0,o=n.length;r<o;r++){let s=n[r];l(s.billboard)&&(s.billboard.scaleByDistance=e)}let i=this._backgroundBillboard;l(i)&&(i.scaleByDistance=e)}}},eyeOffset:{get:function(){return this._eyeOffset},set:function(e){let t=this._eyeOffset;if(!h.equals(t,e)){h.clone(e,t);let n=this._glyphs;for(let r=0,o=n.length;r<o;r++){let s=n[r];l(s.billboard)&&(s.billboard.eyeOffset=e)}let i=this._backgroundBillboard;l(i)&&(i.eyeOffset=e)}}},horizontalOrigin:{get:function(){return this._horizontalOrigin},set:function(e){this._horizontalOrigin!==e&&(this._horizontalOrigin=e,DP(this))}},verticalOrigin:{get:function(){return this._verticalOrigin},set:function(e){if(this._verticalOrigin!==e){this._verticalOrigin=e;let t=this._glyphs;for(let i=0,r=t.length;i<r;i++){let o=t[i];l(o.billboard)&&(o.billboard.verticalOrigin=e)}let n=this._backgroundBillboard;l(n)&&(n.verticalOrigin=e),DP(this)}}},scale:{get:function(){return this._scale},set:function(e){if(this._scale!==e){this._scale=e;let t=this._glyphs;for(let i=0,r=t.length;i<r;i++){let o=t[i];l(o.billboard)&&(o.billboard.scale=e*this._relativeSize)}let n=this._backgroundBillboard;l(n)&&(n.scale=e*this._relativeSize),DP(this)}}},totalScale:{get:function(){return this._scale*this._relativeSize}},distanceDisplayCondition:{get:function(){return this._distanceDisplayCondition},set:function(e){if(!Gt.equals(e,this._distanceDisplayCondition)){this._distanceDisplayCondition=Gt.clone(e,this._distanceDisplayCondition);let t=this._glyphs;for(let i=0,r=t.length;i<r;i++){let o=t[i];l(o.billboard)&&(o.billboard.distanceDisplayCondition=e)}let n=this._backgroundBillboard;l(n)&&(n.distanceDisplayCondition=e)}}},disableDepthTestDistance:{get:function(){return this._disableDepthTestDistance},set:function(e){if(this._disableDepthTestDistance!==e){this._disableDepthTestDistance=e;let t=this._glyphs;for(let i=0,r=t.length;i<r;i++){let o=t[i];l(o.billboard)&&(o.billboard.disableDepthTestDistance=e)}let n=this._backgroundBillboard;l(n)&&(n.disableDepthTestDistance=e)}}},id:{get:function(){return this._id},set:function(e){if(this._id!==e){this._id=e;let t=this._glyphs;for(let i=0,r=t.length;i<r;i++){let o=t[i];l(o.billboard)&&(o.billboard.id=e)}let n=this._backgroundBillboard;l(n)&&(n.id=e)}}},pickId:{get:function(){if(!(this._glyphs.length===0||!l(this._glyphs[0].billboard)))return this._glyphs[0].billboard.pickId}},_clampedPosition:{get:function(){return this._actualClampedPosition},set:function(e){this._actualClampedPosition=Fb(e,this._actualClampedPosition);let t=this._glyphs;for(let i=0,r=t.length;i<r;i++){let o=t[i];l(o.billboard)&&(o.billboard._clampedPosition=e)}let n=this._backgroundBillboard;l(n)&&(n._clampedPosition=e)}},clusterShow:{get:function(){return this._clusterShow},set:function(e){if(this._clusterShow!==e){this._clusterShow=e;let t=this._glyphs;for(let i=0,r=t.length;i<r;i++){let o=t[i];l(o.billboard)&&(o.billboard.clusterShow=e)}let n=this._backgroundBillboard;l(n)&&(n.clusterShow=e)}}},ready:{get:function(){if(this._rebindAllGlyphs||this._repositionAllGlyphs||l(this._backgroundBillboard)&&!this._backgroundBillboard.ready)return!1;let e=this._glyphs;for(let t=0,n=e.length;t<n;t++){let i=e[t];if(l(i.billboard)&&!i.billboard.ready)return!1}return!0}}});Ch.prototype._updateClamping=function(){Fr._updateClamping(this._labelCollection,this)};Ch.prototype.computeScreenSpacePosition=function(e,t){l(t)||(t=new U);let i=this._labelCollection.modelMatrix,r=l(this._actualClampedPosition)?this._actualClampedPosition:this._position;return Fr._computeScreenSpacePosition(i,r,this._eyeOffset,this._pixelOffset,e,t)};Ch.getScreenSpaceBoundingBox=function(e,t,n){let i,r,o,s,a=e.totalScale,c=e._backgroundBillboard;if(l(c))i=t.x+c._translate.x,r=t.y-c._translate.y,o=c.width*a,s=c.height*a,e.verticalOrigin===qn.BOTTOM||e.verticalOrigin===qn.BASELINE?r-=s:e.verticalOrigin===qn.CENTER&&(r-=s*.5);else{i=Number.POSITIVE_INFINITY,r=Number.POSITIVE_INFINITY;let u=0,f=0,d=e._glyphs,p=d.length;for(let g=0;g<p;++g){let m=d[g],y=m.billboard;if(!l(y))continue;let A=t.x+y._translate.x,b=t.y-y._translate.y,x=m.dimensions.width*a,T=m.dimensions.height*a;e.verticalOrigin===qn.BOTTOM||e.verticalOrigin===qn.BASELINE?b-=T:e.verticalOrigin===qn.CENTER&&(b-=T*.5),e._verticalOrigin===qn.TOP?b+=$a.PADDING*a:(e._verticalOrigin===qn.BOTTOM||e._verticalOrigin===qn.BASELINE)&&(b-=$a.PADDING*a),i=Math.min(i,A),r=Math.min(r,b),u=Math.max(u,A+x),f=Math.max(f,b+T)}o=u-i,s=f-r}return l(n)||(n=new et),n.x=i,n.y=r,n.width=o,n.height=s,n};Ch.filterUnsupportedCharacters=function(e){let t=new RegExp(/[\u0000-\u0008\u000E-\u001F\u00ad\u202a-\u206f\u200b-\u200f]/,"g");return e.replace(t,"")};Ch.prototype.equals=function(e){return this===e||l(e)&&this._show===e._show&&this._scale===e._scale&&this._outlineWidth===e._outlineWidth&&this._showBackground===e._showBackground&&this._style===e._style&&this._verticalOrigin===e._verticalOrigin&&this._horizontalOrigin===e._horizontalOrigin&&this._heightReference===e._heightReference&&this._renderedText===e._renderedText&&this._font===e._font&&h.equals(this._position,e._position)&&z.equals(this._fillColor,e._fillColor)&&z.equals(this._outlineColor,e._outlineColor)&&z.equals(this._backgroundColor,e._backgroundColor)&&U.equals(this._backgroundPadding,e._backgroundPadding)&&U.equals(this._pixelOffset,e._pixelOffset)&&h.equals(this._eyeOffset,e._eyeOffset)&&qt.equals(this._translucencyByDistance,e._translucencyByDistance)&&qt.equals(this._pixelOffsetScaleByDistance,e._pixelOffsetScaleByDistance)&&qt.equals(this._scaleByDistance,e._scaleByDistance)&&Gt.equals(this._distanceDisplayCondition,e._distanceDisplayCondition)&&this._disableDepthTestDistance===e._disableDepthTestDistance&&this._id===e._id};Ch.prototype.isDestroyed=function(){return!1};Ch.enableRightToLeftDetection=!1;function y7e(e,t){let n=/[a-zA-Z0-9]/,i=/[()[\]{}<>]/,r=[],o="",s=Ks.LTR,a="",c=e.length;for(let u=0;u<c;++u){let f=e.charAt(u);t.test(f)?a=Ks.RTL:n.test(f)?a=Ks.LTR:i.test(f)?a=Ks.BRACKETS:a=Ks.WEAK,u===0&&(s=a),s===a&&a!==Ks.BRACKETS?o+=f:(o!==""&&r.push({Type:s,Word:o}),s=a,o=f)}return r.push({Type:a,Word:o}),r}function A7e(e){return e.split("").reverse().join("")}function OP(e,t,n){return e.slice(0,t)+n+e.slice(t)}function b7e(e){switch(e){case"(":return")";case")":return"(";case"[":return"]";case"]":return"[";case"{":return"}";case"}":return"{";case"<":return">";case">":return"<"}}var x7e="\u05D0-\u05EA",T7e="\u0600-\u06FF\u0750-\u077F\u08A0-\u08FF",hme=new RegExp(`[${x7e}${T7e}]`);function E7e(e){let t=e.split(` +`),n="";for(let i=0;i<t.length;i++){let r=t[i],o=hme.test(r.charAt(0)),s=y7e(r,hme),a=0,c="";for(let u=0;u<s.length;++u){let f=s[u],d=f.Type===Ks.BRACKETS?b7e(f.Word):A7e(f.Word);o?f.Type===Ks.RTL?(c=d+c,a=0):f.Type===Ks.LTR?(c=OP(c,a,f.Word),a+=f.Word.length):(f.Type===Ks.WEAK||f.Type===Ks.BRACKETS)&&(f.Type===Ks.WEAK&&s[u-1].Type===Ks.BRACKETS?c=d+c:s[u-1].Type===Ks.RTL?(c=d+c,a=0):s.length>u+1?s[u+1].Type===Ks.RTL?(c=d+c,a=0):(c=OP(c,a,f.Word),a+=f.Word.length):c=OP(c,0,d)):f.Type===Ks.RTL?c=OP(c,a,d):f.Type===Ks.LTR?(c+=f.Word,a=c.length):(f.Type===Ks.WEAK||f.Type===Ks.BRACKETS)&&(u>0&&s[u-1].Type===Ks.RTL?s.length>u+1?s[u+1].Type===Ks.RTL?c=OP(c,a,d):(c+=f.Word,a=c.length):c+=f.Word:(c+=f.Word,a=c.length))}n+=c,i<t.length-1&&(n+=` +`)}return n}var zb=Ch;function C7e(e,t){let n=e.measureText(t);if(!/\S/.test(t))return{width:n.width,height:0,ascent:0,descent:0,minx:0};let r=Math.round(n.actualBoundingBoxAscent),o=Math.round(n.actualBoundingBoxDescent),s=Math.max(r+o,1);return{width:n.width,height:s,ascent:r,descent:o,minx:-Math.round(n.actualBoundingBoxLeft)}}var Vb;function v7e(e,t){if(e==="")return;t=t??H.EMPTY_OBJECT;let n=t.font??"10px sans-serif",i=t.stroke??!1,r=t.fill??!0,o=t.strokeWidth??1,s=t.backgroundColor??z.TRANSPARENT,a=t.padding??0,c=a*2,u=document.createElement("canvas");u.width=1,u.height=1,u.style.font=n;let f=u.getContext("2d",{willReadFrequently:!0});l(Vb)||(l(f.imageSmoothingEnabled)?Vb="imageSmoothingEnabled":l(f.mozImageSmoothingEnabled)?Vb="mozImageSmoothingEnabled":l(f.webkitImageSmoothingEnabled)?Vb="webkitImageSmoothingEnabled":l(f.msImageSmoothingEnabled)&&(Vb="msImageSmoothingEnabled")),f.font=n,f.lineJoin="round",f.lineWidth=o,f[Vb]=!1,u.style.visibility="hidden",document.body.appendChild(u);let d=C7e(f,e);u.dimensions=d,document.body.removeChild(u),u.style.visibility="";let p=!/\S/.test(e),g=i&&!p?Math.ceil(o/2):0,m=g*2,y=-d.minx+g,A=Math.ceil(d.width)+y+c+g,b=d.height+c+m,x=d.ascent+a+g;if(u.width=A,u.height=b,f.font=n,f.lineJoin="round",f.lineWidth=o,f[Vb]=!1,s!==z.TRANSPARENT&&(f.fillStyle=s.toCssColorString(),f.fillRect(0,0,u.width,u.height)),i){let T=t.strokeColor??z.BLACK;f.strokeStyle=T.toCssColorString(),f.strokeText(e,y+a,x)}if(r){let T=t.fillColor??z.WHITE;f.fillStyle=T.toCssColorString(),f.fillText(e,y+a,x)}return u}var rC=v7e;var Tme=js(yme(),1);var Eme=js(Ame(),1);function I7e(){this.dimensions=void 0,this.billboardTexture=void 0,this.billboard=void 0}var P7e=1.2,bme="ID_WHITE_PIXEL",uK=new U(4,4),D7e=new et(1,1,1,1);function R7e(e,t){let n=t._backgroundBillboardTexture;if(!n.hasImage){let r=document.createElement("canvas");r.width=uK.x,r.height=uK.y;let o=r.getContext("2d");o.fillStyle="#fff",o.fillRect(0,0,r.width,r.height),n.loadImage(bme,r),n.addImageSubRegion(bme,D7e)}let i=e.add({collection:t});return i.setImageTexture(n),i._positionFromParent=!0,i._labelTranslate=new U,i}var X0={};function O7e(e,t,n,i,r,o){return X0.font=t,X0.fillColor=n,X0.strokeColor=i,X0.strokeWidth=r,X0.padding=$a.PADDING,X0.fill=o===Co.FILL||o===Co.FILL_AND_OUTLINE,X0.stroke=o===Co.OUTLINE||o===Co.FILL_AND_OUTLINE,X0.backgroundColor=z.BLACK,rC(e,X0)}function fK(e,t){let n=t.billboard;l(n)&&(n.show=!1,n._clampedPosition=void 0,l(n._removeCallbackFunc)&&(n._removeCallbackFunc(),n._removeCallbackFunc=void 0),e._spareBillboards.push(n),t.billboard=void 0)}var M7e=new Eme.default,N7e=/\s/;function L7e(e,t){let n=t._renderedText,i=M7e.splitGraphemes(n),r=i.length,o=t._glyphs,s=o.length;if(t._relativeSize=t._fontSize/$a.FONT_SIZE,r<s)for(let p=r;p<s;++p)fK(e,o[p]);o.length=r;let a=t._backgroundBillboard,c=e._backgroundBillboardCollection;t._showBackground&&!l(a)&&(a=R7e(c,e),t._backgroundBillboard=a),F7e(c,t,a);let u=e._glyphBillboardCollection,f=u.billboardTextureCache,d=e._textDimensionsCache;for(let p=0;p<r;++p){let g=i[p],m=t._verticalOrigin,y=JSON.stringify([g,t._fontFamily,t._fontStyle,t._fontWeight,+m]),A=d[y],b=f.get(y);if(!l(b)||!l(A)){b=new Y_(u),f.set(y,b);let v=`${t._fontStyle} ${t._fontWeight} ${$a.FONT_SIZE}px ${t._fontFamily}`,S=O7e(g,v,z.WHITE,z.WHITE,0,Co.FILL);if(A=S.dimensions,d[y]=A,S.width>0&&S.height>0&&!N7e.test(g)){let I=(0,Tme.default)(S,{cutoff:$a.CUTOFF,radius:$a.RADIUS}),R=S.getContext("2d"),O=S.width,L=S.height,_=R.getImageData(0,0,O,L);for(let C=0;C<O;C++)for(let w=0;w<L;w++){let D=w*O+C,N=I[D]*255,F=D*4;_.data[F+0]=N,_.data[F+1]=N,_.data[F+2]=N,_.data[F+3]=N}R.putImageData(_,0,0),b.loadImage(y,S)}}let x=o[p];if(l(x)||(x=new I7e,x.dimensions=A,x.billboardTexture=b,o[p]=x),x.billboardTexture.id!==y&&(x.billboardTexture=b,x.dimensions=A),!b.hasImage){fK(e,x);continue}let T=x.billboard,E=e._spareBillboards;l(T)||(E.length>0?T=E.pop():(T=u.add({collection:e}),T._labelDimensions=new U,T._labelTranslate=new U,T._positionFromParent=!0),x.billboard=T),T.setImageTexture(b),T.show=t._show,T.position=t._position,T.eyeOffset=t._eyeOffset,T.pixelOffset=t._pixelOffset,T.horizontalOrigin=Gi.LEFT,T.verticalOrigin=t._verticalOrigin,T.heightReference=t._heightReference,l(t._clampedPosition)&&(T._clampedPosition=t._clampedPosition),T.scale=t.totalScale,T.pickPrimitive=t,T.id=t._id,T.translucencyByDistance=t._translucencyByDistance,T.pixelOffsetScaleByDistance=t._pixelOffsetScaleByDistance,T.scaleByDistance=t._scaleByDistance,T.distanceDisplayCondition=t._distanceDisplayCondition,T.disableDepthTestDistance=t._disableDepthTestDistance,T._batchIndex=t._batchIndex,T.outlineColor=t.outlineColor,t.style===Co.FILL_AND_OUTLINE?(T.color=t._fillColor,T.outlineWidth=t.outlineWidth):t.style===Co.FILL?(T.color=t._fillColor,T.outlineWidth=0):t.style===Co.OUTLINE&&(T.color=z.TRANSPARENT,T.outlineWidth=t.outlineWidth)}t._repositionAllGlyphs=!0}function F7e(e,t,n){if(!l(n))return;let i=t.show&&t._showBackground&&t._renderedText.split(` +`).join("").length>0;if(t.show&&!i){e.remove(n),t._backgroundBillboard=void 0;return}n.color=t._backgroundColor,n.show=t._show,n.position=t._position,n.eyeOffset=t._eyeOffset,n.pixelOffset=t._pixelOffset,n.horizontalOrigin=Gi.LEFT,n.verticalOrigin=t._verticalOrigin,n.heightReference=t._heightReference,l(t._clampedPosition)&&(n._clampedPosition=t._clampedPosition),n.scale=t.totalScale,n.pickPrimitive=t,n.id=t._id,n.translucencyByDistance=t._translucencyByDistance,n.pixelOffsetScaleByDistance=t._pixelOffsetScaleByDistance,n.scaleByDistance=t._scaleByDistance,n.distanceDisplayCondition=t._distanceDisplayCondition,n.disableDepthTestDistance=t._disableDepthTestDistance,n.clusterShow=t.clusterShow}function xme(e,t,n){return t===Gi.CENTER?-e/2:t===Gi.RIGHT?-(e+n.x):n.x}var No=new U,B7e=new U;function k7e(e){let t=e._glyphs,n=e._renderedText,i=0,r=0,o=[],s=Number.NEGATIVE_INFINITY,a=0,c=1,u=t.length,f=e._backgroundBillboard,d=U.clone(l(f)?e._backgroundPadding:U.ZERO,B7e);d.x/=e._relativeSize,d.y/=e._relativeSize;for(let O=0;O<u;++O){if(n.charAt(O)===` +`){o.push(i),++c,i=0;continue}let _=t[O].dimensions;l(_)&&(a=Math.max(a,_.height-_.descent),s=Math.max(s,_.descent),i+=_.width-_.minx,O<u-1&&(i+=t[O+1].dimensions.minx),r=Math.max(r,i))}o.push(i);let p=a+s,g=e.totalScale,m=e._horizontalOrigin,y=e._verticalOrigin,A=0,b=o[A],x=xme(b,m,d),T=(l(e._lineHeight)?e._lineHeight:P7e*e._fontSize)/e._relativeSize,E=T*(c-1),v=r,S=p+E;l(f)&&(v+=d.x*2,S+=d.y*2,f._labelHorizontalOrigin=m),No.x=x*g,No.y=0;let I=!0,R=0;for(let O=0;O<u;++O){if(n.charAt(O)===` +`){++A,R+=T,b=o[A],x=xme(b,m,d),No.x=x*g,I=!0;continue}let L=t[O],_=L.dimensions;if(l(_)&&(y===qn.TOP?(No.y=_.height-a-d.y,No.y+=$a.PADDING):y===qn.CENTER?No.y=(E+_.height-a)/2:y===qn.BASELINE?(No.y=E,No.y-=$a.PADDING):(No.y=E+s+d.y,No.y-=$a.PADDING),No.y=(No.y-_.descent-R)*g,I&&(No.x-=$a.PADDING*g,I=!1),l(L.billboard)&&(L.billboard._setTranslate(No),L.billboard._labelDimensions.x=v,L.billboard._labelDimensions.y=S,L.billboard._labelHorizontalOrigin=m,fs(e.heightReference)&&(L.billboard._labelTranslate=U.clone(No,L.billboard._labelTranslate))),O<u-1)){let C=t[O+1];No.x+=(_.width-_.minx+C.dimensions.minx)*g}}l(f)&&n.split(` +`).join("").length>0&&(m===Gi.CENTER?x=-r/2-d.x:m===Gi.RIGHT?x=-(r+d.x*2):x=0,No.x=x*g,y===qn.TOP?No.y=p-a-s:y===qn.CENTER?No.y=(p-a)/2-s:y===qn.BASELINE?No.y=-d.y-s:No.y=0,No.y=No.y*g,f.width=v,f.height=S,f._setTranslate(No),f._labelTranslate=U.clone(No,f._labelTranslate))}function Cme(e,t){let n=t._glyphs;for(let i=0,r=n.length;i<r;++i)fK(e,n[i]);l(t._backgroundBillboard)&&(e._backgroundBillboardCollection.remove(t._backgroundBillboard),t._backgroundBillboard=void 0),t._labelCollection=void 0,l(t._removeCallbackFunc)&&t._removeCallbackFunc(),le(t)}function np(e){e=e??H.EMPTY_OBJECT,this._scene=e.scene,this._batchTable=e.batchTable;let t=new ud({scene:this._scene,textureAtlas:new XE({initialSize:uK}),coarseDepthTestDistance:e.coarseDepthTestDistance,threePointDepthTestDistance:e.threePointDepthTestDistance});this._backgroundBillboardCollection=t,this._backgroundBillboardTexture=new Y_(t),this._glyphBillboardCollection=new ud({scene:this._scene,batchTable:this._batchTable,coarseDepthTestDistance:e.coarseDepthTestDistance,threePointDepthTestDistance:e.threePointDepthTestDistance}),this._glyphBillboardCollection._sdf=!0,this._spareBillboards=[],this._textDimensionsCache={},this._labels=[],this._labelsToUpdate=[],this._totalGlyphCount=0,this._highlightColor=z.clone(z.WHITE),this.show=e.show??!0,this.modelMatrix=M.clone(e.modelMatrix??M.IDENTITY),this.debugShowBoundingVolume=e.debugShowBoundingVolume??!1,this.blendOption=e.blendOption??Bi.OPAQUE_AND_TRANSLUCENT}Object.defineProperties(np.prototype,{length:{get:function(){return this._labels.length}},sizeInBytes:{get:function(){return this._glyphBillboardCollection.sizeInBytes+this._backgroundBillboardCollection.sizeInBytes}},ready:{get:function(){let e=this._backgroundBillboardCollection.get(0);return l(e)&&!e.ready?!1:this._glyphBillboardCollection.ready}},coarseDepthTestDistance:{get:function(){return this._backgroundBillboardCollection.coarseDepthTestDistance},set:function(e){this._backgroundBillboardCollection.coarseDepthTestDistance=e,this._glyphBillboardCollection.coarseDepthTestDistance=e}},threePointDepthTestDistance:{get:function(){return this._backgroundBillboardCollection.threePointDepthTestDistance},set:function(e){this._backgroundBillboardCollection.threePointDepthTestDistance=e,this._glyphBillboardCollection.threePointDepthTestDistance=e}}});np.prototype.add=function(e){let t=new zb(e,this);return this._labels.push(t),this._labelsToUpdate.push(t),t};np.prototype.remove=function(e){if(l(e)&&e._labelCollection===this){let t=this._labels.indexOf(e);if(t!==-1)return this._labels.splice(t,1),Cme(this,e),!0}return!1};np.prototype.removeAll=function(){let e=this._labels;for(let t=0,n=e.length;t<n;++t)Cme(this,e[t]);e.length=0};np.prototype.contains=function(e){return l(e)&&e._labelCollection===this};np.prototype.get=function(e){return this._labels[e]};np.prototype.update=function(e){if(!this.show)return;let t=this._glyphBillboardCollection,n=this._backgroundBillboardCollection;t.modelMatrix=this.modelMatrix,t.debugShowBoundingVolume=this.debugShowBoundingVolume,n.modelMatrix=this.modelMatrix,n.debugShowBoundingVolume=this.debugShowBoundingVolume;let i=this._labelsToUpdate.length;for(let o=0;o<i;++o){let s=this._labelsToUpdate[o];if(s.isDestroyed())continue;let a=s._glyphs.length;s._rebindAllGlyphs&&(L7e(this,s),s._rebindAllGlyphs=!1),s._repositionAllGlyphs&&(k7e(s),s._repositionAllGlyphs=!1);let c=s._glyphs.length-a;this._totalGlyphCount+=c}let r=n.length>0?Bi.TRANSLUCENT:this.blendOption;t.blendOption=r,n.blendOption=r,t._highlightColor=this._highlightColor,n._highlightColor=this._highlightColor,this._labelsToUpdate.length=0,n.update(e),t.update(e)};np.prototype.isDestroyed=function(){return!1};np.prototype.destroy=function(){return this.removeAll(),this._glyphBillboardCollection=this._glyphBillboardCollection.destroy(),this._backgroundBillboardCollection=this._backgroundBillboardCollection.destroy(),le(this)};var K0=np;function Xo(e,t){e=e??H.EMPTY_OBJECT;let n=e.translucencyByDistance,i=e.scaleByDistance,r=e.distanceDisplayCondition;l(n)&&(n=qt.clone(n)),l(i)&&(i=qt.clone(i)),l(r)&&(r=Gt.clone(r)),this._show=e.show??!0,this._position=h.clone(e.position??h.ZERO),this._actualPosition=h.clone(this._position),this._color=z.clone(e.color??z.WHITE),this._outlineColor=z.clone(e.outlineColor??z.TRANSPARENT),this._outlineWidth=e.outlineWidth??0,this._pixelSize=e.pixelSize??10,this._scaleByDistance=i,this._translucencyByDistance=n,this._distanceDisplayCondition=r,this._disableDepthTestDistance=e.disableDepthTestDistance??0,this._id=e.id,this._collection=e.collection??t,this._clusterShow=!0,this._pickId=void 0,this._pointPrimitiveCollection=t,this._dirty=!1,this._index=-1,this._splitDirection=e.splitDirection??Yo.NONE}var vme=Xo.SHOW_INDEX=0,Ime=Xo.POSITION_INDEX=1,U7e=Xo.COLOR_INDEX=2,z7e=Xo.OUTLINE_COLOR_INDEX=3,V7e=Xo.OUTLINE_WIDTH_INDEX=4,j7e=Xo.PIXEL_SIZE_INDEX=5,H7e=Xo.SCALE_BY_DISTANCE_INDEX=6,G7e=Xo.TRANSLUCENCY_BY_DISTANCE_INDEX=7,W7e=Xo.DISTANCE_DISPLAY_CONDITION_INDEX=8,q7e=Xo.DISABLE_DEPTH_DISTANCE_INDEX=9,Y7e=Xo.SPLIT_DIRECTION_INDEX=10;Xo.NUMBER_OF_PROPERTIES=11;function af(e,t){let n=e._pointPrimitiveCollection;l(n)&&(n._updatePointPrimitive(e,t),e._dirty=!0)}Object.defineProperties(Xo.prototype,{show:{get:function(){return this._show},set:function(e){this._show!==e&&(this._show=e,af(this,vme))}},position:{get:function(){return this._position},set:function(e){let t=this._position;h.equals(t,e)||(h.clone(e,t),h.clone(e,this._actualPosition),af(this,Ime))}},scaleByDistance:{get:function(){return this._scaleByDistance},set:function(e){let t=this._scaleByDistance;qt.equals(t,e)||(this._scaleByDistance=qt.clone(e,t),af(this,H7e))}},translucencyByDistance:{get:function(){return this._translucencyByDistance},set:function(e){let t=this._translucencyByDistance;qt.equals(t,e)||(this._translucencyByDistance=qt.clone(e,t),af(this,G7e))}},pixelSize:{get:function(){return this._pixelSize},set:function(e){this._pixelSize!==e&&(this._pixelSize=e,af(this,j7e))}},color:{get:function(){return this._color},set:function(e){let t=this._color;z.equals(t,e)||(z.clone(e,t),af(this,U7e))}},outlineColor:{get:function(){return this._outlineColor},set:function(e){let t=this._outlineColor;z.equals(t,e)||(z.clone(e,t),af(this,z7e))}},outlineWidth:{get:function(){return this._outlineWidth},set:function(e){this._outlineWidth!==e&&(this._outlineWidth=e,af(this,V7e))}},distanceDisplayCondition:{get:function(){return this._distanceDisplayCondition},set:function(e){Gt.equals(this._distanceDisplayCondition,e)||(this._distanceDisplayCondition=Gt.clone(e,this._distanceDisplayCondition),af(this,W7e))}},disableDepthTestDistance:{get:function(){return this._disableDepthTestDistance},set:function(e){this._disableDepthTestDistance!==e&&(this._disableDepthTestDistance=e,af(this,q7e))}},id:{get:function(){return this._id},set:function(e){this._id=e,l(this._pickId)&&(this._pickId.object.id=e)}},pickId:{get:function(){return this._pickId}},clusterShow:{get:function(){return this._clusterShow},set:function(e){this._clusterShow!==e&&(this._clusterShow=e,af(this,vme))}},splitDirection:{get:function(){return this._splitDirection},set:function(e){this._splitDirection!==e&&(this._splitDirection=e,af(this,Y7e))}}});Xo.prototype.getPickId=function(e){return l(this._pickId)||(this._pickId=e.createPickId({primitive:this,collection:this._collection,id:this._id})),this._pickId};Xo.prototype._getActualPosition=function(){return this._actualPosition};Xo.prototype._setActualPosition=function(e){h.clone(e,this._actualPosition),af(this,Ime)};var Sme=new se;Xo._computeActualPosition=function(e,t,n){return t.mode===re.SCENE3D?e:(M.multiplyByPoint(n,e,Sme),pr.computeActualEllipsoidPosition(t,Sme))};var wme=new se;Xo._computeScreenSpacePosition=function(e,t,n,i){let r=M.multiplyByVector(e,se.fromElements(t.x,t.y,t.z,1,wme),wme);return pr.worldToWindowCoordinates(n,r,i)};Xo.prototype.computeScreenSpacePosition=function(e,t){let n=this._pointPrimitiveCollection;l(t)||(t=new U);let i=n.modelMatrix,r=Xo._computeScreenSpacePosition(i,this._actualPosition,e,t);if(l(r))return r.y=e.canvas.clientHeight-r.y,r};Xo.getScreenSpaceBoundingBox=function(e,t,n){let i=e.pixelSize,r=i*.5,o=t.x-r,s=t.y-r,a=i,c=i;return l(n)||(n=new et),n.x=o,n.y=s,n.width=a,n.height=c,n};Xo.prototype.equals=function(e){return this===e||l(e)&&this._id===e._id&&h.equals(this._position,e._position)&&z.equals(this._color,e._color)&&this._pixelSize===e._pixelSize&&this._outlineWidth===e._outlineWidth&&this._show===e._show&&z.equals(this._outlineColor,e._outlineColor)&&qt.equals(this._scaleByDistance,e._scaleByDistance)&&qt.equals(this._translucencyByDistance,e._translucencyByDistance)&&Gt.equals(this._distanceDisplayCondition,e._distanceDisplayCondition)&&this._disableDepthTestDistance===e._disableDepthTestDistance&&this._splitDirection===e._splitDirection};Xo.prototype._destroy=function(){this._pickId=this._pickId&&this._pickId.destroy(),this._pointPrimitiveCollection=void 0};var Ia=Xo;var X7e=Ia.SHOW_INDEX,mK=Ia.POSITION_INDEX,Pme=Ia.COLOR_INDEX,K7e=Ia.OUTLINE_COLOR_INDEX,$7e=Ia.OUTLINE_WIDTH_INDEX,J7e=Ia.PIXEL_SIZE_INDEX,Dme=Ia.SCALE_BY_DISTANCE_INDEX,Rme=Ia.TRANSLUCENCY_BY_DISTANCE_INDEX,Ome=Ia.DISTANCE_DISPLAY_CONDITION_INDEX,Z7e=Ia.DISABLE_DEPTH_DISTANCE_INDEX,Q7e=Ia.SPLIT_DIRECTION_INDEX,pK=Ia.NUMBER_OF_PROPERTIES,Gc={positionHighAndSize:0,positionLowAndOutline:1,compressedAttribute0:2,compressedAttribute1:3,scaleByDistance:4,distanceDisplayConditionAndDisableDepthAndSplitDirection:5};function fd(e){e=e??H.EMPTY_OBJECT,this._sp=void 0,this._spTranslucent=void 0,this._rsOpaque=void 0,this._rsTranslucent=void 0,this._vaf=void 0,this._pointPrimitives=[],this._pointPrimitivesToUpdate=[],this._pointPrimitivesToUpdateIndex=0,this._pointPrimitivesRemoved=!1,this._createVertexArray=!1,this._shaderScaleByDistance=!1,this._compiledShaderScaleByDistance=!1,this._shaderTranslucencyByDistance=!1,this._compiledShaderTranslucencyByDistance=!1,this._shaderDistanceDisplayCondition=!1,this._compiledShaderDistanceDisplayCondition=!1,this._shaderDisableDepthDistance=!1,this._compiledShaderDisableDepthDistance=!1,this._propertiesChanged=new Uint32Array(pK),this._maxPixelSize=1,this._baseVolume=new ue,this._baseVolumeWC=new ue,this._baseVolume2D=new ue,this._boundingVolume=new ue,this._boundingVolumeDirty=!1,this._colorCommands=[],this.show=e.show??!0,this.modelMatrix=M.clone(e.modelMatrix??M.IDENTITY),this._modelMatrix=M.clone(M.IDENTITY),this.debugShowBoundingVolume=e.debugShowBoundingVolume??!1,this.blendOption=e.blendOption??Bi.OPAQUE_AND_TRANSLUCENT,this._blendOption=void 0,this._mode=re.SCENE3D,this._maxTotalPointSize=1,this._buffersUsage=[Me.STATIC_DRAW,Me.STATIC_DRAW,Me.STATIC_DRAW,Me.STATIC_DRAW,Me.STATIC_DRAW,Me.STATIC_DRAW,Me.STATIC_DRAW,Me.STATIC_DRAW,Me.STATIC_DRAW];let t=this;this._uniforms={u_maxTotalPointSize:function(){return t._maxTotalPointSize}}}Object.defineProperties(fd.prototype,{length:{get:function(){return gK(this),this._pointPrimitives.length}}});function Mme(e){let t=e.length;for(let n=0;n<t;++n)e[n]&&e[n]._destroy()}fd.prototype.add=function(e){let t=new Ia(e,this);return t._index=this._pointPrimitives.length,this._pointPrimitives.push(t),this._createVertexArray=!0,t};fd.prototype.remove=function(e){return this.contains(e)?(this._pointPrimitives[e._index]=null,this._pointPrimitivesRemoved=!0,this._createVertexArray=!0,e._destroy(),!0):!1};fd.prototype.removeAll=function(){Mme(this._pointPrimitives),this._pointPrimitives=[],this._pointPrimitivesToUpdate=[],this._pointPrimitivesToUpdateIndex=0,this._pointPrimitivesRemoved=!1,this._createVertexArray=!0};function gK(e){if(e._pointPrimitivesRemoved){e._pointPrimitivesRemoved=!1;let t=[],n=e._pointPrimitives,i=n.length;for(let r=0,o=0;r<i;++r){let s=n[r];s&&(s._index=o++,t.push(s))}e._pointPrimitives=t}}fd.prototype._updatePointPrimitive=function(e,t){e._dirty||(this._pointPrimitivesToUpdate[this._pointPrimitivesToUpdateIndex++]=e),++this._propertiesChanged[t]};fd.prototype.contains=function(e){return l(e)&&e._pointPrimitiveCollection===this};fd.prototype.get=function(e){return gK(this),this._pointPrimitives[e]};fd.prototype.computeNewBuffersUsage=function(){let e=this._buffersUsage,t=!1,n=this._propertiesChanged;for(let i=0;i<pK;++i){let r=n[i]===0?Me.STATIC_DRAW:Me.STREAM_DRAW;t=t||e[i]!==r,e[i]=r}return t};function eWe(e,t,n){return new k_(e,[{index:Gc.positionHighAndSize,componentsPerAttribute:4,componentDatatype:Y.FLOAT,usage:n[mK]},{index:Gc.positionLowAndShow,componentsPerAttribute:4,componentDatatype:Y.FLOAT,usage:n[mK]},{index:Gc.compressedAttribute0,componentsPerAttribute:4,componentDatatype:Y.FLOAT,usage:n[Pme]},{index:Gc.compressedAttribute1,componentsPerAttribute:4,componentDatatype:Y.FLOAT,usage:n[Rme]},{index:Gc.scaleByDistance,componentsPerAttribute:4,componentDatatype:Y.FLOAT,usage:n[Dme]},{index:Gc.distanceDisplayConditionAndDisableDepthAndSplitDirection,componentsPerAttribute:4,componentDatatype:Y.FLOAT,usage:n[Ome]}],t)}var dK=new Sn,e3=new z;function Nme(e,t,n,i){let r=i._index,o=i._getActualPosition();e._mode===re.SCENE3D&&(ue.expand(e._baseVolume,o,e._baseVolume),e._boundingVolumeDirty=!0),Sn.fromCartesian(o,dK);let s=i.pixelSize,a=i.outlineWidth;e._maxPixelSize=Math.max(e._maxPixelSize,s+a);let c=n[Gc.positionHighAndSize],u=dK.high;c(r,u.x,u.y,u.z,s);let f=n[Gc.positionLowAndOutline],d=dK.low;f(r,d.x,d.y,d.z,a)}var tWe=256;function Lme(e,t,n,i){let r=i._index,o=i.color,s=i.outlineColor,a=i.getPickId(t).color;e3.red=o.alpha,e3.green=s.alpha,e3.blue=a.alpha;let c=n[Gc.compressedAttribute0];c(r,cn.encodeRGB8(o),cn.encodeRGB8(s),cn.encodeRGB8(a),cn.encodeRGB8(e3))}function Fme(e,t,n,i){let r=i._index,o=0,s=1,a=1,c=1,u=i.translucencyByDistance;l(u)&&(o=u.near,s=u.nearValue,a=u.far,c=u.farValue,(s!==1||c!==1)&&(e._shaderTranslucencyByDistance=!0));let f=i.show&&i.clusterShow;i.color.alpha===0&&i.outlineColor.alpha===0&&(f=!1),s=P.clamp(s,0,1),s=s===1?255:s*255|0;let d=(f?1:0)*tWe+s;c=P.clamp(c,0,1),c=c===1?255:c*255|0;let p=c,g=n[Gc.compressedAttribute1];g(r,d,p,o,a)}function Bme(e,t,n,i){let r=i._index,o=n[Gc.scaleByDistance],s=0,a=1,c=1,u=1,f=i.scaleByDistance;l(f)&&(s=f.near,a=f.nearValue,c=f.far,u=f.farValue,(a!==1||u!==1)&&(e._shaderScaleByDistance=!0)),o(r,s,a,c,u)}function kme(e,t,n,i){let r=i._index,o=n[Gc.distanceDisplayConditionAndDisableDepthAndSplitDirection],s=0,a=Number.MAX_VALUE,c=i.distanceDisplayCondition;l(c)&&(s=c.near,a=c.far,s*=s,a*=a,e._shaderDistanceDisplayCondition=!0);let u=i.disableDepthTestDistance;u*=u,u>0&&(e._shaderDisableDepthDistance=!0,u===Number.POSITIVE_INFINITY&&(u=-1));let f=0,d=i.splitDirection;l(d)&&(f=d),o(r,s,a,u,f)}function nWe(e,t,n,i){Nme(e,t,n,i),Lme(e,t,n,i),Fme(e,t,n,i),Bme(e,t,n,i),kme(e,t,n,i)}function hK(e,t,n,i,r,o){let s;i.mode===re.SCENE3D?(s=e._baseVolume,e._boundingVolumeDirty=!0):s=e._baseVolume2D;let a=[];for(let c=0;c<n;++c){let u=t[c],f=u.position,d=Ia._computeActualPosition(f,i,r);l(d)&&(u._setActualPosition(d),o?a.push(d):ue.expand(s,d,s))}o&&ue.fromPoints(a,s)}function iWe(e,t){let n=t.mode,i=e._pointPrimitives,r=e._pointPrimitivesToUpdate,o=e._modelMatrix;e._createVertexArray||e._mode!==n||n!==re.SCENE3D&&!M.equals(o,e.modelMatrix)?(e._mode=n,M.clone(e.modelMatrix,o),e._createVertexArray=!0,(n===re.SCENE3D||n===re.SCENE2D||n===re.COLUMBUS_VIEW)&&hK(e,i,i.length,t,o,!0)):n===re.MORPHING?hK(e,i,i.length,t,o,!0):(n===re.SCENE2D||n===re.COLUMBUS_VIEW)&&hK(e,r,e._pointPrimitivesToUpdateIndex,t,o,!1)}function rWe(e,t,n){let r=t.camera.getPixelSize(n,t.context.drawingBufferWidth,t.context.drawingBufferHeight)*e._maxPixelSize;n.radius+=r}var oWe=[];fd.prototype.update=function(e){if(gK(this),!this.show)return;this._maxTotalPointSize=Ut.maximumAliasedPointSize,iWe(this,e);let n=this._pointPrimitives.length,i=this._pointPrimitivesToUpdate,r=this._pointPrimitivesToUpdateIndex,o=this._propertiesChanged,s=this._createVertexArray,a,c=e.context,u=e.passes,f=u.pick;if(s||!f&&this.computeNewBuffersUsage()){this._createVertexArray=!1;for(let v=0;v<pK;++v)o[v]=0;if(this._vaf=this._vaf&&this._vaf.destroy(),n>0){this._vaf=eWe(c,n,this._buffersUsage),a=this._vaf.writers;for(let v=0;v<n;++v){let S=this._pointPrimitives[v];S._dirty=!1,nWe(this,c,a,S)}this._vaf.commit()}this._pointPrimitivesToUpdateIndex=0}else if(r>0){let v=oWe;v.length=0,(o[mK]||o[$7e]||o[J7e])&&v.push(Nme),(o[Pme]||o[K7e])&&v.push(Lme),(o[X7e]||o[Rme])&&v.push(Fme),o[Dme]&&v.push(Bme),(o[Ome]||o[Z7e]||o[Q7e])&&v.push(kme);let S=v.length;if(a=this._vaf.writers,r/n>.1){for(let I=0;I<r;++I){let R=i[I];R._dirty=!1;for(let O=0;O<S;++O)v[O](this,c,a,R)}this._vaf.commit()}else{for(let I=0;I<r;++I){let R=i[I];R._dirty=!1;for(let O=0;O<S;++O)v[O](this,c,a,R);this._vaf.subCommit(R._index,1)}this._vaf.endSubCommits()}this._pointPrimitivesToUpdateIndex=0}if(r>n*1.5&&(i.length=n),!l(this._vaf)||!l(this._vaf.va))return;this._boundingVolumeDirty&&(this._boundingVolumeDirty=!1,ue.transform(this._baseVolume,this.modelMatrix,this._baseVolumeWC));let d,p=M.IDENTITY;e.mode===re.SCENE3D?(p=this.modelMatrix,d=ue.clone(this._baseVolumeWC,this._boundingVolume)):d=ue.clone(this._baseVolume2D,this._boundingVolume),rWe(this,e,d);let g=this._blendOption!==this.blendOption;this._blendOption=this.blendOption,g&&(this._blendOption===Bi.OPAQUE||this._blendOption===Bi.OPAQUE_AND_TRANSLUCENT?this._rsOpaque=Ge.fromCache({depthTest:{enabled:!0,func:te.LEQUAL},depthMask:!0}):this._rsOpaque=void 0,this._blendOption===Bi.TRANSLUCENT||this._blendOption===Bi.OPAQUE_AND_TRANSLUCENT?this._rsTranslucent=Ge.fromCache({depthTest:{enabled:!0,func:te.LEQUAL},depthMask:!1,blending:nn.ALPHA_BLEND}):this._rsTranslucent=void 0),this._shaderDisableDepthDistance=this._shaderDisableDepthDistance||e.minimumDisableDepthTestDistance!==0;let m,y;(g||this._shaderScaleByDistance&&!this._compiledShaderScaleByDistance||this._shaderTranslucencyByDistance&&!this._compiledShaderTranslucencyByDistance||this._shaderDistanceDisplayCondition&&!this._compiledShaderDistanceDisplayCondition||this._shaderDisableDepthDistance!==this._compiledShaderDisableDepthDistance)&&(m=new Xe({sources:[k2]}),this._shaderScaleByDistance&&m.defines.push("EYE_DISTANCE_SCALING"),this._shaderTranslucencyByDistance&&m.defines.push("EYE_DISTANCE_TRANSLUCENCY"),this._shaderDistanceDisplayCondition&&m.defines.push("DISTANCE_DISPLAY_CONDITION"),this._shaderDisableDepthDistance&&m.defines.push("DISABLE_DEPTH_DISTANCE"),this._blendOption===Bi.OPAQUE_AND_TRANSLUCENT&&(y=new Xe({defines:["OPAQUE"],sources:[Rb]}),this._sp=Qt.replaceCache({context:c,shaderProgram:this._sp,vertexShaderSource:m,fragmentShaderSource:y,attributeLocations:Gc}),y=new Xe({defines:["TRANSLUCENT"],sources:[Rb]}),this._spTranslucent=Qt.replaceCache({context:c,shaderProgram:this._spTranslucent,vertexShaderSource:m,fragmentShaderSource:y,attributeLocations:Gc})),this._blendOption===Bi.OPAQUE&&(y=new Xe({sources:[Rb]}),this._sp=Qt.replaceCache({context:c,shaderProgram:this._sp,vertexShaderSource:m,fragmentShaderSource:y,attributeLocations:Gc})),this._blendOption===Bi.TRANSLUCENT&&(y=new Xe({sources:[Rb]}),this._spTranslucent=Qt.replaceCache({context:c,shaderProgram:this._spTranslucent,vertexShaderSource:m,fragmentShaderSource:y,attributeLocations:Gc})),this._compiledShaderScaleByDistance=this._shaderScaleByDistance,this._compiledShaderTranslucencyByDistance=this._shaderTranslucencyByDistance,this._compiledShaderDistanceDisplayCondition=this._shaderDistanceDisplayCondition,this._compiledShaderDisableDepthDistance=this._shaderDisableDepthDistance);let A,b,x,T,E=e.commandList;if(u.render||f){let v=this._colorCommands,S=this._blendOption===Bi.OPAQUE,I=this._blendOption===Bi.OPAQUE_AND_TRANSLUCENT;A=this._vaf.va,b=A.length,v.length=b;let R=I?b*2:b;for(T=0;T<R;++T){let O=S||I&&T%2===0;x=v[T],l(x)||(x=v[T]=new at),x.primitiveType=Oe.POINTS,x.pass=O||!I?Ie.OPAQUE:Ie.TRANSLUCENT,x.owner=this;let L=I?Math.floor(T/2):T;x.boundingVolume=d,x.modelMatrix=p,x.shaderProgram=O?this._sp:this._spTranslucent,x.uniformMap=this._uniforms,x.vertexArray=A[L].va,x.renderState=O?this._rsOpaque:this._rsTranslucent,x.debugShowBoundingVolume=this.debugShowBoundingVolume,x.pickId="v_pickColor",E.push(x)}}};fd.prototype.isDestroyed=function(){return!1};fd.prototype.destroy=function(){return this._sp=this._sp&&this._sp.destroy(),this._spTranslucent=this._spTranslucent&&this._spTranslucent.destroy(),this._spPick=this._spPick&&this._spPick.destroy(),this._vaf=this._vaf&&this._vaf.destroy(),Mme(this._pointPrimitives),le(this)};var NP=fd;var Ume=[Int8Array,Uint8Array,Uint8ClampedArray,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array],_K=1,LP=8,Ko=new Uint32Array(96),BP=class e{static from(t){if(!t||t.byteLength===void 0||t.buffer)throw new Error("Data must be an instance of ArrayBuffer or SharedArrayBuffer.");let[n,i]=new Uint8Array(t,0,2);if(n!==219)throw new Error("Data does not appear to be in a KDBush format.");let r=i>>4;if(r!==_K)throw new Error(`Got v${r} data when expected v${_K}.`);let o=Ume[i&15];if(!o)throw new Error("Unrecognized array type.");let[s]=new Uint16Array(t,2,1),[a]=new Uint32Array(t,4,1);return new e(a,s,o,void 0,t)}constructor(t,n=64,i=Float64Array,r=ArrayBuffer,o){if(isNaN(t)||t<0)throw new Error(`Unexpected numItems value: ${t}.`);this.numItems=+t,this.nodeSize=Math.min(Math.max(+n,2),65535),this.ArrayType=i,this.IndexArrayType=t<65536?Uint16Array:Uint32Array;let s=Ume.indexOf(this.ArrayType),a=t*2*this.ArrayType.BYTES_PER_ELEMENT,c=t*this.IndexArrayType.BYTES_PER_ELEMENT,u=(8-c%8)%8;if(s<0)throw new Error(`Unexpected typed array class: ${i}.`);if(o)this.data=o,this.ids=new this.IndexArrayType(o,LP,t),this.coords=new i(o,LP+c+u,t*2),this._pos=t*2,this._finished=!0;else{let f=this.data=new r(LP+a+c+u);this.ids=new this.IndexArrayType(f,LP,t),this.coords=new i(f,LP+c+u,t*2),this._pos=0,this._finished=!1,new Uint8Array(f,0,2).set([219,(_K<<4)+s]),new Uint16Array(f,2,1)[0]=n,new Uint32Array(f,4,1)[0]=t}}add(t,n){let i=this._pos>>1;return this.ids[i]=i,this.coords[this._pos++]=t,this.coords[this._pos++]=n,i}finish(){let t=this._pos>>1;if(t!==this.numItems)throw new Error(`Added ${t} items when expected ${this.numItems}.`);return AK(this.ids,this.coords,this.nodeSize,0,this.numItems-1,0),this._finished=!0,this}range(t,n,i,r){if(!this._finished)throw new Error("Data not yet indexed - call index.finish().");let{ids:o,coords:s,nodeSize:a}=this;Ko[0]=0,Ko[1]=o.length-1,Ko[2]=0;let c=3,u=[];for(;c>0;){let f=Ko[--c],d=Ko[--c],p=Ko[--c];if(d-p<=a){for(let A=p;A<=d;A++){let b=s[2*A],x=s[2*A+1];b>=t&&b<=i&&x>=n&&x<=r&&u.push(o[A])}continue}let g=p+d>>1,m=s[2*g],y=s[2*g+1];m>=t&&m<=i&&y>=n&&y<=r&&u.push(o[g]),(f===0?t<=m:n<=y)&&(Ko[c++]=p,Ko[c++]=g-1,Ko[c++]=1-f),(f===0?i>=m:r>=y)&&(Ko[c++]=g+1,Ko[c++]=d,Ko[c++]=1-f)}return u}within(t,n,i){let r=[];return this.withinInto(t,n,i,r),r}withinInto(t,n,i,r){if(!this._finished)throw new Error("Data not yet indexed - call index.finish().");let{ids:o,coords:s,nodeSize:a}=this;Ko[0]=0,Ko[1]=o.length-1,Ko[2]=0;let c=3,u=0,f=i*i;for(;c>0;){let d=Ko[--c],p=Ko[--c],g=Ko[--c];if(p-g<=a){for(let b=g;b<=p;b++)zme(s[2*b],s[2*b+1],t,n)<=f&&(r[u++]=o[b]);continue}let m=g+p>>1,y=s[2*m],A=s[2*m+1];zme(y,A,t,n)<=f&&(r[u++]=o[m]),(d===0?t-i<=y:n-i<=A)&&(Ko[c++]=g,Ko[c++]=m-1,Ko[c++]=1-d),(d===0?t+i>=y:n+i>=A)&&(Ko[c++]=m+1,Ko[c++]=p,Ko[c++]=1-d)}return u}};function AK(e,t,n,i,r,o){if(r-i<=n)return;let s=i+r>>1;Vme(e,t,s,i,r,o),AK(e,t,n,i,s-1,1-o),AK(e,t,n,s+1,r,1-o)}function Vme(e,t,n,i,r,o){for(;r>i;){if(r-i>600){let u=r-i+1,f=n-i+1,d=Math.log(u),p=.5*Math.exp(2*d/3),g=.5*Math.sqrt(d*p*(u-p)/u)*(f-u/2<0?-1:1),m=Math.max(i,Math.floor(n-f*p/u+g)),y=Math.min(r,Math.floor(n+(u-f)*p/u+g));Vme(e,t,n,m,y,o)}let s=t[2*n+o],a=i,c=r;for(FP(e,t,i,n),t[2*r+o]>s&&FP(e,t,i,r);a<c;){for(FP(e,t,a,c),a++,c--;t[2*a+o]<s;)a++;for(;t[2*c+o]>s;)c--}t[2*i+o]===s?FP(e,t,i,c):(c++,FP(e,t,c,r)),c<=n&&(i=c+1),n<=c&&(r=c-1)}}function FP(e,t,n,i){yK(e,n,i),yK(t,2*n,2*i),yK(t,2*n+1,2*i+1)}function yK(e,t,n){let i=e[t];e[t]=e[n],e[n]=i}function zme(e,t,n,i){let r=e-n,o=t-i;return r*r+o*o}function vh(e){e=e??H.EMPTY_OBJECT,this._enabled=e.enabled??!1,this._pixelRange=e.pixelRange??80,this._minimumClusterSize=e.minimumClusterSize??2,this._clusterBillboards=e.clusterBillboards??!0,this._clusterLabels=e.clusterLabels??!0,this._clusterPoints=e.clusterPoints??!0,this._labelCollection=void 0,this._billboardCollection=void 0,this._pointCollection=void 0,this._clusterBillboardCollection=void 0,this._clusterLabelCollection=void 0,this._clusterPointCollection=void 0,this._collectionIndicesByEntity={},this._unusedLabelIndices=[],this._unusedBillboardIndices=[],this._unusedPointIndices=[],this._previousClusters=[],this._previousHeight=void 0,this._enabledDirty=!1,this._clusterDirty=!1,this._cluster=void 0,this._removeEventListener=void 0,this._clusterEvent=new be,this.show=e.show??!0}function jme(e,t){e.x-=t,e.y-=t,e.width+=t*2,e.height+=t*2}var sWe=new et;function Hme(e,t,n,i,r){if(l(e._labelCollection)&&i._clusterLabels?r=zb.getScreenSpaceBoundingBox(e,t,r):l(e._billboardCollection)&&i._clusterBillboards?r=Fr.getScreenSpaceBoundingBox(e,t,r):l(e._pointPrimitiveCollection)&&i._clusterPoints&&(r=Ia.getScreenSpaceBoundingBox(e,t,r)),jme(r,n),i._clusterLabels&&!l(e._labelCollection)&&l(e.id)&&Wme(i,e.id.id)&&l(e.id._label)){let o=i._collectionIndicesByEntity[e.id.id].labelIndex,s=i._labelCollection.get(o),a=zb.getScreenSpaceBoundingBox(s,t,sWe);jme(a,n),r=et.union(r,a,r)}return r}function aWe(e,t){if(e.clusterShow=!0,!l(e._labelCollection)&&l(e.id)&&Wme(t,e.id.id)&&l(e.id._label)){let n=t._collectionIndicesByEntity[e.id.id].labelIndex,i=t._labelCollection.get(n);i.clusterShow=!0}}function Gme(e,t,n,i){let r={billboard:i._clusterBillboardCollection.add(),label:i._clusterLabelCollection.add(),point:i._clusterPointCollection.add()};r.billboard.show=!1,r.point.show=!1,r.label.show=!0,r.label.text=t.toLocaleString(),r.label.id=n,r.billboard.position=r.label.position=r.point.position=e,i._clusterEvent.raiseEvent(n,r)}function Wme(e,t){return l(e)&&l(e._collectionIndicesByEntity[t])&&l(e._collectionIndicesByEntity[t].labelIndex)}function bK(e,t,n,i,r){if(!l(e))return;let o=e.length;for(let s=0;s<o;++s){let a=e.get(s);if(a.clusterShow=!1,!a.show||r._scene.mode===re.SCENE3D&&!i.isPointVisible(a.position))continue;let c=r._clusterLabels&&l(a._labelCollection),u=r._clusterBillboards&&l(a.id._billboard),f=r._clusterPoints&&l(a.id._point);if(c&&(f||u))continue;let d=a.computeScreenSpacePosition(n);l(d)&&t.push({index:s,collection:e,clustered:!1,coord:d})}}var cWe=new et,lWe=new et,uWe=new et;function fWe(e){return function(t){if(l(t)&&t<.05||!e.enabled)return;let n=e._scene,i=e._labelCollection,r=e._billboardCollection,o=e._pointCollection;if(!l(i)&&!l(r)&&!l(o)||!e._clusterBillboards&&!e._clusterLabels&&!e._clusterPoints)return;let s=e._clusterLabelCollection,a=e._clusterBillboardCollection,c=e._clusterPointCollection;l(s)?s.removeAll():s=e._clusterLabelCollection=new K0({scene:n}),l(a)?a.removeAll():a=e._clusterBillboardCollection=new ud({scene:n}),l(c)?c.removeAll():c=e._clusterPointCollection=new NP;let u=e._pixelRange,f=e._minimumClusterSize,d=e._previousClusters,p=[],g=e._previousHeight,m=n.camera.positionCartographic.height,y=n.ellipsoid,A=n.camera.positionWC,b=new tp(y,A),x=[];e._clusterLabels&&bK(i,x,n,b,e),e._clusterBillboards&&bK(r,x,n,b,e),e._clusterPoints&&bK(o,x,n,b,e);let T,E,v,S,I,R,O,L,_,C,w,D;if(x.length>0){let N=new BP(x.length,64,Float64Array);for(let F=0;F<x.length;++F)N.add(x[F].coord.x,x[F].coord.y);if(N.finish(),m<g)for(v=d.length,T=0;T<v;++T){let F=d[T];if(!b.isPointVisible(F.position))continue;let V=Fr._computeScreenSpacePosition(M.IDENTITY,F.position,h.ZERO,U.ZERO,n);if(!l(V))continue;let B=1-m/g,j=F.width=F.width*B,k=F.height=F.height*B;j=Math.max(j,F.minimumWidth),k=Math.max(k,F.minimumHeight);let G=V.x-j*.5,q=V.y-k*.5,Q=V.x+j,W=V.y+k;for(I=N.range(G,q,Q,W),R=I.length,C=0,_=[],E=0;E<R;++E)O=I[E],L=x[O],L.clustered||(++C,w=L.collection,D=L.index,_.push(w.get(D).id));if(C>=f)for(Gme(F.position,C,_,e),p.push(F),E=0;E<R;++E)x[I[E]].clustered=!0}for(v=x.length,T=0;T<v;++T){let F=x[T];if(F.clustered)continue;F.clustered=!0,w=F.collection,D=F.index;let V=w.get(D);S=Hme(V,F.coord,u,e,cWe);let B=et.clone(S,lWe);I=N.range(S.x,S.y,S.x+S.width,S.y+S.height),R=I.length;let j=h.clone(V.position);for(C=1,_=[V.id],E=0;E<R;++E)if(O=I[E],L=x[O],!L.clustered){let k=L.collection.get(L.index),G=Hme(k,L.coord,u,e,uWe);h.add(k.position,j,j),et.union(B,G,B),++C,_.push(k.id)}if(C>=f){let k=h.multiplyByScalar(j,1/C,j);for(Gme(k,C,_,e),p.push({position:k,width:B.width,height:B.height,minimumWidth:S.width,minimumHeight:S.height}),E=0;E<R;++E)x[I[E]].clustered=!0}else aWe(V,e)}}s.length===0&&(s.destroy(),e._clusterLabelCollection=void 0),a.length===0&&(a.destroy(),e._clusterBillboardCollection=void 0),c.length===0&&(c.destroy(),e._clusterPointCollection=void 0),e._previousClusters=p,e._previousHeight=m}}vh.prototype._initialize=function(e){this._scene=e;let t=fWe(this);this._cluster=t,this._removeEventListener=e.camera.changed.addEventListener(t)};Object.defineProperties(vh.prototype,{enabled:{get:function(){return this._enabled},set:function(e){this._enabledDirty=e!==this._enabled,this._enabled=e}},pixelRange:{get:function(){return this._pixelRange},set:function(e){this._clusterDirty=this._clusterDirty||e!==this._pixelRange,this._pixelRange=e}},minimumClusterSize:{get:function(){return this._minimumClusterSize},set:function(e){this._clusterDirty=this._clusterDirty||e!==this._minimumClusterSize,this._minimumClusterSize=e}},clusterEvent:{get:function(){return this._clusterEvent}},clusterBillboards:{get:function(){return this._clusterBillboards},set:function(e){this._clusterDirty=this._clusterDirty||e!==this._clusterBillboards,this._clusterBillboards=e}},clusterLabels:{get:function(){return this._clusterLabels},set:function(e){this._clusterDirty=this._clusterDirty||e!==this._clusterLabels,this._clusterLabels=e}},clusterPoints:{get:function(){return this._clusterPoints},set:function(e){this._clusterDirty=this._clusterDirty||e!==this._clusterPoints,this._clusterPoints=e}},ready:{get:function(){return!this._enabledDirty&&!this._clusterDirty&&(!l(this._billboardCollection)||this._billboardCollection.ready)&&(!l(this._labelCollection)||this._labelCollection.ready)}}});function TK(e,t,n,i){return function(r){let o=this[e];l(this._collectionIndicesByEntity)||(this._collectionIndicesByEntity={});let s=this._collectionIndicesByEntity[r.id];if(l(s)||(s=this._collectionIndicesByEntity[r.id]={billboardIndex:void 0,labelIndex:void 0,pointIndex:void 0}),l(o)&&l(s[i]))return o.get(s[i]);l(o)||(o=this[e]=new t({scene:this._scene}));let a,c,u=this[n];u.length>0?(a=u.shift(),c=o.get(a)):(c=o.add(),a=o.length-1),s[i]=a;let f=this;return Promise.resolve().then(function(){f._clusterDirty=!0}),c}}function EK(e,t){let n=e._collectionIndicesByEntity[t];!l(n.billboardIndex)&&!l(n.labelIndex)&&!l(n.pointIndex)&&delete e._collectionIndicesByEntity[t]}vh.prototype.getLabel=TK("_labelCollection",K0,"_unusedLabelIndices","labelIndex");vh.prototype.removeLabel=function(e){let t=this._collectionIndicesByEntity&&this._collectionIndicesByEntity[e.id];if(!l(this._labelCollection)||!l(t)||!l(t.labelIndex))return;let n=t.labelIndex;t.labelIndex=void 0,EK(this,e.id);let i=this._labelCollection.get(n);i.show=!1,i.text="",i.id=void 0,this._unusedLabelIndices.push(n),this._clusterDirty=!0};vh.prototype.getBillboard=TK("_billboardCollection",ud,"_unusedBillboardIndices","billboardIndex");vh.prototype.removeBillboard=function(e){let t=this._collectionIndicesByEntity&&this._collectionIndicesByEntity[e.id];if(!l(this._billboardCollection)||!l(t)||!l(t.billboardIndex))return;let n=t.billboardIndex;t.billboardIndex=void 0,EK(this,e.id);let i=this._billboardCollection.get(n);i.id=void 0,i.show=!1,i.image=void 0,this._unusedBillboardIndices.push(n),this._clusterDirty=!0};vh.prototype.getPoint=TK("_pointCollection",NP,"_unusedPointIndices","pointIndex");vh.prototype.removePoint=function(e){let t=this._collectionIndicesByEntity&&this._collectionIndicesByEntity[e.id];if(!l(this._pointCollection)||!l(t)||!l(t.pointIndex))return;let n=t.pointIndex;t.pointIndex=void 0,EK(this,e.id);let i=this._pointCollection.get(n);i.show=!1,i.id=void 0,this._unusedPointIndices.push(n),this._clusterDirty=!0};function xK(e){if(!l(e))return;let t=e.length;for(let n=0;n<t;++n)e.get(n).clusterShow=!0}function dWe(e){e.enabled||(l(e._clusterLabelCollection)&&e._clusterLabelCollection.destroy(),l(e._clusterBillboardCollection)&&e._clusterBillboardCollection.destroy(),l(e._clusterPointCollection)&&e._clusterPointCollection.destroy(),e._clusterLabelCollection=void 0,e._clusterBillboardCollection=void 0,e._clusterPointCollection=void 0,xK(e._labelCollection),xK(e._billboardCollection),xK(e._pointCollection))}vh.prototype.update=function(e){if(!this.show)return;let t,n=this._labelCollection;l(n)&&n.length>0&&!n.ready&&(t=e.commandList,e.commandList=[],n.update(e),e.commandList=t);let i=this._billboardCollection;l(i)&&i.length>0&&!i.ready&&(t=e.commandList,e.commandList=[],i.update(e),e.commandList=t),this._enabledDirty&&(this._enabledDirty=!1,dWe(this),this._clusterDirty=!0),this._clusterDirty&&(this._cluster(),this._clusterDirty=l(n)&&!n.ready||l(i)&&!i.ready),l(this._clusterLabelCollection)&&this._clusterLabelCollection.update(e),l(this._clusterBillboardCollection)&&this._clusterBillboardCollection.update(e),l(this._clusterPointCollection)&&this._clusterPointCollection.update(e),l(n)&&n.update(e),l(i)&&i.update(e),l(this._pointCollection)&&this._pointCollection.update(e)};vh.prototype.destroy=function(){l(this._removeEventListener)&&(this._removeEventListener(),this._removeEventListener=void 0),this._labelCollection=this._labelCollection&&this._labelCollection.destroy(),this._billboardCollection=this._billboardCollection&&this._billboardCollection.destroy(),this._pointCollection=this._pointCollection&&this._pointCollection.destroy(),this._clusterLabelCollection=this._clusterLabelCollection&&this._clusterLabelCollection.destroy(),this._clusterBillboardCollection=this._clusterBillboardCollection&&this._clusterBillboardCollection.destroy(),this._clusterPointCollection=this._clusterPointCollection&&this._clusterPointCollection.destroy(),this._labelCollection=void 0,this._billboardCollection=void 0,this._pointCollection=void 0,this._clusterBillboardCollection=void 0,this._clusterLabelCollection=void 0,this._clusterPointCollection=void 0,this._collectionIndicesByEntity=void 0,this._unusedLabelIndices=[],this._unusedBillboardIndices=[],this._unusedPointIndices=[],this._previousClusters=[],this._previousHeight=void 0,this._enabledDirty=!1,this._pixelRangeDirty=!1,this._minimumClusterSizeDirty=!1};var dd=vh;function vo(e){e=e??H.EMPTY_OBJECT,this.start=l(e.start)?K.clone(e.start):new K,this.stop=l(e.stop)?K.clone(e.stop):new K,this.data=e.data,this.isStartIncluded=e.isStartIncluded??!0,this.isStopIncluded=e.isStopIncluded??!0}Object.defineProperties(vo.prototype,{isEmpty:{get:function(){let e=K.compare(this.stop,this.start);return e<0||e===0&&(!this.isStartIncluded||!this.isStopIncluded)}}});var oC={start:void 0,stop:void 0,isStartIncluded:void 0,isStopIncluded:void 0,data:void 0};vo.fromIso8601=function(e,t){let n=e.iso8601.split("/");if(n.length!==2)throw new pe("options.iso8601 is an invalid ISO 8601 interval.");let i=K.fromIso8601(n[0]),r=K.fromIso8601(n[1]),o=e.isStartIncluded??!0,s=e.isStopIncluded??!0,a=e.data;return l(t)?(t.start=i,t.stop=r,t.isStartIncluded=o,t.isStopIncluded=s,t.data=a,t):(oC.start=i,oC.stop=r,oC.isStartIncluded=o,oC.isStopIncluded=s,oC.data=a,new vo(oC))};vo.toIso8601=function(e,t){return`${K.toIso8601(e.start,t)}/${K.toIso8601(e.stop,t)}`};vo.clone=function(e,t){if(l(e))return l(t)?(t.start=e.start,t.stop=e.stop,t.isStartIncluded=e.isStartIncluded,t.isStopIncluded=e.isStopIncluded,t.data=e.data,t):new vo(e)};vo.equals=function(e,t,n){return e===t||l(e)&&l(t)&&(e.isEmpty&&t.isEmpty||e.isStartIncluded===t.isStartIncluded&&e.isStopIncluded===t.isStopIncluded&&K.equals(e.start,t.start)&&K.equals(e.stop,t.stop)&&(e.data===t.data||l(n)&&n(e.data,t.data)))};vo.equalsEpsilon=function(e,t,n,i){return n=n??0,e===t||l(e)&&l(t)&&(e.isEmpty&&t.isEmpty||e.isStartIncluded===t.isStartIncluded&&e.isStopIncluded===t.isStopIncluded&&K.equalsEpsilon(e.start,t.start,n)&&K.equalsEpsilon(e.stop,t.stop,n)&&(e.data===t.data||l(i)&&i(e.data,t.data)))};vo.intersect=function(e,t,n,i){if(!l(t))return vo.clone(vo.EMPTY,n);let r=e.start,o=e.stop,s=t.start,a=t.stop,c=K.greaterThanOrEquals(s,r)&&K.greaterThanOrEquals(o,s),u=!c&&K.lessThanOrEquals(s,r)&&K.lessThanOrEquals(r,a);if(!c&&!u)return vo.clone(vo.EMPTY,n);let f=e.isStartIncluded,d=e.isStopIncluded,p=t.isStartIncluded,g=t.isStopIncluded,m=K.lessThan(o,a);return l(n)||(n=new vo),n.start=c?s:r,n.isStartIncluded=f&&p||!K.equals(s,r)&&(c&&p||u&&f),n.stop=m?o:a,n.isStopIncluded=m?d:d&&g||!K.equals(a,o)&&g,n.data=l(i)?i(e.data,t.data):e.data,n};vo.contains=function(e,t){if(e.isEmpty)return!1;let n=K.compare(e.start,t);if(n===0)return e.isStartIncluded;let i=K.compare(t,e.stop);return i===0?e.isStopIncluded:n<0&&i<0};vo.prototype.clone=function(e){return vo.clone(this,e)};vo.prototype.equals=function(e,t){return vo.equals(this,e,t)};vo.prototype.equalsEpsilon=function(e,t,n){return vo.equalsEpsilon(this,e,t,n)};vo.prototype.toString=function(){return vo.toIso8601(this)};vo.EMPTY=Object.freeze(new vo({start:new K,stop:new K,isStartIncluded:!1,isStopIncluded:!1}));var Cn=vo;var qme=Object.freeze(K.fromIso8601("0000-01-01T00:00:00Z")),Yme=Object.freeze(K.fromIso8601("9999-12-31T24:00:00Z")),hWe=Object.freeze(new Cn({start:qme,stop:Yme})),mWe={MINIMUM_VALUE:qme,MAXIMUM_VALUE:Yme,MAXIMUM_INTERVAL:hWe},it=mWe;var Xme={AUTODETECT:0,ENU:1,INERTIAL:2,VELOCITY:3};Object.freeze(Xme);var K_=Xme;function $_(e){this._value=void 0,this._hasClone=!1,this._hasEquals=!1,this._definitionChanged=new be,this.setValue(e)}Object.defineProperties($_.prototype,{isConstant:{value:!0},definitionChanged:{get:function(){return this._definitionChanged}}});$_.prototype.getValue=function(e,t){return this._hasClone?this._value.clone(t):this._value};$_.prototype.setValue=function(e){let t=this._value;if(t!==e){let n=l(e),i=n&&typeof e.clone=="function",r=n&&typeof e.equals=="function";(!r||!e.equals(t))&&(this._hasClone=i,this._hasEquals=r,this._value=i?e.clone(this._value):e,this._definitionChanged.raiseEvent(this))}};$_.prototype.equals=function(e){return this===e||e instanceof $_&&(!this._hasEquals&&this._value===e._value||this._hasEquals&&this._value.equals(e._value))};$_.prototype.valueOf=function(){return this._value};$_.prototype.toString=function(){return String(this._value)};var hi=$_;function pWe(e,t,n,i,r){return{configurable:i,get:function(){return this[t]},set:function(o){let s=this[t],a=this[n];l(a)&&(a(),this[n]=void 0),o!==void 0&&(!l(o)||!l(o.getValue))&&l(r)&&(o=r(o)),s!==o&&(this[t]=o,this._definitionChanged.raiseEvent(this,e,o,s)),l(o)&&l(o.definitionChanged)&&(this[n]=o.definitionChanged.addEventListener(function(){this._definitionChanged.raiseEvent(this,e,o,o)},this))}}}function gWe(e){return new hi(e)}function _We(e,t,n){return pWe(e,`_${e.toString()}`,`_${e.toString()}Subscription`,t??!1,n??gWe)}var me=_We;function kP(e){this._definitionChanged=new be,this._show=void 0,this._showSubscription=void 0,this._image=void 0,this._imageSubscription=void 0,this._scale=void 0,this._scaleSubscription=void 0,this._pixelOffset=void 0,this._pixelOffsetSubscription=void 0,this._eyeOffset=void 0,this._eyeOffsetSubscription=void 0,this._horizontalOrigin=void 0,this._horizontalOriginSubscription=void 0,this._verticalOrigin=void 0,this._verticalOriginSubscription=void 0,this._heightReference=void 0,this._heightReferenceSubscription=void 0,this._color=void 0,this._colorSubscription=void 0,this._rotation=void 0,this._rotationSubscription=void 0,this._alignedAxis=void 0,this._alignedAxisSubscription=void 0,this._sizeInMeters=void 0,this._sizeInMetersSubscription=void 0,this._width=void 0,this._widthSubscription=void 0,this._height=void 0,this._heightSubscription=void 0,this._scaleByDistance=void 0,this._scaleByDistanceSubscription=void 0,this._translucencyByDistance=void 0,this._translucencyByDistanceSubscription=void 0,this._pixelOffsetScaleByDistance=void 0,this._pixelOffsetScaleByDistanceSubscription=void 0,this._imageSubRegion=void 0,this._imageSubRegionSubscription=void 0,this._distanceDisplayCondition=void 0,this._distanceDisplayConditionSubscription=void 0,this._disableDepthTestDistance=void 0,this._disableDepthTestDistanceSubscription=void 0,this._splitDirection=void 0,this._splitDirectionSubscription=void 0,this.merge(e??H.EMPTY_OBJECT)}Object.defineProperties(kP.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:me("show"),image:me("image"),scale:me("scale"),pixelOffset:me("pixelOffset"),eyeOffset:me("eyeOffset"),horizontalOrigin:me("horizontalOrigin"),verticalOrigin:me("verticalOrigin"),heightReference:me("heightReference"),color:me("color"),rotation:me("rotation"),alignedAxis:me("alignedAxis"),sizeInMeters:me("sizeInMeters"),width:me("width"),height:me("height"),scaleByDistance:me("scaleByDistance"),translucencyByDistance:me("translucencyByDistance"),pixelOffsetScaleByDistance:me("pixelOffsetScaleByDistance"),imageSubRegion:me("imageSubRegion"),distanceDisplayCondition:me("distanceDisplayCondition"),disableDepthTestDistance:me("disableDepthTestDistance"),splitDirection:me("splitDirection")});kP.prototype.clone=function(e){return l(e)?(e.show=this._show,e.image=this._image,e.scale=this._scale,e.pixelOffset=this._pixelOffset,e.eyeOffset=this._eyeOffset,e.horizontalOrigin=this._horizontalOrigin,e.verticalOrigin=this._verticalOrigin,e.heightReference=this._heightReference,e.color=this._color,e.rotation=this._rotation,e.alignedAxis=this._alignedAxis,e.sizeInMeters=this._sizeInMeters,e.width=this._width,e.height=this._height,e.scaleByDistance=this._scaleByDistance,e.translucencyByDistance=this._translucencyByDistance,e.pixelOffsetScaleByDistance=this._pixelOffsetScaleByDistance,e.imageSubRegion=this._imageSubRegion,e.distanceDisplayCondition=this._distanceDisplayCondition,e.disableDepthTestDistance=this._disableDepthTestDistance,e.splitDirection=this._splitDirection,e):new kP(this)};kP.prototype.merge=function(e){this.show=this._show??e.show,this.image=this._image??e.image,this.scale=this._scale??e.scale,this.pixelOffset=this._pixelOffset??e.pixelOffset,this.eyeOffset=this._eyeOffset??e.eyeOffset,this.horizontalOrigin=this._horizontalOrigin??e.horizontalOrigin,this.verticalOrigin=this._verticalOrigin??e.verticalOrigin,this.heightReference=this._heightReference??e.heightReference,this.color=this._color??e.color,this.rotation=this._rotation??e.rotation,this.alignedAxis=this._alignedAxis??e.alignedAxis,this.sizeInMeters=this._sizeInMeters??e.sizeInMeters,this.width=this._width??e.width,this.height=this._height??e.height,this.scaleByDistance=this._scaleByDistance??e.scaleByDistance,this.translucencyByDistance=this._translucencyByDistance??e.translucencyByDistance,this.pixelOffsetScaleByDistance=this._pixelOffsetScaleByDistance??e.pixelOffsetScaleByDistance,this.imageSubRegion=this._imageSubRegion??e.imageSubRegion,this.distanceDisplayCondition=this._distanceDisplayCondition??e.distanceDisplayCondition,this.disableDepthTestDistance=this._disableDepthTestDistance??e.disableDepthTestDistance,this.splitDirection=this.splitDirection??e.splitDirection};var Ol=kP;function sC(e){this._definitionChanged=new be,this._color=void 0,this._colorSubscription=void 0,this.color=e}Object.defineProperties(sC.prototype,{isConstant:{get:function(){return X.isConstant(this._color)}},definitionChanged:{get:function(){return this._definitionChanged}},color:me("color")});sC.prototype.getType=function(e){return"Color"};var yWe=new K;sC.prototype.getValue=function(e,t){return l(e)||(e=K.now(yWe)),l(t)||(t={}),t.color=X.getValueOrClonedDefault(this._color,e,z.WHITE,t.color),t};sC.prototype.equals=function(e){return this===e||e instanceof sC&&X.equals(this._color,e._color)};var Kt=sC;var AWe=new U(1,1),bWe=!1,xWe=z.WHITE;function aC(e){e=e??H.EMPTY_OBJECT,this._definitionChanged=new be,this._image=void 0,this._imageSubscription=void 0,this._repeat=void 0,this._repeatSubscription=void 0,this._color=void 0,this._colorSubscription=void 0,this._transparent=void 0,this._transparentSubscription=void 0,this.image=e.image,this.repeat=e.repeat,this.color=e.color,this.transparent=e.transparent}Object.defineProperties(aC.prototype,{isConstant:{get:function(){return X.isConstant(this._image)&&X.isConstant(this._repeat)}},definitionChanged:{get:function(){return this._definitionChanged}},image:me("image"),repeat:me("repeat"),color:me("color"),transparent:me("transparent")});aC.prototype.getType=function(e){return"Image"};var TWe=new K;aC.prototype.getValue=function(e,t){return l(e)||(e=K.now(TWe)),l(t)||(t={}),t.image=X.getValueOrUndefined(this._image,e),t.repeat=X.getValueOrClonedDefault(this._repeat,e,AWe,t.repeat),t.color=X.getValueOrClonedDefault(this._color,e,xWe,t.color),X.getValueOrDefault(this._transparent,e,bWe)&&(t.color.alpha=Math.min(.99,t.color.alpha)),t};aC.prototype.equals=function(e){return this===e||e instanceof aC&&X.equals(this._image,e._image)&&X.equals(this._repeat,e._repeat)&&X.equals(this._color,e._color)&&X.equals(this._transparent,e._transparent)};var jb=aC;function EWe(e){if(e instanceof z)return new Kt(e);if(typeof e=="string"||e instanceof De||e instanceof HTMLCanvasElement||e instanceof HTMLVideoElement){let t=new jb;return t.image=e,t}}function CWe(e,t){return me(e,t,EWe)}var fo=CWe;function UP(e){this._definitionChanged=new be,this._show=void 0,this._showSubscription=void 0,this._dimensions=void 0,this._dimensionsSubscription=void 0,this._heightReference=void 0,this._heightReferenceSubscription=void 0,this._fill=void 0,this._fillSubscription=void 0,this._material=void 0,this._materialSubscription=void 0,this._outline=void 0,this._outlineSubscription=void 0,this._outlineColor=void 0,this._outlineColorSubscription=void 0,this._outlineWidth=void 0,this._outlineWidthSubscription=void 0,this._shadows=void 0,this._shadowsSubscription=void 0,this._distanceDisplayCondition=void 0,this._distanceDisplayConditionSubscription=void 0,this.merge(e??H.EMPTY_OBJECT)}Object.defineProperties(UP.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:me("show"),dimensions:me("dimensions"),heightReference:me("heightReference"),fill:me("fill"),material:fo("material"),outline:me("outline"),outlineColor:me("outlineColor"),outlineWidth:me("outlineWidth"),shadows:me("shadows"),distanceDisplayCondition:me("distanceDisplayCondition")});UP.prototype.clone=function(e){return l(e)?(e.show=this.show,e.dimensions=this.dimensions,e.heightReference=this.heightReference,e.fill=this.fill,e.material=this.material,e.outline=this.outline,e.outlineColor=this.outlineColor,e.outlineWidth=this.outlineWidth,e.shadows=this.shadows,e.distanceDisplayCondition=this.distanceDisplayCondition,e):new UP(this)};UP.prototype.merge=function(e){this.show=this.show??e.show,this.dimensions=this.dimensions??e.dimensions,this.heightReference=this.heightReference??e.heightReference,this.fill=this.fill??e.fill,this.material=this.material??e.material,this.outline=this.outline??e.outline,this.outlineColor=this.outlineColor??e.outlineColor,this.outlineWidth=this.outlineWidth??e.outlineWidth,this.shadows=this.shadows??e.shadows,this.distanceDisplayCondition=this.distanceDisplayCondition??e.distanceDisplayCondition};var cC=UP;var Kme={FIXED:0,INERTIAL:1};Object.freeze(Kme);var Wi=Kme;function lC(){pe.throwInstantiationError()}Object.defineProperties(lC.prototype,{isConstant:{get:pe.throwInstantiationError},definitionChanged:{get:pe.throwInstantiationError},referenceFrame:{get:pe.throwInstantiationError}});lC.prototype.getValue=pe.throwInstantiationError;lC.prototype.getValueInReferenceFrame=pe.throwInstantiationError;lC.prototype.equals=pe.throwInstantiationError;var $me=new $;lC.convertToReferenceFrame=function(e,t,n,i,r){if(!l(t))return t;if(l(r)||(r=new h),n===i)return h.clone(t,r);let o=At.computeIcrfToCentralBodyFixedMatrix(e,$me);if(n===Wi.INERTIAL)return $.multiplyByVector(o,t,r);if(n===Wi.FIXED)return $.multiplyByVector($.transpose(o,$me),t,r)};var ip=lC;function Hb(e,t){this._definitionChanged=new be,this._value=h.clone(e),this._referenceFrame=t??Wi.FIXED}Object.defineProperties(Hb.prototype,{isConstant:{get:function(){return!l(this._value)||this._referenceFrame===Wi.FIXED}},definitionChanged:{get:function(){return this._definitionChanged}},referenceFrame:{get:function(){return this._referenceFrame}}});var vWe=new K;Hb.prototype.getValue=function(e,t){return l(e)||(e=K.now(vWe)),this.getValueInReferenceFrame(e,Wi.FIXED,t)};Hb.prototype.setValue=function(e,t){let n=!1;h.equals(this._value,e)||(n=!0,this._value=h.clone(e)),l(t)&&this._referenceFrame!==t&&(n=!0,this._referenceFrame=t),n&&this._definitionChanged.raiseEvent(this)};Hb.prototype.getValueInReferenceFrame=function(e,t,n){return ip.convertToReferenceFrame(e,this._value,this._referenceFrame,t,n)};Hb.prototype.equals=function(e){return this===e||e instanceof Hb&&h.equals(this._value,e._value)&&this._referenceFrame===e._referenceFrame};var gu=Hb;function zP(e){this._definitionChanged=new be,this._show=void 0,this._showSubscription=void 0,this._positions=void 0,this._positionsSubscription=void 0,this._width=void 0,this._widthSubscription=void 0,this._height=void 0,this._heightSubscription=void 0,this._heightReference=void 0,this._heightReferenceSubscription=void 0,this._extrudedHeight=void 0,this._extrudedHeightSubscription=void 0,this._extrudedHeightReference=void 0,this._extrudedHeightReferenceSubscription=void 0,this._cornerType=void 0,this._cornerTypeSubscription=void 0,this._granularity=void 0,this._granularitySubscription=void 0,this._fill=void 0,this._fillSubscription=void 0,this._material=void 0,this._materialSubscription=void 0,this._outline=void 0,this._outlineSubscription=void 0,this._outlineColor=void 0,this._outlineColorSubscription=void 0,this._outlineWidth=void 0,this._outlineWidthSubscription=void 0,this._shadows=void 0,this._shadowsSubscription=void 0,this._distanceDisplayCondition=void 0,this._distanceDisplayConditionSubscription=void 0,this._classificationType=void 0,this._classificationTypeSubscription=void 0,this._zIndex=void 0,this._zIndexSubscription=void 0,this.merge(e??H.EMPTY_OBJECT)}Object.defineProperties(zP.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:me("show"),positions:me("positions"),width:me("width"),height:me("height"),heightReference:me("heightReference"),extrudedHeight:me("extrudedHeight"),extrudedHeightReference:me("extrudedHeightReference"),cornerType:me("cornerType"),granularity:me("granularity"),fill:me("fill"),material:fo("material"),outline:me("outline"),outlineColor:me("outlineColor"),outlineWidth:me("outlineWidth"),shadows:me("shadows"),distanceDisplayCondition:me("distanceDisplayCondition"),classificationType:me("classificationType"),zIndex:me("zIndex")});zP.prototype.clone=function(e){return l(e)?(e.show=this.show,e.positions=this.positions,e.width=this.width,e.height=this.height,e.heightReference=this.heightReference,e.extrudedHeight=this.extrudedHeight,e.extrudedHeightReference=this.extrudedHeightReference,e.cornerType=this.cornerType,e.granularity=this.granularity,e.fill=this.fill,e.material=this.material,e.outline=this.outline,e.outlineColor=this.outlineColor,e.outlineWidth=this.outlineWidth,e.shadows=this.shadows,e.distanceDisplayCondition=this.distanceDisplayCondition,e.classificationType=this.classificationType,e.zIndex=this.zIndex,e):new zP(this)};zP.prototype.merge=function(e){this.show=this.show??e.show,this.positions=this.positions??e.positions,this.width=this.width??e.width,this.height=this.height??e.height,this.heightReference=this.heightReference??e.heightReference,this.extrudedHeight=this.extrudedHeight??e.extrudedHeight,this.extrudedHeightReference=this.extrudedHeightReference??e.extrudedHeightReference,this.cornerType=this.cornerType??e.cornerType,this.granularity=this.granularity??e.granularity,this.fill=this.fill??e.fill,this.material=this.material??e.material,this.outline=this.outline??e.outline,this.outlineColor=this.outlineColor??e.outlineColor,this.outlineWidth=this.outlineWidth??e.outlineWidth,this.shadows=this.shadows??e.shadows,this.distanceDisplayCondition=this.distanceDisplayCondition??e.distanceDisplayCondition,this.classificationType=this.classificationType??e.classificationType,this.zIndex=this.zIndex??e.zIndex};var uC=zP;function SWe(e){return e}function wWe(e,t){return me(e,t,SWe)}var _u=wWe;function VP(e){this._definitionChanged=new be,this._show=void 0,this._showSubscription=void 0,this._length=void 0,this._lengthSubscription=void 0,this._topRadius=void 0,this._topRadiusSubscription=void 0,this._bottomRadius=void 0,this._bottomRadiusSubscription=void 0,this._heightReference=void 0,this._heightReferenceSubscription=void 0,this._fill=void 0,this._fillSubscription=void 0,this._material=void 0,this._materialSubscription=void 0,this._outline=void 0,this._outlineSubscription=void 0,this._outlineColor=void 0,this._outlineColorSubscription=void 0,this._outlineWidth=void 0,this._outlineWidthSubscription=void 0,this._numberOfVerticalLines=void 0,this._numberOfVerticalLinesSubscription=void 0,this._slices=void 0,this._slicesSubscription=void 0,this._shadows=void 0,this._shadowsSubscription=void 0,this._distanceDisplayCondition=void 0,this._distanceDisplayConditionSubscription=void 0,this.merge(e??H.EMPTY_OBJECT)}Object.defineProperties(VP.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:me("show"),length:me("length"),topRadius:me("topRadius"),bottomRadius:me("bottomRadius"),heightReference:me("heightReference"),fill:me("fill"),material:fo("material"),outline:me("outline"),outlineColor:me("outlineColor"),outlineWidth:me("outlineWidth"),numberOfVerticalLines:me("numberOfVerticalLines"),slices:me("slices"),shadows:me("shadows"),distanceDisplayCondition:me("distanceDisplayCondition")});VP.prototype.clone=function(e){return l(e)?(e.show=this.show,e.length=this.length,e.topRadius=this.topRadius,e.bottomRadius=this.bottomRadius,e.heightReference=this.heightReference,e.fill=this.fill,e.material=this.material,e.outline=this.outline,e.outlineColor=this.outlineColor,e.outlineWidth=this.outlineWidth,e.numberOfVerticalLines=this.numberOfVerticalLines,e.slices=this.slices,e.shadows=this.shadows,e.distanceDisplayCondition=this.distanceDisplayCondition,e):new VP(this)};VP.prototype.merge=function(e){this.show=this.show??e.show,this.length=this.length??e.length,this.topRadius=this.topRadius??e.topRadius,this.bottomRadius=this.bottomRadius??e.bottomRadius,this.heightReference=this.heightReference??e.heightReference,this.fill=this.fill??e.fill,this.material=this.material??e.material,this.outline=this.outline??e.outline,this.outlineColor=this.outlineColor??e.outlineColor,this.outlineWidth=this.outlineWidth??e.outlineWidth,this.numberOfVerticalLines=this.numberOfVerticalLines??e.numberOfVerticalLines,this.slices=this.slices??e.slices,this.shadows=this.shadows??e.shadows,this.distanceDisplayCondition=this.distanceDisplayCondition??e.distanceDisplayCondition};var fC=VP;function jP(e){this._definitionChanged=new be,this._show=void 0,this._showSubscription=void 0,this._semiMajorAxis=void 0,this._semiMajorAxisSubscription=void 0,this._semiMinorAxis=void 0,this._semiMinorAxisSubscription=void 0,this._height=void 0,this._heightSubscription=void 0,this._heightReference=void 0,this._heightReferenceSubscription=void 0,this._extrudedHeight=void 0,this._extrudedHeightSubscription=void 0,this._extrudedHeightReference=void 0,this._extrudedHeightReferenceSubscription=void 0,this._rotation=void 0,this._rotationSubscription=void 0,this._stRotation=void 0,this._stRotationSubscription=void 0,this._granularity=void 0,this._granularitySubscription=void 0,this._fill=void 0,this._fillSubscription=void 0,this._material=void 0,this._materialSubscription=void 0,this._outline=void 0,this._outlineSubscription=void 0,this._outlineColor=void 0,this._outlineColorSubscription=void 0,this._outlineWidth=void 0,this._outlineWidthSubscription=void 0,this._numberOfVerticalLines=void 0,this._numberOfVerticalLinesSubscription=void 0,this._shadows=void 0,this._shadowsSubscription=void 0,this._distanceDisplayCondition=void 0,this._distanceDisplayConditionSubscription=void 0,this._classificationType=void 0,this._classificationTypeSubscription=void 0,this._zIndex=void 0,this._zIndexSubscription=void 0,this.merge(e??H.EMPTY_OBJECT)}Object.defineProperties(jP.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:me("show"),semiMajorAxis:me("semiMajorAxis"),semiMinorAxis:me("semiMinorAxis"),height:me("height"),heightReference:me("heightReference"),extrudedHeight:me("extrudedHeight"),extrudedHeightReference:me("extrudedHeightReference"),rotation:me("rotation"),stRotation:me("stRotation"),granularity:me("granularity"),fill:me("fill"),material:fo("material"),outline:me("outline"),outlineColor:me("outlineColor"),outlineWidth:me("outlineWidth"),numberOfVerticalLines:me("numberOfVerticalLines"),shadows:me("shadows"),distanceDisplayCondition:me("distanceDisplayCondition"),classificationType:me("classificationType"),zIndex:me("zIndex")});jP.prototype.clone=function(e){return l(e)?(e.show=this.show,e.semiMajorAxis=this.semiMajorAxis,e.semiMinorAxis=this.semiMinorAxis,e.height=this.height,e.heightReference=this.heightReference,e.extrudedHeight=this.extrudedHeight,e.extrudedHeightReference=this.extrudedHeightReference,e.rotation=this.rotation,e.stRotation=this.stRotation,e.granularity=this.granularity,e.fill=this.fill,e.material=this.material,e.outline=this.outline,e.outlineColor=this.outlineColor,e.outlineWidth=this.outlineWidth,e.numberOfVerticalLines=this.numberOfVerticalLines,e.shadows=this.shadows,e.distanceDisplayCondition=this.distanceDisplayCondition,e.classificationType=this.classificationType,e.zIndex=this.zIndex,e):new jP(this)};jP.prototype.merge=function(e){this.show=this.show??e.show,this.semiMajorAxis=this.semiMajorAxis??e.semiMajorAxis,this.semiMinorAxis=this.semiMinorAxis??e.semiMinorAxis,this.height=this.height??e.height,this.heightReference=this.heightReference??e.heightReference,this.extrudedHeight=this.extrudedHeight??e.extrudedHeight,this.extrudedHeightReference=this.extrudedHeightReference??e.extrudedHeightReference,this.rotation=this.rotation??e.rotation,this.stRotation=this.stRotation??e.stRotation,this.granularity=this.granularity??e.granularity,this.fill=this.fill??e.fill,this.material=this.material??e.material,this.outline=this.outline??e.outline,this.outlineColor=this.outlineColor??e.outlineColor,this.outlineWidth=this.outlineWidth??e.outlineWidth,this.numberOfVerticalLines=this.numberOfVerticalLines??e.numberOfVerticalLines,this.shadows=this.shadows??e.shadows,this.distanceDisplayCondition=this.distanceDisplayCondition??e.distanceDisplayCondition,this.classificationType=this.classificationType??e.classificationType,this.zIndex=this.zIndex??e.zIndex};var dC=jP;function HP(e){this._definitionChanged=new be,this._show=void 0,this._showSubscription=void 0,this._radii=void 0,this._radiiSubscription=void 0,this._innerRadii=void 0,this._innerRadiiSubscription=void 0,this._minimumClock=void 0,this._minimumClockSubscription=void 0,this._maximumClock=void 0,this._maximumClockSubscription=void 0,this._minimumCone=void 0,this._minimumConeSubscription=void 0,this._maximumCone=void 0,this._maximumConeSubscription=void 0,this._heightReference=void 0,this._heightReferenceSubscription=void 0,this._fill=void 0,this._fillSubscription=void 0,this._material=void 0,this._materialSubscription=void 0,this._outline=void 0,this._outlineSubscription=void 0,this._outlineColor=void 0,this._outlineColorSubscription=void 0,this._outlineWidth=void 0,this._outlineWidthSubscription=void 0,this._stackPartitions=void 0,this._stackPartitionsSubscription=void 0,this._slicePartitions=void 0,this._slicePartitionsSubscription=void 0,this._subdivisions=void 0,this._subdivisionsSubscription=void 0,this._shadows=void 0,this._shadowsSubscription=void 0,this._distanceDisplayCondition=void 0,this._distanceDisplayConditionSubscription=void 0,this.merge(e??H.EMPTY_OBJECT)}Object.defineProperties(HP.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:me("show"),radii:me("radii"),innerRadii:me("innerRadii"),minimumClock:me("minimumClock"),maximumClock:me("maximumClock"),minimumCone:me("minimumCone"),maximumCone:me("maximumCone"),heightReference:me("heightReference"),fill:me("fill"),material:fo("material"),outline:me("outline"),outlineColor:me("outlineColor"),outlineWidth:me("outlineWidth"),stackPartitions:me("stackPartitions"),slicePartitions:me("slicePartitions"),subdivisions:me("subdivisions"),shadows:me("shadows"),distanceDisplayCondition:me("distanceDisplayCondition")});HP.prototype.clone=function(e){return l(e)?(e.show=this.show,e.radii=this.radii,e.innerRadii=this.innerRadii,e.minimumClock=this.minimumClock,e.maximumClock=this.maximumClock,e.minimumCone=this.minimumCone,e.maximumCone=this.maximumCone,e.heightReference=this.heightReference,e.fill=this.fill,e.material=this.material,e.outline=this.outline,e.outlineColor=this.outlineColor,e.outlineWidth=this.outlineWidth,e.stackPartitions=this.stackPartitions,e.slicePartitions=this.slicePartitions,e.subdivisions=this.subdivisions,e.shadows=this.shadows,e.distanceDisplayCondition=this.distanceDisplayCondition,e):new HP(this)};HP.prototype.merge=function(e){this.show=this.show??e.show,this.radii=this.radii??e.radii,this.innerRadii=this.innerRadii??e.innerRadii,this.minimumClock=this.minimumClock??e.minimumClock,this.maximumClock=this.maximumClock??e.maximumClock,this.minimumCone=this.minimumCone??e.minimumCone,this.maximumCone=this.maximumCone??e.maximumCone,this.heightReference=this.heightReference??e.heightReference,this.fill=this.fill??e.fill,this.material=this.material??e.material,this.outline=this.outline??e.outline,this.outlineColor=this.outlineColor??e.outlineColor,this.outlineWidth=this.outlineWidth??e.outlineWidth,this.stackPartitions=this.stackPartitions??e.stackPartitions,this.slicePartitions=this.slicePartitions??e.slicePartitions,this.subdivisions=this.subdivisions??e.subdivisions,this.shadows=this.shadows??e.shadows,this.distanceDisplayCondition=this.distanceDisplayCondition??e.distanceDisplayCondition};var hC=HP;function GP(e){this._definitionChanged=new be,this._show=void 0,this._showSubscription=void 0,this._text=void 0,this._textSubscription=void 0,this._font=void 0,this._fontSubscription=void 0,this._style=void 0,this._styleSubscription=void 0,this._scale=void 0,this._scaleSubscription=void 0,this._showBackground=void 0,this._showBackgroundSubscription=void 0,this._backgroundColor=void 0,this._backgroundColorSubscription=void 0,this._backgroundPadding=void 0,this._backgroundPaddingSubscription=void 0,this._pixelOffset=void 0,this._pixelOffsetSubscription=void 0,this._eyeOffset=void 0,this._eyeOffsetSubscription=void 0,this._horizontalOrigin=void 0,this._horizontalOriginSubscription=void 0,this._verticalOrigin=void 0,this._verticalOriginSubscription=void 0,this._heightReference=void 0,this._heightReferenceSubscription=void 0,this._fillColor=void 0,this._fillColorSubscription=void 0,this._outlineColor=void 0,this._outlineColorSubscription=void 0,this._outlineWidth=void 0,this._outlineWidthSubscription=void 0,this._translucencyByDistance=void 0,this._translucencyByDistanceSubscription=void 0,this._pixelOffsetScaleByDistance=void 0,this._pixelOffsetScaleByDistanceSubscription=void 0,this._scaleByDistance=void 0,this._scaleByDistanceSubscription=void 0,this._distanceDisplayCondition=void 0,this._distanceDisplayConditionSubscription=void 0,this._disableDepthTestDistance=void 0,this._disableDepthTestDistanceSubscription=void 0,this.merge(e??H.EMPTY_OBJECT)}Object.defineProperties(GP.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:me("show"),text:me("text"),font:me("font"),style:me("style"),scale:me("scale"),showBackground:me("showBackground"),backgroundColor:me("backgroundColor"),backgroundPadding:me("backgroundPadding"),pixelOffset:me("pixelOffset"),eyeOffset:me("eyeOffset"),horizontalOrigin:me("horizontalOrigin"),verticalOrigin:me("verticalOrigin"),heightReference:me("heightReference"),fillColor:me("fillColor"),outlineColor:me("outlineColor"),outlineWidth:me("outlineWidth"),translucencyByDistance:me("translucencyByDistance"),pixelOffsetScaleByDistance:me("pixelOffsetScaleByDistance"),scaleByDistance:me("scaleByDistance"),distanceDisplayCondition:me("distanceDisplayCondition"),disableDepthTestDistance:me("disableDepthTestDistance")});GP.prototype.clone=function(e){return l(e)?(e.show=this.show,e.text=this.text,e.font=this.font,e.style=this.style,e.scale=this.scale,e.showBackground=this.showBackground,e.backgroundColor=this.backgroundColor,e.backgroundPadding=this.backgroundPadding,e.pixelOffset=this.pixelOffset,e.eyeOffset=this.eyeOffset,e.horizontalOrigin=this.horizontalOrigin,e.verticalOrigin=this.verticalOrigin,e.heightReference=this.heightReference,e.fillColor=this.fillColor,e.outlineColor=this.outlineColor,e.outlineWidth=this.outlineWidth,e.translucencyByDistance=this.translucencyByDistance,e.pixelOffsetScaleByDistance=this.pixelOffsetScaleByDistance,e.scaleByDistance=this.scaleByDistance,e.distanceDisplayCondition=this.distanceDisplayCondition,e.disableDepthTestDistance=this.disableDepthTestDistance,e):new GP(this)};GP.prototype.merge=function(e){this.show=this.show??e.show,this.text=this.text??e.text,this.font=this.font??e.font,this.style=this.style??e.style,this.scale=this.scale??e.scale,this.showBackground=this.showBackground??e.showBackground,this.backgroundColor=this.backgroundColor??e.backgroundColor,this.backgroundPadding=this.backgroundPadding??e.backgroundPadding,this.pixelOffset=this.pixelOffset??e.pixelOffset,this.eyeOffset=this.eyeOffset??e.eyeOffset,this.horizontalOrigin=this.horizontalOrigin??e.horizontalOrigin,this.verticalOrigin=this.verticalOrigin??e.verticalOrigin,this.heightReference=this.heightReference??e.heightReference,this.fillColor=this.fillColor??e.fillColor,this.outlineColor=this.outlineColor??e.outlineColor,this.outlineWidth=this.outlineWidth??e.outlineWidth,this.translucencyByDistance=this.translucencyByDistance??e.translucencyByDistance,this.pixelOffsetScaleByDistance=this.pixelOffsetScaleByDistance??e.pixelOffsetScaleByDistance,this.scaleByDistance=this.scaleByDistance??e.scaleByDistance,this.distanceDisplayCondition=this.distanceDisplayCondition??e.distanceDisplayCondition,this.disableDepthTestDistance=this.disableDepthTestDistance??e.disableDepthTestDistance};var rp=GP;var IWe=new h(1,1,1),PWe=h.ZERO,DWe=Le.IDENTITY;function Jme(e,t,n){this.translation=h.clone(e??PWe),this.rotation=Le.clone(t??DWe),this.scale=h.clone(n??IWe)}Jme.prototype.equals=function(e){return this===e||l(e)&&h.equals(this.translation,e.translation)&&Le.equals(this.rotation,e.rotation)&&h.equals(this.scale,e.scale)};var Gb=Jme;var CK=new Gb;function WP(e){e=e??H.EMPTY_OBJECT,this._definitionChanged=new be,this._translation=void 0,this._translationSubscription=void 0,this._rotation=void 0,this._rotationSubscription=void 0,this._scale=void 0,this._scaleSubscription=void 0,this.translation=e.translation,this.rotation=e.rotation,this.scale=e.scale}Object.defineProperties(WP.prototype,{isConstant:{get:function(){return X.isConstant(this._translation)&&X.isConstant(this._rotation)&&X.isConstant(this._scale)}},definitionChanged:{get:function(){return this._definitionChanged}},translation:me("translation"),rotation:me("rotation"),scale:me("scale")});var RWe=new K;WP.prototype.getValue=function(e,t){return l(e)||(e=K.now(RWe)),l(t)||(t=new Gb),t.translation=X.getValueOrClonedDefault(this._translation,e,CK.translation,t.translation),t.rotation=X.getValueOrClonedDefault(this._rotation,e,CK.rotation,t.rotation),t.scale=X.getValueOrClonedDefault(this._scale,e,CK.scale,t.scale),t};WP.prototype.equals=function(e){return this===e||e instanceof WP&&X.equals(this._translation,e._translation)&&X.equals(this._rotation,e._rotation)&&X.equals(this._scale,e._scale)};var mC=WP;function $0(e,t){this._propertyNames=[],this._definitionChanged=new be,l(e)&&this.merge(e,t)}Object.defineProperties($0.prototype,{propertyNames:{get:function(){return this._propertyNames}},isConstant:{get:function(){let e=this._propertyNames;for(let t=0,n=e.length;t<n;t++)if(!X.isConstant(this[e[t]]))return!1;return!0}},definitionChanged:{get:function(){return this._definitionChanged}}});$0.prototype.hasProperty=function(e){return this._propertyNames.indexOf(e)!==-1};function OWe(e){return new hi(e)}$0.prototype.addProperty=function(e,t,n){this._propertyNames.push(e),Object.defineProperty(this,e,me(e,!0,n??OWe)),l(t)&&(this[e]=t),this._definitionChanged.raiseEvent(this)};$0.prototype.removeProperty=function(e){let n=this._propertyNames.indexOf(e);this._propertyNames.splice(n,1),delete this[e],this._definitionChanged.raiseEvent(this)};var MWe=new K;$0.prototype.getValue=function(e,t){l(e)||(e=K.now(MWe)),l(t)||(t={});let n=this._propertyNames;for(let i=0,r=n.length;i<r;i++){let o=n[i];t[o]=X.getValueOrUndefined(this[o],e,t[o])}return t};$0.prototype.merge=function(e,t){let n=this._propertyNames,i=l(e._propertyNames)?e._propertyNames:Object.keys(e);for(let r=0,o=i.length;r<o;r++){let s=i[r],a=this[s],c=e[s];a===void 0&&n.indexOf(s)===-1&&this.addProperty(s,void 0,t),c!==void 0&&(a!==void 0?l(a)&&l(a.merge)&&a.merge(c):l(c)&&l(c.merge)&&l(c.clone)?this[s]=c.clone():this[s]=c)}};function NWe(e,t){let n=e._propertyNames,i=t._propertyNames,r=n.length;if(r!==i.length)return!1;for(let o=0;o<r;++o){let s=n[o];if(i.indexOf(s)===-1||!X.equals(e[s],t[s]))return!1}return!0}$0.prototype.equals=function(e){return this===e||e instanceof $0&&NWe(this,e)};var yu=$0;function Zme(e){return new mC(e)}function LWe(e){return new yu(e,Zme)}function FWe(e){return new yu(e)}function BWe(e){return new yu(e)}function qP(e){this._definitionChanged=new be,this._show=void 0,this._showSubscription=void 0,this._uri=void 0,this._uriSubscription=void 0,this._scale=void 0,this._scaleSubscription=void 0,this._hasVerticalExaggeration=void 0,this._hasVerticalExaggerationSubscription=void 0,this._enableVerticalExaggeration=void 0,this._enableVerticalExaggerationSubscription=void 0,this._minimumPixelSize=void 0,this._minimumPixelSizeSubscription=void 0,this._maximumScale=void 0,this._maximumScaleSubscription=void 0,this._incrementallyLoadTextures=void 0,this._incrementallyLoadTexturesSubscription=void 0,this._runAnimations=void 0,this._runAnimationsSubscription=void 0,this._clampAnimations=void 0,this._clampAnimationsSubscription=void 0,this._shadows=void 0,this._shadowsSubscription=void 0,this._heightReference=void 0,this._heightReferenceSubscription=void 0,this._silhouetteColor=void 0,this._silhouetteColorSubscription=void 0,this._silhouetteSize=void 0,this._silhouetteSizeSubscription=void 0,this._color=void 0,this._colorSubscription=void 0,this._colorBlendMode=void 0,this._colorBlendModeSubscription=void 0,this._colorBlendAmount=void 0,this._colorBlendAmountSubscription=void 0,this._imageBasedLightingFactor=void 0,this._imageBasedLightingFactorSubscription=void 0,this._environmentMapOptions=void 0,this._environmentMapOptionsSubscription=void 0,this._lightColor=void 0,this._lightColorSubscription=void 0,this._distanceDisplayCondition=void 0,this._distanceDisplayConditionSubscription=void 0,this._nodeTransformations=void 0,this._nodeTransformationsSubscription=void 0,this._articulations=void 0,this._articulationsSubscription=void 0,this._clippingPlanes=void 0,this._clippingPlanesSubscription=void 0,this._customShader=void 0,this._customShaderSubscription=void 0,this.merge(e??H.EMPTY_OBJECT)}Object.defineProperties(qP.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:me("show"),uri:me("uri"),scale:me("scale"),enableVerticalExaggeration:me("enableVerticalExaggeration"),minimumPixelSize:me("minimumPixelSize"),maximumScale:me("maximumScale"),incrementallyLoadTextures:me("incrementallyLoadTextures"),runAnimations:me("runAnimations"),clampAnimations:me("clampAnimations"),shadows:me("shadows"),heightReference:me("heightReference"),silhouetteColor:me("silhouetteColor"),silhouetteSize:me("silhouetteSize"),color:me("color"),colorBlendMode:me("colorBlendMode"),colorBlendAmount:me("colorBlendAmount"),imageBasedLightingFactor:me("imageBasedLightingFactor"),environmentMapOptions:me("environmentMapOptions",void 0,BWe),lightColor:me("lightColor"),distanceDisplayCondition:me("distanceDisplayCondition"),nodeTransformations:me("nodeTransformations",void 0,LWe),articulations:me("articulations",void 0,FWe),clippingPlanes:me("clippingPlanes"),customShader:me("customShader")});qP.prototype.clone=function(e){return l(e)?(e.show=this.show,e.uri=this.uri,e.scale=this.scale,e.enableVerticalExaggeration=this.enableVerticalExaggeration,e.minimumPixelSize=this.minimumPixelSize,e.maximumScale=this.maximumScale,e.incrementallyLoadTextures=this.incrementallyLoadTextures,e.runAnimations=this.runAnimations,e.clampAnimations=this.clampAnimations,e.heightReference=this._heightReference,e.silhouetteColor=this.silhouetteColor,e.silhouetteSize=this.silhouetteSize,e.color=this.color,e.colorBlendMode=this.colorBlendMode,e.colorBlendAmount=this.colorBlendAmount,e.imageBasedLightingFactor=this.imageBasedLightingFactor,e.environmentMapOptions=this.environmentMapOptions,e.lightColor=this.lightColor,e.distanceDisplayCondition=this.distanceDisplayCondition,e.nodeTransformations=this.nodeTransformations,e.articulations=this.articulations,e.clippingPlanes=this.clippingPlanes,e.customShader=this.customShader,e):new qP(this)};qP.prototype.merge=function(e){this.show=this.show??e.show,this.uri=this.uri??e.uri,this.scale=this.scale??e.scale,this.enableVerticalExaggeration=this.enableVerticalExaggeration??e.enableVerticalExaggeration,this.minimumPixelSize=this.minimumPixelSize??e.minimumPixelSize,this.maximumScale=this.maximumScale??e.maximumScale,this.incrementallyLoadTextures=this.incrementallyLoadTextures??e.incrementallyLoadTextures,this.runAnimations=this.runAnimations??e.runAnimations,this.clampAnimations=this.clampAnimations??e.clampAnimations,this.shadows=this.shadows??e.shadows,this.heightReference=this.heightReference??e.heightReference,this.silhouetteColor=this.silhouetteColor??e.silhouetteColor,this.silhouetteSize=this.silhouetteSize??e.silhouetteSize,this.color=this.color??e.color,this.colorBlendMode=this.colorBlendMode??e.colorBlendMode,this.colorBlendAmount=this.colorBlendAmount??e.colorBlendAmount,this.imageBasedLightingFactor=this.imageBasedLightingFactor??e.imageBasedLightingFactor,this.environmentMapOptions=this.environmentMapOptions??e.environmentMapOptions,this.lightColor=this.lightColor??e.lightColor,this.distanceDisplayCondition=this.distanceDisplayCondition??e.distanceDisplayCondition,this.clippingPlanes=this.clippingPlanes??e.clippingPlanes,this.customShader=this.customShader??e.customShader;let t=e.nodeTransformations;if(l(t)){let i=this.nodeTransformations;l(i)?i.merge(t):this.nodeTransformations=new yu(t,Zme)}let n=e.articulations;if(l(n)){let i=this.articulations;l(i)?i.merge(n):this.articulations=new yu(n)}};var J_=qP;function YP(e){this._definitionChanged=new be,this._show=void 0,this._showSubscription=void 0,this._uri=void 0,this._uriSubscription=void 0,this._maximumScreenSpaceError=void 0,this._maximumScreenSpaceErrorSubscription=void 0,this.merge(e??H.EMPTY_OBJECT)}Object.defineProperties(YP.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:me("show"),uri:me("uri"),maximumScreenSpaceError:me("maximumScreenSpaceError")});YP.prototype.clone=function(e){return l(e)?(e.show=this.show,e.uri=this.uri,e.maximumScreenSpaceError=this.maximumScreenSpaceError,e):new YP(this)};YP.prototype.merge=function(e){this.show=this.show??e.show,this.uri=this.uri??e.uri,this.maximumScreenSpaceError=this.maximumScreenSpaceError??e.maximumScreenSpaceError};var pC=YP;function XP(e){this._definitionChanged=new be,this._show=void 0,this._showSubscription=void 0,this._leadTime=void 0,this._leadTimeSubscription=void 0,this._trailTime=void 0,this._trailTimeSubscription=void 0,this._width=void 0,this._widthSubscription=void 0,this._resolution=void 0,this._resolutionSubscription=void 0,this._material=void 0,this._materialSubscription=void 0,this._distanceDisplayCondition=void 0,this._distanceDisplayConditionSubscription=void 0,this._relativeTo=void 0,this._relativeToSubscription=void 0,this._materialMode=void 0,this._materialModeSubscription=void 0,this.merge(e??H.EMPTY_OBJECT)}Object.defineProperties(XP.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:me("show"),leadTime:me("leadTime"),trailTime:me("trailTime"),width:me("width"),resolution:me("resolution"),material:fo("material"),distanceDisplayCondition:me("distanceDisplayCondition"),relativeTo:me("relativeTo"),materialMode:me("materialMode")});XP.prototype.clone=function(e){return l(e)?(e.show=this.show,e.leadTime=this.leadTime,e.trailTime=this.trailTime,e.width=this.width,e.resolution=this.resolution,e.material=this.material,e.distanceDisplayCondition=this.distanceDisplayCondition,e.relativeTo=this.relativeTo,e.materialMode=this.materialMode,e):new XP(this)};XP.prototype.merge=function(e){this.show=this.show??e.show,this.leadTime=this.leadTime??e.leadTime,this.trailTime=this.trailTime??e.trailTime,this.width=this.width??e.width,this.resolution=this.resolution??e.resolution,this.material=this.material??e.material,this.distanceDisplayCondition=this.distanceDisplayCondition??e.distanceDisplayCondition,this.relativeTo=this.relativeTo??e.relativeTo,this.materialMode=this.materialMode??e.materialMode};var Z_=XP;function KP(e){this._definitionChanged=new be,this._show=void 0,this._showSubscription=void 0,this._plane=void 0,this._planeSubscription=void 0,this._dimensions=void 0,this._dimensionsSubscription=void 0,this._fill=void 0,this._fillSubscription=void 0,this._material=void 0,this._materialSubscription=void 0,this._outline=void 0,this._outlineSubscription=void 0,this._outlineColor=void 0,this._outlineColorSubscription=void 0,this._outlineWidth=void 0,this._outlineWidthSubscription=void 0,this._shadows=void 0,this._shadowsSubscription=void 0,this._distanceDisplayCondition=void 0,this._distanceDisplayConditionSubscription=void 0,this.merge(e??H.EMPTY_OBJECT)}Object.defineProperties(KP.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:me("show"),plane:me("plane"),dimensions:me("dimensions"),fill:me("fill"),material:fo("material"),outline:me("outline"),outlineColor:me("outlineColor"),outlineWidth:me("outlineWidth"),shadows:me("shadows"),distanceDisplayCondition:me("distanceDisplayCondition")});KP.prototype.clone=function(e){return l(e)?(e.show=this.show,e.plane=this.plane,e.dimensions=this.dimensions,e.fill=this.fill,e.material=this.material,e.outline=this.outline,e.outlineColor=this.outlineColor,e.outlineWidth=this.outlineWidth,e.shadows=this.shadows,e.distanceDisplayCondition=this.distanceDisplayCondition,e):new KP(this)};KP.prototype.merge=function(e){this.show=this.show??e.show,this.plane=this.plane??e.plane,this.dimensions=this.dimensions??e.dimensions,this.fill=this.fill??e.fill,this.material=this.material??e.material,this.outline=this.outline??e.outline,this.outlineColor=this.outlineColor??e.outlineColor,this.outlineWidth=this.outlineWidth??e.outlineWidth,this.shadows=this.shadows??e.shadows,this.distanceDisplayCondition=this.distanceDisplayCondition??e.distanceDisplayCondition};var t3=KP;function $P(e){this._definitionChanged=new be,this._show=void 0,this._showSubscription=void 0,this._pixelSize=void 0,this._pixelSizeSubscription=void 0,this._heightReference=void 0,this._heightReferenceSubscription=void 0,this._color=void 0,this._colorSubscription=void 0,this._outlineColor=void 0,this._outlineColorSubscription=void 0,this._outlineWidth=void 0,this._outlineWidthSubscription=void 0,this._scaleByDistance=void 0,this._scaleByDistanceSubscription=void 0,this._translucencyByDistance=void 0,this._translucencyByDistanceSubscription=void 0,this._distanceDisplayCondition=void 0,this._distanceDisplayConditionSubscription=void 0,this._disableDepthTestDistance=void 0,this._disableDepthTestDistanceSubscription=void 0,this._splitDirection=void 0,this._splitDirectionSubscription=void 0,this.merge(e??H.EMPTY_OBJECT)}Object.defineProperties($P.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:me("show"),pixelSize:me("pixelSize"),heightReference:me("heightReference"),color:me("color"),outlineColor:me("outlineColor"),outlineWidth:me("outlineWidth"),scaleByDistance:me("scaleByDistance"),translucencyByDistance:me("translucencyByDistance"),distanceDisplayCondition:me("distanceDisplayCondition"),disableDepthTestDistance:me("disableDepthTestDistance"),splitDirection:me("splitDirection")});$P.prototype.clone=function(e){return l(e)?(e.show=this.show,e.pixelSize=this.pixelSize,e.heightReference=this.heightReference,e.color=this.color,e.outlineColor=this.outlineColor,e.outlineWidth=this.outlineWidth,e.scaleByDistance=this.scaleByDistance,e.translucencyByDistance=this._translucencyByDistance,e.distanceDisplayCondition=this.distanceDisplayCondition,e.disableDepthTestDistance=this.disableDepthTestDistance,e.splitDirection=this.splitDirection,e):new $P(this)};$P.prototype.merge=function(e){this.show=this.show??e.show,this.pixelSize=this.pixelSize??e.pixelSize,this.heightReference=this.heightReference??e.heightReference,this.color=this.color??e.color,this.outlineColor=this.outlineColor??e.outlineColor,this.outlineWidth=this.outlineWidth??e.outlineWidth,this.scaleByDistance=this.scaleByDistance??e.scaleByDistance,this.translucencyByDistance=this._translucencyByDistance??e.translucencyByDistance,this.distanceDisplayCondition=this.distanceDisplayCondition??e.distanceDisplayCondition,this.disableDepthTestDistance=this.disableDepthTestDistance??e.disableDepthTestDistance,this.splitDirection=this.splitDirection??e.splitDirection};var gC=$P;function kWe(e,t){this.positions=l(e)?e:[],this.holes=l(t)?t:[]}var Wc=kWe;function UWe(e){return Array.isArray(e)&&(e=new Wc(e)),new hi(e)}function JP(e){this._definitionChanged=new be,this._show=void 0,this._showSubscription=void 0,this._hierarchy=void 0,this._hierarchySubscription=void 0,this._height=void 0,this._heightSubscription=void 0,this._heightReference=void 0,this._heightReferenceSubscription=void 0,this._extrudedHeight=void 0,this._extrudedHeightSubscription=void 0,this._extrudedHeightReference=void 0,this._extrudedHeightReferenceSubscription=void 0,this._stRotation=void 0,this._stRotationSubscription=void 0,this._granularity=void 0,this._granularitySubscription=void 0,this._fill=void 0,this._fillSubscription=void 0,this._material=void 0,this._materialSubscription=void 0,this._outline=void 0,this._outlineSubscription=void 0,this._outlineColor=void 0,this._outlineColorSubscription=void 0,this._outlineWidth=void 0,this._outlineWidthSubscription=void 0,this._perPositionHeight=void 0,this._perPositionHeightSubscription=void 0,this._closeTop=void 0,this._closeTopSubscription=void 0,this._closeBottom=void 0,this._closeBottomSubscription=void 0,this._arcType=void 0,this._arcTypeSubscription=void 0,this._shadows=void 0,this._shadowsSubscription=void 0,this._distanceDisplayCondition=void 0,this._distanceDisplayConditionSubscription=void 0,this._classificationType=void 0,this._classificationTypeSubscription=void 0,this._zIndex=void 0,this._zIndexSubscription=void 0,this._textureCoordinates=void 0,this._textureCoordinatesSubscription=void 0,this.merge(e??H.EMPTY_OBJECT)}Object.defineProperties(JP.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:me("show"),hierarchy:me("hierarchy",void 0,UWe),height:me("height"),heightReference:me("heightReference"),extrudedHeight:me("extrudedHeight"),extrudedHeightReference:me("extrudedHeightReference"),stRotation:me("stRotation"),granularity:me("granularity"),fill:me("fill"),material:fo("material"),outline:me("outline"),outlineColor:me("outlineColor"),outlineWidth:me("outlineWidth"),perPositionHeight:me("perPositionHeight"),closeTop:me("closeTop"),closeBottom:me("closeBottom"),arcType:me("arcType"),shadows:me("shadows"),distanceDisplayCondition:me("distanceDisplayCondition"),classificationType:me("classificationType"),zIndex:me("zIndex"),textureCoordinates:me("textureCoordinates")});JP.prototype.clone=function(e){return l(e)?(e.show=this.show,e.hierarchy=this.hierarchy,e.height=this.height,e.heightReference=this.heightReference,e.extrudedHeight=this.extrudedHeight,e.extrudedHeightReference=this.extrudedHeightReference,e.stRotation=this.stRotation,e.granularity=this.granularity,e.fill=this.fill,e.material=this.material,e.outline=this.outline,e.outlineColor=this.outlineColor,e.outlineWidth=this.outlineWidth,e.perPositionHeight=this.perPositionHeight,e.closeTop=this.closeTop,e.closeBottom=this.closeBottom,e.arcType=this.arcType,e.shadows=this.shadows,e.distanceDisplayCondition=this.distanceDisplayCondition,e.classificationType=this.classificationType,e.zIndex=this.zIndex,e.textureCoordinates=this.textureCoordinates,e):new JP(this)};JP.prototype.merge=function(e){this.show=this.show??e.show,this.hierarchy=this.hierarchy??e.hierarchy,this.height=this.height??e.height,this.heightReference=this.heightReference??e.heightReference,this.extrudedHeight=this.extrudedHeight??e.extrudedHeight,this.extrudedHeightReference=this.extrudedHeightReference??e.extrudedHeightReference,this.stRotation=this.stRotation??e.stRotation,this.granularity=this.granularity??e.granularity,this.fill=this.fill??e.fill,this.material=this.material??e.material,this.outline=this.outline??e.outline,this.outlineColor=this.outlineColor??e.outlineColor,this.outlineWidth=this.outlineWidth??e.outlineWidth,this.perPositionHeight=this.perPositionHeight??e.perPositionHeight,this.closeTop=this.closeTop??e.closeTop,this.closeBottom=this.closeBottom??e.closeBottom,this.arcType=this.arcType??e.arcType,this.shadows=this.shadows??e.shadows,this.distanceDisplayCondition=this.distanceDisplayCondition??e.distanceDisplayCondition,this.classificationType=this.classificationType??e.classificationType,this.zIndex=this.zIndex??e.zIndex,this.textureCoordinates=this.textureCoordinates??e.textureCoordinates};var op=JP;function ZP(e){this._definitionChanged=new be,this._show=void 0,this._showSubscription=void 0,this._positions=void 0,this._positionsSubscription=void 0,this._width=void 0,this._widthSubscription=void 0,this._granularity=void 0,this._granularitySubscription=void 0,this._material=void 0,this._materialSubscription=void 0,this._depthFailMaterial=void 0,this._depthFailMaterialSubscription=void 0,this._arcType=void 0,this._arcTypeSubscription=void 0,this._clampToGround=void 0,this._clampToGroundSubscription=void 0,this._shadows=void 0,this._shadowsSubscription=void 0,this._distanceDisplayCondition=void 0,this._distanceDisplayConditionSubscription=void 0,this._classificationType=void 0,this._classificationTypeSubscription=void 0,this._zIndex=void 0,this._zIndexSubscription=void 0,this.merge(e??H.EMPTY_OBJECT)}Object.defineProperties(ZP.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:me("show"),positions:me("positions"),width:me("width"),granularity:me("granularity"),material:fo("material"),depthFailMaterial:fo("depthFailMaterial"),arcType:me("arcType"),clampToGround:me("clampToGround"),shadows:me("shadows"),distanceDisplayCondition:me("distanceDisplayCondition"),classificationType:me("classificationType"),zIndex:me("zIndex")});ZP.prototype.clone=function(e){return l(e)?(e.show=this.show,e.positions=this.positions,e.width=this.width,e.granularity=this.granularity,e.material=this.material,e.depthFailMaterial=this.depthFailMaterial,e.arcType=this.arcType,e.clampToGround=this.clampToGround,e.shadows=this.shadows,e.distanceDisplayCondition=this.distanceDisplayCondition,e.classificationType=this.classificationType,e.zIndex=this.zIndex,e):new ZP(this)};ZP.prototype.merge=function(e){this.show=this.show??e.show,this.positions=this.positions??e.positions,this.width=this.width??e.width,this.granularity=this.granularity??e.granularity,this.material=this.material??e.material,this.depthFailMaterial=this.depthFailMaterial??e.depthFailMaterial,this.arcType=this.arcType??e.arcType,this.clampToGround=this.clampToGround??e.clampToGround,this.shadows=this.shadows??e.shadows,this.distanceDisplayCondition=this.distanceDisplayCondition??e.distanceDisplayCondition,this.classificationType=this.classificationType??e.classificationType,this.zIndex=this.zIndex??e.zIndex};var Ml=ZP;function QP(e){this._definitionChanged=new be,this._show=void 0,this._showSubscription=void 0,this._positions=void 0,this._positionsSubscription=void 0,this._shape=void 0,this._shapeSubscription=void 0,this._cornerType=void 0,this._cornerTypeSubscription=void 0,this._granularity=void 0,this._granularitySubscription=void 0,this._fill=void 0,this._fillSubscription=void 0,this._material=void 0,this._materialSubscription=void 0,this._outline=void 0,this._outlineSubscription=void 0,this._outlineColor=void 0,this._outlineColorSubscription=void 0,this._outlineWidth=void 0,this._outlineWidthSubscription=void 0,this._shadows=void 0,this._shadowsSubscription=void 0,this._distanceDisplayCondition=void 0,this._distanceDisplayConditionSubsription=void 0,this.merge(e??H.EMPTY_OBJECT)}Object.defineProperties(QP.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:me("show"),positions:me("positions"),shape:me("shape"),cornerType:me("cornerType"),granularity:me("granularity"),fill:me("fill"),material:fo("material"),outline:me("outline"),outlineColor:me("outlineColor"),outlineWidth:me("outlineWidth"),shadows:me("shadows"),distanceDisplayCondition:me("distanceDisplayCondition")});QP.prototype.clone=function(e){return l(e)?(e.show=this.show,e.positions=this.positions,e.shape=this.shape,e.cornerType=this.cornerType,e.granularity=this.granularity,e.fill=this.fill,e.material=this.material,e.outline=this.outline,e.outlineColor=this.outlineColor,e.outlineWidth=this.outlineWidth,e.shadows=this.shadows,e.distanceDisplayCondition=this.distanceDisplayCondition,e):new QP(this)};QP.prototype.merge=function(e){this.show=this.show??e.show,this.positions=this.positions??e.positions,this.shape=this.shape??e.shape,this.cornerType=this.cornerType??e.cornerType,this.granularity=this.granularity??e.granularity,this.fill=this.fill??e.fill,this.material=this.material??e.material,this.outline=this.outline??e.outline,this.outlineColor=this.outlineColor??e.outlineColor,this.outlineWidth=this.outlineWidth??e.outlineWidth,this.shadows=this.shadows??e.shadows,this.distanceDisplayCondition=this.distanceDisplayCondition??e.distanceDisplayCondition};var _C=QP;function eD(e){this._definitionChanged=new be,this._show=void 0,this._showSubscription=void 0,this._coordinates=void 0,this._coordinatesSubscription=void 0,this._height=void 0,this._heightSubscription=void 0,this._heightReference=void 0,this._heightReferenceSubscription=void 0,this._extrudedHeight=void 0,this._extrudedHeightSubscription=void 0,this._extrudedHeightReference=void 0,this._extrudedHeightReferenceSubscription=void 0,this._rotation=void 0,this._rotationSubscription=void 0,this._stRotation=void 0,this._stRotationSubscription=void 0,this._granularity=void 0,this._granularitySubscription=void 0,this._fill=void 0,this._fillSubscription=void 0,this._material=void 0,this._materialSubscription=void 0,this._outline=void 0,this._outlineSubscription=void 0,this._outlineColor=void 0,this._outlineColorSubscription=void 0,this._outlineWidth=void 0,this._outlineWidthSubscription=void 0,this._shadows=void 0,this._shadowsSubscription=void 0,this._distanceDisplayCondition=void 0,this._distancedisplayConditionSubscription=void 0,this._classificationType=void 0,this._classificationTypeSubscription=void 0,this._zIndex=void 0,this._zIndexSubscription=void 0,this.merge(e??H.EMPTY_OBJECT)}Object.defineProperties(eD.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:me("show"),coordinates:me("coordinates"),height:me("height"),heightReference:me("heightReference"),extrudedHeight:me("extrudedHeight"),extrudedHeightReference:me("extrudedHeightReference"),rotation:me("rotation"),stRotation:me("stRotation"),granularity:me("granularity"),fill:me("fill"),material:fo("material"),outline:me("outline"),outlineColor:me("outlineColor"),outlineWidth:me("outlineWidth"),shadows:me("shadows"),distanceDisplayCondition:me("distanceDisplayCondition"),classificationType:me("classificationType"),zIndex:me("zIndex")});eD.prototype.clone=function(e){return l(e)?(e.show=this.show,e.coordinates=this.coordinates,e.height=this.height,e.heightReference=this.heightReference,e.extrudedHeight=this.extrudedHeight,e.extrudedHeightReference=this.extrudedHeightReference,e.rotation=this.rotation,e.stRotation=this.stRotation,e.granularity=this.granularity,e.fill=this.fill,e.material=this.material,e.outline=this.outline,e.outlineColor=this.outlineColor,e.outlineWidth=this.outlineWidth,e.shadows=this.shadows,e.distanceDisplayCondition=this.distanceDisplayCondition,e.classificationType=this.classificationType,e.zIndex=this.zIndex,e):new eD(this)};eD.prototype.merge=function(e){this.show=this.show??e.show,this.coordinates=this.coordinates??e.coordinates,this.height=this.height??e.height,this.heightReference=this.heightReference??e.heightReference,this.extrudedHeight=this.extrudedHeight??e.extrudedHeight,this.extrudedHeightReference=this.extrudedHeightReference??e.extrudedHeightReference,this.rotation=this.rotation??e.rotation,this.stRotation=this.stRotation??e.stRotation,this.granularity=this.granularity??e.granularity,this.fill=this.fill??e.fill,this.material=this.material??e.material,this.outline=this.outline??e.outline,this.outlineColor=this.outlineColor??e.outlineColor,this.outlineWidth=this.outlineWidth??e.outlineWidth,this.shadows=this.shadows??e.shadows,this.distanceDisplayCondition=this.distanceDisplayCondition??e.distanceDisplayCondition,this.classificationType=this.classificationType??e.classificationType,this.zIndex=this.zIndex??e.zIndex};var sp=eD;function tD(e){this._definitionChanged=new be,this._show=void 0,this._showSubscription=void 0,this._positions=void 0,this._positionsSubscription=void 0,this._minimumHeights=void 0,this._minimumHeightsSubscription=void 0,this._maximumHeights=void 0,this._maximumHeightsSubscription=void 0,this._granularity=void 0,this._granularitySubscription=void 0,this._fill=void 0,this._fillSubscription=void 0,this._material=void 0,this._materialSubscription=void 0,this._outline=void 0,this._outlineSubscription=void 0,this._outlineColor=void 0,this._outlineColorSubscription=void 0,this._outlineWidth=void 0,this._outlineWidthSubscription=void 0,this._shadows=void 0,this._shadowsSubscription=void 0,this._distanceDisplayCondition=void 0,this._distanceDisplayConditionSubscription=void 0,this.merge(e??H.EMPTY_OBJECT)}Object.defineProperties(tD.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},show:me("show"),positions:me("positions"),minimumHeights:me("minimumHeights"),maximumHeights:me("maximumHeights"),granularity:me("granularity"),fill:me("fill"),material:fo("material"),outline:me("outline"),outlineColor:me("outlineColor"),outlineWidth:me("outlineWidth"),shadows:me("shadows"),distanceDisplayCondition:me("distanceDisplayCondition")});tD.prototype.clone=function(e){return l(e)?(e.show=this.show,e.positions=this.positions,e.minimumHeights=this.minimumHeights,e.maximumHeights=this.maximumHeights,e.granularity=this.granularity,e.fill=this.fill,e.material=this.material,e.outline=this.outline,e.outlineColor=this.outlineColor,e.outlineWidth=this.outlineWidth,e.shadows=this.shadows,e.distanceDisplayCondition=this.distanceDisplayCondition,e):new tD(this)};tD.prototype.merge=function(e){this.show=this.show??e.show,this.positions=this.positions??e.positions,this.minimumHeights=this.minimumHeights??e.minimumHeights,this.maximumHeights=this.maximumHeights??e.maximumHeights,this.granularity=this.granularity??e.granularity,this.fill=this.fill??e.fill,this.material=this.material??e.material,this.outline=this.outline??e.outline,this.outlineColor=this.outlineColor??e.outlineColor,this.outlineWidth=this.outlineWidth??e.outlineWidth,this.shadows=this.shadows??e.shadows,this.distanceDisplayCondition=this.distanceDisplayCondition??e.distanceDisplayCondition};var Q_=tD;var zWe=new he,vK=[];function VWe(e){return new gu(e)}function jWe(e){return me(e,void 0,VWe)}function Pa(e,t){return me(e,void 0,function(n){return n instanceof t?n:new t(n)})}function hd(e){e=e??H.EMPTY_OBJECT;let t=e.id;l(t)||(t=Kn()),this._availability=void 0,this._id=t,this._definitionChanged=new be,this._name=e.name,this._show=e.show??!0,this._trackingReferenceFrame=e.trackingReferenceFrame??K_.AUTODETECT,this._parent=void 0,this._propertyNames=["billboard","box","corridor","cylinder","description","ellipse","ellipsoid","label","model","tileset","orientation","path","plane","point","polygon","polyline","polylineVolume","position","properties","rectangle","viewFrom","wall",...vK],this._billboard=void 0,this._billboardSubscription=void 0,this._box=void 0,this._boxSubscription=void 0,this._corridor=void 0,this._corridorSubscription=void 0,this._cylinder=void 0,this._cylinderSubscription=void 0,this._description=void 0,this._descriptionSubscription=void 0,this._ellipse=void 0,this._ellipseSubscription=void 0,this._ellipsoid=void 0,this._ellipsoidSubscription=void 0,this._label=void 0,this._labelSubscription=void 0,this._model=void 0,this._modelSubscription=void 0,this._tileset=void 0,this._tilesetSubscription=void 0,this._orientation=void 0,this._orientationSubscription=void 0,this._path=void 0,this._pathSubscription=void 0,this._plane=void 0,this._planeSubscription=void 0,this._point=void 0,this._pointSubscription=void 0,this._polygon=void 0,this._polygonSubscription=void 0,this._polyline=void 0,this._polylineSubscription=void 0,this._polylineVolume=void 0,this._polylineVolumeSubscription=void 0,this._position=void 0,this._positionSubscription=void 0,this._properties=void 0,this._propertiesSubscription=void 0,this._rectangle=void 0,this._rectangleSubscription=void 0,this._viewFrom=void 0,this._viewFromSubscription=void 0,this._wall=void 0,this._wallSubscription=void 0,this._children=[],this.entityCollection=void 0,this.parent=e.parent,this.merge(e)}function SK(e,t,n){let i=t.length;for(let r=0;r<i;r++){let o=t[r],s=o._show;(!n&&s)!==(n&&s)&&SK(o,o._children,n)}e._definitionChanged.raiseEvent(e,"isShowing",n,!n)}Object.defineProperties(hd.prototype,{availability:_u("availability"),id:{get:function(){return this._id}},definitionChanged:{get:function(){return this._definitionChanged}},name:_u("name"),show:{get:function(){return this._show},set:function(e){if(e===this._show)return;let t=this.isShowing;this._show=e;let n=this.isShowing;t!==n&&SK(this,this._children,n),this._definitionChanged.raiseEvent(this,"show",e,!e)}},trackingReferenceFrame:_u("trackingReferenceFrame"),isShowing:{get:function(){return this._show&&(!l(this.entityCollection)||this.entityCollection.show)&&(!l(this._parent)||this._parent.isShowing)}},parent:{get:function(){return this._parent},set:function(e){let t=this._parent;if(t===e)return;let n=this.isShowing;if(l(t)){let r=t._children.indexOf(this);t._children.splice(r,1)}this._parent=e,l(e)&&e._children.push(this);let i=this.isShowing;n!==i&&SK(this,this._children,i),this._definitionChanged.raiseEvent(this,"parent",e,t)}},propertyNames:{get:function(){return this._propertyNames}},billboard:Pa("billboard",Ol),box:Pa("box",cC),corridor:Pa("corridor",uC),cylinder:Pa("cylinder",fC),description:me("description"),ellipse:Pa("ellipse",dC),ellipsoid:Pa("ellipsoid",hC),label:Pa("label",rp),model:Pa("model",J_),tileset:Pa("tileset",pC),orientation:me("orientation"),path:Pa("path",Z_),plane:Pa("plane",t3),point:Pa("point",gC),polygon:Pa("polygon",op),polyline:Pa("polyline",Ml),polylineVolume:Pa("polylineVolume",_C),properties:Pa("properties",yu),position:jWe("position"),rectangle:Pa("rectangle",sp),viewFrom:me("viewFrom"),wall:Pa("wall",Q_)});hd.registerEntityType=function(e,t){Object.defineProperties(hd.prototype,{[e]:Pa(e,t)}),vK.includes(e)||vK.push(e)};hd.prototype.isAvailable=function(e){let t=this._availability;return!l(t)||t.contains(e)};hd.prototype.addProperty=function(e){this._propertyNames.push(e),Object.defineProperty(this,e,_u(e,!0))};hd.prototype.removeProperty=function(e){let n=this._propertyNames.indexOf(e);this._propertyNames.splice(n,1),delete this[e]};hd.prototype.merge=function(e){this.name=this.name??e.name,this.availability=this.availability??e.availability;let t=this._propertyNames,n=l(e._propertyNames)?e._propertyNames:Object.keys(e),i=n.length;for(let r=0;r<i;r++){let o=n[r];if(o==="parent"||o==="name"||o==="availability"||o==="children")continue;let s=this[o],a=e[o];!l(s)&&t.indexOf(o)===-1&&this.addProperty(o),l(a)&&(l(s)?l(s.merge)&&s.merge(a):l(a.merge)&&l(a.clone)?this[o]=a.clone():this[o]=a)}};var Qme=new $,epe=new h,tpe=new Le;hd.prototype.computeModelMatrix=function(e,t){let n=X.getValueOrUndefined(this._position,e,epe);if(!l(n))return;let i=X.getValueOrUndefined(this._orientation,e,tpe);return l(i)?t=M.fromRotationTranslation($.fromQuaternion(i,Qme),n,t):t=At.eastNorthUpToFixedFrame(n,void 0,t),t};hd.prototype.computeModelMatrixForHeightReference=function(e,t,n,i,r){let o=X.getValueOrDefault(t,e,We.NONE),s=X.getValueOrUndefined(this._position,e,epe);if(o===We.NONE||!l(s)||h.equalsEpsilon(s,h.ZERO,P.EPSILON8))return this.computeModelMatrix(e,r);let a=i.cartesianToCartographic(s,zWe);o===We.CLIP_TO_GROUND?a.height<n&&(a.height=n):fs(o)?a.height=n:a.height+=n,s=i.cartographicToCartesian(a,s);let c=X.getValueOrUndefined(this._orientation,e,tpe);return l(c)?r=M.fromRotationTranslation($.fromQuaternion(c,Qme),s,r):r=At.eastNorthUpToFixedFrame(s,void 0,r),r};hd.supportsMaterialsforEntitiesOnTerrain=function(e){return pu.supportsMaterials(e)};hd.supportsPolylinesOnTerrain=function(e){return $m.isSupported(e)};var Qr=hd;var npe={id:void 0};function nD(e){if(e._firing){e._refire=!0;return}if(e._suspendCount===0){let t=e._addedEntities,n=e._removedEntities,i=e._changedEntities;if(i.length!==0||t.length!==0||n.length!==0){e._firing=!0;do{e._refire=!1;let r=t.values.slice(0),o=n.values.slice(0),s=i.values.slice(0);t.removeAll(),n.removeAll(),i.removeAll(),e._collectionChanged.raiseEvent(e,r,o,s)}while(e._refire);e._firing=!1}}}function qc(e){this._owner=e,this._entities=new zt,this._addedEntities=new zt,this._removedEntities=new zt,this._changedEntities=new zt,this._suspendCount=0,this._collectionChanged=new be,this._id=Kn(),this._show=!0,this._firing=!1,this._refire=!1}qc.prototype.suspendEvents=function(){this._suspendCount++};qc.prototype.resumeEvents=function(){this._suspendCount--,nD(this)};Object.defineProperties(qc.prototype,{collectionChanged:{get:function(){return this._collectionChanged}},id:{get:function(){return this._id}},values:{get:function(){return this._entities.values}},show:{get:function(){return this._show},set:function(e){if(e===this._show)return;this.suspendEvents();let t,n=[],i=this._entities.values,r=i.length;for(t=0;t<r;t++)n.push(i[t].isShowing);for(this._show=e,t=0;t<r;t++){let o=n[t],s=i[t];o!==s.isShowing&&s.definitionChanged.raiseEvent(s,"isShowing",s.isShowing,o)}this.resumeEvents()}},owner:{get:function(){return this._owner}}});qc.prototype.computeAvailability=function(){let e=it.MAXIMUM_VALUE,t=it.MINIMUM_VALUE,n=this._entities.values;for(let i=0,r=n.length;i<r;i++){let s=n[i].availability;if(l(s)){let a=s.start,c=s.stop;K.lessThan(a,e)&&!a.equals(it.MINIMUM_VALUE)&&(e=a),K.greaterThan(c,t)&&!c.equals(it.MAXIMUM_VALUE)&&(t=c)}}return it.MAXIMUM_VALUE.equals(e)&&(e=it.MINIMUM_VALUE),it.MINIMUM_VALUE.equals(t)&&(t=it.MAXIMUM_VALUE),new Cn({start:e,stop:t})};qc.prototype.add=function(e){e instanceof Qr||(e=new Qr(e));let t=e.id,n=this._entities;if(n.contains(t))throw new pe(`An entity with id ${t} already exists in this collection.`);return e.entityCollection=this,n.set(t,e),this._removedEntities.remove(t)||this._addedEntities.set(t,e),e.definitionChanged.addEventListener(qc.prototype._onEntityDefinitionChanged,this),nD(this),e};qc.prototype.remove=function(e){return l(e)?this.removeById(e.id):!1};qc.prototype.contains=function(e){return this._entities.get(e.id)===e};qc.prototype.removeById=function(e){if(!l(e))return!1;let n=this._entities.get(e);return this._entities.remove(e)?(this._addedEntities.remove(e)||(this._removedEntities.set(e,n),this._changedEntities.remove(e)),this._entities.remove(e),n.definitionChanged.removeEventListener(qc.prototype._onEntityDefinitionChanged,this),nD(this),!0):!1};qc.prototype.removeAll=function(){let e=this._entities,t=e.length,n=e.values,i=this._addedEntities,r=this._removedEntities;for(let o=0;o<t;o++){let s=n[o],a=s.id,c=i.get(a);l(c)||(s.definitionChanged.removeEventListener(qc.prototype._onEntityDefinitionChanged,this),r.set(a,s))}e.removeAll(),i.removeAll(),this._changedEntities.removeAll(),nD(this)};qc.prototype.getById=function(e){return this._entities.get(e)};qc.prototype.getOrCreateEntity=function(e){let t=this._entities.get(e);return l(t)||(npe.id=e,t=new Qr(npe),this.add(t)),t};qc.prototype._onEntityDefinitionChanged=function(e){let t=e.id;this._addedEntities.contains(t)||this._changedEntities.set(t,e),nD(this)};var Ja=qc;function wK(e){this._name=e,this._clock=void 0,this._changed=new be,this._error=new be,this._isLoading=!1,this._loading=new be,this._entityCollection=new Ja(this),this._entityCluster=new dd}Object.defineProperties(wK.prototype,{name:{get:function(){return this._name},set:function(e){this._name!==e&&(this._name=e,this._changed.raiseEvent(this))}},clock:{get:function(){return this._clock},set:function(e){this._clock!==e&&(this._clock=e,this._changed.raiseEvent(this))}},entities:{get:function(){return this._entityCollection}},isLoading:{get:function(){return this._isLoading},set:function(e){Ps.setLoading(this,e)}},changedEvent:{get:function(){return this._changed}},errorEvent:{get:function(){return this._error}},loadingEvent:{get:function(){return this._loading}},show:{get:function(){return this._entityCollection.show},set:function(e){this._entityCollection.show=e}},clustering:{get:function(){return this._entityCluster},set:function(e){this._entityCluster=e}}});wK.prototype.update=function(e){return!0};var n3=wK;var i3=`in vec3 v_positionEC; +in vec3 v_normalEC; +in vec3 v_tangentEC; +in vec3 v_bitangentEC; +in vec2 v_st; +void main() +{ +vec3 positionToEyeEC = -v_positionEC; +mat3 tangentToEyeMatrix = czm_tangentToEyeSpaceMatrix(v_normalEC, v_tangentEC, v_bitangentEC); +vec3 normalEC = normalize(v_normalEC); +#ifdef FACE_FORWARD +normalEC = faceforward(normalEC, vec3(0.0, 0.0, 1.0), -normalEC); +#endif +czm_materialInput materialInput; +materialInput.normalEC = normalEC; +materialInput.tangentToEyeMatrix = tangentToEyeMatrix; +materialInput.positionToEyeEC = positionToEyeEC; +materialInput.st = v_st; +czm_material material = czm_getMaterial(materialInput); +#ifdef FLAT +out_FragColor = vec4(material.diffuse + material.emission, material.alpha); +#else +out_FragColor = czm_phong(normalize(positionToEyeEC), material, czm_lightDirectionEC); +#endif +} +`;var r3=`in vec3 position3DHigh; +in vec3 position3DLow; +in vec3 normal; +in vec3 tangent; +in vec3 bitangent; +in vec2 st; +in float batchId; +out vec3 v_positionEC; +out vec3 v_normalEC; +out vec3 v_tangentEC; +out vec3 v_bitangentEC; +out vec2 v_st; +void main() +{ +vec4 p = czm_computePosition(); +v_positionEC = (czm_modelViewRelativeToEye * p).xyz; +v_normalEC = czm_normal * normal; +v_tangentEC = czm_normal * tangent; +v_bitangentEC = czm_normal * bitangent; +v_st = st; +gl_Position = czm_modelViewProjectionRelativeToEye * p; +} +`;var o3=`in vec3 v_positionEC; +in vec3 v_normalEC; +void main() +{ +vec3 positionToEyeEC = -v_positionEC; +vec3 normalEC = normalize(v_normalEC); +#ifdef FACE_FORWARD +normalEC = faceforward(normalEC, vec3(0.0, 0.0, 1.0), -normalEC); +#endif +czm_materialInput materialInput; +materialInput.normalEC = normalEC; +materialInput.positionToEyeEC = positionToEyeEC; +czm_material material = czm_getMaterial(materialInput); +#ifdef FLAT +out_FragColor = vec4(material.diffuse + material.emission, material.alpha); +#else +out_FragColor = czm_phong(normalize(positionToEyeEC), material, czm_lightDirectionEC); +#endif +} +`;var s3=`in vec3 position3DHigh; +in vec3 position3DLow; +in vec3 normal; +in float batchId; +out vec3 v_positionEC; +out vec3 v_normalEC; +void main() { - return ${r}; +vec4 p = czm_computePosition(); +v_positionEC = (czm_modelViewRelativeToEye * p).xyz; +v_normalEC = czm_normal * normal; +gl_Position = czm_modelViewProjectionRelativeToEye * p; } -`,r};Ch.prototype.getShaderExpression=function(e,t){return this._runtimeAst.getShaderExpression(e,t)};Ch.prototype.getVariables=function(){let e=[];return this._runtimeAst.getVariables(e),e=e.filter(function(t,n,i){return i.indexOf(t)===n}),e};var BWe=["!","-","+"],cme=["+","-","*","/","%","===","!==",">",">=","<","<=","&&","||","!~","=~"],nD=/\${(.*?)}/g,kWe=/\\/g,UWe="@#%",zWe=/@#%/g,r3=new z,o3={abs:Da(Math.abs),sqrt:Da(Math.sqrt),cos:Da(Math.cos),sin:Da(Math.sin),tan:Da(Math.tan),acos:Da(Math.acos),asin:Da(Math.asin),atan:Da(Math.atan),radians:Da(P.toRadians),degrees:Da(P.toDegrees),sign:Da(P.sign),floor:Da(Math.floor),ceil:Da(Math.ceil),round:Da(Math.round),exp:Da(Math.exp),exp2:Da(jWe),log:Da(Math.log),log2:Da(HWe),fract:Da(VWe),length:GWe,normalize:WWe},s3={atan2:n3(Math.atan2,!1),pow:n3(Math.pow,!1),min:n3(Math.min,!0),max:n3(Math.max,!0),distance:qWe,dot:YWe,cross:XWe},yK={clamp:lme(P.clamp,!0),mix:lme(P.lerp,!0)};function VWe(e){return e-Math.floor(e)}function jWe(e){return Math.pow(2,e)}function HWe(e){return P.log2(e)}function Da(e){return function(t,n){if(typeof n=="number")return e(n);if(n instanceof U)return U.fromElements(e(n.x),e(n.y),Bn.getCartesian2());if(n instanceof h)return h.fromElements(e(n.x),e(n.y),e(n.z),Bn.getCartesian3());if(n instanceof se)return se.fromElements(e(n.x),e(n.y),e(n.z),e(n.w),Bn.getCartesian4());throw new oe(`Function "${t}" requires a vector or number argument. Argument is ${n}.`)}}function n3(e,t){return function(n,i,r){if(t&&typeof r=="number"){if(typeof i=="number")return e(i,r);if(i instanceof U)return U.fromElements(e(i.x,r),e(i.y,r),Bn.getCartesian2());if(i instanceof h)return h.fromElements(e(i.x,r),e(i.y,r),e(i.z,r),Bn.getCartesian3());if(i instanceof se)return se.fromElements(e(i.x,r),e(i.y,r),e(i.z,r),e(i.w,r),Bn.getCartesian4())}if(typeof i=="number"&&typeof r=="number")return e(i,r);if(i instanceof U&&r instanceof U)return U.fromElements(e(i.x,r.x),e(i.y,r.y),Bn.getCartesian2());if(i instanceof h&&r instanceof h)return h.fromElements(e(i.x,r.x),e(i.y,r.y),e(i.z,r.z),Bn.getCartesian3());if(i instanceof se&&r instanceof se)return se.fromElements(e(i.x,r.x),e(i.y,r.y),e(i.z,r.z),e(i.w,r.w),Bn.getCartesian4());throw new oe(`Function "${n}" requires vector or number arguments of matching types. Arguments are ${i} and ${r}.`)}}function lme(e,t){return function(n,i,r,o){if(t&&typeof o=="number"){if(typeof i=="number"&&typeof r=="number")return e(i,r,o);if(i instanceof U&&r instanceof U)return U.fromElements(e(i.x,r.x,o),e(i.y,r.y,o),Bn.getCartesian2());if(i instanceof h&&r instanceof h)return h.fromElements(e(i.x,r.x,o),e(i.y,r.y,o),e(i.z,r.z,o),Bn.getCartesian3());if(i instanceof se&&r instanceof se)return se.fromElements(e(i.x,r.x,o),e(i.y,r.y,o),e(i.z,r.z,o),e(i.w,r.w,o),Bn.getCartesian4())}if(typeof i=="number"&&typeof r=="number"&&typeof o=="number")return e(i,r,o);if(i instanceof U&&r instanceof U&&o instanceof U)return U.fromElements(e(i.x,r.x,o.x),e(i.y,r.y,o.y),Bn.getCartesian2());if(i instanceof h&&r instanceof h&&o instanceof h)return h.fromElements(e(i.x,r.x,o.x),e(i.y,r.y,o.y),e(i.z,r.z,o.z),Bn.getCartesian3());if(i instanceof se&&r instanceof se&&o instanceof se)return se.fromElements(e(i.x,r.x,o.x),e(i.y,r.y,o.y),e(i.z,r.z,o.z),e(i.w,r.w,o.w),Bn.getCartesian4());throw new oe(`Function "${n}" requires vector or number arguments of matching types. Arguments are ${i}, ${r}, and ${o}.`)}}function GWe(e,t){if(typeof t=="number")return Math.abs(t);if(t instanceof U)return U.magnitude(t);if(t instanceof h)return h.magnitude(t);if(t instanceof se)return se.magnitude(t);throw new oe(`Function "${e}" requires a vector or number argument. Argument is ${t}.`)}function WWe(e,t){if(typeof t=="number")return 1;if(t instanceof U)return U.normalize(t,Bn.getCartesian2());if(t instanceof h)return h.normalize(t,Bn.getCartesian3());if(t instanceof se)return se.normalize(t,Bn.getCartesian4());throw new oe(`Function "${e}" requires a vector or number argument. Argument is ${t}.`)}function qWe(e,t,n){if(typeof t=="number"&&typeof n=="number")return Math.abs(t-n);if(t instanceof U&&n instanceof U)return U.distance(t,n);if(t instanceof h&&n instanceof h)return h.distance(t,n);if(t instanceof se&&n instanceof se)return se.distance(t,n);throw new oe(`Function "${e}" requires vector or number arguments of matching types. Arguments are ${t} and ${n}.`)}function YWe(e,t,n){if(typeof t=="number"&&typeof n=="number")return t*n;if(t instanceof U&&n instanceof U)return U.dot(t,n);if(t instanceof h&&n instanceof h)return h.dot(t,n);if(t instanceof se&&n instanceof se)return se.dot(t,n);throw new oe(`Function "${e}" requires vector or number arguments of matching types. Arguments are ${t} and ${n}.`)}function XWe(e,t,n){if(t instanceof h&&n instanceof h)return h.cross(t,n,Bn.getCartesian3());throw new oe(`Function "${e}" requires vec3 arguments. Arguments are ${t} and ${n}.`)}function Lt(e,t,n,i,r){this._type=e,this._value=t,this._left=n,this._right=i,this._test=r,this.evaluate=void 0,aqe(this)}function KWe(e,t){if(!l(t))return e;for(let n in t)if(t.hasOwnProperty(n)){let i=new RegExp(`\\$\\{${n}\\}`,"g"),r=`(${t[n]})`;l(r)&&(e=e.replace(i,r))}return e}function $We(e){return e.replace(kWe,UWe)}function _K(e){return e.replace(zWe,"\\")}function JWe(e){let t=e,n="",i=t.indexOf("${");for(;i>=0;){let r=t.indexOf("'"),o=t.indexOf('"'),s;if(r>=0&&r<i)s=t.indexOf("'",r+1),n+=t.substr(0,s+1),t=t.substr(s+1),i=t.indexOf("${");else if(o>=0&&o<i)s=t.indexOf('"',o+1),n+=t.substr(0,s+1),t=t.substr(s+1),i=t.indexOf("${");else{n+=t.substr(0,i);let a=t.indexOf("}");if(a<0)throw new oe("Unmatched {.");n+=`czm_${t.substr(i+2,a-(i+2))}`,t=t.substr(a+1),i=t.indexOf("${")}}return n+=t,n}function ZWe(e){let t=typeof e.value;if(e.value===null)return new Lt(Nt.LITERAL_NULL,null);if(t==="boolean")return new Lt(Nt.LITERAL_BOOLEAN,e.value);if(t==="number")return new Lt(Nt.LITERAL_NUMBER,e.value);if(t==="string")return e.value.indexOf("${")>=0?new Lt(Nt.VARIABLE_IN_STRING,e.value):new Lt(Nt.LITERAL_STRING,_K(e.value))}function QWe(e,t){let n=t.arguments,i=n.length,r,o,s,a;if(t.callee.type==="MemberExpression"){r=t.callee.property.name;let c=t.callee.object;if(r==="test"||r==="exec"){if(!l(c.callee)||c.callee.name!=="regExp")throw new oe(`${r} is not a function.`);return i===0?r==="test"?new Lt(Nt.LITERAL_BOOLEAN,!1):new Lt(Nt.LITERAL_NULL,null):(s=Yi(e,c),a=Yi(e,n[0]),new Lt(Nt.FUNCTION_CALL,r,s,a))}else if(r==="toString")return o=Yi(e,c),new Lt(Nt.FUNCTION_CALL,r,o);throw new oe(`Unexpected function call "${r}".`)}if(r=t.callee.name,r==="color"){if(i===0)return new Lt(Nt.LITERAL_COLOR,r);if(o=Yi(e,n[0]),l(n[1])){let c=Yi(e,n[1]);return new Lt(Nt.LITERAL_COLOR,r,[o,c])}return new Lt(Nt.LITERAL_COLOR,r,[o])}else if(r==="rgb"||r==="hsl"){if(i<3)throw new oe(`${r} requires three arguments.`);return o=[Yi(e,n[0]),Yi(e,n[1]),Yi(e,n[2])],new Lt(Nt.LITERAL_COLOR,r,o)}else if(r==="rgba"||r==="hsla"){if(i<4)throw new oe(`${r} requires four arguments.`);return o=[Yi(e,n[0]),Yi(e,n[1]),Yi(e,n[2]),Yi(e,n[3])],new Lt(Nt.LITERAL_COLOR,r,o)}else if(r==="vec2"||r==="vec3"||r==="vec4"){o=new Array(i);for(let c=0;c<i;++c)o[c]=Yi(e,n[c]);return new Lt(Nt.LITERAL_VECTOR,r,o)}else{if(r==="isNaN"||r==="isFinite")return i===0?r==="isNaN"?new Lt(Nt.LITERAL_BOOLEAN,!0):new Lt(Nt.LITERAL_BOOLEAN,!1):(o=Yi(e,n[0]),new Lt(Nt.UNARY,r,o));if(r==="isExactClass"||r==="isClass"){if(i<1||i>1)throw new oe(`${r} requires exactly one argument.`);return o=Yi(e,n[0]),new Lt(Nt.UNARY,r,o)}else if(r==="getExactClassName"){if(i>0)throw new oe(`${r} does not take any argument.`);return new Lt(Nt.UNARY,r)}else if(l(o3[r])){if(i!==1)throw new oe(`${r} requires exactly one argument.`);return o=Yi(e,n[0]),new Lt(Nt.UNARY,r,o)}else if(l(s3[r])){if(i!==2)throw new oe(`${r} requires exactly two arguments.`);return s=Yi(e,n[0]),a=Yi(e,n[1]),new Lt(Nt.BINARY,r,s,a)}else if(l(yK[r])){if(i!==3)throw new oe(`${r} requires exactly three arguments.`);s=Yi(e,n[0]),a=Yi(e,n[1]);let c=Yi(e,n[2]);return new Lt(Nt.TERNARY,r,s,a,c)}else{if(r==="Boolean")return i===0?new Lt(Nt.LITERAL_BOOLEAN,!1):(o=Yi(e,n[0]),new Lt(Nt.UNARY,r,o));if(r==="Number")return i===0?new Lt(Nt.LITERAL_NUMBER,0):(o=Yi(e,n[0]),new Lt(Nt.UNARY,r,o));if(r==="String")return i===0?new Lt(Nt.LITERAL_STRING,""):(o=Yi(e,n[0]),new Lt(Nt.UNARY,r,o));if(r==="regExp")return eqe(e,t)}}throw new oe(`Unexpected function call "${r}".`)}function eqe(e,t){let n=t.arguments;if(n.length===0)return new Lt(Nt.LITERAL_REGEX,new RegExp);let i=Yi(e,n[0]),r;if(n.length>1){let o=Yi(e,n[1]);if(gK(i)&&gK(o)){try{r=new RegExp(_K(String(i._value)),o._value)}catch(s){throw new oe(s)}return new Lt(Nt.LITERAL_REGEX,r)}return new Lt(Nt.REGEX,i,o)}if(gK(i)){try{r=new RegExp(_K(String(i._value)))}catch(o){throw new oe(o)}return new Lt(Nt.LITERAL_REGEX,r)}return new Lt(Nt.REGEX,i)}function tqe(e){if(oqe(e.name)){let t=sqe(e.name);return t.substr(0,8)==="tiles3d_"?new Lt(Nt.BUILTIN_VARIABLE,t):new Lt(Nt.VARIABLE,t)}else{if(e.name==="NaN")return new Lt(Nt.LITERAL_NUMBER,NaN);if(e.name==="Infinity")return new Lt(Nt.LITERAL_NUMBER,1/0);if(e.name==="undefined")return new Lt(Nt.LITERAL_UNDEFINED,void 0)}throw new oe(`${e.name} is not defined.`)}function nqe(e){let t=e.property.name;if(t==="PI")return new Lt(Nt.LITERAL_NUMBER,Math.PI);if(t==="E")return new Lt(Nt.LITERAL_NUMBER,Math.E)}function iqe(e){if(e.property.name==="POSITIVE_INFINITY")return new Lt(Nt.LITERAL_NUMBER,Number.POSITIVE_INFINITY)}function rqe(e,t){if(t.object.name==="Math")return nqe(t);if(t.object.name==="Number")return iqe(t);let n,i=Yi(e,t.object);return t.computed?(n=Yi(e,t.property),new Lt(Nt.MEMBER,"brackets",i,n)):(n=new Lt(Nt.LITERAL_STRING,t.property.name),new Lt(Nt.MEMBER,"dot",i,n))}function gK(e){return e._type>=Nt.LITERAL_NULL}function oqe(e){return e.substr(0,4)==="czm_"}function sqe(e){return e.substr(4)}function Yi(e,t){let n,i,r,o;if(t.type==="Literal")n=ZWe(t);else if(t.type==="CallExpression")n=QWe(e,t);else if(t.type==="Identifier")n=tqe(t);else if(t.type==="UnaryExpression"){i=t.operator;let s=Yi(e,t.argument);if(BWe.indexOf(i)>-1)n=new Lt(Nt.UNARY,i,s);else throw new oe(`Unexpected operator "${i}".`)}else if(t.type==="BinaryExpression")if(i=t.operator,r=Yi(e,t.left),o=Yi(e,t.right),cme.indexOf(i)>-1)n=new Lt(Nt.BINARY,i,r,o);else throw new oe(`Unexpected operator "${i}".`);else if(t.type==="LogicalExpression")i=t.operator,r=Yi(e,t.left),o=Yi(e,t.right),cme.indexOf(i)>-1&&(n=new Lt(Nt.BINARY,i,r,o));else if(t.type==="ConditionalExpression"){let s=Yi(e,t.test);r=Yi(e,t.consequent),o=Yi(e,t.alternate),n=new Lt(Nt.CONDITIONAL,"?",r,o,s)}else if(t.type==="MemberExpression")n=rqe(e,t);else if(t.type==="ArrayExpression"){let s=[];for(let a=0;a<t.elements.length;a++)s[a]=Yi(e,t.elements[a]);n=new Lt(Nt.ARRAY,s)}else throw t.type==="Compound"?new oe("Provide exactly one expression."):new oe("Cannot parse expression.");return n}function aqe(e){e._type===Nt.CONDITIONAL?e.evaluate=e._evaluateConditional:e._type===Nt.FUNCTION_CALL?e._value==="test"?e.evaluate=e._evaluateRegExpTest:e._value==="exec"?e.evaluate=e._evaluateRegExpExec:e._value==="toString"&&(e.evaluate=e._evaluateToString):e._type===Nt.UNARY?e._value==="!"?e.evaluate=e._evaluateNot:e._value==="-"?e.evaluate=e._evaluateNegative:e._value==="+"?e.evaluate=e._evaluatePositive:e._value==="isNaN"?e.evaluate=e._evaluateNaN:e._value==="isFinite"?e.evaluate=e._evaluateIsFinite:e._value==="isExactClass"?e.evaluate=e._evaluateIsExactClass:e._value==="isClass"?e.evaluate=e._evaluateIsClass:e._value==="getExactClassName"?e.evaluate=e._evaluateGetExactClassName:e._value==="Boolean"?e.evaluate=e._evaluateBooleanConversion:e._value==="Number"?e.evaluate=e._evaluateNumberConversion:e._value==="String"?e.evaluate=e._evaluateStringConversion:l(o3[e._value])&&(e.evaluate=lqe(e._value)):e._type===Nt.BINARY?e._value==="+"?e.evaluate=e._evaluatePlus:e._value==="-"?e.evaluate=e._evaluateMinus:e._value==="*"?e.evaluate=e._evaluateTimes:e._value==="/"?e.evaluate=e._evaluateDivide:e._value==="%"?e.evaluate=e._evaluateMod:e._value==="==="?e.evaluate=e._evaluateEqualsStrict:e._value==="!=="?e.evaluate=e._evaluateNotEqualsStrict:e._value==="<"?e.evaluate=e._evaluateLessThan:e._value==="<="?e.evaluate=e._evaluateLessThanOrEquals:e._value===">"?e.evaluate=e._evaluateGreaterThan:e._value===">="?e.evaluate=e._evaluateGreaterThanOrEquals:e._value==="&&"?e.evaluate=e._evaluateAnd:e._value==="||"?e.evaluate=e._evaluateOr:e._value==="=~"?e.evaluate=e._evaluateRegExpMatch:e._value==="!~"?e.evaluate=e._evaluateRegExpNotMatch:l(s3[e._value])&&(e.evaluate=uqe(e._value)):e._type===Nt.TERNARY?e.evaluate=fqe(e._value):e._type===Nt.MEMBER?e._value==="brackets"?e.evaluate=e._evaluateMemberBrackets:e.evaluate=e._evaluateMemberDot:e._type===Nt.ARRAY?e.evaluate=e._evaluateArray:e._type===Nt.VARIABLE?e.evaluate=e._evaluateVariable:e._type===Nt.VARIABLE_IN_STRING?e.evaluate=e._evaluateVariableString:e._type===Nt.LITERAL_COLOR?e.evaluate=e._evaluateLiteralColor:e._type===Nt.LITERAL_VECTOR?e.evaluate=e._evaluateLiteralVector:e._type===Nt.LITERAL_STRING?e.evaluate=e._evaluateLiteralString:e._type===Nt.REGEX?e.evaluate=e._evaluateRegExp:e._type===Nt.BUILTIN_VARIABLE?e._value==="tiles3d_tileset_time"&&(e.evaluate=cqe):e.evaluate=e._evaluateLiteral}function cqe(e){return l(e)?e.content.tileset.timeSinceLoad:0}function lqe(e){let t=o3[e];return function(n){let i=this._left.evaluate(n);return t(e,i)}}function uqe(e){let t=s3[e];return function(n){let i=this._left.evaluate(n),r=this._right.evaluate(n);return t(e,i,r)}}function fqe(e){let t=yK[e];return function(n){let i=this._left.evaluate(n),r=this._right.evaluate(n),o=this._test.evaluate(n);return t(e,i,r,o)}}function a3(e,t){if(l(e))return e.getPropertyInherited(t)}Lt.prototype._evaluateLiteral=function(){return this._value};Lt.prototype._evaluateLiteralColor=function(e){let t=r3,n=this._left;if(this._value==="color")l(n)?n.length>1?(z.fromCssColorString(n[0].evaluate(e),t),t.alpha=n[1].evaluate(e)):z.fromCssColorString(n[0].evaluate(e),t):z.fromBytes(255,255,255,255,t);else if(this._value==="rgb")z.fromBytes(n[0].evaluate(e),n[1].evaluate(e),n[2].evaluate(e),255,t);else if(this._value==="rgba"){let i=n[3].evaluate(e)*255;z.fromBytes(n[0].evaluate(e),n[1].evaluate(e),n[2].evaluate(e),i,t)}else this._value==="hsl"?z.fromHsl(n[0].evaluate(e),n[1].evaluate(e),n[2].evaluate(e),1,t):this._value==="hsla"&&z.fromHsl(n[0].evaluate(e),n[1].evaluate(e),n[2].evaluate(e),n[3].evaluate(e),t);return se.fromColor(t,Bn.getCartesian4())};Lt.prototype._evaluateLiteralVector=function(e){let t=Bn.getArray(),n=this._value,i=this._left,r=i.length;for(let a=0;a<r;++a){let c=i[a].evaluate(e);if(typeof c=="number")t.push(c);else if(c instanceof U)t.push(c.x,c.y);else if(c instanceof h)t.push(c.x,c.y,c.z);else if(c instanceof se)t.push(c.x,c.y,c.z,c.w);else throw new oe(`${n} argument must be a vector or number. Argument is ${c}.`)}let o=t.length,s=parseInt(n.charAt(3));if(o===0)throw new oe(`Invalid ${n} constructor. No valid arguments.`);if(o<s&&o>1)throw new oe(`Invalid ${n} constructor. Not enough arguments.`);if(o>s&&r>1)throw new oe(`Invalid ${n} constructor. Too many arguments.`);if(o===1){let a=t[0];t.push(a,a,a)}if(n==="vec2")return U.fromArray(t,0,Bn.getCartesian2());if(n==="vec3")return h.fromArray(t,0,Bn.getCartesian3());if(n==="vec4")return se.fromArray(t,0,Bn.getCartesian4())};Lt.prototype._evaluateLiteralString=function(){return this._value};Lt.prototype._evaluateVariableString=function(e){let t=this._value,n=nD.exec(t);for(;n!==null;){let i=n[0],r=n[1],o=a3(e,r);l(o)||(o=""),t=t.replace(i,o),nD.lastIndex+=o.length-i.length,n=nD.exec(t)}return t};Lt.prototype._evaluateVariable=function(e){return a3(e,this._value)};function Wb(e){return e._value==="feature"}Lt.prototype._evaluateMemberDot=function(e){if(Wb(this._left))return a3(e,this._right.evaluate(e));let t=this._left.evaluate(e);if(!l(t))return;let n=this._right.evaluate(e);if(t instanceof U||t instanceof h||t instanceof se){if(n==="r")return t.x;if(n==="g")return t.y;if(n==="b")return t.z;if(n==="a")return t.w}return t[n]};Lt.prototype._evaluateMemberBrackets=function(e){if(Wb(this._left))return a3(e,this._right.evaluate(e));let t=this._left.evaluate(e);if(!l(t))return;let n=this._right.evaluate(e);if(t instanceof U||t instanceof h||t instanceof se){if(n===0||n==="r")return t.x;if(n===1||n==="g")return t.y;if(n===2||n==="b")return t.z;if(n===3||n==="a")return t.w}return t[n]};Lt.prototype._evaluateArray=function(e){let t=[];for(let n=0;n<this._value.length;n++)t[n]=this._value[n].evaluate(e);return t};Lt.prototype._evaluateNot=function(e){let t=this._left.evaluate(e);if(typeof t!="boolean")throw new oe(`Operator "!" requires a boolean argument. Argument is ${t}.`);return!t};Lt.prototype._evaluateNegative=function(e){let t=this._left.evaluate(e);if(t instanceof U)return U.negate(t,Bn.getCartesian2());if(t instanceof h)return h.negate(t,Bn.getCartesian3());if(t instanceof se)return se.negate(t,Bn.getCartesian4());if(typeof t=="number")return-t;throw new oe(`Operator "-" requires a vector or number argument. Argument is ${t}.`)};Lt.prototype._evaluatePositive=function(e){let t=this._left.evaluate(e);if(!(t instanceof U||t instanceof h||t instanceof se||typeof t=="number"))throw new oe(`Operator "+" requires a vector or number argument. Argument is ${t}.`);return t};Lt.prototype._evaluateLessThan=function(e){let t=this._left.evaluate(e),n=this._right.evaluate(e);if(typeof t!="number"||typeof n!="number")throw new oe(`Operator "<" requires number arguments. Arguments are ${t} and ${n}.`);return t<n};Lt.prototype._evaluateLessThanOrEquals=function(e){let t=this._left.evaluate(e),n=this._right.evaluate(e);if(typeof t!="number"||typeof n!="number")throw new oe(`Operator "<=" requires number arguments. Arguments are ${t} and ${n}.`);return t<=n};Lt.prototype._evaluateGreaterThan=function(e){let t=this._left.evaluate(e),n=this._right.evaluate(e);if(typeof t!="number"||typeof n!="number")throw new oe(`Operator ">" requires number arguments. Arguments are ${t} and ${n}.`);return t>n};Lt.prototype._evaluateGreaterThanOrEquals=function(e){let t=this._left.evaluate(e),n=this._right.evaluate(e);if(typeof t!="number"||typeof n!="number")throw new oe(`Operator ">=" requires number arguments. Arguments are ${t} and ${n}.`);return t>=n};Lt.prototype._evaluateOr=function(e){let t=this._left.evaluate(e);if(typeof t!="boolean")throw new oe(`Operator "||" requires boolean arguments. First argument is ${t}.`);if(t)return!0;let n=this._right.evaluate(e);if(typeof n!="boolean")throw new oe(`Operator "||" requires boolean arguments. Second argument is ${n}.`);return t||n};Lt.prototype._evaluateAnd=function(e){let t=this._left.evaluate(e);if(typeof t!="boolean")throw new oe(`Operator "&&" requires boolean arguments. First argument is ${t}.`);if(!t)return!1;let n=this._right.evaluate(e);if(typeof n!="boolean")throw new oe(`Operator "&&" requires boolean arguments. Second argument is ${n}.`);return t&&n};Lt.prototype._evaluatePlus=function(e){let t=this._left.evaluate(e),n=this._right.evaluate(e);if(n instanceof U&&t instanceof U)return U.add(t,n,Bn.getCartesian2());if(n instanceof h&&t instanceof h)return h.add(t,n,Bn.getCartesian3());if(n instanceof se&&t instanceof se)return se.add(t,n,Bn.getCartesian4());if(typeof t=="string"||typeof n=="string")return t+n;if(typeof t=="number"&&typeof n=="number")return t+n;throw new oe(`Operator "+" requires vector or number arguments of matching types, or at least one string argument. Arguments are ${t} and ${n}.`)};Lt.prototype._evaluateMinus=function(e){let t=this._left.evaluate(e),n=this._right.evaluate(e);if(n instanceof U&&t instanceof U)return U.subtract(t,n,Bn.getCartesian2());if(n instanceof h&&t instanceof h)return h.subtract(t,n,Bn.getCartesian3());if(n instanceof se&&t instanceof se)return se.subtract(t,n,Bn.getCartesian4());if(typeof t=="number"&&typeof n=="number")return t-n;throw new oe(`Operator "-" requires vector or number arguments of matching types. Arguments are ${t} and ${n}.`)};Lt.prototype._evaluateTimes=function(e){let t=this._left.evaluate(e),n=this._right.evaluate(e);if(n instanceof U&&t instanceof U)return U.multiplyComponents(t,n,Bn.getCartesian2());if(n instanceof U&&typeof t=="number")return U.multiplyByScalar(n,t,Bn.getCartesian2());if(t instanceof U&&typeof n=="number")return U.multiplyByScalar(t,n,Bn.getCartesian2());if(n instanceof h&&t instanceof h)return h.multiplyComponents(t,n,Bn.getCartesian3());if(n instanceof h&&typeof t=="number")return h.multiplyByScalar(n,t,Bn.getCartesian3());if(t instanceof h&&typeof n=="number")return h.multiplyByScalar(t,n,Bn.getCartesian3());if(n instanceof se&&t instanceof se)return se.multiplyComponents(t,n,Bn.getCartesian4());if(n instanceof se&&typeof t=="number")return se.multiplyByScalar(n,t,Bn.getCartesian4());if(t instanceof se&&typeof n=="number")return se.multiplyByScalar(t,n,Bn.getCartesian4());if(typeof t=="number"&&typeof n=="number")return t*n;throw new oe(`Operator "*" requires vector or number arguments. If both arguments are vectors they must be matching types. Arguments are ${t} and ${n}.`)};Lt.prototype._evaluateDivide=function(e){let t=this._left.evaluate(e),n=this._right.evaluate(e);if(n instanceof U&&t instanceof U)return U.divideComponents(t,n,Bn.getCartesian2());if(t instanceof U&&typeof n=="number")return U.divideByScalar(t,n,Bn.getCartesian2());if(n instanceof h&&t instanceof h)return h.divideComponents(t,n,Bn.getCartesian3());if(t instanceof h&&typeof n=="number")return h.divideByScalar(t,n,Bn.getCartesian3());if(n instanceof se&&t instanceof se)return se.divideComponents(t,n,Bn.getCartesian4());if(t instanceof se&&typeof n=="number")return se.divideByScalar(t,n,Bn.getCartesian4());if(typeof t=="number"&&typeof n=="number")return t/n;throw new oe(`Operator "/" requires vector or number arguments of matching types, or a number as the second argument. Arguments are ${t} and ${n}.`)};Lt.prototype._evaluateMod=function(e){let t=this._left.evaluate(e),n=this._right.evaluate(e);if(n instanceof U&&t instanceof U)return U.fromElements(t.x%n.x,t.y%n.y,Bn.getCartesian2());if(n instanceof h&&t instanceof h)return h.fromElements(t.x%n.x,t.y%n.y,t.z%n.z,Bn.getCartesian3());if(n instanceof se&&t instanceof se)return se.fromElements(t.x%n.x,t.y%n.y,t.z%n.z,t.w%n.w,Bn.getCartesian4());if(typeof t=="number"&&typeof n=="number")return t%n;throw new oe(`Operator "%" requires vector or number arguments of matching types. Arguments are ${t} and ${n}.`)};Lt.prototype._evaluateEqualsStrict=function(e){let t=this._left.evaluate(e),n=this._right.evaluate(e);return n instanceof U&&t instanceof U||n instanceof h&&t instanceof h||n instanceof se&&t instanceof se?t.equals(n):t===n};Lt.prototype._evaluateNotEqualsStrict=function(e){let t=this._left.evaluate(e),n=this._right.evaluate(e);return n instanceof U&&t instanceof U||n instanceof h&&t instanceof h||n instanceof se&&t instanceof se?!t.equals(n):t!==n};Lt.prototype._evaluateConditional=function(e){let t=this._test.evaluate(e);if(typeof t!="boolean")throw new oe(`Conditional argument of conditional expression must be a boolean. Argument is ${t}.`);return t?this._left.evaluate(e):this._right.evaluate(e)};Lt.prototype._evaluateNaN=function(e){return isNaN(this._left.evaluate(e))};Lt.prototype._evaluateIsFinite=function(e){return isFinite(this._left.evaluate(e))};Lt.prototype._evaluateIsExactClass=function(e){return l(e)?e.isExactClass(this._left.evaluate(e)):!1};Lt.prototype._evaluateIsClass=function(e){return l(e)?e.isClass(this._left.evaluate(e)):!1};Lt.prototype._evaluateGetExactClassName=function(e){if(l(e))return e.getExactClassName()};Lt.prototype._evaluateBooleanConversion=function(e){return!!this._left.evaluate(e)};Lt.prototype._evaluateNumberConversion=function(e){return Number(this._left.evaluate(e))};Lt.prototype._evaluateStringConversion=function(e){return String(this._left.evaluate(e))};Lt.prototype._evaluateRegExp=function(e){let t=this._value.evaluate(e),n="";l(this._left)&&(n=this._left.evaluate(e));let i;try{i=new RegExp(t,n)}catch(r){throw new oe(r)}return i};Lt.prototype._evaluateRegExpTest=function(e){let t=this._left.evaluate(e),n=this._right.evaluate(e);if(!(t instanceof RegExp&&typeof n=="string"))throw new oe(`RegExp.test requires the first argument to be a RegExp and the second argument to be a string. Arguments are ${t} and ${n}.`);return t.test(n)};Lt.prototype._evaluateRegExpMatch=function(e){let t=this._left.evaluate(e),n=this._right.evaluate(e);if(t instanceof RegExp&&typeof n=="string")return t.test(n);if(n instanceof RegExp&&typeof t=="string")return n.test(t);throw new oe(`Operator "=~" requires one RegExp argument and one string argument. Arguments are ${t} and ${n}.`)};Lt.prototype._evaluateRegExpNotMatch=function(e){let t=this._left.evaluate(e),n=this._right.evaluate(e);if(t instanceof RegExp&&typeof n=="string")return!t.test(n);if(n instanceof RegExp&&typeof t=="string")return!n.test(t);throw new oe(`Operator "!~" requires one RegExp argument and one string argument. Arguments are ${t} and ${n}.`)};Lt.prototype._evaluateRegExpExec=function(e){let t=this._left.evaluate(e),n=this._right.evaluate(e);if(!(t instanceof RegExp&&typeof n=="string"))throw new oe(`RegExp.exec requires the first argument to be a RegExp and the second argument to be a string. Arguments are ${t} and ${n}.`);let i=t.exec(n);return l(i)?i[1]:null};Lt.prototype._evaluateToString=function(e){let t=this._left.evaluate(e);if(t instanceof RegExp||t instanceof U||t instanceof h||t instanceof se)return String(t);throw new oe(`Unexpected function call "${this._value}".`)};function ume(e){let t=e._left,n=t.length;for(let a=0;a<n;++a)if(t[a]._type!==Nt.LITERAL_NUMBER)return;let i=t[0]._value,r=t[1]._value,o=t[2]._value,s=n===4?t[3]._value:1;return z.fromHsl(i,r,o,s,r3)}function fme(e){let t=e._left,n=t.length;for(let r=0;r<n;++r)if(t[r]._type!==Nt.LITERAL_NUMBER)return;let i=r3;return i.red=t[0]._value/255,i.green=t[1]._value/255,i.blue=t[2]._value/255,i.alpha=n===4?t[3]._value:1,i}function iy(e){return e%1===0?e.toFixed(1):e.toString()}function dqe(e){let t=iy(e.red),n=iy(e.green),i=iy(e.blue);return`vec3(${t}, ${n}, ${i})`}function i3(e){let t=iy(e.red),n=iy(e.green),i=iy(e.blue),r=iy(e.alpha);return`vec4(${t}, ${n}, ${i}, ${r})`}function dme(e,t,n,i){let r=e.length,o=new Array(r);for(let s=0;s<r;++s)o[s]=e[s].getShaderExpression(t,n,i);return o}function hme(e,t){return l(t[e])?t[e]:Ch.NULL_SENTINEL}Ch.NULL_SENTINEL="czm_infinity";Lt.prototype.getShaderExpression=function(e,t,n){let i,r,o,s,a=this._type,c=this._value;l(this._left)&&(Array.isArray(this._left)?r=dme(this._left,e,t,this):r=this._left.getShaderExpression(e,t,this)),l(this._right)&&(o=this._right.getShaderExpression(e,t,this)),l(this._test)&&(s=this._test.getShaderExpression(e,t,this)),Array.isArray(this._value)&&(c=dme(this._value,e,t,this));let u,f,d;switch(a){case Nt.VARIABLE:return Wb(this)?void 0:hme(c,e);case Nt.UNARY:if(c==="Boolean")return`bool(${r})`;if(c==="Number")return`float(${r})`;if(c==="round")return`floor(${r} + 0.5)`;if(l(o3[c]))return`${c}(${r})`;if(c==="isNaN")return`(${r} != ${r})`;if(c==="isFinite")return`(abs(${r}) < czm_infinity)`;if(c==="String"||c==="isExactClass"||c==="isClass"||c==="getExactClassName")throw new oe(`Error generating style shader: "${c}" is not supported.`);return c+r;case Nt.BINARY:return c==="%"?`mod(${r}, ${o})`:c==="==="?`(${r} == ${o})`:c==="!=="?`(${r} != ${o})`:c==="atan2"?`atan(${r}, ${o})`:l(s3[c])?`${c}(${r}, ${o})`:`(${r} ${c} ${o})`;case Nt.TERNARY:if(l(yK[c]))return`${c}(${r}, ${o}, ${s})`;break;case Nt.CONDITIONAL:return`(${s} ? ${r} : ${o})`;case Nt.MEMBER:return Wb(this._left)?hme(o,e):o==="r"||o==="x"||o==="0.0"?`${r}[0]`:o==="g"||o==="y"||o==="1.0"?`${r}[1]`:o==="b"||o==="z"||o==="2.0"?`${r}[2]`:o==="a"||o==="w"||o==="3.0"?`${r}[3]`:`${r}[int(${o})]`;case Nt.FUNCTION_CALL:throw new oe(`Error generating style shader: "${c}" is not supported.`);case Nt.ARRAY:if(c.length===4)return`vec4(${c[0]}, ${c[1]}, ${c[2]}, ${c[3]})`;if(c.length===3)return`vec3(${c[0]}, ${c[1]}, ${c[2]})`;if(c.length===2)return`vec2(${c[0]}, ${c[1]})`;throw new oe("Error generating style shader: Invalid array length. Array length should be 2, 3, or 4.");case Nt.REGEX:throw new oe("Error generating style shader: Regular expressions are not supported.");case Nt.VARIABLE_IN_STRING:throw new oe("Error generating style shader: Converting a variable to a string is not supported.");case Nt.LITERAL_NULL:return Ch.NULL_SENTINEL;case Nt.LITERAL_BOOLEAN:return c?"true":"false";case Nt.LITERAL_NUMBER:return iy(c);case Nt.LITERAL_STRING:if(l(n)&&n._type===Nt.MEMBER&&(c==="r"||c==="g"||c==="b"||c==="a"||c==="x"||c==="y"||c==="z"||c==="w"||Wb(n._left)))return c;if(i=z.fromCssColorString(c,r3),l(i))return dqe(i);throw new oe("Error generating style shader: String literals are not supported.");case Nt.LITERAL_COLOR:if(u=r,c==="color"){if(l(u)){if(u.length>1){let p=u[0],g=u[1];return g!=="1.0"&&(t.translucent=!0),`vec4(${p}, ${g})`}}else return"vec4(1.0)";return`vec4(${u[0]}, 1.0)`}else{if(c==="rgb")return i=fme(this),l(i)?i3(i):`vec4(${u[0]} / 255.0, ${u[1]} / 255.0, ${u[2]} / 255.0, 1.0)`;if(c==="rgba")return u[3]!=="1.0"&&(t.translucent=!0),i=fme(this),l(i)?i3(i):`vec4(${u[0]} / 255.0, ${u[1]} / 255.0, ${u[2]} / 255.0, ${u[3]})`;if(c==="hsl")return i=ume(this),l(i)?i3(i):`vec4(czm_HSLToRGB(vec3(${u[0]}, ${u[1]}, ${u[2]})), 1.0)`;if(c==="hsla")return i=ume(this),l(i)?(i.alpha!==1&&(t.translucent=!0),i3(i)):(u[3]!=="1.0"&&(t.translucent=!0),`vec4(czm_HSLToRGB(vec3(${u[0]}, ${u[1]}, ${u[2]})), ${u[3]})`)}break;case Nt.LITERAL_VECTOR:f=r.length,d=`${c}(`;for(let p=0;p<f;++p)d+=r[p],p<f-1&&(d+=", ");return d+=")",d;case Nt.LITERAL_REGEX:throw new oe("Error generating style shader: Regular expressions are not supported.");case Nt.LITERAL_UNDEFINED:return Ch.NULL_SENTINEL;case Nt.BUILTIN_VARIABLE:if(c==="tiles3d_tileset_time")return c}};Lt.prototype.getVariables=function(e,t){let n,i,r,o=this._type,s=this._value;if(l(this._left))if(Array.isArray(this._left))for(n=this._left,i=n.length,r=0;r<i;++r)n[r].getVariables(e,this);else this._left.getVariables(e,this);if(l(this._right)&&this._right.getVariables(e,this),l(this._test)&&this._test.getVariables(e,this),Array.isArray(this._value))for(n=this._value,i=n.length,r=0;r<i;++r)n[r].getVariables(e,this);let a;switch(o){case Nt.VARIABLE:Wb(this)||e.push(s);break;case Nt.VARIABLE_IN_STRING:for(a=nD.exec(s);a!==null;)e.push(a[1]),a=nD.exec(s);break;case Nt.LITERAL_STRING:l(t)&&t._type===Nt.MEMBER&&Wb(t._left)&&e.push(s);break}};var vh=Ch;function K0(e){e=e??H.EMPTY_OBJECT,this._batchTable=e.batchTable,this._batchIds=e.batchIds,this._positions=e.positions,this._vertexBatchIds=e.vertexBatchIds,this._indices=e.indices,this._indexCounts=e.indexCounts,this._indexOffsets=e.indexOffsets,this._batchedIndices=e.batchedIndices,this._boundingVolume=e.boundingVolume,this._boundingVolumes=e.boundingVolumes,this._center=e.center??h.ZERO,this._va=void 0,this._sp=void 0,this._spStencil=void 0,this._spPick=void 0,this._uniformMap=void 0,this._vaSwap=void 0,this._rsStencilDepthPass=void 0,this._rsStencilDepthPass3DTiles=void 0,this._rsColorPass=void 0,this._rsPickPass=void 0,this._rsWireframe=void 0,this._commands=[],this._commandsIgnoreShow=[],this._pickCommands=[],this._constantColor=z.clone(z.WHITE),this._highlightColor=this._constantColor,this._batchDirty=!0,this._pickCommandsDirty=!0,this._framesSinceLastRebatch=0,this._updatingAllCommands=!1,this._trianglesLength=this._indices.length/3,this._geometryByteLength=this._indices.byteLength+this._positions.byteLength+this._vertexBatchIds.byteLength,this.debugWireframe=!1,this._debugWireframe=this.debugWireframe,this._wireframeDirty=!1,this.forceRebatch=!1,this.classificationType=e.classificationType??ei.BOTH,this._vertexShaderSource=e._vertexShaderSource,this._fragmentShaderSource=e._fragmentShaderSource,this._attributeLocations=e._attributeLocations,this._uniformMap=e._uniformMap,this._pickId=e._pickId,this._modelMatrix=e._modelMatrix,this._boundingSphere=e._boundingSphere,this._batchIdLookUp={};let t=this._batchIds.length;for(let n=0;n<t;++n){let i=this._batchIds[n];this._batchIdLookUp[i]=n}}Object.defineProperties(K0.prototype,{trianglesLength:{get:function(){return this._trianglesLength}},geometryByteLength:{get:function(){return this._geometryByteLength}}});var hqe={position:0,a_batchId:1};function mqe(e,t){if(l(e._va))return;let n=tt.createVertexBuffer({context:t,typedArray:e._positions,usage:Me.STATIC_DRAW}),i=tt.createVertexBuffer({context:t,typedArray:e._vertexBatchIds,usage:Me.STATIC_DRAW}),r=tt.createIndexBuffer({context:t,typedArray:e._indices,usage:Me.DYNAMIC_DRAW,indexDatatype:e._indices.BYTES_PER_ELEMENT===2?je.UNSIGNED_SHORT:je.UNSIGNED_INT}),o=[{index:0,vertexBuffer:n,componentDatatype:Y.fromTypedArray(e._positions),componentsPerAttribute:3},{index:1,vertexBuffer:i,componentDatatype:Y.fromTypedArray(e._vertexBatchIds),componentsPerAttribute:1}];e._va=new Vn({context:t,attributes:o,indexBuffer:r}),t.webgl2&&(e._vaSwap=new Vn({context:t,attributes:o,indexBuffer:tt.createIndexBuffer({context:t,sizeInBytes:r.sizeInBytes,usage:Me.DYNAMIC_DRAW,indexDatatype:r.indexDatatype})})),e._batchedPositions=void 0,e._transferrableBatchIds=void 0,e._vertexBatchIds=void 0}function pqe(e,t){if(l(e._sp))return;let n=e._batchTable,i=e._attributeLocations??hqe,r=e._pickId,o=e._vertexShaderSource,s=e._fragmentShaderSource;if(l(o)){e._sp=Qt.fromCache({context:t,vertexShaderSource:o,fragmentShaderSource:s,attributeLocations:i}),e._spStencil=e._sp,s=Xe.replaceMain(s,"czm_non_pick_main"),s=`${s}void main() -{ - czm_non_pick_main(); - out_FragColor = ${r}; -} -`,e._spPick=Qt.fromCache({context:t,vertexShaderSource:o,fragmentShaderSource:s,attributeLocations:i});return}let a=n.getVertexShaderCallback(!1,"a_batchId",void 0)(gP),c=n.getFragmentShaderCallback(!1,void 0,!0)(Ob);r=n.getPickId();let u=new Xe({sources:[a]}),f=new Xe({defines:["VECTOR_TILE"],sources:[c]});e._sp=Qt.fromCache({context:t,vertexShaderSource:u,fragmentShaderSource:f,attributeLocations:i}),u=new Xe({sources:[gP]}),f=new Xe({defines:["VECTOR_TILE"],sources:[Ob]}),e._spStencil=Qt.fromCache({context:t,vertexShaderSource:u,fragmentShaderSource:f,attributeLocations:i}),c=Xe.replaceMain(c,"czm_non_pick_main"),c=`${c} -void main() -{ - czm_non_pick_main(); - out_FragColor = ${r}; -} -`;let d=new Xe({sources:[a]}),p=new Xe({defines:["VECTOR_TILE"],sources:[c]});e._spPick=Qt.fromCache({context:t,vertexShaderSource:d,fragmentShaderSource:p,attributeLocations:i})}function mme(e){let t=e?ti.EQUAL:ti.ALWAYS;return{colorMask:{red:!1,green:!1,blue:!1,alpha:!1},stencilTest:{enabled:!0,frontFunction:t,frontOperation:{fail:Rt.KEEP,zFail:Rt.DECREMENT_WRAP,zPass:Rt.KEEP},backFunction:t,backOperation:{fail:Rt.KEEP,zFail:Rt.INCREMENT_WRAP,zPass:Rt.KEEP},reference:Xt.CESIUM_3D_TILE_MASK,mask:Xt.CESIUM_3D_TILE_MASK},stencilMask:Xt.CLASSIFICATION_MASK,depthTest:{enabled:!0,func:yc.LESS_OR_EQUAL},depthMask:!1}}var gqe={stencilTest:{enabled:!0,frontFunction:ti.NOT_EQUAL,frontOperation:{fail:Rt.ZERO,zFail:Rt.ZERO,zPass:Rt.ZERO},backFunction:ti.NOT_EQUAL,backOperation:{fail:Rt.ZERO,zFail:Rt.ZERO,zPass:Rt.ZERO},reference:0,mask:Xt.CLASSIFICATION_MASK},stencilMask:Xt.CLASSIFICATION_MASK,depthTest:{enabled:!1},depthMask:!1,blending:nn.PRE_MULTIPLIED_ALPHA_BLEND},_qe={stencilTest:{enabled:!0,frontFunction:ti.NOT_EQUAL,frontOperation:{fail:Rt.ZERO,zFail:Rt.ZERO,zPass:Rt.ZERO},backFunction:ti.NOT_EQUAL,backOperation:{fail:Rt.ZERO,zFail:Rt.ZERO,zPass:Rt.ZERO},reference:0,mask:Xt.CLASSIFICATION_MASK},stencilMask:Xt.CLASSIFICATION_MASK,depthTest:{enabled:!1},depthMask:!1};function yqe(e){l(e._rsStencilDepthPass)||(e._rsStencilDepthPass=Ge.fromCache(mme(!1)),e._rsStencilDepthPass3DTiles=Ge.fromCache(mme(!0)),e._rsColorPass=Ge.fromCache(gqe),e._rsPickPass=Ge.fromCache(_qe))}var qb=new M,pme=new h;function Aqe(e,t){if(l(e._uniformMap))return;let n={u_modifiedModelViewProjection:function(){let i=t.uniformState.view,r=t.uniformState.projection;return M.clone(i,qb),M.multiplyByPoint(qb,e._center,pme),M.setTranslation(qb,pme,qb),M.multiply(r,qb,qb),qb},u_highlightColor:function(){return e._highlightColor}};e._uniformMap=e._batchTable.getUniformMapCallback()(n)}function AK(e,t,n,i,r,o,s){let a=e.constructor.BYTES_PER_ELEMENT,c=o.length;for(let u=0;u<c;++u){let f=o[u],d=s[f],p=i[d],g=r[d],m=new e.constructor(e.buffer,a*p,g);t.set(m,n),i[d]=n,n+=g}return n}function bqe(e,t){let n=e._indices,i=e._indexOffsets,r=e._indexCounts,o=e._batchIdLookUp,s=new n.constructor(n.length),a=t.pop(),c=[a],u=AK(n,s,0,i,r,a.batchIds,o);for(a.offset=0,a.count=u;t.length>0;){let f=t.pop();if(z.equals(f.color,a.color))u=AK(n,s,u,i,r,f.batchIds,o),a.batchIds=a.batchIds.concat(f.batchIds),a.count=u-a.offset;else{let d=u;u=AK(n,s,u,i,r,f.batchIds,o),f.offset=d,f.count=u-d,c.push(f),a=f}}e._va.indexBuffer.copyFromArrayView(s),e._indices=s,e._batchedIndices=c}function bK(e,t,n,i,r,o,s){let a=e.bytesPerIndex,c=o.length;for(let u=0;u<c;++u){let f=o[u],d=s[f],p=i[d],g=r[d];t.copyFromBuffer(e,p*a,n*a,g*a),i[d]=n,n+=g}return n}function xqe(e,t){let n=e._indexOffsets,i=e._indexCounts,r=e._batchIdLookUp,o=t.pop(),s=[o],a=e._va.indexBuffer,c=e._vaSwap.indexBuffer,u=bK(a,c,0,n,i,o.batchIds,r);for(o.offset=0,o.count=u;t.length>0;){let d=t.pop();if(z.equals(d.color,o.color))u=bK(a,c,u,n,i,d.batchIds,r),o.batchIds=o.batchIds.concat(d.batchIds),o.count=u-o.offset;else{let p=u;u=bK(a,c,u,n,i,d.batchIds,r),d.offset=p,d.count=u-p,s.push(d),o=d}}let f=e._va;e._va=e._vaSwap,e._vaSwap=f,e._batchedIndices=s}function Tqe(e,t){return t.color.toRgba()-e.color.toRgba()}function Eqe(e,t){if(!e._batchDirty)return!1;let n=e._batchedIndices,i=n.length,r=!1,o={};for(let s=0;s<i;++s){let c=n[s].color.toRgba();if(l(o[c])){r=!0;break}else o[c]=!0}if(!r)return e._batchDirty=!1,!1;if(r&&!e.forceRebatch&&e._framesSinceLastRebatch<120){++e._framesSinceLastRebatch;return}return n.sort(Tqe),t.webgl2?xqe(e,n):bqe(e,n),e._framesSinceLastRebatch=0,e._batchDirty=!1,e._pickCommandsDirty=!0,e._wireframeDirty=!0,!0}function Cqe(e,t){let n=Eqe(e,t),i=e._commands,r=e._batchedIndices,o=r.length,s=o*2;if(l(i)&&!n&&i.length===s)return;i.length=s;let a=e._va,c=e._sp,u=e._modelMatrix??M.IDENTITY,f=e._uniformMap,d=e._boundingVolume;for(let p=0;p<o;++p){let g=r[p].offset,m=r[p].count,y=i[p*2];l(y)||(y=i[p*2]=new at({owner:e})),y.vertexArray=a,y.modelMatrix=u,y.offset=g,y.count=m,y.renderState=e._rsStencilDepthPass,y.shaderProgram=c,y.uniformMap=f,y.boundingVolume=d,y.cull=!1,y.pass=Ie.TERRAIN_CLASSIFICATION;let A=at.shallowClone(y,y.derivedCommands.tileset);A.renderState=e._rsStencilDepthPass3DTiles,A.pass=Ie.CESIUM_3D_TILE_CLASSIFICATION,y.derivedCommands.tileset=A;let b=i[p*2+1];l(b)||(b=i[p*2+1]=new at({owner:e})),b.vertexArray=a,b.modelMatrix=u,b.offset=g,b.count=m,b.renderState=e._rsColorPass,b.shaderProgram=c,b.uniformMap=f,b.boundingVolume=d,b.cull=!1,b.pass=Ie.TERRAIN_CLASSIFICATION;let x=at.shallowClone(b,b.derivedCommands.tileset);x.pass=Ie.CESIUM_3D_TILE_CLASSIFICATION,b.derivedCommands.tileset=x}e._commandsDirty=!0}function vqe(e,t){if(e.classificationType===ei.TERRAIN||!t.invertClassification||l(e._commandsIgnoreShow)&&!e._commandsDirty)return;let n=e._commands,i=e._commandsIgnoreShow,r=e._spStencil,o=n.length,s=i.length=o/2,a=0;for(let c=0;c<s;++c){let u=i[c]=at.shallowClone(n[a],i[c]);u.shaderProgram=r,u.pass=Ie.CESIUM_3D_TILE_CLASSIFICATION_IGNORE_SHOW,a+=2}e._commandsDirty=!1}function Sqe(e){if(!e._pickCommandsDirty)return;let t=e._indexOffsets.length,n=e._pickCommands;n.length=t*2;let i=e._va,r=e._spStencil,o=e._spPick,s=e._modelMatrix??M.IDENTITY,a=e._uniformMap;for(let c=0;c<t;++c){let u=e._indexOffsets[c],f=e._indexCounts[c],d=l(e._boundingVolumes)?e._boundingVolumes[c]:e.boundingVolume,p=n[c*2];l(p)||(p=n[c*2]=new at({owner:e,pickOnly:!0})),p.vertexArray=i,p.modelMatrix=s,p.offset=u,p.count=f,p.renderState=e._rsStencilDepthPass,p.shaderProgram=r,p.uniformMap=a,p.boundingVolume=d,p.pass=Ie.TERRAIN_CLASSIFICATION;let g=at.shallowClone(p,p.derivedCommands.tileset);g.renderState=e._rsStencilDepthPass3DTiles,g.pass=Ie.CESIUM_3D_TILE_CLASSIFICATION,p.derivedCommands.tileset=g;let m=n[c*2+1];l(m)||(m=n[c*2+1]=new at({owner:e,pickOnly:!0})),m.vertexArray=i,m.modelMatrix=s,m.offset=u,m.count=f,m.renderState=e._rsPickPass,m.shaderProgram=o,m.uniformMap=a,m.boundingVolume=d,m.pass=Ie.TERRAIN_CLASSIFICATION;let y=at.shallowClone(m,m.derivedCommands.tileset);y.pass=Ie.CESIUM_3D_TILE_CLASSIFICATION,m.derivedCommands.tileset=y}e._pickCommandsDirty=!1}K0.prototype.createFeatures=function(e,t){let n=this._batchIds,i=n.length;for(let r=0;r<i;++r){let o=n[r];t[o]=new ua(e,o)}};K0.prototype.applyDebugSettings=function(e,t){this._highlightColor=e?t:this._constantColor};function wqe(e,t){e._updatingAllCommands=!0;let n=e._batchIds,i=n.length,r;for(r=0;r<i;++r){let s=n[r],a=t[s];a.show=!0,a.color=z.WHITE}let o=e._batchedIndices;for(i=o.length,r=0;r<i;++r)o[r].color=z.clone(z.WHITE);e._updatingAllCommands=!1,e._batchDirty=!0}var Iqe=new z,Pqe=z.WHITE,Dqe=!0,Rqe=/\$/;K0.prototype.applyStyle=function(e,t){if(!l(e)){wqe(this,t);return}let n=e.color,i=n instanceof vh&&!Rqe.test(n.expression);this._updatingAllCommands=i;let r=this._batchIds,o=r.length,s;for(s=0;s<o;++s){let a=r[s],c=t[a];c.color=l(e.color)?e.color.evaluateColor(c,Iqe):Pqe,c.show=l(e.show)?e.show.evaluate(c):Dqe}if(i){let a=this._batchedIndices;for(o=a.length,s=0;s<o;++s)a[s].color=z.clone(z.WHITE);this._updatingAllCommands=!1,this._batchDirty=!0}};K0.prototype.updateCommands=function(e,t){if(this._updatingAllCommands)return;let n=this._batchIdLookUp,i=n[e];if(!l(i))return;let r=this._indexOffsets,o=this._indexCounts,s=r[i],a=o[i],c=this._batchedIndices,u=c.length,f;for(f=0;f<u;++f){let y=c[f].offset,A=c[f].count;if(s>=y&&s<y+A)break}c.push(new X0({color:z.clone(t),offset:s,count:a,batchIds:[e]}));let d=[],p=[],g=c[f].batchIds,m=g.length;for(let y=0;y<m;++y){let A=g[y];if(A===e)continue;let b=n[A];r[b]<s?d.push(A):p.push(A)}p.length!==0&&c.push(new X0({color:z.clone(c[f].color),offset:s+a,count:c[f].offset+c[f].count-(s+a),batchIds:p})),d.length!==0?(c[f].count=s-c[f].offset,c[f].batchIds=d):c.splice(f,1),this._batchDirty=!0};function gme(e,t,n,i){let r=e.classificationType,o=r!==ei.CESIUM_3D_TILE,s=r!==ei.TERRAIN,a=t.commandList,c=n.length,u,f;for(f=0;f<c;++f)o&&(u=n[f],u.pass=Ie.TERRAIN_CLASSIFICATION,a.push(u)),s&&(u=n[f].derivedCommands.tileset,u.pass=Ie.CESIUM_3D_TILE_CLASSIFICATION,a.push(u));if(!(!t.invertClassification||!l(i)))for(c=i.length,f=0;f<c;++f)a.push(i[f])}function Oqe(e,t){let n=e.commandList,i=t.length;for(let r=0;r<i;r+=2){let o=t[r+1];o.pass=Ie.OPAQUE,n.push(o)}}function Mqe(e){let t=e.debugWireframe===e._debugWireframe;if(t=t&&!(e.debugWireframe&&e._wireframeDirty),t)return;l(e._rsWireframe)||(e._rsWireframe=Ge.fromCache({}));let n,i;e.debugWireframe?(n=e._rsWireframe,i=Oe.LINES):(n=e._rsColorPass,i=Oe.TRIANGLES);let r=e._commands,o=r.length;for(let s=0;s<o;s+=2){let a=r[s+1];a.renderState=n,a.primitiveType=i}e._debugWireframe=e.debugWireframe,e._wireframeDirty=!1}K0.prototype.update=function(e){let t=e.context;mqe(this,t),pqe(this,t),yqe(this),Aqe(this,t);let n=e.passes;n.render&&(Cqe(this,t),vqe(this,e),Mqe(this),this._debugWireframe?Oqe(e,this._commands):gme(this,e,this._commands,this._commandsIgnoreShow)),n.pick&&(Sqe(this),gme(this,e,this._pickCommands))};K0.prototype.isDestroyed=function(){return!1};K0.prototype.destroy=function(){return this._va=this._va&&this._va.destroy(),this._sp=this._sp&&this._sp.destroy(),this._spPick=this._spPick&&this._spPick.destroy(),this._vaSwap=this._vaSwap&&this._vaSwap.destroy(),le(this)};var wC=K0;function hf(e){this._boxes=e.boxes,this._boxBatchIds=e.boxBatchIds,this._cylinders=e.cylinders,this._cylinderBatchIds=e.cylinderBatchIds,this._ellipsoids=e.ellipsoids,this._ellipsoidBatchIds=e.ellipsoidBatchIds,this._spheres=e.spheres,this._sphereBatchIds=e.sphereBatchIds,this._modelMatrix=e.modelMatrix,this._batchTable=e.batchTable,this._boundingVolume=e.boundingVolume,this._center=e.center,l(this._center)||(l(this._boundingVolume)?this._center=h.clone(this._boundingVolume.center):this._center=h.clone(h.ZERO)),this._boundingVolumes=void 0,this._batchedIndices=void 0,this._indices=void 0,this._indexOffsets=void 0,this._indexCounts=void 0,this._positions=void 0,this._vertexBatchIds=void 0,this._batchIds=void 0,this._batchTableColors=void 0,this._packedBuffer=void 0,this._ready=!1,this._promise=void 0,this._error=void 0,this._verticesPromise=void 0,this._primitive=void 0,this.debugWireframe=!1,this.forceRebatch=!1,this.classificationType=ei.BOTH}Object.defineProperties(hf.prototype,{trianglesLength:{get:function(){return l(this._primitive)?this._primitive.trianglesLength:0}},geometryByteLength:{get:function(){return l(this._primitive)?this._primitive.geometryByteLength:0}},ready:{get:function(){return this._ready}}});hf.packedBoxLength=M.packedLength+h.packedLength;hf.packedCylinderLength=M.packedLength+2;hf.packedEllipsoidLength=M.packedLength+h.packedLength;hf.packedSphereLength=h.packedLength+1;function Nqe(e){let t=new Float64Array(M.packedLength+h.packedLength),n=0;return h.pack(e._center,t,n),n+=h.packedLength,M.pack(e._modelMatrix,t,n),t}function Lqe(e,t){let n=0,i=t[n++],r=t[n++],o=e._boundingVolumes=new Array(r);for(let c=0;c<r;++c)o[c]=ue.unpack(t,n),n+=ue.packedLength;let s=t[n++],a=e._batchedIndices=new Array(s);for(let c=0;c<s;++c){let u=z.unpack(t,n);n+=z.packedLength;let f=t[n++],d=t[n++],p=t[n++],g=new Array(p);for(let m=0;m<p;++m)g[m]=t[n++];a[c]=new X0({color:u,offset:f,count:d,batchIds:g})}return i}var Fqe=new $n("createVectorTileGeometries",5),Bqe=new z;function kqe(e){if(!l(e._primitive)&&!l(e._verticesPromise)){let t=e._boxes,n=e._boxBatchIds,i=e._cylinders,r=e._cylinderBatchIds,o=e._ellipsoids,s=e._ellipsoidBatchIds,a=e._spheres,c=e._sphereBatchIds,u=e._batchTableColors,f=e._packedBuffer;if(!l(u)){let m=0;l(e._boxes)&&(t=e._boxes=t.slice(),n=e._boxBatchIds=n.slice(),m+=n.length),l(e._cylinders)&&(i=e._cylinders=i.slice(),r=e._cylinderBatchIds=r.slice(),m+=r.length),l(e._ellipsoids)&&(o=e._ellipsoids=o.slice(),s=e._ellipsoidBatchIds=s.slice(),m+=s.length),l(e._spheres)&&(a=e._sphere=a.slice(),c=e._sphereBatchIds=c.slice(),m+=c.length),u=e._batchTableColors=new Uint32Array(m);let y=e._batchTable;for(let A=0;A<m;++A){let b=y.getColor(A,Bqe);u[A]=b.toRgba()}f=e._packedBuffer=Nqe(e)}let d=[];l(t)&&d.push(t.buffer,n.buffer),l(i)&&d.push(i.buffer,r.buffer),l(o)&&d.push(o.buffer,s.buffer),l(a)&&d.push(a.buffer,c.buffer),d.push(u.buffer,f.buffer);let p={boxes:l(t)?t.buffer:void 0,boxBatchIds:l(t)?n.buffer:void 0,cylinders:l(i)?i.buffer:void 0,cylinderBatchIds:l(i)?r.buffer:void 0,ellipsoids:l(o)?o.buffer:void 0,ellipsoidBatchIds:l(o)?s.buffer:void 0,spheres:l(a)?a.buffer:void 0,sphereBatchIds:l(a)?c.buffer:void 0,batchTableColors:u.buffer,packedBuffer:f.buffer},g=e._verticesPromise=Fqe.scheduleTask(p,d);return l(g)?g.then(function(m){if(e.isDestroyed())return;let y=new Float64Array(m.packedBuffer);Lqe(e,y)===2?e._indices=new Uint16Array(m.indices):e._indices=new Uint32Array(m.indices),e._indexOffsets=new Uint32Array(m.indexOffsets),e._indexCounts=new Uint32Array(m.indexCounts),e._positions=new Float32Array(m.positions),e._vertexBatchIds=new Uint16Array(m.vertexBatchIds),e._batchIds=new Uint16Array(m.batchIds),Uqe(e),e._ready=!0}).catch(m=>{e.isDestroyed()||(e._error=m)}):void 0}}function Uqe(e){l(e._primitive)||(e._primitive=new wC({batchTable:e._batchTable,positions:e._positions,batchIds:e._batchIds,vertexBatchIds:e._vertexBatchIds,indices:e._indices,indexOffsets:e._indexOffsets,indexCounts:e._indexCounts,batchedIndices:e._batchedIndices,boundingVolume:e._boundingVolume,boundingVolumes:e._boundingVolumes,center:e._center,pickObject:e._pickObject??e}),e._boxes=void 0,e._boxBatchIds=void 0,e._cylinders=void 0,e._cylinderBatchIds=void 0,e._ellipsoids=void 0,e._ellipsoidBatchIds=void 0,e._spheres=void 0,e._sphereBatchIds=void 0,e._center=void 0,e._modelMatrix=void 0,e._batchTable=void 0,e._boundingVolume=void 0,e._boundingVolumes=void 0,e._batchedIndices=void 0,e._indices=void 0,e._indexOffsets=void 0,e._indexCounts=void 0,e._positions=void 0,e._vertexBatchIds=void 0,e._batchIds=void 0,e._batchTableColors=void 0,e._packedBuffer=void 0,e._verticesPromise=void 0)}hf.prototype.createFeatures=function(e,t){this._primitive.createFeatures(e,t)};hf.prototype.applyDebugSettings=function(e,t){this._primitive.applyDebugSettings(e,t)};hf.prototype.applyStyle=function(e,t){this._primitive.applyStyle(e,t)};hf.prototype.updateCommands=function(e,t){this._primitive.updateCommands(e,t)};hf.prototype.update=function(e){if(!this._ready){if(l(this._promise)||(this._promise=kqe(this)),l(this._error)){let t=this._error;throw this._error=void 0,t}return}this._primitive.debugWireframe=this.debugWireframe,this._primitive.forceRebatch=this.forceRebatch,this._primitive.classificationType=this.classificationType,this._primitive.update(e)};hf.prototype.isDestroyed=function(){return!1};hf.prototype.destroy=function(){return this._primitive=this._primitive&&this._primitive.destroy(),le(this)};var ry=hf;var xK=class{constructor(t,n,i,r,o){this._tileset=t,this._tile=n,this._resource=i,this._geometries=void 0,this._metadata=void 0,this._batchTable=void 0,this._features=void 0,this.featurePropertiesDirty=!1,this._group=void 0,this._ready=!1,jqe(this,r,o)}get featuresLength(){return l(this._batchTable)?this._batchTable.featuresLength:0}get pointsLength(){return 0}get trianglesLength(){return l(this._geometries)?this._geometries.trianglesLength:0}get geometryByteLength(){return l(this._geometries)?this._geometries.geometryByteLength:0}get texturesByteLength(){return 0}get batchTableByteLength(){return l(this._batchTable)?this._batchTable.batchTableByteLength:0}get innerContents(){}get ready(){return this._ready}get tileset(){return this._tileset}get tile(){return this._tile}get url(){return this._resource.getUrlComponent(!0)}get metadata(){return this._metadata}set metadata(t){this._metadata=t}get batchTable(){return this._batchTable}get group(){return this._group}set group(t){this._group=t}hasProperty(t,n){return this._batchTable.hasProperty(t,n)}getFeature(t){return _me(this),this._features[t]}applyDebugSettings(t,n){l(this._geometries)&&this._geometries.applyDebugSettings(t,n)}applyStyle(t){_me(this),l(this._geometries)&&this._geometries.applyStyle(t,this._features)}update(t,n){l(this._geometries)&&(this._geometries.classificationType=this._tileset.classificationType,this._geometries.debugWireframe=this._tileset.debugWireframe,this._geometries.update(n)),l(this._batchTable)&&this._geometries.ready&&(this._batchTable.update(t,n),this._ready=!0)}pick(t,n,i){}isDestroyed(){return!1}destroy(){return this._geometries=this._geometries&&this._geometries.destroy(),this._batchTable=this._batchTable&&this._batchTable.destroy(),le(this)}};function zqe(e){return function(t,n){l(e._geometries)&&e._geometries.updateCommands(t,n)}}function Vqe(e,t){let n,i,r,o,s,a=e.BOXES_LENGTH??0,c=e.CYLINDERS_LENGTH??0,u=e.ELLIPSOIDS_LENGTH??0,f=e.SPHERES_LENGTH??0;if(a>0&&l(e.BOX_BATCH_IDS)){let m=t.byteOffset+e.BOX_BATCH_IDS.byteOffset;n=new Uint16Array(t.buffer,m,a)}if(c>0&&l(e.CYLINDER_BATCH_IDS)){let m=t.byteOffset+e.CYLINDER_BATCH_IDS.byteOffset;i=new Uint16Array(t.buffer,m,c)}if(u>0&&l(e.ELLIPSOID_BATCH_IDS)){let m=t.byteOffset+e.ELLIPSOID_BATCH_IDS.byteOffset;r=new Uint16Array(t.buffer,m,u)}if(f>0&&l(e.SPHERE_BATCH_IDS)){let m=t.byteOffset+e.SPHERE_BATCH_IDS.byteOffset;o=new Uint16Array(t.buffer,m,f)}let d=l(n)||l(i)||l(r)||l(o),p=a>0&&!l(n)||c>0&&!l(i)||u>0&&!l(r)||f>0&&!l(o);if(d&&p)throw new oe("If one group of batch ids is defined, then all batch ids must be defined");if(!l(n)&&!l(i)&&!l(r)&&!l(o)){let m=0;if(!l(n)&&a>0)for(n=new Uint16Array(a),s=0;s<a;++s)n[s]=m++;if(!l(i)&&c>0)for(i=new Uint16Array(c),s=0;s<c;++s)i[s]=m++;if(!l(r)&&u>0)for(r=new Uint16Array(u),s=0;s<u;++s)r[s]=m++;if(!l(o)&&f>0)for(o=new Uint16Array(f),s=0;s<f;++s)o[s]=m++}return{boxes:n,cylinders:i,ellipsoids:r,spheres:o}}var Yb=Uint32Array.BYTES_PER_ELEMENT;function jqe(e,t,n){n=n??0;let i=new Uint8Array(t),r=new DataView(t);n+=Yb;let o=r.getUint32(n,!0);if(o!==1)throw new oe(`Only Geometry tile version 1 is supported. Version ${o} is not.`);n+=Yb;let s=r.getUint32(n,!0);if(n+=Yb,s===0){e._ready=!0;return}let a=r.getUint32(n,!0);if(n+=Yb,a===0)throw new oe("Feature table must have a byte length greater than zero");let c=r.getUint32(n,!0);n+=Yb;let u=r.getUint32(n,!0);n+=Yb;let f=r.getUint32(n,!0);n+=Yb;let d=No(i,n,a);n+=a;let p=new Uint8Array(t,n,c);n+=c;let g,m;u>0&&(g=No(i,n,u),n+=u,f>0&&(m=new Uint8Array(t,n,f),m=new Uint8Array(m)));let y=d.BOXES_LENGTH??0,A=d.CYLINDERS_LENGTH??0,b=d.ELLIPSOIDS_LENGTH??0,x=d.SPHERES_LENGTH??0,T=y+A+b+x,E=new lp(e,T,g,m,zqe(e));if(e._batchTable=E,T===0)return;let v=e.tile.computedTransform,S;l(d.RTC_CENTER)&&(S=h.unpack(d.RTC_CENTER),M.multiplyByPoint(v,S,S));let I=Vqe(d,p);if(y>0||A>0||b>0||x>0){let R,O,L,_;if(y>0){let C=p.byteOffset+d.BOXES.byteOffset;R=new Float32Array(p.buffer,C,ry.packedBoxLength*y)}if(A>0){let C=p.byteOffset+d.CYLINDERS.byteOffset;O=new Float32Array(p.buffer,C,ry.packedCylinderLength*A)}if(b>0){let C=p.byteOffset+d.ELLIPSOIDS.byteOffset;L=new Float32Array(p.buffer,C,ry.packedEllipsoidLength*b)}if(x>0){let C=p.byteOffset+d.SPHERES.byteOffset;_=new Float32Array(p.buffer,C,ry.packedSphereLength*x)}return e._geometries=new ry({boxes:R,boxBatchIds:I.boxes,cylinders:O,cylinderBatchIds:I.cylinders,ellipsoids:L,ellipsoidBatchIds:I.ellipsoids,spheres:_,sphereBatchIds:I.spheres,center:S,modelMatrix:v,batchTable:E,boundingVolume:e.tile.boundingVolume.boundingVolume}),e}return Promise.resolve(e)}function _me(e){let t=e.featuresLength;if(!l(e._features)&&t>0){let n=new Array(t);l(e._geometries)&&e._geometries.createFeatures(e,n),e._features=n}}var c3=xK;var TK={};TK.encode2D=function(e,t,n){let i=Math.pow(2,e),r={x:t,y:n},o,s,a,c=BigInt(0);for(a=i/2;a>0;a/=2)o=(r.x&a)>0?1:0,s=(r.y&a)>0?1:0,c+=BigInt((3*o^s)*a*a),yme(i,r,o,s);return c};TK.decode2D=function(e,t){let n=Math.pow(2,e),i={x:0,y:0},r,o,s,a;for(s=1,a=t;s<n;s*=2)r=1&Number(a/BigInt(2)),o=1&Number(a^BigInt(r)),yme(s,i,r,o),i.x+=s*r,i.y+=s*o,a/=BigInt(4);return[i.x,i.y]};function yme(e,t,n,i){if(i!==0)return;n===1&&(t.x=e-1-t.x,t.y=e-1-t.y);let r=t.x;t.x=t.y,t.y=r}var iD=TK;var Xb=30,Hqe=1<<Xb,Gqe=1<<Xb+1>>>0,EK=2*Xb+1,oy=4,xme=[],Tme=[],Wqe=[[0,1,3,2],[0,2,3,1],[3,2,0,1],[3,1,0,2]],sy=1,IC=2,l3=[sy,0,0,sy|IC];function Is(e){if(!dn.supportsBigInt())throw new oe("S2 required BigInt support");this._cellId=e,this._level=Is.getLevel(e)}Is.fromToken=function(e){return new Is(Is.getIdFromToken(e))};Is.isValidId=function(e){return!(e<=0||e>>BigInt(EK)>5||!(e&~e+BigInt(1)&BigInt("0x1555555555555555")))};Is.isValidToken=function(e){return/^[0-9a-fA-F]{1,16}$/.test(e)?Is.isValidId(Is.getIdFromToken(e)):!1};Is.getIdFromToken=function(e){return BigInt("0x"+e+"0".repeat(16-e.length))};Is.getTokenFromId=function(e){let t=Math.floor(tYe(e)/4),n=e.toString(16).replace(/0*$/,"");return Array(17-t-n.length).join("0")+n};Is.getLevel=function(e){let t=0;for(;e!==BigInt(0)&&!(e&BigInt(1));)t++,e=e>>BigInt(1);return Xb-(t>>1)};Is.prototype.getChild=function(e){let t=vme(this._cellId)>>BigInt(2),n=this._cellId+BigInt(2*e+1-4)*t;return new Is(n)};Is.prototype.getParent=function(){let e=vme(this._cellId)<<BigInt(2);return new Is(this._cellId&~e+BigInt(1)|e)};Is.prototype.getParentAtLevel=function(e){let t=Qqe(e);return new Is(this._cellId&-t|t)};Is.prototype.getCenter=function(e){e=e??ee.WGS84;let t=qqe(this._cellId,this._level);t=h.normalize(t,t);let n=he.fromCartesian(t,ee.UNIT_SPHERE);return he.toCartesian(n,e,new h)};Is.prototype.getVertex=function(e,t){t=t??ee.WGS84;let n=Yqe(this._cellId,this._level,e);n=h.normalize(n,n);let i=he.fromCartesian(n,ee.UNIT_SPHERE);return he.toCartesian(i,t,new h)};Is.fromFacePositionLevel=function(e,t,n){let i=(e<4?"0":"")+(e<2?"0":"")+e.toString(2),r=t.toString(2),o=Array(2*n-r.length+1).join("0"),s=Array(EK-2*n).join("0"),a=BigInt(`0b${i}${o}${r}1${s}`);return new Is(a)};function qqe(e,t){let n=Xqe(e,t);return Kqe(n[0],n[1],n[2])}function Yqe(e,t,n){let i=Eme(e,t),r=$qe([i[1],i[2]],t),o=n>>1&1;return Cme(i[0],r[0][o^n&1],r[1][o])}function Xqe(e,t){let n=Eme(e),i=n[0],r=n[1],o=n[2],s=t===30,a=!s&&(BigInt(r)^e>>BigInt(2))&BigInt(1),c=s?1:a?2:0,u=(r<<1)+c,f=(o<<1)+c;return[i,u,f]}function Eme(e){xme.length===0&&Zqe();let t=Number(e>>BigInt(EK)),n=t&sy,i=(1<<oy)-1,r=0,o=0;for(let s=7;s>=0;s--){let c=(1<<2*(s===7?Xb-7*oy:oy))-1;n+=Number(e>>BigInt(s*2*oy+1)&BigInt(c))<<2,n=Tme[n];let u=s*oy;r+=n>>oy+2<<u,o+=(n>>2&i)<<u,n&=sy|IC}return[t,r,o]}function Kqe(e,t,n){let i=Ame(t),r=Ame(n),o=u3(i),s=u3(r);return Cme(e,o,s)}function Cme(e,t,n){switch(e){case 0:return new h(1,t,n);case 1:return new h(-t,1,n);case 2:return new h(-t,-n,1);case 3:return new h(-1,-n,-t);case 4:return new h(n,-1,-t);default:return new h(n,t,-1)}}function u3(e){return e>=.5?1/3*(4*e*e-1):1/3*(1-4*(1-e)*(1-e))}function Ame(e){return 1/Gqe*e}function $qe(e,t){let n=[[],[]],i=Jqe(t);for(let r=0;r<2;++r){let o=e[r]&-i,s=o+i;n[r][0]=u3(bme(o)),n[r][1]=u3(bme(s))}return n}function Jqe(e){return 1<<Xb-e>>>0}function bme(e){return 1/Hqe*e}function ay(e,t,n,i,r,o){if(e===oy){let s=(t<<oy)+n;xme[(s<<2)+i]=(r<<2)+o,Tme[(r<<2)+i]=(s<<2)+o}else{e++,t<<=1,n<<=1,r<<=2;let s=Wqe[o];ay(e,t+(s[0]>>1),n+(s[0]&1),i,r,o^l3[0]),ay(e,t+(s[1]>>1),n+(s[1]&1),i,r+1,o^l3[1]),ay(e,t+(s[2]>>1),n+(s[2]&1),i,r+2,o^l3[2]),ay(e,t+(s[3]>>1),n+(s[3]&1),i,r+3,o^l3[3])}}function Zqe(){ay(0,0,0,0,0,0),ay(0,0,0,sy,0,sy),ay(0,0,0,IC,0,IC),ay(0,0,0,sy|IC,0,sy|IC)}function vme(e){return e&~e+BigInt(1)}function Qqe(e){return BigInt(1)<<BigInt(2*(Xb-e))}var eYe=[64,0,1,39,2,15,40,23,3,12,16,59,41,19,24,54,4,64,13,10,17,62,60,28,42,30,20,51,25,44,55,47,5,32,65,38,14,22,11,58,18,53,63,9,61,27,29,50,43,46,31,37,21,57,52,8,26,49,45,36,56,7,48,35,6,34,33,0];function tYe(e){return eYe[(-e&e)%BigInt(67)]}var cy=Is;function nYe(e,t){return l(e)&&l(e.extensions)&&l(e.extensions[t])}var sr=nYe;function CK(e){let t=e.lengthBits,n=e.availableCount,i=e.constant,r=e.bitstream;if(l(i))n=t;else{let o=Math.ceil(t/8);if(r.length!==o)throw new oe(`Availability bitstream must be exactly ${o} bytes long to store ${t} bits. Actual bitstream was ${r.length} bytes long.`);let s=e.computeAvailableCountEnabled??!1;!l(n)&&s&&(n=iYe(r,t))}this._lengthBits=t,this._availableCount=n,this._constant=i,this._bitstream=r}function iYe(e,t){let n=0;for(let i=0;i<t;i++){let r=i>>3,o=i%8;n+=e[r]>>o&1}return n}Object.defineProperties(CK.prototype,{lengthBits:{get:function(){return this._lengthBits}},availableCount:{get:function(){return this._availableCount}}});CK.prototype.getBit=function(e){if(l(this._constant))return this._constant;let t=e>>3,n=e%8;return(this._bitstream[t]>>n&1)===1};var rD=CK;function $0(e){e=e??H.EMPTY_OBJECT;let t=e.metadataTable,n=e.class,i=e.entityId,r=e.propertyTableJson;this._class=n,this._metadataTable=t,this._entityId=i,this._extensions=r.extensions,this._extras=r.extras}Object.defineProperties($0.prototype,{class:{get:function(){return this._class}},extras:{get:function(){return this._extras}},extensions:{get:function(){return this._extensions}}});$0.prototype.hasProperty=function(e){return this._metadataTable.hasProperty(e)};$0.prototype.hasPropertyBySemantic=function(e){return this._metadataTable.hasPropertyBySemantic(e)};$0.prototype.getPropertyIds=function(e){return this._metadataTable.getPropertyIds(e)};$0.prototype.getProperty=function(e){return this._metadataTable.getProperty(this._entityId,e)};$0.prototype.setProperty=function(e,t){return this._metadataTable.setProperty(this._entityId,e,t)};$0.prototype.getPropertyBySemantic=function(e){return this._metadataTable.getPropertyBySemantic(this._entityId,e)};$0.prototype.setPropertyBySemantic=function(e,t){return this._metadataTable.setPropertyBySemantic(this._entityId,e,t)};var oD=$0;var sD={QUADTREE:"QUADTREE",OCTREE:"OCTREE"};sD.getBranchingFactor=function(e){switch(e){case sD.OCTREE:return 8;case sD.QUADTREE:return 4}};Object.freeze(sD);var Xs=sD;function $a(){}Object.defineProperties($a.prototype,{class:{get:function(){pe.throwInstantiationError()}}});$a.prototype.hasProperty=function(e){pe.throwInstantiationError()};$a.prototype.hasPropertyBySemantic=function(e){pe.throwInstantiationError()};$a.prototype.getPropertyIds=function(e){pe.throwInstantiationError()};$a.prototype.getProperty=function(e){pe.throwInstantiationError()};$a.prototype.setProperty=function(e,t){pe.throwInstantiationError()};$a.prototype.getPropertyBySemantic=function(e){pe.throwInstantiationError()};$a.prototype.setPropertyBySemantic=function(e,t){pe.throwInstantiationError()};$a.hasProperty=function(e,t,n){if(l(t[e]))return!0;let i=n.properties;if(!l(i))return!1;let r=i[e];return!!(l(r)&&l(r.default))};$a.hasPropertyBySemantic=function(e,t,n){let i=n.propertiesBySemantic;if(!l(i))return!1;let r=i[e];return l(r)};$a.getPropertyIds=function(e,t,n){n=l(n)?n:[],n.length=0;for(let r in e)e.hasOwnProperty(r)&&l(e[r])&&n.push(r);let i=t.properties;if(l(i))for(let r in i)i.hasOwnProperty(r)&&!l(e[r])&&l(i[r].default)&&n.push(r);return n};$a.getProperty=function(e,t,n){let i=n.properties[e],r=t[e];Array.isArray(r)&&l(r.slice)&&(r=r.slice());let o=!0;if(r=i.handleNoData(r),!l(r)&&l(i.default))return r=Ze(i.default,!0),i.unpackVectorAndMatrixTypes(r,o);if(l(r))return r=i.normalize(r),r=i.applyValueTransform(r),i.unpackVectorAndMatrixTypes(r,o)};$a.setProperty=function(e,t,n,i){if(!l(n[e]))return!1;Array.isArray(t)&&l(t.slice)&&(t=t.slice());let r,o=i.properties;return l(o)&&(r=o[e]),l(r)&&(t=r.packVectorAndMatrixTypes(t,!0),t=r.unapplyValueTransform(t),t=r.unnormalize(t)),n[e]=t,!0};$a.getPropertyBySemantic=function(e,t,n){let i=n.propertiesBySemantic;if(!l(i))return;let r=i[e];if(l(r))return $a.getProperty(r.id,t,n)};$a.setPropertyBySemantic=function(e,t,n,i){let r=i.propertiesBySemantic;if(!l(r))return!1;let o=i.propertiesBySemantic[e];return l(o)?$a.setProperty(o.id,t,n,i):!1};var Xn=$a;function J0(e){e=e??H.EMPTY_OBJECT;let t=e.subtreeMetadata,n=e.class,i=l(t.properties)?t.properties:{};this._class=n,this._properties=i,this._extras=t.extras,this._extensions=t.extensions}Object.defineProperties(J0.prototype,{class:{get:function(){return this._class}},extras:{get:function(){return this._extras}},extensions:{get:function(){return this._extensions}}});J0.prototype.hasProperty=function(e){return Xn.hasProperty(e,this._properties,this._class)};J0.prototype.hasPropertyBySemantic=function(e){return Xn.hasPropertyBySemantic(e,this._properties,this._class)};J0.prototype.getPropertyIds=function(e){return Xn.getPropertyIds(this._properties,this._class,e)};J0.prototype.getProperty=function(e){return Xn.getProperty(e,this._properties,this._class)};J0.prototype.setProperty=function(e,t){return Xn.setProperty(e,t,this._properties,this._class)};J0.prototype.getPropertyBySemantic=function(e){return Xn.getPropertyBySemantic(e,this._properties,this._class)};J0.prototype.setPropertyBySemantic=function(e,t){return Xn.setPropertyBySemantic(e,t,this._properties,this._class)};var f3=J0;var un={INT8:"INT8",UINT8:"UINT8",INT16:"INT16",UINT16:"UINT16",INT32:"INT32",UINT32:"UINT32",INT64:"INT64",UINT64:"UINT64",FLOAT32:"FLOAT32",FLOAT64:"FLOAT64"},Yc={INTEGER:"int",UNSIGNED_INTEGER:"uint",FLOAT:"float"};un.typeInfo={INT8:{vectorCompatible:!0,size:1,maximumValue:127,minimumValue:-128,category:Yc.INTEGER},UINT8:{vectorCompatible:!0,size:1,maximumValue:255,minimumValue:0,category:Yc.UNSIGNED_INTEGER},INT16:{vectorCompatible:!0,size:2,maximumValue:32767,minimumValue:-32768,category:Yc.INTEGER},UINT16:{vectorCompatible:!0,size:2,maximumValue:65535,minimumValue:0,category:Yc.UNSIGNED_INTEGER},INT32:{vectorCompatible:!0,size:4,maximumValue:2147483647,minimumValue:-2147483648,category:Yc.INTEGER},UINT32:{vectorCompatible:!0,size:4,maximumValue:4294967295,minimumValue:0,category:Yc.UNSIGNED_INTEGER},INT64:{vectorCompatible:!1,size:8,maximumValue:BigInt("9223372036854775807"),minimumValue:BigInt("-9223372036854775808"),category:Yc.INTEGER,downcastFunction:e=>un.clampToLimits(e,un.INT32)},UINT64:{vectorCompatible:!1,size:8,maximumValue:BigInt("18446744073709551615"),minimumValue:BigInt(0),category:Yc.UNSIGNED_INTEGER,downcastFunction:e=>un.clampToLimits(e,un.UINT32)},FLOAT32:{vectorCompatible:!0,size:4,maximumValue:34028234663852886e22,minimumValue:-34028234663852886e22,category:Yc.FLOAT},FLOAT64:{vectorCompatible:!0,size:8,maximumValue:Number.MAX_VALUE,minimumValue:-Number.MAX_VALUE,category:Yc.FLOAT,downcastFunction:e=>Math.fround(e)}};un.getMinimum=function(e){return un.typeInfo[e].minimumValue};un.getMaximum=function(e){return un.typeInfo[e].maximumValue};un.isIntegerType=function(e){return un.typeInfo[e].category!==Yc.FLOAT};un.isUnsignedIntegerType=function(e){return un.typeInfo[e].category===Yc.UNSIGNED_INTEGER};un.isVectorCompatible=function(e){return un.typeInfo[e].vectorCompatible};un.category=function(e){return un.typeInfo[e].category};un.gpuComponentType=function(e){switch(e){case un.INT64:return"INT32";case un.UINT64:return"UINT32";case un.FLOAT64:return"FLOAT32";default:return e}};un.normalize=function(e,t){return Math.max(Number(e)/Number(un.getMaximum(t)),-1)};un.unnormalize=function(e,t){let n=un.getMaximum(t),i=un.isUnsignedIntegerType(t)?0:-n;return e=P.sign(e)*Math.round(Math.abs(e)*Number(n)),(t===un.INT64||t===un.UINT64)&&dn.supportsBigInt()&&(e=BigInt(e)),e>n?n:e<i?i:e};un.applyValueTransform=function(e,t,n){return n*e+t};un.unapplyValueTransform=function(e,t,n){return n===0?0:(e-t)/n};un.getSizeInBytes=function(e){return un.typeInfo[e].size};un.clampToLimits=function(e,t){let n=un.getMinimum(t),i=un.getMaximum(t);if(typeof e=="bigint"){let r=BigInt(n),o=BigInt(i);return e<r?n:e>o?i:Number(e)}return Math.max(n,Math.min(i,e))};un.downcastFunction=function(e){let n=un.typeInfo[e].downcastFunction;return l(n)?n:i=>i};un.fromComponentDatatype=function(e){switch(e){case Y.BYTE:return un.INT8;case Y.UNSIGNED_BYTE:return un.UINT8;case Y.SHORT:return un.INT16;case Y.UNSIGNED_SHORT:return un.UINT16;case Y.INT:return un.INT32;case Y.UNSIGNED_INT:return un.UINT32;case Y.FLOAT:return un.FLOAT32;case Y.DOUBLE:return un.FLOAT64}};un.toComponentDatatype=function(e){switch(e){case un.INT8:return Y.BYTE;case un.UINT8:return Y.UNSIGNED_BYTE;case un.INT16:return Y.SHORT;case un.UINT16:return Y.UNSIGNED_SHORT;case un.INT32:return Y.INT;case un.UINT32:return Y.UNSIGNED_INT;case un.FLOAT32:return Y.FLOAT;case un.FLOAT64:return Y.DOUBLE}};un.getDataViewAccessors=function(e,t){return{[un.UINT8]:{get:e.getUint8.bind(e),set:e.setUint8.bind(e)},[un.INT8]:{get:e.getInt8.bind(e),set:e.setInt8.bind(e)},[un.UINT16]:{get:i=>e.getUint16(i,!0),set:(i,r)=>e.setUint16(i,r,!0)},[un.INT16]:{get:i=>e.getInt16(i,!0),set:(i,r)=>e.setInt16(i,r,!0)},[un.UINT32]:{get:i=>e.getUint32(i,!0),set:(i,r)=>e.setUint32(i,r,!0)},[un.INT32]:{get:i=>e.getInt32(i,!0),set:(i,r)=>e.setInt32(i,r,!0)},[un.FLOAT32]:{get:i=>e.getFloat32(i,!0),set:(i,r)=>e.setFloat32(i,r,!0)},[un.FLOAT64]:{get:i=>e.getFloat64(i,!0),set:(i,r)=>e.setFloat64(i,r,!0)},[un.UINT64]:{get:i=>e.getBigUint64(i,!0),set:(i,r)=>e.setBigUint64(i,BigInt(r),!0)},[un.INT64]:{get:i=>e.getBigInt64(i,!0),set:(i,r)=>e.setBigInt64(i,BigInt(r),!0)}}[t]};Object.freeze(un);var Ft=un;var eo={SCALAR:"SCALAR",VEC2:"VEC2",VEC3:"VEC3",VEC4:"VEC4",MAT2:"MAT2",MAT3:"MAT3",MAT4:"MAT4",BOOLEAN:"BOOLEAN",STRING:"STRING",ENUM:"ENUM"};eo.isVectorType=function(e){switch(e){case eo.VEC2:case eo.VEC3:case eo.VEC4:return!0;default:return!1}};eo.isMatrixType=function(e){switch(e){case eo.MAT2:case eo.MAT3:case eo.MAT4:return!0;default:return!1}};eo.getComponentCount=function(e){switch(e){case eo.SCALAR:case eo.STRING:case eo.ENUM:case eo.BOOLEAN:return 1;case eo.VEC2:return 2;case eo.VEC3:return 3;case eo.VEC4:return 4;case eo.MAT2:return 4;case eo.MAT3:return 9;case eo.MAT4:return 16}};eo.getMathType=function(e){switch(e){case eo.VEC2:return U;case eo.VEC3:return h;case eo.VEC4:return se;case eo.MAT2:return $i;case eo.MAT3:return $;case eo.MAT4:return M;default:return}};Object.freeze(eo);var bt=eo;function Xo(e){e=e??H.EMPTY_OBJECT;let t=e.id,n=e.type,i=e.componentType,r=e.enumType,o=l(i)&&(e.normalized??!1)&&Ft.isIntegerType(i);this._id=t,this._name=e.name,this._description=e.description,this._semantic=e.semantic,this._isLegacyExtension=e.isLegacyExtension,this._type=n,this._componentType=i,this._enumType=r,this._valueType=l(r)?r.valueType:i,this._isArray=e.isArray??!1,this._isVariableLengthArray=e.isVariableLengthArray??!1,this._arrayLength=e.arrayLength,this._min=Ze(e.min,!0),this._max=Ze(e.max,!0),this._normalized=o;let s=Ze(e.offset,!0),a=Ze(e.scale,!0),c=l(s)||l(a),u=!0;l(s)||(s=this.expandConstant(0,u)),l(a)||(a=this.expandConstant(1,u)),this._offset=s,this._scale=a,this._hasValueTransform=c,this._noData=Ze(e.noData,!0),this._default=Ze(e.default,!0),this._required=e.required??!0,this._extras=Ze(e.extras,!0),this._extensions=Ze(e.extensions,!0)}Xo.fromJson=function(e){e=e??H.EMPTY_OBJECT;let t=e.id,n=e.property,i=rYe(n),r=oYe(n,e.enums),o;return l(i)?i?o=l(n.optional)?!n.optional:!0:o=n.required??!1:o=!1,new Xo({id:t,type:r.type,componentType:r.componentType,enumType:r.enumType,isArray:r.isArray,isVariableLengthArray:r.isVariableLengthArray,arrayLength:r.arrayLength,normalized:n.normalized,min:n.min,max:n.max,offset:n.offset,scale:n.scale,noData:n.noData,default:n.default,required:o,name:n.name,description:n.description,semantic:n.semantic,extras:n.extras,extensions:n.extensions,isLegacyExtension:i})};Object.defineProperties(Xo.prototype,{id:{get:function(){return this._id}},name:{get:function(){return this._name}},description:{get:function(){return this._description}},type:{get:function(){return this._type}},enumType:{get:function(){return this._enumType}},componentType:{get:function(){return this._componentType}},valueType:{get:function(){return this._valueType}},isArray:{get:function(){return this._isArray}},isVariableLengthArray:{get:function(){return this._isVariableLengthArray}},arrayLength:{get:function(){return this._arrayLength}},normalized:{get:function(){return this._normalized}},max:{get:function(){return this._max}},min:{get:function(){return this._min}},noData:{get:function(){return this._noData}},default:{get:function(){return this._default}},required:{get:function(){return this._required}},semantic:{get:function(){return this._semantic}},hasValueTransform:{get:function(){return this._hasValueTransform}},offset:{get:function(){return this._offset}},scale:{get:function(){return this._scale}},extras:{get:function(){return this._extras}},extensions:{get:function(){return this._extensions}}});function rYe(e){if(e.type==="ARRAY")return!0;let t=e.type;if(t===bt.SCALAR||bt.isMatrixType(t)||bt.isVectorType(t))return!1;if(l(Ft[t]))return!0;if(l(e.noData)||l(e.scale)||l(e.offset)||l(e.required)||l(e.count)||l(e.array)||l(e.optional))return!1}function oYe(e,t){let n=e.type,i=e.componentType,r=n==="ARRAY",o,s,a;r?(o=!0,s=e.componentCount,a=!l(s)):e.array?(o=!0,s=e.count,a=!l(e.count)):(o=!1,s=void 0,a=!1);let c;if(l(e.enumType)&&(c=t[e.enumType]),n===bt.ENUM)return{type:n,componentType:void 0,enumType:c,valueType:c.valueType,isArray:o,isVariableLengthArray:a,arrayLength:s};if(r&&i===bt.ENUM)return{type:i,componentType:void 0,enumType:c,valueType:c.valueType,isArray:o,isVariableLengthArray:a,arrayLength:s};if(n===bt.SCALAR||bt.isMatrixType(n)||bt.isVectorType(n))return{type:n,componentType:i,enumType:void 0,valueType:i,isArray:o,isVariableLengthArray:a,arrayLength:s};if(n===bt.BOOLEAN||n===bt.STRING)return{type:n,componentType:void 0,enumType:void 0,valueType:void 0,isArray:o,isVariableLengthArray:a,arrayLength:s};if(r&&(i===bt.BOOLEAN||i===bt.STRING))return{type:i,componentType:void 0,enumType:void 0,valueType:void 0,isArray:o,isVariableLengthArray:a,arrayLength:s};if(l(i)&&l(Ft[i]))return{type:bt.SCALAR,componentType:i,enumType:void 0,valueType:i,isArray:o,isVariableLengthArray:a,arrayLength:s};if(l(Ft[n]))return{type:bt.SCALAR,componentType:n,enumType:void 0,valueType:n,isArray:o,isVariableLengthArray:a,arrayLength:s}}Xo.prototype.normalize=function(e){return this._normalized?vK(e,this._valueType,Ft.normalize):e};Xo.prototype.unnormalize=function(e){return this._normalized?vK(e,this._valueType,Ft.unnormalize):e};Xo.prototype.applyValueTransform=function(e){return!this._hasValueTransform||this._isVariableLengthArray?e:Xo.valueTransformInPlace(e,this._offset,this._scale,Ft.applyValueTransform)};Xo.prototype.unapplyValueTransform=function(e){return!this._hasValueTransform||this._isVariableLengthArray?e:Xo.valueTransformInPlace(e,this._offset,this._scale,Ft.unapplyValueTransform)};Xo.prototype.expandConstant=function(e,t){t=t??!1;let n=this._isArray,i=this._arrayLength,r=bt.getComponentCount(this._type),o=n&&r>1;if(!n&&r===1)return e;if(!n)return new Array(r).fill(e);if(!o)return new Array(i).fill(e);if(!t)return new Array(this._arrayLength*r).fill(e);let s=new Array(r).fill(e);return new Array(this._arrayLength).fill(s)};Xo.prototype.handleNoData=function(e){let t=this._noData;if(!l(t))return e;if(!Pme(e,t))return e};function aD(e){return Array.isArray(e)&&!(e instanceof $i)&&!(e instanceof $)&&!(e instanceof M)}function Pme(e,t){if(!aD(e))return e===t;if(!aD(t)||e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(!Pme(e[n],t[n]))return!1;return!0}Xo.prototype.unpackVectorAndMatrixTypes=function(e,t){t=t??!1;let n=bt.getMathType(this._type),i=this._isArray,r=bt.getComponentCount(this._type),o=i&&r>1;return l(n)?t&&o?e.map(function(s){return n.unpack(s)}):i?n.unpackArray(e):n.unpack(e):e};Xo.prototype.packVectorAndMatrixTypes=function(e,t){t=t??!1;let n=bt.getMathType(this._type),i=this._isArray,r=bt.getComponentCount(this._type),o=i&&r>1;return l(n)?t&&o?e.map(function(s){return n.pack(s,[])}):i?n.packArray(e,[]):n.pack(e,[]):e};Xo.prototype.validate=function(e){if(!(!l(e)&&l(this._default)))return this._required&&!l(e)?"required property must have a value":this._isArray?sYe(this,e):Dme(this,e)};function sYe(e,t){if(!aD(t))return`value ${t} must be an array`;let n=t.length;if(!e._isVariableLengthArray&&n!==e._arrayLength)return"Array length does not match property.arrayLength";for(let i=0;i<n;i++){let r=Dme(e,t[i]);if(l(r))return r}}function Dme(e,t){let n=e._type,i=e._componentType,r=e._enumType,o=e._normalized;return bt.isVectorType(n)?aYe(t,n,i):bt.isMatrixType(n)?cYe(t,n,i):n===bt.STRING?lYe(t):n===bt.BOOLEAN?uYe(t):n===bt.ENUM?fYe(t,r):dYe(t,i,o)}function aYe(e,t,n){if(!Ft.isVectorCompatible(n))return`componentType ${n} is incompatible with vector type ${t}`;if(t===bt.VEC2&&!(e instanceof U))return`vector value ${e} must be a Cartesian2`;if(t===bt.VEC3&&!(e instanceof h))return`vector value ${e} must be a Cartesian3`;if(t===bt.VEC4&&!(e instanceof se))return`vector value ${e} must be a Cartesian4`}function cYe(e,t,n){if(!Ft.isVectorCompatible(n))return`componentType ${n} is incompatible with matrix type ${t}`;if(t===bt.MAT2&&!(e instanceof $i))return`matrix value ${e} must be a Matrix2`;if(t===bt.MAT3&&!(e instanceof $))return`matrix value ${e} must be a Matrix3`;if(t===bt.MAT4&&!(e instanceof M))return`matrix value ${e} must be a Matrix4`}function lYe(e){if(typeof e!="string")return d3(e,bt.STRING)}function uYe(e){if(typeof e!="boolean")return d3(e,bt.BOOLEAN)}function fYe(e,t){let n=typeof e;if(l(t))return n!=="string"||!l(t.valuesByName[e])?`value ${e} is not a valid enum name for ${t.id}`:void 0}function dYe(e,t,n){let i=typeof e;switch(t){case Ft.INT8:case Ft.UINT8:case Ft.INT16:case Ft.UINT16:case Ft.INT32:case Ft.UINT32:case Ft.FLOAT32:case Ft.FLOAT64:return i!=="number"?d3(e,t):isFinite(e)?wme(e,t,n):Ime(e,t);case Ft.INT64:case Ft.UINT64:return i!=="number"&&i!=="bigint"?d3(e,t):i==="number"&&!isFinite(e)?Ime(e,t):wme(e,t,n)}}function d3(e,t){return`value ${e} does not match type ${t}`}function Sme(e,t,n){let i=`value ${e} is out of range for type ${t}`;return n&&(i+=" (normalized)"),i}function wme(e,t,n){if(n){let i=Ft.isUnsignedIntegerType(t)?0:-1;return e<i||e>1?Sme(e,t,n):void 0}if(e<Ft.getMinimum(t)||e>Ft.getMaximum(t))return Sme(e,t,n)}function Ime(e,t){return`value ${e} of type ${t} must be finite`}function vK(e,t,n){if(!aD(e))return n(e,t);for(let i=0;i<e.length;i++)e[i]=vK(e[i],t,n);return e}Xo.valueTransformInPlace=function(e,t,n,i){if(!aD(e))return i(e,t,n);for(let r=0;r<e.length;r++)e[r]=Xo.valueTransformInPlace(e[r],t[r],n[r],i);return e};Xo.prototype.cpuBytesPerElement=function(){return Rme(this,this.valueType)};Xo.prototype.gpuBytesPerElement=function(){let e=Ft.gpuComponentType(this.valueType);return Rme(this,e)};function Rme(e,t){let n=e.type,i=bt.getComponentCount(n),r=e.isArray?e.arrayLength:1,o=Ft.getSizeInBytes(t);return i*r*o}Xo.prototype.isGpuCompatible=function(e){let t=this.type;return!(this.isVariableLengthArray||t===bt.STRING||t===bt.BOOLEAN||this.gpuBytesPerElement()>e)};var SK=[void 0,"float","vec2","vec3","vec4"],Ome=[void 0,"int","ivec2","ivec3","ivec4"],hYe=[void 0,"uint","uvec2","uvec3","uvec4"],mYe={[Yc.FLOAT]:"uintBitsToFloat",[Yc.INTEGER]:"int",[Yc.UNSIGNED_INTEGER]:""};Xo.prototype.getGlslTypeWebGL1=function(){let e=bt.getComponentCount(this.type);return this.isArray&&(e=this.arrayLength),this.normalized?SK[e]:Ome[e]};Xo.prototype.getGlslType=function(){let e=this.valueType,t=bt.getComponentCount(this.type),n=this.isArray?this.arrayLength:1;return t*=n,!Ft.isIntegerType(e)||this.normalized?SK[t]:Ft.isUnsignedIntegerType(e)?hYe[t]:Ome[t]};Xo.prototype.unpackTextureInShader=function(e,t,n,i){let r=this.getGlslType(),o=Ft.gpuComponentType(this.valueType),s=t.length,a=this.type,c=bt.getComponentCount(a)*(this.isArray?this.arrayLength:1),u=Math.floor(s/c),f=`${n}_rawChannels`,d=`${n}_rawBits`,p=`${n}_unpackedValue`,g=`${r} ${p};`,m=`uint ${d};`;i.push(g),i.push(m);let y=`${SK[s]} ${f} = ${e};`;i.push(y);let A=mYe[Ft.category(o)],b=c>1;for(let x=0;x<c;x++){let T="rgba".slice(x*u,(x+1)*u),E=s>1?`.${T}`:"",v=`${d} = czm_unpackTexture(${f}${E});`,S="";b&&(S=`[${x}]`);let I="",R="";if(this.normalized){let L=Ft.getMaximum(o);I=` * ${1/Number(L)}`,R="float"}let O=`${p}${S} = ${R}(${A}(${d}))${I};`;i.push(v),i.push(O)}return p};Xo.prototype.unpackTextureInShaderWebGL1=function(e){return this.normalized?e:`${this.getGlslTypeWebGL1()}(255.0 * ${e})`};var Z0=Xo;function cD(e){e=e??H.EMPTY_OBJECT;let t=e.count,n=e.property,i=e.classProperty,r=e.bufferViews,o=i.type,s=i.isArray,a=i.isVariableLengthArray,c=i.valueType,u=i.enumType,f=o===bt.STRING,d=o===bt.BOOLEAN,p=0,g;if(a){let _=n.arrayOffsetType??n.offsetType;_=Ft[_]??Ft.UINT32;let C=n.arrayOffsets??n.arrayOffsetBufferView;g=new wK(r[C],_,t+1),p+=g.typedArray.byteLength}let m=bt.getComponentCount(o),y;a?y=g.get(t)-g.get(0):s?y=t*i.arrayLength:y=t;let A=m*y,b;if(f){let _=n.stringOffsetType??n.offsetType;_=Ft[_]??Ft.UINT32;let C=n.stringOffsets??n.stringOffsetBufferView;b=new wK(r[C],_,A+1),p+=b.typedArray.byteLength}(f||d)&&(c=Ft.UINT8);let x;f?x=b.get(A)-b.get(0):d?x=Math.ceil(A/8):x=A;let T=n.values??n.bufferView,E=new wK(r[T],c,x);p+=E.typedArray.byteLength;let v=n.offset,S=n.scale,I=i.hasValueTransform||l(v)||l(S);v=v??i.offset,S=S??i.scale,v=Mme(v),S=Mme(S);let R,O,L=this;f?R=function(_){return _Ye(_,L._values,L._stringOffsets)}:d?(R=function(_){return yYe(_,L._values)},O=function(_,C){AYe(_,L._values,C)}):l(u)?(R=function(_){let C=L._values.get(_);return u.namesByValue[C]},O=function(_,C){let w=u.valuesByName[C];L._values.set(_,w)}):(R=function(_){return L._values.get(_)},O=function(_,C){L._values.set(_,C)}),this._arrayOffsets=g,this._stringOffsets=b,this._values=E,this._classProperty=i,this._count=t,this._vectorComponentCount=m,this._min=n.min,this._max=n.max,this._offset=v,this._scale=S,this._hasValueTransform=I,this._getValue=R,this._setValue=O,this._unpackedValues=void 0,this._extras=n.extras,this._extensions=n.extensions,this._byteLength=p}Object.defineProperties(cD.prototype,{hasValueTransform:{get:function(){return this._hasValueTransform}},offset:{get:function(){return this._offset}},scale:{get:function(){return this._scale}},extras:{get:function(){return this._extras}},extensions:{get:function(){return this._extensions}},byteLength:{get:function(){return this._byteLength}},classProperty:{get:function(){return this._classProperty}}});cD.prototype.get=function(e){let t=pYe(this,e);return t=this._classProperty.handleNoData(t),l(t)?(t=this._classProperty.normalize(t),t=wYe(this,t),this._classProperty.unpackVectorAndMatrixTypes(t)):(t=this._classProperty.default,this._classProperty.unpackVectorAndMatrixTypes(t))};cD.prototype.set=function(e,t){let n=this._classProperty;t=n.packVectorAndMatrixTypes(t),t=IYe(this,t),t=n.unnormalize(t),gYe(this,e,t)};cD.prototype.getTypedArray=function(){if(l(this._values))return this._values.typedArray};function Mme(e){if(!Array.isArray(e)||!l(e.slice))return e;let t=[];for(let n=0;n<e.length;n++){let i=e[n];Array.isArray(i)?Zn(t,i):t.push(i)}return t}function pYe(e,t){Lme(e)&&Fme(e);let n=e._classProperty,i=n.isArray,r=n.type,o=bt.getComponentCount(r);if(l(e._unpackedValues)){let s=e._unpackedValues[t];return i?Ze(s,!0):s}return!i&&o===1?e._getValue(t):Nme(e,n,t)}function Nme(e,t,n){let i,r;if(t.isVariableLengthArray){i=e._arrayOffsets.get(n),r=e._arrayOffsets.get(n+1)-i;let s=bt.getComponentCount(t.type);i*=s,r*=s}else{let a=(t.arrayLength??1)*e._vectorComponentCount;i=n*a,r=a}let o=new Array(r);for(let s=0;s<r;s++)o[s]=e._getValue(i+s);return o}function gYe(e,t,n){vYe(e,t,n)&&Fme(e);let i=e._classProperty,r=i.isArray,o=i.type,s=bt.getComponentCount(o);if(l(e._unpackedValues)){i.isArray&&(n=Ze(n,!0)),e._unpackedValues[t]=n;return}if(!r&&s===1){e._setValue(t,n);return}let a,c;if(i.isVariableLengthArray)a=e._arrayOffsets.get(t),c=e._arrayOffsets.get(t+1)-a;else{let f=(i.arrayLength??1)*e._vectorComponentCount;a=t*f,c=f}for(let u=0;u<c;++u)e._setValue(a+u,n[u])}function _Ye(e,t,n){let i=n.get(e),r=n.get(e+1)-i;return ff(t.typedArray,i,r)}function yYe(e,t){let n=e>>3,i=e%8;return(t.typedArray[n]>>i&1)===1}function AYe(e,t,n){let i=e>>3,r=e%8;n?t.typedArray[i]|=1<<r:t.typedArray[i]&=~(1<<r)}function bYe(e,t){let n=t.dataView,i=e*8,r=0,o=(n.getUint8(i+7)&128)>0,s=!0;for(let a=0;a<8;++a){let c=n.getUint8(i+a);o&&(s?c!==0&&(c=~(c-1)&255,s=!1):c=~c&255),r+=c*Math.pow(256,a)}return o&&(r=-r),r}function xYe(e,t){let n=t.dataView,i=e*8,r=BigInt(0),o=(n.getUint8(i+7)&128)>0,s=!0;for(let a=0;a<8;++a){let c=n.getUint8(i+a);o&&(s?c!==0&&(c=~(c-1)&255,s=!1):c=~c&255),r+=BigInt(c)*(BigInt(1)<<BigInt(a*8))}return o&&(r=-r),r}function TYe(e,t){let n=t.dataView,i=e*8,r=n.getUint32(i,!0),o=n.getUint32(i+4,!0);return r+4294967296*o}function EYe(e,t){let n=t.dataView,i=e*8,r=BigInt(n.getUint32(i,!0)),o=BigInt(n.getUint32(i+4,!0));return r+BigInt(4294967296)*o}function CYe(e){switch(e){case Ft.INT8:return Y.BYTE;case Ft.UINT8:return Y.UNSIGNED_BYTE;case Ft.INT16:return Y.SHORT;case Ft.UINT16:return Y.UNSIGNED_SHORT;case Ft.INT32:return Y.INT;case Ft.UINT32:return Y.UNSIGNED_INT;case Ft.FLOAT32:return Y.FLOAT;case Ft.FLOAT64:return Y.DOUBLE}}function Lme(e){if(l(e._unpackedValues))return!1;let t=e._classProperty,n=t.type,i=t.valueType;return n===bt.STRING||i===Ft.INT64&&!dn.supportsBigInt64Array()||i===Ft.UINT64&&!dn.supportsBigUint64Array()}function vYe(e,t,n){if(Lme(e))return!0;let i=e._arrayOffsets;if(l(i)){let r=i.get(t+1)-i.get(t),o=n.length;if(r!==o)return!0}return!1}function Fme(e){e._unpackedValues=SYe(e),e._arrayOffsets=void 0,e._stringOffsets=void 0,e._values=void 0}function SYe(e){let t=e._count,n=new Array(t),i=e._classProperty,r=i.isArray,o=i.type,s=bt.getComponentCount(o);if(!r&&s===1){for(let a=0;a<t;++a)n[a]=e._getValue(a);return n}for(let a=0;a<t;a++)n[a]=Nme(e,i,a);return n}function wYe(e,t){let i=e._classProperty.isVariableLengthArray;return!e._hasValueTransform||i?t:Z0.valueTransformInPlace(t,e._offset,e._scale,Ft.applyValueTransform)}function IYe(e,t){let i=e._classProperty.isVariableLengthArray;return!e._hasValueTransform||i?t:Z0.valueTransformInPlace(t,e._offset,e._scale,Ft.unapplyValueTransform)}function wK(e,t,n){let i=this,r,o,s;if(t===Ft.INT64)dn.supportsBigInt()?dn.supportsBigInt64Array()?(r=new BigInt64Array(e.buffer,e.byteOffset,n),s=function(a,c){i.typedArray[a]=BigInt(c)}):(r=new Uint8Array(e.buffer,e.byteOffset,n*8),o=function(a){return xYe(a,i)}):(yt("INT64 type is not fully supported on this platform. Values greater than 2^53 - 1 or less than -(2^53 - 1) may lose precision when read."),r=new Uint8Array(e.buffer,e.byteOffset,n*8),o=function(a){return bYe(a,i)});else if(t===Ft.UINT64)dn.supportsBigInt()?dn.supportsBigUint64Array()?(r=new BigUint64Array(e.buffer,e.byteOffset,n),s=function(a,c){i.typedArray[a]=BigInt(c)}):(r=new Uint8Array(e.buffer,e.byteOffset,n*8),o=function(a){return EYe(a,i)}):(yt("UINT64 type is not fully supported on this platform. Values greater than 2^53 - 1 may lose precision when read."),r=new Uint8Array(e.buffer,e.byteOffset,n*8),o=function(a){return TYe(a,i)});else{let a=CYe(t);r=Y.createArrayBufferView(a,e.buffer,e.byteOffset,n),s=function(c,u){i.typedArray[c]=u}}l(o)||(o=function(a){return i.typedArray[a]}),this.typedArray=r,this.dataView=new DataView(r.buffer,r.byteOffset),this.get=o,this.set=s,this._componentType=t}var h3=cD;function Sh(e){e=e??H.EMPTY_OBJECT;let t=e.count,n=e.class,i=0,r={};if(l(e.properties)){for(let o in e.properties)if(e.properties.hasOwnProperty(o)){let s=new h3({count:t,property:e.properties[o],classProperty:n.properties[o],bufferViews:e.bufferViews});r[o]=s,i+=s.byteLength}}this._count=t,this._class=n,this._properties=r,this._byteLength=i}Object.defineProperties(Sh.prototype,{count:{get:function(){return this._count}},class:{get:function(){return this._class}},byteLength:{get:function(){return this._byteLength}},properties:{get:function(){return this._properties}}});Sh.prototype.hasProperty=function(e){return Xn.hasProperty(e,this._properties,this._class)};Sh.prototype.hasPropertyBySemantic=function(e){return Xn.hasPropertyBySemantic(e,this._properties,this._class)};Sh.prototype.getPropertyIds=function(e){return Xn.getPropertyIds(this._properties,this._class,e)};Sh.prototype.getProperty=function(e,t){let n=this._properties[t],i;return l(n)?i=n.get(e):i=PYe(this._class,t),i};Sh.prototype.setProperty=function(e,t,n){let i=this._properties[t];return l(i)?(i.set(e,n),!0):!1};Sh.prototype.getPropertyBySemantic=function(e,t){let n,i=this._class.propertiesBySemantic;if(l(i)&&(n=i[t]),l(n))return this.getProperty(e,n.id)};Sh.prototype.setPropertyBySemantic=function(e,t,n){let i,r=this._class.propertiesBySemantic;return l(r)&&(i=r[t]),l(i)?this.setProperty(e,i.id,n):!1};Sh.prototype.getPropertyTypedArray=function(e){let t=this._properties[e];if(l(t))return t.getTypedArray()};Sh.prototype.getPropertyTypedArrayBySemantic=function(e){let t,n=this._class.propertiesBySemantic;if(l(n)&&(t=n[e]),l(t))return this.getPropertyTypedArray(t.id)};function PYe(e,t){let n=e.properties;if(!l(n))return;let i=n[t];if(l(i)&&l(i.default)){let r=i.default;return i.isArray&&(r=Ze(r,!0)),r=i.normalize(r),i.unpackVectorAndMatrixTypes(r)}}var wh=Sh;var IK=class{get cacheKey(){pe.throwInstantiationError()}load(){pe.throwInstantiationError()}unload(){}process(t){return!1}getError(t,n){l(n)&&l(n.message)&&(t+=` +`;var a3=`in vec3 v_positionEC; +in vec3 v_normalEC; +in vec2 v_st; +void main() +{ +vec3 positionToEyeEC = -v_positionEC; +vec3 normalEC = normalize(v_normalEC); +#ifdef FACE_FORWARD +normalEC = faceforward(normalEC, vec3(0.0, 0.0, 1.0), -normalEC); +#endif +czm_materialInput materialInput; +materialInput.normalEC = normalEC; +materialInput.positionToEyeEC = positionToEyeEC; +materialInput.st = v_st; +czm_material material = czm_getMaterial(materialInput); +#ifdef FLAT +out_FragColor = vec4(material.diffuse + material.emission, material.alpha); +#else +out_FragColor = czm_phong(normalize(positionToEyeEC), material, czm_lightDirectionEC); +#endif +} +`;var c3=`in vec3 position3DHigh; +in vec3 position3DLow; +in vec3 normal; +in vec2 st; +in float batchId; +out vec3 v_positionEC; +out vec3 v_normalEC; +out vec2 v_st; +void main() +{ +vec4 p = czm_computePosition(); +v_positionEC = (czm_modelViewRelativeToEye * p).xyz; +v_normalEC = czm_normal * normal; +v_st = st; +gl_Position = czm_modelViewProjectionRelativeToEye * p; +} +`;function Wb(e){e=e??H.EMPTY_OBJECT;let t=e.translucent??!0,n=e.closed??!1,i=e.materialSupport??Wb.MaterialSupport.TEXTURED;this.material=l(e.material)?e.material:rr.fromType(rr.ColorType),this.translucent=t,this._vertexShaderSource=e.vertexShaderSource??i.vertexShaderSource,this._fragmentShaderSource=e.fragmentShaderSource??i.fragmentShaderSource,this._renderState=Rr.getDefaultRenderState(t,n,e.renderState),this._closed=n,this._materialSupport=i,this._vertexFormat=i.vertexFormat,this._flat=e.flat??!1,this._faceForward=e.faceForward??!n}Object.defineProperties(Wb.prototype,{vertexShaderSource:{get:function(){return this._vertexShaderSource}},fragmentShaderSource:{get:function(){return this._fragmentShaderSource}},renderState:{get:function(){return this._renderState}},closed:{get:function(){return this._closed}},materialSupport:{get:function(){return this._materialSupport}},vertexFormat:{get:function(){return this._vertexFormat}},flat:{get:function(){return this._flat}},faceForward:{get:function(){return this._faceForward}}});Wb.prototype.getFragmentShaderSource=Rr.prototype.getFragmentShaderSource;Wb.prototype.isTranslucent=Rr.prototype.isTranslucent;Wb.prototype.getRenderState=Rr.prototype.getRenderState;Wb.MaterialSupport={BASIC:Object.freeze({vertexFormat:Be.POSITION_AND_NORMAL,vertexShaderSource:s3,fragmentShaderSource:o3}),TEXTURED:Object.freeze({vertexFormat:Be.POSITION_NORMAL_AND_ST,vertexShaderSource:c3,fragmentShaderSource:a3}),ALL:Object.freeze({vertexFormat:Be.ALL,vertexShaderSource:r3,fragmentShaderSource:i3})};var Cr=Wb;function yC(e,t){this._primitives=e,this._orderedGroundPrimitives=t,this._dynamicUpdaters=new zt}yC.prototype.add=function(e,t){this._dynamicUpdaters.set(t.id,t.createDynamicUpdater(this._primitives,this._orderedGroundPrimitives))};yC.prototype.remove=function(e){let t=e.id,n=this._dynamicUpdaters.get(t);l(n)&&(this._dynamicUpdaters.remove(t),n.destroy())};yC.prototype.update=function(e){let t=this._dynamicUpdaters.values;for(let n=0,i=t.length;n<i;n++)t[n].update(e);return!0};yC.prototype.removeAllPrimitives=function(){let e=this._dynamicUpdaters.values;for(let t=0,n=e.length;t<n;t++)e[t].destroy();this._dynamicUpdaters.removeAll()};yC.prototype.getBoundingSphere=function(e,t){return e=this._dynamicUpdaters.get(e.id),l(e)&&l(e.getBoundingSphere)?e.getBoundingSphere(t):Pt.FAILED};var AC=yC;var HWe=new h;function ap(e){e=e??H.EMPTY_OBJECT;let t=e.minimum,n=e.maximum;this._min=h.clone(t),this._max=h.clone(n),this._offsetAttribute=e.offsetAttribute,this._workerName="createBoxOutlineGeometry"}ap.fromDimensions=function(e){e=e??H.EMPTY_OBJECT;let t=e.dimensions,n=h.multiplyByScalar(t,.5,new h);return new ap({minimum:h.negate(n,new h),maximum:n,offsetAttribute:e.offsetAttribute})};ap.fromAxisAlignedBoundingBox=function(e){return new ap({minimum:e.minimum,maximum:e.maximum})};ap.packedLength=2*h.packedLength+1;ap.pack=function(e,t,n){return n=n??0,h.pack(e._min,t,n),h.pack(e._max,t,n+h.packedLength),t[n+h.packedLength*2]=e._offsetAttribute??-1,t};var rpe=new h,ope=new h,ipe={minimum:rpe,maximum:ope,offsetAttribute:void 0};ap.unpack=function(e,t,n){t=t??0;let i=h.unpack(e,t,rpe),r=h.unpack(e,t+h.packedLength,ope),o=e[t+h.packedLength*2];return l(n)?(n._min=h.clone(i,n._min),n._max=h.clone(r,n._max),n._offsetAttribute=o===-1?void 0:o,n):(ipe.offsetAttribute=o===-1?void 0:o,new ap(ipe))};ap.createGeometry=function(e){let t=e._min,n=e._max;if(h.equals(t,n))return;let i=new En,r=new Uint16Array(24),o=new Float64Array(24);o[0]=t.x,o[1]=t.y,o[2]=t.z,o[3]=n.x,o[4]=t.y,o[5]=t.z,o[6]=n.x,o[7]=n.y,o[8]=t.z,o[9]=t.x,o[10]=n.y,o[11]=t.z,o[12]=t.x,o[13]=t.y,o[14]=n.z,o[15]=n.x,o[16]=t.y,o[17]=n.z,o[18]=n.x,o[19]=n.y,o[20]=n.z,o[21]=t.x,o[22]=n.y,o[23]=n.z,i.position=new Ne({componentDatatype:Y.DOUBLE,componentsPerAttribute:3,values:o}),r[0]=4,r[1]=5,r[2]=5,r[3]=6,r[4]=6,r[5]=7,r[6]=7,r[7]=4,r[8]=0,r[9]=1,r[10]=1,r[11]=2,r[12]=2,r[13]=3,r[14]=3,r[15]=0,r[16]=0,r[17]=4,r[18]=1,r[19]=5,r[20]=2,r[21]=6,r[22]=3,r[23]=7;let s=h.subtract(n,t,HWe),a=h.magnitude(s)*.5;if(l(e._offsetAttribute)){let c=o.length,u=e._offsetAttribute===pn.NONE?0:1,f=new Uint8Array(c/3).fill(u);i.applyOffset=new Ne({componentDatatype:Y.UNSIGNED_BYTE,componentsPerAttribute:1,values:f})}return new wt({attributes:i,indices:r,primitiveType:Oe.LINES,boundingSphere:new ue(h.ZERO,a),offsetAttribute:e._offsetAttribute})};var cp=ap;function iD(e,t){e=e??0,t=t??Number.MAX_VALUE,this.value=new Float32Array([e,t])}Object.defineProperties(iD.prototype,{componentDatatype:{get:function(){return Y.FLOAT}},componentsPerAttribute:{get:function(){return 2}},normalize:{get:function(){return!1}}});iD.fromDistanceDisplayCondition=function(e){return new iD(e.near,e.far)};iD.toValue=function(e,t){return l(t)?(t[0]=e.near,t[1]=e.far,t):new Float32Array([e.near,e.far])};var ti=iD;function l3(e){e=e??!0,this.value=l3.toValue(e)}Object.defineProperties(l3.prototype,{componentDatatype:{get:function(){return Y.UNSIGNED_BYTE}},componentsPerAttribute:{get:function(){return 1}},normalize:{get:function(){return!1}}});l3.toValue=function(e,t){return l(t)?(t[0]=e,t):new Uint8Array([e])};var Dn=l3;function bC(){pe.throwInstantiationError()}Object.defineProperties(bC.prototype,{isConstant:{get:pe.throwInstantiationError},definitionChanged:{get:pe.throwInstantiationError}});bC.prototype.getType=pe.throwInstantiationError;bC.prototype.getValue=pe.throwInstantiationError;bC.prototype.equals=pe.throwInstantiationError;var GWe=new K;bC.getValue=function(e,t,n){let i;return l(e)||(e=K.now(GWe)),l(t)&&(i=t.getType(e),l(i))?((!l(n)||n.type!==i)&&(n=rr.fromType(i)),t.getValue(e,n.uniforms),n):((!l(n)||n.type!==rr.ColorType)&&(n=rr.fromType(rr.ColorType)),z.clone(z.WHITE,n.uniforms.color),n)};var So=bC;function qb(e,t,n){this._primitives=t,this._orderedGroundPrimitives=n,this._primitive=void 0,this._outlinePrimitive=void 0,this._geometryUpdater=e,this._options=e._options,this._entity=e._entity,this._material=void 0}qb.prototype._isHidden=function(e,t,n){return!e.isShowing||!e.isAvailable(n)||!X.getValueOrDefault(t.show,n,!0)};qb.prototype._setOptions=pe.throwInstantiationError;qb.prototype.update=function(e){let t=this._geometryUpdater,n=t._onTerrain,i=this._primitives,r=this._orderedGroundPrimitives;n?r.remove(this._primitive):(i.removeAndDestroy(this._primitive),i.removeAndDestroy(this._outlinePrimitive),this._outlinePrimitive=void 0),this._primitive=void 0;let o=this._entity,s=o[this._geometryUpdater._geometryPropertyName];if(this._setOptions(o,s,e),this._isHidden(o,s,e))return;let a=this._geometryUpdater.shadowsProperty.getValue(e),c=this._options;if(!l(s.fill)||s.fill.getValue(e)){let u=t.fillMaterialProperty,f=u instanceof Kt,d,p=t._getIsClosed(c);if(f)d=new An({closed:p,flat:n&&!t._supportsMaterialsforEntitiesOnTerrain});else{let g=So.getValue(e,u,this._material);this._material=g,d=new Cr({material:g,translucent:g.isTranslucent(),closed:p})}if(n)c.vertexFormat=An.VERTEX_FORMAT,this._primitive=r.add(new pu({geometryInstances:this._geometryUpdater.createFillGeometryInstance(e),appearance:d,asynchronous:!1,shadows:a,classificationType:this._geometryUpdater.classificationTypeProperty.getValue(e)}),X.getValueOrUndefined(this._geometryUpdater.zIndex,e));else{c.vertexFormat=d.vertexFormat;let g=this._geometryUpdater.createFillGeometryInstance(e);f&&(d.translucent=g.attributes.color.value[3]!==255),this._primitive=i.add(new Mn({geometryInstances:g,appearance:d,asynchronous:!1,shadows:a}))}}if(!n&&l(s.outline)&&s.outline.getValue(e)){let u=this._geometryUpdater.createOutlineGeometryInstance(e),f=X.getValueOrDefault(s.outlineWidth,e,1);this._outlinePrimitive=i.add(new Mn({geometryInstances:u,appearance:new An({flat:!0,translucent:u.attributes.color.value[3]!==255,renderState:{lineWidth:t._scene.clampLineWidth(f)}}),asynchronous:!1,shadows:a}))}};qb.prototype.getBoundingSphere=function(e){let t=this._entity,n=this._primitive,i=this._outlinePrimitive,r;return l(n)&&n.show&&n.ready&&(r=n.getGeometryInstanceAttributes(t),l(r)&&l(r.boundingSphere))?(ue.clone(r.boundingSphere,e),Pt.DONE):l(i)&&i.show&&i.ready&&(r=i.getGeometryInstanceAttributes(t),l(r)&&l(r.boundingSphere))?(ue.clone(r.boundingSphere,e),Pt.DONE):l(n)&&!n.ready||l(i)&&!i.ready?Pt.PENDING:Pt.FAILED};qb.prototype.isDestroyed=function(){return!1};qb.prototype.destroy=function(){let e=this._primitives,t=this._orderedGroundPrimitives;this._geometryUpdater._onTerrain?t.remove(this._primitive):e.removeAndDestroy(this._primitive),e.removeAndDestroy(this._outlinePrimitive),le(this)};var Oi=qb;var spe={};function rD(e,t){l(spe[e])||(spe[e]=!0,console.warn(t??e))}rD.geometryOutlines="Entity geometry outlines are unsupported on terrain. Outlines will be disabled. To enable outlines, disable geometry terrain clamping by explicitly setting height to 0.";rD.geometryZIndex="Entity geometry with zIndex are unsupported when height or extrudedHeight are defined. zIndex will be ignored";rD.geometryHeightReference="Entity corridor, ellipse, polygon or rectangle with heightReference must also have a defined height. heightReference will be ignored";rD.geometryExtrudedHeightReference="Entity corridor, ellipse, polygon or rectangle with extrudedHeightReference must also have a defined extrudedHeight. extrudedHeightReference will be ignored";var yt=rD;var WWe=new Kt(z.WHITE),qWe=new hi(!0),YWe=new hi(!0),XWe=new hi(!1),KWe=new hi(z.BLACK),$We=new hi(Pn.DISABLED),JWe=new hi(new Gt),ZWe=new hi(Qn.BOTH);function Nl(e){let t=e.entity,n=e.geometryPropertyName;this._entity=t,this._scene=e.scene,this._fillEnabled=!1,this._isClosed=!1,this._onTerrain=!1,this._dynamic=!1,this._outlineEnabled=!1,this._geometryChanged=new be,this._showProperty=void 0,this._materialProperty=void 0,this._showOutlineProperty=void 0,this._outlineColorProperty=void 0,this._outlineWidth=1,this._shadowsProperty=void 0,this._distanceDisplayConditionProperty=void 0,this._classificationTypeProperty=void 0,this._options=e.geometryOptions,this._geometryPropertyName=n,this._id=`${n}-${t.id}`,this._observedPropertyNames=e.observedPropertyNames,this._supportsMaterialsforEntitiesOnTerrain=Qr.supportsMaterialsforEntitiesOnTerrain(e.scene)}Object.defineProperties(Nl.prototype,{id:{get:function(){return this._id}},entity:{get:function(){return this._entity}},fillEnabled:{get:function(){return this._fillEnabled}},hasConstantFill:{get:function(){return!this._fillEnabled||!l(this._entity.availability)&&X.isConstant(this._showProperty)&&X.isConstant(this._fillProperty)}},fillMaterialProperty:{get:function(){return this._materialProperty}},outlineEnabled:{get:function(){return this._outlineEnabled}},hasConstantOutline:{get:function(){return!this._outlineEnabled||!l(this._entity.availability)&&X.isConstant(this._showProperty)&&X.isConstant(this._showOutlineProperty)}},outlineColorProperty:{get:function(){return this._outlineColorProperty}},outlineWidth:{get:function(){return this._outlineWidth}},shadowsProperty:{get:function(){return this._shadowsProperty}},distanceDisplayConditionProperty:{get:function(){return this._distanceDisplayConditionProperty}},classificationTypeProperty:{get:function(){return this._classificationTypeProperty}},isDynamic:{get:function(){return this._dynamic}},isClosed:{get:function(){return this._isClosed}},onTerrain:{get:function(){return this._onTerrain}},geometryChanged:{get:function(){return this._geometryChanged}}});Nl.prototype.isOutlineVisible=function(e){let t=this._entity;return(this._outlineEnabled&&t.isAvailable(e)&&this._showProperty.getValue(e)&&this._showOutlineProperty.getValue(e))??!1};Nl.prototype.isFilled=function(e){let t=this._entity;return(this._fillEnabled&&t.isAvailable(e)&&this._showProperty.getValue(e)&&this._fillProperty.getValue(e))??!1};Nl.prototype.createFillGeometryInstance=pe.throwInstantiationError;Nl.prototype.createOutlineGeometryInstance=pe.throwInstantiationError;Nl.prototype.isDestroyed=function(){return!1};Nl.prototype.destroy=function(){le(this)};Nl.prototype._isHidden=function(e,t){let n=t.show;return l(n)&&n.isConstant&&!n.getValue(it.MINIMUM_VALUE)};Nl.prototype._isOnTerrain=function(e,t){return!1};Nl.prototype._getIsClosed=function(e){return!0};Nl.prototype._isDynamic=pe.throwInstantiationError;Nl.prototype._setStaticOptions=pe.throwInstantiationError;Nl.prototype._onEntityPropertyChanged=function(e,t,n,i){if(this._observedPropertyNames.indexOf(t)===-1)return;let r=this._entity[this._geometryPropertyName];if(!l(r)){(this._fillEnabled||this._outlineEnabled)&&(this._fillEnabled=!1,this._outlineEnabled=!1,this._geometryChanged.raiseEvent(this));return}let o=r.fill,s=l(o)&&o.isConstant?o.getValue(it.MINIMUM_VALUE):!0,a=r.outline,c=l(a);if(c&&a.isConstant&&(c=a.getValue(it.MINIMUM_VALUE)),!s&&!c){(this._fillEnabled||this._outlineEnabled)&&(this._fillEnabled=!1,this._outlineEnabled=!1,this._geometryChanged.raiseEvent(this));return}let u=r.show;if(this._isHidden(e,r)){(this._fillEnabled||this._outlineEnabled)&&(this._fillEnabled=!1,this._outlineEnabled=!1,this._geometryChanged.raiseEvent(this));return}this._materialProperty=r.material??WWe,this._fillProperty=o??YWe,this._showProperty=u??qWe,this._showOutlineProperty=r.outline??XWe,this._outlineColorProperty=c?r.outlineColor??KWe:void 0,this._shadowsProperty=r.shadows??$We,this._distanceDisplayConditionProperty=r.distanceDisplayCondition??JWe,this._classificationTypeProperty=r.classificationType??ZWe,this._fillEnabled=s;let f=this._isOnTerrain(e,r)&&(this._supportsMaterialsforEntitiesOnTerrain||this._materialProperty instanceof Kt);if(c&&f&&(yt(yt.geometryOutlines),c=!1),this._onTerrain=f,this._outlineEnabled=c,this._isDynamic(e,r))this._dynamic||(this._dynamic=!0,this._geometryChanged.raiseEvent(this));else{this._setStaticOptions(e,r),this._isClosed=this._getIsClosed(this._options);let d=r.outlineWidth;this._outlineWidth=l(d)?d.getValue(it.MINIMUM_VALUE):1,this._dynamic=!1,this._geometryChanged.raiseEvent(this)}};Nl.prototype.createDynamicUpdater=function(e,t){return new this.constructor.DynamicGeometryUpdater(this,e,t)};var Mi=Nl;function xC(e,t){this._callback=void 0,this._isConstant=void 0,this._definitionChanged=new be,this.setCallback(e,t)}Object.defineProperties(xC.prototype,{isConstant:{get:function(){return this._isConstant}},definitionChanged:{get:function(){return this._definitionChanged}}});var QWe=new K;xC.prototype.getValue=function(e,t){return l(e)||(e=K.now(QWe)),this._callback(e,t)};xC.prototype.setCallback=function(e,t){let n=this._callback!==e||this._isConstant!==t;this._callback=e,this._isConstant=t,n&&this._definitionChanged.raiseEvent(this)};xC.prototype.equals=function(e){return this===e||e instanceof xC&&this._callback===e._callback&&this._isConstant===e._isConstant};var lp=xC;var ape=new h;function TC(e,t,n,i){this._scene=e,this._heightReference=n,this._extrudedHeightReference=i,this._positionProperty=t,this._position=new h,this._cartographicPosition=new he,this._normal=new h,this._definitionChanged=new be,this._terrainHeight=0,this._removeCallbackFunc=void 0,this._removeEventListener=void 0,this._removeModeListener=void 0;let r=this;if(l(e.globe)&&(this._removeEventListener=e.terrainProviderChanged.addEventListener(function(){r._updateClamping()}),this._removeModeListener=e.morphComplete.addEventListener(function(){r._updateClamping()})),t.isConstant){let o=t.getValue(it.MINIMUM_VALUE,ape);if(!l(o)||h.equals(o,h.ZERO)||!l(e.globe))return;this._position=h.clone(o,this._position),this._updateClamping(),this._normal=e.ellipsoid.geodeticSurfaceNormal(o,this._normal)}}Object.defineProperties(TC.prototype,{isConstant:{get:function(){return!1}},definitionChanged:{get:function(){return this._definitionChanged}}});TC.prototype._updateClamping=function(){l(this._removeCallbackFunc)&&this._removeCallbackFunc();let e=this._scene,t=this._position;if(h.equals(t,h.ZERO)){this._terrainHeight=0;return}let i=e.ellipsoid.cartesianToCartographic(t,this._cartographicPosition),r=e.getHeight(i,this._heightReference);l(r)?this._terrainHeight=r:this._terrainHeight=0;let o=s=>{this._terrainHeight=s.height,this.definitionChanged.raiseEvent()};this._removeCallbackFunc=e.updateHeight(i,o,this._heightReference)};var eqe=new K;TC.prototype.getValue=function(e,t){l(e)||(e=K.now(eqe));let n=X.getValueOrDefault(this._heightReference,e,We.NONE),i=X.getValueOrDefault(this._extrudedHeightReference,e,We.NONE);if(n===We.NONE&&!G_(i))return this._position=h.clone(h.ZERO,this._position),h.clone(h.ZERO,t);if(this._positionProperty.isConstant&&n!==We.CLIP_TO_GROUND)return h.multiplyByScalar(this._normal,this._terrainHeight,t);let r=this._scene,o=this._positionProperty.getValue(e,ape);if(!l(o)||h.equals(o,h.ZERO)||!l(r.globe))return h.clone(h.ZERO,t);if(h.equalsEpsilon(this._position,o,P.EPSILON10)&&n!==We.CLIP_TO_GROUND)return h.multiplyByScalar(this._normal,this._terrainHeight,t);this._position=h.clone(o,this._position),this._updateClamping();let s=r.ellipsoid.geodeticSurfaceNormal(o,this._normal);if(n===We.CLIP_TO_GROUND){let c=r.globe.ellipsoid.cartesianToCartographic(o,scratchCarto);return this._terrainHeight>=c.height?h.multiplyByScalar(s,this._terrainHeight-c.height,t):h.clone(h.ZERO,t)}return h.multiplyByScalar(s,this._terrainHeight,t)};TC.prototype.isDestroyed=function(){return!1};TC.prototype.destroy=function(){return l(this._removeEventListener)&&this._removeEventListener(),l(this._removeModeListener)&&this._removeModeListener(),l(this._removeCallbackFunc)&&this._removeCallbackFunc(),le(this)};var EC=TC;function tqe(e,t,n,i){if(Mi.prototype._onEntityPropertyChanged.call(this,e,t,n,i),this._observedPropertyNames.indexOf(t)===-1)return;let r=this._entity[this._geometryPropertyName];if(!l(r))return;l(this._terrainOffsetProperty)&&(this._terrainOffsetProperty.destroy(),this._terrainOffsetProperty=void 0);let o=r.heightReference;if(l(o)){let s=new lp(this._computeCenter.bind(this),!this._dynamic);this._terrainOffsetProperty=new EC(this._scene,s,o)}}var ey=tqe;var cpe=h.ZERO,lpe=new h,nqe=new h,upe=new z;function iqe(e){this.id=e,this.vertexFormat=void 0,this.dimensions=void 0,this.offsetAttribute=void 0}function cf(e,t){Mi.call(this,{entity:e,scene:t,geometryOptions:new iqe(e),geometryPropertyName:"box",observedPropertyNames:["availability","position","orientation","box"]}),this._onEntityPropertyChanged(e,"box",e.box,void 0)}l(Object.create)&&(cf.prototype=Object.create(Mi.prototype),cf.prototype.constructor=cf);Object.defineProperties(cf.prototype,{terrainOffsetProperty:{get:function(){return this._terrainOffsetProperty}}});cf.prototype.createFillGeometryInstance=function(e){let t=this._entity,n=t.isAvailable(e),i=new Dn(n&&t.isShowing&&this._showProperty.getValue(e)&&this._fillProperty.getValue(e)),r=this._distanceDisplayConditionProperty.getValue(e),o=ti.fromDistanceDisplayCondition(r),s={show:i,distanceDisplayCondition:o,color:void 0,offset:void 0};if(this._materialProperty instanceof Kt){let a;l(this._materialProperty.color)&&(this._materialProperty.color.isConstant||n)&&(a=this._materialProperty.color.getValue(e,upe)),l(a)||(a=z.WHITE),s.color=Jt.fromColor(a)}return l(this._options.offsetAttribute)&&(s.offset=Er.fromCartesian3(X.getValueOrDefault(this._terrainOffsetProperty,e,cpe,lpe))),new Bt({id:t,geometry:zc.fromDimensions(this._options),modelMatrix:t.computeModelMatrixForHeightReference(e,t.box.heightReference,this._options.dimensions.z*.5,this._scene.ellipsoid),attributes:s})};cf.prototype.createOutlineGeometryInstance=function(e){let t=this._entity,n=t.isAvailable(e),i=X.getValueOrDefault(this._outlineColorProperty,e,z.BLACK,upe),r=this._distanceDisplayConditionProperty.getValue(e),o={show:new Dn(n&&t.isShowing&&this._showProperty.getValue(e)&&this._showOutlineProperty.getValue(e)),color:Jt.fromColor(i),distanceDisplayCondition:ti.fromDistanceDisplayCondition(r),offset:void 0};return l(this._options.offsetAttribute)&&(o.offset=Er.fromCartesian3(X.getValueOrDefault(this._terrainOffsetProperty,e,cpe,lpe))),new Bt({id:t,geometry:cp.fromDimensions(this._options),modelMatrix:t.computeModelMatrixForHeightReference(e,t.box.heightReference,this._options.dimensions.z*.5,this._scene.ellipsoid),attributes:o})};cf.prototype._computeCenter=function(e,t){return X.getValueOrUndefined(this._entity.position,e,t)};cf.prototype._isHidden=function(e,t){return!l(t.dimensions)||!l(e.position)||Mi.prototype._isHidden.call(this,e,t)};cf.prototype._isDynamic=function(e,t){return!e.position.isConstant||!X.isConstant(e.orientation)||!t.dimensions.isConstant||!X.isConstant(t.outlineWidth)};cf.prototype._setStaticOptions=function(e,t){let n=X.getValueOrDefault(t.heightReference,it.MINIMUM_VALUE,We.NONE),i=this._options;i.vertexFormat=this._materialProperty instanceof Kt?An.VERTEX_FORMAT:Cr.MaterialSupport.TEXTURED.vertexFormat,i.dimensions=t.dimensions.getValue(it.MINIMUM_VALUE,i.dimensions),i.offsetAttribute=n!==We.NONE?pn.ALL:void 0};cf.prototype._onEntityPropertyChanged=ey;cf.DynamicGeometryUpdater=CC;function CC(e,t,n){Oi.call(this,e,t,n)}l(Object.create)&&(CC.prototype=Object.create(Oi.prototype),CC.prototype.constructor=CC);CC.prototype._isHidden=function(e,t,n){let i=X.getValueOrUndefined(e.position,n,nqe),r=this._options.dimensions;return!l(i)||!l(r)||Oi.prototype._isHidden.call(this,e,t,n)};CC.prototype._setOptions=function(e,t,n){let i=X.getValueOrDefault(t.heightReference,n,We.NONE),r=this._options;r.dimensions=X.getValueOrUndefined(t.dimensions,n,r.dimensions),r.offsetAttribute=i!==We.NONE?pn.ALL:void 0};var u3=cf;var fpe={ROUNDED:0,MITERED:1,BEVELED:2};Object.freeze(fpe);var sr=fpe;var Ll={};Ll.numberOfPoints=function(e,t,n){let i=h.distance(e,t);return Math.ceil(i/n)};Ll.numberOfPointsRhumbLine=function(e,t,n){let i=Math.pow(e.longitude-t.longitude,2)+Math.pow(e.latitude-t.latitude,2);return Math.max(1,Math.ceil(Math.sqrt(i/(n*n))))};var rqe=new he;Ll.extractHeights=function(e,t){let n=e.length,i=new Array(n);for(let r=0;r<n;r++){let o=e[r];i[r]=t.cartesianToCartographic(o,rqe).height}return i};var oqe=new M,sqe=new h,dpe=new h,aqe=new sn(h.UNIT_X,0),hpe=new h,cqe=new sn(h.UNIT_X,0),lqe=new h,uqe=new h,PK=[];function ppe(e,t,n){let i=PK;i.length=e;let r;if(t===n){for(r=0;r<e;r++)i[r]=t;return i}let s=(n-t)/e;for(r=0;r<e;r++){let a=t+r*s;i[r]=a}return i}var d3=new he,f3=new he,ty=new h,DK=new h,fqe=new h,IK=new z_,oD=new Vc;function dqe(e,t,n,i,r,o,s,a){let c=i.scaleToGeodeticSurface(e,DK),u=i.scaleToGeodeticSurface(t,fqe),f=Ll.numberOfPoints(e,t,n),d=i.cartesianToCartographic(c,d3),p=i.cartesianToCartographic(u,f3),g=ppe(f,r,o);IK.setEndPoints(d,p);let m=IK.surfaceDistance/f,y=a;d.height=r;let A=i.cartographicToCartesian(d,ty);h.pack(A,s,y),y+=3;for(let b=1;b<f;b++){let x=IK.interpolateUsingSurfaceDistance(b*m,f3);x.height=g[b],A=i.cartographicToCartesian(x,ty),h.pack(A,s,y),y+=3}return y}function hqe(e,t,n,i,r,o,s,a){let c=i.cartesianToCartographic(e,d3),u=i.cartesianToCartographic(t,f3),f=Ll.numberOfPointsRhumbLine(c,u,n);c.height=0,u.height=0;let d=ppe(f,r,o);oD.ellipsoid.equals(i)||(oD=new Vc(void 0,void 0,i)),oD.setEndPoints(c,u);let p=oD.surfaceDistance/f,g=a;c.height=r;let m=i.cartographicToCartesian(c,ty);h.pack(m,s,g),g+=3;for(let y=1;y<f;y++){let A=oD.interpolateUsingSurfaceDistance(y*p,f3);A.height=d[y],m=i.cartographicToCartesian(A,ty),h.pack(m,s,g),g+=3}return g}Ll.wrapLongitude=function(e,t){let n=[],i=[];if(l(e)&&e.length>0){t=t??M.IDENTITY;let r=M.inverseTransformation(t,oqe),o=M.multiplyByPoint(r,h.ZERO,sqe),s=h.normalize(M.multiplyByPointAsVector(r,h.UNIT_Y,dpe),dpe),a=sn.fromPointNormal(o,s,aqe),c=h.normalize(M.multiplyByPointAsVector(r,h.UNIT_X,hpe),hpe),u=sn.fromPointNormal(o,c,cqe),f=1;n.push(h.clone(e[0]));let d=n[0],p=e.length;for(let g=1;g<p;++g){let m=e[g];if(sn.getPointDistance(u,d)<0||sn.getPointDistance(u,m)<0){let y=xi.lineSegmentPlane(d,m,a,lqe);if(l(y)){let A=h.multiplyByScalar(s,5e-9,uqe);sn.getPointDistance(a,d)<0&&h.negate(A,A),n.push(h.add(y,A,new h)),i.push(f+1),h.negate(A,A),n.push(h.add(y,A,new h)),f=1}}n.push(h.clone(e[g])),f++,d=m}i.push(f)}return{positions:n,lengths:i}};Ll.generateArc=function(e){l(e)||(e={});let t=e.positions,n=t.length,i=e.ellipsoid??ee.default,r=e.height??0,o=Array.isArray(r);if(n<1)return[];if(n===1){let y=i.scaleToGeodeticSurface(t[0],DK);if(r=o?r[0]:r,r!==0){let A=i.geodeticSurfaceNormal(y,ty);h.multiplyByScalar(A,r,A),h.add(y,A,y)}return[y.x,y.y,y.z]}let s=e.minDistance;if(!l(s)){let y=e.granularity??P.RADIANS_PER_DEGREE;s=P.chordLength(y,i.maximumRadius)}let a=0,c;for(c=0;c<n-1;c++)a+=Ll.numberOfPoints(t[c],t[c+1],s);let u=(a+1)*3,f=new Array(u),d=0;for(c=0;c<n-1;c++){let y=t[c],A=t[c+1],b=o?r[c]:r,x=o?r[c+1]:r;d=dqe(y,A,s,i,b,x,f,d)}PK.length=0;let p=t[n-1],g=i.cartesianToCartographic(p,d3);g.height=o?r[n-1]:r;let m=i.cartographicToCartesian(g,ty);return h.pack(m,f,u-3),f};var mpe=new he,mqe=new he;Ll.generateRhumbArc=function(e){l(e)||(e={});let t=e.positions,n=t.length,i=e.ellipsoid??ee.default,r=e.height??0,o=Array.isArray(r);if(n<1)return[];if(n===1){let b=i.scaleToGeodeticSurface(t[0],DK);if(r=o?r[0]:r,r!==0){let x=i.geodeticSurfaceNormal(b,ty);h.multiplyByScalar(x,r,x),h.add(b,x,b)}return[b.x,b.y,b.z]}let s=e.granularity??P.RADIANS_PER_DEGREE,a=0,c,u=i.cartesianToCartographic(t[0],mpe),f;for(c=0;c<n-1;c++)f=i.cartesianToCartographic(t[c+1],mqe),a+=Ll.numberOfPointsRhumbLine(u,f,s),u=he.clone(f,mpe);let d=(a+1)*3,p=new Array(d),g=0;for(c=0;c<n-1;c++){let b=t[c],x=t[c+1],T=o?r[c]:r,E=o?r[c+1]:r;g=hqe(b,x,s,i,T,E,p,g)}PK.length=0;let m=t[n-1],y=i.cartesianToCartographic(m,d3);y.height=o?r[n-1]:r;let A=i.cartographicToCartesian(y,ty);return h.pack(A,p,d-3),p};Ll.generateCartesianArc=function(e){let t=Ll.generateArc(e),n=t.length/3,i=new Array(n);for(let r=0;r<n;r++)i[r]=h.unpack(t,r*3);return i};Ll.generateCartesianRhumbArc=function(e){let t=Ll.generateRhumbArc(e),n=t.length/3,i=new Array(n);for(let r=0;r<n;r++)i[r]=h.unpack(t,r*3);return i};var ar=Ll;var Za=[new h,new h],pqe=new h,gqe=new h,_qe=new h,yqe=new h,Aqe=new h,bqe=new h,xqe=new h,Tqe=new h,Eqe=new h,vC=new h,h3=new h,sD={},RK=new he;function Cqe(e,t){let n=new Array(e.length);for(let i=0;i<e.length;i++){let r=e[i];RK=t.cartesianToCartographic(r,RK),n[i]=RK.height,e[i]=t.scaleToGeodeticSurface(r,r)}return n}function OK(e,t,n,i){let r=e[0],o=e[1],s=h.angleBetween(r,o),a=Math.ceil(s/i),c=new Array(a),u;if(t===n){for(u=0;u<a;u++)c[u]=t;return c.push(n),c}let d=(n-t)/a;for(u=1;u<a;u++){let p=t+u*d;c[u]=p}return c[0]=t,c.push(n),c}var m3=new h,p3=new h;function vqe(e,t,n,i){let r=new Ys(n,i),o=r.projectPointOntoPlane(h.add(n,e,m3),m3),s=r.projectPointOntoPlane(h.add(n,t,p3),p3),a=U.angleBetween(o,s);return s.x*o.y-s.y*o.x>=0?-a:a}var Sqe=new h(-1,0,0),Yb=new M,wqe=new M,MK=new $,Iqe=$.IDENTITY.clone(),Pqe=new h,Dqe=new se,gpe=new h;function J0(e,t,n,i,r,o,s,a){let c=Pqe,u=Dqe;Yb=At.eastNorthUpToFixedFrame(e,r,Yb),c=M.multiplyByPointAsVector(Yb,Sqe,c),c=h.normalize(c,c);let f=vqe(c,t,e,r);MK=$.fromRotationZ(f,MK),gpe.z=o,Yb=M.multiplyTransformation(Yb,M.fromRotationTranslation(MK,gpe,wqe),Yb);let d=Iqe;d[0]=s;for(let p=0;p<a;p++)for(let g=0;g<n.length;g+=3)u=h.fromArray(n,g,u),u=$.multiplyByVector(d,u,u),u=M.multiplyByPoint(Yb,u,u),i.push(u.x,u.y,u.z);return i}var Rqe=new h;function NK(e,t,n,i,r,o,s){for(let a=0;a<e.length;a+=3){let c=h.fromArray(e,a,Rqe);i=J0(c,t,n,i,r,o[a/3],s,1)}return i}function Oqe(e,t){let n=e.length,i=new Array(n*6),r=0,o=t.x+t.width/2,s=t.y+t.height/2,a=e[0];i[r++]=a.x-o,i[r++]=0,i[r++]=a.y-s;for(let c=1;c<n;c++){a=e[c];let u=a.x-o,f=a.y-s;i[r++]=u,i[r++]=0,i[r++]=f,i[r++]=u,i[r++]=0,i[r++]=f}return a=e[0],i[r++]=a.x-o,i[r++]=0,i[r]=a.y-s,i}function _pe(e,t){let n=e.length,i=new Array(n*3),r=0,o=t.x+t.width/2,s=t.y+t.height/2;for(let a=0;a<n;a++)i[r++]=e[a].x-o,i[r++]=0,i[r++]=e[a].y-s;return i}var ype=new Le,Ape=new h,bpe=new $;function xpe(e,t,n,i,r,o,s,a,c,u){let f=h.angleBetween(h.subtract(t,e,vC),h.subtract(n,e,h3)),d=i===sr.BEVELED?0:Math.ceil(f/P.toRadians(5)),p;r?p=$.fromQuaternion(Le.fromAxisAngle(h.negate(e,vC),f/(d+1),ype),bpe):p=$.fromQuaternion(Le.fromAxisAngle(e,f/(d+1),ype),bpe);let g,m;if(t=h.clone(t,Ape),d>0){let y=u?2:1;for(let A=0;A<d;A++)t=$.multiplyByVector(p,t,t),g=h.subtract(t,e,vC),g=h.normalize(g,g),r||(g=h.negate(g,g)),m=o.scaleToGeodeticSurface(t,h3),s=J0(m,g,a,s,o,c,1,y)}else g=h.subtract(t,e,vC),g=h.normalize(g,g),r||(g=h.negate(g,g)),m=o.scaleToGeodeticSurface(t,h3),s=J0(m,g,a,s,o,c,1,1),n=h.clone(n,Ape),g=h.subtract(n,e,vC),g=h.normalize(g,g),r||(g=h.negate(g,g)),m=o.scaleToGeodeticSurface(n,h3),s=J0(m,g,a,s,o,c,1,1);return s}sD.removeDuplicatesFromShape=function(e){let t=e.length,n=[];for(let i=t-1,r=0;r<t;i=r++){let o=e[i],s=e[r];U.equals(o,s)||n.push(s)}return n};sD.angleIsGreaterThanPi=function(e,t,n,i){let r=new Ys(n,i),o=r.projectPointOntoPlane(h.add(n,e,m3),m3),s=r.projectPointOntoPlane(h.add(n,t,p3),p3);return s.x*o.y-s.y*o.x>=0};var Mqe=new h,Nqe=new h;sD.computePositions=function(e,t,n,i,r){let o=i._ellipsoid,s=Cqe(e,o),a=i._granularity,c=i._cornerType,u=r?Oqe(t,n):_pe(t,n),f=r?_pe(t,n):void 0,d=n.height/2,p=n.width/2,g=e.length,m=[],y=r?[]:void 0,A=pqe,b=gqe,x=_qe,T=yqe,E=Aqe,v=bqe,S=xqe,I=Tqe,R=Eqe,O=e[0],L=e[1];T=o.geodeticSurfaceNormal(O,T),A=h.subtract(L,O,A),A=h.normalize(A,A),I=h.cross(T,A,I),I=h.normalize(I,I);let _=s[0],C=s[1];r&&(y=J0(O,I,f,y,o,_+d,1,1)),R=h.clone(O,R),O=L,b=h.negate(A,b);let w,D;for(let V=1;V<g-1;V++){let B=r?2:1;if(L=e[V+1],O.equals(L)){yt("Positions are too close and are considered equivalent with rounding error.");continue}A=h.subtract(L,O,A),A=h.normalize(A,A),T=o.geodeticSurfaceNormal(O,T);let j=h.multiplyByScalar(T,h.dot(A,T),Mqe);h.subtract(A,j,j),h.normalize(j,j);let k=h.multiplyByScalar(T,h.dot(b,T),Nqe);if(h.subtract(b,k,k),h.normalize(k,k),!P.equalsEpsilon(Math.abs(h.dot(j,k)),1,P.EPSILON7)){x=h.add(A,b,x),x=h.normalize(x,x),x=h.cross(x,T,x),x=h.cross(T,x,x),x=h.normalize(x,x);let q=1/Math.max(.25,h.magnitude(h.cross(x,b,vC))),Q=sD.angleIsGreaterThanPi(A,b,O,o);Q?(E=h.add(O,h.multiplyByScalar(x,q*p,x),E),v=h.add(E,h.multiplyByScalar(I,p,v),v),Za[0]=h.clone(R,Za[0]),Za[1]=h.clone(v,Za[1]),w=OK(Za,_+d,C+d,a),D=ar.generateArc({positions:Za,granularity:a,ellipsoid:o}),m=NK(D,I,u,m,o,w,1),I=h.cross(T,A,I),I=h.normalize(I,I),S=h.add(E,h.multiplyByScalar(I,p,S),S),c===sr.ROUNDED||c===sr.BEVELED?xpe(E,v,S,c,Q,o,m,u,C+d,r):(x=h.negate(x,x),m=J0(O,x,u,m,o,C+d,q,B)),R=h.clone(S,R)):(E=h.add(O,h.multiplyByScalar(x,q*p,x),E),v=h.add(E,h.multiplyByScalar(I,-p,v),v),Za[0]=h.clone(R,Za[0]),Za[1]=h.clone(v,Za[1]),w=OK(Za,_+d,C+d,a),D=ar.generateArc({positions:Za,granularity:a,ellipsoid:o}),m=NK(D,I,u,m,o,w,1),I=h.cross(T,A,I),I=h.normalize(I,I),S=h.add(E,h.multiplyByScalar(I,-p,S),S),c===sr.ROUNDED||c===sr.BEVELED?xpe(E,v,S,c,Q,o,m,u,C+d,r):m=J0(O,x,u,m,o,C+d,q,B),R=h.clone(S,R)),b=h.negate(A,b)}else m=J0(R,I,u,m,o,_+d,1,1),R=O;_=C,C=s[V+1],O=L}Za[0]=h.clone(R,Za[0]),Za[1]=h.clone(O,Za[1]),w=OK(Za,_+d,C+d,a),D=ar.generateArc({positions:Za,granularity:a,ellipsoid:o}),m=NK(D,I,u,m,o,w,1),r&&(y=J0(O,I,f,y,o,C+d,1,1)),g=m.length;let N=r?g+y.length:g,F=new Float64Array(N);return F.set(m),r&&F.set(y,g),F};var up=sD;var FK={},SC=new h,Spe=new h,Lqe=new h,Tpe=new h,Fl=[new h,new h],wpe=new h,Ipe=new h,Ppe=new h,Fqe=new h,Bqe=new h,kqe=new h,Uqe=new h,zqe=new h,Vqe=new h,jqe=new h,Epe=new Le,Cpe=new $;function g3(e,t,n,i,r){let o=h.angleBetween(h.subtract(t,e,SC),h.subtract(n,e,Spe)),s=i===sr.BEVELED?1:Math.ceil(o/P.toRadians(5))+1,a=s*3,c=new Array(a);c[a-3]=n.x,c[a-2]=n.y,c[a-1]=n.z;let u;r?u=$.fromQuaternion(Le.fromAxisAngle(h.negate(e,SC),o/s,Epe),Cpe):u=$.fromQuaternion(Le.fromAxisAngle(e,o/s,Epe),Cpe);let f=0;t=h.clone(t,SC);for(let d=0;d<s;d++)t=$.multiplyByVector(u,t,t),c[f++]=t.x,c[f++]=t.y,c[f++]=t.z;return c}function Hqe(e){let t=wpe,n=Ipe,i=Ppe,r=e[1];n=h.fromArray(e[1],r.length-3,n),i=h.fromArray(e[0],0,i),t=h.midpoint(n,i,t);let o=g3(t,n,i,sr.ROUNDED,!1),s=e.length-1,a=e[s-1];r=e[s],n=h.fromArray(a,a.length-3,n),i=h.fromArray(r,0,i),t=h.midpoint(n,i,t);let c=g3(t,n,i,sr.ROUNDED,!1);return[o,c]}function vpe(e,t,n,i){let r=SC;return i?r=h.add(e,t,r):(t=h.negate(t,t),r=h.add(e,t,r)),[r.x,r.y,r.z,n.x,n.y,n.z]}function LK(e,t,n,i){let r=new Array(e.length),o=new Array(e.length),s=h.multiplyByScalar(t,n,SC),a=h.negate(s,Spe),c=0,u=e.length-1;for(let f=0;f<e.length;f+=3){let d=h.fromArray(e,f,Lqe),p=h.add(d,a,Tpe);r[c++]=p.x,r[c++]=p.y,r[c++]=p.z;let g=h.add(d,s,Tpe);o[u--]=g.z,o[u--]=g.y,o[u--]=g.x}return i.push(r,o),i}FK.addAttribute=function(e,t,n,i){let r=t.x,o=t.y,s=t.z;l(n)&&(e[n]=r,e[n+1]=o,e[n+2]=s),l(i)&&(e[i]=s,e[i-1]=o,e[i-2]=r)};var Gqe=new h,Wqe=new h;FK.computePositions=function(e){let t=e.granularity,n=e.positions,i=e.ellipsoid,r=e.width/2,o=e.cornerType,s=e.saveAttributes,a=wpe,c=Ipe,u=Ppe,f=Fqe,d=Bqe,p=kqe,g=Uqe,m=zqe,y=Vqe,A=jqe,b=[],x=s?[]:void 0,T=s?[]:void 0,E=n[0],v=n[1];c=h.normalize(h.subtract(v,E,c),c),a=i.geodeticSurfaceNormal(E,a),f=h.normalize(h.cross(a,c,f),f),s&&(x.push(f.x,f.y,f.z),T.push(a.x,a.y,a.z)),g=h.clone(E,g),E=v,u=h.negate(c,u);let S,I=[],R,O=n.length;for(R=1;R<O-1;R++){a=i.geodeticSurfaceNormal(E,a),v=n[R+1],c=h.normalize(h.subtract(v,E,c),c);let _=h.multiplyByScalar(a,h.dot(c,a),Gqe);h.subtract(c,_,_),h.normalize(_,_);let C=h.multiplyByScalar(a,h.dot(u,a),Wqe);if(h.subtract(u,C,C),h.normalize(C,C),!P.equalsEpsilon(Math.abs(h.dot(_,C)),1,P.EPSILON7)){d=h.normalize(h.add(c,u,d),d),d=h.cross(d,a,d),d=h.cross(a,d,d),d=h.normalize(d,d);let D=r/Math.max(.25,h.magnitude(h.cross(d,u,SC))),N=up.angleIsGreaterThanPi(c,u,E,i);d=h.multiplyByScalar(d,D,d),N?(m=h.add(E,d,m),A=h.add(m,h.multiplyByScalar(f,r,A),A),y=h.add(m,h.multiplyByScalar(f,r*2,y),y),Fl[0]=h.clone(g,Fl[0]),Fl[1]=h.clone(A,Fl[1]),S=ar.generateArc({positions:Fl,granularity:t,ellipsoid:i}),b=LK(S,f,r,b),s&&(x.push(f.x,f.y,f.z),T.push(a.x,a.y,a.z)),p=h.clone(y,p),f=h.normalize(h.cross(a,c,f),f),y=h.add(m,h.multiplyByScalar(f,r*2,y),y),g=h.add(m,h.multiplyByScalar(f,r,g),g),o===sr.ROUNDED||o===sr.BEVELED?I.push({leftPositions:g3(m,p,y,o,N)}):I.push({leftPositions:vpe(E,h.negate(d,d),y,N)})):(y=h.add(E,d,y),A=h.add(y,h.negate(h.multiplyByScalar(f,r,A),A),A),m=h.add(y,h.negate(h.multiplyByScalar(f,r*2,m),m),m),Fl[0]=h.clone(g,Fl[0]),Fl[1]=h.clone(A,Fl[1]),S=ar.generateArc({positions:Fl,granularity:t,ellipsoid:i}),b=LK(S,f,r,b),s&&(x.push(f.x,f.y,f.z),T.push(a.x,a.y,a.z)),p=h.clone(m,p),f=h.normalize(h.cross(a,c,f),f),m=h.add(y,h.negate(h.multiplyByScalar(f,r*2,m),m),m),g=h.add(y,h.negate(h.multiplyByScalar(f,r,g),g),g),o===sr.ROUNDED||o===sr.BEVELED?I.push({rightPositions:g3(y,p,m,o,N)}):I.push({rightPositions:vpe(E,d,m,N)})),u=h.negate(c,u)}E=v}a=i.geodeticSurfaceNormal(E,a),Fl[0]=h.clone(g,Fl[0]),Fl[1]=h.clone(E,Fl[1]),S=ar.generateArc({positions:Fl,granularity:t,ellipsoid:i}),b=LK(S,f,r,b),s&&(x.push(f.x,f.y,f.z),T.push(a.x,a.y,a.z));let L;return o===sr.ROUNDED&&(L=Hqe(b)),{positions:b,corners:I,lefts:x,normals:T,endPositions:L}};var gr=FK;function UK(e,t,n=2){let i=t&&t.length,r=i?t[0]*n:e.length,o=Rpe(e,0,r,n,!0),s=[];if(!o||o.next===o.prev)return s;let a,c,u;if(i&&(o=$qe(e,t,o,n)),e.length>80*n){a=e[0],c=e[1];let f=a,d=c;for(let p=n;p<r;p+=n){let g=e[p],m=e[p+1];g<a&&(a=g),m<c&&(c=m),g>f&&(f=g),m>d&&(d=m)}u=Math.max(f-a,d-c),u=u!==0?32767/u:0}return cD(o,s,n,a,c,u,0),s}function Rpe(e,t,n,i,r){let o;if(r===aYe(e,t,n,i)>0)for(let s=t;s<n;s+=i)o=Dpe(s/i|0,e[s],e[s+1],o);else for(let s=n-i;s>=t;s-=i)o=Dpe(s/i|0,e[s],e[s+1],o);return o&&wC(o,o.next)&&(uD(o),o=o.next),o}function Xb(e,t){if(!e)return e;t||(t=e);let n=e,i;do if(i=!1,!n.steiner&&(wC(n,n.next)||ds(n.prev,n,n.next)===0)){if(uD(n),n=t=n.prev,n===n.next)break;i=!0}else n=n.next;while(i||n!==t);return t}function cD(e,t,n,i,r,o,s){if(!e)return;!s&&o&&tYe(e,i,r,o);let a=e;for(;e.prev!==e.next;){let c=e.prev,u=e.next;if(o?Yqe(e,i,r,o):qqe(e)){t.push(c.i,e.i,u.i),uD(e),e=u.next,a=u.next;continue}if(e=u,e===a){s?s===1?(e=Xqe(Xb(e),t),cD(e,t,n,i,r,o,2)):s===2&&Kqe(e,t,n,i,r,o):cD(Xb(e),t,n,i,r,o,1);break}}}function qqe(e){let t=e.prev,n=e,i=e.next;if(ds(t,n,i)>=0)return!1;let r=t.x,o=n.x,s=i.x,a=t.y,c=n.y,u=i.y,f=Math.min(r,o,s),d=Math.min(a,c,u),p=Math.max(r,o,s),g=Math.max(a,c,u),m=i.next;for(;m!==t;){if(m.x>=f&&m.x<=p&&m.y>=d&&m.y<=g&&aD(r,a,o,c,s,u,m.x,m.y)&&ds(m.prev,m,m.next)>=0)return!1;m=m.next}return!0}function Yqe(e,t,n,i){let r=e.prev,o=e,s=e.next;if(ds(r,o,s)>=0)return!1;let a=r.x,c=o.x,u=s.x,f=r.y,d=o.y,p=s.y,g=Math.min(a,c,u),m=Math.min(f,d,p),y=Math.max(a,c,u),A=Math.max(f,d,p),b=BK(g,m,t,n,i),x=BK(y,A,t,n,i),T=e.prevZ,E=e.nextZ;for(;T&&T.z>=b&&E&&E.z<=x;){if(T.x>=g&&T.x<=y&&T.y>=m&&T.y<=A&&T!==r&&T!==s&&aD(a,f,c,d,u,p,T.x,T.y)&&ds(T.prev,T,T.next)>=0||(T=T.prevZ,E.x>=g&&E.x<=y&&E.y>=m&&E.y<=A&&E!==r&&E!==s&&aD(a,f,c,d,u,p,E.x,E.y)&&ds(E.prev,E,E.next)>=0))return!1;E=E.nextZ}for(;T&&T.z>=b;){if(T.x>=g&&T.x<=y&&T.y>=m&&T.y<=A&&T!==r&&T!==s&&aD(a,f,c,d,u,p,T.x,T.y)&&ds(T.prev,T,T.next)>=0)return!1;T=T.prevZ}for(;E&&E.z<=x;){if(E.x>=g&&E.x<=y&&E.y>=m&&E.y<=A&&E!==r&&E!==s&&aD(a,f,c,d,u,p,E.x,E.y)&&ds(E.prev,E,E.next)>=0)return!1;E=E.nextZ}return!0}function Xqe(e,t){let n=e;do{let i=n.prev,r=n.next.next;!wC(i,r)&&Mpe(i,n,n.next,r)&&lD(i,r)&&lD(r,i)&&(t.push(i.i,n.i,r.i),uD(n),uD(n.next),n=e=r),n=n.next}while(n!==e);return Xb(n)}function Kqe(e,t,n,i,r,o){let s=e;do{let a=s.next.next;for(;a!==s.prev;){if(s.i!==a.i&&rYe(s,a)){let c=Npe(s,a);s=Xb(s,s.next),c=Xb(c,c.next),cD(s,t,n,i,r,o,0),cD(c,t,n,i,r,o,0);return}a=a.next}s=s.next}while(s!==e)}function $qe(e,t,n,i){let r=[];for(let o=0,s=t.length;o<s;o++){let a=t[o]*i,c=o<s-1?t[o+1]*i:e.length,u=Rpe(e,a,c,i,!1);u===u.next&&(u.steiner=!0),r.push(iYe(u))}r.sort(Jqe);for(let o=0;o<r.length;o++)n=Zqe(r[o],n);return n}function Jqe(e,t){let n=e.x-t.x;if(n===0&&(n=e.y-t.y,n===0)){let i=(e.next.y-e.y)/(e.next.x-e.x),r=(t.next.y-t.y)/(t.next.x-t.x);n=i-r}return n}function Zqe(e,t){let n=Qqe(e,t);if(!n)return t;let i=Npe(n,e);return Xb(i,i.next),Xb(n,n.next)}function Qqe(e,t){let n=t,i=e.x,r=e.y,o=-1/0,s;if(wC(e,n))return n;do{if(wC(e,n.next))return n.next;if(r<=n.y&&r>=n.next.y&&n.next.y!==n.y){let d=n.x+(r-n.y)*(n.next.x-n.x)/(n.next.y-n.y);if(d<=i&&d>o&&(o=d,s=n.x<n.next.x?n:n.next,d===i))return s}n=n.next}while(n!==t);if(!s)return null;let a=s,c=s.x,u=s.y,f=1/0;n=s;do{if(i>=n.x&&n.x>=c&&i!==n.x&&Ope(r<u?i:o,r,c,u,r<u?o:i,r,n.x,n.y)){let d=Math.abs(r-n.y)/(i-n.x);lD(n,e)&&(d<f||d===f&&(n.x>s.x||n.x===s.x&&eYe(s,n)))&&(s=n,f=d)}n=n.next}while(n!==a);return s}function eYe(e,t){return ds(e.prev,e,t.prev)<0&&ds(t.next,e,e.next)<0}function tYe(e,t,n,i){let r=e;do r.z===0&&(r.z=BK(r.x,r.y,t,n,i)),r.prevZ=r.prev,r.nextZ=r.next,r=r.next;while(r!==e);r.prevZ.nextZ=null,r.prevZ=null,nYe(r)}function nYe(e){let t,n=1;do{let i=e,r;e=null;let o=null;for(t=0;i;){t++;let s=i,a=0;for(let u=0;u<n&&(a++,s=s.nextZ,!!s);u++);let c=n;for(;a>0||c>0&&s;)a!==0&&(c===0||!s||i.z<=s.z)?(r=i,i=i.nextZ,a--):(r=s,s=s.nextZ,c--),o?o.nextZ=r:e=r,r.prevZ=o,o=r;i=s}o.nextZ=null,n*=2}while(t>1);return e}function BK(e,t,n,i,r){return e=(e-n)*r|0,t=(t-i)*r|0,e=(e|e<<8)&16711935,e=(e|e<<4)&252645135,e=(e|e<<2)&858993459,e=(e|e<<1)&1431655765,t=(t|t<<8)&16711935,t=(t|t<<4)&252645135,t=(t|t<<2)&858993459,t=(t|t<<1)&1431655765,e|t<<1}function iYe(e){let t=e,n=e;do(t.x<n.x||t.x===n.x&&t.y<n.y)&&(n=t),t=t.next;while(t!==e);return n}function Ope(e,t,n,i,r,o,s,a){return(r-s)*(t-a)>=(e-s)*(o-a)&&(e-s)*(i-a)>=(n-s)*(t-a)&&(n-s)*(o-a)>=(r-s)*(i-a)}function aD(e,t,n,i,r,o,s,a){return!(e===s&&t===a)&&Ope(e,t,n,i,r,o,s,a)}function rYe(e,t){return e.next.i!==t.i&&e.prev.i!==t.i&&!oYe(e,t)&&(lD(e,t)&&lD(t,e)&&sYe(e,t)&&(ds(e.prev,e,t.prev)||ds(e,t.prev,t))||wC(e,t)&&ds(e.prev,e,e.next)>0&&ds(t.prev,t,t.next)>0)}function ds(e,t,n){return(t.y-e.y)*(n.x-t.x)-(t.x-e.x)*(n.y-t.y)}function wC(e,t){return e.x===t.x&&e.y===t.y}function Mpe(e,t,n,i){let r=y3(ds(e,t,n)),o=y3(ds(e,t,i)),s=y3(ds(n,i,e)),a=y3(ds(n,i,t));return!!(r!==o&&s!==a||r===0&&_3(e,n,t)||o===0&&_3(e,i,t)||s===0&&_3(n,e,i)||a===0&&_3(n,t,i))}function _3(e,t,n){return t.x<=Math.max(e.x,n.x)&&t.x>=Math.min(e.x,n.x)&&t.y<=Math.max(e.y,n.y)&&t.y>=Math.min(e.y,n.y)}function y3(e){return e>0?1:e<0?-1:0}function oYe(e,t){let n=e;do{if(n.i!==e.i&&n.next.i!==e.i&&n.i!==t.i&&n.next.i!==t.i&&Mpe(n,n.next,e,t))return!0;n=n.next}while(n!==e);return!1}function lD(e,t){return ds(e.prev,e,e.next)<0?ds(e,t,e.next)>=0&&ds(e,e.prev,t)>=0:ds(e,t,e.prev)<0||ds(e,e.next,t)<0}function sYe(e,t){let n=e,i=!1,r=(e.x+t.x)/2,o=(e.y+t.y)/2;do n.y>o!=n.next.y>o&&n.next.y!==n.y&&r<(n.next.x-n.x)*(o-n.y)/(n.next.y-n.y)+n.x&&(i=!i),n=n.next;while(n!==e);return i}function Npe(e,t){let n=kK(e.i,e.x,e.y),i=kK(t.i,t.x,t.y),r=e.next,o=t.prev;return e.next=t,t.prev=e,n.next=r,r.prev=n,i.next=n,n.prev=i,o.next=i,i.prev=o,i}function Dpe(e,t,n,i){let r=kK(e,t,n);return i?(r.next=i.next,r.prev=i,i.next.prev=r,i.next=r):(r.prev=r,r.next=r),r}function uD(e){e.next.prev=e.prev,e.prev.next=e.next,e.prevZ&&(e.prevZ.nextZ=e.nextZ),e.nextZ&&(e.nextZ.prevZ=e.prevZ)}function kK(e,t,n){return{i:e,x:t,y:n,prev:null,next:null,z:0,prevZ:null,nextZ:null,steiner:!1}}function aYe(e,t,n,i){let r=0;for(let o=t,s=n-i;o<n;o+=i)r+=(e[s]-e[o])*(e[o+1]+e[s+1]),s=o;return r}var cYe=new h,lYe=new h,ny={};ny.computeArea2D=function(e){let t=e.length,n=0;for(let i=t-1,r=0;r<t;i=r++){let o=e[i],s=e[r];n+=o.x*s.y-s.x*o.y}return n*.5};ny.computeWindingOrder2D=function(e){return ny.computeArea2D(e)>0?sa.COUNTER_CLOCKWISE:sa.CLOCKWISE};ny.triangulate=function(e,t){let n=U.packArray(e);return UK(n,t,2)};var kpe=new h,Upe=new h,zpe=new h,Lpe=new h,Fpe=new h,Bpe=new h,Z0=new h,Vpe=new U,jpe=new U,Hpe=new U,IC=new U;ny.computeSubdivision=function(e,t,n,i,r){r=r??P.RADIANS_PER_DEGREE;let o=l(i),s=n.slice(0),a,c=t.length,u=new Array(c*3),f=new Array(c*2),d=0,p=0;for(a=0;a<c;a++){let T=t[a];if(u[d++]=T.x,u[d++]=T.y,u[d++]=T.z,o){let E=i[a];f[p++]=E.x,f[p++]=E.y}}let g=[],m={},y=e.maximumRadius,A=P.chordLength(r,y),b=A*A;for(;s.length>0;){let T=s.pop(),E=s.pop(),v=s.pop(),S=h.fromArray(u,v*3,kpe),I=h.fromArray(u,E*3,Upe),R=h.fromArray(u,T*3,zpe),O,L,_;o&&(O=U.fromArray(f,v*2,Vpe),L=U.fromArray(f,E*2,jpe),_=U.fromArray(f,T*2,Hpe));let C=h.multiplyByScalar(h.normalize(S,Lpe),y,Lpe),w=h.multiplyByScalar(h.normalize(I,Fpe),y,Fpe),D=h.multiplyByScalar(h.normalize(R,Bpe),y,Bpe),N=h.magnitudeSquared(h.subtract(C,w,Z0)),F=h.magnitudeSquared(h.subtract(w,D,Z0)),V=h.magnitudeSquared(h.subtract(D,C,Z0)),B=Math.max(N,F,V),j,k,G;B>b?N===B?(j=`${Math.min(v,E)} ${Math.max(v,E)}`,a=m[j],l(a)||(k=h.add(S,I,Z0),h.multiplyByScalar(k,.5,k),u.push(k.x,k.y,k.z),a=u.length/3-1,m[j]=a,o&&(G=U.add(O,L,IC),U.multiplyByScalar(G,.5,G),f.push(G.x,G.y))),s.push(v,a,T),s.push(a,E,T)):F===B?(j=`${Math.min(E,T)} ${Math.max(E,T)}`,a=m[j],l(a)||(k=h.add(I,R,Z0),h.multiplyByScalar(k,.5,k),u.push(k.x,k.y,k.z),a=u.length/3-1,m[j]=a,o&&(G=U.add(L,_,IC),U.multiplyByScalar(G,.5,G),f.push(G.x,G.y))),s.push(E,a,v),s.push(a,T,v)):V===B&&(j=`${Math.min(T,v)} ${Math.max(T,v)}`,a=m[j],l(a)||(k=h.add(R,S,Z0),h.multiplyByScalar(k,.5,k),u.push(k.x,k.y,k.z),a=u.length/3-1,m[j]=a,o&&(G=U.add(_,O,IC),U.multiplyByScalar(G,.5,G),f.push(G.x,G.y))),s.push(T,a,E),s.push(a,v,E)):(g.push(v),g.push(E),g.push(T))}let x={attributes:{position:new Ne({componentDatatype:Y.DOUBLE,componentsPerAttribute:3,values:u})},indices:g,primitiveType:Oe.TRIANGLES};return o&&(x.attributes.st=new Ne({componentDatatype:Y.FLOAT,componentsPerAttribute:2,values:f})),new wt(x)};var uYe=new he,fYe=new he,dYe=new he,zK=new he;ny.computeRhumbLineSubdivision=function(e,t,n,i,r){r=r??P.RADIANS_PER_DEGREE;let o=l(i),s=n.slice(0),a,c=t.length,u=new Array(c*3),f=new Array(c*2),d=0,p=0;for(a=0;a<c;a++){let v=t[a];if(u[d++]=v.x,u[d++]=v.y,u[d++]=v.z,o){let S=i[a];f[p++]=S.x,f[p++]=S.y}}let g=[],m={},y=e.maximumRadius,A=P.chordLength(r,y),b=new Vc(void 0,void 0,e),x=new Vc(void 0,void 0,e),T=new Vc(void 0,void 0,e);for(;s.length>0;){let v=s.pop(),S=s.pop(),I=s.pop(),R=h.fromArray(u,I*3,kpe),O=h.fromArray(u,S*3,Upe),L=h.fromArray(u,v*3,zpe),_,C,w;o&&(_=U.fromArray(f,I*2,Vpe),C=U.fromArray(f,S*2,jpe),w=U.fromArray(f,v*2,Hpe));let D=e.cartesianToCartographic(R,uYe),N=e.cartesianToCartographic(O,fYe),F=e.cartesianToCartographic(L,dYe);b.setEndPoints(D,N);let V=b.surfaceDistance;x.setEndPoints(N,F);let B=x.surfaceDistance;T.setEndPoints(F,D);let j=T.surfaceDistance,k=Math.max(V,B,j),G,q,Q,W,J;k>A?V===k?(G=`${Math.min(I,S)} ${Math.max(I,S)}`,a=m[G],l(a)||(q=b.interpolateUsingFraction(.5,zK),Q=(D.height+N.height)*.5,W=h.fromRadians(q.longitude,q.latitude,Q,e,Z0),u.push(W.x,W.y,W.z),a=u.length/3-1,m[G]=a,o&&(J=U.add(_,C,IC),U.multiplyByScalar(J,.5,J),f.push(J.x,J.y))),s.push(I,a,v),s.push(a,S,v)):B===k?(G=`${Math.min(S,v)} ${Math.max(S,v)}`,a=m[G],l(a)||(q=x.interpolateUsingFraction(.5,zK),Q=(N.height+F.height)*.5,W=h.fromRadians(q.longitude,q.latitude,Q,e,Z0),u.push(W.x,W.y,W.z),a=u.length/3-1,m[G]=a,o&&(J=U.add(C,w,IC),U.multiplyByScalar(J,.5,J),f.push(J.x,J.y))),s.push(S,a,I),s.push(a,v,I)):j===k&&(G=`${Math.min(v,I)} ${Math.max(v,I)}`,a=m[G],l(a)||(q=T.interpolateUsingFraction(.5,zK),Q=(F.height+D.height)*.5,W=h.fromRadians(q.longitude,q.latitude,Q,e,Z0),u.push(W.x,W.y,W.z),a=u.length/3-1,m[G]=a,o&&(J=U.add(w,_,IC),U.multiplyByScalar(J,.5,J),f.push(J.x,J.y))),s.push(v,a,S),s.push(a,I,S)):(g.push(I),g.push(S),g.push(v))}let E={attributes:{position:new Ne({componentDatatype:Y.DOUBLE,componentsPerAttribute:3,values:u})},indices:g,primitiveType:Oe.TRIANGLES};return o&&(E.attributes.st=new Ne({componentDatatype:Y.FLOAT,componentsPerAttribute:2,values:f})),new wt(E)};ny.scaleToGeodeticHeight=function(e,t,n,i){n=n??ee.default;let r=cYe,o=lYe;if(t=t??0,i=i??!0,l(e)){let s=e.length;for(let a=0;a<s;a+=3)h.fromArray(e,a,o),i&&(o=n.scaleToGeodeticSurface(o,o)),t!==0&&(r=n.geodeticSurfaceNormal(o,r),h.multiplyByScalar(r,t,r),h.add(o,r,o)),e[a]=o.x,e[a+1]=o.y,e[a+2]=o.z}return e};var mi=ny;var qpe=new h,Ype=new h,A3=new h,b3=new h,hYe=new h,Xpe=new h,iy=new h,PC=new h;function Kpe(e,t){for(let n=0;n<e.length;n++)e[n]=t.scaleToGeodeticSurface(e[n],e[n]);return e}function Sh(e,t,n,i,r,o){let s=e.normals,a=e.tangents,c=e.bitangents,u=h.normalize(h.cross(n,t,iy),iy);o.normal&&gr.addAttribute(s,t,i,r),o.tangent&&gr.addAttribute(a,u,i,r),o.bitangent&&gr.addAttribute(c,n,i,r)}function $pe(e,t,n){let i=e.positions,r=e.corners,o=e.endPositions,s=e.lefts,a=e.normals,c=new En,u=0,f=0,d,p=0,g;for(d=0;d<i.length;d+=2)g=i[d].length-3,u+=g,p+=g*2,f+=i[d+1].length-3;for(u+=3,f+=3,d=0;d<r.length;d++){let J=r[d].leftPositions;l(J)?(g=J.length,u+=g,p+=g):(g=r[d].rightPositions.length,f+=g,p+=g)}let m=l(o),y;m&&(y=o[0].length-3,u+=y,f+=y,y/=3,p+=y*6);let A=u+f,b=new Float64Array(A),x=t.normal?new Float32Array(A):void 0,T=t.tangent?new Float32Array(A):void 0,E=t.bitangent?new Float32Array(A):void 0,v={normals:x,tangents:T,bitangents:E},S=0,I=A-1,R,O,L,_,C=qpe,w=Ype,D,N,F=y/2,V=je.createTypedArray(A/3,p),B=0;if(m){N=A3,D=b3;let J=o[0];for(C=h.fromArray(a,0,C),w=h.fromArray(s,0,w),d=0;d<F;d++)N=h.fromArray(J,(F-1-d)*3,N),D=h.fromArray(J,(F+d)*3,D),gr.addAttribute(b,D,S),gr.addAttribute(b,N,void 0,I),Sh(v,C,w,S,I,t),O=S/3,_=O+1,R=(I-2)/3,L=R-1,V[B++]=R,V[B++]=O,V[B++]=L,V[B++]=L,V[B++]=O,V[B++]=_,S+=3,I-=3}let j=0,k=0,G=i[j++],q=i[j++];b.set(G,S),b.set(q,I-q.length+1),w=h.fromArray(s,k,w);let Q,W;for(g=q.length-3,d=0;d<g;d+=3)Q=n.geodeticSurfaceNormal(h.fromArray(G,d,iy),iy),W=n.geodeticSurfaceNormal(h.fromArray(q,g-d,PC),PC),C=h.normalize(h.add(Q,W,C),C),Sh(v,C,w,S,I,t),O=S/3,_=O+1,R=(I-2)/3,L=R-1,V[B++]=R,V[B++]=O,V[B++]=L,V[B++]=L,V[B++]=O,V[B++]=_,S+=3,I-=3;for(Q=n.geodeticSurfaceNormal(h.fromArray(G,g,iy),iy),W=n.geodeticSurfaceNormal(h.fromArray(q,g,PC),PC),C=h.normalize(h.add(Q,W,C),C),k+=3,d=0;d<r.length;d++){let J,Z=r[d],ae=Z.leftPositions,Ae=Z.rightPositions,fe,xe,ge=Xpe,we=A3,ve=b3;if(C=h.fromArray(a,k,C),l(ae)){for(Sh(v,C,w,void 0,I,t),I-=3,fe=_,xe=L,J=0;J<ae.length/3;J++)ge=h.fromArray(ae,J*3,ge),V[B++]=fe,V[B++]=xe-J-1,V[B++]=xe-J,gr.addAttribute(b,ge,void 0,I),we=h.fromArray(b,(xe-J-1)*3,we),ve=h.fromArray(b,fe*3,ve),w=h.normalize(h.subtract(we,ve,w),w),Sh(v,C,w,void 0,I,t),I-=3;ge=h.fromArray(b,fe*3,ge),we=h.subtract(h.fromArray(b,xe*3,we),ge,we),ve=h.subtract(h.fromArray(b,(xe-J)*3,ve),ge,ve),w=h.normalize(h.add(we,ve,w),w),Sh(v,C,w,S,void 0,t),S+=3}else{for(Sh(v,C,w,S,void 0,t),S+=3,fe=L,xe=_,J=0;J<Ae.length/3;J++)ge=h.fromArray(Ae,J*3,ge),V[B++]=fe,V[B++]=xe+J,V[B++]=xe+J+1,gr.addAttribute(b,ge,S),we=h.fromArray(b,fe*3,we),ve=h.fromArray(b,(xe+J)*3,ve),w=h.normalize(h.subtract(we,ve,w),w),Sh(v,C,w,S,void 0,t),S+=3;ge=h.fromArray(b,fe*3,ge),we=h.subtract(h.fromArray(b,(xe+J)*3,we),ge,we),ve=h.subtract(h.fromArray(b,xe*3,ve),ge,ve),w=h.normalize(h.negate(h.add(ve,we,w),w),w),Sh(v,C,w,void 0,I,t),I-=3}for(G=i[j++],q=i[j++],G.splice(0,3),q.splice(q.length-3,3),b.set(G,S),b.set(q,I-q.length+1),g=q.length-3,k+=3,w=h.fromArray(s,k,w),J=0;J<q.length;J+=3)Q=n.geodeticSurfaceNormal(h.fromArray(G,J,iy),iy),W=n.geodeticSurfaceNormal(h.fromArray(q,g-J,PC),PC),C=h.normalize(h.add(Q,W,C),C),Sh(v,C,w,S,I,t),_=S/3,O=_-1,L=(I-2)/3,R=L+1,V[B++]=R,V[B++]=O,V[B++]=L,V[B++]=L,V[B++]=O,V[B++]=_,S+=3,I-=3;S-=3,I+=3}if(C=h.fromArray(a,a.length-3,C),Sh(v,C,w,S,I,t),m){S+=3,I-=3,N=A3,D=b3;let J=o[1];for(d=0;d<F;d++)N=h.fromArray(J,(y-d-1)*3,N),D=h.fromArray(J,d*3,D),gr.addAttribute(b,N,void 0,I),gr.addAttribute(b,D,S),Sh(v,C,w,S,I,t),_=S/3,O=_-1,L=(I-2)/3,R=L+1,V[B++]=R,V[B++]=O,V[B++]=L,V[B++]=L,V[B++]=O,V[B++]=_,S+=3,I-=3}if(c.position=new Ne({componentDatatype:Y.DOUBLE,componentsPerAttribute:3,values:b}),t.st){let J=new Float32Array(A/3*2),Z,ae,Ae=0;if(m){u/=3,f/=3;let fe=Math.PI/(y+1);ae=1/(u-y+1),Z=1/(f-y+1);let xe,ge=y/2;for(d=ge+1;d<y+1;d++)xe=P.PI_OVER_TWO+fe*d,J[Ae++]=Z*(1+Math.cos(xe)),J[Ae++]=.5*(1+Math.sin(xe));for(d=1;d<f-y+1;d++)J[Ae++]=d*Z,J[Ae++]=0;for(d=y;d>ge;d--)xe=P.PI_OVER_TWO-d*fe,J[Ae++]=1-Z*(1+Math.cos(xe)),J[Ae++]=.5*(1+Math.sin(xe));for(d=ge;d>0;d--)xe=P.PI_OVER_TWO-fe*d,J[Ae++]=1-ae*(1+Math.cos(xe)),J[Ae++]=.5*(1+Math.sin(xe));for(d=u-y;d>0;d--)J[Ae++]=d*ae,J[Ae++]=1;for(d=1;d<ge+1;d++)xe=P.PI_OVER_TWO+fe*d,J[Ae++]=ae*(1+Math.cos(xe)),J[Ae++]=.5*(1+Math.sin(xe))}else{for(u/=3,f/=3,ae=1/(u-1),Z=1/(f-1),d=0;d<f;d++)J[Ae++]=d*Z,J[Ae++]=0;for(d=u;d>0;d--)J[Ae++]=(d-1)*ae,J[Ae++]=1}c.st=new Ne({componentDatatype:Y.FLOAT,componentsPerAttribute:2,values:J})}return t.normal&&(c.normal=new Ne({componentDatatype:Y.FLOAT,componentsPerAttribute:3,values:v.normals})),t.tangent&&(c.tangent=new Ne({componentDatatype:Y.FLOAT,componentsPerAttribute:3,values:v.tangents})),t.bitangent&&(c.bitangent=new Ne({componentDatatype:Y.FLOAT,componentsPerAttribute:3,values:v.bitangents})),{attributes:c,indices:V}}function mYe(e,t){if(!t.normal&&!t.tangent&&!t.bitangent&&!t.st)return e;let n=e.position.values,i,r;(t.normal||t.bitangent)&&(i=e.normal.values,r=e.bitangent.values);let o=e.position.values.length/18,s=o*3,a=o*2,c=s*2,u;if(t.normal||t.bitangent||t.tangent){let f=t.normal?new Float32Array(s*6):void 0,d=t.tangent?new Float32Array(s*6):void 0,p=t.bitangent?new Float32Array(s*6):void 0,g=qpe,m=Ype,y=A3,A=b3,b=hYe,x=Xpe,T=c;for(u=0;u<s;u+=3){let E=T+c;g=h.fromArray(n,u,g),m=h.fromArray(n,u+s,m),y=h.fromArray(n,(u+3)%s,y),m=h.subtract(m,g,m),y=h.subtract(y,g,y),A=h.normalize(h.cross(m,y,A),A),t.normal&&(gr.addAttribute(f,A,E),gr.addAttribute(f,A,E+3),gr.addAttribute(f,A,T),gr.addAttribute(f,A,T+3)),(t.tangent||t.bitangent)&&(x=h.fromArray(i,u,x),t.bitangent&&(gr.addAttribute(p,x,E),gr.addAttribute(p,x,E+3),gr.addAttribute(p,x,T),gr.addAttribute(p,x,T+3)),t.tangent&&(b=h.normalize(h.cross(x,A,b),b),gr.addAttribute(d,b,E),gr.addAttribute(d,b,E+3),gr.addAttribute(d,b,T),gr.addAttribute(d,b,T+3))),T+=6}if(t.normal){for(f.set(i),u=0;u<s;u+=3)f[u+s]=-i[u],f[u+s+1]=-i[u+1],f[u+s+2]=-i[u+2];e.normal.values=f}else e.normal=void 0;if(t.bitangent?(p.set(r),p.set(r,s),e.bitangent.values=p):e.bitangent=void 0,t.tangent){let E=e.tangent.values;d.set(E),d.set(E,s),e.tangent.values=d}}if(t.st){let f=e.st.values,d=new Float32Array(a*6);d.set(f),d.set(f,a);let p=a*2;for(let g=0;g<2;g++){for(d[p++]=f[0],d[p++]=f[1],u=2;u<a;u+=2){let m=f[u],y=f[u+1];d[p++]=m,d[p++]=y,d[p++]=m,d[p++]=y}d[p++]=f[0],d[p++]=f[1]}e.st.values=d}return e}function VK(e,t,n){n[t++]=e[0],n[t++]=e[1],n[t++]=e[2];for(let i=3;i<e.length;i+=3){let r=e[i],o=e[i+1],s=e[i+2];n[t++]=r,n[t++]=o,n[t++]=s,n[t++]=r,n[t++]=o,n[t++]=s}return n[t++]=e[0],n[t++]=e[1],n[t]=e[2],n}function pYe(e,t){let n=new Be({position:t.position,normal:t.normal||t.bitangent||e.shadowVolume,tangent:t.tangent,bitangent:t.normal||t.bitangent,st:t.st}),i=e.ellipsoid,r=gr.computePositions(e),o=$pe(r,n,i),s=e.height,a=e.extrudedHeight,c=o.attributes,u=o.indices,f=c.position.values,d=f.length,p=new Float64Array(d*6),g=new Float64Array(d);g.set(f);let m=new Float64Array(d*4);f=mi.scaleToGeodeticHeight(f,s,i),m=VK(f,0,m),g=mi.scaleToGeodeticHeight(g,a,i),m=VK(g,d*2,m),p.set(f),p.set(g,d),p.set(m,d*2),c.position.values=p,c=mYe(c,t);let y,A=d/3;if(e.shadowVolume){let O=c.normal.values;d=O.length;let L=new Float32Array(d*6);for(y=0;y<d;y++)O[y]=-O[y];L.set(O,d),L=VK(O,d*4,L),c.extrudeDirection=new Ne({componentDatatype:Y.FLOAT,componentsPerAttribute:3,values:L}),t.normal||(c.normal=void 0)}if(l(e.offsetAttribute)){let O=new Uint8Array(A*6);if(e.offsetAttribute===pn.TOP)O=O.fill(1,0,A).fill(1,A*2,A*4);else{let L=e.offsetAttribute===pn.NONE?0:1;O=O.fill(L)}c.applyOffset=new Ne({componentDatatype:Y.UNSIGNED_BYTE,componentsPerAttribute:1,values:O})}let b=u.length,x=A+A,T=je.createTypedArray(p.length/3,b*2+x*3);T.set(u);let E=b;for(y=0;y<b;y+=3){let O=u[y],L=u[y+1],_=u[y+2];T[E++]=_+A,T[E++]=L+A,T[E++]=O+A}let v,S,I,R;for(y=0;y<x;y+=2)v=y+x,S=v+x,I=v+1,R=S+1,T[E++]=v,T[E++]=S,T[E++]=I,T[E++]=I,T[E++]=S,T[E++]=R;return{attributes:c,indices:T}}var Gpe=new h,fD=new h,pd=new he;function Wpe(e,t,n,i,r,o){let s=h.subtract(t,e,Gpe);h.normalize(s,s);let a=n.geodeticSurfaceNormal(e,fD),c=h.cross(s,a,Gpe);h.multiplyByScalar(c,i,c);let u=r.latitude,f=r.longitude,d=o.latitude,p=o.longitude;h.add(e,c,fD),n.cartesianToCartographic(fD,pd);let g=pd.latitude,m=pd.longitude;u=Math.min(u,g),f=Math.min(f,m),d=Math.max(d,g),p=Math.max(p,m),h.subtract(e,c,fD),n.cartesianToCartographic(fD,pd),g=pd.latitude,m=pd.longitude,u=Math.min(u,g),f=Math.min(f,m),d=Math.max(d,g),p=Math.max(p,m),r.latitude=u,r.longitude=f,o.latitude=d,o.longitude=p}var md=new h,dD=new h,Au=new he,bu=new he;function Jpe(e,t,n,i,r){e=Kpe(e,t);let o=Lr(e,h.equalsEpsilon),s=o.length;if(s<2||n<=0)return new ie;let a=n*.5;Au.latitude=Number.POSITIVE_INFINITY,Au.longitude=Number.POSITIVE_INFINITY,bu.latitude=Number.NEGATIVE_INFINITY,bu.longitude=Number.NEGATIVE_INFINITY;let c,u;if(i===sr.ROUNDED){let p=o[0];h.subtract(p,o[1],md),h.normalize(md,md),h.multiplyByScalar(md,a,md),h.add(p,md,dD),t.cartesianToCartographic(dD,pd),c=pd.latitude,u=pd.longitude,Au.latitude=Math.min(Au.latitude,c),Au.longitude=Math.min(Au.longitude,u),bu.latitude=Math.max(bu.latitude,c),bu.longitude=Math.max(bu.longitude,u)}for(let p=0;p<s-1;++p)Wpe(o[p],o[p+1],t,a,Au,bu);let f=o[s-1];h.subtract(f,o[s-2],md),h.normalize(md,md),h.multiplyByScalar(md,a,md),h.add(f,md,dD),Wpe(f,dD,t,a,Au,bu),i===sr.ROUNDED&&(t.cartesianToCartographic(dD,pd),c=pd.latitude,u=pd.longitude,Au.latitude=Math.min(Au.latitude,c),Au.longitude=Math.min(Au.longitude,u),bu.latitude=Math.max(bu.latitude,c),bu.longitude=Math.max(bu.longitude,u));let d=l(r)?r:new ie;return d.north=bu.latitude,d.south=Au.latitude,d.east=bu.longitude,d.west=Au.longitude,d}function eg(e){e=e??H.EMPTY_OBJECT;let t=e.positions,n=e.width,i=e.height??0,r=e.extrudedHeight??i;this._positions=t,this._ellipsoid=ee.clone(e.ellipsoid??ee.default),this._vertexFormat=Be.clone(e.vertexFormat??Be.DEFAULT),this._width=n,this._height=Math.max(i,r),this._extrudedHeight=Math.min(i,r),this._cornerType=e.cornerType??sr.ROUNDED,this._granularity=e.granularity??P.RADIANS_PER_DEGREE,this._shadowVolume=e.shadowVolume??!1,this._workerName="createCorridorGeometry",this._offsetAttribute=e.offsetAttribute,this._rectangle=void 0,this.packedLength=1+t.length*h.packedLength+ee.packedLength+Be.packedLength+7}eg.pack=function(e,t,n){n=n??0;let i=e._positions,r=i.length;t[n++]=r;for(let o=0;o<r;++o,n+=h.packedLength)h.pack(i[o],t,n);return ee.pack(e._ellipsoid,t,n),n+=ee.packedLength,Be.pack(e._vertexFormat,t,n),n+=Be.packedLength,t[n++]=e._width,t[n++]=e._height,t[n++]=e._extrudedHeight,t[n++]=e._cornerType,t[n++]=e._granularity,t[n++]=e._shadowVolume?1:0,t[n]=e._offsetAttribute??-1,t};var Zpe=ee.clone(ee.UNIT_SPHERE),Qpe=new Be,Q0={positions:void 0,ellipsoid:Zpe,vertexFormat:Qpe,width:void 0,height:void 0,extrudedHeight:void 0,cornerType:void 0,granularity:void 0,shadowVolume:void 0,offsetAttribute:void 0};eg.unpack=function(e,t,n){t=t??0;let i=e[t++],r=new Array(i);for(let m=0;m<i;++m,t+=h.packedLength)r[m]=h.unpack(e,t);let o=ee.unpack(e,t,Zpe);t+=ee.packedLength;let s=Be.unpack(e,t,Qpe);t+=Be.packedLength;let a=e[t++],c=e[t++],u=e[t++],f=e[t++],d=e[t++],p=e[t++]===1,g=e[t];return l(n)?(n._positions=r,n._ellipsoid=ee.clone(o,n._ellipsoid),n._vertexFormat=Be.clone(s,n._vertexFormat),n._width=a,n._height=c,n._extrudedHeight=u,n._cornerType=f,n._granularity=d,n._shadowVolume=p,n._offsetAttribute=g===-1?void 0:g,n):(Q0.positions=r,Q0.width=a,Q0.height=c,Q0.extrudedHeight=u,Q0.cornerType=f,Q0.granularity=d,Q0.shadowVolume=p,Q0.offsetAttribute=g===-1?void 0:g,new eg(Q0))};eg.computeRectangle=function(e,t){e=e??H.EMPTY_OBJECT;let n=e.positions,i=e.width,r=e.ellipsoid??ee.default,o=e.cornerType??sr.ROUNDED;return Jpe(n,r,i,o,t)};eg.createGeometry=function(e){let t=e._positions,n=e._width,i=e._ellipsoid;t=Kpe(t,i);let r=Lr(t,h.equalsEpsilon);if(r.length<2||n<=0)return;let o=e._height,s=e._extrudedHeight,a=!P.equalsEpsilon(o,s,0,P.EPSILON2),c=e._vertexFormat,u={ellipsoid:i,positions:r,width:n,cornerType:e._cornerType,granularity:e._granularity,saveAttributes:!0},f;if(a)u.height=o,u.extrudedHeight=s,u.shadowVolume=e._shadowVolume,u.offsetAttribute=e._offsetAttribute,f=pYe(u,c);else{let g=gr.computePositions(u);if(f=$pe(g,c,i),f.attributes.position.values=mi.scaleToGeodeticHeight(f.attributes.position.values,o,i),l(e._offsetAttribute)){let m=e._offsetAttribute===pn.NONE?0:1,y=f.attributes.position.values.length,A=new Uint8Array(y/3).fill(m);f.attributes.applyOffset=new Ne({componentDatatype:Y.UNSIGNED_BYTE,componentsPerAttribute:1,values:A})}}let d=f.attributes,p=ue.fromVertices(d.position.values,void 0,3);return c.position||(f.attributes.position.values=void 0),new wt({attributes:d,indices:f.indices,primitiveType:Oe.TRIANGLES,boundingSphere:p,offsetAttribute:e._offsetAttribute})};eg.createShadowVolume=function(e,t,n){let i=e._granularity,r=e._ellipsoid,o=t(i,r),s=n(i,r);return new eg({positions:e._positions,width:e._width,cornerType:e._cornerType,ellipsoid:r,granularity:i,extrudedHeight:o,height:s,vertexFormat:Be.POSITION_ONLY,shadowVolume:!0})};Object.defineProperties(eg.prototype,{rectangle:{get:function(){return l(this._rectangle)||(this._rectangle=Jpe(this._positions,this._ellipsoid,this._width,this._cornerType)),this._rectangle}},textureCoordinateRotationPoints:{get:function(){return[0,0,0,1,1,0]}}});var DC=eg;var e0e=new h,t0e=new h,gYe=new h;function _Ye(e,t){for(let n=0;n<e.length;n++)e[n]=t.scaleToGeodeticSurface(e[n],e[n]);return e}function n0e(e,t){let n=[],i=e.positions,r=e.corners,o=e.endPositions,s=new En,a,c=0,u=0,f,d=0,p;for(f=0;f<i.length;f+=2)p=i[f].length-3,c+=p,d+=p/3*4,u+=i[f+1].length-3;for(c+=3,u+=3,f=0;f<r.length;f++){let N=r[f].leftPositions;l(N)?(p=N.length,c+=p,d+=p/3*2):(p=r[f].rightPositions.length,u+=p,d+=p/3*2)}let g=l(o),m;g&&(m=o[0].length-3,c+=m,u+=m,m/=3,d+=m*4);let y=c+u,A=new Float64Array(y),b=0,x=y-1,T,E,v,S,I,R,O=m/2,L=je.createTypedArray(y/3,d+4),_=0;if(L[_++]=b/3,L[_++]=(x-2)/3,g){n.push(b/3),R=e0e,I=t0e;let N=o[0];for(f=0;f<O;f++)R=h.fromArray(N,(O-1-f)*3,R),I=h.fromArray(N,(O+f)*3,I),gr.addAttribute(A,I,b),gr.addAttribute(A,R,void 0,x),E=b/3,S=E+1,T=(x-2)/3,v=T-1,L[_++]=T,L[_++]=v,L[_++]=E,L[_++]=S,b+=3,x-=3}let C=0,w=i[C++],D=i[C++];for(A.set(w,b),A.set(D,x-D.length+1),p=D.length-3,n.push(b/3,(x-2)/3),f=0;f<p;f+=3)E=b/3,S=E+1,T=(x-2)/3,v=T-1,L[_++]=T,L[_++]=v,L[_++]=E,L[_++]=S,b+=3,x-=3;for(f=0;f<r.length;f++){let N;a=r[f];let F=a.leftPositions,V=a.rightPositions,B,j=gYe;if(l(F)){for(x-=3,B=v,n.push(S),N=0;N<F.length/3;N++)j=h.fromArray(F,N*3,j),L[_++]=B-N-1,L[_++]=B-N,gr.addAttribute(A,j,void 0,x),x-=3;n.push(B-Math.floor(F.length/6)),t===sr.BEVELED&&n.push((x-2)/3+1),b+=3}else{for(b+=3,B=S,n.push(v),N=0;N<V.length/3;N++)j=h.fromArray(V,N*3,j),L[_++]=B+N,L[_++]=B+N+1,gr.addAttribute(A,j,b),b+=3;n.push(B+Math.floor(V.length/6)),t===sr.BEVELED&&n.push(b/3-1),x-=3}for(w=i[C++],D=i[C++],w.splice(0,3),D.splice(D.length-3,3),A.set(w,b),A.set(D,x-D.length+1),N=0;N<D.length;N+=3)S=b/3,E=S-1,v=(x-2)/3,T=v+1,L[_++]=T,L[_++]=v,L[_++]=E,L[_++]=S,b+=3,x-=3;b-=3,x+=3,n.push(b/3,(x-2)/3)}if(g){b+=3,x-=3,R=e0e,I=t0e;let N=o[1];for(f=0;f<O;f++)R=h.fromArray(N,(m-f-1)*3,R),I=h.fromArray(N,f*3,I),gr.addAttribute(A,R,void 0,x),gr.addAttribute(A,I,b),S=b/3,E=S-1,v=(x-2)/3,T=v+1,L[_++]=T,L[_++]=v,L[_++]=E,L[_++]=S,b+=3,x-=3;n.push(b/3)}else n.push(b/3,(x-2)/3);return L[_++]=b/3,L[_]=(x-2)/3,s.position=new Ne({componentDatatype:Y.DOUBLE,componentsPerAttribute:3,values:A}),{attributes:s,indices:L,wallIndices:n}}function yYe(e){let t=e.ellipsoid,n=gr.computePositions(e),i=n0e(n,e.cornerType),r=i.wallIndices,o=e.height,s=e.extrudedHeight,a=i.attributes,c=i.indices,u=a.position.values,f=u.length,d=new Float64Array(f);d.set(u);let p=new Float64Array(f*2);if(u=mi.scaleToGeodeticHeight(u,o,t),d=mi.scaleToGeodeticHeight(d,s,t),p.set(u),p.set(d,f),a.position.values=p,f/=3,l(e.offsetAttribute)){let T=new Uint8Array(f*2);if(e.offsetAttribute===pn.TOP)T=T.fill(1,0,f);else{let E=e.offsetAttribute===pn.NONE?0:1;T=T.fill(E)}a.applyOffset=new Ne({componentDatatype:Y.UNSIGNED_BYTE,componentsPerAttribute:1,values:T})}let g,m=c.length,y=je.createTypedArray(p.length/3,(m+r.length)*2);y.set(c);let A=m;for(g=0;g<m;g+=2){let T=c[g],E=c[g+1];y[A++]=T+f,y[A++]=E+f}let b,x;for(g=0;g<r.length;g++)b=r[g],x=b+f,y[A++]=b,y[A++]=x;return{attributes:a,indices:y}}function hD(e){e=e??H.EMPTY_OBJECT;let t=e.positions,n=e.width,i=e.height??0,r=e.extrudedHeight??i;this._positions=t,this._ellipsoid=ee.clone(e.ellipsoid??ee.default),this._width=n,this._height=Math.max(i,r),this._extrudedHeight=Math.min(i,r),this._cornerType=e.cornerType??sr.ROUNDED,this._granularity=e.granularity??P.RADIANS_PER_DEGREE,this._offsetAttribute=e.offsetAttribute,this._workerName="createCorridorOutlineGeometry",this.packedLength=1+t.length*h.packedLength+ee.packedLength+6}hD.pack=function(e,t,n){n=n??0;let i=e._positions,r=i.length;t[n++]=r;for(let o=0;o<r;++o,n+=h.packedLength)h.pack(i[o],t,n);return ee.pack(e._ellipsoid,t,n),n+=ee.packedLength,t[n++]=e._width,t[n++]=e._height,t[n++]=e._extrudedHeight,t[n++]=e._cornerType,t[n++]=e._granularity,t[n]=e._offsetAttribute??-1,t};var i0e=ee.clone(ee.UNIT_SPHERE),ry={positions:void 0,ellipsoid:i0e,width:void 0,height:void 0,extrudedHeight:void 0,cornerType:void 0,granularity:void 0,offsetAttribute:void 0};hD.unpack=function(e,t,n){t=t??0;let i=e[t++],r=new Array(i);for(let p=0;p<i;++p,t+=h.packedLength)r[p]=h.unpack(e,t);let o=ee.unpack(e,t,i0e);t+=ee.packedLength;let s=e[t++],a=e[t++],c=e[t++],u=e[t++],f=e[t++],d=e[t];return l(n)?(n._positions=r,n._ellipsoid=ee.clone(o,n._ellipsoid),n._width=s,n._height=a,n._extrudedHeight=c,n._cornerType=u,n._granularity=f,n._offsetAttribute=d===-1?void 0:d,n):(ry.positions=r,ry.width=s,ry.height=a,ry.extrudedHeight=c,ry.cornerType=u,ry.granularity=f,ry.offsetAttribute=d===-1?void 0:d,new hD(ry))};hD.createGeometry=function(e){let t=e._positions,n=e._width,i=e._ellipsoid;t=_Ye(t,i);let r=Lr(t,h.equalsEpsilon);if(r.length<2||n<=0)return;let o=e._height,s=e._extrudedHeight,a=!P.equalsEpsilon(o,s,0,P.EPSILON2),c={ellipsoid:i,positions:r,width:n,cornerType:e._cornerType,granularity:e._granularity,saveAttributes:!1},u;if(a)c.height=o,c.extrudedHeight=s,c.offsetAttribute=e._offsetAttribute,u=yYe(c);else{let p=gr.computePositions(c);if(u=n0e(p,c.cornerType),u.attributes.position.values=mi.scaleToGeodeticHeight(u.attributes.position.values,o,i),l(e._offsetAttribute)){let g=u.attributes.position.values.length,m=e._offsetAttribute===pn.NONE?0:1,y=new Uint8Array(g/3).fill(m);u.attributes.applyOffset=new Ne({componentDatatype:Y.UNSIGNED_BYTE,componentsPerAttribute:1,values:y})}}let f=u.attributes,d=ue.fromVertices(f.position.values,void 0,3);return new wt({attributes:f,indices:u.indices,primitiveType:Oe.LINES,boundingSphere:d,offsetAttribute:e._offsetAttribute})};var x3=hD;var AYe=new hi(0);function Bl(e){Mi.call(this,e),this._zIndex=0,this._terrainOffsetProperty=void 0}l(Object.create)&&(Bl.prototype=Object.create(Mi.prototype),Bl.prototype.constructor=Bl);Object.defineProperties(Bl.prototype,{zIndex:{get:function(){return this._zIndex}},terrainOffsetProperty:{get:function(){return this._terrainOffsetProperty}}});Bl.prototype._isOnTerrain=function(e,t){return this._fillEnabled&&!l(t.height)&&!l(t.extrudedHeight)&&pu.isSupported(this._scene)};Bl.prototype._getIsClosed=function(e){let t=e.height,n=e.extrudedHeight;return t===0||l(n)&&n!==t};Bl.prototype._computeCenter=pe.throwInstantiationError;Bl.prototype._onEntityPropertyChanged=function(e,t,n,i){if(Mi.prototype._onEntityPropertyChanged.call(this,e,t,n,i),this._observedPropertyNames.indexOf(t)===-1)return;let r=this._entity[this._geometryPropertyName];if(!l(r))return;l(r.zIndex)&&(l(r.height)||l(r.extrudedHeight))&&yt(yt.geometryZIndex),this._zIndex=r.zIndex??AYe,l(this._terrainOffsetProperty)&&(this._terrainOffsetProperty.destroy(),this._terrainOffsetProperty=void 0);let o=r.heightReference,s=r.extrudedHeightReference;if(l(o)||l(s)){let a=new lp(this._computeCenter.bind(this),!this._dynamic);this._terrainOffsetProperty=new EC(this._scene,a,o,s)}};Bl.prototype.destroy=function(){l(this._terrainOffsetProperty)&&(this._terrainOffsetProperty.destroy(),this._terrainOffsetProperty=void 0),Mi.prototype.destroy.call(this)};Bl.getGeometryHeight=function(e,t){if(!l(e)){t!==We.NONE&&yt(yt.geometryHeightReference);return}return fs(t)?0:e};Bl.getGeometryExtrudedHeight=function(e,t){if(!l(e)){t!==We.NONE&&yt(yt.geometryExtrudedHeightReference);return}return fs(t)?Bl.CLAMP_TO_GROUND:e};Bl.CLAMP_TO_GROUND="clamp";Bl.computeGeometryOffsetAttribute=function(e,t,n,i){(!l(e)||!l(t))&&(t=We.NONE),(!l(n)||!l(i))&&(i=We.NONE);let r=0;if(t!==We.NONE&&r++,i===We.RELATIVE_TO_GROUND&&r++,r===2)return pn.ALL;if(r===1)return pn.TOP};var oi=Bl;var r0e=new z,o0e=h.ZERO,s0e=new h,a0e=new ie;function bYe(e){this.id=e,this.vertexFormat=void 0,this.positions=void 0,this.width=void 0,this.cornerType=void 0,this.height=void 0,this.extrudedHeight=void 0,this.granularity=void 0,this.offsetAttribute=void 0}function wh(e,t){oi.call(this,{entity:e,scene:t,geometryOptions:new bYe(e),geometryPropertyName:"corridor",observedPropertyNames:["availability","corridor"]}),this._onEntityPropertyChanged(e,"corridor",e.corridor,void 0)}l(Object.create)&&(wh.prototype=Object.create(oi.prototype),wh.prototype.constructor=wh);wh.prototype.createFillGeometryInstance=function(e){let t=this._entity,n=t.isAvailable(e),i={show:new Dn(n&&t.isShowing&&this._showProperty.getValue(e)&&this._fillProperty.getValue(e)),distanceDisplayCondition:ti.fromDistanceDisplayCondition(this._distanceDisplayConditionProperty.getValue(e)),offset:void 0,color:void 0};if(this._materialProperty instanceof Kt){let r;l(this._materialProperty.color)&&(this._materialProperty.color.isConstant||n)&&(r=this._materialProperty.color.getValue(e,r0e)),l(r)||(r=z.WHITE),i.color=Jt.fromColor(r)}return l(this._options.offsetAttribute)&&(i.offset=Er.fromCartesian3(X.getValueOrDefault(this._terrainOffsetProperty,e,o0e,s0e))),new Bt({id:t,geometry:new DC(this._options),attributes:i})};wh.prototype.createOutlineGeometryInstance=function(e){let t=this._entity,n=t.isAvailable(e),i=X.getValueOrDefault(this._outlineColorProperty,e,z.BLACK,r0e),r={show:new Dn(n&&t.isShowing&&this._showProperty.getValue(e)&&this._showOutlineProperty.getValue(e)),color:Jt.fromColor(i),distanceDisplayCondition:ti.fromDistanceDisplayCondition(this._distanceDisplayConditionProperty.getValue(e)),offset:void 0};return l(this._options.offsetAttribute)&&(r.offset=Er.fromCartesian3(X.getValueOrDefault(this._terrainOffsetProperty,e,o0e,s0e))),new Bt({id:t,geometry:new x3(this._options),attributes:r})};wh.prototype._computeCenter=function(e,t){let n=X.getValueOrUndefined(this._entity.corridor.positions,e);if(!(!l(n)||n.length===0))return h.clone(n[Math.floor(n.length/2)],t)};wh.prototype._isHidden=function(e,t){return!l(t.positions)||!l(t.width)||Mi.prototype._isHidden.call(this,e,t)};wh.prototype._isDynamic=function(e,t){return!t.positions.isConstant||!X.isConstant(t.height)||!X.isConstant(t.extrudedHeight)||!X.isConstant(t.granularity)||!X.isConstant(t.width)||!X.isConstant(t.outlineWidth)||!X.isConstant(t.cornerType)||!X.isConstant(t.zIndex)||this._onTerrain&&!X.isConstant(this._materialProperty)&&!(this._materialProperty instanceof Kt)};wh.prototype._setStaticOptions=function(e,t){let n=X.getValueOrUndefined(t.height,it.MINIMUM_VALUE),i=X.getValueOrDefault(t.heightReference,it.MINIMUM_VALUE,We.NONE),r=X.getValueOrUndefined(t.extrudedHeight,it.MINIMUM_VALUE),o=X.getValueOrDefault(t.extrudedHeightReference,it.MINIMUM_VALUE,We.NONE);l(r)&&!l(n)&&(n=0);let s=this._options;s.vertexFormat=this._materialProperty instanceof Kt?An.VERTEX_FORMAT:Cr.MaterialSupport.TEXTURED.vertexFormat,s.positions=t.positions.getValue(it.MINIMUM_VALUE,s.positions),s.width=t.width.getValue(it.MINIMUM_VALUE),s.granularity=X.getValueOrUndefined(t.granularity,it.MINIMUM_VALUE),s.cornerType=X.getValueOrUndefined(t.cornerType,it.MINIMUM_VALUE),s.offsetAttribute=oi.computeGeometryOffsetAttribute(n,i,r,o),s.height=oi.getGeometryHeight(n,i),r=oi.getGeometryExtrudedHeight(r,o),r===oi.CLAMP_TO_GROUND&&(r=Ni.getMinimumMaximumHeights(DC.computeRectangle(s,a0e)).minimumTerrainHeight),s.extrudedHeight=r};wh.DynamicGeometryUpdater=RC;function RC(e,t,n){Oi.call(this,e,t,n)}l(Object.create)&&(RC.prototype=Object.create(Oi.prototype),RC.prototype.constructor=RC);RC.prototype._isHidden=function(e,t,n){let i=this._options;return!l(i.positions)||!l(i.width)||Oi.prototype._isHidden.call(this,e,t,n)};RC.prototype._setOptions=function(e,t,n){let i=this._options,r=X.getValueOrUndefined(t.height,n),o=X.getValueOrDefault(t.heightReference,n,We.NONE),s=X.getValueOrUndefined(t.extrudedHeight,n),a=X.getValueOrDefault(t.extrudedHeightReference,n,We.NONE);l(s)&&!l(r)&&(r=0),i.positions=X.getValueOrUndefined(t.positions,n),i.width=X.getValueOrUndefined(t.width,n),i.granularity=X.getValueOrUndefined(t.granularity,n),i.cornerType=X.getValueOrUndefined(t.cornerType,n),i.offsetAttribute=oi.computeGeometryOffsetAttribute(r,o,s,a),i.height=oi.getGeometryHeight(r,o),s=oi.getGeometryExtrudedHeight(s,a),s===oi.CLAMP_TO_GROUND&&(s=Ni.getMinimumMaximumHeights(DC.computeRectangle(i,a0e)).minimumTerrainHeight),i.extrudedHeight=s};var T3=wh;var c0e={};c0e.computePositions=function(e,t,n,i,r){let o=e*.5,s=-o,a=i+i,c=r?2*a:a,u=new Float64Array(c*3),f,d=0,p=0,g=r?a*3:0,m=r?(a+i)*3:i*3;for(f=0;f<i;f++){let y=f/i*P.TWO_PI,A=Math.cos(y),b=Math.sin(y),x=A*n,T=b*n,E=A*t,v=b*t;u[p+g]=x,u[p+g+1]=T,u[p+g+2]=s,u[p+m]=E,u[p+m+1]=v,u[p+m+2]=o,p+=3,r&&(u[d++]=x,u[d++]=T,u[d++]=s,u[d++]=E,u[d++]=v,u[d++]=o)}return u};var OC=c0e;var jK=new U,xYe=new h,TYe=new h,EYe=new h,CYe=new h;function tg(e){e=e??H.EMPTY_OBJECT;let t=e.length,n=e.topRadius,i=e.bottomRadius,r=e.vertexFormat??Be.DEFAULT,o=e.slices??128;this._length=t,this._topRadius=n,this._bottomRadius=i,this._vertexFormat=Be.clone(r),this._slices=o,this._offsetAttribute=e.offsetAttribute,this._workerName="createCylinderGeometry"}tg.packedLength=Be.packedLength+5;tg.pack=function(e,t,n){return n=n??0,Be.pack(e._vertexFormat,t,n),n+=Be.packedLength,t[n++]=e._length,t[n++]=e._topRadius,t[n++]=e._bottomRadius,t[n++]=e._slices,t[n]=e._offsetAttribute??-1,t};var l0e=new Be,MC={vertexFormat:l0e,length:void 0,topRadius:void 0,bottomRadius:void 0,slices:void 0,offsetAttribute:void 0};tg.unpack=function(e,t,n){t=t??0;let i=Be.unpack(e,t,l0e);t+=Be.packedLength;let r=e[t++],o=e[t++],s=e[t++],a=e[t++],c=e[t];return l(n)?(n._vertexFormat=Be.clone(i,n._vertexFormat),n._length=r,n._topRadius=o,n._bottomRadius=s,n._slices=a,n._offsetAttribute=c===-1?void 0:c,n):(MC.length=r,MC.topRadius=o,MC.bottomRadius=s,MC.slices=a,MC.offsetAttribute=c===-1?void 0:c,new tg(MC))};tg.createGeometry=function(e){let t=e._length,n=e._topRadius,i=e._bottomRadius,r=e._vertexFormat,o=e._slices;if(t<=0||n<0||i<0||n===0&&i===0)return;let s=o+o,a=o+s,c=s+s,u=OC.computePositions(t,n,i,o,!0),f=r.st?new Float32Array(c*2):void 0,d=r.normal?new Float32Array(c*3):void 0,p=r.tangent?new Float32Array(c*3):void 0,g=r.bitangent?new Float32Array(c*3):void 0,m,y=r.normal||r.tangent||r.bitangent;if(y){let I=r.tangent||r.bitangent,R=0,O=0,L=0,_=Math.atan2(i-n,t),C=xYe;C.z=Math.sin(_);let w=Math.cos(_),D=EYe,N=TYe;for(m=0;m<o;m++){let F=m/o*P.TWO_PI,V=w*Math.cos(F),B=w*Math.sin(F);y&&(C.x=V,C.y=B,I&&(D=h.normalize(h.cross(h.UNIT_Z,C,D),D)),r.normal&&(d[R++]=C.x,d[R++]=C.y,d[R++]=C.z,d[R++]=C.x,d[R++]=C.y,d[R++]=C.z),r.tangent&&(p[O++]=D.x,p[O++]=D.y,p[O++]=D.z,p[O++]=D.x,p[O++]=D.y,p[O++]=D.z),r.bitangent&&(N=h.normalize(h.cross(C,D,N),N),g[L++]=N.x,g[L++]=N.y,g[L++]=N.z,g[L++]=N.x,g[L++]=N.y,g[L++]=N.z))}for(m=0;m<o;m++)r.normal&&(d[R++]=0,d[R++]=0,d[R++]=-1),r.tangent&&(p[O++]=1,p[O++]=0,p[O++]=0),r.bitangent&&(g[L++]=0,g[L++]=-1,g[L++]=0);for(m=0;m<o;m++)r.normal&&(d[R++]=0,d[R++]=0,d[R++]=1),r.tangent&&(p[O++]=1,p[O++]=0,p[O++]=0),r.bitangent&&(g[L++]=0,g[L++]=1,g[L++]=0)}let A=12*o-12,b=je.createTypedArray(c,A),x=0,T=0;for(m=0;m<o-1;m++)b[x++]=T,b[x++]=T+2,b[x++]=T+3,b[x++]=T,b[x++]=T+3,b[x++]=T+1,T+=2;for(b[x++]=s-2,b[x++]=0,b[x++]=1,b[x++]=s-2,b[x++]=1,b[x++]=s-1,m=1;m<o-1;m++)b[x++]=s+m+1,b[x++]=s+m,b[x++]=s;for(m=1;m<o-1;m++)b[x++]=a,b[x++]=a+m,b[x++]=a+m+1;let E=0;if(r.st){let I=Math.max(n,i);for(m=0;m<c;m++){let R=h.fromArray(u,m*3,CYe);f[E++]=(R.x+I)/(2*I),f[E++]=(R.y+I)/(2*I)}}let v=new En;r.position&&(v.position=new Ne({componentDatatype:Y.DOUBLE,componentsPerAttribute:3,values:u})),r.normal&&(v.normal=new Ne({componentDatatype:Y.FLOAT,componentsPerAttribute:3,values:d})),r.tangent&&(v.tangent=new Ne({componentDatatype:Y.FLOAT,componentsPerAttribute:3,values:p})),r.bitangent&&(v.bitangent=new Ne({componentDatatype:Y.FLOAT,componentsPerAttribute:3,values:g})),r.st&&(v.st=new Ne({componentDatatype:Y.FLOAT,componentsPerAttribute:2,values:f})),jK.x=t*.5,jK.y=Math.max(i,n);let S=new ue(h.ZERO,U.magnitude(jK));if(l(e._offsetAttribute)){t=u.length;let I=e._offsetAttribute===pn.NONE?0:1,R=new Uint8Array(t/3).fill(I);v.applyOffset=new Ne({componentDatatype:Y.UNSIGNED_BYTE,componentsPerAttribute:1,values:R})}return new wt({attributes:v,indices:b,primitiveType:Oe.TRIANGLES,boundingSphere:S,offsetAttribute:e._offsetAttribute})};var HK;tg.getUnitCylinder=function(){return l(HK)||(HK=tg.createGeometry(new tg({topRadius:1,bottomRadius:1,length:1,vertexFormat:Be.POSITION_ONLY}))),HK};var E3=tg;var GK=new U;function NC(e){e=e??H.EMPTY_OBJECT;let t=e.length,n=e.topRadius,i=e.bottomRadius,r=e.slices??128,o=Math.max(e.numberOfVerticalLines??16,0);this._length=t,this._topRadius=n,this._bottomRadius=i,this._slices=r,this._numberOfVerticalLines=o,this._offsetAttribute=e.offsetAttribute,this._workerName="createCylinderOutlineGeometry"}NC.packedLength=6;NC.pack=function(e,t,n){return n=n??0,t[n++]=e._length,t[n++]=e._topRadius,t[n++]=e._bottomRadius,t[n++]=e._slices,t[n++]=e._numberOfVerticalLines,t[n]=e._offsetAttribute??-1,t};var Kb={length:void 0,topRadius:void 0,bottomRadius:void 0,slices:void 0,numberOfVerticalLines:void 0,offsetAttribute:void 0};NC.unpack=function(e,t,n){t=t??0;let i=e[t++],r=e[t++],o=e[t++],s=e[t++],a=e[t++],c=e[t];return l(n)?(n._length=i,n._topRadius=r,n._bottomRadius=o,n._slices=s,n._numberOfVerticalLines=a,n._offsetAttribute=c===-1?void 0:c,n):(Kb.length=i,Kb.topRadius=r,Kb.bottomRadius=o,Kb.slices=s,Kb.numberOfVerticalLines=a,Kb.offsetAttribute=c===-1?void 0:c,new NC(Kb))};NC.createGeometry=function(e){let t=e._length,n=e._topRadius,i=e._bottomRadius,r=e._slices,o=e._numberOfVerticalLines;if(t<=0||n<0||i<0||n===0&&i===0)return;let s=r*2,a=OC.computePositions(t,n,i,r,!1),c=r*2,u;if(o>0){let y=Math.min(o,r);u=Math.round(r/y),c+=y}let f=je.createTypedArray(s,c*2),d=0,p;for(p=0;p<r-1;p++)f[d++]=p,f[d++]=p+1,f[d++]=p+r,f[d++]=p+1+r;if(f[d++]=r-1,f[d++]=0,f[d++]=r+r-1,f[d++]=r,o>0)for(p=0;p<r;p+=u)f[d++]=p,f[d++]=p+r;let g=new En;g.position=new Ne({componentDatatype:Y.DOUBLE,componentsPerAttribute:3,values:a}),GK.x=t*.5,GK.y=Math.max(i,n);let m=new ue(h.ZERO,U.magnitude(GK));if(l(e._offsetAttribute)){t=a.length;let y=e._offsetAttribute===pn.NONE?0:1,A=new Uint8Array(t/3).fill(y);g.applyOffset=new Ne({componentDatatype:Y.UNSIGNED_BYTE,componentsPerAttribute:1,values:A})}return new wt({attributes:g,indices:f,primitiveType:Oe.LINES,boundingSphere:m,offsetAttribute:e._offsetAttribute})};var C3=NC;var u0e=h.ZERO,f0e=new h,vYe=new h,d0e=new z;function SYe(e){this.id=e,this.vertexFormat=void 0,this.length=void 0,this.topRadius=void 0,this.bottomRadius=void 0,this.slices=void 0,this.numberOfVerticalLines=void 0,this.offsetAttribute=void 0}function lf(e,t){Mi.call(this,{entity:e,scene:t,geometryOptions:new SYe(e),geometryPropertyName:"cylinder",observedPropertyNames:["availability","position","orientation","cylinder"]}),this._onEntityPropertyChanged(e,"cylinder",e.cylinder,void 0)}l(Object.create)&&(lf.prototype=Object.create(Mi.prototype),lf.prototype.constructor=lf);Object.defineProperties(lf.prototype,{terrainOffsetProperty:{get:function(){return this._terrainOffsetProperty}}});lf.prototype.createFillGeometryInstance=function(e){let t=this._entity,n=t.isAvailable(e),i=new Dn(n&&t.isShowing&&this._showProperty.getValue(e)&&this._fillProperty.getValue(e)),r=this._distanceDisplayConditionProperty.getValue(e),o=ti.fromDistanceDisplayCondition(r),s={show:i,distanceDisplayCondition:o,color:void 0,offset:void 0};if(this._materialProperty instanceof Kt){let a;l(this._materialProperty.color)&&(this._materialProperty.color.isConstant||n)&&(a=this._materialProperty.color.getValue(e,d0e)),l(a)||(a=z.WHITE),s.color=Jt.fromColor(a)}return l(this._options.offsetAttribute)&&(s.offset=Er.fromCartesian3(X.getValueOrDefault(this._terrainOffsetProperty,e,u0e,f0e))),new Bt({id:t,geometry:new E3(this._options),modelMatrix:t.computeModelMatrixForHeightReference(e,t.cylinder.heightReference,this._options.length*.5,this._scene.ellipsoid),attributes:s})};lf.prototype.createOutlineGeometryInstance=function(e){let t=this._entity,n=t.isAvailable(e),i=X.getValueOrDefault(this._outlineColorProperty,e,z.BLACK,d0e),r=this._distanceDisplayConditionProperty.getValue(e),o={show:new Dn(n&&t.isShowing&&this._showProperty.getValue(e)&&this._showOutlineProperty.getValue(e)),color:Jt.fromColor(i),distanceDisplayCondition:ti.fromDistanceDisplayCondition(r),offset:void 0};return l(this._options.offsetAttribute)&&(o.offset=Er.fromCartesian3(X.getValueOrDefault(this._terrainOffsetProperty,e,u0e,f0e))),new Bt({id:t,geometry:new C3(this._options),modelMatrix:t.computeModelMatrixForHeightReference(e,t.cylinder.heightReference,this._options.length*.5,this._scene.ellipsoid),attributes:o})};lf.prototype._computeCenter=function(e,t){return X.getValueOrUndefined(this._entity.position,e,t)};lf.prototype._isHidden=function(e,t){return!l(e.position)||!l(t.length)||!l(t.topRadius)||!l(t.bottomRadius)||Mi.prototype._isHidden.call(this,e,t)};lf.prototype._isDynamic=function(e,t){return!e.position.isConstant||!X.isConstant(e.orientation)||!t.length.isConstant||!t.topRadius.isConstant||!t.bottomRadius.isConstant||!X.isConstant(t.slices)||!X.isConstant(t.outlineWidth)||!X.isConstant(t.numberOfVerticalLines)};lf.prototype._setStaticOptions=function(e,t){let n=X.getValueOrDefault(t.heightReference,it.MINIMUM_VALUE,We.NONE),i=this._options;i.vertexFormat=this._materialProperty instanceof Kt?An.VERTEX_FORMAT:Cr.MaterialSupport.TEXTURED.vertexFormat,i.length=t.length.getValue(it.MINIMUM_VALUE),i.topRadius=t.topRadius.getValue(it.MINIMUM_VALUE),i.bottomRadius=t.bottomRadius.getValue(it.MINIMUM_VALUE),i.slices=X.getValueOrUndefined(t.slices,it.MINIMUM_VALUE),i.numberOfVerticalLines=X.getValueOrUndefined(t.numberOfVerticalLines,it.MINIMUM_VALUE),i.offsetAttribute=n!==We.NONE?pn.ALL:void 0};lf.prototype._onEntityPropertyChanged=ey;lf.DynamicGeometryUpdater=LC;function LC(e,t,n){Oi.call(this,e,t,n)}l(Object.create)&&(LC.prototype=Object.create(Oi.prototype),LC.prototype.constructor=LC);LC.prototype._isHidden=function(e,t,n){let i=this._options,r=X.getValueOrUndefined(e.position,n,vYe);return!l(r)||!l(i.length)||!l(i.topRadius)||!l(i.bottomRadius)||Oi.prototype._isHidden.call(this,e,t,n)};LC.prototype._setOptions=function(e,t,n){let i=X.getValueOrDefault(t.heightReference,n,We.NONE),r=this._options;r.length=X.getValueOrUndefined(t.length,n),r.topRadius=X.getValueOrUndefined(t.topRadius,n),r.bottomRadius=X.getValueOrUndefined(t.bottomRadius,n),r.slices=X.getValueOrUndefined(t.slices,n),r.numberOfVerticalLines=X.getValueOrUndefined(t.numberOfVerticalLines,n),r.offsetAttribute=i!==We.NONE?pn.ALL:void 0};var v3=lf;var qK={},S3=new h,h0e=new h,m0e=new Le,p0e=new $;function FC(e,t,n,i,r,o,s,a,c,u){let f=e+t;h.multiplyByScalar(i,Math.cos(f),S3),h.multiplyByScalar(n,Math.sin(f),h0e),h.add(S3,h0e,S3);let d=Math.cos(e);d=d*d;let p=Math.sin(e);p=p*p;let m=o/Math.sqrt(s*d+r*p)/a;return Le.fromAxisAngle(S3,m,m0e),$.fromQuaternion(m0e,p0e),$.multiplyByVector(p0e,c,u),h.normalize(u,u),h.multiplyByScalar(u,a,u),u}var g0e=new h,_0e=new h,WK=new h,wYe=new h;qK.raisePositionsToHeight=function(e,t,n){let i=t.ellipsoid,r=t.height,o=t.extrudedHeight,s=n?e.length/3*2:e.length/3,a=new Float64Array(s*3),c=e.length,u=n?c:0;for(let f=0;f<c;f+=3){let d=f+1,p=f+2,g=h.fromArray(e,f,g0e);i.scaleToGeodeticSurface(g,g);let m=h.clone(g,_0e),y=i.geodeticSurfaceNormal(g,wYe),A=h.multiplyByScalar(y,r,WK);h.add(g,A,g),n&&(h.multiplyByScalar(y,o,A),h.add(m,A,m),a[f+u]=m.x,a[d+u]=m.y,a[p+u]=m.z),a[f]=g.x,a[d]=g.y,a[p]=g.z}return a};var IYe=new h,PYe=new h,DYe=new h;qK.computeEllipsePositions=function(e,t,n){let i=e.semiMinorAxis,r=e.semiMajorAxis,o=e.rotation,s=e.center,a=e.granularity*8,c=i*i,u=r*r,f=r*i,d=h.magnitude(s),p=h.normalize(s,IYe),g=h.cross(h.UNIT_Z,s,PYe);g=h.normalize(g,g);let m=h.cross(p,g,DYe),y=1+Math.ceil(P.PI_OVER_TWO/a),A=P.PI_OVER_TWO/(y-1),b=P.PI_OVER_TWO-y*A;b<0&&(y-=Math.ceil(Math.abs(b)/A));let x=2*(y*(y+2)),T=t?new Array(x*3):void 0,E=0,v=g0e,S=_0e,I=y*4*3,R=I-1,O=0,L=n?new Array(I):void 0,_,C,w,D,N;for(b=P.PI_OVER_TWO,v=FC(b,o,m,g,c,f,u,d,p,v),t&&(T[E++]=v.x,T[E++]=v.y,T[E++]=v.z),n&&(L[R--]=v.z,L[R--]=v.y,L[R--]=v.x),b=P.PI_OVER_TWO-A,_=1;_<y+1;++_){if(v=FC(b,o,m,g,c,f,u,d,p,v),S=FC(Math.PI-b,o,m,g,c,f,u,d,p,S),t){for(T[E++]=v.x,T[E++]=v.y,T[E++]=v.z,w=2*_+2,C=1;C<w-1;++C)D=C/(w-1),N=h.lerp(v,S,D,WK),T[E++]=N.x,T[E++]=N.y,T[E++]=N.z;T[E++]=S.x,T[E++]=S.y,T[E++]=S.z}n&&(L[R--]=v.z,L[R--]=v.y,L[R--]=v.x,L[O++]=S.x,L[O++]=S.y,L[O++]=S.z),b=P.PI_OVER_TWO-(_+1)*A}for(_=y;_>1;--_){if(b=P.PI_OVER_TWO-(_-1)*A,v=FC(-b,o,m,g,c,f,u,d,p,v),S=FC(b+Math.PI,o,m,g,c,f,u,d,p,S),t){for(T[E++]=v.x,T[E++]=v.y,T[E++]=v.z,w=2*(_-1)+2,C=1;C<w-1;++C)D=C/(w-1),N=h.lerp(v,S,D,WK),T[E++]=N.x,T[E++]=N.y,T[E++]=N.z;T[E++]=S.x,T[E++]=S.y,T[E++]=S.z}n&&(L[R--]=v.z,L[R--]=v.y,L[R--]=v.x,L[O++]=S.x,L[O++]=S.y,L[O++]=S.z)}b=P.PI_OVER_TWO,v=FC(-b,o,m,g,c,f,u,d,p,v);let F={};return t&&(T[E++]=v.x,T[E++]=v.y,T[E]=v.z,F.positions=T,F.numPts=y),n&&(L[R--]=v.z,L[R--]=v.y,L[R]=v.x,F.outerPositions=L),F};var uf=qK;var BC=new h,YK=new h,XK=new h,y0e=new h,la=new U,A0e=new $,RYe=new $,KK=new Le,b0e=new h,x0e=new h,T0e=new h,P3=new he,E0e=new h,C0e=new U,v0e=new U;function S0e(e,t,n){let i=t.vertexFormat,r=t.center,o=t.semiMajorAxis,s=t.semiMinorAxis,a=t.ellipsoid,c=t.stRotation,u=n?e.length/3*2:e.length/3,f=t.shadowVolume,d=i.st?new Float32Array(u*2):void 0,p=i.normal?new Float32Array(u*3):void 0,g=i.tangent?new Float32Array(u*3):void 0,m=i.bitangent?new Float32Array(u*3):void 0,y=f?new Float32Array(u*3):void 0,A=0,b=b0e,x=x0e,T=T0e,E=new ji(a),v=E.project(a.cartesianToCartographic(r,P3),E0e),S=a.scaleToGeodeticSurface(r,BC);a.geodeticSurfaceNormal(S,S);let I=A0e,R=RYe;if(c!==0){let N=Le.fromAxisAngle(S,c,KK);I=$.fromQuaternion(N,I),N=Le.fromAxisAngle(S,-c,KK),R=$.fromQuaternion(N,R)}else I=$.clone($.IDENTITY,I),R=$.clone($.IDENTITY,R);let O=U.fromElements(Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY,C0e),L=U.fromElements(Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY,v0e),_=e.length,C=n?_:0,w=C/3*2;for(let N=0;N<_;N+=3){let F=N+1,V=N+2,B=h.fromArray(e,N,BC);if(i.st){let j=$.multiplyByVector(I,B,YK),k=E.project(a.cartesianToCartographic(j,P3),XK);h.subtract(k,v,k),la.x=(k.x+o)/(2*o),la.y=(k.y+s)/(2*s),O.x=Math.min(la.x,O.x),O.y=Math.min(la.y,O.y),L.x=Math.max(la.x,L.x),L.y=Math.max(la.y,L.y),n&&(d[A+w]=la.x,d[A+1+w]=la.y),d[A++]=la.x,d[A++]=la.y}(i.normal||i.tangent||i.bitangent||f)&&(b=a.geodeticSurfaceNormal(B,b),f&&(y[N+C]=-b.x,y[F+C]=-b.y,y[V+C]=-b.z),(i.normal||i.tangent||i.bitangent)&&((i.tangent||i.bitangent)&&(x=h.normalize(h.cross(h.UNIT_Z,b,x),x),$.multiplyByVector(R,x,x)),i.normal&&(p[N]=b.x,p[F]=b.y,p[V]=b.z,n&&(p[N+C]=-b.x,p[F+C]=-b.y,p[V+C]=-b.z)),i.tangent&&(g[N]=x.x,g[F]=x.y,g[V]=x.z,n&&(g[N+C]=-x.x,g[F+C]=-x.y,g[V+C]=-x.z)),i.bitangent&&(T=h.normalize(h.cross(b,x,T),T),m[N]=T.x,m[F]=T.y,m[V]=T.z,n&&(m[N+C]=T.x,m[F+C]=T.y,m[V+C]=T.z))))}if(i.st){_=d.length;for(let N=0;N<_;N+=2)d[N]=(d[N]-O.x)/(L.x-O.x),d[N+1]=(d[N+1]-O.y)/(L.y-O.y)}let D=new En;if(i.position){let N=uf.raisePositionsToHeight(e,t,n);D.position=new Ne({componentDatatype:Y.DOUBLE,componentsPerAttribute:3,values:N})}if(i.st&&(D.st=new Ne({componentDatatype:Y.FLOAT,componentsPerAttribute:2,values:d})),i.normal&&(D.normal=new Ne({componentDatatype:Y.FLOAT,componentsPerAttribute:3,values:p})),i.tangent&&(D.tangent=new Ne({componentDatatype:Y.FLOAT,componentsPerAttribute:3,values:g})),i.bitangent&&(D.bitangent=new Ne({componentDatatype:Y.FLOAT,componentsPerAttribute:3,values:m})),f&&(D.extrudeDirection=new Ne({componentDatatype:Y.FLOAT,componentsPerAttribute:3,values:y})),n&&l(t.offsetAttribute)){let N=new Uint8Array(u);if(t.offsetAttribute===pn.TOP)N=N.fill(1,0,u/2);else{let F=t.offsetAttribute===pn.NONE?0:1;N=N.fill(F)}D.applyOffset=new Ne({componentDatatype:Y.UNSIGNED_BYTE,componentsPerAttribute:1,values:N})}return D}function w0e(e){let t=new Array(12*(e*(e+1))-6),n=0,i,r,o,s,a;for(i=0,o=1,s=0;s<3;s++)t[n++]=o++,t[n++]=i,t[n++]=o;for(s=2;s<e+1;++s){for(o=s*(s+1)-1,i=(s-1)*s-1,t[n++]=o++,t[n++]=i,t[n++]=o,r=2*s,a=0;a<r-1;++a)t[n++]=o,t[n++]=i++,t[n++]=i,t[n++]=o++,t[n++]=i,t[n++]=o;t[n++]=o++,t[n++]=i,t[n++]=o}for(r=e*2,++o,++i,s=0;s<r-1;++s)t[n++]=o,t[n++]=i++,t[n++]=i,t[n++]=o++,t[n++]=i,t[n++]=o;for(t[n++]=o,t[n++]=i++,t[n++]=i,t[n++]=o++,t[n++]=i++,t[n++]=i,++i,s=e-1;s>1;--s){for(t[n++]=i++,t[n++]=i,t[n++]=o,r=2*s,a=0;a<r-1;++a)t[n++]=o,t[n++]=i++,t[n++]=i,t[n++]=o++,t[n++]=i,t[n++]=o;t[n++]=i++,t[n++]=i++,t[n++]=o++}for(s=0;s<3;s++)t[n++]=i++,t[n++]=i,t[n++]=o;return t}var $b=new h;function OYe(e){let t=e.center;$b=h.multiplyByScalar(e.ellipsoid.geodeticSurfaceNormal(t,$b),e.height,$b),$b=h.add(t,$b,$b);let n=new ue($b,e.semiMajorAxis),i=uf.computeEllipsePositions(e,!0,!1),r=i.positions,o=i.numPts,s=S0e(r,e,!1),a=w0e(o);return a=je.createTypedArray(r.length/3,a),{boundingSphere:n,attributes:s,indices:a}}function MYe(e,t){let n=t.vertexFormat,i=t.center,r=t.semiMajorAxis,o=t.semiMinorAxis,s=t.ellipsoid,a=t.height,c=t.extrudedHeight,u=t.stRotation,f=e.length/3*2,d=new Float64Array(f*3),p=n.st?new Float32Array(f*2):void 0,g=n.normal?new Float32Array(f*3):void 0,m=n.tangent?new Float32Array(f*3):void 0,y=n.bitangent?new Float32Array(f*3):void 0,A=t.shadowVolume,b=A?new Float32Array(f*3):void 0,x=0,T=b0e,E=x0e,v=T0e,S=new ji(s),I=S.project(s.cartesianToCartographic(i,P3),E0e),R=s.scaleToGeodeticSurface(i,BC);s.geodeticSurfaceNormal(R,R);let O=Le.fromAxisAngle(R,u,KK),L=$.fromQuaternion(O,A0e),_=U.fromElements(Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY,C0e),C=U.fromElements(Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY,v0e),w=e.length,D=w/3*2;for(let F=0;F<w;F+=3){let V=F+1,B=F+2,j=h.fromArray(e,F,BC),k;if(n.st){let q=$.multiplyByVector(L,j,YK),Q=S.project(s.cartesianToCartographic(q,P3),XK);h.subtract(Q,I,Q),la.x=(Q.x+r)/(2*r),la.y=(Q.y+o)/(2*o),_.x=Math.min(la.x,_.x),_.y=Math.min(la.y,_.y),C.x=Math.max(la.x,C.x),C.y=Math.max(la.y,C.y),p[x+D]=la.x,p[x+1+D]=la.y,p[x++]=la.x,p[x++]=la.y}j=s.scaleToGeodeticSurface(j,j),k=h.clone(j,YK),T=s.geodeticSurfaceNormal(j,T),A&&(b[F+w]=-T.x,b[V+w]=-T.y,b[B+w]=-T.z);let G=h.multiplyByScalar(T,a,y0e);if(j=h.add(j,G,j),G=h.multiplyByScalar(T,c,G),k=h.add(k,G,k),n.position&&(d[F+w]=k.x,d[V+w]=k.y,d[B+w]=k.z,d[F]=j.x,d[V]=j.y,d[B]=j.z),n.normal||n.tangent||n.bitangent){v=h.clone(T,v);let q=h.fromArray(e,(F+3)%w,y0e);h.subtract(q,j,q);let Q=h.subtract(k,j,XK);T=h.normalize(h.cross(Q,q,T),T),n.normal&&(g[F]=T.x,g[V]=T.y,g[B]=T.z,g[F+w]=T.x,g[V+w]=T.y,g[B+w]=T.z),n.tangent&&(E=h.normalize(h.cross(v,T,E),E),m[F]=E.x,m[V]=E.y,m[B]=E.z,m[F+w]=E.x,m[F+1+w]=E.y,m[F+2+w]=E.z),n.bitangent&&(y[F]=v.x,y[V]=v.y,y[B]=v.z,y[F+w]=v.x,y[V+w]=v.y,y[B+w]=v.z)}}if(n.st){w=p.length;for(let F=0;F<w;F+=2)p[F]=(p[F]-_.x)/(C.x-_.x),p[F+1]=(p[F+1]-_.y)/(C.y-_.y)}let N=new En;if(n.position&&(N.position=new Ne({componentDatatype:Y.DOUBLE,componentsPerAttribute:3,values:d})),n.st&&(N.st=new Ne({componentDatatype:Y.FLOAT,componentsPerAttribute:2,values:p})),n.normal&&(N.normal=new Ne({componentDatatype:Y.FLOAT,componentsPerAttribute:3,values:g})),n.tangent&&(N.tangent=new Ne({componentDatatype:Y.FLOAT,componentsPerAttribute:3,values:m})),n.bitangent&&(N.bitangent=new Ne({componentDatatype:Y.FLOAT,componentsPerAttribute:3,values:y})),A&&(N.extrudeDirection=new Ne({componentDatatype:Y.FLOAT,componentsPerAttribute:3,values:b})),l(t.offsetAttribute)){let F=new Uint8Array(f);if(t.offsetAttribute===pn.TOP)F=F.fill(1,0,f/2);else{let V=t.offsetAttribute===pn.NONE?0:1;F=F.fill(V)}N.applyOffset=new Ne({componentDatatype:Y.UNSIGNED_BYTE,componentsPerAttribute:1,values:F})}return N}function NYe(e){let t=e.length/3,n=je.createTypedArray(t,t*6),i=0;for(let r=0;r<t;r++){let o=r,s=r+t,a=(o+1)%t,c=a+t;n[i++]=o,n[i++]=s,n[i++]=a,n[i++]=a,n[i++]=s,n[i++]=c}return n}var w3=new ue,I3=new ue;function LYe(e){let t=e.center,n=e.ellipsoid,i=e.semiMajorAxis,r=h.multiplyByScalar(n.geodeticSurfaceNormal(t,BC),e.height,BC);w3.center=h.add(t,r,w3.center),w3.radius=i,r=h.multiplyByScalar(n.geodeticSurfaceNormal(t,r),e.extrudedHeight,r),I3.center=h.add(t,r,I3.center),I3.radius=i;let o=uf.computeEllipsePositions(e,!0,!0),s=o.positions,a=o.numPts,c=o.outerPositions,u=ue.union(w3,I3),f=S0e(s,e,!0),d=w0e(a),p=d.length;d.length=p*2;let g=s.length/3;for(let E=0;E<p;E+=3)d[E+p]=d[E+2]+g,d[E+1+p]=d[E+1]+g,d[E+2+p]=d[E]+g;let m=je.createTypedArray(g*2/3,d),y=new wt({attributes:f,indices:m,primitiveType:Oe.TRIANGLES}),A=MYe(c,e);d=NYe(c);let b=je.createTypedArray(c.length*2/3,d),x=new wt({attributes:A,indices:b,primitiveType:Oe.TRIANGLES}),T=Wn.combineInstances([new Bt({geometry:y}),new Bt({geometry:x})]);return{boundingSphere:u,attributes:T[0].attributes,indices:T[0].indices}}function I0e(e,t,n,i,r,o,s){let c=uf.computeEllipsePositions({center:e,semiMajorAxis:t,semiMinorAxis:n,rotation:i,granularity:r},!1,!0).outerPositions,u=c.length/3,f=new Array(u);for(let p=0;p<u;++p)f[p]=h.fromArray(c,p*3);let d=ie.fromCartesianArray(f,o,s);return d.width>P.PI&&(d.north=d.north>0?P.PI_OVER_TWO-P.EPSILON7:d.north,d.south=d.south<0?P.EPSILON7-P.PI_OVER_TWO:d.south,d.east=P.PI,d.west=-P.PI),d}function dp(e){e=e??H.EMPTY_OBJECT;let t=e.center,n=e.ellipsoid??ee.default,i=e.semiMajorAxis,r=e.semiMinorAxis,o=e.granularity??P.RADIANS_PER_DEGREE,s=e.vertexFormat??Be.DEFAULT,a=e.height??0,c=e.extrudedHeight??a;this._center=h.clone(t),this._semiMajorAxis=i,this._semiMinorAxis=r,this._ellipsoid=ee.clone(n),this._rotation=e.rotation??0,this._stRotation=e.stRotation??0,this._height=Math.max(c,a),this._granularity=o,this._vertexFormat=Be.clone(s),this._extrudedHeight=Math.min(c,a),this._shadowVolume=e.shadowVolume??!1,this._workerName="createEllipseGeometry",this._offsetAttribute=e.offsetAttribute,this._rectangle=void 0,this._textureCoordinateRotationPoints=void 0}dp.packedLength=h.packedLength+ee.packedLength+Be.packedLength+9;dp.pack=function(e,t,n){return n=n??0,h.pack(e._center,t,n),n+=h.packedLength,ee.pack(e._ellipsoid,t,n),n+=ee.packedLength,Be.pack(e._vertexFormat,t,n),n+=Be.packedLength,t[n++]=e._semiMajorAxis,t[n++]=e._semiMinorAxis,t[n++]=e._rotation,t[n++]=e._stRotation,t[n++]=e._height,t[n++]=e._granularity,t[n++]=e._extrudedHeight,t[n++]=e._shadowVolume?1:0,t[n]=e._offsetAttribute??-1,t};var P0e=new h,D0e=new ee,R0e=new Be,fp={center:P0e,ellipsoid:D0e,vertexFormat:R0e,semiMajorAxis:void 0,semiMinorAxis:void 0,rotation:void 0,stRotation:void 0,height:void 0,granularity:void 0,extrudedHeight:void 0,shadowVolume:void 0,offsetAttribute:void 0};dp.unpack=function(e,t,n){t=t??0;let i=h.unpack(e,t,P0e);t+=h.packedLength;let r=ee.unpack(e,t,D0e);t+=ee.packedLength;let o=Be.unpack(e,t,R0e);t+=Be.packedLength;let s=e[t++],a=e[t++],c=e[t++],u=e[t++],f=e[t++],d=e[t++],p=e[t++],g=e[t++]===1,m=e[t];return l(n)?(n._center=h.clone(i,n._center),n._ellipsoid=ee.clone(r,n._ellipsoid),n._vertexFormat=Be.clone(o,n._vertexFormat),n._semiMajorAxis=s,n._semiMinorAxis=a,n._rotation=c,n._stRotation=u,n._height=f,n._granularity=d,n._extrudedHeight=p,n._shadowVolume=g,n._offsetAttribute=m===-1?void 0:m,n):(fp.height=f,fp.extrudedHeight=p,fp.granularity=d,fp.stRotation=u,fp.rotation=c,fp.semiMajorAxis=s,fp.semiMinorAxis=a,fp.shadowVolume=g,fp.offsetAttribute=m===-1?void 0:m,new dp(fp))};dp.computeRectangle=function(e,t){e=e??H.EMPTY_OBJECT;let n=e.center,i=e.ellipsoid??ee.default,r=e.semiMajorAxis,o=e.semiMinorAxis,s=e.granularity??P.RADIANS_PER_DEGREE,a=e.rotation??0;return I0e(n,r,o,a,s,i,t)};dp.createGeometry=function(e){if(e._semiMajorAxis<=0||e._semiMinorAxis<=0)return;let t=e._height,n=e._extrudedHeight,i=!P.equalsEpsilon(t,n,0,P.EPSILON2);e._center=e._ellipsoid.scaleToGeodeticSurface(e._center,e._center);let r={center:e._center,semiMajorAxis:e._semiMajorAxis,semiMinorAxis:e._semiMinorAxis,ellipsoid:e._ellipsoid,rotation:e._rotation,height:t,granularity:e._granularity,vertexFormat:e._vertexFormat,stRotation:e._stRotation},o;if(i)r.extrudedHeight=n,r.shadowVolume=e._shadowVolume,r.offsetAttribute=e._offsetAttribute,o=LYe(r);else if(o=OYe(r),l(e._offsetAttribute)){let s=o.attributes.position.values.length,a=e._offsetAttribute===pn.NONE?0:1,c=new Uint8Array(s/3).fill(a);o.attributes.applyOffset=new Ne({componentDatatype:Y.UNSIGNED_BYTE,componentsPerAttribute:1,values:c})}return new wt({attributes:o.attributes,indices:o.indices,primitiveType:Oe.TRIANGLES,boundingSphere:o.boundingSphere,offsetAttribute:e._offsetAttribute})};dp.createShadowVolume=function(e,t,n){let i=e._granularity,r=e._ellipsoid,o=t(i,r),s=n(i,r);return new dp({center:e._center,semiMajorAxis:e._semiMajorAxis,semiMinorAxis:e._semiMinorAxis,ellipsoid:r,rotation:e._rotation,stRotation:e._stRotation,granularity:i,extrudedHeight:o,height:s,vertexFormat:Be.POSITION_ONLY,shadowVolume:!0})};function FYe(e){let t=-e._stRotation;if(t===0)return[0,0,0,1,1,0];let i=uf.computeEllipsePositions({center:e._center,semiMajorAxis:e._semiMajorAxis,semiMinorAxis:e._semiMinorAxis,rotation:e._rotation,granularity:e._granularity},!1,!0).outerPositions,r=i.length/3,o=new Array(r);for(let c=0;c<r;++c)o[c]=h.fromArray(i,c*3);let s=e._ellipsoid,a=e.rectangle;return wt._textureCoordinateRotationPoints(o,t,s,a)}Object.defineProperties(dp.prototype,{rectangle:{get:function(){return l(this._rectangle)||(this._rectangle=I0e(this._center,this._semiMajorAxis,this._semiMinorAxis,this._rotation,this._granularity,this._ellipsoid)),this._rectangle}},textureCoordinateRotationPoints:{get:function(){return l(this._textureCoordinateRotationPoints)||(this._textureCoordinateRotationPoints=FYe(this)),this._textureCoordinateRotationPoints}}});var xu=dp;var O0e=new h,Jb=new h;function BYe(e){let t=e.center;Jb=h.multiplyByScalar(e.ellipsoid.geodeticSurfaceNormal(t,Jb),e.height,Jb),Jb=h.add(t,Jb,Jb);let n=new ue(Jb,e.semiMajorAxis),i=uf.computeEllipsePositions(e,!1,!0).outerPositions,r=new En({position:new Ne({componentDatatype:Y.DOUBLE,componentsPerAttribute:3,values:uf.raisePositionsToHeight(i,e,!1)})}),o=i.length/3,s=je.createTypedArray(o,o*2),a=0;for(let c=0;c<o;++c)s[a++]=c,s[a++]=(c+1)%o;return{boundingSphere:n,attributes:r,indices:s}}var D3=new ue,R3=new ue;function kYe(e){let t=e.center,n=e.ellipsoid,i=e.semiMajorAxis,r=h.multiplyByScalar(n.geodeticSurfaceNormal(t,O0e),e.height,O0e);D3.center=h.add(t,r,D3.center),D3.radius=i,r=h.multiplyByScalar(n.geodeticSurfaceNormal(t,r),e.extrudedHeight,r),R3.center=h.add(t,r,R3.center),R3.radius=i;let o=uf.computeEllipsePositions(e,!1,!0).outerPositions,s=new En({position:new Ne({componentDatatype:Y.DOUBLE,componentsPerAttribute:3,values:uf.raisePositionsToHeight(o,e,!0)})});o=s.position.values;let a=ue.union(D3,R3),c=o.length/3;if(l(e.offsetAttribute)){let m=new Uint8Array(c);if(e.offsetAttribute===pn.TOP)m=m.fill(1,0,c/2);else{let y=e.offsetAttribute===pn.NONE?0:1;m=m.fill(y)}s.applyOffset=new Ne({componentDatatype:Y.UNSIGNED_BYTE,componentsPerAttribute:1,values:m})}let u=e.numberOfVerticalLines??16;u=P.clamp(u,0,c/2);let f=je.createTypedArray(c,c*2+u*2);c/=2;let d=0,p;for(p=0;p<c;++p)f[d++]=p,f[d++]=(p+1)%c,f[d++]=p+c,f[d++]=(p+1)%c+c;let g;if(u>0){let m=Math.min(u,c);g=Math.round(c/m);let y=Math.min(g*u,c);for(p=0;p<y;p+=g)f[d++]=p,f[d++]=p+c}return{boundingSphere:a,attributes:s,indices:f}}function kC(e){e=e??H.EMPTY_OBJECT;let t=e.center,n=e.ellipsoid??ee.default,i=e.semiMajorAxis,r=e.semiMinorAxis,o=e.granularity??P.RADIANS_PER_DEGREE,s=e.height??0,a=e.extrudedHeight??s;this._center=h.clone(t),this._semiMajorAxis=i,this._semiMinorAxis=r,this._ellipsoid=ee.clone(n),this._rotation=e.rotation??0,this._height=Math.max(a,s),this._granularity=o,this._extrudedHeight=Math.min(a,s),this._numberOfVerticalLines=Math.max(e.numberOfVerticalLines??16,0),this._offsetAttribute=e.offsetAttribute,this._workerName="createEllipseOutlineGeometry"}kC.packedLength=h.packedLength+ee.packedLength+8;kC.pack=function(e,t,n){return n=n??0,h.pack(e._center,t,n),n+=h.packedLength,ee.pack(e._ellipsoid,t,n),n+=ee.packedLength,t[n++]=e._semiMajorAxis,t[n++]=e._semiMinorAxis,t[n++]=e._rotation,t[n++]=e._height,t[n++]=e._granularity,t[n++]=e._extrudedHeight,t[n++]=e._numberOfVerticalLines,t[n]=e._offsetAttribute??-1,t};var M0e=new h,N0e=new ee,ng={center:M0e,ellipsoid:N0e,semiMajorAxis:void 0,semiMinorAxis:void 0,rotation:void 0,height:void 0,granularity:void 0,extrudedHeight:void 0,numberOfVerticalLines:void 0,offsetAttribute:void 0};kC.unpack=function(e,t,n){t=t??0;let i=h.unpack(e,t,M0e);t+=h.packedLength;let r=ee.unpack(e,t,N0e);t+=ee.packedLength;let o=e[t++],s=e[t++],a=e[t++],c=e[t++],u=e[t++],f=e[t++],d=e[t++],p=e[t];return l(n)?(n._center=h.clone(i,n._center),n._ellipsoid=ee.clone(r,n._ellipsoid),n._semiMajorAxis=o,n._semiMinorAxis=s,n._rotation=a,n._height=c,n._granularity=u,n._extrudedHeight=f,n._numberOfVerticalLines=d,n._offsetAttribute=p===-1?void 0:p,n):(ng.height=c,ng.extrudedHeight=f,ng.granularity=u,ng.rotation=a,ng.semiMajorAxis=o,ng.semiMinorAxis=s,ng.numberOfVerticalLines=d,ng.offsetAttribute=p===-1?void 0:p,new kC(ng))};kC.createGeometry=function(e){if(e._semiMajorAxis<=0||e._semiMinorAxis<=0)return;let t=e._height,n=e._extrudedHeight,i=!P.equalsEpsilon(t,n,0,P.EPSILON2);e._center=e._ellipsoid.scaleToGeodeticSurface(e._center,e._center);let r={center:e._center,semiMajorAxis:e._semiMajorAxis,semiMinorAxis:e._semiMinorAxis,ellipsoid:e._ellipsoid,rotation:e._rotation,height:t,granularity:e._granularity,numberOfVerticalLines:e._numberOfVerticalLines},o;if(i)r.extrudedHeight=n,r.offsetAttribute=e._offsetAttribute,o=kYe(r);else if(o=BYe(r),l(e._offsetAttribute)){let s=o.attributes.position.values.length,a=e._offsetAttribute===pn.NONE?0:1,c=new Uint8Array(s/3).fill(a);o.attributes.applyOffset=new Ne({componentDatatype:Y.UNSIGNED_BYTE,componentsPerAttribute:1,values:c})}return new wt({attributes:o.attributes,indices:o.indices,primitiveType:Oe.LINES,boundingSphere:o.boundingSphere,offsetAttribute:e._offsetAttribute})};var gd=kC;var L0e=new z,F0e=h.ZERO,B0e=new h,k0e=new ie;function UYe(e){this.id=e,this.vertexFormat=void 0,this.center=void 0,this.semiMajorAxis=void 0,this.semiMinorAxis=void 0,this.rotation=void 0,this.height=void 0,this.extrudedHeight=void 0,this.granularity=void 0,this.stRotation=void 0,this.numberOfVerticalLines=void 0,this.offsetAttribute=void 0}function Ih(e,t){oi.call(this,{entity:e,scene:t,geometryOptions:new UYe(e),geometryPropertyName:"ellipse",observedPropertyNames:["availability","position","ellipse"]}),this._onEntityPropertyChanged(e,"ellipse",e.ellipse,void 0)}l(Object.create)&&(Ih.prototype=Object.create(oi.prototype),Ih.prototype.constructor=Ih);Ih.prototype.createFillGeometryInstance=function(e){let t=this._entity,n=t.isAvailable(e),i={show:new Dn(n&&t.isShowing&&this._showProperty.getValue(e)&&this._fillProperty.getValue(e)),distanceDisplayCondition:ti.fromDistanceDisplayCondition(this._distanceDisplayConditionProperty.getValue(e)),offset:void 0,color:void 0};if(this._materialProperty instanceof Kt){let r;l(this._materialProperty.color)&&(this._materialProperty.color.isConstant||n)&&(r=this._materialProperty.color.getValue(e,L0e)),l(r)||(r=z.WHITE),i.color=Jt.fromColor(r)}return l(this._options.offsetAttribute)&&(i.offset=Er.fromCartesian3(X.getValueOrDefault(this._terrainOffsetProperty,e,F0e,B0e))),new Bt({id:t,geometry:new xu(this._options),attributes:i})};Ih.prototype.createOutlineGeometryInstance=function(e){let t=this._entity,n=t.isAvailable(e),i=X.getValueOrDefault(this._outlineColorProperty,e,z.BLACK,L0e),r=this._distanceDisplayConditionProperty.getValue(e),o={show:new Dn(n&&t.isShowing&&this._showProperty.getValue(e)&&this._showOutlineProperty.getValue(e)),color:Jt.fromColor(i),distanceDisplayCondition:ti.fromDistanceDisplayCondition(r),offset:void 0};return l(this._options.offsetAttribute)&&(o.offset=Er.fromCartesian3(X.getValueOrDefault(this._terrainOffsetProperty,e,F0e,B0e))),new Bt({id:t,geometry:new gd(this._options),attributes:o})};Ih.prototype._computeCenter=function(e,t){return X.getValueOrUndefined(this._entity.position,e,t)};Ih.prototype._isHidden=function(e,t){let n=e.position;return!l(n)||!l(t.semiMajorAxis)||!l(t.semiMinorAxis)||Mi.prototype._isHidden.call(this,e,t)};Ih.prototype._isDynamic=function(e,t){return!e.position.isConstant||!t.semiMajorAxis.isConstant||!t.semiMinorAxis.isConstant||!X.isConstant(t.rotation)||!X.isConstant(t.height)||!X.isConstant(t.extrudedHeight)||!X.isConstant(t.granularity)||!X.isConstant(t.stRotation)||!X.isConstant(t.outlineWidth)||!X.isConstant(t.numberOfVerticalLines)||!X.isConstant(t.zIndex)||this._onTerrain&&!X.isConstant(this._materialProperty)&&!(this._materialProperty instanceof Kt)};Ih.prototype._setStaticOptions=function(e,t){let n=X.getValueOrUndefined(t.height,it.MINIMUM_VALUE),i=X.getValueOrDefault(t.heightReference,it.MINIMUM_VALUE,We.NONE),r=X.getValueOrUndefined(t.extrudedHeight,it.MINIMUM_VALUE),o=X.getValueOrDefault(t.extrudedHeightReference,it.MINIMUM_VALUE,We.NONE);l(r)&&!l(n)&&(n=0);let s=this._options;s.vertexFormat=this._materialProperty instanceof Kt?An.VERTEX_FORMAT:Cr.MaterialSupport.TEXTURED.vertexFormat,s.center=e.position.getValue(it.MINIMUM_VALUE,s.center),s.semiMajorAxis=t.semiMajorAxis.getValue(it.MINIMUM_VALUE,s.semiMajorAxis),s.semiMinorAxis=t.semiMinorAxis.getValue(it.MINIMUM_VALUE,s.semiMinorAxis),s.rotation=X.getValueOrUndefined(t.rotation,it.MINIMUM_VALUE),s.granularity=X.getValueOrUndefined(t.granularity,it.MINIMUM_VALUE),s.stRotation=X.getValueOrUndefined(t.stRotation,it.MINIMUM_VALUE),s.numberOfVerticalLines=X.getValueOrUndefined(t.numberOfVerticalLines,it.MINIMUM_VALUE),s.offsetAttribute=oi.computeGeometryOffsetAttribute(n,i,r,o),s.height=oi.getGeometryHeight(n,i),r=oi.getGeometryExtrudedHeight(r,o),r===oi.CLAMP_TO_GROUND&&(r=Ni.getMinimumMaximumHeights(xu.computeRectangle(s,k0e)).minimumTerrainHeight),s.extrudedHeight=r};Ih.DynamicGeometryUpdater=UC;function UC(e,t,n){Oi.call(this,e,t,n)}l(Object.create)&&(UC.prototype=Object.create(Oi.prototype),UC.prototype.constructor=UC);UC.prototype._isHidden=function(e,t,n){let i=this._options;return!l(i.center)||!l(i.semiMajorAxis)||!l(i.semiMinorAxis)||Oi.prototype._isHidden.call(this,e,t,n)};UC.prototype._setOptions=function(e,t,n){let i=this._options,r=X.getValueOrUndefined(t.height,n),o=X.getValueOrDefault(t.heightReference,n,We.NONE),s=X.getValueOrUndefined(t.extrudedHeight,n),a=X.getValueOrDefault(t.extrudedHeightReference,n,We.NONE);l(s)&&!l(r)&&(r=0),i.center=X.getValueOrUndefined(e.position,n,i.center),i.semiMajorAxis=X.getValueOrUndefined(t.semiMajorAxis,n),i.semiMinorAxis=X.getValueOrUndefined(t.semiMinorAxis,n),i.rotation=X.getValueOrUndefined(t.rotation,n),i.granularity=X.getValueOrUndefined(t.granularity,n),i.stRotation=X.getValueOrUndefined(t.stRotation,n),i.numberOfVerticalLines=X.getValueOrUndefined(t.numberOfVerticalLines,n),i.offsetAttribute=oi.computeGeometryOffsetAttribute(r,o,s,a),i.height=oi.getGeometryHeight(r,o),s=oi.getGeometryExtrudedHeight(s,a),s===oi.CLAMP_TO_GROUND&&(s=Ni.getMinimumMaximumHeights(xu.computeRectangle(i,k0e)).minimumTerrainHeight),i.extrudedHeight=s};var O3=Ih;var zYe=new h,VYe=new h,jYe=new h,HYe=new h,GYe=new h,WYe=new h(1,1,1),U0e=Math.cos,z0e=Math.sin;function ig(e){e=e??H.EMPTY_OBJECT;let t=e.radii??WYe,n=e.innerRadii??t,i=e.minimumClock??0,r=e.maximumClock??P.TWO_PI,o=e.minimumCone??0,s=e.maximumCone??P.PI,a=Math.round(e.stackPartitions??64),c=Math.round(e.slicePartitions??64),u=e.vertexFormat??Be.DEFAULT;this._radii=h.clone(t),this._innerRadii=h.clone(n),this._minimumClock=i,this._maximumClock=r,this._minimumCone=o,this._maximumCone=s,this._stackPartitions=a,this._slicePartitions=c,this._vertexFormat=Be.clone(u),this._offsetAttribute=e.offsetAttribute,this._workerName="createEllipsoidGeometry"}ig.packedLength=2*h.packedLength+Be.packedLength+7;ig.pack=function(e,t,n){return n=n??0,h.pack(e._radii,t,n),n+=h.packedLength,h.pack(e._innerRadii,t,n),n+=h.packedLength,Be.pack(e._vertexFormat,t,n),n+=Be.packedLength,t[n++]=e._minimumClock,t[n++]=e._maximumClock,t[n++]=e._minimumCone,t[n++]=e._maximumCone,t[n++]=e._stackPartitions,t[n++]=e._slicePartitions,t[n]=e._offsetAttribute??-1,t};var V0e=new h,j0e=new h,H0e=new Be,oy={radii:V0e,innerRadii:j0e,vertexFormat:H0e,minimumClock:void 0,maximumClock:void 0,minimumCone:void 0,maximumCone:void 0,stackPartitions:void 0,slicePartitions:void 0,offsetAttribute:void 0};ig.unpack=function(e,t,n){t=t??0;let i=h.unpack(e,t,V0e);t+=h.packedLength;let r=h.unpack(e,t,j0e);t+=h.packedLength;let o=Be.unpack(e,t,H0e);t+=Be.packedLength;let s=e[t++],a=e[t++],c=e[t++],u=e[t++],f=e[t++],d=e[t++],p=e[t];return l(n)?(n._radii=h.clone(i,n._radii),n._innerRadii=h.clone(r,n._innerRadii),n._vertexFormat=Be.clone(o,n._vertexFormat),n._minimumClock=s,n._maximumClock=a,n._minimumCone=c,n._maximumCone=u,n._stackPartitions=f,n._slicePartitions=d,n._offsetAttribute=p===-1?void 0:p,n):(oy.minimumClock=s,oy.maximumClock=a,oy.minimumCone=c,oy.maximumCone=u,oy.stackPartitions=f,oy.slicePartitions=d,oy.offsetAttribute=p===-1?void 0:p,new ig(oy))};ig.createGeometry=function(e){let t=e._radii;if(t.x<=0||t.y<=0||t.z<=0)return;let n=e._innerRadii;if(n.x<=0||n.y<=0||n.z<=0)return;let i=e._minimumClock,r=e._maximumClock,o=e._minimumCone,s=e._maximumCone,a=e._vertexFormat,c=e._slicePartitions+1,u=e._stackPartitions+1;c=Math.round(c*Math.abs(r-i)/P.TWO_PI),u=Math.round(u*Math.abs(s-o)/P.PI),c<2&&(c=2),u<2&&(u=2);let f,d,p=0,g=[o],m=[i];for(f=0;f<u;f++)g.push(o+f*(s-o)/(u-1));for(g.push(s),d=0;d<c;d++)m.push(i+d*(r-i)/(c-1));m.push(r);let y=g.length,A=m.length,b=0,x=1,T=n.x!==t.x||n.y!==t.y||n.z!==t.z,E=!1,v=!1,S=!1;T&&(x=2,o>0&&(E=!0,b+=c-1),s<Math.PI&&(v=!0,b+=c-1),(r-i)%P.TWO_PI?(S=!0,b+=(u-1)*2+1):b+=1);let I=A*y*x,R=new Float64Array(I*3),O=new Array(I).fill(!1),L=new Array(I).fill(!1),_=c*u*x,C=6*(_+b+1-(c+u)*x),w=je.createTypedArray(_,C),D=a.normal?new Float32Array(I*3):void 0,N=a.tangent?new Float32Array(I*3):void 0,F=a.bitangent?new Float32Array(I*3):void 0,V=a.st?new Float32Array(I*2):void 0,B=new Array(y),j=new Array(y);for(f=0;f<y;f++)B[f]=z0e(g[f]),j[f]=U0e(g[f]);let k=new Array(A),G=new Array(A);for(d=0;d<A;d++)G[d]=U0e(m[d]),k[d]=z0e(m[d]);for(f=0;f<y;f++)for(d=0;d<A;d++)R[p++]=t.x*B[f]*G[d],R[p++]=t.y*B[f]*k[d],R[p++]=t.z*j[f];let q=I/2;if(T)for(f=0;f<y;f++)for(d=0;d<A;d++)R[p++]=n.x*B[f]*G[d],R[p++]=n.y*B[f]*k[d],R[p++]=n.z*j[f],O[q]=!0,f>0&&f!==y-1&&d!==0&&d!==A-1&&(L[q]=!0),q++;p=0;let Q,W;for(f=1;f<y-2;f++)for(Q=f*A,W=(f+1)*A,d=1;d<A-2;d++)w[p++]=W+d,w[p++]=W+d+1,w[p++]=Q+d+1,w[p++]=W+d,w[p++]=Q+d+1,w[p++]=Q+d;if(T){let He=y*A;for(f=1;f<y-2;f++)for(Q=He+f*A,W=He+(f+1)*A,d=1;d<A-2;d++)w[p++]=W+d,w[p++]=Q+d,w[p++]=Q+d+1,w[p++]=W+d,w[p++]=Q+d+1,w[p++]=W+d+1}let J,Z;if(T){if(E)for(Z=y*A,f=1;f<A-2;f++)w[p++]=f,w[p++]=f+1,w[p++]=Z+f+1,w[p++]=f,w[p++]=Z+f+1,w[p++]=Z+f;if(v)for(J=y*A-A,Z=y*A*x-A,f=1;f<A-2;f++)w[p++]=J+f+1,w[p++]=J+f,w[p++]=Z+f,w[p++]=J+f+1,w[p++]=Z+f,w[p++]=Z+f+1}if(S){for(f=1;f<y-2;f++)Z=A*y+A*f,J=A*f,w[p++]=Z,w[p++]=J+A,w[p++]=J,w[p++]=Z,w[p++]=Z+A,w[p++]=J+A;for(f=1;f<y-2;f++)Z=A*y+A*(f+1)-1,J=A*(f+1)-1,w[p++]=J+A,w[p++]=Z,w[p++]=J,w[p++]=J+A,w[p++]=Z+A,w[p++]=Z}let ae=new En;a.position&&(ae.position=new Ne({componentDatatype:Y.DOUBLE,componentsPerAttribute:3,values:R}));let Ae=0,fe=0,xe=0,ge=0,we=I/2,ve,Re=ee.fromCartesian3(t),Qe=ee.fromCartesian3(n);if(a.st||a.normal||a.tangent||a.bitangent){for(f=0;f<I;f++){ve=O[f]?Qe:Re;let He=h.fromArray(R,f*3,zYe),Ye=ve.geodeticSurfaceNormal(He,VYe);if(L[f]&&h.negate(Ye,Ye),a.st){let Ke=U.negate(Ye,GYe);V[Ae++]=Math.atan2(Ke.y,Ke.x)/P.TWO_PI+.5,V[Ae++]=Math.asin(Ye.z)/Math.PI+.5}if(a.normal&&(D[fe++]=Ye.x,D[fe++]=Ye.y,D[fe++]=Ye.z),a.tangent||a.bitangent){let Ke=jYe,Pe=0,qe;if(O[f]&&(Pe=we),!E&&f>=Pe&&f<Pe+A*2?qe=h.UNIT_X:qe=h.UNIT_Z,h.cross(qe,Ye,Ke),h.normalize(Ke,Ke),a.tangent&&(N[xe++]=Ke.x,N[xe++]=Ke.y,N[xe++]=Ke.z),a.bitangent){let st=h.cross(Ye,Ke,HYe);h.normalize(st,st),F[ge++]=st.x,F[ge++]=st.y,F[ge++]=st.z}}}a.st&&(ae.st=new Ne({componentDatatype:Y.FLOAT,componentsPerAttribute:2,values:V})),a.normal&&(ae.normal=new Ne({componentDatatype:Y.FLOAT,componentsPerAttribute:3,values:D})),a.tangent&&(ae.tangent=new Ne({componentDatatype:Y.FLOAT,componentsPerAttribute:3,values:N})),a.bitangent&&(ae.bitangent=new Ne({componentDatatype:Y.FLOAT,componentsPerAttribute:3,values:F}))}if(l(e._offsetAttribute)){let He=R.length,Ye=e._offsetAttribute===pn.NONE?0:1,Ke=new Uint8Array(He/3).fill(Ye);ae.applyOffset=new Ne({componentDatatype:Y.UNSIGNED_BYTE,componentsPerAttribute:1,values:Ke})}return new wt({attributes:ae,indices:w,primitiveType:Oe.TRIANGLES,boundingSphere:ue.fromEllipsoid(Re),offsetAttribute:e._offsetAttribute})};var $K;ig.getUnitEllipsoid=function(){return l($K)||($K=ig.createGeometry(new ig({radii:new h(1,1,1),vertexFormat:Be.POSITION_ONLY}))),$K};var Qa=ig;var qYe=new h(1,1,1),M3=Math.cos,N3=Math.sin;function zC(e){e=e??H.EMPTY_OBJECT;let t=e.radii??qYe,n=e.innerRadii??t,i=e.minimumClock??0,r=e.maximumClock??P.TWO_PI,o=e.minimumCone??0,s=e.maximumCone??P.PI,a=Math.round(e.stackPartitions??10),c=Math.round(e.slicePartitions??8),u=Math.round(e.subdivisions??128);this._radii=h.clone(t),this._innerRadii=h.clone(n),this._minimumClock=i,this._maximumClock=r,this._minimumCone=o,this._maximumCone=s,this._stackPartitions=a,this._slicePartitions=c,this._subdivisions=u,this._offsetAttribute=e.offsetAttribute,this._workerName="createEllipsoidOutlineGeometry"}zC.packedLength=2*h.packedLength+8;zC.pack=function(e,t,n){return n=n??0,h.pack(e._radii,t,n),n+=h.packedLength,h.pack(e._innerRadii,t,n),n+=h.packedLength,t[n++]=e._minimumClock,t[n++]=e._maximumClock,t[n++]=e._minimumCone,t[n++]=e._maximumCone,t[n++]=e._stackPartitions,t[n++]=e._slicePartitions,t[n++]=e._subdivisions,t[n]=e._offsetAttribute??-1,t};var G0e=new h,W0e=new h,rg={radii:G0e,innerRadii:W0e,minimumClock:void 0,maximumClock:void 0,minimumCone:void 0,maximumCone:void 0,stackPartitions:void 0,slicePartitions:void 0,subdivisions:void 0,offsetAttribute:void 0};zC.unpack=function(e,t,n){t=t??0;let i=h.unpack(e,t,G0e);t+=h.packedLength;let r=h.unpack(e,t,W0e);t+=h.packedLength;let o=e[t++],s=e[t++],a=e[t++],c=e[t++],u=e[t++],f=e[t++],d=e[t++],p=e[t];return l(n)?(n._radii=h.clone(i,n._radii),n._innerRadii=h.clone(r,n._innerRadii),n._minimumClock=o,n._maximumClock=s,n._minimumCone=a,n._maximumCone=c,n._stackPartitions=u,n._slicePartitions=f,n._subdivisions=d,n._offsetAttribute=p===-1?void 0:p,n):(rg.minimumClock=o,rg.maximumClock=s,rg.minimumCone=a,rg.maximumCone=c,rg.stackPartitions=u,rg.slicePartitions=f,rg.subdivisions=d,rg.offsetAttribute=p===-1?void 0:p,new zC(rg))};zC.createGeometry=function(e){let t=e._radii;if(t.x<=0||t.y<=0||t.z<=0)return;let n=e._innerRadii;if(n.x<=0||n.y<=0||n.z<=0)return;let i=e._minimumClock,r=e._maximumClock,o=e._minimumCone,s=e._maximumCone,a=e._subdivisions,c=ee.fromCartesian3(t),u=e._slicePartitions+1,f=e._stackPartitions+1;u=Math.round(u*Math.abs(r-i)/P.TWO_PI),f=Math.round(f*Math.abs(s-o)/P.PI),u<2&&(u=2),f<2&&(f=2);let d=0,p=1,g=n.x!==t.x||n.y!==t.y||n.z!==t.z,m=!1,y=!1;g&&(p=2,o>0&&(m=!0,d+=u),s<Math.PI&&(y=!0,d+=u));let A=a*p*(f+u),b=new Float64Array(A*3),x=2*(A+d-(u+f)*p),T=je.createTypedArray(A,x),E,v,S,I,R=0,O=new Array(f),L=new Array(f);for(E=0;E<f;E++)I=o+E*(s-o)/(f-1),O[E]=N3(I),L[E]=M3(I);let _=new Array(a),C=new Array(a);for(E=0;E<a;E++)S=i+E*(r-i)/(a-1),_[E]=N3(S),C[E]=M3(S);for(E=0;E<f;E++)for(v=0;v<a;v++)b[R++]=t.x*O[E]*C[v],b[R++]=t.y*O[E]*_[v],b[R++]=t.z*L[E];if(g)for(E=0;E<f;E++)for(v=0;v<a;v++)b[R++]=n.x*O[E]*C[v],b[R++]=n.y*O[E]*_[v],b[R++]=n.z*L[E];for(O.length=a,L.length=a,E=0;E<a;E++)I=o+E*(s-o)/(a-1),O[E]=N3(I),L[E]=M3(I);for(_.length=u,C.length=u,E=0;E<u;E++)S=i+E*(r-i)/(u-1),_[E]=N3(S),C[E]=M3(S);for(E=0;E<a;E++)for(v=0;v<u;v++)b[R++]=t.x*O[E]*C[v],b[R++]=t.y*O[E]*_[v],b[R++]=t.z*L[E];if(g)for(E=0;E<a;E++)for(v=0;v<u;v++)b[R++]=n.x*O[E]*C[v],b[R++]=n.y*O[E]*_[v],b[R++]=n.z*L[E];for(R=0,E=0;E<f*p;E++){let N=E*a;for(v=0;v<a-1;v++)T[R++]=N+v,T[R++]=N+v+1}let w=f*a*p;for(E=0;E<u;E++)for(v=0;v<a-1;v++)T[R++]=w+E+v*u,T[R++]=w+E+(v+1)*u;if(g)for(w=f*a*p+u*a,E=0;E<u;E++)for(v=0;v<a-1;v++)T[R++]=w+E+v*u,T[R++]=w+E+(v+1)*u;if(g){let N=f*a*p,F=N+a*u;if(m)for(E=0;E<u;E++)T[R++]=N+E,T[R++]=F+E;if(y)for(N+=a*u-u,F+=a*u-u,E=0;E<u;E++)T[R++]=N+E,T[R++]=F+E}let D=new En({position:new Ne({componentDatatype:Y.DOUBLE,componentsPerAttribute:3,values:b})});if(l(e._offsetAttribute)){let N=b.length,F=e._offsetAttribute===pn.NONE?0:1,V=new Uint8Array(N/3).fill(F);D.applyOffset=new Ne({componentDatatype:Y.UNSIGNED_BYTE,componentsPerAttribute:1,values:V})}return new wt({attributes:D,indices:T,primitiveType:Oe.LINES,boundingSphere:ue.fromEllipsoid(c),offsetAttribute:e._offsetAttribute})};var _d=zC;var YYe=new Kt(z.WHITE),JK=h.ZERO,ZK=new h,XYe=new h,KYe=new h,QK=new z,$Ye=new h(1,1,1);function JYe(e){this.id=e,this.vertexFormat=void 0,this.radii=void 0,this.innerRadii=void 0,this.minimumClock=void 0,this.maximumClock=void 0,this.minimumCone=void 0,this.maximumCone=void 0,this.stackPartitions=void 0,this.slicePartitions=void 0,this.subdivisions=void 0,this.offsetAttribute=void 0}function ff(e,t){Mi.call(this,{entity:e,scene:t,geometryOptions:new JYe(e),geometryPropertyName:"ellipsoid",observedPropertyNames:["availability","position","orientation","ellipsoid"]}),this._onEntityPropertyChanged(e,"ellipsoid",e.ellipsoid,void 0)}l(Object.create)&&(ff.prototype=Object.create(Mi.prototype),ff.prototype.constructor=ff);Object.defineProperties(ff.prototype,{terrainOffsetProperty:{get:function(){return this._terrainOffsetProperty}}});ff.prototype.createFillGeometryInstance=function(e,t,n){let i=this._entity,r=i.isAvailable(e),o,s=new Dn(r&&i.isShowing&&this._showProperty.getValue(e)&&this._fillProperty.getValue(e)),a=this._distanceDisplayConditionProperty.getValue(e),c=ti.fromDistanceDisplayCondition(a),u={show:s,distanceDisplayCondition:c,color:void 0,offset:void 0};if(this._materialProperty instanceof Kt){let f;l(this._materialProperty.color)&&(this._materialProperty.color.isConstant||r)&&(f=this._materialProperty.color.getValue(e,QK)),l(f)||(f=z.WHITE),o=Jt.fromColor(f),u.color=o}return l(this._options.offsetAttribute)&&(u.offset=Er.fromCartesian3(X.getValueOrDefault(this._terrainOffsetProperty,e,JK,ZK))),new Bt({id:i,geometry:new Qa(this._options),modelMatrix:t?void 0:i.computeModelMatrixForHeightReference(e,i.ellipsoid.heightReference,this._options.radii.z*.5,this._scene.ellipsoid,n),attributes:u})};ff.prototype.createOutlineGeometryInstance=function(e,t,n){let i=this._entity,r=i.isAvailable(e),o=X.getValueOrDefault(this._outlineColorProperty,e,z.BLACK,QK),s=this._distanceDisplayConditionProperty.getValue(e),a={show:new Dn(r&&i.isShowing&&this._showProperty.getValue(e)&&this._showOutlineProperty.getValue(e)),color:Jt.fromColor(o),distanceDisplayCondition:ti.fromDistanceDisplayCondition(s),offset:void 0};return l(this._options.offsetAttribute)&&(a.offset=Er.fromCartesian3(X.getValueOrDefault(this._terrainOffsetProperty,e,JK,ZK))),new Bt({id:i,geometry:new _d(this._options),modelMatrix:t?void 0:i.computeModelMatrixForHeightReference(e,i.ellipsoid.heightReference,this._options.radii.z*.5,this._scene.ellipsoid,n),attributes:a})};ff.prototype._computeCenter=function(e,t){return X.getValueOrUndefined(this._entity.position,e,t)};ff.prototype._isHidden=function(e,t){return!l(e.position)||!l(t.radii)||Mi.prototype._isHidden.call(this,e,t)};ff.prototype._isDynamic=function(e,t){return!e.position.isConstant||!X.isConstant(e.orientation)||!t.radii.isConstant||!X.isConstant(t.innerRadii)||!X.isConstant(t.stackPartitions)||!X.isConstant(t.slicePartitions)||!X.isConstant(t.outlineWidth)||!X.isConstant(t.minimumClock)||!X.isConstant(t.maximumClock)||!X.isConstant(t.minimumCone)||!X.isConstant(t.maximumCone)||!X.isConstant(t.subdivisions)};ff.prototype._setStaticOptions=function(e,t){let n=X.getValueOrDefault(t.heightReference,it.MINIMUM_VALUE,We.NONE),i=this._options;i.vertexFormat=this._materialProperty instanceof Kt?An.VERTEX_FORMAT:Cr.MaterialSupport.TEXTURED.vertexFormat,i.radii=t.radii.getValue(it.MINIMUM_VALUE,i.radii),i.innerRadii=X.getValueOrUndefined(t.innerRadii,i.radii),i.minimumClock=X.getValueOrUndefined(t.minimumClock,it.MINIMUM_VALUE),i.maximumClock=X.getValueOrUndefined(t.maximumClock,it.MINIMUM_VALUE),i.minimumCone=X.getValueOrUndefined(t.minimumCone,it.MINIMUM_VALUE),i.maximumCone=X.getValueOrUndefined(t.maximumCone,it.MINIMUM_VALUE),i.stackPartitions=X.getValueOrUndefined(t.stackPartitions,it.MINIMUM_VALUE),i.slicePartitions=X.getValueOrUndefined(t.slicePartitions,it.MINIMUM_VALUE),i.subdivisions=X.getValueOrUndefined(t.subdivisions,it.MINIMUM_VALUE),i.offsetAttribute=n!==We.NONE?pn.ALL:void 0};ff.prototype._onEntityPropertyChanged=ey;ff.DynamicGeometryUpdater=mD;function mD(e,t,n){Oi.call(this,e,t,n),this._scene=e._scene,this._modelMatrix=new M,this._attributes=void 0,this._outlineAttributes=void 0,this._lastSceneMode=void 0,this._lastShow=void 0,this._lastOutlineShow=void 0,this._lastOutlineWidth=void 0,this._lastOutlineColor=void 0,this._lastOffset=new h,this._material={}}l(Object.create)&&(mD.prototype=Object.create(Oi.prototype),mD.prototype.constructor=mD);mD.prototype.update=function(e){let t=this._entity,n=t.ellipsoid;if(!t.isShowing||!t.isAvailable(e)||!X.getValueOrDefault(n.show,e,!0)){l(this._primitive)&&(this._primitive.show=!1),l(this._outlinePrimitive)&&(this._outlinePrimitive.show=!1);return}let i=X.getValueOrUndefined(n.radii,e,XYe),r=l(i)?t.computeModelMatrixForHeightReference(e,n.heightReference,i.z*.5,this._scene.ellipsoid,this._modelMatrix):void 0;if(!l(r)||!l(i)){l(this._primitive)&&(this._primitive.show=!1),l(this._outlinePrimitive)&&(this._outlinePrimitive.show=!1);return}let o=X.getValueOrDefault(n.fill,e,!0),s=X.getValueOrDefault(n.outline,e,!1),a=X.getValueOrClonedDefault(n.outlineColor,e,z.BLACK,QK),c=So.getValue(e,n.material??YYe,this._material),u=X.getValueOrUndefined(n.innerRadii,e,KYe),f=X.getValueOrUndefined(n.minimumClock,e),d=X.getValueOrUndefined(n.maximumClock,e),p=X.getValueOrUndefined(n.minimumCone,e),g=X.getValueOrUndefined(n.maximumCone,e),m=X.getValueOrUndefined(n.stackPartitions,e),y=X.getValueOrUndefined(n.slicePartitions,e),A=X.getValueOrUndefined(n.subdivisions,e),b=X.getValueOrDefault(n.outlineWidth,e,1),x=X.getValueOrDefault(n.heightReference,e,We.NONE),T=x!==We.NONE?pn.ALL:void 0,E=this._scene.mode,v=E===re.SCENE3D&&x===We.NONE,S=this._options,I=this._geometryUpdater.shadowsProperty.getValue(e),O=this._geometryUpdater.distanceDisplayConditionProperty.getValue(e),L=X.getValueOrDefault(this._geometryUpdater.terrainOffsetProperty,e,JK,ZK);if(!v||this._lastSceneMode!==E||!l(this._primitive)||S.stackPartitions!==m||S.slicePartitions!==y||l(u)&&!h.equals(S.innerRadii!==u)||S.minimumClock!==f||S.maximumClock!==d||S.minimumCone!==p||S.maximumCone!==g||S.subdivisions!==A||this._lastOutlineWidth!==b||S.offsetAttribute!==T){let C=this._primitives;C.removeAndDestroy(this._primitive),C.removeAndDestroy(this._outlinePrimitive),this._primitive=void 0,this._outlinePrimitive=void 0,this._lastSceneMode=E,this._lastOutlineWidth=b,S.stackPartitions=m,S.slicePartitions=y,S.subdivisions=A,S.offsetAttribute=T,S.radii=h.clone(v?$Ye:i,S.radii),l(u)?v?S.innerRadii=h.fromElements(u.x/i.x,u.y/i.y,u.z/i.z,S.innerRadii):S.innerRadii=h.clone(u,S.innerRadii):S.innerRadii=void 0,S.minimumClock=f,S.maximumClock=d,S.minimumCone=p,S.maximumCone=g;let w=new Cr({material:c,translucent:c.isTranslucent(),closed:!0});S.vertexFormat=w.vertexFormat;let D=this._geometryUpdater.createFillGeometryInstance(e,v,this._modelMatrix);this._primitive=C.add(new Mn({geometryInstances:D,appearance:w,asynchronous:!1,shadows:I}));let N=this._geometryUpdater.createOutlineGeometryInstance(e,v,this._modelMatrix);this._outlinePrimitive=C.add(new Mn({geometryInstances:N,appearance:new An({flat:!0,translucent:N.attributes.color.value[3]!==255,renderState:{lineWidth:this._geometryUpdater._scene.clampLineWidth(b)}}),asynchronous:!1,shadows:I})),this._lastShow=o,this._lastOutlineShow=s,this._lastOutlineColor=z.clone(a,this._lastOutlineColor),this._lastDistanceDisplayCondition=O,this._lastOffset=h.clone(L,this._lastOffset)}else if(this._primitive.ready){let C=this._primitive,w=this._outlinePrimitive;C.show=!0,w.show=!0,C.appearance.material=c;let D=this._attributes;l(D)||(D=C.getGeometryInstanceAttributes(t),this._attributes=D),o!==this._lastShow&&(D.show=Dn.toValue(o,D.show),this._lastShow=o);let N=this._outlineAttributes;l(N)||(N=w.getGeometryInstanceAttributes(t),this._outlineAttributes=N),s!==this._lastOutlineShow&&(N.show=Dn.toValue(s,N.show),this._lastOutlineShow=s),z.equals(a,this._lastOutlineColor)||(N.color=Jt.toValue(a,N.color),z.clone(a,this._lastOutlineColor)),Gt.equals(O,this._lastDistanceDisplayCondition)||(D.distanceDisplayCondition=ti.toValue(O,D.distanceDisplayCondition),N.distanceDisplayCondition=ti.toValue(O,N.distanceDisplayCondition),Gt.clone(O,this._lastDistanceDisplayCondition)),h.equals(L,this._lastOffset)||(D.offset=Er.toValue(L,D.offset),N.offset=Er.toValue(L,D.offset),h.clone(L,this._lastOffset))}v&&(i.x=Math.max(i.x,.001),i.y=Math.max(i.y,.001),i.z=Math.max(i.z,.001),r=M.multiplyByScale(r,i,r),this._primitive.modelMatrix=r,this._outlinePrimitive.modelMatrix=r)};var L3=ff;function VC(e){e=e??H.EMPTY_OBJECT;let t=e.vertexFormat??Be.DEFAULT;this._vertexFormat=t,this._workerName="createPlaneGeometry"}VC.packedLength=Be.packedLength;VC.pack=function(e,t,n){return n=n??0,Be.pack(e._vertexFormat,t,n),t};var q0e=new Be,ZYe={vertexFormat:q0e};VC.unpack=function(e,t,n){t=t??0;let i=Be.unpack(e,t,q0e);return l(n)?(n._vertexFormat=Be.clone(i,n._vertexFormat),n):new VC(ZYe)};var F3=new h(-.5,-.5,0),B3=new h(.5,.5,0);VC.createGeometry=function(e){let t=e._vertexFormat,n=new En,i,r;if(t.position){if(r=new Float64Array(12),r[0]=F3.x,r[1]=F3.y,r[2]=0,r[3]=B3.x,r[4]=F3.y,r[5]=0,r[6]=B3.x,r[7]=B3.y,r[8]=0,r[9]=F3.x,r[10]=B3.y,r[11]=0,n.position=new Ne({componentDatatype:Y.DOUBLE,componentsPerAttribute:3,values:r}),t.normal){let o=new Float32Array(12);o[0]=0,o[1]=0,o[2]=1,o[3]=0,o[4]=0,o[5]=1,o[6]=0,o[7]=0,o[8]=1,o[9]=0,o[10]=0,o[11]=1,n.normal=new Ne({componentDatatype:Y.FLOAT,componentsPerAttribute:3,values:o})}if(t.st){let o=new Float32Array(8);o[0]=0,o[1]=0,o[2]=1,o[3]=0,o[4]=1,o[5]=1,o[6]=0,o[7]=1,n.st=new Ne({componentDatatype:Y.FLOAT,componentsPerAttribute:2,values:o})}if(t.tangent){let o=new Float32Array(12);o[0]=1,o[1]=0,o[2]=0,o[3]=1,o[4]=0,o[5]=0,o[6]=1,o[7]=0,o[8]=0,o[9]=1,o[10]=0,o[11]=0,n.tangent=new Ne({componentDatatype:Y.FLOAT,componentsPerAttribute:3,values:o})}if(t.bitangent){let o=new Float32Array(12);o[0]=0,o[1]=1,o[2]=0,o[3]=0,o[4]=1,o[5]=0,o[6]=0,o[7]=1,o[8]=0,o[9]=0,o[10]=1,o[11]=0,n.bitangent=new Ne({componentDatatype:Y.FLOAT,componentsPerAttribute:3,values:o})}i=new Uint16Array(6),i[0]=0,i[1]=1,i[2]=2,i[3]=0,i[4]=2,i[5]=3}return new wt({attributes:n,indices:i,primitiveType:Oe.TRIANGLES,boundingSphere:new ue(h.ZERO,Math.sqrt(2))})};var k3=VC;function jC(){this._workerName="createPlaneOutlineGeometry"}jC.packedLength=0;jC.pack=function(e,t){return t};jC.unpack=function(e,t,n){return l(n)?n:new jC};var sy=new h(-.5,-.5,0),U3=new h(.5,.5,0);jC.createGeometry=function(){let e=new En,t=new Uint16Array(8),n=new Float64Array(12);return n[0]=sy.x,n[1]=sy.y,n[2]=sy.z,n[3]=U3.x,n[4]=sy.y,n[5]=sy.z,n[6]=U3.x,n[7]=U3.y,n[8]=sy.z,n[9]=sy.x,n[10]=U3.y,n[11]=sy.z,e.position=new Ne({componentDatatype:Y.DOUBLE,componentsPerAttribute:3,values:n}),t[0]=0,t[1]=1,t[2]=1,t[3]=2,t[4]=2,t[5]=3,t[6]=3,t[7]=0,new wt({attributes:e,indices:t,primitiveType:Oe.LINES,boundingSphere:new ue(h.ZERO,Math.sqrt(2))})};var z3=jC;var QYe=new h,Y0e=new z;function eXe(e){this.id=e,this.vertexFormat=void 0,this.plane=void 0,this.dimensions=void 0}function yd(e,t){Mi.call(this,{entity:e,scene:t,geometryOptions:new eXe(e),geometryPropertyName:"plane",observedPropertyNames:["availability","position","orientation","plane"]}),this._onEntityPropertyChanged(e,"plane",e.plane,void 0)}l(Object.create)&&(yd.prototype=Object.create(Mi.prototype),yd.prototype.constructor=yd);yd.prototype.createFillGeometryInstance=function(e){let t=this._entity,n=t.isAvailable(e),i,r,o=new Dn(n&&t.isShowing&&this._showProperty.getValue(e)&&this._fillProperty.getValue(e)),s=this._distanceDisplayConditionProperty.getValue(e),a=ti.fromDistanceDisplayCondition(s);if(this._materialProperty instanceof Kt){let g;l(this._materialProperty.color)&&(this._materialProperty.color.isConstant||n)&&(g=this._materialProperty.color.getValue(e,Y0e)),l(g)||(g=z.WHITE),r=Jt.fromColor(g),i={show:o,distanceDisplayCondition:a,color:r}}else i={show:o,distanceDisplayCondition:a};let c=t.plane,u=this._options,f=t.computeModelMatrix(e),d=X.getValueOrDefault(c.plane,e,u.plane),p=X.getValueOrUndefined(c.dimensions,e,u.dimensions);return u.plane=d,u.dimensions=p,f=e$(d,p,f,f),new Bt({id:t,geometry:new k3(this._options),modelMatrix:f,attributes:i})};yd.prototype.createOutlineGeometryInstance=function(e){let t=this._entity,n=t.isAvailable(e),i=X.getValueOrDefault(this._outlineColorProperty,e,z.BLACK,Y0e),r=this._distanceDisplayConditionProperty.getValue(e),o=t.plane,s=this._options,a=t.computeModelMatrix(e),c=X.getValueOrDefault(o.plane,e,s.plane),u=X.getValueOrUndefined(o.dimensions,e,s.dimensions);return s.plane=c,s.dimensions=u,a=e$(c,u,a,a),new Bt({id:t,geometry:new z3,modelMatrix:a,attributes:{show:new Dn(n&&t.isShowing&&this._showProperty.getValue(e)&&this._showOutlineProperty.getValue(e)),color:Jt.fromColor(i),distanceDisplayCondition:ti.fromDistanceDisplayCondition(r)}})};yd.prototype._isHidden=function(e,t){return!l(t.plane)||!l(t.dimensions)||!l(e.position)||Mi.prototype._isHidden.call(this,e,t)};yd.prototype._getIsClosed=function(e){return!1};yd.prototype._isDynamic=function(e,t){return!e.position.isConstant||!X.isConstant(e.orientation)||!t.plane.isConstant||!t.dimensions.isConstant||!X.isConstant(t.outlineWidth)};yd.prototype._setStaticOptions=function(e,t){let n=this._materialProperty instanceof Kt,i=this._options;i.vertexFormat=n?An.VERTEX_FORMAT:Cr.MaterialSupport.TEXTURED.vertexFormat,i.plane=t.plane.getValue(it.MINIMUM_VALUE,i.plane),i.dimensions=t.dimensions.getValue(it.MINIMUM_VALUE,i.dimensions)};yd.DynamicGeometryUpdater=HC;function HC(e,t,n){Oi.call(this,e,t,n)}l(Object.create)&&(HC.prototype=Object.create(Oi.prototype),HC.prototype.constructor=HC);HC.prototype._isHidden=function(e,t,n){let i=this._options,r=X.getValueOrUndefined(e.position,n,QYe);return!l(r)||!l(i.plane)||!l(i.dimensions)||Oi.prototype._isHidden.call(this,e,t,n)};HC.prototype._setOptions=function(e,t,n){let i=this._options;i.plane=X.getValueOrDefault(t.plane,n,i.plane),i.dimensions=X.getValueOrUndefined(t.dimensions,n,i.dimensions)};var tXe=new h,nXe=new h,iXe=new h,rXe=new h,oXe=new $,sXe=new $,aXe=new M;function e$(e,t,n,i){let r=e.normal,o=e.distance,s=h.multiplyByScalar(r,-o,iXe),a=h.clone(h.UNIT_Z,nXe);P.equalsEpsilon(Math.abs(h.dot(a,r)),1,P.EPSILON8)&&(a=h.clone(h.UNIT_Y,a));let c=h.cross(a,r,tXe);a=h.cross(r,c,a),h.normalize(c,c),h.normalize(a,a);let u=oXe;$.setColumn(u,0,c,u),$.setColumn(u,1,a,u),$.setColumn(u,2,r,u);let f=h.fromElements(t.x,t.y,1,rXe),d=$.multiplyByScale(u,f,sXe),p=M.fromRotationTranslation(d,s,aXe);return M.multiplyTransformation(n,p,i)}yd.createPrimitiveMatrix=e$;var V3=yd;var pD={},cXe=new h,X0e=new h,K0e=new h,$0e=new h,J0e=new en;pD.validOutline=function(e){let n=en.fromPoints(e,J0e).halfAxes,i=$.getColumn(n,0,X0e),r=$.getColumn(n,1,K0e),o=$.getColumn(n,2,$0e),s=h.magnitude(i),a=h.magnitude(r),c=h.magnitude(o);return!(s===0&&(a===0||c===0)||a===0&&c===0)};pD.computeProjectTo2DArguments=function(e,t,n,i){let r=en.fromPoints(e,J0e),o=r.halfAxes,s=$.getColumn(o,0,X0e),a=$.getColumn(o,1,K0e),c=$.getColumn(o,2,$0e),u=h.magnitude(s),f=h.magnitude(a),d=h.magnitude(c),p=Math.min(u,f,d);if(u===0&&(f===0||d===0)||f===0&&d===0)return!1;let g,m;return(p===f||p===d)&&(g=s),p===u?g=a:p===d&&(m=a),(p===u||p===f)&&(m=c),h.normalize(g,n),h.normalize(m,i),h.clone(r.center,t),!0};function Z0e(e,t,n,i,r){let o=h.subtract(e,t,cXe),s=h.dot(n,o),a=h.dot(i,o);return U.fromElements(s,a,r)}pD.createProjectPointsTo2DFunction=function(e,t,n){return function(i){let r=new Array(i.length);for(let o=0;o<i.length;o++)r[o]=Z0e(i[o],e,t,n);return r}};pD.createProjectPointTo2DFunction=function(e,t,n){return function(i,r){return Z0e(i,e,t,n,r)}};var ay=pD;function cy(){this._array=[],this._offset=0,this._length=0}Object.defineProperties(cy.prototype,{length:{get:function(){return this._length}}});cy.prototype.enqueue=function(e){this._array.push(e),this._length++};cy.prototype.dequeue=function(){if(this._length===0)return;let e=this._array,t=this._offset,n=e[t];return e[t]=void 0,t++,t>10&&t*2>e.length&&(this._array=e.slice(t),t=0),this._offset=t,this._length--,n};cy.prototype.peek=function(){if(this._length!==0)return this._array[this._offset]};cy.prototype.contains=function(e){return this._array.indexOf(e)!==-1};cy.prototype.clear=function(){this._array.length=this._offset=this._length=0};cy.prototype.sort=function(e){this._offset>0&&(this._array=this._array.slice(this._offset),this._offset=0),this._array.sort(e)};var Zb=cy;var wo={};wo.computeHierarchyPackedLength=function(e,t){let n=0,i=[e];for(;i.length>0;){let r=i.pop();if(!l(r))continue;n+=2;let o=r.positions,s=r.holes;if(l(o)&&o.length>0&&(n+=o.length*t.packedLength),l(s)){let a=s.length;for(let c=0;c<a;++c)i.push(s[c])}}return n};wo.packPolygonHierarchy=function(e,t,n,i){let r=[e];for(;r.length>0;){let o=r.pop();if(!l(o))continue;let s=o.positions,a=o.holes;if(t[n++]=l(s)?s.length:0,t[n++]=l(a)?a.length:0,l(s)){let c=s.length;for(let u=0;u<c;++u,n+=i.packedLength)i.pack(s[u],t,n)}if(l(a)){let c=a.length;for(let u=0;u<c;++u)r.push(a[u])}}return n};wo.unpackPolygonHierarchy=function(e,t,n){let i=e[t++],r=e[t++],o=new Array(i),s=r>0?new Array(r):void 0;for(let a=0;a<i;++a,t+=n.packedLength)o[a]=n.unpack(e,t);for(let a=0;a<r;++a)s[a]=wo.unpackPolygonHierarchy(e,t,n),t=s[a].startingIndex,delete s[a].startingIndex;return{positions:o,holes:s,startingIndex:t}};var Qb=new U;function tge(e,t,n,i){return U.subtract(t,e,Qb),U.multiplyByScalar(Qb,n/i,Qb),U.add(e,Qb,Qb),[Qb.x,Qb.y]}var ly=new h;function lXe(e,t,n,i){return h.subtract(t,e,ly),h.multiplyByScalar(ly,n/i,ly),h.add(e,ly,ly),[ly.x,ly.y,ly.z]}wo.subdivideLineCount=function(e,t,n){let r=h.distance(e,t)/n,o=Math.max(0,Math.ceil(P.log2(r)));return Math.pow(2,o)};var H3=new he,G3=new he,uXe=new he,fXe=new h,j3=new Vc;wo.subdivideRhumbLineCount=function(e,t,n,i){let r=e.cartesianToCartographic(t,H3),o=e.cartesianToCartographic(n,G3),a=new Vc(r,o,e).surfaceDistance/i,c=Math.max(0,Math.ceil(P.log2(a)));return Math.pow(2,c)};wo.subdivideTexcoordLine=function(e,t,n,i,r,o){let s=wo.subdivideLineCount(n,i,r),a=U.distance(e,t),c=a/s,u=o;u.length=s*2;let f=0;for(let d=0;d<s;d++){let p=tge(e,t,d*c,a);u[f++]=p[0],u[f++]=p[1]}return u};wo.subdivideLine=function(e,t,n,i){let r=wo.subdivideLineCount(e,t,n),o=h.distance(e,t),s=o/r;l(i)||(i=[]);let a=i;a.length=r*3;let c=0;for(let u=0;u<r;u++){let f=lXe(e,t,u*s,o);a[c++]=f[0],a[c++]=f[1],a[c++]=f[2]}return a};wo.subdivideTexcoordRhumbLine=function(e,t,n,i,r,o,s){let a=n.cartesianToCartographic(i,H3),c=n.cartesianToCartographic(r,G3);j3.setEndPoints(a,c);let u=j3.surfaceDistance/o,f=Math.max(0,Math.ceil(P.log2(u))),d=Math.pow(2,f),p=U.distance(e,t),g=p/d,m=s;m.length=d*2;let y=0;for(let A=0;A<d;A++){let b=tge(e,t,A*g,p);m[y++]=b[0],m[y++]=b[1]}return m};wo.subdivideRhumbLine=function(e,t,n,i,r){let o=e.cartesianToCartographic(t,H3),s=e.cartesianToCartographic(n,G3),a=new Vc(o,s,e);if(l(r)||(r=[]),a.surfaceDistance<=i)return r.length=3,r[0]=t.x,r[1]=t.y,r[2]=t.z,r;let c=a.surfaceDistance/i,u=Math.max(0,Math.ceil(P.log2(c))),f=Math.pow(2,u),d=a.surfaceDistance/f,p=r;p.length=f*3;let g=0;for(let m=0;m<f;m++){let y=a.interpolateUsingSurfaceDistance(m*d,uXe),A=e.cartographicToCartesian(y,fXe);p[g++]=A.x,p[g++]=A.y,p[g++]=A.z}return p};var dXe=new h,hXe=new h,mXe=new h,pXe=new h;wo.scaleToGeodeticHeightExtruded=function(e,t,n,i,r){i=i??ee.default;let o=dXe,s=hXe,a=mXe,c=pXe;if(l(e)&&l(e.attributes)&&l(e.attributes.position)){let u=e.attributes.position.values,f=u.length/2;for(let d=0;d<f;d+=3)h.fromArray(u,d,a),i.geodeticSurfaceNormal(a,o),c=i.scaleToGeodeticSurface(a,c),s=h.multiplyByScalar(o,n,s),s=h.add(c,s,s),u[d+f]=s.x,u[d+1+f]=s.y,u[d+2+f]=s.z,r&&(c=h.clone(a,c)),s=h.multiplyByScalar(o,t,s),s=h.add(c,s,s),u[d]=s.x,u[d+1]=s.y,u[d+2]=s.z}return e};wo.polygonOutlinesFromHierarchy=function(e,t,n){let i=[],r=new Zb;r.enqueue(e);let o,s,a;for(;r.length!==0;){let c=r.dequeue(),u=c.positions;if(t)for(a=u.length,o=0;o<a;o++)n.scaleToGeodeticSurface(u[o],u[o]);if(u=Lr(u,h.equalsEpsilon,!0),u.length<3)continue;let f=c.holes?c.holes.length:0;for(o=0;o<f;o++){let d=c.holes[o],p=d.positions;if(t)for(a=p.length,s=0;s<a;++s)n.scaleToGeodeticSurface(p[s],p[s]);if(p=Lr(p,h.equalsEpsilon,!0),p.length<3)continue;i.push(p);let g=0;for(l(d.holes)&&(g=d.holes.length),s=0;s<g;s++)r.enqueue(d.holes[s])}i.push(u)}return i};var gXe=new he;function _Xe(e,t,n){let i=n.cartesianToCartographic(e,H3),r=n.cartesianToCartographic(t,G3);if(Math.sign(i.latitude)===Math.sign(r.latitude))return;j3.setEndPoints(i,r);let o=j3.findIntersectionWithLatitude(0,gXe);if(!l(o))return;let s=Math.min(i.longitude,r.longitude),a=Math.max(i.longitude,r.longitude);if(Math.abs(a-s)>P.PI){let c=s;s=a,a=c}if(!(o.longitude<s||o.longitude>a))return n.cartographicToCartesian(o)}function yXe(e,t,n,i){if(i===ln.RHUMB)return _Xe(e,t,n);let r=xi.lineSegmentPlane(e,t,sn.ORIGIN_XY_PLANE);if(l(r))return n.scaleToGeodeticSurface(r,r)}var AXe=new he;function bXe(e,t,n){let i=[],r,o,s,a,c,u=0;for(;u<e.length;){r=e[u],o=e[(u+1)%e.length],s=P.sign(r.z),a=P.sign(o.z);let f=d=>t.cartesianToCartographic(d,AXe).longitude;if(s===0)i.push({position:u,type:s,visited:!1,next:a,theta:f(r)});else if(a!==0){if(c=yXe(r,o,t,n),++u,!l(c))continue;e.splice(u,0,c),i.push({position:u,type:s,visited:!1,next:a,theta:f(c)})}++u}return i}function nge(e,t,n,i,r,o,s){let a=[],c=o,u=d=>p=>p.position===d,f=[];do{let d=n[c];a.push(d);let p=i.findIndex(u(c)),g=i[p];if(!l(g)){++c;continue}let{visited:m,type:y,next:A}=g;if(g.visited=!0,y===0){if(A===0){let E=i[p-(s?1:-1)];if(E?.position===c+1)E.visited=!0;else{++c;continue}}if(!m&&s&&A>0||o===c&&!s&&A<0){++c;continue}}if(!(s?y>=0:y<=0)){++c;continue}m||f.push(c);let x=p+(s?1:-1),T=i[x];if(!l(T)){++c;continue}c=T.position}while(c<n.length&&c>=0&&c!==o&&a.length<n.length);e.splice(t,r,a);for(let d of f)t=nge(e,t+1,n,i,0,d,!s);return t}wo.splitPolygonsOnEquator=function(e,t,n,i){l(i)||(i=[]),i.splice(0,0,...e),i.length=e.length;let r=0;for(;r<i.length;){let o=i[r],s=o.slice();if(o.length<3){i[r]=s,++r;continue}let a=bXe(s,t,n);if(s.length===o.length||a.length<=1){i[r]=s,++r;continue}a.sort((u,f)=>u.theta-f.theta);let c=s[0].z>=0;r=nge(i,r,s,a,1,0,c)}return i};wo.polygonsFromHierarchy=function(e,t,n,i,r,o){let s=[],a=[],c=new Zb;c.enqueue(e);let u=l(o);for(;c.length!==0;){let f=c.dequeue(),d=f.positions,p=f.holes,g,m;if(i)for(m=d.length,g=0;g<m;g++)r.scaleToGeodeticSurface(d[g],d[g]);if(t||(d=Lr(d,h.equalsEpsilon,!0)),d.length<3)continue;let y=n(d);if(!l(y))continue;let A=[],b=mi.computeWindingOrder2D(y);if(b===sa.CLOCKWISE&&(y.reverse(),d=d.slice().reverse()),u){u=!1;let S=[d];if(S=o(S,S),S.length>1){for(let I of S)c.enqueue(new Wc(I,p));continue}}let x=d.slice(),T=l(p)?p.length:0,E=[],v;for(g=0;g<T;g++){let S=p[g],I=S.positions;if(i)for(m=I.length,v=0;v<m;++v)r.scaleToGeodeticSurface(I[v],I[v]);if(t||(I=Lr(I,h.equalsEpsilon,!0)),I.length<3)continue;let R=n(I);if(!l(R))continue;b=mi.computeWindingOrder2D(R),b===sa.CLOCKWISE&&(R.reverse(),I=I.slice().reverse()),E.push(I),A.push(x.length),x=x.concat(I),y=y.concat(R);let O=0;for(l(S.holes)&&(O=S.holes.length),v=0;v<O;v++)c.enqueue(S.holes[v])}s.push({outerRing:d,holes:E}),a.push({positions:x,positions2D:y,holes:A})}return{hierarchy:s,polygons:a}};var xXe=new U,TXe=new h,EXe=new Le,CXe=new $;wo.computeBoundingRectangle=function(e,t,n,i,r){let o=Le.fromAxisAngle(e,i,EXe),s=$.fromQuaternion(o,CXe),a=Number.POSITIVE_INFINITY,c=Number.NEGATIVE_INFINITY,u=Number.POSITIVE_INFINITY,f=Number.NEGATIVE_INFINITY,d=n.length;for(let p=0;p<d;++p){let g=h.clone(n[p],TXe);$.multiplyByVector(s,g,g);let m=t(g,xXe);l(m)&&(a=Math.min(a,m.x),c=Math.max(c,m.x),u=Math.min(u,m.y),f=Math.max(f,m.y))}return r.x=a,r.y=u,r.width=c-a,r.height=f-u,r};wo.createGeometryFromPositions=function(e,t,n,i,r,o,s){let a=mi.triangulate(t.positions2D,t.holes);a.length<3&&(a=[0,1,2]);let c=t.positions,u=l(n),f=u?n.positions:void 0;if(r){let d=c.length,p=new Array(d*3),g=0;for(let A=0;A<d;A++){let b=c[A];p[g++]=b.x,p[g++]=b.y,p[g++]=b.z}let m={attributes:{position:new Ne({componentDatatype:Y.DOUBLE,componentsPerAttribute:3,values:p})},indices:a,primitiveType:Oe.TRIANGLES};u&&(m.attributes.st=new Ne({componentDatatype:Y.FLOAT,componentsPerAttribute:2,values:U.packArray(f)}));let y=new wt(m);return o.normal?Wn.computeNormal(y):y}if(s===ln.GEODESIC)return mi.computeSubdivision(e,c,a,f,i);if(s===ln.RHUMB)return mi.computeRhumbLineSubdivision(e,c,a,f,i)};var Q0e=[],ege=[],vXe=new h,SXe=new h;wo.computeWallGeometry=function(e,t,n,i,r,o){let s,a,c,u,f,d,p,g,m,y=e.length,A=0,b=0,x=l(t),T=x?t.positions:void 0;if(r)for(a=y*3*2,s=new Array(a*2),x&&(m=y*2*2,g=new Array(m*2)),c=0;c<y;c++)u=e[c],f=e[(c+1)%y],s[A]=s[A+a]=u.x,++A,s[A]=s[A+a]=u.y,++A,s[A]=s[A+a]=u.z,++A,s[A]=s[A+a]=f.x,++A,s[A]=s[A+a]=f.y,++A,s[A]=s[A+a]=f.z,++A,x&&(d=T[c],p=T[(c+1)%y],g[b]=g[b+m]=d.x,++b,g[b]=g[b+m]=d.y,++b,g[b]=g[b+m]=p.x,++b,g[b]=g[b+m]=p.y,++b);else{let R=P.chordLength(i,n.maximumRadius),O=0;if(o===ln.GEODESIC)for(c=0;c<y;c++)O+=wo.subdivideLineCount(e[c],e[(c+1)%y],R);else if(o===ln.RHUMB)for(c=0;c<y;c++)O+=wo.subdivideRhumbLineCount(n,e[c],e[(c+1)%y],R);for(a=(O+y)*3,s=new Array(a*2),x&&(m=(O+y)*2,g=new Array(m*2)),c=0;c<y;c++){u=e[c],f=e[(c+1)%y];let L,_;x&&(d=T[c],p=T[(c+1)%y]),o===ln.GEODESIC?(L=wo.subdivideLine(u,f,R,ege),x&&(_=wo.subdivideTexcoordLine(d,p,u,f,R,Q0e))):o===ln.RHUMB&&(L=wo.subdivideRhumbLine(n,u,f,R,ege),x&&(_=wo.subdivideTexcoordRhumbLine(d,p,n,u,f,R,Q0e)));let C=L.length;for(let w=0;w<C;++w,++A)s[A]=L[w],s[A+a]=L[w];if(s[A]=f.x,s[A+a]=f.x,++A,s[A]=f.y,s[A+a]=f.y,++A,s[A]=f.z,s[A+a]=f.z,++A,x){let w=_.length;for(let D=0;D<w;++D,++b)g[b]=_[D],g[b+m]=_[D];g[b]=p.x,g[b+m]=p.x,++b,g[b]=p.y,g[b+m]=p.y,++b}}}y=s.length;let E=je.createTypedArray(y/3,y-e.length*6),v=0;for(y/=6,c=0;c<y;c++){let R=c,O=R+1,L=R+y,_=L+1;u=h.fromArray(s,R*3,vXe),f=h.fromArray(s,O*3,SXe),!h.equalsEpsilon(u,f,P.EPSILON10,P.EPSILON10)&&(E[v++]=R,E[v++]=L,E[v++]=O,E[v++]=O,E[v++]=L,E[v++]=_)}let S={attributes:new En({position:new Ne({componentDatatype:Y.DOUBLE,componentsPerAttribute:3,values:s})}),indices:E,primitiveType:Oe.TRIANGLES};return x&&(S.attributes.st=new Ne({componentDatatype:Y.FLOAT,componentsPerAttribute:2,values:g})),new wt(S)};var ni=wo;var wXe=new h,IXe=new et,PXe=new U,DXe=new U,RXe=new h,OXe=new h,MXe=new h,gD=new h,NXe=new h,LXe=new h,ige=new Le,FXe=new $,BXe=new $,kXe=new h;function UXe(e,t,n,i,r,o,s,a,c){let u=e.positions,f=mi.triangulate(e.positions2D,e.holes);f.length<3&&(f=[0,1,2]);let d=je.createTypedArray(u.length,f.length);d.set(f);let p=FXe;if(i!==0){let _=Le.fromAxisAngle(s,i,ige);if(p=$.fromQuaternion(_,p),t.tangent||t.bitangent){_=Le.fromAxisAngle(s,-i,ige);let C=$.fromQuaternion(_,BXe);a=h.normalize($.multiplyByVector(C,a,a),a),t.bitangent&&(c=h.normalize(h.cross(s,a,c),c))}}else p=$.clone($.IDENTITY,p);let g=DXe;t.st&&(g.x=n.x,g.y=n.y);let m=u.length,y=m*3,A=new Float64Array(y),b=t.normal?new Float32Array(y):void 0,x=t.tangent?new Float32Array(y):void 0,T=t.bitangent?new Float32Array(y):void 0,E=t.st?new Float32Array(m*2):void 0,v=0,S=0,I=0,R=0,O=0;for(let _=0;_<m;_++){let C=u[_];if(A[v++]=C.x,A[v++]=C.y,A[v++]=C.z,t.st)if(l(r)&&r.positions.length===m)E[O++]=r.positions[_].x,E[O++]=r.positions[_].y;else{let w=$.multiplyByVector(p,C,wXe),D=o(w,PXe);U.subtract(D,g,D);let N=P.clamp(D.x/n.width,0,1),F=P.clamp(D.y/n.height,0,1);E[O++]=N,E[O++]=F}t.normal&&(b[S++]=s.x,b[S++]=s.y,b[S++]=s.z),t.tangent&&(x[R++]=a.x,x[R++]=a.y,x[R++]=a.z),t.bitangent&&(T[I++]=c.x,T[I++]=c.y,T[I++]=c.z)}let L=new En;return t.position&&(L.position=new Ne({componentDatatype:Y.DOUBLE,componentsPerAttribute:3,values:A})),t.normal&&(L.normal=new Ne({componentDatatype:Y.FLOAT,componentsPerAttribute:3,values:b})),t.tangent&&(L.tangent=new Ne({componentDatatype:Y.FLOAT,componentsPerAttribute:3,values:x})),t.bitangent&&(L.bitangent=new Ne({componentDatatype:Y.FLOAT,componentsPerAttribute:3,values:T})),t.st&&(L.st=new Ne({componentDatatype:Y.FLOAT,componentsPerAttribute:2,values:E})),new wt({attributes:L,indices:d,primitiveType:Oe.TRIANGLES})}function ex(e){e=e??H.EMPTY_OBJECT;let t=e.polygonHierarchy,n=e.textureCoordinates,i=e.vertexFormat??Be.DEFAULT;this._vertexFormat=Be.clone(i),this._polygonHierarchy=t,this._stRotation=e.stRotation??0,this._ellipsoid=ee.clone(e.ellipsoid??ee.default),this._workerName="createCoplanarPolygonGeometry",this._textureCoordinates=n,this.packedLength=ni.computeHierarchyPackedLength(t,h)+Be.packedLength+ee.packedLength+(l(n)?ni.computeHierarchyPackedLength(n,U):1)+2}ex.fromPositions=function(e){e=e??H.EMPTY_OBJECT;let t={polygonHierarchy:{positions:e.positions},vertexFormat:e.vertexFormat,stRotation:e.stRotation,ellipsoid:e.ellipsoid,textureCoordinates:e.textureCoordinates};return new ex(t)};ex.pack=function(e,t,n){return n=n??0,n=ni.packPolygonHierarchy(e._polygonHierarchy,t,n,h),ee.pack(e._ellipsoid,t,n),n+=ee.packedLength,Be.pack(e._vertexFormat,t,n),n+=Be.packedLength,t[n++]=e._stRotation,l(e._textureCoordinates)?n=ni.packPolygonHierarchy(e._textureCoordinates,t,n,U):t[n++]=-1,t[n]=e.packedLength,t};var zXe=ee.clone(ee.UNIT_SPHERE),VXe=new Be,jXe={polygonHierarchy:{}};ex.unpack=function(e,t,n){t=t??0;let i=ni.unpackPolygonHierarchy(e,t,h);t=i.startingIndex,delete i.startingIndex;let r=ee.unpack(e,t,zXe);t+=ee.packedLength;let o=Be.unpack(e,t,VXe);t+=Be.packedLength;let s=e[t++],a=e[t]===-1?void 0:ni.unpackPolygonHierarchy(e,t,U);l(a)?(t=a.startingIndex,delete a.startingIndex):t++;let c=e[t];return l(n)||(n=new ex(jXe)),n._polygonHierarchy=i,n._ellipsoid=ee.clone(r,n._ellipsoid),n._vertexFormat=Be.clone(o,n._vertexFormat),n._stRotation=s,n._textureCoordinates=a,n.packedLength=c,n};ex.createGeometry=function(e){let t=e._vertexFormat,n=e._polygonHierarchy,i=e._stRotation,r=e._textureCoordinates,o=l(r),s=n.positions;if(s=Lr(s,h.equalsEpsilon,!0),s.length<3)return;let a=RXe,c=OXe,u=MXe,f=NXe,d=LXe;if(!ay.computeProjectTo2DArguments(s,gD,f,d))return;if(a=h.cross(f,d,a),a=h.normalize(a,a),!h.equalsEpsilon(gD,h.ZERO,P.EPSILON6)){let O=e._ellipsoid.geodeticSurfaceNormal(gD,kXe);h.dot(a,O)<0&&(a=h.negate(a,a),f=h.negate(f,f))}let g=ay.createProjectPointsTo2DFunction(gD,f,d),m=ay.createProjectPointTo2DFunction(gD,f,d);t.tangent&&(c=h.clone(f,c)),t.bitangent&&(u=h.clone(d,u));let y=ni.polygonsFromHierarchy(n,o,g,!1),A=y.hierarchy,b=y.polygons,x=function(O){return O},T=o?ni.polygonsFromHierarchy(r,!0,x,!1).polygons:void 0;if(A.length===0)return;s=A[0].outerRing;let E=ue.fromPoints(s),v=ni.computeBoundingRectangle(a,m,s,i,IXe),S=[];for(let O=0;O<b.length;O++){let L=new Bt({geometry:UXe(b[O],t,v,i,o?T[O]:void 0,m,a,c,u)});S.push(L)}let I=Wn.combineInstances(S)[0];I.attributes.position.values=new Float64Array(I.attributes.position.values),I.indices=je.createTypedArray(I.attributes.position.values.length/3,I.indices);let R=I.attributes;return t.position||delete R.position,new wt({attributes:R,indices:I.indices,primitiveType:I.primitiveType,boundingSphere:E})};var W3=ex;function HXe(e){let t=e.length,n=new Float64Array(t*3),i=je.createTypedArray(t,t*2),r=0,o=0;for(let a=0;a<t;a++){let c=e[a];n[r++]=c.x,n[r++]=c.y,n[r++]=c.z,i[o++]=a,i[o++]=(a+1)%t}let s=new En({position:new Ne({componentDatatype:Y.DOUBLE,componentsPerAttribute:3,values:n})});return new wt({attributes:s,indices:i,primitiveType:Oe.LINES})}function tx(e){e=e??H.EMPTY_OBJECT;let t=e.polygonHierarchy;this._polygonHierarchy=t,this._workerName="createCoplanarPolygonOutlineGeometry",this.packedLength=ni.computeHierarchyPackedLength(t,h)+1}tx.fromPositions=function(e){e=e??H.EMPTY_OBJECT;let t={polygonHierarchy:{positions:e.positions}};return new tx(t)};tx.pack=function(e,t,n){return n=n??0,n=ni.packPolygonHierarchy(e._polygonHierarchy,t,n,h),t[n]=e.packedLength,t};var GXe={polygonHierarchy:{}};tx.unpack=function(e,t,n){t=t??0;let i=ni.unpackPolygonHierarchy(e,t,h);t=i.startingIndex,delete i.startingIndex;let r=e[t];return l(n)||(n=new tx(GXe)),n._polygonHierarchy=i,n.packedLength=r,n};tx.createGeometry=function(e){let t=e._polygonHierarchy,n=t.positions;if(n=Lr(n,h.equalsEpsilon,!0),n.length<3||!ay.validOutline(n))return;let r=ni.polygonOutlinesFromHierarchy(t,!1);if(r.length===0)return;let o=[];for(let c=0;c<r.length;c++){let u=new Bt({geometry:HXe(r[c])});o.push(u)}let s=Wn.combineInstances(o)[0],a=ue.fromPoints(t.positions);return new wt({attributes:s.attributes,indices:s.indices,primitiveType:s.primitiveType,boundingSphere:a})};var Ph=tx;function hs(e,t){this.position=e,l(this.position)||(this.position=new U),this.tangentPlane=t,l(this.tangentPlane)||(this.tangentPlane=hs.NORTH_POLE_TANGENT_PLANE)}Object.defineProperties(hs.prototype,{ellipsoid:{get:function(){return this.tangentPlane.ellipsoid}},x:{get:function(){return this.position.x}},y:{get:function(){return this.position.y}},conformalLatitude:{get:function(){let e=U.magnitude(this.position),t=2*this.ellipsoid.maximumRadius;return this.tangentPlane.plane.normal.z*(P.PI_OVER_TWO-2*Math.atan2(e,t))}},longitude:{get:function(){let e=P.PI_OVER_TWO+Math.atan2(this.y,this.x);return e>Math.PI&&(e-=P.TWO_PI),e}}});var GC=new he,WXe=new h;hs.prototype.getLatitude=function(e){l(e)||(e=ee.default),GC.latitude=this.conformalLatitude,GC.longitude=this.longitude,GC.height=0;let t=this.ellipsoid.cartographicToCartesian(GC,WXe);return e.cartesianToCartographic(t,GC),GC.latitude};var qXe=new gn,YXe=new h,XXe=new h;hs.fromCartesian=function(e,t){let n=P.signNotZero(e.z),i=hs.NORTH_POLE_TANGENT_PLANE,r=hs.SOUTH_POLE;n<0&&(i=hs.SOUTH_POLE_TANGENT_PLANE,r=hs.NORTH_POLE);let o=qXe;o.origin=i.ellipsoid.scaleToGeocentricSurface(e,o.origin),o.direction=h.subtract(o.origin,r,YXe),h.normalize(o.direction,o.direction);let s=xi.rayPlane(o,i.plane,XXe),a=h.subtract(s,r,s),c=h.dot(i.xAxis,a),u=n*h.dot(i.yAxis,a);return l(t)?(t.position=new U(c,u),t.tangentPlane=i,t):new hs(new U(c,u),i)};hs.fromCartesianArray=function(e,t){let n=e.length;l(t)?t.length=n:t=new Array(n);for(let i=0;i<n;i++)t[i]=hs.fromCartesian(e[i],t[i]);return t};hs.clone=function(e,t){if(l(e))return l(t)?(t.position=e.position,t.tangentPlane=e.tangentPlane,t):new hs(e.position,e.tangentPlane)};hs.HALF_UNIT_SPHERE=Object.freeze(new ee(.5,.5,.5));hs.NORTH_POLE=Object.freeze(new h(0,0,.5));hs.SOUTH_POLE=Object.freeze(new h(0,0,-.5));hs.NORTH_POLE_TANGENT_PLANE=Object.freeze(new Ys(hs.NORTH_POLE,hs.HALF_UNIT_SPHERE));hs.SOUTH_POLE_TANGENT_PLANE=Object.freeze(new Ys(hs.SOUTH_POLE,hs.HALF_UNIT_SPHERE));var kl=hs;var KXe=new he,rge=new he;function $Xe(e,t,n,i){let o=i.cartesianToCartographic(e,KXe).height,s=i.cartesianToCartographic(t,rge);s.height=o,i.cartographicToCartesian(s,t);let a=i.cartesianToCartographic(n,rge);a.height=o-100,i.cartographicToCartesian(a,n)}var oge=new et,JXe=new h,ZXe=new h,QXe=new h,eKe=new h,tKe=new h,nKe=new h,q3=new h,hp=new h,WC=new h,iKe=new U,rKe=new U,oKe=new h,sge=new Le,sKe=new $,aKe=new $;function t$(e){let t=e.vertexFormat,n=e.geometry,i=e.shadowVolume,r=n.attributes.position.values,o=l(n.attributes.st)?n.attributes.st.values:void 0,s=r.length,a=e.wall,c=e.top||a,u=e.bottom||a;if(t.st||t.normal||t.tangent||t.bitangent||i){let f=e.boundingRectangle,d=e.rotationAxis,p=e.projectTo2d,g=e.ellipsoid,m=e.stRotation,y=e.perPositionHeight,A=iKe;A.x=f.x,A.y=f.y;let b=t.st?new Float32Array(2*(s/3)):void 0,x;t.normal&&(y&&c&&!a?x=n.attributes.normal.values:x=new Float32Array(s));let T=t.tangent?new Float32Array(s):void 0,E=t.bitangent?new Float32Array(s):void 0,v=i?new Float32Array(s):void 0,S=0,I=0,R=ZXe,O=QXe,L=eKe,_=!0,C=sKe,w=aKe;if(m!==0){let F=Le.fromAxisAngle(d,m,sge);C=$.fromQuaternion(F,C),F=Le.fromAxisAngle(d,-m,sge),w=$.fromQuaternion(F,w)}else C=$.clone($.IDENTITY,C),w=$.clone($.IDENTITY,w);let D=0,N=0;c&&u&&(D=s/2,N=s/3,s/=2);for(let F=0;F<s;F+=3){let V=h.fromArray(r,F,oKe);if(t.st&&!l(o)){let B=$.multiplyByVector(C,V,JXe);B=g.scaleToGeodeticSurface(B,B);let j=p([B],rKe)[0];U.subtract(j,A,j);let k=P.clamp(j.x/f.width,0,1),G=P.clamp(j.y/f.height,0,1);u&&(b[S+N]=k,b[S+1+N]=G),c&&(b[S]=k,b[S+1]=G),S+=2}if(t.normal||t.tangent||t.bitangent||i){let B=I+1,j=I+2;if(a){if(F+3<s){let k=h.fromArray(r,F+3,tKe);if(_){let G=h.fromArray(r,F+s,nKe);y&&$Xe(V,k,G,g),h.subtract(k,V,k),h.subtract(G,V,G),R=h.normalize(h.cross(G,k,R),R),_=!1}h.equalsEpsilon(k,V,P.EPSILON10)&&(_=!0)}(t.tangent||t.bitangent)&&(L=g.geodeticSurfaceNormal(V,L),t.tangent&&(O=h.normalize(h.cross(L,R,O),O)))}else R=g.geodeticSurfaceNormal(V,R),(t.tangent||t.bitangent)&&(y&&(q3=h.fromArray(x,I,q3),hp=h.cross(h.UNIT_Z,q3,hp),hp=h.normalize($.multiplyByVector(w,hp,hp),hp),t.bitangent&&(WC=h.normalize(h.cross(q3,hp,WC),WC))),O=h.cross(h.UNIT_Z,R,O),O=h.normalize($.multiplyByVector(w,O,O),O),t.bitangent&&(L=h.normalize(h.cross(R,O,L),L)));t.normal&&(e.wall?(x[I+D]=R.x,x[B+D]=R.y,x[j+D]=R.z):u&&(x[I+D]=-R.x,x[B+D]=-R.y,x[j+D]=-R.z),(c&&!y||a)&&(x[I]=R.x,x[B]=R.y,x[j]=R.z)),i&&(a&&(R=g.geodeticSurfaceNormal(V,R)),v[I+D]=-R.x,v[B+D]=-R.y,v[j+D]=-R.z),t.tangent&&(e.wall?(T[I+D]=O.x,T[B+D]=O.y,T[j+D]=O.z):u&&(T[I+D]=-O.x,T[B+D]=-O.y,T[j+D]=-O.z),c&&(y?(T[I]=hp.x,T[B]=hp.y,T[j]=hp.z):(T[I]=O.x,T[B]=O.y,T[j]=O.z))),t.bitangent&&(u&&(E[I+D]=L.x,E[B+D]=L.y,E[j+D]=L.z),c&&(y?(E[I]=WC.x,E[B]=WC.y,E[j]=WC.z):(E[I]=L.x,E[B]=L.y,E[j]=L.z))),I+=3}}t.st&&!l(o)&&(n.attributes.st=new Ne({componentDatatype:Y.FLOAT,componentsPerAttribute:2,values:b})),t.normal&&(n.attributes.normal=new Ne({componentDatatype:Y.FLOAT,componentsPerAttribute:3,values:x})),t.tangent&&(n.attributes.tangent=new Ne({componentDatatype:Y.FLOAT,componentsPerAttribute:3,values:T})),t.bitangent&&(n.attributes.bitangent=new Ne({componentDatatype:Y.FLOAT,componentsPerAttribute:3,values:E})),i&&(n.attributes.extrudeDirection=new Ne({componentDatatype:Y.FLOAT,componentsPerAttribute:3,values:v}))}if(e.extrude&&l(e.offsetAttribute)){let f=r.length/3,d=new Uint8Array(f);if(e.offsetAttribute===pn.TOP)c&&u||a?d=d.fill(1,0,f/2):c&&(d=d.fill(1));else{let p=e.offsetAttribute===pn.NONE?0:1;d=d.fill(p)}n.attributes.applyOffset=new Ne({componentDatatype:Y.UNSIGNED_BYTE,componentsPerAttribute:1,values:d})}return n}var age=[];function cKe(e,t,n,i,r,o,s,a,c,u){let f={walls:[]},d;if(s||a){let x=ni.createGeometryFromPositions(e,t,n,i,o,c,u),T=x.attributes.position.values,E=x.indices,v,S;if(s&&a){let I=T.concat(T);v=I.length/3,S=je.createTypedArray(v,E.length*2),S.set(E);let R=E.length,O=v/2;for(d=0;d<R;d+=3){let L=S[d]+O,_=S[d+1]+O,C=S[d+2]+O;S[d+R]=C,S[d+1+R]=_,S[d+2+R]=L}if(x.attributes.position.values=I,o&&c.normal){let L=x.attributes.normal.values;x.attributes.normal.values=new Float32Array(I.length),x.attributes.normal.values.set(L)}if(c.st&&l(n)){let L=x.attributes.st.values;x.attributes.st.values=new Float32Array(v*2),x.attributes.st.values=L.concat(L)}x.indices=S}else if(a){for(v=T.length/3,S=je.createTypedArray(v,E.length),d=0;d<E.length;d+=3)S[d]=E[d+2],S[d+1]=E[d+1],S[d+2]=E[d];x.indices=S}f.topAndBottom=new Bt({geometry:x})}let p=r.outerRing,g=Ys.fromPoints(p,e),m=g.projectPointsOntoPlane(p,age),y=mi.computeWindingOrder2D(m);y===sa.CLOCKWISE&&(p=p.slice().reverse());let A=ni.computeWallGeometry(p,n,e,i,o,u);f.walls.push(new Bt({geometry:A}));let b=r.holes;for(d=0;d<b.length;d++){let x=b[d];m=g.projectPointsOntoPlane(x,age),y=mi.computeWindingOrder2D(m),y===sa.COUNTER_CLOCKWISE&&(x=x.slice().reverse()),A=ni.computeWallGeometry(x,n,e,i,o,u),f.walls.push(new Bt({geometry:A}))}return f}function bd(e){let t=e.polygonHierarchy,n=e.vertexFormat??Be.DEFAULT,i=e.ellipsoid??ee.default,r=e.granularity??P.RADIANS_PER_DEGREE,o=e.stRotation??0,s=e.textureCoordinates,a=e.perPositionHeight??!1,c=a&&l(e.extrudedHeight),u=e.height??0,f=e.extrudedHeight??u;if(!c){let d=Math.max(u,f);f=Math.min(u,f),u=d}this._vertexFormat=Be.clone(n),this._ellipsoid=ee.clone(i),this._granularity=r,this._stRotation=o,this._height=u,this._extrudedHeight=f,this._closeTop=e.closeTop??!0,this._closeBottom=e.closeBottom??!0,this._polygonHierarchy=t,this._perPositionHeight=a,this._perPositionHeightExtrude=c,this._shadowVolume=e.shadowVolume??!1,this._workerName="createPolygonGeometry",this._offsetAttribute=e.offsetAttribute,this._arcType=e.arcType??ln.GEODESIC,this._rectangle=void 0,this._textureCoordinateRotationPoints=void 0,this._textureCoordinates=s,this.packedLength=ni.computeHierarchyPackedLength(t,h)+ee.packedLength+Be.packedLength+(s?ni.computeHierarchyPackedLength(s,U):1)+12}bd.fromPositions=function(e){e=e??H.EMPTY_OBJECT;let t={polygonHierarchy:{positions:e.positions},height:e.height,extrudedHeight:e.extrudedHeight,vertexFormat:e.vertexFormat,stRotation:e.stRotation,ellipsoid:e.ellipsoid,granularity:e.granularity,perPositionHeight:e.perPositionHeight,closeTop:e.closeTop,closeBottom:e.closeBottom,offsetAttribute:e.offsetAttribute,arcType:e.arcType,textureCoordinates:e.textureCoordinates};return new bd(t)};bd.pack=function(e,t,n){return n=n??0,n=ni.packPolygonHierarchy(e._polygonHierarchy,t,n,h),ee.pack(e._ellipsoid,t,n),n+=ee.packedLength,Be.pack(e._vertexFormat,t,n),n+=Be.packedLength,t[n++]=e._height,t[n++]=e._extrudedHeight,t[n++]=e._granularity,t[n++]=e._stRotation,t[n++]=e._perPositionHeightExtrude?1:0,t[n++]=e._perPositionHeight?1:0,t[n++]=e._closeTop?1:0,t[n++]=e._closeBottom?1:0,t[n++]=e._shadowVolume?1:0,t[n++]=e._offsetAttribute??-1,t[n++]=e._arcType,l(e._textureCoordinates)?n=ni.packPolygonHierarchy(e._textureCoordinates,t,n,U):t[n++]=-1,t[n]=e.packedLength,t};var lKe=ee.clone(ee.UNIT_SPHERE),uKe=new Be,fKe={polygonHierarchy:{}};bd.unpack=function(e,t,n){t=t??0;let i=ni.unpackPolygonHierarchy(e,t,h);t=i.startingIndex,delete i.startingIndex;let r=ee.unpack(e,t,lKe);t+=ee.packedLength;let o=Be.unpack(e,t,uKe);t+=Be.packedLength;let s=e[t++],a=e[t++],c=e[t++],u=e[t++],f=e[t++]===1,d=e[t++]===1,p=e[t++]===1,g=e[t++]===1,m=e[t++]===1,y=e[t++],A=e[t++],b=e[t]===-1?void 0:ni.unpackPolygonHierarchy(e,t,U);l(b)?(t=b.startingIndex,delete b.startingIndex):t++;let x=e[t];return l(n)||(n=new bd(fKe)),n._polygonHierarchy=i,n._ellipsoid=ee.clone(r,n._ellipsoid),n._vertexFormat=Be.clone(o,n._vertexFormat),n._height=s,n._extrudedHeight=a,n._granularity=c,n._stRotation=u,n._perPositionHeightExtrude=f,n._perPositionHeight=d,n._closeTop=p,n._closeBottom=g,n._shadowVolume=m,n._offsetAttribute=y===-1?void 0:y,n._arcType=A,n._textureCoordinates=b,n.packedLength=x,n};var dKe=new U,hKe=new U,mKe=new kl;function cge(e,t,n,i,r,o){let s=e.longitude,a=s>=0?s:s+P.TWO_PI;r.westOverIdl=Math.min(r.westOverIdl,a),r.eastOverIdl=Math.max(r.eastOverIdl,a),o.west=Math.min(o.west,s),o.east=Math.max(o.east,s);let c=e.getLatitude(n),u=c;if(o.south=Math.min(o.south,c),o.north=Math.max(o.north,c),i!==ln.RHUMB){let p=U.subtract(t.position,e.position,dKe),g=U.dot(t.position,p)/U.dot(p,p);if(g>0&&g<1){let m=U.add(t.position,U.multiplyByScalar(p,-g,p),hKe),y=kl.clone(t,mKe);y.position=m;let A=y.getLatitude(n);o.south=Math.min(o.south,A),o.north=Math.max(o.north,A),Math.abs(c)>Math.abs(A)&&(u=A)}}let f=t.x*e.y-e.x*t.y,d=Math.sign(f);d!==0&&(d*=U.angleBetween(t.position,e.position)),u>=0&&(r.northAngle+=d),u<=0&&(r.southAngle+=d)}var lge=new kl,pKe=new kl,Ad={northAngle:0,southAngle:0,westOverIdl:0,eastOverIdl:0};bd.computeRectangleFromPositions=function(e,t,n,i){if(l(i)||(i=new ie),e.length<3)return i;i.west=Number.POSITIVE_INFINITY,i.east=Number.NEGATIVE_INFINITY,i.south=Number.POSITIVE_INFINITY,i.north=Number.NEGATIVE_INFINITY,Ad.northAngle=0,Ad.southAngle=0,Ad.westOverIdl=Number.POSITIVE_INFINITY,Ad.eastOverIdl=Number.NEGATIVE_INFINITY;let r=e.length,o=kl.fromCartesian(e[0],pKe);for(let s=1;s<r;s++){let a=kl.fromCartesian(e[s],lge);cge(a,o,t,n,Ad,i),o=kl.clone(a,o)}return cge(kl.fromCartesian(e[0],lge),o,t,n,Ad,i),i.east-i.west>Ad.eastOverIdl-Ad.westOverIdl&&(i.west=Ad.westOverIdl,i.east=Ad.eastOverIdl,i.east>P.PI&&(i.east=i.east-P.TWO_PI),i.west>P.PI&&(i.west=i.west-P.TWO_PI)),P.equalsEpsilon(Math.abs(Ad.northAngle),P.TWO_PI,P.EPSILON10)&&(i.north=P.PI_OVER_TWO,i.east=P.PI,i.west=-P.PI),P.equalsEpsilon(Math.abs(Ad.southAngle),P.TWO_PI,P.EPSILON10)&&(i.south=-P.PI_OVER_TWO,i.east=P.PI,i.west=-P.PI),i};var gKe=new kl;function _Ke(e,t,n){return e.height>=P.PI||e.width>=P.PI?kl.fromCartesian(t[0],gKe).tangentPlane:Ys.fromPoints(t,n)}var uge=new he;function yKe(e,t,n){return(i,r)=>{if(e.height>=P.PI||e.width>=P.PI){if(e.south<0&&e.north>0){l(r)||(r=[]);for(let s=0;s<i.length;++s){let a=n.cartesianToCartographic(i[s],uge);r[s]=new U(a.longitude/P.PI,a.latitude/P.PI_OVER_TWO)}return r.length=i.length,r}return kl.fromCartesianArray(i,r)}return Ys.fromPoints(t,n).projectPointsOntoPlane(i,r)}}function AKe(e,t,n){if(e.height>=P.PI||e.width>=P.PI)return(r,o)=>{if(e.south<0&&e.north>0){let s=n.cartesianToCartographic(r,uge);return l(o)||(o=new U),o.x=s.longitude/P.PI,o.y=s.latitude/P.PI_OVER_TWO,o}return kl.fromCartesian(r,o)};let i=Ys.fromPoints(t,n);return(r,o)=>i.projectPointsOntoPlane(r,o)}function bKe(e,t,n,i){return(r,o)=>!i&&(e.height>=P.PI_OVER_TWO||e.width>=2*P.PI_OVER_THREE)?ni.splitPolygonsOnEquator(r,t,n,o):r}function xKe(e,t,n,i){if(t.height>=P.PI||t.width>=P.PI)return et.fromRectangle(t,void 0,oge);let r=e,o=Ys.fromPoints(r,n);return ni.computeBoundingRectangle(o.plane.normal,o.projectPointOntoPlane.bind(o),r,i,oge)}bd.createGeometry=function(e){let t=e._vertexFormat,n=e._ellipsoid,i=e._granularity,r=e._stRotation,o=e._polygonHierarchy,s=e._perPositionHeight,a=e._closeTop,c=e._closeBottom,u=e._arcType,f=e._textureCoordinates,d=l(f),p=o.positions;if(p.length<3)return;let g=e.rectangle,m=ni.polygonsFromHierarchy(o,d,yKe(g,p,n),!s,n,bKe(g,n,u,s)),y=m.hierarchy,A=m.polygons,b=function(D){return D},x=d?ni.polygonsFromHierarchy(f,!0,b,!1,n).polygons:void 0;if(y.length===0)return;let T=y[0].outerRing,E=xKe(T,g,n,r),v=[],S=e._height,I=e._extrudedHeight,R=e._perPositionHeightExtrude||!P.equalsEpsilon(S,I,0,P.EPSILON2),O={perPositionHeight:s,vertexFormat:t,geometry:void 0,rotationAxis:_Ke(g,T,n).plane.normal,projectTo2d:AKe(g,T,n),boundingRectangle:E,ellipsoid:n,stRotation:r,textureCoordinates:void 0,bottom:!1,top:!0,wall:!1,extrude:!1,arcType:u},L;if(R)for(O.extrude=!0,O.top=a,O.bottom=c,O.shadowVolume=e._shadowVolume,O.offsetAttribute=e._offsetAttribute,L=0;L<A.length;L++){let D=cKe(n,A[L],d?x[L]:void 0,i,y[L],s,a,c,t,u),N;a&&c?(N=D.topAndBottom,O.geometry=ni.scaleToGeodeticHeightExtruded(N.geometry,S,I,n,s)):a?(N=D.topAndBottom,N.geometry.attributes.position.values=mi.scaleToGeodeticHeight(N.geometry.attributes.position.values,S,n,!s),O.geometry=N.geometry):c&&(N=D.topAndBottom,N.geometry.attributes.position.values=mi.scaleToGeodeticHeight(N.geometry.attributes.position.values,I,n,!0),O.geometry=N.geometry),(a||c)&&(O.wall=!1,N.geometry=t$(O),v.push(N));let F=D.walls;O.wall=!0;for(let V=0;V<F.length;V++){let B=F[V];O.geometry=ni.scaleToGeodeticHeightExtruded(B.geometry,S,I,n,s),B.geometry=t$(O),v.push(B)}}else for(L=0;L<A.length;L++){let D=new Bt({geometry:ni.createGeometryFromPositions(n,A[L],d?x[L]:void 0,i,s,t,u)});if(D.geometry.attributes.position.values=mi.scaleToGeodeticHeight(D.geometry.attributes.position.values,S,n,!s),O.geometry=D.geometry,D.geometry=t$(O),l(e._offsetAttribute)){let N=D.geometry.attributes.position.values.length,F=e._offsetAttribute===pn.NONE?0:1,V=new Uint8Array(N/3).fill(F);D.geometry.attributes.applyOffset=new Ne({componentDatatype:Y.UNSIGNED_BYTE,componentsPerAttribute:1,values:V})}v.push(D)}let _=Wn.combineInstances(v)[0];_.attributes.position.values=new Float64Array(_.attributes.position.values),_.indices=je.createTypedArray(_.attributes.position.values.length/3,_.indices);let C=_.attributes,w=ue.fromVertices(C.position.values);return t.position||delete C.position,new wt({attributes:C,indices:_.indices,primitiveType:_.primitiveType,boundingSphere:w,offsetAttribute:e._offsetAttribute})};bd.createShadowVolume=function(e,t,n){let i=e._granularity,r=e._ellipsoid,o=t(i,r),s=n(i,r);return new bd({polygonHierarchy:e._polygonHierarchy,ellipsoid:r,stRotation:e._stRotation,granularity:i,perPositionHeight:!1,extrudedHeight:o,height:s,vertexFormat:Be.POSITION_ONLY,shadowVolume:!0,arcType:e._arcType})};function TKe(e){let t=-e._stRotation;if(t===0)return[0,0,0,1,1,0];let n=e._ellipsoid,i=e._polygonHierarchy.positions,r=e.rectangle;return wt._textureCoordinateRotationPoints(i,t,n,r)}Object.defineProperties(bd.prototype,{rectangle:{get:function(){if(!l(this._rectangle)){let e=this._polygonHierarchy.positions;this._rectangle=bd.computeRectangleFromPositions(e,this._ellipsoid,this._arcType)}return this._rectangle}},textureCoordinateRotationPoints:{get:function(){return l(this._textureCoordinateRotationPoints)||(this._textureCoordinateRotationPoints=TKe(this)),this._textureCoordinateRotationPoints}}});var og=bd;var fge=[],Y3=[];function EKe(e,t,n,i,r){let s=Ys.fromPoints(t,e).projectPointsOntoPlane(t,fge);mi.computeWindingOrder2D(s)===sa.CLOCKWISE&&(s.reverse(),t=t.slice().reverse());let c,u,f=t.length,d=0;if(i)for(c=new Float64Array(f*2*3),u=0;u<f;u++){let m=t[u],y=t[(u+1)%f];c[d++]=m.x,c[d++]=m.y,c[d++]=m.z,c[d++]=y.x,c[d++]=y.y,c[d++]=y.z}else{let m=0;if(r===ln.GEODESIC)for(u=0;u<f;u++)m+=ni.subdivideLineCount(t[u],t[(u+1)%f],n);else if(r===ln.RHUMB)for(u=0;u<f;u++)m+=ni.subdivideRhumbLineCount(e,t[u],t[(u+1)%f],n);for(c=new Float64Array(m*3),u=0;u<f;u++){let y;r===ln.GEODESIC?y=ni.subdivideLine(t[u],t[(u+1)%f],n,Y3):r===ln.RHUMB&&(y=ni.subdivideRhumbLine(e,t[u],t[(u+1)%f],n,Y3));let A=y.length;for(let b=0;b<A;++b)c[d++]=y[b]}}f=c.length/3;let p=f*2,g=je.createTypedArray(f,p);for(d=0,u=0;u<f-1;u++)g[d++]=u,g[d++]=u+1;return g[d++]=f-1,g[d]=0,new Bt({geometry:new wt({attributes:new En({position:new Ne({componentDatatype:Y.DOUBLE,componentsPerAttribute:3,values:c})}),indices:g,primitiveType:Oe.LINES})})}function CKe(e,t,n,i,r){let s=Ys.fromPoints(t,e).projectPointsOntoPlane(t,fge);mi.computeWindingOrder2D(s)===sa.CLOCKWISE&&(s.reverse(),t=t.slice().reverse());let c,u,f=t.length,d=new Array(f),p=0;if(i)for(c=new Float64Array(f*2*3*2),u=0;u<f;++u){d[u]=p/3;let A=t[u],b=t[(u+1)%f];c[p++]=A.x,c[p++]=A.y,c[p++]=A.z,c[p++]=b.x,c[p++]=b.y,c[p++]=b.z}else{let A=0;if(r===ln.GEODESIC)for(u=0;u<f;u++)A+=ni.subdivideLineCount(t[u],t[(u+1)%f],n);else if(r===ln.RHUMB)for(u=0;u<f;u++)A+=ni.subdivideRhumbLineCount(e,t[u],t[(u+1)%f],n);for(c=new Float64Array(A*3*2),u=0;u<f;++u){d[u]=p/3;let b;r===ln.GEODESIC?b=ni.subdivideLine(t[u],t[(u+1)%f],n,Y3):r===ln.RHUMB&&(b=ni.subdivideRhumbLine(e,t[u],t[(u+1)%f],n,Y3));let x=b.length;for(let T=0;T<x;++T)c[p++]=b[T]}}f=c.length/6;let g=d.length,m=(f*2+g)*2,y=je.createTypedArray(f+g,m);for(p=0,u=0;u<f;++u)y[p++]=u,y[p++]=(u+1)%f,y[p++]=u+f,y[p++]=(u+1)%f+f;for(u=0;u<g;u++){let A=d[u];y[p++]=A,y[p++]=A+f}return new Bt({geometry:new wt({attributes:new En({position:new Ne({componentDatatype:Y.DOUBLE,componentsPerAttribute:3,values:c})}),indices:y,primitiveType:Oe.LINES})})}function nx(e){let t=e.polygonHierarchy,n=e.ellipsoid??ee.default,i=e.granularity??P.RADIANS_PER_DEGREE,r=e.perPositionHeight??!1,o=r&&l(e.extrudedHeight),s=e.arcType??ln.GEODESIC,a=e.height??0,c=e.extrudedHeight??a;if(!o){let u=Math.max(a,c);c=Math.min(a,c),a=u}this._ellipsoid=ee.clone(n),this._granularity=i,this._height=a,this._extrudedHeight=c,this._arcType=s,this._polygonHierarchy=t,this._perPositionHeight=r,this._perPositionHeightExtrude=o,this._offsetAttribute=e.offsetAttribute,this._workerName="createPolygonOutlineGeometry",this.packedLength=ni.computeHierarchyPackedLength(t,h)+ee.packedLength+8}nx.pack=function(e,t,n){return n=n??0,n=ni.packPolygonHierarchy(e._polygonHierarchy,t,n,h),ee.pack(e._ellipsoid,t,n),n+=ee.packedLength,t[n++]=e._height,t[n++]=e._extrudedHeight,t[n++]=e._granularity,t[n++]=e._perPositionHeightExtrude?1:0,t[n++]=e._perPositionHeight?1:0,t[n++]=e._arcType,t[n++]=e._offsetAttribute??-1,t[n]=e.packedLength,t};var vKe=ee.clone(ee.UNIT_SPHERE),SKe={polygonHierarchy:{}};nx.unpack=function(e,t,n){t=t??0;let i=ni.unpackPolygonHierarchy(e,t,h);t=i.startingIndex,delete i.startingIndex;let r=ee.unpack(e,t,vKe);t+=ee.packedLength;let o=e[t++],s=e[t++],a=e[t++],c=e[t++]===1,u=e[t++]===1,f=e[t++],d=e[t++],p=e[t];return l(n)||(n=new nx(SKe)),n._polygonHierarchy=i,n._ellipsoid=ee.clone(r,n._ellipsoid),n._height=o,n._extrudedHeight=s,n._granularity=a,n._perPositionHeight=u,n._perPositionHeightExtrude=c,n._arcType=f,n._offsetAttribute=d===-1?void 0:d,n.packedLength=p,n};nx.fromPositions=function(e){e=e??H.EMPTY_OBJECT;let t={polygonHierarchy:{positions:e.positions},height:e.height,extrudedHeight:e.extrudedHeight,ellipsoid:e.ellipsoid,granularity:e.granularity,perPositionHeight:e.perPositionHeight,arcType:e.arcType,offsetAttribute:e.offsetAttribute};return new nx(t)};nx.createGeometry=function(e){let t=e._ellipsoid,n=e._granularity,i=e._polygonHierarchy,r=e._perPositionHeight,o=e._arcType,s=ni.polygonOutlinesFromHierarchy(i,!r,t);if(s.length===0)return;let a,c=[],u=P.chordLength(n,t.maximumRadius),f=e._height,d=e._extrudedHeight,p=e._perPositionHeightExtrude||!P.equalsEpsilon(f,d,0,P.EPSILON2),g,m;if(p)for(m=0;m<s.length;m++){if(a=CKe(t,s[m],u,r,o),a.geometry=ni.scaleToGeodeticHeightExtruded(a.geometry,f,d,t,r),l(e._offsetAttribute)){let b=a.geometry.attributes.position.values.length/3,x=new Uint8Array(b);e._offsetAttribute===pn.TOP?x=x.fill(1,0,b/2):(g=e._offsetAttribute===pn.NONE?0:1,x=x.fill(g)),a.geometry.attributes.applyOffset=new Ne({componentDatatype:Y.UNSIGNED_BYTE,componentsPerAttribute:1,values:x})}c.push(a)}else for(m=0;m<s.length;m++){if(a=EKe(t,s[m],u,r,o),a.geometry.attributes.position.values=mi.scaleToGeodeticHeight(a.geometry.attributes.position.values,f,t,!r),l(e._offsetAttribute)){let b=a.geometry.attributes.position.values.length;g=e._offsetAttribute===pn.NONE?0:1;let x=new Uint8Array(b/3).fill(g);a.geometry.attributes.applyOffset=new Ne({componentDatatype:Y.UNSIGNED_BYTE,componentsPerAttribute:1,values:x})}c.push(a)}let y=Wn.combineInstances(c)[0],A=ue.fromVertices(y.attributes.position.values);return new wt({attributes:y.attributes,indices:y.indices,primitiveType:y.primitiveType,boundingSphere:A,offsetAttribute:e._offsetAttribute})};var X3=nx;var dge="Entity polygons cannot have both height and perPositionHeight. height will be ignored",hge="heightReference is not supported for entity polygons with perPositionHeight. heightReference will be ignored",mge=new z,pge=h.ZERO,gge=new h,_ge=new ie,wKe=[],IKe=new U;function PKe(e){this.id=e,this.vertexFormat=void 0,this.polygonHierarchy=void 0,this.perPositionHeight=void 0,this.closeTop=void 0,this.closeBottom=void 0,this.height=void 0,this.extrudedHeight=void 0,this.granularity=void 0,this.stRotation=void 0,this.offsetAttribute=void 0,this.arcType=void 0,this.textureCoordinates=void 0}function df(e,t){oi.call(this,{entity:e,scene:t,geometryOptions:new PKe(e),geometryPropertyName:"polygon",observedPropertyNames:["availability","polygon"]}),this._onEntityPropertyChanged(e,"polygon",e.polygon,void 0)}l(Object.create)&&(df.prototype=Object.create(oi.prototype),df.prototype.constructor=df);df.prototype.createFillGeometryInstance=function(e){let t=this._entity,n=t.isAvailable(e),i=this._options,r={show:new Dn(n&&t.isShowing&&this._showProperty.getValue(e)&&this._fillProperty.getValue(e)),distanceDisplayCondition:ti.fromDistanceDisplayCondition(this._distanceDisplayConditionProperty.getValue(e)),offset:void 0,color:void 0};if(this._materialProperty instanceof Kt){let s;l(this._materialProperty.color)&&(this._materialProperty.color.isConstant||n)&&(s=this._materialProperty.color.getValue(e,mge)),l(s)||(s=z.WHITE),r.color=Jt.fromColor(s)}l(i.offsetAttribute)&&(r.offset=Er.fromCartesian3(X.getValueOrDefault(this._terrainOffsetProperty,e,pge,gge)));let o;return i.perPositionHeight&&!l(i.extrudedHeight)?o=new W3(i):o=new og(i),new Bt({id:t,geometry:o,attributes:r})};df.prototype.createOutlineGeometryInstance=function(e){let t=this._entity,n=t.isAvailable(e),i=this._options,r=X.getValueOrDefault(this._outlineColorProperty,e,z.BLACK,mge),o=this._distanceDisplayConditionProperty.getValue(e),s={show:new Dn(n&&t.isShowing&&this._showProperty.getValue(e)&&this._showOutlineProperty.getValue(e)),color:Jt.fromColor(r),distanceDisplayCondition:ti.fromDistanceDisplayCondition(o),offset:void 0};l(i.offsetAttribute)&&(s.offset=Er.fromCartesian3(X.getValueOrDefault(this._terrainOffsetProperty,e,pge,gge)));let a;return i.perPositionHeight&&!l(i.extrudedHeight)?a=new Ph(i):a=new X3(i),new Bt({id:t,geometry:a,attributes:s})};df.prototype._computeCenter=function(e,t){let n=X.getValueOrUndefined(this._entity.polygon.hierarchy,e);if(!l(n))return;let i=n.positions;if(i.length===0)return;let r=this._scene.ellipsoid,o=Ys.fromPoints(i,r),s=o.projectPointsOntoPlane(i,wKe),a=s.length,c=0,u=a-1,f=new U;for(let p=0;p<a;u=p++){let g=s[p],m=s[u],y=g.x*m.y-m.x*g.y,A=U.add(g,m,IKe);A=U.multiplyByScalar(A,y,A),f=U.add(f,A,f),c+=y}let d=1/(c*3);return f=U.multiplyByScalar(f,d,f),o.projectPointOntoEllipsoid(f,t)};df.prototype._isHidden=function(e,t){return!l(t.hierarchy)||Mi.prototype._isHidden.call(this,e,t)};df.prototype._isOnTerrain=function(e,t){let n=oi.prototype._isOnTerrain.call(this,e,t),i=t.perPositionHeight,r=l(i)&&(i.isConstant?i.getValue(it.MINIMUM_VALUE):!0);return n&&!r};df.prototype._isDynamic=function(e,t){return!t.hierarchy.isConstant||!X.isConstant(t.height)||!X.isConstant(t.extrudedHeight)||!X.isConstant(t.granularity)||!X.isConstant(t.stRotation)||!X.isConstant(t.textureCoordinates)||!X.isConstant(t.outlineWidth)||!X.isConstant(t.perPositionHeight)||!X.isConstant(t.closeTop)||!X.isConstant(t.closeBottom)||!X.isConstant(t.zIndex)||!X.isConstant(t.arcType)||this._onTerrain&&!X.isConstant(this._materialProperty)&&!(this._materialProperty instanceof Kt)};df.prototype._setStaticOptions=function(e,t){let n=this._materialProperty instanceof Kt,i=this._options;i.vertexFormat=n?An.VERTEX_FORMAT:Cr.MaterialSupport.TEXTURED.vertexFormat;let r=t.hierarchy.getValue(it.MINIMUM_VALUE),o=X.getValueOrUndefined(t.height,it.MINIMUM_VALUE),s=X.getValueOrDefault(t.heightReference,it.MINIMUM_VALUE,We.NONE),a=X.getValueOrUndefined(t.extrudedHeight,it.MINIMUM_VALUE),c=X.getValueOrDefault(t.extrudedHeightReference,it.MINIMUM_VALUE,We.NONE),u=X.getValueOrDefault(t.perPositionHeight,it.MINIMUM_VALUE,!1);o=oi.getGeometryHeight(o,s);let f;if(u?(l(o)&&(o=void 0,yt(dge)),s!==We.NONE&&u&&(o=void 0,yt(hge))):(l(a)&&!l(o)&&(o=0),f=oi.computeGeometryOffsetAttribute(o,s,a,c)),i.polygonHierarchy=r,i.granularity=X.getValueOrUndefined(t.granularity,it.MINIMUM_VALUE),i.stRotation=X.getValueOrUndefined(t.stRotation,it.MINIMUM_VALUE),i.perPositionHeight=u,i.closeTop=X.getValueOrDefault(t.closeTop,it.MINIMUM_VALUE,!0),i.closeBottom=X.getValueOrDefault(t.closeBottom,it.MINIMUM_VALUE,!0),i.offsetAttribute=f,i.height=o,i.arcType=X.getValueOrDefault(t.arcType,it.MINIMUM_VALUE,ln.GEODESIC),i.textureCoordinates=X.getValueOrUndefined(t.textureCoordinates,it.MINIMUM_VALUE),a=oi.getGeometryExtrudedHeight(a,c),a===oi.CLAMP_TO_GROUND){let d=og.computeRectangleFromPositions(i.polygonHierarchy.positions,i.ellipsoid,i.arcType,_ge);a=Ni.getMinimumMaximumHeights(d).minimumTerrainHeight}i.extrudedHeight=a};df.prototype._getIsClosed=function(e){let t=e.height,n=e.extrudedHeight,i=l(n)&&n!==t;return!e.perPositionHeight&&(!i&&t===0||i&&e.closeTop&&e.closeBottom)};df.DynamicGeometryUpdater=qC;function qC(e,t,n){Oi.call(this,e,t,n)}l(Object.create)&&(qC.prototype=Object.create(Oi.prototype),qC.prototype.constructor=qC);qC.prototype._isHidden=function(e,t,n){return!l(this._options.polygonHierarchy)||Oi.prototype._isHidden.call(this,e,t,n)};qC.prototype._setOptions=function(e,t,n){let i=this._options;i.polygonHierarchy=X.getValueOrUndefined(t.hierarchy,n);let r=X.getValueOrUndefined(t.height,n),o=X.getValueOrDefault(t.heightReference,n,We.NONE),s=X.getValueOrDefault(t.extrudedHeightReference,n,We.NONE),a=X.getValueOrUndefined(t.extrudedHeight,n),c=X.getValueOrUndefined(t.perPositionHeight,n);r=oi.getGeometryHeight(r,s);let u;if(c?(l(r)&&(r=void 0,yt(dge)),o!==We.NONE&&c&&(r=void 0,yt(hge))):(l(a)&&!l(r)&&(r=0),u=oi.computeGeometryOffsetAttribute(r,o,a,s)),i.granularity=X.getValueOrUndefined(t.granularity,n),i.stRotation=X.getValueOrUndefined(t.stRotation,n),i.textureCoordinates=X.getValueOrUndefined(t.textureCoordinates,n),i.perPositionHeight=X.getValueOrUndefined(t.perPositionHeight,n),i.closeTop=X.getValueOrDefault(t.closeTop,n,!0),i.closeBottom=X.getValueOrDefault(t.closeBottom,n,!0),i.offsetAttribute=u,i.height=r,i.arcType=X.getValueOrDefault(t.arcType,n,ln.GEODESIC),a=oi.getGeometryExtrudedHeight(a,s),a===oi.CLAMP_TO_GROUND){let f=og.computeRectangleFromPositions(i.polygonHierarchy.positions,i.ellipsoid,i.arcType,_ge);a=Ni.getMinimumMaximumHeights(f).minimumTerrainHeight}i.extrudedHeight=a};var K3=df;function DKe(e,t,n,i){let r=new En;i.position&&(r.position=new Ne({componentDatatype:Y.DOUBLE,componentsPerAttribute:3,values:e}));let o=t.length,s=e.length/3,a=(s-o*2)/(o*2),c=mi.triangulate(t),u=(a-1)*o*6+c.length*2,f=je.createTypedArray(s,u),d,p,g,m,y,A,b=o*2,x=0;for(d=0;d<a-1;d++){for(p=0;p<o-1;p++)g=p*2+d*o*2,A=g+b,m=g+1,y=m+b,f[x++]=m,f[x++]=g,f[x++]=y,f[x++]=y,f[x++]=g,f[x++]=A;g=o*2-2+d*o*2,m=g+1,y=m+b,A=g+b,f[x++]=m,f[x++]=g,f[x++]=y,f[x++]=y,f[x++]=g,f[x++]=A}if(i.st||i.tangent||i.bitangent){let v=new Float32Array(s*2),S=1/(a-1),I=1/n.height,R=n.height/2,O,L,_=0;for(d=0;d<a;d++){for(O=d*S,L=I*(t[0].y+R),v[_++]=O,v[_++]=L,p=1;p<o;p++)L=I*(t[p].y+R),v[_++]=O,v[_++]=L,v[_++]=O,v[_++]=L;L=I*(t[0].y+R),v[_++]=O,v[_++]=L}for(p=0;p<o;p++)O=0,L=I*(t[p].y+R),v[_++]=O,v[_++]=L;for(p=0;p<o;p++)O=(a-1)*S,L=I*(t[p].y+R),v[_++]=O,v[_++]=L;r.st=new Ne({componentDatatype:Y.FLOAT,componentsPerAttribute:2,values:new Float32Array(v)})}let T=s-o*2;for(d=0;d<c.length;d+=3){let v=c[d]+T,S=c[d+1]+T,I=c[d+2]+T;f[x++]=v,f[x++]=S,f[x++]=I,f[x++]=I+o,f[x++]=S+o,f[x++]=v+o}let E=new wt({attributes:r,indices:f,boundingSphere:ue.fromVertices(e),primitiveType:Oe.TRIANGLES});if(i.normal&&(E=Wn.computeNormal(E)),i.tangent||i.bitangent){try{E=Wn.computeTangentAndBitangent(E)}catch{yt("polyline-volume-tangent-bitangent","Unable to compute tangents and bitangents for polyline volume geometry")}i.tangent||(E.attributes.tangent=void 0),i.bitangent||(E.attributes.bitangent=void 0),i.st||(E.attributes.st=void 0)}return E}function yD(e){e=e??H.EMPTY_OBJECT;let t=e.polylinePositions,n=e.shapePositions;this._positions=t,this._shape=n,this._ellipsoid=ee.clone(e.ellipsoid??ee.default),this._cornerType=e.cornerType??sr.ROUNDED,this._vertexFormat=Be.clone(e.vertexFormat??Be.DEFAULT),this._granularity=e.granularity??P.RADIANS_PER_DEGREE,this._workerName="createPolylineVolumeGeometry";let i=1+t.length*h.packedLength;i+=1+n.length*U.packedLength,this.packedLength=i+ee.packedLength+Be.packedLength+2}yD.pack=function(e,t,n){n=n??0;let i,r=e._positions,o=r.length;for(t[n++]=o,i=0;i<o;++i,n+=h.packedLength)h.pack(r[i],t,n);let s=e._shape;for(o=s.length,t[n++]=o,i=0;i<o;++i,n+=U.packedLength)U.pack(s[i],t,n);return ee.pack(e._ellipsoid,t,n),n+=ee.packedLength,Be.pack(e._vertexFormat,t,n),n+=Be.packedLength,t[n++]=e._cornerType,t[n]=e._granularity,t};var yge=ee.clone(ee.UNIT_SPHERE),Age=new Be,_D={polylinePositions:void 0,shapePositions:void 0,ellipsoid:yge,vertexFormat:Age,cornerType:void 0,granularity:void 0};yD.unpack=function(e,t,n){t=t??0;let i,r=e[t++],o=new Array(r);for(i=0;i<r;++i,t+=h.packedLength)o[i]=h.unpack(e,t);r=e[t++];let s=new Array(r);for(i=0;i<r;++i,t+=U.packedLength)s[i]=U.unpack(e,t);let a=ee.unpack(e,t,yge);t+=ee.packedLength;let c=Be.unpack(e,t,Age);t+=Be.packedLength;let u=e[t++],f=e[t];return l(n)?(n._positions=o,n._shape=s,n._ellipsoid=ee.clone(a,n._ellipsoid),n._vertexFormat=Be.clone(c,n._vertexFormat),n._cornerType=u,n._granularity=f,n):(_D.polylinePositions=o,_D.shapePositions=s,_D.cornerType=u,_D.granularity=f,new yD(_D))};var RKe=new et;yD.createGeometry=function(e){let t=e._positions,n=Lr(t,h.equalsEpsilon),i=e._shape;if(i=up.removeDuplicatesFromShape(i),n.length<2||i.length<3)return;mi.computeWindingOrder2D(i)===sa.CLOCKWISE&&i.reverse();let r=et.fromPoints(i,RKe),o=up.computePositions(n,i,r,e,!0);return DKe(o,i,r,e._vertexFormat)};var $3=yD;function OKe(e,t){let n=new En;n.position=new Ne({componentDatatype:Y.DOUBLE,componentsPerAttribute:3,values:e});let i=t.length,r=n.position.values.length/3,s=e.length/3/i,a=je.createTypedArray(r,2*i*(s+1)),c,u,f=0;c=0;let d=c*i;for(u=0;u<i-1;u++)a[f++]=u+d,a[f++]=u+d+1;for(a[f++]=i-1+d,a[f++]=d,c=s-1,d=c*i,u=0;u<i-1;u++)a[f++]=u+d,a[f++]=u+d+1;for(a[f++]=i-1+d,a[f++]=d,c=0;c<s-1;c++){let g=i*c,m=g+i;for(u=0;u<i;u++)a[f++]=u+g,a[f++]=u+m}return new wt({attributes:n,indices:je.createTypedArray(r,a),boundingSphere:ue.fromVertices(e),primitiveType:Oe.LINES})}function bD(e){e=e??H.EMPTY_OBJECT;let t=e.polylinePositions,n=e.shapePositions;this._positions=t,this._shape=n,this._ellipsoid=ee.clone(e.ellipsoid??ee.default),this._cornerType=e.cornerType??sr.ROUNDED,this._granularity=e.granularity??P.RADIANS_PER_DEGREE,this._workerName="createPolylineVolumeOutlineGeometry";let i=1+t.length*h.packedLength;i+=1+n.length*U.packedLength,this.packedLength=i+ee.packedLength+2}bD.pack=function(e,t,n){n=n??0;let i,r=e._positions,o=r.length;for(t[n++]=o,i=0;i<o;++i,n+=h.packedLength)h.pack(r[i],t,n);let s=e._shape;for(o=s.length,t[n++]=o,i=0;i<o;++i,n+=U.packedLength)U.pack(s[i],t,n);return ee.pack(e._ellipsoid,t,n),n+=ee.packedLength,t[n++]=e._cornerType,t[n]=e._granularity,t};var bge=ee.clone(ee.UNIT_SPHERE),AD={polylinePositions:void 0,shapePositions:void 0,ellipsoid:bge,height:void 0,cornerType:void 0,granularity:void 0};bD.unpack=function(e,t,n){t=t??0;let i,r=e[t++],o=new Array(r);for(i=0;i<r;++i,t+=h.packedLength)o[i]=h.unpack(e,t);r=e[t++];let s=new Array(r);for(i=0;i<r;++i,t+=U.packedLength)s[i]=U.unpack(e,t);let a=ee.unpack(e,t,bge);t+=ee.packedLength;let c=e[t++],u=e[t];return l(n)?(n._positions=o,n._shape=s,n._ellipsoid=ee.clone(a,n._ellipsoid),n._cornerType=c,n._granularity=u,n):(AD.polylinePositions=o,AD.shapePositions=s,AD.cornerType=c,AD.granularity=u,new bD(AD))};var MKe=new et;bD.createGeometry=function(e){let t=e._positions,n=Lr(t,h.equalsEpsilon),i=e._shape;if(i=up.removeDuplicatesFromShape(i),n.length<2||i.length<3)return;mi.computeWindingOrder2D(i)===sa.CLOCKWISE&&i.reverse();let r=et.fromPoints(i,MKe),o=up.computePositions(n,i,r,e,!1);return OKe(o,i)};var J3=bD;var xge=new z;function NKe(e){this.id=e,this.vertexFormat=void 0,this.polylinePositions=void 0,this.shapePositions=void 0,this.cornerType=void 0,this.granularity=void 0}function mp(e,t){Mi.call(this,{entity:e,scene:t,geometryOptions:new NKe(e),geometryPropertyName:"polylineVolume",observedPropertyNames:["availability","polylineVolume"]}),this._onEntityPropertyChanged(e,"polylineVolume",e.polylineVolume,void 0)}l(Object.create)&&(mp.prototype=Object.create(Mi.prototype),mp.prototype.constructor=mp);mp.prototype.createFillGeometryInstance=function(e){let t=this._entity,n=t.isAvailable(e),i,r,o=new Dn(n&&t.isShowing&&this._showProperty.getValue(e)&&this._fillProperty.getValue(e)),s=this._distanceDisplayConditionProperty.getValue(e),a=ti.fromDistanceDisplayCondition(s);if(this._materialProperty instanceof Kt){let c;l(this._materialProperty.color)&&(this._materialProperty.color.isConstant||n)&&(c=this._materialProperty.color.getValue(e,xge)),l(c)||(c=z.WHITE),r=Jt.fromColor(c),i={show:o,distanceDisplayCondition:a,color:r}}else i={show:o,distanceDisplayCondition:a};return new Bt({id:t,geometry:new $3(this._options),attributes:i})};mp.prototype.createOutlineGeometryInstance=function(e){let t=this._entity,n=t.isAvailable(e),i=X.getValueOrDefault(this._outlineColorProperty,e,z.BLACK,xge),r=this._distanceDisplayConditionProperty.getValue(e);return new Bt({id:t,geometry:new J3(this._options),attributes:{show:new Dn(n&&t.isShowing&&this._showProperty.getValue(e)&&this._showOutlineProperty.getValue(e)),color:Jt.fromColor(i),distanceDisplayCondition:ti.fromDistanceDisplayCondition(r)}})};mp.prototype._isHidden=function(e,t){return!l(t.positions)||!l(t.shape)||Mi.prototype._isHidden.call(this,e,t)};mp.prototype._isDynamic=function(e,t){return!t.positions.isConstant||!t.shape.isConstant||!X.isConstant(t.granularity)||!X.isConstant(t.outlineWidth)||!X.isConstant(t.cornerType)};mp.prototype._setStaticOptions=function(e,t){let n=t.granularity,i=t.cornerType,r=this._options,o=this._materialProperty instanceof Kt;r.vertexFormat=o?An.VERTEX_FORMAT:Cr.MaterialSupport.TEXTURED.vertexFormat,r.polylinePositions=t.positions.getValue(it.MINIMUM_VALUE,r.polylinePositions),r.shapePositions=t.shape.getValue(it.MINIMUM_VALUE,r.shape),r.granularity=l(n)?n.getValue(it.MINIMUM_VALUE):void 0,r.cornerType=l(i)?i.getValue(it.MINIMUM_VALUE):void 0};mp.DynamicGeometryUpdater=YC;function YC(e,t,n){Oi.call(this,e,t,n)}l(Object.create)&&(YC.prototype=Object.create(Oi.prototype),YC.prototype.constructor=YC);YC.prototype._isHidden=function(e,t,n){let i=this._options;return!l(i.polylinePositions)||!l(i.shapePositions)||Oi.prototype._isHidden.call(this,e,t,n)};YC.prototype._setOptions=function(e,t,n){let i=this._options;i.polylinePositions=X.getValueOrUndefined(t.positions,n,i.polylinePositions),i.shapePositions=X.getValueOrUndefined(t.shape,n),i.granularity=X.getValueOrUndefined(t.granularity,n),i.cornerType=X.getValueOrUndefined(t.cornerType,n)};var Z3=mp;var Tge=Math.cos,Ege=Math.sin,LKe=Math.sqrt,n$={};n$.computePosition=function(e,t,n,i,r,o,s){let a=t.radiiSquared,c=e.nwCorner,u=e.boundingRectangle,f=c.latitude-e.granYCos*i+r*e.granXSin,d=Tge(f),p=Ege(f),g=a.z*p,m=c.longitude+i*e.granYSin+r*e.granXCos,y=d*Tge(m),A=d*Ege(m),b=a.x*y,x=a.y*A,T=LKe(b*y+x*A+g*p);if(o.x=b/T,o.y=x/T,o.z=g/T,n){let E=e.stNwCorner;l(E)?(f=E.latitude-e.stGranYCos*i+r*e.stGranXSin,m=E.longitude+i*e.stGranYSin+r*e.stGranXCos,s.x=(m-e.stWest)*e.lonScalar,s.y=(f-e.stSouth)*e.latScalar):(s.x=(m-u.west)*e.lonScalar,s.y=(f-u.south)*e.latScalar)}};var FKe=new $i,xd=new h,BKe=new he,Q3=new h,xD=new ji;function Cge(e,t,n,i,r,o,s){let a=Math.cos(t),c=i*a,u=n*a,f=Math.sin(t),d=i*f,p=n*f;xD._ellipsoid=ee.default,xd=xD.project(e,xd),xd=h.subtract(xd,Q3,xd);let g=$i.fromRotation(t,FKe);xd=$i.multiplyByVector(g,xd,xd),xd=h.add(xd,Q3,xd),e=xD.unproject(xd,e),o-=1,s-=1;let m=e.latitude,y=m+o*p,A=m-c*s,b=m-c*s+o*p,x=Math.max(m,y,A,b),T=Math.min(m,y,A,b),E=e.longitude,v=E+o*u,S=E+s*d,I=E+s*d+o*u,R=Math.max(E,v,S,I),O=Math.min(E,v,S,I);return{north:x,south:T,east:R,west:O,granYCos:c,granYSin:d,granXCos:u,granXSin:p,nwCorner:e}}n$.computeOptions=function(e,t,n,i,r,o,s){let a=e.east,c=e.west,u=e.north,f=e.south,d=!1,p=!1;u===P.PI_OVER_TWO&&(d=!0),f===-P.PI_OVER_TWO&&(p=!0);let g,m=u-f;c>a?g=P.TWO_PI-c+a:g=a-c;let y=Math.ceil(g/t)+1,A=Math.ceil(m/t)+1,b=g/(y-1),x=m/(A-1),T=ie.northwest(e,o),E=ie.center(e,BKe);(n!==0||i!==0)&&(E.longitude<T.longitude&&(E.longitude+=P.TWO_PI),xD._ellipsoid=ee.default,Q3=xD.project(E,Q3));let v=x,S=b,I=0,R=0,O=ie.clone(e,r),L={granYCos:v,granYSin:I,granXCos:S,granXSin:R,nwCorner:T,boundingRectangle:O,width:y,height:A,northCap:d,southCap:p};if(n!==0){let _=Cge(T,n,b,x,E,y,A);u=_.north,f=_.south,a=_.east,c=_.west,L.granYCos=_.granYCos,L.granYSin=_.granYSin,L.granXCos=_.granXCos,L.granXSin=_.granXSin,O.north=u,O.south=f,O.east=a,O.west=c}if(i!==0){n=n-i;let _=ie.northwest(O,s),C=Cge(_,n,b,x,E,y,A);L.stGranYCos=C.granYCos,L.stGranXCos=C.granXCos,L.stGranYSin=C.granYSin,L.stGranXSin=C.granXSin,L.stNwCorner=_,L.stWest=C.west,L.stSouth=C.south}return L};var Da=n$;var i$=new h,wge=new h,Ige=new h,Pge=new h,Dge=new ie,kKe=new U,UKe=new ue,zKe=new ue;function Rge(e,t){let n=new wt({attributes:new En,primitiveType:Oe.TRIANGLES});return n.attributes.position=new Ne({componentDatatype:Y.DOUBLE,componentsPerAttribute:3,values:t.positions}),e.normal&&(n.attributes.normal=new Ne({componentDatatype:Y.FLOAT,componentsPerAttribute:3,values:t.normals})),e.tangent&&(n.attributes.tangent=new Ne({componentDatatype:Y.FLOAT,componentsPerAttribute:3,values:t.tangents})),e.bitangent&&(n.attributes.bitangent=new Ne({componentDatatype:Y.FLOAT,componentsPerAttribute:3,values:t.bitangents})),n}function VKe(e,t,n,i){let r=e.length,o=t.normal?new Float32Array(r):void 0,s=t.tangent?new Float32Array(r):void 0,a=t.bitangent?new Float32Array(r):void 0,c=0,u=Pge,f=Ige,d=wge;if(t.normal||t.tangent||t.bitangent)for(let p=0;p<r;p+=3){let g=h.fromArray(e,p,i$),m=c+1,y=c+2;d=n.geodeticSurfaceNormal(g,d),(t.tangent||t.bitangent)&&(h.cross(h.UNIT_Z,d,f),$.multiplyByVector(i,f,f),h.normalize(f,f),t.bitangent&&h.normalize(h.cross(d,f,u),u)),t.normal&&(o[c]=d.x,o[m]=d.y,o[y]=d.z),t.tangent&&(s[c]=f.x,s[m]=f.y,s[y]=f.z),t.bitangent&&(a[c]=u.x,a[m]=u.y,a[y]=u.z),c+=3}return Rge(t,{positions:e,normals:o,tangents:s,bitangents:a})}var r$=new h,Oge=new h;function jKe(e,t,n){let i=e.length,r=t.normal?new Float32Array(i):void 0,o=t.tangent?new Float32Array(i):void 0,s=t.bitangent?new Float32Array(i):void 0,a=0,c=0,u=0,f=!0,d=Pge,p=Ige,g=wge;if(t.normal||t.tangent||t.bitangent)for(let m=0;m<i;m+=6){let y=h.fromArray(e,m,i$),A=h.fromArray(e,(m+6)%i,r$);if(f){let b=h.fromArray(e,(m+3)%i,Oge);h.subtract(A,y,A),h.subtract(b,y,b),g=h.normalize(h.cross(b,A,g),g),f=!1}h.equalsEpsilon(A,y,P.EPSILON10)&&(f=!0),(t.tangent||t.bitangent)&&(d=n.geodeticSurfaceNormal(y,d),t.tangent&&(p=h.normalize(h.cross(d,g,p),p))),t.normal&&(r[a++]=g.x,r[a++]=g.y,r[a++]=g.z,r[a++]=g.x,r[a++]=g.y,r[a++]=g.z),t.tangent&&(o[c++]=p.x,o[c++]=p.y,o[c++]=p.z,o[c++]=p.x,o[c++]=p.y,o[c++]=p.z),t.bitangent&&(s[u++]=d.x,s[u++]=d.y,s[u++]=d.z,s[u++]=d.x,s[u++]=d.y,s[u++]=d.z)}return Rge(t,{positions:e,normals:r,tangents:o,bitangents:s})}function Mge(e,t){let n=e._vertexFormat,i=e._ellipsoid,r=t.height,o=t.width,s=t.northCap,a=t.southCap,c=0,u=r,f=r,d=0;s&&(c=1,f-=1,d+=1),a&&(u-=1,f-=1,d+=1),d+=o*f;let p=n.position?new Float64Array(d*3):void 0,g=n.st?new Float32Array(d*2):void 0,m=0,y=0,A=i$,b=kKe,x=Number.MAX_VALUE,T=Number.MAX_VALUE,E=-Number.MAX_VALUE,v=-Number.MAX_VALUE;for(let C=c;C<u;++C)for(let w=0;w<o;++w)Da.computePosition(t,i,n.st,C,w,A,b),p[m++]=A.x,p[m++]=A.y,p[m++]=A.z,n.st&&(g[y++]=b.x,g[y++]=b.y,x=Math.min(x,b.x),T=Math.min(T,b.y),E=Math.max(E,b.x),v=Math.max(v,b.y));if(s&&(Da.computePosition(t,i,n.st,0,0,A,b),p[m++]=A.x,p[m++]=A.y,p[m++]=A.z,n.st&&(g[y++]=b.x,g[y++]=b.y,x=b.x,T=b.y,E=b.x,v=b.y)),a&&(Da.computePosition(t,i,n.st,r-1,0,A,b),p[m++]=A.x,p[m++]=A.y,p[m]=A.z,n.st&&(g[y++]=b.x,g[y]=b.y,x=Math.min(x,b.x),T=Math.min(T,b.y),E=Math.max(E,b.x),v=Math.max(v,b.y))),n.st&&(x<0||T<0||E>1||v>1))for(let C=0;C<g.length;C+=2)g[C]=(g[C]-x)/(E-x),g[C+1]=(g[C+1]-T)/(v-T);let S=VKe(p,n,i,t.tangentRotationMatrix),I=6*(o-1)*(f-1);s&&(I+=3*(o-1)),a&&(I+=3*(o-1));let R=je.createTypedArray(d,I),O=0,L=0,_;for(_=0;_<f-1;++_){for(let C=0;C<o-1;++C){let w=O,D=w+o,N=D+1,F=w+1;R[L++]=w,R[L++]=D,R[L++]=F,R[L++]=F,R[L++]=D,R[L++]=N,++O}++O}if(s||a){let C=d-1,w=d-1;s&&a&&(C=d-2);let D,N;if(O=0,s)for(_=0;_<o-1;_++)D=O,N=D+1,R[L++]=C,R[L++]=D,R[L++]=N,++O;if(a)for(O=(f-1)*o,_=0;_<o-1;_++)D=O,N=D+1,R[L++]=D,R[L++]=w,R[L++]=N,++O}return S.indices=R,n.st&&(S.attributes.st=new Ne({componentDatatype:Y.FLOAT,componentsPerAttribute:2,values:g})),S}function XC(e,t,n,i,r){return e[t++]=i[n],e[t++]=i[n+1],e[t++]=i[n+2],e[t++]=r[n],e[t++]=r[n+1],e[t]=r[n+2],e}function KC(e,t,n,i){return e[t++]=i[n],e[t++]=i[n+1],e[t++]=i[n],e[t]=i[n+1],e}var o$=new Be;function HKe(e,t){let n=e._shadowVolume,i=e._offsetAttribute,r=e._vertexFormat,o=e._extrudedHeight,s=e._surfaceHeight,a=e._ellipsoid,c=t.height,u=t.width,f;if(n){let Pe=Be.clone(r,o$);Pe.normal=!0,e._vertexFormat=Pe}let d=Mge(e,t);n&&(e._vertexFormat=r);let p=mi.scaleToGeodeticHeight(d.attributes.position.values,s,a,!1);p=new Float64Array(p);let g=p.length,m=g*2,y=new Float64Array(m);y.set(p);let A=mi.scaleToGeodeticHeight(d.attributes.position.values,o,a);y.set(A,g),d.attributes.position.values=y;let b=r.normal?new Float32Array(m):void 0,x=r.tangent?new Float32Array(m):void 0,T=r.bitangent?new Float32Array(m):void 0,E=r.st?new Float32Array(m/3*2):void 0,v,S;if(r.normal){for(S=d.attributes.normal.values,b.set(S),f=0;f<g;f++)S[f]=-S[f];b.set(S,g),d.attributes.normal.values=b}if(n){S=d.attributes.normal.values,r.normal||(d.attributes.normal=void 0);let Pe=new Float32Array(m);for(f=0;f<g;f++)S[f]=-S[f];Pe.set(S,g),d.attributes.extrudeDirection=new Ne({componentDatatype:Y.FLOAT,componentsPerAttribute:3,values:Pe})}let I,R=l(i);if(R){let Pe=g/3*2,qe=new Uint8Array(Pe);i===pn.TOP?qe=qe.fill(1,0,Pe/2):(I=i===pn.NONE?0:1,qe=qe.fill(I)),d.attributes.applyOffset=new Ne({componentDatatype:Y.UNSIGNED_BYTE,componentsPerAttribute:1,values:qe})}if(r.tangent){let Pe=d.attributes.tangent.values;for(x.set(Pe),f=0;f<g;f++)Pe[f]=-Pe[f];x.set(Pe,g),d.attributes.tangent.values=x}if(r.bitangent){let Pe=d.attributes.bitangent.values;T.set(Pe),T.set(Pe,g),d.attributes.bitangent.values=T}r.st&&(v=d.attributes.st.values,E.set(v),E.set(v,g/3*2),d.attributes.st.values=E);let O=d.indices,L=O.length,_=g/3,C=je.createTypedArray(m/3,L*2);for(C.set(O),f=0;f<L;f+=3)C[f+L]=O[f+2]+_,C[f+1+L]=O[f+1]+_,C[f+2+L]=O[f]+_;d.indices=C;let w=t.northCap,D=t.southCap,N=c,F=2,V=0,B=4,j=4;w&&(F-=1,N-=1,V+=1,B-=2,j-=1),D&&(F-=1,N-=1,V+=1,B-=2,j-=1),V+=F*u+2*N-B;let k=(V+j)*2,G=new Float64Array(k*3),q=n?new Float32Array(k*3):void 0,Q=R?new Uint8Array(k):void 0,W=r.st?new Float32Array(k*2):void 0,J=i===pn.TOP;R&&!J&&(I=i===pn.ALL?1:0,Q=Q.fill(I));let Z=0,ae=0,Ae=0,fe=0,xe=u*N,ge;for(f=0;f<xe;f+=u)ge=f*3,G=XC(G,Z,ge,p,A),Z+=6,r.st&&(W=KC(W,ae,f*2,v),ae+=4),n&&(Ae+=3,q[Ae++]=S[ge],q[Ae++]=S[ge+1],q[Ae++]=S[ge+2]),J&&(Q[fe++]=1,fe+=1);if(D){let Pe=w?xe+1:xe;for(ge=Pe*3,f=0;f<2;f++)G=XC(G,Z,ge,p,A),Z+=6,r.st&&(W=KC(W,ae,Pe*2,v),ae+=4),n&&(Ae+=3,q[Ae++]=S[ge],q[Ae++]=S[ge+1],q[Ae++]=S[ge+2]),J&&(Q[fe++]=1,fe+=1)}else for(f=xe-u;f<xe;f++)ge=f*3,G=XC(G,Z,ge,p,A),Z+=6,r.st&&(W=KC(W,ae,f*2,v),ae+=4),n&&(Ae+=3,q[Ae++]=S[ge],q[Ae++]=S[ge+1],q[Ae++]=S[ge+2]),J&&(Q[fe++]=1,fe+=1);for(f=xe-1;f>0;f-=u)ge=f*3,G=XC(G,Z,ge,p,A),Z+=6,r.st&&(W=KC(W,ae,f*2,v),ae+=4),n&&(Ae+=3,q[Ae++]=S[ge],q[Ae++]=S[ge+1],q[Ae++]=S[ge+2]),J&&(Q[fe++]=1,fe+=1);if(w){let Pe=xe;for(ge=Pe*3,f=0;f<2;f++)G=XC(G,Z,ge,p,A),Z+=6,r.st&&(W=KC(W,ae,Pe*2,v),ae+=4),n&&(Ae+=3,q[Ae++]=S[ge],q[Ae++]=S[ge+1],q[Ae++]=S[ge+2]),J&&(Q[fe++]=1,fe+=1)}else for(f=u-1;f>=0;f--)ge=f*3,G=XC(G,Z,ge,p,A),Z+=6,r.st&&(W=KC(W,ae,f*2,v),ae+=4),n&&(Ae+=3,q[Ae++]=S[ge],q[Ae++]=S[ge+1],q[Ae++]=S[ge+2]),J&&(Q[fe++]=1,fe+=1);let we=jKe(G,r,a);r.st&&(we.attributes.st=new Ne({componentDatatype:Y.FLOAT,componentsPerAttribute:2,values:W})),n&&(we.attributes.extrudeDirection=new Ne({componentDatatype:Y.FLOAT,componentsPerAttribute:3,values:q})),R&&(we.attributes.applyOffset=new Ne({componentDatatype:Y.UNSIGNED_BYTE,componentsPerAttribute:1,values:Q}));let ve=je.createTypedArray(k,V*6),Re,Qe,He,Ye;g=G.length/3;let Ke=0;for(f=0;f<g-1;f+=2){Re=f,Ye=(Re+2)%g;let Pe=h.fromArray(G,Re*3,r$),qe=h.fromArray(G,Ye*3,Oge);h.equalsEpsilon(Pe,qe,P.EPSILON10)||(Qe=(Re+1)%g,He=(Qe+2)%g,ve[Ke++]=Re,ve[Ke++]=Qe,ve[Ke++]=Ye,ve[Ke++]=Ye,ve[Ke++]=Qe,ve[Ke++]=He)}return we.indices=ve,we=Wn.combineInstances([new Bt({geometry:d}),new Bt({geometry:we})]),we[0]}var GKe=[new h,new h,new h,new h],Nge=new he,WKe=new he;function s$(e,t,n,i,r){if(n===0)return ie.clone(e,r);let o=Da.computeOptions(e,t,n,0,Dge,Nge),s=o.height,a=o.width,c=GKe;return Da.computePosition(o,i,!1,0,0,c[0]),Da.computePosition(o,i,!1,0,a-1,c[1]),Da.computePosition(o,i,!1,s-1,0,c[2]),Da.computePosition(o,i,!1,s-1,a-1,c[3]),ie.fromCartesianArray(c,i,r)}function pp(e){e=e??H.EMPTY_OBJECT;let t=e.rectangle,n=e.height??0,i=e.extrudedHeight??n;this._rectangle=ie.clone(t),this._granularity=e.granularity??P.RADIANS_PER_DEGREE,this._ellipsoid=ee.clone(e.ellipsoid??ee.default),this._surfaceHeight=Math.max(n,i),this._rotation=e.rotation??0,this._stRotation=e.stRotation??0,this._vertexFormat=Be.clone(e.vertexFormat??Be.DEFAULT),this._extrudedHeight=Math.min(n,i),this._shadowVolume=e.shadowVolume??!1,this._workerName="createRectangleGeometry",this._offsetAttribute=e.offsetAttribute,this._rotatedRectangle=void 0,this._textureCoordinateRotationPoints=void 0}pp.packedLength=ie.packedLength+ee.packedLength+Be.packedLength+7;pp.pack=function(e,t,n){return n=n??0,ie.pack(e._rectangle,t,n),n+=ie.packedLength,ee.pack(e._ellipsoid,t,n),n+=ee.packedLength,Be.pack(e._vertexFormat,t,n),n+=Be.packedLength,t[n++]=e._granularity,t[n++]=e._surfaceHeight,t[n++]=e._rotation,t[n++]=e._stRotation,t[n++]=e._extrudedHeight,t[n++]=e._shadowVolume?1:0,t[n]=e._offsetAttribute??-1,t};var Lge=new ie,Fge=ee.clone(ee.UNIT_SPHERE),uy={rectangle:Lge,ellipsoid:Fge,vertexFormat:o$,granularity:void 0,height:void 0,rotation:void 0,stRotation:void 0,extrudedHeight:void 0,shadowVolume:void 0,offsetAttribute:void 0};pp.unpack=function(e,t,n){t=t??0;let i=ie.unpack(e,t,Lge);t+=ie.packedLength;let r=ee.unpack(e,t,Fge);t+=ee.packedLength;let o=Be.unpack(e,t,o$);t+=Be.packedLength;let s=e[t++],a=e[t++],c=e[t++],u=e[t++],f=e[t++],d=e[t++]===1,p=e[t];return l(n)?(n._rectangle=ie.clone(i,n._rectangle),n._ellipsoid=ee.clone(r,n._ellipsoid),n._vertexFormat=Be.clone(o,n._vertexFormat),n._granularity=s,n._surfaceHeight=a,n._rotation=c,n._stRotation=u,n._extrudedHeight=f,n._shadowVolume=d,n._offsetAttribute=p===-1?void 0:p,n):(uy.granularity=s,uy.height=a,uy.rotation=c,uy.stRotation=u,uy.extrudedHeight=f,uy.shadowVolume=d,uy.offsetAttribute=p===-1?void 0:p,new pp(uy))};pp.computeRectangle=function(e,t){e=e??H.EMPTY_OBJECT;let n=e.rectangle,i=e.granularity??P.RADIANS_PER_DEGREE,r=e.ellipsoid??ee.default,o=e.rotation??0;return s$(n,i,o,r,t)};var qKe=new $,vge=new Le,YKe=new he;pp.createGeometry=function(e){if(P.equalsEpsilon(e._rectangle.north,e._rectangle.south,P.EPSILON10)||P.equalsEpsilon(e._rectangle.east,e._rectangle.west,P.EPSILON10))return;let t=e._rectangle,n=e._ellipsoid,i=e._rotation,r=e._stRotation,o=e._vertexFormat,s=Da.computeOptions(t,e._granularity,i,r,Dge,Nge,WKe),a=qKe;if(r!==0||i!==0){let g=ie.center(t,YKe),m=n.geodeticSurfaceNormalCartographic(g,r$);Le.fromAxisAngle(m,-r,vge),$.fromQuaternion(vge,a)}else $.clone($.IDENTITY,a);let c=e._surfaceHeight,u=e._extrudedHeight,f=!P.equalsEpsilon(c,u,0,P.EPSILON2);s.lonScalar=1/e._rectangle.width,s.latScalar=1/e._rectangle.height,s.tangentRotationMatrix=a;let d,p;if(t=e._rectangle,f){d=HKe(e,s);let g=ue.fromRectangle3D(t,n,c,zKe),m=ue.fromRectangle3D(t,n,u,UKe);p=ue.union(g,m)}else{if(d=Mge(e,s),d.attributes.position.values=mi.scaleToGeodeticHeight(d.attributes.position.values,c,n,!1),l(e._offsetAttribute)){let g=d.attributes.position.values.length,m=e._offsetAttribute===pn.NONE?0:1,y=new Uint8Array(g/3).fill(m);d.attributes.applyOffset=new Ne({componentDatatype:Y.UNSIGNED_BYTE,componentsPerAttribute:1,values:y})}p=ue.fromRectangle3D(t,n,c)}return o.position||delete d.attributes.position,new wt({attributes:d.attributes,indices:d.indices,primitiveType:d.primitiveType,boundingSphere:p,offsetAttribute:e._offsetAttribute})};pp.createShadowVolume=function(e,t,n){let i=e._granularity,r=e._ellipsoid,o=t(i,r),s=n(i,r);return new pp({rectangle:e._rectangle,rotation:e._rotation,ellipsoid:r,stRotation:e._stRotation,granularity:i,extrudedHeight:s,height:o,vertexFormat:Be.POSITION_ONLY,shadowVolume:!0})};var Sge=new ie,XKe=[new U,new U,new U],KKe=new $i,$Ke=new he;function JKe(e){if(e._stRotation===0)return[0,0,0,1,1,0];let t=ie.clone(e._rectangle,Sge),n=e._granularity,i=e._ellipsoid,r=e._rotation-e._stRotation,o=s$(t,n,r,i,Sge),s=XKe;s[0].x=o.west,s[0].y=o.south,s[1].x=o.west,s[1].y=o.north,s[2].x=o.east,s[2].y=o.south;let a=e.rectangle,c=$i.fromRotation(e._stRotation,KKe),u=ie.center(a,$Ke);for(let m=0;m<3;++m){let y=s[m];y.x-=u.longitude,y.y-=u.latitude,$i.multiplyByVector(c,y,y),y.x+=u.longitude,y.y+=u.latitude,y.x=(y.x-a.west)/a.width,y.y=(y.y-a.south)/a.height}let f=s[0],d=s[1],p=s[2],g=new Array(6);return U.pack(f,g),U.pack(d,g,2),U.pack(p,g,4),g}Object.defineProperties(pp.prototype,{rectangle:{get:function(){return l(this._rotatedRectangle)||(this._rotatedRectangle=s$(this._rectangle,this._granularity,this._rotation,this._ellipsoid)),this._rotatedRectangle}},textureCoordinateRotationPoints:{get:function(){return l(this._textureCoordinateRotationPoints)||(this._textureCoordinateRotationPoints=JKe(this)),this._textureCoordinateRotationPoints}}});var $C=pp;var ZKe=new ue,QKe=new ue,e$e=new h,t$e=new ie;function Bge(e,t){let n=e._ellipsoid,i=t.height,r=t.width,o=t.northCap,s=t.southCap,a=i,c=2,u=0,f=4;o&&(c-=1,a-=1,u+=1,f-=2),s&&(c-=1,a-=1,u+=1,f-=2),u+=c*r+2*a-f;let d=new Float64Array(u*3),p=0,g=0,m,y=e$e;if(o)Da.computePosition(t,n,!1,g,0,y),d[p++]=y.x,d[p++]=y.y,d[p++]=y.z;else for(m=0;m<r;m++)Da.computePosition(t,n,!1,g,m,y),d[p++]=y.x,d[p++]=y.y,d[p++]=y.z;for(m=r-1,g=1;g<i;g++)Da.computePosition(t,n,!1,g,m,y),d[p++]=y.x,d[p++]=y.y,d[p++]=y.z;if(g=i-1,!s)for(m=r-2;m>=0;m--)Da.computePosition(t,n,!1,g,m,y),d[p++]=y.x,d[p++]=y.y,d[p++]=y.z;for(m=0,g=i-2;g>0;g--)Da.computePosition(t,n,!1,g,m,y),d[p++]=y.x,d[p++]=y.y,d[p++]=y.z;let A=d.length/3*2,b=je.createTypedArray(d.length/3,A),x=0;for(let E=0;E<d.length/3-1;E++)b[x++]=E,b[x++]=E+1;b[x++]=d.length/3-1,b[x]=0;let T=new wt({attributes:new En,primitiveType:Oe.LINES});return T.attributes.position=new Ne({componentDatatype:Y.DOUBLE,componentsPerAttribute:3,values:d}),T.indices=b,T}function n$e(e,t){let n=e._surfaceHeight,i=e._extrudedHeight,r=e._ellipsoid,o=Bge(e,t),s=t.height,a=t.width,c=mi.scaleToGeodeticHeight(o.attributes.position.values,n,r,!1),u=c.length,f=new Float64Array(u*2);f.set(c);let d=mi.scaleToGeodeticHeight(o.attributes.position.values,i,r);f.set(d,u),o.attributes.position.values=f;let p=t.northCap,g=t.southCap,m=4;p&&(m-=1),g&&(m-=1);let y=(f.length/3+m)*2,A=je.createTypedArray(f.length/3,y);u=f.length/6;let b=0;for(let T=0;T<u-1;T++)A[b++]=T,A[b++]=T+1,A[b++]=T+u,A[b++]=T+u+1;A[b++]=u-1,A[b++]=0,A[b++]=u+u-1,A[b++]=u,A[b++]=0,A[b++]=u;let x;if(p)x=s-1;else{let T=a-1;A[b++]=T,A[b++]=T+u,x=a+s-2}if(A[b++]=x,A[b++]=x+u,!g){let T=a+x-1;A[b++]=T,A[b]=T+u}return o.indices=A,o}function ZC(e){e=e??H.EMPTY_OBJECT;let t=e.rectangle,n=e.granularity??P.RADIANS_PER_DEGREE,i=e.ellipsoid??ee.default,r=e.rotation??0,o=e.height??0,s=e.extrudedHeight??o;this._rectangle=ie.clone(t),this._granularity=n,this._ellipsoid=i,this._surfaceHeight=Math.max(o,s),this._rotation=r,this._extrudedHeight=Math.min(o,s),this._offsetAttribute=e.offsetAttribute,this._workerName="createRectangleOutlineGeometry"}ZC.packedLength=ie.packedLength+ee.packedLength+5;ZC.pack=function(e,t,n){return n=n??0,ie.pack(e._rectangle,t,n),n+=ie.packedLength,ee.pack(e._ellipsoid,t,n),n+=ee.packedLength,t[n++]=e._granularity,t[n++]=e._surfaceHeight,t[n++]=e._rotation,t[n++]=e._extrudedHeight,t[n]=e._offsetAttribute??-1,t};var kge=new ie,Uge=ee.clone(ee.UNIT_SPHERE),JC={rectangle:kge,ellipsoid:Uge,granularity:void 0,height:void 0,rotation:void 0,extrudedHeight:void 0,offsetAttribute:void 0};ZC.unpack=function(e,t,n){t=t??0;let i=ie.unpack(e,t,kge);t+=ie.packedLength;let r=ee.unpack(e,t,Uge);t+=ee.packedLength;let o=e[t++],s=e[t++],a=e[t++],c=e[t++],u=e[t];return l(n)?(n._rectangle=ie.clone(i,n._rectangle),n._ellipsoid=ee.clone(r,n._ellipsoid),n._surfaceHeight=s,n._rotation=a,n._extrudedHeight=c,n._offsetAttribute=u===-1?void 0:u,n):(JC.granularity=o,JC.height=s,JC.rotation=a,JC.extrudedHeight=c,JC.offsetAttribute=u===-1?void 0:u,new ZC(JC))};var i$e=new he;ZC.createGeometry=function(e){let t=e._rectangle,n=e._ellipsoid,i=Da.computeOptions(t,e._granularity,e._rotation,0,t$e,i$e),r,o;if(P.equalsEpsilon(t.north,t.south,P.EPSILON10)||P.equalsEpsilon(t.east,t.west,P.EPSILON10))return;let s=e._surfaceHeight,a=e._extrudedHeight,c=!P.equalsEpsilon(s,a,0,P.EPSILON2),u;if(c){if(r=n$e(e,i),l(e._offsetAttribute)){let p=r.attributes.position.values.length/3,g=new Uint8Array(p);e._offsetAttribute===pn.TOP?g=g.fill(1,0,p/2):(u=e._offsetAttribute===pn.NONE?0:1,g=g.fill(u)),r.attributes.applyOffset=new Ne({componentDatatype:Y.UNSIGNED_BYTE,componentsPerAttribute:1,values:g})}let f=ue.fromRectangle3D(t,n,s,QKe),d=ue.fromRectangle3D(t,n,a,ZKe);o=ue.union(f,d)}else{if(r=Bge(e,i),r.attributes.position.values=mi.scaleToGeodeticHeight(r.attributes.position.values,s,n,!1),l(e._offsetAttribute)){let f=r.attributes.position.values.length;u=e._offsetAttribute===pn.NONE?0:1;let d=new Uint8Array(f/3).fill(u);r.attributes.applyOffset=new Ne({componentDatatype:Y.UNSIGNED_BYTE,componentsPerAttribute:1,values:d})}o=ue.fromRectangle3D(t,n,s)}return new wt({attributes:r.attributes,indices:r.indices,primitiveType:Oe.LINES,boundingSphere:o,offsetAttribute:e._offsetAttribute})};var QC=ZC;var zge=new z,Vge=h.ZERO,jge=new h,Hge=new ie,r$e=new ie,o$e=new he;function s$e(e){this.id=e,this.vertexFormat=void 0,this.rectangle=void 0,this.height=void 0,this.extrudedHeight=void 0,this.granularity=void 0,this.stRotation=void 0,this.rotation=void 0,this.offsetAttribute=void 0}function Dh(e,t){oi.call(this,{entity:e,scene:t,geometryOptions:new s$e(e),geometryPropertyName:"rectangle",observedPropertyNames:["availability","rectangle"]}),this._onEntityPropertyChanged(e,"rectangle",e.rectangle,void 0)}l(Object.create)&&(Dh.prototype=Object.create(oi.prototype),Dh.prototype.constructor=Dh);Dh.prototype.createFillGeometryInstance=function(e){let t=this._entity,n=t.isAvailable(e),i={show:new Dn(n&&t.isShowing&&this._showProperty.getValue(e)&&this._fillProperty.getValue(e)),distanceDisplayCondition:ti.fromDistanceDisplayCondition(this._distanceDisplayConditionProperty.getValue(e)),offset:void 0,color:void 0};if(this._materialProperty instanceof Kt){let r;l(this._materialProperty.color)&&(this._materialProperty.color.isConstant||n)&&(r=this._materialProperty.color.getValue(e,zge)),l(r)||(r=z.WHITE),i.color=Jt.fromColor(r)}return l(this._options.offsetAttribute)&&(i.offset=Er.fromCartesian3(X.getValueOrDefault(this._terrainOffsetProperty,e,Vge,jge))),new Bt({id:t,geometry:new $C(this._options),attributes:i})};Dh.prototype.createOutlineGeometryInstance=function(e){let t=this._entity,n=t.isAvailable(e),i=X.getValueOrDefault(this._outlineColorProperty,e,z.BLACK,zge),r=this._distanceDisplayConditionProperty.getValue(e),o={show:new Dn(n&&t.isShowing&&this._showProperty.getValue(e)&&this._showOutlineProperty.getValue(e)),color:Jt.fromColor(i),distanceDisplayCondition:ti.fromDistanceDisplayCondition(r),offset:void 0};return l(this._options.offsetAttribute)&&(o.offset=Er.fromCartesian3(X.getValueOrDefault(this._terrainOffsetProperty,e,Vge,jge))),new Bt({id:t,geometry:new QC(this._options),attributes:o})};Dh.prototype._computeCenter=function(e,t){let n=X.getValueOrUndefined(this._entity.rectangle.coordinates,e,r$e);if(!l(n))return;let i=ie.center(n,o$e);return he.toCartesian(i,ee.default,t)};Dh.prototype._isHidden=function(e,t){return!l(t.coordinates)||Mi.prototype._isHidden.call(this,e,t)};Dh.prototype._isDynamic=function(e,t){return!t.coordinates.isConstant||!X.isConstant(t.height)||!X.isConstant(t.extrudedHeight)||!X.isConstant(t.granularity)||!X.isConstant(t.stRotation)||!X.isConstant(t.rotation)||!X.isConstant(t.outlineWidth)||!X.isConstant(t.zIndex)||this._onTerrain&&!X.isConstant(this._materialProperty)&&!(this._materialProperty instanceof Kt)};Dh.prototype._setStaticOptions=function(e,t){let n=this._materialProperty instanceof Kt,i=X.getValueOrUndefined(t.height,it.MINIMUM_VALUE),r=X.getValueOrDefault(t.heightReference,it.MINIMUM_VALUE,We.NONE),o=X.getValueOrUndefined(t.extrudedHeight,it.MINIMUM_VALUE),s=X.getValueOrDefault(t.extrudedHeightReference,it.MINIMUM_VALUE,We.NONE);l(o)&&!l(i)&&(i=0);let a=this._options;a.vertexFormat=n?An.VERTEX_FORMAT:Cr.MaterialSupport.TEXTURED.vertexFormat,a.rectangle=t.coordinates.getValue(it.MINIMUM_VALUE,a.rectangle),a.granularity=X.getValueOrUndefined(t.granularity,it.MINIMUM_VALUE),a.stRotation=X.getValueOrUndefined(t.stRotation,it.MINIMUM_VALUE),a.rotation=X.getValueOrUndefined(t.rotation,it.MINIMUM_VALUE),a.offsetAttribute=oi.computeGeometryOffsetAttribute(i,r,o,s),a.height=oi.getGeometryHeight(i,r),o=oi.getGeometryExtrudedHeight(o,s),o===oi.CLAMP_TO_GROUND&&(o=Ni.getMinimumMaximumHeights($C.computeRectangle(a,Hge)).minimumTerrainHeight),a.extrudedHeight=o};Dh.DynamicGeometryUpdater=ev;function ev(e,t,n){Oi.call(this,e,t,n)}l(Object.create)&&(ev.prototype=Object.create(Oi.prototype),ev.prototype.constructor=ev);ev.prototype._isHidden=function(e,t,n){return!l(this._options.rectangle)||Oi.prototype._isHidden.call(this,e,t,n)};ev.prototype._setOptions=function(e,t,n){let i=this._options,r=X.getValueOrUndefined(t.height,n),o=X.getValueOrDefault(t.heightReference,n,We.NONE),s=X.getValueOrUndefined(t.extrudedHeight,n),a=X.getValueOrDefault(t.extrudedHeightReference,n,We.NONE);l(s)&&!l(r)&&(r=0),i.rectangle=X.getValueOrUndefined(t.coordinates,n,i.rectangle),i.granularity=X.getValueOrUndefined(t.granularity,n),i.stRotation=X.getValueOrUndefined(t.stRotation,n),i.rotation=X.getValueOrUndefined(t.rotation,n),i.offsetAttribute=oi.computeGeometryOffsetAttribute(r,o,s,a),i.height=oi.getGeometryHeight(r,o),s=oi.getGeometryExtrudedHeight(s,a),s===oi.CLAMP_TO_GROUND&&(s=Ni.getMinimumMaximumHeights($C.computeRectangle(i,Hge)).minimumTerrainHeight),i.extrudedHeight=s};var eU=Dh;var Gge={};function a$e(e,t){return P.equalsEpsilon(e.latitude,t.latitude,P.EPSILON10)&&P.equalsEpsilon(e.longitude,t.longitude,P.EPSILON10)}var c$e=new he,l$e=new he;function u$e(e,t,n,i){t=Lr(t,h.equalsEpsilon);let r=t.length;if(r<2)return;let o=l(i),s=l(n),a=new Array(r),c=new Array(r),u=new Array(r),f=t[0];a[0]=f;let d=e.cartesianToCartographic(f,c$e);s&&(d.height=n[0]),c[0]=d.height,o?u[0]=i[0]:u[0]=0;let p=c[0],g=u[0],m=p===g,y=1;for(let A=1;A<r;++A){let b=t[A],x=e.cartesianToCartographic(b,l$e);s&&(x.height=n[A]),m=m&&x.height===0,a$e(d,x)?d.height<x.height&&(c[y-1]=x.height):(a[y]=b,c[y]=x.height,o?u[y]=i[A]:u[y]=0,m=m&&c[y]===u[y],he.clone(x,d),++y)}if(!(m||y<2))return a.length=y,c.length=y,u.length=y,{positions:a,topHeights:c,bottomHeights:u}}var f$e=new Array(2),d$e=new Array(2),h$e={positions:void 0,height:void 0,granularity:void 0,ellipsoid:void 0};Gge.computePositions=function(e,t,n,i,r,o){let s=u$e(e,t,n,i);if(!l(s))return;t=s.positions,n=s.topHeights,i=s.bottomHeights;let a=t.length,c=a-2,u,f,d=P.chordLength(r,e.maximumRadius),p=h$e;if(p.minDistance=d,p.ellipsoid=e,o){let g=0,m;for(m=0;m<a-1;m++)g+=ar.numberOfPoints(t[m],t[m+1],d)+1;u=new Float64Array(g*3),f=new Float64Array(g*3);let y=f$e,A=d$e;p.positions=y,p.height=A;let b=0;for(m=0;m<a-1;m++){y[0]=t[m],y[1]=t[m+1],A[0]=n[m],A[1]=n[m+1];let x=ar.generateArc(p);u.set(x,b),A[0]=i[m],A[1]=i[m+1],f.set(ar.generateArc(p),b),b+=x.length}}else p.positions=t,p.height=n,u=new Float64Array(ar.generateArc(p)),p.height=i,f=new Float64Array(ar.generateArc(p));return{bottomPositions:f,topPositions:u,numCorners:c}};var tv=Gge;var a$=new h,tU=new h,m$e=new h,Wge=new h,p$e=new h,g$e=new h,_$e=new h;function ix(e){e=e??H.EMPTY_OBJECT;let t=e.positions,n=e.maximumHeights,i=e.minimumHeights,r=e.vertexFormat??Be.DEFAULT,o=e.granularity??P.RADIANS_PER_DEGREE,s=e.ellipsoid??ee.default;this._positions=t,this._minimumHeights=i,this._maximumHeights=n,this._vertexFormat=Be.clone(r),this._granularity=o,this._ellipsoid=ee.clone(s),this._workerName="createWallGeometry";let a=1+t.length*h.packedLength+2;l(i)&&(a+=i.length),l(n)&&(a+=n.length),this.packedLength=a+ee.packedLength+Be.packedLength+1}ix.pack=function(e,t,n){n=n??0;let i,r=e._positions,o=r.length;for(t[n++]=o,i=0;i<o;++i,n+=h.packedLength)h.pack(r[i],t,n);let s=e._minimumHeights;if(o=l(s)?s.length:0,t[n++]=o,l(s))for(i=0;i<o;++i)t[n++]=s[i];let a=e._maximumHeights;if(o=l(a)?a.length:0,t[n++]=o,l(a))for(i=0;i<o;++i)t[n++]=a[i];return ee.pack(e._ellipsoid,t,n),n+=ee.packedLength,Be.pack(e._vertexFormat,t,n),n+=Be.packedLength,t[n]=e._granularity,t};var qge=ee.clone(ee.UNIT_SPHERE),Yge=new Be,TD={positions:void 0,minimumHeights:void 0,maximumHeights:void 0,ellipsoid:qge,vertexFormat:Yge,granularity:void 0};ix.unpack=function(e,t,n){t=t??0;let i,r=e[t++],o=new Array(r);for(i=0;i<r;++i,t+=h.packedLength)o[i]=h.unpack(e,t);r=e[t++];let s;if(r>0)for(s=new Array(r),i=0;i<r;++i)s[i]=e[t++];r=e[t++];let a;if(r>0)for(a=new Array(r),i=0;i<r;++i)a[i]=e[t++];let c=ee.unpack(e,t,qge);t+=ee.packedLength;let u=Be.unpack(e,t,Yge);t+=Be.packedLength;let f=e[t];return l(n)?(n._positions=o,n._minimumHeights=s,n._maximumHeights=a,n._ellipsoid=ee.clone(c,n._ellipsoid),n._vertexFormat=Be.clone(u,n._vertexFormat),n._granularity=f,n):(TD.positions=o,TD.minimumHeights=s,TD.maximumHeights=a,TD.granularity=f,new ix(TD))};ix.fromConstantHeights=function(e){e=e??H.EMPTY_OBJECT;let t=e.positions,n,i,r=e.minimumHeight,o=e.maximumHeight,s=l(r),a=l(o);if(s||a){let u=t.length;n=s?new Array(u):void 0,i=a?new Array(u):void 0;for(let f=0;f<u;++f)s&&(n[f]=r),a&&(i[f]=o)}let c={positions:t,maximumHeights:i,minimumHeights:n,ellipsoid:e.ellipsoid,vertexFormat:e.vertexFormat};return new ix(c)};ix.createGeometry=function(e){let t=e._positions,n=e._minimumHeights,i=e._maximumHeights,r=e._vertexFormat,o=e._granularity,s=e._ellipsoid,a=tv.computePositions(s,t,i,n,o,!0);if(!l(a))return;let c=a.bottomPositions,u=a.topPositions,f=a.numCorners,d=u.length,p=d*2,g=r.position?new Float64Array(p):void 0,m=r.normal?new Float32Array(p):void 0,y=r.tangent?new Float32Array(p):void 0,A=r.bitangent?new Float32Array(p):void 0,b=r.st?new Float32Array(p/3*2):void 0,x=0,T=0,E=0,v=0,S=0,I=_$e,R=g$e,O=p$e,L=!0;d/=3;let _,C=0,w=1/(d-f-1);for(_=0;_<d;++_){let B=_*3,j=h.fromArray(u,B,a$),k=h.fromArray(c,B,tU);if(r.position&&(g[x++]=k.x,g[x++]=k.y,g[x++]=k.z,g[x++]=j.x,g[x++]=j.y,g[x++]=j.z),r.st&&(b[S++]=C,b[S++]=0,b[S++]=C,b[S++]=1),r.normal||r.tangent||r.bitangent){let G=h.clone(h.ZERO,Wge),q=h.subtract(j,s.geodeticSurfaceNormal(j,tU),tU);if(_+1<d&&(G=h.fromArray(u,B+3,Wge)),L){let Q=h.subtract(G,j,m$e),W=h.subtract(q,j,a$);I=h.normalize(h.cross(W,Q,I),I),L=!1}h.equalsEpsilon(j,G,P.EPSILON10)?L=!0:(C+=w,r.tangent&&(R=h.normalize(h.subtract(G,j,R),R)),r.bitangent&&(O=h.normalize(h.cross(I,R,O),O))),r.normal&&(m[T++]=I.x,m[T++]=I.y,m[T++]=I.z,m[T++]=I.x,m[T++]=I.y,m[T++]=I.z),r.tangent&&(y[v++]=R.x,y[v++]=R.y,y[v++]=R.z,y[v++]=R.x,y[v++]=R.y,y[v++]=R.z),r.bitangent&&(A[E++]=O.x,A[E++]=O.y,A[E++]=O.z,A[E++]=O.x,A[E++]=O.y,A[E++]=O.z)}}let D=new En;r.position&&(D.position=new Ne({componentDatatype:Y.DOUBLE,componentsPerAttribute:3,values:g})),r.normal&&(D.normal=new Ne({componentDatatype:Y.FLOAT,componentsPerAttribute:3,values:m})),r.tangent&&(D.tangent=new Ne({componentDatatype:Y.FLOAT,componentsPerAttribute:3,values:y})),r.bitangent&&(D.bitangent=new Ne({componentDatatype:Y.FLOAT,componentsPerAttribute:3,values:A})),r.st&&(D.st=new Ne({componentDatatype:Y.FLOAT,componentsPerAttribute:2,values:b}));let N=p/3;p-=6*(f+1);let F=je.createTypedArray(N,p),V=0;for(_=0;_<N-2;_+=2){let B=_,j=_+2,k=h.fromArray(g,B*3,a$),G=h.fromArray(g,j*3,tU);if(h.equalsEpsilon(k,G,P.EPSILON10))continue;let q=_+1,Q=_+3;F[V++]=q,F[V++]=B,F[V++]=Q,F[V++]=Q,F[V++]=B,F[V++]=j}return new wt({attributes:D,indices:F,primitiveType:Oe.TRIANGLES,boundingSphere:ue.fromVertices(g)})};var nU=ix;var Xge=new h,Kge=new h;function rx(e){e=e??H.EMPTY_OBJECT;let t=e.positions,n=e.maximumHeights,i=e.minimumHeights,r=e.granularity??P.RADIANS_PER_DEGREE,o=e.ellipsoid??ee.default;this._positions=t,this._minimumHeights=i,this._maximumHeights=n,this._granularity=r,this._ellipsoid=ee.clone(o),this._workerName="createWallOutlineGeometry";let s=1+t.length*h.packedLength+2;l(i)&&(s+=i.length),l(n)&&(s+=n.length),this.packedLength=s+ee.packedLength+1}rx.pack=function(e,t,n){n=n??0;let i,r=e._positions,o=r.length;for(t[n++]=o,i=0;i<o;++i,n+=h.packedLength)h.pack(r[i],t,n);let s=e._minimumHeights;if(o=l(s)?s.length:0,t[n++]=o,l(s))for(i=0;i<o;++i)t[n++]=s[i];let a=e._maximumHeights;if(o=l(a)?a.length:0,t[n++]=o,l(a))for(i=0;i<o;++i)t[n++]=a[i];return ee.pack(e._ellipsoid,t,n),n+=ee.packedLength,t[n]=e._granularity,t};var $ge=ee.clone(ee.UNIT_SPHERE),ED={positions:void 0,minimumHeights:void 0,maximumHeights:void 0,ellipsoid:$ge,granularity:void 0};rx.unpack=function(e,t,n){t=t??0;let i,r=e[t++],o=new Array(r);for(i=0;i<r;++i,t+=h.packedLength)o[i]=h.unpack(e,t);r=e[t++];let s;if(r>0)for(s=new Array(r),i=0;i<r;++i)s[i]=e[t++];r=e[t++];let a;if(r>0)for(a=new Array(r),i=0;i<r;++i)a[i]=e[t++];let c=ee.unpack(e,t,$ge);t+=ee.packedLength;let u=e[t];return l(n)?(n._positions=o,n._minimumHeights=s,n._maximumHeights=a,n._ellipsoid=ee.clone(c,n._ellipsoid),n._granularity=u,n):(ED.positions=o,ED.minimumHeights=s,ED.maximumHeights=a,ED.granularity=u,new rx(ED))};rx.fromConstantHeights=function(e){e=e??H.EMPTY_OBJECT;let t=e.positions,n,i,r=e.minimumHeight,o=e.maximumHeight,s=l(r),a=l(o);if(s||a){let u=t.length;n=s?new Array(u):void 0,i=a?new Array(u):void 0;for(let f=0;f<u;++f)s&&(n[f]=r),a&&(i[f]=o)}let c={positions:t,maximumHeights:i,minimumHeights:n,ellipsoid:e.ellipsoid};return new rx(c)};rx.createGeometry=function(e){let t=e._positions,n=e._minimumHeights,i=e._maximumHeights,r=e._granularity,o=e._ellipsoid,s=tv.computePositions(o,t,i,n,r,!1);if(!l(s))return;let a=s.bottomPositions,c=s.topPositions,u=c.length,f=u*2,d=new Float64Array(f),p=0;u/=3;let g;for(g=0;g<u;++g){let x=g*3,T=h.fromArray(c,x,Xge),E=h.fromArray(a,x,Kge);d[p++]=E.x,d[p++]=E.y,d[p++]=E.z,d[p++]=T.x,d[p++]=T.y,d[p++]=T.z}let m=new En({position:new Ne({componentDatatype:Y.DOUBLE,componentsPerAttribute:3,values:d})}),y=f/3;f=2*y-4+y;let A=je.createTypedArray(y,f),b=0;for(g=0;g<y-2;g+=2){let x=g,T=g+2,E=h.fromArray(d,x*3,Xge),v=h.fromArray(d,T*3,Kge);if(h.equalsEpsilon(E,v,P.EPSILON10))continue;let S=g+1,I=g+3;A[b++]=S,A[b++]=x,A[b++]=S,A[b++]=I,A[b++]=x,A[b++]=T}return A[b++]=y-2,A[b]=y-1,new wt({attributes:m,indices:A,primitiveType:Oe.LINES,boundingSphere:ue.fromVertices(d)})};var iU=rx;var Jge=new z;function y$e(e){this.id=e,this.vertexFormat=void 0,this.positions=void 0,this.minimumHeights=void 0,this.maximumHeights=void 0,this.granularity=void 0}function Rh(e,t){Mi.call(this,{entity:e,scene:t,geometryOptions:new y$e(e),geometryPropertyName:"wall",observedPropertyNames:["availability","wall"]}),this._onEntityPropertyChanged(e,"wall",e.wall,void 0)}l(Object.create)&&(Rh.prototype=Object.create(Mi.prototype),Rh.prototype.constructor=Rh);Rh.prototype.createFillGeometryInstance=function(e){let t=this._entity,n=t.isAvailable(e),i,r,o=new Dn(n&&t.isShowing&&this._showProperty.getValue(e)&&this._fillProperty.getValue(e)),s=this._distanceDisplayConditionProperty.getValue(e),a=ti.fromDistanceDisplayCondition(s);if(this._materialProperty instanceof Kt){let c;l(this._materialProperty.color)&&(this._materialProperty.color.isConstant||n)&&(c=this._materialProperty.color.getValue(e,Jge)),l(c)||(c=z.WHITE),r=Jt.fromColor(c),i={show:o,distanceDisplayCondition:a,color:r}}else i={show:o,distanceDisplayCondition:a};return new Bt({id:t,geometry:new nU(this._options),attributes:i})};Rh.prototype.createOutlineGeometryInstance=function(e){let t=this._entity,n=t.isAvailable(e),i=X.getValueOrDefault(this._outlineColorProperty,e,z.BLACK,Jge),r=this._distanceDisplayConditionProperty.getValue(e);return new Bt({id:t,geometry:new iU(this._options),attributes:{show:new Dn(n&&t.isShowing&&this._showProperty.getValue(e)&&this._showOutlineProperty.getValue(e)),color:Jt.fromColor(i),distanceDisplayCondition:ti.fromDistanceDisplayCondition(r)}})};Rh.prototype._isHidden=function(e,t){return!l(t.positions)||Mi.prototype._isHidden.call(this,e,t)};Rh.prototype._getIsClosed=function(e){return!1};Rh.prototype._isDynamic=function(e,t){return!t.positions.isConstant||!X.isConstant(t.minimumHeights)||!X.isConstant(t.maximumHeights)||!X.isConstant(t.outlineWidth)||!X.isConstant(t.granularity)};Rh.prototype._setStaticOptions=function(e,t){let n=t.minimumHeights,i=t.maximumHeights,r=t.granularity,o=this._materialProperty instanceof Kt,s=this._options;s.vertexFormat=o?An.VERTEX_FORMAT:Cr.MaterialSupport.TEXTURED.vertexFormat,s.positions=t.positions.getValue(it.MINIMUM_VALUE,s.positions),s.minimumHeights=l(n)?n.getValue(it.MINIMUM_VALUE,s.minimumHeights):void 0,s.maximumHeights=l(i)?i.getValue(it.MINIMUM_VALUE,s.maximumHeights):void 0,s.granularity=l(r)?r.getValue(it.MINIMUM_VALUE):void 0};Rh.DynamicGeometryUpdater=nv;function nv(e,t,n){Oi.call(this,e,t,n)}l(Object.create)&&(nv.prototype=Object.create(Oi.prototype),nv.prototype.constructor=nv);nv.prototype._isHidden=function(e,t,n){return!l(this._options.positions)||Oi.prototype._isHidden.call(this,e,t,n)};nv.prototype._setOptions=function(e,t,n){let i=this._options;i.positions=X.getValueOrUndefined(t.positions,n,i.positions),i.minimumHeights=X.getValueOrUndefined(t.minimumHeights,n,i.minimumHeights),i.maximumHeights=X.getValueOrUndefined(t.maximumHeights,n,i.maximumHeights),i.granularity=X.getValueOrUndefined(t.granularity,n)};var rU=Rh;var ox=[u3,v3,T3,O3,L3,V3,K3,Z3,eU,rU];function sx(e,t){this.entity=e,this.scene=t;let n=new Array(ox.length),i=new be,r=new Wo;for(let o=0;o<n.length;o++){let s=new ox[o](e,t);r.add(s.geometryChanged,a=>{i.raiseEvent(a)}),n[o]=s}this.updaters=n,this.geometryChanged=i,this.eventHelper=r,this._removeEntitySubscription=e.definitionChanged.addEventListener(sx.prototype._onEntityPropertyChanged,this)}sx.prototype._onEntityPropertyChanged=function(e,t,n,i){let r=this.updaters;for(let o=0;o<r.length;o++)r[o]._onEntityPropertyChanged(e,t,n,i)};sx.prototype.forEach=function(e){let t=this.updaters;for(let n=0;n<t.length;n++)e(t[n])};sx.prototype.destroy=function(){this.eventHelper.removeAll();let e=this.updaters;for(let t=0;t<e.length;t++)e[t].destroy();this._removeEntitySubscription(),le(this)};sx.registerUpdater=function(e){ox.includes(e)||ox.push(e)};sx.unregisterUpdater=function(e){if(ox.includes(e)){let t=ox.indexOf(e);ox.splice(t,1)}};var iv=sx;var Zge=new z,A$e=new Gt,b$e=new Gt,x$e=h.ZERO,T$e=new h;function Oh(e,t,n,i,r,o,s){this.translucent=t,this.appearanceType=n,this.depthFailAppearanceType=i,this.depthFailMaterialProperty=r,this.depthFailMaterial=void 0,this.closed=o,this.shadows=s,this.primitives=e,this.createPrimitive=!1,this.waitingOnCreate=!1,this.primitive=void 0,this.oldPrimitive=void 0,this.geometry=new zt,this.updaters=new zt,this.updatersWithAttributes=new zt,this.attributes=new zt,this.subscriptions=new zt,this.showsUpdated=new zt,this.itemsToRemove=[],this.invalidated=!1;let a;l(r)&&(a=r.definitionChanged.addEventListener(Oh.prototype.onMaterialChanged,this)),this.removeMaterialSubscription=a}Oh.prototype.onMaterialChanged=function(){this.invalidated=!0};Oh.prototype.isMaterial=function(e){let t=this.depthFailMaterialProperty,n=e.depthFailMaterialProperty;return n===t?!0:l(t)?t.equals(n):!1};Oh.prototype.add=function(e,t){let n=e.id;if(this.createPrimitive=!0,this.geometry.set(n,t),this.updaters.set(n,e),!e.hasConstantFill||!e.fillMaterialProperty.isConstant||!X.isConstant(e.distanceDisplayConditionProperty)||!X.isConstant(e.terrainOffsetProperty))this.updatersWithAttributes.set(n,e);else{let i=this;this.subscriptions.set(n,e.entity.definitionChanged.addEventListener(function(r,o,s,a){o==="isShowing"&&i.showsUpdated.set(e.id,e)}))}};Oh.prototype.remove=function(e){let t=e.id;if(this.createPrimitive=this.geometry.remove(t)||this.createPrimitive,this.updaters.remove(t)){this.updatersWithAttributes.remove(t);let n=this.subscriptions.get(t);return l(n)&&(n(),this.subscriptions.remove(t),this.showsUpdated.remove(t)),!0}return!1};Oh.prototype.update=function(e){let t=!0,n=0,i=this.primitive,r=this.primitives,o;if(this.createPrimitive){let s=this.geometry.values;if(s.length>0){l(i)&&(l(this.oldPrimitive)?r.remove(i):this.oldPrimitive=i);let c;if(l(this.depthFailAppearanceType)){l(this.depthFailMaterialProperty)&&(this.depthFailMaterial=So.getValue(e,this.depthFailMaterialProperty,this.depthFailMaterial));let f=this.depthFailAppearanceType;c=new f({material:this.depthFailMaterial,translucent:this.translucent,closed:this.closed})}let u=this.appearanceType;i=new Mn({show:!1,asynchronous:!0,geometryInstances:s.slice(),appearance:new u({translucent:this.translucent,closed:this.closed}),depthFailAppearance:c,shadows:this.shadows}),r.add(i),t=!1}else{l(i)&&(r.remove(i),i=void 0);let c=this.oldPrimitive;l(c)&&(r.remove(c),this.oldPrimitive=void 0)}this.attributes.removeAll(),this.primitive=i,this.createPrimitive=!1,this.waitingOnCreate=!0}else if(l(i)&&i.ready){i.show=!0,l(this.oldPrimitive)&&(r.remove(this.oldPrimitive),this.oldPrimitive=void 0),l(this.depthFailAppearanceType)&&!(this.depthFailMaterialProperty instanceof Kt)&&(this.depthFailMaterial=So.getValue(e,this.depthFailMaterialProperty,this.depthFailMaterial),this.primitive.depthFailAppearance.material=this.depthFailMaterial);let s=this.updatersWithAttributes.values,a=s.length,c=this.waitingOnCreate;for(o=0;o<a;o++){let u=s[o],f=this.geometry.get(u.id),d=this.attributes.get(f.id.id);if(l(d)||(d=i.getGeometryInstanceAttributes(f.id),this.attributes.set(f.id.id,d)),!u.fillMaterialProperty.isConstant||c){let A=u.fillMaterialProperty.color,b=X.getValueOrDefault(A,e,z.WHITE,Zge);z.equals(d._lastColor,b)||(d._lastColor=z.clone(b,d._lastColor),d.color=Jt.toValue(b,d.color),(this.translucent&&d.color[3]===255||!this.translucent&&d.color[3]!==255)&&(this.itemsToRemove[n++]=u))}if(l(this.depthFailAppearanceType)&&u.depthFailMaterialProperty instanceof Kt&&(!u.depthFailMaterialProperty.isConstant||c)){let A=u.depthFailMaterialProperty.color,b=X.getValueOrDefault(A,e,z.WHITE,Zge);z.equals(d._lastDepthFailColor,b)||(d._lastDepthFailColor=z.clone(b,d._lastDepthFailColor),d.depthFailColor=Jt.toValue(b,d.depthFailColor))}let p=u.entity.isShowing&&(u.hasConstantFill||u.isFilled(e)),g=d.show[0]===1;p!==g&&(d.show=Dn.toValue(p,d.show));let m=u.distanceDisplayConditionProperty;if(!X.isConstant(m)){let A=X.getValueOrDefault(m,e,b$e,A$e);Gt.equals(A,d._lastDistanceDisplayCondition)||(d._lastDistanceDisplayCondition=Gt.clone(A,d._lastDistanceDisplayCondition),d.distanceDisplayCondition=ti.toValue(A,d.distanceDisplayCondition))}let y=u.terrainOffsetProperty;if(!X.isConstant(y)){let A=X.getValueOrDefault(y,e,x$e,T$e);h.equals(A,d._lastOffset)||(d._lastOffset=h.clone(A,d._lastOffset),d.offset=Er.toValue(A,d.offset))}}this.updateShows(i),this.waitingOnCreate=!1}else l(i)&&!i.ready&&(t=!1);return this.itemsToRemove.length=n,t};Oh.prototype.updateShows=function(e){let t=this.showsUpdated.values,n=t.length;for(let i=0;i<n;i++){let r=t[i],o=this.geometry.get(r.id),s=this.attributes.get(o.id.id);l(s)||(s=e.getGeometryInstanceAttributes(o.id),this.attributes.set(o.id.id,s));let a=r.entity.isShowing,c=s.show[0]===1;a!==c&&(s.show=Dn.toValue(a,s.show),o.attributes.show.value[0]=s.show[0])}this.showsUpdated.removeAll()};Oh.prototype.contains=function(e){return this.updaters.contains(e.id)};Oh.prototype.getBoundingSphere=function(e,t){let n=this.primitive;if(!n.ready)return Pt.PENDING;let i=n.getGeometryInstanceAttributes(e.entity);return!l(i)||!l(i.boundingSphere)||l(i.show)&&i.show[0]===0?Pt.FAILED:(i.boundingSphere.clone(t),Pt.DONE)};Oh.prototype.destroy=function(){let e=this.primitive,t=this.primitives;l(e)&&t.remove(e);let n=this.oldPrimitive;l(n)&&t.remove(n),l(this.removeMaterialSubscription)&&this.removeMaterialSubscription()};function rv(e,t,n,i,r){this._solidItems=[],this._translucentItems=[],this._primitives=e,this._appearanceType=t,this._depthFailAppearanceType=n,this._closed=i,this._shadows=r}rv.prototype.add=function(e,t){let n,i,r=t.createFillGeometryInstance(e);r.attributes.color.value[3]===255?(n=this._solidItems,i=!1):(n=this._translucentItems,i=!0);let o=n.length;for(let a=0;a<o;a++){let c=n[a];if(c.isMaterial(t)){c.add(t,r);return}}let s=new Oh(this._primitives,i,this._appearanceType,this._depthFailAppearanceType,t.depthFailMaterialProperty,this._closed,this._shadows);s.add(t,r),n.push(s)};function Qge(e,t){let n=e.length;for(let i=n-1;i>=0;i--){let r=e[i];if(r.remove(t))return r.updaters.length===0&&(e.splice(i,1),r.destroy()),!0}return!1}rv.prototype.remove=function(e){Qge(this._solidItems,e)||Qge(this._translucentItems,e)};function e_e(e,t,n){let i=!1,r=t.length;for(let o=0;o<r;++o){let s=t[o],a=s.itemsToRemove,c=a.length;if(c>0)for(o=0;o<c;o++){let u=a[o];s.remove(u),e.add(n,u),i=!0}}return i}function oU(e,t,n,i){let r=t.length,o;for(o=r-1;o>=0;o--){let s=t[o];if(s.invalidated){t.splice(o,1);let a=s.updaters.values,c=a.length;for(let u=0;u<c;u++)e.add(n,a[u]);s.destroy()}}for(r=t.length,o=0;o<r;++o)i=t[o].update(n)&&i;return i}rv.prototype.update=function(e){let t=oU(this,this._solidItems,e,!0);t=oU(this,this._translucentItems,e,t)&&t;let n=e_e(this,this._solidItems,e),i=e_e(this,this._translucentItems,e);return(n||i)&&(t=oU(this,this._solidItems,e,t)&&t,t=oU(this,this._translucentItems,e,t)&&t),t};function t_e(e,t,n){let i=e.length;for(let r=0;r<i;r++){let o=e[r];if(o.contains(t))return o.getBoundingSphere(t,n)}return Pt.FAILED}rv.prototype.getBoundingSphere=function(e,t){let n=t_e(this._solidItems,e,t);return n===Pt.FAILED?t_e(this._translucentItems,e,t):n};function n_e(e){let t=e.length;for(let n=0;n<t;n++)e[n].destroy();e.length=0}rv.prototype.removeAllPrimitives=function(){n_e(this._solidItems),n_e(this._translucentItems)};var Mh=rv;var E$e=new Gt,C$e=new Gt,v$e=h.ZERO,S$e=new h;function Nh(e,t,n,i,r,o,s){this.primitives=e,this.appearanceType=t,this.materialProperty=n,this.depthFailAppearanceType=i,this.depthFailMaterialProperty=r,this.closed=o,this.shadows=s,this.updaters=new zt,this.createPrimitive=!0,this.primitive=void 0,this.oldPrimitive=void 0,this.geometry=new zt,this.material=void 0,this.depthFailMaterial=void 0,this.updatersWithAttributes=new zt,this.attributes=new zt,this.invalidated=!1,this.removeMaterialSubscription=n.definitionChanged.addEventListener(Nh.prototype.onMaterialChanged,this),this.subscriptions=new zt,this.showsUpdated=new zt}Nh.prototype.onMaterialChanged=function(){this.invalidated=!0};Nh.prototype.isMaterial=function(e){let t=this.materialProperty,n=e.fillMaterialProperty,i=this.depthFailMaterialProperty,r=e.depthFailMaterialProperty;if(n===t&&r===i)return!0;let o=l(t)&&t.equals(n);return o=(!l(i)&&!l(r)||l(i)&&i.equals(r))&&o,o};Nh.prototype.add=function(e,t){let n=t.id;if(this.updaters.set(n,t),this.geometry.set(n,t.createFillGeometryInstance(e)),!t.hasConstantFill||!t.fillMaterialProperty.isConstant||!X.isConstant(t.distanceDisplayConditionProperty)||!X.isConstant(t.terrainOffsetProperty))this.updatersWithAttributes.set(n,t);else{let i=this;this.subscriptions.set(n,t.entity.definitionChanged.addEventListener(function(r,o,s,a){o==="isShowing"&&i.showsUpdated.set(t.id,t)}))}this.createPrimitive=!0};Nh.prototype.remove=function(e){let t=e.id;if(this.createPrimitive=this.geometry.remove(t)||this.createPrimitive,this.updaters.remove(t)){this.updatersWithAttributes.remove(t);let n=this.subscriptions.get(t);return l(n)&&(n(),this.subscriptions.remove(t),this.showsUpdated.remove(t)),!0}return!1};var w$e=new z;Nh.prototype.update=function(e){let t=!0,n=this.primitive,i=this.primitives,r=this.geometry.values,o;if(this.createPrimitive){if(r.length>0){l(n)&&(l(this.oldPrimitive)?i.remove(n):this.oldPrimitive=n),this.material=So.getValue(e,this.materialProperty,this.material);let a;if(l(this.depthFailMaterialProperty)){this.depthFailMaterial=So.getValue(e,this.depthFailMaterialProperty,this.depthFailMaterial);let u=this.depthFailAppearanceType;a=new u({material:this.depthFailMaterial,translucent:this.depthFailMaterial.isTranslucent(),closed:this.closed})}let c=this.appearanceType;n=new Mn({show:!1,asynchronous:!0,geometryInstances:r.slice(),appearance:new c({material:this.material,translucent:this.material.isTranslucent(),closed:this.closed}),depthFailAppearance:a,shadows:this.shadows}),i.add(n),t=!1}else{l(n)&&(i.remove(n),n=void 0);let a=this.oldPrimitive;l(a)&&(i.remove(a),this.oldPrimitive=void 0)}this.attributes.removeAll(),this.primitive=n,this.createPrimitive=!1}else if(l(n)&&n.ready){n.show=!0,l(this.oldPrimitive)&&(i.remove(this.oldPrimitive),this.oldPrimitive=void 0),this.material=So.getValue(e,this.materialProperty,this.material),this.primitive.appearance.material=this.material,l(this.depthFailAppearanceType)&&!(this.depthFailMaterialProperty instanceof Kt)&&(this.depthFailMaterial=So.getValue(e,this.depthFailMaterialProperty,this.depthFailMaterial),this.primitive.depthFailAppearance.material=this.depthFailMaterial);let s=this.updatersWithAttributes.values,a=s.length;for(o=0;o<a;o++){let c=s[o],u=c.entity,f=this.geometry.get(c.id),d=this.attributes.get(f.id.id);if(l(d)||(d=n.getGeometryInstanceAttributes(f.id),this.attributes.set(f.id.id,d)),l(this.depthFailAppearanceType)&&this.depthFailMaterialProperty instanceof Kt&&!c.depthFailMaterialProperty.isConstant){let A=c.depthFailMaterialProperty.color,b=X.getValueOrDefault(A,e,z.WHITE,w$e);z.equals(d._lastDepthFailColor,b)||(d._lastDepthFailColor=z.clone(b,d._lastDepthFailColor),d.depthFailColor=Jt.toValue(b,d.depthFailColor))}let p=u.isShowing&&(c.hasConstantFill||c.isFilled(e)),g=d.show[0]===1;p!==g&&(d.show=Dn.toValue(p,d.show));let m=c.distanceDisplayConditionProperty;if(!X.isConstant(m)){let A=X.getValueOrDefault(m,e,C$e,E$e);Gt.equals(A,d._lastDistanceDisplayCondition)||(d._lastDistanceDisplayCondition=Gt.clone(A,d._lastDistanceDisplayCondition),d.distanceDisplayCondition=ti.toValue(A,d.distanceDisplayCondition))}let y=c.terrainOffsetProperty;if(!X.isConstant(y)){let A=X.getValueOrDefault(y,e,v$e,S$e);h.equals(A,d._lastOffset)||(d._lastOffset=h.clone(A,d._lastOffset),d.offset=Er.toValue(A,d.offset))}}this.updateShows(n)}else l(n)&&!n.ready&&(t=!1);return t};Nh.prototype.updateShows=function(e){let t=this.showsUpdated.values,n=t.length;for(let i=0;i<n;i++){let r=t[i],o=r.entity,s=this.geometry.get(r.id),a=this.attributes.get(s.id.id);l(a)||(a=e.getGeometryInstanceAttributes(s.id),this.attributes.set(s.id.id,a));let c=o.isShowing,u=a.show[0]===1;c!==u&&(a.show=Dn.toValue(c,a.show),s.attributes.show.value[0]=a.show[0])}this.showsUpdated.removeAll()};Nh.prototype.contains=function(e){return this.updaters.contains(e.id)};Nh.prototype.getBoundingSphere=function(e,t){let n=this.primitive;if(!n.ready)return Pt.PENDING;let i=n.getGeometryInstanceAttributes(e.entity);return!l(i)||!l(i.boundingSphere)||l(i.show)&&i.show[0]===0?Pt.FAILED:(i.boundingSphere.clone(t),Pt.DONE)};Nh.prototype.destroy=function(){let e=this.primitive,t=this.primitives;l(e)&&t.remove(e);let n=this.oldPrimitive;l(n)&&t.remove(n),this.removeMaterialSubscription()};function ov(e,t,n,i,r){this._items=[],this._primitives=e,this._appearanceType=t,this._depthFailAppearanceType=n,this._closed=i,this._shadows=r}ov.prototype.add=function(e,t){let n=this._items,i=n.length;for(let o=0;o<i;o++){let s=n[o];if(s.isMaterial(t)){s.add(e,t);return}}let r=new Nh(this._primitives,this._appearanceType,t.fillMaterialProperty,this._depthFailAppearanceType,t.depthFailMaterialProperty,this._closed,this._shadows);r.add(e,t),n.push(r)};ov.prototype.remove=function(e){let t=this._items,n=t.length;for(let i=n-1;i>=0;i--){let r=t[i];if(r.remove(e)){r.updaters.length===0&&(t.splice(i,1),r.destroy());break}}};ov.prototype.update=function(e){let t,n=this._items,i=n.length;for(t=i-1;t>=0;t--){let o=n[t];if(o.invalidated){n.splice(t,1);let s=o.updaters.values,a=s.length;for(let c=0;c<a;c++)this.add(e,s[c]);o.destroy()}}let r=!0;for(t=0;t<n.length;t++)r=n[t].update(e)&&r;return r};ov.prototype.getBoundingSphere=function(e,t){let n=this._items,i=n.length;for(let r=0;r<i;r++){let o=n[r];if(o.contains(e))return o.getBoundingSphere(e,t)}return Pt.FAILED};ov.prototype.removeAllPrimitives=function(){let e=this._items,t=e.length;for(let n=0;n<t;n++)e[n].destroy();this._items.length=0};var Lh=ov;function sU(e,t,n=0,i=e.length-1,r=I$e){for(;i>n;){if(i-n>600){let c=i-n+1,u=t-n+1,f=Math.log(c),d=.5*Math.exp(2*f/3),p=.5*Math.sqrt(f*d*(c-d)/c)*(u-c/2<0?-1:1),g=Math.max(n,Math.floor(t-u*d/c+p)),m=Math.min(i,Math.floor(t+(c-u)*d/c+p));sU(e,t,g,m,r)}let o=e[t],s=n,a=i;for(CD(e,n,t),r(e[i],o)>0&&CD(e,n,i);s<a;){for(CD(e,s,a),s++,a--;r(e[s],o)<0;)s++;for(;r(e[a],o)>0;)a--}r(e[n],o)===0?CD(e,n,a):(a++,CD(e,a,i)),a<=t&&(n=a+1),t<=a&&(i=a-1)}}function CD(e,t,n){let i=e[t];e[t]=e[n],e[n]=i}function I$e(e,t){return e<t?-1:e>t?1:0}var wD=class{constructor(t=9){this._maxEntries=Math.max(4,t),this._minEntries=Math.max(2,Math.ceil(this._maxEntries*.4)),this.clear()}all(){return this._all(this.data,[])}search(t){let n=this.data,i=[];if(!cU(t,n))return i;let r=this.toBBox,o=[];for(;n;){for(let s=0;s<n.children.length;s++){let a=n.children[s],c=n.leaf?r(a):a;cU(t,c)&&(n.leaf?i.push(a):l$(t,c)?this._all(a,i):o.push(a))}n=o.pop()}return i}collides(t){let n=this.data;if(!cU(t,n))return!1;let i=[];for(;n;){for(let r=0;r<n.children.length;r++){let o=n.children[r],s=n.leaf?this.toBBox(o):o;if(cU(t,s)){if(n.leaf||l$(t,s))return!0;i.push(o)}}n=i.pop()}return!1}load(t){if(!(t&&t.length))return this;if(t.length<this._minEntries){for(let i=0;i<t.length;i++)this.insert(t[i]);return this}let n=this._build(t.slice(),0,t.length-1,0);if(!this.data.children.length)this.data=n;else if(this.data.height===n.height)this._splitRoot(this.data,n);else{if(this.data.height<n.height){let i=this.data;this.data=n,n=i}this._insert(n,this.data.height-n.height-1,!0)}return this}insert(t){return t&&this._insert(t,this.data.height-1),this}clear(){return this.data=av([]),this}remove(t,n){if(!t)return this;let i=this.data,r=this.toBBox(t),o=[],s=[],a,c,u;for(;i||o.length;){if(i||(i=o.pop(),c=o[o.length-1],a=s.pop(),u=!0),i.leaf){let f=P$e(t,i.children,n);if(f!==-1)return i.children.splice(f,1),o.push(i),this._condense(o),this}!u&&!i.leaf&&l$(i,r)?(o.push(i),s.push(a),a=0,c=i,i=i.children[0]):c?(a++,i=c.children[a],u=!1):i=null}return this}toBBox(t){return t}compareMinX(t,n){return t.minX-n.minX}compareMinY(t,n){return t.minY-n.minY}toJSON(){return this.data}fromJSON(t){return this.data=t,this}_all(t,n){let i=[];for(;t;)t.leaf?n.push(...t.children):i.push(...t.children),t=i.pop();return n}_build(t,n,i,r){let o=i-n+1,s=this._maxEntries,a;if(o<=s)return a=av(t.slice(n,i+1)),sv(a,this.toBBox),a;r||(r=Math.ceil(Math.log(o)/Math.log(s)),s=Math.ceil(o/Math.pow(s,r-1))),a=av([]),a.leaf=!1,a.height=r;let c=Math.ceil(o/s),u=c*Math.ceil(Math.sqrt(s));i_e(t,n,i,u,this.compareMinX);for(let f=n;f<=i;f+=u){let d=Math.min(f+u-1,i);i_e(t,f,d,c,this.compareMinY);for(let p=f;p<=d;p+=c){let g=Math.min(p+c-1,d);a.children.push(this._build(t,p,g,r-1))}}return sv(a,this.toBBox),a}_chooseSubtree(t,n,i,r){for(;r.push(n),!(n.leaf||r.length-1===i);){let o=1/0,s=1/0,a;for(let c=0;c<n.children.length;c++){let u=n.children[c],f=c$(u),d=O$e(t,u)-f;d<s?(s=d,o=f<o?f:o,a=u):d===s&&f<o&&(o=f,a=u)}n=a||n.children[0]}return n}_insert(t,n,i){let r=i?t:this.toBBox(t),o=[],s=this._chooseSubtree(r,this.data,n,o);for(s.children.push(t),SD(s,r);n>=0&&o[n].children.length>this._maxEntries;)this._split(o,n),n--;this._adjustParentBBoxes(r,o,n)}_split(t,n){let i=t[n],r=i.children.length,o=this._minEntries;this._chooseSplitAxis(i,o,r);let s=this._chooseSplitIndex(i,o,r),a=av(i.children.splice(s,i.children.length-s));a.height=i.height,a.leaf=i.leaf,sv(i,this.toBBox),sv(a,this.toBBox),n?t[n-1].children.push(a):this._splitRoot(i,a)}_splitRoot(t,n){this.data=av([t,n]),this.data.height=t.height+1,this.data.leaf=!1,sv(this.data,this.toBBox)}_chooseSplitIndex(t,n,i){let r,o=1/0,s=1/0;for(let a=n;a<=i-n;a++){let c=vD(t,0,a,this.toBBox),u=vD(t,a,i,this.toBBox),f=M$e(c,u),d=c$(c)+c$(u);f<o?(o=f,r=a,s=d<s?d:s):f===o&&d<s&&(s=d,r=a)}return r||i-n}_chooseSplitAxis(t,n,i){let r=t.leaf?this.compareMinX:D$e,o=t.leaf?this.compareMinY:R$e,s=this._allDistMargin(t,n,i,r),a=this._allDistMargin(t,n,i,o);s<a&&t.children.sort(r)}_allDistMargin(t,n,i,r){t.children.sort(r);let o=this.toBBox,s=vD(t,0,n,o),a=vD(t,i-n,i,o),c=aU(s)+aU(a);for(let u=n;u<i-n;u++){let f=t.children[u];SD(s,t.leaf?o(f):f),c+=aU(s)}for(let u=i-n-1;u>=n;u--){let f=t.children[u];SD(a,t.leaf?o(f):f),c+=aU(a)}return c}_adjustParentBBoxes(t,n,i){for(let r=i;r>=0;r--)SD(n[r],t)}_condense(t){for(let n=t.length-1,i;n>=0;n--)t[n].children.length===0?n>0?(i=t[n-1].children,i.splice(i.indexOf(t[n]),1)):this.clear():sv(t[n],this.toBBox)}};function P$e(e,t,n){if(!n)return t.indexOf(e);for(let i=0;i<t.length;i++)if(n(e,t[i]))return i;return-1}function sv(e,t){vD(e,0,e.children.length,t,e)}function vD(e,t,n,i,r){r||(r=av(null)),r.minX=1/0,r.minY=1/0,r.maxX=-1/0,r.maxY=-1/0;for(let o=t;o<n;o++){let s=e.children[o];SD(r,e.leaf?i(s):s)}return r}function SD(e,t){return e.minX=Math.min(e.minX,t.minX),e.minY=Math.min(e.minY,t.minY),e.maxX=Math.max(e.maxX,t.maxX),e.maxY=Math.max(e.maxY,t.maxY),e}function D$e(e,t){return e.minX-t.minX}function R$e(e,t){return e.minY-t.minY}function c$(e){return(e.maxX-e.minX)*(e.maxY-e.minY)}function aU(e){return e.maxX-e.minX+(e.maxY-e.minY)}function O$e(e,t){return(Math.max(t.maxX,e.maxX)-Math.min(t.minX,e.minX))*(Math.max(t.maxY,e.maxY)-Math.min(t.minY,e.minY))}function M$e(e,t){let n=Math.max(e.minX,t.minX),i=Math.max(e.minY,t.minY),r=Math.min(e.maxX,t.maxX),o=Math.min(e.maxY,t.maxY);return Math.max(0,r-n)*Math.max(0,o-i)}function l$(e,t){return e.minX<=t.minX&&e.minY<=t.minY&&t.maxX<=e.maxX&&t.maxY<=e.maxY}function cU(e,t){return t.minX<=e.maxX&&t.minY<=e.maxY&&t.maxX>=e.minX&&t.maxY>=e.minY}function av(e){return{children:e,height:1,leaf:!0,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0}}function i_e(e,t,n,i,r){let o=[t,n];for(;o.length;){if(n=o.pop(),t=o.pop(),n-t<=i)continue;let s=t+Math.ceil((n-t)/i/2)*i;sU(e,s,t,n,r),o.push(t,s,s,n)}}function lU(){this._tree=new wD}function ax(){this.minX=0,this.minY=0,this.maxX=0,this.maxY=0,this.id=""}ax.fromRectangleAndId=function(e,t,n){return n.minX=t.west,n.minY=t.south,n.maxX=t.east,n.maxY=t.north,n.id=e,n};lU.prototype.insert=function(e,t){let n=ax.fromRectangleAndId(e,t,new ax);this._tree.insert(n)};function N$e(e,t){return e.id===t.id}var L$e=new ax;lU.prototype.remove=function(e,t){let n=ax.fromRectangleAndId(e,t,L$e);this._tree.remove(n,N$e)};var F$e=new ax;lU.prototype.collides=function(e){let t=ax.fromRectangleAndId("",e,F$e);return this._tree.collides(t)};var cv=lU;var B$e=new z,k$e=new Gt,U$e=new Gt;function sg(e,t,n,i){this.primitives=e,this.zIndex=i,this.classificationType=t,this.color=n,this.createPrimitive=!1,this.waitingOnCreate=!1,this.primitive=void 0,this.oldPrimitive=void 0,this.geometry=new zt,this.updaters=new zt,this.updatersWithAttributes=new zt,this.attributes=new zt,this.subscriptions=new zt,this.showsUpdated=new zt,this.itemsToRemove=[],this.isDirty=!1,this.rectangleCollisionCheck=new cv}sg.prototype.overlapping=function(e){return this.rectangleCollisionCheck.collides(e)};sg.prototype.add=function(e,t){let n=e.id;if(this.createPrimitive=!0,this.geometry.set(n,t),this.updaters.set(n,e),this.rectangleCollisionCheck.insert(n,t.geometry.rectangle),!e.hasConstantFill||!e.fillMaterialProperty.isConstant||!X.isConstant(e.distanceDisplayConditionProperty))this.updatersWithAttributes.set(n,e);else{let i=this;this.subscriptions.set(n,e.entity.definitionChanged.addEventListener(function(r,o,s,a){o==="isShowing"&&i.showsUpdated.set(e.id,e)}))}};sg.prototype.remove=function(e){let t=e.id,n=this.geometry.get(t);if(this.createPrimitive=this.geometry.remove(t)||this.createPrimitive,this.updaters.remove(t)){this.rectangleCollisionCheck.remove(t,n.geometry.rectangle),this.updatersWithAttributes.remove(t);let i=this.subscriptions.get(t);return l(i)&&(i(),this.subscriptions.remove(t),this.showsUpdated.remove(t)),!0}return!1};sg.prototype.update=function(e){let t=!0,n=0,i=this.primitive,r=this.primitives,o;if(this.createPrimitive){let s=this.geometry.values;if(s.length>0)l(i)&&(l(this.oldPrimitive)?r.remove(i):this.oldPrimitive=i),i=new pu({show:!1,asynchronous:!0,geometryInstances:s.slice(),classificationType:this.classificationType}),r.add(i,this.zIndex),t=!1;else{l(i)&&(r.remove(i),i=void 0);let c=this.oldPrimitive;l(c)&&(r.remove(c),this.oldPrimitive=void 0)}this.attributes.removeAll(),this.primitive=i,this.createPrimitive=!1,this.waitingOnCreate=!0}else if(l(i)&&i.ready){i.show=!0,l(this.oldPrimitive)&&(r.remove(this.oldPrimitive),this.oldPrimitive=void 0);let s=this.updatersWithAttributes.values,a=s.length,c=this.waitingOnCreate;for(o=0;o<a;o++){let u=s[o],f=this.geometry.get(u.id),d=this.attributes.get(f.id.id);if(l(d)||(d=i.getGeometryInstanceAttributes(f.id),this.attributes.set(f.id.id,d)),!u.fillMaterialProperty.isConstant||c){let y=u.fillMaterialProperty.color,A=X.getValueOrDefault(y,e,z.WHITE,B$e);z.equals(d._lastColor,A)||(d._lastColor=z.clone(A,d._lastColor),d.color=Jt.toValue(A,d.color))}let p=u.entity.isShowing&&(u.hasConstantFill||u.isFilled(e)),g=d.show[0]===1;p!==g&&(d.show=Dn.toValue(p,d.show));let m=u.distanceDisplayConditionProperty;if(!X.isConstant(m)){let y=X.getValueOrDefault(m,e,U$e,k$e);Gt.equals(y,d._lastDistanceDisplayCondition)||(d._lastDistanceDisplayCondition=Gt.clone(y,d._lastDistanceDisplayCondition),d.distanceDisplayCondition=ti.toValue(y,d.distanceDisplayCondition))}}this.updateShows(i),this.waitingOnCreate=!1}else l(i)&&!i.ready&&(t=!1);return this.itemsToRemove.length=n,t};sg.prototype.updateShows=function(e){let t=this.showsUpdated.values,n=t.length;for(let i=0;i<n;i++){let r=t[i],o=this.geometry.get(r.id),s=this.attributes.get(o.id.id);l(s)||(s=e.getGeometryInstanceAttributes(o.id),this.attributes.set(o.id.id,s));let a=r.entity.isShowing,c=s.show[0]===1;a!==c&&(s.show=Dn.toValue(a,s.show),o.attributes.show.value[0]=s.show[0])}this.showsUpdated.removeAll()};sg.prototype.contains=function(e){return this.updaters.contains(e.id)};sg.prototype.getBoundingSphere=function(e,t){let n=this.primitive;if(!n.ready)return Pt.PENDING;let i=n.getBoundingSphere(e.entity);return l(i)?(i.clone(t),Pt.DONE):Pt.FAILED};sg.prototype.removeAllPrimitives=function(){let e=this.primitives,t=this.primitive;l(t)&&(e.remove(t),this.primitive=void 0,this.geometry.removeAll(),this.updaters.removeAll());let n=this.oldPrimitive;l(n)&&(e.remove(n),this.oldPrimitive=void 0)};function lv(e,t){this._batches=[],this._primitives=e,this._classificationType=t}lv.prototype.add=function(e,t){let n=t.createFillGeometryInstance(e),i=this._batches,r=X.getValueOrDefault(t.zIndex,0),o,s=i.length;for(let a=0;a<s;++a){let c=i[a];if(c.zIndex===r&&!c.overlapping(n.geometry.rectangle)){o=c;break}}return l(o)||(o=new sg(this._primitives,this._classificationType,n.attributes.color.value,r),i.push(o)),o.add(t,n),o};lv.prototype.remove=function(e){let t=this._batches,n=t.length;for(let i=0;i<n;++i)if(t[i].remove(e))return};lv.prototype.update=function(e){let t,n,i=!0,r=this._batches,o=r.length;for(t=0;t<o;++t)i=r[t].update(e)&&i;for(t=0;t<o;++t){let s=r[t],a=s.itemsToRemove,c=a.length;for(let u=0;u<c;u++){n=a[u],s.remove(n);let f=this.add(e,n);s.isDirty=!0,f.isDirty=!0}}for(t=o-1;t>=0;--t){let s=r[t];s.isDirty&&(i=r[t].update(e)&&i,s.isDirty=!1),s.geometry.length===0&&r.splice(t,1)}return i};lv.prototype.getBoundingSphere=function(e,t){let n=this._batches,i=n.length;for(let r=0;r<i;++r){let o=n[r];if(o.contains(e))return o.getBoundingSphere(e,t)}return Pt.FAILED};lv.prototype.removeAllPrimitives=function(){let e=this._batches,t=e.length;for(let n=0;n<t;++n)e[n].removeAllPrimitives()};var ID=lv;var z$e=new Gt,V$e=new Gt;function gp(e,t,n,i,r,o){this.primitives=e,this.classificationType=t,this.appearanceType=n,this.materialProperty=i,this.updaters=new zt,this.createPrimitive=!0,this.primitive=void 0,this.oldPrimitive=void 0,this.geometry=new zt,this.material=void 0,this.updatersWithAttributes=new zt,this.attributes=new zt,this.subscriptions=new zt,this.showsUpdated=new zt,this.usingSphericalTextureCoordinates=r,this.zIndex=o,this.rectangleCollisionCheck=new cv}gp.prototype.overlapping=function(e){return this.rectangleCollisionCheck.collides(e)};gp.prototype.isMaterial=function(e){let t=this.materialProperty,n=e.fillMaterialProperty;return n===t||n instanceof Kt&&t instanceof Kt?!0:l(t)&&t.equals(n)};gp.prototype.add=function(e,t,n){let i=t.id;if(this.updaters.set(i,t),this.geometry.set(i,n),this.rectangleCollisionCheck.insert(i,n.geometry.rectangle),!t.hasConstantFill||!t.fillMaterialProperty.isConstant||!X.isConstant(t.distanceDisplayConditionProperty))this.updatersWithAttributes.set(i,t);else{let r=this;this.subscriptions.set(i,t.entity.definitionChanged.addEventListener(function(o,s,a,c){s==="isShowing"&&r.showsUpdated.set(t.id,t)}))}this.createPrimitive=!0};gp.prototype.remove=function(e){let t=e.id,n=this.geometry.get(t);if(this.createPrimitive=this.geometry.remove(t)||this.createPrimitive,this.updaters.remove(t)){this.rectangleCollisionCheck.remove(t,n.geometry.rectangle),this.updatersWithAttributes.remove(t);let i=this.subscriptions.get(t);return l(i)&&(i(),this.subscriptions.remove(t),this.showsUpdated.remove(t)),!0}return!1};gp.prototype.update=function(e){let t=!0,n=this.primitive,i=this.primitives,r=this.geometry.values,o;if(this.createPrimitive){if(r.length>0){l(n)&&(l(this.oldPrimitive)?i.remove(n):this.oldPrimitive=n),this.material=So.getValue(e,this.materialProperty,this.material);let a=this.appearanceType;n=new pu({show:!1,asynchronous:!0,geometryInstances:r.slice(),appearance:new a({material:this.material}),classificationType:this.classificationType}),i.add(n,this.zIndex),t=!1}else{l(n)&&(i.remove(n),n=void 0);let a=this.oldPrimitive;l(a)&&(i.remove(a),this.oldPrimitive=void 0)}this.attributes.removeAll(),this.primitive=n,this.createPrimitive=!1}else if(l(n)&&n.ready){n.show=!0,l(this.oldPrimitive)&&(i.remove(this.oldPrimitive),this.oldPrimitive=void 0),this.material=So.getValue(e,this.materialProperty,this.material),this.primitive.appearance.material=this.material;let s=this.updatersWithAttributes.values,a=s.length;for(o=0;o<a;o++){let c=s[o],u=c.entity,f=this.geometry.get(c.id),d=this.attributes.get(f.id.id);l(d)||(d=n.getGeometryInstanceAttributes(f.id),this.attributes.set(f.id.id,d));let p=u.isShowing&&(c.hasConstantFill||c.isFilled(e)),g=d.show[0]===1;p!==g&&(d.show=Dn.toValue(p,d.show));let m=c.distanceDisplayConditionProperty;if(!X.isConstant(m)){let y=X.getValueOrDefault(m,e,V$e,z$e);Gt.equals(y,d._lastDistanceDisplayCondition)||(d._lastDistanceDisplayCondition=Gt.clone(y,d._lastDistanceDisplayCondition),d.distanceDisplayCondition=ti.toValue(y,d.distanceDisplayCondition))}}this.updateShows(n)}else l(n)&&!n.ready&&(t=!1);return t};gp.prototype.updateShows=function(e){let t=this.showsUpdated.values,n=t.length;for(let i=0;i<n;i++){let r=t[i],o=r.entity,s=this.geometry.get(r.id),a=this.attributes.get(s.id.id);l(a)||(a=e.getGeometryInstanceAttributes(s.id),this.attributes.set(s.id.id,a));let c=o.isShowing,u=a.show[0]===1;c!==u&&(a.show=Dn.toValue(c,a.show),s.attributes.show.value[0]=a.show[0])}this.showsUpdated.removeAll()};gp.prototype.contains=function(e){return this.updaters.contains(e.id)};gp.prototype.getBoundingSphere=function(e,t){let n=this.primitive;if(!n.ready)return Pt.PENDING;let i=n.getGeometryInstanceAttributes(e.entity);return!l(i)||!l(i.boundingSphere)||l(i.show)&&i.show[0]===0?Pt.FAILED:(i.boundingSphere.clone(t),Pt.DONE)};gp.prototype.destroy=function(){let e=this.primitive,t=this.primitives;l(e)&&t.remove(e);let n=this.oldPrimitive;l(n)&&t.remove(n)};function uv(e,t,n){this._items=[],this._primitives=e,this._classificationType=t,this._appearanceType=n}uv.prototype.add=function(e,t){let n=this._items,i=n.length,r=t.createFillGeometryInstance(e),o=sd.shouldUseSphericalCoordinates(r.geometry.rectangle),s=X.getValueOrDefault(t.zIndex,0);for(let c=0;c<i;++c){let u=n[c];if(u.isMaterial(t)&&u.usingSphericalTextureCoordinates===o&&u.zIndex===s&&!u.overlapping(r.geometry.rectangle)){u.add(e,t,r);return}}let a=new gp(this._primitives,this._classificationType,this._appearanceType,t.fillMaterialProperty,o,s);a.add(e,t,r),n.push(a)};uv.prototype.remove=function(e){let t=this._items,n=t.length;for(let i=n-1;i>=0&&!t[i].remove(e);i--);};uv.prototype.update=function(e){let t,n=this._items,i=n.length;for(t=i-1;t>=0;t--){let o=n[t];o.updaters.length===0&&(n.splice(t,1),o.destroy())}let r=!0;for(t=0;t<n.length;t++)r=n[t].update(e)&&r;return r};uv.prototype.getBoundingSphere=function(e,t){let n=this._items,i=n.length;for(let r=0;r<i;r++){let o=n[r];if(o.contains(e))return o.getBoundingSphere(e,t)}return Pt.FAILED};uv.prototype.removeAllPrimitives=function(){let e=this._items,t=e.length;for(let n=0;n<t;n++)e[n].destroy();this._items.length=0};var uU=uv;var j$e=new z,H$e=new Gt,G$e=new Gt,W$e=h.ZERO,q$e=new h;function ag(e,t,n,i){this.translucent=t,this.width=n,this.shadows=i,this.primitives=e,this.createPrimitive=!1,this.waitingOnCreate=!1,this.primitive=void 0,this.oldPrimitive=void 0,this.geometry=new zt,this.updaters=new zt,this.updatersWithAttributes=new zt,this.attributes=new zt,this.itemsToRemove=[],this.subscriptions=new zt,this.showsUpdated=new zt}ag.prototype.add=function(e,t){let n=e.id;if(this.createPrimitive=!0,this.geometry.set(n,t),this.updaters.set(n,e),!e.hasConstantOutline||!e.outlineColorProperty.isConstant||!X.isConstant(e.distanceDisplayConditionProperty)||!X.isConstant(e.terrainOffsetProperty))this.updatersWithAttributes.set(n,e);else{let i=this;this.subscriptions.set(n,e.entity.definitionChanged.addEventListener(function(r,o,s,a){o==="isShowing"&&i.showsUpdated.set(e.id,e)}))}};ag.prototype.remove=function(e){let t=e.id;if(this.createPrimitive=this.geometry.remove(t)||this.createPrimitive,this.updaters.remove(t)){this.updatersWithAttributes.remove(t);let n=this.subscriptions.get(t);return l(n)&&(n(),this.subscriptions.remove(t),this.showsUpdated.remove(t)),!0}return!1};ag.prototype.update=function(e){let t=!0,n=0,i=this.primitive,r=this.primitives,o;if(this.createPrimitive){let s=this.geometry.values;if(s.length>0)l(i)&&(l(this.oldPrimitive)?r.remove(i):this.oldPrimitive=i),i=new Mn({show:!1,asynchronous:!0,geometryInstances:s.slice(),appearance:new An({flat:!0,translucent:this.translucent,renderState:{lineWidth:this.width}}),shadows:this.shadows}),r.add(i),t=!1;else{l(i)&&(r.remove(i),i=void 0);let c=this.oldPrimitive;l(c)&&(r.remove(c),this.oldPrimitive=void 0)}this.attributes.removeAll(),this.primitive=i,this.createPrimitive=!1,this.waitingOnCreate=!0}else if(l(i)&&i.ready){i.show=!0,l(this.oldPrimitive)&&(r.remove(this.oldPrimitive),this.oldPrimitive=void 0);let s=this.updatersWithAttributes.values,a=s.length,c=this.waitingOnCreate;for(o=0;o<a;o++){let u=s[o],f=this.geometry.get(u.id),d=this.attributes.get(f.id.id);if(l(d)||(d=i.getGeometryInstanceAttributes(f.id),this.attributes.set(f.id.id,d)),!u.outlineColorProperty.isConstant||c){let A=u.outlineColorProperty,b=X.getValueOrDefault(A,e,z.WHITE,j$e);z.equals(d._lastColor,b)||(d._lastColor=z.clone(b,d._lastColor),d.color=Jt.toValue(b,d.color),(this.translucent&&d.color[3]===255||!this.translucent&&d.color[3]!==255)&&(this.itemsToRemove[n++]=u))}let p=u.entity.isShowing&&(u.hasConstantOutline||u.isOutlineVisible(e)),g=d.show[0]===1;p!==g&&(d.show=Dn.toValue(p,d.show));let m=u.distanceDisplayConditionProperty;if(!X.isConstant(m)){let A=X.getValueOrDefault(m,e,G$e,H$e);Gt.equals(A,d._lastDistanceDisplayCondition)||(d._lastDistanceDisplayCondition=Gt.clone(A,d._lastDistanceDisplayCondition),d.distanceDisplayCondition=ti.toValue(A,d.distanceDisplayCondition))}let y=u.terrainOffsetProperty;if(!X.isConstant(y)){let A=X.getValueOrDefault(y,e,W$e,q$e);h.equals(A,d._lastOffset)||(d._lastOffset=h.clone(A,d._lastOffset),d.offset=Er.toValue(A,d.offset))}}this.updateShows(i),this.waitingOnCreate=!1}else l(i)&&!i.ready&&(t=!1);return this.itemsToRemove.length=n,t};ag.prototype.updateShows=function(e){let t=this.showsUpdated.values,n=t.length;for(let i=0;i<n;i++){let r=t[i],o=this.geometry.get(r.id),s=this.attributes.get(o.id.id);l(s)||(s=e.getGeometryInstanceAttributes(o.id),this.attributes.set(o.id.id,s));let a=r.entity.isShowing,c=s.show[0]===1;a!==c&&(s.show=Dn.toValue(a,s.show),o.attributes.show.value[0]=s.show[0])}this.showsUpdated.removeAll()};ag.prototype.contains=function(e){return this.updaters.contains(e.id)};ag.prototype.getBoundingSphere=function(e,t){let n=this.primitive;if(!n.ready)return Pt.PENDING;let i=n.getGeometryInstanceAttributes(e.entity);return!l(i)||!l(i.boundingSphere)||l(i.show)&&i.show[0]===0?Pt.FAILED:(i.boundingSphere.clone(t),Pt.DONE)};ag.prototype.removeAllPrimitives=function(){let e=this.primitives,t=this.primitive;l(t)&&(e.remove(t),this.primitive=void 0,this.geometry.removeAll(),this.updaters.removeAll());let n=this.oldPrimitive;l(n)&&(e.remove(n),this.oldPrimitive=void 0)};function fv(e,t,n){this._primitives=e,this._scene=t,this._shadows=n,this._solidBatches=new zt,this._translucentBatches=new zt}fv.prototype.add=function(e,t){let n=t.createOutlineGeometryInstance(e),i=this._scene.clampLineWidth(t.outlineWidth),r,o;n.attributes.color.value[3]===255?(r=this._solidBatches,o=r.get(i),l(o)||(o=new ag(this._primitives,!1,i,this._shadows),r.set(i,o)),o.add(t,n)):(r=this._translucentBatches,o=r.get(i),l(o)||(o=new ag(this._primitives,!0,i,this._shadows),r.set(i,o)),o.add(t,n))};fv.prototype.remove=function(e){let t,n=this._solidBatches.values,i=n.length;for(t=0;t<i;t++)if(n[t].remove(e))return;let r=this._translucentBatches.values,o=r.length;for(t=0;t<o;t++)if(r[t].remove(e))return};fv.prototype.update=function(e){let t,n,i,r,o=this._solidBatches.values,s=o.length,a=this._translucentBatches.values,c=a.length,u,f=!0,d;do{for(d=!1,n=0;n<s;n++){r=o[n],f=r.update(e),u=r.itemsToRemove;let p=u.length;if(p>0)for(d=!0,t=0;t<p;t++)i=u[t],r.remove(i),this.add(e,i)}for(n=0;n<c;n++){r=a[n],f=r.update(e),u=r.itemsToRemove;let p=u.length;if(p>0)for(d=!0,t=0;t<p;t++)i=u[t],r.remove(i),this.add(e,i)}}while(d);return f};fv.prototype.getBoundingSphere=function(e,t){let n,i=this._solidBatches.values,r=i.length;for(n=0;n<r;n++){let a=i[n];if(a.contains(e))return a.getBoundingSphere(e,t)}let o=this._translucentBatches.values,s=o.length;for(n=0;n<s;n++){let a=o[n];if(a.contains(e))return a.getBoundingSphere(e,t)}return Pt.FAILED};fv.prototype.removeAllPrimitives=function(){let e,t=this._solidBatches.values,n=t.length;for(e=0;e<n;e++)t[e].removeAllPrimitives();let i=this._translucentBatches.values,r=i.length;for(e=0;e<r;e++)i[e].removeAllPrimitives()};var PD=fv;var Y$e=[];function Tu(e,t,n,i){n=n??e.primitives,i=i??e.groundPrimitives,this._scene=e,this._primitives=n,this._groundPrimitives=i,this._entityCollection=void 0,this._addedObjects=new zt,this._removedObjects=new zt,this._changedObjects=new zt;let r=Pn.NUMBER_OF_SHADOW_MODES;this._outlineBatches=new Array(r*2),this._closedColorBatches=new Array(r*2),this._closedMaterialBatches=new Array(r*2),this._openColorBatches=new Array(r*2),this._openMaterialBatches=new Array(r*2);let o=Qr.supportsMaterialsforEntitiesOnTerrain(e);this._supportsMaterialsforEntitiesOnTerrain=o;let s;for(s=0;s<r;++s)this._outlineBatches[s]=new PD(n,e,s,!1),this._outlineBatches[r+s]=new PD(n,e,s,!0),this._closedColorBatches[s]=new Mh(n,An,void 0,!0,s,!0),this._closedColorBatches[r+s]=new Mh(n,An,void 0,!0,s,!1),this._closedMaterialBatches[s]=new Lh(n,Cr,void 0,!0,s,!0),this._closedMaterialBatches[r+s]=new Lh(n,Cr,void 0,!0,s,!1),this._openColorBatches[s]=new Mh(n,An,void 0,!1,s,!0),this._openColorBatches[r+s]=new Mh(n,An,void 0,!1,s,!1),this._openMaterialBatches[s]=new Lh(n,Cr,void 0,!1,s,!0),this._openMaterialBatches[r+s]=new Lh(n,Cr,void 0,!1,s,!1);let a=Qn.NUMBER_OF_CLASSIFICATION_TYPES,c=new Array(a),u=[];if(o)for(s=0;s<a;++s)u.push(new uU(i,s,Cr)),c[s]=new ID(i,s);else for(s=0;s<a;++s)c[s]=new ID(i,s);this._groundColorBatches=c,this._groundMaterialBatches=u,this._dynamicBatch=new AC(n,i),this._batches=this._outlineBatches.concat(this._closedColorBatches,this._closedMaterialBatches,this._openColorBatches,this._openMaterialBatches,this._groundColorBatches,this._groundMaterialBatches,this._dynamicBatch),this._subscriptions=new zt,this._updaterSets=new zt,this._entityCollection=t,t.collectionChanged.addEventListener(Tu.prototype._onCollectionChanged,this),this._onCollectionChanged(t,t.values,Y$e)}Tu.registerUpdater=function(e){iv.registerUpdater(e)};Tu.unregisterUpdater=function(e){iv.unregisterUpdater(e)};Tu.prototype.update=function(e){let t=this._addedObjects,n=t.values,i=this._removedObjects,r=i.values,o=this._changedObjects,s=o.values,a,c,u,f,d=this;for(a=s.length-1;a>-1;a--)c=s[a],u=c.id,f=this._updaterSets.get(u),f.entity===c?f.forEach(function(y){d._removeUpdater(y),d._insertUpdaterIntoBatch(e,y)}):(r.push(c),n.push(c));for(a=r.length-1;a>-1;a--)c=r[a],u=c.id,f=this._updaterSets.get(u),f.forEach(this._removeUpdater.bind(this)),f.destroy(),this._updaterSets.remove(u),this._subscriptions.get(u)(),this._subscriptions.remove(u);for(a=n.length-1;a>-1;a--)c=n[a],u=c.id,f=new iv(c,this._scene),this._updaterSets.set(u,f),f.forEach(function(y){d._insertUpdaterIntoBatch(e,y)}),this._subscriptions.set(u,f.geometryChanged.addEventListener(Tu._onGeometryChanged,this));t.removeAll(),i.removeAll(),o.removeAll();let p=!0,g=this._batches,m=g.length;for(a=0;a<m;a++)p=g[a].update(e)&&p;return p};var X$e=[],K$e=new ue;Tu.prototype.getBoundingSphere=function(e,t){let n=X$e,i=K$e,r=0,o,s=this._batches,a=s.length,c=e.id,u=this._updaterSets.get(c).updaters;for(let f=0;f<u.length;f++){let d=u[f];for(let p=0;p<a;p++){if(o=s[p].getBoundingSphere(d,i),o===Pt.PENDING)return Pt.PENDING;o===Pt.DONE&&(n[r]=ue.clone(i,n[r]),r++)}}return r===0?Pt.FAILED:(n.length=r,ue.fromBoundingSpheres(n,t),Pt.DONE)};Tu.prototype.isDestroyed=function(){return!1};Tu.prototype.destroy=function(){this._entityCollection.collectionChanged.removeEventListener(Tu.prototype._onCollectionChanged,this),this._addedObjects.removeAll(),this._removedObjects.removeAll();let e,t=this._batches,n=t.length;for(e=0;e<n;e++)t[e].removeAllPrimitives();let i=this._subscriptions.values;for(n=i.length,e=0;e<n;e++)i[e]();this._subscriptions.removeAll();let r=this._updaterSets.values;for(n=r.length,e=0;e<n;e++)r[e].destroy();return this._updaterSets.removeAll(),le(this)};Tu.prototype._removeUpdater=function(e){let t=this._batches,n=t.length;for(let i=0;i<n;i++)t[i].remove(e)};Tu.prototype._insertUpdaterIntoBatch=function(e,t){if(t.isDynamic){this._dynamicBatch.add(e,t);return}let n;(t.outlineEnabled||t.fillEnabled)&&(n=t.shadowsProperty.getValue(e));let i=Pn.NUMBER_OF_SHADOW_MODES;if(t.outlineEnabled&&(l(t.terrainOffsetProperty)?this._outlineBatches[i+n].add(e,t):this._outlineBatches[n].add(e,t)),t.fillEnabled)if(t.onTerrain){let r=t.classificationTypeProperty.getValue(e);t.fillMaterialProperty instanceof Kt?this._groundColorBatches[r].add(e,t):this._groundMaterialBatches[r].add(e,t)}else t.isClosed?t.fillMaterialProperty instanceof Kt?l(t.terrainOffsetProperty)?this._closedColorBatches[i+n].add(e,t):this._closedColorBatches[n].add(e,t):l(t.terrainOffsetProperty)?this._closedMaterialBatches[i+n].add(e,t):this._closedMaterialBatches[n].add(e,t):t.fillMaterialProperty instanceof Kt?l(t.terrainOffsetProperty)?this._openColorBatches[i+n].add(e,t):this._openColorBatches[n].add(e,t):l(t.terrainOffsetProperty)?this._openMaterialBatches[i+n].add(e,t):this._openMaterialBatches[n].add(e,t)};Tu._onGeometryChanged=function(e){let t=this._removedObjects,n=this._changedObjects,i=e.entity,r=i.id;!l(t.get(r))&&!l(n.get(r))&&n.set(r,i)};Tu.prototype._onCollectionChanged=function(e,t,n){let i=this._addedObjects,r=this._removedObjects,o=this._changedObjects,s,a,c;for(s=n.length-1;s>-1;s--)c=n[s],a=c.id,i.remove(a)||(r.set(a,c),o.remove(a));for(s=t.length-1;s>-1;s--)c=t[s],a=c.id,r.remove(a)?o.set(a,c):i.set(a,c)};var fU=Tu;var $$e=1,J$e="30px sans-serif",Z$e=Co.FILL,Q$e=z.WHITE,eJe=z.BLACK,tJe=1,nJe=!1,iJe=new z(.165,.165,.165,.8),rJe=new U(7,5),oJe=U.ZERO,sJe=h.ZERO,aJe=We.NONE,cJe=Gi.CENTER,lJe=qn.CENTER,uJe=new h,fJe=new z,dJe=new z,hJe=new z,mJe=new U,pJe=new h,gJe=new U,_Je=new qt,yJe=new qt,AJe=new qt,bJe=new Gt;function r_e(e){this.entity=e,this.label=void 0,this.index=void 0}function fy(e,t){t.collectionChanged.addEventListener(fy.prototype._onCollectionChanged,this),this._cluster=e,this._entityCollection=t,this._items=new zt,this._onCollectionChanged(t,t.values,[],[])}fy.prototype.update=function(e){let t=this._items.values,n=this._cluster;for(let i=0,r=t.length;i<r;i++){let o=t[i],s=o.entity,a=s._label,c,u=o.label,f=s.isShowing&&s.isAvailable(e)&&X.getValueOrDefault(a._show,e,!0),d;if(f&&(d=X.getValueOrUndefined(s._position,e,uJe),c=X.getValueOrUndefined(a._text,e),f=l(d)&&l(c)),!f){u$(o,s,n);continue}X.isConstant(s._position)||(n._clusterDirty=!0);let p=!1,g=X.getValueOrDefault(a._heightReference,e,aJe);l(u)||(u=n.getLabel(s),u.id=s,o.label=u,p=h.equals(u.position,d)&&u.heightReference===g),u.show=!0,u.position=d,u.text=c,u.scale=X.getValueOrDefault(a._scale,e,$$e),u.font=X.getValueOrDefault(a._font,e,J$e),u.style=X.getValueOrDefault(a._style,e,Z$e),u.fillColor=X.getValueOrDefault(a._fillColor,e,Q$e,fJe),u.outlineColor=X.getValueOrDefault(a._outlineColor,e,eJe,dJe),u.outlineWidth=X.getValueOrDefault(a._outlineWidth,e,tJe),u.showBackground=X.getValueOrDefault(a._showBackground,e,nJe),u.backgroundColor=X.getValueOrDefault(a._backgroundColor,e,iJe,hJe),u.backgroundPadding=X.getValueOrDefault(a._backgroundPadding,e,rJe,mJe),u.pixelOffset=X.getValueOrDefault(a._pixelOffset,e,oJe,gJe),u.eyeOffset=X.getValueOrDefault(a._eyeOffset,e,sJe,pJe),u.heightReference=g,u.horizontalOrigin=X.getValueOrDefault(a._horizontalOrigin,e,cJe),u.verticalOrigin=X.getValueOrDefault(a._verticalOrigin,e,lJe),u.translucencyByDistance=X.getValueOrUndefined(a._translucencyByDistance,e,_Je),u.pixelOffsetScaleByDistance=X.getValueOrUndefined(a._pixelOffsetScaleByDistance,e,yJe),u.scaleByDistance=X.getValueOrUndefined(a._scaleByDistance,e,AJe),u.distanceDisplayCondition=X.getValueOrUndefined(a._distanceDisplayCondition,e,bJe),u.disableDepthTestDistance=X.getValueOrUndefined(a._disableDepthTestDistance,e),p&&u._updateClamping()}return!0};fy.prototype.getBoundingSphere=function(e,t){let n=this._items.get(e.id);if(!l(n)||!l(n.label))return Pt.FAILED;let i=n.label;if(i.heightReference===We.NONE)t.center=h.clone(i.position,t.center);else if(i._clampedToSurface)t.center=h.clone(i._clampedPosition,t.center);else{let r=this._cluster._scene,o=this._items,s=Qm(r,n,i.position,[i],()=>o.get(e.id)===n);if(s===void 0)return Pt.PENDING;s===null?t.center=h.clone(i.position,t.center):t.center=W_(i.position,s,i.heightReference,r.ellipsoid??ee.default,t.center)}return t.radius=0,Pt.DONE};fy.prototype.isDestroyed=function(){return!1};fy.prototype.destroy=function(){this._entityCollection.collectionChanged.removeEventListener(fy.prototype._onCollectionChanged,this);let e=this._entityCollection.values;for(let t=0;t<e.length;t++)this._cluster.removeLabel(e[t]);return le(this)};fy.prototype._onCollectionChanged=function(e,t,n,i){let r,o,s=this._items,a=this._cluster;for(r=t.length-1;r>-1;r--)o=t[r],l(o._label)&&l(o._position)&&s.set(o.id,new r_e(o));for(r=i.length-1;r>-1;r--)o=i[r],l(o._label)&&l(o._position)?s.contains(o.id)||s.set(o.id,new r_e(o)):(u$(s.get(o.id),o,a),s.remove(o.id));for(r=n.length-1;r>-1;r--)o=n[r],u$(s.get(o.id),o,a),s.remove(o.id)};function u$(e,t,n){l(e)&&(e.label=void 0,n.removeLabel(t))}var dU=fy;var dv={HIGHLIGHT:0,REPLACE:1,MIX:2};dv.getColorBlend=function(e,t){if(e===dv.HIGHLIGHT)return 0;if(e===dv.REPLACE)return 1;if(e===dv.MIX)return P.clamp(t,P.EPSILON4,1)};Object.freeze(dv);var Ul=dv;/*! @license DOMPurify 3.4.14 | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/3.4.14/LICENSE */function o_e(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,i=Array(t);n<t;n++)i[n]=e[n];return i}function xJe(e){if(Array.isArray(e))return e}function TJe(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var i,r,o,s,a=[],c=!0,u=!1;try{if(o=(n=n.call(e)).next,t!==0)for(;!(c=(i=o.call(n)).done)&&(a.push(i.value),a.length!==t);c=!0);}catch(f){u=!0,r=f}finally{try{if(!c&&n.return!=null&&(s=n.return(),Object(s)!==s))return}finally{if(u)throw r}}return a}}function EJe(){throw new TypeError(`Invalid attempt to destructure non-iterable instance. +In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function CJe(e,t){return xJe(e)||TJe(e,t)||vJe(e,t)||EJe()}function vJe(e,t){if(e){if(typeof e=="string")return o_e(e,t);var n={}.toString.call(e).slice(8,-1);return n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set"?Array.from(e):n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?o_e(e,t):void 0}}var b_e=Object.entries,s_e=Object.setPrototypeOf,SJe=Object.isFrozen,wJe=Object.getPrototypeOf,IJe=Object.getOwnPropertyDescriptor,Ra=Object.freeze,ec=Object.seal,hv=Object.create,x_e=typeof Reflect<"u"&&Reflect,_$=x_e.apply,y$=x_e.construct;Ra||(Ra=function(t){return t});ec||(ec=function(t){return t});_$||(_$=function(t,n){for(var i=arguments.length,r=new Array(i>2?i-2:0),o=2;o<i;o++)r[o-2]=arguments[o];return t.apply(n,r)});y$||(y$=function(t){for(var n=arguments.length,i=new Array(n>1?n-1:0),r=1;r<n;r++)i[r-1]=arguments[r];return new t(...i)});var lx=ua(Array.prototype.forEach),PJe=ua(Array.prototype.lastIndexOf),a_e=ua(Array.prototype.pop),DD=ua(Array.prototype.push),DJe=ua(Array.prototype.splice),mv=Array.isArray,MD=ua(String.prototype.toLowerCase),f$=ua(String.prototype.toString),c_e=ua(String.prototype.match),RD=ua(String.prototype.replace),l_e=ua(String.prototype.indexOf),RJe=ua(String.prototype.trim),OJe=ua(Number.prototype.toString),MJe=ua(Boolean.prototype.toString),u_e=typeof BigInt>"u"?null:ua(BigInt.prototype.toString),f_e=typeof Symbol>"u"?null:ua(Symbol.prototype.toString),Eu=ua(Object.prototype.hasOwnProperty),OD=ua(Object.prototype.toString),Yc=ua(RegExp.prototype.test),cx=NJe(TypeError);function ua(e){return function(t){t instanceof RegExp&&(t.lastIndex=0);for(var n=arguments.length,i=new Array(n>1?n-1:0),r=1;r<n;r++)i[r-1]=arguments[r];return _$(e,t,i)}}function NJe(e){return function(){for(var t=arguments.length,n=new Array(t),i=0;i<t;i++)n[i]=arguments[i];return y$(e,n)}}function vr(e,t){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:MD;if(s_e&&s_e(e,null),!mv(t))return e;let i=t.length;for(;i--;){let r=t[i];if(typeof r=="string"){let o=n(r);o!==r&&(SJe(t)||(t[i]=o),r=o)}e[r]=!0}return e}function LJe(e){for(let t=0;t<e.length;t++)Eu(e,t)||(e[t]=null);return e}function mf(e){let t=hv(null);for(let i of b_e(e)){var n=CJe(i,2);let r=n[0],o=n[1];Eu(e,r)&&(mv(o)?t[r]=LJe(o):o&&typeof o=="object"&&o.constructor===Object?t[r]=mf(o):t[r]=o)}return t}function FJe(e){switch(typeof e){case"string":return e;case"number":return OJe(e);case"boolean":return MJe(e);case"bigint":return u_e?u_e(e):"0";case"symbol":return f_e?f_e(e):"Symbol()";case"undefined":return OD(e);case"function":case"object":{if(e===null)return OD(e);let t=e,n=Fh(t,"toString");if(typeof n=="function"){let i=n(t);return typeof i=="string"?i:OD(i)}return OD(e)}default:return OD(e)}}function Fh(e,t){for(;e!==null;){let i=IJe(e,t);if(i){if(i.get)return ua(i.get);if(typeof i.value=="function")return ua(i.value)}e=wJe(e)}function n(){return null}return n}function BJe(e){try{return Yc(e,""),!0}catch{return!1}}var d_e=Ra(["a","abbr","acronym","address","area","article","aside","audio","b","bdi","bdo","big","blink","blockquote","body","br","button","canvas","caption","center","cite","code","col","colgroup","content","data","datalist","dd","decorator","del","details","dfn","dialog","dir","div","dl","dt","element","em","fieldset","figcaption","figure","font","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","img","input","ins","kbd","label","legend","li","main","map","mark","marquee","menu","menuitem","meter","nav","nobr","ol","optgroup","option","output","p","picture","pre","progress","q","rp","rt","ruby","s","samp","search","section","select","shadow","slot","small","source","spacer","span","strike","strong","style","sub","summary","sup","table","tbody","td","template","textarea","tfoot","th","thead","time","tr","track","tt","u","ul","var","video","wbr"]),d$=Ra(["svg","a","altglyph","altglyphdef","altglyphitem","animatecolor","animatemotion","animatetransform","circle","clippath","defs","desc","ellipse","enterkeyhint","exportparts","filter","font","g","glyph","glyphref","hkern","image","inputmode","line","lineargradient","marker","mask","metadata","mpath","part","path","pattern","polygon","polyline","radialgradient","rect","stop","style","switch","symbol","text","textpath","title","tref","tspan","view","vkern"]),h$=Ra(["feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feDropShadow","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence"]),kJe=Ra(["animate","color-profile","cursor","discard","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","foreignobject","hatch","hatchpath","mesh","meshgradient","meshpatch","meshrow","missing-glyph","script","set","solidcolor","unknown","use"]),m$=Ra(["math","menclose","merror","mfenced","mfrac","mglyph","mi","mlabeledtr","mmultiscripts","mn","mo","mover","mpadded","mphantom","mroot","mrow","ms","mspace","msqrt","mstyle","msub","msup","msubsup","mtable","mtd","mtext","mtr","munder","munderover","mprescripts"]),UJe=Ra(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),h_e=Ra(["#text"]),m_e=Ra(["accept","action","align","alt","autocapitalize","autocomplete","autopictureinpicture","autoplay","background","bgcolor","border","capture","cellpadding","cellspacing","checked","cite","class","clear","color","cols","colspan","command","commandfor","controls","controlslist","coords","crossorigin","datetime","decoding","default","dir","disabled","disablepictureinpicture","disableremoteplayback","download","draggable","enctype","enterkeyhint","exportparts","face","for","headers","height","hidden","high","href","hreflang","id","inert","inputmode","integrity","ismap","kind","label","lang","list","loading","loop","low","max","maxlength","media","method","min","minlength","multiple","muted","name","nonce","noshade","novalidate","nowrap","open","optimum","part","pattern","placeholder","playsinline","popover","popovertarget","popovertargetaction","poster","preload","pubdate","radiogroup","readonly","rel","required","rev","reversed","role","rows","rowspan","spellcheck","scope","selected","shape","size","sizes","slot","span","srclang","start","src","srcset","step","style","summary","tabindex","title","translate","type","usemap","valign","value","width","wrap","xmlns"]),p$=Ra(["accent-height","accumulate","additive","alignment-baseline","amplitude","ascent","attributename","attributetype","azimuth","basefrequency","baseline-shift","begin","bias","by","class","clip","clippathunits","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","cx","cy","d","dx","dy","diffuseconstant","direction","display","divisor","dominant-baseline","dur","edgemode","elevation","end","exponent","fill","fill-opacity","fill-rule","filter","filterunits","flood-color","flood-opacity","font-family","font-size","font-size-adjust","font-stretch","font-style","font-variant","font-weight","fx","fy","g1","g2","glyph-name","glyphref","gradientunits","gradienttransform","height","href","id","image-rendering","in","in2","intercept","k","k1","k2","k3","k4","kerning","keypoints","keysplines","keytimes","lang","lengthadjust","letter-spacing","kernelmatrix","kernelunitlength","lighting-color","local","marker-end","marker-mid","marker-start","markerheight","markerunits","markerwidth","maskcontentunits","maskunits","max","mask","mask-type","media","method","mode","min","name","numoctaves","offset","operator","opacity","order","orient","orientation","origin","overflow","paint-order","path","pathlength","patterncontentunits","patterntransform","patternunits","pointer-events","points","preservealpha","preserveaspectratio","primitiveunits","r","rx","ry","radius","refx","refy","repeatcount","repeatdur","restart","result","rotate","scale","seed","shape-rendering","slope","specularconstant","specularexponent","spreadmethod","startoffset","stddeviation","stitchtiles","stop-color","stop-opacity","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke","stroke-width","style","surfacescale","systemlanguage","tabindex","tablevalues","targetx","targety","transform","transform-origin","text-anchor","text-decoration","text-orientation","text-rendering","textlength","type","u1","u2","unicode","values","vector-effect","viewbox","visibility","version","vert-adv-y","vert-origin-x","vert-origin-y","width","word-spacing","wrap","writing-mode","xchannelselector","ychannelselector","x","x1","x2","xmlns","y","y1","y2","z","zoomandpan"]),p_e=Ra(["accent","accentunder","align","bevelled","close","columnalign","columnlines","columnspacing","columnspan","denomalign","depth","dir","display","displaystyle","encoding","fence","frame","height","href","id","largeop","length","linethickness","lquote","lspace","mathbackground","mathcolor","mathsize","mathvariant","maxsize","minsize","movablelimits","notation","numalign","open","rowalign","rowlines","rowspacing","rowspan","rspace","rquote","scriptlevel","scriptminsize","scriptsizemultiplier","selection","separator","separators","stretchy","subscriptshift","supscriptshift","symmetric","voffset","width","xmlns"]),hU=Ra(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),zJe=ec(/{{[\w\W]*|^[\w\W]*}}/g),VJe=ec(/<%[\w\W]*|^[\w\W]*%>/g),jJe=ec(/\${[\w\W]*/g),HJe=ec(/^data-[\-\w.\u00B7-\uFFFF]+$/),GJe=ec(/^aria-[\-\w]+$/),g_e=ec(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),WJe=ec(/^(?:\w+script|data):/i),qJe=ec(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),YJe=ec(/^html$/i),XJe=ec(/^[a-z][.\w]*(-[.\w]+)+$/i),__e=ec(/<[/\w!]/g),y_e=ec(/<[/\w]/g),KJe=ec(/<\/no(script|embed|frames)/i),$Je=ec(/\/>/i),hf={element:1,attribute:2,text:3,cdataSection:4,entityReference:5,entityNode:6,processingInstruction:7,comment:8,document:9,documentType:10,documentFragment:11,notation:12},T_e=["style","script","xmp","iframe","noembed","noframes","plaintext","noscript"],JJe=Ra(vr({},T_e)),ZJe=(function(){let e={};return lx(T_e,t=>{e[t]=ec(new RegExp("</"+t+"(?=[\\t\\n\\f\\r />])","i"))}),Ra(e)})(),QJe=function(){return typeof window>"u"?null:window},eZe=function(t,n){if(typeof t!="object"||typeof t.createPolicy!="function")return null;let i=null,r="data-tt-policy-suffix";n&&n.hasAttribute(r)&&(i=n.getAttribute(r));let o="dompurify"+(i?"#"+i:"");try{return t.createPolicy(o,{createHTML(s){return s},createScriptURL(s){return s}})}catch{return console.warn("TrustedTypes policy "+o+" could not be created."),null}},A_e=function(){return{afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}},dy=function(t,n,i,r){return Eu(t,n)&&mv(t[n])?vr(r.base?mf(r.base):{},t[n],r.transform):i},g$=function(t,n,i){let r=Eu(t,n)?t[n]:void 0;return r&&typeof r=="object"?mf(r):i()};function E_e(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:QJe(),t=Et=>E_e(Et);if(t.version="3.4.14",t.removed=[],!e||!e.document||e.document.nodeType!==hf.document||!e.Element)return t.isSupported=!1,t;let n=e.document,i=n,r=i.currentScript;e.DocumentFragment;let o=e.HTMLTemplateElement,s=e.Node,a=e.Element,c=e.NodeFilter,u=e.NamedNodeMap;u===void 0&&(e.NamedNodeMap||e.MozNamedAttrMap),e.HTMLFormElement;let f=e.DOMParser,d=e.trustedTypes,p=a.prototype,g=Fh(p,"cloneNode"),m=Fh(p,"remove"),y=Fh(p,"nextSibling"),A=Fh(p,"childNodes"),b=Fh(p,"parentNode"),x=Fh(p,"shadowRoot"),T=Fh(p,"attributes"),E=s&&s.prototype?Fh(s.prototype,"nodeType"):null,v=s&&s.prototype?Fh(s.prototype,"nodeName"):null,S=s&&s.prototype?Fh(s.prototype,"ownerDocument"):null,I=function(ye){return E?E(ye):ye.nodeType},R=function(ye){return v?v(ye):ye.nodeName};if(typeof o=="function"){let Et=n.createElement("template");Et.content&&Et.content.ownerDocument&&(n=Et.content.ownerDocument)}let O,L="",_,C=!1,w=0,D=function(){if(w>0)throw cx('A configured TRUSTED_TYPES_POLICY callback (createHTML or createScriptURL) must not call DOMPurify.sanitize, as that causes infinite recursion. Do not pass a policy whose callbacks wrap DOMPurify as TRUSTED_TYPES_POLICY; see the "DOMPurify and Trusted Types" section of the README.')},N=function(ye){D(),w++;try{return O.createHTML(ye)}finally{w--}},F=function(ye){D(),w++;try{return O.createScriptURL(ye)}finally{w--}},V=function(){return C||(_=eZe(d,r),C=!0),_},B=n,j=B.implementation,k=B.createNodeIterator,G=B.createDocumentFragment,q=B.getElementsByTagName,Q=i.importNode,W=A_e();t.isSupported=typeof b_e=="function"&&typeof b=="function"&&j&&j.createHTMLDocument!==void 0;let J=zJe,Z=VJe,ae=jJe,Ae=HJe,fe=GJe,xe=WJe,ge=qJe,we=XJe,ve=g_e,Re=null,Qe=vr({},[...d_e,...d$,...h$,...m$,...h_e]),He=null,Ye=vr({},[...m_e,...p$,...p_e,...hU]),Ke=Object.seal(hv(null,{tagNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},allowCustomizedBuiltInElements:{writable:!0,configurable:!1,enumerable:!0,value:!1}})),Pe=null,qe=null,st=Object.seal(hv(null,{tagCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeCheck:{writable:!0,configurable:!1,enumerable:!0,value:null}})),vt=!0,jt=!0,lt=!1,mt=!0,ft=!1,Yt=!0,rt=!1,ht=!1,Li=null,Yn=null,yi=!1,zi=!1,Si=!1,ui=!1,Ai=!0,zn=!1,tn="user-content-",Hn=!0,Ki=!1,wr={},so=null,Ts=vr({},["annotation-xml","audio","colgroup","desc","foreignobject","head","iframe","math","mi","mn","mo","ms","mtext","noembed","noframes","noscript","plaintext","script","selectedcontent","style","svg","template","thead","title","video","xmp"]),zs=null,$r=vr({},["audio","video","img","source","image","track"]),pi=null,ao=vr({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),nr="http://www.w3.org/1998/Math/MathML",jo="http://www.w3.org/2000/svg",Fn="http://www.w3.org/1999/xhtml",Vi=Fn,Fi=!1,Ir=null,Mc=vr({},[nr,jo,Fn],f$),qf=Ra(["mi","mo","mn","ms","mtext"]),Rm=vr({},qf),ch=Ra(["annotation-xml"]),na=vr({},ch),Om=vr({},["title","style","font","a","script"]),Es=null,Ha=["application/xhtml+xml","text/html"],ub="text/html",ii=null,Wr=null,_l=n.createElement("form"),w0=function(ye){return ye instanceof RegExp||ye instanceof Function},Ca=function(){let ye=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(Wr&&Wr===ye)return;(!ye||typeof ye!="object")&&(ye={}),ye=mf(ye),Es=Ha.indexOf(ye.PARSER_MEDIA_TYPE)===-1?ub:ye.PARSER_MEDIA_TYPE,ii=Es==="application/xhtml+xml"?f$:MD,Re=dy(ye,"ALLOWED_TAGS",Qe,{transform:ii}),He=dy(ye,"ALLOWED_ATTR",Ye,{transform:ii}),Ir=dy(ye,"ALLOWED_NAMESPACES",Mc,{transform:f$}),pi=dy(ye,"ADD_URI_SAFE_ATTR",ao,{transform:ii,base:ao}),zs=dy(ye,"ADD_DATA_URI_TAGS",$r,{transform:ii,base:$r}),so=dy(ye,"FORBID_CONTENTS",Ts,{transform:ii}),Pe=dy(ye,"FORBID_TAGS",mf({}),{transform:ii}),qe=dy(ye,"FORBID_ATTR",mf({}),{transform:ii}),wr=Eu(ye,"USE_PROFILES")?ye.USE_PROFILES&&typeof ye.USE_PROFILES=="object"?mf(ye.USE_PROFILES):ye.USE_PROFILES:!1,vt=ye.ALLOW_ARIA_ATTR!==!1,jt=ye.ALLOW_DATA_ATTR!==!1,lt=ye.ALLOW_UNKNOWN_PROTOCOLS||!1,mt=ye.ALLOW_SELF_CLOSE_IN_ATTR!==!1,ft=ye.SAFE_FOR_TEMPLATES||!1,Yt=ye.SAFE_FOR_XML!==!1,rt=ye.WHOLE_DOCUMENT||!1,zi=ye.RETURN_DOM||!1,Si=ye.RETURN_DOM_FRAGMENT||!1,ui=ye.RETURN_TRUSTED_TYPE||!1,yi=ye.FORCE_BODY||!1,Ai=ye.SANITIZE_DOM!==!1,zn=ye.SANITIZE_NAMED_PROPS||!1,Hn=ye.KEEP_CONTENT!==!1,Ki=ye.IN_PLACE||!1,ve=BJe(ye.ALLOWED_URI_REGEXP)?ye.ALLOWED_URI_REGEXP:g_e,Vi=typeof ye.NAMESPACE=="string"?ye.NAMESPACE:Fn,Rm=g$(ye,"MATHML_TEXT_INTEGRATION_POINTS",()=>vr({},qf)),na=g$(ye,"HTML_INTEGRATION_POINTS",()=>vr({},ch));let Fe=g$(ye,"CUSTOM_ELEMENT_HANDLING",()=>hv(null));if(Ke=hv(null),Eu(Fe,"tagNameCheck")&&w0(Fe.tagNameCheck)&&(Ke.tagNameCheck=Fe.tagNameCheck),Eu(Fe,"attributeNameCheck")&&w0(Fe.attributeNameCheck)&&(Ke.attributeNameCheck=Fe.attributeNameCheck),Eu(Fe,"allowCustomizedBuiltInElements")&&typeof Fe.allowCustomizedBuiltInElements=="boolean"&&(Ke.allowCustomizedBuiltInElements=Fe.allowCustomizedBuiltInElements),ec(Ke),ft&&(jt=!1),Si&&(zi=!0),wr&&(Re=vr({},h_e),He=hv(null),wr.html===!0&&(vr(Re,d_e),vr(He,m_e)),wr.svg===!0&&(vr(Re,d$),vr(He,p$),vr(He,hU)),wr.svgFilters===!0&&(vr(Re,h$),vr(He,p$),vr(He,hU)),wr.mathMl===!0&&(vr(Re,m$),vr(He,p_e),vr(He,hU))),st.tagCheck=null,st.attributeCheck=null,Eu(ye,"ADD_TAGS")&&(typeof ye.ADD_TAGS=="function"?st.tagCheck=ye.ADD_TAGS:mv(ye.ADD_TAGS)&&(Re===Qe&&(Re=mf(Re)),vr(Re,ye.ADD_TAGS,ii))),Eu(ye,"ADD_ATTR")&&(typeof ye.ADD_ATTR=="function"?st.attributeCheck=ye.ADD_ATTR:mv(ye.ADD_ATTR)&&(He===Ye&&(He=mf(He)),vr(He,ye.ADD_ATTR,ii))),Eu(ye,"ADD_FORBID_CONTENTS")&&mv(ye.ADD_FORBID_CONTENTS)&&(so===Ts&&(so=mf(so)),vr(so,ye.ADD_FORBID_CONTENTS,ii)),Hn&&(Re["#text"]=!0),rt&&vr(Re,["html","head","body"]),Re.table&&(vr(Re,["tbody"]),delete Pe.tbody),ye.TRUSTED_TYPES_POLICY){if(typeof ye.TRUSTED_TYPES_POLICY.createHTML!="function")throw cx('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if(typeof ye.TRUSTED_TYPES_POLICY.createScriptURL!="function")throw cx('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');let gt=O;O=ye.TRUSTED_TYPES_POLICY;try{L=N("")}catch(on){throw O=gt,on}}else ye.TRUSTED_TYPES_POLICY===null?(O=void 0,L=""):(O===void 0&&(O=V()),O&&typeof L=="string"&&(L=N("")));Ra&&Ra(ye),Wr=ye},Mm=vr({},[...d$,...h$,...kJe]),b_=vr({},[...m$,...UJe]),iq=function(ye,Fe,gt){return Fe.namespaceURI===Fn?ye==="svg":Fe.namespaceURI===nr?ye==="svg"&&(gt==="annotation-xml"||Rm[gt]):!!Mm[ye]},rq=function(ye,Fe,gt){return Fe.namespaceURI===Fn?ye==="math":Fe.namespaceURI===jo?ye==="math"&&na[gt]:!!b_[ye]},oq=function(ye,Fe,gt){return Fe.namespaceURI===jo&&!na[gt]||Fe.namespaceURI===nr&&!Rm[gt]?!1:!b_[ye]&&(Om[ye]||!Mm[ye])},sq=function(ye){let Fe=b(ye);(!Fe||!Fe.tagName)&&(Fe={namespaceURI:Vi,tagName:"template"});let gt=MD(ye.tagName),on=MD(Fe.tagName);return Ir[ye.namespaceURI]?ye.namespaceURI===jo?iq(gt,Fe,on):ye.namespaceURI===nr?rq(gt,Fe,on):ye.namespaceURI===Fn?oq(gt,Fe,on):!!(Es==="application/xhtml+xml"&&Ir[ye.namespaceURI]):!1},Nm=function(ye){DD(t.removed,{element:ye});try{b(ye).removeChild(ye)}catch{if(m(ye),!b(ye))throw cx("a node selected for removal could not be detached from its tree and cannot be safely returned; refusing to sanitize in place")}},hE=function(ye,Fe,gt){try{ye.removeAttributeNode(Fe)}catch{try{ye.removeAttribute(gt)}catch{}}},fb=function(ye){db(ye);let Fe=A(ye);if(Fe){let on=[];lx(Fe,wn=>{DD(on,wn)}),lx(on,wn=>{try{m(wn)}catch{}})}let gt=T(ye);if(gt)for(let on=gt.length-1;on>=0;--on){let wn=gt[on],ri=wn&&wn.name;typeof ri=="string"&&hE(ye,wn,ri)}},lh=function(ye,Fe,gt){if(!gt)try{gt=Fe.getAttributeNode(ye)}catch{gt=null}DD(t.removed,{attribute:gt||null,from:Fe});try{gt?Fe.removeAttributeNode(gt):Fe.removeAttribute(ye)}catch{try{Fe.removeAttribute(ye)}catch{}}if(ye==="is")if(zi||Si)try{Nm(Fe)}catch{}else try{Fe.setAttribute(ye,"")}catch{}},aq=function(ye){let Fe=T(ye);if(Fe)for(let gt=Fe.length-1;gt>=0;--gt){let on=Fe[gt],wn=on&&on.name;typeof wn!="string"||He[ii(wn)]||hE(ye,on,wn)}},db=function(ye){let Fe=[ye];for(;Fe.length>0;){let gt=Fe.pop();I(gt)===hf.element&&aq(gt);let wn=A(gt);if(wn)for(let ri=wn.length-1;ri>=0;--ri)Fe.push(wn[ri])}},mE=function(ye,Fe){return Yt?ye==="patchsrc"?!0:ye==="for"&&Fe!=="label"&&Fe!=="output":!1},Lm=function(ye){if(!Yt)return;let Fe=[ye];for(;Fe.length>0;){let gt=Fe.pop(),on=I(gt);if(on===hf.processingInstruction||on===hf.comment&&Yc(y_e,gt.data)){try{m(gt)}catch{}continue}if(on===hf.element){let ri=gt,bo=ii(R(gt));try{ri.hasAttribute&&ri.hasAttribute("patchsrc")&&ri.removeAttribute("patchsrc"),ri.hasAttribute&&ri.hasAttribute("for")&&mE("for",bo)&&ri.removeAttribute("for")}catch{}}let wn=A(gt);if(wn)for(let ri=wn.length-1;ri>=0;--ri)Fe.push(wn[ri])}},hb=function(ye){let Fe=null,gt=null;if(yi)ye="<remove></remove>"+ye;else{let ri=c_e(ye,/^[\r\n\t ]+/);gt=ri&&ri[0]}Es==="application/xhtml+xml"&&Vi===Fn&&(ye='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+ye+"</body></html>");let on=O?N(ye):ye;if(Vi===Fn)try{Fe=new f().parseFromString(on,Es)}catch{}if(!Fe||!Fe.documentElement){Fe=j.createDocument(Vi,"template",null);try{Fe.documentElement.innerHTML=Fi?L:on}catch{}}let wn=Fe.body||Fe.documentElement;return ye&>&&wn.insertBefore(n.createTextNode(gt),wn.childNodes[0]||null),Vi===Fn?q.call(Fe,rt?"html":"body")[0]:rt?Fe.documentElement:wn},NI=function(ye){let Fe=S?S(ye):ye.ownerDocument;return k.call(Fe||ye,ye,c.SHOW_ELEMENT|c.SHOW_COMMENT|c.SHOW_TEXT|c.SHOW_PROCESSING_INSTRUCTION|c.SHOW_CDATA_SECTION,null)},pE=function(ye){return ye=RD(ye,J," "),ye=RD(ye,Z," "),ye=RD(ye,ae," "),ye},x_=function(ye){var Fe;ye.normalize();let gt=S?S(ye):ye.ownerDocument,on=k.call(gt||ye,ye,c.SHOW_TEXT|c.SHOW_COMMENT|c.SHOW_CDATA_SECTION|c.SHOW_PROCESSING_INSTRUCTION,null),wn=on.nextNode();for(;wn;)wn.data=pE(wn.data),wn=on.nextNode();let ri=(Fe=ye.querySelectorAll)===null||Fe===void 0?void 0:Fe.call(ye,"template");ri&&lx(ri,bo=>{ne(bo.content)&&x_(bo.content)})},ce=function(ye){let Fe=v?v(ye):null;return typeof Fe!="string"||ii(Fe)!=="form"?!1:typeof ye.nodeName!="string"||typeof ye.textContent!="string"||typeof ye.removeChild!="function"||ye.attributes!==T(ye)||typeof ye.removeAttribute!="function"||typeof ye.setAttribute!="function"||typeof ye.namespaceURI!="string"||typeof ye.insertBefore!="function"||typeof ye.hasChildNodes!="function"||ye.nodeType!==E(ye)||ye.childNodes!==A(ye)},ne=function(ye){if(!E||typeof ye!="object"||ye===null)return!1;try{return E(ye)===hf.documentFragment}catch{return!1}},Te=function(ye){if(!E||typeof ye!="object"||ye===null)return!1;try{return typeof E(ye)=="number"}catch{return!1}};function Ce(Et,ye,Fe){Et.length!==0&&lx(Et,gt=>{gt.call(t,ye,Fe,Wr)})}let Je=function(ye,Fe){return!!(Yt&&ye.hasChildNodes()&&!Te(ye.firstElementChild)&&Yc(__e,ye.textContent)&&Yc(__e,ye.innerHTML)||Yt&&ye.namespaceURI===Fn&&JJe[Fe]&&(Te(ye.firstElementChild)||typeof ye.textContent=="string"&&Yc(ZJe[Fe],ye.textContent))||ye.nodeType===hf.processingInstruction||Yt&&ye.nodeType===hf.comment&&Yc(y_e,ye.data))},Tt=function(ye,Fe){if(ye instanceof RegExp)return Yc(ye,Fe);if(ye instanceof Function){for(var gt=arguments.length,on=new Array(gt>2?gt-2:0),wn=2;wn<gt;wn++)on[wn-2]=arguments[wn];return!!ye(Fe,...on)}return!1},pt=function(ye,Fe,gt){if(!Pe[Fe]&&co(Fe)&&Tt(Ke.tagNameCheck,Fe))return!1;if(Hn&&!so[Fe]){let on=b(ye),wn=A(ye);if(wn&&on){let ri=wn.length;for(let bo=ri-1;bo>=0;--bo){let rs=ye===gt?g(wn[bo],!0):wn[bo];on.insertBefore(rs,y(ye))}}}return Nm(ye),!0},St=function(ye,Fe,gt,on){return ye.length===0?Fe:Fe===gt||Fe===on?mf(Fe):Fe},bn=function(ye,Fe){return ye===Fe||b(ye)!==null?!1:(Ki&&db(ye),!0)},Gn=function(ye,Fe){if(Ce(W.beforeSanitizeElements,ye,null),bn(ye,Fe))return!0;if(ce(ye))return Nm(ye),!0;let gt=ii(R(ye));if(Re=St(W.uponSanitizeElement,Re,Qe,Li),Ce(W.uponSanitizeElement,ye,{tagName:gt,allowedTags:Re}),bn(ye,Fe))return!0;if(Je(ye,gt))return Nm(ye),!0;if(Pe[gt]||!(st.tagCheck instanceof Function&&st.tagCheck(gt))&&!Re[gt]){let wn=pt(ye,gt,Fe);return wn===!1&&Ce(W.afterSanitizeElements,ye,null),wn}if(I(ye)===hf.element&&!sq(ye)||(gt==="noscript"||gt==="noembed"||gt==="noframes")&&Yc(KJe,ye.innerHTML))return Nm(ye),!0;if(ft&&ye.nodeType===hf.text){let wn=pE(ye.textContent);ye.textContent!==wn&&(DD(t.removed,{element:ye.cloneNode()}),ye.textContent=wn)}return Ce(W.afterSanitizeElements,ye,null),!1},mn=function(ye,Fe,gt){if(qe[Fe]||mE(Fe,ye)||Ai&&(Fe==="id"||Fe==="name")&&(gt in n||gt in _l))return!1;let on=He[Fe]||st.attributeCheck instanceof Function&&st.attributeCheck(Fe,ye);return jt&&Yc(Ae,Fe)||vt&&Yc(fe,Fe)?!0:on?pi[Fe]||Yc(ve,RD(gt,ge,""))||(Fe==="src"||Fe==="xlink:href"||Fe==="href")&&ye!=="script"&&l_e(gt,"data:")===0&&zs[ye]||lt&&!Yc(xe,RD(gt,ge,""))?!0:!gt:co(ye)&&Tt(Ke.tagNameCheck,ye)&&Tt(Ke.attributeNameCheck,Fe,ye)||Fe==="is"&&Ke.allowCustomizedBuiltInElements&&Tt(Ke.tagNameCheck,gt)},Ao=vr({},["annotation-xml","color-profile","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","missing-glyph"]),co=function(ye){return!Ao[MD(ye)]&&Yc(we,ye)},Vs=function(ye,Fe,gt,on){if(O&&typeof d=="object"&&typeof d.getAttributeType=="function"&&!gt)switch(d.getAttributeType(ye,Fe)){case"TrustedHTML":return N(on);case"TrustedScriptURL":return F(on)}return on},pc=function(ye,Fe,gt,on){try{gt?ye.setAttributeNS(gt,Fe,on):ye.setAttribute(Fe,on),ce(ye)?Nm(ye):a_e(t.removed)}catch{lh(Fe,ye)}},yl=function(ye){Ce(W.beforeSanitizeAttributes,ye,null);let Fe=ye.attributes;if(!Fe||ce(ye))return;He=St(W.uponSanitizeAttribute,He,Ye,Yn);let gt={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:He,forceKeepAttr:void 0},on=Fe.length,wn=ii(ye.nodeName);for(;on--;){let ri=Fe[on],bo=ri.name,rs=ri.namespaceURI,nu=ri.value,iu=ii(bo),cq=nu,Al=bo==="value"?cq:RJe(cq);if(gt.attrName=iu,gt.attrValue=Al,gt.keepAttr=!0,gt.forceKeepAttr=void 0,Ce(W.uponSanitizeAttribute,ye,gt),Al=gt.attrValue,zn&&(iu==="id"||iu==="name")&&l_e(Al,tn)!==0&&(lh(bo,ye,ri),Al=tn+Al),Yt&&Yc(/((--!?|])>)|<\/(style|script|title|xmp|textarea|noscript|iframe|noembed|noframes)/i,Al)){lh(bo,ye,ri);continue}if(iu==="attributename"&&c_e(Al,"href")){lh(bo,ye,ri);continue}if(!gt.forceKeepAttr){if(!gt.keepAttr){lh(bo,ye,ri);continue}if(!mt&&Yc($Je,Al)){lh(bo,ye,ri);continue}if(ft&&(Al=pE(Al)),!mn(wn,iu,Al)){lh(bo,ye,ri);continue}Al=Vs(wn,iu,rs,Al),Al!==cq&&pc(ye,bo,rs,Al)}}Ce(W.afterSanitizeAttributes,ye,null)},tu=function(ye){let Fe=null,gt=NI(ye);for(Ce(W.beforeSanitizeShadowDOM,ye,null);Fe=gt.nextNode();)if(Ce(W.uponSanitizeShadowNode,Fe,null),Gn(Fe,ye),yl(Fe),ne(Fe.content)&&tu(Fe.content),I(Fe)===hf.element){let on=x(Fe);ne(on)&&(I0(on),tu(on))}Ce(W.afterSanitizeShadowDOM,ye,null)},I0=function(ye){let Fe=[{node:ye,shadow:null}];for(;Fe.length>0;){let gt=Fe.pop();if(gt.shadow){tu(gt.shadow);continue}let on=gt.node,ri=I(on)===hf.element,bo=A(on);if(bo)for(let rs=bo.length-1;rs>=0;--rs)Fe.push({node:bo[rs],shadow:null});if(ri){let rs=v?v(on):null;if(typeof rs=="string"&&ii(rs)==="template"){let nu=on.content;ne(nu)&&Fe.push({node:nu,shadow:null})}}if(ri){let rs=x(on);ne(rs)&&Fe.push({node:null,shadow:rs},{node:rs,shadow:null})}}};return t.sanitize=function(Et){let ye=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},Fe=null,gt=null,on=null,wn=null;if(Fi=!Et,Fi&&(Et="<!-->"),typeof Et!="string"&&!Te(Et)&&(Et=FJe(Et),typeof Et!="string"))throw cx("dirty is not a string, aborting");if(!t.isSupported)return Et;ht?(Re=Li,He=Yn):Ca(ye),(W.uponSanitizeElement.length>0||W.uponSanitizeAttribute.length>0)&&(Re=mf(Re)),W.uponSanitizeAttribute.length>0&&(He=mf(He)),t.removed=[];let ri=Ki&&typeof Et!="string"&&Te(Et);if(ri){Lm(Et);let nu=R(Et);if(typeof nu=="string"){let iu=ii(nu);if(!Re[iu]||Pe[iu])throw fb(Et),cx("root node is forbidden and cannot be sanitized in-place")}if(ce(Et))throw fb(Et),cx("root node is clobbered and cannot be sanitized in-place");try{I0(Et)}catch(iu){throw fb(Et),iu}}else if(Te(Et))Fe=hb("<!---->"),gt=Fe.ownerDocument.importNode(Et,!0),gt.nodeType===hf.element&>.nodeName==="BODY"||gt.nodeName==="HTML"?Fe=gt:Fe.appendChild(gt),I0(gt);else{if(!zi&&!ft&&!rt&&Et.indexOf("<")===-1)return O&&ui?N(Et):Et;if(Fe=hb(Et),!Fe)return zi?null:ui?L:""}Fe&&yi&&Nm(Fe.firstChild);let bo=ri?Et:Fe;try{let nu=NI(bo);for(;on=nu.nextNode();)Gn(on,bo),yl(on),ne(on.content)&&tu(on.content)}catch(nu){throw ri&&(fb(Et),lx(t.removed,iu=>{iu.element&&db(iu.element)})),nu}if(ri)return lx(t.removed,nu=>{nu.element&&db(nu.element)}),ft&&x_(Et),Et;if(zi){if(ft&&x_(Fe),Si)for(wn=G.call(Fe.ownerDocument);Fe.firstChild;)wn.appendChild(Fe.firstChild);else wn=Fe;return(He.shadowroot||He.shadowrootmode)&&(wn=Q.call(i,wn,!0)),wn}let rs=rt?Fe.outerHTML:Fe.innerHTML;return rt&&Re["!doctype"]&&Fe.ownerDocument&&Fe.ownerDocument.doctype&&Fe.ownerDocument.doctype.name&&Yc(YJe,Fe.ownerDocument.doctype.name)&&(rs="<!DOCTYPE "+Fe.ownerDocument.doctype.name+`> +`+rs),ft&&(rs=pE(rs)),O&&ui?N(rs):rs},t.setConfig=function(){let Et=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};Ca(Et),ht=!0,Li=Re,Yn=He},t.clearConfig=function(){Wr=null,ht=!1,Li=null,Yn=null,O=_,L=""},t.isValidAttribute=function(Et,ye,Fe){Wr||Ca({});let gt=ii(Et),on=ii(ye);return mn(gt,on,Fe)},t.addHook=function(Et,ye){typeof ye=="function"&&Eu(W,Et)&&DD(W[Et],ye)},t.removeHook=function(Et,ye){if(Eu(W,Et)){if(ye!==void 0){let Fe=PJe(W[Et],ye);return Fe===-1?void 0:DJe(W[Et],Fe,1)[0]}return a_e(W[Et])}},t.removeHooks=function(Et){Eu(W,Et)&&(W[Et]=[])},t.removeAllHooks=function(){W=A_e()},t}var C_e=E_e();var tZe=0,A$={},b$=class e{constructor(t,n){let i,r=t;l(A$[r])?i=A$[r]:(i=tZe++,A$[r]=i),n=n??!1,this._id=i,this._html=t,this._showOnScreen=n,this._element=void 0}get html(){return this._html}get id(){return this._id}get showOnScreen(){return this._showOnScreen}set showOnScreen(t){this._showOnScreen=t}get element(){if(!l(this._element)){let t=C_e.sanitize(this._html),n=document.createElement("div");n.className="cesium-credit-wrapper",n._creditId=this._id,n.style.display="inline",n.innerHTML=t;let i=n.querySelectorAll("a");for(let r=0;r<i.length;r++)i[r].setAttribute("target","_blank");this._element=n}return this._element}static equals(t,n){return t===n||l(t)&&l(n)&&t._id===n._id&&t._showOnScreen===n._showOnScreen}equals(t){return e.equals(this,t)}isIon(){return this.html.indexOf("ion-credit.png")!==-1}static getIonCredit(t){let n=l(t.collapsible)&&!t.collapsible;return new e(t.html,n)}static clone(t){if(l(t))return new e(t.html,t.showOnScreen)}},It=b$;function pv(e,t){this._distance=t,this._normal=new v_e(e,this),this.onChangeCallback=void 0,this.index=-1}Object.defineProperties(pv.prototype,{distance:{get:function(){return this._distance},set:function(e){l(this.onChangeCallback)&&e!==this._distance&&this.onChangeCallback(this.index),this._distance=e}},normal:{get:function(){return this._normal},set:function(e){l(this.onChangeCallback)&&!h.equals(this._normal._cartesian3,e)&&this.onChangeCallback(this.index),h.clone(e,this._normal._cartesian3)}}});pv.fromPlane=function(e,t){return l(t)?(t.normal=e.normal,t.distance=e.distance):t=new pv(e.normal,e.distance),t};pv.clone=function(e,t){return l(t)?(t.normal=e.normal,t.distance=e.distance,t):new pv(e.normal,e.distance)};function v_e(e,t){this._clippingPlane=t,this._cartesian3=h.clone(e)}Object.defineProperties(v_e.prototype,{x:{get:function(){return this._cartesian3.x},set:function(e){l(this._clippingPlane.onChangeCallback)&&e!==this._cartesian3.x&&this._clippingPlane.onChangeCallback(this._clippingPlane.index),this._cartesian3.x=e}},y:{get:function(){return this._cartesian3.y},set:function(e){l(this._clippingPlane.onChangeCallback)&&e!==this._cartesian3.y&&this._clippingPlane.onChangeCallback(this._clippingPlane.index),this._cartesian3.y=e}},z:{get:function(){return this._cartesian3.z},set:function(e){l(this._clippingPlane.onChangeCallback)&&e!==this._cartesian3.z&&this._clippingPlane.onChangeCallback(this._clippingPlane.index),this._cartesian3.z=e}}});var fa=pv;function Xc(e){e=e??H.EMPTY_OBJECT,this._planes=[],this._dirtyIndex=-1,this._multipleDirtyPlanes=!1,this._enabled=e.enabled??!0,this.modelMatrix=M.clone(e.modelMatrix??M.IDENTITY),this.edgeColor=z.clone(e.edgeColor??z.WHITE),this.edgeWidth=e.edgeWidth??0,this.planeAdded=new be,this.planeRemoved=new be,this._owner=void 0;let t=e.unionClippingRegions??!1;this._unionClippingRegions=t,this._testIntersection=t?D_e:R_e,this._uint8View=void 0,this._float32View=void 0,this._clippingPlanesTexture=void 0;let n=e.planes;if(l(n)){let i=n.length;for(let r=0;r<i;++r)this.add(n[r])}}function D_e(e){return e===$t.OUTSIDE}function R_e(e){return e===$t.INSIDE}Object.defineProperties(Xc.prototype,{length:{get:function(){return this._planes.length}},unionClippingRegions:{get:function(){return this._unionClippingRegions},set:function(e){this._unionClippingRegions!==e&&(this._unionClippingRegions=e,this._testIntersection=e?D_e:R_e)}},enabled:{get:function(){return this._enabled},set:function(e){this._enabled!==e&&(this._enabled=e)}},texture:{get:function(){return this._clippingPlanesTexture}},owner:{get:function(){return this._owner}},clippingPlanesState:{get:function(){return this._unionClippingRegions?this._planes.length:-this._planes.length}}});function S_e(e,t){e._multipleDirtyPlanes=e._multipleDirtyPlanes||e._dirtyIndex!==-1&&e._dirtyIndex!==t,e._dirtyIndex=t}Xc.prototype.add=function(e){let t=this._planes.length,n=this;e.onChangeCallback=function(i){S_e(n,i)},e.index=t,S_e(this,t),this._planes.push(e),this.planeAdded.raiseEvent(e,t)};Xc.prototype.get=function(e){return this._planes[e]};function O_e(e,t){let n=e.length;for(let i=0;i<n;++i)if(sn.equals(e[i],t))return i;return-1}Xc.prototype.contains=function(e){return O_e(this._planes,e)!==-1};Xc.prototype.remove=function(e){let t=this._planes,n=O_e(t,e);if(n===-1)return!1;e instanceof fa&&(e.onChangeCallback=void 0,e.index=-1);let i=t.length-1;for(let r=n;r<i;++r){let o=t[r+1];t[r]=o,o instanceof fa&&(o.index=r)}return this._multipleDirtyPlanes=!0,t.length=i,this.planeRemoved.raiseEvent(e,n),!0};Xc.prototype.removeAll=function(){let e=this._planes,t=e.length;for(let n=0;n<t;++n){let i=e[n];i instanceof fa&&(i.onChangeCallback=void 0,i.index=-1),this.planeRemoved.raiseEvent(i,n)}this._multipleDirtyPlanes=!0,this._planes=[]};var nZe=new se,iZe=new se;function w_e(e,t,n){let i=e._uint8View,r=e._planes,o=0;for(let s=t;s<n;++s){let a=r[s],c=cn.octEncodeToCartesian4(a.normal,iZe);i[o]=c.x,i[o+1]=c.y,i[o+2]=c.z,i[o+3]=c.w;let u=se.packFloat(a.distance,nZe);i[o+4]=u.x,i[o+5]=u.y,i[o+6]=u.z,i[o+7]=u.w,o+=8}}function I_e(e,t,n){let i=e._float32View,r=e._planes,o=0;for(let s=t;s<n;++s){let a=r[s],c=a.normal;i[o]=c.x,i[o+1]=c.y,i[o+2]=c.z,i[o+3]=a.distance,o+=4}}function M_e(e,t){let n=Ut.maximumTextureSize;return t.x=Math.min(e,n),t.y=Math.ceil(e/t.x),t}var rZe=new U;Xc.prototype.update=function(e){let t=this._clippingPlanesTexture,n=e.context,i=Xc.useFloatTexture(n),r=i?this.length:this.length*2;if(l(t)){let s=t.width*t.height;(s<r||r<.25*s)&&(t.destroy(),t=void 0,this._clippingPlanesTexture=void 0)}if(this.length===0)return;if(!l(t)){let s=M_e(r,rZe);s.y*=2,i?(t=new Dt({context:n,width:s.x,height:s.y,pixelFormat:$e.RGBA,pixelDatatype:ze.FLOAT,sampler:Ht.NEAREST,flipY:!1}),this._float32View=new Float32Array(s.x*s.y*4)):(t=new Dt({context:n,width:s.x,height:s.y,pixelFormat:$e.RGBA,pixelDatatype:ze.UNSIGNED_BYTE,sampler:Ht.NEAREST,flipY:!1}),this._uint8View=new Uint8Array(s.x*s.y*4)),this._clippingPlanesTexture=t,this._multipleDirtyPlanes=!0}let o=this._dirtyIndex;if(!(!this._multipleDirtyPlanes&&o===-1)){if(this._multipleDirtyPlanes)i?(I_e(this,0,this._planes.length),t.copyFrom({source:{width:t.width,height:t.height,arrayBufferView:this._float32View}})):(w_e(this,0,this._planes.length),t.copyFrom({source:{width:t.width,height:t.height,arrayBufferView:this._uint8View}}));else{let s,a;i?(a=Math.floor(o/t.width),s=Math.floor(o-a*t.width),I_e(this,o,o+1),t.copyFrom({source:{width:1,height:1,arrayBufferView:this._float32View},xOffset:s,yOffset:a})):(a=Math.floor(o*2/t.width),s=Math.floor(o*2-a*t.width),w_e(this,o,o+1),t.copyFrom({source:{width:2,height:1,arrayBufferView:this._uint8View},xOffset:s,yOffset:a}))}this._multipleDirtyPlanes=!1,this._dirtyIndex=-1}};var oZe=new M,P_e=new sn(h.UNIT_X,0);Xc.prototype.computeIntersectionWithBoundingVolume=function(e,t){let n=this._planes,i=n.length,r=this.modelMatrix;l(t)&&(r=M.multiply(t,r,oZe));let o=$t.INSIDE;!this.unionClippingRegions&&i>0&&(o=$t.OUTSIDE);for(let s=0;s<i;++s){let a=n[s];sn.transform(a,r,P_e);let c=e.intersectPlane(P_e);if(c===$t.INTERSECTING)o=c;else if(this._testIntersection(c))return c}return o};Xc.setOwner=function(e,t,n){e!==t[n]&&(t[n]=t[n]&&t[n].destroy(),l(e)&&(e._owner=t,t[n]=e))};Xc.useFloatTexture=function(e){return e.floatingPointTexture};Xc.getTextureResolution=function(e,t,n){let i=e.texture;if(l(i))return n.x=i.width,n.y=i.height,n;let r=Xc.useFloatTexture(t)?e.length:e.length*2,o=M_e(r,n);return o.y*=2,o};Xc.prototype.isDestroyed=function(){return!1};Xc.prototype.destroy=function(){return this._clippingPlanesTexture=this._clippingPlanesTexture&&this._clippingPlanesTexture.destroy(),le(this)};var Ds=Xc;function sZe(e,t){yt(e,t)}var Yr=sZe;function gv(e){this._ellipsoid=e.ellipsoid??ee.default,this._positions=mU(e.positions),this._holes=l(e.holes)?e.holes.map(mU):[],this._rectangle=og.computeRectangleFromPositions(this._positions,this._ellipsoid),x$(this._positions),N_e(this._holes)}function mU(e){if(!l(e))return;let t=e.length,n=Array(t);for(let i=0;i<t;i++)n[i]=h.clone(e[i]);return n}function x$(e){for(let t=0;t<e.length;t++)Object.freeze(e[t]);return Object.freeze(e)}function N_e(e){for(let t=0;t<e.length;t++)x$(e[t]);return Object.freeze(e)}function aZe(e,t){if(!l(e)&&!l(t))return!0;if(l(e)!==l(t)||e.length!==t.length)return!1;let n=e.length;for(let i=0;i<n;i++){let r=e[i],o=t[i];if(!h.equals(r,o))return!1}return!0}function cZe(e,t){if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(!aZe(e[n],t[n]))return!1;return!0}Object.defineProperties(gv.prototype,{length:{get:function(){let e=this._positions.length,t=this._holes;for(let n=0;n<t.length;n++)e+=t[n].length;return e}},positions:{get:function(){return this._positions}},holes:{get:function(){return this._holes}},ellipsoid:{get:function(){return this._ellipsoid}},rectangle:{get:function(){return this._rectangle}}});gv.clone=function(e,t){return l(t)?(t._ellipsoid=e.ellipsoid,t._positions=mU(e.positions),t._holes=e.holes.map(mU),t._rectangle=og.computeRectangleFromPositions(t._positions,t._ellipsoid),x$(t._positions),N_e(t._holes),t):new gv({positions:e.positions,holes:e.holes,ellipsoid:e.ellipsoid})};gv.equals=function(e,t){return e.ellipsoid.equals(t.ellipsoid)&&e.positions===t.positions&&cZe(e.holes,t.holes)};gv.prototype.computeRectangle=function(e){return Yr("ClippingPolygon.computeRectangle","ClippingPolygon.computeRectangle is deprecated as of CesiumJS 1.145 and will be removed in 1.147. Use the ClippingPolygon.rectangle property instead."),ie.clone(this._rectangle,e)};var ND=gv;var LD=class LD{constructor(t=H.EMPTY_OBJECT){ut(this,"_renderContext",null);this.show=t.show??!0,this._heightReference=t.heightReference??We.NONE,this._blendOption=t.blendOption??Bi.TRANSLUCENT,this._modelMatrix=M.clone(t.modelMatrix??M.IDENTITY),this._boundingVolume=ue.clone(t.boundingVolume??new ue,new ue),this._boundingVolumeAutoUpdate=!l(t.boundingVolume),this._allowPicking=t.allowPicking??!1,this._pickIds=new Map,this._customPickObjects=[],this.debugShowBoundingVolume=t.debugShowBoundingVolume??!1,this._primitiveCount=0,this._primitiveCountMax=t.primitiveCountMax??LD.DEFAULT_CAPACITY,this._primitiveView=null,this._positionCount=0,this._positionCountMax=t.vertexCountMax??LD.DEFAULT_CAPACITY,this._positionView=null,this._positionDatatype=t.positionDatatype??Y.DOUBLE,this._positionNormalized=t.positionNormalized??!1,this._materialView=null,this._dirtyOffset=0,this._dirtyCount=0,this._dirtyBoundingVolume=!1,this._version=0,this._allocatePrimitiveBuffer(),this._allocatePositionBuffer(),this._allocateMaterialBuffer()}_getCollectionClass(){pe.throwInstantiationError()}_getPrimitiveClass(){pe.throwInstantiationError()}_getMaterialClass(){pe.throwInstantiationError()}_allocatePrimitiveBuffer(){let t=this._getPrimitiveClass().Layout;this._primitiveView=new DataView(new ArrayBuffer(this._primitiveCountMax*t.__BYTE_LENGTH))}_allocatePositionBuffer(){this._positionView=Y.createTypedArray(this._positionDatatype,this._positionCountMax*3)}_allocateMaterialBuffer(){let t=this._getMaterialClass();this._materialView=new DataView(new ArrayBuffer(this._primitiveCountMax*t.packedLength))}isDestroyed(){return!1}destroy(){this._customPickObjects.length=0;for(let t of this._pickIds.values())for(let n of t)n.destroy();l(this._renderContext)&&(this._renderContext.destroy(),this._renderContext=void 0,this._dirtyOffset=0,this._dirtyCount=this.primitiveCount)}sort(t,n=new Uint32Array(this.primitiveCount)){let i=this._getPrimitiveClass(),r=this._getCollectionClass(),{primitiveCount:o}=this,s=new i,a=new i,c=new Uint32Array(o);for(let f=0;f<o;f++)c[f]=f;c.sort((f,d)=>t(this.get(f,s),this.get(d,a)));for(let f=0;f<o;f++)n[c[f]]=f;let u=this._cloneEmpty();for(let f=0;f<o;f++){let d=this.get(c[f],s),p=u.add({},a);i.clone(d,p)}return r._replaceBuffers(u,this),this._dirtyOffset=0,this._dirtyCount=o,n}static clone(t,n,i){if(l(i))return this._cloneFiltered(t,n,i);let r=t._getPrimitiveClass().Layout,o=t._getMaterialClass(),s=t._getPrimitiveClass();this._copySubDataView(t._primitiveView,n._primitiveView,t.primitiveCount*r.__BYTE_LENGTH),this._copySubArray(t._positionView,n._positionView,t.vertexCount*3),this._copySubDataView(t._materialView,n._materialView,t.primitiveCount*o.packedLength),n._primitiveCount=t._primitiveCount,n._positionCount=t._positionCount;let a=t._customPickObjects,c=n._customPickObjects;c.length=0;let u=new s;for(let f=0,d=n.primitiveCount;f<d;f++)c[f]=a[f],n.get(f,u)._pickId=0;return n._dirtyOffset=0,n._dirtyCount=n.primitiveCount,t.boundingVolume.clone(n.boundingVolume),n}static _cloneFiltered(t,n,i){let r=t._getPrimitiveClass(),o=new r,s=new r,a=t._customPickObjects,c=n._customPickObjects;c.length=0;for(let u=0,f=t._primitiveCount;u<f;u++){if(t.get(u,o),!i(o,u))continue;let d=n._primitiveCount;r.clone(o,n.add({},s)),l(a[u])&&(c[d]=a[u])}return n}static fromCollection(t,n=H.EMPTY_OBJECT,i){let r=t._cloneEmpty(n);return t._getCollectionClass().clone(t,r,i),r}_cloneEmptyBaseArgs(t){return{primitiveCountMax:this.primitiveCountMax,vertexCountMax:this.vertexCountMax,positionDatatype:this.positionDatatype,positionNormalized:this.positionNormalized,modelMatrix:this._modelMatrix,show:this.show,debugShowBoundingVolume:this.debugShowBoundingVolume,blendOption:this._blendOption,allowPicking:this._allowPicking,boundingVolume:this._boundingVolumeAutoUpdate?void 0:this._boundingVolume,...t}}_cloneEmpty(t){pe.throwInstantiationError()}static _replaceBuffers(t,n){n._primitiveView=t._primitiveView,n._positionView=t._positionView,n._materialView=t._materialView}_updateBoundingVolume(){let t=this._positionView.subarray(0,this._positionCount*3);this._positionNormalized&&(t=cn.dequantize(t,this._positionDatatype,Vt.VEC3,this._positionCount)),ue.fromVertices(t,h.ZERO,3,this._boundingVolume),ue.transform(this._boundingVolume,this._modelMatrix,this._boundingVolume),this._dirtyBoundingVolume=!1}_updatePickIds(t){let n=this._pickIds.get(t);if(n&&n.length===this._primitiveCount)return;n||(n=[],this._pickIds.set(t,n));let i=this,r=this._getPrimitiveClass(),o=new r;for(let s=n.length,a=this._primitiveCount;s<a;s++){this.get(s,o);let c=this._customPickObjects[s]||{collection:this,index:s,get primitive(){return i.get(s,new r)}},u=t.createPickId(c);o._pickId=u.key,n.push(u)}}get(t,n){return n._collection=this,n._index=t,n._byteOffset=t*this._getPrimitiveClass().Layout.__BYTE_LENGTH,n}add(t=H.EMPTY_OBJECT,n){let i=this._getMaterialClass(),r=this._primitiveCount++;return n=this.get(r,n),n.featureId=t.featureId??r,n.show=t.show??!0,n.setMaterial(t.material??i.DEFAULT_MATERIAL),n._pickId=0,n._dirty=!0,l(t.pickObject)&&(this._customPickObjects[r]=t.pickObject),n}_makeDirty(t){this._dirtyCount===0?(this._dirtyCount=1,this._dirtyOffset=t):t<this._dirtyOffset?(this._dirtyCount+=this._dirtyOffset-t,this._dirtyOffset=t):t+1>this._dirtyOffset+this._dirtyCount&&(this._dirtyCount=t+1-this._dirtyOffset)}_makeClean(){this._dirtyCount>0&&(this._dirtyCount=0,this._dirtyOffset=0,this._version++)}_makeDirtyBoundingVolume(){this._boundingVolumeAutoUpdate&&(this._dirtyBoundingVolume=!0)}update(t){t.mode!==re.SCENE3D&&yt("bufferprim-scenemode","BufferPrimitiveCollection requires SceneMode.SCENE3D."),this._dirtyBoundingVolume&&this._updateBoundingVolume(),this._allowPicking&&this._updatePickIds(t.context)}_isRendered(t){let n=t.passes;return this.show&&!fs(this._heightReference)&&(n.render||n.pick)}get primitiveCount(){return this._primitiveCount}get primitiveCountMax(){return this._primitiveCountMax}get byteLength(){return this._primitiveView.byteLength+this._positionView.byteLength+this._materialView.byteLength}get vertexCount(){return this._positionCount}get vertexCountMax(){return this._positionCountMax}get modelMatrix(){return this._modelMatrix}get boundingVolume(){return this._dirtyBoundingVolume&&this._updateBoundingVolume(),this._boundingVolume}get positionDatatype(){return this._positionDatatype}get positionNormalized(){return this._positionNormalized}get heightReference(){return this._heightReference}static _copySubArray(t,n,i){for(let r=0;r<i;r++)n[r]=t[r]}static _copySubDataView(t,n,i){this._copySubArray(new Uint32Array(t.buffer,t.byteOffset,t.byteLength/4),new Uint32Array(n.buffer,n.byteOffset,n.byteLength/4),i/4)}toJSON(){let t=this._getPrimitiveClass(),n=new t,i=[];for(let r=0,o=this.primitiveCount;r<o;r++)i.push(this.get(r,n).toJSON());return i}};ut(LD,"Error",{ERR_RESIZE:"BufferPrimitive range cannot be resized after initialization.",ERR_CAPACITY:"BufferPrimitiveCollection capacity exceeded.",ERR_MULTIPLE_OF_FOUR:"BufferPrimitive byte length must be a multiple of 4.",ERR_OUT_OF_RANGE:"BufferPrimitive buffer access out of range."});var pU=LD;pU.DEFAULT_CAPACITY=1024;var da=pU;var Bh=class Bh{constructor(){ut(this,"_collection",null);ut(this,"_index",-1);ut(this,"_byteOffset",-1)}static clone(t,n){let i=t._collection._getMaterialClass();return n.featureId=t.featureId,n.show=t.show,n.setMaterial(t.getMaterial(new i)),n}_isResizable(){return this._index===this._collection.primitiveCount-1}get featureId(){return this._getUint32(Bh.Layout.FEATURE_ID_U32)}set featureId(t){this._setUint32(Bh.Layout.FEATURE_ID_U32,t)}get show(){return this._getUint8(Bh.Layout.SHOW_U8)===1}set show(t){this._setUint8(Bh.Layout.SHOW_U8,t?1:0)}getMaterial(t){let n=this._collection,i=n._getMaterialClass();return i.unpack(n._materialView,this._index*i.packedLength,t)}setMaterial(t){let n=this._collection,i=n._getMaterialClass();return i.pack(t,n._materialView,this._index*i.packedLength),this._dirty=!0,t}get _dirty(){return this._getUint8(Bh.Layout.DIRTY_U8)===1}set _dirty(t){this._collection._primitiveView.setUint8(this._byteOffset+Bh.Layout.DIRTY_U8,t?1:0),t&&this._collection._makeDirty(this._index)}get _pickId(){return this._getUint32(Bh.Layout.PICK_ID_U32)}set _pickId(t){this._setUint32(Bh.Layout.PICK_ID_U32,t)}_getUint8(t){return this._collection._primitiveView.getUint8(this._byteOffset+t)}_setUint8(t,n){this._collection._primitiveView.setUint8(this._byteOffset+t,n),this._dirty=!0}_getUint32(t){return this._collection._primitiveView.getUint32(this._byteOffset+t,!0)}_setUint32(t,n){this._collection._primitiveView.setUint32(this._byteOffset+t,n,!0),this._dirty=!0}_getFloat32(t){return this._collection._primitiveView.getFloat32(this._byteOffset+t,!0)}_setFloat32(t,n){this._collection._primitiveView.setFloat32(this._byteOffset+t,n,!0),this._dirty=!0}toJSON(){let n=this._collection._getMaterialClass();return{featureId:this.featureId,show:this.show,dirty:this._dirty,material:this.getMaterial(new n).toJSON()}}};ut(Bh,"Layout",{FEATURE_ID_U32:0,SHOW_U8:4,DIRTY_U8:5,PICK_ID_U32:8,__BYTE_LENGTH:12});var T$=Bh,ms=T$;var{ERR_CAPACITY:Akn,ERR_RESIZE:bkn,ERR_OUT_OF_RANGE:xkn}=da.Error,Td=class Td extends ms{constructor(){super(...arguments);ut(this,"_collection",null)}static clone(n,i){return super.clone(n,i),i.setPositions(n.getPositions()),i.setHoles(n.getHoles()),i.setTriangles(n.getTriangles()),i}get vertexOffset(){return this._getUint32(Td.Layout.POSITION_OFFSET_U32)}get vertexCount(){return this._getUint32(Td.Layout.POSITION_COUNT_U32)}getPositions(n){return this._getPositionsRange(0,this.vertexCount,n)}setPositions(n){let i=this._collection,r=this.vertexOffset,o=this.vertexCount,s=n.length/3,a=i.vertexCount+s-o;i._positionCount=a,this._setUint32(Td.Layout.POSITION_COUNT_U32,s);let c=i._positionView;for(let u=0;u<s;u++)c[(r+u)*3]=n[u*3],c[(r+u)*3+1]=n[u*3+1],c[(r+u)*3+2]=n[u*3+2];this._dirty=!0,i._makeDirtyBoundingVolume()}get outerVertexOffset(){return this.vertexOffset}get outerVertexCount(){return this.holeCount>0?this.getHoles()[0]:this.vertexCount}getOuterPositions(n){return this._getPositionsRange(0,this.outerVertexCount,n)}get holeOffset(){return this._getUint32(Td.Layout.HOLE_OFFSET_U32)}get holeCount(){return this._getUint32(Td.Layout.HOLE_COUNT_U32)}getHoles(n){let{holeOffset:i,holeCount:r}=this,o=this._collection._holeIndexView;if(!l(n)){let s=o.byteOffset+i*o.BYTES_PER_ELEMENT,a=o.constructor;return new a(o.buffer,s,r)}for(let s=0;s<r;s++)n[s]=o[i+s];return n}setHoles(n){let i=this._collection,r=this.holeOffset,o=this.holeCount,s=n.length,a=i.holeCount+s-o;i._holeCount=a,this._setUint32(Td.Layout.HOLE_COUNT_U32,s);let c=i._holeIndexView;for(let u=0;u<s;u++)c[r+u]=n[u];this._dirty=!0}getHoleVertexCount(n){let i=this.getHoles(),r=i[n];return n===i.length-1?this.vertexCount-r:i[n+1]-r}getHolePositions(n,i){let o=this.getHoles()[n],s=this.getHoleVertexCount(n);return this._getPositionsRange(o,s,i)}_getPositionsRange(n,i,r){let o=this._collection,s=this._collection._positionView,a=this.vertexOffset+n;if(!l(r)){let c=s.byteOffset+a*3*s.BYTES_PER_ELEMENT,u=s.constructor;return new u(s.buffer,c,i*3)}for(let c=0;c<i;c++)r[c*3]=s[(a+c)*3],r[c*3+1]=s[(a+c)*3+1],r[c*3+2]=s[(a+c)*3+2];return r}get triangleOffset(){return this._getUint32(Td.Layout.TRIANGLE_OFFSET_U32)}get triangleCount(){return this._getUint32(Td.Layout.TRIANGLE_COUNT_U32)}getTriangles(n){let{triangleOffset:i,triangleCount:r}=this,o=this._collection._triangleIndexView;if(!l(n)){let s=o.byteOffset+i*3*o.BYTES_PER_ELEMENT,a=o.constructor;return new a(o.buffer,s,r*3)}for(let s=0;s<r;s++)n[s*3]=o[(i+s)*3],n[s*3+1]=o[(i+s)*3+1],n[s*3+2]=o[(i+s)*3+2];return n}setTriangles(n){let i=this._collection,r=this.triangleOffset,o=this.triangleCount,s=n.length/3,a=i.triangleCount+s-o;i._triangleCount+=s-o,this._setUint32(Td.Layout.TRIANGLE_COUNT_U32,s);let c=i._triangleIndexView;for(let u=0;u<s;u++)c[(r+u)*3]=n[u*3],c[(r+u)*3+1]=n[u*3+1],c[(r+u)*3+2]=n[u*3+2];this._dirty=!0}toJSON(){return{...super.toJSON(),positions:Array.from(this.getPositions()),holes:Array.from(this.getHoles()),triangles:Array.from(this.getTriangles())}}};ut(Td,"Layout",{...ms.Layout,POSITION_OFFSET_U32:ms.Layout.__BYTE_LENGTH,POSITION_COUNT_U32:ms.Layout.__BYTE_LENGTH+4,HOLE_OFFSET_U32:ms.Layout.__BYTE_LENGTH+8,HOLE_COUNT_U32:ms.Layout.__BYTE_LENGTH+12,TRIANGLE_OFFSET_U32:ms.Layout.__BYTE_LENGTH+16,TRIANGLE_COUNT_U32:ms.Layout.__BYTE_LENGTH+20,__BYTE_LENGTH:ms.Layout.__BYTE_LENGTH+24});var E$=Td,Lo=E$;var FD=class{constructor(t=H.EMPTY_OBJECT){this.color=z.clone(t.color??z.WHITE),this.outlineColor=z.clone(t.outlineColor??z.WHITE),this.outlineWidth=t.outlineWidth??0}static get packedLength(){return this.Layout.__BYTE_LENGTH}static pack(t,n,i){n.setUint32(this.Layout.COLOR_U32+i,t.color.toRgba(),!0),n.setUint32(this.Layout.OUTLINE_COLOR_U32+i,t.outlineColor.toRgba(),!0),n.setUint8(this.Layout.OUTLINE_WIDTH_U8+i,t.outlineWidth)}static unpack(t,n,i){return z.fromRgba(t.getUint32(this.Layout.COLOR_U32+n,!0),i.color),z.fromRgba(t.getUint32(this.Layout.OUTLINE_COLOR_U32+n,!0),i.outlineColor),i.outlineWidth=t.getUint8(this.Layout.OUTLINE_WIDTH_U8+n),i}toJSON(){return{color:this.color.toCssHexString(),outlineColor:this.outlineColor.toCssHexString(),outlineWidth:this.outlineWidth}}};ut(FD,"Layout",{COLOR_U32:0,OUTLINE_COLOR_U32:4,OUTLINE_WIDTH_U8:8,__BYTE_LENGTH:12}),ut(FD,"DEFAULT_MATERIAL");var Cu=FD;var gU=class gU extends Cu{constructor(t=H.EMPTY_OBJECT){super(t)}};ut(gU,"DEFAULT_MATERIAL",Object.freeze(new gU));var C$=gU,Ed=C$;var v$={positionHigh:0,positionLow:1,pickColor:2,showColorAlpha:3},L_e={position:0,pickColor:1,showColorAlpha:2},ha=new Lo,S$=new Ed,BD=new z,F_e=new h,w$=new Sn;function lZe(e,t,n){let i=t.context;n=n||{destroy:fZe};let r=e._positionDatatype===Y.DOUBLE,o=r?v$:L_e;if(!l(n.attributeArrays)||!l(n.indexArray)){let{vertexCountMax:c,triangleCountMax:u}=e;n.indexArray=je.createTypedArray(c,u*3),n.attributeArrays={...r?{positionHigh:new Float32Array(c*3),positionLow:new Float32Array(c*3)}:{position:e._positionView},pickColor:new Uint8Array(c*4),showColorAlpha:new Float32Array(c*3)}}if(e._dirtyCount>0){let{attributeArrays:c}=n,{_dirtyOffset:u,_dirtyCount:f}=e,d=c.positionHigh,p=c.positionLow,g=n.indexArray,m=c.pickColor,y=c.showColorAlpha;for(let A=u,b=u+f;A<b;A++){if(e.get(A,ha),!ha._dirty)continue;let x=ha.triangleOffset,T=ha.vertexOffset,E=ha.getTriangles();for(let R=0,O=ha.triangleCount;R<O;R++)g[x*3]=T+E[R*3],g[x*3+1]=T+E[R*3+1],g[x*3+2]=T+E[R*3+2],x++;let v=ha.show,S=r?ha.getPositions():null;ha.getMaterial(S$);let I=cn.encodeRGB8(S$.color);z.fromRgba(ha._pickId,BD);for(let R=0,O=ha.vertexCount;R<O;R++)r&&(h.fromArray(S,R*3,F_e),Sn.fromCartesian(F_e,w$),h.pack(w$.high,d,T*3),h.pack(w$.low,p,T*3)),m[T*4]=z.floatToByte(BD.red),m[T*4+1]=z.floatToByte(BD.green),m[T*4+2]=z.floatToByte(BD.blue),m[T*4+3]=z.floatToByte(BD.alpha),y[T*3]=v?1:0,y[T*3+1]=I,y[T*3+2]=S$.color.alpha,T++;ha._dirty=!1}}if(l(n.vertexArray)){if(e._dirtyCount>0){let{indexOffset:c,indexCount:u,vertexOffset:f,vertexCount:d}=uZe(e);n.vertexArray.copyIndexFromRange(n.indexArray,c,u);for(let p in o)if(Object.hasOwn(o,p)){let g=p;n.vertexArray.copyAttributeFromRange(o[g],n.attributeArrays[g],f,d)}}}else{let{attributeArrays:c}=n;n.vertexArray=new Vn({context:i,indexBuffer:tt.createIndexBuffer({context:i,typedArray:n.indexArray,usage:Me.STATIC_DRAW,indexDatatype:je.fromTypedArray(n.indexArray)}),attributes:[...r?[{index:v$.positionHigh,componentDatatype:Y.FLOAT,componentsPerAttribute:3,vertexBuffer:tt.createVertexBuffer({typedArray:c.positionHigh,context:i,usage:Me.STATIC_DRAW})},{index:v$.positionLow,componentDatatype:Y.FLOAT,componentsPerAttribute:3,vertexBuffer:tt.createVertexBuffer({typedArray:c.positionLow,context:i,usage:Me.STATIC_DRAW})}]:[{index:L_e.position,componentDatatype:e._positionDatatype,componentsPerAttribute:3,normalize:e._positionNormalized,vertexBuffer:tt.createVertexBuffer({typedArray:c.position,context:i,usage:Me.STATIC_DRAW})}],{index:o.pickColor,componentDatatype:Y.UNSIGNED_BYTE,componentsPerAttribute:4,vertexBuffer:tt.createVertexBuffer({typedArray:c.pickColor,context:i,usage:Me.STATIC_DRAW})},{index:o.showColorAlpha,componentDatatype:Y.FLOAT,componentsPerAttribute:3,vertexBuffer:tt.createVertexBuffer({typedArray:c.showColorAlpha,context:i,usage:Me.STATIC_DRAW})}]})}l(n.renderState)||(n.renderState=Ge.fromCache({blending:e._blendOption===Bi.OPAQUE?nn.DISABLED:nn.ALPHA_BLEND,depthTest:{enabled:!0}})),l(n.shaderProgram)||(n.shaderProgram=Qt.fromCache({context:i,vertexShaderSource:new Xe({sources:[A2],defines:r?["USE_FLOAT64"]:[]}),fragmentShaderSource:new Xe({sources:[y2]}),attributeLocations:o}));let s=e.triangleCount*3;l(n.command)||(n.command=new at({vertexArray:n.vertexArray,renderState:n.renderState,shaderProgram:n.shaderProgram,primitiveType:Oe.TRIANGLES,pass:e._blendOption===Bi.OPAQUE?Ie.OPAQUE:Ie.TRANSLUCENT,pickId:e._allowPicking?"v_pickColor":void 0,owner:e,count:s,modelMatrix:e.modelMatrix,boundingVolume:e.boundingVolume,debugShowBoundingVolume:e.debugShowBoundingVolume}));let a=n.command;return a.count!==s&&(a.count=s),a.debugShowBoundingVolume!==e.debugShowBoundingVolume&&(a.debugShowBoundingVolume=e.debugShowBoundingVolume),t.commandList.push(a),e._makeClean(),n}function uZe(e){let{_dirtyOffset:t,_dirtyCount:n}=e;e.get(t,ha);let i=ha.vertexOffset,r=ha.triangleOffset*3;e.get(t+n-1,ha);let o=ha.vertexOffset+ha.vertexCount-i,s=(ha.triangleOffset+ha.triangleCount)*3-r;return{indexOffset:r,indexCount:s,vertexOffset:i,vertexCount:o}}function fZe(){let e=this;l(e.vertexArray)&&e.vertexArray.destroy(),l(e.shaderProgram)&&e.shaderProgram.destroy(),l(e.renderState)&&Ge.removeFromCache(e.renderState)}var _U=lZe;var{ERR_CAPACITY:c3n}=da.Error,I$=class e extends da{constructor(t=H.EMPTY_OBJECT){super(t),this._holeCount=0,this._holeCountMax=t.holeCountMax??da.DEFAULT_CAPACITY,this._holeIndexView=null,this._triangleCount=0,this._triangleCountMax=t.triangleCountMax??da.DEFAULT_CAPACITY,this._triangleIndexView=null,this._allocateHoleIndexBuffer(),this._allocateTriangleIndexBuffer()}_getCollectionClass(){return e}_getPrimitiveClass(){return Lo}_getMaterialClass(){return Ed}_allocateHoleIndexBuffer(){this._holeIndexView=je.createTypedArray(this._positionCountMax,this._holeCountMax)}_allocateTriangleIndexBuffer(){this._triangleIndexView=je.createTypedArray(this._positionCountMax,this._triangleCountMax*3)}static clone(t,n,i){return super.clone(t,n,i),l(i)||(this._copySubArray(t._holeIndexView,n._holeIndexView,t.holeCount),this._copySubArray(t._triangleIndexView,n._triangleIndexView,t._triangleCount*3),n._holeCount=t._holeCount,n._triangleCount=t._triangleCount),n}static fromCollection(t,n,i){return super.fromCollection(t,n,i)}_cloneEmpty(t=H.EMPTY_OBJECT){return new e({holeCountMax:this.holeCountMax,triangleCountMax:this.triangleCountMax,...this._cloneEmptyBaseArgs(t)})}static _replaceBuffers(t,n){super._replaceBuffers(t,n),n._holeIndexView=t._holeIndexView,n._triangleIndexView=t._triangleIndexView}add(t,n=new Lo){super.add(t,n);let i=this._positionCount;n._setUint32(Lo.Layout.POSITION_OFFSET_U32,i),n._setUint32(Lo.Layout.POSITION_COUNT_U32,0);let r=this._holeCount;n._setUint32(Lo.Layout.HOLE_OFFSET_U32,r),n._setUint32(Lo.Layout.HOLE_COUNT_U32,0);let o=this._triangleCount;return n._setUint32(Lo.Layout.TRIANGLE_OFFSET_U32,o),n._setUint32(Lo.Layout.TRIANGLE_COUNT_U32,0),l(t.positions)&&n.setPositions(t.positions),l(t.holes)&&n.setHoles(t.holes),l(t.triangles)&&n.setTriangles(t.triangles),n}update(t){super.update(t),this._isRendered(t)&&(this._renderContext=_U(this,t,this._renderContext))}get byteLength(){return super.byteLength+this._holeIndexView.byteLength+this._triangleIndexView.byteLength}get holeCount(){return this._holeCount}get holeCountMax(){return this._holeCountMax}get triangleCount(){return this._triangleCount}get triangleCountMax(){return this._triangleCountMax}},tc=I$;var{ERR_RESIZE:h3n,ERR_CAPACITY:m3n}=da.Error,_v=class _v extends ms{constructor(){super(...arguments);ut(this,"_collection",null)}static clone(n,i){return super.clone(n,i),i.setPositions(n.getPositions()),i}get vertexOffset(){return this._getUint32(_v.Layout.POSITION_OFFSET_U32)}get vertexCount(){return this._getUint32(_v.Layout.POSITION_COUNT_U32)}getPositions(n){let{vertexOffset:i,vertexCount:r}=this,o=this._collection._positionView;if(!l(n)){let s=o.byteOffset+i*3*o.BYTES_PER_ELEMENT,a=o.constructor;return new a(o.buffer,s,r*3)}for(let s=0;s<r;s++)n[s*3]=o[(i+s)*3],n[s*3+1]=o[(i+s)*3+1],n[s*3+2]=o[(i+s)*3+2];return n}setPositions(n){let i=this._collection,r=this.vertexOffset,o=this.vertexCount,s=n.length/3,a=i._positionCount+s-o;i._positionCount=a,this._setUint32(_v.Layout.POSITION_COUNT_U32,s);let c=i._positionView;for(let u=0;u<s;u++)c[(r+u)*3]=n[u*3],c[(r+u)*3+1]=n[u*3+1],c[(r+u)*3+2]=n[u*3+2];this._dirty=!0,i._makeDirtyBoundingVolume()}toJSON(){return{...super.toJSON(),positions:Array.from(this.getPositions())}}};ut(_v,"Layout",{...ms.Layout,POSITION_OFFSET_U32:ms.Layout.__BYTE_LENGTH,POSITION_COUNT_U32:ms.Layout.__BYTE_LENGTH+4,__BYTE_LENGTH:ms.Layout.__BYTE_LENGTH+8});var P$=_v,Oa=P$;var kD=class kD extends Cu{constructor(t=H.EMPTY_OBJECT){super(t),this.width=t.width??1}static pack(t,n,i){super.pack(t,n,i),n.setFloat32(this.Layout.WIDTH_F32+i,t.width,!0)}static unpack(t,n,i){return super.unpack(t,n,i),i.width=t.getFloat32(this.Layout.WIDTH_F32+n,!0),i}toJSON(){return{...super.toJSON(),width:this.width}}};ut(kD,"Layout",{...Cu.Layout,WIDTH_F32:Cu.Layout.__BYTE_LENGTH,__BYTE_LENGTH:Cu.Layout.__BYTE_LENGTH+4}),ut(kD,"DEFAULT_MATERIAL",Object.freeze(new kD));var D$=kD,Cd=D$;var B_e=16,dZe=.35,k_e=new Oa,hZe=new Cd,U_e=new Lo,mZe=new Ed,pZe=new h,gZe=new h,_Ze=new he,yZe=new U,AZe=new U,UD=new z,O$=class{static packPolylineCollectionData(t,n,i){if(l(i)&&t._dirtyCount===0&&t._version===i.version)return i;let r=t.primitiveCount,o=t.boundingVolume,s=ie.fromBoundingSphere(o,n),a=q_e(t,n),c=new Float32Array(r),u=new Uint8Array(r*4),f=new Uint8Array(r*4),d=t.widthUnits==="meters";for(let p=0;p<r;p++){let g=t.get(p,k_e),m=g.getMaterial(hZe);c[p]=d?-m.width:m.width,u[p*4]=z.floatToByte(m.color.red),u[p*4+1]=z.floatToByte(m.color.green),u[p*4+2]=z.floatToByte(m.color.blue),u[p*4+3]=z.floatToByte(m.color.alpha),z_e(f,p,g._pickId)}return Object.assign(i??{},{version:t._version,rectangle:s,positions:a,widths:c,widthInMeters:d,colors:u,pickColors:f})}static packPolylineSegments(t,n,i,r){r.polylineSegments??(r.polylineSegments=[]),r.widths??(r.widths=[]),r.colors??(r.colors=[]),r.pickColors??(r.pickColors=[]),r.polylineSegmentPrimitiveIndices??(r.polylineSegmentPrimitiveIndices=[]),r.primitiveCount??(r.primitiveCount=0),r.rectangle??(r.rectangle=ie.clone(i));let o=i.width,s=t.primitiveCount,a=n.positions;for(let c=0;c<s;c++){let u=t.get(c,k_e);if(!u.show)continue;let f=u.vertexCount,d=u.vertexOffset,p=Math.max(P.EPSILON3,V_e(n.widths[c],r));for(let g=0;g+1<f;g++){let m=U.fromArray(a,(d+g)*2,yZe),y=U.fromArray(a,(d+g+1)*2,AZe);bZe(m,y,i,o),xZe(m,y,p)&&(r.polylineSegments.push([m.x,m.y,y.x,y.y]),r.polylineSegmentPrimitiveIndices.push(r.primitiveCount+c))}}r.widths.push(n.widths),r.colors.push(n.colors),r.pickColors.push(n.pickColors),s>0&&(r.hasPixelWidths||(r.hasPixelWidths=!n.widthInMeters),r.hasMeterWidths||(r.hasMeterWidths=n.widthInMeters)),r.primitiveCount+=s}static packPolylineGrid(t){let n=t.polylineSegments,i=t.polylineSegmentPrimitiveIndices,r=Math.max(1,Math.ceil(Math.sqrt(n.length/B_e))),o=new Array(r*r);for(let A=0;A<o.length;A++)o[A]=[];let s=0,a=dZe/r,c=yU(t.widths);for(let A=0;A<n.length;A++){let b=n[A],x=Math.max(a,V_e(c[i[A]],t)),T=Math.max(0,Math.min(b[0],b[2])-x),E=Math.min(1,Math.max(b[0],b[2])+x),v=Math.max(0,Math.min(b[1],b[3])-x),S=Math.min(1,Math.max(b[1],b[3])+x),I=hy(Math.floor(T*r),r),R=hy(Math.floor(E*r),r),O=hy(Math.floor(v*r),r),L=hy(Math.floor(S*r),r);for(let _=O;_<=L;_++)for(let C=I;C<=R;C++)o[_*r+C].push(A),s++}let[u,f]=AU(s),d=u*f,p=new Float32Array(d*4).fill(-1),g=new Float32Array(d).fill(-1),m=new Uint32Array(o.length+2);m[0]=r,m[1]=r;let y=0;for(let A=0;A<o.length;A++){let b=o[A];for(let x=0;x<b.length;x++){let T=b[x],E=n[T];p[y*4]=E[0],p[y*4+1]=E[1],p[y*4+2]=E[2],p[y*4+3]=E[3];let v=i[T];g[y]=v,y++}m[A+2]=y}t.polylineSegmentTexels=p,t.polylineSegmentTextureWidth=u,t.polylineSegmentTextureHeight=f,t.polylineSegmentPrimitiveIndicesTexels=g,t.polylineGridCellIndices=m}static packPolygonCollectionData(t,n,i){if(l(i)&&t._dirtyCount===0&&t._version===i.version)return i;let r=t.primitiveCount,o=t.boundingVolume,s=ie.fromBoundingSphere(o,n),a=q_e(t,n),c=new Float32Array(r),u=new Uint8Array(r*4),f=new Uint8Array(r*4);for(let d=0;d<r;d++){let p=t.get(d,U_e),g=p.getMaterial(mZe);u[d*4]=z.floatToByte(g.color.red),u[d*4+1]=z.floatToByte(g.color.green),u[d*4+2]=z.floatToByte(g.color.blue),u[d*4+3]=z.floatToByte(g.color.alpha),z_e(f,d,p._pickId)}return Object.assign(i??{},{version:t._version,rectangle:s,positions:a,widths:c,colors:u,pickColors:f})}static packPolygonRings(t,n,i,r){r.polygonRings??(r.polygonRings=[]),r.polygonRingPrimitiveIndices??(r.polygonRingPrimitiveIndices=[]),r.widths??(r.widths=[]),r.colors??(r.colors=[]),r.pickColors??(r.pickColors=[]),r.primitiveCount??(r.primitiveCount=0),r.rectangle??(r.rectangle=ie.clone(i));let o=i.width,s=t.primitiveCount,a=n.positions;for(let c=0;c<s;c++){let u=t.get(c,U_e);if(!u.show)continue;let f=u.vertexOffset,d=u.vertexCount,p=u.getHoles();for(let g=0;g<=p.length;g++){let m=g===0?0:p[g-1],A=(g===p.length?d:p[g])-m;if(A<3)continue;let b=TZe(a,f+m,A,i,o),x=G_e(b,A,-P.EPSILON3,1+P.EPSILON3,-P.EPSILON3,1+P.EPSILON3,H_e);x.vertexCount<3||(r.polygonRings.push(x.positions.slice(0,x.vertexCount*2)),r.polygonRingPrimitiveIndices.push(r.primitiveCount+c))}}r.widths.push(n.widths),r.colors.push(n.colors),r.pickColors.push(n.pickColors),r.primitiveCount+=s}static packPolygonGrid(t){let n=t.polygonRings,i=t.polygonRingPrimitiveIndices,r=0;for(let y=0;y<n.length;y++)r+=n[y].length/2;let o=Math.max(1,Math.ceil(Math.sqrt(r/B_e))),s=new Array(o*o);for(let y=0;y<s.length;y++)s[y]=[];let a=0;for(let y=0;y<n.length;y++){let A=n[y],b=i[y],x=A.length/2,T=1/0,E=1/0,v=-1/0,S=-1/0;for(let _=0;_<x;_++)T=Math.min(T,A[_*2]),v=Math.max(v,A[_*2]),E=Math.min(E,A[_*2+1]),S=Math.max(S,A[_*2+1]);let I=hy(Math.floor(T*o),o),R=hy(Math.floor(v*o),o),O=hy(Math.floor(E*o),o),L=hy(Math.floor(S*o),o);for(let _=O;_<=L;_++)for(let C=I;C<=R;C++){let w=G_e(A,x,C/o-P.EPSILON5,(C+1)/o+P.EPSILON5,_/o-P.EPSILON5,(_+1)/o+P.EPSILON5,H_e),D=w.vertexCount;if(D<3)continue;let N=w.positions,F=s[_*o+C];for(let V=0;V<D;V++){let B=(V+1)%D,j=N[V*2],k=N[V*2+1],G=N[B*2],q=N[B*2+1];k!==q&&(F.push(j,k,G,q,b),a++)}}}let[c,u]=AU(a),f=c*u,d=new Float32Array(f*4).fill(-1),p=new Float32Array(f).fill(-1),g=new Uint32Array(s.length+2);g[0]=o,g[1]=o;let m=0;for(let y=0;y<s.length;y++){let A=s[y];for(let b=0;b<A.length;b+=5)d[m*4]=A[b],d[m*4+1]=A[b+1],d[m*4+2]=A[b+2],d[m*4+3]=A[b+3],p[m]=A[b+4],m++;g[y+2]=m}t.polygonEdgeTexels=d,t.polygonEdgeTextureWidth=c,t.polygonEdgeTextureHeight=u,t.polygonEdgePrimitiveIndicesTexels=p,t.polygonGridCellIndices=g}static packPrimitiveTextures(t,n){let[i,r]=AU(n.primitiveCount),o=new Float32Array(i*r);o.set(yU(n.widths)),n.widthTexture=new Dt({context:t,pixelFormat:$e.RED,pixelDatatype:ze.FLOAT,source:{width:i,height:r,arrayBufferView:o},sampler:Ht.NEAREST,flipY:!1});let s=new Uint8Array(i*r*4);s.set(yU(n.colors)),n.colorTexture=new Dt({context:t,pixelFormat:$e.RGBA,pixelDatatype:ze.UNSIGNED_BYTE,source:{width:i,height:r,arrayBufferView:s},sampler:Ht.NEAREST,flipY:!1});let a=new Uint8Array(i*r*4);a.set(yU(n.pickColors)),n.pickColorTexture=new Dt({context:t,pixelFormat:$e.RGBA,pixelDatatype:ze.UNSIGNED_BYTE,source:{width:i,height:r,arrayBufferView:a},sampler:Ht.NEAREST,flipY:!1})}static packPolylineTextures(t,n){n.polylineSegmentTexture=new Dt({context:t,pixelFormat:$e.RGBA,pixelDatatype:ze.FLOAT,source:{width:n.polylineSegmentTextureWidth,height:n.polylineSegmentTextureHeight,arrayBufferView:n.polylineSegmentTexels},sampler:Ht.NEAREST,flipY:!1}),n.polylineSegmentPrimitiveIndicesTexture=new Dt({context:t,pixelFormat:$e.RED,pixelDatatype:ze.FLOAT,source:{width:n.polylineSegmentTextureWidth,height:n.polylineSegmentTextureHeight,arrayBufferView:n.polylineSegmentPrimitiveIndicesTexels},sampler:Ht.NEAREST,flipY:!1}),n.polylineGridCellIndicesTexture=W_e(t,n.polylineGridCellIndices)}static packPolygonTextures(t,n){n.polygonEdgeTexture=new Dt({context:t,pixelFormat:$e.RGBA,pixelDatatype:ze.FLOAT,source:{width:n.polygonEdgeTextureWidth,height:n.polygonEdgeTextureHeight,arrayBufferView:n.polygonEdgeTexels},sampler:Ht.NEAREST,flipY:!1}),n.polygonEdgePrimitiveIndicesTexture=new Dt({context:t,pixelFormat:$e.RED,pixelDatatype:ze.FLOAT,source:{width:n.polygonEdgeTextureWidth,height:n.polygonEdgeTextureHeight,arrayBufferView:n.polygonEdgePrimitiveIndicesTexels},sampler:Ht.NEAREST,flipY:!1}),n.polygonGridCellIndicesTexture=W_e(t,n.polygonGridCellIndices)}static freeResources(t){t.polylineSegmentTexture?.destroy(),t.widthTexture?.destroy(),t.colorTexture?.destroy(),t.pickColorTexture?.destroy(),t.polylineSegmentPrimitiveIndicesTexture?.destroy(),t.polylineGridCellIndicesTexture?.destroy(),t.polygonEdgeTexture?.destroy(),t.polygonEdgePrimitiveIndicesTexture?.destroy(),t.polygonGridCellIndicesTexture?.destroy()}};function z_e(e,t,n){z.fromRgba(n,UD),e[t*4]=z.floatToByte(UD.red),e[t*4+1]=z.floatToByte(UD.green),e[t*4+2]=z.floatToByte(UD.blue),e[t*4+3]=z.floatToByte(UD.alpha)}function V_e(e,t){if(e>=0)return(e+1)*.5/t.minimumTileScreenPixels;let n=t.metersPerUv;return-e*.5/Math.min(n.x,n.y)}function bZe(e,t,n,i){let r=e.x,o=t.x;o=r+P.negativePiToPi(o-r);let s=n.west+i*.5,a=s+P.negativePiToPi(r-s)-r;r+=a,o+=a;let c=n.north-n.south;e.x=(r-n.west)/i,e.y=(e.y-n.south)/c,t.x=(o-n.west)/i,t.y=(t.y-n.south)/c}function xZe(e,t,n){let i=-n,r=1+n,o=0,s=1,a=e.x,c=e.y,u=t.x,f=t.y,d=u-a,p=f-c,g=[-d,d,-p,p],m=[a-i,r-a,c-i,r-c];for(let y=0;y<4;y++){if(Math.abs(g[y])<1e-12){if(m[y]<0)return!1;continue}let A=m[y]/g[y];if(g[y]<0?o=Math.max(o,A):s=Math.min(s,A),o>s)return!1}return e.x=a+o*d,e.y=c+o*p,t.x=a+s*d,t.y=c+s*p,!0}function hy(e,t){return Math.max(0,Math.min(t-1,e))}var R$=new Float64Array(512),j_e=new Float64Array(512),H_e={positions:new Float64Array(512),vertexCount:0};function TZe(e,t,n,i,r){R$.length<n*2&&(R$=new Float64Array(n*4));let o=R$,s=i.north-i.south,a=e[t*2];o[0]=a,o[1]=e[t*2+1];for(let d=1;d<n;d++){let p=a+P.negativePiToPi(e[(t+d)*2]-a);o[d*2]=p,o[d*2+1]=e[(t+d)*2+1],a=p}let c=i.west+r*.5,u=o[0],f=c+P.negativePiToPi(u-c)-u;for(let d=0;d<n;d++)o[d*2]=(o[d*2]+f-i.west)/r,o[d*2+1]=(o[d*2+1]-i.south)/s;return o}function G_e(e,t,n,i,r,o,s){let a=e,c=t;for(let u=0;u<4;u++){let f=u>>1,d=(u&1)===0?1:-1,p=u===0?n:u===1?i:u===2?r:o,g=c*4+4,m=(u&1)===0,y=m?j_e:s.positions;y.length<g&&(y=new Float64Array(g*2),m?j_e=y:s.positions=y);let A=0,b=a[(c-1)*2],x=a[(c-1)*2+1],T=d*((f===0?b:x)-p)>=0;for(let E=0;E<c;E++){let v=a[E*2],S=a[E*2+1],I=d*((f===0?v:S)-p)>=0;if(I!==T){let R=f===0?(p-b)/(v-b):(p-x)/(S-x);y[A*2]=f===0?p:b+R*(v-b),y[A*2+1]=f===0?x+R*(S-x):p,A++}I&&(y[A*2]=v,y[A*2+1]=S,A++),b=v,x=S,T=I}if(A===0)return s.vertexCount=0,s;a=y,c=A}return s.vertexCount=c,s}function AU(e){let t=P.nextPowerOfTwo(Math.max(1,Math.ceil(Math.sqrt(e)))),n=P.nextPowerOfTwo(Math.max(1,Math.ceil(e/t)));return[t,n]}function W_e(e,t){let[n,i]=AU(t.length),r=new Float32Array(n*i);return r.set(t),new Dt({context:e,pixelFormat:$e.RED,pixelDatatype:ze.FLOAT,source:{width:n,height:i,arrayBufferView:r},sampler:Ht.NEAREST,flipY:!1})}function q_e(e,t,n){l(n)||(n=new Float64Array(e._positionCountMax*2));let i=e._positionView,r=e.modelMatrix;for(let o=0;o<e._positionCount;o++){let s=h.fromArray(i,o*3,pZe),a=M.multiplyByPoint(r,s,gZe),c=t.cartesianToCartographic(a,_Ze);n[o*2]=c.longitude,n[o*2+1]=c.latitude}return n}function yU(e){let t=0;for(let o of e)t+=o.byteLength;let n=e[0].constructor,i=new n(t/n.BYTES_PER_ELEMENT),r=0;for(let o of e)i.set(o,r),r+=o.length;return i}var Rs=O$;var L$=new Lo,M$="ClippingPolygonCollection.quality is deprecated as of CesiumJS 1.145 and will be removed in 1.147. Signed distance field clipping was replaced with vector clipping, so this property no longer has any effect.",N$="ClippingPolygonCollection.debugShowDistanceTexture is deprecated as of CesiumJS 1.145 and will be removed in 1.147. Signed distance field clipping was replaced with vector clipping, so this property no longer has any effect.",EZe="ClippingPolygonCollection.isDestroyed is deprecated as of CesiumJS 1.145 and will be removed in 1.147. The collection no longer holds any GPU resources of its own, so it does not need to be destroyed.",CZe="ClippingPolygonCollection.destroy is deprecated as of CesiumJS 1.145 and will be removed in 1.147. The collection no longer holds any GPU resources of its own, so it does not need to be destroyed.";function Kc(e){e=e??H.EMPTY_OBJECT,this._polygons=[];let t=e.polygons??[],n=0,i=0;for(let r=0;r<t.length;++r)n+=t[r].length,i+=t[r].holes.length;this._dirty=!1,this._bufferPolygonCollection=new tc({show:!1,allowPicking:!1,primitiveCountMax:2*t.length,vertexCountMax:2*n,holeCountMax:i>0?2*i:0,triangleCountMax:0});for(let r=0;r<t.length;++r){let o=this._bufferPolygonCollection.primitiveCount;this._bufferPolygonCollection.add(X_e(t[r]),L$),this._polygons.push({clippingPolygon:t[r],bufferIndex:o})}l(e.debugShowDistanceTexture)&&Yr("ClippingPolygonCollection.debugShowDistanceTexture",N$),this._debugShowDistanceTexture=e.debugShowDistanceTexture??!1,this.enabled=e.enabled??!0,this.inverse=e.inverse??!1,l(e.quality)&&Yr("ClippingPolygonCollection.quality",M$),this._quality=e.quality??1,this.polygonAdded=new be,this.polygonRemoved=new be,this.ellipsoid=e.ellipsoid??ee.default,this._owner=void 0,this._vectorCollectionData=Rs.packPolygonCollectionData(this._bufferPolygonCollection,this.ellipsoid)}Object.defineProperties(Kc.prototype,{length:{get:function(){return this._polygons.length}},debugShowDistanceTexture:{get:function(){return Yr("ClippingPolygonCollection.debugShowDistanceTexture",N$),this._debugShowDistanceTexture},set:function(e){Yr("ClippingPolygonCollection.debugShowDistanceTexture",N$),this._debugShowDistanceTexture=e}},quality:{get:function(){return Yr("ClippingPolygonCollection.quality",M$),this._quality},set:function(e){Yr("ClippingPolygonCollection.quality",M$),this._quality=e}},owner:{get:function(){return this._owner}},clippingPolygonsState:{get:function(){return!this.enabled||this.length===0?0:this.inverse?-1:1}}});function X_e(e){let t=e.positions,n=e.holes,i=new Float64Array(e.length*3),r=0;for(let s=0;s<t.length;s++)h.pack(t[s],i,r*3),r++;if(n.length===0)return{positions:i,holes:void 0};let o=new Uint32Array(n.length);for(let s=0;s<n.length;s++){let a=n[s];o[s]=r;for(let c=0;c<a.length;c++)h.pack(a[c],i,r*3),r++}return{positions:i,holes:o}}function vZe(e,t,n){let i=e._bufferPolygonCollection,r=i.primitiveCount+1,o=i.vertexCount+t,s=i.holeCount+n;if(r<=i.primitiveCountMax&&o<=i.vertexCountMax&&s<=i.holeCountMax)return i;let a=e._polygons.length!==i.primitiveCount,c=tc.fromCollection(i,{primitiveCountMax:P.nextPowerOfTwo(r),vertexCountMax:P.nextPowerOfTwo(o),holeCountMax:P.nextPowerOfTwo(s)},a?u=>u.show:void 0);if(i.destroy(),e._bufferPolygonCollection=c,a){let u=e._polygons;for(let f=0;f<u.length;++f)u[f].bufferIndex=f}return c}function K_e(e,t){e._bufferPolygonCollection.get(t.bufferIndex,L$).show=!1,t.bufferIndex=-1}Kc.prototype.add=function(e){let t=this._polygons.length,n=vZe(this,e.length,e.holes.length);return this._polygons.push({clippingPolygon:e,bufferIndex:n.primitiveCount}),n.add(X_e(e),L$),this._dirty=!0,this.polygonAdded.raiseEvent(e,t),e};Kc.prototype.get=function(e){return this._polygons[e]?.clippingPolygon};Kc.prototype.contains=function(e){return this._polygons.some(t=>ND.equals(t.clippingPolygon,e))};Kc.prototype.remove=function(e){let t=this._polygons,n=t.findIndex(r=>ND.equals(r.clippingPolygon,e));if(n===-1)return!1;let[i]=t.splice(n,1);return K_e(this,i),this._dirty=!0,this.polygonRemoved.raiseEvent(i.clippingPolygon,n),!0};Kc.prototype.removeAll=function(){let e=this._polygons,t=e.length;for(let n=0;n<t;++n){let i=e[n];K_e(this,i),this.polygonRemoved.raiseEvent(i.clippingPolygon,n)}this._dirty=!0,this._polygons=[]};Kc.prototype.update=function(e){if(!Kc.isSupported(e))throw new oe("ClippingPolygonCollections are only supported for WebGL 2.");this._dirty&&(this._dirty=!1,this.length!==0&&(this._vectorCollectionData=Rs.packPolygonCollectionData(this._bufferPolygonCollection,this.ellipsoid)))};var Y_e=new ie,SZe=new ie;Kc.prototype.computeIntersectionWithBoundingVolume=function(e,t){let n=this._polygons,i=n.length,r=$t.OUTSIDE;this.inverse&&(r=$t.INSIDE);let o=e.rectangle;if(!l(o)&&l(e.boundingVolume?.computeCorners)){let s=e.boundingVolume.computeCorners();o=ie.fromCartesianArray(s,t,Y_e)}l(o)||(o=ie.fromBoundingSphere(e.boundingSphere,t,Y_e));for(let s=0;s<i;++s){let a=n[s].clippingPolygon,c=ie.intersection(o,a.rectangle,SZe);if(l(c))return $t.INTERSECTING}return r};Kc.setOwner=function(e,t,n){e!==t[n]&&(t[n]=void 0,l(e)&&(e._owner=t,t[n]=e))};Kc.prototype.requestRectangleData=function(e,t){let n={rectangle:ie.clone(e),polygonRings:[]};return this.length===0||(Rs.packPolygonRings(this._bufferPolygonCollection,this._vectorCollectionData,e,n),n.polygonRings.length===0)||(Rs.packPolygonGrid(n),Rs.packPolygonTextures(t,n)),n};Kc.releaseRectangleData=function(e){Rs.freeResources(e)};Kc.isSupported=function(e){return e?.context.webgl2};Kc.prototype.isDestroyed=function(){return Yr("ClippingPolygonCollection.isDestroyed",EZe),!1};Kc.prototype.destroy=function(){return Yr("ClippingPolygonCollection.destroy",CZe),le(this)};var $c=Kc;var yv={NONE:0,SCENE_LIGHT:1,SUNLIGHT:2};yv.fromGlobeFlags=function(e){return e.enableLighting&&e.dynamicAtmosphereLighting?e.dynamicAtmosphereLightingFromSun?yv.SUNLIGHT:yv.SCENE_LIGHT:yv.NONE};Object.freeze(yv);var my=yv;function $_e(){this.lightIntensity=10,this.rayleighCoefficient=new h(55e-7,13e-6,284e-7),this.mieCoefficient=new h(21e-6,21e-6,21e-6),this.rayleighScaleHeight=1e4,this.mieScaleHeight=3200,this.mieAnisotropy=.9,this.hueShift=0,this.saturationShift=0,this.brightnessShift=0,this.dynamicLighting=my.NONE}$_e.requiresColorCorrect=function(e){return!(P.equalsEpsilon(e.hueShift,0,P.EPSILON7)&&P.equalsEpsilon(e.saturationShift,0,P.EPSILON7)&&P.equalsEpsilon(e.brightnessShift,0,P.EPSILON7))};var Av=$_e;function Ei(e){this._position=void 0,this._radianceMapDirty=!1,this._radianceCommandsDirty=!1,this._convolutionsCommandsDirty=!1,this._irradianceCommandDirty=!1,this._irradianceTextureDirty=!1,this._sphericalHarmonicCoefficientsDirty=!1,this._shouldRegenerateShaders=!1,this._shouldReset=!1,e=e??H.EMPTY_OBJECT;let t=Math.max(Math.floor(Math.min(e.mipmapLevels??7,Math.log2(Ut.maximumCubeMapSize))),0);this._mipmapLevels=t;let n=Math.max(t-1,0)*6;this._radianceMapComputeCommands=new Array(6),this._convolutionComputeCommands=new Array(n),this._irradianceComputeCommand=void 0,this._radianceMapFS=void 0,this._irradianceMapFS=void 0,this._convolveSP=void 0,this._va=void 0,this._radianceMapTextures=new Array(6),this._specularMapTextures=new Array(n),this._radianceCubeMap=void 0,this._irradianceMapTexture=void 0,this._sphericalHarmonicCoefficients=Ei.DEFAULT_SPHERICAL_HARMONIC_COEFFICIENTS.slice(),this._lastTime=new K;let i=Math.max(Math.pow(2,t-1),1);this._textureDimensions=new U(i,i),this._radiiAndDynamicAtmosphereColor=new h,this._sceneEnvironmentMap=void 0,this._backgroundColor=void 0,this._owner=void 0,this.enabled=e.enabled??!0,this.shouldUpdate=!0,this.maximumSecondsDifference=e.maximumSecondsDifference??3600,this.maximumPositionEpsilon=e.maximumPositionEpsilon??1e3,this.atmosphereScatteringIntensity=e.atmosphereScatteringIntensity??2,this.gamma=e.gamma??1,this.brightness=e.brightness??1,this.saturation=e.saturation??1,this.groundColor=e.groundColor??Ei.AVERAGE_EARTH_GROUND_COLOR,this.groundAlbedo=e.groundAlbedo??.31}Object.defineProperties(Ei.prototype,{owner:{get:function(){return this._owner}},shouldRegenerateShaders:{get:function(){return this._shouldRegenerateShaders}},position:{get:function(){return this._position},set:function(e){h.equalsEpsilon(e,this._position,0,this.maximumPositionEpsilon)||(this._position=h.clone(e,this._position),this._shouldReset=!0)}},radianceCubeMap:{get:function(){return this._radianceCubeMap}},maximumMipmapLevel:{get:function(){return this._mipmapLevels}},sphericalHarmonicCoefficients:{get:function(){return this._sphericalHarmonicCoefficients}}});Ei._maximumComputeCommandCount=8;Ei._activeComputeCommandCount=0;Ei._nextFrameCommandQueue=[];Ei._queueCommand=(e,t)=>{if(Ei._activeComputeCommandCount>=Ei._maximumComputeCommandCount){Ei._nextFrameCommandQueue.push(e);return}t.commandList.push(e),Ei._activeComputeCommandCount++};Ei._updateCommandQueue=e=>{if(Ei._maximumComputeCommandCount=Math.log2(Ut.maximumCubeMapSize),Ei._nextFrameCommandQueue.length>0&&Ei._activeComputeCommandCount<Ei._maximumComputeCommandCount){let t=Ei._nextFrameCommandQueue.shift();for(;l(t)&&Ei._activeComputeCommandCount<Ei._maximumComputeCommandCount;){if(t.owner.isDestroyed()||t.canceled){t=Ei._nextFrameCommandQueue.shift();continue}e.commandList.push(t),Ei._activeComputeCommandCount++,t=Ei._nextFrameCommandQueue.shift()}l(t)&&Ei._nextFrameCommandQueue.push(t)}};Ei.setOwner=function(e,t,n){e!==t[n]&&(t[n]=t[n]&&t[n].destroy(),l(e)&&(e._owner=t,t[n]=e))};Ei.prototype.reset=function(){let e=this._radianceMapComputeCommands.length;for(let t=0;t<e;++t)l(this._radianceMapComputeCommands[t])&&(this._radianceMapComputeCommands[t].canceled=!0),this._radianceMapComputeCommands[t]=void 0;e=this._convolutionComputeCommands.length;for(let t=0;t<e;++t)l(this._convolutionComputeCommands[t])&&(this._convolutionComputeCommands[t].canceled=!0),this._convolutionComputeCommands[t]=void 0;l(this._irradianceComputeCommand)&&(this._irradianceComputeCommand.canceled=!0,this._irradianceComputeCommand=void 0),this._radianceMapDirty=!0,this._radianceCommandsDirty=!0,this._convolutionsCommandsDirty=!1,this._irradianceCommandDirty=!1};var wZe=new h,IZe=new h;function PZe(e,t){let n=e._position,i=t.atmosphere,r=t.mapProjection.ellipsoid,o=r.scaleToGeodeticSurface(n,IZe),s=1.025,a=wZe,c=l(o)?h.magnitude(o):r.maximumRadius;return a.x=c*s,a.y=c,a.z=i.dynamicLighting,!h.equalsEpsilon(e._radiiAndDynamicAtmosphereColor,a)||t.environmentMap!==e._sceneEnvironmentMap||t.backgroundColor!==e._backgroundColor?(h.clone(a,e._radiiAndDynamicAtmosphereColor),e._sceneEnvironmentMap=t.environmentMap,e._backgroundColor=t.backgroundColor,!0):!1}var J_e=new h,DZe=new M,RZe=new se,OZe=new z;function MZe(e,t){let n=t.context,i=e._textureDimensions;if(l(e._radianceCubeMap)||(e._radianceCubeMap=new ls({context:n,width:i.x,height:i.y,pixelDatatype:ze.UNSIGNED_BYTE,pixelFormat:$e.RGBA})),e._radianceCommandsDirty){let r=e._radianceMapFS;l(r)||(r=new Xe({sources:[Xm,P2]}),e._radianceMapFS=r),Av.requiresColorCorrect(t.atmosphere)&&r.defines.push("ATMOSPHERE_COLOR_CORRECT");let o=e._position,s=e._radiiAndDynamicAtmosphereColor,a=t.mapProjection.ellipsoid,c=At.eastNorthUpToFixedFrame(o,a,DZe),u=RZe;u.x=e.brightness,u.y=e.saturation,u.z=e.gamma,u.w=e.atmosphereScatteringIntensity,(e.brightness!==1||e.saturation!==1||e.gamma!==1)&&r.defines.push("ENVIRONMENT_COLOR_CORRECT");let f=0;for(let d of ls.faceNames()){let p=e._radianceMapTextures[f];l(p)&&!p.isDestroyed()&&p.destroy(),p=new Dt({context:n,width:i.x,height:i.y,pixelDatatype:ze.UNSIGNED_BYTE,pixelFormat:$e.RGBA}),e._radianceMapTextures[f]=p;let g=f,m=new $f({fragmentShaderSource:r,outputTexture:p,uniformMap:{u_radiiAndDynamicAtmosphereColor:()=>s,u_enuToFixedFrame:()=>c,u_faceDirection:()=>ls.getDirection(d,J_e),u_positionWC:()=>o,u_brightnessSaturationGammaIntensity:()=>u,u_groundColor:()=>e.groundColor.withAlpha(e.groundAlbedo,OZe)},owner:e});m.postExecute=()=>{if(e.isDestroyed()||m.canceled){Ei._activeComputeCommandCount--;return}let y=e._radianceMapComputeCommands;y[g]=void 0;let A=new vs({context:n,colorTextures:[e._radianceMapTextures[g]]});A._bind(),e._radianceCubeMap[d].copyFromFramebuffer(),A._unBind(),A.destroy(),Ei._activeComputeCommandCount--,y.some(l)||(e._convolutionsCommandsDirty=!0,e._shouldRegenerateShaders=!0)},e._radianceMapComputeCommands[f]=m,Ei._queueCommand(m,t),f++}e._radianceCommandsDirty=!1}}function NZe(e,t){let n=e._radianceCubeMap;n.generateMipmap();let i=e._mipmapLevels,r=e._textureDimensions,o=r.x/2,s=r.y/2,a=t.context,c=0,u=()=>{let p=e._specularMapTextures.length;c>=p&&(e._irradianceCommandDirty=!0,i>1&&(n.sampler=new Ht({minificationFilter:Wt.LINEAR_MIPMAP_LINEAR}),e._shouldRegenerateShaders=!0,e._va.destroy(),e._va=void 0,e._convolveSP.destroy(),e._convolveSP=void 0))},f=(p,g,m,y,A)=>()=>{if(e.isDestroyed()||p.canceled){Ei._activeComputeCommandCount--;return}let b=e._convolutionComputeCommands;b[g]=void 0,n.copyFace(t,m,y,A),c++,Ei._activeComputeCommandCount--,m.destroy(),e._specularMapTextures[g]=void 0,u()},d=0;for(let p=1;p<i;++p){for(let g of ls.faceNames()){l(e._specularMapTextures[d])&&e._specularMapTextures[d].destroy();let m=e._specularMapTextures[d]=new Dt({context:a,width:o,height:s,pixelDatatype:ze.UNSIGNED_BYTE,pixelFormat:$e.RGBA}),y=e._va;l(y)||(y=ls.createVertexArray(a,g),e._va=y);let A=e._convolveSP;l(A)||(A=Qt.fromCache({context:a,vertexShaderSource:R2,fragmentShaderSource:D2,attributeLocations:{positions:0}}),e._convolveSP=A);let b=new $f({shaderProgram:A,vertexArray:y,outputTexture:m,persists:!0,owner:e,uniformMap:{u_roughness:()=>p/(i-1),u_radianceTexture:()=>n??a.defaultTexture,u_faceDirection:()=>ls.getDirection(g,J_e)}});b.postExecute=f(b,d,m,g,p),e._convolutionComputeCommands[d]=b,Ei._queueCommand(b,t),++d}o/=2,s/=2}u()}var Z_e=new U(3,3);function LZe(e,t){let n=t.context,i=Z_e,r=e._irradianceMapTexture;l(r)&&!r.isDestroyed()&&r.destroy(),r=new Dt({context:n,width:i.x,height:i.y,pixelDatatype:ze.FLOAT,pixelFormat:$e.RGBA}),e._irradianceMapTexture=r;let o=e._irradianceMapFS;l(o)||(o=new Xe({sources:[I2]}),e._irradianceMapFS=o);let s=new $f({fragmentShaderSource:o,outputTexture:r,owner:e,uniformMap:{u_radianceMap:()=>e._radianceCubeMap??n.defaultTexture}});s.postExecute=()=>{if(e.isDestroyed()||s.canceled){Ei._activeComputeCommandCount--;return}e._irradianceTextureDirty=!1,e._irradianceComputeCommand=void 0,e._sphericalHarmonicCoefficientsDirty=!0,e._irradianceMapFS=void 0,Ei._activeComputeCommandCount--},e._irradianceComputeCommand=s,Ei._queueCommand(s,t),e._irradianceTextureDirty=!0}function FZe(e,t){let n=t.context;if(!l(e._irradianceMapTexture))return;let i=new vs({context:n,colorTextures:[e._irradianceMapTexture],destroyAttachments:!1}),r=Z_e,o=n.readPixels({x:0,y:0,width:r.x,height:r.y,framebuffer:i});for(let s=0;s<9;++s)e._sphericalHarmonicCoefficients[s]=h.unpack(o,s*4),h.multiplyByScalar(e._sphericalHarmonicCoefficients[s],e.atmosphereScatteringIntensity,e._sphericalHarmonicCoefficients[s]);i.destroy(),e._irradianceMapTexture.destroy(),e._irradianceMapTexture=void 0,e._shouldRegenerateShaders=!0}Ei.prototype.update=function(e){let t=e.mode;if(!(Ei.isDynamicUpdateSupported(e)&&this._mipmapLevels>=1)||!this.enabled||!this.shouldUpdate||!l(this._position)||t===re.MORPHING){this._shouldRegenerateShaders=!1;return}Ei._updateCommandQueue(e);let i=e.atmosphere.dynamicLighting,r=PZe(this,e)||i===my.SUNLIGHT&&!K.equalsEpsilon(e.time,this._lastTime,this.maximumSecondsDifference);if(this._shouldReset||r){this.reset(),this._shouldReset=!1,this._lastTime=K.clone(e.time,this._lastTime);return}if(this._radianceMapDirty&&(MZe(this,e),this._radianceMapDirty=!1),this._convolutionsCommandsDirty&&(NZe(this,e),this._convolutionsCommandsDirty=!1),this._irradianceCommandDirty&&(LZe(this,e),this._irradianceCommandDirty=!1),this._irradianceTextureDirty){this._shouldRegenerateShaders=!1;return}if(this._sphericalHarmonicCoefficientsDirty){FZe(this,e),this._sphericalHarmonicCoefficientsDirty=!1;return}this._shouldRegenerateShaders=!1};Ei.prototype.isDestroyed=function(){return!1};Ei.prototype.destroy=function(){let e=this._radianceMapComputeCommands.length;for(let t=0;t<e;++t)this._radianceMapComputeCommands[t]=void 0;e=this._convolutionComputeCommands.length;for(let t=0;t<e;++t)this._convolutionComputeCommands[t]=void 0;this._irradianceMapComputeCommand=void 0,e=this._radianceMapTextures.length;for(let t=0;t<e;++t)this._radianceMapTextures[t]=this._radianceMapTextures[t]&&!this._radianceMapTextures[t].isDestroyed()&&this._radianceMapTextures[t].destroy();e=this._specularMapTextures.length;for(let t=0;t<e;++t)this._specularMapTextures[t]=this._specularMapTextures[t]&&!this._specularMapTextures[t].isDestroyed()&&this._specularMapTextures[t].destroy();return this._radianceCubeMap=this._radianceCubeMap&&this._radianceCubeMap.destroy(),this._irradianceMapTexture=this._irradianceMapTexture&&!this._irradianceMapTexture.isDestroyed()&&this._irradianceMapTexture.destroy(),l(this._va)&&this._va.destroy(),l(this._convolveSP)&&this._convolveSP.destroy(),le(this)};Ei.isDynamicUpdateSupported=function(e){let t=e.context;return t.halfFloatingPointTexture||t.colorBufferFloat};Ei.AVERAGE_EARTH_GROUND_COLOR=Object.freeze(z.fromCssColorString("#717145"));Ei.DEFAULT_SPHERICAL_HARMONIC_COEFFICIENTS=Object.freeze([Object.freeze(new h(.35449,.35449,.35449)),h.ZERO,h.ZERO,h.ZERO,h.ZERO,h.ZERO,h.ZERO,h.ZERO,h.ZERO]);var py=Ei;var Q_e={SURFACES_ONLY:0,SURFACES_AND_EDGES:1,EDGES_ONLY:2};Object.freeze(Q_e);var kh=Q_e;var eye={XTRANSLATE:"xTranslate",YTRANSLATE:"yTranslate",ZTRANSLATE:"zTranslate",XROTATE:"xRotate",YROTATE:"yRotate",ZROTATE:"zRotate",XSCALE:"xScale",YSCALE:"yScale",ZSCALE:"zScale",UNIFORMSCALE:"uniformScale"};Object.freeze(eye);var zl=eye;var tye={STEP:0,LINEAR:1,CUBICSPLINE:2};Object.freeze(tye);var _p=tye;function BZe(e){switch(e){case"SCALAR":return 1;case"VEC2":return 2;case"VEC3":return 3;case"VEC4":case"MAT2":return 4;case"MAT3":return 9;case"MAT4":return 16}}var vd=BZe;function kZe(e,t){let n=t.bufferView;if(l(n)){let i=e.bufferViews[n];if(l(i.byteStride)&&i.byteStride>0)return i.byteStride}return Y.getSizeInBytes(t.componentType)*vd(t.type)}var pf=kZe;function UZe(e){switch(e){case Y.BYTE:return function(t,n,i,r,o){for(let s=0;s<i;++s)o[s]=t.getInt8(n+s*r)};case Y.UNSIGNED_BYTE:return function(t,n,i,r,o){for(let s=0;s<i;++s)o[s]=t.getUint8(n+s*r)};case Y.SHORT:return function(t,n,i,r,o){for(let s=0;s<i;++s)o[s]=t.getInt16(n+s*r,!0)};case Y.UNSIGNED_SHORT:return function(t,n,i,r,o){for(let s=0;s<i;++s)o[s]=t.getUint16(n+s*r,!0)};case Y.INT:return function(t,n,i,r,o){for(let s=0;s<i;++s)o[s]=t.getInt32(n+s*r,!0)};case Y.UNSIGNED_INT:return function(t,n,i,r,o){for(let s=0;s<i;++s)o[s]=t.getUint32(n+s*r,!0)};case Y.FLOAT:return function(t,n,i,r,o){for(let s=0;s<i;++s)o[s]=t.getFloat32(n+s*r,!0)};case Y.DOUBLE:return function(t,n,i,r,o){for(let s=0;s<i;++s)o[s]=t.getFloat64(n+s*r,!0)}}}var gy=UZe;function nc(){}Object.defineProperties(nc.prototype,{class:{get:function(){pe.throwInstantiationError()}}});nc.prototype.hasProperty=function(e){pe.throwInstantiationError()};nc.prototype.hasPropertyBySemantic=function(e){pe.throwInstantiationError()};nc.prototype.getPropertyIds=function(e){pe.throwInstantiationError()};nc.prototype.getProperty=function(e){pe.throwInstantiationError()};nc.prototype.setProperty=function(e,t){pe.throwInstantiationError()};nc.prototype.getPropertyBySemantic=function(e){pe.throwInstantiationError()};nc.prototype.setPropertyBySemantic=function(e,t){pe.throwInstantiationError()};nc.hasProperty=function(e,t,n){if(l(t[e]))return!0;let i=n.properties;if(!l(i))return!1;let r=i[e];return!!(l(r)&&l(r.default))};nc.hasPropertyBySemantic=function(e,t,n){let i=n.propertiesBySemantic;if(!l(i))return!1;let r=i[e];return l(r)};nc.getPropertyIds=function(e,t,n){n=l(n)?n:[],n.length=0;for(let r in e)e.hasOwnProperty(r)&&l(e[r])&&n.push(r);let i=t.properties;if(l(i))for(let r in i)i.hasOwnProperty(r)&&!l(e[r])&&l(i[r].default)&&n.push(r);return n};nc.getProperty=function(e,t,n){let i=n.properties[e],r=t[e];Array.isArray(r)&&l(r.slice)&&(r=r.slice());let o=!0;if(r=i.handleNoData(r),!l(r)&&l(i.default))return r=Ze(i.default,!0),i.unpackVectorAndMatrixTypes(r,o);if(l(r))return r=i.normalize(r),r=i.applyValueTransform(r),i.unpackVectorAndMatrixTypes(r,o)};nc.setProperty=function(e,t,n,i){if(!l(n[e]))return!1;Array.isArray(t)&&l(t.slice)&&(t=t.slice());let r,o=i.properties;return l(o)&&(r=o[e]),l(r)&&(t=r.packVectorAndMatrixTypes(t,!0),t=r.unapplyValueTransform(t),t=r.unnormalize(t)),n[e]=t,!0};nc.getPropertyBySemantic=function(e,t,n){let i=n.propertiesBySemantic;if(!l(i))return;let r=i[e];if(l(r))return nc.getProperty(r.id,t,n)};nc.setPropertyBySemantic=function(e,t,n,i){let r=i.propertiesBySemantic;if(!l(r))return!1;let o=i.propertiesBySemantic[e];return l(o)?nc.setProperty(o.id,t,n,i):!1};var Xn=nc;var nye={};function zD(e){this._count=e.count,this._properties=Ze(e.properties,!0)}zD.prototype.hasProperty=function(e){return Xn.hasProperty(e,this._properties,nye)};zD.prototype.getPropertyIds=function(e){return Xn.getPropertyIds(this._properties,nye,e)};zD.prototype.getProperty=function(e,t){let n=this._properties[t];if(l(n))return Ze(n[e],!0)};zD.prototype.setProperty=function(e,t,n){let i=this._properties[t];l(i)||(i=new Array(this._count),this._properties[t]=i),i[e]=Ze(n,!0)};var _y=zD;function xc(e){e=e??H.EMPTY_OBJECT,this._name=e.name,this._id=e.id,this._count=e.count,this._extras=e.extras,this._extensions=e.extensions,this._metadataTable=e.metadataTable,this._jsonMetadataTable=e.jsonMetadataTable,this._batchTableHierarchy=e.batchTableHierarchy,this._texture=e.texture}Object.defineProperties(xc.prototype,{name:{get:function(){return this._name}},id:{get:function(){return this._id}},count:{get:function(){return this._count}},class:{get:function(){if(l(this._metadataTable))return this._metadataTable.class}},properties:{get:function(){if(l(this._metadataTable))return this._metadataTable.properties}},extras:{get:function(){return this._extras}},extensions:{get:function(){return this._extensions}},byteLength:{get:function(){let e=0;return l(this._metadataTable)&&(e+=this._metadataTable.byteLength),l(this._batchTableHierarchy)&&(e+=this._batchTableHierarchy.byteLength),e}},texture:{get:function(){return this._texture}}});xc.prototype.hasProperty=function(e,t){return!!(l(this._metadataTable)&&this._metadataTable.hasProperty(t)||l(this._batchTableHierarchy)&&this._batchTableHierarchy.hasProperty(e,t)||l(this._jsonMetadataTable)&&this._jsonMetadataTable.hasProperty(t))};xc.prototype.hasPropertyBySemantic=function(e,t){return l(this._metadataTable)?this._metadataTable.hasPropertyBySemantic(t):!1};xc.prototype.propertyExists=function(e){return!!(l(this._metadataTable)&&this._metadataTable.hasProperty(e)||l(this._batchTableHierarchy)&&this._batchTableHierarchy.propertyExists(e)||l(this._jsonMetadataTable)&&this._jsonMetadataTable.hasProperty(e))};xc.prototype.propertyExistsBySemantic=function(e){return l(this._metadataTable)?this._metadataTable.hasPropertyBySemantic(e):!1};var F$=[];xc.prototype.getPropertyIds=function(e,t){if(t=l(t)?t:[],t.length=0,l(this._metadataTable)){let n=this._metadataTable.getPropertyIds(F$);Zn(t,n)}if(l(this._batchTableHierarchy)){let n=this._batchTableHierarchy.getPropertyIds(e,F$);Zn(t,n)}if(l(this._jsonMetadataTable)){let n=this._jsonMetadataTable.getPropertyIds(F$);Zn(t,n)}return t};xc.prototype.getProperty=function(e,t){let n;if(l(this._metadataTable)&&(n=this._metadataTable.getProperty(e,t),l(n))||l(this._batchTableHierarchy)&&(n=this._batchTableHierarchy.getProperty(e,t),l(n))||l(this._jsonMetadataTable)&&(n=this._jsonMetadataTable.getProperty(e,t),l(n)))return n};xc.prototype.setProperty=function(e,t,n){l(this._metadataTable)&&this._metadataTable.setProperty(e,t,n)||l(this._batchTableHierarchy)&&this._batchTableHierarchy.setProperty(e,t,n)||(l(this._jsonMetadataTable)||(this._jsonMetadataTable=new _y({count:this._count,properties:{}})),this._jsonMetadataTable.setProperty(e,t,n))};xc.prototype.getPropertyBySemantic=function(e,t){if(l(this._metadataTable))return this._metadataTable.getPropertyBySemantic(e,t)};xc.prototype.setPropertyBySemantic=function(e,t,n){return l(this._metadataTable)?this._metadataTable.setPropertyBySemantic(e,t,n):!1};xc.prototype.getPropertyTypedArray=function(e){if(l(this._metadataTable))return this._metadataTable.getPropertyTypedArray(e)};xc.prototype.getPropertyTypedArrayBySemantic=function(e){if(l(this._metadataTable))return this._metadataTable.getPropertyTypedArrayBySemantic(e)};xc.prototype.isClass=function(e,t){let n=this._batchTableHierarchy;return l(n)?n.isClass(e,t):!1};xc.prototype.isExactClass=function(e,t){return this.getExactClassName(e)===t};xc.prototype.getExactClassName=function(e){let t=this._batchTableHierarchy;if(l(t))return t.getClassName(e)};xc.prototype.destroy=function(){return this._texture=this._texture&&this._texture.destroy(),le(this)};var vu=xc;var iye={OPAQUE:"OPAQUE",MASK:"MASK",BLEND:"BLEND"};Object.freeze(iye);var cg=iye;var Sr={},B$=class{constructor(){this.octEncoded=!1,this.octEncodedZXY=!1,this.normalizationRange=void 0,this.quantizedVolumeOffset=void 0,this.quantizedVolumeDimensions=void 0,this.quantizedVolumeStepSize=void 0,this.componentDatatype=void 0,this.type=void 0}},k$=class{constructor(){this.name=void 0,this.semantic=void 0,this.setIndex=void 0,this.componentDatatype=void 0,this.type=void 0,this.normalized=!1,this.count=void 0,this.min=void 0,this.max=void 0,this.constant=void 0,this.quantization=void 0,this.typedArray=void 0,this.buffer=void 0,this.byteOffset=0,this.byteStride=void 0}},U$=class{constructor(){this.indexDatatype=void 0,this.count=void 0,this.buffer=void 0,this.typedArray=void 0}},z$=class{constructor(){this.featureCount=void 0,this.nullFeatureId=void 0,this.propertyTableId=void 0,this.setIndex=void 0,this.label=void 0,this.positionalLabel=void 0}},V$=class{constructor(){this.featureCount=void 0,this.nullFeatureId=void 0,this.propertyTableId=void 0,this.offset=0,this.repeat=void 0,this.label=void 0,this.positionalLabel=void 0}},j$=class{constructor(){this.featureCount=void 0,this.nullFeatureId=void 0,this.propertyTableId=void 0,this.textureReader=void 0,this.label=void 0,this.positionalLabel=void 0}},H$=class{constructor(){this.attributes=[]}},G$=class{constructor(){this.attributes=[],this.morphTargets=[],this.indices=void 0,this.material=void 0,this.primitiveType=void 0,this.polygon=void 0,this.vector=void 0,this.featureIds=[],this.propertyTextureIds=[],this.propertyAttributeIds=[],this.outlineCoordinates=void 0,this.modelPrimitiveImagery=void 0,this.edgeVisibility=void 0}},W$=class{constructor(){this.attributes=[],this.featureIds=[],this.transformInWorldSpace=!1}},q$=class{constructor(){this.index=void 0,this.joints=[],this.inverseBindMatrices=[]}},Y$=class{constructor(){this.name=void 0,this.index=void 0,this.children=[],this.primitives=[],this.instances=void 0,this.skin=void 0,this.matrix=void 0,this.translation=void 0,this.rotation=void 0,this.scale=void 0,this.morphWeights=[],this.articulationName=void 0,this.meshVector=void 0}},X$=class{constructor(){this.nodes=[]}},zZe={TRANSLATION:"translation",ROTATION:"rotation",SCALE:"scale",WEIGHTS:"weights"},K$=class{constructor(){this.input=[],this.interpolation=void 0,this.output=[]}},$$=class{constructor(){this.node=void 0,this.path=void 0}},J$=class{constructor(){this.sampler=void 0,this.target=void 0}},Z$=class{constructor(){this.name=void 0,this.samplers=[],this.channels=[]}},Q$=class{constructor(){this.name=void 0,this.type=void 0,this.minimumValue=void 0,this.maximumValue=void 0,this.initialValue=void 0}},eJ=class{constructor(){this.name=void 0,this.stages=[]}},bU=class{constructor(){this.credits=[]}},tJ=class{constructor(){this.asset=new bU,this.scene=void 0,this.nodes=[],this.skins=[],this.animations=[],this.articulations=[],this.structuralMetadata=void 0,this.upAxis=void 0,this.forwardAxis=void 0,this.transform=M.clone(M.IDENTITY),this.extensions={}}},nJ=class{constructor(){this.texture=void 0,this.index=void 0,this.texCoord=0,this.transform=$.clone($.IDENTITY),this.scale=1,this.channels=void 0,this.constantLod=void 0}},yy=class yy{constructor(){this.baseColorTexture=void 0,this.metallicRoughnessTexture=void 0,this.baseColorFactor=se.clone(yy.DEFAULT_BASE_COLOR_FACTOR),this.metallicFactor=yy.DEFAULT_METALLIC_FACTOR,this.roughnessFactor=yy.DEFAULT_ROUGHNESS_FACTOR}};ut(yy,"DEFAULT_BASE_COLOR_FACTOR",se.ONE),ut(yy,"DEFAULT_METALLIC_FACTOR",1),ut(yy,"DEFAULT_ROUGHNESS_FACTOR",1);var xU=yy,Ay=class Ay{constructor(){this.diffuseTexture=void 0,this.specularGlossinessTexture=void 0,this.diffuseFactor=se.clone(Ay.DEFAULT_DIFFUSE_FACTOR),this.specularFactor=h.clone(Ay.DEFAULT_SPECULAR_FACTOR),this.glossinessFactor=Ay.DEFAULT_GLOSSINESS_FACTOR}};ut(Ay,"DEFAULT_DIFFUSE_FACTOR",se.ONE),ut(Ay,"DEFAULT_SPECULAR_FACTOR",h.ONE),ut(Ay,"DEFAULT_GLOSSINESS_FACTOR",1);var iJ=Ay,bv=class bv{constructor(){this.specularFactor=bv.DEFAULT_SPECULAR_FACTOR,this.specularTexture=void 0,this.specularColorFactor=h.clone(bv.DEFAULT_SPECULAR_COLOR_FACTOR),this.specularColorTexture=void 0}};ut(bv,"DEFAULT_SPECULAR_FACTOR",1),ut(bv,"DEFAULT_SPECULAR_COLOR_FACTOR",h.ONE);var rJ=bv,xv=class xv{constructor(){this.anisotropyStrength=xv.DEFAULT_ANISOTROPY_STRENGTH,this.anisotropyRotation=xv.DEFAULT_ANISOTROPY_ROTATION,this.anisotropyTexture=void 0}};ut(xv,"DEFAULT_ANISOTROPY_STRENGTH",0),ut(xv,"DEFAULT_ANISOTROPY_ROTATION",0);var oJ=xv,Tv=class Tv{constructor(){this.clearcoatFactor=Tv.DEFAULT_CLEARCOAT_FACTOR,this.clearcoatTexture=void 0,this.clearcoatRoughnessFactor=Tv.DEFAULT_CLEARCOAT_ROUGHNESS_FACTOR,this.clearcoatRoughnessTexture=void 0,this.clearcoatNormalTexture=void 0}};ut(Tv,"DEFAULT_CLEARCOAT_FACTOR",0),ut(Tv,"DEFAULT_CLEARCOAT_ROUGHNESS_FACTOR",0);var sJ=Tv,aJ=class{constructor(){ut(this,"width");ut(this,"pattern")}},TU=class TU{constructor(t={}){let{wireframeFill:n=TU.DEFAULT_WIREFRAME_FILL,backgroundFill:i=!1,behind:r=!1}=t;this.wireframeFill=n,this.backgroundFill=i,this.behind=r}};ut(TU,"DEFAULT_WIREFRAME_FILL",0);var cJ=TU,EU=class EU{constructor(){this.metallicRoughness=new xU,this.specularGlossiness=void 0,this.specular=void 0,this.anisotropy=void 0,this.clearcoat=void 0,this.emissiveTexture=void 0,this.normalTexture=void 0,this.occlusionTexture=void 0,this.emissiveFactor=h.clone(EU.DEFAULT_EMISSIVE_FACTOR),this.alphaMode=cg.OPAQUE,this.alphaCutoff=.5,this.doubleSided=!1,this.unlit=!1,this.pointDiameter=void 0,this.planarFill=void 0,this.lineStyle=void 0}};ut(EU,"DEFAULT_EMISSIVE_FACTOR",h.ZERO);var lJ=EU,uJ=class{constructor(){ut(this,"count",0);ut(this,"triangleIndices");ut(this,"triangleIndicesOffsets");ut(this,"loopIndices");ut(this,"loopIndicesOffsets")}},fJ=class{constructor(){ut(this,"vector",!0);ut(this,"count",0);ut(this,"polygonAttributeOffsets");ut(this,"polygonHoleCounts");ut(this,"polygonHoleOffsets");ut(this,"polygonIndicesOffsets")}};Sr.Quantization=B$;Sr.Attribute=k$;Sr.Indices=U$;Sr.FeatureIdAttribute=z$;Sr.FeatureIdTexture=j$;Sr.FeatureIdImplicitRange=V$;Sr.MorphTarget=H$;Sr.Primitive=G$;Sr.Instances=W$;Sr.Skin=q$;Sr.Node=Y$;Sr.Scene=X$;Sr.AnimatedPropertyType=Object.freeze(zZe);Sr.AnimationSampler=K$;Sr.AnimationTarget=$$;Sr.AnimationChannel=J$;Sr.Animation=Z$;Sr.ArticulationStage=Q$;Sr.Articulation=eJ;Sr.Asset=bU;Sr.Components=tJ;Sr.TextureReader=nJ;Sr.MetallicRoughness=xU;Sr.SpecularGlossiness=iJ;Sr.Specular=rJ;Sr.Anisotropy=oJ;Sr.Clearcoat=sJ;Sr.PlanarFill=cJ;Sr.LineStyle=aJ;Sr.Material=lJ;Sr.Vector=fJ;Sr.Polygon=uJ;var vn=Sr;var CU={};CU.getImageIdFromTexture=function(e){e=e??H.EMPTY_OBJECT;let{gltf:t,textureId:n,supportedImageFormats:i}=e,r=t.textures[n],o=r.extensions;if(l(o)){if(i.webp&&l(o.EXT_texture_webp))return o.EXT_texture_webp.source;if(i.basis&&l(o.KHR_texture_basisu))return o.KHR_texture_basisu.source}return r.source};CU.createSampler=function(e){e=e??H.EMPTY_OBJECT;let{gltf:t,textureInfo:n,compressedTextureNoMipmap:i=!1}=e,r=hn.REPEAT,o=hn.REPEAT,s=Wt.LINEAR,a=Jn.LINEAR,c=n.index,f=t.textures[c].sampler;if(l(f)){let d=t.samplers[f];r=d.wrapS??r,o=d.wrapT??o,s=d.minFilter??s,a=d.magFilter??a}return i&&s!==Wt.LINEAR&&s!==Wt.NEAREST&&(s===Wt.NEAREST_MIPMAP_NEAREST||s===Wt.NEAREST_MIPMAP_LINEAR?s=Wt.NEAREST:s=Wt.LINEAR),hn.validate(r)||(r=hn.REPEAT),hn.validate(o)||(o=hn.REPEAT),Wt.validate(s)||(s=Wt.LINEAR),Jn.validate(a)||(a=Jn.LINEAR),new Ht({wrapS:r,wrapT:o,minificationFilter:s,magnificationFilter:a})};var VZe=new U(1,1);CU.createModelTextureReader=function(e){e=e??H.EMPTY_OBJECT;let{textureInfo:t,channels:n,texture:i}=e,r=t.texCoord??0,o,s=t.extensions?.KHR_texture_transform;if(l(s)){r=s.texCoord??r;let u=l(s.offset)?U.unpack(s.offset):U.ZERO,f=s.rotation??0,d=l(s.scale)?U.unpack(s.scale):VZe;f=-f,o=new $(Math.cos(f)*d.x,-Math.sin(f)*d.y,u.x,Math.sin(f)*d.x,Math.cos(f)*d.y,u.y,0,0,1)}let a=new vn.TextureReader;a.index=t.index,a.texture=i,a.texCoord=r,a.scale=t.scale,a.transform=o,a.channels=n;let c=t.extensions?.EXT_textureInfo_constant_lod;return l(c)&&(a.constantLod={repetitions:c.repetitions??1,offset:l(c.offset)?U.unpack(c.offset):U.ZERO,minClampDistance:c.minClampDistance??1,maxClampDistance:c.maxClampDistance??4294967296}),a};var gf=CU;function rye(e){e=e??H.EMPTY_OBJECT;let t=e.property,n=e.classProperty,i=e.textures,r=l(t.channels)?t.channels:[0],o=t,s=gf.createModelTextureReader({textureInfo:o,channels:jZe(r),texture:i[o.index]});this._min=t.min,this._max=t.max;let a=t.offset,c=t.scale,u=n.hasValueTransform||l(a)||l(c);a=a??n.offset,c=c??n.scale,a=n.unpackVectorAndMatrixTypes(a),c=n.unpackVectorAndMatrixTypes(c),this._offset=a,this._scale=c,this._hasValueTransform=u,this._textureReader=s,this._classProperty=n,this._extras=t.extras,this._extensions=t.extensions}Object.defineProperties(rye.prototype,{textureReader:{get:function(){return this._textureReader}},hasValueTransform:{get:function(){return this._hasValueTransform}},offset:{get:function(){return this._offset}},scale:{get:function(){return this._scale}},classProperty:{get:function(){return this._classProperty}},extras:{get:function(){return this._extras}},extensions:{get:function(){return this._extensions}}});function jZe(e){return e.map(function(t){return"rgba".charAt(t)}).join("")}var vU=rye;function dJ(e){e=e??H.EMPTY_OBJECT;let t=e.propertyTexture,n=e.class,i=e.textures,r=t.extensions,o=t.extras,s={};if(l(t.properties))for(let a in t.properties)t.properties.hasOwnProperty(a)&&(s[a]=new vU({property:t.properties[a],classProperty:n.properties[a],textures:i}));this._name=e.name,this._id=e.id,this._class=n,this._properties=s,this._extras=o,this._extensions=r}Object.defineProperties(dJ.prototype,{name:{get:function(){return this._name}},id:{get:function(){return this._id}},class:{get:function(){return this._class}},properties:{get:function(){return this._properties}},extras:{get:function(){return this._extras}},extensions:{get:function(){return this._extensions}}});dJ.prototype.getProperty=function(e){return this._properties[e]};var by=dJ;function oye(e){e=e??H.EMPTY_OBJECT;let t=e.property,n=e.classProperty;this._attribute=t.attribute,this._classProperty=n,this._min=t.min,this._max=t.max;let i=t.offset,r=t.scale,o=n.hasValueTransform||l(i)||l(r);i=i??n.offset,r=r??n.scale,i=n.unpackVectorAndMatrixTypes(i),r=n.unpackVectorAndMatrixTypes(r),this._offset=i,this._scale=r,this._hasValueTransform=o,this._extras=t.extras,this._extensions=t.extensions}Object.defineProperties(oye.prototype,{attribute:{get:function(){return this._attribute}},hasValueTransform:{get:function(){return this._hasValueTransform}},offset:{get:function(){return this._offset}},scale:{get:function(){return this._scale}},classProperty:{get:function(){return this._classProperty}},extras:{get:function(){return this._extras}},extensions:{get:function(){return this._extensions}}});var SU=oye;function hJ(e){e=e??H.EMPTY_OBJECT;let t=e.propertyAttribute,n=e.class,i={};if(l(t.properties))for(let r in t.properties)t.properties.hasOwnProperty(r)&&(i[r]=new SU({property:t.properties[r],classProperty:n.properties[r]}));this._name=e.name,this._id=e.id,this._class=n,this._properties=i,this._extras=t.extras,this._extensions=t.extensions}Object.defineProperties(hJ.prototype,{name:{get:function(){return this._name}},id:{get:function(){return this._id}},class:{get:function(){return this._class}},properties:{get:function(){return this._properties}},extras:{get:function(){return this._extras}},extensions:{get:function(){return this._extensions}}});hJ.prototype.getProperty=function(e){return this._properties[e]};var Ev=hJ;function Cv(e){e=e??H.EMPTY_OBJECT,this._schema=e.schema;let t=e.propertyTables;this._propertyTableCount=l(t)?t.length:0,this._propertyTables=t??[],this._propertyTextures=e.propertyTextures??[],this._propertyAttributes=e.propertyAttributes??[],this._statistics=e.statistics,this._extras=e.extras,this._extensions=e.extensions}Object.defineProperties(Cv.prototype,{schema:{get:function(){return this._schema}},statistics:{get:function(){return this._statistics}},extras:{get:function(){return this._extras}},extensions:{get:function(){return this._extensions}},propertyTableCount:{get:function(){return this._propertyTableCount}},propertyTables:{get:function(){return this._propertyTables}},propertyTextures:{get:function(){return this._propertyTextures}},propertyAttributes:{get:function(){return this._propertyAttributes}},propertyTablesByteLength:{get:function(){if(!l(this._propertyTables))return 0;let e=0,t=this._propertyTables.length;for(let n=0;n<t;n++)e+=this._propertyTables[n].byteLength;return e}}});Cv.prototype.getPropertyTable=function(e){return this._propertyTables[e]};Cv.prototype.getPropertyTexture=function(e){return this._propertyTextures[e]};Cv.prototype.getPropertyAttribute=function(e){return this._propertyAttributes[e]};Cv.prototype.destroy=function(){let e=this._propertyTables;for(let t=0;t<e.length;t++)e[t]=e[t]&&e[t].destroy();return le(this)};var ic=Cv;function xy(e,t,n){return t=t??0,n=n??e.byteLength-t,e=e.subarray(t,t+n),xy.decode(e)}xy.decodeWithTextDecoder=function(e){return new TextDecoder("utf-8").decode(e)};xy.decodeWithFromCharCode=function(e){let t="",n=HZe(e),i=n.length;for(let r=0;r<i;++r){let o=n[r];o<=65535?t+=String.fromCharCode(o):(o-=65536,t+=String.fromCharCode((o>>10)+55296,(o&1023)+56320))}return t};function VD(e,t,n){return t<=e&&e<=n}function HZe(e){let t=0,n=0,i=0,r=128,o=191,s=[],a=e.length;for(let c=0;c<a;++c){let u=e[c];if(i===0){if(VD(u,0,127)){s.push(u);continue}if(VD(u,194,223)){i=1,t=u&31;continue}if(VD(u,224,239)){u===224&&(r=160),u===237&&(o=159),i=2,t=u&15;continue}if(VD(u,240,244)){u===240&&(r=144),u===244&&(o=143),i=3,t=u&7;continue}throw new oe("String decoding failed.")}if(!VD(u,r,o)){t=i=n=0,r=128,o=191,--c;continue}r=128,o=191,t=t<<6|u&63,++n,n===i&&(s.push(t),t=i=n=0)}return s}typeof TextDecoder<"u"?xy.decode=xy.decodeWithTextDecoder:xy.decode=xy.decodeWithFromCharCode;var _f=xy;var un={INT8:"INT8",UINT8:"UINT8",INT16:"INT16",UINT16:"UINT16",INT32:"INT32",UINT32:"UINT32",INT64:"INT64",UINT64:"UINT64",FLOAT32:"FLOAT32",FLOAT64:"FLOAT64"},Jc={INTEGER:"int",UNSIGNED_INTEGER:"uint",FLOAT:"float"};un.typeInfo={INT8:{vectorCompatible:!0,size:1,maximumValue:127,minimumValue:-128,category:Jc.INTEGER},UINT8:{vectorCompatible:!0,size:1,maximumValue:255,minimumValue:0,category:Jc.UNSIGNED_INTEGER},INT16:{vectorCompatible:!0,size:2,maximumValue:32767,minimumValue:-32768,category:Jc.INTEGER},UINT16:{vectorCompatible:!0,size:2,maximumValue:65535,minimumValue:0,category:Jc.UNSIGNED_INTEGER},INT32:{vectorCompatible:!0,size:4,maximumValue:2147483647,minimumValue:-2147483648,category:Jc.INTEGER},UINT32:{vectorCompatible:!0,size:4,maximumValue:4294967295,minimumValue:0,category:Jc.UNSIGNED_INTEGER},INT64:{vectorCompatible:!1,size:8,maximumValue:BigInt("9223372036854775807"),minimumValue:BigInt("-9223372036854775808"),category:Jc.INTEGER,downcastFunction:e=>un.clampToLimits(e,un.INT32)},UINT64:{vectorCompatible:!1,size:8,maximumValue:BigInt("18446744073709551615"),minimumValue:BigInt(0),category:Jc.UNSIGNED_INTEGER,downcastFunction:e=>un.clampToLimits(e,un.UINT32)},FLOAT32:{vectorCompatible:!0,size:4,maximumValue:34028234663852886e22,minimumValue:-34028234663852886e22,category:Jc.FLOAT},FLOAT64:{vectorCompatible:!0,size:8,maximumValue:Number.MAX_VALUE,minimumValue:-Number.MAX_VALUE,category:Jc.FLOAT,downcastFunction:e=>Math.fround(e)}};un.getMinimum=function(e){return un.typeInfo[e].minimumValue};un.getMaximum=function(e){return un.typeInfo[e].maximumValue};un.isIntegerType=function(e){return un.typeInfo[e].category!==Jc.FLOAT};un.isUnsignedIntegerType=function(e){return un.typeInfo[e].category===Jc.UNSIGNED_INTEGER};un.isVectorCompatible=function(e){return un.typeInfo[e].vectorCompatible};un.category=function(e){return un.typeInfo[e].category};un.gpuComponentType=function(e){switch(e){case un.INT64:return"INT32";case un.UINT64:return"UINT32";case un.FLOAT64:return"FLOAT32";default:return e}};un.normalize=function(e,t){return Math.max(Number(e)/Number(un.getMaximum(t)),-1)};un.unnormalize=function(e,t){let n=un.getMaximum(t),i=un.isUnsignedIntegerType(t)?0:-n;return e=P.sign(e)*Math.round(Math.abs(e)*Number(n)),(t===un.INT64||t===un.UINT64)&&dn.supportsBigInt()&&(e=BigInt(e)),e>n?n:e<i?i:e};un.applyValueTransform=function(e,t,n){return n*e+t};un.unapplyValueTransform=function(e,t,n){return n===0?0:(e-t)/n};un.getSizeInBytes=function(e){return un.typeInfo[e].size};un.clampToLimits=function(e,t){let n=un.getMinimum(t),i=un.getMaximum(t);if(typeof e=="bigint"){let r=BigInt(n),o=BigInt(i);return e<r?n:e>o?i:Number(e)}return Math.max(n,Math.min(i,e))};un.downcastFunction=function(e){let n=un.typeInfo[e].downcastFunction;return l(n)?n:i=>i};un.fromComponentDatatype=function(e){switch(e){case Y.BYTE:return un.INT8;case Y.UNSIGNED_BYTE:return un.UINT8;case Y.SHORT:return un.INT16;case Y.UNSIGNED_SHORT:return un.UINT16;case Y.INT:return un.INT32;case Y.UNSIGNED_INT:return un.UINT32;case Y.FLOAT:return un.FLOAT32;case Y.DOUBLE:return un.FLOAT64}};un.toComponentDatatype=function(e){switch(e){case un.INT8:return Y.BYTE;case un.UINT8:return Y.UNSIGNED_BYTE;case un.INT16:return Y.SHORT;case un.UINT16:return Y.UNSIGNED_SHORT;case un.INT32:return Y.INT;case un.UINT32:return Y.UNSIGNED_INT;case un.FLOAT32:return Y.FLOAT;case un.FLOAT64:return Y.DOUBLE}};un.getDataViewAccessors=function(e,t){return{[un.UINT8]:{get:e.getUint8.bind(e),set:e.setUint8.bind(e)},[un.INT8]:{get:e.getInt8.bind(e),set:e.setInt8.bind(e)},[un.UINT16]:{get:i=>e.getUint16(i,!0),set:(i,r)=>e.setUint16(i,r,!0)},[un.INT16]:{get:i=>e.getInt16(i,!0),set:(i,r)=>e.setInt16(i,r,!0)},[un.UINT32]:{get:i=>e.getUint32(i,!0),set:(i,r)=>e.setUint32(i,r,!0)},[un.INT32]:{get:i=>e.getInt32(i,!0),set:(i,r)=>e.setInt32(i,r,!0)},[un.FLOAT32]:{get:i=>e.getFloat32(i,!0),set:(i,r)=>e.setFloat32(i,r,!0)},[un.FLOAT64]:{get:i=>e.getFloat64(i,!0),set:(i,r)=>e.setFloat64(i,r,!0)},[un.UINT64]:{get:i=>e.getBigUint64(i,!0),set:(i,r)=>e.setBigUint64(i,BigInt(r),!0)},[un.INT64]:{get:i=>e.getBigInt64(i,!0),set:(i,r)=>e.setBigInt64(i,BigInt(r),!0)}}[t]};Object.freeze(un);var Lt=un;var eo={SCALAR:"SCALAR",VEC2:"VEC2",VEC3:"VEC3",VEC4:"VEC4",MAT2:"MAT2",MAT3:"MAT3",MAT4:"MAT4",BOOLEAN:"BOOLEAN",STRING:"STRING",ENUM:"ENUM"};eo.isVectorType=function(e){switch(e){case eo.VEC2:case eo.VEC3:case eo.VEC4:return!0;default:return!1}};eo.isMatrixType=function(e){switch(e){case eo.MAT2:case eo.MAT3:case eo.MAT4:return!0;default:return!1}};eo.getComponentCount=function(e){switch(e){case eo.SCALAR:case eo.STRING:case eo.ENUM:case eo.BOOLEAN:return 1;case eo.VEC2:return 2;case eo.VEC3:return 3;case eo.VEC4:return 4;case eo.MAT2:return 4;case eo.MAT3:return 9;case eo.MAT4:return 16}};eo.getMathType=function(e){switch(e){case eo.VEC2:return U;case eo.VEC3:return h;case eo.VEC4:return se;case eo.MAT2:return $i;case eo.MAT3:return $;case eo.MAT4:return M;default:return}};Object.freeze(eo);var bt=eo;function $o(e){e=e??H.EMPTY_OBJECT;let t=e.id,n=e.type,i=e.componentType,r=e.enumType,o=l(i)&&(e.normalized??!1)&&Lt.isIntegerType(i);this._id=t,this._name=e.name,this._description=e.description,this._semantic=e.semantic,this._isLegacyExtension=e.isLegacyExtension,this._type=n,this._componentType=i,this._enumType=r,this._valueType=l(r)?r.valueType:i,this._isArray=e.isArray??!1,this._isVariableLengthArray=e.isVariableLengthArray??!1,this._arrayLength=e.arrayLength,this._min=Ze(e.min,!0),this._max=Ze(e.max,!0),this._normalized=o;let s=Ze(e.offset,!0),a=Ze(e.scale,!0),c=l(s)||l(a),u=!0;l(s)||(s=this.expandConstant(0,u)),l(a)||(a=this.expandConstant(1,u)),this._offset=s,this._scale=a,this._hasValueTransform=c,this._noData=Ze(e.noData,!0),this._default=Ze(e.default,!0),this._required=e.required??!0,this._extras=Ze(e.extras,!0),this._extensions=Ze(e.extensions,!0)}$o.fromJson=function(e){e=e??H.EMPTY_OBJECT;let t=e.id,n=e.property,i=GZe(n),r=WZe(n,e.enums),o;return l(i)?i?o=l(n.optional)?!n.optional:!0:o=n.required??!1:o=!1,new $o({id:t,type:r.type,componentType:r.componentType,enumType:r.enumType,isArray:r.isArray,isVariableLengthArray:r.isVariableLengthArray,arrayLength:r.arrayLength,normalized:n.normalized,min:n.min,max:n.max,offset:n.offset,scale:n.scale,noData:n.noData,default:n.default,required:o,name:n.name,description:n.description,semantic:n.semantic,extras:n.extras,extensions:n.extensions,isLegacyExtension:i})};Object.defineProperties($o.prototype,{id:{get:function(){return this._id}},name:{get:function(){return this._name}},description:{get:function(){return this._description}},type:{get:function(){return this._type}},enumType:{get:function(){return this._enumType}},componentType:{get:function(){return this._componentType}},valueType:{get:function(){return this._valueType}},isArray:{get:function(){return this._isArray}},isVariableLengthArray:{get:function(){return this._isVariableLengthArray}},arrayLength:{get:function(){return this._arrayLength}},normalized:{get:function(){return this._normalized}},max:{get:function(){return this._max}},min:{get:function(){return this._min}},noData:{get:function(){return this._noData}},default:{get:function(){return this._default}},required:{get:function(){return this._required}},semantic:{get:function(){return this._semantic}},hasValueTransform:{get:function(){return this._hasValueTransform}},offset:{get:function(){return this._offset}},scale:{get:function(){return this._scale}},extras:{get:function(){return this._extras}},extensions:{get:function(){return this._extensions}}});function GZe(e){if(e.type==="ARRAY")return!0;let t=e.type;if(t===bt.SCALAR||bt.isMatrixType(t)||bt.isVectorType(t))return!1;if(l(Lt[t]))return!0;if(l(e.noData)||l(e.scale)||l(e.offset)||l(e.required)||l(e.count)||l(e.array)||l(e.optional))return!1}function WZe(e,t){let n=e.type,i=e.componentType,r=n==="ARRAY",o,s,a;r?(o=!0,s=e.componentCount,a=!l(s)):e.array?(o=!0,s=e.count,a=!l(e.count)):(o=!1,s=void 0,a=!1);let c;if(l(e.enumType)&&(c=t[e.enumType]),n===bt.ENUM)return{type:n,componentType:void 0,enumType:c,valueType:c.valueType,isArray:o,isVariableLengthArray:a,arrayLength:s};if(r&&i===bt.ENUM)return{type:i,componentType:void 0,enumType:c,valueType:c.valueType,isArray:o,isVariableLengthArray:a,arrayLength:s};if(n===bt.SCALAR||bt.isMatrixType(n)||bt.isVectorType(n))return{type:n,componentType:i,enumType:void 0,valueType:i,isArray:o,isVariableLengthArray:a,arrayLength:s};if(n===bt.BOOLEAN||n===bt.STRING)return{type:n,componentType:void 0,enumType:void 0,valueType:void 0,isArray:o,isVariableLengthArray:a,arrayLength:s};if(r&&(i===bt.BOOLEAN||i===bt.STRING))return{type:i,componentType:void 0,enumType:void 0,valueType:void 0,isArray:o,isVariableLengthArray:a,arrayLength:s};if(l(i)&&l(Lt[i]))return{type:bt.SCALAR,componentType:i,enumType:void 0,valueType:i,isArray:o,isVariableLengthArray:a,arrayLength:s};if(l(Lt[n]))return{type:bt.SCALAR,componentType:n,enumType:void 0,valueType:n,isArray:o,isVariableLengthArray:a,arrayLength:s}}$o.prototype.normalize=function(e){return this._normalized?mJ(e,this._valueType,Lt.normalize):e};$o.prototype.unnormalize=function(e){return this._normalized?mJ(e,this._valueType,Lt.unnormalize):e};$o.prototype.applyValueTransform=function(e){return!this._hasValueTransform||this._isVariableLengthArray?e:$o.valueTransformInPlace(e,this._offset,this._scale,Lt.applyValueTransform)};$o.prototype.unapplyValueTransform=function(e){return!this._hasValueTransform||this._isVariableLengthArray?e:$o.valueTransformInPlace(e,this._offset,this._scale,Lt.unapplyValueTransform)};$o.prototype.expandConstant=function(e,t){t=t??!1;let n=this._isArray,i=this._arrayLength,r=bt.getComponentCount(this._type),o=n&&r>1;if(!n&&r===1)return e;if(!n)return new Array(r).fill(e);if(!o)return new Array(i).fill(e);if(!t)return new Array(this._arrayLength*r).fill(e);let s=new Array(r).fill(e);return new Array(this._arrayLength).fill(s)};$o.prototype.handleNoData=function(e){let t=this._noData;if(!l(t))return e;if(!lye(e,t))return e};function jD(e){return Array.isArray(e)&&!(e instanceof $i)&&!(e instanceof $)&&!(e instanceof M)}function lye(e,t){if(!jD(e))return e===t;if(!jD(t)||e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(!lye(e[n],t[n]))return!1;return!0}$o.prototype.unpackVectorAndMatrixTypes=function(e,t){t=t??!1;let n=bt.getMathType(this._type),i=this._isArray,r=bt.getComponentCount(this._type),o=i&&r>1;return l(n)?t&&o?e.map(function(s){return n.unpack(s)}):i?n.unpackArray(e):n.unpack(e):e};$o.prototype.packVectorAndMatrixTypes=function(e,t){t=t??!1;let n=bt.getMathType(this._type),i=this._isArray,r=bt.getComponentCount(this._type),o=i&&r>1;return l(n)?t&&o?e.map(function(s){return n.pack(s,[])}):i?n.packArray(e,[]):n.pack(e,[]):e};$o.prototype.validate=function(e){if(!(!l(e)&&l(this._default)))return this._required&&!l(e)?"required property must have a value":this._isArray?qZe(this,e):uye(this,e)};function qZe(e,t){if(!jD(t))return`value ${t} must be an array`;let n=t.length;if(!e._isVariableLengthArray&&n!==e._arrayLength)return"Array length does not match property.arrayLength";for(let i=0;i<n;i++){let r=uye(e,t[i]);if(l(r))return r}}function uye(e,t){let n=e._type,i=e._componentType,r=e._enumType,o=e._normalized;return bt.isVectorType(n)?YZe(t,n,i):bt.isMatrixType(n)?XZe(t,n,i):n===bt.STRING?KZe(t):n===bt.BOOLEAN?$Ze(t):n===bt.ENUM?JZe(t,r):ZZe(t,i,o)}function YZe(e,t,n){if(!Lt.isVectorCompatible(n))return`componentType ${n} is incompatible with vector type ${t}`;if(t===bt.VEC2&&!(e instanceof U))return`vector value ${e} must be a Cartesian2`;if(t===bt.VEC3&&!(e instanceof h))return`vector value ${e} must be a Cartesian3`;if(t===bt.VEC4&&!(e instanceof se))return`vector value ${e} must be a Cartesian4`}function XZe(e,t,n){if(!Lt.isVectorCompatible(n))return`componentType ${n} is incompatible with matrix type ${t}`;if(t===bt.MAT2&&!(e instanceof $i))return`matrix value ${e} must be a Matrix2`;if(t===bt.MAT3&&!(e instanceof $))return`matrix value ${e} must be a Matrix3`;if(t===bt.MAT4&&!(e instanceof M))return`matrix value ${e} must be a Matrix4`}function KZe(e){if(typeof e!="string")return wU(e,bt.STRING)}function $Ze(e){if(typeof e!="boolean")return wU(e,bt.BOOLEAN)}function JZe(e,t){let n=typeof e;if(l(t))return n!=="string"||!l(t.valuesByName[e])?`value ${e} is not a valid enum name for ${t.id}`:void 0}function ZZe(e,t,n){let i=typeof e;switch(t){case Lt.INT8:case Lt.UINT8:case Lt.INT16:case Lt.UINT16:case Lt.INT32:case Lt.UINT32:case Lt.FLOAT32:case Lt.FLOAT64:return i!=="number"?wU(e,t):isFinite(e)?aye(e,t,n):cye(e,t);case Lt.INT64:case Lt.UINT64:return i!=="number"&&i!=="bigint"?wU(e,t):i==="number"&&!isFinite(e)?cye(e,t):aye(e,t,n)}}function wU(e,t){return`value ${e} does not match type ${t}`}function sye(e,t,n){let i=`value ${e} is out of range for type ${t}`;return n&&(i+=" (normalized)"),i}function aye(e,t,n){if(n){let i=Lt.isUnsignedIntegerType(t)?0:-1;return e<i||e>1?sye(e,t,n):void 0}if(e<Lt.getMinimum(t)||e>Lt.getMaximum(t))return sye(e,t,n)}function cye(e,t){return`value ${e} of type ${t} must be finite`}function mJ(e,t,n){if(!jD(e))return n(e,t);for(let i=0;i<e.length;i++)e[i]=mJ(e[i],t,n);return e}$o.valueTransformInPlace=function(e,t,n,i){if(!jD(e))return i(e,t,n);for(let r=0;r<e.length;r++)e[r]=$o.valueTransformInPlace(e[r],t[r],n[r],i);return e};$o.prototype.cpuBytesPerElement=function(){return fye(this,this.valueType)};$o.prototype.gpuBytesPerElement=function(){let e=Lt.gpuComponentType(this.valueType);return fye(this,e)};function fye(e,t){let n=e.type,i=bt.getComponentCount(n),r=e.isArray?e.arrayLength:1,o=Lt.getSizeInBytes(t);return i*r*o}$o.prototype.isGpuCompatible=function(e){let t=this.type;return!(this.isVariableLengthArray||t===bt.STRING||t===bt.BOOLEAN||this.gpuBytesPerElement()>e)};var pJ=[void 0,"float","vec2","vec3","vec4"],dye=[void 0,"int","ivec2","ivec3","ivec4"],QZe=[void 0,"uint","uvec2","uvec3","uvec4"],eQe={[Jc.FLOAT]:"uintBitsToFloat",[Jc.INTEGER]:"int",[Jc.UNSIGNED_INTEGER]:""};$o.prototype.getGlslTypeWebGL1=function(){let e=bt.getComponentCount(this.type);return this.isArray&&(e=this.arrayLength),this.normalized?pJ[e]:dye[e]};$o.prototype.getGlslType=function(){let e=this.valueType,t=bt.getComponentCount(this.type),n=this.isArray?this.arrayLength:1;return t*=n,!Lt.isIntegerType(e)||this.normalized?pJ[t]:Lt.isUnsignedIntegerType(e)?QZe[t]:dye[t]};$o.prototype.unpackTextureInShader=function(e,t,n,i){let r=this.getGlslType(),o=Lt.gpuComponentType(this.valueType),s=t.length,a=this.type,c=bt.getComponentCount(a)*(this.isArray?this.arrayLength:1),u=Math.floor(s/c),f=`${n}_rawChannels`,d=`${n}_rawBits`,p=`${n}_unpackedValue`,g=`${r} ${p};`,m=`uint ${d};`;i.push(g),i.push(m);let y=`${pJ[s]} ${f} = ${e};`;i.push(y);let A=eQe[Lt.category(o)],b=c>1;for(let x=0;x<c;x++){let T="rgba".slice(x*u,(x+1)*u),E=s>1?`.${T}`:"",v=`${d} = czm_unpackTexture(${f}${E});`,S="";b&&(S=`[${x}]`);let I="",R="";if(this.normalized){let L=Lt.getMaximum(o);I=` * ${1/Number(L)}`,R="float"}let O=`${p}${S} = ${R}(${A}(${d}))${I};`;i.push(v),i.push(O)}return p};$o.prototype.unpackTextureInShaderWebGL1=function(e){return this.normalized?e:`${this.getGlslTypeWebGL1()}(255.0 * ${e})`};var lg=$o;function HD(e){e=e??H.EMPTY_OBJECT;let t=e.count,n=e.property,i=e.classProperty,r=e.bufferViews,o=i.type,s=i.isArray,a=i.isVariableLengthArray,c=i.valueType,u=i.enumType,f=o===bt.STRING,d=o===bt.BOOLEAN,p=0,g;if(a){let _=n.arrayOffsetType??n.offsetType;_=Lt[_]??Lt.UINT32;let C=n.arrayOffsets??n.arrayOffsetBufferView;g=new gJ(r[C],_,t+1),p+=g.typedArray.byteLength}let m=bt.getComponentCount(o),y;a?y=g.get(t)-g.get(0):s?y=t*i.arrayLength:y=t;let A=m*y,b;if(f){let _=n.stringOffsetType??n.offsetType;_=Lt[_]??Lt.UINT32;let C=n.stringOffsets??n.stringOffsetBufferView;b=new gJ(r[C],_,A+1),p+=b.typedArray.byteLength}(f||d)&&(c=Lt.UINT8);let x;f?x=b.get(A)-b.get(0):d?x=Math.ceil(A/8):x=A;let T=n.values??n.bufferView,E=new gJ(r[T],c,x);p+=E.typedArray.byteLength;let v=n.offset,S=n.scale,I=i.hasValueTransform||l(v)||l(S);v=v??i.offset,S=S??i.scale,v=hye(v),S=hye(S);let R,O,L=this;f?R=function(_){return iQe(_,L._values,L._stringOffsets)}:d?(R=function(_){return rQe(_,L._values)},O=function(_,C){oQe(_,L._values,C)}):l(u)?(R=function(_){let C=L._values.get(_);return u.namesByValue[C]},O=function(_,C){let w=u.valuesByName[C];L._values.set(_,w)}):(R=function(_){return L._values.get(_)},O=function(_,C){L._values.set(_,C)}),this._arrayOffsets=g,this._stringOffsets=b,this._values=E,this._classProperty=i,this._count=t,this._vectorComponentCount=m,this._min=n.min,this._max=n.max,this._offset=v,this._scale=S,this._hasValueTransform=I,this._getValue=R,this._setValue=O,this._unpackedValues=void 0,this._extras=n.extras,this._extensions=n.extensions,this._byteLength=p}Object.defineProperties(HD.prototype,{hasValueTransform:{get:function(){return this._hasValueTransform}},offset:{get:function(){return this._offset}},scale:{get:function(){return this._scale}},extras:{get:function(){return this._extras}},extensions:{get:function(){return this._extensions}},byteLength:{get:function(){return this._byteLength}},classProperty:{get:function(){return this._classProperty}}});HD.prototype.get=function(e){let t=tQe(this,e);return t=this._classProperty.handleNoData(t),l(t)?(t=this._classProperty.normalize(t),t=hQe(this,t),this._classProperty.unpackVectorAndMatrixTypes(t)):(t=this._classProperty.default,this._classProperty.unpackVectorAndMatrixTypes(t))};HD.prototype.set=function(e,t){let n=this._classProperty;t=n.packVectorAndMatrixTypes(t),t=mQe(this,t),t=n.unnormalize(t),nQe(this,e,t)};HD.prototype.getTypedArray=function(){if(l(this._values))return this._values.typedArray};function hye(e){if(!Array.isArray(e)||!l(e.slice))return e;let t=[];for(let n=0;n<e.length;n++){let i=e[n];Array.isArray(i)?Zn(t,i):t.push(i)}return t}function tQe(e,t){pye(e)&&gye(e);let n=e._classProperty,i=n.isArray,r=n.type,o=bt.getComponentCount(r);if(l(e._unpackedValues)){let s=e._unpackedValues[t];return i?Ze(s,!0):s}return!i&&o===1?e._getValue(t):mye(e,n,t)}function mye(e,t,n){let i,r;if(t.isVariableLengthArray){i=e._arrayOffsets.get(n),r=e._arrayOffsets.get(n+1)-i;let s=bt.getComponentCount(t.type);i*=s,r*=s}else{let a=(t.arrayLength??1)*e._vectorComponentCount;i=n*a,r=a}let o=new Array(r);for(let s=0;s<r;s++)o[s]=e._getValue(i+s);return o}function nQe(e,t,n){fQe(e,t,n)&&gye(e);let i=e._classProperty,r=i.isArray,o=i.type,s=bt.getComponentCount(o);if(l(e._unpackedValues)){i.isArray&&(n=Ze(n,!0)),e._unpackedValues[t]=n;return}if(!r&&s===1){e._setValue(t,n);return}let a,c;if(i.isVariableLengthArray)a=e._arrayOffsets.get(t),c=e._arrayOffsets.get(t+1)-a;else{let f=(i.arrayLength??1)*e._vectorComponentCount;a=t*f,c=f}for(let u=0;u<c;++u)e._setValue(a+u,n[u])}function iQe(e,t,n){let i=n.get(e),r=n.get(e+1)-i;return _f(t.typedArray,i,r)}function rQe(e,t){let n=e>>3,i=e%8;return(t.typedArray[n]>>i&1)===1}function oQe(e,t,n){let i=e>>3,r=e%8;n?t.typedArray[i]|=1<<r:t.typedArray[i]&=~(1<<r)}function sQe(e,t){let n=t.dataView,i=e*8,r=0,o=(n.getUint8(i+7)&128)>0,s=!0;for(let a=0;a<8;++a){let c=n.getUint8(i+a);o&&(s?c!==0&&(c=~(c-1)&255,s=!1):c=~c&255),r+=c*Math.pow(256,a)}return o&&(r=-r),r}function aQe(e,t){let n=t.dataView,i=e*8,r=BigInt(0),o=(n.getUint8(i+7)&128)>0,s=!0;for(let a=0;a<8;++a){let c=n.getUint8(i+a);o&&(s?c!==0&&(c=~(c-1)&255,s=!1):c=~c&255),r+=BigInt(c)*(BigInt(1)<<BigInt(a*8))}return o&&(r=-r),r}function cQe(e,t){let n=t.dataView,i=e*8,r=n.getUint32(i,!0),o=n.getUint32(i+4,!0);return r+4294967296*o}function lQe(e,t){let n=t.dataView,i=e*8,r=BigInt(n.getUint32(i,!0)),o=BigInt(n.getUint32(i+4,!0));return r+BigInt(4294967296)*o}function uQe(e){switch(e){case Lt.INT8:return Y.BYTE;case Lt.UINT8:return Y.UNSIGNED_BYTE;case Lt.INT16:return Y.SHORT;case Lt.UINT16:return Y.UNSIGNED_SHORT;case Lt.INT32:return Y.INT;case Lt.UINT32:return Y.UNSIGNED_INT;case Lt.FLOAT32:return Y.FLOAT;case Lt.FLOAT64:return Y.DOUBLE}}function pye(e){if(l(e._unpackedValues))return!1;let t=e._classProperty,n=t.type,i=t.valueType;return n===bt.STRING||i===Lt.INT64&&!dn.supportsBigInt64Array()||i===Lt.UINT64&&!dn.supportsBigUint64Array()}function fQe(e,t,n){if(pye(e))return!0;let i=e._arrayOffsets;if(l(i)){let r=i.get(t+1)-i.get(t),o=n.length;if(r!==o)return!0}return!1}function gye(e){e._unpackedValues=dQe(e),e._arrayOffsets=void 0,e._stringOffsets=void 0,e._values=void 0}function dQe(e){let t=e._count,n=new Array(t),i=e._classProperty,r=i.isArray,o=i.type,s=bt.getComponentCount(o);if(!r&&s===1){for(let a=0;a<t;++a)n[a]=e._getValue(a);return n}for(let a=0;a<t;a++)n[a]=mye(e,i,a);return n}function hQe(e,t){let i=e._classProperty.isVariableLengthArray;return!e._hasValueTransform||i?t:lg.valueTransformInPlace(t,e._offset,e._scale,Lt.applyValueTransform)}function mQe(e,t){let i=e._classProperty.isVariableLengthArray;return!e._hasValueTransform||i?t:lg.valueTransformInPlace(t,e._offset,e._scale,Lt.unapplyValueTransform)}function gJ(e,t,n){let i=this,r,o,s;if(t===Lt.INT64)dn.supportsBigInt()?dn.supportsBigInt64Array()?(r=new BigInt64Array(e.buffer,e.byteOffset,n),s=function(a,c){i.typedArray[a]=BigInt(c)}):(r=new Uint8Array(e.buffer,e.byteOffset,n*8),o=function(a){return aQe(a,i)}):(yt("INT64 type is not fully supported on this platform. Values greater than 2^53 - 1 or less than -(2^53 - 1) may lose precision when read."),r=new Uint8Array(e.buffer,e.byteOffset,n*8),o=function(a){return sQe(a,i)});else if(t===Lt.UINT64)dn.supportsBigInt()?dn.supportsBigUint64Array()?(r=new BigUint64Array(e.buffer,e.byteOffset,n),s=function(a,c){i.typedArray[a]=BigInt(c)}):(r=new Uint8Array(e.buffer,e.byteOffset,n*8),o=function(a){return lQe(a,i)}):(yt("UINT64 type is not fully supported on this platform. Values greater than 2^53 - 1 may lose precision when read."),r=new Uint8Array(e.buffer,e.byteOffset,n*8),o=function(a){return cQe(a,i)});else{let a=uQe(t);r=Y.createArrayBufferView(a,e.buffer,e.byteOffset,n),s=function(c,u){i.typedArray[c]=u}}l(o)||(o=function(a){return i.typedArray[a]}),this.typedArray=r,this.dataView=new DataView(r.buffer,r.byteOffset),this.get=o,this.set=s,this._componentType=t}var IU=HD;function Uh(e){e=e??H.EMPTY_OBJECT;let t=e.count,n=e.class,i=0,r={};if(l(e.properties)){for(let o in e.properties)if(e.properties.hasOwnProperty(o)){let s=new IU({count:t,property:e.properties[o],classProperty:n.properties[o],bufferViews:e.bufferViews});r[o]=s,i+=s.byteLength}}this._count=t,this._class=n,this._properties=r,this._byteLength=i}Object.defineProperties(Uh.prototype,{count:{get:function(){return this._count}},class:{get:function(){return this._class}},byteLength:{get:function(){return this._byteLength}},properties:{get:function(){return this._properties}}});Uh.prototype.hasProperty=function(e){return Xn.hasProperty(e,this._properties,this._class)};Uh.prototype.hasPropertyBySemantic=function(e){return Xn.hasPropertyBySemantic(e,this._properties,this._class)};Uh.prototype.getPropertyIds=function(e){return Xn.getPropertyIds(this._properties,this._class,e)};Uh.prototype.getProperty=function(e,t){let n=this._properties[t],i;return l(n)?i=n.get(e):i=pQe(this._class,t),i};Uh.prototype.setProperty=function(e,t,n){let i=this._properties[t];return l(i)?(i.set(e,n),!0):!1};Uh.prototype.getPropertyBySemantic=function(e,t){let n,i=this._class.propertiesBySemantic;if(l(i)&&(n=i[t]),l(n))return this.getProperty(e,n.id)};Uh.prototype.setPropertyBySemantic=function(e,t,n){let i,r=this._class.propertiesBySemantic;return l(r)&&(i=r[t]),l(i)?this.setProperty(e,i.id,n):!1};Uh.prototype.getPropertyTypedArray=function(e){let t=this._properties[e];if(l(t))return t.getTypedArray()};Uh.prototype.getPropertyTypedArrayBySemantic=function(e){let t,n=this._class.propertiesBySemantic;if(l(n)&&(t=n[e]),l(t))return this.getPropertyTypedArray(t.id)};function pQe(e,t){let n=e.properties;if(!l(n))return;let i=n[t];if(l(i)&&l(i.default)){let r=i.default;return i.isArray&&(r=Ze(r,!0)),r=i.normalize(r),i.unpackVectorAndMatrixTypes(r)}}var zh=Uh;function gQe(e){e=e??H.EMPTY_OBJECT;let t=e.extension,n=e.schema,i=[];if(l(t.propertyTables))for(let s=0;s<t.propertyTables.length;s++){let a=t.propertyTables[s],c=n.classes[a.class],u=_Qe(a,e.bufferViews,c,e.context),f=new zh({count:a.count,properties:a.properties,class:c,bufferViews:e.bufferViews});i.push(new vu({id:s,name:a.name,count:a.count,metadataTable:f,extras:a.extras,extensions:a.extensions,texture:u}))}let r=[];if(l(t.propertyTextures))for(let s=0;s<t.propertyTextures.length;s++){let a=t.propertyTextures[s];r.push(new by({id:s,name:a.name,propertyTexture:a,class:n.classes[a.class],textures:e.textures}))}let o=[];if(l(t.propertyAttributes))for(let s=0;s<t.propertyAttributes.length;s++){let a=t.propertyAttributes[s];o.push(new Ev({id:s,name:a.name,class:n.classes[a.class],propertyAttribute:a}))}return new ic({schema:n,propertyTables:i,propertyTextures:r,propertyAttributes:o,statistics:t.statistics,extras:t.extras,extensions:t.extensions})}var GD=4;function _Qe(e,t,n,i){let r=e.properties;if(!l(r))return;let o=e.count,s;try{s=yQe(r,t,n,o)}catch(f){console.warn(`Failed to create texture for property table "${e.name}": ${f.message}`);return}let a=s.length;if(a===0)return;if(o>Ut.maximumTextureSize||a>Ut.maximumTextureSize){yt("PropertyTableTextureExceedsMaximumSize",`Cannot create a texture for the property table "${e.name}" because it exceeds the maximum texture size of ${Ut.maximumTextureSize}.`);return}let c=bQe(s,o),u=new Ht({wrapS:hn.CLAMP_TO_EDGE,wrapT:hn.CLAMP_TO_EDGE,minificationFilter:Wt.NEAREST,magnificationFilter:Jn.NEAREST});return Dt.create({context:i,pixelFormat:$e.RGBA,pixelDatatype:ze.UNSIGNED_BYTE,sampler:u,flipY:!1,source:{width:o,height:a,arrayBufferView:c}})}function yQe(e,t,n,i){let r=[],o=n.properties;for(let[s,a]of Object.entries(o)){if(!a.isGpuCompatible(GD))continue;let c=e[s],u=l(c)?t[c.values]:AQe(a,i),f=u.length,d=a.cpuBytesPerElement(),p=f/d;if(p!==i)throw new oe(`Property with ID: "${s}" has (${p}), which does not match number of features in the property table: (${i}).`);r.push({view:u,classProperty:a})}return r}function AQe(e,t){let n=e.noData,i=bt.getComponentCount(e.type),r=e.isArray?e.arrayLength:1;e.type===bt.ENUM&&(n=e.enumType.valuesByName[n]),i===1&&(n=[n]),r===1&&(n=[n]);let o=e.cpuBytesPerElement(),s=Lt.getSizeInBytes(e.valueType),a=new ArrayBuffer(o*t),c=new DataView(a),u=Lt.getDataViewAccessors(c,e.valueType);for(let f=0;f<t;f++)for(let d=0;d<r;d++)for(let p=0;p<i;p++){let g=d*i+p;u.set(o*f+g*s,n[d][p])}return new Uint8Array(a)}function bQe(e,t){let n=e.length,i=new Uint8Array(n*t*GD),r=new DataView(i.buffer,i.byteOffset,i.byteLength);for(let o=0;o<n;o++){let s=e[o],a=s.classProperty,c=o*t*GD,u=a.valueType,f=Lt.gpuComponentType(u);if(u!==f){TQe(s,r,c);continue}xQe(s,i,c)}return i}function xQe(e,t,n){let i=e.view,r=e.classProperty.cpuBytesPerElement(),o=i.length/r;for(let s=0;s<o;s++){let a=s*r,c=n+s*GD;t.set(i.subarray(a,a+r),c)}}function TQe(e,t,n){let i=e.classProperty,r=e.view,o=i.valueType,s=Lt.gpuComponentType(o),a=i.cpuBytesPerElement(),c=r.length/a,u=new DataView(r.buffer,r.byteOffset,r.byteLength),f=Lt.getDataViewAccessors(u,o),d=Lt.getDataViewAccessors(t,s),p=Lt.downcastFunction(o);for(let g=0;g<c;g++){let m=g*a,y=n+g*GD,A=f.get(m);d.set(y,p(A))}}var PU=gQe;function EQe(e){e=e??H.EMPTY_OBJECT;let t=e.extension,n=e.schema,i,r=[],o;if(l(t.featureTables))for(o=Object.keys(t.featureTables).sort(),i=0;i<o.length;i++){let a=o[i],c=t.featureTables[a],u=n.classes[c.class],f=new zh({count:c.count,properties:c.properties,class:u,bufferViews:e.bufferViews});r.push(new vu({id:a,count:c.count,metadataTable:f,extras:c.extras,extensions:c.extensions}))}let s=[];if(l(t.featureTextures))for(o=Object.keys(t.featureTextures).sort(),i=0;i<o.length;i++){let a=o[i],c=t.featureTextures[a];s.push(new by({id:a,propertyTexture:CQe(c),class:n.classes[c.class],textures:e.textures}))}return new ic({schema:n,propertyTables:r,propertyTextures:s,statistics:t.statistics,extras:t.extras,extensions:t.extensions})}function CQe(e){let t={class:e.class,properties:{}},n=e.properties;for(let i in n)if(n.hasOwnProperty(i)){let r=n[i],o={channels:vQe(r.channels),extras:r.extras,extensions:r.extensions};t.properties[i]=Mt(r.texture,o,!0)}return t}function vQe(e){let t=e.length,n=new Array(t);for(let i=0;i<t;i++)n[i]="rgba".indexOf(e[i]);return n}var DU=EQe;var _J=class{get cacheKey(){pe.throwInstantiationError()}load(){pe.throwInstantiationError()}unload(){}process(t){return!1}getError(t,n){l(n)&&l(n.message)&&(t+=` ${n.message}`);let i=new oe(t);return l(n)&&(i.stack=`Original stack: ${n.stack} Handler stack: -${i.stack}`),i}isDestroyed(){return!1}destroy(){return this.unload(),le(this)}},ar=IK;var Bme={UNLOADED:0,LOADING:1,LOADED:2,PROCESSING:3,READY:4,FAILED:5};Object.freeze(Bme);var Ct=Bme;var m3=class extends ar{constructor(t){super(),t=t??H.EMPTY_OBJECT;let n=t.typedArray,i=t.resource,r=t.cacheKey;this._typedArray=n,this._resource=i,this._cacheKey=r,this._state=Ct.UNLOADED,this._promise=void 0}get cacheKey(){return this._cacheKey}get typedArray(){return this._typedArray}async load(){return l(this._promise)?this._promise:l(this._typedArray)?(this._promise=Promise.resolve(this),this._promise):(this._promise=DYe(this),this._promise)}static _fetchArrayBuffer(t){return t.fetchArrayBuffer()}unload(){this._typedArray=void 0}};async function DYe(e){let t=e._resource;e._state=Ct.LOADING;try{let n=await m3._fetchArrayBuffer(t);return e.isDestroyed()?void 0:(e._typedArray=new Uint8Array(n),e._state=Ct.READY,e)}catch(n){if(e.isDestroyed())return;e._state=Ct.FAILED;let i=`Failed to load external buffer: ${t.url}`;throw e.getError(i,n)}}var PC=m3;function RYe(e){let t=e?.extensions;if(l(t))return t.KHR_meshopt_compression??t.EXT_meshopt_compression}var Kb=RYe;var FCn=(function(){var e="b9H79Tebbbe9ok9Geueu9Geub9Gbb9Gruuuuuuueu9Gvuuuuueu9Gduueu9Gluuuueu9Gvuuuuub9Gouuuuuub9Gluuuub9GiuuueuiE8AdilveoveovrrwrrrDDoD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b83iyar9cb83iaar9cb83iKar9cb83izar9cb83iwar9cb83ibcj;abal9Uc;WFbGcjdalca0Ehqdnaicd6mbavcd9imbaDTmbadcefhkaqci2gxal2hmarc;alfclfhParc;qlfceVhsarc;qofclVhzcbhHincdhOcbhAdnavci6mbar9cb83i;Ooar9cb83i;Goar9cb83i;yoar9cb83i;qoadaHfgoybbhCcbhXincbhwcbhQdninaoalfhLaoybbgKaC7aQVhQawcP0meaLhoaKhCawcefgwaXfai6mbkkcbhCarc;qofhwincwhYcwh8AdnaQaC93gocFeGgEcs0mbclh8AaEci0mbcdcbaEEh8Akdnaocw4cFeGgEcs0mbclhYaEci0mbcdcbaEEhYkaYa8AfhEawydbh3cwhYcwh8Adnaocz4cFeGg5cs0mbclh8Aa5ci0mbcdcba5Eh8AkaEa3fhEdnaocFFFFb0mbclhYaocFFF8F0mbcbcdaocjjjw6EhYkawaEa8AfaYfBdbawclfhwaCcefgCcw9hmbkaLhoaKhCaXczfgXai6mbkcbhocehwazhQinawaoaQydbarc;qofaocdtfydb6EhoaQclfhQawcefgwcw9hmbkaoclthAcihOkcbhEarc;qlfcbcjdz:xjjjb8AarcbBd;ilar9cb83i;aladh8Eaqh8Fakh3inarc;qlfadaEaEcb9h9Ral2falz:wjjjb8Aaia8Faia8F6EhadnaqaiaE9RaEaqfai6EgKcsfc9WGgoaK9nmbarc;qofaKfcbaoaK9Rz:xjjjb8AkadaEal2fhhcbhginagaAVcl4hXarc;alfagcdtfh8JaHh8Kcbh8Lina8LaHfhwdndndndndndndnagPlbedibkaKTmvahawfhoarc;qlfawfRbbhQarc;qofhwaahCinawaoRbbgYaQ9RgQcetaQcKtc8F91786bbawcefhwaoalfhoaYhQaEaCcufgC9hmbxvkkaKTmla8Kc9:Ghoa8LcitcwGh8Aarc;qlfawceVfRbbcwtarc;qlfawc9:GfRbbVhQarc;qofhwaahCinawa3aofRbbcwta8EaofRbbVgYaQ9RgQcetaQcztc8F917cFFiGa8A486bbaoalfhoawcefhwaYhQaEaCcufgC9hmbxlkkasa8Kc98GgQfhoa3aQfhYarc;qlfawc98GgQfRbbhCcwhwinaoRbbawtaCVhCaocefhoawcwfgwca9hmbxdkkaKTmdxekaKTmea8Lcith5ahaQfh8AcbhLina8ARbbhQcwhoaYhwinawRbbaotaQVhQawcefhwaocwfgoca9hmbkarc;qofaLfaQaC7aX93a5486bbaYalfhYa8Aalfh8AaQhCaLcefgLaK9hmbkka8Jydbh8AcbhLarc;qofhoincdhQcbhwinaQaoawfRbbcb9hfhQawcefgwcz9hmbkclhCcbhwinaCaoawfRbbcd0fhCawcefgwcz9hmbkcwhYcbhwinaYaoawfRbbcP0fhYawcefgwcz9hmbkaQaCaQaC6EgwaYawaY6Egwczawcz6Ea8Afh8AaoczfhoaLczfgLaK6mbka8Ja8ABdbka8Kcefh8Ka8Lcefg8Lcl9hmbkagcefggaO9hmbka8Eamfh8Ea8Faxfh8Fa3amfh3aEaxfgEai6mbkcbhocehwaPhQinawaoaQydbarc;alfaocdtfydb6EhoaQclfhQaOawcefgw9hmbkaraHcd4faAcdVaoaocdSE86bbaHclfgHal6mbkkabaefhgabcefhoalcd4g8McbaDEhkadcefh8Narc;abfceVhecbhmdndninaiam9nmearc;qofcbcjdz:xjjjb8Aagao9Rak6mdadamal2gwfhxcbhHa8Nawfhzaocbakz:xjjjbg8Fakfh3aqaiam9Ramaqfai6Egscsfgocl4cifcd4hOaoc9WGg8JThPindndndndndndndndndndnaDTmbaraHcd4fRbbgQciGPlbedlbkasTmdaxaHfhoarc;abfaHfRbbhQarc;qofhwashCinawaoRbbgYaQ9RgQcetaQcKtc8F91786bbawcefhwaoalfhoaYhQaCcufgCmbxikkasTmiaHcitcwGh8Aarc;abfaHceVfRbbcwtarc;abfaHc9:GgofRbbVhQaxaofhoarc;qofhwashCinawao8VbbgYaQ9RgQcetaQcztc8F917cFFiGa8A486bbawcefhwaoalfhoaYhQaCcufgCmbxikkaeaHc98Gg8Afhoaza8AfhYarc;abfa8AfRbbhCcwhwinaoRbbawtaCVhCaocefhoawcwfgwca9hmbkasTmdaQcl4hKaHcitcKGhEaxa8Afh8AcbhLina8ARbbhQcwhoaYhwinawRbbaotaQVhQawcefhwaocwfgoca9hmbkarc;qofaLfaQaC7aK93aE486bbaYalfhYa8Aalfh8AaQhCaLcefgLas9hmbkkaDmbcbhoxlka8JTmbcbhodninarc;qofaofgwcwf8Pibaw8Pib:e9qTmeaoczfgoa8J9pmdxbkkdnavmbcehoxikcbh8AaOhLaOhKinarc;qofa8Afgocwf8Pibhyao8Pibh8PcdhQcbhwinaQaoawfRbbcb9hfhQawcefgwcz9hmbkclhCcbhwinaCaoawfRbbcd0fhCawcefgwcz9hmbkcwhYcbhwinaYaoawfRbbcP0fhYawcefgwcz9hmbkaQaCaQaC6EgoaYaoaY6Egoczaocz6EaKfhKaocucbaya8P:e9cb9sEgwaoaw6EaLfhLa8Aczfg8Aa8J9pmdxbkka8FaHcd4fgoaoRbbcdaHcetcoGtV86bbxikdnaLas6mbaKas6mba8FaHcd4fgoaoRbbciaHcetcoGtV86bbaga39Ras6mra3arc;qofasz:wjjjbasfh3xikaLaK9phoka8FaHcd4fgwawRbbaoaHcetcoGtV86bbkaga39RaO6mla3cbaOz:xjjjbgaaOfhKdndna8JmbaPhoxekdnagaK9RcK9pmbaPhoxekaocdtc:q:G:cjbfcj:G:cjbaDEg3ydxghcetc;:FFFeGhAcuhEcuahtcu7cFeGh8Ecbh8Karc;qofhQinarc;qofa8KfhXczh8AdndndnahPDbeeeeeeedekcucbaXcwf8PibaX8Pib:e9cb9sEh8AxekcbhoaAh8Aina8Aa8EaQaofRbb9nfh8Aaocefgocz9hmbkkcih5cbhYinczhwdndndna3aYcdtfydbgLPDbeeeeeeedekcucbaXcwf8PibaX8Pib:e9cb9sEhwxekaLcetc;:FFFeGhwcuaLtcu7cFeGhCcbhoinawaCaQaofRbb9nfhwaocefgocz9hmbkkdndnawa8A6mbaLaE9hmeawa8A9hmea3a5cdtfydbcwSmekaYh5awh8AkaYcefgYci9hmbkaaa8Kco4fgoaoRbba5a8Kci4coGtV86bbdndndna3a5cdtfydbgEPDdbbbbbbbebkdncwaE9Tg5TmbcuaEtcu7hwdndnaEceSmbcbh8LaQhXinaXhoa5hYcbhCinaoRbbg8AawcFeGgLa8AaL6EaCaEtVhCaocefhoaYcufgYmbkaKaC86bbaXa5fhXaKcefhKa8La5fg8Lcz6mbxdkkcbh8LaQhXinaXhoa5hYcbhCinaoRbbg8AawcFeGgLa8AaL6EaCcetVhCaocefhoaYcufgYmbkaKaC:T9cFe:d9c:c:qj:bw9:9c:q;c1:I1e:d9c:b:c:e1z9:9ca188bbaXa5fhXaKcefhKa8La5fg8Lcz6mbkkcbhoinaKaQaofRbbgC86bbaKaCawcFeG9pfhKaocefgocz9hmbxikkdnaEceSmbinaKcb86bbaKcefhKxbkkinaKcb86bbaKcefhKxbkkaKaX8Pbw83bwaKaX8Pbb83bbaKczfhKka8Kczfg8Ka8J9pgomeaQczfhQagaK9RcK9pmbkkaoTmlaKh3aKTmlkaHcefgHal9hmbkarc;abfaxascufal2falz:wjjjb8Aasamfhma3hoa3mbkcbhwxdkdnagao9RakalfgwcKcaaDEgQawaQ0EgC9pmbcbhwxdkdnawaQ9pmbaocbaCaw9Rgwz:xjjjbawfhokaoarc;adfalz:wjjjbalfhodnaDTmbaoara8Mz:wjjjba8Mfhokaoab9Rhwxekcbhwkarc;qwf8Kjjjjbawk5babaeadaialcdcbyd;i:I:cjbz:bjjjbk9reduaecd4gdaefgicaaica0Eabcj;abae9Uc;WFbGcjdaeca0Egifcufai9Uae2aiadfaicl4cifcd4f2fcefkmbcbabBd;i:I:cjbk;HPeLu8Jjjjjbc;ae9Rgl8Kjjjjbcbhvdnaeaici9UgocHf6mbabcbyd;m:I:cjbgrc;GeV86bbalc;abfcFecjez:xjjjb8Aal9cu83iUal9cu83i8Wal9cu83iyal9cu83iaal9cu83iKal9cu83izal9cu83iwal9cu83ibabaefc9WfhwabcefgDaofhednaiTmbcmcsarcb9kgqEhkcbhxcbhmcbhPcbhscbhzindnaeaw9nmbcbhvxikazcufhvadaPcdtfgHydbhOaHcwfydbhAaHclfydbhCcbhXdndndninalc;abfavcsGcitfgoydlhQdndndnaoydbgoaO9hmbaQaCSmekdnaoaC9hmbaQaA9hmbaXcefhXxekaoaA9hmeaQaO9hmeaXcdfhXkaXc870mdascufhvaHaXcdtgAcxGgoyd:4:G:cjbcdtfydbhQaHaoyd:0:G:cjbcdtfydbhCaHaoyd:W:G:cjbcdtfydbhOcbhodnindnalavcsGcdtfydbaQ9hmbaohXxdkcuhXavcufhvaocefgocz9hmbkkaxaQaxSgvaXce9iaXak9oVgoGfhxdndndncbcsavEaXaoEgvcs9hmbarce9imbaQaQamaQcefamSgvEgmcefSmecmcsavEhvkaDavaAc;WeGV86bbavcs9hmeaQam9Rgvcetavc8F917hvinaecbcjeavcje6EavcFbGV86bbaecefheavcr4gvmbkaQhmxvkcPhvaDaAcPV86bbaQhmkavTmiavak9omicdhocehXazhAxlkavcufhvaXclfgXc;ab9hmbkkdnaHcecdcbaAaxSEaCaxSEcdtgvyd:W:G:cjbcdtfydbgOTaHavyd:0:G:cjbcdtfydbgCceSGaHavyd:4:G:cjbcdtfydbgQcdSGaxcb9hGaqGgLce9hmbal9cu83iUal9cu83i8Wal9cu83iyal9cu83iaal9cu83iKal9cu83izal9cu83iwal9cu83ibcbhxkcbhXascufgvhodnindnalaocsGcdtfydbaC9hmbaXhAxdkcuhAaocufhoaXcefgXcz9hmbkkcbhodnindnalavcsGcdtfydbaQ9hmbaohXxdkcuhXavcufhvaocefgocz9hmbkkaxaOaxSgKfhHdndnaAcm0mbaAcefhAxekcbcsaCaHSgvEhAaHavfhHkdndnaXcm0mbaXcefhXxekcbcsaQaHSgvEhXaHavfhHkc9:cuaKEhYcbhvaXaAcltVg8AcFeGhodndndninavc;q:G:cjbfRbbaoSmeavcefgvcz9hmbxdkkaLaOax9havcm0VVmbaDavc;WeV86bbxekaDaY86bbaea8A86bbaecefhekdnaKmbaOam9Rgvcetavc8F917hvinaecbcjeavcje6EavcFbGV86bbaecefheavcr4gvmbkaOhmkdnaAcs9hmbaCam9Rgvcetavc8F917hvinaecbcjeavcje6EavcFbGV86bbaecefheavcr4gvmbkaChmkdnaXcs9hmbaQam9Rgvcetavc8F917hvinaecbcjeavcje6EavcFbGV86bbaecefheavcr4gvmbkaQhmkalascdtfaOBdbascefcsGhvdndnaAPzbeeeeeeeeeeeeeebekalavcdtfaCBdbascdfcsGhvkdndnaXPzbeeeeeeeeeeeeeebekalavcdtfaQBdbavcefcsGhvkcihoalc;abfazcitfgXaOBdlaXaCBdbazcefcsGhAcdhXavhsaHhxxekcdhoalascdtfaQBdbcehXascefcsGhsazhAkalc;abfaAcitfgvaCBdlavaQBdbalc;abfazaXfcsGcitfgvaQBdlavaOBdbaDcefhDazaofcsGhzaPcifgPai6mbkkdnaeaw9nmbcbhvxekcbhvinaeavfavc;q:G:cjbfRbb86bbavcefgvcz9hmbkaeab9Ravfhvkalc;aef8KjjjjbavkZeeucbhddninadcefgdc8F0meaeceadt0mbkkadcrfcFeGcr9Uci2cdfabci9U2cHfkmbcbabBd;m:I:cjbk:zderu8Jjjjjbcz9Rhlcbhvdnaeaicvf6mbabcbRb;m:I:cjbc;qeV86bbal9cb83iwabcefhvabaefc98fhodnaiTmbcbhecbhrcbhwindnavao6mbcbskadawcdtfydbgDalcwfaraDae9Rgeaec8F91ge7ae9Rc507grcdtfgqydb9Rgec8E91c9:Gaecdt7arVheinavcbcjeaecje6EaecFbGV86bbavcefhvaecr4gembkaqaDBdbaDheawcefgwai9hmbkkdnavao9nmbcbskavcbBbbavab9RclfhvkavkBeeucbhddninadcefgdc8F0meaeceadt0mbkkabadcwfcFeGcr9U2cvfk:dvli99dui99ludnaeTmbcuadcetcuftcu7:Zhvdndncuaicuftcu7:ZgoJbbbZMgr:lJbbb9p9DTmbar:Ohwxekcjjjj94hwkcbhicbhDinalclfIdbgrJbbbbJbbjZalIdbgq:lar:lMalcwfIdbgk:lMgr:varJbbbb9BEgrNhxaqarNhralcxfIdbhqdndnakJbbbb9GTmbaxhkxekJbbjZar:l:tgkak:maxJbbbb9GEhkJbbjZax:l:tgxax:marJbbbb9GEhrkdndnaqJbbj:;aqJbbj:;9GEgxJbbjZaxJbbjZ9FEavNJbbbZJbbb:;aqJbbbb9GEMgq:lJbbb9p9DTmbaq:Ohmxekcjjjj94hmkdndnakJbbj:;akJbbj:;9GEgqJbbjZaqJbbjZ9FEaoNJbbbZJbbb:;akJbbbb9GEMgq:lJbbb9p9DTmbaq:OhPxekcjjjj94hPkdndnarJbbj:;arJbbj:;9GEgqJbbjZaqJbbjZ9FEaoNJbbbZJbbb:;arJbbbb9GEMgr:lJbbb9p9DTmbar:Ohsxekcjjjj94hskdndnadcl9hmbabaDfgzas86bbazcifam86bbazcdfaw86bbazcefaP86bbxekabaifgzas87ebazcofam87ebazclfaw87ebazcdfaP87ebkaicwfhiaDclfhDalczfhlaecufgembkkk;hlld99eud99eudnaeTmbdndncuaicuftcu7:ZgvJbbbZMgo:lJbbb9p9DTmbao:Ohixekcjjjj94hikaic;8FiGhrinabcofcicdalclfIdb:lalIdb:l9EgialcwfIdb:lalaicdtfIdb:l9EEgialcxfIdb:lalaicdtfIdb:l9EEgiarV87ebdndnJbbj:;JbbjZalaicdtfIdbJbbbb9DEgoalaicd7cdtfIdbJ;Zl:1ZNNgwJbbj:;awJbbj:;9GEgDJbbjZaDJbbjZ9FEavNJbbbZJbbb:;awJbbbb9GEMgw:lJbbb9p9DTmbaw:Ohqxekcjjjj94hqkabcdfaq87ebdndnalaicefciGcdtfIdbJ;Zl:1ZNaoNgwJbbj:;awJbbj:;9GEgDJbbjZaDJbbjZ9FEavNJbbbZJbbb:;awJbbbb9GEMgw:lJbbb9p9DTmbaw:Ohqxekcjjjj94hqkabaq87ebdndnaoalaicufciGcdtfIdbJ;Zl:1ZNNgoJbbj:;aoJbbj:;9GEgwJbbjZawJbbjZ9FEavNJbbbZJbbb:;aoJbbbb9GEMgo:lJbbb9p9DTmbao:Ohixekcjjjj94hikabclfai87ebabcwfhbalczfhlaecufgembkkk;gvdDue998Jjjjjbcjd9Rgo8Kjjjjbdndndnadcd4grTmbc:CucbavEhwaohdarhDinadawBdbadclfhdaDcufgDmbkavcd9hmbaeTmbarcdthqcbhkalhxinaohdaxhDarhwinadadydbgmaDydbcL4cFeGc:cufgPamaP9kEBdbaDclfhDadclfhdawcufgwmbkaxaqfhxakcefgkae9hmbxdkkaeTmekarcdthxavce9hhqcbhkindndndnaqmbarTmdc:CuhDalhdarhwinaDadydbcL4cFeGc:cufgmaDam9kEhDadclfhdawcufgwmbxdkkdndndndnavPleddbdkarTmlaohdalhDarhwinadcbaDydbcL4cFeGgmc:cufgPaPam0EBdbadclfhdaDclfhDawcufgwmbxikkarTmicbhdarhDindnaladfIdbgsJbbbb9Bmbaoadfas:8cL4cFeGgwc8Aawc8A0Ec:cufBdbkadclfhdaDcufgDmbxdkkarTmdkc:CuhDkcbhdarhminaDhwdnavceSmbaoadfydbhwkdndnaladfIdbgscjjj;8iawai9RcefgwcLt9R::NJbbbZJbbb:;asJbbbb9GEMgs:lJbbb9p9DTmbas:OhPxekcjjjj94hPkabadfaPcFFFrGawcKtVBdbadclfhdamcufgmmbkkabaxfhbalaxfhlakcefgkae9hmbkkaocjdf8Kjjjjbk:Olveue99iue99iudnaeTmbceaicufthvcuaitcu7:Zhocbhradcl9hhwcbhDindndnalcwfIdbgqJbbbbaqJbbbb9GEgqJbbjZaqJbbjZ9FEaoNJbbbZMgq:lJbbb9p9DTmbaq:Ohixekcjjjj94hikdndnalIdbgqJbbbbaqJbbbb9GEgqJbbjZaqJbbjZ9FEaoNJbbbZMgq:lJbbb9p9DTmbaq:Ohdxekcjjjj94hdkadai9Rcd9TgkaifhidndnalclfIdbgqJbbbbaqJbbbb9GEgqJbbjZaqJbbjZ9FEaoNJbbbZMgq:lJbbb9p9DTmbaq:Ohdxekcjjjj94hdkadai9Rcd9ThddndnalcxfIdbgqJbbbbaqJbbbb9GEgqJbbjZaqJbbjZ9FEaoNJbbbZMgq:lJbbb9p9DTmbaq:Ohxxekcjjjj94hxkadaifhiaxce91avVhxdndnawmbabaDfgmai86bbamcifax86bbamcdfad86bbamcefak86bbxekabarfgmai87ebamcofax87ebamclfad87ebamcdfak87ebkarcwfhraDclfhDalczfhlaecufgembkkk;mqdQui998Jjjjjbc:qd9Rgv8Kjjjjbavc:Sefcbc;Kbz:xjjjb8AdnadTmbaiTmbdndnabaeSmbaehoxekavcuadcdtgradcFFFFi0Ecbyd;q:I:cjbHjjjjbbgoBd:SeavceBd:mdaoaearz:wjjjb8AkavcbBd:Oeav9cb83i:Geavc:Gefaoadaiavc:Sefz:pjjjbavyd:Gehwadci9UgDcbyd;q:I:cjbHjjjjbbheavc:Sefavyd:mdgqcdtfaeBdbavaqcefgrBd:mdaecbaDz:xjjjbhkavc:SefarcdtfcuaicdtaicFFFFi0Ecbyd;q:I:cjbHjjjjbbgxBdbavaqcdfgmBd:mdalc;ebfhPawheaxhrinaralIdbaPaeydbgscwascw6EcdtfIdbMUdbaeclfhearclfhraicufgimbkavc:SefamcdtfcuaDcdtadcFFFF970Ecbyd;q:I:cjbHjjjjbbgmBdbdnadci6mbaoheamhraDhiinaraxaeydbcdtfIdbaxaeclfydbcdtfIdbMaxaecwfydbcdtfIdbMUdbaecxfhearclfhraicufgimbkkaqcifhzalc;ebfhHavc;qbfhOavheavyd:KehAavyd:OehCcbhscbhrcbhXcehQinaehLaoarcx2fgKydbhPaKclfydbhdabaXcx2fgecwfaKcwfydbgYBdbaeclfadBdbaeaPBdbakarfce86bbaOaYBdwaOadBdlaOaPBdbamarcdtfcbBdbcih8AdnasTmbaLhiinaOa8AcdtfaiydbgeBdba8AaeaY9haeaP9haead9hGGfh8AaiclfhiascufgsmbkkaXcefhXcbhsinaCaAaKascdtfydbcdtgifydbcdtfgYheawaifgdydbgPhidnaPTmbdninaeydbarSmeaeclfheaicufgiTmdxbkkaeaYaPcdtfc98fydbBdbadadydbcufBdbkascefgsci9hmbkdndndna8ATmbcuhrJbbbbhEcbhdavyd:KehYavyd:OehKindnawaOadcdtfydbcdtgsfydbgeTmbaxasfgiIdbh3aialcuadadcs0EcdtfclfIdbaHaecwaecw6EcdtfIdbMg5Udba5a3:th5aecdthiaKaYasfydbcdtfheinamaeydbgscdtfgPa5aPIdbMg3Udba3aEaEa39DgPEhEasaraPEhraeclfheaic98fgimbkkadcefgda8A9hmbkarcu9hmekaQaD9pmeindnakaQfRbbmbaQhrxdkaDaQcefgQ9hmbxdkka8Acza8Acz6EhsaOheaLhOarcu9hmekkazTmbaqcdtavc:Seffcwfheinaeydbcbyd;u:I:cjbH:bjjjbbaec98fheazcufgzmbkkavc:qdf8Kjjjjbk:0leoucuaicdtgvaicFFFFi0Egocbyd;q:I:cjbHjjjjbbhralalyd9GgwcdtfarBdbalawcefBd9GabarBdbaocbyd;q:I:cjbHjjjjbbhralalyd9GgocdtfarBdbalaocefBd9GabarBdlcuadcdtadcFFFFi0Ecbyd;q:I:cjbHjjjjbbhralalyd9GgocdtfarBdbalaocefBd9GabarBdwabydbcbavz:xjjjb8AabydbhraehladhvinaralydbcdtfgoaoydbcefBdbalclfhlavcufgvmbkcbhvabydlglhoarhwaihDinaoavBdbaoclfhoawydbavfhvawclfhwaDcufgDmbkadci9Uhqdnadcd9nmbabydwhocbhvinaecwfydbhwaeclfydbhDalaeydbcdtfgbabydbgbcefBdbaoabcdtfavBdbalaDcdtfgDaDydbgDcefBdbaoaDcdtfavBdbalawcdtfgwawydbgwcefBdbaoawcdtfavBdbaecxfheaqavcefgv9hmbkkinalalydbarydb9RBdbarclfhralclfhlaicufgimbkkQbabaeadaic;G:G:cjbz:ojjjbkQbabaeadaic;i:H:cjbz:ojjjbk9DeeuabcFeaicdtz:xjjjbhlcbhbdnadTmbindnalaeydbcdtfgiydbcu9hmbaiabBdbabcefhbkaeclfheadcufgdmbkkabk:3vioud9:du8Jjjjjbc;Wa9Rgl8Kjjjjbcbhvalcxfcbc;Kbz:xjjjb8AalcuadcitgoadcFFFFe0Ecbyd;q:I:cjbHjjjjbbgrBdxalceBd2araeadaicezNjjjbalcuaoadcjjjjoGEcbyd;q:I:cjbHjjjjbbgwBdzadcdthednadTmbabhiinaiavBdbaiclfhiadavcefgv9hmbkkawaefhDalabBdwalawBdl9cbhqindnadTmbaq9cq9:hkarhvaDhiadheinaiav8Pibak1:NcFrG87ebavcwfhvaicdfhiaecufgembkkalclfaq:NceGcdtfydbhxalclfaq9ce98gq:NceGcdtfydbhmalc;Wbfcbcjaz:xjjjb8AaDhvadhidnadTmbinalc;Wbfav8VebcdtfgeaeydbcefBdbavcdfhvaicufgimbkkcbhvcbhiinalc;WbfavfgeydbhoaeaiBdbaoaifhiavclfgvcja9hmbkadhvdndnadTmbinalc;WbfaDamydbgicetf8VebcdtfgeaeydbgecefBdbaxaecdtfaiBdbamclfhmavcufgvmbkaq9cv9smdcbhvinabawydbcdtfavBdbawclfhwadavcefgv9hmbxdkkaq9cv9smekkcwhvcbhiinalcxfavfc98fydbcbyd;u:I:cjbH:bjjjbbaiceGheclhvcehiaeTmbkalc;Waf8Kjjjjbk:Awliuo99iud9:cbhv8Jjjjjbca9Rgocbyd:4:I:cjbBdKaocb8Pd:W:I:cjb83izaocbyd;e:I:cjbBdwaocb8Pd:8:I:cjb83ibaicd4hrdndnadmbJFFuFhwJFFuuhDJFFuuhqJFFuFhkJFFuuhxJFFuFhmxekarcdthPaehsincbhiinaoczfaifgzasaifIdbgwazIdbgDaDaw9EEUdbaoaifgzawazIdbgDaDaw9DEUdbaiclfgicx9hmbkasaPfhsavcefgvad9hmbkaoIdKhDaoIdwhwaoIdChqaoIdlhkaoIdzhxaoIdbhmkdnadTmbJbbbbJbFu9hJbbbbamax:tgmamJbbbb9DEgmakaq:tgkakam9DEgkawaD:tgwawak9DEgw:vawJbbbb9BEhwdnalmbarcdthoindndnaeclfIdbaq:tawNJbbbZMgk:lJbbb9p9DTmbak:Ohixekcjjjj94hikai:S9cC:ghHdndnaeIdbax:tawNJbbbZMgk:lJbbb9p9DTmbak:Ohixekcjjjj94hikaHai:S:ehHdndnaecwfIdbaD:tawNJbbbZMgk:lJbbb9p9DTmbak:Ohixekcjjjj94hikabaHai:T9cy:g:e83ibaeaofheabcwfhbadcufgdmbxdkkarcdthoindndnaeIdbax:tawNJbbbZMgk:lJbbb9p9DTmbak:Ohixekcjjjj94hikai:SgH9ca:gaH9cz:g9cjjj;4s:d:eaH9cFe:d:e9cF:bj;4:pj;ar:d9c:bd9:9c:p;G:d;4j:E;ar:d9cH9:9c;d;H:W:y:m:g;d;Hb:d9cv9:9c;j:KM;j:KM;j:Kd:dhOdndnaeclfIdbaq:tawNJbbbZMgk:lJbbb9p9DTmbak:Ohixekcjjjj94hikai:SgH9ca:gaH9cz:g9cjjj;4s:d:eaH9cFe:d:e9cF:bj;4:pj;ar:d9c:bd9:9c:p;G:d;4j:E;ar:d9cH9:9c;d;H:W:y:m:g;d;Hb:d9cq9:9cM;j:KM;j:KM;jl:daO:ehOdndnaecwfIdbaD:tawNJbbbZMgk:lJbbb9p9DTmbak:Ohixekcjjjj94hikabaOai:SgH9ca:gaH9cz:g9cjjj;4s:d:eaH9cFe:d:e9cF:bj;4:pj;ar:d9c:bd9:9c:p;G:d;4j:E;ar:d9cH9:9c;d;H:W:y:m:g;d;Hb:d9cC9:9c:KM;j:KM;j:KMD:d:e83ibaeaofheabcwfhbadcufgdmbkkk9teiucbcbyd;y:I:cjbgeabcifc98GfgbBd;y:I:cjbdndnabZbcztgd9nmbcuhiabad9RcFFifcz4nbcuSmekaehikaik;LeeeudndnaeabVciGTmbabhixekdndnadcz9pmbabhixekabhiinaiaeydbBdbaiclfaeclfydbBdbaicwfaecwfydbBdbaicxfaecxfydbBdbaeczfheaiczfhiadc9Wfgdcs0mbkkadcl6mbinaiaeydbBdbaeclfheaiclfhiadc98fgdci0mbkkdnadTmbinaiaeRbb86bbaicefhiaecefheadcufgdmbkkabk;aeedudndnabciGTmbabhixekaecFeGc:b:c:ew2hldndnadcz9pmbabhixekabhiinaialBdbaicxfalBdbaicwfalBdbaiclfalBdbaiczfhiadc9Wfgdcs0mbkkadcl6mbinaialBdbaiclfhiadc98fgdci0mbkkdnadTmbinaiae86bbaicefhiadcufgdmbkkabk9teiucbcbyd;y:I:cjbgeabcrfc94GfgbBd;y:I:cjbdndnabZbcztgd9nmbcuhiabad9RcFFifcz4nbcuSmekaehikaikTeeucbabcbyd;y:I:cjbge9Rcifc98GaefgbBd;y:I:cjbdnabZbcztge9nmbabae9RcFFifcz4nb8Akkk;Sddbcj:Gdk;idbbbbdbbblbbbwbbbbbbbebbbdbbblbbbwbbbbbbbbbbbbbbbbbbbebbbdbbbbbbbebbbbbbbbbbbbbbbb4:h9w9N94:P:gW:j9O:ye9Pbbbbbb:l29hZ;69:9kZ;N;76Z;rg97Z;z;o9xZ8J;B85Z;:;u9yZ;b;k9HZ:2;Z9DZ9e:l9mZ59A8KZ:r;T3Z:A:zYZ79OHZ;j4::8::Y:D9V8:bbbb9s:49:Z8R:hBZ9M9M;M8:L;z;o8:;8:PG89q;x:J878R:hQ8::M:B;e87bbbbbbjZbbjZbbjZ:E;V;N8::Y:DsZ9i;H;68:xd;R8:;h0838:;W:NoZbbbb:WV9O8:uf888:9i;H;68:9c9G;L89;n;m9m89;D8Ko8:bbbbf:8tZ9m836ZS:2AZL;zPZZ818EZ9e:lxZ;U98F8:819E;68:FFuuFFuuFFuuFFuFFFuFFFuFbc;i:IdkCebbbebbbebbbdbbb9G:rbb",t=new Uint8Array([32,0,65,2,1,106,34,33,3,128,11,4,13,64,6,253,10,7,15,116,127,5,8,12,40,16,19,54,20,9,27,255,113,17,42,67,24,23,146,148,18,14,22,45,70,69,56,114,101,21,25,63,75,136,108,28,118,29,73,115]);if(typeof WebAssembly!="object")return{supported:!1};var n,i=WebAssembly.instantiate(r(e),{}).then(function(g){n=g.instance,n.exports.__wasm_call_ctors(),n.exports.meshopt_encodeVertexVersion(1),n.exports.meshopt_encodeIndexVersion(1)});function r(g){for(var m=new Uint8Array(g.length),y=0;y<g.length;++y){var A=g.charCodeAt(y);m[y]=A>96?A-97:A>64?A-39:A+4}for(var b=0,y=0;y<g.length;++y)m[b++]=m[y]<60?t[m[y]]:(m[y]-60)*64+m[++y];return m.buffer.slice(0,b)}function o(g){if(!g)throw new Error("Assertion failed")}function s(g){return new Uint8Array(g.buffer,g.byteOffset,g.byteLength)}function a(g,m,y,A){var b=n.exports.sbrk,x=b(m.length*4),T=b(y*4),E=new Uint8Array(n.exports.memory.buffer),v=s(m);E.set(v,x),A&&A(x,x,m.length,y);var S=g(T,x,m.length,y);E=new Uint8Array(n.exports.memory.buffer);var I=new Uint32Array(y);new Uint8Array(I.buffer).set(E.subarray(T,T+y*4)),v.set(E.subarray(x,x+m.length*4)),b(x-b(0));for(var R=0;R<m.length;++R)m[R]=I[m[R]];return[I,S]}function c(g,m,y,A){var b=n.exports.sbrk,x=b(y*4),T=b(y*A),E=new Uint8Array(n.exports.memory.buffer);E.set(s(m),T),g(x,T,y,A),E=new Uint8Array(n.exports.memory.buffer);var v=new Uint32Array(y);return new Uint8Array(v.buffer).set(E.subarray(x,x+y*4)),b(x-b(0)),v}function u(g,m,y,A,b,x,T){var E=n.exports.sbrk,v=E(m),S=E(A*b),I=new Uint8Array(n.exports.memory.buffer);I.set(s(y),S);var R=g(v,m,S,A,b,x,T),O=new Uint8Array(R);return O.set(I.subarray(v,v+R)),E(v-E(0)),O}function f(g){for(var m=0,y=0;y<g.length;++y){var A=g[y];m=m<A?A:m}return m}function d(g,m){if(o(m==2||m==4),m==4)return new Uint32Array(g.buffer,g.byteOffset,g.byteLength/4);var y=new Uint16Array(g.buffer,g.byteOffset,g.byteLength/2);return new Uint32Array(y)}function p(g,m,y,A,b,x,T){var E=n.exports.sbrk,v=E(y*A),S=E(y*x),I=new Uint8Array(n.exports.memory.buffer);I.set(s(m),S),g(v,y,A,b,S,T);var R=new Uint8Array(y*A);return R.set(I.subarray(v,v+y*A)),E(v-E(0)),R}return{ready:i,supported:!0,reorderMesh:function(g,m,y){o(g instanceof Uint32Array||g instanceof Int32Array),o(!m||g.length%3==0);var A=m?y?n.exports.meshopt_optimizeVertexCacheStrip:n.exports.meshopt_optimizeVertexCache:void 0;return a(n.exports.meshopt_optimizeVertexFetchRemap,g,f(g)+1,A)},reorderPoints:function(g,m){return o(g instanceof Float32Array),o(g.length%m==0),o(m>=3),c(n.exports.meshopt_spatialSortRemap,g,g.length/m,m*4)},encodeVertexBuffer:function(g,m,y){o(y>0&&y<=256),o(y%4==0);var A=n.exports.meshopt_encodeVertexBufferBound(m,y);return u(n.exports.meshopt_encodeVertexBuffer,A,g,m,y)},encodeVertexBufferLevel:function(g,m,y,A,b){o(y>0&&y<=256),o(y%4==0),o(A>=0&&A<=3),o(b===void 0||b==0||b==1);var x=n.exports.meshopt_encodeVertexBufferBound(m,y);return u(n.exports.meshopt_encodeVertexBufferLevel,x,g,m,y,A,b===void 0?-1:b)},encodeIndexBuffer:function(g,m,y){o(y==2||y==4),o(m%3==0);var A=d(g,y),b=n.exports.meshopt_encodeIndexBufferBound(m,f(A)+1);return u(n.exports.meshopt_encodeIndexBuffer,b,A,m,4)},encodeIndexSequence:function(g,m,y){o(y==2||y==4);var A=d(g,y),b=n.exports.meshopt_encodeIndexSequenceBound(m,f(A)+1);return u(n.exports.meshopt_encodeIndexSequence,b,A,m,4)},encodeGltfBuffer:function(g,m,y,A,b){var x={ATTRIBUTES:this.encodeVertexBufferLevel,TRIANGLES:this.encodeIndexBuffer,INDICES:this.encodeIndexSequence};return o(x[A]),x[A](g,m,y,2,b===void 0?0:b)},encodeFilterOct:function(g,m,y,A){return o(y==4||y==8),o(A>=2&&A<=16),p(n.exports.meshopt_encodeFilterOct,g,m,y,A,16)},encodeFilterQuat:function(g,m,y,A){return o(y==8),o(A>=4&&A<=16),p(n.exports.meshopt_encodeFilterQuat,g,m,y,A,16)},encodeFilterExp:function(g,m,y,A,b){o(y>0&&y%4==0),o(A>=1&&A<=24);var x={Separate:0,SharedVector:1,SharedComponent:2,Clamped:3};return o(!b||b in x),p(n.exports.meshopt_encodeFilterExp,g,m,y,A,y,b?x[b]:1)},encodeFilterColor:function(g,m,y,A){return o(y==4||y==8),o(A>=2&&A<=16),p(n.exports.meshopt_encodeFilterColor,g,m,y,A,16)}}})();var ly=(function(){var e="b9H79Tebbbe8Fv9Gbb9Gvuuuuueu9Giuuub9Geueu9Giuuueuixkbeeeddddillviebeoweuecj:Gdkr;Neqo9TW9T9VV95dbH9F9F939H79T9F9J9H229F9Jt9VV7bb8A9TW79O9V9Wt9F9KW9J9V9KW9wWVtW949c919M9MWVbeY9TW79O9V9Wt9F9KW9J9V9KW69U9KW949c919M9MWVbdE9TW79O9V9Wt9F9KW9J9V9KW69U9KW949tWG91W9U9JWbiL9TW79O9V9Wt9F9KW9J9V9KWS9P2tWV9p9JtblK9TW79O9V9Wt9F9KW9J9V9KWS9P2tWV9r919HtbvL9TW79O9V9Wt9F9KW9J9V9KWS9P2tWVT949WboY9TW79O9V9Wt9F9KW9J9V9KWS9P2tWVJ9V29VVbrl79IV9Rbwq1Zkdbk:kYi5ud9:du8Jjjjjbcjq9Rgv8Kjjjjbc9:hodnalTmbcuhoaiRbbgrc;WeGc:Ge9hmbarcsGgwce0mbc9:hoalcufadcd4cbawEgDadfgrcKcaawEgqaraq0Egk6mbaicefhxcj;abad9Uc;WFbGcjdadca0EhmaialfgPar9Rgoadfhsavaoadz:jjjjbgzceVhHcbhOdndninaeaO9nmeaPax9RaD6mdamaeaO9RaOamfgoae6EgAcsfglc9WGhCaAcethXaxaDfhiaOaeaoaeao6E9RhQalcl4cifcd4hLazcjdfaAfhKcbhYabaOad2fg8AhEaHh3incbh5dnawTmbaxaYcd4fRbbh5kcbh8Eazcjdfhqinaih8Fdndndndna5a8Ecet4ciGgoc9:fPdebdkaPa8F9RaA6mrazcjdfa8EaA2fa8FaAz:jjjjb8Aa8FaAfhixdkazcjdfa8EaA2fcbaAz:kjjjb8Aa8FhixekaPa8F9RaL6mva8FaLfhidnaCTmbaPai9RcK6mbaocdtc:q:G:cjbfcj:G:cjbawEhaczhrcbhlinargoc9Wfghaqfhrdndndndndndnaaa8Fahco4fRbbalcoG4ciGcdtfydbPDbedvivvvlvkar9cb83bwar9cb83bbxlkarcbaiRbdai8Xbb9c:c:qj:bw9:9c:q;c1:I1e:d9c:b:c:e1z9:gg9cjjjjjz:dg8J9qE86bbaqaofgrcGfcbaicdfa8J9c8N1:NfghRbbag9cjjjjjw:dg8J9qE86bbarcVfcbaha8J9c8M1:NfghRbbag9cjjjjjl:dg8J9qE86bbarc7fcbaha8J9c8L1:NfghRbbag9cjjjjjd:dg8J9qE86bbarctfcbaha8J9c8K1:NfghRbbag9cjjjjje:dg8J9qE86bbarc91fcbaha8J9c8J1:NfghRbbag9cjjjj;ab:dg8J9qE86bbarc4fcbaha8J9cg1:NfghRbbag9cjjjja:dg8J9qE86bbarc93fcbaha8J9ch1:NfghRbbag9cjjjjz:dgg9qE86bbarc94fcbahag9ca1:NfghRbbai8Xbe9c:c:qj:bw9:9c:q;c1:I1e:d9c:b:c:e1z9:gg9cjjjjjz:dg8J9qE86bbarc95fcbaha8J9c8N1:NfgiRbbag9cjjjjjw:dg8J9qE86bbarc96fcbaia8J9c8M1:NfgiRbbag9cjjjjjl:dg8J9qE86bbarc97fcbaia8J9c8L1:NfgiRbbag9cjjjjjd:dg8J9qE86bbarc98fcbaia8J9c8K1:NfgiRbbag9cjjjjje:dg8J9qE86bbarc99fcbaia8J9c8J1:NfgiRbbag9cjjjj;ab:dg8J9qE86bbarc9:fcbaia8J9cg1:NfgiRbbag9cjjjja:dg8J9qE86bbarcufcbaia8J9ch1:NfgiRbbag9cjjjjz:dgg9qE86bbaiag9ca1:NfhixikaraiRblaiRbbghco4g8Ka8KciSg8KE86bbaqaofgrcGfaiclfa8Kfg8KRbbahcl4ciGg8La8LciSg8LE86bbarcVfa8Ka8Lfg8KRbbahcd4ciGg8La8LciSg8LE86bbarc7fa8Ka8Lfg8KRbbahciGghahciSghE86bbarctfa8Kahfg8KRbbaiRbeghco4g8La8LciSg8LE86bbarc91fa8Ka8Lfg8KRbbahcl4ciGg8La8LciSg8LE86bbarc4fa8Ka8Lfg8KRbbahcd4ciGg8La8LciSg8LE86bbarc93fa8Ka8Lfg8KRbbahciGghahciSghE86bbarc94fa8Kahfg8KRbbaiRbdghco4g8La8LciSg8LE86bbarc95fa8Ka8Lfg8KRbbahcl4ciGg8La8LciSg8LE86bbarc96fa8Ka8Lfg8KRbbahcd4ciGg8La8LciSg8LE86bbarc97fa8Ka8Lfg8KRbbahciGghahciSghE86bbarc98fa8KahfghRbbaiRbigico4g8Ka8KciSg8KE86bbarc99faha8KfghRbbaicl4ciGg8Ka8KciSg8KE86bbarc9:faha8KfghRbbaicd4ciGg8Ka8KciSg8KE86bbarcufaha8KfgrRbbaiciGgiaiciSgiE86bbaraifhixdkaraiRbwaiRbbghcl4g8Ka8KcsSg8KE86bbaqaofgrcGfaicwfa8Kfg8KRbbahcsGghahcsSghE86bbarcVfa8KahfghRbbaiRbeg8Kcl4g8La8LcsSg8LE86bbarc7faha8LfghRbba8KcsGg8Ka8KcsSg8KE86bbarctfaha8KfghRbbaiRbdg8Kcl4g8La8LcsSg8LE86bbarc91faha8LfghRbba8KcsGg8Ka8KcsSg8KE86bbarc4faha8KfghRbbaiRbig8Kcl4g8La8LcsSg8LE86bbarc93faha8LfghRbba8KcsGg8Ka8KcsSg8KE86bbarc94faha8KfghRbbaiRblg8Kcl4g8La8LcsSg8LE86bbarc95faha8LfghRbba8KcsGg8Ka8KcsSg8KE86bbarc96faha8KfghRbbaiRbvg8Kcl4g8La8LcsSg8LE86bbarc97faha8LfghRbba8KcsGg8Ka8KcsSg8KE86bbarc98faha8KfghRbbaiRbog8Kcl4g8La8LcsSg8LE86bbarc99faha8LfghRbba8KcsGg8Ka8KcsSg8KE86bbarc9:faha8KfghRbbaiRbrgicl4g8Ka8KcsSg8KE86bbarcufaha8KfgrRbbaicsGgiaicsSgiE86bbaraifhixekarai8Pbw83bwarai8Pbb83bbaiczfhikdnaoaC9pmbalcdfhlaoczfhraPai9RcL0mekkaoaC6moaimexokaCmva8FTmvkaqaAfhqa8Ecefg8Ecl9hmbkdndndndnawTmbasaYcd4fRbbgociGPlbedrbkaATmdazaYfh8Fazcjdfhhcbh8EaEhaina8FRbbhraahocbhlinaoahalfRbbgqce4cbaqceG9R7arfgr86bbaoadfhoaAalcefgl9hmbkaacefhaa8Fcefh8FahaAfhha8Ecefg8Ecl9hmbxikkaATmeazaYfhaazcjdfhhcbhoceh8EaKh8FinaEaofhlaa8Vbbhrcbhoinala8FaofRbbcwtahaofRbbgqVc;:FiGce4cbaqceG9R7arfgr87bbaladfhlaQaocefgofmbka8FaXfh8FcdhoaacdfhaahaXfhha8EceGhlcbh8EalmbxdkkaATmbaocl4h8EazaYfRbbhqcwhoa3hlinalRbbaotaqVhqalcefhlaocwfgoca9hmbkcbhhaEh8FaKhainazcjdfahfRbbhrcwhoaahlinalRbbaotarVhralaAfhlaocwfgoca9hmbkara8E94aq7hqcbhoa8Fhlinalaqao486bbalcefhlaocwfgoca9hmbka8Fadfh8FaacefhaahcefghaA9hmbkkaEclfhEa3clfh3aYclfgYad6mbkaza8AaAcufad2fadz:jjjjb8AaAaOfhOaihxaimbkc9:hoxdkcbc99aPax9RakSEhoxekc9:hokavcjqf8Kjjjjbaok:ysezu8Jjjjjbc;ae9Rgv8Kjjjjbc9:hodnalaeci9UgrcHf6mbcuhoaiRbbgwc;WeGc;Ge9hmbawcsGgDce0mbavc;abfcFecjez:kjjjb8Aav9cu83iUav9cu83i8Wav9cu83iyav9cu83iaav9cu83iKav9cu83izav9cu83iwav9cu83ibaialfc9WfhqaicefgwarfhldnaeTmbcmcsaDceSEhkcbhxcbhmcbhrcbhicbhoindnalaq9nmbc9:hoxikdndnawRbbgDc;Ve0mbavc;abfaoaDcu7gPcl4fcsGcitfgsydlhzasydbhHdndnaDcsGgsak9pmbavaiaPfcsGcdtfydbaxasEhDaxasTgOfhxxekdndnascsSmbcehOasc987asamffcefhDxekalcefhDal8SbbgscFeGhPdndnascu9mmbaDhlxekalcvfhlaPcFbGhPcrhsdninaD8SbbgOcFbGastaPVhPaOcu9kmeaDcefhDascrfgsc8J9hmbxdkkaDcefhlkcehOaPce4cbaPceG9R7amfhDkaDhmkavc;abfaocitfgsaDBdbasazBdlavaicdtfaDBdbavc;abfaocefcsGcitfgsaHBdbasaDBdlaocdfhoaOaifhidnadcd9hmbabarcetfgsaH87ebasclfaD87ebascdfaz87ebxdkabarcdtfgsaHBdbascwfaDBdbasclfazBdbxekdnaDcpe0mbavaiaqaDcsGfRbbgscl4gP9RcsGcdtfydbaxcefgOaPEhDavaias9RcsGcdtfydbaOaPTgzfgOascsGgPEhsaPThPdndnadcd9hmbabarcetfgHax87ebaHclfas87ebaHcdfaD87ebxekabarcdtfgHaxBdbaHcwfasBdbaHclfaDBdbkavaicdtfaxBdbavc;abfaocitfgHaDBdbaHaxBdlavaicefgicsGcdtfaDBdbavc;abfaocefcsGcitfgHasBdbaHaDBdlavaiazfgicsGcdtfasBdbavc;abfaocdfcsGcitfgDaxBdbaDasBdlaocifhoaiaPfhiaOaPfhxxekaxcbalRbbgsEgHaDc;:eSgDfhOascsGhAdndnascl4gCmbaOcefhzxekaOhzavaiaC9RcsGcdtfydbhOkdndnaAmbazcefhxxekazhxavaias9RcsGcdtfydbhzkdndnaDTmbalcefhDxekalcdfhDal8SbegPcFeGhsdnaPcu9kmbalcofhHascFbGhscrhldninaD8SbbgPcFbGaltasVhsaPcu9kmeaDcefhDalcrfglc8J9hmbkaHhDxekaDcefhDkasce4cbasceG9R7amfgmhHkdndnaCcsSmbaDhsxekaDcefhsaD8SbbglcFeGhPdnalcu9kmbaDcvfhOaPcFbGhPcrhldninas8SbbgDcFbGaltaPVhPaDcu9kmeascefhsalcrfglc8J9hmbkaOhsxekascefhskaPce4cbaPceG9R7amfgmhOkdndnaAcsSmbashlxekascefhlas8SbbgDcFeGhPdnaDcu9kmbascvfhzaPcFbGhPcrhDdninal8SbbgscFbGaDtaPVhPascu9kmealcefhlaDcrfgDc8J9hmbkazhlxekalcefhlkaPce4cbaPceG9R7amfgmhzkdndnadcd9hmbabarcetfgDaH87ebaDclfaz87ebaDcdfaO87ebxekabarcdtfgDaHBdbaDcwfazBdbaDclfaOBdbkavc;abfaocitfgDaOBdbaDaHBdlavaicdtfaHBdbavc;abfaocefcsGcitfgDazBdbaDaOBdlavaicefgicsGcdtfaOBdbavc;abfaocdfcsGcitfgDaHBdbaDazBdlavaiaCTaCcsSVfgicsGcdtfazBdbaiaATaAcsSVfhiaocifhokawcefhwaocsGhoaicsGhiarcifgrae6mbkkcbc99alaqSEhokavc;aef8Kjjjjbaok:clevu8Jjjjjbcz9Rhvdnalaecvf9pmbc9:skdnaiRbbc;:eGc;qeSmbcuskav9cb83iwaicefhoaialfc98fhrdnaeTmbdnadcdSmbcbhwindnaoar6mbc9:skaocefhlao8SbbgicFeGhddndnaicu9mmbalhoxekaocvfhoadcFbGhdcrhidninal8SbbgDcFbGaitadVhdaDcu9kmealcefhlaicrfgic8J9hmbxdkkalcefhokabawcdtfadc8Etc8F91adcd47avcwfadceGcdtVglydbfgiBdbalaiBdbawcefgwae9hmbxdkkcbhwindnaoar6mbc9:skaocefhlao8SbbgicFeGhddndnaicu9mmbalhoxekaocvfhoadcFbGhdcrhidninal8SbbgDcFbGaitadVhdaDcu9kmealcefhlaicrfgic8J9hmbxdkkalcefhokabawcetfadc8Etc8F91adcd47avcwfadceGcdtVglydbfgi87ebalaiBdbawcefgwae9hmbkkcbc99aoarSEk:Lvoeue99dud99eud99dndnadcl9hmbaeTmeindndnabcdfgd8Sbb:Yab8Sbbgi:Ygl:l:tabcefgv8Sbbgo:Ygr:l:tgwJbb;:9cawawNJbbbbawawJbbbb9GgDEgq:mgkaqaicb9iEalMgwawNakaqaocb9iEarMgqaqNMM:r:vglNJbbbZJbbb:;aDEMgr:lJbbb9p9DTmbar:Ohixekcjjjj94hikadai86bbdndnaqalNJbbbZJbbb:;aqJbbbb9GEMgq:lJbbb9p9DTmbaq:Ohdxekcjjjj94hdkavad86bbdndnawalNJbbbZJbbb:;awJbbbb9GEMgw:lJbbb9p9DTmbaw:Ohdxekcjjjj94hdkabad86bbabclfhbaecufgembxdkkaeTmbindndnabclfgd8Ueb:Yab8Uebgi:Ygl:l:tabcdfgv8Uebgo:Ygr:l:tgwJb;:FSawawNJbbbbawawJbbbb9GgDEgq:mgkaqaicb9iEalMgwawNakaqaocb9iEarMgqaqNMM:r:vglNJbbbZJbbb:;aDEMgr:lJbbb9p9DTmbar:Ohixekcjjjj94hikadai87ebdndnaqalNJbbbZJbbb:;aqJbbbb9GEMgq:lJbbb9p9DTmbaq:Ohdxekcjjjj94hdkavad87ebdndnawalNJbbbZJbbb:;awJbbbb9GEMgw:lJbbb9p9DTmbaw:Ohdxekcjjjj94hdkabad87ebabcwfhbaecufgembkkk:4ioiue99dud99dud99dnaeTmbcbhiabhlindndnal8Uebgv:YgoJ:ji:1Salcof8UebgrciVgw:Y:vgDNJbbbZJbbb:;avcu9kEMgq:lJbbb9p9DTmbaq:Ohkxekcjjjj94hkkalclf8Uebhvalcdf8UebhxalarcefciGcetfak87ebdndnax:YgqaDNJbbbZJbbb:;axcu9kEMgm:lJbbb9p9DTmbam:Ohxxekcjjjj94hxkabaiarciGgkfcd7cetfax87ebdndnav:YgmaDNJbbbZJbbb:;avcu9kEMgP:lJbbb9p9DTmbaP:Ohvxekcjjjj94hvkalarcufciGcetfav87ebdndnawaw2:ZgPaPMaoaoN:taqaqN:tamamN:tgoJbbbbaoJbbbb9GE:raDNJbbbZMgD:lJbbb9p9DTmbaD:Ohrxekcjjjj94hrkalakcetfar87ebalcwfhlaiclfhiaecufgembkkk9mbdnadcd4ae2gdTmbinababydbgecwtcw91:Yaece91cjjj98Gcjjj;8if::NUdbabclfhbadcufgdmbkkk:Tvirud99eudndnadcl9hmbaeTmeindndnabRbbgiabcefgl8Sbbgvabcdfgo8Sbbgrf9R:YJbbuJabcifgwRbbgdce4adVgDcd4aDVgDcl4aDVgD:Z:vgqNJbbbZMgk:lJbbb9p9DTmbak:Ohxxekcjjjj94hxkaoax86bbdndnaraif:YaqNJbbbZMgk:lJbbb9p9DTmbak:Ohoxekcjjjj94hokalao86bbdndnavaifar9R:YaqNJbbbZMgk:lJbbb9p9DTmbak:Ohixekcjjjj94hikabai86bbdndnaDadcetGadceGV:ZaqNJbbbZMgq:lJbbb9p9DTmbaq:Ohdxekcjjjj94hdkawad86bbabclfhbaecufgembxdkkaeTmbindndnab8Vebgiabcdfgl8Uebgvabclfgo8Uebgrf9R:YJbFu9habcofgw8Vebgdce4adVgDcd4aDVgDcl4aDVgDcw4aDVgD:Z:vgqNJbbbZMgk:lJbbb9p9DTmbak:Ohxxekcjjjj94hxkaoax87ebdndnaraif:YaqNJbbbZMgk:lJbbb9p9DTmbak:Ohoxekcjjjj94hokalao87ebdndnavaifar9R:YaqNJbbbZMgk:lJbbb9p9DTmbak:Ohixekcjjjj94hikabai87ebdndnaDadcetGadceGV:ZaqNJbbbZMgq:lJbbb9p9DTmbaq:Ohdxekcjjjj94hdkawad87ebabcwfhbaecufgembkkk9teiucbcbyd:K:G:cjbgeabcifc98GfgbBd:K:G:cjbdndnabZbcztgd9nmbcuhiabad9RcFFifcz4nbcuSmekaehikaik;LeeeudndnaeabVciGTmbabhixekdndnadcz9pmbabhixekabhiinaiaeydbBdbaiclfaeclfydbBdbaicwfaecwfydbBdbaicxfaecxfydbBdbaeczfheaiczfhiadc9Wfgdcs0mbkkadcl6mbinaiaeydbBdbaeclfheaiclfhiadc98fgdci0mbkkdnadTmbinaiaeRbb86bbaicefhiaecefheadcufgdmbkkabk;aeedudndnabciGTmbabhixekaecFeGc:b:c:ew2hldndnadcz9pmbabhixekabhiinaialBdbaicxfalBdbaicwfalBdbaiclfalBdbaiczfhiadc9Wfgdcs0mbkkadcl6mbinaialBdbaiclfhiadc98fgdci0mbkkdnadTmbinaiae86bbaicefhiadcufgdmbkkabkk83dbcj:Gdk8Kbbbbdbbblbbbwbbbbbbbebbbdbbblbbbwbbbbc:K:Gdkl8W:qbb",t="b9H79TebbbeKl9Gbb9Gvuuuuueu9Giuuub9Geueuixkbbebeeddddilve9Weeeviebeoweuecj:Gdkr;Neqo9TW9T9VV95dbH9F9F939H79T9F9J9H229F9Jt9VV7bb8A9TW79O9V9Wt9F9KW9J9V9KW9wWVtW949c919M9MWVbdY9TW79O9V9Wt9F9KW9J9V9KW69U9KW949c919M9MWVblE9TW79O9V9Wt9F9KW9J9V9KW69U9KW949tWG91W9U9JWbvL9TW79O9V9Wt9F9KW9J9V9KWS9P2tWV9p9JtboK9TW79O9V9Wt9F9KW9J9V9KWS9P2tWV9r919HtbrL9TW79O9V9Wt9F9KW9J9V9KWS9P2tWVT949WbwY9TW79O9V9Wt9F9KW9J9V9KWS9P2tWVJ9V29VVbDl79IV9Rbqq:59Dklbzik94evu8Jjjjjbcz9Rhbcbheincbhdcbhiinabcwfadfaicjuaead4ceGglE86bbaialfhiadcefgdcw9hmbkaeai86b:q:W:cjbaecitab8Piw83i:q:G:cjbaecefgecjd9hmbkk:SBlEud97dur978Jjjjjbcj;kb9Rgv8Kjjjjbc9:hodnalTmbcuhoaiRbbgrc;WeGc:Ge9hmbarcsGgwce0mbc9:hoalcufadcd4cbawEgDadfgrcKcaawEgqaraq0Egk6mbaialfgxar9RhodnadTgmmbavaoad;8qbbkaicefhPcj;abad9Uc;WFbGcjdadca0EhsdndndnadTmbaoadfhzcbhHinaeaH9nmdaxaP9RaD6miabaHad2fgOavcjdfasaeaH9RaHasfae6EgAaAcsfgoc9WGgCSEhXaPaDfhQaocl4cifcd4hLavcj;cbfaCcetfhKavcj;cbfaCci2fhYavcj;cbfaCfh8AcbhEaoc;ab6h3incbh5dnawTmbaPaEcd4fRbbh5kcbh8Eavcj;cbfh8Findndndndna5a8Ecet4ciGgoc9:fPdebdkaxaQ9RaC6mwdnaCTmbavcj;cbfa8EaC2faQaC;8qbbkaQaAfhQxdkaCTmeavcj;cbfa8EaC2fcbaC;8kbxekaxaQ9RaL6moaoclVcbawEhraQaLfhocbhidna3mbaxao9Rc;Gb6mbcbhlina8FalfhidndndndndndnaQalco4fRbbgqciGarfPDbedibledibkaipxbbbbbbbbbbbbbbbbpklbxlkaiaopbblaopbbbgaclp:meaapmbzeHdOiAlCvXoQrLgacdp:meaapmbzeHdOiAlCvXoQrLpxiiiiiiiiiiiiiiiip9oghpxiiiiiiiiiiiiiiiip8Jgap5b9cjF;8;4;W;G;ab9:9cU1:Nggcitpbi:q:G:cjbagRb:q:W:cjbggpsaap5e9cjF;8;4;W;G;ab9:9cU1:Ng8Jcitpbi:q:G:cjbp9UpmbedilvorzHOACXQLpPahaap9spklbagaoclffa8JRb:q:W:cjbfhoxikaiaopbbwaopbbbgaclp:meaapmbzeHdOiAlCvXoQrLpxssssssssssssssssp9oghpxssssssssssssssssp8Jgap5b9cjF;8;4;W;G;ab9:9cU1:Nggcitpbi:q:G:cjbagRb:q:W:cjbggpsaap5e9cjF;8;4;W;G;ab9:9cU1:Ng8Jcitpbi:q:G:cjbp9UpmbedilvorzHOACXQLpPahaap9spklbagaocwffa8JRb:q:W:cjbfhoxdkaiaopbbbpklbaoczfhoxekaiaopbbdaoRbbggcitpbi:q:G:cjbagRb:q:W:cjbggpsaoRbeg8Jcitpbi:q:G:cjbp9UpmbedilvorzHOACXQLpPpklbagaocdffa8JRb:q:W:cjbfhokdndndndndndnaqcd4ciGarfPDbedibledibkaiczfpxbbbbbbbbbbbbbbbbpklbxlkaiczfaopbblaopbbbgaclp:meaapmbzeHdOiAlCvXoQrLgacdp:meaapmbzeHdOiAlCvXoQrLpxiiiiiiiiiiiiiiiip9oghpxiiiiiiiiiiiiiiiip8Jgap5b9cjF;8;4;W;G;ab9:9cU1:Nggcitpbi:q:G:cjbagRb:q:W:cjbggpsaap5e9cjF;8;4;W;G;ab9:9cU1:Ng8Jcitpbi:q:G:cjbp9UpmbedilvorzHOACXQLpPahaap9spklbagaoclffa8JRb:q:W:cjbfhoxikaiczfaopbbwaopbbbgaclp:meaapmbzeHdOiAlCvXoQrLpxssssssssssssssssp9oghpxssssssssssssssssp8Jgap5b9cjF;8;4;W;G;ab9:9cU1:Nggcitpbi:q:G:cjbagRb:q:W:cjbggpsaap5e9cjF;8;4;W;G;ab9:9cU1:Ng8Jcitpbi:q:G:cjbp9UpmbedilvorzHOACXQLpPahaap9spklbagaocwffa8JRb:q:W:cjbfhoxdkaiczfaopbbbpklbaoczfhoxekaiczfaopbbdaoRbbggcitpbi:q:G:cjbagRb:q:W:cjbggpsaoRbeg8Jcitpbi:q:G:cjbp9UpmbedilvorzHOACXQLpPpklbagaocdffa8JRb:q:W:cjbfhokdndndndndndnaqcl4ciGarfPDbedibledibkaicafpxbbbbbbbbbbbbbbbbpklbxlkaicafaopbblaopbbbgaclp:meaapmbzeHdOiAlCvXoQrLgacdp:meaapmbzeHdOiAlCvXoQrLpxiiiiiiiiiiiiiiiip9oghpxiiiiiiiiiiiiiiiip8Jgap5b9cjF;8;4;W;G;ab9:9cU1:Nggcitpbi:q:G:cjbagRb:q:W:cjbggpsaap5e9cjF;8;4;W;G;ab9:9cU1:Ng8Jcitpbi:q:G:cjbp9UpmbedilvorzHOACXQLpPahaap9spklbagaoclffa8JRb:q:W:cjbfhoxikaicafaopbbwaopbbbgaclp:meaapmbzeHdOiAlCvXoQrLpxssssssssssssssssp9oghpxssssssssssssssssp8Jgap5b9cjF;8;4;W;G;ab9:9cU1:Nggcitpbi:q:G:cjbagRb:q:W:cjbggpsaap5e9cjF;8;4;W;G;ab9:9cU1:Ng8Jcitpbi:q:G:cjbp9UpmbedilvorzHOACXQLpPahaap9spklbagaocwffa8JRb:q:W:cjbfhoxdkaicafaopbbbpklbaoczfhoxekaicafaopbbdaoRbbggcitpbi:q:G:cjbagRb:q:W:cjbggpsaoRbeg8Jcitpbi:q:G:cjbp9UpmbedilvorzHOACXQLpPpklbagaocdffa8JRb:q:W:cjbfhokdndndndndndnaqco4arfPDbedibledibkaic8Wfpxbbbbbbbbbbbbbbbbpklbxlkaic8Wfaopbblaopbbbgaclp:meaapmbzeHdOiAlCvXoQrLgacdp:meaapmbzeHdOiAlCvXoQrLpxiiiiiiiiiiiiiiiip9oghpxiiiiiiiiiiiiiiiip8Jgap5b9cjF;8;4;W;G;ab9:9cU1:Ngicitpbi:q:G:cjbaiRb:q:W:cjbgipsaap5e9cjF;8;4;W;G;ab9:9cU1:Ngqcitpbi:q:G:cjbp9UpmbedilvorzHOACXQLpPahaap9spklbaiaoclffaqRb:q:W:cjbfhoxikaic8Wfaopbbwaopbbbgaclp:meaapmbzeHdOiAlCvXoQrLpxssssssssssssssssp9oghpxssssssssssssssssp8Jgap5b9cjF;8;4;W;G;ab9:9cU1:Ngicitpbi:q:G:cjbaiRb:q:W:cjbgipsaap5e9cjF;8;4;W;G;ab9:9cU1:Ngqcitpbi:q:G:cjbp9UpmbedilvorzHOACXQLpPahaap9spklbaiaocwffaqRb:q:W:cjbfhoxdkaic8Wfaopbbbpklbaoczfhoxekaic8WfaopbbdaoRbbgicitpbi:q:G:cjbaiRb:q:W:cjbgipsaoRbegqcitpbi:q:G:cjbp9UpmbedilvorzHOACXQLpPpklbaiaocdffaqRb:q:W:cjbfhokalc;abfhialcjefaC0meaihlaxao9Rc;Fb0mbkkdnaiaC9pmbaici4hlinaxao9RcK6mwa8FaifhqdndndndndndnaQaico4fRbbalcoG4ciGarfPDbedibledibkaqpxbbbbbbbbbbbbbbbbpkbbxlkaqaopbblaopbbbgaclp:meaapmbzeHdOiAlCvXoQrLgacdp:meaapmbzeHdOiAlCvXoQrLpxiiiiiiiiiiiiiiiip9oghpxiiiiiiiiiiiiiiiip8Jgap5b9cjF;8;4;W;G;ab9:9cU1:Nggcitpbi:q:G:cjbagRb:q:W:cjbggpsaap5e9cjF;8;4;W;G;ab9:9cU1:Ng8Jcitpbi:q:G:cjbp9UpmbedilvorzHOACXQLpPahaap9spkbbagaoclffa8JRb:q:W:cjbfhoxikaqaopbbwaopbbbgaclp:meaapmbzeHdOiAlCvXoQrLpxssssssssssssssssp9oghpxssssssssssssssssp8Jgap5b9cjF;8;4;W;G;ab9:9cU1:Nggcitpbi:q:G:cjbagRb:q:W:cjbggpsaap5e9cjF;8;4;W;G;ab9:9cU1:Ng8Jcitpbi:q:G:cjbp9UpmbedilvorzHOACXQLpPahaap9spkbbagaocwffa8JRb:q:W:cjbfhoxdkaqaopbbbpkbbaoczfhoxekaqaopbbdaoRbbggcitpbi:q:G:cjbagRb:q:W:cjbggpsaoRbeg8Jcitpbi:q:G:cjbp9UpmbedilvorzHOACXQLpPpkbbagaocdffa8JRb:q:W:cjbfhokalcdfhlaiczfgiaC6mbkkaohQaoTmoka8FaCfh8Fa8Ecefg8Ecl9hmbkdndndndnawTmbazaEcd4fRbbglciGPlbedwbkaCTmdaXaEfhlavaEfpbdbh8Kcbhoinalavcj;cbfaofpblbg8La8Aaofpblbg8MpmbzeHdOiAlCvXoQrLg8NaKaofpblbgyaYaofpblbg8PpmbzeHdOiAlCvXoQrLgIpmbezHdiOAlvCXorQLgacep9Taapxeeeeeeeeeeeeeeeeghp9op9Hp9rgaa8Kp9Ug8Kp9Abbbaladfgla8Kaaaapmlvorlvorlvorlvorp9Ug8Kp9Abbbaladfgla8KaaaapmwDqkwDqkwDqkwDqkp9Ug8Kp9Abbbaladfgla8KaaaapmxmPsxmPsxmPsxmPsp9Ug8Kp9Abbbaladfgla8Ka8NaIpmwDKYqk8AExm35Ps8E8Fgacep9Taaahp9op9Hp9rgap9Ug8Kp9Abbbaladfgla8Kaaaapmlvorlvorlvorlvorp9Ug8Kp9Abbbaladfgla8KaaaapmwDqkwDqkwDqkwDqkp9Ug8Kp9Abbbaladfgla8KaaaapmxmPsxmPsxmPsxmPsp9Ug8Kp9Abbbaladfgla8Ka8La8MpmwKDYq8AkEx3m5P8Es8Fg8Laya8PpmwKDYq8AkEx3m5P8Es8Fg8MpmbezHdiOAlvCXorQLgacep9Taaahp9op9Hp9rgap9Ug8Kp9Abbbaladfgla8Kaaaapmlvorlvorlvorlvorp9Ug8Kp9Abbbaladfgla8KaaaapmwDqkwDqkwDqkwDqkp9Ug8Kp9Abbbaladfgla8KaaaapmxmPsxmPsxmPsxmPsp9Ug8Kp9Abbbaladfgla8Ka8La8MpmwDKYqk8AExm35Ps8E8Fgacep9Taaahp9op9Hp9rgap9Ughp9Abbbaladfglahaaaapmlvorlvorlvorlvorp9Ughp9AbbbaladfglahaaaapmwDqkwDqkwDqkwDqkp9Ughp9AbbbaladfglahaaaapmxmPsxmPsxmPsxmPsp9Ug8Kp9AbbbaladfhlaoczfgoaC6mbxikkaCTmeaXaEfhlavaEfpbdbh8Kcbhoinalavcj;cbfaofpblbg8La8Aaofpblbg8MpmbzeHdOiAlCvXoQrLg8NaKaofpblbgyaYaofpblbg8PpmbzeHdOiAlCvXoQrLgIpmbezHdiOAlvCXorQLgacep:neaapxebebebebebebebebghp9op:bep9rgaa8Kp:oeg8Kp9Abbbaladfgla8Kaaaapmlvorlvorlvorlvorp:oeg8Kp9Abbbaladfgla8KaaaapmwDqkwDqkwDqkwDqkp:oeg8Kp9Abbbaladfgla8KaaaapmxmPsxmPsxmPsxmPsp:oeg8Kp9Abbbaladfgla8Ka8NaIpmwDKYqk8AExm35Ps8E8Fgacep:neaaahp9op:bep9rgap:oeg8Kp9Abbbaladfgla8Kaaaapmlvorlvorlvorlvorp:oeg8Kp9Abbbaladfgla8KaaaapmwDqkwDqkwDqkwDqkp:oeg8Kp9Abbbaladfgla8KaaaapmxmPsxmPsxmPsxmPsp:oeg8Kp9Abbbaladfgla8Ka8La8MpmwKDYq8AkEx3m5P8Es8Fg8Laya8PpmwKDYq8AkEx3m5P8Es8Fg8MpmbezHdiOAlvCXorQLgacep:neaaahp9op:bep9rgap:oeg8Kp9Abbbaladfgla8Kaaaapmlvorlvorlvorlvorp:oeg8Kp9Abbbaladfgla8KaaaapmwDqkwDqkwDqkwDqkp:oeg8Kp9Abbbaladfgla8KaaaapmxmPsxmPsxmPsxmPsp:oeg8Kp9Abbbaladfgla8Ka8La8MpmwDKYqk8AExm35Ps8E8Fgacep:neaaahp9op:bep9rgap:oeghp9Abbbaladfglahaaaapmlvorlvorlvorlvorp:oeghp9AbbbaladfglahaaaapmwDqkwDqkwDqkwDqkp:oeghp9AbbbaladfglahaaaapmxmPsxmPsxmPsxmPsp:oeg8Kp9AbbbaladfhlaoczfgoaC6mbxdkkaCTmbaXaEfhrcbhocbalcl4gl9Rc8FGhiavaEfpbdbhhinaravcj;cbfaofpblbg8Ka8Aaofpblbg8LpmbzeHdOiAlCvXoQrLg8MaKaofpblbg8NaYaofpblbgypmbzeHdOiAlCvXoQrLg8PpmbezHdiOAlvCXorQLgaaip:Reaaalp:Tep9qgaahp9rghp9Abbbaradfgrahaaaapmlvorlvorlvorlvorp9rghp9AbbbaradfgrahaaaapmwDqkwDqkwDqkwDqkp9rghp9AbbbaradfgrahaaaapmxmPsxmPsxmPsxmPsp9rghp9Abbbaradfgraha8Ma8PpmwDKYqk8AExm35Ps8E8Fgaaip:Reaaalp:Tep9qgap9rghp9Abbbaradfgrahaaaapmlvorlvorlvorlvorp9rghp9AbbbaradfgrahaaaapmwDqkwDqkwDqkwDqkp9rghp9AbbbaradfgrahaaaapmxmPsxmPsxmPsxmPsp9rghp9Abbbaradfgraha8Ka8LpmwKDYq8AkEx3m5P8Es8Fg8Ka8NaypmwKDYq8AkEx3m5P8Es8Fg8LpmbezHdiOAlvCXorQLgaaip:Reaaalp:Tep9qgap9rghp9Abbbaradfgrahaaaapmlvorlvorlvorlvorp9rghp9AbbbaradfgrahaaaapmwDqkwDqkwDqkwDqkp9rghp9AbbbaradfgrahaaaapmxmPsxmPsxmPsxmPsp9rghp9Abbbaradfgraha8Ka8LpmwDKYqk8AExm35Ps8E8Fgaaip:Reaaalp:Tep9qgap9rghp9Abbbaradfgrahaaaapmlvorlvorlvorlvorp9rghp9AbbbaradfgrahaaaapmwDqkwDqkwDqkwDqkp9rghp9AbbbaradfgrahaaaapmxmPsxmPsxmPsxmPsp9rghp9AbbbaradfhraoczfgoaC6mbkkaEclfgEad6mbkdnaXavcjdf9hmbaAad2goTmbaOavcjdfao;8qbbkdnammbavaXaAcufad2fad;8qbbkaAaHfhHc9:hoaQhPaQmbxlkkaeTmbaDalfhrcbhocuhlinaralaD9RglfaD6mdasaeao9Raoasfae6Eaofgoae6mbkaial9RhPkcbc99axaP9RakSEhoxekc9:hokavcj;kbf8Kjjjjbaokwbz:bjjjbkNsezu8Jjjjjbc;ae9Rgv8Kjjjjbc9:hodnalaeci9UgrcHf6mbcuhoaiRbbgwc;WeGc;Ge9hmbawcsGgDce0mbavc;abfcFecje;8kbav9cu83iUav9cu83i8Wav9cu83iyav9cu83iaav9cu83iKav9cu83izav9cu83iwav9cu83ibaialfc9WfhqaicefgwarfhldnaeTmbcmcsaDceSEhkcbhxcbhmcbhrcbhicbhoindnalaq9nmbc9:hoxikdndnawRbbgDc;Ve0mbavc;abfaoaDcu7gPcl4fcsGcitfgsydlhzasydbhHdndnaDcsGgsak9pmbavaiaPfcsGcdtfydbaxasEhDaxasTgOfhxxekdndnascsSmbcehOasc987asamffcefhDxekalcefhDal8SbbgscFeGhPdndnascu9mmbaDhlxekalcvfhlaPcFbGhPcrhsdninaD8SbbgOcFbGastaPVhPaOcu9kmeaDcefhDascrfgsc8J9hmbxdkkaDcefhlkcehOaPce4cbaPceG9R7amfhDkaDhmkavc;abfaocitfgsaDBdbasazBdlavaicdtfaDBdbavc;abfaocefcsGcitfgsaHBdbasaDBdlaocdfhoaOaifhidnadcd9hmbabarcetfgsaH87ebasclfaD87ebascdfaz87ebxdkabarcdtfgsaHBdbascwfaDBdbasclfazBdbxekdnaDcpe0mbavaiaqaDcsGfRbbgscl4gP9RcsGcdtfydbaxcefgOaPEhDavaias9RcsGcdtfydbaOaPTgzfgOascsGgPEhsaPThPdndnadcd9hmbabarcetfgHax87ebaHclfas87ebaHcdfaD87ebxekabarcdtfgHaxBdbaHcwfasBdbaHclfaDBdbkavaicdtfaxBdbavc;abfaocitfgHaDBdbaHaxBdlavaicefgicsGcdtfaDBdbavc;abfaocefcsGcitfgHasBdbaHaDBdlavaiazfgicsGcdtfasBdbavc;abfaocdfcsGcitfgDaxBdbaDasBdlaocifhoaiaPfhiaOaPfhxxekaxcbalRbbgsEgHaDc;:eSgDfhOascsGhAdndnascl4gCmbaOcefhzxekaOhzavaiaC9RcsGcdtfydbhOkdndnaAmbazcefhxxekazhxavaias9RcsGcdtfydbhzkdndnaDTmbalcefhDxekalcdfhDal8SbegPcFeGhsdnaPcu9kmbalcofhHascFbGhscrhldninaD8SbbgPcFbGaltasVhsaPcu9kmeaDcefhDalcrfglc8J9hmbkaHhDxekaDcefhDkasce4cbasceG9R7amfgmhHkdndnaCcsSmbaDhsxekaDcefhsaD8SbbglcFeGhPdnalcu9kmbaDcvfhOaPcFbGhPcrhldninas8SbbgDcFbGaltaPVhPaDcu9kmeascefhsalcrfglc8J9hmbkaOhsxekascefhskaPce4cbaPceG9R7amfgmhOkdndnaAcsSmbashlxekascefhlas8SbbgDcFeGhPdnaDcu9kmbascvfhzaPcFbGhPcrhDdninal8SbbgscFbGaDtaPVhPascu9kmealcefhlaDcrfgDc8J9hmbkazhlxekalcefhlkaPce4cbaPceG9R7amfgmhzkdndnadcd9hmbabarcetfgDaH87ebaDclfaz87ebaDcdfaO87ebxekabarcdtfgDaHBdbaDcwfazBdbaDclfaOBdbkavc;abfaocitfgDaOBdbaDaHBdlavaicdtfaHBdbavc;abfaocefcsGcitfgDazBdbaDaOBdlavaicefgicsGcdtfaOBdbavc;abfaocdfcsGcitfgDaHBdbaDazBdlavaiaCTaCcsSVfgicsGcdtfazBdbaiaATaAcsSVfhiaocifhokawcefhwaocsGhoaicsGhiarcifgrae6mbkkcbc99alaqSEhokavc;aef8Kjjjjbaok:clevu8Jjjjjbcz9Rhvdnalaecvf9pmbc9:skdnaiRbbc;:eGc;qeSmbcuskav9cb83iwaicefhoaialfc98fhrdnaeTmbdnadcdSmbcbhwindnaoar6mbc9:skaocefhlao8SbbgicFeGhddndnaicu9mmbalhoxekaocvfhoadcFbGhdcrhidninal8SbbgDcFbGaitadVhdaDcu9kmealcefhlaicrfgic8J9hmbxdkkalcefhokabawcdtfadc8Etc8F91adcd47avcwfadceGcdtVglydbfgiBdbalaiBdbawcefgwae9hmbxdkkcbhwindnaoar6mbc9:skaocefhlao8SbbgicFeGhddndnaicu9mmbalhoxekaocvfhoadcFbGhdcrhidninal8SbbgDcFbGaitadVhdaDcu9kmealcefhlaicrfgic8J9hmbxdkkalcefhokabawcetfadc8Etc8F91adcd47avcwfadceGcdtVglydbfgi87ebalaiBdbawcefgwae9hmbkkcbc99aoarSEk;Toio97eue97aec98Ghedndnadcl9hmbaeTmecbhdinababpbbbgicKp:RecKp:Sep;6eglaicwp:RecKp:Sep;6ealp;Geaiczp:RecKp:Sep;6egvp;Gep;Kep;Legopxbbbbbbbbbbbbbbbbp:2egralpxbbbjbbbjbbbjbbbjgwp9op9rp;Keglpxbb;:9cbb;:9cbb;:9cbb;:9calalp;Meaoaop;Meavaravawp9op9rp;Keglalp;Mep;Kep;Kep;Jep;Negvp;Mepxbbn0bbn0bbn0bbn0grp;KepxFbbbFbbbFbbbFbbbp9oaipxbbbFbbbFbbbFbbbFp9op9qalavp;Mearp;Kecwp:RepxbFbbbFbbbFbbbFbbp9op9qaoavp;Mearp;Keczp:RepxbbFbbbFbbbFbbbFbp9op9qpkbbabczfhbadclfgdae6mbxdkkaeTmbcbhdinabczfgDaDpbbbgipxbbbbbbFFbbbbbbFFgwp9oabpbbbgoaipmbediwDqkzHOAKY8AEgvczp:Reczp:Sep;6eglaoaipmlvorxmPsCXQL358E8FpxFubbFubbFubbFubbp9op;6eavczp:Sep;6egvp;Gealp;Gep;Kep;Legipxbbbbbbbbbbbbbbbbp:2egralpxbbbjbbbjbbbjbbbjgqp9op9rp;Keglpxb;:FSb;:FSb;:FSb;:FSalalp;Meaiaip;Meavaravaqp9op9rp;Keglalp;Mep;Kep;Kep;Jep;Negvp;Mepxbbn0bbn0bbn0bbn0grp;KepxFFbbFFbbFFbbFFbbp9oaiavp;Mearp;Keczp:Rep9qgialavp;Mearp;KepxFFbbFFbbFFbbFFbbp9oglpmwDKYqk8AExm35Ps8E8Fp9qpkbbabaoawp9oaialpmbezHdiOAlvCXorQLp9qpkbbabcafhbadclfgdae6mbkkk;2ileue97euo97dnaec98GgiTmbcbheinabcKfpx:ji:1S:ji:1S:ji:1S:ji:1SabpbbbglabczfgvpbbbgopmlvorxmPsCXQL358E8Fgrczp:Segwpxibbbibbbibbbibbbp9qp;6egDp;NegqaDaDp;MegDaDp;KealaopmbediwDqkzHOAKY8AEgDczp:Reczp:Sep;6eglalp;MeaDczp:Sep;6egoaop;Mearczp:Reczp:Sep;6egrarp;Mep;Kep;Kep;Lepxbbbbbbbbbbbbbbbbp:4ep;Jep;Mepxbbn0bbn0bbn0bbn0gDp;KepxFFbbFFbbFFbbFFbbgkp9oaqaop;MeaDp;Keczp:Rep9qgoaqalp;MeaDp;Keakp9oaqarp;MeaDp;Keczp:Rep9qgDpmwDKYqk8AExm35Ps8E8Fglp5eawclp:RegqpEi:T:j83ibavalp5baqpEd:T:j83ibabcwfaoaDpmbezHdiOAlvCXorQLgDp5eaqpEe:T:j83ibabaDp5baqpEb:T:j83ibabcafhbaeclfgeai6mbkkkuee97dnadcd4ae2c98GgeTmbcbhdinababpbbbgicwp:Recwp:Sep;6eaicep:SepxbbjFbbjFbbjFbbjFp9opxbbjZbbjZbbjZbbjZp:Uep;Mepkbbabczfhbadclfgdae6mbkkk:Sodw97euaec98Ghedndnadcl9hmbaeTmecbhdinabpxbbuJbbuJbbuJbbuJabpbbbgicKp:TeglaicYp:Tep9qgvcdp:Teavp9qgvclp:Teavp9qgop;6ep;Negvaicwp:RecKp:SegraipxFbbbFbbbFbbbFbbbgwp9ogDp:Uep;6ep;Mepxbbn0bbn0bbn0bbn0gqp;Kecwp:RepxbFbbbFbbbFbbbFbbp9oavaDarp:Xeaiczp:RecKp:Segip:Uep;6ep;Meaqp;Keawp9op9qavaDaraip:Uep:Xep;6ep;Meaqp;Keczp:RepxbbFbbbFbbbFbbbFbp9op9qavaoalcep:Rep9oalpxebbbebbbebbbebbbp9op9qp;6ep;Meaqp;KecKp:Rep9qpkbbabczfhbadclfgdae6mbxdkkaeTmbcbhdinabczfgkpxbFu9hbFu9hbFu9hbFu9habpbbbglakpbbbgrpmlvorxmPsCXQL358E8Fgvczp:TegqavcHp:Tep9qgicdp:Teaip9qgiclp:Teaip9qgicwp:Teaip9qgop;6ep;NegialarpmbediwDqkzHOAKY8AEgDpxFFbbFFbbFFbbFFbbglp9ograDczp:Segwp:Ueavczp:Reczp:SegDp:Xep;6ep;Mepxbbn0bbn0bbn0bbn0gvp;Kealp9oaiarawaDp:Uep:Xep;6ep;Meavp;Keczp:Rep9qgwaiaoaqcep:Rep9oaqpxebbbebbbebbbebbbp9op9qp;6ep;Meavp;Keczp:ReaiaDarp:Uep;6ep;Meavp;Kealp9op9qgipmwDKYqk8AExm35Ps8E8FpkbbabawaipmbezHdiOAlvCXorQLpkbbabcafhbadclfgdae6mbkkk9teiucbcbydj:G:cjbgeabcifc98GfgbBdj:G:cjbdndnabZbcztgd9nmbcuhiabad9RcFFifcz4nbcuSmekaehikaikkxebcj:Gdklz:zbb",n=new Uint8Array([0,97,115,109,1,0,0,0,1,4,1,96,0,0,3,3,2,0,0,5,3,1,0,1,12,1,0,10,22,2,12,0,65,0,65,0,65,0,252,10,0,0,11,7,0,65,0,253,15,26,11]),i=new Uint8Array([32,0,65,2,1,106,34,33,3,128,11,4,13,64,6,253,10,7,15,116,127,5,8,12,40,16,19,54,20,9,27,255,113,17,42,67,24,23,146,148,18,14,22,45,70,69,56,114,101,21,25,63,75,136,108,28,118,29,73,115]);if(typeof WebAssembly!="object")return{supported:!1};var r=WebAssembly.validate(n)?a(t):a(e),o,s=WebAssembly.instantiate(r,{}).then(function(b){o=b.instance,o.exports.__wasm_call_ctors()});function a(b){for(var x=new Uint8Array(b.length),T=0;T<b.length;++T){var E=b.charCodeAt(T);x[T]=E>96?E-97:E>64?E-39:E+4}for(var v=0,T=0;T<b.length;++T)x[v++]=x[T]<60?i[x[T]]:(x[T]-60)*64+x[++T];return x.buffer.slice(0,v)}function c(b,x,T,E,v,S,I){var R=b.exports.sbrk,O=E+3&-4,L=R(O*v),_=R(S.length),C=new Uint8Array(b.exports.memory.buffer);C.set(S,_);var w=x(L,E,v,_,S.length);if(w==0&&I&&I(L,O,v),T.set(C.subarray(L,L+E*v)),R(L-R(0)),w!=0)throw new Error("Malformed buffer data: "+w)}var u={NONE:"",OCTAHEDRAL:"meshopt_decodeFilterOct",QUATERNION:"meshopt_decodeFilterQuat",EXPONENTIAL:"meshopt_decodeFilterExp",COLOR:"meshopt_decodeFilterColor"},f={ATTRIBUTES:"meshopt_decodeVertexBuffer",TRIANGLES:"meshopt_decodeIndexBuffer",INDICES:"meshopt_decodeIndexSequence"},d=[],p=0;function g(b){var x={object:new Worker(b),pending:0,requests:{}};return x.object.onmessage=function(T){var E=T.data;x.pending-=E.count,x.requests[E.id][E.action](E.value),delete x.requests[E.id]},x}function m(b){for(var x="self.ready = WebAssembly.instantiate(new Uint8Array(["+new Uint8Array(r)+"]), {}).then(function(result) { result.instance.exports.__wasm_call_ctors(); return result.instance; });self.onmessage = "+A.name+";"+c.toString()+A.toString(),T=new Blob([x],{type:"text/javascript"}),E=URL.createObjectURL(T),v=d.length;v<b;++v)d[v]=g(E);for(var v=b;v<d.length;++v)d[v].object.postMessage({});d.length=b,URL.revokeObjectURL(E)}function y(b,x,T,E,v){for(var S=d[0],I=1;I<d.length;++I)d[I].pending<S.pending&&(S=d[I]);return new Promise(function(R,O){var L=new Uint8Array(T),_=++p;S.pending+=b,S.requests[_]={resolve:R,reject:O},S.object.postMessage({id:_,count:b,size:x,source:L,mode:E,filter:v},[L.buffer])})}function A(b){var x=b.data;self.ready.then(function(T){if(!x.id)return self.close();try{var E=new Uint8Array(x.count*x.size);c(T,T.exports[x.mode],E,x.count,x.size,x.source,T.exports[x.filter]),self.postMessage({id:x.id,count:x.count,action:"resolve",value:E},[E.buffer])}catch(v){self.postMessage({id:x.id,count:x.count,action:"reject",value:v})}})}return{ready:s,supported:!0,useWorkers:function(b){m(b)},decodeVertexBuffer:function(b,x,T,E,v){c(o,o.exports.meshopt_decodeVertexBuffer,b,x,T,E,o.exports[u[v]])},decodeIndexBuffer:function(b,x,T,E){c(o,o.exports.meshopt_decodeIndexBuffer,b,x,T,E)},decodeIndexSequence:function(b,x,T,E){c(o,o.exports.meshopt_decodeIndexSequence,b,x,T,E)},decodeGltfBuffer:function(b,x,T,E,v,S){c(o,o.exports[f[v]],b,x,T,E,o.exports[u[S]])},decodeGltfBufferAsync:function(b,x,T,E,v){return d.length>0?y(b,x,T,f[E],u[v]):s.then(function(){var S=new Uint8Array(b*x);return c(o,o.exports[f[E]],S,b,x,T,o.exports[u[v]]),S})}}})();var UCn=(function(){var e="b9H79Tebbbe:6eO9Geueu9Geub9Gbb9Gsuuuuuuuuuuuu99uueu9Gvuuuuub9Gruuuuuuub9Gouuuuuue999Gvuuuuueu9Gzuuuuuuuuuuu99uuuub9Gquuuuuuu99uueu9GPuuuuuuuuuuu99uueu9Gquuuuuuuu99ueu9Gruuuuuu99eu9Gwuuuuuu99ueu9Giuuue999Gluuuueu9Gluuuub9GiuuueuiLQdilvorlwDiqkxmPszbHHbelve9Weiiviebeoweuecj:Gdkr:Bdxo9TW9T9VV95dbH9F9F939H79T9F9J9H229F9Jt9VV7bbz9TW79O9V9Wt9F79P9T9W29P9M95bw8E9TW79O9V9Wt9F79P9T9W29P9M959x9Pt9OcttV9P9I91tW7bD8A9TW79O9V9Wt9F79P9T9W29P9M959x9Pt9O9v9W9K9HtWbqQ9TW79O9V9Wt9F79P9T9W29P9M959t29V9W9W95bkX9TW79O9V9Wt9F79P9T9W29P9M959qV919UWbxQ9TW79O9V9Wt9F79P9T9W29P9M959q9V9P9Ut7bmX9TW79O9V9Wt9F79P9T9W29P9M959t9J9H2WbPa9TW79O9V9Wt9F9V9Wt9P9T9P96W9wWVtW94SWt9J9O9sW9T9H9Wbs59TW79O9V9Wt9F9NW9UWV9HtW9q9V79Pt9P9V9U9sW9T9H9Wbzl79IV9RbHDwebcekdCXq;y;WeQdbk;r:herYue99iuY99Xue9:D998Jjjjjbcj;sb9Rgs8Kjjjjbcbhzasc:Cefcbc;Kbz:tjjjb8AdnabaeSmbabaeadcdtzMjjjb8AkdnamcdGTmbalcrfci4cbyd1:H:cjbHjjjjbbhHasc:Cefasyd;8egecdtfaHBdbasaecefBd;8ecbhlcbhednadTmbabheadhOinaHaeydbci4fcb86bbaeclfheaOcufgOmbkcbhlabheadhOinaHaeydbgAci4fgCaCRbbgCceaAcrGgAtV86bbaCcu7aA4ceGalfhlaeclfheaOcufgOmbkcualcdtalcFFFFi0Ehekaecbyd1:H:cjbHjjjjbbhzasc:Cefasyd;8egecdtfazBdbasaecefBd;8ealcd4alfhOcehHinaHgecethHaeaO6mbkcbhXcuaecdtgOaecFFFFi0Ecbyd1:H:cjbHjjjjbbhHasc:Cefasyd;8egAcdtfaHBdbasaAcefBd;8eaHcFeaOz:tjjjbhQdnadTmbaecufhLcbhKindndnaQabaKcdtfgYydbgAc:v;t;h;Ev2aLGgOcdtfgCydbgHcuSmbceheinazaHcdtfydbaASmdaOaefhHaecefheaQaHaLGgOcdtfgCydbgHcu9hmbkkazaXcdtfaABdbaCaXBdbaXhHaXcefhXkaYaHBdbaKcefgKad9hmbkkaQcbyd:m:H:cjbH:bjjjbbasasyd;8ecufBd;8ekcbh8AcualcefgecdtaecFFFFi0Ecbyd1:H:cjbHjjjjbbhLasc:Cefasyd;8egecdtfaLBdbasaLBdNeasaecefBd;8ecuadcitadcFFFFe0Ecbyd1:H:cjbHjjjjbbhEasc:Cefasyd;8egecdtfaEBdbasaEBd:yeasaecefBd;8eascNefabadalcbz:cjjjbcualcdtgealcFFFFi0Eg3cbyd1:H:cjbHjjjjbbhOasc:Cefasyd;8egHcdtfaOBdbasaHcefBd;8ea3cbyd1:H:cjbHjjjjbbhQasc:Cefasyd;8egHcdtfaQBdbasaHcefBd;8eaOaQaialavazasc:Cefz:djjjbalcbyd1:H:cjbHjjjjbbhYasc:Cefasyd;8egHcdtfaYBdbasaHcefBd;8ea3cbyd1:H:cjbHjjjjbbhHasc:Cefasyd;8egAcdtfaHBdbasaAcefBd;8ea3cbyd1:H:cjbHjjjjbbhAasc:Cefasyd;8egCcdtfaABdbasaCcefBd;8eaHcFeaez:tjjjbh5aAcFeaez:tjjjbh8EdnalTmbindnaLa8AgAcefg8AcdtfydbgCaLaAcdtgefydbgHSmbaCaH9Rh8FaEaHcitfhaa8Eaefhha5aefhKcbhCindndnaaaCcitfydbgXaA9hmbaKaABdbahaABdbxekdnaLaXcdtggfgeclfydbgHaeydbgeSmbaHae9RhHaEaecitfheinaeydbaASmdaecwfheaHcufgHmbkka8EagfgeaAaXaeydbcuSEBdbaKaXaAaKydbcuSEBdbkaCcefgCa8F9hmbkka8Aal9hmbkaOhHaQhAa5hXa8EhCcbheindndnaeaHydbgK9hmbdnaeaAydbgK9hmbaXydbhKdnaCydbg8Fcu9hmbaKcu9hmbaYaefcb86bbxikdna8FcuSmbaKcuSmbaea8FSmbaOa8FcdtfydbaOaKcdtfydb9hmbaYaefcd86bbxikaYaefhadnaea8FSmbaeaKSmbaace86bbxikaacl86bbxdkdnaeaQaKcdtg8Ffydb9hmbdnaCydbgacuSmbaeaaSmbaXydbggcuSmbaeagSmba8Ea8FfydbghcuSmbahaKSmba5a8Ffydbg8FcuSmba8FaKSmbdnaOaacdtfydbgKaOa8Fcdtfydb9hmbaKaOagcdtfydbg8FSmba8FaOahcdtfydb9hmbaYaefcd86bbxlkaYaefcl86bbxikaYaefcl86bbxdkaYaefcl86bbxekaYaefaYaKfRbb86bbkaHclfhHaAclfhAaXclfhXaCclfhCalaecefge9hmbkdnamcaGTmbcbh8JindndnaYa8Jfg8KRbbg8Lc9:fPibebekdndndnaOa8Jcdtfydbgea8J9hmbdnaqmbcbh8FxdkdnazTmbcbh8Fa8JheinaqazaecdtgefydbfRbbce4a8FVceGh8FaQaefydbgea8J9hmbxikkcbh8Fa8JheinaqaefRbbce4a8FVceGh8FaQaecdtfydbgea8J9hmbxdkkaYaefRbbhexeka8JheindnaLaecdtg8AfgeclfydbgHaeydbgeSmbaHae9RhgaEaecitfhhaOa8AfhacbhKinahaKcitfydbgXhednindnaLaecdtgCfgeclfydbgHaeydbgeSmbaHae9RhHaEaecitfheaaydbhAdninaOaeydbcdtfydbaASmeaecwfheaHcufgHTmdxbkkcbhexdkaQaCfydbgeaX9hmbkceheka8FaeVh8FaKcefgKag9hmbkkaQa8Afydbgea8J9hmbka8Lcia8FceGEheka8Kae86bbka8Jcefg8Jal9hmbkkdnaqTmbdndnazTmbazheaOhHalhAindnaqaeydbfRbbceGTmbaYaHydbfcl86bbkaeclfheaHclfhHaAcufgAmbxdkkaqheaOhHalhAindnaeRbbceGTmbaYaHydbfcl86bbkaecefheaHclfhHaAcufgAmbkkaOhealhAaYhHindnaYaeydbfRbbcl9hmbaHcl86bbkaeclfheaHcefhHaAcufgAmbkkamceGTmbaYhealhHindnaeRbbce9hmbaecl86bbkaecefheaHcufgHmbkkcbh8Mcualcx2alc;v:Q;v:Qe0Ecbyd1:H:cjbHjjjjbbh8Nasc:Cefasyd;8egecdtfa8NBdbasaecefBd;8eascbBd:qeas9cb83i1ea8Naialavazasc1efz:ejjjbhydndnaDmbcbh8PcbhCxekcbhCawhecbhHindnaeIdbJbbbb9ETmbasaCcdtfaHBdbaCcefhCkaeclfheaDaHcefgH9hmbkcuaCal2gecdtaecFFFFi0Ecbyd1:H:cjbHjjjjbbh8Pasc:Cefasyd;8egecdtfa8PBdbasaecefBd;8ealTmbdnaCmbcbhCxekarcd4hgdnazTmbaCcdthhcbh8Fa8Phainaoaza8Fc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gKaAcwfIdbaKIdbMUdbaecxfgeaAcxfIdbaeIdbMUdbaHczfhHaXcufgXmbkaacifgaad6mbkkcbhAdndnamcwGgTmbJbbbbh8ScbhScbh9hcbh9ixekcbhSa3cbyd1:H:cjbHjjjjbbh9iasc:Cefasyd;8egecdtfa9iBdbasaecefBd;8ecua9ialabadaOz:fjjjbgXcltaXcjjjjiGEcbyd1:H:cjbHjjjjbbh9hasc:Cefasyd;8egecdtfa9hBdbasaecefBd;8ea9haXa9ia8Nalz:gjjjbJFFuuh8SaXTmba9hheaXhHinaeIdbgRa8Sa8SaR9EEh8SaeclfheaHcufgHmbkaXhSkdnalTmbaLclfheaLydbhXaYhHalhKcbhAincbaeydbg8FaX9RaHRbbcpeGEaAfhAaHcefhHaeclfhea8FhXaKcufgKmbkaAce4hAkcuadaA9Rcifg6cx2a6c;v:Q;v:Qe0Ecbyd1:H:cjbHjjjjbbh9kasc:Cefasyd;8egecdtfa9kBdbasaecefBd;8ecua6cdta6cFFFFi0Ecbyd1:H:cjbHjjjjbbh0asc:Cefasyd;8egecdtfa0BdbasaecefBd;8ea3cbyd1:H:cjbHjjjjbbh9masc:Cefasyd;8egecdtfa9mBdbasaecefBd;8ealcbyd1:H:cjbHjjjjbbh9nasc:Cefasyd;8egecdtfa9nBdbasaecefBd;8eaxaxNayJbbjZamclGEgZaZN:vh87JbbbbhUdnadak9nmbdna6ci6mbaCclth9oa9kcwfh9pJbbbbh85JbbbbhUinascNefabadalaOz:cjjjbabh8Acbh9qcbh9rinaba9rcdtfhDcbheindnaOa8AaefydbgAcdtghfydbgXaOaDaec:W:G:cjbfydbcdtfydbgHcdtg8JfydbgKSmbaYaHfRbbgacv2aYaAfRbbg8FfRb;a:G:cjbg8La8Fcv2aafg8KRb;a:G:cjbg3VcFeGTmbdnaKaX9nmba8KRb;G:G:cjbcFeGmekdna8FcufcFeGce0mbaaTmba5ahfydbaH9hmekdna8FTmbaacufcFeGce0mba8Ea8JfydbaA9hmeka9ka9qcx2fgX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aeclfIdbNMMMg8Wa8WM:tNa8VMh8VaHclfhHaeczfheaAcufgAmbka8V:lh8VkaBaR:lMhBa86a8VMh86dndndnaYaKfRbbc9:fPddbekaQaXfydbgXaKSmbaOa8Fcdtfydbh8Jindndna5aXcdtgafydbgecuSmbaOaecdtfydba8JSmekdna8EaafydbgecuSmbaOaecdtfydba8JSmeka8FhekagaXc8S2fgAIdwa8Naecx2fgHIdwg8WNaAIdzaHIdbg8XNaAIdaMgRaRMMa8WNaAIdlaHIdlg8YNaAIdCa8WNaAId3MgRaRMMa8YNaAIdba8XNaAIdxa8YNaAIdKMgRaRMMa8XNaAId8KMMMhRa8PaeaC2cdtfhHa8RaXaC2cltfheaAIdyh81aChAinaHIdbg8Va8Va81NaecxfIdba8WaecwfIdbNa8XaeIdbNa8YaeclfIdbNMMMg8Va8VM:tNaRMhRaHclfhHaeczfheaAcufgAmbkaBaR:lMhBaQaafydbgXaK9hmbkkaYa8FfRbbci9hmeaDTmeaQa8FcdtfydbgXa8FSmeindndna5aXcdtgafydbgecuSmbaOaecdtfydba8ASmekdna8EaafydbgecuSmbaOaecdtfydba8ASmekaKhekagaXc8S2fgAIdwa8Naecx2fgHIdwg8WNaAIdzaHIdbg8XNaAIdaMgRaRMMa8WNaAIdlaHIdlg8YNaAIdCa8WNaAId3MgRaRMMa8YNaAIdba8XNaAIdxa8YNaAIdKMgRaRMMa8XNaAId8KMMMhRa8PaeaC2cdtfhHa8RaXaC2cltfheaAIdyh81aChAinaHIdbg8Va8Va81NaecxfIdba8WaecwfIdbNa8XaeIdbNa8YaeclfIdbNMMMg8Va8VM:tNaRMhRaHclfhHaeczfheaAcufgAmbka86aR:lMh86aQaafydbgXa8F9hmbxdkkdna8Ea5a5aXfydba8FSEaQaXfydbgacdtfydbgXcu9hmbaQa8FcdtfydbhXkagaac8S2fgAIdwa8NaXcx2fgeIdwg8WNaAIdzaeIdbg8XNaAIdaMgRaRMMa8WNaAIdlaeIdlg8YNaAIdCa8WNaAId3MgRa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tg9vfg8AydbgAfg9wRbba3aOa8Jydbghcdtg9xfydbgefg9yRbbVmbaYahfRbbh9zdndnaLaecdtfgHclfydbgXaHydbgHSmbaXaH9RhXa8NaAcx2fh8Fa8Naecx2fhaaEaHcitfheindna9maeydbcdtfydbgHaASmba9maeclfydbcdtfydbgKaASmbaHaKSmba8NaKcx2fgKIdba8NaHcx2fgHIdbg8W:tgRaaIdlaHIdlg8X:tg80NaKIdla8X:tg8VaaIdba8W:tgBN:tg8YaRa8FIdla8X:tg86Na8Va8FIdba8W:tg8UN:tg8XNa8VaaIdwaHIdwg81:tg8ZNaKIdwa81:tg8Wa80N:tg80a8Va8FIdwa81:tg83Na8Wa86N:tg8VNa8WaBNaRa8ZN:tg81a8Wa8UNaRa83N:tgRNMMa8Ya8YNa80a80Na81a81NMMa8Xa8XNa8Va8VNaRaRNMMN:rJbbj8:N9FmikaecwfheaXcufgXmbkkdndndndna9zc9:fPdebdkahheina8AydbhAdndna5aecdtgHfydbgecuSmbaOaecdtfydbaASmekdna8EaHfydbgecuSmbaOaecdtfydbaASmekaDheka9maHfaeBdbaQaHfydbgeah9hmbxikkdna8Ea5a5a9xfydbaDSEaQa9xfydbghcdtfydbgecu9hmbaQa9vfydbheka9ma9xfaDBdbaehDka9mahcdtfaDBdbka9yce86bba9wce86bba8JIdwgRaUaUaR9DEhUa9tcefh9tcecda9zceSEa8Lfh8Lxeka9rcefh9rka8Kcefg8Ka9q9hmbkka9tTmddnalTmbcbh8Fcbhhindna9mahcdtgefydbgAahSmbaOaAcdtfydbh8AdnahaOaefydb9hg8JmbaIa8Ac8S2fgeaIahc8S2fgHIdbaeIdbMUdbaeaHIdlaeIdlMUdlaeaHIdwaeIdwMUdwaeaHIdxaeIdxMUdxaeaHIdzaeIdzMUdzaeaHIdCaeIdCMUdCaeaHIdKaeIdKMUdKaeaHId3aeId3MUd3aeaHIdaaeIdaMUdaaeaHId8KaeId8KMUd8KaeaHIdyaeIdyMUdya8MTmba8Ma8Acltfgea8M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ha9iaeydbgXcdtfydbcdtfIdbgRa859ETmbaeclf8Pdbh9AabadcdtfgKaXBdbaKclfa9A83dbaRa8Sa8SaR9EEh8SadcifhdkaecxfheaAcifgAaH6mbkkadak0mbxdkkascNefabadalaOz:cjjjbkdndnadak0mbadhaxekdnaTmbadhaxekdna8Sa879FmbadhaxekcehKina8SJbb;aZNgRa87aRa879DEh8WJbbbbhRdnaSTmba9hheaShHinaeIdbg8VaRa8Va8W9FEaRa8VaR9EEhRaeclfheaHcufgHmbkkJFFuuh8ScbhaabhecbhHindna9ha9iaeydbgAcdtfydbcdtfIdbg8Va8W9ETmbaeclf8Pdbh9AabaacdtfgXaABdbaXclfa9A83dba8Va8Sa8Sa8V9EEh8SaacifhakaecxfheaHcifgHad6mbkdnaKaaad9hVceGmbadhaxdkaRaUaUaR9DEhUaaak9nmecbhKaahda8Sa879FmbkkdnamcjjjjdGTmba9ncbalz:tjjjbh8AdnaaTmbabheaahHina8AaeydbgAfce86bba8AaOaAcdtfydbfce86bbaeclfheaHcufgHmbkkascNefabaaalaOz:cjjjbdndnalTmbcbhXindna8AaXfRbbTmbdnaYaXfRbbgecl0mbceaetcQGmekdnaOaXcdtg8FfydbgeaXSmba8NaXcx2fgHa8Naecx2fgeydwBdwaHae8Pdb83dbxekaIaXc8S2fgKIdygcacJL:3;rUNgRMh87aKIdwg9BaRMh8SaKIdlg9CaRMh8UaKIdbg9DaRMh81aKIdag9EaRa8NaXcx2fg8JIdwg88N:th8ZaKId3g9FaRa8JIdlg89N:th83aKIdKg9Ga8JIdbg8:aRN:th80JbbbbhnaKIdCg9HJbbbbMh85aKIdzg9IJbbbbMhBaKIdxg9JJbbbbMh86dndnaCTmbaXhAinJbbbba87agaAc8S2fgHIdygR:vaRJbbbb9BEhRa8RaAaC2cltfheaHIdaa87Na8ZMh8ZaHId3a87Na83Mh83aHIdKa87Na80Mh80aHIdCa87Na85Mh85aHIdza87NaBMhBaHIdxa87Na86Mh86aHIdwa87Na8SMh8SaHIdla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AcdtgEfydbaeclfgKydbgOSmbcjjjj94cba8EaOcdtfydbaASEhCkaeaQaCVaAVBdbaYaOfRbbc3th8Fcjjjj94hCcjjjj94hQdna5aOcdtfydbaHSmbcjjjj94cba8EaHcdtfydbaOSEhQkaKa8FaQVaOVBdbaYaHfRbbc3thOdna5aHcdtfydbaASmbcjjjj94cba8EaEfydbaHSEhCkaXaOaCVaHVBdbaecxfheaLcifgLaa6mbkkdnazTmbaaTmbaaheinabazabydbcdtfydbBdbabclfhbaecufgembkkdnaPTmbaPaZaU:rNUdbkdnasyd;8egHTmbaHcdtasc:Ceffc98fheinaeydbcbyd:m:H:cjbH:bjjjbbaec98fheaHcufgHmbkkascj;sbf8Kjjjjbaak;Yieouabydlhvabydbclfcbaicdtz:tjjjbhoadci9UhrdnadTmbdnalTmbaehwadhDinaoalawydbcdtfydbcdtfgqaqydbcefBdbawclfhwaDcufgDmbxdkkaehwadhDinaoawydbcdtfgqaqydbcefBdbawclfhwaDcufgDmbkkdnaiTmbcbhDaohwinawydbhqawaDBdbawclfhwaqaDfhDaicufgimbkkdnadci6mbinaecwfydbhwaeclfydbhDaeydbhidnalTmbalawcdtfydbhwalaDcdtfydbhDalaicdtfydbhikavaoaicdtfgqydbcitfaDBdbavaqydbcitfawBdlaqaqydbcefBdbavaoaDcdtfgqydbcitfawBdbavaqydbcitfaiBdlaqaqydbcefBdbavaoawcdtfgwydbcitfaiBdbavawydbcitfaDBdlawawydbcefBdbaecxfhearcufgrmbkkabydbcbBdbk:todDue99aicd4aifhrcehwinawgDcethwaDar6mbkcuaDcdtgraDcFFFFi0Ecbyd1:H:cjbHjjjjbbhwaoaoyd9GgqcefBd9GaoaqcdtfawBdbawcFearz:tjjjbhkdnaiTmbalcd4hlaDcufhxcbhminamhDdnavTmbavamcdtfydbhDkcbadaDal2cdtfgDydlgwawcjjjj94SEgwcH4aw7c:F:b:DD2cbaDydbgwawcjjjj94SEgwcH4aw7c;D;O:B8J27cbaDydwgDaDcjjjj94SEgDcH4aD7c:3F;N8N27axGhwamcdthPdndndnavTmbakawcdtfgrydbgDcuSmeadavaPfydbal2cdtfgsIdbhzcehqinaqhrdnadavaDcdtfydbal2cdtfgqIdbaz9CmbaqIdlasIdl9CmbaqIdwasIdw9BmlkarcefhqakawarfaxGgwcdtfgrydbgDcu9hmbxdkkakawcdtfgrydbgDcuSmbadamal2cdtfgsIdbhzcehqinaqhrdnadaDal2cdtfgqIdbaz9CmbaqIdlasIdl9CmbaqIdwasIdw9BmikarcefhqakawarfaxGgwcdtfgrydbgDcu9hmbkkaramBdbamhDkabaPfaDBdbamcefgmai9hmbkkakcbyd:m:H:cjbH:bjjjbbaoaoyd9GcufBd9GdnaeTmbaiTmbcbhDaehwinawaDBdbawclfhwaiaDcefgD9hmbkcbhDaehwindnaDabydbgrSmbawaearcdtfgrydbBdbaraDBdbkabclfhbawclfhwaiaDcefgD9hmbkkk;:odvuv998Jjjjjbca9Rgocbyd1:G:cjbBdKaocb8Pdj:G:cjb83izaocbydN:G:cjbBdwaocb8Pd:m:G:cjb83ibdnadTmbaicd4hrdnabmbdnalTmbcbhwinaealawcdtfydbar2cdtfhDcbhiinaoczfaifgqaDaifIdbgkaqIdbgxaxak9EEUdbaoaifgqakaqIdbgxaxak9DEUdbaiclfgicx9hmbkawcefgwad9hmbxikkarcdthwcbhDincbhiinaoczfaifgqaeaifIdbgkaqIdbgxaxak9EEUdbaoaifgqakaqIdbgxaxak9DEUdbaiclfgicx9hmbkaeawfheaDcefgDad9hmbxdkkdnalTmbcbhwinabawcx2fgiaealawcdtfydbar2cdtfgDIdbUdbaiaDIdlUdlaiaDIdwUdwcbhiinaoczfaifgqaDaifIdbgkaqIdbgxaxak9EEUdbaoaifgqakaqIdbgxaxak9DEUdbaiclfgicx9hmbkawcefgwad9hmbxdkkarcdthlcbhwaehDinabawcx2fgiaeawar2cdtfgqIdbUdbaiaqIdlUdlaiaqIdwUdwcbhiinaoczfaifgqaDaifIdbgkaqIdbgxaxak9EEUdbaoaifgqakaqIdbgxaxak9DEUdbaiclfgicx9hmbkaDalfhDawcefgwad9hmbkkJbbbbaoIdbaoIdzgx:tgkakJbbbb9DEgkaoIdlaoIdCgm:tgPaPak9DEgkaoIdwaoIdKgP:tgsasak9DEhsdnabTmbadTmbJbbbbJbbjZas:vasJbbbb9BEhkinabakabIdbax:tNUdbabclfgoakaoIdbam:tNUdbabcwfgoakaoIdbaP:tNUdbabcxfhbadcufgdmbkkdnavTmbavaPUdwavamUdlavaxUdbkask:WlewudnaeTmbcbhvabhoinaoavBdbaoclfhoaeavcefgv9hmbkkdnaiTmbcbhrinadarcdtfhwcbhDinalawaDcdtgvyd:G:G:cjbcdtfydbcdtfydbhodnalawavfydbcdtfydbgqabaqcdtfgkydbgvSmbinakabavgqcdtfgxydbgvBdbaxhkaqav9hmbkkdnaoabaocdtfgkydbgvSmbinakabavgocdtfgxydbgvBdbaxhkaoav9hmbkkdnaqaoSmbabaqaoaqao0Ecdtfaqaoaqao6EBdbkaDcefgDci9hmbkarcifgrai6mbkkdnaembcbskcbhxindnalaxcdtgvfydbax9hmbaxhodnaxabavfgDydbgvSmbaDhqinaqabavgocdtfgkydbgvBdbakhqaoav9hmbkkaDaoBdbkaxcefgxae9hmbkcbhkabhvcbhoindndnaoalydbgq9hmbdnaoavydbgq9hmbavakBdbakcefhkxdkavabaqcdtfydbBdbxekavabaqcdtfydbBdbkalclfhlavclfhvaeaocefgo9hmbkakk;jiilud99euabcbaecltz:tjjjbhvdnalTmbadhoaihralhwinarcwfIdbhDarclfIdbhqavaoydbcltfgkarIdbakIdbMUdbakaqakIdlMUdlakaDakIdwMUdwakakIdxJbbjZMUdxaoclfhoarcxfhrawcufgwmbkkdnaeTmbavhkaehrinakcxfgoIdbhDaocbBdbakakIdbJbbbbJbbjZaD:vaDJbbbb9BEgDNUdbakclfgoaDaoIdbNUdbakcwfgoaDaoIdbNUdbakczfhkarcufgrmbkkdnalTmbinavadydbcltfgkaicwfIdbakIdw:tgDaDNaiIdbakIdb:tgDaDNaiclfIdbakIdl:tgDaDNMMgDakIdxgqaqaD9DEUdxadclfhdaicxfhialcufglmbkkdnaeTmbavcxfhkinabakIdbUdbakczfhkabclfhbaecufgembkkk:moerudnaoTmbaecd4hzdnavTmbaicd4hHavcdthOcbhAindnaPaAfRbbTmbaAhednaDTmbaDaAcdtfydbhekdnasTmbasaefRbbceGmekdnamaAfRbbclSmbabaeaz2cdtfgiaraAcx2fgCIdbakNaxIdbMUdbaiaCIdlakNaxIdlMUdlaiaCIdwakNaxIdwMUdwkadaeaH2cdtfhXaqheawhiavhCinaXaeydbcdtgQfaiIdbalaQfIdb:vUdbaeclfheaiclfhiaCcufgCmbkkawaOfhwaAcefgAao9hmbxdkkdnasmbcbheaDhiindnaPaefRbbTmbaehCdnaDTmbaiydbhCkamaefRbbclSmbabaCaz2cdtfgCarIdbakNaxIdbMUdbaCarclfIdbakNaxIdlMUdlaCarcwfIdbakNaxIdwMUdwkaiclfhiarcxfhraoaecefge9hmbxdkkdnaDTmbindnaPRbbTmbasaDydbgefRbbceGmbamRbbclSmbabaeaz2cdtfgearIdbakNaxIdbMUdbaearclfIdbakNaxIdlMUdlaearcwfIdbakNaxIdwMUdwkaPcefhPaDclfhDamcefhmarcxfhraocufgombxdkkazcdthicbheindnaPaefRbbTmbasaefRbbceGmbamaefRbbclSmbabarIdbakNaxIdbMUdbabclfarclfIdbakNaxIdlMUdbabcwfarcwfIdbakNaxIdwMUdbkarcxfhrabaifhbaoaecefge9hmbkkk8MbabaeadaialavcbcbcbcbcbaoarawaDz:bjjjbk8MbabaeadaialavaoarawaDaqakaxamaPz:bjjjbkRbababaeadaialavaoarawaDaqakaxcjjjjdVamz:bjjjbk:g8Koque99due99duq998Jjjjjbc;Wb9Rgq8Kjjjjbcbhkaqcxfcbc;Kbz:tjjjb8Aaqcualcx2alc;v:Q;v:Qe0Ecbyd1:H:cjbHjjjjbbgxBdxaqceBd2axaialavcbcbz:ejjjb8AaqcualcdtalcFFFFi0Egmcbyd1:H:cjbHjjjjbbgiBdzaqcdBd2dndnJFF959eJbbjZawJbbjZawJbbjZ9DE:vawJ9VO:d869DEgw:lJbbb9p9DTmbaw:OhPxekcjjjj94hPkadci9Uhsarco9UhzdndnaombaPcd9imekdnalTmbaPcuf:YhwdnaoTmbcbhvaihHaxhOindndnaoavfRbbceGTmbavcjjjjlVhAxekdndnaOclfIdbawNJbbbZMgC:lJbbb9p9DTmbaC:OhAxekcjjjj94hAkaAcqthAdndnaOcwfIdbawNJbbbZMgC:lJbbb9p9DTmbaC:OhXxekcjjjj94hXkaAaXVhAdndnaOIdbawNJbbbZMgC:lJbbb9p9DTmbaC:OhXxekcjjjj94hXkaAaXcCtVhAkaHaABdbaHclfhHaOcxfhOalavcefgv9hmbxdkkaxhvaihOalhHindndnavIdbawNJbbbZMgC:lJbbb9p9DTmbaC:OhAxekcjjjj94hAkaAcCthAdndnavclfIdbawNJbbbZMgC:lJbbb9p9DTmbaC:OhXxekcjjjj94hXkaXcqtaAVhAdndnavcwfIdbawNJbbbZMgC:lJbbb9p9DTmbaC:OhXxekcjjjj94hXkaOaAaXVBdbavcxfhvaOclfhOaHcufgHmbkkadTmbcbhkaehvcbhOinakaiavclfydbcdtfydbgHaiavcwfydbcdtfydbgA9haiavydbcdtfydbgXaH9haXaA9hGGfhkavcxfhvaOcifgOad6mbkkarci9UhQdndnaz:Z:rJbbbZMgw:lJbbb9p9DTmbaw:Ohvxekcjjjj94hvkaQ:ZhLcbhKc:bwhzdninakaQ9pmeazaP9Rcd9imeavazcufgOavaO9iEaPcefavaP9kEhYdnalTmbaYcuf:YhwdnaoTmbcbhOaihHaxhvindndnaoaOfRbbceGTmbaOcjjjjlVhAxekdndnavclfIdbawNJbbbZMgC:lJbbb9p9DTmbaC:OhAxekcjjjj94hAkaAcqthAdndnavcwfIdbawNJbbbZMgC:lJbbb9p9DTmbaC:OhXxekcjjjj94hXkaAaXVhAdndnavIdbawNJbbbZMgC:lJbbb9p9DTmbaC:OhXxekcjjjj94hXkaAaXcCtVhAkaHaABdbaHclfhHavcxfhvalaOcefgO9hmbxdkkaxhvaihOalhHindndnavIdbawNJbbbZMgC:lJbbb9p9DTmbaC:OhAxekcjjjj94hAkaAcCthAdndnavclfIdbawNJbbbZMgC:lJbbb9p9DTmbaC:OhXxekcjjjj94hXkaXcqtaAVhAdndnavcwfIdbawNJbbbZMgC:lJbbb9p9DTmbaC:OhXxekcjjjj94hXkaOaAaXVBdbavcxfhvaOclfhOaHcufgHmbkkcbhOdnadTmbaehvcbhHinaOaiavclfydbcdtfydbgAaiavcwfydbcdtfydbgX9haiavydbcdtfydbgraA9haraX9hGGfhOavcxfhvaHcifgHad6mbkkdnas:ZgCaL:taY:Ygwaz:Y:tg8ANak:ZgEaO:Zg3:tNaEaL:tawaP:Y:tg5Na3aC:tNMg8EJbbbb9BmbaCaE:ta5a8Aa3aL:tNNNa8E:vawMhwkdndnaOaQ0mbaOhkaYhPxekaOhsaYhzkdndnaKcl0mbdnawJbbbZMgw:lJbbb9p9DTmbaw:Ohvxdkcjjjj94hvxekaPazfcd9ThvkaKcefgKcs9hmbkkdndndnakmbJbbjZhwcbhOcdhvaDmexdkalcd4alfhHcehOinaOgvcethOavaH6mbkcbhOaqcuavcdtgYavcFFFFi0Ecbyd1:H:cjbHjjjjbbgKBdCaqciBd2aqamcbyd1:H:cjbHjjjjbbgzBdKaqclBd2dndndndnalTmbaPcuf:YhwaoTmecbhOaihAaxhHindndnaoaOfRbbceGTmbaOcjjjjlVhXxekdndnaHclfIdbawNJbbbZMgC:lJbbb9p9DTmbaC:OhXxekcjjjj94hXkaXcqthXdndnaHcwfIdbawNJbbbZMgC:lJbbb9p9DTmbaC:Ohrxekcjjjj94hrkaXarVhXdndnaHIdbawNJbbbZMgC:lJbbb9p9DTmbaC:Ohrxekcjjjj94hrkaXarcCtVhXkaAaXBdbaAclfhAaHcxfhHalaOcefgO9hmbxikkaKcFeaYz:tjjjb8AcbhPcbhvxdkaxhOaihHalhAindndnaOIdbawNJbbbZMgC:lJbbb9p9DTmbaC:OhXxekcjjjj94hXkaXcCthXdndnaOclfIdbawNJbbbZMgC:lJbbb9p9DTmbaC:Ohrxekcjjjj94hrkarcqtaXVhXdndnaOcwfIdbawNJbbbZMgC:lJbbb9p9DTmbaC:Ohrxekcjjjj94hrkaHaXarVBdbaOcxfhOaHclfhHaAcufgAmbkkaKcFeaYz:tjjjbhravcufhocbhPcbhYindndndnaraiaYcdtgKfydbgAcm4aA7c:v;t;h;Ev2gvcs4av7aoGgHcdtfgXydbgOcuSmbcehvinaiaOcdtgOfydbaASmdaHavfhOavcefhvaraOaoGgHcdtfgXydbgOcu9hmbkkaXaYBdbaPhvaPcefhPxekazaOfydbhvkazaKfavBdbaYcefgYal9hmbkcuaPc8S2gOaPc;D;O;f8U0EhvkcbhXaqavcbyd1:H:cjbHjjjjbbgvBd3aqcvBd2avcbaOz:tjjjbhOdnadTmbaehiinaxaiclfydbgrcx2fgvIdbaxaiydbgocx2fgHIdbg3:tgCaxaicwfydbgYcx2fgAIdlaHIdlg8A:tgwNavIdla8A:tgEaAIdba3:tg8EN:tgLaLNaEaAIdwaHIdwg5:tg8FNavIdwa5:tgEawN:tgwawNaEa8ENaCa8FN:tgCaCNMMg8E:rhEJbbnnJbbjZazaocdtfydbgvazarcdtfydbgASavazaYcdtfydbgrSGgHEh8Fdna8EJbbbb9ETmbaLaE:vhLaCaE:vhCawaE:vhwkaOavc8S2fgvavIdbawa8FaE:rNgEawNNg8FMUdbavaCaEaCNgaNghavIdlMUdlavaLaEaLNg8ENggavIdwMUdwavawaaNgaavIdxMUdxava8EawNg8JavIdzMUdzavaCa8ENg8EavIdCMUdCavawaEaLa5Nawa3Na8AaCNMM:mg8ANg3NgwavIdKMUdKavaCa3NgCavId3MUd3avaLa3NgLavIdaMUdaava3a8ANg3avId8KMUd8KavaEavIdyMUdydnaHmbaOaAc8S2fgva8FavIdbMUdbavahavIdlMUdlavagavIdwMUdwavaaavIdxMUdxava8JavIdzMUdzava8EavIdCMUdCavawavIdKMUdKavaCavId3MUd3avaLavIdaMUdaava3avId8KMUd8KavaEavIdyMUdyaOarc8S2fgva8FavIdbMUdbavahavIdlMUdlavagavIdwMUdwavaaavIdxMUdxava8JavIdzMUdzava8EavIdCMUdCavawavIdKMUdKavaCavId3MUd3avaLavIdaMUdaava3avId8KMUd8KavaEavIdyMUdykaicxfhiaXcifgXad6mbkkcbhAaqcuaPcdtgvaPcFFFFi0Egicbyd1:H:cjbHjjjjbbgHBdaaqcoBd2aqaicbyd1:H:cjbHjjjjbbgiBd8KaqcrBd2aHcFeavz:tjjjbhYdnalTmbazhHinJbbbbJbbjZaOaHydbgXc8S2fgvIdygw:vawJbbbb9BEavIdwaxcwfIdbgwNavIdzaxIdbgCNavIdaMgLaLMMawNavIdlaxclfIdbgLNavIdCawNavId3MgwawMMaLNavIdbaCNavIdxaLNavIdKMgwawMMaCNavId8KMMM:lNhwdndnaYaXcdtgvfgXydbcuSmbaiavfIdbaw9ETmekaXaABdbaiavfawUdbkaHclfhHaxcxfhxalaAcefgA9hmbkkdndnaPmbJbbbbhwxekJbbbbhwinaiIdbgCawawaC9DEhwaiclfhiaPcufgPmbkaw:rhwkakcd4akfhOcehiinaigvcethiavaO6mbkcbhOaqcuavcdtgiavcFFFFi0Ecbyd1:H:cjbHjjjjbbgHBdyaHcFeaiz:tjjjbhXdnadTmbavcufhrcbhPcbhxindnazaeaxcdtfgvydbcdtfydbgiazavclfydbcdtfydbgOSmbaiazavcwfydbcdtfydbgvSmbaOavSmbaYavcdtfydbhAdndnaYaOcdtfydbgvaYaicdtfydbgi9pmbavaA9pmbaAhlaihoavhAxekdnaAai9pmbaAav9pmbaihlavhoxekavhlaAhoaihAkabaPcx2fgvaABdbavcwfaoBdbavclfalBdbdnaXaoc:3F;N8N2alc:F:b:DD27aAc;D;O:B8J27arGgOcdtfgvydbgicuSmbcehHinaHhvdnabaicx2fgiydbaA9hmbaiydlal9hmbaiydwaoSmikavcefhHaXaOavfarGgOcdtfgvydbgicu9hmbkkavaPBdbaPcefhPkaxcifgxad6mbkaPci2hOkcwhvaDTmekaDawUdbkavcdthvaqcxfc98fhiinaiavfydbcbyd:m:H:cjbH:bjjjbbavc98fgvmbkaqc;Wbf8KjjjjbaOk:3ldrue9:8Jjjjjbc;Wb9Rgr8Kjjjjbcbhwarcxfcbc;Kbz:tjjjb8AdnabaeSmbabaeadcdtzMjjjb8AkarcualcdtalcFFFFi0EgDcbyd1:H:cjbHjjjjbbgqBdxarceBd2aqcbaialavcbarcxfz:djjjbcualcx2alc;v:Q;v:Qe0Ecbyd1:H:cjbHjjjjbbhkarcxfaryd2gxcdtfakBdbaraxcefgmBd2akaialavcbcbz:ejjjb8AarcxfamcdtfaDcbyd1:H:cjbHjjjjbbgiBdbaraxcdfgvBd2arcxfavcdtfcuaialaeadaqz:fjjjbgecltaecjjjjiGEcbyd1:H:cjbHjjjjbbgqBdbaqaeaiakalz:gjjjbaxcifhkdnadTmbaoaoNhocbhwabhlcbheindnaqaialydbgvcdtfydbcdtfIdbao9ETmbalclf8PdbhPabawcdtfgDavBdbaDclfaP83dbawcifhwkalcxfhlaecifgead6mbkkdnakTmbaxcdtarcxffcwfhlinalydbcbyd:m:H:cjbH:bjjjbbalc98fhlakcufgkmbkkarc;Wbf8Kjjjjbawk:WCoDud99vue99vuv998Jjjjjbc;Wb9Rgw8KjjjjbdndnarmbcbhDxekawcxfcbc;Kbz:tjjjb8Aawcuadcx2adc;v:Q;v:Qe0Ecbyd1:H:cjbHjjjjbbgqBdxawceBd2aqaeadaicbcbz:ejjjb8AawcuadcdtadcFFFFi0Egkcbyd1:H:cjbHjjjjbbgxBdzawcdBd2adcd4adfhmceheinaegicetheaiam6mbkcbhPawcuaicdtgsaicFFFFi0Ecbyd1:H:cjbHjjjjbbgzBdCawciBd2dndnar:ZgH:rJbbbZMgO:lJbbb9p9DTmbaO:Ohexekcjjjj94hekaicufhAc:bwhCcbhXadhQcbhLinaeaCcufgiaeai9iEaPcefaeaP9k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iinaxaecdtgefydbaYSmdamaifheaicefhiaEaeaAGgmcdtfg8Aydbgecu9hmbkka8Aa3BdbaDhiaDcefhDxeka5aefydbhika5aCfaiBdba3cefg3ad9hmbkcuaDc32giaDc;j:KM;jb0EhexekazcFeasz:tjjjb8AcbhDcbhekawaecbyd1:H:cjbHjjjjbbgeBd3awcvBd2aecbaiz:tjjjbh8Aavcd4hxdnadTmbdnalTmbaxcdthEa5hYaqhealhmadhAina8AaYydbc32fgiaeIdbaiIdbMUdbaiaeclfIdbaiIdlMUdlaiaecwfIdbaiIdwMUdwaiamIdbaiIdxMUdxaiamclfIdbaiIdzMUdzaiamcwfIdbaiIdCMUdCaiaiIdKJbbjZMUdKaYclfhYaecxfheamaEfhmaAcufgAmbxdkka5hmaqheadhYina8Aamydbc32fgiaeIdbaiIdbMUdbaiaeclfIdbaiIdlMUdlaiaecwfIdbaiIdwMUdwaiaiIdxJbbbbMUdxaiaiIdzJbbbbMUdzaiaiIdCJbbbbMUdCaiaiIdKJbbjZMUdKamclfhmaecxfheaYcufgYmbkkdnaDTmba8AhiaDheinaiaiIdbJbbbbJbbjZaicKfIdbgO:vaOJbbbb9BEgONUdbaiclfgmaOamIdbNUdbaicwfgmaOamIdbNUdbaicxfgmaOamIdbNUdbaiczfgmaOamIdbNUdbaicCfgmaOamIdbNUdbaic3fhiaecufgembkkcbhYawcuaDcdtgCaDcFFFFi0Egicbyd1:H:cjbHjjjjbbgeBdaawcoBd2awaicbyd1:H:cjbHjjjjbbgEBd8KaecFeaCz:tjjjbh3dnadTmbaoJbbjZJbbjZaK:vaPceSENgOaONhKaxcdthxalheinaKaec;8:G:cjbalEgmIdwa8Aa5ydbgAc32fgiIdC:tgOaONamIdbaiIdx:tgOaONamIdlaiIdz:tgOaONMMNaqcwfIdbaiIdw:tgOaONaqIdbaiIdb:tgOaONaqclfIdbaiIdl:tgOaONMMMhOdndna3aAcdtgifgmydbcuSmbaEaifIdbaO9ETmekamaYBdbaEaifaOUdbka5clfh5aqcxfhqaeaxfheadaYcefgY9hmbkkaba3aCzMjjjb8Acrhikaicdthiawcxfc98fheinaeaifydbcbyd:m:H:cjbH:bjjjbbaic98fgimbkkawc;Wbf8KjjjjbaDk:Pdidui99ducbhi8Jjjjjbca9Rglcbyd1:G:cjbBdKalcb8Pdj:G:cjb83izalcbydN:G:cjbBdwalcb8Pd:m:G:cjb83ibdndnaembJbbjFhvJbbjFhoJbbjFhrxekadcd4cdthwincbhdinalczfadfgDabadfIdbgvaDIdbgoaoav9EEUdbaladfgDavaDIdbgoaoav9DEUdbadclfgdcx9hmbkabawfhbaicefgiae9hmbkalIdwalIdK:thralIdlalIdC:thoalIdbalIdz:thvkJbbbbavavJbbbb9DEgvaoaoav9DEgvararav9DEk9DeeuabcFeaicdtz:tjjjbhlcbhbdnadTmbindnalaeydbcdtfgiydbcu9hmbaiabBdbabcefhbkaeclfheadcufgdmbkkabk;Bidqui998Jjjjjbc;Wb9Rgl8Kjjjjbalcxfcbc;Kbz:tjjjb8Aadcd4adfhvcehoinaogrcethoarav6mbkalcuarcdtgoarcFFFFi0Ecbyd1:H:cjbHjjjjbbgvBdxavcFeaoz:tjjjbhwdnadTmbaicd4hDarcufhqcbhkindndnawcbaeakaD2cdtfgrydlgiaicjjjj94SEgocH4ao7c:F:b:DD2cbarydbgxaxcjjjj94SEgocH4ao7c;D;O:B8J27cbarydwgmamcjjjj94SEgrcH4ar7c:3F;N8N27aqGgvcdtfgrydbgocuSmbam::hPai::hsax::hzcehiinaihrdnaeaoaD2cdtfgiIdbaz9CmbaiIdlas9CmbaiIdwaP9BmikarcefhiawavarfaqGgvcdtfgrydbgocu9hmbkkarakBdbakhokabakcdtfaoBdbakcefgkad9hmbkkalydxcbyd:m:H:cjbH:bjjjbbalc;Wbf8Kjjjjbk9teiucbcbyd:q:H:cjbgeabcifc98GfgbBd:q:H:cjbdndnabZbcztgd9nmbcuhiabad9RcFFifcz4nbcuSmekaehikaik;LeeeudndnaeabVciGTmbabhixekdndnadcz9pmbabhixekabhiinaiaeydbBdbaiclfaeclfydbBdbaicwfaecwfydbBdbaicxfaecxfydbBdbaeczfheaiczfhiadc9Wfgdcs0mbkkadcl6mbinaiaeydbBdbaeclfheaiclfhiadc98fgdci0mbkkdnadTmbinaiaeRbb86bbaicefhiaecefheadcufgdmbkkabk;aeedudndnabciGTmbabhixekaecFeGc:b:c:ew2hldndnadcz9pmbabhixekabhiinaialBdbaicxfalBdbaicwfalBdbaiclfalBdbaiczfhiadc9Wfgdcs0mbkkadcl6mbinaialBdbaiclfhiadc98fgdci0mbkkdnadTmbinaiae86bbaicefhiadcufgdmbkkabk9teiucbcbyd:q:H:cjbgeabcrfc94GfgbBd:q:H:cjbdndnabZbcztgd9nmbcuhiabad9RcFFifcz4nbcuSmekaehikaikTeeucbabcbyd:q:H:cjbge9Rcifc98GaefgbBd:q:H:cjbdnabZbcztge9nmbabae9RcFFifcz4nb8Akkk:Kedbcj:Gdk1eFFuuFFuuFFuuFFuFFFuFFFuFbbbbbbbbebbbdbbbbbbbebbbebbbdbbbbbbbbbbbeeeeebebbebbebebbbeebbbbbbbbbbbbeeeeeebebbeeebeebbbbebebbbbbbbbbbbbbbbbbbc1:Hdkxebbbdbbb:G:qbb",t=new Uint8Array([32,0,65,2,1,106,34,33,3,128,11,4,13,64,6,253,10,7,15,116,127,5,8,12,40,16,19,54,20,9,27,255,113,17,42,67,24,23,146,148,18,14,22,45,70,69,56,114,101,21,25,63,75,136,108,28,118,29,73,115]);if(typeof WebAssembly!="object")return{supported:!1};var n,i=WebAssembly.instantiate(r(e),{}).then(function(x){n=x.instance,n.exports.__wasm_call_ctors()});function r(x){for(var T=new Uint8Array(x.length),E=0;E<x.length;++E){var v=x.charCodeAt(E);T[E]=v>96?v-97:v>64?v-39:v+4}for(var S=0,E=0;E<x.length;++E)T[S++]=T[E]<60?t[T[E]]:(T[E]-60)*64+T[++E];return T.buffer.slice(0,S)}function o(x){if(!x)throw new Error("Assertion failed")}function s(x){return new Uint8Array(x.buffer,x.byteOffset,x.byteLength)}function a(x,T,E,v){var S=n.exports.sbrk,I=S(E*4),R=S(E*v*4),O=new Uint8Array(n.exports.memory.buffer);O.set(s(T),R),x(I,R,E,v*4),O=new Uint8Array(n.exports.memory.buffer);var L=new Uint32Array(E);return new Uint8Array(L.buffer).set(O.subarray(I,I+E*4)),S(I-S(0)),L}function c(x,T,E){var v=n.exports.sbrk,S=v(T.length*4),I=v(E*4),R=new Uint8Array(n.exports.memory.buffer),O=s(T);R.set(O,S);var L=x(I,S,T.length,E);R=new Uint8Array(n.exports.memory.buffer);var _=new Uint32Array(E);new Uint8Array(_.buffer).set(R.subarray(I,I+E*4)),v(S-v(0));for(var C=0;C<T.length;++C)T[C]=_[T[C]];return[_,L]}function u(x){for(var T=0,E=0;E<x.length;++E){var v=x[E];T=T<v?v:T}return T}function f(x,T,E,v,S,I,R,O,L){var _=n.exports.sbrk,C=_(4),w=_(E*4),D=_(S*I),N=_(E*4),F=new Uint8Array(n.exports.memory.buffer);F.set(s(v),D),F.set(s(T),N);var V=x(w,N,E,D,S,I,R,O,L,C);F=new Uint8Array(n.exports.memory.buffer);var B=new Uint32Array(V);s(B).set(F.subarray(w,w+V*4));var j=new Float32Array(1);return s(j).set(F.subarray(C,C+4)),_(C-_(0)),[B,j[0]]}function d(x,T,E,v,S,I,R,O,L,_,C,w,D){var N=n.exports.sbrk,F=N(4),V=N(E*4),B=N(S*I),j=N(S*O),k=N(L.length*4),G=N(E*4),q=_?N(S):0,Q=new Uint8Array(n.exports.memory.buffer);Q.set(s(v),B),Q.set(s(R),j),Q.set(s(L),k),Q.set(s(T),G),_&&Q.set(s(_),q);var W=x(V,G,E,B,S,I,j,O,k,L.length,q,C,w,D,F);Q=new Uint8Array(n.exports.memory.buffer);var J=new Uint32Array(W);s(J).set(Q.subarray(V,V+W*4));var Z=new Float32Array(1);return s(Z).set(Q.subarray(F,F+4)),N(F-N(0)),[J,Z[0]]}function p(x,T,E,v,S,I,R,O,L,_,C,w,D){var N=n.exports.sbrk,F=N(4),V=N(S*I),B=N(S*O),j=N(L.length*4),k=N(E*4),G=_?N(S):0,q=new Uint8Array(n.exports.memory.buffer);q.set(s(v),V),q.set(s(R),B),q.set(s(L),j),q.set(s(T),k),_&&q.set(s(_),G);var Q=x(k,E,V,S,I,B,O,j,L.length,G,C,w,D,F);q=new Uint8Array(n.exports.memory.buffer),s(T).set(q.subarray(k,k+Q*4)),s(v).set(q.subarray(V,V+S*I)),s(R).set(q.subarray(B,B+S*O));var W=new Float32Array(1);return s(W).set(q.subarray(F,F+4)),N(F-N(0)),[Q,W[0]]}function g(x,T,E,v){var S=n.exports.sbrk,I=S(E*v),R=new Uint8Array(n.exports.memory.buffer);R.set(s(T),I);var O=x(I,E,v);return S(I-S(0)),O}function m(x,T,E,v,S,I,R,O){var L=n.exports.sbrk,_=L(O*4),C=L(E*v),w=S?L(E*I):0,D=new Uint8Array(n.exports.memory.buffer);D.set(s(T),C),S&&D.set(s(S),w);var N=x(_,C,E,v,w,I,R,O);D=new Uint8Array(n.exports.memory.buffer);var F=new Uint32Array(N);return s(F).set(D.subarray(_,_+N*4)),L(_-L(0)),F}function y(x,T,E,v,S,I,R,O,L){var _=n.exports.sbrk,C=_(4),w=_(E*4),D=_(S*I),N=_(E*4),F=R?_(S):0,V=new Uint8Array(n.exports.memory.buffer);V.set(s(v),D),V.set(s(T),N),R&&V.set(s(R),F);var B=x(w,N,E,D,S,I,F,O,L,C);V=new Uint8Array(n.exports.memory.buffer);var j=new Uint32Array(B);s(j).set(V.subarray(w,w+B*4));var k=new Float32Array(1);return s(k).set(V.subarray(C,C+4)),_(C-_(0)),[j,k[0]]}function A(x,T,E,v,S,I,R){var O=n.exports.sbrk,L=O(E*4),_=O(S*I),C=O(E*4),w=new Uint8Array(n.exports.memory.buffer);w.set(s(v),_),w.set(s(T),C);var D=x(L,C,E,_,S,I,R);w=new Uint8Array(n.exports.memory.buffer);var N=new Uint32Array(D);return s(N).set(w.subarray(L,L+D*4)),O(L-O(0)),N}var b={LockBorder:1,Sparse:2,ErrorAbsolute:4,Prune:8,Regularize:16,Permissive:32,RegularizeLight:64,_InternalDebug:1<<30};return{ready:i,supported:!0,compactMesh:function(x){o(x instanceof Uint32Array||x instanceof Int32Array||x instanceof Uint16Array||x instanceof Int16Array),o(x.length%3==0);var T=x.BYTES_PER_ELEMENT==4?x:new Uint32Array(x),E=c(n.exports.meshopt_optimizeVertexFetchRemap,T,u(x)+1);if(x!==T)for(var v=0;v<T.length;++v)x[v]=T[v];return E},generatePositionRemap:function(x,T){return o(x instanceof Float32Array),o(x.length%T==0),o(T>=3),a(n.exports.meshopt_generatePositionRemap,x,x.length/T,T)},simplify:function(x,T,E,v,S,I){o(x instanceof Uint32Array||x instanceof Int32Array||x instanceof Uint16Array||x instanceof Int16Array),o(x.length%3==0),o(T instanceof Float32Array),o(T.length%E==0),o(E>=3),o(v>=0&&v<=x.length),o(v%3==0),o(S>=0);for(var R=0,O=0;O<(I?I.length:0);++O)o(I[O]in b),R|=b[I[O]];var L=x.BYTES_PER_ELEMENT==4?x:new Uint32Array(x),_=f(n.exports.meshopt_simplify,L,x.length,T,T.length/E,E*4,v,S,R);return _[0]=x instanceof Uint32Array?_[0]:new x.constructor(_[0]),_},simplifyWithAttributes:function(x,T,E,v,S,I,R,O,L,_){o(x instanceof Uint32Array||x instanceof Int32Array||x instanceof Uint16Array||x instanceof Int16Array),o(x.length%3==0),o(T instanceof Float32Array),o(T.length%E==0),o(E>=3),o(v instanceof Float32Array),o(v.length==S*(T.length/E)),o(S>=0),o(R==null||R instanceof Uint8Array),o(R==null||R.length==T.length/E),o(O>=0&&O<=x.length),o(O%3==0),o(L>=0),o(Array.isArray(I)),o(S>=I.length),o(I.length<=32);for(var C=0;C<I.length;++C)o(I[C]>=0);for(var w=0,C=0;C<(_?_.length:0);++C)o(_[C]in b),w|=b[_[C]];var D=x.BYTES_PER_ELEMENT==4?x:new Uint32Array(x),N=d(n.exports.meshopt_simplifyWithAttributes,D,x.length,T,T.length/E,E*4,v,S*4,new Float32Array(I),R,O,L,w);return N[0]=x instanceof Uint32Array?N[0]:new x.constructor(N[0]),N},simplifyWithUpdate:function(x,T,E,v,S,I,R,O,L,_){o(x instanceof Uint32Array||x instanceof Int32Array||x instanceof Uint16Array||x instanceof Int16Array),o(x.length%3==0),o(T instanceof Float32Array),o(T.length%E==0),o(E>=3),o(v instanceof Float32Array),o(v.length==S*(T.length/E)),o(S>=0),o(R==null||R instanceof Uint8Array),o(R==null||R.length==T.length/E),o(O>=0&&O<=x.length),o(O%3==0),o(L>=0),o(Array.isArray(I)),o(S>=I.length),o(I.length<=32);for(var C=0;C<I.length;++C)o(I[C]>=0);for(var w=0,C=0;C<(_?_.length:0);++C)o(_[C]in b),w|=b[_[C]];var D=x.BYTES_PER_ELEMENT==4?x:new Uint32Array(x),N=p(n.exports.meshopt_simplifyWithUpdate,D,x.length,T,T.length/E,E*4,v,S*4,new Float32Array(I),R,O,L,w);if(x!==D)for(var C=0;C<N[0];++C)x[C]=D[C];return N},getScale:function(x,T){return o(x instanceof Float32Array),o(x.length%T==0),o(T>=3),g(n.exports.meshopt_simplifyScale,x,x.length/T,T*4)},simplifyPoints:function(x,T,E,v,S,I){return o(x instanceof Float32Array),o(x.length%T==0),o(T>=3),o(E>=0&&E<=x.length/T),v?(o(v instanceof Float32Array),o(v.length%S==0),o(S>=3),o(x.length/T==v.length/S),m(n.exports.meshopt_simplifyPoints,x,x.length/T,T*4,v,S*4,I||0,E)):m(n.exports.meshopt_simplifyPoints,x,x.length/T,T*4,void 0,0,0,E)},simplifySloppy:function(x,T,E,v,S,I){o(x instanceof Uint32Array||x instanceof Int32Array||x instanceof Uint16Array||x instanceof Int16Array),o(x.length%3==0),o(T instanceof Float32Array),o(T.length%E==0),o(E>=3),o(v==null||v instanceof Uint8Array),o(v==null||v.length==T.length/E),o(S>=0&&S<=x.length),o(S%3==0),o(I>=0);var R=x.BYTES_PER_ELEMENT==4?x:new Uint32Array(x),O=y(n.exports.meshopt_simplifySloppy,R,x.length,T,T.length/E,E*4,v,S,I);return O[0]=x instanceof Uint32Array?O[0]:new x.constructor(O[0]),O},simplifyPrune:function(x,T,E,v){o(x instanceof Uint32Array||x instanceof Int32Array||x instanceof Uint16Array||x instanceof Int16Array),o(x.length%3==0),o(T instanceof Float32Array),o(T.length%E==0),o(E>=3),o(v>=0);var S=x.BYTES_PER_ELEMENT==4?x:new Uint32Array(x),I=A(n.exports.meshopt_simplifyPrune,S,x.length,T,T.length/E,E*4,v);return I=x instanceof Uint32Array?I:new x.constructor(I),I}}})();var VCn=(function(){var e="b9H79Tebbbe:neP9Geueu9Geub9Gbb9Giuuueu9Gmuuuuuuuuuuu9999eu9Gouuuuuueu9Gruuuuuuub9Gxuuuuuuuuuuuueu9Gxuuuuuuuuuuu99eu9GPuuuuuuuuuuuuu99b9Gouuuuuub9Gwuuuuuuuub9Gvuuuuub9GluuuubiQXdilvorwDqokoqxmbiibeilve9Weiiviebeoweuecj:Gdkr;Zeqo9TW9T9VV95dbH9F9F939H79T9F9J9H229F9Jt9VV7bb8A9TW79O9V9Wt9F9I919P29K9nW79O2Wt79c9V919U9KbeY9TW79O9V9Wt9F9I919P29K9nW79O2Wt7S2W94bd39TW79O9V9Wt9F9I919P29K9nW79O2Wt79t9W9Ht9P9H2bo39TW79O9V9Wt9F9J9V9T9W91tWJ2917tWV9c9V919U9K7bw39TW79O9V9Wt9F9J9V9T9W91tW9nW79O2Wt9c9V919U9K7bkE9TW79O9V9Wt9F9J9V9T9W91tW9t9W9OWVW9c9V919U9K7bxL9TW79O9V9Wt9F9V9Wt9P9T9P96W9nW79O2WtbPl79IV9RbsDwebcekdOAq;W:leXdbkIbabaec9:fgefcufae9Ugeabci9Uadfcufad9Ugbaeab0Ek:88JDPue99eux99due99euo99iu8Jjjjjbc:WD9Rgm8KjjjjbdndnalmbcbhPxekamc:Cwfcbc;Kbz:rjjjb8AcuaocdtgsaocFFFFi0Ehzcbyd;0:G:cjbhHdndnalcb9imbaoal9nmbamazaHHjjjjbbgHBd:CwamceBd;8wamazcbyd;0:G:cjbHjjjjbbgOBd:GwamcdBd;8wamcualcdtalcFFFFi0Ecbyd;0:G:cjbHjjjjbbgABd:KwamciBd;8waihzalhsinaHazydbcdtfcbBdbazclfhzascufgsmbkaihzalhsinaHazydbcdtfgCaCydbcefBdbazclfhzascufgsmbkaihzalhCcbhXindnaHazydbcdtgQfgsydbcb9imbaOaQfaXBdbasasydbgQcjjjj94VBdbaQaXfhXkazclfhzaCcufgCmbkalci9UhLdnalci6mbcbhzaihsinascwfydbhCasclfydbhXaOasydbcdtfgQaQydbgQcefBdbaAaQcdtfazBdbaOaXcdtfgXaXydbgXcefBdbaAaXcdtfazBdbaOaCcdtfgCaCydbgCcefBdbaAaCcdtfazBdbascxfhsaLazcefgz9hmbkkaihzalhsindnaHazydbcdtgCfgXydbgQcu9kmbaXaQcFFFFrGgQBdbaOaCfgCaCydbaQ9RBdbkazclfhzascufgsmbxdkkamazaHHjjjjbbgHBd:CwamceBd;8wamazcbyd;0:G:cjbHjjjjbbgOBd:GwamcdBd;8wamcualcdtalcFFFFi0Ecbyd;0:G:cjbHjjjjbbgABd:KwamciBd;8waHcbasz:rjjjbhXaihzalhsinaXazydbcdtfgCaCydbcefBdbazclfhzascufgsmbkalci9UhLdnaoTmbcbhzaOhsaXhCaohQinasazBdbasclfhsaCydbazfhzaCclfhCaQcufgQmbkkdnalci6mbcbhzaihsinascwfydbhCasclfydbhQaOasydbcdtfgKaKydbgKcefBdbaAaKcdtfazBdbaOaQcdtfgQaQydbgQcefBdbaAaQcdtfazBdbaOaCcdtfgCaCydbgCcefBdbaAaCcdtfazBdbascxfhsaLazcefgz9hmbkkaoTmbcbhzaohsinaOazfgCaCydbaXazfydb9RBdbazclfhzascufgsmbkkamaLcbyd;0:G:cjbHjjjjbbgzBd:OwamclBd;8wazcbaLz:rjjjbhYamcuaLcK2alcjjjjd0Ecbyd;0:G:cjbHjjjjbbg8ABd:SwamcvBd;8wJbbbbhEdnalci6g3mbarcd4hKaihsa8AhzaLhrJbbbbh5inavasclfydbaK2cdtfgCIdlh8EavasydbaK2cdtfgXIdlhEavascwfydbaK2cdtfgQIdlh8FaCIdwhaaXIdwhhaQIdwhgazaCIdbg8JaXIdbg8KMaQIdbg8LMJbbnn:vUdbazclfaXIdlaCIdlMaQIdlMJbbnn:vUdbaQIdwh8MaCIdwh8NaXIdwhyazcxfa8EaE:tg8Eagah:tggNaaah:tgaa8FaE:tghN:tgEJbbbbJbbjZa8Ja8K:tg8FahNa8Ea8La8K:tg8KN:tghahNaEaENaaa8KNa8FagN:tgEaENMMg8K:rg8E:va8KJbbbb9BEg8KNUdbazczfaEa8KNUdbazcCfaha8KNUdbazcwfa8Maya8NMMJbbnn:vUdba5a8EMh5ascxfhsazcKfhzarcufgrmbka5aL:Z:vJbbbZNhEkamcuaLcdtalcFFFF970Ecbyd;0:G:cjbHjjjjbbgCBd:WwamcoBd;8waq:Zhhdna3mbcbhzaChsinasazBdbasclfhsaLazcefgz9hmbkkaEahNhhamcuaLcltalcFFFFd0Ecbyd;0:G:cjbHjjjjbbg8PBd:0wamcrBd;8wcba8Pa8AaCaLcbz:djjjb8AJFFuuh8MJFFuuh8NJFFuuhydnalci6mbJFFuuhya8AhzaLhsJFFuuh8NJFFuuh8MinazcwfIdbgEa8Ma8MaE9EEh8MazclfIdbgEa8Na8NaE9EEh8NazIdbgEayayaE9EEhyazcKfhzascufgsmbkkah:rhEamaocetgzcuaocu9kEcbyd;0:G:cjbHjjjjbbgCBd:4wdndnaoal9nmbaihzalhsinaCazydbcetfcFFi87ebazclfhzascufgsmbxdkkaCcFeazz:rjjjb8AkaEJbbbZNh8JcuhIdnalci6mbcbhsJFFuuhEa8AhzcuhIinazcwfIdba8M:tghahNazIdbay:tghahNazclfIdba8N:tghahNMM:rghaEaIcuSahaE9DVgXEhEasaIaXEhIazcKfhzaLascefgs9hmbkkamczfcbcjwz:rjjjb8Aam9cb83iwam9cb83ibaxa8JNh8RJbbjZak:th8Lcbh8SJbbbbhRJbbbbh8UJbbbbh8VJbbbbh8WJbbbbh8XJbbbbh8Ycbh8ZcbhPinJbbbbhEdna8STmbJbbjZa8S:Z:vhEkJbbbbhhdna8Ya8YNa8Wa8WNa8Xa8XNMMg8KJbbbb9BmbJbbjZa8K:r:vhhka8VaENh8Ka8UaENh5aRaENh8EaIhLdndndndndna8SaPVTmbamydwg80Tmea8YahNh8Fa8XahNhaa8WahNhgaeamydbcdtfh81cbh3JFFuuhEcvhQcuhLindnaHa81a3cdtfydbcdtgzfydbgvTmbaAaOazfydbcdtfhsindndnaCaiasydbgKcx2fgzclfydbgrcetf8Vebcs4aCazydbgXcetf8Vebcs4faCazcwfydbglcetf8Vebcs4fgombcbhzxekcehzaHaXcdtfydbgXceSmbcehzaHarcdtfydbgrceSmbcehzaHalcdtfydbglceSmbdnarcdSaXcdSfalcdSfcd6mbaocefhzxekaocdfhzkdnazaQ9kmba8AaKcK2fgXIdwa8K:tghahNaXIdba8E:tghahNaXIdla5:tghahNMM:ra8J:va8LNJbbjZMJ9VO:d86JbbjZaXIdCa8FNaXIdxagNaaaXIdzNMMakN:tghahJ9VO:d869DENghaEazaQ6ahaE9DVgXEhEaKaLaXEhLazaQaXEhQkasclfhsavcufgvmbkka3cefg3a809hmbkkaLcu9hmekama8KUd:ODama5Ud:KDama8EUd:GDamcuBd:qDamcFFF;7rBdjDa8Pcba8AaYamc:GDfamc:qDfamcjDfz:ejjjbamyd:qDhLdndnaxJbbbb9ETmba8SaD6mbaLcuSmeceh3amIdjDa8R9EmixdkaLcu9hmekdna8STmbabaPcltfgHam8Piw83dwaHam8Pib83dbaPcefhPkc3hHinamc:CwfaHfydbcbyd;4:G:cjbH:bjjjbbaHc98fgHc989hmbxvkkcbh3a8Saq9pmbamydwaCaiaLcx2fgzydbcetf8Vebcs4aCazcwfydbcetf8Vebcs4faCazclfydbcetf8Vebcs4ffaw9nmekcbhzcbhsdna8ZTmbcbhsamczfhXinamczfascdtfaXydbgQBdbaXclfhXasaYaQfRbbTfhsa8Zcufg8ZmbkkamydwhlamydbhXam9cu83i:GDam9cu83i:ODam9cu83i:qDam9cu83i:yDinamcjDfazfcFFF;7rBdbazclfgzcz9hmbkasc;8easclfc:bd6Eg8Zcdth80dnalTmbaeaXcdtfhocbhrindnaHaoarcdtfydbcdtgzfydbgvTmbaAaOazfydbcdtfhscuhQcuhzinaHaiasydbgKcx2fgXclfydbcdtfydbaHaXydbcdtfydbfaHaXcwfydbcdtfydbfgXazaXaz6gXEhzaKaQaXEhQasclfhsavcufgvmbkaQcuSmba8AaQcK2fgsIdwa8M:tgEaENasIdbay:tgEaENasIdla8N:tgEaENMM:rhEcbhsindndnazamc:qDfasfgvydbgX6mbazaX9hmeaEamcjDfasfIdb9FTmekavazBdbamc:GDfasfaQBdbamcjDfasfaEUdbxdkasclfgscz9hmbkkarcefgral9hmbkkamczfa80fhQcbhzcbhsindnamc:GDfazfydbgXcuSmbaQascdtfaXBdbascefhskazclfgzcz9hmbkasa8Zfg8ZTmbJFFuuhhcuhKamczfhza8ZhvcuhQina8AazydbgXcK2fgsIdwa8M:tgEaENasIdbay:tgEaENasIdla8N:tgEaENMM:rhEdndnaHaiaXcx2fgsclfydbcdtfydbaHasydbcdtfydbfaHascwfydbcdtfydbfgsaQ6mbasaQ9hmeaEah9DTmekaEhhashQaXhKkazclfhzavcufgvmbkaKcuSmbaKhLkdnamaiaLcx2fgrydbarclfydbarcwfydbaCabaeadaPawaqa3z:fjjjbTmbaPcefhPJbbbbhRJbbbbh8UJbbbbh8VJbbbbh8WJbbbbh8XJbbbbh8YkcbhXinaAaOaraXcdtfydbcdtgsfydbcdtfgKhzaHasfgvydbgQhsdnaQTmbdninazydbaLSmeazclfhzascufgsTmdxbkkazaKaQcdtfc98fydbBdbavavydbcufBdbkaXcefgXci9hmbka8AaLcK2fgzIdbhEazIdlhhazIdwh8KazIdxh5azIdzh8EazIdCh8FaYaLfce86bba8Ya8FMh8Ya8Xa8EMh8Xa8Wa5Mh8Wa8Va8KMh8Va8UahMh8UaRaEMhRamydxh8Sxbkkamc:WDf8KjjjjbaPkjoivuv99lu8Jjjjjbca9Rgo8Kjjjjbdndnalcw0mbaiydbhraeabcitfgwalcdtciVBdlawarBdbdnalcd6mbaiclfhralcufhDawcxfhwinarydbhqawcuBdbawc98faqBdbawcwfhwarclfhraDcufgDmbkkalabfhwxekcbhqaocbBdKao9cb83izaocbBdwao9cb83ibJbbjZhkJbbjZhxinadaiaqcdtfydbcK2fhDcbhwinaoczfawfgraDawfIdbgmarIdbgP:tgsaxNaPMgPUdbaoawfgrasamaP:tNarIdbMUdbawclfgwcx9hmbkJbbjZakJbbjZMgk:vhxaqcefgqal9hmbkcbhradcbcecdaoIdlgmaoIdwgP9GEgwaoIdbgsaP9GEawasam9GEgzcdtgwfhHaoczfawfIdbhmaihwalhDinaiarcdtfgqydbhOaqawydbgABdbawaOBdbawclfhwaraHaAcK2fIdbam9DfhraDcufgDmbkdndnarcv6mbavc8X9kmbaralc98f6mekaiydbhraeabcitfgwalcdtciVBdlawarBdbaiclfhralcufhDawcxfhwinarydbhqawcuBdbawc98faqBdbawcwfhwarclfhraDcufgDmbkalabfhwxekaeabcitfgwamUdbawawydlc98GazVBdlabcefaeadaiaravcefgqz:djjjbhDawawydlciGaDabcu7fcdtVBdlaDaeadaiarcdtfalar9Raqz:djjjbhwkaocaf8Kjjjjbawk;Oddvue99dninabaecitfgrydlgwcd4gDTmednawciGgqci9hmbcihqdnawcl6mbabaecitfhbcbheawhqcehkindnaiabydbgDfRbbmbcbhkadaDcK2fgwIdwalIdw:tgxaxNawIdbalIdb:tgxaxNawIdlalIdl:tgxaxNMM:rgxaoIdb9DTmbaoaxUdbavaDBdbarydlhqkabcwfhbaecefgeaqcd46mbkakceGTmikaraqciGBdlskdnabcbaDalaqcdtfIdbarIdb:tgxJbbbb9FEgwaD7aecefgDfgecitfydlabawaDfgDcitfydlVci0mbaraqBdlkabaDadaialavaoz:ejjjbax:laoIdb9Fmbkkkjlevudndnabydwgxaladcetfgm8Vebcs4alaecetfgP8Vebgscs4falaicetfgz8Vebcs4ffaD0mbakmbcbhDabydxaq6mekavawcltfgxab8Pdw83dwaxab8Pdb83dbabydbhDdnabydwgwTmbaoaDcdtfhxawhsinalaxydbcetfcFFi87ebaxclfhxascufgsmbkkabaDawfBdbabydxhxab9cb83dwababydlaxci2fBdlaP8VebhscehDcbhxkdnascztcz91cu9kmbabaxcefBdwaPax87ebaoabydbcdtfaxcdtfaeBdbkdnam8Uebcu9kmbababydwgxcefBdwamax87ebaoabydbcdtfaxcdtfadBdbkdnaz8Uebcu9kmbababydwgxcefBdwazax87ebaoabydbcdtfaxcdtfaiBdbkarabydlfabydxci2faPRbb86bbarabydlfabydxci2fcefamRbb86bbarabydlfabydxci2fcdfazRbb86bbababydxcefBdxaDk:mPrHue99eue99eue99iu8Jjjjjbc;W;Gb9Rgx8KjjjjbdndnalmbcbhmxekcbhPaxc:m;Gbfcbc;Kbz:rjjjb8Aaxcualci9UgscltascjjjjiGEcbyd;0:G:cjbHjjjjbbgzBd:m9GaxceBd;S9GaxcuascK2gHcKfalcpFFFe0Ecbyd;0:G:cjbHjjjjbbgOBd:q9GaxcdBd;S9Gdnalci6gAmbarcd4hCascdthXaOhQazhLinavaiaPcx2fgrydwaC2cdtfhKavarydlaC2cdtfhYavarydbaC2cdtfh8AcbhraLhEinaQarfgma8Aarfg3Idbg5aYarfg8EIdbg8Fa5a8F9DEg5UdbamaKarfgaIdbg8Fa5a8Fa59DEg8FUdbamcxfgma3Idbg5a8EIdbgha5ah9EEg5UdbamaaIdbgha5aha59EEg5UdbaEa8Fa5MJbbbZNUdbaEaXfhEarclfgrcx9hmbkaQcKfhQaLclfhLaPcefgPas9hmbkkaOaHfgr9cb83dbar9cb83dzar9cb83dwaxcuascx2gralc:bjjjl0Ecbyd;0:G:cjbHjjjjbbgHBdN9GaxciBd;S9GascdthgazarfhvaxcwVhPaxclVhCaHh8Jazh8KcbhLinaxcbcj;Gbz:rjjjbhEaLas2cdthadnaAmba8Khrash3inaEarydbgmc8F91cjjjj94Vam7gmcQ4cx2fg8Ea8EydwcefBdwaEamcd4cFrGcx2fg8Ea8EydbcefBdbaEamcx4cFrGcx2fgmamydlcefBdlarclfhra3cufg3mbkkazaafh8AaHaafhXcbhmcbh3cbh8EcbhainaEamfgrydbhQara3BdbarcwfgKydbhYaKaaBdbarclfgrydbhKara8EBdbaQa3fh3aYaafhaaKa8Efh8Eamcxfgmcj;Gb9hmbkdnaAmbcbhravhminamarBdbamclfhmasarcefgr9hmbkavhrashminaEa8Aarydbg3cdtfydbg8Ec8F91a8E7cd4cFrGcx2fg8Ea8Eydbg8EcefBdbaXa8Ecdtfa3Bdbarclfhramcufgmmbka8JhrashminaCa8Aarydbg3cdtfydbg8Ec8F91a8E7cx4cFrGcx2fg8Ea8Eydbg8EcefBdbava8Ecdtfa3BdbarclfhramcufgmmbkavhrashminaPa8Aarydbg3cdtfydbg8Ec8F91cjjjj94Va8E7cQ4cx2fg8Ea8Eydbg8EcefBdbaXa8Ecdtfa3Bdbarclfhramcufgmmbkka8Jagfh8Ja8Kagfh8KaLcefgLci9hmbkaEaocetgrcuaocu9kEcbyd;0:G:cjbHjjjjbbgKBd:y9GaEclBd;S9Gdndnaoal9nmbaihralhminaKarydbcetfcFFi87ebarclfhramcufgmmbxdkkaKcFearz:rjjjb8Akcbh8EaEascbyd;0:G:cjbHjjjjbbg8ABd:C9GaOaHaHascdtfaHascitfa8AascbazaKaiawaDaqakz:hjjjbdndnalci6mba8Ahrashmina8EarRbbfh8EarcefhramcufgmmbkaE9cb83iwaE9cb83ibalawc9:fgrfcufar9UgrasaDfcufaD9Ugmaram0EhYcbhmcbhra8Ehaincbh3dnarTmba8AarfRbbceSh3kamaEaiaHydbcx2fgQydbaQclfydbaQcwfydbaKabaeadamawaqa3a3ce7a8EaY9nVaaamfaY6VGz:fjjjbfhmaHclfhHaaa8AarfRbb9Rhaasarcefgr9hmbkaEydxTmeabamcltfgraE8Piw83dwaraE8Pib83dbamcefhmxekaE9cb83iwaE9cb83ibcbhmkczhrinaEc:m;Gbfarfydbcbyd;4:G:cjbH:bjjjbbarc98fgrc989hmbkkaxc;W;Gbf8Kjjjjbamk:wKDQue99iue99iul9:euw99iu8Jjjjjbc;qb9RgP8Kjjjjbaxhsaxhzdndnavax0gHmbdnavTmbcbhOaehzavhAinawaDazydbcx2fgCcwfydbcetfgX8VebhQawaCclfydbcetfgL8VebhKawaCydbcetfgC8VebhYaXce87ebaLce87ebaCce87ebaOaKcs4aYcs4faQcs4ffhOazclfhzaAcufgAmbkaehzavhAinawaDazydbcx2fgCcwfydbcetfcFFi87ebawaCclfydbcetfcFFi87ebawaCydbcetfcFFi87ebazclfhzaAcufgAmbkcehzaqhsaOaq0mekalce86bbalcefcbavcufz:rjjjb8AxekaPaiBdxaPadBdwaPaeBdlavakaqci9Ug8Aaka8Aak6EaHEgK9RhEaxaK9Rh3aKcufh5aKceth8EaKcdtgCc98fh8FavcitgOaC9Rarfc98fhaascufhhavcufhgaraOfh8JJbbjZas:Y:vh8KcbazceakaxSEg8Lcdtg8M9Rh8NJFFuuhycuh8PcbhIcbh8RinaPclfa8RcdtfydbhQaPcb8Pd:y:G:cjbg8S83i9iaPcb8Pd:q:G:cjbgR83inaPcb8Pd1:G:cjbg8U83iUaPcb8Pdj:G:cjbg8V83i8WaPa8S83iyaPaR83iaaPa8U83iKaPa8V83izaQavcdtgYfh8WcbhXinabaQaXcdtgLfydbcK2fhAcbhzinaPc8WfazfgCaAazfgOIdbg8XaCIdbg8Ya8Xa8Y9DEUdbaCczfgCaOcxfIdbg8XaCIdbg8Ya8Xa8Y9EEUdbazclfgzcx9hmbkaba8WaXcu7cdtfydbcK2fhAcbhzaPIdUh8ZaPId9ih80aPId80h81aPId9ehBaPId8Wh83aPIdnhUinaPczfazfgCaAazfgOIdbg8XaCIdbg8Ya8Xa8Y9DEUdbaCczfgCaOcxfIdbg8XaCIdbg8Ya8Xa8Y9EEUdbazclfgzcx9hmbkaraLfgza80a8Z:tg8XaUa83:tg8YNa8YaBa81:tg8ZNa8Za8XNMMUdbazaYfaPIdyaPIdK:tg8XaPIdaaPIdz:tg8YNa8YaPId8KaPIdC:tg8ZNa8Za8XNMMUdbaXcefgXav9hmbkcbh85dnaHmbcbhAaQhza8JhCavhXinawaDazydbcx2fgOcwfydbcetfgL8Vebh8WawaOclfydbcetfg858Vebh86awaOydbcetfgO8Vebh87aLce87eba85ce87ebaOce87ebaCaAa86cs4a87cs4fa8Wcs4ffgABdbazclfhzaCclfhCaXcufgXmbkavhCinawaDaQydbcx2fgzcwfydbcetfcFFi87ebawazclfydbcetfcFFi87ebawazydbcetfcFFi87ebaQclfhQaCcufgCmbka8Jh85kdndndndndndndndndndndnava8E6mba8Eax9nmeavavaK9UgzaK29Raza320mda5aE9pmqa85Th87ceh8WaEhQxwka5ag9pmDa8Eax9nmixokavaK6mea5aE9pmwcehQaEhXa85Tmixlka5ag6mlxrka5ag9pmokcbhQaghXa85mekJFFuuh8XcbhLa5hzindnazcefgCaK6mbaQavaC9RgOaK6GmbarazcdtfIdbg8YaC:YNaravaz9RcdtfaYfc94fIdbg8ZaO:YNMg80a8X9Embdndna8KaOahf:YNg81:lJbbb9p9DTmba81:OhAxekcjjjj94hAka8ZasaA2aO9R:YNh8Zdndna8Kazasf:YNg81:lJbbb9p9DTmba81:OhOxekcjjjj94hOkamasaO2aC9R:Ya8YNa8ZMNa80Mg8Ya8Xa8Ya8X9DgOEh8XaCaLaOEhLkaza8LfgzaX6mbxlkkJFFuuh8XcbhLaEhCaahAa8FhOaKhzindnazaK6mbaQaCaK6GmbaraOfIdbg8Yaz:YNaAIdbg8ZaC:YNMg80a8X9Embdndna8Ka85aOfydbgYahf:YNg81:lJbbb9p9DTmba81:Oh8Wxekcjjjj94h8Wkamasa8W2aY9R:Yg81a8YNa8Za81NMNa80Mg8Ya8Xa8Ya8X9DgYEh8XazaLaYEhLkaCa8L9RhCaAa8NfhAaOa8MfhOaza8LfgzcufaX6mbxikka85Th87cbh8WaghQkJFFuuh8XcbhLaEhCaahAa8FhOaKhzindnazazaK9UgXaK29RaXa320mbdna8WTmbaCaCaK9UgXaK29RaXa320mekaraOfIdbg8Yaz:YNaAIdbg8ZaC:YNMg80a8X9EmbazhXaChYdna87mba85aOfydbgXhYkdndna8KaYahf:YNg81:lJbbb9p9DTmba81:Oh86xekcjjjj94h86ka8Zasa862aY9R:YNh8Zdndna8KaXahf:YNg81:lJbbb9p9DTmba81:OhYxekcjjjj94hYkamasaY2aX9R:Ya8YNa8ZMNa80Mg8Ya8Xa8Ya8X9DgXEh8XazaLaXEhLkaCa8L9RhCaAa8NfhAaOa8MfhOaza8LfgzcufaQ6mbkkaLTmba8Xay9DTmba8XhyaLhIa8Rh8Pka8Rcefg8Rci9hmbkdndnaoc8X9kmba8Pcb9omeka8Acufh85cbhYindndndnavaY9RaxaYaxfav0Eg8WTmbcbhAaeaYcdtfgzhCa8WhXinawaDaCydbcx2fgOcwfydbcetfgQ8VebhbawaOclfydbcetfgL8VebhrawaOydbcetfgO8VebhKaQce87ebaLce87ebaOce87ebaAarcs4aKcs4fabcs4ffhAaCclfhCaXcufgXmbka8WhOinawaDazydbcx2fgCcwfydbcetfcFFi87ebawaCclfydbcetfcFFi87ebawaCydbcetfcFFi87ebazclfhzaOcufgOmbkaAaq0mekalaYfgzce86bbazcefcba8Wcufz:rjjjb8AxekalaYfgzce86bbazcefcba85z:rjjjb8Aa8Ah8Wka8WaYfgYav9pmdxbkkaravcdtg8WfhLdnaITmbaPclfa8PcdtfydbhzaIhCinaLazydbfcb86bbazclfhzaCcufgCmbkkdnavaI9nmbaPclfa8PcdtfydbaIcdtfhzavaI9RhCinaLazydbfce86bbazclfhzaCcufgCmbkkcbhYindnaYa8PSmbcbhzaraPclfaYcdtfydbgKa8Wz:qjjjbhCavhXaIhOinaKaOazaLaCydbgQfRbbgAEcdtfaQBdbaCclfhCaOaAfhOazaA9RcefhzaXcufgXmbkkaYcefgYci9hmbkabaeadaialaIaocefgCarawaDaqakaxamz:hjjjbabaeaIcdtgzfadazfaiazfalaIfavaI9RaCarawaDaqakaxamz:hjjjbkaPc;qbf8Kjjjjbk:Seeru8Jjjjjbc:q;ab9Rgo8Kjjjjbaoc:q8WfcFecjzz:rjjjb8AcbhrdnadTmbaehwadhDinaoarcdtfawydbgqBdbaoc:q8WfaqcFiGcdtfgkydbhxakaqBdbawclfhwaraxaq9hfhraDcufgDmbkkabaeadaoaraiavz:jjjjbaoc:q;abf8Kjjjjbk;Sqloud99euD998Jjjjjbc:W;ab9Rgr8KjjjjbdndnadTmbaocd4hwcbhDcbhqindnavaeclfydbaw2cdtfgkIdbavaeydbaw2cdtfgxIdbgm:tgPavaecwfydbaw2cdtfgsIdlaxIdlgz:tgHNakIdlaz:tgOasIdbam:tgAN:tgCaCNaOasIdwaxIdwgX:tgQNakIdwaX:tgOaHN:tgHaHNaOaANaPaQN:tgPaPNMMgOJbbbb9Bmbarc8WfaDcltfgkaCaO:rgO:vgCUdwakaPaO:vgPUdlakaHaO:vgHUdbakaCaXNaHamNazaPNMM:mUdxaDcefhDkaecxfheaqcifgqad6mbkab9cb83dyab9cb83daab9cb83dKab9cb83dzab9cb83dwab9cb83dbaDTmearcbBd8Sar9cb83iKar9cb83izarczfavalaoarc8Sfcbcraiz:kjjjbarIdKhQarIdChLarIdzhKar9cb83iwar9cb83ibararc8WfaDczarc8Sfcbcicbz:kjjjbJbbbbhmdnarIdwgzazNarIdbgHaHNarIdlgXaXNMMgCJbbbb9BmbJbbjZaC:r:vhmkazamNhCaXamNhXaHamNhHJbbjZhmarc8WfheaDhvinaecwfIdbaCNaeIdbaHNaXaeclfIdbNMMgzamazam9DEhmaeczfheavcufgvmbkabaQUdwabaLUdlabaKUdbabarId3UdxdndnamJ;n;m;m899FmbJbbbbhzarc8WfheinaecxfIdbaQaecwfIdbgPNaKaeIdbgONaLaeclfIdbgANMMMaCaPNaHaONaXaANMM:vgPazaPaz9EEhzaeczfheaDcufgDmbkabaCUd8KabaXUdaabaHUd3abaQaCazN:tUdKabaLaXazN:tUdCabaKaHazN:tUdzabJbbjZamamN:t:rgmUdydndnaCJbbj:;aCJbbj:;9GEgzJbbjZazJbbjZ9FEJbb;:9cNJbbbZJbbb:;aCJbbbb9GEMgz:lJbbb9p9DTmbaz:Ohexekcjjjj94hekabae86b8UdndnaXJbbj:;aXJbbj:;9GEgzJbbjZazJbbjZ9FEJbb;:9cNJbbbZJbbb:;aXJbbbb9GEMgz:lJbbb9p9DTmbaz:Ohvxekcjjjj94hvkabav86bRdndnaHJbbj:;aHJbbj:;9GEgzJbbjZazJbbjZ9FEJbb;:9cNJbbbZJbbb:;aHJbbbb9GEMgz:lJbbb9p9DTmbaz:Ohwxekcjjjj94hwkabaw86b8SdndnaecKtcK91:YJbb;:9c:vaC:t:lavcKtcK91:YJbb;:9c:vaX:t:lawcKtcK91:YJbb;:9c:vaH:t:lamMMMJbb;:9cNJbbjZMgm:lJbbb9p9DTmbam:Ohexekcjjjj94hekaecFbaecFb9iEhexekabcjjj;8iBdycFbhekabae86b8Vxekab9cb83dyab9cb83daab9cb83dKab9cb83dzab9cb83dwab9cb83dbkarc:W;abf8Kjjjjbk;7woDuo99eue99euv998Jjjjjbcje9Rgw8Kjjjjbawc;abfcbaocdtgDz:rjjjb8Aawc;GbfcbaDz:rjjjb8AawcafhDawhqaohkinaqcFFF97BdbaDcFFF;7rBdbaqclfhqaDclfhDakcufgkmbkavcd4hxaicd4hmdnadTmbaocx2hPcbhsinashzdnarTmbarascdtfydbhzkaeazam2cdtfgDIdwhHaDIdlhOaDIdbhAalazax2cdtfIdbhCcbhDawcafhqawc;Gbfhvawhkawc;abfhiinaCaDc:O:G:cjbfIdbaHNaDc:G:G:cjbfIdbaANaDc:K:G:cjbfIdbaONMMgXMhQazhLdnaXaC:tgXaqIdbgK9DgYmbavydbhLkavaLBdbazhLdnaQakIdbg8A9EmbaiydbhLa8AhQkaiaLBdbakaQUdbaqaXaKaYEUdbaiclfhiakclfhkavclfhvaqclfhqaPaDcxfgD9hmbkascefgsad9hmbkkJbbbbhQcbhLawc;GbfhDawc;abfhqcbhkinalaqydbgvax2cdtfIdbalaDydbgiax2cdtfIdbaeavam2cdtfgvIdwaeaiam2cdtfgiIdw:tgCaCNavIdbaiIdb:tgCaCNavIdlaiIdl:tgCaCNMM:rMMgCaQaCaQ9EgvEhQakaLavEhLaqclfhqaDclfhDaoakcefgk9hmbkJbbbbhCdnaeawc;abfaLcdtgqfydbgkam2cdtfgDIdwaeawc;Gbfaqfydbgvam2cdtfgqIdwgH:tgXaXNaDIdbaqIdbgA:tg8Aa8ANaDIdlaqIdlgE:tgOaONMMgKJbbbb9ETmbaK:rgCalakax2cdtfIdbMalavax2cdtfIdb:taCaCM:vhCkaQJbbbZNhKaXaCNaHMhHaOaCNaEMhOa8AaCNaAMhAdnadTmbcbhqarhkinaqhDdnarTmbakydbhDkdnalaDax2cdtfIdbg3aeaDam2cdtfgDIdwaH:tgQaQNaDIdbaA:tgCaCNaDIdlaO:tgXaXNMMg5:rgEMg8EaK9ETmbJbbbbh8Adna5Jbbbb9ETmba8EaK:taEaEM:vh8Aka8AaQNaHMhHa8AaXNaOMhOa8AaCNaAMhAa3aKaEMMJbbbZNhKkakclfhkadaqcefgq9hmbkkabaKUdxabaHUdwabaOUdlabaAUdbawcjef8Kjjjjbk:reevu8Jjjjjbcj8W9Rgr8Kjjjjbaici2hwcbhDdnaiTmbarhiawhqinaiaeadRbbgkcdtfydbBdbaDakcefgkaDak0EhDaiclfhiadcefhdaqcufgqmbkkabarawaeaDalaoz:jjjjbarcj8Wf8Kjjjjbk:Eeeeu8Jjjjjbca9Rgo8Kjjjjbab9cb83dyab9cb83daab9cb83dKab9cb83dzab9cb83dwab9cb83dbdnadTmbaocbBd3ao9cb83iwao9cb83ibaoaeadaialaoc3falEavcbalEcrcbz:kjjjbabao8Pib83dbabao8Piw83dwkaocaf8Kjjjjbk::meQu8Jjjjjbcjz9Rgv8KjjjjbcbhoavcjPfcbaez:rjjjb8Aavcjxfcbaez:rjjjb8AdnaiTmbadhoaihrinavcjxfaoRbbfgwawRbbcef86bbavcjxfaocefRbbfgwawRbbcef86bbavcjxfaocdfRbbfgwawRbbcef86bbaocifhoarcufgrmbkcbhDcjehoadhqcehkindndnalTmbcbhxcuhmaqhrakhwcuhPinawcufamaoavcjPfarcefRbbgsfRbb9RcFeGgzci6aoavcjPfarRbbgHfRbb9RcFeGgOci6faoavcjPfarcdfRbbgAfRbb9RcFeGgCci6fgXcOtaOcFr7azaCf9RcwtVavcjxfaAfRbbgzavcjxfaHfRbbgHavcjxfasfRbbgsaHas6Egsazas6EcFe7VgsaP9kgzEhmaXcd6gHaxcefgOal9iVce9hmdasaPazEhPaxaOaHEhxarcifhrawai6hsawcefhwasmbxdkkcuhmaqhrakhwcuhxinawcufamaoavcjPfarcefRbbfRbb9RcFeGci6aoavcjPfarRbbfRbb9RcFeGci6faoavcjPfarcdfRbbfRbb9RcFeGci6fgPax9kgsEhmaPce0meaPaxasEhxarcifhrawai6hPawcefhwaPmbkkadamci2fgrcdfRbbhwarcefRbbhxarRbbhPadaDci2fgrcifaramaD9Rci2zNjjjb8AaPavcjPffaocefgo86bbaPavcjxffgmamRbbcuf86bbaxavcjPffao86bbaxavcjxffgmamRbbcuf86bbarcdfaw86bbarcefax86bbaraP86bbawavcjPffao86bbawavcjxffgrarRbbcuf86bbaqcifhqakcefhkaDcefgDai9hmbkcbhzdnalcb9mmbcbhsavcjPfcbaez:rjjjb8Aadcvfhlinadasci2fgxcefgDRbbhoaxcdfgqRbbhrdndnavcjPfaxRbbgmfRbbmbavcjPfarfRbbhwdndndnavcjPfaofRbbTmbawcFeGTmexikawcFeGmdascefgAai9pmdasc980mdascifhQcbhLarcFeGhCamcFeGhXalhwcbhKcbhYinawcufRbbhPawRbbhOcehkdndnawc9:fRbbgHao9hmbaPcFeGamSmekdnaPcFeGao9hmbaOcFeGamSmekaHamSaOcFeGaoSGhkkceh8AaYceGhYdndnaHar9hmbaPcFeGaoSmekdnaPcFeGar9hmbaOcFeGaoSmekaHaoSaOcFeGarSGh8AkakaYVhYaLaHcFeGgHaXSaPcFeGgPaCSGaPaXSaOcFeGgPaCSGVaHaCSaPaXSGVVhLa8AaKceGVhKdnaAcefgPai9pmbawcifhwaAaQ6hHaPhAaHmekkaYTmeaKmekarhwaohPaohHarhOamhrxdkdnaYTaLVceGTmbaYaKTVaLVceGmekamhwarhParhHamhOaohrxekaohwamhPamhHaohOkavcjPfarfce86bbavcjPfawfce86bbaxaH86bbaqar86bbaDaO86bbavcjPfaPfce86bbalcifhlascefgsai9hmbkkavcFeaecetz:rjjjbhwaici2hrindnawadRbbgmcetfgx8Uebgocu9kmbaxaz87ebawcjlfazcdtfabamcdtfydbBdbazhoazcefhzkadao86bbadcefhdarcufgrmbkazcdthokabavcjlfaoz:qjjjb8Aavcjzf8KjjjjbkObabaiaeadcbz:njjjbk9teiucbcbyd;8:G:cjbgeabcifc98GfgbBd;8:G:cjbdndnabZbcztgd9nmbcuhiabad9RcFFifcz4nbcuSmekaehikaik;LeeeudndnaeabVciGTmbabhixekdndnadcz9pmbabhixekabhiinaiaeydbBdbaiclfaeclfydbBdbaicwfaecwfydbBdbaicxfaecxfydbBdbaeczfheaiczfhiadc9Wfgdcs0mbkkadcl6mbinaiaeydbBdbaeclfheaiclfhiadc98fgdci0mbkkdnadTmbinaiaeRbb86bbaicefhiaecefheadcufgdmbkkabk;aeedudndnabciGTmbabhixekaecFeGc:b:c:ew2hldndnadcz9pmbabhixekabhiinaialBdbaicxfalBdbaicwfalBdbaiclfalBdbaiczfhiadc9Wfgdcs0mbkkadcl6mbinaialBdbaiclfhiadc98fgdci0mbkkdnadTmbinaiae86bbaicefhiadcufgdmbkkabk9teiucbcbyd;8:G:cjbgeabcrfc94GfgbBd;8:G:cjbdndnabZbcztgd9nmbcuhiabad9RcFFifcz4nbcuSmekaehikaikTeeucbabcbyd;8:G:cjbge9Rcifc98GaefgbBd;8:G:cjbdnabZbcztge9nmbabae9RcFFifcz4nb8Akk:3qeludndnadch6mbadTmeabaead;8qbbabskabaeSmbdnaeadabfgi9Rcbadcet9R0mbadTmeabaead;8qbbabskaeab7ciGhldndndnabae9pmbdnalTmbadhvabhixikdnabciGmbadhvabhixdkadTmiabaeRbb86bbadcufhvdnabcefgiciGmbaecefhexdkavTmiabaeRbe86beadc9:fhvdnabcdfgiciGmbaecdfhexdkavTmiabaeRbd86bdadc99fhvdnabcifgiciGmbaecifhexdkavTmiabaeRbi86biabclfhiaeclfheadc98fhvxekdnalmbdnaiciGTmbadTmlabadcufgifglaeaifRbb86bbdnalciGmbaihdxekaiTmlabadc9:fgifglaeaifRbb86bbdnalciGmbaihdxekaiTmlabadc99fgifglaeaifRbb86bbdnalciGmbaihdxekaiTmlabadc98fgdfaeadfRbb86bbkadcl6mbdnadc98fgocxGcxSmbaocd4cefciGhiaec98fhlabc98fhvinavadfaladfydbBdbadc98fhdaicufgimbkkaocx6mbaec9Wfhvabc9WfhoinaoadfgicxfavadfglcxfydbBdbaicwfalcwfydbBdbaiclfalclfydbBdbaialydbBdbadc9Wfgdci0mbkkadTmdadhidnadciGglTmbaecufhvabcufhoadhiinaoaifavaifRbb86bbaicufhialcufglmbkkadcl6mdaec98fhlabc98fhvinavaifgecifalaifgdcifRbb86bbaecdfadcdfRbb86bbaecefadcefRbb86bbaeadRbb86bbaic98fgimbxikkavcl6mbdnavc98fglc3Gc3Smbavalcd4cefcrGgdcdt9RhvinaiaeydbBdbaeclfheaiclfhiadcufgdmbkkalc36mbinaiaeydbBdbaiclfaeclfydbBdbaicwfaecwfydbBdbaicxfaecxfydbBdbaiczfaeczfydbBdbaicCfaecCfydbBdbaicKfaecKfydbBdbaic3faec3fydbBdbaecafheaicafhiavc9Gfgvci0mbkkavTmbdndnavcrGgdmbavhlxekavc94GhlinaiaeRbb86bbaicefhiaecefheadcufgdmbkkavcw6mbinaiaeRbb86bbaicefaecefRbb86bbaicdfaecdfRbb86bbaicifaecifRbb86bbaiclfaeclfRbb86bbaicvfaecvfRbb86bbaicofaecofRbb86bbaicrfaecrfRbb86bbaicwfhiaecwfhealc94fglmbkkabkk:pedbcj:GdktFFuuFFuuFFuubbbbFFuFFFuFFFuFbbbbbbjZbbbbbbbbbbbbbbjZbbbbbbbbbbbbbbjZ86;nAZ86;nAZ86;nAZ86;nA:;86;nAZ86;nAZ86;nAZ86;nA:;86;nAZ86;nAZ86;nAZ86;nA:;bc;0:Gdkxebbbdbbbj:qbb",t=new Uint8Array([32,0,65,2,1,106,34,33,3,128,11,4,13,64,6,253,10,7,15,116,127,5,8,12,40,16,19,54,20,9,27,255,113,17,42,67,24,23,146,148,18,14,22,45,70,69,56,114,101,21,25,63,75,136,108,28,118,29,73,115]);if(typeof WebAssembly!="object")return{supported:!1};var n,i=WebAssembly.instantiate(r(e),{}).then(function(y){n=y.instance,n.exports.__wasm_call_ctors()});function r(y){for(var A=new Uint8Array(y.length),b=0;b<y.length;++b){var x=y.charCodeAt(b);A[b]=x>96?x-97:x>64?x-39:x+4}for(var T=0,b=0;b<y.length;++b)A[T++]=A[b]<60?t[A[b]]:(A[b]-60)*64+A[++b];return A.buffer.slice(0,T)}function o(y){if(!y)throw new Error("Assertion failed")}function s(y){return new Uint8Array(y.buffer,y.byteOffset,y.byteLength)}var a=48,c=16;function u(y,A){var b=y.meshlets[A*4+0],x=y.meshlets[A*4+1],T=y.meshlets[A*4+2],E=y.meshlets[A*4+3];return{vertices:y.vertices.subarray(b,b+T),triangles:y.triangles.subarray(x,x+E*3)}}function f(y,A,b,x,T,E,v,S,I,R){var O=n.exports.sbrk,L=n.exports.meshopt_buildMeshletsBound(A.length,E,v),_=O(L*c),C=O(A.length*4),w=O(A.length),D=O(A.byteLength),N=O(b.byteLength),F=new Uint8Array(n.exports.memory.buffer);F.set(s(A),D),F.set(s(b),N);var V=y(_,C,w,D,A.length,N,x,T,E,v,S,I,R);F=new Uint8Array(n.exports.memory.buffer);for(var B=F.subarray(_,_+V*c),j=new Uint32Array(B.buffer,B.byteOffset,B.byteLength/4).slice(),k=0;k<V;++k){var G=j[k*4+0],q=j[k*4+1],x=j[k*4+2],Q=j[k*4+3];n.exports.meshopt_optimizeMeshlet(C+G*4,w+q,Q,x)}var W=V?j[(V-1)*4+0]+j[(V-1)*4+2]:0,J=V?j[(V-1)*4+1]+j[(V-1)*4+3]*3:0,Z={meshlets:j,vertices:new Uint32Array(F.buffer,C,W).slice(),triangles:new Uint8Array(F.buffer,w,J).slice(),meshletCount:V};return O(_-O(0)),Z}function d(y){var A=new Float32Array(n.exports.memory.buffer,y,a/4);return{centerX:A[0],centerY:A[1],centerZ:A[2],radius:A[3],coneApexX:A[4],coneApexY:A[5],coneApexZ:A[6],coneAxisX:A[7],coneAxisY:A[8],coneAxisZ:A[9],coneCutoff:A[10]}}function p(y,A,b,x){var T=n.exports.sbrk,E=[],v=T(A.byteLength),S=T(y.vertices.byteLength),I=T(y.triangles.byteLength),R=T(a),O=new Uint8Array(n.exports.memory.buffer);O.set(s(A),v),O.set(s(y.vertices),S),O.set(s(y.triangles),I);for(var L=0;L<y.meshletCount;++L){var _=y.meshlets[L*4+0],C=y.meshlets[L*4+1],w=y.meshlets[L*4+3];n.exports.meshopt_computeMeshletBounds(R,S+_*4,I+C,w,v,b,x),E.push(d(R))}return T(v-T(0)),E}function g(y,A,b,x){var T=n.exports.sbrk,E=T(a),v=T(y.byteLength),S=T(A.byteLength),I=new Uint8Array(n.exports.memory.buffer);I.set(s(y),v),I.set(s(A),S),n.exports.meshopt_computeClusterBounds(E,v,y.length,S,b,x);var R=d(E);return T(E-T(0)),R}function m(y,A,b,x,T){var E=n.exports.sbrk,v=E(a),S=E(y.byteLength),I=x?E(x.byteLength):0,R=new Uint8Array(n.exports.memory.buffer);R.set(s(y),S),x&&R.set(s(x),I),n.exports.meshopt_computeSphereBounds(v,S,A,b,I,x?T:0);var O=d(v);return E(v-E(0)),O}return{ready:i,supported:!0,buildMeshlets:function(y,A,b,x,T,E){o(y.length%3==0),o(A instanceof Float32Array),o(A.length%b==0),o(b>=3),o(x>=3&&x<=256),o(T>=1&&T<=512),E=E||0;var v=y.BYTES_PER_ELEMENT==4?y:new Uint32Array(y);return f(n.exports.meshopt_buildMeshletsFlex,v,A,A.length/b,b*4,x,T,T,E,0)},buildMeshletsFlex:function(y,A,b,x,T,E,v,S){o(y.length%3==0),o(A instanceof Float32Array),o(A.length%b==0),o(b>=3),o(x>=3&&x<=256),o(T>=1&&E<=512),o(T<=E),v=v||0,S=S||0;var I=y.BYTES_PER_ELEMENT==4?y:new Uint32Array(y);return f(n.exports.meshopt_buildMeshletsFlex,I,A,A.length/b,b*4,x,T,E,v,S)},buildMeshletsSpatial:function(y,A,b,x,T,E,v){o(y.length%3==0),o(A instanceof Float32Array),o(A.length%b==0),o(b>=3),o(x>=3&&x<=256),o(T>=1&&E<=512),o(T<=E),v=v||0;var S=y.BYTES_PER_ELEMENT==4?y:new Uint32Array(y);return f(n.exports.meshopt_buildMeshletsSpatial,S,A,A.length/b,b*4,x,T,E,v)},extractMeshlet:function(y,A){return o(A>=0&&A<y.meshletCount),u(y,A)},computeClusterBounds:function(y,A,b){o(y.length%3==0),o(y.length/3<=512),o(A instanceof Float32Array),o(A.length%b==0),o(b>=3);var x=y.BYTES_PER_ELEMENT==4?y:new Uint32Array(y);return g(x,A,A.length/b,b*4)},computeMeshletBounds:function(y,A,b){return o(A instanceof Float32Array),o(A.length%b==0),o(b>=3),p(y,A,A.length/b,b*4)},computeSphereBounds:function(y,A,b,x){return o(y instanceof Float32Array),o(y.length%A==0),o(A>=3),o(!b||b instanceof Float32Array),o(!b||b.length%x==0),o(!b||x>=1),o(!b||y.length/A==b.length/x),x=x||0,m(y,y.length/A,A*4,b,x*4)}}})();var HCn=(function(){var e="b9H79Tebbbegv9Geueu9Geub9Gbb9Gkuuuuuuuuuuub9Giuuueuirodiblbelve9Weiiviebeoweuecj:Gdkrnlo9TW9T9VV95dbH9F9F939H79T9F9J9H229F9Jt9VV7bbK9TW79O9V9Wt9F9NW9UWV9HtW9u9H9U9NW9Ut7bel79IV9RbdDwebcekdlvq;m8Lodbk:wgvOuw99iuv99vu8Jjjjjbc;Wb9Rgk8Kjjjjbakcxfcbc;Kbz:djjjb8AakcualcdtgxalcFFFFi0Ecbyd:q:G:cjbHjjjjbbgmBdxakceBd2adci9UhPalcd4alfhscehzinazgHcethzaHas6mbkakcuaHcdtgzaHcFFFFi0Ecbyd:q:G:cjbHjjjjbbgsBdzakcdBd2ascFeazz:djjjbhOaDcd4hAarcd4hCavcd4hXdnalTmbaHcufhrcbhvindndnaOcbaiavaX2cdtfgHydlgDaDcjjjj94SEgscH4cbaoavaC2cdtfgzydlgQcs4aQcjjjj94SE7as7c:F:b:DD2cbaHydbgLaLcjjjj94SEgscH4cbazydbgKcs4aKcjjjj94SE7as7c;D;O:B8J27cbaHydwgYaYcjjjj94SEgHcH4cbazydwg8Acs4a8Acjjjj94SE7aH7c:3F;N8N27awavaA2cdtfgHydlgEaHydbg37cFFFFrGgHcm4aH7c:fjjK27arGgscdtfgHydbgzcuSmbaE::h5a3::h8Ea8A::h8FaQ::haaK::hhaY::hgaD::h8JaL::h8KcehDinaDhHdnaiazaX2cdtfgDIdba8K9CmbaDIdla8J9CmbaDIdwag9CmbaoazaC2cdtfgDIdbah9CmbaDIdlaa9CmbaDIdwa8F9CmbawazaA2cdtfgDIdba8E9CmbaDIdla59BmikaHcefhDaOasaHfarGgscdtfgHydbgzcu9hmbkkaHavBdbavhzkamavcdtfazBdbavcefgval9hmbkkaOcbydN:G:cjbH:bjjjbbakceBd2akcualcefgHcdtaHcFFFFi0Ecbyd:q:G:cjbHjjjjbbg8LBdzakcdBd2akcuadcdtadcFFFFi0EgYcbyd:q:G:cjbHjjjjbbg8MBdCakciBd2a8Lclfcbaxz:djjjbhzdnadTmbdnaeTmbaehHadhsinazamaHydbcdtfydbcdtfgDaDydbcefBdbaHclfhHascufgsmbxdkkamhHadhsinazaHydbcdtfgDaDydbcefBdbaHclfhHascufgsmbkkdnalTmbcbhsazhHalhDinaHydbhOaHasBdbaHclfhHaOasfhsaDcufgDmbkkdnadci6gQmbcbhscdhHaPhOindndnaeTmbamaeasfgvydbcdtfhDamavcwfydbcdtfhramavclfydbcdtfhvxekamasfgDcwfhraDclfhvkarydbhravydbhvazaDydbcdtfgDaDydbgDcefBdba8MaDcdtfaHc9:fBdbazavcdtfgDaDydbgDcefBdba8MaDcdtfaHcufBdbazarcdtfgDaDydbgDcefBdba8MaDcdtfaHBdbascxfhsaHclfhHaOcufgOmbkkcbhsa8LcbBdbakcuaPcltadcFFFFd0Ecbyd:q:G:cjbHjjjjbbg8NBdKakclBd2dnaQmbaehza8NhHaPhvindndnaeTmbazcwfydbhDazclfydbhOazydbhrxekascdfhDascefhOashrkJbbbbh8KJbbbbJbbbbJbbbbJbbbbJbbjZJbbj:;awaOaA2cdtfgQIdbawaraA2cdtfgLIdbgh:tawaDaA2cdtfgKIdlaLIdlgg:tg8JNaQIdlag:tggaKIdbah:tN:tghJbbbb9EEahJbbbb9BEg8EaiaraX2cdtfgrIdwghaiaOaX2cdtfgOIdwg59BEa8EarIdlgaaOIdlgy9BEa8EarIdbg8FaOIdbg8P9BEg8EahaiaDaX2cdtfgDIdwgI9BEa8EaaaDIdlg8R9BEa8Ea8FaDIdbg8S9BEg8Ea5aI9BEa8Eaya8R9BEa8Ea8Pa8S9BEh8Edna8Ja5ah:tNagaIah:tN:tghahNa8Ja8Pa8F:tNaga8Sa8F:tN:tg8Fa8FNa8Jayaa:tNaga8Raa:tN:tg8Ja8JNMMggJbbbb9Bmba8Eag:r:vh8KkaHcxfa8EUdbaHcwfaha8KNUdbaHclfa8Ja8KNUdbaHa8Fa8KNUdbazcxfhzaHczfhHascifhsavcufgvmbkkcbhHakaYcbyd:q:G:cjbHjjjjbbgDBd3akcvBd2dnadTmbaDhzinazaHBdbazclfhzadaHcefgH9hmbkkakcuaPcdtadcFFFF970Ecbyd:q:G:cjbHjjjjbbgvBdaakcoBd2akaPcbyd:q:G:cjbHjjjjbbg8ABd8KakcrBd2dnadci6mba8NcxfhzavhscbhHinasaHBdba8AaHfcdcbazIdbg8KJbbbb9DEa8KJbbbb9EV86bbasclfhsazczfhzaPaHcefgH9hmbkkdnalTmbcbhRinaRcdthHdna8LaRcefgRcdtfydbgza8LaHfydbgHSmbazaH9RhLa8MaHcdtfhKcbh8UinaKa8Ucdtfg8VydbgHcd4g8Wci2gxaHciGcdtgzyd:e:G:cjbfhHaxazydj:G:cjbfhzdnaeTmbaeaHcdtfydbhHaeazcdtfydbhzkdna8Ucefg8UaL9pmbamaHcdtfydbhYamazcdtfydbh3a8Aa8WfhEava8Wcdtfh8Xa8UhwinaKawcdtfgQydbgHcd4gzci2gAaHciGcdtgHyd:e:G:cjbfhsaAaHydj:G:cjbfhHdnaeTmbaeascdtfydbhsaeaHcdtfydbhHkdndnamaHcdtfydbaYSmbamascdtfydba39hmeka8AazfRbbgHaERbbgsVciSmbdnaHasGmba8Whsdna8Wa8XydbgHSmba8XhOinaOavaHgscdtfgrydbgHBdbarhOasaH9hmbkkdnazavazcdtfgOydbgHSmbinaOavaHgzcdtfgrydbgHBdbarhOazaH9hmbkkasazSmba8AazfgORbba8AasfgHRbbVciSmeavazcdtfasBdbaHaHRbbaORbbV86bbkdna8VydbciGaxfgzaDazcdtfgsydbgHSmbinasaDaHgzcdtfgOydbgHBdbaOhsazaH9hmbkkdnaQydbciGaAfgsaDascdtfgOydbgHSmbinaOaDaHgscdtfgrydbgHBdbarhOasaH9hmbkkazasSmbaDascdtfazBdbkawcefgwaL9hmbkka8UaL9hmbkkaRal9hmbkkdnadTmbcbhrinarhzdnaraDarcdtfgwydbgHSmbawhsinasaDaHgzcdtfgOydbgHBdbaOhsazaH9hmbkkawazBdbarcefgrad9hmbkcbh8Vabcbadcltz:djjjbhKdnadci6mbaqceGhEaDhYaeh3cbh8Windna8Na8WcltfgsIdxJbbbb9Bmbama8Wcx2gHfhxaeaHfhLcbhza8Vhw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Ja8KNUdbaraha8KNUdbaHaga8KNg8JUdbavmbaHJbbjZa8Ja8KJbbbb9BEUdbkasclfhsaHczfhHadazcefgz9hmbkcbhHaKhzindnaHaDydbgsSmbazaKascltfgsydwBdwazas8Pdb83dbkaDclfhDazczfhzadaHcefgH9hmbkkdnakyd2gzTmbazcdtakcxffc98fhHinaHydbcbydN:G:cjbH:bjjjbbaHc98fhHazcufgzmbkkakc;Wbf8Kjjjjbk9teiucbcbyd:y:G:cjbgeabcifc98GfgbBd:y:G:cjbdndnabZbcztgd9nmbcuhiabad9RcFFifcz4nbcuSmekaehikaik;aeedudndnabciGTmbabhixekaecFeGc:b:c:ew2hldndnadcz9pmbabhixekabhiinaialBdbaicxfalBdbaicwfalBdbaiclfalBdbaiczfhiadc9Wfgdcs0mbkkadcl6mbinaialBdbaiclfhiadc98fgdci0mbkkdnadTmbinaiae86bbaicefhiadcufgdmbkkabk9teiucbcbyd:y:G:cjbgeabcrfc94GfgbBd:y:G:cjbdndnabZbcztgd9nmbcuhiabad9RcFFifcz4nbcuSmekaehikaikTeeucbabcbyd:y:G:cjbge9Rcifc98GaefgbBd:y:G:cjbdnabZbcztge9nmbabae9RcFFifcz4nb8Akkk8Rdbcj:Gdkzebbbdbbbbbbbebbbbc:q:Gdkxebbbdbbba:qbb",t=new Uint8Array([32,0,65,2,1,106,34,33,3,128,11,4,13,64,6,253,10,7,15,116,127,5,8,12,40,16,19,54,20,9,27,255,113,17,42,67,24,23,146,148,18,14,22,45,70,69,56,114,101,21,25,63,75,136,108,28,118,29,73,115]);if(typeof WebAssembly!="object")return{supported:!1};var n,i=WebAssembly.instantiate(r(e),{}).then(function(u){n=u.instance,n.exports.__wasm_call_ctors()});function r(u){for(var f=new Uint8Array(u.length),d=0;d<u.length;++d){var p=u.charCodeAt(d);f[d]=p>96?p-97:p>64?p-39:p+4}for(var g=0,d=0;d<u.length;++d)f[g++]=f[d]<60?t[f[d]]:(f[d]-60)*64+f[++d];return f.buffer.slice(0,g)}function o(u){if(!u)throw new Error("Assertion failed")}function s(u){return new Uint8Array(u.buffer,u.byteOffset,u.byteLength)}function a(u,f,d,p,g,m,y,A,b,x){var T=n.exports.sbrk,E=T(f*16),v=u?T(u.byteLength):0,S=T(d.byteLength),I=T(m.byteLength),R=T(A.byteLength),O=new Uint8Array(n.exports.memory.buffer);u&&O.set(s(u),v),O.set(s(d),S),O.set(s(m),I),O.set(s(A),R),n.exports.meshopt_generateTangents(E,v,f,S,p,g*4,I,y*4,R,b*4,x),O=new Uint8Array(n.exports.memory.buffer);var L=new Float32Array(O.buffer,E,f*4).slice();return T(E-T(0)),L}var c={Compatible:1,ZeroFallback:2};return{ready:i,supported:!0,generateTangents:function(u,f,d,p,g,m,y,A){o(u===null||u instanceof Uint32Array||u instanceof Int32Array||u instanceof Uint16Array||u instanceof Int16Array),o(u===null||u.length%3==0),o(f instanceof Float32Array),o(f.length%d==0),o(d>=3),o(p instanceof Float32Array),o(p.length%g==0),o(g>=3),o(m instanceof Float32Array),o(m.length%y==0),o(y>=2),o(f.length/d==p.length/g),o(f.length/d==m.length/y),o(u!==null||f.length/d%3==0);for(var b=0,x=0;x<(A?A.length:0);++x)o(A[x]in c),b|=c[A[x]];var T=f.length/d,E=u?u.length:T,v=u===null||u.BYTES_PER_ELEMENT==4?u:new Uint32Array(u);return a(v,E,f,T,d,p,g,m,y,b)}}})();var PK=class extends ar{constructor(t){super(),t=t??H.EMPTY_OBJECT;let n=t.resourceCache,i=t.gltf,r=t.bufferViewId,o=t.gltfResource,s=t.baseResource,a=t.cacheKey,c=i.bufferViews[r],u=c.buffer,f=c.byteOffset,d=c.byteLength,p=!1,g,m,y,A,b=Kb(c);l(b)&&(u=b.buffer,f=b.byteOffset??0,d=b.byteLength,p=!0,g=b.byteStride,m=b.count,y=b.mode,A=b.filter??"NONE");let x=i.buffers[u];this._hasMeshopt=p,this._meshoptByteStride=g,this._meshoptCount=m,this._meshoptMode=y,this._meshoptFilter=A,this._resourceCache=n,this._gltfResource=o,this._baseResource=s,this._buffer=x,this._bufferId=u,this._byteOffset=f,this._byteLength=d,this._cacheKey=a,this._bufferLoader=void 0,this._typedArray=void 0,this._state=Ct.UNLOADED,this._promise=void 0}get cacheKey(){return this._cacheKey}get typedArray(){return this._typedArray}async load(){return l(this._promise)?this._promise:(this._state=Ct.LOADING,this._promise=OYe(this),this._promise)}unload(){l(this._bufferLoader)&&!this._bufferLoader.isDestroyed()&&this._resourceCache.unload(this._bufferLoader),this._bufferLoader=void 0,this._typedArray=void 0}};async function OYe(e){try{let t=MYe(e);if(e._bufferLoader=t,await t.load(),e.isDestroyed())return;let n=t.typedArray,i=new Uint8Array(n.buffer,n.byteOffset+e._byteOffset,e._byteLength);if(e.unload(),e._typedArray=i,e._hasMeshopt){let r=e._meshoptCount,o=e._meshoptByteStride,s=new Uint8Array(r*o);ly.decodeGltfBuffer(s,r,o,e._typedArray,e._meshoptMode,e._meshoptFilter),e._typedArray=s}return e._state=Ct.READY,e}catch(t){if(e.isDestroyed())return;throw e.unload(),e._state=Ct.FAILED,e.getError("Failed to load buffer view",t)}}function MYe(e){let t=e._resourceCache,n=e._buffer;if(l(n.uri)){let o=e._baseResource.getDerivedResource({url:n.uri});return t.getExternalBufferLoader({resource:o})}let i=n.extras?._pipeline?.source;return t.getEmbeddedBufferLoader({parentResource:e._gltfResource,bufferId:e._bufferId,typedArray:i})}var lD=PK;var $b=class e{static _getDecoderTaskProcessor(){if(!l(e._decoderTaskProcessor)){let t=new $n("decodeDraco",e._maxDecodingConcurrency);t.initWebAssemblyModule({wasmBinaryFile:"ThirdParty/draco_decoder.wasm"}).then(function(n){n?e._taskProcessorReady=!0:e._error=new oe("Draco decoder could not be initialized.")}).catch(n=>{e._error=n}),e._decoderTaskProcessor=t}return e._decoderTaskProcessor}static decodePointCloud(t){let n=e._getDecoderTaskProcessor();if(l(e._error))throw e._error;if(e._taskProcessorReady)return n.scheduleTask(t,[t.buffer.buffer])}static decodeBufferView(t){let n=e._getDecoderTaskProcessor();if(l(e._error))throw e._error;if(e._taskProcessorReady)return n.scheduleTask(t,[t.array.buffer])}};$b._maxDecodingConcurrency=Math.max(dn.hardwareConcurrency-1,1);$b._decoderTaskProcessor=void 0;$b._taskProcessorReady=!1;$b._error=void 0;var uy=$b;var Rn={POSITION:"POSITION",NORMAL:"NORMAL",TANGENT:"TANGENT",TEXCOORD:"TEXCOORD",COLOR:"COLOR",JOINTS:"JOINTS",WEIGHTS:"WEIGHTS",FEATURE_ID:"_FEATURE_ID",SCALE:"KHR_gaussian_splatting:SCALE",ROTATION:"KHR_gaussian_splatting:ROTATION",CUMULATIVE_DISTANCE:"BENTLEY_materials_line_style:CUMULATIVE_DISTANCE"};function NYe(e){switch(e){case Rn.POSITION:return"positionMC";case Rn.NORMAL:return"normalMC";case Rn.TANGENT:return"tangentMC";case Rn.TEXCOORD:return"texCoord";case Rn.COLOR:return"color";case Rn.JOINTS:return"joints";case Rn.WEIGHTS:return"weights";case Rn.FEATURE_ID:return"featureId";case Rn.SCALE:return"scale";case Rn.ROTATION:return"rotation";case Rn.CUMULATIVE_DISTANCE:return"cumulativeDistance"}}Rn.hasSetIndex=function(e){switch(e){case Rn.POSITION:case Rn.NORMAL:case Rn.TANGENT:case Rn.CUMULATIVE_DISTANCE:return!1;case Rn.TEXCOORD:case Rn.COLOR:case Rn.JOINTS:case Rn.WEIGHTS:case Rn.FEATURE_ID:case Rn.SCALE:case Rn.ROTATION:return!0}};Rn.fromGltfSemantic=function(e){let t=e,i=/^(\w+)_\d+$/.exec(e);switch(i!==null&&(t=i[1]),t){case"POSITION":return Rn.POSITION;case"NORMAL":return Rn.NORMAL;case"TANGENT":return Rn.TANGENT;case"TEXCOORD":return Rn.TEXCOORD;case"COLOR":return Rn.COLOR;case"JOINTS":return Rn.JOINTS;case"WEIGHTS":return Rn.WEIGHTS;case"_FEATURE_ID":return Rn.FEATURE_ID;case"KHR_gaussian_splatting:SCALE":case"_SCALE":return Rn.SCALE;case"KHR_gaussian_splatting:ROTATION":case"_ROTATION":return Rn.ROTATION;case"BENTLEY_materials_line_style:CUMULATIVE_DISTANCE":return Rn.CUMULATIVE_DISTANCE}};Rn.fromPntsSemantic=function(e){switch(e){case"POSITION":case"POSITION_QUANTIZED":return Rn.POSITION;case"RGBA":case"RGB":case"RGB565":return Rn.COLOR;case"NORMAL":case"NORMAL_OCT16P":return Rn.NORMAL;case"BATCH_ID":return Rn.FEATURE_ID}};Rn.getGlslType=function(e){switch(e){case Rn.POSITION:case Rn.NORMAL:case Rn.TANGENT:return"vec3";case Rn.TEXCOORD:return"vec2";case Rn.COLOR:return"vec4";case Rn.JOINTS:return"ivec4";case Rn.WEIGHTS:return"vec4";case Rn.FEATURE_ID:return"int";case Rn.SCALE:return"vec3";case Rn.ROTATION:return"vec4";case Rn.CUMULATIVE_DISTANCE:return"float";case Rn.OPACITY:return"float"}};Rn.getVariableName=function(e,t){let n=NYe(e);return l(t)&&(n+=`_${t}`),n};Object.freeze(Rn);var ct=Rn;var DK=class extends ar{constructor(t){super(),t=t??H.EMPTY_OBJECT;let n=t.resourceCache,i=t.gltf,r=t.primitive,o=t.draco,s=t.gltfResource,a=t.baseResource,c=t.cacheKey;this._resourceCache=n,this._gltfResource=s,this._baseResource=a,this._gltf=i,this._primitive=r,this._draco=o,this._cacheKey=c,this._bufferViewLoader=void 0,this._bufferViewTypedArray=void 0,this._decodePromise=void 0,this._decodedData=void 0,this._state=Ct.UNLOADED,this._promise=void 0,this._dracoError=void 0}get cacheKey(){return this._cacheKey}get decodedData(){return this._decodedData}async load(){return l(this._promise)?this._promise:(this._state=Ct.LOADING,this._promise=LYe(this),this._promise)}process(t){if(this._state===Ct.READY)return!0;if(this._state!==Ct.PROCESSING||(l(this._dracoError)&&kme(this,this._dracoError),!l(this._bufferViewTypedArray))||l(this._decodePromise))return!1;let n=this._draco,i=this._primitive,r=this._gltf,o=r.bufferViews,s=n.bufferView,a=o[s],c=n.attributes,u=[];for(let p in i.attributes)if(i.attributes.hasOwnProperty(p)){let g=BYe(p);l(g)&&r.accessors[i.attributes[p]].componentType===Y.FLOAT&&(u.includes(g)||u.push(g))}let f={array:new Uint8Array(this._bufferViewTypedArray),bufferView:a,compressedAttributes:c,dequantizeInShader:!0,attributesToSkipTransform:u},d=uy.decodeBufferView(f);if(!l(d))return!1;this._decodePromise=FYe(this,d)}unload(){l(this._bufferViewLoader)&&this._resourceCache.unload(this._bufferViewLoader),this._bufferViewLoader=void 0,this._bufferViewTypedArray=void 0,this._decodedData=void 0,this._gltf=void 0,this._primitive=void 0}};async function LYe(e){let t=e._resourceCache;try{let n=t.getBufferViewLoader({gltf:e._gltf,bufferViewId:e._draco.bufferView,gltfResource:e._gltfResource,baseResource:e._baseResource});return e._bufferViewLoader=n,await n.load(),e.isDestroyed()?void 0:(e._bufferViewTypedArray=n.typedArray,e._state=Ct.PROCESSING,e)}catch(n){if(e.isDestroyed())return;kme(e,n)}}function kme(e,t){throw e.unload(),e._state=Ct.FAILED,e.getError("Failed to load Draco",t)}async function FYe(e,t){try{let n=await t;return e.isDestroyed()?void 0:(e.unload(),e._decodedData={indices:n.indexArray,vertexAttributes:n.attributeData},e._state=Ct.READY,e._baseResource)}catch(n){if(e.isDestroyed())return;e._dracoError=n}}var Jb={};Jb[ct.POSITION]="POSITION";Jb[ct.NORMAL]="NORMAL";Jb[ct.COLOR]="COLOR";Jb[ct.TEXCOORD]="TEX_COORD";function BYe(e){for(let t in Jb)if(Jb.hasOwnProperty(t)&&e.startsWith(t))return Jb[t]}var uD=DK;function kYe(e){let{uint8Array:t,format:n,request:i}=e,r=e.flipY??!1,o=e.skipColorSpaceConversion??!1,s=new Blob([t],{type:n}),a;return De.supportsImageBitmapOptions().then(function(c){return c?Promise.resolve(De.createImageBitmapFromBlob(s,{flipY:r,premultiplyAlpha:!1,skipColorSpaceConversion:o})):(a=window.URL.createObjectURL(s),new De({url:a,request:i}).fetchImage({flipY:r,skipColorSpaceConversion:o}))}).then(function(c){return l(a)&&window.URL.revokeObjectURL(a),c}).catch(function(c){return l(a)&&window.URL.revokeObjectURL(a),Promise.reject(c)})}var fy=kYe;var fD=class extends ar{constructor(t){super(),t=t??H.EMPTY_OBJECT;let n=t.resourceCache,i=t.gltf,r=t.imageId,o=t.gltfResource,s=t.baseResource,a=t.cacheKey,c=i.images[r],u=c.bufferView,f=c.uri;this._resourceCache=n,this._gltfResource=o,this._baseResource=s,this._gltf=i,this._bufferViewId=u,this._uri=f,this._cacheKey=a,this._bufferViewLoader=void 0,this._image=void 0,this._mipLevels=void 0,this._state=Ct.UNLOADED,this._promise=void 0}get cacheKey(){return this._cacheKey}get image(){return this._image}get mipLevels(){return this._mipLevels}load(){return l(this._promise)?this._promise:l(this._bufferViewId)?(this._promise=UYe(this),this._promise):(this._promise=zYe(this),this._promise)}unload(){l(this._bufferViewLoader)&&!this._bufferViewLoader.isDestroyed()&&this._resourceCache.unload(this._bufferViewLoader),this._bufferViewLoader=void 0,this._uri=void 0,this._image=void 0,this._mipLevels=void 0,this._gltf=void 0}};function Ume(e){let t;return Array.isArray(e)&&(t=e.slice(1,e.length).map(function(n){return n.bufferView}),e=e[0]),{image:e,mipLevels:t}}async function UYe(e){e._state=Ct.LOADING;let t=e._resourceCache;try{let n=t.getBufferViewLoader({gltf:e._gltf,bufferViewId:e._bufferViewId,gltfResource:e._gltfResource,baseResource:e._baseResource});if(e._bufferViewLoader=n,await n.load(),e.isDestroyed())return;let i=n.typedArray,r=await jYe(i);if(e.isDestroyed())return;let o=Ume(r);return e.unload(),e._image=o.image,e._mipLevels=o.mipLevels,e._state=Ct.READY,e}catch(n){return e.isDestroyed()?void 0:zme(e,n,"Failed to load embedded image")}}async function zYe(e){e._state=Ct.LOADING;let t=e._baseResource,n=e._uri,i=t.getDerivedResource({url:n});try{let r=await GYe(i);if(e.isDestroyed())return;let o=Ume(r);return e.unload(),e._image=o.image,e._mipLevels=o.mipLevels,e._state=Ct.READY,e}catch(r){return e.isDestroyed()?void 0:zme(e,r,`Failed to load image: ${n}`)}}function zme(e,t,n){return e.unload(),e._state=Ct.FAILED,Promise.reject(e.getError(n,t))}function VYe(e){let t=e.subarray(0,2),n=e.subarray(0,4),i=e.subarray(8,12);if(t[0]===255&&t[1]===216)return"image/jpeg";if(t[0]===137&&t[1]===80)return"image/png";if(t[0]===171&&t[1]===75)return"image/ktx2";if(n[0]===82&&n[1]===73&&n[2]===70&&n[3]===70&&i[0]===87&&i[1]===69&&i[2]===66&&i[3]===80)return"image/webp";throw new oe("Image format is not recognized")}async function jYe(e){let t=VYe(e);if(t==="image/ktx2"){let n=new Uint8Array(e);return nf(n)}return fD._loadImageFromTypedArray({uint8Array:e,format:t,flipY:!1,skipColorSpaceConversion:!0})}var HYe=/(^data:image\/ktx2)|(\.ktx2$)/i;function GYe(e){let t=e.getUrlComponent(!1,!0);return HYe.test(t)?nf(e):e.fetchImage({skipColorSpaceConversion:!0,preferImageBitmap:!0})}fD._loadImageFromTypedArray=fy;var dD=fD;var Vme={TEXTURE:0,PROGRAM:1,BUFFER:2,NUMBER_OF_JOB_TYPES:3};Object.freeze(Vme);var Xc=Vme;var RK=class extends ar{constructor(t){super(),t=t??H.EMPTY_OBJECT;let n=t.resourceCache,i=t.gltf,r=t.accessorId,o=t.gltfResource,s=t.baseResource,a=t.primitive,c=t.draco,u=t.cacheKey,f=t.asynchronous??!0,d=t.loadBuffer??!1,p=t.loadTypedArray??!1,g=i.accessors[r].componentType;this._resourceCache=n,this._gltfResource=o,this._baseResource=s,this._gltf=i,this._accessorId=r,this._indexDatatype=g,this._primitive=a,this._draco=c,this._cacheKey=u,this._asynchronous=f,this._loadBuffer=d,this._loadTypedArray=p,this._bufferViewLoader=void 0,this._dracoLoader=void 0,this._typedArray=void 0,this._buffer=void 0,this._state=Ct.UNLOADED,this._promise=void 0}get cacheKey(){return this._cacheKey}get buffer(){return this._buffer}get typedArray(){return this._typedArray}get indexDatatype(){return this._indexDatatype}async load(){return l(this._promise)?this._promise:l(this._draco)?(this._promise=qYe(this),this._promise):(this._promise=YYe(this),this._promise)}process(t){if(this._state===Ct.READY)return!0;if(this._state!==Ct.LOADED&&this._state!==Ct.PROCESSING)return!1;let n=this._typedArray,i=this._indexDatatype;if(l(this._dracoLoader))try{this._dracoLoader.process(t)&&(n=this._dracoLoader.decodedData.indices.typedArray,this._typedArray=n,i=Y.fromTypedArray(n),this._indexDatatype=i)}catch(o){MK(this,o)}if(!l(n))return!1;let r;if(this._loadBuffer&&this._asynchronous){let o=WYe;if(o.set(n,i,t.context),!t.jobScheduler.execute(o,Xc.BUFFER))return!1;r=o.buffer}else this._loadBuffer&&(r=jme(n,i,t.context));return this.unload(),this._buffer=r,this._typedArray=this._loadTypedArray?n:void 0,this._state=Ct.READY,this._resourceCache.statistics.addGeometryLoader(this),!0}unload(){l(this._buffer)&&this._buffer.destroy();let t=this._resourceCache;l(this._bufferViewLoader)&&!this._bufferViewLoader.isDestroyed()&&t.unload(this._bufferViewLoader),l(this._dracoLoader)&&t.unload(this._dracoLoader),this._bufferViewLoader=void 0,this._dracoLoader=void 0,this._typedArray=void 0,this._buffer=void 0,this._gltf=void 0,this._primitive=void 0}},OK=class{constructor(){this.typedArray=void 0,this.indexDatatype=void 0,this.context=void 0,this.buffer=void 0}set(t,n,i){this.typedArray=t,this.indexDatatype=n,this.context=i}execute(){this.buffer=jme(this.typedArray,this.indexDatatype,this.context)}};function jme(e,t,n){let i=tt.createIndexBuffer({typedArray:e,context:n,usage:Me.STATIC_DRAW,indexDatatype:t});return i.vertexArrayDestroyable=!1,i}var WYe=new OK;async function qYe(e){e._state=Ct.LOADING;let t=e._resourceCache;try{let n=t.getDracoLoader({gltf:e._gltf,primitive:e._primitive,draco:e._draco,gltfResource:e._gltfResource,baseResource:e._baseResource});return e._dracoLoader=n,await n.load(),e.isDestroyed()?void 0:(e._state=Ct.LOADED,e)}catch(n){if(e.isDestroyed())return;MK(e,n)}}async function YYe(e){let t=e._gltf,n=e._accessorId,r=t.accessors[n].bufferView;e._state=Ct.LOADING;let o=e._resourceCache;try{let s=o.getBufferViewLoader({gltf:t,bufferViewId:r,gltfResource:e._gltfResource,baseResource:e._baseResource});if(e._bufferViewLoader=s,await s.load(),e.isDestroyed())return;let a=s.typedArray;return e._typedArray=XYe(e,a),e._state=Ct.PROCESSING,e}catch(s){if(e.isDestroyed())return;MK(e,s)}}function XYe(e,t){let n=e._gltf,i=e._accessorId,r=n.accessors[i],o=r.count,s=r.componentType,a=je.getSizeInBytes(s),c=t.buffer,u=t.byteOffset+r.byteOffset;if(u%a!==0){let d=o*a,p=new Uint8Array(c,u,d);c=new Uint8Array(p).buffer,u=0,Yr("index-buffer-unaligned",`The index array is not aligned to a ${a}-byte boundary.`)}let f;return s===je.UNSIGNED_BYTE?f=new Uint8Array(c,u,o):s===je.UNSIGNED_SHORT?f=new Uint16Array(c,u,o):s===je.UNSIGNED_INT&&(f=new Uint32Array(c,u,o)),f}function MK(e,t){throw e.unload(),e._state=Ct.FAILED,e.getError("Failed to load index buffer",t)}var hD=RK;function KYe(e,t,n){if(n=n??!1,n){let i=e.indexOf(t);if(i>-1)return i}return e.push(t),e.length-1}var Ra=KYe;function $Ye(e,t){return l(e.extensionsUsed)&&e.extensionsUsed.indexOf(t)>=0}var Ko=$Ye;function rn(){}rn.objectLegacy=function(e,t){if(l(e)){for(let n in e)if(Object.prototype.hasOwnProperty.call(e,n)){let i=e[n],r=t(i,n);if(l(r))return r}}};rn.object=function(e,t){if(l(e)){let n=e.length;for(let i=0;i<n;i++){let r=e[i],o=t(r,i);if(l(o))return o}}};rn.topLevel=function(e,t,n){let i=e[t];return l(i)&&!Array.isArray(i)?rn.objectLegacy(i,n):rn.object(i,n)};rn.accessor=function(e,t){return rn.topLevel(e,"accessors",t)};rn.accessorWithSemantic=function(e,t,n){let i={};return rn.mesh(e,function(r){return rn.meshPrimitive(r,function(o){let s=rn.meshPrimitiveAttribute(o,function(a,c){if(c.indexOf(t)===0&&!l(i[a])){i[a]=!0;let u=n(a);if(l(u))return u}});return l(s)?s:rn.meshPrimitiveTarget(o,function(a){return rn.meshPrimitiveTargetAttribute(a,function(c,u){if(u.indexOf(t)===0&&!l(i[c])){i[c]=!0;let f=n(c);if(l(f))return f}})})})})};rn.accessorContainingVertexAttributeData=function(e,t){let n={};return rn.mesh(e,function(i){return rn.meshPrimitive(i,function(r){let o=rn.meshPrimitiveAttribute(r,function(s){if(!l(n[s])){n[s]=!0;let a=t(s);if(l(a))return a}});return l(o)?o:rn.meshPrimitiveTarget(r,function(s){return rn.meshPrimitiveTargetAttribute(s,function(a){if(!l(n[a])){n[a]=!0;let c=t(a);if(l(c))return c}})})})})};rn.accessorContainingIndexData=function(e,t){let n={};return rn.mesh(e,function(i){return rn.meshPrimitive(i,function(r){let o=r.indices;if(l(o)&&!l(n[o])){n[o]=!0;let s=t(o);if(l(s))return s}})})};rn.animation=function(e,t){return rn.topLevel(e,"animations",t)};rn.animationChannel=function(e,t){let n=e.channels;return rn.object(n,t)};rn.animationSampler=function(e,t){let n=e.samplers;return rn.object(n,t)};rn.buffer=function(e,t){return rn.topLevel(e,"buffers",t)};rn.bufferView=function(e,t){return rn.topLevel(e,"bufferViews",t)};rn.camera=function(e,t){return rn.topLevel(e,"cameras",t)};rn.image=function(e,t){return rn.topLevel(e,"images",t)};rn.material=function(e,t){return rn.topLevel(e,"materials",t)};rn.materialValue=function(e,t){let n=e.values;l(e.extensions)&&l(e.extensions.KHR_techniques_webgl)&&(n=e.extensions.KHR_techniques_webgl.values);for(let i in n)if(Object.prototype.hasOwnProperty.call(n,i)){let r=t(n[i],i);if(l(r))return r}};rn.mesh=function(e,t){return rn.topLevel(e,"meshes",t)};rn.meshPrimitive=function(e,t){let n=e.primitives;if(l(n)){let i=n.length;for(let r=0;r<i;r++){let o=n[r],s=t(o,r);if(l(s))return s}}};rn.meshPrimitiveAttribute=function(e,t){let n=e.attributes;for(let i in n)if(Object.prototype.hasOwnProperty.call(n,i)){let r=t(n[i],i);if(l(r))return r}};rn.meshPrimitiveTarget=function(e,t){let n=e.targets;if(l(n)){let i=n.length;for(let r=0;r<i;++r){let o=t(n[r],r);if(l(o))return o}}};rn.meshPrimitiveTargetAttribute=function(e,t){for(let n in e)if(Object.prototype.hasOwnProperty.call(e,n)){let i=e[n],r=t(i,n);if(l(r))return r}};rn.node=function(e,t){return rn.topLevel(e,"nodes",t)};rn.nodeInTree=function(e,t,n){let i=e.nodes;if(l(i)){let r=t.length;for(let o=0;o<r;o++){let s=t[o],a=i[s];if(l(a)){let c=n(a,s);if(l(c))return c;let u=a.children;if(l(u)&&(c=rn.nodeInTree(e,u,n),l(c)))return c}}}};rn.nodeInScene=function(e,t,n){let i=t.nodes;if(l(i))return rn.nodeInTree(e,i,n)};rn.program=function(e,t){return Ko(e,"KHR_techniques_webgl")?rn.object(e.extensions.KHR_techniques_webgl.programs,t):rn.topLevel(e,"programs",t)};rn.sampler=function(e,t){return rn.topLevel(e,"samplers",t)};rn.scene=function(e,t){return rn.topLevel(e,"scenes",t)};rn.shader=function(e,t){return Ko(e,"KHR_techniques_webgl")?rn.object(e.extensions.KHR_techniques_webgl.shaders,t):rn.topLevel(e,"shaders",t)};rn.skin=function(e,t){return rn.topLevel(e,"skins",t)};rn.skinJoint=function(e,t){let n=e.joints;if(l(n)){let i=n.length;for(let r=0;r<i;r++){let o=n[r],s=t(o);if(l(s))return s}}};rn.techniqueAttribute=function(e,t){let n=e.attributes;for(let i in n)if(Object.prototype.hasOwnProperty.call(n,i)){let r=t(n[i],i);if(l(r))return r}};rn.techniqueUniform=function(e,t){let n=e.uniforms;for(let i in n)if(Object.prototype.hasOwnProperty.call(n,i)){let r=t(n[i],i);if(l(r))return r}};rn.techniqueParameter=function(e,t){let n=e.parameters;for(let i in n)if(Object.prototype.hasOwnProperty.call(n,i)){let r=t(n[i],i);if(l(r))return r}};rn.technique=function(e,t){return Ko(e,"KHR_techniques_webgl")?rn.object(e.extensions.KHR_techniques_webgl.techniques,t):rn.topLevel(e,"techniques",t)};rn.texture=function(e,t){return rn.topLevel(e,"textures",t)};var Ue=rn;function JYe(e){switch(e){case"SCALAR":return 1;case"VEC2":return 2;case"VEC3":return 3;case"VEC4":case"MAT2":return 4;case"MAT3":return 9;case"MAT4":return 16}}var ud=JYe;function ZYe(e,t){let n=t.bufferView;if(l(n)){let i=e.bufferViews[n];if(l(i.byteStride)&&i.byteStride>0)return i.byteStride}return Y.getSizeInBytes(t.componentType)*ud(t.type)}var mf=ZYe;function QYe(e){Ue.accessor(e,function(n){l(n.bufferView)&&(n.byteOffset=n.byteOffset??0)}),Ue.bufferView(e,function(n){l(n.buffer)&&(n.byteOffset=n.byteOffset??0)}),Ue.mesh(e,function(n){Ue.meshPrimitive(n,function(i){if(i.mode=i.mode??te.TRIANGLES,!l(i.material)){l(e.materials)||(e.materials=[]);let r={name:"default"};i.material=Ra(e.materials,r)}})}),Ue.accessorContainingVertexAttributeData(e,function(n){let i=e.accessors[n],r=i.bufferView;if(i.normalized=i.normalized??!1,l(r)){let o=e.bufferViews[r];o.byteStride=mf(e,i),o.target=te.ARRAY_BUFFER}}),Ue.accessorContainingIndexData(e,function(n){let r=e.accessors[n].bufferView;if(l(r)){let o=e.bufferViews[r];o.target=te.ELEMENT_ARRAY_BUFFER}}),Ue.material(e,function(n){let i=n.extensions??{},r=i.KHR_materials_common;if(l(r)){let c=r.technique,u=l(r.values)?r.values:{};r.values=u,u.ambient=l(u.ambient)?u.ambient:[0,0,0,1],u.emission=l(u.emission)?u.emission:[0,0,0,1],u.transparency=u.transparency??1,c!=="CONSTANT"&&(u.diffuse=l(u.diffuse)?u.diffuse:[0,0,0,1],c!=="LAMBERT"&&(u.specular=l(u.specular)?u.specular:[0,0,0,1],u.shininess=u.shininess??0)),r.transparent=r.transparent??!1,r.doubleSided=r.doubleSided??!1;return}n.emissiveFactor=n.emissiveFactor??[0,0,0],n.alphaMode=n.alphaMode??"OPAQUE",n.doubleSided=n.doubleSided??!1,n.alphaMode==="MASK"&&(n.alphaCutoff=n.alphaCutoff??.5);let o=i.KHR_techniques_webgl;l(o)&&Ue.materialValue(n,function(c){l(c.index)&&Zb(c)}),Zb(n.emissiveTexture),Zb(n.normalTexture),Zb(n.occlusionTexture);let s=n.pbrMetallicRoughness;l(s)&&(s.baseColorFactor=s.baseColorFactor??[1,1,1,1],s.metallicFactor=s.metallicFactor??1,s.roughnessFactor=s.roughnessFactor??1,Zb(s.baseColorTexture),Zb(s.metallicRoughnessTexture));let a=i.KHR_materials_pbrSpecularGlossiness;l(a)&&(a.diffuseFactor=a.diffuseFactor??[1,1,1,1],a.specularFactor=a.specularFactor??[1,1,1],a.glossinessFactor=a.glossinessFactor??1,Zb(a.specularGlossinessTexture))}),Ue.animation(e,function(n){Ue.animationSampler(n,function(i){i.interpolation=i.interpolation??"LINEAR"})});let t=eXe(e);return Ue.node(e,function(n,i){l(t[i])||l(n.translation)||l(n.rotation)||l(n.scale)?(n.translation=n.translation??[0,0,0],n.rotation=n.rotation??[0,0,0,1],n.scale=n.scale??[1,1,1]):n.matrix=n.matrix??[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]}),Ue.sampler(e,function(n){n.wrapS=n.wrapS??te.REPEAT,n.wrapT=n.wrapT??te.REPEAT}),l(e.scenes)&&!l(e.scene)&&(e.scene=0),e}function eXe(e){let t={};return Ue.animation(e,function(n){Ue.animationChannel(n,function(i){let r=i.target,o=r.node,s=r.path;(s==="translation"||s==="rotation"||s==="scale")&&(t[o]=!0)})}),t}function Zb(e){l(e)&&(e.texCoord=e.texCoord??0)}var p3=QYe;function tXe(e){return Ue.shader(e,function(t){g3(t)}),Ue.buffer(e,function(t){g3(t)}),Ue.image(e,function(t){g3(t)}),g3(e),e}function g3(e){e.extras=l(e.extras)?e.extras:{},e.extras._pipeline=l(e.extras._pipeline)?e.extras._pipeline:{}}var Qb=tXe;function nXe(e,t){let n=e.extensionsRequired;if(l(n)){let i=n.indexOf(t);i>=0&&n.splice(i,1),n.length===0&&delete e.extensionsRequired}}var _3=nXe;function iXe(e,t){let n=e.extensionsUsed;if(l(n)){let i=n.indexOf(t);i>=0&&n.splice(i,1),_3(e,t),n.length===0&&delete e.extensionsUsed}}var DC=iXe;var rXe=4;function oXe(e){if(cp(e)!=="glTF")throw new oe("File is not valid binary glTF");let n=Hme(e,0,5),i=n[1];if(i!==1&&i!==2)throw new oe("Binary glTF version is not 1 or 2");return i===1?sXe(e,n):aXe(e,n)}function Hme(e,t,n){let i=new DataView(e.buffer),r=new Array(n);for(let o=0;o<n;++o)r[o]=i.getUint32(e.byteOffset+t+o*rXe,!0);return r}function sXe(e,t){let n=t[2],i=t[3];if(t[4]!==0)throw new oe("Binary glTF scene format is not JSON");let o=20,s=o+i,a=ff(e,o,i),c=JSON.parse(a);Qb(c);let u=e.subarray(s,n),f=c.buffers;if(l(f)&&Object.keys(f).length>0){let d=f.binary_glTF??f.KHR_binary_glTF;l(d)&&(d.extras._pipeline.source=u,delete d.uri)}return DC(c,"KHR_binary_glTF"),c}function aXe(e,t){let n=t[2],i=12,r,o;for(;i<n;){let s=Hme(e,i,2),a=s[0],c=s[1];i+=8;let u=e.subarray(i,i+a);if(i+=a,c===1313821514){let f=ff(u);r=JSON.parse(f),Qb(r)}else c===5130562&&(o=u)}if(l(r)&&l(o)){let s=r.buffers;if(l(s)&&s.length>0){let a=s[0];a.extras._pipeline.source=o}}return r}var RC=oXe;function cXe(e){return Ue.shader(e,function(t){y3(t)}),Ue.buffer(e,function(t){y3(t)}),Ue.image(e,function(t){y3(t)}),y3(e),e}function y3(e){l(e.extras)&&(l(e.extras._pipeline)&&delete e.extras._pipeline,Object.keys(e.extras).length===0&&delete e.extras)}var A3=cXe;function lXe(e,t){let n=e.extensionsUsed;l(n)||(n=[],e.extensionsUsed=n),Ra(n,t,!0)}var Ih=lXe;function uXe(e){switch(e){case Y.BYTE:return function(t,n,i,r,o){for(let s=0;s<i;++s)o[s]=t.getInt8(n+s*r)};case Y.UNSIGNED_BYTE:return function(t,n,i,r,o){for(let s=0;s<i;++s)o[s]=t.getUint8(n+s*r)};case Y.SHORT:return function(t,n,i,r,o){for(let s=0;s<i;++s)o[s]=t.getInt16(n+s*r,!0)};case Y.UNSIGNED_SHORT:return function(t,n,i,r,o){for(let s=0;s<i;++s)o[s]=t.getUint16(n+s*r,!0)};case Y.INT:return function(t,n,i,r,o){for(let s=0;s<i;++s)o[s]=t.getInt32(n+s*r,!0)};case Y.UNSIGNED_INT:return function(t,n,i,r,o){for(let s=0;s<i;++s)o[s]=t.getUint32(n+s*r,!0)};case Y.FLOAT:return function(t,n,i,r,o){for(let s=0;s<i;++s)o[s]=t.getFloat32(n+s*r,!0)};case Y.DOUBLE:return function(t,n,i,r,o){for(let s=0;s<i;++s)o[s]=t.getFloat64(n+s*r,!0)}}}var dy=uXe;function fXe(e,t){let n=e.bufferViews,i=e.buffers,r=t.bufferView,o=ud(t.type);if(!l(t.bufferView))return{min:new Array(o).fill(0),max:new Array(o).fill(0)};let s=new Array(o).fill(Number.POSITIVE_INFINITY),a=new Array(o).fill(Number.NEGATIVE_INFINITY),c=n[r],u=c.buffer,d=i[u].extras._pipeline.source,p=t.count,g=mf(e,t),m=t.byteOffset+c.byteOffset+d.byteOffset,y=t.componentType,A=Y.getSizeInBytes(y),b=new DataView(d.buffer),x=new Array(o),T=dy(y);for(let E=0;E<p;E++){T(b,m,o,A,x);for(let v=0;v<o;v++){let S=x[v];s[v]=Math.min(s[v],S),a[v]=Math.max(a[v],S)}m+=g}return{min:s,max:a}}var OC=fXe;var dXe=[te.FUNC_ADD,te.FUNC_ADD],hXe=[te.ONE,te.ZERO,te.ONE,te.ZERO];function Gme(e,t){let n=e.enable;return l(n)?n.indexOf(t)>-1:!1}var mXe=[te.ZERO,te.ONE,te.SRC_COLOR,te.ONE_MINUS_SRC_COLOR,te.SRC_ALPHA,te.ONE_MINUS_SRC_ALPHA,te.DST_ALPHA,te.ONE_MINUS_DST_ALPHA,te.DST_COLOR,te.ONE_MINUS_DST_COLOR];function pXe(e,t){if(!l(e))return t;for(let n=0;n<4;n++)if(mXe.indexOf(e[n])===-1)return t;return e}function gXe(e){let t={},n={},i=e.techniques;return l(i)&&(Ue.technique(e,function(r,o){let s=r.states;if(l(s)){let a=n[o]={};if(Gme(s,te.BLEND)){a.alphaMode="BLEND";let c=s.functions;l(c)&&(l(c.blendEquationSeparate)||l(c.blendFuncSeparate))&&(t[o]={blendEquation:c.blendEquationSeparate??dXe,blendFactors:pXe(c.blendFuncSeparate,hXe)})}Gme(s,te.CULL_FACE)||(a.doubleSided=!0),delete r.states}}),Object.keys(t).length>0&&(l(e.extensions)||(e.extensions={}),Ih(e,"KHR_blend")),Ue.material(e,function(r){if(l(r.technique)){let o=n[r.technique];Ue.objectLegacy(o,function(a,c){r[c]=a});let s=t[r.technique];l(s)&&(l(r.extensions)||(r.extensions={}),r.extensions.KHR_blend=s)}})),e}var b3=gXe;function _Xe(e,t){let n=e.extensionsRequired;l(n)||(n=[],e.extensionsRequired=n),Ra(n,t,!0),Ih(e,t)}var x3=_Xe;function yXe(e){let t=e.techniques,n={},i={},r={};if(l(t)){let o={programs:[],shaders:[],techniques:[]},s=e.glExtensionsUsed;delete e.glExtensionsUsed,Ue.technique(e,function(a,c){let u={name:a.name,program:void 0,attributes:{},uniforms:{}},f;if(Ue.techniqueAttribute(a,function(d,p){f=a.parameters[d],u.attributes[p]={semantic:f.semantic}}),Ue.techniqueUniform(a,function(d,p){f=a.parameters[d],u.uniforms[p]={count:f.count,node:f.node,type:f.type,semantic:f.semantic,value:f.value},l(n[c])||(n[c]={}),n[c][d]=p}),l(r[a.program]))u.program=r[a.program];else{let d=e.programs[a.program],p={name:d.name,fragmentShader:void 0,vertexShader:void 0,glExtensions:s},g=e.shaders[d.fragmentShader];p.fragmentShader=Ra(o.shaders,g,!0);let m=e.shaders[d.vertexShader];p.vertexShader=Ra(o.shaders,m,!0),u.program=Ra(o.programs,p),r[a.program]=u.program}i[c]=Ra(o.techniques,u)}),o.techniques.length>0&&(l(e.extensions)||(e.extensions={}),e.extensions.KHR_techniques_webgl=o,Ih(e,"KHR_techniques_webgl"),x3(e,"KHR_techniques_webgl"))}return Ue.material(e,function(o){if(l(o.technique)){let s={technique:i[o.technique]};Ue.objectLegacy(o.values,function(a,c){l(s.values)||(s.values={});let u=n[o.technique][c];l(u)&&(s.values[u]=a)}),l(o.extensions)||(o.extensions={}),o.extensions.KHR_techniques_webgl=s}delete o.technique,delete o.values}),delete e.techniques,delete e.programs,delete e.shaders,e}var T3=yXe;function AXe(e,t){qr.typeOf.object("material",e),qr.defined("handler",t);let n=e.pbrMetallicRoughness;if(l(n)){if(l(n.baseColorTexture)){let o=n.baseColorTexture,s=t(o.index,o);if(l(s))return s}if(l(n.metallicRoughnessTexture)){let o=n.metallicRoughnessTexture,s=t(o.index,o);if(l(s))return s}}let{extensions:i}=e;if(l(i)){let o=i.KHR_materials_pbrSpecularGlossiness;if(l(o)){if(l(o.diffuseTexture)){let u=o.diffuseTexture,f=t(u.index,u);if(l(f))return f}if(l(o.specularGlossinessTexture)){let u=o.specularGlossinessTexture,f=t(u.index,u);if(l(f))return f}}let s=i.KHR_materials_specular;if(l(s)){let{specularTexture:u,specularColorTexture:f}=s;if(l(u)){let d=t(u.index,u);if(l(d))return d}if(l(f)){let d=t(f.index,f);if(l(d))return d}}let a=i.KHR_materials_transmission;if(l(a)&&l(a.transmissionTexture)){let u=a.transmissionTexture,f=t(u.index,u);if(l(f))return f}let c=i.KHR_materials_common;if(l(c)&&l(c.values)){let{diffuse:u,ambient:f,emission:d,specular:p}=c.values;if(l(u)&&l(u.index)){let g=t(u.index,u);if(l(g))return g}if(l(f)&&l(f.index)){let g=t(f.index,f);if(l(g))return g}if(l(d)&&l(d.index)){let g=t(d.index,d);if(l(g))return g}if(l(p)&&l(p.index)){let g=t(p.index,p);if(l(g))return g}}}let r=Ue.materialValue(e,function(o){if(l(o.index)){let s=t(o.index,o);if(l(s))return s}});if(l(r))return r;if(l(e.emissiveTexture)){let o=e.emissiveTexture,s=t(o.index,o);if(l(s))return s}if(l(e.normalTexture)){let o=e.normalTexture,s=t(o.index,o);if(l(s))return s}if(l(e.occlusionTexture)){let o=e.occlusionTexture,s=t(o.index,o);if(l(s))return s}}var mD=AXe;var Wme=["mesh","node","material","accessor","bufferView","buffer","texture","sampler","image"];function bXe(e,t){return t=t??Wme,Wme.forEach(function(n){t.indexOf(n)>-1&&TXe(e,n)}),e}var xXe={accessor:"accessors",buffer:"buffers",bufferView:"bufferViews",image:"images",node:"nodes",material:"materials",mesh:"meshes",sampler:"samplers",texture:"textures"};function TXe(e,t){let n=xXe[t],i=e[n];if(l(i)){let r=0,o=fp[t](e),s=i.length;for(let a=0;a<s;++a)o[a]||(up[t](e,a-r),r++)}}function up(){}up.accessor=function(e,t){e.accessors.splice(t,1),Ue.mesh(e,function(i){Ue.meshPrimitive(i,function(r){Ue.meshPrimitiveAttribute(r,function(a,c){a>t&&r.attributes[c]--}),Ue.meshPrimitiveTarget(r,function(a){Ue.meshPrimitiveTargetAttribute(a,function(c,u){c>t&&a[u]--})});let o=r.indices;l(o)&&o>t&&r.indices--;let s=r.extensions;l(s)&&l(s.CESIUM_primitive_outline)&&s.CESIUM_primitive_outline.indices>t&&--s.CESIUM_primitive_outline.indices})}),Ue.skin(e,function(i){l(i.inverseBindMatrices)&&i.inverseBindMatrices>t&&i.inverseBindMatrices--}),Ue.animation(e,function(i){Ue.animationSampler(i,function(r){l(r.input)&&r.input>t&&r.input--,l(r.output)&&r.output>t&&r.output--})})};up.buffer=function(e,t){e.buffers.splice(t,1),Ue.bufferView(e,function(i){l(i.buffer)&&i.buffer>t&&i.buffer--;let r=i.extensions;if(l(r)){let o=r.EXT_meshopt_compression;l(o)&&o.buffer>t&&o.buffer--;let s=r.KHR_meshopt_compression;l(s)&&s.buffer>t&&s.buffer--}})};up.bufferView=function(e,t){if(e.bufferViews.splice(t,1),Ue.accessor(e,function(i){l(i.bufferView)&&i.bufferView>t&&i.bufferView--}),Ue.shader(e,function(i){l(i.bufferView)&&i.bufferView>t&&i.bufferView--}),Ue.image(e,function(i){l(i.bufferView)&&i.bufferView>t&&i.bufferView--}),Ko(e,"KHR_draco_mesh_compression")&&Ue.mesh(e,function(i){Ue.meshPrimitive(i,function(r){l(r.extensions)&&l(r.extensions.KHR_draco_mesh_compression)&&r.extensions.KHR_draco_mesh_compression.bufferView>t&&r.extensions.KHR_draco_mesh_compression.bufferView--})}),Ko(e,"EXT_feature_metadata")){let r=e.extensions.EXT_feature_metadata.featureTables;for(let o in r)if(r.hasOwnProperty(o)){let a=r[o].properties;if(l(a)){for(let c in a)if(a.hasOwnProperty(c)){let u=a[c];l(u.bufferView)&&u.bufferView>t&&u.bufferView--,l(u.arrayOffsetBufferView)&&u.arrayOffsetBufferView>t&&u.arrayOffsetBufferView--,l(u.stringOffsetBufferView)&&u.stringOffsetBufferView>t&&u.stringOffsetBufferView--}}}}if(Ko(e,"EXT_structural_metadata")){let r=e.extensions.EXT_structural_metadata.propertyTables;if(l(r)){let o=r.length;for(let s=0;s<o;++s){let c=r[s].properties;for(let u in c)if(c.hasOwnProperty(u)){let f=c[u];l(f.values)&&f.values>t&&f.values--,l(f.arrayOffsets)&&f.arrayOffsets>t&&f.arrayOffsets--,l(f.stringOffsets)&&f.stringOffsets>t&&f.stringOffsets--}}}}};up.image=function(e,t){e.images.splice(t,1),Ue.texture(e,function(i){l(i.source)&&i.source>t&&--i.source;let r=i.extensions;l(r)&&l(r.EXT_texture_webp)&&r.EXT_texture_webp.source>t?--i.extensions.EXT_texture_webp.source:l(r)&&l(r.KHR_texture_basisu)&&r.KHR_texture_basisu.source>t&&--i.extensions.KHR_texture_basisu.source})};up.mesh=function(e,t){e.meshes.splice(t,1),Ue.node(e,function(i){l(i.mesh)&&(i.mesh>t?i.mesh--:i.mesh===t&&delete i.mesh)})};up.node=function(e,t){e.nodes.splice(t,1),Ue.skin(e,function(i){l(i.skeleton)&&i.skeleton>t&&i.skeleton--,i.joints=i.joints.map(function(r){return r>t?r-1:r})}),Ue.animation(e,function(i){Ue.animationChannel(i,function(r){l(r.target)&&l(r.target.node)&&r.target.node>t&&r.target.node--})}),Ue.technique(e,function(i){Ue.techniqueUniform(i,function(r){l(r.node)&&r.node>t&&r.node--})}),Ue.node(e,function(i){l(i.children)&&(i.children=i.children.filter(function(r){return r!==t}).map(function(r){return r>t?r-1:r}))}),Ue.scene(e,function(i){i.nodes=i.nodes.filter(function(r){return r!==t}).map(function(r){return r>t?r-1:r})})};up.material=function(e,t){e.materials.splice(t,1),Ue.mesh(e,function(i){Ue.meshPrimitive(i,function(r){l(r.material)&&r.material>t&&r.material--})})};up.sampler=function(e,t){e.samplers.splice(t,1),Ue.texture(e,function(i){l(i.sampler)&&i.sampler>t&&--i.sampler})};up.texture=function(e,t){if(e.textures.splice(t,1),Ue.material(e,function(i){mD(i,function(r,o){o.index>t&&--o.index})}),Ko(e,"EXT_feature_metadata")){Ue.mesh(e,function(o){Ue.meshPrimitive(o,function(s){let a=s.extensions;if(l(a)&&l(a.EXT_feature_metadata)){let u=a.EXT_feature_metadata.featureIdTextures;if(l(u)){let f=u.length;for(let d=0;d<f;++d){let g=u[d].featureIds.texture;g.index>t&&--g.index}}}})});let r=e.extensions.EXT_feature_metadata.featureTextures;for(let o in r)if(r.hasOwnProperty(o)){let a=r[o].properties;if(l(a)){for(let c in a)if(a.hasOwnProperty(c)){let f=a[c].texture;f.index>t&&--f.index}}}}if(Ko(e,"EXT_mesh_features")&&Ue.mesh(e,function(i){Ue.meshPrimitive(i,function(r){let o=r.extensions;if(l(o)&&l(o.EXT_mesh_features)){let a=o.EXT_mesh_features.featureIds;if(l(a)){let c=a.length;for(let u=0;u<c;++u){let f=a[u];l(f.texture)&&f.texture.index>t&&--f.texture.index}}}})}),Ko(e,"EXT_structural_metadata")){let r=e.extensions.EXT_structural_metadata.propertyTextures;if(l(r)){let o=r.length;for(let s=0;s<o;++s){let c=r[s].properties;for(let u in c)if(c.hasOwnProperty(u)){let f=c[u];f.index>t&&--f.index}}}}};function fp(){}fp.accessor=function(e){let t={};return Ue.mesh(e,function(n){Ue.meshPrimitive(n,function(i){Ue.meshPrimitiveAttribute(i,function(o){t[o]=!0}),Ue.meshPrimitiveTarget(i,function(o){Ue.meshPrimitiveTargetAttribute(o,function(s){t[s]=!0})});let r=i.indices;l(r)&&(t[r]=!0)})}),Ue.skin(e,function(n){l(n.inverseBindMatrices)&&(t[n.inverseBindMatrices]=!0)}),Ue.animation(e,function(n){Ue.animationSampler(n,function(i){l(i.input)&&(t[i.input]=!0),l(i.output)&&(t[i.output]=!0)})}),Ko(e,"EXT_mesh_gpu_instancing")&&Ue.node(e,function(n){l(n.extensions)&&l(n.extensions.EXT_mesh_gpu_instancing)&&Object.keys(n.extensions.EXT_mesh_gpu_instancing.attributes).forEach(function(i){let r=n.extensions.EXT_mesh_gpu_instancing.attributes[i];t[r]=!0})}),Ko(e,"CESIUM_primitive_outline")&&Ue.mesh(e,function(n){Ue.meshPrimitive(n,function(i){let r=i.extensions;if(l(r)&&l(r.CESIUM_primitive_outline)){let s=r.CESIUM_primitive_outline.indices;l(s)&&(t[s]=!0)}})}),t};fp.buffer=function(e){let t={};return Ue.bufferView(e,function(n){l(n.buffer)&&(t[n.buffer]=!0);let i=n.extensions;if(l(i)){let r=i.EXT_meshopt_compression;l(r)&&(t[r.buffer]=!0);let o=i.KHR_meshopt_compression;l(o)&&(t[o.buffer]=!0)}}),t};fp.bufferView=function(e){let t={};if(Ue.accessor(e,function(n){l(n.bufferView)&&(t[n.bufferView]=!0)}),Ue.shader(e,function(n){l(n.bufferView)&&(t[n.bufferView]=!0)}),Ue.image(e,function(n){l(n.bufferView)&&(t[n.bufferView]=!0)}),Ko(e,"KHR_draco_mesh_compression")&&Ue.mesh(e,function(n){Ue.meshPrimitive(n,function(i){l(i.extensions)&&l(i.extensions.KHR_draco_mesh_compression)&&(t[i.extensions.KHR_draco_mesh_compression.bufferView]=!0)})}),Ko(e,"EXT_feature_metadata")){let i=e.extensions.EXT_feature_metadata.featureTables;for(let r in i)if(i.hasOwnProperty(r)){let s=i[r].properties;if(l(s)){for(let a in s)if(s.hasOwnProperty(a)){let c=s[a];l(c.bufferView)&&(t[c.bufferView]=!0),l(c.arrayOffsetBufferView)&&(t[c.arrayOffsetBufferView]=!0),l(c.stringOffsetBufferView)&&(t[c.stringOffsetBufferView]=!0)}}}}if(Ko(e,"EXT_structural_metadata")){let i=e.extensions.EXT_structural_metadata.propertyTables;if(l(i)){let r=i.length;for(let o=0;o<r;++o){let a=i[o].properties;for(let c in a)if(a.hasOwnProperty(c)){let u=a[c];l(u.values)&&(t[u.values]=!0),l(u.arrayOffsets)&&(t[u.arrayOffsets]=!0),l(u.stringOffsets)&&(t[u.stringOffsets]=!0)}}}}return t};fp.image=function(e){let t={};return Ue.texture(e,function(n){l(n.source)&&(t[n.source]=!0),l(n.extensions)&&l(n.extensions.EXT_texture_webp)?t[n.extensions.EXT_texture_webp.source]=!0:l(n.extensions)&&l(n.extensions.KHR_texture_basisu)&&(t[n.extensions.KHR_texture_basisu.source]=!0)}),t};fp.mesh=function(e){let t={};return Ue.node(e,function(n){if(l(n.mesh&&l(e.meshes))){let i=e.meshes[n.mesh];l(i)&&l(i.primitives)&&i.primitives.length>0&&(t[n.mesh]=!0)}}),t};function qme(e,t,n){let i=e.nodes[t];return l(i.mesh)||l(i.camera)||l(i.skin)||l(i.weights)||l(i.extras)||l(i.extensions)&&Object.keys(i.extensions).length!==0||l(n[t])?!1:!l(i.children)||i.children.filter(function(r){return!qme(e,r,n)}).length===0}fp.node=function(e){let t={};return Ue.skin(e,function(n){l(n.skeleton)&&(t[n.skeleton]=!0),Ue.skinJoint(n,function(i){t[i]=!0})}),Ue.animation(e,function(n){Ue.animationChannel(n,function(i){l(i.target)&&l(i.target.node)&&(t[i.target.node]=!0)})}),Ue.technique(e,function(n){Ue.techniqueUniform(n,function(i){l(i.node)&&(t[i.node]=!0)})}),Ue.node(e,function(n,i){qme(e,i,t)||(t[i]=!0)}),t};fp.material=function(e){let t={};return Ue.mesh(e,function(n){Ue.meshPrimitive(n,function(i){l(i.material)&&(t[i.material]=!0)})}),t};fp.texture=function(e){let t={};if(Ue.material(e,function(n){mD(n,function(i){t[i]=!0})}),Ko(e,"EXT_feature_metadata")){Ue.mesh(e,function(r){Ue.meshPrimitive(r,function(o){let s=o.extensions;if(l(s)&&l(s.EXT_feature_metadata)){let c=s.EXT_feature_metadata.featureIdTextures;if(l(c)){let u=c.length;for(let f=0;f<u;++f){let p=c[f].featureIds.texture;t[p.index]=!0}}}})});let i=e.extensions.EXT_feature_metadata.featureTextures;for(let r in i)if(i.hasOwnProperty(r)){let s=i[r].properties;if(l(s)){for(let a in s)if(s.hasOwnProperty(a)){let u=s[a].texture;t[u.index]=!0}}}}if(Ko(e,"EXT_mesh_features")&&Ue.mesh(e,function(n){Ue.meshPrimitive(n,function(i){let r=i.extensions;if(l(r)&&l(r.EXT_mesh_features)){let s=r.EXT_mesh_features.featureIds;if(l(s)){let a=s.length;for(let c=0;c<a;++c){let u=s[c];l(u.texture)&&(t[u.texture.index]=!0)}}}})}),Ko(e,"EXT_structural_metadata")){let i=e.extensions.EXT_structural_metadata.propertyTextures;if(l(i)){let r=i.length;for(let o=0;o<r;++o){let a=i[o].properties;for(let c in a)if(a.hasOwnProperty(c)){let u=a[c];t[u.index]=!0}}}}return t};fp.sampler=function(e){let t={};return Ue.texture(e,function(n){l(n.sampler)&&(t[n.sampler]=!0)}),t};var E3=bXe;function EXe(e,t){let n={byteLength:t.length,extras:{_pipeline:{source:t}}},r={buffer:Ra(e.buffers,n),byteOffset:0,byteLength:t.length};return Ra(e.bufferViews,r)}var C3=EXe;function CXe(e,t){let n=mf(e,t),i=Y.getSizeInBytes(t.componentType),r=ud(t.type),o=t.count,s=new Array(r*o);if(!l(t.bufferView))return s.fill(0);let a=e.bufferViews[t.bufferView],c=e.buffers[a.buffer].extras._pipeline.source,u=t.byteOffset+a.byteOffset+c.byteOffset,f=new DataView(c.buffer),d=new Array(r),p=dy(t.componentType);for(let g=0;g<o;++g){p(f,u,r,i,d);for(let m=0;m<r;++m)s[g*r+m]=d[m];u+=n}return s}var v3=CXe;function vXe(e){let t;return Ue.accessorWithSemantic(e,"JOINTS_0",function(n){let i=e.accessors[n];t=i.componentType,t===te.BYTE?S3(e,i,Y.UNSIGNED_BYTE):t!==te.UNSIGNED_BYTE&&t!==te.UNSIGNED_SHORT&&S3(e,i,Y.UNSIGNED_SHORT)}),Ue.accessorWithSemantic(e,"WEIGHTS_0",function(n){let i=e.accessors[n];t=i.componentType,t===te.BYTE?S3(e,i,Y.UNSIGNED_BYTE):t===te.SHORT&&S3(e,i,Y.UNSIGNED_SHORT)}),e}function S3(e,t,n){let i=Y.createTypedArray(n,v3(e,t)),r=new Uint8Array(i.buffer);t.bufferView=C3(e,r),t.componentType=n,t.byteOffset=0}var w3=vXe;function SXe(e,t){return DC(e,t),t==="CESIUM_RTC"&&wXe(e),NK(e,t)}function wXe(e){Ue.technique(e,function(t){Ue.techniqueUniform(t,function(n){n.semantic==="CESIUM_RTC_MODELVIEW"&&(n.semantic="MODELVIEW")})})}function NK(e,t){if(Array.isArray(e)){let n=e.length;for(let i=0;i<n;++i)NK(e[i],t)}else if(e!==null&&typeof e=="object"&&e.constructor===Object){let n=e.extensions,i;l(n)&&(i=n[t],l(i)&&(delete n[t],Object.keys(n).length===0&&delete e.extensions));for(let r in e)Object.prototype.hasOwnProperty.call(e,r)&&NK(e[r],t);return i}}var MC=SXe;var I3={.8:MXe,"1.0":eKe,"2.0":void 0};function IXe(e,t){t=t??{};let n=t.targetVersion,i=e.version;e.asset=e.asset??{version:"1.0"},e.asset.version=e.asset.version??"1.0",i=(i??e.asset.version).toString(),Object.prototype.hasOwnProperty.call(I3,i)||(l(i)&&(i=i.substring(0,3)),Object.prototype.hasOwnProperty.call(I3,i)||(i="1.0"));let r=I3[i];for(;l(r)&&i!==n;)r(e,t),i=e.asset.version,r=I3[i];return t.keepLegacyExtensions||(iKe(e,t),rKe(e)),e}function Kme(e){let t=e.materials;for(let n in t)if(Object.prototype.hasOwnProperty.call(t,n)){let i=t[n],r=i.instanceTechnique;l(r)&&(i.technique=r.technique,i.values=r.values,delete i.instanceTechnique)}}function PXe(e){let t=e.meshes;for(let n in t)if(Object.prototype.hasOwnProperty.call(t,n)){let r=t[n].primitives;if(l(r)){let o=r.length;for(let s=0;s<o;++s){let a=r[s],c=a.primitive??te.TRIANGLES;a.mode=a.mode??c,delete a.primitive}}}}function DXe(e){let t=e.nodes,n=new h,i=new Le;for(let r in t)if(Object.prototype.hasOwnProperty.call(t,r)){let o=t[r];if(l(o.rotation)){let a=o.rotation;h.fromArray(a,0,n),Le.fromAxisAngle(n,a[3],i),o.rotation=[i.x,i.y,i.z,i.w]}let s=o.instanceSkin;l(s)&&(o.skeletons=s.skeletons,o.skin=s.skin,o.meshes=s.meshes,delete o.instanceSkin)}}function RXe(e){let t=e.animations,n=e.accessors,i=e.bufferViews,r=e.buffers,o={},s=new h,a=new Le;for(let c in t)if(Object.prototype.hasOwnProperty.call(t,c)){let u=t[c],f=u.channels,d=u.parameters,p=u.samplers;if(l(f)){let g=f.length;for(let m=0;m<g;++m){let y=f[m];if(y.target.path==="rotation"){let A=d[p[y.sampler].output];if(l(o[A]))continue;o[A]=!0;let b=n[A],x=i[b.bufferView],E=r[x.buffer].extras._pipeline.source,v=E.byteOffset+x.byteOffset+b.byteOffset,S=b.componentType,I=b.count,R=ud(b.type),O=b.count*R,L=Y.createArrayBufferView(S,E.buffer,v,O);for(let _=0;_<I;_++){let C=_*R;h.unpack(L,C,s);let w=L[C+3];Le.fromAxisAngle(s,w,a),Le.pack(a,L,C)}}}}}}function OXe(e){let t=e.techniques;for(let n in t)if(Object.prototype.hasOwnProperty.call(t,n)){let i=t[n],r=i.passes;if(l(r)){let o=i.pass??"defaultPass";if(Object.prototype.hasOwnProperty.call(r,o)){let s=r[o],a=s.instanceProgram;i.attributes=i.attributes??a.attributes,i.program=i.program??a.program,i.uniforms=i.uniforms??a.uniforms,i.states=i.states??s.states}delete i.passes,delete i.pass}}}function MXe(e){l(e.asset)||(e.asset={});let t=e.asset;if(t.version="1.0",typeof t.profile=="string"){let n=t.profile.split(" ");t.profile={api:n[0],version:n[1]}}else t.profile={};if(l(e.version)&&delete e.version,Kme(e),PXe(e),DXe(e),RXe(e),OXe(e),l(e.allExtensions)&&(e.extensionsUsed=e.allExtensions,delete e.allExtensions),l(e.lights)){let n=e.extensions??{};e.extensions=n;let i=n.KHR_materials_common??{};n.KHR_materials_common=i,i.lights=e.lights,delete e.lights,Ih(e,"KHR_materials_common")}}function NXe(e){let t=e.animations;for(let n in t)if(Object.prototype.hasOwnProperty.call(t,n)){let i=t[n],r=i.parameters;if(l(r)){let o=i.samplers;for(let s in o)if(Object.prototype.hasOwnProperty.call(o,s)){let a=o[s];a.input=r[a.input],a.output=r[a.output]}delete i.parameters}}}function Yme(e,t){let n=[];for(let i in e)if(Object.prototype.hasOwnProperty.call(e,i)){let r=e[i];t[i]=n.length,n.push(r),l(r.name)||(r.name=i)}return n}function LXe(e){let t,n={accessors:{},animations:{},buffers:{},bufferViews:{},cameras:{},images:{},materials:{},meshes:{},nodes:{},programs:{},samplers:{},scenes:{},shaders:{},skins:{},textures:{},techniques:{}},i,r={},o=e.nodes;for(let s in o)Object.prototype.hasOwnProperty.call(o,s)&&(i=o[s].jointName,l(i)&&(r[i]=s));for(let s in e)if(Object.prototype.hasOwnProperty.call(e,s)&&l(n[s])){let a={},c=e[s];e[s]=Yme(c,a),n[s]=a}for(i in r)Object.prototype.hasOwnProperty.call(r,i)&&(r[i]=n.nodes[r[i]]);l(e.scene)&&(e.scene=n.scenes[e.scene]),Ue.bufferView(e,function(s){l(s.buffer)&&(s.buffer=n.buffers[s.buffer])}),Ue.accessor(e,function(s){l(s.bufferView)&&(s.bufferView=n.bufferViews[s.bufferView])}),Ue.shader(e,function(s){let a=s.extensions;if(l(a)){let c=a.KHR_binary_glTF;l(c)&&(s.bufferView=n.bufferViews[c.bufferView],delete a.KHR_binary_glTF),Object.keys(a).length===0&&delete s.extensions}}),Ue.program(e,function(s){l(s.vertexShader)&&(s.vertexShader=n.shaders[s.vertexShader]),l(s.fragmentShader)&&(s.fragmentShader=n.shaders[s.fragmentShader])}),Ue.technique(e,function(s){l(s.program)&&(s.program=n.programs[s.program]),Ue.techniqueParameter(s,function(a){l(a.node)&&(a.node=n.nodes[a.node]);let c=a.value;typeof c=="string"&&(a.value={index:n.textures[c]})})}),Ue.mesh(e,function(s){Ue.meshPrimitive(s,function(a){l(a.indices)&&(a.indices=n.accessors[a.indices]),Ue.meshPrimitiveAttribute(a,function(c,u){a.attributes[u]=n.accessors[c]}),l(a.material)&&(a.material=n.materials[a.material])})}),Ue.node(e,function(s){let a=s.children;if(l(a)){let c=a.length;for(t=0;t<c;++t)a[t]=n.nodes[a[t]]}if(l(s.meshes)){let c=s.meshes,u=c.length;if(u>0)for(s.mesh=n.meshes[c[0]],t=1;t<u;++t){let f={mesh:n.meshes[c[t]]},d=Ra(e.nodes,f);l(a)||(a=[],s.children=a),a.push(d)}delete s.meshes}if(l(s.camera)&&(s.camera=n.cameras[s.camera]),l(s.skin)&&(s.skin=n.skins[s.skin]),l(s.skeletons)){let c=s.skeletons;if(c.length>0&&l(s.skin)){let f=e.skins[s.skin];f.skeleton=n.nodes[c[0]]}delete s.skeletons}l(s.jointName)&&delete s.jointName}),Ue.skin(e,function(s){l(s.inverseBindMatrices)&&(s.inverseBindMatrices=n.accessors[s.inverseBindMatrices]);let a=s.jointNames;if(l(a)){let c=[],u=a.length;for(t=0;t<u;++t)c[t]=r[a[t]];s.joints=c,delete s.jointNames}}),Ue.scene(e,function(s){let a=s.nodes;if(l(a)){let c=a.length;for(t=0;t<c;++t)a[t]=n.nodes[a[t]]}}),Ue.animation(e,function(s){let a={};s.samplers=Yme(s.samplers,a),Ue.animationSampler(s,function(c){c.input=n.accessors[c.input],c.output=n.accessors[c.output]}),Ue.animationChannel(s,function(c){c.sampler=a[c.sampler];let u=c.target;l(u)&&(u.node=n.nodes[u.id],delete u.id)})}),Ue.material(e,function(s){l(s.technique)&&(s.technique=n.techniques[s.technique]),Ue.materialValue(s,function(c,u){typeof c=="string"&&(s.values[u]={index:n.textures[c]})});let a=s.extensions;if(l(a)){let c=a.KHR_materials_common;l(c)&&l(c.values)&&Ue.materialValue(c,function(u,f){typeof u=="string"&&(c.values[f]={index:n.textures[u]})})}}),Ue.image(e,function(s){let a=s.extensions;if(l(a)){let c=a.KHR_binary_glTF;l(c)&&(s.bufferView=n.bufferViews[c.bufferView],s.mimeType=c.mimeType,delete a.KHR_binary_glTF),Object.keys(a).length===0&&delete s.extensions}}),Ue.texture(e,function(s){l(s.sampler)&&(s.sampler=n.samplers[s.sampler]),l(s.source)&&(s.source=n.images[s.source])})}function FXe(e){Ue.animation(e,function(t){Ue.animationSampler(t,function(n){delete n.name})})}function BXe(e){for(let t in e)if(Object.prototype.hasOwnProperty.call(e,t)){let n=e[t];Array.isArray(n)&&n.length===0&&delete e[t]}Ue.node(e,function(t){l(t.children)&&t.children.length===0&&delete t.children})}function kXe(e){let t=e.asset;delete t.profile,delete t.premultipliedAlpha}var UXe={CESIUM_RTC:!0,KHR_materials_common:!0,WEB3D_quantized_attributes:!0};function zXe(e){let t=e.extensionsUsed;if(e.extensionsRequired=e.extensionsRequired??[],l(t)){let n=t.length;for(let i=0;i<n;++i){let r=t[i];l(UXe[r])&&e.extensionsRequired.push(r)}}}function VXe(e){Ue.buffer(e,function(t){delete t.type})}function jXe(e){Ue.texture(e,function(t){delete t.format,delete t.internalFormat,delete t.target,delete t.type})}function HXe(e){Ue.mesh(e,function(t){Ue.meshPrimitive(t,function(n){Ue.meshPrimitiveAttribute(n,function(i,r){r==="TEXCOORD"?n.attributes.TEXCOORD_0=i:r==="COLOR"&&(n.attributes.COLOR_0=i)}),delete n.attributes.TEXCOORD,delete n.attributes.COLOR})}),Ue.technique(e,function(t){Ue.techniqueParameter(t,function(n){let i=n.semantic;l(i)&&(i==="TEXCOORD"?n.semantic="TEXCOORD_0":i==="COLOR"&&(n.semantic="COLOR_0"))})})}var GXe={POSITION:!0,NORMAL:!0,TANGENT:!0},WXe={COLOR:"COLOR",JOINT:"JOINTS",JOINTS:"JOINTS",TEXCOORD:"TEXCOORD",WEIGHT:"WEIGHTS",WEIGHTS:"WEIGHTS"};function qXe(e){let t={};Ue.mesh(e,function(n){Ue.meshPrimitive(n,function(i){Ue.meshPrimitiveAttribute(i,function(r,o){if(o.charAt(0)!=="_"){let s=o.search(/_[0-9]+/g),a=o,c="_0";s>=0&&(a=o.substring(0,s),c=o.substring(s));let u,f=WXe[a];l(f)?(u=f+c,t[o]=u):l(GXe[a])||(u=`_${o}`,t[o]=u)}});for(let r in t)if(Object.prototype.hasOwnProperty.call(t,r)){let o=t[r],s=i.attributes[r];l(s)&&(delete i.attributes[r],i.attributes[o]=s)}})}),Ue.technique(e,function(n){Ue.techniqueParameter(n,function(i){let r=t[i.semantic];l(r)&&(i.semantic=r)})})}function YXe(e){Ue.camera(e,function(t){let n=t.perspective;if(l(n)){let i=n.aspectRatio;l(i)&&i===0&&delete n.aspectRatio;let r=n.yfov;l(r)&&r===0&&(n.yfov=1)}})}function FK(e,t){return l(t.byteStride)&&t.byteStride!==0?t.byteStride:mf(e,t)}function XXe(e){Ue.buffer(e,function(t){l(t.byteLength)||(t.byteLength=t.extras._pipeline.source.length)}),Ue.accessor(e,function(t){let n=t.bufferView;if(l(n)){let i=e.bufferViews[n],r=FK(e,t),o=t.byteOffset+t.count*r;i.byteLength=Math.max(i.byteLength??0,o)}})}function KXe(e){let t,n,i,r=e.bufferViews,o={};Ue.accessorContainingVertexAttributeData(e,function(a){let c=e.accessors[a];l(c.bufferView)&&(o[c.bufferView]=!0)});let s={};Ue.accessor(e,function(a){l(a.bufferView)&&(s[a.bufferView]=s[a.bufferView]??[],s[a.bufferView].push(a))});for(let a in s)if(Object.prototype.hasOwnProperty.call(s,a)){i=r[a];let c=s[a];c.sort(function(p,g){return p.byteOffset-g.byteOffset});let u=0,f=0,d=c.length;for(t=0;t<d;++t){let p=c[t],g=FK(e,p),m=p.byteOffset,y=p.count*g;delete p.byteStride;let A=t<d-1,b=A?FK(e,c[t+1]):void 0;if(g!==b){let x=Ze(i,!0);o[a]&&(x.byteStride=g),x.byteOffset+=u,x.byteLength=m+y-u;let T=Ra(r,x);for(n=f;n<=t;++n)p=c[n],p.bufferView=T,p.byteOffset=p.byteOffset-u;u=A?c[t+1].byteOffset:void 0,f=t+1}}}E3(e,["accessor","bufferView","buffer"])}function $Xe(e){Ue.accessorWithSemantic(e,"POSITION",function(t){let n=e.accessors[t];if(!l(n.min)||!l(n.max)){let i=OC(e,n);n.min=i.min,n.max=i.max}})}function $me(e){return(!l(e.children)||e.children.length===0)&&(!l(e.meshes)||e.meshes.length===0)&&!l(e.camera)&&!l(e.skin)&&!l(e.skeletons)&&!l(e.jointName)&&(!l(e.translation)||h.fromArray(e.translation).equals(h.ZERO))&&(!l(e.scale)||h.fromArray(e.scale).equals(new h(1,1,1)))&&(!l(e.rotation)||se.fromArray(e.rotation).equals(new se(0,0,0,1)))&&(!l(e.matrix)||M.fromColumnMajorArray(e.matrix).equals(M.IDENTITY))&&!l(e.extensions)&&!l(e.extras)}function Jme(e,t){Ue.scene(e,function(n){let i=n.nodes;if(l(i)){let r=i.length;for(let o=r;o>=0;--o)if(i[o]===t){i.splice(o,1);return}}}),Ue.node(e,function(n,i){if(l(n.children)){let r=n.children.indexOf(t);r>-1&&(n.children.splice(r,1),$me(n)&&Jme(e,i))}}),delete e.nodes[t]}function JXe(e){return Ue.node(e,function(t,n){$me(t)&&Jme(e,n)}),e}function ZXe(e){Ue.animation(e,function(t){Ue.animationSampler(t,function(n){let i=e.accessors[n.input];if(!l(i.min)||!l(i.max)){let r=OC(e,i);i.min=r.min,i.max=r.max}})})}function QXe(e){Ue.accessor(e,function(t){if(l(t.min)||l(t.max)){let n=OC(e,t);l(t.min)&&(t.min=n.min),l(t.max)&&(t.max=n.max)}})}function eKe(e){e.asset=e.asset??{},e.asset.version="2.0",Kme(e),NXe(e),JXe(e),LXe(e),FXe(e),kXe(e),zXe(e),XXe(e),KXe(e),$Xe(e),ZXe(e),QXe(e),VXe(e),jXe(e),HXe(e),qXe(e),w3(e),YXe(e),b3(e),T3(e),BXe(e)}var tKe=["u_tex","u_diffuse","u_emission","u_diffuse_tex"],nKe=["u_diffuse","u_diffuse_mat"];function BK(e){e.pbrMetallicRoughness=l(e.pbrMetallicRoughness)?e.pbrMetallicRoughness:{},e.pbrMetallicRoughness.roughnessFactor=1,e.pbrMetallicRoughness.metallicFactor=0}function kK(e){return l(e.index)}function UK(e){return Array.isArray(e)&&e.length===4}function Zme(e){let t=new Array(4);t[3]=e[3];for(let n=0;n<3;n++){let i=e[n];i<=.04045?t[n]=e[n]*.07739938080495357:t[n]=Math.pow((i+.055)*.9478672985781991,2.4)}return t}function iKe(e,t){t=t??{};let n=t.baseColorTextureNames??tKe,i=t.baseColorFactorNames??nKe;Ue.material(e,function(r){Ue.materialValue(r,function(o,s){n.indexOf(s)!==-1&&kK(o)?(BK(r),r.pbrMetallicRoughness.baseColorTexture=o):i.indexOf(s)!==-1&&UK(o)&&(BK(r),r.pbrMetallicRoughness.baseColorFactor=Zme(o))})}),MC(e,"KHR_techniques_webgl"),MC(e,"KHR_blend")}function LK(e,t){l(t)&&(UK(t)?e.pbrMetallicRoughness.baseColorFactor=Zme(t):kK(t)&&(e.pbrMetallicRoughness.baseColorTexture=t))}function Xme(e,t){l(t)&&(UK(t)?e.emissiveFactor=t.slice(0,3):kK(t)&&(e.emissiveTexture=t))}function rKe(e){Ue.material(e,function(t){let n=(t.extensions??{}).KHR_materials_common;if(!l(n))return;let i=n.values??{},r=i.ambient,o=i.diffuse,s=i.emission,a=i.transparency,c=n.doubleSided,u=n.transparent;BK(t),n.technique==="CONSTANT"?(Ih(e,"KHR_materials_unlit"),t.extensions=l(t.extensions)?t.extensions:{},t.extensions.KHR_materials_unlit={},LK(t,s),LK(t,r)):(LK(t,o),Xme(t,r),Xme(t,s)),l(c)&&(t.doubleSided=c),l(a)&&(l(t.pbrMetallicRoughness.baseColorFactor)?t.pbrMetallicRoughness.baseColorFactor[3]*=a:t.pbrMetallicRoughness.baseColorFactor=[1,1,1,a]),l(u)&&(t.alphaMode=u?"BLEND":"OPAQUE")}),MC(e,"KHR_materials_common")}var P3=IXe;function Kc(){}Kc.getError=function(e,t,n){let i=`Failed to load ${e}: ${t}`;l(n)&&l(n.message)&&(i+=` +${i.stack}`),i}isDestroyed(){return!1}destroy(){return this.unload(),le(this)}},cr=_J;var _ye={UNLOADED:0,LOADING:1,LOADED:2,PROCESSING:3,READY:4,FAILED:5};Object.freeze(_ye);var Ct=_ye;var RU=class extends cr{constructor(t){super(),t=t??H.EMPTY_OBJECT;let n=t.typedArray,i=t.resource,r=t.cacheKey;this._typedArray=n,this._resource=i,this._cacheKey=r,this._state=Ct.UNLOADED,this._promise=void 0}get cacheKey(){return this._cacheKey}get typedArray(){return this._typedArray}async load(){return l(this._promise)?this._promise:l(this._typedArray)?(this._promise=Promise.resolve(this),this._promise):(this._promise=SQe(this),this._promise)}static _fetchArrayBuffer(t){return t.fetchArrayBuffer()}unload(){this._typedArray=void 0}};async function SQe(e){let t=e._resource;e._state=Ct.LOADING;try{let n=await RU._fetchArrayBuffer(t);return e.isDestroyed()?void 0:(e._typedArray=new Uint8Array(n),e._state=Ct.READY,e)}catch(n){if(e.isDestroyed())return;e._state=Ct.FAILED;let i=`Failed to load external buffer: ${t.url}`;throw e.getError(i,n)}}var vv=RU;function wQe(e){let t=e?.extensions;if(l(t))return t.KHR_meshopt_compression??t.EXT_meshopt_compression}var ux=wQe;var A4n=(function(){var e="b9H79Tebbbe9ok9Geueu9Geub9Gbb9Gruuuuuuueu9Gvuuuuueu9Gduueu9Gluuuueu9Gvuuuuub9Gouuuuuub9Gluuuub9GiuuueuiE8AdilveoveovrrwrrrDDoDrbqqbelve9Weiiviebeoweuecj:Gdkr:PlCo9TW9T9VV95dbH9F9F939H79T9F9J9H229F9Jt9VV7bb8F9TW79O9V9Wt9FW9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aqci2gxal2hmarc;alfclfhParc;qlfceVhsarc;qofclVhzcbhHincdhOcbhAdnavci6mbar9cb83i;Ooar9cb83i;Goar9cb83i;yoar9cb83i;qoadaHfgoybbhCcbhXincbhwcbhQdninaoalfhLaoybbgKaC7aQVhQawcP0meaLhoaKhCawcefgwaXfai6mbkkcbhCarc;qofhwincwhYcwh8AdnaQaC93gocFeGgEcs0mbclh8AaEci0mbcdcbaEEh8Akdnaocw4cFeGgEcs0mbclhYaEci0mbcdcbaEEhYkaYa8AfhEawydbh3cwhYcwh8Adnaocz4cFeGg5cs0mbclh8Aa5ci0mbcdcba5Eh8AkaEa3fhEdnaocFFFFb0mbclhYaocFFF8F0mbcbcdaocjjjw6EhYkawaEa8AfaYfBdbawclfhwaCcefgCcw9hmbkaLhoaKhCaXczfgXai6mbkcbhocehwazhQinawaoaQydbarc;qofaocdtfydb6EhoaQclfhQawcefgwcw9hmbkaoclthAcihOkcbhEarc;qlfcbcjdz:xjjjb8AarcbBd;ilar9cb83i;aladh8Eaqh8Fakh3inarc;qlfadaEaEcb9h9Ral2falz:wjjjb8Aaia8Faia8F6EhadnaqaiaE9RaEaqfai6EgKcsfc9WGgoaK9nmbarc;qofaKfcbaoaK9Rz:xjjjb8AkadaEal2fhhcbhginagaAVcl4hXarc;alfagcdtfh8JaHh8Kcbh8Lina8LaHfhwdndndndndndndnagPlbedibkaKTmvahawfhoarc;qlfawfRbbhQarc;qofhwaahCinawaoRbbgYaQ9RgQcetaQcKtc8F91786bbawcefhwaoalfhoaYhQaEaCcufgC9hmbxvkkaKTmla8Kc9:Ghoa8LcitcwGh8Aarc;qlfawceVfRbbcwtarc;qlfawc9:GfRbbVhQarc;qofhwaahCinawa3aofRbbcwta8EaofRbbVgYaQ9RgQcetaQcztc8F917cFFiGa8A486bbaoalfhoawcefhwaYhQaEaCcufgC9hmbxlkkasa8Kc98GgQfhoa3aQfhYarc;qlfawc98GgQfRbbhCcwhwinaoRbbawtaCVhCaocefhoawcwfgwca9hmbxdkkaKTmdxekaKTmea8Lcith5ahaQfh8AcbhLina8ARbbhQcwhoaYhwinawRbbaotaQVhQawcefhwaocwfgoca9hmbkarc;qofaLfaQaC7aX93a5486bbaYalfhYa8Aalfh8AaQhCaLcefgLaK9hmbkka8Jydbh8AcbhLarc;qofhoincdhQcbhwinaQaoawfRbbcb9hfhQawcefgwcz9hmbkclhCcbhwinaCaoawfRbbcd0fhCawcefgwcz9hmbkcwhYcbhwinaYaoawfRbbcP0fhYawcefgwcz9hmbkaQaCaQaC6EgwaYawaY6Egwczawcz6Ea8Afh8AaoczfhoaLczfgLaK6mbka8Ja8ABdbka8Kcefh8Ka8Lcefg8Lcl9hmbkagcefggaO9hmbka8Eamfh8Ea8Faxfh8Fa3amfh3aEaxfgEai6mbkcbhocehwaPhQinawaoaQydbarc;alfaocdtfydb6EhoaQclfhQaOawcefgw9hmbkaraHcd4faAcdVaoaocdSE86bbaHclfgHal6mbkkabaefhgabcefhoalcd4g8McbaDEhkadcefh8Narc;abfceVhecbhmdndninaiam9nmearc;qofcbcjdz:xjjjb8Aagao9Rak6mdadamal2gwfhxcbhHa8Nawfhzaocbakz:xjjjbg8Fakfh3aqaiam9Ramaqfai6Egscsfgocl4cifcd4hOaoc9WGg8JThPindndndndndndndndndndnaDTmbaraHcd4fRbbgQciGPlbedlbkasTmdaxaHfhoarc;abfaHfRbbhQarc;qofhwashCinawaoRbbgYaQ9RgQcetaQcKtc8F91786bbawcefhwaoalfhoaYhQaCcufgCmbxikkasTmiaHcitcwGh8Aarc;abfaHceVfRbbcwtarc;abfaHc9:GgofRbbVhQaxaofhoarc;qofhwashCinawao8VbbgYaQ9RgQcetaQcztc8F917cFFiGa8A486bbawcefhwaoalfhoaYhQaCcufgCmbxikkaeaHc98Gg8Afhoaza8AfhYarc;abfa8AfRbbhCcwhwinaoRbbawtaCVhCaocefhoawcwfgwca9hmbkasTmdaQcl4hKaHcitcKGhEaxa8Afh8AcbhLina8ARbbhQcwhoaYhwinawRbbaotaQVhQawcefhwaocwfgoca9hmbkarc;qofaLfaQaC7aK93aE486bbaYalfhYa8Aalfh8AaQhCaLcefgLas9hmbkkaDmbcbhoxlka8JTmbcbhodninarc;qofaofgwcwf8Pibaw8Pib:e9qTmeaoczfgoa8J9pmdxbkkdnavmbcehoxikcbh8AaOhLaOhKinarc;qofa8Afgocwf8Pibhyao8Pibh8PcdhQcbhwinaQaoawfRbbcb9hfhQawcefgwcz9hmbkclhCcbhwinaCaoawfRbbcd0fhCawcefgwcz9hmbkcwhYcbhwinaYaoawfRbbcP0fhYawcefgwcz9hmbkaQaCaQaC6EgoaYaoaY6Egoczaocz6EaKfhKaocucbaya8P:e9cb9sEgwaoaw6EaLfhLa8Aczfg8Aa8J9pmdxbkka8FaHcd4fgoaoRbbcdaHcetcoGtV86bbxikdnaLas6mbaKas6mba8FaHcd4fgoaoRbbciaHcetcoGtV86bbaga39Ras6mra3arc;qofasz:wjjjbasfh3xikaLaK9phoka8FaHcd4fgwawRbbaoaHcetcoGtV86bbkaga39RaO6mla3cbaOz:xjjjbgaaOfhKdndna8JmbaPhoxekdnagaK9RcK9pmbaPhoxekaocdtc:q:G:cjbfcj:G:cjbaDEg3ydxghcetc;:FFFeGhAcuhEcuahtcu7cFeGh8Ecbh8Karc;qofhQinarc;qofa8KfhXczh8AdndndnahPDbeeeeeeedekcucbaXcwf8PibaX8Pib:e9cb9sEh8AxekcbhoaAh8Aina8Aa8EaQaofRbb9nfh8Aaocefgocz9hmbkkcih5cbhYinczhwdndndna3aYcdtfydbgLPDbeeeeeeedekcucbaXcwf8PibaX8Pib:e9cb9sEhwxekaLcetc;:FFFeGhwcuaLtcu7cFeGhCcbhoinawaCaQaofRbb9nfhwaocefgocz9hmbkkdndnawa8A6mbaLaE9hmeawa8A9hmea3a5cdtfydbcwSmekaYh5awh8AkaYcefgYci9hmbkaaa8Kco4fgoaoRbba5a8Kci4coGtV86bbdndndna3a5cdtfydbgEPDdbbbbbbbebkdncwaE9Tg5TmbcuaEtcu7hwdndnaEceSmbcbh8LaQhXinaXhoa5hYcbhCinaoRbbg8AawcFeGgLa8AaL6EaCaEtVhCaocefhoaYcufgYmbkaKaC86bbaXa5fhXaKcefhKa8La5fg8Lcz6mbxdkkcbh8LaQhXinaXhoa5hYcbhCinaoRbbg8AawcFeGgLa8AaL6EaCcetVhCaocefhoaYcufgYmbkaKaC:T9cFe:d9c:c:qj:bw9:9c:q;c1:I1e:d9c:b:c:e1z9:9ca188bbaXa5fhXaKcefhKa8La5fg8Lcz6mbkkcbhoinaKaQaofRbbgC86bbaKaCawcFeG9pfhKaocefgocz9hmbxikkdnaEceSmbinaKcb86bbaKcefhKxbkkinaKcb86bbaKcefhKxbkkaKaX8Pbw83bwaKaX8Pbb83bbaKczfhKka8Kczfg8Ka8J9pgomeaQczfhQagaK9RcK9pmbkkaoTmlaKh3aKTmlkaHcefgHal9hmbkarc;abfaxascufal2falz:wjjjb8Aasamfhma3hoa3mbkcbhwxdkdnagao9RakalfgwcKcaaDEgQawaQ0EgC9pmbcbhwxdkdnawaQ9pmbaocbaCaw9Rgwz:xjjjbawfhokaoarc;adfalz:wjjjbalfhodnaDTmbaoara8Mz:wjjjba8Mfhokaoab9Rhwxekcbhwkarc;qwf8Kjjjjbawk5babaeadaialcdcbyd;i:I:cjbz:bjjjbk9reduaecd4gdaefgicaaica0Eabcj;abae9Uc;WFbGcjdaeca0Egifcufai9Uae2aiadfaicl4cifcd4f2fcefkmbcbabBd;i:I:cjbk;HPeLu8Jjjjjbc;ae9Rgl8Kjjjjbcbhvdnaeaici9UgocHf6mbabcbyd;m:I:cjbgrc;GeV86bbalc;abfcFecjez:xjjjb8Aal9cu83iUal9cu83i8Wal9cu83iyal9cu83iaal9cu83iKal9cu83izal9cu83iwal9cu83ibabaefc9WfhwabcefgDaofhednaiTmbcmcsarcb9kgqEhkcbhxcbhmcbhPcbhscbhzindnaeaw9nmbcbhvxikazcufhvadaPcdtfgHydbhOaHcwfydbhAaHclfydbhCcbhXdndndninalc;abfavcsGcitfgoydlhQdndndnaoydbgoaO9hmbaQaCSmekdnaoaC9hmbaQaA9hmbaXcefhXxekaoaA9hmeaQaO9hmeaXcdfhXkaXc870mdascufhvaHaXcdtgAcxGgoyd:4:G:cjbcdtfydbhQaHaoyd:0:G:cjbcdtfydbhCaHaoyd:W:G:cjbcdtfydbhOcbhodnindnalavcsGcdtfydbaQ9hmbaohXxdkcuhXavcufhvaocefgocz9hmbkkaxaQaxSgvaXce9iaXak9oVgoGfhxdndndncbcsavEaXaoEgvcs9hmbarce9imbaQaQamaQcefamSgvEgmcefSmecmcsavEhvkaDavaAc;WeGV86bbavcs9hmeaQam9Rgvcetavc8F917hvinaecbcjeavcje6EavcFbGV86bbaecefheavcr4gvmbkaQhmxvkcPhvaDaAcPV86bbaQhmkavTmiavak9omicdhocehXazhAxlkavcufhvaXclfgXc;ab9hmbkkdnaHcecdcbaAaxSEaCaxSEcdtgvyd:W:G:cjbcdtfydbgOTaHavyd:0:G:cjbcdtfydbgCceSGaHavyd:4:G:cjbcdtfydbgQcdSGaxcb9hGaqGgLce9hmbal9cu83iUal9cu83i8Wal9cu83iyal9cu83iaal9cu83iKal9cu83izal9cu83iwal9cu83ibcbhxkcbhXascufgvhodnindnalaocsGcdtfydbaC9hmbaXhAxdkcuhAaocufhoaXcefgXcz9hmbkkcbhodnindnalavcsGcdtfydbaQ9hmbaohXxdkcuhXavcufhvaocefgocz9hmbkkaxaOaxSgKfhHdndnaAcm0mbaAcefhAxekcbcsaCaHSgvEhAaHavfhHkdndnaXcm0mbaXcefhXxekcbcsaQaHSgvEhXaHavfhHkc9:cuaKEhYcbhvaXaAcltVg8AcFeGhodndndninavc;q:G:cjbfRbbaoSmeavcefgvcz9hmbxdkkaLaOax9havcm0VVmbaDavc;WeV86bbxekaDaY86bbaea8A86bbaecefhekdnaKmbaOam9Rgvcetavc8F917hvinaecbcjeavcje6EavcFbGV86bbaecefheavcr4gvmbkaOhmkdnaAcs9hmbaCam9Rgvcetavc8F917hvinaecbcjeavcje6EavcFbGV86bbaecefheavcr4gvmbkaChmkdnaXcs9hmbaQam9Rgvcetavc8F917hvinaecbcjeavcje6EavcFbGV86bbaecefheavcr4gvmbkaQhmkalascdtfaOBdbascefcsGhvdndnaAPzbeeeeeeeeeeeeeebekalavcdtfaCBdbascdfcsGhvkdndnaXPzbeeeeeeeeeeeeeebekalavcdtfaQBdbavcefcsGhvkcihoalc;abfazcitfgXaOBdlaXaCBdbazcefcsGhAcdhXavhsaHhxxekcdhoalascdtfaQBdbcehXascefcsGhsazhAkalc;abfaAcitfgvaCBdlavaQBdbalc;abfazaXfcsGcitfgvaQBdlavaOBdbaDcefhDazaofcsGhzaPcifgPai6mbkkdnaeaw9nmbcbhvxekcbhvinaeavfavc;q:G:cjbfRbb86bbavcefgvcz9hmbkaeab9Ravfhvkalc;aef8KjjjjbavkZeeucbhddninadcefgdc8F0meaeceadt0mbkkadcrfcFeGcr9Uci2cdfabci9U2cHfkmbcbabBd;m:I:cjbk:zderu8Jjjjjbcz9Rhlcbhvdnaeaicvf6mbabcbRb;m:I:cjbc;qeV86bbal9cb83iwabcefhvabaefc98fhodnaiTmbcbhecbhrcbhwindnavao6mbcbskadawcdtfydbgDalcwfaraDae9Rgeaec8F91ge7ae9Rc507grcdtfgqydb9Rgec8E91c9:Gaecdt7arVheinavcbcjeaecje6EaecFbGV86bbavcefhvaecr4gembkaqaDBdbaDheawcefgwai9hmbkkdnavao9nmbcbskavcbBbbavab9RclfhvkavkBeeucbhddninadcefgdc8F0meaeceadt0mbkkabadcwfcFeGcr9U2cvfk:dvli99dui99ludnaeTmbcuadcetcuftcu7:Zhvdndncuaicuftcu7:ZgoJbbbZMgr:lJbbb9p9DTmbar:Ohwxekcjjjj94hwkcbhicbhDinalclfIdbgrJbbbbJbbjZalIdbgq:lar:lMalcwfIdbgk:lMgr:varJbbbb9BEgrNhxaqarNhralcxfIdbhqdndnakJbbbb9GTmbaxhkxekJbbjZar:l:tgkak:maxJbbbb9GEhkJbbjZax:l:tgxax:marJbbbb9GEhrkdndnaqJbbj:;aqJbbj:;9GEgxJbbjZaxJbbjZ9FEavNJbbbZJbbb:;aqJbbbb9GEMgq:lJbbb9p9DTmbaq:Ohmxekcjjjj94hmkdndnakJbbj:;akJbbj:;9GEgqJbbjZaqJbbjZ9FEaoNJbbbZJbbb:;akJbbbb9GEMgq:lJbbb9p9DTmbaq:OhPxekcjjjj94hPkdndnarJbbj:;arJbbj:;9GEgqJbbjZaqJbbjZ9FEaoNJbbbZJbbb:;arJbbbb9GEMgr:lJbbb9p9DTmbar:Ohsxekcjjjj94hskdndnadcl9hmbabaDfgzas86bbazcifam86bbazcdfaw86bbazcefaP86bbxekabaifgzas87ebazcofam87ebazclfaw87ebazcdfaP87ebkaicwfhiaDclfhDalczfhlaecufgembkkk;hlld99eud99eudnaeTmbdndncuaicuftcu7:ZgvJbbbZMgo:lJbbb9p9DTmbao:Ohixekcjjjj94hikaic;8FiGhrinabcofcicdalclfIdb:lalIdb:l9EgialcwfIdb:lalaicdtfIdb:l9EEgialcxfIdb:lalaicdtfIdb:l9EEgiarV87ebdndnJbbj:;JbbjZalaicdtfIdbJbbbb9DEgoalaicd7cdtfIdbJ;Zl:1ZNNgwJbbj:;awJbbj:;9GEgDJbbjZaDJbbjZ9FEavNJbbbZJbbb:;awJbbbb9GEMgw:lJbbb9p9DTmbaw:Ohqxekcjjjj94hqkabcdfaq87ebdndnalaicefciGcdtfIdbJ;Zl:1ZNaoNgwJbbj:;awJbbj:;9GEgDJbbjZaDJbbjZ9FEavNJbbbZJbbb:;awJbbbb9GEMgw:lJbbb9p9DTmbaw:Ohqxekcjjjj94hqkabaq87ebdndnaoalaicufciGcdtfIdbJ;Zl:1ZNNgoJbbj:;aoJbbj:;9GEgwJbbjZawJbbjZ9FEavNJbbbZJbbb:;aoJbbbb9GEMgo:lJbbb9p9DTmbao:Ohixekcjjjj94hikabclfai87ebabcwfhbalczfhlaecufgembkkk;gvdDue998Jjjjjbcjd9Rgo8Kjjjjbdndndnadcd4grTmbc:CucbavEhwaohdarhDinadawBdbadclfhdaDcufgDmbkavcd9hmbaeTmbarcdthqcbhkalhxinaohdaxhDarhwinadadydbgmaDydbcL4cFeGc:cufgPamaP9kEBdbaDclfhDadclfhdawcufgwmbkaxaqfhxakcefgkae9hmbxdkkaeTmekarcdthxavce9hhqcbhkindndndnaqmbarTmdc:CuhDalhdarhwinaDadydbcL4cFeGc:cufgmaDam9kEhDadclfhdawcufgwmbxdkkdndndndnavPleddbdkarTmlaohdalhDarhwinadcbaDydbcL4cFeGgmc:cufgPaPam0EBdbadclfhdaDclfhDawcufgwmbxikkarTmicbhdarhDindnaladfIdbgsJbbbb9Bmbaoadfas:8cL4cFeGgwc8Aawc8A0Ec:cufBdbkadclfhdaDcufgDmbxdkkarTmdkc:CuhDkcbhdarhminaDhwdnavceSmbaoadfydbhwkdndnaladfIdbgscjjj;8iawai9RcefgwcLt9R::NJbbbZJbbb:;asJbbbb9GEMgs:lJbbb9p9DTmbas:OhPxekcjjjj94hPkabadfaPcFFFrGawcKtVBdbadclfhdamcufgmmbkkabaxfhbalaxfhlakcefgkae9hmbkkaocjdf8Kjjjjbk:Olveue99iue99iudnaeTmbceaicufthvcuaitcu7:Zhocbhradcl9hhwcbhDindndnalcwfIdbgqJbbbbaqJbbbb9GEgqJbbjZaqJbbjZ9FEaoNJbbbZMgq:lJbbb9p9DTmbaq:Ohixekcjjjj94hikdndnalIdbgqJbbbbaqJbbbb9GEgqJbbjZaqJbbjZ9FEaoNJbbbZMgq:lJbbb9p9DTmbaq:Ohdxekcjjjj94hdkadai9Rcd9TgkaifhidndnalclfIdbgqJbbbbaqJbbbb9GEgqJbbjZaqJbbjZ9FEaoNJbbbZMgq:lJbbb9p9DTmbaq:Ohdxekcjjjj94hdkadai9Rcd9ThddndnalcxfIdbgqJbbbbaqJbbbb9GEgqJbbjZaqJbbjZ9FEaoNJbbbZMgq:lJbbb9p9DTmbaq:Ohxxekcjjjj94hxkadaifhiaxce91avVhxdndnawmbabaDfgmai86bbamcifax86bbamcdfad86bbamcefak86bbxekabarfgmai87ebamcofax87ebamclfad87ebamcdfak87ebkarcwfhraDclfhDalczfhlaecufgembkkk;mqdQui998Jjjjjbc:qd9Rgv8Kjjjjbavc:Sefcbc;Kbz:xjjjb8AdnadTmbaiTmbdndnabaeSmbaehoxekavcuadcdtgradcFFFFi0Ecbyd;q:I:cjbHjjjjbbgoBd:SeavceBd:mdaoaearz:wjjjb8AkavcbBd:Oeav9cb83i:Geavc:Gefaoadaiavc:Sefz:pjjjbavyd:Gehwadci9UgDcbyd;q:I:cjbHjjjjbbheavc:Sefavyd:mdgqcdtfaeBdbavaqcefgrBd:mdaecbaDz:xjjjbhkavc:SefarcdtfcuaicdtaicFFFFi0Ecbyd;q:I:cjbHjjjjbbgxBdbavaqcdfgmBd:mdalc;ebfhPawheaxhrinaralIdbaPaeydbgscwascw6EcdtfIdbMUdbaeclfhearclfhraicufgimbkavc:SefamcdtfcuaDcdtadcFFFF970Ecbyd;q:I:cjbHjjjjbbgmBdbdnadci6mbaoheamhraDhiinaraxaeydbcdtfIdbaxaeclfydbcdtfIdbMaxaecwfydbcdtfIdbMUdbaecxfhearclfhraicufgimbkkaqcifhzalc;ebfhHavc;qbfhOavheavyd:KehAavyd:OehCcbhscbhrcbhXcehQinaehLaoarcx2fgKydbhPaKclfydbhdabaXcx2fgecwfaKcwfydbgYBdbaeclfadBdbaeaPBdbakarfce86bbaOaYBdwaOadBdlaOaPBdbamarcdtfcbBdbcih8AdnasTmbaLhiinaOa8AcdtfaiydbgeBdba8AaeaY9haeaP9haead9hGGfh8AaiclfhiascufgsmbkkaXcefhXcbhsinaCaAaKascdtfydbcdtgifydbcdtfgYheawaifgdydbgPhidnaPTmbdninaeydbarSmeaeclfheaicufgiTmdxbkkaeaYaPcdtfc98fydbBdbadadydbcufBdbkascefgsci9hmbkdndndna8ATmbcuhrJbbbbhEcbhdavyd:KehYavyd:OehKindnawaOadcdtfydbcdtgsfydbgeTmbaxasfgiIdbh3aialcuadadcs0EcdtfclfIdbaHaecwaecw6EcdtfIdbMg5Udba5a3:th5aecdthiaKaYasfydbcdtfheinamaeydbgscdtfgPa5aPIdbMg3Udba3aEaEa39DgPEhEasaraPEhraeclfheaic98fgimbkkadcefgda8A9hmbkarcu9hmekaQaD9pmeindnakaQfRbbmbaQhrxdkaDaQcefgQ9hmbxdkka8Acza8Acz6EhsaOheaLhOarcu9hmekkazTmbaqcdtavc:Seffcwfheinaeydbcbyd;u:I:cjbH:bjjjbbaec98fheazcufgzmbkkavc:qdf8Kjjjjbk:0leoucuaicdtgvaicFFFFi0Egocbyd;q:I:cjbHjjjjbbhralalyd9GgwcdtfarBdbalawcefBd9GabarBdbaocbyd;q:I:cjbHjjjjbbhralalyd9GgocdtfarBdbalaocefBd9GabarBdlcuadcdtadcFFFFi0Ecbyd;q:I:cjbHjjjjbbhralalyd9GgocdtfarBdbalaocefBd9GabarBdwabydbcbavz:xjjjb8AabydbhraehladhvinaralydbcdtfgoaoydbcefBdbalclfhlavcufgvmbkcbhvabydlglhoarhwaihDinaoavBdbaoclfhoawydbavfhvawclfhwaDcufgDmbkadci9Uhqdnadcd9nmbabydwhocbhvinaecwfydbhwaeclfydbhDalaeydbcdtfgbabydbgbcefBdbaoabcdtfavBdbalaDcdtfgDaDydbgDcefBdbaoaDcdtfavBdbalawcdtfgwawydbgwcefBdbaoawcdtfavBdbaecxfheaqavcefgv9hmbkkinalalydbarydb9RBdbarclfhralclfhlaicufgimbkkQbabaeadaic;G:G:cjbz:ojjjbkQbabaeadaic;i:H:cjbz:ojjjbk9DeeuabcFeaicdtz:xjjjbhlcbhbdnadTmbindnalaeydbcdtfgiydbcu9hmbaiabBdbabcefhbkaeclfheadcufgdmbkkabk:3vioud9:du8Jjjjjbc;Wa9Rgl8Kjjjjbcbhvalcxfcbc;Kbz:xjjjb8AalcuadcitgoadcFFFFe0Ecbyd;q:I:cjbHjjjjbbgrBdxalceBd2araeadaicezNjjjbalcuaoadcjjjjoGEcbyd;q:I:cjbHjjjjbbgwBdzadcdthednadTmbabhiinaiavBdbaiclfhiadavcefgv9hmbkkawaefhDalabBdwalawBdl9cbhqindnadTmbaq9cq9:hkarhvaDhiadheinaiav8Pibak1:NcFrG87ebavcwfhvaicdfhiaecufgembkkalclfaq:NceGcdtfydbhxalclfaq9ce98gq:NceGcdtfydbhmalc;Wbfcbcjaz:xjjjb8AaDhvadhidnadTmbinalc;Wbfav8VebcdtfgeaeydbcefBdbavcdfhvaicufgimbkkcbhvcbhiinalc;WbfavfgeydbhoaeaiBdbaoaifhiavclfgvcja9hmbkadhvdndnadTmbinalc;WbfaDamydbgicetf8VebcdtfgeaeydbgecefBdbaxaecdtfaiBdbamclfhmavcufgvmbkaq9cv9smdcbhvinabawydbcdtfavBdbawclfhwadavcefgv9hmbxdkkaq9cv9smekkcwhvcbhiinalcxfavfc98fydbcbyd;u:I:cjbH:bjjjbbaiceGheclhvcehiaeTmbkalc;Waf8Kjjjjbk:Awliuo99iud9:cbhv8Jjjjjbca9Rgocbyd:4:I:cjbBdKaocb8Pd:W:I:cjb83izaocbyd;e:I:cjbBdwaocb8Pd:8:I:cjb83ibaicd4hrdndnadmbJFFuFhwJFFuuhDJFFuuhqJFFuFhkJFFuuhxJFFuFhmxekarcdthPaehsincbhiinaoczfaifgzasaifIdbgwazIdbgDaDaw9EEUdbaoaifgzawazIdbgDaDaw9DEUdbaiclfgicx9hmbkasaPfhsavcefgvad9hmbkaoIdKhDaoIdwhwaoIdChqaoIdlhkaoIdzhxaoIdbhmkdnadTmbJbbbbJbFu9hJbbbbamax:tgmamJbbbb9DEgmakaq:tgkakam9DEgkawaD:tgwawak9DEgw:vawJbbbb9BEhwdnalmbarcdthoindndnaeclfIdbaq:tawNJbbbZMgk:lJbbb9p9DTmbak:Ohixekcjjjj94hikai:S9cC:ghHdndnaeIdbax:tawNJbbbZMgk:lJbbb9p9DTmbak:Ohixekcjjjj94hikaHai:S:ehHdndnaecwfIdbaD:tawNJbbbZMgk:lJbbb9p9DTmbak:Ohixekcjjjj94hikabaHai:T9cy:g:e83ibaeaofheabcwfhbadcufgdmbxdkkarcdthoindndnaeIdbax:tawNJbbbZMgk:lJbbb9p9DTmbak:Ohixekcjjjj94hikai:SgH9ca:gaH9cz:g9cjjj;4s:d:eaH9cFe:d:e9cF:bj;4:pj;ar:d9c:bd9:9c:p;G:d;4j:E;ar:d9cH9:9c;d;H:W:y:m:g;d;Hb:d9cv9:9c;j:KM;j:KM;j:Kd:dhOdndnaeclfIdbaq:tawNJbbbZMgk:lJbbb9p9DTmbak:Ohixekcjjjj94hikai:SgH9ca:gaH9cz:g9cjjj;4s:d:eaH9cFe:d:e9cF:bj;4:pj;ar:d9c:bd9:9c:p;G:d;4j:E;ar:d9cH9:9c;d;H:W:y:m:g;d;Hb:d9cq9:9cM;j:KM;j:KM;jl:daO:ehOdndnaecwfIdbaD:tawNJbbbZMgk:lJbbb9p9DTmbak:Ohixekcjjjj94hikabaOai:SgH9ca:gaH9cz:g9cjjj;4s:d:eaH9cFe:d:e9cF:bj;4:pj;ar:d9c:bd9:9c:p;G:d;4j:E;ar:d9cH9:9c;d;H:W:y:m:g;d;Hb:d9cC9:9c:KM;j:KM;j:KMD:d:e83ibaeaofheabcwfhbadcufgdmbkkk9teiucbcbyd;y:I:cjbgeabcifc98GfgbBd;y:I:cjbdndnabZbcztgd9nmbcuhiabad9RcFFifcz4nbcuSmekaehikaik;LeeeudndnaeabVciGTmbabhixekdndnadcz9pmbabhixekabhiinaiaeydbBdbaiclfaeclfydbBdbaicwfaecwfydbBdbaicxfaecxfydbBdbaeczfheaiczfhiadc9Wfgdcs0mbkkadcl6mbinaiaeydbBdbaeclfheaiclfhiadc98fgdci0mbkkdnadTmbinaiaeRbb86bbaicefhiaecefheadcufgdmbkkabk;aeedudndnabciGTmbabhixekaecFeGc:b:c:ew2hldndnadcz9pmbabhixekabhiinaialBdbaicxfalBdbaicwfalBdbaiclfalBdbaiczfhiadc9Wfgdcs0mbkkadcl6mbinaialBdbaiclfhiadc98fgdci0mbkkdnadTmbinaiae86bbaicefhiadcufgdmbkkabk9teiucbcbyd;y:I:cjbgeabcrfc94GfgbBd;y:I:cjbdndnabZbcztgd9nmbcuhiabad9RcFFifcz4nbcuSmekaehikaikTeeucbabcbyd;y:I:cjbge9Rcifc98GaefgbBd;y:I:cjbdnabZbcztge9nmbabae9RcFFifcz4nb8Akkk;Sddbcj:Gdk;idbbbbdbbblbbbwbbbbbbbebbbdbbblbbbwbbbbbbbbbbbbbbbbbbbebbbdbbbbbbbebbbbbbbbbbbbbbbb4:h9w9N94:P:gW:j9O:ye9Pbbbbbb:l29hZ;69:9kZ;N;76Z;rg97Z;z;o9xZ8J;B85Z;:;u9yZ;b;k9HZ:2;Z9DZ9e:l9mZ59A8KZ:r;T3Z:A:zYZ79OHZ;j4::8::Y:D9V8:bbbb9s:49:Z8R:hBZ9M9M;M8:L;z;o8:;8:PG89q;x:J878R:hQ8::M:B;e87bbbbbbjZbbjZbbjZ:E;V;N8::Y:DsZ9i;H;68:xd;R8:;h0838:;W:NoZbbbb:WV9O8:uf888:9i;H;68:9c9G;L89;n;m9m89;D8Ko8:bbbbf:8tZ9m836ZS:2AZL;zPZZ818EZ9e:lxZ;U98F8:819E;68:FFuuFFuuFFuuFFuFFFuFFFuFbc;i:IdkCebbbebbbebbbdbbb9G:rbb",t=new Uint8Array([32,0,65,2,1,106,34,33,3,128,11,4,13,64,6,253,10,7,15,116,127,5,8,12,40,16,19,54,20,9,27,255,113,17,42,67,24,23,146,148,18,14,22,45,70,69,56,114,101,21,25,63,75,136,108,28,118,29,73,115]);if(typeof WebAssembly!="object")return{supported:!1};var n,i=WebAssembly.instantiate(r(e),{}).then(function(g){n=g.instance,n.exports.__wasm_call_ctors(),n.exports.meshopt_encodeVertexVersion(1),n.exports.meshopt_encodeIndexVersion(1)});function r(g){for(var m=new Uint8Array(g.length),y=0;y<g.length;++y){var A=g.charCodeAt(y);m[y]=A>96?A-97:A>64?A-39:A+4}for(var b=0,y=0;y<g.length;++y)m[b++]=m[y]<60?t[m[y]]:(m[y]-60)*64+m[++y];return m.buffer.slice(0,b)}function o(g){if(!g)throw new Error("Assertion failed")}function s(g){return new Uint8Array(g.buffer,g.byteOffset,g.byteLength)}function a(g,m,y,A){var b=n.exports.sbrk,x=b(m.length*4),T=b(y*4),E=new Uint8Array(n.exports.memory.buffer),v=s(m);E.set(v,x),A&&A(x,x,m.length,y);var S=g(T,x,m.length,y);E=new Uint8Array(n.exports.memory.buffer);var I=new Uint32Array(y);new Uint8Array(I.buffer).set(E.subarray(T,T+y*4)),v.set(E.subarray(x,x+m.length*4)),b(x-b(0));for(var R=0;R<m.length;++R)m[R]=I[m[R]];return[I,S]}function c(g,m,y,A){var b=n.exports.sbrk,x=b(y*4),T=b(y*A),E=new Uint8Array(n.exports.memory.buffer);E.set(s(m),T),g(x,T,y,A),E=new Uint8Array(n.exports.memory.buffer);var v=new Uint32Array(y);return new Uint8Array(v.buffer).set(E.subarray(x,x+y*4)),b(x-b(0)),v}function u(g,m,y,A,b,x,T){var E=n.exports.sbrk,v=E(m),S=E(A*b),I=new Uint8Array(n.exports.memory.buffer);I.set(s(y),S);var R=g(v,m,S,A,b,x,T),O=new Uint8Array(R);return O.set(I.subarray(v,v+R)),E(v-E(0)),O}function f(g){for(var m=0,y=0;y<g.length;++y){var A=g[y];m=m<A?A:m}return m}function d(g,m){if(o(m==2||m==4),m==4)return new Uint32Array(g.buffer,g.byteOffset,g.byteLength/4);var y=new Uint16Array(g.buffer,g.byteOffset,g.byteLength/2);return new Uint32Array(y)}function p(g,m,y,A,b,x,T){var E=n.exports.sbrk,v=E(y*A),S=E(y*x),I=new Uint8Array(n.exports.memory.buffer);I.set(s(m),S),g(v,y,A,b,S,T);var R=new Uint8Array(y*A);return R.set(I.subarray(v,v+y*A)),E(v-E(0)),R}return{ready:i,supported:!0,reorderMesh:function(g,m,y){o(g instanceof Uint32Array||g instanceof Int32Array),o(!m||g.length%3==0);var A=m?y?n.exports.meshopt_optimizeVertexCacheStrip:n.exports.meshopt_optimizeVertexCache:void 0;return a(n.exports.meshopt_optimizeVertexFetchRemap,g,f(g)+1,A)},reorderPoints:function(g,m){return o(g instanceof Float32Array),o(g.length%m==0),o(m>=3),c(n.exports.meshopt_spatialSortRemap,g,g.length/m,m*4)},encodeVertexBuffer:function(g,m,y){o(y>0&&y<=256),o(y%4==0);var A=n.exports.meshopt_encodeVertexBufferBound(m,y);return u(n.exports.meshopt_encodeVertexBuffer,A,g,m,y)},encodeVertexBufferLevel:function(g,m,y,A,b){o(y>0&&y<=256),o(y%4==0),o(A>=0&&A<=3),o(b===void 0||b==0||b==1);var x=n.exports.meshopt_encodeVertexBufferBound(m,y);return u(n.exports.meshopt_encodeVertexBufferLevel,x,g,m,y,A,b===void 0?-1:b)},encodeIndexBuffer:function(g,m,y){o(y==2||y==4),o(m%3==0);var A=d(g,y),b=n.exports.meshopt_encodeIndexBufferBound(m,f(A)+1);return u(n.exports.meshopt_encodeIndexBuffer,b,A,m,4)},encodeIndexSequence:function(g,m,y){o(y==2||y==4);var A=d(g,y),b=n.exports.meshopt_encodeIndexSequenceBound(m,f(A)+1);return u(n.exports.meshopt_encodeIndexSequence,b,A,m,4)},encodeGltfBuffer:function(g,m,y,A,b){var x={ATTRIBUTES:this.encodeVertexBufferLevel,TRIANGLES:this.encodeIndexBuffer,INDICES:this.encodeIndexSequence};return o(x[A]),x[A](g,m,y,2,b===void 0?0:b)},encodeFilterOct:function(g,m,y,A){return o(y==4||y==8),o(A>=2&&A<=16),p(n.exports.meshopt_encodeFilterOct,g,m,y,A,16)},encodeFilterQuat:function(g,m,y,A){return o(y==8),o(A>=4&&A<=16),p(n.exports.meshopt_encodeFilterQuat,g,m,y,A,16)},encodeFilterExp:function(g,m,y,A,b){o(y>0&&y%4==0),o(A>=1&&A<=24);var x={Separate:0,SharedVector:1,SharedComponent:2,Clamped:3};return o(!b||b in x),p(n.exports.meshopt_encodeFilterExp,g,m,y,A,y,b?x[b]:1)},encodeFilterColor:function(g,m,y,A){return o(y==4||y==8),o(A>=2&&A<=16),p(n.exports.meshopt_encodeFilterColor,g,m,y,A,16)}}})();var Ty=(function(){var e="b9H79Tebbbe8Fv9Gbb9Gvuuuuueu9Giuuub9Geueu9Giuuueuixkbeeeddddillviebeoweuecj:Gdkr;Neqo9TW9T9VV95dbH9F9F939H79T9F9J9H229F9Jt9VV7bb8A9TW79O9V9Wt9F9KW9J9V9KW9wWVtW949c919M9MWVbeY9TW79O9V9Wt9F9KW9J9V9KW69U9KW949c919M9MWVbdE9TW79O9V9Wt9F9KW9J9V9KW69U9KW949tWG91W9U9JWbiL9TW79O9V9Wt9F9KW9J9V9KWS9P2tWV9p9JtblK9TW79O9V9Wt9F9KW9J9V9KWS9P2tWV9r919HtbvL9TW79O9V9Wt9F9KW9J9V9KWS9P2tWVT949WboY9TW79O9V9Wt9F9KW9J9V9KWS9P2tWVJ9V29VVbrl79IV9Rbwq1Zkdbk:kYi5ud9:du8Jjjjjbcjq9Rgv8Kjjjjbc9:hodnalTmbcuhoaiRbbgrc;WeGc:Ge9hmbarcsGgwce0mbc9:hoalcufadcd4cbawEgDadfgrcKcaawEgqaraq0Egk6mbaicefhxcj;abad9Uc;WFbGcjdadca0EhmaialfgPar9Rgoadfhsavaoadz:jjjjbgzceVhHcbhOdndninaeaO9nmeaPax9RaD6mdamaeaO9RaOamfgoae6EgAcsfglc9WGhCaAcethXaxaDfhiaOaeaoaeao6E9RhQalcl4cifcd4hLazcjdfaAfhKcbhYabaOad2fg8AhEaHh3incbh5dnawTmbaxaYcd4fRbbh5kcbh8Eazcjdfhqinaih8Fdndndndna5a8Ecet4ciGgoc9:fPdebdkaPa8F9RaA6mrazcjdfa8EaA2fa8FaAz:jjjjb8Aa8FaAfhixdkazcjdfa8EaA2fcbaAz:kjjjb8Aa8FhixekaPa8F9RaL6mva8FaLfhidnaCTmbaPai9RcK6mbaocdtc:q:G:cjbfcj:G:cjbawEhaczhrcbhlinargoc9Wfghaqfhrdndndndndndnaaa8Fahco4fRbbalcoG4ciGcdtfydbPDbedvivvvlvkar9cb83bwar9cb83bbxlkarcbaiRbdai8Xbb9c:c:qj:bw9:9c:q;c1:I1e:d9c:b:c:e1z9:gg9cjjjjjz:dg8J9qE86bbaqaofgrcGfcbaicdfa8J9c8N1:NfghRbbag9cjjjjjw:dg8J9qE86bbarcVfcbaha8J9c8M1:NfghRbbag9cjjjjjl:dg8J9qE86bbarc7fcbaha8J9c8L1:NfghRbbag9cjjjjjd:dg8J9qE86bbarctfcbaha8J9c8K1:NfghRbbag9cjjjjje:dg8J9qE86bbarc91fcbaha8J9c8J1:NfghRbbag9cjjjj;ab:dg8J9qE86bbarc4fcbaha8J9cg1:NfghRbbag9cjjjja:dg8J9qE86bbarc93fcbaha8J9ch1:NfghRbbag9cjjjjz:dgg9qE86bbarc94fcbahag9ca1:NfghRbbai8Xbe9c:c:qj:bw9:9c:q;c1:I1e:d9c:b:c:e1z9:gg9cjjjjjz:dg8J9qE86bbarc95fcbaha8J9c8N1:NfgiRbbag9cjjjjjw:dg8J9qE86bbarc96fcbaia8J9c8M1:NfgiRbbag9cjjjjjl:dg8J9qE86bbarc97fcbaia8J9c8L1:NfgiRbbag9cjjjjjd:dg8J9qE86bbarc98fcbaia8J9c8K1:NfgiRbbag9cjjjjje:dg8J9qE86bbarc99fcbaia8J9c8J1:NfgiRbbag9cjjjj;ab:dg8J9qE86bbarc9:fcbaia8J9cg1:NfgiRbbag9cjjjja:dg8J9qE86bbarcufcbaia8J9ch1:NfgiRbbag9cjjjjz:dgg9qE86bbaiag9ca1:NfhixikaraiRblaiRbbghco4g8Ka8KciSg8KE86bbaqaofgrcGfaiclfa8Kfg8KRbbahcl4ciGg8La8LciSg8LE86bbarcVfa8Ka8Lfg8KRbbahcd4ciGg8La8LciSg8LE86bbarc7fa8Ka8Lfg8KRbbahciGghahciSghE86bbarctfa8Kahfg8KRbbaiRbeghco4g8La8LciSg8LE86bbarc91fa8Ka8Lfg8KRbbahcl4ciGg8La8LciSg8LE86bbarc4fa8Ka8Lfg8KRbbahcd4ciGg8La8LciSg8LE86bbarc93fa8Ka8Lfg8KRbbahciGghahciSghE86bbarc94fa8Kahfg8KRbbaiRbdghco4g8La8LciSg8LE86bbarc95fa8Ka8Lfg8KRbbahcl4ciGg8La8LciSg8LE86bbarc96fa8Ka8Lfg8KRbbahcd4ciGg8La8LciSg8LE86bbarc97fa8Ka8Lfg8KRbbahciGghahciSghE86bbarc98fa8KahfghRbbaiRbigico4g8Ka8KciSg8KE86bbarc99faha8KfghRbbaicl4ciGg8Ka8KciSg8KE86bbarc9:faha8KfghRbbaicd4ciGg8Ka8KciSg8KE86bbarcufaha8KfgrRbbaiciGgiaiciSgiE86bbaraifhixdkaraiRbwaiRbbghcl4g8Ka8KcsSg8KE86bbaqaofgrcGfaicwfa8Kfg8KRbbahcsGghahcsSghE86bbarcVfa8KahfghRbbaiRbeg8Kcl4g8La8LcsSg8LE86bbarc7faha8LfghRbba8KcsGg8Ka8KcsSg8KE86bbarctfaha8KfghRbbaiRbdg8Kcl4g8La8LcsSg8LE86bbarc91faha8LfghRbba8KcsGg8Ka8KcsSg8KE86bbarc4faha8KfghRbbaiRbig8Kcl4g8La8LcsSg8LE86bbarc93faha8LfghRbba8KcsGg8Ka8KcsSg8KE86bbarc94faha8KfghRbbaiRblg8Kcl4g8La8LcsSg8LE86bbarc95faha8LfghRbba8KcsGg8Ka8KcsSg8KE86bbarc96faha8KfghRbbaiRbvg8Kcl4g8La8LcsSg8LE86bbarc97faha8LfghRbba8KcsGg8Ka8KcsSg8KE86bbarc98faha8KfghRbbaiRbog8Kcl4g8La8LcsSg8LE86bbarc99faha8LfghRbba8KcsGg8Ka8KcsSg8KE86bbarc9:faha8KfghRbbaiRbrgicl4g8Ka8KcsSg8KE86bbarcufaha8KfgrRbbaicsGgiaicsSgiE86bbaraifhixekarai8Pbw83bwarai8Pbb83bbaiczfhikdnaoaC9pmbalcdfhlaoczfhraPai9RcL0mekkaoaC6moaimexokaCmva8FTmvkaqaAfhqa8Ecefg8Ecl9hmbkdndndndnawTmbasaYcd4fRbbgociGPlbedrbkaATmdazaYfh8Fazcjdfhhcbh8EaEhaina8FRbbhraahocbhlinaoahalfRbbgqce4cbaqceG9R7arfgr86bbaoadfhoaAalcefgl9hmbkaacefhaa8Fcefh8FahaAfhha8Ecefg8Ecl9hmbxikkaATmeazaYfhaazcjdfhhcbhoceh8EaKh8FinaEaofhlaa8Vbbhrcbhoinala8FaofRbbcwtahaofRbbgqVc;:FiGce4cbaqceG9R7arfgr87bbaladfhlaQaocefgofmbka8FaXfh8FcdhoaacdfhaahaXfhha8EceGhlcbh8EalmbxdkkaATmbaocl4h8EazaYfRbbhqcwhoa3hlinalRbbaotaqVhqalcefhlaocwfgoca9hmbkcbhhaEh8FaKhainazcjdfahfRbbhrcwhoaahlinalRbbaotarVhralaAfhlaocwfgoca9hmbkara8E94aq7hqcbhoa8Fhlinalaqao486bbalcefhlaocwfgoca9hmbka8Fadfh8FaacefhaahcefghaA9hmbkkaEclfhEa3clfh3aYclfgYad6mbkaza8AaAcufad2fadz:jjjjb8AaAaOfhOaihxaimbkc9:hoxdkcbc99aPax9RakSEhoxekc9:hokavcjqf8Kjjjjbaok:ysezu8Jjjjjbc;ae9Rgv8Kjjjjbc9:hodnalaeci9UgrcHf6mbcuhoaiRbbgwc;WeGc;Ge9hmbawcsGgDce0mbavc;abfcFecjez:kjjjb8Aav9cu83iUav9cu83i8Wav9cu83iyav9cu83iaav9cu83iKav9cu83izav9cu83iwav9cu83ibaialfc9WfhqaicefgwarfhldnaeTmbcmcsaDceSEhkcbhxcbhmcbhrcbhicbhoindnalaq9nmbc9:hoxikdndnawRbbgDc;Ve0mbavc;abfaoaDcu7gPcl4fcsGcitfgsydlhzasydbhHdndnaDcsGgsak9pmbavaiaPfcsGcdtfydbaxasEhDaxasTgOfhxxekdndnascsSmbcehOasc987asamffcefhDxekalcefhDal8SbbgscFeGhPdndnascu9mmbaDhlxekalcvfhlaPcFbGhPcrhsdninaD8SbbgOcFbGastaPVhPaOcu9kmeaDcefhDascrfgsc8J9hmbxdkkaDcefhlkcehOaPce4cbaPceG9R7amfhDkaDhmkavc;abfaocitfgsaDBdbasazBdlavaicdtfaDBdbavc;abfaocefcsGcitfgsaHBdbasaDBdlaocdfhoaOaifhidnadcd9hmbabarcetfgsaH87ebasclfaD87ebascdfaz87ebxdkabarcdtfgsaHBdbascwfaDBdbasclfazBdbxekdnaDcpe0mbavaiaqaDcsGfRbbgscl4gP9RcsGcdtfydbaxcefgOaPEhDavaias9RcsGcdtfydbaOaPTgzfgOascsGgPEhsaPThPdndnadcd9hmbabarcetfgHax87ebaHclfas87ebaHcdfaD87ebxekabarcdtfgHaxBdbaHcwfasBdbaHclfaDBdbkavaicdtfaxBdbavc;abfaocitfgHaDBdbaHaxBdlavaicefgicsGcdtfaDBdbavc;abfaocefcsGcitfgHasBdbaHaDBdlavaiazfgicsGcdtfasBdbavc;abfaocdfcsGcitfgDaxBdbaDasBdlaocifhoaiaPfhiaOaPfhxxekaxcbalRbbgsEgHaDc;:eSgDfhOascsGhAdndnascl4gCmbaOcefhzxekaOhzavaiaC9RcsGcdtfydbhOkdndnaAmbazcefhxxekazhxavaias9RcsGcdtfydbhzkdndnaDTmbalcefhDxekalcdfhDal8SbegPcFeGhsdnaPcu9kmbalcofhHascFbGhscrhldninaD8SbbgPcFbGaltasVhsaPcu9kmeaDcefhDalcrfglc8J9hmbkaHhDxekaDcefhDkasce4cbasceG9R7amfgmhHkdndnaCcsSmbaDhsxekaDcefhsaD8SbbglcFeGhPdnalcu9kmbaDcvfhOaPcFbGhPcrhldninas8SbbgDcFbGaltaPVhPaDcu9kmeascefhsalcrfglc8J9hmbkaOhsxekascefhskaPce4cbaPceG9R7amfgmhOkdndnaAcsSmbashlxekascefhlas8SbbgDcFeGhPdnaDcu9kmbascvfhzaPcFbGhPcrhDdninal8SbbgscFbGaDtaPVhPascu9kmealcefhlaDcrfgDc8J9hmbkazhlxekalcefhlkaPce4cbaPceG9R7amfgmhzkdndnadcd9hmbabarcetfgDaH87ebaDclfaz87ebaDcdfaO87ebxekabarcdtfgDaHBdbaDcwfazBdbaDclfaOBdbkavc;abfaocitfgDaOBdbaDaHBdlavaicdtfaHBdbavc;abfaocefcsGcitfgDazBdbaDaOBdlavaicefgicsGcdtfaOBdbavc;abfaocdfcsGcitfgDaHBdbaDazBdlavaiaCTaCcsSVfgicsGcdtfazBdbaiaATaAcsSVfhiaocifhokawcefhwaocsGhoaicsGhiarcifgrae6mbkkcbc99alaqSEhokavc;aef8Kjjjjbaok:clevu8Jjjjjbcz9Rhvdnalaecvf9pmbc9:skdnaiRbbc;:eGc;qeSmbcuskav9cb83iwaicefhoaialfc98fhrdnaeTmbdnadcdSmbcbhwindnaoar6mbc9:skaocefhlao8SbbgicFeGhddndnaicu9mmbalhoxekaocvfhoadcFbGhdcrhidninal8SbbgDcFbGaitadVhdaDcu9kmealcefhlaicrfgic8J9hmbxdkkalcefhokabawcdtfadc8Etc8F91adcd47avcwfadceGcdtVglydbfgiBdbalaiBdbawcefgwae9hmbxdkkcbhwindnaoar6mbc9:skaocefhlao8SbbgicFeGhddndnaicu9mmbalhoxekaocvfhoadcFbGhdcrhidninal8SbbgDcFbGaitadVhdaDcu9kmealcefhlaicrfgic8J9hmbxdkkalcefhokabawcetfadc8Etc8F91adcd47avcwfadceGcdtVglydbfgi87ebalaiBdbawcefgwae9hmbkkcbc99aoarSEk:Lvoeue99dud99eud99dndnadcl9hmbaeTmeindndnabcdfgd8Sbb:Yab8Sbbgi:Ygl:l:tabcefgv8Sbbgo:Ygr:l:tgwJbb;:9cawawNJbbbbawawJbbbb9GgDEgq:mgkaqaicb9iEalMgwawNakaqaocb9iEarMgqaqNMM:r:vglNJbbbZJbbb:;aDEMgr:lJbbb9p9DTmbar:Ohixekcjjjj94hikadai86bbdndnaqalNJbbbZJbbb:;aqJbbbb9GEMgq:lJbbb9p9DTmbaq:Ohdxekcjjjj94hdkavad86bbdndnawalNJbbbZJbbb:;awJbbbb9GEMgw:lJbbb9p9DTmbaw:Ohdxekcjjjj94hdkabad86bbabclfhbaecufgembxdkkaeTmbindndnabclfgd8Ueb:Yab8Uebgi:Ygl:l:tabcdfgv8Uebgo:Ygr:l:tgwJb;:FSawawNJbbbbawawJbbbb9GgDEgq:mgkaqaicb9iEalMgwawNakaqaocb9iEarMgqaqNMM:r:vglNJbbbZJbbb:;aDEMgr:lJbbb9p9DTmbar:Ohixekcjjjj94hikadai87ebdndnaqalNJbbbZJbbb:;aqJbbbb9GEMgq:lJbbb9p9DTmbaq:Ohdxekcjjjj94hdkavad87ebdndnawalNJbbbZJbbb:;awJbbbb9GEMgw:lJbbb9p9DTmbaw:Ohdxekcjjjj94hdkabad87ebabcwfhbaecufgembkkk:4ioiue99dud99dud99dnaeTmbcbhiabhlindndnal8Uebgv:YgoJ:ji:1Salcof8UebgrciVgw:Y:vgDNJbbbZJbbb:;avcu9kEMgq:lJbbb9p9DTmbaq:Ohkxekcjjjj94hkkalclf8Uebhvalcdf8UebhxalarcefciGcetfak87ebdndnax:YgqaDNJbbbZJbbb:;axcu9kEMgm:lJbbb9p9DTmbam:Ohxxekcjjjj94hxkabaiarciGgkfcd7cetfax87ebdndnav:YgmaDNJbbbZJbbb:;avcu9kEMgP:lJbbb9p9DTmbaP:Ohvxekcjjjj94hvkalarcufciGcetfav87ebdndnawaw2:ZgPaPMaoaoN:taqaqN:tamamN:tgoJbbbbaoJbbbb9GE:raDNJbbbZMgD:lJbbb9p9DTmbaD:Ohrxekcjjjj94hrkalakcetfar87ebalcwfhlaiclfhiaecufgembkkk9mbdnadcd4ae2gdTmbinababydbgecwtcw91:Yaece91cjjj98Gcjjj;8if::NUdbabclfhbadcufgdmbkkk:Tvirud99eudndnadcl9hmbaeTmeindndnabRbbgiabcefgl8Sbbgvabcdfgo8Sbbgrf9R:YJbbuJabcifgwRbbgdce4adVgDcd4aDVgDcl4aDVgD:Z:vgqNJbbbZMgk:lJbbb9p9DTmbak:Ohxxekcjjjj94hxkaoax86bbdndnaraif:YaqNJbbbZMgk:lJbbb9p9DTmbak:Ohoxekcjjjj94hokalao86bbdndnavaifar9R:YaqNJbbbZMgk:lJbbb9p9DTmbak:Ohixekcjjjj94hikabai86bbdndnaDadcetGadceGV:ZaqNJbbbZMgq:lJbbb9p9DTmbaq:Ohdxekcjjjj94hdkawad86bbabclfhbaecufgembxdkkaeTmbindndnab8Vebgiabcdfgl8Uebgvabclfgo8Uebgrf9R:YJbFu9habcofgw8Vebgdce4adVgDcd4aDVgDcl4aDVgDcw4aDVgD:Z:vgqNJbbbZMgk:lJbbb9p9DTmbak:Ohxxekcjjjj94hxkaoax87ebdndnaraif:YaqNJbbbZMgk:lJbbb9p9DTmbak:Ohoxekcjjjj94hokalao87ebdndnavaifar9R:YaqNJbbbZMgk:lJbbb9p9DTmbak:Ohixekcjjjj94hikabai87ebdndnaDadcetGadceGV:ZaqNJbbbZMgq:lJbbb9p9DTmbaq:Ohdxekcjjjj94hdkawad87ebabcwfhbaecufgembkkk9teiucbcbyd:K:G:cjbgeabcifc98GfgbBd:K:G:cjbdndnabZbcztgd9nmbcuhiabad9RcFFifcz4nbcuSmekaehikaik;LeeeudndnaeabVciGTmbabhixekdndnadcz9pmbabhixekabhiinaiaeydbBdbaiclfaeclfydbBdbaicwfaecwfydbBdbaicxfaecxfydbBdbaeczfheaiczfhiadc9Wfgdcs0mbkkadcl6mbinaiaeydbBdbaeclfheaiclfhiadc98fgdci0mbkkdnadTmbinaiaeRbb86bbaicefhiaecefheadcufgdmbkkabk;aeedudndnabciGTmbabhixekaecFeGc:b:c:ew2hldndnadcz9pmbabhixekabhiinaialBdbaicxfalBdbaicwfalBdbaiclfalBdbaiczfhiadc9Wfgdcs0mbkkadcl6mbinaialBdbaiclfhiadc98fgdci0mbkkdnadTmbinaiae86bbaicefhiadcufgdmbkkabkk83dbcj:Gdk8Kbbbbdbbblbbbwbbbbbbbebbbdbbblbbbwbbbbc:K:Gdkl8W:qbb",t="b9H79TebbbeKl9Gbb9Gvuuuuueu9Giuuub9Geueuixkbbebeeddddilve9Weeeviebeoweuecj:Gdkr;Neqo9TW9T9VV95dbH9F9F939H79T9F9J9H229F9Jt9VV7bb8A9TW79O9V9Wt9F9KW9J9V9KW9wWVtW949c919M9MWVbdY9TW79O9V9Wt9F9KW9J9V9KW69U9KW949c919M9MWVblE9TW79O9V9Wt9F9KW9J9V9KW69U9KW949tWG91W9U9JWbvL9TW79O9V9Wt9F9KW9J9V9KWS9P2tWV9p9JtboK9TW79O9V9Wt9F9KW9J9V9KWS9P2tWV9r919HtbrL9TW79O9V9Wt9F9KW9J9V9KWS9P2tWVT949WbwY9TW79O9V9Wt9F9KW9J9V9KWS9P2tWVJ9V29VVbDl79IV9Rbqq:59Dklbzik94evu8Jjjjjbcz9Rhbcbheincbhdcbhiinabcwfadfaicjuaead4ceGglE86bbaialfhiadcefgdcw9hmbkaeai86b:q:W:cjbaecitab8Piw83i:q:G:cjbaecefgecjd9hmbkk:SBlEud97dur978Jjjjjbcj;kb9Rgv8Kjjjjbc9:hodnalTmbcuhoaiRbbgrc;WeGc:Ge9hmbarcsGgwce0mbc9:hoalcufadcd4cbawEgDadfgrcKcaawEgqaraq0Egk6mbaialfgxar9RhodnadTgmmbavaoad;8qbbkaicefhPcj;abad9Uc;WFbGcjdadca0EhsdndndnadTmbaoadfhzcbhHinaeaH9nmdaxaP9RaD6miabaHad2fgOavcjdfasaeaH9RaHasfae6EgAaAcsfgoc9WGgCSEhXaPaDfhQaocl4cifcd4hLavcj;cbfaCcetfhKavcj;cbfaCci2fhYavcj;cbfaCfh8AcbhEaoc;ab6h3incbh5dnawTmbaPaEcd4fRbbh5kcbh8Eavcj;cbfh8Findndndndna5a8Ecet4ciGgoc9:fPdebdkaxaQ9RaC6mwdnaCTmbavcj;cbfa8EaC2faQaC;8qbbkaQaAfhQxdkaCTmeavcj;cbfa8EaC2fcbaC;8kbxekaxaQ9RaL6moaoclVcbawEhraQaLfhocbhidna3mbaxao9Rc;Gb6mbcbhlina8FalfhidndndndndndnaQalco4fRbbgqciGarfPDbedibledibkaipxbbbbbbbbbbbbbbbbpklbxlkaiaopbblaopbbbgaclp:meaapmbzeHdOiAlCvXoQrLgacdp:meaapmbzeHdOiAlCvXoQrLpxiiiiiiiiiiiiiiiip9oghpxiiiiiiiiiiiiiiiip8Jgap5b9cjF;8;4;W;G;ab9:9cU1:Nggcitpbi:q:G:cjbagRb:q:W:cjbggpsaap5e9cjF;8;4;W;G;ab9:9cU1:Ng8Jcitpbi:q:G:cjbp9UpmbedilvorzHOACXQLpPahaap9spklbagaoclffa8JRb:q:W:cjbfhoxikaiaopbbwaopbbbgaclp:meaapmbzeHdOiAlCvXoQrLpxssssssssssssssssp9oghpxssssssssssssssssp8Jgap5b9cjF;8;4;W;G;ab9:9cU1:Nggcitpbi:q:G:cjbagRb:q:W:cjbggpsaap5e9cjF;8;4;W;G;ab9:9cU1:Ng8Jcitpbi:q:G:cjbp9UpmbedilvorzHOACXQLpPahaap9spklbagaocwffa8JRb:q:W:cjbfhoxdkaiaopbbbpklbaoczfhoxekaiaopbbdaoRbbggcitpbi:q:G:cjbagRb:q:W:cjbggpsaoRbeg8Jcitpbi:q:G:cjbp9UpmbedilvorzHOACXQLpPpklbagaocdffa8JRb:q:W:cjbfhokdndndndndndnaqcd4ciGarfPDbedibledibkaiczfpxbbbbbbbbbbbbbbbbpklbxlkaiczfaopbblaopbbbgaclp:meaapmbzeHdOiAlCvXoQrLgacdp:meaapmbzeHdOiAlCvXoQrLpxiiiiiiiiiiiiiiiip9oghpxiiiiiiiiiiiiiiiip8Jgap5b9cjF;8;4;W;G;ab9:9cU1:Nggcitpbi:q:G:cjbagRb:q:W:cjbggpsaap5e9cjF;8;4;W;G;ab9:9cU1:Ng8Jcitpbi:q:G:cjbp9UpmbedilvorzHOACXQLpPahaap9spklbagaoclffa8JRb:q:W:cjbfhoxikaiczfaopbbwaopbbbgaclp:meaapmbzeHdOiAlCvXoQrLpxssssssssssssssssp9oghpxssssssssssssssssp8Jgap5b9cjF;8;4;W;G;ab9:9cU1:Nggcitpbi:q:G:cjbagRb:q:W:cjbggpsaap5e9cjF;8;4;W;G;ab9:9cU1:Ng8Jcitpbi:q:G:cjbp9UpmbedilvorzHOACXQLpPahaap9spklbagaocwffa8JRb:q:W:cjbfhoxdkaiczfaopbbbpklbaoczfhoxekaiczfaopbbdaoRbbggcitpbi:q:G:cjbagRb:q:W:cjbggpsaoRbeg8Jcitpbi:q:G:cjbp9UpmbedilvorzHOACXQLpPpklbagaocdffa8JRb:q:W:cjbfhokdndndndndndnaqcl4ciGarfPDbedibledibkaicafpxbbbbbbbbbbbbbbbbpklbxlkaicafaopbblaopbbbgaclp:meaapmbzeHdOiAlCvXoQrLgacdp:meaapmbzeHdOiAlCvXoQrLpxiiiiiiiiiiiiiiiip9oghpxiiiiiiiiiiiiiiiip8Jgap5b9cjF;8;4;W;G;ab9:9cU1:Nggcitpbi:q:G:cjbagRb:q:W:cjbggpsaap5e9cjF;8;4;W;G;ab9:9cU1:Ng8Jcitpbi:q:G:cjbp9UpmbedilvorzHOACXQLpPahaap9spklbagaoclffa8JRb:q:W:cjbfhoxikaicafaopbbwaopbbbgaclp:meaapmbzeHdOiAlCvXoQrLpxssssssssssssssssp9oghpxssssssssssssssssp8Jgap5b9cjF;8;4;W;G;ab9:9cU1:Nggcitpbi:q:G:cjbagRb:q:W:cjbggpsaap5e9cjF;8;4;W;G;ab9:9cU1:Ng8Jcitpbi:q:G:cjbp9UpmbedilvorzHOACXQLpPahaap9spklbagaocwffa8JRb:q:W:cjbfhoxdkaicafaopbbbpklbaoczfhoxekaicafaopbbdaoRbbggcitpbi:q:G:cjbagRb:q:W:cjbggpsaoRbeg8Jcitpbi:q:G:cjbp9UpmbedilvorzHOACXQLpPpklbagaocdffa8JRb:q:W:cjbfhokdndndndndndnaqco4arfPDbedibledibkaic8Wfpxbbbbbbbbbbbbbbbbpklbxlkaic8Wfaopbblaopbbbgaclp:meaapmbzeHdOiAlCvXoQrLgacdp:meaapmbzeHdOiAlCvXoQrLpxiiiiiiiiiiiiiiiip9oghpxiiiiiiiiiiiiiiiip8Jgap5b9cjF;8;4;W;G;ab9:9cU1:Ngicitpbi:q:G:cjbaiRb:q:W:cjbgipsaap5e9cjF;8;4;W;G;ab9:9cU1:Ngqcitpbi:q:G:cjbp9UpmbedilvorzHOACXQLpPahaap9spklbaiaoclffaqRb:q:W:cjbfhoxikaic8Wfaopbbwaopbbbgaclp:meaapmbzeHdOiAlCvXoQrLpxssssssssssssssssp9oghpxssssssssssssssssp8Jgap5b9cjF;8;4;W;G;ab9:9cU1:Ngicitpbi:q:G:cjbaiRb:q:W:cjbgipsaap5e9cjF;8;4;W;G;ab9:9cU1:Ngqcitpbi:q:G:cjbp9UpmbedilvorzHOACXQLpPahaap9spklbaiaocwffaqRb:q:W:cjbfhoxdkaic8Wfaopbbbpklbaoczfhoxekaic8WfaopbbdaoRbbgicitpbi:q:G:cjbaiRb:q:W:cjbgipsaoRbegqcitpbi:q:G:cjbp9UpmbedilvorzHOACXQLpPpklbaiaocdffaqRb:q:W:cjbfhokalc;abfhialcjefaC0meaihlaxao9Rc;Fb0mbkkdnaiaC9pmbaici4hlinaxao9RcK6mwa8FaifhqdndndndndndnaQaico4fRbbalcoG4ciGarfPDbedibledibkaqpxbbbbbbbbbbbbbbbbpkbbxlkaqaopbblaopbbbgaclp:meaapmbzeHdOiAlCvXoQrLgacdp:meaapmbzeHdOiAlCvXoQrLpxiiiiiiiiiiiiiiiip9oghpxiiiiiiiiiiiiiiiip8Jgap5b9cjF;8;4;W;G;ab9:9cU1:Nggcitpbi:q:G:cjbagRb:q:W:cjbggpsaap5e9cjF;8;4;W;G;ab9:9cU1:Ng8Jcitpbi:q:G:cjbp9UpmbedilvorzHOACXQLpPahaap9spkbbagaoclffa8JRb:q:W:cjbfhoxikaqaopbbwaopbbbgaclp:meaapmbzeHdOiAlCvXoQrLpxssssssssss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8Kp9Abbbaladfgla8KaaaapmwDqkwDqkwDqkwDqkp9Ug8Kp9Abbbaladfgla8KaaaapmxmPsxmPsxmPsxmPsp9Ug8Kp9Abbbaladfgla8Ka8La8MpmwDKYqk8AExm35Ps8E8Fgacep9Taaahp9op9Hp9rgap9Ughp9Abbbaladfglahaaaapmlvorlvorlvorlvorp9Ughp9AbbbaladfglahaaaapmwDqkwDqkwDqkwDqkp9Ughp9AbbbaladfglahaaaapmxmPsxmPsxmPsxmPsp9Ug8Kp9AbbbaladfhlaoczfgoaC6mbxikkaCTmeaXaEfhlavaEfpbdbh8Kcbhoinalavcj;cbfaofpblbg8La8Aaofpblbg8MpmbzeHdOiAlCvXoQrLg8NaKaofpblbgyaYaofpblbg8PpmbzeHdOiAlCvXoQrLgIpmbezHdiOAlvCXorQLgacep:neaapxebebebebebebebebghp9op:bep9rgaa8Kp:oeg8Kp9Abbbaladfgla8Kaaaapmlvorlvorlvorlvorp:oeg8Kp9Abbbaladfgla8KaaaapmwDqkwDqkwDqkwDqkp:oeg8Kp9Abbbaladfgla8KaaaapmxmPsxmPsxmPsxmPsp:oeg8Kp9Abbbaladfgla8Ka8NaIpmwDKYqk8AExm35Ps8E8Fgacep:neaaahp9op:bep9rgap:oeg8Kp9Abbbaladfgla8Kaaaapmlvorlvorlvorlvorp:oeg8Kp9Abbbaladfgla8KaaaapmwDqkwDqkwDqkwDqkp:oeg8Kp9Abbbaladfgla8KaaaapmxmPsxmPsxmPsxmPsp:oeg8Kp9Abbbaladfgla8Ka8La8MpmwKDYq8AkEx3m5P8Es8Fg8Laya8PpmwKDYq8AkEx3m5P8Es8Fg8MpmbezHdiOAlvCXorQLgacep:neaaahp9op:bep9rgap:oeg8Kp9Abbbaladfgla8Kaaaapmlvorlvorlvorlvorp:oeg8Kp9Abbbaladfgla8KaaaapmwDqkwDqkwDqkwDqkp:oeg8Kp9Abbbaladfgla8KaaaapmxmPsxmPsxmPsxmPsp:oeg8Kp9Abbbaladfgla8Ka8La8MpmwDKYqk8AExm35Ps8E8Fgacep:neaaahp9op:bep9rgap:oeghp9Abbbaladfglahaaaapmlvorlvorlvorlvorp:oeghp9AbbbaladfglahaaaapmwDqkwDqkwDqkwDqkp:oeghp9AbbbaladfglahaaaapmxmPsxmPsxmPsxmPsp:oeg8Kp9AbbbaladfhlaoczfgoaC6mbxdkkaCTmbaXaEfhrcbhocbalcl4gl9Rc8FGhiavaEfpbdbhhinaravcj;cbfaofpblbg8Ka8Aaofpblbg8LpmbzeHdOiAlCvXoQrLg8MaKaofpblbg8NaYaofpblbgypmbzeHdOiAlCvXoQrLg8PpmbezHdiOAlvCXorQLgaaip:Reaaalp:Tep9qgaahp9rghp9Abbbaradfgrahaaaapmlvorlvorlvorlvorp9rghp9AbbbaradfgrahaaaapmwDqkwDqkwDqkwDqkp9rghp9AbbbaradfgrahaaaapmxmPsxmPsxmPsxmPsp9rghp9Abbbaradfgraha8Ma8PpmwDKYqk8AExm35Ps8E8Fgaaip:Reaaalp:Tep9qgap9rghp9Abbbaradfgrahaaaapmlvorlvorlvorlvorp9rghp9AbbbaradfgrahaaaapmwDqkwDqkwDqkwDqkp9rghp9AbbbaradfgrahaaaapmxmPsxmPsxmPsxmPsp9rghp9Abbbaradfgraha8Ka8LpmwKDYq8AkEx3m5P8Es8Fg8Ka8NaypmwKDYq8AkEx3m5P8Es8Fg8LpmbezHdiOAlvCXorQLgaaip:Reaaalp:Tep9qgap9rghp9Abbbaradfgrahaaaapmlvorlvorlvorlvorp9rghp9AbbbaradfgrahaaaapmwDqkwDqkwDqkwDqkp9rghp9AbbbaradfgrahaaaapmxmPsxmPsxmPsxmPsp9rghp9Abbbaradfgraha8Ka8LpmwDKYqk8AExm35Ps8E8Fgaaip:Reaaalp:Tep9qgap9rghp9Abbbaradfgrahaaaapmlvorlvorlvorlvorp9rghp9AbbbaradfgrahaaaapmwDqkwDqkwDqkwDqkp9rghp9AbbbaradfgrahaaaapmxmPsxmPsxmPsxmPsp9rghp9AbbbaradfhraoczfgoaC6mbkkaEclfgEad6mbkdnaXavcjdf9hmbaAad2goTmbaOavcjdfao;8qbbkdnammbavaXaAcufad2fad;8qbbkaAaHfhHc9:hoaQhPaQmbxlkkaeTmbaDalfhrcbhocuhlinaralaD9RglfaD6mdasaeao9Raoasfae6Eaofgoae6mbkaial9RhPkcbc99axaP9RakSEhoxekc9:hokavcj;kbf8Kjjjjbaokwbz:bjjjbkNsezu8Jjjjjbc;ae9Rgv8Kjjjjbc9:hodnalaeci9UgrcHf6mbcuhoaiRbbgwc;WeGc;Ge9hmbawcsGgDce0mbavc;abfcFecje;8kbav9cu83iUav9cu83i8Wav9cu83iyav9cu83iaav9cu83iKav9cu83izav9cu83iwav9cu83ibaialfc9WfhqaicefgwarfhldnaeTmbcmcsaDceSEhkcbhxcbhmcbhrcbhicbhoindnalaq9nmbc9:hoxikdndnawRbbgDc;Ve0mbavc;abfaoaDcu7gPcl4fcsGcitfgsydlhzasydbhHdndnaDcsGgsak9pmbavaiaPfcsGcdtfydbaxasEhDaxasTgOfhxxekdndnascsSmbcehOasc987asamffcefhDxekalcefhDal8SbbgscFeGhPdndnascu9mmbaDhlxekalcvfhlaPcFbGhPcrhsdninaD8SbbgOcFbGastaPVhPaOcu9kmeaDcefhDascrfgsc8J9hmbxdkkaDcefhlkcehOaPce4cbaPceG9R7amfhDkaDhmkavc;abfaocitfgsaDBdbasazBdlavaicdtfaDBdbavc;abfaocefcsGcitfgsaHBdbasaDBdlaocdfhoaOaifhidnadcd9hmbabarcetfgsaH87ebasclfaD87ebascdfaz87ebxdkabarcdtfgsaHBdbascwfaDBdbasclfazBdbxekdnaDcpe0mbavaiaqaDcsGfRbbgscl4gP9RcsGcdtfydbaxcefgOaPEhDavaias9RcsGcdtfydbaOaPTgzfgOascsGgPEhsaPThPdndnadcd9hmbabarcetfgHax87ebaHclfas87ebaHcdfaD87ebxekabarcdtfgHaxBdbaHcwfasBdbaHclfaDBdbkavaicdtfaxBdbavc;abfaocitfgHaDBdbaHaxBdlavaicefgicsGcdtfaDBdbavc;abfaocefcsGcitfgHasBdbaHaDBdlavaiazfgicsGcdtfasBdbavc;abfaocdfcsGcitfgDaxBdbaDasBdlaocifhoaiaPfhiaOaPfhxxekaxcbalRbbgsEgHaDc;:eSgDfhOascsGhAdndnascl4gCmbaOcefhzxekaOhzavaiaC9RcsGcdtfydbhOkdndnaAmbazcefhxxekazhxavaias9RcsGcdtfydbhzkdndnaDTmbalcefhDxekalcdfhDal8SbegPcFeGhsdnaPcu9kmbalcofhHascFbGhscrhldninaD8SbbgPcFbGaltasVhsaPcu9kmeaDcefhDalcrfglc8J9hmbkaHhDxekaDcefhDkasce4cbasceG9R7amfgmhHkdndnaCcsSmbaDhsxekaDcefhsaD8SbbglcFeGhPdnalcu9kmbaDcvfhOaPcFbGhPcrhldninas8SbbgDcFbGaltaPVhPaDcu9kmeascefhsalcrfglc8J9hmbkaOhsxekascefhskaPce4cbaPceG9R7amfgmhOkdndnaAcsSmbashlxekascefhlas8SbbgDcFeGhPdnaDcu9kmbascvfhzaPcFbGhPcrhDdninal8SbbgscFbGaDtaPVhPascu9kmealcefhlaDcrfgDc8J9hmbkazhlxekalcefhlkaPce4cbaPceG9R7amfgmhzkdndnadcd9hmbabarcetfgDaH87ebaDclfaz87ebaDcdfaO87ebxekabarcdtfgDaHBdbaDcwfazBdbaDclfaOBdbkavc;abfaocitfgDaOBdbaDaHBdlavaicdtfaHBdbavc;abfaocefcsGcitfgDazBdbaDaOBdlavaicefgicsGcdtfaOBdbavc;abfaocdfcsGcitfgDaHBdbaDazBdlavaiaCTaCcsSVfgicsGcdtfazBdbaiaATaAcsSVfhiaocifhokawcefhwaocsGhoaicsGhiarcifgrae6mbkkcbc99alaqSEhokavc;aef8Kjjjjbaok:clevu8Jjjjjbcz9Rhvdnalaecvf9pmbc9:skdnaiRbbc;:eGc;qeSmbcuskav9cb83iwaicefhoaialfc98fhrdnaeTmbdnadcdSmbcbhwindnaoar6mbc9:skaocefhlao8SbbgicFeGhddndnaicu9mmbalhoxekaocvfhoadcFbGhdcrhidninal8SbbgDcFbGaitadVhdaDcu9kmealcefhlaicrfgic8J9hmbxdkkalcefhokabawcdtfadc8Etc8F91adcd47avcwfadceGcdtVglydbfgiBdbalaiBdbawcefgwae9hmbxdkkcbhwindnaoar6mbc9:skaocefhlao8SbbgicFeGhddndnaicu9mmbalhoxekaocvfhoadcFbGhdcrhidninal8SbbgDcFbGaitadVhdaDcu9kmealcefhlaicrfgic8J9hmbxdkkalcefhokabawcetfadc8Etc8F91adcd47avcwfadceGcdtVglydbfgi87ebalaiBdbawcefgwae9hmbkkcbc99aoarSEk;Toio97eue97aec98Ghedndnadcl9hmbaeTmecbhdinababpbbbgicKp:RecKp:Sep;6eglaicwp:RecKp:Sep;6ealp;Geaiczp:RecKp:Sep;6egvp;Gep;Kep;Legopxbbbbbbbbbbbbbbbbp:2egralpxbbbjbbbjbbbjbbbjgwp9op9rp;Keglpxbb;:9cbb;:9cbb;:9cbb;:9calalp;Meaoaop;Meavaravawp9op9rp;Keglalp;Mep;Kep;Kep;Jep;Negvp;Mepxbbn0bbn0bbn0bbn0grp;KepxFbbbFbbbFbbbFbbbp9oaipxbbbFbbbFbbbFbbbFp9op9qalavp;Mearp;Kecwp:RepxbFbbbFbbbFbbbFbbp9op9qaoavp;Mearp;Keczp:RepxbbFbbbFbbbFbbbFbp9op9qpkbbabczfhbadclfgdae6mbxdkkaeTmbcbhdinabczfgDaDpbbbgipxbbbbbbFFbbbbbbFFgwp9oabpbbbgoaipmbediwDqkzHOAKY8AEgvczp:Reczp:Sep;6eglaoaipmlvorxmPsCXQL358E8FpxFubbFubbFubbFubbp9op;6eavczp:Sep;6egvp;Gealp;Gep;Kep;Legipxbbbbbbbbbbbbbbbbp:2egralpxbbbjbbbjbbbjbbbjgqp9op9rp;Keglpxb;:FSb;:FSb;:FSb;:FSalalp;Meaiaip;Meavaravaqp9op9rp;Keglalp;Mep;Kep;Kep;Jep;Negvp;Mepxbbn0bbn0bbn0bbn0grp;KepxFFbbFFbbFFbbFFbbp9oaiavp;Mearp;Keczp:Rep9qgialavp;Mearp;KepxFFbbFFbbFFbbFFbbp9oglpmwDKYqk8AExm35Ps8E8Fp9qpkbbabaoawp9oaialpmbezHdiOAlvCXorQLp9qpkbbabcafhbadclfgdae6mbkkk;2ileue97euo97dnaec98GgiTmbcbheinabcKfpx:ji:1S:ji:1S:ji:1S:ji:1SabpbbbglabczfgvpbbbgopmlvorxmPsCXQL358E8Fgrczp:Segwpxibbbibbbibbbibbbp9qp;6egDp;NegqaDaDp;MegDaDp;KealaopmbediwDqkzHOAKY8AEgDczp:Reczp:Sep;6eglalp;MeaDczp:Sep;6egoaop;Mearczp:Reczp:Sep;6egrarp;Mep;Kep;Kep;Lepxbbbbbbbbbbbbbbbbp:4ep;Jep;Mepxbbn0bbn0bbn0bbn0gDp;KepxFFbbFFbbFFbbFFbbgkp9oaqaop;MeaDp;Keczp:Rep9qgoaqalp;MeaDp;Keakp9oaqarp;MeaDp;Keczp:Rep9qgDpmwDKYqk8AExm35Ps8E8Fglp5eawclp:RegqpEi:T:j83ibavalp5baqpEd:T:j83ibabcwfaoaDpmbezHdiOAlvCXorQLgDp5eaqpEe:T:j83ibabaDp5baqpEb:T:j83ibabcafhbaeclfgeai6mbkkkuee97dnadcd4ae2c98GgeTmbcbhdinababpbbbgicwp:Recwp:Sep;6eaicep:SepxbbjFbbjFbbjFbbjFp9opxbbjZbbjZbbjZbbjZp:Uep;Mepkbbabczfhbadclfgdae6mbkkk:Sodw97euaec98Ghedndnadcl9hmbaeTmecbhdinabpxbbuJbbuJbbuJbbuJabpbbbgicKp:TeglaicYp:Tep9qgvcdp:Teavp9qgvclp:Teavp9qgop;6ep;Negvaicwp:RecKp:SegraipxFbbbFbbbFbbbFbbbgwp9ogDp:Uep;6ep;Mepxbbn0bbn0bbn0bbn0gqp;Kecwp:RepxbFbbbFbbbFbbbFbbp9oavaDarp:Xeaiczp:RecKp:Segip:Uep;6ep;Meaqp;Keawp9op9qavaDaraip:Uep:Xep;6ep;Meaqp;Keczp:RepxbbFbbbFbbbFbbbFbp9op9qavaoalcep:Rep9oalpxebbbebbbebbbebbbp9op9qp;6ep;Meaqp;KecKp:Rep9qpkbbabczfhbadclfgdae6mbxdkkaeTmbcbhdinabczfgkpxbFu9hbFu9hbFu9hbFu9habpbbbglakpbbbgrpmlvorxmPsCXQL358E8Fgvczp:TegqavcHp:Tep9qgicdp:Teaip9qgiclp:Teaip9qgicwp:Teaip9qgop;6ep;NegialarpmbediwDqkzHOAKY8AEgDpxFFbbFFbbFFbbFFbbglp9ograDczp:Segwp:Ueavczp:Reczp:SegDp:Xep;6ep;Mepxbbn0bbn0bbn0bbn0gvp;Kealp9oaiarawaDp:Uep:Xep;6ep;Meavp;Keczp:Rep9qgwaiaoaqcep:Rep9oaqpxebbbebbbebbbebbbp9op9qp;6ep;Meavp;Keczp:ReaiaDarp:Uep;6ep;Meavp;Kealp9op9qgipmwDKYqk8AExm35Ps8E8FpkbbabawaipmbezHdiOAlvCXorQLpkbbabcafhbadclfgdae6mbkkk9teiucbcbydj:G:cjbgeabcifc98GfgbBdj:G:cjbdndnabZbcztgd9nmbcuhiabad9RcFFifcz4nbcuSmekaehikaikkxebcj:Gdklz:zbb",n=new Uint8Array([0,97,115,109,1,0,0,0,1,4,1,96,0,0,3,3,2,0,0,5,3,1,0,1,12,1,0,10,22,2,12,0,65,0,65,0,65,0,252,10,0,0,11,7,0,65,0,253,15,26,11]),i=new Uint8Array([32,0,65,2,1,106,34,33,3,128,11,4,13,64,6,253,10,7,15,116,127,5,8,12,40,16,19,54,20,9,27,255,113,17,42,67,24,23,146,148,18,14,22,45,70,69,56,114,101,21,25,63,75,136,108,28,118,29,73,115]);if(typeof WebAssembly!="object")return{supported:!1};var r=WebAssembly.validate(n)?a(t):a(e),o,s=WebAssembly.instantiate(r,{}).then(function(b){o=b.instance,o.exports.__wasm_call_ctors()});function a(b){for(var x=new Uint8Array(b.length),T=0;T<b.length;++T){var E=b.charCodeAt(T);x[T]=E>96?E-97:E>64?E-39:E+4}for(var v=0,T=0;T<b.length;++T)x[v++]=x[T]<60?i[x[T]]:(x[T]-60)*64+x[++T];return x.buffer.slice(0,v)}function c(b,x,T,E,v,S,I){var R=b.exports.sbrk,O=E+3&-4,L=R(O*v),_=R(S.length),C=new Uint8Array(b.exports.memory.buffer);C.set(S,_);var w=x(L,E,v,_,S.length);if(w==0&&I&&I(L,O,v),T.set(C.subarray(L,L+E*v)),R(L-R(0)),w!=0)throw new Error("Malformed buffer data: "+w)}var u={NONE:"",OCTAHEDRAL:"meshopt_decodeFilterOct",QUATERNION:"meshopt_decodeFilterQuat",EXPONENTIAL:"meshopt_decodeFilterExp",COLOR:"meshopt_decodeFilterColor"},f={ATTRIBUTES:"meshopt_decodeVertexBuffer",TRIANGLES:"meshopt_decodeIndexBuffer",INDICES:"meshopt_decodeIndexSequence"},d=[],p=0;function g(b){var x={object:new Worker(b),pending:0,requests:{}};return x.object.onmessage=function(T){var E=T.data;x.pending-=E.count,x.requests[E.id][E.action](E.value),delete x.requests[E.id]},x}function m(b){for(var x="self.ready = WebAssembly.instantiate(new Uint8Array(["+new Uint8Array(r)+"]), {}).then(function(result) { result.instance.exports.__wasm_call_ctors(); return result.instance; });self.onmessage = "+A.name+";"+c.toString()+A.toString(),T=new Blob([x],{type:"text/javascript"}),E=URL.createObjectURL(T),v=d.length;v<b;++v)d[v]=g(E);for(var v=b;v<d.length;++v)d[v].object.postMessage({});d.length=b,URL.revokeObjectURL(E)}function y(b,x,T,E,v){for(var S=d[0],I=1;I<d.length;++I)d[I].pending<S.pending&&(S=d[I]);return new Promise(function(R,O){var L=new Uint8Array(T),_=++p;S.pending+=b,S.requests[_]={resolve:R,reject:O},S.object.postMessage({id:_,count:b,size:x,source:L,mode:E,filter:v},[L.buffer])})}function A(b){var x=b.data;self.ready.then(function(T){if(!x.id)return self.close();try{var E=new Uint8Array(x.count*x.size);c(T,T.exports[x.mode],E,x.count,x.size,x.source,T.exports[x.filter]),self.postMessage({id:x.id,count:x.count,action:"resolve",value:E},[E.buffer])}catch(v){self.postMessage({id:x.id,count:x.count,action:"reject",value:v})}})}return{ready:s,supported:!0,useWorkers:function(b){m(b)},decodeVertexBuffer:function(b,x,T,E,v){c(o,o.exports.meshopt_decodeVertexBuffer,b,x,T,E,o.exports[u[v]])},decodeIndexBuffer:function(b,x,T,E){c(o,o.exports.meshopt_decodeIndexBuffer,b,x,T,E)},decodeIndexSequence:function(b,x,T,E){c(o,o.exports.meshopt_decodeIndexSequence,b,x,T,E)},decodeGltfBuffer:function(b,x,T,E,v,S){c(o,o.exports[f[v]],b,x,T,E,o.exports[u[S]])},decodeGltfBufferAsync:function(b,x,T,E,v){return d.length>0?y(b,x,T,f[E],u[v]):s.then(function(){var S=new Uint8Array(b*x);return c(o,o.exports[f[E]],S,b,x,T,o.exports[u[v]]),S})}}})();var T4n=(function(){var e="b9H79Tebbbe:6eO9Geueu9Geub9Gbb9Gsuuuuuuuuuuuu99uueu9Gvuuuuub9Gruuuuuuub9Gouuuuuue999Gvuuuuueu9Gzuuuuuuuuuuu99uuuub9Gquuuuuuu99uueu9GPuuuuuuuuuuu99uueu9Gquuuuuuuu99ueu9Gruuuuuu99eu9Gwuuuuuu99ueu9Giuuue999Gluuuueu9Gluuuub9GiuuueuiLQdilvorlwDiqkxmPszbHHbelve9Weiiviebeoweuecj:Gdkr:Bdxo9TW9T9VV95dbH9F9F939H79T9F9J9H229F9Jt9VV7bbz9TW79O9V9Wt9F79P9T9W29P9M95bw8E9TW79O9V9Wt9F79P9T9W29P9M959x9Pt9OcttV9P9I91tW7bD8A9TW79O9V9Wt9F79P9T9W29P9M959x9Pt9O9v9W9K9HtWbqQ9TW79O9V9Wt9F79P9T9W29P9M959t29V9W9W95bkX9TW79O9V9Wt9F79P9T9W29P9M959qV919UWbxQ9TW79O9V9Wt9F79P9T9W29P9M959q9V9P9Ut7bmX9TW79O9V9Wt9F79P9T9W29P9M959t9J9H2WbPa9TW79O9V9Wt9F9V9Wt9P9T9P96W9wWVtW94SWt9J9O9sW9T9H9Wbs59TW79O9V9Wt9F9NW9UWV9HtW9q9V79Pt9P9V9U9sW9T9H9Wbzl79IV9RbHDwebcekdCXq;y;WeQdbk;r:herYue99iuY99Xue9:D998Jjjjjbcj;sb9Rgs8Kjjjjbcbhzasc:Cefcbc;Kbz:tjjjb8AdnabaeSmbabaeadcdtzMjjjb8AkdnamcdGTmbalcrfci4cbyd1:H:cjbHjjjjbbhHasc:Cefasyd;8egecdtfaHBdbasaecefBd;8ecbhlcbhednadTmbabheadhOinaHaeydbci4fcb86bbaeclfheaOcufgOmbkcbhlabheadhOinaHaeydbgAci4fgCaCRbbgCceaAcrGgAtV86bbaCcu7aA4ceGalfhlaeclfheaOcufgOmbkcualcdtalcFFFFi0Ehekaecbyd1:H:cjbHjjjjbbhzasc:Cefasyd;8egecdtfazBdbasaecefBd;8ealcd4alfhOcehHinaHgecethHaeaO6mbkcbhXcuaecdtgOaecFFFFi0Ecbyd1:H:cjbHjjjjbbhHasc:Cefasyd;8egAcdtfaHBdbasaAcefBd;8eaHcFeaOz:tjjjbhQdnadTmbaecufhLcbhKindndnaQabaKcdtfgYydbgAc:v;t;h;Ev2aLGgOcdtfgCydbgHcuSmbceheinazaHcdtfydbaASmdaOaefhHaecefheaQaHaLGgOcdtfgCydbgHcu9hmbkkazaXcdtfaABdbaCaXBdbaXhHaXcefhXkaYaHBdbaKcefgKad9hmbkkaQcbyd:m:H:cjbH:bjjjbbasasyd;8ecufBd;8ekcbh8AcualcefgecdtaecFFFFi0Ecbyd1:H:cjbHjjjjbbhLasc:Cefasyd;8egecdtfaLBdbasaLBdNeasaecefBd;8ecuadcitadcFFFFe0Ecbyd1:H:cjbHjjjjbbhEasc:Cefasyd;8egecdtfaEBdbasaEBd:yeasaecefBd;8eascNefabadalcbz:cjjjbcualcdtgealcFFFFi0Eg3cbyd1:H:cjbHjjjjbbhOasc:Cefasyd;8egHcdtfaOBdbasaHcefBd;8ea3cbyd1:H:cjbHjjjjbbhQasc:Cefasyd;8egHcdtfaQBdbasaHcefBd;8eaOaQaialavazasc:Cefz:djjjbalcbyd1:H:cjbHjjjjbbhYasc:Cefasyd;8egHcdtfaYBdbasaHcefBd;8ea3cbyd1:H:cjbHjjjjbbhHasc:Cefasyd;8egAcdtfaHBdbasaAcefBd;8ea3cbyd1:H:cjbHjjjjbbhAasc:Cefasyd;8egCcdtfaABdbasaCcefBd;8eaHcFeaez:tjjjbh5aAcFeaez:tjjjbh8EdnalTmbindnaLa8AgAcefg8AcdtfydbgCaLaAcdtgefydbgHSmbaCaH9Rh8FaEaHcitfhaa8Eaefhha5aefhKcbhCindndnaaaCcitfydbgXaA9hmbaKaABdbahaABdbxekdnaLaXcdtggfgeclfydbgHaeydbgeSmbaHae9RhHaEaecitfheinaeydbaASmdaecwfheaHcufgHmbkka8EagfgeaAaXaeydbcuSEBdbaKaXaAaKydbcuSEBdbkaCcefgCa8F9hmbkka8Aal9hmbkaOhHaQhAa5hXa8EhCcbheindndnaeaHydbgK9hmbdnaeaAydbgK9hmbaXydbhKdnaCydbg8Fcu9hmbaKcu9hmbaYaefcb86bbxikdna8FcuSmbaKcuSmbaea8FSmbaOa8FcdtfydbaOaKcdtfydb9hmbaYaefcd86bbxikaYaefhadnaea8FSmbaeaKSmbaace86bbxikaacl86bbxdkdnaeaQaKcdtg8Ffydb9hmbdnaCydbgacuSmbaeaaSmbaXydbggcuSmbaeagSmba8Ea8FfydbghcuSmbahaKSmba5a8Ffydbg8FcuSmba8FaKSmbdnaOaacdtfydbgKaOa8Fcdtfydb9hmbaKaOagcdtfydbg8FSmba8FaOahcdtfydb9hmbaYaefcd86bbxlkaYaefcl86bbxikaYaefcl86bbxdkaYaefcl86bbxekaYaefaYaKfRbb86bbkaHclfhHaAclfhAaXclfhXaCclfhCalaecefge9hmbkdnamcaGTmbcbh8JindndnaYa8Jfg8KRbbg8Lc9:fPibebekdndndnaOa8Jcdtfydbgea8J9hmbdnaqmbcbh8FxdkdnazTmbcbh8Fa8JheinaqazaecdtgefydbfRbbce4a8FVceGh8FaQaefydbgea8J9hmbxikkcbh8Fa8JheinaqaefRbbce4a8FVceGh8FaQaecdtfydbgea8J9hmbxdkkaYaefRbbhexeka8JheindnaLaecdtg8AfgeclfydbgHaeydbgeSmbaHae9RhgaEaecitfhhaOa8AfhacbhKinahaKcitfydbgXhednindnaLaecdtgCfgeclfydbgHaeydbgeSmbaHae9RhHaEaecitfheaaydbhAdninaOaeydbcdtfydbaASmeaecwfheaHcufgHTmdxbkkcbhexdkaQaCfydbgeaX9hmbkceheka8FaeVh8FaKcefgKag9hmbkkaQa8Afydbgea8J9hmbka8Lcia8FceGEheka8Kae86bbka8Jcefg8Jal9hmbkkdnaqTmbdndnazTmbazheaOhHalhAindnaqaeydbfRbbceGTmbaYaHydbfcl86bbkaeclfheaHclfhHaAcufgAmbxdkkaqheaOhHalhAindnaeRbbceGTmbaYaHydbfcl86bbkaecefheaHclfhHaAcufgAmbkkaOhealhAaYhHindnaYaeydbfRbbcl9hmbaHcl86bbkaeclfheaHcefhHaAcufgAmbkkamceGTmbaYhealhHindnaeRbbce9hmbaecl86bbkaecefheaHcufgHmbkkcbh8Mcualcx2alc;v:Q;v:Qe0Ecbyd1:H:cjbHjjjjbbh8Nasc:Cefasyd;8egecdtfa8NBdbasaecefBd;8eascbBd:qeas9cb83i1ea8Naialavazasc1efz:ejjjbhydndnaDmbcbh8PcbhCxekcbhCawhecbhHindnaeIdbJbbbb9ETmbasaCcdtfaHBdbaCcefhCkaeclfheaDaHcefgH9hmbkcuaCal2gecdtaecFFFFi0Ecbyd1:H:cjbHjjjjbbh8Pasc:Cefasyd;8egecdtfa8PBdbasaecefBd;8ealTmbdnaCmbcbhCxekarcd4hgdnazTmbaCcdthhcbh8Fa8Phainaoaza8Fcdtfydbag2cdtfhKasheaahHaChAinaHaKaeydbcdtgXfIdbawaXfIdbNUdbaeclfheaHclfhHaAcufgAmbkaaahfhaa8Fcefg8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bbbh8ScbhScbh9hcbh9ixekcbhSa3cbyd1:H:cjbHjjjjbbh9iasc:Cefasyd;8egecdtfa9iBdbasaecefBd;8ecua9ialabadaOz:fjjjbgXcltaXcjjjjiGEcbyd1:H:cjbHjjjjbbh9hasc:Cefasyd;8egecdtfa9hBdbasaecefBd;8ea9haXa9ia8Nalz:gjjjbJFFuuh8SaXTmba9hheaXhHinaeIdbgRa8Sa8SaR9EEh8SaeclfheaHcufgHmbkaXhSkdnalTmbaLclfheaLydbhXaYhHalhKcbhAincbaeydbg8FaX9RaHRbbcpeGEaAfhAaHcefhHaeclfhea8FhXaKcufgKmbkaAce4hAkcuadaA9Rcifg6cx2a6c;v:Q;v:Qe0Ecbyd1:H:cjbHjjjjbbh9kasc:Cefasyd;8egecdtfa9kBdbasaecefBd;8ecua6cdta6cFFFFi0Ecbyd1:H:cjbHjjjjbbh0asc:Cefasyd;8egecdtfa0BdbasaecefBd;8ea3cbyd1:H:cjbHjjjjbbh9masc:Cefasyd;8egecdtfa9mBdbasaecefBd;8ealcbyd1:H:cjbHjjjjbbh9nasc:Cefasyd;8egecdtfa9nBdbasaecefBd;8eaxaxNayJbbjZamclGEgZaZN:vh87JbbbbhUdnadak9nmbdna6ci6mbaCclth9oa9kcwfh9pJbbbbh85JbbbbhUinascNefabadalaOz:cjjjbabh8Acbh9qcbh9rinaba9rcdtfhDcbheindnaOa8AaefydbgAcdtghfydbgXaOaDaec:W:G:cjbfydbcdtfydbgHcdtg8JfydbgKSmbaYaHfRbbgacv2aYaAfRbbg8FfRb;a:G:cjbg8La8Fcv2aafg8KRb;a:G:cjbg3VcFeGTmbdnaKaX9nmba8KRb;G:G:cjbcFeGmekdna8FcufcFeGce0mbaaTmba5ahfydbaH9hmekdna8FTmbaacufcFeGce0mba8Ea8JfydbaA9hmeka9ka9qcx2fgXaHaAa3cFeGgKEBdlaXaAaHaKEBdbaXaKa8LGcb9hBdwa9qcefh9qkaeclfgecx9hmbkdna9rcifg9rad9pmba8Acxfh8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dyh81aChAinaHIdbg8Va8Va81NaecxfIdba8WaecwfIdbNa8XaeIdbNa8YaeclfIdbNMMMg8Va8VM:tNaRMhRaHclfhHaeczfheaAcufgAmbkdndnaDmbJbbbbh8VxekagaXc8S2fgAIdwa8Naacx2fgeIdwg8XNaAIdzaeIdbg8YNaAIdaMg8Va8VMMa8XNaAIdlaeIdlg81NaAIdCa8XNaAId3Mg8Va8VMMa81NaAIdba8YNaAIdxa81NaAIdKMg8Va8VMMa8YNaAId8KMMMh8Va8Pa8JcdtfhHa8Ra8AcltfheaAIdyh80aChAinaHIdbg8Wa8Wa80NaecxfIdba8XaecwfIdbNa8YaeIdbNa81aeclfIdbNMMMg8Wa8WM:tNa8VMh8VaHclfhHaeczfheaAcufgAmbka8V:lh8VkaBaR:lMhBa86a8VMh86kaha86aBa86aB9DgeEUdwahaKa8FaeaDcb9hGgeEBdlaha8FaKaeEBdba8Kcefg8Ka9q9hmbkascjdfcbcj;qbz:tjjjb8Aa9phea9qhHinascjdfaeydbcA4cF8FGgAcFAaAcFA6EcdtfgAaAydbcefBdbaecxfheaHcufgHmbkcbhecbhHinascjdfaefgAydbhXaAaHBdbaXaHfhHaeclfgecj;qb9hmbkcbhea9phHinascjdfaHydbcA4cF8FGgAcFAaAcFA6EcdtfgAaAydbgAcefBdba0aAcdtfaeBdbaHcxfhHa9qaecefge9hmbkadak9RgAci9Uh9sdnalTmbcbhea9mhHinaHaeBdbaHclfhHalaecefge9hmbkkcbh9ta9ncbalz:tjjjbh3aAcO9Uh9ua9sce4h9rcbh8Lcbh8Kdnina9ka0a8Kcdtfydbcx2fg8JIdwgRa879Emea8La9s9pmeJFFuuh8Vdna9ra9q9pmba9ka0a9rcdtfydbcx2fIdwJbb;aZNh8VkdnaRa8V9ETmbaRaU9ETmba8La9u0mdkdna3aOa8JydlgDcdtg9vfg8AydbgAfg9wRbba3aOa8Jydbghcdtg9xfydbgefg9yRbbVmbaYahfRbbh9zdndnaLaecdtfgHclfydbgXaHydbgHSmbaXaH9RhXa8NaAcx2fh8Fa8Naecx2fhaaEaHcitfheindna9maeydbcdtfydbgHaASmba9maeclfydbcdtfydbgKaASmbaHaKSmba8NaKcx2fgKIdba8NaHcx2fgHIdbg8W:tgRaaIdlaHIdlg8X:tg80NaKIdla8X:tg8VaaIdba8W:tgBN:tg8YaRa8FIdla8X:tg86Na8Va8FIdba8W:tg8UN:tg8XNa8VaaIdwaHIdwg81:tg8ZNaKIdwa81:tg8Wa80N:tg80a8Va8FIdwa81:tg83Na8Wa86N:tg8VNa8WaBNaRa8ZN:tg81a8Wa8UNaRa83N:tgRNMMa8Ya8YNa80a80Na81a81NMMa8Xa8XNa8Va8VNaRaRNMMN:rJbbj8:N9FmikaecwfheaXcufgXmbkkdndndndna9zc9:fPdebdkahheina8AydbhAdndna5aecdtgHfydbgecuSmbaOaecdtfydbaASmekdna8EaHfydbgecuSmbaOaecdtfydbaASmekaDheka9maHfaeBdbaQaHfydbgeah9hmbxikkdna8Ea5a5a9xfydbaDSEaQa9xfydbghcdtfydbgecu9hmbaQa9vfydbheka9ma9xfaDBdbaehDka9mahcdtfaDBdbka9yce86bba9wce86bba8JIdwgRaUaUaR9DEhUa9tcefh9tcecda9zceSEa8Lfh8Lxeka9rcefh9rka8Kcefg8Ka9q9hmbkka9tTmddnalTmbcbh8Fcbhhindna9mahcdtgefydbgAahSmbaOaAcdtfydbh8AdnahaOaefydb9hg8JmbaIa8Ac8S2fgeaIahc8S2fgHIdbaeIdbMUdbaeaHIdlaeIdlMUdlaeaHIdwaeIdwMUdwaeaHIdxaeIdxMUdxaeaHIdzaeIdzMUdzaeaHIdCaeIdCMUdCaeaHIdKaeIdKMUdKaeaHId3aeId3MUd3aeaHIdaaeIdaMUdaaeaHId8KaeId8KMUd8KaeaHIdyaeIdyMUdya8MTmba8Ma8Acltfgea8MahcltfgHIdbaeIdbMUdbaeaHIdlaeIdlMUdlaeaHIdwaeIdwMUdwaeaHIdxaeIdxMUdxkaCTmbagaAc8S2fgeagahc8S2gDfgHIdbaeIdbMUdbaeaHIdlaeIdlMUdlaeaHIdwaeIdwMUdwaeaHIdxaeIdxMUdxaeaHIdzaeIdzMUdzaeaHIdCaeIdCMUdCaeaHIdKaeIdKMUdKaeaHId3aeId3MUd3aeaHIdaaeIdaMUdaaeaHId8KaeId8KMUd8KaeaHIdyaeIdyMUdya9oaA2haa8RhHaChXinaHaafgeaHa8FfgAIdbaeIdbMUdbaeclfgKaAclfIdbaKIdbMUdbaecwfgKaAcwfIdbaKIdbMUdbaecxfgeaAcxfIdbaeIdbMUdbaHczfhHaXcufgXmbka8JmbJbbbbJbbjZaIaDfgeIdygR:vaRJbbbb9BEaeIdwa8Na8Acx2fgHIdwgRNaeIdzaHIdbg8VNaeIdaMg8Wa8WMMaRNaeIdlaHIdlg8WNaeIdCaRNaeId3MgRaRMMa8WNaeIdba8VNaeIdxa8WNaeIdKMgRaRMMa8VNaeId8KMMM:lNgRa85a85aR9DEh85ka8Fa9ofh8Fahcefghal9hmbkcbhHa5heindnaeydbgAcuSmbdnaHa9maAcdtgXfydbgA9hmbcuhAa5aXfydbgXcuSmba9maXcdtfydbhAkaeaABdbkaeclfhealaHcefgH9hmbkcbhHa8EheindnaeydbgAcuSmbdnaHa9maAcdtgXfydbgA9hmbcuhAa8EaXfydbgXcuSmba9maXcdtfydbhAkaeaABdbkaeclfhealaHcefgH9hmbkka85aUaCEh85cbhHabhecbhAindnaOa9maeydbcdtfydbg8FcdtfydbgXaOa9maeclfydbcdtfydbgacdtfydbgKSmbaXaOa9maecwfydbcdtfydbg8AcdtfydbghSmbaKahSmbabaHcdtfgXa8FBdbaXcwfa8ABdbaXclfaaBdbaHcifhHkaecxfheaAcifgAad6mbkdndnaTmbaHhdxekdnaHak0mbaHhdxekdna8Sa859FmbaHhdxekJFFuuh8ScbhdabhecbhAindna9ha9iaeydbgXcdtfydbcdtfIdbgRa859ETmbaeclf8Pdbh9AabadcdtfgKaXBdbaKclfa9A83dbaRa8Sa8SaR9EEh8SadcifhdkaecxfheaAcifgAaH6mbkkadak0mbxdkkascNefabadalaOz:cjjjbkdndnadak0mbadhaxekdnaTmbadhaxekdna8Sa879FmbadhaxekcehKina8SJbb;aZNgRa87aRa879DEh8WJbbbbhRdnaSTmba9hheaShHinaeIdbg8VaRa8Va8W9FEaRa8VaR9EEhRaeclfheaHcufgHmbkkJFFuuh8ScbhaabhecbhHindna9ha9iaeydbgAcdtfydbcdtfIdbg8Va8W9ETmbaeclf8Pdbh9AabaacdtfgXaABdbaXclfa9A83dba8Va8Sa8Sa8V9EEh8SaacifhakaecxfheaHcifgHad6mbkdnaKaaad9hVceGmbadhaxdkaRaUaUaR9DEhUaaak9nmecbhKaahda8Sa879FmbkkdnamcjjjjdGTmba9ncbalz:tjjjbh8AdnaaTmbabheaahHina8AaeydbgAfce86bba8AaOaAcdtfydbfce86bbaeclfheaHcufgHmbkkascNefabaaalaOz:cjjjbdndnalTmbcbhXindna8AaXfRbbTmbdnaYaXfRbbgecl0mbceaetcQGmekdnaOaXcdtg8FfydbgeaXSmba8NaXcx2fgHa8Naecx2fgeydwBdwaHae8Pdb83dbxekaIaXc8S2fgKIdygcacJL:3;rUNgRMh87aKIdwg9BaRMh8SaKIdlg9CaRMh8UaKIdbg9DaRMh81aKIdag9EaRa8NaXcx2fg8JIdwg88N:th8ZaKId3g9FaRa8JIdlg89N:th83aKIdKg9Ga8JIdbg8:aRN:th80JbbbbhnaKIdCg9HJbbbbMh85aKIdzg9IJbbbbMhBaKIdxg9JJbbbbMh86dndnaCTmbaXhAinJbbbba87agaAc8S2fgHIdygR:vaRJbbbb9BEhRa8RaAaC2cltfheaHIdaa87Na8ZMh8ZaHId3a87Na83Mh83aHIdKa87Na80Mh80aHIdCa87Na85Mh85aHIdza87NaBMhBaHIdxa87Na86Mh86aHIdwa87Na8SMh8SaHIdla87Na8UMh8UaHIdba87Na81Mh81aChHina8ZaecwfIdbg8VaecxfIdbg8YNaRN:th8Za83aeclfIdbg8Wa8YNaRN:th83a85a8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j94hQdna5aOcdtfydbaHSmbcjjjj94cba8EaHcdtfydbaOSEhQkaKa8FaQVaOVBdbaYaHfRbbc3thOdna5aHcdtfydbaASmbcjjjj94cba8EaEfydbaHSEhCkaXaOaCVaHVBdbaecxfheaLcifgLaa6mbkkdnazTmbaaTmbaaheinabazabydbcdtfydbBdbabclfhbaecufgembkkdnaPTmbaPaZaU:rNUdbkdnasyd;8egHTmbaHcdtasc:Ceffc98fheinaeydbcbyd:m:H:cjbH:bjjjbbaec98fheaHcufgHmbkkascj;sbf8Kjjjjbaak;Yieouabydlhvabydbclfcbaicdtz:tjjjbhoadci9UhrdnadTmbdnalTmbaehwadhDinaoalawydbcdtfydbcdtfgqaqydbcefBdbawclfhwaDcufgDmbxdkkaehwadhDinaoawydbcdtfgqaqydbcefBdbawclfhwaDcufgDmbkkdnaiTmbcbhDaohwinawydbhqawaDBdbawclfhwaqaDfhDaicufgimbkkdnadci6mbinaecwfydbhwaeclfydbhDaeydbhidnalTmbalawcdtfydbhwalaDcdtfydbhDalaicdtfydbhikavaoaicdtfgqydbcitfaDBdbavaqydbcitfawBdlaqaqydbcefBdbavaoaDcdtfgqydbcitfawBdbavaqydbcitfaiBdlaqaqydbcefBdbavaoawcdtfgwydbcitfaiBdbavawydbcitfaDBdlawawydbcefBdbaecxfhearcufgrmbkkabydbcbBdbk:todDue99aicd4aifhrcehwinawgDcethwaDar6mbkcuaDcdtgraDcFFFFi0Ecbyd1:H:cjbHjjjjbbhwaoaoyd9GgqcefBd9GaoaqcdtfawBdbawcFearz:tjjjbhkdnaiTmbalcd4hlaDcufhxcbhminamhDdnavTmbavamcdtfydbhDkcbadaDal2cdtfgDydlgwawcjjjj94SEgwcH4aw7c:F:b:DD2cbaDydbgwawcjjjj94SEgwcH4aw7c;D;O:B8J27cbaDydwgDaDcjjjj94SEgDcH4aD7c:3F;N8N27axGhwamcdthPdndndnavTmbakawcdtfgrydbgDcuSmeadavaPfydbal2cdtfgsIdbhzcehqinaqhrdnadavaDcdtfydbal2cdtfgqIdbaz9CmbaqIdlasIdl9CmbaqIdwasIdw9BmlkarcefhqakawarfaxGgwcdtfgrydbgDcu9hmbxdkkakawcdtfgrydbgDcuSmbadamal2cdtfgsIdbhzcehqinaqhrdnadaDal2cdtfgqIdbaz9CmbaqIdlasIdl9CmbaqIdwasIdw9BmikarcefhqakawarfaxGgwcdtfgrydbgDcu9hmbkkaramBdbamhDkabaPfaDBdbamcefgmai9hmbkkakcbyd:m:H:cjbH:bjjjbbaoaoyd9GcufBd9GdnaeTmbaiTmbcbhDaehwinawaDBdbawclfhwaiaDcefgD9hmbkcbhDaehwindnaDabydbgrSmbawaearcdtfgrydbBdbaraDBdbkabclfhbawclfhwaiaDcefgD9hmbkkk;:odvuv998Jjjjjbca9Rgocbyd1:G:cjbBdKaocb8Pdj:G:cjb83izaocbydN:G:cjbBdwaocb8Pd:m:G:cjb83ibdnadTmbaicd4hrdnabmbdnalTmbcbhwinaealawcdtfydbar2cdtfhDcbhiinaoczfaifgqaDaifIdbgkaqIdbgxaxak9EEUdbaoaifgqakaqIdbgxaxak9DEUdbaiclfgicx9hmbkawcefgwad9hmbxikkarcdthwcbhDincbhiinaoczfaifgqaeaifIdbgkaqIdbgxaxak9EEUdbaoaifgqakaqIdbgxaxak9DEUdbaiclfgicx9hmbkaeawfheaDcefgDad9hmbxdkkdnalTmbcbhwinabawcx2fgiaealawcdtfydbar2cdtfgDIdbUdbaiaDIdlUdlaiaDIdwUdwcbhiinaoczfaifgqaDaifIdbgkaqIdbgxaxak9EEUdbaoaifgqakaqIdbgxaxak9DEUdbaiclfgicx9hmbkawcefgwad9hmbxdkkarcdthlcbhwaehDinabawcx2fgiaeawar2cdtfgqIdbUdbaiaqIdlUdlaiaqIdwUdwcbhiinaoczfaifgqaDaifIdbgkaqIdbgxaxak9EEUdbaoaifgqakaqIdbgxaxak9DEUdbaiclfgicx9hmbkaDalfhDawcefgwad9hmbkkJbbbbaoIdbaoIdzgx:tgkakJbbbb9DEgkaoIdlaoIdCgm:tgPaPak9DEgkaoIdwaoIdKgP:tgsasak9DEhsdnabTmbadTmbJbbbbJbbjZas:vasJbbbb9BEhkinabakabIdbax:tNUdbabclfgoakaoIdbam:tNUdbabcwfgoakaoIdbaP:tNUdbabcxfhbadcufgdmbkkdnavTmbavaPUdwavamUdlavaxUdbkask:WlewudnaeTmbcbhvabhoinaoavBdbaoclfhoaeavcefgv9hmbkkdnaiTmbcbhrinadarcdtfhwcbhDinalawaDcdtgvyd:G:G:cjbcdtfydbcdtfydbhodnalawavfydbcdtfydbgqabaqcdtfgkydbgvSmbinakabavgqcdtfgxydbgvBdbaxhkaqav9hmbkkdnaoabaocdtfgkydbgvSmbinakabavgocdtfgxydbgvBdbaxhkaoav9hmbkkdnaqaoSmbabaqaoaqao0Ecdtfaqaoaqao6EBdbkaDcefgDci9hmbkarcifgrai6mbkkdnaembcbskcbhxindnalaxcdtgvfydbax9hmbaxhodnaxabavfgDydbgvSmbaDhqinaqabavgocdtfgkydbgvBdbakhqaoav9hmbkkaDaoBdbkaxcefgxae9hmbkcbhkabhvcbhoindndnaoalydbgq9hmbdnaoavydbgq9hmbavakBdbakcefhkxdkavabaqcdtfydbBdbxekavabaqcdtfydbBdbkalclfhlavclfhvaeaocefgo9hmbkakk;jiilud99euabcbaecltz:tjjjbhvdnalTmbadhoaihralhwinarcwfIdbhDarclfIdbhqavaoydbcltfgkarIdbakIdbMUdbakaqakIdlMUdlakaDakIdwMUdwakakIdxJbbjZMUdxaoclfhoarcxfhrawcufgwmbkkdnaeTmbavhkaehrinakcxfgoIdbhDaocbBdbakakIdbJbbbbJbbjZaD:vaDJbbbb9BEgDNUdbakclfgoaDaoIdbNUdbakcwfgoaDaoIdbNUdbakczfhkarcufgrmbkkdnalTmbinavadydbcltfgkaicwfIdbakIdw:tgDaDNaiIdbakIdb:tgDaDNaiclfIdbakIdl:tgDaDNMMgDakIdxgqaqaD9DEUdxadclfhdaicxfhialcufglmbkkdnaeTmbavcxfhkinabakIdbUdbakczfhkabclfhbaecufgembkkk:moerudnaoTmbaecd4hzdnavTmbaicd4hHavcdthOcbhAindnaPaAfRbbTmbaAhednaDTmbaDaAcdtfydbhekdnasTmbasaefRbbceGmekdnamaAfRbbclSmbabaeaz2cdtfgiaraAcx2fgCIdbakNaxIdbMUdbaiaCIdlakNaxIdlMUdlaiaCIdwakNaxIdwMUdwkadaeaH2cdtfhXaqheawhiavhCinaXaeydbcdtgQfaiIdbalaQfIdb:vUdbaeclfheaiclfhiaCcufgCmbkkawaOfhwaAcefgAao9hmbxdkkdnasmbcbheaDhiindnaPaefRbbTmbaehCdnaDTmbaiydbhCkamaefRbbclSmbabaCaz2cdtfgCarIdbakNaxIdbMUdbaCarclfIdbakNaxIdlMUdlaCarcwfIdbakNaxIdwMUdwkaiclfhiarcxfhraoaecefge9hmbxdkkdnaDTmbindnaPRbbTmbasaDydbgefRbbceGmbamRbbclSmbabaeaz2cdtfgearIdbakNaxIdbMUdbaearclfIdbakNaxIdlMUdlaearcwfIdbakNaxIdwMUdwkaPcefhPaDclfhDamcefhmarcxfhraocufgombxdkkazcdthicbheindnaPaefRbbTmbasaefRbbceGmbamaefRbbclSmbabarIdbakNaxIdbMUdbabclfarclfIdbakNaxIdlMUdbabcwfarcwfIdbakNaxIdwMUdbkarcxfhrabaifhbaoaecefge9hmbkkk8MbabaeadaialavcbcbcbcbcbaoarawaDz:bjjjbk8MbabaeadaialavaoarawaDaqakaxamaPz:bjjjbkRbababaeadaialavaoarawaDaqakaxcjjjjdVamz:bjjjbk:g8Koque99due99duq998Jjjjjbc;Wb9Rgq8Kjjjjbcbhkaqcxfcbc;Kbz:tjjjb8Aaqcualcx2alc;v:Q;v:Qe0Ecbyd1:H:cjbHjjjjbbgxBdxaqceBd2axaialavcbcbz:ejjjb8AaqcualcdtalcFFFFi0Egmcbyd1:H:cjbHjjjjbbgiBdzaqcdBd2dndnJFF959eJbbjZawJbbjZawJbbjZ9DE:vawJ9VO:d869DEgw:lJbbb9p9DTmbaw:OhPxekcjjjj94hPkadci9Uhsarco9UhzdndnaombaPcd9imekdnalTmbaPcuf:YhwdnaoTmbcbhvaihHaxhOindndnaoavfRbbceGTmbavcjjjjlVhAxekdndnaOclfIdbawNJbbbZMgC:lJbbb9p9DTmbaC:OhAxekcjjjj94hAkaAcqthAdndnaOcwfIdbawNJbbbZMgC:lJbbb9p9DTmbaC:OhXxekcjjjj94hXkaAaXVhAdndnaOIdbawNJbbbZMgC:lJbbb9p9DTmbaC:OhXxekcjjjj94hXkaAaXcCtVhAkaHaABdbaHclfhHaOcxfhOalavcefgv9hmbxdkkaxhvaihOalhHindndnavIdbawNJbbbZMgC:lJbbb9p9DTmbaC:OhAxekcjjjj94hAkaAcCthAdndnavclfIdbawNJbbbZMgC:lJbbb9p9DTmbaC:OhXxekcjjjj94hXkaXcqtaAVhAdndnavcwfIdbawNJbbbZMgC:lJbbb9p9DTmbaC:OhXxekcjjjj94hXkaOaAaXVBdbavcxfhvaOclfhOaHcufgHmbkkadTmbcbhkaehvcbhOinakaiavclfydbcdtfydbgHaiavcwfydbcdtfydbgA9haiavydbcdtfydbgXaH9haXaA9hGGfhkavcxfhvaOcifgOad6mbkkarci9UhQdndnaz:Z:rJbbbZMgw:lJbbb9p9DTmbaw:Ohvxekcjjjj94hvkaQ:ZhLcbhKc:bwhzdninakaQ9pmeazaP9Rcd9imeavazcufgOavaO9iEaPcefavaP9kEhYdnalTmbaYcuf:YhwdnaoTmbcbhOaihHaxhvindndnaoaOfRbbceGTmbaOcjjjjlVhAxekdndnavclfIdbawNJbbbZMgC:lJbbb9p9DTmbaC:OhAxekcjjjj94hAkaAcqthAdndnavcwfIdbawNJbbbZMgC:lJbbb9p9DTmbaC:OhXxekcjjjj94hXkaAaXVhAdndnavIdbawNJbbbZMgC:lJbbb9p9DTmbaC:OhXxekcjjjj94hXkaAaXcCtVhAkaHaABdbaHclfhHavcxfhvalaOcefgO9hmbxdkkaxhvaihOalhHindndnavIdbawNJbbbZMgC:lJbbb9p9D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ekcjjjj94hrkarcqtaXVhXdndnaOcwfIdbawNJbbbZMgC:lJbbb9p9DTmbaC:Ohrxekcjjjj94hrkaHaXarVBdbaOcxfhOaHclfhHaAcufgAmbkkaKcFeaYz:tjjjbhravcufhocbhPcbhYindndndnaraiaYcdtgKfydbgAcm4aA7c:v;t;h;Ev2gvcs4av7aoGgHcdtfgXydbgOcuSmbcehvinaiaOcdtgOfydbaASmdaHavfhOavcefhvaraOaoGgHcdtfgXydbgOcu9hmbkkaXaYBdbaPhvaPcefhPxekazaOfydbhvkazaKfavBdbaYcefgYal9hmbkcuaPc8S2gOaPc;D;O;f8U0EhvkcbhXaqavcbyd1:H:cjbHjjjjbbgvBd3aqcvBd2avcbaOz:tjjjbhOdnadTmbaehiinaxaiclfydbgrcx2fgvIdbaxaiydbgocx2fgHIdbg3:tgCaxaicwfydbgYcx2fgAIdlaHIdlg8A:tgwNavIdla8A:tgEaAIdba3:tg8EN:tgLaLNaEaAIdwaHIdwg5:tg8FNavIdwa5:tgEawN:tgwawNaEa8ENaCa8FN:tgCaCNMMg8E:rhEJbbnnJbbjZazaocdtfydbgvazarcdtfydbgASavazaYcdtfydbgrSGgHEh8Fdna8EJbbbb9ETmbaLaE:vhLaCaE:vhCawaE:vhwkaOavc8S2fgvavIdbawa8FaE:rNgEawNNg8FMUdbavaCaEaCNgaNghavIdlMUdlavaLaEaLNg8ENggavIdwMUdwavawaaNgaavIdxMUdxava8EawNg8JavIdzMUdzavaCa8ENg8EavIdCMUdCavawaEaLa5Nawa3Na8AaCNMM:mg8ANg3NgwavIdKMUdKavaCa3NgCavId3MUd3avaLa3NgLavIdaMUdaava3a8ANg3avId8KMUd8KavaEavIdyMUdydnaHmbaOaAc8S2fgva8FavIdbMUdbavahavIdlMUdlavagavIdwMUdwavaaavIdxMUdxava8JavIdzMUdzava8EavIdCMUdCavawavIdKMUdKavaCavId3MUd3avaLavIdaMUdaava3avId8KMUd8KavaEavIdyMUdyaOarc8S2fgva8FavIdbMUdbavahavIdlMUdlavagavIdwMUdwavaaavIdxMUdxava8JavIdzMUdzava8EavIdCMUdCavawavIdKMUdKavaCavId3MUd3avaLavIdaMUdaava3avId8KMUd8KavaEavIdyMUdykaicxfhiaXcifgXad6mbkkcbhAaqcuaPcdtgvaPcFFFFi0Egicbyd1:H:cjbHjjjjbbgHBdaaqcoBd2aqaicbyd1:H:cjbHjjjjbbgiBd8KaqcrBd2aHcFeavz:tjjjbhYdnalTmbazhHinJbbbbJbbjZaOaHydbgXc8S2fgvIdygw:vawJbbbb9BEavIdwaxcwfIdbgwNavIdzaxIdbgCNavIdaMgLaLMMawNavIdlaxclfIdbgLNavIdCawNavId3MgwawMMaLNavIdbaCNavIdxaLNavIdKMgwawMMaCNavId8KMMM:lNhwdndnaYaXcdtgvfgXydbcuSmbaiavfIdbaw9ETmekaXaABdbaiavfawUdbkaHclfhHaxcxfhxalaAcefgA9hmbkkdndnaPmbJbbbbhwxekJbbbbhwinaiIdbgCawawaC9DEhwaiclfhiaPcufgPmbkaw:rhwkakcd4akfhOcehiinaigvcethiavaO6mbkcbhOaqcuavcdtgiavcFFFFi0Ecbyd1:H:cjbHjjjjbbgHBdyaHcFeaiz:tjjjbhXdnadTmbavcufhrcbhPcbhxindnazaeaxcdtfgvydbcdtfydbgiazavclfydbcdtfydbgOSmbaiazavcwfydbcdtfydbgvSmbaOavSmbaYavcdtfydbhAdndnaYaOcdtfydbgvaYaicdtfydbgi9pmbavaA9pmbaAhlaihoavhAxekdnaAai9pmbaAav9pmbaihlavhoxekavhlaAhoaihAkabaPcx2fgvaABdbavcwfaoBdbavclfalBdbdnaXaoc:3F;N8N2alc:F:b:DD27aAc;D;O:B8J27arGgOcdtfgvydbgicuSmbcehHinaHhvdnabaicx2fgiydbaA9hmbaiydlal9hmbaiydwaoSmikavcefhHaXaOavfarGgOcdtfgvydbgicu9hmbkkavaPBdbaPcefhPkaxcifgxad6mbkaPci2hOkcwhvaDTmekaDawUdbkavcdthvaqcxfc98fhiinaiavfydbcbyd:m:H:cjbH:bjjjbbavc98fgvmbkaqc;Wbf8KjjjjbaOk:3ldrue9:8Jjjjjbc;Wb9Rgr8Kjjjjbcbhwarcxfcbc;Kbz:tjjjb8AdnabaeSmbabaeadcdtzMjjjb8AkarcualcdtalcFFFFi0EgDcbyd1:H:cjbHjjjjbbgqBdxarceBd2aqcbaialavcbarcxfz:djjjbcualcx2alc;v:Q;v:Qe0Ecbyd1:H:cjbHjjjjbbhkarcxfaryd2gxcdtfakBdbaraxcefgmBd2akaialavcbcbz:ejjjb8AarcxfamcdtfaDcbyd1:H:cjbHjjjjbbgiBdbaraxcdfgvBd2arcxfavcdtfcuaialaeadaqz:fjjjbgecltaecjjjjiGEcbyd1:H:cjbHjjjjbbgqBdbaqaeaiakalz:gjjjbaxcifhkdnadTmbaoaoNhocbhwabhlcbheindnaqaialydbgvcdtfydbcdtfIdbao9ETmbalclf8PdbhPabawcdtfgDavBdbaDclfaP83dbawcifhwkalcxfhlaecifgead6mbkkdnakTmbaxcdtarcxffcwfhlinalydbcbyd:m:H:cjbH:bjjjbbalc98fhlakcufgkmbkkarc;Wbf8Kjjjjbawk:WCoDud99vue99vuv998Jjjjjbc;Wb9Rgw8KjjjjbdndnarmbcbhDxekawcxfcbc;Kbz:tjjjb8Aawcuadcx2adc;v:Q;v:Qe0Ecbyd1:H:cjbHjjjjbbgqBdxawceBd2aqaeadaicbcbz:ejjjb8AawcuadcdtadcFFFFi0Egkcbyd1:H:cjbHjjjjbbgxBdzawcdBd2adcd4adfhmceheinaegicetheaiam6mbkcbhPawcuaicdtgsaicFFFFi0Ecbyd1:H:cjbHjjjjbbgzBdCawciBd2dndnar:ZgH:rJbbbZMgO:lJbbb9p9DTmbaO:Ohexekcjjjj94hekaicufhAc:bwhCcbhXadhQcbhLinaeaCcufgiaeai9iEaPcefaeaP9kEhDdndnadTmbaDcuf:YhOaqhiaxheadhmindndnaiIdbaONJbbbZMgK:lJbbb9p9DTmbaK:OhYxekcjjjj94hYkaYcCthYdnd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faiBdba3cefg3ad9hmbkcuaDc32giaDc;j:KM;jb0EhexekazcFeasz:tjjjb8AcbhDcbhekawaecbyd1:H:cjbHjjjjbbgeBd3awcvBd2aecbaiz:tjjjbh8Aavcd4hxdnadTmbdnalTmbaxcdthEa5hYaqhealhmadhAina8AaYydbc32fgiaeIdbaiIdbMUdbaiaeclfIdbaiIdlMUdlaiaecwfIdbaiIdwMUdwaiamIdbaiIdxMUdxaiamclfIdbaiIdzMUdzaiamcwfIdbaiIdCMUdCaiaiIdKJbbjZMUdKaYclfhYaecxfheamaEfhmaAcufgAmbxdkka5hmaqheadhYina8Aamydbc32fgiaeIdbaiIdbMUdbaiaeclfIdbaiIdlMUdlaiaecwfIdbaiIdwMUdwaiaiIdxJbbbbMUdxaiaiIdzJbbbbMUdzaiaiIdCJbbbbMUdCaiaiIdKJbbjZMUdKamclfhmaecxfheaYcufgYmbkkdnaDTmba8AhiaDheinaiaiIdbJbbbbJbbjZaicKfIdbgO:vaOJbbbb9BEgONUdbaiclfgmaOamIdbNUdbaicwfgmaOamIdbNUdbaicxfgmaOamIdbNUdbaiczfgmaOamIdbNUdbaicCfgmaOamIdbNUdbaic3fhiaecufgembkkcbhYawcuaDcdtgCaDcFFFFi0Egicbyd1:H:cjbHjjjjbbgeBdaawcoBd2awaicbyd1:H:cjbHjjjjbbgEBd8KaecFeaCz:tjjjbh3dnadTmbaoJbbjZJbbjZaK:vaPceSENgOaONhKaxcdthxalheinaKaec;8:G:cjbalEgmIdwa8Aa5ydbgAc32fgiIdC:tgOaONamIdbaiIdx:tgOaONamIdlaiIdz:tgOaONMMNaqcwfIdbaiIdw:tgOaONaqIdbaiIdb:tgOaONaqclfIdbaiIdl:tgOaONMMMhOdndna3aAcdtgifgmydbcuSmbaEaifIdbaO9ETmekamaYBdbaEaifaOUdbka5clfh5aqcxfhqaeaxfheadaYcefgY9hmbkkaba3aCzMjjjb8Acrhikaicdthiawcxfc98fheinaeaifydbcbyd:m:H:cjbH:bjjjbbaic98fgimbkkawc;Wbf8KjjjjbaDk:Pdidui99ducbhi8Jjjjjbca9Rglcbyd1:G:cjbBdKalcb8Pdj:G:cjb83izalcbydN:G:cjbBdwalcb8Pd:m:G:cjb83ibdndnaembJbbjFhvJbbjFhoJbbjFhrxekadcd4cdthwincbhdinalczfadfgDabadfIdbgvaDIdbgoaoav9EEUdbaladfgDavaDIdbgoaoav9DEUdbadclfgdcx9hmbkabawfhbaicefgiae9hmbkalIdwalIdK:thralIdlalIdC:thoalIdbalIdz:thvkJbbbbavavJbbbb9DEgvaoaoav9DEgvararav9DEk9DeeuabcFeaicdtz:tjjjbhlcbhbdnadTmbindnalaeydbcdtfgiydbcu9hmbaiabBdbabcefhbkaeclfheadcufgdmbkkabk;Bidqui998Jjjjjbc;Wb9Rgl8Kjjjjbalcxfcbc;Kbz:tjjjb8Aadcd4adfhvcehoinaogrcethoarav6mbkalcuarcdtgoarcFFFFi0Ecbyd1:H:cjbHjjjjbbgvBdxavcFeaoz:tjjjbhwdnadTmbaicd4hDarcufhqcbhkindndnawcbaeakaD2cdtfgrydlgiaicjjjj94SEgocH4ao7c:F:b:DD2cbarydbgxaxcjjjj94SEgocH4ao7c;D;O:B8J27cbarydwgmamcjjjj94SEgrcH4ar7c:3F;N8N27aqGgvcdtfgrydbgocuSmbam::hPai::hsax::hzcehiinaihrdnaeaoaD2cdtfgiIdbaz9CmbaiIdlas9CmbaiIdwaP9BmikarcefhiawavarfaqGgvcdtfgrydbgocu9hmbkkarakBdbakhokabakcdtfaoBdbakcefgkad9hmbkkalydxcbyd:m:H:cjbH:bjjjbbalc;Wbf8Kjjjjbk9teiucbcbyd:q:H:cjbgeabcifc98GfgbBd:q:H:cjbdndnabZbcztgd9nmbcuhiabad9RcFFifcz4nbcuSmekaehikaik;LeeeudndnaeabVciGTmbabhixekdndnadcz9pmbabhixekabhiinaiaeydbBdbaiclfaeclfydbBdbaicwfaecwfydbBdbaicxfaecxfydbBdbaeczfheaiczfhiadc9Wfgdcs0mbkkadcl6mbinaiaeydbBdbaeclfheaiclfhiadc98fgdci0mbkkdnadTmbinaiaeRbb86bbaicefhiaecefheadcufgdmbkkabk;aeedudndnabciGTmbabhixekaecFeGc:b:c:ew2hldndnadcz9pmbabhixekabhiinaialBdbaicxfalBdbaicwfalBdbaiclfalBdbaiczfhiadc9Wfgdcs0mbkkadcl6mbinaialBdbaiclfhiadc98fgdci0mbkkdnadTmbinaiae86bbaicefhiadcufgdmbkkabk9teiucbcbyd:q:H:cjbgeabcrfc94GfgbBd:q:H:cjbdndnabZbcztgd9nmbcuhiabad9RcFFifcz4nbcuSmekaehikaikTeeucbabcbyd:q:H:cjbge9Rcifc98GaefgbBd:q:H:cjbdnabZbcztge9nmbabae9RcFFifcz4nb8Akkk:Kedbcj:Gdk1eFFuuFFuuFFuuFFuFFFuFFFuFbbbbbbbbebbbdbbbbbbbebbbebbbdbbbbbbbbbbbeeeeebebbebbebebbbeebbbbbbbbbbbbeeeeeebebbeeebeebbbbebebbbbbbbbbbbbbbbbbbc1:Hdkxebbbdbbb:G:qbb",t=new Uint8Array([32,0,65,2,1,106,34,33,3,128,11,4,13,64,6,253,10,7,15,116,127,5,8,12,40,16,19,54,20,9,27,255,113,17,42,67,24,23,146,148,18,14,22,45,70,69,56,114,101,21,25,63,75,136,108,28,118,29,73,115]);if(typeof WebAssembly!="object")return{supported:!1};var n,i=WebAssembly.instantiate(r(e),{}).then(function(x){n=x.instance,n.exports.__wasm_call_ctors()});function r(x){for(var T=new Uint8Array(x.length),E=0;E<x.length;++E){var v=x.charCodeAt(E);T[E]=v>96?v-97:v>64?v-39:v+4}for(var S=0,E=0;E<x.length;++E)T[S++]=T[E]<60?t[T[E]]:(T[E]-60)*64+T[++E];return T.buffer.slice(0,S)}function o(x){if(!x)throw new Error("Assertion failed")}function s(x){return new Uint8Array(x.buffer,x.byteOffset,x.byteLength)}function a(x,T,E,v){var S=n.exports.sbrk,I=S(E*4),R=S(E*v*4),O=new Uint8Array(n.exports.memory.buffer);O.set(s(T),R),x(I,R,E,v*4),O=new Uint8Array(n.exports.memory.buffer);var L=new Uint32Array(E);return new Uint8Array(L.buffer).set(O.subarray(I,I+E*4)),S(I-S(0)),L}function c(x,T,E){var v=n.exports.sbrk,S=v(T.length*4),I=v(E*4),R=new Uint8Array(n.exports.memory.buffer),O=s(T);R.set(O,S);var L=x(I,S,T.length,E);R=new Uint8Array(n.exports.memory.buffer);var _=new Uint32Array(E);new Uint8Array(_.buffer).set(R.subarray(I,I+E*4)),v(S-v(0));for(var C=0;C<T.length;++C)T[C]=_[T[C]];return[_,L]}function u(x){for(var T=0,E=0;E<x.length;++E){var v=x[E];T=T<v?v:T}return T}function f(x,T,E,v,S,I,R,O,L){var _=n.exports.sbrk,C=_(4),w=_(E*4),D=_(S*I),N=_(E*4),F=new Uint8Array(n.exports.memory.buffer);F.set(s(v),D),F.set(s(T),N);var V=x(w,N,E,D,S,I,R,O,L,C);F=new Uint8Array(n.exports.memory.buffer);var B=new Uint32Array(V);s(B).set(F.subarray(w,w+V*4));var j=new Float32Array(1);return s(j).set(F.subarray(C,C+4)),_(C-_(0)),[B,j[0]]}function d(x,T,E,v,S,I,R,O,L,_,C,w,D){var N=n.exports.sbrk,F=N(4),V=N(E*4),B=N(S*I),j=N(S*O),k=N(L.length*4),G=N(E*4),q=_?N(S):0,Q=new Uint8Array(n.exports.memory.buffer);Q.set(s(v),B),Q.set(s(R),j),Q.set(s(L),k),Q.set(s(T),G),_&&Q.set(s(_),q);var W=x(V,G,E,B,S,I,j,O,k,L.length,q,C,w,D,F);Q=new Uint8Array(n.exports.memory.buffer);var J=new Uint32Array(W);s(J).set(Q.subarray(V,V+W*4));var Z=new Float32Array(1);return s(Z).set(Q.subarray(F,F+4)),N(F-N(0)),[J,Z[0]]}function p(x,T,E,v,S,I,R,O,L,_,C,w,D){var N=n.exports.sbrk,F=N(4),V=N(S*I),B=N(S*O),j=N(L.length*4),k=N(E*4),G=_?N(S):0,q=new Uint8Array(n.exports.memory.buffer);q.set(s(v),V),q.set(s(R),B),q.set(s(L),j),q.set(s(T),k),_&&q.set(s(_),G);var Q=x(k,E,V,S,I,B,O,j,L.length,G,C,w,D,F);q=new Uint8Array(n.exports.memory.buffer),s(T).set(q.subarray(k,k+Q*4)),s(v).set(q.subarray(V,V+S*I)),s(R).set(q.subarray(B,B+S*O));var W=new Float32Array(1);return s(W).set(q.subarray(F,F+4)),N(F-N(0)),[Q,W[0]]}function g(x,T,E,v){var S=n.exports.sbrk,I=S(E*v),R=new Uint8Array(n.exports.memory.buffer);R.set(s(T),I);var O=x(I,E,v);return S(I-S(0)),O}function m(x,T,E,v,S,I,R,O){var L=n.exports.sbrk,_=L(O*4),C=L(E*v),w=S?L(E*I):0,D=new Uint8Array(n.exports.memory.buffer);D.set(s(T),C),S&&D.set(s(S),w);var N=x(_,C,E,v,w,I,R,O);D=new Uint8Array(n.exports.memory.buffer);var F=new Uint32Array(N);return s(F).set(D.subarray(_,_+N*4)),L(_-L(0)),F}function y(x,T,E,v,S,I,R,O,L){var _=n.exports.sbrk,C=_(4),w=_(E*4),D=_(S*I),N=_(E*4),F=R?_(S):0,V=new Uint8Array(n.exports.memory.buffer);V.set(s(v),D),V.set(s(T),N),R&&V.set(s(R),F);var B=x(w,N,E,D,S,I,F,O,L,C);V=new Uint8Array(n.exports.memory.buffer);var j=new Uint32Array(B);s(j).set(V.subarray(w,w+B*4));var k=new Float32Array(1);return s(k).set(V.subarray(C,C+4)),_(C-_(0)),[j,k[0]]}function A(x,T,E,v,S,I,R){var O=n.exports.sbrk,L=O(E*4),_=O(S*I),C=O(E*4),w=new Uint8Array(n.exports.memory.buffer);w.set(s(v),_),w.set(s(T),C);var D=x(L,C,E,_,S,I,R);w=new Uint8Array(n.exports.memory.buffer);var N=new Uint32Array(D);return s(N).set(w.subarray(L,L+D*4)),O(L-O(0)),N}var b={LockBorder:1,Sparse:2,ErrorAbsolute:4,Prune:8,Regularize:16,Permissive:32,RegularizeLight:64,_InternalDebug:1<<30};return{ready:i,supported:!0,compactMesh:function(x){o(x instanceof Uint32Array||x instanceof Int32Array||x instanceof Uint16Array||x instanceof Int16Array),o(x.length%3==0);var T=x.BYTES_PER_ELEMENT==4?x:new Uint32Array(x),E=c(n.exports.meshopt_optimizeVertexFetchRemap,T,u(x)+1);if(x!==T)for(var v=0;v<T.length;++v)x[v]=T[v];return E},generatePositionRemap:function(x,T){return o(x instanceof Float32Array),o(x.length%T==0),o(T>=3),a(n.exports.meshopt_generatePositionRemap,x,x.length/T,T)},simplify:function(x,T,E,v,S,I){o(x instanceof Uint32Array||x instanceof Int32Array||x instanceof Uint16Array||x instanceof Int16Array),o(x.length%3==0),o(T instanceof Float32Array),o(T.length%E==0),o(E>=3),o(v>=0&&v<=x.length),o(v%3==0),o(S>=0);for(var R=0,O=0;O<(I?I.length:0);++O)o(I[O]in b),R|=b[I[O]];var L=x.BYTES_PER_ELEMENT==4?x:new Uint32Array(x),_=f(n.exports.meshopt_simplify,L,x.length,T,T.length/E,E*4,v,S,R);return _[0]=x instanceof Uint32Array?_[0]:new x.constructor(_[0]),_},simplifyWithAttributes:function(x,T,E,v,S,I,R,O,L,_){o(x instanceof Uint32Array||x instanceof Int32Array||x instanceof Uint16Array||x instanceof Int16Array),o(x.length%3==0),o(T instanceof Float32Array),o(T.length%E==0),o(E>=3),o(v instanceof Float32Array),o(v.length==S*(T.length/E)),o(S>=0),o(R==null||R instanceof Uint8Array),o(R==null||R.length==T.length/E),o(O>=0&&O<=x.length),o(O%3==0),o(L>=0),o(Array.isArray(I)),o(S>=I.length),o(I.length<=32);for(var C=0;C<I.length;++C)o(I[C]>=0);for(var w=0,C=0;C<(_?_.length:0);++C)o(_[C]in b),w|=b[_[C]];var D=x.BYTES_PER_ELEMENT==4?x:new Uint32Array(x),N=d(n.exports.meshopt_simplifyWithAttributes,D,x.length,T,T.length/E,E*4,v,S*4,new Float32Array(I),R,O,L,w);return N[0]=x instanceof Uint32Array?N[0]:new x.constructor(N[0]),N},simplifyWithUpdate:function(x,T,E,v,S,I,R,O,L,_){o(x instanceof Uint32Array||x instanceof Int32Array||x instanceof Uint16Array||x instanceof Int16Array),o(x.length%3==0),o(T instanceof Float32Array),o(T.length%E==0),o(E>=3),o(v instanceof Float32Array),o(v.length==S*(T.length/E)),o(S>=0),o(R==null||R instanceof Uint8Array),o(R==null||R.length==T.length/E),o(O>=0&&O<=x.length),o(O%3==0),o(L>=0),o(Array.isArray(I)),o(S>=I.length),o(I.length<=32);for(var C=0;C<I.length;++C)o(I[C]>=0);for(var w=0,C=0;C<(_?_.length:0);++C)o(_[C]in b),w|=b[_[C]];var D=x.BYTES_PER_ELEMENT==4?x:new Uint32Array(x),N=p(n.exports.meshopt_simplifyWithUpdate,D,x.length,T,T.length/E,E*4,v,S*4,new Float32Array(I),R,O,L,w);if(x!==D)for(var C=0;C<N[0];++C)x[C]=D[C];return N},getScale:function(x,T){return o(x instanceof Float32Array),o(x.length%T==0),o(T>=3),g(n.exports.meshopt_simplifyScale,x,x.length/T,T*4)},simplifyPoints:function(x,T,E,v,S,I){return o(x instanceof Float32Array),o(x.length%T==0),o(T>=3),o(E>=0&&E<=x.length/T),v?(o(v instanceof Float32Array),o(v.length%S==0),o(S>=3),o(x.length/T==v.length/S),m(n.exports.meshopt_simplifyPoints,x,x.length/T,T*4,v,S*4,I||0,E)):m(n.exports.meshopt_simplifyPoints,x,x.length/T,T*4,void 0,0,0,E)},simplifySloppy:function(x,T,E,v,S,I){o(x instanceof Uint32Array||x instanceof Int32Array||x instanceof Uint16Array||x instanceof Int16Array),o(x.length%3==0),o(T instanceof Float32Array),o(T.length%E==0),o(E>=3),o(v==null||v instanceof Uint8Array),o(v==null||v.length==T.length/E),o(S>=0&&S<=x.length),o(S%3==0),o(I>=0);var R=x.BYTES_PER_ELEMENT==4?x:new Uint32Array(x),O=y(n.exports.meshopt_simplifySloppy,R,x.length,T,T.length/E,E*4,v,S,I);return O[0]=x instanceof Uint32Array?O[0]:new x.constructor(O[0]),O},simplifyPrune:function(x,T,E,v){o(x instanceof Uint32Array||x instanceof Int32Array||x instanceof Uint16Array||x instanceof Int16Array),o(x.length%3==0),o(T instanceof Float32Array),o(T.length%E==0),o(E>=3),o(v>=0);var S=x.BYTES_PER_ELEMENT==4?x:new Uint32Array(x),I=A(n.exports.meshopt_simplifyPrune,S,x.length,T,T.length/E,E*4,v);return I=x instanceof Uint32Array?I:new x.constructor(I),I}}})();var C4n=(function(){var e="b9H79Tebbbe:neP9Geueu9Geub9Gbb9Giuuueu9Gmuuuuuuuuuuu9999eu9Gouuuuuueu9Gruuuuuuub9Gxuuuuuuuuuuuueu9Gxuuuuuuuuuuu99eu9GPuuuuuuuuuuuuu99b9Gouuuuuub9Gwuuuuuuuub9Gvuuuuub9GluuuubiQXdilvorwDqokoqxmbiibeilve9Weiiviebeoweuecj:Gdkr;Zeqo9TW9T9VV95dbH9F9F939H79T9F9J9H229F9Jt9VV7bb8A9TW79O9V9Wt9F9I919P29K9nW79O2Wt79c9V919U9KbeY9TW79O9V9Wt9F9I919P29K9nW79O2Wt7S2W94bd39TW79O9V9Wt9F9I919P29K9nW79O2Wt79t9W9Ht9P9H2bo39TW79O9V9Wt9F9J9V9T9W91tWJ2917tWV9c9V919U9K7bw39TW79O9V9Wt9F9J9V9T9W91tW9nW79O2Wt9c9V919U9K7bkE9TW79O9V9Wt9F9J9V9T9W91tW9t9W9OWVW9c9V919U9K7bxL9TW79O9V9Wt9F9V9Wt9P9T9P96W9nW79O2WtbPl79IV9RbsDwebcekdOAq;W:leXdbkIbabaec9:fgefcufae9Ugeabci9Uadfcufad9Ugbaeab0Ek:88JDPue99eux99due99euo99iu8Jjjjjbc:WD9Rgm8KjjjjbdndnalmbcbhPxekamc:Cwfcbc;Kbz:rjjjb8AcuaocdtgsaocFFFFi0Ehzcbyd;0:G:cjbhHdndnalcb9imbaoal9nmbamazaHHjjjjbbgHBd:CwamceBd;8wamazcbyd;0:G:cjbHjjjjbbgOBd:GwamcdBd;8wamcualcdtalcFFFFi0Ecbyd;0:G:cjbHjjjjbbgABd:KwamciBd;8waihzalhsinaHazydbcdtfcbBdbazclfhzascufgsmbkaihzalhsinaHazydbcdtfgCaCydbcefBdbazclfhzascufgsmbkaihzalhCcbhXindnaHazydbcdtgQfgsydbcb9imbaOaQfaXBdbasasydbgQcjjjj94VBdbaQaXfhXkazclfhzaCcufgCmbkalci9UhLdnalci6mbcbhzaihsinascwfydbhCasclfydbhXaOasydbcdtfgQaQydbgQcefBdbaAaQcdtfazBdbaOaXcdtfgXaXydbgXcefBdbaAaXcdtfazBdbaOaCcdtfgCaCydbgCcefBdbaAaCcdtfazBdbascxfhsaLazcefgz9hmbkkaihzalhsindnaHazydbcdtgCfgXydbgQcu9kmbaXaQcFFFFrGgQBdbaOaCfgCaCydbaQ9RBdbkazclfhzascufgsmbxdkkamazaHHjjjjbbgHBd:CwamceBd;8wamazcbyd;0:G:cjbHjjjjbbgOBd:GwamcdBd;8wamcualcdtalcFFFFi0Ecbyd;0:G:cjbHjjjjbbgABd:KwamciBd;8waHcbasz:rjjjbhXaihzalhsinaXazydbcdtfgCaCydbcefBdbazclfhzascufgsmbkalci9UhLdnaoTmbcbhzaOhsaXhCaohQinasazBdbasclfhsaCydbazfhzaCclfhCaQcufgQmbkkdnalci6mbcbhzaihsinascwfydbhCasclfydbhQaOasydbcdtfgKaKydbgKcefBdbaAaKcdtfazBdbaOaQcdtfgQaQydbgQcefBdbaAaQcdtfazBdbaOaCcdtfgCaCydbgCcefBdbaAaCcdtfazBdbascxfhsaLazcefgz9hmbkkaoTmbcbhzaohsinaOazfgCaCydbaXazfydb9RBdbazclfhzascufgsmbkkamaLcbyd;0:G:cjbHjjjjbbgzBd:OwamclBd;8wazcbaLz:rjjjbhYamcuaLcK2alcjjjjd0Ecbyd;0:G:cjbHjjjjbbg8ABd:SwamcvBd;8wJbbbbhEdnalci6g3mbarcd4hKaihsa8AhzaLhrJbbbbh5inavasclfydbaK2cdtfgCIdlh8EavasydbaK2cdtfgXIdlhEavascwfydbaK2cdtfgQIdlh8FaCIdwhaaXIdwhhaQIdwhgazaCIdbg8JaXIdbg8KMaQIdbg8LMJbbnn:vUdbazclfaXIdlaCIdlMaQIdlMJbbnn:vUdbaQIdwh8MaCIdwh8NaXIdwhyazcxfa8EaE:tg8Eagah:tggNaaah:tgaa8FaE:tghN:tgEJbbbbJbbjZa8Ja8K:tg8FahNa8Ea8La8K:tg8KN:tghahNaEaENaaa8KNa8FagN:tgEaENMMg8K:rg8E:va8KJbbbb9BEg8KNUdbazczfaEa8KNUdbazcCfaha8KNUdbazcwfa8Maya8NMMJbbnn:vUdba5a8EMh5ascxfhsazcKfhzarcufgrmbka5aL:Z:vJbbbZNhEkamcuaLcdtalcFFFF970Ecbyd;0:G:cjbHjjjjbbgCBd:WwamcoBd;8waq:Zhhdna3mbcbhzaChsinasazBdbasclfhsaLazcefgz9hmbkkaEahNhhamcuaLcltalcFFFFd0Ecbyd;0:G:cjbHjjjjbbg8PBd:0wamcrBd;8wcba8Pa8AaCaLcbz:djjjb8AJFFuuh8MJFFuuh8NJFFuuhydnalci6mbJFFuuhya8AhzaLhsJFFuuh8NJFFuuh8MinazcwfIdbgEa8Ma8MaE9EEh8MazclfIdbgEa8Na8NaE9EEh8NazIdbgEayayaE9EEhyazcKfhzascufgsmbkkah:rhEamaocetgzcuaocu9kEcbyd;0:G:cjbHjjjjbbgCBd:4wdndnaoal9nmbaihzalhsinaCazydbcetfcFFi87ebazclfhzascufgsmbxdkkaCcFeazz:rjjjb8AkaEJbbbZNh8JcuhIdnalci6mbcbhsJFFuuhEa8AhzcuhIinazcwfIdba8M:tghahNazIdbay:tghahNazclfIdba8N:tghahNMM:rghaEaIcuSahaE9DVgXEhEasaIaXEhIazcKfhzaLascefgs9hmbkkamczfcbcjwz:rjjjb8Aam9cb83iwam9cb83ibaxa8JNh8RJbbjZak:th8Lcbh8SJbbbbhRJbbbbh8UJbbbbh8VJbbbbh8WJbbbbh8XJbbbbh8Ycbh8ZcbhPinJbbbbhEdna8STmbJbbjZa8S:Z:vhEkJbbbbhhdna8Ya8YNa8Wa8WNa8Xa8XNMMg8KJbbbb9BmbJbbjZa8K:r:vhhka8VaENh8Ka8UaENh5aRaENh8EaIhLdndndndndna8SaPVTmbamydwg80Tmea8YahNh8Fa8XahNhaa8WahNhgaeamydbcdtfh81cbh3JFFuuhEcvhQcuhLindnaHa81a3cdtfydbcdtgzfydbgvTmbaAaOazfydbcdtfhsindndnaCaiasydbgKcx2fgzclfydbgrcetf8Vebcs4aCazydbgXcetf8Vebcs4faCazcwfydbglcetf8Vebcs4fgombcbhzxekcehzaHaXcdtfydbgXceSmbcehzaHarcdtfydbgrceSmbcehzaHalcdtfydbglceSmbdnarcdSaXcdSfalcdSfcd6mbaocefhzxekaocdfhzkdnazaQ9kmba8AaKcK2fgXIdwa8K:tghahNaXIdba8E:tghahNaXIdla5:tghahNMM:ra8J:va8LNJbbjZMJ9VO:d86JbbjZaXIdCa8FNaXIdxagNaaaXIdzNMMakN:tghahJ9VO:d869DENghaEazaQ6ahaE9DVgXEhEaKaLaXEhLazaQaXEhQkasclfhsavcufgvmbkka3cefg3a809hmbkkaLcu9hmekama8KUd:ODama5Ud:KDama8EUd:GDamcuBd:qDamcFFF;7rBdjDa8Pcba8AaYamc:GDfamc:qDfamcjDfz:ejjjbamyd:qDhLdndnaxJbbbb9ETmba8SaD6mbaLcuSmeceh3amIdjDa8R9EmixdkaLcu9hmekdna8STmbabaPcltfgHam8Piw83dwaHam8Pib83dbaPcefhPkc3hHinamc:CwfaHfydbcbyd;4:G:cjbH:bjjjbbaHc98fgHc989hmbxvkkcbh3a8Saq9pmbamydwaCaiaLcx2fgzydbcetf8Vebcs4aCazcwfydbcetf8Vebcs4faCazclfydbcetf8Vebcs4ffaw9nmekcbhzcbhsdna8ZTmbcbhsamczfhXinamczfascdtfaXydbgQBdbaXclfhXasaYaQfRbbTfhsa8Zcufg8ZmbkkamydwhlamydbhXam9cu83i:GDam9cu83i:ODam9cu83i:qDam9cu83i:yDinamcjDfazfcFFF;7rBdbazclfgzcz9hmbkasc;8easclfc:bd6Eg8Zcdth80dnalTmbaeaXcdtfhocbhrindnaHaoarcdtfydbcdtgzfydbgvTmbaAaOazfydbcdtfhscuhQcuhzinaHaiasydbgKcx2fgXclfydbcdtfydbaHaXydbcdtfydbfaHaXcwfydbcdtfydbfgXazaXaz6gXEhzaKaQaXEhQasclfhsavcufgvmbkaQcuSmba8AaQcK2fgsIdwa8M:tgEaENasIdbay:tgEaENasIdla8N:tgEaENMM:rhEcbhsindndnazamc:qDfasfgvydbgX6mbazaX9hmeaEamcjDfasfIdb9FTmekavazBdbamc:GDfasfaQBdbamcjDfasfaEUdbxdkasclfgscz9hmbkkarcefgral9hmbkkamczfa80fhQcbhzcbhsindnamc:GDfazfydbgXcuSmbaQascdtfaXBdbascefhskazclfgzcz9hmbkasa8Zfg8ZTmbJFFuuhhcuhKamczfhza8ZhvcuhQina8AazydbgXcK2fgsIdwa8M:tgEaENasIdbay:tgEaENasIdla8N:tgEaENMM:rhEdndnaHaiaXcx2fgsclfydbcdtfydbaHasydbcdtfydbfaHascwfydbcdtfydbfgsaQ6mbasaQ9hmeaEah9DTmekaEhhashQaXhKkazclfhzavcufgvmbkaKcuSmbaKhLkdnamaiaLcx2fgrydbarclfydbarcwfydbaCabaeadaPawaqa3z:fjjjbTmbaPcefhPJbbbbhRJbbbbh8UJbbbbh8VJbbbbh8WJbbbbh8XJbbbbh8YkcbhXinaAaOaraXcdtfydbcdtgsfydbcdtfgKhzaHasfgvydbgQhsdnaQTmbdninazydbaLSmeazclfhzascufgsTmdxbkkazaKaQcdtfc98fydbBdbavavydbcufBdbkaXcefgXci9hmbka8AaLcK2fgzIdbhEazIdlhhazIdwh8KazIdxh5azIdzh8EazIdCh8FaYaLfce86bba8Ya8FMh8Ya8Xa8EMh8Xa8Wa5Mh8Wa8Va8KMh8Va8UahMh8UaRaEMhRamydxh8Sxbkkamc:WDf8KjjjjbaPkjoivuv99lu8Jjjjjbca9Rgo8Kjjjjbdndnalcw0mbaiydbhraeabcitfgwalcdtciVBdlawarBdbdnalcd6mbaiclfhralcufhDawcxfhwinarydbhqawcuBdbawc98faqBdbawcwfhwarclfhraDcufgDmbkkalabfhwxekcbhqaocbBdKao9cb83izaocbBdwao9cb83ibJbbjZhkJbbjZhxinadaiaqcdtfydbcK2fhDcbhwinaoczfawfgraDawfIdbgmarIdbgP:tgsaxNaPMgPUdbaoawfgrasamaP:tNarIdbMUdbawclfgwcx9hmbkJbbjZakJbbjZMgk:vhxaqcefgqal9hmbkcbhradcbcecdaoIdlgmaoIdwgP9GEgwaoIdbgsaP9GEawasam9GEgzcdtgwfhHaoczfawfIdbhmaihwalhDinaiarcdtfgqydbhOaqawydbgABdbawaOBdbawclfhwaraHaAcK2fIdbam9DfhraDcufgDmbkdndnarcv6mbavc8X9kmbaralc98f6mekaiydbhraeabcitfgwalcdtciVBdlawarBdbaiclfhralcufhDawcxfhwinarydbhqawcuBdbawc98faqBdbawcwfhwarclfhraDcufgDmbkalabfhwxekaeabcitfgwamUdbawawydlc98GazVBdlabcefaeadaiaravcefgqz:djjjbhDawawydlciGaDabcu7fcdtVBdlaDaeadaiarcdtfalar9Raqz:djjjbhwkaocaf8Kjjjjbawk;Oddvue99dninabaecitfgrydlgwcd4gDTmednawciGgqci9hmbcihqdnawcl6mbabaecitfhbcbheawhqcehkindnaiabydbgDfRbbmbcbhkadaDcK2fgwIdwalIdw:tgxaxNawIdbalIdb:tgxaxNawIdlalIdl:tgxaxNMM:rgxaoIdb9DTmbaoaxUdbavaDBdbarydlhqkabcwfhbaecefgeaqcd46mbkakceGTmikaraqciGBdlskdnabcbaDalaqcdtfIdbarIdb:tgxJbbbb9FEgwaD7aecefgDfgecitfydlabawaDfgDcitfydlVci0mbaraqBdlkabaDadaialavaoz:ejjjbax:laoIdb9Fmbkkkjlevudndnabydwgxaladcetfgm8Vebcs4alaecetfgP8Vebgscs4falaicetfgz8Vebcs4ffaD0mbakmbcbhDabydxaq6mekavawcltfgxab8Pdw83dwaxab8Pdb83dbabydbhDdnabydwgwTmbaoaDcdtfhxawhsinalaxydbcetfcFFi87ebaxclfhxascufgsmbkkabaDawfBdbabydxhxab9cb83dwababydlaxci2fBdlaP8VebhscehDcbhxkdnascztcz91cu9kmbabaxcefBdwaPax87ebaoabydbcdtfaxcdtfaeBdbkdnam8Uebcu9kmbababydwgxcefBdwamax87ebaoabydbcdtfaxcdtfadBdbkdnaz8Uebcu9kmbababydwgxcefBdwazax87ebaoabydbcdtfaxcdtfaiBdbkarabydlfabydxci2faPRbb86bbarabydlfabydxci2fcefamRbb86bbarabydlfabydxci2fcdfazRbb86bbababydxcefBdxaDk:mPrHue99eue99eue99iu8Jjjjjbc;W;Gb9Rgx8KjjjjbdndnalmbcbhmxekcbhPaxc:m;Gbfcbc;Kbz:rjjjb8Aaxcualci9UgscltascjjjjiGEcbyd;0:G:cjbHjjjjbbgzBd:m9GaxceBd;S9GaxcuascK2gHcKfalcpFFFe0Ecbyd;0:G:cjbHjjjjbbgOBd:q9GaxcdBd;S9Gdnalci6gAmbarcd4hCascdthXaOhQazhLinavaiaPcx2fgrydwaC2cdtfhKavarydlaC2cdtfhYavarydbaC2cdtfh8AcbhraLhEinaQarfgma8Aarfg3Idbg5aYarfg8EIdbg8Fa5a8F9DEg5UdbamaKarfgaIdbg8Fa5a8Fa59DEg8FUdbamcxfgma3Idbg5a8EIdbgha5ah9EEg5UdbamaaIdbgha5aha59EEg5UdbaEa8Fa5MJbbbZNUdbaEaXfhEarclfgrcx9hmbkaQcKfhQaLclfhLaPcefgPas9hmbkkaOaHfgr9cb83dbar9cb83dzar9cb83dwaxcuascx2gralc:bjjjl0Ecbyd;0:G:cjbHjjjjbbgHBdN9GaxciBd;S9GascdthgazarfhvaxcwVhPaxclVhCaHh8Jazh8KcbhLinaxcbcj;Gbz:rjjjbhEaLas2cdthadnaAmba8Khrash3inaEarydbgmc8F91cjjjj94Vam7gmcQ4cx2fg8Ea8EydwcefBdwaEamcd4cFrGcx2fg8Ea8EydbcefBdbaEamcx4cFrGcx2fgmamydlcefBdlarclfhra3cufg3mbkkazaafh8AaHaafhXcbhmcbh3cbh8EcbhainaEamfgrydbhQara3BdbarcwfgKydbhYaKaaBdbarclfgrydbhKara8EBdbaQa3fh3aYaafhaaKa8Efh8Eamcxfgmcj;Gb9hmbkdnaAmbcbhravhminamarBdbamclfhmasarcefgr9hmbkavhrashminaEa8Aarydbg3cdtfydbg8Ec8F91a8E7cd4cFrGcx2fg8Ea8Eydbg8EcefBdbaXa8Ecdtfa3Bdbarclfhramcufgmmbka8JhrashminaCa8Aarydbg3cdtfydbg8Ec8F91a8E7cx4cFrGcx2fg8Ea8Eydbg8EcefBdbava8Ecdtfa3BdbarclfhramcufgmmbkavhrashminaPa8Aarydbg3cdtfydbg8Ec8F91cjjjj94Va8E7cQ4cx2fg8Ea8Eydbg8EcefBdbaXa8Ecdtfa3Bdbarclfhramcufgmmbkka8Jagfh8Ja8Kagfh8KaLcefgLci9hmbkaEaocetgrcuaocu9kEcbyd;0:G:cjbHjjjjbbgKBd:y9GaEclBd;S9Gdndnaoal9nmbaihralhminaKarydbcetfcFFi87ebarclfhramcufgmmbxdkkaKcFearz:rjjjb8Akcbh8EaEascbyd;0:G:cjbHjjjjbbg8ABd:C9GaOaHaHascdtfaHascitfa8AascbazaKaiawaDaqakz:hjjjbdndnalci6mba8Ahrashmina8EarRbbfh8EarcefhramcufgmmbkaE9cb83iwaE9cb83ibalawc9:fgrfcufar9UgrasaDfcufaD9Ugmaram0EhYcbhmcbhra8Ehaincbh3dnarTmba8AarfRbbceSh3kamaEaiaHydbcx2fgQydbaQclfydbaQcwfydbaKabaeadamawaqa3a3ce7a8EaY9nVaaamfaY6VGz:fjjjbfhmaHclfhHaaa8AarfRbb9Rhaasarcefgr9hmbkaEydxTmeabamcltfgraE8Piw83dwaraE8Pib83dbamcefhmxekaE9cb83iwaE9cb83ibcbhmkczhrinaEc:m;Gbfarfydbcbyd;4:G:cjbH:bjjjbbarc98fgrc989hmbkkaxc;W;Gbf8Kjjjjbamk:wKDQue99iue99iul9:euw99iu8Jjjjjbc;qb9RgP8Kjjjjbaxhsaxhzdndnavax0gHmbdnavTmbcbhOaehzavhAinawaDazydbcx2fgCcwfydbcetfgX8VebhQawaCclfydbcetfgL8VebhKawaCydbcetfgC8VebhYaXce87ebaLce87ebaCce87ebaOaKcs4aYcs4faQcs4ffhOazclfhzaAcufgAmbkaehzavhAinawaDazydbcx2fgCcwfydbcetfcFFi87ebawaCclfydbcetfcFFi87ebawaCydbcetfcFFi87ebazclfhzaAcufgAmbkcehzaqhsaOaq0mekalce86bbalcefcbavcufz:rjjjb8AxekaPaiBdxaPadBdwaPaeBdlavakaqci9Ug8Aaka8Aak6EaHEgK9RhEaxaK9Rh3aKcufh5aKceth8EaKcdtgCc98fh8FavcitgOaC9Rarfc98fhaascufhhavcufhgaraOfh8JJbbjZas:Y:vh8KcbazceakaxSEg8Lcdtg8M9Rh8NJFFuuhycuh8PcbhIcbh8RinaPclfa8RcdtfydbhQaPcb8Pd:y:G:cjbg8S83i9iaPcb8Pd:q:G:cjbgR83inaPcb8Pd1:G:cjbg8U83iUaPcb8Pdj:G:cjbg8V83i8WaPa8S83iyaPaR83iaaPa8U83iKaPa8V83izaQavcdtgYfh8WcbhXinabaQaXcdtgLfydbcK2fhAcbhzinaPc8WfazfgCaAazfgOIdbg8XaCIdbg8Ya8Xa8Y9DEUdbaCczfgCaOcxfIdbg8XaCIdbg8Ya8Xa8Y9EEUdbazclfgzcx9hmbkaba8WaXcu7cdtfydbcK2fhAcbhzaPIdUh8ZaPId9ih80aPId80h81aPId9ehBaPId8Wh83aPIdnhUinaPczfazfgCaAazfgOIdbg8XaCIdbg8Ya8Xa8Y9DEUdbaCczfgCaOcxfIdbg8XaCIdbg8Ya8Xa8Y9EEUdbazclfgzcx9hmbkaraLfgza80a8Z:tg8XaUa83:tg8YNa8YaBa81:tg8ZNa8Za8XNMMUdbazaYfaPIdyaPIdK:tg8XaPIdaaPIdz:tg8YNa8YaPId8KaPIdC:tg8ZNa8Za8XNMMUdbaXcefgXav9hmbkcbh85dnaHmbcbhAaQhza8JhCavhXinawaDazydbcx2fgOcwfydbcetfgL8Vebh8WawaOclfydbcetfg858Vebh86awaOydbcetfgO8Vebh87aLce87eba85ce87ebaOce87ebaCaAa86cs4a87cs4fa8Wcs4ffgABdbazclfhzaCclfhCaXcufgXmbkavhCinawaDaQydbcx2fgzcwfydbcetfcFFi87ebawazclfydbcetfcFFi87ebawazydbcetfcFFi87ebaQclfhQaCcufgCmbka8Jh85kdndndndndndndndndndndnava8E6mba8Eax9nmeavavaK9UgzaK29Raza320mda5aE9pmqa85Th87ceh8WaEhQxwka5ag9pmDa8Eax9nmixokavaK6mea5aE9pmwcehQaEhXa85Tmixlka5ag6mlxrka5ag9pmokcbhQaghXa85mekJFFuuh8XcbhLa5hzindnazcefgCaK6mbaQavaC9RgOaK6GmbarazcdtfIdbg8YaC:YNaravaz9RcdtfaYfc94fIdbg8ZaO:YNMg80a8X9Embdndna8KaOahf:YNg81:lJbbb9p9DTmba81:OhAxekcjjjj94hAka8ZasaA2aO9R:YNh8Zdndna8Kazasf:YNg81:lJbbb9p9DTmba81:OhOxekcjjjj94hOkamasaO2aC9R:Ya8YNa8ZMNa80Mg8Ya8Xa8Ya8X9DgOEh8XaCaLaOEhLkaza8LfgzaX6mbxlkkJFFuuh8XcbhLaEhCaahAa8FhOaKhzindnazaK6mbaQaCaK6GmbaraOfIdbg8Yaz:YNaAIdbg8ZaC:YNMg80a8X9Embdndna8Ka85aOfydbgYahf:YNg81:lJbbb9p9DTmba81:Oh8Wxekcjjjj94h8Wkamasa8W2aY9R:Yg81a8YNa8Za81NMNa80Mg8Ya8Xa8Ya8X9DgYEh8XazaLaYEhLkaCa8L9RhCaAa8NfhAaOa8MfhOaza8LfgzcufaX6mbxikka85Th87cbh8WaghQkJFFuuh8XcbhLaEhCaahAa8FhOaKhzindnazazaK9UgXaK29RaXa320mbdna8WTmbaCaCaK9UgXaK29RaXa320mekaraOfIdbg8Yaz:YNaAIdbg8ZaC:YNMg80a8X9EmbazhXaChYdna87mba85aOfydbgXhYkdndna8KaYahf:YNg81:lJbbb9p9DTmba81:Oh86xekcjjjj94h86ka8Zasa862aY9R:YNh8Zdndna8KaXahf:YNg81:lJbbb9p9DTmba81:OhYxekcjjjj94hYkamasaY2aX9R:Ya8YNa8ZMNa80Mg8Ya8Xa8Ya8X9DgXEh8XazaLaXEhLkaCa8L9RhCaAa8NfhAaOa8MfhOaza8LfgzcufaQ6mbkkaLTmba8Xay9DTmba8XhyaLhIa8Rh8Pka8Rcefg8Rci9hmbkdndnaoc8X9kmba8Pcb9omeka8Acufh85cbhYindndndnavaY9RaxaYaxfav0Eg8WTmbcbhAaeaYcdtfgzhCa8WhXinawaDaCydbcx2fgOcwfydbcetfgQ8VebhbawaOclfydbcetfgL8VebhrawaOydbcetfgO8VebhKaQce87ebaLce87ebaOce87ebaAarcs4aKcs4fabcs4ffhAaCclfhCaXcufgXmbka8WhOinawaDazydbcx2fgCcwfydbcetfcFFi87ebawaCclfydbcetfcFFi87ebawaCydbcetfcFFi87ebazclfhzaOcufgOmbkaAaq0mekalaYfgzce86bbazcefcba8Wcufz:rjjjb8AxekalaYfgzce86bbazcefcba85z:rjjjb8Aa8Ah8Wka8WaYfgYav9pmdxbkkaravcdtg8WfhLdnaITmbaPclfa8PcdtfydbhzaIhCinaLazydbfcb86bbazclfhzaCcufgCmbkkdnavaI9nmbaPclfa8PcdtfydbaIcdtfhzavaI9RhCinaLazydbfce86bbazclfhzaCcufgCmbkkcbhYindnaYa8PSmbcbhzaraPclfaYcdtfydbgKa8Wz:qjjjbhCavhXaIhOinaKaOazaLaCydbgQfRbbgAEcdtfaQBdbaCclfhCaOaAfhOazaA9RcefhzaXcufgXmbkkaYcefgYci9hmbkabaeadaialaIaocefgCarawaDaqakaxamz:hjjjbabaeaIcdtgzfadazfaiazfalaIfavaI9RaCarawaDaqakaxamz:hjjjbkaPc;qbf8Kjjjjbk:Seeru8Jjjjjbc:q;ab9Rgo8Kjjjjbaoc:q8WfcFecjzz:rjjjb8AcbhrdnadTmbaehwadhDinaoarcdtfawydbgqBdbaoc:q8WfaqcFiGcdtfgkydbhxakaqBdbawclfhwaraxaq9hfhraDcufgDmbkkabaeadaoaraiavz:jjjjbaoc:q;abf8Kjjjjbk;Sqloud99euD998Jjjjjbc:W;ab9Rgr8KjjjjbdndnadTmbaocd4hwcbhDcbhqindnavaeclfydbaw2cdtfgkIdbavaeydbaw2cdtfgxIdbgm:tgPavaecwfydbaw2cdtfgsIdlaxIdlgz:tgHNakIdlaz:tgOasIdbam:tgAN:tgCaCNaOasIdwaxIdwgX:tgQNakIdwaX:tgOaHN:tgHaHNaOaANaPaQN:tgPaPNMMgOJbbbb9Bmbarc8WfaDcltfgkaCaO:rgO:vgCUdwakaPaO:vgPUdlakaHaO:vgHUdbakaCaXNaHamNazaPNMM:mUdxaDcefhDkaecxfheaqcifgqad6mbkab9cb83dyab9cb83daab9cb83dKab9cb83dzab9cb83dwab9cb83dbaDTmearcbBd8Sar9cb83iKar9cb83izarczfavalaoarc8Sfcbcraiz:kjjjbarIdKhQarIdChLarIdzhKar9cb83iwar9cb83ibararc8WfaDczarc8Sfcbcicbz:kjjjbJbbbbhmdnarIdwgzazNarIdbgHaHNarIdlgXaXNMMgCJbbbb9BmbJbbjZaC:r:vhmkazamNhCaXamNhXaHamNhHJbbjZhmarc8WfheaDhvinaecwfIdbaCNaeIdbaHNaXaeclfIdbNMMgzamazam9DEhmaeczfheavcufgvmbkabaQUdwabaLUdlabaKUdbabarId3UdxdndnamJ;n;m;m899FmbJbbbbhzarc8WfheinaecxfIdbaQaecwfIdbgPNaKaeIdbgONaLaeclfIdbgANMMMaCaPNaHaONaXaANMM:vgPazaPaz9EEhzaeczfheaDcufgDmbkabaCUd8KabaXUdaabaHUd3abaQaCazN:tUdKabaLaXazN:tUdCabaKaHazN:tUdzabJbbjZamamN:t:rgmUdydndnaCJbbj:;aCJbbj:;9GEgzJbbjZazJbbjZ9FEJbb;:9cNJbbbZJbbb:;aCJbbbb9GEMgz:lJbbb9p9DTmbaz:Ohexekcjjjj94hekabae86b8UdndnaXJbbj:;aXJbbj:;9GEgzJbbjZazJbbjZ9FEJbb;:9cNJbbbZJbbb:;aXJbbbb9GEMgz:lJbbb9p9DTmbaz:Ohvxekcjjjj94hvkabav86bRdndnaHJbbj:;aHJbbj:;9GEgzJbbjZazJbbjZ9FEJbb;:9cNJbbbZJbbb:;aHJbbbb9GEMgz:lJbbb9p9DTmbaz:Ohwxekcjjjj94hwkabaw86b8SdndnaecKtcK91:YJbb;:9c:vaC:t:lavcKtcK91:YJbb;:9c:vaX:t:lawcKtcK91:YJbb;:9c:vaH:t:lamMMMJbb;:9cNJbbjZMgm:lJbbb9p9DTmbam:Ohexekcjjjj94hekaecFbaecFb9iEhexekabcjjj;8iBdycFbhekabae86b8Vxekab9cb83dyab9cb83daab9cb83dKab9cb83dzab9cb83dwab9cb83dbkarc:W;abf8Kjjjjbk;7woDuo99eue99euv998Jjjjjbcje9Rgw8Kjjjjbawc;abfcbaocdtgDz:rjjjb8Aawc;GbfcbaDz:rjjjb8AawcafhDawhqaohkinaqcFFF97BdbaDcFFF;7rBdbaqclfhqaDclfhDakcufgkmbkavcd4hxaicd4hmdnadTmbaocx2hPcbhsinashzdnarTmbarascdtfydbhzkaeazam2cdtfgDIdwhHaDIdlhOaDIdbhAalazax2cdtfIdbhCcbhDawcafhqawc;Gbfhvawhkawc;abfhiinaCaDc:O:G:cjbfIdbaHNaDc:G:G:cjbfIdbaANaDc:K:G:cjbfIdbaONMMgXMhQazhLdnaXaC:tgXaqIdbgK9DgYmbavydbhLkavaLBdbazhLdnaQakIdbg8A9EmbaiydbhLa8AhQkaiaLBdbakaQUdbaqaXaKaYEUdbaiclfhiakclfhkavclfhvaqclfhqaPaDcxfgD9hmbkascefgsad9hmbkkJbbbbhQcbhLawc;GbfhDawc;abfhqcbhkinalaqydbgvax2cdtfIdbalaDydbgiax2cdtfIdbaeavam2cdtfgvIdwaeaiam2cdtfgiIdw:tgCaCNavIdbaiIdb:tgCaCNavIdlaiIdl:tgCaCNMM:rMMgCaQaCaQ9EgvEhQakaLavEhLaqclfhqaDclfhDaoakcefgk9hmbkJbbbbhCdnaeawc;abfaLcdtgqfydbgkam2cdtfgDIdwaeawc;Gbfaqfydbgvam2cdtfgqIdwgH:tgXaXNaDIdbaqIdbgA:tg8Aa8ANaDIdlaqIdlgE:tgOaONMMgKJbbbb9ETmbaK:rgCalakax2cdtfIdbMalavax2cdtfIdb:taCaCM:vhCkaQJbbbZNhKaXaCNaHMhHaOaCNaEMhOa8AaCNaAMhAdnadTmbcbhqarhkinaqhDdnarTmbakydbhDkdnalaDax2cdtfIdbg3aeaDam2cdtfgDIdwaH:tgQaQNaDIdbaA:tgCaCNaDIdlaO:tgXaXNMMg5:rgEMg8EaK9ETmbJbbbbh8Adna5Jbbbb9ETmba8EaK:taEaEM:vh8Aka8AaQNaHMhHa8AaXNaOMhOa8AaCNaAMhAa3aKaEMMJbbbZNhKkakclfhkadaqcefgq9hmbkkabaKUdxabaHUdwabaOUdlabaAUdbawcjef8Kjjjjbk:reevu8Jjjjjbcj8W9Rgr8Kjjjjbaici2hwcbhDdnaiTmbarhiawhqinaiaeadRbbgkcdtfydbBdbaDakcefgkaDak0EhDaiclfhiadcefhdaqcufgqmbkkabarawaeaDalaoz:jjjjbarcj8Wf8Kjjjjbk:Eeeeu8Jjjjjbca9Rgo8Kjjjjbab9cb83dyab9cb83daab9cb83dKab9cb83dzab9cb83dwab9cb83dbdnadTmbaocbBd3ao9cb83iwao9cb83ibaoaeadaialaoc3falEavcbalEcrcbz:kjjjbabao8Pib83dbabao8Piw83dwkaocaf8Kjjjjbk::meQu8Jjjjjbcjz9Rgv8KjjjjbcbhoavcjPfcbaez:rjjjb8Aavcjxfcbaez:rjjjb8AdnaiTmbadhoaihrinavcjxfaoRbbfgwawRbbcef86bbavcjxfaocefRbbfgwawRbbcef86bbavcjxfaocdfRbbfgwawRbbcef86bbaocifhoarcufgrmbkcbhDcjehoadhqcehkindndnalTmbcbhxcuhmaqhrakhwcuhPinawcufamaoavcjPfarcefRbbgsfRbb9RcFeGgzci6aoavcjPfarRbbgHfRbb9RcFeGgOci6faoavcjPfarcdfRbbgAfRbb9RcFeGgCci6fgXcOtaOcFr7azaCf9RcwtVavcjxfaAfRbbgzavcjxfaHfRbbgHavcjxfasfRbbgsaHas6Egsazas6EcFe7VgsaP9kgzEhmaXcd6gHaxcefgOal9iVce9hmdasaPazEhPaxaOaHEhxarcifhrawai6hsawcefhwasmbxdkkcuhmaqhrakhwcuhxinawcufamaoavcjPfarcefRbbfRbb9RcFeGci6aoavcjPfarRbbfRbb9RcFeGci6faoavcjPfarcdfRbbfRbb9RcFeGci6fgPax9kgsEhmaPce0meaPaxasEhxarcifhrawai6hPawcefhwaPmbkkadamci2fgrcdfRbbhwarcefRbbhxarRbbhPadaDci2fgrcifaramaD9Rci2zNjjjb8AaPavcjPffaocefgo86bbaPavcjxffgmamRbbcuf86bbaxavcjPffao86bbaxavcjxffgmamRbbcuf86bbarcdfaw86bbarcefax86bbaraP86bbawavcjPffao86bbawavcjxffgrarRbbcuf86bbaqcifhqakcefhkaDcefgDai9hmbkcbhzdnalcb9mmbcbhsavcjPfcbaez:rjjjb8Aadcvfhlinadasci2fgxcefgDRbbhoaxcdfgqRbbhrdndnavcjPfaxRbbgmfRbbmbavcjPfarfRbbhwdndndnavcjPfaofRbbTmbawcFeGTmexikawcFeGmdascefgAai9pmdasc980mdascifhQcbhLarcFeGhCamcFeGhXalhwcbhKcbhYinawcufRbbhPawRbbhOcehkdndnawc9:fRbbgHao9hmbaPcFeGamSmekdnaPcFeGao9hmbaOcFeGamSmekaHamSaOcFeGaoSGhkkceh8AaYceGhYdndnaHar9hmbaPcFeGaoSmekdnaPcFeGar9hmbaOcFeGaoSmekaHaoSaOcFeGarSGh8AkakaYVhYaLaHcFeGgHaXSaPcFeGgPaCSGaPaXSaOcFeGgPaCSGVaHaCSaPaXSGVVhLa8AaKceGVhKdnaAcefgPai9pmbawcifhwaAaQ6hHaPhAaHmekkaYTmeaKmekarhwaohPaohHarhOamhrxdkdnaYTaLVceGTmbaYaKTVaLVceGmekamhwarhParhHamhOaohrxekaohwamhPamhHaohOkavcjPfarfce86bbavcjPfawfce86bbaxaH86bbaqar86bbaDaO86bbavcjPfaPfce86bbalcifhlascefgsai9hmbkkavcFeaecetz:rjjjbhwaici2hrindnawadRbbgmcetfgx8Uebgocu9kmbaxaz87ebawcjlfazcdtfabamcdtfydbBdbazhoazcefhzkadao86bbadcefhdarcufgrmbkazcdthokabavcjlfaoz:qjjjb8Aavcjzf8KjjjjbkObabaiaeadcbz:njjjbk9teiucbcbyd;8:G:cjbgeabcifc98GfgbBd;8:G:cjbdndnabZbcztgd9nmbcuhiabad9RcFFifcz4nbcuSmekaehikaik;LeeeudndnaeabVciGTmbabhixekdndnadcz9pmbabhixekabhiinaiaeydbBdbaiclfaeclfydbBdbaicwfaecwfydbBdbaicxfaecxfydbBdbaeczfheaiczfhiadc9Wfgdcs0mbkkadcl6mbinaiaeydbBdbaeclfheaiclfhiadc98fgdci0mbkkdnadTmbinaiaeRbb86bbaicefhiaecefheadcufgdmbkkabk;aeedudndnabciGTmbabhixekaecFeGc:b:c:ew2hldndnadcz9pmbabhixekabhiinaialBdbaicxfalBdbaicwfalBdbaiclfalBdbaiczfhiadc9Wfgdcs0mbkkadcl6mbinaialBdbaiclfhiadc98fgdci0mbkkdnadTmbinaiae86bbaicefhiadcufgdmbkkabk9teiucbcbyd;8:G:cjbgeabcrfc94GfgbBd;8:G:cjbdndnabZbcztgd9nmbcuhiabad9RcFFifcz4nbcuSmekaehikaikTeeucbabcbyd;8:G:cjbge9Rcifc98GaefgbBd;8:G:cjbdnabZbcztge9nmbabae9RcFFifcz4nb8Akk:3qeludndnadch6mbadTmeabaead;8qbbabskabaeSmbdnaeadabfgi9Rcbadcet9R0mbadTmeabaead;8qbbabskaeab7ciGhldndndnabae9pmbdnalTmbadhvabhixikdnabciGmbadhvabhixdkadTmiabaeRbb86bbadcufhvdnabcefgiciGmbaecefhexdkavTmiabaeRbe86beadc9:fhvdnabcdfgiciGmbaecdfhexdkavTmiabaeRbd86bdadc99fhvdnabcifgiciGmbaecifhexdkavTmiabaeRbi86biabclfhiaeclfheadc98fhvxekdnalmbdnaiciGTmbadTmlabadcufgifglaeaifRbb86bbdnalciGmbaihdxekaiTmlabadc9:fgifglaeaifRbb86bbdnalciGmbaihdxekaiTmlabadc99fgifglaeaifRbb86bbdnalciGmbaihdxekaiTmlabadc98fgdfaeadfRbb86bbkadcl6mbdnadc98fgocxGcxSmbaocd4cefciGhiaec98fhlabc98fhvinavadfaladfydbBdbadc98fhdaicufgimbkkaocx6mbaec9Wfhvabc9WfhoinaoadfgicxfavadfglcxfydbBdbaicwfalcwfydbBdbaiclfalclfydbBdbaialydbBdbadc9Wfgdci0mbkkadTmdadhidnadciGglTmbaecufhvabcufhoadhiinaoaifavaifRbb86bbaicufhialcufglmbkkadcl6mdaec98fhlabc98fhvinavaifgecifalaifgdcifRbb86bbaecdfadcdfRbb86bbaecefadcefRbb86bbaeadRbb86bbaic98fgimbxikkavcl6mbdnavc98fglc3Gc3Smbavalcd4cefcrGgdcdt9RhvinaiaeydbBdbaeclfheaiclfhiadcufgdmbkkalc36mbinaiaeydbBdbaiclfaeclfydbBdbaicwfaecwfydbBdbaicxfaecxfydbBdbaiczfaeczfydbBdbaicCfaecCfydbBdbaicKfaecKfydbBdbaic3faec3fydbBdbaecafheaicafhiavc9Gfgvci0mbkkavTmbdndnavcrGgdmbavhlxekavc94GhlinaiaeRbb86bbaicefhiaecefheadcufgdmbkkavcw6mbinaiaeRbb86bbaicefaecefRbb86bbaicdfaecdfRbb86bbaicifaecifRbb86bbaiclfaeclfRbb86bbaicvfaecvfRbb86bbaicofaecofRbb86bbaicrfaecrfRbb86bbaicwfhiaecwfhealc94fglmbkkabkk:pedbcj:GdktFFuuFFuuFFuubbbbFFuFFFuFFFuFbbbbbbjZbbbbbbbbbbbbbbjZbbbbbbbbbbbbbbjZ86;nAZ86;nAZ86;nAZ86;nA:;86;nAZ86;nAZ86;nAZ86;nA:;86;nAZ86;nAZ86;nAZ86;nA:;bc;0:Gdkxebbbdbbbj:qbb",t=new Uint8Array([32,0,65,2,1,106,34,33,3,128,11,4,13,64,6,253,10,7,15,116,127,5,8,12,40,16,19,54,20,9,27,255,113,17,42,67,24,23,146,148,18,14,22,45,70,69,56,114,101,21,25,63,75,136,108,28,118,29,73,115]);if(typeof WebAssembly!="object")return{supported:!1};var n,i=WebAssembly.instantiate(r(e),{}).then(function(y){n=y.instance,n.exports.__wasm_call_ctors()});function r(y){for(var A=new Uint8Array(y.length),b=0;b<y.length;++b){var x=y.charCodeAt(b);A[b]=x>96?x-97:x>64?x-39:x+4}for(var T=0,b=0;b<y.length;++b)A[T++]=A[b]<60?t[A[b]]:(A[b]-60)*64+A[++b];return A.buffer.slice(0,T)}function o(y){if(!y)throw new Error("Assertion failed")}function s(y){return new Uint8Array(y.buffer,y.byteOffset,y.byteLength)}var a=48,c=16;function u(y,A){var b=y.meshlets[A*4+0],x=y.meshlets[A*4+1],T=y.meshlets[A*4+2],E=y.meshlets[A*4+3];return{vertices:y.vertices.subarray(b,b+T),triangles:y.triangles.subarray(x,x+E*3)}}function f(y,A,b,x,T,E,v,S,I,R){var O=n.exports.sbrk,L=n.exports.meshopt_buildMeshletsBound(A.length,E,v),_=O(L*c),C=O(A.length*4),w=O(A.length),D=O(A.byteLength),N=O(b.byteLength),F=new Uint8Array(n.exports.memory.buffer);F.set(s(A),D),F.set(s(b),N);var V=y(_,C,w,D,A.length,N,x,T,E,v,S,I,R);F=new Uint8Array(n.exports.memory.buffer);for(var B=F.subarray(_,_+V*c),j=new Uint32Array(B.buffer,B.byteOffset,B.byteLength/4).slice(),k=0;k<V;++k){var G=j[k*4+0],q=j[k*4+1],x=j[k*4+2],Q=j[k*4+3];n.exports.meshopt_optimizeMeshlet(C+G*4,w+q,Q,x)}var W=V?j[(V-1)*4+0]+j[(V-1)*4+2]:0,J=V?j[(V-1)*4+1]+j[(V-1)*4+3]*3:0,Z={meshlets:j,vertices:new Uint32Array(F.buffer,C,W).slice(),triangles:new Uint8Array(F.buffer,w,J).slice(),meshletCount:V};return O(_-O(0)),Z}function d(y){var A=new Float32Array(n.exports.memory.buffer,y,a/4);return{centerX:A[0],centerY:A[1],centerZ:A[2],radius:A[3],coneApexX:A[4],coneApexY:A[5],coneApexZ:A[6],coneAxisX:A[7],coneAxisY:A[8],coneAxisZ:A[9],coneCutoff:A[10]}}function p(y,A,b,x){var T=n.exports.sbrk,E=[],v=T(A.byteLength),S=T(y.vertices.byteLength),I=T(y.triangles.byteLength),R=T(a),O=new Uint8Array(n.exports.memory.buffer);O.set(s(A),v),O.set(s(y.vertices),S),O.set(s(y.triangles),I);for(var L=0;L<y.meshletCount;++L){var _=y.meshlets[L*4+0],C=y.meshlets[L*4+1],w=y.meshlets[L*4+3];n.exports.meshopt_computeMeshletBounds(R,S+_*4,I+C,w,v,b,x),E.push(d(R))}return T(v-T(0)),E}function g(y,A,b,x){var T=n.exports.sbrk,E=T(a),v=T(y.byteLength),S=T(A.byteLength),I=new Uint8Array(n.exports.memory.buffer);I.set(s(y),v),I.set(s(A),S),n.exports.meshopt_computeClusterBounds(E,v,y.length,S,b,x);var R=d(E);return T(E-T(0)),R}function m(y,A,b,x,T){var E=n.exports.sbrk,v=E(a),S=E(y.byteLength),I=x?E(x.byteLength):0,R=new Uint8Array(n.exports.memory.buffer);R.set(s(y),S),x&&R.set(s(x),I),n.exports.meshopt_computeSphereBounds(v,S,A,b,I,x?T:0);var O=d(v);return E(v-E(0)),O}return{ready:i,supported:!0,buildMeshlets:function(y,A,b,x,T,E){o(y.length%3==0),o(A instanceof Float32Array),o(A.length%b==0),o(b>=3),o(x>=3&&x<=256),o(T>=1&&T<=512),E=E||0;var v=y.BYTES_PER_ELEMENT==4?y:new Uint32Array(y);return f(n.exports.meshopt_buildMeshletsFlex,v,A,A.length/b,b*4,x,T,T,E,0)},buildMeshletsFlex:function(y,A,b,x,T,E,v,S){o(y.length%3==0),o(A instanceof Float32Array),o(A.length%b==0),o(b>=3),o(x>=3&&x<=256),o(T>=1&&E<=512),o(T<=E),v=v||0,S=S||0;var I=y.BYTES_PER_ELEMENT==4?y:new Uint32Array(y);return f(n.exports.meshopt_buildMeshletsFlex,I,A,A.length/b,b*4,x,T,E,v,S)},buildMeshletsSpatial:function(y,A,b,x,T,E,v){o(y.length%3==0),o(A instanceof Float32Array),o(A.length%b==0),o(b>=3),o(x>=3&&x<=256),o(T>=1&&E<=512),o(T<=E),v=v||0;var S=y.BYTES_PER_ELEMENT==4?y:new Uint32Array(y);return f(n.exports.meshopt_buildMeshletsSpatial,S,A,A.length/b,b*4,x,T,E,v)},extractMeshlet:function(y,A){return o(A>=0&&A<y.meshletCount),u(y,A)},computeClusterBounds:function(y,A,b){o(y.length%3==0),o(y.length/3<=512),o(A instanceof Float32Array),o(A.length%b==0),o(b>=3);var x=y.BYTES_PER_ELEMENT==4?y:new Uint32Array(y);return g(x,A,A.length/b,b*4)},computeMeshletBounds:function(y,A,b){return o(A instanceof Float32Array),o(A.length%b==0),o(b>=3),p(y,A,A.length/b,b*4)},computeSphereBounds:function(y,A,b,x){return o(y instanceof Float32Array),o(y.length%A==0),o(A>=3),o(!b||b instanceof Float32Array),o(!b||b.length%x==0),o(!b||x>=1),o(!b||y.length/A==b.length/x),x=x||0,m(y,y.length/A,A*4,b,x*4)}}})();var S4n=(function(){var e="b9H79Tebbbegv9Geueu9Geub9Gbb9Gkuuuuuuuuuuub9Giuuueuirodiblbelve9Weiiviebeoweuecj:Gdkrnlo9TW9T9VV95dbH9F9F939H79T9F9J9H229F9Jt9VV7bbK9TW79O9V9Wt9F9NW9UWV9HtW9u9H9U9NW9Ut7bel79IV9RbdDwebcekdlvq;m8Lodbk:wgvOuw99iuv99vu8Jjjjjbc;Wb9Rgk8Kjjjjbakcxfcbc;Kbz:djjjb8AakcualcdtgxalcFFFFi0Ecbyd:q:G:cjbHjjjjbbgmBdxakceBd2adci9UhPalcd4alfhscehzinazgHcethzaHas6mbkakcuaHcdtgzaHcFFFFi0Ecbyd:q:G:cjbHjjjjbbgsBdzakcdBd2ascFeazz:djjjbhOaDcd4hAarcd4hCavcd4hXdnalTmbaHcufhrcbhvindndnaOcbaiavaX2cdtfgHydlgDaDcjjjj94SEgscH4cbaoavaC2cdtfgzydlgQcs4aQcjjjj94SE7as7c:F:b:DD2cbaHydbgLaLcjjjj94SEgscH4cbazydbgKcs4aKcjjjj94SE7as7c;D;O:B8J27cbaHydwgYaYcjjjj94SEgHcH4cbazydwg8Acs4a8Acjjjj94SE7aH7c:3F;N8N27awavaA2cdtfgHydlgEaHydbg37cFFFFrGgHcm4aH7c:fjjK27arGgscdtfgHydbgzcuSmbaE::h5a3::h8Ea8A::h8FaQ::haaK::hhaY::hgaD::h8JaL::h8KcehDinaDhHdnaiazaX2cdtfgDIdba8K9CmbaDIdla8J9CmbaDIdwag9CmbaoazaC2cdtfgDIdbah9CmbaDIdlaa9CmbaDIdwa8F9CmbawazaA2cdtfgDIdba8E9CmbaDIdla59BmikaHcefhDaOasaHfarGgscdtfgHydbgzcu9hmbkkaHavBdbavhzkamavcdtfazBdbavcefgval9hmbkkaOcbydN:G:cjbH:bjjjbbakceBd2akcualcefgHcdtaHcFFFFi0Ecbyd:q:G:cjbHjjjjbbg8LBdzakcdBd2akcuadcdtadcFFFFi0EgYcbyd:q:G:cjbHjjjjbbg8MBdCakciBd2a8Lclfcbaxz:djjjbhzdnadTmbdnaeTmbaehHadhsinazamaHydbcdtfydbcdtfgDaDydbcefBdbaHclfhHascufgsmbxdkkamhHadhsinazaHydbcdtfgDaDydbcefBdbaHclfhHascufgsmbkkdnalTmbcbhsazhHalhDinaHydbhOaHasBdbaHclfhHaOasfhsaDcufgDmbkkdnadci6gQmbcbhscdhHaPhOindndnaeTmbamaeasfgvydbcdtfhDamavcwfydbcdtfhramavclfydbcdtfhvxekamasfgDcwfhraDclfhvkarydbhravydbhvazaDydbcdtfgDaDydbgDcefBdba8MaDcdtfaHc9:fBdbazavcdtfgDaDydbgDcefBdba8MaDcdtfaHcufBdbazarcdtfgDaDydbgDcefBdba8MaDcdtfaHBdbascxfhsaHclfhHaOcufgOmbkkcbhsa8LcbBdbakcuaPcltadcFFFFd0Ecbyd:q:G:cjbHjjjjbbg8NBdKakclBd2dnaQmbaehza8NhHaPhvindndnaeTmbazcwfydbhDazclfydbhOazydbhrxekascdfhDascefhOashrkJbbbbh8KJbbbbJbbbbJbbbbJbbbbJbbjZJbbj:;awaOaA2cdtfgQIdbawaraA2cdtfgLIdbgh:tawaDaA2cdtfgKIdlaLIdlgg:tg8JNaQIdlag:tggaKIdbah:tN:tghJbbbb9EEahJbbbb9BEg8EaiaraX2cdtfgrIdwghaiaOaX2cdtfgOIdwg59BEa8EarIdlgaaOIdlgy9BEa8EarIdbg8FaOIdbg8P9BEg8EahaiaDaX2cdtfgDIdwgI9BEa8EaaaDIdlg8R9BEa8Ea8FaDIdbg8S9BEg8Ea5aI9BEa8Eaya8R9BEa8Ea8Pa8S9BEh8Edna8Ja5ah:tNagaIah:tN:tghahNa8Ja8Pa8F:tNaga8Sa8F:tN:tg8Fa8FNa8Jayaa:tNaga8Raa:tN:tg8Ja8JNMMggJbbbb9Bmba8Eag:r:vh8KkaHcxfa8EUdbaHcwfaha8KNUdbaHclfa8Ja8KNUdbaHa8Fa8KNUdbazcxfhzaHczfhHascifhsavcufgvmbkkcbhHakaYcbyd:q:G:cjbHjjjjbbgDBd3akcvBd2dnadTmbaDhzinazaHBdbazclfhzadaHcefgH9hmbkkakcuaPcdtadcFFFF970Ecbyd:q:G:cjbHjjjjbbgvBdaakcoBd2akaPcbyd:q:G:cjbHjjjjbbg8ABd8KakcrBd2dnadci6mba8NcxfhzavhscbhHinasaHBdba8AaHfcdcbazIdbg8KJbbbb9DEa8KJbbbb9EV86bbasclfhsazczfhzaPaHcefgH9hmbkkdnalTmbcbhRinaRcdthHdna8LaRcefgRcdtfydbgza8LaHfydbgHSmbazaH9RhLa8MaHcdtfhKcbh8UinaKa8Ucdtfg8VydbgHcd4g8Wci2gxaHciGcdtgzyd:e:G:cjbfhHaxazydj:G:cjbfhzdnaeTmbaeaHcdtfydbhHaeazcdtfydbhzkdna8Ucefg8UaL9pmbamaHcdtfydbhYamazcdtfydbh3a8Aa8WfhEava8Wcdtfh8Xa8UhwinaKawcdtfgQydbgHcd4gzci2gAaHciGcdtgHyd:e:G:cjbfhsaAaHydj:G:cjbfhHdnaeTmbaeascdtfydbhsaeaHcdtfydbhHkdndnamaHcdtfydbaYSmbamascdtfydba39hmeka8AazfRbbgHaERbbgsVciSmbdnaHasGmba8Whsdna8Wa8XydbgHSmba8XhOinaOavaHgscdtfgrydbgHBdbarhOasaH9hmbkkdnazavazcdtfgOydbgHSmbinaOavaHgzcdtfgrydbgHBdbarhOazaH9hmbkkasazSmba8AazfgORbba8AasfgHRbbVciSmeavazcdtfasBdbaHaHRbbaORbbV86bbkdna8VydbciGaxfgzaDazcdtfgsydbgHSmbinasaDaHgzcdtfgOydbgHBdbaOhsazaH9hmbkkdnaQydbciGaAfgsaDascdtfgOydbgHSmbinaOaDaHgscdtfgrydbgHBdbarhOasaH9hmbkkazasSmbaDascdtfazBdbkawcefgwaL9hmbkka8UaL9hmbkkaRal9hmbkkdnadTmbcbhrinarhzdnaraDarcdtfgwydbgHSmbawhsinasaDaHgzcdtfgOydbgHBdbaOhsazaH9hmbkkawazBdbarcefgrad9hmbkcbh8Vabcbadcltz:djjjbhKdnadci6mbaqceGhEaDhYaeh3cbh8Windna8Na8WcltfgsIdxJbbbb9Bmbama8Wcx2gHfhxaeaHfhLcbhza8VhwinaKaYazfydbcltfhHdndnaeTmbamaLazc:e:G:cjbfydbcdtfydbcdtfhAamaLazcj:G:cjbfydbcdtfydbcdtfhra3azfydbhOx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HaKhzindnaHaDydbgsSmbazaKascltfgsydwBdwazas8Pdb83dbkaDclfhDazczfhzadaHcefgH9hmbkkdnakyd2gzTmbazcdtakcxffc98fhHinaHydbcbydN:G:cjbH:bjjjbbaHc98fhHazcufgzmbkkakc;Wbf8Kjjjjbk9teiucbcbyd:y:G:cjbgeabcifc98GfgbBd:y:G:cjbdndnabZbcztgd9nmbcuhiabad9RcFFifcz4nbcuSmekaehikaik;aeedudndnabciGTmbabhixekaecFeGc:b:c:ew2hldndnadcz9pmbabhixekabhiinaialBdbaicxfalBdbaicwfalBdbaiclfalBdbaiczfhiadc9Wfgdcs0mbkkadcl6mbinaialBdbaiclfhiadc98fgdci0mbkkdnadTmbinaiae86bbaicefhiadcufgdmbkkabk9teiucbcbyd:y:G:cjbgeabcrfc94GfgbBd:y:G:cjbdndnabZbcztgd9nmbcuhiabad9RcFFifcz4nbcuSmekaehikaikTeeucbabcbyd:y:G:cjbge9Rcifc98GaefgbBd:y:G:cjbdnabZbcztge9nmbabae9RcFFifcz4nb8Akkk8Rdbcj:Gdkzebbbdbbbbbbbebbbbc:q:Gdkxebbbdbbba:qbb",t=new Uint8Array([32,0,65,2,1,106,34,33,3,128,11,4,13,64,6,253,10,7,15,116,127,5,8,12,40,16,19,54,20,9,27,255,113,17,42,67,24,23,146,148,18,14,22,45,70,69,56,114,101,21,25,63,75,136,108,28,118,29,73,115]);if(typeof WebAssembly!="object")return{supported:!1};var n,i=WebAssembly.instantiate(r(e),{}).then(function(u){n=u.instance,n.exports.__wasm_call_ctors()});function r(u){for(var f=new Uint8Array(u.length),d=0;d<u.length;++d){var p=u.charCodeAt(d);f[d]=p>96?p-97:p>64?p-39:p+4}for(var g=0,d=0;d<u.length;++d)f[g++]=f[d]<60?t[f[d]]:(f[d]-60)*64+f[++d];return f.buffer.slice(0,g)}function o(u){if(!u)throw new Error("Assertion failed")}function s(u){return new Uint8Array(u.buffer,u.byteOffset,u.byteLength)}function a(u,f,d,p,g,m,y,A,b,x){var T=n.exports.sbrk,E=T(f*16),v=u?T(u.byteLength):0,S=T(d.byteLength),I=T(m.byteLength),R=T(A.byteLength),O=new Uint8Array(n.exports.memory.buffer);u&&O.set(s(u),v),O.set(s(d),S),O.set(s(m),I),O.set(s(A),R),n.exports.meshopt_generateTangents(E,v,f,S,p,g*4,I,y*4,R,b*4,x),O=new Uint8Array(n.exports.memory.buffer);var L=new Float32Array(O.buffer,E,f*4).slice();return T(E-T(0)),L}var c={Compatible:1,ZeroFallback:2};return{ready:i,supported:!0,generateTangents:function(u,f,d,p,g,m,y,A){o(u===null||u instanceof Uint32Array||u instanceof Int32Array||u instanceof Uint16Array||u instanceof Int16Array),o(u===null||u.length%3==0),o(f instanceof Float32Array),o(f.length%d==0),o(d>=3),o(p instanceof Float32Array),o(p.length%g==0),o(g>=3),o(m instanceof Float32Array),o(m.length%y==0),o(y>=2),o(f.length/d==p.length/g),o(f.length/d==m.length/y),o(u!==null||f.length/d%3==0);for(var b=0,x=0;x<(A?A.length:0);++x)o(A[x]in c),b|=c[A[x]];var T=f.length/d,E=u?u.length:T,v=u===null||u.BYTES_PER_ELEMENT==4?u:new Uint32Array(u);return a(v,E,f,T,d,p,g,m,y,b)}}})();var yJ=class extends cr{constructor(t){super(),t=t??H.EMPTY_OBJECT;let n=t.resourceCache,i=t.gltf,r=t.bufferViewId,o=t.gltfResource,s=t.baseResource,a=t.cacheKey,c=i.bufferViews[r],u=c.buffer,f=c.byteOffset,d=c.byteLength,p=!1,g,m,y,A,b=ux(c);l(b)&&(u=b.buffer,f=b.byteOffset??0,d=b.byteLength,p=!0,g=b.byteStride,m=b.count,y=b.mode,A=b.filter??"NONE");let x=i.buffers[u];this._hasMeshopt=p,this._meshoptByteStride=g,this._meshoptCount=m,this._meshoptMode=y,this._meshoptFilter=A,this._resourceCache=n,this._gltfResource=o,this._baseResource=s,this._buffer=x,this._bufferId=u,this._byteOffset=f,this._byteLength=d,this._cacheKey=a,this._bufferLoader=void 0,this._typedArray=void 0,this._state=Ct.UNLOADED,this._promise=void 0}get cacheKey(){return this._cacheKey}get typedArray(){return this._typedArray}async load(){return l(this._promise)?this._promise:(this._state=Ct.LOADING,this._promise=IQe(this),this._promise)}unload(){l(this._bufferLoader)&&!this._bufferLoader.isDestroyed()&&this._resourceCache.unload(this._bufferLoader),this._bufferLoader=void 0,this._typedArray=void 0}};async function IQe(e){try{let t=PQe(e);if(e._bufferLoader=t,await t.load(),e.isDestroyed())return;let n=t.typedArray,i=new Uint8Array(n.buffer,n.byteOffset+e._byteOffset,e._byteLength);if(e.unload(),e._typedArray=i,e._hasMeshopt){let r=e._meshoptCount,o=e._meshoptByteStride,s=new Uint8Array(r*o);Ty.decodeGltfBuffer(s,r,o,e._typedArray,e._meshoptMode,e._meshoptFilter),e._typedArray=s}return e._state=Ct.READY,e}catch(t){if(e.isDestroyed())return;throw e.unload(),e._state=Ct.FAILED,e.getError("Failed to load buffer view",t)}}function PQe(e){let t=e._resourceCache,n=e._buffer;if(l(n.uri)){let o=e._baseResource.getDerivedResource({url:n.uri});return t.getExternalBufferLoader({resource:o})}let i=n.extras?._pipeline?.source;return t.getEmbeddedBufferLoader({parentResource:e._gltfResource,bufferId:e._bufferId,typedArray:i})}var WD=yJ;var fx=class e{static _getDecoderTaskProcessor(){if(!l(e._decoderTaskProcessor)){let t=new $n("decodeDraco",e._maxDecodingConcurrency);t.initWebAssemblyModule({wasmBinaryFile:"ThirdParty/draco_decoder.wasm"}).then(function(n){n?e._taskProcessorReady=!0:e._error=new oe("Draco decoder could not be initialized.")}).catch(n=>{e._error=n}),e._decoderTaskProcessor=t}return e._decoderTaskProcessor}static decodePointCloud(t){let n=e._getDecoderTaskProcessor();if(l(e._error))throw e._error;if(e._taskProcessorReady)return n.scheduleTask(t,[t.buffer.buffer])}static decodeBufferView(t){let n=e._getDecoderTaskProcessor();if(l(e._error))throw e._error;if(e._taskProcessorReady)return n.scheduleTask(t,[t.array.buffer])}};fx._maxDecodingConcurrency=Math.max(dn.hardwareConcurrency-1,1);fx._decoderTaskProcessor=void 0;fx._taskProcessorReady=!1;fx._error=void 0;var Ey=fx;var Rn={POSITION:"POSITION",NORMAL:"NORMAL",TANGENT:"TANGENT",TEXCOORD:"TEXCOORD",COLOR:"COLOR",JOINTS:"JOINTS",WEIGHTS:"WEIGHTS",FEATURE_ID:"_FEATURE_ID",SCALE:"KHR_gaussian_splatting:SCALE",ROTATION:"KHR_gaussian_splatting:ROTATION",CUMULATIVE_DISTANCE:"BENTLEY_materials_line_style:CUMULATIVE_DISTANCE"};function DQe(e){switch(e){case Rn.POSITION:return"positionMC";case Rn.NORMAL:return"normalMC";case Rn.TANGENT:return"tangentMC";case Rn.TEXCOORD:return"texCoord";case Rn.COLOR:return"color";case Rn.JOINTS:return"joints";case Rn.WEIGHTS:return"weights";case Rn.FEATURE_ID:return"featureId";case Rn.SCALE:return"scale";case Rn.ROTATION:return"rotation";case Rn.CUMULATIVE_DISTANCE:return"cumulativeDistance"}}Rn.hasSetIndex=function(e){switch(e){case Rn.POSITION:case Rn.NORMAL:case Rn.TANGENT:case Rn.CUMULATIVE_DISTANCE:return!1;case Rn.TEXCOORD:case Rn.COLOR:case Rn.JOINTS:case Rn.WEIGHTS:case Rn.FEATURE_ID:case Rn.SCALE:case Rn.ROTATION:return!0}};Rn.fromGltfSemantic=function(e){let t=e,i=/^(\w+)_\d+$/.exec(e);switch(i!==null&&(t=i[1]),t){case"POSITION":return Rn.POSITION;case"NORMAL":return Rn.NORMAL;case"TANGENT":return Rn.TANGENT;case"TEXCOORD":return Rn.TEXCOORD;case"COLOR":return Rn.COLOR;case"JOINTS":return Rn.JOINTS;case"WEIGHTS":return Rn.WEIGHTS;case"_FEATURE_ID":return Rn.FEATURE_ID;case"KHR_gaussian_splatting:SCALE":case"_SCALE":return Rn.SCALE;case"KHR_gaussian_splatting:ROTATION":case"_ROTATION":return Rn.ROTATION;case"BENTLEY_materials_line_style:CUMULATIVE_DISTANCE":return Rn.CUMULATIVE_DISTANCE}};Rn.fromPntsSemantic=function(e){switch(e){case"POSITION":case"POSITION_QUANTIZED":return Rn.POSITION;case"RGBA":case"RGB":case"RGB565":return Rn.COLOR;case"NORMAL":case"NORMAL_OCT16P":return Rn.NORMAL;case"BATCH_ID":return Rn.FEATURE_ID}};Rn.getGlslType=function(e){switch(e){case Rn.POSITION:case Rn.NORMAL:case Rn.TANGENT:return"vec3";case Rn.TEXCOORD:return"vec2";case Rn.COLOR:return"vec4";case Rn.JOINTS:return"ivec4";case Rn.WEIGHTS:return"vec4";case Rn.FEATURE_ID:return"int";case Rn.SCALE:return"vec3";case Rn.ROTATION:return"vec4";case Rn.CUMULATIVE_DISTANCE:return"float";case Rn.OPACITY:return"float"}};Rn.getVariableName=function(e,t){let n=DQe(e);return l(t)&&(n+=`_${t}`),n};Object.freeze(Rn);var ct=Rn;var AJ=class extends cr{constructor(t){super(),t=t??H.EMPTY_OBJECT;let n=t.resourceCache,i=t.gltf,r=t.primitive,o=t.draco,s=t.gltfResource,a=t.baseResource,c=t.cacheKey;this._resourceCache=n,this._gltfResource=s,this._baseResource=a,this._gltf=i,this._primitive=r,this._draco=o,this._cacheKey=c,this._bufferViewLoader=void 0,this._bufferViewTypedArray=void 0,this._decodePromise=void 0,this._decodedData=void 0,this._state=Ct.UNLOADED,this._promise=void 0,this._dracoError=void 0}get cacheKey(){return this._cacheKey}get decodedData(){return this._decodedData}async load(){return l(this._promise)?this._promise:(this._state=Ct.LOADING,this._promise=RQe(this),this._promise)}process(t){if(this._state===Ct.READY)return!0;if(this._state!==Ct.PROCESSING||(l(this._dracoError)&&yye(this,this._dracoError),!l(this._bufferViewTypedArray))||l(this._decodePromise))return!1;let n=this._draco,i=this._primitive,r=this._gltf,o=r.bufferViews,s=n.bufferView,a=o[s],c=n.attributes,u=[];for(let p in i.attributes)if(i.attributes.hasOwnProperty(p)){let g=MQe(p);l(g)&&r.accessors[i.attributes[p]].componentType===Y.FLOAT&&(u.includes(g)||u.push(g))}let f={array:new Uint8Array(this._bufferViewTypedArray),bufferView:a,compressedAttributes:c,dequantizeInShader:!0,attributesToSkipTransform:u},d=Ey.decodeBufferView(f);if(!l(d))return!1;this._decodePromise=OQe(this,d)}unload(){l(this._bufferViewLoader)&&this._resourceCache.unload(this._bufferViewLoader),this._bufferViewLoader=void 0,this._bufferViewTypedArray=void 0,this._decodedData=void 0,this._gltf=void 0,this._primitive=void 0}};async function RQe(e){let t=e._resourceCache;try{let n=t.getBufferViewLoader({gltf:e._gltf,bufferViewId:e._draco.bufferView,gltfResource:e._gltfResource,baseResource:e._baseResource});return e._bufferViewLoader=n,await n.load(),e.isDestroyed()?void 0:(e._bufferViewTypedArray=n.typedArray,e._state=Ct.PROCESSING,e)}catch(n){if(e.isDestroyed())return;yye(e,n)}}function yye(e,t){throw e.unload(),e._state=Ct.FAILED,e.getError("Failed to load Draco",t)}async function OQe(e,t){try{let n=await t;return e.isDestroyed()?void 0:(e.unload(),e._decodedData={indices:n.indexArray,vertexAttributes:n.attributeData},e._state=Ct.READY,e._baseResource)}catch(n){if(e.isDestroyed())return;e._dracoError=n}}var dx={};dx[ct.POSITION]="POSITION";dx[ct.NORMAL]="NORMAL";dx[ct.COLOR]="COLOR";dx[ct.TEXCOORD]="TEX_COORD";function MQe(e){for(let t in dx)if(dx.hasOwnProperty(t)&&e.startsWith(t))return dx[t]}var qD=AJ;function NQe(e){let{uint8Array:t,format:n,request:i}=e,r=e.flipY??!1,o=e.skipColorSpaceConversion??!1,s=new Blob([t],{type:n}),a;return De.supportsImageBitmapOptions().then(function(c){return c?Promise.resolve(De.createImageBitmapFromBlob(s,{flipY:r,premultiplyAlpha:!1,skipColorSpaceConversion:o})):(a=window.URL.createObjectURL(s),new De({url:a,request:i}).fetchImage({flipY:r,skipColorSpaceConversion:o}))}).then(function(c){return l(a)&&window.URL.revokeObjectURL(a),c}).catch(function(c){return l(a)&&window.URL.revokeObjectURL(a),Promise.reject(c)})}var Cy=NQe;var YD=class extends cr{constructor(t){super(),t=t??H.EMPTY_OBJECT;let n=t.resourceCache,i=t.gltf,r=t.imageId,o=t.gltfResource,s=t.baseResource,a=t.cacheKey,c=i.images[r],u=c.bufferView,f=c.uri;this._resourceCache=n,this._gltfResource=o,this._baseResource=s,this._gltf=i,this._bufferViewId=u,this._uri=f,this._cacheKey=a,this._bufferViewLoader=void 0,this._image=void 0,this._mipLevels=void 0,this._state=Ct.UNLOADED,this._promise=void 0}get cacheKey(){return this._cacheKey}get image(){return this._image}get mipLevels(){return this._mipLevels}load(){return l(this._promise)?this._promise:l(this._bufferViewId)?(this._promise=LQe(this),this._promise):(this._promise=FQe(this),this._promise)}unload(){l(this._bufferViewLoader)&&!this._bufferViewLoader.isDestroyed()&&this._resourceCache.unload(this._bufferViewLoader),this._bufferViewLoader=void 0,this._uri=void 0,this._image=void 0,this._mipLevels=void 0,this._gltf=void 0}};function Aye(e){let t;return Array.isArray(e)&&(t=e.slice(1,e.length).map(function(n){return n.bufferView}),e=e[0]),{image:e,mipLevels:t}}async function LQe(e){e._state=Ct.LOADING;let t=e._resourceCache;try{let n=t.getBufferViewLoader({gltf:e._gltf,bufferViewId:e._bufferViewId,gltfResource:e._gltfResource,baseResource:e._baseResource});if(e._bufferViewLoader=n,await n.load(),e.isDestroyed())return;let i=n.typedArray,r=await kQe(i);if(e.isDestroyed())return;let o=Aye(r);return e.unload(),e._image=o.image,e._mipLevels=o.mipLevels,e._state=Ct.READY,e}catch(n){return e.isDestroyed()?void 0:bye(e,n,"Failed to load embedded image")}}async function FQe(e){e._state=Ct.LOADING;let t=e._baseResource,n=e._uri,i=t.getDerivedResource({url:n});try{let r=await zQe(i);if(e.isDestroyed())return;let o=Aye(r);return e.unload(),e._image=o.image,e._mipLevels=o.mipLevels,e._state=Ct.READY,e}catch(r){return e.isDestroyed()?void 0:bye(e,r,`Failed to load image: ${n}`)}}function bye(e,t,n){return e.unload(),e._state=Ct.FAILED,Promise.reject(e.getError(n,t))}function BQe(e){let t=e.subarray(0,2),n=e.subarray(0,4),i=e.subarray(8,12);if(t[0]===255&&t[1]===216)return"image/jpeg";if(t[0]===137&&t[1]===80)return"image/png";if(t[0]===171&&t[1]===75)return"image/ktx2";if(n[0]===82&&n[1]===73&&n[2]===70&&n[3]===70&&i[0]===87&&i[1]===69&&i[2]===66&&i[3]===80)return"image/webp";throw new oe("Image format is not recognized")}async function kQe(e){let t=BQe(e);if(t==="image/ktx2"){let n=new Uint8Array(e);return nf(n)}return YD._loadImageFromTypedArray({uint8Array:e,format:t,flipY:!1,skipColorSpaceConversion:!0})}var UQe=/(^data:image\/ktx2)|(\.ktx2$)/i;function zQe(e){let t=e.getUrlComponent(!1,!0);return UQe.test(t)?nf(e):e.fetchImage({skipColorSpaceConversion:!0,preferImageBitmap:!0})}YD._loadImageFromTypedArray=Cy;var XD=YD;var xye={TEXTURE:0,PROGRAM:1,BUFFER:2,NUMBER_OF_JOB_TYPES:3};Object.freeze(xye);var Zc=xye;var bJ=class extends cr{constructor(t){super(),t=t??H.EMPTY_OBJECT;let n=t.resourceCache,i=t.gltf,r=t.accessorId,o=t.gltfResource,s=t.baseResource,a=t.primitive,c=t.draco,u=t.cacheKey,f=t.asynchronous??!0,d=t.loadBuffer??!1,p=t.loadTypedArray??!1,g=i.accessors[r].componentType;this._resourceCache=n,this._gltfResource=o,this._baseResource=s,this._gltf=i,this._accessorId=r,this._indexDatatype=g,this._primitive=a,this._draco=c,this._cacheKey=u,this._asynchronous=f,this._loadBuffer=d,this._loadTypedArray=p,this._bufferViewLoader=void 0,this._dracoLoader=void 0,this._typedArray=void 0,this._buffer=void 0,this._state=Ct.UNLOADED,this._promise=void 0}get cacheKey(){return this._cacheKey}get buffer(){return this._buffer}get typedArray(){return this._typedArray}get indexDatatype(){return this._indexDatatype}async load(){return l(this._promise)?this._promise:l(this._draco)?(this._promise=jQe(this),this._promise):(this._promise=HQe(this),this._promise)}process(t){if(this._state===Ct.READY)return!0;if(this._state!==Ct.LOADED&&this._state!==Ct.PROCESSING)return!1;let n=this._typedArray,i=this._indexDatatype;if(l(this._dracoLoader))try{this._dracoLoader.process(t)&&(n=this._dracoLoader.decodedData.indices.typedArray,this._typedArray=n,i=Y.fromTypedArray(n),this._indexDatatype=i)}catch(o){TJ(this,o)}if(!l(n))return!1;let r;if(this._loadBuffer&&this._asynchronous){let o=VQe;if(o.set(n,i,t.context),!t.jobScheduler.execute(o,Zc.BUFFER))return!1;r=o.buffer}else this._loadBuffer&&(r=Tye(n,i,t.context));return this.unload(),this._buffer=r,this._typedArray=this._loadTypedArray?n:void 0,this._state=Ct.READY,this._resourceCache.statistics.addGeometryLoader(this),!0}unload(){l(this._buffer)&&this._buffer.destroy();let t=this._resourceCache;l(this._bufferViewLoader)&&!this._bufferViewLoader.isDestroyed()&&t.unload(this._bufferViewLoader),l(this._dracoLoader)&&t.unload(this._dracoLoader),this._bufferViewLoader=void 0,this._dracoLoader=void 0,this._typedArray=void 0,this._buffer=void 0,this._gltf=void 0,this._primitive=void 0}},xJ=class{constructor(){this.typedArray=void 0,this.indexDatatype=void 0,this.context=void 0,this.buffer=void 0}set(t,n,i){this.typedArray=t,this.indexDatatype=n,this.context=i}execute(){this.buffer=Tye(this.typedArray,this.indexDatatype,this.context)}};function Tye(e,t,n){let i=tt.createIndexBuffer({typedArray:e,context:n,usage:Me.STATIC_DRAW,indexDatatype:t});return i.vertexArrayDestroyable=!1,i}var VQe=new xJ;async function jQe(e){e._state=Ct.LOADING;let t=e._resourceCache;try{let n=t.getDracoLoader({gltf:e._gltf,primitive:e._primitive,draco:e._draco,gltfResource:e._gltfResource,baseResource:e._baseResource});return e._dracoLoader=n,await n.load(),e.isDestroyed()?void 0:(e._state=Ct.LOADED,e)}catch(n){if(e.isDestroyed())return;TJ(e,n)}}async function HQe(e){let t=e._gltf,n=e._accessorId,r=t.accessors[n].bufferView;e._state=Ct.LOADING;let o=e._resourceCache;try{let s=o.getBufferViewLoader({gltf:t,bufferViewId:r,gltfResource:e._gltfResource,baseResource:e._baseResource});if(e._bufferViewLoader=s,await s.load(),e.isDestroyed())return;let a=s.typedArray;return e._typedArray=GQe(e,a),e._state=Ct.PROCESSING,e}catch(s){if(e.isDestroyed())return;TJ(e,s)}}function GQe(e,t){let n=e._gltf,i=e._accessorId,r=n.accessors[i],o=r.count,s=r.componentType,a=je.getSizeInBytes(s),c=t.buffer,u=t.byteOffset+r.byteOffset;if(u%a!==0){let d=o*a,p=new Uint8Array(c,u,d);c=new Uint8Array(p).buffer,u=0,Yr("index-buffer-unaligned",`The index array is not aligned to a ${a}-byte boundary.`)}let f;return s===je.UNSIGNED_BYTE?f=new Uint8Array(c,u,o):s===je.UNSIGNED_SHORT?f=new Uint16Array(c,u,o):s===je.UNSIGNED_INT&&(f=new Uint32Array(c,u,o)),f}function TJ(e,t){throw e.unload(),e._state=Ct.FAILED,e.getError("Failed to load index buffer",t)}var KD=bJ;function WQe(e,t,n){return JSON.parse(_f(e,t,n))}var Fo=WQe;function qQe(e,t){return t=t??0,_f(e,t,Math.min(4,e.length))}var yp=qQe;function YQe(e,t,n){if(n=n??!1,n){let i=e.indexOf(t);if(i>-1)return i}return e.push(t),e.length-1}var Ma=YQe;function XQe(e,t){return l(e.extensionsUsed)&&e.extensionsUsed.indexOf(t)>=0}var Jo=XQe;function rn(){}rn.objectLegacy=function(e,t){if(l(e)){for(let n in e)if(Object.prototype.hasOwnProperty.call(e,n)){let i=e[n],r=t(i,n);if(l(r))return r}}};rn.object=function(e,t){if(l(e)){let n=e.length;for(let i=0;i<n;i++){let r=e[i],o=t(r,i);if(l(o))return o}}};rn.topLevel=function(e,t,n){let i=e[t];return l(i)&&!Array.isArray(i)?rn.objectLegacy(i,n):rn.object(i,n)};rn.accessor=function(e,t){return rn.topLevel(e,"accessors",t)};rn.accessorWithSemantic=function(e,t,n){let i={};return rn.mesh(e,function(r){return rn.meshPrimitive(r,function(o){let s=rn.meshPrimitiveAttribute(o,function(a,c){if(c.indexOf(t)===0&&!l(i[a])){i[a]=!0;let u=n(a);if(l(u))return u}});return l(s)?s:rn.meshPrimitiveTarget(o,function(a){return rn.meshPrimitiveTargetAttribute(a,function(c,u){if(u.indexOf(t)===0&&!l(i[c])){i[c]=!0;let f=n(c);if(l(f))return f}})})})})};rn.accessorContainingVertexAttributeData=function(e,t){let n={};return rn.mesh(e,function(i){return rn.meshPrimitive(i,function(r){let o=rn.meshPrimitiveAttribute(r,function(s){if(!l(n[s])){n[s]=!0;let a=t(s);if(l(a))return a}});return l(o)?o:rn.meshPrimitiveTarget(r,function(s){return rn.meshPrimitiveTargetAttribute(s,function(a){if(!l(n[a])){n[a]=!0;let c=t(a);if(l(c))return c}})})})})};rn.accessorContainingIndexData=function(e,t){let n={};return rn.mesh(e,function(i){return rn.meshPrimitive(i,function(r){let o=r.indices;if(l(o)&&!l(n[o])){n[o]=!0;let s=t(o);if(l(s))return s}})})};rn.animation=function(e,t){return rn.topLevel(e,"animations",t)};rn.animationChannel=function(e,t){let n=e.channels;return rn.object(n,t)};rn.animationSampler=function(e,t){let n=e.samplers;return rn.object(n,t)};rn.buffer=function(e,t){return rn.topLevel(e,"buffers",t)};rn.bufferView=function(e,t){return rn.topLevel(e,"bufferViews",t)};rn.camera=function(e,t){return rn.topLevel(e,"cameras",t)};rn.image=function(e,t){return rn.topLevel(e,"images",t)};rn.material=function(e,t){return rn.topLevel(e,"materials",t)};rn.materialValue=function(e,t){let n=e.values;l(e.extensions)&&l(e.extensions.KHR_techniques_webgl)&&(n=e.extensions.KHR_techniques_webgl.values);for(let i in n)if(Object.prototype.hasOwnProperty.call(n,i)){let r=t(n[i],i);if(l(r))return r}};rn.mesh=function(e,t){return rn.topLevel(e,"meshes",t)};rn.meshPrimitive=function(e,t){let n=e.primitives;if(l(n)){let i=n.length;for(let r=0;r<i;r++){let o=n[r],s=t(o,r);if(l(s))return s}}};rn.meshPrimitiveAttribute=function(e,t){let n=e.attributes;for(let i in n)if(Object.prototype.hasOwnProperty.call(n,i)){let r=t(n[i],i);if(l(r))return r}};rn.meshPrimitiveTarget=function(e,t){let n=e.targets;if(l(n)){let i=n.length;for(let r=0;r<i;++r){let o=t(n[r],r);if(l(o))return o}}};rn.meshPrimitiveTargetAttribute=function(e,t){for(let n in e)if(Object.prototype.hasOwnProperty.call(e,n)){let i=e[n],r=t(i,n);if(l(r))return r}};rn.node=function(e,t){return rn.topLevel(e,"nodes",t)};rn.nodeInTree=function(e,t,n){let i=e.nodes;if(l(i)){let r=t.length;for(let o=0;o<r;o++){let s=t[o],a=i[s];if(l(a)){let c=n(a,s);if(l(c))return c;let u=a.children;if(l(u)&&(c=rn.nodeInTree(e,u,n),l(c)))return c}}}};rn.nodeInScene=function(e,t,n){let i=t.nodes;if(l(i))return rn.nodeInTree(e,i,n)};rn.program=function(e,t){return Jo(e,"KHR_techniques_webgl")?rn.object(e.extensions.KHR_techniques_webgl.programs,t):rn.topLevel(e,"programs",t)};rn.sampler=function(e,t){return rn.topLevel(e,"samplers",t)};rn.scene=function(e,t){return rn.topLevel(e,"scenes",t)};rn.shader=function(e,t){return Jo(e,"KHR_techniques_webgl")?rn.object(e.extensions.KHR_techniques_webgl.shaders,t):rn.topLevel(e,"shaders",t)};rn.skin=function(e,t){return rn.topLevel(e,"skins",t)};rn.skinJoint=function(e,t){let n=e.joints;if(l(n)){let i=n.length;for(let r=0;r<i;r++){let o=n[r],s=t(o);if(l(s))return s}}};rn.techniqueAttribute=function(e,t){let n=e.attributes;for(let i in n)if(Object.prototype.hasOwnProperty.call(n,i)){let r=t(n[i],i);if(l(r))return r}};rn.techniqueUniform=function(e,t){let n=e.uniforms;for(let i in n)if(Object.prototype.hasOwnProperty.call(n,i)){let r=t(n[i],i);if(l(r))return r}};rn.techniqueParameter=function(e,t){let n=e.parameters;for(let i in n)if(Object.prototype.hasOwnProperty.call(n,i)){let r=t(n[i],i);if(l(r))return r}};rn.technique=function(e,t){return Jo(e,"KHR_techniques_webgl")?rn.object(e.extensions.KHR_techniques_webgl.techniques,t):rn.topLevel(e,"techniques",t)};rn.texture=function(e,t){return rn.topLevel(e,"textures",t)};var Ue=rn;function KQe(e){Ue.accessor(e,function(n){l(n.bufferView)&&(n.byteOffset=n.byteOffset??0)}),Ue.bufferView(e,function(n){l(n.buffer)&&(n.byteOffset=n.byteOffset??0)}),Ue.mesh(e,function(n){Ue.meshPrimitive(n,function(i){if(i.mode=i.mode??te.TRIANGLES,!l(i.material)){l(e.materials)||(e.materials=[]);let r={name:"default"};i.material=Ma(e.materials,r)}})}),Ue.accessorContainingVertexAttributeData(e,function(n){let i=e.accessors[n],r=i.bufferView;if(i.normalized=i.normalized??!1,l(r)){let o=e.bufferViews[r];o.byteStride=pf(e,i),o.target=te.ARRAY_BUFFER}}),Ue.accessorContainingIndexData(e,function(n){let r=e.accessors[n].bufferView;if(l(r)){let o=e.bufferViews[r];o.target=te.ELEMENT_ARRAY_BUFFER}}),Ue.material(e,function(n){let i=n.extensions??{},r=i.KHR_materials_common;if(l(r)){let c=r.technique,u=l(r.values)?r.values:{};r.values=u,u.ambient=l(u.ambient)?u.ambient:[0,0,0,1],u.emission=l(u.emission)?u.emission:[0,0,0,1],u.transparency=u.transparency??1,c!=="CONSTANT"&&(u.diffuse=l(u.diffuse)?u.diffuse:[0,0,0,1],c!=="LAMBERT"&&(u.specular=l(u.specular)?u.specular:[0,0,0,1],u.shininess=u.shininess??0)),r.transparent=r.transparent??!1,r.doubleSided=r.doubleSided??!1;return}n.emissiveFactor=n.emissiveFactor??[0,0,0],n.alphaMode=n.alphaMode??"OPAQUE",n.doubleSided=n.doubleSided??!1,n.alphaMode==="MASK"&&(n.alphaCutoff=n.alphaCutoff??.5);let o=i.KHR_techniques_webgl;l(o)&&Ue.materialValue(n,function(c){l(c.index)&&hx(c)}),hx(n.emissiveTexture),hx(n.normalTexture),hx(n.occlusionTexture);let s=n.pbrMetallicRoughness;l(s)&&(s.baseColorFactor=s.baseColorFactor??[1,1,1,1],s.metallicFactor=s.metallicFactor??1,s.roughnessFactor=s.roughnessFactor??1,hx(s.baseColorTexture),hx(s.metallicRoughnessTexture));let a=i.KHR_materials_pbrSpecularGlossiness;l(a)&&(a.diffuseFactor=a.diffuseFactor??[1,1,1,1],a.specularFactor=a.specularFactor??[1,1,1],a.glossinessFactor=a.glossinessFactor??1,hx(a.specularGlossinessTexture))}),Ue.animation(e,function(n){Ue.animationSampler(n,function(i){i.interpolation=i.interpolation??"LINEAR"})});let t=$Qe(e);return Ue.node(e,function(n,i){l(t[i])||l(n.translation)||l(n.rotation)||l(n.scale)?(n.translation=n.translation??[0,0,0],n.rotation=n.rotation??[0,0,0,1],n.scale=n.scale??[1,1,1]):n.matrix=n.matrix??[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]}),Ue.sampler(e,function(n){n.wrapS=n.wrapS??te.REPEAT,n.wrapT=n.wrapT??te.REPEAT}),l(e.scenes)&&!l(e.scene)&&(e.scene=0),e}function $Qe(e){let t={};return Ue.animation(e,function(n){Ue.animationChannel(n,function(i){let r=i.target,o=r.node,s=r.path;(s==="translation"||s==="rotation"||s==="scale")&&(t[o]=!0)})}),t}function hx(e){l(e)&&(e.texCoord=e.texCoord??0)}var OU=KQe;function JQe(e){return Ue.shader(e,function(t){MU(t)}),Ue.buffer(e,function(t){MU(t)}),Ue.image(e,function(t){MU(t)}),MU(e),e}function MU(e){e.extras=l(e.extras)?e.extras:{},e.extras._pipeline=l(e.extras._pipeline)?e.extras._pipeline:{}}var mx=JQe;function ZQe(e,t){let n=e.extensionsRequired;if(l(n)){let i=n.indexOf(t);i>=0&&n.splice(i,1),n.length===0&&delete e.extensionsRequired}}var NU=ZQe;function QQe(e,t){let n=e.extensionsUsed;if(l(n)){let i=n.indexOf(t);i>=0&&n.splice(i,1),NU(e,t),n.length===0&&delete e.extensionsUsed}}var Sv=QQe;var eet=4;function tet(e){if(yp(e)!=="glTF")throw new oe("File is not valid binary glTF");let n=Eye(e,0,5),i=n[1];if(i!==1&&i!==2)throw new oe("Binary glTF version is not 1 or 2");return i===1?net(e,n):iet(e,n)}function Eye(e,t,n){let i=new DataView(e.buffer),r=new Array(n);for(let o=0;o<n;++o)r[o]=i.getUint32(e.byteOffset+t+o*eet,!0);return r}function net(e,t){let n=t[2],i=t[3];if(t[4]!==0)throw new oe("Binary glTF scene format is not JSON");let o=20,s=o+i,a=_f(e,o,i),c=JSON.parse(a);mx(c);let u=e.subarray(s,n),f=c.buffers;if(l(f)&&Object.keys(f).length>0){let d=f.binary_glTF??f.KHR_binary_glTF;l(d)&&(d.extras._pipeline.source=u,delete d.uri)}return Sv(c,"KHR_binary_glTF"),c}function iet(e,t){let n=t[2],i=12,r,o;for(;i<n;){let s=Eye(e,i,2),a=s[0],c=s[1];i+=8;let u=e.subarray(i,i+a);if(i+=a,c===1313821514){let f=_f(u);r=JSON.parse(f),mx(r)}else c===5130562&&(o=u)}if(l(r)&&l(o)){let s=r.buffers;if(l(s)&&s.length>0){let a=s[0];a.extras._pipeline.source=o}}return r}var wv=tet;function ret(e){return Ue.shader(e,function(t){LU(t)}),Ue.buffer(e,function(t){LU(t)}),Ue.image(e,function(t){LU(t)}),LU(e),e}function LU(e){l(e.extras)&&(l(e.extras._pipeline)&&delete e.extras._pipeline,Object.keys(e.extras).length===0&&delete e.extras)}var FU=ret;function oet(e,t){let n=e.extensionsUsed;l(n)||(n=[],e.extensionsUsed=n),Ma(n,t,!0)}var Vh=oet;function set(e,t){let n=e.bufferViews,i=e.buffers,r=t.bufferView,o=vd(t.type);if(!l(t.bufferView))return{min:new Array(o).fill(0),max:new Array(o).fill(0)};let s=new Array(o).fill(Number.POSITIVE_INFINITY),a=new Array(o).fill(Number.NEGATIVE_INFINITY),c=n[r],u=c.buffer,d=i[u].extras._pipeline.source,p=t.count,g=pf(e,t),m=t.byteOffset+c.byteOffset+d.byteOffset,y=t.componentType,A=Y.getSizeInBytes(y),b=new DataView(d.buffer),x=new Array(o),T=gy(y);for(let E=0;E<p;E++){T(b,m,o,A,x);for(let v=0;v<o;v++){let S=x[v];s[v]=Math.min(s[v],S),a[v]=Math.max(a[v],S)}m+=g}return{min:s,max:a}}var Iv=set;var aet=[te.FUNC_ADD,te.FUNC_ADD],cet=[te.ONE,te.ZERO,te.ONE,te.ZERO];function Cye(e,t){let n=e.enable;return l(n)?n.indexOf(t)>-1:!1}var uet=[te.ZERO,te.ONE,te.SRC_COLOR,te.ONE_MINUS_SRC_COLOR,te.SRC_ALPHA,te.ONE_MINUS_SRC_ALPHA,te.DST_ALPHA,te.ONE_MINUS_DST_ALPHA,te.DST_COLOR,te.ONE_MINUS_DST_COLOR];function fet(e,t){if(!l(e))return t;for(let n=0;n<4;n++)if(uet.indexOf(e[n])===-1)return t;return e}function det(e){let t={},n={},i=e.techniques;return l(i)&&(Ue.technique(e,function(r,o){let s=r.states;if(l(s)){let a=n[o]={};if(Cye(s,te.BLEND)){a.alphaMode="BLEND";let c=s.functions;l(c)&&(l(c.blendEquationSeparate)||l(c.blendFuncSeparate))&&(t[o]={blendEquation:c.blendEquationSeparate??aet,blendFactors:fet(c.blendFuncSeparate,cet)})}Cye(s,te.CULL_FACE)||(a.doubleSided=!0),delete r.states}}),Object.keys(t).length>0&&(l(e.extensions)||(e.extensions={}),Vh(e,"KHR_blend")),Ue.material(e,function(r){if(l(r.technique)){let o=n[r.technique];Ue.objectLegacy(o,function(a,c){r[c]=a});let s=t[r.technique];l(s)&&(l(r.extensions)||(r.extensions={}),r.extensions.KHR_blend=s)}})),e}var BU=det;function het(e,t){let n=e.extensionsRequired;l(n)||(n=[],e.extensionsRequired=n),Ma(n,t,!0),Vh(e,t)}var kU=het;function met(e){let t=e.techniques,n={},i={},r={};if(l(t)){let o={programs:[],shaders:[],techniques:[]},s=e.glExtensionsUsed;delete e.glExtensionsUsed,Ue.technique(e,function(a,c){let u={name:a.name,program:void 0,attributes:{},uniforms:{}},f;if(Ue.techniqueAttribute(a,function(d,p){f=a.parameters[d],u.attributes[p]={semantic:f.semantic}}),Ue.techniqueUniform(a,function(d,p){f=a.parameters[d],u.uniforms[p]={count:f.count,node:f.node,type:f.type,semantic:f.semantic,value:f.value},l(n[c])||(n[c]={}),n[c][d]=p}),l(r[a.program]))u.program=r[a.program];else{let d=e.programs[a.program],p={name:d.name,fragmentShader:void 0,vertexShader:void 0,glExtensions:s},g=e.shaders[d.fragmentShader];p.fragmentShader=Ma(o.shaders,g,!0);let m=e.shaders[d.vertexShader];p.vertexShader=Ma(o.shaders,m,!0),u.program=Ma(o.programs,p),r[a.program]=u.program}i[c]=Ma(o.techniques,u)}),o.techniques.length>0&&(l(e.extensions)||(e.extensions={}),e.extensions.KHR_techniques_webgl=o,Vh(e,"KHR_techniques_webgl"),kU(e,"KHR_techniques_webgl"))}return Ue.material(e,function(o){if(l(o.technique)){let s={technique:i[o.technique]};Ue.objectLegacy(o.values,function(a,c){l(s.values)||(s.values={});let u=n[o.technique][c];l(u)&&(s.values[u]=a)}),l(o.extensions)||(o.extensions={}),o.extensions.KHR_techniques_webgl=s}delete o.technique,delete o.values}),delete e.techniques,delete e.programs,delete e.shaders,e}var UU=met;function pet(e,t){qr.typeOf.object("material",e),qr.defined("handler",t);let n=e.pbrMetallicRoughness;if(l(n)){if(l(n.baseColorTexture)){let o=n.baseColorTexture,s=t(o.index,o);if(l(s))return s}if(l(n.metallicRoughnessTexture)){let o=n.metallicRoughnessTexture,s=t(o.index,o);if(l(s))return s}}let{extensions:i}=e;if(l(i)){let o=i.KHR_materials_pbrSpecularGlossiness;if(l(o)){if(l(o.diffuseTexture)){let u=o.diffuseTexture,f=t(u.index,u);if(l(f))return f}if(l(o.specularGlossinessTexture)){let u=o.specularGlossinessTexture,f=t(u.index,u);if(l(f))return f}}let s=i.KHR_materials_specular;if(l(s)){let{specularTexture:u,specularColorTexture:f}=s;if(l(u)){let d=t(u.index,u);if(l(d))return d}if(l(f)){let d=t(f.index,f);if(l(d))return d}}let a=i.KHR_materials_transmission;if(l(a)&&l(a.transmissionTexture)){let u=a.transmissionTexture,f=t(u.index,u);if(l(f))return f}let c=i.KHR_materials_common;if(l(c)&&l(c.values)){let{diffuse:u,ambient:f,emission:d,specular:p}=c.values;if(l(u)&&l(u.index)){let g=t(u.index,u);if(l(g))return g}if(l(f)&&l(f.index)){let g=t(f.index,f);if(l(g))return g}if(l(d)&&l(d.index)){let g=t(d.index,d);if(l(g))return g}if(l(p)&&l(p.index)){let g=t(p.index,p);if(l(g))return g}}}let r=Ue.materialValue(e,function(o){if(l(o.index)){let s=t(o.index,o);if(l(s))return s}});if(l(r))return r;if(l(e.emissiveTexture)){let o=e.emissiveTexture,s=t(o.index,o);if(l(s))return s}if(l(e.normalTexture)){let o=e.normalTexture,s=t(o.index,o);if(l(s))return s}if(l(e.occlusionTexture)){let o=e.occlusionTexture,s=t(o.index,o);if(l(s))return s}}var $D=pet;var vye=["mesh","node","material","accessor","bufferView","buffer","texture","sampler","image"];function get(e,t){return t=t??vye,vye.forEach(function(n){t.indexOf(n)>-1&&yet(e,n)}),e}var _et={accessor:"accessors",buffer:"buffers",bufferView:"bufferViews",image:"images",node:"nodes",material:"materials",mesh:"meshes",sampler:"samplers",texture:"textures"};function yet(e,t){let n=_et[t],i=e[n];if(l(i)){let r=0,o=bp[t](e),s=i.length;for(let a=0;a<s;++a)o[a]||(Ap[t](e,a-r),r++)}}function Ap(){}Ap.accessor=function(e,t){e.accessors.splice(t,1),Ue.mesh(e,function(i){Ue.meshPrimitive(i,function(r){Ue.meshPrimitiveAttribute(r,function(a,c){a>t&&r.attributes[c]--}),Ue.meshPrimitiveTarget(r,function(a){Ue.meshPrimitiveTargetAttribute(a,function(c,u){c>t&&a[u]--})});let o=r.indices;l(o)&&o>t&&r.indices--;let s=r.extensions;l(s)&&l(s.CESIUM_primitive_outline)&&s.CESIUM_primitive_outline.indices>t&&--s.CESIUM_primitive_outline.indices})}),Ue.skin(e,function(i){l(i.inverseBindMatrices)&&i.inverseBindMatrices>t&&i.inverseBindMatrices--}),Ue.animation(e,function(i){Ue.animationSampler(i,function(r){l(r.input)&&r.input>t&&r.input--,l(r.output)&&r.output>t&&r.output--})})};Ap.buffer=function(e,t){e.buffers.splice(t,1),Ue.bufferView(e,function(i){l(i.buffer)&&i.buffer>t&&i.buffer--;let r=i.extensions;if(l(r)){let o=r.EXT_meshopt_compression;l(o)&&o.buffer>t&&o.buffer--;let s=r.KHR_meshopt_compression;l(s)&&s.buffer>t&&s.buffer--}})};Ap.bufferView=function(e,t){if(e.bufferViews.splice(t,1),Ue.accessor(e,function(i){l(i.bufferView)&&i.bufferView>t&&i.bufferView--}),Ue.shader(e,function(i){l(i.bufferView)&&i.bufferView>t&&i.bufferView--}),Ue.image(e,function(i){l(i.bufferView)&&i.bufferView>t&&i.bufferView--}),Jo(e,"KHR_draco_mesh_compression")&&Ue.mesh(e,function(i){Ue.meshPrimitive(i,function(r){l(r.extensions)&&l(r.extensions.KHR_draco_mesh_compression)&&r.extensions.KHR_draco_mesh_compression.bufferView>t&&r.extensions.KHR_draco_mesh_compression.bufferView--})}),Jo(e,"EXT_feature_metadata")){let r=e.extensions.EXT_feature_metadata.featureTables;for(let o in r)if(r.hasOwnProperty(o)){let a=r[o].properties;if(l(a)){for(let c in a)if(a.hasOwnProperty(c)){let u=a[c];l(u.bufferView)&&u.bufferView>t&&u.bufferView--,l(u.arrayOffsetBufferView)&&u.arrayOffsetBufferView>t&&u.arrayOffsetBufferView--,l(u.stringOffsetBufferView)&&u.stringOffsetBufferView>t&&u.stringOffsetBufferView--}}}}if(Jo(e,"EXT_structural_metadata")){let r=e.extensions.EXT_structural_metadata.propertyTables;if(l(r)){let o=r.length;for(let s=0;s<o;++s){let c=r[s].properties;for(let u in c)if(c.hasOwnProperty(u)){let f=c[u];l(f.values)&&f.values>t&&f.values--,l(f.arrayOffsets)&&f.arrayOffsets>t&&f.arrayOffsets--,l(f.stringOffsets)&&f.stringOffsets>t&&f.stringOffsets--}}}}};Ap.image=function(e,t){e.images.splice(t,1),Ue.texture(e,function(i){l(i.source)&&i.source>t&&--i.source;let r=i.extensions;l(r)&&l(r.EXT_texture_webp)&&r.EXT_texture_webp.source>t?--i.extensions.EXT_texture_webp.source:l(r)&&l(r.KHR_texture_basisu)&&r.KHR_texture_basisu.source>t&&--i.extensions.KHR_texture_basisu.source})};Ap.mesh=function(e,t){e.meshes.splice(t,1),Ue.node(e,function(i){l(i.mesh)&&(i.mesh>t?i.mesh--:i.mesh===t&&delete i.mesh)})};Ap.node=function(e,t){e.nodes.splice(t,1),Ue.skin(e,function(i){l(i.skeleton)&&i.skeleton>t&&i.skeleton--,i.joints=i.joints.map(function(r){return r>t?r-1:r})}),Ue.animation(e,function(i){Ue.animationChannel(i,function(r){l(r.target)&&l(r.target.node)&&r.target.node>t&&r.target.node--})}),Ue.technique(e,function(i){Ue.techniqueUniform(i,function(r){l(r.node)&&r.node>t&&r.node--})}),Ue.node(e,function(i){l(i.children)&&(i.children=i.children.filter(function(r){return r!==t}).map(function(r){return r>t?r-1:r}))}),Ue.scene(e,function(i){i.nodes=i.nodes.filter(function(r){return r!==t}).map(function(r){return r>t?r-1:r})})};Ap.material=function(e,t){e.materials.splice(t,1),Ue.mesh(e,function(i){Ue.meshPrimitive(i,function(r){l(r.material)&&r.material>t&&r.material--})})};Ap.sampler=function(e,t){e.samplers.splice(t,1),Ue.texture(e,function(i){l(i.sampler)&&i.sampler>t&&--i.sampler})};Ap.texture=function(e,t){if(e.textures.splice(t,1),Ue.material(e,function(i){$D(i,function(r,o){o.index>t&&--o.index})}),Jo(e,"EXT_feature_metadata")){Ue.mesh(e,function(o){Ue.meshPrimitive(o,function(s){let a=s.extensions;if(l(a)&&l(a.EXT_feature_metadata)){let u=a.EXT_feature_metadata.featureIdTextures;if(l(u)){let f=u.length;for(let d=0;d<f;++d){let g=u[d].featureIds.texture;g.index>t&&--g.index}}}})});let r=e.extensions.EXT_feature_metadata.featureTextures;for(let o in r)if(r.hasOwnProperty(o)){let a=r[o].properties;if(l(a)){for(let c in a)if(a.hasOwnProperty(c)){let f=a[c].texture;f.index>t&&--f.index}}}}if(Jo(e,"EXT_mesh_features")&&Ue.mesh(e,function(i){Ue.meshPrimitive(i,function(r){let o=r.extensions;if(l(o)&&l(o.EXT_mesh_features)){let a=o.EXT_mesh_features.featureIds;if(l(a)){let c=a.length;for(let u=0;u<c;++u){let f=a[u];l(f.texture)&&f.texture.index>t&&--f.texture.index}}}})}),Jo(e,"EXT_structural_metadata")){let r=e.extensions.EXT_structural_metadata.propertyTextures;if(l(r)){let o=r.length;for(let s=0;s<o;++s){let c=r[s].properties;for(let u in c)if(c.hasOwnProperty(u)){let f=c[u];f.index>t&&--f.index}}}}};function bp(){}bp.accessor=function(e){let t={};return Ue.mesh(e,function(n){Ue.meshPrimitive(n,function(i){Ue.meshPrimitiveAttribute(i,function(o){t[o]=!0}),Ue.meshPrimitiveTarget(i,function(o){Ue.meshPrimitiveTargetAttribute(o,function(s){t[s]=!0})});let r=i.indices;l(r)&&(t[r]=!0)})}),Ue.skin(e,function(n){l(n.inverseBindMatrices)&&(t[n.inverseBindMatrices]=!0)}),Ue.animation(e,function(n){Ue.animationSampler(n,function(i){l(i.input)&&(t[i.input]=!0),l(i.output)&&(t[i.output]=!0)})}),Jo(e,"EXT_mesh_gpu_instancing")&&Ue.node(e,function(n){l(n.extensions)&&l(n.extensions.EXT_mesh_gpu_instancing)&&Object.keys(n.extensions.EXT_mesh_gpu_instancing.attributes).forEach(function(i){let r=n.extensions.EXT_mesh_gpu_instancing.attributes[i];t[r]=!0})}),Jo(e,"CESIUM_primitive_outline")&&Ue.mesh(e,function(n){Ue.meshPrimitive(n,function(i){let r=i.extensions;if(l(r)&&l(r.CESIUM_primitive_outline)){let s=r.CESIUM_primitive_outline.indices;l(s)&&(t[s]=!0)}})}),t};bp.buffer=function(e){let t={};return Ue.bufferView(e,function(n){l(n.buffer)&&(t[n.buffer]=!0);let i=n.extensions;if(l(i)){let r=i.EXT_meshopt_compression;l(r)&&(t[r.buffer]=!0);let o=i.KHR_meshopt_compression;l(o)&&(t[o.buffer]=!0)}}),t};bp.bufferView=function(e){let t={};if(Ue.accessor(e,function(n){l(n.bufferView)&&(t[n.bufferView]=!0)}),Ue.shader(e,function(n){l(n.bufferView)&&(t[n.bufferView]=!0)}),Ue.image(e,function(n){l(n.bufferView)&&(t[n.bufferView]=!0)}),Jo(e,"KHR_draco_mesh_compression")&&Ue.mesh(e,function(n){Ue.meshPrimitive(n,function(i){l(i.extensions)&&l(i.extensions.KHR_draco_mesh_compression)&&(t[i.extensions.KHR_draco_mesh_compression.bufferView]=!0)})}),Jo(e,"EXT_feature_metadata")){let i=e.extensions.EXT_feature_metadata.featureTables;for(let r in i)if(i.hasOwnProperty(r)){let s=i[r].properties;if(l(s)){for(let a in s)if(s.hasOwnProperty(a)){let c=s[a];l(c.bufferView)&&(t[c.bufferView]=!0),l(c.arrayOffsetBufferView)&&(t[c.arrayOffsetBufferView]=!0),l(c.stringOffsetBufferView)&&(t[c.stringOffsetBufferView]=!0)}}}}if(Jo(e,"EXT_structural_metadata")){let i=e.extensions.EXT_structural_metadata.propertyTables;if(l(i)){let r=i.length;for(let o=0;o<r;++o){let a=i[o].properties;for(let c in a)if(a.hasOwnProperty(c)){let u=a[c];l(u.values)&&(t[u.values]=!0),l(u.arrayOffsets)&&(t[u.arrayOffsets]=!0),l(u.stringOffsets)&&(t[u.stringOffsets]=!0)}}}}return t};bp.image=function(e){let t={};return Ue.texture(e,function(n){l(n.source)&&(t[n.source]=!0),l(n.extensions)&&l(n.extensions.EXT_texture_webp)?t[n.extensions.EXT_texture_webp.source]=!0:l(n.extensions)&&l(n.extensions.KHR_texture_basisu)&&(t[n.extensions.KHR_texture_basisu.source]=!0)}),t};bp.mesh=function(e){let t={};return Ue.node(e,function(n){if(l(n.mesh&&l(e.meshes))){let i=e.meshes[n.mesh];l(i)&&l(i.primitives)&&i.primitives.length>0&&(t[n.mesh]=!0)}}),t};function Sye(e,t,n){let i=e.nodes[t];return l(i.mesh)||l(i.camera)||l(i.skin)||l(i.weights)||l(i.extras)||l(i.extensions)&&Object.keys(i.extensions).length!==0||l(n[t])?!1:!l(i.children)||i.children.filter(function(r){return!Sye(e,r,n)}).length===0}bp.node=function(e){let t={};return Ue.skin(e,function(n){l(n.skeleton)&&(t[n.skeleton]=!0),Ue.skinJoint(n,function(i){t[i]=!0})}),Ue.animation(e,function(n){Ue.animationChannel(n,function(i){l(i.target)&&l(i.target.node)&&(t[i.target.node]=!0)})}),Ue.technique(e,function(n){Ue.techniqueUniform(n,function(i){l(i.node)&&(t[i.node]=!0)})}),Ue.node(e,function(n,i){Sye(e,i,t)||(t[i]=!0)}),t};bp.material=function(e){let t={};return Ue.mesh(e,function(n){Ue.meshPrimitive(n,function(i){l(i.material)&&(t[i.material]=!0)})}),t};bp.texture=function(e){let t={};if(Ue.material(e,function(n){$D(n,function(i){t[i]=!0})}),Jo(e,"EXT_feature_metadata")){Ue.mesh(e,function(r){Ue.meshPrimitive(r,function(o){let s=o.extensions;if(l(s)&&l(s.EXT_feature_metadata)){let c=s.EXT_feature_metadata.featureIdTextures;if(l(c)){let u=c.length;for(let f=0;f<u;++f){let p=c[f].featureIds.texture;t[p.index]=!0}}}})});let i=e.extensions.EXT_feature_metadata.featureTextures;for(let r in i)if(i.hasOwnProperty(r)){let s=i[r].properties;if(l(s)){for(let a in s)if(s.hasOwnProperty(a)){let u=s[a].texture;t[u.index]=!0}}}}if(Jo(e,"EXT_mesh_features")&&Ue.mesh(e,function(n){Ue.meshPrimitive(n,function(i){let r=i.extensions;if(l(r)&&l(r.EXT_mesh_features)){let s=r.EXT_mesh_features.featureIds;if(l(s)){let a=s.length;for(let c=0;c<a;++c){let u=s[c];l(u.texture)&&(t[u.texture.index]=!0)}}}})}),Jo(e,"EXT_structural_metadata")){let i=e.extensions.EXT_structural_metadata.propertyTextures;if(l(i)){let r=i.length;for(let o=0;o<r;++o){let a=i[o].properties;for(let c in a)if(a.hasOwnProperty(c)){let u=a[c];t[u.index]=!0}}}}return t};bp.sampler=function(e){let t={};return Ue.texture(e,function(n){l(n.sampler)&&(t[n.sampler]=!0)}),t};var zU=get;function Aet(e,t){let n={byteLength:t.length,extras:{_pipeline:{source:t}}},r={buffer:Ma(e.buffers,n),byteOffset:0,byteLength:t.length};return Ma(e.bufferViews,r)}var VU=Aet;function bet(e,t){let n=pf(e,t),i=Y.getSizeInBytes(t.componentType),r=vd(t.type),o=t.count,s=new Array(r*o);if(!l(t.bufferView))return s.fill(0);let a=e.bufferViews[t.bufferView],c=e.buffers[a.buffer].extras._pipeline.source,u=t.byteOffset+a.byteOffset+c.byteOffset,f=new DataView(c.buffer),d=new Array(r),p=gy(t.componentType);for(let g=0;g<o;++g){p(f,u,r,i,d);for(let m=0;m<r;++m)s[g*r+m]=d[m];u+=n}return s}var jU=bet;function xet(e){let t;return Ue.accessorWithSemantic(e,"JOINTS_0",function(n){let i=e.accessors[n];t=i.componentType,t===te.BYTE?HU(e,i,Y.UNSIGNED_BYTE):t!==te.UNSIGNED_BYTE&&t!==te.UNSIGNED_SHORT&&HU(e,i,Y.UNSIGNED_SHORT)}),Ue.accessorWithSemantic(e,"WEIGHTS_0",function(n){let i=e.accessors[n];t=i.componentType,t===te.BYTE?HU(e,i,Y.UNSIGNED_BYTE):t===te.SHORT&&HU(e,i,Y.UNSIGNED_SHORT)}),e}function HU(e,t,n){let i=Y.createTypedArray(n,jU(e,t)),r=new Uint8Array(i.buffer);t.bufferView=VU(e,r),t.componentType=n,t.byteOffset=0}var GU=xet;function Tet(e,t){return Sv(e,t),t==="CESIUM_RTC"&&Eet(e),EJ(e,t)}function Eet(e){Ue.technique(e,function(t){Ue.techniqueUniform(t,function(n){n.semantic==="CESIUM_RTC_MODELVIEW"&&(n.semantic="MODELVIEW")})})}function EJ(e,t){if(Array.isArray(e)){let n=e.length;for(let i=0;i<n;++i)EJ(e[i],t)}else if(e!==null&&typeof e=="object"&&e.constructor===Object){let n=e.extensions,i;l(n)&&(i=n[t],l(i)&&(delete n[t],Object.keys(n).length===0&&delete e.extensions));for(let r in e)Object.prototype.hasOwnProperty.call(e,r)&&EJ(e[r],t);return i}}var Pv=Tet;var WU={.8:Det,"1.0":Jet,"2.0":void 0};function Cet(e,t){t=t??{};let n=t.targetVersion,i=e.version;e.asset=e.asset??{version:"1.0"},e.asset.version=e.asset.version??"1.0",i=(i??e.asset.version).toString(),Object.prototype.hasOwnProperty.call(WU,i)||(l(i)&&(i=i.substring(0,3)),Object.prototype.hasOwnProperty.call(WU,i)||(i="1.0"));let r=WU[i];for(;l(r)&&i!==n;)r(e,t),i=e.asset.version,r=WU[i];return t.keepLegacyExtensions||(ett(e,t),ttt(e)),e}function Pye(e){let t=e.materials;for(let n in t)if(Object.prototype.hasOwnProperty.call(t,n)){let i=t[n],r=i.instanceTechnique;l(r)&&(i.technique=r.technique,i.values=r.values,delete i.instanceTechnique)}}function vet(e){let t=e.meshes;for(let n in t)if(Object.prototype.hasOwnProperty.call(t,n)){let r=t[n].primitives;if(l(r)){let o=r.length;for(let s=0;s<o;++s){let a=r[s],c=a.primitive??te.TRIANGLES;a.mode=a.mode??c,delete a.primitive}}}}function wet(e){let t=e.nodes,n=new h,i=new Le;for(let r in t)if(Object.prototype.hasOwnProperty.call(t,r)){let o=t[r];if(l(o.rotation)){let a=o.rotation;h.fromArray(a,0,n),Le.fromAxisAngle(n,a[3],i),o.rotation=[i.x,i.y,i.z,i.w]}let s=o.instanceSkin;l(s)&&(o.skeletons=s.skeletons,o.skin=s.skin,o.meshes=s.meshes,delete o.instanceSkin)}}function Iet(e){let t=e.animations,n=e.accessors,i=e.bufferViews,r=e.buffers,o={},s=new h,a=new Le;for(let c in t)if(Object.prototype.hasOwnProperty.call(t,c)){let u=t[c],f=u.channels,d=u.parameters,p=u.samplers;if(l(f)){let g=f.length;for(let m=0;m<g;++m){let y=f[m];if(y.target.path==="rotation"){let A=d[p[y.sampler].output];if(l(o[A]))continue;o[A]=!0;let b=n[A],x=i[b.bufferView],E=r[x.buffer].extras._pipeline.source,v=E.byteOffset+x.byteOffset+b.byteOffset,S=b.componentType,I=b.count,R=vd(b.type),O=b.count*R,L=Y.createArrayBufferView(S,E.buffer,v,O);for(let _=0;_<I;_++){let C=_*R;h.unpack(L,C,s);let w=L[C+3];Le.fromAxisAngle(s,w,a),Le.pack(a,L,C)}}}}}}function Pet(e){let t=e.techniques;for(let n in t)if(Object.prototype.hasOwnProperty.call(t,n)){let i=t[n],r=i.passes;if(l(r)){let o=i.pass??"defaultPass";if(Object.prototype.hasOwnProperty.call(r,o)){let s=r[o],a=s.instanceProgram;i.attributes=i.attributes??a.attributes,i.program=i.program??a.program,i.uniforms=i.uniforms??a.uniforms,i.states=i.states??s.states}delete i.passes,delete i.pass}}}function Det(e){l(e.asset)||(e.asset={});let t=e.asset;if(t.version="1.0",typeof t.profile=="string"){let n=t.profile.split(" ");t.profile={api:n[0],version:n[1]}}else t.profile={};if(l(e.version)&&delete e.version,Pye(e),vet(e),wet(e),Iet(e),Pet(e),l(e.allExtensions)&&(e.extensionsUsed=e.allExtensions,delete e.allExtensions),l(e.lights)){let n=e.extensions??{};e.extensions=n;let i=n.KHR_materials_common??{};n.KHR_materials_common=i,i.lights=e.lights,delete e.lights,Vh(e,"KHR_materials_common")}}function Ret(e){let t=e.animations;for(let n in t)if(Object.prototype.hasOwnProperty.call(t,n)){let i=t[n],r=i.parameters;if(l(r)){let o=i.samplers;for(let s in o)if(Object.prototype.hasOwnProperty.call(o,s)){let a=o[s];a.input=r[a.input],a.output=r[a.output]}delete i.parameters}}}function wye(e,t){let n=[];for(let i in e)if(Object.prototype.hasOwnProperty.call(e,i)){let r=e[i];t[i]=n.length,n.push(r),l(r.name)||(r.name=i)}return n}function Oet(e){let t,n={accessors:{},animations:{},buffers:{},bufferViews:{},cameras:{},images:{},materials:{},meshes:{},nodes:{},programs:{},samplers:{},scenes:{},shaders:{},skins:{},textures:{},techniques:{}},i,r={},o=e.nodes;for(let s in o)Object.prototype.hasOwnProperty.call(o,s)&&(i=o[s].jointName,l(i)&&(r[i]=s));for(let s in e)if(Object.prototype.hasOwnProperty.call(e,s)&&l(n[s])){let a={},c=e[s];e[s]=wye(c,a),n[s]=a}for(i in r)Object.prototype.hasOwnProperty.call(r,i)&&(r[i]=n.nodes[r[i]]);l(e.scene)&&(e.scene=n.scenes[e.scene]),Ue.bufferView(e,function(s){l(s.buffer)&&(s.buffer=n.buffers[s.buffer])}),Ue.accessor(e,function(s){l(s.bufferView)&&(s.bufferView=n.bufferViews[s.bufferView])}),Ue.shader(e,function(s){let a=s.extensions;if(l(a)){let c=a.KHR_binary_glTF;l(c)&&(s.bufferView=n.bufferViews[c.bufferView],delete a.KHR_binary_glTF),Object.keys(a).length===0&&delete s.extensions}}),Ue.program(e,function(s){l(s.vertexShader)&&(s.vertexShader=n.shaders[s.vertexShader]),l(s.fragmentShader)&&(s.fragmentShader=n.shaders[s.fragmentShader])}),Ue.technique(e,function(s){l(s.program)&&(s.program=n.programs[s.program]),Ue.techniqueParameter(s,function(a){l(a.node)&&(a.node=n.nodes[a.node]);let c=a.value;typeof c=="string"&&(a.value={index:n.textures[c]})})}),Ue.mesh(e,function(s){Ue.meshPrimitive(s,function(a){l(a.indices)&&(a.indices=n.accessors[a.indices]),Ue.meshPrimitiveAttribute(a,function(c,u){a.attributes[u]=n.accessors[c]}),l(a.material)&&(a.material=n.materials[a.material])})}),Ue.node(e,function(s){let a=s.children;if(l(a)){let c=a.length;for(t=0;t<c;++t)a[t]=n.nodes[a[t]]}if(l(s.meshes)){let c=s.meshes,u=c.length;if(u>0)for(s.mesh=n.meshes[c[0]],t=1;t<u;++t){let f={mesh:n.meshes[c[t]]},d=Ma(e.nodes,f);l(a)||(a=[],s.children=a),a.push(d)}delete s.meshes}if(l(s.camera)&&(s.camera=n.cameras[s.camera]),l(s.skin)&&(s.skin=n.skins[s.skin]),l(s.skeletons)){let c=s.skeletons;if(c.length>0&&l(s.skin)){let f=e.skins[s.skin];f.skeleton=n.nodes[c[0]]}delete s.skeletons}l(s.jointName)&&delete s.jointName}),Ue.skin(e,function(s){l(s.inverseBindMatrices)&&(s.inverseBindMatrices=n.accessors[s.inverseBindMatrices]);let a=s.jointNames;if(l(a)){let c=[],u=a.length;for(t=0;t<u;++t)c[t]=r[a[t]];s.joints=c,delete s.jointNames}}),Ue.scene(e,function(s){let a=s.nodes;if(l(a)){let c=a.length;for(t=0;t<c;++t)a[t]=n.nodes[a[t]]}}),Ue.animation(e,function(s){let a={};s.samplers=wye(s.samplers,a),Ue.animationSampler(s,function(c){c.input=n.accessors[c.input],c.output=n.accessors[c.output]}),Ue.animationChannel(s,function(c){c.sampler=a[c.sampler];let u=c.target;l(u)&&(u.node=n.nodes[u.id],delete u.id)})}),Ue.material(e,function(s){l(s.technique)&&(s.technique=n.techniques[s.technique]),Ue.materialValue(s,function(c,u){typeof c=="string"&&(s.values[u]={index:n.textures[c]})});let a=s.extensions;if(l(a)){let c=a.KHR_materials_common;l(c)&&l(c.values)&&Ue.materialValue(c,function(u,f){typeof u=="string"&&(c.values[f]={index:n.textures[u]})})}}),Ue.image(e,function(s){let a=s.extensions;if(l(a)){let c=a.KHR_binary_glTF;l(c)&&(s.bufferView=n.bufferViews[c.bufferView],s.mimeType=c.mimeType,delete a.KHR_binary_glTF),Object.keys(a).length===0&&delete s.extensions}}),Ue.texture(e,function(s){l(s.sampler)&&(s.sampler=n.samplers[s.sampler]),l(s.source)&&(s.source=n.images[s.source])})}function Met(e){Ue.animation(e,function(t){Ue.animationSampler(t,function(n){delete n.name})})}function Net(e){for(let t in e)if(Object.prototype.hasOwnProperty.call(e,t)){let n=e[t];Array.isArray(n)&&n.length===0&&delete e[t]}Ue.node(e,function(t){l(t.children)&&t.children.length===0&&delete t.children})}function Let(e){let t=e.asset;delete t.profile,delete t.premultipliedAlpha}var Fet={CESIUM_RTC:!0,KHR_materials_common:!0,WEB3D_quantized_attributes:!0};function Bet(e){let t=e.extensionsUsed;if(e.extensionsRequired=e.extensionsRequired??[],l(t)){let n=t.length;for(let i=0;i<n;++i){let r=t[i];l(Fet[r])&&e.extensionsRequired.push(r)}}}function ket(e){Ue.buffer(e,function(t){delete t.type})}function Uet(e){Ue.texture(e,function(t){delete t.format,delete t.internalFormat,delete t.target,delete t.type})}function zet(e){Ue.mesh(e,function(t){Ue.meshPrimitive(t,function(n){Ue.meshPrimitiveAttribute(n,function(i,r){r==="TEXCOORD"?n.attributes.TEXCOORD_0=i:r==="COLOR"&&(n.attributes.COLOR_0=i)}),delete n.attributes.TEXCOORD,delete n.attributes.COLOR})}),Ue.technique(e,function(t){Ue.techniqueParameter(t,function(n){let i=n.semantic;l(i)&&(i==="TEXCOORD"?n.semantic="TEXCOORD_0":i==="COLOR"&&(n.semantic="COLOR_0"))})})}var Vet={POSITION:!0,NORMAL:!0,TANGENT:!0},jet={COLOR:"COLOR",JOINT:"JOINTS",JOINTS:"JOINTS",TEXCOORD:"TEXCOORD",WEIGHT:"WEIGHTS",WEIGHTS:"WEIGHTS"};function Het(e){let t={};Ue.mesh(e,function(n){Ue.meshPrimitive(n,function(i){Ue.meshPrimitiveAttribute(i,function(r,o){if(o.charAt(0)!=="_"){let s=o.search(/_[0-9]+/g),a=o,c="_0";s>=0&&(a=o.substring(0,s),c=o.substring(s));let u,f=jet[a];l(f)?(u=f+c,t[o]=u):l(Vet[a])||(u=`_${o}`,t[o]=u)}});for(let r in t)if(Object.prototype.hasOwnProperty.call(t,r)){let o=t[r],s=i.attributes[r];l(s)&&(delete i.attributes[r],i.attributes[o]=s)}})}),Ue.technique(e,function(n){Ue.techniqueParameter(n,function(i){let r=t[i.semantic];l(r)&&(i.semantic=r)})})}function Get(e){Ue.camera(e,function(t){let n=t.perspective;if(l(n)){let i=n.aspectRatio;l(i)&&i===0&&delete n.aspectRatio;let r=n.yfov;l(r)&&r===0&&(n.yfov=1)}})}function vJ(e,t){return l(t.byteStride)&&t.byteStride!==0?t.byteStride:pf(e,t)}function Wet(e){Ue.buffer(e,function(t){l(t.byteLength)||(t.byteLength=t.extras._pipeline.source.length)}),Ue.accessor(e,function(t){let n=t.bufferView;if(l(n)){let i=e.bufferViews[n],r=vJ(e,t),o=t.byteOffset+t.count*r;i.byteLength=Math.max(i.byteLength??0,o)}})}function qet(e){let t,n,i,r=e.bufferViews,o={};Ue.accessorContainingVertexAttributeData(e,function(a){let c=e.accessors[a];l(c.bufferView)&&(o[c.bufferView]=!0)});let s={};Ue.accessor(e,function(a){l(a.bufferView)&&(s[a.bufferView]=s[a.bufferView]??[],s[a.bufferView].push(a))});for(let a in s)if(Object.prototype.hasOwnProperty.call(s,a)){i=r[a];let c=s[a];c.sort(function(p,g){return p.byteOffset-g.byteOffset});let u=0,f=0,d=c.length;for(t=0;t<d;++t){let p=c[t],g=vJ(e,p),m=p.byteOffset,y=p.count*g;delete p.byteStride;let A=t<d-1,b=A?vJ(e,c[t+1]):void 0;if(g!==b){let x=Ze(i,!0);o[a]&&(x.byteStride=g),x.byteOffset+=u,x.byteLength=m+y-u;let T=Ma(r,x);for(n=f;n<=t;++n)p=c[n],p.bufferView=T,p.byteOffset=p.byteOffset-u;u=A?c[t+1].byteOffset:void 0,f=t+1}}}zU(e,["accessor","bufferView","buffer"])}function Yet(e){Ue.accessorWithSemantic(e,"POSITION",function(t){let n=e.accessors[t];if(!l(n.min)||!l(n.max)){let i=Iv(e,n);n.min=i.min,n.max=i.max}})}function Dye(e){return(!l(e.children)||e.children.length===0)&&(!l(e.meshes)||e.meshes.length===0)&&!l(e.camera)&&!l(e.skin)&&!l(e.skeletons)&&!l(e.jointName)&&(!l(e.translation)||h.fromArray(e.translation).equals(h.ZERO))&&(!l(e.scale)||h.fromArray(e.scale).equals(new h(1,1,1)))&&(!l(e.rotation)||se.fromArray(e.rotation).equals(new se(0,0,0,1)))&&(!l(e.matrix)||M.fromColumnMajorArray(e.matrix).equals(M.IDENTITY))&&!l(e.extensions)&&!l(e.extras)}function Rye(e,t){Ue.scene(e,function(n){let i=n.nodes;if(l(i)){let r=i.length;for(let o=r;o>=0;--o)if(i[o]===t){i.splice(o,1);return}}}),Ue.node(e,function(n,i){if(l(n.children)){let r=n.children.indexOf(t);r>-1&&(n.children.splice(r,1),Dye(n)&&Rye(e,i))}}),delete e.nodes[t]}function Xet(e){return Ue.node(e,function(t,n){Dye(t)&&Rye(e,n)}),e}function Ket(e){Ue.animation(e,function(t){Ue.animationSampler(t,function(n){let i=e.accessors[n.input];if(!l(i.min)||!l(i.max)){let r=Iv(e,i);i.min=r.min,i.max=r.max}})})}function $et(e){Ue.accessor(e,function(t){if(l(t.min)||l(t.max)){let n=Iv(e,t);l(t.min)&&(t.min=n.min),l(t.max)&&(t.max=n.max)}})}function Jet(e){e.asset=e.asset??{},e.asset.version="2.0",Pye(e),Ret(e),Xet(e),Oet(e),Met(e),Let(e),Bet(e),Wet(e),qet(e),Yet(e),Ket(e),$et(e),ket(e),Uet(e),zet(e),Het(e),GU(e),Get(e),BU(e),UU(e),Net(e)}var Zet=["u_tex","u_diffuse","u_emission","u_diffuse_tex"],Qet=["u_diffuse","u_diffuse_mat"];function SJ(e){e.pbrMetallicRoughness=l(e.pbrMetallicRoughness)?e.pbrMetallicRoughness:{},e.pbrMetallicRoughness.roughnessFactor=1,e.pbrMetallicRoughness.metallicFactor=0}function wJ(e){return l(e.index)}function IJ(e){return Array.isArray(e)&&e.length===4}function Oye(e){let t=new Array(4);t[3]=e[3];for(let n=0;n<3;n++){let i=e[n];i<=.04045?t[n]=e[n]*.07739938080495357:t[n]=Math.pow((i+.055)*.9478672985781991,2.4)}return t}function ett(e,t){t=t??{};let n=t.baseColorTextureNames??Zet,i=t.baseColorFactorNames??Qet;Ue.material(e,function(r){Ue.materialValue(r,function(o,s){n.indexOf(s)!==-1&&wJ(o)?(SJ(r),r.pbrMetallicRoughness.baseColorTexture=o):i.indexOf(s)!==-1&&IJ(o)&&(SJ(r),r.pbrMetallicRoughness.baseColorFactor=Oye(o))})}),Pv(e,"KHR_techniques_webgl"),Pv(e,"KHR_blend")}function CJ(e,t){l(t)&&(IJ(t)?e.pbrMetallicRoughness.baseColorFactor=Oye(t):wJ(t)&&(e.pbrMetallicRoughness.baseColorTexture=t))}function Iye(e,t){l(t)&&(IJ(t)?e.emissiveFactor=t.slice(0,3):wJ(t)&&(e.emissiveTexture=t))}function ttt(e){Ue.material(e,function(t){let n=(t.extensions??{}).KHR_materials_common;if(!l(n))return;let i=n.values??{},r=i.ambient,o=i.diffuse,s=i.emission,a=i.transparency,c=n.doubleSided,u=n.transparent;SJ(t),n.technique==="CONSTANT"?(Vh(e,"KHR_materials_unlit"),t.extensions=l(t.extensions)?t.extensions:{},t.extensions.KHR_materials_unlit={},CJ(t,s),CJ(t,r)):(CJ(t,o),Iye(t,r),Iye(t,s)),l(c)&&(t.doubleSided=c),l(a)&&(l(t.pbrMetallicRoughness.baseColorFactor)?t.pbrMetallicRoughness.baseColorFactor[3]*=a:t.pbrMetallicRoughness.baseColorFactor=[1,1,1,a]),l(u)&&(t.alphaMode=u?"BLEND":"OPAQUE")}),Pv(e,"KHR_materials_common")}var qU=Cet;var xp={X:0,Y:1,Z:2};xp.Y_UP_TO_Z_UP=M.fromRotationTranslation($.fromArray([1,0,0,0,0,1,0,-1,0]));xp.Z_UP_TO_Y_UP=M.fromRotationTranslation($.fromArray([1,0,0,0,0,-1,0,1,0]));xp.X_UP_TO_Z_UP=M.fromRotationTranslation($.fromArray([0,0,1,0,1,0,-1,0,0]));xp.Z_UP_TO_X_UP=M.fromRotationTranslation($.fromArray([0,0,-1,0,1,0,1,0,0]));xp.X_UP_TO_Y_UP=M.fromRotationTranslation($.fromArray([0,1,0,-1,0,0,0,0,1]));xp.Y_UP_TO_X_UP=M.fromRotationTranslation($.fromArray([0,-1,0,1,0,0,0,0,1]));xp.fromName=function(e){return xp[e]};Object.freeze(xp);var qi=xp;function Qc(){}Qc.getError=function(e,t,n){let i=`Failed to load ${e}: ${t}`;l(n)&&l(n.message)&&(i+=` ${n.message}`);let r=new oe(i);return l(n)&&(r.stack=`Original stack: ${n.stack} Handler stack: -${r.stack}`),r};Kc.getNodeTransform=function(e){return l(e.matrix)?e.matrix:M.fromTranslationQuaternionRotationScale(l(e.translation)?e.translation:h.ZERO,l(e.rotation)?e.rotation:Le.IDENTITY,l(e.scale)?e.scale:h.ONE)};Kc.getAttributeBySemantic=function(e,t,n){let i=e.attributes,r=i.length;for(let o=0;o<r;++o){let s=i[o],a=l(n)?s.setIndex===n:!0;if(s.semantic===t&&a)return s}};Kc.getAttributeByName=function(e,t){let n=e.attributes,i=n.length;for(let r=0;r<i;++r){let o=n[r];if(o.name===t)return o}};Kc.getFeatureIdsByLabel=function(e,t){for(let n=0;n<e.length;n++){let i=e[n];if(i.positionalLabel===t||i.label===t)return i}};Kc.hasQuantizedAttributes=function(e){if(!l(e))return!1;for(let t=0;t<e.length;t++){let n=e[t];if(l(n.quantization))return!0}return!1};Kc.getAttributeInfo=function(e){let t=e.semantic,n=e.setIndex,i,r=!1;l(t)?(i=ct.getVariableName(t,n),r=!0):(i=e.name,i=i.replace(/^_/,""),i=i.toLowerCase());let o=/^color_\d+$/.test(i),s=e.type,a=Vt.getGlslType(s);o&&(a="vec4");let c=l(e.quantization),u;return c&&(u=o?"vec4":Vt.getGlslType(e.quantization.type)),{attribute:e,isQuantized:c,variableName:i,hasSemantic:r,glslType:a,quantizedGlslType:u}};var oKe=new h,sKe=new h;Kc.getPositionMinMax=function(e,t,n){let i=Kc.getAttributeBySemantic(e,"POSITION"),r=i.max,o=i.min;return l(n)&&l(t)&&(o=h.add(o,t,sKe),r=h.add(r,n,oKe)),{min:o,max:r}};Kc.getAxisCorrectionMatrix=function(e,t,n){return n=M.clone(M.IDENTITY,n),e===qi.Y?n=M.clone(qi.Y_UP_TO_Z_UP,n):e===qi.X&&(n=M.clone(qi.X_UP_TO_Z_UP,n)),t===qi.Z&&(n=M.multiplyTransformation(n,qi.Z_UP_TO_X_UP,n)),n};var aKe=new $;Kc.getCullFace=function(e,t){if(!Oe.isTriangles(t))return Gi.BACK;let n=M.getMatrix3(e,aKe);return $.determinant(n)<0?Gi.FRONT:Gi.BACK};Kc.sanitizeGlslIdentifier=function(e){let t=e.replaceAll(/[^A-Za-z0-9]+/g,"_");return t=t.replace(/^gl_/,""),/^\d/.test(t)&&(t=`_${t}`),t};Kc.supportedExtensions={AGI_articulations:!0,CESIUM_mesh_vector:!0,CESIUM_primitive_outline:!0,CESIUM_RTC:!0,EXT_feature_metadata:!0,EXT_implicit_cylinder_region:!0,EXT_implicit_ellipsoid_region:!0,EXT_instance_features:!0,EXT_mesh_features:!0,EXT_mesh_gpu_instancing:!0,EXT_mesh_polygon:!0,EXT_mesh_primitive_edge_visibility:!0,EXT_meshopt_compression:!0,EXT_primitive_voxels:!0,EXT_structural_metadata:!0,EXT_texture_webp:!0,KHR_blend:!0,KHR_draco_mesh_compression:!0,KHR_implicit_shapes:!0,KHR_materials_common:!0,KHR_materials_pbrSpecularGlossiness:!0,KHR_materials_specular:!0,KHR_materials_anisotropy:!0,KHR_materials_clearcoat:!0,KHR_materials_unlit:!0,KHR_mesh_quantization:!0,KHR_mesh_primitive_restart:!0,KHR_meshopt_compression:!0,KHR_techniques_webgl:!0,KHR_texture_basisu:!0,KHR_texture_transform:!0,KHR_gaussian_splatting:!0,KHR_gaussian_splatting_compression_spz_2:!0,WEB3D_quantized_attributes:!0};Kc.checkSupportedExtensions=function(e){let t=e.length;for(let n=0;n<t;n++){let i=e[n];if(!Kc.supportedExtensions[i])throw new oe(`Unsupported glTF Extension: ${i}`)}};var xt=Kc;var zK=class extends ar{constructor(t){super(),t=t??H.EMPTY_OBJECT;let n=t.resourceCache,i=t.gltfResource,r=t.baseResource,o=t.typedArray,s=t.gltfJson,a=t.cacheKey;this._resourceCache=n,this._gltfResource=i,this._baseResource=r,this._typedArray=o,this._gltfJson=s,this._cacheKey=a,this._gltf=void 0,this._bufferLoaders=[],this._state=Ct.UNLOADED,this._promise=void 0}get cacheKey(){return this._cacheKey}get gltf(){return this._gltf}async load(){return l(this._promise)?this._promise:(this._state=Ct.LOADING,l(this._gltfJson)?(this._promise=Qme(this,this._gltfJson),this._promise):l(this._typedArray)?(this._promise=epe(this,this._typedArray),this._promise):(this._promise=cKe(this),this._promise))}unload(){let t=this._bufferLoaders,n=t.length;for(let i=0;i<n;++i)t[i]=!t[i].isDestroyed()&&this._resourceCache.unload(t[i]);this._bufferLoaders.length=0,this._gltf=void 0}_fetchGltf(){return this._gltfResource.fetchArrayBuffer()}};async function cKe(e){let t;try{let n=await e._fetchGltf();if(e.isDestroyed())return;t=new Uint8Array(n)}catch(n){if(e.isDestroyed())return;VK(e,n)}return epe(e,t)}function VK(e,t){e.unload(),e._state=Ct.FAILED;let n=`Failed to load glTF: ${e._gltfResource.url}`;throw e.getError(n,t)}async function lKe(e,t){if(l(t.asset)&&t.asset.version==="2.0"&&!Ko(t,"KHR_techniques_webgl")&&!Ko(t,"KHR_materials_common"))return Promise.resolve();let n=[];Ue.buffer(t,function(i){if(!l(i.extras._pipeline.source)&&l(i.uri)){let r=e._baseResource.getDerivedResource({url:i.uri}),s=e._resourceCache.getExternalBufferLoader({resource:r});e._bufferLoaders.push(s),n.push(s.load().then(function(){s.isDestroyed()||(i.extras._pipeline.source=s.typedArray)}))}}),await Promise.all(n),P3(t)}function uKe(e){let t=[];return Ue.buffer(e,function(n){let i=n.uri;!l(n.extras._pipeline.source)&&l(i)&&Um(i)&&(delete n.uri,t.push(De.fetchArrayBuffer(i).then(function(r){n.extras._pipeline.source=new Uint8Array(r)})))}),Promise.all(t)}function fKe(e,t){let n=[];return Ue.buffer(t,function(i,r){let o=i.extras._pipeline.source;if(l(o)&&!l(i.uri)){let a=e._resourceCache.getEmbeddedBufferLoader({parentResource:e._gltfResource,bufferId:r,typedArray:o});e._bufferLoaders.push(a),n.push(a.load())}}),Promise.all(n)}async function Qme(e,t){try{Qb(t),await uKe(t),await lKe(e,t),p3(t),await fKe(e,t),A3(t);let n=t.asset.version;if(n!=="1.0"&&n!=="2.0")throw new oe(`Unsupported glTF version: ${n}`);let i=t.extensionsRequired;return l(i)&&xt.checkSupportedExtensions(i),e._gltf=t,e._state=Ct.READY,e}catch(n){if(e.isDestroyed())return;VK(e,n)}}async function epe(e,t){let n;try{cp(t)==="glTF"?n=RC(t):n=No(t)}catch(i){if(e.isDestroyed())return;VK(e,i)}return Qme(e,n)}var pD=zK;var tpe={OPAQUE:"OPAQUE",MASK:"MASK",BLEND:"BLEND"};Object.freeze(tpe);var Q0=tpe;var Sr={},jK=class{constructor(){this.octEncoded=!1,this.octEncodedZXY=!1,this.normalizationRange=void 0,this.quantizedVolumeOffset=void 0,this.quantizedVolumeDimensions=void 0,this.quantizedVolumeStepSize=void 0,this.componentDatatype=void 0,this.type=void 0}},HK=class{constructor(){this.name=void 0,this.semantic=void 0,this.setIndex=void 0,this.componentDatatype=void 0,this.type=void 0,this.normalized=!1,this.count=void 0,this.min=void 0,this.max=void 0,this.constant=void 0,this.quantization=void 0,this.typedArray=void 0,this.buffer=void 0,this.byteOffset=0,this.byteStride=void 0}},GK=class{constructor(){this.indexDatatype=void 0,this.count=void 0,this.buffer=void 0,this.typedArray=void 0}},WK=class{constructor(){this.featureCount=void 0,this.nullFeatureId=void 0,this.propertyTableId=void 0,this.setIndex=void 0,this.label=void 0,this.positionalLabel=void 0}},qK=class{constructor(){this.featureCount=void 0,this.nullFeatureId=void 0,this.propertyTableId=void 0,this.offset=0,this.repeat=void 0,this.label=void 0,this.positionalLabel=void 0}},YK=class{constructor(){this.featureCount=void 0,this.nullFeatureId=void 0,this.propertyTableId=void 0,this.textureReader=void 0,this.label=void 0,this.positionalLabel=void 0}},XK=class{constructor(){this.attributes=[]}},KK=class{constructor(){this.attributes=[],this.morphTargets=[],this.indices=void 0,this.material=void 0,this.primitiveType=void 0,this.polygon=void 0,this.vector=void 0,this.featureIds=[],this.propertyTextureIds=[],this.propertyAttributeIds=[],this.outlineCoordinates=void 0,this.modelPrimitiveImagery=void 0,this.edgeVisibility=void 0}},$K=class{constructor(){this.attributes=[],this.featureIds=[],this.transformInWorldSpace=!1}},JK=class{constructor(){this.index=void 0,this.joints=[],this.inverseBindMatrices=[]}},ZK=class{constructor(){this.name=void 0,this.index=void 0,this.children=[],this.primitives=[],this.instances=void 0,this.skin=void 0,this.matrix=void 0,this.translation=void 0,this.rotation=void 0,this.scale=void 0,this.morphWeights=[],this.articulationName=void 0,this.meshVector=void 0}},QK=class{constructor(){this.nodes=[]}},dKe={TRANSLATION:"translation",ROTATION:"rotation",SCALE:"scale",WEIGHTS:"weights"},e$=class{constructor(){this.input=[],this.interpolation=void 0,this.output=[]}},t$=class{constructor(){this.node=void 0,this.path=void 0}},n$=class{constructor(){this.sampler=void 0,this.target=void 0}},i$=class{constructor(){this.name=void 0,this.samplers=[],this.channels=[]}},r$=class{constructor(){this.name=void 0,this.type=void 0,this.minimumValue=void 0,this.maximumValue=void 0,this.initialValue=void 0}},o$=class{constructor(){this.name=void 0,this.stages=[]}},D3=class{constructor(){this.credits=[]}},s$=class{constructor(){this.asset=new D3,this.scene=void 0,this.nodes=[],this.skins=[],this.animations=[],this.articulations=[],this.structuralMetadata=void 0,this.upAxis=void 0,this.forwardAxis=void 0,this.transform=M.clone(M.IDENTITY),this.extensions={}}},a$=class{constructor(){this.texture=void 0,this.index=void 0,this.texCoord=0,this.transform=$.clone($.IDENTITY),this.scale=1,this.channels=void 0,this.constantLod=void 0}},hy=class hy{constructor(){this.baseColorTexture=void 0,this.metallicRoughnessTexture=void 0,this.baseColorFactor=se.clone(hy.DEFAULT_BASE_COLOR_FACTOR),this.metallicFactor=hy.DEFAULT_METALLIC_FACTOR,this.roughnessFactor=hy.DEFAULT_ROUGHNESS_FACTOR}};ut(hy,"DEFAULT_BASE_COLOR_FACTOR",se.ONE),ut(hy,"DEFAULT_METALLIC_FACTOR",1),ut(hy,"DEFAULT_ROUGHNESS_FACTOR",1);var R3=hy,my=class my{constructor(){this.diffuseTexture=void 0,this.specularGlossinessTexture=void 0,this.diffuseFactor=se.clone(my.DEFAULT_DIFFUSE_FACTOR),this.specularFactor=h.clone(my.DEFAULT_SPECULAR_FACTOR),this.glossinessFactor=my.DEFAULT_GLOSSINESS_FACTOR}};ut(my,"DEFAULT_DIFFUSE_FACTOR",se.ONE),ut(my,"DEFAULT_SPECULAR_FACTOR",h.ONE),ut(my,"DEFAULT_GLOSSINESS_FACTOR",1);var c$=my,NC=class NC{constructor(){this.specularFactor=NC.DEFAULT_SPECULAR_FACTOR,this.specularTexture=void 0,this.specularColorFactor=h.clone(NC.DEFAULT_SPECULAR_COLOR_FACTOR),this.specularColorTexture=void 0}};ut(NC,"DEFAULT_SPECULAR_FACTOR",1),ut(NC,"DEFAULT_SPECULAR_COLOR_FACTOR",h.ONE);var l$=NC,LC=class LC{constructor(){this.anisotropyStrength=LC.DEFAULT_ANISOTROPY_STRENGTH,this.anisotropyRotation=LC.DEFAULT_ANISOTROPY_ROTATION,this.anisotropyTexture=void 0}};ut(LC,"DEFAULT_ANISOTROPY_STRENGTH",0),ut(LC,"DEFAULT_ANISOTROPY_ROTATION",0);var u$=LC,FC=class FC{constructor(){this.clearcoatFactor=FC.DEFAULT_CLEARCOAT_FACTOR,this.clearcoatTexture=void 0,this.clearcoatRoughnessFactor=FC.DEFAULT_CLEARCOAT_ROUGHNESS_FACTOR,this.clearcoatRoughnessTexture=void 0,this.clearcoatNormalTexture=void 0}};ut(FC,"DEFAULT_CLEARCOAT_FACTOR",0),ut(FC,"DEFAULT_CLEARCOAT_ROUGHNESS_FACTOR",0);var f$=FC,d$=class{constructor(){ut(this,"width");ut(this,"pattern")}},O3=class O3{constructor(t={}){let{wireframeFill:n=O3.DEFAULT_WIREFRAME_FILL,backgroundFill:i=!1,behind:r=!1}=t;this.wireframeFill=n,this.backgroundFill=i,this.behind=r}};ut(O3,"DEFAULT_WIREFRAME_FILL",0);var h$=O3,M3=class M3{constructor(){this.metallicRoughness=new R3,this.specularGlossiness=void 0,this.specular=void 0,this.anisotropy=void 0,this.clearcoat=void 0,this.emissiveTexture=void 0,this.normalTexture=void 0,this.occlusionTexture=void 0,this.emissiveFactor=h.clone(M3.DEFAULT_EMISSIVE_FACTOR),this.alphaMode=Q0.OPAQUE,this.alphaCutoff=.5,this.doubleSided=!1,this.unlit=!1,this.pointDiameter=void 0,this.planarFill=void 0,this.lineStyle=void 0}};ut(M3,"DEFAULT_EMISSIVE_FACTOR",h.ZERO);var m$=M3,p$=class{constructor(){ut(this,"count",0);ut(this,"triangleIndices");ut(this,"triangleIndicesOffsets");ut(this,"loopIndices");ut(this,"loopIndicesOffsets")}},g$=class{constructor(){ut(this,"vector",!0);ut(this,"count",0);ut(this,"polygonAttributeOffsets");ut(this,"polygonHoleCounts");ut(this,"polygonHoleOffsets");ut(this,"polygonIndicesOffsets")}};Sr.Quantization=jK;Sr.Attribute=HK;Sr.Indices=GK;Sr.FeatureIdAttribute=WK;Sr.FeatureIdTexture=YK;Sr.FeatureIdImplicitRange=qK;Sr.MorphTarget=XK;Sr.Primitive=KK;Sr.Instances=$K;Sr.Skin=JK;Sr.Node=ZK;Sr.Scene=QK;Sr.AnimatedPropertyType=Object.freeze(dKe);Sr.AnimationSampler=e$;Sr.AnimationTarget=t$;Sr.AnimationChannel=n$;Sr.Animation=i$;Sr.ArticulationStage=r$;Sr.Articulation=o$;Sr.Asset=D3;Sr.Components=s$;Sr.TextureReader=a$;Sr.MetallicRoughness=R3;Sr.SpecularGlossiness=c$;Sr.Specular=l$;Sr.Anisotropy=u$;Sr.Clearcoat=f$;Sr.PlanarFill=h$;Sr.LineStyle=d$;Sr.Material=m$;Sr.Vector=g$;Sr.Polygon=p$;var vn=Sr;var N3={};N3.getImageIdFromTexture=function(e){e=e??H.EMPTY_OBJECT;let{gltf:t,textureId:n,supportedImageFormats:i}=e,r=t.textures[n],o=r.extensions;if(l(o)){if(i.webp&&l(o.EXT_texture_webp))return o.EXT_texture_webp.source;if(i.basis&&l(o.KHR_texture_basisu))return o.KHR_texture_basisu.source}return r.source};N3.createSampler=function(e){e=e??H.EMPTY_OBJECT;let{gltf:t,textureInfo:n,compressedTextureNoMipmap:i=!1}=e,r=hn.REPEAT,o=hn.REPEAT,s=Wt.LINEAR,a=Jn.LINEAR,c=n.index,f=t.textures[c].sampler;if(l(f)){let d=t.samplers[f];r=d.wrapS??r,o=d.wrapT??o,s=d.minFilter??s,a=d.magFilter??a}return i&&s!==Wt.LINEAR&&s!==Wt.NEAREST&&(s===Wt.NEAREST_MIPMAP_NEAREST||s===Wt.NEAREST_MIPMAP_LINEAR?s=Wt.NEAREST:s=Wt.LINEAR),hn.validate(r)||(r=hn.REPEAT),hn.validate(o)||(o=hn.REPEAT),Wt.validate(s)||(s=Wt.LINEAR),Jn.validate(a)||(a=Jn.LINEAR),new Ht({wrapS:r,wrapT:o,minificationFilter:s,magnificationFilter:a})};var hKe=new U(1,1);N3.createModelTextureReader=function(e){e=e??H.EMPTY_OBJECT;let{textureInfo:t,channels:n,texture:i}=e,r=t.texCoord??0,o,s=t.extensions?.KHR_texture_transform;if(l(s)){r=s.texCoord??r;let u=l(s.offset)?U.unpack(s.offset):U.ZERO,f=s.rotation??0,d=l(s.scale)?U.unpack(s.scale):hKe;f=-f,o=new $(Math.cos(f)*d.x,-Math.sin(f)*d.y,u.x,Math.sin(f)*d.x,Math.cos(f)*d.y,u.y,0,0,1)}let a=new vn.TextureReader;a.index=t.index,a.texture=i,a.texCoord=r,a.scale=t.scale,a.transform=o,a.channels=n;let c=t.extensions?.EXT_textureInfo_constant_lod;return l(c)&&(a.constantLod={repetitions:c.repetitions??1,offset:l(c.offset)?U.unpack(c.offset):U.ZERO,minClampDistance:c.minClampDistance??1,maxClampDistance:c.maxClampDistance??4294967296}),a};var pf=N3;function mKe(e){let t=document.createElement("canvas");return t.width=P.nextPowerOfTwo(e.width),t.height=P.nextPowerOfTwo(e.height),t.getContext("2d").drawImage(e,0,0,e.width,e.height,0,0,t.width,t.height),t}var ex=mKe;var _$=class extends ar{constructor(t){super(),t=t??H.EMPTY_OBJECT;let n=t.resourceCache,i=t.gltf,r=t.textureInfo,o=t.gltfResource,s=t.baseResource,a=t.supportedImageFormats,c=t.cacheKey,u=t.asynchronous??!0,f=r.index,d=pf.getImageIdFromTexture({gltf:i,textureId:f,supportedImageFormats:a});this._resourceCache=n,this._gltf=i,this._textureInfo=r,this._imageId=d,this._gltfResource=o,this._baseResource=s,this._cacheKey=c,this._asynchronous=u,this._imageLoader=void 0,this._image=void 0,this._mipLevels=void 0,this._texture=void 0,this._state=Ct.UNLOADED,this._promise=void 0}get cacheKey(){return this._cacheKey}get texture(){return this._texture}async load(){return l(this._promise)?this._promise:(this._state=Ct.LOADING,this._promise=gKe(this),this._promise)}process(t){if(this._state===Ct.READY)return!0;if(this._state!==Ct.LOADED&&this._state!==Ct.PROCESSING||l(this._texture)||!l(this._image))return!1;this._state=Ct.PROCESSING;let n;if(this._asynchronous){let i=pKe;if(i.set(this._gltf,this._textureInfo,this._cacheKey,this._image,this._mipLevels,t.context),!t.jobScheduler.execute(i,Xc.TEXTURE))return!1;n=i.texture}else n=npe(this._gltf,this._textureInfo,this._cacheKey,this._image,this._mipLevels,t.context);return this.unload(),this._texture=n,this._state=Ct.READY,this._resourceCache.statistics.addTextureLoader(this),!0}unload(){l(this._texture)&&this._texture.destroy(),l(this._imageLoader)&&!this._imageLoader.isDestroyed()&&this._resourceCache.unload(this._imageLoader),this._imageLoader=void 0,this._image=void 0,this._mipLevels=void 0,this._texture=void 0,this._gltf=void 0}},y$=class{constructor(){this.gltf=void 0,this.textureInfo=void 0,this.textureId=void 0,this.image=void 0,this.context=void 0,this.texture=void 0}set(t,n,i,r,o,s){this.gltf=t,this.textureInfo=n,this.textureId=i,this.image=r,this.mipLevels=o,this.context=s}execute(){this.texture=npe(this.gltf,this.textureInfo,this.textureId,this.image,this.mipLevels,this.context)}};function npe(e,t,n,i,r,o){let s=i.internalFormat,a=!1;$e.isCompressedFormat(s)&&!l(r)&&(a=!0);let c=pf.createSampler({gltf:e,textureInfo:t,compressedTextureNoMipmap:a}),u=c.minificationFilter,f=c.wrapS,d=c.wrapT,p=u===Wt.NEAREST_MIPMAP_NEAREST||u===Wt.NEAREST_MIPMAP_LINEAR||u===Wt.LINEAR_MIPMAP_NEAREST||u===Wt.LINEAR_MIPMAP_LINEAR,g=!l(s)&&p,m=g||f===hn.REPEAT||f===hn.MIRRORED_REPEAT||d===hn.REPEAT||d===hn.MIRRORED_REPEAT,y=!P.isPowerOfTwo(i.width)||!P.isPowerOfTwo(i.height),A=m&&y,b;return l(s)?(!o.webgl2&&$e.isCompressedFormat(s)&&y&&m&&console.warn("Compressed texture uses REPEAT or MIRRORED_REPEAT texture wrap mode and dimensions are not powers of two. The texture may be rendered incorrectly."),b=Dt.create({id:n,context:o,source:{arrayBufferView:i.bufferView,mipLevels:r},width:i.width,height:i.height,pixelFormat:i.internalFormat,sampler:c})):(A&&(i=ex(i)),b=Dt.create({id:n,context:o,source:i,sampler:c,flipY:!1,skipColorSpaceConversion:!0})),g&&b.generateMipmap(),b}var pKe=new y$;async function gKe(e){let t=e._resourceCache;try{let n=t.getImageLoader({gltf:e._gltf,imageId:e._imageId,gltfResource:e._gltfResource,baseResource:e._baseResource});return e._imageLoader=n,await n.load(),e.isDestroyed()?void 0:(e._image=n.image,e._mipLevels=n.mipLevels,e._state=Ct.LOADED,e)}catch(n){if(e.isDestroyed())return;throw e.unload(),e._state=Ct.FAILED,e.getError("Failed to load texture",n)}}var gD=_$;var A$=class extends ar{constructor(t){super(),t=t??H.EMPTY_OBJECT;let n=t.resourceCache,i=t.gltf,r=t.gltfResource,o=t.baseResource,s=t.bufferViewId,a=t.primitive,c=t.draco,u=t.attributeSemantic,f=t.accessorId,d=t.cacheKey,p=t.spz,g=t.asynchronous??!0,m=t.loadBuffer??!1,y=t.loadTypedArray??!1;this._resourceCache=n,this._gltfResource=r,this._baseResource=o,this._gltf=i,this._bufferViewId=s,this._primitive=a,this._draco=c,this._spz=p,this._attributeSemantic=u,this._accessorId=f,this._cacheKey=d,this._asynchronous=g,this._loadBuffer=m,this._loadTypedArray=y,this._bufferViewLoader=void 0,this._dracoLoader=void 0,this._quantization=void 0,this._typedArray=void 0,this._buffer=void 0,this._state=Ct.UNLOADED,this._promise=void 0}get cacheKey(){return this._cacheKey}get buffer(){return this._buffer}get typedArray(){return this._typedArray}get quantization(){return this._quantization}async load(){return l(this._promise)?this._promise:l(this._spz)?(this._promise=AKe(this),this._promise):_Ke(this._draco,this._attributeSemantic)?(this._promise=EKe(this),this._promise):(this._promise=vKe(this),this._promise)}process(t){if(this._state===Ct.READY)return!0;if(this._state!==Ct.LOADED&&this._state!==Ct.PROCESSING)return!1;if(l(this._dracoLoader)){try{if(!this._dracoLoader.process(t))return!1}catch(r){L3(this,r)}CKe(this)}if(l(this._spzLoader)){try{if(!this._spzLoader.process(t))return!1}catch(r){L3(this,r)}TKe(this)}let n,i=this._typedArray;if(this._loadBuffer&&this._asynchronous){let r=SKe;if(r.set(i,t.context),!t.jobScheduler.execute(r,Xc.BUFFER))return!1;n=r.buffer}else this._loadBuffer&&(n=ipe(i,t.context));return this.unload(),this._buffer=n,this._typedArray=this._loadTypedArray?i:void 0,this._state=Ct.READY,this._resourceCache.statistics.addGeometryLoader(this),!0}unload(){l(this._buffer)&&this._buffer.destroy();let t=this._resourceCache;l(this._bufferViewLoader)&&!this._bufferViewLoader.isDestroyed()&&t.unload(this._bufferViewLoader),l(this._dracoLoader)&&t.unload(this._dracoLoader),l(this._spzLoader)&&t.unload(this._spzLoader),this._bufferViewLoader=void 0,this._dracoLoader=void 0,this._spzLoader=void 0,this._typedArray=void 0,this._buffer=void 0,this._gltf=void 0,this._primitive=void 0}};function _Ke(e,t){return l(e)&&l(e.attributes)&&l(e.attributes[t])}function yKe(e,t,n,i){let o=(1<<e.quantizationBits)-1,s=1/o,a=new vn.Quantization;if(a.componentDatatype=t,a.octEncoded=e.octEncoded,a.octEncodedZXY=!0,a.type=i,a.octEncoded)a.type=Vt.VEC2,a.normalizationRange=o;else{let c=Vt.getMathType(i);if(c===Number){let u=e.range;a.quantizedVolumeOffset=e.minValues[0],a.quantizedVolumeDimensions=u,a.normalizationRange=o,a.quantizedVolumeStepSize=u*s}else{a.quantizedVolumeOffset=c.unpack(e.minValues),a.normalizationRange=c.unpack(new Array(n).fill(o));let u=new Array(n).fill(e.range);a.quantizedVolumeDimensions=c.unpack(u);let f=u.map(function(d){return d*s});a.quantizedVolumeStepSize=c.unpack(f)}}return a}async function AKe(e){e._state=Ct.LOADING;let t=e._resourceCache;try{let n=t.getSpzLoader({gltf:e._gltf,primitive:e._primitive,spz:e._spz,gltfResource:e._gltfResource,baseResource:e._baseResource});return e._spzLoader=n,await n.load(),e.isDestroyed()?void 0:(e._state=Ct.LOADED,e)}catch{if(e.isDestroyed())return}}function bKe(e){return`${e.startsWith("KHR_gaussian_splatting:")?"KHR_gaussian_splatting:":"_"}SH_DEGREE_`}function xKe(e){let t=bKe(e),n="_COEF_",i=t.length,r=e.indexOf(n,i),o=parseInt(e.slice(i,r),10),s=parseInt(e.slice(r+n.length),10);return{l:o,n:s}}function TKe(e){e._state=Ct.PROCESSING;let n=e._spzLoader.decodedData.gcloud;if(e._attributeSemantic==="POSITION")e._typedArray=n.positions;else if(e._attributeSemantic==="KHR_gaussian_splatting:SCALE"||e._attributeSemantic==="_SCALE")e._typedArray=n.scales;else if(e._attributeSemantic==="KHR_gaussian_splatting:ROTATION"||e._attributeSemantic==="_ROTATION")e._typedArray=n.rotations;else if(e._attributeSemantic==="COLOR_0"){let i=n.colors,r=n.alphas;e._typedArray=new Uint8Array(i.length/3*4);for(let o=0;o<i.length/3;o++)e._typedArray[o*4]=P.clamp(i[o*3]*255,0,255),e._typedArray[o*4+1]=P.clamp(i[o*3+1]*255,0,255),e._typedArray[o*4+2]=P.clamp(i[o*3+2]*255,0,255),e._typedArray[o*4+3]=P.clamp(r[o]*255,0,255)}else if(e._attributeSemantic.includes("SH_DEGREE_")){let{l:i,n:r}=xKe(e._attributeSemantic),o=n.shDegree,s=0,a=[0,9,24];switch(o){case 1:s=9;break;case 2:s=24;break;case 3:s=45;break}let c=n.numPoints,u=n.sh;e._typedArray=new Float32Array(c*3);for(let f=0;f<c;f++){let d=f*s+a[i-1]+r*3;e._typedArray[f*3]=u[d],e._typedArray[f*3+1]=u[d+1],e._typedArray[f*3+2]=u[d+2]}}}async function EKe(e){e._state=Ct.LOADING;let t=e._resourceCache;try{let n=t.getDracoLoader({gltf:e._gltf,primitive:e._primitive,draco:e._draco,gltfResource:e._gltfResource,baseResource:e._baseResource});return e._dracoLoader=n,await n.load(),e.isDestroyed()?void 0:(e._state=Ct.LOADED,e)}catch{if(e.isDestroyed())return;L3(e)}}function CKe(e){e._state=Ct.PROCESSING;let n=e._dracoLoader.decodedData.vertexAttributes,i=e._attributeSemantic,r=n[i],o=e._accessorId,a=e._gltf.accessors[o].type,c=r.array,u=r.data.quantization;l(u)&&(e._quantization=yKe(u,r.data.componentDatatype,r.data.componentsPerAttribute,a)),e._typedArray=new Uint8Array(c.buffer,c.byteOffset,c.byteLength)}async function vKe(e){e._state=Ct.LOADING;let t=e._resourceCache;try{let n=t.getBufferViewLoader({gltf:e._gltf,bufferViewId:e._bufferViewId,gltfResource:e._gltfResource,baseResource:e._baseResource});return e._bufferViewLoader=n,await n.load(),e.isDestroyed()?void 0:(e._typedArray=n.typedArray,e._state=Ct.PROCESSING,e)}catch(n){if(e.isDestroyed())return;L3(e,n)}}function L3(e,t){throw e.unload(),e._state=Ct.FAILED,e.getError("Failed to load vertex buffer",t)}var b$=class{constructor(){this.typedArray=void 0,this.context=void 0,this.buffer=void 0}set(t,n){this.typedArray=t,this.context=n}execute(){this.buffer=ipe(this.typedArray,this.context)}};function ipe(e,t){let n=tt.createVertexBuffer({typedArray:e,context:t,usage:Me.STATIC_DRAW});return n.vertexArrayDestroyable=!1,n}var SKe=new b$,_D=A$;async function wKe(e={}){var t,n,i,r,o=e,s=!!globalThis.window,a=!!globalThis.WorkerGlobalScope,c=((n=(t=globalThis.process)==null?void 0:t.versions)==null?void 0:n.node)&&((i=globalThis.process)==null?void 0:i.type)!="renderer";if(c){let{createRequire:ce}=await Promise.resolve().then(()=>OKe);var u=ce(import.meta.url)}var f="./this.program",d=import.meta.url;if(c)u("node:fs"),d.startsWith("file:")&&u("node:path").dirname(u("node:url").fileURLToPath(d)),1<process.argv.length&&(f=process.argv[1].replace(/\\/g,"/")),process.argv.slice(2);else if(s||a)try{new URL(".",d)}catch{}var p=console.log.bind(console),g=console.error.bind(console),m=!1;function y(ce){for(var ne=0,Te=ce.length,Ce=new Uint8Array(Te),Je;ne<Te;++ne)Je=ce.charCodeAt(ne),Ce[ne]=~Je>>8&Je;return Ce}var A,b,x,T,E,v,S,I,R,O,L,_,C=!1;function w(){var ce=hb.buffer;x=new Int8Array(ce),E=new Int16Array(ce),o.HEAPU8=T=new Uint8Array(ce),v=new Uint16Array(ce),S=new Int32Array(ce),I=new Uint32Array(ce),o.HEAPF32=R=new Float32Array(ce),O=new Float64Array(ce),L=new BigInt64Array(ce),_=new BigUint64Array(ce)}function D(ce){var ne;throw(ne=o.onAbort)==null||ne.call(o,ce),ce="Aborted("+ce+")",g(ce),m=!0,ce=new WebAssembly.RuntimeError(ce+". Build with -sASSERTIONS for more info."),b?.(ce),ce}var N;async function F(ce){return ce}async function V(ce){var ne=N;try{var Te=await F(ne);return await WebAssembly.instantiate(Te,ce)}catch(Ce){g(`failed to asynchronously prepare wasm: ${Ce}`),D(Ce)}}async function B(ce){return V(ce)}var j=ce=>{for(;0<ce.length;)ce.shift()(o)},k=[],G=[],q=()=>{var ce=o.preRun.shift();G.push(ce)},Q={},W=ce=>{for(;ce.length;){var ne=ce.pop();ce.pop()(ne)}};function J(ce){return this.O(I[ce>>2])}var Z={},ae={},Ae={},fe=class extends Error{constructor(ce){super(ce),this.name="InternalError"}},xe=(ce,ne,Te)=>{function Ce(St){if(St=Te(St),St.length!==ce.length)throw new fe("Mismatched type converter count");for(var bn=0;bn<ce.length;++bn)Qe(ce[bn],St[bn])}ce.forEach(St=>Ae[St]=ne);var Je=Array(ne.length),Tt=[],pt=0;for(let[St,bn]of ne.entries())ae.hasOwnProperty(bn)?Je[St]=ae[bn]:(Tt.push(bn),Z.hasOwnProperty(bn)||(Z[bn]=[]),Z[bn].push(()=>{Je[St]=ae[bn],++pt,pt===Tt.length&&Ce(Je)}));Tt.length===0&&Ce(Je)},ge=ce=>{for(var ne="";;){var Te=T[ce++];if(!Te)return ne;ne+=String.fromCharCode(Te)}},we=class extends Error{constructor(ce){super(ce),this.name="BindingError"}},ve=ce=>{throw new we(ce)};function Re(ce,ne,Te={}){var Ce=ne.name;if(!ce)throw new we(`type "${Ce}" must have a positive integer typeid pointer`);if(ae.hasOwnProperty(ce)){if(Te.Aa)return;throw new we(`Cannot register type '${Ce}' twice`)}ae[ce]=ne,delete Ae[ce],Z.hasOwnProperty(ce)&&(ne=Z[ce],delete Z[ce],ne.forEach(Je=>Je()))}function Qe(ce,ne,Te={}){return Re(ce,ne,Te)}var He=(ce,ne,Te)=>{switch(ne){case 1:return Te?Ce=>x[Ce]:Ce=>T[Ce];case 2:return Te?Ce=>E[Ce>>1]:Ce=>v[Ce>>1];case 4:return Te?Ce=>S[Ce>>2]:Ce=>I[Ce>>2];case 8:return Te?Ce=>L[Ce>>3]:Ce=>_[Ce>>3];default:throw new TypeError(`invalid integer width (${ne}): ${ce}`)}},Ye=ce=>{throw new we(ce.M.R.N.name+" instance already deleted")},Ke=!1,Pe=()=>{},qe=ce=>globalThis.FinalizationRegistry?(Ke=new FinalizationRegistry(ne=>{ne=ne.M,--ne.count.value,ne.count.value===0&&(ne.V?ne.Y.Z(ne.V):ne.R.N.Z(ne.P))}),qe=ne=>{var Te=ne.M;return Te.V&&Ke.register(ne,{M:Te},ne),ne},Pe=ne=>{Ke.unregister(ne)},qe(ce)):(qe=ne=>ne,ce);function st(){}var vt=(ce,ne)=>Object.defineProperty(ne,"name",{value:ce}),jt={},lt=(ce,ne,Te)=>{if(ce[ne].U===void 0){var Ce=ce[ne];ce[ne]=function(...Je){if(!ce[ne].U.hasOwnProperty(Je.length))throw new we(`Function '${Te}' called with an invalid number of arguments (${Je.length}) - expects one of (${ce[ne].U})!`);return ce[ne].U[Je.length].apply(this,Je)},ce[ne].U=[],ce[ne].U[Ce.$]=Ce}},mt=(ce,ne,Te)=>{if(o.hasOwnProperty(ce)){if(Te===void 0||o[ce].U!==void 0&&o[ce].U[Te]!==void 0)throw new we(`Cannot register public name '${ce}' twice`);if(lt(o,ce,ce),o[ce].U.hasOwnProperty(Te))throw new we(`Cannot register multiple overloads of a function with the same number of arguments (${Te})!`);o[ce].U[Te]=ne}else o[ce]=ne,o[ce].$=Te},ft=ce=>{ce=ce.replace(/[^a-zA-Z0-9_]/g,"$");var ne=ce.charCodeAt(0);return 48<=ne&&57>=ne?`_${ce}`:ce};function Yt(ce,ne,Te,Ce,Je,Tt,pt,St){this.name=ce,this.constructor=ne,this.ba=Te,this.Z=Ce,this.W=Je,this.va=Tt,this.fa=pt,this.ta=St,this.Ca=[]}var rt=(ce,ne,Te)=>{for(;ne!==Te;){if(!ne.fa)throw new we(`Expected null or instance of ${Te.name}, got an instance of ${ne.name}`);ce=ne.fa(ce),ne=ne.W}return ce},ht=ce=>{if(ce===null)return"null";var ne=typeof ce;return ne==="object"||ne==="array"||ne==="function"?ce.toString():""+ce};function Li(ce,ne){if(ne===null){if(this.ia)throw new we(`null is not a valid ${this.name}`);return 0}if(!ne.M)throw new we(`Cannot pass "${ht(ne)}" as a ${this.name}`);if(!ne.M.P)throw new we(`Cannot pass deleted object as a pointer of type ${this.name}`);return rt(ne.M.P,ne.M.R.N,this.N)}function Yn(ce,ne){if(ne===null){if(this.ia)throw new we(`null is not a valid ${this.name}`);if(this.ha){var Te=this.ka();return ce!==null&&ce.push(this.Z,Te),Te}return 0}if(!ne||!ne.M)throw new we(`Cannot pass "${ht(ne)}" as a ${this.name}`);if(!ne.M.P)throw new we(`Cannot pass deleted object as a pointer of type ${this.name}`);if(!this.ga&&ne.M.R.ga)throw new we(`Cannot convert argument of type ${ne.M.Y?ne.M.Y.name:ne.M.R.name} to parameter type ${this.name}`);if(Te=rt(ne.M.P,ne.M.R.N,this.N),this.ha){if(ne.M.V===void 0)throw new we("Passing raw pointer to smart pointer is illegal");switch(this.Ha){case 0:if(ne.M.Y===this)Te=ne.M.V;else throw new we(`Cannot convert argument of type ${ne.M.Y?ne.M.Y.name:ne.M.R.name} to parameter type ${this.name}`);break;case 1:Te=ne.M.V;break;case 2:if(ne.M.Y===this)Te=ne.M.V;else{var Ce=ne.clone();Te=this.Da(Te,Vi(()=>Ce.delete())),ce!==null&&ce.push(this.Z,Te)}break;default:throw new we("Unsupported sharing policy")}}return Te}function yi(ce,ne){if(ne===null){if(this.ia)throw new we(`null is not a valid ${this.name}`);return 0}if(!ne.M)throw new we(`Cannot pass "${ht(ne)}" as a ${this.name}`);if(!ne.M.P)throw new we(`Cannot pass deleted object as a pointer of type ${this.name}`);if(ne.M.R.ga)throw new we(`Cannot convert argument of type ${ne.M.R.name} to parameter type ${this.name}`);return rt(ne.M.P,ne.M.R.N,this.N)}var zi=(ce,ne,Te)=>ne===Te?ce:Te.W===void 0?null:(ce=zi(ce,ne,Te.W),ce===null?null:Te.ta(ce)),Si={},ui=(ce,ne)=>{if(ne===void 0)throw new we("ptr should not be undefined");for(;ce.W;)ne=ce.fa(ne),ce=ce.W;return Si[ne]},Ai=(ce,ne)=>{if(!ne.R||!ne.P)throw new fe("makeClassHandle requires ptr and ptrType");if(!!ne.Y!=!!ne.V)throw new fe("Both smartPtrType and smartPtr must be specified");return ne.count={value:1},qe(Object.create(ce,{M:{value:ne,writable:!0}}))};function zn(ce,ne,Te,Ce,Je,Tt,pt,St,bn,Gn,mn){this.name=ce,this.N=ne,this.ia=Te,this.ga=Ce,this.ha=Je,this.Ba=Tt,this.Ha=pt,this.pa=St,this.ka=bn,this.Da=Gn,this.Z=mn,Je||ne.W!==void 0?this.S=Yn:(this.S=Ce?Li:yi,this.T=null)}var tn=(ce,ne,Te)=>{if(!o.hasOwnProperty(ce))throw new fe("Replacing nonexistent public symbol");o[ce].U!==void 0&&Te!==void 0?o[ce].U[Te]=ne:(o[ce]=ne,o[ce].$=Te)},Hn=(ce,ne)=>{ce=ge(ce);var Te=NI.get(ne);if(typeof Te!="function")throw new we(`unknown function pointer with signature ${ce}: ${ne}`);return Te};class Ki extends Error{}var wr=ce=>{ce=db(ce);var ne=ge(ce);return Lm(ce),ne},so=(ce,ne)=>{function Te(Tt){Je[Tt]||ae[Tt]||(Ae[Tt]?Ae[Tt].forEach(Te):(Ce.push(Tt),Je[Tt]=!0))}var Ce=[],Je={};throw ne.forEach(Te),new Ki(`${ce}: `+Ce.map(wr).join([", "]))},Ts=(ce,ne)=>{for(var Te=[],Ce=0;Ce<ce;Ce++)Te.push(I[ne+4*Ce>>2]);return Te};function zs(ce){for(var ne=1;ne<ce.length;++ne)if(ce[ne]!==null&&ce[ne].T===void 0)return!0;return!1}function $r(ce,ne,Te,Ce,Je,Tt){var pt=ne.length;if(2>pt)throw new we("argTypes array size mismatch! Must at least get return value and 'this' types!");var St=ne[1]!==null&&Te!==null,bn=zs(ne);Te=!ne[0].oa;var Gn=ne[0],mn=ne[1];for(Ce=[ce,ve,Ce,Je,W,Gn.O.bind(Gn),mn?.S.bind(mn)],Je=2;Je<pt;++Je)Gn=ne[Je],Ce.push(Gn.S.bind(Gn));if(!bn)for(Je=St?1:2;Je<ne.length;++Je)ne[Je].T!==null&&Ce.push(ne[Je].T);for(bn=zs(ne),Je=ne.length-2,mn=[],Gn=["fn"],St&&Gn.push("thisWired"),pt=0;pt<Je;++pt)mn.push(`arg${pt}`),Gn.push(`arg${pt}Wired`);mn=mn.join(","),Gn=Gn.join(","),mn=`return function (${mn}) { +${r.stack}`),r};Qc.getNodeTransform=function(e){return l(e.matrix)?e.matrix:M.fromTranslationQuaternionRotationScale(l(e.translation)?e.translation:h.ZERO,l(e.rotation)?e.rotation:Le.IDENTITY,l(e.scale)?e.scale:h.ONE)};Qc.getAttributeBySemantic=function(e,t,n){let i=e.attributes,r=i.length;for(let o=0;o<r;++o){let s=i[o],a=l(n)?s.setIndex===n:!0;if(s.semantic===t&&a)return s}};Qc.getAttributeByName=function(e,t){let n=e.attributes,i=n.length;for(let r=0;r<i;++r){let o=n[r];if(o.name===t)return o}};Qc.getFeatureIdsByLabel=function(e,t){for(let n=0;n<e.length;n++){let i=e[n];if(i.positionalLabel===t||i.label===t)return i}};Qc.hasQuantizedAttributes=function(e){if(!l(e))return!1;for(let t=0;t<e.length;t++){let n=e[t];if(l(n.quantization))return!0}return!1};Qc.getAttributeInfo=function(e){let t=e.semantic,n=e.setIndex,i,r=!1;l(t)?(i=ct.getVariableName(t,n),r=!0):(i=e.name,i=i.replace(/^_/,""),i=i.toLowerCase());let o=/^color_\d+$/.test(i),s=e.type,a=Vt.getGlslType(s);o&&(a="vec4");let c=l(e.quantization),u;return c&&(u=o?"vec4":Vt.getGlslType(e.quantization.type)),{attribute:e,isQuantized:c,variableName:i,hasSemantic:r,glslType:a,quantizedGlslType:u}};var ntt=new h,itt=new h;Qc.getPositionMinMax=function(e,t,n){let i=Qc.getAttributeBySemantic(e,"POSITION"),r=i.max,o=i.min;return l(n)&&l(t)&&(o=h.add(o,t,itt),r=h.add(r,n,ntt)),{min:o,max:r}};Qc.getAxisCorrectionMatrix=function(e,t,n){return n=M.clone(M.IDENTITY,n),e===qi.Y?n=M.clone(qi.Y_UP_TO_Z_UP,n):e===qi.X&&(n=M.clone(qi.X_UP_TO_Z_UP,n)),t===qi.Z&&(n=M.multiplyTransformation(n,qi.Z_UP_TO_X_UP,n)),n};var rtt=new $;Qc.getCullFace=function(e,t){if(!Oe.isTriangles(t))return Hi.BACK;let n=M.getMatrix3(e,rtt);return $.determinant(n)<0?Hi.FRONT:Hi.BACK};Qc.sanitizeGlslIdentifier=function(e){let t=e.replaceAll(/[^A-Za-z0-9]+/g,"_");return t=t.replace(/^gl_/,""),/^\d/.test(t)&&(t=`_${t}`),t};Qc.supportedExtensions={AGI_articulations:!0,CESIUM_mesh_vector:!0,CESIUM_primitive_outline:!0,CESIUM_RTC:!0,EXT_feature_metadata:!0,EXT_implicit_cylinder_region:!0,EXT_implicit_ellipsoid_region:!0,EXT_instance_features:!0,EXT_mesh_features:!0,EXT_mesh_gpu_instancing:!0,EXT_mesh_polygon:!0,EXT_mesh_primitive_edge_visibility:!0,EXT_meshopt_compression:!0,EXT_primitive_voxels:!0,EXT_structural_metadata:!0,EXT_texture_webp:!0,KHR_blend:!0,KHR_draco_mesh_compression:!0,KHR_implicit_shapes:!0,KHR_materials_common:!0,KHR_materials_pbrSpecularGlossiness:!0,KHR_materials_specular:!0,KHR_materials_anisotropy:!0,KHR_materials_clearcoat:!0,KHR_materials_unlit:!0,KHR_mesh_quantization:!0,KHR_mesh_primitive_restart:!0,KHR_meshopt_compression:!0,KHR_techniques_webgl:!0,KHR_texture_basisu:!0,KHR_texture_transform:!0,KHR_gaussian_splatting:!0,KHR_gaussian_splatting_compression_spz_2:!0,WEB3D_quantized_attributes:!0};Qc.checkSupportedExtensions=function(e){let t=e.length;for(let n=0;n<t;n++){let i=e[n];if(!Qc.supportedExtensions[i])throw new oe(`Unsupported glTF Extension: ${i}`)}};var xt=Qc;var PJ=class extends cr{constructor(t){super(),t=t??H.EMPTY_OBJECT;let n=t.resourceCache,i=t.gltfResource,r=t.baseResource,o=t.typedArray,s=t.gltfJson,a=t.cacheKey;this._resourceCache=n,this._gltfResource=i,this._baseResource=r,this._typedArray=o,this._gltfJson=s,this._cacheKey=a,this._gltf=void 0,this._bufferLoaders=[],this._state=Ct.UNLOADED,this._promise=void 0}get cacheKey(){return this._cacheKey}get gltf(){return this._gltf}async load(){return l(this._promise)?this._promise:(this._state=Ct.LOADING,l(this._gltfJson)?(this._promise=Mye(this,this._gltfJson),this._promise):l(this._typedArray)?(this._promise=Nye(this,this._typedArray),this._promise):(this._promise=ott(this),this._promise))}unload(){let t=this._bufferLoaders,n=t.length;for(let i=0;i<n;++i)t[i]=!t[i].isDestroyed()&&this._resourceCache.unload(t[i]);this._bufferLoaders.length=0,this._gltf=void 0}_fetchGltf(){return this._gltfResource.fetchArrayBuffer()}};async function ott(e){let t;try{let n=await e._fetchGltf();if(e.isDestroyed())return;t=new Uint8Array(n)}catch(n){if(e.isDestroyed())return;DJ(e,n)}return Nye(e,t)}function DJ(e,t){e.unload(),e._state=Ct.FAILED;let n=`Failed to load glTF: ${e._gltfResource.url}`;throw e.getError(n,t)}async function stt(e,t){if(l(t.asset)&&t.asset.version==="2.0"&&!Jo(t,"KHR_techniques_webgl")&&!Jo(t,"KHR_materials_common"))return Promise.resolve();let n=[];Ue.buffer(t,function(i){if(!l(i.extras._pipeline.source)&&l(i.uri)){let r=e._baseResource.getDerivedResource({url:i.uri}),s=e._resourceCache.getExternalBufferLoader({resource:r});e._bufferLoaders.push(s),n.push(s.load().then(function(){s.isDestroyed()||(i.extras._pipeline.source=s.typedArray)}))}}),await Promise.all(n),qU(t)}function att(e){let t=[];return Ue.buffer(e,function(n){let i=n.uri;!l(n.extras._pipeline.source)&&l(i)&&Um(i)&&(delete n.uri,t.push(De.fetchArrayBuffer(i).then(function(r){n.extras._pipeline.source=new Uint8Array(r)})))}),Promise.all(t)}function ctt(e,t){let n=[];return Ue.buffer(t,function(i,r){let o=i.extras._pipeline.source;if(l(o)&&!l(i.uri)){let a=e._resourceCache.getEmbeddedBufferLoader({parentResource:e._gltfResource,bufferId:r,typedArray:o});e._bufferLoaders.push(a),n.push(a.load())}}),Promise.all(n)}async function Mye(e,t){try{mx(t),await att(t),await stt(e,t),OU(t),await ctt(e,t),FU(t);let n=t.asset.version;if(n!=="1.0"&&n!=="2.0")throw new oe(`Unsupported glTF version: ${n}`);let i=t.extensionsRequired;return l(i)&&xt.checkSupportedExtensions(i),e._gltf=t,e._state=Ct.READY,e}catch(n){if(e.isDestroyed())return;DJ(e,n)}}async function Nye(e,t){let n;try{yp(t)==="glTF"?n=wv(t):n=Fo(t)}catch(i){if(e.isDestroyed())return;DJ(e,i)}return Mye(e,n)}var JD=PJ;function ltt(e){let t=document.createElement("canvas");return t.width=P.nextPowerOfTwo(e.width),t.height=P.nextPowerOfTwo(e.height),t.getContext("2d").drawImage(e,0,0,e.width,e.height,0,0,t.width,t.height),t}var px=ltt;var RJ=class extends cr{constructor(t){super(),t=t??H.EMPTY_OBJECT;let n=t.resourceCache,i=t.gltf,r=t.textureInfo,o=t.gltfResource,s=t.baseResource,a=t.supportedImageFormats,c=t.cacheKey,u=t.asynchronous??!0,f=r.index,d=gf.getImageIdFromTexture({gltf:i,textureId:f,supportedImageFormats:a});this._resourceCache=n,this._gltf=i,this._textureInfo=r,this._imageId=d,this._gltfResource=o,this._baseResource=s,this._cacheKey=c,this._asynchronous=u,this._imageLoader=void 0,this._image=void 0,this._mipLevels=void 0,this._texture=void 0,this._state=Ct.UNLOADED,this._promise=void 0}get cacheKey(){return this._cacheKey}get texture(){return this._texture}async load(){return l(this._promise)?this._promise:(this._state=Ct.LOADING,this._promise=ftt(this),this._promise)}process(t){if(this._state===Ct.READY)return!0;if(this._state!==Ct.LOADED&&this._state!==Ct.PROCESSING||l(this._texture)||!l(this._image))return!1;this._state=Ct.PROCESSING;let n;if(this._asynchronous){let i=utt;if(i.set(this._gltf,this._textureInfo,this._cacheKey,this._image,this._mipLevels,t.context),!t.jobScheduler.execute(i,Zc.TEXTURE))return!1;n=i.texture}else n=Lye(this._gltf,this._textureInfo,this._cacheKey,this._image,this._mipLevels,t.context);return this.unload(),this._texture=n,this._state=Ct.READY,this._resourceCache.statistics.addTextureLoader(this),!0}unload(){l(this._texture)&&this._texture.destroy(),l(this._imageLoader)&&!this._imageLoader.isDestroyed()&&this._resourceCache.unload(this._imageLoader),this._imageLoader=void 0,this._image=void 0,this._mipLevels=void 0,this._texture=void 0,this._gltf=void 0}},OJ=class{constructor(){this.gltf=void 0,this.textureInfo=void 0,this.textureId=void 0,this.image=void 0,this.context=void 0,this.texture=void 0}set(t,n,i,r,o,s){this.gltf=t,this.textureInfo=n,this.textureId=i,this.image=r,this.mipLevels=o,this.context=s}execute(){this.texture=Lye(this.gltf,this.textureInfo,this.textureId,this.image,this.mipLevels,this.context)}};function Lye(e,t,n,i,r,o){let s=i.internalFormat,a=!1;$e.isCompressedFormat(s)&&!l(r)&&(a=!0);let c=gf.createSampler({gltf:e,textureInfo:t,compressedTextureNoMipmap:a}),u=c.minificationFilter,f=c.wrapS,d=c.wrapT,p=u===Wt.NEAREST_MIPMAP_NEAREST||u===Wt.NEAREST_MIPMAP_LINEAR||u===Wt.LINEAR_MIPMAP_NEAREST||u===Wt.LINEAR_MIPMAP_LINEAR,g=!l(s)&&p,m=g||f===hn.REPEAT||f===hn.MIRRORED_REPEAT||d===hn.REPEAT||d===hn.MIRRORED_REPEAT,y=!P.isPowerOfTwo(i.width)||!P.isPowerOfTwo(i.height),A=m&&y,b;return l(s)?(!o.webgl2&&$e.isCompressedFormat(s)&&y&&m&&console.warn("Compressed texture uses REPEAT or MIRRORED_REPEAT texture wrap mode and dimensions are not powers of two. The texture may be rendered incorrectly."),b=Dt.create({id:n,context:o,source:{arrayBufferView:i.bufferView,mipLevels:r},width:i.width,height:i.height,pixelFormat:i.internalFormat,sampler:c})):(A&&(i=px(i)),b=Dt.create({id:n,context:o,source:i,sampler:c,flipY:!1,skipColorSpaceConversion:!0})),g&&b.generateMipmap(),b}var utt=new OJ;async function ftt(e){let t=e._resourceCache;try{let n=t.getImageLoader({gltf:e._gltf,imageId:e._imageId,gltfResource:e._gltfResource,baseResource:e._baseResource});return e._imageLoader=n,await n.load(),e.isDestroyed()?void 0:(e._image=n.image,e._mipLevels=n.mipLevels,e._state=Ct.LOADED,e)}catch(n){if(e.isDestroyed())return;throw e.unload(),e._state=Ct.FAILED,e.getError("Failed to load texture",n)}}var ZD=RJ;var MJ=class extends cr{constructor(t){super(),t=t??H.EMPTY_OBJECT;let n=t.resourceCache,i=t.gltf,r=t.gltfResource,o=t.baseResource,s=t.bufferViewId,a=t.primitive,c=t.draco,u=t.attributeSemantic,f=t.accessorId,d=t.cacheKey,p=t.spz,g=t.asynchronous??!0,m=t.loadBuffer??!1,y=t.loadTypedArray??!1;this._resourceCache=n,this._gltfResource=r,this._baseResource=o,this._gltf=i,this._bufferViewId=s,this._primitive=a,this._draco=c,this._spz=p,this._attributeSemantic=u,this._accessorId=f,this._cacheKey=d,this._asynchronous=g,this._loadBuffer=m,this._loadTypedArray=y,this._bufferViewLoader=void 0,this._dracoLoader=void 0,this._quantization=void 0,this._typedArray=void 0,this._buffer=void 0,this._state=Ct.UNLOADED,this._promise=void 0}get cacheKey(){return this._cacheKey}get buffer(){return this._buffer}get typedArray(){return this._typedArray}get quantization(){return this._quantization}async load(){return l(this._promise)?this._promise:l(this._spz)?(this._promise=mtt(this),this._promise):dtt(this._draco,this._attributeSemantic)?(this._promise=ytt(this),this._promise):(this._promise=btt(this),this._promise)}process(t){if(this._state===Ct.READY)return!0;if(this._state!==Ct.LOADED&&this._state!==Ct.PROCESSING)return!1;if(l(this._dracoLoader)){try{if(!this._dracoLoader.process(t))return!1}catch(r){YU(this,r)}Att(this)}if(l(this._spzLoader)){try{if(!this._spzLoader.process(t))return!1}catch(r){YU(this,r)}_tt(this)}let n,i=this._typedArray;if(this._loadBuffer&&this._asynchronous){let r=xtt;if(r.set(i,t.context),!t.jobScheduler.execute(r,Zc.BUFFER))return!1;n=r.buffer}else this._loadBuffer&&(n=Fye(i,t.context));return this.unload(),this._buffer=n,this._typedArray=this._loadTypedArray?i:void 0,this._state=Ct.READY,this._resourceCache.statistics.addGeometryLoader(this),!0}unload(){l(this._buffer)&&this._buffer.destroy();let t=this._resourceCache;l(this._bufferViewLoader)&&!this._bufferViewLoader.isDestroyed()&&t.unload(this._bufferViewLoader),l(this._dracoLoader)&&t.unload(this._dracoLoader),l(this._spzLoader)&&t.unload(this._spzLoader),this._bufferViewLoader=void 0,this._dracoLoader=void 0,this._spzLoader=void 0,this._typedArray=void 0,this._buffer=void 0,this._gltf=void 0,this._primitive=void 0}};function dtt(e,t){return l(e)&&l(e.attributes)&&l(e.attributes[t])}function htt(e,t,n,i){let o=(1<<e.quantizationBits)-1,s=1/o,a=new vn.Quantization;if(a.componentDatatype=t,a.octEncoded=e.octEncoded,a.octEncodedZXY=!0,a.type=i,a.octEncoded)a.type=Vt.VEC2,a.normalizationRange=o;else{let c=Vt.getMathType(i);if(c===Number){let u=e.range;a.quantizedVolumeOffset=e.minValues[0],a.quantizedVolumeDimensions=u,a.normalizationRange=o,a.quantizedVolumeStepSize=u*s}else{a.quantizedVolumeOffset=c.unpack(e.minValues),a.normalizationRange=c.unpack(new Array(n).fill(o));let u=new Array(n).fill(e.range);a.quantizedVolumeDimensions=c.unpack(u);let f=u.map(function(d){return d*s});a.quantizedVolumeStepSize=c.unpack(f)}}return a}async function mtt(e){e._state=Ct.LOADING;let t=e._resourceCache;try{let n=t.getSpzLoader({gltf:e._gltf,primitive:e._primitive,spz:e._spz,gltfResource:e._gltfResource,baseResource:e._baseResource});return e._spzLoader=n,await n.load(),e.isDestroyed()?void 0:(e._state=Ct.LOADED,e)}catch{if(e.isDestroyed())return}}function ptt(e){return`${e.startsWith("KHR_gaussian_splatting:")?"KHR_gaussian_splatting:":"_"}SH_DEGREE_`}function gtt(e){let t=ptt(e),n="_COEF_",i=t.length,r=e.indexOf(n,i),o=parseInt(e.slice(i,r),10),s=parseInt(e.slice(r+n.length),10);return{l:o,n:s}}function _tt(e){e._state=Ct.PROCESSING;let n=e._spzLoader.decodedData.gcloud;if(e._attributeSemantic==="POSITION")e._typedArray=n.positions;else if(e._attributeSemantic==="KHR_gaussian_splatting:SCALE"||e._attributeSemantic==="_SCALE")e._typedArray=n.scales;else if(e._attributeSemantic==="KHR_gaussian_splatting:ROTATION"||e._attributeSemantic==="_ROTATION")e._typedArray=n.rotations;else if(e._attributeSemantic==="COLOR_0"){let i=n.colors,r=n.alphas;e._typedArray=new Uint8Array(i.length/3*4);for(let o=0;o<i.length/3;o++)e._typedArray[o*4]=P.clamp(i[o*3]*255,0,255),e._typedArray[o*4+1]=P.clamp(i[o*3+1]*255,0,255),e._typedArray[o*4+2]=P.clamp(i[o*3+2]*255,0,255),e._typedArray[o*4+3]=P.clamp(r[o]*255,0,255)}else if(e._attributeSemantic.includes("SH_DEGREE_")){let{l:i,n:r}=gtt(e._attributeSemantic),o=n.shDegree,s=0,a=[0,9,24];switch(o){case 1:s=9;break;case 2:s=24;break;case 3:s=45;break}let c=n.numPoints,u=n.sh;e._typedArray=new Float32Array(c*3);for(let f=0;f<c;f++){let d=f*s+a[i-1]+r*3;e._typedArray[f*3]=u[d],e._typedArray[f*3+1]=u[d+1],e._typedArray[f*3+2]=u[d+2]}}}async function ytt(e){e._state=Ct.LOADING;let t=e._resourceCache;try{let n=t.getDracoLoader({gltf:e._gltf,primitive:e._primitive,draco:e._draco,gltfResource:e._gltfResource,baseResource:e._baseResource});return e._dracoLoader=n,await n.load(),e.isDestroyed()?void 0:(e._state=Ct.LOADED,e)}catch{if(e.isDestroyed())return;YU(e)}}function Att(e){e._state=Ct.PROCESSING;let n=e._dracoLoader.decodedData.vertexAttributes,i=e._attributeSemantic,r=n[i],o=e._accessorId,a=e._gltf.accessors[o].type,c=r.array,u=r.data.quantization;l(u)&&(e._quantization=htt(u,r.data.componentDatatype,r.data.componentsPerAttribute,a)),e._typedArray=new Uint8Array(c.buffer,c.byteOffset,c.byteLength)}async function btt(e){e._state=Ct.LOADING;let t=e._resourceCache;try{let n=t.getBufferViewLoader({gltf:e._gltf,bufferViewId:e._bufferViewId,gltfResource:e._gltfResource,baseResource:e._baseResource});return e._bufferViewLoader=n,await n.load(),e.isDestroyed()?void 0:(e._typedArray=n.typedArray,e._state=Ct.PROCESSING,e)}catch(n){if(e.isDestroyed())return;YU(e,n)}}function YU(e,t){throw e.unload(),e._state=Ct.FAILED,e.getError("Failed to load vertex buffer",t)}var NJ=class{constructor(){this.typedArray=void 0,this.context=void 0,this.buffer=void 0}set(t,n){this.typedArray=t,this.context=n}execute(){this.buffer=Fye(this.typedArray,this.context)}};function Fye(e,t){let n=tt.createVertexBuffer({typedArray:e,context:t,usage:Me.STATIC_DRAW});return n.vertexArrayDestroyable=!1,n}var xtt=new NJ,QD=MJ;async function Ttt(e={}){var t,n,i,r,o=e,s=!!globalThis.window,a=!!globalThis.WorkerGlobalScope,c=((n=(t=globalThis.process)==null?void 0:t.versions)==null?void 0:n.node)&&((i=globalThis.process)==null?void 0:i.type)!="renderer";if(c){let{createRequire:ce}=await Promise.resolve().then(()=>wtt);var u=ce(import.meta.url)}var f="./this.program",d=import.meta.url;if(c)u("node:fs"),d.startsWith("file:")&&u("node:path").dirname(u("node:url").fileURLToPath(d)),1<process.argv.length&&(f=process.argv[1].replace(/\\/g,"/")),process.argv.slice(2);else if(s||a)try{new URL(".",d)}catch{}var p=console.log.bind(console),g=console.error.bind(console),m=!1;function y(ce){for(var ne=0,Te=ce.length,Ce=new Uint8Array(Te),Je;ne<Te;++ne)Je=ce.charCodeAt(ne),Ce[ne]=~Je>>8&Je;return Ce}var A,b,x,T,E,v,S,I,R,O,L,_,C=!1;function w(){var ce=hb.buffer;x=new Int8Array(ce),E=new Int16Array(ce),o.HEAPU8=T=new Uint8Array(ce),v=new Uint16Array(ce),S=new Int32Array(ce),I=new Uint32Array(ce),o.HEAPF32=R=new Float32Array(ce),O=new Float64Array(ce),L=new BigInt64Array(ce),_=new BigUint64Array(ce)}function D(ce){var ne;throw(ne=o.onAbort)==null||ne.call(o,ce),ce="Aborted("+ce+")",g(ce),m=!0,ce=new WebAssembly.RuntimeError(ce+". Build with -sASSERTIONS for more info."),b?.(ce),ce}var N;async function F(ce){return ce}async function V(ce){var ne=N;try{var Te=await F(ne);return await WebAssembly.instantiate(Te,ce)}catch(Ce){g(`failed to asynchronously prepare wasm: ${Ce}`),D(Ce)}}async function B(ce){return V(ce)}var j=ce=>{for(;0<ce.length;)ce.shift()(o)},k=[],G=[],q=()=>{var ce=o.preRun.shift();G.push(ce)},Q={},W=ce=>{for(;ce.length;){var ne=ce.pop();ce.pop()(ne)}};function J(ce){return this.O(I[ce>>2])}var Z={},ae={},Ae={},fe=class extends Error{constructor(ce){super(ce),this.name="InternalError"}},xe=(ce,ne,Te)=>{function Ce(St){if(St=Te(St),St.length!==ce.length)throw new fe("Mismatched type converter count");for(var bn=0;bn<ce.length;++bn)Qe(ce[bn],St[bn])}ce.forEach(St=>Ae[St]=ne);var Je=Array(ne.length),Tt=[],pt=0;for(let[St,bn]of ne.entries())ae.hasOwnProperty(bn)?Je[St]=ae[bn]:(Tt.push(bn),Z.hasOwnProperty(bn)||(Z[bn]=[]),Z[bn].push(()=>{Je[St]=ae[bn],++pt,pt===Tt.length&&Ce(Je)}));Tt.length===0&&Ce(Je)},ge=ce=>{for(var ne="";;){var Te=T[ce++];if(!Te)return ne;ne+=String.fromCharCode(Te)}},we=class extends Error{constructor(ce){super(ce),this.name="BindingError"}},ve=ce=>{throw new we(ce)};function Re(ce,ne,Te={}){var Ce=ne.name;if(!ce)throw new we(`type "${Ce}" must have a positive integer typeid pointer`);if(ae.hasOwnProperty(ce)){if(Te.Aa)return;throw new we(`Cannot register type '${Ce}' twice`)}ae[ce]=ne,delete Ae[ce],Z.hasOwnProperty(ce)&&(ne=Z[ce],delete Z[ce],ne.forEach(Je=>Je()))}function Qe(ce,ne,Te={}){return Re(ce,ne,Te)}var He=(ce,ne,Te)=>{switch(ne){case 1:return Te?Ce=>x[Ce]:Ce=>T[Ce];case 2:return Te?Ce=>E[Ce>>1]:Ce=>v[Ce>>1];case 4:return Te?Ce=>S[Ce>>2]:Ce=>I[Ce>>2];case 8:return Te?Ce=>L[Ce>>3]:Ce=>_[Ce>>3];default:throw new TypeError(`invalid integer width (${ne}): ${ce}`)}},Ye=ce=>{throw new we(ce.M.R.N.name+" instance already deleted")},Ke=!1,Pe=()=>{},qe=ce=>globalThis.FinalizationRegistry?(Ke=new FinalizationRegistry(ne=>{ne=ne.M,--ne.count.value,ne.count.value===0&&(ne.V?ne.Y.Z(ne.V):ne.R.N.Z(ne.P))}),qe=ne=>{var Te=ne.M;return Te.V&&Ke.register(ne,{M:Te},ne),ne},Pe=ne=>{Ke.unregister(ne)},qe(ce)):(qe=ne=>ne,ce);function st(){}var vt=(ce,ne)=>Object.defineProperty(ne,"name",{value:ce}),jt={},lt=(ce,ne,Te)=>{if(ce[ne].U===void 0){var Ce=ce[ne];ce[ne]=function(...Je){if(!ce[ne].U.hasOwnProperty(Je.length))throw new we(`Function '${Te}' called with an invalid number of arguments (${Je.length}) - expects one of (${ce[ne].U})!`);return ce[ne].U[Je.length].apply(this,Je)},ce[ne].U=[],ce[ne].U[Ce.$]=Ce}},mt=(ce,ne,Te)=>{if(o.hasOwnProperty(ce)){if(Te===void 0||o[ce].U!==void 0&&o[ce].U[Te]!==void 0)throw new we(`Cannot register public name '${ce}' twice`);if(lt(o,ce,ce),o[ce].U.hasOwnProperty(Te))throw new we(`Cannot register multiple overloads of a function with the same number of arguments (${Te})!`);o[ce].U[Te]=ne}else o[ce]=ne,o[ce].$=Te},ft=ce=>{ce=ce.replace(/[^a-zA-Z0-9_]/g,"$");var ne=ce.charCodeAt(0);return 48<=ne&&57>=ne?`_${ce}`:ce};function Yt(ce,ne,Te,Ce,Je,Tt,pt,St){this.name=ce,this.constructor=ne,this.ba=Te,this.Z=Ce,this.W=Je,this.va=Tt,this.fa=pt,this.ta=St,this.Ca=[]}var rt=(ce,ne,Te)=>{for(;ne!==Te;){if(!ne.fa)throw new we(`Expected null or instance of ${Te.name}, got an instance of ${ne.name}`);ce=ne.fa(ce),ne=ne.W}return ce},ht=ce=>{if(ce===null)return"null";var ne=typeof ce;return ne==="object"||ne==="array"||ne==="function"?ce.toString():""+ce};function Li(ce,ne){if(ne===null){if(this.ia)throw new we(`null is not a valid ${this.name}`);return 0}if(!ne.M)throw new we(`Cannot pass "${ht(ne)}" as a ${this.name}`);if(!ne.M.P)throw new we(`Cannot pass deleted object as a pointer of type ${this.name}`);return rt(ne.M.P,ne.M.R.N,this.N)}function Yn(ce,ne){if(ne===null){if(this.ia)throw new we(`null is not a valid ${this.name}`);if(this.ha){var Te=this.ka();return ce!==null&&ce.push(this.Z,Te),Te}return 0}if(!ne||!ne.M)throw new we(`Cannot pass "${ht(ne)}" as a ${this.name}`);if(!ne.M.P)throw new we(`Cannot pass deleted object as a pointer of type ${this.name}`);if(!this.ga&&ne.M.R.ga)throw new we(`Cannot convert argument of type ${ne.M.Y?ne.M.Y.name:ne.M.R.name} to parameter type ${this.name}`);if(Te=rt(ne.M.P,ne.M.R.N,this.N),this.ha){if(ne.M.V===void 0)throw new we("Passing raw pointer to smart pointer is illegal");switch(this.Ha){case 0:if(ne.M.Y===this)Te=ne.M.V;else throw new we(`Cannot convert argument of type ${ne.M.Y?ne.M.Y.name:ne.M.R.name} to parameter type ${this.name}`);break;case 1:Te=ne.M.V;break;case 2:if(ne.M.Y===this)Te=ne.M.V;else{var Ce=ne.clone();Te=this.Da(Te,Vi(()=>Ce.delete())),ce!==null&&ce.push(this.Z,Te)}break;default:throw new we("Unsupported sharing policy")}}return Te}function yi(ce,ne){if(ne===null){if(this.ia)throw new we(`null is not a valid ${this.name}`);return 0}if(!ne.M)throw new we(`Cannot pass "${ht(ne)}" as a ${this.name}`);if(!ne.M.P)throw new we(`Cannot pass deleted object as a pointer of type ${this.name}`);if(ne.M.R.ga)throw new we(`Cannot convert argument of type ${ne.M.R.name} to parameter type ${this.name}`);return rt(ne.M.P,ne.M.R.N,this.N)}var zi=(ce,ne,Te)=>ne===Te?ce:Te.W===void 0?null:(ce=zi(ce,ne,Te.W),ce===null?null:Te.ta(ce)),Si={},ui=(ce,ne)=>{if(ne===void 0)throw new we("ptr should not be undefined");for(;ce.W;)ne=ce.fa(ne),ce=ce.W;return Si[ne]},Ai=(ce,ne)=>{if(!ne.R||!ne.P)throw new fe("makeClassHandle requires ptr and ptrType");if(!!ne.Y!=!!ne.V)throw new fe("Both smartPtrType and smartPtr must be specified");return ne.count={value:1},qe(Object.create(ce,{M:{value:ne,writable:!0}}))};function zn(ce,ne,Te,Ce,Je,Tt,pt,St,bn,Gn,mn){this.name=ce,this.N=ne,this.ia=Te,this.ga=Ce,this.ha=Je,this.Ba=Tt,this.Ha=pt,this.pa=St,this.ka=bn,this.Da=Gn,this.Z=mn,Je||ne.W!==void 0?this.S=Yn:(this.S=Ce?Li:yi,this.T=null)}var tn=(ce,ne,Te)=>{if(!o.hasOwnProperty(ce))throw new fe("Replacing nonexistent public symbol");o[ce].U!==void 0&&Te!==void 0?o[ce].U[Te]=ne:(o[ce]=ne,o[ce].$=Te)},Hn=(ce,ne)=>{ce=ge(ce);var Te=NI.get(ne);if(typeof Te!="function")throw new we(`unknown function pointer with signature ${ce}: ${ne}`);return Te};class Ki extends Error{}var wr=ce=>{ce=db(ce);var ne=ge(ce);return Lm(ce),ne},so=(ce,ne)=>{function Te(Tt){Je[Tt]||ae[Tt]||(Ae[Tt]?Ae[Tt].forEach(Te):(Ce.push(Tt),Je[Tt]=!0))}var Ce=[],Je={};throw ne.forEach(Te),new Ki(`${ce}: `+Ce.map(wr).join([", "]))},Ts=(ce,ne)=>{for(var Te=[],Ce=0;Ce<ce;Ce++)Te.push(I[ne+4*Ce>>2]);return Te};function zs(ce){for(var ne=1;ne<ce.length;++ne)if(ce[ne]!==null&&ce[ne].T===void 0)return!0;return!1}function $r(ce,ne,Te,Ce,Je,Tt){var pt=ne.length;if(2>pt)throw new we("argTypes array size mismatch! Must at least get return value and 'this' types!");var St=ne[1]!==null&&Te!==null,bn=zs(ne);Te=!ne[0].oa;var Gn=ne[0],mn=ne[1];for(Ce=[ce,ve,Ce,Je,W,Gn.O.bind(Gn),mn?.S.bind(mn)],Je=2;Je<pt;++Je)Gn=ne[Je],Ce.push(Gn.S.bind(Gn));if(!bn)for(Je=St?1:2;Je<ne.length;++Je)ne[Je].T!==null&&Ce.push(ne[Je].T);for(bn=zs(ne),Je=ne.length-2,mn=[],Gn=["fn"],St&&Gn.push("thisWired"),pt=0;pt<Je;++pt)mn.push(`arg${pt}`),Gn.push(`arg${pt}Wired`);mn=mn.join(","),Gn=Gn.join(","),mn=`return function (${mn}) { `,bn&&(mn+=`var destructors = []; `);var Ao=bn?"destructors":"null",co="humanName throwBindingError invoker fn runDestructors fromRetWire toClassParamWire".split(" ");for(St&&(mn+=`var thisWired = toClassParamWire(${Ao}, this); `),pt=0;pt<Je;++pt){var Vs=`toArg${pt}Wire`;mn+=`var arg${pt}Wired = ${Vs}(${Ao}, arg${pt}); @@ -7135,7 +7005,7 @@ ${r.stack}`),r};Kc.getNodeTransform=function(e){return l(e.matrix)?e.matrix:M.fr `,co.push(`${Tt}_dtor`));return Te&&(mn+=`var ret = fromRetWire(rv); return ret; `),ne=new Function(co,mn+`} -`)(...Ce),vt(ce,ne)}var pi=ce=>{ce=ce.trim();let ne=ce.indexOf("(");return ne===-1?ce:ce.slice(0,ne)},ao=[],nr=[0,1,,1,null,1,!0,1,!1,1],jo=ce=>{9<ce&&--nr[ce+1]===0&&(nr[ce]=void 0,ao.push(ce))},Fn=ce=>{if(!ce)throw new we(`Cannot use deleted val. handle = ${ce}`);return nr[ce]},Vi=ce=>{switch(ce){case void 0:return 2;case null:return 4;case!0:return 6;case!1:return 8;default:let ne=ao.pop()||nr.length;return nr[ne]=ce,nr[ne+1]=1,ne}},Fi={name:"emscripten::val",O:ce=>{var ne=Fn(ce);return jo(ce),ne},S:(ce,ne)=>Vi(ne),X:J,T:null},Ir=(ce,ne,Te)=>{switch(ne){case 1:return Te?function(Ce){return this.O(x[Ce])}:function(Ce){return this.O(T[Ce])};case 2:return Te?function(Ce){return this.O(E[Ce>>1])}:function(Ce){return this.O(v[Ce>>1])};case 4:return Te?function(Ce){return this.O(S[Ce>>2])}:function(Ce){return this.O(I[Ce>>2])};default:throw new TypeError(`invalid integer width (${ne}): ${ce}`)}},Mc=(ce,ne)=>{var Te=ae[ce];if(Te===void 0)throw ce=`${ne} has unknown type ${wr(ce)}`,new we(ce);return Te},Yf=(ce,ne)=>{switch(ne){case 4:return function(Te){return this.O(R[Te>>2])};case 8:return function(Te){return this.O(O[Te>>3])};default:throw new TypeError(`invalid float width (${ne}): ${ce}`)}},Rm=(ce,ne,Te)=>{let Ce=(Je,Tt)=>{let pt=0;return{next(){if(pt>=Je)return{done:!0};let St=pt;return pt++,{value:Tt(St),done:!1}},[Symbol.iterator](){return this}}};ce[Symbol.iterator]||(ce[Symbol.iterator]=function(){let Je=this[ne]();return Ce(Je,Tt=>this[Te](Tt))})},ch=Object.assign({optional:!0},Fi),na=(ce,ne,Te)=>{var Ce=T;if(!(0<Te))return 0;var Je=ne;Te=ne+Te-1;for(var Tt=0;Tt<ce.length;++Tt){var pt=ce.codePointAt(Tt);if(127>=pt){if(ne>=Te)break;Ce[ne++]=pt}else if(2047>=pt){if(ne+1>=Te)break;Ce[ne++]=192|pt>>6,Ce[ne++]=128|pt&63}else if(65535>=pt){if(ne+2>=Te)break;Ce[ne++]=224|pt>>12,Ce[ne++]=128|pt>>6&63,Ce[ne++]=128|pt&63}else{if(ne+3>=Te)break;Ce[ne++]=240|pt>>18,Ce[ne++]=128|pt>>12&63,Ce[ne++]=128|pt>>6&63,Ce[ne++]=128|pt&63,Tt++}}return Ce[ne]=0,ne-Je},Om=ce=>{for(var ne=0,Te=0;Te<ce.length;++Te){var Ce=ce.charCodeAt(Te);127>=Ce?ne++:2047>=Ce?ne+=2:55296<=Ce&&57343>=Ce?(ne+=4,++Te):ne+=3}return ne},Es=new TextDecoder,Ha=(ce,ne,Te,Ce)=>{if(Te=ne+Te,Ce)return Te;for(;ce[ne]&&!(ne>=Te);)++ne;return ne},ub=new TextDecoder("utf-16le"),ii=(ce,ne,Te)=>(ce>>=1,ub.decode(v.subarray(ce,Ha(v,ce,ne/2,Te)))),Wr=(ce,ne,Te)=>{if(Te??(Te=2147483647),2>Te)return 0;Te-=2;var Ce=ne;Te=Te<2*ce.length?Te/2:ce.length;for(var Je=0;Je<Te;++Je)E[ne>>1]=ce.charCodeAt(Je),ne+=2;return E[ne>>1]=0,ne-Ce},_l=ce=>2*ce.length,w0=(ce,ne,Te)=>{var Ce="";ce>>=2;for(var Je=0;!(Je>=ne/4);Je++){var Tt=I[ce+Je];if(!Tt&&!Te)break;Ce+=String.fromCodePoint(Tt)}return Ce},Ca=(ce,ne,Te)=>{if(Te??(Te=2147483647),4>Te)return 0;var Ce=ne;Te=Ce+Te-4;for(var Je=0;Je<ce.length;++Je){var Tt=ce.codePointAt(Je);if(65535<Tt&&Je++,S[ne>>2]=Tt,ne+=4,ne+4>Te)break}return S[ne>>2]=0,ne-Ce},Mm=ce=>{for(var ne=0,Te=0;Te<ce.length;++Te)65535<ce.codePointAt(Te)&&Te++,ne+=4;return ne},b_=[],iq=ce=>{var ne=b_.length;return b_.push(ce),ne},rq=(ce,ne)=>{for(var Te=Array(ce),Ce=0;Ce<ce;++Ce)Te[Ce]=Mc(I[ne+4*Ce>>2],`parameter ${Ce}`);return Te},oq=(ce,ne,Te)=>{var Ce=[];return ce=ce(Ce,Te),Ce.length&&(I[ne>>2]=Vi(Ce)),ce},sq={},Nm=ce=>{var ne=sq[ce];return ne===void 0?ge(ce):ne},hE={},fb=()=>{var ce;if(!lh){var ne={USER:"web_user",LOGNAME:"web_user",PATH:"/",PWD:"/",HOME:"/home/web_user",LANG:(((ce=globalThis.navigator)==null?void 0:ce.language)??"C").replace("-","_")+".UTF-8",_:f||"./this.program"},Te;for(Te in hE)hE[Te]===void 0?delete ne[Te]:ne[Te]=hE[Te];var Ce=[];for(Te in ne)Ce.push(`${Te}=${ne[Te]}`);lh=Ce}return lh},lh,aq=[null,[],[]];if((()=>{let ce=st.prototype;Object.assign(ce,{isAliasOf:function(Te){if(!(this instanceof st&&Te instanceof st))return!1;var Ce=this.M.R.N,Je=this.M.P;Te.M=Te.M;var Tt=Te.M.R.N;for(Te=Te.M.P;Ce.W;)Je=Ce.fa(Je),Ce=Ce.W;for(;Tt.W;)Te=Tt.fa(Te),Tt=Tt.W;return Ce===Tt&&Je===Te},clone:function(){if(this.M.P||Ye(this),this.M.ea)return this.M.count.value+=1,this;var Te=qe,Ce=Object,Je=Ce.create,Tt=Object.getPrototypeOf(this),pt=this.M;return Te=Te(Je.call(Ce,Tt,{M:{value:{count:pt.count,da:pt.da,ea:pt.ea,P:pt.P,R:pt.R,V:pt.V,Y:pt.Y}}})),Te.M.count.value+=1,Te.M.da=!1,Te},delete(){if(this.M.P||Ye(this),this.M.da&&!this.M.ea)throw new we("Object already scheduled for deletion");Pe(this);var Te=this.M;--Te.count.value,Te.count.value===0&&(Te.V?Te.Y.Z(Te.V):Te.R.N.Z(Te.P)),this.M.ea||(this.M.V=void 0,this.M.P=void 0)},isDeleted:function(){return!this.M.P},deleteLater:function(){if(this.M.P||Ye(this),this.M.da&&!this.M.ea)throw new we("Object already scheduled for deletion");return this.M.da=!0,this}});let ne=Symbol.dispose;ne&&(ce[ne]=ce.delete)})(),Object.assign(zn.prototype,{wa(ce){return this.pa&&(ce=this.pa(ce)),ce},ma(ce){var ne;(ne=this.Z)==null||ne.call(this,ce)},X:J,O:function(ce){function ne(){return this.ha?Ai(this.N.ba,{R:this.Ba,P:Te,Y:this,V:ce}):Ai(this.N.ba,{R:this,P:ce})}var Te=this.wa(ce);if(!Te)return this.ma(ce),null;var Ce=ui(this.N,Te);if(Ce!==void 0)return Ce.M.count.value===0?(Ce.M.P=Te,Ce.M.V=ce,Ce.clone()):(Ce=Ce.clone(),this.ma(ce),Ce);if(Ce=this.N.va(Te),Ce=jt[Ce],!Ce)return ne.call(this);Ce=this.ga?Ce.sa:Ce.pointerType;var Je=zi(Te,this.N,Ce.N);return Je===null?ne.call(this):this.ha?Ai(Ce.N.ba,{R:Ce,P:Je,Y:this,V:ce}):Ai(Ce.N.ba,{R:Ce,P:Je})}}),o.print&&(p=o.print),o.printErr&&(g=o.printErr),o.thisProgram&&(f=o.thisProgram),o.preInit)for(typeof o.preInit=="function"&&(o.preInit=[o.preInit]);0<o.preInit.length;)o.preInit.shift()();var db,mE,Lm,hb,NI,pE={y:()=>D(""),r:ce=>{var ne=Q[ce];delete Q[ce];var Te=ne.ka,Ce=ne.Z,Je=ne.na,Tt=Je.map(pt=>pt.za).concat(Je.map(pt=>pt.Fa));xe([ce],Tt,pt=>{var St={},bn,Gn;for([bn,Gn]of Je.entries()){let mn=pt[bn],Ao=Gn.xa,co=Gn.ya,Vs=pt[bn+Je.length],pc=Gn.Ea,yl=Gn.Ga;St[Gn.ua]={read:tu=>mn.O(Ao(co,tu)),write:(tu,I0)=>{var Et=[];pc(yl,tu,Vs.S(Et,I0)),W(Et)},optional:mn.optional}}return[{name:ne.name,O:mn=>{var Ao={},co;for(co in St)Ao[co]=St[co].read(mn);return Ce(mn),Ao},S:(mn,Ao)=>{for(var co in St)if(!(co in Ao||St[co].optional))throw new TypeError(`Missing field: "${co}"`);var Vs=Te();for(co in St)St[co].write(Vs,Ao[co]);return mn!==null&&mn.push(Ce,Vs),Vs},X:J,T:Ce}]})},o:(ce,ne,Te,Ce,Je)=>{ne=ge(ne),Ce=Ce===0n;let Tt=pt=>pt;if(Ce){let pt=8*Te;Tt=St=>BigInt.asUintN(pt,St),Je=Tt(Je)}Qe(ce,{name:ne,O:Tt,S:(pt,St)=>(typeof St=="number"&&(St=BigInt(St)),St),X:He(ne,Te,!Ce),T:null})},C:(ce,ne,Te,Ce)=>{ne=ge(ne),Qe(ce,{name:ne,O:function(Je){return!!Je},S:function(Je,Tt){return Tt?Te:Ce},X:function(Je){return this.O(T[Je])},T:null})},k:(ce,ne,Te,Ce,Je,Tt,pt,St,bn,Gn,mn,Ao,co)=>{mn=ge(mn),Tt=Hn(Je,Tt),St&&(St=Hn(pt,St)),Gn&&(Gn=Hn(bn,Gn)),co=Hn(Ao,co);var Vs=ft(mn);mt(Vs,function(){so(`Cannot construct ${mn} due to unbound types`,[Ce])}),xe([ce,ne,Te],Ce?[Ce]:[],pc=>{if(pc=pc[0],Ce)var yl=pc.N,tu=yl.ba;else tu=st.prototype;pc=vt(mn,function(...Fe){if(Object.getPrototypeOf(this)!==I0)throw new we(`Use 'new' to construct ${mn}`);if(Et.aa===void 0)throw new we(`${mn} has no accessible constructor`);var gt=Et.aa[Fe.length];if(gt===void 0)throw new we(`Tried to invoke ctor of ${mn} with invalid number of parameters (${Fe.length}) - expected (${Object.keys(Et.aa).toString()}) parameters instead!`);return gt.apply(this,Fe)});var I0=Object.create(tu,{constructor:{value:pc}});pc.prototype=I0;var Et=new Yt(mn,pc,I0,co,yl,Tt,St,Gn);if(Et.W){var ye;(ye=Et.W).la??(ye.la=[]),Et.W.la.push(Et)}return yl=new zn(mn,Et,!0,!1,!1),ye=new zn(mn+"*",Et,!1,!1,!1),tu=new zn(mn+" const*",Et,!1,!0,!1),jt[ce]={pointerType:ye,sa:tu},tn(Vs,pc),[yl,ye,tu]})},g:(ce,ne,Te,Ce,Je,Tt)=>{var pt=Ts(ne,Te);Je=Hn(Ce,Je),xe([],[ce],St=>{St=St[0];var bn=`constructor ${St.name}`;if(St.N.aa===void 0&&(St.N.aa=[]),St.N.aa[ne-1]!==void 0)throw new we(`Cannot register multiple constructors with identical number of parameters (${ne-1}) for class '${St.name}'! Overload resolution is currently only performed using the parameter count, not actual type info!`);return St.N.aa[ne-1]=()=>{so(`Cannot construct ${St.name} due to unbound types`,pt)},xe([],pt,Gn=>(Gn.splice(1,0,null),St.N.aa[ne-1]=$r(bn,Gn,null,Je,Tt),[])),[]})},b:(ce,ne,Te,Ce,Je,Tt,pt,St,bn)=>{var Gn=Ts(Te,Ce);ne=ge(ne),ne=pi(ne),Tt=Hn(Je,Tt),xe([],[ce],mn=>{function Ao(){so(`Cannot call ${co} due to unbound types`,Gn)}mn=mn[0];var co=`${mn.name}.${ne}`;ne.startsWith("@@")&&(ne=Symbol[ne.substring(2)]),St&&mn.N.Ca.push(ne);var Vs=mn.N.ba,pc=Vs[ne];return pc===void 0||pc.U===void 0&&pc.className!==mn.name&&pc.$===Te-2?(Ao.$=Te-2,Ao.className=mn.name,Vs[ne]=Ao):(lt(Vs,ne,co),Vs[ne].U[Te-2]=Ao),xe([],Gn,yl=>(yl=$r(co,yl,mn,Tt,pt,bn),Vs[ne].U===void 0?(yl.$=Te-2,Vs[ne]=yl):Vs[ne].U[Te-2]=yl,[])),[]})},A:ce=>Qe(ce,Fi),s:(ce,ne,Te,Ce,Je)=>{switch(ne=ge(ne),Je=Je===0?"object":Je===1?"number":"string",Je){case"object":let pt=function(){};pt.values={},Qe(ce,{name:ne,constructor:pt,valueType:Je,O:function(St){return this.constructor.values[St]},S:(St,bn)=>bn.value,X:Ir(ne,Te,Ce),T:null}),mt(ne,pt);break;case"number":var Tt={};Qe(ce,{name:ne,ja:Tt,valueType:Je,O:St=>St,S:(St,bn)=>bn,X:Ir(ne,Te,Ce),T:null}),mt(ne,Tt),delete o[ne].$;break;case"string":Tt={},Qe(ce,{name:ne,ra:{},qa:{},ja:Tt,valueType:Je,O:function(St){return this.qa[St]},S:function(St,bn){return this.ra[bn]},X:Ir(ne,Te,Ce),T:null}),mt(ne,Tt),delete o[ne].$}},d:(ce,ne,Te)=>{var Ce=Mc(ce,"enum");switch(ne=ge(ne),Ce.valueType){case"object":ce=Ce.constructor,Ce=Object.create(Ce.constructor.prototype,{value:{value:Te},constructor:{value:vt(`${Ce.name}_${ne}`,function(){})}}),ce.values[Te]=Ce,ce[ne]=Ce;break;case"number":Ce.ja[ne]=Te;break;case"string":Ce.ra[ne]=Te,Ce.qa[Te]=ne,Ce.ja[ne]=ne}},n:(ce,ne,Te)=>{ne=ge(ne),Qe(ce,{name:ne,O:Ce=>Ce,S:(Ce,Je)=>Je,X:Yf(ne,Te),T:null})},m:(ce,ne,Te,Ce,Je,Tt,pt)=>{var St=Ts(ne,Te);ce=ge(ce),ce=pi(ce),Je=Hn(Ce,Je),mt(ce,function(){so(`Cannot call ${ce} due to unbound types`,St)},ne-1),xe([],St,bn=>(bn=[bn[0],null].concat(bn.slice(1)),tn(ce,$r(ce,bn,null,Je,Tt,pt),ne-1),[]))},c:(ce,ne,Te,Ce,Je)=>{ne=ge(ne);let Tt=St=>St;if(Ce===0){var pt=32-8*Te;Tt=St=>St<<pt>>>pt,Je=Tt(Je)}Qe(ce,{name:ne,O:Tt,S:(St,bn)=>bn,X:He(ne,Te,Ce!==0),T:null})},j:(ce,ne,Te,Ce)=>{Te=ge(Te),Ce=ge(Ce),xe([],[ce,ne],Je=>(Rm(Je[0].N.ba,Te,Ce),[]))},a:(ce,ne,Te)=>{function Ce(Tt){return new Je(x.buffer,I[Tt+4>>2],I[Tt>>2])}var Je=[Int8Array,Uint8Array,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array,BigInt64Array,BigUint64Array][ne];Te=ge(Te),Qe(ce,{name:Te,O:Ce,X:Ce},{Aa:!0})},h:ce=>{Qe(ce,ch)},B:(ce,ne)=>{ne=ge(ne),Qe(ce,{name:ne,O(Te){var Ce=(Ce=Te+4)?Es.decode(T.subarray(Ce,Ha(T,Ce,I[Te>>2],!0))):"";return Lm(Te),Ce},S(Te,Ce){Ce instanceof ArrayBuffer&&(Ce=new Uint8Array(Ce));var Je=typeof Ce=="string";if(!(Je||ArrayBuffer.isView(Ce)&&Ce.BYTES_PER_ELEMENT==1))throw new we("Cannot pass non-string to std::string");var Tt=Je?Om(Ce):Ce.length,pt=mE(4+Tt+1),St=pt+4;return I[pt>>2]=Tt,Je?na(Ce,St,Tt+1):T.set(Ce,St),Te!==null&&Te.push(Lm,pt),pt},X:J,T(Te){Lm(Te)}})},f:(ce,ne,Te)=>{if(Te=ge(Te),ne===2)var Ce=ii,Je=Wr,Tt=_l;else Ce=w0,Je=Ca,Tt=Mm;Qe(ce,{name:Te,O:pt=>{var St=Ce(pt+4,I[pt>>2]*ne,!0);return Lm(pt),St},S:(pt,St)=>{if(typeof St!="string")throw new we(`Cannot pass non-string to C++ string type ${Te}`);var bn=Tt(St),Gn=mE(4+bn+ne);return I[Gn>>2]=bn/ne,Je(St,Gn+4,bn+ne),pt!==null&&pt.push(Lm,Gn),Gn},X:J,T(pt){Lm(pt)}})},i:(ce,ne,Te,Ce,Je,Tt)=>{Q[ce]={name:ge(ne),ka:Hn(Te,Ce),Z:Hn(Je,Tt),na:[]}},e:(ce,ne,Te,Ce,Je,Tt,pt,St,bn,Gn)=>{Q[ce].na.push({ua:ge(ne),za:Te,xa:Hn(Ce,Je),ya:Tt,Fa:pt,Ea:Hn(St,bn),Ga:Gn})},D:(ce,ne)=>{ne=ge(ne),Qe(ce,{oa:!0,name:ne,O:()=>{},S:()=>{}})},q:(ce,ne,Te)=>{var[Ce,...Je]=rq(ce,ne);ne=Ce.S.bind(Ce);var Tt=Je.map(bn=>bn.X.bind(bn));ce--;var pt={toValue:Fn};switch(ce=Tt.map((bn,Gn)=>{var mn=`argFromPtr${Gn}`;return pt[mn]=bn,`${mn}(args${Gn?"+"+8*Gn:""})`}),Te){case 0:var St="toValue(handle)";break;case 2:St="new (toValue(handle))";break;case 3:St="";break;case 1:pt.getStringOrSymbol=Nm,St="toValue(handle)[getStringOrSymbol(methodName)]"}return St+=`(${ce})`,Ce.oa||(pt.toReturnWire=ne,pt.emval_returnValue=oq,St=`return emval_returnValue(toReturnWire, destructorsRef, ${St})`),St=`return function (handle, methodName, destructorsRef, args) { +`)(...Ce),vt(ce,ne)}var pi=ce=>{ce=ce.trim();let ne=ce.indexOf("(");return ne===-1?ce:ce.slice(0,ne)},ao=[],nr=[0,1,,1,null,1,!0,1,!1,1],jo=ce=>{9<ce&&--nr[ce+1]===0&&(nr[ce]=void 0,ao.push(ce))},Fn=ce=>{if(!ce)throw new we(`Cannot use deleted val. handle = ${ce}`);return nr[ce]},Vi=ce=>{switch(ce){case void 0:return 2;case null:return 4;case!0:return 6;case!1:return 8;default:let ne=ao.pop()||nr.length;return nr[ne]=ce,nr[ne+1]=1,ne}},Fi={name:"emscripten::val",O:ce=>{var ne=Fn(ce);return jo(ce),ne},S:(ce,ne)=>Vi(ne),X:J,T:null},Ir=(ce,ne,Te)=>{switch(ne){case 1:return Te?function(Ce){return this.O(x[Ce])}:function(Ce){return this.O(T[Ce])};case 2:return Te?function(Ce){return this.O(E[Ce>>1])}:function(Ce){return this.O(v[Ce>>1])};case 4:return Te?function(Ce){return this.O(S[Ce>>2])}:function(Ce){return this.O(I[Ce>>2])};default:throw new TypeError(`invalid integer width (${ne}): ${ce}`)}},Mc=(ce,ne)=>{var Te=ae[ce];if(Te===void 0)throw ce=`${ne} has unknown type ${wr(ce)}`,new we(ce);return Te},qf=(ce,ne)=>{switch(ne){case 4:return function(Te){return this.O(R[Te>>2])};case 8:return function(Te){return this.O(O[Te>>3])};default:throw new TypeError(`invalid float width (${ne}): ${ce}`)}},Rm=(ce,ne,Te)=>{let Ce=(Je,Tt)=>{let pt=0;return{next(){if(pt>=Je)return{done:!0};let St=pt;return pt++,{value:Tt(St),done:!1}},[Symbol.iterator](){return this}}};ce[Symbol.iterator]||(ce[Symbol.iterator]=function(){let Je=this[ne]();return Ce(Je,Tt=>this[Te](Tt))})},ch=Object.assign({optional:!0},Fi),na=(ce,ne,Te)=>{var Ce=T;if(!(0<Te))return 0;var Je=ne;Te=ne+Te-1;for(var Tt=0;Tt<ce.length;++Tt){var pt=ce.codePointAt(Tt);if(127>=pt){if(ne>=Te)break;Ce[ne++]=pt}else if(2047>=pt){if(ne+1>=Te)break;Ce[ne++]=192|pt>>6,Ce[ne++]=128|pt&63}else if(65535>=pt){if(ne+2>=Te)break;Ce[ne++]=224|pt>>12,Ce[ne++]=128|pt>>6&63,Ce[ne++]=128|pt&63}else{if(ne+3>=Te)break;Ce[ne++]=240|pt>>18,Ce[ne++]=128|pt>>12&63,Ce[ne++]=128|pt>>6&63,Ce[ne++]=128|pt&63,Tt++}}return Ce[ne]=0,ne-Je},Om=ce=>{for(var ne=0,Te=0;Te<ce.length;++Te){var Ce=ce.charCodeAt(Te);127>=Ce?ne++:2047>=Ce?ne+=2:55296<=Ce&&57343>=Ce?(ne+=4,++Te):ne+=3}return ne},Es=new TextDecoder,Ha=(ce,ne,Te,Ce)=>{if(Te=ne+Te,Ce)return Te;for(;ce[ne]&&!(ne>=Te);)++ne;return ne},ub=new TextDecoder("utf-16le"),ii=(ce,ne,Te)=>(ce>>=1,ub.decode(v.subarray(ce,Ha(v,ce,ne/2,Te)))),Wr=(ce,ne,Te)=>{if(Te??(Te=2147483647),2>Te)return 0;Te-=2;var Ce=ne;Te=Te<2*ce.length?Te/2:ce.length;for(var Je=0;Je<Te;++Je)E[ne>>1]=ce.charCodeAt(Je),ne+=2;return E[ne>>1]=0,ne-Ce},_l=ce=>2*ce.length,w0=(ce,ne,Te)=>{var Ce="";ce>>=2;for(var Je=0;!(Je>=ne/4);Je++){var Tt=I[ce+Je];if(!Tt&&!Te)break;Ce+=String.fromCodePoint(Tt)}return Ce},Ca=(ce,ne,Te)=>{if(Te??(Te=2147483647),4>Te)return 0;var Ce=ne;Te=Ce+Te-4;for(var Je=0;Je<ce.length;++Je){var Tt=ce.codePointAt(Je);if(65535<Tt&&Je++,S[ne>>2]=Tt,ne+=4,ne+4>Te)break}return S[ne>>2]=0,ne-Ce},Mm=ce=>{for(var ne=0,Te=0;Te<ce.length;++Te)65535<ce.codePointAt(Te)&&Te++,ne+=4;return ne},b_=[],iq=ce=>{var ne=b_.length;return b_.push(ce),ne},rq=(ce,ne)=>{for(var Te=Array(ce),Ce=0;Ce<ce;++Ce)Te[Ce]=Mc(I[ne+4*Ce>>2],`parameter ${Ce}`);return Te},oq=(ce,ne,Te)=>{var Ce=[];return ce=ce(Ce,Te),Ce.length&&(I[ne>>2]=Vi(Ce)),ce},sq={},Nm=ce=>{var ne=sq[ce];return ne===void 0?ge(ce):ne},hE={},fb=()=>{var ce;if(!lh){var ne={USER:"web_user",LOGNAME:"web_user",PATH:"/",PWD:"/",HOME:"/home/web_user",LANG:(((ce=globalThis.navigator)==null?void 0:ce.language)??"C").replace("-","_")+".UTF-8",_:f||"./this.program"},Te;for(Te in hE)hE[Te]===void 0?delete ne[Te]:ne[Te]=hE[Te];var Ce=[];for(Te in ne)Ce.push(`${Te}=${ne[Te]}`);lh=Ce}return lh},lh,aq=[null,[],[]];if((()=>{let ce=st.prototype;Object.assign(ce,{isAliasOf:function(Te){if(!(this instanceof st&&Te instanceof st))return!1;var Ce=this.M.R.N,Je=this.M.P;Te.M=Te.M;var Tt=Te.M.R.N;for(Te=Te.M.P;Ce.W;)Je=Ce.fa(Je),Ce=Ce.W;for(;Tt.W;)Te=Tt.fa(Te),Tt=Tt.W;return Ce===Tt&&Je===Te},clone:function(){if(this.M.P||Ye(this),this.M.ea)return this.M.count.value+=1,this;var Te=qe,Ce=Object,Je=Ce.create,Tt=Object.getPrototypeOf(this),pt=this.M;return Te=Te(Je.call(Ce,Tt,{M:{value:{count:pt.count,da:pt.da,ea:pt.ea,P:pt.P,R:pt.R,V:pt.V,Y:pt.Y}}})),Te.M.count.value+=1,Te.M.da=!1,Te},delete(){if(this.M.P||Ye(this),this.M.da&&!this.M.ea)throw new we("Object already scheduled for deletion");Pe(this);var Te=this.M;--Te.count.value,Te.count.value===0&&(Te.V?Te.Y.Z(Te.V):Te.R.N.Z(Te.P)),this.M.ea||(this.M.V=void 0,this.M.P=void 0)},isDeleted:function(){return!this.M.P},deleteLater:function(){if(this.M.P||Ye(this),this.M.da&&!this.M.ea)throw new we("Object already scheduled for deletion");return this.M.da=!0,this}});let ne=Symbol.dispose;ne&&(ce[ne]=ce.delete)})(),Object.assign(zn.prototype,{wa(ce){return this.pa&&(ce=this.pa(ce)),ce},ma(ce){var ne;(ne=this.Z)==null||ne.call(this,ce)},X:J,O:function(ce){function ne(){return this.ha?Ai(this.N.ba,{R:this.Ba,P:Te,Y:this,V:ce}):Ai(this.N.ba,{R:this,P:ce})}var Te=this.wa(ce);if(!Te)return this.ma(ce),null;var Ce=ui(this.N,Te);if(Ce!==void 0)return Ce.M.count.value===0?(Ce.M.P=Te,Ce.M.V=ce,Ce.clone()):(Ce=Ce.clone(),this.ma(ce),Ce);if(Ce=this.N.va(Te),Ce=jt[Ce],!Ce)return ne.call(this);Ce=this.ga?Ce.sa:Ce.pointerType;var Je=zi(Te,this.N,Ce.N);return Je===null?ne.call(this):this.ha?Ai(Ce.N.ba,{R:Ce,P:Je,Y:this,V:ce}):Ai(Ce.N.ba,{R:Ce,P:Je})}}),o.print&&(p=o.print),o.printErr&&(g=o.printErr),o.thisProgram&&(f=o.thisProgram),o.preInit)for(typeof o.preInit=="function"&&(o.preInit=[o.preInit]);0<o.preInit.length;)o.preInit.shift()();var db,mE,Lm,hb,NI,pE={y:()=>D(""),r:ce=>{var ne=Q[ce];delete Q[ce];var Te=ne.ka,Ce=ne.Z,Je=ne.na,Tt=Je.map(pt=>pt.za).concat(Je.map(pt=>pt.Fa));xe([ce],Tt,pt=>{var St={},bn,Gn;for([bn,Gn]of Je.entries()){let mn=pt[bn],Ao=Gn.xa,co=Gn.ya,Vs=pt[bn+Je.length],pc=Gn.Ea,yl=Gn.Ga;St[Gn.ua]={read:tu=>mn.O(Ao(co,tu)),write:(tu,I0)=>{var Et=[];pc(yl,tu,Vs.S(Et,I0)),W(Et)},optional:mn.optional}}return[{name:ne.name,O:mn=>{var Ao={},co;for(co in St)Ao[co]=St[co].read(mn);return Ce(mn),Ao},S:(mn,Ao)=>{for(var co in St)if(!(co in Ao||St[co].optional))throw new TypeError(`Missing field: "${co}"`);var Vs=Te();for(co in St)St[co].write(Vs,Ao[co]);return mn!==null&&mn.push(Ce,Vs),Vs},X:J,T:Ce}]})},o:(ce,ne,Te,Ce,Je)=>{ne=ge(ne),Ce=Ce===0n;let Tt=pt=>pt;if(Ce){let pt=8*Te;Tt=St=>BigInt.asUintN(pt,St),Je=Tt(Je)}Qe(ce,{name:ne,O:Tt,S:(pt,St)=>(typeof St=="number"&&(St=BigInt(St)),St),X:He(ne,Te,!Ce),T:null})},C:(ce,ne,Te,Ce)=>{ne=ge(ne),Qe(ce,{name:ne,O:function(Je){return!!Je},S:function(Je,Tt){return Tt?Te:Ce},X:function(Je){return this.O(T[Je])},T:null})},k:(ce,ne,Te,Ce,Je,Tt,pt,St,bn,Gn,mn,Ao,co)=>{mn=ge(mn),Tt=Hn(Je,Tt),St&&(St=Hn(pt,St)),Gn&&(Gn=Hn(bn,Gn)),co=Hn(Ao,co);var Vs=ft(mn);mt(Vs,function(){so(`Cannot construct ${mn} due to unbound types`,[Ce])}),xe([ce,ne,Te],Ce?[Ce]:[],pc=>{if(pc=pc[0],Ce)var yl=pc.N,tu=yl.ba;else tu=st.prototype;pc=vt(mn,function(...Fe){if(Object.getPrototypeOf(this)!==I0)throw new we(`Use 'new' to construct ${mn}`);if(Et.aa===void 0)throw new we(`${mn} has no accessible constructor`);var gt=Et.aa[Fe.length];if(gt===void 0)throw new we(`Tried to invoke ctor of ${mn} with invalid number of parameters (${Fe.length}) - expected (${Object.keys(Et.aa).toString()}) parameters instead!`);return gt.apply(this,Fe)});var I0=Object.create(tu,{constructor:{value:pc}});pc.prototype=I0;var Et=new Yt(mn,pc,I0,co,yl,Tt,St,Gn);if(Et.W){var ye;(ye=Et.W).la??(ye.la=[]),Et.W.la.push(Et)}return yl=new zn(mn,Et,!0,!1,!1),ye=new zn(mn+"*",Et,!1,!1,!1),tu=new zn(mn+" const*",Et,!1,!0,!1),jt[ce]={pointerType:ye,sa:tu},tn(Vs,pc),[yl,ye,tu]})},g:(ce,ne,Te,Ce,Je,Tt)=>{var pt=Ts(ne,Te);Je=Hn(Ce,Je),xe([],[ce],St=>{St=St[0];var bn=`constructor ${St.name}`;if(St.N.aa===void 0&&(St.N.aa=[]),St.N.aa[ne-1]!==void 0)throw new we(`Cannot register multiple constructors with identical number of parameters (${ne-1}) for class '${St.name}'! Overload resolution is currently only performed using the parameter count, not actual type info!`);return St.N.aa[ne-1]=()=>{so(`Cannot construct ${St.name} due to unbound types`,pt)},xe([],pt,Gn=>(Gn.splice(1,0,null),St.N.aa[ne-1]=$r(bn,Gn,null,Je,Tt),[])),[]})},b:(ce,ne,Te,Ce,Je,Tt,pt,St,bn)=>{var Gn=Ts(Te,Ce);ne=ge(ne),ne=pi(ne),Tt=Hn(Je,Tt),xe([],[ce],mn=>{function Ao(){so(`Cannot call ${co} due to unbound types`,Gn)}mn=mn[0];var co=`${mn.name}.${ne}`;ne.startsWith("@@")&&(ne=Symbol[ne.substring(2)]),St&&mn.N.Ca.push(ne);var Vs=mn.N.ba,pc=Vs[ne];return pc===void 0||pc.U===void 0&&pc.className!==mn.name&&pc.$===Te-2?(Ao.$=Te-2,Ao.className=mn.name,Vs[ne]=Ao):(lt(Vs,ne,co),Vs[ne].U[Te-2]=Ao),xe([],Gn,yl=>(yl=$r(co,yl,mn,Tt,pt,bn),Vs[ne].U===void 0?(yl.$=Te-2,Vs[ne]=yl):Vs[ne].U[Te-2]=yl,[])),[]})},A:ce=>Qe(ce,Fi),s:(ce,ne,Te,Ce,Je)=>{switch(ne=ge(ne),Je=Je===0?"object":Je===1?"number":"string",Je){case"object":let pt=function(){};pt.values={},Qe(ce,{name:ne,constructor:pt,valueType:Je,O:function(St){return this.constructor.values[St]},S:(St,bn)=>bn.value,X:Ir(ne,Te,Ce),T:null}),mt(ne,pt);break;case"number":var Tt={};Qe(ce,{name:ne,ja:Tt,valueType:Je,O:St=>St,S:(St,bn)=>bn,X:Ir(ne,Te,Ce),T:null}),mt(ne,Tt),delete o[ne].$;break;case"string":Tt={},Qe(ce,{name:ne,ra:{},qa:{},ja:Tt,valueType:Je,O:function(St){return this.qa[St]},S:function(St,bn){return this.ra[bn]},X:Ir(ne,Te,Ce),T:null}),mt(ne,Tt),delete o[ne].$}},d:(ce,ne,Te)=>{var Ce=Mc(ce,"enum");switch(ne=ge(ne),Ce.valueType){case"object":ce=Ce.constructor,Ce=Object.create(Ce.constructor.prototype,{value:{value:Te},constructor:{value:vt(`${Ce.name}_${ne}`,function(){})}}),ce.values[Te]=Ce,ce[ne]=Ce;break;case"number":Ce.ja[ne]=Te;break;case"string":Ce.ra[ne]=Te,Ce.qa[Te]=ne,Ce.ja[ne]=ne}},n:(ce,ne,Te)=>{ne=ge(ne),Qe(ce,{name:ne,O:Ce=>Ce,S:(Ce,Je)=>Je,X:qf(ne,Te),T:null})},m:(ce,ne,Te,Ce,Je,Tt,pt)=>{var St=Ts(ne,Te);ce=ge(ce),ce=pi(ce),Je=Hn(Ce,Je),mt(ce,function(){so(`Cannot call ${ce} due to unbound types`,St)},ne-1),xe([],St,bn=>(bn=[bn[0],null].concat(bn.slice(1)),tn(ce,$r(ce,bn,null,Je,Tt,pt),ne-1),[]))},c:(ce,ne,Te,Ce,Je)=>{ne=ge(ne);let Tt=St=>St;if(Ce===0){var pt=32-8*Te;Tt=St=>St<<pt>>>pt,Je=Tt(Je)}Qe(ce,{name:ne,O:Tt,S:(St,bn)=>bn,X:He(ne,Te,Ce!==0),T:null})},j:(ce,ne,Te,Ce)=>{Te=ge(Te),Ce=ge(Ce),xe([],[ce,ne],Je=>(Rm(Je[0].N.ba,Te,Ce),[]))},a:(ce,ne,Te)=>{function Ce(Tt){return new Je(x.buffer,I[Tt+4>>2],I[Tt>>2])}var Je=[Int8Array,Uint8Array,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array,BigInt64Array,BigUint64Array][ne];Te=ge(Te),Qe(ce,{name:Te,O:Ce,X:Ce},{Aa:!0})},h:ce=>{Qe(ce,ch)},B:(ce,ne)=>{ne=ge(ne),Qe(ce,{name:ne,O(Te){var Ce=(Ce=Te+4)?Es.decode(T.subarray(Ce,Ha(T,Ce,I[Te>>2],!0))):"";return Lm(Te),Ce},S(Te,Ce){Ce instanceof ArrayBuffer&&(Ce=new Uint8Array(Ce));var Je=typeof Ce=="string";if(!(Je||ArrayBuffer.isView(Ce)&&Ce.BYTES_PER_ELEMENT==1))throw new we("Cannot pass non-string to std::string");var Tt=Je?Om(Ce):Ce.length,pt=mE(4+Tt+1),St=pt+4;return I[pt>>2]=Tt,Je?na(Ce,St,Tt+1):T.set(Ce,St),Te!==null&&Te.push(Lm,pt),pt},X:J,T(Te){Lm(Te)}})},f:(ce,ne,Te)=>{if(Te=ge(Te),ne===2)var Ce=ii,Je=Wr,Tt=_l;else Ce=w0,Je=Ca,Tt=Mm;Qe(ce,{name:Te,O:pt=>{var St=Ce(pt+4,I[pt>>2]*ne,!0);return Lm(pt),St},S:(pt,St)=>{if(typeof St!="string")throw new we(`Cannot pass non-string to C++ string type ${Te}`);var bn=Tt(St),Gn=mE(4+bn+ne);return I[Gn>>2]=bn/ne,Je(St,Gn+4,bn+ne),pt!==null&&pt.push(Lm,Gn),Gn},X:J,T(pt){Lm(pt)}})},i:(ce,ne,Te,Ce,Je,Tt)=>{Q[ce]={name:ge(ne),ka:Hn(Te,Ce),Z:Hn(Je,Tt),na:[]}},e:(ce,ne,Te,Ce,Je,Tt,pt,St,bn,Gn)=>{Q[ce].na.push({ua:ge(ne),za:Te,xa:Hn(Ce,Je),ya:Tt,Fa:pt,Ea:Hn(St,bn),Ga:Gn})},D:(ce,ne)=>{ne=ge(ne),Qe(ce,{oa:!0,name:ne,O:()=>{},S:()=>{}})},q:(ce,ne,Te)=>{var[Ce,...Je]=rq(ce,ne);ne=Ce.S.bind(Ce);var Tt=Je.map(bn=>bn.X.bind(bn));ce--;var pt={toValue:Fn};switch(ce=Tt.map((bn,Gn)=>{var mn=`argFromPtr${Gn}`;return pt[mn]=bn,`${mn}(args${Gn?"+"+8*Gn:""})`}),Te){case 0:var St="toValue(handle)";break;case 2:St="new (toValue(handle))";break;case 3:St="";break;case 1:pt.getStringOrSymbol=Nm,St="toValue(handle)[getStringOrSymbol(methodName)]"}return St+=`(${ce})`,Ce.oa||(pt.toReturnWire=ne,pt.emval_returnValue=oq,St=`return emval_returnValue(toReturnWire, destructorsRef, ${St})`),St=`return function (handle, methodName, destructorsRef, args) { ${St} }`,Te=new Function(Object.keys(pt),St)(...Object.values(pt)),St=`methodCaller<(${Je.map(bn=>bn.name)}) => ${Ce.name}>`,iq(vt(St,Te))},F:jo,p:(ce,ne,Te,Ce,Je)=>b_[ce](ne,Te,Ce,Je),E:ce=>{var ne=Fn(ce);W(ne),jo(ce)},t:(ce,ne,Te,Ce)=>{var Je=new Date().getFullYear(),Tt=new Date(Je,0,1).getTimezoneOffset();Je=new Date(Je,6,1).getTimezoneOffset(),I[ce>>2]=60*Math.max(Tt,Je),S[ne>>2]=+(Tt!=Je),ne=pt=>{var St=Math.abs(pt);return`UTC${0<=pt?"-":"+"}${String(Math.floor(St/60)).padStart(2,"0")}${String(St%60).padStart(2,"0")}`},ce=ne(Tt),ne=ne(Je),Je<Tt?(na(ce,Te,17),na(ne,Ce,17)):(na(ce,Ce,17),na(ne,Te,17))},z:ce=>{var ne=T.length;if(ce>>>=0,2147483648<ce)return!1;for(var Te=1;4>=Te;Te*=2){var Ce=ne*(1+.2/Te);Ce=Math.min(Ce,ce+100663296);e:{Ce=(Math.min(2147483648,65536*Math.ceil(Math.max(ce,Ce)/65536))-hb.buffer.byteLength+65535)/65536|0;try{hb.grow(Ce),w();var Je=1;break e}catch{}Je=void 0}if(Je)return!0}return!1},u:(ce,ne)=>{var Te=0,Ce=0,Je;for(Je of fb()){var Tt=ne+Te;I[ce+Ce>>2]=Tt,Te+=na(Je,Tt,1/0)+1,Ce+=4}return 0},v:(ce,ne)=>{var Te=fb();I[ce>>2]=Te.length,ce=0;for(var Ce of Te)ce+=Om(Ce)+1;return I[ne>>2]=ce,0},w:()=>52,x:function(){return 70},l:(ce,ne,Te,Ce)=>{for(var Je=0,Tt=0;Tt<Te;Tt++){var pt=I[ne>>2],St=I[ne+4>>2];ne+=8;for(var bn=0;bn<St;bn++){var Gn=ce,mn=T[pt+bn],Ao=aq[Gn];mn===0||mn===10?(Gn=Gn===1?p:g,mn=Ha(Ao,0),mn=Es.decode(Ao.buffer?Ao.subarray(0,mn):new Uint8Array(Ao.slice(0,mn))),Gn(mn),Ao.length=0):Ao.push(mn)}Je+=St}return I[Ce>>2]=Je,0}},x_;return x_=await(async function(){function ce(Te){return Te=x_=Te.exports,db=Te.J,mE=o._malloc=Te.K,Lm=o._free=Te.L,hb=Te.G,NI=Te.I,w(),x_}var ne={a:pE};return o.instantiateWasm?new Promise(Te=>{o.instantiateWasm(ne,(Ce,Je)=>{Te(ce(Ce))})}):(N??(N=y(`\0asm\0\0\0\xD79\`\x7F\x7F\`\x7F\x7F\0\`\x7F\x7F\x7F\x7F\`\x7F\x7F\x7F\`\x7F\0\`\x7F\x7F\x7F\x7F\x7F\x7F\x7F\`\x7F\x7F\x7F\x7F\x7F\`\x7F\x7F\x7F\0\`\x7F\x7F\x7F\x7F\0\`\x7F\x7F\x7F\x7F\x7F\x7F\`\x7F\x7F\x7F\x7F\x7F\0\`\x7F\x7F\x7F\x7F\x7F\x7F\0\`\b\x7F\x7F\x7F\x7F\x7F\x7F\x7F\x7F\x7F\`\0\0\`\x07\x7F\x7F\x7F\x7F\x7F\x7F\x7F\x7F\`\x7F~~~~\0\`\0\x7F\` \x7F\x7F\x7F\x7F\x7F\x7F\x7F\x7F\x7F\x7F\0\`\x07\x7F\x7F\x7F\x7F\x7F\x7F\x7F\0\`\x7F\x7F\x7F\x7F~\x7F\`\b\x7F\x7F\x7F\x7F\x7F\x7F\x7F\x7F\0\`\x7F~~\x7F\0\`\x7F~\x7F~\`\x7F\x7F~\x7F\x7F\0\` @@ -8155,7 +8025,7 @@ OW\xC6\xBF\xA0\x8E\v{"^\xF2?\0\x81\x9C\xC7+\xAA\xC1\xBF?4JJ\xBB\xF1?^\x8C\xCEv \0\0\0d\0\0\0\xE8\0\0'\0\0\xA0\x86\0@B\0\x80\x96\x98\0\0\xE1\xF5\0\xCA\x9A;\0\0\0\0\0\0\0\x0000010203040506070809101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899\0\0\0\0\0\0\0\x00000000010010001101000101011001111000100110101011110011011110111100010203040506071011121314151617202122232425262730313233343536374041424344454647505152535455565760616263646566677071727374757677000102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f202122232425262728292a2b2c2d2e2f303132333435363738393a3b3c3d3e3f404142434445464748494a4b4c4d4e4f505152535455565758595a5b5c5d5e5f606162636465666768696a6b6c6d6e6f707172737475767778797a7b7c7d7e7f808182838485868788898a8b8c8d8e8f909192939495969798999a9b9c9d9e9fa0a1a2a3a4a5a6a7a8a9aaabacadaeafb0b1b2b3b4b5b6b7b8b9babbbcbdbebfc0c1c2c3c4c5c6c7c8c9cacbcccdcecfd0d1d2d3d4d5d6d7d8d9dadbdcdddedfe0e1e2e3e4e5e6e7e8e9eaebecedeeeff0f1f2f3f4f5f6f7f8f9fafbfcfdfeff\0\0\0\0\0\0\0\0 \0\0\0\0\0\0\0d\0\0\0\0\0\0\0\xE8\0\0\0\0\0\0'\0\0\0\0\0\0\xA0\x86\0\0\0\0\0@B\0\0\0\0\0\x80\x96\x98\0\0\0\0\0\0\xE1\xF5\0\0\0\0\0\xCA\x9A;\0\0\0\0\0\xE4\vT\0\0\0\0\xE8vH\0\0\0\0\xA5\xD4\xE8\0\0\0\0\xA0rN \0\0\0@z\xF3Z\0\0\0\x80\xC6\xA4~\x8D\0\0\0\xC1o\xF2\x86#\0\0\0\x8A]xEc\0\0d\xA7\xB3\xB6\xE0\r\0\0\xE8\x89#\xC7\x8A\xA4d\0\0\xF8a\0\0NSt3__214__shared_countE\0\0\0\0hf\0\0\xCCd\0\0$b\0\0\x98e\0\0N10__cxxabiv116__shim_type_infoE\0\0\0\0\xCCd\0\0Tb\0\0b\0\0N10__cxxabiv117__class_type_infoE\0\0\0\xCCd\0\0\x84b\0\0b\0\0N10__cxxabiv117__pbase_type_infoE\0\0\0\xCCd\0\0\xB4b\0\0xb\0\0N10__cxxabiv119__pointer_type_infoE\0\xCCd\0\0\xE4b\0\0b\0\0N10__cxxabiv120__function_type_infoE\0\0\0\0\xCCd\0\0c\0\0xb\0\0N10__cxxabiv129__pointer_to_member_type_infoE\0\0\0\0\0\0\0dc\0\0g\0\0h\0\0i\0\0j\0\0k\0\0\xCCd\0\0pc\0\0b\0\0N10__cxxabiv123__fundamental_type_infoE\0Pc\0\0\xA0c\0\0v\0Dn\0\0\0\0Pc\0\0\xB0c\0\0b\0\0\0Pc\0\0\xBCc\0\0c\0\0\0Pc\0\0\xC8c\0\0h\0\0\0Pc\0\0\xD4c\0\0a\0\0\0Pc\0\0\xE0c\0\0s\0\0\0Pc\0\0\xECc\0\0t\0\0\0Pc\0\0\xF8c\0\0i\0\0\0Pc\0\0d\0\0j\0\0\0Pc\0\0d\0\0l\0\0\0Pc\0\0d\0\0m\0\0\0Pc\0\0(d\0\0x\0\0\0Pc\0\x004d\0\0y\0\0\0Pc\0\0@d\0\0f\0\0\0Pc\0\0Ld\0\0d\0\0\0\0\0\0\0ld\0\0g\0\0l\0\0i\0\0j\0\0m\0\0\xCCd\0\0xd\0\0b\0\0N10__cxxabiv116__enum_type_infoE\0\0\0\0\0\0\0\0Hb\0\0g\0\0n\0\0i\0\0j\0\0o\0\0p\0\0q\0\0r\0\0\0\0\0\0\xECd\0\0g\0\0s\0\0i\0\0j\0\0o\0\0t\0\0u\0\0v\0\0\xCCd\0\0\xF8d\0\0Hb\0\0N10__cxxabiv120__si_class_type_infoE\0\0\0\0\0\0\0\0He\0\0g\0\0w\0\0i\0\0j\0\0o\0\0x\0\0y\0\0z\0\0\xCCd\0\0Te\0\0Hb\0\0N10__cxxabiv121__vmi_class_type_infoE\0\0\0\0\0\0\0\xA8b\0\0g\0\0{\0\0i\0\0j\0\0|\0\0\xA4d\0\0\xA0e\0\0St9type_info\0A\xB1\xCB\v\b \0\0\0\0\0\0\0A\xC4\xCB\v1\0A\xDC\xCB\v2\0\0\x003\0\0\0\xF8g\0\0\0\0A\xF4\xCB\v\0A\x84\xCC\v\xFF\xFF\xFF\xFF \0A\xC8\xCC\v!\xB8e\0\0@v\0%m/%d/%y\0\0\0\b%H:%M:%S\0\0\0\b\0A\xF4\xCC\ve\0A\x8C\xCD\v -2\0\0\0f\0\x004v\0A\xA4\xCD\v\0A\xB4\xCD\v\b\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\0A\xF8\xCD\vhf`)),ce((await B(ne)).instance))})(),(function(){function ce(){var ne;if(o.calledRun=!0,!m){if(C=!0,x_.H(),A?.(o),(ne=o.onRuntimeInitialized)==null||ne.call(o),o.postRun)for(typeof o.postRun=="function"&&(o.postRun=[o.postRun]);o.postRun.length;){var Te=o.postRun.shift();k.push(Te)}j(k)}}if(o.preRun)for(typeof o.preRun=="function"&&(o.preRun=[o.preRun]);o.preRun.length;)q();j(G),o.setStatus?(o.setStatus("Running..."),setTimeout(()=>{setTimeout(()=>o.setStatus(""),1),ce()},1)):ce()})(),C?r=o:r=new Promise((ce,ne)=>{A=ce,b=ne}),r}var BC=(e,t,n)=>{let i=e.vf32_ptr(t),r=t.size(),o=i>>2,s=e.HEAPF32.slice(o,o+r);if(n!==void 0)for(let a=0;a<r;a++)s[a]=n(s[a]);return s},IKe=e=>1/(1+Math.exp(-e)),PKe=e=>t=>t*e+.5,DKe=(e,t,n)=>{let i=n?.colorScaleFactor??.282;return{numPoints:t.numPoints,shDegree:t.shDegree,antialiased:t.antialiased,positions:BC(e,t.positions),scales:BC(e,t.scales,Math.exp),rotations:BC(e,t.rotations),alphas:BC(e,t.alphas,IKe),colors:BC(e,t.colors,PKe(i)),sh:BC(e,t.sh)}},RKe=(e,t)=>{e._free(e.vf32_ptr(t.positions)),e._free(e.vf32_ptr(t.scales)),e._free(e.vf32_ptr(t.rotations)),e._free(e.vf32_ptr(t.alphas)),e._free(e.vf32_ptr(t.colors)),e._free(e.vf32_ptr(t.sh))},rpe=async(e,t)=>{var n;let i=await wKe(),r=e instanceof Uint8Array?e:new Uint8Array(e),o=null;try{if(o=i._malloc(Uint8Array.BYTES_PER_ELEMENT*r.length),o===null)throw new Error("couldn't allocate memory");i.HEAPU8.set(r,o/Uint8Array.BYTES_PER_ELEMENT);let s=i.CoordinateSystem[((n=t?.unpackOptions)==null?void 0:n.coordinateSystem)??"UNSPECIFIED"],a=i.load_spz(o,r.length,{coordinateSystem:s}),c=DKe(i,a,t);return RKe(i,a),c}catch(s){throw s}finally{o!==null&&i._free(o)}};var OKe=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"}));var MKe=[0,9,24,45],NKe=14,LKe=1.6*1024*1024*1024;function FKe(e,t){let n=t?.attributes;if(!l(n))return;let i=n.POSITION;if(!l(i))return;let r=e?.accessors?.[i];if(!l(r)||r.count<=0)return;let o=0;for(let s in n)if(Object.prototype.hasOwnProperty.call(n,s)){let a=/SH_DEGREE_(\d+)_COEF_/.exec(s);a&&(o=Math.max(o,parseInt(a[1],10)))}return{numPoints:r.count,shDegree:o}}function BKe(e,t){let n=NKe+(MKe[t]??0);return e*n*Float32Array.BYTES_PER_ELEMENT*2}var x$=class extends ar{constructor(t){super(),t=t??H.EMPTY_OBJECT;let n=t.resourceCache,i=t.gltf,r=t.primitive,o=t.spz,s=t.gltfResource,a=t.baseResource,c=t.cacheKey;this._resourceCache=n,this._gltfResource=s,this._baseResource=a,this._gltf=i,this._primitive=r,this._spz=o,this._cacheKey=c,this._bufferViewLoader=void 0,this._bufferViewTypedArray=void 0,this._decodePromise=void 0,this._decodedData=void 0,this._state=Ct.UNLOADED,this._promise=void 0,this._spzError=void 0}get cacheKey(){return this._cacheKey}get decodedData(){return this._decodedData}async load(){return l(this._promise)?this._promise:(this._state=Ct.LOADING,this._promise=kKe(this),this._promise)}process(t){if(this._state===Ct.READY)return!0;if(this._state!==Ct.PROCESSING||(l(this._spzError)&&T$(this,this._spzError),!l(this._bufferViewTypedArray))||l(this._decodePromise))return!1;let n=FKe(this._gltf,this._primitive);if(l(n)){let r=BKe(n.numPoints,n.shDegree);if(r>LKe){let o=Math.round(r/1048576);return T$(this,new oe(`SPZ data too large to decode: ${n.numPoints.toLocaleString()} splats with spherical harmonics degree ${n.shDegree} would require approximately ${o} MB, which exceeds the WASM memory limit. Consider using a lower spherical harmonics degree or splitting the dataset into smaller tiles.`)),!1}}let i=rpe(this._bufferViewTypedArray,{unpackOptions:{coordinateSystem:"UNSPECIFIED"}});if(!l(i))return!1;this._decodePromise=UKe(this,i)}unload(){l(this._bufferViewLoader)&&this._resourceCache.unload(this._bufferViewLoader),this._bufferViewLoader=void 0,this._bufferViewTypedArray=void 0,this._decodedData=void 0,this._gltf=void 0,this._primitive=void 0}};async function kKe(e){let t=e._resourceCache;try{let n=t.getBufferViewLoader({gltf:e._gltf,bufferViewId:e._spz.bufferView,gltfResource:e._gltfResource,baseResource:e._baseResource});return e._bufferViewLoader=n,await n.load(),e.isDestroyed()?void 0:(e._bufferViewTypedArray=n.typedArray,e._state=Ct.PROCESSING,e)}catch(n){if(e.isDestroyed())return;T$(e,n)}}function T$(e,t){throw e.unload(),e._state=Ct.FAILED,e.getError("Failed to load SPZ",t)}async function UKe(e,t){try{let n=await t;return e.isDestroyed()?void 0:(e.unload(),e._decodedData={gcloud:n},e._state=Ct.READY,e._baseResource)}catch(n){if(e.isDestroyed())return;e._spzError=n}}var F3=x$;function yD(e){e=e??H.EMPTY_OBJECT;let t=e.id,n=e.properties??{},i={};for(let r in n)if(n.hasOwnProperty(r)){let o=n[r];l(o.semantic)&&(i[o.semantic]=o)}this._id=t,this._name=e.name,this._description=e.description,this._properties=n,this._propertiesBySemantic=i,this._extras=Ze(e.extras,!0),this._extensions=Ze(e.extensions,!0)}yD.fromJson=function(e){e=e??H.EMPTY_OBJECT;let t=e.id,n=e.class,i={};for(let r in n.properties)if(n.properties.hasOwnProperty(r)){let o=Z0.fromJson({id:r,property:n.properties[r],enums:e.enums});i[r]=o}return new yD({id:t,name:n.name,description:n.description,properties:i,extras:n.extras,extensions:n.extensions})};Object.defineProperties(yD.prototype,{properties:{get:function(){return this._properties}},propertiesBySemantic:{get:function(){return this._propertiesBySemantic}},id:{get:function(){return this._id}},name:{get:function(){return this._name}},description:{get:function(){return this._description}},extras:{get:function(){return this._extras}},extensions:{get:function(){return this._extensions}}});yD.BATCH_TABLE_CLASS_NAME="_batchTable";var dp=yD;function B3(e){e=e??H.EMPTY_OBJECT;let t=e.value,n=e.name;this._value=t,this._name=n,this._description=e.description,this._extras=Ze(e.extras,!0),this._extensions=Ze(e.extensions,!0)}B3.fromJson=function(e){return new B3({value:e.value,name:e.name,description:e.description,extras:e.extras,extensions:e.extensions})};Object.defineProperties(B3.prototype,{value:{get:function(){return this._value}},name:{get:function(){return this._name}},description:{get:function(){return this._description}},extras:{get:function(){return this._extras}},extensions:{get:function(){return this._extensions}}});var k3=B3;function U3(e){e=e??H.EMPTY_OBJECT;let t=e.id,n=e.values,i={},r={},o=n.length;for(let a=0;a<o;++a){let c=n[a];i[c.value]=c.name,r[c.name]=c.value}let s=e.valueType??Ft.UINT16;this._values=n,this._namesByValue=i,this._valuesByName=r,this._valueType=s,this._id=t,this._name=e.name,this._description=e.description,this._extras=Ze(e.extras,!0),this._extensions=Ze(e.extensions,!0)}U3.fromJson=function(e){e=e??H.EMPTY_OBJECT;let t=e.id,n=e.enum,i=n.values.map(function(r){return k3.fromJson(r)});return new U3({id:t,values:i,valueType:Ft[n.valueType],name:n.name,description:n.description,extras:n.extras,extensions:n.extensions})};Object.defineProperties(U3.prototype,{values:{get:function(){return this._values}},namesByValue:{get:function(){return this._namesByValue}},valuesByName:{get:function(){return this._valuesByName}},valueType:{get:function(){return this._valueType}},id:{get:function(){return this._id}},name:{get:function(){return this._name}},description:{get:function(){return this._description}},extras:{get:function(){return this._extras}},extensions:{get:function(){return this._extensions}}});var z3=U3;function V3(e){e=e??H.EMPTY_OBJECT;let t=e.classes??{},n=e.enums??{};this._classes=t,this._enums=n,this._id=e.id,this._name=e.name,this._description=e.description,this._version=e.version,this._extras=Ze(e.extras,!0),this._extensions=Ze(e.extensions,!0)}V3.fromJson=function(e){let t={};if(l(e.enums))for(let i in e.enums)e.enums.hasOwnProperty(i)&&(t[i]=z3.fromJson({id:i,enum:e.enums[i]}));let n={};if(l(e.classes))for(let i in e.classes)e.classes.hasOwnProperty(i)&&(n[i]=dp.fromJson({id:i,class:e.classes[i],enums:t}));return new V3({id:e.id,name:e.name,description:e.description,version:e.version,classes:n,enums:t,extras:e.extras,extensions:e.extensions})};Object.defineProperties(V3.prototype,{classes:{get:function(){return this._classes}},enums:{get:function(){return this._enums}},id:{get:function(){return this._id}},name:{get:function(){return this._name}},description:{get:function(){return this._description}},version:{get:function(){return this._version}},extras:{get:function(){return this._extras}},extensions:{get:function(){return this._extensions}}});var Eu=V3;var E$=class extends ar{constructor(t){super(),t=t??H.EMPTY_OBJECT;let n=t.schema,i=t.resource,r=t.cacheKey;this._schema=l(n)?Eu.fromJson(n):void 0,this._resource=i,this._cacheKey=r,this._state=Ct.UNLOADED,this._promise=void 0}get cacheKey(){return this._cacheKey}get schema(){return this._schema}async load(){return l(this._promise)?this._promise:l(this._schema)?(this._promise=Promise.resolve(this),this._promise):(this._promise=zKe(this),this._promise)}unload(){this._schema=void 0}};async function zKe(e){let t=e._resource;e._state=Ct.LOADING;try{let n=await t.fetchJson();return e.isDestroyed()?void 0:(e._schema=Eu.fromJson(n),e._state=Ct.READY,e)}catch(n){if(e.isDestroyed())return;e._state=Ct.FAILED;let i=`Failed to load schema: ${t.url}`;throw e.getError(i,n)}}var tx=E$;var fd={};function kC(e){return fh(e.url)}function AD(e){let{byteOffset:t,byteLength:n}=e,i=Kb(e);return l(i)&&(t=i.byteOffset??0,n=i.byteLength),`${t}-${t+n}`}function VKe(e,t){let n=t.byteOffset+e.byteOffset,{componentType:i,type:r,count:o}=e;return`${n}-${i}-${r}-${o}`}function ope(e,t){return`${kC(e)}-buffer-id-${t}`}function UC(e,t,n,i){if(l(e.uri)){let r=i.getDerivedResource({url:e.uri});return kC(r)}return ope(n,t)}function C$(e,t,n,i){let r=t.bufferView,o=e.bufferViews[r],s=o.buffer,a=e.buffers[s],c=UC(a,s,n,i),u=AD(o);return`${c}-range-${u}`}function spe(e,t,n,i){let r=t.bufferView,o=e.bufferViews[r],s=o.buffer,a=e.buffers[s],c=UC(a,s,n,i),u=AD(o);return`${c}-range-${u}`}function ape(e,t,n,i){let r=e.images[t],o=r.bufferView,s=r.uri;if(l(s)){let p=i.getDerivedResource({url:s});return kC(p)}let a=e.bufferViews[o],c=a.buffer,u=e.buffers[c],f=UC(u,c,n,i),d=AD(a);return`${f}-range-${d}`}function jKe(e,t){let n=pf.createSampler({gltf:e,textureInfo:t});return`${n.wrapS}-${n.wrapT}-${n.minificationFilter}-${n.magnificationFilter}`}fd.getSchemaCacheKey=function(e){let{schema:t,resource:n}=e;return l(t)?`embedded-schema:${JSON.stringify(t)}`:`external-schema:${kC(n)}`};fd.getExternalBufferCacheKey=function(e){e=e??H.EMPTY_OBJECT;let{resource:t}=e;return`external-buffer:${kC(t)}`};fd.getEmbeddedBufferCacheKey=function(e){e=e??H.EMPTY_OBJECT;let{parentResource:t,bufferId:n}=e;return`embedded-buffer:${ope(t,n)}`};fd.getGltfCacheKey=function(e){e=e??H.EMPTY_OBJECT;let{gltfResource:t}=e;return`gltf:${kC(t)}`};fd.getBufferViewCacheKey=function(e){e=e??H.EMPTY_OBJECT;let{gltf:t,bufferViewId:n,gltfResource:i,baseResource:r}=e,o=t.bufferViews[n],s=o.buffer,a=t.buffers[s],c=Kb(o);l(c)&&(s=c.buffer);let u=UC(a,s,i,r),f=AD(o);return`buffer-view:${u}-range-${f}`};fd.getDracoCacheKey=function(e){e=e??H.EMPTY_OBJECT;let{gltf:t,draco:n,gltfResource:i,baseResource:r}=e;return`draco:${C$(t,n,i,r)}`};fd.getSpzCacheKey=function(e){e=e??H.EMPTY_OBJECT;let{gltf:t,spz:n,gltfResource:i,baseResource:r}=e;return`spz:${spe(t,n,i,r)}`};fd.getVertexBufferCacheKey=function(e){e=e??H.EMPTY_OBJECT;let{gltf:t,gltfResource:n,baseResource:i,frameState:r,bufferViewId:o,draco:s,spz:a,attributeSemantic:c,dequantize:u=!1,loadBuffer:f=!1,loadTypedArray:d=!1}=e,p="";if(u&&(p+="-dequantize"),f&&(p+="-buffer",p+=`-context-${r.context.id}`),d&&(p+="-typed-array"),l(a))return`vertex-buffer:${spe(t,a,n,i)}-spz-${c}${p}`;if(l(s))return`vertex-buffer:${C$(t,s,n,i)}-draco-${c}${p}`;let g=t.bufferViews[o],m=g.buffer,y=t.buffers[m],A=UC(y,m,n,i),b=AD(g);return`vertex-buffer:${A}-range-${b}${p}`};fd.getIndexBufferCacheKey=function(e){e=e??H.EMPTY_OBJECT;let{gltf:t,accessorId:n,gltfResource:i,baseResource:r,frameState:o,draco:s,loadBuffer:a=!1,loadTypedArray:c=!1}=e,u="";if(a&&(u+="-buffer",u+=`-context-${o.context.id}`),c&&(u+="-typed-array"),l(s))return`index-buffer:${C$(t,s,i,r)}-draco${u}`;let f=t.accessors[n],d=f.bufferView,p=t.bufferViews[d],g=p.buffer,m=t.buffers[g],y=UC(m,g,i,r),A=VKe(f,p);return`index-buffer:${y}-accessor-${A}${u}`};fd.getImageCacheKey=function(e){e=e??H.EMPTY_OBJECT;let{gltf:t,imageId:n,gltfResource:i,baseResource:r}=e;return`image:${ape(t,n,i,r)}`};fd.getTextureCacheKey=function(e){e=e??H.EMPTY_OBJECT;let{gltf:t,textureInfo:n,gltfResource:i,baseResource:r,supportedImageFormats:o,frameState:s}=e,a=n.index,c=pf.getImageIdFromTexture({gltf:t,textureId:a,supportedImageFormats:o}),u=ape(t,c,i,r),f=jKe(t,n);return`texture:${u}-sampler-${f}-context-${s.context.id}`};var Cu=fd;function bD(){this.geometryByteLength=0,this.texturesByteLength=0,this._geometrySizes={},this._textureSizes={}}bD.prototype.clear=function(){this.geometryByteLength=0,this.texturesByteLength=0,this._geometrySizes={},this._textureSizes={}};bD.prototype.addGeometryLoader=function(e){let t=e.cacheKey;if(this._geometrySizes.hasOwnProperty(t))return;this._geometrySizes[t]=0;let n=e.buffer,i=e.typedArray,r=0;l(n)&&(r+=n.sizeInBytes),l(i)&&(r+=i.byteLength),this.geometryByteLength+=r,this._geometrySizes[t]=r};bD.prototype.addTextureLoader=function(e){let t=e.cacheKey;if(this._textureSizes.hasOwnProperty(t))return;this._textureSizes[t]=0;let n=e.texture.sizeInBytes;this.texturesByteLength+=e.texture.sizeInBytes,this._textureSizes[t]=n};bD.prototype.removeLoader=function(e){let t=e.cacheKey,n=this._geometrySizes[t];delete this._geometrySizes[t],l(n)&&(this.geometryByteLength-=n);let i=this._textureSizes[t];delete this._textureSizes[t],l(i)&&(this.texturesByteLength-=i)};var j3=bD;function Nn(){}Nn.cacheEntries={};Nn.statistics=new j3;function HKe(e){this.referenceCount=1,this.resourceLoader=e,this._statisticsPromise=void 0}Nn.get=function(e){let t=Nn.cacheEntries[e];if(l(t))return++t.referenceCount,t.resourceLoader};Nn.add=function(e){let t=e.cacheKey;return Nn.cacheEntries[t]=new HKe(e),e};Nn.unload=function(e){let t=e.cacheKey,n=Nn.cacheEntries[t];--n.referenceCount,n.referenceCount===0&&(Nn.statistics.removeLoader(e),e.destroy(),delete Nn.cacheEntries[t])};Nn.getSchemaLoader=function(e){e=e??H.EMPTY_OBJECT;let{schema:t,resource:n}=e,i=Cu.getSchemaCacheKey({schema:t,resource:n}),r=Nn.get(i);return l(r)?r:(r=new tx({schema:t,resource:n,cacheKey:i}),Nn.add(r))};Nn.getEmbeddedBufferLoader=function(e){e=e??H.EMPTY_OBJECT;let{parentResource:t,bufferId:n,typedArray:i}=e,r=Cu.getEmbeddedBufferCacheKey({parentResource:t,bufferId:n}),o=Nn.get(r);return l(o)?o:(o=new PC({typedArray:i,cacheKey:r}),Nn.add(o))};Nn.getExternalBufferLoader=function(e){e=e??H.EMPTY_OBJECT;let{resource:t}=e,n=Cu.getExternalBufferCacheKey({resource:t}),i=Nn.get(n);return l(i)?i:(i=new PC({resource:t,cacheKey:n}),Nn.add(i))};Nn.getGltfJsonLoader=function(e){e=e??H.EMPTY_OBJECT;let{gltfResource:t,baseResource:n,typedArray:i,gltfJson:r}=e,o=Cu.getGltfCacheKey({gltfResource:t}),s=Nn.get(o);return l(s)?s:(s=new pD({resourceCache:Nn,gltfResource:t,baseResource:n,typedArray:i,gltfJson:r,cacheKey:o}),Nn.add(s))};Nn.getBufferViewLoader=function(e){e=e??H.EMPTY_OBJECT;let{gltf:t,bufferViewId:n,gltfResource:i,baseResource:r}=e,o=Cu.getBufferViewCacheKey({gltf:t,bufferViewId:n,gltfResource:i,baseResource:r}),s=Nn.get(o);return l(s)?s:(s=new lD({resourceCache:Nn,gltf:t,bufferViewId:n,gltfResource:i,baseResource:r,cacheKey:o}),Nn.add(s))};Nn.getDracoLoader=function(e){e=e??H.EMPTY_OBJECT;let{gltf:t,primitive:n,draco:i,gltfResource:r,baseResource:o}=e,s=Cu.getDracoCacheKey({gltf:t,draco:i,gltfResource:r,baseResource:o}),a=Nn.get(s);return l(a)?a:(a=new uD({resourceCache:Nn,gltf:t,primitive:n,draco:i,gltfResource:r,baseResource:o,cacheKey:s}),Nn.add(a))};Nn.getSpzLoader=function(e){e=e??H.EMPTY_OBJECT;let{gltf:t,primitive:n,spz:i,gltfResource:r,baseResource:o}=e,s=Cu.getSpzCacheKey({gltf:t,spz:i,gltfResource:r,baseResource:o}),a=Nn.get(s);return l(a)?a:(a=new F3({resourceCache:Nn,gltf:t,primitive:n,spz:i,gltfResource:r,baseResource:o,cacheKey:s}),Nn.add(a))};Nn.getVertexBufferLoader=function(e){e=e??H.EMPTY_OBJECT;let{gltf:t,gltfResource:n,baseResource:i,frameState:r,bufferViewId:o,primitive:s,draco:a,spz:c,attributeSemantic:u,accessorId:f,asynchronous:d=!0,dequantize:p=!1,loadBuffer:g=!1,loadTypedArray:m=!1}=e,y=Cu.getVertexBufferCacheKey({gltf:t,gltfResource:n,baseResource:i,frameState:r,bufferViewId:o,draco:a,spz:c,attributeSemantic:u,dequantize:p,loadBuffer:g,loadTypedArray:m}),A=Nn.get(y);return l(A)?A:(A=new _D({resourceCache:Nn,gltf:t,gltfResource:n,baseResource:i,bufferViewId:o,primitive:s,draco:a,spz:c,attributeSemantic:u,accessorId:f,cacheKey:y,asynchronous:d,dequantize:p,loadBuffer:g,loadTypedArray:m}),Nn.add(A))};Nn.getIndexBufferLoader=function(e){e=e??H.EMPTY_OBJECT;let{gltf:t,accessorId:n,gltfResource:i,baseResource:r,frameState:o,primitive:s,draco:a,asynchronous:c=!0,loadBuffer:u=!1,loadTypedArray:f=!1}=e,d=Cu.getIndexBufferCacheKey({gltf:t,accessorId:n,gltfResource:i,baseResource:r,frameState:o,draco:a,loadBuffer:u,loadTypedArray:f}),p=Nn.get(d);return l(p)?p:(p=new hD({resourceCache:Nn,gltf:t,accessorId:n,gltfResource:i,baseResource:r,primitive:s,draco:a,cacheKey:d,asynchronous:c,loadBuffer:u,loadTypedArray:f}),Nn.add(p))};Nn.getImageLoader=function(e){e=e??H.EMPTY_OBJECT;let{gltf:t,imageId:n,gltfResource:i,baseResource:r}=e,o=Cu.getImageCacheKey({gltf:t,imageId:n,gltfResource:i,baseResource:r}),s=Nn.get(o);return l(s)?s:(s=new dD({resourceCache:Nn,gltf:t,imageId:n,gltfResource:i,baseResource:r,cacheKey:o}),Nn.add(s))};Nn.getTextureLoader=function(e){e=e??H.EMPTY_OBJECT;let{gltf:t,textureInfo:n,gltfResource:i,baseResource:r,supportedImageFormats:o,frameState:s,asynchronous:a=!0}=e,c=Cu.getTextureCacheKey({gltf:t,textureInfo:n,gltfResource:i,baseResource:r,supportedImageFormats:o,frameState:s}),u=Nn.get(c);return l(u)?u:(u=new gD({resourceCache:Nn,gltf:t,textureInfo:n,gltfResource:i,baseResource:r,supportedImageFormats:o,cacheKey:c,asynchronous:a}),Nn.add(u))};Nn.clearForSpecs=function(){let e=[_D,hD,uD,gD,dD,lD,PC,tx,pD],t,n=Nn.cacheEntries,i=[];for(t in n)n.hasOwnProperty(t)&&i.push(n[t]);i.sort(function(o,s){let a=e.indexOf(o.resourceLoader.constructor),c=e.indexOf(s.resourceLoader.constructor);return a-c});let r=i.length;for(let o=0;o<r;++o){let s=i[o];t=s.resourceLoader.cacheKey,l(n[t])&&(s.resourceLoader.destroy(),delete n[t])}Nn.statistics.clear()};var Bi=Nn;function Ja(e,t,n){this._resource=e,this._subtreeJson=void 0,this._bufferLoader=void 0,this._tileAvailability=void 0,this._contentAvailabilityBitstreams=[],this._childSubtreeAvailability=void 0,this._implicitCoordinates=n,this._subtreeLevels=t.subtreeLevels,this._subdivisionScheme=t.subdivisionScheme,this._branchingFactor=t.branchingFactor,this._metadata=void 0,this._tileMetadataTable=void 0,this._tilePropertyTableJson=void 0,this._contentMetadataTables=[],this._contentPropertyTableJsons=[],this._tileJumpBuffer=void 0,this._contentJumpBuffers=[],this._ready=!1}Object.defineProperties(Ja.prototype,{ready:{get:function(){return this._ready}},metadata:{get:function(){return this._metadata}},tileMetadataTable:{get:function(){return this._tileMetadataTable}},tilePropertyTableJson:{get:function(){return this._tilePropertyTableJson}},contentMetadataTables:{get:function(){return this._contentMetadataTables}},contentPropertyTableJsons:{get:function(){return this._contentPropertyTableJsons}},implicitCoordinates:{get:function(){return this._implicitCoordinates}}});Ja.prototype.tileIsAvailableAtIndex=function(e){return this._tileAvailability.getBit(e)};Ja.prototype.tileIsAvailableAtCoordinates=function(e){let t=this.getTileIndex(e);return this.tileIsAvailableAtIndex(t)};Ja.prototype.contentIsAvailableAtIndex=function(e,t){return t=t??0,this._contentAvailabilityBitstreams[t].getBit(e)};Ja.prototype.contentIsAvailableAtCoordinates=function(e,t){let n=this.getTileIndex(e);return this.contentIsAvailableAtIndex(n,t)};Ja.prototype.childSubtreeIsAvailableAtIndex=function(e){return this._childSubtreeAvailability.getBit(e)};Ja.prototype.childSubtreeIsAvailableAtCoordinates=function(e){let t=this.getChildSubtreeIndex(e);return this.childSubtreeIsAvailableAtIndex(t)};Ja.prototype.getLevelOffset=function(e){let t=this._branchingFactor;return(Math.pow(t,e)-1)/(t-1)};Ja.prototype.getParentMortonIndex=function(e){let t=2;return this._subdivisionScheme===Xs.OCTREE&&(t=3),e>>t};Ja.fromSubtreeJson=async function(e,t,n,i,r){let o=new Ja(e,i,r),s;l(t)?s={json:t,binary:void 0}:s=GKe(n);let a=s.json;o._subtreeJson=a;let c;if(sr(a,"3DTILES_metadata"))c=a.extensions["3DTILES_metadata"];else if(l(a.tileMetadata)){let x=a.tileMetadata;c=a.propertyTables[x]}let u=[];if(l(a.contentMetadata)){let x=a.contentMetadata.length;for(let T=0;T<x;T++){let E=a.contentMetadata[T];u.push(a.propertyTables[E])}}let f,d=i.metadataSchema,p=a.subtreeMetadata;if(l(p)){let x=p.class,T=d.classes[x];f=new f3({subtreeMetadata:p,class:T})}o._metadata=f,o._tilePropertyTableJson=c,o._contentPropertyTableJsons=u;let g={constant:0};a.contentAvailabilityHeaders=[],sr(a,"3DTILES_multiple_contents")?a.contentAvailabilityHeaders=a.extensions["3DTILES_multiple_contents"].contentAvailability:Array.isArray(a.contentAvailability)?a.contentAvailabilityHeaders=a.contentAvailability:a.contentAvailabilityHeaders.push(a.contentAvailability??g);let m=WKe(a.buffers),y=qKe(a.bufferViews,m);YKe(a,y),l(c)&&cpe(c,y);for(let x=0;x<u.length;x++){let T=u[x];cpe(T,y)}let A=await XKe(o,m,s.binary),b=$Ke(y,A);return JKe(o,a,i,b),l(c)&&(ZKe(o,i,b),e$e(o)),QKe(o,i,b),t$e(o),o._ready=!0,o};function GKe(e){let n=new DataView(e.buffer,e.byteOffset),i=8,r=n.getUint32(i,!0);i+=8;let o=n.getUint32(i,!0);i+=8;let s=No(e,i,r);i+=r;let a=e.subarray(i,i+o);return{json:s,binary:a}}function WKe(e){e=l(e)?e:[];for(let t=0;t<e.length;t++){let n=e[t];n.isExternal=l(n.uri),n.isActive=!1}return e}function qKe(e,t){e=l(e)?e:[];for(let n=0;n<e.length;n++){let i=e[n],r=t[i.buffer];i.bufferHeader=r,i.isActive=!1}return e}function YKe(e,t){let n,i=e.tileAvailability;l(i.bitstream)?n=t[i.bitstream]:l(i.bufferView)&&(n=t[i.bufferView]),l(n)&&(n.isActive=!0,n.bufferHeader.isActive=!0);let r=e.contentAvailabilityHeaders;for(let s=0;s<r.length;s++)n=void 0,l(r[s].bitstream)?n=t[r[s].bitstream]:l(r[s].bufferView)&&(n=t[r[s].bufferView]),l(n)&&(n.isActive=!0,n.bufferHeader.isActive=!0);n=void 0;let o=e.childSubtreeAvailability;l(o.bitstream)?n=t[o.bitstream]:l(o.bufferView)&&(n=t[o.bufferView]),l(n)&&(n.isActive=!0,n.bufferHeader.isActive=!0)}function cpe(e,t){let n=e.properties,i;for(let r in n)if(n.hasOwnProperty(r)){let o=n[r],s=o.values??o.bufferView;i=t[s],i.isActive=!0,i.bufferHeader.isActive=!0;let a=o.stringOffsets??o.stringOffsetBufferView;l(a)&&(i=t[a],i.isActive=!0,i.bufferHeader.isActive=!0);let c=o.arrayOffsets??o.arrayOffsetBufferView;l(c)&&(i=t[c],i.isActive=!0,i.bufferHeader.isActive=!0)}}function XKe(e,t,n){let i=[];for(let r=0;r<t.length;r++){let o=t[r];if(!o.isActive)i.push(Promise.resolve(void 0));else if(o.isExternal){let s=KKe(e,o);i.push(s)}else i.push(Promise.resolve(n))}return Promise.all(i).then(function(r){let o={};for(let s=0;s<r.length;s++){let a=r[s];l(a)&&(o[s]=a)}return o})}async function KKe(e,t){let i=e._resource.getDerivedResource({url:t.uri}),r=Bi.getExternalBufferLoader({resource:i});e._bufferLoader=r;try{await r.load()}catch(o){if(r.isDestroyed())return;throw o}return r.typedArray}function $Ke(e,t){let n={};for(let i=0;i<e.length;i++){let r=e[i];if(!r.isActive)continue;let o=r.byteOffset,s=o+r.byteLength,c=t[r.buffer].subarray(o,s);n[i]=c}return n}function JKe(e,t,n,i){let r=n.branchingFactor,o=n.subtreeLevels,s=(Math.pow(r,o)-1)/(r-1),a=Math.pow(r,o),c=sr(t,"3DTILES_metadata"),u=l(e._tilePropertyTableJson),f=c||u;e._tileAvailability=v$(t.tileAvailability,i,s,f);let d=e._contentPropertyTableJsons.length>0;f=f||d;for(let p=0;p<t.contentAvailabilityHeaders.length;p++){let g=v$(t.contentAvailabilityHeaders[p],i,s,f);e._contentAvailabilityBitstreams.push(g)}e._childSubtreeAvailability=v$(t.childSubtreeAvailability,i,a)}function v$(e,t,n,i){if(l(e.constant))return new rD({constant:!!e.constant,lengthBits:n,availableCount:e.availableCount});let r;return l(e.bitstream)?r=t[e.bitstream]:l(e.bufferView)&&(r=t[e.bufferView]),new rD({bitstream:r,lengthBits:n,availableCount:e.availableCount,computeAvailableCountEnabled:i})}function ZKe(e,t,n){let i=e._tilePropertyTableJson,r=e._tileAvailability.availableCount,o=t.metadataSchema,s=i.class,a=o.classes[s];e._tileMetadataTable=new wh({class:a,count:r,properties:i.properties,bufferViews:n})}function QKe(e,t,n){let i=e._contentPropertyTableJsons,r=e._contentAvailabilityBitstreams,o=t.metadataSchema,s=e._contentMetadataTables;for(let a=0;a<i.length;a++){let c=i[a],f=r[a].availableCount,d=c.class,p=o.classes[d],g=new wh({class:p,count:f,properties:c.properties,bufferViews:n});s.push(g)}}function lpe(e){let t=0,n=e.lengthBits,i=e.availableCount,r;i<256?r=new Uint8Array(n):i<65536?r=new Uint16Array(n):r=new Uint32Array(n);for(let o=0;o<e.lengthBits;o++)e.getBit(o)&&(r[o]=t,t++);return r}function e$e(e){let t=lpe(e._tileAvailability);e._tileJumpBuffer=t}function t$e(e){let t=e._contentJumpBuffers,n=e._contentAvailabilityBitstreams;for(let i=0;i<n.length;i++){let r=n[i],o=lpe(r);t.push(o)}}Ja.prototype.getTileIndex=function(e){let t=e.level-this._implicitCoordinates.level;if(t<0||this._subtreeLevels<=t)throw new oe("level is out of bounds for this subtree");return e.getSubtreeCoordinates().getOffsetCoordinates(e).tileIndex};Ja.prototype.getChildSubtreeIndex=function(e){if(e.level-this._implicitCoordinates.level!==this._implicitCoordinates.subtreeLevels)throw new oe("level is out of bounds for this subtree");return e.getParentSubtreeCoordinates().getOffsetCoordinates(e).mortonIndex};function n$e(e,t){if(!l(e._tileMetadataTable))return;let n=e.getTileIndex(t);if(e._tileAvailability.getBit(n))return e._tileJumpBuffer[n]}function i$e(e,t,n){let i=e._contentMetadataTables;if(!l(i))return;let r=i[n];if(!l(r))return;let o=e._contentAvailabilityBitstreams[n],s=e.getTileIndex(t);if(o.getBit(s))return e._contentJumpBuffers[n][s]}Ja.prototype.getTileMetadataView=function(e){let t=n$e(this,e);if(!l(t))return;let n=this._tileMetadataTable;return new oD({class:n.class,metadataTable:n,entityId:t,propertyTableJson:this._tilePropertyTableJson})};Ja.prototype.getContentMetadataView=function(e,t){let n=i$e(this,e,t);if(!l(n))return;let i=this._contentMetadataTables[t],r=this._contentPropertyTableJsons[t];return new oD({class:i.class,metadataTable:i,entityId:n,contentIndex:t,propertyTableJson:r})};Ja.prototype.isDestroyed=function(){return!1};Ja.prototype.destroy=function(){return l(this._bufferLoader)&&Bi.unload(this._bufferLoader),le(this)};var py=Ja;var upe={ID:"ID",NAME:"NAME",DESCRIPTION:"DESCRIPTION",TILESET_TILE_COUNT:"TILESET_TILE_COUNT",TILE_BOUNDING_BOX:"TILE_BOUNDING_BOX",TILE_BOUNDING_REGION:"TILE_BOUNDING_REGION",TILE_BOUNDING_SPHERE:"TILE_BOUNDING_SPHERE",TILE_MINIMUM_HEIGHT:"TILE_MINIMUM_HEIGHT",TILE_MAXIMUM_HEIGHT:"TILE_MAXIMUM_HEIGHT",TILE_HORIZON_OCCLUSION_POINT:"TILE_HORIZON_OCCLUSION_POINT",TILE_GEOMETRIC_ERROR:"TILE_GEOMETRIC_ERROR",CONTENT_BOUNDING_BOX:"CONTENT_BOUNDING_BOX",CONTENT_BOUNDING_REGION:"CONTENT_BOUNDING_REGION",CONTENT_BOUNDING_SPHERE:"CONTENT_BOUNDING_SPHERE",CONTENT_MINIMUM_HEIGHT:"CONTENT_MINIMUM_HEIGHT",CONTENT_MAXIMUM_HEIGHT:"CONTENT_MAXIMUM_HEIGHT",CONTENT_HORIZON_OCCLUSION_POINT:"CONTENT_HORIZON_OCCLUSION_POINT"};Object.freeze(upe);var Ph=upe;var gy={};gy.parseAllBoundingVolumeSemantics=function(e,t){return{boundingVolume:gy.parseBoundingVolumeSemantic(e,t),minimumHeight:gy._parseMinimumHeight(e,t),maximumHeight:gy._parseMaximumHeight(e,t)}};gy.parseBoundingVolumeSemantic=function(e,t){let n=`${e}_BOUNDING_BOX`,i=t.getPropertyBySemantic(n);if(l(i))return{box:i};let r=`${e}_BOUNDING_REGION`,o=t.getPropertyBySemantic(r);if(l(o))return{region:o};let s=`${e}_BOUNDING_SPHERE`,a=t.getPropertyBySemantic(s);if(l(a))return{sphere:a}};gy._parseMinimumHeight=function(e,t){let n=`${e}_MINIMUM_HEIGHT`;return t.getPropertyBySemantic(n)};gy._parseMaximumHeight=function(e,t){let n=`${e}_MAXIMUM_HEIGHT`;return t.getPropertyBySemantic(n)};var nx=gy;var zC=class e{constructor(t,n,i){let r=n.implicitTileset,o=n.implicitCoordinates;this._implicitTileset=r,this._implicitCoordinates=o,this._implicitSubtree=void 0,this._tileset=t,this._tile=n,this._resource=i,this._metadata=void 0,this.featurePropertiesDirty=!1,this._group=void 0;let s=o.getTemplateValues(),a=r.subtreeUriTemplate.getDerivedResource({templateValues:s});this._url=a.getUrlComponent(!0),this._ready=!1}get featuresLength(){return 0}get pointsLength(){return 0}get trianglesLength(){return 0}get geometryByteLength(){return 0}get texturesByteLength(){return 0}get batchTableByteLength(){return 0}get innerContents(){}get ready(){return this._ready}get tileset(){return this._tileset}get tile(){return this._tile}get url(){return this._url}get metadata(){}set metadata(t){}get batchTable(){}get group(){return this._group}set group(t){this._group=t}static async fromSubtreeJson(t,n,i,r,o,s){s=s??0;let a;l(o)&&(a=new Uint8Array(o,s));let c=n.implicitTileset,u=n.implicitCoordinates,f=await py.fromSubtreeJson(i,r,a,c,u),d=new e(t,n,i);return d._implicitSubtree=f,r$e(d,f),d._ready=!0,d}hasProperty(t,n){return!1}getFeature(t){}applyDebugSettings(t,n){}applyStyle(t){}update(t,n){}pick(t,n,i){}isDestroyed(){return!1}destroy(){return this._implicitSubtree=this._implicitSubtree&&this._implicitSubtree.destroy(),le(this)}};function r$e(e,t){let n=e._tile,i=e._implicitCoordinates.childIndex,r=s$e(e,t,n,i),o=e._tileset.statistics;n.children.push(r.rootTile),o.numberOfTilesTotal++;let s=o$e(e,t,r.bottomRow);for(let a=0;a<s.length;a++){let c=s[a],u=c.tile,f=p$e(e,u,c.childIndex);u.children.push(f),o.numberOfTilesTotal++}}function o$e(e,t,n){let i=[],r=e._implicitTileset.branchingFactor;for(let o=0;o<n.length;o++){let s=n[o];if(l(s))for(let a=0;a<r;a++){let c=o*r+a;t.childSubtreeIsAvailableAtIndex(c)&&i.push({tile:s,childIndex:a})}}return i}function s$e(e,t,n,i){let s=fpe(e,t,n,i,0,!0),a=e._tileset.statistics,c=[s],u=[],f=e._implicitTileset;for(let d=1;d<f.subtreeLevels;d++){let p=t.getLevelOffset(d),g=f.branchingFactor*c.length;for(let m=0;m<g;m++){let y=p+m;if(!t.tileIsAvailableAtIndex(y)){u.push(void 0);continue}let A=t.getParentMortonIndex(m),b=c[A],x=m%f.branchingFactor,T=fpe(e,t,b,x,y);b.children.push(T),a.numberOfTilesTotal++,u.push(T)}c=u,u=[]}return{rootTile:s,bottomRow:c}}function dpe(e,t,n){let i=Ph.TILE_GEOMETRIC_ERROR;return l(e)&&e.hasPropertyBySemantic(i)?e.getPropertyBySemantic(i):t.geometricError/Math.pow(2,n.level)}function fpe(e,t,n,i,r,o){let s=e._implicitTileset,a;o??!1?a=n.implicitCoordinates:a=n.implicitCoordinates.getChildCoordinates(i);let c,u;l(t.tilePropertyTableJson)&&(c=t.getTileMetadataView(a),u=nx.parseAllBoundingVolumeSemantics("TILE",c));let d=t.contentPropertyTableJsons.length,p=!1;for(let v=0;v<d;v++)if(t.contentIsAvailableAtCoordinates(a,v)){p=!0;break}let g=l$e(s,a,i,o,n,u),m=[];for(let v=0;v<s.contentCount;v++){if(!t.contentIsAvailableAtIndex(r,v))continue;let R={uri:s.contentUriTemplates[v].getDerivedResource({templateValues:a.getTemplateValues()}).url},O;if(t.contentPropertyTableJsons.length>0){let _=t.getContentMetadataView(a,v);O=nx.parseAllBoundingVolumeSemantics("CONTENT",_)}let L=u$e(g,O);l(L)&&(R.boundingVolume=L),m.push(Mt(R,s.contentHeaders[v]))}let y=dpe(c,s,a),A={boundingVolume:g,geometricError:y,refine:s.refine,contents:m},b=!0,x=Ze(s.tileHeader,b);delete x.boundingVolume,delete x.transform,delete x.metadata;let T=Mt(A,x,b),E=_pe(e,s.baseResource,T,n);return E.implicitCoordinates=a,E.implicitSubtree=t,E.metadata=c,E.hasImplicitContentMetadata=p,E}function H3(e,t){return l(e)&&l(t)&&(l(t.minimumHeight)||l(t.maximumHeight))&&(sr(e,"3DTILES_bounding_volume_S2")||l(e.region))}function w$(e,t){l(t)&&(sr(e,"3DTILES_bounding_volume_S2")?c$e(e.extensions["3DTILES_bounding_volume_S2"],t.minimumHeight,t.maximumHeight):l(e.region)&&a$e(e.region,t.minimumHeight,t.maximumHeight))}function a$e(e,t,n){l(t)&&(e[4]=t),l(n)&&(e[5]=n)}function c$e(e,t,n){l(t)&&(e.minimumHeight=t),l(n)&&(e.maximumHeight=n)}function l$e(e,t,n,i,r,o){let s;return!l(o)||!l(o.boundingVolume)||!H3(o.boundingVolume,o)&&H3(e.boundingVolume,o)?s=hpe(e,t,n,i??!1,r):s=o.boundingVolume,w$(s,o),s}function u$e(e,t){let n;return l(t)&&(n=t.boundingVolume),H3(n,t)?w$(n,t):H3(e,t)&&(n=Ze(e,!0),w$(n,t)),n}function hpe(e,t,n,i,r){let o=e.boundingVolume;return sr(o,"3DTILES_bounding_volume_S2")?mpe(i,r,n,t.level,t.x,t.y,t.z):l(o.region)?{region:gpe(o.region,t.level,t.x,t.y,t.z)}:{box:ppe(o.box,t.level,t.x,t.y,t.z)}}function mpe(e,t,n,i,r,o,s){let a=t._boundingVolume;if(e)return{extensions:{"3DTILES_bounding_volume_S2":{token:cy.getTokenFromId(a.s2Cell._cellId),minimumHeight:a.minimumHeight,maximumHeight:a.maximumHeight}}};let c=Number(t._boundingVolume.s2Cell._cellId>>BigInt(61)),u=c%2===0?iD.encode2D(i,r,o):iD.encode2D(i,o,r),f=cy.fromFacePositionLevel(c,BigInt(u),i),d,p;if(l(s)){let g=(a.maximumHeight+a.minimumHeight)/2;d=n<4?a.minimumHeight:g,p=n<4?g:a.maximumHeight}else d=a.minimumHeight,p=a.maximumHeight;return{extensions:{"3DTILES_bounding_volume_S2":{token:cy.getTokenFromId(f._cellId),minimumHeight:d,maximumHeight:p}}}}var f$e=new h,d$e=new h,S$=new h,h$e=new $;function ppe(e,t,n,i,r){if(t===0)return e;let o=h.unpack(e,0,d$e),s=$.unpack(e,3,h$e),a=Math.pow(2,-t),c=-1+(2*n+1)*a,u=-1+(2*i+1)*a,f=0,d=h.fromElements(a,a,1,f$e);l(r)&&(f=-1+(2*r+1)*a,d.z=a);let p=h.fromElements(c,u,f,S$);p=$.multiplyByVector(s,p,S$),p=h.add(p,o,S$);let g=$.clone(s);g=$.multiplyByScale(g,d,g);let m=new Array(12);return h.pack(p,m),$.pack(g,m,3),m}var m$e=new ie;function gpe(e,t,n,i,r){if(t===0)return e.slice();let o=ie.unpack(e,0,m$e),s=e[4],a=e[5],c=Math.pow(2,-t),u=c*o.width,f=P.negativePiToPi(o.west+n*u),d=P.negativePiToPi(f+u),p=c*o.height,g=P.negativePiToPi(o.south+i*p),m=P.negativePiToPi(g+p),y=s,A=a;if(l(r)){let b=c*(a-s);y+=r*b,A=y+b}return[f,g,d,m,y,A]}function p$e(e,t,n){let i=e._implicitTileset,r=t.implicitCoordinates.getChildCoordinates(n),o=hpe(i,r,n,!1,t),s=dpe(void 0,i,r),a=i.subtreeUriTemplate.getDerivedResource({templateValues:r.getTemplateValues()}).url,c={boundingVolume:o,geometricError:s,refine:i.refine,contents:[{uri:a}]},u=_pe(e,i.baseResource,c,t);return u.implicitTileset=i,u.implicitCoordinates=r,u}function _pe(e,t,n,i){let r=e._tile.constructor;return new r(e._tileset,t,n,i)}zC._deriveBoundingBox=ppe;zC._deriveBoundingRegion=gpe;zC._deriveBoundingVolumeS2=mpe;var xD=zC;var ype={NONE:0,REPEAT:1,MIRRORED_REPEAT:2};Object.freeze(ype);var gf=ype;function VC(e,t){this._distance=t,this._normal=new Ape(e,this),this.onChangeCallback=void 0,this.index=-1}Object.defineProperties(VC.prototype,{distance:{get:function(){return this._distance},set:function(e){l(this.onChangeCallback)&&e!==this._distance&&this.onChangeCallback(this.index),this._distance=e}},normal:{get:function(){return this._normal},set:function(e){l(this.onChangeCallback)&&!h.equals(this._normal._cartesian3,e)&&this.onChangeCallback(this.index),h.clone(e,this._normal._cartesian3)}}});VC.fromPlane=function(e,t){return l(t)?(t.normal=e.normal,t.distance=e.distance):t=new VC(e.normal,e.distance),t};VC.clone=function(e,t){return l(t)?(t.normal=e.normal,t.distance=e.distance,t):new VC(e.normal,e.distance)};function Ape(e,t){this._clippingPlane=t,this._cartesian3=h.clone(e)}Object.defineProperties(Ape.prototype,{x:{get:function(){return this._cartesian3.x},set:function(e){l(this._clippingPlane.onChangeCallback)&&e!==this._cartesian3.x&&this._clippingPlane.onChangeCallback(this._clippingPlane.index),this._cartesian3.x=e}},y:{get:function(){return this._cartesian3.y},set:function(e){l(this._clippingPlane.onChangeCallback)&&e!==this._cartesian3.y&&this._clippingPlane.onChangeCallback(this._clippingPlane.index),this._cartesian3.y=e}},z:{get:function(){return this._cartesian3.z},set:function(e){l(this._clippingPlane.onChangeCallback)&&e!==this._cartesian3.z&&this._clippingPlane.onChangeCallback(this._clippingPlane.index),this._cartesian3.z=e}}});var fa=VC;function $c(e){e=e??H.EMPTY_OBJECT,this._planes=[],this._dirtyIndex=-1,this._multipleDirtyPlanes=!1,this._enabled=e.enabled??!0,this.modelMatrix=M.clone(e.modelMatrix??M.IDENTITY),this.edgeColor=z.clone(e.edgeColor??z.WHITE),this.edgeWidth=e.edgeWidth??0,this.planeAdded=new be,this.planeRemoved=new be,this._owner=void 0;let t=e.unionClippingRegions??!1;this._unionClippingRegions=t,this._testIntersection=t?Cpe:vpe,this._uint8View=void 0,this._float32View=void 0,this._clippingPlanesTexture=void 0;let n=e.planes;if(l(n)){let i=n.length;for(let r=0;r<i;++r)this.add(n[r])}}function Cpe(e){return e===$t.OUTSIDE}function vpe(e){return e===$t.INSIDE}Object.defineProperties($c.prototype,{length:{get:function(){return this._planes.length}},unionClippingRegions:{get:function(){return this._unionClippingRegions},set:function(e){this._unionClippingRegions!==e&&(this._unionClippingRegions=e,this._testIntersection=e?Cpe:vpe)}},enabled:{get:function(){return this._enabled},set:function(e){this._enabled!==e&&(this._enabled=e)}},texture:{get:function(){return this._clippingPlanesTexture}},owner:{get:function(){return this._owner}},clippingPlanesState:{get:function(){return this._unionClippingRegions?this._planes.length:-this._planes.length}}});function bpe(e,t){e._multipleDirtyPlanes=e._multipleDirtyPlanes||e._dirtyIndex!==-1&&e._dirtyIndex!==t,e._dirtyIndex=t}$c.prototype.add=function(e){let t=this._planes.length,n=this;e.onChangeCallback=function(i){bpe(n,i)},e.index=t,bpe(this,t),this._planes.push(e),this.planeAdded.raiseEvent(e,t)};$c.prototype.get=function(e){return this._planes[e]};function Spe(e,t){let n=e.length;for(let i=0;i<n;++i)if(sn.equals(e[i],t))return i;return-1}$c.prototype.contains=function(e){return Spe(this._planes,e)!==-1};$c.prototype.remove=function(e){let t=this._planes,n=Spe(t,e);if(n===-1)return!1;e instanceof fa&&(e.onChangeCallback=void 0,e.index=-1);let i=t.length-1;for(let r=n;r<i;++r){let o=t[r+1];t[r]=o,o instanceof fa&&(o.index=r)}return this._multipleDirtyPlanes=!0,t.length=i,this.planeRemoved.raiseEvent(e,n),!0};$c.prototype.removeAll=function(){let e=this._planes,t=e.length;for(let n=0;n<t;++n){let i=e[n];i instanceof fa&&(i.onChangeCallback=void 0,i.index=-1),this.planeRemoved.raiseEvent(i,n)}this._multipleDirtyPlanes=!0,this._planes=[]};var g$e=new se,_$e=new se;function xpe(e,t,n){let i=e._uint8View,r=e._planes,o=0;for(let s=t;s<n;++s){let a=r[s],c=cn.octEncodeToCartesian4(a.normal,_$e);i[o]=c.x,i[o+1]=c.y,i[o+2]=c.z,i[o+3]=c.w;let u=se.packFloat(a.distance,g$e);i[o+4]=u.x,i[o+5]=u.y,i[o+6]=u.z,i[o+7]=u.w,o+=8}}function Tpe(e,t,n){let i=e._float32View,r=e._planes,o=0;for(let s=t;s<n;++s){let a=r[s],c=a.normal;i[o]=c.x,i[o+1]=c.y,i[o+2]=c.z,i[o+3]=a.distance,o+=4}}function wpe(e,t){let n=Ut.maximumTextureSize;return t.x=Math.min(e,n),t.y=Math.ceil(e/t.x),t}var y$e=new U;$c.prototype.update=function(e){let t=this._clippingPlanesTexture,n=e.context,i=$c.useFloatTexture(n),r=i?this.length:this.length*2;if(l(t)){let s=t.width*t.height;(s<r||r<.25*s)&&(t.destroy(),t=void 0,this._clippingPlanesTexture=void 0)}if(this.length===0)return;if(!l(t)){let s=wpe(r,y$e);s.y*=2,i?(t=new Dt({context:n,width:s.x,height:s.y,pixelFormat:$e.RGBA,pixelDatatype:ze.FLOAT,sampler:Ht.NEAREST,flipY:!1}),this._float32View=new Float32Array(s.x*s.y*4)):(t=new Dt({context:n,width:s.x,height:s.y,pixelFormat:$e.RGBA,pixelDatatype:ze.UNSIGNED_BYTE,sampler:Ht.NEAREST,flipY:!1}),this._uint8View=new Uint8Array(s.x*s.y*4)),this._clippingPlanesTexture=t,this._multipleDirtyPlanes=!0}let o=this._dirtyIndex;if(!(!this._multipleDirtyPlanes&&o===-1)){if(this._multipleDirtyPlanes)i?(Tpe(this,0,this._planes.length),t.copyFrom({source:{width:t.width,height:t.height,arrayBufferView:this._float32View}})):(xpe(this,0,this._planes.length),t.copyFrom({source:{width:t.width,height:t.height,arrayBufferView:this._uint8View}}));else{let s,a;i?(a=Math.floor(o/t.width),s=Math.floor(o-a*t.width),Tpe(this,o,o+1),t.copyFrom({source:{width:1,height:1,arrayBufferView:this._float32View},xOffset:s,yOffset:a})):(a=Math.floor(o*2/t.width),s=Math.floor(o*2-a*t.width),xpe(this,o,o+1),t.copyFrom({source:{width:2,height:1,arrayBufferView:this._uint8View},xOffset:s,yOffset:a}))}this._multipleDirtyPlanes=!1,this._dirtyIndex=-1}};var A$e=new M,Epe=new sn(h.UNIT_X,0);$c.prototype.computeIntersectionWithBoundingVolume=function(e,t){let n=this._planes,i=n.length,r=this.modelMatrix;l(t)&&(r=M.multiply(t,r,A$e));let o=$t.INSIDE;!this.unionClippingRegions&&i>0&&(o=$t.OUTSIDE);for(let s=0;s<i;++s){let a=n[s];sn.transform(a,r,Epe);let c=e.intersectPlane(Epe);if(c===$t.INTERSECTING)o=c;else if(this._testIntersection(c))return c}return o};$c.setOwner=function(e,t,n){e!==t[n]&&(t[n]=t[n]&&t[n].destroy(),l(e)&&(e._owner=t,t[n]=e))};$c.useFloatTexture=function(e){return e.floatingPointTexture};$c.getTextureResolution=function(e,t,n){let i=e.texture;if(l(i))return n.x=i.width,n.y=i.height,n;let r=$c.useFloatTexture(t)?e.length:e.length*2,o=wpe(r,n);return o.y*=2,o};$c.prototype.isDestroyed=function(){return!1};$c.prototype.destroy=function(){return this._clippingPlanesTexture=this._clippingPlanesTexture&&this._clippingPlanesTexture.destroy(),le(this)};var Ps=$c;function D$(e,t,n=2){let i=t&&t.length,r=i?t[0]*n:e.length,o=Ppe(e,0,r,n,!0),s=[];if(!o||o.next===o.prev)return s;let a,c,u;if(i&&(o=C$e(e,t,o,n)),e.length>80*n){a=e[0],c=e[1];let f=a,d=c;for(let p=n;p<r;p+=n){let g=e[p],m=e[p+1];g<a&&(a=g),m<c&&(c=m),g>f&&(f=g),m>d&&(d=m)}u=Math.max(f-a,d-c),u=u!==0?32767/u:0}return ED(o,s,n,a,c,u,0),s}function Ppe(e,t,n,i,r){let o;if(r===L$e(e,t,n,i)>0)for(let s=t;s<n;s+=i)o=Ipe(s/i|0,e[s],e[s+1],o);else for(let s=n-i;s>=t;s-=i)o=Ipe(s/i|0,e[s],e[s+1],o);return o&&jC(o,o.next)&&(vD(o),o=o.next),o}function ix(e,t){if(!e)return e;t||(t=e);let n=e,i;do if(i=!1,!n.steiner&&(jC(n,n.next)||ds(n.prev,n,n.next)===0)){if(vD(n),n=t=n.prev,n===n.next)break;i=!0}else n=n.next;while(i||n!==t);return t}function ED(e,t,n,i,r,o,s){if(!e)return;!s&&o&&P$e(e,i,r,o);let a=e;for(;e.prev!==e.next;){let c=e.prev,u=e.next;if(o?x$e(e,i,r,o):b$e(e)){t.push(c.i,e.i,u.i),vD(e),e=u.next,a=u.next;continue}if(e=u,e===a){s?s===1?(e=T$e(ix(e),t),ED(e,t,n,i,r,o,2)):s===2&&E$e(e,t,n,i,r,o):ED(ix(e),t,n,i,r,o,1);break}}}function b$e(e){let t=e.prev,n=e,i=e.next;if(ds(t,n,i)>=0)return!1;let r=t.x,o=n.x,s=i.x,a=t.y,c=n.y,u=i.y,f=Math.min(r,o,s),d=Math.min(a,c,u),p=Math.max(r,o,s),g=Math.max(a,c,u),m=i.next;for(;m!==t;){if(m.x>=f&&m.x<=p&&m.y>=d&&m.y<=g&&TD(r,a,o,c,s,u,m.x,m.y)&&ds(m.prev,m,m.next)>=0)return!1;m=m.next}return!0}function x$e(e,t,n,i){let r=e.prev,o=e,s=e.next;if(ds(r,o,s)>=0)return!1;let a=r.x,c=o.x,u=s.x,f=r.y,d=o.y,p=s.y,g=Math.min(a,c,u),m=Math.min(f,d,p),y=Math.max(a,c,u),A=Math.max(f,d,p),b=I$(g,m,t,n,i),x=I$(y,A,t,n,i),T=e.prevZ,E=e.nextZ;for(;T&&T.z>=b&&E&&E.z<=x;){if(T.x>=g&&T.x<=y&&T.y>=m&&T.y<=A&&T!==r&&T!==s&&TD(a,f,c,d,u,p,T.x,T.y)&&ds(T.prev,T,T.next)>=0||(T=T.prevZ,E.x>=g&&E.x<=y&&E.y>=m&&E.y<=A&&E!==r&&E!==s&&TD(a,f,c,d,u,p,E.x,E.y)&&ds(E.prev,E,E.next)>=0))return!1;E=E.nextZ}for(;T&&T.z>=b;){if(T.x>=g&&T.x<=y&&T.y>=m&&T.y<=A&&T!==r&&T!==s&&TD(a,f,c,d,u,p,T.x,T.y)&&ds(T.prev,T,T.next)>=0)return!1;T=T.prevZ}for(;E&&E.z<=x;){if(E.x>=g&&E.x<=y&&E.y>=m&&E.y<=A&&E!==r&&E!==s&&TD(a,f,c,d,u,p,E.x,E.y)&&ds(E.prev,E,E.next)>=0)return!1;E=E.nextZ}return!0}function T$e(e,t){let n=e;do{let i=n.prev,r=n.next.next;!jC(i,r)&&Rpe(i,n,n.next,r)&&CD(i,r)&&CD(r,i)&&(t.push(i.i,n.i,r.i),vD(n),vD(n.next),n=e=r),n=n.next}while(n!==e);return ix(n)}function E$e(e,t,n,i,r,o){let s=e;do{let a=s.next.next;for(;a!==s.prev;){if(s.i!==a.i&&O$e(s,a)){let c=Ope(s,a);s=ix(s,s.next),c=ix(c,c.next),ED(s,t,n,i,r,o,0),ED(c,t,n,i,r,o,0);return}a=a.next}s=s.next}while(s!==e)}function C$e(e,t,n,i){let r=[];for(let o=0,s=t.length;o<s;o++){let a=t[o]*i,c=o<s-1?t[o+1]*i:e.length,u=Ppe(e,a,c,i,!1);u===u.next&&(u.steiner=!0),r.push(R$e(u))}r.sort(v$e);for(let o=0;o<r.length;o++)n=S$e(r[o],n);return n}function v$e(e,t){let n=e.x-t.x;if(n===0&&(n=e.y-t.y,n===0)){let i=(e.next.y-e.y)/(e.next.x-e.x),r=(t.next.y-t.y)/(t.next.x-t.x);n=i-r}return n}function S$e(e,t){let n=w$e(e,t);if(!n)return t;let i=Ope(n,e);return ix(i,i.next),ix(n,n.next)}function w$e(e,t){let n=t,i=e.x,r=e.y,o=-1/0,s;if(jC(e,n))return n;do{if(jC(e,n.next))return n.next;if(r<=n.y&&r>=n.next.y&&n.next.y!==n.y){let d=n.x+(r-n.y)*(n.next.x-n.x)/(n.next.y-n.y);if(d<=i&&d>o&&(o=d,s=n.x<n.next.x?n:n.next,d===i))return s}n=n.next}while(n!==t);if(!s)return null;let a=s,c=s.x,u=s.y,f=1/0;n=s;do{if(i>=n.x&&n.x>=c&&i!==n.x&&Dpe(r<u?i:o,r,c,u,r<u?o:i,r,n.x,n.y)){let d=Math.abs(r-n.y)/(i-n.x);CD(n,e)&&(d<f||d===f&&(n.x>s.x||n.x===s.x&&I$e(s,n)))&&(s=n,f=d)}n=n.next}while(n!==a);return s}function I$e(e,t){return ds(e.prev,e,t.prev)<0&&ds(t.next,e,e.next)<0}function P$e(e,t,n,i){let r=e;do r.z===0&&(r.z=I$(r.x,r.y,t,n,i)),r.prevZ=r.prev,r.nextZ=r.next,r=r.next;while(r!==e);r.prevZ.nextZ=null,r.prevZ=null,D$e(r)}function D$e(e){let t,n=1;do{let i=e,r;e=null;let o=null;for(t=0;i;){t++;let s=i,a=0;for(let u=0;u<n&&(a++,s=s.nextZ,!!s);u++);let c=n;for(;a>0||c>0&&s;)a!==0&&(c===0||!s||i.z<=s.z)?(r=i,i=i.nextZ,a--):(r=s,s=s.nextZ,c--),o?o.nextZ=r:e=r,r.prevZ=o,o=r;i=s}o.nextZ=null,n*=2}while(t>1);return e}function I$(e,t,n,i,r){return e=(e-n)*r|0,t=(t-i)*r|0,e=(e|e<<8)&16711935,e=(e|e<<4)&252645135,e=(e|e<<2)&858993459,e=(e|e<<1)&1431655765,t=(t|t<<8)&16711935,t=(t|t<<4)&252645135,t=(t|t<<2)&858993459,t=(t|t<<1)&1431655765,e|t<<1}function R$e(e){let t=e,n=e;do(t.x<n.x||t.x===n.x&&t.y<n.y)&&(n=t),t=t.next;while(t!==e);return n}function Dpe(e,t,n,i,r,o,s,a){return(r-s)*(t-a)>=(e-s)*(o-a)&&(e-s)*(i-a)>=(n-s)*(t-a)&&(n-s)*(o-a)>=(r-s)*(i-a)}function TD(e,t,n,i,r,o,s,a){return!(e===s&&t===a)&&Dpe(e,t,n,i,r,o,s,a)}function O$e(e,t){return e.next.i!==t.i&&e.prev.i!==t.i&&!M$e(e,t)&&(CD(e,t)&&CD(t,e)&&N$e(e,t)&&(ds(e.prev,e,t.prev)||ds(e,t.prev,t))||jC(e,t)&&ds(e.prev,e,e.next)>0&&ds(t.prev,t,t.next)>0)}function ds(e,t,n){return(t.y-e.y)*(n.x-t.x)-(t.x-e.x)*(n.y-t.y)}function jC(e,t){return e.x===t.x&&e.y===t.y}function Rpe(e,t,n,i){let r=W3(ds(e,t,n)),o=W3(ds(e,t,i)),s=W3(ds(n,i,e)),a=W3(ds(n,i,t));return!!(r!==o&&s!==a||r===0&&G3(e,n,t)||o===0&&G3(e,i,t)||s===0&&G3(n,e,i)||a===0&&G3(n,t,i))}function G3(e,t,n){return t.x<=Math.max(e.x,n.x)&&t.x>=Math.min(e.x,n.x)&&t.y<=Math.max(e.y,n.y)&&t.y>=Math.min(e.y,n.y)}function W3(e){return e>0?1:e<0?-1:0}function M$e(e,t){let n=e;do{if(n.i!==e.i&&n.next.i!==e.i&&n.i!==t.i&&n.next.i!==t.i&&Rpe(n,n.next,e,t))return!0;n=n.next}while(n!==e);return!1}function CD(e,t){return ds(e.prev,e,e.next)<0?ds(e,t,e.next)>=0&&ds(e,e.prev,t)>=0:ds(e,t,e.prev)<0||ds(e,e.next,t)<0}function N$e(e,t){let n=e,i=!1,r=(e.x+t.x)/2,o=(e.y+t.y)/2;do n.y>o!=n.next.y>o&&n.next.y!==n.y&&r<(n.next.x-n.x)*(o-n.y)/(n.next.y-n.y)+n.x&&(i=!i),n=n.next;while(n!==e);return i}function Ope(e,t){let n=P$(e.i,e.x,e.y),i=P$(t.i,t.x,t.y),r=e.next,o=t.prev;return e.next=t,t.prev=e,n.next=r,r.prev=n,i.next=n,n.prev=i,o.next=i,i.prev=o,i}function Ipe(e,t,n,i){let r=P$(e,t,n);return i?(r.next=i.next,r.prev=i,i.next.prev=r,i.next=r):(r.prev=r,r.next=r),r}function vD(e){e.next.prev=e.prev,e.prev.next=e.next,e.prevZ&&(e.prevZ.nextZ=e.nextZ),e.nextZ&&(e.nextZ.prevZ=e.prevZ)}function P$(e,t,n){return{i:e,x:t,y:n,prev:null,next:null,z:0,prevZ:null,nextZ:null,steiner:!1}}function L$e(e,t,n,i){let r=0;for(let o=t,s=n-i;o<n;o+=i)r+=(e[s]-e[o])*(e[o+1]+e[s+1]),s=o;return r}var F$e=new h,B$e=new h,_y={};_y.computeArea2D=function(e){let t=e.length,n=0;for(let i=t-1,r=0;r<t;i=r++){let o=e[i],s=e[r];n+=o.x*s.y-s.x*o.y}return n*.5};_y.computeWindingOrder2D=function(e){return _y.computeArea2D(e)>0?sa.COUNTER_CLOCKWISE:sa.CLOCKWISE};_y.triangulate=function(e,t){let n=U.packArray(e);return D$(n,t,2)};var Fpe=new h,Bpe=new h,kpe=new h,Mpe=new h,Npe=new h,Lpe=new h,eg=new h,Upe=new U,zpe=new U,Vpe=new U,HC=new U;_y.computeSubdivision=function(e,t,n,i,r){r=r??P.RADIANS_PER_DEGREE;let o=l(i),s=n.slice(0),a,c=t.length,u=new Array(c*3),f=new Array(c*2),d=0,p=0;for(a=0;a<c;a++){let T=t[a];if(u[d++]=T.x,u[d++]=T.y,u[d++]=T.z,o){let E=i[a];f[p++]=E.x,f[p++]=E.y}}let g=[],m={},y=e.maximumRadius,A=P.chordLength(r,y),b=A*A;for(;s.length>0;){let T=s.pop(),E=s.pop(),v=s.pop(),S=h.fromArray(u,v*3,Fpe),I=h.fromArray(u,E*3,Bpe),R=h.fromArray(u,T*3,kpe),O,L,_;o&&(O=U.fromArray(f,v*2,Upe),L=U.fromArray(f,E*2,zpe),_=U.fromArray(f,T*2,Vpe));let C=h.multiplyByScalar(h.normalize(S,Mpe),y,Mpe),w=h.multiplyByScalar(h.normalize(I,Npe),y,Npe),D=h.multiplyByScalar(h.normalize(R,Lpe),y,Lpe),N=h.magnitudeSquared(h.subtract(C,w,eg)),F=h.magnitudeSquared(h.subtract(w,D,eg)),V=h.magnitudeSquared(h.subtract(D,C,eg)),B=Math.max(N,F,V),j,k,G;B>b?N===B?(j=`${Math.min(v,E)} ${Math.max(v,E)}`,a=m[j],l(a)||(k=h.add(S,I,eg),h.multiplyByScalar(k,.5,k),u.push(k.x,k.y,k.z),a=u.length/3-1,m[j]=a,o&&(G=U.add(O,L,HC),U.multiplyByScalar(G,.5,G),f.push(G.x,G.y))),s.push(v,a,T),s.push(a,E,T)):F===B?(j=`${Math.min(E,T)} ${Math.max(E,T)}`,a=m[j],l(a)||(k=h.add(I,R,eg),h.multiplyByScalar(k,.5,k),u.push(k.x,k.y,k.z),a=u.length/3-1,m[j]=a,o&&(G=U.add(L,_,HC),U.multiplyByScalar(G,.5,G),f.push(G.x,G.y))),s.push(E,a,v),s.push(a,T,v)):V===B&&(j=`${Math.min(T,v)} ${Math.max(T,v)}`,a=m[j],l(a)||(k=h.add(R,S,eg),h.multiplyByScalar(k,.5,k),u.push(k.x,k.y,k.z),a=u.length/3-1,m[j]=a,o&&(G=U.add(_,O,HC),U.multiplyByScalar(G,.5,G),f.push(G.x,G.y))),s.push(T,a,E),s.push(a,v,E)):(g.push(v),g.push(E),g.push(T))}let x={attributes:{position:new Ne({componentDatatype:Y.DOUBLE,componentsPerAttribute:3,values:u})},indices:g,primitiveType:Oe.TRIANGLES};return o&&(x.attributes.st=new Ne({componentDatatype:Y.FLOAT,componentsPerAttribute:2,values:f})),new wt(x)};var k$e=new he,U$e=new he,z$e=new he,R$=new he;_y.computeRhumbLineSubdivision=function(e,t,n,i,r){r=r??P.RADIANS_PER_DEGREE;let o=l(i),s=n.slice(0),a,c=t.length,u=new Array(c*3),f=new Array(c*2),d=0,p=0;for(a=0;a<c;a++){let v=t[a];if(u[d++]=v.x,u[d++]=v.y,u[d++]=v.z,o){let S=i[a];f[p++]=S.x,f[p++]=S.y}}let g=[],m={},y=e.maximumRadius,A=P.chordLength(r,y),b=new jc(void 0,void 0,e),x=new jc(void 0,void 0,e),T=new jc(void 0,void 0,e);for(;s.length>0;){let v=s.pop(),S=s.pop(),I=s.pop(),R=h.fromArray(u,I*3,Fpe),O=h.fromArray(u,S*3,Bpe),L=h.fromArray(u,v*3,kpe),_,C,w;o&&(_=U.fromArray(f,I*2,Upe),C=U.fromArray(f,S*2,zpe),w=U.fromArray(f,v*2,Vpe));let D=e.cartesianToCartographic(R,k$e),N=e.cartesianToCartographic(O,U$e),F=e.cartesianToCartographic(L,z$e);b.setEndPoints(D,N);let V=b.surfaceDistance;x.setEndPoints(N,F);let B=x.surfaceDistance;T.setEndPoints(F,D);let j=T.surfaceDistance,k=Math.max(V,B,j),G,q,Q,W,J;k>A?V===k?(G=`${Math.min(I,S)} ${Math.max(I,S)}`,a=m[G],l(a)||(q=b.interpolateUsingFraction(.5,R$),Q=(D.height+N.height)*.5,W=h.fromRadians(q.longitude,q.latitude,Q,e,eg),u.push(W.x,W.y,W.z),a=u.length/3-1,m[G]=a,o&&(J=U.add(_,C,HC),U.multiplyByScalar(J,.5,J),f.push(J.x,J.y))),s.push(I,a,v),s.push(a,S,v)):B===k?(G=`${Math.min(S,v)} ${Math.max(S,v)}`,a=m[G],l(a)||(q=x.interpolateUsingFraction(.5,R$),Q=(N.height+F.height)*.5,W=h.fromRadians(q.longitude,q.latitude,Q,e,eg),u.push(W.x,W.y,W.z),a=u.length/3-1,m[G]=a,o&&(J=U.add(C,w,HC),U.multiplyByScalar(J,.5,J),f.push(J.x,J.y))),s.push(S,a,I),s.push(a,v,I)):j===k&&(G=`${Math.min(v,I)} ${Math.max(v,I)}`,a=m[G],l(a)||(q=T.interpolateUsingFraction(.5,R$),Q=(F.height+D.height)*.5,W=h.fromRadians(q.longitude,q.latitude,Q,e,eg),u.push(W.x,W.y,W.z),a=u.length/3-1,m[G]=a,o&&(J=U.add(w,_,HC),U.multiplyByScalar(J,.5,J),f.push(J.x,J.y))),s.push(v,a,S),s.push(a,I,S)):(g.push(I),g.push(S),g.push(v))}let E={attributes:{position:new Ne({componentDatatype:Y.DOUBLE,componentsPerAttribute:3,values:u})},indices:g,primitiveType:Oe.TRIANGLES};return o&&(E.attributes.st=new Ne({componentDatatype:Y.FLOAT,componentsPerAttribute:2,values:f})),new wt(E)};_y.scaleToGeodeticHeight=function(e,t,n,i){n=n??ee.default;let r=F$e,o=B$e;if(t=t??0,i=i??!0,l(e)){let s=e.length;for(let a=0;a<s;a+=3)h.fromArray(e,a,o),i&&(o=n.scaleToGeodeticSurface(o,o)),t!==0&&(r=n.geodeticSurfaceNormal(o,r),h.multiplyByScalar(r,t,r),h.add(o,r,o)),e[a]=o.x,e[a+1]=o.y,e[a+2]=o.z}return e};var mi=_y;function yy(){this._array=[],this._offset=0,this._length=0}Object.defineProperties(yy.prototype,{length:{get:function(){return this._length}}});yy.prototype.enqueue=function(e){this._array.push(e),this._length++};yy.prototype.dequeue=function(){if(this._length===0)return;let e=this._array,t=this._offset,n=e[t];return e[t]=void 0,t++,t>10&&t*2>e.length&&(this._array=e.slice(t),t=0),this._offset=t,this._length--,n};yy.prototype.peek=function(){if(this._length!==0)return this._array[this._offset]};yy.prototype.contains=function(e){return this._array.indexOf(e)!==-1};yy.prototype.clear=function(){this._array.length=this._offset=this._length=0};yy.prototype.sort=function(e){this._offset>0&&(this._array=this._array.slice(this._offset),this._offset=0),this._array.sort(e)};var rx=yy;var vo={};vo.computeHierarchyPackedLength=function(e,t){let n=0,i=[e];for(;i.length>0;){let r=i.pop();if(!l(r))continue;n+=2;let o=r.positions,s=r.holes;if(l(o)&&o.length>0&&(n+=o.length*t.packedLength),l(s)){let a=s.length;for(let c=0;c<a;++c)i.push(s[c])}}return n};vo.packPolygonHierarchy=function(e,t,n,i){let r=[e];for(;r.length>0;){let o=r.pop();if(!l(o))continue;let s=o.positions,a=o.holes;if(t[n++]=l(s)?s.length:0,t[n++]=l(a)?a.length:0,l(s)){let c=s.length;for(let u=0;u<c;++u,n+=i.packedLength)i.pack(s[u],t,n)}if(l(a)){let c=a.length;for(let u=0;u<c;++u)r.push(a[u])}}return n};vo.unpackPolygonHierarchy=function(e,t,n){let i=e[t++],r=e[t++],o=new Array(i),s=r>0?new Array(r):void 0;for(let a=0;a<i;++a,t+=n.packedLength)o[a]=n.unpack(e,t);for(let a=0;a<r;++a)s[a]=vo.unpackPolygonHierarchy(e,t,n),t=s[a].startingIndex,delete s[a].startingIndex;return{positions:o,holes:s,startingIndex:t}};var ox=new U;function Gpe(e,t,n,i){return U.subtract(t,e,ox),U.multiplyByScalar(ox,n/i,ox),U.add(e,ox,ox),[ox.x,ox.y]}var Ay=new h;function V$e(e,t,n,i){return h.subtract(t,e,Ay),h.multiplyByScalar(Ay,n/i,Ay),h.add(e,Ay,Ay),[Ay.x,Ay.y,Ay.z]}vo.subdivideLineCount=function(e,t,n){let r=h.distance(e,t)/n,o=Math.max(0,Math.ceil(P.log2(r)));return Math.pow(2,o)};var Y3=new he,X3=new he,j$e=new he,H$e=new h,q3=new jc;vo.subdivideRhumbLineCount=function(e,t,n,i){let r=e.cartesianToCartographic(t,Y3),o=e.cartesianToCartographic(n,X3),a=new jc(r,o,e).surfaceDistance/i,c=Math.max(0,Math.ceil(P.log2(a)));return Math.pow(2,c)};vo.subdivideTexcoordLine=function(e,t,n,i,r,o){let s=vo.subdivideLineCount(n,i,r),a=U.distance(e,t),c=a/s,u=o;u.length=s*2;let f=0;for(let d=0;d<s;d++){let p=Gpe(e,t,d*c,a);u[f++]=p[0],u[f++]=p[1]}return u};vo.subdivideLine=function(e,t,n,i){let r=vo.subdivideLineCount(e,t,n),o=h.distance(e,t),s=o/r;l(i)||(i=[]);let a=i;a.length=r*3;let c=0;for(let u=0;u<r;u++){let f=V$e(e,t,u*s,o);a[c++]=f[0],a[c++]=f[1],a[c++]=f[2]}return a};vo.subdivideTexcoordRhumbLine=function(e,t,n,i,r,o,s){let a=n.cartesianToCartographic(i,Y3),c=n.cartesianToCartographic(r,X3);q3.setEndPoints(a,c);let u=q3.surfaceDistance/o,f=Math.max(0,Math.ceil(P.log2(u))),d=Math.pow(2,f),p=U.distance(e,t),g=p/d,m=s;m.length=d*2;let y=0;for(let A=0;A<d;A++){let b=Gpe(e,t,A*g,p);m[y++]=b[0],m[y++]=b[1]}return m};vo.subdivideRhumbLine=function(e,t,n,i,r){let o=e.cartesianToCartographic(t,Y3),s=e.cartesianToCartographic(n,X3),a=new jc(o,s,e);if(l(r)||(r=[]),a.surfaceDistance<=i)return r.length=3,r[0]=t.x,r[1]=t.y,r[2]=t.z,r;let c=a.surfaceDistance/i,u=Math.max(0,Math.ceil(P.log2(c))),f=Math.pow(2,u),d=a.surfaceDistance/f,p=r;p.length=f*3;let g=0;for(let m=0;m<f;m++){let y=a.interpolateUsingSurfaceDistance(m*d,j$e),A=e.cartographicToCartesian(y,H$e);p[g++]=A.x,p[g++]=A.y,p[g++]=A.z}return p};var G$e=new h,W$e=new h,q$e=new h,Y$e=new h;vo.scaleToGeodeticHeightExtruded=function(e,t,n,i,r){i=i??ee.default;let o=G$e,s=W$e,a=q$e,c=Y$e;if(l(e)&&l(e.attributes)&&l(e.attributes.position)){let u=e.attributes.position.values,f=u.length/2;for(let d=0;d<f;d+=3)h.fromArray(u,d,a),i.geodeticSurfaceNormal(a,o),c=i.scaleToGeodeticSurface(a,c),s=h.multiplyByScalar(o,n,s),s=h.add(c,s,s),u[d+f]=s.x,u[d+1+f]=s.y,u[d+2+f]=s.z,r&&(c=h.clone(a,c)),s=h.multiplyByScalar(o,t,s),s=h.add(c,s,s),u[d]=s.x,u[d+1]=s.y,u[d+2]=s.z}return e};vo.polygonOutlinesFromHierarchy=function(e,t,n){let i=[],r=new rx;r.enqueue(e);let o,s,a;for(;r.length!==0;){let c=r.dequeue(),u=c.positions;if(t)for(a=u.length,o=0;o<a;o++)n.scaleToGeodeticSurface(u[o],u[o]);if(u=Lr(u,h.equalsEpsilon,!0),u.length<3)continue;let f=c.holes?c.holes.length:0;for(o=0;o<f;o++){let d=c.holes[o],p=d.positions;if(t)for(a=p.length,s=0;s<a;++s)n.scaleToGeodeticSurface(p[s],p[s]);if(p=Lr(p,h.equalsEpsilon,!0),p.length<3)continue;i.push(p);let g=0;for(l(d.holes)&&(g=d.holes.length),s=0;s<g;s++)r.enqueue(d.holes[s])}i.push(u)}return i};var X$e=new he;function K$e(e,t,n){let i=n.cartesianToCartographic(e,Y3),r=n.cartesianToCartographic(t,X3);if(Math.sign(i.latitude)===Math.sign(r.latitude))return;q3.setEndPoints(i,r);let o=q3.findIntersectionWithLatitude(0,X$e);if(!l(o))return;let s=Math.min(i.longitude,r.longitude),a=Math.max(i.longitude,r.longitude);if(Math.abs(a-s)>P.PI){let c=s;s=a,a=c}if(!(o.longitude<s||o.longitude>a))return n.cartographicToCartesian(o)}function $$e(e,t,n,i){if(i===ln.RHUMB)return K$e(e,t,n);let r=xi.lineSegmentPlane(e,t,sn.ORIGIN_XY_PLANE);if(l(r))return n.scaleToGeodeticSurface(r,r)}var J$e=new he;function Z$e(e,t,n){let i=[],r,o,s,a,c,u=0;for(;u<e.length;){r=e[u],o=e[(u+1)%e.length],s=P.sign(r.z),a=P.sign(o.z);let f=d=>t.cartesianToCartographic(d,J$e).longitude;if(s===0)i.push({position:u,type:s,visited:!1,next:a,theta:f(r)});else if(a!==0){if(c=$$e(r,o,t,n),++u,!l(c))continue;e.splice(u,0,c),i.push({position:u,type:s,visited:!1,next:a,theta:f(c)})}++u}return i}function Wpe(e,t,n,i,r,o,s){let a=[],c=o,u=d=>p=>p.position===d,f=[];do{let d=n[c];a.push(d);let p=i.findIndex(u(c)),g=i[p];if(!l(g)){++c;continue}let{visited:m,type:y,next:A}=g;if(g.visited=!0,y===0){if(A===0){let E=i[p-(s?1:-1)];if(E?.position===c+1)E.visited=!0;else{++c;continue}}if(!m&&s&&A>0||o===c&&!s&&A<0){++c;continue}}if(!(s?y>=0:y<=0)){++c;continue}m||f.push(c);let x=p+(s?1:-1),T=i[x];if(!l(T)){++c;continue}c=T.position}while(c<n.length&&c>=0&&c!==o&&a.length<n.length);e.splice(t,r,a);for(let d of f)t=Wpe(e,t+1,n,i,0,d,!s);return t}vo.splitPolygonsOnEquator=function(e,t,n,i){l(i)||(i=[]),i.splice(0,0,...e),i.length=e.length;let r=0;for(;r<i.length;){let o=i[r],s=o.slice();if(o.length<3){i[r]=s,++r;continue}let a=Z$e(s,t,n);if(s.length===o.length||a.length<=1){i[r]=s,++r;continue}a.sort((u,f)=>u.theta-f.theta);let c=s[0].z>=0;r=Wpe(i,r,s,a,1,0,c)}return i};vo.polygonsFromHierarchy=function(e,t,n,i,r,o){let s=[],a=[],c=new rx;c.enqueue(e);let u=l(o);for(;c.length!==0;){let f=c.dequeue(),d=f.positions,p=f.holes,g,m;if(i)for(m=d.length,g=0;g<m;g++)r.scaleToGeodeticSurface(d[g],d[g]);if(t||(d=Lr(d,h.equalsEpsilon,!0)),d.length<3)continue;let y=n(d);if(!l(y))continue;let A=[],b=mi.computeWindingOrder2D(y);if(b===sa.CLOCKWISE&&(y.reverse(),d=d.slice().reverse()),u){u=!1;let S=[d];if(S=o(S,S),S.length>1){for(let I of S)c.enqueue(new Hc(I,p));continue}}let x=d.slice(),T=l(p)?p.length:0,E=[],v;for(g=0;g<T;g++){let S=p[g],I=S.positions;if(i)for(m=I.length,v=0;v<m;++v)r.scaleToGeodeticSurface(I[v],I[v]);if(t||(I=Lr(I,h.equalsEpsilon,!0)),I.length<3)continue;let R=n(I);if(!l(R))continue;b=mi.computeWindingOrder2D(R),b===sa.CLOCKWISE&&(R.reverse(),I=I.slice().reverse()),E.push(I),A.push(x.length),x=x.concat(I),y=y.concat(R);let O=0;for(l(S.holes)&&(O=S.holes.length),v=0;v<O;v++)c.enqueue(S.holes[v])}s.push({outerRing:d,holes:E}),a.push({positions:x,positions2D:y,holes:A})}return{hierarchy:s,polygons:a}};var Q$e=new U,eJe=new h,tJe=new Le,nJe=new $;vo.computeBoundingRectangle=function(e,t,n,i,r){let o=Le.fromAxisAngle(e,i,tJe),s=$.fromQuaternion(o,nJe),a=Number.POSITIVE_INFINITY,c=Number.NEGATIVE_INFINITY,u=Number.POSITIVE_INFINITY,f=Number.NEGATIVE_INFINITY,d=n.length;for(let p=0;p<d;++p){let g=h.clone(n[p],eJe);$.multiplyByVector(s,g,g);let m=t(g,Q$e);l(m)&&(a=Math.min(a,m.x),c=Math.max(c,m.x),u=Math.min(u,m.y),f=Math.max(f,m.y))}return r.x=a,r.y=u,r.width=c-a,r.height=f-u,r};vo.createGeometryFromPositions=function(e,t,n,i,r,o,s){let a=mi.triangulate(t.positions2D,t.holes);a.length<3&&(a=[0,1,2]);let c=t.positions,u=l(n),f=u?n.positions:void 0;if(r){let d=c.length,p=new Array(d*3),g=0;for(let A=0;A<d;A++){let b=c[A];p[g++]=b.x,p[g++]=b.y,p[g++]=b.z}let m={attributes:{position:new Ne({componentDatatype:Y.DOUBLE,componentsPerAttribute:3,values:p})},indices:a,primitiveType:Oe.TRIANGLES};u&&(m.attributes.st=new Ne({componentDatatype:Y.FLOAT,componentsPerAttribute:2,values:U.packArray(f)}));let y=new wt(m);return o.normal?Wn.computeNormal(y):y}if(s===ln.GEODESIC)return mi.computeSubdivision(e,c,a,f,i);if(s===ln.RHUMB)return mi.computeRhumbLineSubdivision(e,c,a,f,i)};var jpe=[],Hpe=[],iJe=new h,rJe=new h;vo.computeWallGeometry=function(e,t,n,i,r,o){let s,a,c,u,f,d,p,g,m,y=e.length,A=0,b=0,x=l(t),T=x?t.positions:void 0;if(r)for(a=y*3*2,s=new Array(a*2),x&&(m=y*2*2,g=new Array(m*2)),c=0;c<y;c++)u=e[c],f=e[(c+1)%y],s[A]=s[A+a]=u.x,++A,s[A]=s[A+a]=u.y,++A,s[A]=s[A+a]=u.z,++A,s[A]=s[A+a]=f.x,++A,s[A]=s[A+a]=f.y,++A,s[A]=s[A+a]=f.z,++A,x&&(d=T[c],p=T[(c+1)%y],g[b]=g[b+m]=d.x,++b,g[b]=g[b+m]=d.y,++b,g[b]=g[b+m]=p.x,++b,g[b]=g[b+m]=p.y,++b);else{let R=P.chordLength(i,n.maximumRadius),O=0;if(o===ln.GEODESIC)for(c=0;c<y;c++)O+=vo.subdivideLineCount(e[c],e[(c+1)%y],R);else if(o===ln.RHUMB)for(c=0;c<y;c++)O+=vo.subdivideRhumbLineCount(n,e[c],e[(c+1)%y],R);for(a=(O+y)*3,s=new Array(a*2),x&&(m=(O+y)*2,g=new Array(m*2)),c=0;c<y;c++){u=e[c],f=e[(c+1)%y];let L,_;x&&(d=T[c],p=T[(c+1)%y]),o===ln.GEODESIC?(L=vo.subdivideLine(u,f,R,Hpe),x&&(_=vo.subdivideTexcoordLine(d,p,u,f,R,jpe))):o===ln.RHUMB&&(L=vo.subdivideRhumbLine(n,u,f,R,Hpe),x&&(_=vo.subdivideTexcoordRhumbLine(d,p,n,u,f,R,jpe)));let C=L.length;for(let w=0;w<C;++w,++A)s[A]=L[w],s[A+a]=L[w];if(s[A]=f.x,s[A+a]=f.x,++A,s[A]=f.y,s[A+a]=f.y,++A,s[A]=f.z,s[A+a]=f.z,++A,x){let w=_.length;for(let D=0;D<w;++D,++b)g[b]=_[D],g[b+m]=_[D];g[b]=p.x,g[b+m]=p.x,++b,g[b]=p.y,g[b+m]=p.y,++b}}}y=s.length;let E=je.createTypedArray(y/3,y-e.length*6),v=0;for(y/=6,c=0;c<y;c++){let R=c,O=R+1,L=R+y,_=L+1;u=h.fromArray(s,R*3,iJe),f=h.fromArray(s,O*3,rJe),!h.equalsEpsilon(u,f,P.EPSILON10,P.EPSILON10)&&(E[v++]=R,E[v++]=L,E[v++]=O,E[v++]=O,E[v++]=L,E[v++]=_)}let S={attributes:new En({position:new Ne({componentDatatype:Y.DOUBLE,componentsPerAttribute:3,values:s})}),indices:E,primitiveType:Oe.TRIANGLES};return x&&(S.attributes.st=new Ne({componentDatatype:Y.FLOAT,componentsPerAttribute:2,values:g})),new wt(S)};var ni=vo;function hs(e,t){this.position=e,l(this.position)||(this.position=new U),this.tangentPlane=t,l(this.tangentPlane)||(this.tangentPlane=hs.NORTH_POLE_TANGENT_PLANE)}Object.defineProperties(hs.prototype,{ellipsoid:{get:function(){return this.tangentPlane.ellipsoid}},x:{get:function(){return this.position.x}},y:{get:function(){return this.position.y}},conformalLatitude:{get:function(){let e=U.magnitude(this.position),t=2*this.ellipsoid.maximumRadius;return this.tangentPlane.plane.normal.z*(P.PI_OVER_TWO-2*Math.atan2(e,t))}},longitude:{get:function(){let e=P.PI_OVER_TWO+Math.atan2(this.y,this.x);return e>Math.PI&&(e-=P.TWO_PI),e}}});var GC=new he,oJe=new h;hs.prototype.getLatitude=function(e){l(e)||(e=ee.default),GC.latitude=this.conformalLatitude,GC.longitude=this.longitude,GC.height=0;let t=this.ellipsoid.cartographicToCartesian(GC,oJe);return e.cartesianToCartographic(t,GC),GC.latitude};var sJe=new gn,aJe=new h,cJe=new h;hs.fromCartesian=function(e,t){let n=P.signNotZero(e.z),i=hs.NORTH_POLE_TANGENT_PLANE,r=hs.SOUTH_POLE;n<0&&(i=hs.SOUTH_POLE_TANGENT_PLANE,r=hs.NORTH_POLE);let o=sJe;o.origin=i.ellipsoid.scaleToGeocentricSurface(e,o.origin),o.direction=h.subtract(o.origin,r,aJe),h.normalize(o.direction,o.direction);let s=xi.rayPlane(o,i.plane,cJe),a=h.subtract(s,r,s),c=h.dot(i.xAxis,a),u=n*h.dot(i.yAxis,a);return l(t)?(t.position=new U(c,u),t.tangentPlane=i,t):new hs(new U(c,u),i)};hs.fromCartesianArray=function(e,t){let n=e.length;l(t)?t.length=n:t=new Array(n);for(let i=0;i<n;i++)t[i]=hs.fromCartesian(e[i],t[i]);return t};hs.clone=function(e,t){if(l(e))return l(t)?(t.position=e.position,t.tangentPlane=e.tangentPlane,t):new hs(e.position,e.tangentPlane)};hs.HALF_UNIT_SPHERE=Object.freeze(new ee(.5,.5,.5));hs.NORTH_POLE=Object.freeze(new h(0,0,.5));hs.SOUTH_POLE=Object.freeze(new h(0,0,-.5));hs.NORTH_POLE_TANGENT_PLANE=Object.freeze(new qs(hs.NORTH_POLE,hs.HALF_UNIT_SPHERE));hs.SOUTH_POLE_TANGENT_PLANE=Object.freeze(new qs(hs.SOUTH_POLE,hs.HALF_UNIT_SPHERE));var Ml=hs;var lJe=new he,qpe=new he;function uJe(e,t,n,i){let o=i.cartesianToCartographic(e,lJe).height,s=i.cartesianToCartographic(t,qpe);s.height=o,i.cartographicToCartesian(s,t);let a=i.cartesianToCartographic(n,qpe);a.height=o-100,i.cartographicToCartesian(a,n)}var Ype=new et,fJe=new h,dJe=new h,hJe=new h,mJe=new h,pJe=new h,gJe=new h,K3=new h,hp=new h,WC=new h,_Je=new U,yJe=new U,AJe=new h,Xpe=new Le,bJe=new $,xJe=new $;function O$(e){let t=e.vertexFormat,n=e.geometry,i=e.shadowVolume,r=n.attributes.position.values,o=l(n.attributes.st)?n.attributes.st.values:void 0,s=r.length,a=e.wall,c=e.top||a,u=e.bottom||a;if(t.st||t.normal||t.tangent||t.bitangent||i){let f=e.boundingRectangle,d=e.rotationAxis,p=e.projectTo2d,g=e.ellipsoid,m=e.stRotation,y=e.perPositionHeight,A=_Je;A.x=f.x,A.y=f.y;let b=t.st?new Float32Array(2*(s/3)):void 0,x;t.normal&&(y&&c&&!a?x=n.attributes.normal.values:x=new Float32Array(s));let T=t.tangent?new Float32Array(s):void 0,E=t.bitangent?new Float32Array(s):void 0,v=i?new Float32Array(s):void 0,S=0,I=0,R=dJe,O=hJe,L=mJe,_=!0,C=bJe,w=xJe;if(m!==0){let F=Le.fromAxisAngle(d,m,Xpe);C=$.fromQuaternion(F,C),F=Le.fromAxisAngle(d,-m,Xpe),w=$.fromQuaternion(F,w)}else C=$.clone($.IDENTITY,C),w=$.clone($.IDENTITY,w);let D=0,N=0;c&&u&&(D=s/2,N=s/3,s/=2);for(let F=0;F<s;F+=3){let V=h.fromArray(r,F,AJe);if(t.st&&!l(o)){let B=$.multiplyByVector(C,V,fJe);B=g.scaleToGeodeticSurface(B,B);let j=p([B],yJe)[0];U.subtract(j,A,j);let k=P.clamp(j.x/f.width,0,1),G=P.clamp(j.y/f.height,0,1);u&&(b[S+N]=k,b[S+1+N]=G),c&&(b[S]=k,b[S+1]=G),S+=2}if(t.normal||t.tangent||t.bitangent||i){let B=I+1,j=I+2;if(a){if(F+3<s){let k=h.fromArray(r,F+3,pJe);if(_){let G=h.fromArray(r,F+s,gJe);y&&uJe(V,k,G,g),h.subtract(k,V,k),h.subtract(G,V,G),R=h.normalize(h.cross(G,k,R),R),_=!1}h.equalsEpsilon(k,V,P.EPSILON10)&&(_=!0)}(t.tangent||t.bitangent)&&(L=g.geodeticSurfaceNormal(V,L),t.tangent&&(O=h.normalize(h.cross(L,R,O),O)))}else R=g.geodeticSurfaceNormal(V,R),(t.tangent||t.bitangent)&&(y&&(K3=h.fromArray(x,I,K3),hp=h.cross(h.UNIT_Z,K3,hp),hp=h.normalize($.multiplyByVector(w,hp,hp),hp),t.bitangent&&(WC=h.normalize(h.cross(K3,hp,WC),WC))),O=h.cross(h.UNIT_Z,R,O),O=h.normalize($.multiplyByVector(w,O,O),O),t.bitangent&&(L=h.normalize(h.cross(R,O,L),L)));t.normal&&(e.wall?(x[I+D]=R.x,x[B+D]=R.y,x[j+D]=R.z):u&&(x[I+D]=-R.x,x[B+D]=-R.y,x[j+D]=-R.z),(c&&!y||a)&&(x[I]=R.x,x[B]=R.y,x[j]=R.z)),i&&(a&&(R=g.geodeticSurfaceNormal(V,R)),v[I+D]=-R.x,v[B+D]=-R.y,v[j+D]=-R.z),t.tangent&&(e.wall?(T[I+D]=O.x,T[B+D]=O.y,T[j+D]=O.z):u&&(T[I+D]=-O.x,T[B+D]=-O.y,T[j+D]=-O.z),c&&(y?(T[I]=hp.x,T[B]=hp.y,T[j]=hp.z):(T[I]=O.x,T[B]=O.y,T[j]=O.z))),t.bitangent&&(u&&(E[I+D]=L.x,E[B+D]=L.y,E[j+D]=L.z),c&&(y?(E[I]=WC.x,E[B]=WC.y,E[j]=WC.z):(E[I]=L.x,E[B]=L.y,E[j]=L.z))),I+=3}}t.st&&!l(o)&&(n.attributes.st=new Ne({componentDatatype:Y.FLOAT,componentsPerAttribute:2,values:b})),t.normal&&(n.attributes.normal=new Ne({componentDatatype:Y.FLOAT,componentsPerAttribute:3,values:x})),t.tangent&&(n.attributes.tangent=new Ne({componentDatatype:Y.FLOAT,componentsPerAttribute:3,values:T})),t.bitangent&&(n.attributes.bitangent=new Ne({componentDatatype:Y.FLOAT,componentsPerAttribute:3,values:E})),i&&(n.attributes.extrudeDirection=new Ne({componentDatatype:Y.FLOAT,componentsPerAttribute:3,values:v}))}if(e.extrude&&l(e.offsetAttribute)){let f=r.length/3,d=new Uint8Array(f);if(e.offsetAttribute===pn.TOP)c&&u||a?d=d.fill(1,0,f/2):c&&(d=d.fill(1));else{let p=e.offsetAttribute===pn.NONE?0:1;d=d.fill(p)}n.attributes.applyOffset=new Ne({componentDatatype:Y.UNSIGNED_BYTE,componentsPerAttribute:1,values:d})}return n}var Kpe=[];function TJe(e,t,n,i,r,o,s,a,c,u){let f={walls:[]},d;if(s||a){let x=ni.createGeometryFromPositions(e,t,n,i,o,c,u),T=x.attributes.position.values,E=x.indices,v,S;if(s&&a){let I=T.concat(T);v=I.length/3,S=je.createTypedArray(v,E.length*2),S.set(E);let R=E.length,O=v/2;for(d=0;d<R;d+=3){let L=S[d]+O,_=S[d+1]+O,C=S[d+2]+O;S[d+R]=C,S[d+1+R]=_,S[d+2+R]=L}if(x.attributes.position.values=I,o&&c.normal){let L=x.attributes.normal.values;x.attributes.normal.values=new Float32Array(I.length),x.attributes.normal.values.set(L)}if(c.st&&l(n)){let L=x.attributes.st.values;x.attributes.st.values=new Float32Array(v*2),x.attributes.st.values=L.concat(L)}x.indices=S}else if(a){for(v=T.length/3,S=je.createTypedArray(v,E.length),d=0;d<E.length;d+=3)S[d]=E[d+2],S[d+1]=E[d+1],S[d+2]=E[d];x.indices=S}f.topAndBottom=new Bt({geometry:x})}let p=r.outerRing,g=qs.fromPoints(p,e),m=g.projectPointsOntoPlane(p,Kpe),y=mi.computeWindingOrder2D(m);y===sa.CLOCKWISE&&(p=p.slice().reverse());let A=ni.computeWallGeometry(p,n,e,i,o,u);f.walls.push(new Bt({geometry:A}));let b=r.holes;for(d=0;d<b.length;d++){let x=b[d];m=g.projectPointsOntoPlane(x,Kpe),y=mi.computeWindingOrder2D(m),y===sa.COUNTER_CLOCKWISE&&(x=x.slice().reverse()),A=ni.computeWallGeometry(x,n,e,i,o,u),f.walls.push(new Bt({geometry:A}))}return f}function hd(e){let t=e.polygonHierarchy,n=e.vertexFormat??Be.DEFAULT,i=e.ellipsoid??ee.default,r=e.granularity??P.RADIANS_PER_DEGREE,o=e.stRotation??0,s=e.textureCoordinates,a=e.perPositionHeight??!1,c=a&&l(e.extrudedHeight),u=e.height??0,f=e.extrudedHeight??u;if(!c){let d=Math.max(u,f);f=Math.min(u,f),u=d}this._vertexFormat=Be.clone(n),this._ellipsoid=ee.clone(i),this._granularity=r,this._stRotation=o,this._height=u,this._extrudedHeight=f,this._closeTop=e.closeTop??!0,this._closeBottom=e.closeBottom??!0,this._polygonHierarchy=t,this._perPositionHeight=a,this._perPositionHeightExtrude=c,this._shadowVolume=e.shadowVolume??!1,this._workerName="createPolygonGeometry",this._offsetAttribute=e.offsetAttribute,this._arcType=e.arcType??ln.GEODESIC,this._rectangle=void 0,this._textureCoordinateRotationPoints=void 0,this._textureCoordinates=s,this.packedLength=ni.computeHierarchyPackedLength(t,h)+ee.packedLength+Be.packedLength+(s?ni.computeHierarchyPackedLength(s,U):1)+12}hd.fromPositions=function(e){e=e??H.EMPTY_OBJECT;let t={polygonHierarchy:{positions:e.positions},height:e.height,extrudedHeight:e.extrudedHeight,vertexFormat:e.vertexFormat,stRotation:e.stRotation,ellipsoid:e.ellipsoid,granularity:e.granularity,perPositionHeight:e.perPositionHeight,closeTop:e.closeTop,closeBottom:e.closeBottom,offsetAttribute:e.offsetAttribute,arcType:e.arcType,textureCoordinates:e.textureCoordinates};return new hd(t)};hd.pack=function(e,t,n){return n=n??0,n=ni.packPolygonHierarchy(e._polygonHierarchy,t,n,h),ee.pack(e._ellipsoid,t,n),n+=ee.packedLength,Be.pack(e._vertexFormat,t,n),n+=Be.packedLength,t[n++]=e._height,t[n++]=e._extrudedHeight,t[n++]=e._granularity,t[n++]=e._stRotation,t[n++]=e._perPositionHeightExtrude?1:0,t[n++]=e._perPositionHeight?1:0,t[n++]=e._closeTop?1:0,t[n++]=e._closeBottom?1:0,t[n++]=e._shadowVolume?1:0,t[n++]=e._offsetAttribute??-1,t[n++]=e._arcType,l(e._textureCoordinates)?n=ni.packPolygonHierarchy(e._textureCoordinates,t,n,U):t[n++]=-1,t[n]=e.packedLength,t};var EJe=ee.clone(ee.UNIT_SPHERE),CJe=new Be,vJe={polygonHierarchy:{}};hd.unpack=function(e,t,n){t=t??0;let i=ni.unpackPolygonHierarchy(e,t,h);t=i.startingIndex,delete i.startingIndex;let r=ee.unpack(e,t,EJe);t+=ee.packedLength;let o=Be.unpack(e,t,CJe);t+=Be.packedLength;let s=e[t++],a=e[t++],c=e[t++],u=e[t++],f=e[t++]===1,d=e[t++]===1,p=e[t++]===1,g=e[t++]===1,m=e[t++]===1,y=e[t++],A=e[t++],b=e[t]===-1?void 0:ni.unpackPolygonHierarchy(e,t,U);l(b)?(t=b.startingIndex,delete b.startingIndex):t++;let x=e[t];return l(n)||(n=new hd(vJe)),n._polygonHierarchy=i,n._ellipsoid=ee.clone(r,n._ellipsoid),n._vertexFormat=Be.clone(o,n._vertexFormat),n._height=s,n._extrudedHeight=a,n._granularity=c,n._stRotation=u,n._perPositionHeightExtrude=f,n._perPositionHeight=d,n._closeTop=p,n._closeBottom=g,n._shadowVolume=m,n._offsetAttribute=y===-1?void 0:y,n._arcType=A,n._textureCoordinates=b,n.packedLength=x,n};var SJe=new U,wJe=new U,IJe=new Ml;function $pe(e,t,n,i,r,o){let s=e.longitude,a=s>=0?s:s+P.TWO_PI;r.westOverIdl=Math.min(r.westOverIdl,a),r.eastOverIdl=Math.max(r.eastOverIdl,a),o.west=Math.min(o.west,s),o.east=Math.max(o.east,s);let c=e.getLatitude(n),u=c;if(o.south=Math.min(o.south,c),o.north=Math.max(o.north,c),i!==ln.RHUMB){let p=U.subtract(t.position,e.position,SJe),g=U.dot(t.position,p)/U.dot(p,p);if(g>0&&g<1){let m=U.add(t.position,U.multiplyByScalar(p,-g,p),wJe),y=Ml.clone(t,IJe);y.position=m;let A=y.getLatitude(n);o.south=Math.min(o.south,A),o.north=Math.max(o.north,A),Math.abs(c)>Math.abs(A)&&(u=A)}}let f=t.x*e.y-e.x*t.y,d=Math.sign(f);d!==0&&(d*=U.angleBetween(t.position,e.position)),u>=0&&(r.northAngle+=d),u<=0&&(r.southAngle+=d)}var Jpe=new Ml,PJe=new Ml,dd={northAngle:0,southAngle:0,westOverIdl:0,eastOverIdl:0};hd.computeRectangleFromPositions=function(e,t,n,i){if(l(i)||(i=new ie),e.length<3)return i;i.west=Number.POSITIVE_INFINITY,i.east=Number.NEGATIVE_INFINITY,i.south=Number.POSITIVE_INFINITY,i.north=Number.NEGATIVE_INFINITY,dd.northAngle=0,dd.southAngle=0,dd.westOverIdl=Number.POSITIVE_INFINITY,dd.eastOverIdl=Number.NEGATIVE_INFINITY;let r=e.length,o=Ml.fromCartesian(e[0],PJe);for(let s=1;s<r;s++){let a=Ml.fromCartesian(e[s],Jpe);$pe(a,o,t,n,dd,i),o=Ml.clone(a,o)}return $pe(Ml.fromCartesian(e[0],Jpe),o,t,n,dd,i),i.east-i.west>dd.eastOverIdl-dd.westOverIdl&&(i.west=dd.westOverIdl,i.east=dd.eastOverIdl,i.east>P.PI&&(i.east=i.east-P.TWO_PI),i.west>P.PI&&(i.west=i.west-P.TWO_PI)),P.equalsEpsilon(Math.abs(dd.northAngle),P.TWO_PI,P.EPSILON10)&&(i.north=P.PI_OVER_TWO,i.east=P.PI,i.west=-P.PI),P.equalsEpsilon(Math.abs(dd.southAngle),P.TWO_PI,P.EPSILON10)&&(i.south=-P.PI_OVER_TWO,i.east=P.PI,i.west=-P.PI),i};var DJe=new Ml;function RJe(e,t,n){return e.height>=P.PI||e.width>=P.PI?Ml.fromCartesian(t[0],DJe).tangentPlane:qs.fromPoints(t,n)}var Zpe=new he;function OJe(e,t,n){return(i,r)=>{if(e.height>=P.PI||e.width>=P.PI){if(e.south<0&&e.north>0){l(r)||(r=[]);for(let s=0;s<i.length;++s){let a=n.cartesianToCartographic(i[s],Zpe);r[s]=new U(a.longitude/P.PI,a.latitude/P.PI_OVER_TWO)}return r.length=i.length,r}return Ml.fromCartesianArray(i,r)}return qs.fromPoints(t,n).projectPointsOntoPlane(i,r)}}function MJe(e,t,n){if(e.height>=P.PI||e.width>=P.PI)return(r,o)=>{if(e.south<0&&e.north>0){let s=n.cartesianToCartographic(r,Zpe);return l(o)||(o=new U),o.x=s.longitude/P.PI,o.y=s.latitude/P.PI_OVER_TWO,o}return Ml.fromCartesian(r,o)};let i=qs.fromPoints(t,n);return(r,o)=>i.projectPointsOntoPlane(r,o)}function NJe(e,t,n,i){return(r,o)=>!i&&(e.height>=P.PI_OVER_TWO||e.width>=2*P.PI_OVER_THREE)?ni.splitPolygonsOnEquator(r,t,n,o):r}function LJe(e,t,n,i){if(t.height>=P.PI||t.width>=P.PI)return et.fromRectangle(t,void 0,Ype);let r=e,o=qs.fromPoints(r,n);return ni.computeBoundingRectangle(o.plane.normal,o.projectPointOntoPlane.bind(o),r,i,Ype)}hd.createGeometry=function(e){let t=e._vertexFormat,n=e._ellipsoid,i=e._granularity,r=e._stRotation,o=e._polygonHierarchy,s=e._perPositionHeight,a=e._closeTop,c=e._closeBottom,u=e._arcType,f=e._textureCoordinates,d=l(f),p=o.positions;if(p.length<3)return;let g=e.rectangle,m=ni.polygonsFromHierarchy(o,d,OJe(g,p,n),!s,n,NJe(g,n,u,s)),y=m.hierarchy,A=m.polygons,b=function(D){return D},x=d?ni.polygonsFromHierarchy(f,!0,b,!1,n).polygons:void 0;if(y.length===0)return;let T=y[0].outerRing,E=LJe(T,g,n,r),v=[],S=e._height,I=e._extrudedHeight,R=e._perPositionHeightExtrude||!P.equalsEpsilon(S,I,0,P.EPSILON2),O={perPositionHeight:s,vertexFormat:t,geometry:void 0,rotationAxis:RJe(g,T,n).plane.normal,projectTo2d:MJe(g,T,n),boundingRectangle:E,ellipsoid:n,stRotation:r,textureCoordinates:void 0,bottom:!1,top:!0,wall:!1,extrude:!1,arcType:u},L;if(R)for(O.extrude=!0,O.top=a,O.bottom=c,O.shadowVolume=e._shadowVolume,O.offsetAttribute=e._offsetAttribute,L=0;L<A.length;L++){let D=TJe(n,A[L],d?x[L]:void 0,i,y[L],s,a,c,t,u),N;a&&c?(N=D.topAndBottom,O.geometry=ni.scaleToGeodeticHeightExtruded(N.geometry,S,I,n,s)):a?(N=D.topAndBottom,N.geometry.attributes.position.values=mi.scaleToGeodeticHeight(N.geometry.attributes.position.values,S,n,!s),O.geometry=N.geometry):c&&(N=D.topAndBottom,N.geometry.attributes.position.values=mi.scaleToGeodeticHeight(N.geometry.attributes.position.values,I,n,!0),O.geometry=N.geometry),(a||c)&&(O.wall=!1,N.geometry=O$(O),v.push(N));let F=D.walls;O.wall=!0;for(let V=0;V<F.length;V++){let B=F[V];O.geometry=ni.scaleToGeodeticHeightExtruded(B.geometry,S,I,n,s),B.geometry=O$(O),v.push(B)}}else for(L=0;L<A.length;L++){let D=new Bt({geometry:ni.createGeometryFromPositions(n,A[L],d?x[L]:void 0,i,s,t,u)});if(D.geometry.attributes.position.values=mi.scaleToGeodeticHeight(D.geometry.attributes.position.values,S,n,!s),O.geometry=D.geometry,D.geometry=O$(O),l(e._offsetAttribute)){let N=D.geometry.attributes.position.values.length,F=e._offsetAttribute===pn.NONE?0:1,V=new Uint8Array(N/3).fill(F);D.geometry.attributes.applyOffset=new Ne({componentDatatype:Y.UNSIGNED_BYTE,componentsPerAttribute:1,values:V})}v.push(D)}let _=Wn.combineInstances(v)[0];_.attributes.position.values=new Float64Array(_.attributes.position.values),_.indices=je.createTypedArray(_.attributes.position.values.length/3,_.indices);let C=_.attributes,w=ue.fromVertices(C.position.values);return t.position||delete C.position,new wt({attributes:C,indices:_.indices,primitiveType:_.primitiveType,boundingSphere:w,offsetAttribute:e._offsetAttribute})};hd.createShadowVolume=function(e,t,n){let i=e._granularity,r=e._ellipsoid,o=t(i,r),s=n(i,r);return new hd({polygonHierarchy:e._polygonHierarchy,ellipsoid:r,stRotation:e._stRotation,granularity:i,perPositionHeight:!1,extrudedHeight:o,height:s,vertexFormat:Be.POSITION_ONLY,shadowVolume:!0,arcType:e._arcType})};function FJe(e){let t=-e._stRotation;if(t===0)return[0,0,0,1,1,0];let n=e._ellipsoid,i=e._polygonHierarchy.positions,r=e.rectangle;return wt._textureCoordinateRotationPoints(i,t,n,r)}Object.defineProperties(hd.prototype,{rectangle:{get:function(){if(!l(this._rectangle)){let e=this._polygonHierarchy.positions;this._rectangle=hd.computeRectangleFromPositions(e,this._ellipsoid,this._arcType)}return this._rectangle}},textureCoordinateRotationPoints:{get:function(){return l(this._textureCoordinateRotationPoints)||(this._textureCoordinateRotationPoints=FJe(this)),this._textureCoordinateRotationPoints}}});var tg=hd;function qC(e){this._ellipsoid=e.ellipsoid??ee.default,this._positions=$3(e.positions),this._holes=l(e.holes)?e.holes.map($3):[],this._rectangle=tg.computeRectangleFromPositions(this._positions,this._ellipsoid),M$(this._positions),Qpe(this._holes)}function $3(e){if(!l(e))return;let t=e.length,n=Array(t);for(let i=0;i<t;i++)n[i]=h.clone(e[i]);return n}function M$(e){for(let t=0;t<e.length;t++)Object.freeze(e[t]);return Object.freeze(e)}function Qpe(e){for(let t=0;t<e.length;t++)M$(e[t]);return Object.freeze(e)}function BJe(e,t){if(!l(e)&&!l(t))return!0;if(l(e)!==l(t)||e.length!==t.length)return!1;let n=e.length;for(let i=0;i<n;i++){let r=e[i],o=t[i];if(!h.equals(r,o))return!1}return!0}function kJe(e,t){if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(!BJe(e[n],t[n]))return!1;return!0}Object.defineProperties(qC.prototype,{length:{get:function(){let e=this._positions.length,t=this._holes;for(let n=0;n<t.length;n++)e+=t[n].length;return e}},positions:{get:function(){return this._positions}},holes:{get:function(){return this._holes}},ellipsoid:{get:function(){return this._ellipsoid}},rectangle:{get:function(){return this._rectangle}}});qC.clone=function(e,t){return l(t)?(t._ellipsoid=e.ellipsoid,t._positions=$3(e.positions),t._holes=e.holes.map($3),t._rectangle=tg.computeRectangleFromPositions(t._positions,t._ellipsoid),M$(t._positions),Qpe(t._holes),t):new qC({positions:e.positions,holes:e.holes,ellipsoid:e.ellipsoid})};qC.equals=function(e,t){return e.ellipsoid.equals(t.ellipsoid)&&e.positions===t.positions&&kJe(e.holes,t.holes)};qC.prototype.computeRectangle=function(e){return Yr("ClippingPolygon.computeRectangle","ClippingPolygon.computeRectangle is deprecated as of CesiumJS 1.145 and will be removed in 1.147. Use the ClippingPolygon.rectangle property instead."),ie.clone(this._rectangle,e)};var SD=qC;var e0e={OPAQUE:0,TRANSLUCENT:1,OPAQUE_AND_TRANSLUCENT:2};Object.freeze(e0e);var ki=e0e;var wD=class wD{constructor(t=H.EMPTY_OBJECT){ut(this,"_renderContext",null);this.show=t.show??!0,this._heightReference=t.heightReference??We.NONE,this._blendOption=t.blendOption??ki.TRANSLUCENT,this._modelMatrix=M.clone(t.modelMatrix??M.IDENTITY),this._boundingVolume=ue.clone(t.boundingVolume??new ue,new ue),this._boundingVolumeAutoUpdate=!l(t.boundingVolume),this._allowPicking=t.allowPicking??!1,this._pickIds=new Map,this._customPickObjects=[],this.debugShowBoundingVolume=t.debugShowBoundingVolume??!1,this._primitiveCount=0,this._primitiveCountMax=t.primitiveCountMax??wD.DEFAULT_CAPACITY,this._primitiveView=null,this._positionCount=0,this._positionCountMax=t.vertexCountMax??wD.DEFAULT_CAPACITY,this._positionView=null,this._positionDatatype=t.positionDatatype??Y.DOUBLE,this._positionNormalized=t.positionNormalized??!1,this._materialView=null,this._dirtyOffset=0,this._dirtyCount=0,this._dirtyBoundingVolume=!1,this._version=0,this._allocatePrimitiveBuffer(),this._allocatePositionBuffer(),this._allocateMaterialBuffer()}_getCollectionClass(){pe.throwInstantiationError()}_getPrimitiveClass(){pe.throwInstantiationError()}_getMaterialClass(){pe.throwInstantiationError()}_allocatePrimitiveBuffer(){let t=this._getPrimitiveClass().Layout;this._primitiveView=new DataView(new ArrayBuffer(this._primitiveCountMax*t.__BYTE_LENGTH))}_allocatePositionBuffer(){this._positionView=Y.createTypedArray(this._positionDatatype,this._positionCountMax*3)}_allocateMaterialBuffer(){let t=this._getMaterialClass();this._materialView=new DataView(new ArrayBuffer(this._primitiveCountMax*t.packedLength))}isDestroyed(){return!1}destroy(){this._customPickObjects.length=0;for(let t of this._pickIds.values())for(let n of t)n.destroy();l(this._renderContext)&&(this._renderContext.destroy(),this._renderContext=void 0,this._dirtyOffset=0,this._dirtyCount=this.primitiveCount)}sort(t,n=new Uint32Array(this.primitiveCount)){let i=this._getPrimitiveClass(),r=this._getCollectionClass(),{primitiveCount:o}=this,s=new i,a=new i,c=new Uint32Array(o);for(let f=0;f<o;f++)c[f]=f;c.sort((f,d)=>t(this.get(f,s),this.get(d,a)));for(let f=0;f<o;f++)n[c[f]]=f;let u=this._cloneEmpty();for(let f=0;f<o;f++){let d=this.get(c[f],s),p=u.add({},a);i.clone(d,p)}return r._replaceBuffers(u,this),this._dirtyOffset=0,this._dirtyCount=o,n}static clone(t,n,i){if(l(i))return this._cloneFiltered(t,n,i);let r=t._getPrimitiveClass().Layout,o=t._getMaterialClass(),s=t._getPrimitiveClass();this._copySubDataView(t._primitiveView,n._primitiveView,t.primitiveCount*r.__BYTE_LENGTH),this._copySubArray(t._positionView,n._positionView,t.vertexCount*3),this._copySubDataView(t._materialView,n._materialView,t.primitiveCount*o.packedLength),n._primitiveCount=t._primitiveCount,n._positionCount=t._positionCount;let a=t._customPickObjects,c=n._customPickObjects;c.length=0;let u=new s;for(let f=0,d=n.primitiveCount;f<d;f++)c[f]=a[f],n.get(f,u)._pickId=0;return n._dirtyOffset=0,n._dirtyCount=n.primitiveCount,t.boundingVolume.clone(n.boundingVolume),n}static _cloneFiltered(t,n,i){let r=t._getPrimitiveClass(),o=new r,s=new r,a=t._customPickObjects,c=n._customPickObjects;c.length=0;for(let u=0,f=t._primitiveCount;u<f;u++){if(t.get(u,o),!i(o,u))continue;let d=n._primitiveCount;r.clone(o,n.add({},s)),l(a[u])&&(c[d]=a[u])}return n}static fromCollection(t,n=H.EMPTY_OBJECT,i){let r=t._cloneEmpty(n);return t._getCollectionClass().clone(t,r,i),r}_cloneEmptyBaseArgs(t){return{primitiveCountMax:this.primitiveCountMax,vertexCountMax:this.vertexCountMax,positionDatatype:this.positionDatatype,positionNormalized:this.positionNormalized,modelMatrix:this._modelMatrix,show:this.show,debugShowBoundingVolume:this.debugShowBoundingVolume,blendOption:this._blendOption,allowPicking:this._allowPicking,boundingVolume:this._boundingVolumeAutoUpdate?void 0:this._boundingVolume,...t}}_cloneEmpty(t){pe.throwInstantiationError()}static _replaceBuffers(t,n){n._primitiveView=t._primitiveView,n._positionView=t._positionView,n._materialView=t._materialView}_updateBoundingVolume(){let t=this._positionView.subarray(0,this._positionCount*3);this._positionNormalized&&(t=cn.dequantize(t,this._positionDatatype,Vt.VEC3,this._positionCount)),ue.fromVertices(t,h.ZERO,3,this._boundingVolume),ue.transform(this._boundingVolume,this._modelMatrix,this._boundingVolume),this._dirtyBoundingVolume=!1}_updatePickIds(t){let n=this._pickIds.get(t);if(n&&n.length===this._primitiveCount)return;n||(n=[],this._pickIds.set(t,n));let i=this,r=this._getPrimitiveClass(),o=new r;for(let s=n.length,a=this._primitiveCount;s<a;s++){this.get(s,o);let c=this._customPickObjects[s]||{collection:this,index:s,get primitive(){return i.get(s,new r)}},u=t.createPickId(c);o._pickId=u.key,n.push(u)}}get(t,n){return n._collection=this,n._index=t,n._byteOffset=t*this._getPrimitiveClass().Layout.__BYTE_LENGTH,n}add(t=H.EMPTY_OBJECT,n){let i=this._getMaterialClass(),r=this._primitiveCount++;return n=this.get(r,n),n.featureId=t.featureId??r,n.show=t.show??!0,n.setMaterial(t.material??i.DEFAULT_MATERIAL),n._pickId=0,n._dirty=!0,l(t.pickObject)&&(this._customPickObjects[r]=t.pickObject),n}_makeDirty(t){this._dirtyCount===0?(this._dirtyCount=1,this._dirtyOffset=t):t<this._dirtyOffset?(this._dirtyCount+=this._dirtyOffset-t,this._dirtyOffset=t):t+1>this._dirtyOffset+this._dirtyCount&&(this._dirtyCount=t+1-this._dirtyOffset)}_makeClean(){this._dirtyCount>0&&(this._dirtyCount=0,this._dirtyOffset=0,this._version++)}_makeDirtyBoundingVolume(){this._boundingVolumeAutoUpdate&&(this._dirtyBoundingVolume=!0)}update(t){t.mode!==re.SCENE3D&&yt("bufferprim-scenemode","BufferPrimitiveCollection requires SceneMode.SCENE3D."),this._dirtyBoundingVolume&&this._updateBoundingVolume(),this._allowPicking&&this._updatePickIds(t.context)}_isRendered(t){let n=t.passes;return this.show&&!us(this._heightReference)&&(n.render||n.pick)}get primitiveCount(){return this._primitiveCount}get primitiveCountMax(){return this._primitiveCountMax}get byteLength(){return this._primitiveView.byteLength+this._positionView.byteLength+this._materialView.byteLength}get vertexCount(){return this._positionCount}get vertexCountMax(){return this._positionCountMax}get modelMatrix(){return this._modelMatrix}get boundingVolume(){return this._dirtyBoundingVolume&&this._updateBoundingVolume(),this._boundingVolume}get positionDatatype(){return this._positionDatatype}get positionNormalized(){return this._positionNormalized}get heightReference(){return this._heightReference}static _copySubArray(t,n,i){for(let r=0;r<i;r++)n[r]=t[r]}static _copySubDataView(t,n,i){this._copySubArray(new Uint32Array(t.buffer,t.byteOffset,t.byteLength/4),new Uint32Array(n.buffer,n.byteOffset,n.byteLength/4),i/4)}toJSON(){let t=this._getPrimitiveClass(),n=new t,i=[];for(let r=0,o=this.primitiveCount;r<o;r++)i.push(this.get(r,n).toJSON());return i}};ut(wD,"Error",{ERR_RESIZE:"BufferPrimitive range cannot be resized after initialization.",ERR_CAPACITY:"BufferPrimitiveCollection capacity exceeded.",ERR_MULTIPLE_OF_FOUR:"BufferPrimitive byte length must be a multiple of 4.",ERR_OUT_OF_RANGE:"BufferPrimitive buffer access out of range."});var J3=wD;J3.DEFAULT_CAPACITY=1024;var da=J3;var Dh=class Dh{constructor(){ut(this,"_collection",null);ut(this,"_index",-1);ut(this,"_byteOffset",-1)}static clone(t,n){let i=t._collection._getMaterialClass();return n.featureId=t.featureId,n.show=t.show,n.setMaterial(t.getMaterial(new i)),n}_isResizable(){return this._index===this._collection.primitiveCount-1}get featureId(){return this._getUint32(Dh.Layout.FEATURE_ID_U32)}set featureId(t){this._setUint32(Dh.Layout.FEATURE_ID_U32,t)}get show(){return this._getUint8(Dh.Layout.SHOW_U8)===1}set show(t){this._setUint8(Dh.Layout.SHOW_U8,t?1:0)}getMaterial(t){let n=this._collection,i=n._getMaterialClass();return i.unpack(n._materialView,this._index*i.packedLength,t)}setMaterial(t){let n=this._collection,i=n._getMaterialClass();return i.pack(t,n._materialView,this._index*i.packedLength),this._dirty=!0,t}get _dirty(){return this._getUint8(Dh.Layout.DIRTY_U8)===1}set _dirty(t){this._collection._primitiveView.setUint8(this._byteOffset+Dh.Layout.DIRTY_U8,t?1:0),t&&this._collection._makeDirty(this._index)}get _pickId(){return this._getUint32(Dh.Layout.PICK_ID_U32)}set _pickId(t){this._setUint32(Dh.Layout.PICK_ID_U32,t)}_getUint8(t){return this._collection._primitiveView.getUint8(this._byteOffset+t)}_setUint8(t,n){this._collection._primitiveView.setUint8(this._byteOffset+t,n),this._dirty=!0}_getUint32(t){return this._collection._primitiveView.getUint32(this._byteOffset+t,!0)}_setUint32(t,n){this._collection._primitiveView.setUint32(this._byteOffset+t,n,!0),this._dirty=!0}_getFloat32(t){return this._collection._primitiveView.getFloat32(this._byteOffset+t,!0)}_setFloat32(t,n){this._collection._primitiveView.setFloat32(this._byteOffset+t,n,!0),this._dirty=!0}toJSON(){let n=this._collection._getMaterialClass();return{featureId:this.featureId,show:this.show,dirty:this._dirty,material:this.getMaterial(new n).toJSON()}}};ut(Dh,"Layout",{FEATURE_ID_U32:0,SHOW_U8:4,DIRTY_U8:5,PICK_ID_U32:8,__BYTE_LENGTH:12});var N$=Dh,ms=N$;var{ERR_CAPACITY:lOn,ERR_RESIZE:uOn,ERR_OUT_OF_RANGE:fOn}=da.Error,md=class md extends ms{constructor(){super(...arguments);ut(this,"_collection",null)}static clone(n,i){return super.clone(n,i),i.setPositions(n.getPositions()),i.setHoles(n.getHoles()),i.setTriangles(n.getTriangles()),i}get vertexOffset(){return this._getUint32(md.Layout.POSITION_OFFSET_U32)}get vertexCount(){return this._getUint32(md.Layout.POSITION_COUNT_U32)}getPositions(n){return this._getPositionsRange(0,this.vertexCount,n)}setPositions(n){let i=this._collection,r=this.vertexOffset,o=this.vertexCount,s=n.length/3,a=i.vertexCount+s-o;i._positionCount=a,this._setUint32(md.Layout.POSITION_COUNT_U32,s);let c=i._positionView;for(let u=0;u<s;u++)c[(r+u)*3]=n[u*3],c[(r+u)*3+1]=n[u*3+1],c[(r+u)*3+2]=n[u*3+2];this._dirty=!0,i._makeDirtyBoundingVolume()}get outerVertexOffset(){return this.vertexOffset}get outerVertexCount(){return this.holeCount>0?this.getHoles()[0]:this.vertexCount}getOuterPositions(n){return this._getPositionsRange(0,this.outerVertexCount,n)}get holeOffset(){return this._getUint32(md.Layout.HOLE_OFFSET_U32)}get holeCount(){return this._getUint32(md.Layout.HOLE_COUNT_U32)}getHoles(n){let{holeOffset:i,holeCount:r}=this,o=this._collection._holeIndexView;if(!l(n)){let s=o.byteOffset+i*o.BYTES_PER_ELEMENT,a=o.constructor;return new a(o.buffer,s,r)}for(let s=0;s<r;s++)n[s]=o[i+s];return n}setHoles(n){let i=this._collection,r=this.holeOffset,o=this.holeCount,s=n.length,a=i.holeCount+s-o;i._holeCount=a,this._setUint32(md.Layout.HOLE_COUNT_U32,s);let c=i._holeIndexView;for(let u=0;u<s;u++)c[r+u]=n[u];this._dirty=!0}getHoleVertexCount(n){let i=this.getHoles(),r=i[n];return n===i.length-1?this.vertexCount-r:i[n+1]-r}getHolePositions(n,i){let o=this.getHoles()[n],s=this.getHoleVertexCount(n);return this._getPositionsRange(o,s,i)}_getPositionsRange(n,i,r){let o=this._collection,s=this._collection._positionView,a=this.vertexOffset+n;if(!l(r)){let c=s.byteOffset+a*3*s.BYTES_PER_ELEMENT,u=s.constructor;return new u(s.buffer,c,i*3)}for(let c=0;c<i;c++)r[c*3]=s[(a+c)*3],r[c*3+1]=s[(a+c)*3+1],r[c*3+2]=s[(a+c)*3+2];return r}get triangleOffset(){return this._getUint32(md.Layout.TRIANGLE_OFFSET_U32)}get triangleCount(){return this._getUint32(md.Layout.TRIANGLE_COUNT_U32)}getTriangles(n){let{triangleOffset:i,triangleCount:r}=this,o=this._collection._triangleIndexView;if(!l(n)){let s=o.byteOffset+i*3*o.BYTES_PER_ELEMENT,a=o.constructor;return new a(o.buffer,s,r*3)}for(let s=0;s<r;s++)n[s*3]=o[(i+s)*3],n[s*3+1]=o[(i+s)*3+1],n[s*3+2]=o[(i+s)*3+2];return n}setTriangles(n){let i=this._collection,r=this.triangleOffset,o=this.triangleCount,s=n.length/3,a=i.triangleCount+s-o;i._triangleCount+=s-o,this._setUint32(md.Layout.TRIANGLE_COUNT_U32,s);let c=i._triangleIndexView;for(let u=0;u<s;u++)c[(r+u)*3]=n[u*3],c[(r+u)*3+1]=n[u*3+1],c[(r+u)*3+2]=n[u*3+2];this._dirty=!0}toJSON(){return{...super.toJSON(),positions:Array.from(this.getPositions()),holes:Array.from(this.getHoles()),triangles:Array.from(this.getTriangles())}}};ut(md,"Layout",{...ms.Layout,POSITION_OFFSET_U32:ms.Layout.__BYTE_LENGTH,POSITION_COUNT_U32:ms.Layout.__BYTE_LENGTH+4,HOLE_OFFSET_U32:ms.Layout.__BYTE_LENGTH+8,HOLE_COUNT_U32:ms.Layout.__BYTE_LENGTH+12,TRIANGLE_OFFSET_U32:ms.Layout.__BYTE_LENGTH+16,TRIANGLE_COUNT_U32:ms.Layout.__BYTE_LENGTH+20,__BYTE_LENGTH:ms.Layout.__BYTE_LENGTH+24});var L$=md,Lo=L$;var ID=class{constructor(t=H.EMPTY_OBJECT){this.color=z.clone(t.color??z.WHITE),this.outlineColor=z.clone(t.outlineColor??z.WHITE),this.outlineWidth=t.outlineWidth??0}static get packedLength(){return this.Layout.__BYTE_LENGTH}static pack(t,n,i){n.setUint32(this.Layout.COLOR_U32+i,t.color.toRgba(),!0),n.setUint32(this.Layout.OUTLINE_COLOR_U32+i,t.outlineColor.toRgba(),!0),n.setUint8(this.Layout.OUTLINE_WIDTH_U8+i,t.outlineWidth)}static unpack(t,n,i){return z.fromRgba(t.getUint32(this.Layout.COLOR_U32+n,!0),i.color),z.fromRgba(t.getUint32(this.Layout.OUTLINE_COLOR_U32+n,!0),i.outlineColor),i.outlineWidth=t.getUint8(this.Layout.OUTLINE_WIDTH_U8+n),i}toJSON(){return{color:this.color.toCssHexString(),outlineColor:this.outlineColor.toCssHexString(),outlineWidth:this.outlineWidth}}};ut(ID,"Layout",{COLOR_U32:0,OUTLINE_COLOR_U32:4,OUTLINE_WIDTH_U8:8,__BYTE_LENGTH:12}),ut(ID,"DEFAULT_MATERIAL");var vu=ID;var Z3=class Z3 extends vu{constructor(t=H.EMPTY_OBJECT){super(t)}};ut(Z3,"DEFAULT_MATERIAL",Object.freeze(new Z3));var F$=Z3,pd=F$;var B$={positionHigh:0,positionLow:1,pickColor:2,showColorAlpha:3},t0e={position:0,pickColor:1,showColorAlpha:2},ha=new Lo,k$=new pd,PD=new z,n0e=new h,U$=new Sn;function UJe(e,t,n){let i=t.context;n=n||{destroy:VJe};let r=e._positionDatatype===Y.DOUBLE,o=r?B$:t0e;if(!l(n.attributeArrays)||!l(n.indexArray)){let{vertexCountMax:c,triangleCountMax:u}=e;n.indexArray=je.createTypedArray(c,u*3),n.attributeArrays={...r?{positionHigh:new Float32Array(c*3),positionLow:new Float32Array(c*3)}:{position:e._positionView},pickColor:new Uint8Array(c*4),showColorAlpha:new Float32Array(c*3)}}if(e._dirtyCount>0){let{attributeArrays:c}=n,{_dirtyOffset:u,_dirtyCount:f}=e,d=c.positionHigh,p=c.positionLow,g=n.indexArray,m=c.pickColor,y=c.showColorAlpha;for(let A=u,b=u+f;A<b;A++){if(e.get(A,ha),!ha._dirty)continue;let x=ha.triangleOffset,T=ha.vertexOffset,E=ha.getTriangles();for(let R=0,O=ha.triangleCount;R<O;R++)g[x*3]=T+E[R*3],g[x*3+1]=T+E[R*3+1],g[x*3+2]=T+E[R*3+2],x++;let v=ha.show,S=r?ha.getPositions():null;ha.getMaterial(k$);let I=cn.encodeRGB8(k$.color);z.fromRgba(ha._pickId,PD);for(let R=0,O=ha.vertexCount;R<O;R++)r&&(h.fromArray(S,R*3,n0e),Sn.fromCartesian(n0e,U$),h.pack(U$.high,d,T*3),h.pack(U$.low,p,T*3)),m[T*4]=z.floatToByte(PD.red),m[T*4+1]=z.floatToByte(PD.green),m[T*4+2]=z.floatToByte(PD.blue),m[T*4+3]=z.floatToByte(PD.alpha),y[T*3]=v?1:0,y[T*3+1]=I,y[T*3+2]=k$.color.alpha,T++;ha._dirty=!1}}if(l(n.vertexArray)){if(e._dirtyCount>0){let{indexOffset:c,indexCount:u,vertexOffset:f,vertexCount:d}=zJe(e);n.vertexArray.copyIndexFromRange(n.indexArray,c,u);for(let p in o)if(Object.hasOwn(o,p)){let g=p;n.vertexArray.copyAttributeFromRange(o[g],n.attributeArrays[g],f,d)}}}else{let{attributeArrays:c}=n;n.vertexArray=new Vn({context:i,indexBuffer:tt.createIndexBuffer({context:i,typedArray:n.indexArray,usage:Me.STATIC_DRAW,indexDatatype:je.fromTypedArray(n.indexArray)}),attributes:[...r?[{index:B$.positionHigh,componentDatatype:Y.FLOAT,componentsPerAttribute:3,vertexBuffer:tt.createVertexBuffer({typedArray:c.positionHigh,context:i,usage:Me.STATIC_DRAW})},{index:B$.positionLow,componentDatatype:Y.FLOAT,componentsPerAttribute:3,vertexBuffer:tt.createVertexBuffer({typedArray:c.positionLow,context:i,usage:Me.STATIC_DRAW})}]:[{index:t0e.position,componentDatatype:e._positionDatatype,componentsPerAttribute:3,normalize:e._positionNormalized,vertexBuffer:tt.createVertexBuffer({typedArray:c.position,context:i,usage:Me.STATIC_DRAW})}],{index:o.pickColor,componentDatatype:Y.UNSIGNED_BYTE,componentsPerAttribute:4,vertexBuffer:tt.createVertexBuffer({typedArray:c.pickColor,context:i,usage:Me.STATIC_DRAW})},{index:o.showColorAlpha,componentDatatype:Y.FLOAT,componentsPerAttribute:3,vertexBuffer:tt.createVertexBuffer({typedArray:c.showColorAlpha,context:i,usage:Me.STATIC_DRAW})}]})}l(n.renderState)||(n.renderState=Ge.fromCache({blending:e._blendOption===ki.OPAQUE?nn.DISABLED:nn.ALPHA_BLEND,depthTest:{enabled:!0}})),l(n.shaderProgram)||(n.shaderProgram=Qt.fromCache({context:i,vertexShaderSource:new Xe({sources:[A2],defines:r?["USE_FLOAT64"]:[]}),fragmentShaderSource:new Xe({sources:[y2]}),attributeLocations:o}));let s=e.triangleCount*3;l(n.command)||(n.command=new at({vertexArray:n.vertexArray,renderState:n.renderState,shaderProgram:n.shaderProgram,primitiveType:Oe.TRIANGLES,pass:e._blendOption===ki.OPAQUE?Ie.OPAQUE:Ie.TRANSLUCENT,pickId:e._allowPicking?"v_pickColor":void 0,owner:e,count:s,modelMatrix:e.modelMatrix,boundingVolume:e.boundingVolume,debugShowBoundingVolume:e.debugShowBoundingVolume}));let a=n.command;return a.count!==s&&(a.count=s),a.debugShowBoundingVolume!==e.debugShowBoundingVolume&&(a.debugShowBoundingVolume=e.debugShowBoundingVolume),t.commandList.push(a),e._makeClean(),n}function zJe(e){let{_dirtyOffset:t,_dirtyCount:n}=e;e.get(t,ha);let i=ha.vertexOffset,r=ha.triangleOffset*3;e.get(t+n-1,ha);let o=ha.vertexOffset+ha.vertexCount-i,s=(ha.triangleOffset+ha.triangleCount)*3-r;return{indexOffset:r,indexCount:s,vertexOffset:i,vertexCount:o}}function VJe(){let e=this;l(e.vertexArray)&&e.vertexArray.destroy(),l(e.shaderProgram)&&e.shaderProgram.destroy(),l(e.renderState)&&Ge.removeFromCache(e.renderState)}var Q3=UJe;var{ERR_CAPACITY:ZOn}=da.Error,z$=class e extends da{constructor(t=H.EMPTY_OBJECT){super(t),this._holeCount=0,this._holeCountMax=t.holeCountMax??da.DEFAULT_CAPACITY,this._holeIndexView=null,this._triangleCount=0,this._triangleCountMax=t.triangleCountMax??da.DEFAULT_CAPACITY,this._triangleIndexView=null,this._allocateHoleIndexBuffer(),this._allocateTriangleIndexBuffer()}_getCollectionClass(){return e}_getPrimitiveClass(){return Lo}_getMaterialClass(){return pd}_allocateHoleIndexBuffer(){this._holeIndexView=je.createTypedArray(this._positionCountMax,this._holeCountMax)}_allocateTriangleIndexBuffer(){this._triangleIndexView=je.createTypedArray(this._positionCountMax,this._triangleCountMax*3)}static clone(t,n,i){return super.clone(t,n,i),l(i)||(this._copySubArray(t._holeIndexView,n._holeIndexView,t.holeCount),this._copySubArray(t._triangleIndexView,n._triangleIndexView,t._triangleCount*3),n._holeCount=t._holeCount,n._triangleCount=t._triangleCount),n}static fromCollection(t,n,i){return super.fromCollection(t,n,i)}_cloneEmpty(t=H.EMPTY_OBJECT){return new e({holeCountMax:this.holeCountMax,triangleCountMax:this.triangleCountMax,...this._cloneEmptyBaseArgs(t)})}static _replaceBuffers(t,n){super._replaceBuffers(t,n),n._holeIndexView=t._holeIndexView,n._triangleIndexView=t._triangleIndexView}add(t,n=new Lo){super.add(t,n);let i=this._positionCount;n._setUint32(Lo.Layout.POSITION_OFFSET_U32,i),n._setUint32(Lo.Layout.POSITION_COUNT_U32,0);let r=this._holeCount;n._setUint32(Lo.Layout.HOLE_OFFSET_U32,r),n._setUint32(Lo.Layout.HOLE_COUNT_U32,0);let o=this._triangleCount;return n._setUint32(Lo.Layout.TRIANGLE_OFFSET_U32,o),n._setUint32(Lo.Layout.TRIANGLE_COUNT_U32,0),l(t.positions)&&n.setPositions(t.positions),l(t.holes)&&n.setHoles(t.holes),l(t.triangles)&&n.setTriangles(t.triangles),n}update(t){super.update(t),this._isRendered(t)&&(this._renderContext=Q3(this,t,this._renderContext))}get byteLength(){return super.byteLength+this._holeIndexView.byteLength+this._triangleIndexView.byteLength}get holeCount(){return this._holeCount}get holeCountMax(){return this._holeCountMax}get triangleCount(){return this._triangleCount}get triangleCountMax(){return this._triangleCountMax}},Za=z$;var{ERR_RESIZE:iMn,ERR_CAPACITY:rMn}=da.Error,YC=class YC extends ms{constructor(){super(...arguments);ut(this,"_collection",null)}static clone(n,i){return super.clone(n,i),i.setPositions(n.getPositions()),i}get vertexOffset(){return this._getUint32(YC.Layout.POSITION_OFFSET_U32)}get vertexCount(){return this._getUint32(YC.Layout.POSITION_COUNT_U32)}getPositions(n){let{vertexOffset:i,vertexCount:r}=this,o=this._collection._positionView;if(!l(n)){let s=o.byteOffset+i*3*o.BYTES_PER_ELEMENT,a=o.constructor;return new a(o.buffer,s,r*3)}for(let s=0;s<r;s++)n[s*3]=o[(i+s)*3],n[s*3+1]=o[(i+s)*3+1],n[s*3+2]=o[(i+s)*3+2];return n}setPositions(n){let i=this._collection,r=this.vertexOffset,o=this.vertexCount,s=n.length/3,a=i._positionCount+s-o;i._positionCount=a,this._setUint32(YC.Layout.POSITION_COUNT_U32,s);let c=i._positionView;for(let u=0;u<s;u++)c[(r+u)*3]=n[u*3],c[(r+u)*3+1]=n[u*3+1],c[(r+u)*3+2]=n[u*3+2];this._dirty=!0,i._makeDirtyBoundingVolume()}toJSON(){return{...super.toJSON(),positions:Array.from(this.getPositions())}}};ut(YC,"Layout",{...ms.Layout,POSITION_OFFSET_U32:ms.Layout.__BYTE_LENGTH,POSITION_COUNT_U32:ms.Layout.__BYTE_LENGTH+4,__BYTE_LENGTH:ms.Layout.__BYTE_LENGTH+8});var V$=YC,Oa=V$;var DD=class DD extends vu{constructor(t=H.EMPTY_OBJECT){super(t),this.width=t.width??1}static pack(t,n,i){super.pack(t,n,i),n.setFloat32(this.Layout.WIDTH_F32+i,t.width,!0)}static unpack(t,n,i){return super.unpack(t,n,i),i.width=t.getFloat32(this.Layout.WIDTH_F32+n,!0),i}toJSON(){return{...super.toJSON(),width:this.width}}};ut(DD,"Layout",{...vu.Layout,WIDTH_F32:vu.Layout.__BYTE_LENGTH,__BYTE_LENGTH:vu.Layout.__BYTE_LENGTH+4}),ut(DD,"DEFAULT_MATERIAL",Object.freeze(new DD));var j$=DD,gd=j$;var i0e=16,jJe=.35,r0e=new Oa,HJe=new gd,o0e=new Lo,GJe=new pd,WJe=new h,qJe=new h,YJe=new he,XJe=new U,KJe=new U,RD=new z,G$=class{static packPolylineCollectionData(t,n,i){if(l(i)&&t._dirtyCount===0&&t._version===i.version)return i;let r=t.primitiveCount,o=t.boundingVolume,s=ie.fromBoundingSphere(o,n),a=d0e(t,n),c=new Float32Array(r),u=new Uint8Array(r*4),f=new Uint8Array(r*4),d=t.widthUnits==="meters";for(let p=0;p<r;p++){let g=t.get(p,r0e),m=g.getMaterial(HJe);c[p]=d?-m.width:m.width,u[p*4]=z.floatToByte(m.color.red),u[p*4+1]=z.floatToByte(m.color.green),u[p*4+2]=z.floatToByte(m.color.blue),u[p*4+3]=z.floatToByte(m.color.alpha),s0e(f,p,g._pickId)}return Object.assign(i??{},{version:t._version,rectangle:s,positions:a,widths:c,widthInMeters:d,colors:u,pickColors:f})}static packPolylineSegments(t,n,i,r){r.polylineSegments??(r.polylineSegments=[]),r.widths??(r.widths=[]),r.colors??(r.colors=[]),r.pickColors??(r.pickColors=[]),r.polylineSegmentPrimitiveIndices??(r.polylineSegmentPrimitiveIndices=[]),r.primitiveCount??(r.primitiveCount=0),r.rectangle??(r.rectangle=ie.clone(i));let o=i.width,s=t.primitiveCount,a=n.positions;for(let c=0;c<s;c++){let u=t.get(c,r0e);if(!u.show)continue;let f=u.vertexCount,d=u.vertexOffset,p=Math.max(P.EPSILON3,a0e(n.widths[c],r));for(let g=0;g+1<f;g++){let m=U.fromArray(a,(d+g)*2,XJe),y=U.fromArray(a,(d+g+1)*2,KJe);$Je(m,y,i,o),JJe(m,y,p)&&(r.polylineSegments.push([m.x,m.y,y.x,y.y]),r.polylineSegmentPrimitiveIndices.push(r.primitiveCount+c))}}r.widths.push(n.widths),r.colors.push(n.colors),r.pickColors.push(n.pickColors),s>0&&(r.hasPixelWidths||(r.hasPixelWidths=!n.widthInMeters),r.hasMeterWidths||(r.hasMeterWidths=n.widthInMeters)),r.primitiveCount+=s}static packPolylineGrid(t){let n=t.polylineSegments,i=t.polylineSegmentPrimitiveIndices,r=Math.max(1,Math.ceil(Math.sqrt(n.length/i0e))),o=new Array(r*r);for(let A=0;A<o.length;A++)o[A]=[];let s=0,a=jJe/r,c=eU(t.widths);for(let A=0;A<n.length;A++){let b=n[A],x=Math.max(a,a0e(c[i[A]],t)),T=Math.max(0,Math.min(b[0],b[2])-x),E=Math.min(1,Math.max(b[0],b[2])+x),v=Math.max(0,Math.min(b[1],b[3])-x),S=Math.min(1,Math.max(b[1],b[3])+x),I=by(Math.floor(T*r),r),R=by(Math.floor(E*r),r),O=by(Math.floor(v*r),r),L=by(Math.floor(S*r),r);for(let _=O;_<=L;_++)for(let C=I;C<=R;C++)o[_*r+C].push(A),s++}let[u,f]=tU(s),d=u*f,p=new Float32Array(d*4).fill(-1),g=new Float32Array(d).fill(-1),m=new Uint32Array(o.length+2);m[0]=r,m[1]=r;let y=0;for(let A=0;A<o.length;A++){let b=o[A];for(let x=0;x<b.length;x++){let T=b[x],E=n[T];p[y*4]=E[0],p[y*4+1]=E[1],p[y*4+2]=E[2],p[y*4+3]=E[3];let v=i[T];g[y]=v,y++}m[A+2]=y}t.polylineSegmentTexels=p,t.polylineSegmentTextureWidth=u,t.polylineSegmentTextureHeight=f,t.polylineSegmentPrimitiveIndicesTexels=g,t.polylineGridCellIndices=m}static packPolygonCollectionData(t,n,i){if(l(i)&&t._dirtyCount===0&&t._version===i.version)return i;let r=t.primitiveCount,o=t.boundingVolume,s=ie.fromBoundingSphere(o,n),a=d0e(t,n),c=new Float32Array(r),u=new Uint8Array(r*4),f=new Uint8Array(r*4);for(let d=0;d<r;d++){let p=t.get(d,o0e),g=p.getMaterial(GJe);u[d*4]=z.floatToByte(g.color.red),u[d*4+1]=z.floatToByte(g.color.green),u[d*4+2]=z.floatToByte(g.color.blue),u[d*4+3]=z.floatToByte(g.color.alpha),s0e(f,d,p._pickId)}return Object.assign(i??{},{version:t._version,rectangle:s,positions:a,widths:c,colors:u,pickColors:f})}static packPolygonRings(t,n,i,r){r.polygonRings??(r.polygonRings=[]),r.polygonRingPrimitiveIndices??(r.polygonRingPrimitiveIndices=[]),r.widths??(r.widths=[]),r.colors??(r.colors=[]),r.pickColors??(r.pickColors=[]),r.primitiveCount??(r.primitiveCount=0),r.rectangle??(r.rectangle=ie.clone(i));let o=i.width,s=t.primitiveCount,a=n.positions;for(let c=0;c<s;c++){let u=t.get(c,o0e);if(!u.show)continue;let f=u.vertexOffset,d=u.vertexCount,p=u.getHoles();for(let g=0;g<=p.length;g++){let m=g===0?0:p[g-1],A=(g===p.length?d:p[g])-m;if(A<3)continue;let b=ZJe(a,f+m,A,i,o),x=u0e(b,A,-P.EPSILON3,1+P.EPSILON3,-P.EPSILON3,1+P.EPSILON3,l0e);x.vertexCount<3||(r.polygonRings.push(x.positions.slice(0,x.vertexCount*2)),r.polygonRingPrimitiveIndices.push(r.primitiveCount+c))}}r.widths.push(n.widths),r.colors.push(n.colors),r.pickColors.push(n.pickColors),r.primitiveCount+=s}static packPolygonGrid(t){let n=t.polygonRings,i=t.polygonRingPrimitiveIndices,r=0;for(let y=0;y<n.length;y++)r+=n[y].length/2;let o=Math.max(1,Math.ceil(Math.sqrt(r/i0e))),s=new Array(o*o);for(let y=0;y<s.length;y++)s[y]=[];let a=0;for(let y=0;y<n.length;y++){let A=n[y],b=i[y],x=A.length/2,T=1/0,E=1/0,v=-1/0,S=-1/0;for(let _=0;_<x;_++)T=Math.min(T,A[_*2]),v=Math.max(v,A[_*2]),E=Math.min(E,A[_*2+1]),S=Math.max(S,A[_*2+1]);let I=by(Math.floor(T*o),o),R=by(Math.floor(v*o),o),O=by(Math.floor(E*o),o),L=by(Math.floor(S*o),o);for(let _=O;_<=L;_++)for(let C=I;C<=R;C++){let w=u0e(A,x,C/o-P.EPSILON5,(C+1)/o+P.EPSILON5,_/o-P.EPSILON5,(_+1)/o+P.EPSILON5,l0e),D=w.vertexCount;if(D<3)continue;let N=w.positions,F=s[_*o+C];for(let V=0;V<D;V++){let B=(V+1)%D,j=N[V*2],k=N[V*2+1],G=N[B*2],q=N[B*2+1];k!==q&&(F.push(j,k,G,q,b),a++)}}}let[c,u]=tU(a),f=c*u,d=new Float32Array(f*4).fill(-1),p=new Float32Array(f).fill(-1),g=new Uint32Array(s.length+2);g[0]=o,g[1]=o;let m=0;for(let y=0;y<s.length;y++){let A=s[y];for(let b=0;b<A.length;b+=5)d[m*4]=A[b],d[m*4+1]=A[b+1],d[m*4+2]=A[b+2],d[m*4+3]=A[b+3],p[m]=A[b+4],m++;g[y+2]=m}t.polygonEdgeTexels=d,t.polygonEdgeTextureWidth=c,t.polygonEdgeTextureHeight=u,t.polygonEdgePrimitiveIndicesTexels=p,t.polygonGridCellIndices=g}static packPrimitiveTextures(t,n){let[i,r]=tU(n.primitiveCount),o=new Float32Array(i*r);o.set(eU(n.widths)),n.widthTexture=new Dt({context:t,pixelFormat:$e.RED,pixelDatatype:ze.FLOAT,source:{width:i,height:r,arrayBufferView:o},sampler:Ht.NEAREST,flipY:!1});let s=new Uint8Array(i*r*4);s.set(eU(n.colors)),n.colorTexture=new Dt({context:t,pixelFormat:$e.RGBA,pixelDatatype:ze.UNSIGNED_BYTE,source:{width:i,height:r,arrayBufferView:s},sampler:Ht.NEAREST,flipY:!1});let a=new Uint8Array(i*r*4);a.set(eU(n.pickColors)),n.pickColorTexture=new Dt({context:t,pixelFormat:$e.RGBA,pixelDatatype:ze.UNSIGNED_BYTE,source:{width:i,height:r,arrayBufferView:a},sampler:Ht.NEAREST,flipY:!1})}static packPolylineTextures(t,n){n.polylineSegmentTexture=new Dt({context:t,pixelFormat:$e.RGBA,pixelDatatype:ze.FLOAT,source:{width:n.polylineSegmentTextureWidth,height:n.polylineSegmentTextureHeight,arrayBufferView:n.polylineSegmentTexels},sampler:Ht.NEAREST,flipY:!1}),n.polylineSegmentPrimitiveIndicesTexture=new Dt({context:t,pixelFormat:$e.RED,pixelDatatype:ze.FLOAT,source:{width:n.polylineSegmentTextureWidth,height:n.polylineSegmentTextureHeight,arrayBufferView:n.polylineSegmentPrimitiveIndicesTexels},sampler:Ht.NEAREST,flipY:!1}),n.polylineGridCellIndicesTexture=f0e(t,n.polylineGridCellIndices)}static packPolygonTextures(t,n){n.polygonEdgeTexture=new Dt({context:t,pixelFormat:$e.RGBA,pixelDatatype:ze.FLOAT,source:{width:n.polygonEdgeTextureWidth,height:n.polygonEdgeTextureHeight,arrayBufferView:n.polygonEdgeTexels},sampler:Ht.NEAREST,flipY:!1}),n.polygonEdgePrimitiveIndicesTexture=new Dt({context:t,pixelFormat:$e.RED,pixelDatatype:ze.FLOAT,source:{width:n.polygonEdgeTextureWidth,height:n.polygonEdgeTextureHeight,arrayBufferView:n.polygonEdgePrimitiveIndicesTexels},sampler:Ht.NEAREST,flipY:!1}),n.polygonGridCellIndicesTexture=f0e(t,n.polygonGridCellIndices)}static freeResources(t){t.polylineSegmentTexture?.destroy(),t.widthTexture?.destroy(),t.colorTexture?.destroy(),t.pickColorTexture?.destroy(),t.polylineSegmentPrimitiveIndicesTexture?.destroy(),t.polylineGridCellIndicesTexture?.destroy(),t.polygonEdgeTexture?.destroy(),t.polygonEdgePrimitiveIndicesTexture?.destroy(),t.polygonGridCellIndicesTexture?.destroy()}};function s0e(e,t,n){z.fromRgba(n,RD),e[t*4]=z.floatToByte(RD.red),e[t*4+1]=z.floatToByte(RD.green),e[t*4+2]=z.floatToByte(RD.blue),e[t*4+3]=z.floatToByte(RD.alpha)}function a0e(e,t){if(e>=0)return(e+1)*.5/t.minimumTileScreenPixels;let n=t.metersPerUv;return-e*.5/Math.min(n.x,n.y)}function $Je(e,t,n,i){let r=e.x,o=t.x;o=r+P.negativePiToPi(o-r);let s=n.west+i*.5,a=s+P.negativePiToPi(r-s)-r;r+=a,o+=a;let c=n.north-n.south;e.x=(r-n.west)/i,e.y=(e.y-n.south)/c,t.x=(o-n.west)/i,t.y=(t.y-n.south)/c}function JJe(e,t,n){let i=-n,r=1+n,o=0,s=1,a=e.x,c=e.y,u=t.x,f=t.y,d=u-a,p=f-c,g=[-d,d,-p,p],m=[a-i,r-a,c-i,r-c];for(let y=0;y<4;y++){if(Math.abs(g[y])<1e-12){if(m[y]<0)return!1;continue}let A=m[y]/g[y];if(g[y]<0?o=Math.max(o,A):s=Math.min(s,A),o>s)return!1}return e.x=a+o*d,e.y=c+o*p,t.x=a+s*d,t.y=c+s*p,!0}function by(e,t){return Math.max(0,Math.min(t-1,e))}var H$=new Float64Array(512),c0e=new Float64Array(512),l0e={positions:new Float64Array(512),vertexCount:0};function ZJe(e,t,n,i,r){H$.length<n*2&&(H$=new Float64Array(n*4));let o=H$,s=i.north-i.south,a=e[t*2];o[0]=a,o[1]=e[t*2+1];for(let d=1;d<n;d++){let p=a+P.negativePiToPi(e[(t+d)*2]-a);o[d*2]=p,o[d*2+1]=e[(t+d)*2+1],a=p}let c=i.west+r*.5,u=o[0],f=c+P.negativePiToPi(u-c)-u;for(let d=0;d<n;d++)o[d*2]=(o[d*2]+f-i.west)/r,o[d*2+1]=(o[d*2+1]-i.south)/s;return o}function u0e(e,t,n,i,r,o,s){let a=e,c=t;for(let u=0;u<4;u++){let f=u>>1,d=(u&1)===0?1:-1,p=u===0?n:u===1?i:u===2?r:o,g=c*4+4,m=(u&1)===0,y=m?c0e:s.positions;y.length<g&&(y=new Float64Array(g*2),m?c0e=y:s.positions=y);let A=0,b=a[(c-1)*2],x=a[(c-1)*2+1],T=d*((f===0?b:x)-p)>=0;for(let E=0;E<c;E++){let v=a[E*2],S=a[E*2+1],I=d*((f===0?v:S)-p)>=0;if(I!==T){let R=f===0?(p-b)/(v-b):(p-x)/(S-x);y[A*2]=f===0?p:b+R*(v-b),y[A*2+1]=f===0?x+R*(S-x):p,A++}I&&(y[A*2]=v,y[A*2+1]=S,A++),b=v,x=S,T=I}if(A===0)return s.vertexCount=0,s;a=y,c=A}return s.vertexCount=c,s}function tU(e){let t=P.nextPowerOfTwo(Math.max(1,Math.ceil(Math.sqrt(e)))),n=P.nextPowerOfTwo(Math.max(1,Math.ceil(e/t)));return[t,n]}function f0e(e,t){let[n,i]=tU(t.length),r=new Float32Array(n*i);return r.set(t),new Dt({context:e,pixelFormat:$e.RED,pixelDatatype:ze.FLOAT,source:{width:n,height:i,arrayBufferView:r},sampler:Ht.NEAREST,flipY:!1})}function d0e(e,t,n){l(n)||(n=new Float64Array(e._positionCountMax*2));let i=e._positionView,r=e.modelMatrix;for(let o=0;o<e._positionCount;o++){let s=h.fromArray(i,o*3,WJe),a=M.multiplyByPoint(r,s,qJe),c=t.cartesianToCartographic(a,YJe);n[o*2]=c.longitude,n[o*2+1]=c.latitude}return n}function eU(e){let t=0;for(let o of e)t+=o.byteLength;let n=e[0].constructor,i=new n(t/n.BYTES_PER_ELEMENT),r=0;for(let o of e)i.set(o,r),r+=o.length;return i}var Ds=G$;var Y$=new Lo,W$="ClippingPolygonCollection.quality is deprecated as of CesiumJS 1.145 and will be removed in 1.147. Signed distance field clipping was replaced with vector clipping, so this property no longer has any effect.",q$="ClippingPolygonCollection.debugShowDistanceTexture is deprecated as of CesiumJS 1.145 and will be removed in 1.147. Signed distance field clipping was replaced with vector clipping, so this property no longer has any effect.",QJe="ClippingPolygonCollection.isDestroyed is deprecated as of CesiumJS 1.145 and will be removed in 1.147. The collection no longer holds any GPU resources of its own, so it does not need to be destroyed.",eZe="ClippingPolygonCollection.destroy is deprecated as of CesiumJS 1.145 and will be removed in 1.147. The collection no longer holds any GPU resources of its own, so it does not need to be destroyed.";function Jc(e){e=e??H.EMPTY_OBJECT,this._polygons=[];let t=e.polygons??[],n=0,i=0;for(let r=0;r<t.length;++r)n+=t[r].length,i+=t[r].holes.length;this._dirty=!1,this._bufferPolygonCollection=new Za({show:!1,allowPicking:!1,primitiveCountMax:2*t.length,vertexCountMax:2*n,holeCountMax:i>0?2*i:0,triangleCountMax:0});for(let r=0;r<t.length;++r){let o=this._bufferPolygonCollection.primitiveCount;this._bufferPolygonCollection.add(m0e(t[r]),Y$),this._polygons.push({clippingPolygon:t[r],bufferIndex:o})}l(e.debugShowDistanceTexture)&&Yr("ClippingPolygonCollection.debugShowDistanceTexture",q$),this._debugShowDistanceTexture=e.debugShowDistanceTexture??!1,this.enabled=e.enabled??!0,this.inverse=e.inverse??!1,l(e.quality)&&Yr("ClippingPolygonCollection.quality",W$),this._quality=e.quality??1,this.polygonAdded=new be,this.polygonRemoved=new be,this.ellipsoid=e.ellipsoid??ee.default,this._owner=void 0,this._vectorCollectionData=Ds.packPolygonCollectionData(this._bufferPolygonCollection,this.ellipsoid)}Object.defineProperties(Jc.prototype,{length:{get:function(){return this._polygons.length}},debugShowDistanceTexture:{get:function(){return Yr("ClippingPolygonCollection.debugShowDistanceTexture",q$),this._debugShowDistanceTexture},set:function(e){Yr("ClippingPolygonCollection.debugShowDistanceTexture",q$),this._debugShowDistanceTexture=e}},quality:{get:function(){return Yr("ClippingPolygonCollection.quality",W$),this._quality},set:function(e){Yr("ClippingPolygonCollection.quality",W$),this._quality=e}},owner:{get:function(){return this._owner}},clippingPolygonsState:{get:function(){return!this.enabled||this.length===0?0:this.inverse?-1:1}}});function m0e(e){let t=e.positions,n=e.holes,i=new Float64Array(e.length*3),r=0;for(let s=0;s<t.length;s++)h.pack(t[s],i,r*3),r++;if(n.length===0)return{positions:i,holes:void 0};let o=new Uint32Array(n.length);for(let s=0;s<n.length;s++){let a=n[s];o[s]=r;for(let c=0;c<a.length;c++)h.pack(a[c],i,r*3),r++}return{positions:i,holes:o}}function tZe(e,t,n){let i=e._bufferPolygonCollection,r=i.primitiveCount+1,o=i.vertexCount+t,s=i.holeCount+n;if(r<=i.primitiveCountMax&&o<=i.vertexCountMax&&s<=i.holeCountMax)return i;let a=e._polygons.length!==i.primitiveCount,c=Za.fromCollection(i,{primitiveCountMax:P.nextPowerOfTwo(r),vertexCountMax:P.nextPowerOfTwo(o),holeCountMax:P.nextPowerOfTwo(s)},a?u=>u.show:void 0);if(i.destroy(),e._bufferPolygonCollection=c,a){let u=e._polygons;for(let f=0;f<u.length;++f)u[f].bufferIndex=f}return c}function p0e(e,t){e._bufferPolygonCollection.get(t.bufferIndex,Y$).show=!1,t.bufferIndex=-1}Jc.prototype.add=function(e){let t=this._polygons.length,n=tZe(this,e.length,e.holes.length);return this._polygons.push({clippingPolygon:e,bufferIndex:n.primitiveCount}),n.add(m0e(e),Y$),this._dirty=!0,this.polygonAdded.raiseEvent(e,t),e};Jc.prototype.get=function(e){return this._polygons[e]?.clippingPolygon};Jc.prototype.contains=function(e){return this._polygons.some(t=>SD.equals(t.clippingPolygon,e))};Jc.prototype.remove=function(e){let t=this._polygons,n=t.findIndex(r=>SD.equals(r.clippingPolygon,e));if(n===-1)return!1;let[i]=t.splice(n,1);return p0e(this,i),this._dirty=!0,this.polygonRemoved.raiseEvent(i.clippingPolygon,n),!0};Jc.prototype.removeAll=function(){let e=this._polygons,t=e.length;for(let n=0;n<t;++n){let i=e[n];p0e(this,i),this.polygonRemoved.raiseEvent(i.clippingPolygon,n)}this._dirty=!0,this._polygons=[]};Jc.prototype.update=function(e){if(!Jc.isSupported(e))throw new oe("ClippingPolygonCollections are only supported for WebGL 2.");this._dirty&&(this._dirty=!1,this.length!==0&&(this._vectorCollectionData=Ds.packPolygonCollectionData(this._bufferPolygonCollection,this.ellipsoid)))};var h0e=new ie,nZe=new ie;Jc.prototype.computeIntersectionWithBoundingVolume=function(e,t){let n=this._polygons,i=n.length,r=$t.OUTSIDE;this.inverse&&(r=$t.INSIDE);let o=e.rectangle;if(!l(o)&&l(e.boundingVolume?.computeCorners)){let s=e.boundingVolume.computeCorners();o=ie.fromCartesianArray(s,t,h0e)}l(o)||(o=ie.fromBoundingSphere(e.boundingSphere,t,h0e));for(let s=0;s<i;++s){let a=n[s].clippingPolygon,c=ie.intersection(o,a.rectangle,nZe);if(l(c))return $t.INTERSECTING}return r};Jc.setOwner=function(e,t,n){e!==t[n]&&(t[n]=void 0,l(e)&&(e._owner=t,t[n]=e))};Jc.prototype.requestRectangleData=function(e,t){let n={rectangle:ie.clone(e),polygonRings:[]};return this.length===0||(Ds.packPolygonRings(this._bufferPolygonCollection,this._vectorCollectionData,e,n),n.polygonRings.length===0)||(Ds.packPolygonGrid(n),Ds.packPolygonTextures(t,n)),n};Jc.releaseRectangleData=function(e){Ds.freeResources(e)};Jc.isSupported=function(e){return e?.context.webgl2};Jc.prototype.isDestroyed=function(){return Yr("ClippingPolygonCollection.isDestroyed",QJe),!1};Jc.prototype.destroy=function(){return Yr("ClippingPolygonCollection.destroy",eZe),le(this)};var Zc=Jc;var XC={NONE:0,SCENE_LIGHT:1,SUNLIGHT:2};XC.fromGlobeFlags=function(e){return e.enableLighting&&e.dynamicAtmosphereLighting?e.dynamicAtmosphereLightingFromSun?XC.SUNLIGHT:XC.SCENE_LIGHT:XC.NONE};Object.freeze(XC);var xy=XC;function g0e(){this.lightIntensity=10,this.rayleighCoefficient=new h(55e-7,13e-6,284e-7),this.mieCoefficient=new h(21e-6,21e-6,21e-6),this.rayleighScaleHeight=1e4,this.mieScaleHeight=3200,this.mieAnisotropy=.9,this.hueShift=0,this.saturationShift=0,this.brightnessShift=0,this.dynamicLighting=xy.NONE}g0e.requiresColorCorrect=function(e){return!(P.equalsEpsilon(e.hueShift,0,P.EPSILON7)&&P.equalsEpsilon(e.saturationShift,0,P.EPSILON7)&&P.equalsEpsilon(e.brightnessShift,0,P.EPSILON7))};var KC=g0e;function Ei(e){this._position=void 0,this._radianceMapDirty=!1,this._radianceCommandsDirty=!1,this._convolutionsCommandsDirty=!1,this._irradianceCommandDirty=!1,this._irradianceTextureDirty=!1,this._sphericalHarmonicCoefficientsDirty=!1,this._shouldRegenerateShaders=!1,this._shouldReset=!1,e=e??H.EMPTY_OBJECT;let t=Math.max(Math.floor(Math.min(e.mipmapLevels??7,Math.log2(Ut.maximumCubeMapSize))),0);this._mipmapLevels=t;let n=Math.max(t-1,0)*6;this._radianceMapComputeCommands=new Array(6),this._convolutionComputeCommands=new Array(n),this._irradianceComputeCommand=void 0,this._radianceMapFS=void 0,this._irradianceMapFS=void 0,this._convolveSP=void 0,this._va=void 0,this._radianceMapTextures=new Array(6),this._specularMapTextures=new Array(n),this._radianceCubeMap=void 0,this._irradianceMapTexture=void 0,this._sphericalHarmonicCoefficients=Ei.DEFAULT_SPHERICAL_HARMONIC_COEFFICIENTS.slice(),this._lastTime=new K;let i=Math.max(Math.pow(2,t-1),1);this._textureDimensions=new U(i,i),this._radiiAndDynamicAtmosphereColor=new h,this._sceneEnvironmentMap=void 0,this._backgroundColor=void 0,this._owner=void 0,this.enabled=e.enabled??!0,this.shouldUpdate=!0,this.maximumSecondsDifference=e.maximumSecondsDifference??3600,this.maximumPositionEpsilon=e.maximumPositionEpsilon??1e3,this.atmosphereScatteringIntensity=e.atmosphereScatteringIntensity??2,this.gamma=e.gamma??1,this.brightness=e.brightness??1,this.saturation=e.saturation??1,this.groundColor=e.groundColor??Ei.AVERAGE_EARTH_GROUND_COLOR,this.groundAlbedo=e.groundAlbedo??.31}Object.defineProperties(Ei.prototype,{owner:{get:function(){return this._owner}},shouldRegenerateShaders:{get:function(){return this._shouldRegenerateShaders}},position:{get:function(){return this._position},set:function(e){h.equalsEpsilon(e,this._position,0,this.maximumPositionEpsilon)||(this._position=h.clone(e,this._position),this._shouldReset=!0)}},radianceCubeMap:{get:function(){return this._radianceCubeMap}},maximumMipmapLevel:{get:function(){return this._mipmapLevels}},sphericalHarmonicCoefficients:{get:function(){return this._sphericalHarmonicCoefficients}}});Ei._maximumComputeCommandCount=8;Ei._activeComputeCommandCount=0;Ei._nextFrameCommandQueue=[];Ei._queueCommand=(e,t)=>{if(Ei._activeComputeCommandCount>=Ei._maximumComputeCommandCount){Ei._nextFrameCommandQueue.push(e);return}t.commandList.push(e),Ei._activeComputeCommandCount++};Ei._updateCommandQueue=e=>{if(Ei._maximumComputeCommandCount=Math.log2(Ut.maximumCubeMapSize),Ei._nextFrameCommandQueue.length>0&&Ei._activeComputeCommandCount<Ei._maximumComputeCommandCount){let t=Ei._nextFrameCommandQueue.shift();for(;l(t)&&Ei._activeComputeCommandCount<Ei._maximumComputeCommandCount;){if(t.owner.isDestroyed()||t.canceled){t=Ei._nextFrameCommandQueue.shift();continue}e.commandList.push(t),Ei._activeComputeCommandCount++,t=Ei._nextFrameCommandQueue.shift()}l(t)&&Ei._nextFrameCommandQueue.push(t)}};Ei.setOwner=function(e,t,n){e!==t[n]&&(t[n]=t[n]&&t[n].destroy(),l(e)&&(e._owner=t,t[n]=e))};Ei.prototype.reset=function(){let e=this._radianceMapComputeCommands.length;for(let t=0;t<e;++t)l(this._radianceMapComputeCommands[t])&&(this._radianceMapComputeCommands[t].canceled=!0),this._radianceMapComputeCommands[t]=void 0;e=this._convolutionComputeCommands.length;for(let t=0;t<e;++t)l(this._convolutionComputeCommands[t])&&(this._convolutionComputeCommands[t].canceled=!0),this._convolutionComputeCommands[t]=void 0;l(this._irradianceComputeCommand)&&(this._irradianceComputeCommand.canceled=!0,this._irradianceComputeCommand=void 0),this._radianceMapDirty=!0,this._radianceCommandsDirty=!0,this._convolutionsCommandsDirty=!1,this._irradianceCommandDirty=!1};var iZe=new h,rZe=new h;function oZe(e,t){let n=e._position,i=t.atmosphere,r=t.mapProjection.ellipsoid,o=r.scaleToGeodeticSurface(n,rZe),s=1.025,a=iZe,c=l(o)?h.magnitude(o):r.maximumRadius;return a.x=c*s,a.y=c,a.z=i.dynamicLighting,!h.equalsEpsilon(e._radiiAndDynamicAtmosphereColor,a)||t.environmentMap!==e._sceneEnvironmentMap||t.backgroundColor!==e._backgroundColor?(h.clone(a,e._radiiAndDynamicAtmosphereColor),e._sceneEnvironmentMap=t.environmentMap,e._backgroundColor=t.backgroundColor,!0):!1}var _0e=new h,sZe=new M,aZe=new se,cZe=new z;function lZe(e,t){let n=t.context,i=e._textureDimensions;if(l(e._radianceCubeMap)||(e._radianceCubeMap=new ls({context:n,width:i.x,height:i.y,pixelDatatype:ze.UNSIGNED_BYTE,pixelFormat:$e.RGBA})),e._radianceCommandsDirty){let r=e._radianceMapFS;l(r)||(r=new Xe({sources:[Xm,P2]}),e._radianceMapFS=r),KC.requiresColorCorrect(t.atmosphere)&&r.defines.push("ATMOSPHERE_COLOR_CORRECT");let o=e._position,s=e._radiiAndDynamicAtmosphereColor,a=t.mapProjection.ellipsoid,c=At.eastNorthUpToFixedFrame(o,a,sZe),u=aZe;u.x=e.brightness,u.y=e.saturation,u.z=e.gamma,u.w=e.atmosphereScatteringIntensity,(e.brightness!==1||e.saturation!==1||e.gamma!==1)&&r.defines.push("ENVIRONMENT_COLOR_CORRECT");let f=0;for(let d of ls.faceNames()){let p=e._radianceMapTextures[f];l(p)&&!p.isDestroyed()&&p.destroy(),p=new Dt({context:n,width:i.x,height:i.y,pixelDatatype:ze.UNSIGNED_BYTE,pixelFormat:$e.RGBA}),e._radianceMapTextures[f]=p;let g=f,m=new Jf({fragmentShaderSource:r,outputTexture:p,uniformMap:{u_radiiAndDynamicAtmosphereColor:()=>s,u_enuToFixedFrame:()=>c,u_faceDirection:()=>ls.getDirection(d,_0e),u_positionWC:()=>o,u_brightnessSaturationGammaIntensity:()=>u,u_groundColor:()=>e.groundColor.withAlpha(e.groundAlbedo,cZe)},owner:e});m.postExecute=()=>{if(e.isDestroyed()||m.canceled){Ei._activeComputeCommandCount--;return}let y=e._radianceMapComputeCommands;y[g]=void 0;let A=new vs({context:n,colorTextures:[e._radianceMapTextures[g]]});A._bind(),e._radianceCubeMap[d].copyFromFramebuffer(),A._unBind(),A.destroy(),Ei._activeComputeCommandCount--,y.some(l)||(e._convolutionsCommandsDirty=!0,e._shouldRegenerateShaders=!0)},e._radianceMapComputeCommands[f]=m,Ei._queueCommand(m,t),f++}e._radianceCommandsDirty=!1}}function uZe(e,t){let n=e._radianceCubeMap;n.generateMipmap();let i=e._mipmapLevels,r=e._textureDimensions,o=r.x/2,s=r.y/2,a=t.context,c=0,u=()=>{let p=e._specularMapTextures.length;c>=p&&(e._irradianceCommandDirty=!0,i>1&&(n.sampler=new Ht({minificationFilter:Wt.LINEAR_MIPMAP_LINEAR}),e._shouldRegenerateShaders=!0,e._va.destroy(),e._va=void 0,e._convolveSP.destroy(),e._convolveSP=void 0))},f=(p,g,m,y,A)=>()=>{if(e.isDestroyed()||p.canceled){Ei._activeComputeCommandCount--;return}let b=e._convolutionComputeCommands;b[g]=void 0,n.copyFace(t,m,y,A),c++,Ei._activeComputeCommandCount--,m.destroy(),e._specularMapTextures[g]=void 0,u()},d=0;for(let p=1;p<i;++p){for(let g of ls.faceNames()){l(e._specularMapTextures[d])&&e._specularMapTextures[d].destroy();let m=e._specularMapTextures[d]=new Dt({context:a,width:o,height:s,pixelDatatype:ze.UNSIGNED_BYTE,pixelFormat:$e.RGBA}),y=e._va;l(y)||(y=ls.createVertexArray(a,g),e._va=y);let A=e._convolveSP;l(A)||(A=Qt.fromCache({context:a,vertexShaderSource:R2,fragmentShaderSource:D2,attributeLocations:{positions:0}}),e._convolveSP=A);let b=new Jf({shaderProgram:A,vertexArray:y,outputTexture:m,persists:!0,owner:e,uniformMap:{u_roughness:()=>p/(i-1),u_radianceTexture:()=>n??a.defaultTexture,u_faceDirection:()=>ls.getDirection(g,_0e)}});b.postExecute=f(b,d,m,g,p),e._convolutionComputeCommands[d]=b,Ei._queueCommand(b,t),++d}o/=2,s/=2}u()}var y0e=new U(3,3);function fZe(e,t){let n=t.context,i=y0e,r=e._irradianceMapTexture;l(r)&&!r.isDestroyed()&&r.destroy(),r=new Dt({context:n,width:i.x,height:i.y,pixelDatatype:ze.FLOAT,pixelFormat:$e.RGBA}),e._irradianceMapTexture=r;let o=e._irradianceMapFS;l(o)||(o=new Xe({sources:[I2]}),e._irradianceMapFS=o);let s=new Jf({fragmentShaderSource:o,outputTexture:r,owner:e,uniformMap:{u_radianceMap:()=>e._radianceCubeMap??n.defaultTexture}});s.postExecute=()=>{if(e.isDestroyed()||s.canceled){Ei._activeComputeCommandCount--;return}e._irradianceTextureDirty=!1,e._irradianceComputeCommand=void 0,e._sphericalHarmonicCoefficientsDirty=!0,e._irradianceMapFS=void 0,Ei._activeComputeCommandCount--},e._irradianceComputeCommand=s,Ei._queueCommand(s,t),e._irradianceTextureDirty=!0}function dZe(e,t){let n=t.context;if(!l(e._irradianceMapTexture))return;let i=new vs({context:n,colorTextures:[e._irradianceMapTexture],destroyAttachments:!1}),r=y0e,o=n.readPixels({x:0,y:0,width:r.x,height:r.y,framebuffer:i});for(let s=0;s<9;++s)e._sphericalHarmonicCoefficients[s]=h.unpack(o,s*4),h.multiplyByScalar(e._sphericalHarmonicCoefficients[s],e.atmosphereScatteringIntensity,e._sphericalHarmonicCoefficients[s]);i.destroy(),e._irradianceMapTexture.destroy(),e._irradianceMapTexture=void 0,e._shouldRegenerateShaders=!0}Ei.prototype.update=function(e){let t=e.mode;if(!(Ei.isDynamicUpdateSupported(e)&&this._mipmapLevels>=1)||!this.enabled||!this.shouldUpdate||!l(this._position)||t===re.MORPHING){this._shouldRegenerateShaders=!1;return}Ei._updateCommandQueue(e);let i=e.atmosphere.dynamicLighting,r=oZe(this,e)||i===xy.SUNLIGHT&&!K.equalsEpsilon(e.time,this._lastTime,this.maximumSecondsDifference);if(this._shouldReset||r){this.reset(),this._shouldReset=!1,this._lastTime=K.clone(e.time,this._lastTime);return}if(this._radianceMapDirty&&(lZe(this,e),this._radianceMapDirty=!1),this._convolutionsCommandsDirty&&(uZe(this,e),this._convolutionsCommandsDirty=!1),this._irradianceCommandDirty&&(fZe(this,e),this._irradianceCommandDirty=!1),this._irradianceTextureDirty){this._shouldRegenerateShaders=!1;return}if(this._sphericalHarmonicCoefficientsDirty){dZe(this,e),this._sphericalHarmonicCoefficientsDirty=!1;return}this._shouldRegenerateShaders=!1};Ei.prototype.isDestroyed=function(){return!1};Ei.prototype.destroy=function(){let e=this._radianceMapComputeCommands.length;for(let t=0;t<e;++t)this._radianceMapComputeCommands[t]=void 0;e=this._convolutionComputeCommands.length;for(let t=0;t<e;++t)this._convolutionComputeCommands[t]=void 0;this._irradianceMapComputeCommand=void 0,e=this._radianceMapTextures.length;for(let t=0;t<e;++t)this._radianceMapTextures[t]=this._radianceMapTextures[t]&&!this._radianceMapTextures[t].isDestroyed()&&this._radianceMapTextures[t].destroy();e=this._specularMapTextures.length;for(let t=0;t<e;++t)this._specularMapTextures[t]=this._specularMapTextures[t]&&!this._specularMapTextures[t].isDestroyed()&&this._specularMapTextures[t].destroy();return this._radianceCubeMap=this._radianceCubeMap&&this._radianceCubeMap.destroy(),this._irradianceMapTexture=this._irradianceMapTexture&&!this._irradianceMapTexture.isDestroyed()&&this._irradianceMapTexture.destroy(),l(this._va)&&this._va.destroy(),l(this._convolveSP)&&this._convolveSP.destroy(),le(this)};Ei.isDynamicUpdateSupported=function(e){let t=e.context;return t.halfFloatingPointTexture||t.colorBufferFloat};Ei.AVERAGE_EARTH_GROUND_COLOR=Object.freeze(z.fromCssColorString("#717145"));Ei.DEFAULT_SPHERICAL_HARMONIC_COEFFICIENTS=Object.freeze([Object.freeze(new h(.35449,.35449,.35449)),h.ZERO,h.ZERO,h.ZERO,h.ZERO,h.ZERO,h.ZERO,h.ZERO,h.ZERO]);var Ty=Ei;var $C={HIGHLIGHT:0,REPLACE:1,MIX:2};$C.getColorBlend=function(e,t){if(e===$C.HIGHLIGHT)return 0;if(e===$C.REPLACE)return 1;if(e===$C.MIX)return P.clamp(t,P.EPSILON4,1)};Object.freeze($C);var Nl=$C;var A0e={SURFACES_ONLY:0,SURFACES_AND_EDGES:1,EDGES_ONLY:2};Object.freeze(A0e);var Rh=A0e;var b0e={XTRANSLATE:"xTranslate",YTRANSLATE:"yTranslate",ZTRANSLATE:"zTranslate",XROTATE:"xRotate",YROTATE:"yRotate",ZROTATE:"zRotate",XSCALE:"xScale",YSCALE:"yScale",ZSCALE:"zScale",UNIFORMSCALE:"uniformScale"};Object.freeze(b0e);var Ll=b0e;var x0e={STEP:0,LINEAR:1,CUBICSPLINE:2};Object.freeze(x0e);var mp=x0e;var T0e={};function OD(e){this._count=e.count,this._properties=Ze(e.properties,!0)}OD.prototype.hasProperty=function(e){return Xn.hasProperty(e,this._properties,T0e)};OD.prototype.getPropertyIds=function(e){return Xn.getPropertyIds(this._properties,T0e,e)};OD.prototype.getProperty=function(e,t){let n=this._properties[t];if(l(n))return Ze(n[e],!0)};OD.prototype.setProperty=function(e,t,n){let i=this._properties[t];l(i)||(i=new Array(this._count),this._properties[t]=i),i[e]=Ze(n,!0)};var Ey=OD;function bc(e){e=e??H.EMPTY_OBJECT,this._name=e.name,this._id=e.id,this._count=e.count,this._extras=e.extras,this._extensions=e.extensions,this._metadataTable=e.metadataTable,this._jsonMetadataTable=e.jsonMetadataTable,this._batchTableHierarchy=e.batchTableHierarchy,this._texture=e.texture}Object.defineProperties(bc.prototype,{name:{get:function(){return this._name}},id:{get:function(){return this._id}},count:{get:function(){return this._count}},class:{get:function(){if(l(this._metadataTable))return this._metadataTable.class}},properties:{get:function(){if(l(this._metadataTable))return this._metadataTable.properties}},extras:{get:function(){return this._extras}},extensions:{get:function(){return this._extensions}},byteLength:{get:function(){let e=0;return l(this._metadataTable)&&(e+=this._metadataTable.byteLength),l(this._batchTableHierarchy)&&(e+=this._batchTableHierarchy.byteLength),e}},texture:{get:function(){return this._texture}}});bc.prototype.hasProperty=function(e,t){return!!(l(this._metadataTable)&&this._metadataTable.hasProperty(t)||l(this._batchTableHierarchy)&&this._batchTableHierarchy.hasProperty(e,t)||l(this._jsonMetadataTable)&&this._jsonMetadataTable.hasProperty(t))};bc.prototype.hasPropertyBySemantic=function(e,t){return l(this._metadataTable)?this._metadataTable.hasPropertyBySemantic(t):!1};bc.prototype.propertyExists=function(e){return!!(l(this._metadataTable)&&this._metadataTable.hasProperty(e)||l(this._batchTableHierarchy)&&this._batchTableHierarchy.propertyExists(e)||l(this._jsonMetadataTable)&&this._jsonMetadataTable.hasProperty(e))};bc.prototype.propertyExistsBySemantic=function(e){return l(this._metadataTable)?this._metadataTable.hasPropertyBySemantic(e):!1};var X$=[];bc.prototype.getPropertyIds=function(e,t){if(t=l(t)?t:[],t.length=0,l(this._metadataTable)){let n=this._metadataTable.getPropertyIds(X$);Zn(t,n)}if(l(this._batchTableHierarchy)){let n=this._batchTableHierarchy.getPropertyIds(e,X$);Zn(t,n)}if(l(this._jsonMetadataTable)){let n=this._jsonMetadataTable.getPropertyIds(X$);Zn(t,n)}return t};bc.prototype.getProperty=function(e,t){let n;if(l(this._metadataTable)&&(n=this._metadataTable.getProperty(e,t),l(n))||l(this._batchTableHierarchy)&&(n=this._batchTableHierarchy.getProperty(e,t),l(n))||l(this._jsonMetadataTable)&&(n=this._jsonMetadataTable.getProperty(e,t),l(n)))return n};bc.prototype.setProperty=function(e,t,n){l(this._metadataTable)&&this._metadataTable.setProperty(e,t,n)||l(this._batchTableHierarchy)&&this._batchTableHierarchy.setProperty(e,t,n)||(l(this._jsonMetadataTable)||(this._jsonMetadataTable=new Ey({count:this._count,properties:{}})),this._jsonMetadataTable.setProperty(e,t,n))};bc.prototype.getPropertyBySemantic=function(e,t){if(l(this._metadataTable))return this._metadataTable.getPropertyBySemantic(e,t)};bc.prototype.setPropertyBySemantic=function(e,t,n){return l(this._metadataTable)?this._metadataTable.setPropertyBySemantic(e,t,n):!1};bc.prototype.getPropertyTypedArray=function(e){if(l(this._metadataTable))return this._metadataTable.getPropertyTypedArray(e)};bc.prototype.getPropertyTypedArrayBySemantic=function(e){if(l(this._metadataTable))return this._metadataTable.getPropertyTypedArrayBySemantic(e)};bc.prototype.isClass=function(e,t){let n=this._batchTableHierarchy;return l(n)?n.isClass(e,t):!1};bc.prototype.isExactClass=function(e,t){return this.getExactClassName(e)===t};bc.prototype.getExactClassName=function(e){let t=this._batchTableHierarchy;if(l(t))return t.getClassName(e)};bc.prototype.destroy=function(){return this._texture=this._texture&&this._texture.destroy(),le(this)};var Su=bc;function E0e(e){e=e??H.EMPTY_OBJECT;let t=e.property,n=e.classProperty,i=e.textures,r=l(t.channels)?t.channels:[0],o=t,s=pf.createModelTextureReader({textureInfo:o,channels:hZe(r),texture:i[o.index]});this._min=t.min,this._max=t.max;let a=t.offset,c=t.scale,u=n.hasValueTransform||l(a)||l(c);a=a??n.offset,c=c??n.scale,a=n.unpackVectorAndMatrixTypes(a),c=n.unpackVectorAndMatrixTypes(c),this._offset=a,this._scale=c,this._hasValueTransform=u,this._textureReader=s,this._classProperty=n,this._extras=t.extras,this._extensions=t.extensions}Object.defineProperties(E0e.prototype,{textureReader:{get:function(){return this._textureReader}},hasValueTransform:{get:function(){return this._hasValueTransform}},offset:{get:function(){return this._offset}},scale:{get:function(){return this._scale}},classProperty:{get:function(){return this._classProperty}},extras:{get:function(){return this._extras}},extensions:{get:function(){return this._extensions}}});function hZe(e){return e.map(function(t){return"rgba".charAt(t)}).join("")}var nU=E0e;function K$(e){e=e??H.EMPTY_OBJECT;let t=e.propertyTexture,n=e.class,i=e.textures,r=t.extensions,o=t.extras,s={};if(l(t.properties))for(let a in t.properties)t.properties.hasOwnProperty(a)&&(s[a]=new nU({property:t.properties[a],classProperty:n.properties[a],textures:i}));this._name=e.name,this._id=e.id,this._class=n,this._properties=s,this._extras=o,this._extensions=r}Object.defineProperties(K$.prototype,{name:{get:function(){return this._name}},id:{get:function(){return this._id}},class:{get:function(){return this._class}},properties:{get:function(){return this._properties}},extras:{get:function(){return this._extras}},extensions:{get:function(){return this._extensions}}});K$.prototype.getProperty=function(e){return this._properties[e]};var Cy=K$;function C0e(e){e=e??H.EMPTY_OBJECT;let t=e.property,n=e.classProperty;this._attribute=t.attribute,this._classProperty=n,this._min=t.min,this._max=t.max;let i=t.offset,r=t.scale,o=n.hasValueTransform||l(i)||l(r);i=i??n.offset,r=r??n.scale,i=n.unpackVectorAndMatrixTypes(i),r=n.unpackVectorAndMatrixTypes(r),this._offset=i,this._scale=r,this._hasValueTransform=o,this._extras=t.extras,this._extensions=t.extensions}Object.defineProperties(C0e.prototype,{attribute:{get:function(){return this._attribute}},hasValueTransform:{get:function(){return this._hasValueTransform}},offset:{get:function(){return this._offset}},scale:{get:function(){return this._scale}},classProperty:{get:function(){return this._classProperty}},extras:{get:function(){return this._extras}},extensions:{get:function(){return this._extensions}}});var iU=C0e;function $$(e){e=e??H.EMPTY_OBJECT;let t=e.propertyAttribute,n=e.class,i={};if(l(t.properties))for(let r in t.properties)t.properties.hasOwnProperty(r)&&(i[r]=new iU({property:t.properties[r],classProperty:n.properties[r]}));this._name=e.name,this._id=e.id,this._class=n,this._properties=i,this._extras=t.extras,this._extensions=t.extensions}Object.defineProperties($$.prototype,{name:{get:function(){return this._name}},id:{get:function(){return this._id}},class:{get:function(){return this._class}},properties:{get:function(){return this._properties}},extras:{get:function(){return this._extras}},extensions:{get:function(){return this._extensions}}});$$.prototype.getProperty=function(e){return this._properties[e]};var JC=$$;function ZC(e){e=e??H.EMPTY_OBJECT,this._schema=e.schema;let t=e.propertyTables;this._propertyTableCount=l(t)?t.length:0,this._propertyTables=t??[],this._propertyTextures=e.propertyTextures??[],this._propertyAttributes=e.propertyAttributes??[],this._statistics=e.statistics,this._extras=e.extras,this._extensions=e.extensions}Object.defineProperties(ZC.prototype,{schema:{get:function(){return this._schema}},statistics:{get:function(){return this._statistics}},extras:{get:function(){return this._extras}},extensions:{get:function(){return this._extensions}},propertyTableCount:{get:function(){return this._propertyTableCount}},propertyTables:{get:function(){return this._propertyTables}},propertyTextures:{get:function(){return this._propertyTextures}},propertyAttributes:{get:function(){return this._propertyAttributes}},propertyTablesByteLength:{get:function(){if(!l(this._propertyTables))return 0;let e=0,t=this._propertyTables.length;for(let n=0;n<t;n++)e+=this._propertyTables[n].byteLength;return e}}});ZC.prototype.getPropertyTable=function(e){return this._propertyTables[e]};ZC.prototype.getPropertyTexture=function(e){return this._propertyTextures[e]};ZC.prototype.getPropertyAttribute=function(e){return this._propertyAttributes[e]};ZC.prototype.destroy=function(){let e=this._propertyTables;for(let t=0;t<e.length;t++)e[t]=e[t]&&e[t].destroy();return le(this)};var Qa=ZC;function mZe(e){e=e??H.EMPTY_OBJECT;let t=e.extension,n=e.schema,i=[];if(l(t.propertyTables))for(let s=0;s<t.propertyTables.length;s++){let a=t.propertyTables[s],c=n.classes[a.class],u=pZe(a,e.bufferViews,c,e.context),f=new wh({count:a.count,properties:a.properties,class:c,bufferViews:e.bufferViews});i.push(new Su({id:s,name:a.name,count:a.count,metadataTable:f,extras:a.extras,extensions:a.extensions,texture:u}))}let r=[];if(l(t.propertyTextures))for(let s=0;s<t.propertyTextures.length;s++){let a=t.propertyTextures[s];r.push(new Cy({id:s,name:a.name,propertyTexture:a,class:n.classes[a.class],textures:e.textures}))}let o=[];if(l(t.propertyAttributes))for(let s=0;s<t.propertyAttributes.length;s++){let a=t.propertyAttributes[s];o.push(new JC({id:s,name:a.name,class:n.classes[a.class],propertyAttribute:a}))}return new Qa({schema:n,propertyTables:i,propertyTextures:r,propertyAttributes:o,statistics:t.statistics,extras:t.extras,extensions:t.extensions})}var MD=4;function pZe(e,t,n,i){let r=e.properties;if(!l(r))return;let o=e.count,s;try{s=gZe(r,t,n,o)}catch(f){console.warn(`Failed to create texture for property table "${e.name}": ${f.message}`);return}let a=s.length;if(a===0)return;if(o>Ut.maximumTextureSize||a>Ut.maximumTextureSize){yt("PropertyTableTextureExceedsMaximumSize",`Cannot create a texture for the property table "${e.name}" because it exceeds the maximum texture size of ${Ut.maximumTextureSize}.`);return}let c=yZe(s,o),u=new Ht({wrapS:hn.CLAMP_TO_EDGE,wrapT:hn.CLAMP_TO_EDGE,minificationFilter:Wt.NEAREST,magnificationFilter:Jn.NEAREST});return Dt.create({context:i,pixelFormat:$e.RGBA,pixelDatatype:ze.UNSIGNED_BYTE,sampler:u,flipY:!1,source:{width:o,height:a,arrayBufferView:c}})}function gZe(e,t,n,i){let r=[],o=n.properties;for(let[s,a]of Object.entries(o)){if(!a.isGpuCompatible(MD))continue;let c=e[s],u=l(c)?t[c.values]:_Ze(a,i),f=u.length,d=a.cpuBytesPerElement(),p=f/d;if(p!==i)throw new oe(`Property with ID: "${s}" has (${p}), which does not match number of features in the property table: (${i}).`);r.push({view:u,classProperty:a})}return r}function _Ze(e,t){let n=e.noData,i=bt.getComponentCount(e.type),r=e.isArray?e.arrayLength:1;e.type===bt.ENUM&&(n=e.enumType.valuesByName[n]),i===1&&(n=[n]),r===1&&(n=[n]);let o=e.cpuBytesPerElement(),s=Ft.getSizeInBytes(e.valueType),a=new ArrayBuffer(o*t),c=new DataView(a),u=Ft.getDataViewAccessors(c,e.valueType);for(let f=0;f<t;f++)for(let d=0;d<r;d++)for(let p=0;p<i;p++){let g=d*i+p;u.set(o*f+g*s,n[d][p])}return new Uint8Array(a)}function yZe(e,t){let n=e.length,i=new Uint8Array(n*t*MD),r=new DataView(i.buffer,i.byteOffset,i.byteLength);for(let o=0;o<n;o++){let s=e[o],a=s.classProperty,c=o*t*MD,u=a.valueType,f=Ft.gpuComponentType(u);if(u!==f){bZe(s,r,c);continue}AZe(s,i,c)}return i}function AZe(e,t,n){let i=e.view,r=e.classProperty.cpuBytesPerElement(),o=i.length/r;for(let s=0;s<o;s++){let a=s*r,c=n+s*MD;t.set(i.subarray(a,a+r),c)}}function bZe(e,t,n){let i=e.classProperty,r=e.view,o=i.valueType,s=Ft.gpuComponentType(o),a=i.cpuBytesPerElement(),c=r.length/a,u=new DataView(r.buffer,r.byteOffset,r.byteLength),f=Ft.getDataViewAccessors(u,o),d=Ft.getDataViewAccessors(t,s),p=Ft.downcastFunction(o);for(let g=0;g<c;g++){let m=g*a,y=n+g*MD,A=f.get(m);d.set(y,p(A))}}var rU=mZe;function xZe(e){e=e??H.EMPTY_OBJECT;let t=e.extension,n=e.schema,i,r=[],o;if(l(t.featureTables))for(o=Object.keys(t.featureTables).sort(),i=0;i<o.length;i++){let a=o[i],c=t.featureTables[a],u=n.classes[c.class],f=new wh({count:c.count,properties:c.properties,class:u,bufferViews:e.bufferViews});r.push(new Su({id:a,count:c.count,metadataTable:f,extras:c.extras,extensions:c.extensions}))}let s=[];if(l(t.featureTextures))for(o=Object.keys(t.featureTextures).sort(),i=0;i<o.length;i++){let a=o[i],c=t.featureTextures[a];s.push(new Cy({id:a,propertyTexture:TZe(c),class:n.classes[c.class],textures:e.textures}))}return new Qa({schema:n,propertyTables:r,propertyTextures:s,statistics:t.statistics,extras:t.extras,extensions:t.extensions})}function TZe(e){let t={class:e.class,properties:{}},n=e.properties;for(let i in n)if(n.hasOwnProperty(i)){let r=n[i],o={channels:EZe(r.channels),extras:r.extras,extensions:r.extensions};t.properties[i]=Mt(r.texture,o,!0)}return t}function EZe(e){let t=e.length,n=new Array(t);for(let i=0;i<t;i++)n[i]="rgba".indexOf(e[i]);return n}var oU=xZe;var J$=class extends ar{constructor(t){super(),t=t??H.EMPTY_OBJECT;let{gltf:n,extension:i,extensionLegacy:r,gltfResource:o,baseResource:s,supportedImageFormats:a,frameState:c,cacheKey:u,asynchronous:f=!0}=t;this._gltfResource=o,this._baseResource=s,this._gltf=n,this._extension=i,this._extensionLegacy=r,this._supportedImageFormats=a,this._frameState=c,this._cacheKey=u,this._asynchronous=f,this._bufferViewLoaders=[],this._bufferViewIds=[],this._textureLoaders=[],this._textureIds=[],this._schemaLoader=void 0,this._structuralMetadata=void 0,this._state=Ct.UNLOADED,this._promise=void 0}get cacheKey(){return this._cacheKey}get structuralMetadata(){return this._structuralMetadata}load(){return l(this._promise)?this._promise:(this._state=Ct.LOADING,this._promise=CZe(this),this._promise)}process(t){if(this._state===Ct.READY)return!0;if(this._state!==Ct.LOADED)return!1;let n=this._textureLoaders,i=n.length,r=!0;for(let c=0;c<i;++c){let f=n[c].process(t);r=r&&f}if(!r)return!1;let o=this._schemaLoader.schema,s={};for(let c=0;c<this._bufferViewIds.length;++c){let u=this._bufferViewIds[c],f=this._bufferViewLoaders[c];if(!f.isDestroyed()){let d=new Uint8Array(f.typedArray);s[u]=d}}let a={};for(let c=0;c<this._textureIds.length;++c){let u=this._textureIds[c],f=n[c];f.isDestroyed()||(a[u]=f.texture)}return l(this._extension)?this._structuralMetadata=rU({extension:this._extension,schema:o,bufferViews:s,textures:a,context:t.context}):this._structuralMetadata=oU({extension:this._extensionLegacy,schema:o,bufferViews:s,textures:a}),v0e(this),this._state=Ct.READY,!0}unload(){v0e(this),FZe(this),l(this._schemaLoader)&&Bi.unload(this._schemaLoader),this._schemaLoader=void 0,l(this._structuralMetadata)&&this._structuralMetadata.destroy(),this._structuralMetadata=void 0}};async function CZe(e){try{let t=PZe(e),n=NZe(e),i=LZe(e);return await Promise.all([t,n,i]),e.isDestroyed()?void 0:(e._gltf=void 0,e._state=Ct.LOADED,e)}catch(t){if(e.isDestroyed())return;throw e.unload(),e._state=Ct.FAILED,e.getError("Failed to load structural metadata",t)}}function vZe(e,t){for(let n in e)if(e.hasOwnProperty(n)){let i=e[n],r=i.values,o=i.arrayOffsets,s=i.stringOffsets;l(r)&&(t[r]=!0),l(o)&&(t[o]=!0),l(s)&&(t[s]=!0)}}function SZe(e,t){for(let n in e)if(e.hasOwnProperty(n)){let i=e[n],r=i.bufferView,o=i.arrayOffsetBufferView,s=i.stringOffsetBufferView;l(r)&&(t[r]=!0),l(o)&&(t[o]=!0),l(s)&&(t[s]=!0)}}function wZe(e){let t=e.propertyTables,n={};if(l(t))for(let i=0;i<t.length;i++){let r=t[i];vZe(r.properties,n)}return n}function IZe(e){let t=e.featureTables,n={};if(l(t)){for(let i in t)if(t.hasOwnProperty(i)){let o=t[i].properties;l(o)&&SZe(o,n)}}return n}async function PZe(e){let t;l(e._extension)?t=wZe(e._extension):t=IZe(e._extensionLegacy);let n=[];for(let i in t)if(t.hasOwnProperty(i)){let r=Bi.getBufferViewLoader({gltf:e._gltf,bufferViewId:parseInt(i),gltfResource:e._gltfResource,baseResource:e._baseResource});e._bufferViewLoaders.push(r),e._bufferViewIds.push(i),n.push(r.load())}return Promise.all(n)}function DZe(e){let t={},n=e.propertyTextures;if(l(n))for(let i=0;i<n.length;i++){let o=n[i].properties;l(o)&&RZe(o,t)}return t}function RZe(e,t){for(let n in e)if(e.hasOwnProperty(n)){let i=e[n];t[i.index]=i}}function OZe(e){let t={},n=e.featureTextures;if(l(n)){for(let i in n)if(n.hasOwnProperty(i)){let o=n[i].properties;l(o)&&MZe(o,t)}}return t}function MZe(e,t){for(let n in e)if(e.hasOwnProperty(n)){let r=e[n].texture;t[r.index]=r}}function NZe(e){let t;l(e._extension)?t=DZe(e._extension):t=OZe(e._extensionLegacy);let n=e._gltf,i=e._gltfResource,r=e._baseResource,o=e._supportedImageFormats,s=e._frameState,a=e._asynchronous,c=[];for(let u in t)if(t.hasOwnProperty(u)){let f=Bi.getTextureLoader({gltf:n,textureInfo:t[u],gltfResource:i,baseResource:r,supportedImageFormats:o,frameState:s,asynchronous:a});e._textureLoaders.push(f),e._textureIds.push(u),c.push(f.load())}return Promise.all(c)}async function LZe(e){let t=e._extension??e._extensionLegacy,n;if(l(t.schemaUri)){let i=e._baseResource.getDerivedResource({url:t.schemaUri});n=Bi.getSchemaLoader({resource:i})}else n=Bi.getSchemaLoader({schema:t.schema});if(e._schemaLoader=n,await n.load(),!n.isDestroyed())return n.schema}function v0e(e){let t=e._bufferViewLoaders,n=t.length;for(let i=0;i<n;++i)Bi.unload(t[i]);e._bufferViewLoaders.length=0,e._bufferViewIds.length=0}function FZe(e){let t=e._textureLoaders,n=t.length;for(let i=0;i<n;++i)Bi.unload(t[i]);e._textureLoaders.length=0,e._textureIds.length=0}var sU=J$;var sx={TRANSLATION:"TRANSLATION",ROTATION:"ROTATION",SCALE:"SCALE",FEATURE_ID:"_FEATURE_ID"};sx.fromGltfSemantic=function(e){let t=e,i=/^(\w+)_\d+$/.exec(e);switch(i!==null&&(t=i[1]),t){case"TRANSLATION":return sx.TRANSLATION;case"ROTATION":return sx.ROTATION;case"SCALE":return sx.SCALE;case"_FEATURE_ID":return sx.FEATURE_ID}};Object.freeze(sx);var Fo=sx;var BZe=65534,kZe=255;function aU(e){e=e??H.EMPTY_OBJECT;let t=e.triangleIndices,n=e.outlineIndices,i=e.originalVertexCount;this._triangleIndices=t,this._originalVertexCount=i,this._edges=new I0e(n,i),this._outlineCoordinatesTypedArray=void 0,this._extraVertices=[],UZe(this)}Object.defineProperties(aU.prototype,{updatedTriangleIndices:{get:function(){return this._triangleIndices}},outlineCoordinates:{get:function(){return this._outlineCoordinatesTypedArray}}});function UZe(e){let t=e._triangleIndices,n=e._edges,i=[],r=e._extraVertices,o=e._originalVertexCount,s={};for(let a=0;a<t.length;a+=3){let c=t[a],u=t[a+1],f=t[a+2],d=!1,p=d||n.hasEdge(c,u),g=d||n.hasEdge(u,f),m=d||n.hasEdge(f,c),y=S0e(i,c,u,f,p,g,m);for(;l(y);){let A=s[y];if(!l(A)){A=o+r.length;let b=y;for(;b>=o;)b=r[b-o];r.push(b),s[y]=A}A>BZe&&(t instanceof Uint16Array||t instanceof Uint8Array)?t=new Uint32Array(t):A>kZe&&t instanceof Uint8Array&&(t=new Uint16Array(t)),y===c?(c=A,t[a]=A):y===u?(u=A,t[a+1]=A):(f=A,t[a+2]=A),y=S0e(i,c,u,f,p,g,m)}}e._triangleIndices=t,e._outlineCoordinatesTypedArray=new Float32Array(i)}function S0e(e,t,n,i,r,o,s){let a=s?1:0,c=r?1:0,u=0,f=Z$(e,t,a,c,u);if(f===0)return t;let d=0,p=r?1:0,g=o?1:0,m=Z$(e,n,d,p,g);if(m===0)return n;let y=s?1:0,A=0,b=o?1:0,x=Z$(e,i,y,A,b);if(x===0)return i;let T=f&m&x,E,v,S;if(T&1)E=0,v=1,S=2;else if(T&2)E=0,S=1,v=2;else if(T&4)v=0,E=1,S=2;else if(T&8)v=0,S=1,E=2;else if(T&16)S=0,E=1,v=2;else if(T&32)S=0,v=1,E=2;else{let L=Q$(f),_=Q$(m),C=Q$(x);return L<_&&L<C?t:_<C?n:i}let I=t*3;e[I+E]=a,e[I+v]=c,e[I+S]=u;let R=n*3;e[R+E]=d,e[R+v]=p,e[R+S]=g;let O=i*3;e[O+E]=y,e[O+v]=A,e[O+S]=b}function Z$(e,t,n,i,r){let o=t*3,s=e[o],a=e[o+1],c=e[o+2];return l(s)?(s===n&&a===i&&c===r)<<0|(s===n&&a===r&&c===i)<<1|(s===i&&a===n&&c===r)<<2|(s===i&&a===r&&c===n)<<3|(s===r&&a===n&&c===i)<<4|(s===r&&a===i&&c===n)<<5:63}function Q$(e){return(e&1)+(e>>1&1)+(e>>2&1)+(e>>3&1)+(e>>4&1)+(e>>5&1)}aU.prototype.updateAttribute=function(e){let t=this._extraVertices,n=e.length,i=n/this._originalVertexCount,r=t.length,o=e.constructor,s=new o(e.length+r*i);s.set(e);for(let a=0;a<r;a++){let c=t[a]*i,u=n+a*i;for(let f=0;f<i;f++)s[u+f]=s[c+f]}return s};aU.createTexture=function(e){let t=e.cache.modelOutliningCache;if(l(t)||(t=e.cache.modelOutliningCache={}),l(t.outlineTexture))return t.outlineTexture;let n=Math.min(4096,Ut.maximumTextureSize),i=n,r=w0e(i),o=[];for(;i>1;)i>>=1,o.push(w0e(i));let s=new Dt({context:e,source:{arrayBufferView:r,mipLevels:o},width:n,height:1,pixelFormat:$e.LUMINANCE,sampler:new Ht({wrapS:hn.CLAMP_TO_EDGE,wrapT:hn.CLAMP_TO_EDGE,minificationFilter:Wt.LINEAR_MIPMAP_LINEAR,magnificationFilter:Jn.LINEAR})});return t.outlineTexture=s,s};function w0e(e){let t=new Uint8Array(e);return t[e-1]=192,e===8?t[e-1]=96:e===4?t[e-1]=48:e===2?t[e-1]=24:e===1&&(t[e-1]=12),t}function I0e(e,t){this._originalVertexCount=t,this._edges=new Set;for(let n=0;n<e.length;n+=2){let i=e[n],r=e[n+1],o=Math.min(i,r),s=Math.max(i,r),a=o*this._originalVertexCount+s;this._edges.add(a)}}I0e.prototype.hasEdge=function(e,t){let n=Math.min(e,t),i=Math.max(e,t),r=n*this._originalVertexCount+i;return this._edges.has(r)};var QC=aU;function P0e(e){this.attribute=e,this.loadBuffer=!1,this.loadTypedArray=!1}function zZe(e){this.indices=e,this.loadBuffer=!1,this.loadTypedArray=!1}function cU(e){this.primitive=e,this.attributePlans=[],this.indicesPlan=void 0,this.needsOutlines=!1,this.outlineIndices=void 0,this.needsGaussianSplats=!1}cU.prototype.postProcess=function(e){this.needsOutlines&&(VZe(this),GZe(this,e)),this.needsGaussianSplats&&HZe(this,e)};function VZe(e){let t=e.primitive,n=t.indices,i=t.attributes[0].count,r=new QC({triangleIndices:n.typedArray,outlineIndices:e.outlineIndices,originalVertexCount:i});n.typedArray=r.updatedTriangleIndices,n.indexDatatype=je.fromTypedArray(n.typedArray);let o=jZe(r.outlineCoordinates),s=new P0e(o);s.loadBuffer=!0,s.loadTypedArray=!1,e.attributePlans.push(s),t.outlineCoordinates=s.attribute;let a=e.attributePlans,c=e.attributePlans.length;for(let u=0;u<c;u++){let f=a[u].attribute;f.typedArray=r.updateAttribute(f.typedArray)}}function jZe(e){let t=new vn.Attribute;return t.name="_OUTLINE_COORDINATES",t.typedArray=e,t.componentDatatype=Y.FLOAT,t.type=Vt.VEC3,t.normalized=!1,t.count=e.length/3,t}function HZe(e,t){let n=e.attributePlans,i=n.length;for(let r=0;r<i;r++){let o=n[r];o.loadBuffer=!1,o.loadTypedArray=!0}}function GZe(e,t){WZe(e.attributePlans,t),l(e.indicesPlan)&&qZe(e.indicesPlan,t)}function WZe(e,t){let n=e.length;for(let i=0;i<n;i++){let r=e[i],o=r.attribute,s=o.typedArray;if(r.loadBuffer){let a=tt.createVertexBuffer({typedArray:s,context:t,usage:Me.STATIC_DRAW});a.vertexArrayDestroyable=!1,o.buffer=a}r.loadTypedArray||(o.typedArray=void 0)}}function qZe(e,t){let n=e.indices;if(e.loadBuffer){let i=tt.createIndexBuffer({typedArray:n.typedArray,context:t,usage:Me.STATIC_DRAW,indexDatatype:n.indexDatatype});n.buffer=i,i.vertexArrayDestroyable=!1}e.loadTypedArray||(n.typedArray=void 0)}cU.AttributeLoadPlan=P0e;cU.IndicesLoadPlan=zZe;var ev=cU;function YZe(e){e=e??H.EMPTY_OBJECT,this.webp=e.webp??!1,this.basis=e.basis??!1}var lU=YZe;function D0e(e){this._position=e.position,this._adjustmentParams=e.adjustmentParams}Object.defineProperties(D0e.prototype,{position:{get:function(){return this._position}},adjustmentParams:{get:function(){return this._adjustmentParams}}});var uU=D0e;function R0e(e){this._position=e.position,this._adjustmentParams=e.adjustmentParams,this._covarianceMatrix=e.covarianceMatrix}Object.defineProperties(R0e.prototype,{position:{get:function(){return this._position}},adjustmentParams:{get:function(){return this._adjustmentParams}},covarianceMatrix:{get:function(){return this._covarianceMatrix}}});var fU=R0e;function O0e(e){this._groupFlags=e.groupFlags,this._rotationThetas=e.rotationThetas,this._params=e.params}Object.defineProperties(O0e.prototype,{groupFlags:{get:function(){return this._groupFlags}},rotationThetas:{get:function(){return this._rotationThetas}},params:{get:function(){return this._params}}});var dU=O0e;var M0e={Direct:"Direct",Indirect:"Indirect"};Object.freeze(M0e);var ax=M0e;function N0e(e){this._storageType=e.storageType,this._anchorPointsIndirect=e.anchorPointsIndirect,this._anchorPointsDirect=e.anchorPointsDirect,this._intraTileCorrelationGroups=e.intraTileCorrelationGroups,this._covarianceDirect=e.covarianceDirect}Object.defineProperties(N0e.prototype,{storageType:{get:function(){return this._storageType}},anchorPointsIndirect:{get:function(){return this._anchorPointsIndirect}},anchorPointsDirect:{get:function(){return this._anchorPointsDirect}},intraTileCorrelationGroups:{get:function(){return this._intraTileCorrelationGroups}},covarianceDirect:{get:function(){return this._covarianceDirect}}});var ND=N0e;function L0e(e){this._A=e.A,this._alpha=e.alpha,this._beta=e.beta,this._T=e.T}Object.defineProperties(L0e.prototype,{A:{get:function(){return this._A}},alpha:{get:function(){return this._alpha}},beta:{get:function(){return this._beta}},T:{get:function(){return this._T}}});var hU=L0e;function tv(){}function F0e(e){return new $(e[0],e[1],e[3],e[1],e[2],e[4],e[3],e[4],e[5])}function XZe(e){let t=h.fromArray(e.position,0,new h),n=h.fromArray(e.adjustmentParams,0,new h);return new uU({position:t,adjustmentParams:n})}function KZe(e){let t=h.fromArray(e.position,0,new h),n=h.fromArray(e.adjustmentParams,0,new h),i=F0e(e.covarianceMatrix);return new fU({position:t,adjustmentParams:n,covarianceMatrix:i})}function $Ze(e){let t=e.groupFlags,n=h.fromArray(e.rotationThetas,0,new h),i=[];for(let o of e.params){let s=new hU({A:o.A,alpha:o.alpha,beta:o.beta,T:o.T});i.push(s)}return new dU({groupFlags:t,rotationThetas:n,params:i})}tv.load=function(e){let t=e.storageType;if(t===ax.Direct)return tv.loadDirect(e);if(t===ax.Indirect)return tv.loadIndirect(e);throw new oe(`Invalid storage type in NGA_gpm_local - expected 'Direct' or 'Indirect', but found ${t}`)};tv.loadDirect=function(e){let t=[],n=e.anchorPointsDirect;for(let o of n){let s=XZe(o);t.push(s)}let i=F0e(e.covarianceDirectUpperTriangle);return new ND({storageType:ax.Direct,anchorPointsDirect:t,covarianceDirect:i})};tv.loadIndirect=function(e){let t=[],n=e.anchorPointsIndirect;for(let s of n){let a=KZe(s);t.push(a)}let i=e.intraTileCorrelationGroups,r=[];for(let s of i){let a=$Ze(s);r.push(a)}return new ND({storageType:ax.Indirect,anchorPointsIndirect:t,intraTileCorrelationGroups:r})};var mU=tv;function B0e(e){this._traits=e.traits,this._noData=e.noData,this._offset=e.offset,this._scale=e.scale,this._index=e.index,this._texCoord=e.texCoord}Object.defineProperties(B0e.prototype,{traits:{get:function(){return this._traits}},noData:{get:function(){return this._noData}},offset:{get:function(){return this._offset}},scale:{get:function(){return this._scale}},index:{get:function(){return this._index}},texCoord:{get:function(){return this._texCoord}}});var pU=B0e;function k0e(e){this._min=e.min,this._max=e.max,this._source=e.source}Object.defineProperties(k0e.prototype,{min:{get:function(){return this._min}},max:{get:function(){return this._max}},source:{get:function(){return this._source}}});var gU=k0e;function U0e(e){this._ppeTextures=e}Object.defineProperties(U0e.prototype,{ppeTextures:{get:function(){return this._ppeTextures}}});var _U=U0e;function $o(e){e=e??H.EMPTY_OBJECT;let t=e.gltf,n=e.extension,i=e.gltfResource,r=e.baseResource,o=e.supportedImageFormats,s=e.frameState,a=e.cacheKey,c=e.asynchronous??!0;this._gltfResource=i,this._baseResource=r,this._gltf=t,this._extension=n,this._supportedImageFormats=o,this._frameState=s,this._cacheKey=a,this._asynchronous=c,this._textureLoaders=[],this._textureIds=[],this._meshPrimitiveGpmLocal=void 0,this._structuralMetadata=void 0,this._state=Ct.UNLOADED,this._promise=void 0}l(Object.create)&&($o.prototype=Object.create(ar.prototype),$o.prototype.constructor=$o);Object.defineProperties($o.prototype,{cacheKey:{get:function(){return this._cacheKey}},meshPrimitiveGpmLocal:{get:function(){return this._meshPrimitiveGpmLocal}},structuralMetadata:{get:function(){return this._structuralMetadata}}});$o.prototype._loadResources=async function(){try{return await this._loadTextures(),this.isDestroyed()?void 0:(this._gltf=void 0,this._state=Ct.LOADED,this)}catch(e){if(this.isDestroyed())return;throw this.unload(),this._state=Ct.FAILED,this.getError("Failed to load GPM data",e)}};$o.prototype.load=function(){return l(this._promise)?this._promise:(this._state=Ct.LOADING,this._promise=this._loadResources(this),this._promise)};function JZe(e){let t={},n=e.ppeTextures;if(l(n))for(let i=0;i<n.length;i++){let r=n[i];t[r.index]=r}return t}$o.prototype._loadTextures=function(){let e;l(this._extension)&&(e=JZe(this._extension));let t=this._gltf,n=this._gltfResource,i=this._baseResource,r=this._supportedImageFormats,o=this._frameState,s=this._asynchronous,a=[];for(let c in e)if(e.hasOwnProperty(c)){let u=Bi.getTextureLoader({gltf:t,textureInfo:e[c],gltfResource:n,baseResource:i,supportedImageFormats:r,frameState:o,asynchronous:s});this._textureLoaders.push(u),this._textureIds.push(c),a.push(u.load())}return Promise.all(a)};$o.ppeTexturesMetadataSchemaCache=new Map;$o._createPpeTextureClassJson=function(e,t){let n=e.traits,i=n.source,r=e.offset??0,o=(e.scale??1)*255;return{name:`PPE texture class ${t}`,properties:{[i]:{name:"PPE",type:"SCALAR",componentType:"UINT8",normalized:!0,offset:r,scale:o,min:n.min,max:n.max}}}};$o._obtainPpeTexturesMetadataSchema=function(e){let n=$o._collectPpeTexturePropertyIdentifiers(e).toString(),i=$o.ppeTexturesMetadataSchemaCache.get(n);if(l(i))return i;let o={id:`PPE_TEXTURE_SCHEMA_${$o.ppeTexturesMetadataSchemaCache.size}`,classes:{}},s=e.ppeTextures;for(let a=0;a<s.length;a++){let c=s[a],u=`ppeTexture_${a}`,f=$o._createPpeTextureClassJson(c,a);o.classes[u]=f}return i=Eu.fromJson(o),$o.ppeTexturesMetadataSchemaCache.set(n,i),i};$o._collectPpeTexturePropertyIdentifiers=function(e){let t=[],n=e.ppeTextures;for(let i=0;i<n.length;i++){let r=n[i],o=$o._createPpeTextureClassJson(r,i),s=JSON.stringify(o);t.push(s)}return t};$o._convertToStructuralMetadata=function(e,t){let n=[],i=$o._obtainPpeTexturesMetadataSchema(e),r=e.ppeTextures;for(let s=0;s<r.length;s++){let a=r[s],c=`ppeTexture_${s}`,f=a.traits.source,d=i.classes[c],p={class:c,properties:{[f]:{index:a.index,texCoord:a.texCoord}}};n.push(new Cy({id:s,name:a.name,propertyTexture:p,class:d,textures:t}))}return new Qa({schema:i,propertyTables:[],propertyTextures:n,propertyAttributes:[]})};$o.prototype.process=function(e){if(this._state===Ct.READY)return!0;if(this._state!==Ct.LOADED)return!1;let t=this._textureLoaders,n=t.length,i=!0;for(let u=0;u<n;++u){let d=t[u].process(e);i=i&&d}if(!i)return!1;let r={};for(let u=0;u<this._textureIds.length;++u){let f=this._textureIds[u],d=t[u];d.isDestroyed()||(r[f]=d.texture)}let o=[],s=this._extension;if(l(s.ppeTextures)){let u=s.ppeTextures;for(let f of u){let d=f.traits,p=new gU({min:d.min,max:d.max,source:d.source}),g=new pU({traits:p,noData:f.noData,offset:f.offset,scale:f.scale,index:f.index,texCoord:f.texCoord});o.push(g)}}let a=new _U(o);this._meshPrimitiveGpmLocal=a;let c=$o._convertToStructuralMetadata(a,r);return this._structuralMetadata=c,this._state=Ct.READY,!0};$o.prototype._unloadTextures=function(){let e=this._textureLoaders,t=e.length;for(let n=0;n<t;++n)Bi.unload(e[n]);this._textureLoaders.length=0,this._textureIds.length=0};$o.prototype.unload=function(){this._unloadTextures(),this._gltf=void 0,this._extension=void 0,this._structuralMetadata=void 0};var yU=$o;function ZZe(e){let n=(e.extensions??H.EMPTY_OBJECT).EXT_mesh_primitive_restart,i=e.primitives;if(!l(n))return i;let r=[];Zn(r,i);for(let o of n.primitiveGroups){let s=o.primitives[0];if(!l(s)||!i[s])return i;let a={...i[s],indices:o.indices};switch(a.mode){case te.TRIANGLE_FAN:case te.TRIANGLE_STRIP:case te.LINE_STRIP:case te.LINE_LOOP:break;default:return i}for(let c of o.primitives){let u=r[c];if(!l(u?.indices)||u.mode!==a.mode)return i;r[c]=void 0}r[s]=a}return r.filter(l)}var AU=ZZe;var{Attribute:QZe,Indices:eQe,FeatureIdAttribute:V0e,FeatureIdTexture:j0e,FeatureIdImplicitRange:H0e,MorphTarget:tQe,Primitive:nQe,Instances:iQe,Skin:rQe,Node:oQe,AnimatedPropertyType:sQe,AnimationSampler:aQe,AnimationTarget:cQe,AnimationChannel:lQe,Animation:uQe,ArticulationStage:fQe,Articulation:dQe,Asset:hQe,Scene:mQe,Components:pQe,MetallicRoughness:gQe,SpecularGlossiness:_Qe,Specular:yQe,Anisotropy:eJ,Clearcoat:tJ,PlanarFill:AQe,LineStyle:bQe,Material:xQe,Vector:TQe,Polygon:EQe}=vn,to={NOT_LOADED:0,LOADING:1,LOADED:2,PROCESSING:3,POST_PROCESSING:4,PROCESSED:5,READY:6,FAILED:7,UNLOADED:8},nJ=class extends ar{constructor(t){super(),t=t??H.EMPTY_OBJECT;let{gltfResource:n,typedArray:i,releaseGltfJson:r=!1,asynchronous:o=!0,incrementallyLoadTextures:s=!0,upAxis:a=qi.Y,forwardAxis:c=qi.Z,loadAttributesAsTypedArray:u=!1,loadAttributesFor2D:f=!1,enablePick:d=!1,loadIndicesForWireframe:p=!1,loadPrimitiveOutline:g=!0,loadForClassification:m=!1,renameBatchIdSemantic:y=!1}=t,{baseResource:A=n.clone()}=t;this._gltfJson=t.gltfJson,this._gltfResource=n,this._baseResource=A,this._typedArray=i,this._releaseGltfJson=r,this._asynchronous=o,this._incrementallyLoadTextures=s,this._upAxis=a,this._forwardAxis=c,this._loadAttributesAsTypedArray=u,this._loadAttributesFor2D=f,this._enablePick=d,this._loadIndicesForWireframe=p,this._loadPrimitiveOutline=g,this._loadForClassification=m,this._renameBatchIdSemantic=y,this._sortedPropertyTableIds=void 0,this._sortedFeatureTextureIds=void 0,this._gltfJsonLoader=void 0,this._state=to.NOT_LOADED,this._textureState=to.NOT_LOADED,this._promise=void 0,this._processError=void 0,this._textureErrors=[],this._primitiveLoadPlans=[],this._loaderPromises=[],this._textureLoaders=[],this._texturesPromises=[],this._textureCallbacks=[],this._bufferViewLoaders=[],this._geometryLoaders=[],this._geometryCallbacks=[],this._structuralMetadataLoader=void 0,this._meshPrimitiveGpmLoader=void 0,this._loadResourcesPromise=void 0,this._resourcesLoaded=!1,this._texturesLoaded=!1,this._supportedImageFormats=void 0,this._postProcessBuffers=[],this._components=void 0}get cacheKey(){}get components(){return this._components}get gltfJson(){return l(this._gltfJsonLoader)?this._gltfJsonLoader.gltf:this._gltfJson}get incrementallyLoadTextures(){return this._incrementallyLoadTextures}get texturesLoaded(){return this._texturesLoaded}async load(){return l(this._promise)?this._promise:(this._promise=CQe(this),this._promise)}_process(t){return this._state===to.READY?!0:(this._state===to.PROCESSING&&SQe(this,t),this._resourcesLoaded&&this._state===to.POST_PROCESSING&&(wQe(this,t.context),this._state=to.PROCESSED),this._resourcesLoaded&&this._state===to.PROCESSED?(z0e(this),this._typedArray=void 0,this._state=to.READY,!0):!1)}_processTextures(t){if(this._textureState===to.READY)return!0;if(this._textureState!==to.PROCESSING)return!1;let n=!0,i=this._textureLoaders;for(let r=0;r<i.length;++r){let o=i[r].process(t);o&&l(this._textureCallbacks[r])&&(this._textureCallbacks[r](),this._textureCallbacks[r]=void 0),n=n&&o}return n?(this._textureState=to.READY,this._texturesLoaded=!0,!0):!1}process(t){if(this._state===to.LOADED&&!l(this._loadResourcesPromise)&&(this._loadResourcesPromise=vQe(this,t).then(()=>{this._resourcesLoaded=!0}).catch(o=>{this._processError=o})),l(this._processError)){this._state=to.FAILED;let o=this._processError;this._processError=void 0,bU(this,o)}let n=this._textureErrors.pop();if(l(n)){let o=this.getError("Failed to load glTF texture",n);throw o.name="TextureError",o}if(this._state===to.FAILED)return!1;let i=!1;try{i=this._process(t)}catch(o){this._state=to.FAILED,bU(this,o)}let r=!1;try{r=this._processTextures(t)}catch(o){this._textureState=to.FAILED,bU(this,o)}return this._incrementallyLoadTextures?i:i&&r}isUnloaded(){return this._state===to.UNLOADED}unload(){l(this._gltfJsonLoader)&&!this._gltfJsonLoader.isDestroyed()&&Bi.unload(this._gltfJsonLoader),this._gltfJsonLoader=void 0,Vet(this),z0e(this),jet(this),Het(this),Get(this),Wet(this),this._components=void 0,this._typedArray=void 0,this._state=to.UNLOADED}};async function CQe(e){e._state=to.LOADING,e._textureState=to.LOADING;try{let t=Bi.getGltfJsonLoader({gltfResource:e._gltfResource,baseResource:e._baseResource,typedArray:e._typedArray,gltfJson:e._gltfJson});return e._gltfJsonLoader=t,await t.load(),e.isDestroyed()||e.isUnloaded()||t.isDestroyed()?void 0:(e._state=to.LOADED,e._textureState=to.LOADED,e)}catch(t){if(e.isDestroyed())return;e._state=to.FAILED,e._textureState=to.FAILED,bU(e,t)}}async function vQe(e,t){dn.supportsWebP.initialized||await dn.supportsWebP.initialize(),e._supportedImageFormats=new lU({webp:dn.supportsWebP(),basis:t.context.supportsBasis});let n=zet(e,t);return e._state=to.PROCESSING,e._textureState=to.PROCESSING,l(e._gltfJsonLoader)&&e._releaseGltfJson&&(Bi.unload(e._gltfJsonLoader),e._gltfJsonLoader=void 0),n}function bU(e,t){throw e.unload(),e.getError("Failed to load glTF",t)}function SQe(e,t){let n=!0,i=e._geometryLoaders;for(let s=0;s<i.length;++s){let a=i[s].process(t);a&&l(e._geometryCallbacks[s])&&(e._geometryCallbacks[s](),e._geometryCallbacks[s]=void 0),n=n&&a}let r=e._structuralMetadataLoader;if(l(r)){let s=r.process(t);s&&(e._components.structuralMetadata=r.structuralMetadata),n=n&&s}let o=e._meshPrimitiveGpmLoader;if(l(o)){let s=o.process(t);s&&(l(e._components.structuralMetadata)&&yt("structural-metadata-gpm","The model defines both the 'EXT_structural_metadata' extension and the 'NGA_gpm_local' extension. The data from the 'EXT_structural_metadata' extension will be replaced with the data from the 'NGA_gpm_local' extension, and will no longer be available for styling and picking."),e._components.structuralMetadata=o.structuralMetadata),n=n&&s}n&&(e._state=to.POST_PROCESSING)}function wQe(e,t){let n=e._primitiveLoadPlans;for(let i=0;i<n.length;i++){let r=n[i];r.postProcess(t),(r.needsOutlines||r.needsGaussianSplats)&&IQe(e,r)}}function IQe(e,t){let n=e._postProcessBuffers,i=t.primitive,r=i.outlineCoordinates;l(r)&&n.push(r.buffer);let o=i.attributes;for(let a=0;a<o.length;a++){let c=o[a];l(c.buffer)&&n.push(c.buffer)}let s=i.indices;l(s)&&l(s.buffer)&&n.push(s.buffer)}function PQe(e,t,n,i,r,o,s,a,c){let u=e.gltfJson,d=u.accessors[t].bufferView;return Bi.getVertexBufferLoader({gltf:u,gltfResource:e._gltfResource,baseResource:e._baseResource,frameState:c,bufferViewId:d,primitive:i,draco:r,spz:o,attributeSemantic:n,accessorId:t,asynchronous:e._asynchronous,loadBuffer:s,loadTypedArray:a})}function DQe(e,t,n,i,r,o,s){return Bi.getIndexBufferLoader({gltf:e.gltfJson,accessorId:t,gltfResource:e._gltfResource,baseResource:e._baseResource,frameState:s,primitive:n,draco:i,asynchronous:e._asynchronous,loadBuffer:r,loadTypedArray:o})}function G0e(e,t){let n=Bi.getBufferViewLoader({gltf:e.gltfJson,bufferViewId:t,gltfResource:e._gltfResource,baseResource:e._baseResource});return e._bufferViewLoaders.push(n),n}function iJ(e,t,n){let i=t.byteOffset,r=mf(e,t),o=t.count,s=ud(t.type),a=t.componentType,c=Y.getSizeInBytes(a),u=c*s,f=o*s;if(r===u)return n=new Uint8Array(n),Y.createArrayBufferView(a,n.buffer,n.byteOffset+i,f);let d=Y.createTypedArray(a,f),p=new DataView(n.buffer),g=new Array(s),m=dy(t.componentType);i=n.byteOffset+i;for(let y=0;y<o;++y){m(p,i,s,c,g);for(let A=0;A<s;++A)d[y*s+A]=g[A];i+=r}return d}function RQe(e,t){let n=e.type;if(n===Vt.SCALAR)return t.fill(0);let i=Vt.getMathType(n);return t.fill(i.clone(i.ZERO))}function OQe(e,t,n,i){let r=e.type,o=e.count;if(r===Vt.SCALAR)for(let s=0;s<o;s++)n[s]=t[s];else if(r===Vt.VEC4&&i)for(let s=0;s<o;s++)n[s]=Le.unpack(t,s*4);else{let s=Vt.getMathType(r),a=Vt.getNumberOfComponents(r);for(let c=0;c<o;c++)n[c]=s.unpack(t,c*a)}return n}async function MQe(e,t,n,i,r){let{gltfJson:o}=e;if(await t.load(),e.isDestroyed())return;let s=iJ(o,n,t.typedArray);i=i??!1,OQe(n,s,r,i)}function LD(e,t,n){let i=new Array(t.count),r=t.bufferView;if(l(r)){let o=G0e(e,r),s=MQe(e,o,t,n,i);return e._loaderPromises.push(s),i}return RQe(t,i)}function Oh(e,t){let n=Y.createTypedArray(t.componentType,t.count*Vt.getNumberOfComponents(t.type));if(!l(t.bufferView))return n;let i=G0e(e,t.bufferView),{gltfJson:r}=e,o=i.load().then(()=>{if(e.isDestroyed())return;let s=iJ(r,t,i.typedArray);n.set(s)});return e._loaderPromises.push(o),n}function wu(e,t){if(l(t))return e===Number?t[0]:e.unpack(t)}function NQe(e){return e===Number?0:new e}function LQe(e){switch(e){case Y.BYTE:return 127;case Y.UNSIGNED_BYTE:return 255;case Y.SHORT:return 32767;case Y.UNSIGNED_SHORT:return 65535;default:return 1}}var FQe={VEC2:new U(-1,-1),VEC3:new h(-1,-1,-1),VEC4:new se(-1,-1,-1,-1)};function BQe(e,t){let n=LQe(e.componentDatatype),i=FQe[e.type],r=e.min;l(r)&&(r=t.divideByScalar(r,n,r),r=t.maximumByComponent(r,i,r));let o=e.max;l(o)&&(o=t.divideByScalar(o,n,o),o=t.maximumByComponent(o,i,o)),e.min=r,e.max=o}function kQe(e,t,n){let i=e.decodeMatrix,r=wu(n,e.decodedMin),o=wu(n,e.decodedMax);l(r)&&l(o)&&(t.min=r,t.max=o);let s=new vn.Quantization;s.componentDatatype=t.componentDatatype,s.type=t.type,i.length===4?(s.quantizedVolumeOffset=i[2],s.quantizedVolumeStepSize=i[0]):i.length===9?(s.quantizedVolumeOffset=new U(i[6],i[7]),s.quantizedVolumeStepSize=new U(i[0],i[4])):i.length===16?(s.quantizedVolumeOffset=new h(i[12],i[13],i[14]),s.quantizedVolumeStepSize=new h(i[0],i[5],i[10])):i.length===25&&(s.quantizedVolumeOffset=new se(i[20],i[21],i[22],i[23]),s.quantizedVolumeStepSize=new se(i[0],i[6],i[12],i[18])),t.quantization=s}function UQe(e,t,n,i,r){let o=e.accessors[t],s=Vt.getMathType(o.type),a=o.normalized??!1,c=new QZe;c.name=n,c.semantic=i,c.setIndex=r,c.constant=NQe(s),c.componentDatatype=o.componentType,c.normalized=a,c.count=o.count,c.type=o.type,c.min=wu(s,o.min),c.max=wu(s,o.max),c.byteOffset=o.byteOffset,c.byteStride=mf(e,o),sr(o,"WEB3D_quantized_attributes")&&kQe(o.extensions.WEB3D_quantized_attributes,c,s);let u=c.semantic===ct.POSITION||c.semantic===ct.NORMAL||c.semantic===ct.TANGENT||c.semantic===ct.TEXCOORD||c.semantic===ct.FEATURE_ID||c.semantic===ct.SCALE||c.semantic===ct.ROTATION;return e.extensionsRequired?.includes("KHR_mesh_quantization")&&a&&u&&BQe(c,s),c}function W0e(e){let n=/^\w+_(\d+)$/.exec(e);if(n!==null)return parseInt(n[1])}var zQe={gltfSemantic:void 0,renamedSemantic:void 0,modelSemantic:void 0};function rJ(e,t,n){let i=n;e._renameBatchIdSemantic&&(n==="_BATCHID"||n==="BATCHID")&&(i="_FEATURE_ID_0");let r=t.fromGltfSemantic(i),o=zQe;return o.gltfSemantic=n,o.renamedSemantic=i,o.modelSemantic=r,o}function VQe(e){let t=e===ct.POSITION,n=e===ct.FEATURE_ID,i=e===ct.TEXCOORD;return t||n||i}function jQe(e,t,n,i){if(e.byteOffset=0,e.byteStride=void 0,e.quantization=t.quantization,n&&(e.buffer=t.buffer),i){let r=l(t.quantization)?t.quantization.componentDatatype:e.componentDatatype;e.typedArray=Y.createArrayBufferView(r,t.typedArray.buffer)}}function HQe(e,t,n,i){if(e.byteOffset=0,e.byteStride=void 0,n&&(e.buffer=t.buffer),i&&l(t.typedArray)&&(e.typedArray=Y.createArrayBufferView(e.componentDatatype,t.typedArray.buffer)),e.semantic===ct.POSITION){let r=s=>{let a=1/0,c=-1/0,u=1/0,f=-1/0,d=1/0,p=-1/0;for(let g=0;g<s.length;g+=3){let m=s[g],y=s[g+1],A=s[g+2];a=Math.min(a,m),c=Math.max(c,m),u=Math.min(u,y),f=Math.max(f,y),d=Math.min(d,A),p=Math.max(p,A)}return[new h(a,u,d),new h(c,f,p)]},o=e.typedArray;[e.min,e.max]=r(o)}}function GQe(e,t,n,i,r,o){if(r&&(n.buffer=i.buffer),o){let s=i.typedArray;n.typedArray=iJ(e,t,s),r||(n.byteOffset=0,n.byteStride=void 0)}}function q0e(e,t,n,i,r,o,s,a,c){let u=e.gltfJson,f=u.accessors[t],d=f.bufferView,p=n.gltfSemantic,g=n.renamedSemantic,m=n.modelSemantic,y=l(m)?W0e(g):void 0,b=UQe(u,t,p,m,y);if(!l(r)&&!l(d)&&!l(o))return b;let x=PQe(e,t,p,i,r,o,s,a,c),T=e._geometryLoaders.length;e._geometryLoaders.push(x);let E=x.load();return e._loaderPromises.push(E),e._geometryCallbacks[T]=()=>{l(r)&&l(r.attributes)&&l(r.attributes[p])?jQe(b,x,s,a):l(o)?HQe(b,x,s,a):GQe(u,f,b,x,s,a)},b}function Y0e(e,t,n,i,r,o,s,a,c){let u=n.modelSemantic,f=u===ct.POSITION,d=u===ct.FEATURE_ID,p=f&&!s&&e._loadAttributesFor2D&&!c.scene3DOnly,g=f&&e._enablePick&&!c.context.webgl2,m=e._loadForClassification&&d,y=e._loadAttributesAsTypedArray,A=!y,b=y||p||g||m,E=q0e(e,t,n,i,r,o,a?!1:A,a?!0:b,c),v=new ev.AttributeLoadPlan(E);return v.loadBuffer=A,v.loadTypedArray=b,v}function WQe(e,t,n,i,r){let o=e.gltfJson.accessors,s=l(n.ROTATION),a=l(n.TRANSLATION)&&l(o[n.TRANSLATION].min)&&l(o[n.TRANSLATION].max),c=rJ(e,Fo,i),u=c.modelSemantic,f=u===Fo.TRANSLATION||u===Fo.ROTATION||u===Fo.SCALE,d=u===Fo.TRANSLATION,p=e._loadAttributesAsTypedArray||s&&f||!r.context.instancedArrays,g=e._enablePick&&!r.context.webgl2,m=!p,y=e._loadAttributesFor2D&&!r.scene3DOnly;return q0e(e,t,c,void 0,void 0,void 0,m,p||d&&(!a||y||g),r)}function qQe(e,t,n,i,r,o){let s=e.gltfJson.accessors[t],a=s.bufferView,c=n.extensions??H.EMPTY_OBJECT,u=c.KHR_draco_mesh_compression,f=l(c.EXT_mesh_primitive_edge_visibility);if(!l(u)&&!l(a))return;let d=new eQe;d.count=s.count;let p=e._loadAttributesAsTypedArray,g=(e._loadIndicesForWireframe||e._enablePick)&&!o.context.webgl2,m=e._loadForClassification&&i,A=!p,b=p||g||m||f,E=DQe(e,t,n,u,r?!1:A,r?!0:b,o),v=e._geometryLoaders.length;e._geometryLoaders.push(E);let S=E.load();e._loaderPromises.push(S),e._geometryCallbacks[v]=()=>{d.indexDatatype=E.indexDatatype,d.buffer=E.buffer,d.typedArray=E.typedArray};let I=new ev.IndicesLoadPlan(d);return I.loadBuffer=A,I.loadTypedArray=b,I}function YQe(e,t,n){return new Ht({wrapR:e.wrapR,wrapS:e.wrapS,wrapT:e.wrapT,minificationFilter:t??e.minificationFilter,magnificationFilter:n??e.magnificationFilter,maximumAnisotropy:e.maximumAnisotropy})}function Fl(e,t,n,i,r){let o=e.gltfJson,s=pf.getImageIdFromTexture({gltf:o,textureId:t.index,supportedImageFormats:e._supportedImageFormats});if(!l(s))return;let a=Bi.getTextureLoader({gltf:o,textureInfo:t,gltfResource:e._gltfResource,baseResource:e._baseResource,supportedImageFormats:e._supportedImageFormats,frameState:n,asynchronous:e._asynchronous}),c=pf.createModelTextureReader({textureInfo:t}),u=e._textureLoaders.length;e._textureLoaders.push(a);let f=a.load().catch(d=>{if(!e.isDestroyed()){if(!e._incrementallyLoadTextures)throw d;e._textureState=to.FAILED,e._textureErrors.push(d)}});return e._texturesPromises.push(f),e._textureCallbacks[u]=()=>{let d=a.texture;c.texture=d,(l(i)||l(r))&&(d.sampler=YQe(d.sampler,i,r))},c}function XQe(e,t,n){let{diffuseTexture:i,specularGlossinessTexture:r,diffuseFactor:o,specularFactor:s,glossinessFactor:a}=t,c=new _Qe;return l(i)&&(c.diffuseTexture=Fl(e,i,n)),l(r)&&(c.specularGlossinessTexture=Fl(e,r,n)),c.diffuseFactor=wu(se,o),c.specularFactor=wu(h,s),c.glossinessFactor=a,c}function KQe(e,t,n){let{baseColorTexture:i,metallicRoughnessTexture:r,baseColorFactor:o,metallicFactor:s,roughnessFactor:a}=t,c=new gQe;return l(i)&&(c.baseColorTexture=Fl(e,i,n)),l(r)&&(c.metallicRoughnessTexture=Fl(e,r,n)),c.baseColorFactor=wu(se,o),c.metallicFactor=s,c.roughnessFactor=a,c}function $Qe(e,t,n){let{specularFactor:i,specularTexture:r,specularColorFactor:o,specularColorTexture:s}=t,a=new yQe;return l(r)&&(a.specularTexture=Fl(e,r,n)),l(s)&&(a.specularColorTexture=Fl(e,s,n)),a.specularFactor=i,a.specularColorFactor=wu(h,o),a}function JQe(e,t,n){let{anisotropyStrength:i=eJ.DEFAULT_ANISOTROPY_STRENGTH,anisotropyRotation:r=eJ.DEFAULT_ANISOTROPY_ROTATION,anisotropyTexture:o}=t,s=new eJ;return l(o)&&(s.anisotropyTexture=Fl(e,o,n)),s.anisotropyStrength=i,s.anisotropyRotation=r,s}function ZQe(e,t,n){let{clearcoatFactor:i=tJ.DEFAULT_CLEARCOAT_FACTOR,clearcoatTexture:r,clearcoatRoughnessFactor:o=tJ.DEFAULT_CLEARCOAT_ROUGHNESS_FACTOR,clearcoatRoughnessTexture:s,clearcoatNormalTexture:a}=t,c=new tJ;return l(r)&&(c.clearcoatTexture=Fl(e,r,n)),l(s)&&(c.clearcoatRoughnessTexture=Fl(e,s,n)),l(a)&&(c.clearcoatNormalTexture=Fl(e,a,n)),c.clearcoatFactor=i,c.clearcoatRoughnessFactor=o,c}function QQe(e){return new AQe(e)}function eet(e){if(!l(e))return;let t=new bQe;if(l(e.width)){let n=e.width;n>0&&Math.floor(n)===n&&(t.width=n)}if(l(e.pattern)){let n=e.pattern;n>=0&&n<=65535&&Math.floor(n)===n&&(t.pattern=n)}if(!(!l(t.width)&&!l(t.pattern)))return t}function tet(e,t,n){let i=new xQe,r=t.extensions??H.EMPTY_OBJECT,o=r.KHR_materials_pbrSpecularGlossiness,s=r.KHR_materials_specular,a=r.KHR_materials_anisotropy,c=r.KHR_materials_clearcoat,u=t.pbrMetallicRoughness,f=r.BENTLEY_materials_planar_fill;i.unlit=l(r.KHR_materials_unlit),l(o)?i.specularGlossiness=XQe(e,o,n):(l(u)&&(i.metallicRoughness=KQe(e,u,n)),l(s)&&!i.unlit&&(i.specular=$Qe(e,s,n)),l(a)&&!i.unlit&&(i.anisotropy=JQe(e,a,n)),l(c)&&!i.unlit&&(i.clearcoat=ZQe(e,c,n))),l(t.emissiveTexture)&&(i.emissiveTexture=Fl(e,t.emissiveTexture,n)),l(t.normalTexture)&&!e._loadForClassification&&(i.normalTexture=Fl(e,t.normalTexture,n)),l(t.occlusionTexture)&&(i.occlusionTexture=Fl(e,t.occlusionTexture,n)),i.emissiveFactor=wu(h,t.emissiveFactor),i.alphaMode=t.alphaMode,i.alphaCutoff=t.alphaCutoff,i.doubleSided=t.doubleSided,l(f)&&(i.planarFill=QQe(f));let d=r.BENTLEY_materials_point_style;if(l(d)&&l(d.diameter)){let p=d.diameter;p>=1&&(i.pointDiameter=Math.floor(p))}return i.lineStyle=eet(r.BENTLEY_materials_line_style),i}function X0e(e,t){let n=new V0e;return n.featureCount=e.featureCount,n.nullFeatureId=e.nullFeatureId,n.propertyTableId=e.propertyTable,n.setIndex=e.attribute,n.label=e.label,n.positionalLabel=t,n}function K0e(e,t,n,i){let r=new V0e,o=e.featureIds;return r.featureCount=n,r.propertyTableId=t,r.setIndex=W0e(o.attribute),r.positionalLabel=i,r}function $0e(e,t){let n=new H0e;return n.propertyTableId=e.propertyTable,n.featureCount=e.featureCount,n.nullFeatureId=e.nullFeatureId,n.label=e.label,n.positionalLabel=t,n.offset=0,n.repeat=1,n}function J0e(e,t,n,i){let r=new H0e,o=e.featureIds;r.propertyTableId=t,r.featureCount=n,r.offset=o.constant??0;let s=o.divisor??0;return r.repeat=s===0?void 0:s,r.positionalLabel=i,r}function net(e,t,n,i){let r=new j0e;r.featureCount=t.featureCount,r.nullFeatureId=t.nullFeatureId,r.propertyTableId=t.propertyTable,r.label=t.label,r.positionalLabel=i;let o=t.texture;r.textureReader=Fl(e,o,n,Wt.NEAREST,Jn.NEAREST);let a=(l(o.channels)?o.channels:[0]).map(function(c){return"rgba".charAt(c)}).join("");return r.textureReader.channels=a,r}function iet(e,t,n,i,r,o){let s=new j0e,a=t.featureIds,c=a.texture;return s.featureCount=r,s.propertyTableId=n,s.textureReader=Fl(e,c,i,Wt.NEAREST,Jn.NEAREST),s.textureReader.channels=a.channels,s.positionalLabel=o,s}function ret(e,t,n,i,r){let o=new tQe,s=void 0,a=void 0,c=void 0,u=!1;for(let f in t){if(!t.hasOwnProperty(f))continue;let d=t[f],p=rJ(e,ct,f),g=Y0e(e,d,p,s,a,c,u,n,r);o.attributes.push(g.attribute),i.attributePlans.push(g)}return o}function oet(e){let i=e?.KHR_gaussian_splatting?.extensions?.KHR_gaussian_splatting_compression_spz_2;if(l(i))return i}function Z0e(e,t){if(!l(t))return;let n=e.gltfJson.materials;if(!l(n)||t<0||t>=n.length)return;let i=n[t];if(!l(i))return;let r=i.pbrMetallicRoughness??H.EMPTY_OBJECT,o=wu(se,r.baseColorFactor);return l(o)?o:new se(1,1,1,1)}function set(e){switch(e){case Y.UNSIGNED_BYTE:return 255;case Y.UNSIGNED_SHORT:return 65535;case Y.UNSIGNED_INT:return 4294967295;default:throw new oe("EXT_mesh_primitive_edge_visibility line strings indices must use unsigned scalar component types.")}}function aet(e,t,n){if(!l(t)||t.length===0)return;let i=new Array(t.length);for(let r=0;r<t.length;r++){let o=t[r]??H.EMPTY_OBJECT,s=o.indices,a=e.gltfJson.accessors[s];if(!l(a))throw new oe("Edge visibility line string accessor not found!");let c=Oh(e,a),u=set(a.componentType),f=l(o.material)?o.material:n;i[r]={indices:c,restartIndex:u,componentType:a.componentType,materialColor:Z0e(e,f)}}return i}function cet(e,t){if(!l(t))return;let n={},i=t.visibility;if(l(i)){let r=e.gltfJson.accessors[i];if(!l(r))throw new oe("Edge visibility accessor not found!");n.visibility=Oh(e,r)}if(n.materialColor=Z0e(e,t.material),l(t.silhouetteNormals)){let r=e.gltfJson.accessors[t.silhouetteNormals];l(r)&&(n.silhouetteNormals=Oh(e,r))}return l(t.lineStrings)&&(n.lineStrings=aet(e,t.lineStrings,t.material)),n}function uet(e,t,n,i){let r=new nQe,o=new ev(r);e._primitiveLoadPlans.push(o);let s=t.material;l(s)&&(r.material=tet(e,e.gltfJson.materials[s],i));let a=t.extensions??H.EMPTY_OBJECT,c=a.EXT_mesh_polygon;l(c)&&(r.polygon=det(e,t,c));let u=a.CESIUM_mesh_vector;l(u)&&(r.vector=het(e,u));let f=!1,d=a.CESIUM_primitive_outline;e._loadPrimitiveOutline&&l(d)&&(f=!0,o.needsOutlines=!0,o.outlineIndices=fet(e,d,o)),r.edgeVisibility=cet(e,a.EXT_mesh_primitive_edge_visibility);let p=oet(a);l(p)&&(f=!0,o.needsGaussianSplats=!0);let g=e._loadForClassification,m=a.KHR_draco_mesh_compression,y=!1,A=t.attributes;if(l(A))for(let O in A){if(!A.hasOwnProperty(O))continue;let L=A[O],_=rJ(e,ct,O),C=_.modelSemantic;if(g&&!VQe(C))continue;C===ct.FEATURE_ID&&(y=!0);let w=Y0e(e,L,_,t,m,p,n,f,i);o.attributePlans.push(w),r.attributes.push(w.attribute)}let b=t.targets;if(l(b)&&!g)for(let O=0;O<b.length;++O)r.morphTargets.push(ret(e,b[O],f,o,i));let x=t.indices;if(l(x)){let O=qQe(e,x,t,y,f,i);l(O)&&(o.indicesPlan=O,r.indices=O.indices)}let T=a.EXT_structural_metadata,E=a.EXT_mesh_features,v=a.EXT_feature_metadata,S=l(v),I=a.NGA_gpm_local;l(E)?met(e,r,E,i):S&&pet(e,r,v,i),l(T)?get(r,T):S&&_et(e,r,v),l(I)&&yet(r,I);let R=t.mode;if(g&&R!==Oe.TRIANGLES)throw new oe("Only triangle meshes can be used for classification.");return r.primitiveType=R,r}function fet(e,t){let n=t.indices,i=e.gltfJson.accessors[n];return LD(e,i,!1)}function det(e,t,n){let i=new EQe,r=e.gltfJson.accessors;return i.count=n.count,t.mode===Oe.LINE_LOOP?(i.loopIndices=Oh(e,r[t.indices]),i.loopIndicesOffsets=Oh(e,r[n.indicesOffsets]),i.triangleIndices=Oh(e,r[n.triangleIndices]),i.triangleIndicesOffsets=Oh(e,r[n.triangleIndicesOffsets])):t.mode===Oe.TRIANGLES&&(i.loopIndices=Oh(e,r[n.loopIndices]),i.loopIndicesOffsets=Oh(e,r[n.loopIndicesOffsets]),i.triangleIndices=Oh(e,r[t.indices]),i.triangleIndicesOffsets=Oh(e,r[n.indicesOffsets])),i}function het(e,t){if(!l(t))return;let n=new TQe;n.vector=t.vector,n.count=t.count;let i=e.gltfJson.accessors;function r(o,s){if(l(o))return LD(e,i[o])}return n.polygonAttributeOffsets=r(t.polygonAttributeOffsets,"polygonAttributeOffsets"),n.polygonHoleCounts=r(t.polygonHoleCounts,"polygonHoleCounts"),n.polygonHoleOffsets=r(t.polygonHoleOffsets,"polygonHoleOffsets"),n.polygonIndicesOffsets=r(t.polygonIndicesOffsets,"polygonIndicesOffsets"),n}function met(e,t,n,i){let r;l(n)&&l(n.featureIds)?r=n.featureIds:r=[];for(let o=0;o<r.length;o++){let s=r[o],a=`featureId_${o}`,c;l(s.texture)?c=net(e,s,i,a):l(s.attribute)?c=X0e(s,a):c=$0e(s,a),t.featureIds.push(c)}}function pet(e,t,n,i){let{featureTables:r}=e.gltfJson.extensions.EXT_feature_metadata,o=0,s=n.featureIdAttributes;if(l(s))for(let c=0;c<s.length;++c){let u=s[c],f=u.featureTable,d=e._sortedPropertyTableIds.indexOf(f),p=r[f].count,g=`featureId_${o}`;o++;let m;l(u.featureIds.attribute)?m=K0e(u,d,p,g):m=J0e(u,d,p,g),t.featureIds.push(m)}let a=n.featureIdTextures;if(l(a))for(let c=0;c<a.length;++c){let u=a[c],f=u.featureTable,d=e._sortedPropertyTableIds.indexOf(f),p=r[f].count,g=`featureId_${o}`;o++;let m=iet(e,u,d,i,p,g);t.featureIds.push(m)}}function get(e,t){if(!l(t))return;let{propertyTextures:n,propertyAttributes:i}=t;l(n)&&(e.propertyTextureIds=n),l(i)&&(e.propertyAttributeIds=i)}function _et(e,t,n){l(n.featureTextures)&&(t.propertyTextureIds=n.featureTextures.map(function(i){return e._sortedFeatureTextureIds.indexOf(i)}))}function yet(e,t){let n=t.ppeTextures??[];for(let i=0;i<n.length;i++)e.propertyTextureIds.push(i)}function Aet(e,t,n){let i=t.EXT_mesh_gpu_instancing,r=new iQe,o=i.attributes;if(l(o))for(let u in o){if(!o.hasOwnProperty(u))continue;let f=o[u];r.attributes.push(WQe(e,f,o,u,n))}let s=i.extensions??H.EMPTY_OBJECT,a=t.EXT_instance_features,c=s.EXT_feature_metadata;return l(a)?bet(r,a):l(c)&&xet(e.gltfJson,r,c,e._sortedPropertyTableIds),r}function bet(e,t){let n=t.featureIds;for(let i=0;i<n.length;i++){let r=n[i],o=`instanceFeatureId_${i}`,s;l(r.attribute)?s=X0e(r,o):s=$0e(r,o),e.featureIds.push(s)}}function xet(e,t,n,i){let r=e.extensions.EXT_feature_metadata.featureTables,o=n.featureIdAttributes;if(l(o))for(let s=0;s<o.length;++s){let a=o[s],c=a.featureTable,u=i.indexOf(c),f=r[c].count,d=`instanceFeatureId_${s}`,p;l(a.featureIds.attribute)?p=K0e(a,u,f,d):p=J0e(a,u,f,d),t.featureIds.push(p)}}function Tet(e,t,n){let i=new oQe;i.name=t.name,i.matrix=wu(M,t.matrix),i.translation=wu(h,t.translation),i.rotation=wu(Le,t.rotation),i.scale=wu(h,t.scale);let r=t.extensions??H.EMPTY_OBJECT,o=r.EXT_mesh_gpu_instancing,s=r.AGI_articulations,a=r.CESIUM_mesh_vector;if(l(o)){if(e._loadForClassification)throw new oe("Models with the EXT_mesh_gpu_instancing extension cannot be used for classification.");i.instances=Aet(e,r,n)}l(s)&&(i.articulationName=s.articulationName),l(a)&&(i.meshVector=a);let c=t.mesh;if(l(c)){let u=e.gltfJson.meshes[c],f=AU(u);for(let g=0;g<f.length;++g)i.primitives.push(uet(e,f[g],l(i.instances),n));let d=t.weights??u.weights,p=i.primitives[0].morphTargets;i.morphWeights=l(d)?d.slice():new Array(p.length).fill(0)}return i}function Eet(e,t){let n=e.gltfJson.nodes;if(!l(n))return[];let i=n.map(function(r,o){let s=Tet(e,r,t);return s.index=o,s});for(let r=0;r<i.length;++r){let o=n[r].children;if(l(o))for(let s=0;s<o.length;++s)i[r].children.push(i[o[s]])}return i}function Cet(e,t,n){let i=new rQe,r=t.joints;i.joints=r.map(s=>n[s]);let o=t.inverseBindMatrices;if(l(o)){let s=e.gltfJson.accessors[o];i.inverseBindMatrices=LD(e,s)}else i.inverseBindMatrices=new Array(r.length).fill(M.IDENTITY);return i}function vet(e,t){let n=e.gltfJson.skins;if(e._loadForClassification||!l(n))return[];let i=n.map(function(o,s){let a=Cet(e,o,t);return a.index=s,a}),r=e.gltfJson.nodes;for(let o=0;o<t.length;++o){let s=r[o].skin;l(s)&&(t[o].skin=i[s])}return i}async function wet(e,t,n,i){let r=new sU({gltf:e.gltfJson,extension:t,extensionLegacy:n,gltfResource:e._gltfResource,baseResource:e._baseResource,supportedImageFormats:e._supportedImageFormats,frameState:i,asynchronous:e._asynchronous});return e._structuralMetadataLoader=r,r.load()}async function Iet(e,t,n,i){let r=new yU({gltf:t,extension:n,gltfResource:e._gltfResource,baseResource:e._baseResource,supportedImageFormats:e._supportedImageFormats,frameState:i,asynchronous:e._asynchronous});return e._meshPrimitiveGpmLoader=r,r.load()}function Pet(e,t){let n=new aQe,i=e.gltfJson.accessors,r=i[t.input];n.input=LD(e,r);let o=t.interpolation;n.interpolation=mp[o]??mp.LINEAR;let s=i[t.output];return n.output=LD(e,s,!0),n}function Det(e,t){let n=new cQe,i=e.node;if(!l(i))return;n.node=t[i];let r=e.path.toUpperCase();return n.path=sQe[r],n}function Ret(e,t,n){let i=new lQe,r=e.sampler;return i.sampler=t[r],i.target=Det(e.target,n),i}function Oet(e,t,n){let i=new uQe;i.name=t.name;let r=t.samplers.map(function(s,a){let c=Pet(e,s);return c.index=a,c}),o=t.channels.map(function(s){return Ret(s,r,n)});return i.samplers=r,i.channels=o,i}function Met(e,t){let n=e.gltfJson.animations;return e._loadForClassification||!l(n)?[]:n.map(function(r,o){let s=Oet(e,r,t);return s.index=o,s})}function Net(e){let t=new fQe;t.name=e.name;let n=e.type.toUpperCase();return t.type=Ll[n],t.minimumValue=e.minimumValue,t.maximumValue=e.maximumValue,t.initialValue=e.initialValue,t}function Let(e){let t=new dQe;return t.name=e.name,t.stages=e.stages.map(Net),t}function Fet(e){let n=(e.extensions??H.EMPTY_OBJECT).AGI_articulations?.articulations;return l(n)?n.map(Let):[]}function Bet(e){let t;return l(e.scenes)&&l(e.scene)&&(t=e.scenes[e.scene].nodes),t=t??e.nodes,t=l(t)?t:[],t}function ket(e,t){let n=new mQe,i=Bet(e);return n.nodes=i.map(function(r){return t[r]}),n}var Uet=new h;function zet(e,t){let n=e.gltfJson,i=n.extensions??H.EMPTY_OBJECT,r=i.EXT_structural_metadata,o=i.EXT_feature_metadata,s=i.CESIUM_RTC;if(l(o)){let x=o.featureTables,T=o.featureTextures,E=l(x)?x:[],v=l(T)?T:[];e._sortedPropertyTableIds=Object.keys(E).sort(),e._sortedFeatureTextureIds=Object.keys(v).sort()}let a=Eet(e,t),c=vet(e,a),u=Met(e,a),f=Fet(n),d=ket(n,a),p=new pQe,g=new hQe,m=n.asset.copyright;if(l(m)){let x=m.split(";").map(function(T){return new It(T.trim())});g.credits=x}if(p.asset=g,p.scene=d,p.nodes=a,p.skins=c,p.animations=u,p.articulations=f,p.upAxis=e._upAxis,p.forwardAxis=e._forwardAxis,l(s)){let x=h.fromArray(s.center,0,Uet);p.transform=M.fromTranslation(x,p.transform)}if(e._components=p,l(r)||l(o)){let x=wet(e,r,o,t);e._loaderPromises.push(x)}let y=i.NGA_gpm_local;if(l(y)){let x=mU.load(y);e._components.extensions.NGA_gpm_local=x}let A=n.meshes;if(l(A))for(let x of A){let T=x.primitives;if(l(T))for(let E of T){let v=E.extensions;if(l(v)){let S=v.NGA_gpm_local;if(l(S)){let I=Iet(e,n,S,t);e._loaderPromises.push(I)}}}}let b=[];return Zn(b,e._loaderPromises),e._incrementallyLoadTextures||Zn(b,e._texturesPromises),Promise.all(b)}function Vet(e){let t=e._textureLoaders;for(let n=0;n<t.length;++n)t[n]=!t[n].isDestroyed()&&Bi.unload(t[n]);e._textureLoaders.length=0}function z0e(e){let t=e._bufferViewLoaders;for(let n=0;n<t.length;++n)t[n]=!t[n].isDestroyed()&&Bi.unload(t[n]);e._bufferViewLoaders.length=0}function jet(e){let t=e._geometryLoaders;for(let n=0;n<t.length;++n)t[n]=!t[n].isDestroyed()&&Bi.unload(t[n]);e._geometryLoaders.length=0}function Het(e){let t=e._postProcessBuffers;for(let n=0;n<t.length;n++){let i=t[n];i.isDestroyed()||i.destroy()}t.length=0}function Get(e){l(e._structuralMetadataLoader)&&!e._structuralMetadataLoader.isDestroyed()&&(e._structuralMetadataLoader.destroy(),e._structuralMetadataLoader=void 0)}function Wet(e){l(e._meshPrimitiveGpmLoader)&&!e._meshPrimitiveGpmLoader.isDestroyed()&&(e._meshPrimitiveGpmLoader.destroy(),e._meshPrimitiveGpmLoader=void 0)}var _d=nJ;var xU=`uniform sampler2D u_pointCloud_colorGBuffer; +2\0\0\0f\0\x004v\0A\xA4\xCD\v\0A\xB4\xCD\v\b\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\0A\xF8\xCD\vhf`)),ce((await B(ne)).instance))})(),(function(){function ce(){var ne;if(o.calledRun=!0,!m){if(C=!0,x_.H(),A?.(o),(ne=o.onRuntimeInitialized)==null||ne.call(o),o.postRun)for(typeof o.postRun=="function"&&(o.postRun=[o.postRun]);o.postRun.length;){var Te=o.postRun.shift();k.push(Te)}j(k)}}if(o.preRun)for(typeof o.preRun=="function"&&(o.preRun=[o.preRun]);o.preRun.length;)q();j(G),o.setStatus?(o.setStatus("Running..."),setTimeout(()=>{setTimeout(()=>o.setStatus(""),1),ce()},1)):ce()})(),C?r=o:r=new Promise((ce,ne)=>{A=ce,b=ne}),r}var Dv=(e,t,n)=>{let i=e.vf32_ptr(t),r=t.size(),o=i>>2,s=e.HEAPF32.slice(o,o+r);if(n!==void 0)for(let a=0;a<r;a++)s[a]=n(s[a]);return s},Ett=e=>1/(1+Math.exp(-e)),Ctt=e=>t=>t*e+.5,vtt=(e,t,n)=>{let i=n?.colorScaleFactor??.282;return{numPoints:t.numPoints,shDegree:t.shDegree,antialiased:t.antialiased,positions:Dv(e,t.positions),scales:Dv(e,t.scales,Math.exp),rotations:Dv(e,t.rotations),alphas:Dv(e,t.alphas,Ett),colors:Dv(e,t.colors,Ctt(i)),sh:Dv(e,t.sh)}},Stt=(e,t)=>{e._free(e.vf32_ptr(t.positions)),e._free(e.vf32_ptr(t.scales)),e._free(e.vf32_ptr(t.rotations)),e._free(e.vf32_ptr(t.alphas)),e._free(e.vf32_ptr(t.colors)),e._free(e.vf32_ptr(t.sh))},Bye=async(e,t)=>{var n;let i=await Ttt(),r=e instanceof Uint8Array?e:new Uint8Array(e),o=null;try{if(o=i._malloc(Uint8Array.BYTES_PER_ELEMENT*r.length),o===null)throw new Error("couldn't allocate memory");i.HEAPU8.set(r,o/Uint8Array.BYTES_PER_ELEMENT);let s=i.CoordinateSystem[((n=t?.unpackOptions)==null?void 0:n.coordinateSystem)??"UNSPECIFIED"],a=i.load_spz(o,r.length,{coordinateSystem:s}),c=vtt(i,a,t);return Stt(i,a),c}catch(s){throw s}finally{o!==null&&i._free(o)}};var wtt=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"}));var Itt=[0,9,24,45],Ptt=14,Dtt=1.6*1024*1024*1024;function Rtt(e,t){let n=t?.attributes;if(!l(n))return;let i=n.POSITION;if(!l(i))return;let r=e?.accessors?.[i];if(!l(r)||r.count<=0)return;let o=0;for(let s in n)if(Object.prototype.hasOwnProperty.call(n,s)){let a=/SH_DEGREE_(\d+)_COEF_/.exec(s);a&&(o=Math.max(o,parseInt(a[1],10)))}return{numPoints:r.count,shDegree:o}}function Ott(e,t){let n=Ptt+(Itt[t]??0);return e*n*Float32Array.BYTES_PER_ELEMENT*2}var LJ=class extends cr{constructor(t){super(),t=t??H.EMPTY_OBJECT;let n=t.resourceCache,i=t.gltf,r=t.primitive,o=t.spz,s=t.gltfResource,a=t.baseResource,c=t.cacheKey;this._resourceCache=n,this._gltfResource=s,this._baseResource=a,this._gltf=i,this._primitive=r,this._spz=o,this._cacheKey=c,this._bufferViewLoader=void 0,this._bufferViewTypedArray=void 0,this._decodePromise=void 0,this._decodedData=void 0,this._state=Ct.UNLOADED,this._promise=void 0,this._spzError=void 0}get cacheKey(){return this._cacheKey}get decodedData(){return this._decodedData}async load(){return l(this._promise)?this._promise:(this._state=Ct.LOADING,this._promise=Mtt(this),this._promise)}process(t){if(this._state===Ct.READY)return!0;if(this._state!==Ct.PROCESSING||(l(this._spzError)&&FJ(this,this._spzError),!l(this._bufferViewTypedArray))||l(this._decodePromise))return!1;let n=Rtt(this._gltf,this._primitive);if(l(n)){let r=Ott(n.numPoints,n.shDegree);if(r>Dtt){let o=Math.round(r/1048576);return FJ(this,new oe(`SPZ data too large to decode: ${n.numPoints.toLocaleString()} splats with spherical harmonics degree ${n.shDegree} would require approximately ${o} MB, which exceeds the WASM memory limit. Consider using a lower spherical harmonics degree or splitting the dataset into smaller tiles.`)),!1}}let i=Bye(this._bufferViewTypedArray,{unpackOptions:{coordinateSystem:"UNSPECIFIED"}});if(!l(i))return!1;this._decodePromise=Ntt(this,i)}unload(){l(this._bufferViewLoader)&&this._resourceCache.unload(this._bufferViewLoader),this._bufferViewLoader=void 0,this._bufferViewTypedArray=void 0,this._decodedData=void 0,this._gltf=void 0,this._primitive=void 0}};async function Mtt(e){let t=e._resourceCache;try{let n=t.getBufferViewLoader({gltf:e._gltf,bufferViewId:e._spz.bufferView,gltfResource:e._gltfResource,baseResource:e._baseResource});return e._bufferViewLoader=n,await n.load(),e.isDestroyed()?void 0:(e._bufferViewTypedArray=n.typedArray,e._state=Ct.PROCESSING,e)}catch(n){if(e.isDestroyed())return;FJ(e,n)}}function FJ(e,t){throw e.unload(),e._state=Ct.FAILED,e.getError("Failed to load SPZ",t)}async function Ntt(e,t){try{let n=await t;return e.isDestroyed()?void 0:(e.unload(),e._decodedData={gcloud:n},e._state=Ct.READY,e._baseResource)}catch(n){if(e.isDestroyed())return;e._spzError=n}}var XU=LJ;function e1(e){e=e??H.EMPTY_OBJECT;let t=e.id,n=e.properties??{},i={};for(let r in n)if(n.hasOwnProperty(r)){let o=n[r];l(o.semantic)&&(i[o.semantic]=o)}this._id=t,this._name=e.name,this._description=e.description,this._properties=n,this._propertiesBySemantic=i,this._extras=Ze(e.extras,!0),this._extensions=Ze(e.extensions,!0)}e1.fromJson=function(e){e=e??H.EMPTY_OBJECT;let t=e.id,n=e.class,i={};for(let r in n.properties)if(n.properties.hasOwnProperty(r)){let o=lg.fromJson({id:r,property:n.properties[r],enums:e.enums});i[r]=o}return new e1({id:t,name:n.name,description:n.description,properties:i,extras:n.extras,extensions:n.extensions})};Object.defineProperties(e1.prototype,{properties:{get:function(){return this._properties}},propertiesBySemantic:{get:function(){return this._propertiesBySemantic}},id:{get:function(){return this._id}},name:{get:function(){return this._name}},description:{get:function(){return this._description}},extras:{get:function(){return this._extras}},extensions:{get:function(){return this._extensions}}});e1.BATCH_TABLE_CLASS_NAME="_batchTable";var Tp=e1;function KU(e){e=e??H.EMPTY_OBJECT;let t=e.value,n=e.name;this._value=t,this._name=n,this._description=e.description,this._extras=Ze(e.extras,!0),this._extensions=Ze(e.extensions,!0)}KU.fromJson=function(e){return new KU({value:e.value,name:e.name,description:e.description,extras:e.extras,extensions:e.extensions})};Object.defineProperties(KU.prototype,{value:{get:function(){return this._value}},name:{get:function(){return this._name}},description:{get:function(){return this._description}},extras:{get:function(){return this._extras}},extensions:{get:function(){return this._extensions}}});var $U=KU;function JU(e){e=e??H.EMPTY_OBJECT;let t=e.id,n=e.values,i={},r={},o=n.length;for(let a=0;a<o;++a){let c=n[a];i[c.value]=c.name,r[c.name]=c.value}let s=e.valueType??Lt.UINT16;this._values=n,this._namesByValue=i,this._valuesByName=r,this._valueType=s,this._id=t,this._name=e.name,this._description=e.description,this._extras=Ze(e.extras,!0),this._extensions=Ze(e.extensions,!0)}JU.fromJson=function(e){e=e??H.EMPTY_OBJECT;let t=e.id,n=e.enum,i=n.values.map(function(r){return $U.fromJson(r)});return new JU({id:t,values:i,valueType:Lt[n.valueType],name:n.name,description:n.description,extras:n.extras,extensions:n.extensions})};Object.defineProperties(JU.prototype,{values:{get:function(){return this._values}},namesByValue:{get:function(){return this._namesByValue}},valuesByName:{get:function(){return this._valuesByName}},valueType:{get:function(){return this._valueType}},id:{get:function(){return this._id}},name:{get:function(){return this._name}},description:{get:function(){return this._description}},extras:{get:function(){return this._extras}},extensions:{get:function(){return this._extensions}}});var ZU=JU;function QU(e){e=e??H.EMPTY_OBJECT;let t=e.classes??{},n=e.enums??{};this._classes=t,this._enums=n,this._id=e.id,this._name=e.name,this._description=e.description,this._version=e.version,this._extras=Ze(e.extras,!0),this._extensions=Ze(e.extensions,!0)}QU.fromJson=function(e){let t={};if(l(e.enums))for(let i in e.enums)e.enums.hasOwnProperty(i)&&(t[i]=ZU.fromJson({id:i,enum:e.enums[i]}));let n={};if(l(e.classes))for(let i in e.classes)e.classes.hasOwnProperty(i)&&(n[i]=Tp.fromJson({id:i,class:e.classes[i],enums:t}));return new QU({id:e.id,name:e.name,description:e.description,version:e.version,classes:n,enums:t,extras:e.extras,extensions:e.extensions})};Object.defineProperties(QU.prototype,{classes:{get:function(){return this._classes}},enums:{get:function(){return this._enums}},id:{get:function(){return this._id}},name:{get:function(){return this._name}},description:{get:function(){return this._description}},version:{get:function(){return this._version}},extras:{get:function(){return this._extras}},extensions:{get:function(){return this._extensions}}});var Su=QU;var BJ=class extends cr{constructor(t){super(),t=t??H.EMPTY_OBJECT;let n=t.schema,i=t.resource,r=t.cacheKey;this._schema=l(n)?Su.fromJson(n):void 0,this._resource=i,this._cacheKey=r,this._state=Ct.UNLOADED,this._promise=void 0}get cacheKey(){return this._cacheKey}get schema(){return this._schema}async load(){return l(this._promise)?this._promise:l(this._schema)?(this._promise=Promise.resolve(this),this._promise):(this._promise=Ltt(this),this._promise)}unload(){this._schema=void 0}};async function Ltt(e){let t=e._resource;e._state=Ct.LOADING;try{let n=await t.fetchJson();return e.isDestroyed()?void 0:(e._schema=Su.fromJson(n),e._state=Ct.READY,e)}catch(n){if(e.isDestroyed())return;e._state=Ct.FAILED;let i=`Failed to load schema: ${t.url}`;throw e.getError(i,n)}}var gx=BJ;var Sd={};function Rv(e){return fh(e.url)}function t1(e){let{byteOffset:t,byteLength:n}=e,i=ux(e);return l(i)&&(t=i.byteOffset??0,n=i.byteLength),`${t}-${t+n}`}function Ftt(e,t){let n=t.byteOffset+e.byteOffset,{componentType:i,type:r,count:o}=e;return`${n}-${i}-${r}-${o}`}function kye(e,t){return`${Rv(e)}-buffer-id-${t}`}function Ov(e,t,n,i){if(l(e.uri)){let r=i.getDerivedResource({url:e.uri});return Rv(r)}return kye(n,t)}function kJ(e,t,n,i){let r=t.bufferView,o=e.bufferViews[r],s=o.buffer,a=e.buffers[s],c=Ov(a,s,n,i),u=t1(o);return`${c}-range-${u}`}function Uye(e,t,n,i){let r=t.bufferView,o=e.bufferViews[r],s=o.buffer,a=e.buffers[s],c=Ov(a,s,n,i),u=t1(o);return`${c}-range-${u}`}function zye(e,t,n,i){let r=e.images[t],o=r.bufferView,s=r.uri;if(l(s)){let p=i.getDerivedResource({url:s});return Rv(p)}let a=e.bufferViews[o],c=a.buffer,u=e.buffers[c],f=Ov(u,c,n,i),d=t1(a);return`${f}-range-${d}`}function Btt(e,t){let n=gf.createSampler({gltf:e,textureInfo:t});return`${n.wrapS}-${n.wrapT}-${n.minificationFilter}-${n.magnificationFilter}`}Sd.getSchemaCacheKey=function(e){let{schema:t,resource:n}=e;return l(t)?`embedded-schema:${JSON.stringify(t)}`:`external-schema:${Rv(n)}`};Sd.getExternalBufferCacheKey=function(e){e=e??H.EMPTY_OBJECT;let{resource:t}=e;return`external-buffer:${Rv(t)}`};Sd.getEmbeddedBufferCacheKey=function(e){e=e??H.EMPTY_OBJECT;let{parentResource:t,bufferId:n}=e;return`embedded-buffer:${kye(t,n)}`};Sd.getGltfCacheKey=function(e){e=e??H.EMPTY_OBJECT;let{gltfResource:t}=e;return`gltf:${Rv(t)}`};Sd.getBufferViewCacheKey=function(e){e=e??H.EMPTY_OBJECT;let{gltf:t,bufferViewId:n,gltfResource:i,baseResource:r}=e,o=t.bufferViews[n],s=o.buffer,a=t.buffers[s],c=ux(o);l(c)&&(s=c.buffer);let u=Ov(a,s,i,r),f=t1(o);return`buffer-view:${u}-range-${f}`};Sd.getDracoCacheKey=function(e){e=e??H.EMPTY_OBJECT;let{gltf:t,draco:n,gltfResource:i,baseResource:r}=e;return`draco:${kJ(t,n,i,r)}`};Sd.getSpzCacheKey=function(e){e=e??H.EMPTY_OBJECT;let{gltf:t,spz:n,gltfResource:i,baseResource:r}=e;return`spz:${Uye(t,n,i,r)}`};Sd.getVertexBufferCacheKey=function(e){e=e??H.EMPTY_OBJECT;let{gltf:t,gltfResource:n,baseResource:i,frameState:r,bufferViewId:o,draco:s,spz:a,attributeSemantic:c,dequantize:u=!1,loadBuffer:f=!1,loadTypedArray:d=!1}=e,p="";if(u&&(p+="-dequantize"),f&&(p+="-buffer",p+=`-context-${r.context.id}`),d&&(p+="-typed-array"),l(a))return`vertex-buffer:${Uye(t,a,n,i)}-spz-${c}${p}`;if(l(s))return`vertex-buffer:${kJ(t,s,n,i)}-draco-${c}${p}`;let g=t.bufferViews[o],m=g.buffer,y=t.buffers[m],A=Ov(y,m,n,i),b=t1(g);return`vertex-buffer:${A}-range-${b}${p}`};Sd.getIndexBufferCacheKey=function(e){e=e??H.EMPTY_OBJECT;let{gltf:t,accessorId:n,gltfResource:i,baseResource:r,frameState:o,draco:s,loadBuffer:a=!1,loadTypedArray:c=!1}=e,u="";if(a&&(u+="-buffer",u+=`-context-${o.context.id}`),c&&(u+="-typed-array"),l(s))return`index-buffer:${kJ(t,s,i,r)}-draco${u}`;let f=t.accessors[n],d=f.bufferView,p=t.bufferViews[d],g=p.buffer,m=t.buffers[g],y=Ov(m,g,i,r),A=Ftt(f,p);return`index-buffer:${y}-accessor-${A}${u}`};Sd.getImageCacheKey=function(e){e=e??H.EMPTY_OBJECT;let{gltf:t,imageId:n,gltfResource:i,baseResource:r}=e;return`image:${zye(t,n,i,r)}`};Sd.getTextureCacheKey=function(e){e=e??H.EMPTY_OBJECT;let{gltf:t,textureInfo:n,gltfResource:i,baseResource:r,supportedImageFormats:o,frameState:s}=e,a=n.index,c=gf.getImageIdFromTexture({gltf:t,textureId:a,supportedImageFormats:o}),u=zye(t,c,i,r),f=Btt(t,n);return`texture:${u}-sampler-${f}-context-${s.context.id}`};var wu=Sd;function n1(){this.geometryByteLength=0,this.texturesByteLength=0,this._geometrySizes={},this._textureSizes={}}n1.prototype.clear=function(){this.geometryByteLength=0,this.texturesByteLength=0,this._geometrySizes={},this._textureSizes={}};n1.prototype.addGeometryLoader=function(e){let t=e.cacheKey;if(this._geometrySizes.hasOwnProperty(t))return;this._geometrySizes[t]=0;let n=e.buffer,i=e.typedArray,r=0;l(n)&&(r+=n.sizeInBytes),l(i)&&(r+=i.byteLength),this.geometryByteLength+=r,this._geometrySizes[t]=r};n1.prototype.addTextureLoader=function(e){let t=e.cacheKey;if(this._textureSizes.hasOwnProperty(t))return;this._textureSizes[t]=0;let n=e.texture.sizeInBytes;this.texturesByteLength+=e.texture.sizeInBytes,this._textureSizes[t]=n};n1.prototype.removeLoader=function(e){let t=e.cacheKey,n=this._geometrySizes[t];delete this._geometrySizes[t],l(n)&&(this.geometryByteLength-=n);let i=this._textureSizes[t];delete this._textureSizes[t],l(i)&&(this.texturesByteLength-=i)};var ez=n1;function Nn(){}Nn.cacheEntries={};Nn.statistics=new ez;function ktt(e){this.referenceCount=1,this.resourceLoader=e,this._statisticsPromise=void 0}Nn.get=function(e){let t=Nn.cacheEntries[e];if(l(t))return++t.referenceCount,t.resourceLoader};Nn.add=function(e){let t=e.cacheKey;return Nn.cacheEntries[t]=new ktt(e),e};Nn.unload=function(e){let t=e.cacheKey,n=Nn.cacheEntries[t];--n.referenceCount,n.referenceCount===0&&(Nn.statistics.removeLoader(e),e.destroy(),delete Nn.cacheEntries[t])};Nn.getSchemaLoader=function(e){e=e??H.EMPTY_OBJECT;let{schema:t,resource:n}=e,i=wu.getSchemaCacheKey({schema:t,resource:n}),r=Nn.get(i);return l(r)?r:(r=new gx({schema:t,resource:n,cacheKey:i}),Nn.add(r))};Nn.getEmbeddedBufferLoader=function(e){e=e??H.EMPTY_OBJECT;let{parentResource:t,bufferId:n,typedArray:i}=e,r=wu.getEmbeddedBufferCacheKey({parentResource:t,bufferId:n}),o=Nn.get(r);return l(o)?o:(o=new vv({typedArray:i,cacheKey:r}),Nn.add(o))};Nn.getExternalBufferLoader=function(e){e=e??H.EMPTY_OBJECT;let{resource:t}=e,n=wu.getExternalBufferCacheKey({resource:t}),i=Nn.get(n);return l(i)?i:(i=new vv({resource:t,cacheKey:n}),Nn.add(i))};Nn.getGltfJsonLoader=function(e){e=e??H.EMPTY_OBJECT;let{gltfResource:t,baseResource:n,typedArray:i,gltfJson:r}=e,o=wu.getGltfCacheKey({gltfResource:t}),s=Nn.get(o);return l(s)?s:(s=new JD({resourceCache:Nn,gltfResource:t,baseResource:n,typedArray:i,gltfJson:r,cacheKey:o}),Nn.add(s))};Nn.getBufferViewLoader=function(e){e=e??H.EMPTY_OBJECT;let{gltf:t,bufferViewId:n,gltfResource:i,baseResource:r}=e,o=wu.getBufferViewCacheKey({gltf:t,bufferViewId:n,gltfResource:i,baseResource:r}),s=Nn.get(o);return l(s)?s:(s=new WD({resourceCache:Nn,gltf:t,bufferViewId:n,gltfResource:i,baseResource:r,cacheKey:o}),Nn.add(s))};Nn.getDracoLoader=function(e){e=e??H.EMPTY_OBJECT;let{gltf:t,primitive:n,draco:i,gltfResource:r,baseResource:o}=e,s=wu.getDracoCacheKey({gltf:t,draco:i,gltfResource:r,baseResource:o}),a=Nn.get(s);return l(a)?a:(a=new qD({resourceCache:Nn,gltf:t,primitive:n,draco:i,gltfResource:r,baseResource:o,cacheKey:s}),Nn.add(a))};Nn.getSpzLoader=function(e){e=e??H.EMPTY_OBJECT;let{gltf:t,primitive:n,spz:i,gltfResource:r,baseResource:o}=e,s=wu.getSpzCacheKey({gltf:t,spz:i,gltfResource:r,baseResource:o}),a=Nn.get(s);return l(a)?a:(a=new XU({resourceCache:Nn,gltf:t,primitive:n,spz:i,gltfResource:r,baseResource:o,cacheKey:s}),Nn.add(a))};Nn.getVertexBufferLoader=function(e){e=e??H.EMPTY_OBJECT;let{gltf:t,gltfResource:n,baseResource:i,frameState:r,bufferViewId:o,primitive:s,draco:a,spz:c,attributeSemantic:u,accessorId:f,asynchronous:d=!0,dequantize:p=!1,loadBuffer:g=!1,loadTypedArray:m=!1}=e,y=wu.getVertexBufferCacheKey({gltf:t,gltfResource:n,baseResource:i,frameState:r,bufferViewId:o,draco:a,spz:c,attributeSemantic:u,dequantize:p,loadBuffer:g,loadTypedArray:m}),A=Nn.get(y);return l(A)?A:(A=new QD({resourceCache:Nn,gltf:t,gltfResource:n,baseResource:i,bufferViewId:o,primitive:s,draco:a,spz:c,attributeSemantic:u,accessorId:f,cacheKey:y,asynchronous:d,dequantize:p,loadBuffer:g,loadTypedArray:m}),Nn.add(A))};Nn.getIndexBufferLoader=function(e){e=e??H.EMPTY_OBJECT;let{gltf:t,accessorId:n,gltfResource:i,baseResource:r,frameState:o,primitive:s,draco:a,asynchronous:c=!0,loadBuffer:u=!1,loadTypedArray:f=!1}=e,d=wu.getIndexBufferCacheKey({gltf:t,accessorId:n,gltfResource:i,baseResource:r,frameState:o,draco:a,loadBuffer:u,loadTypedArray:f}),p=Nn.get(d);return l(p)?p:(p=new KD({resourceCache:Nn,gltf:t,accessorId:n,gltfResource:i,baseResource:r,primitive:s,draco:a,cacheKey:d,asynchronous:c,loadBuffer:u,loadTypedArray:f}),Nn.add(p))};Nn.getImageLoader=function(e){e=e??H.EMPTY_OBJECT;let{gltf:t,imageId:n,gltfResource:i,baseResource:r}=e,o=wu.getImageCacheKey({gltf:t,imageId:n,gltfResource:i,baseResource:r}),s=Nn.get(o);return l(s)?s:(s=new XD({resourceCache:Nn,gltf:t,imageId:n,gltfResource:i,baseResource:r,cacheKey:o}),Nn.add(s))};Nn.getTextureLoader=function(e){e=e??H.EMPTY_OBJECT;let{gltf:t,textureInfo:n,gltfResource:i,baseResource:r,supportedImageFormats:o,frameState:s,asynchronous:a=!0}=e,c=wu.getTextureCacheKey({gltf:t,textureInfo:n,gltfResource:i,baseResource:r,supportedImageFormats:o,frameState:s}),u=Nn.get(c);return l(u)?u:(u=new ZD({resourceCache:Nn,gltf:t,textureInfo:n,gltfResource:i,baseResource:r,supportedImageFormats:o,cacheKey:c,asynchronous:a}),Nn.add(u))};Nn.clearForSpecs=function(){let e=[QD,KD,qD,ZD,XD,WD,vv,gx,JD],t,n=Nn.cacheEntries,i=[];for(t in n)n.hasOwnProperty(t)&&i.push(n[t]);i.sort(function(o,s){let a=e.indexOf(o.resourceLoader.constructor),c=e.indexOf(s.resourceLoader.constructor);return a-c});let r=i.length;for(let o=0;o<r;++o){let s=i[o];t=s.resourceLoader.cacheKey,l(n[t])&&(s.resourceLoader.destroy(),delete n[t])}Nn.statistics.clear()};var ki=Nn;var UJ=class extends cr{constructor(t){super(),t=t??H.EMPTY_OBJECT;let{gltf:n,extension:i,extensionLegacy:r,gltfResource:o,baseResource:s,supportedImageFormats:a,frameState:c,cacheKey:u,asynchronous:f=!0}=t;this._gltfResource=o,this._baseResource=s,this._gltf=n,this._extension=i,this._extensionLegacy=r,this._supportedImageFormats=a,this._frameState=c,this._cacheKey=u,this._asynchronous=f,this._bufferViewLoaders=[],this._bufferViewIds=[],this._textureLoaders=[],this._textureIds=[],this._schemaLoader=void 0,this._structuralMetadata=void 0,this._state=Ct.UNLOADED,this._promise=void 0}get cacheKey(){return this._cacheKey}get structuralMetadata(){return this._structuralMetadata}load(){return l(this._promise)?this._promise:(this._state=Ct.LOADING,this._promise=Utt(this),this._promise)}process(t){if(this._state===Ct.READY)return!0;if(this._state!==Ct.LOADED)return!1;let n=this._textureLoaders,i=n.length,r=!0;for(let c=0;c<i;++c){let f=n[c].process(t);r=r&&f}if(!r)return!1;let o=this._schemaLoader.schema,s={};for(let c=0;c<this._bufferViewIds.length;++c){let u=this._bufferViewIds[c],f=this._bufferViewLoaders[c];if(!f.isDestroyed()){let d=new Uint8Array(f.typedArray);s[u]=d}}let a={};for(let c=0;c<this._textureIds.length;++c){let u=this._textureIds[c],f=n[c];f.isDestroyed()||(a[u]=f.texture)}return l(this._extension)?this._structuralMetadata=PU({extension:this._extension,schema:o,bufferViews:s,textures:a,context:t.context}):this._structuralMetadata=DU({extension:this._extensionLegacy,schema:o,bufferViews:s,textures:a}),Vye(this),this._state=Ct.READY,!0}unload(){Vye(this),Jtt(this),l(this._schemaLoader)&&ki.unload(this._schemaLoader),this._schemaLoader=void 0,l(this._structuralMetadata)&&this._structuralMetadata.destroy(),this._structuralMetadata=void 0}};async function Utt(e){try{let t=Gtt(e),n=Ktt(e),i=$tt(e);return await Promise.all([t,n,i]),e.isDestroyed()?void 0:(e._gltf=void 0,e._state=Ct.LOADED,e)}catch(t){if(e.isDestroyed())return;throw e.unload(),e._state=Ct.FAILED,e.getError("Failed to load structural metadata",t)}}function ztt(e,t){for(let n in e)if(e.hasOwnProperty(n)){let i=e[n],r=i.values,o=i.arrayOffsets,s=i.stringOffsets;l(r)&&(t[r]=!0),l(o)&&(t[o]=!0),l(s)&&(t[s]=!0)}}function Vtt(e,t){for(let n in e)if(e.hasOwnProperty(n)){let i=e[n],r=i.bufferView,o=i.arrayOffsetBufferView,s=i.stringOffsetBufferView;l(r)&&(t[r]=!0),l(o)&&(t[o]=!0),l(s)&&(t[s]=!0)}}function jtt(e){let t=e.propertyTables,n={};if(l(t))for(let i=0;i<t.length;i++){let r=t[i];ztt(r.properties,n)}return n}function Htt(e){let t=e.featureTables,n={};if(l(t)){for(let i in t)if(t.hasOwnProperty(i)){let o=t[i].properties;l(o)&&Vtt(o,n)}}return n}async function Gtt(e){let t;l(e._extension)?t=jtt(e._extension):t=Htt(e._extensionLegacy);let n=[];for(let i in t)if(t.hasOwnProperty(i)){let r=ki.getBufferViewLoader({gltf:e._gltf,bufferViewId:parseInt(i),gltfResource:e._gltfResource,baseResource:e._baseResource});e._bufferViewLoaders.push(r),e._bufferViewIds.push(i),n.push(r.load())}return Promise.all(n)}function Wtt(e){let t={},n=e.propertyTextures;if(l(n))for(let i=0;i<n.length;i++){let o=n[i].properties;l(o)&&qtt(o,t)}return t}function qtt(e,t){for(let n in e)if(e.hasOwnProperty(n)){let i=e[n];t[i.index]=i}}function Ytt(e){let t={},n=e.featureTextures;if(l(n)){for(let i in n)if(n.hasOwnProperty(i)){let o=n[i].properties;l(o)&&Xtt(o,t)}}return t}function Xtt(e,t){for(let n in e)if(e.hasOwnProperty(n)){let r=e[n].texture;t[r.index]=r}}function Ktt(e){let t;l(e._extension)?t=Wtt(e._extension):t=Ytt(e._extensionLegacy);let n=e._gltf,i=e._gltfResource,r=e._baseResource,o=e._supportedImageFormats,s=e._frameState,a=e._asynchronous,c=[];for(let u in t)if(t.hasOwnProperty(u)){let f=ki.getTextureLoader({gltf:n,textureInfo:t[u],gltfResource:i,baseResource:r,supportedImageFormats:o,frameState:s,asynchronous:a});e._textureLoaders.push(f),e._textureIds.push(u),c.push(f.load())}return Promise.all(c)}async function $tt(e){let t=e._extension??e._extensionLegacy,n;if(l(t.schemaUri)){let i=e._baseResource.getDerivedResource({url:t.schemaUri});n=ki.getSchemaLoader({resource:i})}else n=ki.getSchemaLoader({schema:t.schema});if(e._schemaLoader=n,await n.load(),!n.isDestroyed())return n.schema}function Vye(e){let t=e._bufferViewLoaders,n=t.length;for(let i=0;i<n;++i)ki.unload(t[i]);e._bufferViewLoaders.length=0,e._bufferViewIds.length=0}function Jtt(e){let t=e._textureLoaders,n=t.length;for(let i=0;i<n;++i)ki.unload(t[i]);e._textureLoaders.length=0,e._textureIds.length=0}var tz=UJ;function Ztt(e,t){return l(e)&&l(e.extensions)&&l(e.extensions[t])}var lr=Ztt;var _x={TRANSLATION:"TRANSLATION",ROTATION:"ROTATION",SCALE:"SCALE",FEATURE_ID:"_FEATURE_ID"};_x.fromGltfSemantic=function(e){let t=e,i=/^(\w+)_\d+$/.exec(e);switch(i!==null&&(t=i[1]),t){case"TRANSLATION":return _x.TRANSLATION;case"ROTATION":return _x.ROTATION;case"SCALE":return _x.SCALE;case"_FEATURE_ID":return _x.FEATURE_ID}};Object.freeze(_x);var Bo=_x;var Qtt=65534,ent=255;function nz(e){e=e??H.EMPTY_OBJECT;let t=e.triangleIndices,n=e.outlineIndices,i=e.originalVertexCount;this._triangleIndices=t,this._originalVertexCount=i,this._edges=new Gye(n,i),this._outlineCoordinatesTypedArray=void 0,this._extraVertices=[],tnt(this)}Object.defineProperties(nz.prototype,{updatedTriangleIndices:{get:function(){return this._triangleIndices}},outlineCoordinates:{get:function(){return this._outlineCoordinatesTypedArray}}});function tnt(e){let t=e._triangleIndices,n=e._edges,i=[],r=e._extraVertices,o=e._originalVertexCount,s={};for(let a=0;a<t.length;a+=3){let c=t[a],u=t[a+1],f=t[a+2],d=!1,p=d||n.hasEdge(c,u),g=d||n.hasEdge(u,f),m=d||n.hasEdge(f,c),y=jye(i,c,u,f,p,g,m);for(;l(y);){let A=s[y];if(!l(A)){A=o+r.length;let b=y;for(;b>=o;)b=r[b-o];r.push(b),s[y]=A}A>Qtt&&(t instanceof Uint16Array||t instanceof Uint8Array)?t=new Uint32Array(t):A>ent&&t instanceof Uint8Array&&(t=new Uint16Array(t)),y===c?(c=A,t[a]=A):y===u?(u=A,t[a+1]=A):(f=A,t[a+2]=A),y=jye(i,c,u,f,p,g,m)}}e._triangleIndices=t,e._outlineCoordinatesTypedArray=new Float32Array(i)}function jye(e,t,n,i,r,o,s){let a=s?1:0,c=r?1:0,u=0,f=zJ(e,t,a,c,u);if(f===0)return t;let d=0,p=r?1:0,g=o?1:0,m=zJ(e,n,d,p,g);if(m===0)return n;let y=s?1:0,A=0,b=o?1:0,x=zJ(e,i,y,A,b);if(x===0)return i;let T=f&m&x,E,v,S;if(T&1)E=0,v=1,S=2;else if(T&2)E=0,S=1,v=2;else if(T&4)v=0,E=1,S=2;else if(T&8)v=0,S=1,E=2;else if(T&16)S=0,E=1,v=2;else if(T&32)S=0,v=1,E=2;else{let L=VJ(f),_=VJ(m),C=VJ(x);return L<_&&L<C?t:_<C?n:i}let I=t*3;e[I+E]=a,e[I+v]=c,e[I+S]=u;let R=n*3;e[R+E]=d,e[R+v]=p,e[R+S]=g;let O=i*3;e[O+E]=y,e[O+v]=A,e[O+S]=b}function zJ(e,t,n,i,r){let o=t*3,s=e[o],a=e[o+1],c=e[o+2];return l(s)?(s===n&&a===i&&c===r)<<0|(s===n&&a===r&&c===i)<<1|(s===i&&a===n&&c===r)<<2|(s===i&&a===r&&c===n)<<3|(s===r&&a===n&&c===i)<<4|(s===r&&a===i&&c===n)<<5:63}function VJ(e){return(e&1)+(e>>1&1)+(e>>2&1)+(e>>3&1)+(e>>4&1)+(e>>5&1)}nz.prototype.updateAttribute=function(e){let t=this._extraVertices,n=e.length,i=n/this._originalVertexCount,r=t.length,o=e.constructor,s=new o(e.length+r*i);s.set(e);for(let a=0;a<r;a++){let c=t[a]*i,u=n+a*i;for(let f=0;f<i;f++)s[u+f]=s[c+f]}return s};nz.createTexture=function(e){let t=e.cache.modelOutliningCache;if(l(t)||(t=e.cache.modelOutliningCache={}),l(t.outlineTexture))return t.outlineTexture;let n=Math.min(4096,Ut.maximumTextureSize),i=n,r=Hye(i),o=[];for(;i>1;)i>>=1,o.push(Hye(i));let s=new Dt({context:e,source:{arrayBufferView:r,mipLevels:o},width:n,height:1,pixelFormat:$e.LUMINANCE,sampler:new Ht({wrapS:hn.CLAMP_TO_EDGE,wrapT:hn.CLAMP_TO_EDGE,minificationFilter:Wt.LINEAR_MIPMAP_LINEAR,magnificationFilter:Jn.LINEAR})});return t.outlineTexture=s,s};function Hye(e){let t=new Uint8Array(e);return t[e-1]=192,e===8?t[e-1]=96:e===4?t[e-1]=48:e===2?t[e-1]=24:e===1&&(t[e-1]=12),t}function Gye(e,t){this._originalVertexCount=t,this._edges=new Set;for(let n=0;n<e.length;n+=2){let i=e[n],r=e[n+1],o=Math.min(i,r),s=Math.max(i,r),a=o*this._originalVertexCount+s;this._edges.add(a)}}Gye.prototype.hasEdge=function(e,t){let n=Math.min(e,t),i=Math.max(e,t),r=n*this._originalVertexCount+i;return this._edges.has(r)};var Mv=nz;function Wye(e){this.attribute=e,this.loadBuffer=!1,this.loadTypedArray=!1}function nnt(e){this.indices=e,this.loadBuffer=!1,this.loadTypedArray=!1}function iz(e){this.primitive=e,this.attributePlans=[],this.indicesPlan=void 0,this.needsOutlines=!1,this.outlineIndices=void 0,this.needsGaussianSplats=!1}iz.prototype.postProcess=function(e){this.needsOutlines&&(int(this),snt(this,e)),this.needsGaussianSplats&&ont(this,e)};function int(e){let t=e.primitive,n=t.indices,i=t.attributes[0].count,r=new Mv({triangleIndices:n.typedArray,outlineIndices:e.outlineIndices,originalVertexCount:i});n.typedArray=r.updatedTriangleIndices,n.indexDatatype=je.fromTypedArray(n.typedArray);let o=rnt(r.outlineCoordinates),s=new Wye(o);s.loadBuffer=!0,s.loadTypedArray=!1,e.attributePlans.push(s),t.outlineCoordinates=s.attribute;let a=e.attributePlans,c=e.attributePlans.length;for(let u=0;u<c;u++){let f=a[u].attribute;f.typedArray=r.updateAttribute(f.typedArray)}}function rnt(e){let t=new vn.Attribute;return t.name="_OUTLINE_COORDINATES",t.typedArray=e,t.componentDatatype=Y.FLOAT,t.type=Vt.VEC3,t.normalized=!1,t.count=e.length/3,t}function ont(e,t){let n=e.attributePlans,i=n.length;for(let r=0;r<i;r++){let o=n[r];o.loadBuffer=!1,o.loadTypedArray=!0}}function snt(e,t){ant(e.attributePlans,t),l(e.indicesPlan)&&cnt(e.indicesPlan,t)}function ant(e,t){let n=e.length;for(let i=0;i<n;i++){let r=e[i],o=r.attribute,s=o.typedArray;if(r.loadBuffer){let a=tt.createVertexBuffer({typedArray:s,context:t,usage:Me.STATIC_DRAW});a.vertexArrayDestroyable=!1,o.buffer=a}r.loadTypedArray||(o.typedArray=void 0)}}function cnt(e,t){let n=e.indices;if(e.loadBuffer){let i=tt.createIndexBuffer({typedArray:n.typedArray,context:t,usage:Me.STATIC_DRAW,indexDatatype:n.indexDatatype});n.buffer=i,i.vertexArrayDestroyable=!1}e.loadTypedArray||(n.typedArray=void 0)}iz.AttributeLoadPlan=Wye;iz.IndicesLoadPlan=nnt;var Nv=iz;function lnt(e){e=e??H.EMPTY_OBJECT,this.webp=e.webp??!1,this.basis=e.basis??!1}var rz=lnt;function qye(e){this._position=e.position,this._adjustmentParams=e.adjustmentParams}Object.defineProperties(qye.prototype,{position:{get:function(){return this._position}},adjustmentParams:{get:function(){return this._adjustmentParams}}});var oz=qye;function Yye(e){this._position=e.position,this._adjustmentParams=e.adjustmentParams,this._covarianceMatrix=e.covarianceMatrix}Object.defineProperties(Yye.prototype,{position:{get:function(){return this._position}},adjustmentParams:{get:function(){return this._adjustmentParams}},covarianceMatrix:{get:function(){return this._covarianceMatrix}}});var sz=Yye;function Xye(e){this._groupFlags=e.groupFlags,this._rotationThetas=e.rotationThetas,this._params=e.params}Object.defineProperties(Xye.prototype,{groupFlags:{get:function(){return this._groupFlags}},rotationThetas:{get:function(){return this._rotationThetas}},params:{get:function(){return this._params}}});var az=Xye;var Kye={Direct:"Direct",Indirect:"Indirect"};Object.freeze(Kye);var yx=Kye;function $ye(e){this._storageType=e.storageType,this._anchorPointsIndirect=e.anchorPointsIndirect,this._anchorPointsDirect=e.anchorPointsDirect,this._intraTileCorrelationGroups=e.intraTileCorrelationGroups,this._covarianceDirect=e.covarianceDirect}Object.defineProperties($ye.prototype,{storageType:{get:function(){return this._storageType}},anchorPointsIndirect:{get:function(){return this._anchorPointsIndirect}},anchorPointsDirect:{get:function(){return this._anchorPointsDirect}},intraTileCorrelationGroups:{get:function(){return this._intraTileCorrelationGroups}},covarianceDirect:{get:function(){return this._covarianceDirect}}});var i1=$ye;function Jye(e){this._A=e.A,this._alpha=e.alpha,this._beta=e.beta,this._T=e.T}Object.defineProperties(Jye.prototype,{A:{get:function(){return this._A}},alpha:{get:function(){return this._alpha}},beta:{get:function(){return this._beta}},T:{get:function(){return this._T}}});var cz=Jye;function Lv(){}function Zye(e){return new $(e[0],e[1],e[3],e[1],e[2],e[4],e[3],e[4],e[5])}function unt(e){let t=h.fromArray(e.position,0,new h),n=h.fromArray(e.adjustmentParams,0,new h);return new oz({position:t,adjustmentParams:n})}function fnt(e){let t=h.fromArray(e.position,0,new h),n=h.fromArray(e.adjustmentParams,0,new h),i=Zye(e.covarianceMatrix);return new sz({position:t,adjustmentParams:n,covarianceMatrix:i})}function dnt(e){let t=e.groupFlags,n=h.fromArray(e.rotationThetas,0,new h),i=[];for(let o of e.params){let s=new cz({A:o.A,alpha:o.alpha,beta:o.beta,T:o.T});i.push(s)}return new az({groupFlags:t,rotationThetas:n,params:i})}Lv.load=function(e){let t=e.storageType;if(t===yx.Direct)return Lv.loadDirect(e);if(t===yx.Indirect)return Lv.loadIndirect(e);throw new oe(`Invalid storage type in NGA_gpm_local - expected 'Direct' or 'Indirect', but found ${t}`)};Lv.loadDirect=function(e){let t=[],n=e.anchorPointsDirect;for(let o of n){let s=unt(o);t.push(s)}let i=Zye(e.covarianceDirectUpperTriangle);return new i1({storageType:yx.Direct,anchorPointsDirect:t,covarianceDirect:i})};Lv.loadIndirect=function(e){let t=[],n=e.anchorPointsIndirect;for(let s of n){let a=fnt(s);t.push(a)}let i=e.intraTileCorrelationGroups,r=[];for(let s of i){let a=dnt(s);r.push(a)}return new i1({storageType:yx.Indirect,anchorPointsIndirect:t,intraTileCorrelationGroups:r})};var lz=Lv;function Qye(e){this._traits=e.traits,this._noData=e.noData,this._offset=e.offset,this._scale=e.scale,this._index=e.index,this._texCoord=e.texCoord}Object.defineProperties(Qye.prototype,{traits:{get:function(){return this._traits}},noData:{get:function(){return this._noData}},offset:{get:function(){return this._offset}},scale:{get:function(){return this._scale}},index:{get:function(){return this._index}},texCoord:{get:function(){return this._texCoord}}});var uz=Qye;function eAe(e){this._min=e.min,this._max=e.max,this._source=e.source}Object.defineProperties(eAe.prototype,{min:{get:function(){return this._min}},max:{get:function(){return this._max}},source:{get:function(){return this._source}}});var fz=eAe;function tAe(e){this._ppeTextures=e}Object.defineProperties(tAe.prototype,{ppeTextures:{get:function(){return this._ppeTextures}}});var dz=tAe;function Zo(e){e=e??H.EMPTY_OBJECT;let t=e.gltf,n=e.extension,i=e.gltfResource,r=e.baseResource,o=e.supportedImageFormats,s=e.frameState,a=e.cacheKey,c=e.asynchronous??!0;this._gltfResource=i,this._baseResource=r,this._gltf=t,this._extension=n,this._supportedImageFormats=o,this._frameState=s,this._cacheKey=a,this._asynchronous=c,this._textureLoaders=[],this._textureIds=[],this._meshPrimitiveGpmLocal=void 0,this._structuralMetadata=void 0,this._state=Ct.UNLOADED,this._promise=void 0}l(Object.create)&&(Zo.prototype=Object.create(cr.prototype),Zo.prototype.constructor=Zo);Object.defineProperties(Zo.prototype,{cacheKey:{get:function(){return this._cacheKey}},meshPrimitiveGpmLocal:{get:function(){return this._meshPrimitiveGpmLocal}},structuralMetadata:{get:function(){return this._structuralMetadata}}});Zo.prototype._loadResources=async function(){try{return await this._loadTextures(),this.isDestroyed()?void 0:(this._gltf=void 0,this._state=Ct.LOADED,this)}catch(e){if(this.isDestroyed())return;throw this.unload(),this._state=Ct.FAILED,this.getError("Failed to load GPM data",e)}};Zo.prototype.load=function(){return l(this._promise)?this._promise:(this._state=Ct.LOADING,this._promise=this._loadResources(this),this._promise)};function hnt(e){let t={},n=e.ppeTextures;if(l(n))for(let i=0;i<n.length;i++){let r=n[i];t[r.index]=r}return t}Zo.prototype._loadTextures=function(){let e;l(this._extension)&&(e=hnt(this._extension));let t=this._gltf,n=this._gltfResource,i=this._baseResource,r=this._supportedImageFormats,o=this._frameState,s=this._asynchronous,a=[];for(let c in e)if(e.hasOwnProperty(c)){let u=ki.getTextureLoader({gltf:t,textureInfo:e[c],gltfResource:n,baseResource:i,supportedImageFormats:r,frameState:o,asynchronous:s});this._textureLoaders.push(u),this._textureIds.push(c),a.push(u.load())}return Promise.all(a)};Zo.ppeTexturesMetadataSchemaCache=new Map;Zo._createPpeTextureClassJson=function(e,t){let n=e.traits,i=n.source,r=e.offset??0,o=(e.scale??1)*255;return{name:`PPE texture class ${t}`,properties:{[i]:{name:"PPE",type:"SCALAR",componentType:"UINT8",normalized:!0,offset:r,scale:o,min:n.min,max:n.max}}}};Zo._obtainPpeTexturesMetadataSchema=function(e){let n=Zo._collectPpeTexturePropertyIdentifiers(e).toString(),i=Zo.ppeTexturesMetadataSchemaCache.get(n);if(l(i))return i;let o={id:`PPE_TEXTURE_SCHEMA_${Zo.ppeTexturesMetadataSchemaCache.size}`,classes:{}},s=e.ppeTextures;for(let a=0;a<s.length;a++){let c=s[a],u=`ppeTexture_${a}`,f=Zo._createPpeTextureClassJson(c,a);o.classes[u]=f}return i=Su.fromJson(o),Zo.ppeTexturesMetadataSchemaCache.set(n,i),i};Zo._collectPpeTexturePropertyIdentifiers=function(e){let t=[],n=e.ppeTextures;for(let i=0;i<n.length;i++){let r=n[i],o=Zo._createPpeTextureClassJson(r,i),s=JSON.stringify(o);t.push(s)}return t};Zo._convertToStructuralMetadata=function(e,t){let n=[],i=Zo._obtainPpeTexturesMetadataSchema(e),r=e.ppeTextures;for(let s=0;s<r.length;s++){let a=r[s],c=`ppeTexture_${s}`,f=a.traits.source,d=i.classes[c],p={class:c,properties:{[f]:{index:a.index,texCoord:a.texCoord}}};n.push(new by({id:s,name:a.name,propertyTexture:p,class:d,textures:t}))}return new ic({schema:i,propertyTables:[],propertyTextures:n,propertyAttributes:[]})};Zo.prototype.process=function(e){if(this._state===Ct.READY)return!0;if(this._state!==Ct.LOADED)return!1;let t=this._textureLoaders,n=t.length,i=!0;for(let u=0;u<n;++u){let d=t[u].process(e);i=i&&d}if(!i)return!1;let r={};for(let u=0;u<this._textureIds.length;++u){let f=this._textureIds[u],d=t[u];d.isDestroyed()||(r[f]=d.texture)}let o=[],s=this._extension;if(l(s.ppeTextures)){let u=s.ppeTextures;for(let f of u){let d=f.traits,p=new fz({min:d.min,max:d.max,source:d.source}),g=new uz({traits:p,noData:f.noData,offset:f.offset,scale:f.scale,index:f.index,texCoord:f.texCoord});o.push(g)}}let a=new dz(o);this._meshPrimitiveGpmLocal=a;let c=Zo._convertToStructuralMetadata(a,r);return this._structuralMetadata=c,this._state=Ct.READY,!0};Zo.prototype._unloadTextures=function(){let e=this._textureLoaders,t=e.length;for(let n=0;n<t;++n)ki.unload(e[n]);this._textureLoaders.length=0,this._textureIds.length=0};Zo.prototype.unload=function(){this._unloadTextures(),this._gltf=void 0,this._extension=void 0,this._structuralMetadata=void 0};var hz=Zo;function mnt(e){let n=(e.extensions??H.EMPTY_OBJECT).EXT_mesh_primitive_restart,i=e.primitives;if(!l(n))return i;let r=[];Zn(r,i);for(let o of n.primitiveGroups){let s=o.primitives[0];if(!l(s)||!i[s])return i;let a={...i[s],indices:o.indices};switch(a.mode){case te.TRIANGLE_FAN:case te.TRIANGLE_STRIP:case te.LINE_STRIP:case te.LINE_LOOP:break;default:return i}for(let c of o.primitives){let u=r[c];if(!l(u?.indices)||u.mode!==a.mode)return i;r[c]=void 0}r[s]=a}return r.filter(l)}var mz=mnt;var{Attribute:pnt,Indices:gnt,FeatureIdAttribute:iAe,FeatureIdTexture:rAe,FeatureIdImplicitRange:oAe,MorphTarget:_nt,Primitive:ynt,Instances:Ant,Skin:bnt,Node:xnt,AnimatedPropertyType:Tnt,AnimationSampler:Ent,AnimationTarget:Cnt,AnimationChannel:vnt,Animation:Snt,ArticulationStage:wnt,Articulation:Int,Asset:Pnt,Scene:Dnt,Components:Rnt,MetallicRoughness:Ont,SpecularGlossiness:Mnt,Specular:Nnt,Anisotropy:jJ,Clearcoat:HJ,PlanarFill:Lnt,LineStyle:Fnt,Material:Bnt,Vector:knt,Polygon:Unt}=vn,to={NOT_LOADED:0,LOADING:1,LOADED:2,PROCESSING:3,POST_PROCESSING:4,PROCESSED:5,READY:6,FAILED:7,UNLOADED:8},GJ=class extends cr{constructor(t){super(),t=t??H.EMPTY_OBJECT;let{gltfResource:n,typedArray:i,releaseGltfJson:r=!1,asynchronous:o=!0,incrementallyLoadTextures:s=!0,upAxis:a=qi.Y,forwardAxis:c=qi.Z,loadAttributesAsTypedArray:u=!1,loadAttributesFor2D:f=!1,enablePick:d=!1,loadIndicesForWireframe:p=!1,loadPrimitiveOutline:g=!0,loadForClassification:m=!1,renameBatchIdSemantic:y=!1}=t,{baseResource:A=n.clone()}=t;this._gltfJson=t.gltfJson,this._gltfResource=n,this._baseResource=A,this._typedArray=i,this._releaseGltfJson=r,this._asynchronous=o,this._incrementallyLoadTextures=s,this._upAxis=a,this._forwardAxis=c,this._loadAttributesAsTypedArray=u,this._loadAttributesFor2D=f,this._enablePick=d,this._loadIndicesForWireframe=p,this._loadPrimitiveOutline=g,this._loadForClassification=m,this._renameBatchIdSemantic=y,this._sortedPropertyTableIds=void 0,this._sortedFeatureTextureIds=void 0,this._gltfJsonLoader=void 0,this._state=to.NOT_LOADED,this._textureState=to.NOT_LOADED,this._promise=void 0,this._processError=void 0,this._textureErrors=[],this._primitiveLoadPlans=[],this._loaderPromises=[],this._textureLoaders=[],this._texturesPromises=[],this._textureCallbacks=[],this._bufferViewLoaders=[],this._geometryLoaders=[],this._geometryCallbacks=[],this._structuralMetadataLoader=void 0,this._meshPrimitiveGpmLoader=void 0,this._loadResourcesPromise=void 0,this._resourcesLoaded=!1,this._texturesLoaded=!1,this._supportedImageFormats=void 0,this._postProcessBuffers=[],this._components=void 0}get cacheKey(){}get components(){return this._components}get gltfJson(){return l(this._gltfJsonLoader)?this._gltfJsonLoader.gltf:this._gltfJson}get incrementallyLoadTextures(){return this._incrementallyLoadTextures}get texturesLoaded(){return this._texturesLoaded}async load(){return l(this._promise)?this._promise:(this._promise=znt(this),this._promise)}_process(t){return this._state===to.READY?!0:(this._state===to.PROCESSING&&jnt(this,t),this._resourcesLoaded&&this._state===to.POST_PROCESSING&&(Hnt(this,t.context),this._state=to.PROCESSED),this._resourcesLoaded&&this._state===to.PROCESSED?(nAe(this),this._typedArray=void 0,this._state=to.READY,!0):!1)}_processTextures(t){if(this._textureState===to.READY)return!0;if(this._textureState!==to.PROCESSING)return!1;let n=!0,i=this._textureLoaders;for(let r=0;r<i.length;++r){let o=i[r].process(t);o&&l(this._textureCallbacks[r])&&(this._textureCallbacks[r](),this._textureCallbacks[r]=void 0),n=n&&o}return n?(this._textureState=to.READY,this._texturesLoaded=!0,!0):!1}process(t){if(this._state===to.LOADED&&!l(this._loadResourcesPromise)&&(this._loadResourcesPromise=Vnt(this,t).then(()=>{this._resourcesLoaded=!0}).catch(o=>{this._processError=o})),l(this._processError)){this._state=to.FAILED;let o=this._processError;this._processError=void 0,pz(this,o)}let n=this._textureErrors.pop();if(l(n)){let o=this.getError("Failed to load glTF texture",n);throw o.name="TextureError",o}if(this._state===to.FAILED)return!1;let i=!1;try{i=this._process(t)}catch(o){this._state=to.FAILED,pz(this,o)}let r=!1;try{r=this._processTextures(t)}catch(o){this._textureState=to.FAILED,pz(this,o)}return this._incrementallyLoadTextures?i:i&&r}isUnloaded(){return this._state===to.UNLOADED}unload(){l(this._gltfJsonLoader)&&!this._gltfJsonLoader.isDestroyed()&&ki.unload(this._gltfJsonLoader),this._gltfJsonLoader=void 0,trt(this),nAe(this),nrt(this),irt(this),rrt(this),ort(this),this._components=void 0,this._typedArray=void 0,this._state=to.UNLOADED}};async function znt(e){e._state=to.LOADING,e._textureState=to.LOADING;try{let t=ki.getGltfJsonLoader({gltfResource:e._gltfResource,baseResource:e._baseResource,typedArray:e._typedArray,gltfJson:e._gltfJson});return e._gltfJsonLoader=t,await t.load(),e.isDestroyed()||e.isUnloaded()||t.isDestroyed()?void 0:(e._state=to.LOADED,e._textureState=to.LOADED,e)}catch(t){if(e.isDestroyed())return;e._state=to.FAILED,e._textureState=to.FAILED,pz(e,t)}}async function Vnt(e,t){dn.supportsWebP.initialized||await dn.supportsWebP.initialize(),e._supportedImageFormats=new rz({webp:dn.supportsWebP(),basis:t.context.supportsBasis});let n=ert(e,t);return e._state=to.PROCESSING,e._textureState=to.PROCESSING,l(e._gltfJsonLoader)&&e._releaseGltfJson&&(ki.unload(e._gltfJsonLoader),e._gltfJsonLoader=void 0),n}function pz(e,t){throw e.unload(),e.getError("Failed to load glTF",t)}function jnt(e,t){let n=!0,i=e._geometryLoaders;for(let s=0;s<i.length;++s){let a=i[s].process(t);a&&l(e._geometryCallbacks[s])&&(e._geometryCallbacks[s](),e._geometryCallbacks[s]=void 0),n=n&&a}let r=e._structuralMetadataLoader;if(l(r)){let s=r.process(t);s&&(e._components.structuralMetadata=r.structuralMetadata),n=n&&s}let o=e._meshPrimitiveGpmLoader;if(l(o)){let s=o.process(t);s&&(l(e._components.structuralMetadata)&&yt("structural-metadata-gpm","The model defines both the 'EXT_structural_metadata' extension and the 'NGA_gpm_local' extension. The data from the 'EXT_structural_metadata' extension will be replaced with the data from the 'NGA_gpm_local' extension, and will no longer be available for styling and picking."),e._components.structuralMetadata=o.structuralMetadata),n=n&&s}n&&(e._state=to.POST_PROCESSING)}function Hnt(e,t){let n=e._primitiveLoadPlans;for(let i=0;i<n.length;i++){let r=n[i];r.postProcess(t),(r.needsOutlines||r.needsGaussianSplats)&&Gnt(e,r)}}function Gnt(e,t){let n=e._postProcessBuffers,i=t.primitive,r=i.outlineCoordinates;l(r)&&n.push(r.buffer);let o=i.attributes;for(let a=0;a<o.length;a++){let c=o[a];l(c.buffer)&&n.push(c.buffer)}let s=i.indices;l(s)&&l(s.buffer)&&n.push(s.buffer)}function Wnt(e,t,n,i,r,o,s,a,c){let u=e.gltfJson,d=u.accessors[t].bufferView;return ki.getVertexBufferLoader({gltf:u,gltfResource:e._gltfResource,baseResource:e._baseResource,frameState:c,bufferViewId:d,primitive:i,draco:r,spz:o,attributeSemantic:n,accessorId:t,asynchronous:e._asynchronous,loadBuffer:s,loadTypedArray:a})}function qnt(e,t,n,i,r,o,s){return ki.getIndexBufferLoader({gltf:e.gltfJson,accessorId:t,gltfResource:e._gltfResource,baseResource:e._baseResource,frameState:s,primitive:n,draco:i,asynchronous:e._asynchronous,loadBuffer:r,loadTypedArray:o})}function sAe(e,t){let n=ki.getBufferViewLoader({gltf:e.gltfJson,bufferViewId:t,gltfResource:e._gltfResource,baseResource:e._baseResource});return e._bufferViewLoaders.push(n),n}function WJ(e,t,n){let i=t.byteOffset,r=pf(e,t),o=t.count,s=vd(t.type),a=t.componentType,c=Y.getSizeInBytes(a),u=c*s,f=o*s;if(r===u)return n=new Uint8Array(n),Y.createArrayBufferView(a,n.buffer,n.byteOffset+i,f);let d=Y.createTypedArray(a,f),p=new DataView(n.buffer),g=new Array(s),m=gy(t.componentType);i=n.byteOffset+i;for(let y=0;y<o;++y){m(p,i,s,c,g);for(let A=0;A<s;++A)d[y*s+A]=g[A];i+=r}return d}function Ynt(e,t){let n=e.type;if(n===Vt.SCALAR)return t.fill(0);let i=Vt.getMathType(n);return t.fill(i.clone(i.ZERO))}function Xnt(e,t,n,i){let r=e.type,o=e.count;if(r===Vt.SCALAR)for(let s=0;s<o;s++)n[s]=t[s];else if(r===Vt.VEC4&&i)for(let s=0;s<o;s++)n[s]=Le.unpack(t,s*4);else{let s=Vt.getMathType(r),a=Vt.getNumberOfComponents(r);for(let c=0;c<o;c++)n[c]=s.unpack(t,c*a)}return n}async function Knt(e,t,n,i,r){let{gltfJson:o}=e;if(await t.load(),e.isDestroyed())return;let s=WJ(o,n,t.typedArray);i=i??!1,Xnt(n,s,r,i)}function r1(e,t,n){let i=new Array(t.count),r=t.bufferView;if(l(r)){let o=sAe(e,r),s=Knt(e,o,t,n,i);return e._loaderPromises.push(s),i}return Ynt(t,i)}function jh(e,t){let n=Y.createTypedArray(t.componentType,t.count*Vt.getNumberOfComponents(t.type));if(!l(t.bufferView))return n;let i=sAe(e,t.bufferView),{gltfJson:r}=e,o=i.load().then(()=>{if(e.isDestroyed())return;let s=WJ(r,t,i.typedArray);n.set(s)});return e._loaderPromises.push(o),n}function Iu(e,t){if(l(t))return e===Number?t[0]:e.unpack(t)}function $nt(e){return e===Number?0:new e}function Jnt(e){switch(e){case Y.BYTE:return 127;case Y.UNSIGNED_BYTE:return 255;case Y.SHORT:return 32767;case Y.UNSIGNED_SHORT:return 65535;default:return 1}}var Znt={VEC2:new U(-1,-1),VEC3:new h(-1,-1,-1),VEC4:new se(-1,-1,-1,-1)};function Qnt(e,t){let n=Jnt(e.componentDatatype),i=Znt[e.type],r=e.min;l(r)&&(r=t.divideByScalar(r,n,r),r=t.maximumByComponent(r,i,r));let o=e.max;l(o)&&(o=t.divideByScalar(o,n,o),o=t.maximumByComponent(o,i,o)),e.min=r,e.max=o}function eit(e,t,n){let i=e.decodeMatrix,r=Iu(n,e.decodedMin),o=Iu(n,e.decodedMax);l(r)&&l(o)&&(t.min=r,t.max=o);let s=new vn.Quantization;s.componentDatatype=t.componentDatatype,s.type=t.type,i.length===4?(s.quantizedVolumeOffset=i[2],s.quantizedVolumeStepSize=i[0]):i.length===9?(s.quantizedVolumeOffset=new U(i[6],i[7]),s.quantizedVolumeStepSize=new U(i[0],i[4])):i.length===16?(s.quantizedVolumeOffset=new h(i[12],i[13],i[14]),s.quantizedVolumeStepSize=new h(i[0],i[5],i[10])):i.length===25&&(s.quantizedVolumeOffset=new se(i[20],i[21],i[22],i[23]),s.quantizedVolumeStepSize=new se(i[0],i[6],i[12],i[18])),t.quantization=s}function tit(e,t,n,i,r){let o=e.accessors[t],s=Vt.getMathType(o.type),a=o.normalized??!1,c=new pnt;c.name=n,c.semantic=i,c.setIndex=r,c.constant=$nt(s),c.componentDatatype=o.componentType,c.normalized=a,c.count=o.count,c.type=o.type,c.min=Iu(s,o.min),c.max=Iu(s,o.max),c.byteOffset=o.byteOffset,c.byteStride=pf(e,o),lr(o,"WEB3D_quantized_attributes")&&eit(o.extensions.WEB3D_quantized_attributes,c,s);let u=c.semantic===ct.POSITION||c.semantic===ct.NORMAL||c.semantic===ct.TANGENT||c.semantic===ct.TEXCOORD||c.semantic===ct.FEATURE_ID||c.semantic===ct.SCALE||c.semantic===ct.ROTATION;return e.extensionsRequired?.includes("KHR_mesh_quantization")&&a&&u&&Qnt(c,s),c}function aAe(e){let n=/^\w+_(\d+)$/.exec(e);if(n!==null)return parseInt(n[1])}var nit={gltfSemantic:void 0,renamedSemantic:void 0,modelSemantic:void 0};function qJ(e,t,n){let i=n;e._renameBatchIdSemantic&&(n==="_BATCHID"||n==="BATCHID")&&(i="_FEATURE_ID_0");let r=t.fromGltfSemantic(i),o=nit;return o.gltfSemantic=n,o.renamedSemantic=i,o.modelSemantic=r,o}function iit(e){let t=e===ct.POSITION,n=e===ct.FEATURE_ID,i=e===ct.TEXCOORD;return t||n||i}function rit(e,t,n,i){if(e.byteOffset=0,e.byteStride=void 0,e.quantization=t.quantization,n&&(e.buffer=t.buffer),i){let r=l(t.quantization)?t.quantization.componentDatatype:e.componentDatatype;e.typedArray=Y.createArrayBufferView(r,t.typedArray.buffer)}}function oit(e,t,n,i){if(e.byteOffset=0,e.byteStride=void 0,n&&(e.buffer=t.buffer),i&&l(t.typedArray)&&(e.typedArray=Y.createArrayBufferView(e.componentDatatype,t.typedArray.buffer)),e.semantic===ct.POSITION){let r=s=>{let a=1/0,c=-1/0,u=1/0,f=-1/0,d=1/0,p=-1/0;for(let g=0;g<s.length;g+=3){let m=s[g],y=s[g+1],A=s[g+2];a=Math.min(a,m),c=Math.max(c,m),u=Math.min(u,y),f=Math.max(f,y),d=Math.min(d,A),p=Math.max(p,A)}return[new h(a,u,d),new h(c,f,p)]},o=e.typedArray;[e.min,e.max]=r(o)}}function sit(e,t,n,i,r,o){if(r&&(n.buffer=i.buffer),o){let s=i.typedArray;n.typedArray=WJ(e,t,s),r||(n.byteOffset=0,n.byteStride=void 0)}}function cAe(e,t,n,i,r,o,s,a,c){let u=e.gltfJson,f=u.accessors[t],d=f.bufferView,p=n.gltfSemantic,g=n.renamedSemantic,m=n.modelSemantic,y=l(m)?aAe(g):void 0,b=tit(u,t,p,m,y);if(!l(r)&&!l(d)&&!l(o))return b;let x=Wnt(e,t,p,i,r,o,s,a,c),T=e._geometryLoaders.length;e._geometryLoaders.push(x);let E=x.load();return e._loaderPromises.push(E),e._geometryCallbacks[T]=()=>{l(r)&&l(r.attributes)&&l(r.attributes[p])?rit(b,x,s,a):l(o)?oit(b,x,s,a):sit(u,f,b,x,s,a)},b}function lAe(e,t,n,i,r,o,s,a,c){let u=n.modelSemantic,f=u===ct.POSITION,d=u===ct.FEATURE_ID,p=f&&!s&&e._loadAttributesFor2D&&!c.scene3DOnly,g=f&&e._enablePick&&!c.context.webgl2,m=e._loadForClassification&&d,y=e._loadAttributesAsTypedArray,A=!y,b=y||p||g||m,E=cAe(e,t,n,i,r,o,a?!1:A,a?!0:b,c),v=new Nv.AttributeLoadPlan(E);return v.loadBuffer=A,v.loadTypedArray=b,v}function ait(e,t,n,i,r){let o=e.gltfJson.accessors,s=l(n.ROTATION),a=l(n.TRANSLATION)&&l(o[n.TRANSLATION].min)&&l(o[n.TRANSLATION].max),c=qJ(e,Bo,i),u=c.modelSemantic,f=u===Bo.TRANSLATION||u===Bo.ROTATION||u===Bo.SCALE,d=u===Bo.TRANSLATION,p=e._loadAttributesAsTypedArray||s&&f||!r.context.instancedArrays,g=e._enablePick&&!r.context.webgl2,m=!p,y=e._loadAttributesFor2D&&!r.scene3DOnly;return cAe(e,t,c,void 0,void 0,void 0,m,p||d&&(!a||y||g),r)}function cit(e,t,n,i,r,o){let s=e.gltfJson.accessors[t],a=s.bufferView,c=n.extensions??H.EMPTY_OBJECT,u=c.KHR_draco_mesh_compression,f=l(c.EXT_mesh_primitive_edge_visibility);if(!l(u)&&!l(a))return;let d=new gnt;d.count=s.count;let p=e._loadAttributesAsTypedArray,g=(e._loadIndicesForWireframe||e._enablePick)&&!o.context.webgl2,m=e._loadForClassification&&i,A=!p,b=p||g||m||f,E=qnt(e,t,n,u,r?!1:A,r?!0:b,o),v=e._geometryLoaders.length;e._geometryLoaders.push(E);let S=E.load();e._loaderPromises.push(S),e._geometryCallbacks[v]=()=>{d.indexDatatype=E.indexDatatype,d.buffer=E.buffer,d.typedArray=E.typedArray};let I=new Nv.IndicesLoadPlan(d);return I.loadBuffer=A,I.loadTypedArray=b,I}function lit(e,t,n){return new Ht({wrapR:e.wrapR,wrapS:e.wrapS,wrapT:e.wrapT,minificationFilter:t??e.minificationFilter,magnificationFilter:n??e.magnificationFilter,maximumAnisotropy:e.maximumAnisotropy})}function Vl(e,t,n,i,r){let o=e.gltfJson,s=gf.getImageIdFromTexture({gltf:o,textureId:t.index,supportedImageFormats:e._supportedImageFormats});if(!l(s))return;let a=ki.getTextureLoader({gltf:o,textureInfo:t,gltfResource:e._gltfResource,baseResource:e._baseResource,supportedImageFormats:e._supportedImageFormats,frameState:n,asynchronous:e._asynchronous}),c=gf.createModelTextureReader({textureInfo:t}),u=e._textureLoaders.length;e._textureLoaders.push(a);let f=a.load().catch(d=>{if(!e.isDestroyed()){if(!e._incrementallyLoadTextures)throw d;e._textureState=to.FAILED,e._textureErrors.push(d)}});return e._texturesPromises.push(f),e._textureCallbacks[u]=()=>{let d=a.texture;c.texture=d,(l(i)||l(r))&&(d.sampler=lit(d.sampler,i,r))},c}function uit(e,t,n){let{diffuseTexture:i,specularGlossinessTexture:r,diffuseFactor:o,specularFactor:s,glossinessFactor:a}=t,c=new Mnt;return l(i)&&(c.diffuseTexture=Vl(e,i,n)),l(r)&&(c.specularGlossinessTexture=Vl(e,r,n)),c.diffuseFactor=Iu(se,o),c.specularFactor=Iu(h,s),c.glossinessFactor=a,c}function fit(e,t,n){let{baseColorTexture:i,metallicRoughnessTexture:r,baseColorFactor:o,metallicFactor:s,roughnessFactor:a}=t,c=new Ont;return l(i)&&(c.baseColorTexture=Vl(e,i,n)),l(r)&&(c.metallicRoughnessTexture=Vl(e,r,n)),c.baseColorFactor=Iu(se,o),c.metallicFactor=s,c.roughnessFactor=a,c}function dit(e,t,n){let{specularFactor:i,specularTexture:r,specularColorFactor:o,specularColorTexture:s}=t,a=new Nnt;return l(r)&&(a.specularTexture=Vl(e,r,n)),l(s)&&(a.specularColorTexture=Vl(e,s,n)),a.specularFactor=i,a.specularColorFactor=Iu(h,o),a}function hit(e,t,n){let{anisotropyStrength:i=jJ.DEFAULT_ANISOTROPY_STRENGTH,anisotropyRotation:r=jJ.DEFAULT_ANISOTROPY_ROTATION,anisotropyTexture:o}=t,s=new jJ;return l(o)&&(s.anisotropyTexture=Vl(e,o,n)),s.anisotropyStrength=i,s.anisotropyRotation=r,s}function mit(e,t,n){let{clearcoatFactor:i=HJ.DEFAULT_CLEARCOAT_FACTOR,clearcoatTexture:r,clearcoatRoughnessFactor:o=HJ.DEFAULT_CLEARCOAT_ROUGHNESS_FACTOR,clearcoatRoughnessTexture:s,clearcoatNormalTexture:a}=t,c=new HJ;return l(r)&&(c.clearcoatTexture=Vl(e,r,n)),l(s)&&(c.clearcoatRoughnessTexture=Vl(e,s,n)),l(a)&&(c.clearcoatNormalTexture=Vl(e,a,n)),c.clearcoatFactor=i,c.clearcoatRoughnessFactor=o,c}function pit(e){return new Lnt(e)}function git(e){if(!l(e))return;let t=new Fnt;if(l(e.width)){let n=e.width;n>0&&Math.floor(n)===n&&(t.width=n)}if(l(e.pattern)){let n=e.pattern;n>=0&&n<=65535&&Math.floor(n)===n&&(t.pattern=n)}if(!(!l(t.width)&&!l(t.pattern)))return t}function _it(e,t,n){let i=new Bnt,r=t.extensions??H.EMPTY_OBJECT,o=r.KHR_materials_pbrSpecularGlossiness,s=r.KHR_materials_specular,a=r.KHR_materials_anisotropy,c=r.KHR_materials_clearcoat,u=t.pbrMetallicRoughness,f=r.BENTLEY_materials_planar_fill;i.unlit=l(r.KHR_materials_unlit),l(o)?i.specularGlossiness=uit(e,o,n):(l(u)&&(i.metallicRoughness=fit(e,u,n)),l(s)&&!i.unlit&&(i.specular=dit(e,s,n)),l(a)&&!i.unlit&&(i.anisotropy=hit(e,a,n)),l(c)&&!i.unlit&&(i.clearcoat=mit(e,c,n))),l(t.emissiveTexture)&&(i.emissiveTexture=Vl(e,t.emissiveTexture,n)),l(t.normalTexture)&&!e._loadForClassification&&(i.normalTexture=Vl(e,t.normalTexture,n)),l(t.occlusionTexture)&&(i.occlusionTexture=Vl(e,t.occlusionTexture,n)),i.emissiveFactor=Iu(h,t.emissiveFactor),i.alphaMode=t.alphaMode,i.alphaCutoff=t.alphaCutoff,i.doubleSided=t.doubleSided,l(f)&&(i.planarFill=pit(f));let d=r.BENTLEY_materials_point_style;if(l(d)&&l(d.diameter)){let p=d.diameter;p>=1&&(i.pointDiameter=Math.floor(p))}return i.lineStyle=git(r.BENTLEY_materials_line_style),i}function uAe(e,t){let n=new iAe;return n.featureCount=e.featureCount,n.nullFeatureId=e.nullFeatureId,n.propertyTableId=e.propertyTable,n.setIndex=e.attribute,n.label=e.label,n.positionalLabel=t,n}function fAe(e,t,n,i){let r=new iAe,o=e.featureIds;return r.featureCount=n,r.propertyTableId=t,r.setIndex=aAe(o.attribute),r.positionalLabel=i,r}function dAe(e,t){let n=new oAe;return n.propertyTableId=e.propertyTable,n.featureCount=e.featureCount,n.nullFeatureId=e.nullFeatureId,n.label=e.label,n.positionalLabel=t,n.offset=0,n.repeat=1,n}function hAe(e,t,n,i){let r=new oAe,o=e.featureIds;r.propertyTableId=t,r.featureCount=n,r.offset=o.constant??0;let s=o.divisor??0;return r.repeat=s===0?void 0:s,r.positionalLabel=i,r}function yit(e,t,n,i){let r=new rAe;r.featureCount=t.featureCount,r.nullFeatureId=t.nullFeatureId,r.propertyTableId=t.propertyTable,r.label=t.label,r.positionalLabel=i;let o=t.texture;r.textureReader=Vl(e,o,n,Wt.NEAREST,Jn.NEAREST);let a=(l(o.channels)?o.channels:[0]).map(function(c){return"rgba".charAt(c)}).join("");return r.textureReader.channels=a,r}function Ait(e,t,n,i,r,o){let s=new rAe,a=t.featureIds,c=a.texture;return s.featureCount=r,s.propertyTableId=n,s.textureReader=Vl(e,c,i,Wt.NEAREST,Jn.NEAREST),s.textureReader.channels=a.channels,s.positionalLabel=o,s}function bit(e,t,n,i,r){let o=new _nt,s=void 0,a=void 0,c=void 0,u=!1;for(let f in t){if(!t.hasOwnProperty(f))continue;let d=t[f],p=qJ(e,ct,f),g=lAe(e,d,p,s,a,c,u,n,r);o.attributes.push(g.attribute),i.attributePlans.push(g)}return o}function xit(e){let i=e?.KHR_gaussian_splatting?.extensions?.KHR_gaussian_splatting_compression_spz_2;if(l(i))return i}function mAe(e,t){if(!l(t))return;let n=e.gltfJson.materials;if(!l(n)||t<0||t>=n.length)return;let i=n[t];if(!l(i))return;let r=i.pbrMetallicRoughness??H.EMPTY_OBJECT,o=Iu(se,r.baseColorFactor);return l(o)?o:new se(1,1,1,1)}function Tit(e){switch(e){case Y.UNSIGNED_BYTE:return 255;case Y.UNSIGNED_SHORT:return 65535;case Y.UNSIGNED_INT:return 4294967295;default:throw new oe("EXT_mesh_primitive_edge_visibility line strings indices must use unsigned scalar component types.")}}function Eit(e,t,n){if(!l(t)||t.length===0)return;let i=new Array(t.length);for(let r=0;r<t.length;r++){let o=t[r]??H.EMPTY_OBJECT,s=o.indices,a=e.gltfJson.accessors[s];if(!l(a))throw new oe("Edge visibility line string accessor not found!");let c=jh(e,a),u=Tit(a.componentType),f=l(o.material)?o.material:n;i[r]={indices:c,restartIndex:u,componentType:a.componentType,materialColor:mAe(e,f)}}return i}function Cit(e,t){if(!l(t))return;let n={},i=t.visibility;if(l(i)){let r=e.gltfJson.accessors[i];if(!l(r))throw new oe("Edge visibility accessor not found!");n.visibility=jh(e,r)}if(n.materialColor=mAe(e,t.material),l(t.silhouetteNormals)){let r=e.gltfJson.accessors[t.silhouetteNormals];l(r)&&(n.silhouetteNormals=jh(e,r))}return l(t.lineStrings)&&(n.lineStrings=Eit(e,t.lineStrings,t.material)),n}function vit(e,t,n,i){let r=new ynt,o=new Nv(r);e._primitiveLoadPlans.push(o);let s=t.material;l(s)&&(r.material=_it(e,e.gltfJson.materials[s],i));let a=t.extensions??H.EMPTY_OBJECT,c=a.EXT_mesh_polygon;l(c)&&(r.polygon=wit(e,t,c));let u=a.CESIUM_mesh_vector;l(u)&&(r.vector=Iit(e,u));let f=!1,d=a.CESIUM_primitive_outline;e._loadPrimitiveOutline&&l(d)&&(f=!0,o.needsOutlines=!0,o.outlineIndices=Sit(e,d,o)),r.edgeVisibility=Cit(e,a.EXT_mesh_primitive_edge_visibility);let p=xit(a);l(p)&&(f=!0,o.needsGaussianSplats=!0);let g=e._loadForClassification,m=a.KHR_draco_mesh_compression,y=!1,A=t.attributes;if(l(A))for(let O in A){if(!A.hasOwnProperty(O))continue;let L=A[O],_=qJ(e,ct,O),C=_.modelSemantic;if(g&&!iit(C))continue;C===ct.FEATURE_ID&&(y=!0);let w=lAe(e,L,_,t,m,p,n,f,i);o.attributePlans.push(w),r.attributes.push(w.attribute)}let b=t.targets;if(l(b)&&!g)for(let O=0;O<b.length;++O)r.morphTargets.push(bit(e,b[O],f,o,i));let x=t.indices;if(l(x)){let O=cit(e,x,t,y,f,i);l(O)&&(o.indicesPlan=O,r.indices=O.indices)}let T=a.EXT_structural_metadata,E=a.EXT_mesh_features,v=a.EXT_feature_metadata,S=l(v),I=a.NGA_gpm_local;l(E)?Pit(e,r,E,i):S&&Dit(e,r,v,i),l(T)?Rit(r,T):S&&Oit(e,r,v),l(I)&&Mit(r,I);let R=t.mode;if(g&&R!==Oe.TRIANGLES)throw new oe("Only triangle meshes can be used for classification.");return r.primitiveType=R,r}function Sit(e,t){let n=t.indices,i=e.gltfJson.accessors[n];return r1(e,i,!1)}function wit(e,t,n){let i=new Unt,r=e.gltfJson.accessors;return i.count=n.count,t.mode===Oe.LINE_LOOP?(i.loopIndices=jh(e,r[t.indices]),i.loopIndicesOffsets=jh(e,r[n.indicesOffsets]),i.triangleIndices=jh(e,r[n.triangleIndices]),i.triangleIndicesOffsets=jh(e,r[n.triangleIndicesOffsets])):t.mode===Oe.TRIANGLES&&(i.loopIndices=jh(e,r[n.loopIndices]),i.loopIndicesOffsets=jh(e,r[n.loopIndicesOffsets]),i.triangleIndices=jh(e,r[t.indices]),i.triangleIndicesOffsets=jh(e,r[n.indicesOffsets])),i}function Iit(e,t){if(!l(t))return;let n=new knt;n.vector=t.vector,n.count=t.count;let i=e.gltfJson.accessors;function r(o,s){if(l(o))return r1(e,i[o])}return n.polygonAttributeOffsets=r(t.polygonAttributeOffsets,"polygonAttributeOffsets"),n.polygonHoleCounts=r(t.polygonHoleCounts,"polygonHoleCounts"),n.polygonHoleOffsets=r(t.polygonHoleOffsets,"polygonHoleOffsets"),n.polygonIndicesOffsets=r(t.polygonIndicesOffsets,"polygonIndicesOffsets"),n}function Pit(e,t,n,i){let r;l(n)&&l(n.featureIds)?r=n.featureIds:r=[];for(let o=0;o<r.length;o++){let s=r[o],a=`featureId_${o}`,c;l(s.texture)?c=yit(e,s,i,a):l(s.attribute)?c=uAe(s,a):c=dAe(s,a),t.featureIds.push(c)}}function Dit(e,t,n,i){let{featureTables:r}=e.gltfJson.extensions.EXT_feature_metadata,o=0,s=n.featureIdAttributes;if(l(s))for(let c=0;c<s.length;++c){let u=s[c],f=u.featureTable,d=e._sortedPropertyTableIds.indexOf(f),p=r[f].count,g=`featureId_${o}`;o++;let m;l(u.featureIds.attribute)?m=fAe(u,d,p,g):m=hAe(u,d,p,g),t.featureIds.push(m)}let a=n.featureIdTextures;if(l(a))for(let c=0;c<a.length;++c){let u=a[c],f=u.featureTable,d=e._sortedPropertyTableIds.indexOf(f),p=r[f].count,g=`featureId_${o}`;o++;let m=Ait(e,u,d,i,p,g);t.featureIds.push(m)}}function Rit(e,t){if(!l(t))return;let{propertyTextures:n,propertyAttributes:i}=t;l(n)&&(e.propertyTextureIds=n),l(i)&&(e.propertyAttributeIds=i)}function Oit(e,t,n){l(n.featureTextures)&&(t.propertyTextureIds=n.featureTextures.map(function(i){return e._sortedFeatureTextureIds.indexOf(i)}))}function Mit(e,t){let n=t.ppeTextures??[];for(let i=0;i<n.length;i++)e.propertyTextureIds.push(i)}function Nit(e,t,n){let i=t.EXT_mesh_gpu_instancing,r=new Ant,o=i.attributes;if(l(o))for(let u in o){if(!o.hasOwnProperty(u))continue;let f=o[u];r.attributes.push(ait(e,f,o,u,n))}let s=i.extensions??H.EMPTY_OBJECT,a=t.EXT_instance_features,c=s.EXT_feature_metadata;return l(a)?Lit(r,a):l(c)&&Fit(e.gltfJson,r,c,e._sortedPropertyTableIds),r}function Lit(e,t){let n=t.featureIds;for(let i=0;i<n.length;i++){let r=n[i],o=`instanceFeatureId_${i}`,s;l(r.attribute)?s=uAe(r,o):s=dAe(r,o),e.featureIds.push(s)}}function Fit(e,t,n,i){let r=e.extensions.EXT_feature_metadata.featureTables,o=n.featureIdAttributes;if(l(o))for(let s=0;s<o.length;++s){let a=o[s],c=a.featureTable,u=i.indexOf(c),f=r[c].count,d=`instanceFeatureId_${s}`,p;l(a.featureIds.attribute)?p=fAe(a,u,f,d):p=hAe(a,u,f,d),t.featureIds.push(p)}}function Bit(e,t,n){let i=new xnt;i.name=t.name,i.matrix=Iu(M,t.matrix),i.translation=Iu(h,t.translation),i.rotation=Iu(Le,t.rotation),i.scale=Iu(h,t.scale);let r=t.extensions??H.EMPTY_OBJECT,o=r.EXT_mesh_gpu_instancing,s=r.AGI_articulations,a=r.CESIUM_mesh_vector;if(l(o)){if(e._loadForClassification)throw new oe("Models with the EXT_mesh_gpu_instancing extension cannot be used for classification.");i.instances=Nit(e,r,n)}l(s)&&(i.articulationName=s.articulationName),l(a)&&(i.meshVector=a);let c=t.mesh;if(l(c)){let u=e.gltfJson.meshes[c],f=mz(u);for(let g=0;g<f.length;++g)i.primitives.push(vit(e,f[g],l(i.instances),n));let d=t.weights??u.weights,p=i.primitives[0].morphTargets;i.morphWeights=l(d)?d.slice():new Array(p.length).fill(0)}return i}function kit(e,t){let n=e.gltfJson.nodes;if(!l(n))return[];let i=n.map(function(r,o){let s=Bit(e,r,t);return s.index=o,s});for(let r=0;r<i.length;++r){let o=n[r].children;if(l(o))for(let s=0;s<o.length;++s)i[r].children.push(i[o[s]])}return i}function Uit(e,t,n){let i=new bnt,r=t.joints;i.joints=r.map(s=>n[s]);let o=t.inverseBindMatrices;if(l(o)){let s=e.gltfJson.accessors[o];i.inverseBindMatrices=r1(e,s)}else i.inverseBindMatrices=new Array(r.length).fill(M.IDENTITY);return i}function zit(e,t){let n=e.gltfJson.skins;if(e._loadForClassification||!l(n))return[];let i=n.map(function(o,s){let a=Uit(e,o,t);return a.index=s,a}),r=e.gltfJson.nodes;for(let o=0;o<t.length;++o){let s=r[o].skin;l(s)&&(t[o].skin=i[s])}return i}async function Vit(e,t,n,i){let r=new tz({gltf:e.gltfJson,extension:t,extensionLegacy:n,gltfResource:e._gltfResource,baseResource:e._baseResource,supportedImageFormats:e._supportedImageFormats,frameState:i,asynchronous:e._asynchronous});return e._structuralMetadataLoader=r,r.load()}async function jit(e,t,n,i){let r=new hz({gltf:t,extension:n,gltfResource:e._gltfResource,baseResource:e._baseResource,supportedImageFormats:e._supportedImageFormats,frameState:i,asynchronous:e._asynchronous});return e._meshPrimitiveGpmLoader=r,r.load()}function Hit(e,t){let n=new Ent,i=e.gltfJson.accessors,r=i[t.input];n.input=r1(e,r);let o=t.interpolation;n.interpolation=_p[o]??_p.LINEAR;let s=i[t.output];return n.output=r1(e,s,!0),n}function Git(e,t){let n=new Cnt,i=e.node;if(!l(i))return;n.node=t[i];let r=e.path.toUpperCase();return n.path=Tnt[r],n}function Wit(e,t,n){let i=new vnt,r=e.sampler;return i.sampler=t[r],i.target=Git(e.target,n),i}function qit(e,t,n){let i=new Snt;i.name=t.name;let r=t.samplers.map(function(s,a){let c=Hit(e,s);return c.index=a,c}),o=t.channels.map(function(s){return Wit(s,r,n)});return i.samplers=r,i.channels=o,i}function Yit(e,t){let n=e.gltfJson.animations;return e._loadForClassification||!l(n)?[]:n.map(function(r,o){let s=qit(e,r,t);return s.index=o,s})}function Xit(e){let t=new wnt;t.name=e.name;let n=e.type.toUpperCase();return t.type=zl[n],t.minimumValue=e.minimumValue,t.maximumValue=e.maximumValue,t.initialValue=e.initialValue,t}function Kit(e){let t=new Int;return t.name=e.name,t.stages=e.stages.map(Xit),t}function $it(e){let n=(e.extensions??H.EMPTY_OBJECT).AGI_articulations?.articulations;return l(n)?n.map(Kit):[]}function Jit(e){let t;return l(e.scenes)&&l(e.scene)&&(t=e.scenes[e.scene].nodes),t=t??e.nodes,t=l(t)?t:[],t}function Zit(e,t){let n=new Dnt,i=Jit(e);return n.nodes=i.map(function(r){return t[r]}),n}var Qit=new h;function ert(e,t){let n=e.gltfJson,i=n.extensions??H.EMPTY_OBJECT,r=i.EXT_structural_metadata,o=i.EXT_feature_metadata,s=i.CESIUM_RTC;if(l(o)){let x=o.featureTables,T=o.featureTextures,E=l(x)?x:[],v=l(T)?T:[];e._sortedPropertyTableIds=Object.keys(E).sort(),e._sortedFeatureTextureIds=Object.keys(v).sort()}let a=kit(e,t),c=zit(e,a),u=Yit(e,a),f=$it(n),d=Zit(n,a),p=new Rnt,g=new Pnt,m=n.asset.copyright;if(l(m)){let x=m.split(";").map(function(T){return new It(T.trim())});g.credits=x}if(p.asset=g,p.scene=d,p.nodes=a,p.skins=c,p.animations=u,p.articulations=f,p.upAxis=e._upAxis,p.forwardAxis=e._forwardAxis,l(s)){let x=h.fromArray(s.center,0,Qit);p.transform=M.fromTranslation(x,p.transform)}if(e._components=p,l(r)||l(o)){let x=Vit(e,r,o,t);e._loaderPromises.push(x)}let y=i.NGA_gpm_local;if(l(y)){let x=lz.load(y);e._components.extensions.NGA_gpm_local=x}let A=n.meshes;if(l(A))for(let x of A){let T=x.primitives;if(l(T))for(let E of T){let v=E.extensions;if(l(v)){let S=v.NGA_gpm_local;if(l(S)){let I=jit(e,n,S,t);e._loaderPromises.push(I)}}}}let b=[];return Zn(b,e._loaderPromises),e._incrementallyLoadTextures||Zn(b,e._texturesPromises),Promise.all(b)}function trt(e){let t=e._textureLoaders;for(let n=0;n<t.length;++n)t[n]=!t[n].isDestroyed()&&ki.unload(t[n]);e._textureLoaders.length=0}function nAe(e){let t=e._bufferViewLoaders;for(let n=0;n<t.length;++n)t[n]=!t[n].isDestroyed()&&ki.unload(t[n]);e._bufferViewLoaders.length=0}function nrt(e){let t=e._geometryLoaders;for(let n=0;n<t.length;++n)t[n]=!t[n].isDestroyed()&&ki.unload(t[n]);e._geometryLoaders.length=0}function irt(e){let t=e._postProcessBuffers;for(let n=0;n<t.length;n++){let i=t[n];i.isDestroyed()||i.destroy()}t.length=0}function rrt(e){l(e._structuralMetadataLoader)&&!e._structuralMetadataLoader.isDestroyed()&&(e._structuralMetadataLoader.destroy(),e._structuralMetadataLoader=void 0)}function ort(e){l(e._meshPrimitiveGpmLoader)&&!e._meshPrimitiveGpmLoader.isDestroyed()&&(e._meshPrimitiveGpmLoader.destroy(),e._meshPrimitiveGpmLoader=void 0)}var wd=GJ;function Ax(e){this._url=e,this._cubeMapBuffers=void 0,this._texture=void 0,this._maximumMipmapLevel=void 0,this._loading=!1,this._ready=!1,this._errorEvent=new be}Object.defineProperties(Ax.prototype,{url:{get:function(){return this._url}},errorEvent:{get:function(){return this._errorEvent}},texture:{get:function(){return this._texture}},maximumMipmapLevel:{get:function(){return this._maximumMipmapLevel}},ready:{get:function(){return this._ready}}});Ax.isSupported=function(e){return(e.colorBufferHalfFloat&&e.halfFloatingPointTexture||e.floatingPointTexture&&e.colorBufferFloat)&&e.supportsTextureLod};function YJ(e){e._cubeMapBuffers=void 0}Ax.prototype.update=function(e){let{context:t}=e;if(!Ax.isSupported(t))return;if(l(this._texture)){YJ(this);return}if(!l(this._texture)&&!this._loading){let f=t.textureCache.getTexture(this._url);l(f)&&(YJ(this),this._texture=f,this._maximumMipmapLevel=this._texture.maximumMipmapLevel,this._ready=!0)}let n=this._cubeMapBuffers;if(!l(n)&&!this._loading){let f=this;nf(this._url).then(function(d){f._cubeMapBuffers=d,f._loading=!1}).catch(function(d){f.isDestroyed()||f._errorEvent.raiseEvent(d)}),this._loading=!0}if(!l(this._cubeMapBuffers))return;let{pixelDatatype:i}=n[0].positiveX;l(i)||(i=t.halfFloatingPointTexture?ze.HALF_FLOAT:ze.FLOAT);let r=$e.RGBA,o=n.length;this._maximumMipmapLevel=o-1;let s=n[0].positiveX.width,a=Math.log2(s)+1;if(o!==a){let f={};Object.values(ls.FaceName).forEach(d=>{f[d]=void 0});for(let d=o;d<a;d++)n.push(f)}let c=new Ht({minificationFilter:Wt.LINEAR_MIPMAP_LINEAR}),u=new ls({context:t,source:n[0],flipY:!1,pixelDatatype:i,pixelFormat:r,sampler:c});u.loadMipmaps(n.slice(1)),this._texture=u,this._texture.maximumMipmapLevel=this._maximumMipmapLevel,t.textureCache.addTexture(this._url,this._texture),this._ready=!0};Ax.prototype.isDestroyed=function(){return!1};Ax.prototype.destroy=function(){return YJ(this),this._texture=this._texture&&this._texture.destroy(),le(this)};var Ep=Ax;function o1(e){e=e??H.EMPTY_OBJECT;let t=l(e.imageBasedLightingFactor)?U.clone(e.imageBasedLightingFactor):new U(1,1);this._imageBasedLightingFactor=t;let n=e.sphericalHarmonicCoefficients;this._sphericalHarmonicCoefficients=n,this._specularEnvironmentMaps=e.specularEnvironmentMaps,this._specularEnvironmentCubeMap=void 0,this._specularEnvironmentCubeMapDirty=!0,this._specularEnvironmentMapLoaded=!1,this._previousSpecularEnvironmentMapLoaded=!1,this._useDefaultSpecularMaps=!1,this._useDefaultSphericalHarmonics=!1,this._shouldRegenerateShaders=!1,this._previousFrameNumber=void 0,this._previousFrameContext=void 0,this._previousImageBasedLightingFactor=U.clone(t),this._previousSphericalHarmonicCoefficients=n,this._removeErrorListener=void 0}Object.defineProperties(o1.prototype,{imageBasedLightingFactor:{get:function(){return this._imageBasedLightingFactor},set:function(e){this._previousImageBasedLightingFactor=U.clone(this._imageBasedLightingFactor,this._previousImageBasedLightingFactor),this._imageBasedLightingFactor=U.clone(e,this._imageBasedLightingFactor)}},sphericalHarmonicCoefficients:{get:function(){return this._sphericalHarmonicCoefficients},set:function(e){this._previousSphericalHarmonicCoefficients=this._sphericalHarmonicCoefficients,this._sphericalHarmonicCoefficients=e}},specularEnvironmentMaps:{get:function(){return this._specularEnvironmentMaps},set:function(e){e!==this._specularEnvironmentMaps&&(this._specularEnvironmentCubeMapDirty=this._specularEnvironmentCubeMapDirty||e!==this._specularEnvironmentMaps,this._specularEnvironmentMapLoaded=!1),this._specularEnvironmentMaps=e}},enabled:{get:function(){return this._imageBasedLightingFactor.x>0||this._imageBasedLightingFactor.y>0}},shouldRegenerateShaders:{get:function(){return this._shouldRegenerateShaders}},specularEnvironmentCubeMap:{get:function(){return this._specularEnvironmentCubeMap}},useDefaultSphericalHarmonics:{get:function(){return this._useDefaultSphericalHarmonics}},useDefaultSpecularMaps:{get:function(){return this._useDefaultSpecularMaps}},useSpecularEnvironmentMaps:{get:function(){return l(this._specularEnvironmentCubeMap)&&this._specularEnvironmentCubeMap.ready||this._useDefaultSpecularMaps}}});function srt(e,t){if(Ep.isSupported(t)){if(e._specularEnvironmentCubeMap=e._specularEnvironmentCubeMap&&e._specularEnvironmentCubeMap.destroy(),l(e._specularEnvironmentMaps)){let n=new Ep(e._specularEnvironmentMaps);e._specularEnvironmentCubeMap=n,e._removeErrorListener=n.errorEvent.addEventListener(i=>{console.error(`Error loading specularEnvironmentMaps: ${i}`)})}e._shouldRegenerateShaders=!0}}o1.prototype.update=function(e){if(e.frameNumber===this._previousFrameNumber&&e.context===this._previousFrameContext)return;this._previousFrameNumber=e.frameNumber;let t=this._previousFrameContext=e.context;e.brdfLutGenerator.update(e),this._shouldRegenerateShaders=!1;let n=this._imageBasedLightingFactor,i=this._previousImageBasedLightingFactor;U.equals(n,i)||(this._shouldRegenerateShaders=n.x>0&&i.x===0||n.x===0&&i.x>0,this._shouldRegenerateShaders=this._shouldRegenerateShaders||n.y>0&&i.y===0||n.y===0&&i.y>0,this._previousImageBasedLightingFactor=U.clone(this._imageBasedLightingFactor,this._previousImageBasedLightingFactor)),this._previousSphericalHarmonicCoefficients!==this._sphericalHarmonicCoefficients&&(this._shouldRegenerateShaders=this._shouldRegenerateShaders||l(this._previousSphericalHarmonicCoefficients)!==l(this._sphericalHarmonicCoefficients),this._previousSphericalHarmonicCoefficients=this._sphericalHarmonicCoefficients),this._shouldRegenerateShaders=this._shouldRegenerateShaders||this._previousSpecularEnvironmentMapLoaded!==this._specularEnvironmentMapLoaded,this._previousSpecularEnvironmentMapLoaded=this._specularEnvironmentMapLoaded,this._specularEnvironmentCubeMapDirty&&(srt(this,t),this._specularEnvironmentCubeMapDirty=!1),l(this._specularEnvironmentCubeMap)&&(this._specularEnvironmentCubeMap.update(e),this._specularEnvironmentCubeMap.ready&&(this._specularEnvironmentMapLoaded=!0));let r=!l(this._specularEnvironmentCubeMap)&&l(e.specularEnvironmentMaps)&&!this._useDefaultSpecularMaps,o=!l(e.specularEnvironmentMaps)&&this._useDefaultSpecularMaps,s=!l(this._sphericalHarmonicCoefficients)&&l(e.sphericalHarmonicCoefficients)&&!this._useDefaultSphericalHarmonics,a=!l(e.sphericalHarmonicCoefficients)&&this._useDefaultSphericalHarmonics;this._shouldRegenerateShaders=this._shouldRegenerateShaders||r||o||s||a,this._useDefaultSpecularMaps=!l(this._specularEnvironmentCubeMap)&&l(e.specularEnvironmentMaps),this._useDefaultSphericalHarmonics=!l(this._sphericalHarmonicCoefficients)&&l(e.sphericalHarmonicCoefficients)};o1.prototype.isDestroyed=function(){return!1};o1.prototype.destroy=function(){return this._specularEnvironmentCubeMap=this._specularEnvironmentCubeMap&&this._specularEnvironmentCubeMap.destroy(),this._removeErrorListener=this._removeErrorListener&&this._removeErrorListener(),le(this)};var Fv=o1;var gz=`uniform sampler2D u_pointCloud_colorGBuffer; uniform sampler2D u_pointCloud_depthGBuffer; uniform vec2 u_distanceAndEdlStrength; in vec2 v_textureCoordinates; @@ -8198,7 +8068,7 @@ color.rgb *= shade; out_FragColor = vec4(color); gl_FragDepth = depthOrLogDepth; } -`;function nv(){this._framebuffer=new ci({colorAttachmentsLength:2,depth:!0,supportsDepthTexture:!0}),this._drawCommand=void 0,this._clearCommand=void 0,this._strength=1,this._radius=1}Object.defineProperties(nv.prototype,{framebuffer:{get:function(){return this._framebuffer.framebuffer}},colorGBuffer:{get:function(){return this._framebuffer.getColorTexture(0)}},depthGBuffer:{get:function(){return this._framebuffer.getColorTexture(1)}}});function qet(e){e._framebuffer.destroy(),e._drawCommand=void 0,e._clearCommand=void 0}var oJ=new U;function Yet(e,t){let n=new Xe({defines:["LOG_DEPTH_WRITE"],sources:[xU]}),i={u_pointCloud_colorGBuffer:function(){return e.colorGBuffer},u_pointCloud_depthGBuffer:function(){return e.depthGBuffer},u_distanceAndEdlStrength:function(){return oJ.x=e._radius,oJ.y=e._strength,oJ}},r=Ge.fromCache({blending:nn.ALPHA_BLEND,depthMask:!0,depthTest:{enabled:!0},stencilTest:Xt.setCesium3DTileBit(),stencilMask:Xt.CESIUM_3D_TILE_MASK});e._drawCommand=t.createViewportQuadCommand(n,{uniformMap:i,renderState:r,pass:Ie.CESIUM_3D_TILE,owner:e}),e._clearCommand=new fi({framebuffer:e.framebuffer,color:new z(0,0,0,0),depth:1,renderState:Ge.fromCache(),pass:Ie.CESIUM_3D_TILE,owner:e})}function Xet(e,t){let n=t.drawingBufferWidth,i=t.drawingBufferHeight;e._framebuffer.update(t,n,i),Yet(e,t)}function Q0e(e){return e.drawBuffers&&e.fragmentDepth}nv.isSupported=Q0e;function Ket(e,t){let n=e.shaderCache.getDerivedShaderProgram(t,"EC");if(!l(n)){let i=t._attributeLocations,r=t.fragmentShaderSource.clone();r.sources.splice(0,0,`layout (location = 0) out vec4 out_FragData_0; +`;function Bv(){this._framebuffer=new ci({colorAttachmentsLength:2,depth:!0,supportsDepthTexture:!0}),this._drawCommand=void 0,this._clearCommand=void 0,this._strength=1,this._radius=1}Object.defineProperties(Bv.prototype,{framebuffer:{get:function(){return this._framebuffer.framebuffer}},colorGBuffer:{get:function(){return this._framebuffer.getColorTexture(0)}},depthGBuffer:{get:function(){return this._framebuffer.getColorTexture(1)}}});function art(e){e._framebuffer.destroy(),e._drawCommand=void 0,e._clearCommand=void 0}var XJ=new U;function crt(e,t){let n=new Xe({defines:["LOG_DEPTH_WRITE"],sources:[gz]}),i={u_pointCloud_colorGBuffer:function(){return e.colorGBuffer},u_pointCloud_depthGBuffer:function(){return e.depthGBuffer},u_distanceAndEdlStrength:function(){return XJ.x=e._radius,XJ.y=e._strength,XJ}},r=Ge.fromCache({blending:nn.ALPHA_BLEND,depthMask:!0,depthTest:{enabled:!0},stencilTest:Xt.setCesium3DTileBit(),stencilMask:Xt.CESIUM_3D_TILE_MASK});e._drawCommand=t.createViewportQuadCommand(n,{uniformMap:i,renderState:r,pass:Ie.CESIUM_3D_TILE,owner:e}),e._clearCommand=new fi({framebuffer:e.framebuffer,color:new z(0,0,0,0),depth:1,renderState:Ge.fromCache(),pass:Ie.CESIUM_3D_TILE,owner:e})}function lrt(e,t){let n=t.drawingBufferWidth,i=t.drawingBufferHeight;e._framebuffer.update(t,n,i),crt(e,t)}function pAe(e){return e.drawBuffers&&e.fragmentDepth}Bv.isSupported=pAe;function urt(e,t){let n=e.shaderCache.getDerivedShaderProgram(t,"EC");if(!l(n)){let i=t._attributeLocations,r=t.fragmentShaderSource.clone();r.sources.splice(0,0,`layout (location = 0) out vec4 out_FragData_0; layout (location = 1) out vec4 out_FragData_1;`),r.sources=r.sources.map(function(o){return o=Xe.replaceMain(o,"czm_point_cloud_post_process_main"),o=o.replaceAll(/out_FragColor/g,"out_FragData_0"),o}),r.sources.push(`void main() { czm_point_cloud_post_process_main(); @@ -8208,7 +8078,134 @@ layout (location = 1) out vec4 out_FragData_1;`),r.sources=r.sources.map(functio #else out_FragData_1 = czm_packDepth(gl_FragCoord.z); #endif -}`),n=e.shaderCache.createDerivedShaderProgram(t,"EC",{vertexShaderSource:t.vertexShaderSource,fragmentShaderSource:r,attributeLocations:i})}return n}nv.prototype.update=function(e,t,n,i){if(!Q0e(e.context))return;this._strength=n.eyeDomeLightingStrength,this._radius=n.eyeDomeLightingRadius*e.pixelRatio,Xet(this,e.context);let r,o=e.commandList,s=o.length;for(r=t;r<s;++r){let u=o[r];if(u.primitiveType!==Oe.POINTS||u.pass===Ie.TRANSLUCENT)continue;let f,d,p=u.derivedCommands.pointCloudProcessor;l(p)&&(f=p.command,d=p.originalShaderProgram),(!l(f)||u.dirty||d!==u.shaderProgram||f.framebuffer!==this.framebuffer)&&(f=at.shallowClone(u,f),f.framebuffer=this.framebuffer,f.shaderProgram=Ket(e.context,u.shaderProgram),f.castShadows=!1,f.receiveShadows=!1,l(p)||(p={command:f,originalShaderProgram:u.shaderProgram},u.derivedCommands.pointCloudProcessor=p),p.originalShaderProgram=u.shaderProgram),o[r]=f}let a=this._clearCommand,c=this._drawCommand;c.boundingVolume=i,o.push(c),o.push(a)};nv.prototype.isDestroyed=function(){return!1};nv.prototype.destroy=function(){return qet(this),le(this)};var vy=nv;function ege(e){let t=e??{};this.attenuation=t.attenuation??!1,this.geometricErrorScale=t.geometricErrorScale??1,this.maximumAttenuation=t.maximumAttenuation,this.baseResolution=t.baseResolution,this.eyeDomeLighting=t.eyeDomeLighting??!0,this.eyeDomeLightingStrength=t.eyeDomeLightingStrength??1,this.eyeDomeLightingRadius=t.eyeDomeLightingRadius??1,this.backFaceCulling=t.backFaceCulling??!1,this.normalShading=t.normalShading??!0}ege.isSupported=function(e){return vy.isSupported(e.context)};var ng=ege;var xc={},$et=new se(0,0,0,1),Qc=new se,Jet=new et,sJ=new U,aJ=new U;xc.worldToWindowCoordinates=function(e,t,n){return xc.worldWithEyeOffsetToWindowCoordinates(e,t,h.ZERO,n)};var tge=new se,nge=new h;function FD(e,t,n,i){let r=n.viewMatrix,o=M.multiplyByVector(r,se.fromElements(e.x,e.y,e.z,1,tge),tge),s=h.multiplyComponents(t,h.normalize(o,nge),nge);return o.x+=t.x+s.x,o.y+=t.y+s.y,o.z+=s.z,M.multiplyByVector(n.frustum.projectionMatrix,o,i)}var Zet=new he(Math.PI,P.PI_OVER_TWO),Qet=new h,ett=new h;xc.worldWithEyeOffsetToWindowCoordinates=function(e,t,n,i){let r=e.frameState,o=xc.computeActualEllipsoidPosition(r,t,$et);if(!l(o))return;let s=e.canvas,a=Jet;a.x=0,a.y=0,a.width=s.clientWidth,a.height=s.clientHeight;let c=e.camera,u=!1;if(r.mode===re.SCENE2D){let f=e.mapProjection,d=Zet,p=f.project(d,Qet),g=h.clone(c.position,ett),m=c.frustum.clone(),y=M.computeViewportTransformation(a,0,1,new M),A=c.frustum.projectionMatrix,b=c.positionWC.y,x=h.fromElements(P.sign(b)*p.x-b,0,-c.positionWC.x),T=At.pointToGLWindowCoordinates(A,y,x);if(b===0||T.x<=0||T.x>=s.clientWidth)u=!0;else{if(T.x>s.clientWidth*.5){a.width=T.x,c.frustum.right=p.x-b,Qc=FD(o,n,c,Qc),xc.clipToGLWindowCoordinates(a,Qc,sJ),a.x+=T.x,c.position.x=-c.position.x;let E=c.frustum.right;c.frustum.right=-c.frustum.left,c.frustum.left=-E,Qc=FD(o,n,c,Qc),xc.clipToGLWindowCoordinates(a,Qc,aJ)}else{a.x+=T.x,a.width-=T.x,c.frustum.left=-p.x-b,Qc=FD(o,n,c,Qc),xc.clipToGLWindowCoordinates(a,Qc,sJ),a.x=a.x-a.width,c.position.x=-c.position.x;let E=c.frustum.left;c.frustum.left=-c.frustum.right,c.frustum.right=-E,Qc=FD(o,n,c,Qc),xc.clipToGLWindowCoordinates(a,Qc,aJ)}h.clone(g,c.position),c.frustum=m.clone(),i=U.clone(sJ,i),(i.x<0||i.x>s.clientWidth)&&(i.x=aJ.x)}}if(r.mode!==re.SCENE2D||u){if(Qc=FD(o,n,c,Qc),Qc.z<0&&!(c.frustum instanceof _n)&&!(c.frustum instanceof Ss))return;i=xc.clipToGLWindowCoordinates(a,Qc,i)}return i.y=s.clientHeight-i.y,i};xc.worldToDrawingBufferCoordinates=function(e,t,n){if(n=xc.worldToWindowCoordinates(e,t,n),!!l(n))return xc.transformWindowToDrawingBuffer(e,n,n)};var ig=new h,ttt=new he;xc.computeActualEllipsoidPosition=function(e,t,n){let i=e.mode;if(i===re.SCENE3D)return h.clone(t,n);let r=e.mapProjection,o=r.ellipsoid.cartesianToCartographic(t,ttt);if(!l(o))return;if(r.project(o,ig),i===re.COLUMBUS_VIEW)return h.fromElements(ig.z,ig.x,ig.y,n);if(i===re.SCENE2D)return h.fromElements(0,ig.x,ig.y,n);let s=e.morphTime;return h.fromElements(P.lerp(ig.z,t.x,s),P.lerp(ig.x,t.y,s),P.lerp(ig.y,t.z,s),n)};var ige=new h,rge=new h,oge=new M;xc.clipToGLWindowCoordinates=function(e,t,n){return h.divideByScalar(t,t.w,ige),M.computeViewportTransformation(e,0,1,oge),M.multiplyByPoint(oge,ige,rge),U.fromCartesian3(rge,n)};xc.transformWindowToDrawingBuffer=function(e,t,n){let i=e.canvas,r=e.drawingBufferWidth/i.clientWidth,o=e.drawingBufferHeight/i.clientHeight;return U.fromElements(t.x*r,t.y*o,n)};var ntt=new se,sge=new se;xc.drawingBufferToWorldCoordinates=function(e,t,n,i){let o=e.context.uniformState,s=o.currentFrustum,a=s.x,c=s.y;if(e.frameState.useLogDepth){let g=n*o.log2FarDepthFromNearPlusOne,m=Math.pow(2,g)-1;n=c*(1-a/(m+a))/(c-a)}let u=e.view.passState.viewport,f=se.clone(se.UNIT_W,ntt);f.x=(t.x-u.x)/u.width*2-1,f.y=(t.y-u.y)/u.height*2-1,f.z=n*2-1,f.w=1;let d,p=e.camera.frustum;if(l(p.fovy)){d=M.multiplyByVector(o.inverseViewProjection,f,sge);let g=1/d.w;h.multiplyByScalar(d,g,d)}else{let g=p.offCenterFrustum;l(g)&&(p=g),d=sge,d.x=(f.x*(p.right-p.left)+p.left+p.right)*.5,d.y=(f.y*(p.top-p.bottom)+p.bottom+p.top)*.5,d.z=(f.z*(a-c)-a-c)*.5,d.w=1,d=M.multiplyByVector(o.inverseView,d,d)}return h.fromCartesian4(d,i)};var pr=xc;var iv={};iv._deprecationWarning=Yr;var rg=Uint32Array.BYTES_PER_ELEMENT;iv.parse=function(e,t){let n=t??0;t=n;let i=new Uint8Array(e),r=new DataView(e);t+=rg;let o=r.getUint32(t,!0);if(o!==1)throw new oe(`Only Batched 3D Model version 1 is supported. Version ${o} is not.`);t+=rg;let s=r.getUint32(t,!0);t+=rg;let a=r.getUint32(t,!0);t+=rg;let c=r.getUint32(t,!0);t+=rg;let u=r.getUint32(t,!0);t+=rg;let f=r.getUint32(t,!0);t+=rg;let d;u>=570425344?(t-=rg*2,d=a,u=c,f=0,a=0,c=0,iv._deprecationWarning("b3dm-legacy-header","This b3dm header is using the legacy format [batchLength] [batchTableByteLength]. The new format is [featureTableJsonByteLength] [featureTableBinaryByteLength] [batchTableJsonByteLength] [batchTableBinaryByteLength] from https://github.com/CesiumGS/3d-tiles/tree/main/specification/TileFormats/Batched3DModel.")):f>=570425344&&(t-=rg,d=u,u=a,f=c,a=0,c=0,iv._deprecationWarning("b3dm-legacy-header","This b3dm header is using the legacy format [batchTableJsonByteLength] [batchTableBinaryByteLength] [batchLength]. The new format is [featureTableJsonByteLength] [featureTableBinaryByteLength] [batchTableJsonByteLength] [batchTableBinaryByteLength] from https://github.com/CesiumGS/3d-tiles/tree/main/specification/TileFormats/Batched3DModel."));let p;a===0?p={BATCH_LENGTH:d??0}:(p=No(i,t,a),t+=a);let g=new Uint8Array(e,t,c);t+=c;let m,y;u>0&&(m=No(i,t,u),t+=u,f>0&&(y=new Uint8Array(e,t,f),y=new Uint8Array(y),t+=f));let A=n+s-t;if(A===0)throw new oe("glTF byte length must be greater than 0.");let b;return t%4===0?b=new Uint8Array(e,t,A):(iv._deprecationWarning("b3dm-glb-unaligned","The embedded glb is not aligned to a 4-byte boundary."),b=new Uint8Array(i.subarray(t,t+A))),{batchLength:d,featureTableJson:p,featureTableBinary:g,batchTableJson:m,batchTableBinary:y,gltf:b}};var TU=iv;function BD(e,t){this.json=e,this.buffer=t,this._cachedTypedArrays={},this.featuresLength=0}function age(e,t,n,i,r,o){let s=e._cachedTypedArrays,a=s[t];return l(a)||(a=Y.createArrayBufferView(n,e.buffer.buffer,e.buffer.byteOffset+o,r*i),s[t]=a),a}function itt(e,t,n,i){let r=e._cachedTypedArrays,o=r[t];return l(o)||(o=Y.createTypedArray(n,i),r[t]=o),o}BD.prototype.getGlobalProperty=function(e,t,n){let i=this.json[e];if(l(i))return l(i.byteOffset)?(t=t??Y.UNSIGNED_INT,n=n??1,age(this,e,t,n,1,i.byteOffset)):i};BD.prototype.hasProperty=function(e){return l(this.json[e])};BD.prototype.getPropertyArray=function(e,t,n){let i=this.json[e];if(l(i))return l(i.byteOffset)?(l(i.componentType)&&(t=Y.fromName(i.componentType)),age(this,e,t,n,this.featuresLength,i.byteOffset)):itt(this,e,t,i)};BD.prototype.getProperty=function(e,t,n,i,r){let o=this.json[e];if(!l(o))return;let s=this.getPropertyArray(e,t,n);if(n===1)return s[i];for(let a=0;a<n;++a)r[a]=s[n*i+a];return r};var pp=BD;function kD(e){let t=e.count,n=e.batchTable,i=e.binaryBody,r=e.parseAsPropertyAttributes??!1,o=e.customAttributeOutput,s=rtt(n),a;l(s.jsonProperties)&&(a=new Ey({count:t,properties:s.jsonProperties}));let c;l(s.hierarchy)&&(c=new SC({extension:s.hierarchy,binaryBody:i}));let u=dp.BATCH_TABLE_CLASS_NAME,f=s.binaryProperties,d,p,g;if(r){let A=stt(t,u,f,i,o);g=A.transcodedSchema,p=[new JC({propertyAttribute:A.propertyAttributeJson,class:A.transcodedClass})]}else{let A=ott(t,u,f,i);g=A.transcodedSchema;let b=A.featureTableJson;d=new wh({count:b.count,properties:b.properties,class:A.transcodedClass,bufferViews:A.bufferViewsTypedArrays}),p=[]}let m=[];if(l(d)||l(a)||l(c)){let A=new Su({id:0,name:"Batch Table",count:t,metadataTable:d,jsonMetadataTable:a,batchTableHierarchy:c});m.push(A)}let y={schema:g,propertyTables:m,propertyAttributes:p,extensions:s.extensions,extras:s.extras};return new Qa(y)}function rtt(e){let t=e.HIERARCHY,n=e.extras,i=e.extensions,r;l(t)?(kD._deprecationWarning("batchTableHierarchyExtension","The batch table HIERARCHY property has been moved to an extension. Use extensions.3DTILES_batch_table_hierarchy instead."),r=t):l(i)&&(r=i["3DTILES_batch_table_hierarchy"]);let o,s={};for(let a in e){if(!e.hasOwnProperty(a)||a==="HIERARCHY"||a==="extensions"||a==="extras")continue;let c=e[a];Array.isArray(c)?(o=l(o)?o:{},o[a]=c):s[a]=c}return{binaryProperties:s,jsonProperties:o,hierarchy:r,extras:n,extensions:i}}function ott(e,t,n,i){let r={},o={},s={},a=0;for(let d in n){if(!n.hasOwnProperty(d))continue;if(!l(i))throw new oe(`Property ${d} requires a batch table binary.`);let p=n[d],g=Eh(p);o[d]={bufferView:a},r[d]=cge(p),s[a]=g.createArrayBufferView(i.buffer,i.byteOffset+p.byteOffset,e),a++}let c={classes:{}};c.classes[t]={properties:r};let u=Eu.fromJson(c);return{featureTableJson:{class:t,count:e,properties:o},bufferViewsTypedArrays:s,transcodedSchema:u,transcodedClass:u.classes[t]}}function stt(e,t,n,i,r){let o={},s={},a=0;for(let d in n){if(!n.hasOwnProperty(d))continue;let p=n[d];if(!l(i)&&!l(p.typedArray))throw new oe(`Property ${d} requires a batch table binary.`);let g=xt.sanitizeGlslIdentifier(d);(g===""||o.hasOwnProperty(g))&&(g=`property_${a}`,a++);let m=cge(p);m.name=d,o[g]=m;let y=g.toUpperCase();y.startsWith("_")||(y=`_${y}`);let A=p.typedArray;l(A)||(A=Eh(p).createArrayBufferView(i.buffer,i.byteOffset+p.byteOffset,e));let b=new vn.Attribute;b.name=y,b.count=e,b.type=p.type;let x=Y.fromTypedArray(A);(x===Y.INT||x===Y.UNSIGNED_INT||x===Y.DOUBLE)&&(kD._oneTimeWarning("Cast pnts property to floats",`Point cloud property "${y}" will be cast to a float array because INT, UNSIGNED_INT, and DOUBLE are not valid WebGL vertex attribute types. Some precision may be lost.`),A=new Float32Array(A)),b.componentDatatype=Y.fromTypedArray(A),b.typedArray=A,r.push(b),s[g]={attribute:y}}let c={classes:{}};c.classes[t]={properties:o};let u=Eu.fromJson(c);return{class:t,propertyAttributeJson:{properties:s},transcodedSchema:u,transcodedClass:u.classes[t]}}function cge(e){let t=att(e.componentType);return{type:e.type,componentType:t}}function att(e){switch(e){case"BYTE":return"INT8";case"UNSIGNED_BYTE":return"UINT8";case"SHORT":return"INT16";case"UNSIGNED_SHORT":return"UINT16";case"INT":return"INT32";case"UNSIGNED_INT":return"UINT32";case"FLOAT":return"FLOAT32";case"DOUBLE":return"FLOAT64"}}kD._deprecationWarning=Yr;kD._oneTimeWarning=yt;var Sy=kD;var cx={UNLOADED:0,LOADING:1,PROCESSING:2,READY:3,FAILED:4},ctt=vn.FeatureIdAttribute,cJ=class extends ar{constructor(t){super(),t=t??H.EMPTY_OBJECT;let n=t.b3dmResource,i=t.baseResource,r=t.arrayBuffer,o=t.byteOffset??0,s=t.releaseGltfJson??!1,a=t.asynchronous??!0,c=t.incrementallyLoadTextures??!0,u=t.upAxis??qi.Y,f=t.forwardAxis??qi.X,d=t.loadAttributesAsTypedArray??!1,p=t.loadAttributesFor2D??!1,g=t.enablePick??!1,m=t.loadIndicesForWireframe??!1,y=t.loadPrimitiveOutline??!0,A=t.loadForClassification??!1;i=l(i)?i:n.clone(),this._b3dmResource=n,this._baseResource=i,this._arrayBuffer=r,this._byteOffset=o,this._releaseGltfJson=s,this._asynchronous=a,this._incrementallyLoadTextures=c,this._upAxis=u,this._forwardAxis=f,this._loadAttributesAsTypedArray=d,this._loadAttributesFor2D=p,this._enablePick=g,this._loadIndicesForWireframe=m,this._loadPrimitiveOutline=y,this._loadForClassification=A,this._state=cx.UNLOADED,this._promise=void 0,this._gltfLoader=void 0,this._batchLength=0,this._propertyTable=void 0,this._batchTable=void 0,this._components=void 0,this._transform=M.IDENTITY}get texturesLoaded(){return this._gltfLoader?.texturesLoaded}get cacheKey(){}get components(){return this._components}load(){if(l(this._promise))return this._promise;let t=TU.parse(this._arrayBuffer,this._byteOffset),n=t.featureTableJson,i=t.featureTableBinary,r=t.batchTableJson,o=t.batchTableBinary,s=new pp(n,i),a=s.getGlobalProperty("BATCH_LENGTH");this._batchLength=a;let c=s.getGlobalProperty("RTC_CENTER",Y.FLOAT,3);l(c)&&(this._transform=M.fromTranslation(h.fromArray(c))),this._batchTable={json:r,binary:o};let u=new _d({typedArray:t.gltf,upAxis:this._upAxis,forwardAxis:this._forwardAxis,gltfResource:this._b3dmResource,baseResource:this._baseResource,releaseGltfJson:this._releaseGltfJson,incrementallyLoadTextures:this._incrementallyLoadTextures,loadAttributesAsTypedArray:this._loadAttributesAsTypedArray,loadAttributesFor2D:this._loadAttributesFor2D,enablePick:this._enablePick,loadIndicesForWireframe:this._loadIndicesForWireframe,loadPrimitiveOutline:this._loadPrimitiveOutline,loadForClassification:this._loadForClassification,renameBatchIdSemantic:!0});this._gltfLoader=u,this._state=cx.LOADING;let f=this;return this._promise=u.load().then(function(){if(!f.isDestroyed())return f._state=cx.PROCESSING,f}).catch(function(d){if(!f.isDestroyed())return ltt(f,d)}),this._promise}process(t){if(this._state===cx.READY)return!0;if(this._state!==cx.PROCESSING||!this._gltfLoader.process(t))return!1;let i=this._gltfLoader.components;return i.transform=M.multiplyTransformation(this._transform,i.transform,i.transform),utt(this,i),this._components=i,this._arrayBuffer=void 0,this._state=cx.READY,!0}unload(){l(this._gltfLoader)&&!this._gltfLoader.isDestroyed()&&this._gltfLoader.unload(),this._components=void 0,this._arrayBuffer=void 0}};function ltt(e,t){return e.unload(),e._state=cx.FAILED,t=e.getError("Failed to load b3dm",t),Promise.reject(t)}function utt(e,t){let n=e._batchTable,i=e._batchLength;if(i===0)return;let r;if(l(n.json))r=Sy({count:i,batchTable:n.json,binaryBody:n.binary});else{let a=new Su({name:dp.BATCH_TABLE_CLASS_NAME,count:i});r=new Qa({schema:{},propertyTables:[a]})}let o=t.scene.nodes,s=o.length;for(let a=0;a<s;a++)lge(o[a]);t.structuralMetadata=r}function lge(e){let t=e.children.length;for(let i=0;i<t;i++)lge(e.children[i]);let n=e.primitives.length;for(let i=0;i<n;i++){let r=e.primitives[i],o=xt.getAttributeBySemantic(r,ct.FEATURE_ID);if(l(o)){o.setIndex=0;let s=new ctt;s.propertyTableId=0,s.setIndex=0,s.positionalLabel="featureId_0",r.featureIds.push(s)}}}var EU=cJ;var lJ=class extends ar{constructor(t){super(),t=t??H.EMPTY_OBJECT,this._geoJson=t.geoJson,this._components=void 0}get cacheKey(){}get components(){return this._components}load(){return Promise.resolve(this)}process(t){return l(this._components)||(this._components=Ett(this._geoJson,t),this._geoJson=void 0),!0}unload(){this._components=void 0}};function ftt(){this.lines=void 0,this.points=void 0,this.properties=void 0}function dtt(){this.features=[]}function uJ(e){let t=e[0],n=e[1],i=e[2]??0;return new h(t,n,i)}function fJ(e){let t=e.length,n=new Array(t);for(let r=0;r<t;r++)n[r]=uJ(e[r]);return[n]}function htt(e){let t=e.length,n=new Array(t);for(let i=0;i<t;i++)n[i]=fJ(e[i])[0];return n}function uge(e){let t=e.length,n=new Array(t);for(let i=0;i<t;i++)n[i]=fJ(e[i])[0];return n}function mtt(e){let t=e.length,n=[];for(let i=0;i<t;i++){let r=uge(e[i]);Zn(n,r)}return n}function ptt(e){return[uJ(e)]}function gtt(e){let t=e.length,n=new Array(t);for(let i=0;i<t;i++)n[i]=uJ(e[i]);return n}var _tt={LineString:fJ,MultiLineString:htt,MultiPolygon:mtt,Polygon:uge,MultiPoint:gtt,Point:ptt},ytt={LineString:Oe.LINES,MultiLineString:Oe.LINES,MultiPolygon:Oe.LINES,Polygon:Oe.LINES,MultiPoint:Oe.POINTS,Point:Oe.POINTS};function fge(e,t){if(!l(e.geometry))return;let n=e.geometry.type,i=_tt[n],r=ytt[n],o=e.geometry.coordinates;if(!l(i)||!l(o))return;let s=new ftt;r===Oe.LINES?s.lines=i(o):r===Oe.POINTS&&(s.points=i(o)),s.properties=e.properties,t.features.push(s)}function Att(e,t){let n=e.features,i=n.length;for(let r=0;r<i;r++)fge(n[r],t)}var btt={FeatureCollection:Att,Feature:fge},CU=new h;function xtt(e,t,n){let i=0,r=0,o=e.length;for(let O=0;O<o;O++){let L=e[O];if(l(L.lines)){let _=L.lines.length;for(let C=0;C<_;C++){let w=L.lines[C];i+=w.length,r+=(w.length-1)*2}}}let s=new Float32Array(i*3),a=new Float32Array(i),c=je.createTypedArray(i,r),u=je.fromTypedArray(c),f=new h(Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY),d=new h(Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY),p=0,g=0;for(let O=0;O<o;O++){let L=e[O];if(!l(L.lines))continue;let _=L.lines.length;for(let C=0;C<_;C++){let w=L.lines[C],D=w.length;for(let N=0;N<D;N++){let F=w[N],V=h.fromDegrees(F.x,F.y,F.z,ee.WGS84,CU),B=M.multiplyByPoint(t,V,CU);h.minimumByComponent(f,B,f),h.maximumByComponent(d,B,d),h.pack(B,s,p*3),a[p]=O,N<D-1&&(c[g*2]=p,c[g*2+1]=p+1,g++),p++}}}let m=tt.createVertexBuffer({typedArray:s,context:n.context,usage:Me.STATIC_DRAW});m.vertexArrayDestroyable=!1;let y=tt.createVertexBuffer({typedArray:a,context:n.context,usage:Me.STATIC_DRAW});y.vertexArrayDestroyable=!1;let A=tt.createIndexBuffer({typedArray:c,context:n.context,usage:Me.STATIC_DRAW,indexDatatype:u});A.vertexArrayDestroyable=!1;let b=new vn.Attribute;b.semantic=ct.POSITION,b.componentDatatype=Y.FLOAT,b.type=Vt.VEC3,b.count=i,b.min=f,b.max=d,b.buffer=m;let x=new vn.Attribute;x.semantic=ct.FEATURE_ID,x.setIndex=0,x.componentDatatype=Y.FLOAT,x.type=Vt.SCALAR,x.count=i,x.buffer=y;let T=[b,x],E=new vn.Material;E.unlit=!0;let v=new vn.Indices;v.indexDatatype=u,v.count=c.length,v.buffer=A;let S=new vn.FeatureIdAttribute;S.featureCount=o,S.propertyTableId=0,S.setIndex=0,S.positionalLabel="featureId_0";let I=[S],R=new vn.Primitive;return R.attributes=T,R.indices=v,R.featureIds=I,R.primitiveType=Oe.LINES,R.material=E,R}function Ttt(e,t,n){let i=0,r=e.length;for(let T=0;T<r;T++){let E=e[T];l(E.points)&&(i+=E.points.length)}let o=new Float32Array(i*3),s=new Float32Array(i),a=new h(Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY),c=new h(Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY),u=0;for(let T=0;T<r;T++){let E=e[T];if(!l(E.points))continue;let v=E.points.length;for(let S=0;S<v;S++){let I=E.points[S],R=h.fromDegrees(I.x,I.y,I.z,ee.WGS84,CU),O=M.multiplyByPoint(t,R,CU);h.minimumByComponent(a,O,a),h.maximumByComponent(c,O,c),h.pack(O,o,u*3),s[u]=T,u++}}let f=tt.createVertexBuffer({typedArray:o,context:n.context,usage:Me.STATIC_DRAW});f.vertexArrayDestroyable=!1;let d=tt.createVertexBuffer({typedArray:s,context:n.context,usage:Me.STATIC_DRAW});d.vertexArrayDestroyable=!1;let p=new vn.Attribute;p.semantic=ct.POSITION,p.componentDatatype=Y.FLOAT,p.type=Vt.VEC3,p.count=i,p.min=a,p.max=c,p.buffer=f;let g=new vn.Attribute;g.semantic=ct.FEATURE_ID,g.setIndex=0,g.componentDatatype=Y.FLOAT,g.type=Vt.SCALAR,g.count=i,g.buffer=d;let m=[p,g],y=new vn.Material;y.unlit=!0;let A=new vn.FeatureIdAttribute;A.featureCount=r,A.propertyTableId=0,A.setIndex=0,A.positionalLabel="featureId_0";let b=[A],x=new vn.Primitive;return x.attributes=m,x.featureIds=b,x.primitiveType=Oe.POINTS,x.material=y,x}function Ett(e,t){let n=new dtt,i=btt[e.type];l(i)&&i(e,n);let r=n.features,o=r.length;if(o===0)throw new oe("GeoJSON must have at least one feature");let s={};for(let O=0;O<o;O++){let _=r[O].properties??H.EMPTY_OBJECT;for(let C in _)_.hasOwnProperty(C)&&(l(s[C])||(s[C]=new Array(o)))}for(let O=0;O<o;O++){let L=r[O];for(let _ in s)if(s.hasOwnProperty(_)){let C=L.properties[_]??"";s[_][O]=C}}let a=new Ey({count:o,properties:s}),u=[new Su({id:0,count:o,jsonMetadataTable:a})],f=Eu.fromJson({}),d=new Qa({schema:f,propertyTables:u}),p=new h(Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY),g=new h(Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY),m=!1,y=!1;for(let O=0;O<o;O++){let L=r[O];if(l(L.lines)){m=!0;let _=L.lines.length;for(let C=0;C<_;C++){let w=L.lines[C],D=w.length;for(let N=0;N<D;N++)h.minimumByComponent(p,w[N],p),h.maximumByComponent(g,w[N],g)}}if(l(L.points)){y=!0;let _=L.points.length;for(let C=0;C<_;C++){let w=L.points[C];h.minimumByComponent(p,w,p),h.maximumByComponent(g,w,g)}}}let A=h.midpoint(p,g,new h),b=h.fromDegrees(A.x,A.y,A.z,ee.WGS84,new h),x=At.eastNorthUpToFixedFrame(b,ee.WGS84,new M),T=M.inverseTransformation(x,new M),E=[];m&&E.push(xtt(r,T,t)),y&&E.push(Ttt(r,T,t));let v=new vn.Node;v.index=0,v.primitives=E;let S=[v],I=new vn.Scene;I.nodes=S;let R=new vn.Components;return R.scene=I,R.nodes=S,R.transform=x,R.structuralMetadata=d,R}var vU=lJ;var SU={};SU._deprecationWarning=Yr;var wy=Uint32Array.BYTES_PER_ELEMENT;SU.parse=function(e,t){let n=t??0;t=n;let i=new Uint8Array(e),r=new DataView(e);t+=wy;let o=r.getUint32(t,!0);if(o!==1)throw new oe(`Only Instanced 3D Model version 1 is supported. Version ${o} is not.`);t+=wy;let s=r.getUint32(t,!0);t+=wy;let a=r.getUint32(t,!0);if(a===0)throw new oe("featureTableJsonByteLength is zero, the feature table must be defined.");t+=wy;let c=r.getUint32(t,!0);t+=wy;let u=r.getUint32(t,!0);t+=wy;let f=r.getUint32(t,!0);t+=wy;let d=r.getUint32(t,!0);if(d!==1&&d!==0)throw new oe(`Only glTF format 0 (uri) or 1 (embedded) are supported. Format ${d} is not.`);t+=wy;let p=No(i,t,a);t+=a;let g=new Uint8Array(e,t,c);t+=c;let m,y;u>0&&(m=No(i,t,u),t+=u,f>0&&(y=new Uint8Array(e,t,f),y=new Uint8Array(y),t+=f));let A=n+s-t;if(A===0)throw new oe("glTF byte length must be greater than 0.");let b;return t%4===0?b=new Uint8Array(e,t,A):(SU._deprecationWarning("i3dm-glb-unaligned","The embedded glb is not aligned to a 4-byte boundary."),b=new Uint8Array(i.subarray(t,t+A))),{gltfFormat:d,featureTableJson:p,featureTableBinary:g,batchTableJson:m,batchTableBinary:y,gltf:b}};var wU=SU;var og={NOT_LOADED:0,LOADING:1,PROCESSING:2,POST_PROCESSING:3,READY:4,FAILED:5,UNLOADED:6},IU=vn.Attribute,Ctt=vn.FeatureIdAttribute,hge=vn.Instances,dJ=class extends ar{constructor(t){super(),t=t??H.EMPTY_OBJECT;let n=t.i3dmResource,i=t.arrayBuffer,r=t.baseResource,o=t.byteOffset??0,s=t.releaseGltfJson??!1,a=t.asynchronous??!0,c=t.incrementallyLoadTextures??!0,u=t.upAxis??qi.Y,f=t.forwardAxis??qi.X,d=t.loadAttributesAsTypedArray??!1,p=t.loadIndicesForWireframe??!1,g=t.loadPrimitiveOutline??!0,m=t.enablePick??!1;r=l(r)?r:n.clone(),this._i3dmResource=n,this._baseResource=r,this._arrayBuffer=i,this._byteOffset=o,this._releaseGltfJson=s,this._asynchronous=a,this._incrementallyLoadTextures=c,this._upAxis=u,this._forwardAxis=f,this._loadAttributesAsTypedArray=d,this._loadIndicesForWireframe=p,this._loadPrimitiveOutline=g,this._enablePick=m,this._state=og.NOT_LOADED,this._promise=void 0,this._gltfLoader=void 0,this._buffers=[],this._components=void 0,this._transform=M.IDENTITY,this._batchTable=void 0,this._featureTable=void 0,this._instancesLength=0}get texturesLoaded(){return this._gltfLoader?.texturesLoaded}get cacheKey(){}get components(){return this._components}load(){if(l(this._promise))return this._promise;let t=wU.parse(this._arrayBuffer,this._byteOffset),n=t.featureTableJson,i=t.featureTableBinary,r=t.batchTableJson,o=t.batchTableBinary,s=t.gltfFormat,a=new pp(n,i);this._featureTable=a;let c=a.getGlobalProperty("INSTANCES_LENGTH");if(a.featuresLength=c,!l(c))throw new oe("Feature table global property: INSTANCES_LENGTH must be defined");this._instancesLength=c;let u=a.getGlobalProperty("RTC_CENTER",Y.FLOAT,3);l(u)&&(this._transform=M.fromTranslation(h.fromArray(u))),this._batchTable={json:r,binary:o};let f={upAxis:this._upAxis,forwardAxis:this._forwardAxis,releaseGltfJson:this._releaseGltfJson,incrementallyLoadTextures:this._incrementallyLoadTextures,loadAttributesAsTypedArray:this._loadAttributesAsTypedArray,enablePick:this._enablePick,loadIndicesForWireframe:this._loadIndicesForWireframe,loadPrimitiveOutline:this._loadPrimitiveOutline};if(s===0){let p=ff(t.gltf);p=p.replace(/[\s\0]+$/,"");let g=this._baseResource.getDerivedResource({url:p});f.gltfResource=g,f.baseResource=g}else f.gltfResource=this._i3dmResource,f.typedArray=t.gltf;let d=new _d(f);return this._gltfLoader=d,this._state=og.LOADING,this._promise=d.load().then(()=>{if(!this.isDestroyed())return this._state=og.PROCESSING,this}).catch(p=>{if(!this.isDestroyed())throw vtt(this,p)}),this._promise}process(t){if(this._state===og.READY)return!0;let n=this._gltfLoader,i=!1;if(this._state===og.PROCESSING&&(i=n.process(t)),!i)return!1;let r=n.components;return r.transform=M.multiplyTransformation(this._transform,r.transform,r.transform),Itt(this,r,t),Stt(this,r),this._components=r,this._arrayBuffer=void 0,this._state=og.READY,!0}isUnloaded(){return this._state===og.UNLOADED}unload(){l(this._gltfLoader)&&!this._gltfLoader.isDestroyed()&&this._gltfLoader.unload(),Mtt(this),this._components=void 0,this._arrayBuffer=void 0,this._state=og.UNLOADED}};function vtt(e,t){return e.unload(),e._state=og.FAILED,e.getError("Failed to load i3dm",t)}function Stt(e,t){let n=e._batchTable,i=e._instancesLength;if(i===0)return;let r;if(l(n.json))r=Sy({count:i,batchTable:n.json,binaryBody:n.binary});else{let o=new Su({name:dp.BATCH_TABLE_CLASS_NAME,count:i});r=new Qa({schema:{},propertyTables:[o]})}t.structuralMetadata=r}var PU=new h,hJ=new Array(4),wtt=new M;function Itt(e,t,n){let i,r=e._featureTable,o=e._instancesLength;if(o===0)return;let s=r.getGlobalProperty("RTC_CENTER",Y.FLOAT,3),a=r.getGlobalProperty("EAST_NORTH_UP"),c=r.hasProperty("NORMAL_UP")||r.hasProperty("NORMAL_UP_OCT32P")||a,u=r.hasProperty("SCALE")||r.hasProperty("SCALE_NON_UNIFORM"),f=Dtt(r,o),d;c&&(d=new Float32Array(4*o));let p;u&&(p=new Float32Array(3*o));let g=new Float32Array(o),m=h.unpackArray(f),y,A=new h,b=new h,x=new h,T=new $,E=new Le,v=new Array(4),S=new h,I=new Array(3),R=new M;if(!l(s)||h.equals(h.unpack(s),h.ZERO)){let B=ue.fromPoints(m);for(i=0;i<m.length;i++)h.subtract(m[i],B.center,PU),f[3*i+0]=PU.x,f[3*i+1]=PU.y,f[3*i+2]=PU.z;let j=M.fromTranslation(B.center,wtt);t.transform=M.multiplyTransformation(j,t.transform,t.transform)}for(i=0;i<o;i++){y=h.clone(m[i]),l(s)&&h.add(y,h.unpack(s),y),c&&(Rtt(r,a,i,E,y,b,A,x,T,R),Le.pack(E,v,0),d[4*i+0]=v[0],d[4*i+1]=v[1],d[4*i+2]=v[2],d[4*i+3]=v[3]),u&&(Ott(r,i,S),h.pack(S,I,0),p[3*i+0]=I[0],p[3*i+1]=I[1],p[3*i+2]=I[2]);let B=r.getProperty("BATCH_ID",Y.UNSIGNED_SHORT,1,i);l(B)||(B=i),g[i]=B}let O=new hge;O.transformInWorldSpace=!0;let L=e._buffers,_=new IU;if(_.name="Instance Translation",_.semantic=Fo.TRANSLATION,_.componentDatatype=Y.FLOAT,_.type=Vt.VEC3,_.count=o,_.typedArray=f,!c){let B=tt.createVertexBuffer({context:n.context,typedArray:f,usage:Me.STATIC_DRAW});B.vertexArrayDestroyable=!1,L.push(B),_.buffer=B}if(O.attributes.push(_),c){let B=new IU;B.name="Instance Rotation",B.semantic=Fo.ROTATION,B.componentDatatype=Y.FLOAT,B.type=Vt.VEC4,B.count=o,B.typedArray=d,O.attributes.push(B)}if(u){let B=new IU;if(B.name="Instance Scale",B.semantic=Fo.SCALE,B.componentDatatype=Y.FLOAT,B.type=Vt.VEC3,B.count=o,c)B.typedArray=p;else{let j=tt.createVertexBuffer({context:n.context,typedArray:p,usage:Me.STATIC_DRAW});j.vertexArrayDestroyable=!1,L.push(j),B.buffer=j}O.attributes.push(B)}let C=new IU;C.name="Instance Feature ID",C.setIndex=0,C.semantic=Fo.FEATURE_ID,C.componentDatatype=Y.FLOAT,C.type=Vt.SCALAR,C.count=o;let w=tt.createVertexBuffer({context:n.context,typedArray:g,usage:Me.STATIC_DRAW});w.vertexArrayDestroyable=!1,L.push(w),C.buffer=w,O.attributes.push(C);let D=new Ctt;D.propertyTableId=0,D.setIndex=0,D.positionalLabel="instanceFeatureId_0",O.featureIds.push(D);let N=t.nodes,F=N.length,V=!1;for(i=0;i<F;i++){let B=N[i];B.primitives.length>0&&(B.instances=V?Ptt(O):O,V=!0)}}function Ptt(e){let t=new hge;t.transformInWorldSpace=e.transformInWorldSpace;let n=e.attributes,i=n.length;for(let r=0;r<i;r++){let o=Ze(n[r],!1);t.attributes.push(o)}return t.featureIds=e.featureIds,t}function Dtt(e,t){if(e.hasProperty("POSITION"))return e.getPropertyArray("POSITION",Y.FLOAT,3);if(e.hasProperty("POSITION_QUANTIZED")){let n=e.getPropertyArray("POSITION_QUANTIZED",Y.UNSIGNED_SHORT,3),i=e.getGlobalProperty("QUANTIZED_VOLUME_OFFSET",Y.FLOAT,3);if(!l(i))throw new oe("Global property: QUANTIZED_VOLUME_OFFSET must be defined for quantized positions.");let r=e.getGlobalProperty("QUANTIZED_VOLUME_SCALE",Y.FLOAT,3);if(!l(r))throw new oe("Global property: QUANTIZED_VOLUME_SCALE must be defined for quantized positions.");let o=new Float32Array(n.length);for(let s=0;s<n.length/3;s++)for(let a=0;a<3;a++){let c=3*s+a;o[c]=n[c]/65535*r[a]+i[a]}return o}else throw new oe("Either POSITION or POSITION_QUANTIZED must be defined for each instance.")}var dge=new Array(4);function Rtt(e,t,n,i,r,o,s,a,c,u){let f=e.getProperty("NORMAL_UP",Y.FLOAT,3,n,hJ),d=e.getProperty("NORMAL_RIGHT",Y.FLOAT,3,n,dge),p=!1;if(l(f)){if(!l(d))throw new oe("To define a custom orientation, both NORMAL_UP and NORMAL_RIGHT must be defined.");h.unpack(f,0,o),h.unpack(d,0,s),p=!0}else{let g=e.getProperty("NORMAL_UP_OCT32P",Y.UNSIGNED_SHORT,2,n,hJ),m=e.getProperty("NORMAL_RIGHT_OCT32P",Y.UNSIGNED_SHORT,2,n,dge);if(l(g)){if(!l(m))throw new oe("To define a custom orientation with oct-encoded vectors, both NORMAL_UP_OCT32P and NORMAL_RIGHT_OCT32P must be defined.");cn.octDecodeInRange(g[0],g[1],65535,o),cn.octDecodeInRange(m[0],m[1],65535,s),p=!0}else t?(At.eastNorthUpToFixedFrame(r,ee.WGS84,u),M.getMatrix3(u,c)):$.clone($.IDENTITY,c)}p&&(h.cross(s,o,a),h.normalize(a,a),$.setColumn(c,0,s,c),$.setColumn(c,1,o,c),$.setColumn(c,2,a,c)),Le.fromRotationMatrix(c,i)}function Ott(e,t,n){n=h.fromElements(1,1,1,n);let i=e.getProperty("SCALE",Y.FLOAT,1,t);l(i)&&h.multiplyByScalar(n,i,n);let r=e.getProperty("SCALE_NON_UNIFORM",Y.FLOAT,3,t,hJ);l(r)&&(n.x*=r[0],n.y*=r[1],n.z*=r[2])}function Mtt(e){let t=e._buffers,n=t.length;for(let i=0;i<n;i++){let r=t[i];r.isDestroyed()||r.destroy()}t.length=0}var DU=dJ;var mge={STOPPED:0,ANIMATING:1};Object.freeze(mge);var gp=mge;function rv(){this.times=void 0,this.points=void 0,pe.throwInstantiationError()}rv.getPointType=function(e){if(typeof e=="number")return Number;if(e instanceof h)return h;if(e instanceof Le)return Le};rv.prototype.evaluate=pe.throwInstantiationError;rv.prototype.findTimeInterval=function(e,t){let n=this.times,i=n.length;if(t=t??0,e>=n[t]){if(t+1<i&&e<n[t+1])return t;if(t+2<i&&e<n[t+2])return t+1}else if(t-1>=0&&e>=n[t-1])return t-1;let r;if(e>n[t])for(r=t;r<i-1&&!(e>=n[r]&&e<n[r+1]);++r);else for(r=t-1;r>=0&&!(e>=n[r]&&e<n[r+1]);--r);return r===i-1&&(r=i-2),r};rv.prototype.wrapTime=function(e){let t=this.times,n=t[t.length-1],i=t[0],r=n-i,o;return e<i&&(o=Math.floor((i-e)/r)+1,e+=o*r),e>n&&(o=Math.floor((e-n)/r)+1,e-=o*r),e};rv.prototype.clampTime=function(e){let t=this.times;return P.clamp(e,t[0],t[t.length-1])};var Or=rv;function ov(e){this._value=e,this._valueType=Or.getPointType(e)}Object.defineProperties(ov.prototype,{value:{get:function(){return this._value}}});ov.prototype.findTimeInterval=function(e){};ov.prototype.wrapTime=function(e){return 0};ov.prototype.clampTime=function(e){return 0};ov.prototype.evaluate=function(e,t){let n=this._value,i=this._valueType;return i===Number?n:i.clone(n,t)};var RU=ov;function sv(e){e=e??H.EMPTY_OBJECT;let t=e.points,n=e.times;this._times=n,this._points=t,this._pointType=Or.getPointType(t[0]),this._lastTimeIndex=0}Object.defineProperties(sv.prototype,{times:{get:function(){return this._times}},points:{get:function(){return this._points}}});sv.prototype.findTimeInterval=Or.prototype.findTimeInterval;sv.prototype.wrapTime=Or.prototype.wrapTime;sv.prototype.clampTime=Or.prototype.clampTime;sv.prototype.evaluate=function(e,t){let n=this.points,i=this.times,r=this._lastTimeIndex=this.findTimeInterval(e,this._lastTimeIndex),o=(e-i[r])/(i[r+1]-i[r]);return this._pointType===Number?(1-o)*n[r]+o*n[r+1]:(l(t)||(t=new h),h.lerp(n[r],n[r+1],o,t))};var lx=sv;var pge={};pge.solve=function(e,t,n,i){let r=new Array(n.length),o=new Array(i.length),s=new Array(i.length),a;for(a=0;a<o.length;a++)o[a]=new h,s[a]=new h;r[0]=n[0]/t[0],o[0]=h.multiplyByScalar(i[0],1/t[0],o[0]);let c;for(a=1;a<r.length;++a)c=1/(t[a]-r[a-1]*e[a-1]),r[a]=n[a]*c,o[a]=h.subtract(i[a],h.multiplyByScalar(o[a-1],e[a-1],o[a]),o[a]),o[a]=h.multiplyByScalar(o[a],c,o[a]);for(c=1/(t[a]-r[a-1]*e[a-1]),o[a]=h.subtract(i[a],h.multiplyByScalar(o[a-1],e[a-1],o[a]),o[a]),o[a]=h.multiplyByScalar(o[a],c,o[a]),s[s.length-1]=o[o.length-1],a=s.length-2;a>=0;--a)s[a]=h.subtract(o[a],h.multiplyByScalar(s[a+1],r[a],s[a]),s[a]);return s};var UD=pge;var gge=[],_ge=[],yge=[],Age=[];function Ntt(e,t,n){let i=gge,r=yge,o=_ge,s=Age;i.length=r.length=e.length-1,o.length=s.length=e.length;let a;i[0]=o[0]=1,r[0]=0;let c=s[0];for(l(c)||(c=s[0]=new h),h.clone(t,c),a=1;a<i.length-1;++a)i[a]=r[a]=1,o[a]=4,c=s[a],l(c)||(c=s[a]=new h),h.subtract(e[a+1],e[a-1],c),h.multiplyByScalar(c,3,c);return i[a]=0,r[a]=1,o[a]=4,c=s[a],l(c)||(c=s[a]=new h),h.subtract(e[a+1],e[a-1],c),h.multiplyByScalar(c,3,c),o[a+1]=1,c=s[a+1],l(c)||(c=s[a+1]=new h),h.clone(n,c),UD.solve(i,o,r,s)}function Ltt(e){let t=gge,n=yge,i=_ge,r=Age;t.length=n.length=e.length-1,i.length=r.length=e.length;let o;t[0]=n[0]=1,i[0]=2;let s=r[0];for(l(s)||(s=r[0]=new h),h.subtract(e[1],e[0],s),h.multiplyByScalar(s,3,s),o=1;o<t.length;++o)t[o]=n[o]=1,i[o]=4,s=r[o],l(s)||(s=r[o]=new h),h.subtract(e[o+1],e[o-1],s),h.multiplyByScalar(s,3,s);return i[o]=2,s=r[o],l(s)||(s=r[o]=new h),h.subtract(e[o],e[o-1],s),h.multiplyByScalar(s,3,s),UD.solve(t,i,n,r)}function Iu(e){e=e??H.EMPTY_OBJECT;let t=e.points,n=e.times,i=e.inTangents,r=e.outTangents;this._times=n,this._points=t,this._pointType=Or.getPointType(t[0]),this._inTangents=i,this._outTangents=r,this._lastTimeIndex=0}Object.defineProperties(Iu.prototype,{times:{get:function(){return this._times}},points:{get:function(){return this._points}},inTangents:{get:function(){return this._inTangents}},outTangents:{get:function(){return this._outTangents}}});Iu.createC1=function(e){e=e??H.EMPTY_OBJECT;let t=e.times,n=e.points,i=e.tangents,r=i.slice(0,i.length-1),o=i.slice(1,i.length);return new Iu({times:t,points:n,inTangents:o,outTangents:r})};Iu.createNaturalCubic=function(e){e=e??H.EMPTY_OBJECT;let t=e.times,n=e.points;if(n.length<3)return new lx({points:n,times:t});let i=Ltt(n),r=i.slice(0,i.length-1),o=i.slice(1,i.length);return new Iu({times:t,points:n,inTangents:o,outTangents:r})};Iu.createClampedCubic=function(e){e=e??H.EMPTY_OBJECT;let t=e.times,n=e.points,i=e.firstTangent,r=e.lastTangent,o=Or.getPointType(n[0]);if(n.length<3)return new lx({points:n,times:t});let s=Ntt(n,i,r),a=s.slice(0,s.length-1),c=s.slice(1,s.length);return new Iu({times:t,points:n,inTangents:c,outTangents:a})};Iu.hermiteCoefficientMatrix=new M(2,-3,0,1,-2,3,0,0,1,-2,1,0,1,-1,0,0);Iu.prototype.findTimeInterval=Or.prototype.findTimeInterval;var Ftt=new se,av=new h;Iu.prototype.wrapTime=Or.prototype.wrapTime;Iu.prototype.clampTime=Or.prototype.clampTime;Iu.prototype.evaluate=function(e,t){let n=this.points,i=this.times,r=this.inTangents,o=this.outTangents;this._lastTimeIndex=this.findTimeInterval(e,this._lastTimeIndex);let s=this._lastTimeIndex,a=i[s+1]-i[s],c=(e-i[s])/a,u=Ftt;u.z=c,u.y=c*c,u.x=u.y*c,u.w=1;let f=M.multiplyByVector(Iu.hermiteCoefficientMatrix,u,u);f.z*=a,f.w*=a;let d=this._pointType;return d===Number?n[s]*f.x+n[s+1]*f.y+o[s]*f.z+r[s]*f.w:(l(t)||(t=new d),t=d.multiplyByScalar(n[s],f.x,t),d.multiplyByScalar(n[s+1],f.y,av),d.add(t,av,t),d.multiplyByScalar(o[s],f.z,av),d.add(t,av,t),d.multiplyByScalar(r[s],f.w,av),d.add(t,av,t))};var ux=Iu;function cv(e){e=e??H.EMPTY_OBJECT;let t=e.points,n=e.times;this._times=n,this._points=t,this._pointType=Or.getPointType(t[0]),this._lastTimeIndex=0}Object.defineProperties(cv.prototype,{times:{get:function(){return this._times}},points:{get:function(){return this._points}}});cv.prototype.findTimeInterval=Or.prototype.findTimeInterval;cv.prototype.wrapTime=Or.prototype.wrapTime;cv.prototype.clampTime=Or.prototype.clampTime;cv.prototype.evaluate=function(e,t){let n=this.points;this._lastTimeIndex=this.findTimeInterval(e,this._lastTimeIndex);let i=this._lastTimeIndex,r=this._pointType;return r===Number?n[i]:(l(t)||(t=new r),r.clone(n[i],t))};var OU=cv;function Btt(e){let t=e.points,n=e.times;return function(i,r){l(r)||(r=new Le);let o=e._lastTimeIndex=e.findTimeInterval(i,e._lastTimeIndex),s=(i-n[o])/(n[o+1]-n[o]),a=t[o],c=t[o+1];return Le.fastSlerp(a,c,s,r)}}function lv(e){e=e??H.EMPTY_OBJECT;let t=e.points,n=e.times;this._times=n,this._points=t,this._evaluateFunction=Btt(this),this._lastTimeIndex=0}Object.defineProperties(lv.prototype,{times:{get:function(){return this._times}},points:{get:function(){return this._points}}});lv.prototype.findTimeInterval=Or.prototype.findTimeInterval;lv.prototype.wrapTime=Or.prototype.wrapTime;lv.prototype.clampTime=Or.prototype.clampTime;lv.prototype.evaluate=function(e,t){return this._evaluateFunction(e,t)};var MU=lv;var uv=vn.AnimatedPropertyType;function mJ(e){e=e??H.EMPTY_OBJECT;let t=e.channel,n=e.runtimeAnimation,i=e.runtimeNode;this._channel=t,this._runtimeAnimation=n,this._runtimeNode=i,this._splines=[],this._path=void 0,jtt(this)}Object.defineProperties(mJ.prototype,{channel:{get:function(){return this._channel}},runtimeAnimation:{get:function(){return this._runtimeAnimation}},runtimeNode:{get:function(){return this._runtimeNode}},splines:{get:function(){return this._splines}}});function ktt(e,t){let n=[],i=[],r=[],o=t.length;for(let s=0;s<o;s+=3)i.push(t[s]),n.push(t[s+1]),r.push(t[s+2]);return i.splice(0,1),r.length=r.length-1,new ux({times:e,points:n,inTangents:i,outTangents:r})}function bge(e,t,n,i){if(e.length===1&&t.length===1)return new RU(t[0]);switch(n){case mp.STEP:return new OU({times:e,points:t});case mp.CUBICSPLINE:return ktt(e,t);case mp.LINEAR:return i===uv.ROTATION?new MU({times:e,points:t}):new lx({times:e,points:t})}}function Utt(e,t,n,i,r){let o=[];if(i===uv.WEIGHTS){let a=t.length/r,c,u;for(c=0;c<r;c++){let f=new Array(a),d=c;if(n===mp.CUBICSPLINE)for(u=0;u<a;u+=3)f[u]=t[d],f[u+1]=t[d+r],f[u+2]=t[d+2*r],d+=r*3;else for(u=0;u<a;u++)f[u]=t[d],d+=r;o.push(bge(e,f,n,i))}}else o.push(bge(e,t,n,i));return o}var ztt=new h,Vtt=new Le;function jtt(e){let t=e._channel,n=t.sampler,i=n.input,r=n.output,o=n.interpolation,a=t.target.path,c=e._runtimeNode,u=l(c.morphWeights)?c.morphWeights.length:1,f=Utt(i,r,o,a,u);e._splines=f,e._path=a}mJ.prototype.animate=function(e){let t=this._splines,n=this._path,i=this._runtimeAnimation.model,r=this._runtimeNode;if(n===uv.WEIGHTS){let o=r.morphWeights,s=o.length;for(let a=0;a<s;a++){let c=t[a],u=i.clampAnimations?c.clampTime(e):c.wrapTime(e);o[a]=c.evaluate(u)}}else{if(r.userAnimated)return;{let o=t[0],s=i.clampAnimations?o.clampTime(e):o.wrapTime(e);n===uv.TRANSLATION||n===uv.SCALE?r[n]=o.evaluate(s,ztt):n===uv.ROTATION&&(r[n]=o.evaluate(s,Vtt))}}};var NU=mJ;function pJ(e,t,n){this._animation=t,this._name=t.name,this._runtimeChannels=void 0,this._startTime=K.clone(n.startTime),this._delay=n.delay??0,this._stopTime=K.clone(n.stopTime),this.removeOnStop=n.removeOnStop??!1,this._multiplier=n.multiplier??1,this._reverse=n.reverse??!1,this._loop=n.loop??gf.NONE,this._startOffset=n.startOffset??0,this._animationTime=n.animationTime,this._prevAnimationDelta=void 0,this.start=new be,this.update=new be,this.stop=new be,this._state=gp.STOPPED,this._computedStartTime=void 0,this._duration=void 0;let i=this;this._raiseStartEvent=function(){i.start.raiseEvent(e,i)},this._updateEventTime=0,this._raiseUpdateEvent=function(){i.update.raiseEvent(e,i,i._updateEventTime)},this._raiseStopEvent=function(){i.stop.raiseEvent(e,i)},this._model=e,this._localStartTime=void 0,this._localStopTime=void 0,Htt(this)}Object.defineProperties(pJ.prototype,{animation:{get:function(){return this._animation}},name:{get:function(){return this._name}},runtimeChannels:{get:function(){return this._runtimeChannels}},model:{get:function(){return this._model}},localStartTime:{get:function(){return this._localStartTime}},localStopTime:{get:function(){return this._localStopTime}},startTime:{get:function(){return this._startTime}},delay:{get:function(){return this._delay}},stopTime:{get:function(){return this._stopTime}},multiplier:{get:function(){return this._multiplier}},reverse:{get:function(){return this._reverse}},loop:{get:function(){return this._loop}},startOffset:{get:function(){return this._startOffset}},animationTime:{get:function(){return this._animationTime}}});function Htt(e){let t=Number.MAX_VALUE,n=-Number.MAX_VALUE,i=e._model.sceneGraph,o=e._animation.channels,s=o.length,a=[];for(let c=0;c<s;c++){let u=o[c],f=u.target;if(!l(f))continue;let d=f.node.index,p=i._runtimeNodes[d],g=new NU({channel:u,runtimeAnimation:e,runtimeNode:p}),m=u.sampler.input;t=Math.min(t,m[0]),n=Math.max(n,m[m.length-1]),a.push(g)}e._runtimeChannels=a,e._localStartTime=t,e._localStopTime=n}pJ.prototype.animate=function(e){let t=this._runtimeChannels,n=t.length;for(let i=0;i<n;i++)t[i].animate(e)};var LU=pJ;function sg(e){this.animationAdded=new be,this.animationRemoved=new be,this.animateWhilePaused=!1,this._model=e,this._runtimeAnimations=[],this._previousTime=void 0}Object.defineProperties(sg.prototype,{length:{get:function(){return this._runtimeAnimations.length}},model:{get:function(){return this._model}}});function gJ(e,t,n){let i=e._model,r=new LU(i,t,n);return e._runtimeAnimations.push(r),e.animationAdded.raiseEvent(i,r),r}sg.prototype.add=function(e){e=e??H.EMPTY_OBJECT;let n=this._model.sceneGraph.components.animations,i=e.index;if(l(i))return gJ(this,n[i],e);let r=n.length;for(let o=0;o<r;++o)if(n[o].name===e.name){i=o;break}return gJ(this,n[i],e)};sg.prototype.addAll=function(e){e=e??H.EMPTY_OBJECT;let n=this._model.sceneGraph.components.animations,i=[],r=n.length;for(let o=0;o<r;++o){let s=gJ(this,n[o],e);i.push(s)}return i};sg.prototype.remove=function(e){if(!l(e))return!1;let t=this._runtimeAnimations,n=t.indexOf(e);return n!==-1?(t.splice(n,1),this.animationRemoved.raiseEvent(this._model,e),!0):!1};sg.prototype.removeAll=function(){let e=this._model,t=this._runtimeAnimations,n=t.length;this._runtimeAnimations.length=0;for(let i=0;i<n;++i)this.animationRemoved.raiseEvent(e,t[i])};sg.prototype.contains=function(e){return l(e)?this._runtimeAnimations.indexOf(e)!==-1:!1};sg.prototype.get=function(e){return this._runtimeAnimations[e]};var FU=[];function Gtt(e,t,n){return function(){e.animationRemoved.raiseEvent(t,n)}}sg.prototype.update=function(e){let t=this._runtimeAnimations,n=t.length;if(n===0)return this._previousTime=void 0,!1;if(!this.animateWhilePaused&&K.equals(e.time,this._previousTime))return!1;this._previousTime=K.clone(e.time,this._previousTime);let i=!1,r=e.time,o=this._model;for(let s=0;s<n;++s){let a=t[s];l(a._computedStartTime)||(a._computedStartTime=K.addSeconds(a.startTime??r,a.delay,new K)),l(a._duration)||(a._duration=a.localStopTime*(1/a.multiplier));let c=a._computedStartTime,u=a._duration,f=a.stopTime,d=K.lessThanOrEquals(c,r),p=l(f)&&K.greaterThan(r,f),g=0;if(u!==0){let A=K.secondsDifference(p?f:r,c);g=l(a._animationTime)?a._animationTime(u,A):A/u}let m=a.loop===gf.REPEAT||a.loop===gf.MIRRORED_REPEAT,y=(d||m&&!l(a.startTime))&&(g<=1||m)&&!p;if(g===a._prevAnimationDelta){let A=a._state===gp.STOPPED;if(y!==A)continue}if(a._prevAnimationDelta=g,y||a._state===gp.ANIMATING){if(y&&a._state===gp.STOPPED&&(a._state=gp.ANIMATING,a.start.numberOfListeners>0&&e.afterRender.push(a._raiseStartEvent)),a.loop===gf.REPEAT)g=g-Math.floor(g);else if(a.loop===gf.MIRRORED_REPEAT){let x=Math.floor(g),T=g-x;g=x%2===1?1-T:T}let A=a.startOffset;a.reverse&&(g=1-g,A=-A);let b=g*u*a.multiplier+A;b=P.clamp(b,a.localStartTime,a.localStopTime),a.animate(b),a.update.numberOfListeners>0&&(a._updateEventTime=b,e.afterRender.push(a._raiseUpdateEvent)),i=!0,y||(a._state=gp.STOPPED,a.stop.numberOfListeners>0&&e.afterRender.push(a._raiseStopEvent),a.removeOnStop&&FU.push(a))}}n=FU.length;for(let s=0;s<n;++s){let a=FU[s];t.splice(t.indexOf(a),1),e.afterRender.push(Gtt(this,o,a))}return FU.length=0,i};var BU=sg;function fx(e){this._model=e.model,this._featureTable=e.featureTable,this._featureId=e.featureId,this._color=void 0}Object.defineProperties(fx.prototype,{show:{get:function(){return this._featureTable.getShow(this._featureId)},set:function(e){this._featureTable.setShow(this._featureId,e)}},color:{get:function(){return l(this._color)||(this._color=new z),this._featureTable.getColor(this._featureId,this._color)},set:function(e){this._featureTable.setColor(this._featureId,e)}},primitive:{get:function(){return this._model}},featureTable:{get:function(){return this._featureTable}},featureId:{get:function(){return this._featureId}}});fx.prototype.hasProperty=function(e){return this._featureTable.hasProperty(this._featureId,e)};fx.prototype.getProperty=function(e){return this._featureTable.getProperty(this._featureId,e)};fx.prototype.getPropertyInherited=function(e){return this._featureTable.hasPropertyBySemantic(this._featureId,e)?this._featureTable.getPropertyBySemantic(this._featureId,e):this._featureTable.getProperty(this._featureId,e)};fx.prototype.getPropertyIds=function(e){return this._featureTable.getPropertyIds(e)};fx.prototype.setProperty=function(e,t){return this._featureTable.setProperty(this._featureId,e,t)};var kU=fx;var fv={ALL_OPAQUE:0,ALL_TRANSLUCENT:1,OPAQUE_AND_TRANSLUCENT:2};fv.getStyleCommandsNeeded=function(e,t){return t===0?fv.ALL_OPAQUE:t===e?fv.ALL_TRANSLUCENT:fv.OPAQUE_AND_TRANSLUCENT};Object.freeze(fv);var _p=fv;var ag={GLTF:"GLTF",TILE_GLTF:"TILE_GLTF",TILE_B3DM:"B3DM",TILE_I3DM:"I3DM",TILE_PNTS:"PNTS",TILE_GEOJSON:"TILE_GEOJSON"};ag.is3DTiles=function(e){switch(e){case ag.TILE_GLTF:case ag.TILE_B3DM:case ag.TILE_I3DM:case ag.TILE_PNTS:case ag.TILE_GEOJSON:return!0;case ag.GLTF:return!1}};Object.freeze(ag);var Jo=ag;function ps(e){let t=e.model,n=e.propertyTable;this._propertyTable=n,this._model=t,this._features=void 0,this._featuresLength=0,this._batchTexture=void 0,this._styleCommandsNeededDirty=!1,this._styleCommandsNeeded=_p.ALL_OPAQUE,Wtt(this)}Object.defineProperties(ps.prototype,{batchTexture:{get:function(){return this._batchTexture}},featuresLength:{get:function(){return this._featuresLength}},batchTextureByteLength:{get:function(){return l(this._batchTexture)?this._batchTexture.byteLength:0}},styleCommandsNeededDirty:{get:function(){return this._styleCommandsNeededDirty}}});function Wtt(e){let t=e._model,n=Jo.is3DTiles(t.type),i=e._propertyTable.count;if(i===0)return;let r,o=new Array(i);if(n){let s=t.content;for(r=0;r<i;r++)o[r]=new ua(s,r)}else for(r=0;r<i;r++)o[r]=new kU({model:t,featureId:r,featureTable:e});e._features=o,e._featuresLength=i,e._batchTexture=new xu({featuresLength:i,owner:e,statistics:n?t.content.tileset.statistics:void 0})}ps.prototype.update=function(e){this._styleCommandsNeededDirty=!1,this._batchTexture.update(void 0,e);let t=_p.getStyleCommandsNeeded(this._featuresLength,this._batchTexture.translucentFeaturesLength);this._styleCommandsNeeded!==t&&(this._styleCommandsNeededDirty=!0,this._styleCommandsNeeded=t)};ps.prototype.setShow=function(e,t){this._batchTexture.setShow(e,t)};ps.prototype.setAllShow=function(e){this._batchTexture.setAllShow(e)};ps.prototype.getShow=function(e){return this._batchTexture.getShow(e)};ps.prototype.setColor=function(e,t){this._batchTexture.setColor(e,t)};ps.prototype.setAllColor=function(e){this._batchTexture.setAllColor(e)};ps.prototype.getColor=function(e,t){return this._batchTexture.getColor(e,t)};ps.prototype.getPickColor=function(e){return this._batchTexture.getPickColor(e)};ps.prototype.getFeature=function(e){return this._features[e]};ps.prototype.hasProperty=function(e,t){return this._propertyTable.hasProperty(e,t)};ps.prototype.hasPropertyBySemantic=function(e,t){return this._propertyTable.hasPropertyBySemantic(e,t)};ps.prototype.getProperty=function(e,t){return this._propertyTable.getProperty(e,t)};ps.prototype.getPropertyBySemantic=function(e,t){return this._propertyTable.getPropertyBySemantic(e,t)};ps.prototype.getPropertyIds=function(e){return this._propertyTable.getPropertyIds(e)};ps.prototype.setProperty=function(e,t,n){return this._propertyTable.setProperty(e,t,n)};ps.prototype.isClass=function(e,t){return this._propertyTable.isClass(e,t)};ps.prototype.isExactClass=function(e,t){return this._propertyTable.isExactClass(e,t)};ps.prototype.getExactClassName=function(e){return this._propertyTable.getExactClassName(e)};var qtt=new z;ps.prototype.applyStyle=function(e){if(!l(e)){this.setAllColor(xu.DEFAULT_COLOR_VALUE),this.setAllShow(xu.DEFAULT_SHOW_VALUE);return}for(let t=0;t<this._featuresLength;t++){let n=this.getFeature(t),i=l(e.color)?e.color.evaluateColor(n,qtt)??xu.DEFAULT_COLOR_VALUE:xu.DEFAULT_COLOR_VALUE,r=l(e.show)?e.show.evaluate(n)??xu.DEFAULT_SHOW_VALUE:xu.DEFAULT_SHOW_VALUE;this.setColor(t,i),this.setShow(t,r)}};ps.prototype.isDestroyed=function(){return!1};ps.prototype.destroy=function(e){this._batchTexture=this._batchTexture&&this._batchTexture.destroy(),le(this)};var UU=ps;var xge={name:"TilesetPipelineStage"};xge.process=function(e,t,n){if(t.hasSkipLevelOfDetail(n)){e.shaderBuilder.addDefine("POLYGON_OFFSET",void 0,de.FRAGMENT);let o={u_polygonOffset:function(){return U.ZERO}};e.uniformMap=Mt(o,e.uniformMap),e.hasSkipLevelOfDetail=!0}let i=e.renderStateOptions;i.stencilTest=Xt.setCesium3DTileBit(),i.stencilMask=Xt.CESIUM_3D_TILE_MASK};var zU=xge;var VU=`vec2 nearestPointOnEllipseFast(vec2 pos, vec2 radii) { +}`),n=e.shaderCache.createDerivedShaderProgram(t,"EC",{vertexShaderSource:t.vertexShaderSource,fragmentShaderSource:r,attributeLocations:i})}return n}Bv.prototype.update=function(e,t,n,i){if(!pAe(e.context))return;this._strength=n.eyeDomeLightingStrength,this._radius=n.eyeDomeLightingRadius*e.pixelRatio,lrt(this,e.context);let r,o=e.commandList,s=o.length;for(r=t;r<s;++r){let u=o[r];if(u.primitiveType!==Oe.POINTS||u.pass===Ie.TRANSLUCENT)continue;let f,d,p=u.derivedCommands.pointCloudProcessor;l(p)&&(f=p.command,d=p.originalShaderProgram),(!l(f)||u.dirty||d!==u.shaderProgram||f.framebuffer!==this.framebuffer)&&(f=at.shallowClone(u,f),f.framebuffer=this.framebuffer,f.shaderProgram=urt(e.context,u.shaderProgram),f.castShadows=!1,f.receiveShadows=!1,l(p)||(p={command:f,originalShaderProgram:u.shaderProgram},u.derivedCommands.pointCloudProcessor=p),p.originalShaderProgram=u.shaderProgram),o[r]=f}let a=this._clearCommand,c=this._drawCommand;c.boundingVolume=i,o.push(c),o.push(a)};Bv.prototype.isDestroyed=function(){return!1};Bv.prototype.destroy=function(){return art(this),le(this)};var vy=Bv;function gAe(e){let t=e??{};this.attenuation=t.attenuation??!1,this.geometricErrorScale=t.geometricErrorScale??1,this.maximumAttenuation=t.maximumAttenuation,this.baseResolution=t.baseResolution,this.eyeDomeLighting=t.eyeDomeLighting??!0,this.eyeDomeLightingStrength=t.eyeDomeLightingStrength??1,this.eyeDomeLightingRadius=t.eyeDomeLightingRadius??1,this.backFaceCulling=t.backFaceCulling??!1,this.normalShading=t.normalShading??!0}gAe.isSupported=function(e){return vy.isSupported(e.context)};var ug=gAe;var kv={};kv._deprecationWarning=Yr;var fg=Uint32Array.BYTES_PER_ELEMENT;kv.parse=function(e,t){let n=t??0;t=n;let i=new Uint8Array(e),r=new DataView(e);t+=fg;let o=r.getUint32(t,!0);if(o!==1)throw new oe(`Only Batched 3D Model version 1 is supported. Version ${o} is not.`);t+=fg;let s=r.getUint32(t,!0);t+=fg;let a=r.getUint32(t,!0);t+=fg;let c=r.getUint32(t,!0);t+=fg;let u=r.getUint32(t,!0);t+=fg;let f=r.getUint32(t,!0);t+=fg;let d;u>=570425344?(t-=fg*2,d=a,u=c,f=0,a=0,c=0,kv._deprecationWarning("b3dm-legacy-header","This b3dm header is using the legacy format [batchLength] [batchTableByteLength]. The new format is [featureTableJsonByteLength] [featureTableBinaryByteLength] [batchTableJsonByteLength] [batchTableBinaryByteLength] from https://github.com/CesiumGS/3d-tiles/tree/main/specification/TileFormats/Batched3DModel.")):f>=570425344&&(t-=fg,d=u,u=a,f=c,a=0,c=0,kv._deprecationWarning("b3dm-legacy-header","This b3dm header is using the legacy format [batchTableJsonByteLength] [batchTableBinaryByteLength] [batchLength]. The new format is [featureTableJsonByteLength] [featureTableBinaryByteLength] [batchTableJsonByteLength] [batchTableBinaryByteLength] from https://github.com/CesiumGS/3d-tiles/tree/main/specification/TileFormats/Batched3DModel."));let p;a===0?p={BATCH_LENGTH:d??0}:(p=Fo(i,t,a),t+=a);let g=new Uint8Array(e,t,c);t+=c;let m,y;u>0&&(m=Fo(i,t,u),t+=u,f>0&&(y=new Uint8Array(e,t,f),y=new Uint8Array(y),t+=f));let A=n+s-t;if(A===0)throw new oe("glTF byte length must be greater than 0.");let b;return t%4===0?b=new Uint8Array(e,t,A):(kv._deprecationWarning("b3dm-glb-unaligned","The embedded glb is not aligned to a 4-byte boundary."),b=new Uint8Array(i.subarray(t,t+A))),{batchLength:d,featureTableJson:p,featureTableBinary:g,batchTableJson:m,batchTableBinary:y,gltf:b}};var _z=kv;function s1(e,t){this.json=e,this.buffer=t,this._cachedTypedArrays={},this.featuresLength=0}function _Ae(e,t,n,i,r,o){let s=e._cachedTypedArrays,a=s[t];return l(a)||(a=Y.createArrayBufferView(n,e.buffer.buffer,e.buffer.byteOffset+o,r*i),s[t]=a),a}function frt(e,t,n,i){let r=e._cachedTypedArrays,o=r[t];return l(o)||(o=Y.createTypedArray(n,i),r[t]=o),o}s1.prototype.getGlobalProperty=function(e,t,n){let i=this.json[e];if(l(i))return l(i.byteOffset)?(t=t??Y.UNSIGNED_INT,n=n??1,_Ae(this,e,t,n,1,i.byteOffset)):i};s1.prototype.hasProperty=function(e){return l(this.json[e])};s1.prototype.getPropertyArray=function(e,t,n){let i=this.json[e];if(l(i))return l(i.byteOffset)?(l(i.componentType)&&(t=Y.fromName(i.componentType)),_Ae(this,e,t,n,this.featuresLength,i.byteOffset)):frt(this,e,t,i)};s1.prototype.getProperty=function(e,t,n,i,r){let o=this.json[e];if(!l(o))return;let s=this.getPropertyArray(e,t,n);if(n===1)return s[i];for(let a=0;a<n;++a)r[a]=s[n*i+a];return r};var Cp=s1;var drt={SCALAR:1,VEC2:2,VEC3:3,VEC4:4,MAT2:4,MAT3:9,MAT4:16},hrt={SCALAR:void 0,VEC2:U,VEC3:h,VEC4:se,MAT2:$i,MAT3:$,MAT4:M};function mrt(e){let t=e.componentType,n;typeof t=="string"?n=Y.fromName(t):n=t;let i=drt[e.type],r=hrt[e.type];return{componentsPerAttribute:i,classType:r,createArrayBufferView:function(o,s,a){return Y.createArrayBufferView(n,o,s,i*a)}}}var Hh=mrt;function el(e){this._id=Kn();let t=e.featuresLength;this._showAlphaProperties=void 0,this._batchValues=void 0,this._batchValuesDirty=!1,this._batchTexture=void 0,this._defaultTexture=void 0,this._pickTexture=void 0,this._pickIds=[];let n,i;if(t>0){let r=Math.min(t,Ut.maximumTextureSize),o=Math.ceil(t/Ut.maximumTextureSize),s=1/r,a=s*.5,c=1/o,u=c*.5;n=new U(r,o),i=new se(s,a,c,u)}this._translucentFeaturesLength=0,this._featuresLength=t,this._textureDimensions=n,this._textureStep=i,this._owner=e.owner,this._statistics=e.statistics,this._colorChangedCallback=e.colorChangedCallback}Object.defineProperties(el.prototype,{translucentFeaturesLength:{get:function(){return this._translucentFeaturesLength}},byteLength:{get:function(){let e=0;return l(this._pickTexture)&&(e+=this._pickTexture.sizeInBytes),l(this._batchTexture)&&(e+=this._batchTexture.sizeInBytes),e}},textureDimensions:{get:function(){return this._textureDimensions}},textureStep:{get:function(){return this._textureStep}},batchTexture:{get:function(){return this._batchTexture}},defaultTexture:{get:function(){return this._defaultTexture}},pickTexture:{get:function(){return this._pickTexture}}});el.DEFAULT_COLOR_VALUE=z.WHITE;el.DEFAULT_SHOW_VALUE=!0;function yAe(e){let t=e._textureDimensions;return t.x*t.y*4}function AAe(e){if(!l(e._batchValues)){let t=yAe(e),n=new Uint8Array(t).fill(255);e._batchValues=n}return e._batchValues}function bAe(e){if(!l(e._showAlphaProperties)){let t=2*e._featuresLength,n=new Uint8Array(t).fill(255);e._showAlphaProperties=n}return e._showAlphaProperties}el.prototype.setShow=function(e,t){if(t&&!l(this._showAlphaProperties))return;let n=bAe(this),i=e*2,r=t?255:0;if(n[i]!==r){n[i]=r;let o=AAe(this),s=e*4+3;o[s]=t?n[i+1]:0,this._batchValuesDirty=!0}};el.prototype.setAllShow=function(e){let t=this._featuresLength;for(let n=0;n<t;++n)this.setShow(n,e)};el.prototype.getShow=function(e){if(!l(this._showAlphaProperties))return!0;let t=e*2;return this._showAlphaProperties[t]===255};var prt=new Array(4);el.prototype.setColor=function(e,t){if(z.equals(t,el.DEFAULT_COLOR_VALUE)&&!l(this._batchValues))return;let n=t.toBytes(prt),i=n[3],r=AAe(this),o=e*4,s=bAe(this),a=e*2;if(r[o]!==n[0]||r[o+1]!==n[1]||r[o+2]!==n[2]||s[a+1]!==i){r[o]=n[0],r[o+1]=n[1],r[o+2]=n[2];let c=s[a+1]!==255,u=s[a]!==0;r[o+3]=u?i:0,s[a+1]=i;let f=i!==255;f&&!c?++this._translucentFeaturesLength:!f&&c&&--this._translucentFeaturesLength,this._batchValuesDirty=!0,l(this._colorChangedCallback)&&this._colorChangedCallback(e,t)}};el.prototype.setAllColor=function(e){let t=this._featuresLength;for(let n=0;n<t;++n)this.setColor(n,e)};el.prototype.getColor=function(e,t){if(!l(this._batchValues))return z.clone(el.DEFAULT_COLOR_VALUE,t);let n=this._batchValues,i=e*4,r=this._showAlphaProperties,o=e*2;return z.fromBytes(n[i],n[i+1],n[i+2],r[o+1],t)};el.prototype.getPickColor=function(e){return this._pickIds[e]};function xAe(e,t,n){let i=e._textureDimensions;return new Dt({context:t,pixelFormat:$e.RGBA,pixelDatatype:ze.UNSIGNED_BYTE,source:{width:i.x,height:i.y,arrayBufferView:n},flipY:!1,sampler:Ht.NEAREST})}function grt(e,t){let n=e._featuresLength;if(!l(e._pickTexture)&&n>0){let i=e._pickIds,r=yAe(e),o=new Uint8Array(r),s=e._owner,a=e._statistics;for(let c=0;c<n;++c){let u=t.createPickId(s.getFeature(c));i.push(u);let f=u.color,d=c*4;o[d]=z.floatToByte(f.red),o[d+1]=z.floatToByte(f.green),o[d+2]=z.floatToByte(f.blue),o[d+3]=z.floatToByte(f.alpha)}e._pickTexture=xAe(e,t,o),l(a)&&(a.batchTableByteLength+=e._pickTexture.sizeInBytes)}}function _rt(e){let t=e._textureDimensions;e._batchTexture.copyFrom({source:{width:t.x,height:t.y,arrayBufferView:e._batchValues}})}el.prototype.update=function(e,t){let n=t.context;this._defaultTexture=n.defaultTexture;let i=t.passes;(i.pick||i.postProcess)&&grt(this,n),this._batchValuesDirty&&(this._batchValuesDirty=!1,l(this._batchTexture)||(this._batchTexture=xAe(this,n,this._batchValues),l(this._statistics)&&(this._statistics.batchTableByteLength+=this._batchTexture.sizeInBytes)),_rt(this))};el.prototype.isDestroyed=function(){return!1};el.prototype.destroy=function(){this._batchTexture=this._batchTexture&&this._batchTexture.destroy(),this._pickTexture=this._pickTexture&&this._pickTexture.destroy();let e=this._pickIds,t=e.length;for(let n=0;n<t;++n)e[n].destroy();return le(this)};var Pu=el;var TAe={HIGHLIGHT:0,REPLACE:1,MIX:2};Object.freeze(TAe);var yf=TAe;var KJ=Pu.DEFAULT_COLOR_VALUE,$J=Pu.DEFAULT_SHOW_VALUE;function Hr(e,t,n,i,r){this.featuresLength=t;let o;l(n)&&(o=n.extensions),this._extensions=o??{};let s=yrt(n);this._properties=s,this._batchTableHierarchy=Art(this,n,i);let a=CAe(t,s,i);this._binaryPropertiesByteLength=brt(a),this._batchTableBinaryProperties=a,this._content=e,this._batchTexture=new Pu({featuresLength:t,colorChangedCallback:r,owner:e,statistics:e.tileset.statistics})}Hr._deprecationWarning=Yr;Object.defineProperties(Hr.prototype,{batchTableByteLength:{get:function(){let e=this._binaryPropertiesByteLength;return l(this._batchTableHierarchy)&&(e+=this._batchTableHierarchy.byteLength),e+=this._batchTexture.byteLength,e}}});function yrt(e){let t={};if(!l(e))return t;for(let n in e)e.hasOwnProperty(n)&&n!=="HIERARCHY"&&n!=="extensions"&&n!=="extras"&&(t[n]=Ze(e[n],!0));return t}function Art(e,t,n){if(!l(t))return;let i=e._extensions["3DTILES_batch_table_hierarchy"],r=t.HIERARCHY;if(l(r)&&(Hr._deprecationWarning("batchTableHierarchyExtension","The batch table HIERARCHY property has been moved to an extension. Use extensions.3DTILES_batch_table_hierarchy instead."),e._extensions["3DTILES_batch_table_hierarchy"]=r,i=r),!!l(i))return new Uv({extension:i,binaryBody:n})}function CAe(e,t,n){let i;for(let r in t)if(t.hasOwnProperty(r)){let o=t[r],s=o.byteOffset;if(l(s)){let a=o.componentType,c=o.type;if(!l(a))throw new oe("componentType is required.");if(!l(c))throw new oe("type is required.");if(!l(n))throw new oe(`Property ${r} requires a batch table binary.`);let u=Hh(o),f=u.componentsPerAttribute,d=u.classType,p=u.createArrayBufferView(n.buffer,n.byteOffset+s,e);l(i)||(i={}),i[r]={typedArray:p,componentCount:f,type:d}}}return i}function brt(e){if(!l(e))return 0;let t=0;for(let n in e)e.hasOwnProperty(n)&&(t+=e[n].typedArray.byteLength);return t}Hr.getBinaryProperties=function(e,t,n){return CAe(e,t,n)};Hr.prototype.setShow=function(e,t){this._batchTexture.setShow(e,t)};Hr.prototype.setAllShow=function(e){this._batchTexture.setAllShow(e)};Hr.prototype.getShow=function(e){return this._batchTexture.getShow(e)};Hr.prototype.setColor=function(e,t){this._batchTexture.setColor(e,t)};Hr.prototype.setAllColor=function(e){this._batchTexture.setAllColor(e)};Hr.prototype.getColor=function(e,t){return this._batchTexture.getColor(e,t)};Hr.prototype.getPickColor=function(e){return this._batchTexture.getPickColor(e)};var xrt=new z;Hr.prototype.applyStyle=function(e){if(!l(e)){this.setAllColor(KJ),this.setAllShow($J);return}let t=this._content,n=this.featuresLength;for(let i=0;i<n;++i){let r=t.getFeature(i),o=l(e.color)?e.color.evaluateColor(r,xrt)??KJ:KJ,s=l(e.show)?e.show.evaluate(r)??$J:$J;this.setColor(i,o),this.setShow(i,s)}};function Trt(e,t){let n=e.typedArray,i=e.componentCount;return i===1?n[t]:e.type.unpack(n,t*i)}function Ert(e,t,n){let i=e.typedArray,r=e.componentCount;r===1?i[t]=n:e.type.pack(n,i,t*r)}Hr.prototype.isClass=function(e,t){let n=this._batchTableHierarchy;return l(n)?n.isClass(e,t):!1};Hr.prototype.isExactClass=function(e,t){return this.getExactClassName(e)===t};Hr.prototype.getExactClassName=function(e){let t=this._batchTableHierarchy;if(l(t))return t.getClassName(e)};Hr.prototype.hasProperty=function(e,t){return l(this._properties[t])||l(this._batchTableHierarchy)&&this._batchTableHierarchy.hasProperty(e,t)};Hr.prototype.hasPropertyBySemantic=function(){return!1};Hr.prototype.getPropertyIds=function(e,t){t=l(t)?t:[],t.length=0;let n=Object.keys(this._properties);if(Zn(t,n),l(this._batchTableHierarchy)){let i=this._batchTableHierarchy.getPropertyIds(e,n);Zn(t,i)}return t};Hr.prototype.getPropertyBySemantic=function(e,t){};Hr.prototype.getProperty=function(e,t){if(l(this._batchTableBinaryProperties)){let i=this._batchTableBinaryProperties[t];if(l(i))return Trt(i,e)}let n=this._properties[t];if(l(n))return Ze(n[e],!0);if(l(this._batchTableHierarchy)){let i=this._batchTableHierarchy.getProperty(e,t);if(l(i))return i}};Hr.prototype.setProperty=function(e,t,n){let i=this.featuresLength;if(l(this._batchTableBinaryProperties)){let o=this._batchTableBinaryProperties[t];if(l(o)){Ert(o,e,n);return}}if(l(this._batchTableHierarchy)&&this._batchTableHierarchy.setProperty(e,t,n))return;let r=this._properties[t];l(r)||(this._properties[t]=new Array(i),r=this._properties[t]),r[e]=Ze(n,!0)};function Crt(e){return e._batchTexture.textureDimensions.y===1?`uniform vec4 tile_textureStep; +vec2 computeSt(float batchId) +{ + float stepX = tile_textureStep.x; + float centerX = tile_textureStep.y; + return vec2(centerX + (batchId * stepX), 0.5); +} +`:`uniform vec4 tile_textureStep; +uniform vec2 tile_textureDimensions; +vec2 computeSt(float batchId) +{ + float stepX = tile_textureStep.x; + float centerX = tile_textureStep.y; + float stepY = tile_textureStep.z; + float centerY = tile_textureStep.w; + float xId = mod(batchId, tile_textureDimensions.x); + float yId = floor(batchId / tile_textureDimensions.x); + return vec2(centerX + (xId * stepX), centerY + (yId * stepY)); +} +`}Hr.prototype.getVertexShaderCallback=function(e,t,n){if(this.featuresLength===0)return;let i=this;return function(r){let o=vAe(r,n,!1),s;return Ut.maximumVertexTextureImageUnits>0?(s="",e&&(s+=`uniform bool tile_translucentCommand; +`),s+=`uniform sampler2D tile_batchTexture; +out vec4 tile_featureColor; +out vec2 tile_featureSt; +void main() +{ + vec2 st = computeSt(${t}); + vec4 featureProperties = texture(tile_batchTexture, st); + tile_color(featureProperties); + float show = ceil(featureProperties.a); + gl_Position *= show; +`,e&&(s+=` bool isStyleTranslucent = (featureProperties.a != 1.0); + if (czm_pass == czm_passTranslucent) + { + if (!isStyleTranslucent && !tile_translucentCommand) + { + gl_Position *= 0.0; + } + } + else + { + if (isStyleTranslucent) + { + gl_Position *= 0.0; + } + } +`),s+=` tile_featureColor = featureProperties; + tile_featureSt = st; +}`):s=`out vec2 tile_featureSt; +void main() +{ + tile_color(vec4(1.0)); + tile_featureSt = computeSt(${t}); +}`,`${o} +${Crt(i)}${s}`}};function EAe(e,t){return e=Xe.replaceMain(e,"tile_main"),t?`${e}uniform float tile_colorBlend; +void tile_color(vec4 tile_featureColor) +{ + tile_main(); + tile_featureColor = czm_gammaCorrect(tile_featureColor); + out_FragColor.a *= tile_featureColor.a; + float highlight = ceil(tile_colorBlend); + out_FragColor.rgb *= mix(tile_featureColor.rgb, vec3(1.0), highlight); +} +`:`${e}void tile_color(vec4 tile_featureColor) +{ + tile_main(); +} +`}function vrt(e,t){let n=`texture(${t}`,i=0,r=e.indexOf(n,i),o;for(;r>-1;){let s=0;for(let u=r;u<e.length;++u){let f=e.charAt(u);if(f==="(")++s;else if(f===")"&&(--s,s===0)){o=u+1;break}}let c=`tile_diffuse_final(${e.slice(r,o)}, tile_diffuse)`;e=e.slice(0,r)+c+e.slice(o),i=r+c.length,r=e.indexOf(n,i)}return e}function vAe(e,t,n){if(!l(t))return EAe(e,n);let i=new RegExp(`(uniform|attribute|in)\\s+(vec[34]|sampler2D)\\s+${t};`),r=e.match(i);if(!l(r))return EAe(e,n);let o=r[0],s=r[2];e=Xe.replaceMain(e,"tile_main"),e=e.replace(o,"");let a=`bool isWhite(vec3 color) +{ + return all(greaterThan(color, vec3(1.0 - czm_epsilon3))); +} +vec4 tile_diffuse_final(vec4 sourceDiffuse, vec4 tileDiffuse) +{ + vec4 blendDiffuse = mix(sourceDiffuse, tileDiffuse, tile_colorBlend); + vec4 diffuse = isWhite(tileDiffuse.rgb) ? sourceDiffuse : blendDiffuse; + return vec4(diffuse.rgb, sourceDiffuse.a); +} +`,c=` tile_featureColor = czm_gammaCorrect(tile_featureColor); + out_FragColor.a *= tile_featureColor.a; + float highlight = ceil(tile_colorBlend); + out_FragColor.rgb *= mix(tile_featureColor.rgb, vec3(1.0), highlight); +`,u;if(s==="vec3"||s==="vec4"){let f=s==="vec3"?`vec4(${t}, 1.0)`:t,d=s==="vec3"?"tile_diffuse.xyz":"tile_diffuse";i=new RegExp(t,"g"),e=e.replace(i,d),u=` vec4 source = ${f}; + tile_diffuse = tile_diffuse_final(source, tile_featureColor); + tile_main(); +`}else s==="sampler2D"&&(e=vrt(e,t),u=` tile_diffuse = tile_featureColor; + tile_main(); +`);return e=`uniform float tile_colorBlend; +vec4 tile_diffuse = vec4(1.0); +${a}${o} +${e} +void tile_color(vec4 tile_featureColor) +{ +${u}`,n&&(e+=c),e+=`} +`,e}Hr.prototype.getFragmentShaderCallback=function(e,t,n){if(this.featuresLength!==0)return function(i){return i=vAe(i,t,!0),Ut.maximumVertexTextureImageUnits>0?(i+=`uniform sampler2D tile_pickTexture; +in vec2 tile_featureSt; +in vec4 tile_featureColor; +void main() +{ + tile_color(tile_featureColor); +`,n&&(i+=` out_FragColor.rgb *= out_FragColor.a; +`),i+="}"):(e&&(i+=`uniform bool tile_translucentCommand; +`),i+=`uniform sampler2D tile_pickTexture; +uniform sampler2D tile_batchTexture; +in vec2 tile_featureSt; +void main() +{ + vec4 featureProperties = texture(tile_batchTexture, tile_featureSt); + if (featureProperties.a == 0.0) { + discard; + } +`,e&&(i+=` bool isStyleTranslucent = (featureProperties.a != 1.0); + if (czm_pass == czm_passTranslucent) + { + if (!isStyleTranslucent && !tile_translucentCommand) + { + discard; + } + } + else + { + if (isStyleTranslucent) + { + discard; + } + } +`),i+=` tile_color(featureProperties); +`,n&&(i+=` out_FragColor.rgb *= out_FragColor.a; +`),i+=`} +`),i}};function Srt(e){let t=e._content.tileset,n=t.colorBlendMode,i=t.colorBlendAmount;if(n===yf.HIGHLIGHT)return 0;if(n===yf.REPLACE)return 1;if(n===yf.MIX)return P.clamp(i,P.EPSILON4,1)}Hr.prototype.getUniformMapCallback=function(){if(this.featuresLength===0)return;let e=this;return function(t){return Mt(t,{tile_batchTexture:function(){return e._batchTexture.batchTexture??e._batchTexture.defaultTexture},tile_textureDimensions:function(){return e._batchTexture.textureDimensions},tile_textureStep:function(){return e._batchTexture.textureStep},tile_colorBlend:function(){return Srt(e)},tile_pickTexture:function(){return e._batchTexture.pickTexture}})}};Hr.prototype.getPickId=function(){return"texture(tile_pickTexture, tile_featureSt)"};var Sy={ALL_OPAQUE:0,ALL_TRANSLUCENT:1,OPAQUE_AND_TRANSLUCENT:2};Hr.prototype.addDerivedCommands=function(e,t){let n=e.commandList,i=n.length,r=this._content._tile,o=r._finalResolution,s=r.tileset,a=s.isSkippingLevelOfDetail&&s.hasMixedContent&&e.context.stencilBuffer,c=wrt(this);for(let u=t;u<i;++u){let f=n[u];if(f.pass===Ie.COMPUTE)continue;let d=f.derivedCommands.tileset;(!l(d)||f.dirty)&&(d={},f.derivedCommands.tileset=d,d.originalCommand=Irt(f),f.dirty=!1);let p=d.originalCommand;c!==Sy.ALL_OPAQUE&&f.pass!==Ie.TRANSLUCENT&&(l(d.translucent)||(d.translucent=Prt(p))),c!==Sy.ALL_TRANSLUCENT&&f.pass!==Ie.TRANSLUCENT&&(l(d.opaque)||(d.opaque=Drt(p)),a&&(o||(l(d.zback)||(d.zback=Ort(e.context,p)),s._backfaceCommands.push(d.zback)),(!l(d.stencil)||r._selectionDepth!==Nrt(d.stencil))&&(f.renderState.depthMask?d.stencil=Mrt(p,r._selectionDepth):d.stencil=d.opaque)));let g=a?d.stencil:d.opaque,m=d.translucent;f.pass!==Ie.TRANSLUCENT?(c===Sy.ALL_OPAQUE&&(n[u]=g),c===Sy.ALL_TRANSLUCENT&&(n[u]=m),c===Sy.OPAQUE_AND_TRANSLUCENT&&(n[u]=g,n.push(m))):n[u]=p}};function wrt(e){let t=e._batchTexture.translucentFeaturesLength;return t===0?Sy.ALL_OPAQUE:t===e.featuresLength?Sy.ALL_TRANSLUCENT:Sy.OPAQUE_AND_TRANSLUCENT}function Irt(e){let t=at.shallowClone(e),n=t.pass===Ie.TRANSLUCENT;return t.uniformMap=l(t.uniformMap)?t.uniformMap:{},t.uniformMap.tile_translucentCommand=function(){return n},t}function Prt(e){let t=at.shallowClone(e);return t.pass=Ie.TRANSLUCENT,t.renderState=Lrt(e.renderState),t}function Drt(e){let t=at.shallowClone(e);return t.renderState=Frt(e.renderState),t}function Rrt(e,t){let n=e.shaderCache.getDerivedShaderProgram(t,"zBackfaceLogDepth");if(!l(n)){let i=t.fragmentShaderSource.clone();i.defines=l(i.defines)?i.defines.slice(0):[],i.defines.push("POLYGON_OFFSET"),n=e.shaderCache.createDerivedShaderProgram(t,"zBackfaceLogDepth",{vertexShaderSource:t.vertexShaderSource,fragmentShaderSource:i,attributeLocations:t._attributeLocations})}return n}function Ort(e,t){let n=at.shallowClone(t),i=Ze(n.renderState,!0);i.cull.enabled=!0,i.cull.face=Hi.FRONT,i.colorMask={red:!1,green:!1,blue:!1,alpha:!1},i.polygonOffset={enabled:!0,factor:5,units:5},i.stencilTest=Xt.setCesium3DTileBit(),i.stencilMask=Xt.CESIUM_3D_TILE_MASK,n.renderState=Ge.fromCache(i),n.castShadows=!1,n.receiveShadows=!1,n.uniformMap=Ze(t.uniformMap);let r=new U(5,5);return n.uniformMap.u_polygonOffset=function(){return r},n.shaderProgram=Rrt(e,t.shaderProgram),n}function Mrt(e,t){let n=at.shallowClone(e),i=Ze(n.renderState,!0);return i.stencilTest.enabled=!0,i.stencilTest.mask=Xt.SKIP_LOD_MASK,i.stencilTest.reference=Xt.CESIUM_3D_TILE_MASK|t<<Xt.SKIP_LOD_BIT_SHIFT,i.stencilTest.frontFunction=ei.GREATER_OR_EQUAL,i.stencilTest.frontOperation.zPass=Rt.REPLACE,i.stencilTest.backFunction=ei.GREATER_OR_EQUAL,i.stencilTest.backOperation.zPass=Rt.REPLACE,i.stencilMask=Xt.CESIUM_3D_TILE_MASK|Xt.SKIP_LOD_MASK,n.renderState=Ge.fromCache(i),n}function Nrt(e){return(e.renderState.stencilTest.reference&Xt.SKIP_LOD_MASK)>>>Xt.SKIP_LOD_BIT_SHIFT}function Lrt(e){let t=Ze(e,!0);return t.cull.enabled=!1,t.depthTest.enabled=!0,t.depthMask=!1,t.blending=nn.ALPHA_BLEND,t.stencilTest=Xt.setCesium3DTileBit(),t.stencilMask=Xt.CESIUM_3D_TILE_MASK,Ge.fromCache(t)}function Frt(e){let t=Ze(e,!0);return t.stencilTest=Xt.setCesium3DTileBit(),t.stencilMask=Xt.CESIUM_3D_TILE_MASK,Ge.fromCache(t)}Hr.prototype.update=function(e,t){this._batchTexture.update(e,t)};Hr.prototype.isDestroyed=function(){return!1};Hr.prototype.destroy=function(){return this._batchTexture=this._batchTexture&&this._batchTexture.destroy(),le(this)};var vp=Hr;function dg(e){this._classes=void 0,this._classIds=void 0,this._classIndexes=void 0,this._parentCounts=void 0,this._parentIndexes=void 0,this._parentIds=void 0,this._byteLength=0,Brt(this,e.extension,e.binaryBody)}Object.defineProperties(dg.prototype,{byteLength:{get:function(){return this._byteLength}}});function Brt(e,t,n){let i,r,o,s=t.instancesLength,a=t.classes,c=t.classIds,u=t.parentCounts,f=t.parentIds,d=s,p=0;l(c.byteOffset)&&(c.componentType=c.componentType??Y.UNSIGNED_SHORT,c.type=Vt.SCALAR,o=Hh(c),c=o.createArrayBufferView(n.buffer,n.byteOffset+c.byteOffset,s),p+=c.byteLength);let g;if(l(u)){for(l(u.byteOffset)&&(u.componentType=u.componentType??Y.UNSIGNED_SHORT,u.type=Vt.SCALAR,o=Hh(u),u=o.createArrayBufferView(n.buffer,n.byteOffset+u.byteOffset,s),p+=u.byteLength),g=new Uint16Array(s),d=0,i=0;i<s;++i)g[i]=d,d+=u[i];p+=g.byteLength}l(f)&&l(f.byteOffset)&&(f.componentType=f.componentType??Y.UNSIGNED_SHORT,f.type=Vt.SCALAR,o=Hh(f),f=o.createArrayBufferView(n.buffer,n.byteOffset+f.byteOffset,d),p+=f.byteLength);let m=a.length;for(i=0;i<m;++i){let b=a[i].length,x=a[i].instances,T=vp.getBinaryProperties(b,x,n);p+=krt(T),a[i].instances=Mt(T,x)}let y=new Array(m).fill(0),A=new Uint16Array(s);for(i=0;i<s;++i)r=c[i],A[i]=y[r],++y[r];p+=A.byteLength,e._classes=a,e._classIds=c,e._classIndexes=A,e._parentCounts=u,e._parentIndexes=g,e._parentIds=f,e._byteLength=p}function krt(e){let t=0;for(let n in e)e.hasOwnProperty(n)&&(t+=e[n].typedArray.byteLength);return t}var Urt=[],zrt=[],Vrt=0;function jrt(e,t,n){let i=e._classIds,r=e._parentCounts,o=e._parentIds,s=e._parentIndexes,a=i.length,c=Urt;c.length=Math.max(c.length,a);let u=++Vrt,f=zrt;for(f.length=0,f.push(t);f.length>0;){if(t=f.pop(),c[t]===u)continue;c[t]=u;let d=n(e,t);if(l(d))return d;let p=r[t],g=s[t];for(let m=0;m<p;++m){let y=o[g+m];y!==t&&f.push(y)}}}function Hrt(e,t,n){let i=!0;for(;i;){let r=n(e,t);if(l(r))return r;let o=e._parentIds[t];i=o!==t,t=o}}function a1(e,t,n){let i=e._parentCounts,r=e._parentIds;if(l(r)){if(l(i))return jrt(e,t,n)}else return n(e,t);return Hrt(e,t,n)}dg.prototype.hasProperty=function(e,t){let n=a1(this,e,function(i,r){let o=i._classIds[r],s=i._classes[o].instances;if(l(s[t]))return!0});return l(n)};dg.prototype.propertyExists=function(e){let t=this._classes,n=t.length;for(let i=0;i<n;++i){let r=t[i].instances;if(l(r[e]))return!0}return!1};dg.prototype.getPropertyIds=function(e,t){return t=l(t)?t:[],t.length=0,a1(this,e,function(n,i){let r=n._classIds[i],o=n._classes[r].instances;for(let s in o)o.hasOwnProperty(s)&&t.indexOf(s)===-1&&t.push(s)}),t};dg.prototype.getProperty=function(e,t){return a1(this,e,function(n,i){let r=n._classIds[i],o=n._classes[r],s=n._classIndexes[i],a=o.instances[t];if(l(a))return l(a.typedArray)?Grt(a,s):Ze(a[s],!0)})};function Grt(e,t){let n=e.typedArray,i=e.componentCount;return i===1?n[t]:e.type.unpack(n,t*i)}dg.prototype.setProperty=function(e,t,n){let i=a1(this,e,function(r,o){let s=r._classIds[o],a=r._classes[s],c=r._classIndexes[o],u=a.instances[t];if(l(u))return l(u.typedArray)?Wrt(u,c,n):u[c]=Ze(n,!0),!0});return l(i)};function Wrt(e,t,n){let i=e.typedArray,r=e.componentCount;r===1?i[t]=n:e.type.pack(n,i,t*r)}dg.prototype.isClass=function(e,t){let n=a1(this,e,function(i,r){let o=i._classIds[r];if(i._classes[o].name===t)return!0});return l(n)};dg.prototype.getClassName=function(e){let t=this._classIds[e];return this._classes[t].name};var Uv=dg;function c1(e){let t=e.count,n=e.batchTable,i=e.binaryBody,r=e.parseAsPropertyAttributes??!1,o=e.customAttributeOutput,s=qrt(n),a;l(s.jsonProperties)&&(a=new _y({count:t,properties:s.jsonProperties}));let c;l(s.hierarchy)&&(c=new Uv({extension:s.hierarchy,binaryBody:i}));let u=Tp.BATCH_TABLE_CLASS_NAME,f=s.binaryProperties,d,p,g;if(r){let A=Xrt(t,u,f,i,o);g=A.transcodedSchema,p=[new Ev({propertyAttribute:A.propertyAttributeJson,class:A.transcodedClass})]}else{let A=Yrt(t,u,f,i);g=A.transcodedSchema;let b=A.featureTableJson;d=new zh({count:b.count,properties:b.properties,class:A.transcodedClass,bufferViews:A.bufferViewsTypedArrays}),p=[]}let m=[];if(l(d)||l(a)||l(c)){let A=new vu({id:0,name:"Batch Table",count:t,metadataTable:d,jsonMetadataTable:a,batchTableHierarchy:c});m.push(A)}let y={schema:g,propertyTables:m,propertyAttributes:p,extensions:s.extensions,extras:s.extras};return new ic(y)}function qrt(e){let t=e.HIERARCHY,n=e.extras,i=e.extensions,r;l(t)?(c1._deprecationWarning("batchTableHierarchyExtension","The batch table HIERARCHY property has been moved to an extension. Use extensions.3DTILES_batch_table_hierarchy instead."),r=t):l(i)&&(r=i["3DTILES_batch_table_hierarchy"]);let o,s={};for(let a in e){if(!e.hasOwnProperty(a)||a==="HIERARCHY"||a==="extensions"||a==="extras")continue;let c=e[a];Array.isArray(c)?(o=l(o)?o:{},o[a]=c):s[a]=c}return{binaryProperties:s,jsonProperties:o,hierarchy:r,extras:n,extensions:i}}function Yrt(e,t,n,i){let r={},o={},s={},a=0;for(let d in n){if(!n.hasOwnProperty(d))continue;if(!l(i))throw new oe(`Property ${d} requires a batch table binary.`);let p=n[d],g=Hh(p);o[d]={bufferView:a},r[d]=SAe(p),s[a]=g.createArrayBufferView(i.buffer,i.byteOffset+p.byteOffset,e),a++}let c={classes:{}};c.classes[t]={properties:r};let u=Su.fromJson(c);return{featureTableJson:{class:t,count:e,properties:o},bufferViewsTypedArrays:s,transcodedSchema:u,transcodedClass:u.classes[t]}}function Xrt(e,t,n,i,r){let o={},s={},a=0;for(let d in n){if(!n.hasOwnProperty(d))continue;let p=n[d];if(!l(i)&&!l(p.typedArray))throw new oe(`Property ${d} requires a batch table binary.`);let g=xt.sanitizeGlslIdentifier(d);(g===""||o.hasOwnProperty(g))&&(g=`property_${a}`,a++);let m=SAe(p);m.name=d,o[g]=m;let y=g.toUpperCase();y.startsWith("_")||(y=`_${y}`);let A=p.typedArray;l(A)||(A=Hh(p).createArrayBufferView(i.buffer,i.byteOffset+p.byteOffset,e));let b=new vn.Attribute;b.name=y,b.count=e,b.type=p.type;let x=Y.fromTypedArray(A);(x===Y.INT||x===Y.UNSIGNED_INT||x===Y.DOUBLE)&&(c1._oneTimeWarning("Cast pnts property to floats",`Point cloud property "${y}" will be cast to a float array because INT, UNSIGNED_INT, and DOUBLE are not valid WebGL vertex attribute types. Some precision may be lost.`),A=new Float32Array(A)),b.componentDatatype=Y.fromTypedArray(A),b.typedArray=A,r.push(b),s[g]={attribute:y}}let c={classes:{}};c.classes[t]={properties:o};let u=Su.fromJson(c);return{class:t,propertyAttributeJson:{properties:s},transcodedSchema:u,transcodedClass:u.classes[t]}}function SAe(e){let t=Krt(e.componentType);return{type:e.type,componentType:t}}function Krt(e){switch(e){case"BYTE":return"INT8";case"UNSIGNED_BYTE":return"UINT8";case"SHORT":return"INT16";case"UNSIGNED_SHORT":return"UINT16";case"INT":return"INT32";case"UNSIGNED_INT":return"UINT32";case"FLOAT":return"FLOAT32";case"DOUBLE":return"FLOAT64"}}c1._deprecationWarning=Yr;c1._oneTimeWarning=yt;var wy=c1;var bx={UNLOADED:0,LOADING:1,PROCESSING:2,READY:3,FAILED:4},$rt=vn.FeatureIdAttribute,JJ=class extends cr{constructor(t){super(),t=t??H.EMPTY_OBJECT;let n=t.b3dmResource,i=t.baseResource,r=t.arrayBuffer,o=t.byteOffset??0,s=t.releaseGltfJson??!1,a=t.asynchronous??!0,c=t.incrementallyLoadTextures??!0,u=t.upAxis??qi.Y,f=t.forwardAxis??qi.X,d=t.loadAttributesAsTypedArray??!1,p=t.loadAttributesFor2D??!1,g=t.enablePick??!1,m=t.loadIndicesForWireframe??!1,y=t.loadPrimitiveOutline??!0,A=t.loadForClassification??!1;i=l(i)?i:n.clone(),this._b3dmResource=n,this._baseResource=i,this._arrayBuffer=r,this._byteOffset=o,this._releaseGltfJson=s,this._asynchronous=a,this._incrementallyLoadTextures=c,this._upAxis=u,this._forwardAxis=f,this._loadAttributesAsTypedArray=d,this._loadAttributesFor2D=p,this._enablePick=g,this._loadIndicesForWireframe=m,this._loadPrimitiveOutline=y,this._loadForClassification=A,this._state=bx.UNLOADED,this._promise=void 0,this._gltfLoader=void 0,this._batchLength=0,this._propertyTable=void 0,this._batchTable=void 0,this._components=void 0,this._transform=M.IDENTITY}get texturesLoaded(){return this._gltfLoader?.texturesLoaded}get cacheKey(){}get components(){return this._components}load(){if(l(this._promise))return this._promise;let t=_z.parse(this._arrayBuffer,this._byteOffset),n=t.featureTableJson,i=t.featureTableBinary,r=t.batchTableJson,o=t.batchTableBinary,s=new Cp(n,i),a=s.getGlobalProperty("BATCH_LENGTH");this._batchLength=a;let c=s.getGlobalProperty("RTC_CENTER",Y.FLOAT,3);l(c)&&(this._transform=M.fromTranslation(h.fromArray(c))),this._batchTable={json:r,binary:o};let u=new wd({typedArray:t.gltf,upAxis:this._upAxis,forwardAxis:this._forwardAxis,gltfResource:this._b3dmResource,baseResource:this._baseResource,releaseGltfJson:this._releaseGltfJson,incrementallyLoadTextures:this._incrementallyLoadTextures,loadAttributesAsTypedArray:this._loadAttributesAsTypedArray,loadAttributesFor2D:this._loadAttributesFor2D,enablePick:this._enablePick,loadIndicesForWireframe:this._loadIndicesForWireframe,loadPrimitiveOutline:this._loadPrimitiveOutline,loadForClassification:this._loadForClassification,renameBatchIdSemantic:!0});this._gltfLoader=u,this._state=bx.LOADING;let f=this;return this._promise=u.load().then(function(){if(!f.isDestroyed())return f._state=bx.PROCESSING,f}).catch(function(d){if(!f.isDestroyed())return Jrt(f,d)}),this._promise}process(t){if(this._state===bx.READY)return!0;if(this._state!==bx.PROCESSING||!this._gltfLoader.process(t))return!1;let i=this._gltfLoader.components;return i.transform=M.multiplyTransformation(this._transform,i.transform,i.transform),Zrt(this,i),this._components=i,this._arrayBuffer=void 0,this._state=bx.READY,!0}unload(){l(this._gltfLoader)&&!this._gltfLoader.isDestroyed()&&this._gltfLoader.unload(),this._components=void 0,this._arrayBuffer=void 0}};function Jrt(e,t){return e.unload(),e._state=bx.FAILED,t=e.getError("Failed to load b3dm",t),Promise.reject(t)}function Zrt(e,t){let n=e._batchTable,i=e._batchLength;if(i===0)return;let r;if(l(n.json))r=wy({count:i,batchTable:n.json,binaryBody:n.binary});else{let a=new vu({name:Tp.BATCH_TABLE_CLASS_NAME,count:i});r=new ic({schema:{},propertyTables:[a]})}let o=t.scene.nodes,s=o.length;for(let a=0;a<s;a++)wAe(o[a]);t.structuralMetadata=r}function wAe(e){let t=e.children.length;for(let i=0;i<t;i++)wAe(e.children[i]);let n=e.primitives.length;for(let i=0;i<n;i++){let r=e.primitives[i],o=xt.getAttributeBySemantic(r,ct.FEATURE_ID);if(l(o)){o.setIndex=0;let s=new $rt;s.propertyTableId=0,s.setIndex=0,s.positionalLabel="featureId_0",r.featureIds.push(s)}}}var yz=JJ;var ZJ=class extends cr{constructor(t){super(),t=t??H.EMPTY_OBJECT,this._geoJson=t.geoJson,this._components=void 0}get cacheKey(){}get components(){return this._components}load(){return Promise.resolve(this)}process(t){return l(this._components)||(this._components=fot(this._geoJson,t),this._geoJson=void 0),!0}unload(){this._components=void 0}};function Qrt(){this.lines=void 0,this.points=void 0,this.properties=void 0}function eot(){this.features=[]}function QJ(e){let t=e[0],n=e[1],i=e[2]??0;return new h(t,n,i)}function eZ(e){let t=e.length,n=new Array(t);for(let r=0;r<t;r++)n[r]=QJ(e[r]);return[n]}function tot(e){let t=e.length,n=new Array(t);for(let i=0;i<t;i++)n[i]=eZ(e[i])[0];return n}function IAe(e){let t=e.length,n=new Array(t);for(let i=0;i<t;i++)n[i]=eZ(e[i])[0];return n}function not(e){let t=e.length,n=[];for(let i=0;i<t;i++){let r=IAe(e[i]);Zn(n,r)}return n}function iot(e){return[QJ(e)]}function rot(e){let t=e.length,n=new Array(t);for(let i=0;i<t;i++)n[i]=QJ(e[i]);return n}var oot={LineString:eZ,MultiLineString:tot,MultiPolygon:not,Polygon:IAe,MultiPoint:rot,Point:iot},sot={LineString:Oe.LINES,MultiLineString:Oe.LINES,MultiPolygon:Oe.LINES,Polygon:Oe.LINES,MultiPoint:Oe.POINTS,Point:Oe.POINTS};function PAe(e,t){if(!l(e.geometry))return;let n=e.geometry.type,i=oot[n],r=sot[n],o=e.geometry.coordinates;if(!l(i)||!l(o))return;let s=new Qrt;r===Oe.LINES?s.lines=i(o):r===Oe.POINTS&&(s.points=i(o)),s.properties=e.properties,t.features.push(s)}function aot(e,t){let n=e.features,i=n.length;for(let r=0;r<i;r++)PAe(n[r],t)}var cot={FeatureCollection:aot,Feature:PAe},Az=new h;function lot(e,t,n){let i=0,r=0,o=e.length;for(let O=0;O<o;O++){let L=e[O];if(l(L.lines)){let _=L.lines.length;for(let C=0;C<_;C++){let w=L.lines[C];i+=w.length,r+=(w.length-1)*2}}}let s=new Float32Array(i*3),a=new Float32Array(i),c=je.createTypedArray(i,r),u=je.fromTypedArray(c),f=new h(Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY),d=new h(Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY),p=0,g=0;for(let O=0;O<o;O++){let L=e[O];if(!l(L.lines))continue;let _=L.lines.length;for(let C=0;C<_;C++){let w=L.lines[C],D=w.length;for(let N=0;N<D;N++){let F=w[N],V=h.fromDegrees(F.x,F.y,F.z,ee.WGS84,Az),B=M.multiplyByPoint(t,V,Az);h.minimumByComponent(f,B,f),h.maximumByComponent(d,B,d),h.pack(B,s,p*3),a[p]=O,N<D-1&&(c[g*2]=p,c[g*2+1]=p+1,g++),p++}}}let m=tt.createVertexBuffer({typedArray:s,context:n.context,usage:Me.STATIC_DRAW});m.vertexArrayDestroyable=!1;let y=tt.createVertexBuffer({typedArray:a,context:n.context,usage:Me.STATIC_DRAW});y.vertexArrayDestroyable=!1;let A=tt.createIndexBuffer({typedArray:c,context:n.context,usage:Me.STATIC_DRAW,indexDatatype:u});A.vertexArrayDestroyable=!1;let b=new vn.Attribute;b.semantic=ct.POSITION,b.componentDatatype=Y.FLOAT,b.type=Vt.VEC3,b.count=i,b.min=f,b.max=d,b.buffer=m;let x=new vn.Attribute;x.semantic=ct.FEATURE_ID,x.setIndex=0,x.componentDatatype=Y.FLOAT,x.type=Vt.SCALAR,x.count=i,x.buffer=y;let T=[b,x],E=new vn.Material;E.unlit=!0;let v=new vn.Indices;v.indexDatatype=u,v.count=c.length,v.buffer=A;let S=new vn.FeatureIdAttribute;S.featureCount=o,S.propertyTableId=0,S.setIndex=0,S.positionalLabel="featureId_0";let I=[S],R=new vn.Primitive;return R.attributes=T,R.indices=v,R.featureIds=I,R.primitiveType=Oe.LINES,R.material=E,R}function uot(e,t,n){let i=0,r=e.length;for(let T=0;T<r;T++){let E=e[T];l(E.points)&&(i+=E.points.length)}let o=new Float32Array(i*3),s=new Float32Array(i),a=new h(Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY),c=new h(Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY),u=0;for(let T=0;T<r;T++){let E=e[T];if(!l(E.points))continue;let v=E.points.length;for(let S=0;S<v;S++){let I=E.points[S],R=h.fromDegrees(I.x,I.y,I.z,ee.WGS84,Az),O=M.multiplyByPoint(t,R,Az);h.minimumByComponent(a,O,a),h.maximumByComponent(c,O,c),h.pack(O,o,u*3),s[u]=T,u++}}let f=tt.createVertexBuffer({typedArray:o,context:n.context,usage:Me.STATIC_DRAW});f.vertexArrayDestroyable=!1;let d=tt.createVertexBuffer({typedArray:s,context:n.context,usage:Me.STATIC_DRAW});d.vertexArrayDestroyable=!1;let p=new vn.Attribute;p.semantic=ct.POSITION,p.componentDatatype=Y.FLOAT,p.type=Vt.VEC3,p.count=i,p.min=a,p.max=c,p.buffer=f;let g=new vn.Attribute;g.semantic=ct.FEATURE_ID,g.setIndex=0,g.componentDatatype=Y.FLOAT,g.type=Vt.SCALAR,g.count=i,g.buffer=d;let m=[p,g],y=new vn.Material;y.unlit=!0;let A=new vn.FeatureIdAttribute;A.featureCount=r,A.propertyTableId=0,A.setIndex=0,A.positionalLabel="featureId_0";let b=[A],x=new vn.Primitive;return x.attributes=m,x.featureIds=b,x.primitiveType=Oe.POINTS,x.material=y,x}function fot(e,t){let n=new eot,i=cot[e.type];l(i)&&i(e,n);let r=n.features,o=r.length;if(o===0)throw new oe("GeoJSON must have at least one feature");let s={};for(let O=0;O<o;O++){let _=r[O].properties??H.EMPTY_OBJECT;for(let C in _)_.hasOwnProperty(C)&&(l(s[C])||(s[C]=new Array(o)))}for(let O=0;O<o;O++){let L=r[O];for(let _ in s)if(s.hasOwnProperty(_)){let C=L.properties[_]??"";s[_][O]=C}}let a=new _y({count:o,properties:s}),u=[new vu({id:0,count:o,jsonMetadataTable:a})],f=Su.fromJson({}),d=new ic({schema:f,propertyTables:u}),p=new h(Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY),g=new h(Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY),m=!1,y=!1;for(let O=0;O<o;O++){let L=r[O];if(l(L.lines)){m=!0;let _=L.lines.length;for(let C=0;C<_;C++){let w=L.lines[C],D=w.length;for(let N=0;N<D;N++)h.minimumByComponent(p,w[N],p),h.maximumByComponent(g,w[N],g)}}if(l(L.points)){y=!0;let _=L.points.length;for(let C=0;C<_;C++){let w=L.points[C];h.minimumByComponent(p,w,p),h.maximumByComponent(g,w,g)}}}let A=h.midpoint(p,g,new h),b=h.fromDegrees(A.x,A.y,A.z,ee.WGS84,new h),x=At.eastNorthUpToFixedFrame(b,ee.WGS84,new M),T=M.inverseTransformation(x,new M),E=[];m&&E.push(lot(r,T,t)),y&&E.push(uot(r,T,t));let v=new vn.Node;v.index=0,v.primitives=E;let S=[v],I=new vn.Scene;I.nodes=S;let R=new vn.Components;return R.scene=I,R.nodes=S,R.transform=x,R.structuralMetadata=d,R}var bz=ZJ;var xz={};xz._deprecationWarning=Yr;var Iy=Uint32Array.BYTES_PER_ELEMENT;xz.parse=function(e,t){let n=t??0;t=n;let i=new Uint8Array(e),r=new DataView(e);t+=Iy;let o=r.getUint32(t,!0);if(o!==1)throw new oe(`Only Instanced 3D Model version 1 is supported. Version ${o} is not.`);t+=Iy;let s=r.getUint32(t,!0);t+=Iy;let a=r.getUint32(t,!0);if(a===0)throw new oe("featureTableJsonByteLength is zero, the feature table must be defined.");t+=Iy;let c=r.getUint32(t,!0);t+=Iy;let u=r.getUint32(t,!0);t+=Iy;let f=r.getUint32(t,!0);t+=Iy;let d=r.getUint32(t,!0);if(d!==1&&d!==0)throw new oe(`Only glTF format 0 (uri) or 1 (embedded) are supported. Format ${d} is not.`);t+=Iy;let p=Fo(i,t,a);t+=a;let g=new Uint8Array(e,t,c);t+=c;let m,y;u>0&&(m=Fo(i,t,u),t+=u,f>0&&(y=new Uint8Array(e,t,f),y=new Uint8Array(y),t+=f));let A=n+s-t;if(A===0)throw new oe("glTF byte length must be greater than 0.");let b;return t%4===0?b=new Uint8Array(e,t,A):(xz._deprecationWarning("i3dm-glb-unaligned","The embedded glb is not aligned to a 4-byte boundary."),b=new Uint8Array(i.subarray(t,t+A))),{gltfFormat:d,featureTableJson:p,featureTableBinary:g,batchTableJson:m,batchTableBinary:y,gltf:b}};var Tz=xz;var hg={NOT_LOADED:0,LOADING:1,PROCESSING:2,POST_PROCESSING:3,READY:4,FAILED:5,UNLOADED:6},Ez=vn.Attribute,dot=vn.FeatureIdAttribute,RAe=vn.Instances,tZ=class extends cr{constructor(t){super(),t=t??H.EMPTY_OBJECT;let n=t.i3dmResource,i=t.arrayBuffer,r=t.baseResource,o=t.byteOffset??0,s=t.releaseGltfJson??!1,a=t.asynchronous??!0,c=t.incrementallyLoadTextures??!0,u=t.upAxis??qi.Y,f=t.forwardAxis??qi.X,d=t.loadAttributesAsTypedArray??!1,p=t.loadIndicesForWireframe??!1,g=t.loadPrimitiveOutline??!0,m=t.enablePick??!1;r=l(r)?r:n.clone(),this._i3dmResource=n,this._baseResource=r,this._arrayBuffer=i,this._byteOffset=o,this._releaseGltfJson=s,this._asynchronous=a,this._incrementallyLoadTextures=c,this._upAxis=u,this._forwardAxis=f,this._loadAttributesAsTypedArray=d,this._loadIndicesForWireframe=p,this._loadPrimitiveOutline=g,this._enablePick=m,this._state=hg.NOT_LOADED,this._promise=void 0,this._gltfLoader=void 0,this._buffers=[],this._components=void 0,this._transform=M.IDENTITY,this._batchTable=void 0,this._featureTable=void 0,this._instancesLength=0}get texturesLoaded(){return this._gltfLoader?.texturesLoaded}get cacheKey(){}get components(){return this._components}load(){if(l(this._promise))return this._promise;let t=Tz.parse(this._arrayBuffer,this._byteOffset),n=t.featureTableJson,i=t.featureTableBinary,r=t.batchTableJson,o=t.batchTableBinary,s=t.gltfFormat,a=new Cp(n,i);this._featureTable=a;let c=a.getGlobalProperty("INSTANCES_LENGTH");if(a.featuresLength=c,!l(c))throw new oe("Feature table global property: INSTANCES_LENGTH must be defined");this._instancesLength=c;let u=a.getGlobalProperty("RTC_CENTER",Y.FLOAT,3);l(u)&&(this._transform=M.fromTranslation(h.fromArray(u))),this._batchTable={json:r,binary:o};let f={upAxis:this._upAxis,forwardAxis:this._forwardAxis,releaseGltfJson:this._releaseGltfJson,incrementallyLoadTextures:this._incrementallyLoadTextures,loadAttributesAsTypedArray:this._loadAttributesAsTypedArray,enablePick:this._enablePick,loadIndicesForWireframe:this._loadIndicesForWireframe,loadPrimitiveOutline:this._loadPrimitiveOutline};if(s===0){let p=_f(t.gltf);p=p.replace(/[\s\0]+$/,"");let g=this._baseResource.getDerivedResource({url:p});f.gltfResource=g,f.baseResource=g}else f.gltfResource=this._i3dmResource,f.typedArray=t.gltf;let d=new wd(f);return this._gltfLoader=d,this._state=hg.LOADING,this._promise=d.load().then(()=>{if(!this.isDestroyed())return this._state=hg.PROCESSING,this}).catch(p=>{if(!this.isDestroyed())throw hot(this,p)}),this._promise}process(t){if(this._state===hg.READY)return!0;let n=this._gltfLoader,i=!1;if(this._state===hg.PROCESSING&&(i=n.process(t)),!i)return!1;let r=n.components;return r.transform=M.multiplyTransformation(this._transform,r.transform,r.transform),got(this,r,t),mot(this,r),this._components=r,this._arrayBuffer=void 0,this._state=hg.READY,!0}isUnloaded(){return this._state===hg.UNLOADED}unload(){l(this._gltfLoader)&&!this._gltfLoader.isDestroyed()&&this._gltfLoader.unload(),xot(this),this._components=void 0,this._arrayBuffer=void 0,this._state=hg.UNLOADED}};function hot(e,t){return e.unload(),e._state=hg.FAILED,e.getError("Failed to load i3dm",t)}function mot(e,t){let n=e._batchTable,i=e._instancesLength;if(i===0)return;let r;if(l(n.json))r=wy({count:i,batchTable:n.json,binaryBody:n.binary});else{let o=new vu({name:Tp.BATCH_TABLE_CLASS_NAME,count:i});r=new ic({schema:{},propertyTables:[o]})}t.structuralMetadata=r}var Cz=new h,nZ=new Array(4),pot=new M;function got(e,t,n){let i,r=e._featureTable,o=e._instancesLength;if(o===0)return;let s=r.getGlobalProperty("RTC_CENTER",Y.FLOAT,3),a=r.getGlobalProperty("EAST_NORTH_UP"),c=r.hasProperty("NORMAL_UP")||r.hasProperty("NORMAL_UP_OCT32P")||a,u=r.hasProperty("SCALE")||r.hasProperty("SCALE_NON_UNIFORM"),f=yot(r,o),d;c&&(d=new Float32Array(4*o));let p;u&&(p=new Float32Array(3*o));let g=new Float32Array(o),m=h.unpackArray(f),y,A=new h,b=new h,x=new h,T=new $,E=new Le,v=new Array(4),S=new h,I=new Array(3),R=new M;if(!l(s)||h.equals(h.unpack(s),h.ZERO)){let B=ue.fromPoints(m);for(i=0;i<m.length;i++)h.subtract(m[i],B.center,Cz),f[3*i+0]=Cz.x,f[3*i+1]=Cz.y,f[3*i+2]=Cz.z;let j=M.fromTranslation(B.center,pot);t.transform=M.multiplyTransformation(j,t.transform,t.transform)}for(i=0;i<o;i++){y=h.clone(m[i]),l(s)&&h.add(y,h.unpack(s),y),c&&(Aot(r,a,i,E,y,b,A,x,T,R),Le.pack(E,v,0),d[4*i+0]=v[0],d[4*i+1]=v[1],d[4*i+2]=v[2],d[4*i+3]=v[3]),u&&(bot(r,i,S),h.pack(S,I,0),p[3*i+0]=I[0],p[3*i+1]=I[1],p[3*i+2]=I[2]);let B=r.getProperty("BATCH_ID",Y.UNSIGNED_SHORT,1,i);l(B)||(B=i),g[i]=B}let O=new RAe;O.transformInWorldSpace=!0;let L=e._buffers,_=new Ez;if(_.name="Instance Translation",_.semantic=Bo.TRANSLATION,_.componentDatatype=Y.FLOAT,_.type=Vt.VEC3,_.count=o,_.typedArray=f,!c){let B=tt.createVertexBuffer({context:n.context,typedArray:f,usage:Me.STATIC_DRAW});B.vertexArrayDestroyable=!1,L.push(B),_.buffer=B}if(O.attributes.push(_),c){let B=new Ez;B.name="Instance Rotation",B.semantic=Bo.ROTATION,B.componentDatatype=Y.FLOAT,B.type=Vt.VEC4,B.count=o,B.typedArray=d,O.attributes.push(B)}if(u){let B=new Ez;if(B.name="Instance Scale",B.semantic=Bo.SCALE,B.componentDatatype=Y.FLOAT,B.type=Vt.VEC3,B.count=o,c)B.typedArray=p;else{let j=tt.createVertexBuffer({context:n.context,typedArray:p,usage:Me.STATIC_DRAW});j.vertexArrayDestroyable=!1,L.push(j),B.buffer=j}O.attributes.push(B)}let C=new Ez;C.name="Instance Feature ID",C.setIndex=0,C.semantic=Bo.FEATURE_ID,C.componentDatatype=Y.FLOAT,C.type=Vt.SCALAR,C.count=o;let w=tt.createVertexBuffer({context:n.context,typedArray:g,usage:Me.STATIC_DRAW});w.vertexArrayDestroyable=!1,L.push(w),C.buffer=w,O.attributes.push(C);let D=new dot;D.propertyTableId=0,D.setIndex=0,D.positionalLabel="instanceFeatureId_0",O.featureIds.push(D);let N=t.nodes,F=N.length,V=!1;for(i=0;i<F;i++){let B=N[i];B.primitives.length>0&&(B.instances=V?_ot(O):O,V=!0)}}function _ot(e){let t=new RAe;t.transformInWorldSpace=e.transformInWorldSpace;let n=e.attributes,i=n.length;for(let r=0;r<i;r++){let o=Ze(n[r],!1);t.attributes.push(o)}return t.featureIds=e.featureIds,t}function yot(e,t){if(e.hasProperty("POSITION"))return e.getPropertyArray("POSITION",Y.FLOAT,3);if(e.hasProperty("POSITION_QUANTIZED")){let n=e.getPropertyArray("POSITION_QUANTIZED",Y.UNSIGNED_SHORT,3),i=e.getGlobalProperty("QUANTIZED_VOLUME_OFFSET",Y.FLOAT,3);if(!l(i))throw new oe("Global property: QUANTIZED_VOLUME_OFFSET must be defined for quantized positions.");let r=e.getGlobalProperty("QUANTIZED_VOLUME_SCALE",Y.FLOAT,3);if(!l(r))throw new oe("Global property: QUANTIZED_VOLUME_SCALE must be defined for quantized positions.");let o=new Float32Array(n.length);for(let s=0;s<n.length/3;s++)for(let a=0;a<3;a++){let c=3*s+a;o[c]=n[c]/65535*r[a]+i[a]}return o}else throw new oe("Either POSITION or POSITION_QUANTIZED must be defined for each instance.")}var DAe=new Array(4);function Aot(e,t,n,i,r,o,s,a,c,u){let f=e.getProperty("NORMAL_UP",Y.FLOAT,3,n,nZ),d=e.getProperty("NORMAL_RIGHT",Y.FLOAT,3,n,DAe),p=!1;if(l(f)){if(!l(d))throw new oe("To define a custom orientation, both NORMAL_UP and NORMAL_RIGHT must be defined.");h.unpack(f,0,o),h.unpack(d,0,s),p=!0}else{let g=e.getProperty("NORMAL_UP_OCT32P",Y.UNSIGNED_SHORT,2,n,nZ),m=e.getProperty("NORMAL_RIGHT_OCT32P",Y.UNSIGNED_SHORT,2,n,DAe);if(l(g)){if(!l(m))throw new oe("To define a custom orientation with oct-encoded vectors, both NORMAL_UP_OCT32P and NORMAL_RIGHT_OCT32P must be defined.");cn.octDecodeInRange(g[0],g[1],65535,o),cn.octDecodeInRange(m[0],m[1],65535,s),p=!0}else t?(At.eastNorthUpToFixedFrame(r,ee.WGS84,u),M.getMatrix3(u,c)):$.clone($.IDENTITY,c)}p&&(h.cross(s,o,a),h.normalize(a,a),$.setColumn(c,0,s,c),$.setColumn(c,1,o,c),$.setColumn(c,2,a,c)),Le.fromRotationMatrix(c,i)}function bot(e,t,n){n=h.fromElements(1,1,1,n);let i=e.getProperty("SCALE",Y.FLOAT,1,t);l(i)&&h.multiplyByScalar(n,i,n);let r=e.getProperty("SCALE_NON_UNIFORM",Y.FLOAT,3,t,nZ);l(r)&&(n.x*=r[0],n.y*=r[1],n.z*=r[2])}function xot(e){let t=e._buffers,n=t.length;for(let i=0;i<n;i++){let r=t[i];r.isDestroyed()||r.destroy()}t.length=0}var vz=tZ;var OAe={NONE:0,REPEAT:1,MIRRORED_REPEAT:2};Object.freeze(OAe);var Af=OAe;var MAe={STOPPED:0,ANIMATING:1};Object.freeze(MAe);var Sp=MAe;function zv(){this.times=void 0,this.points=void 0,pe.throwInstantiationError()}zv.getPointType=function(e){if(typeof e=="number")return Number;if(e instanceof h)return h;if(e instanceof Le)return Le};zv.prototype.evaluate=pe.throwInstantiationError;zv.prototype.findTimeInterval=function(e,t){let n=this.times,i=n.length;if(t=t??0,e>=n[t]){if(t+1<i&&e<n[t+1])return t;if(t+2<i&&e<n[t+2])return t+1}else if(t-1>=0&&e>=n[t-1])return t-1;let r;if(e>n[t])for(r=t;r<i-1&&!(e>=n[r]&&e<n[r+1]);++r);else for(r=t-1;r>=0&&!(e>=n[r]&&e<n[r+1]);--r);return r===i-1&&(r=i-2),r};zv.prototype.wrapTime=function(e){let t=this.times,n=t[t.length-1],i=t[0],r=n-i,o;return e<i&&(o=Math.floor((i-e)/r)+1,e+=o*r),e>n&&(o=Math.floor((e-n)/r)+1,e-=o*r),e};zv.prototype.clampTime=function(e){let t=this.times;return P.clamp(e,t[0],t[t.length-1])};var Or=zv;function Vv(e){this._value=e,this._valueType=Or.getPointType(e)}Object.defineProperties(Vv.prototype,{value:{get:function(){return this._value}}});Vv.prototype.findTimeInterval=function(e){};Vv.prototype.wrapTime=function(e){return 0};Vv.prototype.clampTime=function(e){return 0};Vv.prototype.evaluate=function(e,t){let n=this._value,i=this._valueType;return i===Number?n:i.clone(n,t)};var Sz=Vv;function jv(e){e=e??H.EMPTY_OBJECT;let t=e.points,n=e.times;this._times=n,this._points=t,this._pointType=Or.getPointType(t[0]),this._lastTimeIndex=0}Object.defineProperties(jv.prototype,{times:{get:function(){return this._times}},points:{get:function(){return this._points}}});jv.prototype.findTimeInterval=Or.prototype.findTimeInterval;jv.prototype.wrapTime=Or.prototype.wrapTime;jv.prototype.clampTime=Or.prototype.clampTime;jv.prototype.evaluate=function(e,t){let n=this.points,i=this.times,r=this._lastTimeIndex=this.findTimeInterval(e,this._lastTimeIndex),o=(e-i[r])/(i[r+1]-i[r]);return this._pointType===Number?(1-o)*n[r]+o*n[r+1]:(l(t)||(t=new h),h.lerp(n[r],n[r+1],o,t))};var xx=jv;var NAe={};NAe.solve=function(e,t,n,i){let r=new Array(n.length),o=new Array(i.length),s=new Array(i.length),a;for(a=0;a<o.length;a++)o[a]=new h,s[a]=new h;r[0]=n[0]/t[0],o[0]=h.multiplyByScalar(i[0],1/t[0],o[0]);let c;for(a=1;a<r.length;++a)c=1/(t[a]-r[a-1]*e[a-1]),r[a]=n[a]*c,o[a]=h.subtract(i[a],h.multiplyByScalar(o[a-1],e[a-1],o[a]),o[a]),o[a]=h.multiplyByScalar(o[a],c,o[a]);for(c=1/(t[a]-r[a-1]*e[a-1]),o[a]=h.subtract(i[a],h.multiplyByScalar(o[a-1],e[a-1],o[a]),o[a]),o[a]=h.multiplyByScalar(o[a],c,o[a]),s[s.length-1]=o[o.length-1],a=s.length-2;a>=0;--a)s[a]=h.subtract(o[a],h.multiplyByScalar(s[a+1],r[a],s[a]),s[a]);return s};var l1=NAe;var LAe=[],FAe=[],BAe=[],kAe=[];function Tot(e,t,n){let i=LAe,r=BAe,o=FAe,s=kAe;i.length=r.length=e.length-1,o.length=s.length=e.length;let a;i[0]=o[0]=1,r[0]=0;let c=s[0];for(l(c)||(c=s[0]=new h),h.clone(t,c),a=1;a<i.length-1;++a)i[a]=r[a]=1,o[a]=4,c=s[a],l(c)||(c=s[a]=new h),h.subtract(e[a+1],e[a-1],c),h.multiplyByScalar(c,3,c);return i[a]=0,r[a]=1,o[a]=4,c=s[a],l(c)||(c=s[a]=new h),h.subtract(e[a+1],e[a-1],c),h.multiplyByScalar(c,3,c),o[a+1]=1,c=s[a+1],l(c)||(c=s[a+1]=new h),h.clone(n,c),l1.solve(i,o,r,s)}function Eot(e){let t=LAe,n=BAe,i=FAe,r=kAe;t.length=n.length=e.length-1,i.length=r.length=e.length;let o;t[0]=n[0]=1,i[0]=2;let s=r[0];for(l(s)||(s=r[0]=new h),h.subtract(e[1],e[0],s),h.multiplyByScalar(s,3,s),o=1;o<t.length;++o)t[o]=n[o]=1,i[o]=4,s=r[o],l(s)||(s=r[o]=new h),h.subtract(e[o+1],e[o-1],s),h.multiplyByScalar(s,3,s);return i[o]=2,s=r[o],l(s)||(s=r[o]=new h),h.subtract(e[o],e[o-1],s),h.multiplyByScalar(s,3,s),l1.solve(t,i,n,r)}function Du(e){e=e??H.EMPTY_OBJECT;let t=e.points,n=e.times,i=e.inTangents,r=e.outTangents;this._times=n,this._points=t,this._pointType=Or.getPointType(t[0]),this._inTangents=i,this._outTangents=r,this._lastTimeIndex=0}Object.defineProperties(Du.prototype,{times:{get:function(){return this._times}},points:{get:function(){return this._points}},inTangents:{get:function(){return this._inTangents}},outTangents:{get:function(){return this._outTangents}}});Du.createC1=function(e){e=e??H.EMPTY_OBJECT;let t=e.times,n=e.points,i=e.tangents,r=i.slice(0,i.length-1),o=i.slice(1,i.length);return new Du({times:t,points:n,inTangents:o,outTangents:r})};Du.createNaturalCubic=function(e){e=e??H.EMPTY_OBJECT;let t=e.times,n=e.points;if(n.length<3)return new xx({points:n,times:t});let i=Eot(n),r=i.slice(0,i.length-1),o=i.slice(1,i.length);return new Du({times:t,points:n,inTangents:o,outTangents:r})};Du.createClampedCubic=function(e){e=e??H.EMPTY_OBJECT;let t=e.times,n=e.points,i=e.firstTangent,r=e.lastTangent,o=Or.getPointType(n[0]);if(n.length<3)return new xx({points:n,times:t});let s=Tot(n,i,r),a=s.slice(0,s.length-1),c=s.slice(1,s.length);return new Du({times:t,points:n,inTangents:c,outTangents:a})};Du.hermiteCoefficientMatrix=new M(2,-3,0,1,-2,3,0,0,1,-2,1,0,1,-1,0,0);Du.prototype.findTimeInterval=Or.prototype.findTimeInterval;var Cot=new se,Hv=new h;Du.prototype.wrapTime=Or.prototype.wrapTime;Du.prototype.clampTime=Or.prototype.clampTime;Du.prototype.evaluate=function(e,t){let n=this.points,i=this.times,r=this.inTangents,o=this.outTangents;this._lastTimeIndex=this.findTimeInterval(e,this._lastTimeIndex);let s=this._lastTimeIndex,a=i[s+1]-i[s],c=(e-i[s])/a,u=Cot;u.z=c,u.y=c*c,u.x=u.y*c,u.w=1;let f=M.multiplyByVector(Du.hermiteCoefficientMatrix,u,u);f.z*=a,f.w*=a;let d=this._pointType;return d===Number?n[s]*f.x+n[s+1]*f.y+o[s]*f.z+r[s]*f.w:(l(t)||(t=new d),t=d.multiplyByScalar(n[s],f.x,t),d.multiplyByScalar(n[s+1],f.y,Hv),d.add(t,Hv,t),d.multiplyByScalar(o[s],f.z,Hv),d.add(t,Hv,t),d.multiplyByScalar(r[s],f.w,Hv),d.add(t,Hv,t))};var Tx=Du;function Gv(e){e=e??H.EMPTY_OBJECT;let t=e.points,n=e.times;this._times=n,this._points=t,this._pointType=Or.getPointType(t[0]),this._lastTimeIndex=0}Object.defineProperties(Gv.prototype,{times:{get:function(){return this._times}},points:{get:function(){return this._points}}});Gv.prototype.findTimeInterval=Or.prototype.findTimeInterval;Gv.prototype.wrapTime=Or.prototype.wrapTime;Gv.prototype.clampTime=Or.prototype.clampTime;Gv.prototype.evaluate=function(e,t){let n=this.points;this._lastTimeIndex=this.findTimeInterval(e,this._lastTimeIndex);let i=this._lastTimeIndex,r=this._pointType;return r===Number?n[i]:(l(t)||(t=new r),r.clone(n[i],t))};var wz=Gv;function vot(e){let t=e.points,n=e.times;return function(i,r){l(r)||(r=new Le);let o=e._lastTimeIndex=e.findTimeInterval(i,e._lastTimeIndex),s=(i-n[o])/(n[o+1]-n[o]),a=t[o],c=t[o+1];return Le.fastSlerp(a,c,s,r)}}function Wv(e){e=e??H.EMPTY_OBJECT;let t=e.points,n=e.times;this._times=n,this._points=t,this._evaluateFunction=vot(this),this._lastTimeIndex=0}Object.defineProperties(Wv.prototype,{times:{get:function(){return this._times}},points:{get:function(){return this._points}}});Wv.prototype.findTimeInterval=Or.prototype.findTimeInterval;Wv.prototype.wrapTime=Or.prototype.wrapTime;Wv.prototype.clampTime=Or.prototype.clampTime;Wv.prototype.evaluate=function(e,t){return this._evaluateFunction(e,t)};var Iz=Wv;var qv=vn.AnimatedPropertyType;function iZ(e){e=e??H.EMPTY_OBJECT;let t=e.channel,n=e.runtimeAnimation,i=e.runtimeNode;this._channel=t,this._runtimeAnimation=n,this._runtimeNode=i,this._splines=[],this._path=void 0,Dot(this)}Object.defineProperties(iZ.prototype,{channel:{get:function(){return this._channel}},runtimeAnimation:{get:function(){return this._runtimeAnimation}},runtimeNode:{get:function(){return this._runtimeNode}},splines:{get:function(){return this._splines}}});function Sot(e,t){let n=[],i=[],r=[],o=t.length;for(let s=0;s<o;s+=3)i.push(t[s]),n.push(t[s+1]),r.push(t[s+2]);return i.splice(0,1),r.length=r.length-1,new Tx({times:e,points:n,inTangents:i,outTangents:r})}function UAe(e,t,n,i){if(e.length===1&&t.length===1)return new Sz(t[0]);switch(n){case _p.STEP:return new wz({times:e,points:t});case _p.CUBICSPLINE:return Sot(e,t);case _p.LINEAR:return i===qv.ROTATION?new Iz({times:e,points:t}):new xx({times:e,points:t})}}function wot(e,t,n,i,r){let o=[];if(i===qv.WEIGHTS){let a=t.length/r,c,u;for(c=0;c<r;c++){let f=new Array(a),d=c;if(n===_p.CUBICSPLINE)for(u=0;u<a;u+=3)f[u]=t[d],f[u+1]=t[d+r],f[u+2]=t[d+2*r],d+=r*3;else for(u=0;u<a;u++)f[u]=t[d],d+=r;o.push(UAe(e,f,n,i))}}else o.push(UAe(e,t,n,i));return o}var Iot=new h,Pot=new Le;function Dot(e){let t=e._channel,n=t.sampler,i=n.input,r=n.output,o=n.interpolation,a=t.target.path,c=e._runtimeNode,u=l(c.morphWeights)?c.morphWeights.length:1,f=wot(i,r,o,a,u);e._splines=f,e._path=a}iZ.prototype.animate=function(e){let t=this._splines,n=this._path,i=this._runtimeAnimation.model,r=this._runtimeNode;if(n===qv.WEIGHTS){let o=r.morphWeights,s=o.length;for(let a=0;a<s;a++){let c=t[a],u=i.clampAnimations?c.clampTime(e):c.wrapTime(e);o[a]=c.evaluate(u)}}else{if(r.userAnimated)return;{let o=t[0],s=i.clampAnimations?o.clampTime(e):o.wrapTime(e);n===qv.TRANSLATION||n===qv.SCALE?r[n]=o.evaluate(s,Iot):n===qv.ROTATION&&(r[n]=o.evaluate(s,Pot))}}};var Pz=iZ;function rZ(e,t,n){this._animation=t,this._name=t.name,this._runtimeChannels=void 0,this._startTime=K.clone(n.startTime),this._delay=n.delay??0,this._stopTime=K.clone(n.stopTime),this.removeOnStop=n.removeOnStop??!1,this._multiplier=n.multiplier??1,this._reverse=n.reverse??!1,this._loop=n.loop??Af.NONE,this._startOffset=n.startOffset??0,this._animationTime=n.animationTime,this._prevAnimationDelta=void 0,this.start=new be,this.update=new be,this.stop=new be,this._state=Sp.STOPPED,this._computedStartTime=void 0,this._duration=void 0;let i=this;this._raiseStartEvent=function(){i.start.raiseEvent(e,i)},this._updateEventTime=0,this._raiseUpdateEvent=function(){i.update.raiseEvent(e,i,i._updateEventTime)},this._raiseStopEvent=function(){i.stop.raiseEvent(e,i)},this._model=e,this._localStartTime=void 0,this._localStopTime=void 0,Rot(this)}Object.defineProperties(rZ.prototype,{animation:{get:function(){return this._animation}},name:{get:function(){return this._name}},runtimeChannels:{get:function(){return this._runtimeChannels}},model:{get:function(){return this._model}},localStartTime:{get:function(){return this._localStartTime}},localStopTime:{get:function(){return this._localStopTime}},startTime:{get:function(){return this._startTime}},delay:{get:function(){return this._delay}},stopTime:{get:function(){return this._stopTime}},multiplier:{get:function(){return this._multiplier}},reverse:{get:function(){return this._reverse}},loop:{get:function(){return this._loop}},startOffset:{get:function(){return this._startOffset}},animationTime:{get:function(){return this._animationTime}}});function Rot(e){let t=Number.MAX_VALUE,n=-Number.MAX_VALUE,i=e._model.sceneGraph,o=e._animation.channels,s=o.length,a=[];for(let c=0;c<s;c++){let u=o[c],f=u.target;if(!l(f))continue;let d=f.node.index,p=i._runtimeNodes[d],g=new Pz({channel:u,runtimeAnimation:e,runtimeNode:p}),m=u.sampler.input;t=Math.min(t,m[0]),n=Math.max(n,m[m.length-1]),a.push(g)}e._runtimeChannels=a,e._localStartTime=t,e._localStopTime=n}rZ.prototype.animate=function(e){let t=this._runtimeChannels,n=t.length;for(let i=0;i<n;i++)t[i].animate(e)};var Dz=rZ;function mg(e){this.animationAdded=new be,this.animationRemoved=new be,this.animateWhilePaused=!1,this._model=e,this._runtimeAnimations=[],this._previousTime=void 0}Object.defineProperties(mg.prototype,{length:{get:function(){return this._runtimeAnimations.length}},model:{get:function(){return this._model}}});function oZ(e,t,n){let i=e._model,r=new Dz(i,t,n);return e._runtimeAnimations.push(r),e.animationAdded.raiseEvent(i,r),r}mg.prototype.add=function(e){e=e??H.EMPTY_OBJECT;let n=this._model.sceneGraph.components.animations,i=e.index;if(l(i))return oZ(this,n[i],e);let r=n.length;for(let o=0;o<r;++o)if(n[o].name===e.name){i=o;break}return oZ(this,n[i],e)};mg.prototype.addAll=function(e){e=e??H.EMPTY_OBJECT;let n=this._model.sceneGraph.components.animations,i=[],r=n.length;for(let o=0;o<r;++o){let s=oZ(this,n[o],e);i.push(s)}return i};mg.prototype.remove=function(e){if(!l(e))return!1;let t=this._runtimeAnimations,n=t.indexOf(e);return n!==-1?(t.splice(n,1),this.animationRemoved.raiseEvent(this._model,e),!0):!1};mg.prototype.removeAll=function(){let e=this._model,t=this._runtimeAnimations,n=t.length;this._runtimeAnimations.length=0;for(let i=0;i<n;++i)this.animationRemoved.raiseEvent(e,t[i])};mg.prototype.contains=function(e){return l(e)?this._runtimeAnimations.indexOf(e)!==-1:!1};mg.prototype.get=function(e){return this._runtimeAnimations[e]};var Rz=[];function Oot(e,t,n){return function(){e.animationRemoved.raiseEvent(t,n)}}mg.prototype.update=function(e){let t=this._runtimeAnimations,n=t.length;if(n===0)return this._previousTime=void 0,!1;if(!this.animateWhilePaused&&K.equals(e.time,this._previousTime))return!1;this._previousTime=K.clone(e.time,this._previousTime);let i=!1,r=e.time,o=this._model;for(let s=0;s<n;++s){let a=t[s];l(a._computedStartTime)||(a._computedStartTime=K.addSeconds(a.startTime??r,a.delay,new K)),l(a._duration)||(a._duration=a.localStopTime*(1/a.multiplier));let c=a._computedStartTime,u=a._duration,f=a.stopTime,d=K.lessThanOrEquals(c,r),p=l(f)&&K.greaterThan(r,f),g=0;if(u!==0){let A=K.secondsDifference(p?f:r,c);g=l(a._animationTime)?a._animationTime(u,A):A/u}let m=a.loop===Af.REPEAT||a.loop===Af.MIRRORED_REPEAT,y=(d||m&&!l(a.startTime))&&(g<=1||m)&&!p;if(g===a._prevAnimationDelta){let A=a._state===Sp.STOPPED;if(y!==A)continue}if(a._prevAnimationDelta=g,y||a._state===Sp.ANIMATING){if(y&&a._state===Sp.STOPPED&&(a._state=Sp.ANIMATING,a.start.numberOfListeners>0&&e.afterRender.push(a._raiseStartEvent)),a.loop===Af.REPEAT)g=g-Math.floor(g);else if(a.loop===Af.MIRRORED_REPEAT){let x=Math.floor(g),T=g-x;g=x%2===1?1-T:T}let A=a.startOffset;a.reverse&&(g=1-g,A=-A);let b=g*u*a.multiplier+A;b=P.clamp(b,a.localStartTime,a.localStopTime),a.animate(b),a.update.numberOfListeners>0&&(a._updateEventTime=b,e.afterRender.push(a._raiseUpdateEvent)),i=!0,y||(a._state=Sp.STOPPED,a.stop.numberOfListeners>0&&e.afterRender.push(a._raiseStopEvent),a.removeOnStop&&Rz.push(a))}}n=Rz.length;for(let s=0;s<n;++s){let a=Rz[s];t.splice(t.indexOf(a),1),e.afterRender.push(Oot(this,o,a))}return Rz.length=0,i};var Oz=mg;var sZ=class e{constructor(t,n){this._content=t,this._batchId=n,this._color=void 0}get show(){return this._content.batchTable.getShow(this._batchId)}set show(t){this._content.batchTable.setShow(this._batchId,t)}get color(){return l(this._color)||(this._color=new z),this._content.batchTable.getColor(this._batchId,this._color)}set color(t){this._content.batchTable.setColor(this._batchId,t)}get polylinePositions(){if(l(this._content.getPolylinePositions))return this._content.getPolylinePositions(this._batchId)}get content(){return this._content}get tileset(){return this._content.tileset}get primitive(){return this._content.tileset}get featureId(){return this._batchId}get pickId(){return this._content.batchTable.getPickColor(this._batchId)}hasProperty(t){return this._content.batchTable.hasProperty(this._batchId,t)}getPropertyIds(t){return this._content.batchTable.getPropertyIds(this._batchId,t)}getProperty(t){return this._content.batchTable.getProperty(this._batchId,t)}static getPropertyInherited(t,n,i,r=t.batchTable){if(l(r)){if(r.hasPropertyBySemantic(n,i))return r.getPropertyBySemantic(n,i);if(r.hasProperty(n,i))return r.getProperty(n,i)}let o=t.metadata;if(l(o)){if(o.hasPropertyBySemantic(i))return o.getPropertyBySemantic(i);if(o.hasProperty(i))return o.getProperty(i)}let s=t.tile,a=s.metadata;if(l(a)){if(a.hasPropertyBySemantic(i))return a.getPropertyBySemantic(i);if(a.hasProperty(i))return a.getProperty(i)}let c;if(l(s.implicitSubtree)&&(c=s.implicitSubtree.metadata),l(c)){if(c.hasPropertyBySemantic(i))return c.getPropertyBySemantic(i);if(c.hasProperty(i))return c.getProperty(i)}let u=l(t.group)?t.group.metadata:void 0;if(l(u)){if(u.hasPropertyBySemantic(i))return u.getPropertyBySemantic(i);if(u.hasProperty(i))return u.getProperty(i)}let f=t.tileset.metadata;if(l(f)){if(f.hasPropertyBySemantic(i))return f.getPropertyBySemantic(i);if(f.hasProperty(i))return f.getProperty(i)}}getPropertyInherited(t){return e.getPropertyInherited(this._content,this._batchId,t)}setProperty(t,n){this._content.batchTable.setProperty(this._batchId,t,n),this._content.featurePropertiesDirty=!0}isExactClass(t){return this._content.batchTable.isExactClass(this._batchId,t)}isClass(t){return this._content.batchTable.isClass(this._batchId,t)}getExactClassName(){return this._content.batchTable.getExactClassName(this._batchId)}},ma=sZ;function Ex(e){this._model=e.model,this._featureTable=e.featureTable,this._featureId=e.featureId,this._color=void 0}Object.defineProperties(Ex.prototype,{show:{get:function(){return this._featureTable.getShow(this._featureId)},set:function(e){this._featureTable.setShow(this._featureId,e)}},color:{get:function(){return l(this._color)||(this._color=new z),this._featureTable.getColor(this._featureId,this._color)},set:function(e){this._featureTable.setColor(this._featureId,e)}},primitive:{get:function(){return this._model}},featureTable:{get:function(){return this._featureTable}},featureId:{get:function(){return this._featureId}}});Ex.prototype.hasProperty=function(e){return this._featureTable.hasProperty(this._featureId,e)};Ex.prototype.getProperty=function(e){return this._featureTable.getProperty(this._featureId,e)};Ex.prototype.getPropertyInherited=function(e){return this._featureTable.hasPropertyBySemantic(this._featureId,e)?this._featureTable.getPropertyBySemantic(this._featureId,e):this._featureTable.getProperty(this._featureId,e)};Ex.prototype.getPropertyIds=function(e){return this._featureTable.getPropertyIds(e)};Ex.prototype.setProperty=function(e,t){return this._featureTable.setProperty(this._featureId,e,t)};var Mz=Ex;var Yv={ALL_OPAQUE:0,ALL_TRANSLUCENT:1,OPAQUE_AND_TRANSLUCENT:2};Yv.getStyleCommandsNeeded=function(e,t){return t===0?Yv.ALL_OPAQUE:t===e?Yv.ALL_TRANSLUCENT:Yv.OPAQUE_AND_TRANSLUCENT};Object.freeze(Yv);var wp=Yv;var pg={GLTF:"GLTF",TILE_GLTF:"TILE_GLTF",TILE_B3DM:"B3DM",TILE_I3DM:"I3DM",TILE_PNTS:"PNTS",TILE_GEOJSON:"TILE_GEOJSON"};pg.is3DTiles=function(e){switch(e){case pg.TILE_GLTF:case pg.TILE_B3DM:case pg.TILE_I3DM:case pg.TILE_PNTS:case pg.TILE_GEOJSON:return!0;case pg.GLTF:return!1}};Object.freeze(pg);var Qo=pg;function ps(e){let t=e.model,n=e.propertyTable;this._propertyTable=n,this._model=t,this._features=void 0,this._featuresLength=0,this._batchTexture=void 0,this._styleCommandsNeededDirty=!1,this._styleCommandsNeeded=wp.ALL_OPAQUE,Mot(this)}Object.defineProperties(ps.prototype,{batchTexture:{get:function(){return this._batchTexture}},featuresLength:{get:function(){return this._featuresLength}},batchTextureByteLength:{get:function(){return l(this._batchTexture)?this._batchTexture.byteLength:0}},styleCommandsNeededDirty:{get:function(){return this._styleCommandsNeededDirty}}});function Mot(e){let t=e._model,n=Qo.is3DTiles(t.type),i=e._propertyTable.count;if(i===0)return;let r,o=new Array(i);if(n){let s=t.content;for(r=0;r<i;r++)o[r]=new ma(s,r)}else for(r=0;r<i;r++)o[r]=new Mz({model:t,featureId:r,featureTable:e});e._features=o,e._featuresLength=i,e._batchTexture=new Pu({featuresLength:i,owner:e,statistics:n?t.content.tileset.statistics:void 0})}ps.prototype.update=function(e){this._styleCommandsNeededDirty=!1,this._batchTexture.update(void 0,e);let t=wp.getStyleCommandsNeeded(this._featuresLength,this._batchTexture.translucentFeaturesLength);this._styleCommandsNeeded!==t&&(this._styleCommandsNeededDirty=!0,this._styleCommandsNeeded=t)};ps.prototype.setShow=function(e,t){this._batchTexture.setShow(e,t)};ps.prototype.setAllShow=function(e){this._batchTexture.setAllShow(e)};ps.prototype.getShow=function(e){return this._batchTexture.getShow(e)};ps.prototype.setColor=function(e,t){this._batchTexture.setColor(e,t)};ps.prototype.setAllColor=function(e){this._batchTexture.setAllColor(e)};ps.prototype.getColor=function(e,t){return this._batchTexture.getColor(e,t)};ps.prototype.getPickColor=function(e){return this._batchTexture.getPickColor(e)};ps.prototype.getFeature=function(e){return this._features[e]};ps.prototype.hasProperty=function(e,t){return this._propertyTable.hasProperty(e,t)};ps.prototype.hasPropertyBySemantic=function(e,t){return this._propertyTable.hasPropertyBySemantic(e,t)};ps.prototype.getProperty=function(e,t){return this._propertyTable.getProperty(e,t)};ps.prototype.getPropertyBySemantic=function(e,t){return this._propertyTable.getPropertyBySemantic(e,t)};ps.prototype.getPropertyIds=function(e){return this._propertyTable.getPropertyIds(e)};ps.prototype.setProperty=function(e,t,n){return this._propertyTable.setProperty(e,t,n)};ps.prototype.isClass=function(e,t){return this._propertyTable.isClass(e,t)};ps.prototype.isExactClass=function(e,t){return this._propertyTable.isExactClass(e,t)};ps.prototype.getExactClassName=function(e){return this._propertyTable.getExactClassName(e)};var Not=new z;ps.prototype.applyStyle=function(e){if(!l(e)){this.setAllColor(Pu.DEFAULT_COLOR_VALUE),this.setAllShow(Pu.DEFAULT_SHOW_VALUE);return}for(let t=0;t<this._featuresLength;t++){let n=this.getFeature(t),i=l(e.color)?e.color.evaluateColor(n,Not)??Pu.DEFAULT_COLOR_VALUE:Pu.DEFAULT_COLOR_VALUE,r=l(e.show)?e.show.evaluate(n)??Pu.DEFAULT_SHOW_VALUE:Pu.DEFAULT_SHOW_VALUE;this.setColor(t,i),this.setShow(t,r)}};ps.prototype.isDestroyed=function(){return!1};ps.prototype.destroy=function(e){this._batchTexture=this._batchTexture&&this._batchTexture.destroy(),le(this)};var Nz=ps;var zAe={name:"TilesetPipelineStage"};zAe.process=function(e,t,n){if(t.hasSkipLevelOfDetail(n)){e.shaderBuilder.addDefine("POLYGON_OFFSET",void 0,de.FRAGMENT);let o={u_polygonOffset:function(){return U.ZERO}};e.uniformMap=Mt(o,e.uniformMap),e.hasSkipLevelOfDetail=!0}let i=e.renderStateOptions;i.stencilTest=Xt.setCesium3DTileBit(),i.stencilMask=Xt.CESIUM_3D_TILE_MASK};var Lz=zAe;var Fz=`vec2 nearestPointOnEllipseFast(vec2 pos, vec2 radii) { vec2 p = abs(pos); vec2 inverseRadii = 1.0 / radii; vec2 evoluteScale = (radii.x * radii.x - radii.y * radii.y) * vec2(1.0, -1.0) * inverseRadii; @@ -8274,7 +8271,7 @@ applyFog(color, groundAtmosphereColor, lightDirection, distanceToCamera); } else { } } -`;var jU=`void atmosphereStage(ProcessedAttributes attributes) { +`;var Bz=`void atmosphereStage(ProcessedAttributes attributes) { vec3 lightDirection = czm_getDynamicAtmosphereLightDirection(v_positionWC, czm_atmosphereDynamicLighting); czm_computeGroundAtmosphereScattering( v_positionWC, @@ -8284,7 +8281,7 @@ v_atmosphereMieColor, v_atmosphereOpacity ); } -`;var Tge={name:"AtmospherePipelineStage"};Tge.process=function(e,t,n){let i=e.shaderBuilder;i.addDefine("HAS_ATMOSPHERE",void 0,de.BOTH),i.addDefine("COMPUTE_POSITION_WC_ATMOSPHERE",void 0,de.BOTH),i.addVarying("vec3","v_atmosphereRayleighColor"),i.addVarying("vec3","v_atmosphereMieColor"),i.addVarying("float","v_atmosphereOpacity"),i.addVertexLines([jU]),i.addFragmentLines([VU]),i.addUniform("bool","u_isInFog",de.FRAGMENT),e.uniformMap.u_isInFog=function(){let r=h.distance(n.camera.positionWC,t.boundingSphere.center);return P.fog(r,n.fog.density)>P.EPSILON3}};var HU=Tge;var GU=`#ifdef DIFFUSE_IBL +`;var VAe={name:"AtmospherePipelineStage"};VAe.process=function(e,t,n){let i=e.shaderBuilder;i.addDefine("HAS_ATMOSPHERE",void 0,de.BOTH),i.addDefine("COMPUTE_POSITION_WC_ATMOSPHERE",void 0,de.BOTH),i.addVarying("vec3","v_atmosphereRayleighColor"),i.addVarying("vec3","v_atmosphereMieColor"),i.addVarying("float","v_atmosphereOpacity"),i.addVertexLines([Bz]),i.addFragmentLines([Fz]),i.addUniform("bool","u_isInFog",de.FRAGMENT),e.uniformMap.u_isInFog=function(){let r=h.distance(n.camera.positionWC,t.boundingSphere.center);return P.fog(r,n.fog.density)>P.EPSILON3}};var kz=VAe;var Uz=`#ifdef DIFFUSE_IBL vec3 sampleDiffuseEnvironment(vec3 cubeDir) { #ifdef CUSTOM_SPHERICAL_HARMONICS @@ -8359,14 +8356,14 @@ vec3 specularContribution = vec3(0.0); return diffuseContribution + specularContribution; } #endif -`;var Ege={name:"ImageBasedLightingPipelineStage"},Ytt=new U;Ege.process=function(e,t,n){let i=t.imageBasedLighting,r=t.environmentMapManager,o=e.shaderBuilder,s;l(i.specularEnvironmentMaps)||(s=r.radianceCubeMap);let a=i.sphericalHarmonicCoefficients??r.sphericalHarmonicCoefficients;o.addDefine("USE_IBL_LIGHTING",void 0,de.FRAGMENT),o.addUniform("vec2","model_iblFactor",de.FRAGMENT),op.isSupported(n.context)&&((i.useSphericalHarmonics||i.useSpecularEnvironmentMaps||i.enabled)&&o.addUniform("mat3","model_iblReferenceFrameMatrix",de.FRAGMENT),l(s)&&o.addDefine("COMPUTE_POSITION_WC_ATMOSPHERE",void 0,de.BOTH),l(a)&&l(a[0])?(o.addDefine("DIFFUSE_IBL",void 0,de.FRAGMENT),o.addDefine("CUSTOM_SPHERICAL_HARMONICS",void 0,de.FRAGMENT),o.addUniform("vec3","model_sphericalHarmonicCoefficients[9]",de.FRAGMENT)):i.useDefaultSphericalHarmonics&&o.addDefine("DIFFUSE_IBL",void 0,de.FRAGMENT),l(i.specularEnvironmentCubeMap)&&i.specularEnvironmentCubeMap.ready||l(s)?(o.addDefine("SPECULAR_IBL",void 0,de.FRAGMENT),o.addDefine("CUSTOM_SPECULAR_IBL",void 0,de.FRAGMENT),o.addUniform("samplerCube","model_specularEnvironmentMaps",de.FRAGMENT),o.addUniform("float","model_specularEnvironmentMapsMaximumLOD",de.FRAGMENT)):t.useDefaultSpecularMaps&&o.addDefine("SPECULAR_IBL",void 0,de.FRAGMENT)),o.addFragmentLines(GU);let c={model_iblFactor:function(){return U.multiplyByScalar(i.imageBasedLightingFactor,r?.intensity||1,Ytt)},model_iblReferenceFrameMatrix:function(){return t._iblReferenceFrameMatrix},model_sphericalHarmonicCoefficients:function(){return a},model_specularEnvironmentMaps:function(){return i.specularEnvironmentCubeMap.texture},model_specularEnvironmentMapsMaximumLOD:function(){return i.specularEnvironmentCubeMap.maximumMipmapLevel}};l(s)&&(c.model_specularEnvironmentMaps=function(){return s},c.model_specularEnvironmentMapsMaximumLOD=function(){return r.maximumMipmapLevel}),e.uniformMap=Mt(c,e.uniformMap)};var WU=Ege;var Xtt=P.EPSILON16;function yJ(e){e=e??H.EMPTY_OBJECT;let t=e.stage,n=e.runtimeArticulation;this._stage=t,this._runtimeArticulation=n,this._name=t.name,this._type=t.type,this._minimumValue=t.minimumValue,this._maximumValue=t.maximumValue,this._currentValue=t.initialValue}Object.defineProperties(yJ.prototype,{stage:{get:function(){return this._stage}},runtimeArticulation:{get:function(){return this._runtimeArticulation}},name:{get:function(){return this._name}},type:{get:function(){return this._type}},minimumValue:{get:function(){return this._minimumValue}},maximumValue:{get:function(){return this._maximumValue}},currentValue:{get:function(){return this._currentValue},set:function(e){e=P.clamp(e,this.minimumValue,this.maximumValue),P.equalsEpsilon(this._currentValue,e,Xtt)||(this._currentValue=e,this.runtimeArticulation._dirty=!0)}}});var Ktt=new h,_J=new $;yJ.prototype.applyStageToMatrix=function(e){let t=this.type,n=this.currentValue,i=Ktt,r;switch(t){case Ll.XROTATE:r=$.fromRotationX(P.toRadians(n),_J),e=M.multiplyByMatrix3(e,r,e);break;case Ll.YROTATE:r=$.fromRotationY(P.toRadians(n),_J),e=M.multiplyByMatrix3(e,r,e);break;case Ll.ZROTATE:r=$.fromRotationZ(P.toRadians(n),_J),e=M.multiplyByMatrix3(e,r,e);break;case Ll.XTRANSLATE:i.x=n,i.y=0,i.z=0,e=M.multiplyByTranslation(e,i,e);break;case Ll.YTRANSLATE:i.x=0,i.y=n,i.z=0,e=M.multiplyByTranslation(e,i,e);break;case Ll.ZTRANSLATE:i.x=0,i.y=0,i.z=n,e=M.multiplyByTranslation(e,i,e);break;case Ll.XSCALE:i.x=n,i.y=1,i.z=1,e=M.multiplyByScale(e,i,e);break;case Ll.YSCALE:i.x=1,i.y=n,i.z=1,e=M.multiplyByScale(e,i,e);break;case Ll.ZSCALE:i.x=1,i.y=1,i.z=n,e=M.multiplyByScale(e,i,e);break;case Ll.UNIFORMSCALE:e=M.multiplyByUniformScale(e,n,e);break;default:break}return e};var qU=yJ;function YU(e){e=e??H.EMPTY_OBJECT;let t=e.articulation,n=e.sceneGraph;this._articulation=t,this._sceneGraph=n,this._name=t.name,this._runtimeStages=[],this._runtimeStagesByName={},this._runtimeNodes=[],this._dirty=!0,$tt(this)}Object.defineProperties(YU.prototype,{articulation:{get:function(){return this._articulation}},sceneGraph:{get:function(){return this._sceneGraph}},name:{get:function(){return this._name}},runtimeStages:{get:function(){return this._runtimeStages}},runtimeNodes:{get:function(){return this._runtimeNodes}}});function $tt(e){let n=e.articulation.stages,i=n.length,r=e._runtimeStages,o=e._runtimeStagesByName;for(let s=0;s<i;s++){let a=n[s],c=new qU({stage:a,runtimeArticulation:e});r.push(c);let u=a.name;o[u]=c}}YU.prototype.setArticulationStage=function(e,t){let n=this._runtimeStagesByName[e];l(n)&&(n.currentValue=t)};var Jtt=new M,Ztt=new M;YU.prototype.apply=function(){if(!this._dirty)return;this._dirty=!1;let e=M.clone(M.IDENTITY,Jtt),t,n=this._runtimeStages,i=n.length;for(t=0;t<i;t++)e=n[t].applyStageToMatrix(e);let r=this._runtimeNodes,o=r.length;for(t=0;t<o;t++){let s=r[t],a=M.multiplyTransformation(s.originalTransform,e,Ztt);s.transform=a}};var XU=YU;var KU=`void modelColorStage(inout czm_modelMaterial material) +`;var jAe={name:"ImageBasedLightingPipelineStage"},Lot=new U;jAe.process=function(e,t,n){let i=t.imageBasedLighting,r=t.environmentMapManager,o=e.shaderBuilder,s;l(i.specularEnvironmentMaps)||(s=r.radianceCubeMap);let a=i.sphericalHarmonicCoefficients??r.sphericalHarmonicCoefficients;o.addDefine("USE_IBL_LIGHTING",void 0,de.FRAGMENT),o.addUniform("vec2","model_iblFactor",de.FRAGMENT),Ep.isSupported(n.context)&&((i.useSphericalHarmonics||i.useSpecularEnvironmentMaps||i.enabled)&&o.addUniform("mat3","model_iblReferenceFrameMatrix",de.FRAGMENT),l(s)&&o.addDefine("COMPUTE_POSITION_WC_ATMOSPHERE",void 0,de.BOTH),l(a)&&l(a[0])?(o.addDefine("DIFFUSE_IBL",void 0,de.FRAGMENT),o.addDefine("CUSTOM_SPHERICAL_HARMONICS",void 0,de.FRAGMENT),o.addUniform("vec3","model_sphericalHarmonicCoefficients[9]",de.FRAGMENT)):i.useDefaultSphericalHarmonics&&o.addDefine("DIFFUSE_IBL",void 0,de.FRAGMENT),l(i.specularEnvironmentCubeMap)&&i.specularEnvironmentCubeMap.ready||l(s)?(o.addDefine("SPECULAR_IBL",void 0,de.FRAGMENT),o.addDefine("CUSTOM_SPECULAR_IBL",void 0,de.FRAGMENT),o.addUniform("samplerCube","model_specularEnvironmentMaps",de.FRAGMENT),o.addUniform("float","model_specularEnvironmentMapsMaximumLOD",de.FRAGMENT)):t.useDefaultSpecularMaps&&o.addDefine("SPECULAR_IBL",void 0,de.FRAGMENT)),o.addFragmentLines(Uz);let c={model_iblFactor:function(){return U.multiplyByScalar(i.imageBasedLightingFactor,r?.intensity||1,Lot)},model_iblReferenceFrameMatrix:function(){return t._iblReferenceFrameMatrix},model_sphericalHarmonicCoefficients:function(){return a},model_specularEnvironmentMaps:function(){return i.specularEnvironmentCubeMap.texture},model_specularEnvironmentMapsMaximumLOD:function(){return i.specularEnvironmentCubeMap.maximumMipmapLevel}};l(s)&&(c.model_specularEnvironmentMaps=function(){return s},c.model_specularEnvironmentMapsMaximumLOD=function(){return r.maximumMipmapLevel}),e.uniformMap=Mt(c,e.uniformMap)};var zz=jAe;var Fot=P.EPSILON16;function cZ(e){e=e??H.EMPTY_OBJECT;let t=e.stage,n=e.runtimeArticulation;this._stage=t,this._runtimeArticulation=n,this._name=t.name,this._type=t.type,this._minimumValue=t.minimumValue,this._maximumValue=t.maximumValue,this._currentValue=t.initialValue}Object.defineProperties(cZ.prototype,{stage:{get:function(){return this._stage}},runtimeArticulation:{get:function(){return this._runtimeArticulation}},name:{get:function(){return this._name}},type:{get:function(){return this._type}},minimumValue:{get:function(){return this._minimumValue}},maximumValue:{get:function(){return this._maximumValue}},currentValue:{get:function(){return this._currentValue},set:function(e){e=P.clamp(e,this.minimumValue,this.maximumValue),P.equalsEpsilon(this._currentValue,e,Fot)||(this._currentValue=e,this.runtimeArticulation._dirty=!0)}}});var Bot=new h,aZ=new $;cZ.prototype.applyStageToMatrix=function(e){let t=this.type,n=this.currentValue,i=Bot,r;switch(t){case zl.XROTATE:r=$.fromRotationX(P.toRadians(n),aZ),e=M.multiplyByMatrix3(e,r,e);break;case zl.YROTATE:r=$.fromRotationY(P.toRadians(n),aZ),e=M.multiplyByMatrix3(e,r,e);break;case zl.ZROTATE:r=$.fromRotationZ(P.toRadians(n),aZ),e=M.multiplyByMatrix3(e,r,e);break;case zl.XTRANSLATE:i.x=n,i.y=0,i.z=0,e=M.multiplyByTranslation(e,i,e);break;case zl.YTRANSLATE:i.x=0,i.y=n,i.z=0,e=M.multiplyByTranslation(e,i,e);break;case zl.ZTRANSLATE:i.x=0,i.y=0,i.z=n,e=M.multiplyByTranslation(e,i,e);break;case zl.XSCALE:i.x=n,i.y=1,i.z=1,e=M.multiplyByScale(e,i,e);break;case zl.YSCALE:i.x=1,i.y=n,i.z=1,e=M.multiplyByScale(e,i,e);break;case zl.ZSCALE:i.x=1,i.y=1,i.z=n,e=M.multiplyByScale(e,i,e);break;case zl.UNIFORMSCALE:e=M.multiplyByUniformScale(e,n,e);break;default:break}return e};var Vz=cZ;function jz(e){e=e??H.EMPTY_OBJECT;let t=e.articulation,n=e.sceneGraph;this._articulation=t,this._sceneGraph=n,this._name=t.name,this._runtimeStages=[],this._runtimeStagesByName={},this._runtimeNodes=[],this._dirty=!0,kot(this)}Object.defineProperties(jz.prototype,{articulation:{get:function(){return this._articulation}},sceneGraph:{get:function(){return this._sceneGraph}},name:{get:function(){return this._name}},runtimeStages:{get:function(){return this._runtimeStages}},runtimeNodes:{get:function(){return this._runtimeNodes}}});function kot(e){let n=e.articulation.stages,i=n.length,r=e._runtimeStages,o=e._runtimeStagesByName;for(let s=0;s<i;s++){let a=n[s],c=new Vz({stage:a,runtimeArticulation:e});r.push(c);let u=a.name;o[u]=c}}jz.prototype.setArticulationStage=function(e,t){let n=this._runtimeStagesByName[e];l(n)&&(n.currentValue=t)};var Uot=new M,zot=new M;jz.prototype.apply=function(){if(!this._dirty)return;this._dirty=!1;let e=M.clone(M.IDENTITY,Uot),t,n=this._runtimeStages,i=n.length;for(t=0;t<i;t++)e=n[t].applyStageToMatrix(e);let r=this._runtimeNodes,o=r.length;for(t=0;t<o;t++){let s=r[t],a=M.multiplyTransformation(s.originalTransform,e,zot);s.transform=a}};var Hz=jz;var Gz=`void modelColorStage(inout czm_modelMaterial material) { material.diffuse = mix(material.diffuse, model_color.rgb, model_colorBlend); float highlight = ceil(model_colorBlend); material.diffuse *= mix(model_color.rgb, vec3(1.0), highlight); material.alpha *= model_color.a; } -`;var dv={name:"ModelColorPipelineStage",COLOR_UNIFORM_NAME:"model_color",COLOR_BLEND_UNIFORM_NAME:"model_colorBlend"};dv.process=function(e,t,n){let i=e.shaderBuilder;i.addDefine("HAS_MODEL_COLOR",void 0,de.FRAGMENT),i.addFragmentLines(KU);let r={},o=t.color;o.alpha===0&&!t.hasSilhouette(n)&&(e.renderStateOptions.colorMask={red:!1,green:!1,blue:!1,alpha:!1}),o.alpha<1&&(e.alphaOptions.pass=Ie.TRANSLUCENT),i.addUniform("vec4",dv.COLOR_UNIFORM_NAME,de.FRAGMENT),r[dv.COLOR_UNIFORM_NAME]=function(){return t.color},i.addUniform("float",dv.COLOR_BLEND_UNIFORM_NAME,de.FRAGMENT),r[dv.COLOR_BLEND_UNIFORM_NAME]=function(){return Nl.getColorBlend(t.colorBlendMode,t.colorBlendAmount)},e.uniformMap=Mt(r,e.uniformMap)};var dx=dv;var $U=`#ifdef USE_CLIPPING_PLANES_FLOAT_TEXTURE +`;var Xv={name:"ModelColorPipelineStage",COLOR_UNIFORM_NAME:"model_color",COLOR_BLEND_UNIFORM_NAME:"model_colorBlend"};Xv.process=function(e,t,n){let i=e.shaderBuilder;i.addDefine("HAS_MODEL_COLOR",void 0,de.FRAGMENT),i.addFragmentLines(Gz);let r={},o=t.color;o.alpha===0&&!t.hasSilhouette(n)&&(e.renderStateOptions.colorMask={red:!1,green:!1,blue:!1,alpha:!1}),o.alpha<1&&(e.alphaOptions.pass=Ie.TRANSLUCENT),i.addUniform("vec4",Xv.COLOR_UNIFORM_NAME,de.FRAGMENT),r[Xv.COLOR_UNIFORM_NAME]=function(){return t.color},i.addUniform("float",Xv.COLOR_BLEND_UNIFORM_NAME,de.FRAGMENT),r[Xv.COLOR_BLEND_UNIFORM_NAME]=function(){return Ul.getColorBlend(t.colorBlendMode,t.colorBlendAmount)},e.uniformMap=Mt(r,e.uniformMap)};var Cx=Xv;var Wz=`#ifdef USE_CLIPPING_PLANES_FLOAT_TEXTURE vec4 getClippingPlane( highp sampler2D packedClippingPlanes, int clippingPlaneNumber, @@ -8445,7 +8442,7 @@ if (clipDistance > 0.0 && clipDistance < clippingPlanesEdgeWidth) { color = clippingPlanesEdgeColor; } } -`;var Cge={name:"ModelClippingPlanesPipelineStage"},Qtt=new U,ent=new M,tnt=new M;Cge.process=function(e,t,n){let i=t.clippingPlanes,r=n.context,o=e.shaderBuilder;o.addDefine("HAS_CLIPPING_PLANES",void 0,de.FRAGMENT),o.addDefine("CLIPPING_PLANES_LENGTH",i.length,de.FRAGMENT),i.unionClippingRegions&&o.addDefine("UNION_CLIPPING_REGIONS",void 0,de.FRAGMENT),Ps.useFloatTexture(r)&&o.addDefine("USE_CLIPPING_PLANES_FLOAT_TEXTURE",void 0,de.FRAGMENT);let s=Ps.getTextureResolution(i,r,Qtt);o.addDefine("CLIPPING_PLANES_TEXTURE_WIDTH",s.x,de.FRAGMENT),o.addDefine("CLIPPING_PLANES_TEXTURE_HEIGHT",s.y,de.FRAGMENT),o.addUniform("sampler2D","model_clippingPlanes",de.FRAGMENT),o.addUniform("vec4","model_clippingPlanesEdgeStyle",de.FRAGMENT),o.addUniform("mat4","model_clippingPlanesMatrix",de.FRAGMENT),o.addFragmentLines($U);let a={model_clippingPlanes:function(){return i.texture},model_clippingPlanesEdgeStyle:function(){let c=z.clone(i.edgeColor);return c.alpha=i.edgeWidth,c},model_clippingPlanesMatrix:function(){let c=M.transpose(r.uniformState.inverseView3D,ent);return M.multiply(c,t._clippingPlanesMatrix,tnt)}};e.uniformMap=Mt(a,e.uniformMap)};var JU=Cge;var ZU=`void modelClippingPolygonsStage() +`;var HAe={name:"ModelClippingPlanesPipelineStage"},Vot=new U,jot=new M,Hot=new M;HAe.process=function(e,t,n){let i=t.clippingPlanes,r=n.context,o=e.shaderBuilder;o.addDefine("HAS_CLIPPING_PLANES",void 0,de.FRAGMENT),o.addDefine("CLIPPING_PLANES_LENGTH",i.length,de.FRAGMENT),i.unionClippingRegions&&o.addDefine("UNION_CLIPPING_REGIONS",void 0,de.FRAGMENT),Ds.useFloatTexture(r)&&o.addDefine("USE_CLIPPING_PLANES_FLOAT_TEXTURE",void 0,de.FRAGMENT);let s=Ds.getTextureResolution(i,r,Vot);o.addDefine("CLIPPING_PLANES_TEXTURE_WIDTH",s.x,de.FRAGMENT),o.addDefine("CLIPPING_PLANES_TEXTURE_HEIGHT",s.y,de.FRAGMENT),o.addUniform("sampler2D","model_clippingPlanes",de.FRAGMENT),o.addUniform("vec4","model_clippingPlanesEdgeStyle",de.FRAGMENT),o.addUniform("mat4","model_clippingPlanesMatrix",de.FRAGMENT),o.addFragmentLines(Wz);let a={model_clippingPlanes:function(){return i.texture},model_clippingPlanesEdgeStyle:function(){let c=z.clone(i.edgeColor);return c.alpha=i.edgeWidth,c},model_clippingPlanesMatrix:function(){let c=M.transpose(r.uniformState.inverseView3D,jot);return M.multiply(c,t._clippingPlanesMatrix,Hot)}};e.uniformMap=Mt(a,e.uniformMap)};var qz=HAe;var Yz=`void modelClippingPolygonsStage() { bool insideAny = vectorClip(v_clippingUv); #ifdef CLIPPING_INVERSE @@ -8460,22 +8457,22 @@ discard; } #endif } -`;var QU=`void modelClippingPolygonsStage() +`;var Xz=`void modelClippingPolygonsStage() { vec2 delta = czm_eyeToCartographicDelta(v_positionEC).xy; v_clippingUv = u_clippingCameraUv + delta * u_clippingRectangleInverseSize; } -`;var Sge={name:"ModelClippingPolygonsPipelineStage"},nnt=new U,int=new U,vge=ie.MAX_VALUE;Sge.process=function(e,t,n){let i=t.clippingPolygons,r=e.shaderBuilder;r.addDefine("ENABLE_CLIPPING_POLYGONS",void 0,de.BOTH),i.inverse&&r.addDefine("CLIPPING_INVERSE",void 0,de.FRAGMENT),r.addVarying("vec2","v_clippingUv"),r.addUniform("vec2","u_clippingCameraUv",de.VERTEX),r.addUniform("vec2","u_clippingRectangleInverseSize",de.VERTEX),r.addVertexLines(QU),r.addFragmentLines(U_),r.addFragmentLines(ZU);let o={u_clippingCameraUv:function(){let s=t._clippingPolygonData?.rectangle??vge,a=s.width*.5,c=s.west+a,u=n.camera.positionCartographic,f=P.negativePiToPi(u.longitude-c)+a;return U.fromElements(f/s.width,(u.latitude-s.south)/s.height,nnt)},u_clippingRectangleInverseSize:function(){let s=t._clippingPolygonData?.rectangle??vge;return U.fromElements(1/s.width,1/s.height,int)},u_clippingEdgeTexture:function(){return t._clippingPolygonData?.polygonEdgeTexture??n.context.defaultTexture},u_clippingEdgePrimitiveIndicesTexture:function(){return t._clippingPolygonData?.polygonEdgePrimitiveIndicesTexture??n.context.defaultTexture},u_clippingGridCellIndicesTexture:function(){return t._clippingPolygonData?.polygonGridCellIndicesTexture??n.context.defaultTexture}};e.uniformMap=Mt(o,e.uniformMap)};var ez=Sge;var tz=`void modelVectorLookupStage(ProcessedAttributes attributes) +`;var WAe={name:"ModelClippingPolygonsPipelineStage"},Got=new U,Wot=new U,GAe=ie.MAX_VALUE;WAe.process=function(e,t,n){let i=t.clippingPolygons,r=e.shaderBuilder;r.addDefine("ENABLE_CLIPPING_POLYGONS",void 0,de.BOTH),i.inverse&&r.addDefine("CLIPPING_INVERSE",void 0,de.FRAGMENT),r.addVarying("vec2","v_clippingUv"),r.addUniform("vec2","u_clippingCameraUv",de.VERTEX),r.addUniform("vec2","u_clippingRectangleInverseSize",de.VERTEX),r.addVertexLines(Xz),r.addFragmentLines(U_),r.addFragmentLines(Yz);let o={u_clippingCameraUv:function(){let s=t._clippingPolygonData?.rectangle??GAe,a=s.width*.5,c=s.west+a,u=n.camera.positionCartographic,f=P.negativePiToPi(u.longitude-c)+a;return U.fromElements(f/s.width,(u.latitude-s.south)/s.height,Got)},u_clippingRectangleInverseSize:function(){let s=t._clippingPolygonData?.rectangle??GAe;return U.fromElements(1/s.width,1/s.height,Wot)},u_clippingEdgeTexture:function(){return t._clippingPolygonData?.polygonEdgeTexture??n.context.defaultTexture},u_clippingEdgePrimitiveIndicesTexture:function(){return t._clippingPolygonData?.polygonEdgePrimitiveIndicesTexture??n.context.defaultTexture},u_clippingGridCellIndicesTexture:function(){return t._clippingPolygonData?.polygonGridCellIndicesTexture??n.context.defaultTexture}};e.uniformMap=Mt(o,e.uniformMap)};var Kz=WAe;var $z=`void modelVectorLookupStage(ProcessedAttributes attributes) { vec2 delta = czm_eyeToCartographicDelta(v_positionEC).xy; v_vectorUv = u_vectorCameraUv + delta * u_vectorRectangleInverseSize; } -`;var nz=`void modelVectorLookupStage(inout vec4 color) +`;var Jz=`void modelVectorLookupStage(inout vec4 color) { color = vectorPolygonRender(v_vectorUv, color); color = vectorPolylineRender(v_vectorUv, color); } -`;var rnt={name:"ModelVectorLookupPipelineStage",process:ant},ont=new U,snt=new U;function ant(e,t,n){let i=e.shaderBuilder,r=t._vectorData,o=r.hasPolylines,s=r.hasPolygons;i.addDefine("HAS_VECTOR_LOOKUP",void 0,de.BOTH),o&&(i.addDefine("HAS_VECTOR_POLYLINES",void 0,de.FRAGMENT),r.hasMeterWidths&&(i.addDefine("VECTOR_WIDTH_IN_METERS",void 0,de.FRAGMENT),r.hasPixelWidths&&i.addDefine("VECTOR_WIDTH_MIXED_UNITS",void 0,de.FRAGMENT),i.addUniform("vec2","u_vectorMetersPerUv",de.FRAGMENT))),s&&i.addDefine("HAS_VECTOR_POLYGONS",void 0,de.FRAGMENT),i.addUniform("vec2","u_vectorCameraUv",de.VERTEX),i.addUniform("vec2","u_vectorRectangleInverseSize",de.VERTEX),i.addVarying("vec2","v_vectorUv"),i.addVertexLines(tz),i.addFragmentLines(U_),i.addFragmentLines(nz);let a=r.rectangle,c=function(){return n.context.defaultTexture},u={u_vectorCameraUv:function(){let f=t._vectorData?.rectangle??a,d=n.camera.positionCartographic,p=f.width*.5,g=f.west+p,m=P.negativePiToPi(d.longitude-g)+p;return U.fromElements(m/f.width,(d.latitude-f.south)/f.height,ont)},u_vectorRectangleInverseSize:function(){let f=t._vectorData?.rectangle??a;return U.fromElements(1/f.width,1/f.height,snt)},u_vectorColorTexture:function(){return t._vectorData?.colorTexture??c()},u_vectorPickColorTexture:function(){return t._vectorData?.pickColorTexture??c()}};o&&(u.u_vectorSegmentTexture=function(){return t._vectorData?.polylineSegmentTexture??c()},u.u_vectorWidthTexture=function(){return t._vectorData?.widthTexture??c()},u.u_vectorSegmentPrimitiveIndicesTexture=function(){return t._vectorData?.polylineSegmentPrimitiveIndicesTexture??c()},u.u_vectorGridCellIndicesTexture=function(){return t._vectorData?.polylineGridCellIndicesTexture??c()},r.hasMeterWidths&&(u.u_vectorMetersPerUv=function(){return t._vectorData.metersPerUv})),s&&(u.u_vectorPolygonEdgeTexture=function(){return t._vectorData?.polygonEdgeTexture??c()},u.u_vectorPolygonEdgePrimitiveIndicesTexture=function(){return t._vectorData?.polygonEdgePrimitiveIndicesTexture??c()},u.u_vectorPolygonGridCellIndicesTexture=function(){return t._vectorData?.polygonGridCellIndicesTexture??c()}),e.uniformMap=Mt(u,e.uniformMap)}var iz=rnt;function wge(e,t){this._model=e,this._runtimeNode=t}Object.defineProperties(wge.prototype,{name:{get:function(){return this._runtimeNode._name}},id:{get:function(){return this._runtimeNode._id}},show:{get:function(){return this._runtimeNode.show},set:function(e){this._runtimeNode.show=e}},matrix:{get:function(){return this._runtimeNode.transform},set:function(e){l(e)?(this._runtimeNode.transform=e,this._runtimeNode.userAnimated=!0,this._model._userAnimationDirty=!0):(this._runtimeNode.transform=this.originalMatrix,this._runtimeNode.userAnimated=!1)}},originalMatrix:{get:function(){return this._runtimeNode.originalTransform}}});var rz=wge;var oz=`mat4 getInstancingTransform() +`;var qot={name:"ModelVectorLookupPipelineStage",process:Kot},Yot=new U,Xot=new U;function Kot(e,t,n){let i=e.shaderBuilder,r=t._vectorData,o=r.hasPolylines,s=r.hasPolygons;i.addDefine("HAS_VECTOR_LOOKUP",void 0,de.BOTH),o&&(i.addDefine("HAS_VECTOR_POLYLINES",void 0,de.FRAGMENT),r.hasMeterWidths&&(i.addDefine("VECTOR_WIDTH_IN_METERS",void 0,de.FRAGMENT),r.hasPixelWidths&&i.addDefine("VECTOR_WIDTH_MIXED_UNITS",void 0,de.FRAGMENT),i.addUniform("vec2","u_vectorMetersPerUv",de.FRAGMENT))),s&&i.addDefine("HAS_VECTOR_POLYGONS",void 0,de.FRAGMENT),i.addUniform("vec2","u_vectorCameraUv",de.VERTEX),i.addUniform("vec2","u_vectorRectangleInverseSize",de.VERTEX),i.addVarying("vec2","v_vectorUv"),i.addVertexLines($z),i.addFragmentLines(U_),i.addFragmentLines(Jz);let a=r.rectangle,c=function(){return n.context.defaultTexture},u={u_vectorCameraUv:function(){let f=t._vectorData?.rectangle??a,d=n.camera.positionCartographic,p=f.width*.5,g=f.west+p,m=P.negativePiToPi(d.longitude-g)+p;return U.fromElements(m/f.width,(d.latitude-f.south)/f.height,Yot)},u_vectorRectangleInverseSize:function(){let f=t._vectorData?.rectangle??a;return U.fromElements(1/f.width,1/f.height,Xot)},u_vectorColorTexture:function(){return t._vectorData?.colorTexture??c()},u_vectorPickColorTexture:function(){return t._vectorData?.pickColorTexture??c()}};o&&(u.u_vectorSegmentTexture=function(){return t._vectorData?.polylineSegmentTexture??c()},u.u_vectorWidthTexture=function(){return t._vectorData?.widthTexture??c()},u.u_vectorSegmentPrimitiveIndicesTexture=function(){return t._vectorData?.polylineSegmentPrimitiveIndicesTexture??c()},u.u_vectorGridCellIndicesTexture=function(){return t._vectorData?.polylineGridCellIndicesTexture??c()},r.hasMeterWidths&&(u.u_vectorMetersPerUv=function(){return t._vectorData.metersPerUv})),s&&(u.u_vectorPolygonEdgeTexture=function(){return t._vectorData?.polygonEdgeTexture??c()},u.u_vectorPolygonEdgePrimitiveIndicesTexture=function(){return t._vectorData?.polygonEdgePrimitiveIndicesTexture??c()},u.u_vectorPolygonGridCellIndicesTexture=function(){return t._vectorData?.polygonGridCellIndicesTexture??c()}),e.uniformMap=Mt(u,e.uniformMap)}var Zz=qot;function qAe(e,t){this._model=e,this._runtimeNode=t}Object.defineProperties(qAe.prototype,{name:{get:function(){return this._runtimeNode._name}},id:{get:function(){return this._runtimeNode._id}},show:{get:function(){return this._runtimeNode.show},set:function(e){this._runtimeNode.show=e}},matrix:{get:function(){return this._runtimeNode.transform},set:function(e){l(e)?(this._runtimeNode.transform=e,this._runtimeNode.userAnimated=!0,this._model._userAnimationDirty=!0):(this._runtimeNode.transform=this.originalMatrix,this._runtimeNode.userAnimated=!1)}},originalMatrix:{get:function(){return this._runtimeNode.originalTransform}}});var Qz=qAe;var eV=`mat4 getInstancingTransform() { mat4 instancingTransform; #ifdef HAS_INSTANCE_MATRICES @@ -8533,7 +8530,7 @@ translation2D.x, translation2D.y, translation2D.z, 1.0 return instancingTransform2D; } #endif -`;var sz=`void instancingStage(inout ProcessedAttributes attributes) +`;var tV=`void instancingStage(inout ProcessedAttributes attributes) { vec3 positionMC = attributes.positionMC; mat4 instancingTransform = getInstancingTransform(); @@ -8547,7 +8544,7 @@ mat4 instancingTransform2D = getInstancingTransform2D(); attributes.position2D = (instancingTransform2D * vec4(positionMC, 1.0)).xyz; #endif } -`;var az=`void legacyInstancingStage( +`;var nV=`void legacyInstancingStage( inout ProcessedAttributes attributes, out mat4 instanceModelView, out mat3 instanceModelViewInverseTranspose) @@ -8563,7 +8560,7 @@ mat4 instancingTransform2D = getInstancingTransform2D(); attributes.position2D = (instancingTransform2D * vec4(positionMC, 1.0)).xyz; #endif } -`;var cz=new M,cnt=new M,lnt=new M,Pge={name:"InstancingPipelineStage",_getInstanceTransformsAsMatrices:Nge,_transformsToTypedArray:bJ};Pge.process=function(e,t,n){let i=t.instances,r=i.attributes[0].count,o=e.shaderBuilder;o.addDefine("HAS_INSTANCING"),o.addVertexLines(oz);let s=e.model,a=s.sceneGraph,c=e.runtimeNode,u=n.mode!==re.SCENE3D&&!n.scene3DOnly&&s._projectTo2D,f=s._enablePick&&!n.context.webgl2,d=[];Cnt(e,n,i,d,u,f),wnt(e,n,i,d);let p={};if(i.transformInWorldSpace?(o.addDefine("USE_LEGACY_INSTANCING",void 0,de.VERTEX),o.addUniform("mat4","u_instance_modifiedModelView",de.VERTEX),o.addUniform("mat4","u_instance_nodeTransform",de.VERTEX),p.u_instance_modifiedModelView=function(){let g=M.multiplyTransformation(s.modelMatrix,a.components.transform,cz);return u?M.multiplyTransformation(n.context.uniformState.view3D,g,cz):(n.mode!==re.SCENE3D&&(g=At.basisTo2D(n.mapProjection,g,cz)),M.multiplyTransformation(n.context.uniformState.view,g,cz))},p.u_instance_nodeTransform=function(){return M.multiplyTransformation(a.axisCorrectionMatrix,c.computedTransform,cnt)},o.addVertexLines(az)):o.addVertexLines(sz),u){o.addDefine("USE_2D_INSTANCING",void 0,de.VERTEX),o.addUniform("mat4","u_modelView2D",de.VERTEX);let g=n.context,m=M.fromTranslation(c.instancingReferencePoint2D,new M);p.u_modelView2D=function(){return M.multiplyTransformation(g.uniformState.view,m,lnt)}}e.uniformMap=Mt(p,e.uniformMap),e.instanceCount=r,Zn(e.attributes,d)};var zD=new M,unt=new h;function fnt(e,t,n,i,r){let o=M.multiplyTransformation(t,e,zD);return o=M.multiplyTransformation(o,n,zD),r=At.basisTo2D(i.mapProjection,o,r),r}function dnt(e,t,n,i,r){let o=M.fromTranslation(e,zD),s=M.multiplyTransformation(t,o,zD);s=M.multiplyTransformation(s,n,zD);let a=M.getTranslation(s,unt);return r=pr.computeActualEllipsoidPosition(i,a,r),r}function Dge(e,t,n){let i=e.model,r=i.sceneGraph;e.runtimeNode.node.instances.transformInWorldSpace?(M.multiplyTransformation(i.modelMatrix,r.components.transform,t),M.multiplyTransformation(r.axisCorrectionMatrix,e.runtimeNode.computedTransform,n)):(t=M.clone(r.computedModelMatrix,t),M.multiplyTransformation(t,e.runtimeNode.computedTransform,t),M.clone(M.IDENTITY,n))}var Rge=new M,Oge=new M,hnt=new M,mnt=new h;function pnt(e,t,n,i){let r=Rge,o=Oge;Dge(t,r,o);let a=t.runtimeNode.instancingReferencePoint2D,c=e.length;for(let u=0;u<c;u++){let f=e[u],d=fnt(f,r,o,n,hnt),p=M.getTranslation(d,mnt),g=h.subtract(p,a,p);i[u]=M.setTranslation(d,g,i[u])}return i}function gnt(e,t,n,i){let r=Rge,o=Oge;Dge(t,r,o);let a=t.runtimeNode.instancingReferencePoint2D,c=e.length;for(let u=0;u<c;u++){let f=e[u],d=dnt(f,r,o,n,f);i[u]=h.subtract(d,a,i[u])}return i}var _nt=new h,ynt=new h;function Mge(e,t){let n=e.runtimeNode,i=e.model.sceneGraph.computedModelMatrix,r=M.multiplyByPoint(i,n.instancingTranslationMin,_nt),o=pr.computeActualEllipsoidPosition(t,r,r),s=M.multiplyByPoint(i,n.instancingTranslationMax,ynt),a=pr.computeActualEllipsoidPosition(t,s,s);n.instancingReferencePoint2D=h.lerp(o,a,.5,new h)}function bJ(e){let n=e.length,i=new Float32Array(n*12);for(let r=0;r<n;r++){let o=e[r],s=12*r;i[s+0]=o[0],i[s+1]=o[4],i[s+2]=o[8],i[s+3]=o[12],i[s+4]=o[1],i[s+5]=o[5],i[s+6]=o[9],i[s+7]=o[13],i[s+8]=o[2],i[s+9]=o[6],i[s+10]=o[10],i[s+11]=o[14]}return i}function Ant(e){let n=e.length,i=new Float32Array(n*3);for(let r=0;r<n;r++){let o=e[r],s=3*r;i[s+0]=o[0],i[s+1]=o[4],i[s+2]=o[8]}return i}var bnt=new h,xnt=new Le,Tnt=new h;function Nge(e,t,n){let i=new Array(t),r=xt.getAttributeBySemantic(e,Fo.TRANSLATION),o=xt.getAttributeBySemantic(e,Fo.ROTATION),s=xt.getAttributeBySemantic(e,Fo.SCALE),a=new h(-Number.MAX_VALUE,-Number.MAX_VALUE,-Number.MAX_VALUE),c=new h(Number.MAX_VALUE,Number.MAX_VALUE,Number.MAX_VALUE),u=l(r),f=l(o),d=l(s),p=u?r.typedArray:new Float32Array(t*3),g=f?o.typedArray:new Float32Array(t*4);f&&o.normalized&&(g=cn.dequantize(g,o.componentDatatype,o.type,t));let m;d?m=s.typedArray:(m=new Float32Array(t*3),m.fill(1));for(let A=0;A<t;A++){let b=new h(p[A*3],p[A*3+1],p[A*3+2],bnt);h.maximumByComponent(a,b,a),h.minimumByComponent(c,b,c);let x=new Le(g[A*4],g[A*4+1],g[A*4+2],f?g[A*4+3]:1,xnt),T=new h(m[A*3],m[A*3+1],m[A*3+2],Tnt),E=M.fromTranslationQuaternionRotationScale(b,x,T,new M);i[A]=E}let y=n.runtimeNode;return y.instancingTranslationMin=c,y.instancingTranslationMax=a,u&&(r.typedArray=void 0),f&&(o.typedArray=void 0),d&&(s.typedArray=void 0),i}function Ent(e,t,n){let i=new Array(t),r=e.typedArray,o=new h(Number.MAX_VALUE,Number.MAX_VALUE,Number.MAX_VALUE),s=new h(-Number.MAX_VALUE,-Number.MAX_VALUE,-Number.MAX_VALUE);for(let c=0;c<t;c++){let u=new h(r[c*3],r[c*3+1],r[c*3+2]);i[c]=u,h.minimumByComponent(o,u,o),h.maximumByComponent(s,u,s)}let a=n.runtimeNode;return a.instancingTranslationMin=o,a.instancingTranslationMax=s,e.typedArray=void 0,i}function xJ(e,t){let n=tt.createVertexBuffer({context:t.context,typedArray:e,usage:Me.STATIC_DRAW});return n.vertexArrayDestroyable=!1,n}function Cnt(e,t,n,i,r,o){let s=xt.getAttributeBySemantic(n,Fo.ROTATION);l(s)||o?vnt(e,n,i,t,r,o):Snt(e,n,i,t,r)}function vnt(e,t,n,i,r,o){let s=e.shaderBuilder,a=t.attributes[0].count,c=e.model,u=e.runtimeNode;s.addDefine("HAS_INSTANCE_MATRICES");let f="Transform",d,p=u.instancingTransformsBuffer;if(!l(p)){d=Nge(t,a,e);let A=bJ(d);p=xJ(A,i),c._modelResources.push(p),o&&(u.transformsTypedArray=A),u.instancingTransformsBuffer=p}if(Ige(e,p,n,f),!r)return;let g=Ze(i);g.mode=re.COLUMBUS_VIEW,Mge(e,g);let m=u.instancingTransformsBuffer2D;if(!l(m)){let A=pnt(d,e,g,d),b=bJ(A);m=xJ(b,i),c._modelResources.push(m),u.instancingTransformsBuffer2D=m}Ige(e,m,n,"Transform2D")}function Snt(e,t,n,i,r,o){let s=e.shaderBuilder,a=e.runtimeNode,c=xt.getAttributeBySemantic(t,Fo.TRANSLATION),u=xt.getAttributeBySemantic(t,Fo.SCALE);if(l(u)&&(s.addDefine("HAS_INSTANCE_SCALE"),AJ(e,u.buffer,u.byteOffset,u.byteStride,n,"Scale")),!l(c))return;let f,d=c.typedArray;if(l(d)?f=Ent(c,c.count,e):l(a.instancingTranslationMin)||(a.instancingTranslationMin=c.min,a.instancingTranslationMax=c.max),s.addDefine("HAS_INSTANCE_TRANSLATION"),AJ(e,c.buffer,c.byteOffset,c.byteStride,n,"Translation"),!r&&!o)return;let g=Ze(i);g.mode=re.COLUMBUS_VIEW,Mge(e,g);let m=a.instancingTranslationBuffer2D;if(!l(m)){let x=gnt(f,e,g,f),T=Ant(x);o&&(a.transformsTypedArray=T),m=xJ(T,i),e.model._modelResources.push(m),a.instancingTranslationBuffer2D=m}if(!r)return;AJ(e,m,0,void 0,n,"Translation2D")}function Ige(e,t,n,i){let o=Y.getSizeInBytes(Y.FLOAT),s=o*12,a=[{index:e.attributeIndex++,vertexBuffer:t,componentsPerAttribute:4,componentDatatype:Y.FLOAT,normalize:!1,offsetInBytes:0,strideInBytes:s,instanceDivisor:1},{index:e.attributeIndex++,vertexBuffer:t,componentsPerAttribute:4,componentDatatype:Y.FLOAT,normalize:!1,offsetInBytes:o*4,strideInBytes:s,instanceDivisor:1},{index:e.attributeIndex++,vertexBuffer:t,componentsPerAttribute:4,componentDatatype:Y.FLOAT,normalize:!1,offsetInBytes:o*8,strideInBytes:s,instanceDivisor:1}],c=e.shaderBuilder;c.addAttribute("vec4",`a_instancing${i}Row0`),c.addAttribute("vec4",`a_instancing${i}Row1`),c.addAttribute("vec4",`a_instancing${i}Row2`),Zn(n,a)}function AJ(e,t,n,i,r,o){r.push({index:e.attributeIndex++,vertexBuffer:t,componentsPerAttribute:3,componentDatatype:Y.FLOAT,normalize:!1,offsetInBytes:n,strideInBytes:i,instanceDivisor:1}),e.shaderBuilder.addAttribute("vec3",`a_instance${o}`)}function wnt(e,t,n,i){let r=n.attributes,o=e.shaderBuilder;for(let s=0;s<r.length;s++){let a=r[s];a.semantic===Fo.FEATURE_ID&&(a.setIndex>=e.featureIdVertexAttributeSetIndex&&(e.featureIdVertexAttributeSetIndex=a.setIndex+1),i.push({index:e.attributeIndex++,vertexBuffer:a.buffer,componentsPerAttribute:Vt.getNumberOfComponents(a.type),componentDatatype:a.componentDatatype,normalize:!1,offsetInBytes:a.byteOffset,strideInBytes:a.byteStride,instanceDivisor:1}),o.addAttribute("float",`a_instanceFeatureId_${a.setIndex}`))}}var lz=Pge;var Lge=[],TJ={};TJ.name="ModelMatrixUpdateStage";TJ.update=function(e,t,n){let i=n.mode!==re.SCENE3D;if(!(i&&t._model._projectTo2D)&&e._transformDirty){if(!e.show)return;let r=i?t._computedModelMatrix2D:t._computedModelMatrix;Fge(e,t,r,e.transformToRoot,0),e._transformDirty=!1}};function Int(e,t,n){e.modelMatrix=M.multiplyTransformation(t,n,e.modelMatrix),e.cullFace=xt.getCullFace(e.modelMatrix,e.primitiveType)}function Fge(e,t,n,i,r){let o,s=Lge[r];l(s)||(s=Lge[r]=new M),i=M.multiplyTransformation(i,e.transform,s),e.updateComputedTransform();let a=e.runtimePrimitives.length;for(o=0;o<a;o++){let u=e.runtimePrimitives[o];Int(u.drawCommand,n,i)}let c=e.children.length;for(o=0;o<c;o++){let u=t._runtimeNodes[e.children[o]];if(u._transformToRoot=M.clone(i,u._transformToRoot),!u.show){u._transformDirty=!0;continue}Fge(u,t,n,i,r+1),u._transformDirty=!1}}var uz=TJ;var Bge={name:"NodeStatisticsPipelineStage",_countInstancingAttributes:kge,_countGeneratedBuffers:Uge};Bge.process=function(e,t,n){let i=e.model.statistics,r=t.instances,o=e.runtimeNode;kge(i,r),Uge(i,o)};function kge(e,t){if(!l(t))return;let n=t.attributes,i=n.length;for(let r=0;r<i;r++){let o=n[r];l(o.buffer)&&e.addBuffer(o.buffer,!1)}}function Uge(e,t){l(t.instancingTransformsBuffer)&&e.addBuffer(t.instancingTransformsBuffer,!1),l(t.instancingTransformsBuffer2D)&&e.addBuffer(t.instancingTransformsBuffer2D,!1),l(t.instancingTranslationBuffer2D)&&e.addBuffer(t.instancingTranslationBuffer2D,!1)}var fz=Bge;function hv(e){e=e??H.EMPTY_OBJECT;let t=e.node,n=e.transform,i=e.transformToRoot,r=e.sceneGraph,o=e.children;this._node=t,this._name=t.name,this._id=t.index,this._sceneGraph=r,this._children=o,this._originalTransform=M.clone(n,this._originalTransform),this._transform=M.clone(n,this._transform),this._transformToRoot=M.clone(i,this._transformToRoot),this._computedTransform=new M,this._transformDirty=!1,this._transformParameters=void 0,this._morphWeights=[],this._runtimeSkin=void 0,this._computedJointMatrices=[],this.show=!0,this.userAnimated=!1,this.pipelineStages=[],this.runtimePrimitives=[],this.updateStages=[],this.instancingTranslationMin=void 0,this.instancingTranslationMax=void 0,this.instancingTransformsBuffer=void 0,this.instancingTransformsBuffer2D=void 0,this.instancingTranslationBuffer2D=void 0,this.instancingReferencePoint2D=void 0,Pnt(this)}Object.defineProperties(hv.prototype,{node:{get:function(){return this._node}},sceneGraph:{get:function(){return this._sceneGraph}},children:{get:function(){return this._children}},transform:{get:function(){return this._transform},set:function(e){this._transformDirty=!0,this._transform=M.clone(e,this._transform)}},transformToRoot:{get:function(){return this._transformToRoot}},computedTransform:{get:function(){return this._computedTransform}},originalTransform:{get:function(){return this._originalTransform}},translation:{get:function(){return l(this._transformParameters)?this._transformParameters.translation:void 0},set:function(e){let t=this._transformParameters,n=t.translation;h.equals(n,e)||(t.translation=h.clone(e,t.translation),EJ(this,t))}},rotation:{get:function(){return l(this._transformParameters)?this._transformParameters.rotation:void 0},set:function(e){let t=this._transformParameters,n=t.rotation;Le.equals(n,e)||(t.rotation=Le.clone(e,t.rotation),EJ(this,t))}},scale:{get:function(){return l(this._transformParameters)?this._transformParameters.scale:void 0},set:function(e){let t=this._transformParameters,n=t.scale;h.equals(n,e)||(t.scale=h.clone(e,t.scale),EJ(this,t))}},morphWeights:{get:function(){return this._morphWeights},set:function(e){let t=e.length;for(let n=0;n<t;n++)this._morphWeights[n]=e[n]}},runtimeSkin:{get:function(){return this._runtimeSkin}},computedJointMatrices:{get:function(){return this._computedJointMatrices}}});function Pnt(e){let t=e.transform,n=e.transformToRoot,i=e._computedTransform;e._computedTransform=M.multiply(n,t,i);let r=e.node;l(r.matrix)||(e._transformParameters=new zb(r.translation,r.rotation,r.scale)),l(r.morphWeights)&&(e._morphWeights=r.morphWeights.slice());let o=r.articulationName;if(l(o)){let c=e.sceneGraph._runtimeArticulations[o];l(c)&&c.runtimeNodes.push(e)}}function EJ(e,t){e._transformDirty=!0,e._transform=M.fromTranslationRotationScale(t,e._transform)}hv.prototype.getChild=function(e){return this.sceneGraph._runtimeNodes[this.children[e]]};hv.prototype.configurePipeline=function(){let e=this.node,t=this.pipelineStages;t.length=0;let n=this.updateStages;n.length=0,l(e.instances)&&t.push(lz),t.push(fz),n.push(uz)};hv.prototype.updateComputedTransform=function(){this._computedTransform=M.multiply(this._transformToRoot,this._transform,this._computedTransform)};hv.prototype.updateJointMatrices=function(){let e=this._runtimeSkin;if(!l(e))return;e.updateJointMatrices();let t=this._computedJointMatrices,n=e.jointMatrices,i=n.length;for(let r=0;r<i;r++){l(t[r])||(t[r]=new M);let o=M.multiplyTransformation(this.transformToRoot,this.transform,t[r]),s=M.inverseTransformation(o,t[r]);t[r]=M.multiplyTransformation(s,n[r],t[r])}};var dz=hv;var zge={name:"AlphaPipelineStage"};zge.process=function(e,t,n){let i=e.alphaOptions,r=e.model;i.pass=i.pass??r.opaquePass;let o=e.renderStateOptions;i.pass===Ie.TRANSLUCENT&&(o.cull.enabled=!1,o.depthMask=!1,o.blending=nn.ALPHA_BLEND);let s=e.shaderBuilder,a=e.uniformMap;l(i.alphaCutoff)&&(s.addDefine("ALPHA_MODE_MASK",void 0,de.FRAGMENT),s.addUniform("float","u_alphaCutoff",de.FRAGMENT),a.u_alphaCutoff=function(){return i.alphaCutoff})};var hz=zge;var Vge={name:"BatchTexturePipelineStage"};Vge.process=function(e,t,n){let i=e.shaderBuilder,r={},o=e.model,s=o.featureTables[o.featureTableId],a=s.featuresLength;i.addUniform("int","model_featuresLength"),r.model_featuresLength=function(){return a};let c=s.batchTexture;i.addUniform("sampler2D","model_batchTexture"),r.model_batchTexture=function(){return c.batchTexture??c.defaultTexture},i.addUniform("vec4","model_textureStep"),r.model_textureStep=function(){return c.textureStep},c.textureDimensions.y>1&&(i.addDefine("MULTILINE_BATCH_TEXTURE"),i.addUniform("vec2","model_textureDimensions"),r.model_textureDimensions=function(){return c.textureDimensions}),e.uniformMap=Mt(r,e.uniformMap)};var mz=Vge;var jge={name:"ClassificationPipelineStage"};jge.process=function(e,t,n){e.shaderBuilder.addDefine("HAS_CLASSIFICATION",void 0,de.BOTH);let r=e.runtimePrimitive;l(r.batchLengths)||Dnt(t,r)};function Dnt(e,t){let n=xt.getAttributeBySemantic(e,ct.POSITION);if(!l(n))throw new oe("Primitives must have a position attribute to be used for classification.");let i,r=e.indices,o=l(r);o&&(i=r.typedArray,r.typedArray=void 0);let s=o?r.count:n.count,a=xt.getAttributeBySemantic(e,ct.FEATURE_ID,0);if(!l(a)){t.batchLengths=[s],t.batchOffsets=[0];return}let c=a.typedArray;a.typedArray=void 0;let u=[],f=[0],d=o?i[0]:0,p=c[d],g=0;for(let y=1;y<s;y++){let A=o?i[y]:y,b=c[A];if(b!==p){let x=y-g,T=y;u.push(x),f.push(T),g=T,p=b}}let m=s-g;u.push(m),t.batchLengths=u,t.batchOffsets=f}var pz=jge;var gz=`void filterByPassType(inout vec3 positionMC, vec4 featureColor) +`;var iV=new M,$ot=new M,Jot=new M,XAe={name:"InstancingPipelineStage",_getInstanceTransformsAsMatrices:QAe,_transformsToTypedArray:uZ};XAe.process=function(e,t,n){let i=t.instances,r=i.attributes[0].count,o=e.shaderBuilder;o.addDefine("HAS_INSTANCING"),o.addVertexLines(eV);let s=e.model,a=s.sceneGraph,c=e.runtimeNode,u=n.mode!==re.SCENE3D&&!n.scene3DOnly&&s._projectTo2D,f=s._enablePick&&!n.context.webgl2,d=[];dst(e,n,i,d,u,f),pst(e,n,i,d);let p={};if(i.transformInWorldSpace?(o.addDefine("USE_LEGACY_INSTANCING",void 0,de.VERTEX),o.addUniform("mat4","u_instance_modifiedModelView",de.VERTEX),o.addUniform("mat4","u_instance_nodeTransform",de.VERTEX),p.u_instance_modifiedModelView=function(){let g=M.multiplyTransformation(s.modelMatrix,a.components.transform,iV);return u?M.multiplyTransformation(n.context.uniformState.view3D,g,iV):(n.mode!==re.SCENE3D&&(g=At.basisTo2D(n.mapProjection,g,iV)),M.multiplyTransformation(n.context.uniformState.view,g,iV))},p.u_instance_nodeTransform=function(){return M.multiplyTransformation(a.axisCorrectionMatrix,c.computedTransform,$ot)},o.addVertexLines(nV)):o.addVertexLines(tV),u){o.addDefine("USE_2D_INSTANCING",void 0,de.VERTEX),o.addUniform("mat4","u_modelView2D",de.VERTEX);let g=n.context,m=M.fromTranslation(c.instancingReferencePoint2D,new M);p.u_modelView2D=function(){return M.multiplyTransformation(g.uniformState.view,m,Jot)}}e.uniformMap=Mt(p,e.uniformMap),e.instanceCount=r,Zn(e.attributes,d)};var u1=new M,Zot=new h;function Qot(e,t,n,i,r){let o=M.multiplyTransformation(t,e,u1);return o=M.multiplyTransformation(o,n,u1),r=At.basisTo2D(i.mapProjection,o,r),r}function est(e,t,n,i,r){let o=M.fromTranslation(e,u1),s=M.multiplyTransformation(t,o,u1);s=M.multiplyTransformation(s,n,u1);let a=M.getTranslation(s,Zot);return r=pr.computeActualEllipsoidPosition(i,a,r),r}function KAe(e,t,n){let i=e.model,r=i.sceneGraph;e.runtimeNode.node.instances.transformInWorldSpace?(M.multiplyTransformation(i.modelMatrix,r.components.transform,t),M.multiplyTransformation(r.axisCorrectionMatrix,e.runtimeNode.computedTransform,n)):(t=M.clone(r.computedModelMatrix,t),M.multiplyTransformation(t,e.runtimeNode.computedTransform,t),M.clone(M.IDENTITY,n))}var $Ae=new M,JAe=new M,tst=new M,nst=new h;function ist(e,t,n,i){let r=$Ae,o=JAe;KAe(t,r,o);let a=t.runtimeNode.instancingReferencePoint2D,c=e.length;for(let u=0;u<c;u++){let f=e[u],d=Qot(f,r,o,n,tst),p=M.getTranslation(d,nst),g=h.subtract(p,a,p);i[u]=M.setTranslation(d,g,i[u])}return i}function rst(e,t,n,i){let r=$Ae,o=JAe;KAe(t,r,o);let a=t.runtimeNode.instancingReferencePoint2D,c=e.length;for(let u=0;u<c;u++){let f=e[u],d=est(f,r,o,n,f);i[u]=h.subtract(d,a,i[u])}return i}var ost=new h,sst=new h;function ZAe(e,t){let n=e.runtimeNode,i=e.model.sceneGraph.computedModelMatrix,r=M.multiplyByPoint(i,n.instancingTranslationMin,ost),o=pr.computeActualEllipsoidPosition(t,r,r),s=M.multiplyByPoint(i,n.instancingTranslationMax,sst),a=pr.computeActualEllipsoidPosition(t,s,s);n.instancingReferencePoint2D=h.lerp(o,a,.5,new h)}function uZ(e){let n=e.length,i=new Float32Array(n*12);for(let r=0;r<n;r++){let o=e[r],s=12*r;i[s+0]=o[0],i[s+1]=o[4],i[s+2]=o[8],i[s+3]=o[12],i[s+4]=o[1],i[s+5]=o[5],i[s+6]=o[9],i[s+7]=o[13],i[s+8]=o[2],i[s+9]=o[6],i[s+10]=o[10],i[s+11]=o[14]}return i}function ast(e){let n=e.length,i=new Float32Array(n*3);for(let r=0;r<n;r++){let o=e[r],s=3*r;i[s+0]=o[0],i[s+1]=o[4],i[s+2]=o[8]}return i}var cst=new h,lst=new Le,ust=new h;function QAe(e,t,n){let i=new Array(t),r=xt.getAttributeBySemantic(e,Bo.TRANSLATION),o=xt.getAttributeBySemantic(e,Bo.ROTATION),s=xt.getAttributeBySemantic(e,Bo.SCALE),a=new h(-Number.MAX_VALUE,-Number.MAX_VALUE,-Number.MAX_VALUE),c=new h(Number.MAX_VALUE,Number.MAX_VALUE,Number.MAX_VALUE),u=l(r),f=l(o),d=l(s),p=u?r.typedArray:new Float32Array(t*3),g=f?o.typedArray:new Float32Array(t*4);f&&o.normalized&&(g=cn.dequantize(g,o.componentDatatype,o.type,t));let m;d?m=s.typedArray:(m=new Float32Array(t*3),m.fill(1));for(let A=0;A<t;A++){let b=new h(p[A*3],p[A*3+1],p[A*3+2],cst);h.maximumByComponent(a,b,a),h.minimumByComponent(c,b,c);let x=new Le(g[A*4],g[A*4+1],g[A*4+2],f?g[A*4+3]:1,lst),T=new h(m[A*3],m[A*3+1],m[A*3+2],ust),E=M.fromTranslationQuaternionRotationScale(b,x,T,new M);i[A]=E}let y=n.runtimeNode;return y.instancingTranslationMin=c,y.instancingTranslationMax=a,u&&(r.typedArray=void 0),f&&(o.typedArray=void 0),d&&(s.typedArray=void 0),i}function fst(e,t,n){let i=new Array(t),r=e.typedArray,o=new h(Number.MAX_VALUE,Number.MAX_VALUE,Number.MAX_VALUE),s=new h(-Number.MAX_VALUE,-Number.MAX_VALUE,-Number.MAX_VALUE);for(let c=0;c<t;c++){let u=new h(r[c*3],r[c*3+1],r[c*3+2]);i[c]=u,h.minimumByComponent(o,u,o),h.maximumByComponent(s,u,s)}let a=n.runtimeNode;return a.instancingTranslationMin=o,a.instancingTranslationMax=s,e.typedArray=void 0,i}function fZ(e,t){let n=tt.createVertexBuffer({context:t.context,typedArray:e,usage:Me.STATIC_DRAW});return n.vertexArrayDestroyable=!1,n}function dst(e,t,n,i,r,o){let s=xt.getAttributeBySemantic(n,Bo.ROTATION);l(s)||o?hst(e,n,i,t,r,o):mst(e,n,i,t,r)}function hst(e,t,n,i,r,o){let s=e.shaderBuilder,a=t.attributes[0].count,c=e.model,u=e.runtimeNode;s.addDefine("HAS_INSTANCE_MATRICES");let f="Transform",d,p=u.instancingTransformsBuffer;if(!l(p)){d=QAe(t,a,e);let A=uZ(d);p=fZ(A,i),c._modelResources.push(p),o&&(u.transformsTypedArray=A),u.instancingTransformsBuffer=p}if(YAe(e,p,n,f),!r)return;let g=Ze(i);g.mode=re.COLUMBUS_VIEW,ZAe(e,g);let m=u.instancingTransformsBuffer2D;if(!l(m)){let A=ist(d,e,g,d),b=uZ(A);m=fZ(b,i),c._modelResources.push(m),u.instancingTransformsBuffer2D=m}YAe(e,m,n,"Transform2D")}function mst(e,t,n,i,r,o){let s=e.shaderBuilder,a=e.runtimeNode,c=xt.getAttributeBySemantic(t,Bo.TRANSLATION),u=xt.getAttributeBySemantic(t,Bo.SCALE);if(l(u)&&(s.addDefine("HAS_INSTANCE_SCALE"),lZ(e,u.buffer,u.byteOffset,u.byteStride,n,"Scale")),!l(c))return;let f,d=c.typedArray;if(l(d)?f=fst(c,c.count,e):l(a.instancingTranslationMin)||(a.instancingTranslationMin=c.min,a.instancingTranslationMax=c.max),s.addDefine("HAS_INSTANCE_TRANSLATION"),lZ(e,c.buffer,c.byteOffset,c.byteStride,n,"Translation"),!r&&!o)return;let g=Ze(i);g.mode=re.COLUMBUS_VIEW,ZAe(e,g);let m=a.instancingTranslationBuffer2D;if(!l(m)){let x=rst(f,e,g,f),T=ast(x);o&&(a.transformsTypedArray=T),m=fZ(T,i),e.model._modelResources.push(m),a.instancingTranslationBuffer2D=m}if(!r)return;lZ(e,m,0,void 0,n,"Translation2D")}function YAe(e,t,n,i){let o=Y.getSizeInBytes(Y.FLOAT),s=o*12,a=[{index:e.attributeIndex++,vertexBuffer:t,componentsPerAttribute:4,componentDatatype:Y.FLOAT,normalize:!1,offsetInBytes:0,strideInBytes:s,instanceDivisor:1},{index:e.attributeIndex++,vertexBuffer:t,componentsPerAttribute:4,componentDatatype:Y.FLOAT,normalize:!1,offsetInBytes:o*4,strideInBytes:s,instanceDivisor:1},{index:e.attributeIndex++,vertexBuffer:t,componentsPerAttribute:4,componentDatatype:Y.FLOAT,normalize:!1,offsetInBytes:o*8,strideInBytes:s,instanceDivisor:1}],c=e.shaderBuilder;c.addAttribute("vec4",`a_instancing${i}Row0`),c.addAttribute("vec4",`a_instancing${i}Row1`),c.addAttribute("vec4",`a_instancing${i}Row2`),Zn(n,a)}function lZ(e,t,n,i,r,o){r.push({index:e.attributeIndex++,vertexBuffer:t,componentsPerAttribute:3,componentDatatype:Y.FLOAT,normalize:!1,offsetInBytes:n,strideInBytes:i,instanceDivisor:1}),e.shaderBuilder.addAttribute("vec3",`a_instance${o}`)}function pst(e,t,n,i){let r=n.attributes,o=e.shaderBuilder;for(let s=0;s<r.length;s++){let a=r[s];a.semantic===Bo.FEATURE_ID&&(a.setIndex>=e.featureIdVertexAttributeSetIndex&&(e.featureIdVertexAttributeSetIndex=a.setIndex+1),i.push({index:e.attributeIndex++,vertexBuffer:a.buffer,componentsPerAttribute:Vt.getNumberOfComponents(a.type),componentDatatype:a.componentDatatype,normalize:!1,offsetInBytes:a.byteOffset,strideInBytes:a.byteStride,instanceDivisor:1}),o.addAttribute("float",`a_instanceFeatureId_${a.setIndex}`))}}var rV=XAe;var ebe=[],dZ={};dZ.name="ModelMatrixUpdateStage";dZ.update=function(e,t,n){let i=n.mode!==re.SCENE3D;if(!(i&&t._model._projectTo2D)&&e._transformDirty){if(!e.show)return;let r=i?t._computedModelMatrix2D:t._computedModelMatrix;tbe(e,t,r,e.transformToRoot,0),e._transformDirty=!1}};function gst(e,t,n){e.modelMatrix=M.multiplyTransformation(t,n,e.modelMatrix),e.cullFace=xt.getCullFace(e.modelMatrix,e.primitiveType)}function tbe(e,t,n,i,r){let o,s=ebe[r];l(s)||(s=ebe[r]=new M),i=M.multiplyTransformation(i,e.transform,s),e.updateComputedTransform();let a=e.runtimePrimitives.length;for(o=0;o<a;o++){let u=e.runtimePrimitives[o];gst(u.drawCommand,n,i)}let c=e.children.length;for(o=0;o<c;o++){let u=t._runtimeNodes[e.children[o]];if(u._transformToRoot=M.clone(i,u._transformToRoot),!u.show){u._transformDirty=!0;continue}tbe(u,t,n,i,r+1),u._transformDirty=!1}}var oV=dZ;var nbe={name:"NodeStatisticsPipelineStage",_countInstancingAttributes:ibe,_countGeneratedBuffers:rbe};nbe.process=function(e,t,n){let i=e.model.statistics,r=t.instances,o=e.runtimeNode;ibe(i,r),rbe(i,o)};function ibe(e,t){if(!l(t))return;let n=t.attributes,i=n.length;for(let r=0;r<i;r++){let o=n[r];l(o.buffer)&&e.addBuffer(o.buffer,!1)}}function rbe(e,t){l(t.instancingTransformsBuffer)&&e.addBuffer(t.instancingTransformsBuffer,!1),l(t.instancingTransformsBuffer2D)&&e.addBuffer(t.instancingTransformsBuffer2D,!1),l(t.instancingTranslationBuffer2D)&&e.addBuffer(t.instancingTranslationBuffer2D,!1)}var sV=nbe;function Kv(e){e=e??H.EMPTY_OBJECT;let t=e.node,n=e.transform,i=e.transformToRoot,r=e.sceneGraph,o=e.children;this._node=t,this._name=t.name,this._id=t.index,this._sceneGraph=r,this._children=o,this._originalTransform=M.clone(n,this._originalTransform),this._transform=M.clone(n,this._transform),this._transformToRoot=M.clone(i,this._transformToRoot),this._computedTransform=new M,this._transformDirty=!1,this._transformParameters=void 0,this._morphWeights=[],this._runtimeSkin=void 0,this._computedJointMatrices=[],this.show=!0,this.userAnimated=!1,this.pipelineStages=[],this.runtimePrimitives=[],this.updateStages=[],this.instancingTranslationMin=void 0,this.instancingTranslationMax=void 0,this.instancingTransformsBuffer=void 0,this.instancingTransformsBuffer2D=void 0,this.instancingTranslationBuffer2D=void 0,this.instancingReferencePoint2D=void 0,_st(this)}Object.defineProperties(Kv.prototype,{node:{get:function(){return this._node}},sceneGraph:{get:function(){return this._sceneGraph}},children:{get:function(){return this._children}},transform:{get:function(){return this._transform},set:function(e){this._transformDirty=!0,this._transform=M.clone(e,this._transform)}},transformToRoot:{get:function(){return this._transformToRoot}},computedTransform:{get:function(){return this._computedTransform}},originalTransform:{get:function(){return this._originalTransform}},translation:{get:function(){return l(this._transformParameters)?this._transformParameters.translation:void 0},set:function(e){let t=this._transformParameters,n=t.translation;h.equals(n,e)||(t.translation=h.clone(e,t.translation),hZ(this,t))}},rotation:{get:function(){return l(this._transformParameters)?this._transformParameters.rotation:void 0},set:function(e){let t=this._transformParameters,n=t.rotation;Le.equals(n,e)||(t.rotation=Le.clone(e,t.rotation),hZ(this,t))}},scale:{get:function(){return l(this._transformParameters)?this._transformParameters.scale:void 0},set:function(e){let t=this._transformParameters,n=t.scale;h.equals(n,e)||(t.scale=h.clone(e,t.scale),hZ(this,t))}},morphWeights:{get:function(){return this._morphWeights},set:function(e){let t=e.length;for(let n=0;n<t;n++)this._morphWeights[n]=e[n]}},runtimeSkin:{get:function(){return this._runtimeSkin}},computedJointMatrices:{get:function(){return this._computedJointMatrices}}});function _st(e){let t=e.transform,n=e.transformToRoot,i=e._computedTransform;e._computedTransform=M.multiply(n,t,i);let r=e.node;l(r.matrix)||(e._transformParameters=new Gb(r.translation,r.rotation,r.scale)),l(r.morphWeights)&&(e._morphWeights=r.morphWeights.slice());let o=r.articulationName;if(l(o)){let c=e.sceneGraph._runtimeArticulations[o];l(c)&&c.runtimeNodes.push(e)}}function hZ(e,t){e._transformDirty=!0,e._transform=M.fromTranslationRotationScale(t,e._transform)}Kv.prototype.getChild=function(e){return this.sceneGraph._runtimeNodes[this.children[e]]};Kv.prototype.configurePipeline=function(){let e=this.node,t=this.pipelineStages;t.length=0;let n=this.updateStages;n.length=0,l(e.instances)&&t.push(rV),t.push(sV),n.push(oV)};Kv.prototype.updateComputedTransform=function(){this._computedTransform=M.multiply(this._transformToRoot,this._transform,this._computedTransform)};Kv.prototype.updateJointMatrices=function(){let e=this._runtimeSkin;if(!l(e))return;e.updateJointMatrices();let t=this._computedJointMatrices,n=e.jointMatrices,i=n.length;for(let r=0;r<i;r++){l(t[r])||(t[r]=new M);let o=M.multiplyTransformation(this.transformToRoot,this.transform,t[r]),s=M.inverseTransformation(o,t[r]);t[r]=M.multiplyTransformation(s,n[r],t[r])}};var aV=Kv;var obe={name:"AlphaPipelineStage"};obe.process=function(e,t,n){let i=e.alphaOptions,r=e.model;i.pass=i.pass??r.opaquePass;let o=e.renderStateOptions;i.pass===Ie.TRANSLUCENT&&(o.cull.enabled=!1,o.depthMask=!1,o.blending=nn.ALPHA_BLEND);let s=e.shaderBuilder,a=e.uniformMap;l(i.alphaCutoff)&&(s.addDefine("ALPHA_MODE_MASK",void 0,de.FRAGMENT),s.addUniform("float","u_alphaCutoff",de.FRAGMENT),a.u_alphaCutoff=function(){return i.alphaCutoff})};var cV=obe;var sbe={name:"BatchTexturePipelineStage"};sbe.process=function(e,t,n){let i=e.shaderBuilder,r={},o=e.model,s=o.featureTables[o.featureTableId],a=s.featuresLength;i.addUniform("int","model_featuresLength"),r.model_featuresLength=function(){return a};let c=s.batchTexture;i.addUniform("sampler2D","model_batchTexture"),r.model_batchTexture=function(){return c.batchTexture??c.defaultTexture},i.addUniform("vec4","model_textureStep"),r.model_textureStep=function(){return c.textureStep},c.textureDimensions.y>1&&(i.addDefine("MULTILINE_BATCH_TEXTURE"),i.addUniform("vec2","model_textureDimensions"),r.model_textureDimensions=function(){return c.textureDimensions}),e.uniformMap=Mt(r,e.uniformMap)};var lV=sbe;var abe={name:"ClassificationPipelineStage"};abe.process=function(e,t,n){e.shaderBuilder.addDefine("HAS_CLASSIFICATION",void 0,de.BOTH);let r=e.runtimePrimitive;l(r.batchLengths)||yst(t,r)};function yst(e,t){let n=xt.getAttributeBySemantic(e,ct.POSITION);if(!l(n))throw new oe("Primitives must have a position attribute to be used for classification.");let i,r=e.indices,o=l(r);o&&(i=r.typedArray,r.typedArray=void 0);let s=o?r.count:n.count,a=xt.getAttributeBySemantic(e,ct.FEATURE_ID,0);if(!l(a)){t.batchLengths=[s],t.batchOffsets=[0];return}let c=a.typedArray;a.typedArray=void 0;let u=[],f=[0],d=o?i[0]:0,p=c[d],g=0;for(let y=1;y<s;y++){let A=o?i[y]:y,b=c[A];if(b!==p){let x=y-g,T=y;u.push(x),f.push(T),g=T,p=b}}let m=s-g;u.push(m),t.batchLengths=u,t.batchOffsets=f}var uV=abe;var fV=`void filterByPassType(inout vec3 positionMC, vec4 featureColor) { bool styleTranslucent = (featureColor.a != 1.0); if (czm_pass == czm_passTranslucent && !styleTranslucent && !model_commandTranslucent) @@ -8587,7 +8584,7 @@ positionMC *= show; filterByPassType(positionMC, feature.color); #endif } -`;var _z=`void filterByPassType(vec4 featureColor) +`;var dV=`void filterByPassType(vec4 featureColor) { bool styleTranslucent = (featureColor.a != 1.0); if (czm_pass == czm_passTranslucent && !styleTranslucent && !model_commandTranslucent) @@ -8624,7 +8621,7 @@ material.diffuse *= mix(featureColor.rgb, vec3(1.0), highlight); #endif material.alpha *= featureColor.a; } -`;var Hge={name:"CPUStylingPipelineStage"};Hge.process=function(e,t,n){let i=e.model,r=e.shaderBuilder;r.addVertexLines(gz),r.addFragmentLines(_z),r.addDefine("USE_CPU_STYLING",void 0,de.BOTH),l(i.color)||(r.addUniform("float",dx.COLOR_BLEND_UNIFORM_NAME,de.FRAGMENT),e.uniformMap[dx.COLOR_BLEND_UNIFORM_NAME]=function(){return Nl.getColorBlend(i.colorBlendMode,i.colorBlendAmount)}),r.addUniform("bool","model_commandTranslucent",de.BOTH),e.uniformMap.model_commandTranslucent=function(){return e.alphaOptions.pass===Ie.TRANSLUCENT}};var yz=Hge;var CJ={MODIFY_MATERIAL:"MODIFY_MATERIAL",REPLACE_MATERIAL:"REPLACE_MATERIAL"};CJ.getDefineName=function(e){return`CUSTOM_SHADER_${e}`};Object.freeze(CJ);var Iy=CJ;var Az=`void customShaderStage( +`;var cbe={name:"CPUStylingPipelineStage"};cbe.process=function(e,t,n){let i=e.model,r=e.shaderBuilder;r.addVertexLines(fV),r.addFragmentLines(dV),r.addDefine("USE_CPU_STYLING",void 0,de.BOTH),l(i.color)||(r.addUniform("float",Cx.COLOR_BLEND_UNIFORM_NAME,de.FRAGMENT),e.uniformMap[Cx.COLOR_BLEND_UNIFORM_NAME]=function(){return Ul.getColorBlend(i.colorBlendMode,i.colorBlendAmount)}),r.addUniform("bool","model_commandTranslucent",de.BOTH),e.uniformMap.model_commandTranslucent=function(){return e.alphaOptions.pass===Ie.TRANSLUCENT}};var hV=cbe;var mZ={MODIFY_MATERIAL:"MODIFY_MATERIAL",REPLACE_MATERIAL:"REPLACE_MATERIAL"};mZ.getDefineName=function(e){return`CUSTOM_SHADER_${e}`};Object.freeze(mZ);var Py=mZ;var mV=`void customShaderStage( inout czm_modelVertexOutput vsOutput, inout ProcessedAttributes attributes, FeatureIds featureIds, @@ -8641,7 +8638,7 @@ vsInput.metadataStatistics = metadataStatistics; vertexMain(vsInput, vsOutput); attributes.positionMC = vsOutput.positionMC; } -`;var bz=`void customShaderStage( +`;var pV=`void customShaderStage( inout czm_modelMaterial material, ProcessedAttributes attributes, FeatureIds featureIds, @@ -8657,17 +8654,17 @@ fsInput.metadataClass = metadataClass; fsInput.metadataStatistics = metadataStatistics; fragmentMain(fsInput, material); } -`;var xz=`void featureIdStage(out FeatureIds featureIds, ProcessedAttributes attributes) { +`;var gV=`void featureIdStage(out FeatureIds featureIds, ProcessedAttributes attributes) { initializeFeatureIds(featureIds, attributes); initializeFeatureIdAliases(featureIds); } -`;var Tz=`void featureIdStage(out FeatureIds featureIds, ProcessedAttributes attributes) +`;var _V=`void featureIdStage(out FeatureIds featureIds, ProcessedAttributes attributes) { initializeFeatureIds(featureIds, attributes); initializeFeatureIdAliases(featureIds); setFeatureIdVaryings(); } -`;var cr={name:"FeatureIdPipelineStage",STRUCT_ID_FEATURE_IDS_VS:"FeatureIdsVS",STRUCT_ID_FEATURE_IDS_FS:"FeatureIdsFS",STRUCT_NAME_FEATURE_IDS:"FeatureIds",FUNCTION_ID_INITIALIZE_FEATURE_IDS_VS:"initializeFeatureIdsVS",FUNCTION_ID_INITIALIZE_FEATURE_IDS_FS:"initializeFeatureIdsFS",FUNCTION_ID_INITIALIZE_FEATURE_ID_ALIASES_VS:"initializeFeatureIdAliasesVS",FUNCTION_ID_INITIALIZE_FEATURE_ID_ALIASES_FS:"initializeFeatureIdAliasesFS",FUNCTION_SIGNATURE_INITIALIZE_FEATURE_IDS:"void initializeFeatureIds(out FeatureIds featureIds, ProcessedAttributes attributes)",FUNCTION_SIGNATURE_INITIALIZE_FEATURE_ID_ALIASES:"void initializeFeatureIdAliases(inout FeatureIds featureIds)",FUNCTION_ID_SET_FEATURE_ID_VARYINGS:"setFeatureIdVaryings",FUNCTION_SIGNATURE_SET_FEATURE_ID_VARYINGS:"void setFeatureIdVaryings()"};cr.process=function(e,t,n){let i=e.shaderBuilder;Rnt(i);let r=e.runtimeNode.node.instances;l(r)&&Ont(e,r,n),Mnt(e,t,n),i.addVertexLines(Tz),i.addFragmentLines(xz)};function Rnt(e){e.addStruct(cr.STRUCT_ID_FEATURE_IDS_VS,cr.STRUCT_NAME_FEATURE_IDS,de.VERTEX),e.addStruct(cr.STRUCT_ID_FEATURE_IDS_FS,cr.STRUCT_NAME_FEATURE_IDS,de.FRAGMENT),e.addFunction(cr.FUNCTION_ID_INITIALIZE_FEATURE_IDS_VS,cr.FUNCTION_SIGNATURE_INITIALIZE_FEATURE_IDS,de.VERTEX),e.addFunction(cr.FUNCTION_ID_INITIALIZE_FEATURE_IDS_FS,cr.FUNCTION_SIGNATURE_INITIALIZE_FEATURE_IDS,de.FRAGMENT),e.addFunction(cr.FUNCTION_ID_INITIALIZE_FEATURE_ID_ALIASES_VS,cr.FUNCTION_SIGNATURE_INITIALIZE_FEATURE_ID_ALIASES,de.VERTEX),e.addFunction(cr.FUNCTION_ID_INITIALIZE_FEATURE_ID_ALIASES_FS,cr.FUNCTION_SIGNATURE_INITIALIZE_FEATURE_ID_ALIASES,de.FRAGMENT),e.addFunction(cr.FUNCTION_ID_SET_FEATURE_ID_VARYINGS,cr.FUNCTION_SIGNATURE_SET_FEATURE_ID_VARYINGS,de.VERTEX)}function Ont(e,t,n){let i=t.featureIds,r=t.attributes[0].count;for(let o=0;o<i.length;o++){let s=i[o],a=s.positionalLabel;s instanceof vn.FeatureIdAttribute?Nnt(e,s,a):Gge(e,s,a,r,1,n);let c=s.label;l(c)&&Wge(e,a,c,de.BOTH)}}function Mnt(e,t,n){let i=t.featureIds,o=xt.getAttributeBySemantic(t,ct.POSITION).count;for(let s=0;s<i.length;s++){let a=i[s],c=a.positionalLabel,u=de.BOTH;a instanceof vn.FeatureIdAttribute?Lnt(e,a,c):a instanceof vn.FeatureIdImplicitRange?Gge(e,a,c,o,void 0,n):(Fnt(e,a,c,s,n),u=de.FRAGMENT);let f=a.label;l(f)&&Wge(e,c,f,u)}}function Nnt(e,t,n){let i=e.shaderBuilder;i.addStructField(cr.STRUCT_ID_FEATURE_IDS_VS,"int",n),i.addStructField(cr.STRUCT_ID_FEATURE_IDS_FS,"int",n);let r=t.setIndex,o=n.replace(/_\d+$/,"_"),s=`a_${o}${r}`,a=`v_${o}${r}`,c=`featureIds.${n} = int(czm_round(${s}));`,u=`featureIds.${n} = int(czm_round(${a}));`;i.addFunctionLines(cr.FUNCTION_ID_INITIALIZE_FEATURE_IDS_VS,[c]),i.addFunctionLines(cr.FUNCTION_ID_INITIALIZE_FEATURE_IDS_FS,[u]),i.addVarying("float",a),i.addFunctionLines(cr.FUNCTION_ID_SET_FEATURE_ID_VARYINGS,[`${a} = ${s};`])}function Lnt(e,t,n){let i=e.shaderBuilder;i.addStructField(cr.STRUCT_ID_FEATURE_IDS_VS,"int",n),i.addStructField(cr.STRUCT_ID_FEATURE_IDS_FS,"int",n);let r=t.setIndex,o=n.replace(/_\d+$/,"_"),s=[`featureIds.${n} = int(czm_round(attributes.${o}${r}));`];i.addFunctionLines(cr.FUNCTION_ID_INITIALIZE_FEATURE_IDS_VS,s),i.addFunctionLines(cr.FUNCTION_ID_INITIALIZE_FEATURE_IDS_FS,s)}function Gge(e,t,n,i,r,o){Bnt(e,t,i,r,o);let s=e.shaderBuilder,a=`a_implicit_${n}`;s.addAttribute("float",a);let c=`v_implicit_${n}`;s.addVarying("float",c),s.addStructField(cr.STRUCT_ID_FEATURE_IDS_VS,"int",n),s.addStructField(cr.STRUCT_ID_FEATURE_IDS_FS,"int",n),s.addFunctionLines(cr.FUNCTION_ID_SET_FEATURE_ID_VARYINGS,[`${c} = ${a};`]),s.addFunctionLines(cr.FUNCTION_ID_INITIALIZE_FEATURE_IDS_VS,[`featureIds.${n} = int(czm_round(${a}));`]),s.addFunctionLines(cr.FUNCTION_ID_INITIALIZE_FEATURE_IDS_FS,[`featureIds.${n} = int(czm_round(${c}));`])}function Fnt(e,t,n,i,r){let o=`u_featureIdTexture_${i}`,s=e.uniformMap,a=t.textureReader;s[o]=function(){return a.texture??r.context.defaultTexture};let c=a.channels,u=e.shaderBuilder;u.addStructField(cr.STRUCT_ID_FEATURE_IDS_FS,"int",n),u.addUniform("sampler2D",o,de.FRAGMENT);let d=`v_texCoord_${a.texCoord}`,p=d,g=a.transform;if(l(g)&&!$.equals(g,$.IDENTITY)){let A=`${o}Transform`;u.addUniform("mat3",A,de.FRAGMENT),s[A]=function(){return g},p=`vec2(${A} * vec3(${d}, 1.0))`}let m=`texture(${o}, ${p}).${c}`,y=`featureIds.${n} = czm_unpackUint(${m});`;u.addFunctionLines(cr.FUNCTION_ID_INITIALIZE_FEATURE_IDS_FS,[y])}function Wge(e,t,n,i){let r=e.shaderBuilder,o=de.includesVertexShader(i);o&&r.addStructField(cr.STRUCT_ID_FEATURE_IDS_VS,"int",n),r.addStructField(cr.STRUCT_ID_FEATURE_IDS_FS,"int",n);let s=[`featureIds.${n} = featureIds.${t};`];o&&r.addFunctionLines(cr.FUNCTION_ID_INITIALIZE_FEATURE_ID_ALIASES_VS,s),r.addFunctionLines(cr.FUNCTION_ID_INITIALIZE_FEATURE_ID_ALIASES_FS,s)}function Bnt(e,t,n,i,r){let o=e.model,s,a;if(l(t.repeat)){let u=knt(t,n);s=tt.createVertexBuffer({context:r.context,typedArray:u,usage:Me.STATIC_DRAW}),s.vertexArrayDestroyable=!1,o._pipelineResources.push(s),o.statistics.addBuffer(s,!1)}else a=[t.offset];let c={index:e.attributeIndex++,instanceDivisor:i,value:a,vertexBuffer:s,normalize:!1,componentsPerAttribute:1,componentDatatype:Y.FLOAT,strideInBytes:Y.getSizeInBytes(Y.FLOAT),offsetInBytes:0};e.attributes.push(c)}function knt(e,t){let n=e.offset,i=e.repeat,r=new Float32Array(t);for(let o=0;o<t;o++)r[o]=n+Math.floor(o/i);return r}var hx=cr;var Ez=`void metadataStage( +`;var ur={name:"FeatureIdPipelineStage",STRUCT_ID_FEATURE_IDS_VS:"FeatureIdsVS",STRUCT_ID_FEATURE_IDS_FS:"FeatureIdsFS",STRUCT_NAME_FEATURE_IDS:"FeatureIds",FUNCTION_ID_INITIALIZE_FEATURE_IDS_VS:"initializeFeatureIdsVS",FUNCTION_ID_INITIALIZE_FEATURE_IDS_FS:"initializeFeatureIdsFS",FUNCTION_ID_INITIALIZE_FEATURE_ID_ALIASES_VS:"initializeFeatureIdAliasesVS",FUNCTION_ID_INITIALIZE_FEATURE_ID_ALIASES_FS:"initializeFeatureIdAliasesFS",FUNCTION_SIGNATURE_INITIALIZE_FEATURE_IDS:"void initializeFeatureIds(out FeatureIds featureIds, ProcessedAttributes attributes)",FUNCTION_SIGNATURE_INITIALIZE_FEATURE_ID_ALIASES:"void initializeFeatureIdAliases(inout FeatureIds featureIds)",FUNCTION_ID_SET_FEATURE_ID_VARYINGS:"setFeatureIdVaryings",FUNCTION_SIGNATURE_SET_FEATURE_ID_VARYINGS:"void setFeatureIdVaryings()"};ur.process=function(e,t,n){let i=e.shaderBuilder;Ast(i);let r=e.runtimeNode.node.instances;l(r)&&bst(e,r,n),xst(e,t,n),i.addVertexLines(_V),i.addFragmentLines(gV)};function Ast(e){e.addStruct(ur.STRUCT_ID_FEATURE_IDS_VS,ur.STRUCT_NAME_FEATURE_IDS,de.VERTEX),e.addStruct(ur.STRUCT_ID_FEATURE_IDS_FS,ur.STRUCT_NAME_FEATURE_IDS,de.FRAGMENT),e.addFunction(ur.FUNCTION_ID_INITIALIZE_FEATURE_IDS_VS,ur.FUNCTION_SIGNATURE_INITIALIZE_FEATURE_IDS,de.VERTEX),e.addFunction(ur.FUNCTION_ID_INITIALIZE_FEATURE_IDS_FS,ur.FUNCTION_SIGNATURE_INITIALIZE_FEATURE_IDS,de.FRAGMENT),e.addFunction(ur.FUNCTION_ID_INITIALIZE_FEATURE_ID_ALIASES_VS,ur.FUNCTION_SIGNATURE_INITIALIZE_FEATURE_ID_ALIASES,de.VERTEX),e.addFunction(ur.FUNCTION_ID_INITIALIZE_FEATURE_ID_ALIASES_FS,ur.FUNCTION_SIGNATURE_INITIALIZE_FEATURE_ID_ALIASES,de.FRAGMENT),e.addFunction(ur.FUNCTION_ID_SET_FEATURE_ID_VARYINGS,ur.FUNCTION_SIGNATURE_SET_FEATURE_ID_VARYINGS,de.VERTEX)}function bst(e,t,n){let i=t.featureIds,r=t.attributes[0].count;for(let o=0;o<i.length;o++){let s=i[o],a=s.positionalLabel;s instanceof vn.FeatureIdAttribute?Tst(e,s,a):lbe(e,s,a,r,1,n);let c=s.label;l(c)&&ube(e,a,c,de.BOTH)}}function xst(e,t,n){let i=t.featureIds,o=xt.getAttributeBySemantic(t,ct.POSITION).count;for(let s=0;s<i.length;s++){let a=i[s],c=a.positionalLabel,u=de.BOTH;a instanceof vn.FeatureIdAttribute?Est(e,a,c):a instanceof vn.FeatureIdImplicitRange?lbe(e,a,c,o,void 0,n):(Cst(e,a,c,s,n),u=de.FRAGMENT);let f=a.label;l(f)&&ube(e,c,f,u)}}function Tst(e,t,n){let i=e.shaderBuilder;i.addStructField(ur.STRUCT_ID_FEATURE_IDS_VS,"int",n),i.addStructField(ur.STRUCT_ID_FEATURE_IDS_FS,"int",n);let r=t.setIndex,o=n.replace(/_\d+$/,"_"),s=`a_${o}${r}`,a=`v_${o}${r}`,c=`featureIds.${n} = int(czm_round(${s}));`,u=`featureIds.${n} = int(czm_round(${a}));`;i.addFunctionLines(ur.FUNCTION_ID_INITIALIZE_FEATURE_IDS_VS,[c]),i.addFunctionLines(ur.FUNCTION_ID_INITIALIZE_FEATURE_IDS_FS,[u]),i.addVarying("float",a),i.addFunctionLines(ur.FUNCTION_ID_SET_FEATURE_ID_VARYINGS,[`${a} = ${s};`])}function Est(e,t,n){let i=e.shaderBuilder;i.addStructField(ur.STRUCT_ID_FEATURE_IDS_VS,"int",n),i.addStructField(ur.STRUCT_ID_FEATURE_IDS_FS,"int",n);let r=t.setIndex,o=n.replace(/_\d+$/,"_"),s=[`featureIds.${n} = int(czm_round(attributes.${o}${r}));`];i.addFunctionLines(ur.FUNCTION_ID_INITIALIZE_FEATURE_IDS_VS,s),i.addFunctionLines(ur.FUNCTION_ID_INITIALIZE_FEATURE_IDS_FS,s)}function lbe(e,t,n,i,r,o){vst(e,t,i,r,o);let s=e.shaderBuilder,a=`a_implicit_${n}`;s.addAttribute("float",a);let c=`v_implicit_${n}`;s.addVarying("float",c),s.addStructField(ur.STRUCT_ID_FEATURE_IDS_VS,"int",n),s.addStructField(ur.STRUCT_ID_FEATURE_IDS_FS,"int",n),s.addFunctionLines(ur.FUNCTION_ID_SET_FEATURE_ID_VARYINGS,[`${c} = ${a};`]),s.addFunctionLines(ur.FUNCTION_ID_INITIALIZE_FEATURE_IDS_VS,[`featureIds.${n} = int(czm_round(${a}));`]),s.addFunctionLines(ur.FUNCTION_ID_INITIALIZE_FEATURE_IDS_FS,[`featureIds.${n} = int(czm_round(${c}));`])}function Cst(e,t,n,i,r){let o=`u_featureIdTexture_${i}`,s=e.uniformMap,a=t.textureReader;s[o]=function(){return a.texture??r.context.defaultTexture};let c=a.channels,u=e.shaderBuilder;u.addStructField(ur.STRUCT_ID_FEATURE_IDS_FS,"int",n),u.addUniform("sampler2D",o,de.FRAGMENT);let d=`v_texCoord_${a.texCoord}`,p=d,g=a.transform;if(l(g)&&!$.equals(g,$.IDENTITY)){let A=`${o}Transform`;u.addUniform("mat3",A,de.FRAGMENT),s[A]=function(){return g},p=`vec2(${A} * vec3(${d}, 1.0))`}let m=`texture(${o}, ${p}).${c}`,y=`featureIds.${n} = czm_unpackUint(${m});`;u.addFunctionLines(ur.FUNCTION_ID_INITIALIZE_FEATURE_IDS_FS,[y])}function ube(e,t,n,i){let r=e.shaderBuilder,o=de.includesVertexShader(i);o&&r.addStructField(ur.STRUCT_ID_FEATURE_IDS_VS,"int",n),r.addStructField(ur.STRUCT_ID_FEATURE_IDS_FS,"int",n);let s=[`featureIds.${n} = featureIds.${t};`];o&&r.addFunctionLines(ur.FUNCTION_ID_INITIALIZE_FEATURE_ID_ALIASES_VS,s),r.addFunctionLines(ur.FUNCTION_ID_INITIALIZE_FEATURE_ID_ALIASES_FS,s)}function vst(e,t,n,i,r){let o=e.model,s,a;if(l(t.repeat)){let u=Sst(t,n);s=tt.createVertexBuffer({context:r.context,typedArray:u,usage:Me.STATIC_DRAW}),s.vertexArrayDestroyable=!1,o._pipelineResources.push(s),o.statistics.addBuffer(s,!1)}else a=[t.offset];let c={index:e.attributeIndex++,instanceDivisor:i,value:a,vertexBuffer:s,normalize:!1,componentsPerAttribute:1,componentDatatype:Y.FLOAT,strideInBytes:Y.getSizeInBytes(Y.FLOAT),offsetInBytes:0};e.attributes.push(c)}function Sst(e,t){let n=e.offset,i=e.repeat,r=new Float32Array(t);for(let o=0;o<t;o++)r[o]=n+Math.floor(o/i);return r}var vx=ur;var yV=`void metadataStage( FeatureIds featureIds, out Metadata metadata, out MetadataClass metadataClass, @@ -8677,7 +8674,7 @@ ProcessedAttributes attributes { initializeMetadata(featureIds, metadata, metadataClass, metadataStatistics, attributes); } -`;var Cz=`void metadataStage( +`;var AV=`void metadataStage( FeatureIds featureIds, out Metadata metadata, out MetadataClass metadataClass, @@ -8688,7 +8685,7 @@ ProcessedAttributes attributes initializeMetadata(featureIds, metadata, metadataClass, metadataStatistics, attributes); setMetadataVaryings(); } -`;var Ii={name:"MetadataPipelineStage",STRUCT_ID_METADATA_VS:"MetadataVS",STRUCT_ID_METADATA_FS:"MetadataFS",STRUCT_NAME_METADATA:"Metadata",STRUCT_ID_METADATA_CLASS_VS:"MetadataClassVS",STRUCT_ID_METADATA_CLASS_FS:"MetadataClassFS",STRUCT_NAME_METADATA_CLASS:"MetadataClass",STRUCT_ID_METADATA_STATISTICS_VS:"MetadataStatisticsVS",STRUCT_ID_METADATA_STATISTICS_FS:"MetadataStatisticsFS",STRUCT_NAME_METADATA_STATISTICS:"MetadataStatistics",FUNCTION_ID_INITIALIZE_METADATA_VS:"initializeMetadataVS",FUNCTION_ID_INITIALIZE_METADATA_FS:"initializeMetadataFS",FUNCTION_SIGNATURE_INITIALIZE_METADATA:"void initializeMetadata(FeatureIds featureIds, out Metadata metadata, out MetadataClass metadataClass, out MetadataStatistics metadataStatistics, ProcessedAttributes attributes)",FUNCTION_ID_SET_METADATA_VARYINGS:"setMetadataVaryings",FUNCTION_SIGNATURE_SET_METADATA_VARYINGS:"void setMetadataVaryings()",METADATA_CLASS_FIELDS:[{specName:"noData",shaderName:"noData"},{specName:"default",shaderName:"defaultValue"},{specName:"min",shaderName:"minValue"},{specName:"max",shaderName:"maxValue"}],METADATA_STATISTICS_FIELDS:[{specName:"min",shaderName:"minValue"},{specName:"max",shaderName:"maxValue"},{specName:"mean",shaderName:"mean",type:"float"},{specName:"median",shaderName:"median"},{specName:"standardDeviation",shaderName:"standardDeviation",type:"float"},{specName:"variance",shaderName:"variance",type:"float"},{specName:"sum",shaderName:"sum"}]};Ii.process=function(e,t,n){let{shaderBuilder:i,model:r}=e,{structuralMetadata:o={},content:s}=r,a=s?.tileset.metadataExtension?.statistics,c=n.context.webgl2,u=iit(r,t),f=Unt(o.propertyAttributes,t,a),d=Vnt(o.propertyTextures,a),p=Gnt(o.propertyTables,t,e,a,u),g=f.concat(d).concat(p);Ynt(i,g),$nt(i),i.addVertexLines(Cz),i.addFragmentLines(Ez);for(let m=0;m<f.length;m++){let y=f[m];Jnt(e,y)}for(let m=0;m<d.length;m++){let y=d[m];Qnt(e,y,c)}for(let m=0;m<p.length;m++){let y=p[m];tit(e,y,c)}};function Unt(e,t,n){return l(e)?e.flatMap(i=>znt(i,t,n)):[]}function znt(e,t,n){let{getAttributeByName:i,getAttributeInfo:r,sanitizeGlslIdentifier:o}=xt,s=e.class.id,a=n?.classes[s],c=Object.entries(e.properties),u=new Array(c.length);for(let f=0;f<c.length;f++){let[d,p]=c[f],g=i(t,p.attribute),{glslType:m,variableName:y}=r(g);u[f]={metadataVariable:o(d),property:p,classProperty:p.classProperty,type:p.classProperty.type,glslType:m,variableName:y,propertyStatistics:a?.properties[d],shaderDestination:de.BOTH}}return u}function Vnt(e,t){return l(e)?e.flatMap(n=>jnt(n,t)):[]}function jnt(e,t){let{sanitizeGlslIdentifier:n}=xt,i=e.class.id,r=t?.classes[i],o=Object.entries(e.properties).filter(([a,c])=>{let u=c.textureReader.channels.length;return c.classProperty.isGpuCompatible(u)}),s=new Array(o.length);for(let a=0;a<o.length;a++){let[c,u]=o[a];s[a]={metadataVariable:n(c),property:u,classProperty:u.classProperty,type:u.classProperty.type,glslType:u.classProperty.getGlslType(),propertyStatistics:r?.properties[c],shaderDestination:de.FRAGMENT}}return s}var Hnt=4;function Gnt(e,t,n,i,r){if(!l(e))return[];let o=qnt(n,t);return e.filter(s=>l(s.class)&&o.has(String(s.id))).flatMap(s=>Wnt(s,o,i,r))}function Wnt(e,t,n,i){let{sanitizeGlslIdentifier:r}=xt,o=e.class,s=n?.classes[o.id],a=t.get(String(e.id))??{},c=a.shaderDestination??de.BOTH,u=e.properties,f=o.properties,d=[],p=0;for(let[g,m]of Object.entries(f)){if(!m.isGpuCompatible(Hnt))continue;let y=u[g],A=de.intersection(sit(g,i),c);if(A===de.NONE){p++;continue}d.push({metadataVariable:r(g),property:y,classProperty:m,type:m.type,glslType:m.getGlslType(),propertyStatistics:s?.properties[g],shaderDestination:A,propertyTable:e,featureIdVariableName:a.variableName,propertyInfoIndex:p}),p++}return d}function qnt(e,t){let n=new Map;function i(a,c){let u=a?.propertyTableId;if(!l(u))return;let f=String(u),d={variableName:a.positionalLabel,shaderDestination:c},p=n.get(f);l(p)&&console.warn(`Multiple feature ID sets reference the same property table ${u} in primitive. Only one will be used.`),n.set(f,d)}let r=t?.featureIds??[];for(let a=0;a<r.length;a++){let c=r[a],u=l(c?.textureReader);i(c,u?de.FRAGMENT:de.BOTH)}let s=e.runtimeNode?.node?.instances?.featureIds??[];for(let a=0;a<s.length;a++){let c=s[a];i(c,de.BOTH)}return n}function Ynt(e,t){let n=new Set,i=new Set;for(let a=0;a<t.length;a++){let{type:c,glslType:u,propertyStatistics:f}=t[a];n.add(u),l(f)&&c!==bt.ENUM&&i.add(u)}let r=Ii.METADATA_CLASS_FIELDS;for(let a of n){let c=`${a}MetadataClass`;s(c,a,r)}let o=Ii.METADATA_STATISTICS_FIELDS;for(let a of i){let c=`${a}MetadataStatistics`;s(c,a,o)}function s(a,c,u){e.addStruct(a,a,de.BOTH);for(let f=0;f<u.length;f++){let{shaderName:d}=u[f],p=u[f].type==="float"?Knt(c):c;e.addStructField(a,p,d)}}}var Xnt={int:"float",ivec2:"vec2",ivec3:"vec3",ivec4:"vec4"};function Knt(e){let t=Xnt[e];return l(t)?t:e}function $nt(e){e.addStruct(Ii.STRUCT_ID_METADATA_VS,Ii.STRUCT_NAME_METADATA,de.VERTEX),e.addStruct(Ii.STRUCT_ID_METADATA_FS,Ii.STRUCT_NAME_METADATA,de.FRAGMENT),e.addStruct(Ii.STRUCT_ID_METADATA_CLASS_VS,Ii.STRUCT_NAME_METADATA_CLASS,de.VERTEX),e.addStruct(Ii.STRUCT_ID_METADATA_CLASS_FS,Ii.STRUCT_NAME_METADATA_CLASS,de.FRAGMENT),e.addStruct(Ii.STRUCT_ID_METADATA_STATISTICS_VS,Ii.STRUCT_NAME_METADATA_STATISTICS,de.VERTEX),e.addStruct(Ii.STRUCT_ID_METADATA_STATISTICS_FS,Ii.STRUCT_NAME_METADATA_STATISTICS,de.FRAGMENT),e.addFunction(Ii.FUNCTION_ID_INITIALIZE_METADATA_VS,Ii.FUNCTION_SIGNATURE_INITIALIZE_METADATA,de.VERTEX),e.addFunction(Ii.FUNCTION_ID_INITIALIZE_METADATA_FS,Ii.FUNCTION_SIGNATURE_INITIALIZE_METADATA,de.FRAGMENT),e.addFunction(Ii.FUNCTION_ID_SET_METADATA_VARYINGS,Ii.FUNCTION_SIGNATURE_SET_METADATA_VARYINGS,de.VERTEX)}function Jnt(e,t){Znt(e,t),vJ(e.shaderBuilder,t),SJ(e.shaderBuilder,t)}function Znt(e,t){let{shaderBuilder:n}=e,{metadataVariable:i,property:r,glslType:o}=t,s=wJ({valueExpression:`attributes.${t.variableName}`,renderResources:e,glslType:o,metadataVariable:i,shaderDestination:de.BOTH,property:r});n.addStructField(Ii.STRUCT_ID_METADATA_VS,o,i),n.addStructField(Ii.STRUCT_ID_METADATA_FS,o,i);let a=`metadata.${i} = ${s};`;n.addFunctionLines(Ii.FUNCTION_ID_INITIALIZE_METADATA_VS,[a]),n.addFunctionLines(Ii.FUNCTION_ID_INITIALIZE_METADATA_FS,[a])}function Qnt(e,t,n){eit(e,t,n),vJ(e.shaderBuilder,t),SJ(e.shaderBuilder,t)}function eit(e,t,n){let{shaderBuilder:i,uniformMap:r}=e,{metadataVariable:o,glslType:s,property:a}=t,{texCoord:c,channels:u,index:f,texture:d,transform:p}=a.textureReader,g=`u_propertyTexture_${f}`,m=[];r.hasOwnProperty(g)||(i.addUniform("sampler2D",g,de.FRAGMENT),r[g]=()=>d),i.addStructField(Ii.STRUCT_ID_METADATA_FS,s,o);let y=`attributes.texCoord_${c}`,A=y;if(l(p)&&!$.equals(p,$.IDENTITY)){let S=`${g}Transform`;i.addUniform("mat3",S,de.FRAGMENT),r[S]=function(){return p},A=`vec2(${S} * vec3(${y}, 1.0))`}let b=`texture(${g}, ${A}).${u}`,x=a.classProperty,T;n?T=x.unpackTextureInShader(b,u,o,m):T=x.unpackTextureInShaderWebGL1(b);let E=wJ({valueExpression:T,renderResources:e,glslType:s,metadataVariable:o,shaderDestination:de.FRAGMENT,property:a}),v=`metadata.${o} = ${E};`;m.push(v),i.addFunctionLines(Ii.FUNCTION_ID_INITIALIZE_METADATA_FS,m)}function vJ(e,t){let n=t.classProperty,{metadataVariable:i,glslType:r,shaderDestination:o}=t,s=qge(Ii.METADATA_CLASS_FIELDS,n,`metadataClass.${i}`,r),a=`${r}MetadataClass`;e.addStructField(Ii.STRUCT_ID_METADATA_CLASS_FS,a,i),e.addFunctionLines(Ii.FUNCTION_ID_INITIALIZE_METADATA_FS,s),de.includesVertexShader(o)&&(e.addStructField(Ii.STRUCT_ID_METADATA_CLASS_VS,a,i),e.addFunctionLines(Ii.FUNCTION_ID_INITIALIZE_METADATA_VS,s))}function SJ(e,t){let{propertyStatistics:n}=t;if(!l(n))return;let{metadataVariable:i,type:r,glslType:o}=t;if(r===bt.ENUM)return;let s=Ii.METADATA_STATISTICS_FIELDS,a=`metadataStatistics.${i}`,c=qge(s,n,a,o),u=`${o}MetadataStatistics`;e.addStructField(Ii.STRUCT_ID_METADATA_STATISTICS_FS,u,i),e.addFunctionLines(Ii.FUNCTION_ID_INITIALIZE_METADATA_FS,c),de.includesVertexShader(t.shaderDestination)&&(e.addStructField(Ii.STRUCT_ID_METADATA_STATISTICS_VS,u,i),e.addFunctionLines(Ii.FUNCTION_ID_INITIALIZE_METADATA_VS,c))}function tit(e,t,n){nit(e,t,n),vJ(e.shaderBuilder,t),SJ(e.shaderBuilder,t)}function nit(e,t,n){let{shaderBuilder:i,uniformMap:r}=e,{metadataVariable:o,glslType:s,property:a,featureIdVariableName:c,propertyTable:u,propertyInfoIndex:f}=t;if(!n){yt("PropertyTableCustomShader","Property table support for custom shaders requires WebGL2.");return}if(!l(c)||!l(u.texture))return;let d=`u_propertyTableTexture_${u.id}`,p=[];r.hasOwnProperty(d)||(i.addUniform("sampler2D",d,de.BOTH),r[d]=()=>u.texture);let g=t.shaderDestination;de.includesVertexShader(g)&&i.addStructField(Ii.STRUCT_ID_METADATA_VS,s,o),de.includesFragmentShader(g)&&i.addStructField(Ii.STRUCT_ID_METADATA_FS,s,o);let y=`ivec2(${`featureIds.${c}`}, ${f})`,A=`texelFetch(${d}, ${y}, 0)`,b=t.classProperty,x=b.unpackTextureInShader(A,"rgba",o,p),T=wJ({valueExpression:x,renderResources:e,glslType:s,metadataVariable:o,shaderDestination:g,property:a??b}),E=`metadata.${o} = ${T};`;p.push(E),de.includesVertexShader(g)&&i.addFunctionLines(Ii.FUNCTION_ID_INITIALIZE_METADATA_VS,p),de.includesFragmentShader(g)&&i.addFunctionLines(Ii.FUNCTION_ID_INITIALIZE_METADATA_FS,p)}function qge(e,t,n,i){function r(o){let s=t[o.specName];if(l(s))return`${n}.${o.shaderName} = ${i}(${s});`}return l(t)?e.map(r).filter(l):[]}function wJ(e){let{valueExpression:t,property:n}=e;if(!n.hasValueTransform)return t;let i=e.metadataVariable,r=`u_${i}_offset`,o=`u_${i}_scale`,{shaderBuilder:s,uniformMap:a}=e.renderResources,{glslType:c,shaderDestination:u}=e;s.addUniform(c,r,u),s.addUniform(c,o,u);let{offset:f,scale:d}=n;return a[r]=()=>f,a[o]=()=>d,`czm_valueTransform(${r}, ${o}, ${t})`}function iit(e,t){let n=new Set,i=new Set;return rit(e,n,i),oit(e,t,n,i),{usedInVertex:n,usedInFragment:i}}function rit(e,t,n){let i=e.customShader;if(!l(i))return;let r=i.usedVariablesFragment?.metadataSet??{};for(let s in r)r.hasOwnProperty(s)&&n.add(s);let o=i.usedVariablesVertex?.metadataSet??{};for(let s in o)o.hasOwnProperty(s)&&t.add(s)}function oit(e,t,n,i){let r=e.style;if(!(l(r)&&t.primitiveType===Oe.POINTS))return;let s=r.color?.getVariables?.()??[];for(let u of s)n.add(u),i.add(u);let a=r.show?.getVariables?.()??[];for(let u of a)n.add(u),i.add(u);let c=r.pointSize?.getVariables?.()??[];for(let u of c)n.add(u)}function sit(e,t){let n=t.usedInFragment.has(e)?de.FRAGMENT:de.NONE,i=t.usedInVertex.has(e)?de.VERTEX:de.NONE;return de.union(n,i)}var Mh=Ii;var Yge={INHERIT:0,OPAQUE:1,TRANSLUCENT:2};Object.freeze(Yge);var mx=Yge;var Ma={name:"CustomShaderPipelineStage",STRUCT_ID_ATTRIBUTES_VS:"AttributesVS",STRUCT_ID_ATTRIBUTES_FS:"AttributesFS",STRUCT_NAME_ATTRIBUTES:"Attributes",STRUCT_ID_VERTEX_INPUT:"VertexInput",STRUCT_NAME_VERTEX_INPUT:"VertexInput",STRUCT_ID_FRAGMENT_INPUT:"FragmentInput",STRUCT_NAME_FRAGMENT_INPUT:"FragmentInput",FUNCTION_ID_INITIALIZE_INPUT_STRUCT_VS:"initializeInputStructVS",FUNCTION_SIGNATURE_INITIALIZE_INPUT_STRUCT_VS:"void initializeInputStruct(out VertexInput vsInput, ProcessedAttributes attributes)",FUNCTION_ID_INITIALIZE_INPUT_STRUCT_FS:"initializeInputStructFS",FUNCTION_SIGNATURE_INITIALIZE_INPUT_STRUCT_FS:"void initializeInputStruct(out FragmentInput fsInput, ProcessedAttributes attributes)",_oneTimeWarning:yt};Ma.process=function(e,t,n){let{shaderBuilder:i,model:r,alphaOptions:o}=e,{customShader:s}=r,{lightingModel:a,translucencyMode:c}=s;l(a)&&(e.lightingOptions.lightingModel=a),c===mx.TRANSLUCENT?o.pass=Ie.TRANSLUCENT:c===mx.OPAQUE&&(o.pass=void 0);let u=mit(s,t,e);if(!u.customShaderEnabled)return;if(yit(i,s,u),u.shouldComputePositionWC&&i.addDefine("COMPUTE_POSITION_WC_CUSTOM_SHADER",void 0,de.BOTH),l(s.vertexShaderText)&&i.addDefine("HAS_CUSTOM_VERTEX_SHADER",void 0,de.VERTEX),l(s.fragmentShaderText)){i.addDefine("HAS_CUSTOM_FRAGMENT_SHADER",void 0,de.FRAGMENT);let p=Iy.getDefineName(s.mode);i.addDefine(p,void 0,de.FRAGMENT)}let f=s.uniforms;for(let p in f)if(f.hasOwnProperty(p)){let g=f[p];i.addUniform(g.type,p)}let d=s.varyings;for(let p in d)if(d.hasOwnProperty(p)){let g=d[p];i.addVarying(g,p)}e.uniformMap=Mt(e.uniformMap,s.uniformMap)};function ait(e){let t={};for(let n=0;n<e.length;n++){let i=xt.getAttributeInfo(e[n]);t[i.variableName]=i}return t}var cit={position:"vec3",normal:"vec3",tangent:"vec3",bitangent:"vec3",texCoord:"vec2",color:"vec4",joints:"ivec4",weights:"vec4"},lit={position:"vec3(0.0)",normal:"vec3(0.0, 0.0, 1.0)",tangent:"vec3(1.0, 0.0, 0.0)",bitangent:"vec3(0.0, 1.0, 0.0)",texCoord:"vec2(0.0)",color:"vec4(1.0)",joints:"ivec4(0)",weights:"vec4(0.0)"};function Xge(e){let t=e.replace(/_[0-9]+$/,"");t=t.replace(/(MC|EC)$/,"");let n=cit[t],i=lit[t];if(l(n))return{attributeField:[n,e],value:i}}function uit(e,t,n){if(!l(e.vertexShaderText))return{enabled:!1};let i=e.usedVariablesVertex;if(!Jge(i.metadataSet,n))return{enabled:!1};let r=i.attributeSet,o=Kge(t,r,!1),s=$ge(t,r,!1),a,c=[],u=[];for(let f in o){if(!o.hasOwnProperty(f))continue;let p=[o[f].glslType,f];c.push(p),a=`vsInput.attributes.${f} = attributes.${f};`,u.push(a)}for(let f=0;f<s.length;f++){let d=s[f],p=Xge(d);if(!l(p))return Ma._oneTimeWarning("CustomShaderPipelineStage.incompatiblePrimitiveVS",`Primitive is missing attribute ${d}, disabling custom vertex shader`),{enabled:!1};c.push(p.attributeField),a=`vsInput.attributes.${d} = ${p.value};`,u.push(a)}return{enabled:!0,attributeFields:c,initializationLines:u}}function fit(e){let t=[],n=[],i=e.usedVariablesFragment.attributeSet;return i.hasOwnProperty("positionWC")&&(t.push(["vec3","positionWC"]),n.push("fsInput.attributes.positionWC = attributes.positionWC;")),i.hasOwnProperty("positionEC")&&(t.push(["vec3","positionEC"]),n.push("fsInput.attributes.positionEC = attributes.positionEC;")),{attributeFields:t,initializationLines:n}}function dit(e,t,n){if(!l(e.fragmentShaderText))return{enabled:!1};let i=e.usedVariablesFragment;if(!Jge(i.metadataSet,n))return{enabled:!1};let r=i.attributeSet,o=Kge(t,r,!0),s=$ge(t,r,!0),a,c=[],u=[];for(let d in o){if(!o.hasOwnProperty(d))continue;let g=[o[d].glslType,d];c.push(g),a=`fsInput.attributes.${d} = attributes.${d};`,u.push(a)}for(let d=0;d<s.length;d++){let p=s[d],g=Xge(p);if(!l(g))return Ma._oneTimeWarning("CustomShaderPipelineStage.incompatiblePrimitiveFS",`Primitive is missing attribute ${p}, disabling custom fragment shader.`),{enabled:!1};c.push(g.attributeField),a=`fsInput.attributes.${p} = ${g.value};`,u.push(a)}let f=fit(e);return{enabled:!0,attributeFields:c.concat(f.attributeFields),initializationLines:f.initializationLines.concat(u)}}var hit={positionWC:!0,positionEC:!0};function Kge(e,t,n){let i={};for(let r in e){if(!e.hasOwnProperty(r))continue;let o=e[r],s=r;n&&r==="normalMC"?s="normalEC":n&&r==="tangentMC"&&(s="tangentEC",o.glslType="vec3"),t.hasOwnProperty(s)&&(i[s]=o)}return i}function $ge(e,t,n){let i=[];for(let r in t){if(!t.hasOwnProperty(r)||hit.hasOwnProperty(r))continue;let o=r;n&&r==="normalEC"?o="normalMC":n&&r==="tangentEC"&&(o="tangentMC"),e.hasOwnProperty(o)||i.push(r)}return i}function mit(e,t,n){let i=ait(t.attributes),r=Ait(t,n.model.structuralMetadata),o=uit(e,i,r),s=dit(e,i,r),c=e.usedVariablesFragment.attributeSet.hasOwnProperty("positionWC")&&s.enabled;return{vertexLines:o,fragmentLines:s,customShaderEnabled:o.enabled||s.enabled,shouldComputePositionWC:c}}function pit(e,t){let n=Ma.STRUCT_ID_ATTRIBUTES_VS;e.addStruct(n,Ma.STRUCT_NAME_ATTRIBUTES,de.VERTEX);let{attributeFields:i,initializationLines:r}=t;for(let s=0;s<i.length;s++){let[a,c]=i[s];e.addStructField(n,a,c)}n=Ma.STRUCT_ID_VERTEX_INPUT,e.addStruct(n,Ma.STRUCT_NAME_VERTEX_INPUT,de.VERTEX),e.addStructField(n,Ma.STRUCT_NAME_ATTRIBUTES,"attributes"),e.addStructField(n,hx.STRUCT_NAME_FEATURE_IDS,"featureIds"),e.addStructField(n,Mh.STRUCT_NAME_METADATA,"metadata"),e.addStructField(n,Mh.STRUCT_NAME_METADATA_CLASS,"metadataClass"),e.addStructField(n,Mh.STRUCT_NAME_METADATA_STATISTICS,"metadataStatistics");let o=Ma.FUNCTION_ID_INITIALIZE_INPUT_STRUCT_VS;e.addFunction(o,Ma.FUNCTION_SIGNATURE_INITIALIZE_INPUT_STRUCT_VS,de.VERTEX),e.addFunctionLines(o,r)}function git(e,t){let n=Ma.STRUCT_ID_ATTRIBUTES_FS;e.addStruct(n,Ma.STRUCT_NAME_ATTRIBUTES,de.FRAGMENT);let{attributeFields:i,initializationLines:r}=t;for(let s=0;s<i.length;s++){let[a,c]=i[s];e.addStructField(n,a,c)}n=Ma.STRUCT_ID_FRAGMENT_INPUT,e.addStruct(n,Ma.STRUCT_NAME_FRAGMENT_INPUT,de.FRAGMENT),e.addStructField(n,Ma.STRUCT_NAME_ATTRIBUTES,"attributes"),e.addStructField(n,hx.STRUCT_NAME_FEATURE_IDS,"featureIds"),e.addStructField(n,Mh.STRUCT_NAME_METADATA,"metadata"),e.addStructField(n,Mh.STRUCT_NAME_METADATA_CLASS,"metadataClass"),e.addStructField(n,Mh.STRUCT_NAME_METADATA_STATISTICS,"metadataStatistics");let o=Ma.FUNCTION_ID_INITIALIZE_INPUT_STRUCT_FS;e.addFunction(o,Ma.FUNCTION_SIGNATURE_INITIALIZE_INPUT_STRUCT_FS,de.FRAGMENT),e.addFunctionLines(o,r)}var _it=[];function yit(e,t,n){let{vertexLines:i,fragmentLines:r}=n,o=_it;i.enabled&&(pit(e,i),o.length=0,o.push("#line 0",t.vertexShaderText,Az),e.addVertexLines(o)),r.enabled&&(git(e,r),o.length=0,o.push("#line 0",t.fragmentShaderText,bz),e.addFragmentLines(o))}function Ait(e,t){if(!l(t))return new Set;let n=e.propertyTextureIds,i=e.propertyAttributeIds,r=l(e.featureIds)?e.featureIds.map(a=>a.propertyTableId):[],o=new Set;function s(a,c){for(let u of a){let d=c[u].class.properties;Object.keys(d).forEach(p=>o.add(p))}}return s(n,t.propertyTextures),s(i,t.propertyAttributes),s(r,t.propertyTables),o}function Jge(e,t){for(let n in e)if(e.hasOwnProperty(n)&&!t.has(n))return Ma._oneTimeWarning("CustomShaderPipelineStage.checkMetadataCompatibility",`A custom shader uses metadata property "${n}" which is not present for all primitives in the tileset. Disabling the custom shader for these primitives.`),!1;return!0}var vz=Ma;var VD={name:"DequantizationPipelineStage",FUNCTION_ID_DEQUANTIZATION_STAGE_VS:"dequantizationStage",FUNCTION_SIGNATURE_DEQUANTIZATION_STAGE_VS:"void dequantizationStage(inout ProcessedAttributes attributes)"};VD.process=function(e,t,n){let i=e.shaderBuilder,r=e.model,o=l(r.classificationType);i.addDefine("USE_DEQUANTIZATION",void 0,de.VERTEX),i.addFunction(VD.FUNCTION_ID_DEQUANTIZATION_STAGE_VS,VD.FUNCTION_SIGNATURE_DEQUANTIZATION_STAGE_VS,de.VERTEX);let s=t.attributes;for(let a=0;a<s.length;a++){let c=s[a],u=c.quantization;if(!l(u))continue;let f=c.semantic===ct.POSITION,d=c.semantic===ct.TEXCOORD;if(o&&!f&&!d)continue;let p=xt.getAttributeInfo(c);xit(i,p),bit(e,p)}};function bit(e,t){let n=e.shaderBuilder,i=e.uniformMap,r=t.variableName,o=t.attribute.quantization;if(o.octEncoded){let s=`model_normalizationRange_${r}`;n.addUniform("float",s,de.VERTEX),i[s]=function(){return o.normalizationRange}}else{let s=`model_quantizedVolumeOffset_${r}`,a=`model_quantizedVolumeStepSize_${r}`,c=t.glslType;n.addUniform(c,s,de.VERTEX),n.addUniform(c,a,de.VERTEX);let u=o.quantizedVolumeOffset,f=o.quantizedVolumeStepSize;/^color_\d+$/.test(r)&&(u=Zge(u,0),f=Zge(f,1)),i[s]=function(){return u},i[a]=function(){return f}}}function Zge(e,t){return e instanceof se?e:new se(e.x,e.y,e.z,t)}function xit(e,t){let n=t.variableName,i=t.attribute.quantization,r;i.octEncoded?r=Tit(n,i):r=Eit(n),e.addFunctionLines(VD.FUNCTION_ID_DEQUANTIZATION_STAGE_VS,[r])}function Tit(e,t){let n=`attributes.${e}`,i=`a_quantized_${e}`,r=`model_normalizationRange_${e}`,o=t.octEncodedZXY?".zxy":".xyz";return`${n} = czm_octDecode(${i}, ${r})${o};`}function Eit(e){let t=`attributes.${e}`,n=`a_quantized_${e}`,i=`model_quantizedVolumeOffset_${e}`,r=`model_quantizedVolumeStepSize_${e}`;return`${t} = ${i} + ${n} * ${r};`}var Sz=VD;var wz=`void edgeDetectionStage(inout vec4 color, inout FeatureIds featureIds) { +`;var Ii={name:"MetadataPipelineStage",STRUCT_ID_METADATA_VS:"MetadataVS",STRUCT_ID_METADATA_FS:"MetadataFS",STRUCT_NAME_METADATA:"Metadata",STRUCT_ID_METADATA_CLASS_VS:"MetadataClassVS",STRUCT_ID_METADATA_CLASS_FS:"MetadataClassFS",STRUCT_NAME_METADATA_CLASS:"MetadataClass",STRUCT_ID_METADATA_STATISTICS_VS:"MetadataStatisticsVS",STRUCT_ID_METADATA_STATISTICS_FS:"MetadataStatisticsFS",STRUCT_NAME_METADATA_STATISTICS:"MetadataStatistics",FUNCTION_ID_INITIALIZE_METADATA_VS:"initializeMetadataVS",FUNCTION_ID_INITIALIZE_METADATA_FS:"initializeMetadataFS",FUNCTION_SIGNATURE_INITIALIZE_METADATA:"void initializeMetadata(FeatureIds featureIds, out Metadata metadata, out MetadataClass metadataClass, out MetadataStatistics metadataStatistics, ProcessedAttributes attributes)",FUNCTION_ID_SET_METADATA_VARYINGS:"setMetadataVaryings",FUNCTION_SIGNATURE_SET_METADATA_VARYINGS:"void setMetadataVaryings()",METADATA_CLASS_FIELDS:[{specName:"noData",shaderName:"noData"},{specName:"default",shaderName:"defaultValue"},{specName:"min",shaderName:"minValue"},{specName:"max",shaderName:"maxValue"}],METADATA_STATISTICS_FIELDS:[{specName:"min",shaderName:"minValue"},{specName:"max",shaderName:"maxValue"},{specName:"mean",shaderName:"mean",type:"float"},{specName:"median",shaderName:"median"},{specName:"standardDeviation",shaderName:"standardDeviation",type:"float"},{specName:"variance",shaderName:"variance",type:"float"},{specName:"sum",shaderName:"sum"}]};Ii.process=function(e,t,n){let{shaderBuilder:i,model:r}=e,{structuralMetadata:o={},content:s}=r,a=s?.tileset.metadataExtension?.statistics,c=n.context.webgl2,u=Wst(r,t),f=wst(o.propertyAttributes,t,a),d=Pst(o.propertyTextures,a),p=Ost(o.propertyTables,t,e,a,u),g=f.concat(d).concat(p);Lst(i,g),kst(i),i.addVertexLines(AV),i.addFragmentLines(yV);for(let m=0;m<f.length;m++){let y=f[m];Ust(e,y)}for(let m=0;m<d.length;m++){let y=d[m];Vst(e,y,c)}for(let m=0;m<p.length;m++){let y=p[m];Hst(e,y,c)}};function wst(e,t,n){return l(e)?e.flatMap(i=>Ist(i,t,n)):[]}function Ist(e,t,n){let{getAttributeByName:i,getAttributeInfo:r,sanitizeGlslIdentifier:o}=xt,s=e.class.id,a=n?.classes[s],c=Object.entries(e.properties),u=new Array(c.length);for(let f=0;f<c.length;f++){let[d,p]=c[f],g=i(t,p.attribute),{glslType:m,variableName:y}=r(g);u[f]={metadataVariable:o(d),property:p,classProperty:p.classProperty,type:p.classProperty.type,glslType:m,variableName:y,propertyStatistics:a?.properties[d],shaderDestination:de.BOTH}}return u}function Pst(e,t){return l(e)?e.flatMap(n=>Dst(n,t)):[]}function Dst(e,t){let{sanitizeGlslIdentifier:n}=xt,i=e.class.id,r=t?.classes[i],o=Object.entries(e.properties).filter(([a,c])=>{let u=c.textureReader.channels.length;return c.classProperty.isGpuCompatible(u)}),s=new Array(o.length);for(let a=0;a<o.length;a++){let[c,u]=o[a];s[a]={metadataVariable:n(c),property:u,classProperty:u.classProperty,type:u.classProperty.type,glslType:u.classProperty.getGlslType(),propertyStatistics:r?.properties[c],shaderDestination:de.FRAGMENT}}return s}var Rst=4;function Ost(e,t,n,i,r){if(!l(e))return[];let o=Nst(n,t);return e.filter(s=>l(s.class)&&o.has(String(s.id))).flatMap(s=>Mst(s,o,i,r))}function Mst(e,t,n,i){let{sanitizeGlslIdentifier:r}=xt,o=e.class,s=n?.classes[o.id],a=t.get(String(e.id))??{},c=a.shaderDestination??de.BOTH,u=e.properties,f=o.properties,d=[],p=0;for(let[g,m]of Object.entries(f)){if(!m.isGpuCompatible(Rst))continue;let y=u[g],A=de.intersection(Xst(g,i),c);if(A===de.NONE){p++;continue}d.push({metadataVariable:r(g),property:y,classProperty:m,type:m.type,glslType:m.getGlslType(),propertyStatistics:s?.properties[g],shaderDestination:A,propertyTable:e,featureIdVariableName:a.variableName,propertyInfoIndex:p}),p++}return d}function Nst(e,t){let n=new Map;function i(a,c){let u=a?.propertyTableId;if(!l(u))return;let f=String(u),d={variableName:a.positionalLabel,shaderDestination:c},p=n.get(f);l(p)&&console.warn(`Multiple feature ID sets reference the same property table ${u} in primitive. Only one will be used.`),n.set(f,d)}let r=t?.featureIds??[];for(let a=0;a<r.length;a++){let c=r[a],u=l(c?.textureReader);i(c,u?de.FRAGMENT:de.BOTH)}let s=e.runtimeNode?.node?.instances?.featureIds??[];for(let a=0;a<s.length;a++){let c=s[a];i(c,de.BOTH)}return n}function Lst(e,t){let n=new Set,i=new Set;for(let a=0;a<t.length;a++){let{type:c,glslType:u,propertyStatistics:f}=t[a];n.add(u),l(f)&&c!==bt.ENUM&&i.add(u)}let r=Ii.METADATA_CLASS_FIELDS;for(let a of n){let c=`${a}MetadataClass`;s(c,a,r)}let o=Ii.METADATA_STATISTICS_FIELDS;for(let a of i){let c=`${a}MetadataStatistics`;s(c,a,o)}function s(a,c,u){e.addStruct(a,a,de.BOTH);for(let f=0;f<u.length;f++){let{shaderName:d}=u[f],p=u[f].type==="float"?Bst(c):c;e.addStructField(a,p,d)}}}var Fst={int:"float",ivec2:"vec2",ivec3:"vec3",ivec4:"vec4"};function Bst(e){let t=Fst[e];return l(t)?t:e}function kst(e){e.addStruct(Ii.STRUCT_ID_METADATA_VS,Ii.STRUCT_NAME_METADATA,de.VERTEX),e.addStruct(Ii.STRUCT_ID_METADATA_FS,Ii.STRUCT_NAME_METADATA,de.FRAGMENT),e.addStruct(Ii.STRUCT_ID_METADATA_CLASS_VS,Ii.STRUCT_NAME_METADATA_CLASS,de.VERTEX),e.addStruct(Ii.STRUCT_ID_METADATA_CLASS_FS,Ii.STRUCT_NAME_METADATA_CLASS,de.FRAGMENT),e.addStruct(Ii.STRUCT_ID_METADATA_STATISTICS_VS,Ii.STRUCT_NAME_METADATA_STATISTICS,de.VERTEX),e.addStruct(Ii.STRUCT_ID_METADATA_STATISTICS_FS,Ii.STRUCT_NAME_METADATA_STATISTICS,de.FRAGMENT),e.addFunction(Ii.FUNCTION_ID_INITIALIZE_METADATA_VS,Ii.FUNCTION_SIGNATURE_INITIALIZE_METADATA,de.VERTEX),e.addFunction(Ii.FUNCTION_ID_INITIALIZE_METADATA_FS,Ii.FUNCTION_SIGNATURE_INITIALIZE_METADATA,de.FRAGMENT),e.addFunction(Ii.FUNCTION_ID_SET_METADATA_VARYINGS,Ii.FUNCTION_SIGNATURE_SET_METADATA_VARYINGS,de.VERTEX)}function Ust(e,t){zst(e,t),pZ(e.shaderBuilder,t),gZ(e.shaderBuilder,t)}function zst(e,t){let{shaderBuilder:n}=e,{metadataVariable:i,property:r,glslType:o}=t,s=_Z({valueExpression:`attributes.${t.variableName}`,renderResources:e,glslType:o,metadataVariable:i,shaderDestination:de.BOTH,property:r});n.addStructField(Ii.STRUCT_ID_METADATA_VS,o,i),n.addStructField(Ii.STRUCT_ID_METADATA_FS,o,i);let a=`metadata.${i} = ${s};`;n.addFunctionLines(Ii.FUNCTION_ID_INITIALIZE_METADATA_VS,[a]),n.addFunctionLines(Ii.FUNCTION_ID_INITIALIZE_METADATA_FS,[a])}function Vst(e,t,n){jst(e,t,n),pZ(e.shaderBuilder,t),gZ(e.shaderBuilder,t)}function jst(e,t,n){let{shaderBuilder:i,uniformMap:r}=e,{metadataVariable:o,glslType:s,property:a}=t,{texCoord:c,channels:u,index:f,texture:d,transform:p}=a.textureReader,g=`u_propertyTexture_${f}`,m=[];r.hasOwnProperty(g)||(i.addUniform("sampler2D",g,de.FRAGMENT),r[g]=()=>d),i.addStructField(Ii.STRUCT_ID_METADATA_FS,s,o);let y=`attributes.texCoord_${c}`,A=y;if(l(p)&&!$.equals(p,$.IDENTITY)){let S=`${g}Transform`;i.addUniform("mat3",S,de.FRAGMENT),r[S]=function(){return p},A=`vec2(${S} * vec3(${y}, 1.0))`}let b=`texture(${g}, ${A}).${u}`,x=a.classProperty,T;n?T=x.unpackTextureInShader(b,u,o,m):T=x.unpackTextureInShaderWebGL1(b);let E=_Z({valueExpression:T,renderResources:e,glslType:s,metadataVariable:o,shaderDestination:de.FRAGMENT,property:a}),v=`metadata.${o} = ${E};`;m.push(v),i.addFunctionLines(Ii.FUNCTION_ID_INITIALIZE_METADATA_FS,m)}function pZ(e,t){let n=t.classProperty,{metadataVariable:i,glslType:r,shaderDestination:o}=t,s=fbe(Ii.METADATA_CLASS_FIELDS,n,`metadataClass.${i}`,r),a=`${r}MetadataClass`;e.addStructField(Ii.STRUCT_ID_METADATA_CLASS_FS,a,i),e.addFunctionLines(Ii.FUNCTION_ID_INITIALIZE_METADATA_FS,s),de.includesVertexShader(o)&&(e.addStructField(Ii.STRUCT_ID_METADATA_CLASS_VS,a,i),e.addFunctionLines(Ii.FUNCTION_ID_INITIALIZE_METADATA_VS,s))}function gZ(e,t){let{propertyStatistics:n}=t;if(!l(n))return;let{metadataVariable:i,type:r,glslType:o}=t;if(r===bt.ENUM)return;let s=Ii.METADATA_STATISTICS_FIELDS,a=`metadataStatistics.${i}`,c=fbe(s,n,a,o),u=`${o}MetadataStatistics`;e.addStructField(Ii.STRUCT_ID_METADATA_STATISTICS_FS,u,i),e.addFunctionLines(Ii.FUNCTION_ID_INITIALIZE_METADATA_FS,c),de.includesVertexShader(t.shaderDestination)&&(e.addStructField(Ii.STRUCT_ID_METADATA_STATISTICS_VS,u,i),e.addFunctionLines(Ii.FUNCTION_ID_INITIALIZE_METADATA_VS,c))}function Hst(e,t,n){Gst(e,t,n),pZ(e.shaderBuilder,t),gZ(e.shaderBuilder,t)}function Gst(e,t,n){let{shaderBuilder:i,uniformMap:r}=e,{metadataVariable:o,glslType:s,property:a,featureIdVariableName:c,propertyTable:u,propertyInfoIndex:f}=t;if(!n){yt("PropertyTableCustomShader","Property table support for custom shaders requires WebGL2.");return}if(!l(c)||!l(u.texture))return;let d=`u_propertyTableTexture_${u.id}`,p=[];r.hasOwnProperty(d)||(i.addUniform("sampler2D",d,de.BOTH),r[d]=()=>u.texture);let g=t.shaderDestination;de.includesVertexShader(g)&&i.addStructField(Ii.STRUCT_ID_METADATA_VS,s,o),de.includesFragmentShader(g)&&i.addStructField(Ii.STRUCT_ID_METADATA_FS,s,o);let y=`ivec2(${`featureIds.${c}`}, ${f})`,A=`texelFetch(${d}, ${y}, 0)`,b=t.classProperty,x=b.unpackTextureInShader(A,"rgba",o,p),T=_Z({valueExpression:x,renderResources:e,glslType:s,metadataVariable:o,shaderDestination:g,property:a??b}),E=`metadata.${o} = ${T};`;p.push(E),de.includesVertexShader(g)&&i.addFunctionLines(Ii.FUNCTION_ID_INITIALIZE_METADATA_VS,p),de.includesFragmentShader(g)&&i.addFunctionLines(Ii.FUNCTION_ID_INITIALIZE_METADATA_FS,p)}function fbe(e,t,n,i){function r(o){let s=t[o.specName];if(l(s))return`${n}.${o.shaderName} = ${i}(${s});`}return l(t)?e.map(r).filter(l):[]}function _Z(e){let{valueExpression:t,property:n}=e;if(!n.hasValueTransform)return t;let i=e.metadataVariable,r=`u_${i}_offset`,o=`u_${i}_scale`,{shaderBuilder:s,uniformMap:a}=e.renderResources,{glslType:c,shaderDestination:u}=e;s.addUniform(c,r,u),s.addUniform(c,o,u);let{offset:f,scale:d}=n;return a[r]=()=>f,a[o]=()=>d,`czm_valueTransform(${r}, ${o}, ${t})`}function Wst(e,t){let n=new Set,i=new Set;return qst(e,n,i),Yst(e,t,n,i),{usedInVertex:n,usedInFragment:i}}function qst(e,t,n){let i=e.customShader;if(!l(i))return;let r=i.usedVariablesFragment?.metadataSet??{};for(let s in r)r.hasOwnProperty(s)&&n.add(s);let o=i.usedVariablesVertex?.metadataSet??{};for(let s in o)o.hasOwnProperty(s)&&t.add(s)}function Yst(e,t,n,i){let r=e.style;if(!(l(r)&&t.primitiveType===Oe.POINTS))return;let s=r.color?.getVariables?.()??[];for(let u of s)n.add(u),i.add(u);let a=r.show?.getVariables?.()??[];for(let u of a)n.add(u),i.add(u);let c=r.pointSize?.getVariables?.()??[];for(let u of c)n.add(u)}function Xst(e,t){let n=t.usedInFragment.has(e)?de.FRAGMENT:de.NONE,i=t.usedInVertex.has(e)?de.VERTEX:de.NONE;return de.union(n,i)}var Gh=Ii;var dbe={INHERIT:0,OPAQUE:1,TRANSLUCENT:2};Object.freeze(dbe);var Sx=dbe;var Na={name:"CustomShaderPipelineStage",STRUCT_ID_ATTRIBUTES_VS:"AttributesVS",STRUCT_ID_ATTRIBUTES_FS:"AttributesFS",STRUCT_NAME_ATTRIBUTES:"Attributes",STRUCT_ID_VERTEX_INPUT:"VertexInput",STRUCT_NAME_VERTEX_INPUT:"VertexInput",STRUCT_ID_FRAGMENT_INPUT:"FragmentInput",STRUCT_NAME_FRAGMENT_INPUT:"FragmentInput",FUNCTION_ID_INITIALIZE_INPUT_STRUCT_VS:"initializeInputStructVS",FUNCTION_SIGNATURE_INITIALIZE_INPUT_STRUCT_VS:"void initializeInputStruct(out VertexInput vsInput, ProcessedAttributes attributes)",FUNCTION_ID_INITIALIZE_INPUT_STRUCT_FS:"initializeInputStructFS",FUNCTION_SIGNATURE_INITIALIZE_INPUT_STRUCT_FS:"void initializeInputStruct(out FragmentInput fsInput, ProcessedAttributes attributes)",_oneTimeWarning:yt};Na.process=function(e,t,n){let{shaderBuilder:i,model:r,alphaOptions:o}=e,{customShader:s}=r,{lightingModel:a,translucencyMode:c}=s;l(a)&&(e.lightingOptions.lightingModel=a),c===Sx.TRANSLUCENT?o.pass=Ie.TRANSLUCENT:c===Sx.OPAQUE&&(o.pass=void 0);let u=nat(s,t,e);if(!u.customShaderEnabled)return;if(sat(i,s,u),u.shouldComputePositionWC&&i.addDefine("COMPUTE_POSITION_WC_CUSTOM_SHADER",void 0,de.BOTH),l(s.vertexShaderText)&&i.addDefine("HAS_CUSTOM_VERTEX_SHADER",void 0,de.VERTEX),l(s.fragmentShaderText)){i.addDefine("HAS_CUSTOM_FRAGMENT_SHADER",void 0,de.FRAGMENT);let p=Py.getDefineName(s.mode);i.addDefine(p,void 0,de.FRAGMENT)}let f=s.uniforms;for(let p in f)if(f.hasOwnProperty(p)){let g=f[p];i.addUniform(g.type,p)}let d=s.varyings;for(let p in d)if(d.hasOwnProperty(p)){let g=d[p];i.addVarying(g,p)}e.uniformMap=Mt(e.uniformMap,s.uniformMap)};function Kst(e){let t={};for(let n=0;n<e.length;n++){let i=xt.getAttributeInfo(e[n]);t[i.variableName]=i}return t}var $st={position:"vec3",normal:"vec3",tangent:"vec3",bitangent:"vec3",texCoord:"vec2",color:"vec4",joints:"ivec4",weights:"vec4"},Jst={position:"vec3(0.0)",normal:"vec3(0.0, 0.0, 1.0)",tangent:"vec3(1.0, 0.0, 0.0)",bitangent:"vec3(0.0, 1.0, 0.0)",texCoord:"vec2(0.0)",color:"vec4(1.0)",joints:"ivec4(0)",weights:"vec4(0.0)"};function hbe(e){let t=e.replace(/_[0-9]+$/,"");t=t.replace(/(MC|EC)$/,"");let n=$st[t],i=Jst[t];if(l(n))return{attributeField:[n,e],value:i}}function Zst(e,t,n){if(!l(e.vertexShaderText))return{enabled:!1};let i=e.usedVariablesVertex;if(!gbe(i.metadataSet,n))return{enabled:!1};let r=i.attributeSet,o=mbe(t,r,!1),s=pbe(t,r,!1),a,c=[],u=[];for(let f in o){if(!o.hasOwnProperty(f))continue;let p=[o[f].glslType,f];c.push(p),a=`vsInput.attributes.${f} = attributes.${f};`,u.push(a)}for(let f=0;f<s.length;f++){let d=s[f],p=hbe(d);if(!l(p))return Na._oneTimeWarning("CustomShaderPipelineStage.incompatiblePrimitiveVS",`Primitive is missing attribute ${d}, disabling custom vertex shader`),{enabled:!1};c.push(p.attributeField),a=`vsInput.attributes.${d} = ${p.value};`,u.push(a)}return{enabled:!0,attributeFields:c,initializationLines:u}}function Qst(e){let t=[],n=[],i=e.usedVariablesFragment.attributeSet;return i.hasOwnProperty("positionWC")&&(t.push(["vec3","positionWC"]),n.push("fsInput.attributes.positionWC = attributes.positionWC;")),i.hasOwnProperty("positionEC")&&(t.push(["vec3","positionEC"]),n.push("fsInput.attributes.positionEC = attributes.positionEC;")),{attributeFields:t,initializationLines:n}}function eat(e,t,n){if(!l(e.fragmentShaderText))return{enabled:!1};let i=e.usedVariablesFragment;if(!gbe(i.metadataSet,n))return{enabled:!1};let r=i.attributeSet,o=mbe(t,r,!0),s=pbe(t,r,!0),a,c=[],u=[];for(let d in o){if(!o.hasOwnProperty(d))continue;let g=[o[d].glslType,d];c.push(g),a=`fsInput.attributes.${d} = attributes.${d};`,u.push(a)}for(let d=0;d<s.length;d++){let p=s[d],g=hbe(p);if(!l(g))return Na._oneTimeWarning("CustomShaderPipelineStage.incompatiblePrimitiveFS",`Primitive is missing attribute ${p}, disabling custom fragment shader.`),{enabled:!1};c.push(g.attributeField),a=`fsInput.attributes.${p} = ${g.value};`,u.push(a)}let f=Qst(e);return{enabled:!0,attributeFields:c.concat(f.attributeFields),initializationLines:f.initializationLines.concat(u)}}var tat={positionWC:!0,positionEC:!0};function mbe(e,t,n){let i={};for(let r in e){if(!e.hasOwnProperty(r))continue;let o=e[r],s=r;n&&r==="normalMC"?s="normalEC":n&&r==="tangentMC"&&(s="tangentEC",o.glslType="vec3"),t.hasOwnProperty(s)&&(i[s]=o)}return i}function pbe(e,t,n){let i=[];for(let r in t){if(!t.hasOwnProperty(r)||tat.hasOwnProperty(r))continue;let o=r;n&&r==="normalEC"?o="normalMC":n&&r==="tangentEC"&&(o="tangentMC"),e.hasOwnProperty(o)||i.push(r)}return i}function nat(e,t,n){let i=Kst(t.attributes),r=aat(t,n.model.structuralMetadata),o=Zst(e,i,r),s=eat(e,i,r),c=e.usedVariablesFragment.attributeSet.hasOwnProperty("positionWC")&&s.enabled;return{vertexLines:o,fragmentLines:s,customShaderEnabled:o.enabled||s.enabled,shouldComputePositionWC:c}}function iat(e,t){let n=Na.STRUCT_ID_ATTRIBUTES_VS;e.addStruct(n,Na.STRUCT_NAME_ATTRIBUTES,de.VERTEX);let{attributeFields:i,initializationLines:r}=t;for(let s=0;s<i.length;s++){let[a,c]=i[s];e.addStructField(n,a,c)}n=Na.STRUCT_ID_VERTEX_INPUT,e.addStruct(n,Na.STRUCT_NAME_VERTEX_INPUT,de.VERTEX),e.addStructField(n,Na.STRUCT_NAME_ATTRIBUTES,"attributes"),e.addStructField(n,vx.STRUCT_NAME_FEATURE_IDS,"featureIds"),e.addStructField(n,Gh.STRUCT_NAME_METADATA,"metadata"),e.addStructField(n,Gh.STRUCT_NAME_METADATA_CLASS,"metadataClass"),e.addStructField(n,Gh.STRUCT_NAME_METADATA_STATISTICS,"metadataStatistics");let o=Na.FUNCTION_ID_INITIALIZE_INPUT_STRUCT_VS;e.addFunction(o,Na.FUNCTION_SIGNATURE_INITIALIZE_INPUT_STRUCT_VS,de.VERTEX),e.addFunctionLines(o,r)}function rat(e,t){let n=Na.STRUCT_ID_ATTRIBUTES_FS;e.addStruct(n,Na.STRUCT_NAME_ATTRIBUTES,de.FRAGMENT);let{attributeFields:i,initializationLines:r}=t;for(let s=0;s<i.length;s++){let[a,c]=i[s];e.addStructField(n,a,c)}n=Na.STRUCT_ID_FRAGMENT_INPUT,e.addStruct(n,Na.STRUCT_NAME_FRAGMENT_INPUT,de.FRAGMENT),e.addStructField(n,Na.STRUCT_NAME_ATTRIBUTES,"attributes"),e.addStructField(n,vx.STRUCT_NAME_FEATURE_IDS,"featureIds"),e.addStructField(n,Gh.STRUCT_NAME_METADATA,"metadata"),e.addStructField(n,Gh.STRUCT_NAME_METADATA_CLASS,"metadataClass"),e.addStructField(n,Gh.STRUCT_NAME_METADATA_STATISTICS,"metadataStatistics");let o=Na.FUNCTION_ID_INITIALIZE_INPUT_STRUCT_FS;e.addFunction(o,Na.FUNCTION_SIGNATURE_INITIALIZE_INPUT_STRUCT_FS,de.FRAGMENT),e.addFunctionLines(o,r)}var oat=[];function sat(e,t,n){let{vertexLines:i,fragmentLines:r}=n,o=oat;i.enabled&&(iat(e,i),o.length=0,o.push("#line 0",t.vertexShaderText,mV),e.addVertexLines(o)),r.enabled&&(rat(e,r),o.length=0,o.push("#line 0",t.fragmentShaderText,pV),e.addFragmentLines(o))}function aat(e,t){if(!l(t))return new Set;let n=e.propertyTextureIds,i=e.propertyAttributeIds,r=l(e.featureIds)?e.featureIds.map(a=>a.propertyTableId):[],o=new Set;function s(a,c){for(let u of a){let d=c[u].class.properties;Object.keys(d).forEach(p=>o.add(p))}}return s(n,t.propertyTextures),s(i,t.propertyAttributes),s(r,t.propertyTables),o}function gbe(e,t){for(let n in e)if(e.hasOwnProperty(n)&&!t.has(n))return Na._oneTimeWarning("CustomShaderPipelineStage.checkMetadataCompatibility",`A custom shader uses metadata property "${n}" which is not present for all primitives in the tileset. Disabling the custom shader for these primitives.`),!1;return!0}var bV=Na;var f1={name:"DequantizationPipelineStage",FUNCTION_ID_DEQUANTIZATION_STAGE_VS:"dequantizationStage",FUNCTION_SIGNATURE_DEQUANTIZATION_STAGE_VS:"void dequantizationStage(inout ProcessedAttributes attributes)"};f1.process=function(e,t,n){let i=e.shaderBuilder,r=e.model,o=l(r.classificationType);i.addDefine("USE_DEQUANTIZATION",void 0,de.VERTEX),i.addFunction(f1.FUNCTION_ID_DEQUANTIZATION_STAGE_VS,f1.FUNCTION_SIGNATURE_DEQUANTIZATION_STAGE_VS,de.VERTEX);let s=t.attributes;for(let a=0;a<s.length;a++){let c=s[a],u=c.quantization;if(!l(u))continue;let f=c.semantic===ct.POSITION,d=c.semantic===ct.TEXCOORD;if(o&&!f&&!d)continue;let p=xt.getAttributeInfo(c);lat(i,p),cat(e,p)}};function cat(e,t){let n=e.shaderBuilder,i=e.uniformMap,r=t.variableName,o=t.attribute.quantization;if(o.octEncoded){let s=`model_normalizationRange_${r}`;n.addUniform("float",s,de.VERTEX),i[s]=function(){return o.normalizationRange}}else{let s=`model_quantizedVolumeOffset_${r}`,a=`model_quantizedVolumeStepSize_${r}`,c=t.glslType;n.addUniform(c,s,de.VERTEX),n.addUniform(c,a,de.VERTEX);let u=o.quantizedVolumeOffset,f=o.quantizedVolumeStepSize;/^color_\d+$/.test(r)&&(u=_be(u,0),f=_be(f,1)),i[s]=function(){return u},i[a]=function(){return f}}}function _be(e,t){return e instanceof se?e:new se(e.x,e.y,e.z,t)}function lat(e,t){let n=t.variableName,i=t.attribute.quantization,r;i.octEncoded?r=uat(n,i):r=fat(n),e.addFunctionLines(f1.FUNCTION_ID_DEQUANTIZATION_STAGE_VS,[r])}function uat(e,t){let n=`attributes.${e}`,i=`a_quantized_${e}`,r=`model_normalizationRange_${e}`,o=t.octEncodedZXY?".zxy":".xyz";return`${n} = czm_octDecode(${i}, ${r})${o};`}function fat(e){let t=`attributes.${e}`,n=`a_quantized_${e}`,i=`model_quantizedVolumeOffset_${e}`,r=`model_quantizedVolumeStepSize_${e}`;return`${t} = ${i} + ${n} * ${r};`}var xV=f1;var TV=`void edgeDetectionStage(inout vec4 color, inout FeatureIds featureIds) { if (u_isEdgePass) { return; } @@ -8727,7 +8724,7 @@ color = edgeColor; } } } -`;var Qge={name:"EdgeDetectionPipelineStage"};Qge.process=function(e){e.shaderBuilder.addFragmentLines([wz])};var Iz=Qge;var Pz=`#if defined(HAS_EDGE_VISIBILITY_MRT) && !defined(CESIUM_REDIRECTED_COLOR_OUTPUT) +`;var ybe={name:"EdgeDetectionPipelineStage"};ybe.process=function(e){e.shaderBuilder.addFragmentLines([TV])};var EV=ybe;var CV=`#if defined(HAS_EDGE_VISIBILITY_MRT) && !defined(CESIUM_REDIRECTED_COLOR_OUTPUT) layout(location = 1) out vec4 out_id; layout(location = 2) out vec4 out_edgeDepth; #endif @@ -8774,7 +8771,7 @@ out_edgeDepth = czm_packDepth(gl_FragCoord.z); #endif #endif } -`;var Dz=`#ifdef HAS_EDGE_VISIBILITY +`;var vV=`#ifdef HAS_EDGE_VISIBILITY void edgeVisibilityStageVS() { if (!u_isEdgePass) { return; @@ -8845,7 +8842,7 @@ posClip.xy += offsetClip; gl_Position = posClip; } #endif -`;var IJ=class e{static readAttributeAsTypedArray(t){let n=e.readAttributeAsRawCompactTypedArray(t),i=t.normalized,r=t.quantization;if(!l(r)&&!i)return n;let o=t.type,s=t.count,a=n;return i&&(a=cn.dequantize(n,t.componentDatatype,o,s)),l(r)?e.dequantize(a,s,o,r):a}static readAttributeAsRawCompactTypedArray(t){let n=t.type,i=t.count,r=Vt.getNumberOfComponents(n),o=i*r,s=t.componentDatatype,a=t.quantization;l(a)&&(s=a.componentDatatype);let c=t.buffer,u=t.byteOffset,f=t.byteStride,d=Y.getSizeInBytes(s),p=r*d,g=!l(f)||f===p;if(l(t.typedArray))return t.typedArray;if(g){let v=Y.createTypedArray(s,o);return c.getBufferData(v,u),v}let y=new Uint8Array(c.sizeInBytes);c.getBufferData(y);let A=Y.createTypedArray(s,o),b=f??p,x=new DataView(y.buffer,y.byteOffset,y.byteLength),T=new Array(r),E=e.createComponentsReader(s);for(let v=0;v<i;++v){let S=u+v*b;E(x,S,r,T);for(let I=0;I<r;++I)A[v*r+I]=T[I]}return A}static dequantize(t,n,i,r){if(r.octEncoded){let a=e.octDecode(t,n,r.normalizationRange,void 0);return r.octEncodedZXY&&e.convertZxyToXyz(a,a),a}let o=r.quantizedVolumeStepSize,s=r.quantizedVolumeOffset;if(i===Vt.SCALAR)return e.dequantize1D(t,n,o,s,void 0);if(i===Vt.VEC2)return e.dequantize2D(t,n,o,s,void 0);if(i===Vt.VEC3)return e.dequantize3D(t,n,o,s,void 0);if(i===Vt.VEC4)return e.dequantize4D(t,n,o,s,void 0);throw new pe(`Element type for dequantization must be SCALAR, VEC2, VEC3, or VEC4, but is ${i}`)}static octDecode(t,n,i,r){l(r)||(r=new Float32Array(t.length));let o=new h;for(let s=0;s<n;s++)h.unpack(t,s*3,o),cn.octDecodeInRange(o.x,o.y,i,o),h.pack(o,r,s*3);return r}static convertZxyToXyz(t,n,i){l(i)||(i=new Float32Array(t.length));let r=0;for(let o=0;o<n;o++,r+=3){let s=t[r+0],a=t[r+1],c=t[r+2];i[r+0]=a,i[r+1]=c,i[r+2]=s}return i}static dequantize1D(t,n,i,r,o){l(o)||(o=new Float32Array(t.length));for(let s=0;s<n;s++){let c=t[s]*i+r;o[s]=c}return o}static dequantize2D(t,n,i,r,o){l(o)||(o=new Float32Array(t.length));let s=new U;for(let a=0;a<n;a++)U.unpack(t,a*2,s),U.multiplyComponents(s,i,s),U.add(s,r,s),U.pack(s,o,a*2);return o}static dequantize3D(t,n,i,r,o){l(o)||(o=new Float32Array(t.length));let s=new h;for(let a=0;a<n;a++)h.unpack(t,a*3,s),h.multiplyComponents(s,i,s),h.add(s,r,s),h.pack(s,o,a*3);return o}static dequantize4D(t,n,i,r,o){l(o)||(o=new Float32Array(t.length));let s=new se;for(let a=0;a<n;a++)se.unpack(t,a*4,s),se.multiplyComponents(s,i,s),se.add(s,r,s),se.pack(s,o,a*4);return o}static createComponentsReader(t){let n=e.createComponentReader(t),i=Y.getSizeInBytes(t);return function(r,o,s,a){let c=o;for(let u=0;u<s;++u)a[u]=n(r,c),c+=i}}static createComponentReader(t){switch(t){case Y.BYTE:return function(n,i){return n.getInt8(i)};case Y.UNSIGNED_BYTE:return function(n,i){return n.getUint8(i)};case Y.SHORT:return function(n,i){return n.getInt16(i,!0)};case Y.UNSIGNED_SHORT:return function(n,i){return n.getUint16(i,!0)};case Y.INT:return function(n,i){return n.getInt32(i,!0)};case Y.UNSIGNED_INT:return function(n,i){return n.getUint32(i,!0)};case Y.FLOAT:return function(n,i){return n.getFloat32(i,!0)};case Y.DOUBLE:return function(n,i){return n.getFloat64(i,!0)}}throw new pe(`The componentType must be a valid ComponentDatatype, but is ${t}`)}static transform3D(t,n,i){l(i)||(i=new Float32Array(t.length));let r=new h,o=t.length/3;for(let s=0;s<o;s++)h.unpack(t,s*3,r),M.multiplyByPoint(n,r,r),h.pack(r,i,s*3);return i}static readImplicitRangeAsTypedArray(t,n){let i=n.attributes[0]?.count??0,r=t.offset,o=t.repeat,s=new Float32Array(i);if(l(o))for(let a=0;a<i;a++)s[a]=r+Math.floor(a/o);else s.fill(r);return s}static readIndicesAsTypedArray(t){let n=t.typedArray;if(l(n))return n;let i=t.buffer,r=t.count,o=t.indexDatatype,s=e.createIndexTypedArray(o,r);return i.getBufferData(s),s}static readIndicesAsTriangleIndicesTypedArray(t,n){let i=e.readIndicesAsTypedArray(t);if(n===Oe.TRIANGLES)return i;if(n===Oe.TRIANGLE_STRIP)return e.convertTriangleStripToTriangleIndices(i);if(n===Oe.TRIANGLE_FAN)return e.convertTriangleFanToTriangleIndices(i);throw new pe(`The primitiveType must be TRIANGLES (${Oe.TRIANGLES}, TRIANGLE_STRIP (${Oe.TRIANGLE_STRIP}, or TRIANGLE_FAN (${Oe.TRIANGLE_FAN}, but is ${n}`)}static convertTriangleStripToTriangleIndices(t){let n=t.constructor((t.length-2)*3);for(let i=0;i<t.length-2;i++)i%2===1?(n[i*3+0]=t[i+0],n[i*3+1]=t[i+2],n[i*3+2]=t[i+1]):(n[i*3+0]=t[i+0],n[i*3+1]=t[i+1],n[i*3+2]=t[i+2]);return n}static convertTriangleFanToTriangleIndices(t){let n=t.constructor((t.length-2)*3);for(let i=0;i<t.length-2;i++)n[i*3+0]=t[i+0],n[i*3+1]=t[i+1],n[i*3+2]=t[i+2];return n}static createIndexTypedArray(t,n){switch(t){case je.UNSIGNED_BYTE:return new Uint8Array(n);case je.UNSIGNED_SHORT:return new Uint16Array(n);case je.UNSIGNED_INT:return new Uint32Array(n)}throw new pe(`The indexDatatype must be UNSIGNED_BYTE (${je.UNSIGNED_BYTE}, UNSIGNED_SHORT (${je.UNSIGNED_SHORT}, or UNSIGNED_INT (${je.UNSIGNED_INT}, but is ${t}`)}static forEachPrimitive(t,n,i){let r=n?.mapProjection,o=n?.instanceFeatureIdLabel,s=t.sceneGraph;if(!l(s))return;let a={nodeComputedTransform:new M,modelMatrix:new M,computedModelMatrix:new M},c=s._runtimeNodes,u=c.length;for(let f=0;f<u;f++){let d=c[f],p=e.computeNodeTransforms(d,s,t,a),g=p.computedModelMatrix;l(r)&&(g=At.basisTo2D(r,g,g));let m=e.computeInstanceTransforms(d,g,p.nodeComputedTransform,p.modelMatrix),y=l(o)?e.computeInstanceFeatureIds(d,o):void 0,A=[];for(let x=0;x<m.length;x++)A.push({transform:m[x],featureId:l(y)?y[x]:void 0});let b=d.runtimePrimitives.length;for(let x=0;x<b;x++){let T=d.runtimePrimitives[x];i(T,T.primitive,A,g)}}}static computeNodeTransforms(t,n,i,r){let o=t.node,s=M.clone(t.computedTransform,r.nodeComputedTransform),a=M.clone(n.computedModelMatrix,r.modelMatrix),c=o.instances;l(c)&&c.transformInWorldSpace&&(a=M.multiplyTransformation(i.modelMatrix,n.components.transform,a),s=M.multiplyTransformation(n.axisCorrectionMatrix,t.computedTransform,s));let u=M.multiplyTransformation(a,s,r.computedModelMatrix);return r.computedModelMatrix=u,r.nodeComputedTransform=s,r.modelMatrix=a,r}static computeInstanceTransforms(t,n,i,r){let o=[],a=t.node.instances;if(l(a)){let c=a.attributes[0].count,u=a.attributes[0].componentDatatype,f=12,d=t.transformsTypedArray;if(!l(d)){let p=t.instancingTransformsBuffer;l(p)&&(d=Y.createTypedArray(u,c*f),p.getBufferData(d))}l(d)?e.computeInstanceTransformsFromTypedArray(d,c,o):e.computeInstanceTransformsFromAttributes(a,c,o);for(let p=0;p<o.length;p++){let g=o[p];a.transformInWorldSpace?(M.multiplyTransformation(g,i,g),M.multiplyTransformation(r,g,g)):M.multiplyTransformation(n,g,g)}}return o.length===0&&o.push(n),o}static computeInstanceFeatureIds(t,n){let r=t.node.instances;if(!l(r))return;let o=xt.getFeatureIdsByLabel(r.featureIds,n);if(!l(o))return;let s;if("setIndex"in o){let c=xt.getAttributeBySemantic(r,ct.FEATURE_ID,o.setIndex);l(c)&&(s=e.readAttributeAsTypedArray(c))}if("offset"in o&&(s=e.readImplicitRangeAsTypedArray(o,r)),!l(s))return;let a=new Array(s.length);for(let c=0;c<s.length;c++)a[c]=s[c];return a}static computeInstanceTransformsFromTypedArray(t,n,i){for(let o=0;o<n;o++){let s=o*12,a=new M(t[s],t[s+1],t[s+2],t[s+3],t[s+4],t[s+5],t[s+6],t[s+7],t[s+8],t[s+9],t[s+10],t[s+11],0,0,0,1);i.push(a)}}static computeInstanceTransformsFromAttributes(t,n,i){let r=xt.getAttributeBySemantic(t,Fo.TRANSLATION),o=xt.getAttributeBySemantic(t,Fo.ROTATION),s=xt.getAttributeBySemantic(t,Fo.SCALE),a=l(r),c=l(o),u=l(s);if(!a&&!c&&!u)return;let f,d,p;a&&(f=e.readAttributeAsRawCompactTypedArray(r)),c&&(d=e.readAttributeAsRawCompactTypedArray(o)),u&&(p=e.readAttributeAsRawCompactTypedArray(s));for(let g=0;g<n;g++){let m=a?new h(f[g*3],f[g*3+1],f[g*3+2]):h.ZERO,y=c?new Le(d[g*4],d[g*4+1],d[g*4+2],d[g*4+3]):Le.IDENTITY,A=u?new h(p[g*3],p[g*3+1],p[g*3+2]):h.ONE,b=M.fromTranslationQuaternionRotationScale(m,y,A,new M);i.push(b)}}},Na=IJ;var mv=Object.freeze({HIDDEN:0,SILHOUETTE:1,HARD:2,REPEATED_HARD:3}),e_e={name:"EdgeVisibilityPipelineStage"};e_e.process=function(e,t,n){if(!l(t.edgeVisibility))return;n.edgeVisibilityRequested=!0;let i=e.shaderBuilder;i.addDefine("HAS_EDGE_VISIBILITY",void 0,de.BOTH),i.addDefine("HAS_EDGE_VISIBILITY_MRT",void 0,de.FRAGMENT),i.addFragmentLines(Pz),i.addVertexLines(Dz),i.addUniform("bool","u_isEdgePass",de.BOTH);let r=t.material,o=l(r)?r.lineStyle:void 0;(!l(o)||!l(o.width))&&i.addUniform("float","u_lineWidth",de.VERTEX);let s=i.addAttribute("float","a_edgeType");i.addVarying("float","v_edgeType","flat");let a=i.addAttribute("float","a_edgeFeatureId"),c=i.addAttribute("vec3","a_faceNormalA"),u=i.addAttribute("vec3","a_faceNormalB");i.addVarying("vec3","v_faceNormalAView","flat"),i.addVarying("vec3","v_faceNormalBView","flat"),i.addVarying("float","v_shouldDiscard","flat");let f=i.addAttribute("vec3","a_edgeOtherPos"),d=i.addAttribute("float","a_edgeOffset");i.addVarying("float","v_edgeOffset");let p=vit(t);if(!l(p)||!l(p.edgeIndices)||p.edgeIndices.length===0)return;let g=e.runtimePrimitive.primitive,m=Sit(g),A=p.edgeData.some(function(R){return l(R.color)})||l(m),b;A&&(b=i.addAttribute("vec4","a_edgeColor"),i.addVarying("vec4","v_edgeColor","flat"),i.addDefine("HAS_EDGE_COLOR_ATTRIBUTE",void 0,de.BOTH));let x,T,E=xt.getAttributeBySemantic(t,"BENTLEY_materials_line_style:CUMULATIVE_DISTANCE");l(E)&&(x=E,T=i.addAttribute("float","a_edgeCumulativeDistance"),i.addDefine("HAS_EDGE_CUMULATIVE_DISTANCE",void 0,de.VERTEX));let v=Cit(p.edgeIndices,p.edgeData,t.edgeVisibility),S=wit(p.edgeIndices,p.edgeData,e,n.context,s,c,u,a,b,f,d,m,t.edgeVisibility,v,x,T);if(!l(S))return;S.hasEdgeFeatureIds&&i.addDefine("HAS_EDGE_FEATURE_ID",void 0,de.BOTH),e.uniformMap.u_isEdgePass=function(){return!1},l(e.uniformMap.u_lineWidth)||(e.uniformMap.u_lineWidth=function(){return 1}),l(x)&&(l(e.uniformMap.u_pixelsPerWorld)||(e.uniformMap.u_pixelsPerWorld=function(){return 1}));let I=l(o)&&l(o.width)?o.width*n.pixelRatio:void 0;e.edgeGeometry={vertexArray:S.vertexArray,indexCount:S.indexCount,primitiveType:Oe.TRIANGLES,pass:Ie.CESIUM_3D_TILE_EDGES,lineWidth:I}};function Cit(e,t,n){let i=e.length/2,r=new Float32Array(i*6),o=n.silhouetteNormals;if(!l(o))return r;let s=o.length/3,a=new Float32Array(o.length),c=new h;for(let u=0;u<s;u++)c.x=o[u*3],c.y=o[u*3+1],c.z=o[u*3+2],h.magnitudeSquared(c)>0?h.normalize(c,c):(c.x=0,c.y=0,c.z=1),a[u*3]=c.x,a[u*3+1]=c.y,a[u*3+2]=c.z;for(let u=0;u<i;u++){let{edgeType:f,silhouetteEdgeIndex:d}=t[u];if(f!==mv.SILHOUETTE||d<0)continue;let p=d*2;if((p+1)*3+2>=a.length)continue;let g=p*3,m=(p+1)*3,y=u*6;r[y]=a[g],r[y+1]=a[g+1],r[y+2]=a[g+2],r[y+3]=a[m],r[y+4]=a[m+1],r[y+5]=a[m+2]}return r}function vit(e){let t=e.edgeVisibility;if(!l(t))return[];let n=t.visibility,i=e.indices,r=t.lineStrings,o=e.attributes,s=l(o)&&o.length>0?o[0].count:0,a=l(n)&&l(i)&&l(i.typedArray)&&i.typedArray.length>0,c=l(r)&&r.length>0;if(!a&&!c)return[];let u=a?i.typedArray:void 0,f=[],d=[],p=new Set,g=0,m=t.materialColor;if(a){let y=0,A=u.length,b=n;for(let x=0;x+2<A;x+=3){let T=u[x],E=u[x+1],v=u[x+2];for(let S=0;S<3;S++){let I,R;S===0?(I=T,R=E):S===1?(I=E,R=v):(I=v,R=T);let O=Math.floor(y/4),L=y%4*2;if(y++,O>=b.length)break;let C=b[O]>>L&3;if(C===mv.HIDDEN)continue;let w=Math.min(I,R),D=Math.max(I,R),N=`${w},${D}`;if(p.has(N))continue;p.add(N),f.push(I,R);let F=-1;C===mv.SILHOUETTE&&(F=g,g++),d.push({edgeType:C===mv.REPEATED_HARD?mv.HARD:C,silhouetteEdgeIndex:F,color:m})}}}if(c)for(let y=0;y<r.length;y++){let A=r[y];if(!l(A)||!l(A.indices))continue;let b=A.indices;if(!l(b)||b.length<2)continue;let x=A.restartIndex,T=l(A.materialColor)?A.materialColor:m,E;for(let v=0;v<b.length;v++){let S=b[v];if(l(x)&&S===x){E=void 0;continue}if(!l(E)){E=S;continue}let I=E,R=S;if(E=S,I===R||s>0&&(I<0||I>=s||R<0||R>=s))continue;let O=Math.min(I,R),L=Math.max(I,R),_=`${O},${L}`;p.has(_)||(p.add(_),f.push(I,R),d.push({edgeType:mv.HARD,silhouetteEdgeIndex:-1,color:l(T)?T:void 0}))}}return{edgeIndices:f,edgeData:d,silhouetteEdgeCount:g}}function Sit(e){if(!l(e))return;let t=xt.getAttributeBySemantic(e,ct.COLOR);if(!l(t))return;let n=Vt.getNumberOfComponents(t.type);if(n!==3&&n!==4)return;let i=t.typedArray;if(l(i)||(i=Na.readAttributeAsTypedArray(t)),!l(i))return;let r=t.count;if(!l(r)||r===0||i.length<r*n)return;let o=i instanceof Float32Array||i instanceof Float64Array,s=i instanceof Uint8Array,a=i instanceof Uint16Array;if(!o&&!s&&!a)return;let c=new Float32Array(r*4),u=function(f){let d;return o?d=f:s?d=f/255:a&&(d=f/65535),Math.min(Math.max(d,0),1)};for(let f=0;f<r;f++){let d=f*n,p=f*4;c[p]=u(i[d]),c[p+1]=u(i[d+1]),c[p+2]=u(i[d+2]),n===4?c[p+3]=u(i[d+3]):c[p+3]=1}return{colors:c,count:r}}function wit(e,t,n,i,r,o,s,a,c,u,f,d,p,g,m,y){if(!l(e)||e.length===0)return;let A=t.length,x=A*4,T=0,E=xt.getAttributeBySemantic(n.runtimePrimitive.primitive,ct.POSITION),v=l(E.typedArray)?E.typedArray:Na.readAttributeAsTypedArray(E),S=new Float32Array(x*3),I=new Float32Array(x),R=new Float32Array(x*3),O=new Float32Array(x*3),L=new Float32Array(x*3),_=new Float32Array(x),C=l(m),w=C?new Float32Array(x):void 0,D;C&&(D=l(m.typedArray)?m.typedArray:Na.readAttributeAsTypedArray(m));let N=l(c),F=N?new Float32Array(x*4):void 0,V=l(d)?d.colors:void 0,B=l(d)?d.count:0;function j(Ke){if(!N)return;let Pe=Ke*4;F[Pe]=0,F[Pe+1]=0,F[Pe+2]=0,F[Pe+3]=-1}function k(Ke,Pe){if(!N)return;let qe=Ke*4,st=l(Pe.x)?Pe.x:P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Yn],zi=g[Yn+1],Si=g[Yn+2],ui=g[Yn+3],Ai=g[Yn+4],zn=g[Yn+5];for(let tn=0;tn<4;tn++)R[(ht+tn)*3]=yi,R[(ht+tn)*3+1]=zi,R[(ht+tn)*3+2]=Si,O[(ht+tn)*3]=ui,O[(ht+tn)*3+1]=Ai,O[(ht+tn)*3+2]=zn}let q=tt.createVertexBuffer({context:i,typedArray:S,usage:Me.STATIC_DRAW}),Q=tt.createVertexBuffer({context:i,typedArray:I,usage:Me.STATIC_DRAW}),W=tt.createVertexBuffer({context:i,typedArray:R,usage:Me.STATIC_DRAW}),J=tt.createVertexBuffer({context:i,typedArray:O,usage:Me.STATIC_DRAW}),Z=tt.createVertexBuffer({context:i,typedArray:L,usage:Me.STATIC_DRAW}),ae=tt.createVertexBuffer({context:i,typedArray:_,usage:Me.STATIC_DRAW}),Ae=N?tt.createVertexBuffer({context:i,typedArray:F,usage:Me.STATIC_DRAW}):void 0,fe=C?tt.createVertexBuffer({context:i,typedArray:w,usage:Me.STATIC_DRAW}):void 0,ge=A*2*3,we=x>65534,ve=we?new Uint32Array(ge):new Uint16Array(ge);for(let Ke=0;Ke<A;Ke++){let Pe=Ke*4,qe=Ke*6;ve[qe]=Pe,ve[qe+1]=Pe+1,ve[qe+2]=Pe+2,ve[qe+3]=Pe,ve[qe+4]=Pe+2,ve[qe+5]=Pe+3}let Re=tt.createIndexBuffer({context:i,typedArray:ve,usage:Me.STATIC_DRAW,indexDatatype:we?je.UNSIGNED_INT:je.UNSIGNED_SHORT}),Qe=[{index:T,vertexBuffer:q,componentsPerAttribute:3,componentDatatype:Y.FLOAT,normalize:!1},{index:r,vertexBuffer:Q,componentsPerAttribute:1,componentDatatype:Y.FLOAT,normalize:!1},{index:o,vertexBuffer:W,componentsPerAttribute:3,componentDatatype:Y.FLOAT,normalize:!1},{index:s,vertexBuffer:J,componentsPerAttribute:3,componentDatatype:Y.FLOAT,normalize:!1},{index:u,vertexBuffer:Z,componentsPerAttribute:3,componentDatatype:Y.FLOAT,normalize:!1},{index:f,vertexBuffer:ae,componentsPerAttribute:1,componentDatatype:Y.FLOAT,normalize:!1}];N&&Qe.push({index:c,vertexBuffer:Ae,componentsPerAttribute:4,componentDatatype:Y.FLOAT,normalize:!1}),C&&Qe.push({index:y,vertexBuffer:fe,componentsPerAttribute:1,componentDatatype:Y.FLOAT,normalize:!1});let He=n.runtimePrimitive.primitive;if(l(He.featureIds)&&He.featureIds.length>0){let Ke=He.featureIds[0];if(l(Ke.setIndex)){let Pe=He.attributes.find(qe=>qe.semantic===ct.FEATURE_ID&&qe.setIndex===Ke.setIndex);if(l(Pe)){let qe=l(Pe.typedArray)?Pe.typedArray:Na.readAttributeAsTypedArray(Pe),st=new Float32Array(x);for(let jt=0;jt<A;jt++){let lt=e[jt*2],mt=lt<qe.length?qe[lt]:0;for(let ft=0;ft<4;ft++)st[jt*4+ft]=mt}let vt=tt.createVertexBuffer({context:i,typedArray:st,usage:Me.STATIC_DRAW});Qe.push({index:a,vertexBuffer:vt,componentsPerAttribute:1,componentDatatype:Y.FLOAT,normalize:!1})}}}return{vertexArray:new Vn({context:i,attributes:Qe,indexBuffer:Re}),indexCount:ge,hasEdgeFeatureIds:l(He.featureIds)&&He.featureIds.length>0}}var Rz=e_e;var Oz=`void geometryStage(out ProcessedAttributes attributes) +`;var yZ=class e{static readAttributeAsTypedArray(t){let n=e.readAttributeAsRawCompactTypedArray(t),i=t.normalized,r=t.quantization;if(!l(r)&&!i)return n;let o=t.type,s=t.count,a=n;return i&&(a=cn.dequantize(n,t.componentDatatype,o,s)),l(r)?e.dequantize(a,s,o,r):a}static readAttributeAsRawCompactTypedArray(t){let n=t.type,i=t.count,r=Vt.getNumberOfComponents(n),o=i*r,s=t.componentDatatype,a=t.quantization;l(a)&&(s=a.componentDatatype);let c=t.buffer,u=t.byteOffset,f=t.byteStride,d=Y.getSizeInBytes(s),p=r*d,g=!l(f)||f===p;if(l(t.typedArray))return t.typedArray;if(g){let v=Y.createTypedArray(s,o);return c.getBufferData(v,u),v}let y=new Uint8Array(c.sizeInBytes);c.getBufferData(y);let A=Y.createTypedArray(s,o),b=f??p,x=new DataView(y.buffer,y.byteOffset,y.byteLength),T=new Array(r),E=e.createComponentsReader(s);for(let v=0;v<i;++v){let S=u+v*b;E(x,S,r,T);for(let I=0;I<r;++I)A[v*r+I]=T[I]}return A}static dequantize(t,n,i,r){if(r.octEncoded){let a=e.octDecode(t,n,r.normalizationRange,void 0);return r.octEncodedZXY&&e.convertZxyToXyz(a,a),a}let o=r.quantizedVolumeStepSize,s=r.quantizedVolumeOffset;if(i===Vt.SCALAR)return e.dequantize1D(t,n,o,s,void 0);if(i===Vt.VEC2)return e.dequantize2D(t,n,o,s,void 0);if(i===Vt.VEC3)return e.dequantize3D(t,n,o,s,void 0);if(i===Vt.VEC4)return e.dequantize4D(t,n,o,s,void 0);throw new pe(`Element type for dequantization must be SCALAR, VEC2, VEC3, or VEC4, but is ${i}`)}static octDecode(t,n,i,r){l(r)||(r=new Float32Array(t.length));let o=new h;for(let s=0;s<n;s++)h.unpack(t,s*3,o),cn.octDecodeInRange(o.x,o.y,i,o),h.pack(o,r,s*3);return r}static convertZxyToXyz(t,n,i){l(i)||(i=new Float32Array(t.length));let r=0;for(let o=0;o<n;o++,r+=3){let s=t[r+0],a=t[r+1],c=t[r+2];i[r+0]=a,i[r+1]=c,i[r+2]=s}return i}static dequantize1D(t,n,i,r,o){l(o)||(o=new Float32Array(t.length));for(let s=0;s<n;s++){let c=t[s]*i+r;o[s]=c}return o}static dequantize2D(t,n,i,r,o){l(o)||(o=new Float32Array(t.length));let s=new U;for(let a=0;a<n;a++)U.unpack(t,a*2,s),U.multiplyComponents(s,i,s),U.add(s,r,s),U.pack(s,o,a*2);return o}static dequantize3D(t,n,i,r,o){l(o)||(o=new Float32Array(t.length));let s=new h;for(let a=0;a<n;a++)h.unpack(t,a*3,s),h.multiplyComponents(s,i,s),h.add(s,r,s),h.pack(s,o,a*3);return o}static dequantize4D(t,n,i,r,o){l(o)||(o=new Float32Array(t.length));let s=new se;for(let a=0;a<n;a++)se.unpack(t,a*4,s),se.multiplyComponents(s,i,s),se.add(s,r,s),se.pack(s,o,a*4);return o}static createComponentsReader(t){let n=e.createComponentReader(t),i=Y.getSizeInBytes(t);return function(r,o,s,a){let c=o;for(let u=0;u<s;++u)a[u]=n(r,c),c+=i}}static createComponentReader(t){switch(t){case Y.BYTE:return function(n,i){return n.getInt8(i)};case Y.UNSIGNED_BYTE:return function(n,i){return n.getUint8(i)};case Y.SHORT:return function(n,i){return n.getInt16(i,!0)};case Y.UNSIGNED_SHORT:return function(n,i){return n.getUint16(i,!0)};case Y.INT:return function(n,i){return n.getInt32(i,!0)};case Y.UNSIGNED_INT:return function(n,i){return n.getUint32(i,!0)};case Y.FLOAT:return function(n,i){return n.getFloat32(i,!0)};case Y.DOUBLE:return function(n,i){return n.getFloat64(i,!0)}}throw new pe(`The componentType must be a valid ComponentDatatype, but is ${t}`)}static transform3D(t,n,i){l(i)||(i=new Float32Array(t.length));let r=new h,o=t.length/3;for(let s=0;s<o;s++)h.unpack(t,s*3,r),M.multiplyByPoint(n,r,r),h.pack(r,i,s*3);return i}static readImplicitRangeAsTypedArray(t,n){let i=n.attributes[0]?.count??0,r=t.offset,o=t.repeat,s=new Float32Array(i);if(l(o))for(let a=0;a<i;a++)s[a]=r+Math.floor(a/o);else s.fill(r);return s}static readIndicesAsTypedArray(t){let n=t.typedArray;if(l(n))return n;let i=t.buffer,r=t.count,o=t.indexDatatype,s=e.createIndexTypedArray(o,r);return i.getBufferData(s),s}static readIndicesAsTriangleIndicesTypedArray(t,n){let i=e.readIndicesAsTypedArray(t);if(n===Oe.TRIANGLES)return i;if(n===Oe.TRIANGLE_STRIP)return e.convertTriangleStripToTriangleIndices(i);if(n===Oe.TRIANGLE_FAN)return e.convertTriangleFanToTriangleIndices(i);throw new pe(`The primitiveType must be TRIANGLES (${Oe.TRIANGLES}, TRIANGLE_STRIP (${Oe.TRIANGLE_STRIP}, or TRIANGLE_FAN (${Oe.TRIANGLE_FAN}, but is ${n}`)}static convertTriangleStripToTriangleIndices(t){let n=t.constructor((t.length-2)*3);for(let i=0;i<t.length-2;i++)i%2===1?(n[i*3+0]=t[i+0],n[i*3+1]=t[i+2],n[i*3+2]=t[i+1]):(n[i*3+0]=t[i+0],n[i*3+1]=t[i+1],n[i*3+2]=t[i+2]);return n}static convertTriangleFanToTriangleIndices(t){let n=t.constructor((t.length-2)*3);for(let i=0;i<t.length-2;i++)n[i*3+0]=t[i+0],n[i*3+1]=t[i+1],n[i*3+2]=t[i+2];return n}static createIndexTypedArray(t,n){switch(t){case je.UNSIGNED_BYTE:return new Uint8Array(n);case je.UNSIGNED_SHORT:return new Uint16Array(n);case je.UNSIGNED_INT:return new Uint32Array(n)}throw new pe(`The indexDatatype must be UNSIGNED_BYTE (${je.UNSIGNED_BYTE}, UNSIGNED_SHORT (${je.UNSIGNED_SHORT}, or UNSIGNED_INT (${je.UNSIGNED_INT}, but is ${t}`)}static forEachPrimitive(t,n,i){let r=n?.mapProjection,o=n?.instanceFeatureIdLabel,s=t.sceneGraph;if(!l(s))return;let a={nodeComputedTransform:new M,modelMatrix:new M,computedModelMatrix:new M},c=s._runtimeNodes,u=c.length;for(let f=0;f<u;f++){let d=c[f],p=e.computeNodeTransforms(d,s,t,a),g=p.computedModelMatrix;l(r)&&(g=At.basisTo2D(r,g,g));let m=e.computeInstanceTransforms(d,g,p.nodeComputedTransform,p.modelMatrix),y=l(o)?e.computeInstanceFeatureIds(d,o):void 0,A=[];for(let x=0;x<m.length;x++)A.push({transform:m[x],featureId:l(y)?y[x]:void 0});let b=d.runtimePrimitives.length;for(let x=0;x<b;x++){let T=d.runtimePrimitives[x];i(T,T.primitive,A,g)}}}static computeNodeTransforms(t,n,i,r){let o=t.node,s=M.clone(t.computedTransform,r.nodeComputedTransform),a=M.clone(n.computedModelMatrix,r.modelMatrix),c=o.instances;l(c)&&c.transformInWorldSpace&&(a=M.multiplyTransformation(i.modelMatrix,n.components.transform,a),s=M.multiplyTransformation(n.axisCorrectionMatrix,t.computedTransform,s));let u=M.multiplyTransformation(a,s,r.computedModelMatrix);return r.computedModelMatrix=u,r.nodeComputedTransform=s,r.modelMatrix=a,r}static computeInstanceTransforms(t,n,i,r){let o=[],a=t.node.instances;if(l(a)){let c=a.attributes[0].count,u=a.attributes[0].componentDatatype,f=12,d=t.transformsTypedArray;if(!l(d)){let p=t.instancingTransformsBuffer;l(p)&&(d=Y.createTypedArray(u,c*f),p.getBufferData(d))}l(d)?e.computeInstanceTransformsFromTypedArray(d,c,o):e.computeInstanceTransformsFromAttributes(a,c,o);for(let p=0;p<o.length;p++){let g=o[p];a.transformInWorldSpace?(M.multiplyTransformation(g,i,g),M.multiplyTransformation(r,g,g)):M.multiplyTransformation(n,g,g)}}return o.length===0&&o.push(n),o}static computeInstanceFeatureIds(t,n){let r=t.node.instances;if(!l(r))return;let o=xt.getFeatureIdsByLabel(r.featureIds,n);if(!l(o))return;let s;if("setIndex"in o){let c=xt.getAttributeBySemantic(r,ct.FEATURE_ID,o.setIndex);l(c)&&(s=e.readAttributeAsTypedArray(c))}if("offset"in o&&(s=e.readImplicitRangeAsTypedArray(o,r)),!l(s))return;let a=new Array(s.length);for(let c=0;c<s.length;c++)a[c]=s[c];return a}static computeInstanceTransformsFromTypedArray(t,n,i){for(let o=0;o<n;o++){let s=o*12,a=new M(t[s],t[s+1],t[s+2],t[s+3],t[s+4],t[s+5],t[s+6],t[s+7],t[s+8],t[s+9],t[s+10],t[s+11],0,0,0,1);i.push(a)}}static computeInstanceTransformsFromAttributes(t,n,i){let r=xt.getAttributeBySemantic(t,Bo.TRANSLATION),o=xt.getAttributeBySemantic(t,Bo.ROTATION),s=xt.getAttributeBySemantic(t,Bo.SCALE),a=l(r),c=l(o),u=l(s);if(!a&&!c&&!u)return;let f,d,p;a&&(f=e.readAttributeAsRawCompactTypedArray(r)),c&&(d=e.readAttributeAsRawCompactTypedArray(o)),u&&(p=e.readAttributeAsRawCompactTypedArray(s));for(let g=0;g<n;g++){let m=a?new h(f[g*3],f[g*3+1],f[g*3+2]):h.ZERO,y=c?new Le(d[g*4],d[g*4+1],d[g*4+2],d[g*4+3]):Le.IDENTITY,A=u?new h(p[g*3],p[g*3+1],p[g*3+2]):h.ONE,b=M.fromTranslationQuaternionRotationScale(m,y,A,new M);i.push(b)}}},La=yZ;var $v=Object.freeze({HIDDEN:0,SILHOUETTE:1,HARD:2,REPEATED_HARD:3}),Abe={name:"EdgeVisibilityPipelineStage"};Abe.process=function(e,t,n){if(!l(t.edgeVisibility))return;n.edgeVisibilityRequested=!0;let i=e.shaderBuilder;i.addDefine("HAS_EDGE_VISIBILITY",void 0,de.BOTH),i.addDefine("HAS_EDGE_VISIBILITY_MRT",void 0,de.FRAGMENT),i.addFragmentLines(CV),i.addVertexLines(vV),i.addUniform("bool","u_isEdgePass",de.BOTH);let r=t.material,o=l(r)?r.lineStyle:void 0;(!l(o)||!l(o.width))&&i.addUniform("float","u_lineWidth",de.VERTEX);let s=i.addAttribute("float","a_edgeType");i.addVarying("float","v_edgeType","flat");let a=i.addAttribute("float","a_edgeFeatureId"),c=i.addAttribute("vec3","a_faceNormalA"),u=i.addAttribute("vec3","a_faceNormalB");i.addVarying("vec3","v_faceNormalAView","flat"),i.addVarying("vec3","v_faceNormalBView","flat"),i.addVarying("float","v_shouldDiscard","flat");let f=i.addAttribute("vec3","a_edgeOtherPos"),d=i.addAttribute("float","a_edgeOffset");i.addVarying("float","v_edgeOffset");let p=hat(t);if(!l(p)||!l(p.edgeIndices)||p.edgeIndices.length===0)return;let g=e.runtimePrimitive.primitive,m=mat(g),A=p.edgeData.some(function(R){return l(R.color)})||l(m),b;A&&(b=i.addAttribute("vec4","a_edgeColor"),i.addVarying("vec4","v_edgeColor","flat"),i.addDefine("HAS_EDGE_COLOR_ATTRIBUTE",void 0,de.BOTH));let x,T,E=xt.getAttributeBySemantic(t,"BENTLEY_materials_line_style:CUMULATIVE_DISTANCE");l(E)&&(x=E,T=i.addAttribute("float","a_edgeCumulativeDistance"),i.addDefine("HAS_EDGE_CUMULATIVE_DISTANCE",void 0,de.VERTEX));let v=dat(p.edgeIndices,p.edgeData,t.edgeVisibility),S=pat(p.edgeIndices,p.edgeData,e,n.context,s,c,u,a,b,f,d,m,t.edgeVisibility,v,x,T);if(!l(S))return;S.hasEdgeFeatureIds&&i.addDefine("HAS_EDGE_FEATURE_ID",void 0,de.BOTH),e.uniformMap.u_isEdgePass=function(){return!1},l(e.uniformMap.u_lineWidth)||(e.uniformMap.u_lineWidth=function(){return 1}),l(x)&&(l(e.uniformMap.u_pixelsPerWorld)||(e.uniformMap.u_pixelsPerWorld=function(){return 1}));let I=l(o)&&l(o.width)?o.width*n.pixelRatio:void 0;e.edgeGeometry={vertexArray:S.vertexArray,indexCount:S.indexCount,primitiveType:Oe.TRIANGLES,pass:Ie.CESIUM_3D_TILE_EDGES,lineWidth:I}};function dat(e,t,n){let i=e.length/2,r=new Float32Array(i*6),o=n.silhouetteNormals;if(!l(o))return r;let s=o.length/3,a=new Float32Array(o.length),c=new h;for(let u=0;u<s;u++)c.x=o[u*3],c.y=o[u*3+1],c.z=o[u*3+2],h.magnitudeSquared(c)>0?h.normalize(c,c):(c.x=0,c.y=0,c.z=1),a[u*3]=c.x,a[u*3+1]=c.y,a[u*3+2]=c.z;for(let u=0;u<i;u++){let{edgeType:f,silhouetteEdgeIndex:d}=t[u];if(f!==$v.SILHOUETTE||d<0)continue;let p=d*2;if((p+1)*3+2>=a.length)continue;let g=p*3,m=(p+1)*3,y=u*6;r[y]=a[g],r[y+1]=a[g+1],r[y+2]=a[g+2],r[y+3]=a[m],r[y+4]=a[m+1],r[y+5]=a[m+2]}return r}function hat(e){let t=e.edgeVisibility;if(!l(t))return[];let n=t.visibility,i=e.indices,r=t.lineStrings,o=e.attributes,s=l(o)&&o.length>0?o[0].count:0,a=l(n)&&l(i)&&l(i.typedArray)&&i.typedArray.length>0,c=l(r)&&r.length>0;if(!a&&!c)return[];let u=a?i.typedArray:void 0,f=[],d=[],p=new Set,g=0,m=t.materialColor;if(a){let y=0,A=u.length,b=n;for(let x=0;x+2<A;x+=3){let T=u[x],E=u[x+1],v=u[x+2];for(let S=0;S<3;S++){let I,R;S===0?(I=T,R=E):S===1?(I=E,R=v):(I=v,R=T);let O=Math.floor(y/4),L=y%4*2;if(y++,O>=b.length)break;let C=b[O]>>L&3;if(C===$v.HIDDEN)continue;let w=Math.min(I,R),D=Math.max(I,R),N=`${w},${D}`;if(p.has(N))continue;p.add(N),f.push(I,R);let F=-1;C===$v.SILHOUETTE&&(F=g,g++),d.push({edgeType:C===$v.REPEATED_HARD?$v.HARD:C,silhouetteEdgeIndex:F,color:m})}}}if(c)for(let y=0;y<r.length;y++){let A=r[y];if(!l(A)||!l(A.indices))continue;let b=A.indices;if(!l(b)||b.length<2)continue;let x=A.restartIndex,T=l(A.materialColor)?A.materialColor:m,E;for(let v=0;v<b.length;v++){let S=b[v];if(l(x)&&S===x){E=void 0;continue}if(!l(E)){E=S;continue}let I=E,R=S;if(E=S,I===R||s>0&&(I<0||I>=s||R<0||R>=s))continue;let O=Math.min(I,R),L=Math.max(I,R),_=`${O},${L}`;p.has(_)||(p.add(_),f.push(I,R),d.push({edgeType:$v.HARD,silhouetteEdgeIndex:-1,color:l(T)?T:void 0}))}}return{edgeIndices:f,edgeData:d,silhouetteEdgeCount:g}}function mat(e){if(!l(e))return;let t=xt.getAttributeBySemantic(e,ct.COLOR);if(!l(t))return;let n=Vt.getNumberOfComponents(t.type);if(n!==3&&n!==4)return;let i=t.typedArray;if(l(i)||(i=La.readAttributeAsTypedArray(t)),!l(i))return;let r=t.count;if(!l(r)||r===0||i.length<r*n)return;let o=i instanceof Float32Array||i instanceof Float64Array,s=i instanceof Uint8Array,a=i instanceof Uint16Array;if(!o&&!s&&!a)return;let c=new Float32Array(r*4),u=function(f){let d;return o?d=f:s?d=f/255:a&&(d=f/65535),Math.min(Math.max(d,0),1)};for(let f=0;f<r;f++){let d=f*n,p=f*4;c[p]=u(i[d]),c[p+1]=u(i[d+1]),c[p+2]=u(i[d+2]),n===4?c[p+3]=u(i[d+3]):c[p+3]=1}return{colors:c,count:r}}function pat(e,t,n,i,r,o,s,a,c,u,f,d,p,g,m,y){if(!l(e)||e.length===0)return;let A=t.length,x=A*4,T=0,E=xt.getAttributeBySemantic(n.runtimePrimitive.primitive,ct.POSITION),v=l(E.typedArray)?E.typedArray:La.readAttributeAsTypedArray(E),S=new Float32Array(x*3),I=new Float32Array(x),R=new Float32Array(x*3),O=new Float32Array(x*3),L=new Float32Array(x*3),_=new Float32Array(x),C=l(m),w=C?new Float32Array(x):void 0,D;C&&(D=l(m.typedArray)?m.typedArray:La.readAttributeAsTypedArray(m));let N=l(c),F=N?new Float32Array(x*4):void 0,V=l(d)?d.colors:void 0,B=l(d)?d.count:0;function j(Ke){if(!N)return;let Pe=Ke*4;F[Pe]=0,F[Pe+1]=0,F[Pe+2]=0,F[Pe+3]=-1}function k(Ke,Pe){if(!N)return;let qe=Ke*4,st=l(Pe.x)?Pe.x:Pe[0],vt=l(Pe.y)?Pe.y:Pe[1],jt=l(Pe.z)?Pe.z:Pe[2],lt=l(Pe.w)?Pe.w:l(Pe[3])?Pe[3]:1;F[qe]=st,F[qe+1]=vt,F[qe+2]=jt,F[qe+3]=lt}function G(Ke,Pe){if(!N)return;if(Pe>=B){j(Ke);return}let qe=Pe*4,st=Ke*4;F[st]=V[qe],F[st+1]=V[qe+1],F[st+2]=V[qe+2],F[st+3]=V[qe+3]}for(let Ke=0;Ke<A;Ke++){let Pe=e[Ke*2],qe=e[Ke*2+1],vt=t[Ke].edgeType/255,jt=v[Pe*3],lt=v[Pe*3+1],mt=v[Pe*3+2],ft=v[qe*3],Yt=v[qe*3+1],rt=v[qe*3+2],ht=Ke*4;S[ht*3]=jt,S[ht*3+1]=lt,S[ht*3+2]=mt,L[ht*3]=ft,L[ht*3+1]=Yt,L[ht*3+2]=rt,_[ht]=-1,I[ht]=vt,S[(ht+1)*3]=jt,S[(ht+1)*3+1]=lt,S[(ht+1)*3+2]=mt,L[(ht+1)*3]=ft,L[(ht+1)*3+1]=Yt,L[(ht+1)*3+2]=rt,_[ht+1]=1,I[ht+1]=vt,S[(ht+2)*3]=ft,S[(ht+2)*3+1]=Yt,S[(ht+2)*3+2]=rt,L[(ht+2)*3]=jt,L[(ht+2)*3+1]=lt,L[(ht+2)*3+2]=mt,_[ht+2]=1,I[ht+2]=vt,S[(ht+3)*3]=ft,S[(ht+3)*3+1]=Yt,S[(ht+3)*3+2]=rt,L[(ht+3)*3]=jt,L[(ht+3)*3+1]=lt,L[(ht+3)*3+2]=mt,_[ht+3]=-1,I[ht+3]=vt;let Li=t[Ke].color;if(l(Li))for(let tn=0;tn<4;tn++)k(ht+tn,Li);else if(l(V))for(let tn=0;tn<4;tn++)G(ht+tn,Pe);else for(let tn=0;tn<4;tn++)j(ht+tn);if(C){let tn=D[Pe],Hn=D[qe];w[ht]=tn,w[ht+1]=tn,w[ht+2]=Hn,w[ht+3]=Hn}let Yn=Ke*6,yi=g[Yn],zi=g[Yn+1],Si=g[Yn+2],ui=g[Yn+3],Ai=g[Yn+4],zn=g[Yn+5];for(let tn=0;tn<4;tn++)R[(ht+tn)*3]=yi,R[(ht+tn)*3+1]=zi,R[(ht+tn)*3+2]=Si,O[(ht+tn)*3]=ui,O[(ht+tn)*3+1]=Ai,O[(ht+tn)*3+2]=zn}let q=tt.createVertexBuffer({context:i,typedArray:S,usage:Me.STATIC_DRAW}),Q=tt.createVertexBuffer({context:i,typedArray:I,usage:Me.STATIC_DRAW}),W=tt.createVertexBuffer({context:i,typedArray:R,usage:Me.STATIC_DRAW}),J=tt.createVertexBuffer({context:i,typedArray:O,usage:Me.STATIC_DRAW}),Z=tt.createVertexBuffer({context:i,typedArray:L,usage:Me.STATIC_DRAW}),ae=tt.createVertexBuffer({context:i,typedArray:_,usage:Me.STATIC_DRAW}),Ae=N?tt.createVertexBuffer({context:i,typedArray:F,usage:Me.STATIC_DRAW}):void 0,fe=C?tt.createVertexBuffer({context:i,typedArray:w,usage:Me.STATIC_DRAW}):void 0,ge=A*2*3,we=x>65534,ve=we?new Uint32Array(ge):new Uint16Array(ge);for(let Ke=0;Ke<A;Ke++){let Pe=Ke*4,qe=Ke*6;ve[qe]=Pe,ve[qe+1]=Pe+1,ve[qe+2]=Pe+2,ve[qe+3]=Pe,ve[qe+4]=Pe+2,ve[qe+5]=Pe+3}let Re=tt.createIndexBuffer({context:i,typedArray:ve,usage:Me.STATIC_DRAW,indexDatatype:we?je.UNSIGNED_INT:je.UNSIGNED_SHORT}),Qe=[{index:T,vertexBuffer:q,componentsPerAttribute:3,componentDatatype:Y.FLOAT,normalize:!1},{index:r,vertexBuffer:Q,componentsPerAttribute:1,componentDatatype:Y.FLOAT,normalize:!1},{index:o,vertexBuffer:W,componentsPerAttribute:3,componentDatatype:Y.FLOAT,normalize:!1},{index:s,vertexBuffer:J,componentsPerAttribute:3,componentDatatype:Y.FLOAT,normalize:!1},{index:u,vertexBuffer:Z,componentsPerAttribute:3,componentDatatype:Y.FLOAT,normalize:!1},{index:f,vertexBuffer:ae,componentsPerAttribute:1,componentDatatype:Y.FLOAT,normalize:!1}];N&&Qe.push({index:c,vertexBuffer:Ae,componentsPerAttribute:4,componentDatatype:Y.FLOAT,normalize:!1}),C&&Qe.push({index:y,vertexBuffer:fe,componentsPerAttribute:1,componentDatatype:Y.FLOAT,normalize:!1});let He=n.runtimePrimitive.primitive;if(l(He.featureIds)&&He.featureIds.length>0){let Ke=He.featureIds[0];if(l(Ke.setIndex)){let Pe=He.attributes.find(qe=>qe.semantic===ct.FEATURE_ID&&qe.setIndex===Ke.setIndex);if(l(Pe)){let qe=l(Pe.typedArray)?Pe.typedArray:La.readAttributeAsTypedArray(Pe),st=new Float32Array(x);for(let jt=0;jt<A;jt++){let lt=e[jt*2],mt=lt<qe.length?qe[lt]:0;for(let ft=0;ft<4;ft++)st[jt*4+ft]=mt}let vt=tt.createVertexBuffer({context:i,typedArray:st,usage:Me.STATIC_DRAW});Qe.push({index:a,vertexBuffer:vt,componentsPerAttribute:1,componentDatatype:Y.FLOAT,normalize:!1})}}}return{vertexArray:new Vn({context:i,attributes:Qe,indexBuffer:Re}),indexCount:ge,hasEdgeFeatureIds:l(He.featureIds)&&He.featureIds.length>0}}var SV=Abe;var wV=`void geometryStage(out ProcessedAttributes attributes) { attributes.positionMC = v_positionMC; attributes.positionEC = v_positionEC; @@ -8863,7 +8860,7 @@ attributes.bitangentEC = normalize(v_bitangentEC); #endif setDynamicVaryings(attributes); } -`;var Mz=`vec4 geometryStage(inout ProcessedAttributes attributes, mat4 modelView, mat3 normal) +`;var IV=`vec4 geometryStage(inout ProcessedAttributes attributes, mat4 modelView, mat3 normal) { vec4 computedPosition; vec3 positionMC = attributes.positionMC; @@ -8891,7 +8888,7 @@ v_bitangentEC = normalize(normal * attributes.bitangentMC); setDynamicVaryings(attributes); return computedPosition; } -`;var jD=`vec2 computeSt(float featureId) +`;var d1=`vec2 computeSt(float featureId) { float stepX = model_textureStep.x; float centerX = model_textureStep.y; @@ -8929,8 +8926,7 @@ feature.color = vec4(1.0); } #endif } -`;var HD={name:"SelectedFeatureIdPipelineStage",STRUCT_ID_SELECTED_FEATURE:"SelectedFeature",STRUCT_NAME_SELECTED_FEATURE:"SelectedFeature"};HD.process=function(e,t,n){let i=e.shaderBuilder;e.hasPropertyTable=!0;let r=e.model,o=e.runtimeNode.node,s=Iit(r,o,t),a=s.shaderDestination;i.addDefine("HAS_SELECTED_FEATURE_ID",void 0,a),i.addDefine("SELECTED_FEATURE_ID",s.variableName,a),i.addDefine(s.featureIdDefine,void 0,a),Pit(i);let c=s.featureIds.nullFeatureId,u=e.uniformMap;l(c)&&(i.addDefine("HAS_NULL_FEATURE_ID",void 0,a),i.addUniform("int","model_nullFeatureId",a),u.model_nullFeatureId=function(){return c}),s.shaderDestination===de.BOTH&&i.addVertexLines(jD),i.addFragmentLines(jD)};function t_e(e){return e instanceof vn.FeatureIdTexture?"HAS_SELECTED_FEATURE_ID_TEXTURE":"HAS_SELECTED_FEATURE_ID_ATTRIBUTE"}function n_e(e){return e instanceof vn.FeatureIdTexture?de.FRAGMENT:de.BOTH}function Iit(e,t,n){let i,r;return l(t.instances)&&(r=xt.getFeatureIdsByLabel(t.instances.featureIds,e.instanceFeatureIdLabel),l(r))?(i=r.label??r.positionalLabel,{featureIds:r,variableName:i,shaderDestination:n_e(r),featureIdDefine:t_e(r)}):(r=xt.getFeatureIdsByLabel(n.featureIds,e.featureIdLabel),i=r.label??r.positionalLabel,{featureIds:r,variableName:i,shaderDestination:n_e(r),featureIdDefine:t_e(r)})}function Pit(e){e.addStructField(HD.STRUCT_ID_SELECTED_FEATURE,"int","id"),e.addStructField(HD.STRUCT_ID_SELECTED_FEATURE,"vec2","st"),e.addStructField(HD.STRUCT_ID_SELECTED_FEATURE,"vec4","color")}var px=HD;var La={name:"GeometryPipelineStage",STRUCT_ID_PROCESSED_ATTRIBUTES_VS:"ProcessedAttributesVS",STRUCT_ID_PROCESSED_ATTRIBUTES_FS:"ProcessedAttributesFS",STRUCT_NAME_PROCESSED_ATTRIBUTES:"ProcessedAttributes",FUNCTION_ID_INITIALIZE_ATTRIBUTES:"initializeAttributes",FUNCTION_SIGNATURE_INITIALIZE_ATTRIBUTES:"void initializeAttributes(out ProcessedAttributes attributes)",FUNCTION_ID_SET_DYNAMIC_VARYINGS_VS:"setDynamicVaryingsVS",FUNCTION_ID_SET_DYNAMIC_VARYINGS_FS:"setDynamicVaryingsFS",FUNCTION_SIGNATURE_SET_DYNAMIC_VARYINGS:"void setDynamicVaryings(inout ProcessedAttributes attributes)"};La.process=function(e,t,n){let{shaderBuilder:i,model:r}=e;i.addStruct(La.STRUCT_ID_PROCESSED_ATTRIBUTES_VS,"ProcessedAttributes",de.VERTEX),i.addStruct(La.STRUCT_ID_PROCESSED_ATTRIBUTES_FS,"ProcessedAttributes",de.FRAGMENT),i.addStruct(px.STRUCT_ID_SELECTED_FEATURE,px.STRUCT_NAME_SELECTED_FEATURE,de.BOTH),i.addFunction(La.FUNCTION_ID_INITIALIZE_ATTRIBUTES,La.FUNCTION_SIGNATURE_INITIALIZE_ATTRIBUTES,de.VERTEX),i.addVarying("vec3","v_positionWC"),i.addVarying("vec3","v_positionEC"),i.addStructField(La.STRUCT_ID_PROCESSED_ATTRIBUTES_FS,"vec3","positionWC"),i.addStructField(La.STRUCT_ID_PROCESSED_ATTRIBUTES_FS,"vec3","positionEC"),i.addFunction(La.FUNCTION_ID_SET_DYNAMIC_VARYINGS_VS,La.FUNCTION_SIGNATURE_SET_DYNAMIC_VARYINGS,de.VERTEX),i.addFunction(La.FUNCTION_ID_SET_DYNAMIC_VARYINGS_FS,La.FUNCTION_SIGNATURE_SET_DYNAMIC_VARYINGS,de.FRAGMENT),r.type===Jo.TILE_PNTS&&i.addDefine("HAS_SRGB_COLOR",void 0,de.FRAGMENT);let o=n.mode!==re.SCENE3D&&!n.scene3DOnly&&r._projectTo2D,s=l(e.runtimeNode.node.instances),a=o&&!s,c=t.attributes.length;for(let u=0;u<c;u++){let f=t.attributes[u],d=Vt.getAttributeLocationCount(f.type),p=f.semantic===ct.POSITION,g;d>1?(g=e.attributeIndex,e.attributeIndex+=d):p&&!a?g=0:g=e.attributeIndex++;let m=!p&&t.primitiveType===Oe.POINTS&&n.context.webgl2?"flat":void 0;Dit(e,f,g,d,o,s,m)}Uit(i,t.attributes),t.primitiveType===Oe.POINTS&&i.addDefine("PRIMITIVE_TYPE_POINTS"),i.addVertexLines(Mz),i.addFragmentLines(Oz)};function Dit(e,t,n,i,r,o,s){let a=e.shaderBuilder,c=xt.getAttributeInfo(t),u=r&&!o;i>1?Mit(e,t,n,i):Oit(e,t,n,u),Lit(a,c,u),Nit(a,c,s),l(t.semantic)&&Rit(a,t),Fit(a,c,r),Bit(a,c,u),kit(a,c)}function Rit(e,t){let{semantic:n,setIndex:i}=t;switch(n){case ct.NORMAL:e.addDefine("HAS_NORMALS");break;case ct.TANGENT:e.addDefine("HAS_TANGENTS");break;case ct.FEATURE_ID:e.addDefine(`HAS${n}_${i}`);break;case ct.TEXCOORD:case ct.COLOR:e.addDefine(`HAS_${n}_${i}`)}}function Oit(e,t,n,i){let{quantization:r,semantic:o,setIndex:s}=t,{type:a,componentDatatype:c}=l(r)?r:t;o===ct.FEATURE_ID&&s>=e.featureIdVertexAttributeSetIndex&&(e.featureIdVertexAttributeSetIndex=s+1);let u=o===ct.POSITION,f=u?0:n,d=Vt.getNumberOfComponents(a),p={index:f,value:l(t.buffer)?void 0:t.constant,vertexBuffer:t.buffer,count:t.count,componentsPerAttribute:d,componentDatatype:c,offsetInBytes:t.byteOffset,strideInBytes:t.byteStride,normalize:t.normalized};if(e.attributes.push(p),!u||!i)return;let g=e.runtimePrimitive.positionBuffer2D,m={index:n,vertexBuffer:g,count:t.count,componentsPerAttribute:d,componentDatatype:Y.FLOAT,offsetInBytes:0,strideInBytes:void 0,normalize:t.normalized};e.attributes.push(m)}function Mit(e,t,n,i){let{quantization:r,normalized:o}=t,{type:s,componentDatatype:a}=l(r)?r:t,u=Vt.getNumberOfComponents(s)/i,f=Y.getSizeInBytes(a),d=u*f,p=t.byteStride;for(let g=0;g<i;g++){let m=t.byteOffset+g*d,y={index:n+g,vertexBuffer:t.buffer,componentsPerAttribute:u,componentDatatype:a,offsetInBytes:m,strideInBytes:p,normalize:o};e.attributes.push(y)}}function Nit(e,t,n){let i=t.variableName,r=`v_${i}`,o;i==="normalMC"?(r="v_normalEC",o=t.glslType):i==="tangentMC"?(o="vec3",r="v_tangentEC"):o=t.glslType,e.addVarying(o,r,n)}function Lit(e,t,n){let i=t.attribute.semantic,r=t.variableName,o,s;t.isQuantized?(o=`a_quantized_${r}`,s=t.quantizedGlslType):(o=`a_${r}`,s=t.glslType);let a=i===ct.POSITION;a?e.setPositionAttribute(s,o):e.addAttribute(s,o),a&&n&&e.addAttribute("vec3","a_position2D")}function Fit(e,t,n){let i=La.STRUCT_ID_PROCESSED_ATTRIBUTES_VS,r=La.STRUCT_ID_PROCESSED_ATTRIBUTES_FS,{variableName:o,glslType:s}=t;o==="tangentMC"?(e.addStructField(i,"vec3","tangentMC"),e.addStructField(i,"float","tangentSignMC"),e.addStructField(r,"vec3","tangentEC")):o==="normalMC"?(e.addStructField(i,"vec3","normalMC"),e.addStructField(r,"vec3","normalEC")):(e.addStructField(i,s,o),e.addStructField(r,s,o)),o==="positionMC"&&n&&e.addStructField(i,"vec3","position2D")}function Bit(e,t,n){let i=La.FUNCTION_ID_INITIALIZE_ATTRIBUTES,r=t.variableName;if(r==="positionMC"&&n&&e.addFunctionLines(i,["attributes.position2D = a_position2D;"]),t.isQuantized)return;let s=[];r==="tangentMC"?(s.push("attributes.tangentMC = a_tangentMC.xyz;"),s.push("attributes.tangentSignMC = a_tangentMC.w;")):s.push(`attributes.${r} = a_${r};`),e.addFunctionLines(i,s)}function kit(e,t){let{semantic:n,setIndex:i}=t.attribute;if(l(n)&&!l(i))return;let r=La.FUNCTION_ID_SET_DYNAMIC_VARYINGS_VS,o=t.variableName,s=`v_${o} = attributes.${o};`;e.addFunctionLines(r,[s]),r=La.FUNCTION_ID_SET_DYNAMIC_VARYINGS_FS,s=`attributes.${o} = v_${o};`,e.addFunctionLines(r,[s])}function Uit(e,t){let n=!1,i=!1;for(let r=0;r<t.length;r++){let o=t[r];o.semantic===ct.NORMAL?n=!0:o.semantic===ct.TANGENT&&(i=!0)}!n||!i||(e.addDefine("HAS_BITANGENTS"),e.addVarying("vec3","v_bitangentEC"),e.addStructField(La.STRUCT_ID_PROCESSED_ATTRIBUTES_VS,"vec3","bitangentMC"),e.addStructField(La.STRUCT_ID_PROCESSED_ATTRIBUTES_FS,"vec3","bitangentEC"))}var Nz=La;var PJ=new he,DJ=new he,i_e=new h,r_e=new h,RJ=class{constructor(t){ut(this,"_rectangleSouthwestInMeters");ut(this,"_rectangleNortheastInMeters");if(t=t??H.EMPTY_OBJECT,this._ellipsoid=t.ellipsoid??ee.default,this._numberOfLevelZeroTilesX=t.numberOfLevelZeroTilesX??1,this._numberOfLevelZeroTilesY=t.numberOfLevelZeroTilesY??1,this._projection=new Ti(this._ellipsoid),l(t.rectangleSouthwestInMeters)&&l(t.rectangleNortheastInMeters))this._rectangleSouthwestInMeters=t.rectangleSouthwestInMeters,this._rectangleNortheastInMeters=t.rectangleNortheastInMeters;else{let r=this._ellipsoid.maximumRadius*Math.PI;this._rectangleSouthwestInMeters=new U(-r,-r),this._rectangleNortheastInMeters=new U(r,r)}let{x:n,y:i}=this._rectangleSouthwestInMeters;h.fromElements(n,i,0,i_e),this._projection.unproject(i_e,PJ),{x:n,y:i}=this._rectangleNortheastInMeters,h.fromElements(n,i,0,r_e),this._projection.unproject(r_e,DJ),this._rectangle=new ie(PJ.longitude,PJ.latitude,DJ.longitude,DJ.latitude)}get ellipsoid(){return this._ellipsoid}get rectangle(){return this._rectangle}get projection(){return this._projection}getNumberOfXTilesAtLevel(t){return this._numberOfLevelZeroTilesX<<t}getNumberOfYTilesAtLevel(t){return this._numberOfLevelZeroTilesY<<t}rectangleToNativeRectangle(t,n){let i=this._projection,r=i.project(ie.southwest(t)),o=i.project(ie.northeast(t));return l(n)?(n.west=r.x,n.south=r.y,n.east=o.x,n.north=o.y,n):new ie(r.x,r.y,o.x,o.y)}tileXYToNativeRectangle(t,n,i,r){let o=this.getNumberOfXTilesAtLevel(i),s=this.getNumberOfYTilesAtLevel(i),a=(this._rectangleNortheastInMeters.x-this._rectangleSouthwestInMeters.x)/o,c=this._rectangleSouthwestInMeters.x+t*a,u=this._rectangleSouthwestInMeters.x+(t+1)*a,f=(this._rectangleNortheastInMeters.y-this._rectangleSouthwestInMeters.y)/s,d=this._rectangleNortheastInMeters.y-n*f,p=this._rectangleNortheastInMeters.y-(n+1)*f;return l(r)?(r.west=c,r.south=p,r.east=u,r.north=d,r):new ie(c,p,u,d)}tileXYToRectangle(t,n,i,r){let o=this.tileXYToNativeRectangle(t,n,i,r),s=this._projection,a=s.unproject(new h(o.west,o.south)),c=s.unproject(new h(o.east,o.north));return o.west=a.longitude,o.south=a.latitude,o.east=c.longitude,o.north=c.latitude,o}positionToTileXY(t,n,i){let r=this._rectangle;if(!ie.contains(r,t))return;let o=this.getNumberOfXTilesAtLevel(n),s=this.getNumberOfYTilesAtLevel(n),c=(this._rectangleNortheastInMeters.x-this._rectangleSouthwestInMeters.x)/o,f=(this._rectangleNortheastInMeters.y-this._rectangleSouthwestInMeters.y)/s,p=this._projection.project(t),g=p.x-this._rectangleSouthwestInMeters.x,m=this._rectangleNortheastInMeters.y-p.y,y=g/c|0;y>=o&&(y=o-1);let A=m/f|0;return A>=s&&(A=s-1),l(i)?(i.x=y,i.y=A,i):new U(y,A)}},Bo=RJ;var OJ,o_e="AAPTaeRGM19PsTpo1ePVkJZk4Tg..zqn3rpU4kUaF-8QMW-oWZntlxvKhdUFXLBoo5dQwRNEKd1EoKJh-Ha2zxbrz2Nhz2tV_gLVZTQwFHLzJHKwsGDz4GTKV8jeUgb12Ci9CeU_9sOrauJYnGK2vHhtSSAQ-73rmKzNG_2lZ0zuCCEKslxCmXUw2mT1Cpk0RoCCtDheWByX1e7Lnb3LKCBDt9VhGFSGCOiaFfizFRLld8LWukKgxCgluTpKgUuUi4OytX84roEpm6mP7PE91AT1_5Uash6To",pv={};pv.defaultAccessToken=o_e;pv.defaultWorldImageryServer=new De({url:"https://ibasemaps-api.arcgis.com/arcgis/rest/services/World_Imagery/MapServer"});pv.defaultWorldHillshadeServer=new De({url:"https://ibasemaps-api.arcgis.com/arcgis/rest/services/Elevation/World_Hillshade/MapServer"});pv.defaultWorldOceanServer=new De({url:"https://ibasemaps-api.arcgis.com/arcgis/rest/services/Ocean/World_Ocean_Base/MapServer"});pv.getDefaultTokenCredit=function(e){if(e===o_e){if(!l(OJ)){let t='<b> This application is using a default ArcGIS access token. Please assign <i>Cesium.ArcGisMapService.defaultAccessToken</i> with an API key from your ArcGIS Developer account before using the ArcGIS tile services. You can sign up for a free ArcGIS Developer account at <a href="https://developers.arcgis.com/">https://developers.arcgis.com/</a>.</b>';OJ=new It(t,!0)}return OJ}};var yd=pv;function MJ(e){e=e??H.EMPTY_OBJECT,this._pixelsToCheck=e.pixelsToCheck,this._missingImagePixels=void 0,this._missingImageByteLength=void 0,this._isReady=!1;let t=De.createIfNeeded(e.missingImageUrl),n=this;function i(o){l(o.blob)&&(n._missingImageByteLength=o.blob.size);let s=Bm(o);if(e.disableCheckIfAllPixelsAreTransparent){let a=!0,c=o.width,u=e.pixelsToCheck;for(let f=0,d=u.length;a&&f<d;++f){let p=u[f],g=p.x*4+p.y*c;s[g+3]>0&&(a=!1)}a&&(s=void 0)}n._missingImagePixels=s,n._isReady=!0}function r(){n._missingImagePixels=void 0,n._isReady=!0}t.fetchImage({preferBlob:!0,preferImageBitmap:!0,flipY:!0}).then(i).catch(r)}MJ.prototype.isReady=function(){return this._isReady};MJ.prototype.shouldDiscardImage=function(e){let t=this._pixelsToCheck,n=this._missingImagePixels;if(!l(n)||l(e.blob)&&e.blob.size!==this._missingImageByteLength)return!1;let i=Bm(e),r=e.width;for(let o=0,s=t.length;o<s;++o){let a=t[o],c=a.x*4+a.y*r;for(let u=0;u<4;++u){let f=c+u;if(i[f]!==n[f])return!1}}return!0};var Lz=MJ;function NJ(){this.name=void 0,this.description=void 0,this.position=void 0,this.data=void 0,this.imageryLayer=void 0}NJ.prototype.configureNameFromProperties=function(e){let t=10,n;for(let i in e)if(e.hasOwnProperty(i)&&e[i]){let r=i.toLowerCase();t>1&&r==="name"?(t=1,n=i):t>2&&r==="title"?(t=2,n=i):t>3&&/name/i.test(i)?(t=3,n=i):t>4&&/title/i.test(i)&&(t=4,n=i)}l(n)&&(this.name=e[n])};NJ.prototype.configureDescriptionFromProperties=function(e){function t(n){let i='<table class="cesium-infoBox-defaultTable">';for(let r in n)if(n.hasOwnProperty(r)){let o=n[r];l(o)&&(typeof o=="object"?i+=`<tr><td>${r}</td><td>${t(o)}</td></tr>`:i+=`<tr><td>${r}</td><td>${o}</td></tr>`)}return i+="</table>",i}this.description=t(e)};var yp=NJ;function gv(){pe.throwInstantiationError()}Object.defineProperties(gv.prototype,{rectangle:{get:pe.throwInstantiationError},tileWidth:{get:pe.throwInstantiationError},tileHeight:{get:pe.throwInstantiationError},maximumLevel:{get:pe.throwInstantiationError},minimumLevel:{get:pe.throwInstantiationError},tilingScheme:{get:pe.throwInstantiationError},tileDiscardPolicy:{get:pe.throwInstantiationError},errorEvent:{get:pe.throwInstantiationError},credit:{get:pe.throwInstantiationError},proxy:{get:pe.throwInstantiationError},hasAlphaChannel:{get:pe.throwInstantiationError}});gv.prototype.getTileCredits=function(e,t,n){pe.throwInstantiationError()};gv.prototype.requestImage=function(e,t,n,i){pe.throwInstantiationError()};gv.prototype.pickFeatures=function(e,t,n,i,r){pe.throwInstantiationError()};var zit=/\.ktx2$/i;gv.loadImage=function(e,t){let n=De.createIfNeeded(t);return zit.test(n.url)?nf(n):l(e)&&l(e.tileDiscardPolicy)?n.fetchImage({preferBlob:!0,preferImageBitmap:!0,flipY:!0}):n.fetchImage({preferImageBitmap:!0,flipY:!0})};var Ad=gv;var s_e={SATELLITE:1,OCEANS:2,HILLSHADE:3};Object.freeze(s_e);var Ap=s_e;function a_e(e){this.useTiles=e.usePreCachedTilesIfAvailable??!0;let t=e.ellipsoid;this.tilingScheme=e.tilingScheme??new rr({ellipsoid:t}),this.rectangle=e.rectangle??this.tilingScheme.rectangle,this.ellipsoid=t;let n=e.credit;typeof n=="string"&&(n=new It(n)),this.credit=n,this.tileCredits=void 0,this.tileDiscardPolicy=e.tileDiscardPolicy,this.tileWidth=e.tileWidth??256,this.tileHeight=e.tileHeight??256,this.maximumLevel=e.maximumLevel}a_e.prototype.build=function(e){e._useTiles=this.useTiles,e._tilingScheme=this.tilingScheme,e._rectangle=this.rectangle,e._credit=this.credit,e._tileCredits=this.tileCredits,e._tileDiscardPolicy=this.tileDiscardPolicy,e._tileWidth=this.tileWidth,e._tileHeight=this.tileHeight,e._maximumLevel=this.maximumLevel,this.useTiles&&!l(this.tileDiscardPolicy)&&(e._tileDiscardPolicy=new Lz({missingImageUrl:c_e(e,0,0,this.maximumLevel).url,pixelsToCheck:[new U(0,0),new U(200,20),new U(20,200),new U(80,110),new U(160,130)],disableCheckIfAllPixelsAreTransparent:!0}))};function Vit(e,t){let n=e.tileInfo;if(!l(n))t.useTiles=!1;else{if(t.tileWidth=n.rows,t.tileHeight=n.cols,n.spatialReference.wkid===102100||n.spatialReference.wkid===102113)t.tilingScheme=new Bo({ellipsoid:t.ellipsoid});else if(e.tileInfo.spatialReference.wkid===4326)t.tilingScheme=new rr({ellipsoid:t.ellipsoid});else{let i=`Tile spatial reference WKID ${e.tileInfo.spatialReference.wkid} is not supported.`;throw new oe(i)}if(t.maximumLevel=e.tileInfo.lods.length-1,l(e.fullExtent)){if(l(e.fullExtent.spatialReference)&&l(e.fullExtent.spatialReference.wkid))if(e.fullExtent.spatialReference.wkid===102100||e.fullExtent.spatialReference.wkid===102113){let i=new Ti,r=e.fullExtent,o=i.unproject(new h(Math.max(r.xmin,-t.tilingScheme.ellipsoid.maximumRadius*Math.PI),Math.max(r.ymin,-t.tilingScheme.ellipsoid.maximumRadius*Math.PI),0)),s=i.unproject(new h(Math.min(r.xmax,t.tilingScheme.ellipsoid.maximumRadius*Math.PI),Math.min(r.ymax,t.tilingScheme.ellipsoid.maximumRadius*Math.PI),0));t.rectangle=new ie(o.longitude,o.latitude,s.longitude,s.latitude)}else if(e.fullExtent.spatialReference.wkid===4326)t.rectangle=ie.fromDegrees(e.fullExtent.xmin,e.fullExtent.ymin,e.fullExtent.xmax,e.fullExtent.ymax);else{let i=`fullExtent.spatialReference WKID ${e.fullExtent.spatialReference.wkid} is not supported.`;throw new oe(i)}}else t.rectangle=t.tilingScheme.rectangle;t.useTiles=!0}l(e.copyrightText)&&e.copyrightText.length>0&&(l(t.credit)?t.tileCredits=[new It(e.copyrightText)]:t.credit=new It(e.copyrightText))}function jit(e,t){let n=`An error occurred while accessing ${e.url}`;throw l(t)&&l(t.message)&&(n+=`: ${t.message}`),new oe(n)}async function Hit(e,t){let n=e.getDerivedResource({queryParameters:{f:"json"}});try{let i=await n.fetchJson();Vit(i,t)}catch(i){jit(e,i)}}function bp(e){e=e??H.EMPTY_OBJECT,this._defaultAlpha=void 0,this._defaultNightAlpha=void 0,this._defaultDayAlpha=void 0,this._defaultBrightness=void 0,this._defaultContrast=void 0,this._defaultHue=void 0,this._defaultSaturation=void 0,this._defaultGamma=void 0,this._defaultMinificationFilter=void 0,this._defaultMagnificationFilter=void 0,this._tileDiscardPolicy=e.tileDiscardPolicy,this._tileWidth=e.tileWidth??256,this._tileHeight=e.tileHeight??256,this._maximumLevel=e.maximumLevel,this._tilingScheme=e.tilingScheme??new rr({ellipsoid:e.ellipsoid}),this._useTiles=e.usePreCachedTilesIfAvailable??!0,this._rectangle=e.rectangle??this._tilingScheme.rectangle,this._layers=e.layers,this._credit=e.credit,this._tileCredits=void 0,this.enablePickFeatures=e.enablePickFeatures??!0,this._errorEvent=new be}bp.fromBasemapType=async function(e,t){t=t??H.EMPTY_OBJECT;let n,i,r;switch(e){case Ap.SATELLITE:{n=t.token??yd.defaultAccessToken,i=De.createIfNeeded(yd.defaultWorldImageryServer),i.appendForwardSlash();let o=yd.getDefaultTokenCredit(n);l(o)&&(r=It.clone(o))}break;case Ap.OCEANS:{n=t.token??yd.defaultAccessToken,i=De.createIfNeeded(yd.defaultWorldOceanServer),i.appendForwardSlash();let o=yd.getDefaultTokenCredit(n);l(o)&&(r=It.clone(o))}break;case Ap.HILLSHADE:{n=t.token??yd.defaultAccessToken,i=De.createIfNeeded(yd.defaultWorldHillshadeServer),i.appendForwardSlash();let o=yd.getDefaultTokenCredit(n);l(o)&&(r=It.clone(o))}break;default:}return bp.fromUrl(i,{...t,token:n,credit:r,usePreCachedTilesIfAvailable:!0})};function c_e(e,t,n,i,r){let o;if(e._useTiles)o=e._resource.getDerivedResource({url:`tile/${i}/${n}/${t}`,request:r});else{let s=e._tilingScheme.tileXYToNativeRectangle(t,n,i),c={bbox:`${s.west},${s.south},${s.east},${s.north}`,size:`${e._tileWidth},${e._tileHeight}`,format:"png32",transparent:!0,f:"image"};e._tilingScheme.projection instanceof ji?(c.bboxSR=4326,c.imageSR=4326):(c.bboxSR=3857,c.imageSR=3857),e.layers&&(c.layers=`show:${e.layers}`),o=e._resource.getDerivedResource({url:"export",request:r,queryParameters:c})}return o}Object.defineProperties(bp.prototype,{url:{get:function(){return this._resource._url}},token:{get:function(){return this._resource.queryParameters.token}},proxy:{get:function(){return this._resource.proxy}},tileWidth:{get:function(){return this._tileWidth}},tileHeight:{get:function(){return this._tileHeight}},maximumLevel:{get:function(){return this._maximumLevel}},minimumLevel:{get:function(){return 0}},tilingScheme:{get:function(){return this._tilingScheme}},rectangle:{get:function(){return this._rectangle}},tileDiscardPolicy:{get:function(){return this._tileDiscardPolicy}},errorEvent:{get:function(){return this._errorEvent}},credit:{get:function(){return this._credit}},usingPrecachedTiles:{get:function(){return this._useTiles}},hasAlphaChannel:{get:function(){return!0}},layers:{get:function(){return this._layers}}});bp.fromUrl=async function(e,t){t=t??H.EMPTY_OBJECT;let n=De.createIfNeeded(e);n.appendForwardSlash(),l(t.token)&&n.setQueryParameters({token:t.token});let i=new bp(t);i._resource=n;let r=new a_e(t);return(t.usePreCachedTilesIfAvailable??!0)&&await Hit(n,r),r.build(i),i};bp.prototype.getTileCredits=function(e,t,n){return this._tileCredits};bp.prototype.requestImage=function(e,t,n,i){return Ad.loadImage(this,c_e(this,e,t,n,i))};bp.prototype.pickFeatures=function(e,t,n,i,r){if(!this.enablePickFeatures)return;let o=this._tilingScheme.tileXYToNativeRectangle(e,t,n),s,a,c;if(this._tilingScheme.projection instanceof ji)s=P.toDegrees(i),a=P.toDegrees(r),c="4326";else{let p=this._tilingScheme.projection.project(new he(i,r,0));s=p.x,a=p.y,c="3857"}let u="visible";l(this._layers)&&(u+=`:${this._layers}`);let f={f:"json",tolerance:2,geometryType:"esriGeometryPoint",geometry:`${s},${a}`,mapExtent:`${o.west},${o.south},${o.east},${o.north}`,imageDisplay:`${this._tileWidth},${this._tileHeight},96`,sr:c,layers:u};return this._resource.getDerivedResource({url:"identify",queryParameters:f}).fetchJson().then(function(p){let g=[],m=p.results;if(!l(m))return g;for(let y=0;y<m.length;++y){let A=m[y],b=new yp;if(b.data=A,b.name=A.value,b.properties=A.attributes,b.configureDescriptionFromProperties(A.attributes),A.geometryType==="esriGeometryPoint"&&A.geometry){let x=A.geometry.spatialReference&&A.geometry.spatialReference.wkid?A.geometry.spatialReference.wkid:4326;if(x===4326||x===4283)b.position=he.fromDegrees(A.geometry.x,A.geometry.y,A.geometry.z);else if(x===102100||x===900913||x===3857){let T=new Ti;b.position=T.unproject(new h(A.geometry.x,A.geometry.y,A.geometry.z))}}g.push(b)}return g})};bp._metadataCache={};var Py=bp;function Git(e){let t,n=e.name,i=e.message;l(n)&&l(i)?t=`${n}: ${i}`:t=e.toString();let r=e.stack;return l(r)&&(t+=` -${r}`),t}var cg=Git;function Fz(e,t,n,i,r,o,s){this.provider=e,this.message=t,this.x=n,this.y=i,this.level=r,this.timesRetried=o??0,this.retry=!1,this.error=s}Fz.reportError=function(e,t,n,i,r,o,s,a){let c=e;return l(e)?(c.provider=t,c.message=i,c.x=r,c.y=o,c.level=s,c.retry=!1,c.error=a,++c.timesRetried):c=new Fz(t,i,r,o,s,0,a),l(n)&&n.numberOfListeners>0?n.raiseEvent(c):l(t)&&console.log(`An error occurred in "${t.constructor.name}": ${cg(i)}`),c};Fz.reportSuccess=function(e){l(e)&&(e.timesRetried=-1)};var no=Fz;var l_e={AERIAL:"Aerial",AERIAL_WITH_LABELS:"AerialWithLabels",AERIAL_WITH_LABELS_ON_DEMAND:"AerialWithLabelsOnDemand",ROAD:"Road",ROAD_ON_DEMAND:"RoadOnDemand",CANVAS_DARK:"CanvasDark",CANVAS_LIGHT:"CanvasLight",CANVAS_GRAY:"CanvasGray",ORDNANCE_SURVEY:"OrdnanceSurvey",COLLINS_BART:"CollinsBart"};Object.freeze(l_e);var GD=l_e;function WD(e){}WD.prototype.isReady=function(){return!0};WD.prototype.shouldDiscardImage=function(e){return WD.EMPTY_IMAGE===e};var Bz;Object.defineProperties(WD,{EMPTY_IMAGE:{get:function(){return l(Bz)||(Bz=new Image,Bz.src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAQAAAC1HAwCAAAAC0lEQVR42mNkYAAAAAYAAjCB0C8AAAAASUVORK5CYII="),Bz}}});var qD=WD;function u_e(e){this.tileWidth=void 0,this.tileHeight=void 0,this.maximumLevel=void 0,this.imageUrlSubdomains=void 0,this.imageUrlTemplate=void 0,this.attributionList=void 0}u_e.prototype.build=function(e){e._tileWidth=this.tileWidth,e._tileHeight=this.tileHeight,e._maximumLevel=this.maximumLevel,e._imageUrlSubdomains=this.imageUrlSubdomains,e._imageUrlTemplate=this.imageUrlTemplate;let t=e._attributionList=this.attributionList;t||(t=[]),e._attributionList=t;for(let n=0,i=t.length;n<i;++n){let r=t[n];if(r.credit instanceof It)break;r.credit=new It(r.attribution);let o=r.coverageAreas;for(let s=0,a=r.coverageAreas.length;s<a;++s){let c=o[s],u=c.bbox;c.bbox=new ie(P.toRadians(u[1]),P.toRadians(u[0]),P.toRadians(u[3]),P.toRadians(u[2]))}}};function Wit(e,t){if(e.resourceSets.length!==1)throw new oe("metadata does not specify one resource in resourceSets");let n=e.resourceSets[0].resources[0];t.tileWidth=n.imageWidth,t.tileHeight=n.imageHeight,t.maximumLevel=n.zoomMax-1,t.imageUrlSubdomains=n.imageUrlSubdomains,t.imageUrlTemplate=n.imageUrl;let i=n.imageryProviders;l(n.imageryProviders)&&(i=n.imageryProviders.filter(r=>r.coverageAreas?.some(o=>l(o.bbox)))),t.attributionList=i}function qit(e,t,n){let i=`An error occurred while accessing ${e.url}`;throw l(t)&&l(t.message)&&(i+=`: ${t.message}`),no.reportError(void 0,n,l(n)?n._errorEvent:void 0,i,void 0,void 0,void 0,t),new oe(i)}async function Yit(e,t,n){let i=e.url,r=ma._metadataCache[i];l(r)||(r=e.fetchJson(),ma._metadataCache[i]=r);try{let o=await r;return Wit(o,t)}catch(o){qit(e,o,n)}}function ma(e){e=e??H.EMPTY_OBJECT,this._defaultAlpha=void 0,this._defaultNightAlpha=void 0,this._defaultDayAlpha=void 0,this._defaultBrightness=void 0,this._defaultContrast=void 0,this._defaultHue=void 0,this._defaultSaturation=void 0,this._defaultGamma=1,this._defaultMinificationFilter=void 0,this._defaultMagnificationFilter=void 0,this._mapStyle=e.mapStyle??GD.AERIAL,this._mapLayer=e.mapLayer,this._culture=e.culture??"",this._key=e.key,this._tileDiscardPolicy=e.tileDiscardPolicy,l(this._tileDiscardPolicy)||(this._tileDiscardPolicy=new qD),this._proxy=e.proxy,this._credit=new It(`<a href="https://www.microsoft.com/en-us/maps/bing-maps/product"><img src="${ma.logoUrl}" title="Bing Imagery"/></a>`),this._tilingScheme=new Bo({numberOfLevelZeroTilesX:2,numberOfLevelZeroTilesY:2,ellipsoid:e.ellipsoid}),this._tileWidth=void 0,this._tileHeight=void 0,this._maximumLevel=void 0,this._imageUrlTemplate=void 0,this._imageUrlSubdomains=void 0,this._attributionList=void 0,this._errorEvent=new be}Object.defineProperties(ma.prototype,{url:{get:function(){return this._resource.url}},proxy:{get:function(){return this._resource.proxy}},key:{get:function(){return this._key}},mapStyle:{get:function(){return this._mapStyle}},mapLayer:{get:function(){return this._mapLayer}},culture:{get:function(){return this._culture}},tileWidth:{get:function(){return this._tileWidth}},tileHeight:{get:function(){return this._tileHeight}},maximumLevel:{get:function(){return this._maximumLevel}},minimumLevel:{get:function(){return 0}},tilingScheme:{get:function(){return this._tilingScheme}},rectangle:{get:function(){return this._tilingScheme.rectangle}},tileDiscardPolicy:{get:function(){return this._tileDiscardPolicy}},errorEvent:{get:function(){return this._errorEvent}},credit:{get:function(){return this._credit}},hasAlphaChannel:{get:function(){return l(this.mapLayer)}}});ma.fromUrl=async function(e,t){t=t??H.EMPTY_OBJECT;let n=t.tileProtocol;l(n)?n.length>0&&n[n.length-1]===":"&&(n=n.substr(0,n.length-1)):n=document.location.protocol==="http:"?"http":"https";let i=t.mapStyle??GD.AERIAL,r=De.createIfNeeded(e);r.appendForwardSlash();let o={incl:"ImageryProviders",key:t.key,uriScheme:n};l(t.mapLayer)&&(o.mapLayer=t.mapLayer),l(t.culture)&&(o.culture=t.culture);let s=r.getDerivedResource({url:`REST/v1/Imagery/Metadata/${i}`,queryParameters:o}),a=new ma(t);a._resource=r;let c=new u_e(t);return await Yit(s,c),c.build(a),a};var Xit=new ie;ma.prototype.getTileCredits=function(e,t,n){let i=this._tilingScheme.tileXYToRectangle(e,t,n,Xit);return Jit(this._attributionList,n,i)};ma.prototype.requestImage=function(e,t,n,i){let r=Ad.loadImage(this,Kit(this,e,t,n,i));if(l(r))return r.catch(function(o){return l(o.blob)&&o.blob.size===0?qD.EMPTY_IMAGE:Promise.reject(o)})};ma.prototype.pickFeatures=function(e,t,n,i,r){};ma.tileXYToQuadKey=function(e,t,n){let i="";for(let r=n;r>=0;--r){let o=1<<r,s=0;(e&o)!==0&&(s|=1),(t&o)!==0&&(s|=2),i+=s}return i};ma.quadKeyToTileXY=function(e){let t=0,n=0,i=e.length-1;for(let r=i;r>=0;--r){let o=1<<r,s=+e[i-r];(s&1)!==0&&(t|=o),(s&2)!==0&&(n|=o)}return{x:t,y:n,level:i}};ma._logoUrl=void 0;Object.defineProperties(ma,{logoUrl:{get:function(){return l(ma._logoUrl)||(ma._logoUrl=Zt("Assets/Images/bing_maps_credit.png")),ma._logoUrl},set:function(e){ma._logoUrl=e}}});function Kit(e,t,n,i,r){let o=e._imageUrlTemplate,s=e._imageUrlSubdomains,a=(t+n+i)%s.length;return e._resource.getDerivedResource({url:o,request:r,templateValues:{quadkey:ma.tileXYToQuadKey(t,n,i),subdomain:s[a],culture:e._culture},queryParameters:{n:"z"}})}var $it=new ie;function Jit(e,t,n){++t;let i=[];for(let r=0,o=e.length;r<o;++r){let s=e[r],a=s.coverageAreas,c=!1;for(let u=0,f=s.coverageAreas.length;!c&&u<f;++u){let d=a[u];if(t>=d.zoomMin&&t<=d.zoomMax){let p=ie.intersection(n,d.bbox,$it);l(p)&&(c=!0)}}c&&i.push(s.credit)}return i}ma._metadataCache={};var kz=ma;var f_e=/{[^}]+}/g,d_e={x:trt,y:irt,z:srt,s:art,reverseX:nrt,reverseY:rrt,reverseZ:ort,westDegrees:crt,southDegrees:lrt,eastDegrees:urt,northDegrees:frt,westProjected:drt,southProjected:hrt,eastProjected:mrt,northProjected:prt,width:grt,height:_rt},Zit=Mt(d_e,{i:yrt,j:Art,reverseI:brt,reverseJ:xrt,longitudeDegrees:Ert,latitudeDegrees:Crt,longitudeProjected:vrt,latitudeProjected:Srt,format:Irt});function YD(e){e=e??H.EMPTY_OBJECT,this._errorEvent=new be;let t=De.createIfNeeded(e.url),n=De.createIfNeeded(e.pickFeaturesUrl);this._resource=t,this._urlSchemeZeroPadding=e.urlSchemeZeroPadding,this._getFeatureInfoFormats=e.getFeatureInfoFormats,this._pickFeaturesResource=n;let i=e.subdomains;Array.isArray(i)?i=i.slice():l(i)&&i.length>0?i=i.split(""):i=["a","b","c"],this._subdomains=i,this._tileWidth=e.tileWidth??256,this._tileHeight=e.tileHeight??256,this._minimumLevel=e.minimumLevel??0,this._maximumLevel=e.maximumLevel,this._tilingScheme=e.tilingScheme??new Bo({ellipsoid:e.ellipsoid}),this._rectangle=e.rectangle??this._tilingScheme.rectangle,this._rectangle=ie.intersection(this._rectangle,this._tilingScheme.rectangle),this._tileDiscardPolicy=e.tileDiscardPolicy;let r=e.credit;typeof r=="string"&&(r=new It(r)),this._credit=r,this._hasAlphaChannel=e.hasAlphaChannel??!0;let o=e.customTags,s=Mt(d_e,o),a=Mt(Zit,o);this._tags=s,this._pickFeaturesTags=a,this._defaultAlpha=void 0,this._defaultNightAlpha=void 0,this._defaultDayAlpha=void 0,this._defaultBrightness=void 0,this._defaultContrast=void 0,this._defaultHue=void 0,this._defaultSaturation=void 0,this._defaultGamma=void 0,this._defaultMinificationFilter=void 0,this._defaultMagnificationFilter=void 0,this.enablePickFeatures=e.enablePickFeatures??!0}Object.defineProperties(YD.prototype,{url:{get:function(){return this._resource.url}},urlSchemeZeroPadding:{get:function(){return this._urlSchemeZeroPadding}},pickFeaturesUrl:{get:function(){return this._pickFeaturesResource.url}},proxy:{get:function(){return this._resource.proxy}},tileWidth:{get:function(){return this._tileWidth}},tileHeight:{get:function(){return this._tileHeight}},maximumLevel:{get:function(){return this._maximumLevel}},minimumLevel:{get:function(){return this._minimumLevel}},tilingScheme:{get:function(){return this._tilingScheme}},rectangle:{get:function(){return this._rectangle}},tileDiscardPolicy:{get:function(){return this._tileDiscardPolicy}},errorEvent:{get:function(){return this._errorEvent}},credit:{get:function(){return this._credit}},hasAlphaChannel:{get:function(){return this._hasAlphaChannel}}});YD.prototype.getTileCredits=function(e,t,n){};YD.prototype.requestImage=function(e,t,n,i){return Ad.loadImage(this,Qit(this,e,t,n,i))};YD.prototype.pickFeatures=function(e,t,n,i,r){if(!this.enablePickFeatures||!l(this._pickFeaturesResource)||this._getFeatureInfoFormats.length===0)return;let o=0,s=this;function a(u,f){return u.callback(f)}function c(){if(o>=s._getFeatureInfoFormats.length)return Promise.resolve([]);let u=s._getFeatureInfoFormats[o],f=ert(s,e,t,n,i,r,u.format);return++o,u.type==="json"?f.fetchJson().then(u.callback).catch(c):u.type==="xml"?f.fetchXML().then(u.callback).catch(c):u.type==="text"||u.type==="html"?f.fetchText().then(u.callback).catch(c):f.fetch({responseType:u.format}).then(a.bind(void 0,u)).catch(c)}return c()};var Uz=!1,_f=new ie,zz=!1,XD=new ie;function Qit(e,t,n,i,r){Uz=!1,zz=!1;let o=e._resource,s=o.getUrlComponent(!0),a=e._tags,c={},u=s.match(f_e);return l(u)&&u.forEach(function(f){let d=f.substring(1,f.length-1);l(a[d])&&(c[d]=a[d](e,t,n,i))}),o.getDerivedResource({request:r,templateValues:c})}var LJ=!1,yv=new U,FJ=!1;function ert(e,t,n,i,r,o,s){Uz=!1,zz=!1,LJ=!1,FJ=!1;let a=e._pickFeaturesResource,c=a.getUrlComponent(!0),u=e._pickFeaturesTags,f={},d=c.match(f_e);return l(d)&&d.forEach(function(p){let g=p.substring(1,p.length-1);l(u[g])&&(f[g]=u[g](e,t,n,i,r,o,s))}),a.getDerivedResource({templateValues:f})}function Av(e,t,n){if(e&&e.urlSchemeZeroPadding&&e.urlSchemeZeroPadding.hasOwnProperty(t)){let i=e.urlSchemeZeroPadding[t];if(typeof i=="string"){let r=i.length;r>1&&(n=n.length>=r?n:new Array(r-n.toString().length+1).join("0")+n)}}return n}function trt(e,t,n,i){return Av(e,"{x}",t)}function nrt(e,t,n,i){let r=e.tilingScheme.getNumberOfXTilesAtLevel(i)-t-1;return Av(e,"{reverseX}",r)}function irt(e,t,n,i){return Av(e,"{y}",n)}function rrt(e,t,n,i){let r=e.tilingScheme.getNumberOfYTilesAtLevel(i)-n-1;return Av(e,"{reverseY}",r)}function ort(e,t,n,i){let r=e.maximumLevel,o=l(r)&&i<r?r-i-1:i;return Av(e,"{reverseZ}",o)}function srt(e,t,n,i){return Av(e,"{z}",i)}function art(e,t,n,i){let r=(t+n+i)%e._subdomains.length;return e._subdomains[r]}function Vz(e,t,n,i){Uz||(e.tilingScheme.tileXYToRectangle(t,n,i,_f),_f.west=P.toDegrees(_f.west),_f.south=P.toDegrees(_f.south),_f.east=P.toDegrees(_f.east),_f.north=P.toDegrees(_f.north),Uz=!0)}function crt(e,t,n,i){return Vz(e,t,n,i),_f.west}function lrt(e,t,n,i){return Vz(e,t,n,i),_f.south}function urt(e,t,n,i){return Vz(e,t,n,i),_f.east}function frt(e,t,n,i){return Vz(e,t,n,i),_f.north}function jz(e,t,n,i){zz||(e.tilingScheme.tileXYToNativeRectangle(t,n,i,XD),zz=!0)}function drt(e,t,n,i){return jz(e,t,n,i),XD.west}function hrt(e,t,n,i){return jz(e,t,n,i),XD.south}function mrt(e,t,n,i){return jz(e,t,n,i),XD.east}function prt(e,t,n,i){return jz(e,t,n,i),XD.north}function grt(e,t,n,i){return e.tileWidth}function _rt(e,t,n,i){return e.tileHeight}function yrt(e,t,n,i,r,o,s){return Hz(e,t,n,i,r,o),yv.x}function Art(e,t,n,i,r,o,s){return Hz(e,t,n,i,r,o),yv.y}function brt(e,t,n,i,r,o,s){return Hz(e,t,n,i,r,o),e.tileWidth-yv.x-1}function xrt(e,t,n,i,r,o,s){return Hz(e,t,n,i,r,o),e.tileHeight-yv.y-1}var Trt=new ie,_v=new h;function Hz(e,t,n,i,r,o,s){if(LJ)return;BJ(e,t,n,i,r,o);let a=_v,c=e.tilingScheme.tileXYToNativeRectangle(t,n,i,Trt);yv.x=e.tileWidth*(a.x-c.west)/c.width|0,yv.y=e.tileHeight*(c.north-a.y)/c.height|0,LJ=!0}function Ert(e,t,n,i,r,o,s){return P.toDegrees(r)}function Crt(e,t,n,i,r,o,s){return P.toDegrees(o)}function vrt(e,t,n,i,r,o,s){return BJ(e,t,n,i,r,o),_v.x}function Srt(e,t,n,i,r,o,s){return BJ(e,t,n,i,r,o),_v.y}var wrt=new he;function BJ(e,t,n,i,r,o,s){if(!FJ){if(e.tilingScheme.projection instanceof ji)_v.x=P.toDegrees(r),_v.y=P.toDegrees(o);else{let a=wrt;a.longitude=r,a.latitude=o,e.tilingScheme.projection.project(a,_v)}FJ=!0}}function Irt(e,t,n,i,r,o,s){return s}var Rs=YD;function bd(e){Rs.call(this,e)}bd._requestMetadata=async function(e,t,n,i){try{let r=await n.fetchXML();return bd._metadataSuccess(r,e,t,n,i)}catch(r){if(r instanceof O0)return bd._metadataFailure(e,t);throw r}};bd.fromUrl=async function(e,t){let n=De.createIfNeeded(e);n.appendForwardSlash();let i=n,r=n.getDerivedResource({url:"tilemapresource.xml"});t=t??H.EMPTY_OBJECT;let o=await bd._requestMetadata(t,i,r);return new bd(o)};l(Object.create)&&(bd.prototype=Object.create(Rs.prototype),bd.prototype.constructor=bd);function h_e(e,t){return e.west<t.rectangle.west&&(e.west=t.rectangle.west),e.east>t.rectangle.east&&(e.east=t.rectangle.east),e.south<t.rectangle.south&&(e.south=t.rectangle.south),e.north>t.rectangle.north&&(e.north=t.rectangle.north),e}function m_e(e,t,n){let i=e.positionToTileXY(ie.southwest(t),n),r=e.positionToTileXY(ie.northeast(t),n);return(Math.abs(r.x-i.x)+1)*(Math.abs(r.y-i.y)+1)>4?0:n}bd._metadataSuccess=function(e,t,n,i,r){let o=/tileformat/i,s=/tileset/i,a=/tilesets/i,c=/boundingbox/i,u,f,d,p=[],g=e.childNodes[0].childNodes;for(let R=0;R<g.length;R++)if(o.test(g.item(R).nodeName))u=g.item(R);else if(a.test(g.item(R).nodeName)){d=g.item(R);let O=g.item(R).childNodes;for(let L=0;L<O.length;L++)s.test(O.item(L).nodeName)&&p.push(O.item(L))}else c.test(g.item(R).nodeName)&&(f=g.item(R));let m;if(!l(d)||!l(f))throw m=`Unable to find expected tilesets or bbox attributes in ${i.url}.`,l(r)&&no.reportError(void 0,r,r.errorEvent,m),new oe(m);let y=t.fileExtension??u.getAttribute("extension"),A=t.tileWidth??parseInt(u.getAttribute("width"),10),b=t.tileHeight??parseInt(u.getAttribute("height"),10),x=t.minimumLevel??parseInt(p[0].getAttribute("order"),10),T=t.maximumLevel??parseInt(p[p.length-1].getAttribute("order"),10),E=d.getAttribute("profile"),v=t.tilingScheme;if(!l(v))if(E==="geodetic"||E==="global-geodetic")v=new rr({ellipsoid:t.ellipsoid});else if(E==="mercator"||E==="global-mercator")v=new Bo({ellipsoid:t.ellipsoid});else throw m=`${i.url} specifies an unsupported profile attribute, ${E}.`,l(r)&&no.reportError(void 0,r,r.errorEvent,m),new oe(m);let S=ie.clone(t.rectangle);if(!l(S)){let R,O,L,_;t.flipXY??!1?(L=new U(parseFloat(f.getAttribute("miny")),parseFloat(f.getAttribute("minx"))),_=new U(parseFloat(f.getAttribute("maxy")),parseFloat(f.getAttribute("maxx")))):(L=new U(parseFloat(f.getAttribute("minx")),parseFloat(f.getAttribute("miny"))),_=new U(parseFloat(f.getAttribute("maxx")),parseFloat(f.getAttribute("maxy"))));let w=E==="geodetic"||E==="mercator";if(v.projection instanceof ji||w)R=he.fromDegrees(L.x,L.y),O=he.fromDegrees(_.x,_.y);else{let D=v.projection;R=D.unproject(L),O=D.unproject(_)}S=new ie(R.longitude,R.latitude,O.longitude,O.latitude)}return S=h_e(S,v),x=m_e(v,S,x),{url:n.getDerivedResource({url:`{z}/{x}/{reverseY}.${y}`}),tilingScheme:v,rectangle:S,tileWidth:A,tileHeight:b,minimumLevel:x,maximumLevel:T,tileDiscardPolicy:t.tileDiscardPolicy,credit:t.credit}};bd._metadataFailure=function(e,t){let n=e.fileExtension??"png",i=e.tileWidth??256,r=e.tileHeight??256,o=e.maximumLevel,s=l(e.tilingScheme)?e.tilingScheme:new Bo({ellipsoid:e.ellipsoid}),a=e.rectangle??s.rectangle;a=h_e(a,s);let c=m_e(s,a,e.minimumLevel);return{url:t.getDerivedResource({url:`{z}/{x}/{reverseY}.${n}`}),tilingScheme:s,rectangle:a,tileWidth:i,tileHeight:r,minimumLevel:c,maximumLevel:o,tileDiscardPolicy:e.tileDiscardPolicy,credit:e.credit}};var gx=bd;function p_e(e){this.channel=e.channel,this.ellipsoid=e.ellipsoid,this.tilingScheme=void 0,this.version=void 0}p_e.prototype.build=function(e){e._channel=this.channel,e._version=this.version,e._tilingScheme=this.tilingScheme};function Prt(e,t){let n;try{n=JSON.parse(e)}catch{n=JSON.parse(e.replace(/([\[\{,])[\n\r ]*([A-Za-z0-9]+)[\n\r ]*:/g,'$1"$2":'))}let i;for(let r=0;r<n.layers.length;r++)if(n.layers[r].id===t.channel){i=n.layers[r];break}if(!l(i)){let r=`Could not find layer with channel (id) of ${t.channel}.`;throw new oe(r)}if(!l(i.version)){let r=`Could not find a version in channel (id) ${t.channel}.`;throw new oe(r)}if(t.version=i.version,l(n.projection)&&n.projection==="flat")t.tilingScheme=new rr({numberOfLevelZeroTilesX:2,numberOfLevelZeroTilesY:2,rectangle:new ie(-Math.PI,-Math.PI,Math.PI,Math.PI),ellipsoid:t.ellipsoid});else if(!l(n.projection)||n.projection==="mercator")t.tilingScheme=new Bo({numberOfLevelZeroTilesX:2,numberOfLevelZeroTilesY:2,ellipsoid:t.ellipsoid});else{let r=`Unsupported projection ${n.projection}.`;throw new oe(r)}return!0}function Drt(e,t,n){let i=`An error occurred while accessing ${t.url}.`;throw l(e)&&l(e.message)&&(i+=`: ${e.message}`),no.reportError(void 0,n,l(n)?n._errorEvent:void 0,i),new oe(i)}async function Rrt(e,t,n){try{let i=await e.fetchText();Prt(i,t)}catch(i){Drt(i,e,n)}}function Pu(e){e=e??{},this._defaultAlpha=void 0,this._defaultNightAlpha=void 0,this._defaultDayAlpha=void 0,this._defaultBrightness=void 0,this._defaultContrast=void 0,this._defaultHue=void 0,this._defaultSaturation=void 0,this._defaultGamma=1.9,this._defaultMinificationFilter=void 0,this._defaultMagnificationFilter=void 0,this._tileDiscardPolicy=e.tileDiscardPolicy,this._channel=e.channel,this._requestType="ImageryMaps",this._credit=new It(`<a href="http://www.google.com/enterprise/mapsearth/products/earthenterprise.html"><img src="${Pu.logoUrl}" title="Google Imagery"/></a>`),this._tilingScheme=void 0,this._version=void 0,this._tileWidth=256,this._tileHeight=256,this._maximumLevel=e.maximumLevel,this._errorEvent=new be}Object.defineProperties(Pu.prototype,{url:{get:function(){return this._url}},path:{get:function(){return this._path}},proxy:{get:function(){return this._resource.proxy}},channel:{get:function(){return this._channel}},tileWidth:{get:function(){return this._tileWidth}},tileHeight:{get:function(){return this._tileHeight}},maximumLevel:{get:function(){return this._maximumLevel}},minimumLevel:{get:function(){return 0}},tilingScheme:{get:function(){return this._tilingScheme}},version:{get:function(){return this._version}},requestType:{get:function(){return this._requestType}},rectangle:{get:function(){return this._tilingScheme.rectangle}},tileDiscardPolicy:{get:function(){return this._tileDiscardPolicy}},errorEvent:{get:function(){return this._errorEvent}},credit:{get:function(){return this._credit}},hasAlphaChannel:{get:function(){return!0}}});Pu.fromUrl=async function(e,t,n){n=n??{};let i=n.path??"/default_map",r=De.createIfNeeded(e).getDerivedResource({url:i[0]==="/"?i.substring(1):i});r.appendForwardSlash();let o=r.getDerivedResource({url:"query",queryParameters:{request:"Json",vars:"geeServerDefs",is2d:"t"}}),s=new p_e(n);s.channel=t,await Rrt(o,s);let a=new Pu(n);return s.build(a),a._resource=r,a._url=e,a._path=i,a};Pu.prototype.getTileCredits=function(e,t,n){};Pu.prototype.requestImage=function(e,t,n,i){let r=this._resource.getDerivedResource({url:"query",request:i,queryParameters:{request:this._requestType,channel:this._channel,version:this._version,x:e,y:t,z:n+1}});return Ad.loadImage(this,r)};Pu.prototype.pickFeatures=function(e,t,n,i,r){};Pu._logoUrl=void 0;Object.defineProperties(Pu,{logoUrl:{get:function(){return l(Pu._logoUrl)||(Pu._logoUrl=Zt("Assets/Images/google_earth_credit.png")),Pu._logoUrl},set:function(e){Pu._logoUrl=e}}});var Gz=Pu;var Ort=/\/$/,g_e=new It('© <a href="https://www.mapbox.com/about/maps/">Mapbox</a> © <a href="http://www.openstreetmap.org/copyright">OpenStreetMap</a> <strong><a href="https://www.mapbox.com/map-feedback/">Improve this map</a></strong>');function bv(e){e=e??H.EMPTY_OBJECT;let t=e.mapId,n=e.accessToken;this._defaultAlpha=void 0,this._defaultNightAlpha=void 0,this._defaultDayAlpha=void 0,this._defaultBrightness=void 0,this._defaultContrast=void 0,this._defaultHue=void 0,this._defaultSaturation=void 0,this._defaultGamma=void 0,this._defaultMinificationFilter=void 0,this._defaultMagnificationFilter=void 0;let i=De.createIfNeeded(e.url??"https://{s}.tiles.mapbox.com/v4/");this._mapId=t,this._accessToken=n;let r=e.format??"png";/\./.test(r)||(r=`.${r}`),this._format=r;let o=i.getUrlComponent();Ort.test(o)||(o+="/"),o+=`${t}/{z}/{x}/{y}${this._format}`,i.url=o,i.setQueryParameters({access_token:n});let s;l(e.credit)?(s=e.credit,typeof s=="string"&&(s=new It(s))):s=g_e,this._resource=i,this._imageryProvider=new Rs({url:i,credit:s,ellipsoid:e.ellipsoid,minimumLevel:e.minimumLevel,maximumLevel:e.maximumLevel,rectangle:e.rectangle})}Object.defineProperties(bv.prototype,{url:{get:function(){return this._imageryProvider.url}},rectangle:{get:function(){return this._imageryProvider.rectangle}},tileWidth:{get:function(){return this._imageryProvider.tileWidth}},tileHeight:{get:function(){return this._imageryProvider.tileHeight}},maximumLevel:{get:function(){return this._imageryProvider.maximumLevel}},minimumLevel:{get:function(){return this._imageryProvider.minimumLevel}},tilingScheme:{get:function(){return this._imageryProvider.tilingScheme}},tileDiscardPolicy:{get:function(){return this._imageryProvider.tileDiscardPolicy}},errorEvent:{get:function(){return this._imageryProvider.errorEvent}},credit:{get:function(){return this._imageryProvider.credit}},proxy:{get:function(){return this._imageryProvider.proxy}},hasAlphaChannel:{get:function(){return this._imageryProvider.hasAlphaChannel}}});bv.prototype.getTileCredits=function(e,t,n){};bv.prototype.requestImage=function(e,t,n,i){return this._imageryProvider.requestImage(e,t,n,i)};bv.prototype.pickFeatures=function(e,t,n,i,r){return this._imageryProvider.pickFeatures(e,t,n,i,r)};bv._defaultCredit=g_e;var Wz=bv;function _x(e){e=e??H.EMPTY_OBJECT,this._defaultAlpha=void 0,this._defaultNightAlpha=void 0,this._defaultDayAlpha=void 0,this._defaultBrightness=void 0,this._defaultContrast=void 0,this._defaultHue=void 0,this._defaultSaturation=void 0,this._defaultGamma=void 0,this._defaultMinificationFilter=void 0,this._defaultMagnificationFilter=void 0;let t=e.rectangle??ie.MAX_VALUE,n=new rr({rectangle:t,numberOfLevelZeroTilesX:1,numberOfLevelZeroTilesY:1,ellipsoid:e.ellipsoid});this._tilingScheme=n,this._image=void 0,this._texture=void 0,this._hasError=!1,this._errorEvent=new be;let i=e.credit;typeof i=="string"&&(i=new It(i)),this._credit=i;let r=De.createIfNeeded(e.url);this._resource=r,this._tileWidth=e.tileWidth,this._tileHeight=e.tileHeight}Object.defineProperties(_x.prototype,{url:{get:function(){return this._resource.url}},proxy:{get:function(){return this._resource.proxy}},tileWidth:{get:function(){return this._tileWidth}},tileHeight:{get:function(){return this._tileHeight}},maximumLevel:{get:function(){return 0}},minimumLevel:{get:function(){return 0}},tilingScheme:{get:function(){return this._tilingScheme}},rectangle:{get:function(){return this._tilingScheme.rectangle}},tileDiscardPolicy:{get:function(){}},errorEvent:{get:function(){return this._errorEvent}},credit:{get:function(){return this._credit}},hasAlphaChannel:{get:function(){return!0}}});function Mrt(e,t,n,i){let r=`Failed to load image ${e.url}`;l(t)&&l(t.message)&&(r+=`: ${t.message}`);let o=no.reportError(i,n,l(n)?n._errorEvent:void 0,r,0,0,0,t);if(o.retry)return kJ(e,n,o);throw l(n)&&(n._hasError=!0),new oe(r)}async function kJ(e,t,n){try{return await Ad.loadImage(null,e)}catch(i){return Mrt(e,i,t,n)}}_x.fromUrl=async function(e,t){let n=De.createIfNeeded(e),i=await kJ(n);t=t??H.EMPTY_OBJECT;let r=new _x({...t,url:e,tileWidth:i.width,tileHeight:i.height});return r._image=i,r};_x.prototype.getTileCredits=function(e,t,n){};_x.prototype.requestImage=async function(e,t,n,i){if(!this._hasError&&!l(this._image)){let r=await kJ(this._resource,this);return this._image=r,no.reportSuccess(this._errorEvent),r}return this._image};_x.prototype.pickFeatures=function(e,t,n,i,r){};var qz=_x;function Nrt(e,t,n){this.type=e,l(t)||(e==="json"?t="application/json":e==="xml"?t="text/xml":e==="html"?t="text/html":e==="text"&&(t="text/plain")),this.format=t,l(n)||(e==="json"?n=Lrt:e==="xml"?n=Urt:(e==="html"||e==="text")&&(n=__e)),this.callback=n}function Lrt(e){let t=[],n=e.features;for(let i=0;i<n.length;++i){let r=n[i],o=new yp;if(o.data=r,o.properties=r.properties,o.configureNameFromProperties(r.properties),o.configureDescriptionFromProperties(r.properties),l(r.geometry)&&r.geometry.type==="Point"){let s=r.geometry.coordinates[0],a=r.geometry.coordinates[1];o.position=he.fromDegrees(s,a)}t.push(o)}return t}var UJ="http://www.mapinfo.com/mxp",Frt="http://www.esri.com/wms",Brt="http://www.opengis.net/wfs",krt="http://www.opengis.net/gml";function Urt(e){let t=e.documentElement;if(t.localName==="MultiFeatureCollection"&&t.namespaceURI===UJ)return zrt(e);if(t.localName==="FeatureInfoResponse"&&t.namespaceURI===Frt)return Vrt(e);if(t.localName==="FeatureCollection"&&t.namespaceURI===Brt)return jrt(e);if(t.localName==="ServiceExceptionReport")throw new oe(new XMLSerializer().serializeToString(t));return t.localName==="msGMLOutput"?Hrt(e):Grt(e)}function zrt(e){let t=[],i=e.documentElement.getElementsByTagNameNS(UJ,"Feature");for(let r=0;r<i.length;++r){let o=i[r],s={},a=o.getElementsByTagNameNS(UJ,"Val");for(let u=0;u<a.length;++u){let f=a[u];if(f.hasAttribute("ref")){let d=f.getAttribute("ref"),p=f.textContent.trim();s[d]=p}}let c=new yp;c.data=o,c.properties=s,c.configureNameFromProperties(s),c.configureDescriptionFromProperties(s),t.push(c)}return t}function Vrt(e){let t=e.documentElement,n=[],i,r=t.getElementsByTagNameNS("*","FIELDS");if(r.length>0)for(let o=0;o<r.length;++o){let s=r[o];i={};let a=s.attributes;for(let c=0;c<a.length;++c){let u=a[c];i[u.name]=u.value}n.push(Yz(s,i))}else{let o=t.getElementsByTagNameNS("*","FeatureInfo");for(let s=0;s<o.length;++s){let a=o[s];i={};let c=a.childNodes;for(let u=0;u<c.length;++u){let f=c[u];f.nodeType===Node.ELEMENT_NODE&&(i[f.localName]=f.textContent)}n.push(Yz(a,i))}}return n}function jrt(e){let t=[],i=e.documentElement.getElementsByTagNameNS(krt,"featureMember");for(let r=0;r<i.length;++r){let o=i[r],s={};zJ(o,s),t.push(Yz(o,s))}return t}function Hrt(e){let t=[],n,i=e.documentElement.childNodes;for(let o=0;o<i.length;o++)if(i[o].nodeType===Node.ELEMENT_NODE){n=i[o];break}if(!l(n))throw new oe("Unable to find first child of the feature info xml document");let r=n.childNodes;for(let o=0;o<r.length;++o){let s=r[o];if(s.nodeType===Node.ELEMENT_NODE){let a={};zJ(s,a),t.push(Yz(s,a))}}return t}function zJ(e,t){let n=!0;for(let i=0;i<e.childNodes.length;++i){let r=e.childNodes[i];r.nodeType===Node.ELEMENT_NODE&&(n=!1),!(r.localName==="Point"||r.localName==="LineString"||r.localName==="Polygon"||r.localName==="boundedBy")&&r.hasChildNodes()&&zJ(r,t)&&(t[r.localName]=r.textContent)}return n}function Yz(e,t){let n=new yp;return n.data=e,n.properties=t,n.configureNameFromProperties(t),n.configureDescriptionFromProperties(t),n}function Grt(e){let t=new XMLSerializer().serializeToString(e),n=document.createElement("div"),i=document.createElement("pre");i.textContent=t,n.appendChild(i);let r=new yp;return r.data=e,r.description=n.innerHTML,[r]}var Wrt=/<body>\s*<\/body>/im,qrt=/<ServiceExceptionReport([\s\S]*)<\/ServiceExceptionReport>/im,Yrt=/<title>([\s\S]*)<\/title>/im;function __e(e){if(Wrt.test(e)||qrt.test(e))return;let t,n=Yrt.exec(e);n&&n.length>1&&(t=n[1]);let i=new yp;return i.name=t,i.description=e,i.data=e,[i]}var xp=Nrt;function KD(e){e=e??H.EMPTY_OBJECT,this._tileCache={},this._tilesRequestedForInterval=[];let t=this._clock=e.clock;this._times=e.times,this._requestImageFunction=e.requestImageFunction,this._reloadFunction=e.reloadFunction,this._currentIntervalIndex=-1,t.onTick.addEventListener(this._clockOnTick,this),this._clockOnTick(t)}Object.defineProperties(KD.prototype,{clock:{get:function(){return this._clock},set:function(e){this._clock!==e&&(this._clock=e,this._clockOnTick(e),this._reloadFunction())}},times:{get:function(){return this._times},set:function(e){this._times!==e&&(this._times=e,this._clockOnTick(this._clock),this._reloadFunction())}},currentInterval:{get:function(){return this._times.get(this._currentIntervalIndex)}}});KD.prototype.getFromCache=function(e,t,n,i){let r=y_e(e,t,n),o,s=this._tileCache[this._currentIntervalIndex];if(l(s)&&l(s[r])){let a=s[r];o=a.promise.catch(function(c){throw i.state=a.request.state,c}),delete s[r]}return o};KD.prototype.checkApproachingInterval=function(e,t,n,i){let r=y_e(e,t,n),o=this._tilesRequestedForInterval,s=A_e(this),a={key:r,priorityFunction:i.priorityFunction};(!l(s)||!b_e(this,a,s))&&o.push(a),o.length>=512&&o.splice(0,256)};KD.prototype._clockOnTick=function(e){let t=e.currentTime,i=this._times.indexOf(t),r=this._currentIntervalIndex;if(i!==r){let s=this._tileCache[r];for(let a in s)s.hasOwnProperty(a)&&s[a].request.cancel();delete this._tileCache[r],this._tilesRequestedForInterval=[],this._currentIntervalIndex=i,this._reloadFunction();return}let o=A_e(this);if(l(o)){let s=this._tilesRequestedForInterval,a=!0;for(;a&&s.length!==0;){let c=s.pop();a=b_e(this,c,o),a||s.push(c)}}};function y_e(e,t,n){return`${e}-${t}-${n}`}function Xrt(e){let t=e.split("-");if(t.length===3)return{x:Number(t[0]),y:Number(t[1]),level:Number(t[2])}}function A_e(e){let t=e._times;if(!l(t))return;let n=e._clock,i=n.currentTime,r=n.canAnimate&&n.shouldAnimate,o=n.multiplier;if(!r&&o!==0)return;let s,a=t.indexOf(i);if(a<0)return;let c=t.get(a);return o>0?(s=K.secondsDifference(c.stop,i),++a):(s=K.secondsDifference(c.start,i),--a),s/=o,a>=0&&s<=5?t.get(a):void 0}function b_e(e,t,n){let i=e._times.indexOf(n.start),r=e._tileCache,o=r[i];l(o)||(o=r[i]={});let s=t.key;if(l(o[s]))return!0;let a=Xrt(s),c=new Oo({throttle:!1,throttleByServer:!0,type:oa.IMAGERY,priorityFunction:t.priorityFunction}),u=e._requestImageFunction(a.x,a.y,a.level,c,n);return l(u)?(o[s]={promise:u,request:c},!0):!1}var xv=KD;var Krt=[3034,3035,3042,3043,3044],$rt=[4471,4559];function Nh(e){if(e=e??H.EMPTY_OBJECT,l(e.times)&&!l(e.clock))throw new pe("options.times was specified, so options.clock is required.");this._defaultAlpha=void 0,this._defaultNightAlpha=void 0,this._defaultDayAlpha=void 0,this._defaultBrightness=void 0,this._defaultContrast=void 0,this._defaultHue=void 0,this._defaultSaturation=void 0,this._defaultGamma=void 0,this._defaultMinificationFilter=void 0,this._defaultMagnificationFilter=void 0,this._getFeatureInfoUrl=e.getFeatureInfoUrl??e.url;let t=De.createIfNeeded(e.url),n=De.createIfNeeded(this._getFeatureInfoUrl);t.setQueryParameters(Nh.DefaultParameters,!0),n.setQueryParameters(Nh.GetFeatureInfoDefaultParameters,!0),l(e.parameters)&&t.setQueryParameters(x_e(e.parameters)),l(e.getFeatureInfoParameters)&&n.setQueryParameters(x_e(e.getFeatureInfoParameters));let i=this;this._reload=void 0,l(e.times)&&(this._timeDynamicImagery=new xv({clock:e.clock,times:e.times,requestImageFunction:function(s,a,c,u,f){return T_e(i,s,a,c,u,f)},reloadFunction:function(){l(i._reload)&&i._reload()}}));let r={};if(r.layers=e.layers,r.bbox="{westProjected},{southProjected},{eastProjected},{northProjected}",r.width="{width}",r.height="{height}",parseFloat(t.queryParameters.version)>=1.3){r.crs=e.crs??(e.tilingScheme&&e.tilingScheme.projection instanceof Ti?"EPSG:3857":"CRS:84");let s=r.crs.split(":");if(s[0]==="EPSG"&&s.length===2){let a=Number(s[1]);(a>=4e3&&a<5e3&&!$rt.includes(a)||Krt.includes(a))&&(r.bbox="{southProjected},{westProjected},{northProjected},{eastProjected}")}}else r.srs=e.srs??(e.tilingScheme&&e.tilingScheme.projection instanceof Ti?"EPSG:3857":"EPSG:4326");t.setQueryParameters(r,!0),n.setQueryParameters(r,!0);let o={query_layers:e.layers,info_format:"{format}"};parseFloat(n.queryParameters.version)>=1.3?(o.i="{i}",o.j="{j}"):(o.x="{i}",o.y="{j}"),n.setQueryParameters(o,!0),this._resource=t,this._pickFeaturesResource=n,this._layers=e.layers,this._tileProvider=new Rs({url:t,pickFeaturesUrl:n,tilingScheme:e.tilingScheme??new rr({ellipsoid:e.ellipsoid}),rectangle:e.rectangle,tileWidth:e.tileWidth,tileHeight:e.tileHeight,minimumLevel:e.minimumLevel,maximumLevel:e.maximumLevel,subdomains:e.subdomains,tileDiscardPolicy:e.tileDiscardPolicy,credit:e.credit,getFeatureInfoFormats:e.getFeatureInfoFormats??Nh.DefaultGetFeatureInfoFormats,enablePickFeatures:e.enablePickFeatures})}function T_e(e,t,n,i,r,o){let s=l(o)?o.data:void 0,a=e._tileProvider;return l(s)&&a._resource.setQueryParameters(s),a.requestImage(t,n,i,r)}function Jrt(e,t,n,i,r,o,s){let a=l(s)?s.data:void 0,c=e._tileProvider;return l(a)&&c._pickFeaturesResource.setQueryParameters(a),c.pickFeatures(t,n,i,r,o)}Object.defineProperties(Nh.prototype,{url:{get:function(){return this._resource._url}},proxy:{get:function(){return this._resource.proxy}},layers:{get:function(){return this._layers}},tileWidth:{get:function(){return this._tileProvider.tileWidth}},tileHeight:{get:function(){return this._tileProvider.tileHeight}},maximumLevel:{get:function(){return this._tileProvider.maximumLevel}},minimumLevel:{get:function(){return this._tileProvider.minimumLevel}},tilingScheme:{get:function(){return this._tileProvider.tilingScheme}},rectangle:{get:function(){return this._tileProvider.rectangle}},tileDiscardPolicy:{get:function(){return this._tileProvider.tileDiscardPolicy}},errorEvent:{get:function(){return this._tileProvider.errorEvent}},credit:{get:function(){return this._tileProvider.credit}},hasAlphaChannel:{get:function(){return this._tileProvider.hasAlphaChannel}},enablePickFeatures:{get:function(){return this._tileProvider.enablePickFeatures},set:function(e){this._tileProvider.enablePickFeatures=e}},clock:{get:function(){return this._timeDynamicImagery.clock},set:function(e){this._timeDynamicImagery.clock=e}},times:{get:function(){return this._timeDynamicImagery.times},set:function(e){this._timeDynamicImagery.times=e}},getFeatureInfoUrl:{get:function(){return this._getFeatureInfoUrl}}});Nh.prototype.getTileCredits=function(e,t,n){return this._tileProvider.getTileCredits(e,t,n)};Nh.prototype.requestImage=function(e,t,n,i){let r,o=this._timeDynamicImagery,s;return l(o)&&(s=o.currentInterval,r=o.getFromCache(e,t,n,i)),l(r)||(r=T_e(this,e,t,n,i,s)),l(r)&&l(o)&&o.checkApproachingInterval(e,t,n,i),r};Nh.prototype.pickFeatures=function(e,t,n,i,r){let o=this._timeDynamicImagery,s=l(o)?o.currentInterval:void 0;return Jrt(this,e,t,n,i,r,s)};Nh.DefaultParameters=Object.freeze({service:"WMS",version:"1.1.1",request:"GetMap",styles:"",format:"image/jpeg"});Nh.GetFeatureInfoDefaultParameters=Object.freeze({service:"WMS",version:"1.1.1",request:"GetFeatureInfo"});Nh.DefaultGetFeatureInfoFormats=Object.freeze([Object.freeze(new xp("json","application/json")),Object.freeze(new xp("xml","text/xml")),Object.freeze(new xp("text","text/html"))]);function x_e(e){let t={};for(let n in e)e.hasOwnProperty(n)&&(t[n.toLowerCase()]=e[n]);return t}var Xz=Nh;function yf(e){e=e??H.EMPTY_OBJECT,this._defaultAlpha=void 0,this._defaultNightAlpha=void 0,this._defaultDayAlpha=void 0,this._defaultBrightness=void 0,this._defaultContrast=void 0,this._defaultHue=void 0,this._defaultSaturation=void 0,this._defaultGamma=void 0,this._defaultMinificationFilter=void 0,this._defaultMagnificationFilter=void 0,this._getFeatureInfoUrl=e.getFeatureInfoUrl??e.url;let t=De.createIfNeeded(e.url),n=De.createIfNeeded(this._getFeatureInfoUrl),i=e.style,r=e.tileMatrixSetID,o=t.url,s=e.format??"image/jpeg",a=o.match(/{/g);if(!l(a)||a.length===1&&/{s}/.test(o)?(t.setQueryParameters(yf.DefaultParameters,!0),this._useKvp=!0):(t.setTemplateValues(yf.DefaultParameters,!0),this._useKvp=!1),this._useKvp){n.setQueryParameters(yf.GetFeatureInfoDefaultParameters,!0),l(e.getFeatureInfoParameters)&&n.setQueryParameters(E_e(e.getFeatureInfoParameters));let f={infoformat:"{format}",i:"{i}",j:"{j}"};n.setQueryParameters(f,!0)}else n.setTemplateValues(yf.GetFeatureInfoDefaultParameters,!0),l(e.getFeatureInfoParameters)&&n.setTemplateValues(E_e(e.getFeatureInfoParameters));this._resource=t,this._tileMatrixLabels=e.tileMatrixLabels,this._format=s,this._dimensions=e.dimensions,this._tilematrixset=r;let c={};c.tilematrix="{TileMatrix}",c.layer=e.layer,c.style=i,c.tilerow="{TileRow}",c.tilecol="{TileCol}",c.tilematrixset=r,this._useKvp?(t.setQueryParameters(c,!0),t.setQueryParameters({format:s},!0),n.setQueryParameters({format:s},!0),n.setQueryParameters(c,!0)):(c.Style=i,t.setTemplateValues(c),t.setTemplateValues({format:s}),n.setTemplateValues(c));let u=this;this._reload=void 0,l(e.times)&&(this._timeDynamicImagery=new xv({clock:e.clock,times:e.times,requestImageFunction:function(f,d,p,g,m){return C_e(u,f,d,p,g,m)},reloadFunction:function(){l(u._reload)&&u._reload()}})),this._errorEvent=new be,this._tileProvider=new Rs({url:t,pickFeaturesUrl:n,tilingScheme:e.tilingScheme??new Bo({ellipsoid:e.ellipsoid}),rectangle:e.rectangle,tileWidth:e.tileWidth,tileHeight:e.tileHeight,minimumLevel:e.minimumLevel,maximumLevel:e.maximumLevel,subdomains:e.subdomains,tileDiscardPolicy:e.tileDiscardPolicy,credit:e.credit,getFeatureInfoFormats:e.getFeatureInfoFormats??yf.DefaultGetFeatureInfoFormats,enablePickFeatures:e.enablePickFeatures??(this._useKvp||l(e.getFeatureInfoUrl)),customTags:Qrt(this)})}function C_e(e,t,n,i,r,o){let s=e._tileProvider;return v_e(e,s._resource,o),s.requestImage(t,n,i,r)}function Zrt(e,t,n,i,r,o,s){let a=e._tileProvider;return v_e(e,a._pickFeaturesResource,s),a.pickFeatures(t,n,i,r,o)}Object.defineProperties(yf.prototype,{url:{get:function(){return this._resource.url}},proxy:{get:function(){return this._resource.proxy}},tileWidth:{get:function(){return this._tileProvider.tileWidth}},tileHeight:{get:function(){return this._tileProvider.tileHeight}},maximumLevel:{get:function(){return this._tileProvider.maximumLevel}},minimumLevel:{get:function(){return this._tileProvider.minimumLevel}},tilingScheme:{get:function(){return this._tileProvider.tilingScheme}},rectangle:{get:function(){return this._tileProvider.rectangle}},tileDiscardPolicy:{get:function(){return this._tileProvider.tileDiscardPolicy}},errorEvent:{get:function(){return this._tileProvider.errorEvent}},format:{get:function(){return this._format}},credit:{get:function(){return this._tileProvider.credit}},hasAlphaChannel:{get:function(){return!0}},enablePickFeatures:{get:function(){return this._tileProvider.enablePickFeatures},set:function(e){this._tileProvider.enablePickFeatures=e}},clock:{get:function(){return this._timeDynamicImagery.clock},set:function(e){this._timeDynamicImagery.clock=e}},times:{get:function(){return this._timeDynamicImagery.times},set:function(e){this._timeDynamicImagery.times=e}},dimensions:{get:function(){return this._dimensions},set:function(e){this._dimensions!==e&&(this._dimensions=e,l(this._reload)&&this._reload())}},getFeatureInfoUrl:{get:function(){return this._getFeatureInfoUrl}}});yf.prototype.getTileCredits=function(e,t,n){return this._tileProvider.getTileCredits(e,t,n)};yf.prototype.requestImage=function(e,t,n,i){let r,o=this._timeDynamicImagery,s;return l(o)&&(s=o.currentInterval,r=o.getFromCache(e,t,n,i)),l(r)||(r=C_e(this,e,t,n,i,s)),l(r)&&l(o)&&o.checkApproachingInterval(e,t,n,i),r};yf.prototype.pickFeatures=function(e,t,n,i,r){let o=this._timeDynamicImagery,s=l(o)?o.currentInterval:void 0;return Zrt(this,e,t,n,i,r,s)};yf.DefaultParameters=Object.freeze({service:"WMTS",version:"1.0.0",request:"GetTile"});yf.GetFeatureInfoDefaultParameters=Object.freeze({service:"WMTS",version:"1.0.0",request:"GetFeatureInfo"});yf.DefaultGetFeatureInfoFormats=Object.freeze([Object.freeze(new xp("json","application/json")),Object.freeze(new xp("xml","text/xml")),Object.freeze(new xp("text","text/html"))]);function v_e(e,t,n){let i=e._dimensions,r=l(n)?n.data:void 0;if(!e._useKvp)l(i)&&t.setTemplateValues(i),l(r)&&t.setTemplateValues(r);else{let o={};l(i)&&(o=Mt(o,i)),l(r)&&(o=Mt(o,r)),t.setQueryParameters(o)}}function Qrt(e){function t(n){let i=e._tileMatrixLabels;return l(i)?i[n]:n.toString()}return{TileMatrix:function(n,i,r,o){return t(o)},tilematrix:function(n,i,r,o){return t(o)},TileRow:function(n,i,r){return r.toString()},tilerow:function(n,i,r){return r.toString()},TileCol:function(n,i,r){return i.toString()},tilecol:function(n,i,r){return i.toString()},TileMatrixSet:function(n){return e._tilematrixset},tilematrixset:function(n){return e._tilematrixset}}}function E_e(e){let t={};for(let n in e)e.hasOwnProperty(n)&&(t[n.toLowerCase()]=e[n]);return t}var Kz=yf;var Tv={};Tv.defaultApiKey=void 0;Tv.mapTilesApiEndpoint=new De({url:"https://tile.googleapis.com/"});Tv.defaultStreetViewStaticApiKey=void 0;Tv.streetViewStaticApiEndpoint=new De({url:"https://maps.googleapis.com/maps/api/streetview"});Tv.getDefaultCredit=function(){return new It('<img alt="Google" src="https://assets.ion.cesium.com/google-credit.png" style="vertical-align:-6px">',!0)};var Fa=Tv;var S_e=/\/$/;function lg(e){e=e??H.EMPTY_OBJECT,this._maximumLevel=e.maximumLevel??22,this._minimumLevel=e.minimumLevel??0,this._session=e.session,this._key=e.key,this._tileWidth=e.tileWidth,this._tileHeight=e.tileHeight;let t=e.url instanceof Yo?e.url:De.createIfNeeded(e.url??Fa.mapTilesApiEndpoint),n=t.getUrlComponent();S_e.test(n)||(n+="/");let i=`${n}v1/2dtiles/{z}/{x}/{y}`;this._viewportUrl=`${n}tile/v1/viewport`,t.url=i,t.setQueryParameters({session:encodeURIComponent(e.session),key:encodeURIComponent(e.key)}),this._resource=t.clone();let r;l(e.credit)&&(r=e.credit,typeof r=="string"&&(r=new It(r)));let o=new Rs({url:t,credit:r,tileWidth:e.tileWidth,tileHeight:e.tileHeight,ellipsoid:e.ellipsoid,rectangle:e.rectangle,maximumLevel:this._maximumLevel,minimumLevel:this._minimumLevel});o._resource=t,this._imageryProvider=o,this._tileCredits=t.credits,this._attributionsByLevel=void 0}Object.defineProperties(lg.prototype,{url:{get:function(){return this._imageryProvider.url}},rectangle:{get:function(){return this._imageryProvider.rectangle}},tileWidth:{get:function(){return this._imageryProvider.tileWidth}},tileHeight:{get:function(){return this._imageryProvider.tileHeight}},maximumLevel:{get:function(){return this._imageryProvider.maximumLevel}},minimumLevel:{get:function(){return this._imageryProvider.minimumLevel}},tilingScheme:{get:function(){return this._imageryProvider.tilingScheme}},tileDiscardPolicy:{get:function(){return this._imageryProvider.tileDiscardPolicy}},errorEvent:{get:function(){return this._imageryProvider.errorEvent}},credit:{get:function(){return this._imageryProvider.credit}},proxy:{get:function(){return this._imageryProvider.proxy}},hasAlphaChannel:{get:function(){return this._imageryProvider.hasAlphaChannel}}});lg.fromIonAssetId=async function(e){e=e??{},e.mapType=e.mapType??"satellite",e.language=e.language??"en_US",e.region=e.region??"US";let t=e.overlayLayerType,n=w_e(e),i=Yo._createEndpointResource(e.assetId,{queryParameters:{options:JSON.stringify(n)}}),r={language:e.language,region:e.region,ellipsoid:e.ellipsoid,minimumLevel:e.minimumLevel,maximumLevel:e.maximumLevel,rectangle:e.rectangle,credit:e.credit},o=await i.fetchJson(),s=o.options.url;return delete o.options.url,o.options={...o.options,...r},VJ(s,o,i)};lg.fromUrl=async function(e){e=e??{},e.mapType=e.mapType??"satellite",e.language=e.language??"en_US",e.region=e.region??"US",e.url=e.url??Fa.mapTilesApiEndpoint,e.key=e.key??Fa.defaultApiKey;let t=e.overlayLayerType,n=await tot(e);return new lg({...n,...e,credit:e.credit??Fa.getDefaultCredit()})};lg.prototype.getTileCredits=function(e,t,n){if(!l(this._attributionsByLevel)||!l(this._tileCredits))return;let r=this._attributionsByLevel.get(n);return l(this._tileCredits)?this._tileCredits.concat(r):r};lg.prototype.requestImage=function(e,t,n,i){let r=this._imageryProvider.requestImage(e,t,n,i);if(l(r))return l(this._attributionsByLevel)?r:Promise.all([r,this.getViewportCredits()]).then(o=>o[0])};lg.prototype.pickFeatures=function(e,t,n,i,r){};lg.prototype.getViewportCredits=async function(){let e=this._maximumLevel,t=[];for(let r=0;r<e+1;r++)t.push(eot(this._resource,this._viewportUrl,r));let n=await Promise.all(t),i=new Map;for(let r=0;r<e+1;r++){let o=[],s=n[r];if(s){let a=new It(s);o.push(a)}i.set(r,o)}return this._attributionsByLevel=i,i};async function eot(e,t,n){return(await e.getDerivedResource({url:t,queryParameters:{zoom:n,north:90,south:-90,east:180,west:-180},data:JSON.stringify(H.EMPTY_OBJECT)}).fetchJson()).copyright}function w_e(e){let{mapType:t,overlayLayerType:n,styles:i}=e,r={mapType:t,overlay:!1};return t==="terrain"&&!l(n)&&(r.layerTypes=["layerRoadmap"]),l(n)&&(r.mapType="satellite",r.overlay=!0,r.layerTypes=[n]),l(i)&&(r.styles=i),r}async function tot(e){let{language:t,region:n,key:i,url:r}=e,o=w_e(e),s=r.url??r;S_e.test(s)||(s+="/");let a=await De.post({url:`${s}v1/createSession`,queryParameters:{key:i},data:JSON.stringify({...o,language:t,region:n})});return JSON.parse(a)}var $z=lg;var not=/\/$/;function Ev(e){e=e??{};let t=e.tilesetId??"microsoft.imagery";this._maximumLevel=e.maximumLevel??22,this._minimumLevel=e.minimumLevel??0,this._subscriptionKey=e.subscriptionKey??e["subscription-key"],this._tilesetId=e.tilesetId;let n=e.url instanceof Yo?e.url:De.createIfNeeded(e.url??"https://atlas.microsoft.com/"),i=n.getUrlComponent();not.test(i)||(i+="/");let r=`${i}map/tile`;this._viewportUrl=`${i}map/attribution`,n.url=r,n.setQueryParameters({"api-version":"2024-04-01",tilesetId:t,"subscription-key":this._subscriptionKey,zoom:"{z}",x:"{x}",y:"{y}"}),this._resource=n;let o;l(e.credit)&&(o=e.credit,typeof o=="string"&&(o=new It(o)));let s=new Rs({...e,maximumLevel:this._maximumLevel,minimumLevel:this._minimumLevel,url:n,credit:o});s._resource=n,this._imageryProvider=s,this._tileCredits=n.credits,this._attributionsByLevel=void 0}Object.defineProperties(Ev.prototype,{url:{get:function(){return this._imageryProvider.url}},rectangle:{get:function(){return this._imageryProvider.rectangle}},tileWidth:{get:function(){return this._imageryProvider.tileWidth}},tileHeight:{get:function(){return this._imageryProvider.tileHeight}},maximumLevel:{get:function(){return this._imageryProvider.maximumLevel}},minimumLevel:{get:function(){return this._imageryProvider.minimumLevel}},tilingScheme:{get:function(){return this._imageryProvider.tilingScheme}},tileDiscardPolicy:{get:function(){return this._imageryProvider.tileDiscardPolicy}},errorEvent:{get:function(){return this._imageryProvider.errorEvent}},credit:{get:function(){return this._imageryProvider.credit}},proxy:{get:function(){return this._imageryProvider.proxy}},hasAlphaChannel:{get:function(){return this._imageryProvider.hasAlphaChannel}}});Ev.prototype.getTileCredits=function(e,t,n){if(!l(this._attributionsByLevel)||!l(this._tileCredits))return;let r=this._attributionsByLevel.get(n);return l(this._tileCredits)?this._tileCredits.concat(r):r};Ev.prototype.requestImage=function(e,t,n,i){let r=this._imageryProvider.requestImage(e,t,n,i);if(l(r))return l(this._attributionsByLevel)?r:Promise.all([r,this.getViewportCredits()]).then(o=>o[0])};Ev.prototype.pickFeatures=function(e,t,n,i,r){};Ev.prototype.getViewportCredits=async function(){let e=this._maximumLevel,t=[];for(let r=0;r<e+1;r++)t.push(iot(this._resource,this._viewportUrl,this._subscriptionKey,this._tilesetId,r));let n=await Promise.all(t),i=new Map;for(let r=0;r<e+1;r++){let o=[],s=n[r].join(",");if(s){let a=new It(s);o.push(a)}i.set(r,o)}return this._attributionsByLevel=i,i};async function iot(e,t,n,i,r){return(await e.getDerivedResource({url:t,queryParameters:{zoom:r,bounds:"-180,-90,180,90"},data:JSON.stringify(H.EMPTY_OBJECT)}).fetchJson()).copyrights}var Jz=Ev;var rot=async(e,t,n)=>gx.fromUrl(new Yo(t,n)),oot=async(e,{options:t})=>Py.fromUrl(e,t),sot=async(e,{options:t})=>kz.fromUrl(e,t),aot=async(e,{options:t})=>{let n=t.channel;return delete t.channel,Gz.fromUrl(e,n,t)},cot=async(e,{options:t})=>new Wz({url:e,...t}),lot=async(e,{options:t})=>qz.fromUrl(e,t),uot=async(e,{options:t})=>gx.fromUrl(e,t),fot=async(e,{options:t})=>new Rs({url:e,...t}),dot=async(e,{options:t})=>new Xz({url:e,...t}),hot=async(e,{options:t})=>new Kz({url:e,...t}),VJ=async(e,t,n)=>{delete t.externalType,t.url=e;let i=new Yo(t,n),r=(o,s)=>{delete s.externalType,s.url=e;let{options:a}=s;o.setQueryParameters({session:a.session,key:a.key})};return i.refreshCallback=r,new $z({...t.options,url:i})},mot=async(e,t,n)=>{delete t.externalType,t.url=e;let i=new Yo(t,n),r=(o,s)=>{delete s.externalType,s.url=e;let{options:a}=s;o.setQueryParameters({"subscription-key":a["subscription-key"]})};return i.refreshCallback=r,new Jz({...t.options,url:i})},pot={ARCGIS_MAPSERVER:oot,BING:sot,GOOGLE_EARTH:aot,MAPBOX:cot,SINGLE_TILE:lot,TMS:uot,URL_TEMPLATE:fot,WMS:dot,WMTS:hot,GOOGLE_2D_MAPS:VJ,AZURE_MAPS:mot,defaultFactoryCallback:rot},$D=Object.freeze(pot);function Tp(){this._defaultAlpha=void 0,this._defaultNightAlpha=void 0,this._defaultDayAlpha=void 0,this._defaultBrightness=void 0,this._defaultContrast=void 0,this._defaultHue=void 0,this._defaultSaturation=void 0,this._defaultGamma=void 0,this._defaultMinificationFilter=void 0,this._defaultMagnificationFilter=void 0,this._tileCredits=void 0,this._errorEvent=new be}Object.defineProperties(Tp.prototype,{rectangle:{get:function(){return this._imageryProvider.rectangle}},tileWidth:{get:function(){return this._imageryProvider.tileWidth}},tileHeight:{get:function(){return this._imageryProvider.tileHeight}},maximumLevel:{get:function(){return this._imageryProvider.maximumLevel}},minimumLevel:{get:function(){return this._imageryProvider.minimumLevel}},tilingScheme:{get:function(){return this._imageryProvider.tilingScheme}},tileDiscardPolicy:{get:function(){return this._imageryProvider.tileDiscardPolicy}},errorEvent:{get:function(){return this._errorEvent}},credit:{get:function(){return this._imageryProvider.credit}},hasAlphaChannel:{get:function(){return this._imageryProvider.hasAlphaChannel}},proxy:{get:function(){}}});Tp.fromAssetId=async function(e,t){t=t??H.EMPTY_OBJECT;let n=Yo._createEndpointResource(e,t),i=e.toString()+t.accessToken+t.server,r=Tp._endpointCache[i];l(r)||(r=n.fetchJson(),Tp._endpointCache[i]=r);let o=await r;if(o.type!=="IMAGERY")throw new oe(`Cesium ion asset ${e} is not an imagery asset.`);let s=o.externalType,a=$D.defaultFactoryCallback;o=Ze(o,!0),o.options=o.options??{};let c=o.options?.url;if(delete t.url,l(s)&&(a=$D[s],!l(a)))throw new oe(`Unrecognized Cesium ion imagery type: ${s}`);let u=await a(c,o,n),f=new Tp(t);return u.errorEvent.addEventListener(function(d){d.provider=f,f._errorEvent.raiseEvent(d)}),f._tileCredits=Yo.getCreditsFromEndpoint(o,n),f._imageryProvider=u,f};Tp.prototype.getTileCredits=function(e,t,n){let i=this._imageryProvider.getTileCredits(e,t,n);return l(i)?this._tileCredits.concat(i):this._tileCredits};Tp.prototype.requestImage=function(e,t,n,i){return this._imageryProvider.requestImage(e,t,n,i)};Tp.prototype.pickFeatures=function(e,t,n,i,r){return this._imageryProvider.pickFeatures(e,t,n,i,r)};Tp._endpointCache={};var Du=Tp;var I_e={AERIAL:2,AERIAL_WITH_LABELS:3,ROAD:4};Object.freeze(I_e);var Dy=I_e;function got(e){e=e??H.EMPTY_OBJECT;let t=e.style??Dy.AERIAL;return Du.fromAssetId(t)}var Ry=got;function Os(){pe.throwInstantiationError()}Object.defineProperties(Os.prototype,{errorEvent:{get:pe.throwInstantiationError},credit:{get:pe.throwInstantiationError},tilingScheme:{get:pe.throwInstantiationError},hasWaterMask:{get:pe.throwInstantiationError},hasVertexNormals:{get:pe.throwInstantiationError},availability:{get:pe.throwInstantiationError}});var P_e=[];Os.getRegularGridIndices=function(e,t){let n=P_e[e];l(n)||(P_e[e]=n=[]);let i=n[t];return l(i)||(e*t<P.SIXTY_FOUR_KILOBYTES?i=n[t]=new Uint16Array((e-1)*(t-1)*6):i=n[t]=new Uint32Array((e-1)*(t-1)*6),M_e(e,t,i,0)),i};var D_e=[];Os.getRegularGridIndicesAndEdgeIndices=function(e,t){let n=D_e[e];l(n)||(D_e[e]=n=[]);let i=n[t];if(!l(i)){let r=Os.getRegularGridIndices(e,t),o=O_e(e,t),s=o.westIndicesSouthToNorth,a=o.southIndicesEastToWest,c=o.eastIndicesNorthToSouth,u=o.northIndicesWestToEast;i=n[t]={indices:r,westIndicesSouthToNorth:s,southIndicesEastToWest:a,eastIndicesNorthToSouth:c,northIndicesWestToEast:u}}return i};var R_e=[];Os.getRegularGridAndSkirtIndicesAndEdgeIndices=function(e,t){let n=R_e[e];l(n)||(R_e[e]=n=[]);let i=n[t];if(!l(i)){let r=e*t,o=(e-1)*(t-1)*6,s=e*2+t*2,a=Math.max(0,s-4)*6,c=r+s,u=o+a,f=O_e(e,t),d=f.westIndicesSouthToNorth,p=f.southIndicesEastToWest,g=f.eastIndicesNorthToSouth,m=f.northIndicesWestToEast,y=je.createTypedArray(c,u);M_e(e,t,y,0),Os.addSkirtIndices(d,p,g,m,r,y,o),i=n[t]={indices:y,westIndicesSouthToNorth:d,southIndicesEastToWest:p,eastIndicesNorthToSouth:g,northIndicesWestToEast:m,indexCountWithoutSkirts:o}}return i};Os.getSkirtVertexCount=function(e,t,n,i){return e.length+t.length+n.length+i.length};Os.getSkirtIndexCount=function(e){return(e-4)*2*3};Os.getSkirtIndexCountWithFilledCorners=function(e){return((e-4)*2+4)*3};Os.addSkirtIndices=function(e,t,n,i,r,o,s){let a=r;s=Zz(e,a,o,s),a+=e.length,s=Zz(t,a,o,s),a+=t.length,s=Zz(n,a,o,s),a+=n.length,Zz(i,a,o,s)};Os.addSkirtIndicesWithFilledCorners=function(e,t,n,i,r,o,s){Os.addSkirtIndices(e,t,n,i,r,o,s);let a=Os.getSkirtVertexCount(e,t,n,i),c=Os.getSkirtIndexCount(a),u=s+c,f=e[0],d=i[0],p=n[0],g=t[0],m=r,y=m+e.length-1,A=y+1,b=A+t.length-1,x=b+1,T=x+n.length-1,E=T+1,v=E+i.length-1;o[u+0]=f,o[u+1]=m,o[u+2]=b,o[u+3]=g,o[u+4]=A,o[u+5]=T,o[u+6]=p,o[u+7]=x,o[u+8]=v,o[u+9]=d,o[u+10]=E,o[u+11]=y};function O_e(e,t){let n=new Array(t),i=new Array(e),r=new Array(t),o=new Array(e),s;for(s=0;s<e;++s)o[s]=s,i[s]=e*t-1-s;for(s=0;s<t;++s)r[s]=(s+1)*e-1,n[s]=(t-s-1)*e;return{westIndicesSouthToNorth:n,southIndicesEastToWest:i,eastIndicesNorthToSouth:r,northIndicesWestToEast:o}}function M_e(e,t,n,i){let r=0;for(let o=0;o<t-1;++o){for(let s=0;s<e-1;++s){let a=r,c=a+e,u=c+1,f=a+1;n[i++]=a,n[i++]=c,n[i++]=f,n[i++]=f,n[i++]=c,n[i++]=u,++r}++r}}function Zz(e,t,n,i){let r=e[0],o=e.length;for(let s=1;s<o;++s){let a=e[s];n[i++]=r,n[i++]=a,n[i++]=t,n[i++]=t,n[i++]=a,n[i++]=t+1,r=a,++t}return i}Os.heightmapTerrainQuality=.25;Os.getEstimatedLevelZeroGeometricErrorForAHeightmap=function(e,t,n){return e.maximumRadius*2*Math.PI*Os.heightmapTerrainQuality/(t*n)};Os.prototype.requestTileGeometry=pe.throwInstantiationError;Os.prototype.getLevelMaximumGeometricError=pe.throwInstantiationError;Os.prototype.getTileDataAvailable=pe.throwInstantiationError;Os.prototype.loadTileDataAvailability=pe.throwInstantiationError;var Xr=Os;var N_e={UNLOADED:0,TRANSITIONING:1,RECEIVED:2,TEXTURE_LOADED:3,READY:4,FAILED:5,INVALID:6,PLACEHOLDER:7};Object.freeze(N_e);var jn=N_e;function Cv(e,t,n,i,r){if(this.imageryLayer=e,this.x=t,this.y=n,this.level=i,this.request=void 0,i!==0){let o=t/2|0,s=n/2|0,a=i-1;this.parent=e.getImageryFromCache(o,s,a)}this.state=jn.UNLOADED,this.imageUrl=void 0,this.image=void 0,this.texture=void 0,this.textureWebMercator=void 0,this.credits=void 0,this.referenceCount=0,!l(r)&&e.ready&&(r=e.imageryProvider.tilingScheme.tileXYToRectangle(t,n,i)),this.rectangle=r}Cv.createPlaceholder=function(e){let t=new Cv(e,0,0,0);return t.addReference(),t.state=jn.PLACEHOLDER,t};Cv.prototype.addReference=function(){++this.referenceCount};Cv.prototype.releaseReference=function(){return--this.referenceCount,this.referenceCount===0?(this.imageryLayer.removeImageryFromCache(this),l(this.parent)&&this.parent.releaseReference(),l(this.image)&&l(this.image.destroy)&&this.image.destroy(),l(this.texture)&&this.texture.destroy(),l(this.textureWebMercator)&&this.texture!==this.textureWebMercator&&this.textureWebMercator.destroy(),le(this),0):this.referenceCount};Cv.prototype.processStateMachine=function(e,t,n){this.state===jn.UNLOADED&&!n&&(this.state=jn.TRANSITIONING,this.imageryLayer._requestImagery(this)),this.state===jn.RECEIVED&&(this.state=jn.TRANSITIONING,this.imageryLayer._createTexture(e.context,this));let i=this.state===jn.READY&&t&&!this.texture;(this.state===jn.TEXTURE_LOADED||i)&&(this.state=jn.TRANSITIONING,this.imageryLayer._reprojectTexture(e,this,t))};var JD=Cv;function jJ(e,t,n){this.readyImagery=void 0,this.loadingImagery=e,this.textureCoordinateRectangle=t,this.textureTranslationAndScale=void 0,this.useWebMercatorT=n}jJ.prototype.freeResources=function(){l(this.readyImagery)&&this.readyImagery.releaseReference(),l(this.loadingImagery)&&this.loadingImagery.releaseReference()};jJ.prototype.processStateMachine=function(e,t,n){let i=this.loadingImagery,r=i.imageryLayer;if(i.processStateMachine(t,!this.useWebMercatorT,n),i.state===jn.READY)return l(this.readyImagery)&&this.readyImagery.releaseReference(),this.readyImagery=this.loadingImagery,this.loadingImagery=void 0,this.textureTranslationAndScale=r._calculateTextureTranslationAndScale(e,this),!0;let o=i.parent,s;for(;l(o)&&(o.state!==jn.READY||!this.useWebMercatorT&&!l(o.texture));)o.state!==jn.FAILED&&o.state!==jn.INVALID&&(s=s||o),o=o.parent;return this.readyImagery!==o&&(l(this.readyImagery)&&this.readyImagery.releaseReference(),this.readyImagery=o,l(o)&&(o.addReference(),this.textureTranslationAndScale=r._calculateTextureTranslationAndScale(e,this))),i.state===jn.FAILED||i.state===jn.INVALID?l(s)?(s.processStateMachine(t,!this.useWebMercatorT,n),!1):!0:!1};var ZD=jJ;function Ui(e,t){this._imageryProvider=e,this._readyEvent=new be,this._errorEvent=new be,t=t??H.EMPTY_OBJECT,e=e??H.EMPTY_OBJECT,this.alpha=t.alpha??e._defaultAlpha??1,this.nightAlpha=t.nightAlpha??e._defaultNightAlpha??1,this.dayAlpha=t.dayAlpha??e._defaultDayAlpha??1,this.brightness=t.brightness??e._defaultBrightness??Ui.DEFAULT_BRIGHTNESS,this.contrast=t.contrast??e._defaultContrast??Ui.DEFAULT_CONTRAST,this.hue=t.hue??e._defaultHue??Ui.DEFAULT_HUE,this.saturation=t.saturation??e._defaultSaturation??Ui.DEFAULT_SATURATION,this.gamma=t.gamma??e._defaultGamma??Ui.DEFAULT_GAMMA,this.splitDirection=t.splitDirection??Ui.DEFAULT_SPLIT,this.minificationFilter=t.minificationFilter??e._defaultMinificationFilter??Ui.DEFAULT_MINIFICATION_FILTER,this.magnificationFilter=t.magnificationFilter??e._defaultMagnificationFilter??Ui.DEFAULT_MAGNIFICATION_FILTER,this.show=t.show??!0,this._minimumTerrainLevel=t.minimumTerrainLevel,this._maximumTerrainLevel=t.maximumTerrainLevel,this._rectangle=t.rectangle??ie.MAX_VALUE,this._maximumAnisotropy=t.maximumAnisotropy,this._imageryCache={},this._skeletonPlaceholder=new ZD(JD.createPlaceholder(this)),this._show=!0,this._layerIndex=-1,this._isBaseLayer=!1,this._requestImageError=void 0,this._reprojectComputeCommands=[],this.cutoutRectangle=t.cutoutRectangle,this.colorToAlpha=t.colorToAlpha,this.colorToAlphaThreshold=t.colorToAlphaThreshold??Ui.DEFAULT_APPLY_COLOR_TO_ALPHA_THRESHOLD}Object.defineProperties(Ui.prototype,{imageryProvider:{get:function(){return this._imageryProvider}},ready:{get:function(){return l(this._imageryProvider)}},errorEvent:{get:function(){return this._errorEvent}},readyEvent:{get:function(){return this._readyEvent}},rectangle:{get:function(){return this._rectangle}}});Ui.DEFAULT_BRIGHTNESS=1;Ui.DEFAULT_CONTRAST=1;Ui.DEFAULT_HUE=0;Ui.DEFAULT_SATURATION=1;Ui.DEFAULT_GAMMA=1;Ui.DEFAULT_SPLIT=Wo.NONE;Ui.DEFAULT_MINIFICATION_FILTER=Wt.LINEAR;Ui.DEFAULT_MAGNIFICATION_FILTER=Jn.LINEAR;Ui.DEFAULT_APPLY_COLOR_TO_ALPHA_THRESHOLD=.004;Ui.fromProviderAsync=function(e,t){let n=new Ui(void 0,t);return xot(n,Promise.resolve(e)),n};Ui.fromWorldImagery=function(e){return e=e??H.EMPTY_OBJECT,Ui.fromProviderAsync(Ry({style:e.style}),e)};Ui.prototype.isBaseLayer=function(){return this._isBaseLayer};Ui.prototype.isDestroyed=function(){return!1};Ui.prototype.destroy=function(){return le(this)};var B_e=new ie,L_e=new ie,HJ=new ie,k_e=new ie;Ui.prototype.getImageryRectangle=function(){let e=this._imageryProvider,t=this._rectangle;return ie.intersection(e.rectangle,t)};Ui.prototype._createTileImagerySkeletons=function(e,t,n){let i=e.data;if(!l(t)||l(this._minimumTerrainLevel)&&e.level<this._minimumTerrainLevel||l(this._maximumTerrainLevel)&&e.level>this._maximumTerrainLevel)return!1;l(n)||(n=i.imagery.length);let r=this._imageryProvider;if(!this.ready)return this._skeletonPlaceholder.loadingImagery.addReference(),i.imagery.splice(n,0,this._skeletonPlaceholder),!0;let o=r.tilingScheme.projection instanceof Ti&&e.rectangle.north<Ti.MaximumLatitude&&e.rectangle.south>-Ti.MaximumLatitude,s=ie.intersection(r.rectangle,this._rectangle,B_e),a=ie.intersection(e.rectangle,s,L_e);if(!l(a)){if(!this.isBaseLayer())return!1;let w=s,D=e.rectangle;a=L_e,D.south>=w.north?a.north=a.south=w.north:D.north<=w.south?a.north=a.south=w.south:(a.south=Math.max(D.south,w.south),a.north=Math.min(D.north,w.north)),D.west>=w.east?a.west=a.east=w.east:D.east<=w.west?a.west=a.east=w.west:(a.west=Math.max(D.west,w.west),a.east=Math.min(D.east,w.east))}let c=0;a.south>0?c=a.south:a.north<0&&(c=a.north);let f=1*t.getLevelMaximumGeometricError(e.level),d=Aot(this,f,c);d=Math.max(0,d);let p=r.maximumLevel;if(d>p&&(d=p),l(r.minimumLevel)){let w=r.minimumLevel;d<w&&(d=w)}let g=r.tilingScheme,m=g.positionToTileXY(ie.northwest(a),d),y=g.positionToTileXY(ie.southeast(a),d),A=e.rectangle.width/512,b=e.rectangle.height/512,x=g.tileXYToRectangle(m.x,m.y,d);Math.abs(x.south-e.rectangle.north)<b&&m.y<y.y&&++m.y,Math.abs(x.east-e.rectangle.west)<A&&m.x<y.x&&++m.x;let T=g.tileXYToRectangle(y.x,y.y,d);Math.abs(T.north-e.rectangle.south)<b&&y.y>m.y&&--y.y,Math.abs(T.west-e.rectangle.east)<A&&y.x>m.x&&--y.x;let E=ie.clone(e.rectangle,k_e),v=g.tileXYToRectangle(m.x,m.y,d),S=ie.intersection(v,s,HJ),I;o?(g.rectangleToNativeRectangle(E,E),g.rectangleToNativeRectangle(v,v),g.rectangleToNativeRectangle(S,S),g.rectangleToNativeRectangle(s,s),I=g.tileXYToNativeRectangle.bind(g),A=E.width/512,b=E.height/512):I=g.tileXYToRectangle.bind(g);let R,O=0,L=1,_;!this.isBaseLayer()&&Math.abs(S.west-E.west)>=A&&(O=Math.min(1,(S.west-E.west)/E.width)),!this.isBaseLayer()&&Math.abs(S.north-E.north)>=b&&(L=Math.max(0,(S.north-E.south)/E.height));let C=L;for(let w=m.x;w<=y.x;w++)if(R=O,v=I(w,m.y,d),S=ie.simpleIntersection(v,s,HJ),!!l(S)){O=Math.min(1,(S.east-E.west)/E.width),w===y.x&&(this.isBaseLayer()||Math.abs(S.east-E.east)<A)&&(O=1),L=C;for(let D=m.y;D<=y.y;D++){if(_=L,v=I(w,D,d),S=ie.simpleIntersection(v,s,HJ),!l(S))continue;L=Math.max(0,(S.south-E.south)/E.height),D===y.y&&(this.isBaseLayer()||Math.abs(S.south-E.south)<b)&&(L=0);let N=new se(R,L,O,_),F=this.getImageryFromCache(w,D,d);i.imagery.splice(n,0,new ZD(F,N,o)),++n}}return!0};Ui.prototype._calculateTextureTranslationAndScale=function(e,t){let n=t.readyImagery.rectangle,i=e.rectangle;if(t.useWebMercatorT){let c=t.readyImagery.imageryLayer.imageryProvider.tilingScheme;n=c.rectangleToNativeRectangle(n,B_e),i=c.rectangleToNativeRectangle(i,k_e)}let r=i.width,o=i.height,s=r/n.width,a=o/n.height;return new se(s*(i.west-n.west)/r,a*(i.south-n.south)/o,s,a)};Ui.prototype._requestImagery=function(e){let t=this._imageryProvider,n=this;function i(s){if(!l(s))return r();e.image=s,e.state=jn.RECEIVED,e.request=void 0,no.reportSuccess(n._requestImageError)}function r(s){if(e.request.state===wi.CANCELLED){e.state=jn.UNLOADED,e.request=void 0;return}e.state=jn.FAILED,e.request=void 0;let a=`Failed to obtain image tile X: ${e.x} Y: ${e.y} Level: ${e.level}.`;n._requestImageError=no.reportError(n._requestImageError,t,t.errorEvent,a,e.x,e.y,e.level,s),n._requestImageError.retry&&o()}function o(){let s=new Oo({throttle:!1,throttleByServer:!0,type:oa.IMAGERY});e.request=s,e.state=jn.TRANSITIONING;let a=t.requestImage(e.x,e.y,e.level,s);if(!l(a)){e.state=jn.UNLOADED,e.request=void 0;return}l(t.getTileCredits)&&(e.credits=t.getTileCredits(e.x,e.y,e.level)),a.then(function(c){i(c)}).catch(function(c){r(c)})}o()};Ui.prototype._createTextureWebGL=function(e,t){let n=new Ht({minificationFilter:this.minificationFilter,magnificationFilter:this.magnificationFilter}),i=t.image;return l(i.internalFormat)?new Dt({context:e,pixelFormat:i.internalFormat,width:i.width,height:i.height,source:{arrayBufferView:i.bufferView},sampler:n}):new Dt({context:e,source:i,pixelFormat:this._imageryProvider.hasAlphaChannel?$e.RGBA:$e.RGB,sampler:n})};Ui.prototype._createTexture=function(e,t){let n=this._imageryProvider,i=t.image;if(l(n.tileDiscardPolicy)){let o=n.tileDiscardPolicy;if(l(o)){if(!o.isReady()){t.state=jn.RECEIVED;return}if(o.shouldDiscardImage(i)){t.state=jn.INVALID;return}}}let r=this._createTextureWebGL(e,t);n.tilingScheme.projection instanceof Ti?t.textureWebMercator=r:t.texture=r,t.image=void 0,t.state=jn.TEXTURE_LOADED};function F_e(e,t,n){return`${e}:${t}:${n}`}Ui.prototype._finalizeReprojectTexture=function(e,t){let n=this.minificationFilter,i=this.magnificationFilter;if(n===Wt.LINEAR&&i===Jn.LINEAR&&!$e.isCompressedFormat(t.pixelFormat)&&P.isPowerOfTwo(t.width)&&P.isPowerOfTwo(t.height)){n=Wt.LINEAR_MIPMAP_LINEAR;let o=Ut.maximumTextureFilterAnisotropy,s=Math.min(o,this._maximumAnisotropy??o),a=F_e(n,i,s),c=e.cache.imageryLayerMipmapSamplers;l(c)||(c={},e.cache.imageryLayerMipmapSamplers=c);let u=c[a];l(u)||(u=c[a]=new Ht({wrapS:hn.CLAMP_TO_EDGE,wrapT:hn.CLAMP_TO_EDGE,minificationFilter:n,magnificationFilter:i,maximumAnisotropy:s})),t.generateMipmap(yh.NICEST),t.sampler=u}else{let o=F_e(n,i,0),s=e.cache.imageryLayerNonMipmapSamplers;l(s)||(s={},e.cache.imageryLayerNonMipmapSamplers=s);let a=s[o];l(a)||(a=s[o]=new Ht({wrapS:hn.CLAMP_TO_EDGE,wrapT:hn.CLAMP_TO_EDGE,minificationFilter:n,magnificationFilter:i})),t.sampler=a}};Ui.prototype._reprojectTexture=function(e,t,n){let i=t.textureWebMercator||t.texture,r=t.rectangle,o=e.context;if(n=n??!0,n&&!(this._imageryProvider.tilingScheme.projection instanceof ji)&&r.width/i.width>1e-5){let s=this;t.addReference();let a=new Jf({persists:!0,owner:this,preExecute:function(c){yot(c,o,i,t.rectangle)},postExecute:function(c){t.texture=c,s._finalizeReprojectTexture(o,c),t.state=jn.READY,t.releaseReference()},canceled:function(){t.state=jn.TEXTURE_LOADED,t.releaseReference()}});this._reprojectComputeCommands.push(a)}else n&&(t.texture=i),this._finalizeReprojectTexture(o,i),t.state=jn.READY};Ui.prototype.queueReprojectionCommands=function(e){let t=this._reprojectComputeCommands,n=t.length;for(let i=0;i<n;++i)e.commandList.push(t[i]);t.length=0};Ui.prototype.cancelReprojections=function(){this._reprojectComputeCommands.forEach(function(e){l(e.canceled)&&e.canceled()}),this._reprojectComputeCommands.length=0};Ui.prototype.getImageryFromCache=function(e,t,n,i){let r=U_e(e,t,n),o=this._imageryCache[r];return l(o)||(o=new JD(this,e,t,n,i),this._imageryCache[r]=o),o.addReference(),o};Ui.prototype.removeImageryFromCache=function(e){let t=U_e(e.x,e.y,e.level);delete this._imageryCache[t]};function U_e(e,t,n){return JSON.stringify([e,t,n])}var Qz={u_textureDimensions:function(){return this.textureDimensions},u_texture:function(){return this.texture},textureDimensions:new U,texture:void 0},_ot=dn.supportsTypedArrays()?new Float32Array(128):void 0;function yot(e,t,n,i){let r=t.cache.imageryLayer_reproject;if(!l(r)){r=t.cache.imageryLayer_reproject={vertexArray:void 0,shaderProgram:void 0,sampler:void 0,destroy:function(){l(this.framebuffer)&&this.framebuffer.destroy(),l(this.vertexArray)&&this.vertexArray.destroy(),l(this.shaderProgram)&&this.shaderProgram.destroy()}};let A=new Float32Array(256),b=0;for(let S=0;S<64;++S){let I=S/63;A[b++]=0,A[b++]=I,A[b++]=1,A[b++]=I}let x={position:0,webMercatorT:1},T=Xr.getRegularGridIndices(2,64),E=tt.createIndexBuffer({context:t,typedArray:T,usage:Me.STATIC_DRAW,indexDatatype:je.UNSIGNED_SHORT});r.vertexArray=new Vn({context:t,attributes:[{index:x.position,vertexBuffer:tt.createVertexBuffer({context:t,typedArray:A,usage:Me.STATIC_DRAW}),componentsPerAttribute:2},{index:x.webMercatorT,vertexBuffer:tt.createVertexBuffer({context:t,sizeInBytes:512,usage:Me.STREAM_DRAW}),componentsPerAttribute:1}],indexBuffer:E});let v=new Xe({sources:[Y2]});r.shaderProgram=Qt.fromCache({context:t,vertexShaderSource:v,fragmentShaderSource:q2,attributeLocations:x}),r.sampler=new Ht({wrapS:hn.CLAMP_TO_EDGE,wrapT:hn.CLAMP_TO_EDGE,minificationFilter:Wt.LINEAR,magnificationFilter:Jn.LINEAR})}n.sampler=r.sampler;let o=n.width,s=n.height;Qz.textureDimensions.x=o,Qz.textureDimensions.y=s,Qz.texture=n;let a=Math.sin(i.south),c=.5*Math.log((1+a)/(1-a));a=Math.sin(i.north);let f=1/(.5*Math.log((1+a)/(1-a))-c),d=new Dt({context:t,width:o,height:s,pixelFormat:n.pixelFormat,pixelDatatype:n.pixelDatatype,preMultiplyAlpha:n.preMultiplyAlpha});P.isPowerOfTwo(o)&&P.isPowerOfTwo(s)&&d.generateMipmap(yh.NICEST);let p=i.south,g=i.north,m=_ot,y=0;for(let A=0;A<64;++A){let b=A/63,x=P.lerp(p,g,b);a=Math.sin(x);let E=(.5*Math.log((1+a)/(1-a))-c)*f;m[y++]=E,m[y++]=E}r.vertexArray.getAttribute(1).vertexBuffer.copyFromArrayView(m),e.shaderProgram=r.shaderProgram,e.outputTexture=d,e.uniformMap=Qz,e.vertexArray=r.vertexArray}function Aot(e,t,n){let i=e._imageryProvider,r=i.tilingScheme,o=r.ellipsoid,s=e._imageryProvider.tilingScheme.projection instanceof ji?1:Math.cos(n),a=r.rectangle,u=o.maximumRadius*a.width*s/(i.tileWidth*r.getNumberOfXTilesAtLevel(0))/t,f=Math.log(u)/Math.log(2);return Math.round(f)|0}function bot(e,t){e.numberOfListeners>0?e.raiseEvent(t):console.error(t)}async function xot(e,t){let n;try{if(n=await Promise.resolve(t),e.isDestroyed())return;e._imageryProvider=n,e._readyEvent.raiseEvent(n)}catch(i){bot(e._errorEvent,i)}}var Ms=Ui;var GJ=class{constructor(){this.alpha=!1,this.brightness=!1,this.contrast=!1,this.hue=!1,this.saturation=!1,this.gamma=!1,this.colorToAlpha=!1}},eV=GJ;var WJ=class{constructor(t,n,i,r){this._minX=t??0,this._minY=n??0,this._maxX=i??0,this._maxY=r??0}get minX(){return this._minX}set minX(t){this._minX=t}get minY(){return this._minY}set minY(t){this._minY=t}get maxX(){return this._maxX}set maxX(t){this._maxX=t}get maxY(){return this._maxY}set maxY(t){this._maxY=t}contains(t,n){return t>=this.minX&&t<this.maxX&&n>=this.minY&&n<this.maxY}containsExclusive(t,n){return t>this.minX&&t<this.maxX&&n>this.minY&&n<this.maxY}containsInclusive(t,n){return t>=this.minX&&t<=this.maxX&&n>=this.minY&&n<=this.maxY}},QD=WJ;var Tot=new ie,z_e=new ie,Eot=new ie,Cot=new ie,vot=new ie,Sot=new ie,qJ=class e{constructor(t,n,i,r,o){this._x=t,this._y=n,this._level=i,this._textureCoordinateRectangle=r,this._imagery=o}get x(){return this._x}get y(){return this._y}get level(){return this._level}get textureCoordinateRectangle(){return this._textureCoordinateRectangle}get imagery(){return this._imagery}static createImageryCoverages(t,n,i){if(!n.show)return[];let r=n.imageryProvider,o=e._clampImageryLevel(r,i),s=ie.intersection(r.rectangle,n.rectangle,Tot),a=r.tilingScheme,c=e._computeImageryRange(t,s,a,o),u=Cot;a.rectangleToNativeRectangle(t,u);let f=vot;a.rectangleToNativeRectangle(s,f);let d=(g,m,y)=>{let A=a.tileXYToRectangle(g,m,y),b=ie.intersection(A,s,Eot);if(!l(b))return;let x=Sot;return a.rectangleToNativeRectangle(b,x),x};return e._computeImageryCoverages(n,c,o,u,d)}static _clampImageryLevel(t,n){let i=t.minimumLevel??0,r=t.maximumLevel??Number.POSITIVE_INFINITY,o=Math.min(r-1,Math.max(i,n));return Math.floor(o)}static _computeImageryRange(t,n,i,r){let o=e._computeOverlappedRectangle(t,n),s=i.positionToTileXY(ie.northwest(o),r),a=i.positionToTileXY(ie.southeast(o),r),c=new QD;c.minX=s.x,c.minY=s.y,c.maxX=a.x,c.maxY=a.y;let u=t.width/512,f=t.height/512,d=i.tileXYToRectangle(c.minX,c.minY,r);Math.abs(d.south-t.north)<f&&c.minY<c.maxY&&++c.minY,Math.abs(d.east-t.west)<u&&c.minX<c.maxX&&++c.minX;let m=i.tileXYToRectangle(c.maxX,c.maxY,r);return Math.abs(m.north-t.south)<f&&c.maxY>c.minY&&--c.maxY,Math.abs(m.west-t.east)<u&&c.maxX>c.minX&&--c.maxX,c}static _clampRectangle(t,n,i){return l(i)||(i=new ie),t.south>=n.north?i.north=i.south=n.north:t.north<=n.south?i.north=i.south=n.south:(i.south=Math.max(t.south,n.south),i.north=Math.min(t.north,n.north)),t.west>=n.east?i.west=i.east=n.east:t.east<=n.west?i.west=i.east=n.west:(i.west=Math.max(t.west,n.west),i.east=Math.min(t.east,n.east)),i}static _computeOverlappedRectangle(t,n){let i=ie.intersection(t,n,z_e);return l(i)?i:e._clampRectangle(t,n,z_e)}static _computeImageryCoverages(t,n,i,r,o){let s=[];for(let a=n.minX;a<=n.maxX;a++){let c=o(a,n.maxY,i);if(l(c))for(let u=n.minY;u<=n.maxY;u++){let f=o(a,u,i);if(!l(f))continue;let d=e._localizeToCartesianRectangle(f,r,void 0),p=t.getImageryFromCache(a,u,i),g=new e(a,u,i,d,p);s.push(g)}}return s}static _localizeToCartesianRectangle(t,n,i){l(i)||(i=new QD);let r=1/n.width,o=1/n.height;return i.minX=(t.west-n.west)*r,i.minY=(t.south-n.south)*o,i.maxX=(t.east-n.west)*r,i.maxY=(t.north-n.south)*o,i}},e1=qJ;var YJ=class e{static createTextureCoordinatesForMappedPositions(t,n){let i=t.cartographicPositions,r=t.cartographicBoundingRectangle,o=t.numPositions;return e._createTextureCoordinates(i,o,r,n)}static _createTextureCoordinates(t,n,i,r){let o=new et;et.fromRectangle(i,r,o);let s=e.createProjectedPositions(t,r),a=e.computeTexCoords(s,o);return e.createTypedArrayFromCartesians2(n,a)}static createTextureCoordinatesAttributeForMappedPositions(t,n){let i=e.createTextureCoordinatesForMappedPositions(t,n);return e.createTexCoordAttribute(i)}static createCartographicPositions(t,n,i){let r=Na.readAttributeAsTypedArray(t),o=t.type,s=Vt.getNumberOfComponents(o),a=e.createIterableCartesian3FromTypedArray(r,s),c=e.transformCartesians3(a,n);return e.transformToCartographic(c,i)}static createIterableCartesian3FromTypedArray(t,n){let i=new h,r=t.length/n;return{[Symbol.iterator]:function*(){for(let s=0;s<r;s++)i.x=t[s*n+0],i.y=t[s*n+1],i.z=t[s*n+2],yield i}}}static map(t,n){return{[Symbol.iterator]:function*(){for(let r of t)yield n(r)}}}static computeCartographicBoundingRectangle(t,n){l(n)||(n=new ie);let i=Number.NEGATIVE_INFINITY,r=Number.POSITIVE_INFINITY,o=Number.NEGATIVE_INFINITY,s=Number.POSITIVE_INFINITY;for(let a of t)i=Math.max(i,a.latitude),r=Math.min(r,a.latitude),o=Math.max(o,a.longitude),s=Math.min(s,a.longitude);return n.north=i,n.south=r,n.east=o,n.west=s,n}static transformCartesians3(t,n){let i=new h;return e.map(t,o=>(M.multiplyByPoint(n,o,i),i))}static transformToCartographic(t,n){let i=new he;return e.map(t,o=>(n.cartesianToCartographic(o,i),i))}static createProjectedPositions(t,n){let i=new h;return e.map(t,o=>(n.project(o,i),i))}static computeTexCoords(t,n){let i=new U,r=1/n.width,o=1/n.height;return e.map(t,a=>{let c=(a.x-n.x)*r,u=(a.y-n.y)*o,f=Math.min(Math.max(c,0),1),d=Math.min(Math.max(u,0),1);return i.x=f,i.y=d,i})}static createTypedArrayFromCartesians2(t,n){let i=new Float32Array(t*2),r=0;for(let o of n)i[r*2+0]=o.x,i[r*2+1]=o.y,r++;return i}static createTexCoordAttribute(t){return{name:"Imagery Texture Coordinates",semantic:ct.TEXCOORD,setIndex:0,componentDatatype:Y.FLOAT,type:Vt.VEC2,normalized:!1,count:t.length/2,min:void 0,max:void 0,constant:new U(0,0),quantization:void 0,typedArray:t,byteOffset:0,byteStride:void 0}}},vv=YJ;var XJ=class{constructor(t,n,i,r){this._cartographicPositions=t,this._numPositions=n,this._cartographicBoundingRectangle=i,this._ellipsoid=r}get cartographicPositions(){return this._cartographicPositions}get numPositions(){return this._numPositions}get cartographicBoundingRectangle(){return this._cartographicBoundingRectangle}get ellipsoid(){return this._ellipsoid}},tV=XJ;var KJ=class e{constructor(t,n,i){this._model=t,this._runtimeNode=n,this._runtimePrimitive=i,this._mappedPositionsPerEllipsoid=void 0,this._mappedPositionsModelMatrix=new M,this._lastImageryLayersModificationCounter=0,this._imageryTexCoordAttributesPerProjection=void 0,this._currentImageryLayers=void 0,this._coveragesPerLayer=void 0,this._allImageriesReady=!1}coveragesForImageryLayer(t){let r=this._model.imageryLayers.indexOf(t);if(r===-1)throw new pe("Imagery layer is not part of the model");let o=this._coveragesPerLayer;if(!l(o))throw new pe("The coveragesPerLayer have not been computed yet");return o[r]}update(t){let n=this._model,o=n.content.tileset.imageryLayersModificationCounter;this._lastImageryLayersModificationCounter!==o&&(delete this._mappedPositionsPerEllipsoid,this._lastImageryLayersModificationCounter=o),this._mappedPositionsNeedUpdate&&(n.resetDrawCommands(),this._mappedPositionsPerEllipsoid=this._computeMappedPositionsPerEllipsoid(),this._deleteCoveragesPerLayer(),this._destroyImageryTexCoordAttributes()),l(this._imageryTexCoordAttributesPerProjection)||(this._imageryTexCoordAttributesPerProjection=this._computeImageryTexCoordsAttributesPerProjection(),this._uploadImageryTexCoordAttributes(t.context)),l(this._coveragesPerLayer)||(this._computeCoveragesPerLayer(),this._allImageriesReady=!1),this._allImageriesReady||this._updateImageries(t)}_deleteCoveragesPerLayer(){let t=this._coveragesPerLayer;if(!l(t))return;let n=this._currentImageryLayers,i=t.length;for(let r=0;r<i;r++){let o=n[r],s=t[r];this._deleteCoverages(o,s)}delete this._currentImageryLayers,delete this._coveragesPerLayer}_deleteCoverages(t,n){if(t.isDestroyed())return;let i=n.length;for(let r=0;r<i;r++)n[r].imagery.releaseReference()}_uploadImageryTexCoordAttributes(t){let n=this._imageryTexCoordAttributesPerProjection;if(!l(n))return;let i=n.length;for(let r=0;r<i;r++){let o=n[r],s=tt.createVertexBuffer({context:t,typedArray:o.typedArray,usage:Me.STATIC_DRAW});s.vertexArrayDestroyable=!1,o.buffer=s}}_destroyImageryTexCoordAttributes(){let t=this._imageryTexCoordAttributesPerProjection;if(!l(t))return;let n=t.length;for(let i=0;i<n;i++){let r=t[i];l(r)&&(l(r.buffer)&&(r.buffer.isDestroyed()||r.buffer.destroy()),t[i]=void 0)}delete this._imageryTexCoordAttributesPerProjection}get _mappedPositionsNeedUpdate(){if(!l(this._mappedPositionsPerEllipsoid))return!0;let t=this._model,n=this._mappedPositionsModelMatrix;return!M.equals(t.modelMatrix,n)}_computeMappedPositionsPerEllipsoid(){let t=this._model,n=this._runtimeNode,i=this._runtimePrimitive,r=e._obtainPrimitivePositionAttribute(i.primitive),o=r.count,s=e._computePrimitivePositionTransform(t,n,void 0),a=[],c=e._computeUniqueEllipsoids(t.imageryLayers),u=c.length;for(let f=0;f<u;f++){let d=c[f],p=vv.createCartographicPositions(r,s,d),g=vv.computeCartographicBoundingRectangle(p),m=new tV(p,o,g,d);a.push(m)}return M.clone(t.modelMatrix,this._mappedPositionsModelMatrix),a}static _computeUniqueEllipsoids(t){let n=new Set,i=t.length;for(let r=0;r<i;r++){let o=t.get(r),s=e._getEllipsoid(o);n.add(s)}return[...n]}_computeImageryTexCoordsAttributesPerProjection(){let n=this._model.imageryLayers,i=e._extractProjections(n),r=[...new Set(i)];return this._createImageryTexCoordAttributes(r)}static _extractProjections(t){let n=[],i=t.length;for(let r=0;r<i;r++){let o=t.get(r),s=e._getProjection(o);n.push(s)}return n}static _getProjection(t){return t.imageryProvider.tilingScheme.projection}_createImageryTexCoordAttributes(t){let n=[],i=t.length;for(let r=0;r<i;r++){let o=t[r],s=o.ellipsoid,a=this.mappedPositionsForEllipsoid(s),c=vv.createTextureCoordinatesAttributeForMappedPositions(a,o);n.push(c)}return n}_computeCoveragesPerLayer(){let t=[],n=[],r=this._model.imageryLayers,o=r.length;for(let s=0;s<o;s++){let a=r.get(s),c=this._computeCoverage(a);t.push(c),n.push(a)}this._coveragesPerLayer=t,this._currentImageryLayers=n}_computeCoverage(t){let i=this.mappedPositionsForImageryLayer(t).cartographicBoundingRectangle,r=this._computeImageryLevel(t,i);return e1.createImageryCoverages(i,t,r)}_computeImageryLevel(t,n){let i=t.imageryProvider,o=i.tilingScheme.rectangle,s=1,a=n.width,c=o.width;n.height>n.width&&(a=n.height,c=o.height);let u=Math.log2(s*c/a);return e1._clampImageryLevel(i,u)}_updateImageries(t){let n=this._model,i=this._coveragesPerLayer,r=i.length,o=!0;for(let s=0;s<r;s++){let a=i[s],c=a.length;for(let u=0;u<c;u++){let d=a[u].imagery;d.state===jn.READY||d.state===jn.FAILED||d.state===jn.INVALID||(o=!1,d.processStateMachine(t,!1,!1))}}o&&n.resetDrawCommands(),this._allImageriesReady=o}mappedPositionsForImageryLayer(t){let n=e._getEllipsoid(t);return this.mappedPositionsForEllipsoid(n)}mappedPositionsForEllipsoid(t){let n=this._mappedPositionsPerEllipsoid;if(!l(n))throw new pe("The mappedPositions have not been computed yet");let i=n.length;for(let r=0;r<i;r++){let o=n[r];if(o.ellipsoid===t)return o}throw new pe(`Could not find mapped positions for ellipsoid ${t}`)}imageryTexCoordAttributesPerProjection(){let t=this._imageryTexCoordAttributesPerProjection;if(!l(t))throw new pe("The imagery texture coordinate attributes have not been computed yet");return this._imageryTexCoordAttributesPerProjection}get ready(){let t=this._coveragesPerLayer;return l(t)?this._allImageriesReady:!1}isDestroyed(){return!1}destroy(){if(!this.isDestroyed())return this._deleteCoveragesPerLayer(),this._destroyImageryTexCoordAttributes(),le(this)}static _computePrimitivePositionTransform(t,n,i){l(i)||(i=new M);let r=t.sceneGraph;return M.clone(M.IDENTITY,i),M.multiply(i,t.modelMatrix,i),M.multiply(i,r.components.transform,i),M.multiply(i,r.axisCorrectionMatrix,i),M.multiply(i,n.computedTransform,i),i}static _obtainPrimitivePositionAttribute(t){let n=xt.getAttributeBySemantic(t,"POSITION");if(!l(n))throw new pe("The primitive does not have a POSITION attribute");return n}static _getEllipsoid(t){return t.imageryProvider.tilingScheme.projection.ellipsoid}},Sv=KJ;var $J=class{constructor(t,n,i,r,o){this.imageryLayer=t,this.texture=n,this.textureTranslationAndScale=i,this.textureCoordinateRectangle=r,this.imageryTexCoordAttributeSetIndex=o}},nV=$J;var wot=!1,Iot=new ie,Pot=new ie,JJ=class e{static process(t,n,i){let r=t.model,o=n.modelPrimitiveImagery;if(!l(o)||!o.ready)return;let s=r.imageryLayers,a=Sv._extractProjections(s),c=[...new Set(a)],u=e._computeIndexMapping(a,c),f=e._createImageryInputs(s,o,u);if(f.length===0)return;f.length>10&&(yt("imagery-texture-units",`Warning: Draped imagery requires ${f.length} texture units, truncating`),f.length=10),e._addImageryTexCoordAttributesToRenderResources(o,t);let d=[];for(let p=0;p<s.length;p++)d.push(s.get(p));e._processImageryInputs(d,t,f,c.length)}static _addImageryTexCoordAttributesToRenderResources(t,n){let i=t.imageryTexCoordAttributesPerProjection();for(let r of i)e._addImageryTexCoordAttributeToRenderResources(r,n)}static _addImageryTexCoordAttributeToRenderResources(t,n){let i=Vt.getNumberOfComponents(t.type),r={index:n.attributeIndex++,value:l(t.buffer)?void 0:t.constant,vertexBuffer:t.buffer,count:t.count,componentsPerAttribute:i,componentDatatype:t.componentDatatype,offsetInBytes:t.byteOffset,strideInBytes:t.byteStride,normalize:t.normalized};n.attributes.push(r)}static _processImageryInputs(t,n,i,r){let o=n.shaderBuilder,s=e._computeImageryFlags(t),a=i.length;o.addDefine("HAS_IMAGERY"),o.addDefine(`IMAGERY_TEXTURE_UNITS ${a}`),e._addAttributes(o,r),e._defineUniforms(o,s),e._buildSampleAndBlendFunction(o,s),e._createMainImageryShader(o,i,s);let c=n.uniformMap,u=e._createImageryUniforms(i);e._setImageryUniforms(c,u)}static _addAttributes(t,n){for(let o=0;o<n;o++)t.addAttribute("vec2",`a_imagery_texCoord_${o}`),t.addVarying("vec2",`v_imagery_texCoord_${o}`);let i="initializeImageryAttributes",r=`void ${i}()`;t.addFunction(i,r,de.VERTEX);for(let o=0;o<n;o++)t.addFunctionLines(i,[`v_imagery_texCoord_${o} = a_imagery_texCoord_${o};`])}static _computeImageryFlags(t){let n=new eV;for(let i=0;i<t.length;i++){let r=t[i];n.alpha|=r.alpha!==1,n.brightness|=r.brightness!==Ms.DEFAULT_BRIGHTNESS,n.contrast|=r.contrast!==Ms.DEFAULT_CONTRAST,n.hue|=r.hue!==Ms.DEFAULT_HUE,n.saturation|=r.saturation!==Ms.DEFAULT_SATURATION,n.gamma|=r.gamma!==Ms.DEFAULT_GAMMA;let o=l(r.colorToAlpha)&&r.colorToAlphaThreshold>0;n.colorToAlpha|=o}return n}static _defineUniforms(t,n){t.addUniform("sampler2D","u_imageryTextures[IMAGERY_TEXTURE_UNITS]",de.FRAGMENT),t.addUniform("vec4","u_imageryTextureCoordinateRectangle[IMAGERY_TEXTURE_UNITS]",de.FRAGMENT),t.addUniform("vec4","u_imageryTextureTranslationAndScale[IMAGERY_TEXTURE_UNITS]",de.FRAGMENT),n.alpha&&t.addUniform("float","u_imageryTextureAlpha[IMAGERY_TEXTURE_UNITS]",de.FRAGMENT),n.brightness&&t.addUniform("float","u_imageryTextureBrightness[IMAGERY_TEXTURE_UNITS]",de.FRAGMENT),n.contrast&&t.addUniform("float","u_imageryTextureContrast[IMAGERY_TEXTURE_UNITS]",de.FRAGMENT),n.hue&&t.addUniform("float","u_imageryTextureHue[IMAGERY_TEXTURE_UNITS]",de.FRAGMENT),n.saturation&&t.addUniform("float","u_imageryTextureSaturation[IMAGERY_TEXTURE_UNITS]",de.FRAGMENT),n.gamma&&t.addUniform("float","u_imageryTextureOneOverGamma[IMAGERY_TEXTURE_UNITS]",de.FRAGMENT),n.colorToAlpha&&t.addUniform("vec4","u_imageryTextureColorToAlpha[IMAGERY_TEXTURE_UNITS]",de.FRAGMENT)}static _createSampleAndBlendFunctionSignature(t){let n="sampleAndBlend",i=[];i.push("vec4 previousColor"),i.push("sampler2D textureToSample"),i.push("vec2 textureCoordinates"),i.push("vec4 textureCoordinateRectangle"),i.push("vec4 textureCoordinateTranslationAndScale"),t.alpha&&i.push("float textureAlpha"),t.brightness&&i.push("float textureBrightness"),t.contrast&&i.push("float textureContrast"),t.hue&&i.push("float textureHue"),t.saturation&&i.push("float textureSaturation"),t.gamma&&i.push("float textureOneOverGamma"),t.colorToAlpha&&i.push("vec4 colorToAlpha");let r=i.join(", ");return`vec4 ${n}(${r})`}static _buildSampleAndBlendFunction(t,n){let i="sampleAndBlend",r=e._createSampleAndBlendFunctionSignature(n);t.addFunction(i,r,de.FRAGMENT),t.addFunctionLines(i,["float effectiveAlpha = 1.0;"]),n.alpha&&t.addFunctionLines(i,["effectiveAlpha = textureAlpha;"]),t.addFunctionLines(i,["if (textureCoordinates.x < textureCoordinateRectangle.x) effectiveAlpha = 0.0;","if (textureCoordinates.x > textureCoordinateRectangle.z) effectiveAlpha = 0.0;","if (textureCoordinates.y < textureCoordinateRectangle.y) effectiveAlpha = 0.0;","if (textureCoordinates.y > textureCoordinateRectangle.w) effectiveAlpha = 0.0;","vec2 translation = textureCoordinateTranslationAndScale.xy;","vec2 scale = textureCoordinateTranslationAndScale.zw;","vec2 effectiveTextureCoordinates = textureCoordinates * scale + translation;","vec4 value = texture(textureToSample, effectiveTextureCoordinates);","value = czm_srgbToLinear(value);","vec3 color = value.rgb;","float alpha = value.a;"]),n.colorToAlpha&&t.addFunctionLines(i,["vec3 colorDiff = abs(color.rgb - colorToAlpha.rgb);","colorDiff.r = czm_maximumComponent(colorDiff);","alpha = czm_branchFreeTernary(colorDiff.r < colorToAlpha.a, 0.0, alpha);"]),n.gamma?t.addFunctionLines(i,["color = pow(color, vec3(textureOneOverGamma));"]):t.addFunctionLines(i,["vec4 tempColor = czm_gammaCorrect(vec4(color, alpha));","color = tempColor.rgb;","alpha = tempColor.a;"]),n.brightness&&t.addFunctionLines(i,["color = mix(vec3(0.0), color, textureBrightness);"]),n.contrast&&t.addFunctionLines(i,["color = mix(vec3(0.5), color, textureContrast);"]),n.hue&&t.addFunctionLines(i,["color = czm_hue(color, textureHue);"]),n.saturation&&t.addFunctionLines(i,["color = czm_saturation(color, textureSaturation);"]),t.addFunctionLines(i,["float sourceAlpha = alpha * effectiveAlpha;","float outAlpha = mix(previousColor.a, 1.0, sourceAlpha);","outAlpha += sign(outAlpha) - 1.0;","vec3 outColor = mix(previousColor.rgb * previousColor.a, color, sourceAlpha) / outAlpha;","vec4 result = vec4(outColor, max(outAlpha, 0.0));"]),wot&&t.addFunctionLines(i,["if (abs(textureCoordinates.x - textureCoordinateRectangle.x) < (1.0/256.0) || "," abs(textureCoordinates.x - textureCoordinateRectangle.z) < (1.0/256.0) || "," abs(textureCoordinates.y - textureCoordinateRectangle.y) < (1.0/256.0) || "," abs(textureCoordinates.y - textureCoordinateRectangle.w) < (1.0/256.0))","{"," result = vec4(1.0, 0.0, 0.0, effectiveAlpha);","}"]),t.addFunctionLines(i,["return result;"])}static _createSampleAndBlendCallArguments(t,n,i){let r=`v_imagery_texCoord_${n}`,o=[];return o.push("blendedBaseColor"),o.push(`u_imageryTextures[${i}]`),o.push(`${r}`),o.push(`u_imageryTextureCoordinateRectangle[${i}]`),o.push(`u_imageryTextureTranslationAndScale[${i}]`),t.alpha&&o.push(`u_imageryTextureAlpha[${i}]`),t.brightness&&o.push(`u_imageryTextureBrightness[${i}]`),t.contrast&&o.push(`u_imageryTextureContrast[${i}]`),t.hue&&o.push(`u_imageryTextureHue[${i}]`),t.saturation&&o.push(`u_imageryTextureSaturation[${i}]`),t.gamma&&o.push(`u_imageryTextureOneOverGamma[${i}]`),t.colorToAlpha&&o.push(`u_imageryTextureColorToAlpha[${i}]`),o.join(", ")}static _createMainImageryShader(t,n,i){let r="blendBaseColorWithImagery";t.addFunction(r,"vec4 blendBaseColorWithImagery(vec4 baseColorWithAlpha)",de.FRAGMENT),t.addFunctionLines(r,["vec4 blendedBaseColor = baseColorWithAlpha;"]);for(let o=0;o<n.length;o++){let a=n[o].imageryTexCoordAttributeSetIndex,c=e._createSampleAndBlendCallArguments(i,a,o);t.addFunctionLines(r,[`blendedBaseColor = sampleAndBlend(${c});`])}t.addFunctionLines(r,["return blendedBaseColor;"])}static _createImageryUniforms(t){let n=t.length,i={};i.imageryTextures=Array(n),i.imageryTextureCoordinateRectangle=Array(n),i.imageryTextureTranslationAndScale=Array(n),i.imageryTextureAlpha=Array(n),i.imageryTextureBrightness=Array(n),i.imageryTextureContrast=Array(n),i.imageryTextureHue=Array(n),i.imageryTextureSaturation=Array(n),i.imageryTextureOneOverGamma=Array(n),i.imageryTextureColorToAlpha=Array(n);for(let r=0;r<n;r++){let o=t[r],s=o.imageryLayer,a=o.texture,c=o.textureCoordinateRectangle,u=o.textureTranslationAndScale;i.imageryTextures[r]=a,i.imageryTextureTranslationAndScale[r]=u,i.imageryTextureCoordinateRectangle[r]=c,i.imageryTextureAlpha[r]=s.alpha,i.imageryTextureBrightness[r]=s.brightness,i.imageryTextureContrast[r]=s.contrast,i.imageryTextureHue[r]=s.hue,i.imageryTextureSaturation[r]=s.saturation,i.imageryTextureOneOverGamma[r]=1/s.gamma;let f=i.imageryTextureColorToAlpha[r];if(l(f)||(f=new se,i.imageryTextureColorToAlpha[r]=f),l(s.colorToAlpha)&&s.colorToAlphaThreshold>0){let p=s.colorToAlpha;f.x=p.red,f.y=p.green,f.z=p.blue,f.w=s.colorToAlphaThreshold}else f.w=-1}return i}static _setImageryUniforms(t,n){for(let i in n)if(n.hasOwnProperty(i)){let r=`u_${i}`;t[r]=function(){return n[i]}}}static _createImageryInputs(t,n,i){let r=[];for(let o=0;o<t.length;o++){let s=t.get(o);if(!s.show)continue;let a=i[o],u=n.mappedPositionsForImageryLayer(s).cartographicBoundingRectangle,f=n.coveragesForImageryLayer(s);for(let d=0;d<f.length;d++){let p=f[d],g=e._createImageryInput(s,p,u,a);l(g)&&r.push(g)}}return r}static _createImageryInput(t,n,i,r){let o=n.imagery;if(o.state===jn.FAILED||o.state===jn.INVALID)return;let s=o.textureWebMercator;if(!l(s)&&(s=o.texture,!l(s))){o.state===jn.READY&&console.log(`Imagery at ${n.x}, ${n.y} (level ${n.level}) does not have any texture - state ${o.state}`);return}let a=e._computeTextureTranslationAndScale(t,i,o.rectangle),c=n.textureCoordinateRectangle,u=new se(c.minX,c.minY,c.maxX,c.maxY);return new nV(t,s,a,u,r)}static _computeTextureTranslationAndScale(t,n,i){let r=t.imageryProvider.tilingScheme,o=r.rectangleToNativeRectangle(n,Iot),s=r.rectangleToNativeRectangle(i,Pot);return e._computeTextureTranslationAndScaleFromNative(o,s)}static _computeTextureTranslationAndScaleFromNative(t,n){let i=1/n.width,r=1/n.height,o=t.west-n.west,s=t.south-n.south,a=o*i,c=s*r,u=t.width*i,f=t.height*r;return new se(a,c,u,f)}static _computeIndexMapping(t,n){let i=[],r=t.length;for(let o=0;o<r;o++){let s=t[o],a=n.indexOf(s);i.push(a)}return i}},iV=JJ;var rV=`#ifdef USE_IBL_LIGHTING +`;var h1={name:"SelectedFeatureIdPipelineStage",STRUCT_ID_SELECTED_FEATURE:"SelectedFeature",STRUCT_NAME_SELECTED_FEATURE:"SelectedFeature"};h1.process=function(e,t,n){let i=e.shaderBuilder;e.hasPropertyTable=!0;let r=e.model,o=e.runtimeNode.node,s=gat(r,o,t),a=s.shaderDestination;i.addDefine("HAS_SELECTED_FEATURE_ID",void 0,a),i.addDefine("SELECTED_FEATURE_ID",s.variableName,a),i.addDefine(s.featureIdDefine,void 0,a),_at(i);let c=s.featureIds.nullFeatureId,u=e.uniformMap;l(c)&&(i.addDefine("HAS_NULL_FEATURE_ID",void 0,a),i.addUniform("int","model_nullFeatureId",a),u.model_nullFeatureId=function(){return c}),s.shaderDestination===de.BOTH&&i.addVertexLines(d1),i.addFragmentLines(d1)};function bbe(e){return e instanceof vn.FeatureIdTexture?"HAS_SELECTED_FEATURE_ID_TEXTURE":"HAS_SELECTED_FEATURE_ID_ATTRIBUTE"}function xbe(e){return e instanceof vn.FeatureIdTexture?de.FRAGMENT:de.BOTH}function gat(e,t,n){let i,r;return l(t.instances)&&(r=xt.getFeatureIdsByLabel(t.instances.featureIds,e.instanceFeatureIdLabel),l(r))?(i=r.label??r.positionalLabel,{featureIds:r,variableName:i,shaderDestination:xbe(r),featureIdDefine:bbe(r)}):(r=xt.getFeatureIdsByLabel(n.featureIds,e.featureIdLabel),i=r.label??r.positionalLabel,{featureIds:r,variableName:i,shaderDestination:xbe(r),featureIdDefine:bbe(r)})}function _at(e){e.addStructField(h1.STRUCT_ID_SELECTED_FEATURE,"int","id"),e.addStructField(h1.STRUCT_ID_SELECTED_FEATURE,"vec2","st"),e.addStructField(h1.STRUCT_ID_SELECTED_FEATURE,"vec4","color")}var wx=h1;var Fa={name:"GeometryPipelineStage",STRUCT_ID_PROCESSED_ATTRIBUTES_VS:"ProcessedAttributesVS",STRUCT_ID_PROCESSED_ATTRIBUTES_FS:"ProcessedAttributesFS",STRUCT_NAME_PROCESSED_ATTRIBUTES:"ProcessedAttributes",FUNCTION_ID_INITIALIZE_ATTRIBUTES:"initializeAttributes",FUNCTION_SIGNATURE_INITIALIZE_ATTRIBUTES:"void initializeAttributes(out ProcessedAttributes attributes)",FUNCTION_ID_SET_DYNAMIC_VARYINGS_VS:"setDynamicVaryingsVS",FUNCTION_ID_SET_DYNAMIC_VARYINGS_FS:"setDynamicVaryingsFS",FUNCTION_SIGNATURE_SET_DYNAMIC_VARYINGS:"void setDynamicVaryings(inout ProcessedAttributes attributes)"};Fa.process=function(e,t,n){let{shaderBuilder:i,model:r}=e;i.addStruct(Fa.STRUCT_ID_PROCESSED_ATTRIBUTES_VS,"ProcessedAttributes",de.VERTEX),i.addStruct(Fa.STRUCT_ID_PROCESSED_ATTRIBUTES_FS,"ProcessedAttributes",de.FRAGMENT),i.addStruct(wx.STRUCT_ID_SELECTED_FEATURE,wx.STRUCT_NAME_SELECTED_FEATURE,de.BOTH),i.addFunction(Fa.FUNCTION_ID_INITIALIZE_ATTRIBUTES,Fa.FUNCTION_SIGNATURE_INITIALIZE_ATTRIBUTES,de.VERTEX),i.addVarying("vec3","v_positionWC"),i.addVarying("vec3","v_positionEC"),i.addStructField(Fa.STRUCT_ID_PROCESSED_ATTRIBUTES_FS,"vec3","positionWC"),i.addStructField(Fa.STRUCT_ID_PROCESSED_ATTRIBUTES_FS,"vec3","positionEC"),i.addFunction(Fa.FUNCTION_ID_SET_DYNAMIC_VARYINGS_VS,Fa.FUNCTION_SIGNATURE_SET_DYNAMIC_VARYINGS,de.VERTEX),i.addFunction(Fa.FUNCTION_ID_SET_DYNAMIC_VARYINGS_FS,Fa.FUNCTION_SIGNATURE_SET_DYNAMIC_VARYINGS,de.FRAGMENT),r.type===Qo.TILE_PNTS&&i.addDefine("HAS_SRGB_COLOR",void 0,de.FRAGMENT);let o=n.mode!==re.SCENE3D&&!n.scene3DOnly&&r._projectTo2D,s=l(e.runtimeNode.node.instances),a=o&&!s,c=t.attributes.length;for(let u=0;u<c;u++){let f=t.attributes[u],d=Vt.getAttributeLocationCount(f.type),p=f.semantic===ct.POSITION,g;d>1?(g=e.attributeIndex,e.attributeIndex+=d):p&&!a?g=0:g=e.attributeIndex++;let m=!p&&t.primitiveType===Oe.POINTS&&n.context.webgl2?"flat":void 0;yat(e,f,g,d,o,s,m)}wat(i,t.attributes),t.primitiveType===Oe.POINTS&&i.addDefine("PRIMITIVE_TYPE_POINTS"),i.addVertexLines(IV),i.addFragmentLines(wV)};function yat(e,t,n,i,r,o,s){let a=e.shaderBuilder,c=xt.getAttributeInfo(t),u=r&&!o;i>1?xat(e,t,n,i):bat(e,t,n,u),Eat(a,c,u),Tat(a,c,s),l(t.semantic)&&Aat(a,t),Cat(a,c,r),vat(a,c,u),Sat(a,c)}function Aat(e,t){let{semantic:n,setIndex:i}=t;switch(n){case ct.NORMAL:e.addDefine("HAS_NORMALS");break;case ct.TANGENT:e.addDefine("HAS_TANGENTS");break;case ct.FEATURE_ID:e.addDefine(`HAS${n}_${i}`);break;case ct.TEXCOORD:case ct.COLOR:e.addDefine(`HAS_${n}_${i}`)}}function bat(e,t,n,i){let{quantization:r,semantic:o,setIndex:s}=t,{type:a,componentDatatype:c}=l(r)?r:t;o===ct.FEATURE_ID&&s>=e.featureIdVertexAttributeSetIndex&&(e.featureIdVertexAttributeSetIndex=s+1);let u=o===ct.POSITION,f=u?0:n,d=Vt.getNumberOfComponents(a),p={index:f,value:l(t.buffer)?void 0:t.constant,vertexBuffer:t.buffer,count:t.count,componentsPerAttribute:d,componentDatatype:c,offsetInBytes:t.byteOffset,strideInBytes:t.byteStride,normalize:t.normalized};if(e.attributes.push(p),!u||!i)return;let g=e.runtimePrimitive.positionBuffer2D,m={index:n,vertexBuffer:g,count:t.count,componentsPerAttribute:d,componentDatatype:Y.FLOAT,offsetInBytes:0,strideInBytes:void 0,normalize:t.normalized};e.attributes.push(m)}function xat(e,t,n,i){let{quantization:r,normalized:o}=t,{type:s,componentDatatype:a}=l(r)?r:t,u=Vt.getNumberOfComponents(s)/i,f=Y.getSizeInBytes(a),d=u*f,p=t.byteStride;for(let g=0;g<i;g++){let m=t.byteOffset+g*d,y={index:n+g,vertexBuffer:t.buffer,componentsPerAttribute:u,componentDatatype:a,offsetInBytes:m,strideInBytes:p,normalize:o};e.attributes.push(y)}}function Tat(e,t,n){let i=t.variableName,r=`v_${i}`,o;i==="normalMC"?(r="v_normalEC",o=t.glslType):i==="tangentMC"?(o="vec3",r="v_tangentEC"):o=t.glslType,e.addVarying(o,r,n)}function Eat(e,t,n){let i=t.attribute.semantic,r=t.variableName,o,s;t.isQuantized?(o=`a_quantized_${r}`,s=t.quantizedGlslType):(o=`a_${r}`,s=t.glslType);let a=i===ct.POSITION;a?e.setPositionAttribute(s,o):e.addAttribute(s,o),a&&n&&e.addAttribute("vec3","a_position2D")}function Cat(e,t,n){let i=Fa.STRUCT_ID_PROCESSED_ATTRIBUTES_VS,r=Fa.STRUCT_ID_PROCESSED_ATTRIBUTES_FS,{variableName:o,glslType:s}=t;o==="tangentMC"?(e.addStructField(i,"vec3","tangentMC"),e.addStructField(i,"float","tangentSignMC"),e.addStructField(r,"vec3","tangentEC")):o==="normalMC"?(e.addStructField(i,"vec3","normalMC"),e.addStructField(r,"vec3","normalEC")):(e.addStructField(i,s,o),e.addStructField(r,s,o)),o==="positionMC"&&n&&e.addStructField(i,"vec3","position2D")}function vat(e,t,n){let i=Fa.FUNCTION_ID_INITIALIZE_ATTRIBUTES,r=t.variableName;if(r==="positionMC"&&n&&e.addFunctionLines(i,["attributes.position2D = a_position2D;"]),t.isQuantized)return;let s=[];r==="tangentMC"?(s.push("attributes.tangentMC = a_tangentMC.xyz;"),s.push("attributes.tangentSignMC = a_tangentMC.w;")):s.push(`attributes.${r} = a_${r};`),e.addFunctionLines(i,s)}function Sat(e,t){let{semantic:n,setIndex:i}=t.attribute;if(l(n)&&!l(i))return;let r=Fa.FUNCTION_ID_SET_DYNAMIC_VARYINGS_VS,o=t.variableName,s=`v_${o} = attributes.${o};`;e.addFunctionLines(r,[s]),r=Fa.FUNCTION_ID_SET_DYNAMIC_VARYINGS_FS,s=`attributes.${o} = v_${o};`,e.addFunctionLines(r,[s])}function wat(e,t){let n=!1,i=!1;for(let r=0;r<t.length;r++){let o=t[r];o.semantic===ct.NORMAL?n=!0:o.semantic===ct.TANGENT&&(i=!0)}!n||!i||(e.addDefine("HAS_BITANGENTS"),e.addVarying("vec3","v_bitangentEC"),e.addStructField(Fa.STRUCT_ID_PROCESSED_ATTRIBUTES_VS,"vec3","bitangentMC"),e.addStructField(Fa.STRUCT_ID_PROCESSED_ATTRIBUTES_FS,"vec3","bitangentEC"))}var PV=Fa;var bZ=js(ef(),1);var AZ,Tbe="eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJub25jZSI6ImwwendUTkl3UVk5Uk5XdEkiLCJqdGkiOiJjZGFkZDZlNC0wMDI5LTQ5OTMtYWIwMC01ZWY4ZDVlNTBhMzYiLCJpZCI6MjU5LCJzdWIiOiJDZXNpdW1KUyIsImlzcyI6Imh0dHBzOi8vYXBpLmNlc2l1bS5jb20iLCJhdWQiOiIxLjE0NSBSZWxlYXNlIC0gRGVsZXRlIG9uIE5vdmVtYmVyIDEsIDIwMjYiLCJpYXQiOjE3ODc2MzQ3NzV9.3SPieoGxEZ22pnWLETAIFZveR0xXTzvOh8G4NYTxDSo",DV={};DV.defaultAccessToken=Tbe;DV.defaultServer=new De({url:"https://api.cesium.com/"});DV.getDefaultTokenCredit=function(e){if(e===Tbe){if(!l(AZ)){let t=`<b> This application is using Cesium's default ion access token. Please assign <i>Cesium.Ion.defaultAccessToken</i> with an access token from your ion account before making any Cesium API calls. You can sign up for a free ion account at <a href="https://cesium.com">https://cesium.com</a>.</b>`;AZ=new It(t,!0)}return AZ}};var bf=DV;function tl(e,t){let n,i=e.externalType,r=l(i);if(!r)n={url:e.url,retryAttempts:1,retryCallback:Iat};else if(i==="3DTILES"||i==="STK_TERRAIN_SERVER")n={url:e.options.url};else throw new oe("Ion.createResource does not support external imagery assets; use IonImageryProvider instead.");De.call(this,n),this._ionEndpoint=e,this._ionEndpointDomain=r?void 0:new bZ.default(e.url).authority(),this._ionEndpointResource=t,this._ionRoot=void 0,this._pendingPromise=void 0,this._credits=void 0,this._isExternal=r,this.refreshCallback=void 0}l(Object.create)&&(tl.prototype=Object.create(De.prototype),tl.prototype.constructor=tl);tl.fromAssetId=function(e,t){let n=tl._createEndpointResource(e,t);return n.fetchJson().then(function(i){return new tl(i,n)})};Object.defineProperties(tl.prototype,{credits:{get:function(){return l(this._ionRoot)?this._ionRoot.credits:l(this._credits)?this._credits:(this._credits=tl.getCreditsFromEndpoint(this._ionEndpoint,this._ionEndpointResource),this._credits)}}});tl.getCreditsFromEndpoint=function(e,t){let n=e.attributions.map(It.getIonCredit),i=bf.getDefaultTokenCredit(t.queryParameters.access_token);return l(i)&&n.push(It.clone(i)),n};tl.prototype.clone=function(e){let t=this._ionRoot??this;return l(e)||(e=Object.create(tl.prototype),De.call(e,{url:this._url,parseUrl:!1}),e._ionEndpoint=t._ionEndpoint,e._ionEndpointDomain=t._ionEndpointDomain,e._ionEndpointResource=t._ionEndpointResource,e._ionRoot=void 0,e._pendingPromise=void 0,e._credits=void 0,e._isExternal=this._isExternal,e.refreshCallback=void 0),e=De.prototype.clone.call(this,e),e._ionRoot=t,e._isExternal=this._isExternal,e};tl.prototype.fetchImage=function(e){if(!this._isExternal){let t=e;e={preferBlob:!0},l(t)&&(e.flipY=t.flipY,e.preferImageBitmap=t.preferImageBitmap)}return De.prototype.fetchImage.call(this,e)};tl.prototype._makeRequest=function(e){return this._isExternal||new bZ.default(this.url).authority()!==this._ionEndpointDomain?De.prototype._makeRequest.call(this,e):(e.headers=xZ(e.headers),e.headers.Authorization=`Bearer ${this._ionEndpoint.accessToken}`,De.prototype._makeRequest.call(this,e))};tl._createEndpointResource=function(e,t){t=t??H.EMPTY_OBJECT;let n=t.server??bf.defaultServer,i=t.accessToken??bf.defaultAccessToken;n=De.createIfNeeded(n);let r={url:`v1/assets/${e}/endpoint`};return l(i)&&(r.queryParameters={access_token:i}),l(t.queryParameters)&&(r.queryParameters={...r.queryParameters,...t.queryParameters}),r.headers=xZ(r.headers),n.getDerivedResource(r)};function xZ(e={}){return e["X-Cesium-Client"]="CesiumJS",typeof CESIUM_VERSION<"u"&&(e["X-Cesium-Client-Version"]=CESIUM_VERSION),e}tl._addClientHeaders=xZ;function Iat(e,t){let n=e._ionRoot??e,i=n._ionEndpointResource,r=typeof Image<"u";return!l(t)||t.statusCode!==401&&!(r&&t.target instanceof Image)?Promise.resolve(!1):(l(n._pendingPromise)||(n._pendingPromise=i.fetchJson().then(function(o){let s=e.refreshCallback??n.refreshCallback;return l(s)&&s(n,o),n._ionEndpoint=o,n._ionEndpoint}).finally(function(o){return n._pendingPromise=void 0,o})),n._pendingPromise.then(function(o){return e._ionEndpoint=o,!0}))}var es=tl;var TZ=new he,EZ=new he,Ebe=new h,Cbe=new h,CZ=class{constructor(t){ut(this,"_rectangleSouthwestInMeters");ut(this,"_rectangleNortheastInMeters");if(t=t??H.EMPTY_OBJECT,this._ellipsoid=t.ellipsoid??ee.default,this._numberOfLevelZeroTilesX=t.numberOfLevelZeroTilesX??1,this._numberOfLevelZeroTilesY=t.numberOfLevelZeroTilesY??1,this._projection=new Ti(this._ellipsoid),l(t.rectangleSouthwestInMeters)&&l(t.rectangleNortheastInMeters))this._rectangleSouthwestInMeters=t.rectangleSouthwestInMeters,this._rectangleNortheastInMeters=t.rectangleNortheastInMeters;else{let r=this._ellipsoid.maximumRadius*Math.PI;this._rectangleSouthwestInMeters=new U(-r,-r),this._rectangleNortheastInMeters=new U(r,r)}let{x:n,y:i}=this._rectangleSouthwestInMeters;h.fromElements(n,i,0,Ebe),this._projection.unproject(Ebe,TZ),{x:n,y:i}=this._rectangleNortheastInMeters,h.fromElements(n,i,0,Cbe),this._projection.unproject(Cbe,EZ),this._rectangle=new ie(TZ.longitude,TZ.latitude,EZ.longitude,EZ.latitude)}get ellipsoid(){return this._ellipsoid}get rectangle(){return this._rectangle}get projection(){return this._projection}getNumberOfXTilesAtLevel(t){return this._numberOfLevelZeroTilesX<<t}getNumberOfYTilesAtLevel(t){return this._numberOfLevelZeroTilesY<<t}rectangleToNativeRectangle(t,n){let i=this._projection,r=i.project(ie.southwest(t)),o=i.project(ie.northeast(t));return l(n)?(n.west=r.x,n.south=r.y,n.east=o.x,n.north=o.y,n):new ie(r.x,r.y,o.x,o.y)}tileXYToNativeRectangle(t,n,i,r){let o=this.getNumberOfXTilesAtLevel(i),s=this.getNumberOfYTilesAtLevel(i),a=(this._rectangleNortheastInMeters.x-this._rectangleSouthwestInMeters.x)/o,c=this._rectangleSouthwestInMeters.x+t*a,u=this._rectangleSouthwestInMeters.x+(t+1)*a,f=(this._rectangleNortheastInMeters.y-this._rectangleSouthwestInMeters.y)/s,d=this._rectangleNortheastInMeters.y-n*f,p=this._rectangleNortheastInMeters.y-(n+1)*f;return l(r)?(r.west=c,r.south=p,r.east=u,r.north=d,r):new ie(c,p,u,d)}tileXYToRectangle(t,n,i,r){let o=this.tileXYToNativeRectangle(t,n,i,r),s=this._projection,a=s.unproject(new h(o.west,o.south)),c=s.unproject(new h(o.east,o.north));return o.west=a.longitude,o.south=a.latitude,o.east=c.longitude,o.north=c.latitude,o}positionToTileXY(t,n,i){let r=this._rectangle;if(!ie.contains(r,t))return;let o=this.getNumberOfXTilesAtLevel(n),s=this.getNumberOfYTilesAtLevel(n),c=(this._rectangleNortheastInMeters.x-this._rectangleSouthwestInMeters.x)/o,f=(this._rectangleNortheastInMeters.y-this._rectangleSouthwestInMeters.y)/s,p=this._projection.project(t),g=p.x-this._rectangleSouthwestInMeters.x,m=this._rectangleNortheastInMeters.y-p.y,y=g/c|0;y>=o&&(y=o-1);let A=m/f|0;return A>=s&&(A=s-1),l(i)?(i.x=y,i.y=A,i):new U(y,A)}},Uo=CZ;var vZ,vbe="AAPTaeRGM19PsTpo1ePVkJZk4Tg..zqn3rpU4kUaF-8QMW-oWZntlxvKhdUFXLBoo5dQwRNEKd1EoKJh-Ha2zxbrz2Nhz2tV_gLVZTQwFHLzJHKwsGDz4GTKV8jeUgb12Ci9CeU_9sOrauJYnGK2vHhtSSAQ-73rmKzNG_2lZ0zuCCEKslxCmXUw2mT1Cpk0RoCCtDheWByX1e7Lnb3LKCBDt9VhGFSGCOiaFfizFRLld8LWukKgxCgluTpKgUuUi4OytX84roEpm6mP7PE91AT1_5Uash6To",Jv={};Jv.defaultAccessToken=vbe;Jv.defaultWorldImageryServer=new De({url:"https://ibasemaps-api.arcgis.com/arcgis/rest/services/World_Imagery/MapServer"});Jv.defaultWorldHillshadeServer=new De({url:"https://ibasemaps-api.arcgis.com/arcgis/rest/services/Elevation/World_Hillshade/MapServer"});Jv.defaultWorldOceanServer=new De({url:"https://ibasemaps-api.arcgis.com/arcgis/rest/services/Ocean/World_Ocean_Base/MapServer"});Jv.getDefaultTokenCredit=function(e){if(e===vbe){if(!l(vZ)){let t='<b> This application is using a default ArcGIS access token. Please assign <i>Cesium.ArcGisMapService.defaultAccessToken</i> with an API key from your ArcGIS Developer account before using the ArcGIS tile services. You can sign up for a free ArcGIS Developer account at <a href="https://developers.arcgis.com/">https://developers.arcgis.com/</a>.</b>';vZ=new It(t,!0)}return vZ}};var Id=Jv;function SZ(e){e=e??H.EMPTY_OBJECT,this._pixelsToCheck=e.pixelsToCheck,this._missingImagePixels=void 0,this._missingImageByteLength=void 0,this._isReady=!1;let t=De.createIfNeeded(e.missingImageUrl),n=this;function i(o){l(o.blob)&&(n._missingImageByteLength=o.blob.size);let s=Bm(o);if(e.disableCheckIfAllPixelsAreTransparent){let a=!0,c=o.width,u=e.pixelsToCheck;for(let f=0,d=u.length;a&&f<d;++f){let p=u[f],g=p.x*4+p.y*c;s[g+3]>0&&(a=!1)}a&&(s=void 0)}n._missingImagePixels=s,n._isReady=!0}function r(){n._missingImagePixels=void 0,n._isReady=!0}t.fetchImage({preferBlob:!0,preferImageBitmap:!0,flipY:!0}).then(i).catch(r)}SZ.prototype.isReady=function(){return this._isReady};SZ.prototype.shouldDiscardImage=function(e){let t=this._pixelsToCheck,n=this._missingImagePixels;if(!l(n)||l(e.blob)&&e.blob.size!==this._missingImageByteLength)return!1;let i=Bm(e),r=e.width;for(let o=0,s=t.length;o<s;++o){let a=t[o],c=a.x*4+a.y*r;for(let u=0;u<4;++u){let f=c+u;if(i[f]!==n[f])return!1}}return!0};var RV=SZ;function wZ(){this.name=void 0,this.description=void 0,this.position=void 0,this.data=void 0,this.imageryLayer=void 0}wZ.prototype.configureNameFromProperties=function(e){let t=10,n;for(let i in e)if(e.hasOwnProperty(i)&&e[i]){let r=i.toLowerCase();t>1&&r==="name"?(t=1,n=i):t>2&&r==="title"?(t=2,n=i):t>3&&/name/i.test(i)?(t=3,n=i):t>4&&/title/i.test(i)&&(t=4,n=i)}l(n)&&(this.name=e[n])};wZ.prototype.configureDescriptionFromProperties=function(e){function t(n){let i='<table class="cesium-infoBox-defaultTable">';for(let r in n)if(n.hasOwnProperty(r)){let o=n[r];l(o)&&(typeof o=="object"?i+=`<tr><td>${r}</td><td>${t(o)}</td></tr>`:i+=`<tr><td>${r}</td><td>${o}</td></tr>`)}return i+="</table>",i}this.description=t(e)};var Ip=wZ;function Zv(){pe.throwInstantiationError()}Object.defineProperties(Zv.prototype,{rectangle:{get:pe.throwInstantiationError},tileWidth:{get:pe.throwInstantiationError},tileHeight:{get:pe.throwInstantiationError},maximumLevel:{get:pe.throwInstantiationError},minimumLevel:{get:pe.throwInstantiationError},tilingScheme:{get:pe.throwInstantiationError},tileDiscardPolicy:{get:pe.throwInstantiationError},errorEvent:{get:pe.throwInstantiationError},credit:{get:pe.throwInstantiationError},proxy:{get:pe.throwInstantiationError},hasAlphaChannel:{get:pe.throwInstantiationError}});Zv.prototype.getTileCredits=function(e,t,n){pe.throwInstantiationError()};Zv.prototype.requestImage=function(e,t,n,i){pe.throwInstantiationError()};Zv.prototype.pickFeatures=function(e,t,n,i,r){pe.throwInstantiationError()};var Pat=/\.ktx2$/i;Zv.loadImage=function(e,t){let n=De.createIfNeeded(t);return Pat.test(n.url)?nf(n):l(e)&&l(e.tileDiscardPolicy)?n.fetchImage({preferBlob:!0,preferImageBitmap:!0,flipY:!0}):n.fetchImage({preferImageBitmap:!0,flipY:!0})};var Pd=Zv;var Sbe={SATELLITE:1,OCEANS:2,HILLSHADE:3};Object.freeze(Sbe);var Pp=Sbe;function wbe(e){this.useTiles=e.usePreCachedTilesIfAvailable??!0;let t=e.ellipsoid;this.tilingScheme=e.tilingScheme??new ir({ellipsoid:t}),this.rectangle=e.rectangle??this.tilingScheme.rectangle,this.ellipsoid=t;let n=e.credit;typeof n=="string"&&(n=new It(n)),this.credit=n,this.tileCredits=void 0,this.tileDiscardPolicy=e.tileDiscardPolicy,this.tileWidth=e.tileWidth??256,this.tileHeight=e.tileHeight??256,this.maximumLevel=e.maximumLevel}wbe.prototype.build=function(e){e._useTiles=this.useTiles,e._tilingScheme=this.tilingScheme,e._rectangle=this.rectangle,e._credit=this.credit,e._tileCredits=this.tileCredits,e._tileDiscardPolicy=this.tileDiscardPolicy,e._tileWidth=this.tileWidth,e._tileHeight=this.tileHeight,e._maximumLevel=this.maximumLevel,this.useTiles&&!l(this.tileDiscardPolicy)&&(e._tileDiscardPolicy=new RV({missingImageUrl:Ibe(e,0,0,this.maximumLevel).url,pixelsToCheck:[new U(0,0),new U(200,20),new U(20,200),new U(80,110),new U(160,130)],disableCheckIfAllPixelsAreTransparent:!0}))};function Dat(e,t){let n=e.tileInfo;if(!l(n))t.useTiles=!1;else{if(t.tileWidth=n.rows,t.tileHeight=n.cols,n.spatialReference.wkid===102100||n.spatialReference.wkid===102113)t.tilingScheme=new Uo({ellipsoid:t.ellipsoid});else if(e.tileInfo.spatialReference.wkid===4326)t.tilingScheme=new ir({ellipsoid:t.ellipsoid});else{let i=`Tile spatial reference WKID ${e.tileInfo.spatialReference.wkid} is not supported.`;throw new oe(i)}if(t.maximumLevel=e.tileInfo.lods.length-1,l(e.fullExtent)){if(l(e.fullExtent.spatialReference)&&l(e.fullExtent.spatialReference.wkid))if(e.fullExtent.spatialReference.wkid===102100||e.fullExtent.spatialReference.wkid===102113){let i=new Ti,r=e.fullExtent,o=i.unproject(new h(Math.max(r.xmin,-t.tilingScheme.ellipsoid.maximumRadius*Math.PI),Math.max(r.ymin,-t.tilingScheme.ellipsoid.maximumRadius*Math.PI),0)),s=i.unproject(new h(Math.min(r.xmax,t.tilingScheme.ellipsoid.maximumRadius*Math.PI),Math.min(r.ymax,t.tilingScheme.ellipsoid.maximumRadius*Math.PI),0));t.rectangle=new ie(o.longitude,o.latitude,s.longitude,s.latitude)}else if(e.fullExtent.spatialReference.wkid===4326)t.rectangle=ie.fromDegrees(e.fullExtent.xmin,e.fullExtent.ymin,e.fullExtent.xmax,e.fullExtent.ymax);else{let i=`fullExtent.spatialReference WKID ${e.fullExtent.spatialReference.wkid} is not supported.`;throw new oe(i)}}else t.rectangle=t.tilingScheme.rectangle;t.useTiles=!0}l(e.copyrightText)&&e.copyrightText.length>0&&(l(t.credit)?t.tileCredits=[new It(e.copyrightText)]:t.credit=new It(e.copyrightText))}function Rat(e,t){let n=`An error occurred while accessing ${e.url}`;throw l(t)&&l(t.message)&&(n+=`: ${t.message}`),new oe(n)}async function Oat(e,t){let n=e.getDerivedResource({queryParameters:{f:"json"}});try{let i=await n.fetchJson();Dat(i,t)}catch(i){Rat(e,i)}}function Dp(e){e=e??H.EMPTY_OBJECT,this._defaultAlpha=void 0,this._defaultNightAlpha=void 0,this._defaultDayAlpha=void 0,this._defaultBrightness=void 0,this._defaultContrast=void 0,this._defaultHue=void 0,this._defaultSaturation=void 0,this._defaultGamma=void 0,this._defaultMinificationFilter=void 0,this._defaultMagnificationFilter=void 0,this._tileDiscardPolicy=e.tileDiscardPolicy,this._tileWidth=e.tileWidth??256,this._tileHeight=e.tileHeight??256,this._maximumLevel=e.maximumLevel,this._tilingScheme=e.tilingScheme??new ir({ellipsoid:e.ellipsoid}),this._useTiles=e.usePreCachedTilesIfAvailable??!0,this._rectangle=e.rectangle??this._tilingScheme.rectangle,this._layers=e.layers,this._credit=e.credit,this._tileCredits=void 0,this.enablePickFeatures=e.enablePickFeatures??!0,this._errorEvent=new be}Dp.fromBasemapType=async function(e,t){t=t??H.EMPTY_OBJECT;let n,i,r;switch(e){case Pp.SATELLITE:{n=t.token??Id.defaultAccessToken,i=De.createIfNeeded(Id.defaultWorldImageryServer),i.appendForwardSlash();let o=Id.getDefaultTokenCredit(n);l(o)&&(r=It.clone(o))}break;case Pp.OCEANS:{n=t.token??Id.defaultAccessToken,i=De.createIfNeeded(Id.defaultWorldOceanServer),i.appendForwardSlash();let o=Id.getDefaultTokenCredit(n);l(o)&&(r=It.clone(o))}break;case Pp.HILLSHADE:{n=t.token??Id.defaultAccessToken,i=De.createIfNeeded(Id.defaultWorldHillshadeServer),i.appendForwardSlash();let o=Id.getDefaultTokenCredit(n);l(o)&&(r=It.clone(o))}break;default:}return Dp.fromUrl(i,{...t,token:n,credit:r,usePreCachedTilesIfAvailable:!0})};function Ibe(e,t,n,i,r){let o;if(e._useTiles)o=e._resource.getDerivedResource({url:`tile/${i}/${n}/${t}`,request:r});else{let s=e._tilingScheme.tileXYToNativeRectangle(t,n,i),c={bbox:`${s.west},${s.south},${s.east},${s.north}`,size:`${e._tileWidth},${e._tileHeight}`,format:"png32",transparent:!0,f:"image"};e._tilingScheme.projection instanceof ji?(c.bboxSR=4326,c.imageSR=4326):(c.bboxSR=3857,c.imageSR=3857),e.layers&&(c.layers=`show:${e.layers}`),o=e._resource.getDerivedResource({url:"export",request:r,queryParameters:c})}return o}Object.defineProperties(Dp.prototype,{url:{get:function(){return this._resource._url}},token:{get:function(){return this._resource.queryParameters.token}},proxy:{get:function(){return this._resource.proxy}},tileWidth:{get:function(){return this._tileWidth}},tileHeight:{get:function(){return this._tileHeight}},maximumLevel:{get:function(){return this._maximumLevel}},minimumLevel:{get:function(){return 0}},tilingScheme:{get:function(){return this._tilingScheme}},rectangle:{get:function(){return this._rectangle}},tileDiscardPolicy:{get:function(){return this._tileDiscardPolicy}},errorEvent:{get:function(){return this._errorEvent}},credit:{get:function(){return this._credit}},usingPrecachedTiles:{get:function(){return this._useTiles}},hasAlphaChannel:{get:function(){return!0}},layers:{get:function(){return this._layers}}});Dp.fromUrl=async function(e,t){t=t??H.EMPTY_OBJECT;let n=De.createIfNeeded(e);n.appendForwardSlash(),l(t.token)&&n.setQueryParameters({token:t.token});let i=new Dp(t);i._resource=n;let r=new wbe(t);return(t.usePreCachedTilesIfAvailable??!0)&&await Oat(n,r),r.build(i),i};Dp.prototype.getTileCredits=function(e,t,n){return this._tileCredits};Dp.prototype.requestImage=function(e,t,n,i){return Pd.loadImage(this,Ibe(this,e,t,n,i))};Dp.prototype.pickFeatures=function(e,t,n,i,r){if(!this.enablePickFeatures)return;let o=this._tilingScheme.tileXYToNativeRectangle(e,t,n),s,a,c;if(this._tilingScheme.projection instanceof ji)s=P.toDegrees(i),a=P.toDegrees(r),c="4326";else{let p=this._tilingScheme.projection.project(new he(i,r,0));s=p.x,a=p.y,c="3857"}let u="visible";l(this._layers)&&(u+=`:${this._layers}`);let f={f:"json",tolerance:2,geometryType:"esriGeometryPoint",geometry:`${s},${a}`,mapExtent:`${o.west},${o.south},${o.east},${o.north}`,imageDisplay:`${this._tileWidth},${this._tileHeight},96`,sr:c,layers:u};return this._resource.getDerivedResource({url:"identify",queryParameters:f}).fetchJson().then(function(p){let g=[],m=p.results;if(!l(m))return g;for(let y=0;y<m.length;++y){let A=m[y],b=new Ip;if(b.data=A,b.name=A.value,b.properties=A.attributes,b.configureDescriptionFromProperties(A.attributes),A.geometryType==="esriGeometryPoint"&&A.geometry){let x=A.geometry.spatialReference&&A.geometry.spatialReference.wkid?A.geometry.spatialReference.wkid:4326;if(x===4326||x===4283)b.position=he.fromDegrees(A.geometry.x,A.geometry.y,A.geometry.z);else if(x===102100||x===900913||x===3857){let T=new Ti;b.position=T.unproject(new h(A.geometry.x,A.geometry.y,A.geometry.z))}}g.push(b)}return g})};Dp._metadataCache={};var Dy=Dp;function OV(e,t,n,i,r,o,s){this.provider=e,this.message=t,this.x=n,this.y=i,this.level=r,this.timesRetried=o??0,this.retry=!1,this.error=s}OV.reportError=function(e,t,n,i,r,o,s,a){let c=e;return l(e)?(c.provider=t,c.message=i,c.x=r,c.y=o,c.level=s,c.retry=!1,c.error=a,++c.timesRetried):c=new OV(t,i,r,o,s,0,a),l(n)&&n.numberOfListeners>0?n.raiseEvent(c):l(t)&&console.log(`An error occurred in "${t.constructor.name}": ${z0(i)}`),c};OV.reportSuccess=function(e){l(e)&&(e.timesRetried=-1)};var no=OV;var Pbe={AERIAL:"Aerial",AERIAL_WITH_LABELS:"AerialWithLabels",AERIAL_WITH_LABELS_ON_DEMAND:"AerialWithLabelsOnDemand",ROAD:"Road",ROAD_ON_DEMAND:"RoadOnDemand",CANVAS_DARK:"CanvasDark",CANVAS_LIGHT:"CanvasLight",CANVAS_GRAY:"CanvasGray",ORDNANCE_SURVEY:"OrdnanceSurvey",COLLINS_BART:"CollinsBart"};Object.freeze(Pbe);var m1=Pbe;function p1(e){}p1.prototype.isReady=function(){return!0};p1.prototype.shouldDiscardImage=function(e){return p1.EMPTY_IMAGE===e};var MV;Object.defineProperties(p1,{EMPTY_IMAGE:{get:function(){return l(MV)||(MV=new Image,MV.src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAQAAAC1HAwCAAAAC0lEQVR42mNkYAAAAAYAAjCB0C8AAAAASUVORK5CYII="),MV}}});var g1=p1;function Dbe(e){this.tileWidth=void 0,this.tileHeight=void 0,this.maximumLevel=void 0,this.imageUrlSubdomains=void 0,this.imageUrlTemplate=void 0,this.attributionList=void 0}Dbe.prototype.build=function(e){e._tileWidth=this.tileWidth,e._tileHeight=this.tileHeight,e._maximumLevel=this.maximumLevel,e._imageUrlSubdomains=this.imageUrlSubdomains,e._imageUrlTemplate=this.imageUrlTemplate;let t=e._attributionList=this.attributionList;t||(t=[]),e._attributionList=t;for(let n=0,i=t.length;n<i;++n){let r=t[n];if(r.credit instanceof It)break;r.credit=new It(r.attribution);let o=r.coverageAreas;for(let s=0,a=r.coverageAreas.length;s<a;++s){let c=o[s],u=c.bbox;c.bbox=new ie(P.toRadians(u[1]),P.toRadians(u[0]),P.toRadians(u[3]),P.toRadians(u[2]))}}};function Mat(e,t){if(e.resourceSets.length!==1)throw new oe("metadata does not specify one resource in resourceSets");let n=e.resourceSets[0].resources[0];t.tileWidth=n.imageWidth,t.tileHeight=n.imageHeight,t.maximumLevel=n.zoomMax-1,t.imageUrlSubdomains=n.imageUrlSubdomains,t.imageUrlTemplate=n.imageUrl;let i=n.imageryProviders;l(n.imageryProviders)&&(i=n.imageryProviders.filter(r=>r.coverageAreas?.some(o=>l(o.bbox)))),t.attributionList=i}function Nat(e,t,n){let i=`An error occurred while accessing ${e.url}`;throw l(t)&&l(t.message)&&(i+=`: ${t.message}`),no.reportError(void 0,n,l(n)?n._errorEvent:void 0,i,void 0,void 0,void 0,t),new oe(i)}async function Lat(e,t,n){let i=e.url,r=pa._metadataCache[i];l(r)||(r=e.fetchJson(),pa._metadataCache[i]=r);try{let o=await r;return Mat(o,t)}catch(o){Nat(e,o,n)}}function pa(e){e=e??H.EMPTY_OBJECT,this._defaultAlpha=void 0,this._defaultNightAlpha=void 0,this._defaultDayAlpha=void 0,this._defaultBrightness=void 0,this._defaultContrast=void 0,this._defaultHue=void 0,this._defaultSaturation=void 0,this._defaultGamma=1,this._defaultMinificationFilter=void 0,this._defaultMagnificationFilter=void 0,this._mapStyle=e.mapStyle??m1.AERIAL,this._mapLayer=e.mapLayer,this._culture=e.culture??"",this._key=e.key,this._tileDiscardPolicy=e.tileDiscardPolicy,l(this._tileDiscardPolicy)||(this._tileDiscardPolicy=new g1),this._proxy=e.proxy,this._credit=new It(`<a href="https://www.microsoft.com/en-us/maps/bing-maps/product"><img src="${pa.logoUrl}" title="Bing Imagery"/></a>`),this._tilingScheme=new Uo({numberOfLevelZeroTilesX:2,numberOfLevelZeroTilesY:2,ellipsoid:e.ellipsoid}),this._tileWidth=void 0,this._tileHeight=void 0,this._maximumLevel=void 0,this._imageUrlTemplate=void 0,this._imageUrlSubdomains=void 0,this._attributionList=void 0,this._errorEvent=new be}Object.defineProperties(pa.prototype,{url:{get:function(){return this._resource.url}},proxy:{get:function(){return this._resource.proxy}},key:{get:function(){return this._key}},mapStyle:{get:function(){return this._mapStyle}},mapLayer:{get:function(){return this._mapLayer}},culture:{get:function(){return this._culture}},tileWidth:{get:function(){return this._tileWidth}},tileHeight:{get:function(){return this._tileHeight}},maximumLevel:{get:function(){return this._maximumLevel}},minimumLevel:{get:function(){return 0}},tilingScheme:{get:function(){return this._tilingScheme}},rectangle:{get:function(){return this._tilingScheme.rectangle}},tileDiscardPolicy:{get:function(){return this._tileDiscardPolicy}},errorEvent:{get:function(){return this._errorEvent}},credit:{get:function(){return this._credit}},hasAlphaChannel:{get:function(){return l(this.mapLayer)}}});pa.fromUrl=async function(e,t){t=t??H.EMPTY_OBJECT;let n=t.tileProtocol;l(n)?n.length>0&&n[n.length-1]===":"&&(n=n.substr(0,n.length-1)):n=document.location.protocol==="http:"?"http":"https";let i=t.mapStyle??m1.AERIAL,r=De.createIfNeeded(e);r.appendForwardSlash();let o={incl:"ImageryProviders",key:t.key,uriScheme:n};l(t.mapLayer)&&(o.mapLayer=t.mapLayer),l(t.culture)&&(o.culture=t.culture);let s=r.getDerivedResource({url:`REST/v1/Imagery/Metadata/${i}`,queryParameters:o}),a=new pa(t);a._resource=r;let c=new Dbe(t);return await Lat(s,c),c.build(a),a};var Fat=new ie;pa.prototype.getTileCredits=function(e,t,n){let i=this._tilingScheme.tileXYToRectangle(e,t,n,Fat);return Uat(this._attributionList,n,i)};pa.prototype.requestImage=function(e,t,n,i){let r=Pd.loadImage(this,Bat(this,e,t,n,i));if(l(r))return r.catch(function(o){return l(o.blob)&&o.blob.size===0?g1.EMPTY_IMAGE:Promise.reject(o)})};pa.prototype.pickFeatures=function(e,t,n,i,r){};pa.tileXYToQuadKey=function(e,t,n){let i="";for(let r=n;r>=0;--r){let o=1<<r,s=0;(e&o)!==0&&(s|=1),(t&o)!==0&&(s|=2),i+=s}return i};pa.quadKeyToTileXY=function(e){let t=0,n=0,i=e.length-1;for(let r=i;r>=0;--r){let o=1<<r,s=+e[i-r];(s&1)!==0&&(t|=o),(s&2)!==0&&(n|=o)}return{x:t,y:n,level:i}};pa._logoUrl=void 0;Object.defineProperties(pa,{logoUrl:{get:function(){return l(pa._logoUrl)||(pa._logoUrl=Zt("Assets/Images/bing_maps_credit.png")),pa._logoUrl},set:function(e){pa._logoUrl=e}}});function Bat(e,t,n,i,r){let o=e._imageUrlTemplate,s=e._imageUrlSubdomains,a=(t+n+i)%s.length;return e._resource.getDerivedResource({url:o,request:r,templateValues:{quadkey:pa.tileXYToQuadKey(t,n,i),subdomain:s[a],culture:e._culture},queryParameters:{n:"z"}})}var kat=new ie;function Uat(e,t,n){++t;let i=[];for(let r=0,o=e.length;r<o;++r){let s=e[r],a=s.coverageAreas,c=!1;for(let u=0,f=s.coverageAreas.length;!c&&u<f;++u){let d=a[u];if(t>=d.zoomMin&&t<=d.zoomMax){let p=ie.intersection(n,d.bbox,kat);l(p)&&(c=!0)}}c&&i.push(s.credit)}return i}pa._metadataCache={};var NV=pa;var Rbe=/{[^}]+}/g,Obe={x:Hat,y:Wat,z:Xat,s:Kat,reverseX:Gat,reverseY:qat,reverseZ:Yat,westDegrees:$at,southDegrees:Jat,eastDegrees:Zat,northDegrees:Qat,westProjected:ect,southProjected:tct,eastProjected:nct,northProjected:ict,width:rct,height:oct},zat=Mt(Obe,{i:sct,j:act,reverseI:cct,reverseJ:lct,longitudeDegrees:fct,latitudeDegrees:dct,longitudeProjected:hct,latitudeProjected:mct,format:gct});function _1(e){e=e??H.EMPTY_OBJECT,this._errorEvent=new be;let t=De.createIfNeeded(e.url),n=De.createIfNeeded(e.pickFeaturesUrl);this._resource=t,this._urlSchemeZeroPadding=e.urlSchemeZeroPadding,this._getFeatureInfoFormats=e.getFeatureInfoFormats,this._pickFeaturesResource=n;let i=e.subdomains;Array.isArray(i)?i=i.slice():l(i)&&i.length>0?i=i.split(""):i=["a","b","c"],this._subdomains=i,this._tileWidth=e.tileWidth??256,this._tileHeight=e.tileHeight??256,this._minimumLevel=e.minimumLevel??0,this._maximumLevel=e.maximumLevel,this._tilingScheme=e.tilingScheme??new Uo({ellipsoid:e.ellipsoid}),this._rectangle=e.rectangle??this._tilingScheme.rectangle,this._rectangle=ie.intersection(this._rectangle,this._tilingScheme.rectangle),this._tileDiscardPolicy=e.tileDiscardPolicy;let r=e.credit;typeof r=="string"&&(r=new It(r)),this._credit=r,this._hasAlphaChannel=e.hasAlphaChannel??!0;let o=e.customTags,s=Mt(Obe,o),a=Mt(zat,o);this._tags=s,this._pickFeaturesTags=a,this._defaultAlpha=void 0,this._defaultNightAlpha=void 0,this._defaultDayAlpha=void 0,this._defaultBrightness=void 0,this._defaultContrast=void 0,this._defaultHue=void 0,this._defaultSaturation=void 0,this._defaultGamma=void 0,this._defaultMinificationFilter=void 0,this._defaultMagnificationFilter=void 0,this.enablePickFeatures=e.enablePickFeatures??!0}Object.defineProperties(_1.prototype,{url:{get:function(){return this._resource.url}},urlSchemeZeroPadding:{get:function(){return this._urlSchemeZeroPadding}},pickFeaturesUrl:{get:function(){return this._pickFeaturesResource.url}},proxy:{get:function(){return this._resource.proxy}},tileWidth:{get:function(){return this._tileWidth}},tileHeight:{get:function(){return this._tileHeight}},maximumLevel:{get:function(){return this._maximumLevel}},minimumLevel:{get:function(){return this._minimumLevel}},tilingScheme:{get:function(){return this._tilingScheme}},rectangle:{get:function(){return this._rectangle}},tileDiscardPolicy:{get:function(){return this._tileDiscardPolicy}},errorEvent:{get:function(){return this._errorEvent}},credit:{get:function(){return this._credit}},hasAlphaChannel:{get:function(){return this._hasAlphaChannel}}});_1.prototype.getTileCredits=function(e,t,n){};_1.prototype.requestImage=function(e,t,n,i){return Pd.loadImage(this,Vat(this,e,t,n,i))};_1.prototype.pickFeatures=function(e,t,n,i,r){if(!this.enablePickFeatures||!l(this._pickFeaturesResource)||this._getFeatureInfoFormats.length===0)return;let o=0,s=this;function a(u,f){return u.callback(f)}function c(){if(o>=s._getFeatureInfoFormats.length)return Promise.resolve([]);let u=s._getFeatureInfoFormats[o],f=jat(s,e,t,n,i,r,u.format);return++o,u.type==="json"?f.fetchJson().then(u.callback).catch(c):u.type==="xml"?f.fetchXML().then(u.callback).catch(c):u.type==="text"||u.type==="html"?f.fetchText().then(u.callback).catch(c):f.fetch({responseType:u.format}).then(a.bind(void 0,u)).catch(c)}return c()};var LV=!1,xf=new ie,FV=!1,y1=new ie;function Vat(e,t,n,i,r){LV=!1,FV=!1;let o=e._resource,s=o.getUrlComponent(!0),a=e._tags,c={},u=s.match(Rbe);return l(u)&&u.forEach(function(f){let d=f.substring(1,f.length-1);l(a[d])&&(c[d]=a[d](e,t,n,i))}),o.getDerivedResource({request:r,templateValues:c})}var IZ=!1,eS=new U,PZ=!1;function jat(e,t,n,i,r,o,s){LV=!1,FV=!1,IZ=!1,PZ=!1;let a=e._pickFeaturesResource,c=a.getUrlComponent(!0),u=e._pickFeaturesTags,f={},d=c.match(Rbe);return l(d)&&d.forEach(function(p){let g=p.substring(1,p.length-1);l(u[g])&&(f[g]=u[g](e,t,n,i,r,o,s))}),a.getDerivedResource({templateValues:f})}function tS(e,t,n){if(e&&e.urlSchemeZeroPadding&&e.urlSchemeZeroPadding.hasOwnProperty(t)){let i=e.urlSchemeZeroPadding[t];if(typeof i=="string"){let r=i.length;r>1&&(n=n.length>=r?n:new Array(r-n.toString().length+1).join("0")+n)}}return n}function Hat(e,t,n,i){return tS(e,"{x}",t)}function Gat(e,t,n,i){let r=e.tilingScheme.getNumberOfXTilesAtLevel(i)-t-1;return tS(e,"{reverseX}",r)}function Wat(e,t,n,i){return tS(e,"{y}",n)}function qat(e,t,n,i){let r=e.tilingScheme.getNumberOfYTilesAtLevel(i)-n-1;return tS(e,"{reverseY}",r)}function Yat(e,t,n,i){let r=e.maximumLevel,o=l(r)&&i<r?r-i-1:i;return tS(e,"{reverseZ}",o)}function Xat(e,t,n,i){return tS(e,"{z}",i)}function Kat(e,t,n,i){let r=(t+n+i)%e._subdomains.length;return e._subdomains[r]}function BV(e,t,n,i){LV||(e.tilingScheme.tileXYToRectangle(t,n,i,xf),xf.west=P.toDegrees(xf.west),xf.south=P.toDegrees(xf.south),xf.east=P.toDegrees(xf.east),xf.north=P.toDegrees(xf.north),LV=!0)}function $at(e,t,n,i){return BV(e,t,n,i),xf.west}function Jat(e,t,n,i){return BV(e,t,n,i),xf.south}function Zat(e,t,n,i){return BV(e,t,n,i),xf.east}function Qat(e,t,n,i){return BV(e,t,n,i),xf.north}function kV(e,t,n,i){FV||(e.tilingScheme.tileXYToNativeRectangle(t,n,i,y1),FV=!0)}function ect(e,t,n,i){return kV(e,t,n,i),y1.west}function tct(e,t,n,i){return kV(e,t,n,i),y1.south}function nct(e,t,n,i){return kV(e,t,n,i),y1.east}function ict(e,t,n,i){return kV(e,t,n,i),y1.north}function rct(e,t,n,i){return e.tileWidth}function oct(e,t,n,i){return e.tileHeight}function sct(e,t,n,i,r,o,s){return UV(e,t,n,i,r,o),eS.x}function act(e,t,n,i,r,o,s){return UV(e,t,n,i,r,o),eS.y}function cct(e,t,n,i,r,o,s){return UV(e,t,n,i,r,o),e.tileWidth-eS.x-1}function lct(e,t,n,i,r,o,s){return UV(e,t,n,i,r,o),e.tileHeight-eS.y-1}var uct=new ie,Qv=new h;function UV(e,t,n,i,r,o,s){if(IZ)return;DZ(e,t,n,i,r,o);let a=Qv,c=e.tilingScheme.tileXYToNativeRectangle(t,n,i,uct);eS.x=e.tileWidth*(a.x-c.west)/c.width|0,eS.y=e.tileHeight*(c.north-a.y)/c.height|0,IZ=!0}function fct(e,t,n,i,r,o,s){return P.toDegrees(r)}function dct(e,t,n,i,r,o,s){return P.toDegrees(o)}function hct(e,t,n,i,r,o,s){return DZ(e,t,n,i,r,o),Qv.x}function mct(e,t,n,i,r,o,s){return DZ(e,t,n,i,r,o),Qv.y}var pct=new he;function DZ(e,t,n,i,r,o,s){if(!PZ){if(e.tilingScheme.projection instanceof ji)Qv.x=P.toDegrees(r),Qv.y=P.toDegrees(o);else{let a=pct;a.longitude=r,a.latitude=o,e.tilingScheme.projection.project(a,Qv)}PZ=!0}}function gct(e,t,n,i,r,o,s){return s}var Os=_1;function Dd(e){Os.call(this,e)}Dd._requestMetadata=async function(e,t,n,i){try{let r=await n.fetchXML();return Dd._metadataSuccess(r,e,t,n,i)}catch(r){if(r instanceof O0)return Dd._metadataFailure(e,t);throw r}};Dd.fromUrl=async function(e,t){let n=De.createIfNeeded(e);n.appendForwardSlash();let i=n,r=n.getDerivedResource({url:"tilemapresource.xml"});t=t??H.EMPTY_OBJECT;let o=await Dd._requestMetadata(t,i,r);return new Dd(o)};l(Object.create)&&(Dd.prototype=Object.create(Os.prototype),Dd.prototype.constructor=Dd);function Mbe(e,t){return e.west<t.rectangle.west&&(e.west=t.rectangle.west),e.east>t.rectangle.east&&(e.east=t.rectangle.east),e.south<t.rectangle.south&&(e.south=t.rectangle.south),e.north>t.rectangle.north&&(e.north=t.rectangle.north),e}function Nbe(e,t,n){let i=e.positionToTileXY(ie.southwest(t),n),r=e.positionToTileXY(ie.northeast(t),n);return(Math.abs(r.x-i.x)+1)*(Math.abs(r.y-i.y)+1)>4?0:n}Dd._metadataSuccess=function(e,t,n,i,r){let o=/tileformat/i,s=/tileset/i,a=/tilesets/i,c=/boundingbox/i,u,f,d,p=[],g=e.childNodes[0].childNodes;for(let R=0;R<g.length;R++)if(o.test(g.item(R).nodeName))u=g.item(R);else if(a.test(g.item(R).nodeName)){d=g.item(R);let O=g.item(R).childNodes;for(let L=0;L<O.length;L++)s.test(O.item(L).nodeName)&&p.push(O.item(L))}else c.test(g.item(R).nodeName)&&(f=g.item(R));let m;if(!l(d)||!l(f))throw m=`Unable to find expected tilesets or bbox attributes in ${i.url}.`,l(r)&&no.reportError(void 0,r,r.errorEvent,m),new oe(m);let y=t.fileExtension??u.getAttribute("extension"),A=t.tileWidth??parseInt(u.getAttribute("width"),10),b=t.tileHeight??parseInt(u.getAttribute("height"),10),x=t.minimumLevel??parseInt(p[0].getAttribute("order"),10),T=t.maximumLevel??parseInt(p[p.length-1].getAttribute("order"),10),E=d.getAttribute("profile"),v=t.tilingScheme;if(!l(v))if(E==="geodetic"||E==="global-geodetic")v=new ir({ellipsoid:t.ellipsoid});else if(E==="mercator"||E==="global-mercator")v=new Uo({ellipsoid:t.ellipsoid});else throw m=`${i.url} specifies an unsupported profile attribute, ${E}.`,l(r)&&no.reportError(void 0,r,r.errorEvent,m),new oe(m);let S=ie.clone(t.rectangle);if(!l(S)){let R,O,L,_;t.flipXY??!1?(L=new U(parseFloat(f.getAttribute("miny")),parseFloat(f.getAttribute("minx"))),_=new U(parseFloat(f.getAttribute("maxy")),parseFloat(f.getAttribute("maxx")))):(L=new U(parseFloat(f.getAttribute("minx")),parseFloat(f.getAttribute("miny"))),_=new U(parseFloat(f.getAttribute("maxx")),parseFloat(f.getAttribute("maxy"))));let w=E==="geodetic"||E==="mercator";if(v.projection instanceof ji||w)R=he.fromDegrees(L.x,L.y),O=he.fromDegrees(_.x,_.y);else{let D=v.projection;R=D.unproject(L),O=D.unproject(_)}S=new ie(R.longitude,R.latitude,O.longitude,O.latitude)}return S=Mbe(S,v),x=Nbe(v,S,x),{url:n.getDerivedResource({url:`{z}/{x}/{reverseY}.${y}`}),tilingScheme:v,rectangle:S,tileWidth:A,tileHeight:b,minimumLevel:x,maximumLevel:T,tileDiscardPolicy:t.tileDiscardPolicy,credit:t.credit}};Dd._metadataFailure=function(e,t){let n=e.fileExtension??"png",i=e.tileWidth??256,r=e.tileHeight??256,o=e.maximumLevel,s=l(e.tilingScheme)?e.tilingScheme:new Uo({ellipsoid:e.ellipsoid}),a=e.rectangle??s.rectangle;a=Mbe(a,s);let c=Nbe(s,a,e.minimumLevel);return{url:t.getDerivedResource({url:`{z}/{x}/{reverseY}.${n}`}),tilingScheme:s,rectangle:a,tileWidth:i,tileHeight:r,minimumLevel:c,maximumLevel:o,tileDiscardPolicy:e.tileDiscardPolicy,credit:e.credit}};var Ix=Dd;function Lbe(e){this.channel=e.channel,this.ellipsoid=e.ellipsoid,this.tilingScheme=void 0,this.version=void 0}Lbe.prototype.build=function(e){e._channel=this.channel,e._version=this.version,e._tilingScheme=this.tilingScheme};function _ct(e,t){let n;try{n=JSON.parse(e)}catch{n=JSON.parse(e.replace(/([\[\{,])[\n\r ]*([A-Za-z0-9]+)[\n\r ]*:/g,'$1"$2":'))}let i;for(let r=0;r<n.layers.length;r++)if(n.layers[r].id===t.channel){i=n.layers[r];break}if(!l(i)){let r=`Could not find layer with channel (id) of ${t.channel}.`;throw new oe(r)}if(!l(i.version)){let r=`Could not find a version in channel (id) ${t.channel}.`;throw new oe(r)}if(t.version=i.version,l(n.projection)&&n.projection==="flat")t.tilingScheme=new ir({numberOfLevelZeroTilesX:2,numberOfLevelZeroTilesY:2,rectangle:new ie(-Math.PI,-Math.PI,Math.PI,Math.PI),ellipsoid:t.ellipsoid});else if(!l(n.projection)||n.projection==="mercator")t.tilingScheme=new Uo({numberOfLevelZeroTilesX:2,numberOfLevelZeroTilesY:2,ellipsoid:t.ellipsoid});else{let r=`Unsupported projection ${n.projection}.`;throw new oe(r)}return!0}function yct(e,t,n){let i=`An error occurred while accessing ${t.url}.`;throw l(e)&&l(e.message)&&(i+=`: ${e.message}`),no.reportError(void 0,n,l(n)?n._errorEvent:void 0,i),new oe(i)}async function Act(e,t,n){try{let i=await e.fetchText();_ct(i,t)}catch(i){yct(i,e,n)}}function Ru(e){e=e??{},this._defaultAlpha=void 0,this._defaultNightAlpha=void 0,this._defaultDayAlpha=void 0,this._defaultBrightness=void 0,this._defaultContrast=void 0,this._defaultHue=void 0,this._defaultSaturation=void 0,this._defaultGamma=1.9,this._defaultMinificationFilter=void 0,this._defaultMagnificationFilter=void 0,this._tileDiscardPolicy=e.tileDiscardPolicy,this._channel=e.channel,this._requestType="ImageryMaps",this._credit=new It(`<a href="http://www.google.com/enterprise/mapsearth/products/earthenterprise.html"><img src="${Ru.logoUrl}" title="Google Imagery"/></a>`),this._tilingScheme=void 0,this._version=void 0,this._tileWidth=256,this._tileHeight=256,this._maximumLevel=e.maximumLevel,this._errorEvent=new be}Object.defineProperties(Ru.prototype,{url:{get:function(){return this._url}},path:{get:function(){return this._path}},proxy:{get:function(){return this._resource.proxy}},channel:{get:function(){return this._channel}},tileWidth:{get:function(){return this._tileWidth}},tileHeight:{get:function(){return this._tileHeight}},maximumLevel:{get:function(){return this._maximumLevel}},minimumLevel:{get:function(){return 0}},tilingScheme:{get:function(){return this._tilingScheme}},version:{get:function(){return this._version}},requestType:{get:function(){return this._requestType}},rectangle:{get:function(){return this._tilingScheme.rectangle}},tileDiscardPolicy:{get:function(){return this._tileDiscardPolicy}},errorEvent:{get:function(){return this._errorEvent}},credit:{get:function(){return this._credit}},hasAlphaChannel:{get:function(){return!0}}});Ru.fromUrl=async function(e,t,n){n=n??{};let i=n.path??"/default_map",r=De.createIfNeeded(e).getDerivedResource({url:i[0]==="/"?i.substring(1):i});r.appendForwardSlash();let o=r.getDerivedResource({url:"query",queryParameters:{request:"Json",vars:"geeServerDefs",is2d:"t"}}),s=new Lbe(n);s.channel=t,await Act(o,s);let a=new Ru(n);return s.build(a),a._resource=r,a._url=e,a._path=i,a};Ru.prototype.getTileCredits=function(e,t,n){};Ru.prototype.requestImage=function(e,t,n,i){let r=this._resource.getDerivedResource({url:"query",request:i,queryParameters:{request:this._requestType,channel:this._channel,version:this._version,x:e,y:t,z:n+1}});return Pd.loadImage(this,r)};Ru.prototype.pickFeatures=function(e,t,n,i,r){};Ru._logoUrl=void 0;Object.defineProperties(Ru,{logoUrl:{get:function(){return l(Ru._logoUrl)||(Ru._logoUrl=Zt("Assets/Images/google_earth_credit.png")),Ru._logoUrl},set:function(e){Ru._logoUrl=e}}});var zV=Ru;var bct=/\/$/,Fbe=new It('© <a href="https://www.mapbox.com/about/maps/">Mapbox</a> © <a href="http://www.openstreetmap.org/copyright">OpenStreetMap</a> <strong><a href="https://www.mapbox.com/map-feedback/">Improve this map</a></strong>');function nS(e){e=e??H.EMPTY_OBJECT;let t=e.mapId,n=e.accessToken;this._defaultAlpha=void 0,this._defaultNightAlpha=void 0,this._defaultDayAlpha=void 0,this._defaultBrightness=void 0,this._defaultContrast=void 0,this._defaultHue=void 0,this._defaultSaturation=void 0,this._defaultGamma=void 0,this._defaultMinificationFilter=void 0,this._defaultMagnificationFilter=void 0;let i=De.createIfNeeded(e.url??"https://{s}.tiles.mapbox.com/v4/");this._mapId=t,this._accessToken=n;let r=e.format??"png";/\./.test(r)||(r=`.${r}`),this._format=r;let o=i.getUrlComponent();bct.test(o)||(o+="/"),o+=`${t}/{z}/{x}/{y}${this._format}`,i.url=o,i.setQueryParameters({access_token:n});let s;l(e.credit)?(s=e.credit,typeof s=="string"&&(s=new It(s))):s=Fbe,this._resource=i,this._imageryProvider=new Os({url:i,credit:s,ellipsoid:e.ellipsoid,minimumLevel:e.minimumLevel,maximumLevel:e.maximumLevel,rectangle:e.rectangle})}Object.defineProperties(nS.prototype,{url:{get:function(){return this._imageryProvider.url}},rectangle:{get:function(){return this._imageryProvider.rectangle}},tileWidth:{get:function(){return this._imageryProvider.tileWidth}},tileHeight:{get:function(){return this._imageryProvider.tileHeight}},maximumLevel:{get:function(){return this._imageryProvider.maximumLevel}},minimumLevel:{get:function(){return this._imageryProvider.minimumLevel}},tilingScheme:{get:function(){return this._imageryProvider.tilingScheme}},tileDiscardPolicy:{get:function(){return this._imageryProvider.tileDiscardPolicy}},errorEvent:{get:function(){return this._imageryProvider.errorEvent}},credit:{get:function(){return this._imageryProvider.credit}},proxy:{get:function(){return this._imageryProvider.proxy}},hasAlphaChannel:{get:function(){return this._imageryProvider.hasAlphaChannel}}});nS.prototype.getTileCredits=function(e,t,n){};nS.prototype.requestImage=function(e,t,n,i){return this._imageryProvider.requestImage(e,t,n,i)};nS.prototype.pickFeatures=function(e,t,n,i,r){return this._imageryProvider.pickFeatures(e,t,n,i,r)};nS._defaultCredit=Fbe;var VV=nS;function Px(e){e=e??H.EMPTY_OBJECT,this._defaultAlpha=void 0,this._defaultNightAlpha=void 0,this._defaultDayAlpha=void 0,this._defaultBrightness=void 0,this._defaultContrast=void 0,this._defaultHue=void 0,this._defaultSaturation=void 0,this._defaultGamma=void 0,this._defaultMinificationFilter=void 0,this._defaultMagnificationFilter=void 0;let t=e.rectangle??ie.MAX_VALUE,n=new ir({rectangle:t,numberOfLevelZeroTilesX:1,numberOfLevelZeroTilesY:1,ellipsoid:e.ellipsoid});this._tilingScheme=n,this._image=void 0,this._texture=void 0,this._hasError=!1,this._errorEvent=new be;let i=e.credit;typeof i=="string"&&(i=new It(i)),this._credit=i;let r=De.createIfNeeded(e.url);this._resource=r,this._tileWidth=e.tileWidth,this._tileHeight=e.tileHeight}Object.defineProperties(Px.prototype,{url:{get:function(){return this._resource.url}},proxy:{get:function(){return this._resource.proxy}},tileWidth:{get:function(){return this._tileWidth}},tileHeight:{get:function(){return this._tileHeight}},maximumLevel:{get:function(){return 0}},minimumLevel:{get:function(){return 0}},tilingScheme:{get:function(){return this._tilingScheme}},rectangle:{get:function(){return this._tilingScheme.rectangle}},tileDiscardPolicy:{get:function(){}},errorEvent:{get:function(){return this._errorEvent}},credit:{get:function(){return this._credit}},hasAlphaChannel:{get:function(){return!0}}});function xct(e,t,n,i){let r=`Failed to load image ${e.url}`;l(t)&&l(t.message)&&(r+=`: ${t.message}`);let o=no.reportError(i,n,l(n)?n._errorEvent:void 0,r,0,0,0,t);if(o.retry)return RZ(e,n,o);throw l(n)&&(n._hasError=!0),new oe(r)}async function RZ(e,t,n){try{return await Pd.loadImage(null,e)}catch(i){return xct(e,i,t,n)}}Px.fromUrl=async function(e,t){let n=De.createIfNeeded(e),i=await RZ(n);t=t??H.EMPTY_OBJECT;let r=new Px({...t,url:e,tileWidth:i.width,tileHeight:i.height});return r._image=i,r};Px.prototype.getTileCredits=function(e,t,n){};Px.prototype.requestImage=async function(e,t,n,i){if(!this._hasError&&!l(this._image)){let r=await RZ(this._resource,this);return this._image=r,no.reportSuccess(this._errorEvent),r}return this._image};Px.prototype.pickFeatures=function(e,t,n,i,r){};var jV=Px;function Tct(e,t,n){this.type=e,l(t)||(e==="json"?t="application/json":e==="xml"?t="text/xml":e==="html"?t="text/html":e==="text"&&(t="text/plain")),this.format=t,l(n)||(e==="json"?n=Ect:e==="xml"?n=wct:(e==="html"||e==="text")&&(n=Bbe)),this.callback=n}function Ect(e){let t=[],n=e.features;for(let i=0;i<n.length;++i){let r=n[i],o=new Ip;if(o.data=r,o.properties=r.properties,o.configureNameFromProperties(r.properties),o.configureDescriptionFromProperties(r.properties),l(r.geometry)&&r.geometry.type==="Point"){let s=r.geometry.coordinates[0],a=r.geometry.coordinates[1];o.position=he.fromDegrees(s,a)}t.push(o)}return t}var OZ="http://www.mapinfo.com/mxp",Cct="http://www.esri.com/wms",vct="http://www.opengis.net/wfs",Sct="http://www.opengis.net/gml";function wct(e){let t=e.documentElement;if(t.localName==="MultiFeatureCollection"&&t.namespaceURI===OZ)return Ict(e);if(t.localName==="FeatureInfoResponse"&&t.namespaceURI===Cct)return Pct(e);if(t.localName==="FeatureCollection"&&t.namespaceURI===vct)return Dct(e);if(t.localName==="ServiceExceptionReport")throw new oe(new XMLSerializer().serializeToString(t));return t.localName==="msGMLOutput"?Rct(e):Oct(e)}function Ict(e){let t=[],i=e.documentElement.getElementsByTagNameNS(OZ,"Feature");for(let r=0;r<i.length;++r){let o=i[r],s={},a=o.getElementsByTagNameNS(OZ,"Val");for(let u=0;u<a.length;++u){let f=a[u];if(f.hasAttribute("ref")){let d=f.getAttribute("ref"),p=f.textContent.trim();s[d]=p}}let c=new Ip;c.data=o,c.properties=s,c.configureNameFromProperties(s),c.configureDescriptionFromProperties(s),t.push(c)}return t}function Pct(e){let t=e.documentElement,n=[],i,r=t.getElementsByTagNameNS("*","FIELDS");if(r.length>0)for(let o=0;o<r.length;++o){let s=r[o];i={};let a=s.attributes;for(let c=0;c<a.length;++c){let u=a[c];i[u.name]=u.value}n.push(HV(s,i))}else{let o=t.getElementsByTagNameNS("*","FeatureInfo");for(let s=0;s<o.length;++s){let a=o[s];i={};let c=a.childNodes;for(let u=0;u<c.length;++u){let f=c[u];f.nodeType===Node.ELEMENT_NODE&&(i[f.localName]=f.textContent)}n.push(HV(a,i))}}return n}function Dct(e){let t=[],i=e.documentElement.getElementsByTagNameNS(Sct,"featureMember");for(let r=0;r<i.length;++r){let o=i[r],s={};MZ(o,s),t.push(HV(o,s))}return t}function Rct(e){let t=[],n,i=e.documentElement.childNodes;for(let o=0;o<i.length;o++)if(i[o].nodeType===Node.ELEMENT_NODE){n=i[o];break}if(!l(n))throw new oe("Unable to find first child of the feature info xml document");let r=n.childNodes;for(let o=0;o<r.length;++o){let s=r[o];if(s.nodeType===Node.ELEMENT_NODE){let a={};MZ(s,a),t.push(HV(s,a))}}return t}function MZ(e,t){let n=!0;for(let i=0;i<e.childNodes.length;++i){let r=e.childNodes[i];r.nodeType===Node.ELEMENT_NODE&&(n=!1),!(r.localName==="Point"||r.localName==="LineString"||r.localName==="Polygon"||r.localName==="boundedBy")&&r.hasChildNodes()&&MZ(r,t)&&(t[r.localName]=r.textContent)}return n}function HV(e,t){let n=new Ip;return n.data=e,n.properties=t,n.configureNameFromProperties(t),n.configureDescriptionFromProperties(t),n}function Oct(e){let t=new XMLSerializer().serializeToString(e),n=document.createElement("div"),i=document.createElement("pre");i.textContent=t,n.appendChild(i);let r=new Ip;return r.data=e,r.description=n.innerHTML,[r]}var Mct=/<body>\s*<\/body>/im,Nct=/<ServiceExceptionReport([\s\S]*)<\/ServiceExceptionReport>/im,Lct=/<title>([\s\S]*)<\/title>/im;function Bbe(e){if(Mct.test(e)||Nct.test(e))return;let t,n=Lct.exec(e);n&&n.length>1&&(t=n[1]);let i=new Ip;return i.name=t,i.description=e,i.data=e,[i]}var Rp=Tct;function A1(e){e=e??H.EMPTY_OBJECT,this._tileCache={},this._tilesRequestedForInterval=[];let t=this._clock=e.clock;this._times=e.times,this._requestImageFunction=e.requestImageFunction,this._reloadFunction=e.reloadFunction,this._currentIntervalIndex=-1,t.onTick.addEventListener(this._clockOnTick,this),this._clockOnTick(t)}Object.defineProperties(A1.prototype,{clock:{get:function(){return this._clock},set:function(e){this._clock!==e&&(this._clock=e,this._clockOnTick(e),this._reloadFunction())}},times:{get:function(){return this._times},set:function(e){this._times!==e&&(this._times=e,this._clockOnTick(this._clock),this._reloadFunction())}},currentInterval:{get:function(){return this._times.get(this._currentIntervalIndex)}}});A1.prototype.getFromCache=function(e,t,n,i){let r=kbe(e,t,n),o,s=this._tileCache[this._currentIntervalIndex];if(l(s)&&l(s[r])){let a=s[r];o=a.promise.catch(function(c){throw i.state=a.request.state,c}),delete s[r]}return o};A1.prototype.checkApproachingInterval=function(e,t,n,i){let r=kbe(e,t,n),o=this._tilesRequestedForInterval,s=Ube(this),a={key:r,priorityFunction:i.priorityFunction};(!l(s)||!zbe(this,a,s))&&o.push(a),o.length>=512&&o.splice(0,256)};A1.prototype._clockOnTick=function(e){let t=e.currentTime,i=this._times.indexOf(t),r=this._currentIntervalIndex;if(i!==r){let s=this._tileCache[r];for(let a in s)s.hasOwnProperty(a)&&s[a].request.cancel();delete this._tileCache[r],this._tilesRequestedForInterval=[],this._currentIntervalIndex=i,this._reloadFunction();return}let o=Ube(this);if(l(o)){let s=this._tilesRequestedForInterval,a=!0;for(;a&&s.length!==0;){let c=s.pop();a=zbe(this,c,o),a||s.push(c)}}};function kbe(e,t,n){return`${e}-${t}-${n}`}function Fct(e){let t=e.split("-");if(t.length===3)return{x:Number(t[0]),y:Number(t[1]),level:Number(t[2])}}function Ube(e){let t=e._times;if(!l(t))return;let n=e._clock,i=n.currentTime,r=n.canAnimate&&n.shouldAnimate,o=n.multiplier;if(!r&&o!==0)return;let s,a=t.indexOf(i);if(a<0)return;let c=t.get(a);return o>0?(s=K.secondsDifference(c.stop,i),++a):(s=K.secondsDifference(c.start,i),--a),s/=o,a>=0&&s<=5?t.get(a):void 0}function zbe(e,t,n){let i=e._times.indexOf(n.start),r=e._tileCache,o=r[i];l(o)||(o=r[i]={});let s=t.key;if(l(o[s]))return!0;let a=Fct(s),c=new Oo({throttle:!1,throttleByServer:!0,type:oa.IMAGERY,priorityFunction:t.priorityFunction}),u=e._requestImageFunction(a.x,a.y,a.level,c,n);return l(u)?(o[s]={promise:u,request:c},!0):!1}var iS=A1;var Bct=[3034,3035,3042,3043,3044],kct=[4471,4559];function Wh(e){if(e=e??H.EMPTY_OBJECT,l(e.times)&&!l(e.clock))throw new pe("options.times was specified, so options.clock is required.");this._defaultAlpha=void 0,this._defaultNightAlpha=void 0,this._defaultDayAlpha=void 0,this._defaultBrightness=void 0,this._defaultContrast=void 0,this._defaultHue=void 0,this._defaultSaturation=void 0,this._defaultGamma=void 0,this._defaultMinificationFilter=void 0,this._defaultMagnificationFilter=void 0,this._getFeatureInfoUrl=e.getFeatureInfoUrl??e.url;let t=De.createIfNeeded(e.url),n=De.createIfNeeded(this._getFeatureInfoUrl);t.setQueryParameters(Wh.DefaultParameters,!0),n.setQueryParameters(Wh.GetFeatureInfoDefaultParameters,!0),l(e.parameters)&&t.setQueryParameters(Vbe(e.parameters)),l(e.getFeatureInfoParameters)&&n.setQueryParameters(Vbe(e.getFeatureInfoParameters));let i=this;this._reload=void 0,l(e.times)&&(this._timeDynamicImagery=new iS({clock:e.clock,times:e.times,requestImageFunction:function(s,a,c,u,f){return jbe(i,s,a,c,u,f)},reloadFunction:function(){l(i._reload)&&i._reload()}}));let r={};if(r.layers=e.layers,r.bbox="{westProjected},{southProjected},{eastProjected},{northProjected}",r.width="{width}",r.height="{height}",parseFloat(t.queryParameters.version)>=1.3){r.crs=e.crs??(e.tilingScheme&&e.tilingScheme.projection instanceof Ti?"EPSG:3857":"CRS:84");let s=r.crs.split(":");if(s[0]==="EPSG"&&s.length===2){let a=Number(s[1]);(a>=4e3&&a<5e3&&!kct.includes(a)||Bct.includes(a))&&(r.bbox="{southProjected},{westProjected},{northProjected},{eastProjected}")}}else r.srs=e.srs??(e.tilingScheme&&e.tilingScheme.projection instanceof Ti?"EPSG:3857":"EPSG:4326");t.setQueryParameters(r,!0),n.setQueryParameters(r,!0);let o={query_layers:e.layers,info_format:"{format}"};parseFloat(n.queryParameters.version)>=1.3?(o.i="{i}",o.j="{j}"):(o.x="{i}",o.y="{j}"),n.setQueryParameters(o,!0),this._resource=t,this._pickFeaturesResource=n,this._layers=e.layers,this._tileProvider=new Os({url:t,pickFeaturesUrl:n,tilingScheme:e.tilingScheme??new ir({ellipsoid:e.ellipsoid}),rectangle:e.rectangle,tileWidth:e.tileWidth,tileHeight:e.tileHeight,minimumLevel:e.minimumLevel,maximumLevel:e.maximumLevel,subdomains:e.subdomains,tileDiscardPolicy:e.tileDiscardPolicy,credit:e.credit,getFeatureInfoFormats:e.getFeatureInfoFormats??Wh.DefaultGetFeatureInfoFormats,enablePickFeatures:e.enablePickFeatures})}function jbe(e,t,n,i,r,o){let s=l(o)?o.data:void 0,a=e._tileProvider;return l(s)&&a._resource.setQueryParameters(s),a.requestImage(t,n,i,r)}function Uct(e,t,n,i,r,o,s){let a=l(s)?s.data:void 0,c=e._tileProvider;return l(a)&&c._pickFeaturesResource.setQueryParameters(a),c.pickFeatures(t,n,i,r,o)}Object.defineProperties(Wh.prototype,{url:{get:function(){return this._resource._url}},proxy:{get:function(){return this._resource.proxy}},layers:{get:function(){return this._layers}},tileWidth:{get:function(){return this._tileProvider.tileWidth}},tileHeight:{get:function(){return this._tileProvider.tileHeight}},maximumLevel:{get:function(){return this._tileProvider.maximumLevel}},minimumLevel:{get:function(){return this._tileProvider.minimumLevel}},tilingScheme:{get:function(){return this._tileProvider.tilingScheme}},rectangle:{get:function(){return this._tileProvider.rectangle}},tileDiscardPolicy:{get:function(){return this._tileProvider.tileDiscardPolicy}},errorEvent:{get:function(){return this._tileProvider.errorEvent}},credit:{get:function(){return this._tileProvider.credit}},hasAlphaChannel:{get:function(){return this._tileProvider.hasAlphaChannel}},enablePickFeatures:{get:function(){return this._tileProvider.enablePickFeatures},set:function(e){this._tileProvider.enablePickFeatures=e}},clock:{get:function(){return this._timeDynamicImagery.clock},set:function(e){this._timeDynamicImagery.clock=e}},times:{get:function(){return this._timeDynamicImagery.times},set:function(e){this._timeDynamicImagery.times=e}},getFeatureInfoUrl:{get:function(){return this._getFeatureInfoUrl}}});Wh.prototype.getTileCredits=function(e,t,n){return this._tileProvider.getTileCredits(e,t,n)};Wh.prototype.requestImage=function(e,t,n,i){let r,o=this._timeDynamicImagery,s;return l(o)&&(s=o.currentInterval,r=o.getFromCache(e,t,n,i)),l(r)||(r=jbe(this,e,t,n,i,s)),l(r)&&l(o)&&o.checkApproachingInterval(e,t,n,i),r};Wh.prototype.pickFeatures=function(e,t,n,i,r){let o=this._timeDynamicImagery,s=l(o)?o.currentInterval:void 0;return Uct(this,e,t,n,i,r,s)};Wh.DefaultParameters=Object.freeze({service:"WMS",version:"1.1.1",request:"GetMap",styles:"",format:"image/jpeg"});Wh.GetFeatureInfoDefaultParameters=Object.freeze({service:"WMS",version:"1.1.1",request:"GetFeatureInfo"});Wh.DefaultGetFeatureInfoFormats=Object.freeze([Object.freeze(new Rp("json","application/json")),Object.freeze(new Rp("xml","text/xml")),Object.freeze(new Rp("text","text/html"))]);function Vbe(e){let t={};for(let n in e)e.hasOwnProperty(n)&&(t[n.toLowerCase()]=e[n]);return t}var GV=Wh;function Tf(e){e=e??H.EMPTY_OBJECT,this._defaultAlpha=void 0,this._defaultNightAlpha=void 0,this._defaultDayAlpha=void 0,this._defaultBrightness=void 0,this._defaultContrast=void 0,this._defaultHue=void 0,this._defaultSaturation=void 0,this._defaultGamma=void 0,this._defaultMinificationFilter=void 0,this._defaultMagnificationFilter=void 0,this._getFeatureInfoUrl=e.getFeatureInfoUrl??e.url;let t=De.createIfNeeded(e.url),n=De.createIfNeeded(this._getFeatureInfoUrl),i=e.style,r=e.tileMatrixSetID,o=t.url,s=e.format??"image/jpeg",a=o.match(/{/g);if(!l(a)||a.length===1&&/{s}/.test(o)?(t.setQueryParameters(Tf.DefaultParameters,!0),this._useKvp=!0):(t.setTemplateValues(Tf.DefaultParameters,!0),this._useKvp=!1),this._useKvp){n.setQueryParameters(Tf.GetFeatureInfoDefaultParameters,!0),l(e.getFeatureInfoParameters)&&n.setQueryParameters(Hbe(e.getFeatureInfoParameters));let f={infoformat:"{format}",i:"{i}",j:"{j}"};n.setQueryParameters(f,!0)}else n.setTemplateValues(Tf.GetFeatureInfoDefaultParameters,!0),l(e.getFeatureInfoParameters)&&n.setTemplateValues(Hbe(e.getFeatureInfoParameters));this._resource=t,this._tileMatrixLabels=e.tileMatrixLabels,this._format=s,this._dimensions=e.dimensions,this._tilematrixset=r;let c={};c.tilematrix="{TileMatrix}",c.layer=e.layer,c.style=i,c.tilerow="{TileRow}",c.tilecol="{TileCol}",c.tilematrixset=r,this._useKvp?(t.setQueryParameters(c,!0),t.setQueryParameters({format:s},!0),n.setQueryParameters({format:s},!0),n.setQueryParameters(c,!0)):(c.Style=i,t.setTemplateValues(c),t.setTemplateValues({format:s}),n.setTemplateValues(c));let u=this;this._reload=void 0,l(e.times)&&(this._timeDynamicImagery=new iS({clock:e.clock,times:e.times,requestImageFunction:function(f,d,p,g,m){return Gbe(u,f,d,p,g,m)},reloadFunction:function(){l(u._reload)&&u._reload()}})),this._errorEvent=new be,this._tileProvider=new Os({url:t,pickFeaturesUrl:n,tilingScheme:e.tilingScheme??new Uo({ellipsoid:e.ellipsoid}),rectangle:e.rectangle,tileWidth:e.tileWidth,tileHeight:e.tileHeight,minimumLevel:e.minimumLevel,maximumLevel:e.maximumLevel,subdomains:e.subdomains,tileDiscardPolicy:e.tileDiscardPolicy,credit:e.credit,getFeatureInfoFormats:e.getFeatureInfoFormats??Tf.DefaultGetFeatureInfoFormats,enablePickFeatures:e.enablePickFeatures??(this._useKvp||l(e.getFeatureInfoUrl)),customTags:Vct(this)})}function Gbe(e,t,n,i,r,o){let s=e._tileProvider;return Wbe(e,s._resource,o),s.requestImage(t,n,i,r)}function zct(e,t,n,i,r,o,s){let a=e._tileProvider;return Wbe(e,a._pickFeaturesResource,s),a.pickFeatures(t,n,i,r,o)}Object.defineProperties(Tf.prototype,{url:{get:function(){return this._resource.url}},proxy:{get:function(){return this._resource.proxy}},tileWidth:{get:function(){return this._tileProvider.tileWidth}},tileHeight:{get:function(){return this._tileProvider.tileHeight}},maximumLevel:{get:function(){return this._tileProvider.maximumLevel}},minimumLevel:{get:function(){return this._tileProvider.minimumLevel}},tilingScheme:{get:function(){return this._tileProvider.tilingScheme}},rectangle:{get:function(){return this._tileProvider.rectangle}},tileDiscardPolicy:{get:function(){return this._tileProvider.tileDiscardPolicy}},errorEvent:{get:function(){return this._tileProvider.errorEvent}},format:{get:function(){return this._format}},credit:{get:function(){return this._tileProvider.credit}},hasAlphaChannel:{get:function(){return!0}},enablePickFeatures:{get:function(){return this._tileProvider.enablePickFeatures},set:function(e){this._tileProvider.enablePickFeatures=e}},clock:{get:function(){return this._timeDynamicImagery.clock},set:function(e){this._timeDynamicImagery.clock=e}},times:{get:function(){return this._timeDynamicImagery.times},set:function(e){this._timeDynamicImagery.times=e}},dimensions:{get:function(){return this._dimensions},set:function(e){this._dimensions!==e&&(this._dimensions=e,l(this._reload)&&this._reload())}},getFeatureInfoUrl:{get:function(){return this._getFeatureInfoUrl}}});Tf.prototype.getTileCredits=function(e,t,n){return this._tileProvider.getTileCredits(e,t,n)};Tf.prototype.requestImage=function(e,t,n,i){let r,o=this._timeDynamicImagery,s;return l(o)&&(s=o.currentInterval,r=o.getFromCache(e,t,n,i)),l(r)||(r=Gbe(this,e,t,n,i,s)),l(r)&&l(o)&&o.checkApproachingInterval(e,t,n,i),r};Tf.prototype.pickFeatures=function(e,t,n,i,r){let o=this._timeDynamicImagery,s=l(o)?o.currentInterval:void 0;return zct(this,e,t,n,i,r,s)};Tf.DefaultParameters=Object.freeze({service:"WMTS",version:"1.0.0",request:"GetTile"});Tf.GetFeatureInfoDefaultParameters=Object.freeze({service:"WMTS",version:"1.0.0",request:"GetFeatureInfo"});Tf.DefaultGetFeatureInfoFormats=Object.freeze([Object.freeze(new Rp("json","application/json")),Object.freeze(new Rp("xml","text/xml")),Object.freeze(new Rp("text","text/html"))]);function Wbe(e,t,n){let i=e._dimensions,r=l(n)?n.data:void 0;if(!e._useKvp)l(i)&&t.setTemplateValues(i),l(r)&&t.setTemplateValues(r);else{let o={};l(i)&&(o=Mt(o,i)),l(r)&&(o=Mt(o,r)),t.setQueryParameters(o)}}function Vct(e){function t(n){let i=e._tileMatrixLabels;return l(i)?i[n]:n.toString()}return{TileMatrix:function(n,i,r,o){return t(o)},tilematrix:function(n,i,r,o){return t(o)},TileRow:function(n,i,r){return r.toString()},tilerow:function(n,i,r){return r.toString()},TileCol:function(n,i,r){return i.toString()},tilecol:function(n,i,r){return i.toString()},TileMatrixSet:function(n){return e._tilematrixset},tilematrixset:function(n){return e._tilematrixset}}}function Hbe(e){let t={};for(let n in e)e.hasOwnProperty(n)&&(t[n.toLowerCase()]=e[n]);return t}var WV=Tf;var rS={};rS.defaultApiKey=void 0;rS.mapTilesApiEndpoint=new De({url:"https://tile.googleapis.com/"});rS.defaultStreetViewStaticApiKey=void 0;rS.streetViewStaticApiEndpoint=new De({url:"https://maps.googleapis.com/maps/api/streetview"});rS.getDefaultCredit=function(){return new It('<img alt="Google" src="https://assets.ion.cesium.com/google-credit.png" style="vertical-align:-6px">',!0)};var Ba=rS;var qbe=/\/$/;function gg(e){e=e??H.EMPTY_OBJECT,this._maximumLevel=e.maximumLevel??22,this._minimumLevel=e.minimumLevel??0,this._session=e.session,this._key=e.key,this._tileWidth=e.tileWidth,this._tileHeight=e.tileHeight;let t=e.url instanceof es?e.url:De.createIfNeeded(e.url??Ba.mapTilesApiEndpoint),n=t.getUrlComponent();qbe.test(n)||(n+="/");let i=`${n}v1/2dtiles/{z}/{x}/{y}`;this._viewportUrl=`${n}tile/v1/viewport`,t.url=i,t.setQueryParameters({session:encodeURIComponent(e.session),key:encodeURIComponent(e.key)}),this._resource=t.clone();let r;l(e.credit)&&(r=e.credit,typeof r=="string"&&(r=new It(r)));let o=new Os({url:t,credit:r,tileWidth:e.tileWidth,tileHeight:e.tileHeight,ellipsoid:e.ellipsoid,rectangle:e.rectangle,maximumLevel:this._maximumLevel,minimumLevel:this._minimumLevel});o._resource=t,this._imageryProvider=o,this._tileCredits=t.credits,this._attributionsByLevel=void 0}Object.defineProperties(gg.prototype,{url:{get:function(){return this._imageryProvider.url}},rectangle:{get:function(){return this._imageryProvider.rectangle}},tileWidth:{get:function(){return this._imageryProvider.tileWidth}},tileHeight:{get:function(){return this._imageryProvider.tileHeight}},maximumLevel:{get:function(){return this._imageryProvider.maximumLevel}},minimumLevel:{get:function(){return this._imageryProvider.minimumLevel}},tilingScheme:{get:function(){return this._imageryProvider.tilingScheme}},tileDiscardPolicy:{get:function(){return this._imageryProvider.tileDiscardPolicy}},errorEvent:{get:function(){return this._imageryProvider.errorEvent}},credit:{get:function(){return this._imageryProvider.credit}},proxy:{get:function(){return this._imageryProvider.proxy}},hasAlphaChannel:{get:function(){return this._imageryProvider.hasAlphaChannel}}});gg.fromIonAssetId=async function(e){e=e??{},e.mapType=e.mapType??"satellite",e.language=e.language??"en_US",e.region=e.region??"US";let t=e.overlayLayerType,n=Ybe(e),i=es._createEndpointResource(e.assetId,{queryParameters:{options:JSON.stringify(n)}}),r={language:e.language,region:e.region,ellipsoid:e.ellipsoid,minimumLevel:e.minimumLevel,maximumLevel:e.maximumLevel,rectangle:e.rectangle,credit:e.credit},o=await i.fetchJson(),s=o.options.url;return delete o.options.url,o.options={...o.options,...r},NZ(s,o,i)};gg.fromUrl=async function(e){e=e??{},e.mapType=e.mapType??"satellite",e.language=e.language??"en_US",e.region=e.region??"US",e.url=e.url??Ba.mapTilesApiEndpoint,e.key=e.key??Ba.defaultApiKey;let t=e.overlayLayerType,n=await Hct(e);return new gg({...n,...e,credit:e.credit??Ba.getDefaultCredit()})};gg.prototype.getTileCredits=function(e,t,n){if(!l(this._attributionsByLevel)||!l(this._tileCredits))return;let r=this._attributionsByLevel.get(n);return l(this._tileCredits)?this._tileCredits.concat(r):r};gg.prototype.requestImage=function(e,t,n,i){let r=this._imageryProvider.requestImage(e,t,n,i);if(l(r))return l(this._attributionsByLevel)?r:Promise.all([r,this.getViewportCredits()]).then(o=>o[0])};gg.prototype.pickFeatures=function(e,t,n,i,r){};gg.prototype.getViewportCredits=async function(){let e=this._maximumLevel,t=[];for(let r=0;r<e+1;r++)t.push(jct(this._resource,this._viewportUrl,r));let n=await Promise.all(t),i=new Map;for(let r=0;r<e+1;r++){let o=[],s=n[r];if(s){let a=new It(s);o.push(a)}i.set(r,o)}return this._attributionsByLevel=i,i};async function jct(e,t,n){return(await e.getDerivedResource({url:t,queryParameters:{zoom:n,north:90,south:-90,east:180,west:-180},data:JSON.stringify(H.EMPTY_OBJECT)}).fetchJson()).copyright}function Ybe(e){let{mapType:t,overlayLayerType:n,styles:i}=e,r={mapType:t,overlay:!1};return t==="terrain"&&!l(n)&&(r.layerTypes=["layerRoadmap"]),l(n)&&(r.mapType="satellite",r.overlay=!0,r.layerTypes=[n]),l(i)&&(r.styles=i),r}async function Hct(e){let{language:t,region:n,key:i,url:r}=e,o=Ybe(e),s=r.url??r;qbe.test(s)||(s+="/");let a=await De.post({url:`${s}v1/createSession`,queryParameters:{key:i},data:JSON.stringify({...o,language:t,region:n})});return JSON.parse(a)}var qV=gg;var Gct=/\/$/;function oS(e){e=e??{};let t=e.tilesetId??"microsoft.imagery";this._maximumLevel=e.maximumLevel??22,this._minimumLevel=e.minimumLevel??0,this._subscriptionKey=e.subscriptionKey??e["subscription-key"],this._tilesetId=e.tilesetId;let n=e.url instanceof es?e.url:De.createIfNeeded(e.url??"https://atlas.microsoft.com/"),i=n.getUrlComponent();Gct.test(i)||(i+="/");let r=`${i}map/tile`;this._viewportUrl=`${i}map/attribution`,n.url=r,n.setQueryParameters({"api-version":"2024-04-01",tilesetId:t,"subscription-key":this._subscriptionKey,zoom:"{z}",x:"{x}",y:"{y}"}),this._resource=n;let o;l(e.credit)&&(o=e.credit,typeof o=="string"&&(o=new It(o)));let s=new Os({...e,maximumLevel:this._maximumLevel,minimumLevel:this._minimumLevel,url:n,credit:o});s._resource=n,this._imageryProvider=s,this._tileCredits=n.credits,this._attributionsByLevel=void 0}Object.defineProperties(oS.prototype,{url:{get:function(){return this._imageryProvider.url}},rectangle:{get:function(){return this._imageryProvider.rectangle}},tileWidth:{get:function(){return this._imageryProvider.tileWidth}},tileHeight:{get:function(){return this._imageryProvider.tileHeight}},maximumLevel:{get:function(){return this._imageryProvider.maximumLevel}},minimumLevel:{get:function(){return this._imageryProvider.minimumLevel}},tilingScheme:{get:function(){return this._imageryProvider.tilingScheme}},tileDiscardPolicy:{get:function(){return this._imageryProvider.tileDiscardPolicy}},errorEvent:{get:function(){return this._imageryProvider.errorEvent}},credit:{get:function(){return this._imageryProvider.credit}},proxy:{get:function(){return this._imageryProvider.proxy}},hasAlphaChannel:{get:function(){return this._imageryProvider.hasAlphaChannel}}});oS.prototype.getTileCredits=function(e,t,n){if(!l(this._attributionsByLevel)||!l(this._tileCredits))return;let r=this._attributionsByLevel.get(n);return l(this._tileCredits)?this._tileCredits.concat(r):r};oS.prototype.requestImage=function(e,t,n,i){let r=this._imageryProvider.requestImage(e,t,n,i);if(l(r))return l(this._attributionsByLevel)?r:Promise.all([r,this.getViewportCredits()]).then(o=>o[0])};oS.prototype.pickFeatures=function(e,t,n,i,r){};oS.prototype.getViewportCredits=async function(){let e=this._maximumLevel,t=[];for(let r=0;r<e+1;r++)t.push(Wct(this._resource,this._viewportUrl,this._subscriptionKey,this._tilesetId,r));let n=await Promise.all(t),i=new Map;for(let r=0;r<e+1;r++){let o=[],s=n[r].join(",");if(s){let a=new It(s);o.push(a)}i.set(r,o)}return this._attributionsByLevel=i,i};async function Wct(e,t,n,i,r){return(await e.getDerivedResource({url:t,queryParameters:{zoom:r,bounds:"-180,-90,180,90"},data:JSON.stringify(H.EMPTY_OBJECT)}).fetchJson()).copyrights}var YV=oS;var qct=async(e,t,n)=>Ix.fromUrl(new es(t,n)),Yct=async(e,{options:t})=>Dy.fromUrl(e,t),Xct=async(e,{options:t})=>NV.fromUrl(e,t),Kct=async(e,{options:t})=>{let n=t.channel;return delete t.channel,zV.fromUrl(e,n,t)},$ct=async(e,{options:t})=>new VV({url:e,...t}),Jct=async(e,{options:t})=>jV.fromUrl(e,t),Zct=async(e,{options:t})=>Ix.fromUrl(e,t),Qct=async(e,{options:t})=>new Os({url:e,...t}),elt=async(e,{options:t})=>new GV({url:e,...t}),tlt=async(e,{options:t})=>new WV({url:e,...t}),NZ=async(e,t,n)=>{delete t.externalType,t.url=e;let i=new es(t,n),r=(o,s)=>{delete s.externalType,s.url=e;let{options:a}=s;o.setQueryParameters({session:a.session,key:a.key})};return i.refreshCallback=r,new qV({...t.options,url:i})},nlt=async(e,t,n)=>{delete t.externalType,t.url=e;let i=new es(t,n),r=(o,s)=>{delete s.externalType,s.url=e;let{options:a}=s;o.setQueryParameters({"subscription-key":a["subscription-key"]})};return i.refreshCallback=r,new YV({...t.options,url:i})},ilt={ARCGIS_MAPSERVER:Yct,BING:Xct,GOOGLE_EARTH:Kct,MAPBOX:$ct,SINGLE_TILE:Jct,TMS:Zct,URL_TEMPLATE:Qct,WMS:elt,WMTS:tlt,GOOGLE_2D_MAPS:NZ,AZURE_MAPS:nlt,defaultFactoryCallback:qct},b1=Object.freeze(ilt);function Op(){this._defaultAlpha=void 0,this._defaultNightAlpha=void 0,this._defaultDayAlpha=void 0,this._defaultBrightness=void 0,this._defaultContrast=void 0,this._defaultHue=void 0,this._defaultSaturation=void 0,this._defaultGamma=void 0,this._defaultMinificationFilter=void 0,this._defaultMagnificationFilter=void 0,this._tileCredits=void 0,this._errorEvent=new be}Object.defineProperties(Op.prototype,{rectangle:{get:function(){return this._imageryProvider.rectangle}},tileWidth:{get:function(){return this._imageryProvider.tileWidth}},tileHeight:{get:function(){return this._imageryProvider.tileHeight}},maximumLevel:{get:function(){return this._imageryProvider.maximumLevel}},minimumLevel:{get:function(){return this._imageryProvider.minimumLevel}},tilingScheme:{get:function(){return this._imageryProvider.tilingScheme}},tileDiscardPolicy:{get:function(){return this._imageryProvider.tileDiscardPolicy}},errorEvent:{get:function(){return this._errorEvent}},credit:{get:function(){return this._imageryProvider.credit}},hasAlphaChannel:{get:function(){return this._imageryProvider.hasAlphaChannel}},proxy:{get:function(){}}});Op.fromAssetId=async function(e,t){t=t??H.EMPTY_OBJECT;let n=es._createEndpointResource(e,t),i=e.toString()+t.accessToken+t.server,r=Op._endpointCache[i];l(r)||(r=n.fetchJson(),Op._endpointCache[i]=r);let o=await r;if(o.type!=="IMAGERY")throw new oe(`Cesium ion asset ${e} is not an imagery asset.`);let s=o.externalType,a=b1.defaultFactoryCallback;o=Ze(o,!0),o.options=o.options??{};let c=o.options?.url;if(delete t.url,l(s)&&(a=b1[s],!l(a)))throw new oe(`Unrecognized Cesium ion imagery type: ${s}`);let u=await a(c,o,n),f=new Op(t);return u.errorEvent.addEventListener(function(d){d.provider=f,f._errorEvent.raiseEvent(d)}),f._tileCredits=es.getCreditsFromEndpoint(o,n),f._imageryProvider=u,f};Op.prototype.getTileCredits=function(e,t,n){let i=this._imageryProvider.getTileCredits(e,t,n);return l(i)?this._tileCredits.concat(i):this._tileCredits};Op.prototype.requestImage=function(e,t,n,i){return this._imageryProvider.requestImage(e,t,n,i)};Op.prototype.pickFeatures=function(e,t,n,i,r){return this._imageryProvider.pickFeatures(e,t,n,i,r)};Op._endpointCache={};var Ou=Op;var Xbe={AERIAL:2,AERIAL_WITH_LABELS:3,ROAD:4};Object.freeze(Xbe);var Ry=Xbe;function rlt(e){e=e??H.EMPTY_OBJECT;let t=e.style??Ry.AERIAL;return Ou.fromAssetId(t)}var Oy=rlt;function Ms(){pe.throwInstantiationError()}Object.defineProperties(Ms.prototype,{errorEvent:{get:pe.throwInstantiationError},credit:{get:pe.throwInstantiationError},tilingScheme:{get:pe.throwInstantiationError},hasWaterMask:{get:pe.throwInstantiationError},hasVertexNormals:{get:pe.throwInstantiationError},availability:{get:pe.throwInstantiationError}});var Kbe=[];Ms.getRegularGridIndices=function(e,t){let n=Kbe[e];l(n)||(Kbe[e]=n=[]);let i=n[t];return l(i)||(e*t<P.SIXTY_FOUR_KILOBYTES?i=n[t]=new Uint16Array((e-1)*(t-1)*6):i=n[t]=new Uint32Array((e-1)*(t-1)*6),Qbe(e,t,i,0)),i};var $be=[];Ms.getRegularGridIndicesAndEdgeIndices=function(e,t){let n=$be[e];l(n)||($be[e]=n=[]);let i=n[t];if(!l(i)){let r=Ms.getRegularGridIndices(e,t),o=Zbe(e,t),s=o.westIndicesSouthToNorth,a=o.southIndicesEastToWest,c=o.eastIndicesNorthToSouth,u=o.northIndicesWestToEast;i=n[t]={indices:r,westIndicesSouthToNorth:s,southIndicesEastToWest:a,eastIndicesNorthToSouth:c,northIndicesWestToEast:u}}return i};var Jbe=[];Ms.getRegularGridAndSkirtIndicesAndEdgeIndices=function(e,t){let n=Jbe[e];l(n)||(Jbe[e]=n=[]);let i=n[t];if(!l(i)){let r=e*t,o=(e-1)*(t-1)*6,s=e*2+t*2,a=Math.max(0,s-4)*6,c=r+s,u=o+a,f=Zbe(e,t),d=f.westIndicesSouthToNorth,p=f.southIndicesEastToWest,g=f.eastIndicesNorthToSouth,m=f.northIndicesWestToEast,y=je.createTypedArray(c,u);Qbe(e,t,y,0),Ms.addSkirtIndices(d,p,g,m,r,y,o),i=n[t]={indices:y,westIndicesSouthToNorth:d,southIndicesEastToWest:p,eastIndicesNorthToSouth:g,northIndicesWestToEast:m,indexCountWithoutSkirts:o}}return i};Ms.getSkirtVertexCount=function(e,t,n,i){return e.length+t.length+n.length+i.length};Ms.getSkirtIndexCount=function(e){return(e-4)*2*3};Ms.getSkirtIndexCountWithFilledCorners=function(e){return((e-4)*2+4)*3};Ms.addSkirtIndices=function(e,t,n,i,r,o,s){let a=r;s=XV(e,a,o,s),a+=e.length,s=XV(t,a,o,s),a+=t.length,s=XV(n,a,o,s),a+=n.length,XV(i,a,o,s)};Ms.addSkirtIndicesWithFilledCorners=function(e,t,n,i,r,o,s){Ms.addSkirtIndices(e,t,n,i,r,o,s);let a=Ms.getSkirtVertexCount(e,t,n,i),c=Ms.getSkirtIndexCount(a),u=s+c,f=e[0],d=i[0],p=n[0],g=t[0],m=r,y=m+e.length-1,A=y+1,b=A+t.length-1,x=b+1,T=x+n.length-1,E=T+1,v=E+i.length-1;o[u+0]=f,o[u+1]=m,o[u+2]=b,o[u+3]=g,o[u+4]=A,o[u+5]=T,o[u+6]=p,o[u+7]=x,o[u+8]=v,o[u+9]=d,o[u+10]=E,o[u+11]=y};function Zbe(e,t){let n=new Array(t),i=new Array(e),r=new Array(t),o=new Array(e),s;for(s=0;s<e;++s)o[s]=s,i[s]=e*t-1-s;for(s=0;s<t;++s)r[s]=(s+1)*e-1,n[s]=(t-s-1)*e;return{westIndicesSouthToNorth:n,southIndicesEastToWest:i,eastIndicesNorthToSouth:r,northIndicesWestToEast:o}}function Qbe(e,t,n,i){let r=0;for(let o=0;o<t-1;++o){for(let s=0;s<e-1;++s){let a=r,c=a+e,u=c+1,f=a+1;n[i++]=a,n[i++]=c,n[i++]=f,n[i++]=f,n[i++]=c,n[i++]=u,++r}++r}}function XV(e,t,n,i){let r=e[0],o=e.length;for(let s=1;s<o;++s){let a=e[s];n[i++]=r,n[i++]=a,n[i++]=t,n[i++]=t,n[i++]=a,n[i++]=t+1,r=a,++t}return i}Ms.heightmapTerrainQuality=.25;Ms.getEstimatedLevelZeroGeometricErrorForAHeightmap=function(e,t,n){return e.maximumRadius*2*Math.PI*Ms.heightmapTerrainQuality/(t*n)};Ms.prototype.requestTileGeometry=pe.throwInstantiationError;Ms.prototype.getLevelMaximumGeometricError=pe.throwInstantiationError;Ms.prototype.getTileDataAvailable=pe.throwInstantiationError;Ms.prototype.loadTileDataAvailability=pe.throwInstantiationError;var Xr=Ms;var exe={UNLOADED:0,TRANSITIONING:1,RECEIVED:2,TEXTURE_LOADED:3,READY:4,FAILED:5,INVALID:6,PLACEHOLDER:7};Object.freeze(exe);var jn=exe;function sS(e,t,n,i,r){if(this.imageryLayer=e,this.x=t,this.y=n,this.level=i,this.request=void 0,i!==0){let o=t/2|0,s=n/2|0,a=i-1;this.parent=e.getImageryFromCache(o,s,a)}this.state=jn.UNLOADED,this.imageUrl=void 0,this.image=void 0,this.texture=void 0,this.textureWebMercator=void 0,this.credits=void 0,this.referenceCount=0,!l(r)&&e.ready&&(r=e.imageryProvider.tilingScheme.tileXYToRectangle(t,n,i)),this.rectangle=r}sS.createPlaceholder=function(e){let t=new sS(e,0,0,0);return t.addReference(),t.state=jn.PLACEHOLDER,t};sS.prototype.addReference=function(){++this.referenceCount};sS.prototype.releaseReference=function(){return--this.referenceCount,this.referenceCount===0?(this.imageryLayer.removeImageryFromCache(this),l(this.parent)&&this.parent.releaseReference(),l(this.image)&&l(this.image.destroy)&&this.image.destroy(),l(this.texture)&&this.texture.destroy(),l(this.textureWebMercator)&&this.texture!==this.textureWebMercator&&this.textureWebMercator.destroy(),le(this),0):this.referenceCount};sS.prototype.processStateMachine=function(e,t,n){this.state===jn.UNLOADED&&!n&&(this.state=jn.TRANSITIONING,this.imageryLayer._requestImagery(this)),this.state===jn.RECEIVED&&(this.state=jn.TRANSITIONING,this.imageryLayer._createTexture(e.context,this));let i=this.state===jn.READY&&t&&!this.texture;(this.state===jn.TEXTURE_LOADED||i)&&(this.state=jn.TRANSITIONING,this.imageryLayer._reprojectTexture(e,this,t))};var x1=sS;function LZ(e,t,n){this.readyImagery=void 0,this.loadingImagery=e,this.textureCoordinateRectangle=t,this.textureTranslationAndScale=void 0,this.useWebMercatorT=n}LZ.prototype.freeResources=function(){l(this.readyImagery)&&this.readyImagery.releaseReference(),l(this.loadingImagery)&&this.loadingImagery.releaseReference()};LZ.prototype.processStateMachine=function(e,t,n){let i=this.loadingImagery,r=i.imageryLayer;if(i.processStateMachine(t,!this.useWebMercatorT,n),i.state===jn.READY)return l(this.readyImagery)&&this.readyImagery.releaseReference(),this.readyImagery=this.loadingImagery,this.loadingImagery=void 0,this.textureTranslationAndScale=r._calculateTextureTranslationAndScale(e,this),!0;let o=i.parent,s;for(;l(o)&&(o.state!==jn.READY||!this.useWebMercatorT&&!l(o.texture));)o.state!==jn.FAILED&&o.state!==jn.INVALID&&(s=s||o),o=o.parent;return this.readyImagery!==o&&(l(this.readyImagery)&&this.readyImagery.releaseReference(),this.readyImagery=o,l(o)&&(o.addReference(),this.textureTranslationAndScale=r._calculateTextureTranslationAndScale(e,this))),i.state===jn.FAILED||i.state===jn.INVALID?l(s)?(s.processStateMachine(t,!this.useWebMercatorT,n),!1):!0:!1};var T1=LZ;function Ui(e,t){this._imageryProvider=e,this._readyEvent=new be,this._errorEvent=new be,t=t??H.EMPTY_OBJECT,e=e??H.EMPTY_OBJECT,this.alpha=t.alpha??e._defaultAlpha??1,this.nightAlpha=t.nightAlpha??e._defaultNightAlpha??1,this.dayAlpha=t.dayAlpha??e._defaultDayAlpha??1,this.brightness=t.brightness??e._defaultBrightness??Ui.DEFAULT_BRIGHTNESS,this.contrast=t.contrast??e._defaultContrast??Ui.DEFAULT_CONTRAST,this.hue=t.hue??e._defaultHue??Ui.DEFAULT_HUE,this.saturation=t.saturation??e._defaultSaturation??Ui.DEFAULT_SATURATION,this.gamma=t.gamma??e._defaultGamma??Ui.DEFAULT_GAMMA,this.splitDirection=t.splitDirection??Ui.DEFAULT_SPLIT,this.minificationFilter=t.minificationFilter??e._defaultMinificationFilter??Ui.DEFAULT_MINIFICATION_FILTER,this.magnificationFilter=t.magnificationFilter??e._defaultMagnificationFilter??Ui.DEFAULT_MAGNIFICATION_FILTER,this.show=t.show??!0,this._minimumTerrainLevel=t.minimumTerrainLevel,this._maximumTerrainLevel=t.maximumTerrainLevel,this._rectangle=t.rectangle??ie.MAX_VALUE,this._maximumAnisotropy=t.maximumAnisotropy,this._imageryCache={},this._skeletonPlaceholder=new T1(x1.createPlaceholder(this)),this._show=!0,this._layerIndex=-1,this._isBaseLayer=!1,this._requestImageError=void 0,this._reprojectComputeCommands=[],this.cutoutRectangle=t.cutoutRectangle,this.colorToAlpha=t.colorToAlpha,this.colorToAlphaThreshold=t.colorToAlphaThreshold??Ui.DEFAULT_APPLY_COLOR_TO_ALPHA_THRESHOLD}Object.defineProperties(Ui.prototype,{imageryProvider:{get:function(){return this._imageryProvider}},ready:{get:function(){return l(this._imageryProvider)}},errorEvent:{get:function(){return this._errorEvent}},readyEvent:{get:function(){return this._readyEvent}},rectangle:{get:function(){return this._rectangle}}});Ui.DEFAULT_BRIGHTNESS=1;Ui.DEFAULT_CONTRAST=1;Ui.DEFAULT_HUE=0;Ui.DEFAULT_SATURATION=1;Ui.DEFAULT_GAMMA=1;Ui.DEFAULT_SPLIT=Yo.NONE;Ui.DEFAULT_MINIFICATION_FILTER=Wt.LINEAR;Ui.DEFAULT_MAGNIFICATION_FILTER=Jn.LINEAR;Ui.DEFAULT_APPLY_COLOR_TO_ALPHA_THRESHOLD=.004;Ui.fromProviderAsync=function(e,t){let n=new Ui(void 0,t);return llt(n,Promise.resolve(e)),n};Ui.fromWorldImagery=function(e){return e=e??H.EMPTY_OBJECT,Ui.fromProviderAsync(Oy({style:e.style}),e)};Ui.prototype.isBaseLayer=function(){return this._isBaseLayer};Ui.prototype.isDestroyed=function(){return!1};Ui.prototype.destroy=function(){return le(this)};var ixe=new ie,txe=new ie,FZ=new ie,rxe=new ie;Ui.prototype.getImageryRectangle=function(){let e=this._imageryProvider,t=this._rectangle;return ie.intersection(e.rectangle,t)};Ui.prototype._createTileImagerySkeletons=function(e,t,n){let i=e.data;if(!l(t)||l(this._minimumTerrainLevel)&&e.level<this._minimumTerrainLevel||l(this._maximumTerrainLevel)&&e.level>this._maximumTerrainLevel)return!1;l(n)||(n=i.imagery.length);let r=this._imageryProvider;if(!this.ready)return this._skeletonPlaceholder.loadingImagery.addReference(),i.imagery.splice(n,0,this._skeletonPlaceholder),!0;let o=r.tilingScheme.projection instanceof Ti&&e.rectangle.north<Ti.MaximumLatitude&&e.rectangle.south>-Ti.MaximumLatitude,s=ie.intersection(r.rectangle,this._rectangle,ixe),a=ie.intersection(e.rectangle,s,txe);if(!l(a)){if(!this.isBaseLayer())return!1;let w=s,D=e.rectangle;a=txe,D.south>=w.north?a.north=a.south=w.north:D.north<=w.south?a.north=a.south=w.south:(a.south=Math.max(D.south,w.south),a.north=Math.min(D.north,w.north)),D.west>=w.east?a.west=a.east=w.east:D.east<=w.west?a.west=a.east=w.west:(a.west=Math.max(D.west,w.west),a.east=Math.min(D.east,w.east))}let c=0;a.south>0?c=a.south:a.north<0&&(c=a.north);let f=1*t.getLevelMaximumGeometricError(e.level),d=alt(this,f,c);d=Math.max(0,d);let p=r.maximumLevel;if(d>p&&(d=p),l(r.minimumLevel)){let w=r.minimumLevel;d<w&&(d=w)}let g=r.tilingScheme,m=g.positionToTileXY(ie.northwest(a),d),y=g.positionToTileXY(ie.southeast(a),d),A=e.rectangle.width/512,b=e.rectangle.height/512,x=g.tileXYToRectangle(m.x,m.y,d);Math.abs(x.south-e.rectangle.north)<b&&m.y<y.y&&++m.y,Math.abs(x.east-e.rectangle.west)<A&&m.x<y.x&&++m.x;let T=g.tileXYToRectangle(y.x,y.y,d);Math.abs(T.north-e.rectangle.south)<b&&y.y>m.y&&--y.y,Math.abs(T.west-e.rectangle.east)<A&&y.x>m.x&&--y.x;let E=ie.clone(e.rectangle,rxe),v=g.tileXYToRectangle(m.x,m.y,d),S=ie.intersection(v,s,FZ),I;o?(g.rectangleToNativeRectangle(E,E),g.rectangleToNativeRectangle(v,v),g.rectangleToNativeRectangle(S,S),g.rectangleToNativeRectangle(s,s),I=g.tileXYToNativeRectangle.bind(g),A=E.width/512,b=E.height/512):I=g.tileXYToRectangle.bind(g);let R,O=0,L=1,_;!this.isBaseLayer()&&Math.abs(S.west-E.west)>=A&&(O=Math.min(1,(S.west-E.west)/E.width)),!this.isBaseLayer()&&Math.abs(S.north-E.north)>=b&&(L=Math.max(0,(S.north-E.south)/E.height));let C=L;for(let w=m.x;w<=y.x;w++)if(R=O,v=I(w,m.y,d),S=ie.simpleIntersection(v,s,FZ),!!l(S)){O=Math.min(1,(S.east-E.west)/E.width),w===y.x&&(this.isBaseLayer()||Math.abs(S.east-E.east)<A)&&(O=1),L=C;for(let D=m.y;D<=y.y;D++){if(_=L,v=I(w,D,d),S=ie.simpleIntersection(v,s,FZ),!l(S))continue;L=Math.max(0,(S.south-E.south)/E.height),D===y.y&&(this.isBaseLayer()||Math.abs(S.south-E.south)<b)&&(L=0);let N=new se(R,L,O,_),F=this.getImageryFromCache(w,D,d);i.imagery.splice(n,0,new T1(F,N,o)),++n}}return!0};Ui.prototype._calculateTextureTranslationAndScale=function(e,t){let n=t.readyImagery.rectangle,i=e.rectangle;if(t.useWebMercatorT){let c=t.readyImagery.imageryLayer.imageryProvider.tilingScheme;n=c.rectangleToNativeRectangle(n,ixe),i=c.rectangleToNativeRectangle(i,rxe)}let r=i.width,o=i.height,s=r/n.width,a=o/n.height;return new se(s*(i.west-n.west)/r,a*(i.south-n.south)/o,s,a)};Ui.prototype._requestImagery=function(e){let t=this._imageryProvider,n=this;function i(s){if(!l(s))return r();e.image=s,e.state=jn.RECEIVED,e.request=void 0,no.reportSuccess(n._requestImageError)}function r(s){if(e.request.state===wi.CANCELLED){e.state=jn.UNLOADED,e.request=void 0;return}e.state=jn.FAILED,e.request=void 0;let a=`Failed to obtain image tile X: ${e.x} Y: ${e.y} Level: ${e.level}.`;n._requestImageError=no.reportError(n._requestImageError,t,t.errorEvent,a,e.x,e.y,e.level,s),n._requestImageError.retry&&o()}function o(){let s=new Oo({throttle:!1,throttleByServer:!0,type:oa.IMAGERY});e.request=s,e.state=jn.TRANSITIONING;let a=t.requestImage(e.x,e.y,e.level,s);if(!l(a)){e.state=jn.UNLOADED,e.request=void 0;return}l(t.getTileCredits)&&(e.credits=t.getTileCredits(e.x,e.y,e.level)),a.then(function(c){i(c)}).catch(function(c){r(c)})}o()};Ui.prototype._createTextureWebGL=function(e,t){let n=new Ht({minificationFilter:this.minificationFilter,magnificationFilter:this.magnificationFilter}),i=t.image;return l(i.internalFormat)?new Dt({context:e,pixelFormat:i.internalFormat,width:i.width,height:i.height,source:{arrayBufferView:i.bufferView},sampler:n}):new Dt({context:e,source:i,pixelFormat:this._imageryProvider.hasAlphaChannel?$e.RGBA:$e.RGB,sampler:n})};Ui.prototype._createTexture=function(e,t){let n=this._imageryProvider,i=t.image;if(l(n.tileDiscardPolicy)){let o=n.tileDiscardPolicy;if(l(o)){if(!o.isReady()){t.state=jn.RECEIVED;return}if(o.shouldDiscardImage(i)){t.state=jn.INVALID;return}}}let r=this._createTextureWebGL(e,t);n.tilingScheme.projection instanceof Ti?t.textureWebMercator=r:t.texture=r,t.image=void 0,t.state=jn.TEXTURE_LOADED};function nxe(e,t,n){return`${e}:${t}:${n}`}Ui.prototype._finalizeReprojectTexture=function(e,t){let n=this.minificationFilter,i=this.magnificationFilter;if(n===Wt.LINEAR&&i===Jn.LINEAR&&!$e.isCompressedFormat(t.pixelFormat)&&P.isPowerOfTwo(t.width)&&P.isPowerOfTwo(t.height)){n=Wt.LINEAR_MIPMAP_LINEAR;let o=Ut.maximumTextureFilterAnisotropy,s=Math.min(o,this._maximumAnisotropy??o),a=nxe(n,i,s),c=e.cache.imageryLayerMipmapSamplers;l(c)||(c={},e.cache.imageryLayerMipmapSamplers=c);let u=c[a];l(u)||(u=c[a]=new Ht({wrapS:hn.CLAMP_TO_EDGE,wrapT:hn.CLAMP_TO_EDGE,minificationFilter:n,magnificationFilter:i,maximumAnisotropy:s})),t.generateMipmap(yh.NICEST),t.sampler=u}else{let o=nxe(n,i,0),s=e.cache.imageryLayerNonMipmapSamplers;l(s)||(s={},e.cache.imageryLayerNonMipmapSamplers=s);let a=s[o];l(a)||(a=s[o]=new Ht({wrapS:hn.CLAMP_TO_EDGE,wrapT:hn.CLAMP_TO_EDGE,minificationFilter:n,magnificationFilter:i})),t.sampler=a}};Ui.prototype._reprojectTexture=function(e,t,n){let i=t.textureWebMercator||t.texture,r=t.rectangle,o=e.context;if(n=n??!0,n&&!(this._imageryProvider.tilingScheme.projection instanceof ji)&&r.width/i.width>1e-5){let s=this;t.addReference();let a=new $f({persists:!0,owner:this,preExecute:function(c){slt(c,o,i,t.rectangle)},postExecute:function(c){t.texture=c,s._finalizeReprojectTexture(o,c),t.state=jn.READY,t.releaseReference()},canceled:function(){t.state=jn.TEXTURE_LOADED,t.releaseReference()}});this._reprojectComputeCommands.push(a)}else n&&(t.texture=i),this._finalizeReprojectTexture(o,i),t.state=jn.READY};Ui.prototype.queueReprojectionCommands=function(e){let t=this._reprojectComputeCommands,n=t.length;for(let i=0;i<n;++i)e.commandList.push(t[i]);t.length=0};Ui.prototype.cancelReprojections=function(){this._reprojectComputeCommands.forEach(function(e){l(e.canceled)&&e.canceled()}),this._reprojectComputeCommands.length=0};Ui.prototype.getImageryFromCache=function(e,t,n,i){let r=oxe(e,t,n),o=this._imageryCache[r];return l(o)||(o=new x1(this,e,t,n,i),this._imageryCache[r]=o),o.addReference(),o};Ui.prototype.removeImageryFromCache=function(e){let t=oxe(e.x,e.y,e.level);delete this._imageryCache[t]};function oxe(e,t,n){return JSON.stringify([e,t,n])}var KV={u_textureDimensions:function(){return this.textureDimensions},u_texture:function(){return this.texture},textureDimensions:new U,texture:void 0},olt=dn.supportsTypedArrays()?new Float32Array(128):void 0;function slt(e,t,n,i){let r=t.cache.imageryLayer_reproject;if(!l(r)){r=t.cache.imageryLayer_reproject={vertexArray:void 0,shaderProgram:void 0,sampler:void 0,destroy:function(){l(this.framebuffer)&&this.framebuffer.destroy(),l(this.vertexArray)&&this.vertexArray.destroy(),l(this.shaderProgram)&&this.shaderProgram.destroy()}};let A=new Float32Array(256),b=0;for(let S=0;S<64;++S){let I=S/63;A[b++]=0,A[b++]=I,A[b++]=1,A[b++]=I}let x={position:0,webMercatorT:1},T=Xr.getRegularGridIndices(2,64),E=tt.createIndexBuffer({context:t,typedArray:T,usage:Me.STATIC_DRAW,indexDatatype:je.UNSIGNED_SHORT});r.vertexArray=new Vn({context:t,attributes:[{index:x.position,vertexBuffer:tt.createVertexBuffer({context:t,typedArray:A,usage:Me.STATIC_DRAW}),componentsPerAttribute:2},{index:x.webMercatorT,vertexBuffer:tt.createVertexBuffer({context:t,sizeInBytes:512,usage:Me.STREAM_DRAW}),componentsPerAttribute:1}],indexBuffer:E});let v=new Xe({sources:[Y2]});r.shaderProgram=Qt.fromCache({context:t,vertexShaderSource:v,fragmentShaderSource:q2,attributeLocations:x}),r.sampler=new Ht({wrapS:hn.CLAMP_TO_EDGE,wrapT:hn.CLAMP_TO_EDGE,minificationFilter:Wt.LINEAR,magnificationFilter:Jn.LINEAR})}n.sampler=r.sampler;let o=n.width,s=n.height;KV.textureDimensions.x=o,KV.textureDimensions.y=s,KV.texture=n;let a=Math.sin(i.south),c=.5*Math.log((1+a)/(1-a));a=Math.sin(i.north);let f=1/(.5*Math.log((1+a)/(1-a))-c),d=new Dt({context:t,width:o,height:s,pixelFormat:n.pixelFormat,pixelDatatype:n.pixelDatatype,preMultiplyAlpha:n.preMultiplyAlpha});P.isPowerOfTwo(o)&&P.isPowerOfTwo(s)&&d.generateMipmap(yh.NICEST);let p=i.south,g=i.north,m=olt,y=0;for(let A=0;A<64;++A){let b=A/63,x=P.lerp(p,g,b);a=Math.sin(x);let E=(.5*Math.log((1+a)/(1-a))-c)*f;m[y++]=E,m[y++]=E}r.vertexArray.getAttribute(1).vertexBuffer.copyFromArrayView(m),e.shaderProgram=r.shaderProgram,e.outputTexture=d,e.uniformMap=KV,e.vertexArray=r.vertexArray}function alt(e,t,n){let i=e._imageryProvider,r=i.tilingScheme,o=r.ellipsoid,s=e._imageryProvider.tilingScheme.projection instanceof ji?1:Math.cos(n),a=r.rectangle,u=o.maximumRadius*a.width*s/(i.tileWidth*r.getNumberOfXTilesAtLevel(0))/t,f=Math.log(u)/Math.log(2);return Math.round(f)|0}function clt(e,t){e.numberOfListeners>0?e.raiseEvent(t):console.error(t)}async function llt(e,t){let n;try{if(n=await Promise.resolve(t),e.isDestroyed())return;e._imageryProvider=n,e._readyEvent.raiseEvent(n)}catch(i){clt(e._errorEvent,i)}}var Ns=Ui;var BZ=class{constructor(){this.alpha=!1,this.brightness=!1,this.contrast=!1,this.hue=!1,this.saturation=!1,this.gamma=!1,this.colorToAlpha=!1}},$V=BZ;var kZ=class{constructor(t,n,i,r){this._minX=t??0,this._minY=n??0,this._maxX=i??0,this._maxY=r??0}get minX(){return this._minX}set minX(t){this._minX=t}get minY(){return this._minY}set minY(t){this._minY=t}get maxX(){return this._maxX}set maxX(t){this._maxX=t}get maxY(){return this._maxY}set maxY(t){this._maxY=t}contains(t,n){return t>=this.minX&&t<this.maxX&&n>=this.minY&&n<this.maxY}containsExclusive(t,n){return t>this.minX&&t<this.maxX&&n>this.minY&&n<this.maxY}containsInclusive(t,n){return t>=this.minX&&t<=this.maxX&&n>=this.minY&&n<=this.maxY}},E1=kZ;var ult=new ie,sxe=new ie,flt=new ie,dlt=new ie,hlt=new ie,mlt=new ie,UZ=class e{constructor(t,n,i,r,o){this._x=t,this._y=n,this._level=i,this._textureCoordinateRectangle=r,this._imagery=o}get x(){return this._x}get y(){return this._y}get level(){return this._level}get textureCoordinateRectangle(){return this._textureCoordinateRectangle}get imagery(){return this._imagery}static createImageryCoverages(t,n,i){if(!n.show)return[];let r=n.imageryProvider,o=e._clampImageryLevel(r,i),s=ie.intersection(r.rectangle,n.rectangle,ult),a=r.tilingScheme,c=e._computeImageryRange(t,s,a,o),u=dlt;a.rectangleToNativeRectangle(t,u);let f=hlt;a.rectangleToNativeRectangle(s,f);let d=(g,m,y)=>{let A=a.tileXYToRectangle(g,m,y),b=ie.intersection(A,s,flt);if(!l(b))return;let x=mlt;return a.rectangleToNativeRectangle(b,x),x};return e._computeImageryCoverages(n,c,o,u,d)}static _clampImageryLevel(t,n){let i=t.minimumLevel??0,r=t.maximumLevel??Number.POSITIVE_INFINITY,o=Math.min(r-1,Math.max(i,n));return Math.floor(o)}static _computeImageryRange(t,n,i,r){let o=e._computeOverlappedRectangle(t,n),s=i.positionToTileXY(ie.northwest(o),r),a=i.positionToTileXY(ie.southeast(o),r),c=new E1;c.minX=s.x,c.minY=s.y,c.maxX=a.x,c.maxY=a.y;let u=t.width/512,f=t.height/512,d=i.tileXYToRectangle(c.minX,c.minY,r);Math.abs(d.south-t.north)<f&&c.minY<c.maxY&&++c.minY,Math.abs(d.east-t.west)<u&&c.minX<c.maxX&&++c.minX;let m=i.tileXYToRectangle(c.maxX,c.maxY,r);return Math.abs(m.north-t.south)<f&&c.maxY>c.minY&&--c.maxY,Math.abs(m.west-t.east)<u&&c.maxX>c.minX&&--c.maxX,c}static _clampRectangle(t,n,i){return l(i)||(i=new ie),t.south>=n.north?i.north=i.south=n.north:t.north<=n.south?i.north=i.south=n.south:(i.south=Math.max(t.south,n.south),i.north=Math.min(t.north,n.north)),t.west>=n.east?i.west=i.east=n.east:t.east<=n.west?i.west=i.east=n.west:(i.west=Math.max(t.west,n.west),i.east=Math.min(t.east,n.east)),i}static _computeOverlappedRectangle(t,n){let i=ie.intersection(t,n,sxe);return l(i)?i:e._clampRectangle(t,n,sxe)}static _computeImageryCoverages(t,n,i,r,o){let s=[];for(let a=n.minX;a<=n.maxX;a++){let c=o(a,n.maxY,i);if(l(c))for(let u=n.minY;u<=n.maxY;u++){let f=o(a,u,i);if(!l(f))continue;let d=e._localizeToCartesianRectangle(f,r,void 0),p=t.getImageryFromCache(a,u,i),g=new e(a,u,i,d,p);s.push(g)}}return s}static _localizeToCartesianRectangle(t,n,i){l(i)||(i=new E1);let r=1/n.width,o=1/n.height;return i.minX=(t.west-n.west)*r,i.minY=(t.south-n.south)*o,i.maxX=(t.east-n.west)*r,i.maxY=(t.north-n.south)*o,i}},C1=UZ;var zZ=class e{static createTextureCoordinatesForMappedPositions(t,n){let i=t.cartographicPositions,r=t.cartographicBoundingRectangle,o=t.numPositions;return e._createTextureCoordinates(i,o,r,n)}static _createTextureCoordinates(t,n,i,r){let o=new et;et.fromRectangle(i,r,o);let s=e.createProjectedPositions(t,r),a=e.computeTexCoords(s,o);return e.createTypedArrayFromCartesians2(n,a)}static createTextureCoordinatesAttributeForMappedPositions(t,n){let i=e.createTextureCoordinatesForMappedPositions(t,n);return e.createTexCoordAttribute(i)}static createCartographicPositions(t,n,i){let r=La.readAttributeAsTypedArray(t),o=t.type,s=Vt.getNumberOfComponents(o),a=e.createIterableCartesian3FromTypedArray(r,s),c=e.transformCartesians3(a,n);return e.transformToCartographic(c,i)}static createIterableCartesian3FromTypedArray(t,n){let i=new h,r=t.length/n;return{[Symbol.iterator]:function*(){for(let s=0;s<r;s++)i.x=t[s*n+0],i.y=t[s*n+1],i.z=t[s*n+2],yield i}}}static map(t,n){return{[Symbol.iterator]:function*(){for(let r of t)yield n(r)}}}static computeCartographicBoundingRectangle(t,n){l(n)||(n=new ie);let i=Number.NEGATIVE_INFINITY,r=Number.POSITIVE_INFINITY,o=Number.NEGATIVE_INFINITY,s=Number.POSITIVE_INFINITY;for(let a of t)i=Math.max(i,a.latitude),r=Math.min(r,a.latitude),o=Math.max(o,a.longitude),s=Math.min(s,a.longitude);return n.north=i,n.south=r,n.east=o,n.west=s,n}static transformCartesians3(t,n){let i=new h;return e.map(t,o=>(M.multiplyByPoint(n,o,i),i))}static transformToCartographic(t,n){let i=new he;return e.map(t,o=>(n.cartesianToCartographic(o,i),i))}static createProjectedPositions(t,n){let i=new h;return e.map(t,o=>(n.project(o,i),i))}static computeTexCoords(t,n){let i=new U,r=1/n.width,o=1/n.height;return e.map(t,a=>{let c=(a.x-n.x)*r,u=(a.y-n.y)*o,f=Math.min(Math.max(c,0),1),d=Math.min(Math.max(u,0),1);return i.x=f,i.y=d,i})}static createTypedArrayFromCartesians2(t,n){let i=new Float32Array(t*2),r=0;for(let o of n)i[r*2+0]=o.x,i[r*2+1]=o.y,r++;return i}static createTexCoordAttribute(t){return{name:"Imagery Texture Coordinates",semantic:ct.TEXCOORD,setIndex:0,componentDatatype:Y.FLOAT,type:Vt.VEC2,normalized:!1,count:t.length/2,min:void 0,max:void 0,constant:new U(0,0),quantization:void 0,typedArray:t,byteOffset:0,byteStride:void 0}}},aS=zZ;var VZ=class{constructor(t,n,i,r){this._cartographicPositions=t,this._numPositions=n,this._cartographicBoundingRectangle=i,this._ellipsoid=r}get cartographicPositions(){return this._cartographicPositions}get numPositions(){return this._numPositions}get cartographicBoundingRectangle(){return this._cartographicBoundingRectangle}get ellipsoid(){return this._ellipsoid}},JV=VZ;var jZ=class e{constructor(t,n,i){this._model=t,this._runtimeNode=n,this._runtimePrimitive=i,this._mappedPositionsPerEllipsoid=void 0,this._mappedPositionsModelMatrix=new M,this._lastImageryLayersModificationCounter=0,this._imageryTexCoordAttributesPerProjection=void 0,this._currentImageryLayers=void 0,this._coveragesPerLayer=void 0,this._allImageriesReady=!1}coveragesForImageryLayer(t){let r=this._model.imageryLayers.indexOf(t);if(r===-1)throw new pe("Imagery layer is not part of the model");let o=this._coveragesPerLayer;if(!l(o))throw new pe("The coveragesPerLayer have not been computed yet");return o[r]}update(t){let n=this._model,o=n.content.tileset.imageryLayersModificationCounter;this._lastImageryLayersModificationCounter!==o&&(delete this._mappedPositionsPerEllipsoid,this._lastImageryLayersModificationCounter=o),this._mappedPositionsNeedUpdate&&(n.resetDrawCommands(),this._mappedPositionsPerEllipsoid=this._computeMappedPositionsPerEllipsoid(),this._deleteCoveragesPerLayer(),this._destroyImageryTexCoordAttributes()),l(this._imageryTexCoordAttributesPerProjection)||(this._imageryTexCoordAttributesPerProjection=this._computeImageryTexCoordsAttributesPerProjection(),this._uploadImageryTexCoordAttributes(t.context)),l(this._coveragesPerLayer)||(this._computeCoveragesPerLayer(),this._allImageriesReady=!1),this._allImageriesReady||this._updateImageries(t)}_deleteCoveragesPerLayer(){let t=this._coveragesPerLayer;if(!l(t))return;let n=this._currentImageryLayers,i=t.length;for(let r=0;r<i;r++){let o=n[r],s=t[r];this._deleteCoverages(o,s)}delete this._currentImageryLayers,delete this._coveragesPerLayer}_deleteCoverages(t,n){if(t.isDestroyed())return;let i=n.length;for(let r=0;r<i;r++)n[r].imagery.releaseReference()}_uploadImageryTexCoordAttributes(t){let n=this._imageryTexCoordAttributesPerProjection;if(!l(n))return;let i=n.length;for(let r=0;r<i;r++){let o=n[r],s=tt.createVertexBuffer({context:t,typedArray:o.typedArray,usage:Me.STATIC_DRAW});s.vertexArrayDestroyable=!1,o.buffer=s}}_destroyImageryTexCoordAttributes(){let t=this._imageryTexCoordAttributesPerProjection;if(!l(t))return;let n=t.length;for(let i=0;i<n;i++){let r=t[i];l(r)&&(l(r.buffer)&&(r.buffer.isDestroyed()||r.buffer.destroy()),t[i]=void 0)}delete this._imageryTexCoordAttributesPerProjection}get _mappedPositionsNeedUpdate(){if(!l(this._mappedPositionsPerEllipsoid))return!0;let t=this._model,n=this._mappedPositionsModelMatrix;return!M.equals(t.modelMatrix,n)}_computeMappedPositionsPerEllipsoid(){let t=this._model,n=this._runtimeNode,i=this._runtimePrimitive,r=e._obtainPrimitivePositionAttribute(i.primitive),o=r.count,s=e._computePrimitivePositionTransform(t,n,void 0),a=[],c=e._computeUniqueEllipsoids(t.imageryLayers),u=c.length;for(let f=0;f<u;f++){let d=c[f],p=aS.createCartographicPositions(r,s,d),g=aS.computeCartographicBoundingRectangle(p),m=new JV(p,o,g,d);a.push(m)}return M.clone(t.modelMatrix,this._mappedPositionsModelMatrix),a}static _computeUniqueEllipsoids(t){let n=new Set,i=t.length;for(let r=0;r<i;r++){let o=t.get(r),s=e._getEllipsoid(o);n.add(s)}return[...n]}_computeImageryTexCoordsAttributesPerProjection(){let n=this._model.imageryLayers,i=e._extractProjections(n),r=[...new Set(i)];return this._createImageryTexCoordAttributes(r)}static _extractProjections(t){let n=[],i=t.length;for(let r=0;r<i;r++){let o=t.get(r),s=e._getProjection(o);n.push(s)}return n}static _getProjection(t){return t.imageryProvider.tilingScheme.projection}_createImageryTexCoordAttributes(t){let n=[],i=t.length;for(let r=0;r<i;r++){let o=t[r],s=o.ellipsoid,a=this.mappedPositionsForEllipsoid(s),c=aS.createTextureCoordinatesAttributeForMappedPositions(a,o);n.push(c)}return n}_computeCoveragesPerLayer(){let t=[],n=[],r=this._model.imageryLayers,o=r.length;for(let s=0;s<o;s++){let a=r.get(s),c=this._computeCoverage(a);t.push(c),n.push(a)}this._coveragesPerLayer=t,this._currentImageryLayers=n}_computeCoverage(t){let i=this.mappedPositionsForImageryLayer(t).cartographicBoundingRectangle,r=this._computeImageryLevel(t,i);return C1.createImageryCoverages(i,t,r)}_computeImageryLevel(t,n){let i=t.imageryProvider,o=i.tilingScheme.rectangle,s=1,a=n.width,c=o.width;n.height>n.width&&(a=n.height,c=o.height);let u=Math.log2(s*c/a);return C1._clampImageryLevel(i,u)}_updateImageries(t){let n=this._model,i=this._coveragesPerLayer,r=i.length,o=!0;for(let s=0;s<r;s++){let a=i[s],c=a.length;for(let u=0;u<c;u++){let d=a[u].imagery;d.state===jn.READY||d.state===jn.FAILED||d.state===jn.INVALID||(o=!1,d.processStateMachine(t,!1,!1))}}o&&n.resetDrawCommands(),this._allImageriesReady=o}mappedPositionsForImageryLayer(t){let n=e._getEllipsoid(t);return this.mappedPositionsForEllipsoid(n)}mappedPositionsForEllipsoid(t){let n=this._mappedPositionsPerEllipsoid;if(!l(n))throw new pe("The mappedPositions have not been computed yet");let i=n.length;for(let r=0;r<i;r++){let o=n[r];if(o.ellipsoid===t)return o}throw new pe(`Could not find mapped positions for ellipsoid ${t}`)}imageryTexCoordAttributesPerProjection(){let t=this._imageryTexCoordAttributesPerProjection;if(!l(t))throw new pe("The imagery texture coordinate attributes have not been computed yet");return this._imageryTexCoordAttributesPerProjection}get ready(){let t=this._coveragesPerLayer;return l(t)?this._allImageriesReady:!1}isDestroyed(){return!1}destroy(){if(!this.isDestroyed())return this._deleteCoveragesPerLayer(),this._destroyImageryTexCoordAttributes(),le(this)}static _computePrimitivePositionTransform(t,n,i){l(i)||(i=new M);let r=t.sceneGraph;return M.clone(M.IDENTITY,i),M.multiply(i,t.modelMatrix,i),M.multiply(i,r.components.transform,i),M.multiply(i,r.axisCorrectionMatrix,i),M.multiply(i,n.computedTransform,i),i}static _obtainPrimitivePositionAttribute(t){let n=xt.getAttributeBySemantic(t,"POSITION");if(!l(n))throw new pe("The primitive does not have a POSITION attribute");return n}static _getEllipsoid(t){return t.imageryProvider.tilingScheme.projection.ellipsoid}},cS=jZ;var HZ=class{constructor(t,n,i,r,o){this.imageryLayer=t,this.texture=n,this.textureTranslationAndScale=i,this.textureCoordinateRectangle=r,this.imageryTexCoordAttributeSetIndex=o}},ZV=HZ;var plt=!1,glt=new ie,_lt=new ie,GZ=class e{static process(t,n,i){let r=t.model,o=n.modelPrimitiveImagery;if(!l(o)||!o.ready)return;let s=r.imageryLayers,a=cS._extractProjections(s),c=[...new Set(a)],u=e._computeIndexMapping(a,c),f=e._createImageryInputs(s,o,u);if(f.length===0)return;f.length>10&&(yt("imagery-texture-units",`Warning: Draped imagery requires ${f.length} texture units, truncating`),f.length=10),e._addImageryTexCoordAttributesToRenderResources(o,t);let d=[];for(let p=0;p<s.length;p++)d.push(s.get(p));e._processImageryInputs(d,t,f,c.length)}static _addImageryTexCoordAttributesToRenderResources(t,n){let i=t.imageryTexCoordAttributesPerProjection();for(let r of i)e._addImageryTexCoordAttributeToRenderResources(r,n)}static _addImageryTexCoordAttributeToRenderResources(t,n){let i=Vt.getNumberOfComponents(t.type),r={index:n.attributeIndex++,value:l(t.buffer)?void 0:t.constant,vertexBuffer:t.buffer,count:t.count,componentsPerAttribute:i,componentDatatype:t.componentDatatype,offsetInBytes:t.byteOffset,strideInBytes:t.byteStride,normalize:t.normalized};n.attributes.push(r)}static _processImageryInputs(t,n,i,r){let o=n.shaderBuilder,s=e._computeImageryFlags(t),a=i.length;o.addDefine("HAS_IMAGERY"),o.addDefine(`IMAGERY_TEXTURE_UNITS ${a}`),e._addAttributes(o,r),e._defineUniforms(o,s),e._buildSampleAndBlendFunction(o,s),e._createMainImageryShader(o,i,s);let c=n.uniformMap,u=e._createImageryUniforms(i);e._setImageryUniforms(c,u)}static _addAttributes(t,n){for(let o=0;o<n;o++)t.addAttribute("vec2",`a_imagery_texCoord_${o}`),t.addVarying("vec2",`v_imagery_texCoord_${o}`);let i="initializeImageryAttributes",r=`void ${i}()`;t.addFunction(i,r,de.VERTEX);for(let o=0;o<n;o++)t.addFunctionLines(i,[`v_imagery_texCoord_${o} = a_imagery_texCoord_${o};`])}static _computeImageryFlags(t){let n=new $V;for(let i=0;i<t.length;i++){let r=t[i];n.alpha|=r.alpha!==1,n.brightness|=r.brightness!==Ns.DEFAULT_BRIGHTNESS,n.contrast|=r.contrast!==Ns.DEFAULT_CONTRAST,n.hue|=r.hue!==Ns.DEFAULT_HUE,n.saturation|=r.saturation!==Ns.DEFAULT_SATURATION,n.gamma|=r.gamma!==Ns.DEFAULT_GAMMA;let o=l(r.colorToAlpha)&&r.colorToAlphaThreshold>0;n.colorToAlpha|=o}return n}static _defineUniforms(t,n){t.addUniform("sampler2D","u_imageryTextures[IMAGERY_TEXTURE_UNITS]",de.FRAGMENT),t.addUniform("vec4","u_imageryTextureCoordinateRectangle[IMAGERY_TEXTURE_UNITS]",de.FRAGMENT),t.addUniform("vec4","u_imageryTextureTranslationAndScale[IMAGERY_TEXTURE_UNITS]",de.FRAGMENT),n.alpha&&t.addUniform("float","u_imageryTextureAlpha[IMAGERY_TEXTURE_UNITS]",de.FRAGMENT),n.brightness&&t.addUniform("float","u_imageryTextureBrightness[IMAGERY_TEXTURE_UNITS]",de.FRAGMENT),n.contrast&&t.addUniform("float","u_imageryTextureContrast[IMAGERY_TEXTURE_UNITS]",de.FRAGMENT),n.hue&&t.addUniform("float","u_imageryTextureHue[IMAGERY_TEXTURE_UNITS]",de.FRAGMENT),n.saturation&&t.addUniform("float","u_imageryTextureSaturation[IMAGERY_TEXTURE_UNITS]",de.FRAGMENT),n.gamma&&t.addUniform("float","u_imageryTextureOneOverGamma[IMAGERY_TEXTURE_UNITS]",de.FRAGMENT),n.colorToAlpha&&t.addUniform("vec4","u_imageryTextureColorToAlpha[IMAGERY_TEXTURE_UNITS]",de.FRAGMENT)}static _createSampleAndBlendFunctionSignature(t){let n="sampleAndBlend",i=[];i.push("vec4 previousColor"),i.push("sampler2D textureToSample"),i.push("vec2 textureCoordinates"),i.push("vec4 textureCoordinateRectangle"),i.push("vec4 textureCoordinateTranslationAndScale"),t.alpha&&i.push("float textureAlpha"),t.brightness&&i.push("float textureBrightness"),t.contrast&&i.push("float textureContrast"),t.hue&&i.push("float textureHue"),t.saturation&&i.push("float textureSaturation"),t.gamma&&i.push("float textureOneOverGamma"),t.colorToAlpha&&i.push("vec4 colorToAlpha");let r=i.join(", ");return`vec4 ${n}(${r})`}static _buildSampleAndBlendFunction(t,n){let i="sampleAndBlend",r=e._createSampleAndBlendFunctionSignature(n);t.addFunction(i,r,de.FRAGMENT),t.addFunctionLines(i,["float effectiveAlpha = 1.0;"]),n.alpha&&t.addFunctionLines(i,["effectiveAlpha = textureAlpha;"]),t.addFunctionLines(i,["if (textureCoordinates.x < textureCoordinateRectangle.x) effectiveAlpha = 0.0;","if (textureCoordinates.x > textureCoordinateRectangle.z) effectiveAlpha = 0.0;","if (textureCoordinates.y < textureCoordinateRectangle.y) effectiveAlpha = 0.0;","if (textureCoordinates.y > textureCoordinateRectangle.w) effectiveAlpha = 0.0;","vec2 translation = textureCoordinateTranslationAndScale.xy;","vec2 scale = textureCoordinateTranslationAndScale.zw;","vec2 effectiveTextureCoordinates = textureCoordinates * scale + translation;","vec4 value = texture(textureToSample, effectiveTextureCoordinates);","value = czm_srgbToLinear(value);","vec3 color = value.rgb;","float alpha = value.a;"]),n.colorToAlpha&&t.addFunctionLines(i,["vec3 colorDiff = abs(color.rgb - colorToAlpha.rgb);","colorDiff.r = czm_maximumComponent(colorDiff);","alpha = czm_branchFreeTernary(colorDiff.r < colorToAlpha.a, 0.0, alpha);"]),n.gamma?t.addFunctionLines(i,["color = pow(color, vec3(textureOneOverGamma));"]):t.addFunctionLines(i,["vec4 tempColor = czm_gammaCorrect(vec4(color, alpha));","color = tempColor.rgb;","alpha = tempColor.a;"]),n.brightness&&t.addFunctionLines(i,["color = mix(vec3(0.0), color, textureBrightness);"]),n.contrast&&t.addFunctionLines(i,["color = mix(vec3(0.5), color, textureContrast);"]),n.hue&&t.addFunctionLines(i,["color = czm_hue(color, textureHue);"]),n.saturation&&t.addFunctionLines(i,["color = czm_saturation(color, textureSaturation);"]),t.addFunctionLines(i,["float sourceAlpha = alpha * effectiveAlpha;","float outAlpha = mix(previousColor.a, 1.0, sourceAlpha);","outAlpha += sign(outAlpha) - 1.0;","vec3 outColor = mix(previousColor.rgb * previousColor.a, color, sourceAlpha) / outAlpha;","vec4 result = vec4(outColor, max(outAlpha, 0.0));"]),plt&&t.addFunctionLines(i,["if (abs(textureCoordinates.x - textureCoordinateRectangle.x) < (1.0/256.0) || "," abs(textureCoordinates.x - textureCoordinateRectangle.z) < (1.0/256.0) || "," abs(textureCoordinates.y - textureCoordinateRectangle.y) < (1.0/256.0) || "," abs(textureCoordinates.y - textureCoordinateRectangle.w) < (1.0/256.0))","{"," result = vec4(1.0, 0.0, 0.0, effectiveAlpha);","}"]),t.addFunctionLines(i,["return result;"])}static _createSampleAndBlendCallArguments(t,n,i){let r=`v_imagery_texCoord_${n}`,o=[];return o.push("blendedBaseColor"),o.push(`u_imageryTextures[${i}]`),o.push(`${r}`),o.push(`u_imageryTextureCoordinateRectangle[${i}]`),o.push(`u_imageryTextureTranslationAndScale[${i}]`),t.alpha&&o.push(`u_imageryTextureAlpha[${i}]`),t.brightness&&o.push(`u_imageryTextureBrightness[${i}]`),t.contrast&&o.push(`u_imageryTextureContrast[${i}]`),t.hue&&o.push(`u_imageryTextureHue[${i}]`),t.saturation&&o.push(`u_imageryTextureSaturation[${i}]`),t.gamma&&o.push(`u_imageryTextureOneOverGamma[${i}]`),t.colorToAlpha&&o.push(`u_imageryTextureColorToAlpha[${i}]`),o.join(", ")}static _createMainImageryShader(t,n,i){let r="blendBaseColorWithImagery";t.addFunction(r,"vec4 blendBaseColorWithImagery(vec4 baseColorWithAlpha)",de.FRAGMENT),t.addFunctionLines(r,["vec4 blendedBaseColor = baseColorWithAlpha;"]);for(let o=0;o<n.length;o++){let a=n[o].imageryTexCoordAttributeSetIndex,c=e._createSampleAndBlendCallArguments(i,a,o);t.addFunctionLines(r,[`blendedBaseColor = sampleAndBlend(${c});`])}t.addFunctionLines(r,["return blendedBaseColor;"])}static _createImageryUniforms(t){let n=t.length,i={};i.imageryTextures=Array(n),i.imageryTextureCoordinateRectangle=Array(n),i.imageryTextureTranslationAndScale=Array(n),i.imageryTextureAlpha=Array(n),i.imageryTextureBrightness=Array(n),i.imageryTextureContrast=Array(n),i.imageryTextureHue=Array(n),i.imageryTextureSaturation=Array(n),i.imageryTextureOneOverGamma=Array(n),i.imageryTextureColorToAlpha=Array(n);for(let r=0;r<n;r++){let o=t[r],s=o.imageryLayer,a=o.texture,c=o.textureCoordinateRectangle,u=o.textureTranslationAndScale;i.imageryTextures[r]=a,i.imageryTextureTranslationAndScale[r]=u,i.imageryTextureCoordinateRectangle[r]=c,i.imageryTextureAlpha[r]=s.alpha,i.imageryTextureBrightness[r]=s.brightness,i.imageryTextureContrast[r]=s.contrast,i.imageryTextureHue[r]=s.hue,i.imageryTextureSaturation[r]=s.saturation,i.imageryTextureOneOverGamma[r]=1/s.gamma;let f=i.imageryTextureColorToAlpha[r];if(l(f)||(f=new se,i.imageryTextureColorToAlpha[r]=f),l(s.colorToAlpha)&&s.colorToAlphaThreshold>0){let p=s.colorToAlpha;f.x=p.red,f.y=p.green,f.z=p.blue,f.w=s.colorToAlphaThreshold}else f.w=-1}return i}static _setImageryUniforms(t,n){for(let i in n)if(n.hasOwnProperty(i)){let r=`u_${i}`;t[r]=function(){return n[i]}}}static _createImageryInputs(t,n,i){let r=[];for(let o=0;o<t.length;o++){let s=t.get(o);if(!s.show)continue;let a=i[o],u=n.mappedPositionsForImageryLayer(s).cartographicBoundingRectangle,f=n.coveragesForImageryLayer(s);for(let d=0;d<f.length;d++){let p=f[d],g=e._createImageryInput(s,p,u,a);l(g)&&r.push(g)}}return r}static _createImageryInput(t,n,i,r){let o=n.imagery;if(o.state===jn.FAILED||o.state===jn.INVALID)return;let s=o.textureWebMercator;if(!l(s)&&(s=o.texture,!l(s))){o.state===jn.READY&&console.log(`Imagery at ${n.x}, ${n.y} (level ${n.level}) does not have any texture - state ${o.state}`);return}let a=e._computeTextureTranslationAndScale(t,i,o.rectangle),c=n.textureCoordinateRectangle,u=new se(c.minX,c.minY,c.maxX,c.maxY);return new ZV(t,s,a,u,r)}static _computeTextureTranslationAndScale(t,n,i){let r=t.imageryProvider.tilingScheme,o=r.rectangleToNativeRectangle(n,glt),s=r.rectangleToNativeRectangle(i,_lt);return e._computeTextureTranslationAndScaleFromNative(o,s)}static _computeTextureTranslationAndScaleFromNative(t,n){let i=1/n.width,r=1/n.height,o=t.west-n.west,s=t.south-n.south,a=o*i,c=s*r,u=t.width*i,f=t.height*r;return new se(a,c,u,f)}static _computeIndexMapping(t,n){let i=[],r=t.length;for(let o=0;o<r;o++){let s=t[o],a=n.indexOf(s);i.push(a)}return i}},QV=GZ;var e4=`#ifdef USE_IBL_LIGHTING vec3 computeIBL(vec3 position, vec3 normal, vec3 lightDirection, vec3 lightColorHdr, czm_modelMaterial material) { #if defined(DIFFUSE_IBL) || defined(SPECULAR_IBL) @@ -9011,7 +9007,7 @@ color = czm_linearToSrgb(color); #endif material.diffuse = color; } -`;var V_e={UNLIT:0,PBR:1};Object.freeze(V_e);var ug=V_e;var j_e={name:"LightingPipelineStage"};j_e.process=function(e,t){let{model:n,lightingOptions:i,shaderBuilder:r}=e;if(l(n.lightColor)){r.addDefine("USE_CUSTOM_LIGHT_COLOR",void 0,de.FRAGMENT),r.addUniform("vec3","model_lightColorHdr",de.FRAGMENT);let s=e.uniformMap;s.model_lightColorHdr=function(){return n.lightColor}}let{lightingModel:o}=i;o===ug.PBR?r.addDefine("LIGHTING_PBR",void 0,de.FRAGMENT):r.addDefine("LIGHTING_UNLIT",void 0,de.FRAGMENT),r.addFragmentLines(rV)};var oV=j_e;var sV=`bool isDefaultStyleColor(vec3 color) +`;var axe={UNLIT:0,PBR:1};Object.freeze(axe);var _g=axe;var cxe={name:"LightingPipelineStage"};cxe.process=function(e,t){let{model:n,lightingOptions:i,shaderBuilder:r}=e;if(l(n.lightColor)){r.addDefine("USE_CUSTOM_LIGHT_COLOR",void 0,de.FRAGMENT),r.addUniform("vec3","model_lightColorHdr",de.FRAGMENT);let s=e.uniformMap;s.model_lightColorHdr=function(){return n.lightColor}}let{lightingModel:o}=i;o===_g.PBR?r.addDefine("LIGHTING_PBR",void 0,de.FRAGMENT):r.addDefine("LIGHTING_UNLIT",void 0,de.FRAGMENT),r.addFragmentLines(e4)};var t4=cxe;var n4=`bool isDefaultStyleColor(vec3 color) { return all(greaterThan(color, vec3(1.0 - czm_epsilon3))); } @@ -9460,7 +9456,7 @@ setClearcoat(material, attributes); #endif #endif } -`;var aV=`#ifdef HAS_CONSTANT_LOD +`;var i4=`#ifdef HAS_CONSTANT_LOD float modelScaleX = length(czm_model[0].xyz); float modelScaleY = length(czm_model[1].xyz); float modelScaleZ = length(czm_model[2].xyz); @@ -9469,7 +9465,7 @@ vec3 enuDir = (u_constantLodWorldToEnu * czm_model * vec4(v_positionMC, 0.0)).xy v_constantLodUvCustom.xy = (enuDir.yx + u_constantLodOffset) / modelScale; v_constantLodUvCustom.z = u_constantLodDistance / modelScale; #endif -`;var cV=`#ifdef HAS_CONSTANT_LOD +`;var r4=`#ifdef HAS_CONSTANT_LOD vec4 constantLodTextureLookup(sampler2D textureSampler, vec3 constantLodParams) { bool atMaxClamp = v_constantLodUvCustom.z >= constantLodParams.y; bool atMinClamp = v_constantLodUvCustom.z <= constantLodParams.x; @@ -9512,8 +9508,8 @@ tc2 = czm_computeTextureTransform(tc2, textureTransform); return mix(texture(textureSampler, tc1), texture(textureSampler, tc2), f); } #endif -`;var{Material:Dot,MetallicRoughness:ZJ,SpecularGlossiness:QJ,Specular:H_e,Clearcoat:G_e}=vn,W_e={name:"MaterialPipelineStage",_processTexture:Ru,_processTextureTransform:q_e};W_e.process=function(e,t,n){let i=t.material,{model:r,uniformMap:o,shaderBuilder:s}=e;l(o.u_constantLodDistance)||(o.u_constantLodDistance=function(){let x=r.boundingSphere,T=n.camera;if(l(x)&&l(T)){let E=h.distance(T.positionWC,x.center);return Math.max(E,.1)}return 1});let a=l(r.classificationType),c=a,{defaultTexture:u,defaultNormalTexture:f,defaultEmissiveTexture:d}=n.context;Lot(i,o,s,u,f,d,c,e),l(i.specularGlossiness)?Fot(i.specularGlossiness,o,s,u,c,e):(l(i.specular)&&xt.supportedExtensions.KHR_materials_specular&&Bot(i.specular,o,s,u,c),l(i.anisotropy)&&xt.supportedExtensions.KHR_materials_anisotropy&&Uot(i.anisotropy,o,s,u,c),l(i.clearcoat)&&xt.supportedExtensions.KHR_materials_clearcoat&&zot(i.clearcoat,o,s,u,c),Vot(i.metallicRoughness,o,s,u,c,e));let p=xt.getAttributeBySemantic(t,ct.NORMAL),g=l(r.pointCloudShading)&&!r.pointCloudShading.normalShading;l(i.planarFill)&&Rot(i.planarFill,t,e,n);let m=l(i.planarFill)&&i.planarFill.backgroundFill,y=e.lightingOptions;i.unlit||!p||a||g||m?y.lightingModel=ug.UNLIT:y.lightingModel=ug.PBR;let A=r.backFaceCulling&&!i.doubleSided;e.renderStateOptions.cull.enabled=A;let b=e.alphaOptions;i.alphaMode===Q0.BLEND?b.pass=Ie.TRANSLUCENT:i.alphaMode===Q0.MASK&&(b.alphaCutoff=i.alphaCutoff),l(i.pointDiameter)&&(s.addDefine("HAS_POINT_DIAMETER",void 0,de.BOTH),s.addUniform("float","u_pointDiameter",de.VERTEX),o.u_pointDiameter=function(){return i.pointDiameter*n.pixelRatio}),l(i.lineStyle)&&Mot(i.lineStyle,t,n,o,s),s.addFragmentLines(sV),i.doubleSided&&s.addDefine("HAS_DOUBLE_SIDED_MATERIAL",void 0,de.BOTH)};function Rot(e,t,n,i){let{uniformMap:r,shaderBuilder:o}=n;if(i.planarFillRequested=!0,o.addDefine("HAS_PLANAR_FILL_DEPTH",void 0,de.FRAGMENT),e.backgroundFill&&o.addDefine("HAS_BACKGROUND_FILL",void 0,de.FRAGMENT),!(l(t.featureIds)&&t.featureIds.length>0))return;let a=t.featureIds[0].positionalLabel;o.addDefine("PLANAR_FILL_FEATURE_ID",a,de.FRAGMENT),e.behind?o.addDefine("HAS_PLANAR_FILL_BEHIND",void 0,de.FRAGMENT):(n.planarFillIdPass=!0,o.addDefine("HAS_PLANAR_FILL_ID_PASS",void 0,de.FRAGMENT),o.addUniform("bool","u_isPlanarFillIdPass",de.FRAGMENT),r.u_isPlanarFillIdPass=function(){return!1})}function Oot(e,t,n,i,r,o){let s=n.constantLod;if(!l(s)||!l(o))return;let a=`HAS_${r}_CONSTANT_LOD`;if(e.addDefine(a,void 0,de.BOTH),!l(t.u_constantLodOffset)){e.addDefine("HAS_CONSTANT_LOD",void 0,de.BOTH),e.addVarying("vec3","v_constantLodUvCustom"),e.addUniform("vec2","u_constantLodOffset",de.VERTEX),e.addUniform("float","u_constantLodDistance",de.VERTEX),e.addUniform("mat4","u_constantLodWorldToEnu",de.VERTEX),e.addFragmentLines(cV);let u=aV.split(` -`).filter(f=>!f.trim().startsWith("//")||f.includes("#"));e.addFunctionLines("setDynamicVaryingsVS",u)}let c=`${i}ConstantLodParams`;if(e.addUniform("vec3",c,de.FRAGMENT),t[c]=function(){return new h(s.minClampDistance,s.maxClampDistance,s.repetitions)},!l(t.u_constantLodOffset)){t.u_constantLodOffset=function(){return s.offset};let u=M.clone(M.IDENTITY),f=!1;t.u_constantLodWorldToEnu=function(){if(!f){let d=o.model.boundingSphere;if(l(d)){let p=d.center,g=At.eastNorthUpToFixedFrame(p);M.inverse(g,u),f=!0}}return f?u:M.IDENTITY}}}function Mot(e,t,n,i,r){let{width:o,pattern:s}=e;l(o)&&(r.addUniform("float","u_lineWidth",de.VERTEX),i.u_lineWidth=function(){return o*n.pixelRatio}),l(s)&&(r.addDefine("HAS_LINE_PATTERN",void 0,de.BOTH),r.addUniform("float","u_linePattern",de.FRAGMENT),r.addVarying("float","v_lineCoord"),i.u_linePattern=function(){return s});let a=xt.getAttributeBySemantic(t,ct.CUMULATIVE_DISTANCE);if(l(s)&&l(a)&&(t.primitiveType===Oe.LINES||t.primitiveType===Oe.TRIANGLE_STRIP)){r.addDefine("HAS_LINE_CUMULATIVE_DISTANCE",void 0,de.VERTEX),a.normalized&&r.addDefine("LINE_CUM_DIST_NORMALIZED",void 0,de.VERTEX),r.addUniform("float","u_cumulativeDistanceMax",de.VERTEX),r.addUniform("float","u_pixelsPerWorld",de.VERTEX);let c=l(a.max)?a.max:1;i.u_cumulativeDistanceMax=function(){return c},i.u_pixelsPerWorld=function(){let f=n.camera.frustum,d=1,p;return l(f.right)&&l(f.left)?p=f.right-f.left:l(f.width)&&(p=f.width),l(p)&&p>0&&(d=n.context.drawingBufferWidth/p),d};let u=xt.getAttributeInfo(a).variableName;r.addVertexLines(` +`;var{Material:ylt,MetallicRoughness:WZ,SpecularGlossiness:qZ,Specular:lxe,Clearcoat:uxe}=vn,fxe={name:"MaterialPipelineStage",_processTexture:Mu,_processTextureTransform:dxe};fxe.process=function(e,t,n){let i=t.material,{model:r,uniformMap:o,shaderBuilder:s}=e;l(o.u_constantLodDistance)||(o.u_constantLodDistance=function(){let x=r.boundingSphere,T=n.camera;if(l(x)&&l(T)){let E=h.distance(T.positionWC,x.center);return Math.max(E,.1)}return 1});let a=l(r.classificationType),c=a,{defaultTexture:u,defaultNormalTexture:f,defaultEmissiveTexture:d}=n.context;Elt(i,o,s,u,f,d,c,e),l(i.specularGlossiness)?Clt(i.specularGlossiness,o,s,u,c,e):(l(i.specular)&&xt.supportedExtensions.KHR_materials_specular&&vlt(i.specular,o,s,u,c),l(i.anisotropy)&&xt.supportedExtensions.KHR_materials_anisotropy&&wlt(i.anisotropy,o,s,u,c),l(i.clearcoat)&&xt.supportedExtensions.KHR_materials_clearcoat&&Ilt(i.clearcoat,o,s,u,c),Plt(i.metallicRoughness,o,s,u,c,e));let p=xt.getAttributeBySemantic(t,ct.NORMAL),g=l(r.pointCloudShading)&&!r.pointCloudShading.normalShading;l(i.planarFill)&&Alt(i.planarFill,t,e,n);let m=l(i.planarFill)&&i.planarFill.backgroundFill,y=e.lightingOptions;i.unlit||!p||a||g||m?y.lightingModel=_g.UNLIT:y.lightingModel=_g.PBR;let A=r.backFaceCulling&&!i.doubleSided;e.renderStateOptions.cull.enabled=A;let b=e.alphaOptions;i.alphaMode===cg.BLEND?b.pass=Ie.TRANSLUCENT:i.alphaMode===cg.MASK&&(b.alphaCutoff=i.alphaCutoff),l(i.pointDiameter)&&(s.addDefine("HAS_POINT_DIAMETER",void 0,de.BOTH),s.addUniform("float","u_pointDiameter",de.VERTEX),o.u_pointDiameter=function(){return i.pointDiameter*n.pixelRatio}),l(i.lineStyle)&&xlt(i.lineStyle,t,n,o,s),s.addFragmentLines(n4),i.doubleSided&&s.addDefine("HAS_DOUBLE_SIDED_MATERIAL",void 0,de.BOTH)};function Alt(e,t,n,i){let{uniformMap:r,shaderBuilder:o}=n;if(i.planarFillRequested=!0,o.addDefine("HAS_PLANAR_FILL_DEPTH",void 0,de.FRAGMENT),e.backgroundFill&&o.addDefine("HAS_BACKGROUND_FILL",void 0,de.FRAGMENT),!(l(t.featureIds)&&t.featureIds.length>0))return;let a=t.featureIds[0].positionalLabel;o.addDefine("PLANAR_FILL_FEATURE_ID",a,de.FRAGMENT),e.behind?o.addDefine("HAS_PLANAR_FILL_BEHIND",void 0,de.FRAGMENT):(n.planarFillIdPass=!0,o.addDefine("HAS_PLANAR_FILL_ID_PASS",void 0,de.FRAGMENT),o.addUniform("bool","u_isPlanarFillIdPass",de.FRAGMENT),r.u_isPlanarFillIdPass=function(){return!1})}function blt(e,t,n,i,r,o){let s=n.constantLod;if(!l(s)||!l(o))return;let a=`HAS_${r}_CONSTANT_LOD`;if(e.addDefine(a,void 0,de.BOTH),!l(t.u_constantLodOffset)){e.addDefine("HAS_CONSTANT_LOD",void 0,de.BOTH),e.addVarying("vec3","v_constantLodUvCustom"),e.addUniform("vec2","u_constantLodOffset",de.VERTEX),e.addUniform("float","u_constantLodDistance",de.VERTEX),e.addUniform("mat4","u_constantLodWorldToEnu",de.VERTEX),e.addFragmentLines(r4);let u=i4.split(` +`).filter(f=>!f.trim().startsWith("//")||f.includes("#"));e.addFunctionLines("setDynamicVaryingsVS",u)}let c=`${i}ConstantLodParams`;if(e.addUniform("vec3",c,de.FRAGMENT),t[c]=function(){return new h(s.minClampDistance,s.maxClampDistance,s.repetitions)},!l(t.u_constantLodOffset)){t.u_constantLodOffset=function(){return s.offset};let u=M.clone(M.IDENTITY),f=!1;t.u_constantLodWorldToEnu=function(){if(!f){let d=o.model.boundingSphere;if(l(d)){let p=d.center,g=At.eastNorthUpToFixedFrame(p);M.inverse(g,u),f=!0}}return f?u:M.IDENTITY}}}function xlt(e,t,n,i,r){let{width:o,pattern:s}=e;l(o)&&(r.addUniform("float","u_lineWidth",de.VERTEX),i.u_lineWidth=function(){return o*n.pixelRatio}),l(s)&&(r.addDefine("HAS_LINE_PATTERN",void 0,de.BOTH),r.addUniform("float","u_linePattern",de.FRAGMENT),r.addVarying("float","v_lineCoord"),i.u_linePattern=function(){return s});let a=xt.getAttributeBySemantic(t,ct.CUMULATIVE_DISTANCE);if(l(s)&&l(a)&&(t.primitiveType===Oe.LINES||t.primitiveType===Oe.TRIANGLE_STRIP)){r.addDefine("HAS_LINE_CUMULATIVE_DISTANCE",void 0,de.VERTEX),a.normalized&&r.addDefine("LINE_CUM_DIST_NORMALIZED",void 0,de.VERTEX),r.addUniform("float","u_cumulativeDistanceMax",de.VERTEX),r.addUniform("float","u_pixelsPerWorld",de.VERTEX);let c=l(a.max)?a.max:1;i.u_cumulativeDistanceMax=function(){return c},i.u_pixelsPerWorld=function(){let f=n.camera.frustum,d=1,p;return l(f.right)&&l(f.left)?p=f.right-f.left:l(f.width)&&(p=f.width),l(p)&&p>0&&(d=n.context.drawingBufferWidth/p),d};let u=xt.getAttributeInfo(a).variableName;r.addVertexLines(` #ifdef HAS_LINE_CUMULATIVE_DISTANCE void lineStyleStageVS(in ProcessedAttributes attributes) { @@ -9540,7 +9536,7 @@ void lineStyleStageVS(in ProcessedAttributes attributes) } } #endif -`)}function q_e(e,t,n,i,r){let o=`HAS_${r}_TEXTURE_TRANSFORM`;e.addDefine(o,void 0,de.FRAGMENT);let s=`${i}Transform`;e.addUniform("mat3",s,de.FRAGMENT),t[s]=function(){return n.transform}}function Not(e,t,n,i,r){let o=`HAS_${r}_TEXTURE_SCALE`;e.addDefine(o,void 0,de.FRAGMENT);let s=`${i}Scale`;e.addUniform("float",s,de.FRAGMENT),t[s]=function(){return n.scale}}function Ru(e,t,n,i,r,o,s){e.addUniform("sampler2D",i,de.FRAGMENT),t[i]=function(){return n.texture??o};let a=`HAS_${r}_TEXTURE`;e.addDefine(a,void 0,de.FRAGMENT);let u=`v_texCoord_${n.texCoord}`,f=`TEXCOORD_${r}`;e.addDefine(f,u,de.FRAGMENT);let d=n.transform;l(d)&&!$.equals(d,$.IDENTITY)&&q_e(e,t,n,i,r);let{scale:p}=n;l(p)&&p!==1&&Not(e,t,n,i,r),Oot(e,t,n,i,r,s)}function Lot(e,t,n,i,r,o,s,a){let{emissiveFactor:c,emissiveTexture:u,normalTexture:f,occlusionTexture:d}=e;l(c)&&!h.equals(c,Dot.DEFAULT_EMISSIVE_FACTOR)&&(n.addUniform("vec3","u_emissiveFactor",de.FRAGMENT),t.u_emissiveFactor=function(){return e.emissiveFactor},n.addDefine("HAS_EMISSIVE_FACTOR",void 0,de.FRAGMENT),l(u)&&!s&&Ru(n,t,u,"u_emissiveTexture","EMISSIVE",o));let p;if(l(e.metallicRoughness)&&l(e.metallicRoughness.baseColorTexture)&&l(e.metallicRoughness.baseColorTexture.constantLod)?p=e.metallicRoughness.baseColorTexture.constantLod:l(e.specularGlossiness)&&l(e.specularGlossiness.diffuseTexture)&&l(e.specularGlossiness.diffuseTexture.constantLod)&&(p=e.specularGlossiness.diffuseTexture.constantLod),l(f)&&!s){let g=f;l(f.constantLod)&&l(p)&&(g=Object.create(Object.getPrototypeOf(f)),Object.assign(g,f),g.constantLod=p),Ru(n,t,g,"u_normalTexture","NORMAL",r,a)}l(d)&&!s&&Ru(n,t,d,"u_occlusionTexture","OCCLUSION",i)}function Fot(e,t,n,i,r,o){let{diffuseTexture:s,diffuseFactor:a,specularGlossinessTexture:c,specularFactor:u,glossinessFactor:f}=e;n.addDefine("USE_SPECULAR_GLOSSINESS",void 0,de.FRAGMENT),l(s)&&!r&&Ru(n,t,s,"u_diffuseTexture","DIFFUSE",i,o),l(a)&&!se.equals(a,QJ.DEFAULT_DIFFUSE_FACTOR)&&(n.addUniform("vec4","u_diffuseFactor",de.FRAGMENT),t.u_diffuseFactor=function(){return e.diffuseFactor},n.addDefine("HAS_DIFFUSE_FACTOR",void 0,de.FRAGMENT)),l(c)&&!r&&Ru(n,t,c,"u_specularGlossinessTexture","SPECULAR_GLOSSINESS",i),l(u)&&!h.equals(u,QJ.DEFAULT_SPECULAR_FACTOR)&&(n.addUniform("vec3","u_legacySpecularFactor",de.FRAGMENT),t.u_legacySpecularFactor=function(){return e.specularFactor},n.addDefine("HAS_LEGACY_SPECULAR_FACTOR",void 0,de.FRAGMENT)),l(f)&&f!==QJ.DEFAULT_GLOSSINESS_FACTOR&&(n.addUniform("float","u_glossinessFactor",de.FRAGMENT),t.u_glossinessFactor=function(){return e.glossinessFactor},n.addDefine("HAS_GLOSSINESS_FACTOR",void 0,de.FRAGMENT))}function Bot(e,t,n,i,r){let{specularTexture:o,specularFactor:s,specularColorTexture:a,specularColorFactor:c}=e;n.addDefine("USE_SPECULAR",void 0,de.FRAGMENT),l(o)&&!r&&Ru(n,t,o,"u_specularTexture","SPECULAR",i),l(s)&&s!==H_e.DEFAULT_SPECULAR_FACTOR&&(n.addUniform("float","u_specularFactor",de.FRAGMENT),t.u_specularFactor=function(){return e.specularFactor},n.addDefine("HAS_SPECULAR_FACTOR",void 0,de.FRAGMENT)),l(a)&&!r&&Ru(n,t,a,"u_specularColorTexture","SPECULAR_COLOR",i),l(c)&&!h.equals(c,H_e.DEFAULT_SPECULAR_COLOR_FACTOR)&&(n.addUniform("vec3","u_specularColorFactor",de.FRAGMENT),t.u_specularColorFactor=function(){return e.specularColorFactor},n.addDefine("HAS_SPECULAR_COLOR_FACTOR",void 0,de.FRAGMENT))}var kot=new h;function Uot(e,t,n,i,r){let{anisotropyStrength:o,anisotropyRotation:s,anisotropyTexture:a}=e;n.addDefine("USE_ANISOTROPY",void 0,de.FRAGMENT),l(a)&&!r&&Ru(n,t,a,"u_anisotropyTexture","ANISOTROPY",i);let c=Math.cos(s),u=Math.sin(s);n.addUniform("vec3","u_anisotropy",de.FRAGMENT),t.u_anisotropy=function(){return h.fromElements(c,u,o,kot)}}function zot(e,t,n,i,r){let{clearcoatFactor:o,clearcoatTexture:s,clearcoatRoughnessFactor:a,clearcoatRoughnessTexture:c,clearcoatNormalTexture:u}=e;n.addDefine("USE_CLEARCOAT",void 0,de.FRAGMENT),l(o)&&o!==G_e.DEFAULT_CLEARCOAT_FACTOR&&(n.addUniform("float","u_clearcoatFactor",de.FRAGMENT),t.u_clearcoatFactor=function(){return e.clearcoatFactor},n.addDefine("HAS_CLEARCOAT_FACTOR",void 0,de.FRAGMENT)),l(s)&&!r&&Ru(n,t,s,"u_clearcoatTexture","CLEARCOAT",i),l(a)&&o!==G_e.DEFAULT_CLEARCOAT_ROUGHNESS_FACTOR&&(n.addUniform("float","u_clearcoatRoughnessFactor",de.FRAGMENT),t.u_clearcoatRoughnessFactor=function(){return e.clearcoatRoughnessFactor},n.addDefine("HAS_CLEARCOAT_ROUGHNESS_FACTOR",void 0,de.FRAGMENT)),l(c)&&!r&&Ru(n,t,c,"u_clearcoatRoughnessTexture","CLEARCOAT_ROUGHNESS",i),l(u)&&!r&&Ru(n,t,u,"u_clearcoatNormalTexture","CLEARCOAT_NORMAL",i)}function Vot(e,t,n,i,r,o){n.addDefine("USE_METALLIC_ROUGHNESS",void 0,de.FRAGMENT);let s=e.baseColorTexture;l(s)&&!r&&Ru(n,t,s,"u_baseColorTexture","BASE_COLOR",i,o);let a=e.baseColorFactor;l(a)&&!se.equals(a,ZJ.DEFAULT_BASE_COLOR_FACTOR)&&(n.addUniform("vec4","u_baseColorFactor",de.FRAGMENT),t.u_baseColorFactor=function(){return e.baseColorFactor},n.addDefine("HAS_BASE_COLOR_FACTOR",void 0,de.FRAGMENT));let c=e.metallicRoughnessTexture;l(c)&&!r&&Ru(n,t,c,"u_metallicRoughnessTexture","METALLIC_ROUGHNESS",i);let u=e.metallicFactor;l(u)&&u!==ZJ.DEFAULT_METALLIC_FACTOR&&(n.addUniform("float","u_metallicFactor",de.FRAGMENT),t.u_metallicFactor=function(){return e.metallicFactor},n.addDefine("HAS_METALLIC_FACTOR",void 0,de.FRAGMENT));let f=e.roughnessFactor;l(f)&&f!==ZJ.DEFAULT_ROUGHNESS_FACTOR&&(n.addUniform("float","u_roughnessFactor",de.FRAGMENT),t.u_roughnessFactor=function(){return e.roughnessFactor},n.addDefine("HAS_ROUGHNESS_FACTOR",void 0,de.FRAGMENT))}var lV=W_e;var Bl={name:"MetadataPickingPipelineStage",METADATA_PICKING_ENABLED:"METADATA_PICKING_ENABLED",METADATA_PICKING_VALUE_TYPE:"METADATA_PICKING_VALUE_TYPE",METADATA_PICKING_VALUE_STRING:"METADATA_PICKING_VALUE_STRING",METADATA_PICKING_VALUE_COMPONENT_X:"METADATA_PICKING_VALUE_COMPONENT_X",METADATA_PICKING_VALUE_COMPONENT_Y:"METADATA_PICKING_VALUE_COMPONENT_Y",METADATA_PICKING_VALUE_COMPONENT_Z:"METADATA_PICKING_VALUE_COMPONENT_Z",METADATA_PICKING_VALUE_COMPONENT_W:"METADATA_PICKING_VALUE_COMPONENT_W"};Bl.process=function(e,t,n){let i=e.shaderBuilder;i.addDefine(Bl.METADATA_PICKING_VALUE_TYPE,"float",de.FRAGMENT),i.addDefine(Bl.METADATA_PICKING_VALUE_STRING,"0.0",de.FRAGMENT),i.addDefine(Bl.METADATA_PICKING_VALUE_COMPONENT_X,"0.0",de.FRAGMENT),i.addDefine(Bl.METADATA_PICKING_VALUE_COMPONENT_Y,"0.0",de.FRAGMENT),i.addDefine(Bl.METADATA_PICKING_VALUE_COMPONENT_Z,"0.0",de.FRAGMENT),i.addDefine(Bl.METADATA_PICKING_VALUE_COMPONENT_W,"0.0",de.FRAGMENT),i.addFunction("metadataPickingStage","void metadataPickingStage(Metadata metadata, MetadataClass metadataClass, inout vec4 metadataValues)",de.FRAGMENT),i.addFunctionLines("metadataPickingStage",[`${Bl.METADATA_PICKING_VALUE_TYPE} value = ${Bl.METADATA_PICKING_VALUE_TYPE}(${Bl.METADATA_PICKING_VALUE_STRING});`,`metadataValues.x = ${Bl.METADATA_PICKING_VALUE_COMPONENT_X};`,`metadataValues.y = ${Bl.METADATA_PICKING_VALUE_COMPONENT_Y};`,`metadataValues.z = ${Bl.METADATA_PICKING_VALUE_COMPONENT_Z};`,`metadataValues.w = ${Bl.METADATA_PICKING_VALUE_COMPONENT_W};`],de.FRAGMENT)};var xd=Bl;var uV=`void morphTargetsStage(inout ProcessedAttributes attributes) +`)}function dxe(e,t,n,i,r){let o=`HAS_${r}_TEXTURE_TRANSFORM`;e.addDefine(o,void 0,de.FRAGMENT);let s=`${i}Transform`;e.addUniform("mat3",s,de.FRAGMENT),t[s]=function(){return n.transform}}function Tlt(e,t,n,i,r){let o=`HAS_${r}_TEXTURE_SCALE`;e.addDefine(o,void 0,de.FRAGMENT);let s=`${i}Scale`;e.addUniform("float",s,de.FRAGMENT),t[s]=function(){return n.scale}}function Mu(e,t,n,i,r,o,s){e.addUniform("sampler2D",i,de.FRAGMENT),t[i]=function(){return n.texture??o};let a=`HAS_${r}_TEXTURE`;e.addDefine(a,void 0,de.FRAGMENT);let u=`v_texCoord_${n.texCoord}`,f=`TEXCOORD_${r}`;e.addDefine(f,u,de.FRAGMENT);let d=n.transform;l(d)&&!$.equals(d,$.IDENTITY)&&dxe(e,t,n,i,r);let{scale:p}=n;l(p)&&p!==1&&Tlt(e,t,n,i,r),blt(e,t,n,i,r,s)}function Elt(e,t,n,i,r,o,s,a){let{emissiveFactor:c,emissiveTexture:u,normalTexture:f,occlusionTexture:d}=e;l(c)&&!h.equals(c,ylt.DEFAULT_EMISSIVE_FACTOR)&&(n.addUniform("vec3","u_emissiveFactor",de.FRAGMENT),t.u_emissiveFactor=function(){return e.emissiveFactor},n.addDefine("HAS_EMISSIVE_FACTOR",void 0,de.FRAGMENT),l(u)&&!s&&Mu(n,t,u,"u_emissiveTexture","EMISSIVE",o));let p;if(l(e.metallicRoughness)&&l(e.metallicRoughness.baseColorTexture)&&l(e.metallicRoughness.baseColorTexture.constantLod)?p=e.metallicRoughness.baseColorTexture.constantLod:l(e.specularGlossiness)&&l(e.specularGlossiness.diffuseTexture)&&l(e.specularGlossiness.diffuseTexture.constantLod)&&(p=e.specularGlossiness.diffuseTexture.constantLod),l(f)&&!s){let g=f;l(f.constantLod)&&l(p)&&(g=Object.create(Object.getPrototypeOf(f)),Object.assign(g,f),g.constantLod=p),Mu(n,t,g,"u_normalTexture","NORMAL",r,a)}l(d)&&!s&&Mu(n,t,d,"u_occlusionTexture","OCCLUSION",i)}function Clt(e,t,n,i,r,o){let{diffuseTexture:s,diffuseFactor:a,specularGlossinessTexture:c,specularFactor:u,glossinessFactor:f}=e;n.addDefine("USE_SPECULAR_GLOSSINESS",void 0,de.FRAGMENT),l(s)&&!r&&Mu(n,t,s,"u_diffuseTexture","DIFFUSE",i,o),l(a)&&!se.equals(a,qZ.DEFAULT_DIFFUSE_FACTOR)&&(n.addUniform("vec4","u_diffuseFactor",de.FRAGMENT),t.u_diffuseFactor=function(){return e.diffuseFactor},n.addDefine("HAS_DIFFUSE_FACTOR",void 0,de.FRAGMENT)),l(c)&&!r&&Mu(n,t,c,"u_specularGlossinessTexture","SPECULAR_GLOSSINESS",i),l(u)&&!h.equals(u,qZ.DEFAULT_SPECULAR_FACTOR)&&(n.addUniform("vec3","u_legacySpecularFactor",de.FRAGMENT),t.u_legacySpecularFactor=function(){return e.specularFactor},n.addDefine("HAS_LEGACY_SPECULAR_FACTOR",void 0,de.FRAGMENT)),l(f)&&f!==qZ.DEFAULT_GLOSSINESS_FACTOR&&(n.addUniform("float","u_glossinessFactor",de.FRAGMENT),t.u_glossinessFactor=function(){return e.glossinessFactor},n.addDefine("HAS_GLOSSINESS_FACTOR",void 0,de.FRAGMENT))}function vlt(e,t,n,i,r){let{specularTexture:o,specularFactor:s,specularColorTexture:a,specularColorFactor:c}=e;n.addDefine("USE_SPECULAR",void 0,de.FRAGMENT),l(o)&&!r&&Mu(n,t,o,"u_specularTexture","SPECULAR",i),l(s)&&s!==lxe.DEFAULT_SPECULAR_FACTOR&&(n.addUniform("float","u_specularFactor",de.FRAGMENT),t.u_specularFactor=function(){return e.specularFactor},n.addDefine("HAS_SPECULAR_FACTOR",void 0,de.FRAGMENT)),l(a)&&!r&&Mu(n,t,a,"u_specularColorTexture","SPECULAR_COLOR",i),l(c)&&!h.equals(c,lxe.DEFAULT_SPECULAR_COLOR_FACTOR)&&(n.addUniform("vec3","u_specularColorFactor",de.FRAGMENT),t.u_specularColorFactor=function(){return e.specularColorFactor},n.addDefine("HAS_SPECULAR_COLOR_FACTOR",void 0,de.FRAGMENT))}var Slt=new h;function wlt(e,t,n,i,r){let{anisotropyStrength:o,anisotropyRotation:s,anisotropyTexture:a}=e;n.addDefine("USE_ANISOTROPY",void 0,de.FRAGMENT),l(a)&&!r&&Mu(n,t,a,"u_anisotropyTexture","ANISOTROPY",i);let c=Math.cos(s),u=Math.sin(s);n.addUniform("vec3","u_anisotropy",de.FRAGMENT),t.u_anisotropy=function(){return h.fromElements(c,u,o,Slt)}}function Ilt(e,t,n,i,r){let{clearcoatFactor:o,clearcoatTexture:s,clearcoatRoughnessFactor:a,clearcoatRoughnessTexture:c,clearcoatNormalTexture:u}=e;n.addDefine("USE_CLEARCOAT",void 0,de.FRAGMENT),l(o)&&o!==uxe.DEFAULT_CLEARCOAT_FACTOR&&(n.addUniform("float","u_clearcoatFactor",de.FRAGMENT),t.u_clearcoatFactor=function(){return e.clearcoatFactor},n.addDefine("HAS_CLEARCOAT_FACTOR",void 0,de.FRAGMENT)),l(s)&&!r&&Mu(n,t,s,"u_clearcoatTexture","CLEARCOAT",i),l(a)&&o!==uxe.DEFAULT_CLEARCOAT_ROUGHNESS_FACTOR&&(n.addUniform("float","u_clearcoatRoughnessFactor",de.FRAGMENT),t.u_clearcoatRoughnessFactor=function(){return e.clearcoatRoughnessFactor},n.addDefine("HAS_CLEARCOAT_ROUGHNESS_FACTOR",void 0,de.FRAGMENT)),l(c)&&!r&&Mu(n,t,c,"u_clearcoatRoughnessTexture","CLEARCOAT_ROUGHNESS",i),l(u)&&!r&&Mu(n,t,u,"u_clearcoatNormalTexture","CLEARCOAT_NORMAL",i)}function Plt(e,t,n,i,r,o){n.addDefine("USE_METALLIC_ROUGHNESS",void 0,de.FRAGMENT);let s=e.baseColorTexture;l(s)&&!r&&Mu(n,t,s,"u_baseColorTexture","BASE_COLOR",i,o);let a=e.baseColorFactor;l(a)&&!se.equals(a,WZ.DEFAULT_BASE_COLOR_FACTOR)&&(n.addUniform("vec4","u_baseColorFactor",de.FRAGMENT),t.u_baseColorFactor=function(){return e.baseColorFactor},n.addDefine("HAS_BASE_COLOR_FACTOR",void 0,de.FRAGMENT));let c=e.metallicRoughnessTexture;l(c)&&!r&&Mu(n,t,c,"u_metallicRoughnessTexture","METALLIC_ROUGHNESS",i);let u=e.metallicFactor;l(u)&&u!==WZ.DEFAULT_METALLIC_FACTOR&&(n.addUniform("float","u_metallicFactor",de.FRAGMENT),t.u_metallicFactor=function(){return e.metallicFactor},n.addDefine("HAS_METALLIC_FACTOR",void 0,de.FRAGMENT));let f=e.roughnessFactor;l(f)&&f!==WZ.DEFAULT_ROUGHNESS_FACTOR&&(n.addUniform("float","u_roughnessFactor",de.FRAGMENT),t.u_roughnessFactor=function(){return e.roughnessFactor},n.addDefine("HAS_ROUGHNESS_FACTOR",void 0,de.FRAGMENT))}var o4=fxe;var jl={name:"MetadataPickingPipelineStage",METADATA_PICKING_ENABLED:"METADATA_PICKING_ENABLED",METADATA_PICKING_VALUE_TYPE:"METADATA_PICKING_VALUE_TYPE",METADATA_PICKING_VALUE_STRING:"METADATA_PICKING_VALUE_STRING",METADATA_PICKING_VALUE_COMPONENT_X:"METADATA_PICKING_VALUE_COMPONENT_X",METADATA_PICKING_VALUE_COMPONENT_Y:"METADATA_PICKING_VALUE_COMPONENT_Y",METADATA_PICKING_VALUE_COMPONENT_Z:"METADATA_PICKING_VALUE_COMPONENT_Z",METADATA_PICKING_VALUE_COMPONENT_W:"METADATA_PICKING_VALUE_COMPONENT_W"};jl.process=function(e,t,n){let i=e.shaderBuilder;i.addDefine(jl.METADATA_PICKING_VALUE_TYPE,"float",de.FRAGMENT),i.addDefine(jl.METADATA_PICKING_VALUE_STRING,"0.0",de.FRAGMENT),i.addDefine(jl.METADATA_PICKING_VALUE_COMPONENT_X,"0.0",de.FRAGMENT),i.addDefine(jl.METADATA_PICKING_VALUE_COMPONENT_Y,"0.0",de.FRAGMENT),i.addDefine(jl.METADATA_PICKING_VALUE_COMPONENT_Z,"0.0",de.FRAGMENT),i.addDefine(jl.METADATA_PICKING_VALUE_COMPONENT_W,"0.0",de.FRAGMENT),i.addFunction("metadataPickingStage","void metadataPickingStage(Metadata metadata, MetadataClass metadataClass, inout vec4 metadataValues)",de.FRAGMENT),i.addFunctionLines("metadataPickingStage",[`${jl.METADATA_PICKING_VALUE_TYPE} value = ${jl.METADATA_PICKING_VALUE_TYPE}(${jl.METADATA_PICKING_VALUE_STRING});`,`metadataValues.x = ${jl.METADATA_PICKING_VALUE_COMPONENT_X};`,`metadataValues.y = ${jl.METADATA_PICKING_VALUE_COMPONENT_Y};`,`metadataValues.z = ${jl.METADATA_PICKING_VALUE_COMPONENT_Z};`,`metadataValues.w = ${jl.METADATA_PICKING_VALUE_COMPONENT_W};`],de.FRAGMENT)};var Rd=jl;var s4=`void morphTargetsStage(inout ProcessedAttributes attributes) { vec3 positionMC = attributes.positionMC; attributes.positionMC = getMorphedPosition(positionMC); @@ -9553,7 +9549,7 @@ vec3 tangentMC = attributes.tangentMC; attributes.tangentMC = getMorphedTangent(tangentMC); #endif } -`;var Tc={name:"MorphTargetsPipelineStage",FUNCTION_ID_GET_MORPHED_POSITION:"getMorphedPosition",FUNCTION_SIGNATURE_GET_MORPHED_POSITION:"vec3 getMorphedPosition(in vec3 position)",FUNCTION_ID_GET_MORPHED_NORMAL:"getMorphedNormal",FUNCTION_SIGNATURE_GET_MORPHED_NORMAL:"vec3 getMorphedNormal(in vec3 normal)",FUNCTION_ID_GET_MORPHED_TANGENT:"getMorphedTangent",FUNCTION_SIGNATURE_GET_MORPHED_TANGENT:"vec3 getMorphedTangent(in vec3 tangent)"};Tc.process=function(e,t){let n=e.shaderBuilder;n.addDefine("HAS_MORPH_TARGETS",void 0,de.VERTEX),Yot(n);let i=t.morphTargets.length;for(let a=0;a<i;a++){let c=t.morphTargets[a].attributes,u=c.length;for(let f=0;f<u;f++){let d=c[f],p=d.semantic;p!==ct.POSITION&&p!==ct.NORMAL&&p!==ct.TANGENT||(Hot(e,d,e.attributeIndex,a),e.attributeIndex++)}}Xot(n);let o=e.runtimeNode.morphWeights.length;n.addUniform("float",`u_morphWeights[${o}]`,de.VERTEX),n.addVertexLines(uV);let s={u_morphWeights:function(){return e.runtimeNode.morphWeights}};e.uniformMap=Mt(s,e.uniformMap)};var jot={attributeString:void 0,functionId:void 0};function Hot(e,t,n,i){let r=e.shaderBuilder;Got(e,t,n);let o=Wot(t,jot);qot(r,o,i)}function Got(e,t,n){let i={index:n,value:l(t.buffer)?void 0:t.constant,vertexBuffer:t.buffer,componentsPerAttribute:Vt.getNumberOfComponents(t.type),componentDatatype:t.componentDatatype,offsetInBytes:t.byteOffset,strideInBytes:t.byteStride,normalize:t.normalized};e.attributes.push(i)}function Wot(e,t){switch(e.semantic){case ct.POSITION:t.attributeString="Position",t.functionId=Tc.FUNCTION_ID_GET_MORPHED_POSITION;break;case ct.NORMAL:t.attributeString="Normal",t.functionId=Tc.FUNCTION_ID_GET_MORPHED_NORMAL;break;case ct.TANGENT:t.attributeString="Tangent",t.functionId=Tc.FUNCTION_ID_GET_MORPHED_TANGENT;break;default:break}return t}function qot(e,t,n){let i=t.attributeString,r=`a_target${i}_${n}`,o=`morphed${i} += u_morphWeights[${n}] * a_target${i}_${n};`;e.addAttribute("vec3",r),e.addFunctionLines(t.functionId,[o])}function Yot(e){e.addFunction(Tc.FUNCTION_ID_GET_MORPHED_POSITION,Tc.FUNCTION_SIGNATURE_GET_MORPHED_POSITION,de.VERTEX),e.addFunctionLines(Tc.FUNCTION_ID_GET_MORPHED_POSITION,["vec3 morphedPosition = position;"]),e.addFunction(Tc.FUNCTION_ID_GET_MORPHED_NORMAL,Tc.FUNCTION_SIGNATURE_GET_MORPHED_NORMAL,de.VERTEX),e.addFunctionLines(Tc.FUNCTION_ID_GET_MORPHED_NORMAL,["vec3 morphedNormal = normal;"]),e.addFunction(Tc.FUNCTION_ID_GET_MORPHED_TANGENT,Tc.FUNCTION_SIGNATURE_GET_MORPHED_TANGENT,de.VERTEX),e.addFunctionLines(Tc.FUNCTION_ID_GET_MORPHED_TANGENT,["vec3 morphedTangent = tangent;"])}function Xot(e){e.addFunctionLines(Tc.FUNCTION_ID_GET_MORPHED_POSITION,["return morphedPosition;"]),e.addFunctionLines(Tc.FUNCTION_ID_GET_MORPHED_NORMAL,["return morphedNormal;"]),e.addFunctionLines(Tc.FUNCTION_ID_GET_MORPHED_TANGENT,["return morphedTangent;"])}var fV=Tc;var Y_e={name:"PickingPipelineStage"};function eZ(e){return`vec4(rgba8UnormToUint32(${e}), isEdge ? 1.0 : 0.0, -v_positionEC.z, 0.0)`}Y_e.process=function(e,t,n){let i=n.context,r=e.runtimeNode,o=e.shaderBuilder,s=e.model,a=r.node.instances;if(e.hasPropertyTable)Kot(e,t,a,i);else if(l(a))$ot(e,i);else{let c=X_e(e),u=i.createPickId(c);s._pipelineResources.push(u),s._pickIds.push(u),o.addUniform("vec4","czm_pickColor",de.FRAGMENT);let f=e.uniformMap;f.czm_pickColor=function(){return u.color},e.pickId="czm_pickColor",e.snapId=eZ(e.pickId)}!l(s.classificationType)&&s.hasDrapedVectors()&&(e.pickId=`vectorPickColorOver(${e.pickId})`)};function X_e(e,t){let n=e.model;if(l(n.pickObject))return n.pickObject;let i={model:n,node:e.runtimeNode,primitive:e.runtimePrimitive},r;if(Jo.is3DTiles(n.type)){let o=n.content;r={content:o,primitive:o.tileset,detail:i}}else r={primitive:n,detail:i};return r.id=n.id,l(t)&&(r.instanceId=t),r}function Kot(e,t,n){let i=e.model,r,o,s=i.featureIdLabel,a=i.instanceFeatureIdLabel;l(i.featureTableId)?r=i.featureTableId:l(n)?(o=xt.getFeatureIdsByLabel(n.featureIds,a),r=o.propertyTableId):(o=xt.getFeatureIdsByLabel(t.featureIds,s),r=o.propertyTableId);let c=i.featureTables[r];e.shaderBuilder.addUniform("sampler2D","model_pickTexture",de.FRAGMENT);let f=c.batchTexture;e.uniformMap.model_pickTexture=function(){return f.pickTexture??f.defaultTexture},e.pickId="((selectedFeature.id < int(model_featuresLength)) ? texture(model_pickTexture, selectedFeature.st) : vec4(0.0))",e.snapId=eZ(e.pickId)}function $ot(e,t){let n=e.instanceCount,i=new Array(n),r=new Uint8Array(n*4),o=e.model,s=o._pipelineResources;for(let d=0;d<n;d++){let p=X_e(e,d),g=t.createPickId(p);s.push(g),i[d]=g;let m=g.color;r[d*4+0]=z.floatToByte(m.red),r[d*4+1]=z.floatToByte(m.green),r[d*4+2]=z.floatToByte(m.blue),r[d*4+3]=z.floatToByte(m.alpha)}o._pickIds=i;let a=tt.createVertexBuffer({context:t,typedArray:r,usage:Me.STATIC_DRAW});a.vertexArrayDestroyable=!1,o.statistics.addBuffer(a,!1),s.push(a);let u={index:e.attributeIndex++,vertexBuffer:a,componentsPerAttribute:4,componentDatatype:Y.UNSIGNED_BYTE,normalize:!0,offsetInBytes:0,strideInBytes:0,instanceDivisor:1};e.attributes.push(u);let f=e.shaderBuilder;f.addDefine("USE_PICKING",void 0,de.BOTH),f.addAttribute("vec4","a_pickColor"),f.addVarying("vec4","v_pickColor"),e.pickId="v_pickColor",e.snapId=eZ(e.pickId)}var dV=Y_e;var K_e={ADD:0,REPLACE:1};Object.freeze(K_e);var So=K_e;var hV=`float getPointSizeFromAttenuation(vec3 positionEC) { +`;var Tc={name:"MorphTargetsPipelineStage",FUNCTION_ID_GET_MORPHED_POSITION:"getMorphedPosition",FUNCTION_SIGNATURE_GET_MORPHED_POSITION:"vec3 getMorphedPosition(in vec3 position)",FUNCTION_ID_GET_MORPHED_NORMAL:"getMorphedNormal",FUNCTION_SIGNATURE_GET_MORPHED_NORMAL:"vec3 getMorphedNormal(in vec3 normal)",FUNCTION_ID_GET_MORPHED_TANGENT:"getMorphedTangent",FUNCTION_SIGNATURE_GET_MORPHED_TANGENT:"vec3 getMorphedTangent(in vec3 tangent)"};Tc.process=function(e,t){let n=e.shaderBuilder;n.addDefine("HAS_MORPH_TARGETS",void 0,de.VERTEX),Llt(n);let i=t.morphTargets.length;for(let a=0;a<i;a++){let c=t.morphTargets[a].attributes,u=c.length;for(let f=0;f<u;f++){let d=c[f],p=d.semantic;p!==ct.POSITION&&p!==ct.NORMAL&&p!==ct.TANGENT||(Rlt(e,d,e.attributeIndex,a),e.attributeIndex++)}}Flt(n);let o=e.runtimeNode.morphWeights.length;n.addUniform("float",`u_morphWeights[${o}]`,de.VERTEX),n.addVertexLines(s4);let s={u_morphWeights:function(){return e.runtimeNode.morphWeights}};e.uniformMap=Mt(s,e.uniformMap)};var Dlt={attributeString:void 0,functionId:void 0};function Rlt(e,t,n,i){let r=e.shaderBuilder;Olt(e,t,n);let o=Mlt(t,Dlt);Nlt(r,o,i)}function Olt(e,t,n){let i={index:n,value:l(t.buffer)?void 0:t.constant,vertexBuffer:t.buffer,componentsPerAttribute:Vt.getNumberOfComponents(t.type),componentDatatype:t.componentDatatype,offsetInBytes:t.byteOffset,strideInBytes:t.byteStride,normalize:t.normalized};e.attributes.push(i)}function Mlt(e,t){switch(e.semantic){case ct.POSITION:t.attributeString="Position",t.functionId=Tc.FUNCTION_ID_GET_MORPHED_POSITION;break;case ct.NORMAL:t.attributeString="Normal",t.functionId=Tc.FUNCTION_ID_GET_MORPHED_NORMAL;break;case ct.TANGENT:t.attributeString="Tangent",t.functionId=Tc.FUNCTION_ID_GET_MORPHED_TANGENT;break;default:break}return t}function Nlt(e,t,n){let i=t.attributeString,r=`a_target${i}_${n}`,o=`morphed${i} += u_morphWeights[${n}] * a_target${i}_${n};`;e.addAttribute("vec3",r),e.addFunctionLines(t.functionId,[o])}function Llt(e){e.addFunction(Tc.FUNCTION_ID_GET_MORPHED_POSITION,Tc.FUNCTION_SIGNATURE_GET_MORPHED_POSITION,de.VERTEX),e.addFunctionLines(Tc.FUNCTION_ID_GET_MORPHED_POSITION,["vec3 morphedPosition = position;"]),e.addFunction(Tc.FUNCTION_ID_GET_MORPHED_NORMAL,Tc.FUNCTION_SIGNATURE_GET_MORPHED_NORMAL,de.VERTEX),e.addFunctionLines(Tc.FUNCTION_ID_GET_MORPHED_NORMAL,["vec3 morphedNormal = normal;"]),e.addFunction(Tc.FUNCTION_ID_GET_MORPHED_TANGENT,Tc.FUNCTION_SIGNATURE_GET_MORPHED_TANGENT,de.VERTEX),e.addFunctionLines(Tc.FUNCTION_ID_GET_MORPHED_TANGENT,["vec3 morphedTangent = tangent;"])}function Flt(e){e.addFunctionLines(Tc.FUNCTION_ID_GET_MORPHED_POSITION,["return morphedPosition;"]),e.addFunctionLines(Tc.FUNCTION_ID_GET_MORPHED_NORMAL,["return morphedNormal;"]),e.addFunctionLines(Tc.FUNCTION_ID_GET_MORPHED_TANGENT,["return morphedTangent;"])}var a4=Tc;var hxe={name:"PickingPipelineStage"};function YZ(e){return`vec4(rgba8UnormToUint32(${e}), isEdge ? 1.0 : 0.0, -v_positionEC.z, 0.0)`}hxe.process=function(e,t,n){let i=n.context,r=e.runtimeNode,o=e.shaderBuilder,s=e.model,a=r.node.instances;if(e.hasPropertyTable)Blt(e,t,a,i);else if(l(a))klt(e,i);else{let c=mxe(e),u=i.createPickId(c);s._pipelineResources.push(u),s._pickIds.push(u),o.addUniform("vec4","czm_pickColor",de.FRAGMENT);let f=e.uniformMap;f.czm_pickColor=function(){return u.color},e.pickId="czm_pickColor",e.snapId=YZ(e.pickId)}!l(s.classificationType)&&s.hasDrapedVectors()&&(e.pickId=`vectorPickColorOver(${e.pickId})`)};function mxe(e,t){let n=e.model;if(l(n.pickObject))return n.pickObject;let i={model:n,node:e.runtimeNode,primitive:e.runtimePrimitive},r;if(Qo.is3DTiles(n.type)){let o=n.content;r={content:o,primitive:o.tileset,detail:i}}else r={primitive:n,detail:i};return r.id=n.id,l(t)&&(r.instanceId=t),r}function Blt(e,t,n){let i=e.model,r,o,s=i.featureIdLabel,a=i.instanceFeatureIdLabel;l(i.featureTableId)?r=i.featureTableId:l(n)?(o=xt.getFeatureIdsByLabel(n.featureIds,a),r=o.propertyTableId):(o=xt.getFeatureIdsByLabel(t.featureIds,s),r=o.propertyTableId);let c=i.featureTables[r];e.shaderBuilder.addUniform("sampler2D","model_pickTexture",de.FRAGMENT);let f=c.batchTexture;e.uniformMap.model_pickTexture=function(){return f.pickTexture??f.defaultTexture},e.pickId="((selectedFeature.id < int(model_featuresLength)) ? texture(model_pickTexture, selectedFeature.st) : vec4(0.0))",e.snapId=YZ(e.pickId)}function klt(e,t){let n=e.instanceCount,i=new Array(n),r=new Uint8Array(n*4),o=e.model,s=o._pipelineResources;for(let d=0;d<n;d++){let p=mxe(e,d),g=t.createPickId(p);s.push(g),i[d]=g;let m=g.color;r[d*4+0]=z.floatToByte(m.red),r[d*4+1]=z.floatToByte(m.green),r[d*4+2]=z.floatToByte(m.blue),r[d*4+3]=z.floatToByte(m.alpha)}o._pickIds=i;let a=tt.createVertexBuffer({context:t,typedArray:r,usage:Me.STATIC_DRAW});a.vertexArrayDestroyable=!1,o.statistics.addBuffer(a,!1),s.push(a);let u={index:e.attributeIndex++,vertexBuffer:a,componentsPerAttribute:4,componentDatatype:Y.UNSIGNED_BYTE,normalize:!0,offsetInBytes:0,strideInBytes:0,instanceDivisor:1};e.attributes.push(u);let f=e.shaderBuilder;f.addDefine("USE_PICKING",void 0,de.BOTH),f.addAttribute("vec4","a_pickColor"),f.addVarying("vec4","v_pickColor"),e.pickId="v_pickColor",e.snapId=YZ(e.pickId)}var c4=hxe;var pxe={ADD:0,REPLACE:1};Object.freeze(pxe);var Io=pxe;var l4=`float getPointSizeFromAttenuation(vec3 positionEC) { float pointSize = model_pointCloudParameters.x; float geometricError = model_pointCloudParameters.y; float depthMultiplier = model_pointCloudParameters.z; @@ -9591,10 +9587,10 @@ return 1.0; #endif } #endif -`;var Jot=new se,J_e={name:"PointCloudStylingPipelineStage"};J_e.process=function(e,t,n){let i=e.shaderBuilder,r=e.model,o=r.style,s=r.structuralMetadata,a=l(s)?s.propertyAttributes:void 0,c=l(r.featureTableId)&&r.featureTables[r.featureTableId].featuresLength>0,u=!l(a)&&c;if(l(o)&&!u){let y=tst(a),A=nst(o,y);ist(i,A);let x=rst(A).indexOf("normalMC")>=0,T=xt.getAttributeBySemantic(t,ct.NORMAL);if(x&&!T)throw new oe("Style references the NORMAL semantic but the point cloud does not have normals");i.addDefine("COMPUTE_POSITION_WC_STYLE",void 0,de.VERTEX),A.styleTranslucent&&(e.alphaOptions.pass=Ie.TRANSLUCENT)}let f=r.pointCloudShading;f.attenuation&&i.addDefine("HAS_POINT_CLOUD_ATTENUATION",void 0,de.VERTEX),f.backFaceCulling&&i.addDefine("HAS_POINT_CLOUD_BACK_FACE_CULLING",void 0,de.VERTEX);let d,p,g;Jo.is3DTiles(r.type)&&(p=!0,d=r.content,g=d.tile.refine===So.ADD),i.addUniform("vec4","model_pointCloudParameters",de.VERTEX),i.addVertexLines(hV);let m=e.uniformMap;m.model_pointCloudParameters=function(){let y=Jot,A=1;p&&(A=g?5:d.tileset.memoryAdjustedScreenSpaceError),y.x=f.maximumAttenuation??A,y.x*=n.pixelRatio;let b=Zot(e,t,f,d);y.y=b*f.geometricErrorScale;let x=n.context,T=n.camera.frustum,E;return n.mode===re.SCENE2D||T instanceof _n?E=Number.POSITIVE_INFINITY:E=x.drawingBufferHeight/n.camera.frustum.sseDenominator,y.z=E,p&&(y.w=d.tileset.timeSinceLoad),y}};var $_e=new h;function Zot(e,t,n,i){if(l(i)){let f=i.tile.geometricError;if(f>0)return f}if(l(n.baseResolution))return n.baseResolution;let r=xt.getAttributeBySemantic(t,ct.POSITION),o=r.count,s=e.runtimeNode.transform,a=h.subtract(r.max,r.min,$_e);a=M.multiplyByPointAsVector(s,a,$_e);let c=a.x*a.y*a.z;return P.cbrt(c/o)}var Qot={colorStyleFunction:void 0,showStyleFunction:void 0,pointSizeStyleFunction:void 0,styleTranslucent:!1},est={POSITION:"attributes.positionMC",POSITION_ABSOLUTE:"v_positionWC",COLOR:"attributes.color_0",NORMAL:"attributes.normalMC"};function tst(e){let t=Ze(est);if(!l(e))return t;for(let n=0;n<e.length;n++){let r=e[n].properties;for(let o in r)r.hasOwnProperty(o)&&(t[o]=`metadata.${o}`)}return t}var tZ="ProcessedAttributes attributes, Metadata metadata, float tiles3d_tileset_time";function nst(e,t){let n=Qot,i={translucent:!1};return n.colorStyleFunction=e.getColorShaderFunction(`getColorFromStyle(${tZ})`,t,i),n.showStyleFunction=e.getShowShaderFunction(`getShowFromStyle(${tZ})`,t,i),n.pointSizeStyleFunction=e.getPointSizeShaderFunction(`getPointSizeFromStyle(${tZ})`,t,i),n.styleTranslucent=l(n.colorStyleFunction)&&i.translucent,n}function ist(e,t){let n=t.colorStyleFunction;l(n)&&(e.addDefine("HAS_POINT_CLOUD_COLOR_STYLE",void 0,de.BOTH),e.addVertexLines(n),e.addVarying("vec4","v_pointCloudColor"));let i=t.showStyleFunction;l(i)&&(e.addDefine("HAS_POINT_CLOUD_SHOW_STYLE",void 0,de.BOTH),e.addVertexLines(i),e.addVarying("float","v_pointCloudShow"));let r=t.pointSizeStyleFunction;l(r)&&(e.addDefine("HAS_POINT_CLOUD_POINT_SIZE_STYLE",void 0,de.VERTEX),e.addVertexLines(r))}function nZ(e,t){let n=/attributes\.(\w+)/g,i=n.exec(e);for(;i!==null;){let r=i[1];t.indexOf(r)===-1&&t.push(r),i=n.exec(e)}}function rst(e){let t=e.colorStyleFunction,n=e.showStyleFunction,i=e.pointSizeStyleFunction,r=[];return l(t)&&nZ(t,r),l(n)&&nZ(n,r),l(i)&&nZ(i,r),r}var mV=J_e;var pV=`void primitiveOutlineStage() { +`;var Ult=new se,_xe={name:"PointCloudStylingPipelineStage"};_xe.process=function(e,t,n){let i=e.shaderBuilder,r=e.model,o=r.style,s=r.structuralMetadata,a=l(s)?s.propertyAttributes:void 0,c=l(r.featureTableId)&&r.featureTables[r.featureTableId].featuresLength>0,u=!l(a)&&c;if(l(o)&&!u){let y=Hlt(a),A=Glt(o,y);Wlt(i,A);let x=qlt(A).indexOf("normalMC")>=0,T=xt.getAttributeBySemantic(t,ct.NORMAL);if(x&&!T)throw new oe("Style references the NORMAL semantic but the point cloud does not have normals");i.addDefine("COMPUTE_POSITION_WC_STYLE",void 0,de.VERTEX),A.styleTranslucent&&(e.alphaOptions.pass=Ie.TRANSLUCENT)}let f=r.pointCloudShading;f.attenuation&&i.addDefine("HAS_POINT_CLOUD_ATTENUATION",void 0,de.VERTEX),f.backFaceCulling&&i.addDefine("HAS_POINT_CLOUD_BACK_FACE_CULLING",void 0,de.VERTEX);let d,p,g;Qo.is3DTiles(r.type)&&(p=!0,d=r.content,g=d.tile.refine===Io.ADD),i.addUniform("vec4","model_pointCloudParameters",de.VERTEX),i.addVertexLines(l4);let m=e.uniformMap;m.model_pointCloudParameters=function(){let y=Ult,A=1;p&&(A=g?5:d.tileset.memoryAdjustedScreenSpaceError),y.x=f.maximumAttenuation??A,y.x*=n.pixelRatio;let b=zlt(e,t,f,d);y.y=b*f.geometricErrorScale;let x=n.context,T=n.camera.frustum,E;return n.mode===re.SCENE2D||T instanceof _n?E=Number.POSITIVE_INFINITY:E=x.drawingBufferHeight/n.camera.frustum.sseDenominator,y.z=E,p&&(y.w=d.tileset.timeSinceLoad),y}};var gxe=new h;function zlt(e,t,n,i){if(l(i)){let f=i.tile.geometricError;if(f>0)return f}if(l(n.baseResolution))return n.baseResolution;let r=xt.getAttributeBySemantic(t,ct.POSITION),o=r.count,s=e.runtimeNode.transform,a=h.subtract(r.max,r.min,gxe);a=M.multiplyByPointAsVector(s,a,gxe);let c=a.x*a.y*a.z;return P.cbrt(c/o)}var Vlt={colorStyleFunction:void 0,showStyleFunction:void 0,pointSizeStyleFunction:void 0,styleTranslucent:!1},jlt={POSITION:"attributes.positionMC",POSITION_ABSOLUTE:"v_positionWC",COLOR:"attributes.color_0",NORMAL:"attributes.normalMC"};function Hlt(e){let t=Ze(jlt);if(!l(e))return t;for(let n=0;n<e.length;n++){let r=e[n].properties;for(let o in r)r.hasOwnProperty(o)&&(t[o]=`metadata.${o}`)}return t}var XZ="ProcessedAttributes attributes, Metadata metadata, float tiles3d_tileset_time";function Glt(e,t){let n=Vlt,i={translucent:!1};return n.colorStyleFunction=e.getColorShaderFunction(`getColorFromStyle(${XZ})`,t,i),n.showStyleFunction=e.getShowShaderFunction(`getShowFromStyle(${XZ})`,t,i),n.pointSizeStyleFunction=e.getPointSizeShaderFunction(`getPointSizeFromStyle(${XZ})`,t,i),n.styleTranslucent=l(n.colorStyleFunction)&&i.translucent,n}function Wlt(e,t){let n=t.colorStyleFunction;l(n)&&(e.addDefine("HAS_POINT_CLOUD_COLOR_STYLE",void 0,de.BOTH),e.addVertexLines(n),e.addVarying("vec4","v_pointCloudColor"));let i=t.showStyleFunction;l(i)&&(e.addDefine("HAS_POINT_CLOUD_SHOW_STYLE",void 0,de.BOTH),e.addVertexLines(i),e.addVarying("float","v_pointCloudShow"));let r=t.pointSizeStyleFunction;l(r)&&(e.addDefine("HAS_POINT_CLOUD_POINT_SIZE_STYLE",void 0,de.VERTEX),e.addVertexLines(r))}function KZ(e,t){let n=/attributes\.(\w+)/g,i=n.exec(e);for(;i!==null;){let r=i[1];t.indexOf(r)===-1&&t.push(r),i=n.exec(e)}}function qlt(e){let t=e.colorStyleFunction,n=e.showStyleFunction,i=e.pointSizeStyleFunction,r=[];return l(t)&&KZ(t,r),l(n)&&KZ(n,r),l(i)&&KZ(i,r),r}var u4=_xe;var f4=`void primitiveOutlineStage() { v_outlineCoordinates = a_outlineCoordinates; } -`;var gV=`void primitiveOutlineStage(inout czm_modelMaterial material) { +`;var d4=`void primitiveOutlineStage(inout czm_modelMaterial material) { if (!model_showOutline) { return; } @@ -9607,7 +9603,7 @@ texture(model_outlineTexture, vec2(v_outlineCoordinates.z, 0.5)).r; float outlineness = max(outlineX, max(outlineY, outlineZ)); material.diffuse = mix(material.diffuse, model_outlineColor.rgb, model_outlineColor.a * outlineness); } -`;var Z_e={name:"PrimitiveOutlinePipelineStage"};Z_e.process=function(e,t,n){let i=e.shaderBuilder,r=e.uniformMap;i.addDefine("HAS_PRIMITIVE_OUTLINE",void 0,de.BOTH),i.addAttribute("vec3","a_outlineCoordinates"),i.addVarying("vec3","v_outlineCoordinates");let o=t.outlineCoordinates,s={index:e.attributeIndex++,vertexBuffer:o.buffer,componentsPerAttribute:Vt.getNumberOfComponents(o.type),componentDatatype:o.componentDatatype,offsetInBytes:o.byteOffset,strideInBytes:o.byteStride,normalize:o.normalized};e.attributes.push(s),i.addUniform("sampler2D","model_outlineTexture",de.FRAGMENT);let a=QC.createTexture(n.context);r.model_outlineTexture=function(){return a};let c=e.model;i.addUniform("vec4","model_outlineColor",de.FRAGMENT),r.model_outlineColor=function(){return c.outlineColor},i.addUniform("bool","model_showOutline",de.FRAGMENT),r.model_showOutline=function(){return c.showOutline},i.addVertexLines(pV),i.addFragmentLines(gV)};var _V=Z_e;var Q_e={name:"PrimitiveStatisticsPipelineStage",_countGeometry:eye,_count2DPositions:tye,_countMorphTargetAttributes:nye,_countMaterialTextures:iye,_countFeatureIdTextures:rye,_countBinaryMetadata:oye};Q_e.process=function(e,t,n){let i=e.model,r=i.statistics;eye(r,t),tye(r,e.runtimePrimitive),nye(r,t),iye(r,t.material),rye(r,t.featureIds),oye(r,i)};function eye(e,t){let n=l(t.indices)?t.indices.count:xt.getAttributeBySemantic(t,"POSITION").count,i=t.primitiveType;i===Oe.POINTS?e.pointsLength+=n:Oe.isTriangles(i)&&(e.trianglesLength+=ost(i,n));let r=t.attributes,o=r.length;for(let c=0;c<o;c++){let u=r[c];if(l(u.buffer)){let f=l(u.typedArray);e.addBuffer(u.buffer,f)}}let s=t.outlineCoordinates;l(s)&&l(s.buffer)&&e.addBuffer(s.buffer,!1);let a=t.indices;if(l(a)&&l(a.buffer)){let c=l(a.typedArray);e.addBuffer(a.buffer,c)}}function ost(e,t){switch(e){case Oe.TRIANGLES:return t/3;case Oe.TRIANGLE_STRIP:case Oe.TRIANGLE_FAN:return Math.max(t-2,0);default:return 0}}function tye(e,t){let n=t.positionBuffer2D;l(n)&&e.addBuffer(n,!0)}function nye(e,t){let n=t.morphTargets;if(!l(n))return;let i=!1,r=n.length;for(let o=0;o<r;o++){let s=n[o].attributes,a=s.length;for(let c=0;c<a;c++){let u=s[c];l(u.buffer)&&e.addBuffer(u.buffer,i)}}}function iye(e,t){let n=sst(t),i=n.length;for(let r=0;r<i;r++){let o=n[r];l(o)&&l(o.texture)&&e.addTexture(o.texture)}}function sst(e){let t=e.metallicRoughness,n=[e.emissiveTexture,e.normalTexture,e.occlusionTexture,t.baseColorTexture,t.metallicRoughnessTexture],i=e.specularGlossiness;return l(i)&&(n.push(i.diffuseTexture),n.push(i.specularGlossinessTexture)),n}function rye(e,t){let n=t.length;for(let i=0;i<n;i++){let r=t[i];if(r instanceof vn.FeatureIdTexture){let o=r.textureReader;l(o.texture)&&e.addTexture(o.texture)}}}function oye(e,t){let n=t.structuralMetadata;l(n)&&(ast(e,n),e.propertyTablesByteLength+=n.propertyTablesByteLength);let i=t.featureTables;if(!l(i))return;let r=i.length;for(let o=0;o<r;o++){let s=i[o];e.addBatchTexture(s.batchTexture)}}function ast(e,t){let n=t.propertyTextures;if(!l(n))return;let i=n.length;for(let r=0;r<i;r++){let s=n[r].properties;for(let a in s)if(s.hasOwnProperty(a)){let u=s[a].textureReader;l(u.texture)&&e.addTexture(u.texture)}}}var yV=Q_e;var cst=new M,lst=new M,sye={name:"SceneMode2DPipelineStage"};sye.process=function(e,t,n){let i=xt.getAttributeBySemantic(t,ct.POSITION),r=e.shaderBuilder,o=e.model,s=o.sceneGraph.computedModelMatrix,a=e.runtimeNode.computedTransform,c=M.multiplyTransformation(s,a,cst),u=dst(e,c,n),f=e.runtimePrimitive;f.boundingSphere2D=u;let d=e.runtimeNode.node.instances;if(l(d))return;if(l(i.typedArray)){let y=pst(i,c,u,n);f.positionBuffer2D=y,o._modelResources.push(y),i.typedArray=void 0}r.addDefine("USE_2D_POSITIONS",void 0,de.VERTEX),r.addUniform("mat4","u_modelView2D",de.VERTEX);let p=M.fromTranslation(u.center,new M),g=n.context,m={u_modelView2D:function(){return M.multiplyTransformation(g.uniformState.view,p,lst)}};e.uniformMap=Mt(m,e.uniformMap)};var ust=new h,fst=new h;function dst(e,t,n){let i=M.multiplyByPoint(t,e.positionMin,ust),r=pr.computeActualEllipsoidPosition(n,i,i),o=M.multiplyByPoint(t,e.positionMax,fst),s=pr.computeActualEllipsoidPosition(n,o,o);return ue.fromCornerPoints(r,s,new ue)}var aye=new h;function hst(e,t){let n=e.length,i=new Float32Array(n),r=t.quantizedVolumeOffset,o=t.quantizedVolumeStepSize;for(let s=0;s<n;s+=3){let a=h.fromArray(e,s,aye),c=h.multiplyComponents(a,o,a),u=h.add(c,r,c);i[s]=u.x,i[s+1]=u.y,i[s+2]=u.z}return i}function mst(e,t,n,i){let r;l(e.quantization)?r=hst(e.typedArray,e.quantization):r=e.typedArray.slice();let o=e.byteOffset/Float32Array.BYTES_PER_ELEMENT,s=r.length,a=l(e.byteStride)?e.byteStride/Float32Array.BYTES_PER_ELEMENT:3;for(let c=o;c<s;c+=a){let u=h.fromArray(r,c,aye);if(isNaN(u.x)||isNaN(u.y)||isNaN(u.z))continue;let f=M.multiplyByPoint(t,u,u),d=pr.computeActualEllipsoidPosition(i,f,f),p=h.subtract(d,n,d);r[c]=p.x,r[c+1]=p.y,r[c+2]=p.z}return r}function pst(e,t,n,i){let r=Ze(i);r.mode=re.COLUMBUS_VIEW;let o=n.center,s=mst(e,t,o,r),a=tt.createVertexBuffer({context:i.context,typedArray:s,usage:Me.STATIC_DRAW});return a.vertexArrayDestroyable=!1,a}var AV=sye;var bV=`void skinningStage(inout ProcessedAttributes attributes) +`;var yxe={name:"PrimitiveOutlinePipelineStage"};yxe.process=function(e,t,n){let i=e.shaderBuilder,r=e.uniformMap;i.addDefine("HAS_PRIMITIVE_OUTLINE",void 0,de.BOTH),i.addAttribute("vec3","a_outlineCoordinates"),i.addVarying("vec3","v_outlineCoordinates");let o=t.outlineCoordinates,s={index:e.attributeIndex++,vertexBuffer:o.buffer,componentsPerAttribute:Vt.getNumberOfComponents(o.type),componentDatatype:o.componentDatatype,offsetInBytes:o.byteOffset,strideInBytes:o.byteStride,normalize:o.normalized};e.attributes.push(s),i.addUniform("sampler2D","model_outlineTexture",de.FRAGMENT);let a=Mv.createTexture(n.context);r.model_outlineTexture=function(){return a};let c=e.model;i.addUniform("vec4","model_outlineColor",de.FRAGMENT),r.model_outlineColor=function(){return c.outlineColor},i.addUniform("bool","model_showOutline",de.FRAGMENT),r.model_showOutline=function(){return c.showOutline},i.addVertexLines(f4),i.addFragmentLines(d4)};var h4=yxe;var Axe={name:"PrimitiveStatisticsPipelineStage",_countGeometry:bxe,_count2DPositions:xxe,_countMorphTargetAttributes:Txe,_countMaterialTextures:Exe,_countFeatureIdTextures:Cxe,_countBinaryMetadata:vxe};Axe.process=function(e,t,n){let i=e.model,r=i.statistics;bxe(r,t),xxe(r,e.runtimePrimitive),Txe(r,t),Exe(r,t.material),Cxe(r,t.featureIds),vxe(r,i)};function bxe(e,t){let n=l(t.indices)?t.indices.count:xt.getAttributeBySemantic(t,"POSITION").count,i=t.primitiveType;i===Oe.POINTS?e.pointsLength+=n:Oe.isTriangles(i)&&(e.trianglesLength+=Ylt(i,n));let r=t.attributes,o=r.length;for(let c=0;c<o;c++){let u=r[c];if(l(u.buffer)){let f=l(u.typedArray);e.addBuffer(u.buffer,f)}}let s=t.outlineCoordinates;l(s)&&l(s.buffer)&&e.addBuffer(s.buffer,!1);let a=t.indices;if(l(a)&&l(a.buffer)){let c=l(a.typedArray);e.addBuffer(a.buffer,c)}}function Ylt(e,t){switch(e){case Oe.TRIANGLES:return t/3;case Oe.TRIANGLE_STRIP:case Oe.TRIANGLE_FAN:return Math.max(t-2,0);default:return 0}}function xxe(e,t){let n=t.positionBuffer2D;l(n)&&e.addBuffer(n,!0)}function Txe(e,t){let n=t.morphTargets;if(!l(n))return;let i=!1,r=n.length;for(let o=0;o<r;o++){let s=n[o].attributes,a=s.length;for(let c=0;c<a;c++){let u=s[c];l(u.buffer)&&e.addBuffer(u.buffer,i)}}}function Exe(e,t){let n=Xlt(t),i=n.length;for(let r=0;r<i;r++){let o=n[r];l(o)&&l(o.texture)&&e.addTexture(o.texture)}}function Xlt(e){let t=e.metallicRoughness,n=[e.emissiveTexture,e.normalTexture,e.occlusionTexture,t.baseColorTexture,t.metallicRoughnessTexture],i=e.specularGlossiness;return l(i)&&(n.push(i.diffuseTexture),n.push(i.specularGlossinessTexture)),n}function Cxe(e,t){let n=t.length;for(let i=0;i<n;i++){let r=t[i];if(r instanceof vn.FeatureIdTexture){let o=r.textureReader;l(o.texture)&&e.addTexture(o.texture)}}}function vxe(e,t){let n=t.structuralMetadata;l(n)&&(Klt(e,n),e.propertyTablesByteLength+=n.propertyTablesByteLength);let i=t.featureTables;if(!l(i))return;let r=i.length;for(let o=0;o<r;o++){let s=i[o];e.addBatchTexture(s.batchTexture)}}function Klt(e,t){let n=t.propertyTextures;if(!l(n))return;let i=n.length;for(let r=0;r<i;r++){let s=n[r].properties;for(let a in s)if(s.hasOwnProperty(a)){let u=s[a].textureReader;l(u.texture)&&e.addTexture(u.texture)}}}var m4=Axe;var $lt=new M,Jlt=new M,Sxe={name:"SceneMode2DPipelineStage"};Sxe.process=function(e,t,n){let i=xt.getAttributeBySemantic(t,ct.POSITION),r=e.shaderBuilder,o=e.model,s=o.sceneGraph.computedModelMatrix,a=e.runtimeNode.computedTransform,c=M.multiplyTransformation(s,a,$lt),u=eut(e,c,n),f=e.runtimePrimitive;f.boundingSphere2D=u;let d=e.runtimeNode.node.instances;if(l(d))return;if(l(i.typedArray)){let y=iut(i,c,u,n);f.positionBuffer2D=y,o._modelResources.push(y),i.typedArray=void 0}r.addDefine("USE_2D_POSITIONS",void 0,de.VERTEX),r.addUniform("mat4","u_modelView2D",de.VERTEX);let p=M.fromTranslation(u.center,new M),g=n.context,m={u_modelView2D:function(){return M.multiplyTransformation(g.uniformState.view,p,Jlt)}};e.uniformMap=Mt(m,e.uniformMap)};var Zlt=new h,Qlt=new h;function eut(e,t,n){let i=M.multiplyByPoint(t,e.positionMin,Zlt),r=pr.computeActualEllipsoidPosition(n,i,i),o=M.multiplyByPoint(t,e.positionMax,Qlt),s=pr.computeActualEllipsoidPosition(n,o,o);return ue.fromCornerPoints(r,s,new ue)}var wxe=new h;function tut(e,t){let n=e.length,i=new Float32Array(n),r=t.quantizedVolumeOffset,o=t.quantizedVolumeStepSize;for(let s=0;s<n;s+=3){let a=h.fromArray(e,s,wxe),c=h.multiplyComponents(a,o,a),u=h.add(c,r,c);i[s]=u.x,i[s+1]=u.y,i[s+2]=u.z}return i}function nut(e,t,n,i){let r;l(e.quantization)?r=tut(e.typedArray,e.quantization):r=e.typedArray.slice();let o=e.byteOffset/Float32Array.BYTES_PER_ELEMENT,s=r.length,a=l(e.byteStride)?e.byteStride/Float32Array.BYTES_PER_ELEMENT:3;for(let c=o;c<s;c+=a){let u=h.fromArray(r,c,wxe);if(isNaN(u.x)||isNaN(u.y)||isNaN(u.z))continue;let f=M.multiplyByPoint(t,u,u),d=pr.computeActualEllipsoidPosition(i,f,f),p=h.subtract(d,n,d);r[c]=p.x,r[c+1]=p.y,r[c+2]=p.z}return r}function iut(e,t,n,i){let r=Ze(i);r.mode=re.COLUMBUS_VIEW;let o=n.center,s=nut(e,t,o,r),a=tt.createVertexBuffer({context:i.context,typedArray:s,usage:Me.STATIC_DRAW});return a.vertexArrayDestroyable=!1,a}var p4=Sxe;var g4=`void skinningStage(inout ProcessedAttributes attributes) { mat4 skinningMatrix = getSkinningMatrix(); mat3 skinningMatrixMat3 = mat3(skinningMatrix); @@ -9622,7 +9618,7 @@ vec3 tangentMC = attributes.tangentMC; attributes.tangentMC = skinningMatrixMat3 * tangentMC; #endif } -`;var yx={name:"SkinningPipelineStage",FUNCTION_ID_GET_SKINNING_MATRIX:"getSkinningMatrix",FUNCTION_SIGNATURE_GET_SKINNING_MATRIX:"mat4 getSkinningMatrix()"};yx.process=function(e,t){let n=e.shaderBuilder;n.addDefine("HAS_SKINNING",void 0,de.VERTEX),_st(n,t);let i=e.runtimeNode,r=i.computedJointMatrices;n.addUniform("mat4",`u_jointMatrices[${r.length}]`,de.VERTEX),n.addVertexLines(bV);let o={u_jointMatrices:function(){return i.computedJointMatrices}};e.uniformMap=Mt(o,e.uniformMap)};function gst(e){let t=-1,n=e.attributes,i=n.length;for(let r=0;r<i;r++){let o=n[r];(o.semantic===ct.JOINTS||o.semantic===ct.WEIGHTS)&&(t=Math.max(t,o.setIndex))}return t}function _st(e,t){e.addFunction(yx.FUNCTION_ID_GET_SKINNING_MATRIX,yx.FUNCTION_SIGNATURE_GET_SKINNING_MATRIX,de.VERTEX),e.addFunctionLines(yx.FUNCTION_ID_GET_SKINNING_MATRIX,["mat4 skinnedMatrix = mat4(0);"]);let i,r,o=["x","y","z","w"],s=gst(t);for(i=0;i<=s;i++)for(r=0;r<=3;r++){let c=o[r],u=`skinnedMatrix += a_weights_${i}.${c} * u_jointMatrices[int(a_joints_${i}.${c})];`;e.addFunctionLines(yx.FUNCTION_ID_GET_SKINNING_MATRIX,[u])}e.addFunctionLines(yx.FUNCTION_ID_GET_SKINNING_MATRIX,["return skinnedMatrix;"])}var xV=yx;var TV=`void verticalExaggerationStage( +`;var Dx={name:"SkinningPipelineStage",FUNCTION_ID_GET_SKINNING_MATRIX:"getSkinningMatrix",FUNCTION_SIGNATURE_GET_SKINNING_MATRIX:"mat4 getSkinningMatrix()"};Dx.process=function(e,t){let n=e.shaderBuilder;n.addDefine("HAS_SKINNING",void 0,de.VERTEX),out(n,t);let i=e.runtimeNode,r=i.computedJointMatrices;n.addUniform("mat4",`u_jointMatrices[${r.length}]`,de.VERTEX),n.addVertexLines(g4);let o={u_jointMatrices:function(){return i.computedJointMatrices}};e.uniformMap=Mt(o,e.uniformMap)};function rut(e){let t=-1,n=e.attributes,i=n.length;for(let r=0;r<i;r++){let o=n[r];(o.semantic===ct.JOINTS||o.semantic===ct.WEIGHTS)&&(t=Math.max(t,o.setIndex))}return t}function out(e,t){e.addFunction(Dx.FUNCTION_ID_GET_SKINNING_MATRIX,Dx.FUNCTION_SIGNATURE_GET_SKINNING_MATRIX,de.VERTEX),e.addFunctionLines(Dx.FUNCTION_ID_GET_SKINNING_MATRIX,["mat4 skinnedMatrix = mat4(0);"]);let i,r,o=["x","y","z","w"],s=rut(t);for(i=0;i<=s;i++)for(r=0;r<=3;r++){let c=o[r],u=`skinnedMatrix += a_weights_${i}.${c} * u_jointMatrices[int(a_joints_${i}.${c})];`;e.addFunctionLines(Dx.FUNCTION_ID_GET_SKINNING_MATRIX,[u])}e.addFunctionLines(Dx.FUNCTION_ID_GET_SKINNING_MATRIX,["return skinnedMatrix;"])}var _4=Dx;var y4=`void verticalExaggerationStage( inout ProcessedAttributes attributes ) { vec4 vertexPositionENU = czm_modelToEnu * vec4(attributes.positionMC, 1.0); @@ -9647,12 +9643,12 @@ float shift = u_verticalExaggerationAndRelativeHeight.y; float exaggeration = (vertexHeight - shift) * (stretch - 1.0); attributes.positionMC += exaggeration * exaggerationDirectionScaledMC; } -`;var cye={name:"VerticalExaggerationPipelineStage"},yst=new U;cye.process=function(e,t,n){let{shaderBuilder:i,uniformMap:r}=e;i.addVertexLines(TV),i.addDefine("HAS_VERTICAL_EXAGGERATION",void 0,de.VERTEX),i.addUniform("vec2","u_verticalExaggerationAndRelativeHeight",de.VERTEX),r.u_verticalExaggerationAndRelativeHeight=function(){return U.fromElements(n.verticalExaggeration,n.verticalExaggerationRelativeHeight,yst)}};var EV=cye;var iZ={};function Ast(e){let t=je.createTypedArray(e,e*2),n=e,i=0;for(let r=0;r<n;r+=3)t[i++]=r,t[i++]=r+1,t[i++]=r+1,t[i++]=r+2,t[i++]=r+2,t[i++]=r;return t}function bst(e,t){let n=t.length,i=je.createTypedArray(e,n*2),r=0;for(let o=0;o<n;o+=3){let s=t[o],a=t[o+1],c=t[o+2];i[r++]=s,i[r++]=a,i[r++]=a,i[r++]=c,i[r++]=c,i[r++]=s}return i}function xst(e){let t=e-2,n=2+t*4,i=je.createTypedArray(e,n),r=0;i[r++]=0,i[r++]=1;for(let o=0;o<t;o++)i[r++]=o+1,i[r++]=o+2,i[r++]=o+2,i[r++]=o;return i}function Tst(e,t){let i=t.length-2,r=2+i*4,o=je.createTypedArray(e,r),s=0;o[s++]=t[0],o[s++]=t[1];for(let a=0;a<i;a++){let c=t[a],u=t[a+1],f=t[a+2];o[s++]=u,o[s++]=f,o[s++]=f,o[s++]=c}return o}function Est(e){let t=e-2,n=2+t*4,i=je.createTypedArray(e,n),r=0;i[r++]=0,i[r++]=1;for(let o=0;o<t;o++)i[r++]=o+1,i[r++]=o+2,i[r++]=o+2,i[r++]=0;return i}function Cst(e,t){let i=t.length-2,r=2+i*4,o=je.createTypedArray(e,r),s=0,a=t[0];o[s++]=a,o[s++]=t[1];for(let c=0;c<i;c++){let u=t[c+1],f=t[c+2];o[s++]=u,o[s++]=f,o[s++]=f,o[s++]=a}return o}iZ.createWireframeIndices=function(e,t,n){let i=l(n);if(e===Oe.TRIANGLES)return i?bst(t,n):Ast(t);if(e===Oe.TRIANGLE_STRIP)return i?Tst(t,n):xst(t);if(e===Oe.TRIANGLE_FAN)return i?Cst(t,n):Est(t)};iZ.getWireframeIndicesCount=function(e,t){return e===Oe.TRIANGLES?t*2:e===Oe.TRIANGLE_STRIP||e===Oe.TRIANGLE_FAN?2+(t-2)*4:t};var t1=iZ;var lye={name:"WireframePipelineStage"};lye.process=function(e,t,n){e.shaderBuilder.addDefine("HAS_WIREFRAME",void 0,de.FRAGMENT);let r=e.model,o=vst(t,e.indices,n);r._pipelineResources.push(o),e.wireframeIndexBuffer=o,r.statistics.addBuffer(o,!1);let a=e.primitiveType,c=e.count;e.primitiveType=Oe.LINES,e.count=t1.getWireframeIndicesCount(a,c)};function vst(e,t,n){let r=xt.getAttributeBySemantic(e,ct.POSITION).count,o=n.context.webgl2,s;if(l(t)){let f=t.buffer,d=t.count;l(f)&&o?(s=f.sizeInBytes===d?new Uint8Array(d):je.createTypedArray(r,d),f.getBufferData(s)):s=t.typedArray}let a=e.primitiveType,c=t1.createWireframeIndices(a,r,s),u=je.fromSizeInBytes(c.BYTES_PER_ELEMENT);return tt.createIndexBuffer({context:n.context,typedArray:c,usage:Me.STATIC_DRAW,indexDatatype:u})}var CV=lye;function uye(e){e=e??H.EMPTY_OBJECT;let t=e.primitive,n=e.node,i=e.model;this.primitive=t,this.node=n,this.model=i,this.pipelineStages=[],this.drawCommand=void 0,this.boundingSphere=void 0,this.boundingSphere2D=void 0,this.positionBuffer2D=void 0,this.batchLengths=void 0,this.batchOffsets=void 0,this.updateStages=[]}uye.prototype.configurePipeline=function(e){let t=this.pipelineStages;t.length=0;let n=this.primitive,i=this.node,r=this.model,o=r.customShader,s=r.style,a=e.context.webgl2,u=e.mode!==re.SCENE3D&&!e.scene3DOnly&&r._projectTo2D,f=e.verticalExaggeration!==1&&r.hasVerticalExaggeration,d=l(n.morphTargets)&&n.morphTargets.length>0,p=l(i.skin),g=l(r.imageryLayers)&&r.imageryLayers.length>0,m=l(o),A=!(m&&l(o.fragmentShaderText))||o.mode!==Iy.REPLACE_MATERIAL,b=xt.hasQuantizedAttributes(n.attributes),x=r.debugWireframe&&Oe.isTriangles(n.primitiveType)&&(r._enableDebugWireframe||a),T=r.pointCloudShading,E=l(T)&&T.attenuation,v=l(T)&&T.backFaceCulling,S=n.primitiveType===Oe.POINTS&&(l(s)||E||v),I=r._enableShowOutline&&l(n.outlineCoordinates),R=l(n.edgeVisibility),O=Sst(r,i,n),L=l(r.classificationType);u&&t.push(AV),t.push(Nz),x&&t.push(CV),L&&t.push(pz),d&&t.push(fV),p&&t.push(xV),S&&t.push(mV),b&&t.push(Sz),g&&(I?yt("outlines-and-draping","Primitive outlines disable imagery draping"):t.push(iV)),A&&t.push(lV),t.push(hx),t.push(Mh),t.push(xd),O.hasPropertyTable&&(t.push(px),t.push(mz),t.push(yz)),f&&t.push(EV),m&&t.push(vz),t.push(oV),r.allowPicking&&t.push(dV),I&&t.push(_V),R&&(e.edgeVisibilityRequested=!0,t.push(Rz),t.push(Iz)),t.push(hz),t.push(yV)};function Sst(e,t,n){let i;return l(t.instances)&&(i=xt.getFeatureIdsByLabel(t.instances.featureIds,e.instanceFeatureIdLabel),l(i))?{hasFeatureIds:!0,hasPropertyTable:l(i.propertyTableId)}:(i=xt.getFeatureIdsByLabel(n.featureIds,e.featureIdLabel),l(i)?{hasFeatureIds:!0,hasPropertyTable:l(i.propertyTableId)}:{hasFeatureIds:!1,hasPropertyTable:!1})}var vV=uye;function rZ(e){e=e??H.EMPTY_OBJECT,this._sceneGraph=e.sceneGraph;let t=e.skin;this._skin=t,this._inverseBindMatrices=void 0,this._joints=[],this._jointMatrices=[],wst(this)}Object.defineProperties(rZ.prototype,{skin:{get:function(){return this._skin}},sceneGraph:{get:function(){return this._sceneGraph}},inverseBindMatrices:{get:function(){return this._inverseBindMatrices}},joints:{get:function(){return this._joints}},jointMatrices:{get:function(){return this._jointMatrices}}});function wst(e){let t=e.skin,n=t.inverseBindMatrices;e._inverseBindMatrices=n;let i=t.joints,r=i.length,o=e.sceneGraph._runtimeNodes,s=e.joints,a=e._jointMatrices;for(let c=0;c<r;c++){let u=i[c].index,f=o[u];s.push(f);let d=n[c],p=fye(f,d,new M);a.push(p)}}function fye(e,t,n){let i=M.multiplyTransformation(e.transformToRoot,e.transform,n);return n=M.multiplyTransformation(i,t,n),n}rZ.prototype.updateJointMatrices=function(){let e=this._jointMatrices,t=e.length;for(let n=0;n<t;n++){let i=this.joints[n],r=this.inverseBindMatrices[n];e[n]=fye(i,r,e[n])}};var SV=rZ;function Ist(){this.pass=void 0,this.alphaCutoff=void 0}var wv=Ist;function Pst(e){this.shaderBuilder=new F_,this.model=e,this.uniformMap={},this.alphaOptions=new wv,this.renderStateOptions=Ge.getState(Ge.fromCache({depthTest:{enabled:!0,func:yc.LESS_OR_EQUAL}})),this.hasSilhouette=!1,this.hasSkipLevelOfDetail=!1,this.nodeRenderResources=[]}var wV=Pst;var IV=`void silhouetteStage(inout vec4 color) { +`;var Ixe={name:"VerticalExaggerationPipelineStage"},sut=new U;Ixe.process=function(e,t,n){let{shaderBuilder:i,uniformMap:r}=e;i.addVertexLines(y4),i.addDefine("HAS_VERTICAL_EXAGGERATION",void 0,de.VERTEX),i.addUniform("vec2","u_verticalExaggerationAndRelativeHeight",de.VERTEX),r.u_verticalExaggerationAndRelativeHeight=function(){return U.fromElements(n.verticalExaggeration,n.verticalExaggerationRelativeHeight,sut)}};var A4=Ixe;var $Z={};function aut(e){let t=je.createTypedArray(e,e*2),n=e,i=0;for(let r=0;r<n;r+=3)t[i++]=r,t[i++]=r+1,t[i++]=r+1,t[i++]=r+2,t[i++]=r+2,t[i++]=r;return t}function cut(e,t){let n=t.length,i=je.createTypedArray(e,n*2),r=0;for(let o=0;o<n;o+=3){let s=t[o],a=t[o+1],c=t[o+2];i[r++]=s,i[r++]=a,i[r++]=a,i[r++]=c,i[r++]=c,i[r++]=s}return i}function lut(e){let t=e-2,n=2+t*4,i=je.createTypedArray(e,n),r=0;i[r++]=0,i[r++]=1;for(let o=0;o<t;o++)i[r++]=o+1,i[r++]=o+2,i[r++]=o+2,i[r++]=o;return i}function uut(e,t){let i=t.length-2,r=2+i*4,o=je.createTypedArray(e,r),s=0;o[s++]=t[0],o[s++]=t[1];for(let a=0;a<i;a++){let c=t[a],u=t[a+1],f=t[a+2];o[s++]=u,o[s++]=f,o[s++]=f,o[s++]=c}return o}function fut(e){let t=e-2,n=2+t*4,i=je.createTypedArray(e,n),r=0;i[r++]=0,i[r++]=1;for(let o=0;o<t;o++)i[r++]=o+1,i[r++]=o+2,i[r++]=o+2,i[r++]=0;return i}function dut(e,t){let i=t.length-2,r=2+i*4,o=je.createTypedArray(e,r),s=0,a=t[0];o[s++]=a,o[s++]=t[1];for(let c=0;c<i;c++){let u=t[c+1],f=t[c+2];o[s++]=u,o[s++]=f,o[s++]=f,o[s++]=a}return o}$Z.createWireframeIndices=function(e,t,n){let i=l(n);if(e===Oe.TRIANGLES)return i?cut(t,n):aut(t);if(e===Oe.TRIANGLE_STRIP)return i?uut(t,n):lut(t);if(e===Oe.TRIANGLE_FAN)return i?dut(t,n):fut(t)};$Z.getWireframeIndicesCount=function(e,t){return e===Oe.TRIANGLES?t*2:e===Oe.TRIANGLE_STRIP||e===Oe.TRIANGLE_FAN?2+(t-2)*4:t};var v1=$Z;var Pxe={name:"WireframePipelineStage"};Pxe.process=function(e,t,n){e.shaderBuilder.addDefine("HAS_WIREFRAME",void 0,de.FRAGMENT);let r=e.model,o=hut(t,e.indices,n);r._pipelineResources.push(o),e.wireframeIndexBuffer=o,r.statistics.addBuffer(o,!1);let a=e.primitiveType,c=e.count;e.primitiveType=Oe.LINES,e.count=v1.getWireframeIndicesCount(a,c)};function hut(e,t,n){let r=xt.getAttributeBySemantic(e,ct.POSITION).count,o=n.context.webgl2,s;if(l(t)){let f=t.buffer,d=t.count;l(f)&&o?(s=f.sizeInBytes===d?new Uint8Array(d):je.createTypedArray(r,d),f.getBufferData(s)):s=t.typedArray}let a=e.primitiveType,c=v1.createWireframeIndices(a,r,s),u=je.fromSizeInBytes(c.BYTES_PER_ELEMENT);return tt.createIndexBuffer({context:n.context,typedArray:c,usage:Me.STATIC_DRAW,indexDatatype:u})}var b4=Pxe;function Dxe(e){e=e??H.EMPTY_OBJECT;let t=e.primitive,n=e.node,i=e.model;this.primitive=t,this.node=n,this.model=i,this.pipelineStages=[],this.drawCommand=void 0,this.boundingSphere=void 0,this.boundingSphere2D=void 0,this.positionBuffer2D=void 0,this.batchLengths=void 0,this.batchOffsets=void 0,this.updateStages=[]}Dxe.prototype.configurePipeline=function(e){let t=this.pipelineStages;t.length=0;let n=this.primitive,i=this.node,r=this.model,o=r.customShader,s=r.style,a=e.context.webgl2,u=e.mode!==re.SCENE3D&&!e.scene3DOnly&&r._projectTo2D,f=e.verticalExaggeration!==1&&r.hasVerticalExaggeration,d=l(n.morphTargets)&&n.morphTargets.length>0,p=l(i.skin),g=l(r.imageryLayers)&&r.imageryLayers.length>0,m=l(o),A=!(m&&l(o.fragmentShaderText))||o.mode!==Py.REPLACE_MATERIAL,b=xt.hasQuantizedAttributes(n.attributes),x=r.debugWireframe&&Oe.isTriangles(n.primitiveType)&&(r._enableDebugWireframe||a),T=r.pointCloudShading,E=l(T)&&T.attenuation,v=l(T)&&T.backFaceCulling,S=n.primitiveType===Oe.POINTS&&(l(s)||E||v),I=r._enableShowOutline&&l(n.outlineCoordinates),R=l(n.edgeVisibility),O=mut(r,i,n),L=l(r.classificationType);u&&t.push(p4),t.push(PV),x&&t.push(b4),L&&t.push(uV),d&&t.push(a4),p&&t.push(_4),S&&t.push(u4),b&&t.push(xV),g&&(I?yt("outlines-and-draping","Primitive outlines disable imagery draping"):t.push(QV)),A&&t.push(o4),t.push(vx),t.push(Gh),t.push(Rd),O.hasPropertyTable&&(t.push(wx),t.push(lV),t.push(hV)),f&&t.push(A4),m&&t.push(bV),t.push(t4),r.allowPicking&&t.push(c4),I&&t.push(h4),R&&(e.edgeVisibilityRequested=!0,t.push(SV),t.push(EV)),t.push(cV),t.push(m4)};function mut(e,t,n){let i;return l(t.instances)&&(i=xt.getFeatureIdsByLabel(t.instances.featureIds,e.instanceFeatureIdLabel),l(i))?{hasFeatureIds:!0,hasPropertyTable:l(i.propertyTableId)}:(i=xt.getFeatureIdsByLabel(n.featureIds,e.featureIdLabel),l(i)?{hasFeatureIds:!0,hasPropertyTable:l(i.propertyTableId)}:{hasFeatureIds:!1,hasPropertyTable:!1})}var x4=Dxe;function JZ(e){e=e??H.EMPTY_OBJECT,this._sceneGraph=e.sceneGraph;let t=e.skin;this._skin=t,this._inverseBindMatrices=void 0,this._joints=[],this._jointMatrices=[],put(this)}Object.defineProperties(JZ.prototype,{skin:{get:function(){return this._skin}},sceneGraph:{get:function(){return this._sceneGraph}},inverseBindMatrices:{get:function(){return this._inverseBindMatrices}},joints:{get:function(){return this._joints}},jointMatrices:{get:function(){return this._jointMatrices}}});function put(e){let t=e.skin,n=t.inverseBindMatrices;e._inverseBindMatrices=n;let i=t.joints,r=i.length,o=e.sceneGraph._runtimeNodes,s=e.joints,a=e._jointMatrices;for(let c=0;c<r;c++){let u=i[c].index,f=o[u];s.push(f);let d=n[c],p=Rxe(f,d,new M);a.push(p)}}function Rxe(e,t,n){let i=M.multiplyTransformation(e.transformToRoot,e.transform,n);return n=M.multiplyTransformation(i,t,n),n}JZ.prototype.updateJointMatrices=function(){let e=this._jointMatrices,t=e.length;for(let n=0;n<t;n++){let i=this.joints[n],r=this.inverseBindMatrices[n];e[n]=Rxe(i,r,e[n])}};var T4=JZ;function gut(){this.pass=void 0,this.alphaCutoff=void 0}var lS=gut;function _ut(e){this.shaderBuilder=new F_,this.model=e,this.uniformMap={},this.alphaOptions=new lS,this.renderStateOptions=Ge.getState(Ge.fromCache({depthTest:{enabled:!0,func:Ac.LESS_OR_EQUAL}})),this.hasSilhouette=!1,this.hasSkipLevelOfDetail=!1,this.nodeRenderResources=[]}var E4=_ut;var C4=`void silhouetteStage(inout vec4 color) { if(model_silhouettePass) { color = czm_gammaCorrect(model_silhouetteColor); } } -`;var PV=`void silhouetteStage(in ProcessedAttributes attributes, inout vec4 positionClip) { +`;var v4=`void silhouetteStage(in ProcessedAttributes attributes, inout vec4 positionClip) { #ifdef HAS_NORMALS if(model_silhouettePass) { vec3 normal = normalize(czm_normal3D * attributes.normalMC); @@ -9662,14 +9658,14 @@ positionClip.xy += normal.xy * positionClip.w * model_silhouetteSize * czm_pixel } #endif } -`;var DV={name:"ModelSilhouettePipelineStage"};DV.silhouettesLength=0;DV.process=function(e,t,n){l(t._silhouetteId)||(t._silhouetteId=++DV.silhouettesLength);let i=e.shaderBuilder;i.addDefine("HAS_SILHOUETTE",void 0,de.BOTH),i.addVertexLines(PV),i.addFragmentLines(IV),i.addUniform("vec4","model_silhouetteColor",de.FRAGMENT),i.addUniform("float","model_silhouetteSize",de.VERTEX),i.addUniform("bool","model_silhouettePass",de.BOTH);let r={model_silhouetteColor:function(){return t.silhouetteColor},model_silhouetteSize:function(){return t.silhouetteSize},model_silhouettePass:function(){return!1}};e.uniformMap=Mt(r,e.uniformMap),e.hasSilhouette=!0};var RV=DV;var OV=`void modelSplitterStage() +`;var S4={name:"ModelSilhouettePipelineStage"};S4.silhouettesLength=0;S4.process=function(e,t,n){l(t._silhouetteId)||(t._silhouetteId=++S4.silhouettesLength);let i=e.shaderBuilder;i.addDefine("HAS_SILHOUETTE",void 0,de.BOTH),i.addVertexLines(v4),i.addFragmentLines(C4),i.addUniform("vec4","model_silhouetteColor",de.FRAGMENT),i.addUniform("float","model_silhouetteSize",de.VERTEX),i.addUniform("bool","model_silhouettePass",de.BOTH);let r={model_silhouetteColor:function(){return t.silhouetteColor},model_silhouetteSize:function(){return t.silhouetteSize},model_silhouettePass:function(){return!1}};e.uniformMap=Mt(r,e.uniformMap),e.hasSilhouette=!0};var w4=S4;var I4=`void modelSplitterStage() { #ifndef SHADOW_MAP if (model_splitDirection < 0.0 && gl_FragCoord.x > czm_splitPosition) discard; if (model_splitDirection > 0.0 && gl_FragCoord.x < czm_splitPosition) discard; #endif } -`;var MV={name:"ModelSplitterPipelineStage",SPLIT_DIRECTION_UNIFORM_NAME:"model_splitDirection"};MV.process=function(e,t,n){let i=e.shaderBuilder;i.addDefine("HAS_MODEL_SPLITTER",void 0,de.FRAGMENT),i.addFragmentLines(OV);let r={};i.addUniform("float",MV.SPLIT_DIRECTION_UNIFORM_NAME,de.FRAGMENT),r[MV.SPLIT_DIRECTION_UNIFORM_NAME]=function(){return t.splitDirection},e.uniformMap=Mt(r,e.uniformMap)};var NV=MV;function Dst(e,t){this.model=e.model,this.shaderBuilder=e.shaderBuilder.clone(),this.uniformMap=Ze(e.uniformMap),this.alphaOptions=Ze(e.alphaOptions),this.renderStateOptions=Ze(e.renderStateOptions,!0),this.hasSilhouette=e.hasSilhouette,this.hasSkipLevelOfDetail=e.hasSkipLevelOfDetail,this.runtimeNode=t,this.attributes=[],this.attributeIndex=1,this.featureIdVertexAttributeSetIndex=0,this.instanceCount=0,this.primitiveRenderResources=[]}var LV=Dst;function Rst(e){e=e??H.EMPTY_OBJECT,this.lightingModel=e.lightingModel??ug.UNLIT}var FV=Rst;function Ost(e,t){this.model=e.model,this.runtimeNode=e.runtimeNode,this.attributes=e.attributes.slice(),this.attributeIndex=e.attributeIndex,this.featureIdVertexAttributeSetIndex=e.featureIdVertexAttributeSetIndex,this.uniformMap=Ze(e.uniformMap),this.alphaOptions=Ze(e.alphaOptions),this.renderStateOptions=Ze(e.renderStateOptions,!0),this.hasSilhouette=e.hasSilhouette,this.hasSkipLevelOfDetail=e.hasSkipLevelOfDetail,this.planarFillIdPass=!1,this.shaderBuilder=e.shaderBuilder.clone(),this.instanceCount=e.instanceCount,this.runtimePrimitive=t;let n=t.primitive;this.count=l(n.indices)?n.indices.count:xt.getAttributeBySemantic(n,"POSITION").count,this.hasPropertyTable=!1,this.indices=n.indices,this.wireframeIndexBuffer=void 0,this.primitiveType=n.primitiveType;let i=xt.getPositionMinMax(n,this.runtimeNode.instancingTranslationMin,this.runtimeNode.instancingTranslationMax);this.positionMin=h.clone(i.min,new h),this.positionMax=h.clone(i.max,new h),this.boundingSphere=ue.fromCornerPoints(this.positionMin,this.positionMax,new ue),this.lightingOptions=new FV,this.pickId=void 0,this.snapId=void 0}var BV=Ost;function sZ(e){e=e??H.EMPTY_OBJECT;let t=e.command,n=e.primitiveRenderResources,i=n.model;this._command=t,this._model=i,this._runtimePrimitive=n.runtimePrimitive,this._modelMatrix=t.modelMatrix,this._boundingVolume=t.boundingVolume,this._cullFace=t.renderState.cull.face;let r=i.classificationType;this._classificationType=r,this._classifiesTerrain=r!==ei.CESIUM_3D_TILE,this._classifies3DTiles=r!==ei.TERRAIN,this._useDebugWireframe=i._enableDebugWireframe&&i.debugWireframe,this._pickId=n.pickId,this._commandListTerrain=[],this._commandList3DTiles=[],this._commandListIgnoreShow=[],this._commandListDebugWireframe=[],this._commandListTerrainPicking=[],this._commandList3DTilesPicking=[],Fst(this)}function Mst(e){return{colorMask:{red:!1,green:!1,blue:!1,alpha:!1},stencilTest:{enabled:!0,frontFunction:e,frontOperation:{fail:Rt.KEEP,zFail:Rt.DECREMENT_WRAP,zPass:Rt.KEEP},backFunction:e,backOperation:{fail:Rt.KEEP,zFail:Rt.INCREMENT_WRAP,zPass:Rt.KEEP},reference:Xt.CESIUM_3D_TILE_MASK,mask:Xt.CESIUM_3D_TILE_MASK},stencilMask:Xt.CLASSIFICATION_MASK,depthTest:{enabled:!0,func:yc.LESS_OR_EQUAL},depthMask:!1}}var Nst={stencilTest:{enabled:!0,frontFunction:ti.NOT_EQUAL,frontOperation:{fail:Rt.ZERO,zFail:Rt.ZERO,zPass:Rt.ZERO},backFunction:ti.NOT_EQUAL,backOperation:{fail:Rt.ZERO,zFail:Rt.ZERO,zPass:Rt.ZERO},reference:0,mask:Xt.CLASSIFICATION_MASK},stencilMask:Xt.CLASSIFICATION_MASK,depthTest:{enabled:!1},depthMask:!1,blending:nn.PRE_MULTIPLIED_ALPHA_BLEND},Lst={stencilTest:{enabled:!0,frontFunction:ti.NOT_EQUAL,frontOperation:{fail:Rt.ZERO,zFail:Rt.ZERO,zPass:Rt.ZERO},backFunction:ti.NOT_EQUAL,backOperation:{fail:Rt.ZERO,zFail:Rt.ZERO,zPass:Rt.ZERO},reference:0,mask:Xt.CLASSIFICATION_MASK},stencilMask:Xt.CLASSIFICATION_MASK,depthTest:{enabled:!1},depthMask:!1},mye=[];function Fst(e){let t=e._command,n=mye;if(e._useDebugWireframe){t.pass=Ie.OPAQUE,n.length=0,n.push(t),e._commandListDebugWireframe=n1(e,n,e._commandListDebugWireframe);let o=e._commandListDebugWireframe,s=o.length;for(let a=0;a<s;a++){let c=o[a];c.count*=2,c.offset*=2}return}let r=e.model.allowPicking;if(e._classifiesTerrain){let o=Ie.TERRAIN_CLASSIFICATION,s=oZ(t,o),a=dye(t,o);n.length=0,n.push(s,a),e._commandListTerrain=n1(e,n,e._commandListTerrain),r&&(e._commandListTerrainPicking=hye(e,n,e._commandListTerrainPicking))}if(e._classifies3DTiles){let o=Ie.CESIUM_3D_TILE_CLASSIFICATION,s=oZ(t,o),a=dye(t,o);n.length=0,n.push(s,a),e._commandList3DTiles=n1(e,n,e._commandList3DTiles),r&&(e._commandList3DTilesPicking=hye(e,n,e._commandList3DTilesPicking))}}function n1(e,t,n){let i=e._runtimePrimitive,r=i.batchLengths,o=i.batchOffsets,s=r.length,a=t.length;for(let c=0;c<s;c++){let u=r[c],f=o[c];for(let d=0;d<a;d++){let p=t[d],g=at.shallowClone(p);g.count=u,g.offset=f,n.push(g)}}return n}function oZ(e,t){let n=at.shallowClone(e);n.cull=!1,n.pass=t;let i=t===Ie.TERRAIN_CLASSIFICATION?ti.ALWAYS:ti.EQUAL,r=Mst(i);return n.renderState=Ge.fromCache(r),n}function dye(e,t){let n=at.shallowClone(e);return n.cull=!1,n.pass=t,n.renderState=Ge.fromCache(Nst),n}var Bst=[];function hye(e,t,n){let i=Ge.fromCache(Lst),r=t[0],o=t[1],s=at.shallowClone(r);s.cull=!0,s.pickOnly=!0;let a=at.shallowClone(o);a.cull=!0,a.pickOnly=!0,a.renderState=i,a.pickId=e._pickId;let c=Bst;return c.length=0,c.push(s,a),n1(e,c,n)}Object.defineProperties(sZ.prototype,{command:{get:function(){return this._command}},runtimePrimitive:{get:function(){return this._runtimePrimitive}},batchLengths:{get:function(){return this._runtimePrimitive.batchLengths}},batchOffsets:{get:function(){return this._runtimePrimitive.batchOffsets}},model:{get:function(){return this._model}},classificationType:{get:function(){return this._classificationType}},modelMatrix:{get:function(){return this._modelMatrix},set:function(e){this._modelMatrix=M.clone(e,this._modelMatrix);let t=this._runtimePrimitive.boundingSphere;this._boundingVolume=ue.transform(t,this._modelMatrix,this._boundingVolume)}},boundingVolume:{get:function(){return this._boundingVolume}},cullFace:{get:function(){return this._cullFace},set:function(e){this._cullFace=e}}});sZ.prototype.pushCommands=function(e,t){let n=e.passes;if(n.render){if(this._useDebugWireframe){Zn(t,this._commandListDebugWireframe);return}if(this._classifiesTerrain&&Zn(t,this._commandListTerrain),this._classifies3DTiles&&Zn(t,this._commandList3DTiles),e.invertClassification&&this._classifies3DTiles){if(this._commandListIgnoreShow.length===0){let r=Ie.CESIUM_3D_TILE_CLASSIFICATION_IGNORE_SHOW,o=oZ(this._command,r),s=mye;s.length=0,s.push(o),this._commandListIgnoreShow=n1(this,s,this._commandListIgnoreShow)}Zn(t,this._commandListIgnoreShow)}}return n.pick&&(this._classifiesTerrain&&Zn(t,this._commandListTerrainPicking),this._classifies3DTiles&&Zn(t,this._commandList3DTilesPicking)),t};var kV=sZ;function Iv(e){e=e??H.EMPTY_OBJECT;let t=e.command,n=e.primitiveRenderResources,i=n.model;this._model=i;let r=n.runtimePrimitive;this._runtimePrimitive=r,this._primitiveRenderResources=n;let o=t.pass===Ie.TRANSLUCENT,a=!r.primitive.material.doubleSided&&!o,c=n.hasSilhouette,u=!o&&!c,f=n.hasSkipLevelOfDetail&&!o,d=c,p=l(n.edgeGeometry);this._command=t,this._modelMatrix=M.clone(t.modelMatrix),this._boundingVolume=ue.clone(t.boundingVolume),this._modelMatrix2D=new M,this._boundingVolume2D=new ue,this._modelMatrix2DDirty=!1,this._backFaceCulling=t.renderState.cull.enabled,this._cullFace=t.renderState.cull.face,this._shadows=i.shadows,this._debugShowBoundingVolume=t.debugShowBoundingVolume,this._usesBackFaceCulling=a,this._needsTranslucentCommand=u,this._needsSkipLevelOfDetailCommands=f,this._needsSilhouetteCommands=d,this._needsEdgeCommands=p,this._needsPlanarFillIdCommand=n.planarFillIdPass,this._originalCommand=void 0,this._translucentCommand=void 0,this._skipLodBackfaceCommand=void 0,this._skipLodStencilCommand=void 0,this._silhouetteModelCommand=void 0,this._silhouetteColorCommand=void 0,this._edgeCommand=void 0,this._edgeSnapCommand=void 0,this._planarFillIdCommand=void 0,this._derivedCommands=[],this._has2DCommands=!1,kst(this)}function Td(e){this.command=e.command,this.updateShadows=e.updateShadows,this.updateBackFaceCulling=e.updateBackFaceCulling,this.updateCullFace=e.updateCullFace,this.updateDebugShowBoundingVolume=e.updateDebugShowBoundingVolume,this.is2D=e.is2D??!1,this.derivedCommand2D=void 0}Td.clone=function(e){return new Td({command:e.command,updateShadows:e.updateShadows,updateBackFaceCulling:e.updateBackFaceCulling,updateCullFace:e.updateCullFace,updateDebugShowBoundingVolume:e.updateDebugShowBoundingVolume,is2D:e.is2D,derivedCommand2D:e.derivedCommand2D})};function kst(e){let t=e._command;t.modelMatrix=e._modelMatrix,t.boundingVolume=e._boundingVolume;let n=e._model,i=e._usesBackFaceCulling,r=e._derivedCommands;if(e._originalCommand=new Td({command:t,updateShadows:!0,updateBackFaceCulling:i,updateCullFace:i,updateDebugShowBoundingVolume:!0,is2D:!1}),r.push(e._originalCommand),e._needsTranslucentCommand&&(e._translucentCommand=new Td({command:Wst(t),updateShadows:!0,updateBackFaceCulling:!1,updateCullFace:!1,updateDebugShowBoundingVolume:!0}),r.push(e._translucentCommand)),e._needsSkipLevelOfDetailCommands&&(e._skipLodBackfaceCommand=new Td({command:Zst(t),updateShadows:!1,updateBackFaceCulling:!1,updateCullFace:i,updateDebugShowBoundingVolume:!1}),e._skipLodStencilCommand=new Td({command:Qst(t,n),updateShadows:!0,updateBackFaceCulling:i,updateCullFace:i,updateDebugShowBoundingVolume:!0}),r.push(e._skipLodBackfaceCommand),r.push(e._skipLodStencilCommand)),e._needsSilhouetteCommands&&(e._silhouetteModelCommand=new Td({command:qst(t,n),updateShadows:!0,updateBackFaceCulling:i,updateCullFace:i,updateDebugShowBoundingVolume:!0}),e._silhouetteColorCommand=new Td({command:Yst(t,n),updateShadows:!1,updateBackFaceCulling:!1,updateCullFace:!1,updateDebugShowBoundingVolume:!1}),r.push(e._silhouetteModelCommand),r.push(e._silhouetteColorCommand)),e._needsEdgeCommands){let o=e._primitiveRenderResources,s=o.edgeGeometry,a=l(s.lineWidth)?s.lineWidth:1,c=1;e._edgeCommand=new Td({command:pye(t,o,a),updateShadows:!1,updateBackFaceCulling:!1,updateCullFace:!1,updateDebugShowBoundingVolume:!1}),e._edgeSnapCommand=new Td({command:pye(t,o,c),updateShadows:!1,updateBackFaceCulling:!1,updateCullFace:!1,updateDebugShowBoundingVolume:!1}),r.push(e._edgeCommand),r.push(e._edgeSnapCommand)}e._needsPlanarFillIdCommand&&(e._planarFillIdCommand=new Td({command:Xst(t),updateShadows:!1,updateBackFaceCulling:!1,updateCullFace:!1,updateDebugShowBoundingVolume:!1}),r.push(e._planarFillIdCommand)),e._primitiveRenderResources=void 0}Object.defineProperties(Iv.prototype,{command:{get:function(){return this._command}},runtimePrimitive:{get:function(){return this._runtimePrimitive}},model:{get:function(){return this._model}},primitiveType:{get:function(){return this._command.primitiveType}},modelMatrix:{get:function(){return this._modelMatrix},set:function(e){this._modelMatrix=M.clone(e,this._modelMatrix),this._modelMatrix2DDirty=!0,this._boundingVolume=ue.transform(this.runtimePrimitive.boundingSphere,this._modelMatrix,this._boundingVolume)}},boundingVolume:{get:function(){return this._boundingVolume}},shadows:{get:function(){return this._shadows},set:function(e){this._shadows=e,zst(this)}},backFaceCulling:{get:function(){return this._backFaceCulling},set:function(e){this._backFaceCulling!==e&&(this._backFaceCulling=e,Vst(this))}},cullFace:{get:function(){return this._cullFace},set:function(e){this._cullFace!==e&&(this._cullFace=e,jst(this))}},debugShowBoundingVolume:{get:function(){return this._debugShowBoundingVolume},set:function(e){this._debugShowBoundingVolume!==e&&(this._debugShowBoundingVolume=e,Hst(this))}}});function Ust(e,t){let n=e._modelMatrix;e._modelMatrix2D=M.clone(n,e._modelMatrix2D),e._modelMatrix2D[13]-=P.sign(n[13])*2*P.PI*t.mapProjection.ellipsoid.maximumRadius,e._boundingVolume2D=ue.transform(e.runtimePrimitive.boundingSphere,e._modelMatrix2D,e._boundingVolume2D)}function zst(e){let t=e.shadows,n=Dn.castShadows(t),i=Dn.receiveShadows(t),r=e._derivedCommands;for(let o=0;o<r.length;++o){let s=r[o];if(s.updateShadows){let a=s.command;a.castShadows=n,a.receiveShadows=i}}}function Vst(e){let t=e.backFaceCulling,n=e._derivedCommands;for(let i=0;i<n.length;++i){let r=n[i];if(r.updateBackFaceCulling){let o=r.command,s=Ze(o.renderState,!0);s.cull.enabled=t,o.renderState=Ge.fromCache(s)}}}function jst(e){let t=e.cullFace,n=e._derivedCommands;for(let i=0;i<n.length;++i){let r=n[i];if(r.updateCullFace){let o=r.command,s=Ze(o.renderState,!0);s.cull.face=t,o.renderState=Ge.fromCache(s)}}}function Hst(e){let t=e.debugShowBoundingVolume,n=e._derivedCommands;for(let i=0;i<n.length;++i){let r=n[i];if(r.updateDebugShowBoundingVolume){let o=r.command;o.debugShowBoundingVolume=t}}}Iv.prototype.pushCommands=function(e,t){let n=UV(this,e);n&&!this._has2DCommands&&(Gst(this),this._has2DCommands=!0,this._modelMatrix2DDirty=!0),this._modelMatrix2DDirty&&(Ust(this,e),this._modelMatrix2DDirty=!1);let i=this.model.styleCommandsNeeded;if(!(this._needsTranslucentCommand&&l(i)&&(i!==_p.ALL_OPAQUE&&Ep(t,this._translucentCommand,n),i===_p.ALL_TRANSLUCENT))){if(this._needsSkipLevelOfDetailCommands){let{tileset:r,tile:o}=this._model.content;if(r.hasMixedContent){o._finalResolution||Ep(r._backfaceCommands,this._skipLodBackfaceCommand,n),Kst(this,o,n),Ep(t,this._skipLodStencilCommand,n);return}}if(this._needsSilhouetteCommands){Ep(t,this._silhouetteModelCommand,n);return}return this._model.edgeDisplayMode===Rh.EDGES_ONLY&&this._needsEdgeCommands||Ep(t,this._originalCommand,n),t}};Iv.prototype.pushSilhouetteCommands=function(e,t){let n=UV(this,e);return Ep(t,this._silhouetteColorCommand,n),t};Iv.prototype.pushEdgeCommands=function(e,t){if(!l(this._edgeCommand))return t;let n=this._model.edgeDisplayMode,i=e.passes,r=UV(this,e);if(i.snap){let s=this._edgeSnapCommand;return s.command.pass=Ie.CESIUM_3D_TILE_EDGES_DIRECT,l(s.derivedCommand2D)&&(s.derivedCommand2D.command.pass=Ie.CESIUM_3D_TILE_EDGES_DIRECT),Ep(t,s,r),t}if(i.pick){if(n!==Rh.EDGES_ONLY)return t;let s=this._edgeCommand;return s.command.pass=Ie.CESIUM_3D_TILE_EDGES_DIRECT,l(s.derivedCommand2D)&&(s.derivedCommand2D.command.pass=Ie.CESIUM_3D_TILE_EDGES_DIRECT),Ep(t,s,r),t}if(n===Rh.SURFACES_ONLY)return t;let o=n===Rh.EDGES_ONLY?Ie.CESIUM_3D_TILE_EDGES_DIRECT:Ie.CESIUM_3D_TILE_EDGES;return this._edgeCommand.command.pass=o,l(this._edgeCommand.derivedCommand2D)&&(this._edgeCommand.derivedCommand2D.command.pass=o),Ep(t,this._edgeCommand,r),t};Iv.prototype.pushPlanarFillIdCommands=function(e,t){if(!l(this._planarFillIdCommand))return t;let n=UV(this,e);return Ep(t,this._planarFillIdCommand,n),t};function Ep(e,t,n){e.push(t.command),n&&e.push(t.derivedCommand2D.command)}function UV(e,t){if(t.mode!==re.SCENE2D||e.model._projectTo2D)return!1;let i=e.model.sceneGraph._boundingSphere2D,r=i.center.y-i.radius,o=i.center.y+i.radius,s=t.mapProjection.ellipsoid.maximumRadius*P.PI;return r<s&&o>s||r<-s&&o>-s}function fg(e,t){if(!l(t))return;let n=Td.clone(t),i=at.shallowClone(t.command);return i.modelMatrix=e._modelMatrix2D,i.boundingVolume=e._boundingVolume2D,n.command=i,n.updateShadows=!1,n.is2D=!0,t.derivedCommand2D=n,e._derivedCommands.push(n),n}function Gst(e){fg(e,e._originalCommand),fg(e,e._translucentCommand),fg(e,e._skipLodBackfaceCommand),fg(e,e._skipLodStencilCommand),fg(e,e._silhouetteModelCommand),fg(e,e._silhouetteColorCommand),fg(e,e._edgeCommand),fg(e,e._edgeSnapCommand),fg(e,e._planarFillIdCommand)}function Wst(e){let t=at.shallowClone(e);t.pass=Ie.TRANSLUCENT;let n=Ze(e.renderState,!0);return n.cull.enabled=!1,n.depthMask=!1,n.blending=nn.ALPHA_BLEND,t.renderState=Ge.fromCache(n),t}function qst(e,t){let n=t._silhouetteId%255,i=at.shallowClone(e),r=Ze(e.renderState,!0);return r.stencilTest={enabled:!0,frontFunction:te.ALWAYS,backFunction:te.ALWAYS,reference:n,mask:-1,frontOperation:{fail:te.KEEP,zFail:te.KEEP,zPass:te.REPLACE},backOperation:{fail:te.KEEP,zFail:te.KEEP,zPass:te.REPLACE}},t.isInvisible()&&(r.colorMask={red:!1,green:!1,blue:!1,alpha:!1}),i.renderState=Ge.fromCache(r),i}function Yst(e,t){let n=t._silhouetteId%255,i=at.shallowClone(e),r=Ze(e.renderState,!0);r.cull.enabled=!1,(e.pass===Ie.TRANSLUCENT||t.silhouetteColor.alpha<1)&&(i.pass=Ie.TRANSLUCENT,r.depthMask=!1,r.blending=nn.ALPHA_BLEND),r.stencilTest={enabled:!0,frontFunction:te.NOTEQUAL,backFunction:te.NOTEQUAL,reference:n,mask:-1,frontOperation:{fail:te.KEEP,zFail:te.KEEP,zPass:te.KEEP},backOperation:{fail:te.KEEP,zFail:te.KEEP,zPass:te.KEEP}};let s=Ze(e.uniformMap);return s.model_silhouettePass=function(){return!0},i.renderState=Ge.fromCache(r),i.uniformMap=s,i.castShadows=!1,i.receiveShadows=!1,i}function pye(e,t,n){let i=t.edgeGeometry,r=at.shallowClone(e);r.vertexArray=i.vertexArray,r.primitiveType=i.primitiveType,r.count=i.indexCount,l(i.shaderProgram)&&(r.shaderProgram=i.shaderProgram),r.pass=i.pass;let o=Ze(e.uniformMap);return o.u_isEdgePass=function(){return!0},o.u_lineWidth=function(){return n},r.uniformMap=o,r.castShadows=!1,r.receiveShadows=!1,r}function Xst(e){let t=at.shallowClone(e);t.pass=Ie.CESIUM_3D_TILE_PLANAR_FILL_ID,t.castShadows=!1,t.receiveShadows=!1;let n=Ze(e.renderState,!0);n.blending.enabled=!1,t.renderState=Ge.fromCache(n);let i=Ze(e.uniformMap);return i.u_isPlanarFillIdPass=function(){return!0},t.uniformMap=i,t}function Kst(e,t,n){let i=e._skipLodStencilCommand,r=i.command,o=t._selectionDepth,s=$st(r);if(o!==s){let a=Jst(o),c=Ze(r.renderState,!0);c.stencilTest.reference=a,r.renderState=Ge.fromCache(c),n&&(i.derivedCommand2D.renderState=c)}}function $st(e){return(e.renderState.stencilTest.reference&Xt.SKIP_LOD_MASK)>>>Xt.SKIP_LOD_BIT_SHIFT}function Jst(e){return Xt.CESIUM_3D_TILE_MASK|e<<Xt.SKIP_LOD_BIT_SHIFT}function Zst(e){let t=at.shallowClone(e),n=Ze(e.renderState,!0);n.cull.enabled=!0,n.cull.face=Gi.FRONT,n.colorMask={red:!1,green:!1,blue:!1,alpha:!1},n.polygonOffset={enabled:!0,factor:5,units:5};let i=Ze(t.uniformMap),r=new U(5,5);return i.u_polygonOffset=function(){return r},t.renderState=Ge.fromCache(n),t.uniformMap=i,t.castShadows=!1,t.receiveShadows=!1,t}function Qst(e){let t=at.shallowClone(e),n=Ze(e.renderState,!0),{stencilTest:i}=n;return i.enabled=!0,i.mask=Xt.SKIP_LOD_MASK,i.reference=Xt.CESIUM_3D_TILE_MASK,i.frontFunction=ti.GREATER_OR_EQUAL,i.frontOperation.zPass=Rt.REPLACE,i.backFunction=ti.GREATER_OR_EQUAL,i.backOperation.zPass=Rt.REPLACE,n.stencilMask=Xt.CESIUM_3D_TILE_MASK|Xt.SKIP_LOD_MASK,t.renderState=Ge.fromCache(n),t}var zV=Iv;var VV=`precision highp float; +`;var P4={name:"ModelSplitterPipelineStage",SPLIT_DIRECTION_UNIFORM_NAME:"model_splitDirection"};P4.process=function(e,t,n){let i=e.shaderBuilder;i.addDefine("HAS_MODEL_SPLITTER",void 0,de.FRAGMENT),i.addFragmentLines(I4);let r={};i.addUniform("float",P4.SPLIT_DIRECTION_UNIFORM_NAME,de.FRAGMENT),r[P4.SPLIT_DIRECTION_UNIFORM_NAME]=function(){return t.splitDirection},e.uniformMap=Mt(r,e.uniformMap)};var D4=P4;function yut(e,t){this.model=e.model,this.shaderBuilder=e.shaderBuilder.clone(),this.uniformMap=Ze(e.uniformMap),this.alphaOptions=Ze(e.alphaOptions),this.renderStateOptions=Ze(e.renderStateOptions,!0),this.hasSilhouette=e.hasSilhouette,this.hasSkipLevelOfDetail=e.hasSkipLevelOfDetail,this.runtimeNode=t,this.attributes=[],this.attributeIndex=1,this.featureIdVertexAttributeSetIndex=0,this.instanceCount=0,this.primitiveRenderResources=[]}var R4=yut;function Aut(e){e=e??H.EMPTY_OBJECT,this.lightingModel=e.lightingModel??_g.UNLIT}var O4=Aut;function but(e,t){this.model=e.model,this.runtimeNode=e.runtimeNode,this.attributes=e.attributes.slice(),this.attributeIndex=e.attributeIndex,this.featureIdVertexAttributeSetIndex=e.featureIdVertexAttributeSetIndex,this.uniformMap=Ze(e.uniformMap),this.alphaOptions=Ze(e.alphaOptions),this.renderStateOptions=Ze(e.renderStateOptions,!0),this.hasSilhouette=e.hasSilhouette,this.hasSkipLevelOfDetail=e.hasSkipLevelOfDetail,this.planarFillIdPass=!1,this.shaderBuilder=e.shaderBuilder.clone(),this.instanceCount=e.instanceCount,this.runtimePrimitive=t;let n=t.primitive;this.count=l(n.indices)?n.indices.count:xt.getAttributeBySemantic(n,"POSITION").count,this.hasPropertyTable=!1,this.indices=n.indices,this.wireframeIndexBuffer=void 0,this.primitiveType=n.primitiveType;let i=xt.getPositionMinMax(n,this.runtimeNode.instancingTranslationMin,this.runtimeNode.instancingTranslationMax);this.positionMin=h.clone(i.min,new h),this.positionMax=h.clone(i.max,new h),this.boundingSphere=ue.fromCornerPoints(this.positionMin,this.positionMax,new ue),this.lightingOptions=new O4,this.pickId=void 0,this.snapId=void 0}var M4=but;function QZ(e){e=e??H.EMPTY_OBJECT;let t=e.command,n=e.primitiveRenderResources,i=n.model;this._command=t,this._model=i,this._runtimePrimitive=n.runtimePrimitive,this._modelMatrix=t.modelMatrix,this._boundingVolume=t.boundingVolume,this._cullFace=t.renderState.cull.face;let r=i.classificationType;this._classificationType=r,this._classifiesTerrain=r!==Qn.CESIUM_3D_TILE,this._classifies3DTiles=r!==Qn.TERRAIN,this._useDebugWireframe=i._enableDebugWireframe&&i.debugWireframe,this._pickId=n.pickId,this._commandListTerrain=[],this._commandList3DTiles=[],this._commandListIgnoreShow=[],this._commandListDebugWireframe=[],this._commandListTerrainPicking=[],this._commandList3DTilesPicking=[],Cut(this)}function xut(e){return{colorMask:{red:!1,green:!1,blue:!1,alpha:!1},stencilTest:{enabled:!0,frontFunction:e,frontOperation:{fail:Rt.KEEP,zFail:Rt.DECREMENT_WRAP,zPass:Rt.KEEP},backFunction:e,backOperation:{fail:Rt.KEEP,zFail:Rt.INCREMENT_WRAP,zPass:Rt.KEEP},reference:Xt.CESIUM_3D_TILE_MASK,mask:Xt.CESIUM_3D_TILE_MASK},stencilMask:Xt.CLASSIFICATION_MASK,depthTest:{enabled:!0,func:Ac.LESS_OR_EQUAL},depthMask:!1}}var Tut={stencilTest:{enabled:!0,frontFunction:ei.NOT_EQUAL,frontOperation:{fail:Rt.ZERO,zFail:Rt.ZERO,zPass:Rt.ZERO},backFunction:ei.NOT_EQUAL,backOperation:{fail:Rt.ZERO,zFail:Rt.ZERO,zPass:Rt.ZERO},reference:0,mask:Xt.CLASSIFICATION_MASK},stencilMask:Xt.CLASSIFICATION_MASK,depthTest:{enabled:!1},depthMask:!1,blending:nn.PRE_MULTIPLIED_ALPHA_BLEND},Eut={stencilTest:{enabled:!0,frontFunction:ei.NOT_EQUAL,frontOperation:{fail:Rt.ZERO,zFail:Rt.ZERO,zPass:Rt.ZERO},backFunction:ei.NOT_EQUAL,backOperation:{fail:Rt.ZERO,zFail:Rt.ZERO,zPass:Rt.ZERO},reference:0,mask:Xt.CLASSIFICATION_MASK},stencilMask:Xt.CLASSIFICATION_MASK,depthTest:{enabled:!1},depthMask:!1},Nxe=[];function Cut(e){let t=e._command,n=Nxe;if(e._useDebugWireframe){t.pass=Ie.OPAQUE,n.length=0,n.push(t),e._commandListDebugWireframe=S1(e,n,e._commandListDebugWireframe);let o=e._commandListDebugWireframe,s=o.length;for(let a=0;a<s;a++){let c=o[a];c.count*=2,c.offset*=2}return}let r=e.model.allowPicking;if(e._classifiesTerrain){let o=Ie.TERRAIN_CLASSIFICATION,s=ZZ(t,o),a=Oxe(t,o);n.length=0,n.push(s,a),e._commandListTerrain=S1(e,n,e._commandListTerrain),r&&(e._commandListTerrainPicking=Mxe(e,n,e._commandListTerrainPicking))}if(e._classifies3DTiles){let o=Ie.CESIUM_3D_TILE_CLASSIFICATION,s=ZZ(t,o),a=Oxe(t,o);n.length=0,n.push(s,a),e._commandList3DTiles=S1(e,n,e._commandList3DTiles),r&&(e._commandList3DTilesPicking=Mxe(e,n,e._commandList3DTilesPicking))}}function S1(e,t,n){let i=e._runtimePrimitive,r=i.batchLengths,o=i.batchOffsets,s=r.length,a=t.length;for(let c=0;c<s;c++){let u=r[c],f=o[c];for(let d=0;d<a;d++){let p=t[d],g=at.shallowClone(p);g.count=u,g.offset=f,n.push(g)}}return n}function ZZ(e,t){let n=at.shallowClone(e);n.cull=!1,n.pass=t;let i=t===Ie.TERRAIN_CLASSIFICATION?ei.ALWAYS:ei.EQUAL,r=xut(i);return n.renderState=Ge.fromCache(r),n}function Oxe(e,t){let n=at.shallowClone(e);return n.cull=!1,n.pass=t,n.renderState=Ge.fromCache(Tut),n}var vut=[];function Mxe(e,t,n){let i=Ge.fromCache(Eut),r=t[0],o=t[1],s=at.shallowClone(r);s.cull=!0,s.pickOnly=!0;let a=at.shallowClone(o);a.cull=!0,a.pickOnly=!0,a.renderState=i,a.pickId=e._pickId;let c=vut;return c.length=0,c.push(s,a),S1(e,c,n)}Object.defineProperties(QZ.prototype,{command:{get:function(){return this._command}},runtimePrimitive:{get:function(){return this._runtimePrimitive}},batchLengths:{get:function(){return this._runtimePrimitive.batchLengths}},batchOffsets:{get:function(){return this._runtimePrimitive.batchOffsets}},model:{get:function(){return this._model}},classificationType:{get:function(){return this._classificationType}},modelMatrix:{get:function(){return this._modelMatrix},set:function(e){this._modelMatrix=M.clone(e,this._modelMatrix);let t=this._runtimePrimitive.boundingSphere;this._boundingVolume=ue.transform(t,this._modelMatrix,this._boundingVolume)}},boundingVolume:{get:function(){return this._boundingVolume}},cullFace:{get:function(){return this._cullFace},set:function(e){this._cullFace=e}}});QZ.prototype.pushCommands=function(e,t){let n=e.passes;if(n.render){if(this._useDebugWireframe){Zn(t,this._commandListDebugWireframe);return}if(this._classifiesTerrain&&Zn(t,this._commandListTerrain),this._classifies3DTiles&&Zn(t,this._commandList3DTiles),e.invertClassification&&this._classifies3DTiles){if(this._commandListIgnoreShow.length===0){let r=Ie.CESIUM_3D_TILE_CLASSIFICATION_IGNORE_SHOW,o=ZZ(this._command,r),s=Nxe;s.length=0,s.push(o),this._commandListIgnoreShow=S1(this,s,this._commandListIgnoreShow)}Zn(t,this._commandListIgnoreShow)}}return n.pick&&(this._classifiesTerrain&&Zn(t,this._commandListTerrainPicking),this._classifies3DTiles&&Zn(t,this._commandList3DTilesPicking)),t};var N4=QZ;function uS(e){e=e??H.EMPTY_OBJECT;let t=e.command,n=e.primitiveRenderResources,i=n.model;this._model=i;let r=n.runtimePrimitive;this._runtimePrimitive=r,this._primitiveRenderResources=n;let o=t.pass===Ie.TRANSLUCENT,a=!r.primitive.material.doubleSided&&!o,c=n.hasSilhouette,u=!o&&!c,f=n.hasSkipLevelOfDetail&&!o,d=c,p=l(n.edgeGeometry);this._command=t,this._modelMatrix=M.clone(t.modelMatrix),this._boundingVolume=ue.clone(t.boundingVolume),this._modelMatrix2D=new M,this._boundingVolume2D=new ue,this._modelMatrix2DDirty=!1,this._backFaceCulling=t.renderState.cull.enabled,this._cullFace=t.renderState.cull.face,this._shadows=i.shadows,this._debugShowBoundingVolume=t.debugShowBoundingVolume,this._usesBackFaceCulling=a,this._needsTranslucentCommand=u,this._needsSkipLevelOfDetailCommands=f,this._needsSilhouetteCommands=d,this._needsEdgeCommands=p,this._needsPlanarFillIdCommand=n.planarFillIdPass,this._originalCommand=void 0,this._translucentCommand=void 0,this._skipLodBackfaceCommand=void 0,this._skipLodStencilCommand=void 0,this._silhouetteModelCommand=void 0,this._silhouetteColorCommand=void 0,this._edgeCommand=void 0,this._edgeSnapCommand=void 0,this._planarFillIdCommand=void 0,this._derivedCommands=[],this._has2DCommands=!1,Sut(this)}function Od(e){this.command=e.command,this.updateShadows=e.updateShadows,this.updateBackFaceCulling=e.updateBackFaceCulling,this.updateCullFace=e.updateCullFace,this.updateDebugShowBoundingVolume=e.updateDebugShowBoundingVolume,this.is2D=e.is2D??!1,this.derivedCommand2D=void 0}Od.clone=function(e){return new Od({command:e.command,updateShadows:e.updateShadows,updateBackFaceCulling:e.updateBackFaceCulling,updateCullFace:e.updateCullFace,updateDebugShowBoundingVolume:e.updateDebugShowBoundingVolume,is2D:e.is2D,derivedCommand2D:e.derivedCommand2D})};function Sut(e){let t=e._command;t.modelMatrix=e._modelMatrix,t.boundingVolume=e._boundingVolume;let n=e._model,i=e._usesBackFaceCulling,r=e._derivedCommands;if(e._originalCommand=new Od({command:t,updateShadows:!0,updateBackFaceCulling:i,updateCullFace:i,updateDebugShowBoundingVolume:!0,is2D:!1}),r.push(e._originalCommand),e._needsTranslucentCommand&&(e._translucentCommand=new Od({command:Mut(t),updateShadows:!0,updateBackFaceCulling:!1,updateCullFace:!1,updateDebugShowBoundingVolume:!0}),r.push(e._translucentCommand)),e._needsSkipLevelOfDetailCommands&&(e._skipLodBackfaceCommand=new Od({command:zut(t),updateShadows:!1,updateBackFaceCulling:!1,updateCullFace:i,updateDebugShowBoundingVolume:!1}),e._skipLodStencilCommand=new Od({command:Vut(t,n),updateShadows:!0,updateBackFaceCulling:i,updateCullFace:i,updateDebugShowBoundingVolume:!0}),r.push(e._skipLodBackfaceCommand),r.push(e._skipLodStencilCommand)),e._needsSilhouetteCommands&&(e._silhouetteModelCommand=new Od({command:Nut(t,n),updateShadows:!0,updateBackFaceCulling:i,updateCullFace:i,updateDebugShowBoundingVolume:!0}),e._silhouetteColorCommand=new Od({command:Lut(t,n),updateShadows:!1,updateBackFaceCulling:!1,updateCullFace:!1,updateDebugShowBoundingVolume:!1}),r.push(e._silhouetteModelCommand),r.push(e._silhouetteColorCommand)),e._needsEdgeCommands){let o=e._primitiveRenderResources,s=o.edgeGeometry,a=l(s.lineWidth)?s.lineWidth:1,c=1;e._edgeCommand=new Od({command:Lxe(t,o,a),updateShadows:!1,updateBackFaceCulling:!1,updateCullFace:!1,updateDebugShowBoundingVolume:!1}),e._edgeSnapCommand=new Od({command:Lxe(t,o,c),updateShadows:!1,updateBackFaceCulling:!1,updateCullFace:!1,updateDebugShowBoundingVolume:!1}),r.push(e._edgeCommand),r.push(e._edgeSnapCommand)}e._needsPlanarFillIdCommand&&(e._planarFillIdCommand=new Od({command:Fut(t),updateShadows:!1,updateBackFaceCulling:!1,updateCullFace:!1,updateDebugShowBoundingVolume:!1}),r.push(e._planarFillIdCommand)),e._primitiveRenderResources=void 0}Object.defineProperties(uS.prototype,{command:{get:function(){return this._command}},runtimePrimitive:{get:function(){return this._runtimePrimitive}},model:{get:function(){return this._model}},primitiveType:{get:function(){return this._command.primitiveType}},modelMatrix:{get:function(){return this._modelMatrix},set:function(e){this._modelMatrix=M.clone(e,this._modelMatrix),this._modelMatrix2DDirty=!0,this._boundingVolume=ue.transform(this.runtimePrimitive.boundingSphere,this._modelMatrix,this._boundingVolume)}},boundingVolume:{get:function(){return this._boundingVolume}},shadows:{get:function(){return this._shadows},set:function(e){this._shadows=e,Iut(this)}},backFaceCulling:{get:function(){return this._backFaceCulling},set:function(e){this._backFaceCulling!==e&&(this._backFaceCulling=e,Put(this))}},cullFace:{get:function(){return this._cullFace},set:function(e){this._cullFace!==e&&(this._cullFace=e,Dut(this))}},debugShowBoundingVolume:{get:function(){return this._debugShowBoundingVolume},set:function(e){this._debugShowBoundingVolume!==e&&(this._debugShowBoundingVolume=e,Rut(this))}}});function wut(e,t){let n=e._modelMatrix;e._modelMatrix2D=M.clone(n,e._modelMatrix2D),e._modelMatrix2D[13]-=P.sign(n[13])*2*P.PI*t.mapProjection.ellipsoid.maximumRadius,e._boundingVolume2D=ue.transform(e.runtimePrimitive.boundingSphere,e._modelMatrix2D,e._boundingVolume2D)}function Iut(e){let t=e.shadows,n=Pn.castShadows(t),i=Pn.receiveShadows(t),r=e._derivedCommands;for(let o=0;o<r.length;++o){let s=r[o];if(s.updateShadows){let a=s.command;a.castShadows=n,a.receiveShadows=i}}}function Put(e){let t=e.backFaceCulling,n=e._derivedCommands;for(let i=0;i<n.length;++i){let r=n[i];if(r.updateBackFaceCulling){let o=r.command,s=Ze(o.renderState,!0);s.cull.enabled=t,o.renderState=Ge.fromCache(s)}}}function Dut(e){let t=e.cullFace,n=e._derivedCommands;for(let i=0;i<n.length;++i){let r=n[i];if(r.updateCullFace){let o=r.command,s=Ze(o.renderState,!0);s.cull.face=t,o.renderState=Ge.fromCache(s)}}}function Rut(e){let t=e.debugShowBoundingVolume,n=e._derivedCommands;for(let i=0;i<n.length;++i){let r=n[i];if(r.updateDebugShowBoundingVolume){let o=r.command;o.debugShowBoundingVolume=t}}}uS.prototype.pushCommands=function(e,t){let n=L4(this,e);n&&!this._has2DCommands&&(Out(this),this._has2DCommands=!0,this._modelMatrix2DDirty=!0),this._modelMatrix2DDirty&&(wut(this,e),this._modelMatrix2DDirty=!1);let i=this.model.styleCommandsNeeded;if(!(this._needsTranslucentCommand&&l(i)&&(i!==wp.ALL_OPAQUE&&Mp(t,this._translucentCommand,n),i===wp.ALL_TRANSLUCENT))){if(this._needsSkipLevelOfDetailCommands){let{tileset:r,tile:o}=this._model.content;if(r.hasMixedContent){o._finalResolution||Mp(r._backfaceCommands,this._skipLodBackfaceCommand,n),But(this,o,n),Mp(t,this._skipLodStencilCommand,n);return}}if(this._needsSilhouetteCommands){Mp(t,this._silhouetteModelCommand,n);return}return this._model.edgeDisplayMode===kh.EDGES_ONLY&&this._needsEdgeCommands||Mp(t,this._originalCommand,n),t}};uS.prototype.pushSilhouetteCommands=function(e,t){let n=L4(this,e);return Mp(t,this._silhouetteColorCommand,n),t};uS.prototype.pushEdgeCommands=function(e,t){if(!l(this._edgeCommand))return t;let n=this._model.edgeDisplayMode,i=e.passes,r=L4(this,e);if(i.snap){let s=this._edgeSnapCommand;return s.command.pass=Ie.CESIUM_3D_TILE_EDGES_DIRECT,l(s.derivedCommand2D)&&(s.derivedCommand2D.command.pass=Ie.CESIUM_3D_TILE_EDGES_DIRECT),Mp(t,s,r),t}if(i.pick){if(n!==kh.EDGES_ONLY)return t;let s=this._edgeCommand;return s.command.pass=Ie.CESIUM_3D_TILE_EDGES_DIRECT,l(s.derivedCommand2D)&&(s.derivedCommand2D.command.pass=Ie.CESIUM_3D_TILE_EDGES_DIRECT),Mp(t,s,r),t}if(n===kh.SURFACES_ONLY)return t;let o=n===kh.EDGES_ONLY?Ie.CESIUM_3D_TILE_EDGES_DIRECT:Ie.CESIUM_3D_TILE_EDGES;return this._edgeCommand.command.pass=o,l(this._edgeCommand.derivedCommand2D)&&(this._edgeCommand.derivedCommand2D.command.pass=o),Mp(t,this._edgeCommand,r),t};uS.prototype.pushPlanarFillIdCommands=function(e,t){if(!l(this._planarFillIdCommand))return t;let n=L4(this,e);return Mp(t,this._planarFillIdCommand,n),t};function Mp(e,t,n){e.push(t.command),n&&e.push(t.derivedCommand2D.command)}function L4(e,t){if(t.mode!==re.SCENE2D||e.model._projectTo2D)return!1;let i=e.model.sceneGraph._boundingSphere2D,r=i.center.y-i.radius,o=i.center.y+i.radius,s=t.mapProjection.ellipsoid.maximumRadius*P.PI;return r<s&&o>s||r<-s&&o>-s}function yg(e,t){if(!l(t))return;let n=Od.clone(t),i=at.shallowClone(t.command);return i.modelMatrix=e._modelMatrix2D,i.boundingVolume=e._boundingVolume2D,n.command=i,n.updateShadows=!1,n.is2D=!0,t.derivedCommand2D=n,e._derivedCommands.push(n),n}function Out(e){yg(e,e._originalCommand),yg(e,e._translucentCommand),yg(e,e._skipLodBackfaceCommand),yg(e,e._skipLodStencilCommand),yg(e,e._silhouetteModelCommand),yg(e,e._silhouetteColorCommand),yg(e,e._edgeCommand),yg(e,e._edgeSnapCommand),yg(e,e._planarFillIdCommand)}function Mut(e){let t=at.shallowClone(e);t.pass=Ie.TRANSLUCENT;let n=Ze(e.renderState,!0);return n.cull.enabled=!1,n.depthMask=!1,n.blending=nn.ALPHA_BLEND,t.renderState=Ge.fromCache(n),t}function Nut(e,t){let n=t._silhouetteId%255,i=at.shallowClone(e),r=Ze(e.renderState,!0);return r.stencilTest={enabled:!0,frontFunction:te.ALWAYS,backFunction:te.ALWAYS,reference:n,mask:-1,frontOperation:{fail:te.KEEP,zFail:te.KEEP,zPass:te.REPLACE},backOperation:{fail:te.KEEP,zFail:te.KEEP,zPass:te.REPLACE}},t.isInvisible()&&(r.colorMask={red:!1,green:!1,blue:!1,alpha:!1}),i.renderState=Ge.fromCache(r),i}function Lut(e,t){let n=t._silhouetteId%255,i=at.shallowClone(e),r=Ze(e.renderState,!0);r.cull.enabled=!1,(e.pass===Ie.TRANSLUCENT||t.silhouetteColor.alpha<1)&&(i.pass=Ie.TRANSLUCENT,r.depthMask=!1,r.blending=nn.ALPHA_BLEND),r.stencilTest={enabled:!0,frontFunction:te.NOTEQUAL,backFunction:te.NOTEQUAL,reference:n,mask:-1,frontOperation:{fail:te.KEEP,zFail:te.KEEP,zPass:te.KEEP},backOperation:{fail:te.KEEP,zFail:te.KEEP,zPass:te.KEEP}};let s=Ze(e.uniformMap);return s.model_silhouettePass=function(){return!0},i.renderState=Ge.fromCache(r),i.uniformMap=s,i.castShadows=!1,i.receiveShadows=!1,i}function Lxe(e,t,n){let i=t.edgeGeometry,r=at.shallowClone(e);r.vertexArray=i.vertexArray,r.primitiveType=i.primitiveType,r.count=i.indexCount,l(i.shaderProgram)&&(r.shaderProgram=i.shaderProgram),r.pass=i.pass;let o=Ze(e.uniformMap);return o.u_isEdgePass=function(){return!0},o.u_lineWidth=function(){return n},r.uniformMap=o,r.castShadows=!1,r.receiveShadows=!1,r}function Fut(e){let t=at.shallowClone(e);t.pass=Ie.CESIUM_3D_TILE_PLANAR_FILL_ID,t.castShadows=!1,t.receiveShadows=!1;let n=Ze(e.renderState,!0);n.blending.enabled=!1,t.renderState=Ge.fromCache(n);let i=Ze(e.uniformMap);return i.u_isPlanarFillIdPass=function(){return!0},t.uniformMap=i,t}function But(e,t,n){let i=e._skipLodStencilCommand,r=i.command,o=t._selectionDepth,s=kut(r);if(o!==s){let a=Uut(o),c=Ze(r.renderState,!0);c.stencilTest.reference=a,r.renderState=Ge.fromCache(c),n&&(i.derivedCommand2D.renderState=c)}}function kut(e){return(e.renderState.stencilTest.reference&Xt.SKIP_LOD_MASK)>>>Xt.SKIP_LOD_BIT_SHIFT}function Uut(e){return Xt.CESIUM_3D_TILE_MASK|e<<Xt.SKIP_LOD_BIT_SHIFT}function zut(e){let t=at.shallowClone(e),n=Ze(e.renderState,!0);n.cull.enabled=!0,n.cull.face=Hi.FRONT,n.colorMask={red:!1,green:!1,blue:!1,alpha:!1},n.polygonOffset={enabled:!0,factor:5,units:5};let i=Ze(t.uniformMap),r=new U(5,5);return i.u_polygonOffset=function(){return r},t.renderState=Ge.fromCache(n),t.uniformMap=i,t.castShadows=!1,t.receiveShadows=!1,t}function Vut(e){let t=at.shallowClone(e),n=Ze(e.renderState,!0),{stencilTest:i}=n;return i.enabled=!0,i.mask=Xt.SKIP_LOD_MASK,i.reference=Xt.CESIUM_3D_TILE_MASK,i.frontFunction=ei.GREATER_OR_EQUAL,i.frontOperation.zPass=Rt.REPLACE,i.backFunction=ei.GREATER_OR_EQUAL,i.backOperation.zPass=Rt.REPLACE,n.stencilMask=Xt.CESIUM_3D_TILE_MASK|Xt.SKIP_LOD_MASK,t.renderState=Ge.fromCache(n),t}var F4=uS;var B4=`precision highp float; czm_modelVertexOutput defaultVertexOutput(vec3 positionMC) { czm_modelVertexOutput vsOutput; vsOutput.positionMC = positionMC; @@ -9784,7 +9780,7 @@ edgeVisibilityStageVS(); v_pointCloudShow = show; #endif } -`;var jV=`precision highp float; +`;var k4=`precision highp float; const float PLANAR_DEPTH_PULL = 0.9995; const float BEHIND_DEPTH_PUSH = 1.0002; const float FEATURE_ID_TOLERANCE = 0.5; @@ -9930,25 +9926,29 @@ gl_FragDepth *= BEHIND_DEPTH_PUSH; } #endif } -`;function gye(){}gye.buildModelDrawCommand=function(e,t){let n=e.shaderBuilder,i=eat(e,n,t),r=tat(e,i,t),o=e.model;return l(o.classificationType)?new kV({primitiveRenderResources:e,command:r}):new zV({primitiveRenderResources:e,command:r})};function eat(e,t,n){t.addVertexLines(VV),t.addFragmentLines(jV);let i=e.model,r=t.buildShaderProgram(n.context);return i._pipelineResources.push(r),r}function tat(e,t,n){let i=nat(e),r=new Vn({context:n.context,indexBuffer:i,attributes:e.attributes}),o=e.model;o._pipelineResources.push(r);let s=e.alphaOptions.pass,a=o.sceneGraph,c=n.mode===re.SCENE3D,u,f;if(!c&&!n.scene3DOnly&&o._projectTo2D)u=M.multiplyTransformation(a._computedModelMatrix,e.runtimeNode.computedTransform,new M),f=e.runtimePrimitive.boundingSphere2D;else{let x=c?a._computedModelMatrix:a._computedModelMatrix2D;u=M.multiplyTransformation(x,e.runtimeNode.computedTransform,new M),f=ue.transform(e.boundingSphere,u)}let d=Ze(Ge.fromCache(e.renderStateOptions),!0);d.cull.face=xt.getCullFace(u,e.primitiveType),d=Ge.fromCache(d);let p=l(o.classificationType),g=p?!1:Dn.castShadows(o.shadows),m=p?!1:Dn.receiveShadows(o.shadows),y=p?void 0:e.pickId,A=p?void 0:e.snapId;return new at({boundingVolume:f,modelMatrix:u,uniformMap:e.uniformMap,renderState:d,vertexArray:r,shaderProgram:t,cull:o.cull,pass:s,count:e.count,owner:o,pickId:y,snapId:A,pickMetadataAllowed:!0,instanceCount:e.instanceCount,primitiveType:e.primitiveType,debugShowBoundingVolume:o.debugShowBoundingVolume,castShadows:g,receiveShadows:m})}function nat(e){let t=e.wireframeIndexBuffer;if(l(t))return t;let n=e.indices;if(l(n))return n.buffer}var HV=gye;function el(e){e=e??H.EMPTY_OBJECT;let t=e.modelComponents;this._model=e.model,this._components=t,this._pipelineStages=[],this._updateStages=[],this._runtimeNodes=[],this._rootNodes=[],this._skinnedNodes=[],this._runtimeSkins=[],this.modelPipelineStages=[],this._boundingSphere=void 0,this._positionMin=void 0,this._positionMax=void 0,this._boundingSphere2D=void 0,this._computedModelMatrix=M.clone(M.IDENTITY),this._computedModelMatrix2D=M.clone(M.IDENTITY),this._axisCorrectionMatrix=xt.getAxisCorrectionMatrix(t.upAxis,t.forwardAxis,new M),this._runtimeArticulations={},iat(this)}Object.defineProperties(el.prototype,{components:{get:function(){return this._components}},computedModelMatrix:{get:function(){return this._computedModelMatrix}},axisCorrectionMatrix:{get:function(){return this._axisCorrectionMatrix}},boundingSphere:{get:function(){return this._boundingSphere}}});function iat(e){let t=e._components,n=t.scene,r=e._model.modelMatrix;_ye(e,r);let o=t.articulations,s=o.length,a=e._runtimeArticulations;for(let x=0;x<s;x++){let T=o[x],E=new XU({articulation:T,sceneGraph:e}),v=E.name;a[v]=E}let c=t.nodes,u=c.length;e._runtimeNodes=new Array(u);let d=n.nodes.length,p=M.IDENTITY;for(let x=0;x<d;x++){let T=n.nodes[x],E=yye(e,T,p);e._rootNodes.push(E)}let g=t.skins,m=e._runtimeSkins,y=g.length;for(let x=0;x<y;x++){let T=g[x];m.push(new SV({skin:T,sceneGraph:e}))}let A=e._skinnedNodes,b=A.length;for(let x=0;x<b;x++){let T=A[x],E=e._runtimeNodes[T],S=c[T].skin.index;E._runtimeSkin=m[S],E.updateJointMatrices()}e.applyArticulations()}function _ye(e,t){let n=e._components,i=e._model;e._computedModelMatrix=M.multiplyTransformation(t,n.transform,e._computedModelMatrix),e._computedModelMatrix=M.multiplyTransformation(e._computedModelMatrix,e._axisCorrectionMatrix,e._computedModelMatrix),e._computedModelMatrix=M.multiplyByUniformScale(e._computedModelMatrix,i.computedScale,e._computedModelMatrix)}var rat=new h;function oat(e,t){let n=e._computedModelMatrix,i=M.getTranslation(n,rat);if(!h.equals(i,h.ZERO))e._computedModelMatrix2D=At.basisTo2D(t.mapProjection,n,e._computedModelMatrix2D);else{let r=e.boundingSphere.center,o=At.ellipsoidTo2DModelMatrix(t.mapProjection,r,e._computedModelMatrix2D);e._computedModelMatrix2D=M.multiply(o,n,e._computedModelMatrix2D)}e._boundingSphere2D=ue.transform(e._boundingSphere,e._computedModelMatrix2D,e._boundingSphere2D)}function yye(e,t,n){let i=[],r=xt.getNodeTransform(t),o=t.children.length;for(let f=0;f<o;f++){let d=t.children[f],p=M.multiplyTransformation(n,r,new M),g=yye(e,d,p);i.push(g)}let s=new dz({node:t,transform:r,transformToRoot:n,children:i,sceneGraph:e}),a=t.primitives.length;for(let f=0;f<a;f++)s.runtimePrimitives.push(new vV({primitive:t.primitives[f],node:t,model:e._model}));let c=t.index;e._runtimeNodes[c]=s,l(t.skin)&&e._skinnedNodes.push(c);let u=t.name;if(l(u)){let f=e._model,d=new rz(f,s);f._nodesByName[u]=d}return c}var sat=new h,aat=new h,cat=new h,lat=new h;el.prototype.buildDrawCommands=function(e){let t=this.buildRenderResources(e);this.computeBoundingVolumes(t),this.createDrawCommands(t,e)};el.prototype.buildRenderResources=function(e){let t=this._model,n=new wV(t);t.statistics.clear(),this.configurePipeline(e);let i=this.modelPipelineStages;for(let r=0;r<i.length;r++)i[r].process(n,t,e);for(let r=0;r<this._runtimeNodes.length;r++){let o=this._runtimeNodes[r];if(!l(o))continue;o.configurePipeline();let s=o.pipelineStages,a=new LV(n,o);n.nodeRenderResources[r]=a;for(let c=0;c<s.length;c++)s[c].process(a,o.node,e);for(let c=0;c<o.runtimePrimitives.length;c++){let u=o.runtimePrimitives[c];u.configurePipeline(e);let f=u.pipelineStages,d=new BV(a,u);a.primitiveRenderResources[c]=d;for(let p=0;p<f.length;p++)f[p].process(d,u.primitive,e)}}return n};el.prototype.computeBoundingVolumes=function(e){let t=this._model,n=h.fromElements(Number.MAX_VALUE,Number.MAX_VALUE,Number.MAX_VALUE,sat),i=h.fromElements(-Number.MAX_VALUE,-Number.MAX_VALUE,-Number.MAX_VALUE,aat);for(let r=0;r<this._runtimeNodes.length;r++){let o=this._runtimeNodes[r];if(!l(o))continue;let s=e.nodeRenderResources[r],a=o.computedTransform;for(let c=0;c<o.runtimePrimitives.length;c++){let u=o.runtimePrimitives[c],f=s.primitiveRenderResources[c];u.boundingSphere=ue.clone(f.boundingSphere,new ue);let d=M.multiplyByPoint(a,f.positionMin,cat),p=M.multiplyByPoint(a,f.positionMax,lat);h.minimumByComponent(n,d,n),h.minimumByComponent(n,p,n),h.maximumByComponent(i,p,i),h.maximumByComponent(i,d,i)}}this._positionMin=h.clone(n,this._positionMin),this._positionMax=h.clone(i,this._positionMax),this._boundingSphere=ue.fromCornerPoints(n,i,new ue),this._boundingSphere=ue.transformWithoutScale(this._boundingSphere,this._axisCorrectionMatrix,this._boundingSphere),this._boundingSphere=ue.transform(this._boundingSphere,this._components.transform,this._boundingSphere),t._boundingSphere=ue.transform(this._boundingSphere,t.modelMatrix,t._boundingSphere),t._initialRadius=t._boundingSphere.radius,t._boundingSphere.radius*=t._clampedScale};el.prototype.createDrawCommands=function(e,t){for(let n=0;n<this._runtimeNodes.length;n++){let i=this._runtimeNodes[n];if(!l(i))continue;let r=e.nodeRenderResources[n];for(let o=0;o<i.runtimePrimitives.length;o++){let s=i.runtimePrimitives[o],a=r.primitiveRenderResources[o],c=HV.buildModelDrawCommand(a,t);s.drawCommand=c}}};el.prototype.configurePipeline=function(e){let t=this.modelPipelineStages;t.length=0;let n=this._model,i=e.fog.enabled&&e.fog.renderable;if(l(n.color)&&t.push(dx),l(n.classificationType))return;n.imageBasedLighting.enabled&&t.push(WU),n.isClippingEnabled()&&t.push(JU);let r=(n._clippingPolygonData?.polygonRings.length??0)>0;n.isClippingPolygonsEnabled()&&r&&t.push(ez),n.hasDrapedVectors()&&t.push(iz),n.hasSilhouette(e)&&t.push(RV),l(n.splitDirection)&&n.splitDirection!==Wo.NONE&&t.push(NV),Jo.is3DTiles(n.type)&&t.push(zU),i&&t.push(HU)};el.prototype.update=function(e,t){let n,i,r;for(n=0;n<this._runtimeNodes.length;n++){let o=this._runtimeNodes[n];if(!l(o))continue;for(i=0;i<o.updateStages.length;i++)o.updateStages[i].update(o,this,e);let s=e.mode!==re.SCENE3D&&this._model._projectTo2D;for(t&&!s&&this.updateJointMatrices(),i=0;i<o.runtimePrimitives.length;i++){let a=o.runtimePrimitives[i];for(r=0;r<a.updateStages.length;r++)a.updateStages[r].update(a,this)}}};el.prototype.updateModelMatrix=function(e,t){_ye(this,e),t.mode!==re.SCENE3D&&oat(this,t);let n=this._rootNodes;for(let i=0;i<n.length;i++){let r=this._runtimeNodes[n[i]];r._transformDirty=!0}};el.prototype.updateJointMatrices=function(){let e=this._skinnedNodes,t=e.length;for(let n=0;n<t;n++){let i=e[n];this._runtimeNodes[i].updateJointMatrices()}};function Aye(e,t,n,i,r){if(n&&!t.show)return;let o=t.children.length;for(let c=0;c<o;c++){let u=t.getChild(c);Aye(e,u,n,i,r)}let s=t.runtimePrimitives,a=s.length;for(let c=0;c<a;c++){let u=s[c];i(u,r)}}function GV(e,t,n,i){let r=e._rootNodes,o=r.length;for(let s=0;s<o;s++){let a=r[s],c=e._runtimeNodes[a];Aye(e,c,t,n,i)}}var uat={backFaceCulling:void 0};el.prototype.updateBackFaceCulling=function(e){let t=uat;t.backFaceCulling=e,GV(this,!1,fat,t)};function fat(e,t){let n=e.drawCommand;n.backFaceCulling=t.backFaceCulling}var dat={shadowMode:void 0};el.prototype.updateShadows=function(e){let t=dat;t.shadowMode=e,GV(this,!1,hat,t)};function hat(e,t){let n=e.drawCommand;n.shadows=t.shadowMode}var mat={debugShowBoundingVolume:void 0};el.prototype.updateShowBoundingVolume=function(e){let t=mat;t.debugShowBoundingVolume=e,GV(this,!1,pat,t)};function pat(e,t){let n=e.drawCommand;n.debugShowBoundingVolume=t.debugShowBoundingVolume}var bye=[],xye=[],Tye=[],gat={frameState:void 0,hasSilhouette:void 0};el.prototype.pushDrawCommands=function(e){let t=bye;t.length=0;let n=xye;n.length=0;let i=Tye;i.length=0;let r=gat;r.hasSilhouette=this._model.hasSilhouette(e),r.frameState=e,GV(this,!0,_at,r),Zn(e.commandList,t),Zn(e.commandList,n),Zn(e.commandList,i)};function _at(e,t){let n=t.frameState,i=t.hasSilhouette,r=n.passes,o=bye,s=xye,a=Tye,c=e.drawCommand;c.pushCommands(n,n.commandList);let u=e.primitive.material;l(u)&&l(u.planarFill)&&(n.planarFillRequested=!0),i&&!r.pick&&c.pushSilhouetteCommands(n,o),l(c.pushEdgeCommands)&&c.pushEdgeCommands(n,s),l(c.pushPlanarFillIdCommands)&&c.pushPlanarFillIdCommands(n,a)}el.prototype.setArticulationStage=function(e,t){let n=e.split(" ");if(n.length!==2)return;let i=n[0],r=n[1],o=this._runtimeArticulations[i];l(o)&&o.setArticulationStage(r,t)};el.prototype.applyArticulations=function(){let e=this._runtimeArticulations;for(let t in e)e.hasOwnProperty(t)&&e[t].apply()};var WV=el;function Oy(){this.pointsLength=0,this.trianglesLength=0,this.geometryByteLength=0,this.texturesByteLength=0,this.propertyTablesByteLength=0,this._bufferIdSet={},this._textureIdByteLengths={},this._batchTextureIdMap=new zt}Object.defineProperties(Oy.prototype,{batchTexturesByteLength:{get:function(){let e=this._batchTextureIdMap.length,t=this._batchTextureIdMap.values,n=0;for(let i=0;i<e;i++)n+=t[i].byteLength;return n}}});Oy.prototype.clear=function(){this.pointsLength=0,this.trianglesLength=0,this.geometryByteLength=0,this.texturesByteLength=0,this.propertyTablesByteLength=0,this._bufferIdSet={},this._textureIdByteLengths={},this._batchTextureIdMap.removeAll()};Oy.prototype.addBuffer=function(e,t){if(!this._bufferIdSet.hasOwnProperty(e._id)){let n=t?2:1;this.geometryByteLength+=e.sizeInBytes*n}this._bufferIdSet[e._id]=!0};Oy.prototype.addTexture=function(e){this._textureIdByteLengths.hasOwnProperty(e._id)||(this.texturesByteLength+=e.sizeInBytes,this._textureIdByteLengths[e._id]=e.sizeInBytes)};Oy.prototype.getTextureIds=function(){return Object.keys(this._textureIdByteLengths)};Oy.prototype.getTextureByteLengthById=function(e){return this._textureIdByteLengths[e]};Oy.prototype.addBatchTexture=function(e){this._batchTextureIdMap.contains(e._id)||this._batchTextureIdMap.set(e._id,e)};var qV=Oy;var Sye=js(rN(),1);var Eye={},Ax=Uint32Array.BYTES_PER_ELEMENT;Eye.parse=function(e,t){t=t??0;let n=new Uint8Array(e),i=new DataView(e);t+=Ax;let r=i.getUint32(t,!0);if(r!==1)throw new oe(`Only Point Cloud tile version 1 is supported. Version ${r} is not.`);t+=Ax,t+=Ax;let o=i.getUint32(t,!0);if(o===0)throw new oe("Feature table must have a byte length greater than zero");t+=Ax;let s=i.getUint32(t,!0);t+=Ax;let a=i.getUint32(t,!0);t+=Ax;let c=i.getUint32(t,!0);t+=Ax;let u=No(n,t,o);t+=o;let f=new Uint8Array(e,t,s);t+=s;let d,p;a>0&&(d=No(n,t,a),Object.keys(d).length===0&&(d=void 0),t+=a,c>0&&(p=new Uint8Array(e,t,c),p=new Uint8Array(p)));let g=new pp(u,f),m=g.getGlobalProperty("POINTS_LENGTH");if(g.featuresLength=m,!l(m))throw new oe("Feature table global property: POINTS_LENGTH must be defined");let y=g.getGlobalProperty("RTC_CENTER",Y.FLOAT,3);l(y)&&(y=h.unpack(y));let A=Aat(g,d);if(A.rtcCenter=y,A.pointsLength=m,!A.hasPositions){let b=bat(g);A.positions=b,A.hasPositions=A.hasPositions||l(b)}if(!A.hasPositions)throw new oe("Either POSITION or POSITION_QUANTIZED must be defined.");if(!A.hasNormals){let b=Tat(g);A.normals=b,A.hasNormals=A.hasNormals||l(b)}if(!A.hasColors){let b=xat(g);A.colors=b,A.hasColors=A.hasColors||l(b),A.hasConstantColor=l(A.constantColor),A.isTranslucent=l(b)&&b.isTranslucent}if(!A.hasBatchIds){let b=Eat(g);A.batchIds=b,A.hasBatchIds=A.hasBatchIds||l(b)}if(A.hasBatchIds){let b=g.getGlobalProperty("BATCH_LENGTH");if(!l(b))throw new oe("Global property: BATCH_LENGTH must be defined when BATCH_ID is defined.");A.batchLength=b}return(l(d)||l(p))&&(A.batchTableJson=d,A.batchTableBinary=p),yat(A),A};function yat(e){let t=e.batchTableJson;if(!l(t))return;let n=e.batchTableBinary;if(l(n))return;let i=Object.keys(e.draco?.batchTableProperties??{}),r=[];for(let o of Object.keys(t)){let a=t[o].byteOffset;l(a)&&(i.includes(o)||r.push(o))}for(let o of r)yt("PntsParser-invalidBinaryBodyReference",`The point cloud data contained a binary property ${o} that could not be resolved - skipping`),delete t[o]}function Aat(e,t){let n=e.json,i,r,o,s=l(n.extensions)?n.extensions["3DTILES_draco_point_compression"]:void 0,a=l(t)&&l(t.extensions)?t.extensions["3DTILES_draco_point_compression"]:void 0;l(a)&&(o=a.properties);let c,u,f,d,p;if(l(s)){r=s.properties;let m=s.byteOffset,y=s.byteLength;if(!l(r)||!l(m)||!l(y))throw new oe("Draco properties, byteOffset, and byteLength must be defined");i=e.buffer.slice(m,m+y),c=l(r.POSITION),u=l(r.RGB)||l(r.RGBA),f=l(r.NORMAL),d=l(r.BATCH_ID),p=l(r.RGBA)}let g;return l(i)&&(g={buffer:i,featureTableProperties:r,batchTableProperties:o,properties:Mt(r,o),dequantizeInShader:!0}),{draco:g,hasPositions:c,hasColors:u,isTranslucent:p,hasNormals:f,hasBatchIds:d}}function bat(e){let t=e.json,n;if(l(t.POSITION))return n=e.getPropertyArray("POSITION",Y.FLOAT,3),{name:ct.POSITION,semantic:ct.POSITION,typedArray:n,isQuantized:!1,componentDatatype:Y.FLOAT,type:Vt.VEC3};if(l(t.POSITION_QUANTIZED)){n=e.getPropertyArray("POSITION_QUANTIZED",Y.UNSIGNED_SHORT,3);let i=e.getGlobalProperty("QUANTIZED_VOLUME_SCALE",Y.FLOAT,3);if(!l(i))throw new oe("Global property: QUANTIZED_VOLUME_SCALE must be defined for quantized positions.");let r=65535,o=e.getGlobalProperty("QUANTIZED_VOLUME_OFFSET",Y.FLOAT,3);if(!l(o))throw new oe("Global property: QUANTIZED_VOLUME_OFFSET must be defined for quantized positions.");return{name:ct.POSITION,semantic:ct.POSITION,typedArray:n,isQuantized:!0,componentDatatype:Y.FLOAT,type:Vt.VEC3,quantizedRange:r,quantizedVolumeOffset:h.unpack(o),quantizedVolumeScale:h.unpack(i),quantizedComponentDatatype:Y.UNSIGNED_SHORT,quantizedType:Vt.VEC3}}}function xat(e){let t=e.json,n;if(l(t.RGBA))return n=e.getPropertyArray("RGBA",Y.UNSIGNED_BYTE,4),{name:ct.COLOR,semantic:ct.COLOR,setIndex:0,typedArray:n,componentDatatype:Y.UNSIGNED_BYTE,type:Vt.VEC4,normalized:!0,isRGB565:!1,isTranslucent:!0};if(l(t.RGB))return n=e.getPropertyArray("RGB",Y.UNSIGNED_BYTE,3),{name:"COLOR",semantic:ct.COLOR,setIndex:0,typedArray:n,componentDatatype:Y.UNSIGNED_BYTE,type:Vt.VEC3,normalized:!0,isRGB565:!1,isTranslucent:!1};if(l(t.RGB565))return n=e.getPropertyArray("RGB565",Y.UNSIGNED_SHORT,1),{name:"COLOR",semantic:ct.COLOR,setIndex:0,typedArray:n,componentDatatype:Y.FLOAT,type:Vt.VEC3,normalized:!1,isRGB565:!0,isTranslucent:!1};if(l(t.CONSTANT_RGBA)){let i=e.getGlobalProperty("CONSTANT_RGBA",Y.UNSIGNED_BYTE,4),r=i[3],o=z.fromBytes(i[0],i[1],i[2],r),s=r<255;return{name:ct.COLOR,semantic:ct.COLOR,setIndex:0,constantColor:o,componentDatatype:Y.FLOAT,type:Vt.VEC4,isQuantized:!1,isTranslucent:s}}}function Tat(e){let t=e.json,n;if(l(t.NORMAL))return n=e.getPropertyArray("NORMAL",Y.FLOAT,3),{name:ct.NORMAL,semantic:ct.NORMAL,typedArray:n,octEncoded:!1,octEncodedZXY:!1,componentDatatype:Y.FLOAT,type:Vt.VEC3};if(l(t.NORMAL_OCT16P))return n=e.getPropertyArray("NORMAL_OCT16P",Y.UNSIGNED_BYTE,2),{name:ct.NORMAL,semantic:ct.NORMAL,typedArray:n,octEncoded:!0,octEncodedZXY:!1,quantizedRange:(1<<8)-1,quantizedType:Vt.VEC2,quantizedComponentDatatype:Y.UNSIGNED_BYTE,componentDatatype:Y.FLOAT,type:Vt.VEC3}}function Eat(e){let t=e.json;if(l(t.BATCH_ID)){let n=e.getPropertyArray("BATCH_ID",Y.UNSIGNED_SHORT,1);return{name:ct.FEATURE_ID,semantic:ct.FEATURE_ID,setIndex:0,typedArray:n,componentDatatype:Y.fromTypedArray(n),type:Vt.SCALAR}}}var Pv=Eye;var Cat=vn.Components,vat=vn.Scene,Sat=vn.Node,wat=vn.Primitive,Iat=vn.Attribute,Cye=vn.Quantization,Pat=vn.FeatureIdAttribute,Dat=vn.Material,Rat=vn.MetallicRoughness,aZ=class extends ar{constructor(t){super(),t=t??H.EMPTY_OBJECT;let n=t.arrayBuffer,i=t.byteOffset??0;this._arrayBuffer=n,this._byteOffset=i,this._loadAttributesFor2D=t.loadAttributesFor2D??!1,this._parsedContent=void 0,this._decodePromise=void 0,this._decodedAttributes=void 0,this._promise=void 0,this._error=void 0,this._state=Ct.UNLOADED,this._buffers=[],this._components=void 0,this._transform=M.IDENTITY}get cacheKey(){}get components(){return this._components}get transform(){return this._transform}load(){if(l(this._promise))return this._promise;this._parsedContent=Pv.parse(this._arrayBuffer,this._byteOffset),this._state=Ct.PROCESSING,this._promise=Promise.resolve(this)}process(t){if(l(this._error)){let n=this._error;throw this._error=void 0,n}if(this._state===Ct.READY)return!0;if(this._state===Ct.PROCESSING){if(l(this._decodePromise))return!1;this._decodePromise=Oat(this,t.context)}return!1}unload(){let t=this._buffers;for(let n=0;n<t.length;n++)t[n].destroy();t.length=0,this._components=void 0,this._parsedContent=void 0,this._arrayBuffer=void 0}};function Oat(e,t){let i=e._parsedContent.draco,r;if(l(i)?r=uy.decodePointCloud(i,t):r=Promise.resolve(),!!l(r))return e._decodePromise=r,r.then(function(o){if(!e.isDestroyed())return l(o)&&Mat(e,i,o),Gat(e,t),e._state=Ct.READY,e}).catch(function(o){e.unload(),e._state=Ct.FAILED;let s="Failed to load Draco pnts";e._error=e.getError(s,o)})}function Mat(e,t,n){e._state=Ct.READY;let i=e._parsedContent,r;if(l(n.POSITION)){if(r={name:"POSITION",semantic:ct.POSITION,typedArray:n.POSITION.array,componentDatatype:Y.FLOAT,type:Vt.VEC3,isQuantized:!1},l(n.POSITION.data.quantization)){let a=n.POSITION.data.quantization,c=a.range,u=h.fromElements(c,c,c),f=h.unpack(a.minValues),d=(1<<a.quantizationBits)-1;r.isQuantized=!0,r.quantizedRange=d,r.quantizedVolumeOffset=f,r.quantizedVolumeScale=u,r.quantizedComponentDatatype=d<=255?Y.UNSIGNED_BYTE:Y.UNSIGNED_SHORT,r.quantizedType=Vt.VEC3}i.positions=r}if(l(n.NORMAL)){if(r={name:"NORMAL",semantic:ct.NORMAL,typedArray:n.NORMAL.array,componentDatatype:Y.FLOAT,type:Vt.VEC3,isQuantized:!1,octEncoded:!1,octEncodedZXY:!1},l(n.NORMAL.data.quantization)){let a=(1<<n.NORMAL.data.quantization.quantizationBits)-1;r.quantizedRange=a,r.octEncoded=!0,r.octEncodedZXY=!0,r.quantizedComponentDatatype=Y.UNSIGNED_BYTE,r.quantizedType=Vt.VEC2}i.normals=r}if(l(n.RGBA)?i.colors={name:"COLOR",semantic:ct.COLOR,setIndex:0,typedArray:n.RGBA.array,componentDatatype:Y.UNSIGNED_BYTE,type:Vt.VEC4,normalized:!0,isTranslucent:!0}:l(n.RGB)&&(i.colors={name:"COLOR",semantic:ct.COLOR,setIndex:0,typedArray:n.RGB.array,componentDatatype:Y.UNSIGNED_BYTE,type:Vt.VEC3,normalized:!0,isTranslucent:!1}),l(n.BATCH_ID)){let a=n.BATCH_ID.array;i.batchIds={name:"_FEATURE_ID",semantic:ct.FEATURE_ID,setIndex:0,typedArray:a,componentDatatype:Y.fromTypedArray(a),type:Vt.SCALAR}}let o=i.batchTableJson,s=t.batchTableProperties;for(let a in s)if(s.hasOwnProperty(a)){let c=n[a];l(o)||(o={}),i.hasDracoBatchTable=!0;let u=c.data;o[a]={byteOffset:u.byteOffset,type:Nat(u.componentsPerAttribute),componentType:Lat(u.componentDatatype),typedArray:c.array}}i.batchTableJson=o}function Nat(e){switch(e){case 1:return"SCALAR";case 2:return"VEC2";case 3:return"VEC3";case 4:return"VEC4"}}function Lat(e){switch(e){case te.BYTE:return"BYTE";case te.UNSIGNED_BYTE:return"UNSIGNED_BYTE";case te.SHORT:return"SHORT";case te.UNSIGNED_SHORT:return"UNSIGNED_SHORT";case te.INT:return"INT";case te.UNSIGNED_INT:return"UNSIGNED_INT";case te.DOUBLE:return"DOUBLE";case te.FLOAT:return"FLOAT"}}function i1(e,t,n){let i=t.typedArray,r;if(t.octEncoded&&(r=new Cye,r.octEncoded=t.octEncoded,r.octEncodedZXY=t.octEncodedZXY,r.normalizationRange=t.quantizedRange,r.type=t.quantizedType,r.componentDatatype=t.quantizedComponentDatatype),t.isQuantized){r=new Cye;let a=t.quantizedRange;r.normalizationRange=a,r.quantizedVolumeOffset=h.ZERO;let c=t.quantizedVolumeScale;r.quantizedVolumeDimensions=c,r.quantizedVolumeStepSize=h.divideByScalar(c,a,new h),r.componentDatatype=t.quantizedComponentDatatype,r.type=t.quantizedType}let o=new Iat;if(o.name=t.name,o.semantic=t.semantic,o.setIndex=t.setIndex,o.componentDatatype=t.componentDatatype,o.type=t.type,o.normalized=t.normalized??!1,o.min=t.min,o.max=t.max,o.quantization=r,t.isRGB565&&(i=cn.decodeRGB565(i)),l(t.constantColor)){let a=new Array(4);o.constant=z.pack(t.constantColor,a)}else{let a=tt.createVertexBuffer({typedArray:i,context:n,usage:Me.STATIC_DRAW});a.vertexArrayDestroyable=!1,e._buffers.push(a),o.buffer=a}let s=e._loadAttributesFor2D;return o.semantic===ct.POSITION&&s&&(o.typedArray=i),o}var vye,YV;function Fat(e){if(!l(YV)){vye=new Sye.default(0),YV=new Array(e);for(let t=0;t<e;++t)YV[t]=vye.random()}return YV}var Bat=new h,kat=new h,Uat=new h;function zat(e){let t=e.typedArray,n=20,i=t.length/3,r=Math.min(i,n),o=Fat(n),s=Number.MAX_VALUE,a=-Number.MAX_VALUE,c=h.fromElements(s,s,s,Bat),u=h.fromElements(a,a,a,kat),f,d,p;if(e.isQuantized)c=h.ZERO,u=e.quantizedVolumeScale;else for(f=0;f<r;++f)d=Math.floor(o[f]*i),p=h.unpack(t,d*3,Uat),h.minimumByComponent(c,p,c),h.maximumByComponent(u,p,u);e.min=h.clone(c),e.max=h.clone(u)}var Vat={name:ct.COLOR,semantic:ct.COLOR,setIndex:0,constantColor:z.DARKGRAY,componentDatatype:Y.FLOAT,type:Vt.VEC4,isQuantized:!1,isTranslucent:!1};function jat(e,t,n){let i=[],r,o=t.positions;return l(o)&&(zat(o),r=i1(e,o,n),r.count=t.pointsLength,i.push(r)),l(t.normals)&&(r=i1(e,t.normals,n),r.count=t.pointsLength,i.push(r)),l(t.colors)?(r=i1(e,t.colors,n),r.count=t.pointsLength,i.push(r)):(r=i1(e,Vat,n),r.count=t.pointsLength,i.push(r)),l(t.batchIds)&&(r=i1(e,t.batchIds,n),r.count=t.pointsLength,i.push(r)),i}function Hat(e,t){let n=e.batchLength,i=e.pointsLength,r=e.batchTableJson,o=e.batchTableBinary,s=!l(e.batchIds);return l(o)||l(r)||e.hasDracoBatchTable?Sy({count:n??i,batchTable:r,binaryBody:o,parseAsPropertyAttributes:s,customAttributeOutput:t}):new Qa({schema:{},propertyTables:[]})}function Gat(e,t){let n=e._parsedContent,i=new Rat;i.metallicFactor=0,i.roughnessFactor=.9;let r=new Dat;r.metallicRoughness=i;let o=n.colors;l(o)&&o.isTranslucent&&(r.alphaMode=Q0.BLEND);let s=!l(n.normals);r.unlit=s;let a=new wat;if(a.attributes=jat(e,n,t),a.primitiveType=Oe.POINTS,a.material=r,l(n.batchIds)){let g=new Pat;g.propertyTableId=0,g.setIndex=0,g.positionalLabel="featureId_0",a.featureIds.push(g)}let c=new Sat;c.index=0,c.primitives=[a];let u=new vat;u.nodes=[c],u.upAxis=qi.Z,u.forwardAxis=qi.X;let f=new Cat;f.scene=u,f.nodes=[c];let d=[];f.structuralMetadata=Hat(n,d),d.length>0&&Wat(e,a,d,t),l(n.rtcCenter)&&(f.transform=M.multiplyByTranslation(f.transform,n.rtcCenter,f.transform));let p=n.positions;l(p)&&p.isQuantized&&(f.transform=M.multiplyByTranslation(f.transform,p.quantizedVolumeOffset,f.transform)),e._components=f,e._parsedContent=void 0,e._arrayBuffer=void 0}function Wat(e,t,n,i){let r=t.attributes,o=n.length;for(let s=0;s<o;s++){let a=n[s],c=tt.createVertexBuffer({typedArray:a.typedArray,context:i,usage:Me.STATIC_DRAW});c.vertexArrayDestroyable=!1,e._buffers.push(c),a.buffer=c,a.typedArray=void 0,r.push(a)}t.propertyAttributeIds=[0]}var XV=aZ;var KV=new h,wye=new h,Iye=new h,r1=new h,qat=new h,Yat=new h,Xat=new he,Kat=new ue;function $V(e,t,n,i){let r=t*n;return i.x=e[r],i.y=e[r+1],i.z=e[r+2],i}var $at=32,cZ=new Map,lZ=[];function Jat(e,t,n,i,r,o){let s=e.origin.x,a=e.origin.y,c=e.origin.z,u=e.direction.x,f=e.direction.y,d=e.direction.z,p=P.EPSILON6;for(let g=0;g<i;g+=3){let m=n[g]*3,y=n[g+1]*3,A=n[g+2]*3,b=t[m],x=t[m+1],T=t[m+2],E=t[y]-b,v=t[y+1]-x,S=t[y+2]-T,I=t[A]-b,R=t[A+1]-x,O=t[A+2]-T,L=f*O-d*R,_=d*I-u*O,C=u*R-f*I,w=E*L+v*_+S*C,D=s-b,N=a-x,F=c-T,V;if(r){if(w<p)continue;let B=D*L+N*_+F*C;if(B<0||B>w)continue;let j=N*S-F*v,k=F*E-D*S,G=D*v-N*E,q=u*j+f*k+d*G;if(q<0||B+q>w)continue;V=(I*j+R*k+O*G)/w}else{if(Math.abs(w)<p)continue;let B=1/w,j=(D*L+N*_+F*C)*B;if(j<0||j>1)continue;let k=N*S-F*v,G=F*E-D*S,q=D*v-N*E,Q=(u*k+f*G+d*q)*B;if(Q<0||j+Q>1)continue;V=(I*k+R*G+O*q)*B}V>=0&&V<o&&(o=V)}return o}function o1(e,t,n,i,r,o,s){if(!e._ready||n.mode===re.MORPHING)return;let a=Number.MAX_VALUE;o=o??ee.default,i=i??1,r=r??0;let c=n.mode!==re.SCENE3D?n.mapProjection:void 0;if(Na.forEachPrimitive(e,{mapProjection:c},function(u,f,d,p){if(l(u.boundingSphere)&&d.length===1){let T=ue.transform(u.boundingSphere,p,Kat),E=xi.raySphere(t,T);if(!l(E))return}if(!l(f.indices))return;let g,m,y=xt.getAttributeBySemantic(f,ct.POSITION),A=cZ.get(f);l(A)||(A={},l(y)&&(A.vertices=Na.readAttributeAsTypedArray(y)),l(f.indices)&&(A.indices=Na.readIndicesAsTypedArray(f.indices)),cZ.set(f,A),lZ.push(f),lZ.length>$at&&cZ.delete(lZ.shift())),l(y)&&(m=Vt.getNumberOfComponents(y.type),g=A.vertices);let b=A.indices;if(!l(b)||!l(g))return;let x=b.length;if(d.length===1&&i===1){let T=d[0].transform;if(!l(A.world)||!M.equals(A.worldTransform,T)){let I=g.length/m,R=new Float64Array(I*3);for(let O=0;O<I;O++)$V(g,O,m,KV),M.multiplyByPoint(T,KV,r1),R[O*3]=r1.x,R[O*3+1]=r1.y,R[O*3+2]=r1.z;A.world=R,A.worldTransform=M.clone(T,A.worldTransform)}let E=A.world,v=e.backFaceCulling??!0,S=Jat(t,E,b,x,v,a);S<a&&(a=S);return}for(let T=0;T<x;T+=3){let E=b[T],v=b[T+1],S=b[T+2];$V(g,E,m,KV),$V(g,v,m,wye),$V(g,S,m,Iye);for(let I of d){let R=M.multiplyByPoint(I.transform,KV,r1),O=M.multiplyByPoint(I.transform,wye,qat),L=M.multiplyByPoint(I.transform,Iye,Yat);i!==1&&(br.getPosition(R,o,i,r,R),br.getPosition(O,o,i,r,O),br.getPosition(L,o,i,r,L));let _=xi.rayTriangleParametric(t,R,O,L,e.backFaceCulling??!0);l(_)&&_<a&&_>=0&&(a=_)}}}),a!==Number.MAX_VALUE){if(s=gn.getPoint(t,a,s),n.mode!==re.SCENE3D){h.fromElements(s.y,s.z,s.x,s);let u=n.mapProjection,f=u.ellipsoid,d=u.unproject(s,Xat);f.cartographicToCartesian(d,s)}return s}}var uZ=class{constructor(t){this.show=t.show,this.alpha=t.alpha,this.brightness=t.brightness,this.contrast=t.contrast,this.hue=t.hue,this.saturation=t.saturation,this.gamma=t.gamma,this.colorToAlpha=t.colorToAlpha}},JV=uZ;var fZ=class{constructor(t){this._model=t,this._modelPrimitiveImageries=void 0,this._imageryConfigurations=[]}update(t){if(!this._hasImagery){this._deleteModelPrimitiveImageries();return}this._allImageryLayersReady&&(l(this._modelPrimitiveImageries)||(this._modelPrimitiveImageries=this._createModelPrimitiveImageries()),this._updateModelPrimitiveImageries(t),this._checkForModifiedImageryConfigurations())}_createModelPrimitiveImageries(){let t=this._model,n=this._collectRuntimeNodesAndPrimitives(),i=[],r=n.length;for(let o=0;o<r;o++){let s=n[o],a=s.runtimeNode,c=s.runtimePrimitive,u=new Sv(t,a,c);c.primitive.modelPrimitiveImagery=u,i.push(u)}return i}_collectRuntimeNodesAndPrimitives(){let i=this._model.sceneGraph._runtimeNodes,r=[];for(let o=0;o<i.length;o++){let s=i[o];if(l(s))for(let a=0;a<s.runtimePrimitives.length;a++){let c=s.runtimePrimitives[a];r.push({runtimeNode:s,runtimePrimitive:c})}}return r}_updateModelPrimitiveImageries(t){if(!l(this._modelPrimitiveImageries))throw new pe("The modelPrimitiveImageries have not been created");let n=this._modelPrimitiveImageries,i=n.length;for(let r=0;r<i;r++)n[r].update(t)}_deleteModelPrimitiveImageries(){let t=this._modelPrimitiveImageries;if(!l(t))return;let n=t.length;for(let i=0;i<n;i++)t[i].destroy();delete this._modelPrimitiveImageries,this._model.resetDrawCommands()}get ready(){return this._hasImagery?!(!this._allImageryLayersReady||!this._allModelPrimitiveImageriesReady):!0}get _hasImagery(){let n=this._model.imageryLayers;return l(n)&&n.length>0}get _allImageryLayersReady(){if(!this._hasImagery)return!0;let t=this._model.imageryLayers,n=t.length;for(let i=0;i<n;i++)if(!t.get(i).ready)return!1;return!0}get _allModelPrimitiveImageriesReady(){let t=this._modelPrimitiveImageries;if(!l(t))return!1;let n=t.length;for(let i=0;i<n;i++)if(!t[i].ready)return!1;return!0}_checkForModifiedImageryConfigurations(){this._imageryConfigurationsModified()&&(this._updateImageryConfigurations(),this._model.resetDrawCommands())}_imageryConfigurationsModified(){let n=this._model.imageryLayers,i=this._imageryConfigurations;if(n.length!==i.length)return!0;for(let r=0;r<n.length;r++){let o=n.get(r),s=i[r];if(o.show!==s.show||o.alpha!==s.alpha||o.brightness!==s.brightness||o.contrast!==s.contrast||o.hue!==s.hue||o.saturation!==s.saturation||o.gamma!==s.gamma||o.colorToAlpha!==s.colorToAlpha)return!0}return!1}_updateImageryConfigurations(){let n=this._model.imageryLayers,i=this._imageryConfigurations;i.length=n.length;for(let r=0;r<n.length;r++){let o=n.get(r);i[r]=new JV(o)}}isDestroyed(){return!1}destroy(){if(!this.isDestroyed())return this._deleteModelPrimitiveImageries(),le(this)}},ZV=fZ;function xr(e){e=e??H.EMPTY_OBJECT,this._loader=e.loader,this._resource=e.resource,this.type=e.type??Jo.GLTF,this.modelMatrix=M.clone(e.modelMatrix??M.IDENTITY),this._modelMatrix=M.clone(this.modelMatrix),this._scale=e.scale??1,this._minimumPixelSize=e.minimumPixelSize??0,this._maximumScale=e.maximumScale,this._clampedScale=l(this._maximumScale)?Math.min(this._scale,this._maximumScale):this._scale,this._computedScale=this._clampedScale,this._updateModelMatrix=!1,this.referenceMatrix=void 0,this._iblReferenceFrameMatrix=$.clone($.IDENTITY),this._clippingPlanesMatrix=M.clone(M.IDENTITY),this._resourcesLoaded=!1,this._drawCommandsBuilt=!1,this._ready=!1,this._customShader=e.customShader,this._content=e.content,this._texturesLoaded=!1,this._defaultTexture=void 0,this._activeAnimations=new BU(this),this._clampAnimations=e.clampAnimations??!0,this._userAnimationDirty=!1,this._id=e.id,this._idDirty=!1,this._color=z.clone(e.color),this._colorBlendMode=e.colorBlendMode??Nl.HIGHLIGHT,this._colorBlendAmount=e.colorBlendAmount??.5;let t=e.silhouetteColor??z.RED;this._silhouetteColor=z.clone(t),this._silhouetteSize=e.silhouetteSize??0,this._silhouetteDirty=!1,this._silhouetteId=void 0,this._cull=e.cull??!0,this._opaquePass=e.opaquePass??Ie.OPAQUE,this._allowPicking=e.allowPicking??!0,this._show=e.show??!0,this._style=void 0,this._styleDirty=!1,this._styleCommandsNeeded=void 0;let n=e.featureIdLabel??"featureId_0";typeof n=="number"&&(n=`featureId_${n}`),this._featureIdLabel=n;let i=e.instanceFeatureIdLabel??"instanceFeatureId_0";typeof i=="number"&&(i=`instanceFeatureId_${i}`),this._instanceFeatureIdLabel=i,this._featureTables=[],this._featureTableId=void 0,this._featureTableIdDirty=!0,this._pipelineResources=[],this._modelResources=[],this._pickIds=[],this._boundingSphere=new ue,this._initialRadius=void 0,this._heightReference=e.heightReference??We.NONE,this._heightDirty=this._heightReference!==We.NONE,this._removeUpdateHeightCallback=void 0,this._enableVerticalExaggeration=e.enableVerticalExaggeration??!0,this._hasVerticalExaggeration=!1,this._clampedModelMatrix=void 0,this._heightAboveSurface=void 0,this._lastSurfaceHeight=void 0,this._lastSurfaceQueryFrame=-1,this._lastSurfaceQueryMissed=!1;let r=e.scene;l(r)&&l(r.terrainProviderChanged)&&(this._terrainProviderChangedCallback=r.terrainProviderChanged.addEventListener(()=>{this._heightDirty=!0})),this._scene=r,this._distanceDisplayCondition=e.distanceDisplayCondition;let o=new ng(e.pointCloudShading);this._pointCloudShading=o,this._attenuation=o.attenuation,this._pointCloudBackFaceCulling=o.backFaceCulling;let s=e.clippingPlanes;l(s)&&s.owner===void 0?Ps.setOwner(s,this,"_clippingPlanes"):this._clippingPlanes=s,this._clippingPlanesState=0;let a=e.clippingPolygons;l(a)&&a.owner===void 0?Zc.setOwner(a,this,"_clippingPolygons"):this._clippingPolygons=a,this._clippingPolygonsState=0,this._clippingPolygonsNeedRebake=!1,this._removeClippingPolygonAdded=void 0,this._removeClippingPolygonRemoved=void 0,Rye(this),this._vectorData=void 0,this._vectorLookupFlags=0,this._clippingPolygonData=void 0,this._rectangle=new ie,this._modelImagery=new ZV(this),this._lightColor=h.clone(e.lightColor),this._imageBasedLighting=l(e.imageBasedLighting)?e.imageBasedLighting:new CC,this._shouldDestroyImageBasedLighting=!l(e.imageBasedLighting),this._environmentMapManager=void 0;let c=new Ty(e.environmentMapOptions);Ty.setOwner(c,this,"_environmentMapManager"),this._backFaceCulling=e.backFaceCulling??!0,this._backFaceCullingDirty=!1,this._shadows=e.shadows??Dn.ENABLED,this._shadowsDirty=!1,this._debugShowBoundingVolumeDirty=!1,this._debugShowBoundingVolume=e.debugShowBoundingVolume??!1,this._enableDebugWireframe=e.enableDebugWireframe??!1,this._enableShowOutline=e.enableShowOutline??!0,this._debugWireframe=e.debugWireframe??!1,this._edgeDisplayMode=e.edgeDisplayMode??Rh.SURFACES_ONLY,this._debugWireframe===!0&&this._enableDebugWireframe===!1&&this.type===Jo.GLTF&&yt("model-debug-wireframe-ignored","enableDebugWireframe must be set to true in Model.fromGltf, otherwise debugWireframe will be ignored.");let u=e.credit;typeof u=="string"&&(u=new It(u)),this._credits=[],this._credit=u,this._resourceCredits=[],this._gltfCredits=[],this._showCreditsOnScreen=e.showCreditsOnScreen??!1,this._showCreditsOnScreenDirty=!0,this._splitDirection=e.splitDirection??Wo.NONE,this._enableShowOutline=e.enableShowOutline??!0,this.showOutline=e.showOutline??!0,this.outlineColor=e.outlineColor??z.BLACK,this._classificationType=e.classificationType,this._statistics=new qV,this._sceneMode=void 0,this._projectTo2D=e.projectTo2D??!1,this._enablePick=e.enablePick??!1,this._fogRenderable=void 0,this._skipLevelOfDetail=!1,this._ignoreCommands=e.ignoreCommands??!1,this._errorEvent=new be,this._readyEvent=new be,this._texturesReadyEvent=new be,this._sceneGraph=void 0,this._nodesByName={},this.pickObject=e.pickObject}function dZ(e,t){if(e._errorEvent.numberOfListeners>0){e._errorEvent.raiseEvent(t);return}console.log(t)}function Zat(e,t){let n=e._featureTables,i=t.propertyTables,r=i.length;for(let o=0;o<r;o++){let s=i[o],a=new UU({model:e,propertyTable:s});n.push(a)}return n}function Qat(e,t){let n=t._featureIdLabel,i=t._instanceFeatureIdLabel,r,o,s,a;for(r=0;r<e.nodes.length;r++)if(a=e.nodes[r],l(a.instances)&&(s=xt.getFeatureIdsByLabel(a.instances.featureIds,i),l(s)&&l(s.propertyTableId)))return s.propertyTableId;for(r=0;r<e.nodes.length;r++)for(a=e.nodes[r],o=0;o<a.primitives.length;o++){let c=a.primitives[o],u=xt.getFeatureIdsByLabel(c.featureIds,n);if(l(u))return u.propertyTableId}if(t._featureTables.length===1)return 0}function pZ(e,t){if(!l(e)&&!l(t))return!1;if(l(e)!==l(t))return!0;let n=e.alpha,i=t.alpha;return Math.floor(n)!==Math.floor(i)||Math.ceil(n)!==Math.ceil(i)}Object.defineProperties(xr.prototype,{ready:{get:function(){return this._ready}},errorEvent:{get:function(){return this._errorEvent}},readyEvent:{get:function(){return this._readyEvent}},incrementallyLoadTextures:{get:function(){return this._loader.incrementallyLoadTextures??!1}},texturesReadyEvent:{get:function(){return this._texturesReadyEvent}},loader:{get:function(){return this._loader}},statistics:{get:function(){return this._statistics}},activeAnimations:{get:function(){return this._activeAnimations}},clampAnimations:{get:function(){return this._clampAnimations},set:function(e){this._clampAnimations=e}},cull:{get:function(){return this._cull}},opaquePass:{get:function(){return this._opaquePass}},pointCloudShading:{get:function(){return this._pointCloudShading},set:function(e){e!==this._pointCloudShading&&this.resetDrawCommands(),this._pointCloudShading=e}},customShader:{get:function(){return this._customShader},set:function(e){e!==this._customShader&&this.resetDrawCommands(),this._customShader=e}},sceneGraph:{get:function(){return this._sceneGraph}},content:{get:function(){return this._content}},heightReference:{get:function(){return this._heightReference},set:function(e){e!==this._heightReference&&(this._heightDirty=!0),this._heightReference=e}},distanceDisplayCondition:{get:function(){return this._distanceDisplayCondition},set:function(e){this._distanceDisplayCondition=Gt.clone(e,this._distanceDisplayCondition)}},structuralMetadata:{get:function(){return this._sceneGraph.components.structuralMetadata}},featureTableId:{get:function(){return this._featureTableId},set:function(e){this._featureTableId=e}},featureTables:{get:function(){return this._featureTables},set:function(e){this._featureTables=e}},id:{get:function(){return this._id},set:function(e){e!==this._id&&(this._idDirty=!0),this._id=e}},allowPicking:{get:function(){return this._allowPicking}},style:{get:function(){return this._style},set:function(e){this._style=e,this._styleDirty=!0}},color:{get:function(){return this._color},set:function(e){pZ(e,this._color)&&this.resetDrawCommands(),this._color=z.clone(e,this._color)}},colorBlendMode:{get:function(){return this._colorBlendMode},set:function(e){this._colorBlendMode=e}},colorBlendAmount:{get:function(){return this._colorBlendAmount},set:function(e){this._colorBlendAmount=e}},silhouetteColor:{get:function(){return this._silhouetteColor},set:function(e){if(!z.equals(e,this._silhouetteColor)){let t=pZ(e,this._silhouetteColor);this._silhouetteDirty=this._silhouetteDirty||t}this._silhouetteColor=z.clone(e,this._silhouetteColor)}},silhouetteSize:{get:function(){return this._silhouetteSize},set:function(e){if(e!==this._silhouetteSize){let t=this._silhouetteSize,n=e>0&&t===0||e===0&&t>0;this._silhouetteDirty=this._silhouetteDirty||n,this._backFaceCullingDirty=this._backFaceCullingDirty||n}this._silhouetteSize=e}},heightAboveSurface:{get:function(){return this._heightAboveSurface}},boundingSphere:{get:function(){let e=l(this._clampedModelMatrix)?this._clampedModelMatrix:this.modelMatrix;return Mye(this,e),this._boundingSphere}},debugShowBoundingVolume:{get:function(){return this._debugShowBoundingVolume},set:function(e){this._debugShowBoundingVolume!==e&&(this._debugShowBoundingVolumeDirty=!0),this._debugShowBoundingVolume=e}},debugWireframe:{get:function(){return this._debugWireframe},set:function(e){this._debugWireframe!==e&&this.resetDrawCommands(),this._debugWireframe=e,this._debugWireframe===!0&&this._enableDebugWireframe===!1&&this.type===Jo.GLTF&&yt("model-debug-wireframe-ignored","enableDebugWireframe must be set to true in Model.fromGltfAsync, otherwise debugWireframe will be ignored.")}},edgeDisplayMode:{get:function(){return this._edgeDisplayMode},set:function(e){this._edgeDisplayMode=e}},show:{get:function(){return this._show},set:function(e){this._show=e}},featureIdLabel:{get:function(){return this._featureIdLabel},set:function(e){typeof e=="number"&&(e=`featureId_${e}`),e!==this._featureIdLabel&&(this._featureTableIdDirty=!0),this._featureIdLabel=e}},instanceFeatureIdLabel:{get:function(){return this._instanceFeatureIdLabel},set:function(e){typeof e=="number"&&(e=`instanceFeatureId_${e}`),e!==this._instanceFeatureIdLabel&&(this._featureTableIdDirty=!0),this._instanceFeatureIdLabel=e}},clippingPlanes:{get:function(){return this._clippingPlanes},set:function(e){e!==this._clippingPlanes&&(Ps.setOwner(e,this,"_clippingPlanes"),this.resetDrawCommands())}},clippingPolygons:{get:function(){return this._clippingPolygons},set:function(e){e!==this._clippingPolygons&&(Zc.setOwner(e,this,"_clippingPolygons"),Rye(this),this.resetDrawCommands(),this._clippingPolygonsState=0,this._clippingPolygonsNeedRebake=!0,l(this._clippingPolygonData)&&(Zc.releaseRectangleData(this._clippingPolygonData),this._clippingPolygonData=void 0))}},enableVerticalExaggeration:{get:function(){return this._enableVerticalExaggeration},set:function(e){e!==this._enableVerticalExaggeration&&this.resetDrawCommands(),this._enableVerticalExaggeration=e}},hasVerticalExaggeration:{get:function(){return this._hasVerticalExaggeration}},imageryLayers:{get:function(){if(l(this._content)){let e=this._content.tileset;if(l(e))return e.imageryLayers}}},lightColor:{get:function(){return this._lightColor},set:function(e){l(e)!==l(this._lightColor)&&this.resetDrawCommands(),this._lightColor=h.clone(e,this._lightColor)}},imageBasedLighting:{get:function(){return this._imageBasedLighting},set:function(e){e!==this._imageBasedLighting&&(this._shouldDestroyImageBasedLighting&&!this._imageBasedLighting.isDestroyed()&&this._imageBasedLighting.destroy(),this._imageBasedLighting=e,this._shouldDestroyImageBasedLighting=!1,this.resetDrawCommands())}},environmentMapManager:{get:function(){return this._environmentMapManager},set:function(e){e!==this.environmentMapManager&&(Ty.setOwner(e,this,"_environmentMapManager"),this.resetDrawCommands())}},backFaceCulling:{get:function(){return this._backFaceCulling},set:function(e){e!==this._backFaceCulling&&(this._backFaceCullingDirty=!0),this._backFaceCulling=e}},scale:{get:function(){return this._scale},set:function(e){e!==this._scale&&(this._updateModelMatrix=!0),this._scale=e}},computedScale:{get:function(){return this._computedScale}},minimumPixelSize:{get:function(){return this._minimumPixelSize},set:function(e){e!==this._minimumPixelSize&&(this._updateModelMatrix=!0),this._minimumPixelSize=e}},maximumScale:{get:function(){return this._maximumScale},set:function(e){e!==this._maximumScale&&(this._updateModelMatrix=!0),this._maximumScale=e}},shadows:{get:function(){return this._shadows},set:function(e){e!==this._shadows&&(this._shadowsDirty=!0),this._shadows=e}},credit:{get:function(){return this._credit}},showCreditsOnScreen:{get:function(){return this._showCreditsOnScreen},set:function(e){this._showCreditsOnScreen!==e&&(this._showCreditsOnScreenDirty=!0),this._showCreditsOnScreen=e}},splitDirection:{get:function(){return this._splitDirection},set:function(e){this._splitDirection!==e&&this.resetDrawCommands(),this._splitDirection=e}},classificationType:{get:function(){return this._classificationType}},pickIds:{get:function(){return this._pickIds}},styleCommandsNeeded:{get:function(){return this._styleCommandsNeeded}}});xr.prototype.getRectangle=function(e){let t=this._content?.tile?.contentBoundingVolume;return l(t?.rectangle)?t.rectangle:(e=e??this._scene?.ellipsoid??ee.default,ie.fromBoundingSphere(this.boundingSphere,e,this._rectangle))};xr.prototype.getNode=function(e){return this._nodesByName[e]};xr.prototype.setArticulationStage=function(e,t){this._sceneGraph.setArticulationStage(e,t)};xr.prototype.applyArticulations=function(){this._sceneGraph.applyArticulations()};xr.prototype.getExtension=function(e){return this._loader.components.extensions[e]};xr.prototype.makeStyleDirty=function(){this._styleDirty=!0};xr.prototype.resetDrawCommands=function(){this._drawCommandsBuilt=!1};var ect=new M,tct=new $,nct=new M;xr.prototype.update=function(e){let t=!1;try{t=ict(this,e)}catch(i){if(!this._loader.incrementallyLoadTextures&&i.name==="TextureError")dZ(this,i);else{let r=xt.getError("model",this._resource,i);dZ(this,r)}}if(rct(this,e),oct(this,e),sct(this,e),!this._resourcesLoaded&&t){this._resourcesLoaded=!0;let i=this._loader.components;if(!l(i)){if(this._loader.isUnloaded())return;let s=xt.getError("model",this._resource,new oe("Failed to load model."));dZ(s),this._rejectLoad=this._rejectLoad&&this._rejectLoad(s)}let r=i.structuralMetadata;l(r)&&r.propertyTableCount>0&&Zat(this,r);let o=new WV({model:this,modelComponents:i});this._sceneGraph=o,this._gltfCredits=o.components.asset.credits}if(!this._resourcesLoaded||e.mode===re.MORPHING)return;let n=this._modelImagery;if(n.update(e),!(!n.ready&&!(this._content?.tileset?._asynchronouslyLoadImagery??!1))){if(act(this),cct(this),lct(this,e),uct(this),fct(this,e),dct(this,e),hct(this,e),mct(this,e),_ct(this,e),yct(this,e),Act(this,e),bct(this,e),this._defaultTexture=e.context.defaultTexture,xct(this,e),Ect(this,e),Sct(this),wct(this,e),Rct(this,e),!this._ready){e.afterRender.push(()=>{this._ready=!0,this._readyEvent.raiseEvent(this)});return}this._loader.incrementallyLoadTextures&&!this._texturesLoaded&&this._loader.texturesLoaded&&(this.resetDrawCommands(),this._texturesLoaded=!0,this._texturesReadyEvent.raiseEvent(this)),Pct(this),Oct(this,e),Mct(this),Lct(this,e)}};function ict(e,t){return!e._resourcesLoaded||e._loader.incrementallyLoadTextures&&!e._texturesLoaded?(t.afterRender.push(()=>!0),e._loader.process(t)):!0}function rct(e,t){l(e._customShader)&&e._customShader.update(t)}function oct(e,t){let n=e._environmentMapManager,i=t.passes.pick||t.passes.pickVoxel;e._ready&&n.owner===e&&!i&&(n.position=e._boundingSphere.center,n.shouldUpdate=!l(e._imageBasedLighting.sphericalHarmonicCoefficients)||!l(e._imageBasedLighting.specularEnvironmentMaps),n.update(t),n.shouldRegenerateShaders&&e.resetDrawCommands())}function sct(e,t){e._imageBasedLighting.update(t),e._imageBasedLighting.shouldRegenerateShaders&&e.resetDrawCommands()}function act(e){if(!e._featureTableIdDirty)return;e._featureTableIdDirty=!1;let t=e._sceneGraph.components,n=t.structuralMetadata;l(n)&&n.propertyTableCount>0&&(e.featureTableId=Qat(t,e),e._styleDirty=!0,e.resetDrawCommands())}function cct(e){e._styleDirty&&(e.applyStyle(e._style),e._styleDirty=!1)}function lct(e,t){let n=e._featureTables,i=n.length,r=!1;for(let o=0;o<i;o++)n[o].update(t),n[o].styleCommandsNeededDirty&&(r=!0);r&&Dye(e)}function Dye(e){let t=e.featureTables[e.featureTableId];e._styleCommandsNeeded=_p.getStyleCommandsNeeded(t.featuresLength,t.batchTexture.translucentFeaturesLength)}function uct(e){let t=e.pointCloudShading;t.attenuation!==e._attenuation&&(e.resetDrawCommands(),e._attenuation=t.attenuation),t.backFaceCulling!==e._pointCloudBackFaceCulling&&(e.resetDrawCommands(),e._pointCloudBackFaceCulling=t.backFaceCulling)}function fct(e,t){e._silhouetteDirty&&(Lye(t)&&e.resetDrawCommands(),e._silhouetteDirty=!1)}function dct(e,t){let n=e.hasSkipLevelOfDetail(t);n!==e._skipLevelOfDetail&&(e.resetDrawCommands(),e._skipLevelOfDetail=n)}function hct(e,t){let n=0;e.isClippingEnabled()&&(e._clippingPlanes.owner===e&&e._clippingPlanes.update(t),n=e._clippingPlanes.clippingPlanesState),n!==e._clippingPlanesState&&(e.resetDrawCommands(),e._clippingPlanesState=n)}function Rye(e){e._removeClippingPolygonAdded=e._removeClippingPolygonAdded&&e._removeClippingPolygonAdded(),e._removeClippingPolygonRemoved=e._removeClippingPolygonRemoved&&e._removeClippingPolygonRemoved();let t=e._clippingPolygons;if(!l(t)||t.owner!==e)return;let n=()=>{e._clippingPolygonsNeedRebake=!0};e._removeClippingPolygonAdded=t.polygonAdded.addEventListener(n),e._removeClippingPolygonRemoved=t.polygonRemoved.addEventListener(n)}function mct(e,t){let n=e._clippingPolygons,i=e.isClippingPolygonsEnabled(),r=0;i&&(n.owner===e&&n.update(t),r=n.clippingPolygonsState),r!==e._clippingPolygonsState&&(e.resetDrawCommands(),e._clippingPolygonsState=r);let o=(e._clippingPolygonData?.polygonRings.length??0)>0;if(e._clippingPolygonsNeedRebake&&(e._clippingPolygonsNeedRebake=!1,l(e._clippingPolygonData)&&(Zc.releaseRectangleData(e._clippingPolygonData),e._clippingPolygonData=void 0)),!i||!e._ready)return;l(e._clippingPolygonData)||(e._clippingPolygonData=n.requestRectangleData(e.getRectangle(n.ellipsoid),t.context));let s=(e._clippingPolygonData?.polygonRings.length??0)>0;o!==s&&e.resetDrawCommands()}var pct=new ie;function Oye(e){l(e._vectorData)&&(e._scene?.vectorProvider?.releaseTileData(e._vectorData),e._vectorData=void 0)}function gct(e){if(e?.show!==!0)return 0;let t=1;return t|=e.hasPolylines?2:0,t|=e.hasPolygons?4:0,t}function _ct(e,t){let n=e._scene?.vectorProvider;if(l(n)&&l(e._content)&&e.ready&&t.mode===re.SCENE3D){let o=e._content?.tile?.contentBoundingVolume.rectangle??ie.fromBoundingSphere(e.boundingSphere,n.ellipsoid,pct);e._vectorData=l(e._vectorData)?n.updateDataForRectangle(o,t.context,e._vectorData,We.CLAMP_TO_3D_TILE):n.requestDataForRectangle(o,t.context,We.CLAMP_TO_3D_TILE)}else Oye(e);let r=gct(e._vectorData);r!==e._vectorLookupFlags&&(e.resetDrawCommands(),e._vectorLookupFlags=r)}function yct(e,t){t.mode!==e._sceneMode&&(e._projectTo2D?e.resetDrawCommands():e._updateModelMatrix=!0,e._sceneMode=t.mode)}function Act(e,t){let n=t.fog.enabled&&t.fog.renderable;n!==e._fogRenderable&&(e.resetDrawCommands(),e._fogRenderable=n)}function bct(e,t){if(e.enableVerticalExaggeration){let n=t.verticalExaggeration!==1;e.hasVerticalExaggeration!==n&&(e.resetDrawCommands(),e._hasVerticalExaggeration=n)}else e.hasVerticalExaggeration&&(e.resetDrawCommands(),e._hasVerticalExaggeration=!1)}function xct(e,t){e._drawCommandsBuilt||(e.destroyPipelineResources(),e._sceneGraph.buildDrawCommands(t),e._drawCommandsBuilt=!0)}function Tct(e,t){if(e===t)return!0;if(!l(e)||!l(t))return!1;for(let n=0;n<16;n++)if(e[n]!==t[n])return!1;return!0}function gZ(e,t){if(!l(e)||!l(t))return M.clone(e,t);for(let n=0;n<16;n++)t[n]=e[n];return t}function Ect(e,t){Tct(e.modelMatrix,e._modelMatrix)||(e._updateModelMatrix=!0,e._modelMatrix=gZ(e.modelMatrix,e._modelMatrix))}var My=new h,hZ=new he,Cct=new he,vct=200,Pye=30;function Sct(e){let t=e.heightReference!==We.NONE&&l(e._scene)&&e._scene.frameState.frameNumber-e._lastSurfaceQueryFrame>=Pye;if(!e._updateModelMatrix&&!e._heightDirty&&e._minimumPixelSize===0&&!t)return;if(!e._updateModelMatrix&&!e._heightDirty&&l(e._removeUpdateHeightCallback)&&!t){e._updateModelMatrix=!0;return}let n=e._scene;if(!l(n)||e.heightReference===We.NONE){l(e._removeUpdateHeightCallback)&&(e._removeUpdateHeightCallback(),e._removeUpdateHeightCallback=void 0),e._clampedModelMatrix=void 0;return}let i=n.ellipsoid??ee.default,r=e.modelMatrix;My.x=r[12],My.y=r[13],My.z=r[14];let o=i.cartesianToCartographic(My,Cct);l(e._clampedModelMatrix)||(e._clampedModelMatrix=M.clone(r,new M));let s=n.frameState.frameNumber,a=e.heightReference===We.CLIP_TO_GROUND,c=s-e._lastSurfaceQueryFrame<Pye,u=a&&l(e._lastSurfaceHeight)&&o.height>e._lastSurfaceHeight+vct,f=u&&c,d=a&&c&&e._lastSurfaceQueryMissed;if(!((a&&e._lastSurfaceQueryMissed||u)&&l(e._removeUpdateHeightCallback))){l(e._removeUpdateHeightCallback)&&e._removeUpdateHeightCallback();let y=he.clone(o),A=Vct(e,i,y);e._removeUpdateHeightCallback=n.updateHeight(y,b=>{let x=n.getHeight(y,e.heightReference);l(x)&&(b.height=x,e._lastSurfaceQueryFrame=n.frameState.frameNumber,e._lastSurfaceQueryMissed=!1),e._lastSurfaceHeight=b.height,A(b)},e.heightReference)}let m;f||d?m=e._lastSurfaceHeight:(e._lastSurfaceQueryFrame=s,m=n.getHeight(o,e.heightReference),e._lastSurfaceQueryMissed=!l(m),l(m)?e._lastSurfaceHeight=m:m=e._lastSurfaceHeight),l(m)?(he.clone(o,hZ),hZ.height=m,Nye(e,i,o,hZ)):gZ(r,e._clampedModelMatrix),e._heightDirty=!1,e._updateModelMatrix=!0}function wct(e,t){if(!e._updateModelMatrix&&e._minimumPixelSize===0)return;let n=l(e._clampedModelMatrix)?e._clampedModelMatrix:e.modelMatrix;Mye(e,n),Ict(e,n,t)}function Mye(e,t){e._clampedScale=l(e._maximumScale)?Math.min(e._scale,e._maximumScale):e._scale,e._boundingSphere.center=h.multiplyByScalar(e._sceneGraph.boundingSphere.center,e._clampedScale,e._boundingSphere.center),e._boundingSphere.radius=e._initialRadius*e._clampedScale,e._boundingSphere=ue.transform(e._boundingSphere,t,e._boundingSphere)}function Ict(e,t,n){let i=e.scale;if(e.minimumPixelSize!==0&&!e._projectTo2D){let r=n.context,o=Math.max(r.drawingBufferWidth,r.drawingBufferHeight);M.getTranslation(t,My),e._sceneMode!==re.SCENE3D&&pr.computeActualEllipsoidPosition(n,My,My);let s=e._boundingSphere.radius,a=Fct(My,s,n),c=1/a;Math.min(c*(2*s),o)<e.minimumPixelSize&&(i=e.minimumPixelSize*a/(2*e._initialRadius))}e._computedScale=l(e.maximumScale)?Math.min(e.maximumScale,i):i}function Pct(e){if(!e._idDirty)return;e._idDirty=!1;let t=e._id,n=e._pickIds,i=n.length;for(let r=0;r<i;++r)n[r].object.id=t}var Dct=new $(1,0,0,0,0,1,0,-1,0);function Rct(e,t){let n=l(e._clampedModelMatrix)?e._clampedModelMatrix:e.modelMatrix,i=e.referenceMatrix??n,r=t.context,o=tct,s=ect;if(s=M.multiply(r.uniformState.view3D,i,s),o=M.getRotation(s,o),o=$.transpose(o,o),e._iblReferenceFrameMatrix=$.multiply(Dct,o,e._iblReferenceFrameMatrix),e.isClippingEnabled()){let a=M.multiply(i,e._clippingPlanes.modelMatrix,nct);e._clippingPlanesMatrix=M.inverseTranspose(a,e._clippingPlanesMatrix)}}function Oct(e,t){let n=e._sceneGraph;if(e._updateModelMatrix||e._minimumPixelSize!==0){let r=l(e._clampedModelMatrix)?e._clampedModelMatrix:e.modelMatrix;n.updateModelMatrix(r,t),e._updateModelMatrix&&(e._clippingPolygonsNeedRebake=!0),e._updateModelMatrix=!1}e._backFaceCullingDirty&&(n.updateBackFaceCulling(e._backFaceCulling),e._backFaceCullingDirty=!1),e._shadowsDirty&&(n.updateShadows(e._shadows),e._shadowsDirty=!1),e._debugShowBoundingVolumeDirty&&(n.updateShowBoundingVolume(e._debugShowBoundingVolume),e._debugShowBoundingVolumeDirty=!1);let i=!1;!l(e.classificationType)&&e._show&&(i=e._userAnimationDirty||e._activeAnimations.update(t)),n.update(t,i),e._userAnimationDirty=!1}function Mct(e){if(!e._showCreditsOnScreenDirty)return;e._showCreditsOnScreenDirty=!1,e._credits.length=0;let t=e._showCreditsOnScreen;if(l(e._credit)){let s=It.clone(e._credit);s.showOnScreen=s.showOnScreen||t,e._credits.push(s)}let n=e._resourceCredits,i=n.length;for(let s=0;s<i;s++){let a=It.clone(n[s]);a.showOnScreen=a.showOnScreen||t,e._credits.push(a)}let r=e._gltfCredits,o=r.length;for(let s=0;s<o;s++){let a=It.clone(r[s]);a.showOnScreen=a.showOnScreen||t,e._credits.push(a)}}function Nct(e){return e.isClippingPolygonsEnabled()&&e._clippingPolygons.inverse&&(e._clippingPolygonData?.polygonRings.length??0)===0}function Lct(e,t){let n=Hct(e,t),i=e.isInvisible(),r=e.hasSilhouette(t),o=e._show&&e._computedScale!==0&&n&&(!i||r)&&!Nct(e),s=t.passes,a=s.render||s.pick&&e.allowPicking;o&&!e._ignoreCommands&&a&&(Gct(e,t),e._sceneGraph.pushDrawCommands(t))}var mZ=new ue;function Fct(e,t,n){return mZ.center=e,mZ.radius=t,n.camera.getPixelSize(mZ,n.context.drawingBufferWidth,n.context.drawingBufferHeight)}var QV=new h,Bct=new h,e4=new h,kct=new h,Uct=new M;function zct(e,t,n){let i=e._sceneGraph;if(!l(i)||!l(i._positionMin))return 0;let r=i._positionMin,o=i._positionMax,s=t.geodeticSurfaceNormalCartographic(n,kct),a=M.multiplyTransformation(i._components.transform,i._axisCorrectionMatrix,Uct),c=e.scale,u=e.modelMatrix,f=0;for(let d=0;d<8;d++){let p=h.fromElements(d&1?o.x:r.x,d&2?o.y:r.y,d&4?o.z:r.z,Bct);h.multiplyByScalar(p,c,p),M.multiplyByPoint(a,p,e4),M.multiplyByPointAsVector(u,e4,e4);let g=h.dot(e4,s);g<f&&(f=g)}return-f}function Nye(e,t,n,i){if(e.heightReference===We.CLIP_TO_GROUND){let o=i.height+zct(e,t,i);e._heightAboveSurface=Math.max(0,n.height-o),i.height=Math.max(n.height,o)}else j_(e.heightReference)&&(i.height+=n.height);t.cartographicToCartesian(i,QV);let r=e._clampedModelMatrix;gZ(e.modelMatrix,r),r[12]=QV.x,r[13]=QV.y,r[14]=QV.z,e._heightDirty=!0}function Vct(e,t,n){return function(i){Nye(e,t,n,i)}}var jct=new h;function Hct(e,t){let n=e.distanceDisplayCondition;if(!l(n))return!0;let i=n.near*n.near,r=n.far*n.far,o;if(t.mode===re.SCENE2D){let a=(t.camera.frustum.right-t.camera.frustum.left)*.5;o=a*a}else{let s=M.getTranslation(e.modelMatrix,jct);pr.computeActualEllipsoidPosition(t,s,s),o=h.distanceSquared(s,t.camera.positionWC)}return o>=i&&o<=r}function Gct(e,t){let n=t.creditDisplay,i=e._credits,r=i.length;for(let o=0;o<r;o++)n.addCreditToNextFrame(i[o])}xr.prototype.isTranslucent=function(){let e=this.color;return l(e)&&e.alpha>0&&e.alpha<1};xr.prototype.isInvisible=function(){let e=this.color;return l(e)&&e.alpha===0};function Lye(e){return e.context.stencilBuffer}xr.prototype.hasSilhouette=function(e){return Lye(e)&&this._silhouetteSize>0&&this._silhouetteColor.alpha>0&&!l(this._classificationType)};xr.prototype.hasSkipLevelOfDetail=function(e){if(!Jo.is3DTiles(this.type))return!1;let t=e.context.stencilBuffer,n=this._content.tileset;return t&&n.isSkippingLevelOfDetail};xr.prototype.isClippingEnabled=function(){let e=this._clippingPlanes;return l(e)&&e.enabled&&e.length!==0};xr.prototype.pick=function(e,t,n,i,r){return o1(this,e,t,n,i,r)};xr.prototype.isClippingPolygonsEnabled=function(){let e=this._clippingPolygons;return l(e)&&e.enabled&&e.length!==0};xr.prototype.hasDrapedVectors=function(){return this._vectorData?.show===!0};xr.prototype.isDestroyed=function(){return!1};xr.prototype.destroy=function(){let e=this._loader;l(e)&&e.destroy();let t=this._featureTables;if(l(t)){let r=t.length;for(let o=0;o<r;o++)t[o].destroy()}this.destroyPipelineResources(),this.destroyModelResources(),Oye(this),l(this._removeUpdateHeightCallback)&&(this._removeUpdateHeightCallback(),this._removeUpdateHeightCallback=void 0),l(this._terrainProviderChangedCallback)&&(this._terrainProviderChangedCallback(),this._terrainProviderChangedCallback=void 0),this._removeClippingPolygonAdded=this._removeClippingPolygonAdded&&this._removeClippingPolygonAdded(),this._removeClippingPolygonRemoved=this._removeClippingPolygonRemoved&&this._removeClippingPolygonRemoved();let n=this._clippingPlanes;l(n)&&!n.isDestroyed()&&n.owner===this&&n.destroy(),this._clippingPlanes=void 0,l(this._clippingPolygonData)&&Zc.releaseRectangleData(this._clippingPolygonData),this._clippingPolygonData=void 0,this._clippingPolygons=void 0,this._shouldDestroyImageBasedLighting&&!this._imageBasedLighting.isDestroyed()&&this._imageBasedLighting.destroy(),this._imageBasedLighting=void 0;let i=this._environmentMapManager;!i.isDestroyed()&&i.owner===this&&i.destroy(),this._environmentMapManager=void 0,le(this)};xr.prototype.destroyPipelineResources=function(){let e=this._pipelineResources;for(let t=0;t<e.length;t++)e[t].destroy();this._pipelineResources.length=0,this._pickIds.length=0};xr.prototype.destroyModelResources=function(){let e=this._modelResources;for(let t=0;t<e.length;t++)e[t].destroy();this._modelResources.length=0};xr.fromGltfAsync=async function(e){e=e??H.EMPTY_OBJECT;let t=e.url??e.gltf,n={releaseGltfJson:e.releaseGltfJson,asynchronous:e.asynchronous,incrementallyLoadTextures:e.incrementallyLoadTextures,upAxis:e.upAxis,forwardAxis:e.forwardAxis,loadAttributesFor2D:e.projectTo2D,enablePick:e.enablePick,loadIndicesForWireframe:e.enableDebugWireframe,loadPrimitiveOutline:e.enableShowOutline,loadForClassification:l(e.classificationType)},i=e.basePath??"",r=De.createIfNeeded(i);l(t.asset)?(n.gltfJson=t,n.baseResource=r,n.gltfResource=r):t instanceof Uint8Array?(n.typedArray=t,n.baseResource=r,n.gltfResource=r):n.gltfResource=De.createIfNeeded(t);let o=new _d(n),a=l(e.content)?Jo.TILE_GLTF:Jo.GLTF,c=n.gltfResource,u=s1(o,a,e);u.resource=c,u.environmentMapOptions=e.environmentMapOptions;try{await o.load()}catch(g){throw o.destroy(),xt.getError("model",c,g)}let f=e.gltfCallback;l(f)&&f(o.gltfJson);let d=new xr(u),p=d._resource.credits;if(l(p)){let g=p.length;for(let m=0;m<g;m++)d._resourceCredits.push(It.clone(p[m]))}return d};xr.fromB3dm=async function(e){let t={b3dmResource:e.resource,arrayBuffer:e.arrayBuffer,byteOffset:e.byteOffset,releaseGltfJson:e.releaseGltfJson,asynchronous:e.asynchronous,incrementallyLoadTextures:e.incrementallyLoadTextures,upAxis:e.upAxis,forwardAxis:e.forwardAxis,loadAttributesFor2D:e.projectTo2D,enablePick:e.enablePick,loadIndicesForWireframe:e.enableDebugWireframe,loadPrimitiveOutline:e.enableShowOutline,loadForClassification:l(e.classificationType)},n=new EU(t);try{await n.load();let i=s1(n,Jo.TILE_B3DM,e);return new xr(i)}catch(i){throw n.destroy(),i}};xr.fromPnts=async function(e){let t={arrayBuffer:e.arrayBuffer,byteOffset:e.byteOffset,loadAttributesFor2D:e.projectTo2D},n=new XV(t);try{await n.load();let i=s1(n,Jo.TILE_PNTS,e);return new xr(i)}catch(i){throw n.destroy(),i}};xr.fromI3dm=async function(e){let t={i3dmResource:e.resource,arrayBuffer:e.arrayBuffer,byteOffset:e.byteOffset,releaseGltfJson:e.releaseGltfJson,asynchronous:e.asynchronous,incrementallyLoadTextures:e.incrementallyLoadTextures,upAxis:e.upAxis,forwardAxis:e.forwardAxis,loadAttributesFor2D:e.projectTo2D,enablePick:e.enablePick,loadIndicesForWireframe:e.enableDebugWireframe,loadPrimitiveOutline:e.enableShowOutline},n=new DU(t);try{await n.load();let i=s1(n,Jo.TILE_I3DM,e);return new xr(i)}catch(i){throw n.destroy(),i}};xr.fromGeoJson=async function(e){let t={geoJson:e.geoJson},n=new vU(t),i=s1(n,Jo.TILE_GEOJSON,e);return new xr(i)};var Wct=new z;xr.prototype.applyColorAndShow=function(e){let t=z.clone(this._color,Wct),n=l(e)&&l(e.color),i=l(e)&&l(e.show);this._color=n?e.color.evaluateColor(void 0,this._color):z.clone(z.WHITE,this._color),this._show=i?e.show.evaluate(void 0):!0,pZ(t,this._color)&&this.resetDrawCommands()};xr.prototype.applyStyle=function(e){let t=this.type===Jo.TILE_PNTS,n=l(this.featureTableId)&&this.featureTables[this.featureTableId].featuresLength>0,i=l(this.structuralMetadata)?this.structuralMetadata.propertyAttributes:void 0,r=l(i)&&l(i[0]);if(t&&(!n||r)){this.resetDrawCommands();return}n?(this.featureTables[this.featureTableId].applyStyle(e),Dye(this,e)):(this.applyColorAndShow(e),this._styleCommandsNeeded=void 0)};function s1(e,t,n){return{loader:e,type:t,resource:n.resource,show:n.show,modelMatrix:n.modelMatrix,scale:n.scale,enableVerticalExaggeration:n.enableVerticalExaggeration,minimumPixelSize:n.minimumPixelSize,maximumScale:n.maximumScale,id:n.id,allowPicking:n.allowPicking,clampAnimations:n.clampAnimations,shadows:n.shadows,debugShowBoundingVolume:n.debugShowBoundingVolume,enableDebugWireframe:n.enableDebugWireframe,debugWireframe:n.debugWireframe,cull:n.cull,opaquePass:n.opaquePass,customShader:n.customShader,content:n.content,heightReference:n.heightReference,scene:n.scene,distanceDisplayCondition:n.distanceDisplayCondition,color:n.color,colorBlendAmount:n.colorBlendAmount,colorBlendMode:n.colorBlendMode,edgeDisplayMode:n.edgeDisplayMode,silhouetteColor:n.silhouetteColor,silhouetteSize:n.silhouetteSize,enableShowOutline:n.enableShowOutline,showOutline:n.showOutline,outlineColor:n.outlineColor,clippingPlanes:n.clippingPlanes,clippingPolygons:n.clippingPolygons,lightColor:n.lightColor,imageBasedLighting:n.imageBasedLighting,backFaceCulling:n.backFaceCulling,credit:n.credit,showCreditsOnScreen:n.showCreditsOnScreen,splitDirection:n.splitDirection,projectTo2D:n.projectTo2D,enablePick:n.enablePick,featureIdLabel:n.featureIdLabel,instanceFeatureIdLabel:n.instanceFeatureIdLabel,pointCloudShading:n.pointCloudShading,classificationType:n.classificationType,pickObject:n.pickObject}}var Ed=xr;var _Z=class e{constructor(t,n,i){this._tileset=t,this._tile=n,this._resource=i,this._model=void 0,this._metadata=void 0,this._group=void 0,this._ready=!1}get featuresLength(){let t=this._model,n=t.featureTables,i=t.featureTableId;return l(n)&&l(n[i])?n[i].featuresLength:0}get pointsLength(){return this._model.statistics.pointsLength}get trianglesLength(){return this._model.statistics.trianglesLength}get geometryByteLength(){return this._model.statistics.geometryByteLength}get texturesByteLength(){return this._model.statistics.texturesByteLength}get batchTableByteLength(){let t=this._model.statistics;return t.propertyTablesByteLength+t.batchTexturesByteLength}get innerContents(){}get ready(){return this._ready}get tileset(){return this._tileset}get tile(){return this._tile}get url(){return this._resource.getUrlComponent(!0)}get batchTable(){let t=this._model,n=t.featureTables,i=t.featureTableId;if(l(n)&&l(n[i]))return n[i]}get metadata(){return this._metadata}set metadata(t){this._metadata=t}get group(){return this._group}set group(t){this._group=t}getTextureIds(){return this._model.statistics.getTextureIds()}getTextureByteLengthById(t){return this._model.statistics.getTextureByteLengthById(t)}getExtension(t){return this._model.getExtension(t)}getFeature(t){let n=this._model,i=n.featureTableId;return n.featureTables[i].getFeature(t)}hasProperty(t,n){let i=this._model,r=i.featureTableId;return l(r)?i.featureTables[r].hasProperty(t,n):!1}applyDebugSettings(t,n){n=t?n:z.WHITE,this.featuresLength===0?this._model.color=n:l(this.batchTable)&&this.batchTable.setAllColor(n)}applyStyle(t){this._model.style=t}update(t,n){let i=this._model,r=this._tile;i.colorBlendAmount=t.colorBlendAmount,i.colorBlendMode=t.colorBlendMode,i.modelMatrix=r.computedTransform,i.customShader=t.customShader,i.featureIdLabel=t.featureIdLabel,i.instanceFeatureIdLabel=t.instanceFeatureIdLabel,i.lightColor=t.lightColor,i.imageBasedLighting=t.imageBasedLighting,i.backFaceCulling=t.backFaceCulling,i.shadows=t.shadows,i.showCreditsOnScreen=t.showCreditsOnScreen,i.splitDirection=t.splitDirection,i.debugWireframe=t.debugWireframe,i.edgeDisplayMode=t.edgeDisplayMode,i.showOutline=t.showOutline,i.outlineColor=t.outlineColor,i.pointCloudShading=t.pointCloudShading;let o=t.clippingPlanes;i.referenceMatrix=t.clippingPlanesOriginMatrix,l(o)&&r.clippingPlanesDirty&&(i._clippingPlanes=o.enabled&&r._isClipped?o:void 0);let s=t.environmentMapManager;i.environmentMapManager!==o&&(i._environmentMapManager=s),l(o)&&l(i._clippingPlanes)&&i._clippingPlanes!==o&&(i._clippingPlanes=o,i._clippingPlanesState=0);let a=t.clippingPolygons;l(a)&&r.clippingPolygonsDirty&&(i._clippingPolygons=a.enabled&&r._isClippedByPolygon?a:void 0),l(a)&&l(i._clippingPolygons)&&i._clippingPolygons!==a&&(i._clippingPolygons=a,i._clippingPolygonsState=0),r.clippingPolygonsNeedRebake&&(i._clippingPolygonsNeedRebake=!0),i.update(n),!this._ready&&i.ready&&(i.activeAnimations.addAll({loop:gf.REPEAT}),this._ready=!0)}isDestroyed(){return!1}destroy(){return this._model=this._model&&this._model.destroy(),le(this)}static async fromGltf(t,n,i,r){let o=new e(t,n,i),a=a1(t,n,o,{gltf:r,basePath:i}),c=t.vectorClassificationOnly?void 0:t.classificationType;a.classificationType=c;let u=await Ed.fromGltfAsync(a);return o._model=u,o}static async fromB3dm(t,n,i,r,o){let s=new e(t,n,i),c=a1(t,n,s,{arrayBuffer:r,byteOffset:o,resource:i}),u=t.vectorClassificationOnly?void 0:t.classificationType;c.classificationType=u;let f=await Ed.fromB3dm(c);return s._model=f,s}static async fromI3dm(t,n,i,r,o){let s=new e(t,n,i),c=a1(t,n,s,{arrayBuffer:r,byteOffset:o,resource:i}),u=await Ed.fromI3dm(c);return s._model=u,s}static async fromPnts(t,n,i,r,o){let s=new e(t,n,i),c=a1(t,n,s,{arrayBuffer:r,byteOffset:o,resource:i}),u=await Ed.fromPnts(c);return s._model=u,s}static async fromGeoJson(t,n,i,r){let o=new e(t,n,i),a=a1(t,n,o,{geoJson:r,resource:i}),c=await Ed.fromGeoJson(a);return o._model=c,o}pick(t,n,i){if(!l(this._model)||!this._ready)return;let r=n.verticalExaggeration,o=n.verticalExaggerationRelativeHeight;return this._model.pick(t,n,r,o,ee.WGS84,i)}};function a1(e,t,n,i){let r={cull:!1,releaseGltfJson:!0,opaquePass:Ie.CESIUM_3D_TILE,modelMatrix:t.computedTransform,upAxis:e._modelUpAxis,forwardAxis:e._modelForwardAxis,incrementallyLoadTextures:!1,customShader:e.customShader,content:n,scene:e._scene,colorBlendMode:e.colorBlendMode,colorBlendAmount:e.colorBlendAmount,lightColor:e.lightColor,imageBasedLighting:e.imageBasedLighting,featureIdLabel:e.featureIdLabel,instanceFeatureIdLabel:e.instanceFeatureIdLabel,pointCloudShading:e.pointCloudShading,clippingPlanes:e.clippingPlanes,backFaceCulling:e.backFaceCulling,shadows:e.shadows,showCreditsOnScreen:e.showCreditsOnScreen,splitDirection:e.splitDirection,enableDebugWireframe:e._enableDebugWireframe,debugWireframe:e.debugWireframe,projectTo2D:e._projectTo2D,enablePick:e._enablePick,enableShowOutline:e._enableShowOutline,showOutline:e.showOutline,outlineColor:e.outlineColor};return Mt(i,r)}var Cd=_Z;var yZ=class e{constructor(t,n,i){this._tileset=t,this._tile=n,this._resource=i,this.featurePropertiesDirty=!1,this._metadata=void 0,this._group=void 0,this._ready=!1}get featuresLength(){return 0}get pointsLength(){return 0}get trianglesLength(){return 0}get geometryByteLength(){return 0}get texturesByteLength(){return 0}get batchTableByteLength(){return 0}get innerContents(){}get ready(){return this._ready}get tileset(){return this._tileset}get tile(){return this._tile}get url(){return this._resource.getUrlComponent(!0)}get batchTable(){}get metadata(){return this._metadata}set metadata(t){this._metadata=t}get group(){return this._group}set group(t){this._group=t}static fromJson(t,n,i,r){let o=new e(t,n,i);return o._tileset.loadTileset(o._resource,r,o._tile),o._ready=!0,o}hasProperty(t,n){return!1}getFeature(t){}applyDebugSettings(t,n){}applyStyle(t){}update(t,n){}pick(t,n,i){}isDestroyed(){return!1}destroy(){return le(this)}},t4=yZ;var qct=Object.freeze({NONE:0,LOADING:2,LOADED:3,ERROR:4,FAILED:5}),Ks=qct;function Lh(e){this._billboardCollection=e,this._id=void 0,this._loadState=Ks.NONE,this._loadError=void 0,this._index=-1,this._width=void 0,this._height=void 0,this._hasSubregion=!1,this.dirty=!1}Object.defineProperties(Lh.prototype,{loadError:{get:function(){return this._loadError}},loadState:{get:function(){return this._loadState}},ready:{get:function(){return this._loadState===Ks.LOADED}},hasImage:{get:function(){return this._loadState!==Ks.NONE}},id:{get:function(){return this._id}},width:{get:function(){return this._width}},height:{get:function(){return this._height}}});Lh.prototype.unload=async function(){this._loadState!==Ks.NONE&&(this._id=void 0,this._loadError=void 0,this._loadState=Ks.NONE,this._index=-1,this._width=void 0,this._height=void 0,this.dirty=!0)};Lh.prototype.loadImage=async function(e,t,n,i){if(this._id===e)return;let r=this._billboardCollection,o=r.billboardTextureCache,s=o.get(e);if(l(s)&&t.loadState===Ks.LOADING||t.loadState===Ks.LOADED){Lh.clone(s,this);return}l(s)||(s=new Lh(r),o.set(e,s)),s._id=this._id=e,s._loadState=this._loadState=Ks.LOADING,s._loadError=this._loadError=void 0;let a,c=this._billboardCollection.textureAtlas;try{let f=c.addImage(e,t,n,i);typeof f=="number"?a=f:a=await f}catch(f){if(s._loadState=Ks.ERROR,s._loadError=f,this._id!==e)return;this._loadState=Ks.ERROR,this._loadError=f;return}if(!l(a)||a===-1){if(s._loadState=Ks.FAILED,s._index=-1,this._id!==e)return;this._loadState=Ks.FAILED,this._index=-1;return}s._index=a,s._loadState=Ks.LOADED;let u=c.rectangles[a];s._width=u.width,s._height=u.height,this._id===e&&(this._index=a,this._loadState=Ks.LOADED,this._width=u.width,this._height=u.height,this.dirty=!0)};Lh.prototype.addImageSubRegion=function(e,t){this._id=e,this._loadError=void 0,this._hasSubregion=!0;let i=this._billboardCollection.textureAtlas.addImageSubRegion(e,t);if(typeof i=="number"){this.setImageSubRegion(i,t);return}this.loadImageSubRegion(e,t,i)};Lh.prototype.loadImageSubRegion=async function(e,t,n){let i;try{this._loadState=Ks.LOADING,i=await n}catch(r){this._loadState=Ks.ERROR,this._loadError=r;return}this._id===e&&(this._loadState=Ks.LOADED,this.setImageSubRegion(i,t))};Lh.prototype.setImageSubRegion=function(e,t){if(this._index!==e){if(!l(e)||e===-1){this._loadState=Ks.FAILED,this._index=-1,this._width=void 0,this._height=void 0;return}this._width=t.width,this._height=t.height,this._index=e,this.dirty=!0}};Lh.prototype.computeTextureCoordinates=function(e){return this._billboardCollection.textureAtlas.computeTextureCoordinates(this._index,e)};Lh.clone=function(e,t){if(t._id=e._id,t._loadState=e._loadState,t._loadError=void 0,t._index=e._index,t._width=e._width,t._height=e._height,t._hasSubregion=e._hasSubregion,e.ready){t.dirty=!0;return}return(async()=>{let i=e._id;await e._billboardCollection.textureAtlas._indexPromiseById.get(i),t._id===i&&(e._hasSubregion&&await Promise.resolve(),t._id=i,t._loadState=e._loadState,t._loadError=e._loadError,t._index=e._index,t._width=e._width,t._height=e._height,t.dirty=!0)})(),t};var Ny=Lh;function Mi(e,t){e=e??H.EMPTY_OBJECT;let n=e.translucencyByDistance,i=e.pixelOffsetScaleByDistance,r=e.scaleByDistance,o=e.distanceDisplayCondition;l(n)&&(n=qt.clone(n)),l(i)&&(i=qt.clone(i)),l(r)&&(r=qt.clone(r)),l(o)&&(o=Gt.clone(o)),this._show=e.show??!0,this._position=h.clone(e.position??h.ZERO),this._actualPosition=h.clone(this._position),this._pixelOffset=U.clone(e.pixelOffset??U.ZERO),this._translate=new U(0,0),this._eyeOffset=h.clone(e.eyeOffset??h.ZERO),this._heightReference=e.heightReference??We.NONE,this._verticalOrigin=e.verticalOrigin??qn.CENTER,this._horizontalOrigin=e.horizontalOrigin??Hi.CENTER,this._scale=e.scale??1,this._color=z.clone(e.color??z.WHITE),this._rotation=e.rotation??0,this._alignedAxis=h.clone(e.alignedAxis??h.ZERO),this._width=e.width,this._height=e.height,this._scaleByDistance=r,this._translucencyByDistance=n,this._pixelOffsetScaleByDistance=i,this._sizeInMeters=e.sizeInMeters??!1,this._distanceDisplayCondition=o,this._disableDepthTestDistance=e.disableDepthTestDistance,this._id=e.id,this._collection=e.collection??t,this._pickId=void 0,this._pickPrimitive=e._pickPrimitive??this,this._billboardCollection=t,this._dirty=!1,this._index=-1,this._batchIndex=void 0,this._imageTexture=new Ny(t),this._imageId=e.imageId,this._imageWidth=void 0,this._imageHeight=void 0,this._labelDimensions=void 0,this._labelHorizontalOrigin=void 0,this._labelTranslate=void 0;let s=e.image;l(s)&&(this._computeImageTextureProperties(e.imageId,s),this._imageTexture.loadImage(this._imageId,s,this._imageWidth,this._imageHeight)),l(e.imageSubRegion)&&this._imageTexture.addImageSubRegion(this._imageId,e.imageSubRegion),this._actualClampedPosition=void 0,this._removeCallbackFunc=void 0,this._lastSurfaceHeight=void 0,this._lastSurfaceQueryFrame=-1,this._lastSurfaceQueryMissed=!1,this._clampedToSurface=!1,this._clampingCartesian=void 0,this._clampingHeight=0,this._clampingHeightValid=!1,this._mode=re.SCENE3D,this._clusterShow=!0,this._outlineColor=z.clone(e.outlineColor??z.BLACK),this._outlineWidth=e.outlineWidth??0,this._updateClamping(),this._splitDirection=e.splitDirection??Wo.NONE,this._positionFromParent=!1}var Fye=Mi.SHOW_INDEX=0,i4=Mi.POSITION_INDEX=1,Wye=Mi.PIXEL_OFFSET_INDEX=2,Yct=Mi.EYE_OFFSET_INDEX=3,Xct=Mi.HORIZONTAL_ORIGIN_INDEX=4,Kct=Mi.VERTICAL_ORIGIN_INDEX=5,$ct=Mi.SCALE_INDEX=6,Bye=Mi.IMAGE_INDEX_INDEX=7,kye=Mi.COLOR_INDEX=8,Jct=Mi.ROTATION_INDEX=9,Zct=Mi.ALIGNED_AXIS_INDEX=10,Qct=Mi.SCALE_BY_DISTANCE_INDEX=11,elt=Mi.TRANSLUCENCY_BY_DISTANCE_INDEX=12,tlt=Mi.PIXEL_OFFSET_SCALE_BY_DISTANCE_INDEX=13,nlt=Mi.DISTANCE_DISPLAY_CONDITION=14,ilt=Mi.DISABLE_DEPTH_DISTANCE=15;Mi.TEXTURE_COORDINATE_BOUNDS=16;var Uye=Mi.SDF_INDEX=17,rlt=Mi.SPLIT_DIRECTION_INDEX=18;Mi.NUMBER_OF_PROPERTIES=19;function wo(e,t){let n=e._billboardCollection;l(n)&&(n._updateBillboard(e,t),e._dirty=!0)}function AZ(e,t){return e===t||l(e)&&l(t)&&e.x===t.x&&e.y===t.y&&e.z===t.z}function bx(e,t){if(l(e))return l(t)?(t.x=e.x,t.y=e.y,t.z=e.z,t):new h(e.x,e.y,e.z)}Object.defineProperties(Mi.prototype,{show:{get:function(){return this._show},set:function(e){this._show!==e&&(this._show=e,wo(this,Fye))}},position:{get:function(){return this._position},set:function(e){let t=this._position;AZ(t,e)||(bx(e,t),bx(e,this._actualPosition),this._updateClamping(),wo(this,i4))}},heightReference:{get:function(){return this._heightReference},set:function(e){let t=this._heightReference;e!==t&&(this._heightReference=e,this._updateClamping(),wo(this,i4))}},pixelOffset:{get:function(){return this._pixelOffset},set:function(e){let t=this._pixelOffset;U.equals(t,e)||(U.clone(e,t),wo(this,Wye))}},scaleByDistance:{get:function(){return this._scaleByDistance},set:function(e){let t=this._scaleByDistance;qt.equals(t,e)||(this._scaleByDistance=qt.clone(e,t),wo(this,Qct))}},translucencyByDistance:{get:function(){return this._translucencyByDistance},set:function(e){let t=this._translucencyByDistance;qt.equals(t,e)||(this._translucencyByDistance=qt.clone(e,t),wo(this,elt))}},pixelOffsetScaleByDistance:{get:function(){return this._pixelOffsetScaleByDistance},set:function(e){let t=this._pixelOffsetScaleByDistance;qt.equals(t,e)||(this._pixelOffsetScaleByDistance=qt.clone(e,t),wo(this,tlt))}},eyeOffset:{get:function(){return this._eyeOffset},set:function(e){let t=this._eyeOffset;h.equals(t,e)||(h.clone(e,t),wo(this,Yct))}},horizontalOrigin:{get:function(){return this._horizontalOrigin},set:function(e){this._horizontalOrigin!==e&&(this._horizontalOrigin=e,wo(this,Xct))}},verticalOrigin:{get:function(){return this._verticalOrigin},set:function(e){this._verticalOrigin!==e&&(this._verticalOrigin=e,wo(this,Kct))}},scale:{get:function(){return this._scale},set:function(e){this._scale!==e&&(this._scale=e,wo(this,$ct))}},color:{get:function(){return this._color},set:function(e){let t=this._color;z.equals(t,e)||(z.clone(e,t),wo(this,kye))}},rotation:{get:function(){return this._rotation},set:function(e){this._rotation!==e&&(this._rotation=e,wo(this,Jct))}},alignedAxis:{get:function(){return this._alignedAxis},set:function(e){let t=this._alignedAxis;h.equals(t,e)||(h.clone(e,t),wo(this,Zct))}},width:{get:function(){return this._width??this._imageTexture.width},set:function(e){this._width!==e&&(this._width=e,wo(this,Bye))}},height:{get:function(){return this._height??this._imageTexture.height},set:function(e){this._height!==e&&(this._height=e,wo(this,Bye))}},sizeInMeters:{get:function(){return this._sizeInMeters},set:function(e){this._sizeInMeters!==e&&(this._sizeInMeters=e,wo(this,kye))}},distanceDisplayCondition:{get:function(){return this._distanceDisplayCondition},set:function(e){Gt.equals(e,this._distanceDisplayCondition)||(this._distanceDisplayCondition=Gt.clone(e,this._distanceDisplayCondition),wo(this,nlt))}},disableDepthTestDistance:{get:function(){return this._disableDepthTestDistance},set:function(e){this._disableDepthTestDistance!==e&&(this._disableDepthTestDistance=e,wo(this,ilt))}},id:{get:function(){return this._id},set:function(e){this._id=e,l(this._pickId)&&(this._pickId.object.id=e)}},pickPrimitive:{get:function(){return this._pickPrimitive},set:function(e){this._pickPrimitive=e,l(this._pickId)&&(this._pickId.object.primitive=e)}},pickId:{get:function(){return this._pickId}},image:{get:function(){return this._imageTexture.id},set:function(e){if(!l(e)){this._imageTexture.unload();return}this._computeImageTextureProperties(void 0,e),this._imageTexture.loadImage(this._imageId,e,this._imageWidth,this._imageHeight)}},ready:{get:function(){return this._imageTexture.ready}},loadError:{get:function(){return this._imageTexture.loadError}},textureDirty:{get:function(){return this._imageTexture.dirty},set:function(e){this._imageTexture.dirty=e}},_clampedPosition:{get:function(){return this._actualClampedPosition},set:function(e){this._actualClampedPosition=bx(e,this._actualClampedPosition),wo(this,i4)}},clusterShow:{get:function(){return this._clusterShow},set:function(e){this._clusterShow!==e&&(this._clusterShow=e,wo(this,Fye))}},outlineColor:{get:function(){return this._outlineColor},set:function(e){let t=this._outlineColor;z.equals(t,e)||(z.clone(e,t),wo(this,Uye))}},outlineWidth:{get:function(){return this._outlineWidth},set:function(e){this._outlineWidth!==e&&(this._outlineWidth=e,wo(this,Uye))}},splitDirection:{get:function(){return this._splitDirection},set:function(e){this._splitDirection!==e&&(this._splitDirection=e,wo(this,rlt))}}});Mi.prototype.getPickId=function(e){return l(this._pickId)||(this._pickId=e.createPickId({primitive:this._pickPrimitive,collection:this._collection,id:this._id})),this._pickId};Mi.prototype._updateClamping=function(){Mi._updateClamping(this._billboardCollection,this)};var r4=new he,olt=new he,zye=200,Vye=30;function jye(e,t,n,i){let r=t.cartographicToCartesian(i,e._clampedPosition);j_(e._heightReference)?e._mode===re.SCENE3D?(i.height+=n.height,t.cartographicToCartesian(i,r)):r.x+=n.height:e._heightReference===We.CLIP_TO_GROUND&&n.height>i.height&&(e._mode===re.SCENE3D?(i.height=n.height,t.cartographicToCartesian(i,r)):r.x=n.height),e._clampedPosition=r}Mi._updateClamping=function(e,t){if(!l(e)||!l(e._scene))return;let n=e._scene,i=n.ellipsoid??ee.default,r=n.frameState.mode,o=r!==t._mode;if(t._mode=r,(t._heightReference===We.NONE||o)&&l(t._removeCallbackFunc)&&(t._removeCallbackFunc(),t._removeCallbackFunc=void 0,t._clampedPosition=void 0,t._lastSurfaceHeight=void 0,t._clampedToSurface=!1),t._heightReference===We.NONE||t._positionFromParent||!l(t._position))return;let s=n.frameState.frameNumber;if(t._clampingHeightValid&&t._heightReference===We.CLIP_TO_GROUND&&r===re.SCENE3D&&l(t._removeCallbackFunc)&&l(t._lastSurfaceHeight)&&s-t._lastSurfaceQueryFrame<Vye){let A=t._position,b=t._clampingCartesian,x=A.x-b.x,T=A.y-b.y,E=A.z-b.z,v=Math.sqrt(x*x+T*T+E*E);if(t._clampingHeight-v>t._lastSurfaceHeight+zye){t._clampedToSurface=!0,t._clampedPosition=A;return}}let a=i.cartesianToCartographic(t._position,olt);if(!l(a)){t._actualClampedPosition=void 0,t._clampingHeightValid=!1;return}t._clampingCartesian=bx(t._position,t._clampingCartesian),t._clampingHeight=a.height,t._clampingHeightValid=!0;let c=t._heightReference===We.CLIP_TO_GROUND,u=s-t._lastSurfaceQueryFrame<Vye,f=c&&l(t._lastSurfaceHeight)&&a.height>t._lastSurfaceHeight+zye,d=f&&u,p=c&&u&&t._lastSurfaceQueryMissed;if(!((c&&t._lastSurfaceQueryMissed||f)&&l(t._removeCallbackFunc))){l(t._removeCallbackFunc)&&t._removeCallbackFunc();let A=he.clone(a);t._removeCallbackFunc=n.updateHeight(A,b=>{let x=n.getHeight(A,t._heightReference);l(x)&&(b.height=x,t._lastSurfaceQueryFrame=n.frameState.frameNumber,t._lastSurfaceQueryMissed=!1),t._lastSurfaceHeight=b.height,t._clampedToSurface=!0,jye(t,i,A,b)},t._heightReference)}he.clone(a,r4);let y;d||p?y=t._lastSurfaceHeight:(t._lastSurfaceQueryFrame=s,y=n.getHeight(a,t._heightReference),t._lastSurfaceQueryMissed=!l(y),l(y)?t._lastSurfaceHeight=y:y=t._lastSurfaceHeight),t._clampedToSurface=l(y),l(y)&&(r4.height=y),jye(t,i,a,r4)};Mi.prototype.computeTextureCoordinates=function(e){return this._imageTexture.computeTextureCoordinates(e)};Mi.prototype.setImage=function(e,t){this._computeImageTextureProperties(e,t),this._imageTexture.loadImage(this._imageId,t,this._imageWidth,this._imageHeight)};Mi.prototype.setImageTexture=function(e){Ny.clone(e,this._imageTexture)};var Hye=512;Mi.prototype._computeImageTextureProperties=function(e,t){if(this._imageWidth=void 0,this._imageHeight=void 0,!l(t)){this._imageId=Kn();return}let n;typeof t=="string"?n=t:t instanceof De?n=t._url:l(t.src)&&(n=t.src),this._imageId=e??n??Kn(),l(this._width)&&l(this._height)&&!this._sizeInMeters&&slt(n)&&(this._imageWidth=Math.min(this._width,Hye),this._imageHeight=Math.min(this._height,Hye))};function slt(e){return l(e)?Um(e)?e.startsWith("data:image/svg+xml"):S_(e)==="svg":!1}Mi.prototype.setImageSubRegion=function(e,t){this._imageTexture.addImageSubRegion(e,t)};Mi.prototype._setTranslate=function(e){let t=this._translate;U.equals(t,e)||(U.clone(e,t),wo(this,Wye))};Mi.prototype._getActualPosition=function(){return l(this._clampedPosition)?this._clampedPosition:this._actualPosition};Mi.prototype._setActualPosition=function(e){l(this._clampedPosition)||h.clone(e,this._actualPosition),wo(this,i4)};var Gye=new se;Mi._computeActualPosition=function(e,t,n,i){return l(e._clampedPosition)?(n.mode!==e._mode&&e._updateClamping(),e._clampedPosition):n.mode===re.SCENE3D?t:(M.multiplyByPoint(i,t,Gye),pr.computeActualEllipsoidPosition(n,Gye))};var qye=new h;Mi._computeScreenSpacePosition=function(e,t,n,i,r,o){let s=M.multiplyByPoint(e,t,qye),a=pr.worldWithEyeOffsetToWindowCoordinates(r,s,n,o);if(l(a))return U.add(a,i,a),a};var n4=new U(0,0);Mi.prototype.computeScreenSpacePosition=function(e,t){let n=this._billboardCollection;l(t)||(t=new U),U.clone(this._pixelOffset,n4),U.add(n4,this._translate,n4);let i=n.modelMatrix,r=this._position;if(l(this._clampedPosition)&&(r=this._clampedPosition,e.mode!==re.SCENE3D)){let s=e.mapProjection,a=s.ellipsoid,c=s.unproject(r,r4);r=a.cartographicToCartesian(c,qye),i=M.IDENTITY}return Mi._computeScreenSpacePosition(i,r,this._eyeOffset,n4,e,t)};Mi.getScreenSpaceBoundingBox=function(e,t,n){let i=e.width,r=e.height,o=e.scale;i*=o,r*=o;let s=t.x;e.horizontalOrigin===Hi.RIGHT?s-=i:e.horizontalOrigin===Hi.CENTER&&(s-=i*.5);let a=t.y;return e.verticalOrigin===qn.BOTTOM||e.verticalOrigin===qn.BASELINE?a-=r:e.verticalOrigin===qn.CENTER&&(a-=r*.5),l(n)||(n=new et),n.x=s,n.y=a,n.width=i,n.height=r,n};Mi.prototype.equals=function(e){return this===e||l(e)&&this._id===e._id&&h.equals(this._position,e._position)&&this.image===e.image&&this._show===e._show&&this._scale===e._scale&&this._verticalOrigin===e._verticalOrigin&&this._horizontalOrigin===e._horizontalOrigin&&this._heightReference===e._heightReference&&z.equals(this._color,e._color)&&U.equals(this._pixelOffset,e._pixelOffset)&&U.equals(this._translate,e._translate)&&h.equals(this._eyeOffset,e._eyeOffset)&&qt.equals(this._scaleByDistance,e._scaleByDistance)&&qt.equals(this._translucencyByDistance,e._translucencyByDistance)&&qt.equals(this._pixelOffsetScaleByDistance,e._pixelOffsetScaleByDistance)&&Gt.equals(this._distanceDisplayCondition,e._distanceDisplayCondition)&&this._disableDepthTestDistance===e._disableDepthTestDistance&&this._splitDirection===e._splitDirection};Mi.prototype._destroy=function(){l(this._customData)&&(this._billboardCollection._scene.globe._surface.removeTileCustomData(this._customData),this._customData=void 0),l(this._removeCallbackFunc)&&(this._removeCallbackFunc(),this._removeCallbackFunc=void 0),this.image=void 0,this._pickId=this._pickId&&this._pickId.destroy(),this._billboardCollection=void 0};var Fr=Mi;var alt={FONT_SIZE:48,PADDING:10,RADIUS:8,CUTOFF:.25},ec=Object.freeze(alt);var clt=Fr.SHOW_INDEX,c1=Fr.POSITION_INDEX,Xye=Fr.PIXEL_OFFSET_INDEX,Kye=Fr.EYE_OFFSET_INDEX,llt=Fr.HORIZONTAL_ORIGIN_INDEX,ult=Fr.VERTICAL_ORIGIN_INDEX,flt=Fr.SCALE_INDEX,xx=Fr.IMAGE_INDEX_INDEX,$ye=Fr.COLOR_INDEX,dlt=Fr.ROTATION_INDEX,hlt=Fr.ALIGNED_AXIS_INDEX,Jye=Fr.SCALE_BY_DISTANCE_INDEX,Zye=Fr.TRANSLUCENCY_BY_DISTANCE_INDEX,Qye=Fr.PIXEL_OFFSET_SCALE_BY_DISTANCE_INDEX,eAe=Fr.DISTANCE_DISPLAY_CONDITION,mlt=Fr.DISABLE_DEPTH_DISTANCE,plt=Fr.TEXTURE_COORDINATE_BOUNDS,tAe=Fr.SDF_INDEX,nAe=Fr.SPLIT_DIRECTION_INDEX,vZ=Fr.NUMBER_OF_PROPERTIES,Br={direction:0,positionHighAndScale:1,positionLowAndRotation:2,compressedAttribute0:3,compressedAttribute1:4,compressedAttribute2:5,eyeOffset:6,scaleByDistance:7,pixelOffsetScaleByDistance:8,compressedAttribute3:9,textureCoordinateBoundsOrLabelTranslate:10,a_batchId:11,sdf:12,splitDirection:13};function Sd(e){e=e??H.EMPTY_OBJECT,this._scene=e.scene,this._batchTable=e.batchTable;let t=e.textureAtlas;l(t)||(t=new XE),this._textureAtlas=t,this._textureAtlasGUID=t.guid,this._destroyTextureAtlas=!0,this._billboardTextureCache=new Map,this._sp=void 0,this._spTranslucent=void 0,this._rsOpaque=void 0,this._rsTranslucent=void 0,this._vaf=void 0,this._billboards=[],this._billboardsToUpdate=[],this._billboardsToUpdateIndex=0,this._billboardsRemoved=!1,this._createVertexArray=!1,this._shaderRotation=!1,this._compiledShaderRotation=!1,this._shaderAlignedAxis=!1,this._compiledShaderAlignedAxis=!1,this._shaderScaleByDistance=!1,this._compiledShaderScaleByDistance=!1,this._shaderTranslucencyByDistance=!1,this._compiledShaderTranslucencyByDistance=!1,this._shaderPixelOffsetScaleByDistance=!1,this._compiledShaderPixelOffsetScaleByDistance=!1,this._shaderDistanceDisplayCondition=!1,this._compiledShaderDistanceDisplayCondition=!1,this._shaderDisableDepthDistance=!1,this._compiledShaderDisableDepthDistance=!1,this._shaderClampToGround=!1,this._compiledShaderClampToGround=!1,this._propertiesChanged=new Uint32Array(vZ),this._maxSize=0,this._maxEyeOffset=0,this._maxScale=1,this._maxPixelOffset=0,this._allHorizontalCenter=!0,this._allVerticalCenter=!0,this._allSizedInMeters=!0,this._baseVolume=new ue,this._baseVolumeWC=new ue,this._baseVolume2D=new ue,this._boundingVolume=new ue,this._boundingVolumeDirty=!1,this._colorCommands=[],this._allBillboardsReady=!1,this.show=e.show??!0,this.modelMatrix=M.clone(e.modelMatrix??M.IDENTITY),this._modelMatrix=M.clone(M.IDENTITY),this.debugShowBoundingVolume=e.debugShowBoundingVolume??!1,this.debugShowTextureAtlas=e.debugShowTextureAtlas??!1,this.blendOption=e.blendOption??ki.OPAQUE_AND_TRANSLUCENT,this._blendOption=void 0,this._mode=re.SCENE3D,this._buffersUsage=[Me.STATIC_DRAW,Me.STATIC_DRAW,Me.STATIC_DRAW,Me.STATIC_DRAW,Me.STATIC_DRAW,Me.STATIC_DRAW,Me.STATIC_DRAW,Me.STATIC_DRAW,Me.STATIC_DRAW,Me.STATIC_DRAW,Me.STATIC_DRAW,Me.STATIC_DRAW,Me.STATIC_DRAW,Me.STATIC_DRAW,Me.STATIC_DRAW,Me.STATIC_DRAW,Me.STATIC_DRAW],this._highlightColor=z.clone(z.WHITE),this._coarseDepthTestDistance=e.coarseDepthTestDistance??ee.default.minimumRadius/10,this._threePointDepthTestDistance=e.threePointDepthTestDistance??ee.default.minimumRadius/1e3,this._uniforms={u_atlas:()=>this.textureAtlas.texture,u_highlightColor:()=>this._highlightColor,u_coarseDepthTestDistance:()=>this._coarseDepthTestDistance,u_threePointDepthTestDistance:()=>this._threePointDepthTestDistance};let n=this._scene;l(n)&&l(n.terrainProviderChanged)&&(this._removeCallbackFunc=n.terrainProviderChanged.addEventListener(function(){let i=this._billboards,r=i.length;for(let o=0;o<r;++o)l(i[o])&&i[o]._updateClamping()},this))}Object.defineProperties(Sd.prototype,{length:{get:function(){return SZ(this),this._billboards.length}},textureAtlas:{get:function(){return this._textureAtlas},set:function(e){this._textureAtlas!==e&&(this._textureAtlas=this._destroyTextureAtlas&&this._textureAtlas&&this._textureAtlas.destroy(),this._textureAtlas=e)}},destroyTextureAtlas:{get:function(){return this._destroyTextureAtlas},set:function(e){this._destroyTextureAtlas=e}},sizeInBytes:{get:function(){return this._textureAtlas.sizeInBytes}},ready:{get:function(){return this._allBillboardsReady}},billboardTextureCache:{get:function(){return this._billboardTextureCache}},coarseDepthTestDistance:{get:function(){return this._coarseDepthTestDistance},set:function(e){this._coarseDepthTestDistance=e}},threePointDepthTestDistance:{get:function(){return this._threePointDepthTestDistance},set:function(e){this._threePointDepthTestDistance=e}}});function iAe(e){let t=e.length;for(let n=0;n<t;++n)e[n]&&e[n]._destroy()}Sd.prototype.add=function(e){let t=new Fr(e,this);return t._index=this._billboards.length,this._billboards.push(t),this._createVertexArray=!0,t};Sd.prototype.remove=function(e){return this.contains(e)?(this._billboards[e._index]=void 0,this._billboardsRemoved=!0,this._createVertexArray=!0,e._destroy(),!0):!1};Sd.prototype.removeAll=function(){iAe(this._billboards),this._billboards=[],this._billboardsToUpdate=[],this._billboardsToUpdateIndex=0,this._billboardsRemoved=!1,this._createVertexArray=!0};function SZ(e){if(e._billboardsRemoved){e._billboardsRemoved=!1;let t=[],n=e._billboards,i=n.length;for(let r=0,o=0;r<i;++r){let s=n[r];l(s)&&(s._index=o++,t.push(s))}e._billboards=t}}Sd.prototype._updateBillboard=function(e,t){e._dirty||(this._billboardsToUpdate[this._billboardsToUpdateIndex++]=e),++this._propertiesChanged[t]};Sd.prototype.contains=function(e){return l(e)&&e._billboardCollection===this};Sd.prototype.get=function(e){return SZ(this),this._billboards[e]};function Yye(e){let t=e.cache.billboardCollection_indexBufferInstanced;return l(t)||(t=tt.createIndexBuffer({context:e,typedArray:new Uint16Array([0,1,2,0,2,3]),usage:Me.STATIC_DRAW,indexDatatype:je.UNSIGNED_SHORT}),t.vertexArrayDestroyable=!1,e.cache.billboardCollection_indexBufferInstanced=t),t}function glt(e){let t=e.cache.billboardCollection_vertexBufferInstanced;return l(t)||(t=tt.createVertexBuffer({context:e,typedArray:new Float32Array([0,0,1,0,1,1,0,1]),usage:Me.STATIC_DRAW}),t.vertexArrayDestroyable=!1,e.cache.billboardCollection_vertexBufferInstanced=t),t}Sd.prototype.computeNewBuffersUsage=function(){let e=this._buffersUsage,t=!1,n=this._propertiesChanged;for(let i=0;i<vZ;++i){let r=n[i]===0?Me.STATIC_DRAW:Me.STREAM_DRAW;t=t||e[i]!==r,e[i]=r}return t};function _lt(e,t,n,i,r){let o=[{index:Br.positionHighAndScale,componentsPerAttribute:4,componentDatatype:Y.FLOAT,usage:n[c1]},{index:Br.positionLowAndRotation,componentsPerAttribute:4,componentDatatype:Y.FLOAT,usage:n[c1]},{index:Br.compressedAttribute0,componentsPerAttribute:4,componentDatatype:Y.FLOAT,usage:n[Xye]},{index:Br.compressedAttribute1,componentsPerAttribute:4,componentDatatype:Y.FLOAT,usage:n[Zye]},{index:Br.compressedAttribute2,componentsPerAttribute:4,componentDatatype:Y.FLOAT,usage:n[$ye]},{index:Br.eyeOffset,componentsPerAttribute:4,componentDatatype:Y.FLOAT,usage:n[Kye]},{index:Br.scaleByDistance,componentsPerAttribute:4,componentDatatype:Y.FLOAT,usage:n[Jye]},{index:Br.pixelOffsetScaleByDistance,componentsPerAttribute:4,componentDatatype:Y.FLOAT,usage:n[Qye]},{index:Br.compressedAttribute3,componentsPerAttribute:4,componentDatatype:Y.FLOAT,usage:n[eAe]},{index:Br.textureCoordinateBoundsOrLabelTranslate,componentsPerAttribute:4,componentDatatype:Y.FLOAT,usage:n[plt]},{index:Br.splitDirection,componentsPerAttribute:1,componentDatatype:Y.FLOAT,usage:n[nAe]},{index:Br.direction,componentsPerAttribute:2,componentDatatype:Y.FLOAT,vertexBuffer:glt(e)}];return l(i)&&o.push({index:Br.a_batchId,componentsPerAttribute:1,componentDatatype:Y.FLOAT,bufferUsage:Me.STATIC_DRAW}),r&&o.push({index:Br.sdf,componentsPerAttribute:2,componentDatatype:Y.FLOAT,usage:n[tAe]}),new k_(e,o,t,!0)}var bZ=new Sn;function rAe(e,t){let n=e.center,i=t.x-n.x,r=t.y-n.y,o=t.z-n.z,s=Math.sqrt(i*i+r*r+o*o);s>e.radius&&(e.radius=s)}function oAe(e,t,n,i){let r=n[Br.positionHighAndScale],o=n[Br.positionLowAndRotation],s=i._getActualPosition();e._mode===re.SCENE3D&&(rAe(e._baseVolume,s),e._boundingVolumeDirty=!0),Sn.fromCartesian(s,bZ);let a=i.scale,c=i.rotation;c!==0&&(e._shaderRotation=!0),e._maxScale=Math.max(e._maxScale,a);let u=bZ.high,f=bZ.low;r(i._index,u.x,u.y,u.z,a),o(i._index,f.x,f.y,f.z,c)}var Ly=new U,vd=32768,wZ=65536,xZ=4096,Tx=256,ylt=128,Alt=32,blt=8,o4=4,xlt=1/256,sAe=new et;function aAe(e,t,n,i){let r=n[Br.compressedAttribute0],o=i.pixelOffset,s=o.x,a=o.y,c=i._translate,u=c.x,f=c.y;e._maxPixelOffset=Math.max(e._maxPixelOffset,Math.abs(s+u),Math.abs(-a+f));let d=i.horizontalOrigin,p=i._verticalOrigin,g=i.show&&i.clusterShow;i.color.alpha===0&&(g=!1),p===qn.BASELINE&&(p=qn.BOTTOM),e._allHorizontalCenter=e._allHorizontalCenter&&d===Hi.CENTER,e._allVerticalCenter=e._allVerticalCenter&&p===qn.CENTER;let m=0,y=0;if(i.ready){let I=i.computeTextureCoordinates(sAe);m=I.x,y=I.y}let A=Math.floor(P.clamp(s,-vd,vd)+vd)*ylt;A+=(d+1)*Alt,A+=(p+1)*blt,A+=(g?1:0)*o4;let b=Math.floor(P.clamp(a,-vd,vd)+vd)*Tx,x=Math.floor(P.clamp(u*o4,-vd,vd)+vd)*Tx,T=(P.clamp(f*o4,-vd,vd)+vd)*xlt,E=Math.floor(T),v=Math.floor((T-E)*Tx);b+=E,x+=v,Ly.x=m,Ly.y=y;let S=cn.compressTextureCoordinates(Ly);r(i._index,A,b,x,S)}function cAe(e,t,n,i){let r=n[Br.compressedAttribute1],o=i.alignedAxis;h.equals(o,h.ZERO)||(o=h.normalize(o,new h),e._shaderAlignedAxis=!0);let s=0,a=1,c=1,u=1,f=i.translucencyByDistance;l(f)&&(s=f.near,a=f.nearValue,c=f.far,u=f.farValue,(a!==1||u!==1)&&(e._shaderTranslucencyByDistance=!0));let d=Math.round(i.width??0);e._maxSize=Math.max(e._maxSize,d);let p=P.clamp(d,0,wZ),g=0;Math.abs(h.magnitudeSquared(o)-1)<P.EPSILON6&&(g=cn.octEncodeFloat(o)),a=P.clamp(a,0,1),a=a===1?255:a*255|0,p=p*Tx+a,u=P.clamp(u,0,1),u=u===1?255:u*255|0,g=g*Tx+u,r(i._index,p,g,s,c)}function EZ(e,t,n,i){let r=n[Br.compressedAttribute2],o=i.color,s=l(e._batchTable)?z.WHITE:i.getPickId(t.context).color,a=i.sizeInMeters?1:0,c=i.alignedAxis,u=h.equals(c,h.ZERO)?c:h.normalize(c,new h),f=Math.abs(h.magnitudeSquared(u)-1)<P.EPSILON6?1:0;e._allSizedInMeters=e._allSizedInMeters&&a===1;let d=i.height??0;e._maxSize=Math.max(e._maxSize,d);let p=i._labelHorizontalOrigin??-2;p+=2;let g=cn.encodeRGB8(o),m=cn.encodeRGB8(s),y=z.floatToByte(o.alpha)*wZ+z.floatToByte(s.alpha)*Tx+(a*2+f),A=d*o4+p;r(i._index,g,m,y,A)}function CZ(e,t,n,i){let r=n[Br.eyeOffset],o=i.eyeOffset,s=o.z;if(i._heightReference!==We.NONE&&(s*=1.005),e._maxEyeOffset=Math.max(e._maxEyeOffset,Math.abs(o.x),Math.abs(o.y),Math.abs(s)),Ly.x=0,Ly.y=0,i.ready){let c=i.computeTextureCoordinates(sAe);Ly.x=c.width,Ly.y=c.height}let a=cn.compressTextureCoordinates(Ly);r(i._index,o.x,o.y,s,a)}function lAe(e,t,n,i){let r=n[Br.scaleByDistance],o=0,s=1,a=1,c=1,u=i.scaleByDistance;l(u)&&(o=u.near,s=u.nearValue,a=u.far,c=u.farValue,(s!==1||c!==1)&&(e._shaderScaleByDistance=!0)),r(i._index,o,s,a,c)}function uAe(e,t,n,i){let r=n[Br.pixelOffsetScaleByDistance],o=0,s=1,a=1,c=1,u=i.pixelOffsetScaleByDistance;l(u)&&(o=u.near,s=u.nearValue,a=u.far,c=u.farValue,(s!==1||c!==1)&&(e._shaderPixelOffsetScaleByDistance=!0)),r(i._index,o,s,a,c)}function fAe(e,t,n,i){let r=n[Br.compressedAttribute3],o=0,s=Number.MAX_VALUE,a=i.distanceDisplayCondition;l(a)&&(o=a.near,s=a.far,o*=o,s*=s,e._shaderDistanceDisplayCondition=!0);let c=i.disableDepthTestDistance,u=us(i.heightReference)&&t.context.depthTexture;c*=c,(u||c>0)&&(e._shaderDisableDepthDistance=!0,c===Number.POSITIVE_INFINITY&&(c=-1));let f,d;l(i._labelDimensions)?(d=i._labelDimensions.x,f=i._labelDimensions.y):(d=i.width??0,f=i.height??0);let p=Math.floor(P.clamp(d,0,xZ)),g=Math.floor(P.clamp(f,0,xZ)),m=p*xZ+g;r(i._index,o,s,c,m)}function dAe(e,t,n,i){if(us(i.heightReference)){let a=e._scene,c=t.context,u=t.globeTranslucencyState.translucent,f=l(a.globe)&&a.globe.depthTestAgainstTerrain;e._shaderClampToGround=c.depthTexture&&!u&&f}let r=n[Br.textureCoordinateBoundsOrLabelTranslate],o=0,s=0;l(i._labelTranslate)&&(o=i._labelTranslate.x,s=i._labelTranslate.y),r(i._index,o,s,0,0)}function Tlt(e,t,n,i){if(!l(e._batchTable))return;let r=n[Br.a_batchId],o=i._batchIndex;r(i._index,o)}function hAe(e,t,n,i){if(!e._sdf)return;let r=n[Br.sdf],o=i.outlineColor,s=i.outlineWidth,a=cn.encodeRGB8(o),c=s/ec.RADIUS,u=z.floatToByte(o.alpha)*wZ+z.floatToByte(c)*Tx;r(i._index,a,u)}function mAe(e,t,n,i){let r=n[Br.splitDirection],o=0,s=i.splitDirection;l(s)&&(o=s),r(i._index,o)}function Elt(e,t,n,i){oAe(e,t,n,i),aAe(e,t,n,i),cAe(e,t,n,i),EZ(e,t,n,i),CZ(e,t,n,i),lAe(e,t,n,i),uAe(e,t,n,i),fAe(e,t,n,i),dAe(e,t,n,i),Tlt(e,t,n,i),hAe(e,t,n,i),mAe(e,t,n,i)}function TZ(e,t,n,i,r,o){let s;i.mode===re.SCENE3D?(s=e._baseVolume,e._boundingVolumeDirty=!0):s=e._baseVolume2D;let a=[];for(let c=0;c<n;++c){let u=t[c],f=u.position,d=Fr._computeActualPosition(u,f,i,r);l(d)&&(u._setActualPosition(d),o?a.push(d):rAe(s,d))}o&&ue.fromPoints(a,s)}function Clt(e,t){let n=t.mode,i=e._billboards,r=e._billboardsToUpdate,o=e._modelMatrix;e._createVertexArray||e._mode!==n||n!==re.SCENE3D&&!M.equals(o,e.modelMatrix)?(e._mode=n,M.clone(e.modelMatrix,o),e._createVertexArray=!0,(n===re.SCENE3D||n===re.SCENE2D||n===re.COLUMBUS_VIEW)&&TZ(e,i,i.length,t,o,!0)):n===re.MORPHING?TZ(e,i,i.length,t,o,!0):(n===re.SCENE2D||n===re.COLUMBUS_VIEW)&&TZ(e,r,e._billboardsToUpdateIndex,t,o,!1)}function vlt(e,t,n){let i=1;(!e._allSizedInMeters||e._maxPixelOffset!==0)&&(i=t.camera.getPixelSize(n,t.context.drawingBufferWidth,t.context.drawingBufferHeight));let r=i*e._maxScale*e._maxSize*2;e._allHorizontalCenter&&e._allVerticalCenter&&(r*=.5);let o=i*e._maxPixelOffset+e._maxEyeOffset;n.radius+=r+o}function Slt(e,t){let i=t.createViewportQuadCommand(`uniform sampler2D billboard_texture; -in vec2 v_textureCoordinates; +`;function Fxe(){}Fxe.buildModelDrawCommand=function(e,t){let n=e.shaderBuilder,i=jut(e,n,t),r=Hut(e,i,t),o=e.model;return l(o.classificationType)?new N4({primitiveRenderResources:e,command:r}):new F4({primitiveRenderResources:e,command:r})};function jut(e,t,n){t.addVertexLines(B4),t.addFragmentLines(k4);let i=e.model,r=t.buildShaderProgram(n.context);return i._pipelineResources.push(r),r}function Hut(e,t,n){let i=Gut(e),r=new Vn({context:n.context,indexBuffer:i,attributes:e.attributes}),o=e.model;o._pipelineResources.push(r);let s=e.alphaOptions.pass,a=o.sceneGraph,c=n.mode===re.SCENE3D,u,f;if(!c&&!n.scene3DOnly&&o._projectTo2D)u=M.multiplyTransformation(a._computedModelMatrix,e.runtimeNode.computedTransform,new M),f=e.runtimePrimitive.boundingSphere2D;else{let x=c?a._computedModelMatrix:a._computedModelMatrix2D;u=M.multiplyTransformation(x,e.runtimeNode.computedTransform,new M),f=ue.transform(e.boundingSphere,u)}let d=Ze(Ge.fromCache(e.renderStateOptions),!0);d.cull.face=xt.getCullFace(u,e.primitiveType),d=Ge.fromCache(d);let p=l(o.classificationType),g=p?!1:Pn.castShadows(o.shadows),m=p?!1:Pn.receiveShadows(o.shadows),y=p?void 0:e.pickId,A=p?void 0:e.snapId;return new at({boundingVolume:f,modelMatrix:u,uniformMap:e.uniformMap,renderState:d,vertexArray:r,shaderProgram:t,cull:o.cull,pass:s,count:e.count,owner:o,pickId:y,snapId:A,pickMetadataAllowed:!0,instanceCount:e.instanceCount,primitiveType:e.primitiveType,debugShowBoundingVolume:o.debugShowBoundingVolume,castShadows:g,receiveShadows:m})}function Gut(e){let t=e.wireframeIndexBuffer;if(l(t))return t;let n=e.indices;if(l(n))return n.buffer}var U4=Fxe;function nl(e){e=e??H.EMPTY_OBJECT;let t=e.modelComponents;this._model=e.model,this._components=t,this._pipelineStages=[],this._updateStages=[],this._runtimeNodes=[],this._rootNodes=[],this._skinnedNodes=[],this._runtimeSkins=[],this.modelPipelineStages=[],this._boundingSphere=void 0,this._positionMin=void 0,this._positionMax=void 0,this._boundingSphere2D=void 0,this._computedModelMatrix=M.clone(M.IDENTITY),this._computedModelMatrix2D=M.clone(M.IDENTITY),this._axisCorrectionMatrix=xt.getAxisCorrectionMatrix(t.upAxis,t.forwardAxis,new M),this._runtimeArticulations={},Wut(this)}Object.defineProperties(nl.prototype,{components:{get:function(){return this._components}},computedModelMatrix:{get:function(){return this._computedModelMatrix}},axisCorrectionMatrix:{get:function(){return this._axisCorrectionMatrix}},boundingSphere:{get:function(){return this._boundingSphere}}});function Wut(e){let t=e._components,n=t.scene,r=e._model.modelMatrix;Bxe(e,r);let o=t.articulations,s=o.length,a=e._runtimeArticulations;for(let x=0;x<s;x++){let T=o[x],E=new Hz({articulation:T,sceneGraph:e}),v=E.name;a[v]=E}let c=t.nodes,u=c.length;e._runtimeNodes=new Array(u);let d=n.nodes.length,p=M.IDENTITY;for(let x=0;x<d;x++){let T=n.nodes[x],E=kxe(e,T,p);e._rootNodes.push(E)}let g=t.skins,m=e._runtimeSkins,y=g.length;for(let x=0;x<y;x++){let T=g[x];m.push(new T4({skin:T,sceneGraph:e}))}let A=e._skinnedNodes,b=A.length;for(let x=0;x<b;x++){let T=A[x],E=e._runtimeNodes[T],S=c[T].skin.index;E._runtimeSkin=m[S],E.updateJointMatrices()}e.applyArticulations()}function Bxe(e,t){let n=e._components,i=e._model;e._computedModelMatrix=M.multiplyTransformation(t,n.transform,e._computedModelMatrix),e._computedModelMatrix=M.multiplyTransformation(e._computedModelMatrix,e._axisCorrectionMatrix,e._computedModelMatrix),e._computedModelMatrix=M.multiplyByUniformScale(e._computedModelMatrix,i.computedScale,e._computedModelMatrix)}var qut=new h;function Yut(e,t){let n=e._computedModelMatrix,i=M.getTranslation(n,qut);if(!h.equals(i,h.ZERO))e._computedModelMatrix2D=At.basisTo2D(t.mapProjection,n,e._computedModelMatrix2D);else{let r=e.boundingSphere.center,o=At.ellipsoidTo2DModelMatrix(t.mapProjection,r,e._computedModelMatrix2D);e._computedModelMatrix2D=M.multiply(o,n,e._computedModelMatrix2D)}e._boundingSphere2D=ue.transform(e._boundingSphere,e._computedModelMatrix2D,e._boundingSphere2D)}function kxe(e,t,n){let i=[],r=xt.getNodeTransform(t),o=t.children.length;for(let f=0;f<o;f++){let d=t.children[f],p=M.multiplyTransformation(n,r,new M),g=kxe(e,d,p);i.push(g)}let s=new aV({node:t,transform:r,transformToRoot:n,children:i,sceneGraph:e}),a=t.primitives.length;for(let f=0;f<a;f++)s.runtimePrimitives.push(new x4({primitive:t.primitives[f],node:t,model:e._model}));let c=t.index;e._runtimeNodes[c]=s,l(t.skin)&&e._skinnedNodes.push(c);let u=t.name;if(l(u)){let f=e._model,d=new Qz(f,s);f._nodesByName[u]=d}return c}var Xut=new h,Kut=new h,$ut=new h,Jut=new h;nl.prototype.buildDrawCommands=function(e){let t=this.buildRenderResources(e);this.computeBoundingVolumes(t),this.createDrawCommands(t,e)};nl.prototype.buildRenderResources=function(e){let t=this._model,n=new E4(t);t.statistics.clear(),this.configurePipeline(e);let i=this.modelPipelineStages;for(let r=0;r<i.length;r++)i[r].process(n,t,e);for(let r=0;r<this._runtimeNodes.length;r++){let o=this._runtimeNodes[r];if(!l(o))continue;o.configurePipeline();let s=o.pipelineStages,a=new R4(n,o);n.nodeRenderResources[r]=a;for(let c=0;c<s.length;c++)s[c].process(a,o.node,e);for(let c=0;c<o.runtimePrimitives.length;c++){let u=o.runtimePrimitives[c];u.configurePipeline(e);let f=u.pipelineStages,d=new M4(a,u);a.primitiveRenderResources[c]=d;for(let p=0;p<f.length;p++)f[p].process(d,u.primitive,e)}}return n};nl.prototype.computeBoundingVolumes=function(e){let t=this._model,n=h.fromElements(Number.MAX_VALUE,Number.MAX_VALUE,Number.MAX_VALUE,Xut),i=h.fromElements(-Number.MAX_VALUE,-Number.MAX_VALUE,-Number.MAX_VALUE,Kut);for(let r=0;r<this._runtimeNodes.length;r++){let o=this._runtimeNodes[r];if(!l(o))continue;let s=e.nodeRenderResources[r],a=o.computedTransform;for(let c=0;c<o.runtimePrimitives.length;c++){let u=o.runtimePrimitives[c],f=s.primitiveRenderResources[c];u.boundingSphere=ue.clone(f.boundingSphere,new ue);let d=M.multiplyByPoint(a,f.positionMin,$ut),p=M.multiplyByPoint(a,f.positionMax,Jut);h.minimumByComponent(n,d,n),h.minimumByComponent(n,p,n),h.maximumByComponent(i,p,i),h.maximumByComponent(i,d,i)}}this._positionMin=h.clone(n,this._positionMin),this._positionMax=h.clone(i,this._positionMax),this._boundingSphere=ue.fromCornerPoints(n,i,new ue),this._boundingSphere=ue.transformWithoutScale(this._boundingSphere,this._axisCorrectionMatrix,this._boundingSphere),this._boundingSphere=ue.transform(this._boundingSphere,this._components.transform,this._boundingSphere),t._boundingSphere=ue.transform(this._boundingSphere,t.modelMatrix,t._boundingSphere),t._initialRadius=t._boundingSphere.radius,t._boundingSphere.radius*=t._clampedScale};nl.prototype.createDrawCommands=function(e,t){for(let n=0;n<this._runtimeNodes.length;n++){let i=this._runtimeNodes[n];if(!l(i))continue;let r=e.nodeRenderResources[n];for(let o=0;o<i.runtimePrimitives.length;o++){let s=i.runtimePrimitives[o],a=r.primitiveRenderResources[o],c=U4.buildModelDrawCommand(a,t);s.drawCommand=c}}};nl.prototype.configurePipeline=function(e){let t=this.modelPipelineStages;t.length=0;let n=this._model,i=e.fog.enabled&&e.fog.renderable;if(l(n.color)&&t.push(Cx),l(n.classificationType))return;n.imageBasedLighting.enabled&&t.push(zz),n.isClippingEnabled()&&t.push(qz);let r=(n._clippingPolygonData?.polygonRings.length??0)>0;n.isClippingPolygonsEnabled()&&r&&t.push(Kz),n.hasDrapedVectors()&&t.push(Zz),n.hasSilhouette(e)&&t.push(w4),l(n.splitDirection)&&n.splitDirection!==Yo.NONE&&t.push(D4),Qo.is3DTiles(n.type)&&t.push(Lz),i&&t.push(kz)};nl.prototype.update=function(e,t){let n,i,r;for(n=0;n<this._runtimeNodes.length;n++){let o=this._runtimeNodes[n];if(!l(o))continue;for(i=0;i<o.updateStages.length;i++)o.updateStages[i].update(o,this,e);let s=e.mode!==re.SCENE3D&&this._model._projectTo2D;for(t&&!s&&this.updateJointMatrices(),i=0;i<o.runtimePrimitives.length;i++){let a=o.runtimePrimitives[i];for(r=0;r<a.updateStages.length;r++)a.updateStages[r].update(a,this)}}};nl.prototype.updateModelMatrix=function(e,t){Bxe(this,e),t.mode!==re.SCENE3D&&Yut(this,t);let n=this._rootNodes;for(let i=0;i<n.length;i++){let r=this._runtimeNodes[n[i]];r._transformDirty=!0}};nl.prototype.updateJointMatrices=function(){let e=this._skinnedNodes,t=e.length;for(let n=0;n<t;n++){let i=e[n];this._runtimeNodes[i].updateJointMatrices()}};function Uxe(e,t,n,i,r){if(n&&!t.show)return;let o=t.children.length;for(let c=0;c<o;c++){let u=t.getChild(c);Uxe(e,u,n,i,r)}let s=t.runtimePrimitives,a=s.length;for(let c=0;c<a;c++){let u=s[c];i(u,r)}}function z4(e,t,n,i){let r=e._rootNodes,o=r.length;for(let s=0;s<o;s++){let a=r[s],c=e._runtimeNodes[a];Uxe(e,c,t,n,i)}}var Zut={backFaceCulling:void 0};nl.prototype.updateBackFaceCulling=function(e){let t=Zut;t.backFaceCulling=e,z4(this,!1,Qut,t)};function Qut(e,t){let n=e.drawCommand;n.backFaceCulling=t.backFaceCulling}var eft={shadowMode:void 0};nl.prototype.updateShadows=function(e){let t=eft;t.shadowMode=e,z4(this,!1,tft,t)};function tft(e,t){let n=e.drawCommand;n.shadows=t.shadowMode}var nft={debugShowBoundingVolume:void 0};nl.prototype.updateShowBoundingVolume=function(e){let t=nft;t.debugShowBoundingVolume=e,z4(this,!1,ift,t)};function ift(e,t){let n=e.drawCommand;n.debugShowBoundingVolume=t.debugShowBoundingVolume}var zxe=[],Vxe=[],jxe=[],rft={frameState:void 0,hasSilhouette:void 0};nl.prototype.pushDrawCommands=function(e){let t=zxe;t.length=0;let n=Vxe;n.length=0;let i=jxe;i.length=0;let r=rft;r.hasSilhouette=this._model.hasSilhouette(e),r.frameState=e,z4(this,!0,oft,r),Zn(e.commandList,t),Zn(e.commandList,n),Zn(e.commandList,i)};function oft(e,t){let n=t.frameState,i=t.hasSilhouette,r=n.passes,o=zxe,s=Vxe,a=jxe,c=e.drawCommand;c.pushCommands(n,n.commandList);let u=e.primitive.material;l(u)&&l(u.planarFill)&&(n.planarFillRequested=!0),i&&!r.pick&&c.pushSilhouetteCommands(n,o),l(c.pushEdgeCommands)&&c.pushEdgeCommands(n,s),l(c.pushPlanarFillIdCommands)&&c.pushPlanarFillIdCommands(n,a)}nl.prototype.setArticulationStage=function(e,t){let n=e.split(" ");if(n.length!==2)return;let i=n[0],r=n[1],o=this._runtimeArticulations[i];l(o)&&o.setArticulationStage(r,t)};nl.prototype.applyArticulations=function(){let e=this._runtimeArticulations;for(let t in e)e.hasOwnProperty(t)&&e[t].apply()};var V4=nl;function My(){this.pointsLength=0,this.trianglesLength=0,this.geometryByteLength=0,this.texturesByteLength=0,this.propertyTablesByteLength=0,this._bufferIdSet={},this._textureIdByteLengths={},this._batchTextureIdMap=new zt}Object.defineProperties(My.prototype,{batchTexturesByteLength:{get:function(){let e=this._batchTextureIdMap.length,t=this._batchTextureIdMap.values,n=0;for(let i=0;i<e;i++)n+=t[i].byteLength;return n}}});My.prototype.clear=function(){this.pointsLength=0,this.trianglesLength=0,this.geometryByteLength=0,this.texturesByteLength=0,this.propertyTablesByteLength=0,this._bufferIdSet={},this._textureIdByteLengths={},this._batchTextureIdMap.removeAll()};My.prototype.addBuffer=function(e,t){if(!this._bufferIdSet.hasOwnProperty(e._id)){let n=t?2:1;this.geometryByteLength+=e.sizeInBytes*n}this._bufferIdSet[e._id]=!0};My.prototype.addTexture=function(e){this._textureIdByteLengths.hasOwnProperty(e._id)||(this.texturesByteLength+=e.sizeInBytes,this._textureIdByteLengths[e._id]=e.sizeInBytes)};My.prototype.getTextureIds=function(){return Object.keys(this._textureIdByteLengths)};My.prototype.getTextureByteLengthById=function(e){return this._textureIdByteLengths[e]};My.prototype.addBatchTexture=function(e){this._batchTextureIdMap.contains(e._id)||this._batchTextureIdMap.set(e._id,e)};var j4=My;var qxe=js(rN(),1);var Hxe={},Rx=Uint32Array.BYTES_PER_ELEMENT;Hxe.parse=function(e,t){t=t??0;let n=new Uint8Array(e),i=new DataView(e);t+=Rx;let r=i.getUint32(t,!0);if(r!==1)throw new oe(`Only Point Cloud tile version 1 is supported. Version ${r} is not.`);t+=Rx,t+=Rx;let o=i.getUint32(t,!0);if(o===0)throw new oe("Feature table must have a byte length greater than zero");t+=Rx;let s=i.getUint32(t,!0);t+=Rx;let a=i.getUint32(t,!0);t+=Rx;let c=i.getUint32(t,!0);t+=Rx;let u=Fo(n,t,o);t+=o;let f=new Uint8Array(e,t,s);t+=s;let d,p;a>0&&(d=Fo(n,t,a),Object.keys(d).length===0&&(d=void 0),t+=a,c>0&&(p=new Uint8Array(e,t,c),p=new Uint8Array(p)));let g=new Cp(u,f),m=g.getGlobalProperty("POINTS_LENGTH");if(g.featuresLength=m,!l(m))throw new oe("Feature table global property: POINTS_LENGTH must be defined");let y=g.getGlobalProperty("RTC_CENTER",Y.FLOAT,3);l(y)&&(y=h.unpack(y));let A=aft(g,d);if(A.rtcCenter=y,A.pointsLength=m,!A.hasPositions){let b=cft(g);A.positions=b,A.hasPositions=A.hasPositions||l(b)}if(!A.hasPositions)throw new oe("Either POSITION or POSITION_QUANTIZED must be defined.");if(!A.hasNormals){let b=uft(g);A.normals=b,A.hasNormals=A.hasNormals||l(b)}if(!A.hasColors){let b=lft(g);A.colors=b,A.hasColors=A.hasColors||l(b),A.hasConstantColor=l(A.constantColor),A.isTranslucent=l(b)&&b.isTranslucent}if(!A.hasBatchIds){let b=fft(g);A.batchIds=b,A.hasBatchIds=A.hasBatchIds||l(b)}if(A.hasBatchIds){let b=g.getGlobalProperty("BATCH_LENGTH");if(!l(b))throw new oe("Global property: BATCH_LENGTH must be defined when BATCH_ID is defined.");A.batchLength=b}return(l(d)||l(p))&&(A.batchTableJson=d,A.batchTableBinary=p),sft(A),A};function sft(e){let t=e.batchTableJson;if(!l(t))return;let n=e.batchTableBinary;if(l(n))return;let i=Object.keys(e.draco?.batchTableProperties??{}),r=[];for(let o of Object.keys(t)){let a=t[o].byteOffset;l(a)&&(i.includes(o)||r.push(o))}for(let o of r)yt("PntsParser-invalidBinaryBodyReference",`The point cloud data contained a binary property ${o} that could not be resolved - skipping`),delete t[o]}function aft(e,t){let n=e.json,i,r,o,s=l(n.extensions)?n.extensions["3DTILES_draco_point_compression"]:void 0,a=l(t)&&l(t.extensions)?t.extensions["3DTILES_draco_point_compression"]:void 0;l(a)&&(o=a.properties);let c,u,f,d,p;if(l(s)){r=s.properties;let m=s.byteOffset,y=s.byteLength;if(!l(r)||!l(m)||!l(y))throw new oe("Draco properties, byteOffset, and byteLength must be defined");i=e.buffer.slice(m,m+y),c=l(r.POSITION),u=l(r.RGB)||l(r.RGBA),f=l(r.NORMAL),d=l(r.BATCH_ID),p=l(r.RGBA)}let g;return l(i)&&(g={buffer:i,featureTableProperties:r,batchTableProperties:o,properties:Mt(r,o),dequantizeInShader:!0}),{draco:g,hasPositions:c,hasColors:u,isTranslucent:p,hasNormals:f,hasBatchIds:d}}function cft(e){let t=e.json,n;if(l(t.POSITION))return n=e.getPropertyArray("POSITION",Y.FLOAT,3),{name:ct.POSITION,semantic:ct.POSITION,typedArray:n,isQuantized:!1,componentDatatype:Y.FLOAT,type:Vt.VEC3};if(l(t.POSITION_QUANTIZED)){n=e.getPropertyArray("POSITION_QUANTIZED",Y.UNSIGNED_SHORT,3);let i=e.getGlobalProperty("QUANTIZED_VOLUME_SCALE",Y.FLOAT,3);if(!l(i))throw new oe("Global property: QUANTIZED_VOLUME_SCALE must be defined for quantized positions.");let r=65535,o=e.getGlobalProperty("QUANTIZED_VOLUME_OFFSET",Y.FLOAT,3);if(!l(o))throw new oe("Global property: QUANTIZED_VOLUME_OFFSET must be defined for quantized positions.");return{name:ct.POSITION,semantic:ct.POSITION,typedArray:n,isQuantized:!0,componentDatatype:Y.FLOAT,type:Vt.VEC3,quantizedRange:r,quantizedVolumeOffset:h.unpack(o),quantizedVolumeScale:h.unpack(i),quantizedComponentDatatype:Y.UNSIGNED_SHORT,quantizedType:Vt.VEC3}}}function lft(e){let t=e.json,n;if(l(t.RGBA))return n=e.getPropertyArray("RGBA",Y.UNSIGNED_BYTE,4),{name:ct.COLOR,semantic:ct.COLOR,setIndex:0,typedArray:n,componentDatatype:Y.UNSIGNED_BYTE,type:Vt.VEC4,normalized:!0,isRGB565:!1,isTranslucent:!0};if(l(t.RGB))return n=e.getPropertyArray("RGB",Y.UNSIGNED_BYTE,3),{name:"COLOR",semantic:ct.COLOR,setIndex:0,typedArray:n,componentDatatype:Y.UNSIGNED_BYTE,type:Vt.VEC3,normalized:!0,isRGB565:!1,isTranslucent:!1};if(l(t.RGB565))return n=e.getPropertyArray("RGB565",Y.UNSIGNED_SHORT,1),{name:"COLOR",semantic:ct.COLOR,setIndex:0,typedArray:n,componentDatatype:Y.FLOAT,type:Vt.VEC3,normalized:!1,isRGB565:!0,isTranslucent:!1};if(l(t.CONSTANT_RGBA)){let i=e.getGlobalProperty("CONSTANT_RGBA",Y.UNSIGNED_BYTE,4),r=i[3],o=z.fromBytes(i[0],i[1],i[2],r),s=r<255;return{name:ct.COLOR,semantic:ct.COLOR,setIndex:0,constantColor:o,componentDatatype:Y.FLOAT,type:Vt.VEC4,isQuantized:!1,isTranslucent:s}}}function uft(e){let t=e.json,n;if(l(t.NORMAL))return n=e.getPropertyArray("NORMAL",Y.FLOAT,3),{name:ct.NORMAL,semantic:ct.NORMAL,typedArray:n,octEncoded:!1,octEncodedZXY:!1,componentDatatype:Y.FLOAT,type:Vt.VEC3};if(l(t.NORMAL_OCT16P))return n=e.getPropertyArray("NORMAL_OCT16P",Y.UNSIGNED_BYTE,2),{name:ct.NORMAL,semantic:ct.NORMAL,typedArray:n,octEncoded:!0,octEncodedZXY:!1,quantizedRange:(1<<8)-1,quantizedType:Vt.VEC2,quantizedComponentDatatype:Y.UNSIGNED_BYTE,componentDatatype:Y.FLOAT,type:Vt.VEC3}}function fft(e){let t=e.json;if(l(t.BATCH_ID)){let n=e.getPropertyArray("BATCH_ID",Y.UNSIGNED_SHORT,1);return{name:ct.FEATURE_ID,semantic:ct.FEATURE_ID,setIndex:0,typedArray:n,componentDatatype:Y.fromTypedArray(n),type:Vt.SCALAR}}}var fS=Hxe;var dft=vn.Components,hft=vn.Scene,mft=vn.Node,pft=vn.Primitive,gft=vn.Attribute,Gxe=vn.Quantization,_ft=vn.FeatureIdAttribute,yft=vn.Material,Aft=vn.MetallicRoughness,eQ=class extends cr{constructor(t){super(),t=t??H.EMPTY_OBJECT;let n=t.arrayBuffer,i=t.byteOffset??0;this._arrayBuffer=n,this._byteOffset=i,this._loadAttributesFor2D=t.loadAttributesFor2D??!1,this._parsedContent=void 0,this._decodePromise=void 0,this._decodedAttributes=void 0,this._promise=void 0,this._error=void 0,this._state=Ct.UNLOADED,this._buffers=[],this._components=void 0,this._transform=M.IDENTITY}get cacheKey(){}get components(){return this._components}get transform(){return this._transform}load(){if(l(this._promise))return this._promise;this._parsedContent=fS.parse(this._arrayBuffer,this._byteOffset),this._state=Ct.PROCESSING,this._promise=Promise.resolve(this)}process(t){if(l(this._error)){let n=this._error;throw this._error=void 0,n}if(this._state===Ct.READY)return!0;if(this._state===Ct.PROCESSING){if(l(this._decodePromise))return!1;this._decodePromise=bft(this,t.context)}return!1}unload(){let t=this._buffers;for(let n=0;n<t.length;n++)t[n].destroy();t.length=0,this._components=void 0,this._parsedContent=void 0,this._arrayBuffer=void 0}};function bft(e,t){let i=e._parsedContent.draco,r;if(l(i)?r=Ey.decodePointCloud(i,t):r=Promise.resolve(),!!l(r))return e._decodePromise=r,r.then(function(o){if(!e.isDestroyed())return l(o)&&xft(e,i,o),Oft(e,t),e._state=Ct.READY,e}).catch(function(o){e.unload(),e._state=Ct.FAILED;let s="Failed to load Draco pnts";e._error=e.getError(s,o)})}function xft(e,t,n){e._state=Ct.READY;let i=e._parsedContent,r;if(l(n.POSITION)){if(r={name:"POSITION",semantic:ct.POSITION,typedArray:n.POSITION.array,componentDatatype:Y.FLOAT,type:Vt.VEC3,isQuantized:!1},l(n.POSITION.data.quantization)){let a=n.POSITION.data.quantization,c=a.range,u=h.fromElements(c,c,c),f=h.unpack(a.minValues),d=(1<<a.quantizationBits)-1;r.isQuantized=!0,r.quantizedRange=d,r.quantizedVolumeOffset=f,r.quantizedVolumeScale=u,r.quantizedComponentDatatype=d<=255?Y.UNSIGNED_BYTE:Y.UNSIGNED_SHORT,r.quantizedType=Vt.VEC3}i.positions=r}if(l(n.NORMAL)){if(r={name:"NORMAL",semantic:ct.NORMAL,typedArray:n.NORMAL.array,componentDatatype:Y.FLOAT,type:Vt.VEC3,isQuantized:!1,octEncoded:!1,octEncodedZXY:!1},l(n.NORMAL.data.quantization)){let a=(1<<n.NORMAL.data.quantization.quantizationBits)-1;r.quantizedRange=a,r.octEncoded=!0,r.octEncodedZXY=!0,r.quantizedComponentDatatype=Y.UNSIGNED_BYTE,r.quantizedType=Vt.VEC2}i.normals=r}if(l(n.RGBA)?i.colors={name:"COLOR",semantic:ct.COLOR,setIndex:0,typedArray:n.RGBA.array,componentDatatype:Y.UNSIGNED_BYTE,type:Vt.VEC4,normalized:!0,isTranslucent:!0}:l(n.RGB)&&(i.colors={name:"COLOR",semantic:ct.COLOR,setIndex:0,typedArray:n.RGB.array,componentDatatype:Y.UNSIGNED_BYTE,type:Vt.VEC3,normalized:!0,isTranslucent:!1}),l(n.BATCH_ID)){let a=n.BATCH_ID.array;i.batchIds={name:"_FEATURE_ID",semantic:ct.FEATURE_ID,setIndex:0,typedArray:a,componentDatatype:Y.fromTypedArray(a),type:Vt.SCALAR}}let o=i.batchTableJson,s=t.batchTableProperties;for(let a in s)if(s.hasOwnProperty(a)){let c=n[a];l(o)||(o={}),i.hasDracoBatchTable=!0;let u=c.data;o[a]={byteOffset:u.byteOffset,type:Tft(u.componentsPerAttribute),componentType:Eft(u.componentDatatype),typedArray:c.array}}i.batchTableJson=o}function Tft(e){switch(e){case 1:return"SCALAR";case 2:return"VEC2";case 3:return"VEC3";case 4:return"VEC4"}}function Eft(e){switch(e){case te.BYTE:return"BYTE";case te.UNSIGNED_BYTE:return"UNSIGNED_BYTE";case te.SHORT:return"SHORT";case te.UNSIGNED_SHORT:return"UNSIGNED_SHORT";case te.INT:return"INT";case te.UNSIGNED_INT:return"UNSIGNED_INT";case te.DOUBLE:return"DOUBLE";case te.FLOAT:return"FLOAT"}}function w1(e,t,n){let i=t.typedArray,r;if(t.octEncoded&&(r=new Gxe,r.octEncoded=t.octEncoded,r.octEncodedZXY=t.octEncodedZXY,r.normalizationRange=t.quantizedRange,r.type=t.quantizedType,r.componentDatatype=t.quantizedComponentDatatype),t.isQuantized){r=new Gxe;let a=t.quantizedRange;r.normalizationRange=a,r.quantizedVolumeOffset=h.ZERO;let c=t.quantizedVolumeScale;r.quantizedVolumeDimensions=c,r.quantizedVolumeStepSize=h.divideByScalar(c,a,new h),r.componentDatatype=t.quantizedComponentDatatype,r.type=t.quantizedType}let o=new gft;if(o.name=t.name,o.semantic=t.semantic,o.setIndex=t.setIndex,o.componentDatatype=t.componentDatatype,o.type=t.type,o.normalized=t.normalized??!1,o.min=t.min,o.max=t.max,o.quantization=r,t.isRGB565&&(i=cn.decodeRGB565(i)),l(t.constantColor)){let a=new Array(4);o.constant=z.pack(t.constantColor,a)}else{let a=tt.createVertexBuffer({typedArray:i,context:n,usage:Me.STATIC_DRAW});a.vertexArrayDestroyable=!1,e._buffers.push(a),o.buffer=a}let s=e._loadAttributesFor2D;return o.semantic===ct.POSITION&&s&&(o.typedArray=i),o}var Wxe,H4;function Cft(e){if(!l(H4)){Wxe=new qxe.default(0),H4=new Array(e);for(let t=0;t<e;++t)H4[t]=Wxe.random()}return H4}var vft=new h,Sft=new h,wft=new h;function Ift(e){let t=e.typedArray,n=20,i=t.length/3,r=Math.min(i,n),o=Cft(n),s=Number.MAX_VALUE,a=-Number.MAX_VALUE,c=h.fromElements(s,s,s,vft),u=h.fromElements(a,a,a,Sft),f,d,p;if(e.isQuantized)c=h.ZERO,u=e.quantizedVolumeScale;else for(f=0;f<r;++f)d=Math.floor(o[f]*i),p=h.unpack(t,d*3,wft),h.minimumByComponent(c,p,c),h.maximumByComponent(u,p,u);e.min=h.clone(c),e.max=h.clone(u)}var Pft={name:ct.COLOR,semantic:ct.COLOR,setIndex:0,constantColor:z.DARKGRAY,componentDatatype:Y.FLOAT,type:Vt.VEC4,isQuantized:!1,isTranslucent:!1};function Dft(e,t,n){let i=[],r,o=t.positions;return l(o)&&(Ift(o),r=w1(e,o,n),r.count=t.pointsLength,i.push(r)),l(t.normals)&&(r=w1(e,t.normals,n),r.count=t.pointsLength,i.push(r)),l(t.colors)?(r=w1(e,t.colors,n),r.count=t.pointsLength,i.push(r)):(r=w1(e,Pft,n),r.count=t.pointsLength,i.push(r)),l(t.batchIds)&&(r=w1(e,t.batchIds,n),r.count=t.pointsLength,i.push(r)),i}function Rft(e,t){let n=e.batchLength,i=e.pointsLength,r=e.batchTableJson,o=e.batchTableBinary,s=!l(e.batchIds);return l(o)||l(r)||e.hasDracoBatchTable?wy({count:n??i,batchTable:r,binaryBody:o,parseAsPropertyAttributes:s,customAttributeOutput:t}):new ic({schema:{},propertyTables:[]})}function Oft(e,t){let n=e._parsedContent,i=new Aft;i.metallicFactor=0,i.roughnessFactor=.9;let r=new yft;r.metallicRoughness=i;let o=n.colors;l(o)&&o.isTranslucent&&(r.alphaMode=cg.BLEND);let s=!l(n.normals);r.unlit=s;let a=new pft;if(a.attributes=Dft(e,n,t),a.primitiveType=Oe.POINTS,a.material=r,l(n.batchIds)){let g=new _ft;g.propertyTableId=0,g.setIndex=0,g.positionalLabel="featureId_0",a.featureIds.push(g)}let c=new mft;c.index=0,c.primitives=[a];let u=new hft;u.nodes=[c],u.upAxis=qi.Z,u.forwardAxis=qi.X;let f=new dft;f.scene=u,f.nodes=[c];let d=[];f.structuralMetadata=Rft(n,d),d.length>0&&Mft(e,a,d,t),l(n.rtcCenter)&&(f.transform=M.multiplyByTranslation(f.transform,n.rtcCenter,f.transform));let p=n.positions;l(p)&&p.isQuantized&&(f.transform=M.multiplyByTranslation(f.transform,p.quantizedVolumeOffset,f.transform)),e._components=f,e._parsedContent=void 0,e._arrayBuffer=void 0}function Mft(e,t,n,i){let r=t.attributes,o=n.length;for(let s=0;s<o;s++){let a=n[s],c=tt.createVertexBuffer({typedArray:a.typedArray,context:i,usage:Me.STATIC_DRAW});c.vertexArrayDestroyable=!1,e._buffers.push(c),a.buffer=c,a.typedArray=void 0,r.push(a)}t.propertyAttributeIds=[0]}var G4=eQ;var W4=new h,Yxe=new h,Xxe=new h,I1=new h,Nft=new h,Lft=new h,Fft=new he,Bft=new ue;function q4(e,t,n,i){let r=t*n;return i.x=e[r],i.y=e[r+1],i.z=e[r+2],i}var kft=32,tQ=new Map,nQ=[];function Uft(e,t,n,i,r,o){let s=e.origin.x,a=e.origin.y,c=e.origin.z,u=e.direction.x,f=e.direction.y,d=e.direction.z,p=P.EPSILON6;for(let g=0;g<i;g+=3){let m=n[g]*3,y=n[g+1]*3,A=n[g+2]*3,b=t[m],x=t[m+1],T=t[m+2],E=t[y]-b,v=t[y+1]-x,S=t[y+2]-T,I=t[A]-b,R=t[A+1]-x,O=t[A+2]-T,L=f*O-d*R,_=d*I-u*O,C=u*R-f*I,w=E*L+v*_+S*C,D=s-b,N=a-x,F=c-T,V;if(r){if(w<p)continue;let B=D*L+N*_+F*C;if(B<0||B>w)continue;let j=N*S-F*v,k=F*E-D*S,G=D*v-N*E,q=u*j+f*k+d*G;if(q<0||B+q>w)continue;V=(I*j+R*k+O*G)/w}else{if(Math.abs(w)<p)continue;let B=1/w,j=(D*L+N*_+F*C)*B;if(j<0||j>1)continue;let k=N*S-F*v,G=F*E-D*S,q=D*v-N*E,Q=(u*k+f*G+d*q)*B;if(Q<0||j+Q>1)continue;V=(I*k+R*G+O*q)*B}V>=0&&V<o&&(o=V)}return o}function P1(e,t,n,i,r,o,s){if(!e._ready||n.mode===re.MORPHING)return;let a=Number.MAX_VALUE;o=o??ee.default,i=i??1,r=r??0;let c=n.mode!==re.SCENE3D?n.mapProjection:void 0;if(La.forEachPrimitive(e,{mapProjection:c},function(u,f,d,p){if(l(u.boundingSphere)&&d.length===1){let T=ue.transform(u.boundingSphere,p,Bft),E=xi.raySphere(t,T);if(!l(E))return}if(!l(f.indices))return;let g,m,y=xt.getAttributeBySemantic(f,ct.POSITION),A=tQ.get(f);l(A)||(A={},l(y)&&(A.vertices=La.readAttributeAsTypedArray(y)),l(f.indices)&&(A.indices=La.readIndicesAsTypedArray(f.indices)),tQ.set(f,A),nQ.push(f),nQ.length>kft&&tQ.delete(nQ.shift())),l(y)&&(m=Vt.getNumberOfComponents(y.type),g=A.vertices);let b=A.indices;if(!l(b)||!l(g))return;let x=b.length;if(d.length===1&&i===1){let T=d[0].transform;if(!l(A.world)||!M.equals(A.worldTransform,T)){let I=g.length/m,R=new Float64Array(I*3);for(let O=0;O<I;O++)q4(g,O,m,W4),M.multiplyByPoint(T,W4,I1),R[O*3]=I1.x,R[O*3+1]=I1.y,R[O*3+2]=I1.z;A.world=R,A.worldTransform=M.clone(T,A.worldTransform)}let E=A.world,v=e.backFaceCulling??!0,S=Uft(t,E,b,x,v,a);S<a&&(a=S);return}for(let T=0;T<x;T+=3){let E=b[T],v=b[T+1],S=b[T+2];q4(g,E,m,W4),q4(g,v,m,Yxe),q4(g,S,m,Xxe);for(let I of d){let R=M.multiplyByPoint(I.transform,W4,I1),O=M.multiplyByPoint(I.transform,Yxe,Nft),L=M.multiplyByPoint(I.transform,Xxe,Lft);i!==1&&(br.getPosition(R,o,i,r,R),br.getPosition(O,o,i,r,O),br.getPosition(L,o,i,r,L));let _=xi.rayTriangleParametric(t,R,O,L,e.backFaceCulling??!0);l(_)&&_<a&&_>=0&&(a=_)}}}),a!==Number.MAX_VALUE){if(s=gn.getPoint(t,a,s),n.mode!==re.SCENE3D){h.fromElements(s.y,s.z,s.x,s);let u=n.mapProjection,f=u.ellipsoid,d=u.unproject(s,Fft);f.cartographicToCartesian(d,s)}return s}}var iQ=class{constructor(t){this.show=t.show,this.alpha=t.alpha,this.brightness=t.brightness,this.contrast=t.contrast,this.hue=t.hue,this.saturation=t.saturation,this.gamma=t.gamma,this.colorToAlpha=t.colorToAlpha}},Y4=iQ;var rQ=class{constructor(t){this._model=t,this._modelPrimitiveImageries=void 0,this._imageryConfigurations=[]}update(t){if(!this._hasImagery){this._deleteModelPrimitiveImageries();return}this._allImageryLayersReady&&(l(this._modelPrimitiveImageries)||(this._modelPrimitiveImageries=this._createModelPrimitiveImageries()),this._updateModelPrimitiveImageries(t),this._checkForModifiedImageryConfigurations())}_createModelPrimitiveImageries(){let t=this._model,n=this._collectRuntimeNodesAndPrimitives(),i=[],r=n.length;for(let o=0;o<r;o++){let s=n[o],a=s.runtimeNode,c=s.runtimePrimitive,u=new cS(t,a,c);c.primitive.modelPrimitiveImagery=u,i.push(u)}return i}_collectRuntimeNodesAndPrimitives(){let i=this._model.sceneGraph._runtimeNodes,r=[];for(let o=0;o<i.length;o++){let s=i[o];if(l(s))for(let a=0;a<s.runtimePrimitives.length;a++){let c=s.runtimePrimitives[a];r.push({runtimeNode:s,runtimePrimitive:c})}}return r}_updateModelPrimitiveImageries(t){if(!l(this._modelPrimitiveImageries))throw new pe("The modelPrimitiveImageries have not been created");let n=this._modelPrimitiveImageries,i=n.length;for(let r=0;r<i;r++)n[r].update(t)}_deleteModelPrimitiveImageries(){let t=this._modelPrimitiveImageries;if(!l(t))return;let n=t.length;for(let i=0;i<n;i++)t[i].destroy();delete this._modelPrimitiveImageries,this._model.resetDrawCommands()}get ready(){return this._hasImagery?!(!this._allImageryLayersReady||!this._allModelPrimitiveImageriesReady):!0}get _hasImagery(){let n=this._model.imageryLayers;return l(n)&&n.length>0}get _allImageryLayersReady(){if(!this._hasImagery)return!0;let t=this._model.imageryLayers,n=t.length;for(let i=0;i<n;i++)if(!t.get(i).ready)return!1;return!0}get _allModelPrimitiveImageriesReady(){let t=this._modelPrimitiveImageries;if(!l(t))return!1;let n=t.length;for(let i=0;i<n;i++)if(!t[i].ready)return!1;return!0}_checkForModifiedImageryConfigurations(){this._imageryConfigurationsModified()&&(this._updateImageryConfigurations(),this._model.resetDrawCommands())}_imageryConfigurationsModified(){let n=this._model.imageryLayers,i=this._imageryConfigurations;if(n.length!==i.length)return!0;for(let r=0;r<n.length;r++){let o=n.get(r),s=i[r];if(o.show!==s.show||o.alpha!==s.alpha||o.brightness!==s.brightness||o.contrast!==s.contrast||o.hue!==s.hue||o.saturation!==s.saturation||o.gamma!==s.gamma||o.colorToAlpha!==s.colorToAlpha)return!0}return!1}_updateImageryConfigurations(){let n=this._model.imageryLayers,i=this._imageryConfigurations;i.length=n.length;for(let r=0;r<n.length;r++){let o=n.get(r);i[r]=new Y4(o)}}isDestroyed(){return!1}destroy(){if(!this.isDestroyed())return this._deleteModelPrimitiveImageries(),le(this)}},X4=rQ;function xr(e){e=e??H.EMPTY_OBJECT,this._loader=e.loader,this._resource=e.resource,this.type=e.type??Qo.GLTF,this.modelMatrix=M.clone(e.modelMatrix??M.IDENTITY),this._modelMatrix=M.clone(this.modelMatrix),this._scale=e.scale??1,this._minimumPixelSize=e.minimumPixelSize??0,this._maximumScale=e.maximumScale,this._clampedScale=l(this._maximumScale)?Math.min(this._scale,this._maximumScale):this._scale,this._computedScale=this._clampedScale,this._updateModelMatrix=!1,this.referenceMatrix=void 0,this._iblReferenceFrameMatrix=$.clone($.IDENTITY),this._clippingPlanesMatrix=M.clone(M.IDENTITY),this._resourcesLoaded=!1,this._drawCommandsBuilt=!1,this._ready=!1,this._customShader=e.customShader,this._content=e.content,this._texturesLoaded=!1,this._defaultTexture=void 0,this._activeAnimations=new Oz(this),this._clampAnimations=e.clampAnimations??!0,this._userAnimationDirty=!1,this._id=e.id,this._idDirty=!1,this._color=z.clone(e.color),this._colorBlendMode=e.colorBlendMode??Ul.HIGHLIGHT,this._colorBlendAmount=e.colorBlendAmount??.5;let t=e.silhouetteColor??z.RED;this._silhouetteColor=z.clone(t),this._silhouetteSize=e.silhouetteSize??0,this._silhouetteDirty=!1,this._silhouetteId=void 0,this._cull=e.cull??!0,this._opaquePass=e.opaquePass??Ie.OPAQUE,this._allowPicking=e.allowPicking??!0,this._show=e.show??!0,this._style=void 0,this._styleDirty=!1,this._styleCommandsNeeded=void 0;let n=e.featureIdLabel??"featureId_0";typeof n=="number"&&(n=`featureId_${n}`),this._featureIdLabel=n;let i=e.instanceFeatureIdLabel??"instanceFeatureId_0";typeof i=="number"&&(i=`instanceFeatureId_${i}`),this._instanceFeatureIdLabel=i,this._featureTables=[],this._featureTableId=void 0,this._featureTableIdDirty=!0,this._pipelineResources=[],this._modelResources=[],this._pickIds=[],this._boundingSphere=new ue,this._initialRadius=void 0,this._heightReference=e.heightReference??We.NONE,this._heightDirty=this._heightReference!==We.NONE,this._removeUpdateHeightCallback=void 0,this._enableVerticalExaggeration=e.enableVerticalExaggeration??!0,this._hasVerticalExaggeration=!1,this._clampedModelMatrix=void 0,this._heightAboveSurface=void 0,this._lastSurfaceHeight=void 0,this._lastSurfaceQueryFrame=-1,this._lastSurfaceQueryMissed=!1;let r=e.scene;l(r)&&l(r.terrainProviderChanged)&&(this._terrainProviderChangedCallback=r.terrainProviderChanged.addEventListener(()=>{this._heightDirty=!0})),this._scene=r,this._distanceDisplayCondition=e.distanceDisplayCondition;let o=new ug(e.pointCloudShading);this._pointCloudShading=o,this._attenuation=o.attenuation,this._pointCloudBackFaceCulling=o.backFaceCulling;let s=e.clippingPlanes;l(s)&&s.owner===void 0?Ds.setOwner(s,this,"_clippingPlanes"):this._clippingPlanes=s,this._clippingPlanesState=0;let a=e.clippingPolygons;l(a)&&a.owner===void 0?$c.setOwner(a,this,"_clippingPolygons"):this._clippingPolygons=a,this._clippingPolygonsState=0,this._clippingPolygonsNeedRebake=!1,this._removeClippingPolygonAdded=void 0,this._removeClippingPolygonRemoved=void 0,Jxe(this),this._vectorData=void 0,this._vectorLookupFlags=0,this._clippingPolygonData=void 0,this._rectangle=new ie,this._modelImagery=new X4(this),this._lightColor=h.clone(e.lightColor),this._imageBasedLighting=l(e.imageBasedLighting)?e.imageBasedLighting:new Fv,this._shouldDestroyImageBasedLighting=!l(e.imageBasedLighting),this._environmentMapManager=void 0;let c=new py(e.environmentMapOptions);py.setOwner(c,this,"_environmentMapManager"),this._backFaceCulling=e.backFaceCulling??!0,this._backFaceCullingDirty=!1,this._shadows=e.shadows??Pn.ENABLED,this._shadowsDirty=!1,this._debugShowBoundingVolumeDirty=!1,this._debugShowBoundingVolume=e.debugShowBoundingVolume??!1,this._enableDebugWireframe=e.enableDebugWireframe??!1,this._enableShowOutline=e.enableShowOutline??!0,this._debugWireframe=e.debugWireframe??!1,this._edgeDisplayMode=e.edgeDisplayMode??kh.SURFACES_ONLY,this._debugWireframe===!0&&this._enableDebugWireframe===!1&&this.type===Qo.GLTF&&yt("model-debug-wireframe-ignored","enableDebugWireframe must be set to true in Model.fromGltf, otherwise debugWireframe will be ignored.");let u=e.credit;typeof u=="string"&&(u=new It(u)),this._credits=[],this._credit=u,this._resourceCredits=[],this._gltfCredits=[],this._showCreditsOnScreen=e.showCreditsOnScreen??!1,this._showCreditsOnScreenDirty=!0,this._splitDirection=e.splitDirection??Yo.NONE,this._enableShowOutline=e.enableShowOutline??!0,this.showOutline=e.showOutline??!0,this.outlineColor=e.outlineColor??z.BLACK,this._classificationType=e.classificationType,this._statistics=new j4,this._sceneMode=void 0,this._projectTo2D=e.projectTo2D??!1,this._enablePick=e.enablePick??!1,this._fogRenderable=void 0,this._skipLevelOfDetail=!1,this._ignoreCommands=e.ignoreCommands??!1,this._errorEvent=new be,this._readyEvent=new be,this._texturesReadyEvent=new be,this._sceneGraph=void 0,this._nodesByName={},this.pickObject=e.pickObject}function oQ(e,t){if(e._errorEvent.numberOfListeners>0){e._errorEvent.raiseEvent(t);return}console.log(t)}function zft(e,t){let n=e._featureTables,i=t.propertyTables,r=i.length;for(let o=0;o<r;o++){let s=i[o],a=new Nz({model:e,propertyTable:s});n.push(a)}return n}function Vft(e,t){let n=t._featureIdLabel,i=t._instanceFeatureIdLabel,r,o,s,a;for(r=0;r<e.nodes.length;r++)if(a=e.nodes[r],l(a.instances)&&(s=xt.getFeatureIdsByLabel(a.instances.featureIds,i),l(s)&&l(s.propertyTableId)))return s.propertyTableId;for(r=0;r<e.nodes.length;r++)for(a=e.nodes[r],o=0;o<a.primitives.length;o++){let c=a.primitives[o],u=xt.getFeatureIdsByLabel(c.featureIds,n);if(l(u))return u.propertyTableId}if(t._featureTables.length===1)return 0}function cQ(e,t){if(!l(e)&&!l(t))return!1;if(l(e)!==l(t))return!0;let n=e.alpha,i=t.alpha;return Math.floor(n)!==Math.floor(i)||Math.ceil(n)!==Math.ceil(i)}Object.defineProperties(xr.prototype,{ready:{get:function(){return this._ready}},errorEvent:{get:function(){return this._errorEvent}},readyEvent:{get:function(){return this._readyEvent}},incrementallyLoadTextures:{get:function(){return this._loader.incrementallyLoadTextures??!1}},texturesReadyEvent:{get:function(){return this._texturesReadyEvent}},loader:{get:function(){return this._loader}},statistics:{get:function(){return this._statistics}},activeAnimations:{get:function(){return this._activeAnimations}},clampAnimations:{get:function(){return this._clampAnimations},set:function(e){this._clampAnimations=e}},cull:{get:function(){return this._cull}},opaquePass:{get:function(){return this._opaquePass}},pointCloudShading:{get:function(){return this._pointCloudShading},set:function(e){e!==this._pointCloudShading&&this.resetDrawCommands(),this._pointCloudShading=e}},customShader:{get:function(){return this._customShader},set:function(e){e!==this._customShader&&this.resetDrawCommands(),this._customShader=e}},sceneGraph:{get:function(){return this._sceneGraph}},content:{get:function(){return this._content}},heightReference:{get:function(){return this._heightReference},set:function(e){e!==this._heightReference&&(this._heightDirty=!0),this._heightReference=e}},distanceDisplayCondition:{get:function(){return this._distanceDisplayCondition},set:function(e){this._distanceDisplayCondition=Gt.clone(e,this._distanceDisplayCondition)}},structuralMetadata:{get:function(){return this._sceneGraph.components.structuralMetadata}},featureTableId:{get:function(){return this._featureTableId},set:function(e){this._featureTableId=e}},featureTables:{get:function(){return this._featureTables},set:function(e){this._featureTables=e}},id:{get:function(){return this._id},set:function(e){e!==this._id&&(this._idDirty=!0),this._id=e}},allowPicking:{get:function(){return this._allowPicking}},style:{get:function(){return this._style},set:function(e){this._style=e,this._styleDirty=!0}},color:{get:function(){return this._color},set:function(e){cQ(e,this._color)&&this.resetDrawCommands(),this._color=z.clone(e,this._color)}},colorBlendMode:{get:function(){return this._colorBlendMode},set:function(e){this._colorBlendMode=e}},colorBlendAmount:{get:function(){return this._colorBlendAmount},set:function(e){this._colorBlendAmount=e}},silhouetteColor:{get:function(){return this._silhouetteColor},set:function(e){if(!z.equals(e,this._silhouetteColor)){let t=cQ(e,this._silhouetteColor);this._silhouetteDirty=this._silhouetteDirty||t}this._silhouetteColor=z.clone(e,this._silhouetteColor)}},silhouetteSize:{get:function(){return this._silhouetteSize},set:function(e){if(e!==this._silhouetteSize){let t=this._silhouetteSize,n=e>0&&t===0||e===0&&t>0;this._silhouetteDirty=this._silhouetteDirty||n,this._backFaceCullingDirty=this._backFaceCullingDirty||n}this._silhouetteSize=e}},heightAboveSurface:{get:function(){return this._heightAboveSurface}},boundingSphere:{get:function(){let e=l(this._clampedModelMatrix)?this._clampedModelMatrix:this.modelMatrix;return Qxe(this,e),this._boundingSphere}},debugShowBoundingVolume:{get:function(){return this._debugShowBoundingVolume},set:function(e){this._debugShowBoundingVolume!==e&&(this._debugShowBoundingVolumeDirty=!0),this._debugShowBoundingVolume=e}},debugWireframe:{get:function(){return this._debugWireframe},set:function(e){this._debugWireframe!==e&&this.resetDrawCommands(),this._debugWireframe=e,this._debugWireframe===!0&&this._enableDebugWireframe===!1&&this.type===Qo.GLTF&&yt("model-debug-wireframe-ignored","enableDebugWireframe must be set to true in Model.fromGltfAsync, otherwise debugWireframe will be ignored.")}},edgeDisplayMode:{get:function(){return this._edgeDisplayMode},set:function(e){this._edgeDisplayMode=e}},show:{get:function(){return this._show},set:function(e){this._show=e}},featureIdLabel:{get:function(){return this._featureIdLabel},set:function(e){typeof e=="number"&&(e=`featureId_${e}`),e!==this._featureIdLabel&&(this._featureTableIdDirty=!0),this._featureIdLabel=e}},instanceFeatureIdLabel:{get:function(){return this._instanceFeatureIdLabel},set:function(e){typeof e=="number"&&(e=`instanceFeatureId_${e}`),e!==this._instanceFeatureIdLabel&&(this._featureTableIdDirty=!0),this._instanceFeatureIdLabel=e}},clippingPlanes:{get:function(){return this._clippingPlanes},set:function(e){e!==this._clippingPlanes&&(Ds.setOwner(e,this,"_clippingPlanes"),this.resetDrawCommands())}},clippingPolygons:{get:function(){return this._clippingPolygons},set:function(e){e!==this._clippingPolygons&&($c.setOwner(e,this,"_clippingPolygons"),Jxe(this),this.resetDrawCommands(),this._clippingPolygonsState=0,this._clippingPolygonsNeedRebake=!0,l(this._clippingPolygonData)&&($c.releaseRectangleData(this._clippingPolygonData),this._clippingPolygonData=void 0))}},enableVerticalExaggeration:{get:function(){return this._enableVerticalExaggeration},set:function(e){e!==this._enableVerticalExaggeration&&this.resetDrawCommands(),this._enableVerticalExaggeration=e}},hasVerticalExaggeration:{get:function(){return this._hasVerticalExaggeration}},imageryLayers:{get:function(){if(l(this._content)){let e=this._content.tileset;if(l(e))return e.imageryLayers}}},lightColor:{get:function(){return this._lightColor},set:function(e){l(e)!==l(this._lightColor)&&this.resetDrawCommands(),this._lightColor=h.clone(e,this._lightColor)}},imageBasedLighting:{get:function(){return this._imageBasedLighting},set:function(e){e!==this._imageBasedLighting&&(this._shouldDestroyImageBasedLighting&&!this._imageBasedLighting.isDestroyed()&&this._imageBasedLighting.destroy(),this._imageBasedLighting=e,this._shouldDestroyImageBasedLighting=!1,this.resetDrawCommands())}},environmentMapManager:{get:function(){return this._environmentMapManager},set:function(e){e!==this.environmentMapManager&&(py.setOwner(e,this,"_environmentMapManager"),this.resetDrawCommands())}},backFaceCulling:{get:function(){return this._backFaceCulling},set:function(e){e!==this._backFaceCulling&&(this._backFaceCullingDirty=!0),this._backFaceCulling=e}},scale:{get:function(){return this._scale},set:function(e){e!==this._scale&&(this._updateModelMatrix=!0),this._scale=e}},computedScale:{get:function(){return this._computedScale}},minimumPixelSize:{get:function(){return this._minimumPixelSize},set:function(e){e!==this._minimumPixelSize&&(this._updateModelMatrix=!0),this._minimumPixelSize=e}},maximumScale:{get:function(){return this._maximumScale},set:function(e){e!==this._maximumScale&&(this._updateModelMatrix=!0),this._maximumScale=e}},shadows:{get:function(){return this._shadows},set:function(e){e!==this._shadows&&(this._shadowsDirty=!0),this._shadows=e}},credit:{get:function(){return this._credit}},showCreditsOnScreen:{get:function(){return this._showCreditsOnScreen},set:function(e){this._showCreditsOnScreen!==e&&(this._showCreditsOnScreenDirty=!0),this._showCreditsOnScreen=e}},splitDirection:{get:function(){return this._splitDirection},set:function(e){this._splitDirection!==e&&this.resetDrawCommands(),this._splitDirection=e}},classificationType:{get:function(){return this._classificationType}},pickIds:{get:function(){return this._pickIds}},styleCommandsNeeded:{get:function(){return this._styleCommandsNeeded}}});xr.prototype.getRectangle=function(e){let t=this._content?.tile?.contentBoundingVolume;return l(t?.rectangle)?t.rectangle:(e=e??this._scene?.ellipsoid??ee.default,ie.fromBoundingSphere(this.boundingSphere,e,this._rectangle))};xr.prototype.getNode=function(e){return this._nodesByName[e]};xr.prototype.setArticulationStage=function(e,t){this._sceneGraph.setArticulationStage(e,t)};xr.prototype.applyArticulations=function(){this._sceneGraph.applyArticulations()};xr.prototype.getExtension=function(e){return this._loader.components.extensions[e]};xr.prototype.makeStyleDirty=function(){this._styleDirty=!0};xr.prototype.resetDrawCommands=function(){this._drawCommandsBuilt=!1};var jft=new M,Hft=new $,Gft=new M;xr.prototype.update=function(e){let t=!1;try{t=Wft(this,e)}catch(i){if(!this._loader.incrementallyLoadTextures&&i.name==="TextureError")oQ(this,i);else{let r=xt.getError("model",this._resource,i);oQ(this,r)}}if(qft(this,e),Yft(this,e),Xft(this,e),!this._resourcesLoaded&&t){this._resourcesLoaded=!0;let i=this._loader.components;if(!l(i)){if(this._loader.isUnloaded())return;let s=xt.getError("model",this._resource,new oe("Failed to load model."));oQ(s),this._rejectLoad=this._rejectLoad&&this._rejectLoad(s)}let r=i.structuralMetadata;l(r)&&r.propertyTableCount>0&&zft(this,r);let o=new V4({model:this,modelComponents:i});this._sceneGraph=o,this._gltfCredits=o.components.asset.credits}if(!this._resourcesLoaded||e.mode===re.MORPHING)return;let n=this._modelImagery;if(n.update(e),!(!n.ready&&!(this._content?.tileset?._asynchronouslyLoadImagery??!1))){if(Kft(this),$ft(this),Jft(this,e),Zft(this),Qft(this,e),edt(this,e),tdt(this,e),ndt(this,e),odt(this,e),sdt(this,e),adt(this,e),cdt(this,e),this._defaultTexture=e.context.defaultTexture,ldt(this,e),fdt(this,e),mdt(this),pdt(this,e),Adt(this,e),!this._ready){e.afterRender.push(()=>{this._ready=!0,this._readyEvent.raiseEvent(this)});return}this._loader.incrementallyLoadTextures&&!this._texturesLoaded&&this._loader.texturesLoaded&&(this.resetDrawCommands(),this._texturesLoaded=!0,this._texturesReadyEvent.raiseEvent(this)),_dt(this),bdt(this,e),xdt(this),Edt(this,e)}};function Wft(e,t){return!e._resourcesLoaded||e._loader.incrementallyLoadTextures&&!e._texturesLoaded?(t.afterRender.push(()=>!0),e._loader.process(t)):!0}function qft(e,t){l(e._customShader)&&e._customShader.update(t)}function Yft(e,t){let n=e._environmentMapManager,i=t.passes.pick||t.passes.pickVoxel;e._ready&&n.owner===e&&!i&&(n.position=e._boundingSphere.center,n.shouldUpdate=!l(e._imageBasedLighting.sphericalHarmonicCoefficients)||!l(e._imageBasedLighting.specularEnvironmentMaps),n.update(t),n.shouldRegenerateShaders&&e.resetDrawCommands())}function Xft(e,t){e._imageBasedLighting.update(t),e._imageBasedLighting.shouldRegenerateShaders&&e.resetDrawCommands()}function Kft(e){if(!e._featureTableIdDirty)return;e._featureTableIdDirty=!1;let t=e._sceneGraph.components,n=t.structuralMetadata;l(n)&&n.propertyTableCount>0&&(e.featureTableId=Vft(t,e),e._styleDirty=!0,e.resetDrawCommands())}function $ft(e){e._styleDirty&&(e.applyStyle(e._style),e._styleDirty=!1)}function Jft(e,t){let n=e._featureTables,i=n.length,r=!1;for(let o=0;o<i;o++)n[o].update(t),n[o].styleCommandsNeededDirty&&(r=!0);r&&$xe(e)}function $xe(e){let t=e.featureTables[e.featureTableId];e._styleCommandsNeeded=wp.getStyleCommandsNeeded(t.featuresLength,t.batchTexture.translucentFeaturesLength)}function Zft(e){let t=e.pointCloudShading;t.attenuation!==e._attenuation&&(e.resetDrawCommands(),e._attenuation=t.attenuation),t.backFaceCulling!==e._pointCloudBackFaceCulling&&(e.resetDrawCommands(),e._pointCloudBackFaceCulling=t.backFaceCulling)}function Qft(e,t){e._silhouetteDirty&&(tTe(t)&&e.resetDrawCommands(),e._silhouetteDirty=!1)}function edt(e,t){let n=e.hasSkipLevelOfDetail(t);n!==e._skipLevelOfDetail&&(e.resetDrawCommands(),e._skipLevelOfDetail=n)}function tdt(e,t){let n=0;e.isClippingEnabled()&&(e._clippingPlanes.owner===e&&e._clippingPlanes.update(t),n=e._clippingPlanes.clippingPlanesState),n!==e._clippingPlanesState&&(e.resetDrawCommands(),e._clippingPlanesState=n)}function Jxe(e){e._removeClippingPolygonAdded=e._removeClippingPolygonAdded&&e._removeClippingPolygonAdded(),e._removeClippingPolygonRemoved=e._removeClippingPolygonRemoved&&e._removeClippingPolygonRemoved();let t=e._clippingPolygons;if(!l(t)||t.owner!==e)return;let n=()=>{e._clippingPolygonsNeedRebake=!0};e._removeClippingPolygonAdded=t.polygonAdded.addEventListener(n),e._removeClippingPolygonRemoved=t.polygonRemoved.addEventListener(n)}function ndt(e,t){let n=e._clippingPolygons,i=e.isClippingPolygonsEnabled(),r=0;i&&(n.owner===e&&n.update(t),r=n.clippingPolygonsState),r!==e._clippingPolygonsState&&(e.resetDrawCommands(),e._clippingPolygonsState=r);let o=(e._clippingPolygonData?.polygonRings.length??0)>0;if(e._clippingPolygonsNeedRebake&&(e._clippingPolygonsNeedRebake=!1,l(e._clippingPolygonData)&&($c.releaseRectangleData(e._clippingPolygonData),e._clippingPolygonData=void 0)),!i||!e._ready)return;l(e._clippingPolygonData)||(e._clippingPolygonData=n.requestRectangleData(e.getRectangle(n.ellipsoid),t.context));let s=(e._clippingPolygonData?.polygonRings.length??0)>0;o!==s&&e.resetDrawCommands()}var idt=new ie;function Zxe(e){l(e._vectorData)&&(e._scene?.vectorProvider?.releaseTileData(e._vectorData),e._vectorData=void 0)}function rdt(e){if(e?.show!==!0)return 0;let t=1;return t|=e.hasPolylines?2:0,t|=e.hasPolygons?4:0,t}function odt(e,t){let n=e._scene?.vectorProvider;if(l(n)&&l(e._content)&&e.ready&&t.mode===re.SCENE3D){let o=e._content?.tile?.contentBoundingVolume.rectangle??ie.fromBoundingSphere(e.boundingSphere,n.ellipsoid,idt);e._vectorData=l(e._vectorData)?n.updateDataForRectangle(o,t.context,e._vectorData,We.CLAMP_TO_3D_TILE):n.requestDataForRectangle(o,t.context,We.CLAMP_TO_3D_TILE)}else Zxe(e);let r=rdt(e._vectorData);r!==e._vectorLookupFlags&&(e.resetDrawCommands(),e._vectorLookupFlags=r)}function sdt(e,t){t.mode!==e._sceneMode&&(e._projectTo2D?e.resetDrawCommands():e._updateModelMatrix=!0,e._sceneMode=t.mode)}function adt(e,t){let n=t.fog.enabled&&t.fog.renderable;n!==e._fogRenderable&&(e.resetDrawCommands(),e._fogRenderable=n)}function cdt(e,t){if(e.enableVerticalExaggeration){let n=t.verticalExaggeration!==1;e.hasVerticalExaggeration!==n&&(e.resetDrawCommands(),e._hasVerticalExaggeration=n)}else e.hasVerticalExaggeration&&(e.resetDrawCommands(),e._hasVerticalExaggeration=!1)}function ldt(e,t){e._drawCommandsBuilt||(e.destroyPipelineResources(),e._sceneGraph.buildDrawCommands(t),e._drawCommandsBuilt=!0)}function udt(e,t){if(e===t)return!0;if(!l(e)||!l(t))return!1;for(let n=0;n<16;n++)if(e[n]!==t[n])return!1;return!0}function lQ(e,t){if(!l(e)||!l(t))return M.clone(e,t);for(let n=0;n<16;n++)t[n]=e[n];return t}function fdt(e,t){udt(e.modelMatrix,e._modelMatrix)||(e._updateModelMatrix=!0,e._modelMatrix=lQ(e.modelMatrix,e._modelMatrix))}var Ny=new h,sQ=new he,ddt=new he,hdt=200,Kxe=30;function mdt(e){let t=e.heightReference!==We.NONE&&l(e._scene)&&e._scene.frameState.frameNumber-e._lastSurfaceQueryFrame>=Kxe;if(!e._updateModelMatrix&&!e._heightDirty&&e._minimumPixelSize===0&&!t)return;if(!e._updateModelMatrix&&!e._heightDirty&&l(e._removeUpdateHeightCallback)&&!t){e._updateModelMatrix=!0;return}let n=e._scene;if(!l(n)||e.heightReference===We.NONE){l(e._removeUpdateHeightCallback)&&(e._removeUpdateHeightCallback(),e._removeUpdateHeightCallback=void 0),e._clampedModelMatrix=void 0;return}let i=n.ellipsoid??ee.default,r=e.modelMatrix;Ny.x=r[12],Ny.y=r[13],Ny.z=r[14];let o=i.cartesianToCartographic(Ny,ddt);l(e._clampedModelMatrix)||(e._clampedModelMatrix=M.clone(r,new M));let s=n.frameState.frameNumber,a=e.heightReference===We.CLIP_TO_GROUND,c=s-e._lastSurfaceQueryFrame<Kxe,u=a&&l(e._lastSurfaceHeight)&&o.height>e._lastSurfaceHeight+hdt,f=u&&c,d=a&&c&&e._lastSurfaceQueryMissed;if(!((a&&e._lastSurfaceQueryMissed||u)&&l(e._removeUpdateHeightCallback))){l(e._removeUpdateHeightCallback)&&e._removeUpdateHeightCallback();let y=he.clone(o),A=Pdt(e,i,y);e._removeUpdateHeightCallback=n.updateHeight(y,b=>{let x=n.getHeight(y,e.heightReference);l(x)&&(b.height=x,e._lastSurfaceQueryFrame=n.frameState.frameNumber,e._lastSurfaceQueryMissed=!1),e._lastSurfaceHeight=b.height,A(b)},e.heightReference)}let m;f||d?m=e._lastSurfaceHeight:(e._lastSurfaceQueryFrame=s,m=n.getHeight(o,e.heightReference),e._lastSurfaceQueryMissed=!l(m),l(m)?e._lastSurfaceHeight=m:m=e._lastSurfaceHeight),l(m)?(he.clone(o,sQ),sQ.height=m,eTe(e,i,o,sQ)):lQ(r,e._clampedModelMatrix),e._heightDirty=!1,e._updateModelMatrix=!0}function pdt(e,t){if(!e._updateModelMatrix&&e._minimumPixelSize===0)return;let n=l(e._clampedModelMatrix)?e._clampedModelMatrix:e.modelMatrix;Qxe(e,n),gdt(e,n,t)}function Qxe(e,t){e._clampedScale=l(e._maximumScale)?Math.min(e._scale,e._maximumScale):e._scale,e._boundingSphere.center=h.multiplyByScalar(e._sceneGraph.boundingSphere.center,e._clampedScale,e._boundingSphere.center),e._boundingSphere.radius=e._initialRadius*e._clampedScale,e._boundingSphere=ue.transform(e._boundingSphere,t,e._boundingSphere)}function gdt(e,t,n){let i=e.scale;if(e.minimumPixelSize!==0&&!e._projectTo2D){let r=n.context,o=Math.max(r.drawingBufferWidth,r.drawingBufferHeight);M.getTranslation(t,Ny),e._sceneMode!==re.SCENE3D&&pr.computeActualEllipsoidPosition(n,Ny,Ny);let s=e._boundingSphere.radius,a=Cdt(Ny,s,n),c=1/a;Math.min(c*(2*s),o)<e.minimumPixelSize&&(i=e.minimumPixelSize*a/(2*e._initialRadius))}e._computedScale=l(e.maximumScale)?Math.min(e.maximumScale,i):i}function _dt(e){if(!e._idDirty)return;e._idDirty=!1;let t=e._id,n=e._pickIds,i=n.length;for(let r=0;r<i;++r)n[r].object.id=t}var ydt=new $(1,0,0,0,0,1,0,-1,0);function Adt(e,t){let n=l(e._clampedModelMatrix)?e._clampedModelMatrix:e.modelMatrix,i=e.referenceMatrix??n,r=t.context,o=Hft,s=jft;if(s=M.multiply(r.uniformState.view3D,i,s),o=M.getRotation(s,o),o=$.transpose(o,o),e._iblReferenceFrameMatrix=$.multiply(ydt,o,e._iblReferenceFrameMatrix),e.isClippingEnabled()){let a=M.multiply(i,e._clippingPlanes.modelMatrix,Gft);e._clippingPlanesMatrix=M.inverseTranspose(a,e._clippingPlanesMatrix)}}function bdt(e,t){let n=e._sceneGraph;if(e._updateModelMatrix||e._minimumPixelSize!==0){let r=l(e._clampedModelMatrix)?e._clampedModelMatrix:e.modelMatrix;n.updateModelMatrix(r,t),e._updateModelMatrix&&(e._clippingPolygonsNeedRebake=!0),e._updateModelMatrix=!1}e._backFaceCullingDirty&&(n.updateBackFaceCulling(e._backFaceCulling),e._backFaceCullingDirty=!1),e._shadowsDirty&&(n.updateShadows(e._shadows),e._shadowsDirty=!1),e._debugShowBoundingVolumeDirty&&(n.updateShowBoundingVolume(e._debugShowBoundingVolume),e._debugShowBoundingVolumeDirty=!1);let i=!1;!l(e.classificationType)&&e._show&&(i=e._userAnimationDirty||e._activeAnimations.update(t)),n.update(t,i),e._userAnimationDirty=!1}function xdt(e){if(!e._showCreditsOnScreenDirty)return;e._showCreditsOnScreenDirty=!1,e._credits.length=0;let t=e._showCreditsOnScreen;if(l(e._credit)){let s=It.clone(e._credit);s.showOnScreen=s.showOnScreen||t,e._credits.push(s)}let n=e._resourceCredits,i=n.length;for(let s=0;s<i;s++){let a=It.clone(n[s]);a.showOnScreen=a.showOnScreen||t,e._credits.push(a)}let r=e._gltfCredits,o=r.length;for(let s=0;s<o;s++){let a=It.clone(r[s]);a.showOnScreen=a.showOnScreen||t,e._credits.push(a)}}function Tdt(e){return e.isClippingPolygonsEnabled()&&e._clippingPolygons.inverse&&(e._clippingPolygonData?.polygonRings.length??0)===0}function Edt(e,t){let n=Rdt(e,t),i=e.isInvisible(),r=e.hasSilhouette(t),o=e._show&&e._computedScale!==0&&n&&(!i||r)&&!Tdt(e),s=t.passes,a=s.render||s.pick&&e.allowPicking;o&&!e._ignoreCommands&&a&&(Odt(e,t),e._sceneGraph.pushDrawCommands(t))}var aQ=new ue;function Cdt(e,t,n){return aQ.center=e,aQ.radius=t,n.camera.getPixelSize(aQ,n.context.drawingBufferWidth,n.context.drawingBufferHeight)}var K4=new h,vdt=new h,$4=new h,Sdt=new h,wdt=new M;function Idt(e,t,n){let i=e._sceneGraph;if(!l(i)||!l(i._positionMin))return 0;let r=i._positionMin,o=i._positionMax,s=t.geodeticSurfaceNormalCartographic(n,Sdt),a=M.multiplyTransformation(i._components.transform,i._axisCorrectionMatrix,wdt),c=e.scale,u=e.modelMatrix,f=0;for(let d=0;d<8;d++){let p=h.fromElements(d&1?o.x:r.x,d&2?o.y:r.y,d&4?o.z:r.z,vdt);h.multiplyByScalar(p,c,p),M.multiplyByPoint(a,p,$4),M.multiplyByPointAsVector(u,$4,$4);let g=h.dot($4,s);g<f&&(f=g)}return-f}function eTe(e,t,n,i){if(e.heightReference===We.CLIP_TO_GROUND){let o=i.height+Idt(e,t,i);e._heightAboveSurface=Math.max(0,n.height-o),i.height=Math.max(n.height,o)}else G_(e.heightReference)&&(i.height+=n.height);t.cartographicToCartesian(i,K4);let r=e._clampedModelMatrix;lQ(e.modelMatrix,r),r[12]=K4.x,r[13]=K4.y,r[14]=K4.z,e._heightDirty=!0}function Pdt(e,t,n){return function(i){eTe(e,t,n,i)}}var Ddt=new h;function Rdt(e,t){let n=e.distanceDisplayCondition;if(!l(n))return!0;let i=n.near*n.near,r=n.far*n.far,o;if(t.mode===re.SCENE2D){let a=(t.camera.frustum.right-t.camera.frustum.left)*.5;o=a*a}else{let s=M.getTranslation(e.modelMatrix,Ddt);pr.computeActualEllipsoidPosition(t,s,s),o=h.distanceSquared(s,t.camera.positionWC)}return o>=i&&o<=r}function Odt(e,t){let n=t.creditDisplay,i=e._credits,r=i.length;for(let o=0;o<r;o++)n.addCreditToNextFrame(i[o])}xr.prototype.isTranslucent=function(){let e=this.color;return l(e)&&e.alpha>0&&e.alpha<1};xr.prototype.isInvisible=function(){let e=this.color;return l(e)&&e.alpha===0};function tTe(e){return e.context.stencilBuffer}xr.prototype.hasSilhouette=function(e){return tTe(e)&&this._silhouetteSize>0&&this._silhouetteColor.alpha>0&&!l(this._classificationType)};xr.prototype.hasSkipLevelOfDetail=function(e){if(!Qo.is3DTiles(this.type))return!1;let t=e.context.stencilBuffer,n=this._content.tileset;return t&&n.isSkippingLevelOfDetail};xr.prototype.isClippingEnabled=function(){let e=this._clippingPlanes;return l(e)&&e.enabled&&e.length!==0};xr.prototype.pick=function(e,t,n,i,r){return P1(this,e,t,n,i,r)};xr.prototype.isClippingPolygonsEnabled=function(){let e=this._clippingPolygons;return l(e)&&e.enabled&&e.length!==0};xr.prototype.hasDrapedVectors=function(){return this._vectorData?.show===!0};xr.prototype.isDestroyed=function(){return!1};xr.prototype.destroy=function(){let e=this._loader;l(e)&&e.destroy();let t=this._featureTables;if(l(t)){let r=t.length;for(let o=0;o<r;o++)t[o].destroy()}this.destroyPipelineResources(),this.destroyModelResources(),Zxe(this),l(this._removeUpdateHeightCallback)&&(this._removeUpdateHeightCallback(),this._removeUpdateHeightCallback=void 0),l(this._terrainProviderChangedCallback)&&(this._terrainProviderChangedCallback(),this._terrainProviderChangedCallback=void 0),this._removeClippingPolygonAdded=this._removeClippingPolygonAdded&&this._removeClippingPolygonAdded(),this._removeClippingPolygonRemoved=this._removeClippingPolygonRemoved&&this._removeClippingPolygonRemoved();let n=this._clippingPlanes;l(n)&&!n.isDestroyed()&&n.owner===this&&n.destroy(),this._clippingPlanes=void 0,l(this._clippingPolygonData)&&$c.releaseRectangleData(this._clippingPolygonData),this._clippingPolygonData=void 0,this._clippingPolygons=void 0,this._shouldDestroyImageBasedLighting&&!this._imageBasedLighting.isDestroyed()&&this._imageBasedLighting.destroy(),this._imageBasedLighting=void 0;let i=this._environmentMapManager;!i.isDestroyed()&&i.owner===this&&i.destroy(),this._environmentMapManager=void 0,le(this)};xr.prototype.destroyPipelineResources=function(){let e=this._pipelineResources;for(let t=0;t<e.length;t++)e[t].destroy();this._pipelineResources.length=0,this._pickIds.length=0};xr.prototype.destroyModelResources=function(){let e=this._modelResources;for(let t=0;t<e.length;t++)e[t].destroy();this._modelResources.length=0};xr.fromGltfAsync=async function(e){e=e??H.EMPTY_OBJECT;let t=e.url??e.gltf,n={releaseGltfJson:e.releaseGltfJson,asynchronous:e.asynchronous,incrementallyLoadTextures:e.incrementallyLoadTextures,upAxis:e.upAxis,forwardAxis:e.forwardAxis,loadAttributesFor2D:e.projectTo2D,enablePick:e.enablePick,loadIndicesForWireframe:e.enableDebugWireframe,loadPrimitiveOutline:e.enableShowOutline,loadForClassification:l(e.classificationType)},i=e.basePath??"",r=De.createIfNeeded(i);l(t.asset)?(n.gltfJson=t,n.baseResource=r,n.gltfResource=r):t instanceof Uint8Array?(n.typedArray=t,n.baseResource=r,n.gltfResource=r):n.gltfResource=De.createIfNeeded(t);let o=new wd(n),a=l(e.content)?Qo.TILE_GLTF:Qo.GLTF,c=n.gltfResource,u=D1(o,a,e);u.resource=c,u.environmentMapOptions=e.environmentMapOptions;try{await o.load()}catch(g){throw o.destroy(),xt.getError("model",c,g)}let f=e.gltfCallback;l(f)&&f(o.gltfJson);let d=new xr(u),p=d._resource.credits;if(l(p)){let g=p.length;for(let m=0;m<g;m++)d._resourceCredits.push(It.clone(p[m]))}return d};xr.fromB3dm=async function(e){let t={b3dmResource:e.resource,arrayBuffer:e.arrayBuffer,byteOffset:e.byteOffset,releaseGltfJson:e.releaseGltfJson,asynchronous:e.asynchronous,incrementallyLoadTextures:e.incrementallyLoadTextures,upAxis:e.upAxis,forwardAxis:e.forwardAxis,loadAttributesFor2D:e.projectTo2D,enablePick:e.enablePick,loadIndicesForWireframe:e.enableDebugWireframe,loadPrimitiveOutline:e.enableShowOutline,loadForClassification:l(e.classificationType)},n=new yz(t);try{await n.load();let i=D1(n,Qo.TILE_B3DM,e);return new xr(i)}catch(i){throw n.destroy(),i}};xr.fromPnts=async function(e){let t={arrayBuffer:e.arrayBuffer,byteOffset:e.byteOffset,loadAttributesFor2D:e.projectTo2D},n=new G4(t);try{await n.load();let i=D1(n,Qo.TILE_PNTS,e);return new xr(i)}catch(i){throw n.destroy(),i}};xr.fromI3dm=async function(e){let t={i3dmResource:e.resource,arrayBuffer:e.arrayBuffer,byteOffset:e.byteOffset,releaseGltfJson:e.releaseGltfJson,asynchronous:e.asynchronous,incrementallyLoadTextures:e.incrementallyLoadTextures,upAxis:e.upAxis,forwardAxis:e.forwardAxis,loadAttributesFor2D:e.projectTo2D,enablePick:e.enablePick,loadIndicesForWireframe:e.enableDebugWireframe,loadPrimitiveOutline:e.enableShowOutline},n=new vz(t);try{await n.load();let i=D1(n,Qo.TILE_I3DM,e);return new xr(i)}catch(i){throw n.destroy(),i}};xr.fromGeoJson=async function(e){let t={geoJson:e.geoJson},n=new bz(t),i=D1(n,Qo.TILE_GEOJSON,e);return new xr(i)};var Mdt=new z;xr.prototype.applyColorAndShow=function(e){let t=z.clone(this._color,Mdt),n=l(e)&&l(e.color),i=l(e)&&l(e.show);this._color=n?e.color.evaluateColor(void 0,this._color):z.clone(z.WHITE,this._color),this._show=i?e.show.evaluate(void 0):!0,cQ(t,this._color)&&this.resetDrawCommands()};xr.prototype.applyStyle=function(e){let t=this.type===Qo.TILE_PNTS,n=l(this.featureTableId)&&this.featureTables[this.featureTableId].featuresLength>0,i=l(this.structuralMetadata)?this.structuralMetadata.propertyAttributes:void 0,r=l(i)&&l(i[0]);if(t&&(!n||r)){this.resetDrawCommands();return}n?(this.featureTables[this.featureTableId].applyStyle(e),$xe(this,e)):(this.applyColorAndShow(e),this._styleCommandsNeeded=void 0)};function D1(e,t,n){return{loader:e,type:t,resource:n.resource,show:n.show,modelMatrix:n.modelMatrix,scale:n.scale,enableVerticalExaggeration:n.enableVerticalExaggeration,minimumPixelSize:n.minimumPixelSize,maximumScale:n.maximumScale,id:n.id,allowPicking:n.allowPicking,clampAnimations:n.clampAnimations,shadows:n.shadows,debugShowBoundingVolume:n.debugShowBoundingVolume,enableDebugWireframe:n.enableDebugWireframe,debugWireframe:n.debugWireframe,cull:n.cull,opaquePass:n.opaquePass,customShader:n.customShader,content:n.content,heightReference:n.heightReference,scene:n.scene,distanceDisplayCondition:n.distanceDisplayCondition,color:n.color,colorBlendAmount:n.colorBlendAmount,colorBlendMode:n.colorBlendMode,edgeDisplayMode:n.edgeDisplayMode,silhouetteColor:n.silhouetteColor,silhouetteSize:n.silhouetteSize,enableShowOutline:n.enableShowOutline,showOutline:n.showOutline,outlineColor:n.outlineColor,clippingPlanes:n.clippingPlanes,clippingPolygons:n.clippingPolygons,lightColor:n.lightColor,imageBasedLighting:n.imageBasedLighting,backFaceCulling:n.backFaceCulling,credit:n.credit,showCreditsOnScreen:n.showCreditsOnScreen,splitDirection:n.splitDirection,projectTo2D:n.projectTo2D,enablePick:n.enablePick,featureIdLabel:n.featureIdLabel,instanceFeatureIdLabel:n.instanceFeatureIdLabel,pointCloudShading:n.pointCloudShading,classificationType:n.classificationType,pickObject:n.pickObject}}var Md=xr;var Ndt=1,Ldt=!0,Fdt=0,Bdt=!0,kdt=!0,Udt=Pn.ENABLED,zdt=We.NONE,Vdt=z.RED,jdt=0,Hdt=z.WHITE,Gdt=Ul.HIGHLIGHT,Wdt=.5,qdt=new U(1,1),nTe={maximumPositionEpsilon:Number.POSITIVE_INFINITY},Ydt=new M,Xdt=new M,iTe=new z,rTe=new Array(4),Kdt=new h;function Ly(e,t){t.collectionChanged.addEventListener(Ly.prototype._onCollectionChanged,this),this._scene=e,this._primitives=e.primitives,this._entityCollection=t,this._modelHash={},this._entitiesToVisualize=new zt,this._onCollectionChanged(t,t.values,[],[])}function $dt(e,t){return e instanceof hi?e.valueOf():X.getValueOrUndefined(e,t)}function Jdt(e,t){return t!==e.uri?!1:t instanceof De?t._url===e.uriUrl&&t._queryParameters===e.uriQueryParameters&&t._templateValues===e.uriTemplateValues:!0}function oTe(e,t){e.uri=t,t instanceof De&&(e.uriUrl=t._url,e.uriQueryParameters=t._queryParameters,e.uriTemplateValues=t._templateValues)}function Zdt(e,t){if(!l(t))return M.clone(e);for(let n=0;n<16;n++)t[n]=e[n];return t}async function Qdt(e,t,n,i,r){let o=e._primitives,s=e._modelHash;try{let a=await Md.fromGltfAsync({url:n,incrementallyLoadTextures:i,scene:e._scene,environmentMapOptions:r});if(e.isDestroyed()||!l(s[t.id]))return;a.id=t,o.add(a),s[t.id].modelPrimitive=a,a.errorEvent.addEventListener(c=>{l(s[t.id])&&(console.log(c),c.name!=="TextureError"&&a.incrementallyLoadTextures&&(s[t.id].loadFailed=!0))})}catch(a){if(e.isDestroyed()||!l(s[t.id]))return;console.log(a),s[t.id].loadFailed=!0}}Ly.prototype.update=function(e){let t=this._entitiesToVisualize.values,n=this._modelHash,i=this._primitives;for(let r=0,o=t.length;r<o;r++){let s=t[r],a=s._model,c,u=n[s.id],f=s.isShowing&&s.isAvailable(e)&&X.getValueOrDefault(a._show,e,!0),d,p;if(f&&(d=s.computeModelMatrix(e,Ydt),p=$dt(a._uri,e),f=l(d)&&l(p)),!f){l(u)&&u.modelPrimitive&&(u.modelPrimitive.show=!1);continue}if((!l(u)||!Jdt(u,p))&&(c=De.createIfNeeded(p),l(u)&&c.url===u.url&&(oTe(u,p),c=void 0)),l(c)){l(u?.modelPrimitive)&&(i.removeAndDestroy(u.modelPrimitive),delete n[s.id]),u={modelPrimitive:void 0,url:c.url,uri:void 0,uriUrl:void 0,uriQueryParameters:void 0,uriTemplateValues:void 0,animationsRunning:!1,nodeTransformationsScratch:{},articulationsScratch:{},loadFailed:!1,modelUpdated:!1,environmentMapOptionsScratch:{...nTe}},n[s.id]=u,oTe(u,p);let y=X.getValueOrDefault(a._incrementallyLoadTextures,e,Bdt),A=X.getValueOrDefault(a._environmentMapOptions,e,nTe,u.environmentMapOptionsScratch);Qdt(this,s,c,y,A)}let g=u.modelPrimitive;if(!l(g))continue;g.show=!0,g.scale=X.getValueOrDefault(a._scale,e,Ndt),g.enableVerticalExaggeration=X.getValueOrDefault(a._enableVerticalExaggeration,e,Ldt),g.minimumPixelSize=X.getValueOrDefault(a._minimumPixelSize,e,Fdt),g.maximumScale=X.getValueOrUndefined(a._maximumScale,e),g.modelMatrix=Zdt(d,g.modelMatrix),g.shadows=X.getValueOrDefault(a._shadows,e,Udt),g.heightReference=X.getValueOrDefault(a._heightReference,e,zdt),g.distanceDisplayCondition=X.getValueOrUndefined(a._distanceDisplayCondition,e),g.silhouetteColor=X.getValueOrDefault(a._silhouetteColor,e,Vdt,iTe),g.silhouetteSize=X.getValueOrDefault(a._silhouetteSize,e,jdt),g.color=X.getValueOrDefault(a._color,e,Hdt,iTe),g.colorBlendMode=X.getValueOrDefault(a._colorBlendMode,e,Gdt),g.colorBlendAmount=X.getValueOrDefault(a._colorBlendAmount,e,Wdt),g.clippingPlanes=X.getValueOrUndefined(a._clippingPlanes,e),g.clampAnimations=X.getValueOrDefault(a._clampAnimations,e,kdt),g.imageBasedLighting.imageBasedLightingFactor=X.getValueOrDefault(a._imageBasedLightingFactor,e,qdt);let m=X.getValueOrUndefined(a._lightColor,e);if(l(m)&&(z.pack(m,rTe,0),m=h.unpack(rTe,0,Kdt)),g.lightColor=m,g.customShader=X.getValueOrUndefined(a._customShader,e),n[s.id].modelUpdated=!0,g.ready){let y=X.getValueOrDefault(a._runAnimations,e,!0);u.animationsRunning!==y&&(y?g.activeAnimations.addAll({loop:Af.REPEAT}):g.activeAnimations.removeAll(),u.animationsRunning=y);let A=X.getValueOrUndefined(a._nodeTransformations,e,u.nodeTransformationsScratch);if(l(A)){let T=Object.keys(A);for(let E=0,v=T.length;E<v;++E){let S=T[E],I=A[S];if(!l(I))continue;let R=g.getNode(S);if(!l(R))continue;let O=M.fromTranslationRotationScale(I,Xdt);R.matrix=M.multiply(R.originalMatrix,O,O)}}let b=!1,x=X.getValueOrUndefined(a._articulations,e,u.articulationsScratch);if(l(x)){let T=Object.keys(x);for(let E=0,v=T.length;E<v;++E){let S=T[E],I=x[S];l(I)&&(b=!0,g.setArticulationStage(S,I))}}b&&g.applyArticulations()}}return!0};Ly.prototype.isDestroyed=function(){return!1};Ly.prototype.destroy=function(){this._entityCollection.collectionChanged.removeEventListener(Ly.prototype._onCollectionChanged,this);let e=this._entitiesToVisualize.values,t=this._modelHash,n=this._primitives;for(let i=e.length-1;i>-1;i--)uQ(this,e[i],t,n);return le(this)};var R1=new h,eht=new he;Ly.prototype.getBoundingSphere=function(e,t){let n=this._modelHash[e.id];if(!l(n))return Pt.FAILED;if(n.loadFailed)return Pt.FAILED;let i=n.modelPrimitive;if(!l(i)||!i.show)return Pt.PENDING;if(!i.ready||!n.modelUpdated)return Pt.PENDING;let r=this._scene,o=r.ellipsoid??ee.default;if(i.heightReference!==We.NONE){let a=i.modelMatrix;R1.x=a[12],R1.y=a[13],R1.z=a[14];let c=o.cartesianToCartographic(R1,eht),u=r.getHeight(c,i.heightReference);if(l(u)||(u=i._lastSurfaceHeight),!l(u)){let f=this._modelHash,d=Qm(r,n,R1,[i],()=>f[e.id]===n);if(d===void 0)return Pt.PENDING;d!==null&&(u=d)}return l(u)&&(i.heightReference===We.CLIP_TO_GROUND?c.height<u&&(c.height=u):fs(i.heightReference)?c.height=u:c.height+=u),ue.clone(i.boundingSphere,t),t.center=o.cartographicToCartesian(c),Pt.DONE}return ue.clone(i.boundingSphere,t),Pt.DONE};Ly.prototype._onCollectionChanged=function(e,t,n,i){let r,o,s=this._entitiesToVisualize,a=this._modelHash,c=this._primitives;for(r=t.length-1;r>-1;r--)o=t[r],l(o._model)&&l(o._position)&&s.set(o.id,o);for(r=i.length-1;r>-1;r--)o=i[r],l(o._model)&&l(o._position)?(tht(o,a),s.set(o.id,o)):(uQ(this,o,a,c),s.remove(o.id));for(r=n.length-1;r>-1;r--)o=n[r],uQ(this,o,a,c),s.remove(o.id)};function uQ(e,t,n,i){let r=n[t.id];l(r)&&(i.removeAndDestroy(r.modelPrimitive),delete n[t.id])}function tht(e,t){let n=t[e.id];l(n)&&(n.nodeTransformationsScratch={},n.articulationsScratch={})}var J4=Ly;function Np(e){e=e??0,this._array=new Array(e),this._length=e}Object.defineProperties(Np.prototype,{length:{get:function(){return this._length},set:function(e){let t=this._array,n=this._length;if(e<n)for(let i=e;i<n;++i)t[i]=void 0;else e>t.length&&(t.length=e);this._length=e}},values:{get:function(){return this._array}}});Np.prototype.get=function(e){return this._array[e]};Np.prototype.set=function(e,t){e>=this._length&&(this.length=e+1),this._array[e]=t};Np.prototype.peek=function(){return this._array[this._length-1]};Np.prototype.push=function(e){let t=this.length++;this._array[t]=e};Np.prototype.pop=function(){if(this._length===0)return;let e=this._array[this._length-1];return--this.length,e};Np.prototype.reserve=function(e){e>this._array.length&&(this._array.length=e)};Np.prototype.resize=function(e){this.length=e};Np.prototype.trim=function(e){e=e??this._length,this._array.length=e};var Nu=Np;function sTe(e){e=e??H.EMPTY_OBJECT,this._metadata=e.metadata}Object.defineProperties(sTe.prototype,{metadata:{get:function(){return this._metadata}}});var dS=sTe;var fQ=class e{constructor(t,n,i,r){this._tileset=t,this._tile=n,this._resource=i,l(r)||(r=[]),this._contents=r,this._metadata=void 0,this._group=void 0,this._ready=!1}get featurePropertiesDirty(){let t=this._contents,n=t.length;for(let i=0;i<n;++i)if(t[i].featurePropertiesDirty)return!0;return!1}set featurePropertiesDirty(t){let n=this._contents,i=n.length;for(let r=0;r<i;++r)n[r].featurePropertiesDirty=t}get featuresLength(){return 0}get pointsLength(){return 0}get trianglesLength(){return 0}get geometryByteLength(){return 0}get texturesByteLength(){return 0}get batchTableByteLength(){return 0}get innerContents(){return this._contents}get ready(){return this._ready}get tileset(){return this._tileset}get tile(){return this._tile}get url(){return this._resource.getUrlComponent(!0)}get metadata(){return this._metadata}set metadata(t){this._metadata=t;let n=this._contents,i=n.length;for(let r=0;r<i;++r)n[r].metadata=t}get batchTable(){}get group(){return this._group}set group(t){this._group=t;let n=this._contents,i=n.length;for(let r=0;r<i;++r)n[r].group=t}static async fromTileType(t,n,i,r,o,s){o=o??0;let a=new Uint8Array(r),c=new DataView(r);o+=O1;let u=c.getUint32(o,!0);if(u!==1)throw new oe(`Only Composite Tile version 1 is supported. Version ${u} is not.`);o+=O1,o+=O1;let f=c.getUint32(o,!0);o+=O1;let d=i.queryParameters.compositeIndex;l(d)?d=`${d}_`:d="";let p=[];p.length=f;for(let y=0;y<f;++y){let A=yp(a,o),b=c.getUint32(o+O1*2,!0),x=s[A],T=`${d}${y}`,E=i.getDerivedResource({queryParameters:{compositeIndex:T}});if(l(x))p[y]=Promise.resolve(x(t,n,E,r,o));else throw new oe(`Unknown tile content type, ${A}, inside Composite tile`);o+=b}let g=await Promise.all(p);return new e(t,n,i,g)}hasProperty(t,n){return!1}getFeature(t){}applyDebugSettings(t,n){let i=this._contents,r=i.length;for(let o=0;o<r;++o)i[o].applyDebugSettings(t,n)}applyStyle(t){let n=this._contents,i=n.length;for(let r=0;r<i;++r)n[r].applyStyle(t)}update(t,n){let i=this._contents,r=i.length,o=!0;for(let s=0;s<r;++s)i[s].update(t,n),o=o&&i[s].ready;!this._ready&&o&&(this._ready=!0)}pick(t,n,i){if(!this._ready)return;let r,o=Number.POSITIVE_INFINITY,s=this._contents,a=s.length;for(let c=0;c<a;++c){let u=s[c].pick(t,n,i);if(!l(u))continue;let f=h.distance(t.origin,u);f<o&&(r=u,o=f)}if(l(r))return i}isDestroyed(){return!1}destroy(){let t=this._contents,n=t.length;for(let i=0;i<n;++i)t[i].destroy();return le(this)}},O1=Uint32Array.BYTES_PER_ELEMENT,Z4=fQ;function nht(e){this.offset=e.offset,this.count=e.count,this.color=e.color,this.batchIds=e.batchIds}var Ag=nht;var dQ=class{add(t,n,i){if(typeof arguments[0]!="string")for(let r in arguments[0])this.add(r,arguments[0][r],arguments[1]);else(Array.isArray(t)?t:[t]).forEach(function(r){this[r]=this[r]||[],n&&this[r][i?"unshift":"push"](n)},this)}run(t,n){this[t]=this[t]||[],this[t].forEach(function(i){i.call(n&&n.context?n.context:n,n)})}},hQ=class{constructor(t){this.jsep=t,this.registered={}}register(...t){t.forEach(n=>{if(typeof n!="object"||!n.name||!n.init)throw new Error("Invalid JSEP plugin format");this.registered[n.name]||(n.init(this.jsep),this.registered[n.name]=n)})}},Lu=class e{static get version(){return"1.4.0"}static toString(){return"JavaScript Expression Parser (JSEP) v"+e.version}static addUnaryOp(t){return e.max_unop_len=Math.max(t.length,e.max_unop_len),e.unary_ops[t]=1,e}static addBinaryOp(t,n,i){return e.max_binop_len=Math.max(t.length,e.max_binop_len),e.binary_ops[t]=n,i?e.right_associative.add(t):e.right_associative.delete(t),e}static addIdentifierChar(t){return e.additional_identifier_chars.add(t),e}static addLiteral(t,n){return e.literals[t]=n,e}static removeUnaryOp(t){return delete e.unary_ops[t],t.length===e.max_unop_len&&(e.max_unop_len=e.getMaxKeyLen(e.unary_ops)),e}static removeAllUnaryOps(){return e.unary_ops={},e.max_unop_len=0,e}static removeIdentifierChar(t){return e.additional_identifier_chars.delete(t),e}static removeBinaryOp(t){return delete e.binary_ops[t],t.length===e.max_binop_len&&(e.max_binop_len=e.getMaxKeyLen(e.binary_ops)),e.right_associative.delete(t),e}static removeAllBinaryOps(){return e.binary_ops={},e.max_binop_len=0,e}static removeLiteral(t){return delete e.literals[t],e}static removeAllLiterals(){return e.literals={},e}get char(){return this.expr.charAt(this.index)}get code(){return this.expr.charCodeAt(this.index)}constructor(t){this.expr=t,this.index=0}static parse(t){return new e(t).parse()}static getMaxKeyLen(t){return Math.max(0,...Object.keys(t).map(n=>n.length))}static isDecimalDigit(t){return t>=48&&t<=57}static binaryPrecedence(t){return e.binary_ops[t]||0}static isIdentifierStart(t){return t>=65&&t<=90||t>=97&&t<=122||t>=128&&!e.binary_ops[String.fromCharCode(t)]||e.additional_identifier_chars.has(String.fromCharCode(t))}static isIdentifierPart(t){return e.isIdentifierStart(t)||e.isDecimalDigit(t)}throwError(t){let n=new Error(t+" at character "+this.index);throw n.index=this.index,n.description=t,n}runHook(t,n){if(e.hooks[t]){let i={context:this,node:n};return e.hooks.run(t,i),i.node}return n}searchHook(t){if(e.hooks[t]){let n={context:this};return e.hooks[t].find(function(i){return i.call(n.context,n),n.node}),n.node}}gobbleSpaces(){let t=this.code;for(;t===e.SPACE_CODE||t===e.TAB_CODE||t===e.LF_CODE||t===e.CR_CODE;)t=this.expr.charCodeAt(++this.index);this.runHook("gobble-spaces")}parse(){this.runHook("before-all");let t=this.gobbleExpressions(),n=t.length===1?t[0]:{type:e.COMPOUND,body:t};return this.runHook("after-all",n)}gobbleExpressions(t){let n=[],i,r;for(;this.index<this.expr.length;)if(i=this.code,i===e.SEMCOL_CODE||i===e.COMMA_CODE)this.index++;else if(r=this.gobbleExpression())n.push(r);else if(this.index<this.expr.length){if(i===t)break;this.throwError('Unexpected "'+this.char+'"')}return n}gobbleExpression(){let t=this.searchHook("gobble-expression")||this.gobbleBinaryExpression();return this.gobbleSpaces(),this.runHook("after-expression",t)}gobbleBinaryOp(){this.gobbleSpaces();let t=this.expr.substr(this.index,e.max_binop_len),n=t.length;for(;n>0;){if(e.binary_ops.hasOwnProperty(t)&&(!e.isIdentifierStart(this.code)||this.index+t.length<this.expr.length&&!e.isIdentifierPart(this.expr.charCodeAt(this.index+t.length))))return this.index+=n,t;t=t.substr(0,--n)}return!1}gobbleBinaryExpression(){let t,n,i,r,o,s,a,c,u;if(s=this.gobbleToken(),!s||(n=this.gobbleBinaryOp(),!n))return s;for(o={value:n,prec:e.binaryPrecedence(n),right_a:e.right_associative.has(n)},a=this.gobbleToken(),a||this.throwError("Expected expression after "+n),r=[s,o,a];n=this.gobbleBinaryOp();){if(i=e.binaryPrecedence(n),i===0){this.index-=n.length;break}o={value:n,prec:i,right_a:e.right_associative.has(n)},u=n;let f=d=>o.right_a&&d.right_a?i>d.prec:i<=d.prec;for(;r.length>2&&f(r[r.length-2]);)a=r.pop(),n=r.pop().value,s=r.pop(),t={type:e.BINARY_EXP,operator:n,left:s,right:a},r.push(t);t=this.gobbleToken(),t||this.throwError("Expected expression after "+u),r.push(o,t)}for(c=r.length-1,t=r[c];c>1;)t={type:e.BINARY_EXP,operator:r[c-1].value,left:r[c-2],right:t},c-=2;return t}gobbleToken(){let t,n,i,r;if(this.gobbleSpaces(),r=this.searchHook("gobble-token"),r)return this.runHook("after-token",r);if(t=this.code,e.isDecimalDigit(t)||t===e.PERIOD_CODE)return this.gobbleNumericLiteral();if(t===e.SQUOTE_CODE||t===e.DQUOTE_CODE)r=this.gobbleStringLiteral();else if(t===e.OBRACK_CODE)r=this.gobbleArray();else{for(n=this.expr.substr(this.index,e.max_unop_len),i=n.length;i>0;){if(e.unary_ops.hasOwnProperty(n)&&(!e.isIdentifierStart(this.code)||this.index+n.length<this.expr.length&&!e.isIdentifierPart(this.expr.charCodeAt(this.index+n.length)))){this.index+=i;let o=this.gobbleToken();return o||this.throwError("missing unaryOp argument"),this.runHook("after-token",{type:e.UNARY_EXP,operator:n,argument:o,prefix:!0})}n=n.substr(0,--i)}e.isIdentifierStart(t)?(r=this.gobbleIdentifier(),e.literals.hasOwnProperty(r.name)?r={type:e.LITERAL,value:e.literals[r.name],raw:r.name}:r.name===e.this_str&&(r={type:e.THIS_EXP})):t===e.OPAREN_CODE&&(r=this.gobbleGroup())}return r?(r=this.gobbleTokenProperty(r),this.runHook("after-token",r)):this.runHook("after-token",!1)}gobbleTokenProperty(t){this.gobbleSpaces();let n=this.code;for(;n===e.PERIOD_CODE||n===e.OBRACK_CODE||n===e.OPAREN_CODE||n===e.QUMARK_CODE;){let i;if(n===e.QUMARK_CODE){if(this.expr.charCodeAt(this.index+1)!==e.PERIOD_CODE)break;i=!0,this.index+=2,this.gobbleSpaces(),n=this.code}this.index++,n===e.OBRACK_CODE?(t={type:e.MEMBER_EXP,computed:!0,object:t,property:this.gobbleExpression()},t.property||this.throwError('Unexpected "'+this.char+'"'),this.gobbleSpaces(),n=this.code,n!==e.CBRACK_CODE&&this.throwError("Unclosed ["),this.index++):n===e.OPAREN_CODE?t={type:e.CALL_EXP,arguments:this.gobbleArguments(e.CPAREN_CODE),callee:t}:(n===e.PERIOD_CODE||i)&&(i&&this.index--,this.gobbleSpaces(),t={type:e.MEMBER_EXP,computed:!1,object:t,property:this.gobbleIdentifier()}),i&&(t.optional=!0),this.gobbleSpaces(),n=this.code}return t}gobbleNumericLiteral(){let t="",n,i;for(;e.isDecimalDigit(this.code);)t+=this.expr.charAt(this.index++);if(this.code===e.PERIOD_CODE)for(t+=this.expr.charAt(this.index++);e.isDecimalDigit(this.code);)t+=this.expr.charAt(this.index++);if(n=this.char,n==="e"||n==="E"){for(t+=this.expr.charAt(this.index++),n=this.char,(n==="+"||n==="-")&&(t+=this.expr.charAt(this.index++));e.isDecimalDigit(this.code);)t+=this.expr.charAt(this.index++);e.isDecimalDigit(this.expr.charCodeAt(this.index-1))||this.throwError("Expected exponent ("+t+this.char+")")}return i=this.code,e.isIdentifierStart(i)?this.throwError("Variable names cannot start with a number ("+t+this.char+")"):(i===e.PERIOD_CODE||t.length===1&&t.charCodeAt(0)===e.PERIOD_CODE)&&this.throwError("Unexpected period"),{type:e.LITERAL,value:parseFloat(t),raw:t}}gobbleStringLiteral(){let t="",n=this.index,i=this.expr.charAt(this.index++),r=!1;for(;this.index<this.expr.length;){let o=this.expr.charAt(this.index++);if(o===i){r=!0;break}else if(o==="\\")switch(o=this.expr.charAt(this.index++),o){case"n":t+=` +`;break;case"r":t+="\r";break;case"t":t+=" ";break;case"b":t+="\b";break;case"f":t+="\f";break;case"v":t+="\v";break;default:t+=o}else t+=o}return r||this.throwError('Unclosed quote after "'+t+'"'),{type:e.LITERAL,value:t,raw:this.expr.substring(n,this.index)}}gobbleIdentifier(){let t=this.code,n=this.index;for(e.isIdentifierStart(t)?this.index++:this.throwError("Unexpected "+this.char);this.index<this.expr.length&&(t=this.code,e.isIdentifierPart(t));)this.index++;return{type:e.IDENTIFIER,name:this.expr.slice(n,this.index)}}gobbleArguments(t){let n=[],i=!1,r=0;for(;this.index<this.expr.length;){this.gobbleSpaces();let o=this.code;if(o===t){i=!0,this.index++,t===e.CPAREN_CODE&&r&&r>=n.length&&this.throwError("Unexpected token "+String.fromCharCode(t));break}else if(o===e.COMMA_CODE){if(this.index++,r++,r!==n.length){if(t===e.CPAREN_CODE)this.throwError("Unexpected token ,");else if(t===e.CBRACK_CODE)for(let s=n.length;s<r;s++)n.push(null)}}else if(n.length!==r&&r!==0)this.throwError("Expected comma");else{let s=this.gobbleExpression();(!s||s.type===e.COMPOUND)&&this.throwError("Expected comma"),n.push(s)}}return i||this.throwError("Expected "+String.fromCharCode(t)),n}gobbleGroup(){this.index++;let t=this.gobbleExpressions(e.CPAREN_CODE);if(this.code===e.CPAREN_CODE)return this.index++,t.length===1?t[0]:t.length?{type:e.SEQUENCE_EXP,expressions:t}:!1;this.throwError("Unclosed (")}gobbleArray(){return this.index++,{type:e.ARRAY_EXP,elements:this.gobbleArguments(e.CBRACK_CODE)}}},iht=new dQ;Object.assign(Lu,{hooks:iht,plugins:new hQ(Lu),COMPOUND:"Compound",SEQUENCE_EXP:"SequenceExpression",IDENTIFIER:"Identifier",MEMBER_EXP:"MemberExpression",LITERAL:"Literal",THIS_EXP:"ThisExpression",CALL_EXP:"CallExpression",UNARY_EXP:"UnaryExpression",BINARY_EXP:"BinaryExpression",ARRAY_EXP:"ArrayExpression",TAB_CODE:9,LF_CODE:10,CR_CODE:13,SPACE_CODE:32,PERIOD_CODE:46,COMMA_CODE:44,SQUOTE_CODE:39,DQUOTE_CODE:34,OPAREN_CODE:40,CPAREN_CODE:41,OBRACK_CODE:91,CBRACK_CODE:93,QUMARK_CODE:63,SEMCOL_CODE:59,COLON_CODE:58,unary_ops:{"-":1,"!":1,"~":1,"+":1},binary_ops:{"||":1,"??":1,"&&":2,"|":3,"^":4,"&":5,"==":6,"!=":6,"===":6,"!==":6,"<":7,">":7,"<=":7,">=":7,"<<":8,">>":8,">>>":8,"+":9,"-":9,"*":10,"/":10,"%":10,"**":11},right_associative:new Set(["**"]),additional_identifier_chars:new Set(["$","_"]),literals:{true:!0,false:!1,null:null},this_str:"this"});Lu.max_unop_len=Lu.getMaxKeyLen(Lu.unary_ops);Lu.max_binop_len=Lu.getMaxKeyLen(Lu.binary_ops);var Fy=e=>new Lu(e).parse(),rht=Object.getOwnPropertyNames(class{});Object.getOwnPropertyNames(Lu).filter(e=>!rht.includes(e)&&Fy[e]===void 0).forEach(e=>{Fy[e]=Lu[e]});Fy.Jsep=Lu;var oht="ConditionalExpression",sht={name:"ternary",init(e){e.hooks.add("after-expression",function(n){if(n.node&&this.code===e.QUMARK_CODE){this.index++;let i=n.node,r=this.gobbleExpression();if(r||this.throwError("Expected expression"),this.gobbleSpaces(),this.code===e.COLON_CODE){this.index++;let o=this.gobbleExpression();if(o||this.throwError("Expected expression"),n.node={type:oht,test:i,consequent:r,alternate:o},i.operator&&e.binary_ops[i.operator]<=.9){let s=i;for(;s.right.operator&&e.binary_ops[s.right.operator]<=.9;)s=s.right;n.node.test=s.right,s.right=n.node,n.node=i}}else this.throwError("Expected :")}})}};Fy.plugins.register(sht);var aTe={VARIABLE:0,UNARY:1,BINARY:2,TERNARY:3,CONDITIONAL:4,MEMBER:5,FUNCTION_CALL:6,ARRAY:7,REGEX:8,VARIABLE_IN_STRING:9,LITERAL_NULL:10,LITERAL_BOOLEAN:11,LITERAL_NUMBER:12,LITERAL_STRING:13,LITERAL_COLOR:14,LITERAL_VECTOR:15,LITERAL_REGEX:16,LITERAL_UNDEFINED:17,BUILTIN_VARIABLE:18};Object.freeze(aTe);var Nt=aTe;function qh(e,t){this._expression=e,e=Aht(e,t),e=xht(bht(e)),Fy.addBinaryOp("=~",0),Fy.addBinaryOp("!~",0);let n;try{n=Fy(e)}catch(i){throw new oe(i)}this._runtimeAst=Yi(this,n)}Object.defineProperties(qh.prototype,{expression:{get:function(){return this._expression}}});var Bn={arrayIndex:0,arrayArray:[[]],cartesian2Index:0,cartesian3Index:0,cartesian4Index:0,cartesian2Array:[new U],cartesian3Array:[new h],cartesian4Array:[new se],reset:function(){this.arrayIndex=0,this.cartesian2Index=0,this.cartesian3Index=0,this.cartesian4Index=0},getArray:function(){this.arrayIndex>=this.arrayArray.length&&this.arrayArray.push([]);let e=this.arrayArray[this.arrayIndex++];return e.length=0,e},getCartesian2:function(){return this.cartesian2Index>=this.cartesian2Array.length&&this.cartesian2Array.push(new U),this.cartesian2Array[this.cartesian2Index++]},getCartesian3:function(){return this.cartesian3Index>=this.cartesian3Array.length&&this.cartesian3Array.push(new h),this.cartesian3Array[this.cartesian3Index++]},getCartesian4:function(){return this.cartesian4Index>=this.cartesian4Array.length&&this.cartesian4Array.push(new se),this.cartesian4Array[this.cartesian4Index++]}};qh.prototype.evaluate=function(e,t){Bn.reset();let n=this._runtimeAst.evaluate(e);return t instanceof z&&n instanceof se?z.fromCartesian4(n,t):n instanceof U||n instanceof h||n instanceof se?n.clone(t):n};qh.prototype.evaluateColor=function(e,t){Bn.reset();let n=this._runtimeAst.evaluate(e);return z.fromCartesian4(n,t)};qh.prototype.getShaderFunction=function(e,t,n,i){let r=this.getShaderExpression(t,n);return r=`${i} ${e} +{ + return ${r}; +} +`,r};qh.prototype.getShaderExpression=function(e,t){return this._runtimeAst.getShaderExpression(e,t)};qh.prototype.getVariables=function(){let e=[];return this._runtimeAst.getVariables(e),e=e.filter(function(t,n,i){return i.indexOf(t)===n}),e};var aht=["!","-","+"],cTe=["+","-","*","/","%","===","!==",">",">=","<","<=","&&","||","!~","=~"],M1=/\${(.*?)}/g,cht=/\\/g,lht="@#%",uht=/@#%/g,t8=new z,n8={abs:ka(Math.abs),sqrt:ka(Math.sqrt),cos:ka(Math.cos),sin:ka(Math.sin),tan:ka(Math.tan),acos:ka(Math.acos),asin:ka(Math.asin),atan:ka(Math.atan),radians:ka(P.toRadians),degrees:ka(P.toDegrees),sign:ka(P.sign),floor:ka(Math.floor),ceil:ka(Math.ceil),round:ka(Math.round),exp:ka(Math.exp),exp2:ka(dht),log:ka(Math.log),log2:ka(hht),fract:ka(fht),length:mht,normalize:pht},i8={atan2:Q4(Math.atan2,!1),pow:Q4(Math.pow,!1),min:Q4(Math.min,!0),max:Q4(Math.max,!0),distance:ght,dot:_ht,cross:yht},gQ={clamp:lTe(P.clamp,!0),mix:lTe(P.lerp,!0)};function fht(e){return e-Math.floor(e)}function dht(e){return Math.pow(2,e)}function hht(e){return P.log2(e)}function ka(e){return function(t,n){if(typeof n=="number")return e(n);if(n instanceof U)return U.fromElements(e(n.x),e(n.y),Bn.getCartesian2());if(n instanceof h)return h.fromElements(e(n.x),e(n.y),e(n.z),Bn.getCartesian3());if(n instanceof se)return se.fromElements(e(n.x),e(n.y),e(n.z),e(n.w),Bn.getCartesian4());throw new oe(`Function "${t}" requires a vector or number argument. Argument is ${n}.`)}}function Q4(e,t){return function(n,i,r){if(t&&typeof r=="number"){if(typeof i=="number")return e(i,r);if(i instanceof U)return U.fromElements(e(i.x,r),e(i.y,r),Bn.getCartesian2());if(i instanceof h)return h.fromElements(e(i.x,r),e(i.y,r),e(i.z,r),Bn.getCartesian3());if(i instanceof se)return se.fromElements(e(i.x,r),e(i.y,r),e(i.z,r),e(i.w,r),Bn.getCartesian4())}if(typeof i=="number"&&typeof r=="number")return e(i,r);if(i instanceof U&&r instanceof U)return U.fromElements(e(i.x,r.x),e(i.y,r.y),Bn.getCartesian2());if(i instanceof h&&r instanceof h)return h.fromElements(e(i.x,r.x),e(i.y,r.y),e(i.z,r.z),Bn.getCartesian3());if(i instanceof se&&r instanceof se)return se.fromElements(e(i.x,r.x),e(i.y,r.y),e(i.z,r.z),e(i.w,r.w),Bn.getCartesian4());throw new oe(`Function "${n}" requires vector or number arguments of matching types. Arguments are ${i} and ${r}.`)}}function lTe(e,t){return function(n,i,r,o){if(t&&typeof o=="number"){if(typeof i=="number"&&typeof r=="number")return e(i,r,o);if(i instanceof U&&r instanceof U)return U.fromElements(e(i.x,r.x,o),e(i.y,r.y,o),Bn.getCartesian2());if(i instanceof h&&r instanceof h)return h.fromElements(e(i.x,r.x,o),e(i.y,r.y,o),e(i.z,r.z,o),Bn.getCartesian3());if(i instanceof se&&r instanceof se)return se.fromElements(e(i.x,r.x,o),e(i.y,r.y,o),e(i.z,r.z,o),e(i.w,r.w,o),Bn.getCartesian4())}if(typeof i=="number"&&typeof r=="number"&&typeof o=="number")return e(i,r,o);if(i instanceof U&&r instanceof U&&o instanceof U)return U.fromElements(e(i.x,r.x,o.x),e(i.y,r.y,o.y),Bn.getCartesian2());if(i instanceof h&&r instanceof h&&o instanceof h)return h.fromElements(e(i.x,r.x,o.x),e(i.y,r.y,o.y),e(i.z,r.z,o.z),Bn.getCartesian3());if(i instanceof se&&r instanceof se&&o instanceof se)return se.fromElements(e(i.x,r.x,o.x),e(i.y,r.y,o.y),e(i.z,r.z,o.z),e(i.w,r.w,o.w),Bn.getCartesian4());throw new oe(`Function "${n}" requires vector or number arguments of matching types. Arguments are ${i}, ${r}, and ${o}.`)}}function mht(e,t){if(typeof t=="number")return Math.abs(t);if(t instanceof U)return U.magnitude(t);if(t instanceof h)return h.magnitude(t);if(t instanceof se)return se.magnitude(t);throw new oe(`Function "${e}" requires a vector or number argument. Argument is ${t}.`)}function pht(e,t){if(typeof t=="number")return 1;if(t instanceof U)return U.normalize(t,Bn.getCartesian2());if(t instanceof h)return h.normalize(t,Bn.getCartesian3());if(t instanceof se)return se.normalize(t,Bn.getCartesian4());throw new oe(`Function "${e}" requires a vector or number argument. Argument is ${t}.`)}function ght(e,t,n){if(typeof t=="number"&&typeof n=="number")return Math.abs(t-n);if(t instanceof U&&n instanceof U)return U.distance(t,n);if(t instanceof h&&n instanceof h)return h.distance(t,n);if(t instanceof se&&n instanceof se)return se.distance(t,n);throw new oe(`Function "${e}" requires vector or number arguments of matching types. Arguments are ${t} and ${n}.`)}function _ht(e,t,n){if(typeof t=="number"&&typeof n=="number")return t*n;if(t instanceof U&&n instanceof U)return U.dot(t,n);if(t instanceof h&&n instanceof h)return h.dot(t,n);if(t instanceof se&&n instanceof se)return se.dot(t,n);throw new oe(`Function "${e}" requires vector or number arguments of matching types. Arguments are ${t} and ${n}.`)}function yht(e,t,n){if(t instanceof h&&n instanceof h)return h.cross(t,n,Bn.getCartesian3());throw new oe(`Function "${e}" requires vec3 arguments. Arguments are ${t} and ${n}.`)}function Ft(e,t,n,i,r){this._type=e,this._value=t,this._left=n,this._right=i,this._test=r,this.evaluate=void 0,Rht(this)}function Aht(e,t){if(!l(t))return e;for(let n in t)if(t.hasOwnProperty(n)){let i=new RegExp(`\\$\\{${n}\\}`,"g"),r=`(${t[n]})`;l(r)&&(e=e.replace(i,r))}return e}function bht(e){return e.replace(cht,lht)}function pQ(e){return e.replace(uht,"\\")}function xht(e){let t=e,n="",i=t.indexOf("${");for(;i>=0;){let r=t.indexOf("'"),o=t.indexOf('"'),s;if(r>=0&&r<i)s=t.indexOf("'",r+1),n+=t.substr(0,s+1),t=t.substr(s+1),i=t.indexOf("${");else if(o>=0&&o<i)s=t.indexOf('"',o+1),n+=t.substr(0,s+1),t=t.substr(s+1),i=t.indexOf("${");else{n+=t.substr(0,i);let a=t.indexOf("}");if(a<0)throw new oe("Unmatched {.");n+=`czm_${t.substr(i+2,a-(i+2))}`,t=t.substr(a+1),i=t.indexOf("${")}}return n+=t,n}function Tht(e){let t=typeof e.value;if(e.value===null)return new Ft(Nt.LITERAL_NULL,null);if(t==="boolean")return new Ft(Nt.LITERAL_BOOLEAN,e.value);if(t==="number")return new Ft(Nt.LITERAL_NUMBER,e.value);if(t==="string")return e.value.indexOf("${")>=0?new Ft(Nt.VARIABLE_IN_STRING,e.value):new Ft(Nt.LITERAL_STRING,pQ(e.value))}function Eht(e,t){let n=t.arguments,i=n.length,r,o,s,a;if(t.callee.type==="MemberExpression"){r=t.callee.property.name;let c=t.callee.object;if(r==="test"||r==="exec"){if(!l(c.callee)||c.callee.name!=="regExp")throw new oe(`${r} is not a function.`);return i===0?r==="test"?new Ft(Nt.LITERAL_BOOLEAN,!1):new Ft(Nt.LITERAL_NULL,null):(s=Yi(e,c),a=Yi(e,n[0]),new Ft(Nt.FUNCTION_CALL,r,s,a))}else if(r==="toString")return o=Yi(e,c),new Ft(Nt.FUNCTION_CALL,r,o);throw new oe(`Unexpected function call "${r}".`)}if(r=t.callee.name,r==="color"){if(i===0)return new Ft(Nt.LITERAL_COLOR,r);if(o=Yi(e,n[0]),l(n[1])){let c=Yi(e,n[1]);return new Ft(Nt.LITERAL_COLOR,r,[o,c])}return new Ft(Nt.LITERAL_COLOR,r,[o])}else if(r==="rgb"||r==="hsl"){if(i<3)throw new oe(`${r} requires three arguments.`);return o=[Yi(e,n[0]),Yi(e,n[1]),Yi(e,n[2])],new Ft(Nt.LITERAL_COLOR,r,o)}else if(r==="rgba"||r==="hsla"){if(i<4)throw new oe(`${r} requires four arguments.`);return o=[Yi(e,n[0]),Yi(e,n[1]),Yi(e,n[2]),Yi(e,n[3])],new Ft(Nt.LITERAL_COLOR,r,o)}else if(r==="vec2"||r==="vec3"||r==="vec4"){o=new Array(i);for(let c=0;c<i;++c)o[c]=Yi(e,n[c]);return new Ft(Nt.LITERAL_VECTOR,r,o)}else{if(r==="isNaN"||r==="isFinite")return i===0?r==="isNaN"?new Ft(Nt.LITERAL_BOOLEAN,!0):new Ft(Nt.LITERAL_BOOLEAN,!1):(o=Yi(e,n[0]),new Ft(Nt.UNARY,r,o));if(r==="isExactClass"||r==="isClass"){if(i<1||i>1)throw new oe(`${r} requires exactly one argument.`);return o=Yi(e,n[0]),new Ft(Nt.UNARY,r,o)}else if(r==="getExactClassName"){if(i>0)throw new oe(`${r} does not take any argument.`);return new Ft(Nt.UNARY,r)}else if(l(n8[r])){if(i!==1)throw new oe(`${r} requires exactly one argument.`);return o=Yi(e,n[0]),new Ft(Nt.UNARY,r,o)}else if(l(i8[r])){if(i!==2)throw new oe(`${r} requires exactly two arguments.`);return s=Yi(e,n[0]),a=Yi(e,n[1]),new Ft(Nt.BINARY,r,s,a)}else if(l(gQ[r])){if(i!==3)throw new oe(`${r} requires exactly three arguments.`);s=Yi(e,n[0]),a=Yi(e,n[1]);let c=Yi(e,n[2]);return new Ft(Nt.TERNARY,r,s,a,c)}else{if(r==="Boolean")return i===0?new Ft(Nt.LITERAL_BOOLEAN,!1):(o=Yi(e,n[0]),new Ft(Nt.UNARY,r,o));if(r==="Number")return i===0?new Ft(Nt.LITERAL_NUMBER,0):(o=Yi(e,n[0]),new Ft(Nt.UNARY,r,o));if(r==="String")return i===0?new Ft(Nt.LITERAL_STRING,""):(o=Yi(e,n[0]),new Ft(Nt.UNARY,r,o));if(r==="regExp")return Cht(e,t)}}throw new oe(`Unexpected function call "${r}".`)}function Cht(e,t){let n=t.arguments;if(n.length===0)return new Ft(Nt.LITERAL_REGEX,new RegExp);let i=Yi(e,n[0]),r;if(n.length>1){let o=Yi(e,n[1]);if(mQ(i)&&mQ(o)){try{r=new RegExp(pQ(String(i._value)),o._value)}catch(s){throw new oe(s)}return new Ft(Nt.LITERAL_REGEX,r)}return new Ft(Nt.REGEX,i,o)}if(mQ(i)){try{r=new RegExp(pQ(String(i._value)))}catch(o){throw new oe(o)}return new Ft(Nt.LITERAL_REGEX,r)}return new Ft(Nt.REGEX,i)}function vht(e){if(Pht(e.name)){let t=Dht(e.name);return t.substr(0,8)==="tiles3d_"?new Ft(Nt.BUILTIN_VARIABLE,t):new Ft(Nt.VARIABLE,t)}else{if(e.name==="NaN")return new Ft(Nt.LITERAL_NUMBER,NaN);if(e.name==="Infinity")return new Ft(Nt.LITERAL_NUMBER,1/0);if(e.name==="undefined")return new Ft(Nt.LITERAL_UNDEFINED,void 0)}throw new oe(`${e.name} is not defined.`)}function Sht(e){let t=e.property.name;if(t==="PI")return new Ft(Nt.LITERAL_NUMBER,Math.PI);if(t==="E")return new Ft(Nt.LITERAL_NUMBER,Math.E)}function wht(e){if(e.property.name==="POSITIVE_INFINITY")return new Ft(Nt.LITERAL_NUMBER,Number.POSITIVE_INFINITY)}function Iht(e,t){if(t.object.name==="Math")return Sht(t);if(t.object.name==="Number")return wht(t);let n,i=Yi(e,t.object);return t.computed?(n=Yi(e,t.property),new Ft(Nt.MEMBER,"brackets",i,n)):(n=new Ft(Nt.LITERAL_STRING,t.property.name),new Ft(Nt.MEMBER,"dot",i,n))}function mQ(e){return e._type>=Nt.LITERAL_NULL}function Pht(e){return e.substr(0,4)==="czm_"}function Dht(e){return e.substr(4)}function Yi(e,t){let n,i,r,o;if(t.type==="Literal")n=Tht(t);else if(t.type==="CallExpression")n=Eht(e,t);else if(t.type==="Identifier")n=vht(t);else if(t.type==="UnaryExpression"){i=t.operator;let s=Yi(e,t.argument);if(aht.indexOf(i)>-1)n=new Ft(Nt.UNARY,i,s);else throw new oe(`Unexpected operator "${i}".`)}else if(t.type==="BinaryExpression")if(i=t.operator,r=Yi(e,t.left),o=Yi(e,t.right),cTe.indexOf(i)>-1)n=new Ft(Nt.BINARY,i,r,o);else throw new oe(`Unexpected operator "${i}".`);else if(t.type==="LogicalExpression")i=t.operator,r=Yi(e,t.left),o=Yi(e,t.right),cTe.indexOf(i)>-1&&(n=new Ft(Nt.BINARY,i,r,o));else if(t.type==="ConditionalExpression"){let s=Yi(e,t.test);r=Yi(e,t.consequent),o=Yi(e,t.alternate),n=new Ft(Nt.CONDITIONAL,"?",r,o,s)}else if(t.type==="MemberExpression")n=Iht(e,t);else if(t.type==="ArrayExpression"){let s=[];for(let a=0;a<t.elements.length;a++)s[a]=Yi(e,t.elements[a]);n=new Ft(Nt.ARRAY,s)}else throw t.type==="Compound"?new oe("Provide exactly one expression."):new oe("Cannot parse expression.");return n}function Rht(e){e._type===Nt.CONDITIONAL?e.evaluate=e._evaluateConditional:e._type===Nt.FUNCTION_CALL?e._value==="test"?e.evaluate=e._evaluateRegExpTest:e._value==="exec"?e.evaluate=e._evaluateRegExpExec:e._value==="toString"&&(e.evaluate=e._evaluateToString):e._type===Nt.UNARY?e._value==="!"?e.evaluate=e._evaluateNot:e._value==="-"?e.evaluate=e._evaluateNegative:e._value==="+"?e.evaluate=e._evaluatePositive:e._value==="isNaN"?e.evaluate=e._evaluateNaN:e._value==="isFinite"?e.evaluate=e._evaluateIsFinite:e._value==="isExactClass"?e.evaluate=e._evaluateIsExactClass:e._value==="isClass"?e.evaluate=e._evaluateIsClass:e._value==="getExactClassName"?e.evaluate=e._evaluateGetExactClassName:e._value==="Boolean"?e.evaluate=e._evaluateBooleanConversion:e._value==="Number"?e.evaluate=e._evaluateNumberConversion:e._value==="String"?e.evaluate=e._evaluateStringConversion:l(n8[e._value])&&(e.evaluate=Mht(e._value)):e._type===Nt.BINARY?e._value==="+"?e.evaluate=e._evaluatePlus:e._value==="-"?e.evaluate=e._evaluateMinus:e._value==="*"?e.evaluate=e._evaluateTimes:e._value==="/"?e.evaluate=e._evaluateDivide:e._value==="%"?e.evaluate=e._evaluateMod:e._value==="==="?e.evaluate=e._evaluateEqualsStrict:e._value==="!=="?e.evaluate=e._evaluateNotEqualsStrict:e._value==="<"?e.evaluate=e._evaluateLessThan:e._value==="<="?e.evaluate=e._evaluateLessThanOrEquals:e._value===">"?e.evaluate=e._evaluateGreaterThan:e._value===">="?e.evaluate=e._evaluateGreaterThanOrEquals:e._value==="&&"?e.evaluate=e._evaluateAnd:e._value==="||"?e.evaluate=e._evaluateOr:e._value==="=~"?e.evaluate=e._evaluateRegExpMatch:e._value==="!~"?e.evaluate=e._evaluateRegExpNotMatch:l(i8[e._value])&&(e.evaluate=Nht(e._value)):e._type===Nt.TERNARY?e.evaluate=Lht(e._value):e._type===Nt.MEMBER?e._value==="brackets"?e.evaluate=e._evaluateMemberBrackets:e.evaluate=e._evaluateMemberDot:e._type===Nt.ARRAY?e.evaluate=e._evaluateArray:e._type===Nt.VARIABLE?e.evaluate=e._evaluateVariable:e._type===Nt.VARIABLE_IN_STRING?e.evaluate=e._evaluateVariableString:e._type===Nt.LITERAL_COLOR?e.evaluate=e._evaluateLiteralColor:e._type===Nt.LITERAL_VECTOR?e.evaluate=e._evaluateLiteralVector:e._type===Nt.LITERAL_STRING?e.evaluate=e._evaluateLiteralString:e._type===Nt.REGEX?e.evaluate=e._evaluateRegExp:e._type===Nt.BUILTIN_VARIABLE?e._value==="tiles3d_tileset_time"&&(e.evaluate=Oht):e.evaluate=e._evaluateLiteral}function Oht(e){return l(e)?e.content.tileset.timeSinceLoad:0}function Mht(e){let t=n8[e];return function(n){let i=this._left.evaluate(n);return t(e,i)}}function Nht(e){let t=i8[e];return function(n){let i=this._left.evaluate(n),r=this._right.evaluate(n);return t(e,i,r)}}function Lht(e){let t=gQ[e];return function(n){let i=this._left.evaluate(n),r=this._right.evaluate(n),o=this._test.evaluate(n);return t(e,i,r,o)}}function r8(e,t){if(l(e))return e.getPropertyInherited(t)}Ft.prototype._evaluateLiteral=function(){return this._value};Ft.prototype._evaluateLiteralColor=function(e){let t=t8,n=this._left;if(this._value==="color")l(n)?n.length>1?(z.fromCssColorString(n[0].evaluate(e),t),t.alpha=n[1].evaluate(e)):z.fromCssColorString(n[0].evaluate(e),t):z.fromBytes(255,255,255,255,t);else if(this._value==="rgb")z.fromBytes(n[0].evaluate(e),n[1].evaluate(e),n[2].evaluate(e),255,t);else if(this._value==="rgba"){let i=n[3].evaluate(e)*255;z.fromBytes(n[0].evaluate(e),n[1].evaluate(e),n[2].evaluate(e),i,t)}else this._value==="hsl"?z.fromHsl(n[0].evaluate(e),n[1].evaluate(e),n[2].evaluate(e),1,t):this._value==="hsla"&&z.fromHsl(n[0].evaluate(e),n[1].evaluate(e),n[2].evaluate(e),n[3].evaluate(e),t);return se.fromColor(t,Bn.getCartesian4())};Ft.prototype._evaluateLiteralVector=function(e){let t=Bn.getArray(),n=this._value,i=this._left,r=i.length;for(let a=0;a<r;++a){let c=i[a].evaluate(e);if(typeof c=="number")t.push(c);else if(c instanceof U)t.push(c.x,c.y);else if(c instanceof h)t.push(c.x,c.y,c.z);else if(c instanceof se)t.push(c.x,c.y,c.z,c.w);else throw new oe(`${n} argument must be a vector or number. Argument is ${c}.`)}let o=t.length,s=parseInt(n.charAt(3));if(o===0)throw new oe(`Invalid ${n} constructor. No valid arguments.`);if(o<s&&o>1)throw new oe(`Invalid ${n} constructor. Not enough arguments.`);if(o>s&&r>1)throw new oe(`Invalid ${n} constructor. Too many arguments.`);if(o===1){let a=t[0];t.push(a,a,a)}if(n==="vec2")return U.fromArray(t,0,Bn.getCartesian2());if(n==="vec3")return h.fromArray(t,0,Bn.getCartesian3());if(n==="vec4")return se.fromArray(t,0,Bn.getCartesian4())};Ft.prototype._evaluateLiteralString=function(){return this._value};Ft.prototype._evaluateVariableString=function(e){let t=this._value,n=M1.exec(t);for(;n!==null;){let i=n[0],r=n[1],o=r8(e,r);l(o)||(o=""),t=t.replace(i,o),M1.lastIndex+=o.length-i.length,n=M1.exec(t)}return t};Ft.prototype._evaluateVariable=function(e){return r8(e,this._value)};function Ox(e){return e._value==="feature"}Ft.prototype._evaluateMemberDot=function(e){if(Ox(this._left))return r8(e,this._right.evaluate(e));let t=this._left.evaluate(e);if(!l(t))return;let n=this._right.evaluate(e);if(t instanceof U||t instanceof h||t instanceof se){if(n==="r")return t.x;if(n==="g")return t.y;if(n==="b")return t.z;if(n==="a")return t.w}return t[n]};Ft.prototype._evaluateMemberBrackets=function(e){if(Ox(this._left))return r8(e,this._right.evaluate(e));let t=this._left.evaluate(e);if(!l(t))return;let n=this._right.evaluate(e);if(t instanceof U||t instanceof h||t instanceof se){if(n===0||n==="r")return t.x;if(n===1||n==="g")return t.y;if(n===2||n==="b")return t.z;if(n===3||n==="a")return t.w}return t[n]};Ft.prototype._evaluateArray=function(e){let t=[];for(let n=0;n<this._value.length;n++)t[n]=this._value[n].evaluate(e);return t};Ft.prototype._evaluateNot=function(e){let t=this._left.evaluate(e);if(typeof t!="boolean")throw new oe(`Operator "!" requires a boolean argument. Argument is ${t}.`);return!t};Ft.prototype._evaluateNegative=function(e){let t=this._left.evaluate(e);if(t instanceof U)return U.negate(t,Bn.getCartesian2());if(t instanceof h)return h.negate(t,Bn.getCartesian3());if(t instanceof se)return se.negate(t,Bn.getCartesian4());if(typeof t=="number")return-t;throw new oe(`Operator "-" requires a vector or number argument. Argument is ${t}.`)};Ft.prototype._evaluatePositive=function(e){let t=this._left.evaluate(e);if(!(t instanceof U||t instanceof h||t instanceof se||typeof t=="number"))throw new oe(`Operator "+" requires a vector or number argument. Argument is ${t}.`);return t};Ft.prototype._evaluateLessThan=function(e){let t=this._left.evaluate(e),n=this._right.evaluate(e);if(typeof t!="number"||typeof n!="number")throw new oe(`Operator "<" requires number arguments. Arguments are ${t} and ${n}.`);return t<n};Ft.prototype._evaluateLessThanOrEquals=function(e){let t=this._left.evaluate(e),n=this._right.evaluate(e);if(typeof t!="number"||typeof n!="number")throw new oe(`Operator "<=" requires number arguments. Arguments are ${t} and ${n}.`);return t<=n};Ft.prototype._evaluateGreaterThan=function(e){let t=this._left.evaluate(e),n=this._right.evaluate(e);if(typeof t!="number"||typeof n!="number")throw new oe(`Operator ">" requires number arguments. Arguments are ${t} and ${n}.`);return t>n};Ft.prototype._evaluateGreaterThanOrEquals=function(e){let t=this._left.evaluate(e),n=this._right.evaluate(e);if(typeof t!="number"||typeof n!="number")throw new oe(`Operator ">=" requires number arguments. Arguments are ${t} and ${n}.`);return t>=n};Ft.prototype._evaluateOr=function(e){let t=this._left.evaluate(e);if(typeof t!="boolean")throw new oe(`Operator "||" requires boolean arguments. First argument is ${t}.`);if(t)return!0;let n=this._right.evaluate(e);if(typeof n!="boolean")throw new oe(`Operator "||" requires boolean arguments. Second argument is ${n}.`);return t||n};Ft.prototype._evaluateAnd=function(e){let t=this._left.evaluate(e);if(typeof t!="boolean")throw new oe(`Operator "&&" requires boolean arguments. First argument is ${t}.`);if(!t)return!1;let n=this._right.evaluate(e);if(typeof n!="boolean")throw new oe(`Operator "&&" requires boolean arguments. Second argument is ${n}.`);return t&&n};Ft.prototype._evaluatePlus=function(e){let t=this._left.evaluate(e),n=this._right.evaluate(e);if(n instanceof U&&t instanceof U)return U.add(t,n,Bn.getCartesian2());if(n instanceof h&&t instanceof h)return h.add(t,n,Bn.getCartesian3());if(n instanceof se&&t instanceof se)return se.add(t,n,Bn.getCartesian4());if(typeof t=="string"||typeof n=="string")return t+n;if(typeof t=="number"&&typeof n=="number")return t+n;throw new oe(`Operator "+" requires vector or number arguments of matching types, or at least one string argument. Arguments are ${t} and ${n}.`)};Ft.prototype._evaluateMinus=function(e){let t=this._left.evaluate(e),n=this._right.evaluate(e);if(n instanceof U&&t instanceof U)return U.subtract(t,n,Bn.getCartesian2());if(n instanceof h&&t instanceof h)return h.subtract(t,n,Bn.getCartesian3());if(n instanceof se&&t instanceof se)return se.subtract(t,n,Bn.getCartesian4());if(typeof t=="number"&&typeof n=="number")return t-n;throw new oe(`Operator "-" requires vector or number arguments of matching types. Arguments are ${t} and ${n}.`)};Ft.prototype._evaluateTimes=function(e){let t=this._left.evaluate(e),n=this._right.evaluate(e);if(n instanceof U&&t instanceof U)return U.multiplyComponents(t,n,Bn.getCartesian2());if(n instanceof U&&typeof t=="number")return U.multiplyByScalar(n,t,Bn.getCartesian2());if(t instanceof U&&typeof n=="number")return U.multiplyByScalar(t,n,Bn.getCartesian2());if(n instanceof h&&t instanceof h)return h.multiplyComponents(t,n,Bn.getCartesian3());if(n instanceof h&&typeof t=="number")return h.multiplyByScalar(n,t,Bn.getCartesian3());if(t instanceof h&&typeof n=="number")return h.multiplyByScalar(t,n,Bn.getCartesian3());if(n instanceof se&&t instanceof se)return se.multiplyComponents(t,n,Bn.getCartesian4());if(n instanceof se&&typeof t=="number")return se.multiplyByScalar(n,t,Bn.getCartesian4());if(t instanceof se&&typeof n=="number")return se.multiplyByScalar(t,n,Bn.getCartesian4());if(typeof t=="number"&&typeof n=="number")return t*n;throw new oe(`Operator "*" requires vector or number arguments. If both arguments are vectors they must be matching types. Arguments are ${t} and ${n}.`)};Ft.prototype._evaluateDivide=function(e){let t=this._left.evaluate(e),n=this._right.evaluate(e);if(n instanceof U&&t instanceof U)return U.divideComponents(t,n,Bn.getCartesian2());if(t instanceof U&&typeof n=="number")return U.divideByScalar(t,n,Bn.getCartesian2());if(n instanceof h&&t instanceof h)return h.divideComponents(t,n,Bn.getCartesian3());if(t instanceof h&&typeof n=="number")return h.divideByScalar(t,n,Bn.getCartesian3());if(n instanceof se&&t instanceof se)return se.divideComponents(t,n,Bn.getCartesian4());if(t instanceof se&&typeof n=="number")return se.divideByScalar(t,n,Bn.getCartesian4());if(typeof t=="number"&&typeof n=="number")return t/n;throw new oe(`Operator "/" requires vector or number arguments of matching types, or a number as the second argument. Arguments are ${t} and ${n}.`)};Ft.prototype._evaluateMod=function(e){let t=this._left.evaluate(e),n=this._right.evaluate(e);if(n instanceof U&&t instanceof U)return U.fromElements(t.x%n.x,t.y%n.y,Bn.getCartesian2());if(n instanceof h&&t instanceof h)return h.fromElements(t.x%n.x,t.y%n.y,t.z%n.z,Bn.getCartesian3());if(n instanceof se&&t instanceof se)return se.fromElements(t.x%n.x,t.y%n.y,t.z%n.z,t.w%n.w,Bn.getCartesian4());if(typeof t=="number"&&typeof n=="number")return t%n;throw new oe(`Operator "%" requires vector or number arguments of matching types. Arguments are ${t} and ${n}.`)};Ft.prototype._evaluateEqualsStrict=function(e){let t=this._left.evaluate(e),n=this._right.evaluate(e);return n instanceof U&&t instanceof U||n instanceof h&&t instanceof h||n instanceof se&&t instanceof se?t.equals(n):t===n};Ft.prototype._evaluateNotEqualsStrict=function(e){let t=this._left.evaluate(e),n=this._right.evaluate(e);return n instanceof U&&t instanceof U||n instanceof h&&t instanceof h||n instanceof se&&t instanceof se?!t.equals(n):t!==n};Ft.prototype._evaluateConditional=function(e){let t=this._test.evaluate(e);if(typeof t!="boolean")throw new oe(`Conditional argument of conditional expression must be a boolean. Argument is ${t}.`);return t?this._left.evaluate(e):this._right.evaluate(e)};Ft.prototype._evaluateNaN=function(e){return isNaN(this._left.evaluate(e))};Ft.prototype._evaluateIsFinite=function(e){return isFinite(this._left.evaluate(e))};Ft.prototype._evaluateIsExactClass=function(e){return l(e)?e.isExactClass(this._left.evaluate(e)):!1};Ft.prototype._evaluateIsClass=function(e){return l(e)?e.isClass(this._left.evaluate(e)):!1};Ft.prototype._evaluateGetExactClassName=function(e){if(l(e))return e.getExactClassName()};Ft.prototype._evaluateBooleanConversion=function(e){return!!this._left.evaluate(e)};Ft.prototype._evaluateNumberConversion=function(e){return Number(this._left.evaluate(e))};Ft.prototype._evaluateStringConversion=function(e){return String(this._left.evaluate(e))};Ft.prototype._evaluateRegExp=function(e){let t=this._value.evaluate(e),n="";l(this._left)&&(n=this._left.evaluate(e));let i;try{i=new RegExp(t,n)}catch(r){throw new oe(r)}return i};Ft.prototype._evaluateRegExpTest=function(e){let t=this._left.evaluate(e),n=this._right.evaluate(e);if(!(t instanceof RegExp&&typeof n=="string"))throw new oe(`RegExp.test requires the first argument to be a RegExp and the second argument to be a string. Arguments are ${t} and ${n}.`);return t.test(n)};Ft.prototype._evaluateRegExpMatch=function(e){let t=this._left.evaluate(e),n=this._right.evaluate(e);if(t instanceof RegExp&&typeof n=="string")return t.test(n);if(n instanceof RegExp&&typeof t=="string")return n.test(t);throw new oe(`Operator "=~" requires one RegExp argument and one string argument. Arguments are ${t} and ${n}.`)};Ft.prototype._evaluateRegExpNotMatch=function(e){let t=this._left.evaluate(e),n=this._right.evaluate(e);if(t instanceof RegExp&&typeof n=="string")return!t.test(n);if(n instanceof RegExp&&typeof t=="string")return!n.test(t);throw new oe(`Operator "!~" requires one RegExp argument and one string argument. Arguments are ${t} and ${n}.`)};Ft.prototype._evaluateRegExpExec=function(e){let t=this._left.evaluate(e),n=this._right.evaluate(e);if(!(t instanceof RegExp&&typeof n=="string"))throw new oe(`RegExp.exec requires the first argument to be a RegExp and the second argument to be a string. Arguments are ${t} and ${n}.`);let i=t.exec(n);return l(i)?i[1]:null};Ft.prototype._evaluateToString=function(e){let t=this._left.evaluate(e);if(t instanceof RegExp||t instanceof U||t instanceof h||t instanceof se)return String(t);throw new oe(`Unexpected function call "${this._value}".`)};function uTe(e){let t=e._left,n=t.length;for(let a=0;a<n;++a)if(t[a]._type!==Nt.LITERAL_NUMBER)return;let i=t[0]._value,r=t[1]._value,o=t[2]._value,s=n===4?t[3]._value:1;return z.fromHsl(i,r,o,s,t8)}function fTe(e){let t=e._left,n=t.length;for(let r=0;r<n;++r)if(t[r]._type!==Nt.LITERAL_NUMBER)return;let i=t8;return i.red=t[0]._value/255,i.green=t[1]._value/255,i.blue=t[2]._value/255,i.alpha=n===4?t[3]._value:1,i}function By(e){return e%1===0?e.toFixed(1):e.toString()}function Fht(e){let t=By(e.red),n=By(e.green),i=By(e.blue);return`vec3(${t}, ${n}, ${i})`}function e8(e){let t=By(e.red),n=By(e.green),i=By(e.blue),r=By(e.alpha);return`vec4(${t}, ${n}, ${i}, ${r})`}function dTe(e,t,n,i){let r=e.length,o=new Array(r);for(let s=0;s<r;++s)o[s]=e[s].getShaderExpression(t,n,i);return o}function hTe(e,t){return l(t[e])?t[e]:qh.NULL_SENTINEL}qh.NULL_SENTINEL="czm_infinity";Ft.prototype.getShaderExpression=function(e,t,n){let i,r,o,s,a=this._type,c=this._value;l(this._left)&&(Array.isArray(this._left)?r=dTe(this._left,e,t,this):r=this._left.getShaderExpression(e,t,this)),l(this._right)&&(o=this._right.getShaderExpression(e,t,this)),l(this._test)&&(s=this._test.getShaderExpression(e,t,this)),Array.isArray(this._value)&&(c=dTe(this._value,e,t,this));let u,f,d;switch(a){case Nt.VARIABLE:return Ox(this)?void 0:hTe(c,e);case Nt.UNARY:if(c==="Boolean")return`bool(${r})`;if(c==="Number")return`float(${r})`;if(c==="round")return`floor(${r} + 0.5)`;if(l(n8[c]))return`${c}(${r})`;if(c==="isNaN")return`(${r} != ${r})`;if(c==="isFinite")return`(abs(${r}) < czm_infinity)`;if(c==="String"||c==="isExactClass"||c==="isClass"||c==="getExactClassName")throw new oe(`Error generating style shader: "${c}" is not supported.`);return c+r;case Nt.BINARY:return c==="%"?`mod(${r}, ${o})`:c==="==="?`(${r} == ${o})`:c==="!=="?`(${r} != ${o})`:c==="atan2"?`atan(${r}, ${o})`:l(i8[c])?`${c}(${r}, ${o})`:`(${r} ${c} ${o})`;case Nt.TERNARY:if(l(gQ[c]))return`${c}(${r}, ${o}, ${s})`;break;case Nt.CONDITIONAL:return`(${s} ? ${r} : ${o})`;case Nt.MEMBER:return Ox(this._left)?hTe(o,e):o==="r"||o==="x"||o==="0.0"?`${r}[0]`:o==="g"||o==="y"||o==="1.0"?`${r}[1]`:o==="b"||o==="z"||o==="2.0"?`${r}[2]`:o==="a"||o==="w"||o==="3.0"?`${r}[3]`:`${r}[int(${o})]`;case Nt.FUNCTION_CALL:throw new oe(`Error generating style shader: "${c}" is not supported.`);case Nt.ARRAY:if(c.length===4)return`vec4(${c[0]}, ${c[1]}, ${c[2]}, ${c[3]})`;if(c.length===3)return`vec3(${c[0]}, ${c[1]}, ${c[2]})`;if(c.length===2)return`vec2(${c[0]}, ${c[1]})`;throw new oe("Error generating style shader: Invalid array length. Array length should be 2, 3, or 4.");case Nt.REGEX:throw new oe("Error generating style shader: Regular expressions are not supported.");case Nt.VARIABLE_IN_STRING:throw new oe("Error generating style shader: Converting a variable to a string is not supported.");case Nt.LITERAL_NULL:return qh.NULL_SENTINEL;case Nt.LITERAL_BOOLEAN:return c?"true":"false";case Nt.LITERAL_NUMBER:return By(c);case Nt.LITERAL_STRING:if(l(n)&&n._type===Nt.MEMBER&&(c==="r"||c==="g"||c==="b"||c==="a"||c==="x"||c==="y"||c==="z"||c==="w"||Ox(n._left)))return c;if(i=z.fromCssColorString(c,t8),l(i))return Fht(i);throw new oe("Error generating style shader: String literals are not supported.");case Nt.LITERAL_COLOR:if(u=r,c==="color"){if(l(u)){if(u.length>1){let p=u[0],g=u[1];return g!=="1.0"&&(t.translucent=!0),`vec4(${p}, ${g})`}}else return"vec4(1.0)";return`vec4(${u[0]}, 1.0)`}else{if(c==="rgb")return i=fTe(this),l(i)?e8(i):`vec4(${u[0]} / 255.0, ${u[1]} / 255.0, ${u[2]} / 255.0, 1.0)`;if(c==="rgba")return u[3]!=="1.0"&&(t.translucent=!0),i=fTe(this),l(i)?e8(i):`vec4(${u[0]} / 255.0, ${u[1]} / 255.0, ${u[2]} / 255.0, ${u[3]})`;if(c==="hsl")return i=uTe(this),l(i)?e8(i):`vec4(czm_HSLToRGB(vec3(${u[0]}, ${u[1]}, ${u[2]})), 1.0)`;if(c==="hsla")return i=uTe(this),l(i)?(i.alpha!==1&&(t.translucent=!0),e8(i)):(u[3]!=="1.0"&&(t.translucent=!0),`vec4(czm_HSLToRGB(vec3(${u[0]}, ${u[1]}, ${u[2]})), ${u[3]})`)}break;case Nt.LITERAL_VECTOR:f=r.length,d=`${c}(`;for(let p=0;p<f;++p)d+=r[p],p<f-1&&(d+=", ");return d+=")",d;case Nt.LITERAL_REGEX:throw new oe("Error generating style shader: Regular expressions are not supported.");case Nt.LITERAL_UNDEFINED:return qh.NULL_SENTINEL;case Nt.BUILTIN_VARIABLE:if(c==="tiles3d_tileset_time")return c}};Ft.prototype.getVariables=function(e,t){let n,i,r,o=this._type,s=this._value;if(l(this._left))if(Array.isArray(this._left))for(n=this._left,i=n.length,r=0;r<i;++r)n[r].getVariables(e,this);else this._left.getVariables(e,this);if(l(this._right)&&this._right.getVariables(e,this),l(this._test)&&this._test.getVariables(e,this),Array.isArray(this._value))for(n=this._value,i=n.length,r=0;r<i;++r)n[r].getVariables(e,this);let a;switch(o){case Nt.VARIABLE:Ox(this)||e.push(s);break;case Nt.VARIABLE_IN_STRING:for(a=M1.exec(s);a!==null;)e.push(a[1]),a=M1.exec(s);break;case Nt.LITERAL_STRING:l(t)&&t._type===Nt.MEMBER&&Ox(t._left)&&e.push(s);break}};var Yh=qh;function bg(e){e=e??H.EMPTY_OBJECT,this._batchTable=e.batchTable,this._batchIds=e.batchIds,this._positions=e.positions,this._vertexBatchIds=e.vertexBatchIds,this._indices=e.indices,this._indexCounts=e.indexCounts,this._indexOffsets=e.indexOffsets,this._batchedIndices=e.batchedIndices,this._boundingVolume=e.boundingVolume,this._boundingVolumes=e.boundingVolumes,this._center=e.center??h.ZERO,this._va=void 0,this._sp=void 0,this._spStencil=void 0,this._spPick=void 0,this._uniformMap=void 0,this._vaSwap=void 0,this._rsStencilDepthPass=void 0,this._rsStencilDepthPass3DTiles=void 0,this._rsColorPass=void 0,this._rsPickPass=void 0,this._rsWireframe=void 0,this._commands=[],this._commandsIgnoreShow=[],this._pickCommands=[],this._constantColor=z.clone(z.WHITE),this._highlightColor=this._constantColor,this._batchDirty=!0,this._pickCommandsDirty=!0,this._framesSinceLastRebatch=0,this._updatingAllCommands=!1,this._trianglesLength=this._indices.length/3,this._geometryByteLength=this._indices.byteLength+this._positions.byteLength+this._vertexBatchIds.byteLength,this.debugWireframe=!1,this._debugWireframe=this.debugWireframe,this._wireframeDirty=!1,this.forceRebatch=!1,this.classificationType=e.classificationType??Qn.BOTH,this._vertexShaderSource=e._vertexShaderSource,this._fragmentShaderSource=e._fragmentShaderSource,this._attributeLocations=e._attributeLocations,this._uniformMap=e._uniformMap,this._pickId=e._pickId,this._modelMatrix=e._modelMatrix,this._boundingSphere=e._boundingSphere,this._batchIdLookUp={};let t=this._batchIds.length;for(let n=0;n<t;++n){let i=this._batchIds[n];this._batchIdLookUp[i]=n}}Object.defineProperties(bg.prototype,{trianglesLength:{get:function(){return this._trianglesLength}},geometryByteLength:{get:function(){return this._geometryByteLength}}});var Bht={position:0,a_batchId:1};function kht(e,t){if(l(e._va))return;let n=tt.createVertexBuffer({context:t,typedArray:e._positions,usage:Me.STATIC_DRAW}),i=tt.createVertexBuffer({context:t,typedArray:e._vertexBatchIds,usage:Me.STATIC_DRAW}),r=tt.createIndexBuffer({context:t,typedArray:e._indices,usage:Me.DYNAMIC_DRAW,indexDatatype:e._indices.BYTES_PER_ELEMENT===2?je.UNSIGNED_SHORT:je.UNSIGNED_INT}),o=[{index:0,vertexBuffer:n,componentDatatype:Y.fromTypedArray(e._positions),componentsPerAttribute:3},{index:1,vertexBuffer:i,componentDatatype:Y.fromTypedArray(e._vertexBatchIds),componentsPerAttribute:1}];e._va=new Vn({context:t,attributes:o,indexBuffer:r}),t.webgl2&&(e._vaSwap=new Vn({context:t,attributes:o,indexBuffer:tt.createIndexBuffer({context:t,sizeInBytes:r.sizeInBytes,usage:Me.DYNAMIC_DRAW,indexDatatype:r.indexDatatype})})),e._batchedPositions=void 0,e._transferrableBatchIds=void 0,e._vertexBatchIds=void 0}function Uht(e,t){if(l(e._sp))return;let n=e._batchTable,i=e._attributeLocations??Bht,r=e._pickId,o=e._vertexShaderSource,s=e._fragmentShaderSource;if(l(o)){e._sp=Qt.fromCache({context:t,vertexShaderSource:o,fragmentShaderSource:s,attributeLocations:i}),e._spStencil=e._sp,s=Xe.replaceMain(s,"czm_non_pick_main"),s=`${s}void main() +{ + czm_non_pick_main(); + out_FragColor = ${r}; +} +`,e._spPick=Qt.fromCache({context:t,vertexShaderSource:o,fragmentShaderSource:s,attributeLocations:i});return}let a=n.getVertexShaderCallback(!1,"a_batchId",void 0)(gP),c=n.getFragmentShaderCallback(!1,void 0,!0)(Ob);r=n.getPickId();let u=new Xe({sources:[a]}),f=new Xe({defines:["VECTOR_TILE"],sources:[c]});e._sp=Qt.fromCache({context:t,vertexShaderSource:u,fragmentShaderSource:f,attributeLocations:i}),u=new Xe({sources:[gP]}),f=new Xe({defines:["VECTOR_TILE"],sources:[Ob]}),e._spStencil=Qt.fromCache({context:t,vertexShaderSource:u,fragmentShaderSource:f,attributeLocations:i}),c=Xe.replaceMain(c,"czm_non_pick_main"),c=`${c} void main() { - out_FragColor = texture(billboard_texture, v_textureCoordinates); + czm_non_pick_main(); + out_FragColor = ${r}; } -`,{uniformMap:{billboard_texture:function(){return e.textureAtlas.texture}}});return i.pass=Ie.OVERLAY,i}var wlt=[];Sd.prototype.update=function(e){if(SZ(this),!this.show)return;let t=e.context;if(!t.instancedArrays||!(Ut.maximumVertexTextureImageUnits>0))throw new pe("Beginning in CesiumJS 1.140, billboards and labels require device support for WebGL 2, or WebGL 1 with ANGLE_instanced_arrays and MAX_VERTEX_TEXTURE_IMAGE_UNITS > 0. For more information or to share feedback, see: https://github.com/CesiumGS/cesium/issues/13053");let n=this._billboards,i=n.length,r=!0;for(let I=0;I<i;++I){let R=n[I];l(R.loadError)&&(console.error(`Error loading image for billboard: ${R.loadError}`),R.image=void 0),R.textureDirty&&this._updateBillboard(R,xx),R.show&&(r=r&&R.ready)}let o=this._textureAtlas;if(e.afterRender.push(()=>{if(!this.isDestroyed())return o.update(e.context)}),!l(o.texture))return;Clt(this,e),n=this._billboards,i=n.length;let s=this._billboardsToUpdate,a=this._billboardsToUpdateIndex,c=this._propertiesChanged,u=o.guid,f=this._createVertexArray||this._textureAtlasGUID!==u;this._textureAtlasGUID=u;let d,p=e.passes,g=p.pick;if(f||!g&&this.computeNewBuffersUsage()){this._createVertexArray=!1;for(let I=0;I<vZ;++I)c[I]=0;if(this._vaf=this._vaf&&this._vaf.destroy(),i>0){this._vaf=_lt(t,i,this._buffersUsage,this._batchTable,this._sdf),d=this._vaf.writers;for(let I=0;I<i;++I){let R=this._billboards[I];R._dirty=!1,R.textureDirty=!1,Elt(this,e,d,R)}this._vaf.commit(Yye(t))}this._billboardsToUpdateIndex=0}else if(a>0){let I=wlt;I.length=0,(c[c1]||c[dlt]||c[flt])&&I.push(oAe),(c[xx]||c[Xye]||c[llt]||c[ult]||c[clt])&&(I.push(aAe),I.push(CZ)),(c[xx]||c[hlt]||c[Zye])&&(I.push(cAe),I.push(EZ)),(c[xx]||c[$ye])&&I.push(EZ),(c[xx]||c[Kye])&&I.push(CZ),c[Jye]&&I.push(lAe),c[Qye]&&I.push(uAe),(c[eAe]||c[mlt]||c[xx]||c[c1])&&I.push(fAe),(c[xx]||c[c1])&&I.push(dAe),c[tAe]&&I.push(hAe),c[nAe]&&I.push(mAe);let R=I.length;if(d=this._vaf.writers,a/i>.1){for(let O=0;O<a;++O){let L=s[O];L._dirty=!1,L.textureDirty=!1;for(let _=0;_<R;++_)I[_](this,e,d,L)}this._vaf.commit(Yye(t))}else{for(let O=0;O<a;++O){let L=s[O];L._dirty=!1,L.textureDirty=!1;for(let _=0;_<R;++_)I[_](this,e,d,L);this._vaf.subCommit(L._index,1)}this._vaf.endSubCommits()}this._billboardsToUpdateIndex=0}if(a>i*1.5&&(s.length=i),!l(this._vaf)||!l(this._vaf.va))return;this._boundingVolumeDirty&&(this._boundingVolumeDirty=!1,ue.transform(this._baseVolume,this.modelMatrix,this._baseVolumeWC));let m,y=M.IDENTITY;e.mode===re.SCENE3D?(y=this.modelMatrix,m=ue.clone(this._baseVolumeWC,this._boundingVolume)):m=ue.clone(this._baseVolume2D,this._boundingVolume),vlt(this,e,m);let A=this._blendOption!==this.blendOption;if(this._blendOption=this.blendOption,A){this._blendOption===ki.OPAQUE||this._blendOption===ki.OPAQUE_AND_TRANSLUCENT?this._rsOpaque=Ge.fromCache({depthTest:{enabled:!0,func:te.LESS},depthMask:!0}):this._rsOpaque=void 0;let I=this._blendOption===ki.TRANSLUCENT;this._blendOption===ki.TRANSLUCENT||this._blendOption===ki.OPAQUE_AND_TRANSLUCENT?this._rsTranslucent=Ge.fromCache({depthTest:{enabled:!0,func:I?te.LEQUAL:te.LESS},depthMask:I,blending:nn.ALPHA_BLEND}):this._rsTranslucent=void 0}this._shaderDisableDepthDistance=this._shaderDisableDepthDistance||e.minimumDisableDepthTestDistance!==0;let b,x,T,E,v;if(A||this._shaderRotation!==this._compiledShaderRotation||this._shaderAlignedAxis!==this._compiledShaderAlignedAxis||this._shaderScaleByDistance!==this._compiledShaderScaleByDistance||this._shaderTranslucencyByDistance!==this._compiledShaderTranslucencyByDistance||this._shaderPixelOffsetScaleByDistance!==this._compiledShaderPixelOffsetScaleByDistance||this._shaderDistanceDisplayCondition!==this._compiledShaderDistanceDisplayCondition||this._shaderDisableDepthDistance!==this._compiledShaderDisableDepthDistance||this._shaderClampToGround!==this._compiledShaderClampToGround||this._sdf!==this._compiledSDF){b=m2,x=h2,v=["INSTANCED"],l(this._batchTable)&&(v.push("VECTOR_TILE"),b=this._batchTable.getVertexShaderCallback(!1,"a_batchId",void 0)(b),x=this._batchTable.getFragmentShaderCallback(!1,void 0)(x)),T=new Xe({defines:v,sources:[b]}),this._shaderRotation&&T.defines.push("ROTATION"),this._shaderAlignedAxis&&T.defines.push("ALIGNED_AXIS"),this._shaderScaleByDistance&&T.defines.push("EYE_DISTANCE_SCALING"),this._shaderTranslucencyByDistance&&T.defines.push("EYE_DISTANCE_TRANSLUCENCY"),this._shaderPixelOffsetScaleByDistance&&T.defines.push("EYE_DISTANCE_PIXEL_OFFSET"),this._shaderDistanceDisplayCondition&&T.defines.push("DISTANCE_DISPLAY_CONDITION"),this._shaderDisableDepthDistance&&T.defines.push("DISABLE_DEPTH_DISTANCE"),this._shaderClampToGround&&T.defines.push("VS_THREE_POINT_DEPTH_CHECK");let I=1-ec.CUTOFF;this._sdf&&T.defines.push("SDF");let R=l(this._batchTable)?"VECTOR_TILE":"";this._blendOption===ki.OPAQUE_AND_TRANSLUCENT&&(E=new Xe({defines:["OPAQUE",R],sources:[x]}),this._shaderClampToGround&&E.defines.push("VS_THREE_POINT_DEPTH_CHECK"),this._sdf&&(E.defines.push("SDF"),E.defines.push(`SDF_EDGE ${I}`)),this._sp=Qt.replaceCache({context:t,shaderProgram:this._sp,vertexShaderSource:T,fragmentShaderSource:E,attributeLocations:Br}),E=new Xe({defines:["TRANSLUCENT",R],sources:[x]}),this._shaderClampToGround&&E.defines.push("VS_THREE_POINT_DEPTH_CHECK"),this._sdf&&(E.defines.push("SDF"),E.defines.push(`SDF_EDGE ${I}`)),this._spTranslucent=Qt.replaceCache({context:t,shaderProgram:this._spTranslucent,vertexShaderSource:T,fragmentShaderSource:E,attributeLocations:Br})),this._blendOption===ki.OPAQUE&&(E=new Xe({defines:[R],sources:[x]}),this._shaderClampToGround&&E.defines.push("VS_THREE_POINT_DEPTH_CHECK"),this._sdf&&(E.defines.push("SDF"),E.defines.push(`SDF_EDGE ${I}`)),this._sp=Qt.replaceCache({context:t,shaderProgram:this._sp,vertexShaderSource:T,fragmentShaderSource:E,attributeLocations:Br})),this._blendOption===ki.TRANSLUCENT&&(E=new Xe({defines:[R],sources:[x]}),this._shaderClampToGround&&E.defines.push("VS_THREE_POINT_DEPTH_CHECK"),this._sdf&&(E.defines.push("SDF"),E.defines.push(`SDF_EDGE ${I}`)),this._spTranslucent=Qt.replaceCache({context:t,shaderProgram:this._spTranslucent,vertexShaderSource:T,fragmentShaderSource:E,attributeLocations:Br})),this._compiledShaderRotation=this._shaderRotation,this._compiledShaderAlignedAxis=this._shaderAlignedAxis,this._compiledShaderScaleByDistance=this._shaderScaleByDistance,this._compiledShaderTranslucencyByDistance=this._shaderTranslucencyByDistance,this._compiledShaderPixelOffsetScaleByDistance=this._shaderPixelOffsetScaleByDistance,this._compiledShaderDistanceDisplayCondition=this._shaderDistanceDisplayCondition,this._compiledShaderDisableDepthDistance=this._shaderDisableDepthDistance,this._compiledShaderClampToGround=this._shaderClampToGround,this._compiledSDF=this._sdf}let S=e.commandList;if(p.render||p.pick){let I=this._colorCommands,R=this._blendOption===ki.OPAQUE,O=this._blendOption===ki.OPAQUE_AND_TRANSLUCENT,L=this._vaf.va,_=L.length,C=this._uniforms,w;l(this._batchTable)?(C=this._batchTable.getUniformMapCallback()(C),w=this._batchTable.getPickId()):w="v_pickColor",I.length=_;let D=O?_*2:_;for(let N=0;N<D;++N){let F=I[N];l(F)||(F=I[N]=new at);let V=R||O&&N%2===0;F.pass=V||!O?Ie.OPAQUE:Ie.TRANSLUCENT,F.owner=this;let B=O?Math.floor(N/2):N;F.boundingVolume=m,F.modelMatrix=y,F.count=L[B].indicesCount,F.shaderProgram=V?this._sp:this._spTranslucent,F.uniformMap=C,F.vertexArray=L[B].va,F.renderState=V?this._rsOpaque:this._rsTranslucent,F.debugShowBoundingVolume=this.debugShowBoundingVolume,F.pickId=w,F.count=6,F.instanceCount=i,S.push(F)}this.debugShowTextureAtlas&&(l(this.debugCommand)||(this.debugCommand=Slt(this,e.context)),S.push(this.debugCommand))}this._allBillboardsReady=r};Sd.prototype.isDestroyed=function(){return!1};Sd.prototype.destroy=function(){return l(this._removeCallbackFunc)&&(this._removeCallbackFunc(),this._removeCallbackFunc=void 0),this._textureAtlas=this._destroyTextureAtlas&&this._textureAtlas&&this._textureAtlas.destroy(),this._sp=this._sp&&this._sp.destroy(),this._spTranslucent=this._spTranslucent&&this._spTranslucent.destroy(),this._vaf=this._vaf&&this._vaf.destroy(),iAe(this._billboards),le(this)};var wd=Sd;function Ilt(e,t,n,i,r){return function(){let o=document.createElement("canvas"),s=r+2*i;o.height=o.width=s;let a=o.getContext("2d");return a.clearRect(0,0,s,s),i!==0&&(a.beginPath(),a.arc(s/2,s/2,s/2,0,2*Math.PI,!0),a.closePath(),a.fillStyle=n,a.fill(),e<1&&(a.save(),a.globalCompositeOperation="destination-out",a.beginPath(),a.arc(s/2,s/2,r/2,0,2*Math.PI,!0),a.closePath(),a.fillStyle="black",a.fill(),a.restore())),a.beginPath(),a.arc(s/2,s/2,r/2,0,2*Math.PI,!0),a.closePath(),a.fillStyle=t,a.fill(),o}}var Dv=Ilt;var Plt=new he,Fh=class{constructor(t,n,i,r,o){this._content=t,this._billboard=i,this._label=r,this._polyline=o,this._batchId=n,this._billboardImage=void 0,this._billboardColor=void 0,this._billboardOutlineColor=void 0,this._billboardOutlineWidth=void 0,this._billboardSize=void 0,this._pointSize=void 0,this._color=void 0,this._pointSize=void 0,this._pointOutlineColor=void 0,this._pointOutlineWidth=void 0,this._heightOffset=void 0,this._pickIds=new Array(3),Rv(this)}get show(){return this._label.show}set show(t){this._label.show=t,this._billboard.show=t,this._polyline.show=t}get color(){return this._color}set color(t){this._color=z.clone(t,this._color),Rv(this)}get pointSize(){return this._pointSize}set pointSize(t){this._pointSize=t,Rv(this)}get pointOutlineColor(){return this._pointOutlineColor}set pointOutlineColor(t){this._pointOutlineColor=z.clone(t,this._pointOutlineColor),Rv(this)}get pointOutlineWidth(){return this._pointOutlineWidth}set pointOutlineWidth(t){this._pointOutlineWidth=t,Rv(this)}get labelColor(){return this._label.fillColor}set labelColor(t){this._label.fillColor=t,this._polyline.show=this._label.show&&t.alpha>0}get labelOutlineColor(){return this._label.outlineColor}set labelOutlineColor(t){this._label.outlineColor=t}get labelOutlineWidth(){return this._label.outlineWidth}set labelOutlineWidth(t){this._label.outlineWidth=t}get font(){return this._label.font}set font(t){this._label.font=t}get labelStyle(){return this._label.style}set labelStyle(t){this._label.style=t}get labelText(){return this._label.text}set labelText(t){l(t)||(t=""),this._label.text=t}get backgroundColor(){return this._label.backgroundColor}set backgroundColor(t){this._label.backgroundColor=t}get backgroundPadding(){return this._label.backgroundPadding}set backgroundPadding(t){this._label.backgroundPadding=t}get backgroundEnabled(){return this._label.showBackground}set backgroundEnabled(t){this._label.showBackground=t}get scaleByDistance(){return this._label.scaleByDistance}set scaleByDistance(t){this._label.scaleByDistance=t,this._billboard.scaleByDistance=t}get translucencyByDistance(){return this._label.translucencyByDistance}set translucencyByDistance(t){this._label.translucencyByDistance=t,this._billboard.translucencyByDistance=t}get distanceDisplayCondition(){return this._label.distanceDisplayCondition}set distanceDisplayCondition(t){this._label.distanceDisplayCondition=t,this._polyline.distanceDisplayCondition=t,this._billboard.distanceDisplayCondition=t}get heightOffset(){return this._heightOffset}set heightOffset(t){let n=this._heightOffset??0,i=this._content.tileset.ellipsoid,r=i.cartesianToCartographic(this._billboard.position,Plt);r.height=r.height-n+t;let o=i.cartographicToCartesian(r);this._billboard.position=o,this._label.position=this._billboard.position,this._polyline.positions=[this._polyline.positions[0],o],this._heightOffset=t}get anchorLineEnabled(){return this._polyline.show}set anchorLineEnabled(t){this._polyline.show=t}get anchorLineColor(){return this._polyline.material.uniforms.color}set anchorLineColor(t){this._polyline.material.uniforms.color=z.clone(t,this._polyline.material.uniforms.color)}get image(){return this._billboardImage}set image(t){let n=this._billboardImage!==t;this._billboardImage=t,n&&Rv(this)}get disableDepthTestDistance(){return this._label.disableDepthTestDistance}set disableDepthTestDistance(t){this._label.disableDepthTestDistance=t,this._billboard.disableDepthTestDistance=t}get horizontalOrigin(){return this._billboard.horizontalOrigin}set horizontalOrigin(t){this._billboard.horizontalOrigin=t}get verticalOrigin(){return this._billboard.verticalOrigin}set verticalOrigin(t){this._billboard.verticalOrigin=t}get labelHorizontalOrigin(){return this._label.horizontalOrigin}set labelHorizontalOrigin(t){this._label.horizontalOrigin=t}get labelVerticalOrigin(){return this._label.verticalOrigin}set labelVerticalOrigin(t){this._label.verticalOrigin=t}get content(){return this._content}get tileset(){return this._content.tileset}get primitive(){return this._content.tileset}get pickIds(){let t=this._pickIds;return t[0]=this._billboard.pickId,t[1]=this._label.pickId,t[2]=this._polyline.pickId,t}hasProperty(t){return this._content.batchTable.hasProperty(this._batchId,t)}getPropertyIds(t){return this._content.batchTable.getPropertyIds(this._batchId,t)}getProperty(t){return this._content.batchTable.getProperty(this._batchId,t)}getPropertyInherited(t){return ua.getPropertyInherited(this._content,this._batchId,t)}setProperty(t,n){this._content.batchTable.setProperty(this._batchId,t,n),this._content.featurePropertiesDirty=!0}isExactClass(t){return this._content.batchTable.isExactClass(this._batchId,t)}isClass(t){return this._content.batchTable.isClass(this._batchId,t)}getExactClassName(){return this._content.batchTable.getExactClassName(this._batchId)}};ut(Fh,"defaultColor",z.WHITE),ut(Fh,"defaultPointOutlineColor",z.BLACK),ut(Fh,"defaultPointOutlineWidth",0),ut(Fh,"defaultPointSize",8);function Rv(e){let t=e._billboard;if(l(e._billboardImage)&&e._billboardImage!==t.image){t.image=e._billboardImage;return}if(l(e._billboardImage))return;let n=e._color??Fh.defaultColor,i=e._pointOutlineColor??Fh.defaultPointOutlineColor,r=e._pointOutlineWidth??Fh.defaultPointOutlineWidth,o=e._pointSize??Fh.defaultPointSize,s=e._billboardColor,a=e._billboardOutlineColor,c=e._billboardOutlineWidth,u=e._billboardSize;if(z.equals(n,s)&&z.equals(i,a)&&r===c&&o===u)return;e._billboardColor=z.clone(n,e._billboardColor),e._billboardOutlineColor=z.clone(i,e._billboardOutlineColor),e._billboardOutlineWidth=r,e._billboardSize=o;let f=n.alpha,d=n.toCssColorString(),p=i.toCssColorString(),g=JSON.stringify([d,o,p,r]);t.setImage(g,Dv(f,d,p,r,o))}var Fy=Fh;function Dlt(e,t){let n=e.measureText(t);if(!/\S/.test(t))return{width:n.width,height:0,ascent:0,descent:0,minx:0};let r=Math.round(n.actualBoundingBoxAscent),o=Math.round(n.actualBoundingBoxDescent),s=Math.max(r+o,1);return{width:n.width,height:s,ascent:r,descent:o,minx:-Math.round(n.actualBoundingBoxLeft)}}var Ex;function Rlt(e,t){if(e==="")return;t=t??H.EMPTY_OBJECT;let n=t.font??"10px sans-serif",i=t.stroke??!1,r=t.fill??!0,o=t.strokeWidth??1,s=t.backgroundColor??z.TRANSPARENT,a=t.padding??0,c=a*2,u=document.createElement("canvas");u.width=1,u.height=1,u.style.font=n;let f=u.getContext("2d",{willReadFrequently:!0});l(Ex)||(l(f.imageSmoothingEnabled)?Ex="imageSmoothingEnabled":l(f.mozImageSmoothingEnabled)?Ex="mozImageSmoothingEnabled":l(f.webkitImageSmoothingEnabled)?Ex="webkitImageSmoothingEnabled":l(f.msImageSmoothingEnabled)&&(Ex="msImageSmoothingEnabled")),f.font=n,f.lineJoin="round",f.lineWidth=o,f[Ex]=!1,u.style.visibility="hidden",document.body.appendChild(u);let d=Dlt(f,e);u.dimensions=d,document.body.removeChild(u),u.style.visibility="";let p=!/\S/.test(e),g=i&&!p?Math.ceil(o/2):0,m=g*2,y=-d.minx+g,A=Math.ceil(d.width)+y+c+g,b=d.height+c+m,x=d.ascent+a+g;if(u.width=A,u.height=b,f.font=n,f.lineJoin="round",f.lineWidth=o,f[Ex]=!1,s!==z.TRANSPARENT&&(f.fillStyle=s.toCssColorString(),f.fillRect(0,0,u.width,u.height)),i){let T=t.strokeColor??z.BLACK;f.strokeStyle=T.toCssColorString(),f.strokeText(e,y+a,x)}if(r){let T=t.fillColor??z.WHITE;f.fillStyle=T.toCssColorString(),f.fillText(e,y+a,x)}return u}var Ov=Rlt;var wAe=js(yAe(),1);var AAe={FILL:0,OUTLINE:1,FILL_AND_OUTLINE:2};Object.freeze(AAe);var Io=AAe;var bAe={},xAe=0,Mlt=256,Nlt=new z(.165,.165,.165,.8),Llt=new U(7,5),$s=Object.freeze({LTR:0,RTL:1,WEAK:2,BRACKETS:3});function Cx(e){!e._rebindAllGlyphs&&!e._repositionAllGlyphs&&e._labelCollection._labelsToUpdate.push(e),e._rebindAllGlyphs=!0}function u1(e){!e._rebindAllGlyphs&&!e._repositionAllGlyphs&&e._labelCollection._labelsToUpdate.push(e),e._repositionAllGlyphs=!0}function f1(e,t){return document.defaultView.getComputedStyle(e,null).getPropertyValue(t)}function EAe(e){let t=bAe[e._font];if(!l(t)){let n=document.createElement("div");n.style.position="absolute",n.style.opacity=0,n.style.font=e._font,document.body.appendChild(n);let i=parseFloat(f1(n,"line-height"));isNaN(i)&&(i=void 0),t={family:f1(n,"font-family"),size:f1(n,"font-size").replace("px",""),style:f1(n,"font-style"),weight:f1(n,"font-weight"),lineHeight:i},document.body.removeChild(n),xAe<Mlt&&(bAe[e._font]=t,xAe++)}e._fontFamily=t.family,e._fontSize=t.size,e._fontStyle=t.style,e._fontWeight=t.weight,e._lineHeight=t.lineHeight}function Bh(e,t){e=e??H.EMPTY_OBJECT;let n=e.translucencyByDistance,i=e.pixelOffsetScaleByDistance,r=e.scaleByDistance,o=e.distanceDisplayCondition;l(n)&&(n=qt.clone(n)),l(i)&&(i=qt.clone(i)),l(r)&&(r=qt.clone(r)),l(o)&&(o=Gt.clone(o)),this._renderedText=void 0,this._text=void 0,this._show=e.show??!0,this._font=e.font??"30px sans-serif",this._fillColor=z.clone(e.fillColor??z.WHITE),this._outlineColor=z.clone(e.outlineColor??z.BLACK),this._outlineWidth=e.outlineWidth??1,this._showBackground=e.showBackground??!1,this._backgroundColor=z.clone(e.backgroundColor??Nlt),this._backgroundPadding=U.clone(e.backgroundPadding??Llt),this._style=e.style??Io.FILL,this._verticalOrigin=e.verticalOrigin??qn.BASELINE,this._horizontalOrigin=e.horizontalOrigin??Hi.LEFT,this._pixelOffset=U.clone(e.pixelOffset??U.ZERO),this._eyeOffset=h.clone(e.eyeOffset??h.ZERO),this._position=h.clone(e.position??h.ZERO),this._scale=e.scale??1,this._id=e.id,this._translucencyByDistance=n,this._pixelOffsetScaleByDistance=i,this._scaleByDistance=r,this._heightReference=e.heightReference??We.NONE,this._distanceDisplayCondition=o,this._disableDepthTestDistance=e.disableDepthTestDistance,this._labelCollection=t,this._glyphs=[],this._backgroundBillboard=void 0,this._batchIndex=void 0,this._rebindAllGlyphs=!0,this._repositionAllGlyphs=!0,this._actualClampedPosition=void 0,this._removeCallbackFunc=void 0,this._lastSurfaceHeight=void 0,this._lastSurfaceQueryFrame=-1,this._lastSurfaceQueryMissed=!1,this._clampedToSurface=!1,this._clampingCartesian=void 0,this._clampingHeight=0,this._clampingHeightValid=!1,this._mode=void 0,this._clusterShow=!0,this.text=e.text??"",this._relativeSize=1,EAe(this),this._updateClamping()}Object.defineProperties(Bh.prototype,{show:{get:function(){return this._show},set:function(e){if(this._show!==e){this._show=e;let t=this._glyphs;for(let i=0,r=t.length;i<r;i++){let o=t[i].billboard;l(o)&&(o.show=e)}let n=this._backgroundBillboard;l(n)&&(n.show=e)}}},position:{get:function(){return this._position},set:function(e){let t=this._position;if(!AZ(t,e)){bx(e,t);let n=this._glyphs;for(let r=0,o=n.length;r<o;r++){let s=n[r].billboard;l(s)&&(s.position=e)}let i=this._backgroundBillboard;l(i)&&(i.position=e),this._updateClamping()}}},heightReference:{get:function(){return this._heightReference},set:function(e){if(e!==this._heightReference){this._heightReference=e;let t=this._glyphs;for(let i=0,r=t.length;i<r;i++){let o=t[i].billboard;l(o)&&(o.heightReference=e)}let n=this._backgroundBillboard;l(n)&&(n.heightReference=e),u1(this),this._updateClamping()}}},text:{get:function(){return this._text},set:function(e){if(this._text!==e){this._text=e;let t=Bh.filterUnsupportedCharacters(e);this._renderedText=Bh.enableRightToLeftDetection?Vlt(t):t,Cx(this)}}},font:{get:function(){return this._font},set:function(e){this._font!==e&&(this._font=e,Cx(this),EAe(this))}},fillColor:{get:function(){return this._fillColor},set:function(e){let t=this._fillColor;z.equals(t,e)||(z.clone(e,t),Cx(this))}},outlineColor:{get:function(){return this._outlineColor},set:function(e){let t=this._outlineColor;z.equals(t,e)||(z.clone(e,t),Cx(this))}},outlineWidth:{get:function(){return this._outlineWidth},set:function(e){this._outlineWidth!==e&&(this._outlineWidth=e,Cx(this))}},showBackground:{get:function(){return this._showBackground},set:function(e){this._showBackground!==e&&(this._showBackground=e,Cx(this))}},backgroundColor:{get:function(){return this._backgroundColor},set:function(e){let t=this._backgroundColor;if(!z.equals(t,e)){z.clone(e,t);let n=this._backgroundBillboard;l(n)&&(n.color=t)}}},backgroundPadding:{get:function(){return this._backgroundPadding},set:function(e){let t=this._backgroundPadding;U.equals(t,e)||(U.clone(e,t),u1(this))}},style:{get:function(){return this._style},set:function(e){this._style!==e&&(this._style=e,Cx(this))}},pixelOffset:{get:function(){return this._pixelOffset},set:function(e){let t=this._pixelOffset;if(!U.equals(t,e)){U.clone(e,t);let n=this._glyphs;for(let r=0,o=n.length;r<o;r++){let s=n[r];l(s.billboard)&&(s.billboard.pixelOffset=e)}let i=this._backgroundBillboard;l(i)&&(i.pixelOffset=e)}}},translucencyByDistance:{get:function(){return this._translucencyByDistance},set:function(e){let t=this._translucencyByDistance;if(!qt.equals(t,e)){this._translucencyByDistance=qt.clone(e,t);let n=this._glyphs;for(let r=0,o=n.length;r<o;r++){let s=n[r];l(s.billboard)&&(s.billboard.translucencyByDistance=e)}let i=this._backgroundBillboard;l(i)&&(i.translucencyByDistance=e)}}},pixelOffsetScaleByDistance:{get:function(){return this._pixelOffsetScaleByDistance},set:function(e){let t=this._pixelOffsetScaleByDistance;if(!qt.equals(t,e)){this._pixelOffsetScaleByDistance=qt.clone(e,t);let n=this._glyphs;for(let r=0,o=n.length;r<o;r++){let s=n[r];l(s.billboard)&&(s.billboard.pixelOffsetScaleByDistance=e)}let i=this._backgroundBillboard;l(i)&&(i.pixelOffsetScaleByDistance=e)}}},scaleByDistance:{get:function(){return this._scaleByDistance},set:function(e){let t=this._scaleByDistance;if(!qt.equals(t,e)){this._scaleByDistance=qt.clone(e,t);let n=this._glyphs;for(let r=0,o=n.length;r<o;r++){let s=n[r];l(s.billboard)&&(s.billboard.scaleByDistance=e)}let i=this._backgroundBillboard;l(i)&&(i.scaleByDistance=e)}}},eyeOffset:{get:function(){return this._eyeOffset},set:function(e){let t=this._eyeOffset;if(!h.equals(t,e)){h.clone(e,t);let n=this._glyphs;for(let r=0,o=n.length;r<o;r++){let s=n[r];l(s.billboard)&&(s.billboard.eyeOffset=e)}let i=this._backgroundBillboard;l(i)&&(i.eyeOffset=e)}}},horizontalOrigin:{get:function(){return this._horizontalOrigin},set:function(e){this._horizontalOrigin!==e&&(this._horizontalOrigin=e,u1(this))}},verticalOrigin:{get:function(){return this._verticalOrigin},set:function(e){if(this._verticalOrigin!==e){this._verticalOrigin=e;let t=this._glyphs;for(let i=0,r=t.length;i<r;i++){let o=t[i];l(o.billboard)&&(o.billboard.verticalOrigin=e)}let n=this._backgroundBillboard;l(n)&&(n.verticalOrigin=e),u1(this)}}},scale:{get:function(){return this._scale},set:function(e){if(this._scale!==e){this._scale=e;let t=this._glyphs;for(let i=0,r=t.length;i<r;i++){let o=t[i];l(o.billboard)&&(o.billboard.scale=e*this._relativeSize)}let n=this._backgroundBillboard;l(n)&&(n.scale=e*this._relativeSize),u1(this)}}},totalScale:{get:function(){return this._scale*this._relativeSize}},distanceDisplayCondition:{get:function(){return this._distanceDisplayCondition},set:function(e){if(!Gt.equals(e,this._distanceDisplayCondition)){this._distanceDisplayCondition=Gt.clone(e,this._distanceDisplayCondition);let t=this._glyphs;for(let i=0,r=t.length;i<r;i++){let o=t[i];l(o.billboard)&&(o.billboard.distanceDisplayCondition=e)}let n=this._backgroundBillboard;l(n)&&(n.distanceDisplayCondition=e)}}},disableDepthTestDistance:{get:function(){return this._disableDepthTestDistance},set:function(e){if(this._disableDepthTestDistance!==e){this._disableDepthTestDistance=e;let t=this._glyphs;for(let i=0,r=t.length;i<r;i++){let o=t[i];l(o.billboard)&&(o.billboard.disableDepthTestDistance=e)}let n=this._backgroundBillboard;l(n)&&(n.disableDepthTestDistance=e)}}},id:{get:function(){return this._id},set:function(e){if(this._id!==e){this._id=e;let t=this._glyphs;for(let i=0,r=t.length;i<r;i++){let o=t[i];l(o.billboard)&&(o.billboard.id=e)}let n=this._backgroundBillboard;l(n)&&(n.id=e)}}},pickId:{get:function(){if(!(this._glyphs.length===0||!l(this._glyphs[0].billboard)))return this._glyphs[0].billboard.pickId}},_clampedPosition:{get:function(){return this._actualClampedPosition},set:function(e){this._actualClampedPosition=bx(e,this._actualClampedPosition);let t=this._glyphs;for(let i=0,r=t.length;i<r;i++){let o=t[i];l(o.billboard)&&(o.billboard._clampedPosition=e)}let n=this._backgroundBillboard;l(n)&&(n._clampedPosition=e)}},clusterShow:{get:function(){return this._clusterShow},set:function(e){if(this._clusterShow!==e){this._clusterShow=e;let t=this._glyphs;for(let i=0,r=t.length;i<r;i++){let o=t[i];l(o.billboard)&&(o.billboard.clusterShow=e)}let n=this._backgroundBillboard;l(n)&&(n.clusterShow=e)}}},ready:{get:function(){if(this._rebindAllGlyphs||this._repositionAllGlyphs||l(this._backgroundBillboard)&&!this._backgroundBillboard.ready)return!1;let e=this._glyphs;for(let t=0,n=e.length;t<n;t++){let i=e[t];if(l(i.billboard)&&!i.billboard.ready)return!1}return!0}}});Bh.prototype._updateClamping=function(){Fr._updateClamping(this._labelCollection,this)};Bh.prototype.computeScreenSpacePosition=function(e,t){l(t)||(t=new U);let i=this._labelCollection.modelMatrix,r=l(this._actualClampedPosition)?this._actualClampedPosition:this._position;return Fr._computeScreenSpacePosition(i,r,this._eyeOffset,this._pixelOffset,e,t)};Bh.getScreenSpaceBoundingBox=function(e,t,n){let i,r,o,s,a=e.totalScale,c=e._backgroundBillboard;if(l(c))i=t.x+c._translate.x,r=t.y-c._translate.y,o=c.width*a,s=c.height*a,e.verticalOrigin===qn.BOTTOM||e.verticalOrigin===qn.BASELINE?r-=s:e.verticalOrigin===qn.CENTER&&(r-=s*.5);else{i=Number.POSITIVE_INFINITY,r=Number.POSITIVE_INFINITY;let u=0,f=0,d=e._glyphs,p=d.length;for(let g=0;g<p;++g){let m=d[g],y=m.billboard;if(!l(y))continue;let A=t.x+y._translate.x,b=t.y-y._translate.y,x=m.dimensions.width*a,T=m.dimensions.height*a;e.verticalOrigin===qn.BOTTOM||e.verticalOrigin===qn.BASELINE?b-=T:e.verticalOrigin===qn.CENTER&&(b-=T*.5),e._verticalOrigin===qn.TOP?b+=ec.PADDING*a:(e._verticalOrigin===qn.BOTTOM||e._verticalOrigin===qn.BASELINE)&&(b-=ec.PADDING*a),i=Math.min(i,A),r=Math.min(r,b),u=Math.max(u,A+x),f=Math.max(f,b+T)}o=u-i,s=f-r}return l(n)||(n=new et),n.x=i,n.y=r,n.width=o,n.height=s,n};Bh.filterUnsupportedCharacters=function(e){let t=new RegExp(/[\u0000-\u0008\u000E-\u001F\u00ad\u202a-\u206f\u200b-\u200f]/,"g");return e.replace(t,"")};Bh.prototype.equals=function(e){return this===e||l(e)&&this._show===e._show&&this._scale===e._scale&&this._outlineWidth===e._outlineWidth&&this._showBackground===e._showBackground&&this._style===e._style&&this._verticalOrigin===e._verticalOrigin&&this._horizontalOrigin===e._horizontalOrigin&&this._heightReference===e._heightReference&&this._renderedText===e._renderedText&&this._font===e._font&&h.equals(this._position,e._position)&&z.equals(this._fillColor,e._fillColor)&&z.equals(this._outlineColor,e._outlineColor)&&z.equals(this._backgroundColor,e._backgroundColor)&&U.equals(this._backgroundPadding,e._backgroundPadding)&&U.equals(this._pixelOffset,e._pixelOffset)&&h.equals(this._eyeOffset,e._eyeOffset)&&qt.equals(this._translucencyByDistance,e._translucencyByDistance)&&qt.equals(this._pixelOffsetScaleByDistance,e._pixelOffsetScaleByDistance)&&qt.equals(this._scaleByDistance,e._scaleByDistance)&&Gt.equals(this._distanceDisplayCondition,e._distanceDisplayCondition)&&this._disableDepthTestDistance===e._disableDepthTestDistance&&this._id===e._id};Bh.prototype.isDestroyed=function(){return!1};Bh.enableRightToLeftDetection=!1;function Flt(e,t){let n=/[a-zA-Z0-9]/,i=/[()[\]{}<>]/,r=[],o="",s=$s.LTR,a="",c=e.length;for(let u=0;u<c;++u){let f=e.charAt(u);t.test(f)?a=$s.RTL:n.test(f)?a=$s.LTR:i.test(f)?a=$s.BRACKETS:a=$s.WEAK,u===0&&(s=a),s===a&&a!==$s.BRACKETS?o+=f:(o!==""&&r.push({Type:s,Word:o}),s=a,o=f)}return r.push({Type:a,Word:o}),r}function Blt(e){return e.split("").reverse().join("")}function d1(e,t,n){return e.slice(0,t)+n+e.slice(t)}function klt(e){switch(e){case"(":return")";case")":return"(";case"[":return"]";case"]":return"[";case"{":return"}";case"}":return"{";case"<":return">";case">":return"<"}}var Ult="\u05D0-\u05EA",zlt="\u0600-\u06FF\u0750-\u077F\u08A0-\u08FF",TAe=new RegExp(`[${Ult}${zlt}]`);function Vlt(e){let t=e.split(` -`),n="";for(let i=0;i<t.length;i++){let r=t[i],o=TAe.test(r.charAt(0)),s=Flt(r,TAe),a=0,c="";for(let u=0;u<s.length;++u){let f=s[u],d=f.Type===$s.BRACKETS?klt(f.Word):Blt(f.Word);o?f.Type===$s.RTL?(c=d+c,a=0):f.Type===$s.LTR?(c=d1(c,a,f.Word),a+=f.Word.length):(f.Type===$s.WEAK||f.Type===$s.BRACKETS)&&(f.Type===$s.WEAK&&s[u-1].Type===$s.BRACKETS?c=d+c:s[u-1].Type===$s.RTL?(c=d+c,a=0):s.length>u+1?s[u+1].Type===$s.RTL?(c=d+c,a=0):(c=d1(c,a,f.Word),a+=f.Word.length):c=d1(c,0,d)):f.Type===$s.RTL?c=d1(c,a,d):f.Type===$s.LTR?(c+=f.Word,a=c.length):(f.Type===$s.WEAK||f.Type===$s.BRACKETS)&&(u>0&&s[u-1].Type===$s.RTL?s.length>u+1?s[u+1].Type===$s.RTL?c=d1(c,a,d):(c+=f.Word,a=c.length):c+=f.Word:(c+=f.Word,a=c.length))}n+=c,i<t.length-1&&(n+=` -`)}return n}var vx=Bh;var IAe=js(CAe(),1);function Hlt(){this.dimensions=void 0,this.billboardTexture=void 0,this.billboard=void 0}var Glt=1.2,vAe="ID_WHITE_PIXEL",IZ=new U(4,4),Wlt=new et(1,1,1,1);function qlt(e,t){let n=t._backgroundBillboardTexture;if(!n.hasImage){let r=document.createElement("canvas");r.width=IZ.x,r.height=IZ.y;let o=r.getContext("2d");o.fillStyle="#fff",o.fillRect(0,0,r.width,r.height),n.loadImage(vAe,r),n.addImageSubRegion(vAe,Wlt)}let i=e.add({collection:t});return i.setImageTexture(n),i._positionFromParent=!0,i._labelTranslate=new U,i}var dg={};function Ylt(e,t,n,i,r,o){return dg.font=t,dg.fillColor=n,dg.strokeColor=i,dg.strokeWidth=r,dg.padding=ec.PADDING,dg.fill=o===Io.FILL||o===Io.FILL_AND_OUTLINE,dg.stroke=o===Io.OUTLINE||o===Io.FILL_AND_OUTLINE,dg.backgroundColor=z.BLACK,Ov(e,dg)}function PZ(e,t){let n=t.billboard;l(n)&&(n.show=!1,n._clampedPosition=void 0,l(n._removeCallbackFunc)&&(n._removeCallbackFunc(),n._removeCallbackFunc=void 0),e._spareBillboards.push(n),t.billboard=void 0)}var Xlt=new IAe.default,Klt=/\s/;function $lt(e,t){let n=t._renderedText,i=Xlt.splitGraphemes(n),r=i.length,o=t._glyphs,s=o.length;if(t._relativeSize=t._fontSize/ec.FONT_SIZE,r<s)for(let p=r;p<s;++p)PZ(e,o[p]);o.length=r;let a=t._backgroundBillboard,c=e._backgroundBillboardCollection;t._showBackground&&!l(a)&&(a=qlt(c,e),t._backgroundBillboard=a),Jlt(c,t,a);let u=e._glyphBillboardCollection,f=u.billboardTextureCache,d=e._textDimensionsCache;for(let p=0;p<r;++p){let g=i[p],m=t._verticalOrigin,y=JSON.stringify([g,t._fontFamily,t._fontStyle,t._fontWeight,+m]),A=d[y],b=f.get(y);if(!l(b)||!l(A)){b=new Ny(u),f.set(y,b);let v=`${t._fontStyle} ${t._fontWeight} ${ec.FONT_SIZE}px ${t._fontFamily}`,S=Ylt(g,v,z.WHITE,z.WHITE,0,Io.FILL);if(A=S.dimensions,d[y]=A,S.width>0&&S.height>0&&!Klt.test(g)){let I=(0,wAe.default)(S,{cutoff:ec.CUTOFF,radius:ec.RADIUS}),R=S.getContext("2d"),O=S.width,L=S.height,_=R.getImageData(0,0,O,L);for(let C=0;C<O;C++)for(let w=0;w<L;w++){let D=w*O+C,N=I[D]*255,F=D*4;_.data[F+0]=N,_.data[F+1]=N,_.data[F+2]=N,_.data[F+3]=N}R.putImageData(_,0,0),b.loadImage(y,S)}}let x=o[p];if(l(x)||(x=new Hlt,x.dimensions=A,x.billboardTexture=b,o[p]=x),x.billboardTexture.id!==y&&(x.billboardTexture=b,x.dimensions=A),!b.hasImage){PZ(e,x);continue}let T=x.billboard,E=e._spareBillboards;l(T)||(E.length>0?T=E.pop():(T=u.add({collection:e}),T._labelDimensions=new U,T._labelTranslate=new U,T._positionFromParent=!0),x.billboard=T),T.setImageTexture(b),T.show=t._show,T.position=t._position,T.eyeOffset=t._eyeOffset,T.pixelOffset=t._pixelOffset,T.horizontalOrigin=Hi.LEFT,T.verticalOrigin=t._verticalOrigin,T.heightReference=t._heightReference,l(t._clampedPosition)&&(T._clampedPosition=t._clampedPosition),T.scale=t.totalScale,T.pickPrimitive=t,T.id=t._id,T.translucencyByDistance=t._translucencyByDistance,T.pixelOffsetScaleByDistance=t._pixelOffsetScaleByDistance,T.scaleByDistance=t._scaleByDistance,T.distanceDisplayCondition=t._distanceDisplayCondition,T.disableDepthTestDistance=t._disableDepthTestDistance,T._batchIndex=t._batchIndex,T.outlineColor=t.outlineColor,t.style===Io.FILL_AND_OUTLINE?(T.color=t._fillColor,T.outlineWidth=t.outlineWidth):t.style===Io.FILL?(T.color=t._fillColor,T.outlineWidth=0):t.style===Io.OUTLINE&&(T.color=z.TRANSPARENT,T.outlineWidth=t.outlineWidth)}t._repositionAllGlyphs=!0}function Jlt(e,t,n){if(!l(n))return;let i=t.show&&t._showBackground&&t._renderedText.split(` -`).join("").length>0;if(t.show&&!i){e.remove(n),t._backgroundBillboard=void 0;return}n.color=t._backgroundColor,n.show=t._show,n.position=t._position,n.eyeOffset=t._eyeOffset,n.pixelOffset=t._pixelOffset,n.horizontalOrigin=Hi.LEFT,n.verticalOrigin=t._verticalOrigin,n.heightReference=t._heightReference,l(t._clampedPosition)&&(n._clampedPosition=t._clampedPosition),n.scale=t.totalScale,n.pickPrimitive=t,n.id=t._id,n.translucencyByDistance=t._translucencyByDistance,n.pixelOffsetScaleByDistance=t._pixelOffsetScaleByDistance,n.scaleByDistance=t._scaleByDistance,n.distanceDisplayCondition=t._distanceDisplayCondition,n.disableDepthTestDistance=t._disableDepthTestDistance,n.clusterShow=t.clusterShow}function SAe(e,t,n){return t===Hi.CENTER?-e/2:t===Hi.RIGHT?-(e+n.x):n.x}var Uo=new U,Zlt=new U;function Qlt(e){let t=e._glyphs,n=e._renderedText,i=0,r=0,o=[],s=Number.NEGATIVE_INFINITY,a=0,c=1,u=t.length,f=e._backgroundBillboard,d=U.clone(l(f)?e._backgroundPadding:U.ZERO,Zlt);d.x/=e._relativeSize,d.y/=e._relativeSize;for(let O=0;O<u;++O){if(n.charAt(O)===` -`){o.push(i),++c,i=0;continue}let _=t[O].dimensions;l(_)&&(a=Math.max(a,_.height-_.descent),s=Math.max(s,_.descent),i+=_.width-_.minx,O<u-1&&(i+=t[O+1].dimensions.minx),r=Math.max(r,i))}o.push(i);let p=a+s,g=e.totalScale,m=e._horizontalOrigin,y=e._verticalOrigin,A=0,b=o[A],x=SAe(b,m,d),T=(l(e._lineHeight)?e._lineHeight:Glt*e._fontSize)/e._relativeSize,E=T*(c-1),v=r,S=p+E;l(f)&&(v+=d.x*2,S+=d.y*2,f._labelHorizontalOrigin=m),Uo.x=x*g,Uo.y=0;let I=!0,R=0;for(let O=0;O<u;++O){if(n.charAt(O)===` -`){++A,R+=T,b=o[A],x=SAe(b,m,d),Uo.x=x*g,I=!0;continue}let L=t[O],_=L.dimensions;if(l(_)&&(y===qn.TOP?(Uo.y=_.height-a-d.y,Uo.y+=ec.PADDING):y===qn.CENTER?Uo.y=(E+_.height-a)/2:y===qn.BASELINE?(Uo.y=E,Uo.y-=ec.PADDING):(Uo.y=E+s+d.y,Uo.y-=ec.PADDING),Uo.y=(Uo.y-_.descent-R)*g,I&&(Uo.x-=ec.PADDING*g,I=!1),l(L.billboard)&&(L.billboard._setTranslate(Uo),L.billboard._labelDimensions.x=v,L.billboard._labelDimensions.y=S,L.billboard._labelHorizontalOrigin=m,us(e.heightReference)&&(L.billboard._labelTranslate=U.clone(Uo,L.billboard._labelTranslate))),O<u-1)){let C=t[O+1];Uo.x+=(_.width-_.minx+C.dimensions.minx)*g}}l(f)&&n.split(` -`).join("").length>0&&(m===Hi.CENTER?x=-r/2-d.x:m===Hi.RIGHT?x=-(r+d.x*2):x=0,Uo.x=x*g,y===qn.TOP?Uo.y=p-a-s:y===qn.CENTER?Uo.y=(p-a)/2-s:y===qn.BASELINE?Uo.y=-d.y-s:Uo.y=0,Uo.y=Uo.y*g,f.width=v,f.height=S,f._setTranslate(Uo),f._labelTranslate=U.clone(Uo,f._labelTranslate))}function PAe(e,t){let n=t._glyphs;for(let i=0,r=n.length;i<r;++i)PZ(e,n[i]);l(t._backgroundBillboard)&&(e._backgroundBillboardCollection.remove(t._backgroundBillboard),t._backgroundBillboard=void 0),t._labelCollection=void 0,l(t._removeCallbackFunc)&&t._removeCallbackFunc(),le(t)}function Cp(e){e=e??H.EMPTY_OBJECT,this._scene=e.scene,this._batchTable=e.batchTable;let t=new wd({scene:this._scene,textureAtlas:new XE({initialSize:IZ}),coarseDepthTestDistance:e.coarseDepthTestDistance,threePointDepthTestDistance:e.threePointDepthTestDistance});this._backgroundBillboardCollection=t,this._backgroundBillboardTexture=new Ny(t),this._glyphBillboardCollection=new wd({scene:this._scene,batchTable:this._batchTable,coarseDepthTestDistance:e.coarseDepthTestDistance,threePointDepthTestDistance:e.threePointDepthTestDistance}),this._glyphBillboardCollection._sdf=!0,this._spareBillboards=[],this._textDimensionsCache={},this._labels=[],this._labelsToUpdate=[],this._totalGlyphCount=0,this._highlightColor=z.clone(z.WHITE),this.show=e.show??!0,this.modelMatrix=M.clone(e.modelMatrix??M.IDENTITY),this.debugShowBoundingVolume=e.debugShowBoundingVolume??!1,this.blendOption=e.blendOption??ki.OPAQUE_AND_TRANSLUCENT}Object.defineProperties(Cp.prototype,{length:{get:function(){return this._labels.length}},sizeInBytes:{get:function(){return this._glyphBillboardCollection.sizeInBytes+this._backgroundBillboardCollection.sizeInBytes}},ready:{get:function(){let e=this._backgroundBillboardCollection.get(0);return l(e)&&!e.ready?!1:this._glyphBillboardCollection.ready}},coarseDepthTestDistance:{get:function(){return this._backgroundBillboardCollection.coarseDepthTestDistance},set:function(e){this._backgroundBillboardCollection.coarseDepthTestDistance=e,this._glyphBillboardCollection.coarseDepthTestDistance=e}},threePointDepthTestDistance:{get:function(){return this._backgroundBillboardCollection.threePointDepthTestDistance},set:function(e){this._backgroundBillboardCollection.threePointDepthTestDistance=e,this._glyphBillboardCollection.threePointDepthTestDistance=e}}});Cp.prototype.add=function(e){let t=new vx(e,this);return this._labels.push(t),this._labelsToUpdate.push(t),t};Cp.prototype.remove=function(e){if(l(e)&&e._labelCollection===this){let t=this._labels.indexOf(e);if(t!==-1)return this._labels.splice(t,1),PAe(this,e),!0}return!1};Cp.prototype.removeAll=function(){let e=this._labels;for(let t=0,n=e.length;t<n;++t)PAe(this,e[t]);e.length=0};Cp.prototype.contains=function(e){return l(e)&&e._labelCollection===this};Cp.prototype.get=function(e){return this._labels[e]};Cp.prototype.update=function(e){if(!this.show)return;let t=this._glyphBillboardCollection,n=this._backgroundBillboardCollection;t.modelMatrix=this.modelMatrix,t.debugShowBoundingVolume=this.debugShowBoundingVolume,n.modelMatrix=this.modelMatrix,n.debugShowBoundingVolume=this.debugShowBoundingVolume;let i=this._labelsToUpdate.length;for(let o=0;o<i;++o){let s=this._labelsToUpdate[o];if(s.isDestroyed())continue;let a=s._glyphs.length;s._rebindAllGlyphs&&($lt(this,s),s._rebindAllGlyphs=!1),s._repositionAllGlyphs&&(Qlt(s),s._repositionAllGlyphs=!1);let c=s._glyphs.length-a;this._totalGlyphCount+=c}let r=n.length>0?ki.TRANSLUCENT:this.blendOption;t.blendOption=r,n.blendOption=r,t._highlightColor=this._highlightColor,n._highlightColor=this._highlightColor,this._labelsToUpdate.length=0,n.update(e),t.update(e)};Cp.prototype.isDestroyed=function(){return!1};Cp.prototype.destroy=function(){return this.removeAll(),this._glyphBillboardCollection=this._glyphBillboardCollection.destroy(),this._backgroundBillboardCollection=this._backgroundBillboardCollection.destroy(),le(this)};var hg=Cp;var kl={};kl.numberOfPoints=function(e,t,n){let i=h.distance(e,t);return Math.ceil(i/n)};kl.numberOfPointsRhumbLine=function(e,t,n){let i=Math.pow(e.longitude-t.longitude,2)+Math.pow(e.latitude-t.latitude,2);return Math.max(1,Math.ceil(Math.sqrt(i/(n*n))))};var eut=new he;kl.extractHeights=function(e,t){let n=e.length,i=new Array(n);for(let r=0;r<n;r++){let o=e[r];i[r]=t.cartesianToCartographic(o,eut).height}return i};var tut=new M,nut=new h,DAe=new h,iut=new sn(h.UNIT_X,0),RAe=new h,rut=new sn(h.UNIT_X,0),out=new h,sut=new h,RZ=[];function MAe(e,t,n){let i=RZ;i.length=e;let r;if(t===n){for(r=0;r<e;r++)i[r]=t;return i}let s=(n-t)/e;for(r=0;r<e;r++){let a=t+r*s;i[r]=a}return i}var c4=new he,a4=new he,By=new h,OZ=new h,aut=new h,DZ=new q_,h1=new jc;function cut(e,t,n,i,r,o,s,a){let c=i.scaleToGeodeticSurface(e,OZ),u=i.scaleToGeodeticSurface(t,aut),f=kl.numberOfPoints(e,t,n),d=i.cartesianToCartographic(c,c4),p=i.cartesianToCartographic(u,a4),g=MAe(f,r,o);DZ.setEndPoints(d,p);let m=DZ.surfaceDistance/f,y=a;d.height=r;let A=i.cartographicToCartesian(d,By);h.pack(A,s,y),y+=3;for(let b=1;b<f;b++){let x=DZ.interpolateUsingSurfaceDistance(b*m,a4);x.height=g[b],A=i.cartographicToCartesian(x,By),h.pack(A,s,y),y+=3}return y}function lut(e,t,n,i,r,o,s,a){let c=i.cartesianToCartographic(e,c4),u=i.cartesianToCartographic(t,a4),f=kl.numberOfPointsRhumbLine(c,u,n);c.height=0,u.height=0;let d=MAe(f,r,o);h1.ellipsoid.equals(i)||(h1=new jc(void 0,void 0,i)),h1.setEndPoints(c,u);let p=h1.surfaceDistance/f,g=a;c.height=r;let m=i.cartographicToCartesian(c,By);h.pack(m,s,g),g+=3;for(let y=1;y<f;y++){let A=h1.interpolateUsingSurfaceDistance(y*p,a4);A.height=d[y],m=i.cartographicToCartesian(A,By),h.pack(m,s,g),g+=3}return g}kl.wrapLongitude=function(e,t){let n=[],i=[];if(l(e)&&e.length>0){t=t??M.IDENTITY;let r=M.inverseTransformation(t,tut),o=M.multiplyByPoint(r,h.ZERO,nut),s=h.normalize(M.multiplyByPointAsVector(r,h.UNIT_Y,DAe),DAe),a=sn.fromPointNormal(o,s,iut),c=h.normalize(M.multiplyByPointAsVector(r,h.UNIT_X,RAe),RAe),u=sn.fromPointNormal(o,c,rut),f=1;n.push(h.clone(e[0]));let d=n[0],p=e.length;for(let g=1;g<p;++g){let m=e[g];if(sn.getPointDistance(u,d)<0||sn.getPointDistance(u,m)<0){let y=xi.lineSegmentPlane(d,m,a,out);if(l(y)){let A=h.multiplyByScalar(s,5e-9,sut);sn.getPointDistance(a,d)<0&&h.negate(A,A),n.push(h.add(y,A,new h)),i.push(f+1),h.negate(A,A),n.push(h.add(y,A,new h)),f=1}}n.push(h.clone(e[g])),f++,d=m}i.push(f)}return{positions:n,lengths:i}};kl.generateArc=function(e){l(e)||(e={});let t=e.positions,n=t.length,i=e.ellipsoid??ee.default,r=e.height??0,o=Array.isArray(r);if(n<1)return[];if(n===1){let y=i.scaleToGeodeticSurface(t[0],OZ);if(r=o?r[0]:r,r!==0){let A=i.geodeticSurfaceNormal(y,By);h.multiplyByScalar(A,r,A),h.add(y,A,y)}return[y.x,y.y,y.z]}let s=e.minDistance;if(!l(s)){let y=e.granularity??P.RADIANS_PER_DEGREE;s=P.chordLength(y,i.maximumRadius)}let a=0,c;for(c=0;c<n-1;c++)a+=kl.numberOfPoints(t[c],t[c+1],s);let u=(a+1)*3,f=new Array(u),d=0;for(c=0;c<n-1;c++){let y=t[c],A=t[c+1],b=o?r[c]:r,x=o?r[c+1]:r;d=cut(y,A,s,i,b,x,f,d)}RZ.length=0;let p=t[n-1],g=i.cartesianToCartographic(p,c4);g.height=o?r[n-1]:r;let m=i.cartographicToCartesian(g,By);return h.pack(m,f,u-3),f};var OAe=new he,uut=new he;kl.generateRhumbArc=function(e){l(e)||(e={});let t=e.positions,n=t.length,i=e.ellipsoid??ee.default,r=e.height??0,o=Array.isArray(r);if(n<1)return[];if(n===1){let b=i.scaleToGeodeticSurface(t[0],OZ);if(r=o?r[0]:r,r!==0){let x=i.geodeticSurfaceNormal(b,By);h.multiplyByScalar(x,r,x),h.add(b,x,b)}return[b.x,b.y,b.z]}let s=e.granularity??P.RADIANS_PER_DEGREE,a=0,c,u=i.cartesianToCartographic(t[0],OAe),f;for(c=0;c<n-1;c++)f=i.cartesianToCartographic(t[c+1],uut),a+=kl.numberOfPointsRhumbLine(u,f,s),u=he.clone(f,OAe);let d=(a+1)*3,p=new Array(d),g=0;for(c=0;c<n-1;c++){let b=t[c],x=t[c+1],T=o?r[c]:r,E=o?r[c+1]:r;g=lut(b,x,s,i,T,E,p,g)}RZ.length=0;let m=t[n-1],y=i.cartesianToCartographic(m,c4);y.height=o?r[n-1]:r;let A=i.cartographicToCartesian(y,By);return h.pack(A,p,d-3),p};kl.generateCartesianArc=function(e){let t=kl.generateArc(e),n=t.length/3,i=new Array(n);for(let r=0;r<n;r++)i[r]=h.unpack(t,r*3);return i};kl.generateCartesianRhumbArc=function(e){let t=kl.generateRhumbArc(e),n=t.length/3,i=new Array(n);for(let r=0;r<n;r++)i[r]=h.unpack(t,r*3);return i};var lr=kl;function Af(e,t){e=e??H.EMPTY_OBJECT,this._show=e.show??!0,this._width=e.width??1,this._loop=e.loop??!1,this._distanceDisplayCondition=e.distanceDisplayCondition,this._material=e.material,l(this._material)||(this._material=ir.fromType(ir.ColorType,{color:new z(1,1,1,1)}));let n=e.positions;l(n)||(n=[]),this._positions=n,this._actualPositions=Lr(n,h.equalsEpsilon),this._loop&&this._actualPositions.length>2&&(this._actualPositions===this._positions&&(this._actualPositions=n.slice()),this._actualPositions.push(h.clone(this._actualPositions[0]))),this._length=this._actualPositions.length,this._id=e.id;let i;l(t)&&(i=M.clone(t.modelMatrix)),this._modelMatrix=i,this._segments=lr.wrapLongitude(this._actualPositions,i),this._actualLength=void 0,this._propertiesChanged=new Uint32Array(LAe),this._polylineCollection=t,this._dirty=!1,this._pickId=void 0,this._boundingVolume=ue.fromPoints(this._actualPositions),this._boundingVolumeWC=ue.transform(this._boundingVolume,this._modelMatrix),this._boundingVolume2D=new ue}var NAe=Af.POSITION_INDEX=0,fut=Af.SHOW_INDEX=1,dut=Af.WIDTH_INDEX=2,hut=Af.MATERIAL_INDEX=3,m1=Af.POSITION_SIZE_INDEX=4,mut=Af.DISTANCE_DISPLAY_CONDITION=5,LAe=Af.NUMBER_OF_PROPERTIES=6;function mg(e,t){++e._propertiesChanged[t];let n=e._polylineCollection;l(n)&&(n._updatePolyline(e,t),e._dirty=!0)}Object.defineProperties(Af.prototype,{show:{get:function(){return this._show},set:function(e){e!==this._show&&(this._show=e,mg(this,fut))}},positions:{get:function(){return this._positions},set:function(e){let t=Lr(e,h.equalsEpsilon);this._loop&&t.length>2&&(t===e&&(t=e.slice()),t.push(h.clone(t[0]))),(this._actualPositions.length!==t.length||this._actualPositions.length!==this._length)&&mg(this,m1),this._positions=e,this._actualPositions=t,this._length=t.length,this._boundingVolume=ue.fromPoints(this._actualPositions,this._boundingVolume),this._boundingVolumeWC=ue.transform(this._boundingVolume,this._modelMatrix,this._boundingVolumeWC),mg(this,NAe),this.update()}},material:{get:function(){return this._material},set:function(e){this._material!==e&&(this._material=e,mg(this,hut))}},width:{get:function(){return this._width},set:function(e){let t=this._width;e!==t&&(this._width=e,mg(this,dut))}},loop:{get:function(){return this._loop},set:function(e){if(e!==this._loop){let t=this._actualPositions;e?t.length>2&&!h.equals(t[0],t[t.length-1])&&(t.length===this._positions.length&&(this._actualPositions=t=this._positions.slice()),t.push(h.clone(t[0]))):t.length>2&&h.equals(t[0],t[t.length-1])&&(t.length-1===this._positions.length?this._actualPositions=this._positions:t.pop()),this._loop=e,mg(this,m1)}}},id:{get:function(){return this._id},set:function(e){this._id=e,l(this._pickId)&&(this._pickId.object.id=e)}},pickId:{get:function(){return this._pickId}},isDestroyed:{get:function(){return!l(this._polylineCollection)}},distanceDisplayCondition:{get:function(){return this._distanceDisplayCondition},set:function(e){Gt.equals(e,this._distanceDisplayCondition)||(this._distanceDisplayCondition=Gt.clone(e,this._distanceDisplayCondition),mg(this,mut))}}});Af.prototype.update=function(){let e=M.IDENTITY;l(this._polylineCollection)&&(e=this._polylineCollection.modelMatrix);let t=this._segments.positions.length,n=this._segments.lengths,i=this._propertiesChanged[NAe]>0||this._propertiesChanged[m1]>0;if((!M.equals(e,this._modelMatrix)||i)&&(this._segments=lr.wrapLongitude(this._actualPositions,e),this._boundingVolumeWC=ue.transform(this._boundingVolume,e,this._boundingVolumeWC)),this._modelMatrix=M.clone(e,this._modelMatrix),this._segments.positions.length!==t)mg(this,m1);else{let r=n.length;for(let o=0;o<r;++o)if(n[o]!==this._segments.lengths[o]){mg(this,m1);break}}};Af.prototype.getPickId=function(e){return l(this._pickId)||(this._pickId=e.createPickId({primitive:this,collection:this._polylineCollection,id:this._id})),this._pickId};Af.prototype._clean=function(){this._dirty=!1;let e=this._propertiesChanged;for(let t=0;t<LAe-1;++t)e[t]=0};Af.prototype._destroy=function(){this._pickId=this._pickId&&this._pickId.destroy(),this._material=this._material&&this._material.destroy(),this._polylineCollection=void 0};var kh=Af;var put=kh.SHOW_INDEX,gut=kh.WIDTH_INDEX,NZ=kh.POSITION_INDEX,_ut=kh.MATERIAL_INDEX,FAe=kh.POSITION_SIZE_INDEX,yut=kh.DISTANCE_DISPLAY_CONDITION,HAe=kh.NUMBER_OF_PROPERTIES,Ou={texCoordExpandAndBatchIndex:0,position3DHigh:1,position3DLow:2,position2DHigh:3,position2DLow:4,prevPosition3DHigh:5,prevPosition3DLow:6,prevPosition2DHigh:7,prevPosition2DLow:8,nextPosition3DHigh:9,nextPosition3DLow:10,nextPosition2DHigh:11,nextPosition2DLow:12};function Uh(e){e=e??H.EMPTY_OBJECT,this.show=e.show??!0,this.modelMatrix=M.clone(e.modelMatrix??M.IDENTITY),this._modelMatrix=M.clone(M.IDENTITY),this.debugShowBoundingVolume=e.debugShowBoundingVolume??!1,this._opaqueRS=void 0,this._translucentRS=void 0,this._colorCommands=[],this._polylinesUpdated=!1,this._polylinesRemoved=!1,this._createVertexArray=!1,this._propertiesChanged=new Uint32Array(HAe),this._polylines=[],this._polylineBuckets={},this._positionBufferUsage={bufferUsage:Me.STATIC_DRAW,frameCount:0},this._mode=void 0,this._polylinesToUpdate=[],this._vertexArrays=[],this._positionBuffer=void 0,this._texCoordExpandAndBatchIndexBuffer=void 0,this._batchTable=void 0,this._createBatchTable=!1,this._useHighlightColor=!1,this._highlightColor=z.clone(z.WHITE);let t=this;this._uniformMap={u_highlightColor:function(){return t._highlightColor}}}Object.defineProperties(Uh.prototype,{length:{get:function(){return LZ(this),this._polylines.length}}});Uh.prototype.add=function(e){let t=new kh(e,this);return t._index=this._polylines.length,this._polylines.push(t),this._createVertexArray=!0,this._createBatchTable=!0,t};Uh.prototype.remove=function(e){if(this.contains(e)){if(this._polylinesRemoved=!0,this._createVertexArray=!0,this._createBatchTable=!0,l(e._bucket)){let t=e._bucket;t.shaderProgram=t.shaderProgram&&t.shaderProgram.destroy()}return e._destroy(),!0}return!1};Uh.prototype.removeAll=function(){FZ(this),XAe(this),this._polylineBuckets={},this._polylinesRemoved=!1,this._polylines.length=0,this._polylinesToUpdate.length=0,this._createVertexArray=!0};Uh.prototype.contains=function(e){return l(e)&&e._polylineCollection===this};Uh.prototype.get=function(e){return LZ(this),this._polylines[e]};function Aut(e,t){l(e._batchTable)&&e._batchTable.destroy();let n=[{functionName:"batchTable_getWidthAndShow",componentDatatype:Y.UNSIGNED_BYTE,componentsPerAttribute:2},{functionName:"batchTable_getPickColor",componentDatatype:Y.UNSIGNED_BYTE,componentsPerAttribute:4,normalize:!0},{functionName:"batchTable_getCenterHigh",componentDatatype:Y.FLOAT,componentsPerAttribute:3},{functionName:"batchTable_getCenterLowAndRadius",componentDatatype:Y.FLOAT,componentsPerAttribute:4},{functionName:"batchTable_getDistanceDisplayCondition",componentDatatype:Y.FLOAT,componentsPerAttribute:2}];e._batchTable=new tC(t,n,e._polylines.length)}var GAe=new Sn,WAe=new se,qAe=new U;Uh.prototype.update=function(e){if(LZ(this),this._polylines.length===0||!this.show)return;vut(this,e);let t=e.context,n=e.mapProjection,i,r=this._propertiesChanged;if(this._createBatchTable){if(Ut.maximumVertexTextureImageUnits===0)throw new oe("Vertex texture fetch support is required to render polylines. The maximum number of vertex texture image units must be greater than zero.");Aut(this,t),this._createBatchTable=!1}if(this._createVertexArray||xut(this))UAe(this,t,n);else if(this._polylinesUpdated){let c=this._polylinesToUpdate;if(this._mode!==re.SCENE3D){let u=c.length;for(let f=0;f<u;++f)i=c[f],i.update()}if(r[FAe]||r[_ut])UAe(this,t,n);else{let u=c.length,f=this._polylineBuckets;for(let d=0;d<u;++d){i=c[d],r=i._propertiesChanged;let p=i._bucket,g=0;for(let m in f)if(f.hasOwnProperty(m)){if(f[m]===p){r[NZ]&&p.writeUpdate(g,i,this._positionBuffer,n);break}g+=f[m].lengthOfPositions}if((r[put]||r[gut])&&this._batchTable.setBatchedAttribute(i._index,0,new U(i._width,i._show)),this._batchTable.attributes.length>2){if(r[NZ]||r[FAe]){let m=e.mode===re.SCENE2D?i._boundingVolume2D:i._boundingVolumeWC,y=Sn.fromCartesian(m.center,GAe),A=se.fromElements(y.low.x,y.low.y,y.low.z,m.radius,WAe);this._batchTable.setBatchedAttribute(i._index,2,y.high),this._batchTable.setBatchedAttribute(i._index,3,A)}if(r[yut]){let m=qAe;m.x=0,m.y=Number.MAX_VALUE;let y=i.distanceDisplayCondition;l(y)&&(m.x=y.near,m.y=y.far),this._batchTable.setBatchedAttribute(i._index,4,m)}}i._clean()}}c.length=0,this._polylinesUpdated=!1}r=this._propertiesChanged;for(let c=0;c<HAe;++c)r[c]=0;let o=M.IDENTITY;e.mode===re.SCENE3D&&(o=this.modelMatrix);let s=e.passes,a=e.morphTime!==0;if((!l(this._opaqueRS)||this._opaqueRS.depthTest.enabled!==a)&&(this._opaqueRS=Ge.fromCache({depthMask:a,depthTest:{enabled:a}})),(!l(this._translucentRS)||this._translucentRS.depthTest.enabled!==a)&&(this._translucentRS=Ge.fromCache({blending:nn.ALPHA_BLEND,depthMask:!a,depthTest:{enabled:a}})),this._batchTable.update(e),s.render||s.pick){let c=this._colorCommands;but(this,e,c,o)}};var p1=new ue,BAe=new ue;function but(e,t,n,i){let r=t.context,o=t.commandList,s=n.length,a=0,c=!0,u=e._vertexArrays,f=e.debugShowBoundingVolume,p=e._batchTable.getUniformMapCallback(),g=u.length;for(let m=0;m<g;++m){let y=u[m],A=y.buckets,b=A.length;for(let x=0;x<b;++x){let T=A[x],E=T.offset,v=T.bucket.shaderProgram,S=T.bucket.polylines,I=S.length,R,O,L=0,_,C;for(let w=0;w<I;++w){let D=S[w],N=Eut(D._material);if(N!==R){if(l(R)&&L>0){let j=O.isTranslucent();a>=s?(_=new at({owner:e}),n.push(_)):_=n[a],++a,C=Mt(p(O._uniforms),e._uniformMap),_.boundingVolume=ue.clone(p1,_.boundingVolume),_.modelMatrix=i,_.shaderProgram=v,_.vertexArray=y.va,_.renderState=j?e._translucentRS:e._opaqueRS,_.pass=j?Ie.TRANSLUCENT:Ie.OPAQUE,_.debugShowBoundingVolume=f,_.pickId="v_pickColor",_.uniformMap=C,_.count=L,_.offset=E,E+=L,L=0,c=!0,o.push(_)}O=D._material,O.update(r),R=N}let F=D._locatorBuckets,V=F.length;for(let j=0;j<V;++j){let k=F[j];k.locator===T&&(L+=k.count)}let B;t.mode===re.SCENE3D?B=D._boundingVolumeWC:t.mode===re.COLUMBUS_VIEW?B=D._boundingVolume2D:t.mode===re.SCENE2D?l(D._boundingVolume2D)&&(B=ue.clone(D._boundingVolume2D,BAe),B.center.x=0):l(D._boundingVolumeWC)&&l(D._boundingVolume2D)&&(B=ue.union(D._boundingVolumeWC,D._boundingVolume2D,BAe)),c?(c=!1,ue.clone(B,p1)):ue.union(B,p1,p1)}l(R)&&L>0&&(a>=s?(_=new at({owner:e}),n.push(_)):_=n[a],++a,C=Mt(p(O._uniforms),e._uniformMap),_.boundingVolume=ue.clone(p1,_.boundingVolume),_.modelMatrix=i,_.shaderProgram=v,_.vertexArray=y.va,_.renderState=O.isTranslucent()?e._translucentRS:e._opaqueRS,_.pass=O.isTranslucent()?Ie.TRANSLUCENT:Ie.OPAQUE,_.debugShowBoundingVolume=f,_.pickId="v_pickColor",_.uniformMap=C,_.count=L,_.offset=E,c=!0,o.push(_)),R=void 0}}n.length=a}Uh.prototype.isDestroyed=function(){return!1};Uh.prototype.destroy=function(){return YAe(this),FZ(this),XAe(this),this._batchTable=this._batchTable&&this._batchTable.destroy(),le(this)};function xut(e){let t=!1,n=e._propertiesChanged,i=e._positionBufferUsage;return n[NZ]?(i.bufferUsage!==Me.STREAM_DRAW&&(t=!0,i.bufferUsage=Me.STREAM_DRAW),i.frameCount=100):i.bufferUsage!==Me.STATIC_DRAW&&(i.frameCount===0?(t=!0,i.bufferUsage=Me.STATIC_DRAW):i.frameCount--),t}var kAe=[0,0,0];function UAe(e,t,n){e._createVertexArray=!1,FZ(e),YAe(e),Cut(e);let i=[[]],r,o=e._batchTable,s=e._useHighlightColor,a=[0],c=0,u=[[]],f=0,d=e._polylineBuckets,p,g;for(p in d)d.hasOwnProperty(p)&&(g=d[p],g.updateShader(t,o,s),f+=g.lengthOfPositions);if(f>0){let m=e._mode,y=new Float32Array(6*f*3),A=new Float32Array(f*4),b,x=0,T=0,E=0;for(p in d)if(d.hasOwnProperty(p)){g=d[p],g.write(y,A,x,T,E,o,t,n),m===re.MORPHING&&(l(b)||(b=new Float32Array(6*f*3)),g.writeForMorph(b,x));let C=g.lengthOfPositions;x+=6*C*3,T+=C*4,E+=C*4,c=g.updateIndices(i,a,u,c)}let v=e._positionBufferUsage.bufferUsage,S=Me.STATIC_DRAW;e._positionBuffer=tt.createVertexBuffer({context:t,typedArray:y,usage:v});let I;l(b)&&(I=tt.createVertexBuffer({context:t,typedArray:b,usage:v})),e._texCoordExpandAndBatchIndexBuffer=tt.createVertexBuffer({context:t,typedArray:A,usage:S});let R=3*Float32Array.BYTES_PER_ELEMENT,O=4*Float32Array.BYTES_PER_ELEMENT,L=0,_=i.length;for(let C=0;C<_;++C)if(r=i[C],r.length>0){let w=new Uint16Array(r),D=tt.createIndexBuffer({context:t,typedArray:w,usage:Me.STATIC_DRAW,indexDatatype:je.UNSIGNED_SHORT});L+=a[C];let N=6*(C*(R*P.SIXTY_FOUR_KILOBYTES)-L*R),F=R+N,V=R+F,B=R+V,j=R+B,k=R+j,G=C*(O*P.SIXTY_FOUR_KILOBYTES)-L*O,q=[{index:Ou.position3DHigh,componentsPerAttribute:3,componentDatatype:Y.FLOAT,offsetInBytes:N,strideInBytes:6*R},{index:Ou.position3DLow,componentsPerAttribute:3,componentDatatype:Y.FLOAT,offsetInBytes:F,strideInBytes:6*R},{index:Ou.position2DHigh,componentsPerAttribute:3,componentDatatype:Y.FLOAT,offsetInBytes:N,strideInBytes:6*R},{index:Ou.position2DLow,componentsPerAttribute:3,componentDatatype:Y.FLOAT,offsetInBytes:F,strideInBytes:6*R},{index:Ou.prevPosition3DHigh,componentsPerAttribute:3,componentDatatype:Y.FLOAT,offsetInBytes:V,strideInBytes:6*R},{index:Ou.prevPosition3DLow,componentsPerAttribute:3,componentDatatype:Y.FLOAT,offsetInBytes:B,strideInBytes:6*R},{index:Ou.prevPosition2DHigh,componentsPerAttribute:3,componentDatatype:Y.FLOAT,offsetInBytes:V,strideInBytes:6*R},{index:Ou.prevPosition2DLow,componentsPerAttribute:3,componentDatatype:Y.FLOAT,offsetInBytes:B,strideInBytes:6*R},{index:Ou.nextPosition3DHigh,componentsPerAttribute:3,componentDatatype:Y.FLOAT,offsetInBytes:j,strideInBytes:6*R},{index:Ou.nextPosition3DLow,componentsPerAttribute:3,componentDatatype:Y.FLOAT,offsetInBytes:k,strideInBytes:6*R},{index:Ou.nextPosition2DHigh,componentsPerAttribute:3,componentDatatype:Y.FLOAT,offsetInBytes:j,strideInBytes:6*R},{index:Ou.nextPosition2DLow,componentsPerAttribute:3,componentDatatype:Y.FLOAT,offsetInBytes:k,strideInBytes:6*R},{index:Ou.texCoordExpandAndBatchIndex,componentsPerAttribute:4,componentDatatype:Y.FLOAT,vertexBuffer:e._texCoordExpandAndBatchIndexBuffer,offsetInBytes:G}],Q,W,J,Z;m===re.SCENE3D?(W=e._positionBuffer,Q="vertexBuffer",J=kAe,Z="value"):m===re.SCENE2D||m===re.COLUMBUS_VIEW?(W=kAe,Q="value",J=e._positionBuffer,Z="vertexBuffer"):(W=I,Q="vertexBuffer",J=e._positionBuffer,Z="vertexBuffer"),q[0][Q]=W,q[1][Q]=W,q[2][Z]=J,q[3][Z]=J,q[4][Q]=W,q[5][Q]=W,q[6][Z]=J,q[7][Z]=J,q[8][Q]=W,q[9][Q]=W,q[10][Z]=J,q[11][Z]=J;let ae=new Vn({context:t,attributes:q,indexBuffer:D});e._vertexArrays.push({va:ae,buckets:u[C]})}}}function Tut(e,t){return t instanceof Dt?t.id:t}var l4=[];function Eut(e){let t=ir._uniformList[e.type],n=t.length;l4.length=2*n;let i=0;for(let r=0;r<n;++r){let o=t[r];l4[i]=o,l4[i+1]=e._uniforms[o](),i+=2}return`${e.type}:${JSON.stringify(l4,Tut)}`}function Cut(e){let t=e._mode,n=e._modelMatrix,i=e._polylineBuckets={},r=e._polylines,o=r.length;for(let s=0;s<o;++s){let a=r[s];if(a._actualPositions.length>1){a.update();let c=a.material,u=i[c.type];l(u)||(u=i[c.type]=new vp(c,t,n)),u.addPolyline(a)}}}function vut(e,t){let n=t.mode;(e._mode!==n||!M.equals(e._modelMatrix,e.modelMatrix))&&(e._mode=n,e._modelMatrix=M.clone(e.modelMatrix),e._createVertexArray=!0)}function LZ(e){if(e._polylinesRemoved){e._polylinesRemoved=!1;let t=[],n=[],i=0,r,o=e._polylines.length;for(let s=0;s<o;++s)r=e._polylines[s],r.isDestroyed||(r._index=i++,n.push(r),t.push(r));e._polylines=t,e._polylinesToUpdate=n}}function FZ(e){let t=e._polylines,n=t.length;for(let i=0;i<n;++i)if(!t[i].isDestroyed){let r=t[i]._bucket;l(r)&&(r.shaderProgram=r.shaderProgram&&r.shaderProgram.destroy())}}function YAe(e){let t=e._vertexArrays.length;for(let n=0;n<t;++n)e._vertexArrays[n].va.destroy();e._vertexArrays.length=0}Uh.prototype._updatePolyline=function(e,t){this._polylinesUpdated=!0,e._dirty||this._polylinesToUpdate.push(e),++this._propertiesChanged[t]};function XAe(e){let t=e._polylines,n=t.length;for(let i=0;i<n;++i)t[i].isDestroyed||t[i]._destroy()}function MZ(e,t,n){this.count=e,this.offset=t,this.bucket=n}function vp(e,t,n){this.polylines=[],this.lengthOfPositions=0,this.material=e,this.shaderProgram=void 0,this.mode=t,this.modelMatrix=n}vp.prototype.addPolyline=function(e){this.polylines.push(e),e._actualLength=this.getPolylinePositionsLength(e),this.lengthOfPositions+=e._actualLength,e._bucket=this};vp.prototype.updateShader=function(e,t,n){if(l(this.shaderProgram))return;let i=["DISTANCE_DISPLAY_CONDITION"];n&&i.push("VECTOR_TILE"),this.material.shaderSource.search(/in\s+float\s+v_polylineAngle;/g)!==-1&&i.push("POLYLINE_DASH"),i.push("CLIP_POLYLINE");let r=new Xe({defines:i,sources:[`in vec4 v_pickColor; -`,this.material.shaderSource,KE]}),o=t.getVertexShaderCallback()(H2),s=new Xe({defines:i,sources:[du,o]});this.shaderProgram=Qt.fromCache({context:e,vertexShaderSource:s,fragmentShaderSource:r,attributeLocations:Ou})};function KAe(e){return h.dot(h.UNIT_X,e._boundingVolume.center)<0||e._boundingVolume.intersectPlane(sn.ORIGIN_ZX_PLANE)===$t.INTERSECTING}vp.prototype.getPolylinePositionsLength=function(e){let t;if(this.mode===re.SCENE3D||!KAe(e))return t=e._actualPositions.length,t*4-4;let n=0,i=e._segments.lengths;t=i.length;for(let r=0;r<t;++r)n+=i[r]*4-4;return n};var pa=new h,Id=new h,Pd=new h,u4=new h,Sut=new se,wut=new U;vp.prototype.write=function(e,t,n,i,r,o,s,a){let c=this.mode,u=a.ellipsoid.maximumRadius*P.PI,f=this.polylines,d=f.length;for(let p=0;p<d;++p){let g=f[p],m=g.width,y=g.show&&m>0,A=g._index,b=this.getSegments(g,a),x=b.positions,T=b.lengths,E=x.length,v=g.getPickId(s).color,S=0,I=0,R;for(let V=0;V<E;++V){V===0?g._loop?R=x[E-2]:(R=u4,h.subtract(x[0],x[1],R),h.add(x[0],R,R)):R=x[V-1],h.clone(R,Id),h.clone(x[V],pa),V===E-1?g._loop?R=x[1]:(R=u4,h.subtract(x[E-1],x[E-2],R),h.add(x[E-1],R,R)):R=x[V+1],h.clone(R,Pd);let B=T[S];V===I+B&&(I+=B,++S);let j=V-I===0,k=V===I+T[S]-1;c===re.SCENE2D&&(Id.z=0,pa.z=0,Pd.z=0),(c===re.SCENE2D||c===re.MORPHING)&&(j||k)&&u-Math.abs(pa.x)<1&&((pa.x<0&&Id.x>0||pa.x>0&&Id.x<0)&&h.clone(pa,Id),(pa.x<0&&Pd.x>0||pa.x>0&&Pd.x<0)&&h.clone(pa,Pd));let G=j?2:0,q=k?2:4;for(let Q=G;Q<q;++Q){Sn.writeElements(pa,e,n),Sn.writeElements(Id,e,n+6),Sn.writeElements(Pd,e,n+12);let W=Q-2<0?-1:1;t[r]=V/(E-1),t[r+1]=2*(Q%2)-1,t[r+2]=W,t[r+3]=A,n+=18,r+=4}}let O=Sut;O.x=z.floatToByte(v.red),O.y=z.floatToByte(v.green),O.z=z.floatToByte(v.blue),O.w=z.floatToByte(v.alpha);let L=wut;L.x=m,L.y=y?1:0;let _=c===re.SCENE2D?g._boundingVolume2D:g._boundingVolumeWC,C=Sn.fromCartesian(_.center,GAe),w=C.high,D=se.fromElements(C.low.x,C.low.y,C.low.z,_.radius,WAe),N=qAe;N.x=0,N.y=Number.MAX_VALUE;let F=g.distanceDisplayCondition;l(F)&&(N.x=F.near,N.y=F.far),o.setBatchedAttribute(A,0,L),o.setBatchedAttribute(A,1,O),o.attributes.length>2&&(o.setBatchedAttribute(A,2,w),o.setBatchedAttribute(A,3,D),o.setBatchedAttribute(A,4,N))}};var Iut=new h,Put=new h,Dut=new h,zAe=new h;vp.prototype.writeForMorph=function(e,t){let n=this.modelMatrix,i=this.polylines,r=i.length;for(let o=0;o<r;++o){let s=i[o],a=s._segments.positions,c=s._segments.lengths,u=a.length,f=0,d=0;for(let p=0;p<u;++p){let g;p===0?s._loop?g=a[u-2]:(g=zAe,h.subtract(a[0],a[1],g),h.add(a[0],g,g)):g=a[p-1],g=M.multiplyByPoint(n,g,Put);let m=M.multiplyByPoint(n,a[p],Iut),y;p===u-1?s._loop?y=a[1]:(y=zAe,h.subtract(a[u-1],a[u-2],y),h.add(a[u-1],y,y)):y=a[p+1],y=M.multiplyByPoint(n,y,Dut);let A=c[f];p===d+A&&(d+=A,++f);let b=p-d===0,x=p===d+c[f]-1,T=b?2:0,E=x?2:4;for(let v=T;v<E;++v)Sn.writeElements(m,e,t),Sn.writeElements(g,e,t+6),Sn.writeElements(y,e,t+12),t+=18}}};var Rut=new Array(1);vp.prototype.updateIndices=function(e,t,n,i){let r=n.length-1,o=new MZ(0,i,this);n[r].push(o);let s=0,a=e[e.length-1],c=0;a.length>0&&(c=a[a.length-1]+1);let u=this.polylines,f=u.length;for(let d=0;d<f;++d){let p=u[d];p._locatorBuckets=[];let g;if(this.mode===re.SCENE3D){g=Rut;let y=p._actualPositions.length;if(y>0)g[0]=y;else continue}else g=p._segments.lengths;let m=g.length;if(m>0){let y=0;for(let A=0;A<m;++A){let b=g[A]-1;for(let x=0;x<b;++x)c+4>P.SIXTY_FOUR_KILOBYTES&&(p._locatorBuckets.push({locator:o,count:y}),y=0,t.push(4),a=[],e.push(a),c=0,o.count=s,s=0,i=0,o=new MZ(0,0,this),n[++r]=[o]),a.push(c,c+2,c+1),a.push(c+1,c+2,c+3),y+=6,s+=6,i+=6,c+=4}p._locatorBuckets.push({locator:o,count:y}),c+4>P.SIXTY_FOUR_KILOBYTES&&(t.push(0),a=[],e.push(a),c=0,o.count=s,i=0,s=0,o=new MZ(0,0,this),n[++r]=[o])}p._clean()}return o.count=s,i};vp.prototype.getPolylineStartIndex=function(e){let t=this.polylines,n=0,i=t.length;for(let r=0;r<i;++r){let o=t[r];if(o===e)break;n+=o._actualLength}return n};var Mv={positions:void 0,lengths:void 0},VAe=new Array(1),Out=new h,Mut=new he;vp.prototype.getSegments=function(e,t){let n=e._actualPositions;if(this.mode===re.SCENE3D)return VAe[0]=n.length,Mv.positions=n,Mv.lengths=VAe,Mv;KAe(e)&&(n=e._segments.positions);let i=t.ellipsoid,r=[],o=this.modelMatrix,s=n.length,a,c=Out;for(let u=0;u<s;++u)a=n[u],c=M.multiplyByPoint(o,a,c),r.push(t.project(i.cartesianToCartographic(c,Mut)));if(r.length>0){e._boundingVolume2D=ue.fromPoints(r,e._boundingVolume2D);let u=e._boundingVolume2D.center;e._boundingVolume2D.center=new h(u.z,u.x,u.y)}return Mv.positions=r,Mv.lengths=e._segments.lengths,Mv};var jAe;vp.prototype.writeUpdate=function(e,t,n,i){let r=this.mode,o=i.ellipsoid.maximumRadius*P.PI,s=t._actualLength;if(s){e+=this.getPolylineStartIndex(t);let a=jAe,c=6*s*3;!l(a)||a.length<c?a=jAe=new Float32Array(c):a.length>c&&(a=new Float32Array(a.buffer,0,c));let u=this.getSegments(t,i),f=u.positions,d=u.lengths,p=0,g=0,m=0,y;s=f.length;for(let A=0;A<s;++A){A===0?t._loop?y=f[s-2]:(y=u4,h.subtract(f[0],f[1],y),h.add(f[0],y,y)):y=f[A-1],h.clone(y,Id),h.clone(f[A],pa),A===s-1?t._loop?y=f[1]:(y=u4,h.subtract(f[s-1],f[s-2],y),h.add(f[s-1],y,y)):y=f[A+1],h.clone(y,Pd);let b=d[g];A===m+b&&(m+=b,++g);let x=A-m===0,T=A===m+d[g]-1;r===re.SCENE2D&&(Id.z=0,pa.z=0,Pd.z=0),(r===re.SCENE2D||r===re.MORPHING)&&(x||T)&&o-Math.abs(pa.x)<1&&((pa.x<0&&Id.x>0||pa.x>0&&Id.x<0)&&h.clone(pa,Id),(pa.x<0&&Pd.x>0||pa.x>0&&Pd.x<0)&&h.clone(pa,Pd));let E=x?2:0,v=T?2:4;for(let S=E;S<v;++S)Sn.writeElements(pa,a,p),Sn.writeElements(Id,a,p+6),Sn.writeElements(Pd,a,p+12),p+=18}n.copyFromArrayView(a,18*Float32Array.BYTES_PER_ELEMENT*e)}};var Sp=Uh;function ky(e){this._positions=e.positions,this._batchTable=e.batchTable,this._batchIds=e.batchIds,this._rectangle=e.rectangle,this._minHeight=e.minimumHeight,this._maxHeight=e.maximumHeight,this._heightReference=e.heightReference,this._billboardCollection=new wd({batchTable:e.batchTable,scene:e.scene}),this._labelCollection=new hg({batchTable:e.batchTable,scene:e.scene}),this._polylineCollection=new Sp,this._polylineCollection._useHighlightColor=!0,this._packedBuffer=void 0,this._ready=!1,this._promise=void 0,this._error=void 0}Object.defineProperties(ky.prototype,{ready:{get:function(){return this._ready}},pointsLength:{get:function(){return this._billboardCollection.length}},texturesByteLength:{get:function(){let e=this._billboardCollection.sizeInBytes,t=this._labelCollection.sizeInBytes;return e+t}}});function Nut(e,t){let n=e._rectangle,i=e._minHeight,r=e._maxHeight,o=2+ie.packedLength+ee.packedLength,s=new Float64Array(o),a=0;return s[a++]=i,s[a++]=r,ie.pack(n,s,a),a+=ie.packedLength,ee.pack(t,s,a),s}var Lut=new $n("createVectorTilePoints",5),Fut=new h;function But(e,t){let n=e._positions,i=e._packedBuffer;l(i)||(n=e._positions=n.slice(),e._batchIds=e._batchIds.slice(),i=e._packedBuffer=Nut(e,t));let r=[n.buffer,i.buffer],o={positions:n.buffer,packedBuffer:i.buffer},s=Lut.scheduleTask(o,r);if(l(s))return s.then(a=>{if(e.isDestroyed())return;e._positions=new Float64Array(a.positions);let c=e._billboardCollection,u=e._labelCollection,f=e._polylineCollection;n=e._positions;let d=e._batchIds,p=n.length/3,g=e._heightReference??We.NONE;for(let m=0;m<p;++m){let y=d[m],A=h.unpack(n,m*3,Fut),b=c.add();b.position=A,b._batchIndex=y,b.heightReference=g;let x=u.add();x.text=" ",x.position=A,x._batchIndex=y,x.heightReference=g;let T=f.add();T.positions=[h.clone(A),h.clone(A)]}e._positions=void 0,e._packedBuffer=void 0,e._ready=!0}).catch(a=>{e.isDestroyed()||(e._error=a)})}ky.prototype.createFeatures=function(e,t){let n=this._billboardCollection,i=this._labelCollection,r=this._polylineCollection,o=this._batchIds,s=o.length;for(let a=0;a<s;++a){let c=o[a],u=n.get(a),f=i.get(a),d=r.get(a);t[c]=new Fy(e,c,u,f,d)}};ky.prototype.applyDebugSettings=function(e,t){e?(z.clone(t,this._billboardCollection._highlightColor),z.clone(t,this._labelCollection._highlightColor),z.clone(t,this._polylineCollection._highlightColor)):(z.clone(z.WHITE,this._billboardCollection._highlightColor),z.clone(z.WHITE,this._labelCollection._highlightColor),z.clone(z.WHITE,this._polylineCollection._highlightColor))};function kut(e,t){let n=e._batchIds,i=n.length;for(let r=0;r<i;++r){let o=n[r],s=t[o];s.show=!0,s.pointSize=Fy.defaultPointSize,s.color=Fy.defaultColor,s.pointOutlineColor=Fy.defaultPointOutlineColor,s.pointOutlineWidth=Fy.defaultPointOutlineWidth,s.labelColor=z.WHITE,s.labelOutlineColor=z.WHITE,s.labelOutlineWidth=1,s.font="30px sans-serif",s.labelStyle=Io.FILL,s.labelText=void 0,s.backgroundColor=new z(.165,.165,.165,.8),s.backgroundPadding=new U(7,5),s.backgroundEnabled=!1,s.scaleByDistance=void 0,s.translucencyByDistance=void 0,s.distanceDisplayCondition=void 0,s.heightOffset=0,s.anchorLineEnabled=!1,s.anchorLineColor=z.WHITE,s.image=void 0,s.disableDepthTestDistance=0,s.horizontalOrigin=Hi.CENTER,s.verticalOrigin=qn.CENTER,s.labelHorizontalOrigin=Hi.RIGHT,s.labelVerticalOrigin=qn.BASELINE}}var Uut=new z,zut=new z,Vut=new z,jut=new z,Hut=new z,Gut=new z,g1=new qt,_1=new qt,BZ=new Gt;ky.prototype.applyStyle=function(e,t){if(!l(e)){kut(this,t);return}let n=this._batchIds,i=n.length;for(let r=0;r<i;++r){let o=n[r],s=t[o];if(l(e.show)&&(s.show=e.show.evaluate(s)),l(e.pointSize)&&(s.pointSize=e.pointSize.evaluate(s)),l(e.color)&&(s.color=e.color.evaluateColor(s,Uut)),l(e.pointOutlineColor)&&(s.pointOutlineColor=e.pointOutlineColor.evaluateColor(s,zut)),l(e.pointOutlineWidth)&&(s.pointOutlineWidth=e.pointOutlineWidth.evaluate(s)),l(e.labelColor)&&(s.labelColor=e.labelColor.evaluateColor(s,Vut)),l(e.labelOutlineColor)&&(s.labelOutlineColor=e.labelOutlineColor.evaluateColor(s,jut)),l(e.labelOutlineWidth)&&(s.labelOutlineWidth=e.labelOutlineWidth.evaluate(s)),l(e.font)&&(s.font=e.font.evaluate(s)),l(e.labelStyle)&&(s.labelStyle=e.labelStyle.evaluate(s)),l(e.labelText)?s.labelText=e.labelText.evaluate(s):s.labelText=void 0,l(e.backgroundColor)&&(s.backgroundColor=e.backgroundColor.evaluateColor(s,Hut)),l(e.backgroundPadding)&&(s.backgroundPadding=e.backgroundPadding.evaluate(s)),l(e.backgroundEnabled)&&(s.backgroundEnabled=e.backgroundEnabled.evaluate(s)),l(e.scaleByDistance)){let a=e.scaleByDistance.evaluate(s);l(a)?(g1.near=a.x,g1.nearValue=a.y,g1.far=a.z,g1.farValue=a.w,s.scaleByDistance=g1):s.scaleByDistance=void 0}else s.scaleByDistance=void 0;if(l(e.translucencyByDistance)){let a=e.translucencyByDistance.evaluate(s);l(a)?(_1.near=a.x,_1.nearValue=a.y,_1.far=a.z,_1.farValue=a.w,s.translucencyByDistance=_1):s.translucencyByDistance=void 0}else s.translucencyByDistance=void 0;if(l(e.distanceDisplayCondition)){let a=e.distanceDisplayCondition.evaluate(s);l(a)?(BZ.near=a.x,BZ.far=a.y,s.distanceDisplayCondition=BZ):s.distanceDisplayCondition=void 0}else s.distanceDisplayCondition=void 0;l(e.heightOffset)&&(s.heightOffset=e.heightOffset.evaluate(s)),l(e.anchorLineEnabled)&&(s.anchorLineEnabled=e.anchorLineEnabled.evaluate(s)),l(e.anchorLineColor)&&(s.anchorLineColor=e.anchorLineColor.evaluateColor(s,Gut)),l(e.image)?s.image=e.image.evaluate(s):s.image=void 0,l(e.disableDepthTestDistance)&&(s.disableDepthTestDistance=e.disableDepthTestDistance.evaluate(s)),l(e.horizontalOrigin)&&(s.horizontalOrigin=e.horizontalOrigin.evaluate(s)),l(e.verticalOrigin)&&(s.verticalOrigin=e.verticalOrigin.evaluate(s)),l(e.labelHorizontalOrigin)&&(s.labelHorizontalOrigin=e.labelHorizontalOrigin.evaluate(s)),l(e.labelVerticalOrigin)&&(s.labelVerticalOrigin=e.labelVerticalOrigin.evaluate(s))}};ky.prototype.update=function(e){if(!this._ready&&(l(this._promise)||(this._promise=But(this,e.mapProjection.ellipsoid)),l(this._error))){let t=this._error;throw this._error=void 0,t}this._polylineCollection.update(e),this._billboardCollection.update(e),this._labelCollection.update(e)};ky.prototype.isDestroyed=function(){return!1};ky.prototype.destroy=function(){return this._billboardCollection=this._billboardCollection&&this._billboardCollection.destroy(),this._labelCollection=this._labelCollection&&this._labelCollection.destroy(),this._polylineCollection=this._polylineCollection&&this._polylineCollection.destroy(),le(this)};var f4=ky;function pg(e){this._batchTable=e.batchTable,this._batchIds=e.batchIds,this._positions=e.positions,this._counts=e.counts,this._indices=e.indices,this._indexCounts=e.indexCounts,this._indexOffsets=void 0,this._batchTableColors=void 0,this._packedBuffer=void 0,this._batchedPositions=void 0,this._transferrableBatchIds=void 0,this._vertexBatchIds=void 0,this._ellipsoid=e.ellipsoid??ee.WGS84,this._minimumHeight=e.minimumHeight,this._maximumHeight=e.maximumHeight,this._polygonMinimumHeights=e.polygonMinimumHeights,this._polygonMaximumHeights=e.polygonMaximumHeights,this._center=e.center??h.ZERO,this._rectangle=e.rectangle,this._center=void 0,this._boundingVolume=e.boundingVolume,this._boundingVolumes=void 0,this._batchedIndices=void 0,this._ready=!1,this._promise=void 0,this._error=void 0,this._primitive=void 0,this.debugWireframe=!1,this.forceRebatch=!1,this.classificationType=ei.BOTH}Object.defineProperties(pg.prototype,{trianglesLength:{get:function(){return l(this._primitive)?this._primitive.trianglesLength:0}},geometryByteLength:{get:function(){return l(this._primitive)?this._primitive.geometryByteLength:0}},ready:{get:function(){return this._ready}}});function Wut(e){let t=new Float64Array(3+h.packedLength+ee.packedLength+ie.packedLength),n=0;return t[n++]=e._indices.BYTES_PER_ELEMENT,t[n++]=e._minimumHeight,t[n++]=e._maximumHeight,h.pack(e._center,t,n),n+=h.packedLength,ee.pack(e._ellipsoid,t,n),n+=ee.packedLength,ie.pack(e._rectangle,t,n),t}function qut(e,t){let n=1,i=t[n++],r=e._boundingVolumes=new Array(i);for(let a=0;a<i;++a)r[a]=en.unpack(t,n),n+=en.packedLength;let o=t[n++],s=e._batchedIndices=new Array(o);for(let a=0;a<o;++a){let c=z.unpack(t,n);n+=z.packedLength;let u=t[n++],f=t[n++],d=t[n++],p=new Array(d);for(let g=0;g<d;++g)p[g]=t[n++];s[a]=new X0({color:c,offset:u,count:f,batchIds:p})}}var Yut=new $n("createVectorTilePolygons",5),Xut=new z;function Kut(e){if(l(e._primitive))return;let t=e._positions,n=e._counts,i=e._indexCounts,r=e._indices,o=e._transferrableBatchIds,s=e._batchTableColors,a=e._packedBuffer;if(!l(s)){t=e._positions=e._positions.slice(),n=e._counts=e._counts.slice(),i=e._indexCounts=e._indexCounts.slice(),r=e._indices=e._indices.slice(),e._center=e._ellipsoid.cartographicToCartesian(ie.center(e._rectangle)),o=e._transferrableBatchIds=new Uint32Array(e._batchIds),s=e._batchTableColors=new Uint32Array(o.length);let g=e._batchTable,m=s.length;for(let y=0;y<m;++y){let A=g.getColor(y,Xut);s[y]=A.toRgba()}a=e._packedBuffer=Wut(e)}let c=[t.buffer,n.buffer,i.buffer,r.buffer,o.buffer,s.buffer,a.buffer],u={packedBuffer:a.buffer,positions:t.buffer,counts:n.buffer,indexCounts:i.buffer,indices:r.buffer,batchIds:o.buffer,batchTableColors:s.buffer},f=e._polygonMinimumHeights,d=e._polygonMaximumHeights;l(f)&&l(d)&&(f=f.slice(),d=d.slice(),c.push(f.buffer,d.buffer),u.minimumHeights=f,u.maximumHeights=d);let p=Yut.scheduleTask(u,c);if(l(p))return p.then(g=>{if(e.isDestroyed())return;e._positions=void 0,e._counts=void 0,e._polygonMinimumHeights=void 0,e._polygonMaximumHeights=void 0;let m=new Float64Array(g.packedBuffer),y=m[0];qut(e,m),e._indices=je.getSizeInBytes(y)===2?new Uint16Array(g.indices):new Uint32Array(g.indices),e._indexOffsets=new Uint32Array(g.indexOffsets),e._indexCounts=new Uint32Array(g.indexCounts),e._batchedPositions=new Float32Array(g.positions),e._vertexBatchIds=new Uint16Array(g.batchIds),$ut(e),e._ready=!0}).catch(g=>{e.isDestroyed()||(e._error=g)})}function $ut(e){l(e._primitive)||(e._primitive=new wC({batchTable:e._batchTable,positions:e._batchedPositions,batchIds:e._batchIds,vertexBatchIds:e._vertexBatchIds,indices:e._indices,indexOffsets:e._indexOffsets,indexCounts:e._indexCounts,batchedIndices:e._batchedIndices,boundingVolume:e._boundingVolume,boundingVolumes:e._boundingVolumes,center:e._center}),e._batchTable=void 0,e._batchIds=void 0,e._positions=void 0,e._counts=void 0,e._indices=void 0,e._indexCounts=void 0,e._indexOffsets=void 0,e._batchTableColors=void 0,e._packedBuffer=void 0,e._batchedPositions=void 0,e._transferrableBatchIds=void 0,e._vertexBatchIds=void 0,e._ellipsoid=void 0,e._minimumHeight=void 0,e._maximumHeight=void 0,e._polygonMinimumHeights=void 0,e._polygonMaximumHeights=void 0,e._center=void 0,e._rectangle=void 0,e._boundingVolume=void 0,e._boundingVolumes=void 0,e._batchedIndices=void 0)}pg.prototype.createFeatures=function(e,t){this._primitive.createFeatures(e,t)};pg.prototype.applyDebugSettings=function(e,t){this._primitive.applyDebugSettings(e,t)};pg.prototype.applyStyle=function(e,t){this._primitive.applyStyle(e,t)};pg.prototype.updateCommands=function(e,t){this._primitive.updateCommands(e,t)};pg.prototype.update=function(e){if(!this._ready){if(l(this._promise)||(this._promise=Kut(this)),l(this._error)){let t=this._error;throw this._error=void 0,t}return}this._primitive.debugWireframe=this.debugWireframe,this._primitive.forceRebatch=this.forceRebatch,this._primitive.classificationType=this.classificationType,this._primitive.update(e)};pg.prototype.isDestroyed=function(){return!1};pg.prototype.destroy=function(){return this._primitive=this._primitive&&this._primitive.destroy(),le(this)};var d4=pg;function zh(e){this._positions=e.positions,this._widths=e.widths,this._counts=e.counts,this._batchIds=e.batchIds,this._ellipsoid=e.ellipsoid??ee.WGS84,this._minimumHeight=e.minimumHeight,this._maximumHeight=e.maximumHeight,this._center=e.center,this._rectangle=e.rectangle,this._boundingVolume=e.boundingVolume,this._batchTable=e.batchTable,this._va=void 0,this._sp=void 0,this._rs=void 0,this._uniformMap=void 0,this._command=void 0,this._transferrableBatchIds=void 0,this._packedBuffer=void 0,this._keepDecodedPositions=e.keepDecodedPositions,this._decodedPositions=void 0,this._decodedPositionOffsets=void 0,this._currentPositions=void 0,this._previousPositions=void 0,this._nextPositions=void 0,this._expandAndWidth=void 0,this._vertexBatchIds=void 0,this._indices=void 0,this._constantColor=z.clone(z.WHITE),this._highlightColor=this._constantColor,this._trianglesLength=0,this._geometryByteLength=0,this._ready=!1,this._promise=void 0,this._error=void 0}Object.defineProperties(zh.prototype,{trianglesLength:{get:function(){return this._trianglesLength}},geometryByteLength:{get:function(){return this._geometryByteLength}},ready:{get:function(){return this._ready}}});function Jut(e){let t=e._rectangle,n=e._minimumHeight,i=e._maximumHeight,r=e._ellipsoid,o=e._center,s=2+ie.packedLength+ee.packedLength+h.packedLength,a=new Float64Array(s),c=0;return a[c++]=n,a[c++]=i,ie.pack(t,a,c),c+=ie.packedLength,ee.pack(r,a,c),c+=ee.packedLength,h.pack(o,a,c),a}var Zut=new $n("createVectorTilePolylines",5),Nv={previousPosition:0,currentPosition:1,nextPosition:2,expandAndWidth:3,a_batchId:4};function Qut(e,t){if(l(e._va))return;let n=e._positions,i=e._widths,r=e._counts,o=e._transferrableBatchIds,s=e._packedBuffer;l(s)||(n=e._positions=n.slice(),i=e._widths=i.slice(),r=e._counts=r.slice(),o=e._transferrableBatchIds=e._batchIds.slice(),s=e._packedBuffer=Jut(e));let a=[n.buffer,i.buffer,r.buffer,o.buffer,s.buffer],c={positions:n.buffer,widths:i.buffer,counts:r.buffer,batchIds:o.buffer,packedBuffer:s.buffer,keepDecodedPositions:e._keepDecodedPositions},u=Zut.scheduleTask(c,a);if(l(u))return u.then(function(f){if(e.isDestroyed())return;e._keepDecodedPositions&&(e._decodedPositions=new Float64Array(f.decodedPositions),e._decodedPositionOffsets=new Uint32Array(f.decodedPositionOffsets)),e._currentPositions=new Float32Array(f.currentPositions),e._previousPositions=new Float32Array(f.previousPositions),e._nextPositions=new Float32Array(f.nextPositions),e._expandAndWidth=new Float32Array(f.expandAndWidth),e._vertexBatchIds=new Uint16Array(f.batchIds);let d=f.indexDatatype;e._indices=d===je.UNSIGNED_SHORT?new Uint16Array(f.indices):new Uint32Array(f.indices),eft(e,t),e._ready=!0}).catch(f=>{e.isDestroyed()||(e._error=f)})}function eft(e,t){if(!l(e._va)){let n=e._currentPositions,i=e._previousPositions,r=e._nextPositions,o=e._expandAndWidth,s=e._vertexBatchIds,a=e._indices,c=i.byteLength+n.byteLength+r.byteLength;c+=o.byteLength+s.byteLength+a.byteLength,e._trianglesLength=a.length/3,e._geometryByteLength=c;let u=tt.createVertexBuffer({context:t,typedArray:i,usage:Me.STATIC_DRAW}),f=tt.createVertexBuffer({context:t,typedArray:n,usage:Me.STATIC_DRAW}),d=tt.createVertexBuffer({context:t,typedArray:r,usage:Me.STATIC_DRAW}),p=tt.createVertexBuffer({context:t,typedArray:o,usage:Me.STATIC_DRAW}),g=tt.createVertexBuffer({context:t,typedArray:s,usage:Me.STATIC_DRAW}),m=tt.createIndexBuffer({context:t,typedArray:a,usage:Me.STATIC_DRAW,indexDatatype:a.BYTES_PER_ELEMENT===2?je.UNSIGNED_SHORT:je.UNSIGNED_INT}),y=[{index:Nv.previousPosition,vertexBuffer:u,componentDatatype:Y.FLOAT,componentsPerAttribute:3},{index:Nv.currentPosition,vertexBuffer:f,componentDatatype:Y.FLOAT,componentsPerAttribute:3},{index:Nv.nextPosition,vertexBuffer:d,componentDatatype:Y.FLOAT,componentsPerAttribute:3},{index:Nv.expandAndWidth,vertexBuffer:p,componentDatatype:Y.FLOAT,componentsPerAttribute:2},{index:Nv.a_batchId,vertexBuffer:g,componentDatatype:Y.UNSIGNED_SHORT,componentsPerAttribute:1}];e._va=new Vn({context:t,attributes:y,indexBuffer:m}),e._positions=void 0,e._widths=void 0,e._counts=void 0,e._ellipsoid=void 0,e._minimumHeight=void 0,e._maximumHeight=void 0,e._rectangle=void 0,e._transferrableBatchIds=void 0,e._packedBuffer=void 0,e._currentPositions=void 0,e._previousPositions=void 0,e._nextPositions=void 0,e._expandAndWidth=void 0,e._vertexBatchIds=void 0,e._indices=void 0}}var y1=new M,$Ae=new h;function tft(e,t){l(e._uniformMap)||(e._uniformMap={u_modifiedModelView:function(){let n=t.uniformState.view;return M.clone(n,y1),M.multiplyByPoint(y1,e._center,$Ae),M.setTranslation(y1,$Ae,y1),y1},u_highlightColor:function(){return e._highlightColor}})}function nft(e){if(l(e._rs))return;let t={enabled:!0,factor:-5,units:-5};e._rs=Ge.fromCache({blending:nn.ALPHA_BLEND,depthMask:!1,depthTest:{enabled:!0},polygonOffset:t})}var ift=`uniform vec4 u_highlightColor; +`;let d=new Xe({sources:[a]}),p=new Xe({defines:["VECTOR_TILE"],sources:[c]});e._spPick=Qt.fromCache({context:t,vertexShaderSource:d,fragmentShaderSource:p,attributeLocations:i})}function mTe(e){let t=e?ei.EQUAL:ei.ALWAYS;return{colorMask:{red:!1,green:!1,blue:!1,alpha:!1},stencilTest:{enabled:!0,frontFunction:t,frontOperation:{fail:Rt.KEEP,zFail:Rt.DECREMENT_WRAP,zPass:Rt.KEEP},backFunction:t,backOperation:{fail:Rt.KEEP,zFail:Rt.INCREMENT_WRAP,zPass:Rt.KEEP},reference:Xt.CESIUM_3D_TILE_MASK,mask:Xt.CESIUM_3D_TILE_MASK},stencilMask:Xt.CLASSIFICATION_MASK,depthTest:{enabled:!0,func:Ac.LESS_OR_EQUAL},depthMask:!1}}var zht={stencilTest:{enabled:!0,frontFunction:ei.NOT_EQUAL,frontOperation:{fail:Rt.ZERO,zFail:Rt.ZERO,zPass:Rt.ZERO},backFunction:ei.NOT_EQUAL,backOperation:{fail:Rt.ZERO,zFail:Rt.ZERO,zPass:Rt.ZERO},reference:0,mask:Xt.CLASSIFICATION_MASK},stencilMask:Xt.CLASSIFICATION_MASK,depthTest:{enabled:!1},depthMask:!1,blending:nn.PRE_MULTIPLIED_ALPHA_BLEND},Vht={stencilTest:{enabled:!0,frontFunction:ei.NOT_EQUAL,frontOperation:{fail:Rt.ZERO,zFail:Rt.ZERO,zPass:Rt.ZERO},backFunction:ei.NOT_EQUAL,backOperation:{fail:Rt.ZERO,zFail:Rt.ZERO,zPass:Rt.ZERO},reference:0,mask:Xt.CLASSIFICATION_MASK},stencilMask:Xt.CLASSIFICATION_MASK,depthTest:{enabled:!1},depthMask:!1};function jht(e){l(e._rsStencilDepthPass)||(e._rsStencilDepthPass=Ge.fromCache(mTe(!1)),e._rsStencilDepthPass3DTiles=Ge.fromCache(mTe(!0)),e._rsColorPass=Ge.fromCache(zht),e._rsPickPass=Ge.fromCache(Vht))}var Mx=new M,pTe=new h;function Hht(e,t){if(l(e._uniformMap))return;let n={u_modifiedModelViewProjection:function(){let i=t.uniformState.view,r=t.uniformState.projection;return M.clone(i,Mx),M.multiplyByPoint(Mx,e._center,pTe),M.setTranslation(Mx,pTe,Mx),M.multiply(r,Mx,Mx),Mx},u_highlightColor:function(){return e._highlightColor}};e._uniformMap=e._batchTable.getUniformMapCallback()(n)}function _Q(e,t,n,i,r,o,s){let a=e.constructor.BYTES_PER_ELEMENT,c=o.length;for(let u=0;u<c;++u){let f=o[u],d=s[f],p=i[d],g=r[d],m=new e.constructor(e.buffer,a*p,g);t.set(m,n),i[d]=n,n+=g}return n}function Ght(e,t){let n=e._indices,i=e._indexOffsets,r=e._indexCounts,o=e._batchIdLookUp,s=new n.constructor(n.length),a=t.pop(),c=[a],u=_Q(n,s,0,i,r,a.batchIds,o);for(a.offset=0,a.count=u;t.length>0;){let f=t.pop();if(z.equals(f.color,a.color))u=_Q(n,s,u,i,r,f.batchIds,o),a.batchIds=a.batchIds.concat(f.batchIds),a.count=u-a.offset;else{let d=u;u=_Q(n,s,u,i,r,f.batchIds,o),f.offset=d,f.count=u-d,c.push(f),a=f}}e._va.indexBuffer.copyFromArrayView(s),e._indices=s,e._batchedIndices=c}function yQ(e,t,n,i,r,o,s){let a=e.bytesPerIndex,c=o.length;for(let u=0;u<c;++u){let f=o[u],d=s[f],p=i[d],g=r[d];t.copyFromBuffer(e,p*a,n*a,g*a),i[d]=n,n+=g}return n}function Wht(e,t){let n=e._indexOffsets,i=e._indexCounts,r=e._batchIdLookUp,o=t.pop(),s=[o],a=e._va.indexBuffer,c=e._vaSwap.indexBuffer,u=yQ(a,c,0,n,i,o.batchIds,r);for(o.offset=0,o.count=u;t.length>0;){let d=t.pop();if(z.equals(d.color,o.color))u=yQ(a,c,u,n,i,d.batchIds,r),o.batchIds=o.batchIds.concat(d.batchIds),o.count=u-o.offset;else{let p=u;u=yQ(a,c,u,n,i,d.batchIds,r),d.offset=p,d.count=u-p,s.push(d),o=d}}let f=e._va;e._va=e._vaSwap,e._vaSwap=f,e._batchedIndices=s}function qht(e,t){return t.color.toRgba()-e.color.toRgba()}function Yht(e,t){if(!e._batchDirty)return!1;let n=e._batchedIndices,i=n.length,r=!1,o={};for(let s=0;s<i;++s){let c=n[s].color.toRgba();if(l(o[c])){r=!0;break}else o[c]=!0}if(!r)return e._batchDirty=!1,!1;if(r&&!e.forceRebatch&&e._framesSinceLastRebatch<120){++e._framesSinceLastRebatch;return}return n.sort(qht),t.webgl2?Wht(e,n):Ght(e,n),e._framesSinceLastRebatch=0,e._batchDirty=!1,e._pickCommandsDirty=!0,e._wireframeDirty=!0,!0}function Xht(e,t){let n=Yht(e,t),i=e._commands,r=e._batchedIndices,o=r.length,s=o*2;if(l(i)&&!n&&i.length===s)return;i.length=s;let a=e._va,c=e._sp,u=e._modelMatrix??M.IDENTITY,f=e._uniformMap,d=e._boundingVolume;for(let p=0;p<o;++p){let g=r[p].offset,m=r[p].count,y=i[p*2];l(y)||(y=i[p*2]=new at({owner:e})),y.vertexArray=a,y.modelMatrix=u,y.offset=g,y.count=m,y.renderState=e._rsStencilDepthPass,y.shaderProgram=c,y.uniformMap=f,y.boundingVolume=d,y.cull=!1,y.pass=Ie.TERRAIN_CLASSIFICATION;let A=at.shallowClone(y,y.derivedCommands.tileset);A.renderState=e._rsStencilDepthPass3DTiles,A.pass=Ie.CESIUM_3D_TILE_CLASSIFICATION,y.derivedCommands.tileset=A;let b=i[p*2+1];l(b)||(b=i[p*2+1]=new at({owner:e})),b.vertexArray=a,b.modelMatrix=u,b.offset=g,b.count=m,b.renderState=e._rsColorPass,b.shaderProgram=c,b.uniformMap=f,b.boundingVolume=d,b.cull=!1,b.pass=Ie.TERRAIN_CLASSIFICATION;let x=at.shallowClone(b,b.derivedCommands.tileset);x.pass=Ie.CESIUM_3D_TILE_CLASSIFICATION,b.derivedCommands.tileset=x}e._commandsDirty=!0}function Kht(e,t){if(e.classificationType===Qn.TERRAIN||!t.invertClassification||l(e._commandsIgnoreShow)&&!e._commandsDirty)return;let n=e._commands,i=e._commandsIgnoreShow,r=e._spStencil,o=n.length,s=i.length=o/2,a=0;for(let c=0;c<s;++c){let u=i[c]=at.shallowClone(n[a],i[c]);u.shaderProgram=r,u.pass=Ie.CESIUM_3D_TILE_CLASSIFICATION_IGNORE_SHOW,a+=2}e._commandsDirty=!1}function $ht(e){if(!e._pickCommandsDirty)return;let t=e._indexOffsets.length,n=e._pickCommands;n.length=t*2;let i=e._va,r=e._spStencil,o=e._spPick,s=e._modelMatrix??M.IDENTITY,a=e._uniformMap;for(let c=0;c<t;++c){let u=e._indexOffsets[c],f=e._indexCounts[c],d=l(e._boundingVolumes)?e._boundingVolumes[c]:e.boundingVolume,p=n[c*2];l(p)||(p=n[c*2]=new at({owner:e,pickOnly:!0})),p.vertexArray=i,p.modelMatrix=s,p.offset=u,p.count=f,p.renderState=e._rsStencilDepthPass,p.shaderProgram=r,p.uniformMap=a,p.boundingVolume=d,p.pass=Ie.TERRAIN_CLASSIFICATION;let g=at.shallowClone(p,p.derivedCommands.tileset);g.renderState=e._rsStencilDepthPass3DTiles,g.pass=Ie.CESIUM_3D_TILE_CLASSIFICATION,p.derivedCommands.tileset=g;let m=n[c*2+1];l(m)||(m=n[c*2+1]=new at({owner:e,pickOnly:!0})),m.vertexArray=i,m.modelMatrix=s,m.offset=u,m.count=f,m.renderState=e._rsPickPass,m.shaderProgram=o,m.uniformMap=a,m.boundingVolume=d,m.pass=Ie.TERRAIN_CLASSIFICATION;let y=at.shallowClone(m,m.derivedCommands.tileset);y.pass=Ie.CESIUM_3D_TILE_CLASSIFICATION,m.derivedCommands.tileset=y}e._pickCommandsDirty=!1}bg.prototype.createFeatures=function(e,t){let n=this._batchIds,i=n.length;for(let r=0;r<i;++r){let o=n[r];t[o]=new ma(e,o)}};bg.prototype.applyDebugSettings=function(e,t){this._highlightColor=e?t:this._constantColor};function Jht(e,t){e._updatingAllCommands=!0;let n=e._batchIds,i=n.length,r;for(r=0;r<i;++r){let s=n[r],a=t[s];a.show=!0,a.color=z.WHITE}let o=e._batchedIndices;for(i=o.length,r=0;r<i;++r)o[r].color=z.clone(z.WHITE);e._updatingAllCommands=!1,e._batchDirty=!0}var Zht=new z,Qht=z.WHITE,emt=!0,tmt=/\$/;bg.prototype.applyStyle=function(e,t){if(!l(e)){Jht(this,t);return}let n=e.color,i=n instanceof Yh&&!tmt.test(n.expression);this._updatingAllCommands=i;let r=this._batchIds,o=r.length,s;for(s=0;s<o;++s){let a=r[s],c=t[a];c.color=l(e.color)?e.color.evaluateColor(c,Zht):Qht,c.show=l(e.show)?e.show.evaluate(c):emt}if(i){let a=this._batchedIndices;for(o=a.length,s=0;s<o;++s)a[s].color=z.clone(z.WHITE);this._updatingAllCommands=!1,this._batchDirty=!0}};bg.prototype.updateCommands=function(e,t){if(this._updatingAllCommands)return;let n=this._batchIdLookUp,i=n[e];if(!l(i))return;let r=this._indexOffsets,o=this._indexCounts,s=r[i],a=o[i],c=this._batchedIndices,u=c.length,f;for(f=0;f<u;++f){let y=c[f].offset,A=c[f].count;if(s>=y&&s<y+A)break}c.push(new Ag({color:z.clone(t),offset:s,count:a,batchIds:[e]}));let d=[],p=[],g=c[f].batchIds,m=g.length;for(let y=0;y<m;++y){let A=g[y];if(A===e)continue;let b=n[A];r[b]<s?d.push(A):p.push(A)}p.length!==0&&c.push(new Ag({color:z.clone(c[f].color),offset:s+a,count:c[f].offset+c[f].count-(s+a),batchIds:p})),d.length!==0?(c[f].count=s-c[f].offset,c[f].batchIds=d):c.splice(f,1),this._batchDirty=!0};function gTe(e,t,n,i){let r=e.classificationType,o=r!==Qn.CESIUM_3D_TILE,s=r!==Qn.TERRAIN,a=t.commandList,c=n.length,u,f;for(f=0;f<c;++f)o&&(u=n[f],u.pass=Ie.TERRAIN_CLASSIFICATION,a.push(u)),s&&(u=n[f].derivedCommands.tileset,u.pass=Ie.CESIUM_3D_TILE_CLASSIFICATION,a.push(u));if(!(!t.invertClassification||!l(i)))for(c=i.length,f=0;f<c;++f)a.push(i[f])}function nmt(e,t){let n=e.commandList,i=t.length;for(let r=0;r<i;r+=2){let o=t[r+1];o.pass=Ie.OPAQUE,n.push(o)}}function imt(e){let t=e.debugWireframe===e._debugWireframe;if(t=t&&!(e.debugWireframe&&e._wireframeDirty),t)return;l(e._rsWireframe)||(e._rsWireframe=Ge.fromCache({}));let n,i;e.debugWireframe?(n=e._rsWireframe,i=Oe.LINES):(n=e._rsColorPass,i=Oe.TRIANGLES);let r=e._commands,o=r.length;for(let s=0;s<o;s+=2){let a=r[s+1];a.renderState=n,a.primitiveType=i}e._debugWireframe=e.debugWireframe,e._wireframeDirty=!1}bg.prototype.update=function(e){let t=e.context;kht(this,t),Uht(this,t),jht(this),Hht(this,t);let n=e.passes;n.render&&(Xht(this,t),Kht(this,e),imt(this),this._debugWireframe?nmt(e,this._commands):gTe(this,e,this._commands,this._commandsIgnoreShow)),n.pick&&($ht(this),gTe(this,e,this._pickCommands))};bg.prototype.isDestroyed=function(){return!1};bg.prototype.destroy=function(){return this._va=this._va&&this._va.destroy(),this._sp=this._sp&&this._sp.destroy(),this._spPick=this._spPick&&this._spPick.destroy(),this._vaSwap=this._vaSwap&&this._vaSwap.destroy(),le(this)};var hS=bg;function Ef(e){this._boxes=e.boxes,this._boxBatchIds=e.boxBatchIds,this._cylinders=e.cylinders,this._cylinderBatchIds=e.cylinderBatchIds,this._ellipsoids=e.ellipsoids,this._ellipsoidBatchIds=e.ellipsoidBatchIds,this._spheres=e.spheres,this._sphereBatchIds=e.sphereBatchIds,this._modelMatrix=e.modelMatrix,this._batchTable=e.batchTable,this._boundingVolume=e.boundingVolume,this._center=e.center,l(this._center)||(l(this._boundingVolume)?this._center=h.clone(this._boundingVolume.center):this._center=h.clone(h.ZERO)),this._boundingVolumes=void 0,this._batchedIndices=void 0,this._indices=void 0,this._indexOffsets=void 0,this._indexCounts=void 0,this._positions=void 0,this._vertexBatchIds=void 0,this._batchIds=void 0,this._batchTableColors=void 0,this._packedBuffer=void 0,this._ready=!1,this._promise=void 0,this._error=void 0,this._verticesPromise=void 0,this._primitive=void 0,this.debugWireframe=!1,this.forceRebatch=!1,this.classificationType=Qn.BOTH}Object.defineProperties(Ef.prototype,{trianglesLength:{get:function(){return l(this._primitive)?this._primitive.trianglesLength:0}},geometryByteLength:{get:function(){return l(this._primitive)?this._primitive.geometryByteLength:0}},ready:{get:function(){return this._ready}}});Ef.packedBoxLength=M.packedLength+h.packedLength;Ef.packedCylinderLength=M.packedLength+2;Ef.packedEllipsoidLength=M.packedLength+h.packedLength;Ef.packedSphereLength=h.packedLength+1;function rmt(e){let t=new Float64Array(M.packedLength+h.packedLength),n=0;return h.pack(e._center,t,n),n+=h.packedLength,M.pack(e._modelMatrix,t,n),t}function omt(e,t){let n=0,i=t[n++],r=t[n++],o=e._boundingVolumes=new Array(r);for(let c=0;c<r;++c)o[c]=ue.unpack(t,n),n+=ue.packedLength;let s=t[n++],a=e._batchedIndices=new Array(s);for(let c=0;c<s;++c){let u=z.unpack(t,n);n+=z.packedLength;let f=t[n++],d=t[n++],p=t[n++],g=new Array(p);for(let m=0;m<p;++m)g[m]=t[n++];a[c]=new Ag({color:u,offset:f,count:d,batchIds:g})}return i}var smt=new $n("createVectorTileGeometries",5),amt=new z;function cmt(e){if(!l(e._primitive)&&!l(e._verticesPromise)){let t=e._boxes,n=e._boxBatchIds,i=e._cylinders,r=e._cylinderBatchIds,o=e._ellipsoids,s=e._ellipsoidBatchIds,a=e._spheres,c=e._sphereBatchIds,u=e._batchTableColors,f=e._packedBuffer;if(!l(u)){let m=0;l(e._boxes)&&(t=e._boxes=t.slice(),n=e._boxBatchIds=n.slice(),m+=n.length),l(e._cylinders)&&(i=e._cylinders=i.slice(),r=e._cylinderBatchIds=r.slice(),m+=r.length),l(e._ellipsoids)&&(o=e._ellipsoids=o.slice(),s=e._ellipsoidBatchIds=s.slice(),m+=s.length),l(e._spheres)&&(a=e._sphere=a.slice(),c=e._sphereBatchIds=c.slice(),m+=c.length),u=e._batchTableColors=new Uint32Array(m);let y=e._batchTable;for(let A=0;A<m;++A){let b=y.getColor(A,amt);u[A]=b.toRgba()}f=e._packedBuffer=rmt(e)}let d=[];l(t)&&d.push(t.buffer,n.buffer),l(i)&&d.push(i.buffer,r.buffer),l(o)&&d.push(o.buffer,s.buffer),l(a)&&d.push(a.buffer,c.buffer),d.push(u.buffer,f.buffer);let p={boxes:l(t)?t.buffer:void 0,boxBatchIds:l(t)?n.buffer:void 0,cylinders:l(i)?i.buffer:void 0,cylinderBatchIds:l(i)?r.buffer:void 0,ellipsoids:l(o)?o.buffer:void 0,ellipsoidBatchIds:l(o)?s.buffer:void 0,spheres:l(a)?a.buffer:void 0,sphereBatchIds:l(a)?c.buffer:void 0,batchTableColors:u.buffer,packedBuffer:f.buffer},g=e._verticesPromise=smt.scheduleTask(p,d);return l(g)?g.then(function(m){if(e.isDestroyed())return;let y=new Float64Array(m.packedBuffer);omt(e,y)===2?e._indices=new Uint16Array(m.indices):e._indices=new Uint32Array(m.indices),e._indexOffsets=new Uint32Array(m.indexOffsets),e._indexCounts=new Uint32Array(m.indexCounts),e._positions=new Float32Array(m.positions),e._vertexBatchIds=new Uint16Array(m.vertexBatchIds),e._batchIds=new Uint16Array(m.batchIds),lmt(e),e._ready=!0}).catch(m=>{e.isDestroyed()||(e._error=m)}):void 0}}function lmt(e){l(e._primitive)||(e._primitive=new hS({batchTable:e._batchTable,positions:e._positions,batchIds:e._batchIds,vertexBatchIds:e._vertexBatchIds,indices:e._indices,indexOffsets:e._indexOffsets,indexCounts:e._indexCounts,batchedIndices:e._batchedIndices,boundingVolume:e._boundingVolume,boundingVolumes:e._boundingVolumes,center:e._center,pickObject:e._pickObject??e}),e._boxes=void 0,e._boxBatchIds=void 0,e._cylinders=void 0,e._cylinderBatchIds=void 0,e._ellipsoids=void 0,e._ellipsoidBatchIds=void 0,e._spheres=void 0,e._sphereBatchIds=void 0,e._center=void 0,e._modelMatrix=void 0,e._batchTable=void 0,e._boundingVolume=void 0,e._boundingVolumes=void 0,e._batchedIndices=void 0,e._indices=void 0,e._indexOffsets=void 0,e._indexCounts=void 0,e._positions=void 0,e._vertexBatchIds=void 0,e._batchIds=void 0,e._batchTableColors=void 0,e._packedBuffer=void 0,e._verticesPromise=void 0)}Ef.prototype.createFeatures=function(e,t){this._primitive.createFeatures(e,t)};Ef.prototype.applyDebugSettings=function(e,t){this._primitive.applyDebugSettings(e,t)};Ef.prototype.applyStyle=function(e,t){this._primitive.applyStyle(e,t)};Ef.prototype.updateCommands=function(e,t){this._primitive.updateCommands(e,t)};Ef.prototype.update=function(e){if(!this._ready){if(l(this._promise)||(this._promise=cmt(this)),l(this._error)){let t=this._error;throw this._error=void 0,t}return}this._primitive.debugWireframe=this.debugWireframe,this._primitive.forceRebatch=this.forceRebatch,this._primitive.classificationType=this.classificationType,this._primitive.update(e)};Ef.prototype.isDestroyed=function(){return!1};Ef.prototype.destroy=function(){return this._primitive=this._primitive&&this._primitive.destroy(),le(this)};var ky=Ef;var AQ=class{constructor(t,n,i,r,o){this._tileset=t,this._tile=n,this._resource=i,this._geometries=void 0,this._metadata=void 0,this._batchTable=void 0,this._features=void 0,this.featurePropertiesDirty=!1,this._group=void 0,this._ready=!1,dmt(this,r,o)}get featuresLength(){return l(this._batchTable)?this._batchTable.featuresLength:0}get pointsLength(){return 0}get trianglesLength(){return l(this._geometries)?this._geometries.trianglesLength:0}get geometryByteLength(){return l(this._geometries)?this._geometries.geometryByteLength:0}get texturesByteLength(){return 0}get batchTableByteLength(){return l(this._batchTable)?this._batchTable.batchTableByteLength:0}get innerContents(){}get ready(){return this._ready}get tileset(){return this._tileset}get tile(){return this._tile}get url(){return this._resource.getUrlComponent(!0)}get metadata(){return this._metadata}set metadata(t){this._metadata=t}get batchTable(){return this._batchTable}get group(){return this._group}set group(t){this._group=t}hasProperty(t,n){return this._batchTable.hasProperty(t,n)}getFeature(t){return _Te(this),this._features[t]}applyDebugSettings(t,n){l(this._geometries)&&this._geometries.applyDebugSettings(t,n)}applyStyle(t){_Te(this),l(this._geometries)&&this._geometries.applyStyle(t,this._features)}update(t,n){l(this._geometries)&&(this._geometries.classificationType=this._tileset.classificationType,this._geometries.debugWireframe=this._tileset.debugWireframe,this._geometries.update(n)),l(this._batchTable)&&this._geometries.ready&&(this._batchTable.update(t,n),this._ready=!0)}pick(t,n,i){}isDestroyed(){return!1}destroy(){return this._geometries=this._geometries&&this._geometries.destroy(),this._batchTable=this._batchTable&&this._batchTable.destroy(),le(this)}};function umt(e){return function(t,n){l(e._geometries)&&e._geometries.updateCommands(t,n)}}function fmt(e,t){let n,i,r,o,s,a=e.BOXES_LENGTH??0,c=e.CYLINDERS_LENGTH??0,u=e.ELLIPSOIDS_LENGTH??0,f=e.SPHERES_LENGTH??0;if(a>0&&l(e.BOX_BATCH_IDS)){let m=t.byteOffset+e.BOX_BATCH_IDS.byteOffset;n=new Uint16Array(t.buffer,m,a)}if(c>0&&l(e.CYLINDER_BATCH_IDS)){let m=t.byteOffset+e.CYLINDER_BATCH_IDS.byteOffset;i=new Uint16Array(t.buffer,m,c)}if(u>0&&l(e.ELLIPSOID_BATCH_IDS)){let m=t.byteOffset+e.ELLIPSOID_BATCH_IDS.byteOffset;r=new Uint16Array(t.buffer,m,u)}if(f>0&&l(e.SPHERE_BATCH_IDS)){let m=t.byteOffset+e.SPHERE_BATCH_IDS.byteOffset;o=new Uint16Array(t.buffer,m,f)}let d=l(n)||l(i)||l(r)||l(o),p=a>0&&!l(n)||c>0&&!l(i)||u>0&&!l(r)||f>0&&!l(o);if(d&&p)throw new oe("If one group of batch ids is defined, then all batch ids must be defined");if(!l(n)&&!l(i)&&!l(r)&&!l(o)){let m=0;if(!l(n)&&a>0)for(n=new Uint16Array(a),s=0;s<a;++s)n[s]=m++;if(!l(i)&&c>0)for(i=new Uint16Array(c),s=0;s<c;++s)i[s]=m++;if(!l(r)&&u>0)for(r=new Uint16Array(u),s=0;s<u;++s)r[s]=m++;if(!l(o)&&f>0)for(o=new Uint16Array(f),s=0;s<f;++s)o[s]=m++}return{boxes:n,cylinders:i,ellipsoids:r,spheres:o}}var Nx=Uint32Array.BYTES_PER_ELEMENT;function dmt(e,t,n){n=n??0;let i=new Uint8Array(t),r=new DataView(t);n+=Nx;let o=r.getUint32(n,!0);if(o!==1)throw new oe(`Only Geometry tile version 1 is supported. Version ${o} is not.`);n+=Nx;let s=r.getUint32(n,!0);if(n+=Nx,s===0){e._ready=!0;return}let a=r.getUint32(n,!0);if(n+=Nx,a===0)throw new oe("Feature table must have a byte length greater than zero");let c=r.getUint32(n,!0);n+=Nx;let u=r.getUint32(n,!0);n+=Nx;let f=r.getUint32(n,!0);n+=Nx;let d=Fo(i,n,a);n+=a;let p=new Uint8Array(t,n,c);n+=c;let g,m;u>0&&(g=Fo(i,n,u),n+=u,f>0&&(m=new Uint8Array(t,n,f),m=new Uint8Array(m)));let y=d.BOXES_LENGTH??0,A=d.CYLINDERS_LENGTH??0,b=d.ELLIPSOIDS_LENGTH??0,x=d.SPHERES_LENGTH??0,T=y+A+b+x,E=new vp(e,T,g,m,umt(e));if(e._batchTable=E,T===0)return;let v=e.tile.computedTransform,S;l(d.RTC_CENTER)&&(S=h.unpack(d.RTC_CENTER),M.multiplyByPoint(v,S,S));let I=fmt(d,p);if(y>0||A>0||b>0||x>0){let R,O,L,_;if(y>0){let C=p.byteOffset+d.BOXES.byteOffset;R=new Float32Array(p.buffer,C,ky.packedBoxLength*y)}if(A>0){let C=p.byteOffset+d.CYLINDERS.byteOffset;O=new Float32Array(p.buffer,C,ky.packedCylinderLength*A)}if(b>0){let C=p.byteOffset+d.ELLIPSOIDS.byteOffset;L=new Float32Array(p.buffer,C,ky.packedEllipsoidLength*b)}if(x>0){let C=p.byteOffset+d.SPHERES.byteOffset;_=new Float32Array(p.buffer,C,ky.packedSphereLength*x)}return e._geometries=new ky({boxes:R,boxBatchIds:I.boxes,cylinders:O,cylinderBatchIds:I.cylinders,ellipsoids:L,ellipsoidBatchIds:I.ellipsoids,spheres:_,sphereBatchIds:I.spheres,center:S,modelMatrix:v,batchTable:E,boundingVolume:e.tile.boundingVolume.boundingVolume}),e}return Promise.resolve(e)}function _Te(e){let t=e.featuresLength;if(!l(e._features)&&t>0){let n=new Array(t);l(e._geometries)&&e._geometries.createFeatures(e,n),e._features=n}}var o8=AQ;var bQ={};bQ.encode2D=function(e,t,n){let i=Math.pow(2,e),r={x:t,y:n},o,s,a,c=BigInt(0);for(a=i/2;a>0;a/=2)o=(r.x&a)>0?1:0,s=(r.y&a)>0?1:0,c+=BigInt((3*o^s)*a*a),yTe(i,r,o,s);return c};bQ.decode2D=function(e,t){let n=Math.pow(2,e),i={x:0,y:0},r,o,s,a;for(s=1,a=t;s<n;s*=2)r=1&Number(a/BigInt(2)),o=1&Number(a^BigInt(r)),yTe(s,i,r,o),i.x+=s*r,i.y+=s*o,a/=BigInt(4);return[i.x,i.y]};function yTe(e,t,n,i){if(i!==0)return;n===1&&(t.x=e-1-t.x,t.y=e-1-t.y);let r=t.x;t.x=t.y,t.y=r}var N1=bQ;var Lx=30,hmt=1<<Lx,mmt=1<<Lx+1>>>0,xQ=2*Lx+1,Uy=4,xTe=[],TTe=[],pmt=[[0,1,3,2],[0,2,3,1],[3,2,0,1],[3,1,0,2]],zy=1,mS=2,s8=[zy,0,0,zy|mS];function Ls(e){if(!dn.supportsBigInt())throw new oe("S2 required BigInt support");this._cellId=e,this._level=Ls.getLevel(e)}Ls.fromToken=function(e){return new Ls(Ls.getIdFromToken(e))};Ls.isValidId=function(e){return!(e<=0||e>>BigInt(xQ)>5||!(e&~e+BigInt(1)&BigInt("0x1555555555555555")))};Ls.isValidToken=function(e){return/^[0-9a-fA-F]{1,16}$/.test(e)?Ls.isValidId(Ls.getIdFromToken(e)):!1};Ls.getIdFromToken=function(e){return BigInt("0x"+e+"0".repeat(16-e.length))};Ls.getTokenFromId=function(e){let t=Math.floor(vmt(e)/4),n=e.toString(16).replace(/0*$/,"");return Array(17-t-n.length).join("0")+n};Ls.getLevel=function(e){let t=0;for(;e!==BigInt(0)&&!(e&BigInt(1));)t++,e=e>>BigInt(1);return Lx-(t>>1)};Ls.prototype.getChild=function(e){let t=vTe(this._cellId)>>BigInt(2),n=this._cellId+BigInt(2*e+1-4)*t;return new Ls(n)};Ls.prototype.getParent=function(){let e=vTe(this._cellId)<<BigInt(2);return new Ls(this._cellId&~e+BigInt(1)|e)};Ls.prototype.getParentAtLevel=function(e){let t=Emt(e);return new Ls(this._cellId&-t|t)};Ls.prototype.getCenter=function(e){e=e??ee.WGS84;let t=gmt(this._cellId,this._level);t=h.normalize(t,t);let n=he.fromCartesian(t,ee.UNIT_SPHERE);return he.toCartesian(n,e,new h)};Ls.prototype.getVertex=function(e,t){t=t??ee.WGS84;let n=_mt(this._cellId,this._level,e);n=h.normalize(n,n);let i=he.fromCartesian(n,ee.UNIT_SPHERE);return he.toCartesian(i,t,new h)};Ls.fromFacePositionLevel=function(e,t,n){let i=(e<4?"0":"")+(e<2?"0":"")+e.toString(2),r=t.toString(2),o=Array(2*n-r.length+1).join("0"),s=Array(xQ-2*n).join("0"),a=BigInt(`0b${i}${o}${r}1${s}`);return new Ls(a)};function gmt(e,t){let n=ymt(e,t);return Amt(n[0],n[1],n[2])}function _mt(e,t,n){let i=ETe(e,t),r=bmt([i[1],i[2]],t),o=n>>1&1;return CTe(i[0],r[0][o^n&1],r[1][o])}function ymt(e,t){let n=ETe(e),i=n[0],r=n[1],o=n[2],s=t===30,a=!s&&(BigInt(r)^e>>BigInt(2))&BigInt(1),c=s?1:a?2:0,u=(r<<1)+c,f=(o<<1)+c;return[i,u,f]}function ETe(e){xTe.length===0&&Tmt();let t=Number(e>>BigInt(xQ)),n=t&zy,i=(1<<Uy)-1,r=0,o=0;for(let s=7;s>=0;s--){let c=(1<<2*(s===7?Lx-7*Uy:Uy))-1;n+=Number(e>>BigInt(s*2*Uy+1)&BigInt(c))<<2,n=TTe[n];let u=s*Uy;r+=n>>Uy+2<<u,o+=(n>>2&i)<<u,n&=zy|mS}return[t,r,o]}function Amt(e,t,n){let i=ATe(t),r=ATe(n),o=a8(i),s=a8(r);return CTe(e,o,s)}function CTe(e,t,n){switch(e){case 0:return new h(1,t,n);case 1:return new h(-t,1,n);case 2:return new h(-t,-n,1);case 3:return new h(-1,-n,-t);case 4:return new h(n,-1,-t);default:return new h(n,t,-1)}}function a8(e){return e>=.5?1/3*(4*e*e-1):1/3*(1-4*(1-e)*(1-e))}function ATe(e){return 1/mmt*e}function bmt(e,t){let n=[[],[]],i=xmt(t);for(let r=0;r<2;++r){let o=e[r]&-i,s=o+i;n[r][0]=a8(bTe(o)),n[r][1]=a8(bTe(s))}return n}function xmt(e){return 1<<Lx-e>>>0}function bTe(e){return 1/hmt*e}function Vy(e,t,n,i,r,o){if(e===Uy){let s=(t<<Uy)+n;xTe[(s<<2)+i]=(r<<2)+o,TTe[(r<<2)+i]=(s<<2)+o}else{e++,t<<=1,n<<=1,r<<=2;let s=pmt[o];Vy(e,t+(s[0]>>1),n+(s[0]&1),i,r,o^s8[0]),Vy(e,t+(s[1]>>1),n+(s[1]&1),i,r+1,o^s8[1]),Vy(e,t+(s[2]>>1),n+(s[2]&1),i,r+2,o^s8[2]),Vy(e,t+(s[3]>>1),n+(s[3]&1),i,r+3,o^s8[3])}}function Tmt(){Vy(0,0,0,0,0,0),Vy(0,0,0,zy,0,zy),Vy(0,0,0,mS,0,mS),Vy(0,0,0,zy|mS,0,zy|mS)}function vTe(e){return e&~e+BigInt(1)}function Emt(e){return BigInt(1)<<BigInt(2*(Lx-e))}var Cmt=[64,0,1,39,2,15,40,23,3,12,16,59,41,19,24,54,4,64,13,10,17,62,60,28,42,30,20,51,25,44,55,47,5,32,65,38,14,22,11,58,18,53,63,9,61,27,29,50,43,46,31,37,21,57,52,8,26,49,45,36,56,7,48,35,6,34,33,0];function vmt(e){return Cmt[(-e&e)%BigInt(67)]}var jy=Ls;function TQ(e){let t=e.lengthBits,n=e.availableCount,i=e.constant,r=e.bitstream;if(l(i))n=t;else{let o=Math.ceil(t/8);if(r.length!==o)throw new oe(`Availability bitstream must be exactly ${o} bytes long to store ${t} bits. Actual bitstream was ${r.length} bytes long.`);let s=e.computeAvailableCountEnabled??!1;!l(n)&&s&&(n=Smt(r,t))}this._lengthBits=t,this._availableCount=n,this._constant=i,this._bitstream=r}function Smt(e,t){let n=0;for(let i=0;i<t;i++){let r=i>>3,o=i%8;n+=e[r]>>o&1}return n}Object.defineProperties(TQ.prototype,{lengthBits:{get:function(){return this._lengthBits}},availableCount:{get:function(){return this._availableCount}}});TQ.prototype.getBit=function(e){if(l(this._constant))return this._constant;let t=e>>3,n=e%8;return(this._bitstream[t]>>n&1)===1};var L1=TQ;function xg(e){e=e??H.EMPTY_OBJECT;let t=e.metadataTable,n=e.class,i=e.entityId,r=e.propertyTableJson;this._class=n,this._metadataTable=t,this._entityId=i,this._extensions=r.extensions,this._extras=r.extras}Object.defineProperties(xg.prototype,{class:{get:function(){return this._class}},extras:{get:function(){return this._extras}},extensions:{get:function(){return this._extensions}}});xg.prototype.hasProperty=function(e){return this._metadataTable.hasProperty(e)};xg.prototype.hasPropertyBySemantic=function(e){return this._metadataTable.hasPropertyBySemantic(e)};xg.prototype.getPropertyIds=function(e){return this._metadataTable.getPropertyIds(e)};xg.prototype.getProperty=function(e){return this._metadataTable.getProperty(this._entityId,e)};xg.prototype.setProperty=function(e,t){return this._metadataTable.setProperty(this._entityId,e,t)};xg.prototype.getPropertyBySemantic=function(e){return this._metadataTable.getPropertyBySemantic(this._entityId,e)};xg.prototype.setPropertyBySemantic=function(e,t){return this._metadataTable.setPropertyBySemantic(this._entityId,e,t)};var F1=xg;var B1={QUADTREE:"QUADTREE",OCTREE:"OCTREE"};B1.getBranchingFactor=function(e){switch(e){case B1.OCTREE:return 8;case B1.QUADTREE:return 4}};Object.freeze(B1);var $s=B1;function Tg(e){e=e??H.EMPTY_OBJECT;let t=e.subtreeMetadata,n=e.class,i=l(t.properties)?t.properties:{};this._class=n,this._properties=i,this._extras=t.extras,this._extensions=t.extensions}Object.defineProperties(Tg.prototype,{class:{get:function(){return this._class}},extras:{get:function(){return this._extras}},extensions:{get:function(){return this._extensions}}});Tg.prototype.hasProperty=function(e){return Xn.hasProperty(e,this._properties,this._class)};Tg.prototype.hasPropertyBySemantic=function(e){return Xn.hasPropertyBySemantic(e,this._properties,this._class)};Tg.prototype.getPropertyIds=function(e){return Xn.getPropertyIds(this._properties,this._class,e)};Tg.prototype.getProperty=function(e){return Xn.getProperty(e,this._properties,this._class)};Tg.prototype.setProperty=function(e,t){return Xn.setProperty(e,t,this._properties,this._class)};Tg.prototype.getPropertyBySemantic=function(e){return Xn.getPropertyBySemantic(e,this._properties,this._class)};Tg.prototype.setPropertyBySemantic=function(e,t){return Xn.setPropertyBySemantic(e,t,this._properties,this._class)};var c8=Tg;function rc(e,t,n){this._resource=e,this._subtreeJson=void 0,this._bufferLoader=void 0,this._tileAvailability=void 0,this._contentAvailabilityBitstreams=[],this._childSubtreeAvailability=void 0,this._implicitCoordinates=n,this._subtreeLevels=t.subtreeLevels,this._subdivisionScheme=t.subdivisionScheme,this._branchingFactor=t.branchingFactor,this._metadata=void 0,this._tileMetadataTable=void 0,this._tilePropertyTableJson=void 0,this._contentMetadataTables=[],this._contentPropertyTableJsons=[],this._tileJumpBuffer=void 0,this._contentJumpBuffers=[],this._ready=!1}Object.defineProperties(rc.prototype,{ready:{get:function(){return this._ready}},metadata:{get:function(){return this._metadata}},tileMetadataTable:{get:function(){return this._tileMetadataTable}},tilePropertyTableJson:{get:function(){return this._tilePropertyTableJson}},contentMetadataTables:{get:function(){return this._contentMetadataTables}},contentPropertyTableJsons:{get:function(){return this._contentPropertyTableJsons}},implicitCoordinates:{get:function(){return this._implicitCoordinates}}});rc.prototype.tileIsAvailableAtIndex=function(e){return this._tileAvailability.getBit(e)};rc.prototype.tileIsAvailableAtCoordinates=function(e){let t=this.getTileIndex(e);return this.tileIsAvailableAtIndex(t)};rc.prototype.contentIsAvailableAtIndex=function(e,t){return t=t??0,this._contentAvailabilityBitstreams[t].getBit(e)};rc.prototype.contentIsAvailableAtCoordinates=function(e,t){let n=this.getTileIndex(e);return this.contentIsAvailableAtIndex(n,t)};rc.prototype.childSubtreeIsAvailableAtIndex=function(e){return this._childSubtreeAvailability.getBit(e)};rc.prototype.childSubtreeIsAvailableAtCoordinates=function(e){let t=this.getChildSubtreeIndex(e);return this.childSubtreeIsAvailableAtIndex(t)};rc.prototype.getLevelOffset=function(e){let t=this._branchingFactor;return(Math.pow(t,e)-1)/(t-1)};rc.prototype.getParentMortonIndex=function(e){let t=2;return this._subdivisionScheme===$s.OCTREE&&(t=3),e>>t};rc.fromSubtreeJson=async function(e,t,n,i,r){let o=new rc(e,i,r),s;l(t)?s={json:t,binary:void 0}:s=wmt(n);let a=s.json;o._subtreeJson=a;let c;if(lr(a,"3DTILES_metadata"))c=a.extensions["3DTILES_metadata"];else if(l(a.tileMetadata)){let x=a.tileMetadata;c=a.propertyTables[x]}let u=[];if(l(a.contentMetadata)){let x=a.contentMetadata.length;for(let T=0;T<x;T++){let E=a.contentMetadata[T];u.push(a.propertyTables[E])}}let f,d=i.metadataSchema,p=a.subtreeMetadata;if(l(p)){let x=p.class,T=d.classes[x];f=new c8({subtreeMetadata:p,class:T})}o._metadata=f,o._tilePropertyTableJson=c,o._contentPropertyTableJsons=u;let g={constant:0};a.contentAvailabilityHeaders=[],lr(a,"3DTILES_multiple_contents")?a.contentAvailabilityHeaders=a.extensions["3DTILES_multiple_contents"].contentAvailability:Array.isArray(a.contentAvailability)?a.contentAvailabilityHeaders=a.contentAvailability:a.contentAvailabilityHeaders.push(a.contentAvailability??g);let m=Imt(a.buffers),y=Pmt(a.bufferViews,m);Dmt(a,y),l(c)&&STe(c,y);for(let x=0;x<u.length;x++){let T=u[x];STe(T,y)}let A=await Rmt(o,m,s.binary),b=Mmt(y,A);return Nmt(o,a,i,b),l(c)&&(Lmt(o,i,b),Bmt(o)),Fmt(o,i,b),kmt(o),o._ready=!0,o};function wmt(e){let n=new DataView(e.buffer,e.byteOffset),i=8,r=n.getUint32(i,!0);i+=8;let o=n.getUint32(i,!0);i+=8;let s=Fo(e,i,r);i+=r;let a=e.subarray(i,i+o);return{json:s,binary:a}}function Imt(e){e=l(e)?e:[];for(let t=0;t<e.length;t++){let n=e[t];n.isExternal=l(n.uri),n.isActive=!1}return e}function Pmt(e,t){e=l(e)?e:[];for(let n=0;n<e.length;n++){let i=e[n],r=t[i.buffer];i.bufferHeader=r,i.isActive=!1}return e}function Dmt(e,t){let n,i=e.tileAvailability;l(i.bitstream)?n=t[i.bitstream]:l(i.bufferView)&&(n=t[i.bufferView]),l(n)&&(n.isActive=!0,n.bufferHeader.isActive=!0);let r=e.contentAvailabilityHeaders;for(let s=0;s<r.length;s++)n=void 0,l(r[s].bitstream)?n=t[r[s].bitstream]:l(r[s].bufferView)&&(n=t[r[s].bufferView]),l(n)&&(n.isActive=!0,n.bufferHeader.isActive=!0);n=void 0;let o=e.childSubtreeAvailability;l(o.bitstream)?n=t[o.bitstream]:l(o.bufferView)&&(n=t[o.bufferView]),l(n)&&(n.isActive=!0,n.bufferHeader.isActive=!0)}function STe(e,t){let n=e.properties,i;for(let r in n)if(n.hasOwnProperty(r)){let o=n[r],s=o.values??o.bufferView;i=t[s],i.isActive=!0,i.bufferHeader.isActive=!0;let a=o.stringOffsets??o.stringOffsetBufferView;l(a)&&(i=t[a],i.isActive=!0,i.bufferHeader.isActive=!0);let c=o.arrayOffsets??o.arrayOffsetBufferView;l(c)&&(i=t[c],i.isActive=!0,i.bufferHeader.isActive=!0)}}function Rmt(e,t,n){let i=[];for(let r=0;r<t.length;r++){let o=t[r];if(!o.isActive)i.push(Promise.resolve(void 0));else if(o.isExternal){let s=Omt(e,o);i.push(s)}else i.push(Promise.resolve(n))}return Promise.all(i).then(function(r){let o={};for(let s=0;s<r.length;s++){let a=r[s];l(a)&&(o[s]=a)}return o})}async function Omt(e,t){let i=e._resource.getDerivedResource({url:t.uri}),r=ki.getExternalBufferLoader({resource:i});e._bufferLoader=r;try{await r.load()}catch(o){if(r.isDestroyed())return;throw o}return r.typedArray}function Mmt(e,t){let n={};for(let i=0;i<e.length;i++){let r=e[i];if(!r.isActive)continue;let o=r.byteOffset,s=o+r.byteLength,c=t[r.buffer].subarray(o,s);n[i]=c}return n}function Nmt(e,t,n,i){let r=n.branchingFactor,o=n.subtreeLevels,s=(Math.pow(r,o)-1)/(r-1),a=Math.pow(r,o),c=lr(t,"3DTILES_metadata"),u=l(e._tilePropertyTableJson),f=c||u;e._tileAvailability=EQ(t.tileAvailability,i,s,f);let d=e._contentPropertyTableJsons.length>0;f=f||d;for(let p=0;p<t.contentAvailabilityHeaders.length;p++){let g=EQ(t.contentAvailabilityHeaders[p],i,s,f);e._contentAvailabilityBitstreams.push(g)}e._childSubtreeAvailability=EQ(t.childSubtreeAvailability,i,a)}function EQ(e,t,n,i){if(l(e.constant))return new L1({constant:!!e.constant,lengthBits:n,availableCount:e.availableCount});let r;return l(e.bitstream)?r=t[e.bitstream]:l(e.bufferView)&&(r=t[e.bufferView]),new L1({bitstream:r,lengthBits:n,availableCount:e.availableCount,computeAvailableCountEnabled:i})}function Lmt(e,t,n){let i=e._tilePropertyTableJson,r=e._tileAvailability.availableCount,o=t.metadataSchema,s=i.class,a=o.classes[s];e._tileMetadataTable=new zh({class:a,count:r,properties:i.properties,bufferViews:n})}function Fmt(e,t,n){let i=e._contentPropertyTableJsons,r=e._contentAvailabilityBitstreams,o=t.metadataSchema,s=e._contentMetadataTables;for(let a=0;a<i.length;a++){let c=i[a],f=r[a].availableCount,d=c.class,p=o.classes[d],g=new zh({class:p,count:f,properties:c.properties,bufferViews:n});s.push(g)}}function wTe(e){let t=0,n=e.lengthBits,i=e.availableCount,r;i<256?r=new Uint8Array(n):i<65536?r=new Uint16Array(n):r=new Uint32Array(n);for(let o=0;o<e.lengthBits;o++)e.getBit(o)&&(r[o]=t,t++);return r}function Bmt(e){let t=wTe(e._tileAvailability);e._tileJumpBuffer=t}function kmt(e){let t=e._contentJumpBuffers,n=e._contentAvailabilityBitstreams;for(let i=0;i<n.length;i++){let r=n[i],o=wTe(r);t.push(o)}}rc.prototype.getTileIndex=function(e){let t=e.level-this._implicitCoordinates.level;if(t<0||this._subtreeLevels<=t)throw new oe("level is out of bounds for this subtree");return e.getSubtreeCoordinates().getOffsetCoordinates(e).tileIndex};rc.prototype.getChildSubtreeIndex=function(e){if(e.level-this._implicitCoordinates.level!==this._implicitCoordinates.subtreeLevels)throw new oe("level is out of bounds for this subtree");return e.getParentSubtreeCoordinates().getOffsetCoordinates(e).mortonIndex};function Umt(e,t){if(!l(e._tileMetadataTable))return;let n=e.getTileIndex(t);if(e._tileAvailability.getBit(n))return e._tileJumpBuffer[n]}function zmt(e,t,n){let i=e._contentMetadataTables;if(!l(i))return;let r=i[n];if(!l(r))return;let o=e._contentAvailabilityBitstreams[n],s=e.getTileIndex(t);if(o.getBit(s))return e._contentJumpBuffers[n][s]}rc.prototype.getTileMetadataView=function(e){let t=Umt(this,e);if(!l(t))return;let n=this._tileMetadataTable;return new F1({class:n.class,metadataTable:n,entityId:t,propertyTableJson:this._tilePropertyTableJson})};rc.prototype.getContentMetadataView=function(e,t){let n=zmt(this,e,t);if(!l(n))return;let i=this._contentMetadataTables[t],r=this._contentPropertyTableJsons[t];return new F1({class:i.class,metadataTable:i,entityId:n,contentIndex:t,propertyTableJson:r})};rc.prototype.isDestroyed=function(){return!1};rc.prototype.destroy=function(){return l(this._bufferLoader)&&ki.unload(this._bufferLoader),le(this)};var Hy=rc;var ITe={ID:"ID",NAME:"NAME",DESCRIPTION:"DESCRIPTION",TILESET_TILE_COUNT:"TILESET_TILE_COUNT",TILE_BOUNDING_BOX:"TILE_BOUNDING_BOX",TILE_BOUNDING_REGION:"TILE_BOUNDING_REGION",TILE_BOUNDING_SPHERE:"TILE_BOUNDING_SPHERE",TILE_MINIMUM_HEIGHT:"TILE_MINIMUM_HEIGHT",TILE_MAXIMUM_HEIGHT:"TILE_MAXIMUM_HEIGHT",TILE_HORIZON_OCCLUSION_POINT:"TILE_HORIZON_OCCLUSION_POINT",TILE_GEOMETRIC_ERROR:"TILE_GEOMETRIC_ERROR",CONTENT_BOUNDING_BOX:"CONTENT_BOUNDING_BOX",CONTENT_BOUNDING_REGION:"CONTENT_BOUNDING_REGION",CONTENT_BOUNDING_SPHERE:"CONTENT_BOUNDING_SPHERE",CONTENT_MINIMUM_HEIGHT:"CONTENT_MINIMUM_HEIGHT",CONTENT_MAXIMUM_HEIGHT:"CONTENT_MAXIMUM_HEIGHT",CONTENT_HORIZON_OCCLUSION_POINT:"CONTENT_HORIZON_OCCLUSION_POINT"};Object.freeze(ITe);var Xh=ITe;var Gy={};Gy.parseAllBoundingVolumeSemantics=function(e,t){return{boundingVolume:Gy.parseBoundingVolumeSemantic(e,t),minimumHeight:Gy._parseMinimumHeight(e,t),maximumHeight:Gy._parseMaximumHeight(e,t)}};Gy.parseBoundingVolumeSemantic=function(e,t){let n=`${e}_BOUNDING_BOX`,i=t.getPropertyBySemantic(n);if(l(i))return{box:i};let r=`${e}_BOUNDING_REGION`,o=t.getPropertyBySemantic(r);if(l(o))return{region:o};let s=`${e}_BOUNDING_SPHERE`,a=t.getPropertyBySemantic(s);if(l(a))return{sphere:a}};Gy._parseMinimumHeight=function(e,t){let n=`${e}_MINIMUM_HEIGHT`;return t.getPropertyBySemantic(n)};Gy._parseMaximumHeight=function(e,t){let n=`${e}_MAXIMUM_HEIGHT`;return t.getPropertyBySemantic(n)};var Fx=Gy;var pS=class e{constructor(t,n,i){let r=n.implicitTileset,o=n.implicitCoordinates;this._implicitTileset=r,this._implicitCoordinates=o,this._implicitSubtree=void 0,this._tileset=t,this._tile=n,this._resource=i,this._metadata=void 0,this.featurePropertiesDirty=!1,this._group=void 0;let s=o.getTemplateValues(),a=r.subtreeUriTemplate.getDerivedResource({templateValues:s});this._url=a.getUrlComponent(!0),this._ready=!1}get featuresLength(){return 0}get pointsLength(){return 0}get trianglesLength(){return 0}get geometryByteLength(){return 0}get texturesByteLength(){return 0}get batchTableByteLength(){return 0}get innerContents(){}get ready(){return this._ready}get tileset(){return this._tileset}get tile(){return this._tile}get url(){return this._url}get metadata(){}set metadata(t){}get batchTable(){}get group(){return this._group}set group(t){this._group=t}static async fromSubtreeJson(t,n,i,r,o,s){s=s??0;let a;l(o)&&(a=new Uint8Array(o,s));let c=n.implicitTileset,u=n.implicitCoordinates,f=await Hy.fromSubtreeJson(i,r,a,c,u),d=new e(t,n,i);return d._implicitSubtree=f,Vmt(d,f),d._ready=!0,d}hasProperty(t,n){return!1}getFeature(t){}applyDebugSettings(t,n){}applyStyle(t){}update(t,n){}pick(t,n,i){}isDestroyed(){return!1}destroy(){return this._implicitSubtree=this._implicitSubtree&&this._implicitSubtree.destroy(),le(this)}};function Vmt(e,t){let n=e._tile,i=e._implicitCoordinates.childIndex,r=Hmt(e,t,n,i),o=e._tileset.statistics;n.children.push(r.rootTile),o.numberOfTilesTotal++;let s=jmt(e,t,r.bottomRow);for(let a=0;a<s.length;a++){let c=s[a],u=c.tile,f=Zmt(e,u,c.childIndex);u.children.push(f),o.numberOfTilesTotal++}}function jmt(e,t,n){let i=[],r=e._implicitTileset.branchingFactor;for(let o=0;o<n.length;o++){let s=n[o];if(l(s))for(let a=0;a<r;a++){let c=o*r+a;t.childSubtreeIsAvailableAtIndex(c)&&i.push({tile:s,childIndex:a})}}return i}function Hmt(e,t,n,i){let s=PTe(e,t,n,i,0,!0),a=e._tileset.statistics,c=[s],u=[],f=e._implicitTileset;for(let d=1;d<f.subtreeLevels;d++){let p=t.getLevelOffset(d),g=f.branchingFactor*c.length;for(let m=0;m<g;m++){let y=p+m;if(!t.tileIsAvailableAtIndex(y)){u.push(void 0);continue}let A=t.getParentMortonIndex(m),b=c[A],x=m%f.branchingFactor,T=PTe(e,t,b,x,y);b.children.push(T),a.numberOfTilesTotal++,u.push(T)}c=u,u=[]}return{rootTile:s,bottomRow:c}}function DTe(e,t,n){let i=Xh.TILE_GEOMETRIC_ERROR;return l(e)&&e.hasPropertyBySemantic(i)?e.getPropertyBySemantic(i):t.geometricError/Math.pow(2,n.level)}function PTe(e,t,n,i,r,o){let s=e._implicitTileset,a;o??!1?a=n.implicitCoordinates:a=n.implicitCoordinates.getChildCoordinates(i);let c,u;l(t.tilePropertyTableJson)&&(c=t.getTileMetadataView(a),u=Fx.parseAllBoundingVolumeSemantics("TILE",c));let d=t.contentPropertyTableJsons.length,p=!1;for(let v=0;v<d;v++)if(t.contentIsAvailableAtCoordinates(a,v)){p=!0;break}let g=qmt(s,a,i,o,n,u),m=[];for(let v=0;v<s.contentCount;v++){if(!t.contentIsAvailableAtIndex(r,v))continue;let R={uri:s.contentUriTemplates[v].getDerivedResource({templateValues:a.getTemplateValues()}).url},O;if(t.contentPropertyTableJsons.length>0){let _=t.getContentMetadataView(a,v);O=Fx.parseAllBoundingVolumeSemantics("CONTENT",_)}let L=Ymt(g,O);l(L)&&(R.boundingVolume=L),m.push(Mt(R,s.contentHeaders[v]))}let y=DTe(c,s,a),A={boundingVolume:g,geometricError:y,refine:s.refine,contents:m},b=!0,x=Ze(s.tileHeader,b);delete x.boundingVolume,delete x.transform,delete x.metadata;let T=Mt(A,x,b),E=LTe(e,s.baseResource,T,n);return E.implicitCoordinates=a,E.implicitSubtree=t,E.metadata=c,E.hasImplicitContentMetadata=p,E}function l8(e,t){return l(e)&&l(t)&&(l(t.minimumHeight)||l(t.maximumHeight))&&(lr(e,"3DTILES_bounding_volume_S2")||l(e.region))}function vQ(e,t){l(t)&&(lr(e,"3DTILES_bounding_volume_S2")?Wmt(e.extensions["3DTILES_bounding_volume_S2"],t.minimumHeight,t.maximumHeight):l(e.region)&&Gmt(e.region,t.minimumHeight,t.maximumHeight))}function Gmt(e,t,n){l(t)&&(e[4]=t),l(n)&&(e[5]=n)}function Wmt(e,t,n){l(t)&&(e.minimumHeight=t),l(n)&&(e.maximumHeight=n)}function qmt(e,t,n,i,r,o){let s;return!l(o)||!l(o.boundingVolume)||!l8(o.boundingVolume,o)&&l8(e.boundingVolume,o)?s=RTe(e,t,n,i??!1,r):s=o.boundingVolume,vQ(s,o),s}function Ymt(e,t){let n;return l(t)&&(n=t.boundingVolume),l8(n,t)?vQ(n,t):l8(e,t)&&(n=Ze(e,!0),vQ(n,t)),n}function RTe(e,t,n,i,r){let o=e.boundingVolume;return lr(o,"3DTILES_bounding_volume_S2")?OTe(i,r,n,t.level,t.x,t.y,t.z):l(o.region)?{region:NTe(o.region,t.level,t.x,t.y,t.z)}:{box:MTe(o.box,t.level,t.x,t.y,t.z)}}function OTe(e,t,n,i,r,o,s){let a=t._boundingVolume;if(e)return{extensions:{"3DTILES_bounding_volume_S2":{token:jy.getTokenFromId(a.s2Cell._cellId),minimumHeight:a.minimumHeight,maximumHeight:a.maximumHeight}}};let c=Number(t._boundingVolume.s2Cell._cellId>>BigInt(61)),u=c%2===0?N1.encode2D(i,r,o):N1.encode2D(i,o,r),f=jy.fromFacePositionLevel(c,BigInt(u),i),d,p;if(l(s)){let g=(a.maximumHeight+a.minimumHeight)/2;d=n<4?a.minimumHeight:g,p=n<4?g:a.maximumHeight}else d=a.minimumHeight,p=a.maximumHeight;return{extensions:{"3DTILES_bounding_volume_S2":{token:jy.getTokenFromId(f._cellId),minimumHeight:d,maximumHeight:p}}}}var Xmt=new h,Kmt=new h,CQ=new h,$mt=new $;function MTe(e,t,n,i,r){if(t===0)return e;let o=h.unpack(e,0,Kmt),s=$.unpack(e,3,$mt),a=Math.pow(2,-t),c=-1+(2*n+1)*a,u=-1+(2*i+1)*a,f=0,d=h.fromElements(a,a,1,Xmt);l(r)&&(f=-1+(2*r+1)*a,d.z=a);let p=h.fromElements(c,u,f,CQ);p=$.multiplyByVector(s,p,CQ),p=h.add(p,o,CQ);let g=$.clone(s);g=$.multiplyByScale(g,d,g);let m=new Array(12);return h.pack(p,m),$.pack(g,m,3),m}var Jmt=new ie;function NTe(e,t,n,i,r){if(t===0)return e.slice();let o=ie.unpack(e,0,Jmt),s=e[4],a=e[5],c=Math.pow(2,-t),u=c*o.width,f=P.negativePiToPi(o.west+n*u),d=P.negativePiToPi(f+u),p=c*o.height,g=P.negativePiToPi(o.south+i*p),m=P.negativePiToPi(g+p),y=s,A=a;if(l(r)){let b=c*(a-s);y+=r*b,A=y+b}return[f,g,d,m,y,A]}function Zmt(e,t,n){let i=e._implicitTileset,r=t.implicitCoordinates.getChildCoordinates(n),o=RTe(i,r,n,!1,t),s=DTe(void 0,i,r),a=i.subtreeUriTemplate.getDerivedResource({templateValues:r.getTemplateValues()}).url,c={boundingVolume:o,geometricError:s,refine:i.refine,contents:[{uri:a}]},u=LTe(e,i.baseResource,c,t);return u.implicitTileset=i,u.implicitCoordinates=r,u}function LTe(e,t,n,i){let r=e._tile.constructor;return new r(e._tileset,t,n,i)}pS._deriveBoundingBox=MTe;pS._deriveBoundingRegion=NTe;pS._deriveBoundingVolumeS2=OTe;var k1=pS;var SQ=class e{constructor(t,n,i){this._tileset=t,this._tile=n,this._resource=i,this._model=void 0,this._metadata=void 0,this._group=void 0,this._ready=!1}get featuresLength(){let t=this._model,n=t.featureTables,i=t.featureTableId;return l(n)&&l(n[i])?n[i].featuresLength:0}get pointsLength(){return this._model.statistics.pointsLength}get trianglesLength(){return this._model.statistics.trianglesLength}get geometryByteLength(){return this._model.statistics.geometryByteLength}get texturesByteLength(){return this._model.statistics.texturesByteLength}get batchTableByteLength(){let t=this._model.statistics;return t.propertyTablesByteLength+t.batchTexturesByteLength}get innerContents(){}get ready(){return this._ready}get tileset(){return this._tileset}get tile(){return this._tile}get url(){return this._resource.getUrlComponent(!0)}get batchTable(){let t=this._model,n=t.featureTables,i=t.featureTableId;if(l(n)&&l(n[i]))return n[i]}get metadata(){return this._metadata}set metadata(t){this._metadata=t}get group(){return this._group}set group(t){this._group=t}getTextureIds(){return this._model.statistics.getTextureIds()}getTextureByteLengthById(t){return this._model.statistics.getTextureByteLengthById(t)}getExtension(t){return this._model.getExtension(t)}getFeature(t){let n=this._model,i=n.featureTableId;return n.featureTables[i].getFeature(t)}hasProperty(t,n){let i=this._model,r=i.featureTableId;return l(r)?i.featureTables[r].hasProperty(t,n):!1}applyDebugSettings(t,n){n=t?n:z.WHITE,this.featuresLength===0?this._model.color=n:l(this.batchTable)&&this.batchTable.setAllColor(n)}applyStyle(t){this._model.style=t}update(t,n){let i=this._model,r=this._tile;i.colorBlendAmount=t.colorBlendAmount,i.colorBlendMode=t.colorBlendMode,i.modelMatrix=r.computedTransform,i.customShader=t.customShader,i.featureIdLabel=t.featureIdLabel,i.instanceFeatureIdLabel=t.instanceFeatureIdLabel,i.lightColor=t.lightColor,i.imageBasedLighting=t.imageBasedLighting,i.backFaceCulling=t.backFaceCulling,i.shadows=t.shadows,i.showCreditsOnScreen=t.showCreditsOnScreen,i.splitDirection=t.splitDirection,i.debugWireframe=t.debugWireframe,i.edgeDisplayMode=t.edgeDisplayMode,i.showOutline=t.showOutline,i.outlineColor=t.outlineColor,i.pointCloudShading=t.pointCloudShading;let o=t.clippingPlanes;i.referenceMatrix=t.clippingPlanesOriginMatrix,l(o)&&r.clippingPlanesDirty&&(i._clippingPlanes=o.enabled&&r._isClipped?o:void 0);let s=t.environmentMapManager;i.environmentMapManager!==o&&(i._environmentMapManager=s),l(o)&&l(i._clippingPlanes)&&i._clippingPlanes!==o&&(i._clippingPlanes=o,i._clippingPlanesState=0);let a=t.clippingPolygons;l(a)&&r.clippingPolygonsDirty&&(i._clippingPolygons=a.enabled&&r._isClippedByPolygon?a:void 0),l(a)&&l(i._clippingPolygons)&&i._clippingPolygons!==a&&(i._clippingPolygons=a,i._clippingPolygonsState=0),r.clippingPolygonsNeedRebake&&(i._clippingPolygonsNeedRebake=!0),i.update(n),!this._ready&&i.ready&&(i.activeAnimations.addAll({loop:Af.REPEAT}),this._ready=!0)}isDestroyed(){return!1}destroy(){return this._model=this._model&&this._model.destroy(),le(this)}static async fromGltf(t,n,i,r){let o=new e(t,n,i),a=U1(t,n,o,{gltf:r,basePath:i}),c=t.vectorClassificationOnly?void 0:t.classificationType;a.classificationType=c;let u=await Md.fromGltfAsync(a);return o._model=u,o}static async fromB3dm(t,n,i,r,o){let s=new e(t,n,i),c=U1(t,n,s,{arrayBuffer:r,byteOffset:o,resource:i}),u=t.vectorClassificationOnly?void 0:t.classificationType;c.classificationType=u;let f=await Md.fromB3dm(c);return s._model=f,s}static async fromI3dm(t,n,i,r,o){let s=new e(t,n,i),c=U1(t,n,s,{arrayBuffer:r,byteOffset:o,resource:i}),u=await Md.fromI3dm(c);return s._model=u,s}static async fromPnts(t,n,i,r,o){let s=new e(t,n,i),c=U1(t,n,s,{arrayBuffer:r,byteOffset:o,resource:i}),u=await Md.fromPnts(c);return s._model=u,s}static async fromGeoJson(t,n,i,r){let o=new e(t,n,i),a=U1(t,n,o,{geoJson:r,resource:i}),c=await Md.fromGeoJson(a);return o._model=c,o}pick(t,n,i){if(!l(this._model)||!this._ready)return;let r=n.verticalExaggeration,o=n.verticalExaggerationRelativeHeight;return this._model.pick(t,n,r,o,ee.WGS84,i)}};function U1(e,t,n,i){let r={cull:!1,releaseGltfJson:!0,opaquePass:Ie.CESIUM_3D_TILE,modelMatrix:t.computedTransform,upAxis:e._modelUpAxis,forwardAxis:e._modelForwardAxis,incrementallyLoadTextures:!1,customShader:e.customShader,content:n,scene:e._scene,colorBlendMode:e.colorBlendMode,colorBlendAmount:e.colorBlendAmount,lightColor:e.lightColor,imageBasedLighting:e.imageBasedLighting,featureIdLabel:e.featureIdLabel,instanceFeatureIdLabel:e.instanceFeatureIdLabel,pointCloudShading:e.pointCloudShading,clippingPlanes:e.clippingPlanes,backFaceCulling:e.backFaceCulling,shadows:e.shadows,showCreditsOnScreen:e.showCreditsOnScreen,splitDirection:e.splitDirection,enableDebugWireframe:e._enableDebugWireframe,debugWireframe:e.debugWireframe,projectTo2D:e._projectTo2D,enablePick:e._enablePick,enableShowOutline:e._enableShowOutline,showOutline:e.showOutline,outlineColor:e.outlineColor};return Mt(i,r)}var Nd=SQ;var wQ=class e{constructor(t,n,i){this._tileset=t,this._tile=n,this._resource=i,this.featurePropertiesDirty=!1,this._metadata=void 0,this._group=void 0,this._ready=!1}get featuresLength(){return 0}get pointsLength(){return 0}get trianglesLength(){return 0}get geometryByteLength(){return 0}get texturesByteLength(){return 0}get batchTableByteLength(){return 0}get innerContents(){}get ready(){return this._ready}get tileset(){return this._tileset}get tile(){return this._tile}get url(){return this._resource.getUrlComponent(!0)}get batchTable(){}get metadata(){return this._metadata}set metadata(t){this._metadata=t}get group(){return this._group}set group(t){this._group=t}static fromJson(t,n,i,r){let o=new e(t,n,i);return o._tileset.loadTileset(o._resource,r,o._tile),o._ready=!0,o}hasProperty(t,n){return!1}getFeature(t){}applyDebugSettings(t,n){}applyStyle(t){}update(t,n){}pick(t,n,i){}isDestroyed(){return!1}destroy(){return le(this)}},u8=wQ;function Qmt(e,t,n,i,r){return function(){let o=document.createElement("canvas"),s=r+2*i;o.height=o.width=s;let a=o.getContext("2d");return a.clearRect(0,0,s,s),i!==0&&(a.beginPath(),a.arc(s/2,s/2,s/2,0,2*Math.PI,!0),a.closePath(),a.fillStyle=n,a.fill(),e<1&&(a.save(),a.globalCompositeOperation="destination-out",a.beginPath(),a.arc(s/2,s/2,r/2,0,2*Math.PI,!0),a.closePath(),a.fillStyle="black",a.fill(),a.restore())),a.beginPath(),a.arc(s/2,s/2,r/2,0,2*Math.PI,!0),a.closePath(),a.fillStyle=t,a.fill(),o}}var gS=Qmt;var ept=new he,Kh=class{constructor(t,n,i,r,o){this._content=t,this._billboard=i,this._label=r,this._polyline=o,this._batchId=n,this._billboardImage=void 0,this._billboardColor=void 0,this._billboardOutlineColor=void 0,this._billboardOutlineWidth=void 0,this._billboardSize=void 0,this._pointSize=void 0,this._color=void 0,this._pointSize=void 0,this._pointOutlineColor=void 0,this._pointOutlineWidth=void 0,this._heightOffset=void 0,this._pickIds=new Array(3),_S(this)}get show(){return this._label.show}set show(t){this._label.show=t,this._billboard.show=t,this._polyline.show=t}get color(){return this._color}set color(t){this._color=z.clone(t,this._color),_S(this)}get pointSize(){return this._pointSize}set pointSize(t){this._pointSize=t,_S(this)}get pointOutlineColor(){return this._pointOutlineColor}set pointOutlineColor(t){this._pointOutlineColor=z.clone(t,this._pointOutlineColor),_S(this)}get pointOutlineWidth(){return this._pointOutlineWidth}set pointOutlineWidth(t){this._pointOutlineWidth=t,_S(this)}get labelColor(){return this._label.fillColor}set labelColor(t){this._label.fillColor=t,this._polyline.show=this._label.show&&t.alpha>0}get labelOutlineColor(){return this._label.outlineColor}set labelOutlineColor(t){this._label.outlineColor=t}get labelOutlineWidth(){return this._label.outlineWidth}set labelOutlineWidth(t){this._label.outlineWidth=t}get font(){return this._label.font}set font(t){this._label.font=t}get labelStyle(){return this._label.style}set labelStyle(t){this._label.style=t}get labelText(){return this._label.text}set labelText(t){l(t)||(t=""),this._label.text=t}get backgroundColor(){return this._label.backgroundColor}set backgroundColor(t){this._label.backgroundColor=t}get backgroundPadding(){return this._label.backgroundPadding}set backgroundPadding(t){this._label.backgroundPadding=t}get backgroundEnabled(){return this._label.showBackground}set backgroundEnabled(t){this._label.showBackground=t}get scaleByDistance(){return this._label.scaleByDistance}set scaleByDistance(t){this._label.scaleByDistance=t,this._billboard.scaleByDistance=t}get translucencyByDistance(){return this._label.translucencyByDistance}set translucencyByDistance(t){this._label.translucencyByDistance=t,this._billboard.translucencyByDistance=t}get distanceDisplayCondition(){return this._label.distanceDisplayCondition}set distanceDisplayCondition(t){this._label.distanceDisplayCondition=t,this._polyline.distanceDisplayCondition=t,this._billboard.distanceDisplayCondition=t}get heightOffset(){return this._heightOffset}set heightOffset(t){let n=this._heightOffset??0,i=this._content.tileset.ellipsoid,r=i.cartesianToCartographic(this._billboard.position,ept);r.height=r.height-n+t;let o=i.cartographicToCartesian(r);this._billboard.position=o,this._label.position=this._billboard.position,this._polyline.positions=[this._polyline.positions[0],o],this._heightOffset=t}get anchorLineEnabled(){return this._polyline.show}set anchorLineEnabled(t){this._polyline.show=t}get anchorLineColor(){return this._polyline.material.uniforms.color}set anchorLineColor(t){this._polyline.material.uniforms.color=z.clone(t,this._polyline.material.uniforms.color)}get image(){return this._billboardImage}set image(t){let n=this._billboardImage!==t;this._billboardImage=t,n&&_S(this)}get disableDepthTestDistance(){return this._label.disableDepthTestDistance}set disableDepthTestDistance(t){this._label.disableDepthTestDistance=t,this._billboard.disableDepthTestDistance=t}get horizontalOrigin(){return this._billboard.horizontalOrigin}set horizontalOrigin(t){this._billboard.horizontalOrigin=t}get verticalOrigin(){return this._billboard.verticalOrigin}set verticalOrigin(t){this._billboard.verticalOrigin=t}get labelHorizontalOrigin(){return this._label.horizontalOrigin}set labelHorizontalOrigin(t){this._label.horizontalOrigin=t}get labelVerticalOrigin(){return this._label.verticalOrigin}set labelVerticalOrigin(t){this._label.verticalOrigin=t}get content(){return this._content}get tileset(){return this._content.tileset}get primitive(){return this._content.tileset}get pickIds(){let t=this._pickIds;return t[0]=this._billboard.pickId,t[1]=this._label.pickId,t[2]=this._polyline.pickId,t}hasProperty(t){return this._content.batchTable.hasProperty(this._batchId,t)}getPropertyIds(t){return this._content.batchTable.getPropertyIds(this._batchId,t)}getProperty(t){return this._content.batchTable.getProperty(this._batchId,t)}getPropertyInherited(t){return ma.getPropertyInherited(this._content,this._batchId,t)}setProperty(t,n){this._content.batchTable.setProperty(this._batchId,t,n),this._content.featurePropertiesDirty=!0}isExactClass(t){return this._content.batchTable.isExactClass(this._batchId,t)}isClass(t){return this._content.batchTable.isClass(this._batchId,t)}getExactClassName(){return this._content.batchTable.getExactClassName(this._batchId)}};ut(Kh,"defaultColor",z.WHITE),ut(Kh,"defaultPointOutlineColor",z.BLACK),ut(Kh,"defaultPointOutlineWidth",0),ut(Kh,"defaultPointSize",8);function _S(e){let t=e._billboard;if(l(e._billboardImage)&&e._billboardImage!==t.image){t.image=e._billboardImage;return}if(l(e._billboardImage))return;let n=e._color??Kh.defaultColor,i=e._pointOutlineColor??Kh.defaultPointOutlineColor,r=e._pointOutlineWidth??Kh.defaultPointOutlineWidth,o=e._pointSize??Kh.defaultPointSize,s=e._billboardColor,a=e._billboardOutlineColor,c=e._billboardOutlineWidth,u=e._billboardSize;if(z.equals(n,s)&&z.equals(i,a)&&r===c&&o===u)return;e._billboardColor=z.clone(n,e._billboardColor),e._billboardOutlineColor=z.clone(i,e._billboardOutlineColor),e._billboardOutlineWidth=r,e._billboardSize=o;let f=n.alpha,d=n.toCssColorString(),p=i.toCssColorString(),g=JSON.stringify([d,o,p,r]);t.setImage(g,gS(f,d,p,r,o))}var Wy=Kh;function Cf(e,t){e=e??H.EMPTY_OBJECT,this._show=e.show??!0,this._width=e.width??1,this._loop=e.loop??!1,this._distanceDisplayCondition=e.distanceDisplayCondition,this._material=e.material,l(this._material)||(this._material=rr.fromType(rr.ColorType,{color:new z(1,1,1,1)}));let n=e.positions;l(n)||(n=[]),this._positions=n,this._actualPositions=Lr(n,h.equalsEpsilon),this._loop&&this._actualPositions.length>2&&(this._actualPositions===this._positions&&(this._actualPositions=n.slice()),this._actualPositions.push(h.clone(this._actualPositions[0]))),this._length=this._actualPositions.length,this._id=e.id;let i;l(t)&&(i=M.clone(t.modelMatrix)),this._modelMatrix=i,this._segments=ar.wrapLongitude(this._actualPositions,i),this._actualLength=void 0,this._propertiesChanged=new Uint32Array(BTe),this._polylineCollection=t,this._dirty=!1,this._pickId=void 0,this._boundingVolume=ue.fromPoints(this._actualPositions),this._boundingVolumeWC=ue.transform(this._boundingVolume,this._modelMatrix),this._boundingVolume2D=new ue}var FTe=Cf.POSITION_INDEX=0,tpt=Cf.SHOW_INDEX=1,npt=Cf.WIDTH_INDEX=2,ipt=Cf.MATERIAL_INDEX=3,z1=Cf.POSITION_SIZE_INDEX=4,rpt=Cf.DISTANCE_DISPLAY_CONDITION=5,BTe=Cf.NUMBER_OF_PROPERTIES=6;function Eg(e,t){++e._propertiesChanged[t];let n=e._polylineCollection;l(n)&&(n._updatePolyline(e,t),e._dirty=!0)}Object.defineProperties(Cf.prototype,{show:{get:function(){return this._show},set:function(e){e!==this._show&&(this._show=e,Eg(this,tpt))}},positions:{get:function(){return this._positions},set:function(e){let t=Lr(e,h.equalsEpsilon);this._loop&&t.length>2&&(t===e&&(t=e.slice()),t.push(h.clone(t[0]))),(this._actualPositions.length!==t.length||this._actualPositions.length!==this._length)&&Eg(this,z1),this._positions=e,this._actualPositions=t,this._length=t.length,this._boundingVolume=ue.fromPoints(this._actualPositions,this._boundingVolume),this._boundingVolumeWC=ue.transform(this._boundingVolume,this._modelMatrix,this._boundingVolumeWC),Eg(this,FTe),this.update()}},material:{get:function(){return this._material},set:function(e){this._material!==e&&(this._material=e,Eg(this,ipt))}},width:{get:function(){return this._width},set:function(e){let t=this._width;e!==t&&(this._width=e,Eg(this,npt))}},loop:{get:function(){return this._loop},set:function(e){if(e!==this._loop){let t=this._actualPositions;e?t.length>2&&!h.equals(t[0],t[t.length-1])&&(t.length===this._positions.length&&(this._actualPositions=t=this._positions.slice()),t.push(h.clone(t[0]))):t.length>2&&h.equals(t[0],t[t.length-1])&&(t.length-1===this._positions.length?this._actualPositions=this._positions:t.pop()),this._loop=e,Eg(this,z1)}}},id:{get:function(){return this._id},set:function(e){this._id=e,l(this._pickId)&&(this._pickId.object.id=e)}},pickId:{get:function(){return this._pickId}},isDestroyed:{get:function(){return!l(this._polylineCollection)}},distanceDisplayCondition:{get:function(){return this._distanceDisplayCondition},set:function(e){Gt.equals(e,this._distanceDisplayCondition)||(this._distanceDisplayCondition=Gt.clone(e,this._distanceDisplayCondition),Eg(this,rpt))}}});Cf.prototype.update=function(){let e=M.IDENTITY;l(this._polylineCollection)&&(e=this._polylineCollection.modelMatrix);let t=this._segments.positions.length,n=this._segments.lengths,i=this._propertiesChanged[FTe]>0||this._propertiesChanged[z1]>0;if((!M.equals(e,this._modelMatrix)||i)&&(this._segments=ar.wrapLongitude(this._actualPositions,e),this._boundingVolumeWC=ue.transform(this._boundingVolume,e,this._boundingVolumeWC)),this._modelMatrix=M.clone(e,this._modelMatrix),this._segments.positions.length!==t)Eg(this,z1);else{let r=n.length;for(let o=0;o<r;++o)if(n[o]!==this._segments.lengths[o]){Eg(this,z1);break}}};Cf.prototype.getPickId=function(e){return l(this._pickId)||(this._pickId=e.createPickId({primitive:this,collection:this._polylineCollection,id:this._id})),this._pickId};Cf.prototype._clean=function(){this._dirty=!1;let e=this._propertiesChanged;for(let t=0;t<BTe-1;++t)e[t]=0};Cf.prototype._destroy=function(){this._pickId=this._pickId&&this._pickId.destroy(),this._material=this._material&&this._material.destroy(),this._polylineCollection=void 0};var $h=Cf;var opt=$h.SHOW_INDEX,spt=$h.WIDTH_INDEX,PQ=$h.POSITION_INDEX,apt=$h.MATERIAL_INDEX,kTe=$h.POSITION_SIZE_INDEX,cpt=$h.DISTANCE_DISPLAY_CONDITION,WTe=$h.NUMBER_OF_PROPERTIES,Fu={texCoordExpandAndBatchIndex:0,position3DHigh:1,position3DLow:2,position2DHigh:3,position2DLow:4,prevPosition3DHigh:5,prevPosition3DLow:6,prevPosition2DHigh:7,prevPosition2DLow:8,nextPosition3DHigh:9,nextPosition3DLow:10,nextPosition2DHigh:11,nextPosition2DLow:12};function Jh(e){e=e??H.EMPTY_OBJECT,this.show=e.show??!0,this.modelMatrix=M.clone(e.modelMatrix??M.IDENTITY),this._modelMatrix=M.clone(M.IDENTITY),this.debugShowBoundingVolume=e.debugShowBoundingVolume??!1,this._opaqueRS=void 0,this._translucentRS=void 0,this._colorCommands=[],this._polylinesUpdated=!1,this._polylinesRemoved=!1,this._createVertexArray=!1,this._propertiesChanged=new Uint32Array(WTe),this._polylines=[],this._polylineBuckets={},this._positionBufferUsage={bufferUsage:Me.STATIC_DRAW,frameCount:0},this._mode=void 0,this._polylinesToUpdate=[],this._vertexArrays=[],this._positionBuffer=void 0,this._texCoordExpandAndBatchIndexBuffer=void 0,this._batchTable=void 0,this._createBatchTable=!1,this._useHighlightColor=!1,this._highlightColor=z.clone(z.WHITE);let t=this;this._uniformMap={u_highlightColor:function(){return t._highlightColor}}}Object.defineProperties(Jh.prototype,{length:{get:function(){return DQ(this),this._polylines.length}}});Jh.prototype.add=function(e){let t=new $h(e,this);return t._index=this._polylines.length,this._polylines.push(t),this._createVertexArray=!0,this._createBatchTable=!0,t};Jh.prototype.remove=function(e){if(this.contains(e)){if(this._polylinesRemoved=!0,this._createVertexArray=!0,this._createBatchTable=!0,l(e._bucket)){let t=e._bucket;t.shaderProgram=t.shaderProgram&&t.shaderProgram.destroy()}return e._destroy(),!0}return!1};Jh.prototype.removeAll=function(){RQ(this),$Te(this),this._polylineBuckets={},this._polylinesRemoved=!1,this._polylines.length=0,this._polylinesToUpdate.length=0,this._createVertexArray=!0};Jh.prototype.contains=function(e){return l(e)&&e._polylineCollection===this};Jh.prototype.get=function(e){return DQ(this),this._polylines[e]};function lpt(e,t){l(e._batchTable)&&e._batchTable.destroy();let n=[{functionName:"batchTable_getWidthAndShow",componentDatatype:Y.UNSIGNED_BYTE,componentsPerAttribute:2},{functionName:"batchTable_getPickColor",componentDatatype:Y.UNSIGNED_BYTE,componentsPerAttribute:4,normalize:!0},{functionName:"batchTable_getCenterHigh",componentDatatype:Y.FLOAT,componentsPerAttribute:3},{functionName:"batchTable_getCenterLowAndRadius",componentDatatype:Y.FLOAT,componentsPerAttribute:4},{functionName:"batchTable_getDistanceDisplayCondition",componentDatatype:Y.FLOAT,componentsPerAttribute:2}];e._batchTable=new eC(t,n,e._polylines.length)}var qTe=new Sn,YTe=new se,XTe=new U;Jh.prototype.update=function(e){if(DQ(this),this._polylines.length===0||!this.show)return;ppt(this,e);let t=e.context,n=e.mapProjection,i,r=this._propertiesChanged;if(this._createBatchTable){if(Ut.maximumVertexTextureImageUnits===0)throw new oe("Vertex texture fetch support is required to render polylines. The maximum number of vertex texture image units must be greater than zero.");lpt(this,t),this._createBatchTable=!1}if(this._createVertexArray||fpt(this))VTe(this,t,n);else if(this._polylinesUpdated){let c=this._polylinesToUpdate;if(this._mode!==re.SCENE3D){let u=c.length;for(let f=0;f<u;++f)i=c[f],i.update()}if(r[kTe]||r[apt])VTe(this,t,n);else{let u=c.length,f=this._polylineBuckets;for(let d=0;d<u;++d){i=c[d],r=i._propertiesChanged;let p=i._bucket,g=0;for(let m in f)if(f.hasOwnProperty(m)){if(f[m]===p){r[PQ]&&p.writeUpdate(g,i,this._positionBuffer,n);break}g+=f[m].lengthOfPositions}if((r[opt]||r[spt])&&this._batchTable.setBatchedAttribute(i._index,0,new U(i._width,i._show)),this._batchTable.attributes.length>2){if(r[PQ]||r[kTe]){let m=e.mode===re.SCENE2D?i._boundingVolume2D:i._boundingVolumeWC,y=Sn.fromCartesian(m.center,qTe),A=se.fromElements(y.low.x,y.low.y,y.low.z,m.radius,YTe);this._batchTable.setBatchedAttribute(i._index,2,y.high),this._batchTable.setBatchedAttribute(i._index,3,A)}if(r[cpt]){let m=XTe;m.x=0,m.y=Number.MAX_VALUE;let y=i.distanceDisplayCondition;l(y)&&(m.x=y.near,m.y=y.far),this._batchTable.setBatchedAttribute(i._index,4,m)}}i._clean()}}c.length=0,this._polylinesUpdated=!1}r=this._propertiesChanged;for(let c=0;c<WTe;++c)r[c]=0;let o=M.IDENTITY;e.mode===re.SCENE3D&&(o=this.modelMatrix);let s=e.passes,a=e.morphTime!==0;if((!l(this._opaqueRS)||this._opaqueRS.depthTest.enabled!==a)&&(this._opaqueRS=Ge.fromCache({depthMask:a,depthTest:{enabled:a}})),(!l(this._translucentRS)||this._translucentRS.depthTest.enabled!==a)&&(this._translucentRS=Ge.fromCache({blending:nn.ALPHA_BLEND,depthMask:!a,depthTest:{enabled:a}})),this._batchTable.update(e),s.render||s.pick){let c=this._colorCommands;upt(this,e,c,o)}};var V1=new ue,UTe=new ue;function upt(e,t,n,i){let r=t.context,o=t.commandList,s=n.length,a=0,c=!0,u=e._vertexArrays,f=e.debugShowBoundingVolume,p=e._batchTable.getUniformMapCallback(),g=u.length;for(let m=0;m<g;++m){let y=u[m],A=y.buckets,b=A.length;for(let x=0;x<b;++x){let T=A[x],E=T.offset,v=T.bucket.shaderProgram,S=T.bucket.polylines,I=S.length,R,O,L=0,_,C;for(let w=0;w<I;++w){let D=S[w],N=hpt(D._material);if(N!==R){if(l(R)&&L>0){let j=O.isTranslucent();a>=s?(_=new at({owner:e}),n.push(_)):_=n[a],++a,C=Mt(p(O._uniforms),e._uniformMap),_.boundingVolume=ue.clone(V1,_.boundingVolume),_.modelMatrix=i,_.shaderProgram=v,_.vertexArray=y.va,_.renderState=j?e._translucentRS:e._opaqueRS,_.pass=j?Ie.TRANSLUCENT:Ie.OPAQUE,_.debugShowBoundingVolume=f,_.pickId="v_pickColor",_.uniformMap=C,_.count=L,_.offset=E,E+=L,L=0,c=!0,o.push(_)}O=D._material,O.update(r),R=N}let F=D._locatorBuckets,V=F.length;for(let j=0;j<V;++j){let k=F[j];k.locator===T&&(L+=k.count)}let B;t.mode===re.SCENE3D?B=D._boundingVolumeWC:t.mode===re.COLUMBUS_VIEW?B=D._boundingVolume2D:t.mode===re.SCENE2D?l(D._boundingVolume2D)&&(B=ue.clone(D._boundingVolume2D,UTe),B.center.x=0):l(D._boundingVolumeWC)&&l(D._boundingVolume2D)&&(B=ue.union(D._boundingVolumeWC,D._boundingVolume2D,UTe)),c?(c=!1,ue.clone(B,V1)):ue.union(B,V1,V1)}l(R)&&L>0&&(a>=s?(_=new at({owner:e}),n.push(_)):_=n[a],++a,C=Mt(p(O._uniforms),e._uniformMap),_.boundingVolume=ue.clone(V1,_.boundingVolume),_.modelMatrix=i,_.shaderProgram=v,_.vertexArray=y.va,_.renderState=O.isTranslucent()?e._translucentRS:e._opaqueRS,_.pass=O.isTranslucent()?Ie.TRANSLUCENT:Ie.OPAQUE,_.debugShowBoundingVolume=f,_.pickId="v_pickColor",_.uniformMap=C,_.count=L,_.offset=E,c=!0,o.push(_)),R=void 0}}n.length=a}Jh.prototype.isDestroyed=function(){return!1};Jh.prototype.destroy=function(){return KTe(this),RQ(this),$Te(this),this._batchTable=this._batchTable&&this._batchTable.destroy(),le(this)};function fpt(e){let t=!1,n=e._propertiesChanged,i=e._positionBufferUsage;return n[PQ]?(i.bufferUsage!==Me.STREAM_DRAW&&(t=!0,i.bufferUsage=Me.STREAM_DRAW),i.frameCount=100):i.bufferUsage!==Me.STATIC_DRAW&&(i.frameCount===0?(t=!0,i.bufferUsage=Me.STATIC_DRAW):i.frameCount--),t}var zTe=[0,0,0];function VTe(e,t,n){e._createVertexArray=!1,RQ(e),KTe(e),mpt(e);let i=[[]],r,o=e._batchTable,s=e._useHighlightColor,a=[0],c=0,u=[[]],f=0,d=e._polylineBuckets,p,g;for(p in d)d.hasOwnProperty(p)&&(g=d[p],g.updateShader(t,o,s),f+=g.lengthOfPositions);if(f>0){let m=e._mode,y=new Float32Array(6*f*3),A=new Float32Array(f*4),b,x=0,T=0,E=0;for(p in d)if(d.hasOwnProperty(p)){g=d[p],g.write(y,A,x,T,E,o,t,n),m===re.MORPHING&&(l(b)||(b=new Float32Array(6*f*3)),g.writeForMorph(b,x));let C=g.lengthOfPositions;x+=6*C*3,T+=C*4,E+=C*4,c=g.updateIndices(i,a,u,c)}let v=e._positionBufferUsage.bufferUsage,S=Me.STATIC_DRAW;e._positionBuffer=tt.createVertexBuffer({context:t,typedArray:y,usage:v});let I;l(b)&&(I=tt.createVertexBuffer({context:t,typedArray:b,usage:v})),e._texCoordExpandAndBatchIndexBuffer=tt.createVertexBuffer({context:t,typedArray:A,usage:S});let R=3*Float32Array.BYTES_PER_ELEMENT,O=4*Float32Array.BYTES_PER_ELEMENT,L=0,_=i.length;for(let C=0;C<_;++C)if(r=i[C],r.length>0){let w=new Uint16Array(r),D=tt.createIndexBuffer({context:t,typedArray:w,usage:Me.STATIC_DRAW,indexDatatype:je.UNSIGNED_SHORT});L+=a[C];let N=6*(C*(R*P.SIXTY_FOUR_KILOBYTES)-L*R),F=R+N,V=R+F,B=R+V,j=R+B,k=R+j,G=C*(O*P.SIXTY_FOUR_KILOBYTES)-L*O,q=[{index:Fu.position3DHigh,componentsPerAttribute:3,componentDatatype:Y.FLOAT,offsetInBytes:N,strideInBytes:6*R},{index:Fu.position3DLow,componentsPerAttribute:3,componentDatatype:Y.FLOAT,offsetInBytes:F,strideInBytes:6*R},{index:Fu.position2DHigh,componentsPerAttribute:3,componentDatatype:Y.FLOAT,offsetInBytes:N,strideInBytes:6*R},{index:Fu.position2DLow,componentsPerAttribute:3,componentDatatype:Y.FLOAT,offsetInBytes:F,strideInBytes:6*R},{index:Fu.prevPosition3DHigh,componentsPerAttribute:3,componentDatatype:Y.FLOAT,offsetInBytes:V,strideInBytes:6*R},{index:Fu.prevPosition3DLow,componentsPerAttribute:3,componentDatatype:Y.FLOAT,offsetInBytes:B,strideInBytes:6*R},{index:Fu.prevPosition2DHigh,componentsPerAttribute:3,componentDatatype:Y.FLOAT,offsetInBytes:V,strideInBytes:6*R},{index:Fu.prevPosition2DLow,componentsPerAttribute:3,componentDatatype:Y.FLOAT,offsetInBytes:B,strideInBytes:6*R},{index:Fu.nextPosition3DHigh,componentsPerAttribute:3,componentDatatype:Y.FLOAT,offsetInBytes:j,strideInBytes:6*R},{index:Fu.nextPosition3DLow,componentsPerAttribute:3,componentDatatype:Y.FLOAT,offsetInBytes:k,strideInBytes:6*R},{index:Fu.nextPosition2DHigh,componentsPerAttribute:3,componentDatatype:Y.FLOAT,offsetInBytes:j,strideInBytes:6*R},{index:Fu.nextPosition2DLow,componentsPerAttribute:3,componentDatatype:Y.FLOAT,offsetInBytes:k,strideInBytes:6*R},{index:Fu.texCoordExpandAndBatchIndex,componentsPerAttribute:4,componentDatatype:Y.FLOAT,vertexBuffer:e._texCoordExpandAndBatchIndexBuffer,offsetInBytes:G}],Q,W,J,Z;m===re.SCENE3D?(W=e._positionBuffer,Q="vertexBuffer",J=zTe,Z="value"):m===re.SCENE2D||m===re.COLUMBUS_VIEW?(W=zTe,Q="value",J=e._positionBuffer,Z="vertexBuffer"):(W=I,Q="vertexBuffer",J=e._positionBuffer,Z="vertexBuffer"),q[0][Q]=W,q[1][Q]=W,q[2][Z]=J,q[3][Z]=J,q[4][Q]=W,q[5][Q]=W,q[6][Z]=J,q[7][Z]=J,q[8][Q]=W,q[9][Q]=W,q[10][Z]=J,q[11][Z]=J;let ae=new Vn({context:t,attributes:q,indexBuffer:D});e._vertexArrays.push({va:ae,buckets:u[C]})}}}function dpt(e,t){return t instanceof Dt?t.id:t}var f8=[];function hpt(e){let t=rr._uniformList[e.type],n=t.length;f8.length=2*n;let i=0;for(let r=0;r<n;++r){let o=t[r];f8[i]=o,f8[i+1]=e._uniforms[o](),i+=2}return`${e.type}:${JSON.stringify(f8,dpt)}`}function mpt(e){let t=e._mode,n=e._modelMatrix,i=e._polylineBuckets={},r=e._polylines,o=r.length;for(let s=0;s<o;++s){let a=r[s];if(a._actualPositions.length>1){a.update();let c=a.material,u=i[c.type];l(u)||(u=i[c.type]=new Lp(c,t,n)),u.addPolyline(a)}}}function ppt(e,t){let n=t.mode;(e._mode!==n||!M.equals(e._modelMatrix,e.modelMatrix))&&(e._mode=n,e._modelMatrix=M.clone(e.modelMatrix),e._createVertexArray=!0)}function DQ(e){if(e._polylinesRemoved){e._polylinesRemoved=!1;let t=[],n=[],i=0,r,o=e._polylines.length;for(let s=0;s<o;++s)r=e._polylines[s],r.isDestroyed||(r._index=i++,n.push(r),t.push(r));e._polylines=t,e._polylinesToUpdate=n}}function RQ(e){let t=e._polylines,n=t.length;for(let i=0;i<n;++i)if(!t[i].isDestroyed){let r=t[i]._bucket;l(r)&&(r.shaderProgram=r.shaderProgram&&r.shaderProgram.destroy())}}function KTe(e){let t=e._vertexArrays.length;for(let n=0;n<t;++n)e._vertexArrays[n].va.destroy();e._vertexArrays.length=0}Jh.prototype._updatePolyline=function(e,t){this._polylinesUpdated=!0,e._dirty||this._polylinesToUpdate.push(e),++this._propertiesChanged[t]};function $Te(e){let t=e._polylines,n=t.length;for(let i=0;i<n;++i)t[i].isDestroyed||t[i]._destroy()}function IQ(e,t,n){this.count=e,this.offset=t,this.bucket=n}function Lp(e,t,n){this.polylines=[],this.lengthOfPositions=0,this.material=e,this.shaderProgram=void 0,this.mode=t,this.modelMatrix=n}Lp.prototype.addPolyline=function(e){this.polylines.push(e),e._actualLength=this.getPolylinePositionsLength(e),this.lengthOfPositions+=e._actualLength,e._bucket=this};Lp.prototype.updateShader=function(e,t,n){if(l(this.shaderProgram))return;let i=["DISTANCE_DISPLAY_CONDITION"];n&&i.push("VECTOR_TILE"),this.material.shaderSource.search(/in\s+float\s+v_polylineAngle;/g)!==-1&&i.push("POLYLINE_DASH"),i.push("CLIP_POLYLINE");let r=new Xe({defines:i,sources:[`in vec4 v_pickColor; +`,this.material.shaderSource,KE]}),o=t.getVertexShaderCallback()(H2),s=new Xe({defines:i,sources:[du,o]});this.shaderProgram=Qt.fromCache({context:e,vertexShaderSource:s,fragmentShaderSource:r,attributeLocations:Fu})};function JTe(e){return h.dot(h.UNIT_X,e._boundingVolume.center)<0||e._boundingVolume.intersectPlane(sn.ORIGIN_ZX_PLANE)===$t.INTERSECTING}Lp.prototype.getPolylinePositionsLength=function(e){let t;if(this.mode===re.SCENE3D||!JTe(e))return t=e._actualPositions.length,t*4-4;let n=0,i=e._segments.lengths;t=i.length;for(let r=0;r<t;++r)n+=i[r]*4-4;return n};var ga=new h,Ld=new h,Fd=new h,d8=new h,gpt=new se,_pt=new U;Lp.prototype.write=function(e,t,n,i,r,o,s,a){let c=this.mode,u=a.ellipsoid.maximumRadius*P.PI,f=this.polylines,d=f.length;for(let p=0;p<d;++p){let g=f[p],m=g.width,y=g.show&&m>0,A=g._index,b=this.getSegments(g,a),x=b.positions,T=b.lengths,E=x.length,v=g.getPickId(s).color,S=0,I=0,R;for(let V=0;V<E;++V){V===0?g._loop?R=x[E-2]:(R=d8,h.subtract(x[0],x[1],R),h.add(x[0],R,R)):R=x[V-1],h.clone(R,Ld),h.clone(x[V],ga),V===E-1?g._loop?R=x[1]:(R=d8,h.subtract(x[E-1],x[E-2],R),h.add(x[E-1],R,R)):R=x[V+1],h.clone(R,Fd);let B=T[S];V===I+B&&(I+=B,++S);let j=V-I===0,k=V===I+T[S]-1;c===re.SCENE2D&&(Ld.z=0,ga.z=0,Fd.z=0),(c===re.SCENE2D||c===re.MORPHING)&&(j||k)&&u-Math.abs(ga.x)<1&&((ga.x<0&&Ld.x>0||ga.x>0&&Ld.x<0)&&h.clone(ga,Ld),(ga.x<0&&Fd.x>0||ga.x>0&&Fd.x<0)&&h.clone(ga,Fd));let G=j?2:0,q=k?2:4;for(let Q=G;Q<q;++Q){Sn.writeElements(ga,e,n),Sn.writeElements(Ld,e,n+6),Sn.writeElements(Fd,e,n+12);let W=Q-2<0?-1:1;t[r]=V/(E-1),t[r+1]=2*(Q%2)-1,t[r+2]=W,t[r+3]=A,n+=18,r+=4}}let O=gpt;O.x=z.floatToByte(v.red),O.y=z.floatToByte(v.green),O.z=z.floatToByte(v.blue),O.w=z.floatToByte(v.alpha);let L=_pt;L.x=m,L.y=y?1:0;let _=c===re.SCENE2D?g._boundingVolume2D:g._boundingVolumeWC,C=Sn.fromCartesian(_.center,qTe),w=C.high,D=se.fromElements(C.low.x,C.low.y,C.low.z,_.radius,YTe),N=XTe;N.x=0,N.y=Number.MAX_VALUE;let F=g.distanceDisplayCondition;l(F)&&(N.x=F.near,N.y=F.far),o.setBatchedAttribute(A,0,L),o.setBatchedAttribute(A,1,O),o.attributes.length>2&&(o.setBatchedAttribute(A,2,w),o.setBatchedAttribute(A,3,D),o.setBatchedAttribute(A,4,N))}};var ypt=new h,Apt=new h,bpt=new h,jTe=new h;Lp.prototype.writeForMorph=function(e,t){let n=this.modelMatrix,i=this.polylines,r=i.length;for(let o=0;o<r;++o){let s=i[o],a=s._segments.positions,c=s._segments.lengths,u=a.length,f=0,d=0;for(let p=0;p<u;++p){let g;p===0?s._loop?g=a[u-2]:(g=jTe,h.subtract(a[0],a[1],g),h.add(a[0],g,g)):g=a[p-1],g=M.multiplyByPoint(n,g,Apt);let m=M.multiplyByPoint(n,a[p],ypt),y;p===u-1?s._loop?y=a[1]:(y=jTe,h.subtract(a[u-1],a[u-2],y),h.add(a[u-1],y,y)):y=a[p+1],y=M.multiplyByPoint(n,y,bpt);let A=c[f];p===d+A&&(d+=A,++f);let b=p-d===0,x=p===d+c[f]-1,T=b?2:0,E=x?2:4;for(let v=T;v<E;++v)Sn.writeElements(m,e,t),Sn.writeElements(g,e,t+6),Sn.writeElements(y,e,t+12),t+=18}}};var xpt=new Array(1);Lp.prototype.updateIndices=function(e,t,n,i){let r=n.length-1,o=new IQ(0,i,this);n[r].push(o);let s=0,a=e[e.length-1],c=0;a.length>0&&(c=a[a.length-1]+1);let u=this.polylines,f=u.length;for(let d=0;d<f;++d){let p=u[d];p._locatorBuckets=[];let g;if(this.mode===re.SCENE3D){g=xpt;let y=p._actualPositions.length;if(y>0)g[0]=y;else continue}else g=p._segments.lengths;let m=g.length;if(m>0){let y=0;for(let A=0;A<m;++A){let b=g[A]-1;for(let x=0;x<b;++x)c+4>P.SIXTY_FOUR_KILOBYTES&&(p._locatorBuckets.push({locator:o,count:y}),y=0,t.push(4),a=[],e.push(a),c=0,o.count=s,s=0,i=0,o=new IQ(0,0,this),n[++r]=[o]),a.push(c,c+2,c+1),a.push(c+1,c+2,c+3),y+=6,s+=6,i+=6,c+=4}p._locatorBuckets.push({locator:o,count:y}),c+4>P.SIXTY_FOUR_KILOBYTES&&(t.push(0),a=[],e.push(a),c=0,o.count=s,i=0,s=0,o=new IQ(0,0,this),n[++r]=[o])}p._clean()}return o.count=s,i};Lp.prototype.getPolylineStartIndex=function(e){let t=this.polylines,n=0,i=t.length;for(let r=0;r<i;++r){let o=t[r];if(o===e)break;n+=o._actualLength}return n};var yS={positions:void 0,lengths:void 0},HTe=new Array(1),Tpt=new h,Ept=new he;Lp.prototype.getSegments=function(e,t){let n=e._actualPositions;if(this.mode===re.SCENE3D)return HTe[0]=n.length,yS.positions=n,yS.lengths=HTe,yS;JTe(e)&&(n=e._segments.positions);let i=t.ellipsoid,r=[],o=this.modelMatrix,s=n.length,a,c=Tpt;for(let u=0;u<s;++u)a=n[u],c=M.multiplyByPoint(o,a,c),r.push(t.project(i.cartesianToCartographic(c,Ept)));if(r.length>0){e._boundingVolume2D=ue.fromPoints(r,e._boundingVolume2D);let u=e._boundingVolume2D.center;e._boundingVolume2D.center=new h(u.z,u.x,u.y)}return yS.positions=r,yS.lengths=e._segments.lengths,yS};var GTe;Lp.prototype.writeUpdate=function(e,t,n,i){let r=this.mode,o=i.ellipsoid.maximumRadius*P.PI,s=t._actualLength;if(s){e+=this.getPolylineStartIndex(t);let a=GTe,c=6*s*3;!l(a)||a.length<c?a=GTe=new Float32Array(c):a.length>c&&(a=new Float32Array(a.buffer,0,c));let u=this.getSegments(t,i),f=u.positions,d=u.lengths,p=0,g=0,m=0,y;s=f.length;for(let A=0;A<s;++A){A===0?t._loop?y=f[s-2]:(y=d8,h.subtract(f[0],f[1],y),h.add(f[0],y,y)):y=f[A-1],h.clone(y,Ld),h.clone(f[A],ga),A===s-1?t._loop?y=f[1]:(y=d8,h.subtract(f[s-1],f[s-2],y),h.add(f[s-1],y,y)):y=f[A+1],h.clone(y,Fd);let b=d[g];A===m+b&&(m+=b,++g);let x=A-m===0,T=A===m+d[g]-1;r===re.SCENE2D&&(Ld.z=0,ga.z=0,Fd.z=0),(r===re.SCENE2D||r===re.MORPHING)&&(x||T)&&o-Math.abs(ga.x)<1&&((ga.x<0&&Ld.x>0||ga.x>0&&Ld.x<0)&&h.clone(ga,Ld),(ga.x<0&&Fd.x>0||ga.x>0&&Fd.x<0)&&h.clone(ga,Fd));let E=x?2:0,v=T?2:4;for(let S=E;S<v;++S)Sn.writeElements(ga,a,p),Sn.writeElements(Ld,a,p+6),Sn.writeElements(Fd,a,p+12),p+=18}n.copyFromArrayView(a,18*Float32Array.BYTES_PER_ELEMENT*e)}};var Fp=Jh;function qy(e){this._positions=e.positions,this._batchTable=e.batchTable,this._batchIds=e.batchIds,this._rectangle=e.rectangle,this._minHeight=e.minimumHeight,this._maxHeight=e.maximumHeight,this._heightReference=e.heightReference,this._billboardCollection=new ud({batchTable:e.batchTable,scene:e.scene}),this._labelCollection=new K0({batchTable:e.batchTable,scene:e.scene}),this._polylineCollection=new Fp,this._polylineCollection._useHighlightColor=!0,this._packedBuffer=void 0,this._ready=!1,this._promise=void 0,this._error=void 0}Object.defineProperties(qy.prototype,{ready:{get:function(){return this._ready}},pointsLength:{get:function(){return this._billboardCollection.length}},texturesByteLength:{get:function(){let e=this._billboardCollection.sizeInBytes,t=this._labelCollection.sizeInBytes;return e+t}}});function Cpt(e,t){let n=e._rectangle,i=e._minHeight,r=e._maxHeight,o=2+ie.packedLength+ee.packedLength,s=new Float64Array(o),a=0;return s[a++]=i,s[a++]=r,ie.pack(n,s,a),a+=ie.packedLength,ee.pack(t,s,a),s}var vpt=new $n("createVectorTilePoints",5),Spt=new h;function wpt(e,t){let n=e._positions,i=e._packedBuffer;l(i)||(n=e._positions=n.slice(),e._batchIds=e._batchIds.slice(),i=e._packedBuffer=Cpt(e,t));let r=[n.buffer,i.buffer],o={positions:n.buffer,packedBuffer:i.buffer},s=vpt.scheduleTask(o,r);if(l(s))return s.then(a=>{if(e.isDestroyed())return;e._positions=new Float64Array(a.positions);let c=e._billboardCollection,u=e._labelCollection,f=e._polylineCollection;n=e._positions;let d=e._batchIds,p=n.length/3,g=e._heightReference??We.NONE;for(let m=0;m<p;++m){let y=d[m],A=h.unpack(n,m*3,Spt),b=c.add();b.position=A,b._batchIndex=y,b.heightReference=g;let x=u.add();x.text=" ",x.position=A,x._batchIndex=y,x.heightReference=g;let T=f.add();T.positions=[h.clone(A),h.clone(A)]}e._positions=void 0,e._packedBuffer=void 0,e._ready=!0}).catch(a=>{e.isDestroyed()||(e._error=a)})}qy.prototype.createFeatures=function(e,t){let n=this._billboardCollection,i=this._labelCollection,r=this._polylineCollection,o=this._batchIds,s=o.length;for(let a=0;a<s;++a){let c=o[a],u=n.get(a),f=i.get(a),d=r.get(a);t[c]=new Wy(e,c,u,f,d)}};qy.prototype.applyDebugSettings=function(e,t){e?(z.clone(t,this._billboardCollection._highlightColor),z.clone(t,this._labelCollection._highlightColor),z.clone(t,this._polylineCollection._highlightColor)):(z.clone(z.WHITE,this._billboardCollection._highlightColor),z.clone(z.WHITE,this._labelCollection._highlightColor),z.clone(z.WHITE,this._polylineCollection._highlightColor))};function Ipt(e,t){let n=e._batchIds,i=n.length;for(let r=0;r<i;++r){let o=n[r],s=t[o];s.show=!0,s.pointSize=Wy.defaultPointSize,s.color=Wy.defaultColor,s.pointOutlineColor=Wy.defaultPointOutlineColor,s.pointOutlineWidth=Wy.defaultPointOutlineWidth,s.labelColor=z.WHITE,s.labelOutlineColor=z.WHITE,s.labelOutlineWidth=1,s.font="30px sans-serif",s.labelStyle=Co.FILL,s.labelText=void 0,s.backgroundColor=new z(.165,.165,.165,.8),s.backgroundPadding=new U(7,5),s.backgroundEnabled=!1,s.scaleByDistance=void 0,s.translucencyByDistance=void 0,s.distanceDisplayCondition=void 0,s.heightOffset=0,s.anchorLineEnabled=!1,s.anchorLineColor=z.WHITE,s.image=void 0,s.disableDepthTestDistance=0,s.horizontalOrigin=Gi.CENTER,s.verticalOrigin=qn.CENTER,s.labelHorizontalOrigin=Gi.RIGHT,s.labelVerticalOrigin=qn.BASELINE}}var Ppt=new z,Dpt=new z,Rpt=new z,Opt=new z,Mpt=new z,Npt=new z,j1=new qt,H1=new qt,OQ=new Gt;qy.prototype.applyStyle=function(e,t){if(!l(e)){Ipt(this,t);return}let n=this._batchIds,i=n.length;for(let r=0;r<i;++r){let o=n[r],s=t[o];if(l(e.show)&&(s.show=e.show.evaluate(s)),l(e.pointSize)&&(s.pointSize=e.pointSize.evaluate(s)),l(e.color)&&(s.color=e.color.evaluateColor(s,Ppt)),l(e.pointOutlineColor)&&(s.pointOutlineColor=e.pointOutlineColor.evaluateColor(s,Dpt)),l(e.pointOutlineWidth)&&(s.pointOutlineWidth=e.pointOutlineWidth.evaluate(s)),l(e.labelColor)&&(s.labelColor=e.labelColor.evaluateColor(s,Rpt)),l(e.labelOutlineColor)&&(s.labelOutlineColor=e.labelOutlineColor.evaluateColor(s,Opt)),l(e.labelOutlineWidth)&&(s.labelOutlineWidth=e.labelOutlineWidth.evaluate(s)),l(e.font)&&(s.font=e.font.evaluate(s)),l(e.labelStyle)&&(s.labelStyle=e.labelStyle.evaluate(s)),l(e.labelText)?s.labelText=e.labelText.evaluate(s):s.labelText=void 0,l(e.backgroundColor)&&(s.backgroundColor=e.backgroundColor.evaluateColor(s,Mpt)),l(e.backgroundPadding)&&(s.backgroundPadding=e.backgroundPadding.evaluate(s)),l(e.backgroundEnabled)&&(s.backgroundEnabled=e.backgroundEnabled.evaluate(s)),l(e.scaleByDistance)){let a=e.scaleByDistance.evaluate(s);l(a)?(j1.near=a.x,j1.nearValue=a.y,j1.far=a.z,j1.farValue=a.w,s.scaleByDistance=j1):s.scaleByDistance=void 0}else s.scaleByDistance=void 0;if(l(e.translucencyByDistance)){let a=e.translucencyByDistance.evaluate(s);l(a)?(H1.near=a.x,H1.nearValue=a.y,H1.far=a.z,H1.farValue=a.w,s.translucencyByDistance=H1):s.translucencyByDistance=void 0}else s.translucencyByDistance=void 0;if(l(e.distanceDisplayCondition)){let a=e.distanceDisplayCondition.evaluate(s);l(a)?(OQ.near=a.x,OQ.far=a.y,s.distanceDisplayCondition=OQ):s.distanceDisplayCondition=void 0}else s.distanceDisplayCondition=void 0;l(e.heightOffset)&&(s.heightOffset=e.heightOffset.evaluate(s)),l(e.anchorLineEnabled)&&(s.anchorLineEnabled=e.anchorLineEnabled.evaluate(s)),l(e.anchorLineColor)&&(s.anchorLineColor=e.anchorLineColor.evaluateColor(s,Npt)),l(e.image)?s.image=e.image.evaluate(s):s.image=void 0,l(e.disableDepthTestDistance)&&(s.disableDepthTestDistance=e.disableDepthTestDistance.evaluate(s)),l(e.horizontalOrigin)&&(s.horizontalOrigin=e.horizontalOrigin.evaluate(s)),l(e.verticalOrigin)&&(s.verticalOrigin=e.verticalOrigin.evaluate(s)),l(e.labelHorizontalOrigin)&&(s.labelHorizontalOrigin=e.labelHorizontalOrigin.evaluate(s)),l(e.labelVerticalOrigin)&&(s.labelVerticalOrigin=e.labelVerticalOrigin.evaluate(s))}};qy.prototype.update=function(e){if(!this._ready&&(l(this._promise)||(this._promise=wpt(this,e.mapProjection.ellipsoid)),l(this._error))){let t=this._error;throw this._error=void 0,t}this._polylineCollection.update(e),this._billboardCollection.update(e),this._labelCollection.update(e)};qy.prototype.isDestroyed=function(){return!1};qy.prototype.destroy=function(){return this._billboardCollection=this._billboardCollection&&this._billboardCollection.destroy(),this._labelCollection=this._labelCollection&&this._labelCollection.destroy(),this._polylineCollection=this._polylineCollection&&this._polylineCollection.destroy(),le(this)};var h8=qy;function Cg(e){this._batchTable=e.batchTable,this._batchIds=e.batchIds,this._positions=e.positions,this._counts=e.counts,this._indices=e.indices,this._indexCounts=e.indexCounts,this._indexOffsets=void 0,this._batchTableColors=void 0,this._packedBuffer=void 0,this._batchedPositions=void 0,this._transferrableBatchIds=void 0,this._vertexBatchIds=void 0,this._ellipsoid=e.ellipsoid??ee.WGS84,this._minimumHeight=e.minimumHeight,this._maximumHeight=e.maximumHeight,this._polygonMinimumHeights=e.polygonMinimumHeights,this._polygonMaximumHeights=e.polygonMaximumHeights,this._center=e.center??h.ZERO,this._rectangle=e.rectangle,this._center=void 0,this._boundingVolume=e.boundingVolume,this._boundingVolumes=void 0,this._batchedIndices=void 0,this._ready=!1,this._promise=void 0,this._error=void 0,this._primitive=void 0,this.debugWireframe=!1,this.forceRebatch=!1,this.classificationType=Qn.BOTH}Object.defineProperties(Cg.prototype,{trianglesLength:{get:function(){return l(this._primitive)?this._primitive.trianglesLength:0}},geometryByteLength:{get:function(){return l(this._primitive)?this._primitive.geometryByteLength:0}},ready:{get:function(){return this._ready}}});function Lpt(e){let t=new Float64Array(3+h.packedLength+ee.packedLength+ie.packedLength),n=0;return t[n++]=e._indices.BYTES_PER_ELEMENT,t[n++]=e._minimumHeight,t[n++]=e._maximumHeight,h.pack(e._center,t,n),n+=h.packedLength,ee.pack(e._ellipsoid,t,n),n+=ee.packedLength,ie.pack(e._rectangle,t,n),t}function Fpt(e,t){let n=1,i=t[n++],r=e._boundingVolumes=new Array(i);for(let a=0;a<i;++a)r[a]=en.unpack(t,n),n+=en.packedLength;let o=t[n++],s=e._batchedIndices=new Array(o);for(let a=0;a<o;++a){let c=z.unpack(t,n);n+=z.packedLength;let u=t[n++],f=t[n++],d=t[n++],p=new Array(d);for(let g=0;g<d;++g)p[g]=t[n++];s[a]=new Ag({color:c,offset:u,count:f,batchIds:p})}}var Bpt=new $n("createVectorTilePolygons",5),kpt=new z;function Upt(e){if(l(e._primitive))return;let t=e._positions,n=e._counts,i=e._indexCounts,r=e._indices,o=e._transferrableBatchIds,s=e._batchTableColors,a=e._packedBuffer;if(!l(s)){t=e._positions=e._positions.slice(),n=e._counts=e._counts.slice(),i=e._indexCounts=e._indexCounts.slice(),r=e._indices=e._indices.slice(),e._center=e._ellipsoid.cartographicToCartesian(ie.center(e._rectangle)),o=e._transferrableBatchIds=new Uint32Array(e._batchIds),s=e._batchTableColors=new Uint32Array(o.length);let g=e._batchTable,m=s.length;for(let y=0;y<m;++y){let A=g.getColor(y,kpt);s[y]=A.toRgba()}a=e._packedBuffer=Lpt(e)}let c=[t.buffer,n.buffer,i.buffer,r.buffer,o.buffer,s.buffer,a.buffer],u={packedBuffer:a.buffer,positions:t.buffer,counts:n.buffer,indexCounts:i.buffer,indices:r.buffer,batchIds:o.buffer,batchTableColors:s.buffer},f=e._polygonMinimumHeights,d=e._polygonMaximumHeights;l(f)&&l(d)&&(f=f.slice(),d=d.slice(),c.push(f.buffer,d.buffer),u.minimumHeights=f,u.maximumHeights=d);let p=Bpt.scheduleTask(u,c);if(l(p))return p.then(g=>{if(e.isDestroyed())return;e._positions=void 0,e._counts=void 0,e._polygonMinimumHeights=void 0,e._polygonMaximumHeights=void 0;let m=new Float64Array(g.packedBuffer),y=m[0];Fpt(e,m),e._indices=je.getSizeInBytes(y)===2?new Uint16Array(g.indices):new Uint32Array(g.indices),e._indexOffsets=new Uint32Array(g.indexOffsets),e._indexCounts=new Uint32Array(g.indexCounts),e._batchedPositions=new Float32Array(g.positions),e._vertexBatchIds=new Uint16Array(g.batchIds),zpt(e),e._ready=!0}).catch(g=>{e.isDestroyed()||(e._error=g)})}function zpt(e){l(e._primitive)||(e._primitive=new hS({batchTable:e._batchTable,positions:e._batchedPositions,batchIds:e._batchIds,vertexBatchIds:e._vertexBatchIds,indices:e._indices,indexOffsets:e._indexOffsets,indexCounts:e._indexCounts,batchedIndices:e._batchedIndices,boundingVolume:e._boundingVolume,boundingVolumes:e._boundingVolumes,center:e._center}),e._batchTable=void 0,e._batchIds=void 0,e._positions=void 0,e._counts=void 0,e._indices=void 0,e._indexCounts=void 0,e._indexOffsets=void 0,e._batchTableColors=void 0,e._packedBuffer=void 0,e._batchedPositions=void 0,e._transferrableBatchIds=void 0,e._vertexBatchIds=void 0,e._ellipsoid=void 0,e._minimumHeight=void 0,e._maximumHeight=void 0,e._polygonMinimumHeights=void 0,e._polygonMaximumHeights=void 0,e._center=void 0,e._rectangle=void 0,e._boundingVolume=void 0,e._boundingVolumes=void 0,e._batchedIndices=void 0)}Cg.prototype.createFeatures=function(e,t){this._primitive.createFeatures(e,t)};Cg.prototype.applyDebugSettings=function(e,t){this._primitive.applyDebugSettings(e,t)};Cg.prototype.applyStyle=function(e,t){this._primitive.applyStyle(e,t)};Cg.prototype.updateCommands=function(e,t){this._primitive.updateCommands(e,t)};Cg.prototype.update=function(e){if(!this._ready){if(l(this._promise)||(this._promise=Upt(this)),l(this._error)){let t=this._error;throw this._error=void 0,t}return}this._primitive.debugWireframe=this.debugWireframe,this._primitive.forceRebatch=this.forceRebatch,this._primitive.classificationType=this.classificationType,this._primitive.update(e)};Cg.prototype.isDestroyed=function(){return!1};Cg.prototype.destroy=function(){return this._primitive=this._primitive&&this._primitive.destroy(),le(this)};var m8=Cg;function Zh(e){this._positions=e.positions,this._widths=e.widths,this._counts=e.counts,this._batchIds=e.batchIds,this._ellipsoid=e.ellipsoid??ee.WGS84,this._minimumHeight=e.minimumHeight,this._maximumHeight=e.maximumHeight,this._center=e.center,this._rectangle=e.rectangle,this._boundingVolume=e.boundingVolume,this._batchTable=e.batchTable,this._va=void 0,this._sp=void 0,this._rs=void 0,this._uniformMap=void 0,this._command=void 0,this._transferrableBatchIds=void 0,this._packedBuffer=void 0,this._keepDecodedPositions=e.keepDecodedPositions,this._decodedPositions=void 0,this._decodedPositionOffsets=void 0,this._currentPositions=void 0,this._previousPositions=void 0,this._nextPositions=void 0,this._expandAndWidth=void 0,this._vertexBatchIds=void 0,this._indices=void 0,this._constantColor=z.clone(z.WHITE),this._highlightColor=this._constantColor,this._trianglesLength=0,this._geometryByteLength=0,this._ready=!1,this._promise=void 0,this._error=void 0}Object.defineProperties(Zh.prototype,{trianglesLength:{get:function(){return this._trianglesLength}},geometryByteLength:{get:function(){return this._geometryByteLength}},ready:{get:function(){return this._ready}}});function Vpt(e){let t=e._rectangle,n=e._minimumHeight,i=e._maximumHeight,r=e._ellipsoid,o=e._center,s=2+ie.packedLength+ee.packedLength+h.packedLength,a=new Float64Array(s),c=0;return a[c++]=n,a[c++]=i,ie.pack(t,a,c),c+=ie.packedLength,ee.pack(r,a,c),c+=ee.packedLength,h.pack(o,a,c),a}var jpt=new $n("createVectorTilePolylines",5),AS={previousPosition:0,currentPosition:1,nextPosition:2,expandAndWidth:3,a_batchId:4};function Hpt(e,t){if(l(e._va))return;let n=e._positions,i=e._widths,r=e._counts,o=e._transferrableBatchIds,s=e._packedBuffer;l(s)||(n=e._positions=n.slice(),i=e._widths=i.slice(),r=e._counts=r.slice(),o=e._transferrableBatchIds=e._batchIds.slice(),s=e._packedBuffer=Vpt(e));let a=[n.buffer,i.buffer,r.buffer,o.buffer,s.buffer],c={positions:n.buffer,widths:i.buffer,counts:r.buffer,batchIds:o.buffer,packedBuffer:s.buffer,keepDecodedPositions:e._keepDecodedPositions},u=jpt.scheduleTask(c,a);if(l(u))return u.then(function(f){if(e.isDestroyed())return;e._keepDecodedPositions&&(e._decodedPositions=new Float64Array(f.decodedPositions),e._decodedPositionOffsets=new Uint32Array(f.decodedPositionOffsets)),e._currentPositions=new Float32Array(f.currentPositions),e._previousPositions=new Float32Array(f.previousPositions),e._nextPositions=new Float32Array(f.nextPositions),e._expandAndWidth=new Float32Array(f.expandAndWidth),e._vertexBatchIds=new Uint16Array(f.batchIds);let d=f.indexDatatype;e._indices=d===je.UNSIGNED_SHORT?new Uint16Array(f.indices):new Uint32Array(f.indices),Gpt(e,t),e._ready=!0}).catch(f=>{e.isDestroyed()||(e._error=f)})}function Gpt(e,t){if(!l(e._va)){let n=e._currentPositions,i=e._previousPositions,r=e._nextPositions,o=e._expandAndWidth,s=e._vertexBatchIds,a=e._indices,c=i.byteLength+n.byteLength+r.byteLength;c+=o.byteLength+s.byteLength+a.byteLength,e._trianglesLength=a.length/3,e._geometryByteLength=c;let u=tt.createVertexBuffer({context:t,typedArray:i,usage:Me.STATIC_DRAW}),f=tt.createVertexBuffer({context:t,typedArray:n,usage:Me.STATIC_DRAW}),d=tt.createVertexBuffer({context:t,typedArray:r,usage:Me.STATIC_DRAW}),p=tt.createVertexBuffer({context:t,typedArray:o,usage:Me.STATIC_DRAW}),g=tt.createVertexBuffer({context:t,typedArray:s,usage:Me.STATIC_DRAW}),m=tt.createIndexBuffer({context:t,typedArray:a,usage:Me.STATIC_DRAW,indexDatatype:a.BYTES_PER_ELEMENT===2?je.UNSIGNED_SHORT:je.UNSIGNED_INT}),y=[{index:AS.previousPosition,vertexBuffer:u,componentDatatype:Y.FLOAT,componentsPerAttribute:3},{index:AS.currentPosition,vertexBuffer:f,componentDatatype:Y.FLOAT,componentsPerAttribute:3},{index:AS.nextPosition,vertexBuffer:d,componentDatatype:Y.FLOAT,componentsPerAttribute:3},{index:AS.expandAndWidth,vertexBuffer:p,componentDatatype:Y.FLOAT,componentsPerAttribute:2},{index:AS.a_batchId,vertexBuffer:g,componentDatatype:Y.UNSIGNED_SHORT,componentsPerAttribute:1}];e._va=new Vn({context:t,attributes:y,indexBuffer:m}),e._positions=void 0,e._widths=void 0,e._counts=void 0,e._ellipsoid=void 0,e._minimumHeight=void 0,e._maximumHeight=void 0,e._rectangle=void 0,e._transferrableBatchIds=void 0,e._packedBuffer=void 0,e._currentPositions=void 0,e._previousPositions=void 0,e._nextPositions=void 0,e._expandAndWidth=void 0,e._vertexBatchIds=void 0,e._indices=void 0}}var G1=new M,ZTe=new h;function Wpt(e,t){l(e._uniformMap)||(e._uniformMap={u_modifiedModelView:function(){let n=t.uniformState.view;return M.clone(n,G1),M.multiplyByPoint(G1,e._center,ZTe),M.setTranslation(G1,ZTe,G1),G1},u_highlightColor:function(){return e._highlightColor}})}function qpt(e){if(l(e._rs))return;let t={enabled:!0,factor:-5,units:-5};e._rs=Ge.fromCache({blending:nn.ALPHA_BLEND,depthMask:!1,depthTest:{enabled:!0},polygonOffset:t})}var Ypt=`uniform vec4 u_highlightColor; void main() { out_FragColor = u_highlightColor; } -`;function rft(e,t){if(l(e._sp))return;let n=e._batchTable,i=n.getVertexShaderCallback(!1,"a_batchId",void 0)(rk),r=n.getFragmentShaderCallback(!1,void 0,!1)(ift),o=new Xe({defines:["VECTOR_TILE","CLIP_POLYLINE"],sources:[du,i]}),s=new Xe({defines:["VECTOR_TILE"],sources:[r]});e._sp=Qt.fromCache({context:t,vertexShaderSource:o,fragmentShaderSource:s,attributeLocations:Nv})}function oft(e,t){if(!l(e._command)){let n=e._batchTable.getUniformMapCallback()(e._uniformMap);e._command=new at({owner:e,vertexArray:e._va,renderState:e._rs,shaderProgram:e._sp,uniformMap:n,boundingVolume:e._boundingVolume,pass:Ie.TRANSLUCENT,pickId:e._batchTable.getPickId()})}t.commandList.push(e._command)}zh.getPolylinePositions=function(e,t){let n=e._batchIds,i=e._decodedPositions,r=e._decodedPositionOffsets;if(!l(n)||!l(i))return;let o,s,a=n.length,c=0,u=0;for(o=0;o<a;++o)n[o]===t&&(c+=r[o+1]-r[o]);if(c===0)return;let f=new Float64Array(c*3);for(o=0;o<a;++o)if(n[o]===t){let d=r[o],p=r[o+1]-d;for(s=0;s<p;++s){let g=(d+s)*3;f[u++]=i[g],f[u++]=i[g+1],f[u++]=i[g+2]}}return f};zh.prototype.getPositions=function(e){return zh.getPolylinePositions(this,e)};zh.prototype.createFeatures=function(e,t){let n=this._batchIds,i=n.length;for(let r=0;r<i;++r){let o=n[r];t[o]=new ua(e,o)}};zh.prototype.applyDebugSettings=function(e,t){this._highlightColor=e?t:this._constantColor};function sft(e,t){let n=e._batchIds,i=n.length;for(let r=0;r<i;++r){let o=n[r],s=t[o];s.show=!0,s.color=z.WHITE}}var aft=new z,cft=z.WHITE,lft=!0;zh.prototype.applyStyle=function(e,t){if(!l(e)){sft(this,t);return}let n=this._batchIds,i=n.length;for(let r=0;r<i;++r){let o=n[r],s=t[o];s.color=l(e.color)?e.color.evaluateColor(s,aft):cft,s.show=l(e.show)?e.show.evaluate(s):lft}};zh.prototype.update=function(e){let t=e.context;if(!this._ready){if(l(this._promise)||(this._promise=Qut(this,t)),l(this._error)){let i=this._error;throw this._error=void 0,i}return}tft(this,t),rft(this,t),nft(this);let n=e.passes;(n.render||n.pick)&&oft(this,e)};zh.prototype.isDestroyed=function(){return!1};zh.prototype.destroy=function(){return this._va=this._va&&this._va.destroy(),this._sp=this._sp&&this._sp.destroy(),le(this)};var Lv=zh;function gg(e){this._positions=e.positions,this._widths=e.widths,this._counts=e.counts,this._batchIds=e.batchIds,this._ellipsoid=e.ellipsoid??ee.WGS84,this._minimumHeight=e.minimumHeight,this._maximumHeight=e.maximumHeight,this._center=e.center,this._rectangle=e.rectangle,this._batchTable=e.batchTable,this._va=void 0,this._sp=void 0,this._rs=void 0,this._uniformMap=void 0,this._command=void 0,this._transferrableBatchIds=void 0,this._packedBuffer=void 0,this._minimumMaximumVectorHeights=new U(Ni._defaultMinTerrainHeight,Ni._defaultMaxTerrainHeight),this._boundingVolume=en.fromRectangle(e.rectangle,Ni._defaultMinTerrainHeight,Ni._defaultMaxTerrainHeight,this._ellipsoid),this._classificationType=e.classificationType,this._keepDecodedPositions=e.keepDecodedPositions,this._decodedPositions=void 0,this._decodedPositionOffsets=void 0,this._startEllipsoidNormals=void 0,this._endEllipsoidNormals=void 0,this._startPositionAndHeights=void 0,this._startFaceNormalAndVertexCornerIds=void 0,this._endPositionAndHeights=void 0,this._endFaceNormalAndHalfWidths=void 0,this._vertexBatchIds=void 0,this._indices=void 0,this._constantColor=z.clone(z.WHITE),this._highlightColor=this._constantColor,this._trianglesLength=0,this._geometryByteLength=0,this._ready=!1,this._promise=void 0,this._error=void 0}Object.defineProperties(gg.prototype,{trianglesLength:{get:function(){return this._trianglesLength}},geometryByteLength:{get:function(){return this._geometryByteLength}},ready:{get:function(){return this._ready}}});function uft(e,t,n){let i=Ni.getMinimumMaximumHeights(t,n),r=i.minimumTerrainHeight,o=i.maximumTerrainHeight,s=e._minimumMaximumVectorHeights;s.x=r,s.y=o;let a=e._boundingVolume,c=e._rectangle;en.fromRectangle(c,r,o,n,a)}function fft(e){let t=e._rectangle,n=e._minimumHeight,i=e._maximumHeight,r=e._ellipsoid,o=e._center,s=2+ie.packedLength+ee.packedLength+h.packedLength,a=new Float64Array(s),c=0;return a[c++]=n,a[c++]=i,ie.pack(t,a,c),c+=ie.packedLength,ee.pack(r,a,c),c+=ee.packedLength,h.pack(o,a,c),a}var dft=new $n("createVectorTileClampedPolylines"),Uy={startEllipsoidNormal:0,endEllipsoidNormal:1,startPositionAndHeight:2,endPositionAndHeight:3,startFaceNormalAndVertexCorner:4,endFaceNormalAndHalfWidth:5,a_batchId:6};function hft(e,t){if(l(e._va))return;let n=e._positions,i=e._widths,r=e._counts,o=e._transferrableBatchIds,s=e._packedBuffer;l(s)||(n=e._positions=n.slice(),i=e._widths=i.slice(),r=e._counts=r.slice(),o=e._transferrableBatchIds=e._batchIds.slice(),s=e._packedBuffer=fft(e));let a=[n.buffer,i.buffer,r.buffer,o.buffer,s.buffer],c={positions:n.buffer,widths:i.buffer,counts:r.buffer,batchIds:o.buffer,packedBuffer:s.buffer,keepDecodedPositions:e._keepDecodedPositions},u=dft.scheduleTask(c,a);if(l(u))return u.then(function(f){if(e.isDestroyed())return;e._keepDecodedPositions&&(e._decodedPositions=new Float64Array(f.decodedPositions),e._decodedPositionOffsets=new Uint32Array(f.decodedPositionOffsets)),e._startEllipsoidNormals=new Float32Array(f.startEllipsoidNormals),e._endEllipsoidNormals=new Float32Array(f.endEllipsoidNormals),e._startPositionAndHeights=new Float32Array(f.startPositionAndHeights),e._startFaceNormalAndVertexCornerIds=new Float32Array(f.startFaceNormalAndVertexCornerIds),e._endPositionAndHeights=new Float32Array(f.endPositionAndHeights),e._endFaceNormalAndHalfWidths=new Float32Array(f.endFaceNormalAndHalfWidths),e._vertexBatchIds=new Uint16Array(f.vertexBatchIds);let d=f.indexDatatype;e._indices=d===je.UNSIGNED_SHORT?new Uint16Array(f.indices):new Uint32Array(f.indices),mft(e,t),e._ready=!0}).catch(f=>{e.isDestroyed()||(e._error=f)})}function mft(e,t){if(!l(e._va)){let n=e._startEllipsoidNormals,i=e._endEllipsoidNormals,r=e._startPositionAndHeights,o=e._endPositionAndHeights,s=e._startFaceNormalAndVertexCornerIds,a=e._endFaceNormalAndHalfWidths,c=e._vertexBatchIds,u=e._indices,f=n.byteLength+i.byteLength;f+=r.byteLength+o.byteLength,f+=s.byteLength+a.byteLength,f+=c.byteLength+u.byteLength,e._trianglesLength=u.length/3,e._geometryByteLength=f;let d=tt.createVertexBuffer({context:t,typedArray:n,usage:Me.STATIC_DRAW}),p=tt.createVertexBuffer({context:t,typedArray:i,usage:Me.STATIC_DRAW}),g=tt.createVertexBuffer({context:t,typedArray:r,usage:Me.STATIC_DRAW}),m=tt.createVertexBuffer({context:t,typedArray:o,usage:Me.STATIC_DRAW}),y=tt.createVertexBuffer({context:t,typedArray:s,usage:Me.STATIC_DRAW}),A=tt.createVertexBuffer({context:t,typedArray:a,usage:Me.STATIC_DRAW}),b=tt.createVertexBuffer({context:t,typedArray:c,usage:Me.STATIC_DRAW}),x=tt.createIndexBuffer({context:t,typedArray:u,usage:Me.STATIC_DRAW,indexDatatype:u.BYTES_PER_ELEMENT===2?je.UNSIGNED_SHORT:je.UNSIGNED_INT}),T=[{index:Uy.startEllipsoidNormal,vertexBuffer:d,componentDatatype:Y.FLOAT,componentsPerAttribute:3},{index:Uy.endEllipsoidNormal,vertexBuffer:p,componentDatatype:Y.FLOAT,componentsPerAttribute:3},{index:Uy.startPositionAndHeight,vertexBuffer:g,componentDatatype:Y.FLOAT,componentsPerAttribute:4},{index:Uy.endPositionAndHeight,vertexBuffer:m,componentDatatype:Y.FLOAT,componentsPerAttribute:4},{index:Uy.startFaceNormalAndVertexCorner,vertexBuffer:y,componentDatatype:Y.FLOAT,componentsPerAttribute:4},{index:Uy.endFaceNormalAndHalfWidth,vertexBuffer:A,componentDatatype:Y.FLOAT,componentsPerAttribute:4},{index:Uy.a_batchId,vertexBuffer:b,componentDatatype:Y.UNSIGNED_SHORT,componentsPerAttribute:1}];e._va=new Vn({context:t,attributes:T,indexBuffer:x}),e._positions=void 0,e._widths=void 0,e._counts=void 0,e._ellipsoid=void 0,e._minimumHeight=void 0,e._maximumHeight=void 0,e._rectangle=void 0,e._transferrableBatchIds=void 0,e._packedBuffer=void 0,e._startEllipsoidNormals=void 0,e._endEllipsoidNormals=void 0,e._startPositionAndHeights=void 0,e._startFaceNormalAndVertexCornerIds=void 0,e._endPositionAndHeights=void 0,e._endFaceNormalAndHalfWidths=void 0,e._vertexBatchIds=void 0,e._indices=void 0}}var A1=new M,JAe=new h;function pft(e,t){l(e._uniformMap)||(e._uniformMap={u_modifiedModelView:function(){let n=t.uniformState.view;return M.clone(n,A1),M.multiplyByPoint(A1,e._center,JAe),M.setTranslation(A1,JAe,A1),A1},u_highlightColor:function(){return e._highlightColor},u_minimumMaximumVectorHeights:function(){return e._minimumMaximumVectorHeights}})}function ZAe(e){return Ge.fromCache({cull:{enabled:!0,face:Gi.FRONT},blending:nn.PRE_MULTIPLIED_ALPHA_BLEND,depthMask:!1,stencilTest:{enabled:e,frontFunction:ti.EQUAL,frontOperation:{fail:Rt.KEEP,zFail:Rt.KEEP,zPass:Rt.KEEP},backFunction:ti.EQUAL,backOperation:{fail:Rt.KEEP,zFail:Rt.KEEP,zPass:Rt.KEEP},reference:Xt.CESIUM_3D_TILE_MASK,mask:Xt.CESIUM_3D_TILE_MASK}})}function gft(e){l(e._rs)||(e._rs=ZAe(!1),e._rs3DTiles=ZAe(!0))}function _ft(e,t){if(l(e._sp))return;let n=e._batchTable,i=n.getVertexShaderCallback(!1,"a_batchId",void 0)(ik),r=n.getFragmentShaderCallback(!1,void 0,!0)(nk),o=new Xe({defines:["VECTOR_TILE","CLIP_POLYLINE"],sources:[du,i]}),s=new Xe({defines:["VECTOR_TILE"],sources:[r]});e._sp=Qt.fromCache({context:t,vertexShaderSource:o,fragmentShaderSource:s,attributeLocations:Uy})}function yft(e,t){let n=e._command;if(!l(e._command)){let r=e._batchTable.getUniformMapCallback()(e._uniformMap);n=e._command=new at({owner:e,vertexArray:e._va,renderState:e._rs,shaderProgram:e._sp,uniformMap:r,boundingVolume:e._boundingVolume,pass:Ie.TERRAIN_CLASSIFICATION,pickId:e._batchTable.getPickId()});let o=at.shallowClone(n,n.derivedCommands.tileset);o.renderState=e._rs3DTiles,o.pass=Ie.CESIUM_3D_TILE_CLASSIFICATION,n.derivedCommands.tileset=o}let i=e._classificationType;(i===ei.TERRAIN||i===ei.BOTH)&&t.commandList.push(n),(i===ei.CESIUM_3D_TILE||i===ei.BOTH)&&t.commandList.push(n.derivedCommands.tileset)}gg.prototype.getPositions=function(e){return Lv.getPolylinePositions(this,e)};gg.prototype.createFeatures=function(e,t){let n=this._batchIds,i=n.length;for(let r=0;r<i;++r){let o=n[r];t[o]=new ua(e,o)}};gg.prototype.applyDebugSettings=function(e,t){this._highlightColor=e?t:this._constantColor};function Aft(e,t){let n=e._batchIds,i=n.length;for(let r=0;r<i;++r){let o=n[r],s=t[o];s.show=!0,s.color=z.WHITE}}var bft=new z,xft=z.WHITE,Tft=!0;gg.prototype.applyStyle=function(e,t){if(!l(e)){Aft(this,t);return}let n=this._batchIds,i=n.length;for(let r=0;r<i;++r){let o=n[r],s=t[o];s.color=l(e.color)?e.color.evaluateColor(s,bft):xft,s.show=l(e.show)?e.show.evaluate(s):Tft}};function Eft(e){return Ni.initialize().then(function(){uft(e,e._rectangle,e._ellipsoid)}).catch(t=>{e.isDestroyed()||(e._error=t)})}gg.prototype.update=function(e){let t=e.context;if(!this._ready){if(l(this._promise)||(this._promise=Eft(this).then(hft(this,t))),l(this._error)){let i=this._error;throw this._error=void 0,i}return}pft(this,t),_ft(this,t),gft(this);let n=e.passes;(n.render||n.pick)&&yft(this,e)};gg.prototype.isDestroyed=function(){return!1};gg.prototype.destroy=function(){return this._va=this._va&&this._va.destroy(),this._sp=this._sp&&this._sp.destroy(),le(this)};var h4=gg;var kZ=32767,Cft=new he,vft=new h;function Sft(e,t,n,i,r){let o=e.length/3,s=e.subarray(0,o),a=e.subarray(o,2*o),c=e.subarray(2*o,3*o);cn.zigZagDeltaDecode(s,a,c);let u=new Float64Array(e.length);for(let f=0;f<o;++f){let d=s[f],p=a[f],g=c[f],m=P.lerp(t.west,t.east,d/kZ),y=P.lerp(t.south,t.north,p/kZ),A=P.lerp(n,i,g/kZ),b=he.fromRadians(m,y,A,Cft),x=r.cartographicToCartesian(b,vft);h.pack(x,u,f*3)}return u}var m4=Sft;var zZ=class{constructor(t,n,i,r,o){this._tileset=t,this._tile=n,this._resource=i,this._polygons=void 0,this._polylines=void 0,this._points=void 0,this._metadata=void 0,this._batchTable=void 0,this._features=void 0,this.featurePropertiesDirty=!1,this._group=void 0,this._ready=!1,Rft(this,r,o)}get featuresLength(){return l(this._batchTable)?this._batchTable.featuresLength:0}get pointsLength(){return l(this._points)?this._points.pointsLength:0}get trianglesLength(){let t=0;return l(this._polygons)&&(t+=this._polygons.trianglesLength),l(this._polylines)&&(t+=this._polylines.trianglesLength),t}get geometryByteLength(){let t=0;return l(this._polygons)&&(t+=this._polygons.geometryByteLength),l(this._polylines)&&(t+=this._polylines.geometryByteLength),t}get texturesByteLength(){return l(this._points)?this._points.texturesByteLength:0}get batchTableByteLength(){return l(this._batchTable)?this._batchTable.batchTableByteLength:0}get innerContents(){}get ready(){return this._ready}get tileset(){return this._tileset}get tile(){return this._tile}get url(){return this._resource.getUrlComponent(!0)}get metadata(){return this._metadata}set metadata(t){this._metadata=t}get batchTable(){return this._batchTable}get group(){return this._group}set group(t){this._group=t}hasProperty(t,n){return this._batchTable.hasProperty(t,n)}getFeature(t){return l(this._features)||UZ(this),this._features[t]}applyDebugSettings(t,n){l(this._polygons)&&this._polygons.applyDebugSettings(t,n),l(this._polylines)&&this._polylines.applyDebugSettings(t,n),l(this._points)&&this._points.applyDebugSettings(t,n)}applyStyle(t){l(this._features)||UZ(this),l(this._polygons)&&this._polygons.applyStyle(t,this._features),l(this._polylines)&&this._polylines.applyStyle(t,this._features),l(this._points)&&this._points.applyStyle(t,this._features)}update(t,n){let i=!0;l(this._polygons)&&(this._polygons.classificationType=this._tileset.classificationType,this._polygons.debugWireframe=this._tileset.debugWireframe,this._polygons.update(n),i=i&&this._polygons.ready),l(this._polylines)&&(this._polylines.update(n),i=i&&this._polylines.ready),l(this._points)&&(this._points.update(n),i=i&&this._points.ready),l(this._batchTable)&&i&&(l(this._features)||UZ(this),this._batchTable.update(t,n),this._ready=!0)}pick(t,n,i){}getPolylinePositions(t){let n=this._polylines;if(l(n))return n.getPositions(t)}isDestroyed(){return!1}destroy(){return this._polygons=this._polygons&&this._polygons.destroy(),this._polylines=this._polylines&&this._polylines.destroy(),this._points=this._points&&this._points.destroy(),this._batchTable=this._batchTable&&this._batchTable.destroy(),le(this)}};function wft(e){return function(t,n){l(e._polygons)&&e._polygons.updateCommands(t,n)}}function Ift(e,t){let n,i,r,o,s=e.POLYGONS_LENGTH??0,a=e.POLYLINES_LENGTH??0,c=e.POINTS_LENGTH??0;if(s>0&&l(e.POLYGON_BATCH_IDS)){let p=t.byteOffset+e.POLYGON_BATCH_IDS.byteOffset;n=new Uint16Array(t.buffer,p,s)}if(a>0&&l(e.POLYLINE_BATCH_IDS)){let p=t.byteOffset+e.POLYLINE_BATCH_IDS.byteOffset;i=new Uint16Array(t.buffer,p,a)}if(c>0&&l(e.POINT_BATCH_IDS)){let p=t.byteOffset+e.POINT_BATCH_IDS.byteOffset;r=new Uint16Array(t.buffer,p,c)}let u=l(n)||l(i)||l(r),f=s>0&&!l(n)||a>0&&!l(i)||c>0&&!l(r);if(u&&f)throw new oe("If one group of batch ids is defined, then all batch ids must be defined");if(!l(n)&&!l(i)&&!l(r)){let p=0;if(!l(n)&&s>0)for(n=new Uint16Array(s),o=0;o<s;++o)n[o]=p++;if(!l(i)&&a>0)for(i=new Uint16Array(a),o=0;o<a;++o)i[o]=p++;if(!l(r)&&c>0)for(r=new Uint16Array(c),o=0;o<c;++o)r[o]=p++}return{polygons:n,polylines:i,points:r}}var Vh=Uint32Array.BYTES_PER_ELEMENT;function Pft(e){return new Lv(e)}function Dft(e){return new h4(e)}function Rft(e,t,n){n=n??0;let i=new Uint8Array(t),r=new DataView(t);n+=Vh;let o=r.getUint32(n,!0);if(o!==1)throw new oe(`Only Vector tile version 1 is supported. Version ${o} is not.`);n+=Vh;let s=r.getUint32(n,!0);if(n+=Vh,s===0){e._ready=!0;return}let a=r.getUint32(n,!0);if(n+=Vh,a===0)throw new oe("Feature table must have a byte length greater than zero");let c=r.getUint32(n,!0);n+=Vh;let u=r.getUint32(n,!0);n+=Vh;let f=r.getUint32(n,!0);n+=Vh;let d=r.getUint32(n,!0);n+=Vh;let p=r.getUint32(n,!0);n+=Vh;let g=r.getUint32(n,!0);n+=Vh,n+=Vh;let m=No(i,n,a);n+=a;let y=new Uint8Array(t,n,c);n+=c;let A,b;u>0&&(A=No(i,n,u),n+=u,f>0&&(b=new Uint8Array(t,n,f),b=new Uint8Array(b),n+=f));let x=m.POLYGONS_LENGTH??0,T=m.POLYLINES_LENGTH??0,E=m.POINTS_LENGTH??0,v=x+T+E,S=new lp(e,v,A,b,wft(e));if(e._batchTable=S,v===0)return;let I=new pp(m,y),R=I.getGlobalProperty("REGION");if(!l(R))throw new oe("Feature table global property: REGION must be defined");let O=ie.unpack(R),L=R[4],_=R[5],C=e._tile.computedTransform,w=I.getGlobalProperty("RTC_CENTER",Y.FLOAT,3);l(w)?(w=h.unpack(w),M.multiplyByPoint(C,w,w)):(w=ie.center(O),w.height=P.lerp(L,_,.5),w=ee.WGS84.cartographicToCartesian(w));let D=Ift(m,y);if(n+=(4-n%4)%4,x>0){I.featuresLength=x;let F=I.getPropertyArray("POLYGON_COUNTS",Y.UNSIGNED_INT,1)??I.getPropertyArray("POLYGON_COUNT",Y.UNSIGNED_INT,1);if(!l(F))throw new oe("Feature table property: POLYGON_COUNTS must be defined when POLYGONS_LENGTH is greater than 0");let V=I.getPropertyArray("POLYGON_INDEX_COUNTS",Y.UNSIGNED_INT,1)??I.getPropertyArray("POLYGON_INDEX_COUNT",Y.UNSIGNED_INT,1);if(!l(V))throw new oe("Feature table property: POLYGON_INDEX_COUNTS must be defined when POLYGONS_LENGTH is greater than 0");let B=F.reduce(function(W,J){return W+J*2},0),j=V.reduce(function(W,J){return W+J},0),k=new Uint32Array(t,n,j);n+=d;let G=new Uint16Array(t,n,B);n+=p;let q,Q;l(m.POLYGON_MINIMUM_HEIGHTS)&&l(m.POLYGON_MAXIMUM_HEIGHTS)&&(q=I.getPropertyArray("POLYGON_MINIMUM_HEIGHTS",Y.FLOAT,1),Q=I.getPropertyArray("POLYGON_MAXIMUM_HEIGHTS",Y.FLOAT,1)),e._polygons=new d4({positions:G,counts:F,indexCounts:V,indices:k,minimumHeight:L,maximumHeight:_,polygonMinimumHeights:q,polygonMaximumHeights:Q,center:w,rectangle:O,boundingVolume:e.tile.boundingVolume.boundingVolume,batchTable:S,batchIds:D.polygons,modelMatrix:C})}let N=e._tileset;if(T>0){I.featuresLength=T;let F=I.getPropertyArray("POLYLINE_COUNTS",Y.UNSIGNED_INT,1)??I.getPropertyArray("POLYLINE_COUNT",Y.UNSIGNED_INT,1);if(!l(F))throw new oe("Feature table property: POLYLINE_COUNTS must be defined when POLYLINES_LENGTH is greater than 0");let V=I.getPropertyArray("POLYLINE_WIDTHS",Y.UNSIGNED_SHORT,1);if(!l(V)){V=new Uint16Array(T);for(let q=0;q<T;++q)V[q]=2}let B=F.reduce(function(q,Q){return q+Q*3},0),j=new Uint16Array(t,n,B);n+=g;let k=N.examineVectorLinesFunction;if(l(k)){let q=m4(new Uint16Array(j),O,L,_,ee.WGS84);Oft(q,F,D.polylines,S,e.url,k)}let G=Pft;l(N.classificationType)&&(G=Dft),e._polylines=G({positions:j,widths:V,counts:F,batchIds:D.polylines,minimumHeight:L,maximumHeight:_,center:w,rectangle:O,boundingVolume:e.tile.boundingVolume.boundingVolume,batchTable:S,classificationType:N.classificationType,keepDecodedPositions:N.vectorKeepDecodedPositions})}if(E>0){let F=new Uint16Array(t,n,E*3);e._points=new f4({positions:F,batchIds:D.points,minimumHeight:L,maximumHeight:_,rectangle:O,batchTable:S,heightReference:N.heightReference,scene:N.scene})}}function UZ(e){let t=e.featuresLength;if(!l(e._features)&&t>0){let n=new Array(t);l(e._polygons)&&e._polygons.createFeatures(e,n),l(e._polylines)&&e._polylines.createFeatures(e,n),l(e._points)&&e._points.createFeatures(e,n),e._features=n}}function Oft(e,t,n,i,r,o){let s=t.length,a=0;for(let c=0;c<s;c++){let u=t[c]*3,f=e.slice(a,a+u);a+=u,o(f,n[c],r,i)}}var p4=zZ;var{ERR_CAPACITY:Xti}=da.Error,Mft=new h,g4=class g4 extends ms{constructor(){super(...arguments);ut(this,"_collection",null)}static clone(n,i){return super.clone(n,i),i.setPosition(n.getPosition(Mft)),i}get vertexOffset(){return this._getUint32(g4.Layout.POSITION_OFFSET_U32)}get vertexCount(){return 1}getPosition(n){let i=this._collection._positionView;return h.fromArray(i,this.vertexOffset*3,n)}setPosition(n){let i=this._collection,r=this.vertexOffset;i._positionView[r*3]=n.x,i._positionView[r*3+1]=n.y,i._positionView[r*3+2]=n.z,this._dirty=!0,i._makeDirtyBoundingVolume()}toJSON(){return{...super.toJSON(),position:h.pack(this.getPosition(),[])}}};ut(g4,"Layout",{...ms.Layout,POSITION_OFFSET_U32:ms.Layout.__BYTE_LENGTH,__BYTE_LENGTH:ms.Layout.__BYTE_LENGTH+4});var VZ=g4,tl=VZ;var b1=class b1 extends vu{constructor(t=H.EMPTY_OBJECT){super(t),this.size=t.size??1}static pack(t,n,i){super.pack(t,n,i),n.setUint8(this.Layout.SIZE_U8+i,t.size)}static unpack(t,n,i){return super.unpack(t,n,i),i.size=t.getUint8(this.Layout.SIZE_U8+n),i}toJSON(){return{...super.toJSON(),size:this.size}}};ut(b1,"Layout",{...vu.Layout,SIZE_U8:vu.Layout.__BYTE_LENGTH,__BYTE_LENGTH:vu.Layout.__BYTE_LENGTH+4}),ut(b1,"DEFAULT_MATERIAL",Object.freeze(new b1));var jZ=b1,wp=jZ;var HZ={positionHigh:0,positionLow:1,pickColor:2,showSizeColorAlpha:3,outlineWidthColorAlpha:4},QAe={position:0,pickColor:1,showSizeColorAlpha:2,outlineWidthColorAlpha:3},Sx=new tl,jh=new wp,x1=new z,ebe=new h,GZ=new Sn;function Nft(e,t,n){let i=t.context;n=n||{destroy:Lft};let r=e._positionDatatype===Y.DOUBLE,o=r?HZ:QAe;if(!l(n.attributeArrays)){let a=e.primitiveCountMax;n.attributeArrays={...r?{positionHigh:new Float32Array(a*3),positionLow:new Float32Array(a*3)}:{position:e._positionView},pickColor:new Uint8Array(a*4),showSizeColorAlpha:new Float32Array(a*4),outlineWidthColorAlpha:new Float32Array(a*3)}}if(e._dirtyCount>0){let{attributeArrays:a}=n,c=a.positionHigh,u=a.positionLow,f=a.pickColor,d=a.showSizeColorAlpha,p=a.outlineWidthColorAlpha,{_dirtyOffset:g,_dirtyCount:m}=e;for(let y=g,A=g+m;y<A;y++)e.get(y,Sx),Sx._dirty&&(r&&(Sx.getPosition(ebe),Sn.fromCartesian(ebe,GZ),h.pack(GZ.high,c,y*3),h.pack(GZ.low,u,y*3)),Sx.getMaterial(jh),z.fromRgba(Sx._pickId,x1),f[y*4]=z.floatToByte(x1.red),f[y*4+1]=z.floatToByte(x1.green),f[y*4+2]=z.floatToByte(x1.blue),f[y*4+3]=z.floatToByte(x1.alpha),d[y*4]=Sx.show?1:0,d[y*4+1]=jh.size,d[y*4+2]=cn.encodeRGB8(jh.color),d[y*4+3]=jh.color.alpha,p[y*3]=jh.outlineWidth,p[y*3+1]=cn.encodeRGB8(jh.outlineWidth>0?jh.outlineColor:jh.color),p[y*3+2]=jh.outlineWidth>0?jh.outlineColor.alpha:jh.color.alpha,Sx._dirty=!1)}if(l(n.vertexArray)){if(e._dirtyCount>0){for(let a in o)if(Object.hasOwn(o,a)){let c=a;n.vertexArray.copyAttributeFromRange(o[c],n.attributeArrays[c],e._dirtyOffset,e._dirtyCount)}}}else{let{attributeArrays:a}=n;n.vertexArray=new Vn({context:i,attributes:[...r?[{index:HZ.positionHigh,componentDatatype:Y.FLOAT,componentsPerAttribute:3,vertexBuffer:tt.createVertexBuffer({typedArray:a.positionHigh,context:i,usage:Me.STATIC_DRAW})},{index:HZ.positionLow,componentDatatype:Y.FLOAT,componentsPerAttribute:3,vertexBuffer:tt.createVertexBuffer({typedArray:a.positionLow,context:i,usage:Me.STATIC_DRAW})}]:[{index:QAe.position,componentDatatype:e._positionDatatype,componentsPerAttribute:3,normalize:e._positionNormalized,vertexBuffer:tt.createVertexBuffer({typedArray:e._positionView,context:i,usage:Me.STATIC_DRAW})}],{index:o.pickColor,componentDatatype:Y.UNSIGNED_BYTE,componentsPerAttribute:4,vertexBuffer:tt.createVertexBuffer({typedArray:a.pickColor,context:i,usage:Me.STATIC_DRAW})},{index:o.showSizeColorAlpha,componentDatatype:Y.FLOAT,componentsPerAttribute:4,vertexBuffer:tt.createVertexBuffer({typedArray:a.showSizeColorAlpha,context:i,usage:Me.STATIC_DRAW})},{index:o.outlineWidthColorAlpha,componentDatatype:Y.FLOAT,componentsPerAttribute:3,vertexBuffer:tt.createVertexBuffer({typedArray:a.outlineWidthColorAlpha,context:i,usage:Me.STATIC_DRAW})}]})}l(n.renderState)||(n.renderState=Ge.fromCache({blending:e._blendOption===ki.OPAQUE?nn.DISABLED:nn.ALPHA_BLEND,depthTest:{enabled:!0}})),l(n.shaderProgram)||(n.shaderProgram=Qt.fromCache({context:i,vertexShaderSource:new Xe({sources:[_2],defines:r?["USE_FLOAT64"]:[]}),fragmentShaderSource:new Xe({sources:[g2]}),attributeLocations:o})),l(n.command)||(n.command=new at({vertexArray:n.vertexArray,renderState:n.renderState,shaderProgram:n.shaderProgram,primitiveType:Oe.POINTS,pass:e._blendOption===ki.OPAQUE?Ie.OPAQUE:Ie.TRANSLUCENT,pickId:e._allowPicking?"v_pickColor":void 0,owner:e,count:e.primitiveCount,modelMatrix:e.modelMatrix,boundingVolume:e.boundingVolume,debugShowBoundingVolume:e.debugShowBoundingVolume}));let s=n.command;return s.count!==e.primitiveCount&&(s.count=e.primitiveCount),s.debugShowBoundingVolume!==e.debugShowBoundingVolume&&(s.debugShowBoundingVolume=e.debugShowBoundingVolume),t.commandList.push(s),e._makeClean(),n}function Lft(){let e=this;l(e.vertexArray)&&e.vertexArray.destroy(),l(e.shaderProgram)&&e.shaderProgram.destroy(),l(e.renderState)&&Ge.removeFromCache(e.renderState)}var _4=Nft;var WZ=class e extends da{constructor(t=H.EMPTY_OBJECT){super({...t,vertexCountMax:t.primitiveCountMax})}_getCollectionClass(){return e}_getPrimitiveClass(){return tl}_getMaterialClass(){return wp}_cloneEmpty(t=H.EMPTY_OBJECT){return new e(this._cloneEmptyBaseArgs(t))}add(t,n=new tl){return super.add(t,n),n._setUint32(tl.Layout.POSITION_OFFSET_U32,this._positionCount++),n.setPosition(t.position??h.ZERO),n}update(t){super.update(t);let n=t.passes;this.show&&(n.render||n.pick)&&(this._renderContext=_4(this,t,this._renderContext))}},bf=WZ;var wx={positionHigh:0,positionLow:1,prevPositionHigh:2,prevPositionLow:3,nextPositionHigh:4,nextPositionLow:5,pickColor:6,showColorWidthAndTexCoord:7,alpha:8},y4={position:0,prevPosition:1,nextPosition:2,pickColor:3,showColorWidthAndTexCoord:4,alpha:5},nl=new Oa,T1=new gd,E1=new z,tbe=new h,nbe=new h,ibe=new h,qZ=new Sn,YZ=new Sn,XZ=new Sn;function Fft(e,t,n){let i=t.context;n=n||{destroy:Uft};let r=e._positionDatatype===Y.DOUBLE,o=r?wx:y4;if(!l(n.attributeArrays)||!l(n.indexArray)){let c=e.vertexCountMax-e.primitiveCount,u=e.vertexCountMax*2;n.indexArray=je.createTypedArray(u,c*6),n.attributeArrays={...r?{positionHigh:new Float32Array(u*3),positionLow:new Float32Array(u*3),prevPositionHigh:new Float32Array(u*3),prevPositionLow:new Float32Array(u*3),nextPositionHigh:new Float32Array(u*3),nextPositionLow:new Float32Array(u*3)}:{position:Y.createTypedArray(e._positionDatatype,u*3),prevPosition:Y.createTypedArray(e._positionDatatype,u*3),nextPosition:Y.createTypedArray(e._positionDatatype,u*3)},pickColor:new Uint8Array(u*4),showColorWidthAndTexCoord:new Float32Array(u*4),alpha:new Uint8Array(u)}}if(e._dirtyCount>0){let{_dirtyOffset:c,_dirtyCount:u}=e,f=e.widthUnits==="meters",d=n.indexArray,{pickColor:p,showColorWidthAndTexCoord:g,alpha:m,position:y,prevPosition:A,nextPosition:b,positionHigh:x,positionLow:T,prevPositionHigh:E,prevPositionLow:v,nextPositionHigh:S,nextPositionLow:I}=n.attributeArrays;for(let R=c,O=c+u;R<O;R++){if(e.get(R,nl),!nl._dirty)continue;nl.getMaterial(T1);let L=cn.encodeRGB8(T1.color),_=T1.color.alpha,C=f?-T1.width:T1.width;z.fromRgba(nl._pickId,E1);let w=nl.show,D=nl.vertexOffset*2,N=(nl.vertexOffset-R)*6,F=e._positionView,V=nl.vertexOffset*3;for(let B=0,j=nl.vertexCount;B<j;B++){let k=B===0,G=B===j-1,q=F[V+B*3],Q=F[V+B*3+1],W=F[V+B*3+2],J,Z,ae,Ae,fe,xe;k?(Ae=F[V+3],fe=F[V+3+1],xe=F[V+3+2],J=2*q-Ae,Z=2*Q-fe,ae=2*W-xe):G?(J=F[V+(B-1)*3],Z=F[V+(B-1)*3+1],ae=F[V+(B-1)*3+2],Ae=2*q-J,fe=2*Q-Z,xe=2*W-ae):(J=F[V+(B-1)*3],Z=F[V+(B-1)*3+1],ae=F[V+(B-1)*3+2],Ae=F[V+(B+1)*3],fe=F[V+(B+1)*3+1],xe=F[V+(B+1)*3+2]),G||(d[N]=D,d[N+1]=D+1,d[N+2]=D+2,d[N+3]=D+2,d[N+4]=D+1,d[N+5]=D+3,N+=6),r&&(h.fromElements(q,Q,W,tbe),h.fromElements(J,Z,ae,nbe),h.fromElements(Ae,fe,xe,ibe),Sn.fromCartesian(tbe,qZ),Sn.fromCartesian(nbe,YZ),Sn.fromCartesian(ibe,XZ));for(let ge=0;ge<2;ge++)r?(h.pack(qZ.high,x,D*3),h.pack(qZ.low,T,D*3),h.pack(YZ.high,E,D*3),h.pack(YZ.low,v,D*3),h.pack(XZ.high,S,D*3),h.pack(XZ.low,I,D*3)):(y[D*3]=q,y[D*3+1]=Q,y[D*3+2]=W,A[D*3]=J,A[D*3+1]=Z,A[D*3+2]=ae,b[D*3]=Ae,b[D*3+1]=fe,b[D*3+2]=xe),p[D*4]=z.floatToByte(E1.red),p[D*4+1]=z.floatToByte(E1.green),p[D*4+2]=z.floatToByte(E1.blue),p[D*4+3]=z.floatToByte(E1.alpha),g[D*4]=w?1:0,g[D*4+1]=L,g[D*4+2]=C,g[D*4+3]=B/(j-1),m[D]=_*255,D++}nl._dirty=!1}}if(l(n.vertexArray)){if(e._dirtyCount>0){let{indexOffset:c,indexCount:u,vertexOffset:f,vertexCount:d}=kft(e);n.vertexArray.copyIndexFromRange(n.indexArray,c,u);for(let p in o)if(Object.hasOwn(o,p)){let g=p;n.vertexArray.copyAttributeFromRange(o[g],n.attributeArrays[g],f,d)}}}else{let c=n.attributeArrays;n.vertexArray=new Vn({context:i,indexBuffer:tt.createIndexBuffer({context:i,typedArray:n.indexArray,usage:Me.STATIC_DRAW,indexDatatype:je.fromTypedArray(n.indexArray)}),attributes:[...r?[{index:wx.positionHigh,componentDatatype:Y.FLOAT,componentsPerAttribute:3,vertexBuffer:tt.createVertexBuffer({typedArray:c.positionHigh,context:i,usage:Me.STATIC_DRAW})},{index:wx.positionLow,componentDatatype:Y.FLOAT,componentsPerAttribute:3,vertexBuffer:tt.createVertexBuffer({typedArray:c.positionLow,context:i,usage:Me.STATIC_DRAW})},{index:wx.prevPositionHigh,componentDatatype:Y.FLOAT,componentsPerAttribute:3,vertexBuffer:tt.createVertexBuffer({typedArray:c.prevPositionHigh,context:i,usage:Me.STATIC_DRAW})},{index:wx.prevPositionLow,componentDatatype:Y.FLOAT,componentsPerAttribute:3,vertexBuffer:tt.createVertexBuffer({typedArray:c.prevPositionLow,context:i,usage:Me.STATIC_DRAW})},{index:wx.nextPositionHigh,componentDatatype:Y.FLOAT,componentsPerAttribute:3,vertexBuffer:tt.createVertexBuffer({typedArray:c.nextPositionHigh,context:i,usage:Me.STATIC_DRAW})},{index:wx.nextPositionLow,componentDatatype:Y.FLOAT,componentsPerAttribute:3,vertexBuffer:tt.createVertexBuffer({typedArray:c.nextPositionLow,context:i,usage:Me.STATIC_DRAW})}]:[{index:y4.position,componentDatatype:e._positionDatatype,componentsPerAttribute:3,normalize:e._positionNormalized,vertexBuffer:tt.createVertexBuffer({typedArray:c.position,context:i,usage:Me.STATIC_DRAW})},{index:y4.prevPosition,componentDatatype:e._positionDatatype,componentsPerAttribute:3,normalize:e._positionNormalized,vertexBuffer:tt.createVertexBuffer({typedArray:c.prevPosition,context:i,usage:Me.STATIC_DRAW})},{index:y4.nextPosition,componentDatatype:e._positionDatatype,componentsPerAttribute:3,normalize:e._positionNormalized,vertexBuffer:tt.createVertexBuffer({typedArray:c.nextPosition,context:i,usage:Me.STATIC_DRAW})}],{index:o.pickColor,componentDatatype:Y.UNSIGNED_BYTE,componentsPerAttribute:4,vertexBuffer:tt.createVertexBuffer({typedArray:c.pickColor,context:i,usage:Me.STATIC_DRAW})},{index:o.showColorWidthAndTexCoord,componentDatatype:Y.FLOAT,componentsPerAttribute:4,vertexBuffer:tt.createVertexBuffer({typedArray:c.showColorWidthAndTexCoord,context:i,usage:Me.STATIC_DRAW})},{index:o.alpha,componentDatatype:Y.UNSIGNED_BYTE,componentsPerAttribute:1,vertexBuffer:tt.createVertexBuffer({typedArray:c.alpha,context:i,usage:Me.STATIC_DRAW})}]})}l(n.renderState)||(n.renderState=Ge.fromCache({blending:e._blendOption===ki.OPAQUE?nn.DISABLED:nn.ALPHA_BLEND,depthTest:{enabled:!0}})),l(n.shaderProgram)||(n.shaderProgram=Qt.fromCache({context:i,vertexShaderSource:new Xe({sources:[du,x2],defines:r?["USE_FLOAT64"]:[]}),fragmentShaderSource:new Xe({sources:[b2]}),attributeLocations:o}));let s=Bft(e);l(n.command)||(n.command=new at({vertexArray:n.vertexArray,renderState:n.renderState,shaderProgram:n.shaderProgram,primitiveType:Oe.TRIANGLES,pass:e._blendOption===ki.OPAQUE?Ie.OPAQUE:Ie.TRANSLUCENT,pickId:e._allowPicking?"v_pickColor":void 0,owner:e,count:s,modelMatrix:e.modelMatrix,boundingVolume:e.boundingVolume,debugShowBoundingVolume:e.debugShowBoundingVolume}));let a=n.command;return a.count!==s&&(a.count=s),a.debugShowBoundingVolume!==e.debugShowBoundingVolume&&(a.debugShowBoundingVolume=e.debugShowBoundingVolume),t.commandList.push(a),e._makeClean(),n}function Bft(e){return(e.vertexCount-e.primitiveCount)*6}function kft(e){let{_dirtyOffset:t,_dirtyCount:n}=e;e.get(t,nl);let i=nl.vertexOffset*2,o=(nl.vertexOffset-t)*6;e.get(t+n-1,nl);let s=(nl.vertexOffset+nl.vertexCount)*2-i,c=(s/2-n)*6;return{indexOffset:o,indexCount:c,vertexOffset:i,vertexCount:s}}function Uft(){let e=this;l(e.vertexArray)&&e.vertexArray.destroy(),l(e.shaderProgram)&&e.shaderProgram.destroy(),l(e.renderState)&&Ge.removeFromCache(e.renderState)}var A4=Fft;var KZ=class e extends da{constructor(t=H.EMPTY_OBJECT){super(t);let n=t.widthUnits??"pixels";this._widthUnits=n}get widthUnits(){return this._widthUnits}_getCollectionClass(){return e}_getPrimitiveClass(){return Oa}_getMaterialClass(){return gd}_cloneEmpty(t=H.EMPTY_OBJECT){return new e({widthUnits:this._widthUnits,...this._cloneEmptyBaseArgs(t)})}add(t,n=new Oa){super.add(t,n);let i=this._positionCount;return n._setUint32(Oa.Layout.POSITION_OFFSET_U32,i),n._setUint32(Oa.Layout.POSITION_COUNT_U32,0),l(t.positions)&&n.setPositions(t.positions),n}update(t){super.update(t),this._isRendered(t)&&(this._renderContext=A4(this,t,this._renderContext))}},Ul=KZ;function Fv(e,t){this._conditionsExpression=Ze(e,!0),this._conditions=e.conditions,this._runtimeConditions=void 0,Vft(this,t)}Object.defineProperties(Fv.prototype,{conditionsExpression:{get:function(){return this._conditionsExpression}}});function zft(e,t){this.condition=e,this.expression=t}function Vft(e,t){let n=[],i=e._conditions;if(!l(i))return;let r=i.length;for(let o=0;o<r;++o){let s=i[o],a=String(s[0]),c=String(s[1]);n.push(new zft(new vh(a,t),new vh(c,t)))}e._runtimeConditions=n}Fv.prototype.evaluate=function(e,t){let n=this._runtimeConditions;if(!l(n))return;let i=n.length;for(let r=0;r<i;++r){let o=n[r];if(o.condition.evaluate(e))return o.expression.evaluate(e,t)}};Fv.prototype.evaluateColor=function(e,t){let n=this._runtimeConditions;if(!l(n))return;let i=n.length;for(let r=0;r<i;++r){let o=n[r];if(o.condition.evaluate(e))return o.expression.evaluateColor(e,t)}};Fv.prototype.getShaderFunction=function(e,t,n,i){let r=this._runtimeConditions;if(!l(r)||r.length===0)return;let o="",s=r.length;for(let a=0;a<s;++a){let c=r[a],u=c.condition.getShaderExpression(t,n),f=c.expression.getShaderExpression(t,n);o+=` ${a===0?"if":"else if"} (${u}) +`;function Xpt(e,t){if(l(e._sp))return;let n=e._batchTable,i=n.getVertexShaderCallback(!1,"a_batchId",void 0)(rk),r=n.getFragmentShaderCallback(!1,void 0,!1)(Ypt),o=new Xe({defines:["VECTOR_TILE","CLIP_POLYLINE"],sources:[du,i]}),s=new Xe({defines:["VECTOR_TILE"],sources:[r]});e._sp=Qt.fromCache({context:t,vertexShaderSource:o,fragmentShaderSource:s,attributeLocations:AS})}function Kpt(e,t){if(!l(e._command)){let n=e._batchTable.getUniformMapCallback()(e._uniformMap);e._command=new at({owner:e,vertexArray:e._va,renderState:e._rs,shaderProgram:e._sp,uniformMap:n,boundingVolume:e._boundingVolume,pass:Ie.TRANSLUCENT,pickId:e._batchTable.getPickId()})}t.commandList.push(e._command)}Zh.getPolylinePositions=function(e,t){let n=e._batchIds,i=e._decodedPositions,r=e._decodedPositionOffsets;if(!l(n)||!l(i))return;let o,s,a=n.length,c=0,u=0;for(o=0;o<a;++o)n[o]===t&&(c+=r[o+1]-r[o]);if(c===0)return;let f=new Float64Array(c*3);for(o=0;o<a;++o)if(n[o]===t){let d=r[o],p=r[o+1]-d;for(s=0;s<p;++s){let g=(d+s)*3;f[u++]=i[g],f[u++]=i[g+1],f[u++]=i[g+2]}}return f};Zh.prototype.getPositions=function(e){return Zh.getPolylinePositions(this,e)};Zh.prototype.createFeatures=function(e,t){let n=this._batchIds,i=n.length;for(let r=0;r<i;++r){let o=n[r];t[o]=new ma(e,o)}};Zh.prototype.applyDebugSettings=function(e,t){this._highlightColor=e?t:this._constantColor};function $pt(e,t){let n=e._batchIds,i=n.length;for(let r=0;r<i;++r){let o=n[r],s=t[o];s.show=!0,s.color=z.WHITE}}var Jpt=new z,Zpt=z.WHITE,Qpt=!0;Zh.prototype.applyStyle=function(e,t){if(!l(e)){$pt(this,t);return}let n=this._batchIds,i=n.length;for(let r=0;r<i;++r){let o=n[r],s=t[o];s.color=l(e.color)?e.color.evaluateColor(s,Jpt):Zpt,s.show=l(e.show)?e.show.evaluate(s):Qpt}};Zh.prototype.update=function(e){let t=e.context;if(!this._ready){if(l(this._promise)||(this._promise=Hpt(this,t)),l(this._error)){let i=this._error;throw this._error=void 0,i}return}Wpt(this,t),Xpt(this,t),qpt(this);let n=e.passes;(n.render||n.pick)&&Kpt(this,e)};Zh.prototype.isDestroyed=function(){return!1};Zh.prototype.destroy=function(){return this._va=this._va&&this._va.destroy(),this._sp=this._sp&&this._sp.destroy(),le(this)};var bS=Zh;function vg(e){this._positions=e.positions,this._widths=e.widths,this._counts=e.counts,this._batchIds=e.batchIds,this._ellipsoid=e.ellipsoid??ee.WGS84,this._minimumHeight=e.minimumHeight,this._maximumHeight=e.maximumHeight,this._center=e.center,this._rectangle=e.rectangle,this._batchTable=e.batchTable,this._va=void 0,this._sp=void 0,this._rs=void 0,this._uniformMap=void 0,this._command=void 0,this._transferrableBatchIds=void 0,this._packedBuffer=void 0,this._minimumMaximumVectorHeights=new U(Ni._defaultMinTerrainHeight,Ni._defaultMaxTerrainHeight),this._boundingVolume=en.fromRectangle(e.rectangle,Ni._defaultMinTerrainHeight,Ni._defaultMaxTerrainHeight,this._ellipsoid),this._classificationType=e.classificationType,this._keepDecodedPositions=e.keepDecodedPositions,this._decodedPositions=void 0,this._decodedPositionOffsets=void 0,this._startEllipsoidNormals=void 0,this._endEllipsoidNormals=void 0,this._startPositionAndHeights=void 0,this._startFaceNormalAndVertexCornerIds=void 0,this._endPositionAndHeights=void 0,this._endFaceNormalAndHalfWidths=void 0,this._vertexBatchIds=void 0,this._indices=void 0,this._constantColor=z.clone(z.WHITE),this._highlightColor=this._constantColor,this._trianglesLength=0,this._geometryByteLength=0,this._ready=!1,this._promise=void 0,this._error=void 0}Object.defineProperties(vg.prototype,{trianglesLength:{get:function(){return this._trianglesLength}},geometryByteLength:{get:function(){return this._geometryByteLength}},ready:{get:function(){return this._ready}}});function e0t(e,t,n){let i=Ni.getMinimumMaximumHeights(t,n),r=i.minimumTerrainHeight,o=i.maximumTerrainHeight,s=e._minimumMaximumVectorHeights;s.x=r,s.y=o;let a=e._boundingVolume,c=e._rectangle;en.fromRectangle(c,r,o,n,a)}function t0t(e){let t=e._rectangle,n=e._minimumHeight,i=e._maximumHeight,r=e._ellipsoid,o=e._center,s=2+ie.packedLength+ee.packedLength+h.packedLength,a=new Float64Array(s),c=0;return a[c++]=n,a[c++]=i,ie.pack(t,a,c),c+=ie.packedLength,ee.pack(r,a,c),c+=ee.packedLength,h.pack(o,a,c),a}var n0t=new $n("createVectorTileClampedPolylines"),Yy={startEllipsoidNormal:0,endEllipsoidNormal:1,startPositionAndHeight:2,endPositionAndHeight:3,startFaceNormalAndVertexCorner:4,endFaceNormalAndHalfWidth:5,a_batchId:6};function i0t(e,t){if(l(e._va))return;let n=e._positions,i=e._widths,r=e._counts,o=e._transferrableBatchIds,s=e._packedBuffer;l(s)||(n=e._positions=n.slice(),i=e._widths=i.slice(),r=e._counts=r.slice(),o=e._transferrableBatchIds=e._batchIds.slice(),s=e._packedBuffer=t0t(e));let a=[n.buffer,i.buffer,r.buffer,o.buffer,s.buffer],c={positions:n.buffer,widths:i.buffer,counts:r.buffer,batchIds:o.buffer,packedBuffer:s.buffer,keepDecodedPositions:e._keepDecodedPositions},u=n0t.scheduleTask(c,a);if(l(u))return u.then(function(f){if(e.isDestroyed())return;e._keepDecodedPositions&&(e._decodedPositions=new Float64Array(f.decodedPositions),e._decodedPositionOffsets=new Uint32Array(f.decodedPositionOffsets)),e._startEllipsoidNormals=new Float32Array(f.startEllipsoidNormals),e._endEllipsoidNormals=new Float32Array(f.endEllipsoidNormals),e._startPositionAndHeights=new Float32Array(f.startPositionAndHeights),e._startFaceNormalAndVertexCornerIds=new Float32Array(f.startFaceNormalAndVertexCornerIds),e._endPositionAndHeights=new Float32Array(f.endPositionAndHeights),e._endFaceNormalAndHalfWidths=new Float32Array(f.endFaceNormalAndHalfWidths),e._vertexBatchIds=new Uint16Array(f.vertexBatchIds);let d=f.indexDatatype;e._indices=d===je.UNSIGNED_SHORT?new Uint16Array(f.indices):new Uint32Array(f.indices),r0t(e,t),e._ready=!0}).catch(f=>{e.isDestroyed()||(e._error=f)})}function r0t(e,t){if(!l(e._va)){let n=e._startEllipsoidNormals,i=e._endEllipsoidNormals,r=e._startPositionAndHeights,o=e._endPositionAndHeights,s=e._startFaceNormalAndVertexCornerIds,a=e._endFaceNormalAndHalfWidths,c=e._vertexBatchIds,u=e._indices,f=n.byteLength+i.byteLength;f+=r.byteLength+o.byteLength,f+=s.byteLength+a.byteLength,f+=c.byteLength+u.byteLength,e._trianglesLength=u.length/3,e._geometryByteLength=f;let d=tt.createVertexBuffer({context:t,typedArray:n,usage:Me.STATIC_DRAW}),p=tt.createVertexBuffer({context:t,typedArray:i,usage:Me.STATIC_DRAW}),g=tt.createVertexBuffer({context:t,typedArray:r,usage:Me.STATIC_DRAW}),m=tt.createVertexBuffer({context:t,typedArray:o,usage:Me.STATIC_DRAW}),y=tt.createVertexBuffer({context:t,typedArray:s,usage:Me.STATIC_DRAW}),A=tt.createVertexBuffer({context:t,typedArray:a,usage:Me.STATIC_DRAW}),b=tt.createVertexBuffer({context:t,typedArray:c,usage:Me.STATIC_DRAW}),x=tt.createIndexBuffer({context:t,typedArray:u,usage:Me.STATIC_DRAW,indexDatatype:u.BYTES_PER_ELEMENT===2?je.UNSIGNED_SHORT:je.UNSIGNED_INT}),T=[{index:Yy.startEllipsoidNormal,vertexBuffer:d,componentDatatype:Y.FLOAT,componentsPerAttribute:3},{index:Yy.endEllipsoidNormal,vertexBuffer:p,componentDatatype:Y.FLOAT,componentsPerAttribute:3},{index:Yy.startPositionAndHeight,vertexBuffer:g,componentDatatype:Y.FLOAT,componentsPerAttribute:4},{index:Yy.endPositionAndHeight,vertexBuffer:m,componentDatatype:Y.FLOAT,componentsPerAttribute:4},{index:Yy.startFaceNormalAndVertexCorner,vertexBuffer:y,componentDatatype:Y.FLOAT,componentsPerAttribute:4},{index:Yy.endFaceNormalAndHalfWidth,vertexBuffer:A,componentDatatype:Y.FLOAT,componentsPerAttribute:4},{index:Yy.a_batchId,vertexBuffer:b,componentDatatype:Y.UNSIGNED_SHORT,componentsPerAttribute:1}];e._va=new Vn({context:t,attributes:T,indexBuffer:x}),e._positions=void 0,e._widths=void 0,e._counts=void 0,e._ellipsoid=void 0,e._minimumHeight=void 0,e._maximumHeight=void 0,e._rectangle=void 0,e._transferrableBatchIds=void 0,e._packedBuffer=void 0,e._startEllipsoidNormals=void 0,e._endEllipsoidNormals=void 0,e._startPositionAndHeights=void 0,e._startFaceNormalAndVertexCornerIds=void 0,e._endPositionAndHeights=void 0,e._endFaceNormalAndHalfWidths=void 0,e._vertexBatchIds=void 0,e._indices=void 0}}var W1=new M,QTe=new h;function o0t(e,t){l(e._uniformMap)||(e._uniformMap={u_modifiedModelView:function(){let n=t.uniformState.view;return M.clone(n,W1),M.multiplyByPoint(W1,e._center,QTe),M.setTranslation(W1,QTe,W1),W1},u_highlightColor:function(){return e._highlightColor},u_minimumMaximumVectorHeights:function(){return e._minimumMaximumVectorHeights}})}function eEe(e){return Ge.fromCache({cull:{enabled:!0,face:Hi.FRONT},blending:nn.PRE_MULTIPLIED_ALPHA_BLEND,depthMask:!1,stencilTest:{enabled:e,frontFunction:ei.EQUAL,frontOperation:{fail:Rt.KEEP,zFail:Rt.KEEP,zPass:Rt.KEEP},backFunction:ei.EQUAL,backOperation:{fail:Rt.KEEP,zFail:Rt.KEEP,zPass:Rt.KEEP},reference:Xt.CESIUM_3D_TILE_MASK,mask:Xt.CESIUM_3D_TILE_MASK}})}function s0t(e){l(e._rs)||(e._rs=eEe(!1),e._rs3DTiles=eEe(!0))}function a0t(e,t){if(l(e._sp))return;let n=e._batchTable,i=n.getVertexShaderCallback(!1,"a_batchId",void 0)(ik),r=n.getFragmentShaderCallback(!1,void 0,!0)(nk),o=new Xe({defines:["VECTOR_TILE","CLIP_POLYLINE"],sources:[du,i]}),s=new Xe({defines:["VECTOR_TILE"],sources:[r]});e._sp=Qt.fromCache({context:t,vertexShaderSource:o,fragmentShaderSource:s,attributeLocations:Yy})}function c0t(e,t){let n=e._command;if(!l(e._command)){let r=e._batchTable.getUniformMapCallback()(e._uniformMap);n=e._command=new at({owner:e,vertexArray:e._va,renderState:e._rs,shaderProgram:e._sp,uniformMap:r,boundingVolume:e._boundingVolume,pass:Ie.TERRAIN_CLASSIFICATION,pickId:e._batchTable.getPickId()});let o=at.shallowClone(n,n.derivedCommands.tileset);o.renderState=e._rs3DTiles,o.pass=Ie.CESIUM_3D_TILE_CLASSIFICATION,n.derivedCommands.tileset=o}let i=e._classificationType;(i===Qn.TERRAIN||i===Qn.BOTH)&&t.commandList.push(n),(i===Qn.CESIUM_3D_TILE||i===Qn.BOTH)&&t.commandList.push(n.derivedCommands.tileset)}vg.prototype.getPositions=function(e){return bS.getPolylinePositions(this,e)};vg.prototype.createFeatures=function(e,t){let n=this._batchIds,i=n.length;for(let r=0;r<i;++r){let o=n[r];t[o]=new ma(e,o)}};vg.prototype.applyDebugSettings=function(e,t){this._highlightColor=e?t:this._constantColor};function l0t(e,t){let n=e._batchIds,i=n.length;for(let r=0;r<i;++r){let o=n[r],s=t[o];s.show=!0,s.color=z.WHITE}}var u0t=new z,f0t=z.WHITE,d0t=!0;vg.prototype.applyStyle=function(e,t){if(!l(e)){l0t(this,t);return}let n=this._batchIds,i=n.length;for(let r=0;r<i;++r){let o=n[r],s=t[o];s.color=l(e.color)?e.color.evaluateColor(s,u0t):f0t,s.show=l(e.show)?e.show.evaluate(s):d0t}};function h0t(e){return Ni.initialize().then(function(){e0t(e,e._rectangle,e._ellipsoid)}).catch(t=>{e.isDestroyed()||(e._error=t)})}vg.prototype.update=function(e){let t=e.context;if(!this._ready){if(l(this._promise)||(this._promise=h0t(this).then(i0t(this,t))),l(this._error)){let i=this._error;throw this._error=void 0,i}return}o0t(this,t),a0t(this,t),s0t(this);let n=e.passes;(n.render||n.pick)&&c0t(this,e)};vg.prototype.isDestroyed=function(){return!1};vg.prototype.destroy=function(){return this._va=this._va&&this._va.destroy(),this._sp=this._sp&&this._sp.destroy(),le(this)};var p8=vg;var MQ=32767,m0t=new he,p0t=new h;function g0t(e,t,n,i,r){let o=e.length/3,s=e.subarray(0,o),a=e.subarray(o,2*o),c=e.subarray(2*o,3*o);cn.zigZagDeltaDecode(s,a,c);let u=new Float64Array(e.length);for(let f=0;f<o;++f){let d=s[f],p=a[f],g=c[f],m=P.lerp(t.west,t.east,d/MQ),y=P.lerp(t.south,t.north,p/MQ),A=P.lerp(n,i,g/MQ),b=he.fromRadians(m,y,A,m0t),x=r.cartographicToCartesian(b,p0t);h.pack(x,u,f*3)}return u}var g8=g0t;var LQ=class{constructor(t,n,i,r,o){this._tileset=t,this._tile=n,this._resource=i,this._polygons=void 0,this._polylines=void 0,this._points=void 0,this._metadata=void 0,this._batchTable=void 0,this._features=void 0,this.featurePropertiesDirty=!1,this._group=void 0,this._ready=!1,x0t(this,r,o)}get featuresLength(){return l(this._batchTable)?this._batchTable.featuresLength:0}get pointsLength(){return l(this._points)?this._points.pointsLength:0}get trianglesLength(){let t=0;return l(this._polygons)&&(t+=this._polygons.trianglesLength),l(this._polylines)&&(t+=this._polylines.trianglesLength),t}get geometryByteLength(){let t=0;return l(this._polygons)&&(t+=this._polygons.geometryByteLength),l(this._polylines)&&(t+=this._polylines.geometryByteLength),t}get texturesByteLength(){return l(this._points)?this._points.texturesByteLength:0}get batchTableByteLength(){return l(this._batchTable)?this._batchTable.batchTableByteLength:0}get innerContents(){}get ready(){return this._ready}get tileset(){return this._tileset}get tile(){return this._tile}get url(){return this._resource.getUrlComponent(!0)}get metadata(){return this._metadata}set metadata(t){this._metadata=t}get batchTable(){return this._batchTable}get group(){return this._group}set group(t){this._group=t}hasProperty(t,n){return this._batchTable.hasProperty(t,n)}getFeature(t){return l(this._features)||NQ(this),this._features[t]}applyDebugSettings(t,n){l(this._polygons)&&this._polygons.applyDebugSettings(t,n),l(this._polylines)&&this._polylines.applyDebugSettings(t,n),l(this._points)&&this._points.applyDebugSettings(t,n)}applyStyle(t){l(this._features)||NQ(this),l(this._polygons)&&this._polygons.applyStyle(t,this._features),l(this._polylines)&&this._polylines.applyStyle(t,this._features),l(this._points)&&this._points.applyStyle(t,this._features)}update(t,n){let i=!0;l(this._polygons)&&(this._polygons.classificationType=this._tileset.classificationType,this._polygons.debugWireframe=this._tileset.debugWireframe,this._polygons.update(n),i=i&&this._polygons.ready),l(this._polylines)&&(this._polylines.update(n),i=i&&this._polylines.ready),l(this._points)&&(this._points.update(n),i=i&&this._points.ready),l(this._batchTable)&&i&&(l(this._features)||NQ(this),this._batchTable.update(t,n),this._ready=!0)}pick(t,n,i){}getPolylinePositions(t){let n=this._polylines;if(l(n))return n.getPositions(t)}isDestroyed(){return!1}destroy(){return this._polygons=this._polygons&&this._polygons.destroy(),this._polylines=this._polylines&&this._polylines.destroy(),this._points=this._points&&this._points.destroy(),this._batchTable=this._batchTable&&this._batchTable.destroy(),le(this)}};function _0t(e){return function(t,n){l(e._polygons)&&e._polygons.updateCommands(t,n)}}function y0t(e,t){let n,i,r,o,s=e.POLYGONS_LENGTH??0,a=e.POLYLINES_LENGTH??0,c=e.POINTS_LENGTH??0;if(s>0&&l(e.POLYGON_BATCH_IDS)){let p=t.byteOffset+e.POLYGON_BATCH_IDS.byteOffset;n=new Uint16Array(t.buffer,p,s)}if(a>0&&l(e.POLYLINE_BATCH_IDS)){let p=t.byteOffset+e.POLYLINE_BATCH_IDS.byteOffset;i=new Uint16Array(t.buffer,p,a)}if(c>0&&l(e.POINT_BATCH_IDS)){let p=t.byteOffset+e.POINT_BATCH_IDS.byteOffset;r=new Uint16Array(t.buffer,p,c)}let u=l(n)||l(i)||l(r),f=s>0&&!l(n)||a>0&&!l(i)||c>0&&!l(r);if(u&&f)throw new oe("If one group of batch ids is defined, then all batch ids must be defined");if(!l(n)&&!l(i)&&!l(r)){let p=0;if(!l(n)&&s>0)for(n=new Uint16Array(s),o=0;o<s;++o)n[o]=p++;if(!l(i)&&a>0)for(i=new Uint16Array(a),o=0;o<a;++o)i[o]=p++;if(!l(r)&&c>0)for(r=new Uint16Array(c),o=0;o<c;++o)r[o]=p++}return{polygons:n,polylines:i,points:r}}var Qh=Uint32Array.BYTES_PER_ELEMENT;function A0t(e){return new bS(e)}function b0t(e){return new p8(e)}function x0t(e,t,n){n=n??0;let i=new Uint8Array(t),r=new DataView(t);n+=Qh;let o=r.getUint32(n,!0);if(o!==1)throw new oe(`Only Vector tile version 1 is supported. Version ${o} is not.`);n+=Qh;let s=r.getUint32(n,!0);if(n+=Qh,s===0){e._ready=!0;return}let a=r.getUint32(n,!0);if(n+=Qh,a===0)throw new oe("Feature table must have a byte length greater than zero");let c=r.getUint32(n,!0);n+=Qh;let u=r.getUint32(n,!0);n+=Qh;let f=r.getUint32(n,!0);n+=Qh;let d=r.getUint32(n,!0);n+=Qh;let p=r.getUint32(n,!0);n+=Qh;let g=r.getUint32(n,!0);n+=Qh,n+=Qh;let m=Fo(i,n,a);n+=a;let y=new Uint8Array(t,n,c);n+=c;let A,b;u>0&&(A=Fo(i,n,u),n+=u,f>0&&(b=new Uint8Array(t,n,f),b=new Uint8Array(b),n+=f));let x=m.POLYGONS_LENGTH??0,T=m.POLYLINES_LENGTH??0,E=m.POINTS_LENGTH??0,v=x+T+E,S=new vp(e,v,A,b,_0t(e));if(e._batchTable=S,v===0)return;let I=new Cp(m,y),R=I.getGlobalProperty("REGION");if(!l(R))throw new oe("Feature table global property: REGION must be defined");let O=ie.unpack(R),L=R[4],_=R[5],C=e._tile.computedTransform,w=I.getGlobalProperty("RTC_CENTER",Y.FLOAT,3);l(w)?(w=h.unpack(w),M.multiplyByPoint(C,w,w)):(w=ie.center(O),w.height=P.lerp(L,_,.5),w=ee.WGS84.cartographicToCartesian(w));let D=y0t(m,y);if(n+=(4-n%4)%4,x>0){I.featuresLength=x;let F=I.getPropertyArray("POLYGON_COUNTS",Y.UNSIGNED_INT,1)??I.getPropertyArray("POLYGON_COUNT",Y.UNSIGNED_INT,1);if(!l(F))throw new oe("Feature table property: POLYGON_COUNTS must be defined when POLYGONS_LENGTH is greater than 0");let V=I.getPropertyArray("POLYGON_INDEX_COUNTS",Y.UNSIGNED_INT,1)??I.getPropertyArray("POLYGON_INDEX_COUNT",Y.UNSIGNED_INT,1);if(!l(V))throw new oe("Feature table property: POLYGON_INDEX_COUNTS must be defined when POLYGONS_LENGTH is greater than 0");let B=F.reduce(function(W,J){return W+J*2},0),j=V.reduce(function(W,J){return W+J},0),k=new Uint32Array(t,n,j);n+=d;let G=new Uint16Array(t,n,B);n+=p;let q,Q;l(m.POLYGON_MINIMUM_HEIGHTS)&&l(m.POLYGON_MAXIMUM_HEIGHTS)&&(q=I.getPropertyArray("POLYGON_MINIMUM_HEIGHTS",Y.FLOAT,1),Q=I.getPropertyArray("POLYGON_MAXIMUM_HEIGHTS",Y.FLOAT,1)),e._polygons=new m8({positions:G,counts:F,indexCounts:V,indices:k,minimumHeight:L,maximumHeight:_,polygonMinimumHeights:q,polygonMaximumHeights:Q,center:w,rectangle:O,boundingVolume:e.tile.boundingVolume.boundingVolume,batchTable:S,batchIds:D.polygons,modelMatrix:C})}let N=e._tileset;if(T>0){I.featuresLength=T;let F=I.getPropertyArray("POLYLINE_COUNTS",Y.UNSIGNED_INT,1)??I.getPropertyArray("POLYLINE_COUNT",Y.UNSIGNED_INT,1);if(!l(F))throw new oe("Feature table property: POLYLINE_COUNTS must be defined when POLYLINES_LENGTH is greater than 0");let V=I.getPropertyArray("POLYLINE_WIDTHS",Y.UNSIGNED_SHORT,1);if(!l(V)){V=new Uint16Array(T);for(let q=0;q<T;++q)V[q]=2}let B=F.reduce(function(q,Q){return q+Q*3},0),j=new Uint16Array(t,n,B);n+=g;let k=N.examineVectorLinesFunction;if(l(k)){let q=g8(new Uint16Array(j),O,L,_,ee.WGS84);T0t(q,F,D.polylines,S,e.url,k)}let G=A0t;l(N.classificationType)&&(G=b0t),e._polylines=G({positions:j,widths:V,counts:F,batchIds:D.polylines,minimumHeight:L,maximumHeight:_,center:w,rectangle:O,boundingVolume:e.tile.boundingVolume.boundingVolume,batchTable:S,classificationType:N.classificationType,keepDecodedPositions:N.vectorKeepDecodedPositions})}if(E>0){let F=new Uint16Array(t,n,E*3);e._points=new h8({positions:F,batchIds:D.points,minimumHeight:L,maximumHeight:_,rectangle:O,batchTable:S,heightReference:N.heightReference,scene:N.scene})}}function NQ(e){let t=e.featuresLength;if(!l(e._features)&&t>0){let n=new Array(t);l(e._polygons)&&e._polygons.createFeatures(e,n),l(e._polylines)&&e._polylines.createFeatures(e,n),l(e._points)&&e._points.createFeatures(e,n),e._features=n}}function T0t(e,t,n,i,r,o){let s=t.length,a=0;for(let c=0;c<s;c++){let u=t[c]*3,f=e.slice(a,a+u);a+=u,o(f,n[c],r,i)}}var _8=LQ;var{ERR_CAPACITY:Rgi}=da.Error,E0t=new h,y8=class y8 extends ms{constructor(){super(...arguments);ut(this,"_collection",null)}static clone(n,i){return super.clone(n,i),i.setPosition(n.getPosition(E0t)),i}get vertexOffset(){return this._getUint32(y8.Layout.POSITION_OFFSET_U32)}get vertexCount(){return 1}getPosition(n){let i=this._collection._positionView;return h.fromArray(i,this.vertexOffset*3,n)}setPosition(n){let i=this._collection,r=this.vertexOffset;i._positionView[r*3]=n.x,i._positionView[r*3+1]=n.y,i._positionView[r*3+2]=n.z,this._dirty=!0,i._makeDirtyBoundingVolume()}toJSON(){return{...super.toJSON(),position:h.pack(this.getPosition(),[])}}};ut(y8,"Layout",{...ms.Layout,POSITION_OFFSET_U32:ms.Layout.__BYTE_LENGTH,__BYTE_LENGTH:ms.Layout.__BYTE_LENGTH+4});var FQ=y8,il=FQ;var q1=class q1 extends Cu{constructor(t=H.EMPTY_OBJECT){super(t),this.size=t.size??1}static pack(t,n,i){super.pack(t,n,i),n.setUint8(this.Layout.SIZE_U8+i,t.size)}static unpack(t,n,i){return super.unpack(t,n,i),i.size=t.getUint8(this.Layout.SIZE_U8+n),i}toJSON(){return{...super.toJSON(),size:this.size}}};ut(q1,"Layout",{...Cu.Layout,SIZE_U8:Cu.Layout.__BYTE_LENGTH,__BYTE_LENGTH:Cu.Layout.__BYTE_LENGTH+4}),ut(q1,"DEFAULT_MATERIAL",Object.freeze(new q1));var BQ=q1,Bp=BQ;var kQ={positionHigh:0,positionLow:1,pickColor:2,showSizeColorAlpha:3,outlineWidthColorAlpha:4},tEe={position:0,pickColor:1,showSizeColorAlpha:2,outlineWidthColorAlpha:3},Bx=new il,em=new Bp,Y1=new z,nEe=new h,UQ=new Sn;function C0t(e,t,n){let i=t.context;n=n||{destroy:v0t};let r=e._positionDatatype===Y.DOUBLE,o=r?kQ:tEe;if(!l(n.attributeArrays)){let a=e.primitiveCountMax;n.attributeArrays={...r?{positionHigh:new Float32Array(a*3),positionLow:new Float32Array(a*3)}:{position:e._positionView},pickColor:new Uint8Array(a*4),showSizeColorAlpha:new Float32Array(a*4),outlineWidthColorAlpha:new Float32Array(a*3)}}if(e._dirtyCount>0){let{attributeArrays:a}=n,c=a.positionHigh,u=a.positionLow,f=a.pickColor,d=a.showSizeColorAlpha,p=a.outlineWidthColorAlpha,{_dirtyOffset:g,_dirtyCount:m}=e;for(let y=g,A=g+m;y<A;y++)e.get(y,Bx),Bx._dirty&&(r&&(Bx.getPosition(nEe),Sn.fromCartesian(nEe,UQ),h.pack(UQ.high,c,y*3),h.pack(UQ.low,u,y*3)),Bx.getMaterial(em),z.fromRgba(Bx._pickId,Y1),f[y*4]=z.floatToByte(Y1.red),f[y*4+1]=z.floatToByte(Y1.green),f[y*4+2]=z.floatToByte(Y1.blue),f[y*4+3]=z.floatToByte(Y1.alpha),d[y*4]=Bx.show?1:0,d[y*4+1]=em.size,d[y*4+2]=cn.encodeRGB8(em.color),d[y*4+3]=em.color.alpha,p[y*3]=em.outlineWidth,p[y*3+1]=cn.encodeRGB8(em.outlineWidth>0?em.outlineColor:em.color),p[y*3+2]=em.outlineWidth>0?em.outlineColor.alpha:em.color.alpha,Bx._dirty=!1)}if(l(n.vertexArray)){if(e._dirtyCount>0){for(let a in o)if(Object.hasOwn(o,a)){let c=a;n.vertexArray.copyAttributeFromRange(o[c],n.attributeArrays[c],e._dirtyOffset,e._dirtyCount)}}}else{let{attributeArrays:a}=n;n.vertexArray=new Vn({context:i,attributes:[...r?[{index:kQ.positionHigh,componentDatatype:Y.FLOAT,componentsPerAttribute:3,vertexBuffer:tt.createVertexBuffer({typedArray:a.positionHigh,context:i,usage:Me.STATIC_DRAW})},{index:kQ.positionLow,componentDatatype:Y.FLOAT,componentsPerAttribute:3,vertexBuffer:tt.createVertexBuffer({typedArray:a.positionLow,context:i,usage:Me.STATIC_DRAW})}]:[{index:tEe.position,componentDatatype:e._positionDatatype,componentsPerAttribute:3,normalize:e._positionNormalized,vertexBuffer:tt.createVertexBuffer({typedArray:e._positionView,context:i,usage:Me.STATIC_DRAW})}],{index:o.pickColor,componentDatatype:Y.UNSIGNED_BYTE,componentsPerAttribute:4,vertexBuffer:tt.createVertexBuffer({typedArray:a.pickColor,context:i,usage:Me.STATIC_DRAW})},{index:o.showSizeColorAlpha,componentDatatype:Y.FLOAT,componentsPerAttribute:4,vertexBuffer:tt.createVertexBuffer({typedArray:a.showSizeColorAlpha,context:i,usage:Me.STATIC_DRAW})},{index:o.outlineWidthColorAlpha,componentDatatype:Y.FLOAT,componentsPerAttribute:3,vertexBuffer:tt.createVertexBuffer({typedArray:a.outlineWidthColorAlpha,context:i,usage:Me.STATIC_DRAW})}]})}l(n.renderState)||(n.renderState=Ge.fromCache({blending:e._blendOption===Bi.OPAQUE?nn.DISABLED:nn.ALPHA_BLEND,depthTest:{enabled:!0}})),l(n.shaderProgram)||(n.shaderProgram=Qt.fromCache({context:i,vertexShaderSource:new Xe({sources:[_2],defines:r?["USE_FLOAT64"]:[]}),fragmentShaderSource:new Xe({sources:[g2]}),attributeLocations:o})),l(n.command)||(n.command=new at({vertexArray:n.vertexArray,renderState:n.renderState,shaderProgram:n.shaderProgram,primitiveType:Oe.POINTS,pass:e._blendOption===Bi.OPAQUE?Ie.OPAQUE:Ie.TRANSLUCENT,pickId:e._allowPicking?"v_pickColor":void 0,owner:e,count:e.primitiveCount,modelMatrix:e.modelMatrix,boundingVolume:e.boundingVolume,debugShowBoundingVolume:e.debugShowBoundingVolume}));let s=n.command;return s.count!==e.primitiveCount&&(s.count=e.primitiveCount),s.debugShowBoundingVolume!==e.debugShowBoundingVolume&&(s.debugShowBoundingVolume=e.debugShowBoundingVolume),t.commandList.push(s),e._makeClean(),n}function v0t(){let e=this;l(e.vertexArray)&&e.vertexArray.destroy(),l(e.shaderProgram)&&e.shaderProgram.destroy(),l(e.renderState)&&Ge.removeFromCache(e.renderState)}var A8=C0t;var zQ=class e extends da{constructor(t=H.EMPTY_OBJECT){super({...t,vertexCountMax:t.primitiveCountMax})}_getCollectionClass(){return e}_getPrimitiveClass(){return il}_getMaterialClass(){return Bp}_cloneEmpty(t=H.EMPTY_OBJECT){return new e(this._cloneEmptyBaseArgs(t))}add(t,n=new il){return super.add(t,n),n._setUint32(il.Layout.POSITION_OFFSET_U32,this._positionCount++),n.setPosition(t.position??h.ZERO),n}update(t){super.update(t);let n=t.passes;this.show&&(n.render||n.pick)&&(this._renderContext=A8(this,t,this._renderContext))}},vf=zQ;var kx={positionHigh:0,positionLow:1,prevPositionHigh:2,prevPositionLow:3,nextPositionHigh:4,nextPositionLow:5,pickColor:6,showColorWidthAndTexCoord:7,alpha:8},b8={position:0,prevPosition:1,nextPosition:2,pickColor:3,showColorWidthAndTexCoord:4,alpha:5},rl=new Oa,X1=new Cd,K1=new z,iEe=new h,rEe=new h,oEe=new h,VQ=new Sn,jQ=new Sn,HQ=new Sn;function S0t(e,t,n){let i=t.context;n=n||{destroy:P0t};let r=e._positionDatatype===Y.DOUBLE,o=r?kx:b8;if(!l(n.attributeArrays)||!l(n.indexArray)){let c=e.vertexCountMax-e.primitiveCount,u=e.vertexCountMax*2;n.indexArray=je.createTypedArray(u,c*6),n.attributeArrays={...r?{positionHigh:new Float32Array(u*3),positionLow:new Float32Array(u*3),prevPositionHigh:new Float32Array(u*3),prevPositionLow:new Float32Array(u*3),nextPositionHigh:new Float32Array(u*3),nextPositionLow:new Float32Array(u*3)}:{position:Y.createTypedArray(e._positionDatatype,u*3),prevPosition:Y.createTypedArray(e._positionDatatype,u*3),nextPosition:Y.createTypedArray(e._positionDatatype,u*3)},pickColor:new Uint8Array(u*4),showColorWidthAndTexCoord:new Float32Array(u*4),alpha:new Uint8Array(u)}}if(e._dirtyCount>0){let{_dirtyOffset:c,_dirtyCount:u}=e,f=e.widthUnits==="meters",d=n.indexArray,{pickColor:p,showColorWidthAndTexCoord:g,alpha:m,position:y,prevPosition:A,nextPosition:b,positionHigh:x,positionLow:T,prevPositionHigh:E,prevPositionLow:v,nextPositionHigh:S,nextPositionLow:I}=n.attributeArrays;for(let R=c,O=c+u;R<O;R++){if(e.get(R,rl),!rl._dirty)continue;rl.getMaterial(X1);let L=cn.encodeRGB8(X1.color),_=X1.color.alpha,C=f?-X1.width:X1.width;z.fromRgba(rl._pickId,K1);let w=rl.show,D=rl.vertexOffset*2,N=(rl.vertexOffset-R)*6,F=e._positionView,V=rl.vertexOffset*3;for(let B=0,j=rl.vertexCount;B<j;B++){let k=B===0,G=B===j-1,q=F[V+B*3],Q=F[V+B*3+1],W=F[V+B*3+2],J,Z,ae,Ae,fe,xe;k?(Ae=F[V+3],fe=F[V+3+1],xe=F[V+3+2],J=2*q-Ae,Z=2*Q-fe,ae=2*W-xe):G?(J=F[V+(B-1)*3],Z=F[V+(B-1)*3+1],ae=F[V+(B-1)*3+2],Ae=2*q-J,fe=2*Q-Z,xe=2*W-ae):(J=F[V+(B-1)*3],Z=F[V+(B-1)*3+1],ae=F[V+(B-1)*3+2],Ae=F[V+(B+1)*3],fe=F[V+(B+1)*3+1],xe=F[V+(B+1)*3+2]),G||(d[N]=D,d[N+1]=D+1,d[N+2]=D+2,d[N+3]=D+2,d[N+4]=D+1,d[N+5]=D+3,N+=6),r&&(h.fromElements(q,Q,W,iEe),h.fromElements(J,Z,ae,rEe),h.fromElements(Ae,fe,xe,oEe),Sn.fromCartesian(iEe,VQ),Sn.fromCartesian(rEe,jQ),Sn.fromCartesian(oEe,HQ));for(let ge=0;ge<2;ge++)r?(h.pack(VQ.high,x,D*3),h.pack(VQ.low,T,D*3),h.pack(jQ.high,E,D*3),h.pack(jQ.low,v,D*3),h.pack(HQ.high,S,D*3),h.pack(HQ.low,I,D*3)):(y[D*3]=q,y[D*3+1]=Q,y[D*3+2]=W,A[D*3]=J,A[D*3+1]=Z,A[D*3+2]=ae,b[D*3]=Ae,b[D*3+1]=fe,b[D*3+2]=xe),p[D*4]=z.floatToByte(K1.red),p[D*4+1]=z.floatToByte(K1.green),p[D*4+2]=z.floatToByte(K1.blue),p[D*4+3]=z.floatToByte(K1.alpha),g[D*4]=w?1:0,g[D*4+1]=L,g[D*4+2]=C,g[D*4+3]=B/(j-1),m[D]=_*255,D++}rl._dirty=!1}}if(l(n.vertexArray)){if(e._dirtyCount>0){let{indexOffset:c,indexCount:u,vertexOffset:f,vertexCount:d}=I0t(e);n.vertexArray.copyIndexFromRange(n.indexArray,c,u);for(let p in o)if(Object.hasOwn(o,p)){let g=p;n.vertexArray.copyAttributeFromRange(o[g],n.attributeArrays[g],f,d)}}}else{let c=n.attributeArrays;n.vertexArray=new Vn({context:i,indexBuffer:tt.createIndexBuffer({context:i,typedArray:n.indexArray,usage:Me.STATIC_DRAW,indexDatatype:je.fromTypedArray(n.indexArray)}),attributes:[...r?[{index:kx.positionHigh,componentDatatype:Y.FLOAT,componentsPerAttribute:3,vertexBuffer:tt.createVertexBuffer({typedArray:c.positionHigh,context:i,usage:Me.STATIC_DRAW})},{index:kx.positionLow,componentDatatype:Y.FLOAT,componentsPerAttribute:3,vertexBuffer:tt.createVertexBuffer({typedArray:c.positionLow,context:i,usage:Me.STATIC_DRAW})},{index:kx.prevPositionHigh,componentDatatype:Y.FLOAT,componentsPerAttribute:3,vertexBuffer:tt.createVertexBuffer({typedArray:c.prevPositionHigh,context:i,usage:Me.STATIC_DRAW})},{index:kx.prevPositionLow,componentDatatype:Y.FLOAT,componentsPerAttribute:3,vertexBuffer:tt.createVertexBuffer({typedArray:c.prevPositionLow,context:i,usage:Me.STATIC_DRAW})},{index:kx.nextPositionHigh,componentDatatype:Y.FLOAT,componentsPerAttribute:3,vertexBuffer:tt.createVertexBuffer({typedArray:c.nextPositionHigh,context:i,usage:Me.STATIC_DRAW})},{index:kx.nextPositionLow,componentDatatype:Y.FLOAT,componentsPerAttribute:3,vertexBuffer:tt.createVertexBuffer({typedArray:c.nextPositionLow,context:i,usage:Me.STATIC_DRAW})}]:[{index:b8.position,componentDatatype:e._positionDatatype,componentsPerAttribute:3,normalize:e._positionNormalized,vertexBuffer:tt.createVertexBuffer({typedArray:c.position,context:i,usage:Me.STATIC_DRAW})},{index:b8.prevPosition,componentDatatype:e._positionDatatype,componentsPerAttribute:3,normalize:e._positionNormalized,vertexBuffer:tt.createVertexBuffer({typedArray:c.prevPosition,context:i,usage:Me.STATIC_DRAW})},{index:b8.nextPosition,componentDatatype:e._positionDatatype,componentsPerAttribute:3,normalize:e._positionNormalized,vertexBuffer:tt.createVertexBuffer({typedArray:c.nextPosition,context:i,usage:Me.STATIC_DRAW})}],{index:o.pickColor,componentDatatype:Y.UNSIGNED_BYTE,componentsPerAttribute:4,vertexBuffer:tt.createVertexBuffer({typedArray:c.pickColor,context:i,usage:Me.STATIC_DRAW})},{index:o.showColorWidthAndTexCoord,componentDatatype:Y.FLOAT,componentsPerAttribute:4,vertexBuffer:tt.createVertexBuffer({typedArray:c.showColorWidthAndTexCoord,context:i,usage:Me.STATIC_DRAW})},{index:o.alpha,componentDatatype:Y.UNSIGNED_BYTE,componentsPerAttribute:1,vertexBuffer:tt.createVertexBuffer({typedArray:c.alpha,context:i,usage:Me.STATIC_DRAW})}]})}l(n.renderState)||(n.renderState=Ge.fromCache({blending:e._blendOption===Bi.OPAQUE?nn.DISABLED:nn.ALPHA_BLEND,depthTest:{enabled:!0}})),l(n.shaderProgram)||(n.shaderProgram=Qt.fromCache({context:i,vertexShaderSource:new Xe({sources:[du,x2],defines:r?["USE_FLOAT64"]:[]}),fragmentShaderSource:new Xe({sources:[b2]}),attributeLocations:o}));let s=w0t(e);l(n.command)||(n.command=new at({vertexArray:n.vertexArray,renderState:n.renderState,shaderProgram:n.shaderProgram,primitiveType:Oe.TRIANGLES,pass:e._blendOption===Bi.OPAQUE?Ie.OPAQUE:Ie.TRANSLUCENT,pickId:e._allowPicking?"v_pickColor":void 0,owner:e,count:s,modelMatrix:e.modelMatrix,boundingVolume:e.boundingVolume,debugShowBoundingVolume:e.debugShowBoundingVolume}));let a=n.command;return a.count!==s&&(a.count=s),a.debugShowBoundingVolume!==e.debugShowBoundingVolume&&(a.debugShowBoundingVolume=e.debugShowBoundingVolume),t.commandList.push(a),e._makeClean(),n}function w0t(e){return(e.vertexCount-e.primitiveCount)*6}function I0t(e){let{_dirtyOffset:t,_dirtyCount:n}=e;e.get(t,rl);let i=rl.vertexOffset*2,o=(rl.vertexOffset-t)*6;e.get(t+n-1,rl);let s=(rl.vertexOffset+rl.vertexCount)*2-i,c=(s/2-n)*6;return{indexOffset:o,indexCount:c,vertexOffset:i,vertexCount:s}}function P0t(){let e=this;l(e.vertexArray)&&e.vertexArray.destroy(),l(e.shaderProgram)&&e.shaderProgram.destroy(),l(e.renderState)&&Ge.removeFromCache(e.renderState)}var x8=S0t;var GQ=class e extends da{constructor(t=H.EMPTY_OBJECT){super(t);let n=t.widthUnits??"pixels";this._widthUnits=n}get widthUnits(){return this._widthUnits}_getCollectionClass(){return e}_getPrimitiveClass(){return Oa}_getMaterialClass(){return Cd}_cloneEmpty(t=H.EMPTY_OBJECT){return new e({widthUnits:this._widthUnits,...this._cloneEmptyBaseArgs(t)})}add(t,n=new Oa){super.add(t,n);let i=this._positionCount;return n._setUint32(Oa.Layout.POSITION_OFFSET_U32,i),n._setUint32(Oa.Layout.POSITION_COUNT_U32,0),l(t.positions)&&n.setPositions(t.positions),n}update(t){super.update(t),this._isRendered(t)&&(this._renderContext=x8(this,t,this._renderContext))}},Hl=GQ;function xS(e,t){this._conditionsExpression=Ze(e,!0),this._conditions=e.conditions,this._runtimeConditions=void 0,R0t(this,t)}Object.defineProperties(xS.prototype,{conditionsExpression:{get:function(){return this._conditionsExpression}}});function D0t(e,t){this.condition=e,this.expression=t}function R0t(e,t){let n=[],i=e._conditions;if(!l(i))return;let r=i.length;for(let o=0;o<r;++o){let s=i[o],a=String(s[0]),c=String(s[1]);n.push(new D0t(new Yh(a,t),new Yh(c,t)))}e._runtimeConditions=n}xS.prototype.evaluate=function(e,t){let n=this._runtimeConditions;if(!l(n))return;let i=n.length;for(let r=0;r<i;++r){let o=n[r];if(o.condition.evaluate(e))return o.expression.evaluate(e,t)}};xS.prototype.evaluateColor=function(e,t){let n=this._runtimeConditions;if(!l(n))return;let i=n.length;for(let r=0;r<i;++r){let o=n[r];if(o.condition.evaluate(e))return o.expression.evaluateColor(e,t)}};xS.prototype.getShaderFunction=function(e,t,n,i){let r=this._runtimeConditions;if(!l(r)||r.length===0)return;let o="",s=r.length;for(let a=0;a<s;++a){let c=r[a],u=c.condition.getShaderExpression(t,n),f=c.expression.getShaderExpression(t,n);o+=` ${a===0?"if":"else if"} (${u}) { return ${f}; } @@ -9956,20 +9956,20 @@ void main() { ${o} return ${i}(1.0); } -`,o};Fv.prototype.getVariables=function(){let e=[],t=this._runtimeConditions;if(!l(t)||t.length===0)return e;let n=t.length;for(let i=0;i<n;++i){let r=t[i];Zn(e,r.condition.getVariables()),Zn(e,r.expression.getVariables())}return e=e.filter(function(i,r,o){return o.indexOf(i)===r}),e};var b4=Fv;function zy(e){this._style={},this._ready=!1,this._show=void 0,this._color=void 0,this._pointSize=void 0,this._pointOutlineColor=void 0,this._pointOutlineWidth=void 0,this._labelColor=void 0,this._labelOutlineColor=void 0,this._labelOutlineWidth=void 0,this._font=void 0,this._labelStyle=void 0,this._labelText=void 0,this._backgroundColor=void 0,this._backgroundPadding=void 0,this._backgroundEnabled=void 0,this._scaleByDistance=void 0,this._translucencyByDistance=void 0,this._distanceDisplayCondition=void 0,this._heightOffset=void 0,this._anchorLineEnabled=void 0,this._anchorLineColor=void 0,this._image=void 0,this._disableDepthTestDistance=void 0,this._horizontalOrigin=void 0,this._verticalOrigin=void 0,this._labelHorizontalOrigin=void 0,this._labelVerticalOrigin=void 0,this._meta=void 0,this._lineWidth=void 0,this._colorShaderFunction=void 0,this._showShaderFunction=void 0,this._pointSizeShaderFunction=void 0,this._colorShaderFunctionReady=!1,this._showShaderFunctionReady=!1,this._pointSizeShaderFunctionReady=!1,this._colorShaderTranslucent=!1,jft(this,e)}function jft(e,t){t=Ze(t,!0)??e._style,e._style=t,e.show=t.show,e.color=t.color,e.pointSize=t.pointSize,e.pointOutlineColor=t.pointOutlineColor,e.pointOutlineWidth=t.pointOutlineWidth,e.labelColor=t.labelColor,e.labelOutlineColor=t.labelOutlineColor,e.labelOutlineWidth=t.labelOutlineWidth,e.labelStyle=t.labelStyle,e.font=t.font,e.labelText=t.labelText,e.backgroundColor=t.backgroundColor,e.backgroundPadding=t.backgroundPadding,e.backgroundEnabled=t.backgroundEnabled,e.scaleByDistance=t.scaleByDistance,e.translucencyByDistance=t.translucencyByDistance,e.distanceDisplayCondition=t.distanceDisplayCondition,e.heightOffset=t.heightOffset,e.anchorLineEnabled=t.anchorLineEnabled,e.anchorLineColor=t.anchorLineColor,e.image=t.image,e.disableDepthTestDistance=t.disableDepthTestDistance,e.horizontalOrigin=t.horizontalOrigin,e.verticalOrigin=t.verticalOrigin,e.labelHorizontalOrigin=t.labelHorizontalOrigin,e.labelVerticalOrigin=t.labelVerticalOrigin,e.lineWidth=t.lineWidth;let n={};if(l(t.meta)){let i=t.defines,r=t.meta??H.EMPTY_OBJECT;for(let o in r)r.hasOwnProperty(o)&&(n[o]=new vh(r[o],i))}e._meta=n,e._ready=!0}function ho(e,t){let n=(e._style??H.EMPTY_OBJECT).defines;if(l(t)){if(typeof t=="boolean"||typeof t=="number")return new vh(String(t));if(typeof t=="string")return new vh(t,n);if(l(t.conditions))return new b4(t,n)}else return;return t}function mo(e){if(l(e)){if(l(e.expression))return e.expression;if(l(e.conditionsExpression))return Ze(e.conditionsExpression,!0)}else return;return e}Object.defineProperties(zy.prototype,{style:{get:function(){return this._style}},show:{get:function(){return this._show},set:function(e){this._show=ho(this,e),this._style.show=mo(this._show),this._showShaderFunctionReady=!1}},color:{get:function(){return this._color},set:function(e){this._color=ho(this,e),this._style.color=mo(this._color),this._colorShaderFunctionReady=!1}},pointSize:{get:function(){return this._pointSize},set:function(e){this._pointSize=ho(this,e),this._style.pointSize=mo(this._pointSize),this._pointSizeShaderFunctionReady=!1}},pointOutlineColor:{get:function(){return this._pointOutlineColor},set:function(e){this._pointOutlineColor=ho(this,e),this._style.pointOutlineColor=mo(this._pointOutlineColor)}},pointOutlineWidth:{get:function(){return this._pointOutlineWidth},set:function(e){this._pointOutlineWidth=ho(this,e),this._style.pointOutlineWidth=mo(this._pointOutlineWidth)}},labelColor:{get:function(){return this._labelColor},set:function(e){this._labelColor=ho(this,e),this._style.labelColor=mo(this._labelColor)}},labelOutlineColor:{get:function(){return this._labelOutlineColor},set:function(e){this._labelOutlineColor=ho(this,e),this._style.labelOutlineColor=mo(this._labelOutlineColor)}},labelOutlineWidth:{get:function(){return this._labelOutlineWidth},set:function(e){this._labelOutlineWidth=ho(this,e),this._style.labelOutlineWidth=mo(this._labelOutlineWidth)}},font:{get:function(){return this._font},set:function(e){this._font=ho(this,e),this._style.font=mo(this._font)}},labelStyle:{get:function(){return this._labelStyle},set:function(e){this._labelStyle=ho(this,e),this._style.labelStyle=mo(this._labelStyle)}},labelText:{get:function(){return this._labelText},set:function(e){this._labelText=ho(this,e),this._style.labelText=mo(this._labelText)}},backgroundColor:{get:function(){return this._backgroundColor},set:function(e){this._backgroundColor=ho(this,e),this._style.backgroundColor=mo(this._backgroundColor)}},backgroundPadding:{get:function(){return this._backgroundPadding},set:function(e){this._backgroundPadding=ho(this,e),this._style.backgroundPadding=mo(this._backgroundPadding)}},backgroundEnabled:{get:function(){return this._backgroundEnabled},set:function(e){this._backgroundEnabled=ho(this,e),this._style.backgroundEnabled=mo(this._backgroundEnabled)}},scaleByDistance:{get:function(){return this._scaleByDistance},set:function(e){this._scaleByDistance=ho(this,e),this._style.scaleByDistance=mo(this._scaleByDistance)}},translucencyByDistance:{get:function(){return this._translucencyByDistance},set:function(e){this._translucencyByDistance=ho(this,e),this._style.translucencyByDistance=mo(this._translucencyByDistance)}},distanceDisplayCondition:{get:function(){return this._distanceDisplayCondition},set:function(e){this._distanceDisplayCondition=ho(this,e),this._style.distanceDisplayCondition=mo(this._distanceDisplayCondition)}},heightOffset:{get:function(){return this._heightOffset},set:function(e){this._heightOffset=ho(this,e),this._style.heightOffset=mo(this._heightOffset)}},anchorLineEnabled:{get:function(){return this._anchorLineEnabled},set:function(e){this._anchorLineEnabled=ho(this,e),this._style.anchorLineEnabled=mo(this._anchorLineEnabled)}},anchorLineColor:{get:function(){return this._anchorLineColor},set:function(e){this._anchorLineColor=ho(this,e),this._style.anchorLineColor=mo(this._anchorLineColor)}},image:{get:function(){return this._image},set:function(e){this._image=ho(this,e),this._style.image=mo(this._image)}},disableDepthTestDistance:{get:function(){return this._disableDepthTestDistance},set:function(e){this._disableDepthTestDistance=ho(this,e),this._style.disableDepthTestDistance=mo(this._disableDepthTestDistance)}},horizontalOrigin:{get:function(){return this._horizontalOrigin},set:function(e){this._horizontalOrigin=ho(this,e),this._style.horizontalOrigin=mo(this._horizontalOrigin)}},verticalOrigin:{get:function(){return this._verticalOrigin},set:function(e){this._verticalOrigin=ho(this,e),this._style.verticalOrigin=mo(this._verticalOrigin)}},labelHorizontalOrigin:{get:function(){return this._labelHorizontalOrigin},set:function(e){this._labelHorizontalOrigin=ho(this,e),this._style.labelHorizontalOrigin=mo(this._labelHorizontalOrigin)}},labelVerticalOrigin:{get:function(){return this._labelVerticalOrigin},set:function(e){this._labelVerticalOrigin=ho(this,e),this._style.labelVerticalOrigin=mo(this._labelVerticalOrigin)}},lineWidth:{get:function(){return this._lineWidth},set:function(e){this._lineWidth=ho(this,e),this._style.lineWidth=mo(this._lineWidth)}},meta:{get:function(){return this._meta},set:function(e){this._meta=e}}});zy.fromUrl=function(e){return De.createIfNeeded(e).fetchJson(e).then(function(n){return new zy(n)})};zy.prototype.getColorShaderFunction=function(e,t,n){return this._colorShaderFunctionReady?(n.translucent=this._colorShaderTranslucent,this._colorShaderFunction):(this._colorShaderFunctionReady=!0,l(this.color)&&l(this.color.getShaderFunction)?this._colorShaderFunction=this.color.getShaderFunction(e,t,n,"vec4"):this._colorShaderFunction=void 0,this._colorShaderTranslucent=n.translucent,this._colorShaderFunction)};zy.prototype.getShowShaderFunction=function(e,t,n){return this._showShaderFunctionReady?this._showShaderFunction:(this._showShaderFunctionReady=!0,l(this.show)&&l(this.show.getShaderFunction)?this._showShaderFunction=this.show.getShaderFunction(e,t,n,"bool"):this._showShaderFunction=void 0,this._showShaderFunction)};zy.prototype.getPointSizeShaderFunction=function(e,t,n){return this._pointSizeShaderFunctionReady?this._pointSizeShaderFunction:(this._pointSizeShaderFunctionReady=!0,l(this.pointSize)&&l(this.pointSize.getShaderFunction)?this._pointSizeShaderFunction=this.pointSize.getShaderFunction(e,t,n,"float"):this._pointSizeShaderFunction=void 0,this._pointSizeShaderFunction)};zy.prototype.getVariables=function(){let e=[];return l(this.color)&&l(this.color.getVariables)&&Zn(e,this.color.getVariables()),l(this.show)&&l(this.show.getVariables)&&Zn(e,this.show.getVariables()),l(this.pointSize)&&l(this.pointSize.getVariables)&&Zn(e,this.pointSize.getVariables()),e=e.filter(function(t,n,i){return i.indexOf(t)===n}),e};var Vy=zy;var sbe=new ie,rbe=new ie,$Z=new ie,x4=new Map;x4.set(Ul,{packCollectionData:Ds.packPolylineCollectionData,packTilePrimitives:Ds.packPolylineSegments});x4.set(Za,{packCollectionData:Ds.packPolygonCollectionData,packTilePrimitives:Ds.packPolygonRings});var JZ=class{constructor(t){this._tilingScheme=t.tilingScheme,this.antialias=t.antialias??!0,this.minimumTileScreenPixels=t.minimumTileScreenPixels??256,this._heightReferenceByCollection=new Map,this._collectionDataCache=new WeakMap,this._markedThisFrame=new Set,this._markedFrameNumber=-1,this._dirtyRectangles=[]}get tilingScheme(){return this._tilingScheme}set tilingScheme(t){this._tilingScheme=t}get ellipsoid(){return this._tilingScheme.ellipsoid}remove(t){this._markedThisFrame.delete(t),this._heightReferenceByCollection.delete(t)&&this._markCollectionRegionDirty(t)}has(t){return this._heightReferenceByCollection.has(t)}static isSupported(t){return x4.has(t.constructor)}markForFrame(t,n,i){this._beginFrame(n),this._markedThisFrame.add(t),this._heightReferenceByCollection.has(t)||this._markCollectionRegionDirty(t),this._heightReferenceByCollection.set(t,i)}_beginFrame(t){if(t!==this._markedFrameNumber){for(let n of this._heightReferenceByCollection.keys())this._markedThisFrame.has(n)||(this._heightReferenceByCollection.delete(n),this._markCollectionRegionDirty(n));this._markedThisFrame.clear(),this._markedFrameNumber=t}}_markCollectionRegionDirty(t){let n=ie.fromBoundingSphere(t.boundingVolume,this._tilingScheme.ellipsoid,new ie);this._dirtyRectangles.push(n)}requestTileData(t,n,i,r,o){let s=this._tilingScheme.tileXYToRectangle(t,n,i,sbe);return this.requestDataForRectangle(s,r,o)}requestDataForRectangle(t,n,i){let r=this._tilingScheme,o=this._heightReferenceByCollection,s={show:!0,hasPolylines:!1,hasPolygons:!1,rectangle:ie.clone(t),collectionVersions:new Map,minimumTileScreenPixels:this.minimumTileScreenPixels,metersPerUv:Hft(t,r.ellipsoid)};for(let[u,f]of o){if(!obe(f,i))continue;let d=ie.fromBoundingSphere(u.boundingVolume,r.ellipsoid,rbe);if(!!!ie.intersection(t,d,$Z))continue;let g=x4.get(u.constructor),m=this._getCollectionDataCached(u,g.packCollectionData);s.collectionVersions.set(u,m.version),g.packTilePrimitives(u,m,t,s)}let a=l(s.polylineSegments)&&s.polylineSegments.length>0,c=l(s.polygonRings)&&s.polygonRings.length>0;return s.hasPolylines=a,s.hasPolygons=c,!a&&!c?(s.show=!1,s):(a&&(Ds.packPolylineGrid(s),Ds.packPolylineTextures(n,s)),c&&(Ds.packPolygonGrid(s),Ds.packPolygonTextures(n,s)),Ds.packPrimitiveTextures(n,s),s)}releaseTileData(t){Ds.freeResources(t)}updateTileData(t,n,i,r,o,s){let a=this._dirtyRectangles,c=this._tilingScheme;return Gft(t,n,i,a,c)?(this.releaseTileData(o),this.requestTileData(t,n,i,r,s)):o}updateDataForRectangle(t,n,i,r){return this._isStale(i,t,r)?(this.releaseTileData(i),this.requestDataForRectangle(t,n,r)):i}_isStale(t,n,i){if(!ie.equals(t.rectangle,n))return!0;let r=t.collectionVersions,o=this._heightReferenceByCollection,s=0;for(let[a,c]of o){if(!obe(c,i))continue;let u=ie.fromBoundingSphere(a.boundingVolume,this._tilingScheme.ellipsoid,rbe),f=!!ie.intersection(n,u,$Z),d=r.get(a);if(!f){if(l(d))return!0;continue}if(!l(d)||(s++,a._dirtyCount>0||d!==a._version))return!0}return s!==r.size}makeClean(){this._dirtyRectangles.length=0}update(t){l(t)&&this._beginFrame(t);for(let n of this._heightReferenceByCollection.keys()){let i=this._collectionDataCache.get(n);!l(i)||!(n._dirtyCount>0||i.version!==n._version)||(l(i.rectangle)&&this._dirtyRectangles.push(ie.clone(i.rectangle)),this._markCollectionRegionDirty(n))}}_getCollectionDataCached(t,n){let i=this._collectionDataCache.get(t),r=t._dirtyCount>0,o=i?.version!==t._version;if(l(i)&&!r&&!o)return i;let s=this.ellipsoid,a=n(t,s,i);return a.version=t._version+(r?1:0),a.rectangle=ie.fromBoundingSphere(t.boundingVolume,s,a.rectangle),this._collectionDataCache.set(t,a),t._makeClean(),a}};function obe(e,t){return e===We.CLAMP_TO_GROUND||e===t}function Hft(e,t){let n=t.maximumRadius,i=(e.south+e.north)*.5;return new U(e.width*n*Math.cos(i),e.height*n)}function Gft(e,t,n,i,r){if(i.length===0)return!1;let o=r.tileXYToRectangle(e,t,n,sbe);for(let s=0;s<i.length;s++)if(ie.intersection(o,i[s],$Z))return!0;return!1}var jy=JZ;var abe=new tl,cbe=new Oa,lbe=new Lo,Wft=new wp,qft=new gd,Yft=new pd,ZZ=class{constructor(t,n,i=0){ut(this,"_color",new z);ut(this,"_outlineColor",new z);this._content=t,this._batchId=n,this._batchTableId=i,this._primitivesByCollection=new Map}addPrimitiveByCollection(t,n){let i=this._primitivesByCollection.get(t);i||(i=[],this._primitivesByCollection.set(t,i)),i.push(n)}get show(){for(let t of this._iteratePrimitives())if(t.show)return!0;return!1}set show(t){for(let n of this._iteratePrimitives())n.show=t}get color(){for(let t of this._iterateMaterials())return z.clone(t.color,this._color);return z.clone(z.WHITE,this._color)}set color(t){for(let n of this._iterateMaterials())z.clone(t,n.color)}get pointSize(){for(let t of this._iteratePointMaterials())return t.size;return 1}set pointSize(t){for(let n of this._iteratePointMaterials())n.size=t}get pointOutlineColor(){for(let t of this._iteratePointMaterials())return z.clone(t.outlineColor,this._outlineColor);return z.clone(z.WHITE,this._outlineColor)}set pointOutlineColor(t){for(let n of this._iteratePointMaterials())z.clone(t,n.outlineColor)}get pointOutlineWidth(){for(let t of this._iteratePointMaterials())return t.outlineWidth;return 0}set pointOutlineWidth(t){for(let n of this._iteratePointMaterials())n.outlineWidth=t}get lineWidth(){for(let t of this._iteratePolylineMaterials())return t.width;return 1}set lineWidth(t){for(let n of this._iteratePolylineMaterials())n.width=t}get lineOutlineColor(){for(let t of this._iteratePolylineMaterials())return z.clone(t.outlineColor,this._outlineColor);return z.clone(z.WHITE,this._outlineColor)}set lineOutlineColor(t){for(let n of this._iteratePolylineMaterials())z.clone(t,n.outlineColor)}get lineOutlineWidth(){for(let t of this._iteratePolylineMaterials())return t.outlineWidth;return 0}set lineOutlineWidth(t){for(let n of this._iteratePolylineMaterials())n.outlineWidth=t}get polygonOutlineColor(){for(let t of this._iteratePolygonMaterials())return z.clone(t.outlineColor,this._outlineColor);return z.clone(z.WHITE,this._outlineColor)}set polygonOutlineColor(t){for(let n of this._iteratePolygonMaterials())z.clone(t,n.outlineColor)}get polygonOutlineWidth(){for(let t of this._iteratePolygonMaterials())return t.outlineWidth;return 0}set polygonOutlineWidth(t){for(let n of this._iteratePolygonMaterials())n.outlineWidth=t}get content(){return this._content}get tileset(){return this._content.tileset}get primitive(){return this._content.tileset}get featureId(){return this._batchId}get _batchTable(){return this._content.batchTables[this._batchTableId]}get pickIds(){let t=[];for(let n of this._iteratePrimitives())t.push(n._pickId);return t}hasProperty(t){return l(this._batchTable)?this._batchTable.hasProperty(this._batchId,t):!1}getPropertyIds(t){return l(this._batchTable)?this._batchTable.getPropertyIds(this._batchId,t):[]}getProperty(t){if(l(this._batchTable))return this._batchTable.getProperty(this._batchId,t)}getPropertyInherited(t){return ua.getPropertyInherited(this._content,this._batchId,t,this._batchTable)}setProperty(t,n){throw new pe("Not implemented")}isExactClass(t){return l(this._batchTable)?this._batchTable.isExactClass(this._batchId,t):!1}isClass(t){return l(this._batchTable)?this._batchTable.isClass(this._batchId,t):!1}getExactClassName(){if(l(this._batchTable))return this._batchTable.getExactClassName(this._batchId)}*_iteratePrimitives(){yield*this._iteratePrimitivesWith(bf,abe),yield*this._iteratePrimitivesWith(Ul,cbe),yield*this._iteratePrimitivesWith(Za,lbe)}*_iteratePrimitivesWith(t,n){let i=this._content._collections;for(let r=0;r<i.length;r++){let o=i[r],s=this._primitivesByCollection.get(r);if(s&&o instanceof t)for(let a of s)o.get(a,n),yield n}}*_iterateMaterials(){yield*this._iteratePointMaterials(),yield*this._iteratePolylineMaterials(),yield*this._iteratePolygonMaterials()}*_iteratePointMaterials(){yield*this._iterateMaterialsWith(bf,abe,Wft)}*_iteratePolylineMaterials(){yield*this._iterateMaterialsWith(Ul,cbe,qft)}*_iteratePolygonMaterials(){yield*this._iterateMaterialsWith(Za,lbe,Yft)}*_iterateMaterialsWith(t,n,i){for(let r of this._iteratePrimitivesWith(t,n))r.getMaterial(i),yield i,r.setMaterial(i)}},Bv=ZZ;var ube=new h,Xft=new tl,Kft=new Oa,dbe=new Lo;function $ft(e,t){let n=t.scene.nodes,i={collections:[],collectionLocalMatrices:[],collectionFeatureTableIds:new Map,featuresByTableId:new Map};for(let r=0;r<n.length;r++)hbe(e,n[r],M.IDENTITY,i);return i}function T4(e){let t=e.BYTES_PER_ELEMENT*8;return Math.pow(2,t)-1}function Jft(e){let t={pointPrimitiveCount:0,pointVertexCount:0,polylinePrimitiveCount:0,polylineVertexCount:0,polygonPrimitiveCount:0,polygonVertexCount:0,polygonHoleCount:0,polygonTriangleCount:0},n=e.vector,i=e.polygon,r=e.primitiveType,s=xt.getAttributeBySemantic(e,ct.POSITION).count,a=e.indices?Na.readIndicesAsTypedArray(e.indices):void 0;if(r===Oe.POINTS)t.pointPrimitiveCount+=s,t.pointVertexCount+=s;else if(r===Oe.LINE_STRIP){let c=n?n.count:fbe(a);t.polylinePrimitiveCount+=c,t.polylineVertexCount+=a.length-c+1}else if(r===Oe.TRIANGLES||r===Oe.LINE_LOOP)if(n){t.polygonPrimitiveCount+=n.count,t.polygonVertexCount+=s,t.polygonTriangleCount+=a.length/3;let c=n.polygonHoleCounts;if(c)for(let u=0;u<c.length;u++)t.polygonHoleCount+=c[u]}else{let c=fbe(i.loopIndices);t.polygonPrimitiveCount+=i.count,t.polygonVertexCount+=i.loopIndices.length-c+1,t.polygonTriangleCount+=i.triangleIndices.length,t.polygonHoleCount+=c-i.count}else throw new oe(`Unexpected primitive type: ${r}`);return t}function fbe(e){let t=T4(e),n=0;for(let i=0;i<e.length;i++)e[i]===t&&i+1<e.length&&n++;return n+1}function Zft(e,t,n,i,r){let o=xt.getAttributeBySemantic(t,ct.POSITION),s=o.typedArray??(n.positionNormalized?Na.readAttributeAsRawCompactTypedArray(o):Na.readAttributeAsTypedArray(o)),a=t.indices?Na.readIndicesAsTypedArray(t.indices):void 0,c=Qft(e,t,r);n instanceof bf?edt(n,i,s,a,c):n instanceof Ul?tdt(n,i,s,a,c):n instanceof Za&&(l(t.vector)?ndt(n,i,s,a,c,t.vector):idt(n,i,s,c,t.polygon))}function Qft(e,t,n){let i=e.tileset.featureIdLabel,r=xt.getFeatureIdsByLabel(t.featureIds,i);if(!(r instanceof vn.FeatureIdAttribute))return()=>{};let o=xt.getAttributeBySemantic(t,ct.FEATURE_ID,r.setIndex),s=o.typedArray??Na.readAttributeAsTypedArray(o);for(let a=0;a<s.length;a++){let c=s[a];if(!n.has(c)){let u=new Bv(e,c,r.propertyTableId);n.set(c,u)}}return function(c){let u=s[c];if(u!==r.nullFeatureId)return n.get(u)}}function edt(e,t,n,i,r){let o=n.length/3;for(let s=0,a=i?i.length:o;s<a;s++){let c=i?i[s]:s;h.fromArray(n,c*3,ube);let u=r(c);u&&u.addPrimitiveByCollection(t,s),e.add({position:ube,pickObject:u,featureId:u?.featureId},Xft)}}function tdt(e,t,n,i,r){let o=T4(i),s=0,a=0,c=0;for(let u=0;u<i.length;u++){if(i[u]===o?a=u-s:u+1===i.length&&(a=u+1-s),a===0)continue;let d=s+a,p=i.subarray(s,d),g=mbe(n,p,3),m=r(i[s]);m&&m.addPrimitiveByCollection(t,c),e.add({positions:g,pickObject:m,featureId:m?.featureId},Kft),s=u+1,a=0,c++}}function ndt(e,t,n,i,r,o){let s=o.polygonAttributeOffsets,a=o.polygonIndicesOffsets,c=o.polygonHoleCounts,u=o.polygonHoleOffsets,f=n.length/3,d=s.length;for(let p=0;p<d;p++){let g=s[p],m=p+1<d?s[p+1]:f,y=n.subarray(g*3,m*3),A;if(l(c)&&c[p]>0){let v=c[p];A=u.slice(p,p+v);for(let S=0;S<v;S++)A[S]-=g}let b=a[p],x=p+1<d?a[p+1]:i.length,T=i.slice(b,x);for(let v=0;v<T.length;v++)T[v]-=g;let E=r(g);E&&E.addPrimitiveByCollection(t,p),e.add({positions:y,triangles:T,holes:A,pickObject:E,featureId:E?.featureId},dbe)}}function idt(e,t,n,i,r){let o=r.loopIndices.constructor,s=new o(r.loopIndices.length),a=T4(r.loopIndices);for(let c=0;c<r.count;c++){let u=c+1===r.count,f=r.loopIndicesOffsets[c],d=u?r.loopIndices.length:r.loopIndicesOffsets[c+1],p=r.loopIndices.subarray(f,d),g=mbe(n,p,3,s),m=[];for(let x=0;x<p.length;x++){let T=x+1===p.length;p[x]===a&&!T&&m.push(x)}let y=new o(m),A;if(l(r.triangleIndices)){let x=r.triangleIndicesOffsets[c],T=u?r.triangleIndices.length:r.triangleIndicesOffsets[c+1];A=r.triangleIndices.subarray(x,T);for(let E=0;E<A.length;E++)A[E]=s[A[E]]}else throw new Error("Runtime triangulation not yet supported.");let b=i(p[0]);b&&b.addPrimitiveByCollection(t,c),e.add({positions:g,triangles:A,holes:y,pickObject:b,featureId:b?.featureId},dbe)}}function hbe(e,t,n,i){let r=xt.getNodeTransform(t),o=M.multiplyTransformation(n,r,new M),s=t.primitives;for(let c=0;c<s.length;c++){let u=s[c],f=u.primitiveType,d,p=Jft(u),g=xt.getAttributeBySemantic(u,ct.POSITION),m=g.normalized??!1,y=g.componentDatatype;f===Oe.POINTS?d=new bf({primitiveCountMax:p.pointPrimitiveCount,allowPicking:!0,positionNormalized:m,positionDatatype:y}):f===Oe.LINE_STRIP?d=new Ul({primitiveCountMax:p.polylinePrimitiveCount,vertexCountMax:p.polylineVertexCount,allowPicking:!0,positionNormalized:m,positionDatatype:y}):(f===Oe.TRIANGLES||f===Oe.LINE_LOOP)&&(d=new Za({primitiveCountMax:p.polygonPrimitiveCount,vertexCountMax:p.polygonVertexCount,holeCountMax:p.polygonHoleCount,triangleCountMax:p.polygonTriangleCount,allowPicking:!0,positionNormalized:m,positionDatatype:y}));let b=u.featureIds?.[0]?.propertyTableId;i.featuresByTableId.has(b)||i.featuresByTableId.set(b,new Map),i.collections.push(d),i.collectionLocalMatrices.push(M.clone(o)),i.collectionFeatureTableIds.set(d,b),Zft(e,u,d,i.collections.length-1,i.featuresByTableId.get(b))}let a=t.children;for(let c=0;c<a.length;c++)hbe(e,a[c],o,i)}function mbe(e,t,n,i){let r=T4(t),o=0;for(let u=0;u<t.length;u++)t[u]!==r&&o++;let s=e.constructor,a=new s(o*n),c=0;for(let u=0;u<t.length;u++){let f=t[u];if(i&&(i[f]=f===r?r:c),f!==r){for(let d=0;d<n;d++)a[c*n+d]=e[f*n+d];c++}}return a}var E4=$ft;var C4=new tl,v4=new Oa,S4=new Lo,C1=new wp,QZ=new gd,pbe=new pd,gbe=new M,eQ=class e{constructor(t,n,i){this._tileset=t,this._tile=n,this._resource=i,this._model=void 0,this._collections=[],this._collectionLocalMatrices=[],this._collectionFeatureTableIds=new Map,this._featuresByTableId=new Map,this._metadata=void 0,this._group=void 0,this.featurePropertiesDirty=!1,this._ready=!1,this._modelMatrix=M.clone(M.IDENTITY)}get featuresLength(){return this.batchTables.reduce((t,n)=>t+n.featuresLength,0)}get pointsLength(){return this._collections.filter(t=>t instanceof bf).reduce((t,n)=>t+n.primitiveCount,0)}get trianglesLength(){return this._collections.reduce((t,n)=>n instanceof Za?t+n.triangleCount:n instanceof Ul?t+(n.vertexCount-n.primitiveCount)*2:t,0)}get geometryByteLength(){return this._collections.reduce((t,n)=>t+n.byteLength,0)}get texturesByteLength(){return 0}get batchTableByteLength(){return this.batchTables.reduce((t,n)=>t+n.batchTableByteLength,0)}get innerContents(){}get ready(){return this._ready}get tileset(){return this._tileset}get tile(){return this._tile}get url(){return this._resource.getUrlComponent(!0)}get batchTables(){return this._model._featureTables}get batchTable(){throw new pe("Deprecated: Use `content.batchTables`.")}get metadata(){return this._metadata}set metadata(t){this._metadata=t}get group(){return this._group}set group(t){this._group=t}getFeature(t,n){return this._featuresByTableId.get(n)?.get(t)}hasProperty(t,n,i){let r=this.getFeature(t,i);return r?r.hasProperty(n):!1}applyDebugSettings(t,n){let i=t?`color("${n.toCssHexString()}", 1.0)`:'color("white", 1.0)';this.applyStyle(new Vy({color:i}))}applyStyle(t){let n=o=>o instanceof bf,i=o=>o instanceof Ul,r=o=>o instanceof Za;for(let o of this._collections.filter(n)){let s=this._collectionFeatureTableIds.get(o);for(let a=0,c=o.primitiveCount;a<c;a++){o.get(a,C4);let u=this.getFeature(C4.featureId,s);l(t.show)&&(C4.show=t.show.evaluate(u)),l(t.color)&&t.color.evaluate(u,C1.color),l(t.pointSize)&&(C1.size=t.pointSize.evaluate(u)),l(t.pointOutlineWidth)&&(C1.outlineWidth=t.pointOutlineWidth.evaluate(u)),l(t.pointOutlineColor)&&t.pointOutlineColor.evaluate(u,C1.outlineColor),C4.setMaterial(C1)}}for(let o of this._collections.filter(i)){let s=this._collectionFeatureTableIds.get(o);for(let a=0,c=o.primitiveCount;a<c;a++){o.get(a,v4);let u=this.getFeature(v4.featureId,s);l(t.show)&&(v4.show=t.show.evaluate(u)),l(t.color)&&t.color.evaluate(u,QZ.color),l(t.lineWidth)&&(QZ.width=t.lineWidth.evaluate(u)),v4.setMaterial(QZ)}}for(let o of this._collections.filter(r)){let s=this._collectionFeatureTableIds.get(o);for(let a=0,c=o.primitiveCount;a<c;a++){o.get(a,S4);let u=this.getFeature(S4.featureId,s);l(t.show)&&(S4.show=t.show.evaluate(u)),l(t.color)&&t.color.evaluate(u,pbe.color),S4.setMaterial(pbe)}}}update(t,n){let i=this._tileset,r=i._scene?.vectorProvider;if(l(this._model)&&!this._ready){let s=this._model;s.modelMatrix=this._tile.computedTransform,s.update(n),s.ready&&(odt(this),this._ready=!0)}M.multiplyTransformation(this._tile.computedTransform,this._modelMatrix,gbe);let o=l(r)&&this._tile._selectedFrame===n.frameNumber;for(let s=0;s<this._collections.length;s++){let a=this._collections[s];M.multiplyTransformation(gbe,this._collectionLocalMatrices[s],a.modelMatrix),!us(i._heightReference)||!jy.isSupported(a)?a.update(n):o&&r.markForFrame(a,n.frameNumber,i._heightReference)}}pick(t,n,i){}isDestroyed(){return!1}destroy(){let t=this._tileset._scene?.vectorProvider;this._model?.destroy(),this._model=void 0;for(let n of this._collections)t?.remove(n),n.destroy();return this._collections.length=0,le(this)}static async fromGltf(t,n,i,r){let o=new e(t,n,i),s=rdt(t,n,o,r),a=await Ed.fromGltfAsync(s);return a.show=!1,o._model=a,o}};function rdt(e,t,n,i){return{gltf:i,basePath:n._resource,cull:!1,releaseGltfJson:!0,opaquePass:Ie.CESIUM_3D_TILE,modelMatrix:t.computedTransform,upAxis:e._modelUpAxis,forwardAxis:e._modelForwardAxis,incrementallyLoadTextures:!1,content:n,featureIdLabel:e.featureIdLabel,instanceFeatureIdLabel:e.instanceFeatureIdLabel,projectTo2D:e._projectTo2D,enablePick:e._enablePick,enableDebugWireframe:e._enableDebugWireframe,enableShowOutline:!1}}function odt(e){let t=e._model.sceneGraph.components,n=xt.getAxisCorrectionMatrix(t.upAxis,t.forwardAxis,new M);M.multiplyTransformation(t.transform,n,e._modelMatrix);let i=E4(e,t);e._collections=i.collections,e._collectionLocalMatrices=i.collectionLocalMatrices,e._collectionFeatureTableIds=i.collectionFeatureTableIds,e._featuresByTableId=i.featuresByTableId}var Ix=eQ;function tc(){}tc._maxSortingConcurrency=Math.max(dn.hardwareConcurrency-1,1);tc._sorterTaskProcessor=void 0;tc._taskProcessorReady=!1;tc._error=void 0;tc._getSorterTaskProcessor=function(){if(!l(tc._sorterTaskProcessor)){let e=new $n("gaussianSplatSorter",tc._maxSortingConcurrency);e.initWebAssemblyModule({wasmBinaryFile:"ThirdParty/wasm_splats_bg.wasm"}).then(function(t){t?tc._taskProcessorReady=!0:tc._error=new oe("Gaussian splat sorter could not be initialized.")}).catch(t=>{tc._error=t}),tc._sorterTaskProcessor=e}return tc._sorterTaskProcessor};tc.radixSortIndexes=function(e){let t=tc._getSorterTaskProcessor();if(l(tc._error))throw tc._error;if(tc._taskProcessorReady)return t.scheduleTask(e,[e.primitive.positions.buffer])};var kv=tc;function nc(){}nc._maxSortingConcurrency=Math.max(dn.hardwareConcurrency-1,1);nc._textureTaskProcessor=void 0;nc._taskProcessorReady=!1;nc._error=void 0;nc._getTextureTaskProcessor=function(){if(!l(nc._textureTaskProcessor)){let e=new $n("gaussianSplatTextureGenerator",nc._maxSortingConcurrency);e.initWebAssemblyModule({wasmBinaryFile:"ThirdParty/wasm_splats_bg.wasm"}).then(function(t){t?nc._taskProcessorReady=!0:nc._error=new oe("Gaussian splat sorter could not be initialized.")}).catch(t=>{nc._error=t}),nc._textureTaskProcessor=e}return nc._textureTaskProcessor};nc.generateFromAttributes=function(e){let t=nc._getTextureTaskProcessor();if(l(nc._error))throw nc._error;if(!nc._taskProcessorReady)return;let{attributes:n}=e;return t.scheduleTask(e,[n.positions.buffer,n.scales.buffer,n.rotations.buffer,n.colors.buffer])};var w4=nc;function sdt(e){let t=new F_;this.shaderBuilder=t,this.uniformMap={},this.renderStateOptions=Ge.getState(Ge.fromCache({depthTest:{enabled:!0,func:yc.LESS_OR_EQUAL}})),this.alphaOptions=new wv,this.hasSkipLevelOfDetail=!1,e._useLogDepth&&t.addDefine("LOG_DEPTH_READ_ONLY",void 0,de.FRAGMENT)}var I4=sdt;var Px=new M,Tbe=new M,v1=new M,Ci=new $,S1=new Le,adt=new h,cdt=new Le,ldt=new h,udt=1e-12,P4=1e-5,tQ=1e-7,Ba={IDLE:0,WAITING:1,SORTING:2,SORTED:3,ERROR:4},Ns={BUILDING:"BUILDING",TEXTURE_PENDING:"TEXTURE_PENDING",TEXTURE_READY:"TEXTURE_READY",SORTING:"SORTING",READY:"READY"},fdt=2,ddt=30,hdt=3,mdt=.008726646259971648,pdt=1;function gdt(e,t){let n=e._lastSteadySortFrameNumber>=0?t.frameNumber-e._lastSteadySortFrameNumber:Number.POSITIVE_INFINITY;if(e._lastSteadySortFrameNumber>=0&&n<hdt)return!1;let i=t.camera;return l(i)?!e._hasLastSteadySortCameraPosition||!e._hasLastSteadySortCameraDirection||h.distance(i.positionWC,e._lastSteadySortCameraPosition)>=pdt?!0:h.angleBetween(i.directionWC,e._lastSteadySortCameraDirection)>=mdt:!1}function _be(e,t){e._lastSteadySortFrameNumber=t.frameNumber;let n=t.camera;l(n)&&(h.clone(n.positionWC,e._lastSteadySortCameraPosition),e._hasLastSteadySortCameraPosition=!0,h.clone(n.directionWC,e._lastSteadySortCameraDirection),e._hasLastSteadySortCameraDirection=!0)}function _dt(e,t){let n=e._selectedTileSet;if(!l(n)||n.size!==t.length)return!0;for(let i=0;i<t.length;i++)if(!n.has(t[i]))return!0;return!1}function ybe(e,t){return l(t)&&t.requestId===e._sortRequestId&&t.dataGeneration===e._splatDataGeneration}function nQ(e){l(e)&&(l(e.gaussianSplatTexture)&&(e.gaussianSplatTexture.destroy(),e.gaussianSplatTexture=void 0),l(e.sphericalHarmonicsTexture)&&(e.sphericalHarmonicsTexture.destroy(),e.sphericalHarmonicsTexture=void 0))}function Abe(e,t,n){if(!l(t))return;e._retiredTextures.push({texture:t,frameNumber:n})}function ydt(e,t){let n=e._retiredTextures;if(!l(n)||n.length===0)return;let i=[];for(let r=0;r<n.length;r++){let o=n[r];t-o.frameNumber>0?o.texture.destroy():i.push(o)}e._retiredTextures=i}function Adt(e,t){let n=e?.[t];return l(n)?n.buffer:void 0}function bdt(e,t,n,i){let r=e._aggregateScratchBuffers[t];l(r)||(r=[],e._aggregateScratchBuffers[t]=r);let o=Adt(e._snapshot,t);for(let a=0;a<r.length;a++){let c=r[a];if(c.length>=i&&c.buffer!==o)return c}let s=Y.createTypedArray(n,i);return r.push(s),s}function xdt(e,t){return e.length===t?e:e.subarray(0,t)}function Tdt(e,t,n){if(!l(t.indexes)||t.state!==Ns.READY)throw new pe("Committing snapshot before it is READY.");let i=n.frameNumber,r=e._snapshot,o=l(r)?r.gaussianSplatTexture:e.gaussianSplatTexture;l(o)&&o!==t.gaussianSplatTexture&&Abe(e,o,i);let s=l(r)?r.sphericalHarmonicsTexture:e.sphericalHarmonicsTexture;l(s)&&s!==t.sphericalHarmonicsTexture&&Abe(e,s,i),e._snapshot=t,e._positions=t.positions,e._rotations=t.rotations,e._scales=t.scales,e._colors=t.colors,e._shData=t.shData,e._sphericalHarmonicsDegree=t.sphericalHarmonicsDegree,e._numSplats=t.numSplats,e._indexes=t.indexes,e.gaussianSplatTexture=t.gaussianSplatTexture,e.sphericalHarmonicsTexture=t.sphericalHarmonicsTexture,e._lastTextureWidth=t.lastTextureWidth,e._lastTextureHeight=t.lastTextureHeight,e._splatRowMask=t.splatRowMask,e._splatRowShift=t.splatRowShift,e._splatBudgetSSEScale=t.splatBudgetSSEScale??1,e._hasGaussianSplatTexture=l(t.gaussianSplatTexture),e._needsGaussianSplatTexture=!1,e._gaussianSplatTexturePending=!1,e._vertexArray=void 0,e._vertexArrayLen=-1,e._drawCommand=void 0,e._sorterPromise=void 0,e._activeSort=void 0,e._sorterState=Ba.IDLE,e._dirty=!1}async function Edt(e,t,n,i){try{let r=await i,o=Ut.maximumTextureSize,s=o,a=Math.ceil(n.numSplats/(o/2)),c=Math.log2(o/2),u=o/2-1;if(a>o){let g=n.numSplats;a=o;let m=s/2;if(n.numSplats=o*m,n.positions=n.positions.subarray(0,n.numSplats*3),n.rotations=n.rotations.subarray(0,n.numSplats*4),n.scales=n.scales.subarray(0,n.numSplats*3),n.colors=n.colors.subarray(0,n.numSplats*4),l(n.shData)){let y=n.shData.length/g;n.shData=n.shData.subarray(0,Math.floor(n.numSplats*y))}n.splatBudgetSSEScale=g/n.numSplats,console.warn(`[GaussianSplat][HARD CAP] ${g} splats exceed the maximum texture capacity (${o}\xD7${m} = ${n.numSplats} splats at width=${s}). Rendering only the first ${n.numSplats} splats to avoid a WebGL crash. Increasing maximumScreenSpaceError by ${n.splatBudgetSSEScale.toFixed(2)}x next frame.`)}else n.splatBudgetSSEScale=1;let f=s*a*4,d;f<=r.data.length?d=r.data.subarray(0,f):(d=new Uint32Array(f),d.set(r.data));let p={width:s,height:a,data:d};if(n.splatRowMask=u,n.splatRowShift=c,e._pendingSnapshot!==n){n.state=Ns.BUILDING;return}if(!l(n.gaussianSplatTexture))n.gaussianSplatTexture=xbe(t.context,p);else if(n.lastTextureHeight!==p.height||n.lastTextureWidth!==p.width){let g=n.gaussianSplatTexture;n.gaussianSplatTexture=xbe(t.context,p),g.destroy()}else n.gaussianSplatTexture.copyFrom({source:{width:p.width,height:p.height,arrayBufferView:p.data}});if(n.lastTextureHeight=p.height,n.lastTextureWidth=p.width,l(n.shData)&&n.sphericalHarmonicsDegree>0){let g=n.sphericalHarmonicsTexture,m=Ut.maximumTextureSize,y=n.shCoefficientCount/3,A=Math.floor(m/y),b=A*(y*2),x=Math.ceil(n.numSplats/A);if(x>m)console.warn(`[GaussianSplat][SHTexture] ${n.numSplats} splats require SH height ${x} > maxTex ${m}. Disabling spherical harmonics for this snapshot (color-only fallback).`),n.sphericalHarmonicsDegree=0,l(g)&&g.destroy(),n.sphericalHarmonicsTexture=void 0;else{let T=new Uint32Array(m*x*2),E=0;for(let v=0;E<n.shData.length;v+=m*2)T.set(n.shData.subarray(E,E+b),v),E+=b;n.sphericalHarmonicsTexture=vdt(t.context,{data:T,width:m,height:x}),l(g)&&g.destroy()}}n.state=Ns.TEXTURE_READY}catch(r){console.error("Error generating Gaussian splat texture:",r),n.state=Ns.BUILDING}}async function Cdt(e,t,n,i){try{let r=await i;if(!l(n)||n.snapshot!==e._pendingSnapshot)return;let o=n.expectedCount,s=o,a=r?.length;if(o!==s||a!==o){e._pendingSortPromise=void 0,e._pendingSort=void 0,n.snapshot.state===Ns.SORTING&&(n.snapshot.state=Ns.TEXTURE_READY);return}let c=n.snapshot;c.indexes=r,c.state=Ns.READY,e._pendingSortPromise=void 0,e._pendingSort=void 0,Tdt(e,c,t),e._pendingSnapshot=void 0,zl.buildGSplatDrawCommand(e,t)}catch(r){if(!l(n)||n.snapshot!==e._pendingSnapshot)return;e._pendingSortPromise=void 0,e._pendingSort=void 0,n.snapshot.state===Ns.SORTING&&(n.snapshot.state=Ns.TEXTURE_READY),e._sorterState=Ba.ERROR,e._sorterError=r}}async function bbe(e,t,n){try{let i=await n,r=ybe(e,t),o=t?.expectedCount,s=o,a=i?.length;if(!r||(o!==s||a!==o)){r&&(e._sorterPromise=void 0,e._sorterState=Ba.IDLE);return}e._indexes=i,e._sorterState=Ba.SORTED}catch(i){if(!ybe(e,t))return;e._sorterState=Ba.ERROR,e._sorterError=i}}function vdt(e,t){return new Dt({context:e,source:{width:t.width,height:t.height,arrayBufferView:t.data},preMultiplyAlpha:!1,skipColorSpaceConversion:!0,pixelFormat:$e.RG_INTEGER,pixelDatatype:ze.UNSIGNED_INT,flipY:!1,sampler:Ht.NEAREST})}function xbe(e,t){return new Dt({context:e,source:{width:t.width,height:t.height,arrayBufferView:t.data},preMultiplyAlpha:!1,skipColorSpaceConversion:!0,pixelFormat:$e.RGBA_INTEGER,pixelDatatype:ze.UNSIGNED_INT,flipY:!1,sampler:Ht.NEAREST})}function zl(e){e=e??H.EMPTY_OBJECT,this._positions=void 0,this._rotations=void 0,this._scales=void 0,this._colors=void 0,this._indexes=void 0,this._numSplats=0,this._needsGaussianSplatTexture=!0,this._snapshot=void 0,this._pendingSnapshot=void 0,this._retiredTextures=[],this._aggregateScratchBuffers={positions:[],scales:[],rotations:[],colors:[]},this._scratchAggregateShBuffer=void 0,this._selectedTilesStableFrames=0,this._needsSnapshotRebuild=!1,this._snapshotRebuildStallFrames=0,this._prevViewMatrix=new M,this._debugShowBoundingVolume=e.debugShowBoundingVolume??!1,this.gaussianSplatTexture=void 0,this.sphericalHarmonicsTexture=void 0,this._lastTextureWidth=0,this._lastTextureHeight=0,this._vertexArray=void 0,this._vertexArrayLen=-1,this._splitDirection=Wo.NONE,this._dirty=!1,this._tileset=e.tileset,this._baseTilesetUpdate=this._tileset.update,this._tileset.update=this._wrappedUpdate.bind(this),this._tileset.tileLoad.addEventListener(this.onTileLoad,this),this._tileset.tileVisible.addEventListener(this.onTileVisible,this),this.selectedTileLength=0,this._selectedTileSet=new Set,this._ready=!1,this._hasGaussianSplatTexture=!1,this._gaussianSplatTexturePending=!1,this._drawCommand=void 0,this._drawCommandModelMatrix=new M,this._rootTransform=void 0,this._axisCorrectionMatrix=xt.getAxisCorrectionMatrix(qi.Y,qi.X,new M),this._shInverseRotation=new $,this._isDestroyed=!1,this._sorterState=Ba.IDLE,this._sorterPromise=void 0,this._splatDataGeneration=0,this._sortRequestId=0,this._activeSort=void 0,this._pendingSortPromise=void 0,this._pendingSort=void 0,this._lastSteadySortFrameNumber=-1,this._lastSteadySortCameraPosition=new h,this._hasLastSteadySortCameraPosition=!1,this._lastSteadySortCameraDirection=new h,this._hasLastSteadySortCameraDirection=!1,this._sorterError=void 0,this._splatRowMask=0,this._splatRowShift=0,this._splatBudgetSSEScale=1}Object.defineProperties(zl.prototype,{ready:{get:function(){return this._ready}},isStable:{get:function(){return!this._dirty&&(!l(this._pendingSnapshot)||this._pendingSnapshot.state===Ns.READY)}},splitDirection:{get:function(){return this._splitDirection},set:function(e){this._splitDirection!==e&&(this._splitDirection=e,this._dirty=!0)}}});zl.prototype._wrappedUpdate=function(e){let t=this._tileset;if(this._splatBudgetSSEScale!==1){let n=t.maximumScreenSpaceError;t.maximumScreenSpaceError*=this._splatBudgetSSEScale,this._baseTilesetUpdate.call(t,e),t.maximumScreenSpaceError=n}else this._baseTilesetUpdate.call(t,e);this.update(e)};zl.prototype.destroy=function(){if(this._positions=void 0,this._rotations=void 0,this._scales=void 0,this._colors=void 0,this._indexes=void 0,nQ(this._pendingSnapshot),nQ(this._snapshot),l(this._retiredTextures))for(let t=0;t<this._retiredTextures.length;t++)this._retiredTextures[t].texture.destroy();this._retiredTextures=[],this._pendingSnapshot=void 0,this._snapshot=void 0,this._aggregateScratchBuffers=void 0,this.gaussianSplatTexture=void 0,this.sphericalHarmonicsTexture=void 0;let e=this._drawCommand;return l(e)&&(e.shaderProgram=e.shaderProgram&&e.shaderProgram.destroy()),l(this._vertexArray)&&(this._vertexArray.destroy(),this._vertexArray=void 0),this._tileset.update=this._baseTilesetUpdate.bind(this._tileset),le(this)};zl.prototype.isDestroyed=function(){return this._isDestroyed};zl.prototype.onTileLoad=function(e){this._dirty=!0};zl.prototype.onTileVisible=function(e){};zl.transformTile=function(e){let t=e.computedTransform,n=e.content.gltfPrimitive,i=e.tileset.gaussianSplatPrimitive;i._rootTransform===void 0&&(i._rootTransform=At.eastNorthUpToFixedFrame(e.tileset.boundingSphere.center));let r=i._rootTransform,o=M.multiplyTransformation(t,i._axisCorrectionMatrix,Px);M.multiplyTransformation(o,e.content.worldTransform,o);let s=M.inverse(r,Tbe),a=M.multiplyTransformation(s,o,Px),c=e.content._lastSplatTransform;if(e.content._transformed&&l(c)&&M.equalsEpsilon(a,c,udt))return;let u=e.content.positions,f=e.content.rotations,d=e.content.scales,p=Math.sqrt(a[0]*a[0]+a[1]*a[1]+a[2]*a[2]),g=Math.sqrt(a[4]*a[4]+a[5]*a[5]+a[6]*a[6]),m=Math.sqrt(a[8]*a[8]+a[9]*a[9]+a[10]*a[10]);Ci[0]=a[0]/p,Ci[1]=a[1]/p,Ci[2]=a[2]/p,Ci[3]=a[4]/g,Ci[4]=a[5]/g,Ci[5]=a[6]/g,Ci[6]=a[8]/m,Ci[7]=a[9]/m,Ci[8]=a[10]/m;let y=Ci[0]*Ci[3]+Ci[1]*Ci[4]+Ci[2]*Ci[5],A=Ci[0]*Ci[6]+Ci[1]*Ci[7]+Ci[2]*Ci[8],b=Ci[3]*Ci[6]+Ci[4]*Ci[7]+Ci[5]*Ci[8],x=Math.abs(p-1)<=tQ&&Math.abs(g-1)<=tQ&&Math.abs(m-1)<=tQ,T=Math.abs(y)<=P4&&Math.abs(A)<=P4&&Math.abs(b)<=P4,E=Ci[0]*(Ci[4]*Ci[8]-Ci[5]*Ci[7])-Ci[3]*(Ci[1]*Ci[8]-Ci[2]*Ci[7])+Ci[6]*(Ci[1]*Ci[5]-Ci[2]*Ci[4]),v=x&&T&&Math.abs(E-1)<=P4;Le.fromRotationMatrix(Ci,S1),Le.normalize(S1,S1);let S=xt.getAttributeBySemantic(n,ct.POSITION).typedArray,I=xt.getAttributeBySemantic(n,ct.ROTATION).typedArray,R=xt.getAttributeBySemantic(n,ct.SCALE).typedArray,O=adt,L=cdt,_=ldt;for(let C=0;C<S.length/3;++C)O.x=S[C*3],O.y=S[C*3+1],O.z=S[C*3+2],L.x=I[C*4],L.y=I[C*4+1],L.z=I[C*4+2],L.w=I[C*4+3],_.x=R[C*3],_.y=R[C*3+1],_.z=R[C*3+2],v?(M.multiplyByPoint(a,O,O),Le.multiply(S1,L,L),Le.normalize(L,L)):(M.fromTranslationQuaternionRotationScale(O,L,_,v1),M.multiplyTransformation(a,v1,v1),M.getTranslation(v1,O),M.getScale(v1,_),Le.multiply(S1,L,L),Le.normalize(L,L)),u[C*3]=O.x,u[C*3+1]=O.y,u[C*3+2]=O.z,f[C*4]=L.x,f[C*4+1]=L.y,f[C*4+2]=L.z,f[C*4+3]=L.w,d[C*3]=_.x,d[C*3+1]=_.y,d[C*3+2]=_.z;e.content._lastSplatTransform=M.clone(a,e.content._lastSplatTransform),e.content._transformed=!0};zl.generateSplatTexture=function(e,t,n){if(!l(n)||n.state!==Ns.BUILDING)return;n.state=Ns.TEXTURE_PENDING;let i=w4.generateFromAttributes({attributes:{positions:new Float32Array(n.positions),scales:new Float32Array(n.scales),rotations:new Float32Array(n.rotations),colors:new Uint8Array(n.colors)},count:n.numSplats});if(!l(i)){n.state=Ns.BUILDING;return}Edt(e,t,n,i)};zl.buildGSplatDrawCommand=function(e,t){let n=e._tileset,i=new I4(e),{shaderBuilder:r}=i,o=i.renderStateOptions;o.cull.enabled=!1,o.depthMask=!1,o.depthTest.enabled=!0,o.blending=nn.PRE_MULTIPLIED_ALPHA_BLEND,i.alphaOptions.pass=Ie.GAUSSIAN_SPLATS,r.addAttribute("vec2","a_screenQuadPosition"),r.addAttribute("float","a_splatIndex"),r.addVarying("vec4","v_splatColor"),r.addVarying("vec2","v_vertPos"),r.addUniform("float","u_splitDirection",de.VERTEX),r.addVarying("float","v_splitDirection"),r.addUniform("highp usampler2D","u_splatAttributeTexture",de.VERTEX),r.addUniform("float","u_sphericalHarmonicsDegree",de.VERTEX),r.addUniform("float","u_splatScale",de.VERTEX),r.addUniform("vec3","u_cameraPositionWC",de.VERTEX),r.addUniform("mat3","u_inverseModelRotation",de.VERTEX);let s=i.uniformMap;r.addUniform("int","u_splatRowMask",de.VERTEX),r.addUniform("int","u_splatRowShift",de.VERTEX);let a=e.gaussianSplatTexture;s.u_splatAttributeTexture=function(){return a},s.u_splatRowMask=function(){return e._splatRowMask},s.u_splatRowShift=function(){return e._splatRowShift},e._sphericalHarmonicsDegree>0&&(r.addDefine("HAS_SPHERICAL_HARMONICS","1",de.VERTEX),r.addUniform("highp usampler2D","u_sphericalHarmonicsTexture",de.VERTEX),s.u_sphericalHarmonicsTexture=function(){return e.sphericalHarmonicsTexture}),s.u_sphericalHarmonicsDegree=function(){return e._sphericalHarmonicsDegree},s.u_cameraPositionWC=function(){return h.clone(t.camera.positionWC)},s.u_inverseModelRotation=function(){return e._shInverseRotation},s.u_splitDirection=function(){return e.splitDirection};let c=l(e._indexes)?e._indexes.length:e._numSplats;i.instanceCount=c,i.count=4,i.primitiveType=Oe.TRIANGLE_STRIP,r.addVertexLines(W2),r.addFragmentLines(G2);let u=r.buildShaderProgram(t.context),f=Ze(Ge.fromCache(i.renderStateOptions),!0);f.cull.face=xt.getCullFace(n.modelMatrix,Oe.TRIANGLE_STRIP),f=Ge.fromCache(f);let d={screenQuadPosition:0,splatIndex:2},p=new vn.Attribute;if(p.name="_SPLAT_INDEXES",p.typedArray=e._indexes,p.componentDatatype=Y.UNSIGNED_INT,p.type=Vt.SCALAR,p.normalized=!1,p.count=i.instanceCount,p.constant=0,p.instanceDivisor=1,!l(e._vertexArray)||e._indexes.length>e._vertexArrayLen){let b=new wt({attributes:{screenQuadPosition:new Ne({componentDatatype:Y.FLOAT,componentsPerAttribute:2,values:[-1,-1,1,-1,1,1,-1,1],name:"_SCREEN_QUAD_POS",variableName:"screenQuadPosition"}),splatIndex:{...p,variableName:"splatIndex"}},primitiveType:Oe.TRIANGLE_STRIP});e._vertexArray=Vn.fromGeometry({context:t.context,geometry:b,attributeLocations:d,bufferUsage:Me.DYNAMIC_DRAW,interleave:!1})}else e._vertexArray.getAttribute(1).vertexBuffer.copyFromArrayView(e._indexes);e._vertexArrayLen=e._indexes.length;let m=M.clone(e._rootTransform,e._drawCommandModelMatrix),y=e._vertexArray,A=new at({boundingVolume:n.boundingSphere,modelMatrix:m,uniformMap:s,renderState:f,vertexArray:y,shaderProgram:u,cull:o.cull.enabled,pass:Ie.GAUSSIAN_SPLATS,count:i.count,owner:e,instanceCount:i.instanceCount,primitiveType:Oe.TRIANGLE_STRIP,debugShowBoundingVolume:n.debugShowBoundingVolume,castShadows:!1,receiveShadows:!1});e._drawCommand=A};zl.prototype.update=function(e){let t=this._tileset;if(ydt(this,e.frameNumber),!t.show)return;if(this._drawCommand&&e.commandList.push(this._drawCommand),t._modelMatrixChanged){this._dirty=!0;return}let n=l(this._rootTransform);if(e.passes.pick===!0)return;this.splitDirection!==t.splitDirection&&(this.splitDirection=t.splitDirection);let i=e.camera;if(l(i)){if(this._sorterState===Ba.IDLE){let r=t._selectedTiles.length!==0&&_dt(this,t._selectedTiles);t._selectedTiles.length===0?(this._selectedTilesStableFrames=0,this._needsSnapshotRebuild=!1,this._snapshotRebuildStallFrames=0):r?this._selectedTilesStableFrames=0:this._selectedTilesStableFrames++,(r||this._dirty)&&(this._needsSnapshotRebuild=!0);let o=this._selectedTilesStableFrames>=fdt,s=!l(this._snapshot)&&!l(this._pendingSnapshot)&&!l(this._drawCommand);this._needsSnapshotRebuild&&t._selectedTiles.length!==0?this._snapshotRebuildStallFrames++:this._snapshotRebuildStallFrames=0;let a=o||s||this._snapshotRebuildStallFrames>=ddt;if(!(this._dirty||this._needsSnapshotRebuild||r||l(this._pendingSnapshot)||l(this._pendingSortPromise)||!l(this._drawCommand))&&M.equals(i.viewMatrix,this._prevViewMatrix))return;if(t._selectedTiles.length!==0&&this._needsSnapshotRebuild&&a){this._splatDataGeneration++,this._activeSort=void 0,this._sorterPromise=void 0,this._sorterState=Ba.IDLE,this._pendingSortPromise=void 0,this._pendingSort=void 0,l(this._pendingSnapshot)&&nQ(this._pendingSnapshot);let u=t._selectedTiles;this._rootTransform=At.eastNorthUpToFixedFrame(t.boundingSphere.center);{let E=u[0],v=M.multiplyTransformation(E.computedTransform,this._axisCorrectionMatrix,Tbe);M.multiplyTransformation(v,E.content.worldTransform??M.IDENTITY,v),M.getRotation(M.inverse(v,v),this._shInverseRotation)}for(let E of u)zl.transformTile(E);let f=u.reduce((E,v)=>E+v.content.pointsLength,0),d=(E,v,S,I)=>{let R,O=0,L=0;for(let _ of u){let C=S(_.content),w=l(I)?I:Vt.getNumberOfComponents(C.type),D=l(C.typedArray)?C.typedArray:C;L+=D.length,l(R)||(R=bdt(this,E,v,f*w))}if(!l(R))return Y.createTypedArray(v,0);for(let _ of u){let C=_.content,w=S(C),D=l(w.typedArray)?w.typedArray:w;R.set(D,O),O+=D.length}return xdt(R,L)},p=()=>{let E=0;for(let R of u)if(R.content.sphericalHarmonicsDegree>0){switch(R.content.sphericalHarmonicsDegree){case 1:E=9;break;case 2:E=24;break;case 3:E=45;break}break}if(E===0)return;let v=f*(E*(2/3));(!l(this._scratchAggregateShBuffer)||this._scratchAggregateShBuffer.length<v)&&(this._scratchAggregateShBuffer=new Uint32Array(v));let S=this._scratchAggregateShBuffer,I=0;for(let R of u){let O=R.content.packedSphericalHarmonicsData;R.content.sphericalHarmonicsDegree>0&&(S.set(O,I),I+=O.length)}return I<S.length?S.subarray(0,I):S},g=d("positions",Y.FLOAT,E=>E.positions,3),m=d("scales",Y.FLOAT,E=>E.scales,3),y=d("rotations",Y.FLOAT,E=>E.rotations,4),A=d("colors",Y.UNSIGNED_BYTE,E=>xt.getAttributeBySemantic(E.gltfPrimitive,ct.COLOR)),b=u[0].content.sphericalHarmonicsDegree,x=b>0?u[0].content.sphericalHarmonicsCoefficientCount:0,T=p();this._pendingSnapshot={generation:this._splatDataGeneration,positions:g,rotations:y,scales:m,colors:A,shData:T,sphericalHarmonicsDegree:b,shCoefficientCount:x,numSplats:f,indexes:void 0,gaussianSplatTexture:void 0,sphericalHarmonicsTexture:void 0,lastTextureWidth:0,lastTextureHeight:0,splatRowMask:0,splatRowShift:0,state:Ns.BUILDING},this.selectedTileLength=t._selectedTiles.length,this._selectedTileSet=new Set(t._selectedTiles),this._dirty=!1,this._needsSnapshotRebuild=!1,this._snapshotRebuildStallFrames=0}if(l(this._pendingSnapshot)){let u=this._pendingSnapshot;if(u.state===Ns.BUILDING){zl.generateSplatTexture(this,e,u);return}if(u.state===Ns.TEXTURE_PENDING||u.state===Ns.TEXTURE_READY&&!l(u.gaussianSplatTexture)||!n)return;if(M.clone(i.viewMatrix,this._prevViewMatrix),M.multiply(i.viewMatrix,this._rootTransform,Px),u.state===Ns.TEXTURE_READY&&!l(this._pendingSortPromise)){let f=++this._sortRequestId,d=this._splatDataGeneration;this._pendingSort={requestId:f,dataGeneration:d,expectedCount:u.numSplats,snapshot:u};let p=kv.radixSortIndexes({primitive:{positions:new Float32Array(u.positions),modelView:Float32Array.from(Px),count:u.numSplats},sortType:"Index"});if(!l(p)){this._pendingSortPromise=void 0,this._pendingSort=void 0,u.state=Ns.TEXTURE_READY;return}this._pendingSortPromise=p,u.state=Ns.SORTING;let g=this._pendingSort;Cdt(this,e,g,p);return}if(!l(this._pendingSortPromise)){u.state===Ns.SORTING&&(u.state=Ns.TEXTURE_READY);return}return}if(this._numSplats===0||!n)return;if(M.clone(i.viewMatrix,this._prevViewMatrix),M.multiply(i.viewMatrix,this._rootTransform,Px),!l(this._sorterPromise)){if(!gdt(this,e))return;let u=++this._sortRequestId,f=this._splatDataGeneration,d=this._numSplats;this._activeSort={requestId:u,dataGeneration:f,expectedCount:d};let p=kv.radixSortIndexes({primitive:{positions:new Float32Array(this._positions),modelView:Float32Array.from(Px),count:this._numSplats},sortType:"Index"});if(this._sorterPromise=p,l(p)){_be(this,e);let g=this._activeSort;this._sorterState=Ba.SORTING,bbe(this,g,p);return}}if(!l(this._sorterPromise)){this._sorterState=Ba.WAITING;return}this._sorterState=Ba.SORTING;return}else if(this._sorterState===Ba.WAITING){if(!l(this._sorterPromise)){let r=++this._sortRequestId,o=this._splatDataGeneration,s=this._numSplats;this._activeSort={requestId:r,dataGeneration:o,expectedCount:s};let a=kv.radixSortIndexes({primitive:{positions:new Float32Array(this._positions),modelView:Float32Array.from(Px),count:this._numSplats},sortType:"Index"});if(this._sorterPromise=a,l(a)){_be(this,e);let c=this._activeSort;this._sorterState=Ba.SORTING,bbe(this,c,a);return}}if(!l(this._sorterPromise)){this._sorterState=Ba.WAITING;return}this._sorterState=Ba.SORTING;return}else{if(this._sorterState===Ba.SORTING)return;if(this._sorterState===Ba.SORTED)zl.buildGSplatDrawCommand(this,e),this._sorterState=Ba.IDLE,this._dirty=!1,this._sorterPromise=void 0,this._activeSort=void 0;else if(this._sorterState===Ba.ERROR)throw this._sorterError}this._dirty=!1}};var D4=zl;var rQ=class e{constructor(t,n,i,r){this._tileset=n,this._tile=i,this._resource=r,this._loader=t,l(this._tileset.gaussianSplatPrimitive)||(this._tileset.gaussianSplatPrimitive=new D4({tileset:this._tileset})),this._positions=void 0,this._rotations=void 0,this._scales=void 0,this.gltfPrimitive=void 0,this.worldTransform=void 0,this.featurePropertiesDirty=!1,this._metadata=void 0,this._group=void 0,this._ready=!1,this._transformed=!1,this._sphericalHarmonicsDegree=0,this._sphericalHarmonicsCoefficientCount=0,this._packedSphericalHarmonicsData=void 0,this._lastSplatTransform=void 0}static tilesetRequiresGaussianSplattingExt(t){let n=!1;return t.isGltfExtensionRequired instanceof Function&&(n=t.isGltfExtensionRequired("KHR_gaussian_splatting")&&t.isGltfExtensionRequired("KHR_gaussian_splatting_compression_spz_2"),t.isGltfExtensionRequired("KHR_spz_gaussian_splats_compression")&&Yr("KHR_spz_gaussian_splats_compression",`Support for the original KHR_spz_gaussian_splats_compression extension has been removed in favor of the up to date KHR_gaussian_splatting and KHR_gaussian_splatting_compression_spz_2 extensions +`,o};xS.prototype.getVariables=function(){let e=[],t=this._runtimeConditions;if(!l(t)||t.length===0)return e;let n=t.length;for(let i=0;i<n;++i){let r=t[i];Zn(e,r.condition.getVariables()),Zn(e,r.expression.getVariables())}return e=e.filter(function(i,r,o){return o.indexOf(i)===r}),e};var T8=xS;function Xy(e){this._style={},this._ready=!1,this._show=void 0,this._color=void 0,this._pointSize=void 0,this._pointOutlineColor=void 0,this._pointOutlineWidth=void 0,this._labelColor=void 0,this._labelOutlineColor=void 0,this._labelOutlineWidth=void 0,this._font=void 0,this._labelStyle=void 0,this._labelText=void 0,this._backgroundColor=void 0,this._backgroundPadding=void 0,this._backgroundEnabled=void 0,this._scaleByDistance=void 0,this._translucencyByDistance=void 0,this._distanceDisplayCondition=void 0,this._heightOffset=void 0,this._anchorLineEnabled=void 0,this._anchorLineColor=void 0,this._image=void 0,this._disableDepthTestDistance=void 0,this._horizontalOrigin=void 0,this._verticalOrigin=void 0,this._labelHorizontalOrigin=void 0,this._labelVerticalOrigin=void 0,this._meta=void 0,this._lineWidth=void 0,this._colorShaderFunction=void 0,this._showShaderFunction=void 0,this._pointSizeShaderFunction=void 0,this._colorShaderFunctionReady=!1,this._showShaderFunctionReady=!1,this._pointSizeShaderFunctionReady=!1,this._colorShaderTranslucent=!1,O0t(this,e)}function O0t(e,t){t=Ze(t,!0)??e._style,e._style=t,e.show=t.show,e.color=t.color,e.pointSize=t.pointSize,e.pointOutlineColor=t.pointOutlineColor,e.pointOutlineWidth=t.pointOutlineWidth,e.labelColor=t.labelColor,e.labelOutlineColor=t.labelOutlineColor,e.labelOutlineWidth=t.labelOutlineWidth,e.labelStyle=t.labelStyle,e.font=t.font,e.labelText=t.labelText,e.backgroundColor=t.backgroundColor,e.backgroundPadding=t.backgroundPadding,e.backgroundEnabled=t.backgroundEnabled,e.scaleByDistance=t.scaleByDistance,e.translucencyByDistance=t.translucencyByDistance,e.distanceDisplayCondition=t.distanceDisplayCondition,e.heightOffset=t.heightOffset,e.anchorLineEnabled=t.anchorLineEnabled,e.anchorLineColor=t.anchorLineColor,e.image=t.image,e.disableDepthTestDistance=t.disableDepthTestDistance,e.horizontalOrigin=t.horizontalOrigin,e.verticalOrigin=t.verticalOrigin,e.labelHorizontalOrigin=t.labelHorizontalOrigin,e.labelVerticalOrigin=t.labelVerticalOrigin,e.lineWidth=t.lineWidth;let n={};if(l(t.meta)){let i=t.defines,r=t.meta??H.EMPTY_OBJECT;for(let o in r)r.hasOwnProperty(o)&&(n[o]=new Yh(r[o],i))}e._meta=n,e._ready=!0}function ho(e,t){let n=(e._style??H.EMPTY_OBJECT).defines;if(l(t)){if(typeof t=="boolean"||typeof t=="number")return new Yh(String(t));if(typeof t=="string")return new Yh(t,n);if(l(t.conditions))return new T8(t,n)}else return;return t}function mo(e){if(l(e)){if(l(e.expression))return e.expression;if(l(e.conditionsExpression))return Ze(e.conditionsExpression,!0)}else return;return e}Object.defineProperties(Xy.prototype,{style:{get:function(){return this._style}},show:{get:function(){return this._show},set:function(e){this._show=ho(this,e),this._style.show=mo(this._show),this._showShaderFunctionReady=!1}},color:{get:function(){return this._color},set:function(e){this._color=ho(this,e),this._style.color=mo(this._color),this._colorShaderFunctionReady=!1}},pointSize:{get:function(){return this._pointSize},set:function(e){this._pointSize=ho(this,e),this._style.pointSize=mo(this._pointSize),this._pointSizeShaderFunctionReady=!1}},pointOutlineColor:{get:function(){return this._pointOutlineColor},set:function(e){this._pointOutlineColor=ho(this,e),this._style.pointOutlineColor=mo(this._pointOutlineColor)}},pointOutlineWidth:{get:function(){return this._pointOutlineWidth},set:function(e){this._pointOutlineWidth=ho(this,e),this._style.pointOutlineWidth=mo(this._pointOutlineWidth)}},labelColor:{get:function(){return this._labelColor},set:function(e){this._labelColor=ho(this,e),this._style.labelColor=mo(this._labelColor)}},labelOutlineColor:{get:function(){return this._labelOutlineColor},set:function(e){this._labelOutlineColor=ho(this,e),this._style.labelOutlineColor=mo(this._labelOutlineColor)}},labelOutlineWidth:{get:function(){return this._labelOutlineWidth},set:function(e){this._labelOutlineWidth=ho(this,e),this._style.labelOutlineWidth=mo(this._labelOutlineWidth)}},font:{get:function(){return this._font},set:function(e){this._font=ho(this,e),this._style.font=mo(this._font)}},labelStyle:{get:function(){return this._labelStyle},set:function(e){this._labelStyle=ho(this,e),this._style.labelStyle=mo(this._labelStyle)}},labelText:{get:function(){return this._labelText},set:function(e){this._labelText=ho(this,e),this._style.labelText=mo(this._labelText)}},backgroundColor:{get:function(){return this._backgroundColor},set:function(e){this._backgroundColor=ho(this,e),this._style.backgroundColor=mo(this._backgroundColor)}},backgroundPadding:{get:function(){return this._backgroundPadding},set:function(e){this._backgroundPadding=ho(this,e),this._style.backgroundPadding=mo(this._backgroundPadding)}},backgroundEnabled:{get:function(){return this._backgroundEnabled},set:function(e){this._backgroundEnabled=ho(this,e),this._style.backgroundEnabled=mo(this._backgroundEnabled)}},scaleByDistance:{get:function(){return this._scaleByDistance},set:function(e){this._scaleByDistance=ho(this,e),this._style.scaleByDistance=mo(this._scaleByDistance)}},translucencyByDistance:{get:function(){return this._translucencyByDistance},set:function(e){this._translucencyByDistance=ho(this,e),this._style.translucencyByDistance=mo(this._translucencyByDistance)}},distanceDisplayCondition:{get:function(){return this._distanceDisplayCondition},set:function(e){this._distanceDisplayCondition=ho(this,e),this._style.distanceDisplayCondition=mo(this._distanceDisplayCondition)}},heightOffset:{get:function(){return this._heightOffset},set:function(e){this._heightOffset=ho(this,e),this._style.heightOffset=mo(this._heightOffset)}},anchorLineEnabled:{get:function(){return this._anchorLineEnabled},set:function(e){this._anchorLineEnabled=ho(this,e),this._style.anchorLineEnabled=mo(this._anchorLineEnabled)}},anchorLineColor:{get:function(){return this._anchorLineColor},set:function(e){this._anchorLineColor=ho(this,e),this._style.anchorLineColor=mo(this._anchorLineColor)}},image:{get:function(){return this._image},set:function(e){this._image=ho(this,e),this._style.image=mo(this._image)}},disableDepthTestDistance:{get:function(){return this._disableDepthTestDistance},set:function(e){this._disableDepthTestDistance=ho(this,e),this._style.disableDepthTestDistance=mo(this._disableDepthTestDistance)}},horizontalOrigin:{get:function(){return this._horizontalOrigin},set:function(e){this._horizontalOrigin=ho(this,e),this._style.horizontalOrigin=mo(this._horizontalOrigin)}},verticalOrigin:{get:function(){return this._verticalOrigin},set:function(e){this._verticalOrigin=ho(this,e),this._style.verticalOrigin=mo(this._verticalOrigin)}},labelHorizontalOrigin:{get:function(){return this._labelHorizontalOrigin},set:function(e){this._labelHorizontalOrigin=ho(this,e),this._style.labelHorizontalOrigin=mo(this._labelHorizontalOrigin)}},labelVerticalOrigin:{get:function(){return this._labelVerticalOrigin},set:function(e){this._labelVerticalOrigin=ho(this,e),this._style.labelVerticalOrigin=mo(this._labelVerticalOrigin)}},lineWidth:{get:function(){return this._lineWidth},set:function(e){this._lineWidth=ho(this,e),this._style.lineWidth=mo(this._lineWidth)}},meta:{get:function(){return this._meta},set:function(e){this._meta=e}}});Xy.fromUrl=function(e){return De.createIfNeeded(e).fetchJson(e).then(function(n){return new Xy(n)})};Xy.prototype.getColorShaderFunction=function(e,t,n){return this._colorShaderFunctionReady?(n.translucent=this._colorShaderTranslucent,this._colorShaderFunction):(this._colorShaderFunctionReady=!0,l(this.color)&&l(this.color.getShaderFunction)?this._colorShaderFunction=this.color.getShaderFunction(e,t,n,"vec4"):this._colorShaderFunction=void 0,this._colorShaderTranslucent=n.translucent,this._colorShaderFunction)};Xy.prototype.getShowShaderFunction=function(e,t,n){return this._showShaderFunctionReady?this._showShaderFunction:(this._showShaderFunctionReady=!0,l(this.show)&&l(this.show.getShaderFunction)?this._showShaderFunction=this.show.getShaderFunction(e,t,n,"bool"):this._showShaderFunction=void 0,this._showShaderFunction)};Xy.prototype.getPointSizeShaderFunction=function(e,t,n){return this._pointSizeShaderFunctionReady?this._pointSizeShaderFunction:(this._pointSizeShaderFunctionReady=!0,l(this.pointSize)&&l(this.pointSize.getShaderFunction)?this._pointSizeShaderFunction=this.pointSize.getShaderFunction(e,t,n,"float"):this._pointSizeShaderFunction=void 0,this._pointSizeShaderFunction)};Xy.prototype.getVariables=function(){let e=[];return l(this.color)&&l(this.color.getVariables)&&Zn(e,this.color.getVariables()),l(this.show)&&l(this.show.getVariables)&&Zn(e,this.show.getVariables()),l(this.pointSize)&&l(this.pointSize.getVariables)&&Zn(e,this.pointSize.getVariables()),e=e.filter(function(t,n,i){return i.indexOf(t)===n}),e};var Ky=Xy;var cEe=new ie,sEe=new ie,WQ=new ie,E8=new Map;E8.set(Hl,{packCollectionData:Rs.packPolylineCollectionData,packTilePrimitives:Rs.packPolylineSegments});E8.set(tc,{packCollectionData:Rs.packPolygonCollectionData,packTilePrimitives:Rs.packPolygonRings});var qQ=class{constructor(t){this._tilingScheme=t.tilingScheme,this.antialias=t.antialias??!0,this.minimumTileScreenPixels=t.minimumTileScreenPixels??256,this._heightReferenceByCollection=new Map,this._collectionDataCache=new WeakMap,this._markedThisFrame=new Set,this._markedFrameNumber=-1,this._dirtyRectangles=[]}get tilingScheme(){return this._tilingScheme}set tilingScheme(t){this._tilingScheme=t}get ellipsoid(){return this._tilingScheme.ellipsoid}remove(t){this._markedThisFrame.delete(t),this._heightReferenceByCollection.delete(t)&&this._markCollectionRegionDirty(t)}has(t){return this._heightReferenceByCollection.has(t)}static isSupported(t){return E8.has(t.constructor)}markForFrame(t,n,i){this._beginFrame(n),this._markedThisFrame.add(t),this._heightReferenceByCollection.has(t)||this._markCollectionRegionDirty(t),this._heightReferenceByCollection.set(t,i)}_beginFrame(t){if(t!==this._markedFrameNumber){for(let n of this._heightReferenceByCollection.keys())this._markedThisFrame.has(n)||(this._heightReferenceByCollection.delete(n),this._markCollectionRegionDirty(n));this._markedThisFrame.clear(),this._markedFrameNumber=t}}_markCollectionRegionDirty(t){let n=ie.fromBoundingSphere(t.boundingVolume,this._tilingScheme.ellipsoid,new ie);this._dirtyRectangles.push(n)}requestTileData(t,n,i,r,o){let s=this._tilingScheme.tileXYToRectangle(t,n,i,cEe);return this.requestDataForRectangle(s,r,o)}requestDataForRectangle(t,n,i){let r=this._tilingScheme,o=this._heightReferenceByCollection,s={show:!0,hasPolylines:!1,hasPolygons:!1,rectangle:ie.clone(t),collectionVersions:new Map,minimumTileScreenPixels:this.minimumTileScreenPixels,metersPerUv:M0t(t,r.ellipsoid)};for(let[u,f]of o){if(!aEe(f,i))continue;let d=ie.fromBoundingSphere(u.boundingVolume,r.ellipsoid,sEe);if(!!!ie.intersection(t,d,WQ))continue;let g=E8.get(u.constructor),m=this._getCollectionDataCached(u,g.packCollectionData);s.collectionVersions.set(u,m.version),g.packTilePrimitives(u,m,t,s)}let a=l(s.polylineSegments)&&s.polylineSegments.length>0,c=l(s.polygonRings)&&s.polygonRings.length>0;return s.hasPolylines=a,s.hasPolygons=c,!a&&!c?(s.show=!1,s):(a&&(Rs.packPolylineGrid(s),Rs.packPolylineTextures(n,s)),c&&(Rs.packPolygonGrid(s),Rs.packPolygonTextures(n,s)),Rs.packPrimitiveTextures(n,s),s)}releaseTileData(t){Rs.freeResources(t)}updateTileData(t,n,i,r,o,s){let a=this._dirtyRectangles,c=this._tilingScheme;return N0t(t,n,i,a,c)?(this.releaseTileData(o),this.requestTileData(t,n,i,r,s)):o}updateDataForRectangle(t,n,i,r){return this._isStale(i,t,r)?(this.releaseTileData(i),this.requestDataForRectangle(t,n,r)):i}_isStale(t,n,i){if(!ie.equals(t.rectangle,n))return!0;let r=t.collectionVersions,o=this._heightReferenceByCollection,s=0;for(let[a,c]of o){if(!aEe(c,i))continue;let u=ie.fromBoundingSphere(a.boundingVolume,this._tilingScheme.ellipsoid,sEe),f=!!ie.intersection(n,u,WQ),d=r.get(a);if(!f){if(l(d))return!0;continue}if(!l(d)||(s++,a._dirtyCount>0||d!==a._version))return!0}return s!==r.size}makeClean(){this._dirtyRectangles.length=0}update(t){l(t)&&this._beginFrame(t);for(let n of this._heightReferenceByCollection.keys()){let i=this._collectionDataCache.get(n);!l(i)||!(n._dirtyCount>0||i.version!==n._version)||(l(i.rectangle)&&this._dirtyRectangles.push(ie.clone(i.rectangle)),this._markCollectionRegionDirty(n))}}_getCollectionDataCached(t,n){let i=this._collectionDataCache.get(t),r=t._dirtyCount>0,o=i?.version!==t._version;if(l(i)&&!r&&!o)return i;let s=this.ellipsoid,a=n(t,s,i);return a.version=t._version+(r?1:0),a.rectangle=ie.fromBoundingSphere(t.boundingVolume,s,a.rectangle),this._collectionDataCache.set(t,a),t._makeClean(),a}};function aEe(e,t){return e===We.CLAMP_TO_GROUND||e===t}function M0t(e,t){let n=t.maximumRadius,i=(e.south+e.north)*.5;return new U(e.width*n*Math.cos(i),e.height*n)}function N0t(e,t,n,i,r){if(i.length===0)return!1;let o=r.tileXYToRectangle(e,t,n,cEe);for(let s=0;s<i.length;s++)if(ie.intersection(o,i[s],WQ))return!0;return!1}var $y=qQ;var lEe=new il,uEe=new Oa,fEe=new Lo,L0t=new Bp,F0t=new Cd,B0t=new Ed,YQ=class{constructor(t,n,i=0){ut(this,"_color",new z);ut(this,"_outlineColor",new z);this._content=t,this._batchId=n,this._batchTableId=i,this._primitivesByCollection=new Map}addPrimitiveByCollection(t,n){let i=this._primitivesByCollection.get(t);i||(i=[],this._primitivesByCollection.set(t,i)),i.push(n)}get show(){for(let t of this._iteratePrimitives())if(t.show)return!0;return!1}set show(t){for(let n of this._iteratePrimitives())n.show=t}get color(){for(let t of this._iterateMaterials())return z.clone(t.color,this._color);return z.clone(z.WHITE,this._color)}set color(t){for(let n of this._iterateMaterials())z.clone(t,n.color)}get pointSize(){for(let t of this._iteratePointMaterials())return t.size;return 1}set pointSize(t){for(let n of this._iteratePointMaterials())n.size=t}get pointOutlineColor(){for(let t of this._iteratePointMaterials())return z.clone(t.outlineColor,this._outlineColor);return z.clone(z.WHITE,this._outlineColor)}set pointOutlineColor(t){for(let n of this._iteratePointMaterials())z.clone(t,n.outlineColor)}get pointOutlineWidth(){for(let t of this._iteratePointMaterials())return t.outlineWidth;return 0}set pointOutlineWidth(t){for(let n of this._iteratePointMaterials())n.outlineWidth=t}get lineWidth(){for(let t of this._iteratePolylineMaterials())return t.width;return 1}set lineWidth(t){for(let n of this._iteratePolylineMaterials())n.width=t}get lineOutlineColor(){for(let t of this._iteratePolylineMaterials())return z.clone(t.outlineColor,this._outlineColor);return z.clone(z.WHITE,this._outlineColor)}set lineOutlineColor(t){for(let n of this._iteratePolylineMaterials())z.clone(t,n.outlineColor)}get lineOutlineWidth(){for(let t of this._iteratePolylineMaterials())return t.outlineWidth;return 0}set lineOutlineWidth(t){for(let n of this._iteratePolylineMaterials())n.outlineWidth=t}get polygonOutlineColor(){for(let t of this._iteratePolygonMaterials())return z.clone(t.outlineColor,this._outlineColor);return z.clone(z.WHITE,this._outlineColor)}set polygonOutlineColor(t){for(let n of this._iteratePolygonMaterials())z.clone(t,n.outlineColor)}get polygonOutlineWidth(){for(let t of this._iteratePolygonMaterials())return t.outlineWidth;return 0}set polygonOutlineWidth(t){for(let n of this._iteratePolygonMaterials())n.outlineWidth=t}get content(){return this._content}get tileset(){return this._content.tileset}get primitive(){return this._content.tileset}get featureId(){return this._batchId}get _batchTable(){return this._content.batchTables[this._batchTableId]}get pickIds(){let t=[];for(let n of this._iteratePrimitives())t.push(n._pickId);return t}hasProperty(t){return l(this._batchTable)?this._batchTable.hasProperty(this._batchId,t):!1}getPropertyIds(t){return l(this._batchTable)?this._batchTable.getPropertyIds(this._batchId,t):[]}getProperty(t){if(l(this._batchTable))return this._batchTable.getProperty(this._batchId,t)}getPropertyInherited(t){return ma.getPropertyInherited(this._content,this._batchId,t,this._batchTable)}setProperty(t,n){throw new pe("Not implemented")}isExactClass(t){return l(this._batchTable)?this._batchTable.isExactClass(this._batchId,t):!1}isClass(t){return l(this._batchTable)?this._batchTable.isClass(this._batchId,t):!1}getExactClassName(){if(l(this._batchTable))return this._batchTable.getExactClassName(this._batchId)}*_iteratePrimitives(){yield*this._iteratePrimitivesWith(vf,lEe),yield*this._iteratePrimitivesWith(Hl,uEe),yield*this._iteratePrimitivesWith(tc,fEe)}*_iteratePrimitivesWith(t,n){let i=this._content._collections;for(let r=0;r<i.length;r++){let o=i[r],s=this._primitivesByCollection.get(r);if(s&&o instanceof t)for(let a of s)o.get(a,n),yield n}}*_iterateMaterials(){yield*this._iteratePointMaterials(),yield*this._iteratePolylineMaterials(),yield*this._iteratePolygonMaterials()}*_iteratePointMaterials(){yield*this._iterateMaterialsWith(vf,lEe,L0t)}*_iteratePolylineMaterials(){yield*this._iterateMaterialsWith(Hl,uEe,F0t)}*_iteratePolygonMaterials(){yield*this._iterateMaterialsWith(tc,fEe,B0t)}*_iterateMaterialsWith(t,n,i){for(let r of this._iteratePrimitivesWith(t,n))r.getMaterial(i),yield i,r.setMaterial(i)}},TS=YQ;var dEe=new h,k0t=new il,U0t=new Oa,mEe=new Lo;function z0t(e,t){let n=t.scene.nodes,i={collections:[],collectionLocalMatrices:[],collectionFeatureTableIds:new Map,featuresByTableId:new Map};for(let r=0;r<n.length;r++)pEe(e,n[r],M.IDENTITY,i);return i}function C8(e){let t=e.BYTES_PER_ELEMENT*8;return Math.pow(2,t)-1}function V0t(e){let t={pointPrimitiveCount:0,pointVertexCount:0,polylinePrimitiveCount:0,polylineVertexCount:0,polygonPrimitiveCount:0,polygonVertexCount:0,polygonHoleCount:0,polygonTriangleCount:0},n=e.vector,i=e.polygon,r=e.primitiveType,s=xt.getAttributeBySemantic(e,ct.POSITION).count,a=e.indices?La.readIndicesAsTypedArray(e.indices):void 0;if(r===Oe.POINTS)t.pointPrimitiveCount+=s,t.pointVertexCount+=s;else if(r===Oe.LINE_STRIP){let c=n?n.count:hEe(a);t.polylinePrimitiveCount+=c,t.polylineVertexCount+=a.length-c+1}else if(r===Oe.TRIANGLES||r===Oe.LINE_LOOP)if(n){t.polygonPrimitiveCount+=n.count,t.polygonVertexCount+=s,t.polygonTriangleCount+=a.length/3;let c=n.polygonHoleCounts;if(c)for(let u=0;u<c.length;u++)t.polygonHoleCount+=c[u]}else{let c=hEe(i.loopIndices);t.polygonPrimitiveCount+=i.count,t.polygonVertexCount+=i.loopIndices.length-c+1,t.polygonTriangleCount+=i.triangleIndices.length,t.polygonHoleCount+=c-i.count}else throw new oe(`Unexpected primitive type: ${r}`);return t}function hEe(e){let t=C8(e),n=0;for(let i=0;i<e.length;i++)e[i]===t&&i+1<e.length&&n++;return n+1}function j0t(e,t,n,i,r){let o=xt.getAttributeBySemantic(t,ct.POSITION),s=o.typedArray??(n.positionNormalized?La.readAttributeAsRawCompactTypedArray(o):La.readAttributeAsTypedArray(o)),a=t.indices?La.readIndicesAsTypedArray(t.indices):void 0,c=H0t(e,t,r);n instanceof vf?G0t(n,i,s,a,c):n instanceof Hl?W0t(n,i,s,a,c):n instanceof tc&&(l(t.vector)?q0t(n,i,s,a,c,t.vector):Y0t(n,i,s,c,t.polygon))}function H0t(e,t,n){let i=e.tileset.featureIdLabel,r=xt.getFeatureIdsByLabel(t.featureIds,i);if(!(r instanceof vn.FeatureIdAttribute))return()=>{};let o=xt.getAttributeBySemantic(t,ct.FEATURE_ID,r.setIndex),s=o.typedArray??La.readAttributeAsTypedArray(o);for(let a=0;a<s.length;a++){let c=s[a];if(!n.has(c)){let u=new TS(e,c,r.propertyTableId);n.set(c,u)}}return function(c){let u=s[c];if(u!==r.nullFeatureId)return n.get(u)}}function G0t(e,t,n,i,r){let o=n.length/3;for(let s=0,a=i?i.length:o;s<a;s++){let c=i?i[s]:s;h.fromArray(n,c*3,dEe);let u=r(c);u&&u.addPrimitiveByCollection(t,s),e.add({position:dEe,pickObject:u,featureId:u?.featureId},k0t)}}function W0t(e,t,n,i,r){let o=C8(i),s=0,a=0,c=0;for(let u=0;u<i.length;u++){if(i[u]===o?a=u-s:u+1===i.length&&(a=u+1-s),a===0)continue;let d=s+a,p=i.subarray(s,d),g=gEe(n,p,3),m=r(i[s]);m&&m.addPrimitiveByCollection(t,c),e.add({positions:g,pickObject:m,featureId:m?.featureId},U0t),s=u+1,a=0,c++}}function q0t(e,t,n,i,r,o){let s=o.polygonAttributeOffsets,a=o.polygonIndicesOffsets,c=o.polygonHoleCounts,u=o.polygonHoleOffsets,f=n.length/3,d=s.length;for(let p=0;p<d;p++){let g=s[p],m=p+1<d?s[p+1]:f,y=n.subarray(g*3,m*3),A;if(l(c)&&c[p]>0){let v=c[p];A=u.slice(p,p+v);for(let S=0;S<v;S++)A[S]-=g}let b=a[p],x=p+1<d?a[p+1]:i.length,T=i.slice(b,x);for(let v=0;v<T.length;v++)T[v]-=g;let E=r(g);E&&E.addPrimitiveByCollection(t,p),e.add({positions:y,triangles:T,holes:A,pickObject:E,featureId:E?.featureId},mEe)}}function Y0t(e,t,n,i,r){let o=r.loopIndices.constructor,s=new o(r.loopIndices.length),a=C8(r.loopIndices);for(let c=0;c<r.count;c++){let u=c+1===r.count,f=r.loopIndicesOffsets[c],d=u?r.loopIndices.length:r.loopIndicesOffsets[c+1],p=r.loopIndices.subarray(f,d),g=gEe(n,p,3,s),m=[];for(let x=0;x<p.length;x++){let T=x+1===p.length;p[x]===a&&!T&&m.push(x)}let y=new o(m),A;if(l(r.triangleIndices)){let x=r.triangleIndicesOffsets[c],T=u?r.triangleIndices.length:r.triangleIndicesOffsets[c+1];A=r.triangleIndices.subarray(x,T);for(let E=0;E<A.length;E++)A[E]=s[A[E]]}else throw new Error("Runtime triangulation not yet supported.");let b=i(p[0]);b&&b.addPrimitiveByCollection(t,c),e.add({positions:g,triangles:A,holes:y,pickObject:b,featureId:b?.featureId},mEe)}}function pEe(e,t,n,i){let r=xt.getNodeTransform(t),o=M.multiplyTransformation(n,r,new M),s=t.primitives;for(let c=0;c<s.length;c++){let u=s[c],f=u.primitiveType,d,p=V0t(u),g=xt.getAttributeBySemantic(u,ct.POSITION),m=g.normalized??!1,y=g.componentDatatype;f===Oe.POINTS?d=new vf({primitiveCountMax:p.pointPrimitiveCount,allowPicking:!0,positionNormalized:m,positionDatatype:y}):f===Oe.LINE_STRIP?d=new Hl({primitiveCountMax:p.polylinePrimitiveCount,vertexCountMax:p.polylineVertexCount,allowPicking:!0,positionNormalized:m,positionDatatype:y}):(f===Oe.TRIANGLES||f===Oe.LINE_LOOP)&&(d=new tc({primitiveCountMax:p.polygonPrimitiveCount,vertexCountMax:p.polygonVertexCount,holeCountMax:p.polygonHoleCount,triangleCountMax:p.polygonTriangleCount,allowPicking:!0,positionNormalized:m,positionDatatype:y}));let b=u.featureIds?.[0]?.propertyTableId;i.featuresByTableId.has(b)||i.featuresByTableId.set(b,new Map),i.collections.push(d),i.collectionLocalMatrices.push(M.clone(o)),i.collectionFeatureTableIds.set(d,b),j0t(e,u,d,i.collections.length-1,i.featuresByTableId.get(b))}let a=t.children;for(let c=0;c<a.length;c++)pEe(e,a[c],o,i)}function gEe(e,t,n,i){let r=C8(t),o=0;for(let u=0;u<t.length;u++)t[u]!==r&&o++;let s=e.constructor,a=new s(o*n),c=0;for(let u=0;u<t.length;u++){let f=t[u];if(i&&(i[f]=f===r?r:c),f!==r){for(let d=0;d<n;d++)a[c*n+d]=e[f*n+d];c++}}return a}var v8=z0t;var S8=new il,w8=new Oa,I8=new Lo,$1=new Bp,XQ=new Cd,_Ee=new Ed,yEe=new M,KQ=class e{constructor(t,n,i){this._tileset=t,this._tile=n,this._resource=i,this._model=void 0,this._collections=[],this._collectionLocalMatrices=[],this._collectionFeatureTableIds=new Map,this._featuresByTableId=new Map,this._metadata=void 0,this._group=void 0,this.featurePropertiesDirty=!1,this._ready=!1,this._modelMatrix=M.clone(M.IDENTITY)}get featuresLength(){return this.batchTables.reduce((t,n)=>t+n.featuresLength,0)}get pointsLength(){return this._collections.filter(t=>t instanceof vf).reduce((t,n)=>t+n.primitiveCount,0)}get trianglesLength(){return this._collections.reduce((t,n)=>n instanceof tc?t+n.triangleCount:n instanceof Hl?t+(n.vertexCount-n.primitiveCount)*2:t,0)}get geometryByteLength(){return this._collections.reduce((t,n)=>t+n.byteLength,0)}get texturesByteLength(){return 0}get batchTableByteLength(){return this.batchTables.reduce((t,n)=>t+n.batchTableByteLength,0)}get innerContents(){}get ready(){return this._ready}get tileset(){return this._tileset}get tile(){return this._tile}get url(){return this._resource.getUrlComponent(!0)}get batchTables(){return this._model._featureTables}get batchTable(){throw new pe("Deprecated: Use `content.batchTables`.")}get metadata(){return this._metadata}set metadata(t){this._metadata=t}get group(){return this._group}set group(t){this._group=t}getFeature(t,n){return this._featuresByTableId.get(n)?.get(t)}hasProperty(t,n,i){let r=this.getFeature(t,i);return r?r.hasProperty(n):!1}applyDebugSettings(t,n){let i=t?`color("${n.toCssHexString()}", 1.0)`:'color("white", 1.0)';this.applyStyle(new Ky({color:i}))}applyStyle(t){let n=o=>o instanceof vf,i=o=>o instanceof Hl,r=o=>o instanceof tc;for(let o of this._collections.filter(n)){let s=this._collectionFeatureTableIds.get(o);for(let a=0,c=o.primitiveCount;a<c;a++){o.get(a,S8);let u=this.getFeature(S8.featureId,s);l(t.show)&&(S8.show=t.show.evaluate(u)),l(t.color)&&t.color.evaluate(u,$1.color),l(t.pointSize)&&($1.size=t.pointSize.evaluate(u)),l(t.pointOutlineWidth)&&($1.outlineWidth=t.pointOutlineWidth.evaluate(u)),l(t.pointOutlineColor)&&t.pointOutlineColor.evaluate(u,$1.outlineColor),S8.setMaterial($1)}}for(let o of this._collections.filter(i)){let s=this._collectionFeatureTableIds.get(o);for(let a=0,c=o.primitiveCount;a<c;a++){o.get(a,w8);let u=this.getFeature(w8.featureId,s);l(t.show)&&(w8.show=t.show.evaluate(u)),l(t.color)&&t.color.evaluate(u,XQ.color),l(t.lineWidth)&&(XQ.width=t.lineWidth.evaluate(u)),w8.setMaterial(XQ)}}for(let o of this._collections.filter(r)){let s=this._collectionFeatureTableIds.get(o);for(let a=0,c=o.primitiveCount;a<c;a++){o.get(a,I8);let u=this.getFeature(I8.featureId,s);l(t.show)&&(I8.show=t.show.evaluate(u)),l(t.color)&&t.color.evaluate(u,_Ee.color),I8.setMaterial(_Ee)}}}update(t,n){let i=this._tileset,r=i._scene?.vectorProvider;if(l(this._model)&&!this._ready){let s=this._model;s.modelMatrix=this._tile.computedTransform,s.update(n),s.ready&&(K0t(this),this._ready=!0)}M.multiplyTransformation(this._tile.computedTransform,this._modelMatrix,yEe);let o=l(r)&&this._tile._selectedFrame===n.frameNumber;for(let s=0;s<this._collections.length;s++){let a=this._collections[s];M.multiplyTransformation(yEe,this._collectionLocalMatrices[s],a.modelMatrix),!fs(i._heightReference)||!$y.isSupported(a)?a.update(n):o&&r.markForFrame(a,n.frameNumber,i._heightReference)}}pick(t,n,i){}isDestroyed(){return!1}destroy(){let t=this._tileset._scene?.vectorProvider;this._model?.destroy(),this._model=void 0;for(let n of this._collections)t?.remove(n),n.destroy();return this._collections.length=0,le(this)}static async fromGltf(t,n,i,r){let o=new e(t,n,i),s=X0t(t,n,o,r),a=await Md.fromGltfAsync(s);return a.show=!1,o._model=a,o}};function X0t(e,t,n,i){return{gltf:i,basePath:n._resource,cull:!1,releaseGltfJson:!0,opaquePass:Ie.CESIUM_3D_TILE,modelMatrix:t.computedTransform,upAxis:e._modelUpAxis,forwardAxis:e._modelForwardAxis,incrementallyLoadTextures:!1,content:n,featureIdLabel:e.featureIdLabel,instanceFeatureIdLabel:e.instanceFeatureIdLabel,projectTo2D:e._projectTo2D,enablePick:e._enablePick,enableDebugWireframe:e._enableDebugWireframe,enableShowOutline:!1}}function K0t(e){let t=e._model.sceneGraph.components,n=xt.getAxisCorrectionMatrix(t.upAxis,t.forwardAxis,new M);M.multiplyTransformation(t.transform,n,e._modelMatrix);let i=v8(e,t);e._collections=i.collections,e._collectionLocalMatrices=i.collectionLocalMatrices,e._collectionFeatureTableIds=i.collectionFeatureTableIds,e._featuresByTableId=i.featuresByTableId}var Ux=KQ;function oc(){}oc._maxSortingConcurrency=Math.max(dn.hardwareConcurrency-1,1);oc._sorterTaskProcessor=void 0;oc._taskProcessorReady=!1;oc._error=void 0;oc._getSorterTaskProcessor=function(){if(!l(oc._sorterTaskProcessor)){let e=new $n("gaussianSplatSorter",oc._maxSortingConcurrency);e.initWebAssemblyModule({wasmBinaryFile:"ThirdParty/wasm_splats_bg.wasm"}).then(function(t){t?oc._taskProcessorReady=!0:oc._error=new oe("Gaussian splat sorter could not be initialized.")}).catch(t=>{oc._error=t}),oc._sorterTaskProcessor=e}return oc._sorterTaskProcessor};oc.radixSortIndexes=function(e){let t=oc._getSorterTaskProcessor();if(l(oc._error))throw oc._error;if(oc._taskProcessorReady)return t.scheduleTask(e,[e.primitive.positions.buffer])};var ES=oc;function sc(){}sc._maxSortingConcurrency=Math.max(dn.hardwareConcurrency-1,1);sc._textureTaskProcessor=void 0;sc._taskProcessorReady=!1;sc._error=void 0;sc._getTextureTaskProcessor=function(){if(!l(sc._textureTaskProcessor)){let e=new $n("gaussianSplatTextureGenerator",sc._maxSortingConcurrency);e.initWebAssemblyModule({wasmBinaryFile:"ThirdParty/wasm_splats_bg.wasm"}).then(function(t){t?sc._taskProcessorReady=!0:sc._error=new oe("Gaussian splat sorter could not be initialized.")}).catch(t=>{sc._error=t}),sc._textureTaskProcessor=e}return sc._textureTaskProcessor};sc.generateFromAttributes=function(e){let t=sc._getTextureTaskProcessor();if(l(sc._error))throw sc._error;if(!sc._taskProcessorReady)return;let{attributes:n}=e;return t.scheduleTask(e,[n.positions.buffer,n.scales.buffer,n.rotations.buffer,n.colors.buffer])};var P8=sc;function $0t(e){let t=new F_;this.shaderBuilder=t,this.uniformMap={},this.renderStateOptions=Ge.getState(Ge.fromCache({depthTest:{enabled:!0,func:Ac.LESS_OR_EQUAL}})),this.alphaOptions=new lS,this.hasSkipLevelOfDetail=!1,e._useLogDepth&&t.addDefine("LOG_DEPTH_READ_ONLY",void 0,de.FRAGMENT)}var D8=$0t;var zx=new M,CEe=new M,J1=new M,Ci=new $,Z1=new Le,J0t=new h,Z0t=new Le,Q0t=new h,egt=1e-12,R8=1e-5,$Q=1e-7,Ua={IDLE:0,WAITING:1,SORTING:2,SORTED:3,ERROR:4},Fs={BUILDING:"BUILDING",TEXTURE_PENDING:"TEXTURE_PENDING",TEXTURE_READY:"TEXTURE_READY",SORTING:"SORTING",READY:"READY"},tgt=2,ngt=30,igt=3,rgt=.008726646259971648,ogt=1;function sgt(e,t){let n=e._lastSteadySortFrameNumber>=0?t.frameNumber-e._lastSteadySortFrameNumber:Number.POSITIVE_INFINITY;if(e._lastSteadySortFrameNumber>=0&&n<igt)return!1;let i=t.camera;return l(i)?!e._hasLastSteadySortCameraPosition||!e._hasLastSteadySortCameraDirection||h.distance(i.positionWC,e._lastSteadySortCameraPosition)>=ogt?!0:h.angleBetween(i.directionWC,e._lastSteadySortCameraDirection)>=rgt:!1}function AEe(e,t){e._lastSteadySortFrameNumber=t.frameNumber;let n=t.camera;l(n)&&(h.clone(n.positionWC,e._lastSteadySortCameraPosition),e._hasLastSteadySortCameraPosition=!0,h.clone(n.directionWC,e._lastSteadySortCameraDirection),e._hasLastSteadySortCameraDirection=!0)}function agt(e,t){let n=e._selectedTileSet;if(!l(n)||n.size!==t.length)return!0;for(let i=0;i<t.length;i++)if(!n.has(t[i]))return!0;return!1}function bEe(e,t){return l(t)&&t.requestId===e._sortRequestId&&t.dataGeneration===e._splatDataGeneration}function JQ(e){l(e)&&(l(e.gaussianSplatTexture)&&(e.gaussianSplatTexture.destroy(),e.gaussianSplatTexture=void 0),l(e.sphericalHarmonicsTexture)&&(e.sphericalHarmonicsTexture.destroy(),e.sphericalHarmonicsTexture=void 0))}function xEe(e,t,n){if(!l(t))return;e._retiredTextures.push({texture:t,frameNumber:n})}function cgt(e,t){let n=e._retiredTextures;if(!l(n)||n.length===0)return;let i=[];for(let r=0;r<n.length;r++){let o=n[r];t-o.frameNumber>0?o.texture.destroy():i.push(o)}e._retiredTextures=i}function lgt(e,t){let n=e?.[t];return l(n)?n.buffer:void 0}function ugt(e,t,n,i){let r=e._aggregateScratchBuffers[t];l(r)||(r=[],e._aggregateScratchBuffers[t]=r);let o=lgt(e._snapshot,t);for(let a=0;a<r.length;a++){let c=r[a];if(c.length>=i&&c.buffer!==o)return c}let s=Y.createTypedArray(n,i);return r.push(s),s}function fgt(e,t){return e.length===t?e:e.subarray(0,t)}function dgt(e,t,n){if(!l(t.indexes)||t.state!==Fs.READY)throw new pe("Committing snapshot before it is READY.");let i=n.frameNumber,r=e._snapshot,o=l(r)?r.gaussianSplatTexture:e.gaussianSplatTexture;l(o)&&o!==t.gaussianSplatTexture&&xEe(e,o,i);let s=l(r)?r.sphericalHarmonicsTexture:e.sphericalHarmonicsTexture;l(s)&&s!==t.sphericalHarmonicsTexture&&xEe(e,s,i),e._snapshot=t,e._positions=t.positions,e._rotations=t.rotations,e._scales=t.scales,e._colors=t.colors,e._shData=t.shData,e._sphericalHarmonicsDegree=t.sphericalHarmonicsDegree,e._numSplats=t.numSplats,e._indexes=t.indexes,e.gaussianSplatTexture=t.gaussianSplatTexture,e.sphericalHarmonicsTexture=t.sphericalHarmonicsTexture,e._lastTextureWidth=t.lastTextureWidth,e._lastTextureHeight=t.lastTextureHeight,e._splatRowMask=t.splatRowMask,e._splatRowShift=t.splatRowShift,e._splatBudgetSSEScale=t.splatBudgetSSEScale??1,e._hasGaussianSplatTexture=l(t.gaussianSplatTexture),e._needsGaussianSplatTexture=!1,e._gaussianSplatTexturePending=!1,e._vertexArray=void 0,e._vertexArrayLen=-1,e._drawCommand=void 0,e._sorterPromise=void 0,e._activeSort=void 0,e._sorterState=Ua.IDLE,e._dirty=!1}async function hgt(e,t,n,i){try{let r=await i,o=Ut.maximumTextureSize,s=o,a=Math.ceil(n.numSplats/(o/2)),c=Math.log2(o/2),u=o/2-1;if(a>o){let g=n.numSplats;a=o;let m=s/2;if(n.numSplats=o*m,n.positions=n.positions.subarray(0,n.numSplats*3),n.rotations=n.rotations.subarray(0,n.numSplats*4),n.scales=n.scales.subarray(0,n.numSplats*3),n.colors=n.colors.subarray(0,n.numSplats*4),l(n.shData)){let y=n.shData.length/g;n.shData=n.shData.subarray(0,Math.floor(n.numSplats*y))}n.splatBudgetSSEScale=g/n.numSplats,console.warn(`[GaussianSplat][HARD CAP] ${g} splats exceed the maximum texture capacity (${o}\xD7${m} = ${n.numSplats} splats at width=${s}). Rendering only the first ${n.numSplats} splats to avoid a WebGL crash. Increasing maximumScreenSpaceError by ${n.splatBudgetSSEScale.toFixed(2)}x next frame.`)}else n.splatBudgetSSEScale=1;let f=s*a*4,d;f<=r.data.length?d=r.data.subarray(0,f):(d=new Uint32Array(f),d.set(r.data));let p={width:s,height:a,data:d};if(n.splatRowMask=u,n.splatRowShift=c,e._pendingSnapshot!==n){n.state=Fs.BUILDING;return}if(!l(n.gaussianSplatTexture))n.gaussianSplatTexture=EEe(t.context,p);else if(n.lastTextureHeight!==p.height||n.lastTextureWidth!==p.width){let g=n.gaussianSplatTexture;n.gaussianSplatTexture=EEe(t.context,p),g.destroy()}else n.gaussianSplatTexture.copyFrom({source:{width:p.width,height:p.height,arrayBufferView:p.data}});if(n.lastTextureHeight=p.height,n.lastTextureWidth=p.width,l(n.shData)&&n.sphericalHarmonicsDegree>0){let g=n.sphericalHarmonicsTexture,m=Ut.maximumTextureSize,y=n.shCoefficientCount/3,A=Math.floor(m/y),b=A*(y*2),x=Math.ceil(n.numSplats/A);if(x>m)console.warn(`[GaussianSplat][SHTexture] ${n.numSplats} splats require SH height ${x} > maxTex ${m}. Disabling spherical harmonics for this snapshot (color-only fallback).`),n.sphericalHarmonicsDegree=0,l(g)&&g.destroy(),n.sphericalHarmonicsTexture=void 0;else{let T=new Uint32Array(m*x*2),E=0;for(let v=0;E<n.shData.length;v+=m*2)T.set(n.shData.subarray(E,E+b),v),E+=b;n.sphericalHarmonicsTexture=pgt(t.context,{data:T,width:m,height:x}),l(g)&&g.destroy()}}n.state=Fs.TEXTURE_READY}catch(r){console.error("Error generating Gaussian splat texture:",r),n.state=Fs.BUILDING}}async function mgt(e,t,n,i){try{let r=await i;if(!l(n)||n.snapshot!==e._pendingSnapshot)return;let o=n.expectedCount,s=o,a=r?.length;if(o!==s||a!==o){e._pendingSortPromise=void 0,e._pendingSort=void 0,n.snapshot.state===Fs.SORTING&&(n.snapshot.state=Fs.TEXTURE_READY);return}let c=n.snapshot;c.indexes=r,c.state=Fs.READY,e._pendingSortPromise=void 0,e._pendingSort=void 0,dgt(e,c,t),e._pendingSnapshot=void 0,Gl.buildGSplatDrawCommand(e,t)}catch(r){if(!l(n)||n.snapshot!==e._pendingSnapshot)return;e._pendingSortPromise=void 0,e._pendingSort=void 0,n.snapshot.state===Fs.SORTING&&(n.snapshot.state=Fs.TEXTURE_READY),e._sorterState=Ua.ERROR,e._sorterError=r}}async function TEe(e,t,n){try{let i=await n,r=bEe(e,t),o=t?.expectedCount,s=o,a=i?.length;if(!r||(o!==s||a!==o)){r&&(e._sorterPromise=void 0,e._sorterState=Ua.IDLE);return}e._indexes=i,e._sorterState=Ua.SORTED}catch(i){if(!bEe(e,t))return;e._sorterState=Ua.ERROR,e._sorterError=i}}function pgt(e,t){return new Dt({context:e,source:{width:t.width,height:t.height,arrayBufferView:t.data},preMultiplyAlpha:!1,skipColorSpaceConversion:!0,pixelFormat:$e.RG_INTEGER,pixelDatatype:ze.UNSIGNED_INT,flipY:!1,sampler:Ht.NEAREST})}function EEe(e,t){return new Dt({context:e,source:{width:t.width,height:t.height,arrayBufferView:t.data},preMultiplyAlpha:!1,skipColorSpaceConversion:!0,pixelFormat:$e.RGBA_INTEGER,pixelDatatype:ze.UNSIGNED_INT,flipY:!1,sampler:Ht.NEAREST})}function Gl(e){e=e??H.EMPTY_OBJECT,this._positions=void 0,this._rotations=void 0,this._scales=void 0,this._colors=void 0,this._indexes=void 0,this._numSplats=0,this._needsGaussianSplatTexture=!0,this._snapshot=void 0,this._pendingSnapshot=void 0,this._retiredTextures=[],this._aggregateScratchBuffers={positions:[],scales:[],rotations:[],colors:[]},this._scratchAggregateShBuffer=void 0,this._selectedTilesStableFrames=0,this._needsSnapshotRebuild=!1,this._snapshotRebuildStallFrames=0,this._prevViewMatrix=new M,this._debugShowBoundingVolume=e.debugShowBoundingVolume??!1,this.gaussianSplatTexture=void 0,this.sphericalHarmonicsTexture=void 0,this._lastTextureWidth=0,this._lastTextureHeight=0,this._vertexArray=void 0,this._vertexArrayLen=-1,this._splitDirection=Yo.NONE,this._dirty=!1,this._tileset=e.tileset,this._baseTilesetUpdate=this._tileset.update,this._tileset.update=this._wrappedUpdate.bind(this),this._tileset.tileLoad.addEventListener(this.onTileLoad,this),this._tileset.tileVisible.addEventListener(this.onTileVisible,this),this.selectedTileLength=0,this._selectedTileSet=new Set,this._ready=!1,this._hasGaussianSplatTexture=!1,this._gaussianSplatTexturePending=!1,this._drawCommand=void 0,this._drawCommandModelMatrix=new M,this._rootTransform=void 0,this._axisCorrectionMatrix=xt.getAxisCorrectionMatrix(qi.Y,qi.X,new M),this._shInverseRotation=new $,this._isDestroyed=!1,this._sorterState=Ua.IDLE,this._sorterPromise=void 0,this._splatDataGeneration=0,this._sortRequestId=0,this._activeSort=void 0,this._pendingSortPromise=void 0,this._pendingSort=void 0,this._lastSteadySortFrameNumber=-1,this._lastSteadySortCameraPosition=new h,this._hasLastSteadySortCameraPosition=!1,this._lastSteadySortCameraDirection=new h,this._hasLastSteadySortCameraDirection=!1,this._sorterError=void 0,this._splatRowMask=0,this._splatRowShift=0,this._splatBudgetSSEScale=1}Object.defineProperties(Gl.prototype,{ready:{get:function(){return this._ready}},isStable:{get:function(){return!this._dirty&&(!l(this._pendingSnapshot)||this._pendingSnapshot.state===Fs.READY)}},splitDirection:{get:function(){return this._splitDirection},set:function(e){this._splitDirection!==e&&(this._splitDirection=e,this._dirty=!0)}}});Gl.prototype._wrappedUpdate=function(e){let t=this._tileset;if(this._splatBudgetSSEScale!==1){let n=t.maximumScreenSpaceError;t.maximumScreenSpaceError*=this._splatBudgetSSEScale,this._baseTilesetUpdate.call(t,e),t.maximumScreenSpaceError=n}else this._baseTilesetUpdate.call(t,e);this.update(e)};Gl.prototype.destroy=function(){if(this._positions=void 0,this._rotations=void 0,this._scales=void 0,this._colors=void 0,this._indexes=void 0,JQ(this._pendingSnapshot),JQ(this._snapshot),l(this._retiredTextures))for(let t=0;t<this._retiredTextures.length;t++)this._retiredTextures[t].texture.destroy();this._retiredTextures=[],this._pendingSnapshot=void 0,this._snapshot=void 0,this._aggregateScratchBuffers=void 0,this.gaussianSplatTexture=void 0,this.sphericalHarmonicsTexture=void 0;let e=this._drawCommand;return l(e)&&(e.shaderProgram=e.shaderProgram&&e.shaderProgram.destroy()),l(this._vertexArray)&&(this._vertexArray.destroy(),this._vertexArray=void 0),this._tileset.update=this._baseTilesetUpdate.bind(this._tileset),le(this)};Gl.prototype.isDestroyed=function(){return this._isDestroyed};Gl.prototype.onTileLoad=function(e){this._dirty=!0};Gl.prototype.onTileVisible=function(e){};Gl.transformTile=function(e){let t=e.computedTransform,n=e.content.gltfPrimitive,i=e.tileset.gaussianSplatPrimitive;i._rootTransform===void 0&&(i._rootTransform=At.eastNorthUpToFixedFrame(e.tileset.boundingSphere.center));let r=i._rootTransform,o=M.multiplyTransformation(t,i._axisCorrectionMatrix,zx);M.multiplyTransformation(o,e.content.worldTransform,o);let s=M.inverse(r,CEe),a=M.multiplyTransformation(s,o,zx),c=e.content._lastSplatTransform;if(e.content._transformed&&l(c)&&M.equalsEpsilon(a,c,egt))return;let u=e.content.positions,f=e.content.rotations,d=e.content.scales,p=Math.sqrt(a[0]*a[0]+a[1]*a[1]+a[2]*a[2]),g=Math.sqrt(a[4]*a[4]+a[5]*a[5]+a[6]*a[6]),m=Math.sqrt(a[8]*a[8]+a[9]*a[9]+a[10]*a[10]);Ci[0]=a[0]/p,Ci[1]=a[1]/p,Ci[2]=a[2]/p,Ci[3]=a[4]/g,Ci[4]=a[5]/g,Ci[5]=a[6]/g,Ci[6]=a[8]/m,Ci[7]=a[9]/m,Ci[8]=a[10]/m;let y=Ci[0]*Ci[3]+Ci[1]*Ci[4]+Ci[2]*Ci[5],A=Ci[0]*Ci[6]+Ci[1]*Ci[7]+Ci[2]*Ci[8],b=Ci[3]*Ci[6]+Ci[4]*Ci[7]+Ci[5]*Ci[8],x=Math.abs(p-1)<=$Q&&Math.abs(g-1)<=$Q&&Math.abs(m-1)<=$Q,T=Math.abs(y)<=R8&&Math.abs(A)<=R8&&Math.abs(b)<=R8,E=Ci[0]*(Ci[4]*Ci[8]-Ci[5]*Ci[7])-Ci[3]*(Ci[1]*Ci[8]-Ci[2]*Ci[7])+Ci[6]*(Ci[1]*Ci[5]-Ci[2]*Ci[4]),v=x&&T&&Math.abs(E-1)<=R8;Le.fromRotationMatrix(Ci,Z1),Le.normalize(Z1,Z1);let S=xt.getAttributeBySemantic(n,ct.POSITION).typedArray,I=xt.getAttributeBySemantic(n,ct.ROTATION).typedArray,R=xt.getAttributeBySemantic(n,ct.SCALE).typedArray,O=J0t,L=Z0t,_=Q0t;for(let C=0;C<S.length/3;++C)O.x=S[C*3],O.y=S[C*3+1],O.z=S[C*3+2],L.x=I[C*4],L.y=I[C*4+1],L.z=I[C*4+2],L.w=I[C*4+3],_.x=R[C*3],_.y=R[C*3+1],_.z=R[C*3+2],v?(M.multiplyByPoint(a,O,O),Le.multiply(Z1,L,L),Le.normalize(L,L)):(M.fromTranslationQuaternionRotationScale(O,L,_,J1),M.multiplyTransformation(a,J1,J1),M.getTranslation(J1,O),M.getScale(J1,_),Le.multiply(Z1,L,L),Le.normalize(L,L)),u[C*3]=O.x,u[C*3+1]=O.y,u[C*3+2]=O.z,f[C*4]=L.x,f[C*4+1]=L.y,f[C*4+2]=L.z,f[C*4+3]=L.w,d[C*3]=_.x,d[C*3+1]=_.y,d[C*3+2]=_.z;e.content._lastSplatTransform=M.clone(a,e.content._lastSplatTransform),e.content._transformed=!0};Gl.generateSplatTexture=function(e,t,n){if(!l(n)||n.state!==Fs.BUILDING)return;n.state=Fs.TEXTURE_PENDING;let i=P8.generateFromAttributes({attributes:{positions:new Float32Array(n.positions),scales:new Float32Array(n.scales),rotations:new Float32Array(n.rotations),colors:new Uint8Array(n.colors)},count:n.numSplats});if(!l(i)){n.state=Fs.BUILDING;return}hgt(e,t,n,i)};Gl.buildGSplatDrawCommand=function(e,t){let n=e._tileset,i=new D8(e),{shaderBuilder:r}=i,o=i.renderStateOptions;o.cull.enabled=!1,o.depthMask=!1,o.depthTest.enabled=!0,o.blending=nn.PRE_MULTIPLIED_ALPHA_BLEND,i.alphaOptions.pass=Ie.GAUSSIAN_SPLATS,r.addAttribute("vec2","a_screenQuadPosition"),r.addAttribute("float","a_splatIndex"),r.addVarying("vec4","v_splatColor"),r.addVarying("vec2","v_vertPos"),r.addUniform("float","u_splitDirection",de.VERTEX),r.addVarying("float","v_splitDirection"),r.addUniform("highp usampler2D","u_splatAttributeTexture",de.VERTEX),r.addUniform("float","u_sphericalHarmonicsDegree",de.VERTEX),r.addUniform("float","u_splatScale",de.VERTEX),r.addUniform("vec3","u_cameraPositionWC",de.VERTEX),r.addUniform("mat3","u_inverseModelRotation",de.VERTEX);let s=i.uniformMap;r.addUniform("int","u_splatRowMask",de.VERTEX),r.addUniform("int","u_splatRowShift",de.VERTEX);let a=e.gaussianSplatTexture;s.u_splatAttributeTexture=function(){return a},s.u_splatRowMask=function(){return e._splatRowMask},s.u_splatRowShift=function(){return e._splatRowShift},e._sphericalHarmonicsDegree>0&&(r.addDefine("HAS_SPHERICAL_HARMONICS","1",de.VERTEX),r.addUniform("highp usampler2D","u_sphericalHarmonicsTexture",de.VERTEX),s.u_sphericalHarmonicsTexture=function(){return e.sphericalHarmonicsTexture}),s.u_sphericalHarmonicsDegree=function(){return e._sphericalHarmonicsDegree},s.u_cameraPositionWC=function(){return h.clone(t.camera.positionWC)},s.u_inverseModelRotation=function(){return e._shInverseRotation},s.u_splitDirection=function(){return e.splitDirection};let c=l(e._indexes)?e._indexes.length:e._numSplats;i.instanceCount=c,i.count=4,i.primitiveType=Oe.TRIANGLE_STRIP,r.addVertexLines(W2),r.addFragmentLines(G2);let u=r.buildShaderProgram(t.context),f=Ze(Ge.fromCache(i.renderStateOptions),!0);f.cull.face=xt.getCullFace(n.modelMatrix,Oe.TRIANGLE_STRIP),f=Ge.fromCache(f);let d={screenQuadPosition:0,splatIndex:2},p=new vn.Attribute;if(p.name="_SPLAT_INDEXES",p.typedArray=e._indexes,p.componentDatatype=Y.UNSIGNED_INT,p.type=Vt.SCALAR,p.normalized=!1,p.count=i.instanceCount,p.constant=0,p.instanceDivisor=1,!l(e._vertexArray)||e._indexes.length>e._vertexArrayLen){let b=new wt({attributes:{screenQuadPosition:new Ne({componentDatatype:Y.FLOAT,componentsPerAttribute:2,values:[-1,-1,1,-1,1,1,-1,1],name:"_SCREEN_QUAD_POS",variableName:"screenQuadPosition"}),splatIndex:{...p,variableName:"splatIndex"}},primitiveType:Oe.TRIANGLE_STRIP});e._vertexArray=Vn.fromGeometry({context:t.context,geometry:b,attributeLocations:d,bufferUsage:Me.DYNAMIC_DRAW,interleave:!1})}else e._vertexArray.getAttribute(1).vertexBuffer.copyFromArrayView(e._indexes);e._vertexArrayLen=e._indexes.length;let m=M.clone(e._rootTransform,e._drawCommandModelMatrix),y=e._vertexArray,A=new at({boundingVolume:n.boundingSphere,modelMatrix:m,uniformMap:s,renderState:f,vertexArray:y,shaderProgram:u,cull:o.cull.enabled,pass:Ie.GAUSSIAN_SPLATS,count:i.count,owner:e,instanceCount:i.instanceCount,primitiveType:Oe.TRIANGLE_STRIP,debugShowBoundingVolume:n.debugShowBoundingVolume,castShadows:!1,receiveShadows:!1});e._drawCommand=A};Gl.prototype.update=function(e){let t=this._tileset;if(cgt(this,e.frameNumber),!t.show)return;if(this._drawCommand&&e.commandList.push(this._drawCommand),t._modelMatrixChanged){this._dirty=!0;return}let n=l(this._rootTransform);if(e.passes.pick===!0)return;this.splitDirection!==t.splitDirection&&(this.splitDirection=t.splitDirection);let i=e.camera;if(l(i)){if(this._sorterState===Ua.IDLE){let r=t._selectedTiles.length!==0&&agt(this,t._selectedTiles);t._selectedTiles.length===0?(this._selectedTilesStableFrames=0,this._needsSnapshotRebuild=!1,this._snapshotRebuildStallFrames=0):r?this._selectedTilesStableFrames=0:this._selectedTilesStableFrames++,(r||this._dirty)&&(this._needsSnapshotRebuild=!0);let o=this._selectedTilesStableFrames>=tgt,s=!l(this._snapshot)&&!l(this._pendingSnapshot)&&!l(this._drawCommand);this._needsSnapshotRebuild&&t._selectedTiles.length!==0?this._snapshotRebuildStallFrames++:this._snapshotRebuildStallFrames=0;let a=o||s||this._snapshotRebuildStallFrames>=ngt;if(!(this._dirty||this._needsSnapshotRebuild||r||l(this._pendingSnapshot)||l(this._pendingSortPromise)||!l(this._drawCommand))&&M.equals(i.viewMatrix,this._prevViewMatrix))return;if(t._selectedTiles.length!==0&&this._needsSnapshotRebuild&&a){this._splatDataGeneration++,this._activeSort=void 0,this._sorterPromise=void 0,this._sorterState=Ua.IDLE,this._pendingSortPromise=void 0,this._pendingSort=void 0,l(this._pendingSnapshot)&&JQ(this._pendingSnapshot);let u=t._selectedTiles;this._rootTransform=At.eastNorthUpToFixedFrame(t.boundingSphere.center);{let E=u[0],v=M.multiplyTransformation(E.computedTransform,this._axisCorrectionMatrix,CEe);M.multiplyTransformation(v,E.content.worldTransform??M.IDENTITY,v),M.getRotation(M.inverse(v,v),this._shInverseRotation)}for(let E of u)Gl.transformTile(E);let f=u.reduce((E,v)=>E+v.content.pointsLength,0),d=(E,v,S,I)=>{let R,O=0,L=0;for(let _ of u){let C=S(_.content),w=l(I)?I:Vt.getNumberOfComponents(C.type),D=l(C.typedArray)?C.typedArray:C;L+=D.length,l(R)||(R=ugt(this,E,v,f*w))}if(!l(R))return Y.createTypedArray(v,0);for(let _ of u){let C=_.content,w=S(C),D=l(w.typedArray)?w.typedArray:w;R.set(D,O),O+=D.length}return fgt(R,L)},p=()=>{let E=0;for(let R of u)if(R.content.sphericalHarmonicsDegree>0){switch(R.content.sphericalHarmonicsDegree){case 1:E=9;break;case 2:E=24;break;case 3:E=45;break}break}if(E===0)return;let v=f*(E*(2/3));(!l(this._scratchAggregateShBuffer)||this._scratchAggregateShBuffer.length<v)&&(this._scratchAggregateShBuffer=new Uint32Array(v));let S=this._scratchAggregateShBuffer,I=0;for(let R of u){let O=R.content.packedSphericalHarmonicsData;R.content.sphericalHarmonicsDegree>0&&(S.set(O,I),I+=O.length)}return I<S.length?S.subarray(0,I):S},g=d("positions",Y.FLOAT,E=>E.positions,3),m=d("scales",Y.FLOAT,E=>E.scales,3),y=d("rotations",Y.FLOAT,E=>E.rotations,4),A=d("colors",Y.UNSIGNED_BYTE,E=>xt.getAttributeBySemantic(E.gltfPrimitive,ct.COLOR)),b=u[0].content.sphericalHarmonicsDegree,x=b>0?u[0].content.sphericalHarmonicsCoefficientCount:0,T=p();this._pendingSnapshot={generation:this._splatDataGeneration,positions:g,rotations:y,scales:m,colors:A,shData:T,sphericalHarmonicsDegree:b,shCoefficientCount:x,numSplats:f,indexes:void 0,gaussianSplatTexture:void 0,sphericalHarmonicsTexture:void 0,lastTextureWidth:0,lastTextureHeight:0,splatRowMask:0,splatRowShift:0,state:Fs.BUILDING},this.selectedTileLength=t._selectedTiles.length,this._selectedTileSet=new Set(t._selectedTiles),this._dirty=!1,this._needsSnapshotRebuild=!1,this._snapshotRebuildStallFrames=0}if(l(this._pendingSnapshot)){let u=this._pendingSnapshot;if(u.state===Fs.BUILDING){Gl.generateSplatTexture(this,e,u);return}if(u.state===Fs.TEXTURE_PENDING||u.state===Fs.TEXTURE_READY&&!l(u.gaussianSplatTexture)||!n)return;if(M.clone(i.viewMatrix,this._prevViewMatrix),M.multiply(i.viewMatrix,this._rootTransform,zx),u.state===Fs.TEXTURE_READY&&!l(this._pendingSortPromise)){let f=++this._sortRequestId,d=this._splatDataGeneration;this._pendingSort={requestId:f,dataGeneration:d,expectedCount:u.numSplats,snapshot:u};let p=ES.radixSortIndexes({primitive:{positions:new Float32Array(u.positions),modelView:Float32Array.from(zx),count:u.numSplats},sortType:"Index"});if(!l(p)){this._pendingSortPromise=void 0,this._pendingSort=void 0,u.state=Fs.TEXTURE_READY;return}this._pendingSortPromise=p,u.state=Fs.SORTING;let g=this._pendingSort;mgt(this,e,g,p);return}if(!l(this._pendingSortPromise)){u.state===Fs.SORTING&&(u.state=Fs.TEXTURE_READY);return}return}if(this._numSplats===0||!n)return;if(M.clone(i.viewMatrix,this._prevViewMatrix),M.multiply(i.viewMatrix,this._rootTransform,zx),!l(this._sorterPromise)){if(!sgt(this,e))return;let u=++this._sortRequestId,f=this._splatDataGeneration,d=this._numSplats;this._activeSort={requestId:u,dataGeneration:f,expectedCount:d};let p=ES.radixSortIndexes({primitive:{positions:new Float32Array(this._positions),modelView:Float32Array.from(zx),count:this._numSplats},sortType:"Index"});if(this._sorterPromise=p,l(p)){AEe(this,e);let g=this._activeSort;this._sorterState=Ua.SORTING,TEe(this,g,p);return}}if(!l(this._sorterPromise)){this._sorterState=Ua.WAITING;return}this._sorterState=Ua.SORTING;return}else if(this._sorterState===Ua.WAITING){if(!l(this._sorterPromise)){let r=++this._sortRequestId,o=this._splatDataGeneration,s=this._numSplats;this._activeSort={requestId:r,dataGeneration:o,expectedCount:s};let a=ES.radixSortIndexes({primitive:{positions:new Float32Array(this._positions),modelView:Float32Array.from(zx),count:this._numSplats},sortType:"Index"});if(this._sorterPromise=a,l(a)){AEe(this,e);let c=this._activeSort;this._sorterState=Ua.SORTING,TEe(this,c,a);return}}if(!l(this._sorterPromise)){this._sorterState=Ua.WAITING;return}this._sorterState=Ua.SORTING;return}else{if(this._sorterState===Ua.SORTING)return;if(this._sorterState===Ua.SORTED)Gl.buildGSplatDrawCommand(this,e),this._sorterState=Ua.IDLE,this._dirty=!1,this._sorterPromise=void 0,this._activeSort=void 0;else if(this._sorterState===Ua.ERROR)throw this._sorterError}this._dirty=!1}};var O8=Gl;var QQ=class e{constructor(t,n,i,r){this._tileset=n,this._tile=i,this._resource=r,this._loader=t,l(this._tileset.gaussianSplatPrimitive)||(this._tileset.gaussianSplatPrimitive=new O8({tileset:this._tileset})),this._positions=void 0,this._rotations=void 0,this._scales=void 0,this.gltfPrimitive=void 0,this.worldTransform=void 0,this.featurePropertiesDirty=!1,this._metadata=void 0,this._group=void 0,this._ready=!1,this._transformed=!1,this._sphericalHarmonicsDegree=0,this._sphericalHarmonicsCoefficientCount=0,this._packedSphericalHarmonicsData=void 0,this._lastSplatTransform=void 0}static tilesetRequiresGaussianSplattingExt(t){let n=!1;return t.isGltfExtensionRequired instanceof Function&&(n=t.isGltfExtensionRequired("KHR_gaussian_splatting")&&t.isGltfExtensionRequired("KHR_gaussian_splatting_compression_spz_2"),t.isGltfExtensionRequired("KHR_spz_gaussian_splats_compression")&&Yr("KHR_spz_gaussian_splats_compression",`Support for the original KHR_spz_gaussian_splats_compression extension has been removed in favor of the up to date KHR_gaussian_splatting and KHR_gaussian_splatting_compression_spz_2 extensions -Please retile your tileset with the KHR_gaussian_splatting and KHR_gaussian_splatting_compression_spz_2 extensions.`)),n}get featuresLength(){return 0}get pointsLength(){return this.gltfPrimitive.attributes[0].count}get trianglesLength(){return 0}get geometryByteLength(){return 0}get texturesByteLength(){let t=this._tileset?.gaussianSplatPrimitive;if(!l(t))return 0;let n=t.gaussianSplatTexture,i=t.selectedTileLength;return!l(n)||i===0?0:n.sizeInBytes/i}get batchTableByteLength(){return 0}get innerContents(){}get ready(){return this._ready}get transformed(){return this._transformed}get tileset(){return this._tileset}get tile(){return this._tile}get url(){return this._resource.getUrlComponent(!0)}get batchTable(){}get metadata(){return this._metadata}set metadata(t){this._metadata=t}get group(){return this._group}set group(t){this._group=t}get positions(){return this._positions}get rotations(){return this._rotations}get scales(){return this._scales}get sphericalHarmonicsCoefficientCount(){return this._sphericalHarmonicsCoefficientCount}get sphericalHarmonicsDegree(){return this._sphericalHarmonicsDegree}get packedSphericalHarmonicsData(){return this._packedSphericalHarmonicsData}static async fromGltf(t,n,i,r){let o=i,s=De.createIfNeeded(o),a={releaseGltfJson:!1,upAxis:qi.Y,forwardAxis:qi.Z};l(r.asset)?(a.gltfJson=r,a.baseResource=s,a.gltfResource=s):r instanceof Uint8Array?(a.typedArray=r,a.baseResource=s,a.gltfResource=s):a.gltfResource=De.createIfNeeded(r);let c=new _d(a);try{await c.load()}catch(u){throw c.destroy(),new oe(`Failed to load glTF: ${u.message}`)}return new e(c,t,n,i)}update(t,n){let i=this._loader;if(!this._ready){if(n.afterRender.push(()=>!0),!l(i)){this._ready=!0;return}if(this._resourcesLoaded){this.gltfPrimitive=i.components.scene.nodes[0].primitives[0],this.worldTransform=i.components.scene.nodes[0].matrix,this._ready=!0,this._positions=xt.getAttributeBySemantic(this.gltfPrimitive,ct.POSITION).typedArray.slice(),this._rotations=xt.getAttributeBySemantic(this.gltfPrimitive,ct.ROTATION).typedArray.slice(),this._scales=xt.getAttributeBySemantic(this.gltfPrimitive,ct.SCALE).typedArray.slice();let{l:r,n:o}=wdt(this.gltfPrimitive.attributes);this._sphericalHarmonicsDegree=r,this._sphericalHarmonicsCoefficientCount=o,this._packedSphericalHarmonicsData=Rdt(this);return}this._resourcesLoaded=i.process(n)}}hasProperty(t,n){return!1}getFeature(t){}applyDebugSettings(t,n){}applyStyle(t){}pick(t,n,i){}isDestroyed(){return this.isDestroyed}destroy(){return this.splatPrimitive=void 0,this._tile=void 0,this._tileset=void 0,this._resource=void 0,this._ready=!1,this._group=void 0,this._metadata=void 0,this._resourcesLoaded=!1,this._lastSplatTransform=void 0,l(this._loader)&&(this._loader.destroy(),this._loader=void 0),le(this)}};function Sdt(e){return`${e.startsWith("KHR_gaussian_splatting:")?"KHR_gaussian_splatting:":"_"}SH_DEGREE_`}function wdt(e){switch(e.filter(n=>n.name.includes("SH_DEGREE_")).length){default:case 0:return{l:0,n:0};case 3:return{l:1,n:9};case 8:return{l:2,n:24};case 15:return{l:3,n:45}}}var Ebe=new ArrayBuffer(4),Idt=new Float32Array(Ebe),Pdt=new Uint32Array(Ebe);function iQ(e){Idt[0]=e;let t=Pdt[0],n=t>>31&1,i=t>>23&255,r=t&8388607,o;if(i===255)o=n<<15|31744|(r?512:0);else if(i===0)o=n<<15;else{let s=i-127+15;s>=31?o=n<<15|31744:s<=0?o=n<<15:o=n<<15|s<<10|r>>>13}return o}function Ddt(e){let t=Sdt(e),n="_COEF_",i=t.length,r=e.indexOf(n,i),o=parseInt(e.slice(i,r),10),s=parseInt(e.slice(r+n.length),10);return{l:o,n:s}}function Rdt(e){let t=e.sphericalHarmonicsDegree,n=e.sphericalHarmonicsCoefficientCount,i=e.pointsLength*(n*(2/3)),r=new Uint32Array(i),o=e.gltfPrimitive.attributes.filter(u=>u.name.includes("SH_DEGREE_")),s=0,a=[0,9,24];switch(t){case 1:s=9;break;case 2:s=24;break;case 3:s=45;break}o.sort((u,f)=>u.name<f.name?-1:u.name>f.name?1:0);let c=s*(2/3);for(let u=0;u<o.length;u++){let{l:f,n:d}=Ddt(o[u].name);for(let p=0;p<e.pointsLength;p++){let g=a[f-1]*2/3,m=p*c+g+d*2,y=p*3;r[m]=iQ(o[u].typedArray[y])|iQ(o[u].typedArray[y+1])<<16,r[m+1]=iQ(o[u].typedArray[y+2])}}return r}var Dx=rQ;var Cbe={b3dm:function(e,t,n,i,r){return Cd.fromB3dm(e,t,n,i,r)},pnts:function(e,t,n,i,r){return Cd.fromPnts(e,t,n,i,r)},i3dm:function(e,t,n,i,r){return Cd.fromI3dm(e,t,n,i,r)},cmpt:function(e,t,n,i,r){return t3.fromTileType(e,t,n,i,r,Cbe)},externalTileset:function(e,t,n,i){return t4.fromJson(e,t,n,i)},geom:function(e,t,n,i,r){return new c3(e,t,n,i,r)},vctr:function(e,t,n,i,r){return new p4(e,t,n,i,r)},subt:function(e,t,n,i,r){return xD.fromSubtreeJson(e,t,n,void 0,i,r)},subtreeJson:function(e,t,n,i){return xD.fromSubtreeJson(e,t,n,i)},glb:function(e,t,n,i,r){if(i.byteLength<12)throw new oe("Invalid glb content");let a=new DataView(i,r).getUint32(8,!0),c=new Uint8Array(i,r,a);return Dx.tilesetRequiresGaussianSplattingExt(e)?Dx.fromGltf(e,t,n,c):e.hasExtension("3DTILES_content_gltf_vector")||e.isGltfExtensionUsed("CESIUM_mesh_vector")?Ix.fromGltf(e,t,n,c):Cd.fromGltf(e,t,n,c)},gltf:function(e,t,n,i){return Dx.tilesetRequiresGaussianSplattingExt(e)?Dx.fromGltf(e,t,n,i):e.hasExtension("3DTILES_content_gltf_vector")||e.isGltfExtensionUsed("CESIUM_mesh_vector")?Ix.fromGltf(e,t,n,i):Cd.fromGltf(e,t,n,i)},geoJson:function(e,t,n,i){return Cd.fromGeoJson(e,t,n,i)}},Uv=Cbe;var vbe={UNLOADED:0,LOADING:1,PROCESSING:2,READY:3,EXPIRED:4,FAILED:5};Object.freeze(vbe);var Mr=vbe;var Dd={BATCHED_3D_MODEL:"b3dm",INSTANCED_3D_MODEL:"i3dm",COMPOSITE:"cmpt",POINT_CLOUD:"pnts",VECTOR:"vctr",GEOMETRY:"geom",GLTF:"gltf",GLTF_BINARY:"glb",IMPLICIT_SUBTREE:"subt",IMPLICIT_SUBTREE_JSON:"subtreeJson",EXTERNAL_TILESET:"externalTileset",MULTIPLE_CONTENT:"multipleContent",GEOJSON:"geoJson",VOXEL_BINARY:"voxl",VOXEL_JSON:"voxelJson"};Dd.isBinaryFormat=function(e){switch(e){case Dd.BATCHED_3D_MODEL:case Dd.INSTANCED_3D_MODEL:case Dd.COMPOSITE:case Dd.POINT_CLOUD:case Dd.VECTOR:case Dd.GEOMETRY:case Dd.IMPLICIT_SUBTREE:case Dd.VOXEL_BINARY:case Dd.GLTF_BINARY:return!0;default:return!1}};Object.freeze(Dd);var ka=Dd;var Sbe={NOT_COMPUTED:-1,USE_OPTIMIZATION:1,SKIP_OPTIMIZATION:0};Object.freeze(Sbe);var Hh=Sbe;var ga={RENDER:0,PICK:1,SHADOW:2,PRELOAD:3,PRELOAD_FLIGHT:4,REQUEST_RENDER_MODE_DEFER_CHECK:5,MOST_DETAILED_PRELOAD:6,MOST_DETAILED_PICK:7,NUMBER_OF_PASSES:8},_g=new Array(ga.NUMBER_OF_PASSES);_g[ga.RENDER]=Object.freeze({pass:ga.RENDER,isRender:!0,requestTiles:!0,ignoreCommands:!1});_g[ga.PICK]=Object.freeze({pass:ga.PICK,isRender:!1,requestTiles:!1,ignoreCommands:!1});_g[ga.SHADOW]=Object.freeze({pass:ga.SHADOW,isRender:!1,requestTiles:!0,ignoreCommands:!1});_g[ga.PRELOAD]=Object.freeze({pass:ga.PRELOAD,isRender:!1,requestTiles:!0,ignoreCommands:!0});_g[ga.PRELOAD_FLIGHT]=Object.freeze({pass:ga.PRELOAD_FLIGHT,isRender:!1,requestTiles:!0,ignoreCommands:!0});_g[ga.REQUEST_RENDER_MODE_DEFER_CHECK]=Object.freeze({pass:ga.REQUEST_RENDER_MODE_DEFER_CHECK,isRender:!1,requestTiles:!0,ignoreCommands:!0});_g[ga.MOST_DETAILED_PRELOAD]=Object.freeze({pass:ga.MOST_DETAILED_PRELOAD,isRender:!1,requestTiles:!0,ignoreCommands:!0});_g[ga.MOST_DETAILED_PICK]=Object.freeze({pass:ga.MOST_DETAILED_PICK,isRender:!1,requestTiles:!1,ignoreCommands:!1});ga.getPassOptions=function(e){return _g[e]};Object.freeze(ga);var po=ga;var oQ=class{constructor(t,n){this._tileset=t,this._tile=n,this.featurePropertiesDirty=!1}get featuresLength(){return 0}get pointsLength(){return 0}get trianglesLength(){return 0}get geometryByteLength(){return 0}get texturesByteLength(){return 0}get batchTableByteLength(){return 0}get innerContents(){}get ready(){return!0}get tileset(){return this._tileset}get tile(){return this._tile}get url(){}get metadata(){}set metadata(t){}get batchTable(){}get group(){}set group(t){}hasProperty(t,n){return!1}getFeature(t){}applyDebugSettings(t,n){}applyStyle(t){}update(t,n){}pick(t,n,i){}isDestroyed(){return!1}destroy(){return le(this)}},yg=oQ;function Ag(e){e=e??H.EMPTY_OBJECT;let t=e.content,n=e.class;this._class=n,this._properties=t.properties,this._extensions=t.extensions,this._extras=t.extras}Object.defineProperties(Ag.prototype,{class:{get:function(){return this._class}},extras:{get:function(){return this._extras}},extensions:{get:function(){return this._extensions}}});Ag.prototype.hasProperty=function(e){return Xn.hasProperty(e,this._properties,this._class)};Ag.prototype.hasPropertyBySemantic=function(e){return Xn.hasPropertyBySemantic(e,this._properties,this._class)};Ag.prototype.getPropertyIds=function(e){return Xn.getPropertyIds(this._properties,this._class,e)};Ag.prototype.getProperty=function(e){return Xn.getProperty(e,this._properties,this._class)};Ag.prototype.setProperty=function(e,t){return Xn.setProperty(e,t,this._properties,this._class)};Ag.prototype.getPropertyBySemantic=function(e){return Xn.getPropertyBySemantic(e,this._properties,this._class)};Ag.prototype.setPropertyBySemantic=function(e,t){return Xn.setPropertyBySemantic(e,t,this._properties,this._class)};var R4=Ag;function sQ(e,t){let n=sr(t,"3DTILES_metadata")?t.extensions["3DTILES_metadata"]:t.metadata;if(!l(n))return;if(!l(e.schema)){sQ._oneTimeWarning("findContentMetadata-missing-root-schema","Could not find a metadata schema for content metadata. For tilesets that contain external tilesets, make sure the schema is added to the root tileset.json.");return}let i=e.schema.classes??H.EMPTY_OBJECT;if(l(n.class)){let r=i[n.class];return new R4({content:n,class:r})}}sQ._oneTimeWarning=yt;var zv=sQ;function Odt(e,t){let n=e.metadataExtension;if(!l(n))return;let i=n.groups,r=sr(t,"3DTILES_metadata")?t.extensions["3DTILES_metadata"].group:t.group;if(typeof r=="number")return i[r];let o=n.groupIds.findIndex(function(s){return s===r});return o>=0?i[o]:void 0}var Vv=Odt;function bg(e){e=e??H.EMPTY_OBJECT;let t=e.tile,n=e.class;this._class=n,this._properties=t.properties,this._extensions=t.extensions,this._extras=t.extras}Object.defineProperties(bg.prototype,{class:{get:function(){return this._class}},extras:{get:function(){return this._extras}},extensions:{get:function(){return this._extensions}}});bg.prototype.hasProperty=function(e){return Xn.hasProperty(e,this._properties,this._class)};bg.prototype.hasPropertyBySemantic=function(e){return Xn.hasPropertyBySemantic(e,this._properties,this._class)};bg.prototype.getPropertyIds=function(e){return Xn.getPropertyIds(this._properties,this._class,e)};bg.prototype.getProperty=function(e){return Xn.getProperty(e,this._properties,this._class)};bg.prototype.setProperty=function(e,t){return Xn.setProperty(e,t,this._properties,this._class)};bg.prototype.getPropertyBySemantic=function(e){return Xn.getPropertyBySemantic(e,this._properties,this._class)};bg.prototype.setPropertyBySemantic=function(e,t){return Xn.setPropertyBySemantic(e,t,this._properties,this._class)};var O4=bg;function aQ(e,t){let n=sr(t,"3DTILES_metadata")?t.extensions["3DTILES_metadata"]:t.metadata;if(!l(n))return;if(!l(e.schema)){aQ._oneTimeWarning("findTileMetadata-missing-root-schema","Could not find a metadata schema for tile metadata. For tilesets that contain external tilesets, make sure the schema is added to the root tileset.json.");return}let i=e.schema.classes??H.EMPTY_OBJECT;if(l(n.class)){let r=i[n.class];return new O4({tile:n,class:r})}}aQ._oneTimeWarning=yt;var M4=aQ;function Mdt(e){let t=new Uint8Array(e),n=cp(t);if(n==="glTF"&&(n="glb"),ka.isBinaryFormat(n))return{contentType:n,binaryPayload:t};let i=Ndt(t);if(l(i.root))return{contentType:ka.EXTERNAL_TILESET,jsonPayload:i};if(l(i.asset))return{contentType:ka.GLTF,jsonPayload:i};if(l(i.tileAvailability))return{contentType:ka.IMPLICIT_SUBTREE_JSON,jsonPayload:i};if(l(i.type))return{contentType:ka.GEOJSON,jsonPayload:i};if(l(i.voxelTable))return{contentType:ka.VOXEL_JSON,jsonPayload:i};throw new oe("Invalid tile content.")}function Ndt(e){let t;try{t=No(e)}catch{throw new oe("Invalid tile content.")}return t}var Hy=Mdt;var cQ=class{constructor(t,n,i,r){this._tileset=t,this._tile=n,this._tilesetResource=i,this._contents=[],this._contentsCreated=!1;let o=l(r.contents)?r.contents:r.content;this._innerContentHeaders=o,this._requestsInFlight=0,this._cancelCount=0,this._externalTilesetCount=0;let s=this._innerContentHeaders.length;this._arrayFetchPromises=new Array(s),this._requests=new Array(s),this._ready=!1,this._innerContentResources=new Array(s),this._serverKeys=new Array(s);for(let a=0;a<s;a++){let c=i.getDerivedResource({url:o[a].uri}),u=El.getServerKey(c.getUrlComponent());this._innerContentResources[a]=c,this._serverKeys[a]=u}}get featurePropertiesDirty(){let t=this._contents,n=t.length;for(let i=0;i<n;++i)if(t[i].featurePropertiesDirty)return!0;return!1}set featurePropertiesDirty(t){let n=this._contents,i=n.length;for(let r=0;r<i;++r)n[r].featurePropertiesDirty=t}get featuresLength(){return 0}get pointsLength(){return 0}get trianglesLength(){return 0}get geometryByteLength(){return 0}get texturesByteLength(){return 0}get batchTableByteLength(){return 0}get innerContents(){return this._contents}get ready(){return this._contentsCreated?this._ready:!1}get tileset(){return this._tileset}get tile(){return this._tile}get url(){}get metadata(){}set metadata(t){}get batchTable(){}get group(){}set group(t){}get innerContentUrls(){return this._innerContentHeaders.map(function(t){return t.uri})}requestInnerContents(){if(!Ldt(this._serverKeys)){this.tileset.statistics.numberOfAttemptedRequests+=this._serverKeys.length;return}let t=this._innerContentHeaders;lQ(this,t.length);let n=this._cancelCount;for(let i=0;i<t.length;i++)this._arrayFetchPromises[i]=Fdt(this,i,n,this._tile._contentState);return Bdt(this)}cancelRequests(){for(let t=0;t<this._requests.length;t++){let n=this._requests[t];l(n)&&n.cancel()}}hasProperty(t,n){return!1}getFeature(t){}applyDebugSettings(t,n){let i=this._contents,r=i.length;for(let o=0;o<r;++o)i[o].applyDebugSettings(t,n)}applyStyle(t){let n=this._contents,i=n.length;for(let r=0;r<i;++r)n[r].applyStyle(t)}update(t,n){let i=this._contents,r=i.length,o=!0;for(let s=0;s<r;++s)i[s].update(t,n),o=o&&i[s].ready;!this._ready&&o&&(this._ready=!0)}pick(t,n,i){if(!this._ready)return;let r,o=Number.POSITIVE_INFINITY,s=this._contents,a=s.length;for(let c=0;c<a;++c){let u=s[c].pick(t,n,i);if(!l(u))continue;let f=h.distance(t.origin,u);f<o&&(r=u,o=f)}if(l(r))return i}isDestroyed(){return!1}destroy(){let t=this._contents,n=t.length;for(let i=0;i<n;++i)t[i].destroy();return le(this)}};function lQ(e,t){e._requestsInFlight+=t,e.tileset.statistics.numberOfPendingRequests+=t}function wbe(e,t){e._cancelCount++,e._tile._contentState=t;let n=e.tileset.statistics;n.numberOfPendingRequests-=e._requestsInFlight,n.numberOfAttemptedRequests+=e._requestsInFlight,e._requestsInFlight=0;let i=e._innerContentHeaders.length;e._arrayFetchPromises=new Array(i)}function Ldt(e){let t={};for(let n=0;n<e.length;n++){let i=e[n];l(t[i])?t[i]++:t[i]=1}for(let n in t)if(t.hasOwnProperty(n)&&!El.serverHasOpenSlots(n,t[n]))return!1;return El.heapHasOpenSlots(e.length)}function Fdt(e,t,n,i){let r=e._innerContentResources[t].clone(),o=e.tile,s=function(){return o._priority},a=e._serverKeys[t],c=new Oo({throttle:!0,throttleByServer:!0,type:oa.TILES3D,priorityFunction:s,serverKey:a});r.request=c,e._requests[t]=c;let u=r.fetchArrayBuffer();if(l(u))return u.then(function(f){if(!(n<e._cancelCount)){if(r.request.cancelled||r.request.state===wi.CANCELLED){wbe(e,i);return}return lQ(e,-1),f}}).catch(function(f){if(!(n<e._cancelCount)){if(r.request.cancelled||r.request.state===wi.CANCELLED){wbe(e,i);return}lQ(e,-1),Ibe(e,t,f)}})}async function Bdt(e){let t=e._cancelCount,n=await Promise.all(e._arrayFetchPromises);if(t<e._cancelCount)return;let i=n.map((o,s)=>kdt(e,o,s)),r=await Promise.all(i);if(e._contentsCreated=!0,e._contents=r.filter(l),e._externalTilesetCount===e._contents.length){let o=e._tile;o.hasRenderableContent=!1}return r}async function kdt(e,t,n){if(l(t))try{let i=Hy(t),r=e._tileset,o=e._innerContentResources[n],s=e._tile;i.contentType===ka.EXTERNAL_TILESET&&(e._externalTilesetCount++,s.hasTilesetContent=!0),e._disableSkipLevelOfDetail=e._disableSkipLevelOfDetail||i.contentType===ka.GEOMETRY||i.contentType===ka.VECTOR;let a,c=Uv[i.contentType];l(i.binaryPayload)?a=await Promise.resolve(c(r,s,o,i.binaryPayload.buffer,0)):a=await Promise.resolve(c(r,s,o,i.jsonPayload));let u=e._innerContentHeaders[n];if(s.hasImplicitContentMetadata){let d=s.implicitSubtree,p=s.implicitCoordinates;a.metadata=d.getContentMetadataView(p,n)}else s.hasImplicitContent||(a.metadata=zv(r,u));let f=Vv(r,u);return l(f)&&(a.group=new vC({metadata:f})),a}catch(i){Ibe(e,n,i)}}function Ibe(e,t,n){let i=e._tileset,r=e._innerContentResources[t].url,o=l(n.message)?n.message:n.toString();i.tileFailed.numberOfListeners>0?i.tileFailed.raiseEvent({url:r,message:o}):(console.log(`A content failed to load: ${r}`),console.log(`Error: ${o}`))}var N4=cQ;var Pbe=Math.cos,Dbe=Math.sin,Udt=Math.sqrt,uQ={};uQ.computePosition=function(e,t,n,i,r,o,s){let a=t.radiiSquared,c=e.nwCorner,u=e.boundingRectangle,f=c.latitude-e.granYCos*i+r*e.granXSin,d=Pbe(f),p=Dbe(f),g=a.z*p,m=c.longitude+i*e.granYSin+r*e.granXCos,y=d*Pbe(m),A=d*Dbe(m),b=a.x*y,x=a.y*A,T=Udt(b*y+x*A+g*p);if(o.x=b/T,o.y=x/T,o.z=g/T,n){let E=e.stNwCorner;l(E)?(f=E.latitude-e.stGranYCos*i+r*e.stGranXSin,m=E.longitude+i*e.stGranYSin+r*e.stGranXCos,s.x=(m-e.stWest)*e.lonScalar,s.y=(f-e.stSouth)*e.latScalar):(s.x=(m-u.west)*e.lonScalar,s.y=(f-u.south)*e.latScalar)}};var zdt=new $i,Rd=new h,Vdt=new he,L4=new h,w1=new ji;function Rbe(e,t,n,i,r,o,s){let a=Math.cos(t),c=i*a,u=n*a,f=Math.sin(t),d=i*f,p=n*f;w1._ellipsoid=ee.default,Rd=w1.project(e,Rd),Rd=h.subtract(Rd,L4,Rd);let g=$i.fromRotation(t,zdt);Rd=$i.multiplyByVector(g,Rd,Rd),Rd=h.add(Rd,L4,Rd),e=w1.unproject(Rd,e),o-=1,s-=1;let m=e.latitude,y=m+o*p,A=m-c*s,b=m-c*s+o*p,x=Math.max(m,y,A,b),T=Math.min(m,y,A,b),E=e.longitude,v=E+o*u,S=E+s*d,I=E+s*d+o*u,R=Math.max(E,v,S,I),O=Math.min(E,v,S,I);return{north:x,south:T,east:R,west:O,granYCos:c,granYSin:d,granXCos:u,granXSin:p,nwCorner:e}}uQ.computeOptions=function(e,t,n,i,r,o,s){let a=e.east,c=e.west,u=e.north,f=e.south,d=!1,p=!1;u===P.PI_OVER_TWO&&(d=!0),f===-P.PI_OVER_TWO&&(p=!0);let g,m=u-f;c>a?g=P.TWO_PI-c+a:g=a-c;let y=Math.ceil(g/t)+1,A=Math.ceil(m/t)+1,b=g/(y-1),x=m/(A-1),T=ie.northwest(e,o),E=ie.center(e,Vdt);(n!==0||i!==0)&&(E.longitude<T.longitude&&(E.longitude+=P.TWO_PI),w1._ellipsoid=ee.default,L4=w1.project(E,L4));let v=x,S=b,I=0,R=0,O=ie.clone(e,r),L={granYCos:v,granYSin:I,granXCos:S,granXSin:R,nwCorner:T,boundingRectangle:O,width:y,height:A,northCap:d,southCap:p};if(n!==0){let _=Rbe(T,n,b,x,E,y,A);u=_.north,f=_.south,a=_.east,c=_.west,L.granYCos=_.granYCos,L.granYSin=_.granYSin,L.granXCos=_.granXCos,L.granXSin=_.granXSin,O.north=u,O.south=f,O.east=a,O.west=c}if(i!==0){n=n-i;let _=ie.northwest(O,s),C=Rbe(_,n,b,x,E,y,A);L.stGranYCos=C.granYCos,L.stGranXCos=C.granXCos,L.stGranYSin=C.granYSin,L.stGranXSin=C.granXSin,L.stNwCorner=_,L.stWest=C.west,L.stSouth=C.south}return L};var Ua=uQ;var jdt=new ue,Hdt=new ue,Gdt=new h,Wdt=new ie;function Obe(e,t){let n=e._ellipsoid,i=t.height,r=t.width,o=t.northCap,s=t.southCap,a=i,c=2,u=0,f=4;o&&(c-=1,a-=1,u+=1,f-=2),s&&(c-=1,a-=1,u+=1,f-=2),u+=c*r+2*a-f;let d=new Float64Array(u*3),p=0,g=0,m,y=Gdt;if(o)Ua.computePosition(t,n,!1,g,0,y),d[p++]=y.x,d[p++]=y.y,d[p++]=y.z;else for(m=0;m<r;m++)Ua.computePosition(t,n,!1,g,m,y),d[p++]=y.x,d[p++]=y.y,d[p++]=y.z;for(m=r-1,g=1;g<i;g++)Ua.computePosition(t,n,!1,g,m,y),d[p++]=y.x,d[p++]=y.y,d[p++]=y.z;if(g=i-1,!s)for(m=r-2;m>=0;m--)Ua.computePosition(t,n,!1,g,m,y),d[p++]=y.x,d[p++]=y.y,d[p++]=y.z;for(m=0,g=i-2;g>0;g--)Ua.computePosition(t,n,!1,g,m,y),d[p++]=y.x,d[p++]=y.y,d[p++]=y.z;let A=d.length/3*2,b=je.createTypedArray(d.length/3,A),x=0;for(let E=0;E<d.length/3-1;E++)b[x++]=E,b[x++]=E+1;b[x++]=d.length/3-1,b[x]=0;let T=new wt({attributes:new En,primitiveType:Oe.LINES});return T.attributes.position=new Ne({componentDatatype:Y.DOUBLE,componentsPerAttribute:3,values:d}),T.indices=b,T}function qdt(e,t){let n=e._surfaceHeight,i=e._extrudedHeight,r=e._ellipsoid,o=Obe(e,t),s=t.height,a=t.width,c=mi.scaleToGeodeticHeight(o.attributes.position.values,n,r,!1),u=c.length,f=new Float64Array(u*2);f.set(c);let d=mi.scaleToGeodeticHeight(o.attributes.position.values,i,r);f.set(d,u),o.attributes.position.values=f;let p=t.northCap,g=t.southCap,m=4;p&&(m-=1),g&&(m-=1);let y=(f.length/3+m)*2,A=je.createTypedArray(f.length/3,y);u=f.length/6;let b=0;for(let T=0;T<u-1;T++)A[b++]=T,A[b++]=T+1,A[b++]=T+u,A[b++]=T+u+1;A[b++]=u-1,A[b++]=0,A[b++]=u+u-1,A[b++]=u,A[b++]=0,A[b++]=u;let x;if(p)x=s-1;else{let T=a-1;A[b++]=T,A[b++]=T+u,x=a+s-2}if(A[b++]=x,A[b++]=x+u,!g){let T=a+x-1;A[b++]=T,A[b]=T+u}return o.indices=A,o}function Hv(e){e=e??H.EMPTY_OBJECT;let t=e.rectangle,n=e.granularity??P.RADIANS_PER_DEGREE,i=e.ellipsoid??ee.default,r=e.rotation??0,o=e.height??0,s=e.extrudedHeight??o;this._rectangle=ie.clone(t),this._granularity=n,this._ellipsoid=i,this._surfaceHeight=Math.max(o,s),this._rotation=r,this._extrudedHeight=Math.min(o,s),this._offsetAttribute=e.offsetAttribute,this._workerName="createRectangleOutlineGeometry"}Hv.packedLength=ie.packedLength+ee.packedLength+5;Hv.pack=function(e,t,n){return n=n??0,ie.pack(e._rectangle,t,n),n+=ie.packedLength,ee.pack(e._ellipsoid,t,n),n+=ee.packedLength,t[n++]=e._granularity,t[n++]=e._surfaceHeight,t[n++]=e._rotation,t[n++]=e._extrudedHeight,t[n]=e._offsetAttribute??-1,t};var Mbe=new ie,Nbe=ee.clone(ee.UNIT_SPHERE),jv={rectangle:Mbe,ellipsoid:Nbe,granularity:void 0,height:void 0,rotation:void 0,extrudedHeight:void 0,offsetAttribute:void 0};Hv.unpack=function(e,t,n){t=t??0;let i=ie.unpack(e,t,Mbe);t+=ie.packedLength;let r=ee.unpack(e,t,Nbe);t+=ee.packedLength;let o=e[t++],s=e[t++],a=e[t++],c=e[t++],u=e[t];return l(n)?(n._rectangle=ie.clone(i,n._rectangle),n._ellipsoid=ee.clone(r,n._ellipsoid),n._surfaceHeight=s,n._rotation=a,n._extrudedHeight=c,n._offsetAttribute=u===-1?void 0:u,n):(jv.granularity=o,jv.height=s,jv.rotation=a,jv.extrudedHeight=c,jv.offsetAttribute=u===-1?void 0:u,new Hv(jv))};var Ydt=new he;Hv.createGeometry=function(e){let t=e._rectangle,n=e._ellipsoid,i=Ua.computeOptions(t,e._granularity,e._rotation,0,Wdt,Ydt),r,o;if(P.equalsEpsilon(t.north,t.south,P.EPSILON10)||P.equalsEpsilon(t.east,t.west,P.EPSILON10))return;let s=e._surfaceHeight,a=e._extrudedHeight,c=!P.equalsEpsilon(s,a,0,P.EPSILON2),u;if(c){if(r=qdt(e,i),l(e._offsetAttribute)){let p=r.attributes.position.values.length/3,g=new Uint8Array(p);e._offsetAttribute===pn.TOP?g=g.fill(1,0,p/2):(u=e._offsetAttribute===pn.NONE?0:1,g=g.fill(u)),r.attributes.applyOffset=new Ne({componentDatatype:Y.UNSIGNED_BYTE,componentsPerAttribute:1,values:g})}let f=ue.fromRectangle3D(t,n,s,Hdt),d=ue.fromRectangle3D(t,n,a,jdt);o=ue.union(f,d)}else{if(r=Obe(e,i),r.attributes.position.values=mi.scaleToGeodeticHeight(r.attributes.position.values,s,n,!1),l(e._offsetAttribute)){let f=r.attributes.position.values.length;u=e._offsetAttribute===pn.NONE?0:1;let d=new Uint8Array(f/3).fill(u);r.attributes.applyOffset=new Ne({componentDatatype:Y.UNSIGNED_BYTE,componentsPerAttribute:1,values:d})}o=ue.fromRectangle3D(t,n,s)}return new wt({attributes:r.attributes,indices:r.indices,primitiveType:Oe.LINES,boundingSphere:o,offsetAttribute:e._offsetAttribute})};var Gv=Hv;function qv(e){this.rectangle=ie.clone(e.rectangle),this.minimumHeight=e.minimumHeight??0,this.maximumHeight=e.maximumHeight??0,this.southwestCornerCartesian=new h,this.northeastCornerCartesian=new h,this.westNormal=new h,this.southNormal=new h,this.eastNormal=new h,this.northNormal=new h;let t=e.ellipsoid??ee.WGS84;Zdt(this,e.rectangle,t),this._orientedBoundingBox=void 0,this._boundingSphere=void 0,(e.computeBoundingVolumes??!0)&&this.computeBoundingVolumes(t)}Object.defineProperties(qv.prototype,{boundingVolume:{get:function(){return this._orientedBoundingBox}},boundingSphere:{get:function(){return this._boundingSphere}}});qv.prototype.computeBoundingVolumes=function(e){this._orientedBoundingBox=en.fromRectangle(this.rectangle,this.minimumHeight,this.maximumHeight,e),this._boundingSphere=ue.fromOrientedBoundingBox(this._orientedBoundingBox)};var Lbe=new h,F4=new h,Fbe=new h,Xdt=new h,Kdt=new h,$dt=new h,Jdt=new h,Od=new he,Bbe=new sn(h.UNIT_X,0),Wv=new gn;function Zdt(e,t,n){n.cartographicToCartesian(ie.southwest(t),e.southwestCornerCartesian),n.cartographicToCartesian(ie.northeast(t),e.northeastCornerCartesian),Od.longitude=t.west,Od.latitude=(t.south+t.north)*.5,Od.height=0;let i=n.cartographicToCartesian(Od,$dt),r=h.cross(i,h.UNIT_Z,Xdt);h.normalize(r,e.westNormal),Od.longitude=t.east;let o=n.cartographicToCartesian(Od,Jdt),s=h.cross(h.UNIT_Z,o,Lbe);h.normalize(s,e.eastNormal);let a=h.subtract(i,o,Lbe);h.magnitude(a)===0&&(a=h.clone(r,a));let c=h.normalize(a,Kdt),u=t.south,f;if(u>0){Od.longitude=(t.west+t.east)*.5,Od.latitude=u;let y=n.cartographicToCartesian(Od,Wv.origin);h.clone(c,Wv.direction);let A=sn.fromPointNormal(e.southwestCornerCartesian,e.westNormal,Bbe);xi.rayPlane(Wv,A,e.southwestCornerCartesian),f=n.geodeticSurfaceNormal(y,F4)}else f=n.geodeticSurfaceNormalCartographic(ie.southeast(t),F4);let d=h.cross(f,a,Fbe);h.normalize(d,e.southNormal);let p=t.north,g;if(p<0){Od.longitude=(t.west+t.east)*.5,Od.latitude=p;let y=n.cartographicToCartesian(Od,Wv.origin);h.negate(c,Wv.direction);let A=sn.fromPointNormal(e.northeastCornerCartesian,e.eastNormal,Bbe);xi.rayPlane(Wv,A,e.northeastCornerCartesian),g=n.geodeticSurfaceNormal(y,F4)}else g=n.geodeticSurfaceNormalCartographic(ie.northwest(t),F4);let m=h.cross(a,g,Fbe);h.normalize(m,e.northNormal)}var Qdt=new h,eht=new h,tht=new h(0,-1,0),nht=new h(0,0,-1),kbe=new h;function iht(e,t){let n=t.camera,i=n.positionWC,r=n.positionCartographic,o=0;if(!ie.contains(e.rectangle,r)){let u=e.southwestCornerCartesian,f=e.northeastCornerCartesian,d=e.westNormal,p=e.southNormal,g=e.eastNormal,m=e.northNormal;t.mode!==re.SCENE3D&&(u=t.mapProjection.project(ie.southwest(e.rectangle),Qdt),u.z=u.y,u.y=u.x,u.x=0,f=t.mapProjection.project(ie.northeast(e.rectangle),eht),f.z=f.y,f.y=f.x,f.x=0,d=tht,g=h.UNIT_Y,p=nht,m=h.UNIT_Z);let y=h.subtract(i,u,kbe),A=h.dot(y,d),b=h.dot(y,p),x=h.subtract(i,f,kbe),T=h.dot(x,g),E=h.dot(x,m);A>0?o+=A*A:T>0&&(o+=T*T),b>0?o+=b*b:E>0&&(o+=E*E)}let s,a,c;if(t.mode===re.SCENE3D?(s=r.height,a=e.minimumHeight,c=e.maximumHeight):(s=i.x,a=0,c=0),s>c){let u=s-c;o+=u*u}else if(s<a){let u=a-s;o+=u*u}return Math.sqrt(o)}qv.prototype.distanceToCamera=function(e){let t=iht(this,e);if(e.mode===re.SCENE3D&&l(this._orientedBoundingBox)){let n=Math.sqrt(this._orientedBoundingBox.distanceSquaredTo(e.camera.positionWC));return Math.max(t,n)}return t};qv.prototype.intersectPlane=function(e){return this._orientedBoundingBox.intersectPlane(e)};qv.prototype.createDebugVolume=function(e){let t=M.clone(M.IDENTITY),n=new Gv({rectangle:this.rectangle,height:this.minimumHeight,extrudedHeight:this.maximumHeight}),i=new Bt({geometry:n,id:"outline",modelMatrix:t,attributes:{color:Jt.fromColor(e)}});return new Mn({geometryInstances:i,appearance:new An({translucent:!1,flat:!0}),asynchronous:!1})};var Md=qv;var I1={},rht=new h,Ube=new h,zbe=new h,Vbe=new h,jbe=new en;I1.validOutline=function(e){let n=en.fromPoints(e,jbe).halfAxes,i=$.getColumn(n,0,Ube),r=$.getColumn(n,1,zbe),o=$.getColumn(n,2,Vbe),s=h.magnitude(i),a=h.magnitude(r),c=h.magnitude(o);return!(s===0&&(a===0||c===0)||a===0&&c===0)};I1.computeProjectTo2DArguments=function(e,t,n,i){let r=en.fromPoints(e,jbe),o=r.halfAxes,s=$.getColumn(o,0,Ube),a=$.getColumn(o,1,zbe),c=$.getColumn(o,2,Vbe),u=h.magnitude(s),f=h.magnitude(a),d=h.magnitude(c),p=Math.min(u,f,d);if(u===0&&(f===0||d===0)||f===0&&d===0)return!1;let g,m;return(p===f||p===d)&&(g=s),p===u?g=a:p===d&&(m=a),(p===u||p===f)&&(m=c),h.normalize(g,n),h.normalize(m,i),h.clone(r.center,t),!0};function Hbe(e,t,n,i,r){let o=h.subtract(e,t,rht),s=h.dot(n,o),a=h.dot(i,o);return U.fromElements(s,a,r)}I1.createProjectPointsTo2DFunction=function(e,t,n){return function(i){let r=new Array(i.length);for(let o=0;o<i.length;o++)r[o]=Hbe(i[o],e,t,n);return r}};I1.createProjectPointTo2DFunction=function(e,t,n){return function(i,r){return Hbe(i,e,t,n,r)}};var Gy=I1;function oht(e){let t=e.length,n=new Float64Array(t*3),i=je.createTypedArray(t,t*2),r=0,o=0;for(let a=0;a<t;a++){let c=e[a];n[r++]=c.x,n[r++]=c.y,n[r++]=c.z,i[o++]=a,i[o++]=(a+1)%t}let s=new En({position:new Ne({componentDatatype:Y.DOUBLE,componentsPerAttribute:3,values:n})});return new wt({attributes:s,indices:i,primitiveType:Oe.LINES})}function Rx(e){e=e??H.EMPTY_OBJECT;let t=e.polygonHierarchy;this._polygonHierarchy=t,this._workerName="createCoplanarPolygonOutlineGeometry",this.packedLength=ni.computeHierarchyPackedLength(t,h)+1}Rx.fromPositions=function(e){e=e??H.EMPTY_OBJECT;let t={polygonHierarchy:{positions:e.positions}};return new Rx(t)};Rx.pack=function(e,t,n){return n=n??0,n=ni.packPolygonHierarchy(e._polygonHierarchy,t,n,h),t[n]=e.packedLength,t};var sht={polygonHierarchy:{}};Rx.unpack=function(e,t,n){t=t??0;let i=ni.unpackPolygonHierarchy(e,t,h);t=i.startingIndex,delete i.startingIndex;let r=e[t];return l(n)||(n=new Rx(sht)),n._polygonHierarchy=i,n.packedLength=r,n};Rx.createGeometry=function(e){let t=e._polygonHierarchy,n=t.positions;if(n=Lr(n,h.equalsEpsilon,!0),n.length<3||!Gy.validOutline(n))return;let r=ni.polygonOutlinesFromHierarchy(t,!1);if(r.length===0)return;let o=[];for(let c=0;c<r.length;c++){let u=new Bt({geometry:oht(r[c])});o.push(u)}let s=Wn.combineInstances(o)[0],a=ue.fromPoints(t.positions);return new wt({attributes:s.attributes,indices:s.indices,primitiveType:s.primitiveType,boundingSphere:a})};var Gh=Rx;var B4=new he;function P1(e){let t=cy.fromToken(e.token),n=e.minimumHeight??0,i=e.maximumHeight??0,r=e.ellipsoid??ee.WGS84;this.s2Cell=t,this.minimumHeight=n,this.maximumHeight=i,this.ellipsoid=r;let o=pht(t,n,i,r);this._boundingPlanes=o;let s=Aht(o);this._vertices=s,this._edgeNormals=new Array(6),this._edgeNormals[0]=yQ(o[0],s.slice(0,4));let a;for(a=0;a<4;a++)this._edgeNormals[0][a]=h.negate(this._edgeNormals[0][a],this._edgeNormals[0][a]);for(this._edgeNormals[1]=yQ(o[1],s.slice(4,8)),a=0;a<4;a++)this._edgeNormals[2+a]=yQ(o[2+a],[s[a%4],s[(a+1)%4],s[4+(a+1)%4],s[4+a]]);for(this._planeVertices=[this._vertices.slice(0,4),this._vertices.slice(4,8)],a=0;a<4;a++)this._planeVertices.push([this._vertices[a%4],this._vertices[(a+1)%4],this._vertices[4+(a+1)%4],this._vertices[4+a]]);let c=t.getCenter();B4=r.cartesianToCartographic(c,B4),B4.height=(i+n)/2,this.center=r.cartographicToCartesian(B4,c),this._boundingSphere=ue.fromPoints(s)}var aht=new h,cht=new he,lht=new h,uht=new he,fht=new h,dht=new h,hht=new h,mht=new h;function pht(e,t,n,i){let r=new Array(6),o=e.getCenter(),s=i.geodeticSurfaceNormal(o,aht),a=i.cartesianToCartographic(o,cht);a.height=n;let c=i.cartographicToCartesian(a,lht),u=sn.fromPointNormal(c,s);r[0]=u;let f=0,d,p=[],g,m;for(d=0;d<4;d++){g=e.getVertex(d),p[d]=g,m=i.cartesianToCartographic(g,uht),m.height=t;let A=sn.getPointDistance(u,i.cartographicToCartesian(m,fht));A<f&&(f=A)}let y=sn.clone(u);for(y.normal=h.negate(y.normal,y.normal),y.distance=y.distance*-1+f,r[1]=y,d=0;d<4;d++){g=p[d];let A=p[(d+1)%4],b=i.geodeticSurfaceNormal(g,dht),x=h.subtract(A,g,mht),T=h.cross(x,b,hht);T=h.normalize(T,T),r[2+d]=sn.fromPointNormal(g,T)}return r}var Ox=new h,Mx=new h,Nx=new h,fQ=new h,dQ=new h,hQ=new h,ght=new h,_ht=new h,yht=new h,mQ=new h,pQ=new h,gQ=new h,Wy=new h,Ip=new $;function Gbe(e,t,n){Ox=e.normal,Mx=t.normal,Nx=n.normal,fQ=h.multiplyByScalar(e.normal,-e.distance,fQ),dQ=h.multiplyByScalar(t.normal,-t.distance,dQ),hQ=h.multiplyByScalar(n.normal,-n.distance,hQ),mQ=h.multiplyByScalar(h.cross(Mx,Nx,ght),h.dot(fQ,Ox),mQ),pQ=h.multiplyByScalar(h.cross(Nx,Ox,_ht),h.dot(dQ,Mx),pQ),gQ=h.multiplyByScalar(h.cross(Ox,Mx,yht),h.dot(hQ,Nx),gQ),Ip[0]=Ox.x,Ip[1]=Mx.x,Ip[2]=Nx.x,Ip[3]=Ox.y,Ip[4]=Mx.y,Ip[5]=Nx.y,Ip[6]=Ox.z,Ip[7]=Mx.z,Ip[8]=Nx.z;let i=$.determinant(Ip);return Wy=h.add(mQ,pQ,Wy),Wy=h.add(Wy,gQ,Wy),new h(Wy.x/i,Wy.y/i,Wy.z/i)}function Aht(e){let t=new Array(8);for(let n=0;n<4;n++)t[n]=Gbe(e[0],e[2+(n+3)%4],e[2+n%4]),t[n+4]=Gbe(e[1],e[2+(n+3)%4],e[2+n%4]);return t}var _Q=new h,Yv=new h;function yQ(e,t){let n=[];for(let i=0;i<4;i++)_Q=h.subtract(t[(i+1)%4],t[i],_Q),Yv=h.cross(e.normal,_Q,Yv),Yv=h.normalize(Yv,Yv),n[i]=h.clone(Yv);return n}Object.defineProperties(P1.prototype,{boundingVolume:{get:function(){return this}},boundingSphere:{get:function(){return this._boundingSphere}}});var AQ=new h;P1.prototype.distanceToCamera=function(e){let t=e.camera.positionWC,n=[],i=[],r;sn.getPointDistance(this._boundingPlanes[0],t)>0?(n.push(0),i.push(this._planeVertices[0]),r=this._edgeNormals[0]):sn.getPointDistance(this._boundingPlanes[1],t)>0&&(n.push(1),i.push(this._planeVertices[1]),r=this._edgeNormals[1]);let o,s;for(o=0;o<4;o++)s=2+o,sn.getPointDistance(this._boundingPlanes[s],t)>0&&(n.push(s),i.push(this._planeVertices[s]),r=this._edgeNormals[s]);if(n.length===0)return 0;let a,c;if(n.length===1)return c=this._boundingPlanes[n[0]],a=bQ(sn.projectPointOntoPlane(c,t,AQ),i[0],c,r),h.distance(a,t);if(n.length===2){if(n[0]===0){let p=[this._vertices[4*n[0]+(n[1]-2)],this._vertices[4*n[0]+(n[1]-2+1)%4]];return a=Wbe(t,p[0],p[1]),h.distance(a,t)}let f=Number.MAX_VALUE,d;for(o=0;o<2;o++)c=this._boundingPlanes[n[o]],a=bQ(sn.projectPointOntoPlane(c,t,AQ),i[o],c,this._edgeNormals[n[o]]),d=h.distanceSquared(a,t),d<f&&(f=d);return Math.sqrt(f)}else if(n.length>3)return a=bQ(sn.projectPointOntoPlane(this._boundingPlanes[1],t,AQ),this._planeVertices[1],this._boundingPlanes[1],this._edgeNormals[1]),h.distance(a,t);let u=n[1]===2&&n[2]===5?0:1;return n[0]===0?h.distance(t,this._vertices[(n[1]-2+u)%4]):h.distance(t,this._vertices[4+(n[1]-2+u)%4])};var bht=new h,xht=new h;function Wbe(e,t,n){let i=h.subtract(n,t,bht),r=h.subtract(e,t,xht),o=h.dot(i,r);if(o<=0)return t;let s=h.dot(i,i);return o>=s?n:(o=o/s,new h((1-o)*t.x+o*n.x,(1-o)*t.y+o*n.y,(1-o)*t.z+o*n.z))}var Tht=new sn(h.UNIT_X,0);function bQ(e,t,n,i){let r=Number.MAX_VALUE,o,s,a;for(let c=0;c<t.length;c++){let u=sn.fromPointNormal(t[c],i[c],Tht);sn.getPointDistance(u,e)<0||(a=Wbe(e,t[c],t[(c+1)%4]),o=h.distance(e,a),o<r&&(r=o,s=a))}return l(s)?s:e}P1.prototype.intersectPlane=function(e){let t=0,n=0;for(let i=0;i<this._vertices.length;i++)h.dot(e.normal,this._vertices[i])+e.distance<0?n++:t++;return t===this._vertices.length?$t.INSIDE:n===this._vertices.length?$t.OUTSIDE:$t.INTERSECTING};P1.prototype.createDebugVolume=function(e){let t=M.clone(M.IDENTITY),n=new Gh({polygonHierarchy:{positions:this._planeVertices[0]}}),i=Gh.createGeometry(n),r=new Bt({geometry:i,id:"outline",modelMatrix:t,attributes:{color:Jt.fromColor(e)}}),o=new Gh({polygonHierarchy:{positions:this._planeVertices[1]}}),s=Gh.createGeometry(o),a=new Bt({geometry:s,id:"outline",modelMatrix:t,attributes:{color:Jt.fromColor(e)}}),c=[];for(let u=0;u<4;u++){let f=new Gh({polygonHierarchy:{positions:this._planeVertices[2+u]}}),d=Gh.createGeometry(f);c[u]=new Bt({geometry:d,id:"outline",modelMatrix:t,attributes:{color:Jt.fromColor(e)}})}return new Mn({geometryInstances:[c[0],c[1],c[2],c[3],a,r],appearance:new An({translucent:!1,flat:!0}),asynchronous:!1})};var k4=P1;var Eht=new h(1,1,1),U4=Math.cos,z4=Math.sin;function Xv(e){e=e??H.EMPTY_OBJECT;let t=e.radii??Eht,n=e.innerRadii??t,i=e.minimumClock??0,r=e.maximumClock??P.TWO_PI,o=e.minimumCone??0,s=e.maximumCone??P.PI,a=Math.round(e.stackPartitions??10),c=Math.round(e.slicePartitions??8),u=Math.round(e.subdivisions??128);this._radii=h.clone(t),this._innerRadii=h.clone(n),this._minimumClock=i,this._maximumClock=r,this._minimumCone=o,this._maximumCone=s,this._stackPartitions=a,this._slicePartitions=c,this._subdivisions=u,this._offsetAttribute=e.offsetAttribute,this._workerName="createEllipsoidOutlineGeometry"}Xv.packedLength=2*h.packedLength+8;Xv.pack=function(e,t,n){return n=n??0,h.pack(e._radii,t,n),n+=h.packedLength,h.pack(e._innerRadii,t,n),n+=h.packedLength,t[n++]=e._minimumClock,t[n++]=e._maximumClock,t[n++]=e._minimumCone,t[n++]=e._maximumCone,t[n++]=e._stackPartitions,t[n++]=e._slicePartitions,t[n++]=e._subdivisions,t[n]=e._offsetAttribute??-1,t};var qbe=new h,Ybe=new h,xg={radii:qbe,innerRadii:Ybe,minimumClock:void 0,maximumClock:void 0,minimumCone:void 0,maximumCone:void 0,stackPartitions:void 0,slicePartitions:void 0,subdivisions:void 0,offsetAttribute:void 0};Xv.unpack=function(e,t,n){t=t??0;let i=h.unpack(e,t,qbe);t+=h.packedLength;let r=h.unpack(e,t,Ybe);t+=h.packedLength;let o=e[t++],s=e[t++],a=e[t++],c=e[t++],u=e[t++],f=e[t++],d=e[t++],p=e[t];return l(n)?(n._radii=h.clone(i,n._radii),n._innerRadii=h.clone(r,n._innerRadii),n._minimumClock=o,n._maximumClock=s,n._minimumCone=a,n._maximumCone=c,n._stackPartitions=u,n._slicePartitions=f,n._subdivisions=d,n._offsetAttribute=p===-1?void 0:p,n):(xg.minimumClock=o,xg.maximumClock=s,xg.minimumCone=a,xg.maximumCone=c,xg.stackPartitions=u,xg.slicePartitions=f,xg.subdivisions=d,xg.offsetAttribute=p===-1?void 0:p,new Xv(xg))};Xv.createGeometry=function(e){let t=e._radii;if(t.x<=0||t.y<=0||t.z<=0)return;let n=e._innerRadii;if(n.x<=0||n.y<=0||n.z<=0)return;let i=e._minimumClock,r=e._maximumClock,o=e._minimumCone,s=e._maximumCone,a=e._subdivisions,c=ee.fromCartesian3(t),u=e._slicePartitions+1,f=e._stackPartitions+1;u=Math.round(u*Math.abs(r-i)/P.TWO_PI),f=Math.round(f*Math.abs(s-o)/P.PI),u<2&&(u=2),f<2&&(f=2);let d=0,p=1,g=n.x!==t.x||n.y!==t.y||n.z!==t.z,m=!1,y=!1;g&&(p=2,o>0&&(m=!0,d+=u),s<Math.PI&&(y=!0,d+=u));let A=a*p*(f+u),b=new Float64Array(A*3),x=2*(A+d-(u+f)*p),T=je.createTypedArray(A,x),E,v,S,I,R=0,O=new Array(f),L=new Array(f);for(E=0;E<f;E++)I=o+E*(s-o)/(f-1),O[E]=z4(I),L[E]=U4(I);let _=new Array(a),C=new Array(a);for(E=0;E<a;E++)S=i+E*(r-i)/(a-1),_[E]=z4(S),C[E]=U4(S);for(E=0;E<f;E++)for(v=0;v<a;v++)b[R++]=t.x*O[E]*C[v],b[R++]=t.y*O[E]*_[v],b[R++]=t.z*L[E];if(g)for(E=0;E<f;E++)for(v=0;v<a;v++)b[R++]=n.x*O[E]*C[v],b[R++]=n.y*O[E]*_[v],b[R++]=n.z*L[E];for(O.length=a,L.length=a,E=0;E<a;E++)I=o+E*(s-o)/(a-1),O[E]=z4(I),L[E]=U4(I);for(_.length=u,C.length=u,E=0;E<u;E++)S=i+E*(r-i)/(u-1),_[E]=z4(S),C[E]=U4(S);for(E=0;E<a;E++)for(v=0;v<u;v++)b[R++]=t.x*O[E]*C[v],b[R++]=t.y*O[E]*_[v],b[R++]=t.z*L[E];if(g)for(E=0;E<a;E++)for(v=0;v<u;v++)b[R++]=n.x*O[E]*C[v],b[R++]=n.y*O[E]*_[v],b[R++]=n.z*L[E];for(R=0,E=0;E<f*p;E++){let N=E*a;for(v=0;v<a-1;v++)T[R++]=N+v,T[R++]=N+v+1}let w=f*a*p;for(E=0;E<u;E++)for(v=0;v<a-1;v++)T[R++]=w+E+v*u,T[R++]=w+E+(v+1)*u;if(g)for(w=f*a*p+u*a,E=0;E<u;E++)for(v=0;v<a-1;v++)T[R++]=w+E+v*u,T[R++]=w+E+(v+1)*u;if(g){let N=f*a*p,F=N+a*u;if(m)for(E=0;E<u;E++)T[R++]=N+E,T[R++]=F+E;if(y)for(N+=a*u-u,F+=a*u-u,E=0;E<u;E++)T[R++]=N+E,T[R++]=F+E}let D=new En({position:new Ne({componentDatatype:Y.DOUBLE,componentsPerAttribute:3,values:b})});if(l(e._offsetAttribute)){let N=b.length,F=e._offsetAttribute===pn.NONE?0:1,V=new Uint8Array(N/3).fill(F);D.applyOffset=new Ne({componentDatatype:Y.UNSIGNED_BYTE,componentsPerAttribute:1,values:V})}return new wt({attributes:D,indices:T,primitiveType:Oe.LINES,boundingSphere:ue.fromEllipsoid(c),offsetAttribute:e._offsetAttribute})};var Nd=Xv;function Kv(e){let t=e.radius??1,i={radii:new h(t,t,t),stackPartitions:e.stackPartitions,slicePartitions:e.slicePartitions,subdivisions:e.subdivisions};this._ellipsoidGeometry=new Nd(i),this._workerName="createSphereOutlineGeometry"}Kv.packedLength=Nd.packedLength;Kv.pack=function(e,t,n){return Nd.pack(e._ellipsoidGeometry,t,n)};var Cht=new Nd,Lx={radius:void 0,radii:new h,stackPartitions:void 0,slicePartitions:void 0,subdivisions:void 0};Kv.unpack=function(e,t,n){let i=Nd.unpack(e,t,Cht);return Lx.stackPartitions=i._stackPartitions,Lx.slicePartitions=i._slicePartitions,Lx.subdivisions=i._subdivisions,l(n)?(h.clone(i._radii,Lx.radii),n._ellipsoidGeometry=new Nd(Lx),n):(Lx.radius=i._radii.x,new Kv(Lx))};Kv.createGeometry=function(e){return Nd.createGeometry(e._ellipsoidGeometry)};var qy=Kv;function $v(e,t){t===0&&(t=P.EPSILON7),this._boundingSphere=new ue(e,t)}Object.defineProperties($v.prototype,{center:{get:function(){return this._boundingSphere.center}},radius:{get:function(){return this._boundingSphere.radius}},boundingVolume:{get:function(){return this._boundingSphere}},boundingSphere:{get:function(){return this._boundingSphere}}});$v.prototype.distanceToCamera=function(e){let t=this._boundingSphere;return Math.max(0,h.distance(t.center,e.camera.positionWC)-t.radius)};$v.prototype.intersectPlane=function(e){return ue.intersectPlane(this._boundingSphere,e)};$v.prototype.update=function(e,t){h.clone(e,this._boundingSphere.center),this._boundingSphere.radius=t};$v.prototype.createDebugVolume=function(e){let t=new qy({radius:this.radius}),n=M.fromTranslation(this.center,M.clone(M.IDENTITY)),i=new Bt({geometry:t,id:"outline",modelMatrix:n,attributes:{color:Jt.fromColor(e)}});return new Mn({geometryInstances:i,appearance:new An({translucent:!1,flat:!0}),asynchronous:!1})};var Yy=$v;var vht=new h,Sht=new h,wht=new h,Iht=new h;function Fx(e,t,n){n=h.cross(e,t,n);let i=h.magnitude(n);return h.multiplyByScalar(n,P.EPSILON7/i,n)}function xQ(e,t){let n=h.normalize(e,Iht),i=h.equalsEpsilon(n,h.UNIT_X,P.EPSILON6)?h.UNIT_Y:h.UNIT_X;return Fx(e,i,t)}function Xbe(e){let t=$.getColumn(e,0,vht),n=$.getColumn(e,1,Sht),i=$.getColumn(e,2,wht),r=h.equals(t,h.ZERO),o=h.equals(n,h.ZERO),s=h.equals(i,h.ZERO);return!r&&!o&&!s?e:r&&o&&s?(e[0]=P.EPSILON7,e[4]=P.EPSILON7,e[8]=P.EPSILON7,e):(r&&!o&&!s?t=Fx(n,i,t):!r&&o&&!s?n=Fx(t,i,n):!r&&!o&&s?i=Fx(n,t,i):r?o?s||(t=xQ(i,t),n=Fx(i,t,n)):(t=xQ(n,t),i=Fx(n,t,i)):(n=xQ(t,n),i=Fx(n,t,i)),$.setColumn(e,0,t,e),$.setColumn(e,1,n,e),$.setColumn(e,2,i,e),e)}function Jv(e,t){t=Xbe(t),this._orientedBoundingBox=new en(e,t),this._boundingSphere=ue.fromOrientedBoundingBox(this._orientedBoundingBox)}Object.defineProperties(Jv.prototype,{boundingVolume:{get:function(){return this._orientedBoundingBox}},boundingSphere:{get:function(){return this._boundingSphere}}});Jv.prototype.distanceToCamera=function(e){return Math.sqrt(this._orientedBoundingBox.distanceSquaredTo(e.camera.positionWC))};Jv.prototype.intersectPlane=function(e){return this._orientedBoundingBox.intersectPlane(e)};Jv.prototype.update=function(e,t){h.clone(e,this._orientedBoundingBox.center),t=Xbe(t),$.clone(t,this._orientedBoundingBox.halfAxes),ue.fromOrientedBoundingBox(this._orientedBoundingBox,this._boundingSphere)};Jv.prototype.createDebugVolume=function(e){let t=new Jm({minimum:new h(-1,-1,-1),maximum:new h(1,1,1)}),n=M.fromRotationTranslation(this.boundingVolume.halfAxes,this.boundingVolume.center),i=new Bt({geometry:t,id:"outline",modelMatrix:n,attributes:{color:Jt.fromColor(e)}});return new Mn({geometryInstances:i,appearance:new An({translucent:!1,flat:!0}),asynchronous:!1})};var xf=Jv;function io(e,t,n,i){this._tileset=e,this._header=n;let r=l(n.contents),o=r&&n.contents.length>1||sr(n,"3DTILES_multiple_contents"),s=r&&!o?n.contents[0]:n.content;this._contentHeader=s,this.transform=l(n.transform)?M.unpack(n.transform):M.clone(M.IDENTITY);let a=l(i)?i.computedTransform:e.modelMatrix,c=M.multiply(a,this.transform,new M),u=l(i)?i._initialTransform:M.IDENTITY;this._initialTransform=M.multiply(u,this.transform,new M),this.computedTransform=c,this.metadata=M4(e,n),this._verticalExaggeration=1,this._verticalExaggerationRelativeHeight=0,this._boundingVolume=this.createBoundingVolume(n.boundingVolume,c),this._boundingVolume2D=void 0;let f;l(s)&&l(s.boundingVolume)&&(f=this.createBoundingVolume(s.boundingVolume,c)),this._contentBoundingVolume=f,this._contentBoundingVolume2D=void 0;let d;l(n.viewerRequestVolume)&&(d=this.createBoundingVolume(n.viewerRequestVolume,c)),this._viewerRequestVolume=d,this.geometricError=n.geometricError,this._geometricError=n.geometricError,l(this._geometricError)||(this._geometricError=l(i)?i._geometricError:e._geometricError,io._deprecationWarning("geometricErrorUndefined","Required property geometricError is undefined for this tile. Using parent's geometric error instead.")),this.updateGeometricErrorScale();let p;l(n.refine)?((n.refine==="replace"||n.refine==="add")&&io._deprecationWarning("lowercase-refine",`This tile uses a lowercase refine "${n.refine}". Instead use "${n.refine.toUpperCase()}".`),p=n.refine.toUpperCase()==="REPLACE"?So.REPLACE:So.ADD):l(i)?p=i.refine:p=So.REPLACE,this.refine=p,this.children=[],this.parent=i;let g,m=!1,y,A,b;if(t=De.createIfNeeded(t),o)y=Mr.UNLOADED,A=t.clone();else if(l(s)){let v=s.uri;l(s.url)&&(io._deprecationWarning("contentUrl",'This tileset JSON uses the "content.url" property which has been deprecated. Use "content.uri" instead.'),v=s.url),v===""?(io._deprecationWarning("contentUriEmpty","content.uri property is an empty string, which creates a circular dependency, making this tileset invalid. Omit the content property instead"),g=new yg(e,this),m=!0,y=Mr.READY):(y=Mr.UNLOADED,A=t.getDerivedResource({url:v}),b=El.getServerKey(A.getUrlComponent()))}else g=new yg(e,this),m=!0,y=Mr.READY;this._content=g,this._contentResource=A,this._contentState=y,this._expiredContent=void 0,this._serverKey=b,this.hasEmptyContent=m,this.hasTilesetContent=!1,this.hasImplicitContent=!1,this.hasRenderableContent=!m,this.hasImplicitContentMetadata=!1,this.hasMultipleContents=o,this.cacheNode=void 0;let x=n.expire,T,E;l(x)&&(T=x.duration,l(x.date)&&(E=K.fromIso8601(x.date))),this.expireDuration=T,this.expireDate=E,this.lastStyleTime=0,this._optimChildrenWithinParent=Hh.NOT_COMPUTED,this.clippingPlanesDirty=!1,this.clippingPolygonsDirty=!1,this.clippingPolygonsNeedRebake=!1,this.priorityDeferred=!1,this.implicitTileset=void 0,this.implicitCoordinates=void 0,this.implicitSubtree=void 0,this._distanceToCamera=0,this._centerZDepth=0,this._screenSpaceError=0,this._screenSpaceErrorProgressiveResolution=0,this._visibilityPlaneMask=0,this._visible=!1,this._inRequestVolume=!1,this._finalResolution=!0,this._depth=0,this._stackLength=0,this._selectionDepth=0,this._updatedVisibilityFrame=0,this._touchedFrame=0,this._visitedFrame=0,this._selectedFrame=0,this._wasSelectedLastFrame=!1,this._requestedFrame=0,this._ancestorWithContent=void 0,this._ancestorWithContentAvailable=void 0,this._refines=!1,this._shouldSelect=!1,this._isClipped=!0,this._isClippedByPolygon=!1,this._clippingPlanesState=0,this._clippingPolygonsState=0,this._debugBoundingVolume=void 0,this._debugContentBoundingVolume=void 0,this._debugViewerRequestVolume=void 0,this._debugColor=z.fromRandom({alpha:1}),this._debugColorizeTiles=!1,this._priority=0,this._priorityHolder=this,this._priorityProgressiveResolution=!1,this._priorityProgressiveResolutionScreenSpaceErrorLeaf=!1,this._priorityReverseScreenSpaceError=0,this._foveatedFactor=0,this._wasMinPriorityChild=!1,this._loadTimestamp=new K,this._commandsLength=0,this._color=void 0,this._colorDirty=!1,this._request=void 0}io._deprecationWarning=Yr;Object.defineProperties(io.prototype,{tileset:{get:function(){return this._tileset}},content:{get:function(){return this._content}},boundingVolume:{get:function(){return this._boundingVolume}},contentBoundingVolume:{get:function(){return this._contentBoundingVolume??this._boundingVolume}},boundingSphere:{get:function(){return this._boundingVolume.boundingSphere}},isVisible:{get:function(){return this._visible&&this._inRequestVolume}},extras:{get:function(){return this._header.extras}},color:{get:function(){return l(this._color)||(this._color=new z),z.clone(this._color)},set:function(e){this._color=z.clone(e,this._color),this._colorDirty=!0}},contentAvailable:{get:function(){return this.contentReady&&this.hasRenderableContent||l(this._expiredContent)&&!this.contentFailed}},contentReady:{get:function(){return this._contentState===Mr.READY}},contentUnloaded:{get:function(){return this._contentState===Mr.UNLOADED}},hasUnloadedRenderableContent:{get:function(){return this.hasRenderableContent&&this.contentUnloaded}},contentExpired:{get:function(){return this._contentState===Mr.EXPIRED}},contentFailed:{get:function(){return this._contentState===Mr.FAILED}},commandsLength:{get:function(){return this._commandsLength}}});var Xy=new h;function Pht(e,t){let{tileset:n,boundingSphere:i}=e,{radius:r,center:o}=i,{camera:s}=t,a=h.multiplyByScalar(s.directionWC,e._centerZDepth,Xy),c=h.add(s.positionWC,a,Xy),u=h.subtract(c,o,Xy);if(h.magnitude(u)>r){let E=h.normalize(u,Xy),v=h.multiplyByScalar(E,r,Xy),S=h.add(o,v,Xy),I=h.subtract(S,s.positionWC,Xy),R=h.normalize(I,Xy);e._foveatedFactor=1-Math.abs(h.dot(s.directionWC,R))}else e._foveatedFactor=0;let p=e.refine===So.REPLACE,g=n.isSkippingLevelOfDetail;if(p&&!g||!n.foveatedScreenSpaceError||n.foveatedConeSize===1||e._priorityProgressiveResolution&&p&&g||n._pass===po.PRELOAD_FLIGHT||n._pass===po.PRELOAD)return!1;let m=1-Math.cos(s.frustum.fov*.5),y=n.foveatedConeSize*m;if(e._foveatedFactor<=y)return!1;let A=m-y,b=P.clamp((e._foveatedFactor-y)/A,0,1),x=n.foveatedInterpolationCallback(n.foveatedMinimumScreenSpaceErrorRelaxation,n.memoryAdjustedScreenSpaceError,b),T=e._screenSpaceError===0&&l(e.parent)?e.parent._screenSpaceError*.5:e._screenSpaceError;return n.memoryAdjustedScreenSpaceError-x<=T}var exe=new K;io.prototype.getScreenSpaceError=function(e,t,n){let i=this._tileset,r=n??1,o=l(this.parent)?this.parent.geometricError:i._scaledGeometricError,s=t?o:this.geometricError;if(s===0)return 0;let{camera:a,context:c}=e,u=a.frustum,f=c.drawingBufferWidth,d=c.drawingBufferHeight*r,p;if(e.mode===re.SCENE2D||u instanceof _n){let g=u.offCenterFrustum;l(g)&&(u=g);let m=Math.max(u.top-u.bottom,u.right-u.left)/Math.max(f,d);p=s/m}else{let g=Math.max(this._distanceToCamera,P.EPSILON7),m=u.sseDenominator;if(p=s*d/(g*m),i.dynamicScreenSpaceError){let y=i._dynamicScreenSpaceErrorComputedDensity,A=i.dynamicScreenSpaceErrorFactor,b=P.fog(g,y)*A;p-=b}}return p/=e.pixelRatio,p};function Dht(e,t){if(e.progressiveResolutionHeightFraction<=0||e.progressiveResolutionHeightFraction>.5)return!1;let n=e.memoryAdjustedScreenSpaceError,i=t._screenSpaceErrorProgressiveResolution>n;t._priorityProgressiveResolutionScreenSpaceErrorLeaf=!1;let r=t.parent,o=t._screenSpaceErrorProgressiveResolution<=n,s=l(r)&&r._screenSpaceErrorProgressiveResolution>n;return o&&s&&(t._priorityProgressiveResolutionScreenSpaceErrorLeaf=!0,i=!0),i}function Rht(e,t){let n=t.parent,r=l(n)&&(!e.isSkippingLevelOfDetail||t._screenSpaceError===0||n.hasTilesetContent||n.hasImplicitContent)?n._screenSpaceError:t._screenSpaceError;return e.root._screenSpaceError-r}io.prototype.updateVisibility=function(e){let{parent:t,tileset:n}=this;if(this._updatedVisibilityFrame===n._updatedVisibilityFrame)return;let i=l(t)?t.computedTransform:n.modelMatrix,r=l(t)?t._visibilityPlaneMask:aa.MASK_INDETERMINATE;this.updateTransform(i,e),this._distanceToCamera=this.distanceToTile(e),this._centerZDepth=this.distanceToTileCenter(e),this._screenSpaceError=this.getScreenSpaceError(e,!1),this._screenSpaceErrorProgressiveResolution=this.getScreenSpaceError(e,!1,n.progressiveResolutionHeightFraction),this._visibilityPlaneMask=this.visibility(e,r),this._visible=this._visibilityPlaneMask!==aa.MASK_OUTSIDE,this._inRequestVolume=this.insideViewerRequestVolume(e),this._priorityReverseScreenSpaceError=Rht(n,this),this._priorityProgressiveResolution=Dht(n,this),this.priorityDeferred=Pht(this,e),this._updatedVisibilityFrame=n._updatedVisibilityFrame};io.prototype.updateExpiration=function(){if(l(this.expireDate)&&this.contentReady&&!this.hasEmptyContent&&!this.hasMultipleContents){let e=K.now(exe);K.lessThan(this.expireDate,e)&&(this._contentState=Mr.EXPIRED,this._expiredContent=this._content)}};function Oht(e){if(!l(e.expireDuration))return;let t=K.now(exe);K.addSeconds(t,e.expireDuration,t),l(e.expireDate)?K.lessThan(e.expireDate,t)&&K.clone(t,e.expireDate):e.expireDate=K.clone(t)}function Mht(e){return function(){return e._priority}}io.prototype.requestContent=function(){if(!this.hasEmptyContent)return this.hasMultipleContents?Nht(this):Fht(this)};function Nht(e){let t=e._content,n=e._tileset;if(!l(t)){let r=sr(e._header,"3DTILES_multiple_contents")?e._header.extensions["3DTILES_multiple_contents"]:e._header;t=new N4(n,e,e._contentResource.clone(),r),e._content=t}let i=t.requestInnerContents();if(l(i))return e._contentState=Mr.LOADING,i.then(r=>{if(!e.isDestroyed()&&l(r))return e._contentState=Mr.PROCESSING,t}).catch(r=>{if(!e.isDestroyed())throw e._contentState=Mr.FAILED,r})}async function Lht(e,t,n,i,r){let o=e._contentState;e._contentState=Mr.LOADING,++t.statistics.numberOfPendingRequests;let s;try{s=await r}catch(a){if(--t.statistics.numberOfPendingRequests,e.isDestroyed())return;if(n.cancelled||n.state===wi.CANCELLED){e._contentState=o,++t.statistics.numberOfAttemptedRequests;return}if(txe(e,a))return i&&(e.expireDate=void 0),e._content=new yg(t,e),Kbe(e),e._contentState=Mr.PROCESSING,e._content;throw e._contentState=Mr.FAILED,a}if(e.isDestroyed()){--t.statistics.numberOfPendingRequests;return}if(n.cancelled||n.state===wi.CANCELLED){e._contentState=o,--t.statistics.numberOfPendingRequests,++t.statistics.numberOfAttemptedRequests;return}try{let a=await Bht(e,s);return--t.statistics.numberOfPendingRequests,e.isDestroyed()?void 0:(i&&(e.expireDate=void 0),e._content=a,a instanceof yg&&Kbe(e),e._contentState=Mr.PROCESSING,a)}catch(a){if(--t.statistics.numberOfPendingRequests,e.isDestroyed())return;throw e._contentState=Mr.FAILED,a}}function Fht(e){let t=e._contentResource.clone(),n=e.contentExpired;n&&t.setQueryParameters({expired:e.expireDate.toString()});let i=new Oo({throttle:!0,throttleByServer:!0,type:oa.TILES3D,priorityFunction:Mht(e),serverKey:e._serverKey});e._request=i,t.request=i;let r=e._tileset,o=t.fetchArrayBuffer();if(!l(o)){++r.statistics.numberOfAttemptedRequests;return}return Lht(e,r,i,n,o)}function txe(e,t){let i=e._tileset?._runtimeContentCodec?.missingTilePolicy;return!l(i)||!l(t.statusCode)?!1:i.statusCodes.includes(t.statusCode)}function Kbe(e){e.hasEmptyContent=!0,e.hasRenderableContent=!1}io._isEmptyTile=txe;async function Bht(e,t){let n=e._tileset,i=n?._runtimeContentCodec;if(l(i)&&typeof i.createContent=="function"){let u=await Promise.resolve(i.createContent(n,e,e._contentResource,t));return e.isDestroyed()?void 0:u}let r=Hy(t);n._disableSkipLevelOfDetail=n._disableSkipLevelOfDetail||r.contentType===ka.GEOMETRY||r.contentType===ka.VECTOR,(r.contentType===ka.IMPLICIT_SUBTREE||r.contentType===ka.IMPLICIT_SUBTREE_JSON)&&(e.hasImplicitContent=!0,e.hasRenderableContent=!1),r.contentType===ka.EXTERNAL_TILESET&&(e.hasTilesetContent=!0,e.hasRenderableContent=!1);let o,s=Uv[r.contentType];if(e.isDestroyed())return;l(r.binaryPayload)?o=await Promise.resolve(s(n,e,e._contentResource,r.binaryPayload.buffer,0)):o=await Promise.resolve(s(n,e,e._contentResource,r.jsonPayload));let a=e._contentHeader;if(e.hasImplicitContentMetadata){let u=e.implicitSubtree,f=e.implicitCoordinates;o.metadata=u.getContentMetadataView(f,0)}else e.hasImplicitContent||(o.metadata=zv(n,a));let c=Vv(n,a);return l(c)&&(o.group=new vC({metadata:c})),o}io.prototype.cancelRequests=function(){this.hasMultipleContents?this._content.cancelRequests():this._request.cancel()};io.prototype.unloadTilesetContent=function(){this.hasTilesetContent&&(this._content=this._content&&this._content.destroy(),this._contentState=Mr.UNLOADED,this._expiredContent=void 0,this.expireDate=void 0,this.hasTilesetContent=!1,this.hasRenderableContent=!0,this._selectedFrame=0,this.lastStyleTime=0)};io.prototype.unloadContent=function(){this.hasRenderableContent&&(this._content=this._content&&this._content.destroy(),this._contentState=Mr.UNLOADED,this.lastStyleTime=0,this.clippingPlanesDirty=this._clippingPlanesState===0,this._clippingPlanesState=0,this.clippingPolygonsDirty=this._clippingPolygonsState===0,this._clippingPolygonsState=0,this.clippingPolygonsNeedRebake=!1,this._debugColorizeTiles=!1,this._debugBoundingVolume=this._debugBoundingVolume&&this._debugBoundingVolume.destroy(),this._debugContentBoundingVolume=this._debugContentBoundingVolume&&this._debugContentBoundingVolume.destroy(),this._debugViewerRequestVolume=this._debugViewerRequestVolume&&this._debugViewerRequestVolume.destroy())};var nxe=new ue;function EQ(e,t){if(t.mode!==re.SCENE3D&&!l(e._boundingVolume2D)){let n=e._boundingVolume.boundingSphere,i=ue.projectTo2D(n,t.mapProjection,nxe);e._boundingVolume2D=new Yy(i.center,i.radius)}return t.mode!==re.SCENE3D?e._boundingVolume2D:e._boundingVolume}function kht(e,t){if(t.mode!==re.SCENE3D&&!l(e._contentBoundingVolume2D)){let n=e._contentBoundingVolume.boundingSphere,i=ue.projectTo2D(n,t.mapProjection,nxe);e._contentBoundingVolume2D=new Yy(i.center,i.radius)}return t.mode!==re.SCENE3D?e._contentBoundingVolume2D:e._contentBoundingVolume}io.prototype.visibility=function(e,t){let n=e.cullingVolume,i=EQ(this,e),r=this._tileset,o=r.clippingPlanes;if(l(o)&&o.enabled){let a=o.computeIntersectionWithBoundingVolume(i,r.clippingPlanesOriginMatrix);if(this._isClipped=a!==$t.INSIDE,a===$t.OUTSIDE)return aa.MASK_OUTSIDE}let s=r.clippingPolygons;if(l(s)&&s.enabled){let a=s.computeIntersectionWithBoundingVolume(i);this._isClippedByPolygon=a!==$t.OUTSIDE}return n.computeVisibilityWithPlaneMask(i,t)};io.prototype.contentVisibility=function(e){if(!l(this._contentBoundingVolume))return $t.INSIDE;if(this._visibilityPlaneMask===aa.MASK_INSIDE)return $t.INSIDE;let t=e.cullingVolume,n=kht(this,e),i=this._tileset,r=i.clippingPlanes;if(l(r)&&r.enabled){let s=r.computeIntersectionWithBoundingVolume(n,i.clippingPlanesOriginMatrix);if(this._isClipped=s!==$t.INSIDE,s===$t.OUTSIDE)return $t.OUTSIDE}let o=i.clippingPolygons;if(l(o)&&o.enabled){let s=o.computeIntersectionWithBoundingVolume(n);if(this._isClippedByPolygon=s!==$t.OUTSIDE,s===$t.INSIDE)return $t.OUTSIDE}return t.computeVisibility(n)};io.prototype.distanceToTile=function(e){return EQ(this,e).distanceToCamera(e)};var Uht=new h;io.prototype.distanceToTileCenter=function(e){let n=EQ(this,e).boundingVolume,i=h.subtract(n.center,e.camera.positionWC,Uht);return h.dot(e.camera.directionWC,i)};io.prototype.insideViewerRequestVolume=function(e){let t=this._viewerRequestVolume;return!l(t)||t.distanceToCamera(e)===0};var ixe=new $,rxe=new h,zht=new $,CQ=new h,oxe=new ie,sxe=new en,TQ=new M;function Vht(e,t,n){let i=h.fromElements(e[0],e[1],e[2],CQ),r=$.fromArray(e,3,zht);i=M.multiplyByPoint(t,i,i);let o=M.getMatrix3(t,ixe);return r=$.multiply(o,r,r),l(n)?(n.update(i,r),n):new xf(i,r)}function $be(e,t,n,i){let r=ie.unpack(e,0,oxe),o=e[4],s=e[5],a=en.fromRectangle(r,o,s,ee.WGS84,sxe),c=a.center,u=a.halfAxes;t=M.multiplyTransformation(t,M.inverseTransformation(n,TQ),TQ),c=M.multiplyByPoint(t,c,c);let f=M.getMatrix3(t,ixe);return u=$.multiply(f,u,u),l(i)&&i instanceof xf?(i.update(c,u),i):new xf(c,u)}function jht(e,t,n,i){if(!M.equalsEpsilon(t,n,P.EPSILON8))return i instanceof xf?$be(e,t,n,i):$be(e,t,n,void 0);let r=ie.unpack(e,0,oxe);return i instanceof Md?(i.rectangle=ie.clone(r,i.rectangle),i.minimumHeight=e[4],i.maximumHeight=e[5],i.computeBoundingVolumes(ee.WGS84),i):new Md({rectangle:r,minimumHeight:e[4],maximumHeight:e[5]})}function Hht(e,t,n){let i=h.fromElements(e[0],e[1],e[2],CQ),r=e[3];i=M.multiplyByPoint(t,i,i);let o=M.getScale(t,rxe),s=h.maximumComponent(o);return r*=s,l(n)?(n.update(i,r),n):new Yy(i,r)}io.prototype.createBoundingVolume=function(e,t,n){let i=this.metadata,r;if(l(i)&&(r=nx.parseBoundingVolumeSemantic("TILE",i)),l(r)&&(e=r),!l(e))throw new oe("boundingVolume must be defined");if(sr(e,"3DTILES_bounding_volume_S2"))return new k4(e.extensions["3DTILES_bounding_volume_S2"]);let{box:o,region:s,sphere:a}=e;if(l(o)){let c=Vht(o,t,n);return this._verticalExaggeration!==1&&Jbe(c,this._verticalExaggeration,this._verticalExaggerationRelativeHeight),c}if(l(s)){let c=jht(s,t,this._initialTransform,n);return this._verticalExaggeration===1||(c instanceof xf?Jbe(c,this._verticalExaggeration,this._verticalExaggerationRelativeHeight):(c.minimumHeight=br.getHeight(c.minimumHeight,this._verticalExaggeration,this._verticalExaggerationRelativeHeight),c.maximumHeight=br.getHeight(c.maximumHeight,this._verticalExaggeration,this._verticalExaggerationRelativeHeight),c.computeBoundingVolumes(ee.WGS84))),c}if(l(a)){let c=Hht(a,t,n);if(this._verticalExaggeration!==1){let u=br.getPosition(c.center,ee.WGS84,this._verticalExaggeration,this._verticalExaggerationRelativeHeight,CQ),f=c.radius*this._verticalExaggeration;c.update(u,f)}return c}throw new oe("boundingVolume must contain a sphere, region, or box")};var Ght=h.unpackArray(new Array(24).fill(0));function Jbe(e,t,n){let i=e.boundingVolume.computeCorners(Ght).map(o=>br.getPosition(o,ee.WGS84,t,n,o)),r=en.fromPoints(i,sxe);e.update(r.center,r.halfAxes)}io.prototype.updateTransform=function(e,t){e=e??M.IDENTITY;let n=M.multiplyTransformation(e,this.transform,TQ),i=!M.equals(n,this.computedTransform),r=l(t)&&(this._verticalExaggeration!==t.verticalExaggeration||this._verticalExaggerationRelativeHeight!==t.verticalExaggerationRelativeHeight);if(!i&&!r)return;i&&M.clone(n,this.computedTransform),r&&(this._verticalExaggeration=t.verticalExaggeration,this._verticalExaggerationRelativeHeight=t.verticalExaggerationRelativeHeight);let o=this._header,s=this._contentHeader;this._boundingVolume=this.createBoundingVolume(o.boundingVolume,this.computedTransform,this._boundingVolume),l(this._contentBoundingVolume)&&(this._contentBoundingVolume=this.createBoundingVolume(s.boundingVolume,this.computedTransform,this._contentBoundingVolume)),l(this._viewerRequestVolume)&&(this._viewerRequestVolume=this.createBoundingVolume(o.viewerRequestVolume,this.computedTransform,this._viewerRequestVolume)),this.updateGeometricErrorScale(),this._debugBoundingVolume=this._debugBoundingVolume&&this._debugBoundingVolume.destroy(),this._debugContentBoundingVolume=this._debugContentBoundingVolume&&this._debugContentBoundingVolume.destroy(),this._debugViewerRequestVolume=this._debugViewerRequestVolume&&this._debugViewerRequestVolume.destroy()};io.prototype.updateGeometricErrorScale=function(){let e=M.getScale(this.computedTransform,rxe),t=h.maximumComponent(e);if(this.geometricError=this._geometricError*t,!l(this.parent)){let n=this._tileset;n._scaledGeometricError=n._geometricError*t}};function Wht(e,t,n,i){if(!i.isRender)return;let r=l(e._contentHeader)&&l(e._contentHeader.boundingVolume),o=t.debugShowBoundingVolume||t.debugShowContentBoundingVolume&&!r;if(o){let c;e._finalResolution?e.hasRenderableContent?c=z.WHITE:c=z.DARKGRAY:c=z.YELLOW,l(e._debugBoundingVolume)||(e._debugBoundingVolume=e._boundingVolume.createDebugVolume(c)),e._debugBoundingVolume.update(n);let u=e._debugBoundingVolume.getGeometryInstanceAttributes("outline");u.color=Jt.toValue(c,u.color)}else!o&&l(e._debugBoundingVolume)&&(e._debugBoundingVolume=e._debugBoundingVolume.destroy());t.debugShowContentBoundingVolume&&r?(l(e._debugContentBoundingVolume)||(e._debugContentBoundingVolume=e._contentBoundingVolume.createDebugVolume(z.BLUE)),e._debugContentBoundingVolume.update(n)):!t.debugShowContentBoundingVolume&&l(e._debugContentBoundingVolume)&&(e._debugContentBoundingVolume=e._debugContentBoundingVolume.destroy()),t.debugShowViewerRequestVolume&&l(e._viewerRequestVolume)?(l(e._debugViewerRequestVolume)||(e._debugViewerRequestVolume=e._viewerRequestVolume.createDebugVolume(z.YELLOW)),e._debugViewerRequestVolume.update(n)):!t.debugShowViewerRequestVolume&&l(e._debugViewerRequestVolume)&&(e._debugViewerRequestVolume=e._debugViewerRequestVolume.destroy());let s=t.debugColorizeTiles&&!e._debugColorizeTiles||l(t._heatmap.tilePropertyName),a=!t.debugColorizeTiles&&e._debugColorizeTiles;s?(t._heatmap.colorize(e,n),e._debugColorizeTiles=!0,e.color=e._debugColor):a&&(e._debugColorizeTiles=!1,e.color=z.WHITE),e._colorDirty&&(e._colorDirty=!1,e._content.applyDebugSettings(!0,e._color)),a&&t.makeStyleDirty()}function qht(e,t,n){let i=e._expiredContent;if(!e.hasMultipleContents&&l(i)){if(!e.contentReady){try{i.update(t,n)}catch{}return}e._expiredContent.destroy(),e._expiredContent=void 0}if(l(e.content))try{e.content.update(t,n)}catch(r){throw e._contentState=Mr.FAILED,r}}function Yht(e,t){let n=t.clippingPlanes,i=0;l(n)&&e._isClipped&&n.enabled&&(i=n.clippingPlanesState),i!==e._clippingPlanesState&&(e._clippingPlanesState=i,e.clippingPlanesDirty=!0)}function Xht(e,t){let n=t.clippingPolygons,i=0;l(n)&&e._isClippedByPolygon&&n.enabled&&(i=n.clippingPolygonsState),i!==e._clippingPolygonsState&&(e._clippingPolygonsState=i,e.clippingPolygonsDirty=!0)}io.prototype.update=function(e,t,n){let{commandList:i}=t,r=i.length;Yht(this,e),Xht(this,e),Wht(this,e,t,n),qht(this,e,t);let o=i.length;this._commandsLength=o-r;for(let s=r;s<o;++s){let a=i[s],c=a.pass===Ie.TRANSLUCENT;a.depthForTranslucentClassification=c}this.clippingPlanesDirty=!1,this.clippingPolygonsDirty=!1,this.clippingPolygonsNeedRebake=!1};var Zbe=[];io.prototype.process=function(e,t){!this.contentExpired&&!this.contentReady&&this._content.ready&&(Oht(this),this._selectedFrame=0,this.lastStyleTime=0,K.now(this._loadTimestamp),this._contentState=Mr.READY,!this.hasTilesetContent&&!this.hasImplicitContent&&(e._statistics.incrementLoadCounts(this.content),++e._statistics.numberOfTilesWithContentReady,++e._statistics.numberOfLoadedTilesTotal,e._cache.add(this)));let n=t.commandList;t.commandList=Zbe;try{this._content.update(e,t)}catch(i){throw this._contentState=Mr.FAILED,i}Zbe.length=0,t.commandList=n};function Qbe(e,t,n){let i=e*Math.pow(10,t);return parseInt(i)*Math.pow(10,n)}function V4(e,t,n){return Math.max(P.normalize(e,t,n)-P.EPSILON7,0)}io.prototype.updatePriority=function(){let e=this.tileset,t=e.preferLeaves,n=e._minimumPriority,i=e._maximumPriority,r=4,o=1,s=0,a=r,c=s+a,u=r,f=c+u,d=o,p=Math.pow(10,f),g=f+d,m=o,y=Math.pow(10,g),A=g+m,b=Math.pow(10,A),x=V4(this._depth,n.depth,i.depth);x=t?1-x:x;let E=!e.isSkippingLevelOfDetail&&this.refine===So.REPLACE?V4(this._priorityHolder._distanceToCamera,n.distance,i.distance):V4(this._priorityReverseScreenSpaceError,n.reverseScreenSpaceError,i.reverseScreenSpaceError),v=Qbe(E,a,s),S=this._priorityProgressiveResolution?0:p,I=V4(this._priorityHolder._foveatedFactor,n.foveatedFactor,i.foveatedFactor),R=Qbe(I,u,c),O=this.priorityDeferred?y:0,L=e._pass===po.PRELOAD_FLIGHT?0:b;this._priority=x+v+S+R+O+L};io.prototype.isDestroyed=function(){return!1};io.prototype.destroy=function(){return this._content=this._content&&this._content.destroy(),this._expiredContent=this._expiredContent&&!this._expiredContent.isDestroyed()&&this._expiredContent.destroy(),this._debugBoundingVolume=this._debugBoundingVolume&&this._debugBoundingVolume.destroy(),this._debugContentBoundingVolume=this._debugContentBoundingVolume&&this._debugContentBoundingVolume.destroy(),this._debugViewerRequestVolume=this._debugViewerRequestVolume&&this._debugViewerRequestVolume.destroy(),le(this)};var Wh=io;function Tg(e){e=e??H.EMPTY_OBJECT;let t=e.id,n=e.group,i=e.class,r=l(n.properties)?n.properties:{};this._class=i,this._properties=r,this._id=t,this._extras=n.extras,this._extensions=n.extensions}Object.defineProperties(Tg.prototype,{class:{get:function(){return this._class}},id:{get:function(){return this._id}},extras:{get:function(){return this._extras}},extensions:{get:function(){return this._extensions}}});Tg.prototype.hasProperty=function(e){return Xn.hasProperty(e,this._properties,this._class)};Tg.prototype.hasPropertyBySemantic=function(e){return Xn.hasPropertyBySemantic(e,this._properties,this._class)};Tg.prototype.getPropertyIds=function(e){return Xn.getPropertyIds(this._properties,this._class,e)};Tg.prototype.getProperty=function(e){return Xn.getProperty(e,this._properties,this._class)};Tg.prototype.setProperty=function(e,t){return Xn.setProperty(e,t,this._properties,this._class)};Tg.prototype.getPropertyBySemantic=function(e){return Xn.getPropertyBySemantic(e,this._properties,this._class)};Tg.prototype.setPropertyBySemantic=function(e,t){return Xn.setPropertyBySemantic(e,t,this._properties,this._class)};var D1=Tg;function Eg(e){e=e??H.EMPTY_OBJECT;let t=e.tileset,n=e.class,i=l(t.properties)?t.properties:{};this._class=n,this._properties=i,this._extras=t.extras,this._extensions=t.extensions}Object.defineProperties(Eg.prototype,{class:{get:function(){return this._class}},extras:{get:function(){return this._extras}},extensions:{get:function(){return this._extensions}}});Eg.prototype.hasProperty=function(e){return Xn.hasProperty(e,this._properties,this._class)};Eg.prototype.hasPropertyBySemantic=function(e){return Xn.hasPropertyBySemantic(e,this._properties,this._class)};Eg.prototype.getPropertyIds=function(e){return Xn.getPropertyIds(this._properties,this._class,e)};Eg.prototype.getProperty=function(e){return Xn.getProperty(e,this._properties,this._class)};Eg.prototype.setProperty=function(e,t){return Xn.setProperty(e,t,this._properties,this._class)};Eg.prototype.getPropertyBySemantic=function(e){return Xn.getPropertyBySemantic(e,this._properties,this._class)};Eg.prototype.setPropertyBySemantic=function(e,t){return Xn.setPropertyBySemantic(e,t,this._properties,this._class)};var j4=Eg;function axe(e){e=e??H.EMPTY_OBJECT;let t=e.metadataJson,n=e.schema,i=t.metadata??t.tileset,r;l(i)&&(r=new j4({tileset:i,class:n.classes[i.class]}));let o=[],s=[],a=t.groups;if(Array.isArray(a)){let c=a.length;for(let u=0;u<c;u++){let f=a[u];s.push(new D1({group:f,class:n.classes[f.class]}))}}else if(l(a)){o=Object.keys(a).sort();let c=o.length;for(let u=0;u<c;u++){let f=o[u];if(a.hasOwnProperty(f)){let d=a[f];s.push(new D1({id:f,group:a[f],class:n.classes[d.class]}))}}}this._schema=n,this._groups=s,this._groupIds=o,this._tileset=r,this._statistics=t.statistics,this._extras=t.extras,this._extensions=t.extensions}Object.defineProperties(axe.prototype,{schema:{get:function(){return this._schema}},groups:{get:function(){return this._groups}},groupIds:{get:function(){return this._groupIds}},tileset:{get:function(){return this._tileset}},statistics:{get:function(){return this._statistics}},extras:{get:function(){return this._extras}},extensions:{get:function(){return this._extensions}}});var Zv=axe;var cxe={},Kht=new h;cxe.checkChildrenWithinParent=function(e){let t=e.children,n=t.length,i=e.boundingVolume;if(i instanceof xf||i instanceof Md){let r=i._orientedBoundingBox;e._optimChildrenWithinParent=Hh.USE_OPTIMIZATION;for(let o=0;o<n;++o){let a=t[o].boundingVolume;if(!(a instanceof xf||a instanceof Md)){e._optimChildrenWithinParent=Hh.SKIP_OPTIMIZATION;break}let c=a._orientedBoundingBox,u=h.subtract(c.center,r.center,Kht),f=h.magnitude(u);h.divideByScalar(u,f,u);let d=Math.abs(r.halfAxes[0]*u.x)+Math.abs(r.halfAxes[1]*u.y)+Math.abs(r.halfAxes[2]*u.z)+Math.abs(r.halfAxes[3]*u.x)+Math.abs(r.halfAxes[4]*u.y)+Math.abs(r.halfAxes[5]*u.z)+Math.abs(r.halfAxes[6]*u.x)+Math.abs(r.halfAxes[7]*u.y)+Math.abs(r.halfAxes[8]*u.z),p=Math.abs(c.halfAxes[0]*u.x)+Math.abs(c.halfAxes[1]*u.y)+Math.abs(c.halfAxes[2]*u.z)+Math.abs(c.halfAxes[3]*u.x)+Math.abs(c.halfAxes[4]*u.y)+Math.abs(c.halfAxes[5]*u.z)+Math.abs(c.halfAxes[6]*u.x)+Math.abs(c.halfAxes[7]*u.y)+Math.abs(c.halfAxes[8]*u.z);if(d<=p+f){e._optimChildrenWithinParent=Hh.SKIP_OPTIMIZATION;break}}}return e._optimChildrenWithinParent===Hh.USE_OPTIMIZATION};var H4=cxe;function R1(){this.head=void 0,this.tail=void 0,this._length=0}Object.defineProperties(R1.prototype,{length:{get:function(){return this._length}}});function $ht(e,t,n){this.item=e,this.previous=t,this.next=n}R1.prototype.add=function(e){let t=new $ht(e,this.tail,void 0);return l(this.tail)?(this.tail.next=t,this.tail=t):(this.head=t,this.tail=t),++this._length,t};function lxe(e,t){l(t.previous)&&l(t.next)?(t.previous.next=t.next,t.next.previous=t.previous):l(t.previous)?(t.previous.next=void 0,e.tail=t.previous):l(t.next)?(t.next.previous=void 0,e.head=t.next):(e.head=void 0,e.tail=void 0),t.next=void 0,t.previous=void 0}R1.prototype.remove=function(e){l(e)&&(lxe(this,e),--this._length)};R1.prototype.splice=function(e,t){if(e===t)return;lxe(this,t);let n=e.next;e.next=t,this.tail===e?this.tail=t:n.previous=t,t.next=n,t.previous=e};var G4=R1;function Ky(){this._list=new G4,this._sentinel=this._list.add(),this._trimTiles=!1}Ky.prototype.reset=function(){this._list.splice(this._list.tail,this._sentinel)};Ky.prototype.touch=function(e){let t=e.cacheNode;l(t)&&this._list.splice(this._sentinel,t)};Ky.prototype.add=function(e){l(e.cacheNode)||(e.cacheNode=this._list.add(e))};Ky.prototype.forEachLoadedTile=function(e){for(let t=this._list.head;l(t);t=t.next)l(t.item)&&e(t.item)};Ky.prototype.unloadTile=function(e,t,n){let i=t.cacheNode;l(i)&&(this._list.remove(i),t.cacheNode=void 0,n(e,t))};Ky.prototype.unloadTiles=function(e,t){let n=this._trimTiles;this._trimTiles=!1;let i=this._list,r=this._sentinel,o=i.head;for(;o!==r&&(e.totalMemoryUsageInBytes>e.cacheBytes||n);){let s=o.item;o=o.next,this.unloadTile(e,s,t)}};Ky.prototype.trim=function(){this._trimTiles=!0};var W4=Ky;function q4(e){this.tilePropertyName=e,this._minimum=Number.MAX_VALUE,this._maximum=-Number.MAX_VALUE,this._previousMinimum=Number.MAX_VALUE,this._previousMaximum=-Number.MAX_VALUE,this._referenceMinimum={},this._referenceMaximum={}}function SQ(e,t){let n;return t==="_loadTimestamp"?n=K.toDate(e).getTime():n=e,n}q4.prototype.setReferenceMinimumMaximum=function(e,t,n){this._referenceMinimum[n]=SQ(e,n),this._referenceMaximum[n]=SQ(t,n)};function Jht(e,t){let n=e.tilePropertyName;if(l(n)){let i=SQ(t[n],n);return l(i)?(e._maximum=Math.max(i,e._maximum),e._minimum=Math.min(i,e._minimum),i):(e.tilePropertyName=void 0,i)}}var vQ=[new z(.1,.1,.1,1),new z(.153,.278,.878,1),new z(.827,.231,.49,1),new z(.827,.188,.22,1),new z(1,.592,.259,1),new z(1,.843,0,1)];q4.prototype.colorize=function(e,t){let n=this.tilePropertyName;if(!l(n)||!e.contentAvailable||e._selectedFrame!==t.frameNumber)return;let i=Jht(this,e),r=this._previousMinimum,o=this._previousMaximum;if(r===Number.MAX_VALUE||o===-Number.MAX_VALUE)return;let s=o-r+P.EPSILON7,c=P.clamp(i-r,0,s)/s,u=vQ.length-1,f=c*u,d=Math.floor(f),p=Math.ceil(f),g=f-d,m=vQ[d],y=vQ[p],A=z.clone(z.WHITE);A.red=P.lerp(m.red,y.red,g),A.green=P.lerp(m.green,y.green,g),A.blue=P.lerp(m.blue,y.blue,g),e._debugColor=A};q4.prototype.resetMinimumMaximum=function(){let e=this.tilePropertyName;if(l(e)){let t=this._referenceMinimum[e],n=this._referenceMaximum[e],i=l(t)&&l(n);this._previousMinimum=i?t:this._minimum,this._previousMaximum=i?n:this._maximum,this._minimum=Number.MAX_VALUE,this._maximum=-Number.MAX_VALUE}};var Y4=q4;function Qv(){this.selected=0,this.visited=0,this.numberOfCommands=0,this.numberOfAttemptedRequests=0,this.numberOfPendingRequests=0,this.numberOfTilesProcessing=0,this.numberOfTilesWithContentReady=0,this.numberOfTilesTotal=0,this.numberOfLoadedTilesTotal=0,this.numberOfFeaturesSelected=0,this.numberOfFeaturesLoaded=0,this.numberOfPointsSelected=0,this.numberOfPointsLoaded=0,this.numberOfTrianglesSelected=0,this.numberOfTilesStyled=0,this.numberOfFeaturesStyled=0,this.numberOfTilesCulledWithChildrenUnion=0,this.geometryByteLength=0,this.texturesByteLength=0,this.texturesReferenceCounterById={},this.batchTableByteLength=0}Qv.prototype.clear=function(){this.selected=0,this.visited=0,this.numberOfCommands=0,this.numberOfAttemptedRequests=0,this.numberOfFeaturesSelected=0,this.numberOfPointsSelected=0,this.numberOfTrianglesSelected=0,this.numberOfTilesStyled=0,this.numberOfFeaturesStyled=0,this.numberOfTilesCulledWithChildrenUnion=0};Qv.prototype.incrementSelectionCounts=function(e){this.numberOfFeaturesSelected+=e.featuresLength,this.numberOfPointsSelected+=e.pointsLength,this.numberOfTrianglesSelected+=e.trianglesLength;let t=e.innerContents;if(l(t)){let n=t.length;for(let i=0;i<n;++i)this.incrementSelectionCounts(t[i])}};Qv.prototype.incrementLoadCounts=function(e){if(this.numberOfFeaturesLoaded+=e.featuresLength,this.numberOfPointsLoaded+=e.pointsLength,this.geometryByteLength+=e.geometryByteLength,this.batchTableByteLength+=e.batchTableByteLength,!(e instanceof Cd))this.texturesByteLength+=e.texturesByteLength;else{let n=e.getTextureIds();for(let i of n){let r=this.texturesReferenceCounterById[i]??0;if(r===0){let o=e.getTextureByteLengthById(i);this.texturesByteLength+=o}this.texturesReferenceCounterById[i]=r+1}}let t=e.innerContents;if(l(t)){let n=t.length;for(let i=0;i<n;++i)this.incrementLoadCounts(t[i])}};Qv.prototype.decrementLoadCounts=function(e){if(this.numberOfFeaturesLoaded-=e.featuresLength,this.numberOfPointsLoaded-=e.pointsLength,this.geometryByteLength-=e.geometryByteLength,this.batchTableByteLength-=e.batchTableByteLength,!(e instanceof Cd))this.texturesByteLength-=e.texturesByteLength;else{let n=e.getTextureIds();for(let i of n){let r=this.texturesReferenceCounterById[i];if(r===1){delete this.texturesReferenceCounterById[i];let o=e.getTextureByteLengthById(i);this.texturesByteLength-=o}else this.texturesReferenceCounterById[i]=r-1}}let t=e.innerContents;if(l(t)){let n=t.length;for(let i=0;i<n;++i)this.decrementLoadCounts(t[i])}};Qv.clone=function(e,t){t.selected=e.selected,t.visited=e.visited,t.numberOfCommands=e.numberOfCommands,t.numberOfAttemptedRequests=e.numberOfAttemptedRequests,t.numberOfPendingRequests=e.numberOfPendingRequests,t.numberOfTilesProcessing=e.numberOfTilesProcessing,t.numberOfTilesWithContentReady=e.numberOfTilesWithContentReady,t.numberOfTilesTotal=e.numberOfTilesTotal,t.numberOfFeaturesSelected=e.numberOfFeaturesSelected,t.numberOfFeaturesLoaded=e.numberOfFeaturesLoaded,t.numberOfPointsSelected=e.numberOfPointsSelected,t.numberOfPointsLoaded=e.numberOfPointsLoaded,t.numberOfTrianglesSelected=e.numberOfTrianglesSelected,t.numberOfTilesStyled=e.numberOfTilesStyled,t.numberOfFeaturesStyled=e.numberOfFeaturesStyled,t.numberOfTilesCulledWithChildrenUnion=e.numberOfTilesCulledWithChildrenUnion,t.geometryByteLength=e.geometryByteLength,t.texturesByteLength=e.texturesByteLength,t.batchTableByteLength=e.batchTableByteLength};var Pp=Qv;function O1(){this._style=void 0,this._styleDirty=!1,this._lastStyleTime=0}Object.defineProperties(O1.prototype,{style:{get:function(){return this._style},set:function(e){e!==this._style&&(this._style=e,this._styleDirty=!0)}}});O1.prototype.makeDirty=function(){this._styleDirty=!0};O1.prototype.resetDirty=function(){this._styleDirty=!1};O1.prototype.applyStyle=function(e){if(!l(e.root)||l(this._style)&&!this._style._ready)return;let t=this._styleDirty;t&&++this._lastStyleTime;let n=this._lastStyleTime,i=e._statistics,r=t?e._selectedTiles:e._selectedTilesToStyle,o=r.length;for(let s=0;s<o;++s){let a=r[s];if(a.lastStyleTime!==n){let c=a.content;a.lastStyleTime=n,c.applyStyle(this._style),i.numberOfFeaturesStyled+=c.featuresLength,++i.numberOfTilesStyled}}};var X4=O1;function uxe(e,t,n){this.context=e,this.commandList=[],this.panoramaCommandList=[],this.shadowMaps=[],this.brdfLutGenerator=void 0,this.environmentMap=void 0,this.sphericalHarmonicCoefficients=void 0,this.specularEnvironmentMaps=void 0,this.specularEnvironmentMapsMaximumLOD=void 0,this.mode=re.SCENE3D,this.morphTime=re.getMorphTime(re.SCENE3D),this.frameNumber=0,this.newFrame=!1,this.time=void 0,this.jobScheduler=n,this.mapProjection=void 0,this.camera=void 0,this.cameraUnderground=!1,this.globeTranslucencyState=void 0,this.cullingVolume=void 0,this.occluder=void 0,this.maximumScreenSpaceError=void 0,this.pixelRatio=1,this.passes={render:!1,pick:!1,pickVoxel:!1,snap:!1,depth:!1,postProcess:!1,offscreen:!1},this.creditDisplay=t,this.afterRender=[],this.scene3DOnly=!1,this.fog={enabled:!1,renderable:!1,density:void 0,visualDensityScalar:void 0,sse:void 0,minimumBrightness:void 0},this.atmosphere=void 0,this.verticalExaggeration=1,this.verticalExaggerationRelativeHeight=0,this.shadowState={shadowsEnabled:!0,shadowMaps:[],lightShadowMaps:[],nearPlane:1,farPlane:5e3,closestObjectSize:1e3,lastDirtyTime:0,outOfView:!0},this.splitPosition=0,this.frustumSplits=[],this.backgroundColor=void 0,this.light=void 0,this.minimumDisableDepthTestDistance=void 0,this.invertClassification=!1,this.invertClassificationColor=void 0,this.useLogDepth=!1,this.tilesetPassState=void 0,this.minimumTerrainHeight=0,this.pickingMetadata=!1,this.pickedMetadataInfo=void 0,this.edgeVisibilityRequested=!1,this.planarFillRequested=!1}uxe.maximumFrameNumber=15e6;var Bx=uxe;function Zht(e,t,n){let i=sr(t,"3DTILES_implicit_tiling")?t.extensions["3DTILES_implicit_tiling"]:t.implicitTiling;this.baseResource=e,this.geometricError=t.geometricError,this.metadataSchema=n;let r=t.boundingVolume;if(!l(r.box)&&!l(r.region)&&!sr(r,"3DTILES_bounding_volume_S2")&&!sr(r,"3DTILES_bounding_volume_cylinder"))throw new oe("Only box, region, 3DTILES_bounding_volume_S2, and 3DTILES_bounding_volume_cylinder are supported for implicit tiling");this.boundingVolume=r,this.refine=t.refine,this.subtreeUriTemplate=new De({url:i.subtrees.uri}),this.contentUriTemplates=[],this.contentHeaders=[];let o=Qht(t);for(let s=0;s<o.length;s++){let a=o[s];this.contentHeaders.push(Ze(a,!0));let c=new De({url:a.uri});this.contentUriTemplates.push(c)}this.contentCount=this.contentHeaders.length,this.tileHeader=emt(t),this.subdivisionScheme=Xs[i.subdivisionScheme],this.branchingFactor=Xs.getBranchingFactor(this.subdivisionScheme),this.subtreeLevels=i.subtreeLevels,l(i.availableLevels)?this.availableLevels=i.availableLevels:this.availableLevels=i.maximumLevel+1}function Qht(e){if(sr(e,"3DTILES_multiple_contents")){let t=e.extensions["3DTILES_multiple_contents"];return l(t.contents)?t.contents:t.content}return l(e.contents)?e.contents:l(e.content)?[e.content]:[]}function emt(e){let t=Ze(e,!0);return l(t.extensions)&&(delete t.extensions["3DTILES_implicit_tiling"],delete t.extensions["3DTILES_multiple_contents"],Object.keys(t.extensions).length===0&&delete t.extensions),delete t.implicitTiling,delete t.contents,delete t.content,t}var Cg=Zht;var M1={};function fxe(e){return e=(e^e<<8)&16711935,e=(e^e<<4)&252645135,e=(e^e<<2)&858993459,e=(e^e<<1)&1431655765,e}function wQ(e){return e=(e^e<<16)&50331903,e=(e^e<<8)&50393103,e=(e^e<<4)&51130563,e=(e^e<<2)&153391689,e}function dxe(e){return e&=1431655765,e=(e^e>>1)&858993459,e=(e^e>>2)&252645135,e=(e^e>>4)&16711935,e=(e^e>>8)&65535,e}function IQ(e){return e&=153391689,e=(e^e>>2)&51130563,e=(e^e>>4)&50393103,e=(e^e>>8)&4278190335,e=(e^e>>16)&1023,e}M1.encode2D=function(e,t){return(fxe(e)|fxe(t)<<1)>>>0};M1.decode2D=function(e,t){return l(t)||(t=new Array(2)),t[0]=dxe(e),t[1]=dxe(e>>1),t};M1.encode3D=function(e,t,n){return wQ(e)|wQ(t)<<1|wQ(n)<<2};M1.decode3D=function(e,t){return l(t)||(t=new Array(3)),t[0]=IQ(e),t[1]=IQ(e>>1),t[2]=IQ(e>>2),t};var kx=M1;function go(e){this.subdivisionScheme=e.subdivisionScheme,this.subtreeLevels=e.subtreeLevels,this.level=e.level,this.x=e.x,this.y=e.y,this.z=void 0,e.subdivisionScheme===Xs.OCTREE&&(this.z=e.z)}Object.defineProperties(go.prototype,{childIndex:{get:function(){let e=0;return e|=this.x&1,e|=(this.y&1)<<1,this.subdivisionScheme===Xs.OCTREE&&(e|=(this.z&1)<<2),e}},mortonIndex:{get:function(){return this.subdivisionScheme===Xs.OCTREE?kx.encode3D(this.x,this.y,this.z):kx.encode2D(this.x,this.y)}},tileIndex:{get:function(){let e=this.subdivisionScheme===Xs.OCTREE?((1<<3*this.level)-1)/7:((1<<2*this.level)-1)/3,t=this.mortonIndex;return e+t}}});go.prototype.getDescendantCoordinates=function(e){let t=this.level+e.level,n=(this.x<<e.level)+e.x,i=(this.y<<e.level)+e.y;if(this.subdivisionScheme===Xs.OCTREE){let r=(this.z<<e.level)+e.z;return new go({subdivisionScheme:this.subdivisionScheme,subtreeLevels:this.subtreeLevels,level:t,x:n,y:i,z:r})}return new go({subdivisionScheme:this.subdivisionScheme,subtreeLevels:this.subtreeLevels,level:t,x:n,y:i})};go.prototype.getAncestorCoordinates=function(e){let t=1<<e,n=this.level-e,i=Math.floor(this.x/t),r=Math.floor(this.y/t);if(this.subdivisionScheme===Xs.OCTREE){let o=Math.floor(this.z/t);return new go({subdivisionScheme:this.subdivisionScheme,subtreeLevels:this.subtreeLevels,level:n,x:i,y:r,z:o})}return new go({subdivisionScheme:this.subdivisionScheme,subtreeLevels:this.subtreeLevels,level:n,x:i,y:r})};go.prototype.getOffsetCoordinates=function(e){let t=e.level-this.level,n=1<<t,i=e.x%n,r=e.y%n;if(this.subdivisionScheme===Xs.OCTREE){let o=e.z%n;return new go({subdivisionScheme:this.subdivisionScheme,subtreeLevels:this.subtreeLevels,level:t,x:i,y:r,z:o})}return new go({subdivisionScheme:this.subdivisionScheme,subtreeLevels:this.subtreeLevels,level:t,x:i,y:r})};go.prototype.getChildCoordinates=function(e){let t=this.level+1,n=2*this.x+e%2,i=2*this.y+Math.floor(e/2)%2;if(this.subdivisionScheme===Xs.OCTREE){let r=2*this.z+Math.floor(e/4)%2;return new go({subdivisionScheme:this.subdivisionScheme,subtreeLevels:this.subtreeLevels,level:t,x:n,y:i,z:r})}return new go({subdivisionScheme:this.subdivisionScheme,subtreeLevels:this.subtreeLevels,level:t,x:n,y:i})};go.prototype.getSubtreeCoordinates=function(){return this.getAncestorCoordinates(this.level%this.subtreeLevels)};go.prototype.getParentSubtreeCoordinates=function(){return this.getAncestorCoordinates(this.level%this.subtreeLevels+this.subtreeLevels)};go.prototype.isAncestor=function(e){let t=e.level-this.level;if(t<=0)return!1;let n=e.x>>t,i=e.y>>t,r=this.x===n,o=this.y===i;if(this.subdivisionScheme===Xs.OCTREE){let s=e.z>>t,a=this.z===s;return r&&o&&a}return r&&o};go.prototype.isEqual=function(e){return this.subdivisionScheme===e.subdivisionScheme&&this.subtreeLevels===e.subtreeLevels&&this.level===e.level&&this.x===e.x&&this.y===e.y&&(this.subdivisionScheme===Xs.OCTREE?this.z===e.z:!0)};go.prototype.isImplicitTilesetRoot=function(){return this.level===0};go.prototype.isSubtreeRoot=function(){return this.level%this.subtreeLevels===0};go.prototype.isBottomOfSubtree=function(){return this.level%this.subtreeLevels===this.subtreeLevels-1};go.prototype.getTemplateValues=function(){let e={level:this.level,x:this.x,y:this.y};return this.subdivisionScheme===Xs.OCTREE&&(e.z=this.z),e};var hxe=[0,0,0];go.fromMortonIndex=function(e,t,n,i){let r;return e===Xs.OCTREE?(r=kx.decode3D(i,hxe),new go({subdivisionScheme:e,subtreeLevels:t,level:n,x:r[0],y:r[1],z:r[2]})):(r=kx.decode2D(i,hxe),new go({subdivisionScheme:e,subtreeLevels:t,level:n,x:r[0],y:r[1]}))};go.fromTileIndex=function(e,t,n){let i,r,o;return e===Xs.OCTREE?(i=Math.floor(P.log2(7*n+1)/3),r=((1<<3*i)-1)/7,o=n-r):(i=Math.floor(P.log2(3*n+1)/2),r=((1<<2*i)-1)/3,o=n-r),go.fromMortonIndex(e,t,i,o)};var vg=go;function Sg(){}Sg.selectTiles=function(e,t){pe.throwInstantiationError()};Sg.sortChildrenByDistanceToCamera=function(e,t){return t._distanceToCamera===0&&e._distanceToCamera===0?t._centerZDepth-e._centerZDepth:t._distanceToCamera-e._distanceToCamera};Sg.canTraverse=function(e){return e.children.length===0?!1:e.hasTilesetContent||e.hasImplicitContent?!e.contentExpired:e._screenSpaceError>e.tileset.memoryAdjustedScreenSpaceError};Sg.selectTile=function(e,t){if(e.contentVisibility(t)===$t.OUTSIDE)return;e._wasSelectedLastFrame=!0;let{content:n,tileset:i}=e;n.featurePropertiesDirty?(n.featurePropertiesDirty=!1,e.lastStyleTime=0,i._selectedTilesToStyle.push(e)):e._selectedFrame<t.frameNumber-1&&(i._selectedTilesToStyle.push(e),e._wasSelectedLastFrame=!1),e._selectedFrame=t.frameNumber,i._selectedTiles.push(e)};Sg.visitTile=function(e,t){++e.tileset._statistics.visited,e._visitedFrame=t.frameNumber};Sg.touchTile=function(e,t){e._touchedFrame!==t.frameNumber&&(e.tileset._cache.touch(e),e._touchedFrame=t.frameNumber)};Sg.loadTile=function(e,t){let{tileset:n}=e;if(e._requestedFrame===t.frameNumber||!e.hasUnloadedRenderableContent&&!e.contentExpired||!tmt(e,t))return;let i=t.camera.timeSinceMoved<n.foveatedTimeDelay;e.priorityDeferred&&i||(e._requestedFrame=t.frameNumber,n._requestedTiles.push(e))};function tmt(e,t){let{tileset:n}=e;if(!n._cullRequestsWhileMoving)return!0;let{positionWCDeltaMagnitude:i,positionWCDeltaMagnitudeLastFrame:r}=t.camera,o=i!==0?i:r,s=Math.max(e.boundingSphere.radius*2,1);return n.cullRequestsWhileMovingMultiplier*o/s<1}Sg.updateTile=function(e,t){mxe(e,t),e.updateExpiration(),e._wasMinPriorityChild=!1,e._priorityHolder=e,rmt(e),e._shouldSelect=!1,e._finalResolution=!0};function mxe(e,t){if(e.updateVisibility(t),!e.isVisible)return;let n=e.children.length>0;if((e.hasTilesetContent||e.hasImplicitContent)&&n){let o=e.children[0];mxe(o,t),e._visible=o._visible;return}if(nmt(e,t)){e._visible=!1;return}let i=e.refine===So.REPLACE,r=e._optimChildrenWithinParent===Hh.USE_OPTIMIZATION;if(i&&r&&n&&!imt(e,t)){++e.tileset._statistics.numberOfTilesCulledWithChildrenUnion,e._visible=!1;return}}function nmt(e,t){let{parent:n,tileset:i}=e;return!l(n)||n.hasTilesetContent||n.hasImplicitContent||n.refine!==So.ADD?!1:e.getScreenSpaceError(t,!0)<=i.memoryAdjustedScreenSpaceError}function imt(e,t){let n=!1,i=e.children;for(let r=0;r<i.length;++r){let o=i[r];o.updateVisibility(t),n=n||o.isVisible}return n}function rmt(e){let t=e.tileset._minimumPriority,n=e.tileset._maximumPriority,i=e._priorityHolder;n.distance=Math.max(i._distanceToCamera,n.distance),t.distance=Math.min(i._distanceToCamera,t.distance),n.depth=Math.max(e._depth,n.depth),t.depth=Math.min(e._depth,t.depth),n.foveatedFactor=Math.max(i._foveatedFactor,n.foveatedFactor),t.foveatedFactor=Math.min(i._foveatedFactor,t.foveatedFactor),n.reverseScreenSpaceError=Math.max(e._priorityReverseScreenSpaceError,n.reverseScreenSpaceError),t.reverseScreenSpaceError=Math.min(e._priorityReverseScreenSpaceError,t.reverseScreenSpaceError)}var ic=Sg;function pxe(){}var N1={stack:new bu,stackMaximumLength:0};pxe.selectTiles=function(e,t){e._selectedTiles.length=0,e._requestedTiles.length=0,e.hasMixedContent=!1;let n=!0,i=e.root;if(i.updateVisibility(t),!i.isVisible)return n;let{touchTile:r,visitTile:o}=ic,s=N1.stack;for(s.push(i);s.length>0;){N1.stackMaximumLength=Math.max(N1.stackMaximumLength,s.length);let a=s.pop(),c=a.refine===So.ADD,u=a.refine===So.REPLACE,f=omt(a);f&&smt(a,s,t),(c||u&&!f)&&(amt(e,a),r(a,t),cmt(a,t),a.hasRenderableContent&&!a.contentAvailable&&(n=!1)),o(a,t)}return N1.stack.trim(N1.stackMaximumLength),n};function omt(e){return e.children.length===0?!1:e.hasTilesetContent||e.hasImplicitContent?!e.contentExpired:(e.hasEmptyContent,!0)}function smt(e,t,n){let{children:i}=e;for(let r=0;r<i.length;++r){let o=i[r];o.updateVisibility(n),o.isVisible&&t.push(o)}}function amt(e,t){(t.hasUnloadedRenderableContent||t.contentExpired)&&(t._priority=0,e._requestedTiles.push(t))}function cmt(e,t){e.contentAvailable&&e.contentVisibility(t)!==$t.OUTSIDE&&e.tileset._selectedTiles.push(e)}var K4=pxe;function gxe(){}var L1={stack:new bu,stackMaximumLength:0},F1={stack:new bu,stackMaximumLength:0};gxe.selectTiles=function(e,t){if(e._requestedTiles.length=0,e.debugFreezeFrame)return;e._selectedTiles.length=0,e._selectedTilesToStyle.length=0,e._emptyTiles.length=0,e.hasMixedContent=!1;let n=e.root;if(ic.updateTile(n,t),!n.isVisible||n.getScreenSpaceError(t,!0)<=e.memoryAdjustedScreenSpaceError)return;umt(n,t),L1.stack.trim(L1.stackMaximumLength),F1.stack.trim(F1.stackMaximumLength);let i=e._requestedTiles;for(let r=0;r<i.length;++r)i[r].updatePriority()};function PQ(e,t){e.contentAvailable&&ic.selectTile(e,t)}function lmt(e,t,n){let i=e.refine===So.REPLACE,{tileset:r,children:o}=e,{updateTile:s,loadTile:a,touchTile:c}=ic;for(let m=0;m<o.length;++m)s(o[m],n);o.sort(ic.sortChildrenByDistanceToCamera);let u=i&&e.hasRenderableContent,f=!0,d=!1,p=-1,g=Number.MAX_VALUE;for(let m=0;m<o.length;++m){let y=o[m];if(y.isVisible?(t.push(y),y._foveatedFactor<g&&(p=m,g=y._foveatedFactor),d=!0):(u||r.loadSiblings)&&(y._foveatedFactor<g&&(p=m,g=y._foveatedFactor),a(y,n),c(y,n)),u){let A;y._inRequestVolume?y.hasRenderableContent?A=y.contentAvailable:A=fmt(y,n):A=!1,f=f&&A}}if(d||(f=!1),p!==-1&&i){let m=o[p];m._wasMinPriorityChild=!0;let y=(e._wasMinPriorityChild||e===r.root)&&g<=e._priorityHolder._foveatedFactor?e._priorityHolder:e;y._foveatedFactor=Math.min(m._foveatedFactor,y._foveatedFactor),y._distanceToCamera=Math.min(m._distanceToCamera,y._distanceToCamera);for(let A=0;A<o.length;++A)o[A]._priorityHolder=y}return f}function umt(e,t){let{tileset:n}=e,{canTraverse:i,loadTile:r,visitTile:o,touchTile:s}=ic,a=L1.stack;for(a.push(e);a.length>0;){L1.stackMaximumLength=Math.max(L1.stackMaximumLength,a.length);let c=a.pop(),u=c.parent,f=!l(u)||u._refines;c._refines=i(c)?lmt(c,a,t)&&f:!1;let d=!c._refines&&f;c.hasRenderableContent?c.refine===So.ADD?(PQ(c,t),r(c,t)):c.refine===So.REPLACE&&(r(c,t),d&&PQ(c,t)):(n._emptyTiles.push(c),r(c,t),d&&PQ(c,t)),o(c,t),s(c,t)}}function fmt(e,t){let{canTraverse:n,updateTile:i,loadTile:r,touchTile:o}=ic,s=e.tileset.hasExtension("3DTILES_content_gltf_vector"),a=!0,c=F1.stack;for(c.push(e);c.length>0;){F1.stackMaximumLength=Math.max(F1.stackMaximumLength,c.length);let u=c.pop(),f=u.children,d=f.length,p=!u.hasRenderableContent&&n(u);if((s?u.hasRenderableContent:!p)&&!u.contentAvailable&&(a=!1),i(u,t),u.isVisible||(r(u,t),o(u,t)),p)for(let m=0;m<d;++m){let y=f[m];c.push(y)}}return e.hasEmptyContent||a}var $4=gxe;function _xe(){}var B1={stack:new bu,stackMaximumLength:0},k1={stack:new bu,stackMaximumLength:0},wg={stack:new bu,stackMaximumLength:0,ancestorStack:new bu,ancestorStackMaximumLength:0},dmt=2;_xe.selectTiles=function(e,t){if(e._requestedTiles.length=0,e.debugFreezeFrame)return;e._selectedTiles.length=0,e._selectedTilesToStyle.length=0,e._emptyTiles.length=0,e.hasMixedContent=!1;let n=e.root;if(ic.updateTile(n,t),!n.isVisible||n.getScreenSpaceError(t,!0)<=e.memoryAdjustedScreenSpaceError)return;ymt(n,t),Amt(n,t),B1.stack.trim(B1.stackMaximumLength),k1.stack.trim(k1.stackMaximumLength),wg.stack.trim(wg.stackMaximumLength),wg.ancestorStack.trim(wg.ancestorStackMaximumLength);let i=e._requestedTiles;for(let r=0;r<i.length;++r)i[r].updatePriority()};function hmt(e,t){let{updateTile:n,touchTile:i,selectTile:r}=ic,o=k1.stack;for(o.push(e);o.length>0;){k1.stackMaximumLength=Math.max(k1.stackMaximumLength,o.length);let a=o.pop().children;for(let c=0;c<a.length;++c){let u=a[c];u.isVisible&&(u.contentAvailable?(n(u,t),i(u,t),r(u,t)):u._depth-e._depth<dmt&&o.push(u))}}}function J4(e,t){let n=e.contentAvailable?e:e._ancestorWithContentAvailable;l(n)?n._shouldSelect=!0:hmt(e,t)}function mmt(e,t){e._ancestorWithContent=void 0,e._ancestorWithContentAvailable=void 0;let{parent:n}=e;if(!l(n))return;let i=!n.hasUnloadedRenderableContent||n._requestedFrame===t.frameNumber;e._ancestorWithContent=i?n:n._ancestorWithContent,e._ancestorWithContentAvailable=n.contentAvailable?n:n._ancestorWithContentAvailable}function pmt(e,t){let n=t._ancestorWithContent;return!e.immediatelyLoadDesiredLevelOfDetail&&(t._priorityProgressiveResolutionScreenSpaceErrorLeaf||l(n)&&t._screenSpaceError<n._screenSpaceError/e.skipScreenSpaceErrorFactor&&t._depth>n._depth+e.skipLevels)}function gmt(e,t,n){let{tileset:i,children:r}=e,{updateTile:o,loadTile:s,touchTile:a}=ic;for(let u=0;u<r.length;++u)o(r[u],n);r.sort(ic.sortChildrenByDistanceToCamera);let c=!1;for(let u=0;u<r.length;++u){let f=r[u];f.isVisible?(t.push(f),c=!0):i.loadSiblings&&(s(f,n),a(f,n))}return c}function _mt(e,t){let{tileset:n}=e;return n.immediatelyLoadDesiredLevelOfDetail?!1:l(e._ancestorWithContent)?e._screenSpaceError===0?e.parent._screenSpaceError>t:e._screenSpaceError>t:!0}function ymt(e,t){let{tileset:n}=e,i=n.immediatelyLoadDesiredLevelOfDetail?Number.MAX_VALUE:Math.max(n.baseScreenSpaceError,n.memoryAdjustedScreenSpaceError),{canTraverse:r,loadTile:o,visitTile:s,touchTile:a}=ic,c=B1.stack;for(c.push(e);c.length>0;){B1.stackMaximumLength=Math.max(B1.stackMaximumLength,c.length);let u=c.pop();mmt(u,t);let f=u.parent,d=!l(f)||f._refines;u._refines=r(u)?gmt(u,c,t)&&d:!1;let p=!u._refines&&d;u.hasRenderableContent?u.refine===So.ADD?(J4(u,t),o(u,t)):u.refine===So.REPLACE&&(_mt(u,i)?(o(u,t),p&&J4(u,t)):p?(J4(u,t),o(u,t)):pmt(n,u)&&o(u,t)):(n._emptyTiles.push(u),o(u,t),p&&J4(u,t)),s(u,t),a(u,t)}}function Amt(e,t){let{selectTile:n,canTraverse:i}=ic,{stack:r,ancestorStack:o}=wg,s;for(r.push(e);r.length>0||o.length>0;){if(wg.stackMaximumLength=Math.max(wg.stackMaximumLength,r.length),wg.ancestorStackMaximumLength=Math.max(wg.ancestorStackMaximumLength,o.length),o.length>0){let u=o.peek();if(u._stackLength===r.length){o.pop(),u!==s&&(u._finalResolution=!1),n(u,t);continue}}let a=r.pop();if(!l(a))continue;let c=i(a);if(a._shouldSelect)if(a.refine===So.ADD)n(a,t);else{if(a._selectionDepth=o.length,a._selectionDepth>0&&(a.tileset.hasMixedContent=!0),s=a,!c){n(a,t);continue}o.push(a),a._stackLength=r.length}if(c){let u=a.children;for(let f=0;f<u.length;++f){let d=u[f];d.isVisible&&r.push(d)}}}}var Z4=_xe;function _a(){this._layers=[],this.layerAdded=new be,this.layerRemoved=new be,this.layerMoved=new be,this.layerShownOrHidden=new be}Object.defineProperties(_a.prototype,{length:{get:function(){return this._layers.length}}});_a.prototype.add=function(e,t){l(t)?this._layers.splice(t,0,e):(t=this._layers.length,this._layers.push(e)),this._update(),this.layerAdded.raiseEvent(e,t);let i=e.readyEvent.addEventListener(()=>{this.layerShownOrHidden.raiseEvent(e,e._layerIndex,e.show),i()})};_a.prototype.addImageryProvider=function(e,t){let n=new Ms(e);return this.add(n,t),n};_a.prototype.remove=function(e,t){t=t??!0;let n=this._layers.indexOf(e);return n!==-1?(this._layers.splice(n,1),this._update(),this.layerRemoved.raiseEvent(e,n),t&&e.destroy(),!0):!1};_a.prototype.removeAll=function(e){e=e??!0;let t=this._layers;for(let n=0,i=t.length;n<i;n++){let r=t[n];this.layerRemoved.raiseEvent(r,n),e&&r.destroy()}this._layers=[]};_a.prototype.contains=function(e){return this.indexOf(e)!==-1};_a.prototype.indexOf=function(e){return this._layers.indexOf(e)};_a.prototype.get=function(e){return this._layers[e]};function Q4(e,t){return e.indexOf(t)}function yxe(e,t,n){let i=e._layers;if(t=P.clamp(t,0,i.length-1),n=P.clamp(n,0,i.length-1),t===n)return;let r=i[t];i[t]=i[n],i[n]=r,e._update(),e.layerMoved.raiseEvent(r,n,t)}_a.prototype.raise=function(e){let t=Q4(this._layers,e);yxe(this,t,t+1)};_a.prototype.lower=function(e){let t=Q4(this._layers,e);yxe(this,t,t-1)};_a.prototype.raiseToTop=function(e){let t=Q4(this._layers,e);t!==this._layers.length-1&&(this._layers.splice(t,1),this._layers.push(e),this._update(),this.layerMoved.raiseEvent(e,this._layers.length-1,t))};_a.prototype.lowerToBottom=function(e){let t=Q4(this._layers,e);t!==0&&(this._layers.splice(t,1),this._layers.splice(0,0,e),this._update(),this.layerMoved.raiseEvent(e,0,t))};var Axe=new ie;function bxe(e,t,n,i){let r=e.globe._surface._tilesToRender,o;for(let a=0;!l(o)&&a<r.length;++a){let c=r[a];ie.contains(c.rectangle,t)&&(o=c)}if(!l(o))return;let s=o.data.imagery;for(let a=s.length-1;a>=0;--a){let c=s[a],u=c.readyImagery;if(!l(u)||!u.imageryLayer.ready)continue;let f=u.imageryLayer.imageryProvider;if(n&&!l(f.pickFeatures)||!ie.contains(u.rectangle,t))continue;let d=Axe,p=1/1024;d.west=P.lerp(o.rectangle.west,o.rectangle.east,c.textureCoordinateRectangle.x-p),d.east=P.lerp(o.rectangle.west,o.rectangle.east,c.textureCoordinateRectangle.z+p),d.south=P.lerp(o.rectangle.south,o.rectangle.north,c.textureCoordinateRectangle.y-p),d.north=P.lerp(o.rectangle.south,o.rectangle.north,c.textureCoordinateRectangle.w+p),ie.contains(d,t)&&i(u)}}_a.prototype.pickImageryLayers=function(e,t){let n=t.globe.pick(e,t);if(!l(n))return;let i=t.ellipsoid.cartesianToCartographic(n),r=[];if(bxe(t,i,!1,function(o){r.push(o.imageryLayer)}),r.length!==0)return r};var bmt=new ie,xmt=new ie,DQ=new U,RQ=new U,Tmt=new he,Emt=new he;function Cmt(e,t,n,i){let r=n.imageryProvider.tilingScheme,o=r.rectangleToNativeRectangle(e,bmt),s=1/1024,a=xmt;a.west=P.lerp(o.west,o.east,t.minX-s),a.east=P.lerp(o.west,o.east,t.maxX+s),a.south=P.lerp(o.south,o.north,t.minY-s),a.north=P.lerp(o.south,o.north,t.maxY+s),l(i)||(i=new ie);let c=r.projection;if(c instanceof ji)return i.west=P.toRadians(a.west),i.south=P.toRadians(a.south),i.east=P.toRadians(a.east),i.north=P.toRadians(a.north),i;DQ.x=a.west,DQ.y=a.south,RQ.x=a.east,RQ.y=a.north;let u=c.unproject(DQ,Tmt),f=c.unproject(RQ,Emt);return i.west=u.longitude,i.south=u.latitude,i.east=f.longitude,i.north=f.latitude,i}function vmt(e,t,n){let i=e._modelImagery;if(!l(i))return;let r=i._modelPrimitiveImageries;if(l(r))for(let o=0;o<r.length;o++){let s=r[o],a=s._coveragesPerLayer;if(l(a))for(let c=a.length-1;c>=0;--c){let u=a[c];for(let f=0;f<u.length;f++){let d=u[f],p=d.imagery,g=p.imageryLayer,m=g.imageryProvider;if(!l(m.pickFeatures)||!l(p)||p.state!==jn.READY||!ie.contains(p.rectangle,t))continue;let A=s.mappedPositionsForImageryLayer(g).cartographicBoundingRectangle,b=Cmt(A,d.textureCoordinateRectangle,g,Axe);ie.contains(b,t)&&n(p)}}}}_a.prototype.pickImageryLayerFeatures=function(e,t){let n;l(t.globe)&&(n=t.globe.pick(e,t));let i;if(!l(n)){let c=t.pickFromRay(e);if(!l(c)||(n=c.position,!l(n)))return;l(c.object)&&l(c.object.detail)&&(i=c.object.detail.model)}let r=t.ellipsoid.cartesianToCartographic(n),o=[],s=[];function a(c){if(!c.imageryLayer.ready)return;let f=c.imageryLayer.imageryProvider.pickFeatures(c.x,c.y,c.level,r.longitude,r.latitude);l(f)&&(o.push(f),s.push(c.imageryLayer))}if(l(t.globe)&&bxe(t,r,!0,function(c){a(c)}),l(i)&&vmt(i,r,function(c){a(c)}),o.length!==0)return Promise.all(o).then(function(c){let u=[];for(let f=0;f<c.length;++f){let d=c[f],p=s[f];if(l(d)&&d.length>0)for(let g=0;g<d.length;++g){let m=d[g];m.imageryLayer=p,l(m.position)||(m.position=r),u.push(m)}}return u})};_a.prototype.queueReprojectionCommands=function(e){let t=this._layers;for(let n=0,i=t.length;n<i;++n)t[n].queueReprojectionCommands(e)};_a.prototype.cancelReprojections=function(){let e=this._layers;for(let t=0,n=e.length;t<n;++t)e[t].cancelReprojections()};_a.prototype.isDestroyed=function(){return!1};_a.prototype.destroy=function(){return this.removeAll(!0),le(this)};_a.prototype._update=function(){let e=!0,t=this._layers,n,i,r,o;for(r=0,o=t.length;r<o;++r)i=t[r],i._layerIndex=r,i.show?(i._isBaseLayer=e,e=!1):i._isBaseLayer=!1,i.show!==i._show&&(l(i._show)&&(l(n)||(n=[]),n.push(i)),i._show=i.show);if(l(n))for(r=0,o=n.length;r<o;++r)i=n[r],this.layerShownOrHidden.raiseEvent(i,i._layerIndex,i.show)};var eS=_a;function ro(e){e=e??H.EMPTY_OBJECT,this._url=void 0,this._basePath=void 0,this._root=void 0,this._resource=void 0,this._asset=void 0,this._properties=void 0,this._geometricError=void 0,this._scaledGeometricError=void 0,this._extensionsUsed=void 0,this._extensions=void 0,this._modelUpAxis=void 0,this._modelForwardAxis=void 0,this._cache=new W4,this._externalTilesetTiles=[],this._externalTilesetSweepIndex=0,this._externalTilesetSweepCount=8,this._externalTilesetIdleFrames=e.externalTilesetIdleFrames??120,this._processingQueue=[],this._selectedTiles=[],this._emptyTiles=[],this._requestedTiles=[],this._selectedTilesToStyle=[],this._loadTimestamp=void 0,this._timeSinceLoad=0,this._updatedVisibilityFrame=0,this._updatedModelMatrixFrame=0,this._modelMatrixChanged=!1,this._previousModelMatrix=void 0,this._extras=void 0,this._credits=void 0,this._showCreditsOnScreen=e.showCreditsOnScreen??!1,this._cullWithChildrenBounds=e.cullWithChildrenBounds??!0,this._allTilesAdditive=!0,this._hasMixedContent=!1,this._stencilClearCommand=void 0,this._backfaceCommands=new bu,this._maximumScreenSpaceError=e.maximumScreenSpaceError??16,this._memoryAdjustedScreenSpaceError=this._maximumScreenSpaceError,this._cacheBytes=e.cacheBytes??512*1024*1024;let t=e.maximumCacheOverflowBytes??512*1024*1024;this._maximumCacheOverflowBytes=t,this._styleEngine=new X4,this._styleApplied=!1,this._modelMatrix=l(e.modelMatrix)?M.clone(e.modelMatrix):M.clone(M.IDENTITY),this._addHeightCallbacks=[],this._statistics=new Pp,this._statisticsLast=new Pp,this._statisticsPerPass=new Array(po.NUMBER_OF_PASSES);for(let r=0;r<po.NUMBER_OF_PASSES;++r)this._statisticsPerPass[r]=new Pp;this._requestedTilesInFlight=[],this._maximumPriority={foveatedFactor:-Number.MAX_VALUE,depth:-Number.MAX_VALUE,distance:-Number.MAX_VALUE,reverseScreenSpaceError:-Number.MAX_VALUE},this._minimumPriority={foveatedFactor:Number.MAX_VALUE,depth:Number.MAX_VALUE,distance:Number.MAX_VALUE,reverseScreenSpaceError:Number.MAX_VALUE},this._heatmap=new Y4(e.debugHeatmapTilePropertyName),this.cullRequestsWhileMoving=e.cullRequestsWhileMoving??!0,this._cullRequestsWhileMoving=!1,this.cullRequestsWhileMovingMultiplier=e.cullRequestsWhileMovingMultiplier??60,this.progressiveResolutionHeightFraction=P.clamp(e.progressiveResolutionHeightFraction??.3,0,.5),this.preferLeaves=e.preferLeaves??!1,this._tilesLoaded=!1,this._initialTilesLoaded=!1,this._tileDebugLabels=void 0,this._classificationType=e.classificationType,this._heightReference=e.heightReference,this._scene=e.scene,this._ellipsoid=e.ellipsoid??ee.WGS84,this._initialClippingPlanesOriginMatrix=M.IDENTITY,this._clippingPlanesOriginMatrix=void 0,this._clippingPlanesOriginMatrixDirty=!0,this._vectorClassificationOnly=e.vectorClassificationOnly??!1,this._vectorKeepDecodedPositions=e.vectorKeepDecodedPositions??!1,this._imageryLayers=new eS(this),this._imageryLayersModificationCounter=0,this._imageryLayersListener=()=>{this._imageryLayersModificationCounter++},this.imageryLayers.layerAdded.addEventListener(this._imageryLayersListener),this.imageryLayers.layerRemoved.addEventListener(this._imageryLayersListener),this.imageryLayers.layerMoved.addEventListener(this._imageryLayersListener),this.imageryLayers.layerShownOrHidden.addEventListener(this._imageryLayersListener),this._asynchronouslyLoadImagery=e.asynchronouslyLoadImagery??!1,this.preloadWhenHidden=e.preloadWhenHidden??!1,this.preloadFlightDestinations=e.preloadFlightDestinations??!0,this._pass=void 0,this.dynamicScreenSpaceError=e.dynamicScreenSpaceError??!0,this.foveatedScreenSpaceError=e.foveatedScreenSpaceError??!0,this._foveatedConeSize=e.foveatedConeSize??.1,this._foveatedMinimumScreenSpaceErrorRelaxation=e.foveatedMinimumScreenSpaceErrorRelaxation??0,this.foveatedInterpolationCallback=e.foveatedInterpolationCallback??P.lerp,this.foveatedTimeDelay=e.foveatedTimeDelay??.2,this.dynamicScreenSpaceErrorDensity=e.dynamicScreenSpaceErrorDensity??2e-4,this.dynamicScreenSpaceErrorFactor=e.dynamicScreenSpaceErrorFactor??24,this.dynamicScreenSpaceErrorHeightFalloff=e.dynamicScreenSpaceErrorHeightFalloff??.25,this._dynamicScreenSpaceErrorComputedDensity=0,this.shadows=e.shadows??Dn.ENABLED,this.show=e.show??!0,this.colorBlendMode=df.HIGHLIGHT,this.colorBlendAmount=.5,this._pointCloudShading=new ng(e.pointCloudShading),this._pointCloudEyeDomeLighting=new vy,this.loadProgress=new be,this.allTilesLoaded=new be,this.initialTilesLoaded=new be,this.tileLoad=new be,this.tileUnload=new be,this.tileFailed=new be,this.tileVisible=new be,this.skipLevelOfDetail=e.skipLevelOfDetail??!1,this._disableSkipLevelOfDetail=!1,this._runtimeContentCodec=void 0,this.baseScreenSpaceError=e.baseScreenSpaceError??1024,this.skipScreenSpaceErrorFactor=e.skipScreenSpaceErrorFactor??16,this.skipLevels=e.skipLevels??1,this.immediatelyLoadDesiredLevelOfDetail=e.immediatelyLoadDesiredLevelOfDetail??!1,this.loadSiblings=e.loadSiblings??!1,this._clippingPlanes=void 0,l(e.clippingPlanes)&&Ps.setOwner(e.clippingPlanes,this,"_clippingPlanes"),this._clippingPolygons=void 0,this._clippingPolygonsNeedRebake=!1,this._removeClippingPolygonAdded=void 0,this._removeClippingPolygonRemoved=void 0,l(e.clippingPolygons)&&(Zc.setOwner(e.clippingPolygons,this,"_clippingPolygons"),vxe(this)),l(e.imageBasedLighting)?(this._imageBasedLighting=e.imageBasedLighting,this._shouldDestroyImageBasedLighting=!1):(this._imageBasedLighting=new CC,this._shouldDestroyImageBasedLighting=!0),this._environmentMapManager=new Ty(e.environmentMapOptions),this.lightColor=e.lightColor,this.backFaceCulling=e.backFaceCulling??!0,this._enableShowOutline=e.enableShowOutline??!0,this.showOutline=e.showOutline??!0,this.outlineColor=e.outlineColor??z.BLACK,this.splitDirection=e.splitDirection??Wo.NONE,this.enableCollision=e.enableCollision??!1,this.maximumHeightQueryGeometricError=e.maximumHeightQueryGeometricError??500,this._projectTo2D=e.projectTo2D??!1,this._enablePick=e.enablePick??!1,this.debugFreezeFrame=e.debugFreezeFrame??!1,this.debugColorizeTiles=e.debugColorizeTiles??!1,this._enableDebugWireframe=e.enableDebugWireframe??!1,this.debugWireframe=e.debugWireframe??!1,this.debugWireframe===!0&&this._enableDebugWireframe===!1&&yt("tileset-debug-wireframe-ignored","enableDebugWireframe must be set to true in the Cesium3DTileset constructor, otherwise debugWireframe will be ignored."),this.edgeDisplayMode=e.edgeDisplayMode??Rh.SURFACES_ONLY,this.debugShowBoundingVolume=e.debugShowBoundingVolume??!1,this.debugShowContentBoundingVolume=e.debugShowContentBoundingVolume??!1,this.debugShowViewerRequestVolume=e.debugShowViewerRequestVolume??!1,this._tileDebugLabels=void 0,this.debugPickedTileLabelOnly=!1,this.debugPickedTile=void 0,this.debugPickPosition=void 0,this.debugShowGeometricError=e.debugShowGeometricError??!1,this.debugShowRenderingStatistics=e.debugShowRenderingStatistics??!1,this.debugShowMemoryUsage=e.debugShowMemoryUsage??!1,this.debugShowUrl=e.debugShowUrl??!1,this.examineVectorLinesFunction=void 0,this._metadataExtension=void 0,this._customShader=e.customShader;let n=e.featureIdLabel??"featureId_0";typeof n=="number"&&(n=`featureId_${n}`),this._featureIdLabel=n;let i=e.instanceFeatureIdLabel??"instanceFeatureId_0";typeof i=="number"&&(i=`instanceFeatureId_${i}`),this._instanceFeatureIdLabel=i}Object.defineProperties(ro.prototype,{isCesium3DTileset:{get:function(){return!0}},asset:{get:function(){return this._asset}},extensions:{get:function(){return this._extensions}},clippingPlanes:{get:function(){return this._clippingPlanes},set:function(e){Ps.setOwner(e,this,"_clippingPlanes")}},clippingPolygons:{get:function(){return this._clippingPolygons},set:function(e){Zc.setOwner(e,this,"_clippingPolygons"),vxe(this),this._clippingPolygonsNeedRebake=!0}},imageryLayers:{get:function(){return this._imageryLayers}},imageryLayersModificationCounter:{get:function(){return this._imageryLayersModificationCounter}},asynchronouslyLoadImagery:{get:function(){return this._asynchronouslyLoadImagery}},properties:{get:function(){return this._properties}},tilesLoaded:{get:function(){return this._tilesLoaded}},resource:{get:function(){return this._resource}},basePath:{get:function(){return Yr("Cesium3DTileset.basePath","Cesium3DTileset.basePath has been deprecated. All tiles are relative to the url of the tileset JSON file that contains them. Use the url property instead."),this._basePath}},style:{get:function(){return this._styleEngine.style},set:function(e){this._styleEngine.style=e}},customShader:{get:function(){return this._customShader},set:function(e){this._customShader=e}},hasMixedContent:{get:function(){return this._hasMixedContent},set:function(e){this._hasMixedContent=e}},isSkippingLevelOfDetail:{get:function(){return this.skipLevelOfDetail&&!l(this._classificationType)&&!this._disableSkipLevelOfDetail&&!this._allTilesAdditive}},metadataExtension:{get:function(){return this._metadataExtension}},metadata:{get:function(){if(l(this._metadataExtension))return this._metadataExtension.tileset}},schema:{get:function(){if(l(this._metadataExtension))return this._metadataExtension.schema}},maximumScreenSpaceError:{get:function(){return this._maximumScreenSpaceError},set:function(e){this._maximumScreenSpaceError=e,this._memoryAdjustedScreenSpaceError=e}},cacheBytes:{get:function(){return this._cacheBytes},set:function(e){this._cacheBytes=e}},maximumCacheOverflowBytes:{get:function(){return this._maximumCacheOverflowBytes},set:function(e){this._maximumCacheOverflowBytes=e}},externalTilesetIdleFrames:{get:function(){return this._externalTilesetIdleFrames},set:function(e){this._externalTilesetIdleFrames=e}},memoryAdjustedScreenSpaceError:{get:function(){return this._memoryAdjustedScreenSpaceError}},pointCloudShading:{get:function(){return this._pointCloudShading},set:function(e){this._pointCloudShading=e}},root:{get:function(){return this._root}},boundingSphere:{get:function(){return this._root.updateTransform(this._modelMatrix),this._root.boundingSphere}},modelMatrix:{get:function(){return this._modelMatrix},set:function(e){this._modelMatrix=M.clone(e,this._modelMatrix)}},timeSinceLoad:{get:function(){return this._timeSinceLoad}},totalMemoryUsageInBytes:{get:function(){let e=this._statistics;return e.texturesByteLength+e.geometryByteLength+e.batchTableByteLength}},clippingPlanesOriginMatrix:{get:function(){return l(this._clippingPlanesOriginMatrix)?(this._clippingPlanesOriginMatrixDirty&&(M.multiply(this.root.computedTransform,this._initialClippingPlanesOriginMatrix,this._clippingPlanesOriginMatrix),this._clippingPlanesOriginMatrixDirty=!1),this._clippingPlanesOriginMatrix):M.IDENTITY}},styleEngine:{get:function(){return this._styleEngine}},statistics:{get:function(){return this._statistics}},classificationType:{get:function(){return this._classificationType}},heightReference:{get:function(){return this._heightReference}},scene:{get:function(){return this._scene}},ellipsoid:{get:function(){return this._ellipsoid}},foveatedConeSize:{get:function(){return this._foveatedConeSize},set:function(e){this._foveatedConeSize=e}},foveatedMinimumScreenSpaceErrorRelaxation:{get:function(){return this._foveatedMinimumScreenSpaceErrorRelaxation},set:function(e){this._foveatedMinimumScreenSpaceErrorRelaxation=e}},extras:{get:function(){return this._extras}},imageBasedLighting:{get:function(){return this._imageBasedLighting},set:function(e){e!==this._imageBasedLighting&&(this._shouldDestroyImageBasedLighting&&!this._imageBasedLighting.isDestroyed()&&this._imageBasedLighting.destroy(),this._imageBasedLighting=e,this._shouldDestroyImageBasedLighting=!1)}},environmentMapManager:{get:function(){return this._environmentMapManager}},vectorClassificationOnly:{get:function(){return this._vectorClassificationOnly}},vectorKeepDecodedPositions:{get:function(){return this._vectorKeepDecodedPositions}},showCreditsOnScreen:{get:function(){return this._showCreditsOnScreen},set:function(e){this._showCreditsOnScreen=e,Dxe(this)}},featureIdLabel:{get:function(){return this._featureIdLabel},set:function(e){typeof e=="number"&&(e=`featureId_${e}`),this._featureIdLabel=e}},instanceFeatureIdLabel:{get:function(){return this._instanceFeatureIdLabel},set:function(e){typeof e=="number"&&(e=`instanceFeatureId_${e}`),this._instanceFeatureIdLabel=e}}});ro.fromIonAssetId=async function(e,t){let n=await Yo.fromAssetId(e);return ro.fromUrl(n,t)};ro.fromUrl=async function(e,t){t=t??H.EMPTY_OBJECT;let n=De.createIfNeeded(e),i;n.extension==="json"?i=n.getBaseUri(!0):n.isDataUri&&(i="");let r=await ro.loadJson(n),o=await Smt(n,r),s=new ro(t);s._resource=n,s._url=n.url,s._basePath=i,s._metadataExtension=o,s._geometricError=r.geometricError,s._scaledGeometricError=r.geometricError;let a=r.asset;s._asset=a,s._extras=r.extras,Dxe(s);let c=l(r.asset.gltfUpAxis)?qi.fromName(r.asset.gltfUpAxis):qi.Y,u=t.modelUpAxis??c,f=t.modelForwardAxis??qi.X;s._properties=r.properties,s._extensionsUsed=r.extensionsUsed,s._extensions=r.extensions,s._modelUpAxis=u,s._modelForwardAxis=f,s._root=s.loadTileset(n,r);let p=s._root.createBoundingVolume(r.root.boundingVolume,M.IDENTITY).boundingSphere.center,g=s._ellipsoid.cartesianToCartographic(p);return l(g)&&g.height>Ni._defaultMinTerrainHeight&&(s._initialClippingPlanesOriginMatrix=At.eastNorthUpToFixedFrame(p)),s._clippingPlanesOriginMatrix=M.clone(s._initialClippingPlanesOriginMatrix),s};ro.loadJson=function(e){return De.createIfNeeded(e).fetchJson()};ro.prototype.makeStyleDirty=function(){this._styleEngine.makeDirty()};ro.prototype.loadTileset=function(e,t,n){let i=t.asset;if(!l(i))throw new oe("Tileset must have an asset property.");if(i.version!=="0.0"&&i.version!=="1.0"&&i.version!=="1.1")throw new oe("The tileset must be 3D Tiles version 0.0, 1.0, or 1.1");l(t.extensionsRequired)&&ro.checkSupportedExtensions(t.extensionsRequired);let r=this._statistics;l(n)&&this._externalTilesetTiles.push(n);let o=i.tilesetVersion;l(o)&&(this._basePath+=`?v=${o}`,e=e.clone(),e.setQueryParameters({v:o}));let s=xxe(this,e,t.root,n);l(n)&&(n.children.push(s),s._depth=n._depth+1);let a=[];for(a.push(s);a.length>0;){let c=a.pop();++r.numberOfTilesTotal,this._allTilesAdditive=this._allTilesAdditive&&c.refine===So.ADD;let u=c._header.children;if(l(u))for(let f=0;f<u.length;++f){let d=u[f],p=xxe(this,e,d,c);c.children.push(p),p._depth=c._depth+1,a.push(p)}this._cullWithChildrenBounds&&H4.checkChildrenWithinParent(c)}return s};function xxe(e,t,n,i){if(!(l(n.implicitTiling)||sr(n,"3DTILES_implicit_tiling")))return new Wh(e,t,n,i);let o=e.schema,s=new Cg(t,n,o),a=new vg({subdivisionScheme:s.subdivisionScheme,subtreeLevels:s.subtreeLevels,level:0,x:0,y:0,z:0}),c=s.subtreeUriTemplate.getDerivedResource({templateValues:a.getTemplateValues()}).url,f=Ze(n,!0);f.contents=[{uri:c}],delete f.content,delete f.extensions;let d=new Wh(e,t,f,i);return d.implicitTileset=s,d.implicitCoordinates=a,d}async function Smt(e,t){let n=sr(t,"3DTILES_metadata")?t.extensions["3DTILES_metadata"]:t,i;if(l(n.schemaUri))e=e.getDerivedResource({url:n.schemaUri}),i=Bi.getSchemaLoader({resource:e});else if(l(n.schema))i=Bi.getSchemaLoader({schema:n.schema});else return;await i.load();let r=new Zv({schema:i.schema,metadataJson:n});return Bi.unload(i),r}var Txe=new h,wmt=new he,Imt=new M,Pmt=new h,Dmt=new h,Rmt=new h,Omt=new h;function Mmt(e,t){let n,i,r,o,s,a=t.camera,c=e._root,u=c.contentBoundingVolume;if(u instanceof Md)n=h.normalize(a.positionWC,Txe),i=a.directionWC,r=a.positionCartographic.height,o=u.minimumHeight,s=u.maximumHeight;else{let y=M.inverseTransformation(c.computedTransform,Imt),A=t.mapProjection.ellipsoid,b=u.boundingVolume,x=M.multiplyByPoint(y,b.center,Pmt);if(h.magnitude(x)>A.minimumRadius){let T=he.fromCartesian(x,A,wmt);n=h.normalize(a.positionWC,Txe),i=a.directionWC,r=a.positionCartographic.height,o=0,s=T.height*2}else{let T=M.multiplyByPoint(y,a.positionWC,Dmt);if(n=h.UNIT_Z,i=M.multiplyByPointAsVector(y,a.directionWC,Rmt),i=h.normalize(i,i),r=T.z,u instanceof xf){let E=$.getColumn(b.halfAxes,2,Omt),v=h.magnitude(E);o=x.z-v,s=x.z+v}else if(u instanceof Yy){let E=b.radius;o=x.z-E,s=x.z+E}}}let f=e.dynamicScreenSpaceErrorHeightFalloff,d=o+(s-o)*f,p=s,g=P.clamp((r-d)/(p-d),0,1),m=1-Math.abs(h.dot(i,n));m=m*(1-g),e._dynamicScreenSpaceErrorComputedDensity=e.dynamicScreenSpaceErrorDensity*m}function Nmt(e,t){if(t.hasEmptyContent)return;let{statistics:n}=e,i=t.contentExpired,r=t.requestContent();l(r)&&(r.then(o=>{!l(o)||t.isDestroyed()||e.isDestroyed()||(e._processingQueue.push(t),++n.numberOfTilesProcessing)}).catch(o=>{Sxe(o,e,t)}),i&&(t.hasTilesetContent||t.hasImplicitContent?Ixe(e,t):(n.decrementLoadCounts(t.content),--n.numberOfTilesWithContentReady)),e._requestedTilesInFlight.push(t))}function Cxe(e,t){return e._priority-t._priority}ro.prototype.postPassesUpdate=function(e){l(this._root)&&(Lmt(this,e),Qmt(this,e),this._cache.unloadTiles(this,Pxe),Jmt(this,e),this._styleApplied&&this._styleEngine.resetDirty(),this._styleApplied=!1)};function vxe(e){e._removeClippingPolygonAdded=e._removeClippingPolygonAdded&&e._removeClippingPolygonAdded(),e._removeClippingPolygonRemoved=e._removeClippingPolygonRemoved&&e._removeClippingPolygonRemoved();let t=e._clippingPolygons;if(!l(t))return;let n=()=>{e._clippingPolygonsNeedRebake=!0};e._removeClippingPolygonAdded=t.polygonAdded.addEventListener(n),e._removeClippingPolygonRemoved=t.polygonRemoved.addEventListener(n)}ro.prototype.prePassesUpdate=function(e){if(!l(this._root))return;jmt(this,e);let t=this._clippingPlanes;this._clippingPlanesOriginMatrixDirty=!0,l(t)&&t.enabled&&t.update(e);let n=this._clippingPolygons;l(n)&&n.enabled&&n.update(e),this._clippingPolygonsNeedRebake&&(this._clippingPolygonsNeedRebake=!1,this._cache.forEachLoadedTile(i=>{i.clippingPolygonsNeedRebake=!0})),l(this._loadTimestamp)||(this._loadTimestamp=K.clone(e.time)),this._timeSinceLoad=Math.max(K.secondsDifference(e.time,this._loadTimestamp)*1e3,0),this.dynamicScreenSpaceError&&Mmt(this,e),e.newFrame&&this._cache.reset()};function Lmt(e,t){let n=e._requestedTilesInFlight,i=0;for(let r=0;r<n.length;++r){let o=n[r],s=t.frameNumber-o._touchedFrame>=1;if(o._contentState!==Mr.LOADING){++i;continue}else if(s){o.cancelRequests(),++i;continue}i>0&&(n[r-i]=o)}n.length-=i}function Fmt(e){let t=e._requestedTiles;t.sort(Cxe);for(let n=0;n<t.length;++n)Nmt(e,t[n])}function Sxe(e,t,n){if(t.isDestroyed())return;let i;n.isDestroyed()||(i=n._contentResource.url);let r=l(e.message)?e.message:e.toString();t.tileFailed.numberOfListeners>0?t.tileFailed.raiseEvent({url:i,message:r}):(console.log(`A 3D tile failed to load: ${i}`),console.log(`Error: ${r}`),console.log(e.stack))}function Bmt(e){let t=e._processingQueue,n=0;for(let i=0;i<t.length;++i){let r=t[i];if(r.isDestroyed()||r._contentState!==Mr.PROCESSING){++n;continue}n>0&&(t[i-n]=r)}t.length-=n}var kmt=new he,Umt=new he,zmt=new h;function Vmt(e,t,n){if(!e.enableCollision||!e.show||t._wasSelectedLastFrame)return;let i=e._addHeightCallbacks,r=t.boundingSphere,o=i.length;for(let s=0;s<o;++s){let a=i[s];if(a.invoked)continue;let c=a.ellipsoid,u=he.clone(a.positionCartographic,kmt),f=he.fromCartesian(r.center,c,Umt);l(f)&&(u.height=f.height);let d=he.toCartesian(u,c,zmt);h.distance(d,r.center)<=r.radius&&(a.invoked=!0,n.afterRender.push(()=>{l(a.callback)&&a.callback(),a.invoked=!1}))}}function jmt(e,t){Bmt(e);let n=e._processingQueue,{cacheBytes:i,maximumCacheOverflowBytes:r,statistics:o}=e,s=i+r,a=!1;for(let c=0;c<n.length;++c){if(e.totalMemoryUsageInBytes>s){a=!0;break}let u=n[c];try{u.process(e,t),u.contentReady&&(--o.numberOfTilesProcessing,e.tileLoad.raiseEvent(u))}catch(f){--o.numberOfTilesProcessing,Sxe(f,e,u)}}e.totalMemoryUsageInBytes<i?Gmt(e):a&&n.length>0&&Hmt(e)}function Hmt(e){e._memoryAdjustedScreenSpaceError*=1.02;let t=e._processingQueue;for(let n=0;n<t.length;++n)t[n].updatePriority();t.sort(Cxe)}function Gmt(e){e._memoryAdjustedScreenSpaceError=Math.max(e.memoryAdjustedScreenSpaceError/1.02,e.maximumScreenSpaceError)}var e8=new h,Wmt={maximumFractionDigits:3};function Exe(e){let t=e/1048576;return t<1?t.toLocaleString(void 0,Wmt):Math.round(t).toLocaleString()}function OQ(e){let{halfAxes:t,radius:n,center:i}=e.boundingVolume.boundingVolume,r=h.clone(i,e8);if(l(t))r.x+=.75*(t[0]+t[3]+t[6]),r.y+=.75*(t[1]+t[4]+t[7]),r.z+=.75*(t[2]+t[5]+t[8]);else if(l(n)){let o=h.normalize(i,e8);o=h.multiplyByScalar(o,.75*n,e8),r=h.add(o,i,e8)}return r}function MQ(e,t,n){let i="",r=0;if(t.debugShowGeometricError&&(i+=` +Please retile your tileset with the KHR_gaussian_splatting and KHR_gaussian_splatting_compression_spz_2 extensions.`)),n}get featuresLength(){return 0}get pointsLength(){return this.gltfPrimitive.attributes[0].count}get trianglesLength(){return 0}get geometryByteLength(){return 0}get texturesByteLength(){let t=this._tileset?.gaussianSplatPrimitive;if(!l(t))return 0;let n=t.gaussianSplatTexture,i=t.selectedTileLength;return!l(n)||i===0?0:n.sizeInBytes/i}get batchTableByteLength(){return 0}get innerContents(){}get ready(){return this._ready}get transformed(){return this._transformed}get tileset(){return this._tileset}get tile(){return this._tile}get url(){return this._resource.getUrlComponent(!0)}get batchTable(){}get metadata(){return this._metadata}set metadata(t){this._metadata=t}get group(){return this._group}set group(t){this._group=t}get positions(){return this._positions}get rotations(){return this._rotations}get scales(){return this._scales}get sphericalHarmonicsCoefficientCount(){return this._sphericalHarmonicsCoefficientCount}get sphericalHarmonicsDegree(){return this._sphericalHarmonicsDegree}get packedSphericalHarmonicsData(){return this._packedSphericalHarmonicsData}static async fromGltf(t,n,i,r){let o=i,s=De.createIfNeeded(o),a={releaseGltfJson:!1,upAxis:qi.Y,forwardAxis:qi.Z};l(r.asset)?(a.gltfJson=r,a.baseResource=s,a.gltfResource=s):r instanceof Uint8Array?(a.typedArray=r,a.baseResource=s,a.gltfResource=s):a.gltfResource=De.createIfNeeded(r);let c=new wd(a);try{await c.load()}catch(u){throw c.destroy(),new oe(`Failed to load glTF: ${u.message}`)}return new e(c,t,n,i)}update(t,n){let i=this._loader;if(!this._ready){if(n.afterRender.push(()=>!0),!l(i)){this._ready=!0;return}if(this._resourcesLoaded){this.gltfPrimitive=i.components.scene.nodes[0].primitives[0],this.worldTransform=i.components.scene.nodes[0].matrix,this._ready=!0,this._positions=xt.getAttributeBySemantic(this.gltfPrimitive,ct.POSITION).typedArray.slice(),this._rotations=xt.getAttributeBySemantic(this.gltfPrimitive,ct.ROTATION).typedArray.slice(),this._scales=xt.getAttributeBySemantic(this.gltfPrimitive,ct.SCALE).typedArray.slice();let{l:r,n:o}=_gt(this.gltfPrimitive.attributes);this._sphericalHarmonicsDegree=r,this._sphericalHarmonicsCoefficientCount=o,this._packedSphericalHarmonicsData=xgt(this);return}this._resourcesLoaded=i.process(n)}}hasProperty(t,n){return!1}getFeature(t){}applyDebugSettings(t,n){}applyStyle(t){}pick(t,n,i){}isDestroyed(){return this.isDestroyed}destroy(){return this.splatPrimitive=void 0,this._tile=void 0,this._tileset=void 0,this._resource=void 0,this._ready=!1,this._group=void 0,this._metadata=void 0,this._resourcesLoaded=!1,this._lastSplatTransform=void 0,l(this._loader)&&(this._loader.destroy(),this._loader=void 0),le(this)}};function ggt(e){return`${e.startsWith("KHR_gaussian_splatting:")?"KHR_gaussian_splatting:":"_"}SH_DEGREE_`}function _gt(e){switch(e.filter(n=>n.name.includes("SH_DEGREE_")).length){default:case 0:return{l:0,n:0};case 3:return{l:1,n:9};case 8:return{l:2,n:24};case 15:return{l:3,n:45}}}var vEe=new ArrayBuffer(4),ygt=new Float32Array(vEe),Agt=new Uint32Array(vEe);function ZQ(e){ygt[0]=e;let t=Agt[0],n=t>>31&1,i=t>>23&255,r=t&8388607,o;if(i===255)o=n<<15|31744|(r?512:0);else if(i===0)o=n<<15;else{let s=i-127+15;s>=31?o=n<<15|31744:s<=0?o=n<<15:o=n<<15|s<<10|r>>>13}return o}function bgt(e){let t=ggt(e),n="_COEF_",i=t.length,r=e.indexOf(n,i),o=parseInt(e.slice(i,r),10),s=parseInt(e.slice(r+n.length),10);return{l:o,n:s}}function xgt(e){let t=e.sphericalHarmonicsDegree,n=e.sphericalHarmonicsCoefficientCount,i=e.pointsLength*(n*(2/3)),r=new Uint32Array(i),o=e.gltfPrimitive.attributes.filter(u=>u.name.includes("SH_DEGREE_")),s=0,a=[0,9,24];switch(t){case 1:s=9;break;case 2:s=24;break;case 3:s=45;break}o.sort((u,f)=>u.name<f.name?-1:u.name>f.name?1:0);let c=s*(2/3);for(let u=0;u<o.length;u++){let{l:f,n:d}=bgt(o[u].name);for(let p=0;p<e.pointsLength;p++){let g=a[f-1]*2/3,m=p*c+g+d*2,y=p*3;r[m]=ZQ(o[u].typedArray[y])|ZQ(o[u].typedArray[y+1])<<16,r[m+1]=ZQ(o[u].typedArray[y+2])}}return r}var Vx=QQ;var SEe={b3dm:function(e,t,n,i,r){return Nd.fromB3dm(e,t,n,i,r)},pnts:function(e,t,n,i,r){return Nd.fromPnts(e,t,n,i,r)},i3dm:function(e,t,n,i,r){return Nd.fromI3dm(e,t,n,i,r)},cmpt:function(e,t,n,i,r){return Z4.fromTileType(e,t,n,i,r,SEe)},externalTileset:function(e,t,n,i){return u8.fromJson(e,t,n,i)},geom:function(e,t,n,i,r){return new o8(e,t,n,i,r)},vctr:function(e,t,n,i,r){return new _8(e,t,n,i,r)},subt:function(e,t,n,i,r){return k1.fromSubtreeJson(e,t,n,void 0,i,r)},subtreeJson:function(e,t,n,i){return k1.fromSubtreeJson(e,t,n,i)},glb:function(e,t,n,i,r){if(i.byteLength<12)throw new oe("Invalid glb content");let a=new DataView(i,r).getUint32(8,!0),c=new Uint8Array(i,r,a);return Vx.tilesetRequiresGaussianSplattingExt(e)?Vx.fromGltf(e,t,n,c):e.hasExtension("3DTILES_content_gltf_vector")||e.isGltfExtensionUsed("CESIUM_mesh_vector")?Ux.fromGltf(e,t,n,c):Nd.fromGltf(e,t,n,c)},gltf:function(e,t,n,i){return Vx.tilesetRequiresGaussianSplattingExt(e)?Vx.fromGltf(e,t,n,i):e.hasExtension("3DTILES_content_gltf_vector")||e.isGltfExtensionUsed("CESIUM_mesh_vector")?Ux.fromGltf(e,t,n,i):Nd.fromGltf(e,t,n,i)},geoJson:function(e,t,n,i){return Nd.fromGeoJson(e,t,n,i)}},CS=SEe;var wEe={UNLOADED:0,LOADING:1,PROCESSING:2,READY:3,EXPIRED:4,FAILED:5};Object.freeze(wEe);var Mr=wEe;var Bd={BATCHED_3D_MODEL:"b3dm",INSTANCED_3D_MODEL:"i3dm",COMPOSITE:"cmpt",POINT_CLOUD:"pnts",VECTOR:"vctr",GEOMETRY:"geom",GLTF:"gltf",GLTF_BINARY:"glb",IMPLICIT_SUBTREE:"subt",IMPLICIT_SUBTREE_JSON:"subtreeJson",EXTERNAL_TILESET:"externalTileset",MULTIPLE_CONTENT:"multipleContent",GEOJSON:"geoJson",VOXEL_BINARY:"voxl",VOXEL_JSON:"voxelJson"};Bd.isBinaryFormat=function(e){switch(e){case Bd.BATCHED_3D_MODEL:case Bd.INSTANCED_3D_MODEL:case Bd.COMPOSITE:case Bd.POINT_CLOUD:case Bd.VECTOR:case Bd.GEOMETRY:case Bd.IMPLICIT_SUBTREE:case Bd.VOXEL_BINARY:case Bd.GLTF_BINARY:return!0;default:return!1}};Object.freeze(Bd);var za=Bd;var IEe={NOT_COMPUTED:-1,USE_OPTIMIZATION:1,SKIP_OPTIMIZATION:0};Object.freeze(IEe);var tm=IEe;var _a={RENDER:0,PICK:1,SHADOW:2,PRELOAD:3,PRELOAD_FLIGHT:4,REQUEST_RENDER_MODE_DEFER_CHECK:5,MOST_DETAILED_PRELOAD:6,MOST_DETAILED_PICK:7,NUMBER_OF_PASSES:8},Sg=new Array(_a.NUMBER_OF_PASSES);Sg[_a.RENDER]=Object.freeze({pass:_a.RENDER,isRender:!0,requestTiles:!0,ignoreCommands:!1});Sg[_a.PICK]=Object.freeze({pass:_a.PICK,isRender:!1,requestTiles:!1,ignoreCommands:!1});Sg[_a.SHADOW]=Object.freeze({pass:_a.SHADOW,isRender:!1,requestTiles:!0,ignoreCommands:!1});Sg[_a.PRELOAD]=Object.freeze({pass:_a.PRELOAD,isRender:!1,requestTiles:!0,ignoreCommands:!0});Sg[_a.PRELOAD_FLIGHT]=Object.freeze({pass:_a.PRELOAD_FLIGHT,isRender:!1,requestTiles:!0,ignoreCommands:!0});Sg[_a.REQUEST_RENDER_MODE_DEFER_CHECK]=Object.freeze({pass:_a.REQUEST_RENDER_MODE_DEFER_CHECK,isRender:!1,requestTiles:!0,ignoreCommands:!0});Sg[_a.MOST_DETAILED_PRELOAD]=Object.freeze({pass:_a.MOST_DETAILED_PRELOAD,isRender:!1,requestTiles:!0,ignoreCommands:!0});Sg[_a.MOST_DETAILED_PICK]=Object.freeze({pass:_a.MOST_DETAILED_PICK,isRender:!1,requestTiles:!1,ignoreCommands:!1});_a.getPassOptions=function(e){return Sg[e]};Object.freeze(_a);var po=_a;var eee=class{constructor(t,n){this._tileset=t,this._tile=n,this.featurePropertiesDirty=!1}get featuresLength(){return 0}get pointsLength(){return 0}get trianglesLength(){return 0}get geometryByteLength(){return 0}get texturesByteLength(){return 0}get batchTableByteLength(){return 0}get innerContents(){}get ready(){return!0}get tileset(){return this._tileset}get tile(){return this._tile}get url(){}get metadata(){}set metadata(t){}get batchTable(){}get group(){}set group(t){}hasProperty(t,n){return!1}getFeature(t){}applyDebugSettings(t,n){}applyStyle(t){}update(t,n){}pick(t,n,i){}isDestroyed(){return!1}destroy(){return le(this)}},wg=eee;function Ig(e){e=e??H.EMPTY_OBJECT;let t=e.content,n=e.class;this._class=n,this._properties=t.properties,this._extensions=t.extensions,this._extras=t.extras}Object.defineProperties(Ig.prototype,{class:{get:function(){return this._class}},extras:{get:function(){return this._extras}},extensions:{get:function(){return this._extensions}}});Ig.prototype.hasProperty=function(e){return Xn.hasProperty(e,this._properties,this._class)};Ig.prototype.hasPropertyBySemantic=function(e){return Xn.hasPropertyBySemantic(e,this._properties,this._class)};Ig.prototype.getPropertyIds=function(e){return Xn.getPropertyIds(this._properties,this._class,e)};Ig.prototype.getProperty=function(e){return Xn.getProperty(e,this._properties,this._class)};Ig.prototype.setProperty=function(e,t){return Xn.setProperty(e,t,this._properties,this._class)};Ig.prototype.getPropertyBySemantic=function(e){return Xn.getPropertyBySemantic(e,this._properties,this._class)};Ig.prototype.setPropertyBySemantic=function(e,t){return Xn.setPropertyBySemantic(e,t,this._properties,this._class)};var M8=Ig;function tee(e,t){let n=lr(t,"3DTILES_metadata")?t.extensions["3DTILES_metadata"]:t.metadata;if(!l(n))return;if(!l(e.schema)){tee._oneTimeWarning("findContentMetadata-missing-root-schema","Could not find a metadata schema for content metadata. For tilesets that contain external tilesets, make sure the schema is added to the root tileset.json.");return}let i=e.schema.classes??H.EMPTY_OBJECT;if(l(n.class)){let r=i[n.class];return new M8({content:n,class:r})}}tee._oneTimeWarning=yt;var vS=tee;function Tgt(e,t){let n=e.metadataExtension;if(!l(n))return;let i=n.groups,r=lr(t,"3DTILES_metadata")?t.extensions["3DTILES_metadata"].group:t.group;if(typeof r=="number")return i[r];let o=n.groupIds.findIndex(function(s){return s===r});return o>=0?i[o]:void 0}var SS=Tgt;function Pg(e){e=e??H.EMPTY_OBJECT;let t=e.tile,n=e.class;this._class=n,this._properties=t.properties,this._extensions=t.extensions,this._extras=t.extras}Object.defineProperties(Pg.prototype,{class:{get:function(){return this._class}},extras:{get:function(){return this._extras}},extensions:{get:function(){return this._extensions}}});Pg.prototype.hasProperty=function(e){return Xn.hasProperty(e,this._properties,this._class)};Pg.prototype.hasPropertyBySemantic=function(e){return Xn.hasPropertyBySemantic(e,this._properties,this._class)};Pg.prototype.getPropertyIds=function(e){return Xn.getPropertyIds(this._properties,this._class,e)};Pg.prototype.getProperty=function(e){return Xn.getProperty(e,this._properties,this._class)};Pg.prototype.setProperty=function(e,t){return Xn.setProperty(e,t,this._properties,this._class)};Pg.prototype.getPropertyBySemantic=function(e){return Xn.getPropertyBySemantic(e,this._properties,this._class)};Pg.prototype.setPropertyBySemantic=function(e,t){return Xn.setPropertyBySemantic(e,t,this._properties,this._class)};var N8=Pg;function nee(e,t){let n=lr(t,"3DTILES_metadata")?t.extensions["3DTILES_metadata"]:t.metadata;if(!l(n))return;if(!l(e.schema)){nee._oneTimeWarning("findTileMetadata-missing-root-schema","Could not find a metadata schema for tile metadata. For tilesets that contain external tilesets, make sure the schema is added to the root tileset.json.");return}let i=e.schema.classes??H.EMPTY_OBJECT;if(l(n.class)){let r=i[n.class];return new N8({tile:n,class:r})}}nee._oneTimeWarning=yt;var L8=nee;function Egt(e){let t=new Uint8Array(e),n=yp(t);if(n==="glTF"&&(n="glb"),za.isBinaryFormat(n))return{contentType:n,binaryPayload:t};let i=Cgt(t);if(l(i.root))return{contentType:za.EXTERNAL_TILESET,jsonPayload:i};if(l(i.asset))return{contentType:za.GLTF,jsonPayload:i};if(l(i.tileAvailability))return{contentType:za.IMPLICIT_SUBTREE_JSON,jsonPayload:i};if(l(i.type))return{contentType:za.GEOJSON,jsonPayload:i};if(l(i.voxelTable))return{contentType:za.VOXEL_JSON,jsonPayload:i};throw new oe("Invalid tile content.")}function Cgt(e){let t;try{t=Fo(e)}catch{throw new oe("Invalid tile content.")}return t}var Jy=Egt;var iee=class{constructor(t,n,i,r){this._tileset=t,this._tile=n,this._tilesetResource=i,this._contents=[],this._contentsCreated=!1;let o=l(r.contents)?r.contents:r.content;this._innerContentHeaders=o,this._requestsInFlight=0,this._cancelCount=0,this._externalTilesetCount=0;let s=this._innerContentHeaders.length;this._arrayFetchPromises=new Array(s),this._requests=new Array(s),this._ready=!1,this._innerContentResources=new Array(s),this._serverKeys=new Array(s);for(let a=0;a<s;a++){let c=i.getDerivedResource({url:o[a].uri}),u=El.getServerKey(c.getUrlComponent());this._innerContentResources[a]=c,this._serverKeys[a]=u}}get featurePropertiesDirty(){let t=this._contents,n=t.length;for(let i=0;i<n;++i)if(t[i].featurePropertiesDirty)return!0;return!1}set featurePropertiesDirty(t){let n=this._contents,i=n.length;for(let r=0;r<i;++r)n[r].featurePropertiesDirty=t}get featuresLength(){return 0}get pointsLength(){return 0}get trianglesLength(){return 0}get geometryByteLength(){return 0}get texturesByteLength(){return 0}get batchTableByteLength(){return 0}get innerContents(){return this._contents}get ready(){return this._contentsCreated?this._ready:!1}get tileset(){return this._tileset}get tile(){return this._tile}get url(){}get metadata(){}set metadata(t){}get batchTable(){}get group(){}set group(t){}get innerContentUrls(){return this._innerContentHeaders.map(function(t){return t.uri})}requestInnerContents(){if(!vgt(this._serverKeys)){this.tileset.statistics.numberOfAttemptedRequests+=this._serverKeys.length;return}let t=this._innerContentHeaders;ree(this,t.length);let n=this._cancelCount;for(let i=0;i<t.length;i++)this._arrayFetchPromises[i]=Sgt(this,i,n,this._tile._contentState);return wgt(this)}cancelRequests(){for(let t=0;t<this._requests.length;t++){let n=this._requests[t];l(n)&&n.cancel()}}hasProperty(t,n){return!1}getFeature(t){}applyDebugSettings(t,n){let i=this._contents,r=i.length;for(let o=0;o<r;++o)i[o].applyDebugSettings(t,n)}applyStyle(t){let n=this._contents,i=n.length;for(let r=0;r<i;++r)n[r].applyStyle(t)}update(t,n){let i=this._contents,r=i.length,o=!0;for(let s=0;s<r;++s)i[s].update(t,n),o=o&&i[s].ready;!this._ready&&o&&(this._ready=!0)}pick(t,n,i){if(!this._ready)return;let r,o=Number.POSITIVE_INFINITY,s=this._contents,a=s.length;for(let c=0;c<a;++c){let u=s[c].pick(t,n,i);if(!l(u))continue;let f=h.distance(t.origin,u);f<o&&(r=u,o=f)}if(l(r))return i}isDestroyed(){return!1}destroy(){let t=this._contents,n=t.length;for(let i=0;i<n;++i)t[i].destroy();return le(this)}};function ree(e,t){e._requestsInFlight+=t,e.tileset.statistics.numberOfPendingRequests+=t}function PEe(e,t){e._cancelCount++,e._tile._contentState=t;let n=e.tileset.statistics;n.numberOfPendingRequests-=e._requestsInFlight,n.numberOfAttemptedRequests+=e._requestsInFlight,e._requestsInFlight=0;let i=e._innerContentHeaders.length;e._arrayFetchPromises=new Array(i)}function vgt(e){let t={};for(let n=0;n<e.length;n++){let i=e[n];l(t[i])?t[i]++:t[i]=1}for(let n in t)if(t.hasOwnProperty(n)&&!El.serverHasOpenSlots(n,t[n]))return!1;return El.heapHasOpenSlots(e.length)}function Sgt(e,t,n,i){let r=e._innerContentResources[t].clone(),o=e.tile,s=function(){return o._priority},a=e._serverKeys[t],c=new Oo({throttle:!0,throttleByServer:!0,type:oa.TILES3D,priorityFunction:s,serverKey:a});r.request=c,e._requests[t]=c;let u=r.fetchArrayBuffer();if(l(u))return u.then(function(f){if(!(n<e._cancelCount)){if(r.request.cancelled||r.request.state===wi.CANCELLED){PEe(e,i);return}return ree(e,-1),f}}).catch(function(f){if(!(n<e._cancelCount)){if(r.request.cancelled||r.request.state===wi.CANCELLED){PEe(e,i);return}ree(e,-1),DEe(e,t,f)}})}async function wgt(e){let t=e._cancelCount,n=await Promise.all(e._arrayFetchPromises);if(t<e._cancelCount)return;let i=n.map((o,s)=>Igt(e,o,s)),r=await Promise.all(i);if(e._contentsCreated=!0,e._contents=r.filter(l),e._externalTilesetCount===e._contents.length){let o=e._tile;o.hasRenderableContent=!1}return r}async function Igt(e,t,n){if(l(t))try{let i=Jy(t),r=e._tileset,o=e._innerContentResources[n],s=e._tile;i.contentType===za.EXTERNAL_TILESET&&(e._externalTilesetCount++,s.hasTilesetContent=!0),e._disableSkipLevelOfDetail=e._disableSkipLevelOfDetail||i.contentType===za.GEOMETRY||i.contentType===za.VECTOR;let a,c=CS[i.contentType];l(i.binaryPayload)?a=await Promise.resolve(c(r,s,o,i.binaryPayload.buffer,0)):a=await Promise.resolve(c(r,s,o,i.jsonPayload));let u=e._innerContentHeaders[n];if(s.hasImplicitContentMetadata){let d=s.implicitSubtree,p=s.implicitCoordinates;a.metadata=d.getContentMetadataView(p,n)}else s.hasImplicitContent||(a.metadata=vS(r,u));let f=SS(r,u);return l(f)&&(a.group=new dS({metadata:f})),a}catch(i){DEe(e,n,i)}}function DEe(e,t,n){let i=e._tileset,r=e._innerContentResources[t].url,o=l(n.message)?n.message:n.toString();i.tileFailed.numberOfListeners>0?i.tileFailed.raiseEvent({url:r,message:o}):(console.log(`A content failed to load: ${r}`),console.log(`Error: ${o}`))}var F8=iee;function IS(e){this.rectangle=ie.clone(e.rectangle),this.minimumHeight=e.minimumHeight??0,this.maximumHeight=e.maximumHeight??0,this.southwestCornerCartesian=new h,this.northeastCornerCartesian=new h,this.westNormal=new h,this.southNormal=new h,this.eastNormal=new h,this.northNormal=new h;let t=e.ellipsoid??ee.WGS84;Mgt(this,e.rectangle,t),this._orientedBoundingBox=void 0,this._boundingSphere=void 0,(e.computeBoundingVolumes??!0)&&this.computeBoundingVolumes(t)}Object.defineProperties(IS.prototype,{boundingVolume:{get:function(){return this._orientedBoundingBox}},boundingSphere:{get:function(){return this._boundingSphere}}});IS.prototype.computeBoundingVolumes=function(e){this._orientedBoundingBox=en.fromRectangle(this.rectangle,this.minimumHeight,this.maximumHeight,e),this._boundingSphere=ue.fromOrientedBoundingBox(this._orientedBoundingBox)};var REe=new h,B8=new h,OEe=new h,Pgt=new h,Dgt=new h,Rgt=new h,Ogt=new h,kd=new he,MEe=new sn(h.UNIT_X,0),wS=new gn;function Mgt(e,t,n){n.cartographicToCartesian(ie.southwest(t),e.southwestCornerCartesian),n.cartographicToCartesian(ie.northeast(t),e.northeastCornerCartesian),kd.longitude=t.west,kd.latitude=(t.south+t.north)*.5,kd.height=0;let i=n.cartographicToCartesian(kd,Rgt),r=h.cross(i,h.UNIT_Z,Pgt);h.normalize(r,e.westNormal),kd.longitude=t.east;let o=n.cartographicToCartesian(kd,Ogt),s=h.cross(h.UNIT_Z,o,REe);h.normalize(s,e.eastNormal);let a=h.subtract(i,o,REe);h.magnitude(a)===0&&(a=h.clone(r,a));let c=h.normalize(a,Dgt),u=t.south,f;if(u>0){kd.longitude=(t.west+t.east)*.5,kd.latitude=u;let y=n.cartographicToCartesian(kd,wS.origin);h.clone(c,wS.direction);let A=sn.fromPointNormal(e.southwestCornerCartesian,e.westNormal,MEe);xi.rayPlane(wS,A,e.southwestCornerCartesian),f=n.geodeticSurfaceNormal(y,B8)}else f=n.geodeticSurfaceNormalCartographic(ie.southeast(t),B8);let d=h.cross(f,a,OEe);h.normalize(d,e.southNormal);let p=t.north,g;if(p<0){kd.longitude=(t.west+t.east)*.5,kd.latitude=p;let y=n.cartographicToCartesian(kd,wS.origin);h.negate(c,wS.direction);let A=sn.fromPointNormal(e.northeastCornerCartesian,e.eastNormal,MEe);xi.rayPlane(wS,A,e.northeastCornerCartesian),g=n.geodeticSurfaceNormal(y,B8)}else g=n.geodeticSurfaceNormalCartographic(ie.northwest(t),B8);let m=h.cross(a,g,OEe);h.normalize(m,e.northNormal)}var Ngt=new h,Lgt=new h,Fgt=new h(0,-1,0),Bgt=new h(0,0,-1),NEe=new h;function kgt(e,t){let n=t.camera,i=n.positionWC,r=n.positionCartographic,o=0;if(!ie.contains(e.rectangle,r)){let u=e.southwestCornerCartesian,f=e.northeastCornerCartesian,d=e.westNormal,p=e.southNormal,g=e.eastNormal,m=e.northNormal;t.mode!==re.SCENE3D&&(u=t.mapProjection.project(ie.southwest(e.rectangle),Ngt),u.z=u.y,u.y=u.x,u.x=0,f=t.mapProjection.project(ie.northeast(e.rectangle),Lgt),f.z=f.y,f.y=f.x,f.x=0,d=Fgt,g=h.UNIT_Y,p=Bgt,m=h.UNIT_Z);let y=h.subtract(i,u,NEe),A=h.dot(y,d),b=h.dot(y,p),x=h.subtract(i,f,NEe),T=h.dot(x,g),E=h.dot(x,m);A>0?o+=A*A:T>0&&(o+=T*T),b>0?o+=b*b:E>0&&(o+=E*E)}let s,a,c;if(t.mode===re.SCENE3D?(s=r.height,a=e.minimumHeight,c=e.maximumHeight):(s=i.x,a=0,c=0),s>c){let u=s-c;o+=u*u}else if(s<a){let u=a-s;o+=u*u}return Math.sqrt(o)}IS.prototype.distanceToCamera=function(e){let t=kgt(this,e);if(e.mode===re.SCENE3D&&l(this._orientedBoundingBox)){let n=Math.sqrt(this._orientedBoundingBox.distanceSquaredTo(e.camera.positionWC));return Math.max(t,n)}return t};IS.prototype.intersectPlane=function(e){return this._orientedBoundingBox.intersectPlane(e)};IS.prototype.createDebugVolume=function(e){let t=M.clone(M.IDENTITY),n=new QC({rectangle:this.rectangle,height:this.minimumHeight,extrudedHeight:this.maximumHeight}),i=new Bt({geometry:n,id:"outline",modelMatrix:t,attributes:{color:Jt.fromColor(e)}});return new Mn({geometryInstances:i,appearance:new An({translucent:!1,flat:!0}),asynchronous:!1})};var Ud=IS;var k8=new he;function Q1(e){let t=jy.fromToken(e.token),n=e.minimumHeight??0,i=e.maximumHeight??0,r=e.ellipsoid??ee.WGS84;this.s2Cell=t,this.minimumHeight=n,this.maximumHeight=i,this.ellipsoid=r;let o=Ygt(t,n,i,r);this._boundingPlanes=o;let s=Jgt(o);this._vertices=s,this._edgeNormals=new Array(6),this._edgeNormals[0]=dee(o[0],s.slice(0,4));let a;for(a=0;a<4;a++)this._edgeNormals[0][a]=h.negate(this._edgeNormals[0][a],this._edgeNormals[0][a]);for(this._edgeNormals[1]=dee(o[1],s.slice(4,8)),a=0;a<4;a++)this._edgeNormals[2+a]=dee(o[2+a],[s[a%4],s[(a+1)%4],s[4+(a+1)%4],s[4+a]]);for(this._planeVertices=[this._vertices.slice(0,4),this._vertices.slice(4,8)],a=0;a<4;a++)this._planeVertices.push([this._vertices[a%4],this._vertices[(a+1)%4],this._vertices[4+(a+1)%4],this._vertices[4+a]]);let c=t.getCenter();k8=r.cartesianToCartographic(c,k8),k8.height=(i+n)/2,this.center=r.cartographicToCartesian(k8,c),this._boundingSphere=ue.fromPoints(s)}var Ugt=new h,zgt=new he,Vgt=new h,jgt=new he,Hgt=new h,Ggt=new h,Wgt=new h,qgt=new h;function Ygt(e,t,n,i){let r=new Array(6),o=e.getCenter(),s=i.geodeticSurfaceNormal(o,Ugt),a=i.cartesianToCartographic(o,zgt);a.height=n;let c=i.cartographicToCartesian(a,Vgt),u=sn.fromPointNormal(c,s);r[0]=u;let f=0,d,p=[],g,m;for(d=0;d<4;d++){g=e.getVertex(d),p[d]=g,m=i.cartesianToCartographic(g,jgt),m.height=t;let A=sn.getPointDistance(u,i.cartographicToCartesian(m,Hgt));A<f&&(f=A)}let y=sn.clone(u);for(y.normal=h.negate(y.normal,y.normal),y.distance=y.distance*-1+f,r[1]=y,d=0;d<4;d++){g=p[d];let A=p[(d+1)%4],b=i.geodeticSurfaceNormal(g,Ggt),x=h.subtract(A,g,qgt),T=h.cross(x,b,Wgt);T=h.normalize(T,T),r[2+d]=sn.fromPointNormal(g,T)}return r}var jx=new h,Hx=new h,Gx=new h,oee=new h,see=new h,aee=new h,Xgt=new h,Kgt=new h,$gt=new h,cee=new h,lee=new h,uee=new h,Zy=new h,kp=new $;function LEe(e,t,n){jx=e.normal,Hx=t.normal,Gx=n.normal,oee=h.multiplyByScalar(e.normal,-e.distance,oee),see=h.multiplyByScalar(t.normal,-t.distance,see),aee=h.multiplyByScalar(n.normal,-n.distance,aee),cee=h.multiplyByScalar(h.cross(Hx,Gx,Xgt),h.dot(oee,jx),cee),lee=h.multiplyByScalar(h.cross(Gx,jx,Kgt),h.dot(see,Hx),lee),uee=h.multiplyByScalar(h.cross(jx,Hx,$gt),h.dot(aee,Gx),uee),kp[0]=jx.x,kp[1]=Hx.x,kp[2]=Gx.x,kp[3]=jx.y,kp[4]=Hx.y,kp[5]=Gx.y,kp[6]=jx.z,kp[7]=Hx.z,kp[8]=Gx.z;let i=$.determinant(kp);return Zy=h.add(cee,lee,Zy),Zy=h.add(Zy,uee,Zy),new h(Zy.x/i,Zy.y/i,Zy.z/i)}function Jgt(e){let t=new Array(8);for(let n=0;n<4;n++)t[n]=LEe(e[0],e[2+(n+3)%4],e[2+n%4]),t[n+4]=LEe(e[1],e[2+(n+3)%4],e[2+n%4]);return t}var fee=new h,PS=new h;function dee(e,t){let n=[];for(let i=0;i<4;i++)fee=h.subtract(t[(i+1)%4],t[i],fee),PS=h.cross(e.normal,fee,PS),PS=h.normalize(PS,PS),n[i]=h.clone(PS);return n}Object.defineProperties(Q1.prototype,{boundingVolume:{get:function(){return this}},boundingSphere:{get:function(){return this._boundingSphere}}});var hee=new h;Q1.prototype.distanceToCamera=function(e){let t=e.camera.positionWC,n=[],i=[],r;sn.getPointDistance(this._boundingPlanes[0],t)>0?(n.push(0),i.push(this._planeVertices[0]),r=this._edgeNormals[0]):sn.getPointDistance(this._boundingPlanes[1],t)>0&&(n.push(1),i.push(this._planeVertices[1]),r=this._edgeNormals[1]);let o,s;for(o=0;o<4;o++)s=2+o,sn.getPointDistance(this._boundingPlanes[s],t)>0&&(n.push(s),i.push(this._planeVertices[s]),r=this._edgeNormals[s]);if(n.length===0)return 0;let a,c;if(n.length===1)return c=this._boundingPlanes[n[0]],a=mee(sn.projectPointOntoPlane(c,t,hee),i[0],c,r),h.distance(a,t);if(n.length===2){if(n[0]===0){let p=[this._vertices[4*n[0]+(n[1]-2)],this._vertices[4*n[0]+(n[1]-2+1)%4]];return a=FEe(t,p[0],p[1]),h.distance(a,t)}let f=Number.MAX_VALUE,d;for(o=0;o<2;o++)c=this._boundingPlanes[n[o]],a=mee(sn.projectPointOntoPlane(c,t,hee),i[o],c,this._edgeNormals[n[o]]),d=h.distanceSquared(a,t),d<f&&(f=d);return Math.sqrt(f)}else if(n.length>3)return a=mee(sn.projectPointOntoPlane(this._boundingPlanes[1],t,hee),this._planeVertices[1],this._boundingPlanes[1],this._edgeNormals[1]),h.distance(a,t);let u=n[1]===2&&n[2]===5?0:1;return n[0]===0?h.distance(t,this._vertices[(n[1]-2+u)%4]):h.distance(t,this._vertices[4+(n[1]-2+u)%4])};var Zgt=new h,Qgt=new h;function FEe(e,t,n){let i=h.subtract(n,t,Zgt),r=h.subtract(e,t,Qgt),o=h.dot(i,r);if(o<=0)return t;let s=h.dot(i,i);return o>=s?n:(o=o/s,new h((1-o)*t.x+o*n.x,(1-o)*t.y+o*n.y,(1-o)*t.z+o*n.z))}var e_t=new sn(h.UNIT_X,0);function mee(e,t,n,i){let r=Number.MAX_VALUE,o,s,a;for(let c=0;c<t.length;c++){let u=sn.fromPointNormal(t[c],i[c],e_t);sn.getPointDistance(u,e)<0||(a=FEe(e,t[c],t[(c+1)%4]),o=h.distance(e,a),o<r&&(r=o,s=a))}return l(s)?s:e}Q1.prototype.intersectPlane=function(e){let t=0,n=0;for(let i=0;i<this._vertices.length;i++)h.dot(e.normal,this._vertices[i])+e.distance<0?n++:t++;return t===this._vertices.length?$t.INSIDE:n===this._vertices.length?$t.OUTSIDE:$t.INTERSECTING};Q1.prototype.createDebugVolume=function(e){let t=M.clone(M.IDENTITY),n=new Ph({polygonHierarchy:{positions:this._planeVertices[0]}}),i=Ph.createGeometry(n),r=new Bt({geometry:i,id:"outline",modelMatrix:t,attributes:{color:Jt.fromColor(e)}}),o=new Ph({polygonHierarchy:{positions:this._planeVertices[1]}}),s=Ph.createGeometry(o),a=new Bt({geometry:s,id:"outline",modelMatrix:t,attributes:{color:Jt.fromColor(e)}}),c=[];for(let u=0;u<4;u++){let f=new Ph({polygonHierarchy:{positions:this._planeVertices[2+u]}}),d=Ph.createGeometry(f);c[u]=new Bt({geometry:d,id:"outline",modelMatrix:t,attributes:{color:Jt.fromColor(e)}})}return new Mn({geometryInstances:[c[0],c[1],c[2],c[3],a,r],appearance:new An({translucent:!1,flat:!0}),asynchronous:!1})};var U8=Q1;function DS(e){let t=e.radius??1,i={radii:new h(t,t,t),stackPartitions:e.stackPartitions,slicePartitions:e.slicePartitions,subdivisions:e.subdivisions};this._ellipsoidGeometry=new _d(i),this._workerName="createSphereOutlineGeometry"}DS.packedLength=_d.packedLength;DS.pack=function(e,t,n){return _d.pack(e._ellipsoidGeometry,t,n)};var t_t=new _d,Wx={radius:void 0,radii:new h,stackPartitions:void 0,slicePartitions:void 0,subdivisions:void 0};DS.unpack=function(e,t,n){let i=_d.unpack(e,t,t_t);return Wx.stackPartitions=i._stackPartitions,Wx.slicePartitions=i._slicePartitions,Wx.subdivisions=i._subdivisions,l(n)?(h.clone(i._radii,Wx.radii),n._ellipsoidGeometry=new _d(Wx),n):(Wx.radius=i._radii.x,new DS(Wx))};DS.createGeometry=function(e){return _d.createGeometry(e._ellipsoidGeometry)};var Qy=DS;function RS(e,t){t===0&&(t=P.EPSILON7),this._boundingSphere=new ue(e,t)}Object.defineProperties(RS.prototype,{center:{get:function(){return this._boundingSphere.center}},radius:{get:function(){return this._boundingSphere.radius}},boundingVolume:{get:function(){return this._boundingSphere}},boundingSphere:{get:function(){return this._boundingSphere}}});RS.prototype.distanceToCamera=function(e){let t=this._boundingSphere;return Math.max(0,h.distance(t.center,e.camera.positionWC)-t.radius)};RS.prototype.intersectPlane=function(e){return ue.intersectPlane(this._boundingSphere,e)};RS.prototype.update=function(e,t){h.clone(e,this._boundingSphere.center),this._boundingSphere.radius=t};RS.prototype.createDebugVolume=function(e){let t=new Qy({radius:this.radius}),n=M.fromTranslation(this.center,M.clone(M.IDENTITY)),i=new Bt({geometry:t,id:"outline",modelMatrix:n,attributes:{color:Jt.fromColor(e)}});return new Mn({geometryInstances:i,appearance:new An({translucent:!1,flat:!0}),asynchronous:!1})};var eA=RS;var n_t=new h,i_t=new h,r_t=new h,o_t=new h;function qx(e,t,n){n=h.cross(e,t,n);let i=h.magnitude(n);return h.multiplyByScalar(n,P.EPSILON7/i,n)}function pee(e,t){let n=h.normalize(e,o_t),i=h.equalsEpsilon(n,h.UNIT_X,P.EPSILON6)?h.UNIT_Y:h.UNIT_X;return qx(e,i,t)}function BEe(e){let t=$.getColumn(e,0,n_t),n=$.getColumn(e,1,i_t),i=$.getColumn(e,2,r_t),r=h.equals(t,h.ZERO),o=h.equals(n,h.ZERO),s=h.equals(i,h.ZERO);return!r&&!o&&!s?e:r&&o&&s?(e[0]=P.EPSILON7,e[4]=P.EPSILON7,e[8]=P.EPSILON7,e):(r&&!o&&!s?t=qx(n,i,t):!r&&o&&!s?n=qx(t,i,n):!r&&!o&&s?i=qx(n,t,i):r?o?s||(t=pee(i,t),n=qx(i,t,n)):(t=pee(n,t),i=qx(n,t,i)):(n=pee(t,n),i=qx(n,t,i)),$.setColumn(e,0,t,e),$.setColumn(e,1,n,e),$.setColumn(e,2,i,e),e)}function OS(e,t){t=BEe(t),this._orientedBoundingBox=new en(e,t),this._boundingSphere=ue.fromOrientedBoundingBox(this._orientedBoundingBox)}Object.defineProperties(OS.prototype,{boundingVolume:{get:function(){return this._orientedBoundingBox}},boundingSphere:{get:function(){return this._boundingSphere}}});OS.prototype.distanceToCamera=function(e){return Math.sqrt(this._orientedBoundingBox.distanceSquaredTo(e.camera.positionWC))};OS.prototype.intersectPlane=function(e){return this._orientedBoundingBox.intersectPlane(e)};OS.prototype.update=function(e,t){h.clone(e,this._orientedBoundingBox.center),t=BEe(t),$.clone(t,this._orientedBoundingBox.halfAxes),ue.fromOrientedBoundingBox(this._orientedBoundingBox,this._boundingSphere)};OS.prototype.createDebugVolume=function(e){let t=new cp({minimum:new h(-1,-1,-1),maximum:new h(1,1,1)}),n=M.fromRotationTranslation(this.boundingVolume.halfAxes,this.boundingVolume.center),i=new Bt({geometry:t,id:"outline",modelMatrix:n,attributes:{color:Jt.fromColor(e)}});return new Mn({geometryInstances:i,appearance:new An({translucent:!1,flat:!0}),asynchronous:!1})};var Sf=OS;function io(e,t,n,i){this._tileset=e,this._header=n;let r=l(n.contents),o=r&&n.contents.length>1||lr(n,"3DTILES_multiple_contents"),s=r&&!o?n.contents[0]:n.content;this._contentHeader=s,this.transform=l(n.transform)?M.unpack(n.transform):M.clone(M.IDENTITY);let a=l(i)?i.computedTransform:e.modelMatrix,c=M.multiply(a,this.transform,new M),u=l(i)?i._initialTransform:M.IDENTITY;this._initialTransform=M.multiply(u,this.transform,new M),this.computedTransform=c,this.metadata=L8(e,n),this._verticalExaggeration=1,this._verticalExaggerationRelativeHeight=0,this._boundingVolume=this.createBoundingVolume(n.boundingVolume,c),this._boundingVolume2D=void 0;let f;l(s)&&l(s.boundingVolume)&&(f=this.createBoundingVolume(s.boundingVolume,c)),this._contentBoundingVolume=f,this._contentBoundingVolume2D=void 0;let d;l(n.viewerRequestVolume)&&(d=this.createBoundingVolume(n.viewerRequestVolume,c)),this._viewerRequestVolume=d,this.geometricError=n.geometricError,this._geometricError=n.geometricError,l(this._geometricError)||(this._geometricError=l(i)?i._geometricError:e._geometricError,io._deprecationWarning("geometricErrorUndefined","Required property geometricError is undefined for this tile. Using parent's geometric error instead.")),this.updateGeometricErrorScale();let p;l(n.refine)?((n.refine==="replace"||n.refine==="add")&&io._deprecationWarning("lowercase-refine",`This tile uses a lowercase refine "${n.refine}". Instead use "${n.refine.toUpperCase()}".`),p=n.refine.toUpperCase()==="REPLACE"?Io.REPLACE:Io.ADD):l(i)?p=i.refine:p=Io.REPLACE,this.refine=p,this.children=[],this.parent=i;let g,m=!1,y,A,b;if(t=De.createIfNeeded(t),o)y=Mr.UNLOADED,A=t.clone();else if(l(s)){let v=s.uri;l(s.url)&&(io._deprecationWarning("contentUrl",'This tileset JSON uses the "content.url" property which has been deprecated. Use "content.uri" instead.'),v=s.url),v===""?(io._deprecationWarning("contentUriEmpty","content.uri property is an empty string, which creates a circular dependency, making this tileset invalid. Omit the content property instead"),g=new wg(e,this),m=!0,y=Mr.READY):(y=Mr.UNLOADED,A=t.getDerivedResource({url:v}),b=El.getServerKey(A.getUrlComponent()))}else g=new wg(e,this),m=!0,y=Mr.READY;this._content=g,this._contentResource=A,this._contentState=y,this._expiredContent=void 0,this._serverKey=b,this.hasEmptyContent=m,this.hasTilesetContent=!1,this.hasImplicitContent=!1,this.hasRenderableContent=!m,this.hasImplicitContentMetadata=!1,this.hasMultipleContents=o,this.cacheNode=void 0;let x=n.expire,T,E;l(x)&&(T=x.duration,l(x.date)&&(E=K.fromIso8601(x.date))),this.expireDuration=T,this.expireDate=E,this.lastStyleTime=0,this._optimChildrenWithinParent=tm.NOT_COMPUTED,this.clippingPlanesDirty=!1,this.clippingPolygonsDirty=!1,this.clippingPolygonsNeedRebake=!1,this.priorityDeferred=!1,this.implicitTileset=void 0,this.implicitCoordinates=void 0,this.implicitSubtree=void 0,this._distanceToCamera=0,this._centerZDepth=0,this._screenSpaceError=0,this._screenSpaceErrorProgressiveResolution=0,this._visibilityPlaneMask=0,this._visible=!1,this._inRequestVolume=!1,this._finalResolution=!0,this._depth=0,this._stackLength=0,this._selectionDepth=0,this._updatedVisibilityFrame=0,this._touchedFrame=0,this._visitedFrame=0,this._selectedFrame=0,this._wasSelectedLastFrame=!1,this._requestedFrame=0,this._ancestorWithContent=void 0,this._ancestorWithContentAvailable=void 0,this._refines=!1,this._shouldSelect=!1,this._isClipped=!0,this._isClippedByPolygon=!1,this._clippingPlanesState=0,this._clippingPolygonsState=0,this._debugBoundingVolume=void 0,this._debugContentBoundingVolume=void 0,this._debugViewerRequestVolume=void 0,this._debugColor=z.fromRandom({alpha:1}),this._debugColorizeTiles=!1,this._priority=0,this._priorityHolder=this,this._priorityProgressiveResolution=!1,this._priorityProgressiveResolutionScreenSpaceErrorLeaf=!1,this._priorityReverseScreenSpaceError=0,this._foveatedFactor=0,this._wasMinPriorityChild=!1,this._loadTimestamp=new K,this._commandsLength=0,this._color=void 0,this._colorDirty=!1,this._request=void 0}io._deprecationWarning=Yr;Object.defineProperties(io.prototype,{tileset:{get:function(){return this._tileset}},content:{get:function(){return this._content}},boundingVolume:{get:function(){return this._boundingVolume}},contentBoundingVolume:{get:function(){return this._contentBoundingVolume??this._boundingVolume}},boundingSphere:{get:function(){return this._boundingVolume.boundingSphere}},isVisible:{get:function(){return this._visible&&this._inRequestVolume}},extras:{get:function(){return this._header.extras}},color:{get:function(){return l(this._color)||(this._color=new z),z.clone(this._color)},set:function(e){this._color=z.clone(e,this._color),this._colorDirty=!0}},contentAvailable:{get:function(){return this.contentReady&&this.hasRenderableContent||l(this._expiredContent)&&!this.contentFailed}},contentReady:{get:function(){return this._contentState===Mr.READY}},contentUnloaded:{get:function(){return this._contentState===Mr.UNLOADED}},hasUnloadedRenderableContent:{get:function(){return this.hasRenderableContent&&this.contentUnloaded}},contentExpired:{get:function(){return this._contentState===Mr.EXPIRED}},contentFailed:{get:function(){return this._contentState===Mr.FAILED}},commandsLength:{get:function(){return this._commandsLength}}});var tA=new h;function s_t(e,t){let{tileset:n,boundingSphere:i}=e,{radius:r,center:o}=i,{camera:s}=t,a=h.multiplyByScalar(s.directionWC,e._centerZDepth,tA),c=h.add(s.positionWC,a,tA),u=h.subtract(c,o,tA);if(h.magnitude(u)>r){let E=h.normalize(u,tA),v=h.multiplyByScalar(E,r,tA),S=h.add(o,v,tA),I=h.subtract(S,s.positionWC,tA),R=h.normalize(I,tA);e._foveatedFactor=1-Math.abs(h.dot(s.directionWC,R))}else e._foveatedFactor=0;let p=e.refine===Io.REPLACE,g=n.isSkippingLevelOfDetail;if(p&&!g||!n.foveatedScreenSpaceError||n.foveatedConeSize===1||e._priorityProgressiveResolution&&p&&g||n._pass===po.PRELOAD_FLIGHT||n._pass===po.PRELOAD)return!1;let m=1-Math.cos(s.frustum.fov*.5),y=n.foveatedConeSize*m;if(e._foveatedFactor<=y)return!1;let A=m-y,b=P.clamp((e._foveatedFactor-y)/A,0,1),x=n.foveatedInterpolationCallback(n.foveatedMinimumScreenSpaceErrorRelaxation,n.memoryAdjustedScreenSpaceError,b),T=e._screenSpaceError===0&&l(e.parent)?e.parent._screenSpaceError*.5:e._screenSpaceError;return n.memoryAdjustedScreenSpaceError-x<=T}var HEe=new K;io.prototype.getScreenSpaceError=function(e,t,n){let i=this._tileset,r=n??1,o=l(this.parent)?this.parent.geometricError:i._scaledGeometricError,s=t?o:this.geometricError;if(s===0)return 0;let{camera:a,context:c}=e,u=a.frustum,f=c.drawingBufferWidth,d=c.drawingBufferHeight*r,p;if(e.mode===re.SCENE2D||u instanceof _n){let g=u.offCenterFrustum;l(g)&&(u=g);let m=Math.max(u.top-u.bottom,u.right-u.left)/Math.max(f,d);p=s/m}else{let g=Math.max(this._distanceToCamera,P.EPSILON7),m=u.sseDenominator;if(p=s*d/(g*m),i.dynamicScreenSpaceError){let y=i._dynamicScreenSpaceErrorComputedDensity,A=i.dynamicScreenSpaceErrorFactor,b=P.fog(g,y)*A;p-=b}}return p/=e.pixelRatio,p};function a_t(e,t){if(e.progressiveResolutionHeightFraction<=0||e.progressiveResolutionHeightFraction>.5)return!1;let n=e.memoryAdjustedScreenSpaceError,i=t._screenSpaceErrorProgressiveResolution>n;t._priorityProgressiveResolutionScreenSpaceErrorLeaf=!1;let r=t.parent,o=t._screenSpaceErrorProgressiveResolution<=n,s=l(r)&&r._screenSpaceErrorProgressiveResolution>n;return o&&s&&(t._priorityProgressiveResolutionScreenSpaceErrorLeaf=!0,i=!0),i}function c_t(e,t){let n=t.parent,r=l(n)&&(!e.isSkippingLevelOfDetail||t._screenSpaceError===0||n.hasTilesetContent||n.hasImplicitContent)?n._screenSpaceError:t._screenSpaceError;return e.root._screenSpaceError-r}io.prototype.updateVisibility=function(e){let{parent:t,tileset:n}=this;if(this._updatedVisibilityFrame===n._updatedVisibilityFrame)return;let i=l(t)?t.computedTransform:n.modelMatrix,r=l(t)?t._visibilityPlaneMask:aa.MASK_INDETERMINATE;this.updateTransform(i,e),this._distanceToCamera=this.distanceToTile(e),this._centerZDepth=this.distanceToTileCenter(e),this._screenSpaceError=this.getScreenSpaceError(e,!1),this._screenSpaceErrorProgressiveResolution=this.getScreenSpaceError(e,!1,n.progressiveResolutionHeightFraction),this._visibilityPlaneMask=this.visibility(e,r),this._visible=this._visibilityPlaneMask!==aa.MASK_OUTSIDE,this._inRequestVolume=this.insideViewerRequestVolume(e),this._priorityReverseScreenSpaceError=c_t(n,this),this._priorityProgressiveResolution=a_t(n,this),this.priorityDeferred=s_t(this,e),this._updatedVisibilityFrame=n._updatedVisibilityFrame};io.prototype.updateExpiration=function(){if(l(this.expireDate)&&this.contentReady&&!this.hasEmptyContent&&!this.hasMultipleContents){let e=K.now(HEe);K.lessThan(this.expireDate,e)&&(this._contentState=Mr.EXPIRED,this._expiredContent=this._content)}};function l_t(e){if(!l(e.expireDuration))return;let t=K.now(HEe);K.addSeconds(t,e.expireDuration,t),l(e.expireDate)?K.lessThan(e.expireDate,t)&&K.clone(t,e.expireDate):e.expireDate=K.clone(t)}function u_t(e){return function(){return e._priority}}io.prototype.requestContent=function(){if(!this.hasEmptyContent)return this.hasMultipleContents?f_t(this):h_t(this)};function f_t(e){let t=e._content,n=e._tileset;if(!l(t)){let r=lr(e._header,"3DTILES_multiple_contents")?e._header.extensions["3DTILES_multiple_contents"]:e._header;t=new F8(n,e,e._contentResource.clone(),r),e._content=t}let i=t.requestInnerContents();if(l(i))return e._contentState=Mr.LOADING,i.then(r=>{if(!e.isDestroyed()&&l(r))return e._contentState=Mr.PROCESSING,t}).catch(r=>{if(!e.isDestroyed())throw e._contentState=Mr.FAILED,r})}async function d_t(e,t,n,i,r){let o=e._contentState;e._contentState=Mr.LOADING,++t.statistics.numberOfPendingRequests;let s;try{s=await r}catch(a){if(--t.statistics.numberOfPendingRequests,e.isDestroyed())return;if(n.cancelled||n.state===wi.CANCELLED){e._contentState=o,++t.statistics.numberOfAttemptedRequests;return}if(GEe(e,a))return i&&(e.expireDate=void 0),e._content=new wg(t,e),kEe(e),e._contentState=Mr.PROCESSING,e._content;throw e._contentState=Mr.FAILED,a}if(e.isDestroyed()){--t.statistics.numberOfPendingRequests;return}if(n.cancelled||n.state===wi.CANCELLED){e._contentState=o,--t.statistics.numberOfPendingRequests,++t.statistics.numberOfAttemptedRequests;return}try{let a=await m_t(e,s);return--t.statistics.numberOfPendingRequests,e.isDestroyed()?void 0:(i&&(e.expireDate=void 0),e._content=a,a instanceof wg&&kEe(e),e._contentState=Mr.PROCESSING,a)}catch(a){if(--t.statistics.numberOfPendingRequests,e.isDestroyed())return;throw e._contentState=Mr.FAILED,a}}function h_t(e){let t=e._contentResource.clone(),n=e.contentExpired;n&&t.setQueryParameters({expired:e.expireDate.toString()});let i=new Oo({throttle:!0,throttleByServer:!0,type:oa.TILES3D,priorityFunction:u_t(e),serverKey:e._serverKey});e._request=i,t.request=i;let r=e._tileset,o=t.fetchArrayBuffer();if(!l(o)){++r.statistics.numberOfAttemptedRequests;return}return d_t(e,r,i,n,o)}function GEe(e,t){let i=e._tileset?._runtimeContentCodec?.missingTilePolicy;return!l(i)||!l(t.statusCode)?!1:i.statusCodes.includes(t.statusCode)}function kEe(e){e.hasEmptyContent=!0,e.hasRenderableContent=!1}io._isEmptyTile=GEe;async function m_t(e,t){let n=e._tileset,i=n?._runtimeContentCodec;if(l(i)&&typeof i.createContent=="function"){let u=await Promise.resolve(i.createContent(n,e,e._contentResource,t));return e.isDestroyed()?void 0:u}let r=Jy(t);n._disableSkipLevelOfDetail=n._disableSkipLevelOfDetail||r.contentType===za.GEOMETRY||r.contentType===za.VECTOR,(r.contentType===za.IMPLICIT_SUBTREE||r.contentType===za.IMPLICIT_SUBTREE_JSON)&&(e.hasImplicitContent=!0,e.hasRenderableContent=!1),r.contentType===za.EXTERNAL_TILESET&&(e.hasTilesetContent=!0,e.hasRenderableContent=!1);let o,s=CS[r.contentType];if(e.isDestroyed())return;l(r.binaryPayload)?o=await Promise.resolve(s(n,e,e._contentResource,r.binaryPayload.buffer,0)):o=await Promise.resolve(s(n,e,e._contentResource,r.jsonPayload));let a=e._contentHeader;if(e.hasImplicitContentMetadata){let u=e.implicitSubtree,f=e.implicitCoordinates;o.metadata=u.getContentMetadataView(f,0)}else e.hasImplicitContent||(o.metadata=vS(n,a));let c=SS(n,a);return l(c)&&(o.group=new dS({metadata:c})),o}io.prototype.cancelRequests=function(){this.hasMultipleContents?this._content.cancelRequests():this._request.cancel()};io.prototype.unloadTilesetContent=function(){this.hasTilesetContent&&(this._content=this._content&&this._content.destroy(),this._contentState=Mr.UNLOADED,this._expiredContent=void 0,this.expireDate=void 0,this.hasTilesetContent=!1,this.hasRenderableContent=!0,this._selectedFrame=0,this.lastStyleTime=0)};io.prototype.unloadContent=function(){this.hasRenderableContent&&(this._content=this._content&&this._content.destroy(),this._contentState=Mr.UNLOADED,this.lastStyleTime=0,this.clippingPlanesDirty=this._clippingPlanesState===0,this._clippingPlanesState=0,this.clippingPolygonsDirty=this._clippingPolygonsState===0,this._clippingPolygonsState=0,this.clippingPolygonsNeedRebake=!1,this._debugColorizeTiles=!1,this._debugBoundingVolume=this._debugBoundingVolume&&this._debugBoundingVolume.destroy(),this._debugContentBoundingVolume=this._debugContentBoundingVolume&&this._debugContentBoundingVolume.destroy(),this._debugViewerRequestVolume=this._debugViewerRequestVolume&&this._debugViewerRequestVolume.destroy())};var WEe=new ue;function _ee(e,t){if(t.mode!==re.SCENE3D&&!l(e._boundingVolume2D)){let n=e._boundingVolume.boundingSphere,i=ue.projectTo2D(n,t.mapProjection,WEe);e._boundingVolume2D=new eA(i.center,i.radius)}return t.mode!==re.SCENE3D?e._boundingVolume2D:e._boundingVolume}function p_t(e,t){if(t.mode!==re.SCENE3D&&!l(e._contentBoundingVolume2D)){let n=e._contentBoundingVolume.boundingSphere,i=ue.projectTo2D(n,t.mapProjection,WEe);e._contentBoundingVolume2D=new eA(i.center,i.radius)}return t.mode!==re.SCENE3D?e._contentBoundingVolume2D:e._contentBoundingVolume}io.prototype.visibility=function(e,t){let n=e.cullingVolume,i=_ee(this,e),r=this._tileset,o=r.clippingPlanes;if(l(o)&&o.enabled){let a=o.computeIntersectionWithBoundingVolume(i,r.clippingPlanesOriginMatrix);if(this._isClipped=a!==$t.INSIDE,a===$t.OUTSIDE)return aa.MASK_OUTSIDE}let s=r.clippingPolygons;if(l(s)&&s.enabled){let a=s.computeIntersectionWithBoundingVolume(i);this._isClippedByPolygon=a!==$t.OUTSIDE}return n.computeVisibilityWithPlaneMask(i,t)};io.prototype.contentVisibility=function(e){if(!l(this._contentBoundingVolume))return $t.INSIDE;if(this._visibilityPlaneMask===aa.MASK_INSIDE)return $t.INSIDE;let t=e.cullingVolume,n=p_t(this,e),i=this._tileset,r=i.clippingPlanes;if(l(r)&&r.enabled){let s=r.computeIntersectionWithBoundingVolume(n,i.clippingPlanesOriginMatrix);if(this._isClipped=s!==$t.INSIDE,s===$t.OUTSIDE)return $t.OUTSIDE}let o=i.clippingPolygons;if(l(o)&&o.enabled){let s=o.computeIntersectionWithBoundingVolume(n);if(this._isClippedByPolygon=s!==$t.OUTSIDE,s===$t.INSIDE)return $t.OUTSIDE}return t.computeVisibility(n)};io.prototype.distanceToTile=function(e){return _ee(this,e).distanceToCamera(e)};var g_t=new h;io.prototype.distanceToTileCenter=function(e){let n=_ee(this,e).boundingVolume,i=h.subtract(n.center,e.camera.positionWC,g_t);return h.dot(e.camera.directionWC,i)};io.prototype.insideViewerRequestVolume=function(e){let t=this._viewerRequestVolume;return!l(t)||t.distanceToCamera(e)===0};var qEe=new $,YEe=new h,__t=new $,yee=new h,XEe=new ie,KEe=new en,gee=new M;function y_t(e,t,n){let i=h.fromElements(e[0],e[1],e[2],yee),r=$.fromArray(e,3,__t);i=M.multiplyByPoint(t,i,i);let o=M.getMatrix3(t,qEe);return r=$.multiply(o,r,r),l(n)?(n.update(i,r),n):new Sf(i,r)}function UEe(e,t,n,i){let r=ie.unpack(e,0,XEe),o=e[4],s=e[5],a=en.fromRectangle(r,o,s,ee.WGS84,KEe),c=a.center,u=a.halfAxes;t=M.multiplyTransformation(t,M.inverseTransformation(n,gee),gee),c=M.multiplyByPoint(t,c,c);let f=M.getMatrix3(t,qEe);return u=$.multiply(f,u,u),l(i)&&i instanceof Sf?(i.update(c,u),i):new Sf(c,u)}function A_t(e,t,n,i){if(!M.equalsEpsilon(t,n,P.EPSILON8))return i instanceof Sf?UEe(e,t,n,i):UEe(e,t,n,void 0);let r=ie.unpack(e,0,XEe);return i instanceof Ud?(i.rectangle=ie.clone(r,i.rectangle),i.minimumHeight=e[4],i.maximumHeight=e[5],i.computeBoundingVolumes(ee.WGS84),i):new Ud({rectangle:r,minimumHeight:e[4],maximumHeight:e[5]})}function b_t(e,t,n){let i=h.fromElements(e[0],e[1],e[2],yee),r=e[3];i=M.multiplyByPoint(t,i,i);let o=M.getScale(t,YEe),s=h.maximumComponent(o);return r*=s,l(n)?(n.update(i,r),n):new eA(i,r)}io.prototype.createBoundingVolume=function(e,t,n){let i=this.metadata,r;if(l(i)&&(r=Fx.parseBoundingVolumeSemantic("TILE",i)),l(r)&&(e=r),!l(e))throw new oe("boundingVolume must be defined");if(lr(e,"3DTILES_bounding_volume_S2"))return new U8(e.extensions["3DTILES_bounding_volume_S2"]);let{box:o,region:s,sphere:a}=e;if(l(o)){let c=y_t(o,t,n);return this._verticalExaggeration!==1&&zEe(c,this._verticalExaggeration,this._verticalExaggerationRelativeHeight),c}if(l(s)){let c=A_t(s,t,this._initialTransform,n);return this._verticalExaggeration===1||(c instanceof Sf?zEe(c,this._verticalExaggeration,this._verticalExaggerationRelativeHeight):(c.minimumHeight=br.getHeight(c.minimumHeight,this._verticalExaggeration,this._verticalExaggerationRelativeHeight),c.maximumHeight=br.getHeight(c.maximumHeight,this._verticalExaggeration,this._verticalExaggerationRelativeHeight),c.computeBoundingVolumes(ee.WGS84))),c}if(l(a)){let c=b_t(a,t,n);if(this._verticalExaggeration!==1){let u=br.getPosition(c.center,ee.WGS84,this._verticalExaggeration,this._verticalExaggerationRelativeHeight,yee),f=c.radius*this._verticalExaggeration;c.update(u,f)}return c}throw new oe("boundingVolume must contain a sphere, region, or box")};var x_t=h.unpackArray(new Array(24).fill(0));function zEe(e,t,n){let i=e.boundingVolume.computeCorners(x_t).map(o=>br.getPosition(o,ee.WGS84,t,n,o)),r=en.fromPoints(i,KEe);e.update(r.center,r.halfAxes)}io.prototype.updateTransform=function(e,t){e=e??M.IDENTITY;let n=M.multiplyTransformation(e,this.transform,gee),i=!M.equals(n,this.computedTransform),r=l(t)&&(this._verticalExaggeration!==t.verticalExaggeration||this._verticalExaggerationRelativeHeight!==t.verticalExaggerationRelativeHeight);if(!i&&!r)return;i&&M.clone(n,this.computedTransform),r&&(this._verticalExaggeration=t.verticalExaggeration,this._verticalExaggerationRelativeHeight=t.verticalExaggerationRelativeHeight);let o=this._header,s=this._contentHeader;this._boundingVolume=this.createBoundingVolume(o.boundingVolume,this.computedTransform,this._boundingVolume),l(this._contentBoundingVolume)&&(this._contentBoundingVolume=this.createBoundingVolume(s.boundingVolume,this.computedTransform,this._contentBoundingVolume)),l(this._viewerRequestVolume)&&(this._viewerRequestVolume=this.createBoundingVolume(o.viewerRequestVolume,this.computedTransform,this._viewerRequestVolume)),this.updateGeometricErrorScale(),this._debugBoundingVolume=this._debugBoundingVolume&&this._debugBoundingVolume.destroy(),this._debugContentBoundingVolume=this._debugContentBoundingVolume&&this._debugContentBoundingVolume.destroy(),this._debugViewerRequestVolume=this._debugViewerRequestVolume&&this._debugViewerRequestVolume.destroy()};io.prototype.updateGeometricErrorScale=function(){let e=M.getScale(this.computedTransform,YEe),t=h.maximumComponent(e);if(this.geometricError=this._geometricError*t,!l(this.parent)){let n=this._tileset;n._scaledGeometricError=n._geometricError*t}};function T_t(e,t,n,i){if(!i.isRender)return;let r=l(e._contentHeader)&&l(e._contentHeader.boundingVolume),o=t.debugShowBoundingVolume||t.debugShowContentBoundingVolume&&!r;if(o){let c;e._finalResolution?e.hasRenderableContent?c=z.WHITE:c=z.DARKGRAY:c=z.YELLOW,l(e._debugBoundingVolume)||(e._debugBoundingVolume=e._boundingVolume.createDebugVolume(c)),e._debugBoundingVolume.update(n);let u=e._debugBoundingVolume.getGeometryInstanceAttributes("outline");u.color=Jt.toValue(c,u.color)}else!o&&l(e._debugBoundingVolume)&&(e._debugBoundingVolume=e._debugBoundingVolume.destroy());t.debugShowContentBoundingVolume&&r?(l(e._debugContentBoundingVolume)||(e._debugContentBoundingVolume=e._contentBoundingVolume.createDebugVolume(z.BLUE)),e._debugContentBoundingVolume.update(n)):!t.debugShowContentBoundingVolume&&l(e._debugContentBoundingVolume)&&(e._debugContentBoundingVolume=e._debugContentBoundingVolume.destroy()),t.debugShowViewerRequestVolume&&l(e._viewerRequestVolume)?(l(e._debugViewerRequestVolume)||(e._debugViewerRequestVolume=e._viewerRequestVolume.createDebugVolume(z.YELLOW)),e._debugViewerRequestVolume.update(n)):!t.debugShowViewerRequestVolume&&l(e._debugViewerRequestVolume)&&(e._debugViewerRequestVolume=e._debugViewerRequestVolume.destroy());let s=t.debugColorizeTiles&&!e._debugColorizeTiles||l(t._heatmap.tilePropertyName),a=!t.debugColorizeTiles&&e._debugColorizeTiles;s?(t._heatmap.colorize(e,n),e._debugColorizeTiles=!0,e.color=e._debugColor):a&&(e._debugColorizeTiles=!1,e.color=z.WHITE),e._colorDirty&&(e._colorDirty=!1,e._content.applyDebugSettings(!0,e._color)),a&&t.makeStyleDirty()}function E_t(e,t,n){let i=e._expiredContent;if(!e.hasMultipleContents&&l(i)){if(!e.contentReady){try{i.update(t,n)}catch{}return}e._expiredContent.destroy(),e._expiredContent=void 0}if(l(e.content))try{e.content.update(t,n)}catch(r){throw e._contentState=Mr.FAILED,r}}function C_t(e,t){let n=t.clippingPlanes,i=0;l(n)&&e._isClipped&&n.enabled&&(i=n.clippingPlanesState),i!==e._clippingPlanesState&&(e._clippingPlanesState=i,e.clippingPlanesDirty=!0)}function v_t(e,t){let n=t.clippingPolygons,i=0;l(n)&&e._isClippedByPolygon&&n.enabled&&(i=n.clippingPolygonsState),i!==e._clippingPolygonsState&&(e._clippingPolygonsState=i,e.clippingPolygonsDirty=!0)}io.prototype.update=function(e,t,n){let{commandList:i}=t,r=i.length;C_t(this,e),v_t(this,e),T_t(this,e,t,n),E_t(this,e,t);let o=i.length;this._commandsLength=o-r;for(let s=r;s<o;++s){let a=i[s],c=a.pass===Ie.TRANSLUCENT;a.depthForTranslucentClassification=c}this.clippingPlanesDirty=!1,this.clippingPolygonsDirty=!1,this.clippingPolygonsNeedRebake=!1};var VEe=[];io.prototype.process=function(e,t){!this.contentExpired&&!this.contentReady&&this._content.ready&&(l_t(this),this._selectedFrame=0,this.lastStyleTime=0,K.now(this._loadTimestamp),this._contentState=Mr.READY,!this.hasTilesetContent&&!this.hasImplicitContent&&(e._statistics.incrementLoadCounts(this.content),++e._statistics.numberOfTilesWithContentReady,++e._statistics.numberOfLoadedTilesTotal,e._cache.add(this)));let n=t.commandList;t.commandList=VEe;try{this._content.update(e,t)}catch(i){throw this._contentState=Mr.FAILED,i}VEe.length=0,t.commandList=n};function jEe(e,t,n){let i=e*Math.pow(10,t);return parseInt(i)*Math.pow(10,n)}function z8(e,t,n){return Math.max(P.normalize(e,t,n)-P.EPSILON7,0)}io.prototype.updatePriority=function(){let e=this.tileset,t=e.preferLeaves,n=e._minimumPriority,i=e._maximumPriority,r=4,o=1,s=0,a=r,c=s+a,u=r,f=c+u,d=o,p=Math.pow(10,f),g=f+d,m=o,y=Math.pow(10,g),A=g+m,b=Math.pow(10,A),x=z8(this._depth,n.depth,i.depth);x=t?1-x:x;let E=!e.isSkippingLevelOfDetail&&this.refine===Io.REPLACE?z8(this._priorityHolder._distanceToCamera,n.distance,i.distance):z8(this._priorityReverseScreenSpaceError,n.reverseScreenSpaceError,i.reverseScreenSpaceError),v=jEe(E,a,s),S=this._priorityProgressiveResolution?0:p,I=z8(this._priorityHolder._foveatedFactor,n.foveatedFactor,i.foveatedFactor),R=jEe(I,u,c),O=this.priorityDeferred?y:0,L=e._pass===po.PRELOAD_FLIGHT?0:b;this._priority=x+v+S+R+O+L};io.prototype.isDestroyed=function(){return!1};io.prototype.destroy=function(){return this._content=this._content&&this._content.destroy(),this._expiredContent=this._expiredContent&&!this._expiredContent.isDestroyed()&&this._expiredContent.destroy(),this._debugBoundingVolume=this._debugBoundingVolume&&this._debugBoundingVolume.destroy(),this._debugContentBoundingVolume=this._debugContentBoundingVolume&&this._debugContentBoundingVolume.destroy(),this._debugViewerRequestVolume=this._debugViewerRequestVolume&&this._debugViewerRequestVolume.destroy(),le(this)};var nm=io;function Dg(e){e=e??H.EMPTY_OBJECT;let t=e.id,n=e.group,i=e.class,r=l(n.properties)?n.properties:{};this._class=i,this._properties=r,this._id=t,this._extras=n.extras,this._extensions=n.extensions}Object.defineProperties(Dg.prototype,{class:{get:function(){return this._class}},id:{get:function(){return this._id}},extras:{get:function(){return this._extras}},extensions:{get:function(){return this._extensions}}});Dg.prototype.hasProperty=function(e){return Xn.hasProperty(e,this._properties,this._class)};Dg.prototype.hasPropertyBySemantic=function(e){return Xn.hasPropertyBySemantic(e,this._properties,this._class)};Dg.prototype.getPropertyIds=function(e){return Xn.getPropertyIds(this._properties,this._class,e)};Dg.prototype.getProperty=function(e){return Xn.getProperty(e,this._properties,this._class)};Dg.prototype.setProperty=function(e,t){return Xn.setProperty(e,t,this._properties,this._class)};Dg.prototype.getPropertyBySemantic=function(e){return Xn.getPropertyBySemantic(e,this._properties,this._class)};Dg.prototype.setPropertyBySemantic=function(e,t){return Xn.setPropertyBySemantic(e,t,this._properties,this._class)};var eR=Dg;function Rg(e){e=e??H.EMPTY_OBJECT;let t=e.tileset,n=e.class,i=l(t.properties)?t.properties:{};this._class=n,this._properties=i,this._extras=t.extras,this._extensions=t.extensions}Object.defineProperties(Rg.prototype,{class:{get:function(){return this._class}},extras:{get:function(){return this._extras}},extensions:{get:function(){return this._extensions}}});Rg.prototype.hasProperty=function(e){return Xn.hasProperty(e,this._properties,this._class)};Rg.prototype.hasPropertyBySemantic=function(e){return Xn.hasPropertyBySemantic(e,this._properties,this._class)};Rg.prototype.getPropertyIds=function(e){return Xn.getPropertyIds(this._properties,this._class,e)};Rg.prototype.getProperty=function(e){return Xn.getProperty(e,this._properties,this._class)};Rg.prototype.setProperty=function(e,t){return Xn.setProperty(e,t,this._properties,this._class)};Rg.prototype.getPropertyBySemantic=function(e){return Xn.getPropertyBySemantic(e,this._properties,this._class)};Rg.prototype.setPropertyBySemantic=function(e,t){return Xn.setPropertyBySemantic(e,t,this._properties,this._class)};var V8=Rg;function $Ee(e){e=e??H.EMPTY_OBJECT;let t=e.metadataJson,n=e.schema,i=t.metadata??t.tileset,r;l(i)&&(r=new V8({tileset:i,class:n.classes[i.class]}));let o=[],s=[],a=t.groups;if(Array.isArray(a)){let c=a.length;for(let u=0;u<c;u++){let f=a[u];s.push(new eR({group:f,class:n.classes[f.class]}))}}else if(l(a)){o=Object.keys(a).sort();let c=o.length;for(let u=0;u<c;u++){let f=o[u];if(a.hasOwnProperty(f)){let d=a[f];s.push(new eR({id:f,group:a[f],class:n.classes[d.class]}))}}}this._schema=n,this._groups=s,this._groupIds=o,this._tileset=r,this._statistics=t.statistics,this._extras=t.extras,this._extensions=t.extensions}Object.defineProperties($Ee.prototype,{schema:{get:function(){return this._schema}},groups:{get:function(){return this._groups}},groupIds:{get:function(){return this._groupIds}},tileset:{get:function(){return this._tileset}},statistics:{get:function(){return this._statistics}},extras:{get:function(){return this._extras}},extensions:{get:function(){return this._extensions}}});var MS=$Ee;var JEe={},S_t=new h;JEe.checkChildrenWithinParent=function(e){let t=e.children,n=t.length,i=e.boundingVolume;if(i instanceof Sf||i instanceof Ud){let r=i._orientedBoundingBox;e._optimChildrenWithinParent=tm.USE_OPTIMIZATION;for(let o=0;o<n;++o){let a=t[o].boundingVolume;if(!(a instanceof Sf||a instanceof Ud)){e._optimChildrenWithinParent=tm.SKIP_OPTIMIZATION;break}let c=a._orientedBoundingBox,u=h.subtract(c.center,r.center,S_t),f=h.magnitude(u);h.divideByScalar(u,f,u);let d=Math.abs(r.halfAxes[0]*u.x)+Math.abs(r.halfAxes[1]*u.y)+Math.abs(r.halfAxes[2]*u.z)+Math.abs(r.halfAxes[3]*u.x)+Math.abs(r.halfAxes[4]*u.y)+Math.abs(r.halfAxes[5]*u.z)+Math.abs(r.halfAxes[6]*u.x)+Math.abs(r.halfAxes[7]*u.y)+Math.abs(r.halfAxes[8]*u.z),p=Math.abs(c.halfAxes[0]*u.x)+Math.abs(c.halfAxes[1]*u.y)+Math.abs(c.halfAxes[2]*u.z)+Math.abs(c.halfAxes[3]*u.x)+Math.abs(c.halfAxes[4]*u.y)+Math.abs(c.halfAxes[5]*u.z)+Math.abs(c.halfAxes[6]*u.x)+Math.abs(c.halfAxes[7]*u.y)+Math.abs(c.halfAxes[8]*u.z);if(d<=p+f){e._optimChildrenWithinParent=tm.SKIP_OPTIMIZATION;break}}}return e._optimChildrenWithinParent===tm.USE_OPTIMIZATION};var j8=JEe;function tR(){this.head=void 0,this.tail=void 0,this._length=0}Object.defineProperties(tR.prototype,{length:{get:function(){return this._length}}});function w_t(e,t,n){this.item=e,this.previous=t,this.next=n}tR.prototype.add=function(e){let t=new w_t(e,this.tail,void 0);return l(this.tail)?(this.tail.next=t,this.tail=t):(this.head=t,this.tail=t),++this._length,t};function ZEe(e,t){l(t.previous)&&l(t.next)?(t.previous.next=t.next,t.next.previous=t.previous):l(t.previous)?(t.previous.next=void 0,e.tail=t.previous):l(t.next)?(t.next.previous=void 0,e.head=t.next):(e.head=void 0,e.tail=void 0),t.next=void 0,t.previous=void 0}tR.prototype.remove=function(e){l(e)&&(ZEe(this,e),--this._length)};tR.prototype.splice=function(e,t){if(e===t)return;ZEe(this,t);let n=e.next;e.next=t,this.tail===e?this.tail=t:n.previous=t,t.next=n,t.previous=e};var H8=tR;function nA(){this._list=new H8,this._sentinel=this._list.add(),this._trimTiles=!1}nA.prototype.reset=function(){this._list.splice(this._list.tail,this._sentinel)};nA.prototype.touch=function(e){let t=e.cacheNode;l(t)&&this._list.splice(this._sentinel,t)};nA.prototype.add=function(e){l(e.cacheNode)||(e.cacheNode=this._list.add(e))};nA.prototype.forEachLoadedTile=function(e){for(let t=this._list.head;l(t);t=t.next)l(t.item)&&e(t.item)};nA.prototype.unloadTile=function(e,t,n){let i=t.cacheNode;l(i)&&(this._list.remove(i),t.cacheNode=void 0,n(e,t))};nA.prototype.unloadTiles=function(e,t){let n=this._trimTiles;this._trimTiles=!1;let i=this._list,r=this._sentinel,o=i.head;for(;o!==r&&(e.totalMemoryUsageInBytes>e.cacheBytes||n);){let s=o.item;o=o.next,this.unloadTile(e,s,t)}};nA.prototype.trim=function(){this._trimTiles=!0};var G8=nA;function W8(e){this.tilePropertyName=e,this._minimum=Number.MAX_VALUE,this._maximum=-Number.MAX_VALUE,this._previousMinimum=Number.MAX_VALUE,this._previousMaximum=-Number.MAX_VALUE,this._referenceMinimum={},this._referenceMaximum={}}function bee(e,t){let n;return t==="_loadTimestamp"?n=K.toDate(e).getTime():n=e,n}W8.prototype.setReferenceMinimumMaximum=function(e,t,n){this._referenceMinimum[n]=bee(e,n),this._referenceMaximum[n]=bee(t,n)};function I_t(e,t){let n=e.tilePropertyName;if(l(n)){let i=bee(t[n],n);return l(i)?(e._maximum=Math.max(i,e._maximum),e._minimum=Math.min(i,e._minimum),i):(e.tilePropertyName=void 0,i)}}var Aee=[new z(.1,.1,.1,1),new z(.153,.278,.878,1),new z(.827,.231,.49,1),new z(.827,.188,.22,1),new z(1,.592,.259,1),new z(1,.843,0,1)];W8.prototype.colorize=function(e,t){let n=this.tilePropertyName;if(!l(n)||!e.contentAvailable||e._selectedFrame!==t.frameNumber)return;let i=I_t(this,e),r=this._previousMinimum,o=this._previousMaximum;if(r===Number.MAX_VALUE||o===-Number.MAX_VALUE)return;let s=o-r+P.EPSILON7,c=P.clamp(i-r,0,s)/s,u=Aee.length-1,f=c*u,d=Math.floor(f),p=Math.ceil(f),g=f-d,m=Aee[d],y=Aee[p],A=z.clone(z.WHITE);A.red=P.lerp(m.red,y.red,g),A.green=P.lerp(m.green,y.green,g),A.blue=P.lerp(m.blue,y.blue,g),e._debugColor=A};W8.prototype.resetMinimumMaximum=function(){let e=this.tilePropertyName;if(l(e)){let t=this._referenceMinimum[e],n=this._referenceMaximum[e],i=l(t)&&l(n);this._previousMinimum=i?t:this._minimum,this._previousMaximum=i?n:this._maximum,this._minimum=Number.MAX_VALUE,this._maximum=-Number.MAX_VALUE}};var q8=W8;function NS(){this.selected=0,this.visited=0,this.numberOfCommands=0,this.numberOfAttemptedRequests=0,this.numberOfPendingRequests=0,this.numberOfTilesProcessing=0,this.numberOfTilesWithContentReady=0,this.numberOfTilesTotal=0,this.numberOfLoadedTilesTotal=0,this.numberOfFeaturesSelected=0,this.numberOfFeaturesLoaded=0,this.numberOfPointsSelected=0,this.numberOfPointsLoaded=0,this.numberOfTrianglesSelected=0,this.numberOfTilesStyled=0,this.numberOfFeaturesStyled=0,this.numberOfTilesCulledWithChildrenUnion=0,this.geometryByteLength=0,this.texturesByteLength=0,this.texturesReferenceCounterById={},this.batchTableByteLength=0}NS.prototype.clear=function(){this.selected=0,this.visited=0,this.numberOfCommands=0,this.numberOfAttemptedRequests=0,this.numberOfFeaturesSelected=0,this.numberOfPointsSelected=0,this.numberOfTrianglesSelected=0,this.numberOfTilesStyled=0,this.numberOfFeaturesStyled=0,this.numberOfTilesCulledWithChildrenUnion=0};NS.prototype.incrementSelectionCounts=function(e){this.numberOfFeaturesSelected+=e.featuresLength,this.numberOfPointsSelected+=e.pointsLength,this.numberOfTrianglesSelected+=e.trianglesLength;let t=e.innerContents;if(l(t)){let n=t.length;for(let i=0;i<n;++i)this.incrementSelectionCounts(t[i])}};NS.prototype.incrementLoadCounts=function(e){if(this.numberOfFeaturesLoaded+=e.featuresLength,this.numberOfPointsLoaded+=e.pointsLength,this.geometryByteLength+=e.geometryByteLength,this.batchTableByteLength+=e.batchTableByteLength,!(e instanceof Nd))this.texturesByteLength+=e.texturesByteLength;else{let n=e.getTextureIds();for(let i of n){let r=this.texturesReferenceCounterById[i]??0;if(r===0){let o=e.getTextureByteLengthById(i);this.texturesByteLength+=o}this.texturesReferenceCounterById[i]=r+1}}let t=e.innerContents;if(l(t)){let n=t.length;for(let i=0;i<n;++i)this.incrementLoadCounts(t[i])}};NS.prototype.decrementLoadCounts=function(e){if(this.numberOfFeaturesLoaded-=e.featuresLength,this.numberOfPointsLoaded-=e.pointsLength,this.geometryByteLength-=e.geometryByteLength,this.batchTableByteLength-=e.batchTableByteLength,!(e instanceof Nd))this.texturesByteLength-=e.texturesByteLength;else{let n=e.getTextureIds();for(let i of n){let r=this.texturesReferenceCounterById[i];if(r===1){delete this.texturesReferenceCounterById[i];let o=e.getTextureByteLengthById(i);this.texturesByteLength-=o}else this.texturesReferenceCounterById[i]=r-1}}let t=e.innerContents;if(l(t)){let n=t.length;for(let i=0;i<n;++i)this.decrementLoadCounts(t[i])}};NS.clone=function(e,t){t.selected=e.selected,t.visited=e.visited,t.numberOfCommands=e.numberOfCommands,t.numberOfAttemptedRequests=e.numberOfAttemptedRequests,t.numberOfPendingRequests=e.numberOfPendingRequests,t.numberOfTilesProcessing=e.numberOfTilesProcessing,t.numberOfTilesWithContentReady=e.numberOfTilesWithContentReady,t.numberOfTilesTotal=e.numberOfTilesTotal,t.numberOfFeaturesSelected=e.numberOfFeaturesSelected,t.numberOfFeaturesLoaded=e.numberOfFeaturesLoaded,t.numberOfPointsSelected=e.numberOfPointsSelected,t.numberOfPointsLoaded=e.numberOfPointsLoaded,t.numberOfTrianglesSelected=e.numberOfTrianglesSelected,t.numberOfTilesStyled=e.numberOfTilesStyled,t.numberOfFeaturesStyled=e.numberOfFeaturesStyled,t.numberOfTilesCulledWithChildrenUnion=e.numberOfTilesCulledWithChildrenUnion,t.geometryByteLength=e.geometryByteLength,t.texturesByteLength=e.texturesByteLength,t.batchTableByteLength=e.batchTableByteLength};var Up=NS;function nR(){this._style=void 0,this._styleDirty=!1,this._lastStyleTime=0}Object.defineProperties(nR.prototype,{style:{get:function(){return this._style},set:function(e){e!==this._style&&(this._style=e,this._styleDirty=!0)}}});nR.prototype.makeDirty=function(){this._styleDirty=!0};nR.prototype.resetDirty=function(){this._styleDirty=!1};nR.prototype.applyStyle=function(e){if(!l(e.root)||l(this._style)&&!this._style._ready)return;let t=this._styleDirty;t&&++this._lastStyleTime;let n=this._lastStyleTime,i=e._statistics,r=t?e._selectedTiles:e._selectedTilesToStyle,o=r.length;for(let s=0;s<o;++s){let a=r[s];if(a.lastStyleTime!==n){let c=a.content;a.lastStyleTime=n,c.applyStyle(this._style),i.numberOfFeaturesStyled+=c.featuresLength,++i.numberOfTilesStyled}}};var Y8=nR;function QEe(e,t,n){this.context=e,this.commandList=[],this.panoramaCommandList=[],this.shadowMaps=[],this.brdfLutGenerator=void 0,this.environmentMap=void 0,this.sphericalHarmonicCoefficients=void 0,this.specularEnvironmentMaps=void 0,this.specularEnvironmentMapsMaximumLOD=void 0,this.mode=re.SCENE3D,this.morphTime=re.getMorphTime(re.SCENE3D),this.frameNumber=0,this.newFrame=!1,this.time=void 0,this.jobScheduler=n,this.mapProjection=void 0,this.camera=void 0,this.cameraUnderground=!1,this.globeTranslucencyState=void 0,this.cullingVolume=void 0,this.occluder=void 0,this.maximumScreenSpaceError=void 0,this.pixelRatio=1,this.passes={render:!1,pick:!1,pickVoxel:!1,snap:!1,depth:!1,postProcess:!1,offscreen:!1},this.creditDisplay=t,this.afterRender=[],this.scene3DOnly=!1,this.fog={enabled:!1,renderable:!1,density:void 0,visualDensityScalar:void 0,sse:void 0,minimumBrightness:void 0},this.atmosphere=void 0,this.verticalExaggeration=1,this.verticalExaggerationRelativeHeight=0,this.shadowState={shadowsEnabled:!0,shadowMaps:[],lightShadowMaps:[],nearPlane:1,farPlane:5e3,closestObjectSize:1e3,lastDirtyTime:0,outOfView:!0},this.splitPosition=0,this.frustumSplits=[],this.backgroundColor=void 0,this.light=void 0,this.minimumDisableDepthTestDistance=void 0,this.invertClassification=!1,this.invertClassificationColor=void 0,this.useLogDepth=!1,this.tilesetPassState=void 0,this.minimumTerrainHeight=0,this.pickingMetadata=!1,this.pickedMetadataInfo=void 0,this.edgeVisibilityRequested=!1,this.planarFillRequested=!1}QEe.maximumFrameNumber=15e6;var Yx=QEe;function P_t(e,t,n){let i=lr(t,"3DTILES_implicit_tiling")?t.extensions["3DTILES_implicit_tiling"]:t.implicitTiling;this.baseResource=e,this.geometricError=t.geometricError,this.metadataSchema=n;let r=t.boundingVolume;if(!l(r.box)&&!l(r.region)&&!lr(r,"3DTILES_bounding_volume_S2")&&!lr(r,"3DTILES_bounding_volume_cylinder"))throw new oe("Only box, region, 3DTILES_bounding_volume_S2, and 3DTILES_bounding_volume_cylinder are supported for implicit tiling");this.boundingVolume=r,this.refine=t.refine,this.subtreeUriTemplate=new De({url:i.subtrees.uri}),this.contentUriTemplates=[],this.contentHeaders=[];let o=D_t(t);for(let s=0;s<o.length;s++){let a=o[s];this.contentHeaders.push(Ze(a,!0));let c=new De({url:a.uri});this.contentUriTemplates.push(c)}this.contentCount=this.contentHeaders.length,this.tileHeader=R_t(t),this.subdivisionScheme=$s[i.subdivisionScheme],this.branchingFactor=$s.getBranchingFactor(this.subdivisionScheme),this.subtreeLevels=i.subtreeLevels,l(i.availableLevels)?this.availableLevels=i.availableLevels:this.availableLevels=i.maximumLevel+1}function D_t(e){if(lr(e,"3DTILES_multiple_contents")){let t=e.extensions["3DTILES_multiple_contents"];return l(t.contents)?t.contents:t.content}return l(e.contents)?e.contents:l(e.content)?[e.content]:[]}function R_t(e){let t=Ze(e,!0);return l(t.extensions)&&(delete t.extensions["3DTILES_implicit_tiling"],delete t.extensions["3DTILES_multiple_contents"],Object.keys(t.extensions).length===0&&delete t.extensions),delete t.implicitTiling,delete t.contents,delete t.content,t}var Og=P_t;var iR={};function eCe(e){return e=(e^e<<8)&16711935,e=(e^e<<4)&252645135,e=(e^e<<2)&858993459,e=(e^e<<1)&1431655765,e}function xee(e){return e=(e^e<<16)&50331903,e=(e^e<<8)&50393103,e=(e^e<<4)&51130563,e=(e^e<<2)&153391689,e}function tCe(e){return e&=1431655765,e=(e^e>>1)&858993459,e=(e^e>>2)&252645135,e=(e^e>>4)&16711935,e=(e^e>>8)&65535,e}function Tee(e){return e&=153391689,e=(e^e>>2)&51130563,e=(e^e>>4)&50393103,e=(e^e>>8)&4278190335,e=(e^e>>16)&1023,e}iR.encode2D=function(e,t){return(eCe(e)|eCe(t)<<1)>>>0};iR.decode2D=function(e,t){return l(t)||(t=new Array(2)),t[0]=tCe(e),t[1]=tCe(e>>1),t};iR.encode3D=function(e,t,n){return xee(e)|xee(t)<<1|xee(n)<<2};iR.decode3D=function(e,t){return l(t)||(t=new Array(3)),t[0]=Tee(e),t[1]=Tee(e>>1),t[2]=Tee(e>>2),t};var Xx=iR;function go(e){this.subdivisionScheme=e.subdivisionScheme,this.subtreeLevels=e.subtreeLevels,this.level=e.level,this.x=e.x,this.y=e.y,this.z=void 0,e.subdivisionScheme===$s.OCTREE&&(this.z=e.z)}Object.defineProperties(go.prototype,{childIndex:{get:function(){let e=0;return e|=this.x&1,e|=(this.y&1)<<1,this.subdivisionScheme===$s.OCTREE&&(e|=(this.z&1)<<2),e}},mortonIndex:{get:function(){return this.subdivisionScheme===$s.OCTREE?Xx.encode3D(this.x,this.y,this.z):Xx.encode2D(this.x,this.y)}},tileIndex:{get:function(){let e=this.subdivisionScheme===$s.OCTREE?((1<<3*this.level)-1)/7:((1<<2*this.level)-1)/3,t=this.mortonIndex;return e+t}}});go.prototype.getDescendantCoordinates=function(e){let t=this.level+e.level,n=(this.x<<e.level)+e.x,i=(this.y<<e.level)+e.y;if(this.subdivisionScheme===$s.OCTREE){let r=(this.z<<e.level)+e.z;return new go({subdivisionScheme:this.subdivisionScheme,subtreeLevels:this.subtreeLevels,level:t,x:n,y:i,z:r})}return new go({subdivisionScheme:this.subdivisionScheme,subtreeLevels:this.subtreeLevels,level:t,x:n,y:i})};go.prototype.getAncestorCoordinates=function(e){let t=1<<e,n=this.level-e,i=Math.floor(this.x/t),r=Math.floor(this.y/t);if(this.subdivisionScheme===$s.OCTREE){let o=Math.floor(this.z/t);return new go({subdivisionScheme:this.subdivisionScheme,subtreeLevels:this.subtreeLevels,level:n,x:i,y:r,z:o})}return new go({subdivisionScheme:this.subdivisionScheme,subtreeLevels:this.subtreeLevels,level:n,x:i,y:r})};go.prototype.getOffsetCoordinates=function(e){let t=e.level-this.level,n=1<<t,i=e.x%n,r=e.y%n;if(this.subdivisionScheme===$s.OCTREE){let o=e.z%n;return new go({subdivisionScheme:this.subdivisionScheme,subtreeLevels:this.subtreeLevels,level:t,x:i,y:r,z:o})}return new go({subdivisionScheme:this.subdivisionScheme,subtreeLevels:this.subtreeLevels,level:t,x:i,y:r})};go.prototype.getChildCoordinates=function(e){let t=this.level+1,n=2*this.x+e%2,i=2*this.y+Math.floor(e/2)%2;if(this.subdivisionScheme===$s.OCTREE){let r=2*this.z+Math.floor(e/4)%2;return new go({subdivisionScheme:this.subdivisionScheme,subtreeLevels:this.subtreeLevels,level:t,x:n,y:i,z:r})}return new go({subdivisionScheme:this.subdivisionScheme,subtreeLevels:this.subtreeLevels,level:t,x:n,y:i})};go.prototype.getSubtreeCoordinates=function(){return this.getAncestorCoordinates(this.level%this.subtreeLevels)};go.prototype.getParentSubtreeCoordinates=function(){return this.getAncestorCoordinates(this.level%this.subtreeLevels+this.subtreeLevels)};go.prototype.isAncestor=function(e){let t=e.level-this.level;if(t<=0)return!1;let n=e.x>>t,i=e.y>>t,r=this.x===n,o=this.y===i;if(this.subdivisionScheme===$s.OCTREE){let s=e.z>>t,a=this.z===s;return r&&o&&a}return r&&o};go.prototype.isEqual=function(e){return this.subdivisionScheme===e.subdivisionScheme&&this.subtreeLevels===e.subtreeLevels&&this.level===e.level&&this.x===e.x&&this.y===e.y&&(this.subdivisionScheme===$s.OCTREE?this.z===e.z:!0)};go.prototype.isImplicitTilesetRoot=function(){return this.level===0};go.prototype.isSubtreeRoot=function(){return this.level%this.subtreeLevels===0};go.prototype.isBottomOfSubtree=function(){return this.level%this.subtreeLevels===this.subtreeLevels-1};go.prototype.getTemplateValues=function(){let e={level:this.level,x:this.x,y:this.y};return this.subdivisionScheme===$s.OCTREE&&(e.z=this.z),e};var nCe=[0,0,0];go.fromMortonIndex=function(e,t,n,i){let r;return e===$s.OCTREE?(r=Xx.decode3D(i,nCe),new go({subdivisionScheme:e,subtreeLevels:t,level:n,x:r[0],y:r[1],z:r[2]})):(r=Xx.decode2D(i,nCe),new go({subdivisionScheme:e,subtreeLevels:t,level:n,x:r[0],y:r[1]}))};go.fromTileIndex=function(e,t,n){let i,r,o;return e===$s.OCTREE?(i=Math.floor(P.log2(7*n+1)/3),r=((1<<3*i)-1)/7,o=n-r):(i=Math.floor(P.log2(3*n+1)/2),r=((1<<2*i)-1)/3,o=n-r),go.fromMortonIndex(e,t,i,o)};var Mg=go;function Ng(){}Ng.selectTiles=function(e,t){pe.throwInstantiationError()};Ng.sortChildrenByDistanceToCamera=function(e,t){return t._distanceToCamera===0&&e._distanceToCamera===0?t._centerZDepth-e._centerZDepth:t._distanceToCamera-e._distanceToCamera};Ng.canTraverse=function(e){return e.children.length===0?!1:e.hasTilesetContent||e.hasImplicitContent?!e.contentExpired:e._screenSpaceError>e.tileset.memoryAdjustedScreenSpaceError};Ng.selectTile=function(e,t){if(e.contentVisibility(t)===$t.OUTSIDE)return;e._wasSelectedLastFrame=!0;let{content:n,tileset:i}=e;n.featurePropertiesDirty?(n.featurePropertiesDirty=!1,e.lastStyleTime=0,i._selectedTilesToStyle.push(e)):e._selectedFrame<t.frameNumber-1&&(i._selectedTilesToStyle.push(e),e._wasSelectedLastFrame=!1),e._selectedFrame=t.frameNumber,i._selectedTiles.push(e)};Ng.visitTile=function(e,t){++e.tileset._statistics.visited,e._visitedFrame=t.frameNumber};Ng.touchTile=function(e,t){e._touchedFrame!==t.frameNumber&&(e.tileset._cache.touch(e),e._touchedFrame=t.frameNumber)};Ng.loadTile=function(e,t){let{tileset:n}=e;if(e._requestedFrame===t.frameNumber||!e.hasUnloadedRenderableContent&&!e.contentExpired||!O_t(e,t))return;let i=t.camera.timeSinceMoved<n.foveatedTimeDelay;e.priorityDeferred&&i||(e._requestedFrame=t.frameNumber,n._requestedTiles.push(e))};function O_t(e,t){let{tileset:n}=e;if(!n._cullRequestsWhileMoving)return!0;let{positionWCDeltaMagnitude:i,positionWCDeltaMagnitudeLastFrame:r}=t.camera,o=i!==0?i:r,s=Math.max(e.boundingSphere.radius*2,1);return n.cullRequestsWhileMovingMultiplier*o/s<1}Ng.updateTile=function(e,t){iCe(e,t),e.updateExpiration(),e._wasMinPriorityChild=!1,e._priorityHolder=e,L_t(e),e._shouldSelect=!1,e._finalResolution=!0};function iCe(e,t){if(e.updateVisibility(t),!e.isVisible)return;let n=e.children.length>0;if((e.hasTilesetContent||e.hasImplicitContent)&&n){let o=e.children[0];iCe(o,t),e._visible=o._visible;return}if(M_t(e,t)){e._visible=!1;return}let i=e.refine===Io.REPLACE,r=e._optimChildrenWithinParent===tm.USE_OPTIMIZATION;if(i&&r&&n&&!N_t(e,t)){++e.tileset._statistics.numberOfTilesCulledWithChildrenUnion,e._visible=!1;return}}function M_t(e,t){let{parent:n,tileset:i}=e;return!l(n)||n.hasTilesetContent||n.hasImplicitContent||n.refine!==Io.ADD?!1:e.getScreenSpaceError(t,!0)<=i.memoryAdjustedScreenSpaceError}function N_t(e,t){let n=!1,i=e.children;for(let r=0;r<i.length;++r){let o=i[r];o.updateVisibility(t),n=n||o.isVisible}return n}function L_t(e){let t=e.tileset._minimumPriority,n=e.tileset._maximumPriority,i=e._priorityHolder;n.distance=Math.max(i._distanceToCamera,n.distance),t.distance=Math.min(i._distanceToCamera,t.distance),n.depth=Math.max(e._depth,n.depth),t.depth=Math.min(e._depth,t.depth),n.foveatedFactor=Math.max(i._foveatedFactor,n.foveatedFactor),t.foveatedFactor=Math.min(i._foveatedFactor,t.foveatedFactor),n.reverseScreenSpaceError=Math.max(e._priorityReverseScreenSpaceError,n.reverseScreenSpaceError),t.reverseScreenSpaceError=Math.min(e._priorityReverseScreenSpaceError,t.reverseScreenSpaceError)}var ac=Ng;function rCe(){}var rR={stack:new Nu,stackMaximumLength:0};rCe.selectTiles=function(e,t){e._selectedTiles.length=0,e._requestedTiles.length=0,e.hasMixedContent=!1;let n=!0,i=e.root;if(i.updateVisibility(t),!i.isVisible)return n;let{touchTile:r,visitTile:o}=ac,s=rR.stack;for(s.push(i);s.length>0;){rR.stackMaximumLength=Math.max(rR.stackMaximumLength,s.length);let a=s.pop(),c=a.refine===Io.ADD,u=a.refine===Io.REPLACE,f=F_t(a);f&&B_t(a,s,t),(c||u&&!f)&&(k_t(e,a),r(a,t),U_t(a,t),a.hasRenderableContent&&!a.contentAvailable&&(n=!1)),o(a,t)}return rR.stack.trim(rR.stackMaximumLength),n};function F_t(e){return e.children.length===0?!1:e.hasTilesetContent||e.hasImplicitContent?!e.contentExpired:(e.hasEmptyContent,!0)}function B_t(e,t,n){let{children:i}=e;for(let r=0;r<i.length;++r){let o=i[r];o.updateVisibility(n),o.isVisible&&t.push(o)}}function k_t(e,t){(t.hasUnloadedRenderableContent||t.contentExpired)&&(t._priority=0,e._requestedTiles.push(t))}function U_t(e,t){e.contentAvailable&&e.contentVisibility(t)!==$t.OUTSIDE&&e.tileset._selectedTiles.push(e)}var X8=rCe;function oCe(){}var oR={stack:new Nu,stackMaximumLength:0},sR={stack:new Nu,stackMaximumLength:0};oCe.selectTiles=function(e,t){if(e._requestedTiles.length=0,e.debugFreezeFrame)return;e._selectedTiles.length=0,e._selectedTilesToStyle.length=0,e._emptyTiles.length=0,e.hasMixedContent=!1;let n=e.root;if(ac.updateTile(n,t),!n.isVisible||n.getScreenSpaceError(t,!0)<=e.memoryAdjustedScreenSpaceError)return;V_t(n,t),oR.stack.trim(oR.stackMaximumLength),sR.stack.trim(sR.stackMaximumLength);let i=e._requestedTiles;for(let r=0;r<i.length;++r)i[r].updatePriority()};function Eee(e,t){e.contentAvailable&&ac.selectTile(e,t)}function z_t(e,t,n){let i=e.refine===Io.REPLACE,{tileset:r,children:o}=e,{updateTile:s,loadTile:a,touchTile:c}=ac;for(let m=0;m<o.length;++m)s(o[m],n);o.sort(ac.sortChildrenByDistanceToCamera);let u=i&&e.hasRenderableContent,f=!0,d=!1,p=-1,g=Number.MAX_VALUE;for(let m=0;m<o.length;++m){let y=o[m];if(y.isVisible?(t.push(y),y._foveatedFactor<g&&(p=m,g=y._foveatedFactor),d=!0):(u||r.loadSiblings)&&(y._foveatedFactor<g&&(p=m,g=y._foveatedFactor),a(y,n),c(y,n)),u){let A;y._inRequestVolume?y.hasRenderableContent?A=y.contentAvailable:A=j_t(y,n):A=!1,f=f&&A}}if(d||(f=!1),p!==-1&&i){let m=o[p];m._wasMinPriorityChild=!0;let y=(e._wasMinPriorityChild||e===r.root)&&g<=e._priorityHolder._foveatedFactor?e._priorityHolder:e;y._foveatedFactor=Math.min(m._foveatedFactor,y._foveatedFactor),y._distanceToCamera=Math.min(m._distanceToCamera,y._distanceToCamera);for(let A=0;A<o.length;++A)o[A]._priorityHolder=y}return f}function V_t(e,t){let{tileset:n}=e,{canTraverse:i,loadTile:r,visitTile:o,touchTile:s}=ac,a=oR.stack;for(a.push(e);a.length>0;){oR.stackMaximumLength=Math.max(oR.stackMaximumLength,a.length);let c=a.pop(),u=c.parent,f=!l(u)||u._refines;c._refines=i(c)?z_t(c,a,t)&&f:!1;let d=!c._refines&&f;c.hasRenderableContent?c.refine===Io.ADD?(Eee(c,t),r(c,t)):c.refine===Io.REPLACE&&(r(c,t),d&&Eee(c,t)):(n._emptyTiles.push(c),r(c,t),d&&Eee(c,t)),o(c,t),s(c,t)}}function j_t(e,t){let{canTraverse:n,updateTile:i,loadTile:r,touchTile:o}=ac,s=e.tileset.hasExtension("3DTILES_content_gltf_vector"),a=!0,c=sR.stack;for(c.push(e);c.length>0;){sR.stackMaximumLength=Math.max(sR.stackMaximumLength,c.length);let u=c.pop(),f=u.children,d=f.length,p=!u.hasRenderableContent&&n(u);if((s?u.hasRenderableContent:!p)&&!u.contentAvailable&&(a=!1),i(u,t),u.isVisible||(r(u,t),o(u,t)),p)for(let m=0;m<d;++m){let y=f[m];c.push(y)}}return e.hasEmptyContent||a}var K8=oCe;function sCe(){}var aR={stack:new Nu,stackMaximumLength:0},cR={stack:new Nu,stackMaximumLength:0},Lg={stack:new Nu,stackMaximumLength:0,ancestorStack:new Nu,ancestorStackMaximumLength:0},H_t=2;sCe.selectTiles=function(e,t){if(e._requestedTiles.length=0,e.debugFreezeFrame)return;e._selectedTiles.length=0,e._selectedTilesToStyle.length=0,e._emptyTiles.length=0,e.hasMixedContent=!1;let n=e.root;if(ac.updateTile(n,t),!n.isVisible||n.getScreenSpaceError(t,!0)<=e.memoryAdjustedScreenSpaceError)return;K_t(n,t),$_t(n,t),aR.stack.trim(aR.stackMaximumLength),cR.stack.trim(cR.stackMaximumLength),Lg.stack.trim(Lg.stackMaximumLength),Lg.ancestorStack.trim(Lg.ancestorStackMaximumLength);let i=e._requestedTiles;for(let r=0;r<i.length;++r)i[r].updatePriority()};function G_t(e,t){let{updateTile:n,touchTile:i,selectTile:r}=ac,o=cR.stack;for(o.push(e);o.length>0;){cR.stackMaximumLength=Math.max(cR.stackMaximumLength,o.length);let a=o.pop().children;for(let c=0;c<a.length;++c){let u=a[c];u.isVisible&&(u.contentAvailable?(n(u,t),i(u,t),r(u,t)):u._depth-e._depth<H_t&&o.push(u))}}}function $8(e,t){let n=e.contentAvailable?e:e._ancestorWithContentAvailable;l(n)?n._shouldSelect=!0:G_t(e,t)}function W_t(e,t){e._ancestorWithContent=void 0,e._ancestorWithContentAvailable=void 0;let{parent:n}=e;if(!l(n))return;let i=!n.hasUnloadedRenderableContent||n._requestedFrame===t.frameNumber;e._ancestorWithContent=i?n:n._ancestorWithContent,e._ancestorWithContentAvailable=n.contentAvailable?n:n._ancestorWithContentAvailable}function q_t(e,t){let n=t._ancestorWithContent;return!e.immediatelyLoadDesiredLevelOfDetail&&(t._priorityProgressiveResolutionScreenSpaceErrorLeaf||l(n)&&t._screenSpaceError<n._screenSpaceError/e.skipScreenSpaceErrorFactor&&t._depth>n._depth+e.skipLevels)}function Y_t(e,t,n){let{tileset:i,children:r}=e,{updateTile:o,loadTile:s,touchTile:a}=ac;for(let u=0;u<r.length;++u)o(r[u],n);r.sort(ac.sortChildrenByDistanceToCamera);let c=!1;for(let u=0;u<r.length;++u){let f=r[u];f.isVisible?(t.push(f),c=!0):i.loadSiblings&&(s(f,n),a(f,n))}return c}function X_t(e,t){let{tileset:n}=e;return n.immediatelyLoadDesiredLevelOfDetail?!1:l(e._ancestorWithContent)?e._screenSpaceError===0?e.parent._screenSpaceError>t:e._screenSpaceError>t:!0}function K_t(e,t){let{tileset:n}=e,i=n.immediatelyLoadDesiredLevelOfDetail?Number.MAX_VALUE:Math.max(n.baseScreenSpaceError,n.memoryAdjustedScreenSpaceError),{canTraverse:r,loadTile:o,visitTile:s,touchTile:a}=ac,c=aR.stack;for(c.push(e);c.length>0;){aR.stackMaximumLength=Math.max(aR.stackMaximumLength,c.length);let u=c.pop();W_t(u,t);let f=u.parent,d=!l(f)||f._refines;u._refines=r(u)?Y_t(u,c,t)&&d:!1;let p=!u._refines&&d;u.hasRenderableContent?u.refine===Io.ADD?($8(u,t),o(u,t)):u.refine===Io.REPLACE&&(X_t(u,i)?(o(u,t),p&&$8(u,t)):p?($8(u,t),o(u,t)):q_t(n,u)&&o(u,t)):(n._emptyTiles.push(u),o(u,t),p&&$8(u,t)),s(u,t),a(u,t)}}function $_t(e,t){let{selectTile:n,canTraverse:i}=ac,{stack:r,ancestorStack:o}=Lg,s;for(r.push(e);r.length>0||o.length>0;){if(Lg.stackMaximumLength=Math.max(Lg.stackMaximumLength,r.length),Lg.ancestorStackMaximumLength=Math.max(Lg.ancestorStackMaximumLength,o.length),o.length>0){let u=o.peek();if(u._stackLength===r.length){o.pop(),u!==s&&(u._finalResolution=!1),n(u,t);continue}}let a=r.pop();if(!l(a))continue;let c=i(a);if(a._shouldSelect)if(a.refine===Io.ADD)n(a,t);else{if(a._selectionDepth=o.length,a._selectionDepth>0&&(a.tileset.hasMixedContent=!0),s=a,!c){n(a,t);continue}o.push(a),a._stackLength=r.length}if(c){let u=a.children;for(let f=0;f<u.length;++f){let d=u[f];d.isVisible&&r.push(d)}}}}var J8=sCe;function ya(){this._layers=[],this.layerAdded=new be,this.layerRemoved=new be,this.layerMoved=new be,this.layerShownOrHidden=new be}Object.defineProperties(ya.prototype,{length:{get:function(){return this._layers.length}}});ya.prototype.add=function(e,t){l(t)?this._layers.splice(t,0,e):(t=this._layers.length,this._layers.push(e)),this._update(),this.layerAdded.raiseEvent(e,t);let i=e.readyEvent.addEventListener(()=>{this.layerShownOrHidden.raiseEvent(e,e._layerIndex,e.show),i()})};ya.prototype.addImageryProvider=function(e,t){let n=new Ns(e);return this.add(n,t),n};ya.prototype.remove=function(e,t){t=t??!0;let n=this._layers.indexOf(e);return n!==-1?(this._layers.splice(n,1),this._update(),this.layerRemoved.raiseEvent(e,n),t&&e.destroy(),!0):!1};ya.prototype.removeAll=function(e){e=e??!0;let t=this._layers;for(let n=0,i=t.length;n<i;n++){let r=t[n];this.layerRemoved.raiseEvent(r,n),e&&r.destroy()}this._layers=[]};ya.prototype.contains=function(e){return this.indexOf(e)!==-1};ya.prototype.indexOf=function(e){return this._layers.indexOf(e)};ya.prototype.get=function(e){return this._layers[e]};function Z8(e,t){return e.indexOf(t)}function aCe(e,t,n){let i=e._layers;if(t=P.clamp(t,0,i.length-1),n=P.clamp(n,0,i.length-1),t===n)return;let r=i[t];i[t]=i[n],i[n]=r,e._update(),e.layerMoved.raiseEvent(r,n,t)}ya.prototype.raise=function(e){let t=Z8(this._layers,e);aCe(this,t,t+1)};ya.prototype.lower=function(e){let t=Z8(this._layers,e);aCe(this,t,t-1)};ya.prototype.raiseToTop=function(e){let t=Z8(this._layers,e);t!==this._layers.length-1&&(this._layers.splice(t,1),this._layers.push(e),this._update(),this.layerMoved.raiseEvent(e,this._layers.length-1,t))};ya.prototype.lowerToBottom=function(e){let t=Z8(this._layers,e);t!==0&&(this._layers.splice(t,1),this._layers.splice(0,0,e),this._update(),this.layerMoved.raiseEvent(e,0,t))};var cCe=new ie;function lCe(e,t,n,i){let r=e.globe._surface._tilesToRender,o;for(let a=0;!l(o)&&a<r.length;++a){let c=r[a];ie.contains(c.rectangle,t)&&(o=c)}if(!l(o))return;let s=o.data.imagery;for(let a=s.length-1;a>=0;--a){let c=s[a],u=c.readyImagery;if(!l(u)||!u.imageryLayer.ready)continue;let f=u.imageryLayer.imageryProvider;if(n&&!l(f.pickFeatures)||!ie.contains(u.rectangle,t))continue;let d=cCe,p=1/1024;d.west=P.lerp(o.rectangle.west,o.rectangle.east,c.textureCoordinateRectangle.x-p),d.east=P.lerp(o.rectangle.west,o.rectangle.east,c.textureCoordinateRectangle.z+p),d.south=P.lerp(o.rectangle.south,o.rectangle.north,c.textureCoordinateRectangle.y-p),d.north=P.lerp(o.rectangle.south,o.rectangle.north,c.textureCoordinateRectangle.w+p),ie.contains(d,t)&&i(u)}}ya.prototype.pickImageryLayers=function(e,t){let n=t.globe.pick(e,t);if(!l(n))return;let i=t.ellipsoid.cartesianToCartographic(n),r=[];if(lCe(t,i,!1,function(o){r.push(o.imageryLayer)}),r.length!==0)return r};var J_t=new ie,Z_t=new ie,Cee=new U,vee=new U,Q_t=new he,eyt=new he;function tyt(e,t,n,i){let r=n.imageryProvider.tilingScheme,o=r.rectangleToNativeRectangle(e,J_t),s=1/1024,a=Z_t;a.west=P.lerp(o.west,o.east,t.minX-s),a.east=P.lerp(o.west,o.east,t.maxX+s),a.south=P.lerp(o.south,o.north,t.minY-s),a.north=P.lerp(o.south,o.north,t.maxY+s),l(i)||(i=new ie);let c=r.projection;if(c instanceof ji)return i.west=P.toRadians(a.west),i.south=P.toRadians(a.south),i.east=P.toRadians(a.east),i.north=P.toRadians(a.north),i;Cee.x=a.west,Cee.y=a.south,vee.x=a.east,vee.y=a.north;let u=c.unproject(Cee,Q_t),f=c.unproject(vee,eyt);return i.west=u.longitude,i.south=u.latitude,i.east=f.longitude,i.north=f.latitude,i}function nyt(e,t,n){let i=e._modelImagery;if(!l(i))return;let r=i._modelPrimitiveImageries;if(l(r))for(let o=0;o<r.length;o++){let s=r[o],a=s._coveragesPerLayer;if(l(a))for(let c=a.length-1;c>=0;--c){let u=a[c];for(let f=0;f<u.length;f++){let d=u[f],p=d.imagery,g=p.imageryLayer,m=g.imageryProvider;if(!l(m.pickFeatures)||!l(p)||p.state!==jn.READY||!ie.contains(p.rectangle,t))continue;let A=s.mappedPositionsForImageryLayer(g).cartographicBoundingRectangle,b=tyt(A,d.textureCoordinateRectangle,g,cCe);ie.contains(b,t)&&n(p)}}}}ya.prototype.pickImageryLayerFeatures=function(e,t){let n;l(t.globe)&&(n=t.globe.pick(e,t));let i;if(!l(n)){let c=t.pickFromRay(e);if(!l(c)||(n=c.position,!l(n)))return;l(c.object)&&l(c.object.detail)&&(i=c.object.detail.model)}let r=t.ellipsoid.cartesianToCartographic(n),o=[],s=[];function a(c){if(!c.imageryLayer.ready)return;let f=c.imageryLayer.imageryProvider.pickFeatures(c.x,c.y,c.level,r.longitude,r.latitude);l(f)&&(o.push(f),s.push(c.imageryLayer))}if(l(t.globe)&&lCe(t,r,!0,function(c){a(c)}),l(i)&&nyt(i,r,function(c){a(c)}),o.length!==0)return Promise.all(o).then(function(c){let u=[];for(let f=0;f<c.length;++f){let d=c[f],p=s[f];if(l(d)&&d.length>0)for(let g=0;g<d.length;++g){let m=d[g];m.imageryLayer=p,l(m.position)||(m.position=r),u.push(m)}}return u})};ya.prototype.queueReprojectionCommands=function(e){let t=this._layers;for(let n=0,i=t.length;n<i;++n)t[n].queueReprojectionCommands(e)};ya.prototype.cancelReprojections=function(){let e=this._layers;for(let t=0,n=e.length;t<n;++t)e[t].cancelReprojections()};ya.prototype.isDestroyed=function(){return!1};ya.prototype.destroy=function(){return this.removeAll(!0),le(this)};ya.prototype._update=function(){let e=!0,t=this._layers,n,i,r,o;for(r=0,o=t.length;r<o;++r)i=t[r],i._layerIndex=r,i.show?(i._isBaseLayer=e,e=!1):i._isBaseLayer=!1,i.show!==i._show&&(l(i._show)&&(l(n)||(n=[]),n.push(i)),i._show=i.show);if(l(n))for(r=0,o=n.length;r<o;++r)i=n[r],this.layerShownOrHidden.raiseEvent(i,i._layerIndex,i.show)};var LS=ya;function ro(e){e=e??H.EMPTY_OBJECT,this._url=void 0,this._basePath=void 0,this._root=void 0,this._resource=void 0,this._asset=void 0,this._properties=void 0,this._geometricError=void 0,this._scaledGeometricError=void 0,this._extensionsUsed=void 0,this._extensions=void 0,this._modelUpAxis=void 0,this._modelForwardAxis=void 0,this._cache=new G8,this._externalTilesetTiles=[],this._externalTilesetSweepIndex=0,this._externalTilesetSweepCount=8,this._externalTilesetIdleFrames=e.externalTilesetIdleFrames??120,this._processingQueue=[],this._selectedTiles=[],this._emptyTiles=[],this._requestedTiles=[],this._selectedTilesToStyle=[],this._loadTimestamp=void 0,this._timeSinceLoad=0,this._updatedVisibilityFrame=0,this._updatedModelMatrixFrame=0,this._modelMatrixChanged=!1,this._previousModelMatrix=void 0,this._extras=void 0,this._credits=void 0,this._showCreditsOnScreen=e.showCreditsOnScreen??!1,this._cullWithChildrenBounds=e.cullWithChildrenBounds??!0,this._allTilesAdditive=!0,this._hasMixedContent=!1,this._stencilClearCommand=void 0,this._backfaceCommands=new Nu,this._maximumScreenSpaceError=e.maximumScreenSpaceError??16,this._memoryAdjustedScreenSpaceError=this._maximumScreenSpaceError,this._cacheBytes=e.cacheBytes??512*1024*1024;let t=e.maximumCacheOverflowBytes??512*1024*1024;this._maximumCacheOverflowBytes=t,this._styleEngine=new Y8,this._styleApplied=!1,this._modelMatrix=l(e.modelMatrix)?M.clone(e.modelMatrix):M.clone(M.IDENTITY),this._addHeightCallbacks=[],this._statistics=new Up,this._statisticsLast=new Up,this._statisticsPerPass=new Array(po.NUMBER_OF_PASSES);for(let r=0;r<po.NUMBER_OF_PASSES;++r)this._statisticsPerPass[r]=new Up;this._requestedTilesInFlight=[],this._maximumPriority={foveatedFactor:-Number.MAX_VALUE,depth:-Number.MAX_VALUE,distance:-Number.MAX_VALUE,reverseScreenSpaceError:-Number.MAX_VALUE},this._minimumPriority={foveatedFactor:Number.MAX_VALUE,depth:Number.MAX_VALUE,distance:Number.MAX_VALUE,reverseScreenSpaceError:Number.MAX_VALUE},this._heatmap=new q8(e.debugHeatmapTilePropertyName),this.cullRequestsWhileMoving=e.cullRequestsWhileMoving??!0,this._cullRequestsWhileMoving=!1,this.cullRequestsWhileMovingMultiplier=e.cullRequestsWhileMovingMultiplier??60,this.progressiveResolutionHeightFraction=P.clamp(e.progressiveResolutionHeightFraction??.3,0,.5),this.preferLeaves=e.preferLeaves??!1,this._tilesLoaded=!1,this._initialTilesLoaded=!1,this._tileDebugLabels=void 0,this._classificationType=e.classificationType,this._heightReference=e.heightReference,this._scene=e.scene,this._ellipsoid=e.ellipsoid??ee.WGS84,this._initialClippingPlanesOriginMatrix=M.IDENTITY,this._clippingPlanesOriginMatrix=void 0,this._clippingPlanesOriginMatrixDirty=!0,this._vectorClassificationOnly=e.vectorClassificationOnly??!1,this._vectorKeepDecodedPositions=e.vectorKeepDecodedPositions??!1,this._imageryLayers=new LS(this),this._imageryLayersModificationCounter=0,this._imageryLayersListener=()=>{this._imageryLayersModificationCounter++},this.imageryLayers.layerAdded.addEventListener(this._imageryLayersListener),this.imageryLayers.layerRemoved.addEventListener(this._imageryLayersListener),this.imageryLayers.layerMoved.addEventListener(this._imageryLayersListener),this.imageryLayers.layerShownOrHidden.addEventListener(this._imageryLayersListener),this._asynchronouslyLoadImagery=e.asynchronouslyLoadImagery??!1,this.preloadWhenHidden=e.preloadWhenHidden??!1,this.preloadFlightDestinations=e.preloadFlightDestinations??!0,this._pass=void 0,this.dynamicScreenSpaceError=e.dynamicScreenSpaceError??!0,this.foveatedScreenSpaceError=e.foveatedScreenSpaceError??!0,this._foveatedConeSize=e.foveatedConeSize??.1,this._foveatedMinimumScreenSpaceErrorRelaxation=e.foveatedMinimumScreenSpaceErrorRelaxation??0,this.foveatedInterpolationCallback=e.foveatedInterpolationCallback??P.lerp,this.foveatedTimeDelay=e.foveatedTimeDelay??.2,this.dynamicScreenSpaceErrorDensity=e.dynamicScreenSpaceErrorDensity??2e-4,this.dynamicScreenSpaceErrorFactor=e.dynamicScreenSpaceErrorFactor??24,this.dynamicScreenSpaceErrorHeightFalloff=e.dynamicScreenSpaceErrorHeightFalloff??.25,this._dynamicScreenSpaceErrorComputedDensity=0,this.shadows=e.shadows??Pn.ENABLED,this.show=e.show??!0,this.colorBlendMode=yf.HIGHLIGHT,this.colorBlendAmount=.5,this._pointCloudShading=new ug(e.pointCloudShading),this._pointCloudEyeDomeLighting=new vy,this.loadProgress=new be,this.allTilesLoaded=new be,this.initialTilesLoaded=new be,this.tileLoad=new be,this.tileUnload=new be,this.tileFailed=new be,this.tileVisible=new be,this.skipLevelOfDetail=e.skipLevelOfDetail??!1,this._disableSkipLevelOfDetail=!1,this._runtimeContentCodec=void 0,this.baseScreenSpaceError=e.baseScreenSpaceError??1024,this.skipScreenSpaceErrorFactor=e.skipScreenSpaceErrorFactor??16,this.skipLevels=e.skipLevels??1,this.immediatelyLoadDesiredLevelOfDetail=e.immediatelyLoadDesiredLevelOfDetail??!1,this.loadSiblings=e.loadSiblings??!1,this._clippingPlanes=void 0,l(e.clippingPlanes)&&Ds.setOwner(e.clippingPlanes,this,"_clippingPlanes"),this._clippingPolygons=void 0,this._clippingPolygonsNeedRebake=!1,this._removeClippingPolygonAdded=void 0,this._removeClippingPolygonRemoved=void 0,l(e.clippingPolygons)&&($c.setOwner(e.clippingPolygons,this,"_clippingPolygons"),mCe(this)),l(e.imageBasedLighting)?(this._imageBasedLighting=e.imageBasedLighting,this._shouldDestroyImageBasedLighting=!1):(this._imageBasedLighting=new Fv,this._shouldDestroyImageBasedLighting=!0),this._environmentMapManager=new py(e.environmentMapOptions),this.lightColor=e.lightColor,this.backFaceCulling=e.backFaceCulling??!0,this._enableShowOutline=e.enableShowOutline??!0,this.showOutline=e.showOutline??!0,this.outlineColor=e.outlineColor??z.BLACK,this.splitDirection=e.splitDirection??Yo.NONE,this.enableCollision=e.enableCollision??!1,this.maximumHeightQueryGeometricError=e.maximumHeightQueryGeometricError??500,this._projectTo2D=e.projectTo2D??!1,this._enablePick=e.enablePick??!1,this.debugFreezeFrame=e.debugFreezeFrame??!1,this.debugColorizeTiles=e.debugColorizeTiles??!1,this._enableDebugWireframe=e.enableDebugWireframe??!1,this.debugWireframe=e.debugWireframe??!1,this.debugWireframe===!0&&this._enableDebugWireframe===!1&&yt("tileset-debug-wireframe-ignored","enableDebugWireframe must be set to true in the Cesium3DTileset constructor, otherwise debugWireframe will be ignored."),this.edgeDisplayMode=e.edgeDisplayMode??kh.SURFACES_ONLY,this.debugShowBoundingVolume=e.debugShowBoundingVolume??!1,this.debugShowContentBoundingVolume=e.debugShowContentBoundingVolume??!1,this.debugShowViewerRequestVolume=e.debugShowViewerRequestVolume??!1,this._tileDebugLabels=void 0,this.debugPickedTileLabelOnly=!1,this.debugPickedTile=void 0,this.debugPickPosition=void 0,this.debugShowGeometricError=e.debugShowGeometricError??!1,this.debugShowRenderingStatistics=e.debugShowRenderingStatistics??!1,this.debugShowMemoryUsage=e.debugShowMemoryUsage??!1,this.debugShowUrl=e.debugShowUrl??!1,this.examineVectorLinesFunction=void 0,this._metadataExtension=void 0,this._customShader=e.customShader;let n=e.featureIdLabel??"featureId_0";typeof n=="number"&&(n=`featureId_${n}`),this._featureIdLabel=n;let i=e.instanceFeatureIdLabel??"instanceFeatureId_0";typeof i=="number"&&(i=`instanceFeatureId_${i}`),this._instanceFeatureIdLabel=i}Object.defineProperties(ro.prototype,{isCesium3DTileset:{get:function(){return!0}},asset:{get:function(){return this._asset}},extensions:{get:function(){return this._extensions}},clippingPlanes:{get:function(){return this._clippingPlanes},set:function(e){Ds.setOwner(e,this,"_clippingPlanes")}},clippingPolygons:{get:function(){return this._clippingPolygons},set:function(e){$c.setOwner(e,this,"_clippingPolygons"),mCe(this),this._clippingPolygonsNeedRebake=!0}},imageryLayers:{get:function(){return this._imageryLayers}},imageryLayersModificationCounter:{get:function(){return this._imageryLayersModificationCounter}},asynchronouslyLoadImagery:{get:function(){return this._asynchronouslyLoadImagery}},properties:{get:function(){return this._properties}},tilesLoaded:{get:function(){return this._tilesLoaded}},resource:{get:function(){return this._resource}},basePath:{get:function(){return Yr("Cesium3DTileset.basePath","Cesium3DTileset.basePath has been deprecated. All tiles are relative to the url of the tileset JSON file that contains them. Use the url property instead."),this._basePath}},style:{get:function(){return this._styleEngine.style},set:function(e){this._styleEngine.style=e}},customShader:{get:function(){return this._customShader},set:function(e){this._customShader=e}},hasMixedContent:{get:function(){return this._hasMixedContent},set:function(e){this._hasMixedContent=e}},isSkippingLevelOfDetail:{get:function(){return this.skipLevelOfDetail&&!l(this._classificationType)&&!this._disableSkipLevelOfDetail&&!this._allTilesAdditive}},metadataExtension:{get:function(){return this._metadataExtension}},metadata:{get:function(){if(l(this._metadataExtension))return this._metadataExtension.tileset}},schema:{get:function(){if(l(this._metadataExtension))return this._metadataExtension.schema}},maximumScreenSpaceError:{get:function(){return this._maximumScreenSpaceError},set:function(e){this._maximumScreenSpaceError=e,this._memoryAdjustedScreenSpaceError=e}},cacheBytes:{get:function(){return this._cacheBytes},set:function(e){this._cacheBytes=e}},maximumCacheOverflowBytes:{get:function(){return this._maximumCacheOverflowBytes},set:function(e){this._maximumCacheOverflowBytes=e}},externalTilesetIdleFrames:{get:function(){return this._externalTilesetIdleFrames},set:function(e){this._externalTilesetIdleFrames=e}},memoryAdjustedScreenSpaceError:{get:function(){return this._memoryAdjustedScreenSpaceError}},pointCloudShading:{get:function(){return this._pointCloudShading},set:function(e){this._pointCloudShading=e}},root:{get:function(){return this._root}},boundingSphere:{get:function(){return this._root.updateTransform(this._modelMatrix),this._root.boundingSphere}},modelMatrix:{get:function(){return this._modelMatrix},set:function(e){this._modelMatrix=M.clone(e,this._modelMatrix)}},timeSinceLoad:{get:function(){return this._timeSinceLoad}},totalMemoryUsageInBytes:{get:function(){let e=this._statistics;return e.texturesByteLength+e.geometryByteLength+e.batchTableByteLength}},clippingPlanesOriginMatrix:{get:function(){return l(this._clippingPlanesOriginMatrix)?(this._clippingPlanesOriginMatrixDirty&&(M.multiply(this.root.computedTransform,this._initialClippingPlanesOriginMatrix,this._clippingPlanesOriginMatrix),this._clippingPlanesOriginMatrixDirty=!1),this._clippingPlanesOriginMatrix):M.IDENTITY}},styleEngine:{get:function(){return this._styleEngine}},statistics:{get:function(){return this._statistics}},classificationType:{get:function(){return this._classificationType}},heightReference:{get:function(){return this._heightReference}},scene:{get:function(){return this._scene}},ellipsoid:{get:function(){return this._ellipsoid}},foveatedConeSize:{get:function(){return this._foveatedConeSize},set:function(e){this._foveatedConeSize=e}},foveatedMinimumScreenSpaceErrorRelaxation:{get:function(){return this._foveatedMinimumScreenSpaceErrorRelaxation},set:function(e){this._foveatedMinimumScreenSpaceErrorRelaxation=e}},extras:{get:function(){return this._extras}},imageBasedLighting:{get:function(){return this._imageBasedLighting},set:function(e){e!==this._imageBasedLighting&&(this._shouldDestroyImageBasedLighting&&!this._imageBasedLighting.isDestroyed()&&this._imageBasedLighting.destroy(),this._imageBasedLighting=e,this._shouldDestroyImageBasedLighting=!1)}},environmentMapManager:{get:function(){return this._environmentMapManager}},vectorClassificationOnly:{get:function(){return this._vectorClassificationOnly}},vectorKeepDecodedPositions:{get:function(){return this._vectorKeepDecodedPositions}},showCreditsOnScreen:{get:function(){return this._showCreditsOnScreen},set:function(e){this._showCreditsOnScreen=e,ACe(this)}},featureIdLabel:{get:function(){return this._featureIdLabel},set:function(e){typeof e=="number"&&(e=`featureId_${e}`),this._featureIdLabel=e}},instanceFeatureIdLabel:{get:function(){return this._instanceFeatureIdLabel},set:function(e){typeof e=="number"&&(e=`instanceFeatureId_${e}`),this._instanceFeatureIdLabel=e}}});ro.fromIonAssetId=async function(e,t){let n=await es.fromAssetId(e);return ro.fromUrl(n,t)};ro.fromUrl=async function(e,t){t=t??H.EMPTY_OBJECT;let n=De.createIfNeeded(e),i;n.extension==="json"?i=n.getBaseUri(!0):n.isDataUri&&(i="");let r=await ro.loadJson(n),o=await iyt(n,r),s=new ro(t);s._resource=n,s._url=n.url,s._basePath=i,s._metadataExtension=o,s._geometricError=r.geometricError,s._scaledGeometricError=r.geometricError;let a=r.asset;s._asset=a,s._extras=r.extras,ACe(s);let c=l(r.asset.gltfUpAxis)?qi.fromName(r.asset.gltfUpAxis):qi.Y,u=t.modelUpAxis??c,f=t.modelForwardAxis??qi.X;s._properties=r.properties,s._extensionsUsed=r.extensionsUsed,s._extensions=r.extensions,s._modelUpAxis=u,s._modelForwardAxis=f,s._root=s.loadTileset(n,r);let p=s._root.createBoundingVolume(r.root.boundingVolume,M.IDENTITY).boundingSphere.center,g=s._ellipsoid.cartesianToCartographic(p);return l(g)&&g.height>Ni._defaultMinTerrainHeight&&(s._initialClippingPlanesOriginMatrix=At.eastNorthUpToFixedFrame(p)),s._clippingPlanesOriginMatrix=M.clone(s._initialClippingPlanesOriginMatrix),s};ro.loadJson=function(e){return De.createIfNeeded(e).fetchJson()};ro.prototype.makeStyleDirty=function(){this._styleEngine.makeDirty()};ro.prototype.loadTileset=function(e,t,n){let i=t.asset;if(!l(i))throw new oe("Tileset must have an asset property.");if(i.version!=="0.0"&&i.version!=="1.0"&&i.version!=="1.1")throw new oe("The tileset must be 3D Tiles version 0.0, 1.0, or 1.1");l(t.extensionsRequired)&&ro.checkSupportedExtensions(t.extensionsRequired);let r=this._statistics;l(n)&&this._externalTilesetTiles.push(n);let o=i.tilesetVersion;l(o)&&(this._basePath+=`?v=${o}`,e=e.clone(),e.setQueryParameters({v:o}));let s=uCe(this,e,t.root,n);l(n)&&(n.children.push(s),s._depth=n._depth+1);let a=[];for(a.push(s);a.length>0;){let c=a.pop();++r.numberOfTilesTotal,this._allTilesAdditive=this._allTilesAdditive&&c.refine===Io.ADD;let u=c._header.children;if(l(u))for(let f=0;f<u.length;++f){let d=u[f],p=uCe(this,e,d,c);c.children.push(p),p._depth=c._depth+1,a.push(p)}this._cullWithChildrenBounds&&j8.checkChildrenWithinParent(c)}return s};function uCe(e,t,n,i){if(!(l(n.implicitTiling)||lr(n,"3DTILES_implicit_tiling")))return new nm(e,t,n,i);let o=e.schema,s=new Og(t,n,o),a=new Mg({subdivisionScheme:s.subdivisionScheme,subtreeLevels:s.subtreeLevels,level:0,x:0,y:0,z:0}),c=s.subtreeUriTemplate.getDerivedResource({templateValues:a.getTemplateValues()}).url,f=Ze(n,!0);f.contents=[{uri:c}],delete f.content,delete f.extensions;let d=new nm(e,t,f,i);return d.implicitTileset=s,d.implicitCoordinates=a,d}async function iyt(e,t){let n=lr(t,"3DTILES_metadata")?t.extensions["3DTILES_metadata"]:t,i;if(l(n.schemaUri))e=e.getDerivedResource({url:n.schemaUri}),i=ki.getSchemaLoader({resource:e});else if(l(n.schema))i=ki.getSchemaLoader({schema:n.schema});else return;await i.load();let r=new MS({schema:i.schema,metadataJson:n});return ki.unload(i),r}var fCe=new h,ryt=new he,oyt=new M,syt=new h,ayt=new h,cyt=new h,lyt=new h;function uyt(e,t){let n,i,r,o,s,a=t.camera,c=e._root,u=c.contentBoundingVolume;if(u instanceof Ud)n=h.normalize(a.positionWC,fCe),i=a.directionWC,r=a.positionCartographic.height,o=u.minimumHeight,s=u.maximumHeight;else{let y=M.inverseTransformation(c.computedTransform,oyt),A=t.mapProjection.ellipsoid,b=u.boundingVolume,x=M.multiplyByPoint(y,b.center,syt);if(h.magnitude(x)>A.minimumRadius){let T=he.fromCartesian(x,A,ryt);n=h.normalize(a.positionWC,fCe),i=a.directionWC,r=a.positionCartographic.height,o=0,s=T.height*2}else{let T=M.multiplyByPoint(y,a.positionWC,ayt);if(n=h.UNIT_Z,i=M.multiplyByPointAsVector(y,a.directionWC,cyt),i=h.normalize(i,i),r=T.z,u instanceof Sf){let E=$.getColumn(b.halfAxes,2,lyt),v=h.magnitude(E);o=x.z-v,s=x.z+v}else if(u instanceof eA){let E=b.radius;o=x.z-E,s=x.z+E}}}let f=e.dynamicScreenSpaceErrorHeightFalloff,d=o+(s-o)*f,p=s,g=P.clamp((r-d)/(p-d),0,1),m=1-Math.abs(h.dot(i,n));m=m*(1-g),e._dynamicScreenSpaceErrorComputedDensity=e.dynamicScreenSpaceErrorDensity*m}function fyt(e,t){if(t.hasEmptyContent)return;let{statistics:n}=e,i=t.contentExpired,r=t.requestContent();l(r)&&(r.then(o=>{!l(o)||t.isDestroyed()||e.isDestroyed()||(e._processingQueue.push(t),++n.numberOfTilesProcessing)}).catch(o=>{pCe(o,e,t)}),i&&(t.hasTilesetContent||t.hasImplicitContent?_Ce(e,t):(n.decrementLoadCounts(t.content),--n.numberOfTilesWithContentReady)),e._requestedTilesInFlight.push(t))}function hCe(e,t){return e._priority-t._priority}ro.prototype.postPassesUpdate=function(e){l(this._root)&&(dyt(this,e),Dyt(this,e),this._cache.unloadTiles(this,yCe),Iyt(this,e),this._styleApplied&&this._styleEngine.resetDirty(),this._styleApplied=!1)};function mCe(e){e._removeClippingPolygonAdded=e._removeClippingPolygonAdded&&e._removeClippingPolygonAdded(),e._removeClippingPolygonRemoved=e._removeClippingPolygonRemoved&&e._removeClippingPolygonRemoved();let t=e._clippingPolygons;if(!l(t))return;let n=()=>{e._clippingPolygonsNeedRebake=!0};e._removeClippingPolygonAdded=t.polygonAdded.addEventListener(n),e._removeClippingPolygonRemoved=t.polygonRemoved.addEventListener(n)}ro.prototype.prePassesUpdate=function(e){if(!l(this._root))return;Ayt(this,e);let t=this._clippingPlanes;this._clippingPlanesOriginMatrixDirty=!0,l(t)&&t.enabled&&t.update(e);let n=this._clippingPolygons;l(n)&&n.enabled&&n.update(e),this._clippingPolygonsNeedRebake&&(this._clippingPolygonsNeedRebake=!1,this._cache.forEachLoadedTile(i=>{i.clippingPolygonsNeedRebake=!0})),l(this._loadTimestamp)||(this._loadTimestamp=K.clone(e.time)),this._timeSinceLoad=Math.max(K.secondsDifference(e.time,this._loadTimestamp)*1e3,0),this.dynamicScreenSpaceError&&uyt(this,e),e.newFrame&&this._cache.reset()};function dyt(e,t){let n=e._requestedTilesInFlight,i=0;for(let r=0;r<n.length;++r){let o=n[r],s=t.frameNumber-o._touchedFrame>=1;if(o._contentState!==Mr.LOADING){++i;continue}else if(s){o.cancelRequests(),++i;continue}i>0&&(n[r-i]=o)}n.length-=i}function hyt(e){let t=e._requestedTiles;t.sort(hCe);for(let n=0;n<t.length;++n)fyt(e,t[n])}function pCe(e,t,n){if(t.isDestroyed())return;let i;n.isDestroyed()||(i=n._contentResource.url);let r=l(e.message)?e.message:e.toString();t.tileFailed.numberOfListeners>0?t.tileFailed.raiseEvent({url:i,message:r}):(console.log(`A 3D tile failed to load: ${i}`),console.log(`Error: ${r}`),console.log(e.stack))}function myt(e){let t=e._processingQueue,n=0;for(let i=0;i<t.length;++i){let r=t[i];if(r.isDestroyed()||r._contentState!==Mr.PROCESSING){++n;continue}n>0&&(t[i-n]=r)}t.length-=n}var pyt=new he,gyt=new he,_yt=new h;function yyt(e,t,n){if(!e.enableCollision||!e.show||t._wasSelectedLastFrame)return;let i=e._addHeightCallbacks,r=t.boundingSphere,o=i.length;for(let s=0;s<o;++s){let a=i[s];if(a.invoked)continue;let c=a.ellipsoid,u=he.clone(a.positionCartographic,pyt),f=he.fromCartesian(r.center,c,gyt);l(f)&&(u.height=f.height);let d=he.toCartesian(u,c,_yt);h.distance(d,r.center)<=r.radius&&(a.invoked=!0,n.afterRender.push(()=>{l(a.callback)&&a.callback(),a.invoked=!1}))}}function Ayt(e,t){myt(e);let n=e._processingQueue,{cacheBytes:i,maximumCacheOverflowBytes:r,statistics:o}=e,s=i+r,a=!1;for(let c=0;c<n.length;++c){if(e.totalMemoryUsageInBytes>s){a=!0;break}let u=n[c];try{u.process(e,t),u.contentReady&&(--o.numberOfTilesProcessing,e.tileLoad.raiseEvent(u))}catch(f){--o.numberOfTilesProcessing,pCe(f,e,u)}}e.totalMemoryUsageInBytes<i?xyt(e):a&&n.length>0&&byt(e)}function byt(e){e._memoryAdjustedScreenSpaceError*=1.02;let t=e._processingQueue;for(let n=0;n<t.length;++n)t[n].updatePriority();t.sort(hCe)}function xyt(e){e._memoryAdjustedScreenSpaceError=Math.max(e.memoryAdjustedScreenSpaceError/1.02,e.maximumScreenSpaceError)}var Q8=new h,Tyt={maximumFractionDigits:3};function dCe(e){let t=e/1048576;return t<1?t.toLocaleString(void 0,Tyt):Math.round(t).toLocaleString()}function See(e){let{halfAxes:t,radius:n,center:i}=e.boundingVolume.boundingVolume,r=h.clone(i,Q8);if(l(t))r.x+=.75*(t[0]+t[3]+t[6]),r.y+=.75*(t[1]+t[4]+t[7]),r.z+=.75*(t[2]+t[5]+t[8]);else if(l(n)){let o=h.normalize(i,Q8);o=h.multiplyByScalar(o,.75*n,Q8),r=h.add(o,i,Q8)}return r}function wee(e,t,n){let i="",r=0;if(t.debugShowGeometricError&&(i+=` Geometric error: ${e.geometricError}`,r++),t.debugShowRenderingStatistics&&(i+=` Commands: ${e.commandsLength}`,r++,e.content.pointsLength>0&&(i+=` Points: ${e.content.pointsLength}`,r++),e.content.trianglesLength>0&&(i+=` Triangles: ${e.content.trianglesLength}`,r++),i+=` Features: ${e.content.featuresLength}`,r++),t.debugShowMemoryUsage&&(i+=` -Texture Memory: ${Exe(e.content.texturesByteLength)}`,i+=` -Geometry Memory: ${Exe(e.content.geometryByteLength)}`,r+=2),t.debugShowUrl)if(e.hasMultipleContents){i+=` +Texture Memory: ${dCe(e.content.texturesByteLength)}`,i+=` +Geometry Memory: ${dCe(e.content.geometryByteLength)}`,r+=2),t.debugShowUrl)if(e.hasMultipleContents){i+=` Urls:`;let s=e.content.innerContentUrls;for(let a=0;a<s.length;a++)i+=` - ${s[a]}`;r+=s.length}else i+=` -Url: ${e._contentHeader.uri}`,r++;let o={text:i.substring(1),position:n,font:`${19-r}px sans-serif`,showBackground:!0,disableDepthTestDistance:Number.POSITIVE_INFINITY};return t._tileDebugLabels.add(o)}function qmt(e,t){let n=e._selectedTiles,i=n.length,r=e._emptyTiles,o=r.length;if(e._tileDebugLabels.removeAll(),e.debugPickedTileLabelOnly){if(l(e.debugPickedTile)){let s=l(e.debugPickPosition)?e.debugPickPosition:OQ(e.debugPickedTile),a=MQ(e.debugPickedTile,e,s);a.pixelOffset=new U(15,-15)}}else{for(let s=0;s<i;++s){let a=n[s];MQ(a,e,OQ(a))}for(let s=0;s<o;++s){let a=r[s];(a.hasTilesetContent||a.hasImplicitContent)&&MQ(a,e,OQ(a))}}e._tileDebugLabels.update(t)}function Ymt(e,t,n){e._styleEngine.applyStyle(e),e._styleApplied=!0;let{commandList:i,context:r}=t,o=i.length,s=e._selectedTiles,a=e.isSkippingLevelOfDetail&&e._hasMixedContent&&r.stencilBuffer&&s.length>0;e._backfaceCommands.length=0,a&&(l(e._stencilClearCommand)||(e._stencilClearCommand=new fi({stencil:0,pass:Ie.CESIUM_3D_TILE,renderState:Ge.fromCache({stencilMask:Xt.SKIP_LOD_MASK})})),i.push(e._stencilClearCommand));let{statistics:c,tileVisible:u}=e,f=n.isRender,d=i.length;for(let m=0;m<s.length;++m){let y=s[m];f&&u.raiseEvent(y),Vmt(e,y,t),y.update(e,t,n),c.incrementSelectionCounts(y.content),++c.selected}let p=e._emptyTiles;for(let m=0;m<p.length;++m)p[m].update(e,t,n);let g=i.length-d;if(e._backfaceCommands.trim(),a){let m=e._backfaceCommands.values,y=m.length;i.length+=y;for(let A=g-1;A>=0;--A)i[d+y+A]=i[d+A];for(let A=0;A<y;++A)i[d+A]=m[A]}g=i.length-o,c.numberOfCommands=g,f&&(e.pointCloudShading.attenuation&&e.pointCloudShading.eyeDomeLighting&&g>0&&e._pointCloudEyeDomeLighting.update(t,o,e.pointCloudShading,e.boundingSphere),e.debugShowGeometricError||e.debugShowRenderingStatistics||e.debugShowMemoryUsage||e.debugShowUrl?(l(e._tileDebugLabels)||(e._tileDebugLabels=new hg),qmt(e,t)):e._tileDebugLabels=e._tileDebugLabels&&e._tileDebugLabels.destroy())}var wxe=[],Xmt=[];function Ixe(e,t){let n=t,i=wxe;for(i.push(t);i.length>0;){t=i.pop();let r=t.children;for(let o=0;o<r.length;++o)i.push(r[o]);t!==n&&(Zmt(e,t),--e._statistics.numberOfTilesTotal)}n.children=[]}function Pxe(e,t){e.tileUnload.raiseEvent(t),e._statistics.decrementLoadCounts(t.content),--e._statistics.numberOfTilesWithContentReady,t.unloadContent()}function t8(e,t){let n=e-t;return n<0?n+Bx.maximumFrameNumber:n}var Kmt=64;function $mt(e,t,n){let i=Xmt;for(i.length=0,i.push(e);i.length>0;){let r=i.pop(),o=r._contentState;if(o===Mr.LOADING||o===Mr.PROCESSING||!r.hasEmptyContent&&!r.hasTilesetContent&&o!==Mr.UNLOADED&&o!==Mr.FAILED||l(r.cacheNode)||Math.min(t8(t,r._visitedFrame),t8(t,r._touchedFrame),t8(t,r._selectedFrame),t8(t,r._requestedFrame))<n)return i.length=0,!0;let c=r.children;for(let u=0;u<c.length;++u)i.push(c[u])}return!1}function Jmt(e,t){let n=e._externalTilesetTiles,i=t.frameNumber,r=e._externalTilesetIdleFrames,o=e._externalTilesetSweepCount,s=0,a=0;for(;s<o&&a<Kmt&&n.length>0;){++a,e._externalTilesetSweepIndex>=n.length&&(e._externalTilesetSweepIndex=0);let c=e._externalTilesetSweepIndex,u=n[c];if(u.isDestroyed()||!u.hasTilesetContent||u.children.length===0){n.splice(c,1);continue}++e._externalTilesetSweepIndex,++s,!$mt(u,i,r)&&(Ixe(e,u),u.unloadTilesetContent(),n.splice(c,1),e._externalTilesetSweepIndex=c)}}function Zmt(e,t){e._cache.unloadTile(e,t,Pxe),t.destroy()}ro.prototype.trimLoadedTiles=function(){this._cache.trim()};function Qmt(e,t){let n=e._statistics,i=e._statisticsLast,r=n.numberOfPendingRequests,o=n.numberOfTilesProcessing,s=i.numberOfPendingRequests,a=i.numberOfTilesProcessing;Pp.clone(n,i);let c=r!==s||o!==a;c&&t.afterRender.push(function(){return e.loadProgress.raiseEvent(r,o),!0}),e._tilesLoaded=n.numberOfPendingRequests===0&&n.numberOfTilesProcessing===0&&n.numberOfAttemptedRequests===0,c&&e._tilesLoaded&&(t.afterRender.push(function(){return e.allTilesLoaded.raiseEvent(),!0}),e._initialTilesLoaded||(e._initialTilesLoaded=!0,t.afterRender.push(function(){return e.initialTilesLoaded.raiseEvent(),!0})))}function ept(e){e._heatmap.resetMinimumMaximum(),e._minimumPriority.depth=Number.MAX_VALUE,e._maximumPriority.depth=-Number.MAX_VALUE,e._minimumPriority.foveatedFactor=Number.MAX_VALUE,e._maximumPriority.foveatedFactor=-Number.MAX_VALUE,e._minimumPriority.distance=Number.MAX_VALUE,e._maximumPriority.distance=-Number.MAX_VALUE,e._minimumPriority.reverseScreenSpaceError=Number.MAX_VALUE,e._maximumPriority.reverseScreenSpaceError=-Number.MAX_VALUE}function tpt(e,t){t.frameNumber===e._updatedModelMatrixFrame&&l(e._previousModelMatrix)||(e._updatedModelMatrixFrame=t.frameNumber,e._modelMatrixChanged=!M.equals(e.modelMatrix,e._previousModelMatrix),e._modelMatrixChanged&&(e._previousModelMatrix=M.clone(e.modelMatrix,e._previousModelMatrix)))}function npt(e,t,n,i){if(t.mode===re.MORPHING||!l(e._root))return!1;let r=e._statistics;r.clear(),++e._updatedVisibilityFrame,ept(e),tpt(e,t),e._cullRequestsWhileMoving=e.cullRequestsWhileMoving&&!e._modelMatrixChanged;let o=e.getTraversal(i).selectTiles(e,t);if(i.requestTiles&&Fmt(e),Ymt(e,t,i),Pp.clone(r,n),i.isRender){let s=e._credits;if(l(s)&&r.selected!==0)for(let a=0;a<s.length;++a){let c=s[a];t.creditDisplay.addCreditToNextFrame(c)}}return o}function Dxe(e){let t=e._credits;l(t)||(t=[]),t.length=0,l(e.resource.credits)&&e.resource.credits.forEach(i=>{t.push(It.clone(i))});let n=e.asset.extras;if(l(n)&&l(n.cesium)&&l(n.cesium.credits)){let i=n.cesium.credits;for(let r=0;r<i.length;++r){let o=i[r];t.push(new It(o.html))}}t.forEach(i=>i.showOnScreen=i.showOnScreen||e._showCreditsOnScreen),e._credits=t}ro.prototype.getTraversal=function(e){let{pass:t}=e;return t===po.MOST_DETAILED_PRELOAD||t===po.MOST_DETAILED_PICK?K4:this.isSkippingLevelOfDetail?Z4:$4};ro.prototype.update=function(e){this.updateForPass(e,e.tilesetPassState)};ro.prototype.updateForPass=function(e,t){this.imageryLayers._update();let n=t.pass;if(n===po.PRELOAD&&(!this.preloadWhenHidden||this.show)||n===po.PRELOAD_FLIGHT&&(!this.preloadFlightDestinations||!this.show&&!this.preloadWhenHidden)||n===po.REQUEST_RENDER_MODE_DEFER_CHECK&&(!this._cullRequestsWhileMoving&&this.foveatedTimeDelay<=0||!this.show))return;let i=e.commandList,r=e.camera,o=e.cullingVolume;t.ready=!1;let s=po.getPassOptions(n),a=s.ignoreCommands,c=t.commandList??i,u=c.length;if(e.commandList=c,e.camera=t.camera??r,e.cullingVolume=t.cullingVolume??o,s.isRender){let d=this._environmentMapManager;l(this._root)&&(d.position=this.boundingSphere.center),d.update(e)}let f=this._statisticsPerPass[n];(this.show||a)&&(this._pass=n,t.ready=npt(this,e,f,s)),a&&(c.length=u),e.commandList=i,e.camera=r,e.cullingVolume=o};ro.prototype.hasExtension=function(e){return l(this._extensionsUsed)?this._extensionsUsed.indexOf(e)>-1:!1};ro.prototype.isDestroyed=function(){return!1};ro.prototype.destroy=function(){if(this._tileDebugLabels=this._tileDebugLabels&&this._tileDebugLabels.destroy(),this._removeClippingPolygonAdded=this._removeClippingPolygonAdded&&this._removeClippingPolygonAdded(),this._removeClippingPolygonRemoved=this._removeClippingPolygonRemoved&&this._removeClippingPolygonRemoved(),this._clippingPlanes=this._clippingPlanes&&this._clippingPlanes.destroy(),this._clippingPolygons=void 0,l(this._root)){let e=wxe;for(e.push(this._root);e.length>0;){let t=e.pop();t.destroy();let n=t.children;for(let i=0;i<n.length;++i)e.push(n[i])}}return this._root=void 0,this._shouldDestroyImageBasedLighting&&!this._imageBasedLighting.isDestroyed()&&this._imageBasedLighting.destroy(),this._imageBasedLighting=void 0,this._environmentMapManager.isDestroyed()||this._environmentMapManager.destroy(),this._environmentMapManager=void 0,this._imageryLayers.isDestroyed()||(this.imageryLayers.layerAdded.removeEventListener(this._imageryLayersListener),this.imageryLayers.layerRemoved.removeEventListener(this._imageryLayersListener),this.imageryLayers.layerMoved.removeEventListener(this._imageryLayersListener),this.imageryLayers.layerShownOrHidden.removeEventListener(this._imageryLayersListener),this._imageryLayers.destroy()),this._imageryLayers=void 0,le(this)};ro.supportedExtensions={"3DTILES_metadata":!0,"3DTILES_implicit_tiling":!0,"3DTILES_content_gltf":!0,"3DTILES_content_gltf_vector":!0,"3DTILES_multiple_contents":!0,"3DTILES_bounding_volume_S2":!0,"3DTILES_batch_table_hierarchy":!0,"3DTILES_draco_point_compression":!0,MAXAR_content_geojson:!0};ro.checkSupportedExtensions=function(e){for(let t=0;t<e.length;t++)if(!ro.supportedExtensions[e[t]])throw new oe(`Unsupported 3D Tiles Extension: ${e[t]}`)};var ipt=new gn,rpt=new h,opt=new h,spt=new he;ro.prototype.getHeight=function(e,t){let n=t.ellipsoid;l(n)||(n=ee.WGS84);let i=ipt,r=n.cartographicToCartesian(e,rpt),o=n.geodeticSurfaceNormal(r,i.direction);i.origin=h.add(r,h.multiplyByScalar(o,2*n.maximumRadius,i.origin),i.origin),i.direction=h.negate(o,i.direction);let s=this.pick(i,t.frameState,opt,this.maximumHeightQueryGeometricError);if(l(s))return n.cartesianToCartographic(s,spt)?.height};ro.prototype.updateHeight=function(e,t,n){n=n??ee.WGS84;let i={positionCartographic:e,ellipsoid:n,callback:t,invoked:!1},r=()=>{let o=this._addHeightCallbacks,s=o.length;for(let a=0;a<s;++a)if(o[a]===i){o.splice(a,1);break}i.callback&&(i.callback=void 0)};return this._addHeightCallbacks.push(i),r};var apt=new h;ro.prototype.pick=function(e,t,n,i){if(!t.context.webgl2&&!this._enablePick)return;let r=this._selectedTiles,o=r.length,s=[],a=e.origin.x,c=e.origin.y,u=e.origin.z,f=e.direction.x,d=e.direction.y,p=e.direction.z,g=f*f+d*d+p*p;for(let b=0;b<o;++b){let x=r[b];if(l(i)&&x.geometricError>i||!l(x.content))continue;let T=x.contentBoundingVolume.boundingSphere,E=T.center,v=a-E.x,S=c-E.y,I=u-E.z,R=2*(f*v+d*S+p*I),O=v*v+S*S+I*I-T.radius*T.radius;R*R-4*g*O<0||s.push(x)}let m=s.length,y,A=Number.POSITIVE_INFINITY;for(let b=0;b<m;++b){let T=s[b].content.pick(e,t,apt);if(l(T)){let E=h.distanceSquared(T,e.origin);E<A&&(A=E,y=h.clone(T,n))}}return y};ro.prototype.isGltfExtensionUsed=function(e){if(this.hasExtension("3DTILES_content_gltf")){if(!l(this.extensions))return!1;let t=this.extensions["3DTILES_content_gltf"]?.extensionsUsed;return l(t)?t.indexOf(e)>-1:!1}return!1};ro.prototype.isGltfExtensionRequired=function(e){if(this.isGltfExtensionUsed(e)){let t=this.extensions["3DTILES_content_gltf"].extensionsRequired;return l(t)?t.indexOf(e)>-1:!1}return!1};var Zo=ro;var cpt=new M;function $y(e,t){t.collectionChanged.addEventListener($y.prototype._onCollectionChanged,this),this._scene=e,this._primitives=e.primitives,this._entityCollection=t,this._tilesetHash={},this._entitiesToVisualize=new zt,this._onCollectionChanged(t,t.values,[],[])}$y.prototype.update=function(e){let t=this._entitiesToVisualize.values,n=this._tilesetHash,i=this._primitives;for(let r=0,o=t.length;r<o;r++){let s=t[r],a=s._tileset,c,u=n[s.id],f=s.isShowing&&s.isAvailable(e)&&X.getValueOrDefault(a._show,e,!0),d;f&&(d=s.computeModelMatrix(e,cpt),c=De.createIfNeeded(X.getValueOrUndefined(a._uri,e)));let p=l(u)?u.tilesetPrimitive:void 0;if(!f){l(p)&&(p.show=!1);continue}(!l(u)||c.url!==u.url)&&(l(p)&&i.removeAndDestroy(p),delete n[s.id],lpt(c,n,s,i)),l(p)&&(p.show=!0,l(d)&&(p.modelMatrix=d),p.maximumScreenSpaceError=X.getValueOrDefault(a.maximumScreenSpaceError,e,p.maximumScreenSpaceError))}return!0};$y.prototype.isDestroyed=function(){return!1};$y.prototype.destroy=function(){this._entityCollection.collectionChanged.removeEventListener($y.prototype._onCollectionChanged,this);let e=this._entitiesToVisualize.values,t=this._tilesetHash,n=this._primitives;for(let i=e.length-1;i>-1;i--)NQ(this,e[i],t,n);return le(this)};$y.prototype.getBoundingSphere=function(e,t){let n=this._tilesetHash[e.id];if(!l(n)||n.loadFail)return Pt.FAILED;let i=n.tilesetPrimitive;return l(i)?i.show?(ue.clone(i.boundingSphere,t),Pt.DONE):Pt.FAILED:Pt.PENDING};$y.prototype._onCollectionChanged=function(e,t,n,i){let r,o,s=this._entitiesToVisualize,a=this._tilesetHash,c=this._primitives;for(r=t.length-1;r>-1;r--)o=t[r],l(o._tileset)&&s.set(o.id,o);for(r=i.length-1;r>-1;r--)o=i[r],l(o._tileset)?s.set(o.id,o):(NQ(this,o,a,c),s.remove(o.id));for(r=n.length-1;r>-1;r--)o=n[r],NQ(this,o,a,c),s.remove(o.id)};function NQ(e,t,n,i){let r=n[t.id];l(r)&&(l(r.tilesetPrimitive)&&i.removeAndDestroy(r.tilesetPrimitive),delete n[t.id])}async function lpt(e,t,n,i){t[n.id]={url:e.url,loadFail:!1};try{let r=await Zo.fromUrl(e);if(r.id=n,i.add(r),!l(t[n.id]))return;t[n.id].tilesetPrimitive=r}catch(r){console.error(r),t[n.id].loadFail=!0}}var n8=$y;var upt=z.WHITE,fpt=z.BLACK,dpt=new U(2,2);function tS(e){e=e??H.EMPTY_OBJECT,this._definitionChanged=new be,this._evenColor=void 0,this._evenColorSubscription=void 0,this._oddColor=void 0,this._oddColorSubscription=void 0,this._repeat=void 0,this._repeatSubscription=void 0,this.evenColor=e.evenColor,this.oddColor=e.oddColor,this.repeat=e.repeat}Object.defineProperties(tS.prototype,{isConstant:{get:function(){return X.isConstant(this._evenColor)&&X.isConstant(this._oddColor)&&X.isConstant(this._repeat)}},definitionChanged:{get:function(){return this._definitionChanged}},evenColor:me("evenColor"),oddColor:me("oddColor"),repeat:me("repeat")});tS.prototype.getType=function(e){return"Checkerboard"};var hpt=new K;tS.prototype.getValue=function(e,t){return l(e)||(e=K.now(hpt)),l(t)||(t={}),t.lightColor=X.getValueOrClonedDefault(this._evenColor,e,upt,t.lightColor),t.darkColor=X.getValueOrClonedDefault(this._oddColor,e,fpt,t.darkColor),t.repeat=X.getValueOrDefault(this._repeat,e,dpt),t};tS.prototype.equals=function(e){return this===e||e instanceof tS&&X.equals(this._evenColor,e._evenColor)&&X.equals(this._oddColor,e._oddColor)&&X.equals(this._repeat,e._repeat)};var U1=tS;var Rxe={id:void 0};function z1(e){if(e._firing){e._refire=!0;return}if(e._suspendCount===0){let t=e._addedEntities,n=e._removedEntities,i=e._changedEntities;if(i.length!==0||t.length!==0||n.length!==0){e._firing=!0;do{e._refire=!1;let r=t.values.slice(0),o=n.values.slice(0),s=i.values.slice(0);t.removeAll(),n.removeAll(),i.removeAll(),e._collectionChanged.raiseEvent(e,r,o,s)}while(e._refire);e._firing=!1}}}function il(e){this._owner=e,this._entities=new zt,this._addedEntities=new zt,this._removedEntities=new zt,this._changedEntities=new zt,this._suspendCount=0,this._collectionChanged=new be,this._id=Kn(),this._show=!0,this._firing=!1,this._refire=!1}il.prototype.suspendEvents=function(){this._suspendCount++};il.prototype.resumeEvents=function(){this._suspendCount--,z1(this)};Object.defineProperties(il.prototype,{collectionChanged:{get:function(){return this._collectionChanged}},id:{get:function(){return this._id}},values:{get:function(){return this._entities.values}},show:{get:function(){return this._show},set:function(e){if(e===this._show)return;this.suspendEvents();let t,n=[],i=this._entities.values,r=i.length;for(t=0;t<r;t++)n.push(i[t].isShowing);for(this._show=e,t=0;t<r;t++){let o=n[t],s=i[t];o!==s.isShowing&&s.definitionChanged.raiseEvent(s,"isShowing",s.isShowing,o)}this.resumeEvents()}},owner:{get:function(){return this._owner}}});il.prototype.computeAvailability=function(){let e=nt.MAXIMUM_VALUE,t=nt.MINIMUM_VALUE,n=this._entities.values;for(let i=0,r=n.length;i<r;i++){let s=n[i].availability;if(l(s)){let a=s.start,c=s.stop;K.lessThan(a,e)&&!a.equals(nt.MINIMUM_VALUE)&&(e=a),K.greaterThan(c,t)&&!c.equals(nt.MAXIMUM_VALUE)&&(t=c)}}return nt.MAXIMUM_VALUE.equals(e)&&(e=nt.MINIMUM_VALUE),nt.MINIMUM_VALUE.equals(t)&&(t=nt.MAXIMUM_VALUE),new Cn({start:e,stop:t})};il.prototype.add=function(e){e instanceof Qr||(e=new Qr(e));let t=e.id,n=this._entities;if(n.contains(t))throw new pe(`An entity with id ${t} already exists in this collection.`);return e.entityCollection=this,n.set(t,e),this._removedEntities.remove(t)||this._addedEntities.set(t,e),e.definitionChanged.addEventListener(il.prototype._onEntityDefinitionChanged,this),z1(this),e};il.prototype.remove=function(e){return l(e)?this.removeById(e.id):!1};il.prototype.contains=function(e){return this._entities.get(e.id)===e};il.prototype.removeById=function(e){if(!l(e))return!1;let n=this._entities.get(e);return this._entities.remove(e)?(this._addedEntities.remove(e)||(this._removedEntities.set(e,n),this._changedEntities.remove(e)),this._entities.remove(e),n.definitionChanged.removeEventListener(il.prototype._onEntityDefinitionChanged,this),z1(this),!0):!1};il.prototype.removeAll=function(){let e=this._entities,t=e.length,n=e.values,i=this._addedEntities,r=this._removedEntities;for(let o=0;o<t;o++){let s=n[o],a=s.id,c=i.get(a);l(c)||(s.definitionChanged.removeEventListener(il.prototype._onEntityDefinitionChanged,this),r.set(a,s))}e.removeAll(),i.removeAll(),this._changedEntities.removeAll(),z1(this)};il.prototype.getById=function(e){return this._entities.get(e)};il.prototype.getOrCreateEntity=function(e){let t=this._entities.get(e);return l(t)||(Rxe.id=e,t=new Qr(Rxe),this.add(t)),t};il.prototype._onEntityDefinitionChanged=function(e){let t=e.id;this._addedEntities.contains(t)||this._changedEntities.set(t,e),z1(this)};var rc=il;var i8={id:void 0},nS=new Array(2);function LQ(e){let t=e.propertyNames,n=t.length;for(let i=0;i<n;i++)e[t[i]]=void 0;e._name=void 0,e._availability=void 0}function Oxe(e,t,n,i){nS[0]=n,nS[1]=i.id,t[JSON.stringify(nS)]=i.definitionChanged.addEventListener(gs.prototype._onDefinitionChanged,e)}function Mxe(e,t,n,i){nS[0]=n,nS[1]=i.id;let r=JSON.stringify(nS);t[r](),t[r]=void 0}function Jy(e){if(e._shouldRecomposite=!0,e._suspendCount!==0)return;let t=e._collections,n=t.length,i=e._collectionsCopy,r=i.length,o,s,a,c,u,f=e._composite,d=new rc(e),p=e._eventHash,g;for(o=0;o<r;o++)for(u=i[o],u.collectionChanged.removeEventListener(gs.prototype._onCollectionChanged,e),a=u.values,g=u.id,c=a.length-1;c>-1;c--)s=a[c],Mxe(e,p,g,s);for(o=n-1;o>=0;o--)for(u=t[o],u.collectionChanged.addEventListener(gs.prototype._onCollectionChanged,e),a=u.values,g=u.id,c=a.length-1;c>-1;c--){s=a[c],Oxe(e,p,g,s);let y=d.getById(s.id);l(y)||(y=f.getById(s.id),l(y)?LQ(y):(i8.id=s.id,y=new Qr(i8)),d.add(y)),y.merge(s)}e._collectionsCopy=t.slice(0),f.suspendEvents(),f.removeAll();let m=d.values;for(o=0;o<m.length;o++)f.add(m[o]);f.resumeEvents()}function gs(e,t){this._owner=t,this._composite=new rc(this),this._suspendCount=0,this._collections=l(e)?e.slice():[],this._collectionsCopy=[],this._id=Kn(),this._eventHash={},Jy(this),this._shouldRecomposite=!1}Object.defineProperties(gs.prototype,{collectionChanged:{get:function(){return this._composite._collectionChanged}},id:{get:function(){return this._id}},values:{get:function(){return this._composite.values}},owner:{get:function(){return this._owner}}});gs.prototype.addCollection=function(e,t){l(t)?this._collections.splice(t,0,e):this._collections.push(e),Jy(this)};gs.prototype.removeCollection=function(e){let t=this._collections.indexOf(e);return t!==-1?(this._collections.splice(t,1),Jy(this),!0):!1};gs.prototype.removeAllCollections=function(){this._collections.length=0,Jy(this)};gs.prototype.containsCollection=function(e){return this._collections.indexOf(e)!==-1};gs.prototype.contains=function(e){return this._composite.contains(e)};gs.prototype.indexOfCollection=function(e){return this._collections.indexOf(e)};gs.prototype.getCollection=function(e){return this._collections[e]};gs.prototype.getCollectionsLength=function(){return this._collections.length};function r8(e,t){return e.indexOf(t)}function Nxe(e,t,n){let i=e._collections;if(t=P.clamp(t,0,i.length-1),n=P.clamp(n,0,i.length-1),t===n)return;let r=i[t];i[t]=i[n],i[n]=r,Jy(e)}gs.prototype.raiseCollection=function(e){let t=r8(this._collections,e);Nxe(this,t,t+1)};gs.prototype.lowerCollection=function(e){let t=r8(this._collections,e);Nxe(this,t,t-1)};gs.prototype.raiseCollectionToTop=function(e){let t=r8(this._collections,e);t!==this._collections.length-1&&(this._collections.splice(t,1),this._collections.push(e),Jy(this))};gs.prototype.lowerCollectionToBottom=function(e){let t=r8(this._collections,e);t!==0&&(this._collections.splice(t,1),this._collections.splice(0,0,e),Jy(this))};gs.prototype.suspendEvents=function(){this._suspendCount++,this._composite.suspendEvents()};gs.prototype.resumeEvents=function(){this._suspendCount--,this._shouldRecomposite&&this._suspendCount===0&&(Jy(this),this._shouldRecomposite=!1),this._composite.resumeEvents()};gs.prototype.computeAvailability=function(){return this._composite.computeAvailability()};gs.prototype.getById=function(e){return this._composite.getById(e)};gs.prototype._onCollectionChanged=function(e,t,n){let i=this._collectionsCopy,r=i.length,o=this._composite;o.suspendEvents();let s,a,c,u,f=n.length,d=this._eventHash,p=e.id;for(s=0;s<f;s++){let m=n[s];Mxe(this,d,p,m);let y=m.id;for(a=r-1;a>=0;a--)c=i[a].getById(y),l(c)&&(l(u)||(u=o.getById(y),LQ(u)),u.merge(c));l(u)||o.removeById(y),u=void 0}let g=t.length;for(s=0;s<g;s++){let m=t[s];Oxe(this,d,p,m);let y=m.id;for(a=r-1;a>=0;a--)c=i[a].getById(y),l(c)&&(l(u)||(u=o.getById(y),l(u)?LQ(u):(i8.id=y,u=new Qr(i8),o.add(u))),u.merge(c));u=void 0}o.resumeEvents()};gs.prototype._onDefinitionChanged=function(e,t,n,i){let r=this._collections,o=this._composite,s=r.length,a=e.id,c=o.getById(a),u=c[t],f=!l(u),d=!0;for(let p=s-1;p>=0;p--){let g=r[p].getById(e.id);if(l(g)){let m=g[t];if(l(m)){if(d)if(d=!1,l(m.merge)&&l(m.clone))u=m.clone(u);else{u=m;break}u.merge(m)}}}f&&c.propertyNames.indexOf(t)===-1&&c.addProperty(t),c[t]=u};var Lxe=gs;function FQ(){this._removalFunctions=[]}FQ.prototype.add=function(e,t,n){let i=e.addEventListener(t,n);this._removalFunctions.push(i);let r=this;return function(){i();let o=r._removalFunctions;o.splice(o.indexOf(i),1)}};FQ.prototype.removeAll=function(){let e=this._removalFunctions;for(let t=0,n=e.length;t<n;++t)e[t]();e.length=0};var Qo=FQ;function UQ(e,t){return K.compare(e.start,t.start)}function _s(e){if(this._intervals=[],this._changedEvent=new be,l(e)){let t=e.length;for(let n=0;n<t;n++)this.addInterval(e[n])}}Object.defineProperties(_s.prototype,{changedEvent:{get:function(){return this._changedEvent}},start:{get:function(){let e=this._intervals;return e.length===0?void 0:e[0].start}},isStartIncluded:{get:function(){let e=this._intervals;return e.length===0?!1:e[0].isStartIncluded}},stop:{get:function(){let e=this._intervals,t=e.length;return t===0?void 0:e[t-1].stop}},isStopIncluded:{get:function(){let e=this._intervals,t=e.length;return t===0?!1:e[t-1].isStopIncluded}},length:{get:function(){return this._intervals.length}},isEmpty:{get:function(){return this._intervals.length===0}}});_s.prototype.equals=function(e,t){if(this===e)return!0;if(!(e instanceof _s))return!1;let n=this._intervals,i=e._intervals,r=n.length;if(r!==i.length)return!1;for(let o=0;o<r;o++)if(!Cn.equals(n[o],i[o],t))return!1;return!0};_s.prototype.get=function(e){return this._intervals[e]};_s.prototype.removeAll=function(){this._intervals.length>0&&(this._intervals.length=0,this._changedEvent.raiseEvent(this))};_s.prototype.findIntervalContainingDate=function(e){let t=this.indexOf(e);return t>=0?this._intervals[t]:void 0};_s.prototype.findDataForIntervalContainingDate=function(e){let t=this.indexOf(e);return t>=0?this._intervals[t].data:void 0};_s.prototype.contains=function(e){return this.indexOf(e)>=0};var BQ=new Cn;_s.prototype.indexOf=function(e){let t=this._intervals;BQ.start=e,BQ.stop=e;let n=Pr(t,BQ,UQ);return n>=0?t[n].isStartIncluded?n:n>0&&t[n-1].stop.equals(e)&&t[n-1].isStopIncluded?n-1:~n:(n=~n,n>0&&n-1<t.length&&Cn.contains(t[n-1],e)?n-1:~n)};_s.prototype.findInterval=function(e){e=e??H.EMPTY_OBJECT;let t=e.start,n=e.stop,i=e.isStartIncluded,r=e.isStopIncluded,o=this._intervals;for(let s=0,a=o.length;s<a;s++){let c=o[s];if((!l(t)||c.start.equals(t))&&(!l(n)||c.stop.equals(n))&&(!l(i)||c.isStartIncluded===i)&&(!l(r)||c.isStopIncluded===r))return o[s]}};_s.prototype.addInterval=function(e,t){if(e.isEmpty)return;let n=this._intervals;if(n.length===0||K.greaterThan(e.start,n[n.length-1].stop)){n.push(e),this._changedEvent.raiseEvent(this);return}let i=Pr(n,e,UQ);i<0?i=~i:i>0&&e.isStartIncluded&&n[i-1].isStartIncluded&&n[i-1].start.equals(e.start)?--i:i<n.length&&!e.isStartIncluded&&n[i].isStartIncluded&&n[i].start.equals(e.start)&&++i;let r;for(i>0&&(r=K.compare(n[i-1].stop,e.start),(r>0||r===0&&(n[i-1].isStopIncluded||e.isStartIncluded))&&((l(t)?t(n[i-1].data,e.data):n[i-1].data===e.data)?(K.greaterThan(e.stop,n[i-1].stop)?e=new Cn({start:n[i-1].start,stop:e.stop,isStartIncluded:n[i-1].isStartIncluded,isStopIncluded:e.isStopIncluded,data:e.data}):e=new Cn({start:n[i-1].start,stop:n[i-1].stop,isStartIncluded:n[i-1].isStartIncluded,isStopIncluded:n[i-1].isStopIncluded||e.stop.equals(n[i-1].stop)&&e.isStopIncluded,data:e.data}),n.splice(i-1,1),--i):(r=K.compare(n[i-1].stop,e.stop),(r>0||r===0&&n[i-1].isStopIncluded&&!e.isStopIncluded)&&n.splice(i,0,new Cn({start:e.stop,stop:n[i-1].stop,isStartIncluded:!e.isStopIncluded,isStopIncluded:n[i-1].isStopIncluded,data:n[i-1].data})),n[i-1]=new Cn({start:n[i-1].start,stop:e.start,isStartIncluded:n[i-1].isStartIncluded,isStopIncluded:!e.isStartIncluded,data:n[i-1].data}))));i<n.length&&(r=K.compare(e.stop,n[i].start),r>0||r===0&&(e.isStopIncluded||n[i].isStartIncluded));)if(l(t)?t(n[i].data,e.data):n[i].data===e.data)e=new Cn({start:e.start,stop:K.greaterThan(n[i].stop,e.stop)?n[i].stop:e.stop,isStartIncluded:e.isStartIncluded,isStopIncluded:K.greaterThan(n[i].stop,e.stop)?n[i].isStopIncluded:e.isStopIncluded,data:e.data}),n.splice(i,1);else if(n[i]=new Cn({start:e.stop,stop:n[i].stop,isStartIncluded:!e.isStopIncluded,isStopIncluded:n[i].isStopIncluded,data:n[i].data}),n[i].isEmpty)n.splice(i,1);else break;n.splice(i,0,e),this._changedEvent.raiseEvent(this)};_s.prototype.removeInterval=function(e){if(e.isEmpty)return!1;let t=this._intervals,n=Pr(t,e,UQ);n<0&&(n=~n);let i=!1;for(n>0&&(K.greaterThan(t[n-1].stop,e.start)||t[n-1].stop.equals(e.start)&&t[n-1].isStopIncluded&&e.isStartIncluded)&&(i=!0,(K.greaterThan(t[n-1].stop,e.stop)||t[n-1].isStopIncluded&&!e.isStopIncluded&&t[n-1].stop.equals(e.stop))&&t.splice(n,0,new Cn({start:e.stop,stop:t[n-1].stop,isStartIncluded:!e.isStopIncluded,isStopIncluded:t[n-1].isStopIncluded,data:t[n-1].data})),t[n-1]=new Cn({start:t[n-1].start,stop:e.start,isStartIncluded:t[n-1].isStartIncluded,isStopIncluded:!e.isStartIncluded,data:t[n-1].data})),n<t.length&&!e.isStartIncluded&&t[n].isStartIncluded&&e.start.equals(t[n].start)&&(i=!0,t.splice(n,0,new Cn({start:t[n].start,stop:t[n].start,isStartIncluded:!0,isStopIncluded:!0,data:t[n].data})),++n);n<t.length&&K.greaterThan(e.stop,t[n].stop);)i=!0,t.splice(n,1);return n<t.length&&e.stop.equals(t[n].stop)&&(i=!0,!e.isStopIncluded&&t[n].isStopIncluded?n+1<t.length&&t[n+1].start.equals(e.stop)&&t[n].data===t[n+1].data?(t.splice(n,1),t[n]=new Cn({start:t[n].start,stop:t[n].stop,isStartIncluded:!0,isStopIncluded:t[n].isStopIncluded,data:t[n].data})):t[n]=new Cn({start:e.stop,stop:e.stop,isStartIncluded:!0,isStopIncluded:!0,data:t[n].data}):t.splice(n,1)),n<t.length&&(K.greaterThan(e.stop,t[n].start)||e.stop.equals(t[n].start)&&e.isStopIncluded&&t[n].isStartIncluded)&&(i=!0,t[n]=new Cn({start:e.stop,stop:t[n].stop,isStartIncluded:!e.isStopIncluded,isStopIncluded:t[n].isStopIncluded,data:t[n].data})),i&&this._changedEvent.raiseEvent(this),i};_s.prototype.intersect=function(e,t,n){let i=new _s,r=0,o=0,s=this._intervals,a=e._intervals;for(;r<s.length&&o<a.length;){let c=s[r],u=a[o];if(K.lessThan(c.stop,u.start))++r;else if(K.lessThan(u.stop,c.start))++o;else{if(l(n)||l(t)&&t(c.data,u.data)||!l(t)&&u.data===c.data){let f=Cn.intersect(c,u,new Cn,n);f.isEmpty||i.addInterval(f,t)}K.lessThan(c.stop,u.stop)||c.stop.equals(u.stop)&&!c.isStopIncluded&&u.isStopIncluded?++r:++o}}return i};_s.fromJulianDateArray=function(e,t){l(t)||(t=new _s);let n=e.julianDates,i=n.length,r=e.dataCallback,o=e.isStartIncluded??!0,s=e.isStopIncluded??!0,a=e.leadingInterval??!1,c=e.trailingInterval??!1,u,f=0;a&&(++f,u=new Cn({start:nt.MINIMUM_VALUE,stop:n[0],isStartIncluded:!0,isStopIncluded:!o}),u.data=l(r)?r(u,t.length):t.length,t.addInterval(u));for(let d=0;d<i-1;++d){let p=n[d],g=n[d+1];u=new Cn({start:p,stop:g,isStartIncluded:t.length===f?o:!0,isStopIncluded:d===i-2?s:!1}),u.data=l(r)?r(u,t.length):t.length,t.addInterval(u)}return c&&(u=new Cn({start:n[i-1],stop:nt.MAXIMUM_VALUE,isStartIncluded:!s,isStopIncluded:!0}),u.data=l(r)?r(u,t.length):t.length,t.addInterval(u)),t};var rl=new Fm,V1=[0,31,28,31,30,31,30,31,31,30,31,30,31];function kQ(e,t,n){l(n)||(n=new K),K.toGregorianDate(e,rl);let i=rl.millisecond+t.millisecond,r=rl.second+t.second,o=rl.minute+t.minute,s=rl.hour+t.hour,a=rl.day+t.day,c=rl.month+t.month,u=rl.year+t.year;for(i>=1e3&&(r+=Math.floor(i/1e3),i=i%1e3),r>=60&&(o+=Math.floor(r/60),r=r%60),o>=60&&(s+=Math.floor(o/60),o=o%60),s>=24&&(a+=Math.floor(s/24),s=s%24),V1[2]=ou(u)?29:28;a>V1[c]||c>=13;)a>V1[c]&&(a-=V1[c],++c),c>=13&&(--c,u+=Math.floor(c/12),c=c%12,++c),V1[2]=ou(u)?29:28;return rl.millisecond=i,rl.second=r,rl.minute=o,rl.hour=s,rl.day=a,rl.month=c,rl.year=u,K.fromGregorianDate(rl,n)}var mpt=new K,ppt=/P(?:([\d.,]+)Y)?(?:([\d.,]+)M)?(?:([\d.,]+)W)?(?:([\d.,]+)D)?(?:T(?:([\d.,]+)H)?(?:([\d.,]+)M)?(?:([\d.,]+)S)?)?/;function Fxe(e,t){if(!l(e)||e.length===0)return!1;if(t.year=0,t.month=0,t.day=0,t.hour=0,t.minute=0,t.second=0,t.millisecond=0,e[0]==="P"){let n=e.match(ppt);if(!l(n))return!1;if(l(n[1])&&(t.year=Number(n[1].replace(",","."))),l(n[2])&&(t.month=Number(n[2].replace(",","."))),l(n[3])&&(t.day=Number(n[3].replace(",","."))*7),l(n[4])&&(t.day+=Number(n[4].replace(",","."))),l(n[5])&&(t.hour=Number(n[5].replace(",","."))),l(n[6])&&(t.minute=Number(n[6].replace(",","."))),l(n[7])){let i=Number(n[7].replace(",","."));t.second=Math.floor(i),t.millisecond=i%1*1e3}}else e[e.length-1]!=="Z"&&(e+="Z"),K.toGregorianDate(K.fromIso8601(e,mpt),t);return t.year||t.month||t.day||t.hour||t.minute||t.second||t.millisecond}var j1=new Fm;_s.fromIso8601=function(e,t){let n=e.iso8601.split("/"),i=K.fromIso8601(n[0]),r=K.fromIso8601(n[1]),o=[];if(!Fxe(n[2],j1))o.push(i,r);else{let s=K.clone(i);for(o.push(s);K.compare(s,r)<0;)s=kQ(s,j1),K.compare(r,s)<=0&&K.clone(r,s),o.push(s)}return _s.fromJulianDateArray({julianDates:o,isStartIncluded:e.isStartIncluded,isStopIncluded:e.isStopIncluded,leadingInterval:e.leadingInterval,trailingInterval:e.trailingInterval,dataCallback:e.dataCallback},t)};_s.fromIso8601DateArray=function(e,t){return _s.fromJulianDateArray({julianDates:e.iso8601Dates.map(function(n){return K.fromIso8601(n)}),isStartIncluded:e.isStartIncluded,isStopIncluded:e.isStopIncluded,leadingInterval:e.leadingInterval,trailingInterval:e.trailingInterval,dataCallback:e.dataCallback},t)};_s.fromIso8601DurationArray=function(e,t){let n=e.epoch,i=e.iso8601Durations,r=e.relativeToPrevious??!1,o=[],s,a,c=i.length;for(let u=0;u<c;++u)(Fxe(i[u],j1)||u===0)&&(r&&l(a)?s=kQ(a,j1):s=kQ(n,j1),o.push(s),a=s);return _s.fromJulianDateArray({julianDates:o,isStartIncluded:e.isStartIncluded,isStopIncluded:e.isStopIncluded,leadingInterval:e.leadingInterval,trailingInterval:e.trailingInterval,dataCallback:e.dataCallback},t)};var Ls=_s;function gpt(e,t,n,i){function r(){n.raiseEvent(e)}let o=[];t.removeAll();let s=i.length;for(let a=0;a<s;a++){let c=i.get(a);l(c.data)&&o.indexOf(c.data)===-1&&t.add(c.data.definitionChanged,r)}}function Ux(){this._eventHelper=new Qo,this._definitionChanged=new be,this._intervals=new Ls,this._intervals.changedEvent.addEventListener(Ux.prototype._intervalsChanged,this)}Object.defineProperties(Ux.prototype,{isConstant:{get:function(){return this._intervals.isEmpty}},definitionChanged:{get:function(){return this._definitionChanged}},intervals:{get:function(){return this._intervals}}});var _pt=new K;Ux.prototype.getValue=function(e,t){l(e)||(e=K.now(_pt));let n=this._intervals.findDataForIntervalContainingDate(e);if(l(n))return n.getValue(e,t)};Ux.prototype.equals=function(e){return this===e||e instanceof Ux&&this._intervals.equals(e._intervals,X.equals)};Ux.prototype._intervalsChanged=function(){gpt(this,this._eventHelper,this._definitionChanged,this._intervals),this._definitionChanged.raiseEvent(this)};var Vl=Ux;function Zy(){this._definitionChanged=new be,this._composite=new Vl,this._composite.definitionChanged.addEventListener(Zy.prototype._raiseDefinitionChanged,this)}Object.defineProperties(Zy.prototype,{isConstant:{get:function(){return this._composite.isConstant}},definitionChanged:{get:function(){return this._definitionChanged}},intervals:{get:function(){return this._composite._intervals}}});Zy.prototype.getType=function(e){let t=this._composite._intervals.findDataForIntervalContainingDate(e);if(l(t))return t.getType(e)};var ypt=new K;Zy.prototype.getValue=function(e,t){l(e)||(e=K.now(ypt));let n=this._composite._intervals.findDataForIntervalContainingDate(e);if(l(n))return n.getValue(e,t)};Zy.prototype.equals=function(e){return this===e||e instanceof Zy&&this._composite.equals(e._composite,X.equals)};Zy.prototype._raiseDefinitionChanged=function(){this._definitionChanged.raiseEvent(this)};var H1=Zy;function Qy(e){this._referenceFrame=e??Wi.FIXED,this._definitionChanged=new be,this._composite=new Vl,this._composite.definitionChanged.addEventListener(Qy.prototype._raiseDefinitionChanged,this)}Object.defineProperties(Qy.prototype,{isConstant:{get:function(){return this._composite.isConstant}},definitionChanged:{get:function(){return this._definitionChanged}},intervals:{get:function(){return this._composite.intervals}},referenceFrame:{get:function(){return this._referenceFrame},set:function(e){this._referenceFrame=e}}});var Apt=new K;Qy.prototype.getValue=function(e,t){return l(e)||(e=K.now(Apt)),this.getValueInReferenceFrame(e,Wi.FIXED,t)};Qy.prototype.getValueInReferenceFrame=function(e,t,n){let i=this._composite._intervals.findDataForIntervalContainingDate(e);if(l(i))return i.getValueInReferenceFrame(e,t,n)};Qy.prototype.equals=function(e){return this===e||e instanceof Qy&&this._referenceFrame===e._referenceFrame&&this._composite.equals(e._composite,X.equals)};Qy.prototype._raiseDefinitionChanged=function(){this._definitionChanged.raiseEvent(this)};var Ec=Qy;var Bxe={ROUNDED:0,MITERED:1,BEVELED:2};Object.freeze(Bxe);var ur=Bxe;var oc=[new h,new h],bpt=new h,xpt=new h,Tpt=new h,Ept=new h,Cpt=new h,vpt=new h,Spt=new h,wpt=new h,Ipt=new h,iS=new h,o8=new h,G1={},zQ=new he;function Ppt(e,t){let n=new Array(e.length);for(let i=0;i<e.length;i++){let r=e[i];zQ=t.cartesianToCartographic(r,zQ),n[i]=zQ.height,e[i]=t.scaleToGeodeticSurface(r,r)}return n}function VQ(e,t,n,i){let r=e[0],o=e[1],s=h.angleBetween(r,o),a=Math.ceil(s/i),c=new Array(a),u;if(t===n){for(u=0;u<a;u++)c[u]=t;return c.push(n),c}let d=(n-t)/a;for(u=1;u<a;u++){let p=t+u*d;c[u]=p}return c[0]=t,c.push(n),c}var s8=new h,a8=new h;function Dpt(e,t,n,i){let r=new qs(n,i),o=r.projectPointOntoPlane(h.add(n,e,s8),s8),s=r.projectPointOntoPlane(h.add(n,t,a8),a8),a=U.angleBetween(o,s);return s.x*o.y-s.y*o.x>=0?-a:a}var Rpt=new h(-1,0,0),zx=new M,Opt=new M,jQ=new $,Mpt=$.IDENTITY.clone(),Npt=new h,Lpt=new se,kxe=new h;function Ig(e,t,n,i,r,o,s,a){let c=Npt,u=Lpt;zx=At.eastNorthUpToFixedFrame(e,r,zx),c=M.multiplyByPointAsVector(zx,Rpt,c),c=h.normalize(c,c);let f=Dpt(c,t,e,r);jQ=$.fromRotationZ(f,jQ),kxe.z=o,zx=M.multiplyTransformation(zx,M.fromRotationTranslation(jQ,kxe,Opt),zx);let d=Mpt;d[0]=s;for(let p=0;p<a;p++)for(let g=0;g<n.length;g+=3)u=h.fromArray(n,g,u),u=$.multiplyByVector(d,u,u),u=M.multiplyByPoint(zx,u,u),i.push(u.x,u.y,u.z);return i}var Fpt=new h;function HQ(e,t,n,i,r,o,s){for(let a=0;a<e.length;a+=3){let c=h.fromArray(e,a,Fpt);i=Ig(c,t,n,i,r,o[a/3],s,1)}return i}function Bpt(e,t){let n=e.length,i=new Array(n*6),r=0,o=t.x+t.width/2,s=t.y+t.height/2,a=e[0];i[r++]=a.x-o,i[r++]=0,i[r++]=a.y-s;for(let c=1;c<n;c++){a=e[c];let u=a.x-o,f=a.y-s;i[r++]=u,i[r++]=0,i[r++]=f,i[r++]=u,i[r++]=0,i[r++]=f}return a=e[0],i[r++]=a.x-o,i[r++]=0,i[r]=a.y-s,i}function Uxe(e,t){let n=e.length,i=new Array(n*3),r=0,o=t.x+t.width/2,s=t.y+t.height/2;for(let a=0;a<n;a++)i[r++]=e[a].x-o,i[r++]=0,i[r++]=e[a].y-s;return i}var zxe=new Le,Vxe=new h,jxe=new $;function Hxe(e,t,n,i,r,o,s,a,c,u){let f=h.angleBetween(h.subtract(t,e,iS),h.subtract(n,e,o8)),d=i===ur.BEVELED?0:Math.ceil(f/P.toRadians(5)),p;r?p=$.fromQuaternion(Le.fromAxisAngle(h.negate(e,iS),f/(d+1),zxe),jxe):p=$.fromQuaternion(Le.fromAxisAngle(e,f/(d+1),zxe),jxe);let g,m;if(t=h.clone(t,Vxe),d>0){let y=u?2:1;for(let A=0;A<d;A++)t=$.multiplyByVector(p,t,t),g=h.subtract(t,e,iS),g=h.normalize(g,g),r||(g=h.negate(g,g)),m=o.scaleToGeodeticSurface(t,o8),s=Ig(m,g,a,s,o,c,1,y)}else g=h.subtract(t,e,iS),g=h.normalize(g,g),r||(g=h.negate(g,g)),m=o.scaleToGeodeticSurface(t,o8),s=Ig(m,g,a,s,o,c,1,1),n=h.clone(n,Vxe),g=h.subtract(n,e,iS),g=h.normalize(g,g),r||(g=h.negate(g,g)),m=o.scaleToGeodeticSurface(n,o8),s=Ig(m,g,a,s,o,c,1,1);return s}G1.removeDuplicatesFromShape=function(e){let t=e.length,n=[];for(let i=t-1,r=0;r<t;i=r++){let o=e[i],s=e[r];U.equals(o,s)||n.push(s)}return n};G1.angleIsGreaterThanPi=function(e,t,n,i){let r=new qs(n,i),o=r.projectPointOntoPlane(h.add(n,e,s8),s8),s=r.projectPointOntoPlane(h.add(n,t,a8),a8);return s.x*o.y-s.y*o.x>=0};var kpt=new h,Upt=new h;G1.computePositions=function(e,t,n,i,r){let o=i._ellipsoid,s=Ppt(e,o),a=i._granularity,c=i._cornerType,u=r?Bpt(t,n):Uxe(t,n),f=r?Uxe(t,n):void 0,d=n.height/2,p=n.width/2,g=e.length,m=[],y=r?[]:void 0,A=bpt,b=xpt,x=Tpt,T=Ept,E=Cpt,v=vpt,S=Spt,I=wpt,R=Ipt,O=e[0],L=e[1];T=o.geodeticSurfaceNormal(O,T),A=h.subtract(L,O,A),A=h.normalize(A,A),I=h.cross(T,A,I),I=h.normalize(I,I);let _=s[0],C=s[1];r&&(y=Ig(O,I,f,y,o,_+d,1,1)),R=h.clone(O,R),O=L,b=h.negate(A,b);let w,D;for(let V=1;V<g-1;V++){let B=r?2:1;if(L=e[V+1],O.equals(L)){yt("Positions are too close and are considered equivalent with rounding error.");continue}A=h.subtract(L,O,A),A=h.normalize(A,A),T=o.geodeticSurfaceNormal(O,T);let j=h.multiplyByScalar(T,h.dot(A,T),kpt);h.subtract(A,j,j),h.normalize(j,j);let k=h.multiplyByScalar(T,h.dot(b,T),Upt);if(h.subtract(b,k,k),h.normalize(k,k),!P.equalsEpsilon(Math.abs(h.dot(j,k)),1,P.EPSILON7)){x=h.add(A,b,x),x=h.normalize(x,x),x=h.cross(x,T,x),x=h.cross(T,x,x),x=h.normalize(x,x);let q=1/Math.max(.25,h.magnitude(h.cross(x,b,iS))),Q=G1.angleIsGreaterThanPi(A,b,O,o);Q?(E=h.add(O,h.multiplyByScalar(x,q*p,x),E),v=h.add(E,h.multiplyByScalar(I,p,v),v),oc[0]=h.clone(R,oc[0]),oc[1]=h.clone(v,oc[1]),w=VQ(oc,_+d,C+d,a),D=lr.generateArc({positions:oc,granularity:a,ellipsoid:o}),m=HQ(D,I,u,m,o,w,1),I=h.cross(T,A,I),I=h.normalize(I,I),S=h.add(E,h.multiplyByScalar(I,p,S),S),c===ur.ROUNDED||c===ur.BEVELED?Hxe(E,v,S,c,Q,o,m,u,C+d,r):(x=h.negate(x,x),m=Ig(O,x,u,m,o,C+d,q,B)),R=h.clone(S,R)):(E=h.add(O,h.multiplyByScalar(x,q*p,x),E),v=h.add(E,h.multiplyByScalar(I,-p,v),v),oc[0]=h.clone(R,oc[0]),oc[1]=h.clone(v,oc[1]),w=VQ(oc,_+d,C+d,a),D=lr.generateArc({positions:oc,granularity:a,ellipsoid:o}),m=HQ(D,I,u,m,o,w,1),I=h.cross(T,A,I),I=h.normalize(I,I),S=h.add(E,h.multiplyByScalar(I,-p,S),S),c===ur.ROUNDED||c===ur.BEVELED?Hxe(E,v,S,c,Q,o,m,u,C+d,r):m=Ig(O,x,u,m,o,C+d,q,B),R=h.clone(S,R)),b=h.negate(A,b)}else m=Ig(R,I,u,m,o,_+d,1,1),R=O;_=C,C=s[V+1],O=L}oc[0]=h.clone(R,oc[0]),oc[1]=h.clone(O,oc[1]),w=VQ(oc,_+d,C+d,a),D=lr.generateArc({positions:oc,granularity:a,ellipsoid:o}),m=HQ(D,I,u,m,o,w,1),r&&(y=Ig(O,I,f,y,o,C+d,1,1)),g=m.length;let N=r?g+y.length:g,F=new Float64Array(N);return F.set(m),r&&F.set(y,g),F};var Dp=G1;var WQ={},rS=new h,Xxe=new h,zpt=new h,Gxe=new h,jl=[new h,new h],Kxe=new h,$xe=new h,Jxe=new h,Vpt=new h,jpt=new h,Hpt=new h,Gpt=new h,Wpt=new h,qpt=new h,Ypt=new h,Wxe=new Le,qxe=new $;function c8(e,t,n,i,r){let o=h.angleBetween(h.subtract(t,e,rS),h.subtract(n,e,Xxe)),s=i===ur.BEVELED?1:Math.ceil(o/P.toRadians(5))+1,a=s*3,c=new Array(a);c[a-3]=n.x,c[a-2]=n.y,c[a-1]=n.z;let u;r?u=$.fromQuaternion(Le.fromAxisAngle(h.negate(e,rS),o/s,Wxe),qxe):u=$.fromQuaternion(Le.fromAxisAngle(e,o/s,Wxe),qxe);let f=0;t=h.clone(t,rS);for(let d=0;d<s;d++)t=$.multiplyByVector(u,t,t),c[f++]=t.x,c[f++]=t.y,c[f++]=t.z;return c}function Xpt(e){let t=Kxe,n=$xe,i=Jxe,r=e[1];n=h.fromArray(e[1],r.length-3,n),i=h.fromArray(e[0],0,i),t=h.midpoint(n,i,t);let o=c8(t,n,i,ur.ROUNDED,!1),s=e.length-1,a=e[s-1];r=e[s],n=h.fromArray(a,a.length-3,n),i=h.fromArray(r,0,i),t=h.midpoint(n,i,t);let c=c8(t,n,i,ur.ROUNDED,!1);return[o,c]}function Yxe(e,t,n,i){let r=rS;return i?r=h.add(e,t,r):(t=h.negate(t,t),r=h.add(e,t,r)),[r.x,r.y,r.z,n.x,n.y,n.z]}function GQ(e,t,n,i){let r=new Array(e.length),o=new Array(e.length),s=h.multiplyByScalar(t,n,rS),a=h.negate(s,Xxe),c=0,u=e.length-1;for(let f=0;f<e.length;f+=3){let d=h.fromArray(e,f,zpt),p=h.add(d,a,Gxe);r[c++]=p.x,r[c++]=p.y,r[c++]=p.z;let g=h.add(d,s,Gxe);o[u--]=g.z,o[u--]=g.y,o[u--]=g.x}return i.push(r,o),i}WQ.addAttribute=function(e,t,n,i){let r=t.x,o=t.y,s=t.z;l(n)&&(e[n]=r,e[n+1]=o,e[n+2]=s),l(i)&&(e[i]=s,e[i-1]=o,e[i-2]=r)};var Kpt=new h,$pt=new h;WQ.computePositions=function(e){let t=e.granularity,n=e.positions,i=e.ellipsoid,r=e.width/2,o=e.cornerType,s=e.saveAttributes,a=Kxe,c=$xe,u=Jxe,f=Vpt,d=jpt,p=Hpt,g=Gpt,m=Wpt,y=qpt,A=Ypt,b=[],x=s?[]:void 0,T=s?[]:void 0,E=n[0],v=n[1];c=h.normalize(h.subtract(v,E,c),c),a=i.geodeticSurfaceNormal(E,a),f=h.normalize(h.cross(a,c,f),f),s&&(x.push(f.x,f.y,f.z),T.push(a.x,a.y,a.z)),g=h.clone(E,g),E=v,u=h.negate(c,u);let S,I=[],R,O=n.length;for(R=1;R<O-1;R++){a=i.geodeticSurfaceNormal(E,a),v=n[R+1],c=h.normalize(h.subtract(v,E,c),c);let _=h.multiplyByScalar(a,h.dot(c,a),Kpt);h.subtract(c,_,_),h.normalize(_,_);let C=h.multiplyByScalar(a,h.dot(u,a),$pt);if(h.subtract(u,C,C),h.normalize(C,C),!P.equalsEpsilon(Math.abs(h.dot(_,C)),1,P.EPSILON7)){d=h.normalize(h.add(c,u,d),d),d=h.cross(d,a,d),d=h.cross(a,d,d),d=h.normalize(d,d);let D=r/Math.max(.25,h.magnitude(h.cross(d,u,rS))),N=Dp.angleIsGreaterThanPi(c,u,E,i);d=h.multiplyByScalar(d,D,d),N?(m=h.add(E,d,m),A=h.add(m,h.multiplyByScalar(f,r,A),A),y=h.add(m,h.multiplyByScalar(f,r*2,y),y),jl[0]=h.clone(g,jl[0]),jl[1]=h.clone(A,jl[1]),S=lr.generateArc({positions:jl,granularity:t,ellipsoid:i}),b=GQ(S,f,r,b),s&&(x.push(f.x,f.y,f.z),T.push(a.x,a.y,a.z)),p=h.clone(y,p),f=h.normalize(h.cross(a,c,f),f),y=h.add(m,h.multiplyByScalar(f,r*2,y),y),g=h.add(m,h.multiplyByScalar(f,r,g),g),o===ur.ROUNDED||o===ur.BEVELED?I.push({leftPositions:c8(m,p,y,o,N)}):I.push({leftPositions:Yxe(E,h.negate(d,d),y,N)})):(y=h.add(E,d,y),A=h.add(y,h.negate(h.multiplyByScalar(f,r,A),A),A),m=h.add(y,h.negate(h.multiplyByScalar(f,r*2,m),m),m),jl[0]=h.clone(g,jl[0]),jl[1]=h.clone(A,jl[1]),S=lr.generateArc({positions:jl,granularity:t,ellipsoid:i}),b=GQ(S,f,r,b),s&&(x.push(f.x,f.y,f.z),T.push(a.x,a.y,a.z)),p=h.clone(m,p),f=h.normalize(h.cross(a,c,f),f),m=h.add(y,h.negate(h.multiplyByScalar(f,r*2,m),m),m),g=h.add(y,h.negate(h.multiplyByScalar(f,r,g),g),g),o===ur.ROUNDED||o===ur.BEVELED?I.push({rightPositions:c8(y,p,m,o,N)}):I.push({rightPositions:Yxe(E,d,m,N)})),u=h.negate(c,u)}E=v}a=i.geodeticSurfaceNormal(E,a),jl[0]=h.clone(g,jl[0]),jl[1]=h.clone(E,jl[1]),S=lr.generateArc({positions:jl,granularity:t,ellipsoid:i}),b=GQ(S,f,r,b),s&&(x.push(f.x,f.y,f.z),T.push(a.x,a.y,a.z));let L;return o===ur.ROUNDED&&(L=Xpt(b)),{positions:b,corners:I,lefts:x,normals:T,endPositions:L}};var gr=WQ;var eTe=new h,tTe=new h,l8=new h,u8=new h,Jpt=new h,nTe=new h,eA=new h,oS=new h;function iTe(e,t){for(let n=0;n<e.length;n++)e[n]=t.scaleToGeodeticSurface(e[n],e[n]);return e}function qh(e,t,n,i,r,o){let s=e.normals,a=e.tangents,c=e.bitangents,u=h.normalize(h.cross(n,t,eA),eA);o.normal&&gr.addAttribute(s,t,i,r),o.tangent&&gr.addAttribute(a,u,i,r),o.bitangent&&gr.addAttribute(c,n,i,r)}function rTe(e,t,n){let i=e.positions,r=e.corners,o=e.endPositions,s=e.lefts,a=e.normals,c=new En,u=0,f=0,d,p=0,g;for(d=0;d<i.length;d+=2)g=i[d].length-3,u+=g,p+=g*2,f+=i[d+1].length-3;for(u+=3,f+=3,d=0;d<r.length;d++){let J=r[d].leftPositions;l(J)?(g=J.length,u+=g,p+=g):(g=r[d].rightPositions.length,f+=g,p+=g)}let m=l(o),y;m&&(y=o[0].length-3,u+=y,f+=y,y/=3,p+=y*6);let A=u+f,b=new Float64Array(A),x=t.normal?new Float32Array(A):void 0,T=t.tangent?new Float32Array(A):void 0,E=t.bitangent?new Float32Array(A):void 0,v={normals:x,tangents:T,bitangents:E},S=0,I=A-1,R,O,L,_,C=eTe,w=tTe,D,N,F=y/2,V=je.createTypedArray(A/3,p),B=0;if(m){N=l8,D=u8;let J=o[0];for(C=h.fromArray(a,0,C),w=h.fromArray(s,0,w),d=0;d<F;d++)N=h.fromArray(J,(F-1-d)*3,N),D=h.fromArray(J,(F+d)*3,D),gr.addAttribute(b,D,S),gr.addAttribute(b,N,void 0,I),qh(v,C,w,S,I,t),O=S/3,_=O+1,R=(I-2)/3,L=R-1,V[B++]=R,V[B++]=O,V[B++]=L,V[B++]=L,V[B++]=O,V[B++]=_,S+=3,I-=3}let j=0,k=0,G=i[j++],q=i[j++];b.set(G,S),b.set(q,I-q.length+1),w=h.fromArray(s,k,w);let Q,W;for(g=q.length-3,d=0;d<g;d+=3)Q=n.geodeticSurfaceNormal(h.fromArray(G,d,eA),eA),W=n.geodeticSurfaceNormal(h.fromArray(q,g-d,oS),oS),C=h.normalize(h.add(Q,W,C),C),qh(v,C,w,S,I,t),O=S/3,_=O+1,R=(I-2)/3,L=R-1,V[B++]=R,V[B++]=O,V[B++]=L,V[B++]=L,V[B++]=O,V[B++]=_,S+=3,I-=3;for(Q=n.geodeticSurfaceNormal(h.fromArray(G,g,eA),eA),W=n.geodeticSurfaceNormal(h.fromArray(q,g,oS),oS),C=h.normalize(h.add(Q,W,C),C),k+=3,d=0;d<r.length;d++){let J,Z=r[d],ae=Z.leftPositions,Ae=Z.rightPositions,fe,xe,ge=nTe,we=l8,ve=u8;if(C=h.fromArray(a,k,C),l(ae)){for(qh(v,C,w,void 0,I,t),I-=3,fe=_,xe=L,J=0;J<ae.length/3;J++)ge=h.fromArray(ae,J*3,ge),V[B++]=fe,V[B++]=xe-J-1,V[B++]=xe-J,gr.addAttribute(b,ge,void 0,I),we=h.fromArray(b,(xe-J-1)*3,we),ve=h.fromArray(b,fe*3,ve),w=h.normalize(h.subtract(we,ve,w),w),qh(v,C,w,void 0,I,t),I-=3;ge=h.fromArray(b,fe*3,ge),we=h.subtract(h.fromArray(b,xe*3,we),ge,we),ve=h.subtract(h.fromArray(b,(xe-J)*3,ve),ge,ve),w=h.normalize(h.add(we,ve,w),w),qh(v,C,w,S,void 0,t),S+=3}else{for(qh(v,C,w,S,void 0,t),S+=3,fe=L,xe=_,J=0;J<Ae.length/3;J++)ge=h.fromArray(Ae,J*3,ge),V[B++]=fe,V[B++]=xe+J,V[B++]=xe+J+1,gr.addAttribute(b,ge,S),we=h.fromArray(b,fe*3,we),ve=h.fromArray(b,(xe+J)*3,ve),w=h.normalize(h.subtract(we,ve,w),w),qh(v,C,w,S,void 0,t),S+=3;ge=h.fromArray(b,fe*3,ge),we=h.subtract(h.fromArray(b,(xe+J)*3,we),ge,we),ve=h.subtract(h.fromArray(b,xe*3,ve),ge,ve),w=h.normalize(h.negate(h.add(ve,we,w),w),w),qh(v,C,w,void 0,I,t),I-=3}for(G=i[j++],q=i[j++],G.splice(0,3),q.splice(q.length-3,3),b.set(G,S),b.set(q,I-q.length+1),g=q.length-3,k+=3,w=h.fromArray(s,k,w),J=0;J<q.length;J+=3)Q=n.geodeticSurfaceNormal(h.fromArray(G,J,eA),eA),W=n.geodeticSurfaceNormal(h.fromArray(q,g-J,oS),oS),C=h.normalize(h.add(Q,W,C),C),qh(v,C,w,S,I,t),_=S/3,O=_-1,L=(I-2)/3,R=L+1,V[B++]=R,V[B++]=O,V[B++]=L,V[B++]=L,V[B++]=O,V[B++]=_,S+=3,I-=3;S-=3,I+=3}if(C=h.fromArray(a,a.length-3,C),qh(v,C,w,S,I,t),m){S+=3,I-=3,N=l8,D=u8;let J=o[1];for(d=0;d<F;d++)N=h.fromArray(J,(y-d-1)*3,N),D=h.fromArray(J,d*3,D),gr.addAttribute(b,N,void 0,I),gr.addAttribute(b,D,S),qh(v,C,w,S,I,t),_=S/3,O=_-1,L=(I-2)/3,R=L+1,V[B++]=R,V[B++]=O,V[B++]=L,V[B++]=L,V[B++]=O,V[B++]=_,S+=3,I-=3}if(c.position=new Ne({componentDatatype:Y.DOUBLE,componentsPerAttribute:3,values:b}),t.st){let J=new Float32Array(A/3*2),Z,ae,Ae=0;if(m){u/=3,f/=3;let fe=Math.PI/(y+1);ae=1/(u-y+1),Z=1/(f-y+1);let xe,ge=y/2;for(d=ge+1;d<y+1;d++)xe=P.PI_OVER_TWO+fe*d,J[Ae++]=Z*(1+Math.cos(xe)),J[Ae++]=.5*(1+Math.sin(xe));for(d=1;d<f-y+1;d++)J[Ae++]=d*Z,J[Ae++]=0;for(d=y;d>ge;d--)xe=P.PI_OVER_TWO-d*fe,J[Ae++]=1-Z*(1+Math.cos(xe)),J[Ae++]=.5*(1+Math.sin(xe));for(d=ge;d>0;d--)xe=P.PI_OVER_TWO-fe*d,J[Ae++]=1-ae*(1+Math.cos(xe)),J[Ae++]=.5*(1+Math.sin(xe));for(d=u-y;d>0;d--)J[Ae++]=d*ae,J[Ae++]=1;for(d=1;d<ge+1;d++)xe=P.PI_OVER_TWO+fe*d,J[Ae++]=ae*(1+Math.cos(xe)),J[Ae++]=.5*(1+Math.sin(xe))}else{for(u/=3,f/=3,ae=1/(u-1),Z=1/(f-1),d=0;d<f;d++)J[Ae++]=d*Z,J[Ae++]=0;for(d=u;d>0;d--)J[Ae++]=(d-1)*ae,J[Ae++]=1}c.st=new Ne({componentDatatype:Y.FLOAT,componentsPerAttribute:2,values:J})}return t.normal&&(c.normal=new Ne({componentDatatype:Y.FLOAT,componentsPerAttribute:3,values:v.normals})),t.tangent&&(c.tangent=new Ne({componentDatatype:Y.FLOAT,componentsPerAttribute:3,values:v.tangents})),t.bitangent&&(c.bitangent=new Ne({componentDatatype:Y.FLOAT,componentsPerAttribute:3,values:v.bitangents})),{attributes:c,indices:V}}function Zpt(e,t){if(!t.normal&&!t.tangent&&!t.bitangent&&!t.st)return e;let n=e.position.values,i,r;(t.normal||t.bitangent)&&(i=e.normal.values,r=e.bitangent.values);let o=e.position.values.length/18,s=o*3,a=o*2,c=s*2,u;if(t.normal||t.bitangent||t.tangent){let f=t.normal?new Float32Array(s*6):void 0,d=t.tangent?new Float32Array(s*6):void 0,p=t.bitangent?new Float32Array(s*6):void 0,g=eTe,m=tTe,y=l8,A=u8,b=Jpt,x=nTe,T=c;for(u=0;u<s;u+=3){let E=T+c;g=h.fromArray(n,u,g),m=h.fromArray(n,u+s,m),y=h.fromArray(n,(u+3)%s,y),m=h.subtract(m,g,m),y=h.subtract(y,g,y),A=h.normalize(h.cross(m,y,A),A),t.normal&&(gr.addAttribute(f,A,E),gr.addAttribute(f,A,E+3),gr.addAttribute(f,A,T),gr.addAttribute(f,A,T+3)),(t.tangent||t.bitangent)&&(x=h.fromArray(i,u,x),t.bitangent&&(gr.addAttribute(p,x,E),gr.addAttribute(p,x,E+3),gr.addAttribute(p,x,T),gr.addAttribute(p,x,T+3)),t.tangent&&(b=h.normalize(h.cross(x,A,b),b),gr.addAttribute(d,b,E),gr.addAttribute(d,b,E+3),gr.addAttribute(d,b,T),gr.addAttribute(d,b,T+3))),T+=6}if(t.normal){for(f.set(i),u=0;u<s;u+=3)f[u+s]=-i[u],f[u+s+1]=-i[u+1],f[u+s+2]=-i[u+2];e.normal.values=f}else e.normal=void 0;if(t.bitangent?(p.set(r),p.set(r,s),e.bitangent.values=p):e.bitangent=void 0,t.tangent){let E=e.tangent.values;d.set(E),d.set(E,s),e.tangent.values=d}}if(t.st){let f=e.st.values,d=new Float32Array(a*6);d.set(f),d.set(f,a);let p=a*2;for(let g=0;g<2;g++){for(d[p++]=f[0],d[p++]=f[1],u=2;u<a;u+=2){let m=f[u],y=f[u+1];d[p++]=m,d[p++]=y,d[p++]=m,d[p++]=y}d[p++]=f[0],d[p++]=f[1]}e.st.values=d}return e}function qQ(e,t,n){n[t++]=e[0],n[t++]=e[1],n[t++]=e[2];for(let i=3;i<e.length;i+=3){let r=e[i],o=e[i+1],s=e[i+2];n[t++]=r,n[t++]=o,n[t++]=s,n[t++]=r,n[t++]=o,n[t++]=s}return n[t++]=e[0],n[t++]=e[1],n[t]=e[2],n}function Qpt(e,t){let n=new Be({position:t.position,normal:t.normal||t.bitangent||e.shadowVolume,tangent:t.tangent,bitangent:t.normal||t.bitangent,st:t.st}),i=e.ellipsoid,r=gr.computePositions(e),o=rTe(r,n,i),s=e.height,a=e.extrudedHeight,c=o.attributes,u=o.indices,f=c.position.values,d=f.length,p=new Float64Array(d*6),g=new Float64Array(d);g.set(f);let m=new Float64Array(d*4);f=mi.scaleToGeodeticHeight(f,s,i),m=qQ(f,0,m),g=mi.scaleToGeodeticHeight(g,a,i),m=qQ(g,d*2,m),p.set(f),p.set(g,d),p.set(m,d*2),c.position.values=p,c=Zpt(c,t);let y,A=d/3;if(e.shadowVolume){let O=c.normal.values;d=O.length;let L=new Float32Array(d*6);for(y=0;y<d;y++)O[y]=-O[y];L.set(O,d),L=qQ(O,d*4,L),c.extrudeDirection=new Ne({componentDatatype:Y.FLOAT,componentsPerAttribute:3,values:L}),t.normal||(c.normal=void 0)}if(l(e.offsetAttribute)){let O=new Uint8Array(A*6);if(e.offsetAttribute===pn.TOP)O=O.fill(1,0,A).fill(1,A*2,A*4);else{let L=e.offsetAttribute===pn.NONE?0:1;O=O.fill(L)}c.applyOffset=new Ne({componentDatatype:Y.UNSIGNED_BYTE,componentsPerAttribute:1,values:O})}let b=u.length,x=A+A,T=je.createTypedArray(p.length/3,b*2+x*3);T.set(u);let E=b;for(y=0;y<b;y+=3){let O=u[y],L=u[y+1],_=u[y+2];T[E++]=_+A,T[E++]=L+A,T[E++]=O+A}let v,S,I,R;for(y=0;y<x;y+=2)v=y+x,S=v+x,I=v+1,R=S+1,T[E++]=v,T[E++]=S,T[E++]=I,T[E++]=I,T[E++]=S,T[E++]=R;return{attributes:c,indices:T}}var Zxe=new h,W1=new h,Fd=new he;function Qxe(e,t,n,i,r,o){let s=h.subtract(t,e,Zxe);h.normalize(s,s);let a=n.geodeticSurfaceNormal(e,W1),c=h.cross(s,a,Zxe);h.multiplyByScalar(c,i,c);let u=r.latitude,f=r.longitude,d=o.latitude,p=o.longitude;h.add(e,c,W1),n.cartesianToCartographic(W1,Fd);let g=Fd.latitude,m=Fd.longitude;u=Math.min(u,g),f=Math.min(f,m),d=Math.max(d,g),p=Math.max(p,m),h.subtract(e,c,W1),n.cartesianToCartographic(W1,Fd),g=Fd.latitude,m=Fd.longitude,u=Math.min(u,g),f=Math.min(f,m),d=Math.max(d,g),p=Math.max(p,m),r.latitude=u,r.longitude=f,o.latitude=d,o.longitude=p}var Ld=new h,q1=new h,Mu=new he,Nu=new he;function oTe(e,t,n,i,r){e=iTe(e,t);let o=Lr(e,h.equalsEpsilon),s=o.length;if(s<2||n<=0)return new ie;let a=n*.5;Mu.latitude=Number.POSITIVE_INFINITY,Mu.longitude=Number.POSITIVE_INFINITY,Nu.latitude=Number.NEGATIVE_INFINITY,Nu.longitude=Number.NEGATIVE_INFINITY;let c,u;if(i===ur.ROUNDED){let p=o[0];h.subtract(p,o[1],Ld),h.normalize(Ld,Ld),h.multiplyByScalar(Ld,a,Ld),h.add(p,Ld,q1),t.cartesianToCartographic(q1,Fd),c=Fd.latitude,u=Fd.longitude,Mu.latitude=Math.min(Mu.latitude,c),Mu.longitude=Math.min(Mu.longitude,u),Nu.latitude=Math.max(Nu.latitude,c),Nu.longitude=Math.max(Nu.longitude,u)}for(let p=0;p<s-1;++p)Qxe(o[p],o[p+1],t,a,Mu,Nu);let f=o[s-1];h.subtract(f,o[s-2],Ld),h.normalize(Ld,Ld),h.multiplyByScalar(Ld,a,Ld),h.add(f,Ld,q1),Qxe(f,q1,t,a,Mu,Nu),i===ur.ROUNDED&&(t.cartesianToCartographic(q1,Fd),c=Fd.latitude,u=Fd.longitude,Mu.latitude=Math.min(Mu.latitude,c),Mu.longitude=Math.min(Mu.longitude,u),Nu.latitude=Math.max(Nu.latitude,c),Nu.longitude=Math.max(Nu.longitude,u));let d=l(r)?r:new ie;return d.north=Nu.latitude,d.south=Mu.latitude,d.east=Nu.longitude,d.west=Mu.longitude,d}function Dg(e){e=e??H.EMPTY_OBJECT;let t=e.positions,n=e.width,i=e.height??0,r=e.extrudedHeight??i;this._positions=t,this._ellipsoid=ee.clone(e.ellipsoid??ee.default),this._vertexFormat=Be.clone(e.vertexFormat??Be.DEFAULT),this._width=n,this._height=Math.max(i,r),this._extrudedHeight=Math.min(i,r),this._cornerType=e.cornerType??ur.ROUNDED,this._granularity=e.granularity??P.RADIANS_PER_DEGREE,this._shadowVolume=e.shadowVolume??!1,this._workerName="createCorridorGeometry",this._offsetAttribute=e.offsetAttribute,this._rectangle=void 0,this.packedLength=1+t.length*h.packedLength+ee.packedLength+Be.packedLength+7}Dg.pack=function(e,t,n){n=n??0;let i=e._positions,r=i.length;t[n++]=r;for(let o=0;o<r;++o,n+=h.packedLength)h.pack(i[o],t,n);return ee.pack(e._ellipsoid,t,n),n+=ee.packedLength,Be.pack(e._vertexFormat,t,n),n+=Be.packedLength,t[n++]=e._width,t[n++]=e._height,t[n++]=e._extrudedHeight,t[n++]=e._cornerType,t[n++]=e._granularity,t[n++]=e._shadowVolume?1:0,t[n]=e._offsetAttribute??-1,t};var sTe=ee.clone(ee.UNIT_SPHERE),aTe=new Be,Pg={positions:void 0,ellipsoid:sTe,vertexFormat:aTe,width:void 0,height:void 0,extrudedHeight:void 0,cornerType:void 0,granularity:void 0,shadowVolume:void 0,offsetAttribute:void 0};Dg.unpack=function(e,t,n){t=t??0;let i=e[t++],r=new Array(i);for(let m=0;m<i;++m,t+=h.packedLength)r[m]=h.unpack(e,t);let o=ee.unpack(e,t,sTe);t+=ee.packedLength;let s=Be.unpack(e,t,aTe);t+=Be.packedLength;let a=e[t++],c=e[t++],u=e[t++],f=e[t++],d=e[t++],p=e[t++]===1,g=e[t];return l(n)?(n._positions=r,n._ellipsoid=ee.clone(o,n._ellipsoid),n._vertexFormat=Be.clone(s,n._vertexFormat),n._width=a,n._height=c,n._extrudedHeight=u,n._cornerType=f,n._granularity=d,n._shadowVolume=p,n._offsetAttribute=g===-1?void 0:g,n):(Pg.positions=r,Pg.width=a,Pg.height=c,Pg.extrudedHeight=u,Pg.cornerType=f,Pg.granularity=d,Pg.shadowVolume=p,Pg.offsetAttribute=g===-1?void 0:g,new Dg(Pg))};Dg.computeRectangle=function(e,t){e=e??H.EMPTY_OBJECT;let n=e.positions,i=e.width,r=e.ellipsoid??ee.default,o=e.cornerType??ur.ROUNDED;return oTe(n,r,i,o,t)};Dg.createGeometry=function(e){let t=e._positions,n=e._width,i=e._ellipsoid;t=iTe(t,i);let r=Lr(t,h.equalsEpsilon);if(r.length<2||n<=0)return;let o=e._height,s=e._extrudedHeight,a=!P.equalsEpsilon(o,s,0,P.EPSILON2),c=e._vertexFormat,u={ellipsoid:i,positions:r,width:n,cornerType:e._cornerType,granularity:e._granularity,saveAttributes:!0},f;if(a)u.height=o,u.extrudedHeight=s,u.shadowVolume=e._shadowVolume,u.offsetAttribute=e._offsetAttribute,f=Qpt(u,c);else{let g=gr.computePositions(u);if(f=rTe(g,c,i),f.attributes.position.values=mi.scaleToGeodeticHeight(f.attributes.position.values,o,i),l(e._offsetAttribute)){let m=e._offsetAttribute===pn.NONE?0:1,y=f.attributes.position.values.length,A=new Uint8Array(y/3).fill(m);f.attributes.applyOffset=new Ne({componentDatatype:Y.UNSIGNED_BYTE,componentsPerAttribute:1,values:A})}}let d=f.attributes,p=ue.fromVertices(d.position.values,void 0,3);return c.position||(f.attributes.position.values=void 0),new wt({attributes:d,indices:f.indices,primitiveType:Oe.TRIANGLES,boundingSphere:p,offsetAttribute:e._offsetAttribute})};Dg.createShadowVolume=function(e,t,n){let i=e._granularity,r=e._ellipsoid,o=t(i,r),s=n(i,r);return new Dg({positions:e._positions,width:e._width,cornerType:e._cornerType,ellipsoid:r,granularity:i,extrudedHeight:o,height:s,vertexFormat:Be.POSITION_ONLY,shadowVolume:!0})};Object.defineProperties(Dg.prototype,{rectangle:{get:function(){return l(this._rectangle)||(this._rectangle=oTe(this._positions,this._ellipsoid,this._width,this._cornerType)),this._rectangle}},textureCoordinateRotationPoints:{get:function(){return[0,0,0,1,1,0]}}});var sS=Dg;var cTe=new h,lTe=new h,e0t=new h;function t0t(e,t){for(let n=0;n<e.length;n++)e[n]=t.scaleToGeodeticSurface(e[n],e[n]);return e}function uTe(e,t){let n=[],i=e.positions,r=e.corners,o=e.endPositions,s=new En,a,c=0,u=0,f,d=0,p;for(f=0;f<i.length;f+=2)p=i[f].length-3,c+=p,d+=p/3*4,u+=i[f+1].length-3;for(c+=3,u+=3,f=0;f<r.length;f++){let N=r[f].leftPositions;l(N)?(p=N.length,c+=p,d+=p/3*2):(p=r[f].rightPositions.length,u+=p,d+=p/3*2)}let g=l(o),m;g&&(m=o[0].length-3,c+=m,u+=m,m/=3,d+=m*4);let y=c+u,A=new Float64Array(y),b=0,x=y-1,T,E,v,S,I,R,O=m/2,L=je.createTypedArray(y/3,d+4),_=0;if(L[_++]=b/3,L[_++]=(x-2)/3,g){n.push(b/3),R=cTe,I=lTe;let N=o[0];for(f=0;f<O;f++)R=h.fromArray(N,(O-1-f)*3,R),I=h.fromArray(N,(O+f)*3,I),gr.addAttribute(A,I,b),gr.addAttribute(A,R,void 0,x),E=b/3,S=E+1,T=(x-2)/3,v=T-1,L[_++]=T,L[_++]=v,L[_++]=E,L[_++]=S,b+=3,x-=3}let C=0,w=i[C++],D=i[C++];for(A.set(w,b),A.set(D,x-D.length+1),p=D.length-3,n.push(b/3,(x-2)/3),f=0;f<p;f+=3)E=b/3,S=E+1,T=(x-2)/3,v=T-1,L[_++]=T,L[_++]=v,L[_++]=E,L[_++]=S,b+=3,x-=3;for(f=0;f<r.length;f++){let N;a=r[f];let F=a.leftPositions,V=a.rightPositions,B,j=e0t;if(l(F)){for(x-=3,B=v,n.push(S),N=0;N<F.length/3;N++)j=h.fromArray(F,N*3,j),L[_++]=B-N-1,L[_++]=B-N,gr.addAttribute(A,j,void 0,x),x-=3;n.push(B-Math.floor(F.length/6)),t===ur.BEVELED&&n.push((x-2)/3+1),b+=3}else{for(b+=3,B=S,n.push(v),N=0;N<V.length/3;N++)j=h.fromArray(V,N*3,j),L[_++]=B+N,L[_++]=B+N+1,gr.addAttribute(A,j,b),b+=3;n.push(B+Math.floor(V.length/6)),t===ur.BEVELED&&n.push(b/3-1),x-=3}for(w=i[C++],D=i[C++],w.splice(0,3),D.splice(D.length-3,3),A.set(w,b),A.set(D,x-D.length+1),N=0;N<D.length;N+=3)S=b/3,E=S-1,v=(x-2)/3,T=v+1,L[_++]=T,L[_++]=v,L[_++]=E,L[_++]=S,b+=3,x-=3;b-=3,x+=3,n.push(b/3,(x-2)/3)}if(g){b+=3,x-=3,R=cTe,I=lTe;let N=o[1];for(f=0;f<O;f++)R=h.fromArray(N,(m-f-1)*3,R),I=h.fromArray(N,f*3,I),gr.addAttribute(A,R,void 0,x),gr.addAttribute(A,I,b),S=b/3,E=S-1,v=(x-2)/3,T=v+1,L[_++]=T,L[_++]=v,L[_++]=E,L[_++]=S,b+=3,x-=3;n.push(b/3)}else n.push(b/3,(x-2)/3);return L[_++]=b/3,L[_]=(x-2)/3,s.position=new Ne({componentDatatype:Y.DOUBLE,componentsPerAttribute:3,values:A}),{attributes:s,indices:L,wallIndices:n}}function n0t(e){let t=e.ellipsoid,n=gr.computePositions(e),i=uTe(n,e.cornerType),r=i.wallIndices,o=e.height,s=e.extrudedHeight,a=i.attributes,c=i.indices,u=a.position.values,f=u.length,d=new Float64Array(f);d.set(u);let p=new Float64Array(f*2);if(u=mi.scaleToGeodeticHeight(u,o,t),d=mi.scaleToGeodeticHeight(d,s,t),p.set(u),p.set(d,f),a.position.values=p,f/=3,l(e.offsetAttribute)){let T=new Uint8Array(f*2);if(e.offsetAttribute===pn.TOP)T=T.fill(1,0,f);else{let E=e.offsetAttribute===pn.NONE?0:1;T=T.fill(E)}a.applyOffset=new Ne({componentDatatype:Y.UNSIGNED_BYTE,componentsPerAttribute:1,values:T})}let g,m=c.length,y=je.createTypedArray(p.length/3,(m+r.length)*2);y.set(c);let A=m;for(g=0;g<m;g+=2){let T=c[g],E=c[g+1];y[A++]=T+f,y[A++]=E+f}let b,x;for(g=0;g<r.length;g++)b=r[g],x=b+f,y[A++]=b,y[A++]=x;return{attributes:a,indices:y}}function Y1(e){e=e??H.EMPTY_OBJECT;let t=e.positions,n=e.width,i=e.height??0,r=e.extrudedHeight??i;this._positions=t,this._ellipsoid=ee.clone(e.ellipsoid??ee.default),this._width=n,this._height=Math.max(i,r),this._extrudedHeight=Math.min(i,r),this._cornerType=e.cornerType??ur.ROUNDED,this._granularity=e.granularity??P.RADIANS_PER_DEGREE,this._offsetAttribute=e.offsetAttribute,this._workerName="createCorridorOutlineGeometry",this.packedLength=1+t.length*h.packedLength+ee.packedLength+6}Y1.pack=function(e,t,n){n=n??0;let i=e._positions,r=i.length;t[n++]=r;for(let o=0;o<r;++o,n+=h.packedLength)h.pack(i[o],t,n);return ee.pack(e._ellipsoid,t,n),n+=ee.packedLength,t[n++]=e._width,t[n++]=e._height,t[n++]=e._extrudedHeight,t[n++]=e._cornerType,t[n++]=e._granularity,t[n]=e._offsetAttribute??-1,t};var fTe=ee.clone(ee.UNIT_SPHERE),tA={positions:void 0,ellipsoid:fTe,width:void 0,height:void 0,extrudedHeight:void 0,cornerType:void 0,granularity:void 0,offsetAttribute:void 0};Y1.unpack=function(e,t,n){t=t??0;let i=e[t++],r=new Array(i);for(let p=0;p<i;++p,t+=h.packedLength)r[p]=h.unpack(e,t);let o=ee.unpack(e,t,fTe);t+=ee.packedLength;let s=e[t++],a=e[t++],c=e[t++],u=e[t++],f=e[t++],d=e[t];return l(n)?(n._positions=r,n._ellipsoid=ee.clone(o,n._ellipsoid),n._width=s,n._height=a,n._extrudedHeight=c,n._cornerType=u,n._granularity=f,n._offsetAttribute=d===-1?void 0:d,n):(tA.positions=r,tA.width=s,tA.height=a,tA.extrudedHeight=c,tA.cornerType=u,tA.granularity=f,tA.offsetAttribute=d===-1?void 0:d,new Y1(tA))};Y1.createGeometry=function(e){let t=e._positions,n=e._width,i=e._ellipsoid;t=t0t(t,i);let r=Lr(t,h.equalsEpsilon);if(r.length<2||n<=0)return;let o=e._height,s=e._extrudedHeight,a=!P.equalsEpsilon(o,s,0,P.EPSILON2),c={ellipsoid:i,positions:r,width:n,cornerType:e._cornerType,granularity:e._granularity,saveAttributes:!1},u;if(a)c.height=o,c.extrudedHeight=s,c.offsetAttribute=e._offsetAttribute,u=n0t(c);else{let p=gr.computePositions(c);if(u=uTe(p,c.cornerType),u.attributes.position.values=mi.scaleToGeodeticHeight(u.attributes.position.values,o,i),l(e._offsetAttribute)){let g=u.attributes.position.values.length,m=e._offsetAttribute===pn.NONE?0:1,y=new Uint8Array(g/3).fill(m);u.attributes.applyOffset=new Ne({componentDatatype:Y.UNSIGNED_BYTE,componentsPerAttribute:1,values:y})}}let f=u.attributes,d=ue.fromVertices(f.position.values,void 0,3);return new wt({attributes:f,indices:u.indices,primitiveType:Oe.LINES,boundingSphere:d,offsetAttribute:e._offsetAttribute})};var f8=Y1;var i0t=new hi(0);function Hl(e){Oi.call(this,e),this._zIndex=0,this._terrainOffsetProperty=void 0}l(Object.create)&&(Hl.prototype=Object.create(Oi.prototype),Hl.prototype.constructor=Hl);Object.defineProperties(Hl.prototype,{zIndex:{get:function(){return this._zIndex}},terrainOffsetProperty:{get:function(){return this._terrainOffsetProperty}}});Hl.prototype._isOnTerrain=function(e,t){return this._fillEnabled&&!l(t.height)&&!l(t.extrudedHeight)&&pu.isSupported(this._scene)};Hl.prototype._getIsClosed=function(e){let t=e.height,n=e.extrudedHeight;return t===0||l(n)&&n!==t};Hl.prototype._computeCenter=pe.throwInstantiationError;Hl.prototype._onEntityPropertyChanged=function(e,t,n,i){if(Oi.prototype._onEntityPropertyChanged.call(this,e,t,n,i),this._observedPropertyNames.indexOf(t)===-1)return;let r=this._entity[this._geometryPropertyName];if(!l(r))return;l(r.zIndex)&&(l(r.height)||l(r.extrudedHeight))&&yt(yt.geometryZIndex),this._zIndex=r.zIndex??i0t,l(this._terrainOffsetProperty)&&(this._terrainOffsetProperty.destroy(),this._terrainOffsetProperty=void 0);let o=r.heightReference,s=r.extrudedHeightReference;if(l(o)||l(s)){let a=new rp(this._computeCenter.bind(this),!this._dynamic);this._terrainOffsetProperty=new bC(this._scene,a,o,s)}};Hl.prototype.destroy=function(){l(this._terrainOffsetProperty)&&(this._terrainOffsetProperty.destroy(),this._terrainOffsetProperty=void 0),Oi.prototype.destroy.call(this)};Hl.getGeometryHeight=function(e,t){if(!l(e)){t!==We.NONE&&yt(yt.geometryHeightReference);return}return us(t)?0:e};Hl.getGeometryExtrudedHeight=function(e,t){if(!l(e)){t!==We.NONE&&yt(yt.geometryExtrudedHeightReference);return}return us(t)?Hl.CLAMP_TO_GROUND:e};Hl.CLAMP_TO_GROUND="clamp";Hl.computeGeometryOffsetAttribute=function(e,t,n,i){(!l(e)||!l(t))&&(t=We.NONE),(!l(n)||!l(i))&&(i=We.NONE);let r=0;if(t!==We.NONE&&r++,i===We.RELATIVE_TO_GROUND&&r++,r===2)return pn.ALL;if(r===1)return pn.TOP};var oi=Hl;var dTe=new z,hTe=h.ZERO,mTe=new h,pTe=new ie;function r0t(e){this.id=e,this.vertexFormat=void 0,this.positions=void 0,this.width=void 0,this.cornerType=void 0,this.height=void 0,this.extrudedHeight=void 0,this.granularity=void 0,this.offsetAttribute=void 0}function Yh(e,t){oi.call(this,{entity:e,scene:t,geometryOptions:new r0t(e),geometryPropertyName:"corridor",observedPropertyNames:["availability","corridor"]}),this._onEntityPropertyChanged(e,"corridor",e.corridor,void 0)}l(Object.create)&&(Yh.prototype=Object.create(oi.prototype),Yh.prototype.constructor=Yh);Yh.prototype.createFillGeometryInstance=function(e){let t=this._entity,n=t.isAvailable(e),i={show:new Pn(n&&t.isShowing&&this._showProperty.getValue(e)&&this._fillProperty.getValue(e)),distanceDisplayCondition:Qn.fromDistanceDisplayCondition(this._distanceDisplayConditionProperty.getValue(e)),offset:void 0,color:void 0};if(this._materialProperty instanceof Kt){let r;l(this._materialProperty.color)&&(this._materialProperty.color.isConstant||n)&&(r=this._materialProperty.color.getValue(e,dTe)),l(r)||(r=z.WHITE),i.color=Jt.fromColor(r)}return l(this._options.offsetAttribute)&&(i.offset=Er.fromCartesian3(X.getValueOrDefault(this._terrainOffsetProperty,e,hTe,mTe))),new Bt({id:t,geometry:new sS(this._options),attributes:i})};Yh.prototype.createOutlineGeometryInstance=function(e){let t=this._entity,n=t.isAvailable(e),i=X.getValueOrDefault(this._outlineColorProperty,e,z.BLACK,dTe),r={show:new Pn(n&&t.isShowing&&this._showProperty.getValue(e)&&this._showOutlineProperty.getValue(e)),color:Jt.fromColor(i),distanceDisplayCondition:Qn.fromDistanceDisplayCondition(this._distanceDisplayConditionProperty.getValue(e)),offset:void 0};return l(this._options.offsetAttribute)&&(r.offset=Er.fromCartesian3(X.getValueOrDefault(this._terrainOffsetProperty,e,hTe,mTe))),new Bt({id:t,geometry:new f8(this._options),attributes:r})};Yh.prototype._computeCenter=function(e,t){let n=X.getValueOrUndefined(this._entity.corridor.positions,e);if(!(!l(n)||n.length===0))return h.clone(n[Math.floor(n.length/2)],t)};Yh.prototype._isHidden=function(e,t){return!l(t.positions)||!l(t.width)||Oi.prototype._isHidden.call(this,e,t)};Yh.prototype._isDynamic=function(e,t){return!t.positions.isConstant||!X.isConstant(t.height)||!X.isConstant(t.extrudedHeight)||!X.isConstant(t.granularity)||!X.isConstant(t.width)||!X.isConstant(t.outlineWidth)||!X.isConstant(t.cornerType)||!X.isConstant(t.zIndex)||this._onTerrain&&!X.isConstant(this._materialProperty)&&!(this._materialProperty instanceof Kt)};Yh.prototype._setStaticOptions=function(e,t){let n=X.getValueOrUndefined(t.height,nt.MINIMUM_VALUE),i=X.getValueOrDefault(t.heightReference,nt.MINIMUM_VALUE,We.NONE),r=X.getValueOrUndefined(t.extrudedHeight,nt.MINIMUM_VALUE),o=X.getValueOrDefault(t.extrudedHeightReference,nt.MINIMUM_VALUE,We.NONE);l(r)&&!l(n)&&(n=0);let s=this._options;s.vertexFormat=this._materialProperty instanceof Kt?An.VERTEX_FORMAT:Cr.MaterialSupport.TEXTURED.vertexFormat,s.positions=t.positions.getValue(nt.MINIMUM_VALUE,s.positions),s.width=t.width.getValue(nt.MINIMUM_VALUE),s.granularity=X.getValueOrUndefined(t.granularity,nt.MINIMUM_VALUE),s.cornerType=X.getValueOrUndefined(t.cornerType,nt.MINIMUM_VALUE),s.offsetAttribute=oi.computeGeometryOffsetAttribute(n,i,r,o),s.height=oi.getGeometryHeight(n,i),r=oi.getGeometryExtrudedHeight(r,o),r===oi.CLAMP_TO_GROUND&&(r=Ni.getMinimumMaximumHeights(sS.computeRectangle(s,pTe)).minimumTerrainHeight),s.extrudedHeight=r};Yh.DynamicGeometryUpdater=aS;function aS(e,t,n){Ri.call(this,e,t,n)}l(Object.create)&&(aS.prototype=Object.create(Ri.prototype),aS.prototype.constructor=aS);aS.prototype._isHidden=function(e,t,n){let i=this._options;return!l(i.positions)||!l(i.width)||Ri.prototype._isHidden.call(this,e,t,n)};aS.prototype._setOptions=function(e,t,n){let i=this._options,r=X.getValueOrUndefined(t.height,n),o=X.getValueOrDefault(t.heightReference,n,We.NONE),s=X.getValueOrUndefined(t.extrudedHeight,n),a=X.getValueOrDefault(t.extrudedHeightReference,n,We.NONE);l(s)&&!l(r)&&(r=0),i.positions=X.getValueOrUndefined(t.positions,n),i.width=X.getValueOrUndefined(t.width,n),i.granularity=X.getValueOrUndefined(t.granularity,n),i.cornerType=X.getValueOrUndefined(t.cornerType,n),i.offsetAttribute=oi.computeGeometryOffsetAttribute(r,o,s,a),i.height=oi.getGeometryHeight(r,o),s=oi.getGeometryExtrudedHeight(s,a),s===oi.CLAMP_TO_GROUND&&(s=Ni.getMinimumMaximumHeights(sS.computeRectangle(i,pTe)).minimumTerrainHeight),i.extrudedHeight=s};var d8=Yh;function h8(){pe.throwInstantiationError()}Object.defineProperties(h8.prototype,{name:{get:pe.throwInstantiationError},clock:{get:pe.throwInstantiationError},entities:{get:pe.throwInstantiationError},isLoading:{get:pe.throwInstantiationError},changedEvent:{get:pe.throwInstantiationError},errorEvent:{get:pe.throwInstantiationError},loadingEvent:{get:pe.throwInstantiationError},show:{get:pe.throwInstantiationError},clustering:{get:pe.throwInstantiationError}});h8.prototype.update=function(e){pe.throwInstantiationError()};h8.setLoading=function(e,t){e._isLoading!==t&&(t?e._entityCollection.suspendEvents():e._entityCollection.resumeEvents(),e._isLoading=t,e._loading.raiseEvent(e,t))};var Fs=h8;function Rp(e,t){this._ellipsoid=e,this._cameraPosition=new h,this._cameraPositionInScaledSpace=new h,this._distanceToLimbInScaledSpaceSquared=0,l(t)&&(this.cameraPosition=t)}Object.defineProperties(Rp.prototype,{ellipsoid:{get:function(){return this._ellipsoid}},cameraPosition:{get:function(){return this._cameraPosition},set:function(e){let n=this._ellipsoid.transformPositionToScaledSpace(e,this._cameraPositionInScaledSpace),i=h.magnitudeSquared(n)-1;h.clone(e,this._cameraPosition),this._cameraPositionInScaledSpace=n,this._distanceToLimbInScaledSpaceSquared=i}}});var gTe=new h;Rp.prototype.isPointVisible=function(e){let n=this._ellipsoid.transformPositionToScaledSpace(e,gTe);return XQ(n,this._cameraPositionInScaledSpace,this._distanceToLimbInScaledSpaceSquared)};Rp.prototype.isScaledSpacePointVisible=function(e){return XQ(e,this._cameraPositionInScaledSpace,this._distanceToLimbInScaledSpaceSquared)};var o0t=new h;Rp.prototype.isScaledSpacePointVisiblePossiblyUnderEllipsoid=function(e,t){let n=this._ellipsoid,i,r;return l(t)&&t<0&&n.minimumRadius>-t?(r=o0t,r.x=this._cameraPosition.x/(n.radii.x+t),r.y=this._cameraPosition.y/(n.radii.y+t),r.z=this._cameraPosition.z/(n.radii.z+t),i=r.x*r.x+r.y*r.y+r.z*r.z-1):(r=this._cameraPositionInScaledSpace,i=this._distanceToLimbInScaledSpaceSquared),XQ(e,r,i)};Rp.prototype.computeHorizonCullingPoint=function(e,t,n){return ATe(this._ellipsoid,e,t,n)};var _Te=ee.clone(ee.UNIT_SPHERE);Rp.prototype.computeHorizonCullingPointPossiblyUnderEllipsoid=function(e,t,n,i){let r=yTe(this._ellipsoid,n,_Te);return ATe(r,e,t,i)};Rp.prototype.computeHorizonCullingPointFromVertices=function(e,t,n,i,r){return bTe(this._ellipsoid,e,t,n,i,r)};Rp.prototype.computeHorizonCullingPointFromVerticesPossiblyUnderEllipsoid=function(e,t,n,i,r,o){let s=yTe(this._ellipsoid,r,_Te);return bTe(s,e,t,n,i,o)};var s0t=[];Rp.prototype.computeHorizonCullingPointFromRectangle=function(e,t,n){let i=ie.subsample(e,t,0,s0t),r=ue.fromPoints(i);if(!(h.magnitude(r.center)<.1*t.minimumRadius))return this.computeHorizonCullingPoint(r.center,i,n)};var a0t=new h;function yTe(e,t,n){if(l(t)&&t<0&&e.minimumRadius>-t){let i=h.fromElements(e.radii.x+t,e.radii.y+t,e.radii.z+t,a0t);e=ee.fromCartesian3(i,n)}return e}function ATe(e,t,n,i){l(i)||(i=new h);let r=ETe(e,t),o=0;for(let s=0,a=n.length;s<a;++s){let c=n[s],u=xTe(e,c,r);if(u<0)return;o=Math.max(o,u)}return TTe(r,o,i)}var m8=new h;function bTe(e,t,n,i,r,o){l(o)||(o=new h),i=i??3,r=r??h.ZERO;let s=ETe(e,t),a=0;for(let c=0,u=n.length;c<u;c+=i){m8.x=n[c]+r.x,m8.y=n[c+1]+r.y,m8.z=n[c+2]+r.z;let f=xTe(e,m8,s);if(f<0)return;a=Math.max(a,f)}return TTe(s,a,o)}function XQ(e,t,n){let i=t,r=n,o=h.subtract(e,i,gTe),s=-h.dot(o,i);return!(r<0?s>0:s>r&&s*s/h.magnitudeSquared(o)>r)}var c0t=new h,l0t=new h;function xTe(e,t,n){let i=e.transformPositionToScaledSpace(t,c0t),r=h.magnitudeSquared(i),o=Math.sqrt(r),s=h.divideByScalar(i,o,l0t);r=Math.max(1,r),o=Math.max(1,o);let a=h.dot(s,n),c=h.magnitude(h.cross(s,n,s)),u=1/o,f=Math.sqrt(r-1)*u;return 1/(a*u-c*f)}function TTe(e,t,n){if(!(t<=0||t===1/0||t!==t))return h.multiplyByScalar(e,t,n)}var YQ=new h;function ETe(e,t){return h.equals(t,h.ZERO)?t:(e.transformPositionToScaledSpace(t,YQ),h.normalize(YQ,YQ))}var Op=Rp;function es(e,t){e=e??H.EMPTY_OBJECT;let n=e.translucencyByDistance,i=e.scaleByDistance,r=e.distanceDisplayCondition;l(n)&&(n=qt.clone(n)),l(i)&&(i=qt.clone(i)),l(r)&&(r=Gt.clone(r)),this._show=e.show??!0,this._position=h.clone(e.position??h.ZERO),this._actualPosition=h.clone(this._position),this._color=z.clone(e.color??z.WHITE),this._outlineColor=z.clone(e.outlineColor??z.TRANSPARENT),this._outlineWidth=e.outlineWidth??0,this._pixelSize=e.pixelSize??10,this._scaleByDistance=i,this._translucencyByDistance=n,this._distanceDisplayCondition=r,this._disableDepthTestDistance=e.disableDepthTestDistance??0,this._id=e.id,this._collection=e.collection??t,this._clusterShow=!0,this._pickId=void 0,this._pointPrimitiveCollection=t,this._dirty=!1,this._index=-1,this._splitDirection=e.splitDirection??Wo.NONE}var CTe=es.SHOW_INDEX=0,wTe=es.POSITION_INDEX=1,u0t=es.COLOR_INDEX=2,f0t=es.OUTLINE_COLOR_INDEX=3,d0t=es.OUTLINE_WIDTH_INDEX=4,h0t=es.PIXEL_SIZE_INDEX=5,m0t=es.SCALE_BY_DISTANCE_INDEX=6,p0t=es.TRANSLUCENCY_BY_DISTANCE_INDEX=7,g0t=es.DISTANCE_DISPLAY_CONDITION_INDEX=8,_0t=es.DISABLE_DEPTH_DISTANCE_INDEX=9,y0t=es.SPLIT_DIRECTION_INDEX=10;es.NUMBER_OF_PROPERTIES=11;function Tf(e,t){let n=e._pointPrimitiveCollection;l(n)&&(n._updatePointPrimitive(e,t),e._dirty=!0)}Object.defineProperties(es.prototype,{show:{get:function(){return this._show},set:function(e){this._show!==e&&(this._show=e,Tf(this,CTe))}},position:{get:function(){return this._position},set:function(e){let t=this._position;h.equals(t,e)||(h.clone(e,t),h.clone(e,this._actualPosition),Tf(this,wTe))}},scaleByDistance:{get:function(){return this._scaleByDistance},set:function(e){let t=this._scaleByDistance;qt.equals(t,e)||(this._scaleByDistance=qt.clone(e,t),Tf(this,m0t))}},translucencyByDistance:{get:function(){return this._translucencyByDistance},set:function(e){let t=this._translucencyByDistance;qt.equals(t,e)||(this._translucencyByDistance=qt.clone(e,t),Tf(this,p0t))}},pixelSize:{get:function(){return this._pixelSize},set:function(e){this._pixelSize!==e&&(this._pixelSize=e,Tf(this,h0t))}},color:{get:function(){return this._color},set:function(e){let t=this._color;z.equals(t,e)||(z.clone(e,t),Tf(this,u0t))}},outlineColor:{get:function(){return this._outlineColor},set:function(e){let t=this._outlineColor;z.equals(t,e)||(z.clone(e,t),Tf(this,f0t))}},outlineWidth:{get:function(){return this._outlineWidth},set:function(e){this._outlineWidth!==e&&(this._outlineWidth=e,Tf(this,d0t))}},distanceDisplayCondition:{get:function(){return this._distanceDisplayCondition},set:function(e){Gt.equals(this._distanceDisplayCondition,e)||(this._distanceDisplayCondition=Gt.clone(e,this._distanceDisplayCondition),Tf(this,g0t))}},disableDepthTestDistance:{get:function(){return this._disableDepthTestDistance},set:function(e){this._disableDepthTestDistance!==e&&(this._disableDepthTestDistance=e,Tf(this,_0t))}},id:{get:function(){return this._id},set:function(e){this._id=e,l(this._pickId)&&(this._pickId.object.id=e)}},pickId:{get:function(){return this._pickId}},clusterShow:{get:function(){return this._clusterShow},set:function(e){this._clusterShow!==e&&(this._clusterShow=e,Tf(this,CTe))}},splitDirection:{get:function(){return this._splitDirection},set:function(e){this._splitDirection!==e&&(this._splitDirection=e,Tf(this,y0t))}}});es.prototype.getPickId=function(e){return l(this._pickId)||(this._pickId=e.createPickId({primitive:this,collection:this._collection,id:this._id})),this._pickId};es.prototype._getActualPosition=function(){return this._actualPosition};es.prototype._setActualPosition=function(e){h.clone(e,this._actualPosition),Tf(this,wTe)};var vTe=new se;es._computeActualPosition=function(e,t,n){return t.mode===re.SCENE3D?e:(M.multiplyByPoint(n,e,vTe),pr.computeActualEllipsoidPosition(t,vTe))};var STe=new se;es._computeScreenSpacePosition=function(e,t,n,i){let r=M.multiplyByVector(e,se.fromElements(t.x,t.y,t.z,1,STe),STe);return pr.worldToWindowCoordinates(n,r,i)};es.prototype.computeScreenSpacePosition=function(e,t){let n=this._pointPrimitiveCollection;l(t)||(t=new U);let i=n.modelMatrix,r=es._computeScreenSpacePosition(i,this._actualPosition,e,t);if(l(r))return r.y=e.canvas.clientHeight-r.y,r};es.getScreenSpaceBoundingBox=function(e,t,n){let i=e.pixelSize,r=i*.5,o=t.x-r,s=t.y-r,a=i,c=i;return l(n)||(n=new et),n.x=o,n.y=s,n.width=a,n.height=c,n};es.prototype.equals=function(e){return this===e||l(e)&&this._id===e._id&&h.equals(this._position,e._position)&&z.equals(this._color,e._color)&&this._pixelSize===e._pixelSize&&this._outlineWidth===e._outlineWidth&&this._show===e._show&&z.equals(this._outlineColor,e._outlineColor)&&qt.equals(this._scaleByDistance,e._scaleByDistance)&&qt.equals(this._translucencyByDistance,e._translucencyByDistance)&&Gt.equals(this._distanceDisplayCondition,e._distanceDisplayCondition)&&this._disableDepthTestDistance===e._disableDepthTestDistance&&this._splitDirection===e._splitDirection};es.prototype._destroy=function(){this._pickId=this._pickId&&this._pickId.destroy(),this._pointPrimitiveCollection=void 0};var za=es;var A0t=za.SHOW_INDEX,JQ=za.POSITION_INDEX,ITe=za.COLOR_INDEX,b0t=za.OUTLINE_COLOR_INDEX,x0t=za.OUTLINE_WIDTH_INDEX,T0t=za.PIXEL_SIZE_INDEX,PTe=za.SCALE_BY_DISTANCE_INDEX,DTe=za.TRANSLUCENCY_BY_DISTANCE_INDEX,RTe=za.DISTANCE_DISPLAY_CONDITION_INDEX,E0t=za.DISABLE_DEPTH_DISTANCE_INDEX,C0t=za.SPLIT_DIRECTION_INDEX,ZQ=za.NUMBER_OF_PROPERTIES,ol={positionHighAndSize:0,positionLowAndOutline:1,compressedAttribute0:2,compressedAttribute1:3,scaleByDistance:4,distanceDisplayConditionAndDisableDepthAndSplitDirection:5};function Bd(e){e=e??H.EMPTY_OBJECT,this._sp=void 0,this._spTranslucent=void 0,this._rsOpaque=void 0,this._rsTranslucent=void 0,this._vaf=void 0,this._pointPrimitives=[],this._pointPrimitivesToUpdate=[],this._pointPrimitivesToUpdateIndex=0,this._pointPrimitivesRemoved=!1,this._createVertexArray=!1,this._shaderScaleByDistance=!1,this._compiledShaderScaleByDistance=!1,this._shaderTranslucencyByDistance=!1,this._compiledShaderTranslucencyByDistance=!1,this._shaderDistanceDisplayCondition=!1,this._compiledShaderDistanceDisplayCondition=!1,this._shaderDisableDepthDistance=!1,this._compiledShaderDisableDepthDistance=!1,this._propertiesChanged=new Uint32Array(ZQ),this._maxPixelSize=1,this._baseVolume=new ue,this._baseVolumeWC=new ue,this._baseVolume2D=new ue,this._boundingVolume=new ue,this._boundingVolumeDirty=!1,this._colorCommands=[],this.show=e.show??!0,this.modelMatrix=M.clone(e.modelMatrix??M.IDENTITY),this._modelMatrix=M.clone(M.IDENTITY),this.debugShowBoundingVolume=e.debugShowBoundingVolume??!1,this.blendOption=e.blendOption??ki.OPAQUE_AND_TRANSLUCENT,this._blendOption=void 0,this._mode=re.SCENE3D,this._maxTotalPointSize=1,this._buffersUsage=[Me.STATIC_DRAW,Me.STATIC_DRAW,Me.STATIC_DRAW,Me.STATIC_DRAW,Me.STATIC_DRAW,Me.STATIC_DRAW,Me.STATIC_DRAW,Me.STATIC_DRAW,Me.STATIC_DRAW];let t=this;this._uniforms={u_maxTotalPointSize:function(){return t._maxTotalPointSize}}}Object.defineProperties(Bd.prototype,{length:{get:function(){return QQ(this),this._pointPrimitives.length}}});function OTe(e){let t=e.length;for(let n=0;n<t;++n)e[n]&&e[n]._destroy()}Bd.prototype.add=function(e){let t=new za(e,this);return t._index=this._pointPrimitives.length,this._pointPrimitives.push(t),this._createVertexArray=!0,t};Bd.prototype.remove=function(e){return this.contains(e)?(this._pointPrimitives[e._index]=null,this._pointPrimitivesRemoved=!0,this._createVertexArray=!0,e._destroy(),!0):!1};Bd.prototype.removeAll=function(){OTe(this._pointPrimitives),this._pointPrimitives=[],this._pointPrimitivesToUpdate=[],this._pointPrimitivesToUpdateIndex=0,this._pointPrimitivesRemoved=!1,this._createVertexArray=!0};function QQ(e){if(e._pointPrimitivesRemoved){e._pointPrimitivesRemoved=!1;let t=[],n=e._pointPrimitives,i=n.length;for(let r=0,o=0;r<i;++r){let s=n[r];s&&(s._index=o++,t.push(s))}e._pointPrimitives=t}}Bd.prototype._updatePointPrimitive=function(e,t){e._dirty||(this._pointPrimitivesToUpdate[this._pointPrimitivesToUpdateIndex++]=e),++this._propertiesChanged[t]};Bd.prototype.contains=function(e){return l(e)&&e._pointPrimitiveCollection===this};Bd.prototype.get=function(e){return QQ(this),this._pointPrimitives[e]};Bd.prototype.computeNewBuffersUsage=function(){let e=this._buffersUsage,t=!1,n=this._propertiesChanged;for(let i=0;i<ZQ;++i){let r=n[i]===0?Me.STATIC_DRAW:Me.STREAM_DRAW;t=t||e[i]!==r,e[i]=r}return t};function v0t(e,t,n){return new k_(e,[{index:ol.positionHighAndSize,componentsPerAttribute:4,componentDatatype:Y.FLOAT,usage:n[JQ]},{index:ol.positionLowAndShow,componentsPerAttribute:4,componentDatatype:Y.FLOAT,usage:n[JQ]},{index:ol.compressedAttribute0,componentsPerAttribute:4,componentDatatype:Y.FLOAT,usage:n[ITe]},{index:ol.compressedAttribute1,componentsPerAttribute:4,componentDatatype:Y.FLOAT,usage:n[DTe]},{index:ol.scaleByDistance,componentsPerAttribute:4,componentDatatype:Y.FLOAT,usage:n[PTe]},{index:ol.distanceDisplayConditionAndDisableDepthAndSplitDirection,componentsPerAttribute:4,componentDatatype:Y.FLOAT,usage:n[RTe]}],t)}var KQ=new Sn,p8=new z;function MTe(e,t,n,i){let r=i._index,o=i._getActualPosition();e._mode===re.SCENE3D&&(ue.expand(e._baseVolume,o,e._baseVolume),e._boundingVolumeDirty=!0),Sn.fromCartesian(o,KQ);let s=i.pixelSize,a=i.outlineWidth;e._maxPixelSize=Math.max(e._maxPixelSize,s+a);let c=n[ol.positionHighAndSize],u=KQ.high;c(r,u.x,u.y,u.z,s);let f=n[ol.positionLowAndOutline],d=KQ.low;f(r,d.x,d.y,d.z,a)}var S0t=256;function NTe(e,t,n,i){let r=i._index,o=i.color,s=i.outlineColor,a=i.getPickId(t).color;p8.red=o.alpha,p8.green=s.alpha,p8.blue=a.alpha;let c=n[ol.compressedAttribute0];c(r,cn.encodeRGB8(o),cn.encodeRGB8(s),cn.encodeRGB8(a),cn.encodeRGB8(p8))}function LTe(e,t,n,i){let r=i._index,o=0,s=1,a=1,c=1,u=i.translucencyByDistance;l(u)&&(o=u.near,s=u.nearValue,a=u.far,c=u.farValue,(s!==1||c!==1)&&(e._shaderTranslucencyByDistance=!0));let f=i.show&&i.clusterShow;i.color.alpha===0&&i.outlineColor.alpha===0&&(f=!1),s=P.clamp(s,0,1),s=s===1?255:s*255|0;let d=(f?1:0)*S0t+s;c=P.clamp(c,0,1),c=c===1?255:c*255|0;let p=c,g=n[ol.compressedAttribute1];g(r,d,p,o,a)}function FTe(e,t,n,i){let r=i._index,o=n[ol.scaleByDistance],s=0,a=1,c=1,u=1,f=i.scaleByDistance;l(f)&&(s=f.near,a=f.nearValue,c=f.far,u=f.farValue,(a!==1||u!==1)&&(e._shaderScaleByDistance=!0)),o(r,s,a,c,u)}function BTe(e,t,n,i){let r=i._index,o=n[ol.distanceDisplayConditionAndDisableDepthAndSplitDirection],s=0,a=Number.MAX_VALUE,c=i.distanceDisplayCondition;l(c)&&(s=c.near,a=c.far,s*=s,a*=a,e._shaderDistanceDisplayCondition=!0);let u=i.disableDepthTestDistance;u*=u,u>0&&(e._shaderDisableDepthDistance=!0,u===Number.POSITIVE_INFINITY&&(u=-1));let f=0,d=i.splitDirection;l(d)&&(f=d),o(r,s,a,u,f)}function w0t(e,t,n,i){MTe(e,t,n,i),NTe(e,t,n,i),LTe(e,t,n,i),FTe(e,t,n,i),BTe(e,t,n,i)}function $Q(e,t,n,i,r,o){let s;i.mode===re.SCENE3D?(s=e._baseVolume,e._boundingVolumeDirty=!0):s=e._baseVolume2D;let a=[];for(let c=0;c<n;++c){let u=t[c],f=u.position,d=za._computeActualPosition(f,i,r);l(d)&&(u._setActualPosition(d),o?a.push(d):ue.expand(s,d,s))}o&&ue.fromPoints(a,s)}function I0t(e,t){let n=t.mode,i=e._pointPrimitives,r=e._pointPrimitivesToUpdate,o=e._modelMatrix;e._createVertexArray||e._mode!==n||n!==re.SCENE3D&&!M.equals(o,e.modelMatrix)?(e._mode=n,M.clone(e.modelMatrix,o),e._createVertexArray=!0,(n===re.SCENE3D||n===re.SCENE2D||n===re.COLUMBUS_VIEW)&&$Q(e,i,i.length,t,o,!0)):n===re.MORPHING?$Q(e,i,i.length,t,o,!0):(n===re.SCENE2D||n===re.COLUMBUS_VIEW)&&$Q(e,r,e._pointPrimitivesToUpdateIndex,t,o,!1)}function P0t(e,t,n){let r=t.camera.getPixelSize(n,t.context.drawingBufferWidth,t.context.drawingBufferHeight)*e._maxPixelSize;n.radius+=r}var D0t=[];Bd.prototype.update=function(e){if(QQ(this),!this.show)return;this._maxTotalPointSize=Ut.maximumAliasedPointSize,I0t(this,e);let n=this._pointPrimitives.length,i=this._pointPrimitivesToUpdate,r=this._pointPrimitivesToUpdateIndex,o=this._propertiesChanged,s=this._createVertexArray,a,c=e.context,u=e.passes,f=u.pick;if(s||!f&&this.computeNewBuffersUsage()){this._createVertexArray=!1;for(let v=0;v<ZQ;++v)o[v]=0;if(this._vaf=this._vaf&&this._vaf.destroy(),n>0){this._vaf=v0t(c,n,this._buffersUsage),a=this._vaf.writers;for(let v=0;v<n;++v){let S=this._pointPrimitives[v];S._dirty=!1,w0t(this,c,a,S)}this._vaf.commit()}this._pointPrimitivesToUpdateIndex=0}else if(r>0){let v=D0t;v.length=0,(o[JQ]||o[x0t]||o[T0t])&&v.push(MTe),(o[ITe]||o[b0t])&&v.push(NTe),(o[A0t]||o[DTe])&&v.push(LTe),o[PTe]&&v.push(FTe),(o[RTe]||o[E0t]||o[C0t])&&v.push(BTe);let S=v.length;if(a=this._vaf.writers,r/n>.1){for(let I=0;I<r;++I){let R=i[I];R._dirty=!1;for(let O=0;O<S;++O)v[O](this,c,a,R)}this._vaf.commit()}else{for(let I=0;I<r;++I){let R=i[I];R._dirty=!1;for(let O=0;O<S;++O)v[O](this,c,a,R);this._vaf.subCommit(R._index,1)}this._vaf.endSubCommits()}this._pointPrimitivesToUpdateIndex=0}if(r>n*1.5&&(i.length=n),!l(this._vaf)||!l(this._vaf.va))return;this._boundingVolumeDirty&&(this._boundingVolumeDirty=!1,ue.transform(this._baseVolume,this.modelMatrix,this._baseVolumeWC));let d,p=M.IDENTITY;e.mode===re.SCENE3D?(p=this.modelMatrix,d=ue.clone(this._baseVolumeWC,this._boundingVolume)):d=ue.clone(this._baseVolume2D,this._boundingVolume),P0t(this,e,d);let g=this._blendOption!==this.blendOption;this._blendOption=this.blendOption,g&&(this._blendOption===ki.OPAQUE||this._blendOption===ki.OPAQUE_AND_TRANSLUCENT?this._rsOpaque=Ge.fromCache({depthTest:{enabled:!0,func:te.LEQUAL},depthMask:!0}):this._rsOpaque=void 0,this._blendOption===ki.TRANSLUCENT||this._blendOption===ki.OPAQUE_AND_TRANSLUCENT?this._rsTranslucent=Ge.fromCache({depthTest:{enabled:!0,func:te.LEQUAL},depthMask:!1,blending:nn.ALPHA_BLEND}):this._rsTranslucent=void 0),this._shaderDisableDepthDistance=this._shaderDisableDepthDistance||e.minimumDisableDepthTestDistance!==0;let m,y;(g||this._shaderScaleByDistance&&!this._compiledShaderScaleByDistance||this._shaderTranslucencyByDistance&&!this._compiledShaderTranslucencyByDistance||this._shaderDistanceDisplayCondition&&!this._compiledShaderDistanceDisplayCondition||this._shaderDisableDepthDistance!==this._compiledShaderDisableDepthDistance)&&(m=new Xe({sources:[k2]}),this._shaderScaleByDistance&&m.defines.push("EYE_DISTANCE_SCALING"),this._shaderTranslucencyByDistance&&m.defines.push("EYE_DISTANCE_TRANSLUCENCY"),this._shaderDistanceDisplayCondition&&m.defines.push("DISTANCE_DISPLAY_CONDITION"),this._shaderDisableDepthDistance&&m.defines.push("DISABLE_DEPTH_DISTANCE"),this._blendOption===ki.OPAQUE_AND_TRANSLUCENT&&(y=new Xe({defines:["OPAQUE"],sources:[Rb]}),this._sp=Qt.replaceCache({context:c,shaderProgram:this._sp,vertexShaderSource:m,fragmentShaderSource:y,attributeLocations:ol}),y=new Xe({defines:["TRANSLUCENT"],sources:[Rb]}),this._spTranslucent=Qt.replaceCache({context:c,shaderProgram:this._spTranslucent,vertexShaderSource:m,fragmentShaderSource:y,attributeLocations:ol})),this._blendOption===ki.OPAQUE&&(y=new Xe({sources:[Rb]}),this._sp=Qt.replaceCache({context:c,shaderProgram:this._sp,vertexShaderSource:m,fragmentShaderSource:y,attributeLocations:ol})),this._blendOption===ki.TRANSLUCENT&&(y=new Xe({sources:[Rb]}),this._spTranslucent=Qt.replaceCache({context:c,shaderProgram:this._spTranslucent,vertexShaderSource:m,fragmentShaderSource:y,attributeLocations:ol})),this._compiledShaderScaleByDistance=this._shaderScaleByDistance,this._compiledShaderTranslucencyByDistance=this._shaderTranslucencyByDistance,this._compiledShaderDistanceDisplayCondition=this._shaderDistanceDisplayCondition,this._compiledShaderDisableDepthDistance=this._shaderDisableDepthDistance);let A,b,x,T,E=e.commandList;if(u.render||f){let v=this._colorCommands,S=this._blendOption===ki.OPAQUE,I=this._blendOption===ki.OPAQUE_AND_TRANSLUCENT;A=this._vaf.va,b=A.length,v.length=b;let R=I?b*2:b;for(T=0;T<R;++T){let O=S||I&&T%2===0;x=v[T],l(x)||(x=v[T]=new at),x.primitiveType=Oe.POINTS,x.pass=O||!I?Ie.OPAQUE:Ie.TRANSLUCENT,x.owner=this;let L=I?Math.floor(T/2):T;x.boundingVolume=d,x.modelMatrix=p,x.shaderProgram=O?this._sp:this._spTranslucent,x.uniformMap=this._uniforms,x.vertexArray=A[L].va,x.renderState=O?this._rsOpaque:this._rsTranslucent,x.debugShowBoundingVolume=this.debugShowBoundingVolume,x.pickId="v_pickColor",E.push(x)}}};Bd.prototype.isDestroyed=function(){return!1};Bd.prototype.destroy=function(){return this._sp=this._sp&&this._sp.destroy(),this._spTranslucent=this._spTranslucent&&this._spTranslucent.destroy(),this._spPick=this._spPick&&this._spPick.destroy(),this._vaf=this._vaf&&this._vaf.destroy(),OTe(this._pointPrimitives),le(this)};var X1=Bd;var kTe=[Int8Array,Uint8Array,Uint8ClampedArray,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array],eee=1,K1=8,ts=new Uint32Array(96),J1=class e{static from(t){if(!t||t.byteLength===void 0||t.buffer)throw new Error("Data must be an instance of ArrayBuffer or SharedArrayBuffer.");let[n,i]=new Uint8Array(t,0,2);if(n!==219)throw new Error("Data does not appear to be in a KDBush format.");let r=i>>4;if(r!==eee)throw new Error(`Got v${r} data when expected v${eee}.`);let o=kTe[i&15];if(!o)throw new Error("Unrecognized array type.");let[s]=new Uint16Array(t,2,1),[a]=new Uint32Array(t,4,1);return new e(a,s,o,void 0,t)}constructor(t,n=64,i=Float64Array,r=ArrayBuffer,o){if(isNaN(t)||t<0)throw new Error(`Unexpected numItems value: ${t}.`);this.numItems=+t,this.nodeSize=Math.min(Math.max(+n,2),65535),this.ArrayType=i,this.IndexArrayType=t<65536?Uint16Array:Uint32Array;let s=kTe.indexOf(this.ArrayType),a=t*2*this.ArrayType.BYTES_PER_ELEMENT,c=t*this.IndexArrayType.BYTES_PER_ELEMENT,u=(8-c%8)%8;if(s<0)throw new Error(`Unexpected typed array class: ${i}.`);if(o)this.data=o,this.ids=new this.IndexArrayType(o,K1,t),this.coords=new i(o,K1+c+u,t*2),this._pos=t*2,this._finished=!0;else{let f=this.data=new r(K1+a+c+u);this.ids=new this.IndexArrayType(f,K1,t),this.coords=new i(f,K1+c+u,t*2),this._pos=0,this._finished=!1,new Uint8Array(f,0,2).set([219,(eee<<4)+s]),new Uint16Array(f,2,1)[0]=n,new Uint32Array(f,4,1)[0]=t}}add(t,n){let i=this._pos>>1;return this.ids[i]=i,this.coords[this._pos++]=t,this.coords[this._pos++]=n,i}finish(){let t=this._pos>>1;if(t!==this.numItems)throw new Error(`Added ${t} items when expected ${this.numItems}.`);return nee(this.ids,this.coords,this.nodeSize,0,this.numItems-1,0),this._finished=!0,this}range(t,n,i,r){if(!this._finished)throw new Error("Data not yet indexed - call index.finish().");let{ids:o,coords:s,nodeSize:a}=this;ts[0]=0,ts[1]=o.length-1,ts[2]=0;let c=3,u=[];for(;c>0;){let f=ts[--c],d=ts[--c],p=ts[--c];if(d-p<=a){for(let A=p;A<=d;A++){let b=s[2*A],x=s[2*A+1];b>=t&&b<=i&&x>=n&&x<=r&&u.push(o[A])}continue}let g=p+d>>1,m=s[2*g],y=s[2*g+1];m>=t&&m<=i&&y>=n&&y<=r&&u.push(o[g]),(f===0?t<=m:n<=y)&&(ts[c++]=p,ts[c++]=g-1,ts[c++]=1-f),(f===0?i>=m:r>=y)&&(ts[c++]=g+1,ts[c++]=d,ts[c++]=1-f)}return u}within(t,n,i){let r=[];return this.withinInto(t,n,i,r),r}withinInto(t,n,i,r){if(!this._finished)throw new Error("Data not yet indexed - call index.finish().");let{ids:o,coords:s,nodeSize:a}=this;ts[0]=0,ts[1]=o.length-1,ts[2]=0;let c=3,u=0,f=i*i;for(;c>0;){let d=ts[--c],p=ts[--c],g=ts[--c];if(p-g<=a){for(let b=g;b<=p;b++)UTe(s[2*b],s[2*b+1],t,n)<=f&&(r[u++]=o[b]);continue}let m=g+p>>1,y=s[2*m],A=s[2*m+1];UTe(y,A,t,n)<=f&&(r[u++]=o[m]),(d===0?t-i<=y:n-i<=A)&&(ts[c++]=g,ts[c++]=m-1,ts[c++]=1-d),(d===0?t+i>=y:n+i>=A)&&(ts[c++]=m+1,ts[c++]=p,ts[c++]=1-d)}return u}};function nee(e,t,n,i,r,o){if(r-i<=n)return;let s=i+r>>1;zTe(e,t,s,i,r,o),nee(e,t,n,i,s-1,1-o),nee(e,t,n,s+1,r,1-o)}function zTe(e,t,n,i,r,o){for(;r>i;){if(r-i>600){let u=r-i+1,f=n-i+1,d=Math.log(u),p=.5*Math.exp(2*d/3),g=.5*Math.sqrt(d*p*(u-p)/u)*(f-u/2<0?-1:1),m=Math.max(i,Math.floor(n-f*p/u+g)),y=Math.min(r,Math.floor(n+(u-f)*p/u+g));zTe(e,t,n,m,y,o)}let s=t[2*n+o],a=i,c=r;for($1(e,t,i,n),t[2*r+o]>s&&$1(e,t,i,r);a<c;){for($1(e,t,a,c),a++,c--;t[2*a+o]<s;)a++;for(;t[2*c+o]>s;)c--}t[2*i+o]===s?$1(e,t,i,c):(c++,$1(e,t,c,r)),c<=n&&(i=c+1),n<=c&&(r=c-1)}}function $1(e,t,n,i){tee(e,n,i),tee(t,2*n,2*i),tee(t,2*n+1,2*i+1)}function tee(e,t,n){let i=e[t];e[t]=e[n],e[n]=i}function UTe(e,t,n,i){let r=e-n,o=t-i;return r*r+o*o}function Xh(e){e=e??H.EMPTY_OBJECT,this._enabled=e.enabled??!1,this._pixelRange=e.pixelRange??80,this._minimumClusterSize=e.minimumClusterSize??2,this._clusterBillboards=e.clusterBillboards??!0,this._clusterLabels=e.clusterLabels??!0,this._clusterPoints=e.clusterPoints??!0,this._labelCollection=void 0,this._billboardCollection=void 0,this._pointCollection=void 0,this._clusterBillboardCollection=void 0,this._clusterLabelCollection=void 0,this._clusterPointCollection=void 0,this._collectionIndicesByEntity={},this._unusedLabelIndices=[],this._unusedBillboardIndices=[],this._unusedPointIndices=[],this._previousClusters=[],this._previousHeight=void 0,this._enabledDirty=!1,this._clusterDirty=!1,this._cluster=void 0,this._removeEventListener=void 0,this._clusterEvent=new be,this.show=e.show??!0}function VTe(e,t){e.x-=t,e.y-=t,e.width+=t*2,e.height+=t*2}var R0t=new et;function jTe(e,t,n,i,r){if(l(e._labelCollection)&&i._clusterLabels?r=vx.getScreenSpaceBoundingBox(e,t,r):l(e._billboardCollection)&&i._clusterBillboards?r=Fr.getScreenSpaceBoundingBox(e,t,r):l(e._pointPrimitiveCollection)&&i._clusterPoints&&(r=za.getScreenSpaceBoundingBox(e,t,r)),VTe(r,n),i._clusterLabels&&!l(e._labelCollection)&&l(e.id)&>e(i,e.id.id)&&l(e.id._label)){let o=i._collectionIndicesByEntity[e.id.id].labelIndex,s=i._labelCollection.get(o),a=vx.getScreenSpaceBoundingBox(s,t,R0t);VTe(a,n),r=et.union(r,a,r)}return r}function O0t(e,t){if(e.clusterShow=!0,!l(e._labelCollection)&&l(e.id)&>e(t,e.id.id)&&l(e.id._label)){let n=t._collectionIndicesByEntity[e.id.id].labelIndex,i=t._labelCollection.get(n);i.clusterShow=!0}}function HTe(e,t,n,i){let r={billboard:i._clusterBillboardCollection.add(),label:i._clusterLabelCollection.add(),point:i._clusterPointCollection.add()};r.billboard.show=!1,r.point.show=!1,r.label.show=!0,r.label.text=t.toLocaleString(),r.label.id=n,r.billboard.position=r.label.position=r.point.position=e,i._clusterEvent.raiseEvent(n,r)}function GTe(e,t){return l(e)&&l(e._collectionIndicesByEntity[t])&&l(e._collectionIndicesByEntity[t].labelIndex)}function iee(e,t,n,i,r){if(!l(e))return;let o=e.length;for(let s=0;s<o;++s){let a=e.get(s);if(a.clusterShow=!1,!a.show||r._scene.mode===re.SCENE3D&&!i.isPointVisible(a.position))continue;let c=r._clusterLabels&&l(a._labelCollection),u=r._clusterBillboards&&l(a.id._billboard),f=r._clusterPoints&&l(a.id._point);if(c&&(f||u))continue;let d=a.computeScreenSpacePosition(n);l(d)&&t.push({index:s,collection:e,clustered:!1,coord:d})}}var M0t=new et,N0t=new et,L0t=new et;function F0t(e){return function(t){if(l(t)&&t<.05||!e.enabled)return;let n=e._scene,i=e._labelCollection,r=e._billboardCollection,o=e._pointCollection;if(!l(i)&&!l(r)&&!l(o)||!e._clusterBillboards&&!e._clusterLabels&&!e._clusterPoints)return;let s=e._clusterLabelCollection,a=e._clusterBillboardCollection,c=e._clusterPointCollection;l(s)?s.removeAll():s=e._clusterLabelCollection=new hg({scene:n}),l(a)?a.removeAll():a=e._clusterBillboardCollection=new wd({scene:n}),l(c)?c.removeAll():c=e._clusterPointCollection=new X1;let u=e._pixelRange,f=e._minimumClusterSize,d=e._previousClusters,p=[],g=e._previousHeight,m=n.camera.positionCartographic.height,y=n.ellipsoid,A=n.camera.positionWC,b=new Op(y,A),x=[];e._clusterLabels&&iee(i,x,n,b,e),e._clusterBillboards&&iee(r,x,n,b,e),e._clusterPoints&&iee(o,x,n,b,e);let T,E,v,S,I,R,O,L,_,C,w,D;if(x.length>0){let N=new J1(x.length,64,Float64Array);for(let F=0;F<x.length;++F)N.add(x[F].coord.x,x[F].coord.y);if(N.finish(),m<g)for(v=d.length,T=0;T<v;++T){let F=d[T];if(!b.isPointVisible(F.position))continue;let V=Fr._computeScreenSpacePosition(M.IDENTITY,F.position,h.ZERO,U.ZERO,n);if(!l(V))continue;let B=1-m/g,j=F.width=F.width*B,k=F.height=F.height*B;j=Math.max(j,F.minimumWidth),k=Math.max(k,F.minimumHeight);let G=V.x-j*.5,q=V.y-k*.5,Q=V.x+j,W=V.y+k;for(I=N.range(G,q,Q,W),R=I.length,C=0,_=[],E=0;E<R;++E)O=I[E],L=x[O],L.clustered||(++C,w=L.collection,D=L.index,_.push(w.get(D).id));if(C>=f)for(HTe(F.position,C,_,e),p.push(F),E=0;E<R;++E)x[I[E]].clustered=!0}for(v=x.length,T=0;T<v;++T){let F=x[T];if(F.clustered)continue;F.clustered=!0,w=F.collection,D=F.index;let V=w.get(D);S=jTe(V,F.coord,u,e,M0t);let B=et.clone(S,N0t);I=N.range(S.x,S.y,S.x+S.width,S.y+S.height),R=I.length;let j=h.clone(V.position);for(C=1,_=[V.id],E=0;E<R;++E)if(O=I[E],L=x[O],!L.clustered){let k=L.collection.get(L.index),G=jTe(k,L.coord,u,e,L0t);h.add(k.position,j,j),et.union(B,G,B),++C,_.push(k.id)}if(C>=f){let k=h.multiplyByScalar(j,1/C,j);for(HTe(k,C,_,e),p.push({position:k,width:B.width,height:B.height,minimumWidth:S.width,minimumHeight:S.height}),E=0;E<R;++E)x[I[E]].clustered=!0}else O0t(V,e)}}s.length===0&&(s.destroy(),e._clusterLabelCollection=void 0),a.length===0&&(a.destroy(),e._clusterBillboardCollection=void 0),c.length===0&&(c.destroy(),e._clusterPointCollection=void 0),e._previousClusters=p,e._previousHeight=m}}Xh.prototype._initialize=function(e){this._scene=e;let t=F0t(this);this._cluster=t,this._removeEventListener=e.camera.changed.addEventListener(t)};Object.defineProperties(Xh.prototype,{enabled:{get:function(){return this._enabled},set:function(e){this._enabledDirty=e!==this._enabled,this._enabled=e}},pixelRange:{get:function(){return this._pixelRange},set:function(e){this._clusterDirty=this._clusterDirty||e!==this._pixelRange,this._pixelRange=e}},minimumClusterSize:{get:function(){return this._minimumClusterSize},set:function(e){this._clusterDirty=this._clusterDirty||e!==this._minimumClusterSize,this._minimumClusterSize=e}},clusterEvent:{get:function(){return this._clusterEvent}},clusterBillboards:{get:function(){return this._clusterBillboards},set:function(e){this._clusterDirty=this._clusterDirty||e!==this._clusterBillboards,this._clusterBillboards=e}},clusterLabels:{get:function(){return this._clusterLabels},set:function(e){this._clusterDirty=this._clusterDirty||e!==this._clusterLabels,this._clusterLabels=e}},clusterPoints:{get:function(){return this._clusterPoints},set:function(e){this._clusterDirty=this._clusterDirty||e!==this._clusterPoints,this._clusterPoints=e}},ready:{get:function(){return!this._enabledDirty&&!this._clusterDirty&&(!l(this._billboardCollection)||this._billboardCollection.ready)&&(!l(this._labelCollection)||this._labelCollection.ready)}}});function oee(e,t,n,i){return function(r){let o=this[e];l(this._collectionIndicesByEntity)||(this._collectionIndicesByEntity={});let s=this._collectionIndicesByEntity[r.id];if(l(s)||(s=this._collectionIndicesByEntity[r.id]={billboardIndex:void 0,labelIndex:void 0,pointIndex:void 0}),l(o)&&l(s[i]))return o.get(s[i]);l(o)||(o=this[e]=new t({scene:this._scene}));let a,c,u=this[n];u.length>0?(a=u.shift(),c=o.get(a)):(c=o.add(),a=o.length-1),s[i]=a;let f=this;return Promise.resolve().then(function(){f._clusterDirty=!0}),c}}function see(e,t){let n=e._collectionIndicesByEntity[t];!l(n.billboardIndex)&&!l(n.labelIndex)&&!l(n.pointIndex)&&delete e._collectionIndicesByEntity[t]}Xh.prototype.getLabel=oee("_labelCollection",hg,"_unusedLabelIndices","labelIndex");Xh.prototype.removeLabel=function(e){let t=this._collectionIndicesByEntity&&this._collectionIndicesByEntity[e.id];if(!l(this._labelCollection)||!l(t)||!l(t.labelIndex))return;let n=t.labelIndex;t.labelIndex=void 0,see(this,e.id);let i=this._labelCollection.get(n);i.show=!1,i.text="",i.id=void 0,this._unusedLabelIndices.push(n),this._clusterDirty=!0};Xh.prototype.getBillboard=oee("_billboardCollection",wd,"_unusedBillboardIndices","billboardIndex");Xh.prototype.removeBillboard=function(e){let t=this._collectionIndicesByEntity&&this._collectionIndicesByEntity[e.id];if(!l(this._billboardCollection)||!l(t)||!l(t.billboardIndex))return;let n=t.billboardIndex;t.billboardIndex=void 0,see(this,e.id);let i=this._billboardCollection.get(n);i.id=void 0,i.show=!1,i.image=void 0,this._unusedBillboardIndices.push(n),this._clusterDirty=!0};Xh.prototype.getPoint=oee("_pointCollection",X1,"_unusedPointIndices","pointIndex");Xh.prototype.removePoint=function(e){let t=this._collectionIndicesByEntity&&this._collectionIndicesByEntity[e.id];if(!l(this._pointCollection)||!l(t)||!l(t.pointIndex))return;let n=t.pointIndex;t.pointIndex=void 0,see(this,e.id);let i=this._pointCollection.get(n);i.show=!1,i.id=void 0,this._unusedPointIndices.push(n),this._clusterDirty=!0};function ree(e){if(!l(e))return;let t=e.length;for(let n=0;n<t;++n)e.get(n).clusterShow=!0}function B0t(e){e.enabled||(l(e._clusterLabelCollection)&&e._clusterLabelCollection.destroy(),l(e._clusterBillboardCollection)&&e._clusterBillboardCollection.destroy(),l(e._clusterPointCollection)&&e._clusterPointCollection.destroy(),e._clusterLabelCollection=void 0,e._clusterBillboardCollection=void 0,e._clusterPointCollection=void 0,ree(e._labelCollection),ree(e._billboardCollection),ree(e._pointCollection))}Xh.prototype.update=function(e){if(!this.show)return;let t,n=this._labelCollection;l(n)&&n.length>0&&!n.ready&&(t=e.commandList,e.commandList=[],n.update(e),e.commandList=t);let i=this._billboardCollection;l(i)&&i.length>0&&!i.ready&&(t=e.commandList,e.commandList=[],i.update(e),e.commandList=t),this._enabledDirty&&(this._enabledDirty=!1,B0t(this),this._clusterDirty=!0),this._clusterDirty&&(this._cluster(),this._clusterDirty=l(n)&&!n.ready||l(i)&&!i.ready),l(this._clusterLabelCollection)&&this._clusterLabelCollection.update(e),l(this._clusterBillboardCollection)&&this._clusterBillboardCollection.update(e),l(this._clusterPointCollection)&&this._clusterPointCollection.update(e),l(n)&&n.update(e),l(i)&&i.update(e),l(this._pointCollection)&&this._pointCollection.update(e)};Xh.prototype.destroy=function(){l(this._removeEventListener)&&(this._removeEventListener(),this._removeEventListener=void 0),this._labelCollection=this._labelCollection&&this._labelCollection.destroy(),this._billboardCollection=this._billboardCollection&&this._billboardCollection.destroy(),this._pointCollection=this._pointCollection&&this._pointCollection.destroy(),this._clusterLabelCollection=this._clusterLabelCollection&&this._clusterLabelCollection.destroy(),this._clusterBillboardCollection=this._clusterBillboardCollection&&this._clusterBillboardCollection.destroy(),this._clusterPointCollection=this._clusterPointCollection&&this._clusterPointCollection.destroy(),this._labelCollection=void 0,this._billboardCollection=void 0,this._pointCollection=void 0,this._clusterBillboardCollection=void 0,this._clusterLabelCollection=void 0,this._clusterPointCollection=void 0,this._collectionIndicesByEntity=void 0,this._unusedLabelIndices=[],this._unusedBillboardIndices=[],this._unusedPointIndices=[],this._previousClusters=[],this._previousHeight=void 0,this._enabledDirty=!1,this._pixelRangeDirty=!1,this._minimumClusterSizeDirty=!1};var kd=Xh;function aee(e){this._name=e,this._clock=void 0,this._changed=new be,this._error=new be,this._isLoading=!1,this._loading=new be,this._entityCollection=new rc(this),this._entityCluster=new kd}Object.defineProperties(aee.prototype,{name:{get:function(){return this._name},set:function(e){this._name!==e&&(this._name=e,this._changed.raiseEvent(this))}},clock:{get:function(){return this._clock},set:function(e){this._clock!==e&&(this._clock=e,this._changed.raiseEvent(this))}},entities:{get:function(){return this._entityCollection}},isLoading:{get:function(){return this._isLoading},set:function(e){Fs.setLoading(this,e)}},changedEvent:{get:function(){return this._changed}},errorEvent:{get:function(){return this._error}},loadingEvent:{get:function(){return this._loading}},show:{get:function(){return this._entityCollection.show},set:function(e){this._entityCollection.show=e}},clustering:{get:function(){return this._entityCluster},set:function(e){this._entityCluster=e}}});aee.prototype.update=function(e){return!0};var g8=aee;var WTe={};WTe.computePositions=function(e,t,n,i,r){let o=e*.5,s=-o,a=i+i,c=r?2*a:a,u=new Float64Array(c*3),f,d=0,p=0,g=r?a*3:0,m=r?(a+i)*3:i*3;for(f=0;f<i;f++){let y=f/i*P.TWO_PI,A=Math.cos(y),b=Math.sin(y),x=A*n,T=b*n,E=A*t,v=b*t;u[p+g]=x,u[p+g+1]=T,u[p+g+2]=s,u[p+m]=E,u[p+m+1]=v,u[p+m+2]=o,p+=3,r&&(u[d++]=x,u[d++]=T,u[d++]=s,u[d++]=E,u[d++]=v,u[d++]=o)}return u};var cS=WTe;var cee=new U,k0t=new h,U0t=new h,z0t=new h,V0t=new h;function Rg(e){e=e??H.EMPTY_OBJECT;let t=e.length,n=e.topRadius,i=e.bottomRadius,r=e.vertexFormat??Be.DEFAULT,o=e.slices??128;this._length=t,this._topRadius=n,this._bottomRadius=i,this._vertexFormat=Be.clone(r),this._slices=o,this._offsetAttribute=e.offsetAttribute,this._workerName="createCylinderGeometry"}Rg.packedLength=Be.packedLength+5;Rg.pack=function(e,t,n){return n=n??0,Be.pack(e._vertexFormat,t,n),n+=Be.packedLength,t[n++]=e._length,t[n++]=e._topRadius,t[n++]=e._bottomRadius,t[n++]=e._slices,t[n]=e._offsetAttribute??-1,t};var qTe=new Be,lS={vertexFormat:qTe,length:void 0,topRadius:void 0,bottomRadius:void 0,slices:void 0,offsetAttribute:void 0};Rg.unpack=function(e,t,n){t=t??0;let i=Be.unpack(e,t,qTe);t+=Be.packedLength;let r=e[t++],o=e[t++],s=e[t++],a=e[t++],c=e[t];return l(n)?(n._vertexFormat=Be.clone(i,n._vertexFormat),n._length=r,n._topRadius=o,n._bottomRadius=s,n._slices=a,n._offsetAttribute=c===-1?void 0:c,n):(lS.length=r,lS.topRadius=o,lS.bottomRadius=s,lS.slices=a,lS.offsetAttribute=c===-1?void 0:c,new Rg(lS))};Rg.createGeometry=function(e){let t=e._length,n=e._topRadius,i=e._bottomRadius,r=e._vertexFormat,o=e._slices;if(t<=0||n<0||i<0||n===0&&i===0)return;let s=o+o,a=o+s,c=s+s,u=cS.computePositions(t,n,i,o,!0),f=r.st?new Float32Array(c*2):void 0,d=r.normal?new Float32Array(c*3):void 0,p=r.tangent?new Float32Array(c*3):void 0,g=r.bitangent?new Float32Array(c*3):void 0,m,y=r.normal||r.tangent||r.bitangent;if(y){let I=r.tangent||r.bitangent,R=0,O=0,L=0,_=Math.atan2(i-n,t),C=k0t;C.z=Math.sin(_);let w=Math.cos(_),D=z0t,N=U0t;for(m=0;m<o;m++){let F=m/o*P.TWO_PI,V=w*Math.cos(F),B=w*Math.sin(F);y&&(C.x=V,C.y=B,I&&(D=h.normalize(h.cross(h.UNIT_Z,C,D),D)),r.normal&&(d[R++]=C.x,d[R++]=C.y,d[R++]=C.z,d[R++]=C.x,d[R++]=C.y,d[R++]=C.z),r.tangent&&(p[O++]=D.x,p[O++]=D.y,p[O++]=D.z,p[O++]=D.x,p[O++]=D.y,p[O++]=D.z),r.bitangent&&(N=h.normalize(h.cross(C,D,N),N),g[L++]=N.x,g[L++]=N.y,g[L++]=N.z,g[L++]=N.x,g[L++]=N.y,g[L++]=N.z))}for(m=0;m<o;m++)r.normal&&(d[R++]=0,d[R++]=0,d[R++]=-1),r.tangent&&(p[O++]=1,p[O++]=0,p[O++]=0),r.bitangent&&(g[L++]=0,g[L++]=-1,g[L++]=0);for(m=0;m<o;m++)r.normal&&(d[R++]=0,d[R++]=0,d[R++]=1),r.tangent&&(p[O++]=1,p[O++]=0,p[O++]=0),r.bitangent&&(g[L++]=0,g[L++]=1,g[L++]=0)}let A=12*o-12,b=je.createTypedArray(c,A),x=0,T=0;for(m=0;m<o-1;m++)b[x++]=T,b[x++]=T+2,b[x++]=T+3,b[x++]=T,b[x++]=T+3,b[x++]=T+1,T+=2;for(b[x++]=s-2,b[x++]=0,b[x++]=1,b[x++]=s-2,b[x++]=1,b[x++]=s-1,m=1;m<o-1;m++)b[x++]=s+m+1,b[x++]=s+m,b[x++]=s;for(m=1;m<o-1;m++)b[x++]=a,b[x++]=a+m,b[x++]=a+m+1;let E=0;if(r.st){let I=Math.max(n,i);for(m=0;m<c;m++){let R=h.fromArray(u,m*3,V0t);f[E++]=(R.x+I)/(2*I),f[E++]=(R.y+I)/(2*I)}}let v=new En;r.position&&(v.position=new Ne({componentDatatype:Y.DOUBLE,componentsPerAttribute:3,values:u})),r.normal&&(v.normal=new Ne({componentDatatype:Y.FLOAT,componentsPerAttribute:3,values:d})),r.tangent&&(v.tangent=new Ne({componentDatatype:Y.FLOAT,componentsPerAttribute:3,values:p})),r.bitangent&&(v.bitangent=new Ne({componentDatatype:Y.FLOAT,componentsPerAttribute:3,values:g})),r.st&&(v.st=new Ne({componentDatatype:Y.FLOAT,componentsPerAttribute:2,values:f})),cee.x=t*.5,cee.y=Math.max(i,n);let S=new ue(h.ZERO,U.magnitude(cee));if(l(e._offsetAttribute)){t=u.length;let I=e._offsetAttribute===pn.NONE?0:1,R=new Uint8Array(t/3).fill(I);v.applyOffset=new Ne({componentDatatype:Y.UNSIGNED_BYTE,componentsPerAttribute:1,values:R})}return new wt({attributes:v,indices:b,primitiveType:Oe.TRIANGLES,boundingSphere:S,offsetAttribute:e._offsetAttribute})};var lee;Rg.getUnitCylinder=function(){return l(lee)||(lee=Rg.createGeometry(new Rg({topRadius:1,bottomRadius:1,length:1,vertexFormat:Be.POSITION_ONLY}))),lee};var _8=Rg;var uee=new U;function uS(e){e=e??H.EMPTY_OBJECT;let t=e.length,n=e.topRadius,i=e.bottomRadius,r=e.slices??128,o=Math.max(e.numberOfVerticalLines??16,0);this._length=t,this._topRadius=n,this._bottomRadius=i,this._slices=r,this._numberOfVerticalLines=o,this._offsetAttribute=e.offsetAttribute,this._workerName="createCylinderOutlineGeometry"}uS.packedLength=6;uS.pack=function(e,t,n){return n=n??0,t[n++]=e._length,t[n++]=e._topRadius,t[n++]=e._bottomRadius,t[n++]=e._slices,t[n++]=e._numberOfVerticalLines,t[n]=e._offsetAttribute??-1,t};var Vx={length:void 0,topRadius:void 0,bottomRadius:void 0,slices:void 0,numberOfVerticalLines:void 0,offsetAttribute:void 0};uS.unpack=function(e,t,n){t=t??0;let i=e[t++],r=e[t++],o=e[t++],s=e[t++],a=e[t++],c=e[t];return l(n)?(n._length=i,n._topRadius=r,n._bottomRadius=o,n._slices=s,n._numberOfVerticalLines=a,n._offsetAttribute=c===-1?void 0:c,n):(Vx.length=i,Vx.topRadius=r,Vx.bottomRadius=o,Vx.slices=s,Vx.numberOfVerticalLines=a,Vx.offsetAttribute=c===-1?void 0:c,new uS(Vx))};uS.createGeometry=function(e){let t=e._length,n=e._topRadius,i=e._bottomRadius,r=e._slices,o=e._numberOfVerticalLines;if(t<=0||n<0||i<0||n===0&&i===0)return;let s=r*2,a=cS.computePositions(t,n,i,r,!1),c=r*2,u;if(o>0){let y=Math.min(o,r);u=Math.round(r/y),c+=y}let f=je.createTypedArray(s,c*2),d=0,p;for(p=0;p<r-1;p++)f[d++]=p,f[d++]=p+1,f[d++]=p+r,f[d++]=p+1+r;if(f[d++]=r-1,f[d++]=0,f[d++]=r+r-1,f[d++]=r,o>0)for(p=0;p<r;p+=u)f[d++]=p,f[d++]=p+r;let g=new En;g.position=new Ne({componentDatatype:Y.DOUBLE,componentsPerAttribute:3,values:a}),uee.x=t*.5,uee.y=Math.max(i,n);let m=new ue(h.ZERO,U.magnitude(uee));if(l(e._offsetAttribute)){t=a.length;let y=e._offsetAttribute===pn.NONE?0:1,A=new Uint8Array(t/3).fill(y);g.applyOffset=new Ne({componentDatatype:Y.UNSIGNED_BYTE,componentsPerAttribute:1,values:A})}return new wt({attributes:g,indices:f,primitiveType:Oe.LINES,boundingSphere:m,offsetAttribute:e._offsetAttribute})};var y8=uS;var YTe=h.ZERO,XTe=new h,j0t=new h,KTe=new z;function H0t(e){this.id=e,this.vertexFormat=void 0,this.length=void 0,this.topRadius=void 0,this.bottomRadius=void 0,this.slices=void 0,this.numberOfVerticalLines=void 0,this.offsetAttribute=void 0}function Ef(e,t){Oi.call(this,{entity:e,scene:t,geometryOptions:new H0t(e),geometryPropertyName:"cylinder",observedPropertyNames:["availability","position","orientation","cylinder"]}),this._onEntityPropertyChanged(e,"cylinder",e.cylinder,void 0)}l(Object.create)&&(Ef.prototype=Object.create(Oi.prototype),Ef.prototype.constructor=Ef);Object.defineProperties(Ef.prototype,{terrainOffsetProperty:{get:function(){return this._terrainOffsetProperty}}});Ef.prototype.createFillGeometryInstance=function(e){let t=this._entity,n=t.isAvailable(e),i=new Pn(n&&t.isShowing&&this._showProperty.getValue(e)&&this._fillProperty.getValue(e)),r=this._distanceDisplayConditionProperty.getValue(e),o=Qn.fromDistanceDisplayCondition(r),s={show:i,distanceDisplayCondition:o,color:void 0,offset:void 0};if(this._materialProperty instanceof Kt){let a;l(this._materialProperty.color)&&(this._materialProperty.color.isConstant||n)&&(a=this._materialProperty.color.getValue(e,KTe)),l(a)||(a=z.WHITE),s.color=Jt.fromColor(a)}return l(this._options.offsetAttribute)&&(s.offset=Er.fromCartesian3(X.getValueOrDefault(this._terrainOffsetProperty,e,YTe,XTe))),new Bt({id:t,geometry:new _8(this._options),modelMatrix:t.computeModelMatrixForHeightReference(e,t.cylinder.heightReference,this._options.length*.5,this._scene.ellipsoid),attributes:s})};Ef.prototype.createOutlineGeometryInstance=function(e){let t=this._entity,n=t.isAvailable(e),i=X.getValueOrDefault(this._outlineColorProperty,e,z.BLACK,KTe),r=this._distanceDisplayConditionProperty.getValue(e),o={show:new Pn(n&&t.isShowing&&this._showProperty.getValue(e)&&this._showOutlineProperty.getValue(e)),color:Jt.fromColor(i),distanceDisplayCondition:Qn.fromDistanceDisplayCondition(r),offset:void 0};return l(this._options.offsetAttribute)&&(o.offset=Er.fromCartesian3(X.getValueOrDefault(this._terrainOffsetProperty,e,YTe,XTe))),new Bt({id:t,geometry:new y8(this._options),modelMatrix:t.computeModelMatrixForHeightReference(e,t.cylinder.heightReference,this._options.length*.5,this._scene.ellipsoid),attributes:o})};Ef.prototype._computeCenter=function(e,t){return X.getValueOrUndefined(this._entity.position,e,t)};Ef.prototype._isHidden=function(e,t){return!l(e.position)||!l(t.length)||!l(t.topRadius)||!l(t.bottomRadius)||Oi.prototype._isHidden.call(this,e,t)};Ef.prototype._isDynamic=function(e,t){return!e.position.isConstant||!X.isConstant(e.orientation)||!t.length.isConstant||!t.topRadius.isConstant||!t.bottomRadius.isConstant||!X.isConstant(t.slices)||!X.isConstant(t.outlineWidth)||!X.isConstant(t.numberOfVerticalLines)};Ef.prototype._setStaticOptions=function(e,t){let n=X.getValueOrDefault(t.heightReference,nt.MINIMUM_VALUE,We.NONE),i=this._options;i.vertexFormat=this._materialProperty instanceof Kt?An.VERTEX_FORMAT:Cr.MaterialSupport.TEXTURED.vertexFormat,i.length=t.length.getValue(nt.MINIMUM_VALUE),i.topRadius=t.topRadius.getValue(nt.MINIMUM_VALUE),i.bottomRadius=t.bottomRadius.getValue(nt.MINIMUM_VALUE),i.slices=X.getValueOrUndefined(t.slices,nt.MINIMUM_VALUE),i.numberOfVerticalLines=X.getValueOrUndefined(t.numberOfVerticalLines,nt.MINIMUM_VALUE),i.offsetAttribute=n!==We.NONE?pn.ALL:void 0};Ef.prototype._onEntityPropertyChanged=Z_;Ef.DynamicGeometryUpdater=fS;function fS(e,t,n){Ri.call(this,e,t,n)}l(Object.create)&&(fS.prototype=Object.create(Ri.prototype),fS.prototype.constructor=fS);fS.prototype._isHidden=function(e,t,n){let i=this._options,r=X.getValueOrUndefined(e.position,n,j0t);return!l(r)||!l(i.length)||!l(i.topRadius)||!l(i.bottomRadius)||Ri.prototype._isHidden.call(this,e,t,n)};fS.prototype._setOptions=function(e,t,n){let i=X.getValueOrDefault(t.heightReference,n,We.NONE),r=this._options;r.length=X.getValueOrUndefined(t.length,n),r.topRadius=X.getValueOrUndefined(t.topRadius,n),r.bottomRadius=X.getValueOrUndefined(t.bottomRadius,n),r.slices=X.getValueOrUndefined(t.slices,n),r.numberOfVerticalLines=X.getValueOrUndefined(t.numberOfVerticalLines,n),r.offsetAttribute=i!==We.NONE?pn.ALL:void 0};var A8=Ef;var $Te={UNBOUNDED:0,CLAMPED:1,LOOP_STOP:2};Object.freeze($Te);var Bs=$Te;var JTe={TICK_DEPENDENT:0,SYSTEM_CLOCK_MULTIPLIER:1,SYSTEM_CLOCK:2};Object.freeze(JTe);var Hr=JTe;var ZTe={NONE:0,HOLD:1,EXTRAPOLATE:2,LINEAR_EXTRAPOLATE:3};Object.freeze(ZTe);var Lu=ZTe;var QTe=js(ef(),1);function G0t(e){let t=new QTe.default(e);t.normalize();let n=t.path(),i=n.lastIndexOf("/");return i!==-1&&(n=n.substr(i+1)),n}var nA=G0t;var W0t=P.factorial;function fee(e,t,n,i,r,o){let s=0,a,c,u;if(i>0){for(c=0;c<r;c++){for(a=!1,u=0;u<o.length&&!a;u++)c===o[u]&&(a=!0);a||(o.push(c),s+=fee(e,t,n,i-1,r,o),o.splice(o.length-1,1))}return s}for(s=1,c=0;c<r;c++){for(a=!1,u=0;u<o.length&&!a;u++)c===o[u]&&(a=!0);a||(s*=e-n[t[c]])}return s}var q0t=[],dee=class{static get type(){return"Hermite"}static getRequiredDataPoints(t,n){return n=n??0,Math.max(Math.floor((t+1)/(n+1)),2)}static interpolateOrderZero(t,n,i,r,o){l(o)||(o=new Array(r));let s,a,c,u,f,d,p=n.length,g=new Array(r);for(s=0;s<r;s++){o[s]=0;let b=new Array(p);for(g[s]=b,a=0;a<p;a++)b[a]=[]}let m=p,y=new Array(m);for(s=0;s<m;s++)y[s]=s;let A=p-1;for(u=0;u<r;u++){for(a=0;a<m;a++)d=y[a]*r+u,g[u][0].push(i[d]);for(s=1;s<m;s++){let b=!1;for(a=0;a<m-s;a++){let x=n[y[a]],T=n[y[a+s]],E;T-x<=0?(d=y[a]*r+r*s+u,E=i[d],g[u][s].push(E/W0t(s))):(E=g[u][s-1][a+1]-g[u][s-1][a],g[u][s].push(E/(T-x))),b=b||E!==0}b||(A=s-1)}}for(c=0,f=0;c<=f;c++)for(s=c;s<=A;s++){let b=fee(t,y,n,c,s,[]);for(u=0;u<r;u++){let x=g[u][s][0];o[u+c*r]+=x*b}}return o}static interpolate(t,n,i,r,o,s,a){let c=r*(s+1);l(a)||(a=new Array(c));for(let x=0;x<c;x++)a[x]=0;let u=n.length,f=new Array(u*(o+1)),d;for(d=0;d<u;d++)for(let x=0;x<o+1;x++)f[d*(o+1)+x]=d;let p=f.length,g=q0t,m=Y0t(g,f,n,i,r,o),y=[],A=p*(p+1)/2,b=Math.min(m,s);for(let x=0;x<=b;x++)for(d=x;d<=m;d++){y.length=0;let T=fee(t,f,n,x,d,y),E=Math.floor(d*(1-d)/2)+p*d;for(let v=0;v<r;v++){let S=Math.floor(v*A),I=g[S+E];a[v+x*r]+=I*T}}return a}};function Y0t(e,t,n,i,r,o){let s,a,c=-1,u=t.length,f=u*(u+1)/2;for(let d=0;d<r;d++){let p=Math.floor(d*f);for(s=0;s<u;s++)a=t[s]*r*(o+1)+d,e[p+s]=i[a];for(let g=1;g<u;g++){let m=0,y=Math.floor(g*(1-g)/2)+u*g,A=!1;for(s=0;s<u-g;s++){let b=n[t[s]],x=n[t[s+g]],T,E;if(x-b<=0)a=t[s]*r*(o+1)+r*g+d,T=i[a],E=T/P.factorial(g),e[p+y+m]=E,m++;else{let v=Math.floor((g-1)*(2-g)/2)+u*(g-1);T=e[p+v+s+1]-e[p+v+s],E=T/(x-b),e[p+y+m]=E,m++}A=A||T!==0}A&&(c=Math.max(c,g))}}return c}var b8=dee;var hee=class{static get type(){return"Lagrange"}static getRequiredDataPoints(t){return Math.max(t+1,2)}static interpolateOrderZero(t,n,i,r,o){l(o)||(o=new Array(r));let s,a,c=n.length;for(s=0;s<r;s++)o[s]=0;for(s=0;s<c;s++){let u=1;for(a=0;a<c;a++)if(a!==s){let f=n[s]-n[a];u*=(t-n[a])/f}for(a=0;a<r;a++)o[a]+=u*i[s*r+a]}return o}},x8=hee;var mee=class{static get type(){return"Linear"}static getRequiredDataPoints(t){return 2}static interpolateOrderZero(t,n,i,r,o){l(o)||(o=new Array(r));let s,a,c,u=n[0],f=n[1];for(s=0;s<r;s++)a=i[s],c=i[s+r],o[s]=((c-a)*t+f*a-u*c)/(f-u);return o}},jx=mee;function sl(e,t,n){this.clock=e??0,this.cone=t??0,this.magnitude=n??1}sl.fromCartesian3=function(e,t){let n=e.x,i=e.y,r=e.z,o=n*n+i*i;return l(t)||(t=new sl),t.clock=Math.atan2(i,n),t.cone=Math.atan2(Math.sqrt(o),r),t.magnitude=Math.sqrt(o+r*r),t};sl.clone=function(e,t){if(l(e))return l(t)?(t.clock=e.clock,t.cone=e.cone,t.magnitude=e.magnitude,t):new sl(e.clock,e.cone,e.magnitude)};sl.normalize=function(e,t){return l(t)?(t.clock=e.clock,t.cone=e.cone,t.magnitude=1,t):new sl(e.clock,e.cone,1)};sl.equals=function(e,t){return e===t||l(e)&&l(t)&&e.clock===t.clock&&e.cone===t.cone&&e.magnitude===t.magnitude};sl.equalsEpsilon=function(e,t,n){return n=n??0,e===t||l(e)&&l(t)&&Math.abs(e.clock-t.clock)<=n&&Math.abs(e.cone-t.cone)<=n&&Math.abs(e.magnitude-t.magnitude)<=n};sl.prototype.equals=function(e){return sl.equals(this,e)};sl.prototype.clone=function(e){return sl.clone(this,e)};sl.prototype.equalsEpsilon=function(e,t){return sl.equalsEpsilon(this,e,t)};sl.prototype.toString=function(){return`(${this.clock}, ${this.cone}, ${this.magnitude})`};var T8=sl;var cR=js(ef(),1);var pee;typeof performance<"u"&&typeof performance.now=="function"&&isFinite(performance.now())?pee=function(){return performance.now()}:pee=function(){return Date.now()};var xn=pee;function gee(e){e=e??H.EMPTY_OBJECT;let t=e.currentTime,n=e.startTime,i=e.stopTime;l(t)?t=K.clone(t):l(n)?t=K.clone(n):l(i)?t=K.addDays(i,-1,new K):t=K.now(),l(n)?n=K.clone(n):n=K.clone(t),l(i)?i=K.clone(i):i=K.addDays(n,1,new K),this.startTime=n,this.stopTime=i,this.clockRange=e.clockRange??Bs.UNBOUNDED,this.canAnimate=e.canAnimate??!0,this.onTick=new be,this.onStop=new be,this._currentTime=void 0,this._multiplier=void 0,this._clockStep=void 0,this._shouldAnimate=void 0,this._lastSystemTime=xn(),this.currentTime=t,this.multiplier=e.multiplier??1,this.shouldAnimate=e.shouldAnimate??!1,this.clockStep=e.clockStep??Hr.SYSTEM_CLOCK_MULTIPLIER}Object.defineProperties(gee.prototype,{currentTime:{get:function(){return this._currentTime},set:function(e){K.equals(this._currentTime,e)||(this._clockStep===Hr.SYSTEM_CLOCK&&(this._clockStep=Hr.SYSTEM_CLOCK_MULTIPLIER),this._currentTime=e)}},multiplier:{get:function(){return this._multiplier},set:function(e){this._multiplier!==e&&(this._clockStep===Hr.SYSTEM_CLOCK&&(this._clockStep=Hr.SYSTEM_CLOCK_MULTIPLIER),this._multiplier=e)}},clockStep:{get:function(){return this._clockStep},set:function(e){e===Hr.SYSTEM_CLOCK&&(this._multiplier=1,this._shouldAnimate=!0,this._currentTime=K.now()),this._clockStep=e}},shouldAnimate:{get:function(){return this._shouldAnimate},set:function(e){this._shouldAnimate!==e&&(this._clockStep===Hr.SYSTEM_CLOCK&&(this._clockStep=Hr.SYSTEM_CLOCK_MULTIPLIER),this._shouldAnimate=e)}}});gee.prototype.tick=function(){let e=xn(),t=K.clone(this._currentTime);if(this.canAnimate&&this._shouldAnimate){let n=this._clockStep;if(n===Hr.SYSTEM_CLOCK)t=K.now(t);else{let i=this._multiplier;if(n===Hr.TICK_DEPENDENT)t=K.addSeconds(t,i,t);else{let a=e-this._lastSystemTime;t=K.addSeconds(t,i*(a/1e3),t)}let r=this.clockRange,o=this.startTime,s=this.stopTime;if(r===Bs.CLAMPED)K.lessThan(t,o)?t=K.clone(o,t):K.greaterThan(t,s)&&(t=K.clone(s,t),this.onStop.raiseEvent(this));else if(r===Bs.LOOP_STOP)for(K.lessThan(t,o)&&(t=K.clone(o,t));K.greaterThan(t,s);)t=K.addSeconds(o,K.secondsDifference(t,s),t),this.onStop.raiseEvent(this)}}return this._currentTime=t,this._lastSystemTime=e,this.onTick.raiseEvent(this),t};var Mp=gee;function Hx(){this._definitionChanged=new be,this._startTime=void 0,this._stopTime=void 0,this._currentTime=void 0,this._clockRange=void 0,this._clockStep=void 0,this._multiplier=void 0}Object.defineProperties(Hx.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},startTime:_u("startTime"),stopTime:_u("stopTime"),currentTime:_u("currentTime"),clockRange:_u("clockRange"),clockStep:_u("clockStep"),multiplier:_u("multiplier")});Hx.prototype.clone=function(e){return l(e)||(e=new Hx),e.startTime=this.startTime,e.stopTime=this.stopTime,e.currentTime=this.currentTime,e.clockRange=this.clockRange,e.clockStep=this.clockStep,e.multiplier=this.multiplier,e};Hx.prototype.equals=function(e){return this===e||l(e)&&K.equals(this.startTime,e.startTime)&&K.equals(this.stopTime,e.stopTime)&&K.equals(this.currentTime,e.currentTime)&&this.clockRange===e.clockRange&&this.clockStep===e.clockStep&&this.multiplier===e.multiplier};Hx.prototype.merge=function(e){this.startTime=this.startTime??e.startTime,this.stopTime=this.stopTime??e.stopTime,this.currentTime=this.currentTime??e.currentTime,this.clockRange=this.clockRange??e.clockRange,this.clockStep=this.clockStep??e.clockStep,this.multiplier=this.multiplier??e.multiplier};Hx.prototype.getValue=function(e){return l(e)||(e=new Mp),e.startTime=this.startTime??e.startTime,e.stopTime=this.stopTime??e.stopTime,e.currentTime=this.currentTime??e.currentTime,e.clockRange=this.clockRange??e.clockRange,e.multiplier=this.multiplier??e.multiplier,e.clockStep=this.clockStep??e.clockStep,e};var Np=Hx;var X0t=z.WHITE,K0t=.1,$0t=new U(8,8),J0t=new U(0,0),Z0t=new U(1,1);function dS(e){e=e??H.EMPTY_OBJECT,this._definitionChanged=new be,this._color=void 0,this._colorSubscription=void 0,this._cellAlpha=void 0,this._cellAlphaSubscription=void 0,this._lineCount=void 0,this._lineCountSubscription=void 0,this._lineThickness=void 0,this._lineThicknessSubscription=void 0,this._lineOffset=void 0,this._lineOffsetSubscription=void 0,this.color=e.color,this.cellAlpha=e.cellAlpha,this.lineCount=e.lineCount,this.lineThickness=e.lineThickness,this.lineOffset=e.lineOffset}Object.defineProperties(dS.prototype,{isConstant:{get:function(){return X.isConstant(this._color)&&X.isConstant(this._cellAlpha)&&X.isConstant(this._lineCount)&&X.isConstant(this._lineThickness)&&X.isConstant(this._lineOffset)}},definitionChanged:{get:function(){return this._definitionChanged}},color:me("color"),cellAlpha:me("cellAlpha"),lineCount:me("lineCount"),lineThickness:me("lineThickness"),lineOffset:me("lineOffset")});dS.prototype.getType=function(e){return"Grid"};var Q0t=new K;dS.prototype.getValue=function(e,t){return l(e)||(e=K.now(Q0t)),l(t)||(t={}),t.color=X.getValueOrClonedDefault(this._color,e,X0t,t.color),t.cellAlpha=X.getValueOrDefault(this._cellAlpha,e,K0t),t.lineCount=X.getValueOrClonedDefault(this._lineCount,e,$0t,t.lineCount),t.lineThickness=X.getValueOrClonedDefault(this._lineThickness,e,Z0t,t.lineThickness),t.lineOffset=X.getValueOrClonedDefault(this._lineOffset,e,J0t,t.lineOffset),t};dS.prototype.equals=function(e){return this===e||e instanceof dS&&X.equals(this._color,e._color)&&X.equals(this._cellAlpha,e._cellAlpha)&&X.equals(this._lineCount,e._lineCount)&&X.equals(this._lineThickness,e._lineThickness)&&X.equals(this._lineOffset,e._lineOffset)};var Z1=dS;var eEe={WHOLE:0,PORTIONS:1};Object.freeze(eEe);var Og=eEe;function hS(e){this._definitionChanged=new be,this._color=void 0,this._colorSubscription=void 0,this.color=e}Object.defineProperties(hS.prototype,{isConstant:{get:function(){return X.isConstant(this._color)}},definitionChanged:{get:function(){return this._definitionChanged}},color:me("color")});hS.prototype.getType=function(e){return"PolylineArrow"};var egt=new K;hS.prototype.getValue=function(e,t){return l(e)||(e=K.now(egt)),l(t)||(t={}),t.color=X.getValueOrClonedDefault(this._color,e,z.WHITE,t.color),t};hS.prototype.equals=function(e){return this===e||e instanceof hS&&X.equals(this._color,e._color)};var Q1=hS;var tgt=z.WHITE,ngt=z.TRANSPARENT,igt=16,rgt=255;function mS(e){e=e??H.EMPTY_OBJECT,this._definitionChanged=new be,this._color=void 0,this._colorSubscription=void 0,this._gapColor=void 0,this._gapColorSubscription=void 0,this._dashLength=void 0,this._dashLengthSubscription=void 0,this._dashPattern=void 0,this._dashPatternSubscription=void 0,this.color=e.color,this.gapColor=e.gapColor,this.dashLength=e.dashLength,this.dashPattern=e.dashPattern}Object.defineProperties(mS.prototype,{isConstant:{get:function(){return X.isConstant(this._color)&&X.isConstant(this._gapColor)&&X.isConstant(this._dashLength)&&X.isConstant(this._dashPattern)}},definitionChanged:{get:function(){return this._definitionChanged}},color:me("color"),gapColor:me("gapColor"),dashLength:me("dashLength"),dashPattern:me("dashPattern")});mS.prototype.getType=function(e){return"PolylineDash"};var ogt=new K;mS.prototype.getValue=function(e,t){return l(e)||(e=K.now(ogt)),l(t)||(t={}),t.color=X.getValueOrClonedDefault(this._color,e,tgt,t.color),t.gapColor=X.getValueOrClonedDefault(this._gapColor,e,ngt,t.gapColor),t.dashLength=X.getValueOrDefault(this._dashLength,e,igt,t.dashLength),t.dashPattern=X.getValueOrDefault(this._dashPattern,e,rgt,t.dashPattern),t};mS.prototype.equals=function(e){return this===e||e instanceof mS&&X.equals(this._color,e._color)&&X.equals(this._gapColor,e._gapColor)&&X.equals(this._dashLength,e._dashLength)&&X.equals(this._dashPattern,e._dashPattern)};var eR=mS;var sgt=z.WHITE,agt=.25,cgt=1;function pS(e){e=e??H.EMPTY_OBJECT,this._definitionChanged=new be,this._color=void 0,this._colorSubscription=void 0,this._glowPower=void 0,this._glowPowerSubscription=void 0,this._taperPower=void 0,this._taperPowerSubscription=void 0,this.color=e.color,this.glowPower=e.glowPower,this.taperPower=e.taperPower}Object.defineProperties(pS.prototype,{isConstant:{get:function(){return X.isConstant(this._color)&&X.isConstant(this._glow)}},definitionChanged:{get:function(){return this._definitionChanged}},color:me("color"),glowPower:me("glowPower"),taperPower:me("taperPower")});pS.prototype.getType=function(e){return"PolylineGlow"};var lgt=new K;pS.prototype.getValue=function(e,t){return l(e)||(e=K.now(lgt)),l(t)||(t={}),t.color=X.getValueOrClonedDefault(this._color,e,sgt,t.color),t.glowPower=X.getValueOrDefault(this._glowPower,e,agt,t.glowPower),t.taperPower=X.getValueOrDefault(this._taperPower,e,cgt,t.taperPower),t};pS.prototype.equals=function(e){return this===e||e instanceof pS&&X.equals(this._color,e._color)&&X.equals(this._glowPower,e._glowPower)&&X.equals(this._taperPower,e._taperPower)};var tR=pS;var ugt=z.WHITE,fgt=z.BLACK,dgt=1;function gS(e){e=e??H.EMPTY_OBJECT,this._definitionChanged=new be,this._color=void 0,this._colorSubscription=void 0,this._outlineColor=void 0,this._outlineColorSubscription=void 0,this._outlineWidth=void 0,this._outlineWidthSubscription=void 0,this.color=e.color,this.outlineColor=e.outlineColor,this.outlineWidth=e.outlineWidth}Object.defineProperties(gS.prototype,{isConstant:{get:function(){return X.isConstant(this._color)&&X.isConstant(this._outlineColor)&&X.isConstant(this._outlineWidth)}},definitionChanged:{get:function(){return this._definitionChanged}},color:me("color"),outlineColor:me("outlineColor"),outlineWidth:me("outlineWidth")});gS.prototype.getType=function(e){return"PolylineOutline"};var hgt=new K;gS.prototype.getValue=function(e,t){return l(e)||(e=K.now(hgt)),l(t)||(t={}),t.color=X.getValueOrClonedDefault(this._color,e,ugt,t.color),t.outlineColor=X.getValueOrClonedDefault(this._outlineColor,e,fgt,t.outlineColor),t.outlineWidth=X.getValueOrDefault(this._outlineWidth,e,dgt),t};gS.prototype.equals=function(e){return this===e||e instanceof gS&&X.equals(this._color,e._color)&&X.equals(this._outlineColor,e._outlineColor)&&X.equals(this._outlineWidth,e._outlineWidth)};var Gx=gS;function Mg(e,t){this._value=void 0,this._definitionChanged=new be,this._eventHelper=new Qo,this._referenceFrame=t??Wi.FIXED,this.setValue(e)}Object.defineProperties(Mg.prototype,{isConstant:{get:function(){let e=this._value;if(!l(e))return!0;let t=e.length;for(let n=0;n<t;n++)if(!X.isConstant(e[n]))return!1;return!0}},definitionChanged:{get:function(){return this._definitionChanged}},referenceFrame:{get:function(){return this._referenceFrame}}});var mgt=new K;Mg.prototype.getValue=function(e,t){return l(e)||(e=K.now(mgt)),this.getValueInReferenceFrame(e,Wi.FIXED,t)};Mg.prototype.getValueInReferenceFrame=function(e,t,n){let i=this._value;if(!l(i))return;let r=i.length;l(n)||(n=new Array(r));let o=0,s=0;for(;o<r;){let c=i[o].getValueInReferenceFrame(e,t,n[o]);l(c)&&(n[s]=c,s++),o++}return n.length=s,n};Mg.prototype.setValue=function(e){let t=this._eventHelper;if(t.removeAll(),l(e)){this._value=e.slice();let n=e.length;for(let i=0;i<n;i++){let r=e[i];l(r)&&t.add(r.definitionChanged,Mg.prototype._raiseDefinitionChanged,this)}}else this._value=void 0;this._definitionChanged.raiseEvent(this)};Mg.prototype.equals=function(e){return this===e||e instanceof Mg&&this._referenceFrame===e._referenceFrame&&X.arrayEquals(this._value,e._value)};Mg.prototype._raiseDefinitionChanged=function(){this._definitionChanged.raiseEvent(this)};var iA=Mg;function rA(e){this._value=void 0,this._definitionChanged=new be,this._eventHelper=new Qo,this.setValue(e)}Object.defineProperties(rA.prototype,{isConstant:{get:function(){let e=this._value;if(!l(e))return!0;let t=e.length;for(let n=0;n<t;n++)if(!X.isConstant(e[n]))return!1;return!0}},definitionChanged:{get:function(){return this._definitionChanged}}});var pgt=new K;rA.prototype.getValue=function(e,t){l(e)||(e=K.now(pgt));let n=this._value;if(!l(n))return;let i=n.length;l(t)||(t=new Array(i));let r=0,o=0;for(;r<i;){let a=this._value[r].getValue(e,t[r]);l(a)&&(t[o]=a,o++),r++}return t.length=o,t};rA.prototype.setValue=function(e){let t=this._eventHelper;if(t.removeAll(),l(e)){this._value=e.slice();let n=e.length;for(let i=0;i<n;i++){let r=e[i];l(r)&&t.add(r.definitionChanged,rA.prototype._raiseDefinitionChanged,this)}}else this._value=void 0;this._definitionChanged.raiseEvent(this)};rA.prototype.equals=function(e){return this===e||e instanceof rA&&X.arrayEquals(this._value,e._value)};rA.prototype._raiseDefinitionChanged=function(){this._definitionChanged.raiseEvent(this)};var nR=rA;function Wx(e){let t=e._targetProperty;if(!l(t)){let n=e._targetEntity;if(!l(n)){if(n=e._targetCollection.getById(e._targetId),!l(n)){e._targetEntity=e._targetProperty=void 0;return}n.definitionChanged.addEventListener(Cf.prototype._onTargetEntityDefinitionChanged,e),e._targetEntity=n}let i=e._targetPropertyNames;t=e._targetEntity;for(let r=0,o=i.length;r<o&&l(t);++r)t=t[i[r]];e._targetProperty=t}return t}function Cf(e,t,n){this._targetCollection=e,this._targetId=t,this._targetPropertyNames=n,this._targetProperty=void 0,this._targetEntity=void 0,this._definitionChanged=new be,e.collectionChanged.addEventListener(Cf.prototype._onCollectionChanged,this)}Object.defineProperties(Cf.prototype,{isConstant:{get:function(){return X.isConstant(Wx(this))}},definitionChanged:{get:function(){return this._definitionChanged}},referenceFrame:{get:function(){let e=Wx(this);return l(e)?e.referenceFrame:void 0}},targetId:{get:function(){return this._targetId}},targetCollection:{get:function(){return this._targetCollection}},targetPropertyNames:{get:function(){return this._targetPropertyNames}},resolvedProperty:{get:function(){return Wx(this)}}});Cf.fromString=function(e,t){let n,i=[],r=!0,o=!1,s="";for(let a=0;a<t.length;++a){let c=t.charAt(a);o?(s+=c,o=!1):c==="\\"?o=!0:r&&c==="#"?(n=s,r=!1,s=""):!r&&c==="."?(i.push(s),s=""):s+=c}return i.push(s),new Cf(e,n,i)};var ggt=new K;Cf.prototype.getValue=function(e,t){let n=Wx(this);return l(e)||(e=K.now(ggt)),l(n)?n.getValue(e,t):void 0};Cf.prototype.getValueInReferenceFrame=function(e,t,n){let i=Wx(this);return l(i)?i.getValueInReferenceFrame(e,t,n):void 0};Cf.prototype.getType=function(e){let t=Wx(this);return l(t)?t.getType(e):void 0};Cf.prototype.equals=function(e){if(this===e)return!0;let t=this._targetPropertyNames,n=e._targetPropertyNames;if(this._targetCollection!==e._targetCollection||this._targetId!==e._targetId||t.length!==n.length)return!1;let i=this._targetPropertyNames.length;for(let r=0;r<i;r++)if(t[r]!==n[r])return!1;return!0};Cf.prototype._onTargetEntityDefinitionChanged=function(e,t,n,i){l(this._targetProperty)&&this._targetPropertyNames[0]===t&&(this._targetProperty=void 0,this._definitionChanged.raiseEvent(this))};Cf.prototype._onCollectionChanged=function(e,t,n){let i=this._targetEntity;l(i)&&n.indexOf(i)!==-1?(i.definitionChanged.removeEventListener(Cf.prototype._onTargetEntityDefinitionChanged,this),this._targetEntity=this._targetProperty=void 0):l(i)||(i=Wx(this),l(i)&&this._definitionChanged.raiseEvent(this))};var oA=Cf;var _gt={packedLength:1,pack:function(e,t,n){return n=n??0,t[n]=e,t},unpack:function(e,t,n){return t=t??0,e[t]},convertPackedArrayForInterpolation:function(e,t,n,i){l(i)||(i=[]),t=t??0,n=n??e.length;let r;for(let o=0,s=n-t+1;o<s;o++){let a=e[t+o];o===0||Math.abs(r-a)<Math.PI?i[o]=a:i[o]=a-P.TWO_PI,r=a}},unpackInterpolationResult:function(e,t,n,i,r){return r=e[0],r<0?r+P.TWO_PI:r}},Kh=_gt;var tEe={packedLength:1,pack:function(e,t,n){n=n??0,t[n]=e},unpack:function(e,t,n){return t=t??0,e[t]}};function nEe(e,t,n){let i,r=e.length,o=n.length,s=r+o;if(e.length=s,r!==t){let a=r-1;for(i=s-1;i>=t;i--)e[i]=e[a--]}for(i=0;i<o;i++)e[t++]=n[i]}function iEe(e,t){return e instanceof K?e:typeof e=="string"?K.fromIso8601(e):K.addSeconds(t,e,new K)}var _ee=[],yee=[];function E8(e,t,n,i,r){let o=0,s,a,c,u,f,d;for(;o<i.length;){f=iEe(i[o],e),c=Pr(t,f,K.compare);let p=0,g=0;if(c<0){for(c=~c,u=c*r,a=void 0,d=t[c];o<i.length&&(f=iEe(i[o],e),!(l(a)&&K.compare(a,f)>=0||l(d)&&K.compare(f,d)>=0));){for(_ee[p++]=f,o=o+1,s=0;s<r;s++)yee[g++]=i[o],o=o+1;a=f}p>0&&(yee.length=g,nEe(n,u,yee),_ee.length=p,nEe(t,c,_ee))}else{for(s=0;s<r;s++)o++,n[c*r+s]=i[o];o++}}}function Ud(e,t){let n=e;n===Number&&(n=tEe);let i=n.packedLength,r=n.packedInterpolationLength??i,o=0,s;if(l(t)){let a=t.length;s=new Array(a);for(let c=0;c<a;c++){let u=t[c];u===Number&&(u=tEe);let f=u.packedLength;i+=f,r+=u.packedInterpolationLength??f,s[c]=u}o=a}this._type=e,this._innerType=n,this._interpolationDegree=1,this._interpolationAlgorithm=jx,this._lastInterpolationAlgorithm=jx,this._numberOfPoints=0,this._times=[],this._values=[],this._xTable=[],this._yTable=[],this._packedLength=i,this._packedInterpolationLength=r,this._updateTableLength=!0,this._interpolationResult=new Array(r),this._definitionChanged=new be,this._derivativeTypes=t,this._innerDerivativeTypes=s,this._inputOrder=o,this._forwardExtrapolationType=Lu.NONE,this._forwardExtrapolationDuration=0,this._backwardExtrapolationType=Lu.NONE,this._backwardExtrapolationDuration=0}Object.defineProperties(Ud.prototype,{isConstant:{get:function(){return this._values.length===0}},definitionChanged:{get:function(){return this._definitionChanged}},type:{get:function(){return this._type}},derivativeTypes:{get:function(){return this._derivativeTypes}},interpolationDegree:{get:function(){return this._interpolationDegree}},interpolationAlgorithm:{get:function(){return this._interpolationAlgorithm}},forwardExtrapolationType:{get:function(){return this._forwardExtrapolationType},set:function(e){this._forwardExtrapolationType!==e&&(this._forwardExtrapolationType=e,this._definitionChanged.raiseEvent(this))}},forwardExtrapolationDuration:{get:function(){return this._forwardExtrapolationDuration},set:function(e){this._forwardExtrapolationDuration!==e&&(this._forwardExtrapolationDuration=e,this._definitionChanged.raiseEvent(this))}},backwardExtrapolationType:{get:function(){return this._backwardExtrapolationType},set:function(e){this._backwardExtrapolationType!==e&&(this._backwardExtrapolationType=e,this._definitionChanged.raiseEvent(this))}},backwardExtrapolationDuration:{get:function(){return this._backwardExtrapolationDuration},set:function(e){this._backwardExtrapolationDuration!==e&&(this._backwardExtrapolationDuration=e,this._definitionChanged.raiseEvent(this))}}});var ygt=new K;Ud.prototype.getValue=function(e,t){l(e)||(e=K.now(ygt));let n=this._times,i=n.length;if(i===0)return;let r,o=this._innerType,s=this._values,a=Pr(n,e,K.compare);var c=!1;if(a<0){if(a=~a,a===0){let S=n[a];if(r=this._backwardExtrapolationDuration,this._backwardExtrapolationType===Lu.NONE||r!==0&&K.secondsDifference(S,e)>r)return;if(this._backwardExtrapolationType===Lu.HOLD)return o.unpack(s,0,t);c=this._backwardExtrapolationType===Lu.LINEAR_EXTRAPOLATE}if(a>=i){a=i-1;let S=n[a];if(r=this._forwardExtrapolationDuration,this._forwardExtrapolationType===Lu.NONE||r!==0&&K.secondsDifference(e,S)>r)return;if(this._forwardExtrapolationType===Lu.HOLD)return a=i-1,o.unpack(s,a*o.packedLength,t);c=this._forwardExtrapolationType===Lu.LINEAR_EXTRAPOLATE}let d=this._xTable,p=this._yTable;var u,f;c?(u=Cesium.LinearApproximation,f=1):(u=this._interpolationAlgorithm,f=this._interpolationDegree),this._lastInterpolationAlgorithm!=u&&(this._lastInterpolationAlgorithm=u,this._updateTableLength=!0);let g=this._packedInterpolationLength,m=this._inputOrder;if(this._updateTableLength){this._updateTableLength=!1;let S=Math.min(u.getRequiredDataPoints(f,m),i);S!==this._numberOfPoints&&(this._numberOfPoints=S,d.length=S,p.length=S*g)}let y=this._numberOfPoints-1;if(y<1)return;let A=0,b=i-1;if(b-A+1>=y+1){let S=a-(y/2|0)-1;S<A&&(S=A);let I=S+y;I>b&&(I=b,S=I-y,S<A&&(S=A)),A=S,b=I}let T=b-A+1;for(let S=0;S<T;++S)d[S]=K.secondsDifference(n[A+S],n[b]);if(l(o.convertPackedArrayForInterpolation))o.convertPackedArrayForInterpolation(s,A,b,p);else{let S=0,I=this._packedLength,R=A*I,O=(b+1)*I;for(;R<O;)p[S]=s[R],R++,S++}let E=K.secondsDifference(e,n[b]),v;if(m===0||!l(u.interpolate))v=u.interpolateOrderZero(E,d,p,g,this._interpolationResult);else{let S=Math.floor(g/(m+1));v=u.interpolate(E,d,p,S,m,m,this._interpolationResult)}return l(o.unpackInterpolationResult)?o.unpackInterpolationResult(v,s,A,b,t):o.unpack(v,0,t)}return o.unpack(s,a*this._packedLength,t)};Ud.prototype.setInterpolationOptions=function(e){if(!l(e))return;let t=!1,n=e.interpolationAlgorithm,i=e.interpolationDegree;l(n)&&this._interpolationAlgorithm!==n&&(this._interpolationAlgorithm=n,t=!0),l(i)&&this._interpolationDegree!==i&&(this._interpolationDegree=i,t=!0),t&&(this._updateTableLength=!0,this._definitionChanged.raiseEvent(this))};Ud.prototype.addSample=function(e,t,n){let i=this._innerDerivativeTypes,r=l(i),o=this._innerType,s=[];if(s.push(e),o.pack(t,s,s.length),r){let a=i.length;for(let c=0;c<a;c++)i[c].pack(n[c],s,s.length)}E8(void 0,this._times,this._values,s,this._packedLength),this._updateTableLength=!0,this._definitionChanged.raiseEvent(this)};Ud.prototype.addSamples=function(e,t,n){let i=this._innerDerivativeTypes,r=l(i),o=this._innerType,s=e.length,a=[];for(let c=0;c<s;c++)if(a.push(e[c]),o.pack(t[c],a,a.length),r){let u=n[c],f=i.length;for(let d=0;d<f;d++)i[d].pack(u[d],a,a.length)}E8(void 0,this._times,this._values,a,this._packedLength),this._updateTableLength=!0,this._definitionChanged.raiseEvent(this)};Ud.prototype.getSample=function(e){let t=this._times,n=t.length;if(l(n))return e<0&&(e+=n),t[e]};Ud.prototype.addSamplesPackedArray=function(e,t){E8(t,this._times,this._values,e,this._packedLength),this._updateTableLength=!0,this._definitionChanged.raiseEvent(this)};Ud.prototype.removeSample=function(e){let t=Pr(this._times,e,K.compare);return t<0?!1:(rEe(this,t,1),!0)};function rEe(e,t,n){let i=e._packedLength;e._times.splice(t,n),e._values.splice(t*i,n*i),e._updateTableLength=!0,e._definitionChanged.raiseEvent(e)}Ud.prototype.removeSamples=function(e){let t=this._times,n=Pr(t,e.start,K.compare);n<0?n=~n:e.isStartIncluded||++n;let i=Pr(t,e.stop,K.compare);i<0?i=~i:e.isStopIncluded&&++i,rEe(this,n,i-n)};Ud.prototype.equals=function(e){if(this===e)return!0;if(!l(e)||this._type!==e._type||this._interpolationDegree!==e._interpolationDegree||this._interpolationAlgorithm!==e._interpolationAlgorithm)return!1;let t=this._derivativeTypes,n=l(t),i=e._derivativeTypes,r=l(i);if(n!==r)return!1;let o,s;if(n){if(s=t.length,s!==i.length)return!1;for(o=0;o<s;o++)if(t[o]!==i[o])return!1}let a=this._times,c=e._times;if(s=a.length,s!==c.length)return!1;for(o=0;o<s;o++)if(!K.equals(a[o],c[o]))return!1;let u=this._values,f=e._values;for(s=u.length,o=0;o<s;o++)if(u[o]!==f[o])return!1;return!0};Ud._mergeNewSamples=E8;var zd=Ud;function Vd(e,t){t=t??0;let n;if(t>0){n=new Array(t);for(let i=0;i<t;i++)n[i]=h}this._numberOfDerivatives=t,this._property=new zd(h,n),this._definitionChanged=new be,this._referenceFrame=e??Wi.FIXED,this._property._definitionChanged.addEventListener(function(){this._definitionChanged.raiseEvent(this)},this)}Object.defineProperties(Vd.prototype,{isConstant:{get:function(){return this._property.isConstant}},definitionChanged:{get:function(){return this._definitionChanged}},referenceFrame:{get:function(){return this._referenceFrame}},interpolationDegree:{get:function(){return this._property.interpolationDegree}},interpolationAlgorithm:{get:function(){return this._property.interpolationAlgorithm}},numberOfDerivatives:{get:function(){return this._numberOfDerivatives}},forwardExtrapolationType:{get:function(){return this._property.forwardExtrapolationType},set:function(e){this._property.forwardExtrapolationType=e}},forwardExtrapolationDuration:{get:function(){return this._property.forwardExtrapolationDuration},set:function(e){this._property.forwardExtrapolationDuration=e}},backwardExtrapolationType:{get:function(){return this._property.backwardExtrapolationType},set:function(e){this._property.backwardExtrapolationType=e}},backwardExtrapolationDuration:{get:function(){return this._property.backwardExtrapolationDuration},set:function(e){this._property.backwardExtrapolationDuration=e}}});var Agt=new K;Vd.prototype.getValue=function(e,t){return l(e)||(e=K.now(Agt)),this.getValueInReferenceFrame(e,Wi.FIXED,t)};Vd.prototype.getValueInReferenceFrame=function(e,t,n){if(n=this._property.getValue(e,n),l(n))return ep.convertToReferenceFrame(e,n,this._referenceFrame,t,n)};Vd.prototype.setInterpolationOptions=function(e){this._property.setInterpolationOptions(e)};Vd.prototype.addSample=function(e,t,n){let i=this._numberOfDerivatives;this._property.addSample(e,t,n)};Vd.prototype.addSamples=function(e,t,n){this._property.addSamples(e,t,n)};Vd.prototype.addSamplesPackedArray=function(e,t){this._property.addSamplesPackedArray(e,t)};Vd.prototype.removeSample=function(e){return this._property.removeSample(e)};Vd.prototype.removeSamples=function(e){this._property.removeSamples(e)};Vd.prototype.equals=function(e){return this===e||e instanceof Vd&&X.equals(this._property,e._property)&&this._referenceFrame===e._referenceFrame};var Cc=Vd;var oEe={HORIZONTAL:0,VERTICAL:1};Object.freeze(oEe);var Lp=oEe;var bgt=Lp.HORIZONTAL,xgt=z.WHITE,Tgt=z.BLACK,Egt=0,Cgt=1;function _S(e){e=e??H.EMPTY_OBJECT,this._definitionChanged=new be,this._orientation=void 0,this._orientationSubscription=void 0,this._evenColor=void 0,this._evenColorSubscription=void 0,this._oddColor=void 0,this._oddColorSubscription=void 0,this._offset=void 0,this._offsetSubscription=void 0,this._repeat=void 0,this._repeatSubscription=void 0,this.orientation=e.orientation,this.evenColor=e.evenColor,this.oddColor=e.oddColor,this.offset=e.offset,this.repeat=e.repeat}Object.defineProperties(_S.prototype,{isConstant:{get:function(){return X.isConstant(this._orientation)&&X.isConstant(this._evenColor)&&X.isConstant(this._oddColor)&&X.isConstant(this._offset)&&X.isConstant(this._repeat)}},definitionChanged:{get:function(){return this._definitionChanged}},orientation:me("orientation"),evenColor:me("evenColor"),oddColor:me("oddColor"),offset:me("offset"),repeat:me("repeat")});_S.prototype.getType=function(e){return"Stripe"};var vgt=new K;_S.prototype.getValue=function(e,t){return l(e)||(e=K.now(vgt)),l(t)||(t={}),t.horizontal=X.getValueOrDefault(this._orientation,e,bgt)===Lp.HORIZONTAL,t.evenColor=X.getValueOrClonedDefault(this._evenColor,e,xgt,t.evenColor),t.oddColor=X.getValueOrClonedDefault(this._oddColor,e,Tgt,t.oddColor),t.offset=X.getValueOrDefault(this._offset,e,Egt),t.repeat=X.getValueOrDefault(this._repeat,e,Cgt),t};_S.prototype.equals=function(e){return this===e||e instanceof _S&&X.equals(this._orientation,e._orientation)&&X.equals(this._evenColor,e._evenColor)&&X.equals(this._oddColor,e._oddColor)&&X.equals(this._offset,e._offset)&&X.equals(this._repeat,e._repeat)};var iR=_S;function sA(e){this._definitionChanged=new be,this._intervals=new Ls,this._intervals.changedEvent.addEventListener(sA.prototype._intervalsChanged,this),this._referenceFrame=e??Wi.FIXED}Object.defineProperties(sA.prototype,{isConstant:{get:function(){return this._intervals.isEmpty}},definitionChanged:{get:function(){return this._definitionChanged}},intervals:{get:function(){return this._intervals}},referenceFrame:{get:function(){return this._referenceFrame}}});var Sgt=new K;sA.prototype.getValue=function(e,t){return l(e)||(e=K.now(Sgt)),this.getValueInReferenceFrame(e,Wi.FIXED,t)};sA.prototype.getValueInReferenceFrame=function(e,t,n){let i=this._intervals.findDataForIntervalContainingDate(e);if(l(i))return ep.convertToReferenceFrame(e,i,this._referenceFrame,t,n)};sA.prototype.equals=function(e){return this===e||e instanceof sA&&this._intervals.equals(e._intervals,X.equals)&&this._referenceFrame===e._referenceFrame};sA.prototype._intervalsChanged=function(){this._definitionChanged.raiseEvent(this)};var aA=sA;function qx(){this._definitionChanged=new be,this._intervals=new Ls,this._intervals.changedEvent.addEventListener(qx.prototype._intervalsChanged,this)}Object.defineProperties(qx.prototype,{isConstant:{get:function(){return this._intervals.isEmpty}},definitionChanged:{get:function(){return this._definitionChanged}},intervals:{get:function(){return this._intervals}}});var wgt=new K;qx.prototype.getValue=function(e,t){l(e)||(e=K.now(wgt));let n=this._intervals.findDataForIntervalContainingDate(e);return l(n)&&typeof n.clone=="function"?n.clone(t):n};qx.prototype.equals=function(e){return this===e||e instanceof qx&&this._intervals.equals(e._intervals,X.equals)};qx.prototype._intervalsChanged=function(){this._definitionChanged.raiseEvent(this)};var cA=qx;function yS(e,t){this._position=void 0,this._subscription=void 0,this._definitionChanged=new be,this._normalize=t??!0,this.position=e}Object.defineProperties(yS.prototype,{isConstant:{get:function(){return X.isConstant(this._position)}},definitionChanged:{get:function(){return this._definitionChanged}},position:{get:function(){return this._position},set:function(e){let t=this._position;t!==e&&(l(t)&&this._subscription(),this._position=e,l(e)&&(this._subscription=e._definitionChanged.addEventListener(function(){this._definitionChanged.raiseEvent(this)},this)),this._definitionChanged.raiseEvent(this))}},normalize:{get:function(){return this._normalize},set:function(e){this._normalize!==e&&(this._normalize=e,this._definitionChanged.raiseEvent(this))}}});var Igt=new h,sEe=new h,aEe=new K,Pgt=new K,Aee=1/60;yS.prototype.getValue=function(e,t){return this._getValue(e,t)};yS.prototype._getValue=function(e,t,n){l(e)||(e=K.now(Pgt)),l(t)||(t=new h);let i=this._position;if(X.isConstant(i))return this._normalize?void 0:h.clone(h.ZERO,t);let r=i.getValue(e,Igt),o=i.getValue(K.addSeconds(e,Aee,aEe),sEe);if(!l(r)||!l(o)&&(o=r,r=i.getValue(K.addSeconds(e,-Aee,aEe),sEe),!l(r)))return;if(h.equals(r,o))return this._normalize?void 0:h.clone(h.ZERO,t);l(n)&&r.clone(n);let s=h.subtract(o,r,t);return this._normalize?h.normalize(s,t):h.divideByScalar(s,Aee,t)};yS.prototype.equals=function(e){return this===e||e instanceof yS&&X.equals(this._position,e._position)};var lA=yS;function rR(e,t){this._velocityVectorProperty=new lA(e,!0),this._subscription=void 0,this._ellipsoid=void 0,this._definitionChanged=new be,this.ellipsoid=t??ee.default;let n=this;this._velocityVectorProperty.definitionChanged.addEventListener(function(){n._definitionChanged.raiseEvent(n)})}Object.defineProperties(rR.prototype,{isConstant:{get:function(){return X.isConstant(this._velocityVectorProperty)}},definitionChanged:{get:function(){return this._definitionChanged}},position:{get:function(){return this._velocityVectorProperty.position},set:function(e){this._velocityVectorProperty.position=e}},ellipsoid:{get:function(){return this._ellipsoid},set:function(e){this._ellipsoid!==e&&(this._ellipsoid=e,this._definitionChanged.raiseEvent(this))}}});var cEe=new h,Dgt=new h,lEe=new $,Rgt=new K;rR.prototype.getValue=function(e,t){l(e)||(e=K.now(Rgt));let n=this._velocityVectorProperty._getValue(e,Dgt,cEe);if(l(n))return At.rotationMatrixFromPositionVelocity(cEe,n,this._ellipsoid,lEe),Le.fromRotationMatrix(lEe,t)};rR.prototype.equals=function(e){return this===e||e instanceof rR&&X.equals(this._velocityVectorProperty,e._velocityVectorProperty)&&(this._ellipsoid===e._ellipsoid||this._ellipsoid.equals(e._ellipsoid))};var C8=rR;var Ng={COMPLETE:0,BELOW_ELLIPSOID_HORIZON:1,ABOVE_ELLIPSOID_HORIZON:2};Ng.validate=function(e){return e===Ng.COMPLETE||e===Ng.BELOW_ELLIPSOID_HORIZON||e===Ng.ABOVE_ELLIPSOID_HORIZON};Ng.toString=function(e){switch(e){case Ng.COMPLETE:return"COMPLETE";case Ng.BELOW_ELLIPSOID_HORIZON:return"BELOW_ELLIPSOID_HORIZON";case Ng.ABOVE_ELLIPSOID_HORIZON:return"ABOVE_ELLIPSOID_HORIZON";default:throw new pe("SensorVolumePortionToDisplay value is not valid and cannot be converted to a String.")}};var oR=Ng;function uA(){}uA.packedLength=h.packedLength;uA.unpack=h.unpack;uA.pack=h.pack;var bee;function sR(e,t){return t[0]==="#"&&(t=bee+t),oA.fromString(e,t)}function uEe(e,t,n){if(l(n.reference))return sR(t,n.reference);if(l(n.velocityReference)){let i=sR(t,n.velocityReference);switch(e){case h:case uA:return new lA(i,e===uA);case Le:return new C8(i)}}throw new oe(`${JSON.stringify(n)} is not valid CZML.`)}function Ogt(e,t){return new rp(function(n,i){return t(e.getValue(n,i))},e.isConstant)}var fr=new h,Gl=new T8,al=new he,Yx=new Cn,v8=new Le;function Mgt(e){let t=e.rgbaf;if(l(t))return t;let n=e.rgba;if(!l(n))return;let i=n.length;if(i===z.packedLength)return[z.byteToFloat(n[0]),z.byteToFloat(n[1]),z.byteToFloat(n[2]),z.byteToFloat(n[3])];t=new Array(i);for(let r=0;r<i;r+=5)t[r]=n[r],t[r+1]=z.byteToFloat(n[r+1]),t[r+2]=z.byteToFloat(n[r+2]),t[r+3]=z.byteToFloat(n[r+3]),t[r+4]=z.byteToFloat(n[r+4]);return t}function fEe(e,t){let n=e.uri??e;return l(t)?t.getDerivedResource({url:n}):De.createIfNeeded(n)}function Ngt(e){let t=e.wsen;if(l(t))return t;let n=e.wsenDegrees;if(!l(n))return;let i=n.length;if(i===ie.packedLength)return[P.toRadians(n[0]),P.toRadians(n[1]),P.toRadians(n[2]),P.toRadians(n[3])];t=new Array(i);for(let r=0;r<i;r+=5)t[r]=n[r],t[r+1]=P.toRadians(n[r+1]),t[r+2]=P.toRadians(n[r+2]),t[r+3]=P.toRadians(n[r+3]),t[r+4]=P.toRadians(n[r+4]);return t}function Lgt(e){let t=e.length;if(Gl.magnitude=1,t===2)return Gl.clock=e[0],Gl.cone=e[1],h.fromSpherical(Gl,fr),[fr.x,fr.y,fr.z];let n=new Array(t/3*4);for(let i=0,r=0;i<t;i+=3,r+=4)n[r]=e[i],Gl.clock=e[i+1],Gl.cone=e[i+2],h.fromSpherical(Gl,fr),n[r+1]=fr.x,n[r+2]=fr.y,n[r+3]=fr.z;return n}function Fgt(e){let t=e.length;if(t===3)return Gl.clock=e[0],Gl.cone=e[1],Gl.magnitude=e[2],h.fromSpherical(Gl,fr),[fr.x,fr.y,fr.z];let n=new Array(t);for(let i=0;i<t;i+=4)n[i]=e[i],Gl.clock=e[i+1],Gl.cone=e[i+2],Gl.magnitude=e[i+3],h.fromSpherical(Gl,fr),n[i+1]=fr.x,n[i+2]=fr.y,n[i+3]=fr.z;return n}function Bgt(e){let t=e.length;if(t===3)return al.longitude=e[0],al.latitude=e[1],al.height=e[2],ee.default.cartographicToCartesian(al,fr),[fr.x,fr.y,fr.z];let n=new Array(t);for(let i=0;i<t;i+=4)n[i]=e[i],al.longitude=e[i+1],al.latitude=e[i+2],al.height=e[i+3],ee.default.cartographicToCartesian(al,fr),n[i+1]=fr.x,n[i+2]=fr.y,n[i+3]=fr.z;return n}function kgt(e){let t=e.length;if(t===3)return al.longitude=P.toRadians(e[0]),al.latitude=P.toRadians(e[1]),al.height=e[2],ee.default.cartographicToCartesian(al,fr),[fr.x,fr.y,fr.z];let n=new Array(t);for(let i=0;i<t;i+=4)n[i]=e[i],al.longitude=P.toRadians(e[i+1]),al.latitude=P.toRadians(e[i+2]),al.height=e[i+3],ee.default.cartographicToCartesian(al,fr),n[i+1]=fr.x,n[i+2]=fr.y,n[i+3]=fr.z;return n}function xee(e){let t=e.cartesian;if(l(t))return t;let n=e.cartesianVelocity;if(l(n))return n;let i=e.unitCartesian;if(l(i))return i;let r=e.unitSpherical;if(l(r))return Lgt(r);let o=e.spherical;if(l(o))return Fgt(o);let s=e.cartographicRadians;if(l(s))return Bgt(s);let a=e.cartographicDegrees;if(l(a))return kgt(a);throw new oe(`${JSON.stringify(e)} is not a valid CZML interval.`)}function dEe(e,t){h.unpack(e,t,fr),h.normalize(fr,fr),h.pack(fr,e,t)}function Ugt(e){let t=xee(e);if(t.length===3)return dEe(t,0),t;for(let n=1;n<t.length;n+=4)dEe(t,n);return t}function hEe(e,t){Le.unpack(e,t,v8),Le.normalize(v8,v8),Le.pack(v8,e,t)}function zgt(e){let t=e.unitQuaternion;if(l(t)){if(t.length===4)return hEe(t,0),t;for(let n=1;n<t.length;n+=5)hEe(t,n)}return t}function mEe(e){return typeof e=="boolean"?Boolean:typeof e=="number"?Number:typeof e=="string"?String:e.hasOwnProperty("array")?Array:e.hasOwnProperty("boolean")?Boolean:e.hasOwnProperty("boundingRectangle")?et:e.hasOwnProperty("cartesian2")?U:e.hasOwnProperty("cartesian")||e.hasOwnProperty("spherical")||e.hasOwnProperty("cartographicRadians")||e.hasOwnProperty("cartographicDegrees")?h:e.hasOwnProperty("unitCartesian")||e.hasOwnProperty("unitSpherical")?uA:e.hasOwnProperty("rgba")||e.hasOwnProperty("rgbaf")?z:e.hasOwnProperty("arcType")?ln:e.hasOwnProperty("classificationType")?ei:e.hasOwnProperty("colorBlendMode")?Nl:e.hasOwnProperty("cornerType")?ur:e.hasOwnProperty("heightReference")?We:e.hasOwnProperty("horizontalOrigin")?Hi:e.hasOwnProperty("date")?K:e.hasOwnProperty("labelStyle")?Io:e.hasOwnProperty("number")?Number:e.hasOwnProperty("nearFarScalar")?qt:e.hasOwnProperty("distanceDisplayCondition")?Gt:e.hasOwnProperty("object")||e.hasOwnProperty("value")?Object:e.hasOwnProperty("unitQuaternion")?Le:e.hasOwnProperty("pathMode")?Og:e.hasOwnProperty("shadowMode")?Dn:e.hasOwnProperty("string")?String:e.hasOwnProperty("stripeOrientation")?Lp:e.hasOwnProperty("wsen")||e.hasOwnProperty("wsenDegrees")?ie:e.hasOwnProperty("uri")?cR.default:e.hasOwnProperty("verticalOrigin")?qn:Object}function Vgt(e,t,n){switch(e){case ln:return ln[t.arcType??t];case Array:return t.array;case Boolean:return t.boolean??t;case et:return t.boundingRectangle;case U:return t.cartesian2;case h:return xee(t);case uA:return Ugt(t);case z:return Mgt(t);case ei:return ei[t.classificationType??t];case Nl:return Nl[t.colorBlendMode??t];case ur:return ur[t.cornerType??t];case We:return We[t.heightReference??t];case Hi:return Hi[t.horizontalOrigin??t];case Image:return fEe(t,n);case K:return K.fromIso8601(t.date??t);case Io:return Io[t.labelStyle??t];case Number:return t.number??t;case qt:return t.nearFarScalar;case Gt:return t.distanceDisplayCondition;case Object:return t.object??t.value??t;case Og:return Og[t.pathMode??t];case Le:return zgt(t);case Kh:return t.number??t;case oR:return oR[t.portionToDisplay??t];case Dn:return Dn[t.shadowMode??t.shadows??t];case String:return t.string??t;case Lp:return Lp[t.stripeOrientation??t];case ie:return Ngt(t);case cR.default:return fEe(t,n);case qn:return qn[t.verticalOrigin??t];default:throw new oe(`Unknown CzmlDataSource interval type: ${e}`)}}var jgt={HERMITE:b8,LAGRANGE:x8,LINEAR:jx};function S8(e,t){let n=e.interpolationAlgorithm,i=e.interpolationDegree;(l(n)||l(i))&&t.setInterpolationOptions({interpolationAlgorithm:jgt[n],interpolationDegree:i});let r=e.forwardExtrapolationType;l(r)&&(t.forwardExtrapolationType=Lu[r]);let o=e.forwardExtrapolationDuration;l(o)&&(t.forwardExtrapolationDuration=o);let s=e.backwardExtrapolationType;l(s)&&(t.backwardExtrapolationType=Lu[s]);let a=e.backwardExtrapolationDuration;l(a)&&(t.backwardExtrapolationDuration=a)}var pEe={iso8601:void 0};function zo(e){if(l(e))return pEe.iso8601=e,Cn.fromIso8601(pEe)}function Tee(e){let t=nt.MAXIMUM_INTERVAL.clone();return t.data=e,t}function gEe(e){let t=new Vl;return t.intervals.addInterval(Tee(e)),t}function _Ee(e){let t=new Ec(e.referenceFrame);return t.intervals.addInterval(Tee(e)),t}function w8(e,t,n,i,r,o,s){let a=zo(i.interval);l(r)&&(l(a)?a=Cn.intersect(a,r,Yx):a=r);let c,u,f,d=!l(i.reference)&&!l(i.velocityReference),p=l(a)&&!a.equals(nt.MAXIMUM_INTERVAL);if(i.delete===!0){if(!p){t[n]=void 0;return}return IEe(t[n],a)}let g=!1;if(d){if(u=Vgt(e,i,o),!l(u))return;c=e.packedLength??1,f=u.length??1,g=!l(i.array)&&typeof u!="string"&&f>c&&e!==Object}let m=typeof e.unpack=="function"&&e!==Kh;if(!g&&!p){d?t[n]=new hi(m?e.unpack(u,0):u):t[n]=uEe(e,s,i);return}let y=t[n],A,b=i.epoch;if(l(b)&&(A=K.fromIso8601(b)),g&&!p){y instanceof zd||(t[n]=y=new zd(e)),y.addSamplesPackedArray(u,A),S8(i,y);return}let x;if(!g&&p){a=a.clone(),d?a.data=m?e.unpack(u,0):u:a.data=uEe(e,s,i),l(y)||(t[n]=y=d?new cA:new Vl),d&&y instanceof cA?y.intervals.addInterval(a):y instanceof Vl?(d&&(a.data=new hi(a.data)),y.intervals.addInterval(a)):(t[n]=y=gEe(y),d&&(a.data=new hi(a.data)),y.intervals.addInterval(a));return}l(y)||(t[n]=y=new Vl),y instanceof Vl||(t[n]=y=gEe(y));let T=y.intervals;x=T.findInterval(a),(!l(x)||!(x.data instanceof zd))&&(x=a.clone(),x.data=new zd(e),T.addInterval(x)),x.data.addSamplesPackedArray(u,A),S8(i,x.data)}function IEe(e,t){if(e instanceof zd){e.removeSamples(t);return}else if(e instanceof cA){e.intervals.removeInterval(t);return}else if(e instanceof Vl){let n=e.intervals;for(let i=0;i<n.length;++i){let r=Cn.intersect(n.get(i),t,Yx);r.isEmpty||IEe(r.data,t)}n.removeInterval(t);return}}function Ee(e,t,n,i,r,o,s){if(l(i))if(Array.isArray(i))for(let a=0,c=i.length;a<c;++a)w8(e,t,n,i[a],r,o,s);else w8(e,t,n,i,r,o,s)}function yEe(e,t,n,i,r,o){let s=zo(n.interval);l(i)&&(l(s)?s=Cn.intersect(s,i,Yx):s=i);let a=l(n.cartesianVelocity)?1:0,c=h.packedLength*(a+1),u,f,d=!l(n.reference),p=l(s)&&!s.equals(nt.MAXIMUM_INTERVAL);if(n.delete===!0){if(!p){e[t]=void 0;return}return PEe(e[t],s)}let g,m=!1;if(d&&(l(n.referenceFrame)&&(g=Wi[n.referenceFrame]),g=g??Wi.FIXED,u=xee(n),f=u.length??1,m=f>c),!m&&!p){d?e[t]=new gu(h.unpack(u),g):e[t]=sR(o,n.reference);return}let y=e[t],A,b=n.epoch;if(l(b)&&(A=K.fromIso8601(b)),m&&!p){(!(y instanceof Cc)||l(g)&&y.referenceFrame!==g)&&(e[t]=y=new Cc(g,a)),y.addSamplesPackedArray(u,A),S8(n,y);return}let x;if(!m&&p){s=s.clone(),d?s.data=h.unpack(u):s.data=sR(o,n.reference),l(y)||(d?y=new aA(g):y=new Ec(g),e[t]=y),d&&y instanceof aA&&l(g)&&y.referenceFrame===g?y.intervals.addInterval(s):y instanceof Ec?(d&&(s.data=new gu(s.data,g)),y.intervals.addInterval(s)):(e[t]=y=_Ee(y),d&&(s.data=new gu(s.data,g)),y.intervals.addInterval(s));return}l(y)?y instanceof Ec||(e[t]=y=_Ee(y)):e[t]=y=new Ec(g);let T=y.intervals;x=T.findInterval(s),(!l(x)||!(x.data instanceof Cc)||l(g)&&x.data.referenceFrame!==g)&&(x=s.clone(),x.data=new Cc(g,a),T.addInterval(x)),x.data.addSamplesPackedArray(u,A),S8(n,x.data)}function PEe(e,t){if(e instanceof Cc){e.removeSamples(t);return}else if(e instanceof aA){e.intervals.removeInterval(t);return}else if(e instanceof Ec){let n=e.intervals;for(let i=0;i<n.length;++i){let r=Cn.intersect(n.get(i),t,Yx);r.isEmpty||PEe(r.data,t)}n.removeInterval(t);return}}function DEe(e,t,n,i,r,o){if(l(n))if(Array.isArray(n))for(let s=0,a=n.length;s<a;++s)yEe(e,t,n[s],i,r,o);else yEe(e,t,n,i,r,o)}function AEe(e,t,n,i){l(n.references)?I8(e,t,n.references,n.interval,i,nR,Vl):(l(n.cartesian2)?n.array=U.unpackArray(n.cartesian2):l(n.cartesian)&&(n.array=U.unpackArray(n.cartesian)),l(n.array)&&Ee(Array,e,t,n,void 0,void 0,i))}function bEe(e,t,n,i,r,o){let s=zo(n.interval);l(i)&&(l(s)?s=Cn.intersect(s,i,Yx):s=i);let a=e[t],c,u;if(l(s)){a instanceof H1||(a=new H1,e[t]=a);let d=a.intervals;u=d.findInterval({start:s.start,stop:s.stop}),l(u)?c=u.data:(u=s.clone(),d.addInterval(u))}else c=a;let f;l(n.solidColor)?(c instanceof Kt||(c=new Kt),f=n.solidColor,Ee(z,c,"color",f.color,void 0,void 0,o)):l(n.grid)?(c instanceof Z1||(c=new Z1),f=n.grid,Ee(z,c,"color",f.color,void 0,r,o),Ee(Number,c,"cellAlpha",f.cellAlpha,void 0,r,o),Ee(U,c,"lineCount",f.lineCount,void 0,r,o),Ee(U,c,"lineThickness",f.lineThickness,void 0,r,o),Ee(U,c,"lineOffset",f.lineOffset,void 0,r,o)):l(n.image)?(c instanceof kb||(c=new kb),f=n.image,Ee(Image,c,"image",f.image,void 0,r,o),Ee(U,c,"repeat",f.repeat,void 0,r,o),Ee(z,c,"color",f.color,void 0,r,o),Ee(Boolean,c,"transparent",f.transparent,void 0,r,o)):l(n.stripe)?(c instanceof iR||(c=new iR),f=n.stripe,Ee(Lp,c,"orientation",f.orientation,void 0,r,o),Ee(z,c,"evenColor",f.evenColor,void 0,r,o),Ee(z,c,"oddColor",f.oddColor,void 0,r,o),Ee(Number,c,"offset",f.offset,void 0,r,o),Ee(Number,c,"repeat",f.repeat,void 0,r,o)):l(n.polylineOutline)?(c instanceof Gx||(c=new Gx),f=n.polylineOutline,Ee(z,c,"color",f.color,void 0,r,o),Ee(z,c,"outlineColor",f.outlineColor,void 0,r,o),Ee(Number,c,"outlineWidth",f.outlineWidth,void 0,r,o)):l(n.polylineGlow)?(c instanceof tR||(c=new tR),f=n.polylineGlow,Ee(z,c,"color",f.color,void 0,r,o),Ee(Number,c,"glowPower",f.glowPower,void 0,r,o),Ee(Number,c,"taperPower",f.taperPower,void 0,r,o)):l(n.polylineArrow)?(c instanceof Q1||(c=new Q1),f=n.polylineArrow,Ee(z,c,"color",f.color,void 0,void 0,o)):l(n.polylineDash)?(c instanceof eR||(c=new eR),f=n.polylineDash,Ee(z,c,"color",f.color,void 0,void 0,o),Ee(z,c,"gapColor",f.gapColor,void 0,void 0,o),Ee(Number,c,"dashLength",f.dashLength,void 0,r,o),Ee(Number,c,"dashPattern",f.dashPattern,void 0,r,o)):l(n.checkerboard)&&(c instanceof U1||(c=new U1),f=n.checkerboard,Ee(z,c,"evenColor",f.evenColor,void 0,r,o),Ee(z,c,"oddColor",f.oddColor,void 0,r,o),Ee(U,c,"repeat",f.repeat,void 0,r,o)),l(u)?u.data=c:e[t]=c}function vf(e,t,n,i,r,o){if(l(n))if(Array.isArray(n))for(let s=0,a=n.length;s<a;++s)bEe(e,t,n[s],i,r,o);else bEe(e,t,n,i,r,o)}function Hgt(e,t,n,i){let r=t.name;l(r)&&(e.name=t.name)}function Ggt(e,t,n,i){let r=t.description;l(r)&&Ee(String,e,"description",r,void 0,i,n)}function Wgt(e,t,n,i){let r=t.position;l(r)&&DEe(e,"position",r,void 0,i,n)}function qgt(e,t,n,i){let r=t.viewFrom;l(r)&&Ee(h,e,"viewFrom",r,void 0,i,n)}function Ygt(e,t,n,i){let r=t.orientation;l(r)&&Ee(Le,e,"orientation",r,void 0,i,n)}function Xgt(e,t,n,i){let r=t.properties;if(l(r)){l(e.properties)||(e.properties=new yu);for(let o in r)if(r.hasOwnProperty(o)){e.properties.hasProperty(o)||e.properties.addProperty(o);let s=r[o];if(Array.isArray(s))for(let a=0,c=s.length;a<c;++a)w8(mEe(s[a]),e.properties,o,s[a],void 0,i,n);else w8(mEe(s),e.properties,o,s,void 0,i,n)}}}function I8(e,t,n,i,r,o,s){let a=n.map(function(c){return sR(r,c)});if(l(i)){i=zo(i);let c=e[t];if(!(c instanceof s)){let u=new s;u.intervals.addInterval(Tee(c)),e[t]=c=u}i.data=new o(a),c.intervals.addInterval(i)}else e[t]=new o(a)}function xEe(e,t,n,i){let r=n.references;l(r)?I8(e,t,r,n.interval,i,nR,Vl):Ee(Array,e,t,n,void 0,void 0,i)}function TEe(e,t,n,i){if(l(n))if(Array.isArray(n))for(let r=0,o=n.length;r<o;++r)xEe(e,t,n[r],i);else xEe(e,t,n,i)}function EEe(e,t,n,i){let r=n.references;l(r)?I8(e,t,r,n.interval,i,iA,Ec):(l(n.cartesian)?n.array=h.unpackArray(n.cartesian):l(n.cartographicRadians)?n.array=h.fromRadiansArrayHeights(n.cartographicRadians,ee.default):l(n.cartographicDegrees)&&(n.array=h.fromDegreesArrayHeights(n.cartographicDegrees,ee.default)),l(n.array)&&Ee(Array,e,t,n,void 0,void 0,i))}function lR(e,t,n,i){if(l(n))if(Array.isArray(n))for(let r=0,o=n.length;r<o;++r)EEe(e,t,n[r],i);else EEe(e,t,n,i)}function Kgt(e){return h.unpackArray(e)}function $gt(e){return h.fromRadiansArrayHeights(e,ee.default)}function Jgt(e){return h.fromDegreesArrayHeights(e,ee.default)}function CEe(e,t,n,i){let r=n.references;if(l(r)){let o=r.map(function(s){let a={};return I8(a,"positions",s,n.interval,i,iA,Ec),a.positions});e[t]=new iA(o)}else l(n.cartesian)?n.array=n.cartesian.map(Kgt):l(n.cartographicRadians)?n.array=n.cartographicRadians.map($gt):l(n.cartographicDegrees)&&(n.array=n.cartographicDegrees.map(Jgt)),l(n.array)&&Ee(Array,e,t,n,void 0,void 0,i)}function Zgt(e,t,n,i){if(l(n))if(Array.isArray(n))for(let r=0,o=n.length;r<o;++r)CEe(e,t,n[r],i);else CEe(e,t,n,i)}function Qgt(e,t,n,i){if(l(n))if(Array.isArray(n))for(let r=0,o=n.length;r<o;r++)AEe(e,t,n[r],i);else AEe(e,t,n,i)}function e_t(e,t,n,i){let r=t.availability;if(!l(r))return;let o;if(Array.isArray(r))for(let s=0,a=r.length;s<a;++s)l(o)||(o=new Ls),o.addInterval(zo(r[s]));else o=new Ls,o.addInterval(zo(r));e.availability=o}function t_t(e,t,n,i,r){l(t)&&Ee(uA,e,"alignedAxis",t,n,i,r)}function n_t(e,t,n,i){let r=t.billboard;if(!l(r))return;let o=zo(r.interval),s=e.billboard;l(s)||(e.billboard=s=new Il),Ee(Boolean,s,"show",r.show,o,i,n),Ee(Image,s,"image",r.image,o,i,n),Ee(Number,s,"scale",r.scale,o,i,n),Ee(U,s,"pixelOffset",r.pixelOffset,o,i,n),Ee(h,s,"eyeOffset",r.eyeOffset,o,i,n),Ee(Hi,s,"horizontalOrigin",r.horizontalOrigin,o,i,n),Ee(qn,s,"verticalOrigin",r.verticalOrigin,o,i,n),Ee(We,s,"heightReference",r.heightReference,o,i,n),Ee(z,s,"color",r.color,o,i,n),Ee(Kh,s,"rotation",r.rotation,o,i,n),t_t(s,r.alignedAxis,o,i,n),Ee(Boolean,s,"sizeInMeters",r.sizeInMeters,o,i,n),Ee(Number,s,"width",r.width,o,i,n),Ee(Number,s,"height",r.height,o,i,n),Ee(qt,s,"scaleByDistance",r.scaleByDistance,o,i,n),Ee(qt,s,"translucencyByDistance",r.translucencyByDistance,o,i,n),Ee(qt,s,"pixelOffsetScaleByDistance",r.pixelOffsetScaleByDistance,o,i,n),Ee(et,s,"imageSubRegion",r.imageSubRegion,o,i,n),Ee(Gt,s,"distanceDisplayCondition",r.distanceDisplayCondition,o,i,n),Ee(Number,s,"disableDepthTestDistance",r.disableDepthTestDistance,o,i,n)}function i_t(e,t,n,i){let r=t.box;if(!l(r))return;let o=zo(r.interval),s=e.box;l(s)||(e.box=s=new cC),Ee(Boolean,s,"show",r.show,o,i,n),Ee(h,s,"dimensions",r.dimensions,o,i,n),Ee(We,s,"heightReference",r.heightReference,o,i,n),Ee(Boolean,s,"fill",r.fill,o,i,n),vf(s,"material",r.material,o,i,n),Ee(Boolean,s,"outline",r.outline,o,i,n),Ee(z,s,"outlineColor",r.outlineColor,o,i,n),Ee(Number,s,"outlineWidth",r.outlineWidth,o,i,n),Ee(Dn,s,"shadows",r.shadows,o,i,n),Ee(Gt,s,"distanceDisplayCondition",r.distanceDisplayCondition,o,i,n)}function r_t(e,t,n,i){let r=t.corridor;if(!l(r))return;let o=zo(r.interval),s=e.corridor;l(s)||(e.corridor=s=new uC),Ee(Boolean,s,"show",r.show,o,i,n),lR(s,"positions",r.positions,n),Ee(Number,s,"width",r.width,o,i,n),Ee(Number,s,"height",r.height,o,i,n),Ee(We,s,"heightReference",r.heightReference,o,i,n),Ee(Number,s,"extrudedHeight",r.extrudedHeight,o,i,n),Ee(We,s,"extrudedHeightReference",r.extrudedHeightReference,o,i,n),Ee(ur,s,"cornerType",r.cornerType,o,i,n),Ee(Number,s,"granularity",r.granularity,o,i,n),Ee(Boolean,s,"fill",r.fill,o,i,n),vf(s,"material",r.material,o,i,n),Ee(Boolean,s,"outline",r.outline,o,i,n),Ee(z,s,"outlineColor",r.outlineColor,o,i,n),Ee(Number,s,"outlineWidth",r.outlineWidth,o,i,n),Ee(Dn,s,"shadows",r.shadows,o,i,n),Ee(Gt,s,"distanceDisplayCondition",r.distanceDisplayCondition,o,i,n),Ee(ei,s,"classificationType",r.classificationType,o,i,n),Ee(Number,s,"zIndex",r.zIndex,o,i,n)}function o_t(e,t,n,i){let r=t.cylinder;if(!l(r))return;let o=zo(r.interval),s=e.cylinder;l(s)||(e.cylinder=s=new fC),Ee(Boolean,s,"show",r.show,o,i,n),Ee(Number,s,"length",r.length,o,i,n),Ee(Number,s,"topRadius",r.topRadius,o,i,n),Ee(Number,s,"bottomRadius",r.bottomRadius,o,i,n),Ee(We,s,"heightReference",r.heightReference,o,i,n),Ee(Boolean,s,"fill",r.fill,o,i,n),vf(s,"material",r.material,o,i,n),Ee(Boolean,s,"outline",r.outline,o,i,n),Ee(z,s,"outlineColor",r.outlineColor,o,i,n),Ee(Number,s,"outlineWidth",r.outlineWidth,o,i,n),Ee(Number,s,"numberOfVerticalLines",r.numberOfVerticalLines,o,i,n),Ee(Number,s,"slices",r.slices,o,i,n),Ee(Dn,s,"shadows",r.shadows,o,i,n),Ee(Gt,s,"distanceDisplayCondition",r.distanceDisplayCondition,o,i,n)}function s_t(e,t){let n=e.version;if(l(n)&&typeof n=="string"){let o=n.split(".");if(o.length===2){if(o[0]!=="1")throw new oe("Cesium only supports CZML version 1.");t._version=n}}if(!l(t._version))throw new oe("CZML version information invalid. It is expected to be a property on the document object in the <Major>.<Minor> version format.");let i=t._documentPacket;l(e.name)&&(i.name=e.name);let r=e.clock;if(l(r)){let o=i.clock;l(o)?(o.interval=r.interval??o.interval,o.currentTime=r.currentTime??o.currentTime,o.range=r.range??o.range,o.step=r.step??o.step,o.multiplier=r.multiplier??o.multiplier):i.clock={interval:r.interval,currentTime:r.currentTime,range:r.range,step:r.step,multiplier:r.multiplier}}}function a_t(e,t,n,i){let r=t.ellipse;if(!l(r))return;let o=zo(r.interval),s=e.ellipse;l(s)||(e.ellipse=s=new dC),Ee(Boolean,s,"show",r.show,o,i,n),Ee(Number,s,"semiMajorAxis",r.semiMajorAxis,o,i,n),Ee(Number,s,"semiMinorAxis",r.semiMinorAxis,o,i,n),Ee(Number,s,"height",r.height,o,i,n),Ee(We,s,"heightReference",r.heightReference,o,i,n),Ee(Number,s,"extrudedHeight",r.extrudedHeight,o,i,n),Ee(We,s,"extrudedHeightReference",r.extrudedHeightReference,o,i,n),Ee(Kh,s,"rotation",r.rotation,o,i,n),Ee(Kh,s,"stRotation",r.stRotation,o,i,n),Ee(Number,s,"granularity",r.granularity,o,i,n),Ee(Boolean,s,"fill",r.fill,o,i,n),vf(s,"material",r.material,o,i,n),Ee(Boolean,s,"outline",r.outline,o,i,n),Ee(z,s,"outlineColor",r.outlineColor,o,i,n),Ee(Number,s,"outlineWidth",r.outlineWidth,o,i,n),Ee(Number,s,"numberOfVerticalLines",r.numberOfVerticalLines,o,i,n),Ee(Dn,s,"shadows",r.shadows,o,i,n),Ee(Gt,s,"distanceDisplayCondition",r.distanceDisplayCondition,o,i,n),Ee(ei,s,"classificationType",r.classificationType,o,i,n),Ee(Number,s,"zIndex",r.zIndex,o,i,n)}function c_t(e,t,n,i){let r=t.ellipsoid;if(!l(r))return;let o=zo(r.interval),s=e.ellipsoid;l(s)||(e.ellipsoid=s=new hC),Ee(Boolean,s,"show",r.show,o,i,n),Ee(h,s,"radii",r.radii,o,i,n),Ee(h,s,"innerRadii",r.innerRadii,o,i,n),Ee(Number,s,"minimumClock",r.minimumClock,o,i,n),Ee(Number,s,"maximumClock",r.maximumClock,o,i,n),Ee(Number,s,"minimumCone",r.minimumCone,o,i,n),Ee(Number,s,"maximumCone",r.maximumCone,o,i,n),Ee(We,s,"heightReference",r.heightReference,o,i,n),Ee(Boolean,s,"fill",r.fill,o,i,n),vf(s,"material",r.material,o,i,n),Ee(Boolean,s,"outline",r.outline,o,i,n),Ee(z,s,"outlineColor",r.outlineColor,o,i,n),Ee(Number,s,"outlineWidth",r.outlineWidth,o,i,n),Ee(Number,s,"stackPartitions",r.stackPartitions,o,i,n),Ee(Number,s,"slicePartitions",r.slicePartitions,o,i,n),Ee(Number,s,"subdivisions",r.subdivisions,o,i,n),Ee(Dn,s,"shadows",r.shadows,o,i,n),Ee(Gt,s,"distanceDisplayCondition",r.distanceDisplayCondition,o,i,n)}function l_t(e,t,n,i){let r=t.label;if(!l(r))return;let o=zo(r.interval),s=e.label;l(s)||(e.label=s=new tp),Ee(Boolean,s,"show",r.show,o,i,n),Ee(String,s,"text",r.text,o,i,n),Ee(String,s,"font",r.font,o,i,n),Ee(Io,s,"style",r.style,o,i,n),Ee(Number,s,"scale",r.scale,o,i,n),Ee(Boolean,s,"showBackground",r.showBackground,o,i,n),Ee(z,s,"backgroundColor",r.backgroundColor,o,i,n),Ee(U,s,"backgroundPadding",r.backgroundPadding,o,i,n),Ee(U,s,"pixelOffset",r.pixelOffset,o,i,n),Ee(h,s,"eyeOffset",r.eyeOffset,o,i,n),Ee(Hi,s,"horizontalOrigin",r.horizontalOrigin,o,i,n),Ee(qn,s,"verticalOrigin",r.verticalOrigin,o,i,n),Ee(We,s,"heightReference",r.heightReference,o,i,n),Ee(z,s,"fillColor",r.fillColor,o,i,n),Ee(z,s,"outlineColor",r.outlineColor,o,i,n),Ee(Number,s,"outlineWidth",r.outlineWidth,o,i,n),Ee(qt,s,"translucencyByDistance",r.translucencyByDistance,o,i,n),Ee(qt,s,"pixelOffsetScaleByDistance",r.pixelOffsetScaleByDistance,o,i,n),Ee(qt,s,"scaleByDistance",r.scaleByDistance,o,i,n),Ee(Gt,s,"distanceDisplayCondition",r.distanceDisplayCondition,o,i,n),Ee(Number,s,"disableDepthTestDistance",r.disableDepthTestDistance,o,i,n)}function u_t(e,t,n,i){let r=t.model;if(!l(r))return;let o=zo(r.interval),s=e.model;l(s)||(e.model=s=new K_),Ee(Boolean,s,"show",r.show,o,i,n),Ee(cR.default,s,"uri",r.gltf,o,i,n),Ee(Number,s,"scale",r.scale,o,i,n),Ee(Number,s,"minimumPixelSize",r.minimumPixelSize,o,i,n),Ee(Number,s,"maximumScale",r.maximumScale,o,i,n),Ee(Boolean,s,"incrementallyLoadTextures",r.incrementallyLoadTextures,o,i,n),Ee(Boolean,s,"runAnimations",r.runAnimations,o,i,n),Ee(Boolean,s,"clampAnimations",r.clampAnimations,o,i,n),Ee(Dn,s,"shadows",r.shadows,o,i,n),Ee(We,s,"heightReference",r.heightReference,o,i,n),Ee(z,s,"silhouetteColor",r.silhouetteColor,o,i,n),Ee(Number,s,"silhouetteSize",r.silhouetteSize,o,i,n),Ee(z,s,"color",r.color,o,i,n),Ee(Nl,s,"colorBlendMode",r.colorBlendMode,o,i,n),Ee(Number,s,"colorBlendAmount",r.colorBlendAmount,o,i,n),Ee(Gt,s,"distanceDisplayCondition",r.distanceDisplayCondition,o,i,n);let a,c,u=r.nodeTransformations;if(l(u))if(Array.isArray(u))for(a=0,c=u.length;a<c;++a)vEe(s,u[a],o,i,n);else vEe(s,u,o,i,n);let f=r.articulations;if(l(f))if(Array.isArray(f))for(a=0,c=f.length;a<c;++a)SEe(s,f[a],o,i,n);else SEe(s,f,o,i,n)}function vEe(e,t,n,i,r){let o=zo(t.interval);l(n)&&(l(o)?o=Cn.intersect(o,n,Yx):o=n);let s=e.nodeTransformations,a=Object.keys(t);for(let c=0,u=a.length;c<u;++c){let f=a[c];if(f==="interval")continue;let d=t[f];if(!l(d))continue;l(s)||(e.nodeTransformations=s=new yu),s.hasProperty(f)||s.addProperty(f);let p=s[f];l(p)||(s[f]=p=new mC),Ee(h,p,"translation",d.translation,o,i,r),Ee(Le,p,"rotation",d.rotation,o,i,r),Ee(h,p,"scale",d.scale,o,i,r)}}function SEe(e,t,n,i,r){let o=zo(t.interval);l(n)&&(l(o)?o=Cn.intersect(o,n,Yx):o=n);let s=e.articulations,a=Object.keys(t);for(let c=0,u=a.length;c<u;++c){let f=a[c];if(f==="interval")continue;let d=t[f];l(d)&&(l(s)||(e.articulations=s=new yu),s.hasProperty(f)||s.addProperty(f),Ee(Number,s,f,d,o,i,r))}}function f_t(e,t,n,i){let r=t.path;if(!l(r))return;let o=zo(r.interval),s=e.path;l(s)||(e.path=s=new $_),Ee(Boolean,s,"show",r.show,o,i,n),Ee(Number,s,"leadTime",r.leadTime,o,i,n),Ee(Number,s,"trailTime",r.trailTime,o,i,n),Ee(Number,s,"width",r.width,o,i,n),Ee(Number,s,"resolution",r.resolution,o,i,n),vf(s,"material",r.material,o,i,n),Ee(Gt,s,"distanceDisplayCondition",r.distanceDisplayCondition,o,i,n),Ee(String,s,"relativeTo",r.relativeTo,o,i,n),Ee(Og,s,"materialMode",r.materialMode,o,i,n)}function d_t(e,t,n,i){let r=t.point;if(!l(r))return;let o=zo(r.interval),s=e.point;l(s)||(e.point=s=new gC),Ee(Boolean,s,"show",r.show,o,i,n),Ee(Number,s,"pixelSize",r.pixelSize,o,i,n),Ee(We,s,"heightReference",r.heightReference,o,i,n),Ee(z,s,"color",r.color,o,i,n),Ee(z,s,"outlineColor",r.outlineColor,o,i,n),Ee(Number,s,"outlineWidth",r.outlineWidth,o,i,n),Ee(qt,s,"scaleByDistance",r.scaleByDistance,o,i,n),Ee(qt,s,"translucencyByDistance",r.translucencyByDistance,o,i,n),Ee(Gt,s,"distanceDisplayCondition",r.distanceDisplayCondition,o,i,n),Ee(Number,s,"disableDepthTestDistance",r.disableDepthTestDistance,o,i,n)}function aR(e){this.polygon=e,this._definitionChanged=new be}Object.defineProperties(aR.prototype,{isConstant:{get:function(){let e=this.polygon._positions,t=this.polygon._holes;return(!l(e)||e.isConstant)&&(!l(t)||t.isConstant)}},definitionChanged:{get:function(){return this._definitionChanged}}});aR.prototype.getValue=function(e,t){let n;l(this.polygon._positions)&&(n=this.polygon._positions.getValue(e));let i;return l(this.polygon._holes)&&(i=this.polygon._holes.getValue(e),l(i)&&(i=i.map(function(r){return new Hc(r)}))),l(t)?(t.positions=n,t.holes=i,t):new Hc(n,i)};aR.prototype.equals=function(e){return this===e||e instanceof aR&&X.equals(this.polygon._positions,e.polygon._positions)&&X.equals(this.polygon._holes,e.polygon._holes)};function h_t(e,t,n,i){let r=t.polygon;if(!l(r))return;let o=zo(r.interval),s=e.polygon;l(s)||(e.polygon=s=new np),Ee(Boolean,s,"show",r.show,o,i,n),lR(s,"_positions",r.positions,n),Zgt(s,"_holes",r.holes,n),(l(s._positions)||l(s._holes))&&(s.hierarchy=new aR(s)),Ee(Number,s,"height",r.height,o,i,n),Ee(We,s,"heightReference",r.heightReference,o,i,n),Ee(Number,s,"extrudedHeight",r.extrudedHeight,o,i,n),Ee(We,s,"extrudedHeightReference",r.extrudedHeightReference,o,i,n),Ee(Kh,s,"stRotation",r.stRotation,o,i,n),Ee(Number,s,"granularity",r.granularity,o,i,n),Ee(Boolean,s,"fill",r.fill,o,i,n),vf(s,"material",r.material,o,i,n),Ee(Boolean,s,"outline",r.outline,o,i,n),Ee(z,s,"outlineColor",r.outlineColor,o,i,n),Ee(Number,s,"outlineWidth",r.outlineWidth,o,i,n),Ee(Boolean,s,"perPositionHeight",r.perPositionHeight,o,i,n),Ee(Boolean,s,"closeTop",r.closeTop,o,i,n),Ee(Boolean,s,"closeBottom",r.closeBottom,o,i,n),Ee(ln,s,"arcType",r.arcType,o,i,n),Ee(Dn,s,"shadows",r.shadows,o,i,n),Ee(Gt,s,"distanceDisplayCondition",r.distanceDisplayCondition,o,i,n),Ee(ei,s,"classificationType",r.classificationType,o,i,n),Ee(Number,s,"zIndex",r.zIndex,o,i,n)}function m_t(e){return e?ln.GEODESIC:ln.NONE}function p_t(e,t,n,i){let r=t.polyline;if(!l(r))return;let o=zo(r.interval),s=e.polyline;if(l(s)||(e.polyline=s=new Rl),Ee(Boolean,s,"show",r.show,o,i,n),lR(s,"positions",r.positions,n),Ee(Number,s,"width",r.width,o,i,n),Ee(Number,s,"granularity",r.granularity,o,i,n),vf(s,"material",r.material,o,i,n),vf(s,"depthFailMaterial",r.depthFailMaterial,o,i,n),Ee(ln,s,"arcType",r.arcType,o,i,n),Ee(Boolean,s,"clampToGround",r.clampToGround,o,i,n),Ee(Dn,s,"shadows",r.shadows,o,i,n),Ee(Gt,s,"distanceDisplayCondition",r.distanceDisplayCondition,o,i,n),Ee(ei,s,"classificationType",r.classificationType,o,i,n),Ee(Number,s,"zIndex",r.zIndex,o,i,n),l(r.followSurface)&&!l(r.arcType)){let a={};Ee(Boolean,a,"followSurface",r.followSurface,o,i,n),s.arcType=Ogt(a.followSurface,m_t)}}function g_t(e,t,n,i){let r=t.polylineVolume;if(!l(r))return;let o=zo(r.interval),s=e.polylineVolume;l(s)||(e.polylineVolume=s=new _C),lR(s,"positions",r.positions,n),Qgt(s,"shape",r.shape,n),Ee(Boolean,s,"show",r.show,o,i,n),Ee(ur,s,"cornerType",r.cornerType,o,i,n),Ee(Boolean,s,"fill",r.fill,o,i,n),vf(s,"material",r.material,o,i,n),Ee(Boolean,s,"outline",r.outline,o,i,n),Ee(z,s,"outlineColor",r.outlineColor,o,i,n),Ee(Number,s,"outlineWidth",r.outlineWidth,o,i,n),Ee(Number,s,"granularity",r.granularity,o,i,n),Ee(Dn,s,"shadows",r.shadows,o,i,n),Ee(Gt,s,"distanceDisplayCondition",r.distanceDisplayCondition,o,i,n)}function __t(e,t,n,i){let r=t.rectangle;if(!l(r))return;let o=zo(r.interval),s=e.rectangle;l(s)||(e.rectangle=s=new ip),Ee(Boolean,s,"show",r.show,o,i,n),Ee(ie,s,"coordinates",r.coordinates,o,i,n),Ee(Number,s,"height",r.height,o,i,n),Ee(We,s,"heightReference",r.heightReference,o,i,n),Ee(Number,s,"extrudedHeight",r.extrudedHeight,o,i,n),Ee(We,s,"extrudedHeightReference",r.extrudedHeightReference,o,i,n),Ee(Kh,s,"rotation",r.rotation,o,i,n),Ee(Kh,s,"stRotation",r.stRotation,o,i,n),Ee(Number,s,"granularity",r.granularity,o,i,n),Ee(Boolean,s,"fill",r.fill,o,i,n),vf(s,"material",r.material,o,i,n),Ee(Boolean,s,"outline",r.outline,o,i,n),Ee(z,s,"outlineColor",r.outlineColor,o,i,n),Ee(Number,s,"outlineWidth",r.outlineWidth,o,i,n),Ee(Dn,s,"shadows",r.shadows,o,i,n),Ee(Gt,s,"distanceDisplayCondition",r.distanceDisplayCondition,o,i,n),Ee(ei,s,"classificationType",r.classificationType,o,i,n),Ee(Number,s,"zIndex",r.zIndex,o,i,n)}function y_t(e,t,n,i){let r=t.tileset;if(!l(r))return;let o=zo(r.interval),s=e.tileset;l(s)||(e.tileset=s=new pC),Ee(Boolean,s,"show",r.show,o,i,n),Ee(cR.default,s,"uri",r.uri,o,i,n),Ee(Number,s,"maximumScreenSpaceError",r.maximumScreenSpaceError,o,i,n)}function A_t(e,t,n,i){let r=t.wall;if(!l(r))return;let o=zo(r.interval),s=e.wall;l(s)||(e.wall=s=new J_),Ee(Boolean,s,"show",r.show,o,i,n),lR(s,"positions",r.positions,n),TEe(s,"minimumHeights",r.minimumHeights,n),TEe(s,"maximumHeights",r.maximumHeights,n),Ee(Number,s,"granularity",r.granularity,o,i,n),Ee(Boolean,s,"fill",r.fill,o,i,n),vf(s,"material",r.material,o,i,n),Ee(Boolean,s,"outline",r.outline,o,i,n),Ee(z,s,"outlineColor",r.outlineColor,o,i,n),Ee(Number,s,"outlineWidth",r.outlineWidth,o,i,n),Ee(Dn,s,"shadows",r.shadows,o,i,n),Ee(Gt,s,"distanceDisplayCondition",r.distanceDisplayCondition,o,i,n)}function wEe(e,t,n,i,r){let o=e.id;if(l(o)||(o=Kn()),bee=o,!l(r._version)&&o!=="document")throw new oe("The first CZML packet is required to be the document object.");if(e.delete===!0)t.removeById(o);else if(o==="document")s_t(e,r);else{let s=t.getOrCreateEntity(o),a=e.parent;l(a)&&(s.parent=t.getOrCreateEntity(a));for(let c=n.length-1;c>-1;c--)n[c](s,e,t,i)}bee=void 0}function b_t(e){let t,n=e._documentPacket.clock;if(!l(n)){if(!l(e._clock)){let r=e._entityCollection.computeAvailability();if(!r.start.equals(nt.MINIMUM_VALUE)){let o=r.start,s=r.stop,a=K.secondsDifference(s,o),c=Math.round(a/120);return t=new Np,t.startTime=K.clone(o),t.stopTime=K.clone(s),t.clockRange=Bs.LOOP_STOP,t.multiplier=c,t.currentTime=K.clone(o),t.clockStep=Hr.SYSTEM_CLOCK_MULTIPLIER,e._clock=t,!0}}return!1}l(e._clock)?t=e._clock.clone():(t=new Np,t.startTime=nt.MINIMUM_VALUE.clone(),t.stopTime=nt.MAXIMUM_VALUE.clone(),t.currentTime=nt.MINIMUM_VALUE.clone(),t.clockRange=Bs.LOOP_STOP,t.clockStep=Hr.SYSTEM_CLOCK_MULTIPLIER,t.multiplier=1);let i=zo(n.interval);return l(i)&&(t.startTime=i.start,t.stopTime=i.stop),l(n.currentTime)&&(t.currentTime=K.fromIso8601(n.currentTime)),l(n.range)&&(t.clockRange=Bs[n.range]??Bs.LOOP_STOP),l(n.step)&&(t.clockStep=Hr[n.step]??Hr.SYSTEM_CLOCK_MULTIPLIER),l(n.multiplier)&&(t.multiplier=n.multiplier),t.equals(e._clock)?!1:(e._clock=t.clone(e._clock),!0)}function REe(e,t,n,i){n=n??H.EMPTY_OBJECT;let r=t,o=n.sourceUri,s=n.credit;if(typeof s=="string"&&(s=new It(s)),e._credit=s,typeof t=="string"||t instanceof De){t=De.createIfNeeded(t),r=t.fetchJson(),o=o??t.clone();let a=e._resourceCredits,c=t.credits;if(l(c)){let u=c.length;for(let f=0;f<u;f++)a.push(c[f])}}return o=De.createIfNeeded(o),Fs.setLoading(e,!0),Promise.resolve(r).then(function(a){return x_t(e,a,o,i)}).catch(function(a){return Fs.setLoading(e,!1),e._error.raiseEvent(e,a),console.log(a),Promise.reject(a)})}function x_t(e,t,n,i){Fs.setLoading(e,!0);let r=e._entityCollection;i&&(e._version=void 0,e._documentPacket=new OEe,r.removeAll()),Js._processCzml(t,r,n,void 0,e);let o=b_t(e),s=e._documentPacket;return l(s.name)&&e._name!==s.name?(e._name=s.name,o=!0):!l(e._name)&&l(n)&&(e._name=nA(n.getUrlComponent()),o=!0),Fs.setLoading(e,!1),o&&e._changed.raiseEvent(e),e}function OEe(){this.name=void 0,this.clock=void 0}function Js(e){this._name=e,this._changed=new be,this._error=new be,this._isLoading=!1,this._loading=new be,this._clock=void 0,this._documentPacket=new OEe,this._version=void 0,this._entityCollection=new rc(this),this._entityCluster=new kd,this._credit=void 0,this._resourceCredits=[]}Js.load=function(e,t){return new Js().load(e,t)};Object.defineProperties(Js.prototype,{name:{get:function(){return this._name}},clock:{get:function(){return this._clock}},entities:{get:function(){return this._entityCollection}},isLoading:{get:function(){return this._isLoading}},changedEvent:{get:function(){return this._changed}},errorEvent:{get:function(){return this._error}},loadingEvent:{get:function(){return this._loading}},show:{get:function(){return this._entityCollection.show},set:function(e){this._entityCollection.show=e}},clustering:{get:function(){return this._entityCluster},set:function(e){this._entityCluster=e}},credit:{get:function(){return this._credit}}});Js.updaters=[n_t,i_t,r_t,o_t,a_t,c_t,l_t,u_t,Hgt,Ggt,f_t,d_t,h_t,p_t,g_t,Xgt,__t,Wgt,y_t,qgt,A_t,Ygt,e_t];Js.registerUpdater=function(e){Js.updaters.includes(e)||Js.updaters.push(e)};Js.unregisterUpdater=function(e){if(Js.updaters.includes(e)){let t=Js.updaters.indexOf(e);Js.updaters.splice(t,1)}};Js.prototype.process=function(e,t){return REe(this,e,t,!1)};Js.prototype.load=function(e,t){return REe(this,e,t,!0)};Js.prototype.update=function(e){return!0};Js.processPacketData=Ee;Js.processPositionPacketData=DEe;Js.processMaterialPacketData=vf;Js._processCzml=function(e,t,n,i,r){if(i=i??Js.updaters,Array.isArray(e))for(let o=0,s=e.length;o<s;++o)wEe(e[o],t,i,n,r);else wEe(e,t,i,n,r)};var P8=Js;function Wl(){this._dataSources=[],this._dataSourceAdded=new be,this._dataSourceRemoved=new be,this._dataSourceMoved=new be}Object.defineProperties(Wl.prototype,{length:{get:function(){return this._dataSources.length}},dataSourceAdded:{get:function(){return this._dataSourceAdded}},dataSourceRemoved:{get:function(){return this._dataSourceRemoved}},dataSourceMoved:{get:function(){return this._dataSourceMoved}}});Wl.prototype.add=function(e){let t=this,n=this._dataSources;return Promise.resolve(e).then(function(i){return n===t._dataSources&&(t._dataSources.push(i),t._dataSourceAdded.raiseEvent(t,i)),i})};Wl.prototype.remove=function(e,t){t=t??!1;let n=this._dataSources.indexOf(e);return n!==-1?(this._dataSources.splice(n,1),this._dataSourceRemoved.raiseEvent(this,e),t&&typeof e.destroy=="function"&&e.destroy(),!0):!1};Wl.prototype.removeAll=function(e){e=e??!1;let t=this._dataSources;for(let n=0,i=t.length;n<i;++n){let r=t[n];this._dataSourceRemoved.raiseEvent(this,r),e&&typeof r.destroy=="function"&&r.destroy()}this._dataSources=[]};Wl.prototype.contains=function(e){return this.indexOf(e)!==-1};Wl.prototype.indexOf=function(e){return this._dataSources.indexOf(e)};Wl.prototype.get=function(e){return this._dataSources[e]};Wl.prototype.getByName=function(e){return this._dataSources.filter(function(t){return t.name===e})};function D8(e,t){return e.indexOf(t)}function MEe(e,t,n){let i=e._dataSources,r=i.length-1;if(t=P.clamp(t,0,r),n=P.clamp(n,0,r),t===n)return;let o=i[t];i[t]=i[n],i[n]=o,e.dataSourceMoved.raiseEvent(o,n,t)}Wl.prototype.raise=function(e){let t=D8(this._dataSources,e);MEe(this,t,t+1)};Wl.prototype.lower=function(e){let t=D8(this._dataSources,e);MEe(this,t,t-1)};Wl.prototype.raiseToTop=function(e){let t=D8(this._dataSources,e);t!==this._dataSources.length-1&&(this._dataSources.splice(t,1),this._dataSources.push(e),this.dataSourceMoved.raiseEvent(e,this._dataSources.length-1,t))};Wl.prototype.lowerToBottom=function(e){let t=D8(this._dataSources,e);t!==0&&(this._dataSources.splice(t,1),this._dataSources.splice(0,0,e),this.dataSourceMoved.raiseEvent(e,0,t))};Wl.prototype.isDestroyed=function(){return!1};Wl.prototype.destroy=function(){return this.removeAll(!0),le(this)};var R8=Wl;function sc(e){e=e??H.EMPTY_OBJECT,this._primitives=[],this._guid=Kn(),this._primitiveAdded=new be,this._primitiveRemoved=new be,this._zIndex=void 0,this.show=e.show??!0,this.destroyPrimitives=e.destroyPrimitives??!0,this._countReferences=e.countReferences??!1}Object.defineProperties(sc.prototype,{length:{get:function(){return this._primitives.length}},primitiveAdded:{get:function(){return this._primitiveAdded}},primitiveRemoved:{get:function(){return this._primitiveRemoved}}});sc.prototype.add=function(e,t){let n=l(t),i=e._external=e._external||{},r=i._composites=i._composites||{};return r[this._guid]={collection:this},n?this._primitives.splice(t,0,e):this._primitives.push(e),this._countReferences&&(l(i._referenceCount)?++i._referenceCount:i._referenceCount=1),this._primitiveAdded.raiseEvent(e),e};sc.prototype.remove=function(e){if(this.contains(e)){let t=this._primitives.indexOf(e);if(t!==-1)return this._primitives.splice(t,1),delete e._external._composites[this._guid],this._countReferences&&e._external._referenceCount--,this.destroyPrimitives&&(!this._countReferences||e._external._referenceCount<=0)&&e.destroy(),this._primitiveRemoved.raiseEvent(e),!0}return!1};sc.prototype.removeAndDestroy=function(e){let t=this.remove(e);return t&&!this.destroyPrimitives&&e.destroy(),t};sc.prototype.removeAll=function(){let e=this._primitives,t=e.length;for(let n=0;n<t;++n){let i=e[n];delete i._external._composites[this._guid],this._countReferences&&i._external._referenceCount--,this.destroyPrimitives&&(!this._countReferences||i._external._referenceCount<=0)&&i.destroy(),this._primitiveRemoved.raiseEvent(i)}this._primitives=[]};sc.prototype.contains=function(e){return!!(l(e)&&e._external&&e._external._composites&&e._external._composites[this._guid])};function O8(e,t){return e._primitives.indexOf(t)}sc.prototype.raise=function(e){if(l(e)){let t=O8(this,e),n=this._primitives;if(t!==n.length-1){let i=n[t];n[t]=n[t+1],n[t+1]=i}}};sc.prototype.raiseToTop=function(e){if(l(e)){let t=O8(this,e),n=this._primitives;t!==n.length-1&&(n.splice(t,1),n.push(e))}};sc.prototype.lower=function(e){if(l(e)){let t=O8(this,e),n=this._primitives;if(t!==0){let i=n[t];n[t]=n[t-1],n[t-1]=i}}};sc.prototype.lowerToBottom=function(e){if(l(e)){let t=O8(this,e),n=this._primitives;t!==0&&(n.splice(t,1),n.unshift(e))}};sc.prototype.get=function(e){return this._primitives[e]};sc.prototype.update=function(e){if(!this.show)return;let t=this._primitives;for(let n=0;n<t.length;++n)t[n].update(e)};sc.prototype.prePassesUpdate=function(e){let t=this._primitives;for(let n=0;n<t.length;++n){let i=t[n];l(i.prePassesUpdate)&&i.prePassesUpdate(e)}};sc.prototype.updateForPass=function(e,t){let n=this._primitives;for(let i=0;i<n.length;++i){let r=n[i];l(r.updateForPass)&&r.updateForPass(e,t)}};sc.prototype.postPassesUpdate=function(e){let t=this._primitives;for(let n=0;n<t.length;++n){let i=t[n];l(i.postPassesUpdate)&&i.postPassesUpdate(e)}};sc.prototype.isDestroyed=function(){return!1};sc.prototype.destroy=function(){return this.removeAll(),le(this)};var ql=sc;function Fp(){this._length=0,this._collections={},this._collectionsArray=[],this.show=!0}Object.defineProperties(Fp.prototype,{length:{get:function(){return this._length}}});Fp.prototype.add=function(e,t){t=t??0;let n=this._collections[t];if(!l(n)){n=new ql({destroyPrimitives:!1}),n._zIndex=t,this._collections[t]=n;let i=this._collectionsArray,r=0;for(;r<i.length&&i[r]._zIndex<t;)r++;i.splice(r,0,n)}return n.add(e),this._length++,e._zIndex=t,e};Fp.prototype.set=function(e,t){return t===e._zIndex||(this.remove(e,!0),this.add(e,t)),e};Fp.prototype.remove=function(e,t){if(this.contains(e)){let n=e._zIndex,i=this._collections[n],r;return t?r=i.remove(e):r=i.removeAndDestroy(e),r&&this._length--,i.length===0&&(this._collectionsArray.splice(this._collectionsArray.indexOf(i),1),this._collections[n]=void 0,i.destroy()),r}return!1};Fp.prototype.removeAll=function(){let e=this._collectionsArray;for(let t=0;t<e.length;t++){let n=e[t];n.destroyPrimitives=!0,n.destroy()}this._collections={},this._collectionsArray=[],this._length=0};Fp.prototype.contains=function(e){if(!l(e))return!1;let t=this._collections[e._zIndex];return l(t)&&t.contains(e)};Fp.prototype.update=function(e){if(!this.show)return;let t=this._collectionsArray;for(let n=0;n<t.length;n++)t[n].update(e)};Fp.prototype.isDestroyed=function(){return!1};Fp.prototype.destroy=function(){return this.removeAll(),le(this)};var M8=Fp;function AS(e,t){this._primitives=e,this._orderedGroundPrimitives=t,this._dynamicUpdaters=new zt}AS.prototype.add=function(e,t){this._dynamicUpdaters.set(t.id,t.createDynamicUpdater(this._primitives,this._orderedGroundPrimitives))};AS.prototype.remove=function(e){let t=e.id,n=this._dynamicUpdaters.get(t);l(n)&&(this._dynamicUpdaters.remove(t),n.destroy())};AS.prototype.update=function(e){let t=this._dynamicUpdaters.values;for(let n=0,i=t.length;n<i;n++)t[n].update(e);return!0};AS.prototype.removeAllPrimitives=function(){let e=this._dynamicUpdaters.values;for(let t=0,n=e.length;t<n;t++)e[t].destroy();this._dynamicUpdaters.removeAll()};AS.prototype.getBoundingSphere=function(e,t){return e=this._dynamicUpdaters.get(e.id),l(e)&&l(e.getBoundingSphere)?e.getBoundingSphere(t):Pt.FAILED};var bS=AS;var Cee={},N8=new h,NEe=new h,LEe=new Le,FEe=new $;function xS(e,t,n,i,r,o,s,a,c,u){let f=e+t;h.multiplyByScalar(i,Math.cos(f),N8),h.multiplyByScalar(n,Math.sin(f),NEe),h.add(N8,NEe,N8);let d=Math.cos(e);d=d*d;let p=Math.sin(e);p=p*p;let m=o/Math.sqrt(s*d+r*p)/a;return Le.fromAxisAngle(N8,m,LEe),$.fromQuaternion(LEe,FEe),$.multiplyByVector(FEe,c,u),h.normalize(u,u),h.multiplyByScalar(u,a,u),u}var BEe=new h,kEe=new h,Eee=new h,T_t=new h;Cee.raisePositionsToHeight=function(e,t,n){let i=t.ellipsoid,r=t.height,o=t.extrudedHeight,s=n?e.length/3*2:e.length/3,a=new Float64Array(s*3),c=e.length,u=n?c:0;for(let f=0;f<c;f+=3){let d=f+1,p=f+2,g=h.fromArray(e,f,BEe);i.scaleToGeodeticSurface(g,g);let m=h.clone(g,kEe),y=i.geodeticSurfaceNormal(g,T_t),A=h.multiplyByScalar(y,r,Eee);h.add(g,A,g),n&&(h.multiplyByScalar(y,o,A),h.add(m,A,m),a[f+u]=m.x,a[d+u]=m.y,a[p+u]=m.z),a[f]=g.x,a[d]=g.y,a[p]=g.z}return a};var E_t=new h,C_t=new h,v_t=new h;Cee.computeEllipsePositions=function(e,t,n){let i=e.semiMinorAxis,r=e.semiMajorAxis,o=e.rotation,s=e.center,a=e.granularity*8,c=i*i,u=r*r,f=r*i,d=h.magnitude(s),p=h.normalize(s,E_t),g=h.cross(h.UNIT_Z,s,C_t);g=h.normalize(g,g);let m=h.cross(p,g,v_t),y=1+Math.ceil(P.PI_OVER_TWO/a),A=P.PI_OVER_TWO/(y-1),b=P.PI_OVER_TWO-y*A;b<0&&(y-=Math.ceil(Math.abs(b)/A));let x=2*(y*(y+2)),T=t?new Array(x*3):void 0,E=0,v=BEe,S=kEe,I=y*4*3,R=I-1,O=0,L=n?new Array(I):void 0,_,C,w,D,N;for(b=P.PI_OVER_TWO,v=xS(b,o,m,g,c,f,u,d,p,v),t&&(T[E++]=v.x,T[E++]=v.y,T[E++]=v.z),n&&(L[R--]=v.z,L[R--]=v.y,L[R--]=v.x),b=P.PI_OVER_TWO-A,_=1;_<y+1;++_){if(v=xS(b,o,m,g,c,f,u,d,p,v),S=xS(Math.PI-b,o,m,g,c,f,u,d,p,S),t){for(T[E++]=v.x,T[E++]=v.y,T[E++]=v.z,w=2*_+2,C=1;C<w-1;++C)D=C/(w-1),N=h.lerp(v,S,D,Eee),T[E++]=N.x,T[E++]=N.y,T[E++]=N.z;T[E++]=S.x,T[E++]=S.y,T[E++]=S.z}n&&(L[R--]=v.z,L[R--]=v.y,L[R--]=v.x,L[O++]=S.x,L[O++]=S.y,L[O++]=S.z),b=P.PI_OVER_TWO-(_+1)*A}for(_=y;_>1;--_){if(b=P.PI_OVER_TWO-(_-1)*A,v=xS(-b,o,m,g,c,f,u,d,p,v),S=xS(b+Math.PI,o,m,g,c,f,u,d,p,S),t){for(T[E++]=v.x,T[E++]=v.y,T[E++]=v.z,w=2*(_-1)+2,C=1;C<w-1;++C)D=C/(w-1),N=h.lerp(v,S,D,Eee),T[E++]=N.x,T[E++]=N.y,T[E++]=N.z;T[E++]=S.x,T[E++]=S.y,T[E++]=S.z}n&&(L[R--]=v.z,L[R--]=v.y,L[R--]=v.x,L[O++]=S.x,L[O++]=S.y,L[O++]=S.z)}b=P.PI_OVER_TWO,v=xS(-b,o,m,g,c,f,u,d,p,v);let F={};return t&&(T[E++]=v.x,T[E++]=v.y,T[E]=v.z,F.positions=T,F.numPts=y),n&&(L[R--]=v.z,L[R--]=v.y,L[R]=v.x,F.outerPositions=L),F};var Sf=Cee;var TS=new h,vee=new h,See=new h,UEe=new h,ya=new U,zEe=new $,S_t=new $,wee=new Le,VEe=new h,jEe=new h,HEe=new h,B8=new he,GEe=new h,WEe=new U,qEe=new U;function YEe(e,t,n){let i=t.vertexFormat,r=t.center,o=t.semiMajorAxis,s=t.semiMinorAxis,a=t.ellipsoid,c=t.stRotation,u=n?e.length/3*2:e.length/3,f=t.shadowVolume,d=i.st?new Float32Array(u*2):void 0,p=i.normal?new Float32Array(u*3):void 0,g=i.tangent?new Float32Array(u*3):void 0,m=i.bitangent?new Float32Array(u*3):void 0,y=f?new Float32Array(u*3):void 0,A=0,b=VEe,x=jEe,T=HEe,E=new ji(a),v=E.project(a.cartesianToCartographic(r,B8),GEe),S=a.scaleToGeodeticSurface(r,TS);a.geodeticSurfaceNormal(S,S);let I=zEe,R=S_t;if(c!==0){let N=Le.fromAxisAngle(S,c,wee);I=$.fromQuaternion(N,I),N=Le.fromAxisAngle(S,-c,wee),R=$.fromQuaternion(N,R)}else I=$.clone($.IDENTITY,I),R=$.clone($.IDENTITY,R);let O=U.fromElements(Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY,WEe),L=U.fromElements(Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY,qEe),_=e.length,C=n?_:0,w=C/3*2;for(let N=0;N<_;N+=3){let F=N+1,V=N+2,B=h.fromArray(e,N,TS);if(i.st){let j=$.multiplyByVector(I,B,vee),k=E.project(a.cartesianToCartographic(j,B8),See);h.subtract(k,v,k),ya.x=(k.x+o)/(2*o),ya.y=(k.y+s)/(2*s),O.x=Math.min(ya.x,O.x),O.y=Math.min(ya.y,O.y),L.x=Math.max(ya.x,L.x),L.y=Math.max(ya.y,L.y),n&&(d[A+w]=ya.x,d[A+1+w]=ya.y),d[A++]=ya.x,d[A++]=ya.y}(i.normal||i.tangent||i.bitangent||f)&&(b=a.geodeticSurfaceNormal(B,b),f&&(y[N+C]=-b.x,y[F+C]=-b.y,y[V+C]=-b.z),(i.normal||i.tangent||i.bitangent)&&((i.tangent||i.bitangent)&&(x=h.normalize(h.cross(h.UNIT_Z,b,x),x),$.multiplyByVector(R,x,x)),i.normal&&(p[N]=b.x,p[F]=b.y,p[V]=b.z,n&&(p[N+C]=-b.x,p[F+C]=-b.y,p[V+C]=-b.z)),i.tangent&&(g[N]=x.x,g[F]=x.y,g[V]=x.z,n&&(g[N+C]=-x.x,g[F+C]=-x.y,g[V+C]=-x.z)),i.bitangent&&(T=h.normalize(h.cross(b,x,T),T),m[N]=T.x,m[F]=T.y,m[V]=T.z,n&&(m[N+C]=T.x,m[F+C]=T.y,m[V+C]=T.z))))}if(i.st){_=d.length;for(let N=0;N<_;N+=2)d[N]=(d[N]-O.x)/(L.x-O.x),d[N+1]=(d[N+1]-O.y)/(L.y-O.y)}let D=new En;if(i.position){let N=Sf.raisePositionsToHeight(e,t,n);D.position=new Ne({componentDatatype:Y.DOUBLE,componentsPerAttribute:3,values:N})}if(i.st&&(D.st=new Ne({componentDatatype:Y.FLOAT,componentsPerAttribute:2,values:d})),i.normal&&(D.normal=new Ne({componentDatatype:Y.FLOAT,componentsPerAttribute:3,values:p})),i.tangent&&(D.tangent=new Ne({componentDatatype:Y.FLOAT,componentsPerAttribute:3,values:g})),i.bitangent&&(D.bitangent=new Ne({componentDatatype:Y.FLOAT,componentsPerAttribute:3,values:m})),f&&(D.extrudeDirection=new Ne({componentDatatype:Y.FLOAT,componentsPerAttribute:3,values:y})),n&&l(t.offsetAttribute)){let N=new Uint8Array(u);if(t.offsetAttribute===pn.TOP)N=N.fill(1,0,u/2);else{let F=t.offsetAttribute===pn.NONE?0:1;N=N.fill(F)}D.applyOffset=new Ne({componentDatatype:Y.UNSIGNED_BYTE,componentsPerAttribute:1,values:N})}return D}function XEe(e){let t=new Array(12*(e*(e+1))-6),n=0,i,r,o,s,a;for(i=0,o=1,s=0;s<3;s++)t[n++]=o++,t[n++]=i,t[n++]=o;for(s=2;s<e+1;++s){for(o=s*(s+1)-1,i=(s-1)*s-1,t[n++]=o++,t[n++]=i,t[n++]=o,r=2*s,a=0;a<r-1;++a)t[n++]=o,t[n++]=i++,t[n++]=i,t[n++]=o++,t[n++]=i,t[n++]=o;t[n++]=o++,t[n++]=i,t[n++]=o}for(r=e*2,++o,++i,s=0;s<r-1;++s)t[n++]=o,t[n++]=i++,t[n++]=i,t[n++]=o++,t[n++]=i,t[n++]=o;for(t[n++]=o,t[n++]=i++,t[n++]=i,t[n++]=o++,t[n++]=i++,t[n++]=i,++i,s=e-1;s>1;--s){for(t[n++]=i++,t[n++]=i,t[n++]=o,r=2*s,a=0;a<r-1;++a)t[n++]=o,t[n++]=i++,t[n++]=i,t[n++]=o++,t[n++]=i,t[n++]=o;t[n++]=i++,t[n++]=i++,t[n++]=o++}for(s=0;s<3;s++)t[n++]=i++,t[n++]=i,t[n++]=o;return t}var Xx=new h;function w_t(e){let t=e.center;Xx=h.multiplyByScalar(e.ellipsoid.geodeticSurfaceNormal(t,Xx),e.height,Xx),Xx=h.add(t,Xx,Xx);let n=new ue(Xx,e.semiMajorAxis),i=Sf.computeEllipsePositions(e,!0,!1),r=i.positions,o=i.numPts,s=YEe(r,e,!1),a=XEe(o);return a=je.createTypedArray(r.length/3,a),{boundingSphere:n,attributes:s,indices:a}}function I_t(e,t){let n=t.vertexFormat,i=t.center,r=t.semiMajorAxis,o=t.semiMinorAxis,s=t.ellipsoid,a=t.height,c=t.extrudedHeight,u=t.stRotation,f=e.length/3*2,d=new Float64Array(f*3),p=n.st?new Float32Array(f*2):void 0,g=n.normal?new Float32Array(f*3):void 0,m=n.tangent?new Float32Array(f*3):void 0,y=n.bitangent?new Float32Array(f*3):void 0,A=t.shadowVolume,b=A?new Float32Array(f*3):void 0,x=0,T=VEe,E=jEe,v=HEe,S=new ji(s),I=S.project(s.cartesianToCartographic(i,B8),GEe),R=s.scaleToGeodeticSurface(i,TS);s.geodeticSurfaceNormal(R,R);let O=Le.fromAxisAngle(R,u,wee),L=$.fromQuaternion(O,zEe),_=U.fromElements(Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY,WEe),C=U.fromElements(Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY,qEe),w=e.length,D=w/3*2;for(let F=0;F<w;F+=3){let V=F+1,B=F+2,j=h.fromArray(e,F,TS),k;if(n.st){let q=$.multiplyByVector(L,j,vee),Q=S.project(s.cartesianToCartographic(q,B8),See);h.subtract(Q,I,Q),ya.x=(Q.x+r)/(2*r),ya.y=(Q.y+o)/(2*o),_.x=Math.min(ya.x,_.x),_.y=Math.min(ya.y,_.y),C.x=Math.max(ya.x,C.x),C.y=Math.max(ya.y,C.y),p[x+D]=ya.x,p[x+1+D]=ya.y,p[x++]=ya.x,p[x++]=ya.y}j=s.scaleToGeodeticSurface(j,j),k=h.clone(j,vee),T=s.geodeticSurfaceNormal(j,T),A&&(b[F+w]=-T.x,b[V+w]=-T.y,b[B+w]=-T.z);let G=h.multiplyByScalar(T,a,UEe);if(j=h.add(j,G,j),G=h.multiplyByScalar(T,c,G),k=h.add(k,G,k),n.position&&(d[F+w]=k.x,d[V+w]=k.y,d[B+w]=k.z,d[F]=j.x,d[V]=j.y,d[B]=j.z),n.normal||n.tangent||n.bitangent){v=h.clone(T,v);let q=h.fromArray(e,(F+3)%w,UEe);h.subtract(q,j,q);let Q=h.subtract(k,j,See);T=h.normalize(h.cross(Q,q,T),T),n.normal&&(g[F]=T.x,g[V]=T.y,g[B]=T.z,g[F+w]=T.x,g[V+w]=T.y,g[B+w]=T.z),n.tangent&&(E=h.normalize(h.cross(v,T,E),E),m[F]=E.x,m[V]=E.y,m[B]=E.z,m[F+w]=E.x,m[F+1+w]=E.y,m[F+2+w]=E.z),n.bitangent&&(y[F]=v.x,y[V]=v.y,y[B]=v.z,y[F+w]=v.x,y[V+w]=v.y,y[B+w]=v.z)}}if(n.st){w=p.length;for(let F=0;F<w;F+=2)p[F]=(p[F]-_.x)/(C.x-_.x),p[F+1]=(p[F+1]-_.y)/(C.y-_.y)}let N=new En;if(n.position&&(N.position=new Ne({componentDatatype:Y.DOUBLE,componentsPerAttribute:3,values:d})),n.st&&(N.st=new Ne({componentDatatype:Y.FLOAT,componentsPerAttribute:2,values:p})),n.normal&&(N.normal=new Ne({componentDatatype:Y.FLOAT,componentsPerAttribute:3,values:g})),n.tangent&&(N.tangent=new Ne({componentDatatype:Y.FLOAT,componentsPerAttribute:3,values:m})),n.bitangent&&(N.bitangent=new Ne({componentDatatype:Y.FLOAT,componentsPerAttribute:3,values:y})),A&&(N.extrudeDirection=new Ne({componentDatatype:Y.FLOAT,componentsPerAttribute:3,values:b})),l(t.offsetAttribute)){let F=new Uint8Array(f);if(t.offsetAttribute===pn.TOP)F=F.fill(1,0,f/2);else{let V=t.offsetAttribute===pn.NONE?0:1;F=F.fill(V)}N.applyOffset=new Ne({componentDatatype:Y.UNSIGNED_BYTE,componentsPerAttribute:1,values:F})}return N}function P_t(e){let t=e.length/3,n=je.createTypedArray(t,t*6),i=0;for(let r=0;r<t;r++){let o=r,s=r+t,a=(o+1)%t,c=a+t;n[i++]=o,n[i++]=s,n[i++]=a,n[i++]=a,n[i++]=s,n[i++]=c}return n}var L8=new ue,F8=new ue;function D_t(e){let t=e.center,n=e.ellipsoid,i=e.semiMajorAxis,r=h.multiplyByScalar(n.geodeticSurfaceNormal(t,TS),e.height,TS);L8.center=h.add(t,r,L8.center),L8.radius=i,r=h.multiplyByScalar(n.geodeticSurfaceNormal(t,r),e.extrudedHeight,r),F8.center=h.add(t,r,F8.center),F8.radius=i;let o=Sf.computeEllipsePositions(e,!0,!0),s=o.positions,a=o.numPts,c=o.outerPositions,u=ue.union(L8,F8),f=YEe(s,e,!0),d=XEe(a),p=d.length;d.length=p*2;let g=s.length/3;for(let E=0;E<p;E+=3)d[E+p]=d[E+2]+g,d[E+1+p]=d[E+1]+g,d[E+2+p]=d[E]+g;let m=je.createTypedArray(g*2/3,d),y=new wt({attributes:f,indices:m,primitiveType:Oe.TRIANGLES}),A=I_t(c,e);d=P_t(c);let b=je.createTypedArray(c.length*2/3,d),x=new wt({attributes:A,indices:b,primitiveType:Oe.TRIANGLES}),T=Wn.combineInstances([new Bt({geometry:y}),new Bt({geometry:x})]);return{boundingSphere:u,attributes:T[0].attributes,indices:T[0].indices}}function KEe(e,t,n,i,r,o,s){let c=Sf.computeEllipsePositions({center:e,semiMajorAxis:t,semiMinorAxis:n,rotation:i,granularity:r},!1,!0).outerPositions,u=c.length/3,f=new Array(u);for(let p=0;p<u;++p)f[p]=h.fromArray(c,p*3);let d=ie.fromCartesianArray(f,o,s);return d.width>P.PI&&(d.north=d.north>0?P.PI_OVER_TWO-P.EPSILON7:d.north,d.south=d.south<0?P.EPSILON7-P.PI_OVER_TWO:d.south,d.east=P.PI,d.west=-P.PI),d}function kp(e){e=e??H.EMPTY_OBJECT;let t=e.center,n=e.ellipsoid??ee.default,i=e.semiMajorAxis,r=e.semiMinorAxis,o=e.granularity??P.RADIANS_PER_DEGREE,s=e.vertexFormat??Be.DEFAULT,a=e.height??0,c=e.extrudedHeight??a;this._center=h.clone(t),this._semiMajorAxis=i,this._semiMinorAxis=r,this._ellipsoid=ee.clone(n),this._rotation=e.rotation??0,this._stRotation=e.stRotation??0,this._height=Math.max(c,a),this._granularity=o,this._vertexFormat=Be.clone(s),this._extrudedHeight=Math.min(c,a),this._shadowVolume=e.shadowVolume??!1,this._workerName="createEllipseGeometry",this._offsetAttribute=e.offsetAttribute,this._rectangle=void 0,this._textureCoordinateRotationPoints=void 0}kp.packedLength=h.packedLength+ee.packedLength+Be.packedLength+9;kp.pack=function(e,t,n){return n=n??0,h.pack(e._center,t,n),n+=h.packedLength,ee.pack(e._ellipsoid,t,n),n+=ee.packedLength,Be.pack(e._vertexFormat,t,n),n+=Be.packedLength,t[n++]=e._semiMajorAxis,t[n++]=e._semiMinorAxis,t[n++]=e._rotation,t[n++]=e._stRotation,t[n++]=e._height,t[n++]=e._granularity,t[n++]=e._extrudedHeight,t[n++]=e._shadowVolume?1:0,t[n]=e._offsetAttribute??-1,t};var $Ee=new h,JEe=new ee,ZEe=new Be,Bp={center:$Ee,ellipsoid:JEe,vertexFormat:ZEe,semiMajorAxis:void 0,semiMinorAxis:void 0,rotation:void 0,stRotation:void 0,height:void 0,granularity:void 0,extrudedHeight:void 0,shadowVolume:void 0,offsetAttribute:void 0};kp.unpack=function(e,t,n){t=t??0;let i=h.unpack(e,t,$Ee);t+=h.packedLength;let r=ee.unpack(e,t,JEe);t+=ee.packedLength;let o=Be.unpack(e,t,ZEe);t+=Be.packedLength;let s=e[t++],a=e[t++],c=e[t++],u=e[t++],f=e[t++],d=e[t++],p=e[t++],g=e[t++]===1,m=e[t];return l(n)?(n._center=h.clone(i,n._center),n._ellipsoid=ee.clone(r,n._ellipsoid),n._vertexFormat=Be.clone(o,n._vertexFormat),n._semiMajorAxis=s,n._semiMinorAxis=a,n._rotation=c,n._stRotation=u,n._height=f,n._granularity=d,n._extrudedHeight=p,n._shadowVolume=g,n._offsetAttribute=m===-1?void 0:m,n):(Bp.height=f,Bp.extrudedHeight=p,Bp.granularity=d,Bp.stRotation=u,Bp.rotation=c,Bp.semiMajorAxis=s,Bp.semiMinorAxis=a,Bp.shadowVolume=g,Bp.offsetAttribute=m===-1?void 0:m,new kp(Bp))};kp.computeRectangle=function(e,t){e=e??H.EMPTY_OBJECT;let n=e.center,i=e.ellipsoid??ee.default,r=e.semiMajorAxis,o=e.semiMinorAxis,s=e.granularity??P.RADIANS_PER_DEGREE,a=e.rotation??0;return KEe(n,r,o,a,s,i,t)};kp.createGeometry=function(e){if(e._semiMajorAxis<=0||e._semiMinorAxis<=0)return;let t=e._height,n=e._extrudedHeight,i=!P.equalsEpsilon(t,n,0,P.EPSILON2);e._center=e._ellipsoid.scaleToGeodeticSurface(e._center,e._center);let r={center:e._center,semiMajorAxis:e._semiMajorAxis,semiMinorAxis:e._semiMinorAxis,ellipsoid:e._ellipsoid,rotation:e._rotation,height:t,granularity:e._granularity,vertexFormat:e._vertexFormat,stRotation:e._stRotation},o;if(i)r.extrudedHeight=n,r.shadowVolume=e._shadowVolume,r.offsetAttribute=e._offsetAttribute,o=D_t(r);else if(o=w_t(r),l(e._offsetAttribute)){let s=o.attributes.position.values.length,a=e._offsetAttribute===pn.NONE?0:1,c=new Uint8Array(s/3).fill(a);o.attributes.applyOffset=new Ne({componentDatatype:Y.UNSIGNED_BYTE,componentsPerAttribute:1,values:c})}return new wt({attributes:o.attributes,indices:o.indices,primitiveType:Oe.TRIANGLES,boundingSphere:o.boundingSphere,offsetAttribute:e._offsetAttribute})};kp.createShadowVolume=function(e,t,n){let i=e._granularity,r=e._ellipsoid,o=t(i,r),s=n(i,r);return new kp({center:e._center,semiMajorAxis:e._semiMajorAxis,semiMinorAxis:e._semiMinorAxis,ellipsoid:r,rotation:e._rotation,stRotation:e._stRotation,granularity:i,extrudedHeight:o,height:s,vertexFormat:Be.POSITION_ONLY,shadowVolume:!0})};function R_t(e){let t=-e._stRotation;if(t===0)return[0,0,0,1,1,0];let i=Sf.computeEllipsePositions({center:e._center,semiMajorAxis:e._semiMajorAxis,semiMinorAxis:e._semiMinorAxis,rotation:e._rotation,granularity:e._granularity},!1,!0).outerPositions,r=i.length/3,o=new Array(r);for(let c=0;c<r;++c)o[c]=h.fromArray(i,c*3);let s=e._ellipsoid,a=e.rectangle;return wt._textureCoordinateRotationPoints(o,t,s,a)}Object.defineProperties(kp.prototype,{rectangle:{get:function(){return l(this._rectangle)||(this._rectangle=KEe(this._center,this._semiMajorAxis,this._semiMinorAxis,this._rotation,this._granularity,this._ellipsoid)),this._rectangle}},textureCoordinateRotationPoints:{get:function(){return l(this._textureCoordinateRotationPoints)||(this._textureCoordinateRotationPoints=R_t(this)),this._textureCoordinateRotationPoints}}});var Fu=kp;var QEe=new h,Kx=new h;function O_t(e){let t=e.center;Kx=h.multiplyByScalar(e.ellipsoid.geodeticSurfaceNormal(t,Kx),e.height,Kx),Kx=h.add(t,Kx,Kx);let n=new ue(Kx,e.semiMajorAxis),i=Sf.computeEllipsePositions(e,!1,!0).outerPositions,r=new En({position:new Ne({componentDatatype:Y.DOUBLE,componentsPerAttribute:3,values:Sf.raisePositionsToHeight(i,e,!1)})}),o=i.length/3,s=je.createTypedArray(o,o*2),a=0;for(let c=0;c<o;++c)s[a++]=c,s[a++]=(c+1)%o;return{boundingSphere:n,attributes:r,indices:s}}var k8=new ue,U8=new ue;function M_t(e){let t=e.center,n=e.ellipsoid,i=e.semiMajorAxis,r=h.multiplyByScalar(n.geodeticSurfaceNormal(t,QEe),e.height,QEe);k8.center=h.add(t,r,k8.center),k8.radius=i,r=h.multiplyByScalar(n.geodeticSurfaceNormal(t,r),e.extrudedHeight,r),U8.center=h.add(t,r,U8.center),U8.radius=i;let o=Sf.computeEllipsePositions(e,!1,!0).outerPositions,s=new En({position:new Ne({componentDatatype:Y.DOUBLE,componentsPerAttribute:3,values:Sf.raisePositionsToHeight(o,e,!0)})});o=s.position.values;let a=ue.union(k8,U8),c=o.length/3;if(l(e.offsetAttribute)){let m=new Uint8Array(c);if(e.offsetAttribute===pn.TOP)m=m.fill(1,0,c/2);else{let y=e.offsetAttribute===pn.NONE?0:1;m=m.fill(y)}s.applyOffset=new Ne({componentDatatype:Y.UNSIGNED_BYTE,componentsPerAttribute:1,values:m})}let u=e.numberOfVerticalLines??16;u=P.clamp(u,0,c/2);let f=je.createTypedArray(c,c*2+u*2);c/=2;let d=0,p;for(p=0;p<c;++p)f[d++]=p,f[d++]=(p+1)%c,f[d++]=p+c,f[d++]=(p+1)%c+c;let g;if(u>0){let m=Math.min(u,c);g=Math.round(c/m);let y=Math.min(g*u,c);for(p=0;p<y;p+=g)f[d++]=p,f[d++]=p+c}return{boundingSphere:a,attributes:s,indices:f}}function ES(e){e=e??H.EMPTY_OBJECT;let t=e.center,n=e.ellipsoid??ee.default,i=e.semiMajorAxis,r=e.semiMinorAxis,o=e.granularity??P.RADIANS_PER_DEGREE,s=e.height??0,a=e.extrudedHeight??s;this._center=h.clone(t),this._semiMajorAxis=i,this._semiMinorAxis=r,this._ellipsoid=ee.clone(n),this._rotation=e.rotation??0,this._height=Math.max(a,s),this._granularity=o,this._extrudedHeight=Math.min(a,s),this._numberOfVerticalLines=Math.max(e.numberOfVerticalLines??16,0),this._offsetAttribute=e.offsetAttribute,this._workerName="createEllipseOutlineGeometry"}ES.packedLength=h.packedLength+ee.packedLength+8;ES.pack=function(e,t,n){return n=n??0,h.pack(e._center,t,n),n+=h.packedLength,ee.pack(e._ellipsoid,t,n),n+=ee.packedLength,t[n++]=e._semiMajorAxis,t[n++]=e._semiMinorAxis,t[n++]=e._rotation,t[n++]=e._height,t[n++]=e._granularity,t[n++]=e._extrudedHeight,t[n++]=e._numberOfVerticalLines,t[n]=e._offsetAttribute??-1,t};var eCe=new h,tCe=new ee,Lg={center:eCe,ellipsoid:tCe,semiMajorAxis:void 0,semiMinorAxis:void 0,rotation:void 0,height:void 0,granularity:void 0,extrudedHeight:void 0,numberOfVerticalLines:void 0,offsetAttribute:void 0};ES.unpack=function(e,t,n){t=t??0;let i=h.unpack(e,t,eCe);t+=h.packedLength;let r=ee.unpack(e,t,tCe);t+=ee.packedLength;let o=e[t++],s=e[t++],a=e[t++],c=e[t++],u=e[t++],f=e[t++],d=e[t++],p=e[t];return l(n)?(n._center=h.clone(i,n._center),n._ellipsoid=ee.clone(r,n._ellipsoid),n._semiMajorAxis=o,n._semiMinorAxis=s,n._rotation=a,n._height=c,n._granularity=u,n._extrudedHeight=f,n._numberOfVerticalLines=d,n._offsetAttribute=p===-1?void 0:p,n):(Lg.height=c,Lg.extrudedHeight=f,Lg.granularity=u,Lg.rotation=a,Lg.semiMajorAxis=o,Lg.semiMinorAxis=s,Lg.numberOfVerticalLines=d,Lg.offsetAttribute=p===-1?void 0:p,new ES(Lg))};ES.createGeometry=function(e){if(e._semiMajorAxis<=0||e._semiMinorAxis<=0)return;let t=e._height,n=e._extrudedHeight,i=!P.equalsEpsilon(t,n,0,P.EPSILON2);e._center=e._ellipsoid.scaleToGeodeticSurface(e._center,e._center);let r={center:e._center,semiMajorAxis:e._semiMajorAxis,semiMinorAxis:e._semiMinorAxis,ellipsoid:e._ellipsoid,rotation:e._rotation,height:t,granularity:e._granularity,numberOfVerticalLines:e._numberOfVerticalLines},o;if(i)r.extrudedHeight=n,r.offsetAttribute=e._offsetAttribute,o=M_t(r);else if(o=O_t(r),l(e._offsetAttribute)){let s=o.attributes.position.values.length,a=e._offsetAttribute===pn.NONE?0:1,c=new Uint8Array(s/3).fill(a);o.attributes.applyOffset=new Ne({componentDatatype:Y.UNSIGNED_BYTE,componentsPerAttribute:1,values:c})}return new wt({attributes:o.attributes,indices:o.indices,primitiveType:Oe.LINES,boundingSphere:o.boundingSphere,offsetAttribute:e._offsetAttribute})};var jd=ES;var nCe=new z,iCe=h.ZERO,rCe=new h,oCe=new ie;function N_t(e){this.id=e,this.vertexFormat=void 0,this.center=void 0,this.semiMajorAxis=void 0,this.semiMinorAxis=void 0,this.rotation=void 0,this.height=void 0,this.extrudedHeight=void 0,this.granularity=void 0,this.stRotation=void 0,this.numberOfVerticalLines=void 0,this.offsetAttribute=void 0}function $h(e,t){oi.call(this,{entity:e,scene:t,geometryOptions:new N_t(e),geometryPropertyName:"ellipse",observedPropertyNames:["availability","position","ellipse"]}),this._onEntityPropertyChanged(e,"ellipse",e.ellipse,void 0)}l(Object.create)&&($h.prototype=Object.create(oi.prototype),$h.prototype.constructor=$h);$h.prototype.createFillGeometryInstance=function(e){let t=this._entity,n=t.isAvailable(e),i={show:new Pn(n&&t.isShowing&&this._showProperty.getValue(e)&&this._fillProperty.getValue(e)),distanceDisplayCondition:Qn.fromDistanceDisplayCondition(this._distanceDisplayConditionProperty.getValue(e)),offset:void 0,color:void 0};if(this._materialProperty instanceof Kt){let r;l(this._materialProperty.color)&&(this._materialProperty.color.isConstant||n)&&(r=this._materialProperty.color.getValue(e,nCe)),l(r)||(r=z.WHITE),i.color=Jt.fromColor(r)}return l(this._options.offsetAttribute)&&(i.offset=Er.fromCartesian3(X.getValueOrDefault(this._terrainOffsetProperty,e,iCe,rCe))),new Bt({id:t,geometry:new Fu(this._options),attributes:i})};$h.prototype.createOutlineGeometryInstance=function(e){let t=this._entity,n=t.isAvailable(e),i=X.getValueOrDefault(this._outlineColorProperty,e,z.BLACK,nCe),r=this._distanceDisplayConditionProperty.getValue(e),o={show:new Pn(n&&t.isShowing&&this._showProperty.getValue(e)&&this._showOutlineProperty.getValue(e)),color:Jt.fromColor(i),distanceDisplayCondition:Qn.fromDistanceDisplayCondition(r),offset:void 0};return l(this._options.offsetAttribute)&&(o.offset=Er.fromCartesian3(X.getValueOrDefault(this._terrainOffsetProperty,e,iCe,rCe))),new Bt({id:t,geometry:new jd(this._options),attributes:o})};$h.prototype._computeCenter=function(e,t){return X.getValueOrUndefined(this._entity.position,e,t)};$h.prototype._isHidden=function(e,t){let n=e.position;return!l(n)||!l(t.semiMajorAxis)||!l(t.semiMinorAxis)||Oi.prototype._isHidden.call(this,e,t)};$h.prototype._isDynamic=function(e,t){return!e.position.isConstant||!t.semiMajorAxis.isConstant||!t.semiMinorAxis.isConstant||!X.isConstant(t.rotation)||!X.isConstant(t.height)||!X.isConstant(t.extrudedHeight)||!X.isConstant(t.granularity)||!X.isConstant(t.stRotation)||!X.isConstant(t.outlineWidth)||!X.isConstant(t.numberOfVerticalLines)||!X.isConstant(t.zIndex)||this._onTerrain&&!X.isConstant(this._materialProperty)&&!(this._materialProperty instanceof Kt)};$h.prototype._setStaticOptions=function(e,t){let n=X.getValueOrUndefined(t.height,nt.MINIMUM_VALUE),i=X.getValueOrDefault(t.heightReference,nt.MINIMUM_VALUE,We.NONE),r=X.getValueOrUndefined(t.extrudedHeight,nt.MINIMUM_VALUE),o=X.getValueOrDefault(t.extrudedHeightReference,nt.MINIMUM_VALUE,We.NONE);l(r)&&!l(n)&&(n=0);let s=this._options;s.vertexFormat=this._materialProperty instanceof Kt?An.VERTEX_FORMAT:Cr.MaterialSupport.TEXTURED.vertexFormat,s.center=e.position.getValue(nt.MINIMUM_VALUE,s.center),s.semiMajorAxis=t.semiMajorAxis.getValue(nt.MINIMUM_VALUE,s.semiMajorAxis),s.semiMinorAxis=t.semiMinorAxis.getValue(nt.MINIMUM_VALUE,s.semiMinorAxis),s.rotation=X.getValueOrUndefined(t.rotation,nt.MINIMUM_VALUE),s.granularity=X.getValueOrUndefined(t.granularity,nt.MINIMUM_VALUE),s.stRotation=X.getValueOrUndefined(t.stRotation,nt.MINIMUM_VALUE),s.numberOfVerticalLines=X.getValueOrUndefined(t.numberOfVerticalLines,nt.MINIMUM_VALUE),s.offsetAttribute=oi.computeGeometryOffsetAttribute(n,i,r,o),s.height=oi.getGeometryHeight(n,i),r=oi.getGeometryExtrudedHeight(r,o),r===oi.CLAMP_TO_GROUND&&(r=Ni.getMinimumMaximumHeights(Fu.computeRectangle(s,oCe)).minimumTerrainHeight),s.extrudedHeight=r};$h.DynamicGeometryUpdater=CS;function CS(e,t,n){Ri.call(this,e,t,n)}l(Object.create)&&(CS.prototype=Object.create(Ri.prototype),CS.prototype.constructor=CS);CS.prototype._isHidden=function(e,t,n){let i=this._options;return!l(i.center)||!l(i.semiMajorAxis)||!l(i.semiMinorAxis)||Ri.prototype._isHidden.call(this,e,t,n)};CS.prototype._setOptions=function(e,t,n){let i=this._options,r=X.getValueOrUndefined(t.height,n),o=X.getValueOrDefault(t.heightReference,n,We.NONE),s=X.getValueOrUndefined(t.extrudedHeight,n),a=X.getValueOrDefault(t.extrudedHeightReference,n,We.NONE);l(s)&&!l(r)&&(r=0),i.center=X.getValueOrUndefined(e.position,n,i.center),i.semiMajorAxis=X.getValueOrUndefined(t.semiMajorAxis,n),i.semiMinorAxis=X.getValueOrUndefined(t.semiMinorAxis,n),i.rotation=X.getValueOrUndefined(t.rotation,n),i.granularity=X.getValueOrUndefined(t.granularity,n),i.stRotation=X.getValueOrUndefined(t.stRotation,n),i.numberOfVerticalLines=X.getValueOrUndefined(t.numberOfVerticalLines,n),i.offsetAttribute=oi.computeGeometryOffsetAttribute(r,o,s,a),i.height=oi.getGeometryHeight(r,o),s=oi.getGeometryExtrudedHeight(s,a),s===oi.CLAMP_TO_GROUND&&(s=Ni.getMinimumMaximumHeights(Fu.computeRectangle(i,oCe)).minimumTerrainHeight),i.extrudedHeight=s};var z8=$h;var L_t=new h,F_t=new h,B_t=new h,k_t=new h,U_t=new h,z_t=new h(1,1,1),sCe=Math.cos,aCe=Math.sin;function Fg(e){e=e??H.EMPTY_OBJECT;let t=e.radii??z_t,n=e.innerRadii??t,i=e.minimumClock??0,r=e.maximumClock??P.TWO_PI,o=e.minimumCone??0,s=e.maximumCone??P.PI,a=Math.round(e.stackPartitions??64),c=Math.round(e.slicePartitions??64),u=e.vertexFormat??Be.DEFAULT;this._radii=h.clone(t),this._innerRadii=h.clone(n),this._minimumClock=i,this._maximumClock=r,this._minimumCone=o,this._maximumCone=s,this._stackPartitions=a,this._slicePartitions=c,this._vertexFormat=Be.clone(u),this._offsetAttribute=e.offsetAttribute,this._workerName="createEllipsoidGeometry"}Fg.packedLength=2*h.packedLength+Be.packedLength+7;Fg.pack=function(e,t,n){return n=n??0,h.pack(e._radii,t,n),n+=h.packedLength,h.pack(e._innerRadii,t,n),n+=h.packedLength,Be.pack(e._vertexFormat,t,n),n+=Be.packedLength,t[n++]=e._minimumClock,t[n++]=e._maximumClock,t[n++]=e._minimumCone,t[n++]=e._maximumCone,t[n++]=e._stackPartitions,t[n++]=e._slicePartitions,t[n]=e._offsetAttribute??-1,t};var cCe=new h,lCe=new h,uCe=new Be,fA={radii:cCe,innerRadii:lCe,vertexFormat:uCe,minimumClock:void 0,maximumClock:void 0,minimumCone:void 0,maximumCone:void 0,stackPartitions:void 0,slicePartitions:void 0,offsetAttribute:void 0};Fg.unpack=function(e,t,n){t=t??0;let i=h.unpack(e,t,cCe);t+=h.packedLength;let r=h.unpack(e,t,lCe);t+=h.packedLength;let o=Be.unpack(e,t,uCe);t+=Be.packedLength;let s=e[t++],a=e[t++],c=e[t++],u=e[t++],f=e[t++],d=e[t++],p=e[t];return l(n)?(n._radii=h.clone(i,n._radii),n._innerRadii=h.clone(r,n._innerRadii),n._vertexFormat=Be.clone(o,n._vertexFormat),n._minimumClock=s,n._maximumClock=a,n._minimumCone=c,n._maximumCone=u,n._stackPartitions=f,n._slicePartitions=d,n._offsetAttribute=p===-1?void 0:p,n):(fA.minimumClock=s,fA.maximumClock=a,fA.minimumCone=c,fA.maximumCone=u,fA.stackPartitions=f,fA.slicePartitions=d,fA.offsetAttribute=p===-1?void 0:p,new Fg(fA))};Fg.createGeometry=function(e){let t=e._radii;if(t.x<=0||t.y<=0||t.z<=0)return;let n=e._innerRadii;if(n.x<=0||n.y<=0||n.z<=0)return;let i=e._minimumClock,r=e._maximumClock,o=e._minimumCone,s=e._maximumCone,a=e._vertexFormat,c=e._slicePartitions+1,u=e._stackPartitions+1;c=Math.round(c*Math.abs(r-i)/P.TWO_PI),u=Math.round(u*Math.abs(s-o)/P.PI),c<2&&(c=2),u<2&&(u=2);let f,d,p=0,g=[o],m=[i];for(f=0;f<u;f++)g.push(o+f*(s-o)/(u-1));for(g.push(s),d=0;d<c;d++)m.push(i+d*(r-i)/(c-1));m.push(r);let y=g.length,A=m.length,b=0,x=1,T=n.x!==t.x||n.y!==t.y||n.z!==t.z,E=!1,v=!1,S=!1;T&&(x=2,o>0&&(E=!0,b+=c-1),s<Math.PI&&(v=!0,b+=c-1),(r-i)%P.TWO_PI?(S=!0,b+=(u-1)*2+1):b+=1);let I=A*y*x,R=new Float64Array(I*3),O=new Array(I).fill(!1),L=new Array(I).fill(!1),_=c*u*x,C=6*(_+b+1-(c+u)*x),w=je.createTypedArray(_,C),D=a.normal?new Float32Array(I*3):void 0,N=a.tangent?new Float32Array(I*3):void 0,F=a.bitangent?new Float32Array(I*3):void 0,V=a.st?new Float32Array(I*2):void 0,B=new Array(y),j=new Array(y);for(f=0;f<y;f++)B[f]=aCe(g[f]),j[f]=sCe(g[f]);let k=new Array(A),G=new Array(A);for(d=0;d<A;d++)G[d]=sCe(m[d]),k[d]=aCe(m[d]);for(f=0;f<y;f++)for(d=0;d<A;d++)R[p++]=t.x*B[f]*G[d],R[p++]=t.y*B[f]*k[d],R[p++]=t.z*j[f];let q=I/2;if(T)for(f=0;f<y;f++)for(d=0;d<A;d++)R[p++]=n.x*B[f]*G[d],R[p++]=n.y*B[f]*k[d],R[p++]=n.z*j[f],O[q]=!0,f>0&&f!==y-1&&d!==0&&d!==A-1&&(L[q]=!0),q++;p=0;let Q,W;for(f=1;f<y-2;f++)for(Q=f*A,W=(f+1)*A,d=1;d<A-2;d++)w[p++]=W+d,w[p++]=W+d+1,w[p++]=Q+d+1,w[p++]=W+d,w[p++]=Q+d+1,w[p++]=Q+d;if(T){let He=y*A;for(f=1;f<y-2;f++)for(Q=He+f*A,W=He+(f+1)*A,d=1;d<A-2;d++)w[p++]=W+d,w[p++]=Q+d,w[p++]=Q+d+1,w[p++]=W+d,w[p++]=Q+d+1,w[p++]=W+d+1}let J,Z;if(T){if(E)for(Z=y*A,f=1;f<A-2;f++)w[p++]=f,w[p++]=f+1,w[p++]=Z+f+1,w[p++]=f,w[p++]=Z+f+1,w[p++]=Z+f;if(v)for(J=y*A-A,Z=y*A*x-A,f=1;f<A-2;f++)w[p++]=J+f+1,w[p++]=J+f,w[p++]=Z+f,w[p++]=J+f+1,w[p++]=Z+f,w[p++]=Z+f+1}if(S){for(f=1;f<y-2;f++)Z=A*y+A*f,J=A*f,w[p++]=Z,w[p++]=J+A,w[p++]=J,w[p++]=Z,w[p++]=Z+A,w[p++]=J+A;for(f=1;f<y-2;f++)Z=A*y+A*(f+1)-1,J=A*(f+1)-1,w[p++]=J+A,w[p++]=Z,w[p++]=J,w[p++]=J+A,w[p++]=Z+A,w[p++]=Z}let ae=new En;a.position&&(ae.position=new Ne({componentDatatype:Y.DOUBLE,componentsPerAttribute:3,values:R}));let Ae=0,fe=0,xe=0,ge=0,we=I/2,ve,Re=ee.fromCartesian3(t),Qe=ee.fromCartesian3(n);if(a.st||a.normal||a.tangent||a.bitangent){for(f=0;f<I;f++){ve=O[f]?Qe:Re;let He=h.fromArray(R,f*3,L_t),Ye=ve.geodeticSurfaceNormal(He,F_t);if(L[f]&&h.negate(Ye,Ye),a.st){let Ke=U.negate(Ye,U_t);V[Ae++]=Math.atan2(Ke.y,Ke.x)/P.TWO_PI+.5,V[Ae++]=Math.asin(Ye.z)/Math.PI+.5}if(a.normal&&(D[fe++]=Ye.x,D[fe++]=Ye.y,D[fe++]=Ye.z),a.tangent||a.bitangent){let Ke=B_t,Pe=0,qe;if(O[f]&&(Pe=we),!E&&f>=Pe&&f<Pe+A*2?qe=h.UNIT_X:qe=h.UNIT_Z,h.cross(qe,Ye,Ke),h.normalize(Ke,Ke),a.tangent&&(N[xe++]=Ke.x,N[xe++]=Ke.y,N[xe++]=Ke.z),a.bitangent){let st=h.cross(Ye,Ke,k_t);h.normalize(st,st),F[ge++]=st.x,F[ge++]=st.y,F[ge++]=st.z}}}a.st&&(ae.st=new Ne({componentDatatype:Y.FLOAT,componentsPerAttribute:2,values:V})),a.normal&&(ae.normal=new Ne({componentDatatype:Y.FLOAT,componentsPerAttribute:3,values:D})),a.tangent&&(ae.tangent=new Ne({componentDatatype:Y.FLOAT,componentsPerAttribute:3,values:N})),a.bitangent&&(ae.bitangent=new Ne({componentDatatype:Y.FLOAT,componentsPerAttribute:3,values:F}))}if(l(e._offsetAttribute)){let He=R.length,Ye=e._offsetAttribute===pn.NONE?0:1,Ke=new Uint8Array(He/3).fill(Ye);ae.applyOffset=new Ne({componentDatatype:Y.UNSIGNED_BYTE,componentsPerAttribute:1,values:Ke})}return new wt({attributes:ae,indices:w,primitiveType:Oe.TRIANGLES,boundingSphere:ue.fromEllipsoid(Re),offsetAttribute:e._offsetAttribute})};var Iee;Fg.getUnitEllipsoid=function(){return l(Iee)||(Iee=Fg.createGeometry(new Fg({radii:new h(1,1,1),vertexFormat:Be.POSITION_ONLY}))),Iee};var ac=Fg;var V_t=new Kt(z.WHITE),Pee=h.ZERO,Dee=new h,j_t=new h,H_t=new h,Ree=new z,G_t=new h(1,1,1);function W_t(e){this.id=e,this.vertexFormat=void 0,this.radii=void 0,this.innerRadii=void 0,this.minimumClock=void 0,this.maximumClock=void 0,this.minimumCone=void 0,this.maximumCone=void 0,this.stackPartitions=void 0,this.slicePartitions=void 0,this.subdivisions=void 0,this.offsetAttribute=void 0}function wf(e,t){Oi.call(this,{entity:e,scene:t,geometryOptions:new W_t(e),geometryPropertyName:"ellipsoid",observedPropertyNames:["availability","position","orientation","ellipsoid"]}),this._onEntityPropertyChanged(e,"ellipsoid",e.ellipsoid,void 0)}l(Object.create)&&(wf.prototype=Object.create(Oi.prototype),wf.prototype.constructor=wf);Object.defineProperties(wf.prototype,{terrainOffsetProperty:{get:function(){return this._terrainOffsetProperty}}});wf.prototype.createFillGeometryInstance=function(e,t,n){let i=this._entity,r=i.isAvailable(e),o,s=new Pn(r&&i.isShowing&&this._showProperty.getValue(e)&&this._fillProperty.getValue(e)),a=this._distanceDisplayConditionProperty.getValue(e),c=Qn.fromDistanceDisplayCondition(a),u={show:s,distanceDisplayCondition:c,color:void 0,offset:void 0};if(this._materialProperty instanceof Kt){let f;l(this._materialProperty.color)&&(this._materialProperty.color.isConstant||r)&&(f=this._materialProperty.color.getValue(e,Ree)),l(f)||(f=z.WHITE),o=Jt.fromColor(f),u.color=o}return l(this._options.offsetAttribute)&&(u.offset=Er.fromCartesian3(X.getValueOrDefault(this._terrainOffsetProperty,e,Pee,Dee))),new Bt({id:i,geometry:new ac(this._options),modelMatrix:t?void 0:i.computeModelMatrixForHeightReference(e,i.ellipsoid.heightReference,this._options.radii.z*.5,this._scene.ellipsoid,n),attributes:u})};wf.prototype.createOutlineGeometryInstance=function(e,t,n){let i=this._entity,r=i.isAvailable(e),o=X.getValueOrDefault(this._outlineColorProperty,e,z.BLACK,Ree),s=this._distanceDisplayConditionProperty.getValue(e),a={show:new Pn(r&&i.isShowing&&this._showProperty.getValue(e)&&this._showOutlineProperty.getValue(e)),color:Jt.fromColor(o),distanceDisplayCondition:Qn.fromDistanceDisplayCondition(s),offset:void 0};return l(this._options.offsetAttribute)&&(a.offset=Er.fromCartesian3(X.getValueOrDefault(this._terrainOffsetProperty,e,Pee,Dee))),new Bt({id:i,geometry:new Nd(this._options),modelMatrix:t?void 0:i.computeModelMatrixForHeightReference(e,i.ellipsoid.heightReference,this._options.radii.z*.5,this._scene.ellipsoid,n),attributes:a})};wf.prototype._computeCenter=function(e,t){return X.getValueOrUndefined(this._entity.position,e,t)};wf.prototype._isHidden=function(e,t){return!l(e.position)||!l(t.radii)||Oi.prototype._isHidden.call(this,e,t)};wf.prototype._isDynamic=function(e,t){return!e.position.isConstant||!X.isConstant(e.orientation)||!t.radii.isConstant||!X.isConstant(t.innerRadii)||!X.isConstant(t.stackPartitions)||!X.isConstant(t.slicePartitions)||!X.isConstant(t.outlineWidth)||!X.isConstant(t.minimumClock)||!X.isConstant(t.maximumClock)||!X.isConstant(t.minimumCone)||!X.isConstant(t.maximumCone)||!X.isConstant(t.subdivisions)};wf.prototype._setStaticOptions=function(e,t){let n=X.getValueOrDefault(t.heightReference,nt.MINIMUM_VALUE,We.NONE),i=this._options;i.vertexFormat=this._materialProperty instanceof Kt?An.VERTEX_FORMAT:Cr.MaterialSupport.TEXTURED.vertexFormat,i.radii=t.radii.getValue(nt.MINIMUM_VALUE,i.radii),i.innerRadii=X.getValueOrUndefined(t.innerRadii,i.radii),i.minimumClock=X.getValueOrUndefined(t.minimumClock,nt.MINIMUM_VALUE),i.maximumClock=X.getValueOrUndefined(t.maximumClock,nt.MINIMUM_VALUE),i.minimumCone=X.getValueOrUndefined(t.minimumCone,nt.MINIMUM_VALUE),i.maximumCone=X.getValueOrUndefined(t.maximumCone,nt.MINIMUM_VALUE),i.stackPartitions=X.getValueOrUndefined(t.stackPartitions,nt.MINIMUM_VALUE),i.slicePartitions=X.getValueOrUndefined(t.slicePartitions,nt.MINIMUM_VALUE),i.subdivisions=X.getValueOrUndefined(t.subdivisions,nt.MINIMUM_VALUE),i.offsetAttribute=n!==We.NONE?pn.ALL:void 0};wf.prototype._onEntityPropertyChanged=Z_;wf.DynamicGeometryUpdater=uR;function uR(e,t,n){Ri.call(this,e,t,n),this._scene=e._scene,this._modelMatrix=new M,this._attributes=void 0,this._outlineAttributes=void 0,this._lastSceneMode=void 0,this._lastShow=void 0,this._lastOutlineShow=void 0,this._lastOutlineWidth=void 0,this._lastOutlineColor=void 0,this._lastOffset=new h,this._material={}}l(Object.create)&&(uR.prototype=Object.create(Ri.prototype),uR.prototype.constructor=uR);uR.prototype.update=function(e){let t=this._entity,n=t.ellipsoid;if(!t.isShowing||!t.isAvailable(e)||!X.getValueOrDefault(n.show,e,!0)){l(this._primitive)&&(this._primitive.show=!1),l(this._outlinePrimitive)&&(this._outlinePrimitive.show=!1);return}let i=X.getValueOrUndefined(n.radii,e,j_t),r=l(i)?t.computeModelMatrixForHeightReference(e,n.heightReference,i.z*.5,this._scene.ellipsoid,this._modelMatrix):void 0;if(!l(r)||!l(i)){l(this._primitive)&&(this._primitive.show=!1),l(this._outlinePrimitive)&&(this._outlinePrimitive.show=!1);return}let o=X.getValueOrDefault(n.fill,e,!0),s=X.getValueOrDefault(n.outline,e,!1),a=X.getValueOrClonedDefault(n.outlineColor,e,z.BLACK,Ree),c=Co.getValue(e,n.material??V_t,this._material),u=X.getValueOrUndefined(n.innerRadii,e,H_t),f=X.getValueOrUndefined(n.minimumClock,e),d=X.getValueOrUndefined(n.maximumClock,e),p=X.getValueOrUndefined(n.minimumCone,e),g=X.getValueOrUndefined(n.maximumCone,e),m=X.getValueOrUndefined(n.stackPartitions,e),y=X.getValueOrUndefined(n.slicePartitions,e),A=X.getValueOrUndefined(n.subdivisions,e),b=X.getValueOrDefault(n.outlineWidth,e,1),x=X.getValueOrDefault(n.heightReference,e,We.NONE),T=x!==We.NONE?pn.ALL:void 0,E=this._scene.mode,v=E===re.SCENE3D&&x===We.NONE,S=this._options,I=this._geometryUpdater.shadowsProperty.getValue(e),O=this._geometryUpdater.distanceDisplayConditionProperty.getValue(e),L=X.getValueOrDefault(this._geometryUpdater.terrainOffsetProperty,e,Pee,Dee);if(!v||this._lastSceneMode!==E||!l(this._primitive)||S.stackPartitions!==m||S.slicePartitions!==y||l(u)&&!h.equals(S.innerRadii!==u)||S.minimumClock!==f||S.maximumClock!==d||S.minimumCone!==p||S.maximumCone!==g||S.subdivisions!==A||this._lastOutlineWidth!==b||S.offsetAttribute!==T){let C=this._primitives;C.removeAndDestroy(this._primitive),C.removeAndDestroy(this._outlinePrimitive),this._primitive=void 0,this._outlinePrimitive=void 0,this._lastSceneMode=E,this._lastOutlineWidth=b,S.stackPartitions=m,S.slicePartitions=y,S.subdivisions=A,S.offsetAttribute=T,S.radii=h.clone(v?G_t:i,S.radii),l(u)?v?S.innerRadii=h.fromElements(u.x/i.x,u.y/i.y,u.z/i.z,S.innerRadii):S.innerRadii=h.clone(u,S.innerRadii):S.innerRadii=void 0,S.minimumClock=f,S.maximumClock=d,S.minimumCone=p,S.maximumCone=g;let w=new Cr({material:c,translucent:c.isTranslucent(),closed:!0});S.vertexFormat=w.vertexFormat;let D=this._geometryUpdater.createFillGeometryInstance(e,v,this._modelMatrix);this._primitive=C.add(new Mn({geometryInstances:D,appearance:w,asynchronous:!1,shadows:I}));let N=this._geometryUpdater.createOutlineGeometryInstance(e,v,this._modelMatrix);this._outlinePrimitive=C.add(new Mn({geometryInstances:N,appearance:new An({flat:!0,translucent:N.attributes.color.value[3]!==255,renderState:{lineWidth:this._geometryUpdater._scene.clampLineWidth(b)}}),asynchronous:!1,shadows:I})),this._lastShow=o,this._lastOutlineShow=s,this._lastOutlineColor=z.clone(a,this._lastOutlineColor),this._lastDistanceDisplayCondition=O,this._lastOffset=h.clone(L,this._lastOffset)}else if(this._primitive.ready){let C=this._primitive,w=this._outlinePrimitive;C.show=!0,w.show=!0,C.appearance.material=c;let D=this._attributes;l(D)||(D=C.getGeometryInstanceAttributes(t),this._attributes=D),o!==this._lastShow&&(D.show=Pn.toValue(o,D.show),this._lastShow=o);let N=this._outlineAttributes;l(N)||(N=w.getGeometryInstanceAttributes(t),this._outlineAttributes=N),s!==this._lastOutlineShow&&(N.show=Pn.toValue(s,N.show),this._lastOutlineShow=s),z.equals(a,this._lastOutlineColor)||(N.color=Jt.toValue(a,N.color),z.clone(a,this._lastOutlineColor)),Gt.equals(O,this._lastDistanceDisplayCondition)||(D.distanceDisplayCondition=Qn.toValue(O,D.distanceDisplayCondition),N.distanceDisplayCondition=Qn.toValue(O,N.distanceDisplayCondition),Gt.clone(O,this._lastDistanceDisplayCondition)),h.equals(L,this._lastOffset)||(D.offset=Er.toValue(L,D.offset),N.offset=Er.toValue(L,D.offset),h.clone(L,this._lastOffset))}v&&(i.x=Math.max(i.x,.001),i.y=Math.max(i.y,.001),i.z=Math.max(i.z,.001),r=M.multiplyByScale(r,i,r),this._primitive.modelMatrix=r,this._outlinePrimitive.modelMatrix=r)};var V8=wf;function vS(e){e=e??H.EMPTY_OBJECT;let t=e.vertexFormat??Be.DEFAULT;this._vertexFormat=t,this._workerName="createPlaneGeometry"}vS.packedLength=Be.packedLength;vS.pack=function(e,t,n){return n=n??0,Be.pack(e._vertexFormat,t,n),t};var fCe=new Be,q_t={vertexFormat:fCe};vS.unpack=function(e,t,n){t=t??0;let i=Be.unpack(e,t,fCe);return l(n)?(n._vertexFormat=Be.clone(i,n._vertexFormat),n):new vS(q_t)};var j8=new h(-.5,-.5,0),H8=new h(.5,.5,0);vS.createGeometry=function(e){let t=e._vertexFormat,n=new En,i,r;if(t.position){if(r=new Float64Array(12),r[0]=j8.x,r[1]=j8.y,r[2]=0,r[3]=H8.x,r[4]=j8.y,r[5]=0,r[6]=H8.x,r[7]=H8.y,r[8]=0,r[9]=j8.x,r[10]=H8.y,r[11]=0,n.position=new Ne({componentDatatype:Y.DOUBLE,componentsPerAttribute:3,values:r}),t.normal){let o=new Float32Array(12);o[0]=0,o[1]=0,o[2]=1,o[3]=0,o[4]=0,o[5]=1,o[6]=0,o[7]=0,o[8]=1,o[9]=0,o[10]=0,o[11]=1,n.normal=new Ne({componentDatatype:Y.FLOAT,componentsPerAttribute:3,values:o})}if(t.st){let o=new Float32Array(8);o[0]=0,o[1]=0,o[2]=1,o[3]=0,o[4]=1,o[5]=1,o[6]=0,o[7]=1,n.st=new Ne({componentDatatype:Y.FLOAT,componentsPerAttribute:2,values:o})}if(t.tangent){let o=new Float32Array(12);o[0]=1,o[1]=0,o[2]=0,o[3]=1,o[4]=0,o[5]=0,o[6]=1,o[7]=0,o[8]=0,o[9]=1,o[10]=0,o[11]=0,n.tangent=new Ne({componentDatatype:Y.FLOAT,componentsPerAttribute:3,values:o})}if(t.bitangent){let o=new Float32Array(12);o[0]=0,o[1]=1,o[2]=0,o[3]=0,o[4]=1,o[5]=0,o[6]=0,o[7]=1,o[8]=0,o[9]=0,o[10]=1,o[11]=0,n.bitangent=new Ne({componentDatatype:Y.FLOAT,componentsPerAttribute:3,values:o})}i=new Uint16Array(6),i[0]=0,i[1]=1,i[2]=2,i[3]=0,i[4]=2,i[5]=3}return new wt({attributes:n,indices:i,primitiveType:Oe.TRIANGLES,boundingSphere:new ue(h.ZERO,Math.sqrt(2))})};var G8=vS;function SS(){this._workerName="createPlaneOutlineGeometry"}SS.packedLength=0;SS.pack=function(e,t){return t};SS.unpack=function(e,t,n){return l(n)?n:new SS};var dA=new h(-.5,-.5,0),W8=new h(.5,.5,0);SS.createGeometry=function(){let e=new En,t=new Uint16Array(8),n=new Float64Array(12);return n[0]=dA.x,n[1]=dA.y,n[2]=dA.z,n[3]=W8.x,n[4]=dA.y,n[5]=dA.z,n[6]=W8.x,n[7]=W8.y,n[8]=dA.z,n[9]=dA.x,n[10]=W8.y,n[11]=dA.z,e.position=new Ne({componentDatatype:Y.DOUBLE,componentsPerAttribute:3,values:n}),t[0]=0,t[1]=1,t[2]=1,t[3]=2,t[4]=2,t[5]=3,t[6]=3,t[7]=0,new wt({attributes:e,indices:t,primitiveType:Oe.LINES,boundingSphere:new ue(h.ZERO,Math.sqrt(2))})};var q8=SS;var Y_t=new h,dCe=new z;function X_t(e){this.id=e,this.vertexFormat=void 0,this.plane=void 0,this.dimensions=void 0}function Hd(e,t){Oi.call(this,{entity:e,scene:t,geometryOptions:new X_t(e),geometryPropertyName:"plane",observedPropertyNames:["availability","position","orientation","plane"]}),this._onEntityPropertyChanged(e,"plane",e.plane,void 0)}l(Object.create)&&(Hd.prototype=Object.create(Oi.prototype),Hd.prototype.constructor=Hd);Hd.prototype.createFillGeometryInstance=function(e){let t=this._entity,n=t.isAvailable(e),i,r,o=new Pn(n&&t.isShowing&&this._showProperty.getValue(e)&&this._fillProperty.getValue(e)),s=this._distanceDisplayConditionProperty.getValue(e),a=Qn.fromDistanceDisplayCondition(s);if(this._materialProperty instanceof Kt){let g;l(this._materialProperty.color)&&(this._materialProperty.color.isConstant||n)&&(g=this._materialProperty.color.getValue(e,dCe)),l(g)||(g=z.WHITE),r=Jt.fromColor(g),i={show:o,distanceDisplayCondition:a,color:r}}else i={show:o,distanceDisplayCondition:a};let c=t.plane,u=this._options,f=t.computeModelMatrix(e),d=X.getValueOrDefault(c.plane,e,u.plane),p=X.getValueOrUndefined(c.dimensions,e,u.dimensions);return u.plane=d,u.dimensions=p,f=Oee(d,p,f,f),new Bt({id:t,geometry:new G8(this._options),modelMatrix:f,attributes:i})};Hd.prototype.createOutlineGeometryInstance=function(e){let t=this._entity,n=t.isAvailable(e),i=X.getValueOrDefault(this._outlineColorProperty,e,z.BLACK,dCe),r=this._distanceDisplayConditionProperty.getValue(e),o=t.plane,s=this._options,a=t.computeModelMatrix(e),c=X.getValueOrDefault(o.plane,e,s.plane),u=X.getValueOrUndefined(o.dimensions,e,s.dimensions);return s.plane=c,s.dimensions=u,a=Oee(c,u,a,a),new Bt({id:t,geometry:new q8,modelMatrix:a,attributes:{show:new Pn(n&&t.isShowing&&this._showProperty.getValue(e)&&this._showOutlineProperty.getValue(e)),color:Jt.fromColor(i),distanceDisplayCondition:Qn.fromDistanceDisplayCondition(r)}})};Hd.prototype._isHidden=function(e,t){return!l(t.plane)||!l(t.dimensions)||!l(e.position)||Oi.prototype._isHidden.call(this,e,t)};Hd.prototype._getIsClosed=function(e){return!1};Hd.prototype._isDynamic=function(e,t){return!e.position.isConstant||!X.isConstant(e.orientation)||!t.plane.isConstant||!t.dimensions.isConstant||!X.isConstant(t.outlineWidth)};Hd.prototype._setStaticOptions=function(e,t){let n=this._materialProperty instanceof Kt,i=this._options;i.vertexFormat=n?An.VERTEX_FORMAT:Cr.MaterialSupport.TEXTURED.vertexFormat,i.plane=t.plane.getValue(nt.MINIMUM_VALUE,i.plane),i.dimensions=t.dimensions.getValue(nt.MINIMUM_VALUE,i.dimensions)};Hd.DynamicGeometryUpdater=wS;function wS(e,t,n){Ri.call(this,e,t,n)}l(Object.create)&&(wS.prototype=Object.create(Ri.prototype),wS.prototype.constructor=wS);wS.prototype._isHidden=function(e,t,n){let i=this._options,r=X.getValueOrUndefined(e.position,n,Y_t);return!l(r)||!l(i.plane)||!l(i.dimensions)||Ri.prototype._isHidden.call(this,e,t,n)};wS.prototype._setOptions=function(e,t,n){let i=this._options;i.plane=X.getValueOrDefault(t.plane,n,i.plane),i.dimensions=X.getValueOrUndefined(t.dimensions,n,i.dimensions)};var K_t=new h,$_t=new h,J_t=new h,Z_t=new h,Q_t=new $,eyt=new $,tyt=new M;function Oee(e,t,n,i){let r=e.normal,o=e.distance,s=h.multiplyByScalar(r,-o,J_t),a=h.clone(h.UNIT_Z,$_t);P.equalsEpsilon(Math.abs(h.dot(a,r)),1,P.EPSILON8)&&(a=h.clone(h.UNIT_Y,a));let c=h.cross(a,r,K_t);a=h.cross(r,c,a),h.normalize(c,c),h.normalize(a,a);let u=Q_t;$.setColumn(u,0,c,u),$.setColumn(u,1,a,u),$.setColumn(u,2,r,u);let f=h.fromElements(t.x,t.y,1,Z_t),d=$.multiplyByScale(u,f,eyt),p=M.fromRotationTranslation(d,s,tyt);return M.multiplyTransformation(n,p,i)}Hd.createPrimitiveMatrix=Oee;var Y8=Hd;var nyt=new h,iyt=new et,ryt=new U,oyt=new U,syt=new h,ayt=new h,cyt=new h,fR=new h,lyt=new h,uyt=new h,hCe=new Le,fyt=new $,dyt=new $,hyt=new h;function myt(e,t,n,i,r,o,s,a,c){let u=e.positions,f=mi.triangulate(e.positions2D,e.holes);f.length<3&&(f=[0,1,2]);let d=je.createTypedArray(u.length,f.length);d.set(f);let p=fyt;if(i!==0){let _=Le.fromAxisAngle(s,i,hCe);if(p=$.fromQuaternion(_,p),t.tangent||t.bitangent){_=Le.fromAxisAngle(s,-i,hCe);let C=$.fromQuaternion(_,dyt);a=h.normalize($.multiplyByVector(C,a,a),a),t.bitangent&&(c=h.normalize(h.cross(s,a,c),c))}}else p=$.clone($.IDENTITY,p);let g=oyt;t.st&&(g.x=n.x,g.y=n.y);let m=u.length,y=m*3,A=new Float64Array(y),b=t.normal?new Float32Array(y):void 0,x=t.tangent?new Float32Array(y):void 0,T=t.bitangent?new Float32Array(y):void 0,E=t.st?new Float32Array(m*2):void 0,v=0,S=0,I=0,R=0,O=0;for(let _=0;_<m;_++){let C=u[_];if(A[v++]=C.x,A[v++]=C.y,A[v++]=C.z,t.st)if(l(r)&&r.positions.length===m)E[O++]=r.positions[_].x,E[O++]=r.positions[_].y;else{let w=$.multiplyByVector(p,C,nyt),D=o(w,ryt);U.subtract(D,g,D);let N=P.clamp(D.x/n.width,0,1),F=P.clamp(D.y/n.height,0,1);E[O++]=N,E[O++]=F}t.normal&&(b[S++]=s.x,b[S++]=s.y,b[S++]=s.z),t.tangent&&(x[R++]=a.x,x[R++]=a.y,x[R++]=a.z),t.bitangent&&(T[I++]=c.x,T[I++]=c.y,T[I++]=c.z)}let L=new En;return t.position&&(L.position=new Ne({componentDatatype:Y.DOUBLE,componentsPerAttribute:3,values:A})),t.normal&&(L.normal=new Ne({componentDatatype:Y.FLOAT,componentsPerAttribute:3,values:b})),t.tangent&&(L.tangent=new Ne({componentDatatype:Y.FLOAT,componentsPerAttribute:3,values:x})),t.bitangent&&(L.bitangent=new Ne({componentDatatype:Y.FLOAT,componentsPerAttribute:3,values:T})),t.st&&(L.st=new Ne({componentDatatype:Y.FLOAT,componentsPerAttribute:2,values:E})),new wt({attributes:L,indices:d,primitiveType:Oe.TRIANGLES})}function $x(e){e=e??H.EMPTY_OBJECT;let t=e.polygonHierarchy,n=e.textureCoordinates,i=e.vertexFormat??Be.DEFAULT;this._vertexFormat=Be.clone(i),this._polygonHierarchy=t,this._stRotation=e.stRotation??0,this._ellipsoid=ee.clone(e.ellipsoid??ee.default),this._workerName="createCoplanarPolygonGeometry",this._textureCoordinates=n,this.packedLength=ni.computeHierarchyPackedLength(t,h)+Be.packedLength+ee.packedLength+(l(n)?ni.computeHierarchyPackedLength(n,U):1)+2}$x.fromPositions=function(e){e=e??H.EMPTY_OBJECT;let t={polygonHierarchy:{positions:e.positions},vertexFormat:e.vertexFormat,stRotation:e.stRotation,ellipsoid:e.ellipsoid,textureCoordinates:e.textureCoordinates};return new $x(t)};$x.pack=function(e,t,n){return n=n??0,n=ni.packPolygonHierarchy(e._polygonHierarchy,t,n,h),ee.pack(e._ellipsoid,t,n),n+=ee.packedLength,Be.pack(e._vertexFormat,t,n),n+=Be.packedLength,t[n++]=e._stRotation,l(e._textureCoordinates)?n=ni.packPolygonHierarchy(e._textureCoordinates,t,n,U):t[n++]=-1,t[n]=e.packedLength,t};var pyt=ee.clone(ee.UNIT_SPHERE),gyt=new Be,_yt={polygonHierarchy:{}};$x.unpack=function(e,t,n){t=t??0;let i=ni.unpackPolygonHierarchy(e,t,h);t=i.startingIndex,delete i.startingIndex;let r=ee.unpack(e,t,pyt);t+=ee.packedLength;let o=Be.unpack(e,t,gyt);t+=Be.packedLength;let s=e[t++],a=e[t]===-1?void 0:ni.unpackPolygonHierarchy(e,t,U);l(a)?(t=a.startingIndex,delete a.startingIndex):t++;let c=e[t];return l(n)||(n=new $x(_yt)),n._polygonHierarchy=i,n._ellipsoid=ee.clone(r,n._ellipsoid),n._vertexFormat=Be.clone(o,n._vertexFormat),n._stRotation=s,n._textureCoordinates=a,n.packedLength=c,n};$x.createGeometry=function(e){let t=e._vertexFormat,n=e._polygonHierarchy,i=e._stRotation,r=e._textureCoordinates,o=l(r),s=n.positions;if(s=Lr(s,h.equalsEpsilon,!0),s.length<3)return;let a=syt,c=ayt,u=cyt,f=lyt,d=uyt;if(!Gy.computeProjectTo2DArguments(s,fR,f,d))return;if(a=h.cross(f,d,a),a=h.normalize(a,a),!h.equalsEpsilon(fR,h.ZERO,P.EPSILON6)){let O=e._ellipsoid.geodeticSurfaceNormal(fR,hyt);h.dot(a,O)<0&&(a=h.negate(a,a),f=h.negate(f,f))}let g=Gy.createProjectPointsTo2DFunction(fR,f,d),m=Gy.createProjectPointTo2DFunction(fR,f,d);t.tangent&&(c=h.clone(f,c)),t.bitangent&&(u=h.clone(d,u));let y=ni.polygonsFromHierarchy(n,o,g,!1),A=y.hierarchy,b=y.polygons,x=function(O){return O},T=o?ni.polygonsFromHierarchy(r,!0,x,!1).polygons:void 0;if(A.length===0)return;s=A[0].outerRing;let E=ue.fromPoints(s),v=ni.computeBoundingRectangle(a,m,s,i,iyt),S=[];for(let O=0;O<b.length;O++){let L=new Bt({geometry:myt(b[O],t,v,i,o?T[O]:void 0,m,a,c,u)});S.push(L)}let I=Wn.combineInstances(S)[0];I.attributes.position.values=new Float64Array(I.attributes.position.values),I.indices=je.createTypedArray(I.attributes.position.values.length/3,I.indices);let R=I.attributes;return t.position||delete R.position,new wt({attributes:R,indices:I.indices,primitiveType:I.primitiveType,boundingSphere:E})};var X8=$x;var mCe=[],K8=[];function yyt(e,t,n,i,r){let s=qs.fromPoints(t,e).projectPointsOntoPlane(t,mCe);mi.computeWindingOrder2D(s)===sa.CLOCKWISE&&(s.reverse(),t=t.slice().reverse());let c,u,f=t.length,d=0;if(i)for(c=new Float64Array(f*2*3),u=0;u<f;u++){let m=t[u],y=t[(u+1)%f];c[d++]=m.x,c[d++]=m.y,c[d++]=m.z,c[d++]=y.x,c[d++]=y.y,c[d++]=y.z}else{let m=0;if(r===ln.GEODESIC)for(u=0;u<f;u++)m+=ni.subdivideLineCount(t[u],t[(u+1)%f],n);else if(r===ln.RHUMB)for(u=0;u<f;u++)m+=ni.subdivideRhumbLineCount(e,t[u],t[(u+1)%f],n);for(c=new Float64Array(m*3),u=0;u<f;u++){let y;r===ln.GEODESIC?y=ni.subdivideLine(t[u],t[(u+1)%f],n,K8):r===ln.RHUMB&&(y=ni.subdivideRhumbLine(e,t[u],t[(u+1)%f],n,K8));let A=y.length;for(let b=0;b<A;++b)c[d++]=y[b]}}f=c.length/3;let p=f*2,g=je.createTypedArray(f,p);for(d=0,u=0;u<f-1;u++)g[d++]=u,g[d++]=u+1;return g[d++]=f-1,g[d]=0,new Bt({geometry:new wt({attributes:new En({position:new Ne({componentDatatype:Y.DOUBLE,componentsPerAttribute:3,values:c})}),indices:g,primitiveType:Oe.LINES})})}function Ayt(e,t,n,i,r){let s=qs.fromPoints(t,e).projectPointsOntoPlane(t,mCe);mi.computeWindingOrder2D(s)===sa.CLOCKWISE&&(s.reverse(),t=t.slice().reverse());let c,u,f=t.length,d=new Array(f),p=0;if(i)for(c=new Float64Array(f*2*3*2),u=0;u<f;++u){d[u]=p/3;let A=t[u],b=t[(u+1)%f];c[p++]=A.x,c[p++]=A.y,c[p++]=A.z,c[p++]=b.x,c[p++]=b.y,c[p++]=b.z}else{let A=0;if(r===ln.GEODESIC)for(u=0;u<f;u++)A+=ni.subdivideLineCount(t[u],t[(u+1)%f],n);else if(r===ln.RHUMB)for(u=0;u<f;u++)A+=ni.subdivideRhumbLineCount(e,t[u],t[(u+1)%f],n);for(c=new Float64Array(A*3*2),u=0;u<f;++u){d[u]=p/3;let b;r===ln.GEODESIC?b=ni.subdivideLine(t[u],t[(u+1)%f],n,K8):r===ln.RHUMB&&(b=ni.subdivideRhumbLine(e,t[u],t[(u+1)%f],n,K8));let x=b.length;for(let T=0;T<x;++T)c[p++]=b[T]}}f=c.length/6;let g=d.length,m=(f*2+g)*2,y=je.createTypedArray(f+g,m);for(p=0,u=0;u<f;++u)y[p++]=u,y[p++]=(u+1)%f,y[p++]=u+f,y[p++]=(u+1)%f+f;for(u=0;u<g;u++){let A=d[u];y[p++]=A,y[p++]=A+f}return new Bt({geometry:new wt({attributes:new En({position:new Ne({componentDatatype:Y.DOUBLE,componentsPerAttribute:3,values:c})}),indices:y,primitiveType:Oe.LINES})})}function Jx(e){let t=e.polygonHierarchy,n=e.ellipsoid??ee.default,i=e.granularity??P.RADIANS_PER_DEGREE,r=e.perPositionHeight??!1,o=r&&l(e.extrudedHeight),s=e.arcType??ln.GEODESIC,a=e.height??0,c=e.extrudedHeight??a;if(!o){let u=Math.max(a,c);c=Math.min(a,c),a=u}this._ellipsoid=ee.clone(n),this._granularity=i,this._height=a,this._extrudedHeight=c,this._arcType=s,this._polygonHierarchy=t,this._perPositionHeight=r,this._perPositionHeightExtrude=o,this._offsetAttribute=e.offsetAttribute,this._workerName="createPolygonOutlineGeometry",this.packedLength=ni.computeHierarchyPackedLength(t,h)+ee.packedLength+8}Jx.pack=function(e,t,n){return n=n??0,n=ni.packPolygonHierarchy(e._polygonHierarchy,t,n,h),ee.pack(e._ellipsoid,t,n),n+=ee.packedLength,t[n++]=e._height,t[n++]=e._extrudedHeight,t[n++]=e._granularity,t[n++]=e._perPositionHeightExtrude?1:0,t[n++]=e._perPositionHeight?1:0,t[n++]=e._arcType,t[n++]=e._offsetAttribute??-1,t[n]=e.packedLength,t};var byt=ee.clone(ee.UNIT_SPHERE),xyt={polygonHierarchy:{}};Jx.unpack=function(e,t,n){t=t??0;let i=ni.unpackPolygonHierarchy(e,t,h);t=i.startingIndex,delete i.startingIndex;let r=ee.unpack(e,t,byt);t+=ee.packedLength;let o=e[t++],s=e[t++],a=e[t++],c=e[t++]===1,u=e[t++]===1,f=e[t++],d=e[t++],p=e[t];return l(n)||(n=new Jx(xyt)),n._polygonHierarchy=i,n._ellipsoid=ee.clone(r,n._ellipsoid),n._height=o,n._extrudedHeight=s,n._granularity=a,n._perPositionHeight=u,n._perPositionHeightExtrude=c,n._arcType=f,n._offsetAttribute=d===-1?void 0:d,n.packedLength=p,n};Jx.fromPositions=function(e){e=e??H.EMPTY_OBJECT;let t={polygonHierarchy:{positions:e.positions},height:e.height,extrudedHeight:e.extrudedHeight,ellipsoid:e.ellipsoid,granularity:e.granularity,perPositionHeight:e.perPositionHeight,arcType:e.arcType,offsetAttribute:e.offsetAttribute};return new Jx(t)};Jx.createGeometry=function(e){let t=e._ellipsoid,n=e._granularity,i=e._polygonHierarchy,r=e._perPositionHeight,o=e._arcType,s=ni.polygonOutlinesFromHierarchy(i,!r,t);if(s.length===0)return;let a,c=[],u=P.chordLength(n,t.maximumRadius),f=e._height,d=e._extrudedHeight,p=e._perPositionHeightExtrude||!P.equalsEpsilon(f,d,0,P.EPSILON2),g,m;if(p)for(m=0;m<s.length;m++){if(a=Ayt(t,s[m],u,r,o),a.geometry=ni.scaleToGeodeticHeightExtruded(a.geometry,f,d,t,r),l(e._offsetAttribute)){let b=a.geometry.attributes.position.values.length/3,x=new Uint8Array(b);e._offsetAttribute===pn.TOP?x=x.fill(1,0,b/2):(g=e._offsetAttribute===pn.NONE?0:1,x=x.fill(g)),a.geometry.attributes.applyOffset=new Ne({componentDatatype:Y.UNSIGNED_BYTE,componentsPerAttribute:1,values:x})}c.push(a)}else for(m=0;m<s.length;m++){if(a=yyt(t,s[m],u,r,o),a.geometry.attributes.position.values=mi.scaleToGeodeticHeight(a.geometry.attributes.position.values,f,t,!r),l(e._offsetAttribute)){let b=a.geometry.attributes.position.values.length;g=e._offsetAttribute===pn.NONE?0:1;let x=new Uint8Array(b/3).fill(g);a.geometry.attributes.applyOffset=new Ne({componentDatatype:Y.UNSIGNED_BYTE,componentsPerAttribute:1,values:x})}c.push(a)}let y=Wn.combineInstances(c)[0],A=ue.fromVertices(y.attributes.position.values);return new wt({attributes:y.attributes,indices:y.indices,primitiveType:y.primitiveType,boundingSphere:A,offsetAttribute:e._offsetAttribute})};var $8=Jx;var pCe="Entity polygons cannot have both height and perPositionHeight. height will be ignored",gCe="heightReference is not supported for entity polygons with perPositionHeight. heightReference will be ignored",_Ce=new z,yCe=h.ZERO,ACe=new h,bCe=new ie,Tyt=[],Eyt=new U;function Cyt(e){this.id=e,this.vertexFormat=void 0,this.polygonHierarchy=void 0,this.perPositionHeight=void 0,this.closeTop=void 0,this.closeBottom=void 0,this.height=void 0,this.extrudedHeight=void 0,this.granularity=void 0,this.stRotation=void 0,this.offsetAttribute=void 0,this.arcType=void 0,this.textureCoordinates=void 0}function If(e,t){oi.call(this,{entity:e,scene:t,geometryOptions:new Cyt(e),geometryPropertyName:"polygon",observedPropertyNames:["availability","polygon"]}),this._onEntityPropertyChanged(e,"polygon",e.polygon,void 0)}l(Object.create)&&(If.prototype=Object.create(oi.prototype),If.prototype.constructor=If);If.prototype.createFillGeometryInstance=function(e){let t=this._entity,n=t.isAvailable(e),i=this._options,r={show:new Pn(n&&t.isShowing&&this._showProperty.getValue(e)&&this._fillProperty.getValue(e)),distanceDisplayCondition:Qn.fromDistanceDisplayCondition(this._distanceDisplayConditionProperty.getValue(e)),offset:void 0,color:void 0};if(this._materialProperty instanceof Kt){let s;l(this._materialProperty.color)&&(this._materialProperty.color.isConstant||n)&&(s=this._materialProperty.color.getValue(e,_Ce)),l(s)||(s=z.WHITE),r.color=Jt.fromColor(s)}l(i.offsetAttribute)&&(r.offset=Er.fromCartesian3(X.getValueOrDefault(this._terrainOffsetProperty,e,yCe,ACe)));let o;return i.perPositionHeight&&!l(i.extrudedHeight)?o=new X8(i):o=new tg(i),new Bt({id:t,geometry:o,attributes:r})};If.prototype.createOutlineGeometryInstance=function(e){let t=this._entity,n=t.isAvailable(e),i=this._options,r=X.getValueOrDefault(this._outlineColorProperty,e,z.BLACK,_Ce),o=this._distanceDisplayConditionProperty.getValue(e),s={show:new Pn(n&&t.isShowing&&this._showProperty.getValue(e)&&this._showOutlineProperty.getValue(e)),color:Jt.fromColor(r),distanceDisplayCondition:Qn.fromDistanceDisplayCondition(o),offset:void 0};l(i.offsetAttribute)&&(s.offset=Er.fromCartesian3(X.getValueOrDefault(this._terrainOffsetProperty,e,yCe,ACe)));let a;return i.perPositionHeight&&!l(i.extrudedHeight)?a=new Gh(i):a=new $8(i),new Bt({id:t,geometry:a,attributes:s})};If.prototype._computeCenter=function(e,t){let n=X.getValueOrUndefined(this._entity.polygon.hierarchy,e);if(!l(n))return;let i=n.positions;if(i.length===0)return;let r=this._scene.ellipsoid,o=qs.fromPoints(i,r),s=o.projectPointsOntoPlane(i,Tyt),a=s.length,c=0,u=a-1,f=new U;for(let p=0;p<a;u=p++){let g=s[p],m=s[u],y=g.x*m.y-m.x*g.y,A=U.add(g,m,Eyt);A=U.multiplyByScalar(A,y,A),f=U.add(f,A,f),c+=y}let d=1/(c*3);return f=U.multiplyByScalar(f,d,f),o.projectPointOntoEllipsoid(f,t)};If.prototype._isHidden=function(e,t){return!l(t.hierarchy)||Oi.prototype._isHidden.call(this,e,t)};If.prototype._isOnTerrain=function(e,t){let n=oi.prototype._isOnTerrain.call(this,e,t),i=t.perPositionHeight,r=l(i)&&(i.isConstant?i.getValue(nt.MINIMUM_VALUE):!0);return n&&!r};If.prototype._isDynamic=function(e,t){return!t.hierarchy.isConstant||!X.isConstant(t.height)||!X.isConstant(t.extrudedHeight)||!X.isConstant(t.granularity)||!X.isConstant(t.stRotation)||!X.isConstant(t.textureCoordinates)||!X.isConstant(t.outlineWidth)||!X.isConstant(t.perPositionHeight)||!X.isConstant(t.closeTop)||!X.isConstant(t.closeBottom)||!X.isConstant(t.zIndex)||!X.isConstant(t.arcType)||this._onTerrain&&!X.isConstant(this._materialProperty)&&!(this._materialProperty instanceof Kt)};If.prototype._setStaticOptions=function(e,t){let n=this._materialProperty instanceof Kt,i=this._options;i.vertexFormat=n?An.VERTEX_FORMAT:Cr.MaterialSupport.TEXTURED.vertexFormat;let r=t.hierarchy.getValue(nt.MINIMUM_VALUE),o=X.getValueOrUndefined(t.height,nt.MINIMUM_VALUE),s=X.getValueOrDefault(t.heightReference,nt.MINIMUM_VALUE,We.NONE),a=X.getValueOrUndefined(t.extrudedHeight,nt.MINIMUM_VALUE),c=X.getValueOrDefault(t.extrudedHeightReference,nt.MINIMUM_VALUE,We.NONE),u=X.getValueOrDefault(t.perPositionHeight,nt.MINIMUM_VALUE,!1);o=oi.getGeometryHeight(o,s);let f;if(u?(l(o)&&(o=void 0,yt(pCe)),s!==We.NONE&&u&&(o=void 0,yt(gCe))):(l(a)&&!l(o)&&(o=0),f=oi.computeGeometryOffsetAttribute(o,s,a,c)),i.polygonHierarchy=r,i.granularity=X.getValueOrUndefined(t.granularity,nt.MINIMUM_VALUE),i.stRotation=X.getValueOrUndefined(t.stRotation,nt.MINIMUM_VALUE),i.perPositionHeight=u,i.closeTop=X.getValueOrDefault(t.closeTop,nt.MINIMUM_VALUE,!0),i.closeBottom=X.getValueOrDefault(t.closeBottom,nt.MINIMUM_VALUE,!0),i.offsetAttribute=f,i.height=o,i.arcType=X.getValueOrDefault(t.arcType,nt.MINIMUM_VALUE,ln.GEODESIC),i.textureCoordinates=X.getValueOrUndefined(t.textureCoordinates,nt.MINIMUM_VALUE),a=oi.getGeometryExtrudedHeight(a,c),a===oi.CLAMP_TO_GROUND){let d=tg.computeRectangleFromPositions(i.polygonHierarchy.positions,i.ellipsoid,i.arcType,bCe);a=Ni.getMinimumMaximumHeights(d).minimumTerrainHeight}i.extrudedHeight=a};If.prototype._getIsClosed=function(e){let t=e.height,n=e.extrudedHeight,i=l(n)&&n!==t;return!e.perPositionHeight&&(!i&&t===0||i&&e.closeTop&&e.closeBottom)};If.DynamicGeometryUpdater=IS;function IS(e,t,n){Ri.call(this,e,t,n)}l(Object.create)&&(IS.prototype=Object.create(Ri.prototype),IS.prototype.constructor=IS);IS.prototype._isHidden=function(e,t,n){return!l(this._options.polygonHierarchy)||Ri.prototype._isHidden.call(this,e,t,n)};IS.prototype._setOptions=function(e,t,n){let i=this._options;i.polygonHierarchy=X.getValueOrUndefined(t.hierarchy,n);let r=X.getValueOrUndefined(t.height,n),o=X.getValueOrDefault(t.heightReference,n,We.NONE),s=X.getValueOrDefault(t.extrudedHeightReference,n,We.NONE),a=X.getValueOrUndefined(t.extrudedHeight,n),c=X.getValueOrUndefined(t.perPositionHeight,n);r=oi.getGeometryHeight(r,s);let u;if(c?(l(r)&&(r=void 0,yt(pCe)),o!==We.NONE&&c&&(r=void 0,yt(gCe))):(l(a)&&!l(r)&&(r=0),u=oi.computeGeometryOffsetAttribute(r,o,a,s)),i.granularity=X.getValueOrUndefined(t.granularity,n),i.stRotation=X.getValueOrUndefined(t.stRotation,n),i.textureCoordinates=X.getValueOrUndefined(t.textureCoordinates,n),i.perPositionHeight=X.getValueOrUndefined(t.perPositionHeight,n),i.closeTop=X.getValueOrDefault(t.closeTop,n,!0),i.closeBottom=X.getValueOrDefault(t.closeBottom,n,!0),i.offsetAttribute=u,i.height=r,i.arcType=X.getValueOrDefault(t.arcType,n,ln.GEODESIC),a=oi.getGeometryExtrudedHeight(a,s),a===oi.CLAMP_TO_GROUND){let f=tg.computeRectangleFromPositions(i.polygonHierarchy.positions,i.ellipsoid,i.arcType,bCe);a=Ni.getMinimumMaximumHeights(f).minimumTerrainHeight}i.extrudedHeight=a};var J8=If;function vyt(e,t,n,i){let r=new En;i.position&&(r.position=new Ne({componentDatatype:Y.DOUBLE,componentsPerAttribute:3,values:e}));let o=t.length,s=e.length/3,a=(s-o*2)/(o*2),c=mi.triangulate(t),u=(a-1)*o*6+c.length*2,f=je.createTypedArray(s,u),d,p,g,m,y,A,b=o*2,x=0;for(d=0;d<a-1;d++){for(p=0;p<o-1;p++)g=p*2+d*o*2,A=g+b,m=g+1,y=m+b,f[x++]=m,f[x++]=g,f[x++]=y,f[x++]=y,f[x++]=g,f[x++]=A;g=o*2-2+d*o*2,m=g+1,y=m+b,A=g+b,f[x++]=m,f[x++]=g,f[x++]=y,f[x++]=y,f[x++]=g,f[x++]=A}if(i.st||i.tangent||i.bitangent){let v=new Float32Array(s*2),S=1/(a-1),I=1/n.height,R=n.height/2,O,L,_=0;for(d=0;d<a;d++){for(O=d*S,L=I*(t[0].y+R),v[_++]=O,v[_++]=L,p=1;p<o;p++)L=I*(t[p].y+R),v[_++]=O,v[_++]=L,v[_++]=O,v[_++]=L;L=I*(t[0].y+R),v[_++]=O,v[_++]=L}for(p=0;p<o;p++)O=0,L=I*(t[p].y+R),v[_++]=O,v[_++]=L;for(p=0;p<o;p++)O=(a-1)*S,L=I*(t[p].y+R),v[_++]=O,v[_++]=L;r.st=new Ne({componentDatatype:Y.FLOAT,componentsPerAttribute:2,values:new Float32Array(v)})}let T=s-o*2;for(d=0;d<c.length;d+=3){let v=c[d]+T,S=c[d+1]+T,I=c[d+2]+T;f[x++]=v,f[x++]=S,f[x++]=I,f[x++]=I+o,f[x++]=S+o,f[x++]=v+o}let E=new wt({attributes:r,indices:f,boundingSphere:ue.fromVertices(e),primitiveType:Oe.TRIANGLES});if(i.normal&&(E=Wn.computeNormal(E)),i.tangent||i.bitangent){try{E=Wn.computeTangentAndBitangent(E)}catch{yt("polyline-volume-tangent-bitangent","Unable to compute tangents and bitangents for polyline volume geometry")}i.tangent||(E.attributes.tangent=void 0),i.bitangent||(E.attributes.bitangent=void 0),i.st||(E.attributes.st=void 0)}return E}function hR(e){e=e??H.EMPTY_OBJECT;let t=e.polylinePositions,n=e.shapePositions;this._positions=t,this._shape=n,this._ellipsoid=ee.clone(e.ellipsoid??ee.default),this._cornerType=e.cornerType??ur.ROUNDED,this._vertexFormat=Be.clone(e.vertexFormat??Be.DEFAULT),this._granularity=e.granularity??P.RADIANS_PER_DEGREE,this._workerName="createPolylineVolumeGeometry";let i=1+t.length*h.packedLength;i+=1+n.length*U.packedLength,this.packedLength=i+ee.packedLength+Be.packedLength+2}hR.pack=function(e,t,n){n=n??0;let i,r=e._positions,o=r.length;for(t[n++]=o,i=0;i<o;++i,n+=h.packedLength)h.pack(r[i],t,n);let s=e._shape;for(o=s.length,t[n++]=o,i=0;i<o;++i,n+=U.packedLength)U.pack(s[i],t,n);return ee.pack(e._ellipsoid,t,n),n+=ee.packedLength,Be.pack(e._vertexFormat,t,n),n+=Be.packedLength,t[n++]=e._cornerType,t[n]=e._granularity,t};var xCe=ee.clone(ee.UNIT_SPHERE),TCe=new Be,dR={polylinePositions:void 0,shapePositions:void 0,ellipsoid:xCe,vertexFormat:TCe,cornerType:void 0,granularity:void 0};hR.unpack=function(e,t,n){t=t??0;let i,r=e[t++],o=new Array(r);for(i=0;i<r;++i,t+=h.packedLength)o[i]=h.unpack(e,t);r=e[t++];let s=new Array(r);for(i=0;i<r;++i,t+=U.packedLength)s[i]=U.unpack(e,t);let a=ee.unpack(e,t,xCe);t+=ee.packedLength;let c=Be.unpack(e,t,TCe);t+=Be.packedLength;let u=e[t++],f=e[t];return l(n)?(n._positions=o,n._shape=s,n._ellipsoid=ee.clone(a,n._ellipsoid),n._vertexFormat=Be.clone(c,n._vertexFormat),n._cornerType=u,n._granularity=f,n):(dR.polylinePositions=o,dR.shapePositions=s,dR.cornerType=u,dR.granularity=f,new hR(dR))};var Syt=new et;hR.createGeometry=function(e){let t=e._positions,n=Lr(t,h.equalsEpsilon),i=e._shape;if(i=Dp.removeDuplicatesFromShape(i),n.length<2||i.length<3)return;mi.computeWindingOrder2D(i)===sa.CLOCKWISE&&i.reverse();let r=et.fromPoints(i,Syt),o=Dp.computePositions(n,i,r,e,!0);return vyt(o,i,r,e._vertexFormat)};var Z8=hR;function wyt(e,t){let n=new En;n.position=new Ne({componentDatatype:Y.DOUBLE,componentsPerAttribute:3,values:e});let i=t.length,r=n.position.values.length/3,s=e.length/3/i,a=je.createTypedArray(r,2*i*(s+1)),c,u,f=0;c=0;let d=c*i;for(u=0;u<i-1;u++)a[f++]=u+d,a[f++]=u+d+1;for(a[f++]=i-1+d,a[f++]=d,c=s-1,d=c*i,u=0;u<i-1;u++)a[f++]=u+d,a[f++]=u+d+1;for(a[f++]=i-1+d,a[f++]=d,c=0;c<s-1;c++){let g=i*c,m=g+i;for(u=0;u<i;u++)a[f++]=u+g,a[f++]=u+m}return new wt({attributes:n,indices:je.createTypedArray(r,a),boundingSphere:ue.fromVertices(e),primitiveType:Oe.LINES})}function pR(e){e=e??H.EMPTY_OBJECT;let t=e.polylinePositions,n=e.shapePositions;this._positions=t,this._shape=n,this._ellipsoid=ee.clone(e.ellipsoid??ee.default),this._cornerType=e.cornerType??ur.ROUNDED,this._granularity=e.granularity??P.RADIANS_PER_DEGREE,this._workerName="createPolylineVolumeOutlineGeometry";let i=1+t.length*h.packedLength;i+=1+n.length*U.packedLength,this.packedLength=i+ee.packedLength+2}pR.pack=function(e,t,n){n=n??0;let i,r=e._positions,o=r.length;for(t[n++]=o,i=0;i<o;++i,n+=h.packedLength)h.pack(r[i],t,n);let s=e._shape;for(o=s.length,t[n++]=o,i=0;i<o;++i,n+=U.packedLength)U.pack(s[i],t,n);return ee.pack(e._ellipsoid,t,n),n+=ee.packedLength,t[n++]=e._cornerType,t[n]=e._granularity,t};var ECe=ee.clone(ee.UNIT_SPHERE),mR={polylinePositions:void 0,shapePositions:void 0,ellipsoid:ECe,height:void 0,cornerType:void 0,granularity:void 0};pR.unpack=function(e,t,n){t=t??0;let i,r=e[t++],o=new Array(r);for(i=0;i<r;++i,t+=h.packedLength)o[i]=h.unpack(e,t);r=e[t++];let s=new Array(r);for(i=0;i<r;++i,t+=U.packedLength)s[i]=U.unpack(e,t);let a=ee.unpack(e,t,ECe);t+=ee.packedLength;let c=e[t++],u=e[t];return l(n)?(n._positions=o,n._shape=s,n._ellipsoid=ee.clone(a,n._ellipsoid),n._cornerType=c,n._granularity=u,n):(mR.polylinePositions=o,mR.shapePositions=s,mR.cornerType=c,mR.granularity=u,new pR(mR))};var Iyt=new et;pR.createGeometry=function(e){let t=e._positions,n=Lr(t,h.equalsEpsilon),i=e._shape;if(i=Dp.removeDuplicatesFromShape(i),n.length<2||i.length<3)return;mi.computeWindingOrder2D(i)===sa.CLOCKWISE&&i.reverse();let r=et.fromPoints(i,Iyt),o=Dp.computePositions(n,i,r,e,!1);return wyt(o,i)};var Q8=pR;var CCe=new z;function Pyt(e){this.id=e,this.vertexFormat=void 0,this.polylinePositions=void 0,this.shapePositions=void 0,this.cornerType=void 0,this.granularity=void 0}function Up(e,t){Oi.call(this,{entity:e,scene:t,geometryOptions:new Pyt(e),geometryPropertyName:"polylineVolume",observedPropertyNames:["availability","polylineVolume"]}),this._onEntityPropertyChanged(e,"polylineVolume",e.polylineVolume,void 0)}l(Object.create)&&(Up.prototype=Object.create(Oi.prototype),Up.prototype.constructor=Up);Up.prototype.createFillGeometryInstance=function(e){let t=this._entity,n=t.isAvailable(e),i,r,o=new Pn(n&&t.isShowing&&this._showProperty.getValue(e)&&this._fillProperty.getValue(e)),s=this._distanceDisplayConditionProperty.getValue(e),a=Qn.fromDistanceDisplayCondition(s);if(this._materialProperty instanceof Kt){let c;l(this._materialProperty.color)&&(this._materialProperty.color.isConstant||n)&&(c=this._materialProperty.color.getValue(e,CCe)),l(c)||(c=z.WHITE),r=Jt.fromColor(c),i={show:o,distanceDisplayCondition:a,color:r}}else i={show:o,distanceDisplayCondition:a};return new Bt({id:t,geometry:new Z8(this._options),attributes:i})};Up.prototype.createOutlineGeometryInstance=function(e){let t=this._entity,n=t.isAvailable(e),i=X.getValueOrDefault(this._outlineColorProperty,e,z.BLACK,CCe),r=this._distanceDisplayConditionProperty.getValue(e);return new Bt({id:t,geometry:new Q8(this._options),attributes:{show:new Pn(n&&t.isShowing&&this._showProperty.getValue(e)&&this._showOutlineProperty.getValue(e)),color:Jt.fromColor(i),distanceDisplayCondition:Qn.fromDistanceDisplayCondition(r)}})};Up.prototype._isHidden=function(e,t){return!l(t.positions)||!l(t.shape)||Oi.prototype._isHidden.call(this,e,t)};Up.prototype._isDynamic=function(e,t){return!t.positions.isConstant||!t.shape.isConstant||!X.isConstant(t.granularity)||!X.isConstant(t.outlineWidth)||!X.isConstant(t.cornerType)};Up.prototype._setStaticOptions=function(e,t){let n=t.granularity,i=t.cornerType,r=this._options,o=this._materialProperty instanceof Kt;r.vertexFormat=o?An.VERTEX_FORMAT:Cr.MaterialSupport.TEXTURED.vertexFormat,r.polylinePositions=t.positions.getValue(nt.MINIMUM_VALUE,r.polylinePositions),r.shapePositions=t.shape.getValue(nt.MINIMUM_VALUE,r.shape),r.granularity=l(n)?n.getValue(nt.MINIMUM_VALUE):void 0,r.cornerType=l(i)?i.getValue(nt.MINIMUM_VALUE):void 0};Up.DynamicGeometryUpdater=PS;function PS(e,t,n){Ri.call(this,e,t,n)}l(Object.create)&&(PS.prototype=Object.create(Ri.prototype),PS.prototype.constructor=PS);PS.prototype._isHidden=function(e,t,n){let i=this._options;return!l(i.polylinePositions)||!l(i.shapePositions)||Ri.prototype._isHidden.call(this,e,t,n)};PS.prototype._setOptions=function(e,t,n){let i=this._options;i.polylinePositions=X.getValueOrUndefined(t.positions,n,i.polylinePositions),i.shapePositions=X.getValueOrUndefined(t.shape,n),i.granularity=X.getValueOrUndefined(t.granularity,n),i.cornerType=X.getValueOrUndefined(t.cornerType,n)};var ej=Up;var Mee=new h,wCe=new h,ICe=new h,PCe=new h,DCe=new ie,Dyt=new U,Ryt=new ue,Oyt=new ue;function RCe(e,t){let n=new wt({attributes:new En,primitiveType:Oe.TRIANGLES});return n.attributes.position=new Ne({componentDatatype:Y.DOUBLE,componentsPerAttribute:3,values:t.positions}),e.normal&&(n.attributes.normal=new Ne({componentDatatype:Y.FLOAT,componentsPerAttribute:3,values:t.normals})),e.tangent&&(n.attributes.tangent=new Ne({componentDatatype:Y.FLOAT,componentsPerAttribute:3,values:t.tangents})),e.bitangent&&(n.attributes.bitangent=new Ne({componentDatatype:Y.FLOAT,componentsPerAttribute:3,values:t.bitangents})),n}function Myt(e,t,n,i){let r=e.length,o=t.normal?new Float32Array(r):void 0,s=t.tangent?new Float32Array(r):void 0,a=t.bitangent?new Float32Array(r):void 0,c=0,u=PCe,f=ICe,d=wCe;if(t.normal||t.tangent||t.bitangent)for(let p=0;p<r;p+=3){let g=h.fromArray(e,p,Mee),m=c+1,y=c+2;d=n.geodeticSurfaceNormal(g,d),(t.tangent||t.bitangent)&&(h.cross(h.UNIT_Z,d,f),$.multiplyByVector(i,f,f),h.normalize(f,f),t.bitangent&&h.normalize(h.cross(d,f,u),u)),t.normal&&(o[c]=d.x,o[m]=d.y,o[y]=d.z),t.tangent&&(s[c]=f.x,s[m]=f.y,s[y]=f.z),t.bitangent&&(a[c]=u.x,a[m]=u.y,a[y]=u.z),c+=3}return RCe(t,{positions:e,normals:o,tangents:s,bitangents:a})}var Nee=new h,OCe=new h;function Nyt(e,t,n){let i=e.length,r=t.normal?new Float32Array(i):void 0,o=t.tangent?new Float32Array(i):void 0,s=t.bitangent?new Float32Array(i):void 0,a=0,c=0,u=0,f=!0,d=PCe,p=ICe,g=wCe;if(t.normal||t.tangent||t.bitangent)for(let m=0;m<i;m+=6){let y=h.fromArray(e,m,Mee),A=h.fromArray(e,(m+6)%i,Nee);if(f){let b=h.fromArray(e,(m+3)%i,OCe);h.subtract(A,y,A),h.subtract(b,y,b),g=h.normalize(h.cross(b,A,g),g),f=!1}h.equalsEpsilon(A,y,P.EPSILON10)&&(f=!0),(t.tangent||t.bitangent)&&(d=n.geodeticSurfaceNormal(y,d),t.tangent&&(p=h.normalize(h.cross(d,g,p),p))),t.normal&&(r[a++]=g.x,r[a++]=g.y,r[a++]=g.z,r[a++]=g.x,r[a++]=g.y,r[a++]=g.z),t.tangent&&(o[c++]=p.x,o[c++]=p.y,o[c++]=p.z,o[c++]=p.x,o[c++]=p.y,o[c++]=p.z),t.bitangent&&(s[u++]=d.x,s[u++]=d.y,s[u++]=d.z,s[u++]=d.x,s[u++]=d.y,s[u++]=d.z)}return RCe(t,{positions:e,normals:r,tangents:o,bitangents:s})}function MCe(e,t){let n=e._vertexFormat,i=e._ellipsoid,r=t.height,o=t.width,s=t.northCap,a=t.southCap,c=0,u=r,f=r,d=0;s&&(c=1,f-=1,d+=1),a&&(u-=1,f-=1,d+=1),d+=o*f;let p=n.position?new Float64Array(d*3):void 0,g=n.st?new Float32Array(d*2):void 0,m=0,y=0,A=Mee,b=Dyt,x=Number.MAX_VALUE,T=Number.MAX_VALUE,E=-Number.MAX_VALUE,v=-Number.MAX_VALUE;for(let C=c;C<u;++C)for(let w=0;w<o;++w)Ua.computePosition(t,i,n.st,C,w,A,b),p[m++]=A.x,p[m++]=A.y,p[m++]=A.z,n.st&&(g[y++]=b.x,g[y++]=b.y,x=Math.min(x,b.x),T=Math.min(T,b.y),E=Math.max(E,b.x),v=Math.max(v,b.y));if(s&&(Ua.computePosition(t,i,n.st,0,0,A,b),p[m++]=A.x,p[m++]=A.y,p[m++]=A.z,n.st&&(g[y++]=b.x,g[y++]=b.y,x=b.x,T=b.y,E=b.x,v=b.y)),a&&(Ua.computePosition(t,i,n.st,r-1,0,A,b),p[m++]=A.x,p[m++]=A.y,p[m]=A.z,n.st&&(g[y++]=b.x,g[y]=b.y,x=Math.min(x,b.x),T=Math.min(T,b.y),E=Math.max(E,b.x),v=Math.max(v,b.y))),n.st&&(x<0||T<0||E>1||v>1))for(let C=0;C<g.length;C+=2)g[C]=(g[C]-x)/(E-x),g[C+1]=(g[C+1]-T)/(v-T);let S=Myt(p,n,i,t.tangentRotationMatrix),I=6*(o-1)*(f-1);s&&(I+=3*(o-1)),a&&(I+=3*(o-1));let R=je.createTypedArray(d,I),O=0,L=0,_;for(_=0;_<f-1;++_){for(let C=0;C<o-1;++C){let w=O,D=w+o,N=D+1,F=w+1;R[L++]=w,R[L++]=D,R[L++]=F,R[L++]=F,R[L++]=D,R[L++]=N,++O}++O}if(s||a){let C=d-1,w=d-1;s&&a&&(C=d-2);let D,N;if(O=0,s)for(_=0;_<o-1;_++)D=O,N=D+1,R[L++]=C,R[L++]=D,R[L++]=N,++O;if(a)for(O=(f-1)*o,_=0;_<o-1;_++)D=O,N=D+1,R[L++]=D,R[L++]=w,R[L++]=N,++O}return S.indices=R,n.st&&(S.attributes.st=new Ne({componentDatatype:Y.FLOAT,componentsPerAttribute:2,values:g})),S}function DS(e,t,n,i,r){return e[t++]=i[n],e[t++]=i[n+1],e[t++]=i[n+2],e[t++]=r[n],e[t++]=r[n+1],e[t]=r[n+2],e}function RS(e,t,n,i){return e[t++]=i[n],e[t++]=i[n+1],e[t++]=i[n],e[t]=i[n+1],e}var Lee=new Be;function Lyt(e,t){let n=e._shadowVolume,i=e._offsetAttribute,r=e._vertexFormat,o=e._extrudedHeight,s=e._surfaceHeight,a=e._ellipsoid,c=t.height,u=t.width,f;if(n){let Pe=Be.clone(r,Lee);Pe.normal=!0,e._vertexFormat=Pe}let d=MCe(e,t);n&&(e._vertexFormat=r);let p=mi.scaleToGeodeticHeight(d.attributes.position.values,s,a,!1);p=new Float64Array(p);let g=p.length,m=g*2,y=new Float64Array(m);y.set(p);let A=mi.scaleToGeodeticHeight(d.attributes.position.values,o,a);y.set(A,g),d.attributes.position.values=y;let b=r.normal?new Float32Array(m):void 0,x=r.tangent?new Float32Array(m):void 0,T=r.bitangent?new Float32Array(m):void 0,E=r.st?new Float32Array(m/3*2):void 0,v,S;if(r.normal){for(S=d.attributes.normal.values,b.set(S),f=0;f<g;f++)S[f]=-S[f];b.set(S,g),d.attributes.normal.values=b}if(n){S=d.attributes.normal.values,r.normal||(d.attributes.normal=void 0);let Pe=new Float32Array(m);for(f=0;f<g;f++)S[f]=-S[f];Pe.set(S,g),d.attributes.extrudeDirection=new Ne({componentDatatype:Y.FLOAT,componentsPerAttribute:3,values:Pe})}let I,R=l(i);if(R){let Pe=g/3*2,qe=new Uint8Array(Pe);i===pn.TOP?qe=qe.fill(1,0,Pe/2):(I=i===pn.NONE?0:1,qe=qe.fill(I)),d.attributes.applyOffset=new Ne({componentDatatype:Y.UNSIGNED_BYTE,componentsPerAttribute:1,values:qe})}if(r.tangent){let Pe=d.attributes.tangent.values;for(x.set(Pe),f=0;f<g;f++)Pe[f]=-Pe[f];x.set(Pe,g),d.attributes.tangent.values=x}if(r.bitangent){let Pe=d.attributes.bitangent.values;T.set(Pe),T.set(Pe,g),d.attributes.bitangent.values=T}r.st&&(v=d.attributes.st.values,E.set(v),E.set(v,g/3*2),d.attributes.st.values=E);let O=d.indices,L=O.length,_=g/3,C=je.createTypedArray(m/3,L*2);for(C.set(O),f=0;f<L;f+=3)C[f+L]=O[f+2]+_,C[f+1+L]=O[f+1]+_,C[f+2+L]=O[f]+_;d.indices=C;let w=t.northCap,D=t.southCap,N=c,F=2,V=0,B=4,j=4;w&&(F-=1,N-=1,V+=1,B-=2,j-=1),D&&(F-=1,N-=1,V+=1,B-=2,j-=1),V+=F*u+2*N-B;let k=(V+j)*2,G=new Float64Array(k*3),q=n?new Float32Array(k*3):void 0,Q=R?new Uint8Array(k):void 0,W=r.st?new Float32Array(k*2):void 0,J=i===pn.TOP;R&&!J&&(I=i===pn.ALL?1:0,Q=Q.fill(I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ute:2,values:W})),n&&(we.attributes.extrudeDirection=new Ne({componentDatatype:Y.FLOAT,componentsPerAttribute:3,values:q})),R&&(we.attributes.applyOffset=new Ne({componentDatatype:Y.UNSIGNED_BYTE,componentsPerAttribute:1,values:Q}));let ve=je.createTypedArray(k,V*6),Re,Qe,He,Ye;g=G.length/3;let Ke=0;for(f=0;f<g-1;f+=2){Re=f,Ye=(Re+2)%g;let Pe=h.fromArray(G,Re*3,Nee),qe=h.fromArray(G,Ye*3,OCe);h.equalsEpsilon(Pe,qe,P.EPSILON10)||(Qe=(Re+1)%g,He=(Qe+2)%g,ve[Ke++]=Re,ve[Ke++]=Qe,ve[Ke++]=Ye,ve[Ke++]=Ye,ve[Ke++]=Qe,ve[Ke++]=He)}return we.indices=ve,we=Wn.combineInstances([new Bt({geometry:d}),new Bt({geometry:we})]),we[0]}var Fyt=[new h,new h,new h,new h],NCe=new he,Byt=new he;function Fee(e,t,n,i,r){if(n===0)return ie.clone(e,r);let o=Ua.computeOptions(e,t,n,0,DCe,NCe),s=o.height,a=o.width,c=Fyt;return Ua.computePosition(o,i,!1,0,0,c[0]),Ua.computePosition(o,i,!1,0,a-1,c[1]),Ua.computePosition(o,i,!1,s-1,0,c[2]),Ua.computePosition(o,i,!1,s-1,a-1,c[3]),ie.fromCartesianArray(c,i,r)}function zp(e){e=e??H.EMPTY_OBJECT;let t=e.rectangle,n=e.height??0,i=e.extrudedHeight??n;this._rectangle=ie.clone(t),this._granularity=e.granularity??P.RADIANS_PER_DEGREE,this._ellipsoid=ee.clone(e.ellipsoid??ee.default),this._surfaceHeight=Math.max(n,i),this._rotation=e.rotation??0,this._stRotation=e.stRotation??0,this._vertexFormat=Be.clone(e.vertexFormat??Be.DEFAULT),this._extrudedHeight=Math.min(n,i),this._shadowVolume=e.shadowVolume??!1,this._workerName="createRectangleGeometry",this._offsetAttribute=e.offsetAttribute,this._rotatedRectangle=void 0,this._textureCoordinateRotationPoints=void 0}zp.packedLength=ie.packedLength+ee.packedLength+Be.packedLength+7;zp.pack=function(e,t,n){return n=n??0,ie.pack(e._rectangle,t,n),n+=ie.packedLength,ee.pack(e._ellipsoid,t,n),n+=ee.packedLength,Be.pack(e._vertexFormat,t,n),n+=Be.packedLength,t[n++]=e._granularity,t[n++]=e._surfaceHeight,t[n++]=e._rotation,t[n++]=e._stRotation,t[n++]=e._extrudedHeight,t[n++]=e._shadowVolume?1:0,t[n]=e._offsetAttribute??-1,t};var LCe=new ie,FCe=ee.clone(ee.UNIT_SPHERE),hA={rectangle:LCe,ellipsoid:FCe,vertexFormat:Lee,granularity:void 0,height:void 0,rotation:void 0,stRotation:void 0,extrudedHeight:void 0,shadowVolume:void 0,offsetAttribute:void 0};zp.unpack=function(e,t,n){t=t??0;let i=ie.unpack(e,t,LCe);t+=ie.packedLength;let r=ee.unpack(e,t,FCe);t+=ee.packedLength;let o=Be.unpack(e,t,Lee);t+=Be.packedLength;let s=e[t++],a=e[t++],c=e[t++],u=e[t++],f=e[t++],d=e[t++]===1,p=e[t];return l(n)?(n._rectangle=ie.clone(i,n._rectangle),n._ellipsoid=ee.clone(r,n._ellipsoid),n._vertexFormat=Be.clone(o,n._vertexFormat),n._granularity=s,n._surfaceHeight=a,n._rotation=c,n._stRotation=u,n._extrudedHeight=f,n._shadowVolume=d,n._offsetAttribute=p===-1?void 0:p,n):(hA.granularity=s,hA.height=a,hA.rotation=c,hA.stRotation=u,hA.extrudedHeight=f,hA.shadowVolume=d,hA.offsetAttribute=p===-1?void 0:p,new zp(hA))};zp.computeRectangle=function(e,t){e=e??H.EMPTY_OBJECT;let n=e.rectangle,i=e.granularity??P.RADIANS_PER_DEGREE,r=e.ellipsoid??ee.default,o=e.rotation??0;return Fee(n,i,o,r,t)};var kyt=new $,vCe=new Le,Uyt=new he;zp.createGeometry=function(e){if(P.equalsEpsilon(e._rectangle.north,e._rectangle.south,P.EPSILON10)||P.equalsEpsilon(e._rectangle.east,e._rectangle.west,P.EPSILON10))return;let t=e._rectangle,n=e._ellipsoid,i=e._rotation,r=e._stRotation,o=e._vertexFormat,s=Ua.computeOptions(t,e._granularity,i,r,DCe,NCe,Byt),a=kyt;if(r!==0||i!==0){let g=ie.center(t,Uyt),m=n.geodeticSurfaceNormalCartographic(g,Nee);Le.fromAxisAngle(m,-r,vCe),$.fromQuaternion(vCe,a)}else $.clone($.IDENTITY,a);let c=e._surfaceHeight,u=e._extrudedHeight,f=!P.equalsEpsilon(c,u,0,P.EPSILON2);s.lonScalar=1/e._rectangle.width,s.latScalar=1/e._rectangle.height,s.tangentRotationMatrix=a;let d,p;if(t=e._rectangle,f){d=Lyt(e,s);let g=ue.fromRectangle3D(t,n,c,Oyt),m=ue.fromRectangle3D(t,n,u,Ryt);p=ue.union(g,m)}else{if(d=MCe(e,s),d.attributes.position.values=mi.scaleToGeodeticHeight(d.attributes.position.values,c,n,!1),l(e._offsetAttribute)){let g=d.attributes.position.values.length,m=e._offsetAttribute===pn.NONE?0:1,y=new Uint8Array(g/3).fill(m);d.attributes.applyOffset=new Ne({componentDatatype:Y.UNSIGNED_BYTE,componentsPerAttribute:1,values:y})}p=ue.fromRectangle3D(t,n,c)}return o.position||delete d.attributes.position,new wt({attributes:d.attributes,indices:d.indices,primitiveType:d.primitiveType,boundingSphere:p,offsetAttribute:e._offsetAttribute})};zp.createShadowVolume=function(e,t,n){let i=e._granularity,r=e._ellipsoid,o=t(i,r),s=n(i,r);return new zp({rectangle:e._rectangle,rotation:e._rotation,ellipsoid:r,stRotation:e._stRotation,granularity:i,extrudedHeight:s,height:o,vertexFormat:Be.POSITION_ONLY,shadowVolume:!0})};var SCe=new ie,zyt=[new U,new U,new U],Vyt=new $i,jyt=new he;function Hyt(e){if(e._stRotation===0)return[0,0,0,1,1,0];let t=ie.clone(e._rectangle,SCe),n=e._granularity,i=e._ellipsoid,r=e._rotation-e._stRotation,o=Fee(t,n,r,i,SCe),s=zyt;s[0].x=o.west,s[0].y=o.south,s[1].x=o.west,s[1].y=o.north,s[2].x=o.east,s[2].y=o.south;let a=e.rectangle,c=$i.fromRotation(e._stRotation,Vyt),u=ie.center(a,jyt);for(let m=0;m<3;++m){let y=s[m];y.x-=u.longitude,y.y-=u.latitude,$i.multiplyByVector(c,y,y),y.x+=u.longitude,y.y+=u.latitude,y.x=(y.x-a.west)/a.width,y.y=(y.y-a.south)/a.height}let f=s[0],d=s[1],p=s[2],g=new Array(6);return U.pack(f,g),U.pack(d,g,2),U.pack(p,g,4),g}Object.defineProperties(zp.prototype,{rectangle:{get:function(){return l(this._rotatedRectangle)||(this._rotatedRectangle=Fee(this._rectangle,this._granularity,this._rotation,this._ellipsoid)),this._rotatedRectangle}},textureCoordinateRotationPoints:{get:function(){return l(this._textureCoordinateRotationPoints)||(this._textureCoordinateRotationPoints=Hyt(this)),this._textureCoordinateRotationPoints}}});var OS=zp;var BCe=new z,kCe=h.ZERO,UCe=new h,zCe=new ie,Gyt=new ie,Wyt=new he;function qyt(e){this.id=e,this.vertexFormat=void 0,this.rectangle=void 0,this.height=void 0,this.extrudedHeight=void 0,this.granularity=void 0,this.stRotation=void 0,this.rotation=void 0,this.offsetAttribute=void 0}function Jh(e,t){oi.call(this,{entity:e,scene:t,geometryOptions:new qyt(e),geometryPropertyName:"rectangle",observedPropertyNames:["availability","rectangle"]}),this._onEntityPropertyChanged(e,"rectangle",e.rectangle,void 0)}l(Object.create)&&(Jh.prototype=Object.create(oi.prototype),Jh.prototype.constructor=Jh);Jh.prototype.createFillGeometryInstance=function(e){let t=this._entity,n=t.isAvailable(e),i={show:new Pn(n&&t.isShowing&&this._showProperty.getValue(e)&&this._fillProperty.getValue(e)),distanceDisplayCondition:Qn.fromDistanceDisplayCondition(this._distanceDisplayConditionProperty.getValue(e)),offset:void 0,color:void 0};if(this._materialProperty instanceof Kt){let r;l(this._materialProperty.color)&&(this._materialProperty.color.isConstant||n)&&(r=this._materialProperty.color.getValue(e,BCe)),l(r)||(r=z.WHITE),i.color=Jt.fromColor(r)}return l(this._options.offsetAttribute)&&(i.offset=Er.fromCartesian3(X.getValueOrDefault(this._terrainOffsetProperty,e,kCe,UCe))),new Bt({id:t,geometry:new OS(this._options),attributes:i})};Jh.prototype.createOutlineGeometryInstance=function(e){let t=this._entity,n=t.isAvailable(e),i=X.getValueOrDefault(this._outlineColorProperty,e,z.BLACK,BCe),r=this._distanceDisplayConditionProperty.getValue(e),o={show:new Pn(n&&t.isShowing&&this._showProperty.getValue(e)&&this._showOutlineProperty.getValue(e)),color:Jt.fromColor(i),distanceDisplayCondition:Qn.fromDistanceDisplayCondition(r),offset:void 0};return l(this._options.offsetAttribute)&&(o.offset=Er.fromCartesian3(X.getValueOrDefault(this._terrainOffsetProperty,e,kCe,UCe))),new Bt({id:t,geometry:new Gv(this._options),attributes:o})};Jh.prototype._computeCenter=function(e,t){let n=X.getValueOrUndefined(this._entity.rectangle.coordinates,e,Gyt);if(!l(n))return;let i=ie.center(n,Wyt);return he.toCartesian(i,ee.default,t)};Jh.prototype._isHidden=function(e,t){return!l(t.coordinates)||Oi.prototype._isHidden.call(this,e,t)};Jh.prototype._isDynamic=function(e,t){return!t.coordinates.isConstant||!X.isConstant(t.height)||!X.isConstant(t.extrudedHeight)||!X.isConstant(t.granularity)||!X.isConstant(t.stRotation)||!X.isConstant(t.rotation)||!X.isConstant(t.outlineWidth)||!X.isConstant(t.zIndex)||this._onTerrain&&!X.isConstant(this._materialProperty)&&!(this._materialProperty instanceof Kt)};Jh.prototype._setStaticOptions=function(e,t){let n=this._materialProperty instanceof Kt,i=X.getValueOrUndefined(t.height,nt.MINIMUM_VALUE),r=X.getValueOrDefault(t.heightReference,nt.MINIMUM_VALUE,We.NONE),o=X.getValueOrUndefined(t.extrudedHeight,nt.MINIMUM_VALUE),s=X.getValueOrDefault(t.extrudedHeightReference,nt.MINIMUM_VALUE,We.NONE);l(o)&&!l(i)&&(i=0);let a=this._options;a.vertexFormat=n?An.VERTEX_FORMAT:Cr.MaterialSupport.TEXTURED.vertexFormat,a.rectangle=t.coordinates.getValue(nt.MINIMUM_VALUE,a.rectangle),a.granularity=X.getValueOrUndefined(t.granularity,nt.MINIMUM_VALUE),a.stRotation=X.getValueOrUndefined(t.stRotation,nt.MINIMUM_VALUE),a.rotation=X.getValueOrUndefined(t.rotation,nt.MINIMUM_VALUE),a.offsetAttribute=oi.computeGeometryOffsetAttribute(i,r,o,s),a.height=oi.getGeometryHeight(i,r),o=oi.getGeometryExtrudedHeight(o,s),o===oi.CLAMP_TO_GROUND&&(o=Ni.getMinimumMaximumHeights(OS.computeRectangle(a,zCe)).minimumTerrainHeight),a.extrudedHeight=o};Jh.DynamicGeometryUpdater=MS;function MS(e,t,n){Ri.call(this,e,t,n)}l(Object.create)&&(MS.prototype=Object.create(Ri.prototype),MS.prototype.constructor=MS);MS.prototype._isHidden=function(e,t,n){return!l(this._options.rectangle)||Ri.prototype._isHidden.call(this,e,t,n)};MS.prototype._setOptions=function(e,t,n){let i=this._options,r=X.getValueOrUndefined(t.height,n),o=X.getValueOrDefault(t.heightReference,n,We.NONE),s=X.getValueOrUndefined(t.extrudedHeight,n),a=X.getValueOrDefault(t.extrudedHeightReference,n,We.NONE);l(s)&&!l(r)&&(r=0),i.rectangle=X.getValueOrUndefined(t.coordinates,n,i.rectangle),i.granularity=X.getValueOrUndefined(t.granularity,n),i.stRotation=X.getValueOrUndefined(t.stRotation,n),i.rotation=X.getValueOrUndefined(t.rotation,n),i.offsetAttribute=oi.computeGeometryOffsetAttribute(r,o,s,a),i.height=oi.getGeometryHeight(r,o),s=oi.getGeometryExtrudedHeight(s,a),s===oi.CLAMP_TO_GROUND&&(s=Ni.getMinimumMaximumHeights(OS.computeRectangle(i,zCe)).minimumTerrainHeight),i.extrudedHeight=s};var tj=Jh;var VCe={};function Yyt(e,t){return P.equalsEpsilon(e.latitude,t.latitude,P.EPSILON10)&&P.equalsEpsilon(e.longitude,t.longitude,P.EPSILON10)}var Xyt=new he,Kyt=new he;function $yt(e,t,n,i){t=Lr(t,h.equalsEpsilon);let r=t.length;if(r<2)return;let o=l(i),s=l(n),a=new Array(r),c=new Array(r),u=new Array(r),f=t[0];a[0]=f;let d=e.cartesianToCartographic(f,Xyt);s&&(d.height=n[0]),c[0]=d.height,o?u[0]=i[0]:u[0]=0;let p=c[0],g=u[0],m=p===g,y=1;for(let A=1;A<r;++A){let b=t[A],x=e.cartesianToCartographic(b,Kyt);s&&(x.height=n[A]),m=m&&x.height===0,Yyt(d,x)?d.height<x.height&&(c[y-1]=x.height):(a[y]=b,c[y]=x.height,o?u[y]=i[A]:u[y]=0,m=m&&c[y]===u[y],he.clone(x,d),++y)}if(!(m||y<2))return a.length=y,c.length=y,u.length=y,{positions:a,topHeights:c,bottomHeights:u}}var Jyt=new Array(2),Zyt=new Array(2),Qyt={positions:void 0,height:void 0,granularity:void 0,ellipsoid:void 0};VCe.computePositions=function(e,t,n,i,r,o){let s=$yt(e,t,n,i);if(!l(s))return;t=s.positions,n=s.topHeights,i=s.bottomHeights;let a=t.length,c=a-2,u,f,d=P.chordLength(r,e.maximumRadius),p=Qyt;if(p.minDistance=d,p.ellipsoid=e,o){let g=0,m;for(m=0;m<a-1;m++)g+=lr.numberOfPoints(t[m],t[m+1],d)+1;u=new Float64Array(g*3),f=new Float64Array(g*3);let y=Jyt,A=Zyt;p.positions=y,p.height=A;let b=0;for(m=0;m<a-1;m++){y[0]=t[m],y[1]=t[m+1],A[0]=n[m],A[1]=n[m+1];let x=lr.generateArc(p);u.set(x,b),A[0]=i[m],A[1]=i[m+1],f.set(lr.generateArc(p),b),b+=x.length}}else p.positions=t,p.height=n,u=new Float64Array(lr.generateArc(p)),p.height=i,f=new Float64Array(lr.generateArc(p));return{bottomPositions:f,topPositions:u,numCorners:c}};var NS=VCe;var Bee=new h,nj=new h,eAt=new h,jCe=new h,tAt=new h,nAt=new h,iAt=new h;function Zx(e){e=e??H.EMPTY_OBJECT;let t=e.positions,n=e.maximumHeights,i=e.minimumHeights,r=e.vertexFormat??Be.DEFAULT,o=e.granularity??P.RADIANS_PER_DEGREE,s=e.ellipsoid??ee.default;this._positions=t,this._minimumHeights=i,this._maximumHeights=n,this._vertexFormat=Be.clone(r),this._granularity=o,this._ellipsoid=ee.clone(s),this._workerName="createWallGeometry";let a=1+t.length*h.packedLength+2;l(i)&&(a+=i.length),l(n)&&(a+=n.length),this.packedLength=a+ee.packedLength+Be.packedLength+1}Zx.pack=function(e,t,n){n=n??0;let i,r=e._positions,o=r.length;for(t[n++]=o,i=0;i<o;++i,n+=h.packedLength)h.pack(r[i],t,n);let s=e._minimumHeights;if(o=l(s)?s.length:0,t[n++]=o,l(s))for(i=0;i<o;++i)t[n++]=s[i];let a=e._maximumHeights;if(o=l(a)?a.length:0,t[n++]=o,l(a))for(i=0;i<o;++i)t[n++]=a[i];return ee.pack(e._ellipsoid,t,n),n+=ee.packedLength,Be.pack(e._vertexFormat,t,n),n+=Be.packedLength,t[n]=e._granularity,t};var HCe=ee.clone(ee.UNIT_SPHERE),GCe=new Be,gR={positions:void 0,minimumHeights:void 0,maximumHeights:void 0,ellipsoid:HCe,vertexFormat:GCe,granularity:void 0};Zx.unpack=function(e,t,n){t=t??0;let i,r=e[t++],o=new Array(r);for(i=0;i<r;++i,t+=h.packedLength)o[i]=h.unpack(e,t);r=e[t++];let s;if(r>0)for(s=new Array(r),i=0;i<r;++i)s[i]=e[t++];r=e[t++];let a;if(r>0)for(a=new Array(r),i=0;i<r;++i)a[i]=e[t++];let c=ee.unpack(e,t,HCe);t+=ee.packedLength;let u=Be.unpack(e,t,GCe);t+=Be.packedLength;let f=e[t];return l(n)?(n._positions=o,n._minimumHeights=s,n._maximumHeights=a,n._ellipsoid=ee.clone(c,n._ellipsoid),n._vertexFormat=Be.clone(u,n._vertexFormat),n._granularity=f,n):(gR.positions=o,gR.minimumHeights=s,gR.maximumHeights=a,gR.granularity=f,new Zx(gR))};Zx.fromConstantHeights=function(e){e=e??H.EMPTY_OBJECT;let t=e.positions,n,i,r=e.minimumHeight,o=e.maximumHeight,s=l(r),a=l(o);if(s||a){let u=t.length;n=s?new Array(u):void 0,i=a?new Array(u):void 0;for(let f=0;f<u;++f)s&&(n[f]=r),a&&(i[f]=o)}let c={positions:t,maximumHeights:i,minimumHeights:n,ellipsoid:e.ellipsoid,vertexFormat:e.vertexFormat};return new Zx(c)};Zx.createGeometry=function(e){let t=e._positions,n=e._minimumHeights,i=e._maximumHeights,r=e._vertexFormat,o=e._granularity,s=e._ellipsoid,a=NS.computePositions(s,t,i,n,o,!0);if(!l(a))return;let c=a.bottomPositions,u=a.topPositions,f=a.numCorners,d=u.length,p=d*2,g=r.position?new Float64Array(p):void 0,m=r.normal?new Float32Array(p):void 0,y=r.tangent?new Float32Array(p):void 0,A=r.bitangent?new Float32Array(p):void 0,b=r.st?new Float32Array(p/3*2):void 0,x=0,T=0,E=0,v=0,S=0,I=iAt,R=nAt,O=tAt,L=!0;d/=3;let _,C=0,w=1/(d-f-1);for(_=0;_<d;++_){let B=_*3,j=h.fromArray(u,B,Bee),k=h.fromArray(c,B,nj);if(r.position&&(g[x++]=k.x,g[x++]=k.y,g[x++]=k.z,g[x++]=j.x,g[x++]=j.y,g[x++]=j.z),r.st&&(b[S++]=C,b[S++]=0,b[S++]=C,b[S++]=1),r.normal||r.tangent||r.bitangent){let G=h.clone(h.ZERO,jCe),q=h.subtract(j,s.geodeticSurfaceNormal(j,nj),nj);if(_+1<d&&(G=h.fromArray(u,B+3,jCe)),L){let Q=h.subtract(G,j,eAt),W=h.subtract(q,j,Bee);I=h.normalize(h.cross(W,Q,I),I),L=!1}h.equalsEpsilon(j,G,P.EPSILON10)?L=!0:(C+=w,r.tangent&&(R=h.normalize(h.subtract(G,j,R),R)),r.bitangent&&(O=h.normalize(h.cross(I,R,O),O))),r.normal&&(m[T++]=I.x,m[T++]=I.y,m[T++]=I.z,m[T++]=I.x,m[T++]=I.y,m[T++]=I.z),r.tangent&&(y[v++]=R.x,y[v++]=R.y,y[v++]=R.z,y[v++]=R.x,y[v++]=R.y,y[v++]=R.z),r.bitangent&&(A[E++]=O.x,A[E++]=O.y,A[E++]=O.z,A[E++]=O.x,A[E++]=O.y,A[E++]=O.z)}}let D=new En;r.position&&(D.position=new Ne({componentDatatype:Y.DOUBLE,componentsPerAttribute:3,values:g})),r.normal&&(D.normal=new Ne({componentDatatype:Y.FLOAT,componentsPerAttribute:3,values:m})),r.tangent&&(D.tangent=new Ne({componentDatatype:Y.FLOAT,componentsPerAttribute:3,values:y})),r.bitangent&&(D.bitangent=new Ne({componentDatatype:Y.FLOAT,componentsPerAttribute:3,values:A})),r.st&&(D.st=new Ne({componentDatatype:Y.FLOAT,componentsPerAttribute:2,values:b}));let N=p/3;p-=6*(f+1);let F=je.createTypedArray(N,p),V=0;for(_=0;_<N-2;_+=2){let B=_,j=_+2,k=h.fromArray(g,B*3,Bee),G=h.fromArray(g,j*3,nj);if(h.equalsEpsilon(k,G,P.EPSILON10))continue;let q=_+1,Q=_+3;F[V++]=q,F[V++]=B,F[V++]=Q,F[V++]=Q,F[V++]=B,F[V++]=j}return new wt({attributes:D,indices:F,primitiveType:Oe.TRIANGLES,boundingSphere:ue.fromVertices(g)})};var ij=Zx;var WCe=new h,qCe=new h;function Qx(e){e=e??H.EMPTY_OBJECT;let t=e.positions,n=e.maximumHeights,i=e.minimumHeights,r=e.granularity??P.RADIANS_PER_DEGREE,o=e.ellipsoid??ee.default;this._positions=t,this._minimumHeights=i,this._maximumHeights=n,this._granularity=r,this._ellipsoid=ee.clone(o),this._workerName="createWallOutlineGeometry";let s=1+t.length*h.packedLength+2;l(i)&&(s+=i.length),l(n)&&(s+=n.length),this.packedLength=s+ee.packedLength+1}Qx.pack=function(e,t,n){n=n??0;let i,r=e._positions,o=r.length;for(t[n++]=o,i=0;i<o;++i,n+=h.packedLength)h.pack(r[i],t,n);let s=e._minimumHeights;if(o=l(s)?s.length:0,t[n++]=o,l(s))for(i=0;i<o;++i)t[n++]=s[i];let a=e._maximumHeights;if(o=l(a)?a.length:0,t[n++]=o,l(a))for(i=0;i<o;++i)t[n++]=a[i];return ee.pack(e._ellipsoid,t,n),n+=ee.packedLength,t[n]=e._granularity,t};var YCe=ee.clone(ee.UNIT_SPHERE),_R={positions:void 0,minimumHeights:void 0,maximumHeights:void 0,ellipsoid:YCe,granularity:void 0};Qx.unpack=function(e,t,n){t=t??0;let i,r=e[t++],o=new Array(r);for(i=0;i<r;++i,t+=h.packedLength)o[i]=h.unpack(e,t);r=e[t++];let s;if(r>0)for(s=new Array(r),i=0;i<r;++i)s[i]=e[t++];r=e[t++];let a;if(r>0)for(a=new Array(r),i=0;i<r;++i)a[i]=e[t++];let c=ee.unpack(e,t,YCe);t+=ee.packedLength;let u=e[t];return l(n)?(n._positions=o,n._minimumHeights=s,n._maximumHeights=a,n._ellipsoid=ee.clone(c,n._ellipsoid),n._granularity=u,n):(_R.positions=o,_R.minimumHeights=s,_R.maximumHeights=a,_R.granularity=u,new Qx(_R))};Qx.fromConstantHeights=function(e){e=e??H.EMPTY_OBJECT;let t=e.positions,n,i,r=e.minimumHeight,o=e.maximumHeight,s=l(r),a=l(o);if(s||a){let u=t.length;n=s?new Array(u):void 0,i=a?new Array(u):void 0;for(let f=0;f<u;++f)s&&(n[f]=r),a&&(i[f]=o)}let c={positions:t,maximumHeights:i,minimumHeights:n,ellipsoid:e.ellipsoid};return new Qx(c)};Qx.createGeometry=function(e){let t=e._positions,n=e._minimumHeights,i=e._maximumHeights,r=e._granularity,o=e._ellipsoid,s=NS.computePositions(o,t,i,n,r,!1);if(!l(s))return;let a=s.bottomPositions,c=s.topPositions,u=c.length,f=u*2,d=new Float64Array(f),p=0;u/=3;let g;for(g=0;g<u;++g){let x=g*3,T=h.fromArray(c,x,WCe),E=h.fromArray(a,x,qCe);d[p++]=E.x,d[p++]=E.y,d[p++]=E.z,d[p++]=T.x,d[p++]=T.y,d[p++]=T.z}let m=new En({position:new Ne({componentDatatype:Y.DOUBLE,componentsPerAttribute:3,values:d})}),y=f/3;f=2*y-4+y;let A=je.createTypedArray(y,f),b=0;for(g=0;g<y-2;g+=2){let x=g,T=g+2,E=h.fromArray(d,x*3,WCe),v=h.fromArray(d,T*3,qCe);if(h.equalsEpsilon(E,v,P.EPSILON10))continue;let S=g+1,I=g+3;A[b++]=S,A[b++]=x,A[b++]=S,A[b++]=I,A[b++]=x,A[b++]=T}return A[b++]=y-2,A[b]=y-1,new wt({attributes:m,indices:A,primitiveType:Oe.LINES,boundingSphere:ue.fromVertices(d)})};var rj=Qx;var XCe=new z;function rAt(e){this.id=e,this.vertexFormat=void 0,this.positions=void 0,this.minimumHeights=void 0,this.maximumHeights=void 0,this.granularity=void 0}function Zh(e,t){Oi.call(this,{entity:e,scene:t,geometryOptions:new rAt(e),geometryPropertyName:"wall",observedPropertyNames:["availability","wall"]}),this._onEntityPropertyChanged(e,"wall",e.wall,void 0)}l(Object.create)&&(Zh.prototype=Object.create(Oi.prototype),Zh.prototype.constructor=Zh);Zh.prototype.createFillGeometryInstance=function(e){let t=this._entity,n=t.isAvailable(e),i,r,o=new Pn(n&&t.isShowing&&this._showProperty.getValue(e)&&this._fillProperty.getValue(e)),s=this._distanceDisplayConditionProperty.getValue(e),a=Qn.fromDistanceDisplayCondition(s);if(this._materialProperty instanceof Kt){let c;l(this._materialProperty.color)&&(this._materialProperty.color.isConstant||n)&&(c=this._materialProperty.color.getValue(e,XCe)),l(c)||(c=z.WHITE),r=Jt.fromColor(c),i={show:o,distanceDisplayCondition:a,color:r}}else i={show:o,distanceDisplayCondition:a};return new Bt({id:t,geometry:new ij(this._options),attributes:i})};Zh.prototype.createOutlineGeometryInstance=function(e){let t=this._entity,n=t.isAvailable(e),i=X.getValueOrDefault(this._outlineColorProperty,e,z.BLACK,XCe),r=this._distanceDisplayConditionProperty.getValue(e);return new Bt({id:t,geometry:new rj(this._options),attributes:{show:new Pn(n&&t.isShowing&&this._showProperty.getValue(e)&&this._showOutlineProperty.getValue(e)),color:Jt.fromColor(i),distanceDisplayCondition:Qn.fromDistanceDisplayCondition(r)}})};Zh.prototype._isHidden=function(e,t){return!l(t.positions)||Oi.prototype._isHidden.call(this,e,t)};Zh.prototype._getIsClosed=function(e){return!1};Zh.prototype._isDynamic=function(e,t){return!t.positions.isConstant||!X.isConstant(t.minimumHeights)||!X.isConstant(t.maximumHeights)||!X.isConstant(t.outlineWidth)||!X.isConstant(t.granularity)};Zh.prototype._setStaticOptions=function(e,t){let n=t.minimumHeights,i=t.maximumHeights,r=t.granularity,o=this._materialProperty instanceof Kt,s=this._options;s.vertexFormat=o?An.VERTEX_FORMAT:Cr.MaterialSupport.TEXTURED.vertexFormat,s.positions=t.positions.getValue(nt.MINIMUM_VALUE,s.positions),s.minimumHeights=l(n)?n.getValue(nt.MINIMUM_VALUE,s.minimumHeights):void 0,s.maximumHeights=l(i)?i.getValue(nt.MINIMUM_VALUE,s.maximumHeights):void 0,s.granularity=l(r)?r.getValue(nt.MINIMUM_VALUE):void 0};Zh.DynamicGeometryUpdater=LS;function LS(e,t,n){Ri.call(this,e,t,n)}l(Object.create)&&(LS.prototype=Object.create(Ri.prototype),LS.prototype.constructor=LS);LS.prototype._isHidden=function(e,t,n){return!l(this._options.positions)||Ri.prototype._isHidden.call(this,e,t,n)};LS.prototype._setOptions=function(e,t,n){let i=this._options;i.positions=X.getValueOrUndefined(t.positions,n,i.positions),i.minimumHeights=X.getValueOrUndefined(t.minimumHeights,n,i.minimumHeights),i.maximumHeights=X.getValueOrUndefined(t.maximumHeights,n,i.maximumHeights),i.granularity=X.getValueOrUndefined(t.granularity,n)};var oj=Zh;var eT=[Jk,A8,d8,z8,V8,Y8,J8,ej,tj,oj];function tT(e,t){this.entity=e,this.scene=t;let n=new Array(eT.length),i=new be,r=new Qo;for(let o=0;o<n.length;o++){let s=new eT[o](e,t);r.add(s.geometryChanged,a=>{i.raiseEvent(a)}),n[o]=s}this.updaters=n,this.geometryChanged=i,this.eventHelper=r,this._removeEntitySubscription=e.definitionChanged.addEventListener(tT.prototype._onEntityPropertyChanged,this)}tT.prototype._onEntityPropertyChanged=function(e,t,n,i){let r=this.updaters;for(let o=0;o<r.length;o++)r[o]._onEntityPropertyChanged(e,t,n,i)};tT.prototype.forEach=function(e){let t=this.updaters;for(let n=0;n<t.length;n++)e(t[n])};tT.prototype.destroy=function(){this.eventHelper.removeAll();let e=this.updaters;for(let t=0;t<e.length;t++)e[t].destroy();this._removeEntitySubscription(),le(this)};tT.registerUpdater=function(e){eT.includes(e)||eT.push(e)};tT.unregisterUpdater=function(e){if(eT.includes(e)){let t=eT.indexOf(e);eT.splice(t,1)}};var FS=tT;var KCe=new z,oAt=new Gt,sAt=new Gt,aAt=h.ZERO,cAt=new h;function Qh(e,t,n,i,r,o,s){this.translucent=t,this.appearanceType=n,this.depthFailAppearanceType=i,this.depthFailMaterialProperty=r,this.depthFailMaterial=void 0,this.closed=o,this.shadows=s,this.primitives=e,this.createPrimitive=!1,this.waitingOnCreate=!1,this.primitive=void 0,this.oldPrimitive=void 0,this.geometry=new zt,this.updaters=new zt,this.updatersWithAttributes=new zt,this.attributes=new zt,this.subscriptions=new zt,this.showsUpdated=new zt,this.itemsToRemove=[],this.invalidated=!1;let a;l(r)&&(a=r.definitionChanged.addEventListener(Qh.prototype.onMaterialChanged,this)),this.removeMaterialSubscription=a}Qh.prototype.onMaterialChanged=function(){this.invalidated=!0};Qh.prototype.isMaterial=function(e){let t=this.depthFailMaterialProperty,n=e.depthFailMaterialProperty;return n===t?!0:l(t)?t.equals(n):!1};Qh.prototype.add=function(e,t){let n=e.id;if(this.createPrimitive=!0,this.geometry.set(n,t),this.updaters.set(n,e),!e.hasConstantFill||!e.fillMaterialProperty.isConstant||!X.isConstant(e.distanceDisplayConditionProperty)||!X.isConstant(e.terrainOffsetProperty))this.updatersWithAttributes.set(n,e);else{let i=this;this.subscriptions.set(n,e.entity.definitionChanged.addEventListener(function(r,o,s,a){o==="isShowing"&&i.showsUpdated.set(e.id,e)}))}};Qh.prototype.remove=function(e){let t=e.id;if(this.createPrimitive=this.geometry.remove(t)||this.createPrimitive,this.updaters.remove(t)){this.updatersWithAttributes.remove(t);let n=this.subscriptions.get(t);return l(n)&&(n(),this.subscriptions.remove(t),this.showsUpdated.remove(t)),!0}return!1};Qh.prototype.update=function(e){let t=!0,n=0,i=this.primitive,r=this.primitives,o;if(this.createPrimitive){let s=this.geometry.values;if(s.length>0){l(i)&&(l(this.oldPrimitive)?r.remove(i):this.oldPrimitive=i);let c;if(l(this.depthFailAppearanceType)){l(this.depthFailMaterialProperty)&&(this.depthFailMaterial=Co.getValue(e,this.depthFailMaterialProperty,this.depthFailMaterial));let f=this.depthFailAppearanceType;c=new f({material:this.depthFailMaterial,translucent:this.translucent,closed:this.closed})}let u=this.appearanceType;i=new Mn({show:!1,asynchronous:!0,geometryInstances:s.slice(),appearance:new u({translucent:this.translucent,closed:this.closed}),depthFailAppearance:c,shadows:this.shadows}),r.add(i),t=!1}else{l(i)&&(r.remove(i),i=void 0);let c=this.oldPrimitive;l(c)&&(r.remove(c),this.oldPrimitive=void 0)}this.attributes.removeAll(),this.primitive=i,this.createPrimitive=!1,this.waitingOnCreate=!0}else if(l(i)&&i.ready){i.show=!0,l(this.oldPrimitive)&&(r.remove(this.oldPrimitive),this.oldPrimitive=void 0),l(this.depthFailAppearanceType)&&!(this.depthFailMaterialProperty instanceof Kt)&&(this.depthFailMaterial=Co.getValue(e,this.depthFailMaterialProperty,this.depthFailMaterial),this.primitive.depthFailAppearance.material=this.depthFailMaterial);let s=this.updatersWithAttributes.values,a=s.length,c=this.waitingOnCreate;for(o=0;o<a;o++){let u=s[o],f=this.geometry.get(u.id),d=this.attributes.get(f.id.id);if(l(d)||(d=i.getGeometryInstanceAttributes(f.id),this.attributes.set(f.id.id,d)),!u.fillMaterialProperty.isConstant||c){let A=u.fillMaterialProperty.color,b=X.getValueOrDefault(A,e,z.WHITE,KCe);z.equals(d._lastColor,b)||(d._lastColor=z.clone(b,d._lastColor),d.color=Jt.toValue(b,d.color),(this.translucent&&d.color[3]===255||!this.translucent&&d.color[3]!==255)&&(this.itemsToRemove[n++]=u))}if(l(this.depthFailAppearanceType)&&u.depthFailMaterialProperty instanceof Kt&&(!u.depthFailMaterialProperty.isConstant||c)){let A=u.depthFailMaterialProperty.color,b=X.getValueOrDefault(A,e,z.WHITE,KCe);z.equals(d._lastDepthFailColor,b)||(d._lastDepthFailColor=z.clone(b,d._lastDepthFailColor),d.depthFailColor=Jt.toValue(b,d.depthFailColor))}let p=u.entity.isShowing&&(u.hasConstantFill||u.isFilled(e)),g=d.show[0]===1;p!==g&&(d.show=Pn.toValue(p,d.show));let m=u.distanceDisplayConditionProperty;if(!X.isConstant(m)){let A=X.getValueOrDefault(m,e,sAt,oAt);Gt.equals(A,d._lastDistanceDisplayCondition)||(d._lastDistanceDisplayCondition=Gt.clone(A,d._lastDistanceDisplayCondition),d.distanceDisplayCondition=Qn.toValue(A,d.distanceDisplayCondition))}let y=u.terrainOffsetProperty;if(!X.isConstant(y)){let A=X.getValueOrDefault(y,e,aAt,cAt);h.equals(A,d._lastOffset)||(d._lastOffset=h.clone(A,d._lastOffset),d.offset=Er.toValue(A,d.offset))}}this.updateShows(i),this.waitingOnCreate=!1}else l(i)&&!i.ready&&(t=!1);return this.itemsToRemove.length=n,t};Qh.prototype.updateShows=function(e){let t=this.showsUpdated.values,n=t.length;for(let i=0;i<n;i++){let r=t[i],o=this.geometry.get(r.id),s=this.attributes.get(o.id.id);l(s)||(s=e.getGeometryInstanceAttributes(o.id),this.attributes.set(o.id.id,s));let a=r.entity.isShowing,c=s.show[0]===1;a!==c&&(s.show=Pn.toValue(a,s.show),o.attributes.show.value[0]=s.show[0])}this.showsUpdated.removeAll()};Qh.prototype.contains=function(e){return this.updaters.contains(e.id)};Qh.prototype.getBoundingSphere=function(e,t){let n=this.primitive;if(!n.ready)return Pt.PENDING;let i=n.getGeometryInstanceAttributes(e.entity);return!l(i)||!l(i.boundingSphere)||l(i.show)&&i.show[0]===0?Pt.FAILED:(i.boundingSphere.clone(t),Pt.DONE)};Qh.prototype.destroy=function(){let e=this.primitive,t=this.primitives;l(e)&&t.remove(e);let n=this.oldPrimitive;l(n)&&t.remove(n),l(this.removeMaterialSubscription)&&this.removeMaterialSubscription()};function BS(e,t,n,i,r){this._solidItems=[],this._translucentItems=[],this._primitives=e,this._appearanceType=t,this._depthFailAppearanceType=n,this._closed=i,this._shadows=r}BS.prototype.add=function(e,t){let n,i,r=t.createFillGeometryInstance(e);r.attributes.color.value[3]===255?(n=this._solidItems,i=!1):(n=this._translucentItems,i=!0);let o=n.length;for(let a=0;a<o;a++){let c=n[a];if(c.isMaterial(t)){c.add(t,r);return}}let s=new Qh(this._primitives,i,this._appearanceType,this._depthFailAppearanceType,t.depthFailMaterialProperty,this._closed,this._shadows);s.add(t,r),n.push(s)};function $Ce(e,t){let n=e.length;for(let i=n-1;i>=0;i--){let r=e[i];if(r.remove(t))return r.updaters.length===0&&(e.splice(i,1),r.destroy()),!0}return!1}BS.prototype.remove=function(e){$Ce(this._solidItems,e)||$Ce(this._translucentItems,e)};function JCe(e,t,n){let i=!1,r=t.length;for(let o=0;o<r;++o){let s=t[o],a=s.itemsToRemove,c=a.length;if(c>0)for(o=0;o<c;o++){let u=a[o];s.remove(u),e.add(n,u),i=!0}}return i}function sj(e,t,n,i){let r=t.length,o;for(o=r-1;o>=0;o--){let s=t[o];if(s.invalidated){t.splice(o,1);let a=s.updaters.values,c=a.length;for(let u=0;u<c;u++)e.add(n,a[u]);s.destroy()}}for(r=t.length,o=0;o<r;++o)i=t[o].update(n)&&i;return i}BS.prototype.update=function(e){let t=sj(this,this._solidItems,e,!0);t=sj(this,this._translucentItems,e,t)&&t;let n=JCe(this,this._solidItems,e),i=JCe(this,this._translucentItems,e);return(n||i)&&(t=sj(this,this._solidItems,e,t)&&t,t=sj(this,this._translucentItems,e,t)&&t),t};function ZCe(e,t,n){let i=e.length;for(let r=0;r<i;r++){let o=e[r];if(o.contains(t))return o.getBoundingSphere(t,n)}return Pt.FAILED}BS.prototype.getBoundingSphere=function(e,t){let n=ZCe(this._solidItems,e,t);return n===Pt.FAILED?ZCe(this._translucentItems,e,t):n};function QCe(e){let t=e.length;for(let n=0;n<t;n++)e[n].destroy();e.length=0}BS.prototype.removeAllPrimitives=function(){QCe(this._solidItems),QCe(this._translucentItems)};var em=BS;var lAt=new Gt,uAt=new Gt,fAt=h.ZERO,dAt=new h;function tm(e,t,n,i,r,o,s){this.primitives=e,this.appearanceType=t,this.materialProperty=n,this.depthFailAppearanceType=i,this.depthFailMaterialProperty=r,this.closed=o,this.shadows=s,this.updaters=new zt,this.createPrimitive=!0,this.primitive=void 0,this.oldPrimitive=void 0,this.geometry=new zt,this.material=void 0,this.depthFailMaterial=void 0,this.updatersWithAttributes=new zt,this.attributes=new zt,this.invalidated=!1,this.removeMaterialSubscription=n.definitionChanged.addEventListener(tm.prototype.onMaterialChanged,this),this.subscriptions=new zt,this.showsUpdated=new zt}tm.prototype.onMaterialChanged=function(){this.invalidated=!0};tm.prototype.isMaterial=function(e){let t=this.materialProperty,n=e.fillMaterialProperty,i=this.depthFailMaterialProperty,r=e.depthFailMaterialProperty;if(n===t&&r===i)return!0;let o=l(t)&&t.equals(n);return o=(!l(i)&&!l(r)||l(i)&&i.equals(r))&&o,o};tm.prototype.add=function(e,t){let n=t.id;if(this.updaters.set(n,t),this.geometry.set(n,t.createFillGeometryInstance(e)),!t.hasConstantFill||!t.fillMaterialProperty.isConstant||!X.isConstant(t.distanceDisplayConditionProperty)||!X.isConstant(t.terrainOffsetProperty))this.updatersWithAttributes.set(n,t);else{let i=this;this.subscriptions.set(n,t.entity.definitionChanged.addEventListener(function(r,o,s,a){o==="isShowing"&&i.showsUpdated.set(t.id,t)}))}this.createPrimitive=!0};tm.prototype.remove=function(e){let t=e.id;if(this.createPrimitive=this.geometry.remove(t)||this.createPrimitive,this.updaters.remove(t)){this.updatersWithAttributes.remove(t);let n=this.subscriptions.get(t);return l(n)&&(n(),this.subscriptions.remove(t),this.showsUpdated.remove(t)),!0}return!1};var hAt=new z;tm.prototype.update=function(e){let t=!0,n=this.primitive,i=this.primitives,r=this.geometry.values,o;if(this.createPrimitive){if(r.length>0){l(n)&&(l(this.oldPrimitive)?i.remove(n):this.oldPrimitive=n),this.material=Co.getValue(e,this.materialProperty,this.material);let a;if(l(this.depthFailMaterialProperty)){this.depthFailMaterial=Co.getValue(e,this.depthFailMaterialProperty,this.depthFailMaterial);let u=this.depthFailAppearanceType;a=new u({material:this.depthFailMaterial,translucent:this.depthFailMaterial.isTranslucent(),closed:this.closed})}let c=this.appearanceType;n=new Mn({show:!1,asynchronous:!0,geometryInstances:r.slice(),appearance:new c({material:this.material,translucent:this.material.isTranslucent(),closed:this.closed}),depthFailAppearance:a,shadows:this.shadows}),i.add(n),t=!1}else{l(n)&&(i.remove(n),n=void 0);let a=this.oldPrimitive;l(a)&&(i.remove(a),this.oldPrimitive=void 0)}this.attributes.removeAll(),this.primitive=n,this.createPrimitive=!1}else if(l(n)&&n.ready){n.show=!0,l(this.oldPrimitive)&&(i.remove(this.oldPrimitive),this.oldPrimitive=void 0),this.material=Co.getValue(e,this.materialProperty,this.material),this.primitive.appearance.material=this.material,l(this.depthFailAppearanceType)&&!(this.depthFailMaterialProperty instanceof Kt)&&(this.depthFailMaterial=Co.getValue(e,this.depthFailMaterialProperty,this.depthFailMaterial),this.primitive.depthFailAppearance.material=this.depthFailMaterial);let s=this.updatersWithAttributes.values,a=s.length;for(o=0;o<a;o++){let c=s[o],u=c.entity,f=this.geometry.get(c.id),d=this.attributes.get(f.id.id);if(l(d)||(d=n.getGeometryInstanceAttributes(f.id),this.attributes.set(f.id.id,d)),l(this.depthFailAppearanceType)&&this.depthFailMaterialProperty instanceof Kt&&!c.depthFailMaterialProperty.isConstant){let A=c.depthFailMaterialProperty.color,b=X.getValueOrDefault(A,e,z.WHITE,hAt);z.equals(d._lastDepthFailColor,b)||(d._lastDepthFailColor=z.clone(b,d._lastDepthFailColor),d.depthFailColor=Jt.toValue(b,d.depthFailColor))}let p=u.isShowing&&(c.hasConstantFill||c.isFilled(e)),g=d.show[0]===1;p!==g&&(d.show=Pn.toValue(p,d.show));let m=c.distanceDisplayConditionProperty;if(!X.isConstant(m)){let A=X.getValueOrDefault(m,e,uAt,lAt);Gt.equals(A,d._lastDistanceDisplayCondition)||(d._lastDistanceDisplayCondition=Gt.clone(A,d._lastDistanceDisplayCondition),d.distanceDisplayCondition=Qn.toValue(A,d.distanceDisplayCondition))}let y=c.terrainOffsetProperty;if(!X.isConstant(y)){let A=X.getValueOrDefault(y,e,fAt,dAt);h.equals(A,d._lastOffset)||(d._lastOffset=h.clone(A,d._lastOffset),d.offset=Er.toValue(A,d.offset))}}this.updateShows(n)}else l(n)&&!n.ready&&(t=!1);return t};tm.prototype.updateShows=function(e){let t=this.showsUpdated.values,n=t.length;for(let i=0;i<n;i++){let r=t[i],o=r.entity,s=this.geometry.get(r.id),a=this.attributes.get(s.id.id);l(a)||(a=e.getGeometryInstanceAttributes(s.id),this.attributes.set(s.id.id,a));let c=o.isShowing,u=a.show[0]===1;c!==u&&(a.show=Pn.toValue(c,a.show),s.attributes.show.value[0]=a.show[0])}this.showsUpdated.removeAll()};tm.prototype.contains=function(e){return this.updaters.contains(e.id)};tm.prototype.getBoundingSphere=function(e,t){let n=this.primitive;if(!n.ready)return Pt.PENDING;let i=n.getGeometryInstanceAttributes(e.entity);return!l(i)||!l(i.boundingSphere)||l(i.show)&&i.show[0]===0?Pt.FAILED:(i.boundingSphere.clone(t),Pt.DONE)};tm.prototype.destroy=function(){let e=this.primitive,t=this.primitives;l(e)&&t.remove(e);let n=this.oldPrimitive;l(n)&&t.remove(n),this.removeMaterialSubscription()};function kS(e,t,n,i,r){this._items=[],this._primitives=e,this._appearanceType=t,this._depthFailAppearanceType=n,this._closed=i,this._shadows=r}kS.prototype.add=function(e,t){let n=this._items,i=n.length;for(let o=0;o<i;o++){let s=n[o];if(s.isMaterial(t)){s.add(e,t);return}}let r=new tm(this._primitives,this._appearanceType,t.fillMaterialProperty,this._depthFailAppearanceType,t.depthFailMaterialProperty,this._closed,this._shadows);r.add(e,t),n.push(r)};kS.prototype.remove=function(e){let t=this._items,n=t.length;for(let i=n-1;i>=0;i--){let r=t[i];if(r.remove(e)){r.updaters.length===0&&(t.splice(i,1),r.destroy());break}}};kS.prototype.update=function(e){let t,n=this._items,i=n.length;for(t=i-1;t>=0;t--){let o=n[t];if(o.invalidated){n.splice(t,1);let s=o.updaters.values,a=s.length;for(let c=0;c<a;c++)this.add(e,s[c]);o.destroy()}}let r=!0;for(t=0;t<n.length;t++)r=n[t].update(e)&&r;return r};kS.prototype.getBoundingSphere=function(e,t){let n=this._items,i=n.length;for(let r=0;r<i;r++){let o=n[r];if(o.contains(e))return o.getBoundingSphere(e,t)}return Pt.FAILED};kS.prototype.removeAllPrimitives=function(){let e=this._items,t=e.length;for(let n=0;n<t;n++)e[n].destroy();this._items.length=0};var nm=kS;function aj(e,t,n=0,i=e.length-1,r=mAt){for(;i>n;){if(i-n>600){let c=i-n+1,u=t-n+1,f=Math.log(c),d=.5*Math.exp(2*f/3),p=.5*Math.sqrt(f*d*(c-d)/c)*(u-c/2<0?-1:1),g=Math.max(n,Math.floor(t-u*d/c+p)),m=Math.min(i,Math.floor(t+(c-u)*d/c+p));aj(e,t,g,m,r)}let o=e[t],s=n,a=i;for(yR(e,n,t),r(e[i],o)>0&&yR(e,n,i);s<a;){for(yR(e,s,a),s++,a--;r(e[s],o)<0;)s++;for(;r(e[a],o)>0;)a--}r(e[n],o)===0?yR(e,n,a):(a++,yR(e,a,i)),a<=t&&(n=a+1),t<=a&&(i=a-1)}}function yR(e,t,n){let i=e[t];e[t]=e[n],e[n]=i}function mAt(e,t){return e<t?-1:e>t?1:0}var xR=class{constructor(t=9){this._maxEntries=Math.max(4,t),this._minEntries=Math.max(2,Math.ceil(this._maxEntries*.4)),this.clear()}all(){return this._all(this.data,[])}search(t){let n=this.data,i=[];if(!lj(t,n))return i;let r=this.toBBox,o=[];for(;n;){for(let s=0;s<n.children.length;s++){let a=n.children[s],c=n.leaf?r(a):a;lj(t,c)&&(n.leaf?i.push(a):Uee(t,c)?this._all(a,i):o.push(a))}n=o.pop()}return i}collides(t){let n=this.data;if(!lj(t,n))return!1;let i=[];for(;n;){for(let r=0;r<n.children.length;r++){let o=n.children[r],s=n.leaf?this.toBBox(o):o;if(lj(t,s)){if(n.leaf||Uee(t,s))return!0;i.push(o)}}n=i.pop()}return!1}load(t){if(!(t&&t.length))return this;if(t.length<this._minEntries){for(let i=0;i<t.length;i++)this.insert(t[i]);return this}let n=this._build(t.slice(),0,t.length-1,0);if(!this.data.children.length)this.data=n;else if(this.data.height===n.height)this._splitRoot(this.data,n);else{if(this.data.height<n.height){let i=this.data;this.data=n,n=i}this._insert(n,this.data.height-n.height-1,!0)}return this}insert(t){return t&&this._insert(t,this.data.height-1),this}clear(){return this.data=zS([]),this}remove(t,n){if(!t)return this;let i=this.data,r=this.toBBox(t),o=[],s=[],a,c,u;for(;i||o.length;){if(i||(i=o.pop(),c=o[o.length-1],a=s.pop(),u=!0),i.leaf){let f=pAt(t,i.children,n);if(f!==-1)return i.children.splice(f,1),o.push(i),this._condense(o),this}!u&&!i.leaf&&Uee(i,r)?(o.push(i),s.push(a),a=0,c=i,i=i.children[0]):c?(a++,i=c.children[a],u=!1):i=null}return this}toBBox(t){return t}compareMinX(t,n){return t.minX-n.minX}compareMinY(t,n){return t.minY-n.minY}toJSON(){return this.data}fromJSON(t){return this.data=t,this}_all(t,n){let i=[];for(;t;)t.leaf?n.push(...t.children):i.push(...t.children),t=i.pop();return n}_build(t,n,i,r){let o=i-n+1,s=this._maxEntries,a;if(o<=s)return a=zS(t.slice(n,i+1)),US(a,this.toBBox),a;r||(r=Math.ceil(Math.log(o)/Math.log(s)),s=Math.ceil(o/Math.pow(s,r-1))),a=zS([]),a.leaf=!1,a.height=r;let c=Math.ceil(o/s),u=c*Math.ceil(Math.sqrt(s));eve(t,n,i,u,this.compareMinX);for(let f=n;f<=i;f+=u){let d=Math.min(f+u-1,i);eve(t,f,d,c,this.compareMinY);for(let p=f;p<=d;p+=c){let g=Math.min(p+c-1,d);a.children.push(this._build(t,p,g,r-1))}}return US(a,this.toBBox),a}_chooseSubtree(t,n,i,r){for(;r.push(n),!(n.leaf||r.length-1===i);){let o=1/0,s=1/0,a;for(let c=0;c<n.children.length;c++){let u=n.children[c],f=kee(u),d=yAt(t,u)-f;d<s?(s=d,o=f<o?f:o,a=u):d===s&&f<o&&(o=f,a=u)}n=a||n.children[0]}return n}_insert(t,n,i){let r=i?t:this.toBBox(t),o=[],s=this._chooseSubtree(r,this.data,n,o);for(s.children.push(t),bR(s,r);n>=0&&o[n].children.length>this._maxEntries;)this._split(o,n),n--;this._adjustParentBBoxes(r,o,n)}_split(t,n){let i=t[n],r=i.children.length,o=this._minEntries;this._chooseSplitAxis(i,o,r);let s=this._chooseSplitIndex(i,o,r),a=zS(i.children.splice(s,i.children.length-s));a.height=i.height,a.leaf=i.leaf,US(i,this.toBBox),US(a,this.toBBox),n?t[n-1].children.push(a):this._splitRoot(i,a)}_splitRoot(t,n){this.data=zS([t,n]),this.data.height=t.height+1,this.data.leaf=!1,US(this.data,this.toBBox)}_chooseSplitIndex(t,n,i){let r,o=1/0,s=1/0;for(let a=n;a<=i-n;a++){let c=AR(t,0,a,this.toBBox),u=AR(t,a,i,this.toBBox),f=AAt(c,u),d=kee(c)+kee(u);f<o?(o=f,r=a,s=d<s?d:s):f===o&&d<s&&(s=d,r=a)}return r||i-n}_chooseSplitAxis(t,n,i){let r=t.leaf?this.compareMinX:gAt,o=t.leaf?this.compareMinY:_At,s=this._allDistMargin(t,n,i,r),a=this._allDistMargin(t,n,i,o);s<a&&t.children.sort(r)}_allDistMargin(t,n,i,r){t.children.sort(r);let o=this.toBBox,s=AR(t,0,n,o),a=AR(t,i-n,i,o),c=cj(s)+cj(a);for(let u=n;u<i-n;u++){let f=t.children[u];bR(s,t.leaf?o(f):f),c+=cj(s)}for(let u=i-n-1;u>=n;u--){let f=t.children[u];bR(a,t.leaf?o(f):f),c+=cj(a)}return c}_adjustParentBBoxes(t,n,i){for(let r=i;r>=0;r--)bR(n[r],t)}_condense(t){for(let n=t.length-1,i;n>=0;n--)t[n].children.length===0?n>0?(i=t[n-1].children,i.splice(i.indexOf(t[n]),1)):this.clear():US(t[n],this.toBBox)}};function pAt(e,t,n){if(!n)return t.indexOf(e);for(let i=0;i<t.length;i++)if(n(e,t[i]))return i;return-1}function US(e,t){AR(e,0,e.children.length,t,e)}function AR(e,t,n,i,r){r||(r=zS(null)),r.minX=1/0,r.minY=1/0,r.maxX=-1/0,r.maxY=-1/0;for(let o=t;o<n;o++){let s=e.children[o];bR(r,e.leaf?i(s):s)}return r}function bR(e,t){return e.minX=Math.min(e.minX,t.minX),e.minY=Math.min(e.minY,t.minY),e.maxX=Math.max(e.maxX,t.maxX),e.maxY=Math.max(e.maxY,t.maxY),e}function gAt(e,t){return e.minX-t.minX}function _At(e,t){return e.minY-t.minY}function kee(e){return(e.maxX-e.minX)*(e.maxY-e.minY)}function cj(e){return e.maxX-e.minX+(e.maxY-e.minY)}function yAt(e,t){return(Math.max(t.maxX,e.maxX)-Math.min(t.minX,e.minX))*(Math.max(t.maxY,e.maxY)-Math.min(t.minY,e.minY))}function AAt(e,t){let n=Math.max(e.minX,t.minX),i=Math.max(e.minY,t.minY),r=Math.min(e.maxX,t.maxX),o=Math.min(e.maxY,t.maxY);return Math.max(0,r-n)*Math.max(0,o-i)}function Uee(e,t){return e.minX<=t.minX&&e.minY<=t.minY&&t.maxX<=e.maxX&&t.maxY<=e.maxY}function lj(e,t){return t.minX<=e.maxX&&t.minY<=e.maxY&&t.maxX>=e.minX&&t.maxY>=e.minY}function zS(e){return{children:e,height:1,leaf:!0,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0}}function eve(e,t,n,i,r){let o=[t,n];for(;o.length;){if(n=o.pop(),t=o.pop(),n-t<=i)continue;let s=t+Math.ceil((n-t)/i/2)*i;aj(e,s,t,n,r),o.push(t,s,s,n)}}function uj(){this._tree=new xR}function nT(){this.minX=0,this.minY=0,this.maxX=0,this.maxY=0,this.id=""}nT.fromRectangleAndId=function(e,t,n){return n.minX=t.west,n.minY=t.south,n.maxX=t.east,n.maxY=t.north,n.id=e,n};uj.prototype.insert=function(e,t){let n=nT.fromRectangleAndId(e,t,new nT);this._tree.insert(n)};function bAt(e,t){return e.id===t.id}var xAt=new nT;uj.prototype.remove=function(e,t){let n=nT.fromRectangleAndId(e,t,xAt);this._tree.remove(n,bAt)};var TAt=new nT;uj.prototype.collides=function(e){let t=nT.fromRectangleAndId("",e,TAt);return this._tree.collides(t)};var VS=uj;var EAt=new z,CAt=new Gt,vAt=new Gt;function Bg(e,t,n,i){this.primitives=e,this.zIndex=i,this.classificationType=t,this.color=n,this.createPrimitive=!1,this.waitingOnCreate=!1,this.primitive=void 0,this.oldPrimitive=void 0,this.geometry=new zt,this.updaters=new zt,this.updatersWithAttributes=new zt,this.attributes=new zt,this.subscriptions=new zt,this.showsUpdated=new zt,this.itemsToRemove=[],this.isDirty=!1,this.rectangleCollisionCheck=new VS}Bg.prototype.overlapping=function(e){return this.rectangleCollisionCheck.collides(e)};Bg.prototype.add=function(e,t){let n=e.id;if(this.createPrimitive=!0,this.geometry.set(n,t),this.updaters.set(n,e),this.rectangleCollisionCheck.insert(n,t.geometry.rectangle),!e.hasConstantFill||!e.fillMaterialProperty.isConstant||!X.isConstant(e.distanceDisplayConditionProperty))this.updatersWithAttributes.set(n,e);else{let i=this;this.subscriptions.set(n,e.entity.definitionChanged.addEventListener(function(r,o,s,a){o==="isShowing"&&i.showsUpdated.set(e.id,e)}))}};Bg.prototype.remove=function(e){let t=e.id,n=this.geometry.get(t);if(this.createPrimitive=this.geometry.remove(t)||this.createPrimitive,this.updaters.remove(t)){this.rectangleCollisionCheck.remove(t,n.geometry.rectangle),this.updatersWithAttributes.remove(t);let i=this.subscriptions.get(t);return l(i)&&(i(),this.subscriptions.remove(t),this.showsUpdated.remove(t)),!0}return!1};Bg.prototype.update=function(e){let t=!0,n=0,i=this.primitive,r=this.primitives,o;if(this.createPrimitive){let s=this.geometry.values;if(s.length>0)l(i)&&(l(this.oldPrimitive)?r.remove(i):this.oldPrimitive=i),i=new pu({show:!1,asynchronous:!0,geometryInstances:s.slice(),classificationType:this.classificationType}),r.add(i,this.zIndex),t=!1;else{l(i)&&(r.remove(i),i=void 0);let c=this.oldPrimitive;l(c)&&(r.remove(c),this.oldPrimitive=void 0)}this.attributes.removeAll(),this.primitive=i,this.createPrimitive=!1,this.waitingOnCreate=!0}else if(l(i)&&i.ready){i.show=!0,l(this.oldPrimitive)&&(r.remove(this.oldPrimitive),this.oldPrimitive=void 0);let s=this.updatersWithAttributes.values,a=s.length,c=this.waitingOnCreate;for(o=0;o<a;o++){let u=s[o],f=this.geometry.get(u.id),d=this.attributes.get(f.id.id);if(l(d)||(d=i.getGeometryInstanceAttributes(f.id),this.attributes.set(f.id.id,d)),!u.fillMaterialProperty.isConstant||c){let y=u.fillMaterialProperty.color,A=X.getValueOrDefault(y,e,z.WHITE,EAt);z.equals(d._lastColor,A)||(d._lastColor=z.clone(A,d._lastColor),d.color=Jt.toValue(A,d.color))}let p=u.entity.isShowing&&(u.hasConstantFill||u.isFilled(e)),g=d.show[0]===1;p!==g&&(d.show=Pn.toValue(p,d.show));let m=u.distanceDisplayConditionProperty;if(!X.isConstant(m)){let y=X.getValueOrDefault(m,e,vAt,CAt);Gt.equals(y,d._lastDistanceDisplayCondition)||(d._lastDistanceDisplayCondition=Gt.clone(y,d._lastDistanceDisplayCondition),d.distanceDisplayCondition=Qn.toValue(y,d.distanceDisplayCondition))}}this.updateShows(i),this.waitingOnCreate=!1}else l(i)&&!i.ready&&(t=!1);return this.itemsToRemove.length=n,t};Bg.prototype.updateShows=function(e){let t=this.showsUpdated.values,n=t.length;for(let i=0;i<n;i++){let r=t[i],o=this.geometry.get(r.id),s=this.attributes.get(o.id.id);l(s)||(s=e.getGeometryInstanceAttributes(o.id),this.attributes.set(o.id.id,s));let a=r.entity.isShowing,c=s.show[0]===1;a!==c&&(s.show=Pn.toValue(a,s.show),o.attributes.show.value[0]=s.show[0])}this.showsUpdated.removeAll()};Bg.prototype.contains=function(e){return this.updaters.contains(e.id)};Bg.prototype.getBoundingSphere=function(e,t){let n=this.primitive;if(!n.ready)return Pt.PENDING;let i=n.getBoundingSphere(e.entity);return l(i)?(i.clone(t),Pt.DONE):Pt.FAILED};Bg.prototype.removeAllPrimitives=function(){let e=this.primitives,t=this.primitive;l(t)&&(e.remove(t),this.primitive=void 0,this.geometry.removeAll(),this.updaters.removeAll());let n=this.oldPrimitive;l(n)&&(e.remove(n),this.oldPrimitive=void 0)};function jS(e,t){this._batches=[],this._primitives=e,this._classificationType=t}jS.prototype.add=function(e,t){let n=t.createFillGeometryInstance(e),i=this._batches,r=X.getValueOrDefault(t.zIndex,0),o,s=i.length;for(let a=0;a<s;++a){let c=i[a];if(c.zIndex===r&&!c.overlapping(n.geometry.rectangle)){o=c;break}}return l(o)||(o=new Bg(this._primitives,this._classificationType,n.attributes.color.value,r),i.push(o)),o.add(t,n),o};jS.prototype.remove=function(e){let t=this._batches,n=t.length;for(let i=0;i<n;++i)if(t[i].remove(e))return};jS.prototype.update=function(e){let t,n,i=!0,r=this._batches,o=r.length;for(t=0;t<o;++t)i=r[t].update(e)&&i;for(t=0;t<o;++t){let s=r[t],a=s.itemsToRemove,c=a.length;for(let u=0;u<c;u++){n=a[u],s.remove(n);let f=this.add(e,n);s.isDirty=!0,f.isDirty=!0}}for(t=o-1;t>=0;--t){let s=r[t];s.isDirty&&(i=r[t].update(e)&&i,s.isDirty=!1),s.geometry.length===0&&r.splice(t,1)}return i};jS.prototype.getBoundingSphere=function(e,t){let n=this._batches,i=n.length;for(let r=0;r<i;++r){let o=n[r];if(o.contains(e))return o.getBoundingSphere(e,t)}return Pt.FAILED};jS.prototype.removeAllPrimitives=function(){let e=this._batches,t=e.length;for(let n=0;n<t;++n)e[n].removeAllPrimitives()};var TR=jS;var SAt=new Gt,wAt=new Gt;function Vp(e,t,n,i,r,o){this.primitives=e,this.classificationType=t,this.appearanceType=n,this.materialProperty=i,this.updaters=new zt,this.createPrimitive=!0,this.primitive=void 0,this.oldPrimitive=void 0,this.geometry=new zt,this.material=void 0,this.updatersWithAttributes=new zt,this.attributes=new zt,this.subscriptions=new zt,this.showsUpdated=new zt,this.usingSphericalTextureCoordinates=r,this.zIndex=o,this.rectangleCollisionCheck=new VS}Vp.prototype.overlapping=function(e){return this.rectangleCollisionCheck.collides(e)};Vp.prototype.isMaterial=function(e){let t=this.materialProperty,n=e.fillMaterialProperty;return n===t||n instanceof Kt&&t instanceof Kt?!0:l(t)&&t.equals(n)};Vp.prototype.add=function(e,t,n){let i=t.id;if(this.updaters.set(i,t),this.geometry.set(i,n),this.rectangleCollisionCheck.insert(i,n.geometry.rectangle),!t.hasConstantFill||!t.fillMaterialProperty.isConstant||!X.isConstant(t.distanceDisplayConditionProperty))this.updatersWithAttributes.set(i,t);else{let r=this;this.subscriptions.set(i,t.entity.definitionChanged.addEventListener(function(o,s,a,c){s==="isShowing"&&r.showsUpdated.set(t.id,t)}))}this.createPrimitive=!0};Vp.prototype.remove=function(e){let t=e.id,n=this.geometry.get(t);if(this.createPrimitive=this.geometry.remove(t)||this.createPrimitive,this.updaters.remove(t)){this.rectangleCollisionCheck.remove(t,n.geometry.rectangle),this.updatersWithAttributes.remove(t);let i=this.subscriptions.get(t);return l(i)&&(i(),this.subscriptions.remove(t),this.showsUpdated.remove(t)),!0}return!1};Vp.prototype.update=function(e){let t=!0,n=this.primitive,i=this.primitives,r=this.geometry.values,o;if(this.createPrimitive){if(r.length>0){l(n)&&(l(this.oldPrimitive)?i.remove(n):this.oldPrimitive=n),this.material=Co.getValue(e,this.materialProperty,this.material);let a=this.appearanceType;n=new pu({show:!1,asynchronous:!0,geometryInstances:r.slice(),appearance:new a({material:this.material}),classificationType:this.classificationType}),i.add(n,this.zIndex),t=!1}else{l(n)&&(i.remove(n),n=void 0);let a=this.oldPrimitive;l(a)&&(i.remove(a),this.oldPrimitive=void 0)}this.attributes.removeAll(),this.primitive=n,this.createPrimitive=!1}else if(l(n)&&n.ready){n.show=!0,l(this.oldPrimitive)&&(i.remove(this.oldPrimitive),this.oldPrimitive=void 0),this.material=Co.getValue(e,this.materialProperty,this.material),this.primitive.appearance.material=this.material;let s=this.updatersWithAttributes.values,a=s.length;for(o=0;o<a;o++){let c=s[o],u=c.entity,f=this.geometry.get(c.id),d=this.attributes.get(f.id.id);l(d)||(d=n.getGeometryInstanceAttributes(f.id),this.attributes.set(f.id.id,d));let p=u.isShowing&&(c.hasConstantFill||c.isFilled(e)),g=d.show[0]===1;p!==g&&(d.show=Pn.toValue(p,d.show));let m=c.distanceDisplayConditionProperty;if(!X.isConstant(m)){let y=X.getValueOrDefault(m,e,wAt,SAt);Gt.equals(y,d._lastDistanceDisplayCondition)||(d._lastDistanceDisplayCondition=Gt.clone(y,d._lastDistanceDisplayCondition),d.distanceDisplayCondition=Qn.toValue(y,d.distanceDisplayCondition))}}this.updateShows(n)}else l(n)&&!n.ready&&(t=!1);return t};Vp.prototype.updateShows=function(e){let t=this.showsUpdated.values,n=t.length;for(let i=0;i<n;i++){let r=t[i],o=r.entity,s=this.geometry.get(r.id),a=this.attributes.get(s.id.id);l(a)||(a=e.getGeometryInstanceAttributes(s.id),this.attributes.set(s.id.id,a));let c=o.isShowing,u=a.show[0]===1;c!==u&&(a.show=Pn.toValue(c,a.show),s.attributes.show.value[0]=a.show[0])}this.showsUpdated.removeAll()};Vp.prototype.contains=function(e){return this.updaters.contains(e.id)};Vp.prototype.getBoundingSphere=function(e,t){let n=this.primitive;if(!n.ready)return Pt.PENDING;let i=n.getGeometryInstanceAttributes(e.entity);return!l(i)||!l(i.boundingSphere)||l(i.show)&&i.show[0]===0?Pt.FAILED:(i.boundingSphere.clone(t),Pt.DONE)};Vp.prototype.destroy=function(){let e=this.primitive,t=this.primitives;l(e)&&t.remove(e);let n=this.oldPrimitive;l(n)&&t.remove(n)};function HS(e,t,n){this._items=[],this._primitives=e,this._classificationType=t,this._appearanceType=n}HS.prototype.add=function(e,t){let n=this._items,i=n.length,r=t.createFillGeometryInstance(e),o=cd.shouldUseSphericalCoordinates(r.geometry.rectangle),s=X.getValueOrDefault(t.zIndex,0);for(let c=0;c<i;++c){let u=n[c];if(u.isMaterial(t)&&u.usingSphericalTextureCoordinates===o&&u.zIndex===s&&!u.overlapping(r.geometry.rectangle)){u.add(e,t,r);return}}let a=new Vp(this._primitives,this._classificationType,this._appearanceType,t.fillMaterialProperty,o,s);a.add(e,t,r),n.push(a)};HS.prototype.remove=function(e){let t=this._items,n=t.length;for(let i=n-1;i>=0&&!t[i].remove(e);i--);};HS.prototype.update=function(e){let t,n=this._items,i=n.length;for(t=i-1;t>=0;t--){let o=n[t];o.updaters.length===0&&(n.splice(t,1),o.destroy())}let r=!0;for(t=0;t<n.length;t++)r=n[t].update(e)&&r;return r};HS.prototype.getBoundingSphere=function(e,t){let n=this._items,i=n.length;for(let r=0;r<i;r++){let o=n[r];if(o.contains(e))return o.getBoundingSphere(e,t)}return Pt.FAILED};HS.prototype.removeAllPrimitives=function(){let e=this._items,t=e.length;for(let n=0;n<t;n++)e[n].destroy();this._items.length=0};var fj=HS;var IAt=new z,PAt=new Gt,DAt=new Gt,RAt=h.ZERO,OAt=new h;function kg(e,t,n,i){this.translucent=t,this.width=n,this.shadows=i,this.primitives=e,this.createPrimitive=!1,this.waitingOnCreate=!1,this.primitive=void 0,this.oldPrimitive=void 0,this.geometry=new zt,this.updaters=new zt,this.updatersWithAttributes=new zt,this.attributes=new zt,this.itemsToRemove=[],this.subscriptions=new zt,this.showsUpdated=new zt}kg.prototype.add=function(e,t){let n=e.id;if(this.createPrimitive=!0,this.geometry.set(n,t),this.updaters.set(n,e),!e.hasConstantOutline||!e.outlineColorProperty.isConstant||!X.isConstant(e.distanceDisplayConditionProperty)||!X.isConstant(e.terrainOffsetProperty))this.updatersWithAttributes.set(n,e);else{let i=this;this.subscriptions.set(n,e.entity.definitionChanged.addEventListener(function(r,o,s,a){o==="isShowing"&&i.showsUpdated.set(e.id,e)}))}};kg.prototype.remove=function(e){let t=e.id;if(this.createPrimitive=this.geometry.remove(t)||this.createPrimitive,this.updaters.remove(t)){this.updatersWithAttributes.remove(t);let n=this.subscriptions.get(t);return l(n)&&(n(),this.subscriptions.remove(t),this.showsUpdated.remove(t)),!0}return!1};kg.prototype.update=function(e){let t=!0,n=0,i=this.primitive,r=this.primitives,o;if(this.createPrimitive){let s=this.geometry.values;if(s.length>0)l(i)&&(l(this.oldPrimitive)?r.remove(i):this.oldPrimitive=i),i=new Mn({show:!1,asynchronous:!0,geometryInstances:s.slice(),appearance:new An({flat:!0,translucent:this.translucent,renderState:{lineWidth:this.width}}),shadows:this.shadows}),r.add(i),t=!1;else{l(i)&&(r.remove(i),i=void 0);let c=this.oldPrimitive;l(c)&&(r.remove(c),this.oldPrimitive=void 0)}this.attributes.removeAll(),this.primitive=i,this.createPrimitive=!1,this.waitingOnCreate=!0}else if(l(i)&&i.ready){i.show=!0,l(this.oldPrimitive)&&(r.remove(this.oldPrimitive),this.oldPrimitive=void 0);let s=this.updatersWithAttributes.values,a=s.length,c=this.waitingOnCreate;for(o=0;o<a;o++){let u=s[o],f=this.geometry.get(u.id),d=this.attributes.get(f.id.id);if(l(d)||(d=i.getGeometryInstanceAttributes(f.id),this.attributes.set(f.id.id,d)),!u.outlineColorProperty.isConstant||c){let A=u.outlineColorProperty,b=X.getValueOrDefault(A,e,z.WHITE,IAt);z.equals(d._lastColor,b)||(d._lastColor=z.clone(b,d._lastColor),d.color=Jt.toValue(b,d.color),(this.translucent&&d.color[3]===255||!this.translucent&&d.color[3]!==255)&&(this.itemsToRemove[n++]=u))}let p=u.entity.isShowing&&(u.hasConstantOutline||u.isOutlineVisible(e)),g=d.show[0]===1;p!==g&&(d.show=Pn.toValue(p,d.show));let m=u.distanceDisplayConditionProperty;if(!X.isConstant(m)){let A=X.getValueOrDefault(m,e,DAt,PAt);Gt.equals(A,d._lastDistanceDisplayCondition)||(d._lastDistanceDisplayCondition=Gt.clone(A,d._lastDistanceDisplayCondition),d.distanceDisplayCondition=Qn.toValue(A,d.distanceDisplayCondition))}let y=u.terrainOffsetProperty;if(!X.isConstant(y)){let A=X.getValueOrDefault(y,e,RAt,OAt);h.equals(A,d._lastOffset)||(d._lastOffset=h.clone(A,d._lastOffset),d.offset=Er.toValue(A,d.offset))}}this.updateShows(i),this.waitingOnCreate=!1}else l(i)&&!i.ready&&(t=!1);return this.itemsToRemove.length=n,t};kg.prototype.updateShows=function(e){let t=this.showsUpdated.values,n=t.length;for(let i=0;i<n;i++){let r=t[i],o=this.geometry.get(r.id),s=this.attributes.get(o.id.id);l(s)||(s=e.getGeometryInstanceAttributes(o.id),this.attributes.set(o.id.id,s));let a=r.entity.isShowing,c=s.show[0]===1;a!==c&&(s.show=Pn.toValue(a,s.show),o.attributes.show.value[0]=s.show[0])}this.showsUpdated.removeAll()};kg.prototype.contains=function(e){return this.updaters.contains(e.id)};kg.prototype.getBoundingSphere=function(e,t){let n=this.primitive;if(!n.ready)return Pt.PENDING;let i=n.getGeometryInstanceAttributes(e.entity);return!l(i)||!l(i.boundingSphere)||l(i.show)&&i.show[0]===0?Pt.FAILED:(i.boundingSphere.clone(t),Pt.DONE)};kg.prototype.removeAllPrimitives=function(){let e=this.primitives,t=this.primitive;l(t)&&(e.remove(t),this.primitive=void 0,this.geometry.removeAll(),this.updaters.removeAll());let n=this.oldPrimitive;l(n)&&(e.remove(n),this.oldPrimitive=void 0)};function GS(e,t,n){this._primitives=e,this._scene=t,this._shadows=n,this._solidBatches=new zt,this._translucentBatches=new zt}GS.prototype.add=function(e,t){let n=t.createOutlineGeometryInstance(e),i=this._scene.clampLineWidth(t.outlineWidth),r,o;n.attributes.color.value[3]===255?(r=this._solidBatches,o=r.get(i),l(o)||(o=new kg(this._primitives,!1,i,this._shadows),r.set(i,o)),o.add(t,n)):(r=this._translucentBatches,o=r.get(i),l(o)||(o=new kg(this._primitives,!0,i,this._shadows),r.set(i,o)),o.add(t,n))};GS.prototype.remove=function(e){let t,n=this._solidBatches.values,i=n.length;for(t=0;t<i;t++)if(n[t].remove(e))return;let r=this._translucentBatches.values,o=r.length;for(t=0;t<o;t++)if(r[t].remove(e))return};GS.prototype.update=function(e){let t,n,i,r,o=this._solidBatches.values,s=o.length,a=this._translucentBatches.values,c=a.length,u,f=!0,d;do{for(d=!1,n=0;n<s;n++){r=o[n],f=r.update(e),u=r.itemsToRemove;let p=u.length;if(p>0)for(d=!0,t=0;t<p;t++)i=u[t],r.remove(i),this.add(e,i)}for(n=0;n<c;n++){r=a[n],f=r.update(e),u=r.itemsToRemove;let p=u.length;if(p>0)for(d=!0,t=0;t<p;t++)i=u[t],r.remove(i),this.add(e,i)}}while(d);return f};GS.prototype.getBoundingSphere=function(e,t){let n,i=this._solidBatches.values,r=i.length;for(n=0;n<r;n++){let a=i[n];if(a.contains(e))return a.getBoundingSphere(e,t)}let o=this._translucentBatches.values,s=o.length;for(n=0;n<s;n++){let a=o[n];if(a.contains(e))return a.getBoundingSphere(e,t)}return Pt.FAILED};GS.prototype.removeAllPrimitives=function(){let e,t=this._solidBatches.values,n=t.length;for(e=0;e<n;e++)t[e].removeAllPrimitives();let i=this._translucentBatches.values,r=i.length;for(e=0;e<r;e++)i[e].removeAllPrimitives()};var ER=GS;var MAt=[];function Bu(e,t,n,i){n=n??e.primitives,i=i??e.groundPrimitives,this._scene=e,this._primitives=n,this._groundPrimitives=i,this._entityCollection=void 0,this._addedObjects=new zt,this._removedObjects=new zt,this._changedObjects=new zt;let r=Dn.NUMBER_OF_SHADOW_MODES;this._outlineBatches=new Array(r*2),this._closedColorBatches=new Array(r*2),this._closedMaterialBatches=new Array(r*2),this._openColorBatches=new Array(r*2),this._openMaterialBatches=new Array(r*2);let o=Qr.supportsMaterialsforEntitiesOnTerrain(e);this._supportsMaterialsforEntitiesOnTerrain=o;let s;for(s=0;s<r;++s)this._outlineBatches[s]=new ER(n,e,s,!1),this._outlineBatches[r+s]=new ER(n,e,s,!0),this._closedColorBatches[s]=new em(n,An,void 0,!0,s,!0),this._closedColorBatches[r+s]=new em(n,An,void 0,!0,s,!1),this._closedMaterialBatches[s]=new nm(n,Cr,void 0,!0,s,!0),this._closedMaterialBatches[r+s]=new nm(n,Cr,void 0,!0,s,!1),this._openColorBatches[s]=new em(n,An,void 0,!1,s,!0),this._openColorBatches[r+s]=new em(n,An,void 0,!1,s,!1),this._openMaterialBatches[s]=new nm(n,Cr,void 0,!1,s,!0),this._openMaterialBatches[r+s]=new nm(n,Cr,void 0,!1,s,!1);let a=ei.NUMBER_OF_CLASSIFICATION_TYPES,c=new Array(a),u=[];if(o)for(s=0;s<a;++s)u.push(new fj(i,s,Cr)),c[s]=new TR(i,s);else for(s=0;s<a;++s)c[s]=new TR(i,s);this._groundColorBatches=c,this._groundMaterialBatches=u,this._dynamicBatch=new bS(n,i),this._batches=this._outlineBatches.concat(this._closedColorBatches,this._closedMaterialBatches,this._openColorBatches,this._openMaterialBatches,this._groundColorBatches,this._groundMaterialBatches,this._dynamicBatch),this._subscriptions=new zt,this._updaterSets=new zt,this._entityCollection=t,t.collectionChanged.addEventListener(Bu.prototype._onCollectionChanged,this),this._onCollectionChanged(t,t.values,MAt)}Bu.registerUpdater=function(e){FS.registerUpdater(e)};Bu.unregisterUpdater=function(e){FS.unregisterUpdater(e)};Bu.prototype.update=function(e){let t=this._addedObjects,n=t.values,i=this._removedObjects,r=i.values,o=this._changedObjects,s=o.values,a,c,u,f,d=this;for(a=s.length-1;a>-1;a--)c=s[a],u=c.id,f=this._updaterSets.get(u),f.entity===c?f.forEach(function(y){d._removeUpdater(y),d._insertUpdaterIntoBatch(e,y)}):(r.push(c),n.push(c));for(a=r.length-1;a>-1;a--)c=r[a],u=c.id,f=this._updaterSets.get(u),f.forEach(this._removeUpdater.bind(this)),f.destroy(),this._updaterSets.remove(u),this._subscriptions.get(u)(),this._subscriptions.remove(u);for(a=n.length-1;a>-1;a--)c=n[a],u=c.id,f=new FS(c,this._scene),this._updaterSets.set(u,f),f.forEach(function(y){d._insertUpdaterIntoBatch(e,y)}),this._subscriptions.set(u,f.geometryChanged.addEventListener(Bu._onGeometryChanged,this));t.removeAll(),i.removeAll(),o.removeAll();let p=!0,g=this._batches,m=g.length;for(a=0;a<m;a++)p=g[a].update(e)&&p;return p};var NAt=[],LAt=new ue;Bu.prototype.getBoundingSphere=function(e,t){let n=NAt,i=LAt,r=0,o,s=this._batches,a=s.length,c=e.id,u=this._updaterSets.get(c).updaters;for(let f=0;f<u.length;f++){let d=u[f];for(let p=0;p<a;p++){if(o=s[p].getBoundingSphere(d,i),o===Pt.PENDING)return Pt.PENDING;o===Pt.DONE&&(n[r]=ue.clone(i,n[r]),r++)}}return r===0?Pt.FAILED:(n.length=r,ue.fromBoundingSpheres(n,t),Pt.DONE)};Bu.prototype.isDestroyed=function(){return!1};Bu.prototype.destroy=function(){this._entityCollection.collectionChanged.removeEventListener(Bu.prototype._onCollectionChanged,this),this._addedObjects.removeAll(),this._removedObjects.removeAll();let e,t=this._batches,n=t.length;for(e=0;e<n;e++)t[e].removeAllPrimitives();let i=this._subscriptions.values;for(n=i.length,e=0;e<n;e++)i[e]();this._subscriptions.removeAll();let r=this._updaterSets.values;for(n=r.length,e=0;e<n;e++)r[e].destroy();return this._updaterSets.removeAll(),le(this)};Bu.prototype._removeUpdater=function(e){let t=this._batches,n=t.length;for(let i=0;i<n;i++)t[i].remove(e)};Bu.prototype._insertUpdaterIntoBatch=function(e,t){if(t.isDynamic){this._dynamicBatch.add(e,t);return}let n;(t.outlineEnabled||t.fillEnabled)&&(n=t.shadowsProperty.getValue(e));let i=Dn.NUMBER_OF_SHADOW_MODES;if(t.outlineEnabled&&(l(t.terrainOffsetProperty)?this._outlineBatches[i+n].add(e,t):this._outlineBatches[n].add(e,t)),t.fillEnabled)if(t.onTerrain){let r=t.classificationTypeProperty.getValue(e);t.fillMaterialProperty instanceof Kt?this._groundColorBatches[r].add(e,t):this._groundMaterialBatches[r].add(e,t)}else t.isClosed?t.fillMaterialProperty instanceof Kt?l(t.terrainOffsetProperty)?this._closedColorBatches[i+n].add(e,t):this._closedColorBatches[n].add(e,t):l(t.terrainOffsetProperty)?this._closedMaterialBatches[i+n].add(e,t):this._closedMaterialBatches[n].add(e,t):t.fillMaterialProperty instanceof Kt?l(t.terrainOffsetProperty)?this._openColorBatches[i+n].add(e,t):this._openColorBatches[n].add(e,t):l(t.terrainOffsetProperty)?this._openMaterialBatches[i+n].add(e,t):this._openMaterialBatches[n].add(e,t)};Bu._onGeometryChanged=function(e){let t=this._removedObjects,n=this._changedObjects,i=e.entity,r=i.id;!l(t.get(r))&&!l(n.get(r))&&n.set(r,i)};Bu.prototype._onCollectionChanged=function(e,t,n){let i=this._addedObjects,r=this._removedObjects,o=this._changedObjects,s,a,c;for(s=n.length-1;s>-1;s--)c=n[s],a=c.id,i.remove(a)||(r.set(a,c),o.remove(a));for(s=t.length-1;s>-1;s--)c=t[s],a=c.id,r.remove(a)?o.set(a,c):i.set(a,c)};var dj=Bu;var FAt=1,BAt="30px sans-serif",kAt=Io.FILL,UAt=z.WHITE,zAt=z.BLACK,VAt=1,jAt=!1,HAt=new z(.165,.165,.165,.8),GAt=new U(7,5),WAt=U.ZERO,qAt=h.ZERO,YAt=We.NONE,XAt=Hi.CENTER,KAt=qn.CENTER,$At=new h,JAt=new z,ZAt=new z,QAt=new z,ebt=new U,tbt=new h,nbt=new U,ibt=new qt,rbt=new qt,obt=new qt,sbt=new Gt;function tve(e){this.entity=e,this.label=void 0,this.index=void 0}function mA(e,t){t.collectionChanged.addEventListener(mA.prototype._onCollectionChanged,this),this._cluster=e,this._entityCollection=t,this._items=new zt,this._onCollectionChanged(t,t.values,[],[])}mA.prototype.update=function(e){let t=this._items.values,n=this._cluster;for(let i=0,r=t.length;i<r;i++){let o=t[i],s=o.entity,a=s._label,c,u=o.label,f=s.isShowing&&s.isAvailable(e)&&X.getValueOrDefault(a._show,e,!0),d;if(f&&(d=X.getValueOrUndefined(s._position,e,$At),c=X.getValueOrUndefined(a._text,e),f=l(d)&&l(c)),!f){zee(o,s,n);continue}X.isConstant(s._position)||(n._clusterDirty=!0);let p=!1,g=X.getValueOrDefault(a._heightReference,e,YAt);l(u)||(u=n.getLabel(s),u.id=s,o.label=u,p=h.equals(u.position,d)&&u.heightReference===g),u.show=!0,u.position=d,u.text=c,u.scale=X.getValueOrDefault(a._scale,e,FAt),u.font=X.getValueOrDefault(a._font,e,BAt),u.style=X.getValueOrDefault(a._style,e,kAt),u.fillColor=X.getValueOrDefault(a._fillColor,e,UAt,JAt),u.outlineColor=X.getValueOrDefault(a._outlineColor,e,zAt,ZAt),u.outlineWidth=X.getValueOrDefault(a._outlineWidth,e,VAt),u.showBackground=X.getValueOrDefault(a._showBackground,e,jAt),u.backgroundColor=X.getValueOrDefault(a._backgroundColor,e,HAt,QAt),u.backgroundPadding=X.getValueOrDefault(a._backgroundPadding,e,GAt,ebt),u.pixelOffset=X.getValueOrDefault(a._pixelOffset,e,WAt,nbt),u.eyeOffset=X.getValueOrDefault(a._eyeOffset,e,qAt,tbt),u.heightReference=g,u.horizontalOrigin=X.getValueOrDefault(a._horizontalOrigin,e,XAt),u.verticalOrigin=X.getValueOrDefault(a._verticalOrigin,e,KAt),u.translucencyByDistance=X.getValueOrUndefined(a._translucencyByDistance,e,ibt),u.pixelOffsetScaleByDistance=X.getValueOrUndefined(a._pixelOffsetScaleByDistance,e,rbt),u.scaleByDistance=X.getValueOrUndefined(a._scaleByDistance,e,obt),u.distanceDisplayCondition=X.getValueOrUndefined(a._distanceDisplayCondition,e,sbt),u.disableDepthTestDistance=X.getValueOrUndefined(a._disableDepthTestDistance,e),p&&u._updateClamping()}return!0};mA.prototype.getBoundingSphere=function(e,t){let n=this._items.get(e.id);if(!l(n)||!l(n.label))return Pt.FAILED;let i=n.label;if(i.heightReference===We.NONE)t.center=h.clone(i.position,t.center);else if(i._clampedToSurface)t.center=h.clone(i._clampedPosition,t.center);else{let r=this._cluster._scene,o=this._items,s=Km(r,n,i.position,[i],()=>o.get(e.id)===n);if(s===void 0)return Pt.PENDING;s===null?t.center=h.clone(i.position,t.center):t.center=H_(i.position,s,i.heightReference,r.ellipsoid??ee.default,t.center)}return t.radius=0,Pt.DONE};mA.prototype.isDestroyed=function(){return!1};mA.prototype.destroy=function(){this._entityCollection.collectionChanged.removeEventListener(mA.prototype._onCollectionChanged,this);let e=this._entityCollection.values;for(let t=0;t<e.length;t++)this._cluster.removeLabel(e[t]);return le(this)};mA.prototype._onCollectionChanged=function(e,t,n,i){let r,o,s=this._items,a=this._cluster;for(r=t.length-1;r>-1;r--)o=t[r],l(o._label)&&l(o._position)&&s.set(o.id,new tve(o));for(r=i.length-1;r>-1;r--)o=i[r],l(o._label)&&l(o._position)?s.contains(o.id)||s.set(o.id,new tve(o)):(zee(s.get(o.id),o,a),s.remove(o.id));for(r=n.length-1;r>-1;r--)o=n[r],zee(s.get(o.id),o,a),s.remove(o.id)};function zee(e,t,n){l(e)&&(e.label=void 0,n.removeLabel(t))}var hj=mA;var abt=1,cbt=!0,lbt=0,ubt=!0,fbt=!0,dbt=Dn.ENABLED,hbt=We.NONE,mbt=z.RED,pbt=0,gbt=z.WHITE,_bt=Nl.HIGHLIGHT,ybt=.5,Abt=new U(1,1),nve={maximumPositionEpsilon:Number.POSITIVE_INFINITY},bbt=new M,xbt=new M,ive=new z,rve=new Array(4),Tbt=new h;function pA(e,t){t.collectionChanged.addEventListener(pA.prototype._onCollectionChanged,this),this._scene=e,this._primitives=e.primitives,this._entityCollection=t,this._modelHash={},this._entitiesToVisualize=new zt,this._onCollectionChanged(t,t.values,[],[])}function Ebt(e,t){return e instanceof hi?e.valueOf():X.getValueOrUndefined(e,t)}function Cbt(e,t){return t!==e.uri?!1:t instanceof De?t._url===e.uriUrl&&t._queryParameters===e.uriQueryParameters&&t._templateValues===e.uriTemplateValues:!0}function ove(e,t){e.uri=t,t instanceof De&&(e.uriUrl=t._url,e.uriQueryParameters=t._queryParameters,e.uriTemplateValues=t._templateValues)}function vbt(e,t){if(!l(t))return M.clone(e);for(let n=0;n<16;n++)t[n]=e[n];return t}async function Sbt(e,t,n,i,r){let o=e._primitives,s=e._modelHash;try{let a=await Ed.fromGltfAsync({url:n,incrementallyLoadTextures:i,scene:e._scene,environmentMapOptions:r});if(e.isDestroyed()||!l(s[t.id]))return;a.id=t,o.add(a),s[t.id].modelPrimitive=a,a.errorEvent.addEventListener(c=>{l(s[t.id])&&(console.log(c),c.name!=="TextureError"&&a.incrementallyLoadTextures&&(s[t.id].loadFailed=!0))})}catch(a){if(e.isDestroyed()||!l(s[t.id]))return;console.log(a),s[t.id].loadFailed=!0}}pA.prototype.update=function(e){let t=this._entitiesToVisualize.values,n=this._modelHash,i=this._primitives;for(let r=0,o=t.length;r<o;r++){let s=t[r],a=s._model,c,u=n[s.id],f=s.isShowing&&s.isAvailable(e)&&X.getValueOrDefault(a._show,e,!0),d,p;if(f&&(d=s.computeModelMatrix(e,bbt),p=Ebt(a._uri,e),f=l(d)&&l(p)),!f){l(u)&&u.modelPrimitive&&(u.modelPrimitive.show=!1);continue}if((!l(u)||!Cbt(u,p))&&(c=De.createIfNeeded(p),l(u)&&c.url===u.url&&(ove(u,p),c=void 0)),l(c)){l(u?.modelPrimitive)&&(i.removeAndDestroy(u.modelPrimitive),delete n[s.id]),u={modelPrimitive:void 0,url:c.url,uri:void 0,uriUrl:void 0,uriQueryParameters:void 0,uriTemplateValues:void 0,animationsRunning:!1,nodeTransformationsScratch:{},articulationsScratch:{},loadFailed:!1,modelUpdated:!1,environmentMapOptionsScratch:{...nve}},n[s.id]=u,ove(u,p);let y=X.getValueOrDefault(a._incrementallyLoadTextures,e,ubt),A=X.getValueOrDefault(a._environmentMapOptions,e,nve,u.environmentMapOptionsScratch);Sbt(this,s,c,y,A)}let g=u.modelPrimitive;if(!l(g))continue;g.show=!0,g.scale=X.getValueOrDefault(a._scale,e,abt),g.enableVerticalExaggeration=X.getValueOrDefault(a._enableVerticalExaggeration,e,cbt),g.minimumPixelSize=X.getValueOrDefault(a._minimumPixelSize,e,lbt),g.maximumScale=X.getValueOrUndefined(a._maximumScale,e),g.modelMatrix=vbt(d,g.modelMatrix),g.shadows=X.getValueOrDefault(a._shadows,e,dbt),g.heightReference=X.getValueOrDefault(a._heightReference,e,hbt),g.distanceDisplayCondition=X.getValueOrUndefined(a._distanceDisplayCondition,e),g.silhouetteColor=X.getValueOrDefault(a._silhouetteColor,e,mbt,ive),g.silhouetteSize=X.getValueOrDefault(a._silhouetteSize,e,pbt),g.color=X.getValueOrDefault(a._color,e,gbt,ive),g.colorBlendMode=X.getValueOrDefault(a._colorBlendMode,e,_bt),g.colorBlendAmount=X.getValueOrDefault(a._colorBlendAmount,e,ybt),g.clippingPlanes=X.getValueOrUndefined(a._clippingPlanes,e),g.clampAnimations=X.getValueOrDefault(a._clampAnimations,e,fbt),g.imageBasedLighting.imageBasedLightingFactor=X.getValueOrDefault(a._imageBasedLightingFactor,e,Abt);let m=X.getValueOrUndefined(a._lightColor,e);if(l(m)&&(z.pack(m,rve,0),m=h.unpack(rve,0,Tbt)),g.lightColor=m,g.customShader=X.getValueOrUndefined(a._customShader,e),n[s.id].modelUpdated=!0,g.ready){let y=X.getValueOrDefault(a._runAnimations,e,!0);u.animationsRunning!==y&&(y?g.activeAnimations.addAll({loop:gf.REPEAT}):g.activeAnimations.removeAll(),u.animationsRunning=y);let A=X.getValueOrUndefined(a._nodeTransformations,e,u.nodeTransformationsScratch);if(l(A)){let T=Object.keys(A);for(let E=0,v=T.length;E<v;++E){let S=T[E],I=A[S];if(!l(I))continue;let R=g.getNode(S);if(!l(R))continue;let O=M.fromTranslationRotationScale(I,xbt);R.matrix=M.multiply(R.originalMatrix,O,O)}}let b=!1,x=X.getValueOrUndefined(a._articulations,e,u.articulationsScratch);if(l(x)){let T=Object.keys(x);for(let E=0,v=T.length;E<v;++E){let S=T[E],I=x[S];l(I)&&(b=!0,g.setArticulationStage(S,I))}}b&&g.applyArticulations()}}return!0};pA.prototype.isDestroyed=function(){return!1};pA.prototype.destroy=function(){this._entityCollection.collectionChanged.removeEventListener(pA.prototype._onCollectionChanged,this);let e=this._entitiesToVisualize.values,t=this._modelHash,n=this._primitives;for(let i=e.length-1;i>-1;i--)Vee(this,e[i],t,n);return le(this)};var CR=new h,wbt=new he;pA.prototype.getBoundingSphere=function(e,t){let n=this._modelHash[e.id];if(!l(n))return Pt.FAILED;if(n.loadFailed)return Pt.FAILED;let i=n.modelPrimitive;if(!l(i)||!i.show)return Pt.PENDING;if(!i.ready||!n.modelUpdated)return Pt.PENDING;let r=this._scene,o=r.ellipsoid??ee.default;if(i.heightReference!==We.NONE){let a=i.modelMatrix;CR.x=a[12],CR.y=a[13],CR.z=a[14];let c=o.cartesianToCartographic(CR,wbt),u=r.getHeight(c,i.heightReference);if(l(u)||(u=i._lastSurfaceHeight),!l(u)){let f=this._modelHash,d=Km(r,n,CR,[i],()=>f[e.id]===n);if(d===void 0)return Pt.PENDING;d!==null&&(u=d)}return l(u)&&(i.heightReference===We.CLIP_TO_GROUND?c.height<u&&(c.height=u):us(i.heightReference)?c.height=u:c.height+=u),ue.clone(i.boundingSphere,t),t.center=o.cartographicToCartesian(c),Pt.DONE}return ue.clone(i.boundingSphere,t),Pt.DONE};pA.prototype._onCollectionChanged=function(e,t,n,i){let r,o,s=this._entitiesToVisualize,a=this._modelHash,c=this._primitives;for(r=t.length-1;r>-1;r--)o=t[r],l(o._model)&&l(o._position)&&s.set(o.id,o);for(r=i.length-1;r>-1;r--)o=i[r],l(o._model)&&l(o._position)?(Ibt(o,a),s.set(o.id,o)):(Vee(this,o,a,c),s.remove(o.id));for(r=n.length-1;r>-1;r--)o=n[r],Vee(this,o,a,c),s.remove(o.id)};function Vee(e,t,n,i){let r=n[t.id];l(r)&&(i.removeAndDestroy(r.modelPrimitive),delete n[t.id])}function Ibt(e,t){let n=t[e.id];l(n)&&(n.nodeTransformationsScratch={},n.articulationsScratch={})}var mj=pA;function gA(e){this._definitionChanged=new be,this._value=void 0,this._removeSubscription=void 0,this.setValue(e)}Object.defineProperties(gA.prototype,{isConstant:{get:function(){return X.isConstant(this._value)}},definitionChanged:{get:function(){return this._definitionChanged}},referenceFrame:{get:function(){return l(this._value)?this._value.referenceFrame:Wi.FIXED}}});var Pbt=new K;gA.prototype.getValue=function(e,t){return l(e)||(e=K.now(Pbt)),this.getValueInReferenceFrame(e,Wi.FIXED,t)};gA.prototype.setValue=function(e){this._value!==e&&(this._value=e,l(this._removeSubscription)&&(this._removeSubscription(),this._removeSubscription=void 0),l(e)&&(this._removeSubscription=e.definitionChanged.addEventListener(this._raiseDefinitionChanged,this)),this._definitionChanged.raiseEvent(this))};gA.prototype.getValueInReferenceFrame=function(e,t,n){if(l(this._value))return n=this._value.getValueInReferenceFrame(e,t,n),l(n)?ee.default.scaleToGeodeticSurface(n,n):void 0};gA.prototype.equals=function(e){return this===e||e instanceof gA&&this._value===e._value};gA.prototype._raiseDefinitionChanged=function(){this._definitionChanged.raiseEvent(this)};var Ug=gA;var sve=new $,ave=new $,cve=new $,Dbt=new h,lve=new h,Rbt=new h,Obt=new h,pj=new Le,gj=new M,_j=new $;function SR(e,t,n,i,r){if(!(!l(t)||!l(n))){if(h.subtract(t,n,r),l(i.orientation))i.orientation.getValue(e,pj)&&(Le.conjugate(pj,pj),$.fromQuaternion(pj,_j),$.multiplyByVector(_j,r,r));else if(l(Gee(e,i.position,gj)))M.inverse(gj,gj),M.getRotation(gj,_j),$.multiplyByVector(_j,r,r);else return;return r}}function Gee(e,t,n){let i=t.getValue(e,Dbt);if(l(i)){let r=K.addSeconds(e,.01,new K),o=t.getValue(r,lve);if(l(o)&&!h.equalsEpsilon(i,o,P.EPSILON16)){let s=At.computeFixedToIcrfMatrix(e,sve),a=At.computeFixedToIcrfMatrix(r,ave),c;!l(s)||!l(a)?(c=At.computeTemeToPseudoFixedMatrix(e,cve),s=$.transpose(c,sve),a=At.computeTemeToPseudoFixedMatrix(r,ave),$.transpose(a,a)):c=$.transpose(s,cve);let u=Rbt;h.normalize(i,u),h.normalize(o,o),$.multiplyByVector(s,u,u),$.multiplyByVector(a,o,o);let f=h.cross(u,o,Obt);if(!h.equalsEpsilon(f,h.ZERO,P.EPSILON16)){let d=h.cross(f,u,lve);return $.multiplyByVector(c,d,d),$.multiplyByVector(c,f,f),$.multiplyByVector(c,u,u),h.normalize(d,d),h.normalize(f,f),h.normalize(u,u),l(n)||(n=new M),n[0]=d.x,n[1]=d.y,n[2]=d.z,n[3]=0,n[4]=f.x,n[5]=f.y,n[6]=f.z,n[7]=0,n[8]=u.x,n[9]=u.y,n[10]=u.z,n[11]=0,n[12]=i.x,n[13]=i.y,n[14]=i.z,n[15]=1,n}}}}var uve=60,gve=1,_ve=new Cn,jee=new Cn,Hee=new Cn;function fve(e){this.entity=e,this.polyline=void 0,this.segmentPolylines=[],this.index=void 0,this.updater=void 0}var yj=new h;function Mbt(e,t,n,i,r,o,s,a,c){let u,f,d=!1;o instanceof Qr&&(u=o,f=u.position,o=Wi.FIXED,d=!0);let p=a,g,m;g=e.getValueInReferenceFrame(t,o,c[p]),d?(m=f.getValueInReferenceFrame(t,o,yj),g=SR(t,g,m,u,g),l(g)&&(c[p++]=g)):l(g)&&(c[p++]=g);let y=!l(r)||K.lessThanOrEquals(r,t)||K.greaterThanOrEquals(r,n),A=0,b=i.length,x=i[A],T=n,E=!1,v,S,I;for(;A<b;){if(!y&&K.greaterThanOrEquals(x,r)&&(g=e.getValueInReferenceFrame(r,o,c[p]),d?(m=f.getValueInReferenceFrame(r,o,yj),l(g)&&l(m)&&(g=SR(r,g,m,u,g),l(g)&&(c[p++]=g))):l(g)&&(c[p++]=g),y=!0),K.greaterThan(x,t)&&K.lessThan(x,T)&&!x.equals(r)&&(g=e.getValueInReferenceFrame(x,o,c[p]),d?(m=f.getValueInReferenceFrame(x,o,yj),l(g)&&l(m)&&(g=SR(x,g,m,u,g),l(g)&&(c[p++]=g))):l(g)&&(c[p++]=g)),A<b-1){if(s>0&&!E){let R=i[A+1],O=K.secondsDifference(R,x);E=O>s,E&&(v=Math.ceil(O/s),S=0,I=O/Math.max(v,2),v=Math.max(v-1,1))}if(E&&S<v){x=K.addSeconds(x,I,new K),S++;continue}}E=!1,A++,x=i[A]}return g=e.getValueInReferenceFrame(n,o,c[p]),d?(m=f.getValueInReferenceFrame(n,o,yj),l(g)&&l(m)&&(g=SR(n,g,m,u,g),l(g)&&(c[p++]=g))):l(g)&&(c[p++]=g),p}function Nbt(e,t,n,i,r,o,s,a){let c,u=0,f=s,d=t,p=!l(i)||K.lessThanOrEquals(i,t)||K.greaterThanOrEquals(i,n);for(;K.lessThan(d,n);)!p&&K.greaterThanOrEquals(d,i)&&(p=!0,c=e.getValueInReferenceFrame(i,r,a[f]),l(c)&&(a[f]=c,f++)),c=e.getValueInReferenceFrame(d,r,a[f]),l(c)&&(a[f]=c,f++),u++,d=K.addSeconds(t,o*u,new K);return c=e.getValueInReferenceFrame(n,r,a[f]),l(c)&&(a[f]=c,f++),f}function Lbt(e,t,n,i,r,o,s,a){let c,u=0,f=s,d=t,p=Math.max(o,60),g=!l(i)||K.lessThanOrEquals(i,t)||K.greaterThanOrEquals(i,n);for(;K.lessThan(d,n);)!g&&K.greaterThanOrEquals(d,i)&&(g=!0,c=e.getValueInReferenceFrame(i,r,a[f]),l(c)&&(a[f]=c,f++)),c=e.getValueInReferenceFrame(d,r,a[f]),l(c)&&(a[f]=c,f++),u++,d=K.addSeconds(t,p*u,new K);return c=e.getValueInReferenceFrame(n,r,a[f]),l(c)&&(a[f]=c,f++),f}function Fbt(e,t,n,i,r,o,s,a){Hee.start=t,Hee.stop=n;let c=s,u=e.intervals;for(let f=0;f<u.length;f++){let d=u.get(f);if(!Cn.intersect(d,Hee,_ve).isEmpty){let p=d.start;d.isStartIncluded||(d.isStopIncluded?p=d.stop:p=K.addSeconds(d.start,K.secondsDifference(d.stop,d.start)/2,new K));let g=e.getValueInReferenceFrame(p,r,a[c]);l(g)&&(a[c]=g,c++)}}return c}function Bbt(e,t,n,i,r,o,s,a){let c=e.getValueInReferenceFrame(t,r,a[s]);return l(c)&&(a[s++]=c),s}function kbt(e,t,n,i,r,o,s,a){jee.start=t,jee.stop=n;let c=s,u=e.intervals;for(let f=0;f<u.length;f++){let d=u.get(f);if(!Cn.intersect(d,jee,_ve).isEmpty){let p=d.start,g=d.stop,m=t;K.greaterThan(p,m)&&(m=p);let y=n;K.lessThan(g,y)&&(y=g),c=yve(d.data,m,y,i,r,o,c,a)}}return c}function yve(e,t,n,i,r,o,s,a){for(;e instanceof oA;)e=e.resolvedProperty;if(e instanceof Cc){let c=e._property._times;s=Mbt(e,t,n,c,i,r,o,s,a)}else e instanceof Zk?s=Nbt(e,t,n,i,r,o,s,a):e instanceof Ec?s=kbt(e,t,n,i,r,o,s,a):e instanceof aA?s=Fbt(e,t,n,i,r,o,s,a):e instanceof gu||e instanceof Ug&&X.isConstant(e)?s=Bbt(e,t,n,i,r,o,s,a):s=Lbt(e,t,n,i,r,o,s,a);return s}function Wee(e,t,n,i,r,o,s){l(s)||(s=[]);let a=yve(e,t,n,i,r,o,0,s);return s.length=a,s}var dve=new $,hve=new Le,mve=new $,vR=new Cn,Aj=new Cn,iT=new Cn;function Ubt(e){let t=[];if(!l(e))return t;for(let n in e){if(n[0]!=="_"||n==="_definitionChanged"||n.endsWith("Subscription"))continue;let i=e[n];l(i)&&typeof i.getValue=="function"&&!X.isConstant(i)&&t.push(i)}return t}function pve(e,t,n,i,r,o,s,a,c,u,f){e.sort(K.compare),e=Lr(e,K.equalsEpsilon);let d=f;for(let p=0;p<e.length-1;p++){let g=e[p],m=e[p+1];if(!K.lessThan(g,m))continue;let y=K.addSeconds(g,K.secondsDifference(m,g)/2,new K),A=Wee(t,g,m,n,c,a,[]);if(A.length<2)continue;let b=o.segmentPolylines[d];l(b)||(b=s.add(),b.id=r,o.segmentPolylines[d]=b),b.show=!0,b.positions=A,b.material=Co.getValue(y,u,b.material),b.width=X.getValueOrDefault(i._width,n,gve),d++}return d}function wR(e,t){this._unusedIndexes=[],this._polylineCollection=new Sp,this._scene=e,this._referenceFrame=t,e.primitives.add(this._polylineCollection)}wR.prototype.update=function(e){let t=this._referenceFrame;if(t===Wi.INERTIAL){let n=At.computeIcrfToFixedMatrix(e,dve);l(n)||(n=At.computeTemeToPseudoFixedMatrix(e,dve)),M.fromRotationTranslation(n,h.ZERO,this._polylineCollection.modelMatrix)}else if(t instanceof Qr){let n=t.position.getValue(e);l(t.orientation)?l(t.orientation.getValue(e,hve))&&($.fromQuaternion(hve,mve),M.fromRotationTranslation(mve,n,this._polylineCollection.modelMatrix)):Gee(e,t.position,this._polylineCollection.modelMatrix)}};wR.prototype.updateObject=function(e,t){let n=t.entity,i=n._path,r=n._position,o,s,a=i._show,c=t.polyline,u=n.isShowing&&n.isAvailable(e)&&(!l(a)||a.getValue(e));if(u){let m=X.getValueOrUndefined(i._leadTime,e),y=X.getValueOrUndefined(i._trailTime,e),A=n._availability,b=l(A),x=l(m),T=l(y);if(u=b||x&&T,u){if(T&&(o=K.addSeconds(e,-y,new K)),x&&(s=K.addSeconds(e,m,new K)),b){let E=A.start,v=A.stop;(!T||K.greaterThan(E,o))&&(o=E),(!x||K.lessThan(v,s))&&(s=v)}u=K.lessThan(o,s)}}if(!u){l(c)&&(this._unusedIndexes.push(t.index),t.polyline=void 0,c.show=!1,t.index=void 0);for(let m=0;m<t.segmentPolylines.length;m++)t.segmentPolylines[m].show=!1;return}if(!l(c)){let m=this._unusedIndexes;if(m.length>0){let A=m.pop();c=this._polylineCollection.get(A),t.index=A}else t.index=this._polylineCollection.length,c=this._polylineCollection.add();c.id=n,t.polyline=c}let f=X.getValueOrDefault(i._resolution,e,uve),d=Wee(r,o,s,e,this._referenceFrame,f,c.positions.slice());if(d.length<2){c.show=!1;for(let m=0;m<t.segmentPolylines.length;m++)t.segmentPolylines[m].show=!1;return}c.show=!0,c.positions=d,c.material=Co.getValue(e,i.material,c.material);let p=X.getValueOrUndefined(i.materialMode,e),g=i.material;if(p===Og.PORTIONS&&!g.isConstant){l(c)&&(c.show=!1);let m=f>0?f:uve,y=g.intervals,A=0;if(l(y)){vR.start=o,vR.stop=s,vR.isStartIncluded=!0,vR.isStopIncluded=!0;for(let b=0;b<y.length;b++){let x=y.get(b);if(!Cn.intersect(x,vR,Aj))continue;let T=Aj.start,E=Aj.stop;if(K.greaterThanOrEquals(T,E))continue;let v=Ubt(x.data),S=[K.clone(T),K.clone(E)];for(let I=0;I<v.length;I++){let R=v[I],O=R.intervals;if(l(O))for(let L=0;L<O.length;L++){let _=O.get(L);Cn.intersect(_,Aj,iT)&&(K.greaterThan(iT.start,T)&&K.lessThan(iT.start,E)&&S.push(K.clone(iT.start)),K.greaterThan(iT.stop,T)&&K.lessThan(iT.stop,E)&&S.push(K.clone(iT.stop)))}else if(!X.isConstant(R)){let L=K.clone(T);for(;K.lessThan(L,E);)S.push(K.clone(L)),L=K.addSeconds(L,m,new K)}}A=pve(S,r,e,i,n,t,this._polylineCollection,m,this._referenceFrame,x.data,A)}}else{let b=[K.clone(o),K.clone(s)],x=K.addSeconds(o,m,new K);for(;K.lessThan(x,s);)b.push(K.clone(x)),x=K.addSeconds(x,m,new K);A=pve(b,r,e,i,n,t,this._polylineCollection,m,this._referenceFrame,i.material,A)}for(let b=A;b<t.segmentPolylines.length;b++)l(t.segmentPolylines[b])&&(t.segmentPolylines[b].show=!1)}else for(let m=0;m<t.segmentPolylines.length;m++)t.segmentPolylines[m].show=!1;c.width=X.getValueOrDefault(i._width,e,gve),c.distanceDisplayCondition=X.getValueOrUndefined(i._distanceDisplayCondition,e,c.distanceDisplayCondition)};wR.prototype.removeObject=function(e){let t=e.polyline;l(t)&&(this._unusedIndexes.push(e.index),e.polyline=void 0,t.show=!1,t.id=void 0,e.index=void 0);for(let n=0;n<e.segmentPolylines.length;n++)e.segmentPolylines[n].show=!1;e.segmentPolylines.length=0};wR.prototype.destroy=function(){return this._scene.primitives.remove(this._polylineCollection),le(this)};function jp(e,t){t.collectionChanged.addEventListener(jp.prototype._onCollectionChanged,this),this._scene=e,this._updaters={},this._entityCollection=t,this._items=new zt,this._onCollectionChanged(t,t.values,[],[])}jp.prototype.update=function(e){let t=this._updaters;for(let i in t)t.hasOwnProperty(i)&&t[i].update(e);let n=this._items.values;if(n.length===0&&l(this._updaters)&&Object.keys(this._updaters).length>0){for(let i in t)t.hasOwnProperty(i)&&t[i].destroy();this._updaters={}}for(let i=0,r=n.length;i<r;i++){let o=n[i],s=o.entity,a=s._position,c=s._path,u=o.updater,f=!1,d=Wi.FIXED,p=d.toString();if(this._scene.mode===re.SCENE3D){let m=X.getValueOrUndefined(c.relativeTo,e);l(m)?m==="FIXED"?(d=Wi.FIXED,p=d.toString()):m==="INERTIAL"?(d=Wi.INERTIAL,p=d.toString()):(f=!0,d=this._entityCollection.getById(m),p=m):(d=a.referenceFrame,p=d.toString())}let g=this._updaters[p];if(u===g&&l(g)){g.updateObject(e,o);continue}l(u)&&u.removeObject(o),!(f&&!l(d))&&(l(g)||(g=new wR(this._scene,d),g.update(e),this._updaters[p]=g),o.updater=g,l(g)&&g.updateObject(e,o))}return!0};jp.prototype.isDestroyed=function(){return!1};jp.prototype.destroy=function(){this._entityCollection.collectionChanged.removeEventListener(jp.prototype._onCollectionChanged,this);let e=this._updaters;for(let t in e)e.hasOwnProperty(t)&&e[t].destroy();return le(this)};jp.prototype._onCollectionChanged=function(e,t,n,i){let r,o,s,a=this._items;for(r=t.length-1;r>-1;r--)o=t[r],l(o._path)&&l(o._position)&&a.set(o.id,new fve(o));for(r=i.length-1;r>-1;r--)o=i[r],l(o._path)&&l(o._position)?a.contains(o.id)||a.set(o.id,new fve(o)):(s=a.get(o.id),l(s)&&(l(s.updater)&&s.updater.removeObject(s),a.remove(o.id)));for(r=n.length-1;r>-1;r--)o=n[r],s=a.get(o.id),l(s)&&(l(s.updater)&&s.updater.removeObject(s),a.remove(o.id))};jp._subSample=Wee;jp._computeVvlhTransform=Gee;jp._transformToEntityFrame=SR;var bj=jp;var Ave=z.WHITE,bve=z.BLACK,xve=0,Tve=1,Eve=0,Cve=Wo.NONE,vve=new z,zbt=new h,Sve=new z,wve=new qt,Ive=new qt,Pve=new Gt;function Dve(e){this.entity=e,this.pointPrimitive=void 0,this.billboard=void 0,this.color=void 0,this.outlineColor=void 0,this.pixelSize=void 0,this.outlineWidth=void 0}function _A(e,t){t.collectionChanged.addEventListener(_A.prototype._onCollectionChanged,this),this._cluster=e,this._entityCollection=t,this._items=new zt,this._onCollectionChanged(t,t.values,[],[])}_A.prototype.update=function(e){let t=this._items.values,n=this._cluster;for(let i=0,r=t.length;i<r;i++){let o=t[i],s=o.entity,a=s._point,c=o.pointPrimitive,u=o.billboard,f=X.getValueOrDefault(a._heightReference,e,We.NONE),d=s.isShowing&&s.isAvailable(e)&&X.getValueOrDefault(a._show,e,!0),p;if(d&&(p=X.getValueOrUndefined(s._position,e,zbt),d=l(p)),!d){IR(o,s,n);continue}X.isConstant(s._position)||(n._clusterDirty=!0);let g=!1,m=!1;if(f!==We.NONE&&!l(u)?(l(c)&&(IR(o,s,n),c=void 0),u=n.getBillboard(s),u.id=s,u.image=void 0,o.billboard=u,g=!0,m=h.equals(u.position,p)&&u.heightReference===f):f===We.NONE&&!l(c)&&(l(u)&&(IR(o,s,n),u=void 0),c=n.getPoint(s),c.id=s,o.pointPrimitive=c),l(c))c.show=!0,c.position=p,c.scaleByDistance=X.getValueOrUndefined(a._scaleByDistance,e,wve),c.translucencyByDistance=X.getValueOrUndefined(a._translucencyByDistance,e,Ive),c.color=X.getValueOrDefault(a._color,e,Ave,vve),c.outlineColor=X.getValueOrDefault(a._outlineColor,e,bve,Sve),c.outlineWidth=X.getValueOrDefault(a._outlineWidth,e,xve),c.pixelSize=X.getValueOrDefault(a._pixelSize,e,Tve),c.distanceDisplayCondition=X.getValueOrUndefined(a._distanceDisplayCondition,e,Pve),c.disableDepthTestDistance=X.getValueOrDefault(a._disableDepthTestDistance,e,Eve),c.splitDirection=X.getValueOrDefault(a._splitDirection,e,Cve);else if(l(u)){u.show=!0,u.position=p,u.scaleByDistance=X.getValueOrUndefined(a._scaleByDistance,e,wve),u.translucencyByDistance=X.getValueOrUndefined(a._translucencyByDistance,e,Ive),u.distanceDisplayCondition=X.getValueOrUndefined(a._distanceDisplayCondition,e,Pve),u.disableDepthTestDistance=X.getValueOrDefault(a._disableDepthTestDistance,e,Eve),u.splitDirection=X.getValueOrDefault(a._splitDirection,e,Cve),u.heightReference=f;let y=X.getValueOrDefault(a._color,e,Ave,vve),A=X.getValueOrDefault(a._outlineColor,e,bve,Sve),b=Math.round(X.getValueOrDefault(a._outlineWidth,e,xve)),x=Math.max(1,Math.round(X.getValueOrDefault(a._pixelSize,e,Tve)));if(b>0?(u.scale=1,g=g||b!==o.outlineWidth||x!==o.pixelSize||!z.equals(y,o.color)||!z.equals(A,o.outlineColor)):(u.scale=x/50,x=50,g=g||b!==o.outlineWidth||!z.equals(y,o.color)||!z.equals(A,o.outlineColor)),g){o.color=z.clone(y,o.color),o.outlineColor=z.clone(A,o.outlineColor),o.pixelSize=x,o.outlineWidth=b;let T=y.alpha,E=y.toCssColorString(),v=A.toCssColorString(),S=JSON.stringify([E,x,v,b]);u.setImage(S,Dv(T,E,v,b,x))}m&&u._updateClamping()}}return!0};_A.prototype.getBoundingSphere=function(e,t){let n=this._items.get(e.id);if(!l(n)||!(l(n.pointPrimitive)||l(n.billboard)))return Pt.FAILED;if(l(n.pointPrimitive))t.center=h.clone(n.pointPrimitive.position,t.center);else{let i=n.billboard;if(i._clampedToSurface)t.center=h.clone(i._clampedPosition,t.center);else{let r=this._cluster._scene,o=this._items,s=Km(r,n,i.position,[i],()=>o.get(e.id)===n);if(s===void 0)return Pt.PENDING;s===null?t.center=h.clone(i.position,t.center):t.center=H_(i.position,s,i.heightReference,r.ellipsoid??ee.default,t.center)}}return t.radius=0,Pt.DONE};_A.prototype.isDestroyed=function(){return!1};_A.prototype.destroy=function(){this._entityCollection.collectionChanged.removeEventListener(_A.prototype._onCollectionChanged,this);let e=this._entityCollection.values;for(let t=0;t<e.length;t++)this._cluster.removePoint(e[t]);return le(this)};_A.prototype._onCollectionChanged=function(e,t,n,i){let r,o,s=this._items,a=this._cluster;for(r=t.length-1;r>-1;r--)o=t[r],l(o._point)&&l(o._position)&&s.set(o.id,new Dve(o));for(r=i.length-1;r>-1;r--)o=i[r],l(o._point)&&l(o._position)?s.contains(o.id)||s.set(o.id,new Dve(o)):(IR(s.get(o.id),o,a),s.remove(o.id));for(r=n.length-1;r>-1;r--)o=n[r],IR(s.get(o.id),o,a),s.remove(o.id)};function IR(e,t,n){if(l(e)){let i=e.pointPrimitive;if(l(i)){e.pointPrimitive=void 0,n.removePoint(t);return}let r=e.billboard;l(r)&&(e.billboard=void 0,n.removeBillboard(t))}}var xj=_A;var Lve=[];function Vbt(e,t,n,i,r){let o=Lve;o.length=r;let s,a=n.red,c=n.green,u=n.blue,f=n.alpha,d=i.red,p=i.green,g=i.blue,m=i.alpha;if(z.equals(n,i)){for(s=0;s<r;s++)o[s]=z.clone(n);return o}let y=(d-a)/r,A=(p-c)/r,b=(g-u)/r,x=(m-f)/r;for(s=0;s<r;s++)o[s]=new z(a+s*y,c+s*A,u+s*b,f+s*x);return o}function PR(e){e=e??H.EMPTY_OBJECT;let t=e.positions,n=e.colors,i=e.width??1,r=e.colorsPerVertex??!1;this._positions=t,this._colors=n,this._width=i,this._colorsPerVertex=r,this._vertexFormat=Be.clone(e.vertexFormat??Be.DEFAULT),this._arcType=e.arcType??ln.GEODESIC,this._granularity=e.granularity??P.RADIANS_PER_DEGREE,this._ellipsoid=ee.clone(e.ellipsoid??ee.default),this._workerName="createPolylineGeometry";let o=1+t.length*h.packedLength;o+=l(n)?1+n.length*z.packedLength:1,this.packedLength=o+ee.packedLength+Be.packedLength+4}PR.pack=function(e,t,n){n=n??0;let i,r=e._positions,o=r.length;for(t[n++]=o,i=0;i<o;++i,n+=h.packedLength)h.pack(r[i],t,n);let s=e._colors;for(o=l(s)?s.length:0,t[n++]=o,i=0;i<o;++i,n+=z.packedLength)z.pack(s[i],t,n);return ee.pack(e._ellipsoid,t,n),n+=ee.packedLength,Be.pack(e._vertexFormat,t,n),n+=Be.packedLength,t[n++]=e._width,t[n++]=e._colorsPerVertex?1:0,t[n++]=e._arcType,t[n]=e._granularity,t};var Fve=ee.clone(ee.UNIT_SPHERE),Bve=new Be,rT={positions:void 0,colors:void 0,ellipsoid:Fve,vertexFormat:Bve,width:void 0,colorsPerVertex:void 0,arcType:void 0,granularity:void 0};PR.unpack=function(e,t,n){t=t??0;let i,r=e[t++],o=new Array(r);for(i=0;i<r;++i,t+=h.packedLength)o[i]=h.unpack(e,t);r=e[t++];let s=r>0?new Array(r):void 0;for(i=0;i<r;++i,t+=z.packedLength)s[i]=z.unpack(e,t);let a=ee.unpack(e,t,Fve);t+=ee.packedLength;let c=Be.unpack(e,t,Bve);t+=Be.packedLength;let u=e[t++],f=e[t++]===1,d=e[t++],p=e[t];return l(n)?(n._positions=o,n._colors=s,n._ellipsoid=ee.clone(a,n._ellipsoid),n._vertexFormat=Be.clone(c,n._vertexFormat),n._width=u,n._colorsPerVertex=f,n._arcType=d,n._granularity=p,n):(rT.positions=o,rT.colors=s,rT.width=u,rT.colorsPerVertex=f,rT.arcType=d,rT.granularity=p,new PR(rT))};var Rve=new h,Ove=new h,Mve=new h,Nve=new h;PR.createGeometry=function(e){let t=e._width,n=e._vertexFormat,i=e._colors,r=e._colorsPerVertex,o=e._arcType,s=e._granularity,a=e._ellipsoid,c,u,f,d=[],p=Lr(e._positions,h.equalsEpsilon,!1,d);if(l(i)&&d.length>0){let N=0,F=d[0];i=i.filter(function(V,B){let j;return r?j=B===F||B===0&&F===1:j=B+1===F,j?(N++,F=d[N],!1):!0})}let g=p.length;if(g<2||t<=0)return;if(o===ln.GEODESIC||o===ln.RHUMB){let N,F;o===ln.GEODESIC?(N=P.chordLength(s,a.maximumRadius),F=lr.numberOfPoints):(N=s,F=lr.numberOfPointsRhumbLine);let V=lr.extractHeights(p,a);if(l(i)){let B=1;for(c=0;c<g-1;++c)B+=F(p[c],p[c+1],N);let j=new Array(B),k=0;for(c=0;c<g-1;++c){let G=p[c],q=p[c+1],Q=i[c],W=F(G,q,N);if(r&&c<B){let J=i[c+1],Z=Vbt(G,q,Q,J,W),ae=Z.length;for(u=0;u<ae;++u)j[k++]=Z[u]}else for(u=0;u<W;++u)j[k++]=z.clone(Q)}j[k]=z.clone(i[i.length-1]),i=j,Lve.length=0}o===ln.GEODESIC?p=lr.generateCartesianArc({positions:p,minDistance:N,ellipsoid:a,height:V}):p=lr.generateCartesianRhumbArc({positions:p,granularity:N,ellipsoid:a,height:V})}g=p.length;let m=g*4-4,y=new Float64Array(m*3),A=new Float64Array(m*3),b=new Float64Array(m*3),x=new Float32Array(m*2),T=n.st?new Float32Array(m*2):void 0,E=l(i)?new Uint8Array(m*4):void 0,v=0,S=0,I=0,R=0,O;for(u=0;u<g;++u){u===0?(O=Rve,h.subtract(p[0],p[1],O),h.add(p[0],O,O)):O=p[u-1],h.clone(O,Mve),h.clone(p[u],Ove),u===g-1?(O=Rve,h.subtract(p[g-1],p[g-2],O),h.add(p[g-1],O,O)):O=p[u+1],h.clone(O,Nve);let N,F;l(E)&&(u!==0&&!r?N=i[u-1]:N=i[u],u!==g-1&&(F=i[u]));let V=u===0?2:0,B=u===g-1?2:4;for(f=V;f<B;++f){h.pack(Ove,y,v),h.pack(Mve,A,v),h.pack(Nve,b,v),v+=3;let j=f-2<0?-1:1;if(x[S++]=2*(f%2)-1,x[S++]=j*t,n.st&&(T[I++]=u/(g-1),T[I++]=Math.max(x[S-2],0)),l(E)){let k=f<2?N:F;E[R++]=z.floatToByte(k.red),E[R++]=z.floatToByte(k.green),E[R++]=z.floatToByte(k.blue),E[R++]=z.floatToByte(k.alpha)}}}let L=new En;L.position=new Ne({componentDatatype:Y.DOUBLE,componentsPerAttribute:3,values:y}),L.prevPosition=new Ne({componentDatatype:Y.DOUBLE,componentsPerAttribute:3,values:A}),L.nextPosition=new Ne({componentDatatype:Y.DOUBLE,componentsPerAttribute:3,values:b}),L.expandAndWidth=new Ne({componentDatatype:Y.FLOAT,componentsPerAttribute:2,values:x}),n.st&&(L.st=new Ne({componentDatatype:Y.FLOAT,componentsPerAttribute:2,values:T})),l(E)&&(L.color=new Ne({componentDatatype:Y.UNSIGNED_BYTE,componentsPerAttribute:4,values:E,normalize:!0}));let _=je.createTypedArray(m,g*6-6),C=0,w=0,D=g-1;for(u=0;u<D;++u)_[w++]=C,_[w++]=C+2,_[w++]=C+1,_[w++]=C+1,_[w++]=C+2,_[w++]=C+3,C+=4;return new wt({attributes:L,indices:_,primitiveType:Oe.TRIANGLES,boundingSphere:ue.fromPoints(p),geometryType:mh.POLYLINES})};var yA=PR;var jbt=new hi(0),Tj={},kve=new z,Hbt=new Kt(z.WHITE),Gbt=new hi(!0),Wbt=new hi(Dn.DISABLED),qbt=new hi(new Gt),Ybt=new hi(ei.BOTH);function Xbt(){this.vertexFormat=void 0,this.positions=void 0,this.width=void 0,this.arcType=void 0,this.granularity=void 0}function Kbt(){this.positions=void 0,this.width=void 0,this.arcType=void 0,this.granularity=void 0}function im(e,t){this._entity=e,this._scene=t,this._entitySubscription=e.definitionChanged.addEventListener(im.prototype._onEntityPropertyChanged,this),this._fillEnabled=!1,this._dynamic=!1,this._geometryChanged=new be,this._showProperty=void 0,this._materialProperty=void 0,this._shadowsProperty=void 0,this._distanceDisplayConditionProperty=void 0,this._classificationTypeProperty=void 0,this._depthFailMaterialProperty=void 0,this._geometryOptions=new Xbt,this._groundGeometryOptions=new Kbt,this._id=`polyline-${e.id}`,this._clampToGround=!1,this._supportsPolylinesOnTerrain=Qr.supportsPolylinesOnTerrain(t),this._zIndex=0,this._onEntityPropertyChanged(e,"polyline",e.polyline,void 0)}Object.defineProperties(im.prototype,{id:{get:function(){return this._id}},entity:{get:function(){return this._entity}},fillEnabled:{get:function(){return this._fillEnabled}},hasConstantFill:{get:function(){return!this._fillEnabled||!l(this._entity.availability)&&X.isConstant(this._showProperty)}},fillMaterialProperty:{get:function(){return this._materialProperty}},depthFailMaterialProperty:{get:function(){return this._depthFailMaterialProperty}},outlineEnabled:{value:!1},hasConstantOutline:{value:!0},outlineColorProperty:{value:void 0},shadowsProperty:{get:function(){return this._shadowsProperty}},distanceDisplayConditionProperty:{get:function(){return this._distanceDisplayConditionProperty}},classificationTypeProperty:{get:function(){return this._classificationTypeProperty}},isDynamic:{get:function(){return this._dynamic}},isClosed:{value:!1},geometryChanged:{get:function(){return this._geometryChanged}},arcType:{get:function(){return this._arcType}},clampToGround:{get:function(){return this._clampToGround&&this._supportsPolylinesOnTerrain}},zIndex:{get:function(){return this._zIndex}}});im.prototype.isOutlineVisible=function(e){return!1};im.prototype.isFilled=function(e){let t=this._entity;return(this._fillEnabled&&t.isAvailable(e)&&this._showProperty.getValue(e))??!1};im.prototype.createFillGeometryInstance=function(e){let t=this._entity,n=t.isAvailable(e),i=new Pn(n&&t.isShowing&&this._showProperty.getValue(e)),r=this._distanceDisplayConditionProperty.getValue(e),o=Qn.fromDistanceDisplayCondition(r),s={show:i,distanceDisplayCondition:o},a;return this._materialProperty instanceof Kt&&(l(this._materialProperty.color)&&(this._materialProperty.color.isConstant||n)&&(a=this._materialProperty.color.getValue(e,kve)),l(a)||(a=z.WHITE),s.color=Jt.fromColor(a)),this.clampToGround?new Bt({id:t,geometry:new sC(this._groundGeometryOptions),attributes:s}):(l(this._depthFailMaterialProperty)&&this._depthFailMaterialProperty instanceof Kt&&(l(this._depthFailMaterialProperty.color)&&(this._depthFailMaterialProperty.color.isConstant||n)&&(a=this._depthFailMaterialProperty.color.getValue(e,kve)),l(a)||(a=z.WHITE),s.depthFailColor=Jt.fromColor(a)),new Bt({id:t,geometry:new yA(this._geometryOptions),attributes:s}))};im.prototype.createOutlineGeometryInstance=function(e){};im.prototype.isDestroyed=function(){return!1};im.prototype.destroy=function(){this._entitySubscription(),le(this)};im.prototype._onEntityPropertyChanged=function(e,t,n,i){if(!(t==="availability"||t==="polyline"))return;let r=this._entity.polyline;if(!l(r)){this._fillEnabled&&(this._fillEnabled=!1,this._geometryChanged.raiseEvent(this));return}let o=r.positions,s=r.show;if(l(s)&&s.isConstant&&!s.getValue(nt.MINIMUM_VALUE)||!l(o)){this._fillEnabled&&(this._fillEnabled=!1,this._geometryChanged.raiseEvent(this));return}let a=r.zIndex,c=r.material??Hbt,u=c instanceof Kt;this._materialProperty=c,this._depthFailMaterialProperty=r.depthFailMaterial,this._showProperty=s??Gbt,this._shadowsProperty=r.shadows??Wbt,this._distanceDisplayConditionProperty=r.distanceDisplayCondition??qbt,this._classificationTypeProperty=r.classificationType??Ybt,this._fillEnabled=!0,this._zIndex=a??jbt;let f=r.width,d=r.arcType,p=r.clampToGround,g=r.granularity;if(!o.isConstant||!X.isConstant(f)||!X.isConstant(d)||!X.isConstant(g)||!X.isConstant(p)||!X.isConstant(a))this._dynamic||(this._dynamic=!0,this._geometryChanged.raiseEvent(this));else{let m=this._geometryOptions,y=o.getValue(nt.MINIMUM_VALUE,m.positions);if(!l(y)||y.length<2){this._fillEnabled&&(this._fillEnabled=!1,this._geometryChanged.raiseEvent(this));return}let A;u&&(!l(this._depthFailMaterialProperty)||this._depthFailMaterialProperty instanceof Kt)?A=Ys.VERTEX_FORMAT:A=Ac.VERTEX_FORMAT,m.vertexFormat=A,m.positions=y,m.width=l(f)?f.getValue(nt.MINIMUM_VALUE):void 0,m.arcType=l(d)?d.getValue(nt.MINIMUM_VALUE):void 0,m.granularity=l(g)?g.getValue(nt.MINIMUM_VALUE):void 0;let b=this._groundGeometryOptions;b.positions=y,b.width=m.width,b.arcType=m.arcType,b.granularity=m.granularity,this._clampToGround=l(p)?p.getValue(nt.MINIMUM_VALUE):!1,!this._clampToGround&&l(a)&&yt("Entity polylines must have clampToGround: true when using zIndex. zIndex will be ignored."),this._dynamic=!1,this._geometryChanged.raiseEvent(this)}};im.prototype.createDynamicUpdater=function(e,t){return new DR(e,t,this)};var WS={positions:void 0,granularity:void 0,height:void 0,ellipsoid:void 0};function DR(e,t,n){this._line=void 0,this._primitives=e,this._groundPrimitives=t,this._groundPolylinePrimitive=void 0,this._material=void 0,this._geometryUpdater=n,this._positions=[]}function Uve(e){if(l(e._line))return e._line;let t=e._primitives,n=e._geometryUpdater._scene.id+t._guid,i=Tj[n];!l(i)||i.isDestroyed()?(i=new Sp,Tj[n]=i,t.add(i)):t.contains(i)||t.add(i);let r=i.add();return r.id=e._geometryUpdater._entity,e._line=r,r}DR.prototype.update=function(e){let t=this._geometryUpdater,n=t._entity,i=n.polyline,r=i.positions,o=X.getValueOrUndefined(r,e,this._positions);t._clampToGround=X.getValueOrDefault(i._clampToGround,e,!1),t._groundGeometryOptions.positions=o,t._groundGeometryOptions.width=X.getValueOrDefault(i._width,e,1),t._groundGeometryOptions.arcType=X.getValueOrDefault(i._arcType,e,ln.GEODESIC),t._groundGeometryOptions.granularity=X.getValueOrDefault(i._granularity,e,9999);let s=this._groundPrimitives;if(l(this._groundPolylinePrimitive)&&(s.remove(this._groundPolylinePrimitive),this._groundPolylinePrimitive=void 0),t.clampToGround){if(!n.isShowing||!n.isAvailable(e)||!X.getValueOrDefault(i._show,e,!0)||!l(o)||o.length<2)return;let d=t.fillMaterialProperty,p;if(d instanceof Kt)p=new Ys;else{let g=Co.getValue(e,d,this._material);p=new Ac({material:g,translucent:g.isTranslucent()}),this._material=g}this._groundPolylinePrimitive=s.add(new Qm({geometryInstances:t.createFillGeometryInstance(e),appearance:p,classificationType:t.classificationTypeProperty.getValue(e),asynchronous:!1}),X.getValueOrUndefined(t.zIndex,e)),l(this._line)&&(this._line.show=!1);return}let a=Uve(this);if(!n.isShowing||!n.isAvailable(e)||!X.getValueOrDefault(i._show,e,!0)){a.show=!1;return}if(!l(o)||o.length<2){a.show=!1;return}let c=ln.GEODESIC;c=X.getValueOrDefault(i._arcType,e,c);let u=t._scene.globe,f=t._scene.ellipsoid;c!==ln.NONE&&l(u)&&(WS.ellipsoid=f,WS.positions=o,WS.granularity=X.getValueOrUndefined(i._granularity,e),WS.height=lr.extractHeights(o,f),c===ln.GEODESIC?o=lr.generateCartesianArc(WS):o=lr.generateCartesianRhumbArc(WS)),a.show=!0,a.positions=o.slice(),a.material=Co.getValue(e,t.fillMaterialProperty,a.material),a.width=X.getValueOrDefault(i._width,e,1),a.distanceDisplayCondition=X.getValueOrUndefined(i._distanceDisplayCondition,e,a.distanceDisplayCondition)};DR.prototype.getBoundingSphere=function(e){if(this._geometryUpdater.clampToGround){let t=this._groundPolylinePrimitive;if(l(t)&&t.show&&t.ready){let n=t.getGeometryInstanceAttributes(this._geometryUpdater._entity);if(l(n)&&l(n.boundingSphere))return ue.clone(n.boundingSphere,e),Pt.DONE}return l(t)&&!t.ready?Pt.PENDING:Pt.DONE}else{let t=Uve(this);if(t.show&&t.positions.length>0)return ue.fromPoints(t.positions,e),Pt.DONE}return Pt.FAILED};DR.prototype.isDestroyed=function(){return!1};DR.prototype.destroy=function(){let t=this._geometryUpdater._scene.id+this._primitives._guid,n=Tj[t];l(n)&&(n.remove(this._line),n.length===0&&(this._primitives.removeAndDestroy(n),delete Tj[t])),l(this._groundPolylinePrimitive)&&this._groundPrimitives.remove(this._groundPolylinePrimitive),le(this)};var Ej=im;var $bt=new z,Jbt=new Gt,Zbt=new Gt;function rm(e,t,n,i,r){let o;n instanceof Kt?o=Ys:o=Ac,this.orderedGroundPrimitives=e,this.classificationType=t,this.appearanceType=o,this.materialProperty=n,this.updaters=new zt,this.createPrimitive=!0,this.primitive=void 0,this.oldPrimitive=void 0,this.geometry=new zt,this.material=void 0,this.updatersWithAttributes=new zt,this.attributes=new zt,this.invalidated=!1,this.removeMaterialSubscription=n.definitionChanged.addEventListener(rm.prototype.onMaterialChanged,this),this.subscriptions=new zt,this.showsUpdated=new zt,this.zIndex=i,this._asynchronous=r}rm.prototype.onMaterialChanged=function(){this.invalidated=!0};rm.prototype.isMaterial=function(e){let t=this.materialProperty,n=e.fillMaterialProperty;return n===t||n instanceof Kt&&t instanceof Kt?!0:l(t)&&t.equals(n)};rm.prototype.add=function(e,t,n){let i=t.id;if(this.updaters.set(i,t),this.geometry.set(i,n),!t.hasConstantFill||!t.fillMaterialProperty.isConstant||!X.isConstant(t.distanceDisplayConditionProperty))this.updatersWithAttributes.set(i,t);else{let r=this;this.subscriptions.set(i,t.entity.definitionChanged.addEventListener(function(o,s,a,c){s==="isShowing"&&r.showsUpdated.set(t.id,t)}))}this.createPrimitive=!0};rm.prototype.remove=function(e){let t=e.id;if(this.createPrimitive=this.geometry.remove(t)||this.createPrimitive,this.updaters.remove(t)){this.updatersWithAttributes.remove(t);let n=this.subscriptions.get(t);return l(n)&&(n(),this.subscriptions.remove(t),this.showsUpdated.remove(t)),!0}return!1};rm.prototype.update=function(e){let t=!0,n=this.primitive,i=this.orderedGroundPrimitives,r=this.geometry.values,o;if(this.createPrimitive){if(r.length>0){l(n)&&(l(this.oldPrimitive)?i.remove(n):this.oldPrimitive=n);let a=this.appearanceType;n=new Qm({show:!1,asynchronous:this._asynchronous,geometryInstances:r.slice(),appearance:new a,classificationType:this.classificationType}),this.appearanceType===Ac&&(this.material=Co.getValue(e,this.materialProperty,this.material),n.appearance.material=this.material),i.add(n,this.zIndex),t=!1}else{l(n)&&(i.remove(n),n=void 0);let a=this.oldPrimitive;l(a)&&(i.remove(a),this.oldPrimitive=void 0)}this.attributes.removeAll(),this.primitive=n,this.createPrimitive=!1}else if(l(n)&&n.ready){n.show=!0,l(this.oldPrimitive)&&(i.remove(this.oldPrimitive),this.oldPrimitive=void 0),this.appearanceType===Ac&&(this.material=Co.getValue(e,this.materialProperty,this.material),this.primitive.appearance.material=this.material);let s=this.updatersWithAttributes.values,a=s.length;for(o=0;o<a;o++){let c=s[o],u=c.entity,f=this.geometry.get(c.id),d=this.attributes.get(f.id.id);if(l(d)||(d=n.getGeometryInstanceAttributes(f.id),this.attributes.set(f.id.id,d)),!c.fillMaterialProperty.isConstant){let y=c.fillMaterialProperty.color,A=X.getValueOrDefault(y,e,z.WHITE,$bt);z.equals(d._lastColor,A)||(d._lastColor=z.clone(A,d._lastColor),d.color=Jt.toValue(A,d.color))}let p=u.isShowing&&(c.hasConstantFill||c.isFilled(e)),g=d.show[0]===1;p!==g&&(d.show=Pn.toValue(p,d.show));let m=c.distanceDisplayConditionProperty;if(!X.isConstant(m)){let y=X.getValueOrDefault(m,e,Zbt,Jbt);Gt.equals(y,d._lastDistanceDisplayCondition)||(d._lastDistanceDisplayCondition=Gt.clone(y,d._lastDistanceDisplayCondition),d.distanceDisplayCondition=Qn.toValue(y,d.distanceDisplayCondition))}}this.updateShows(n)}else l(n)&&!n.ready&&(t=!1);return t};rm.prototype.updateShows=function(e){let t=this.showsUpdated.values,n=t.length;for(let i=0;i<n;i++){let r=t[i],o=r.entity,s=this.geometry.get(r.id),a=this.attributes.get(s.id.id);l(a)||(a=e.getGeometryInstanceAttributes(s.id),this.attributes.set(s.id.id,a));let c=o.isShowing,u=a.show[0]===1;c!==u&&(a.show=Pn.toValue(c,a.show),s.attributes.show.value[0]=a.show[0])}this.showsUpdated.removeAll()};rm.prototype.contains=function(e){return this.updaters.contains(e.id)};rm.prototype.getBoundingSphere=function(e,t){let n=this.primitive;if(!n.ready)return Pt.PENDING;let i=n.getGeometryInstanceAttributes(e.entity);return!l(i)||!l(i.boundingSphere)||l(i.show)&&i.show[0]===0?Pt.FAILED:(i.boundingSphere.clone(t),Pt.DONE)};rm.prototype.destroy=function(){let e=this.primitive,t=this.orderedGroundPrimitives;l(e)&&t.remove(e);let n=this.oldPrimitive;l(n)&&t.remove(n),this.removeMaterialSubscription()};function qS(e,t,n){this._items=[],this._orderedGroundPrimitives=e,this._classificationType=t,this._asynchronous=n??!0}qS.prototype.add=function(e,t){let n=this._items,i=n.length,r=t.createFillGeometryInstance(e),o=X.getValueOrDefault(t.zIndex,0);for(let a=0;a<i;++a){let c=n[a];if(c.isMaterial(t)&&c.zIndex===o){c.add(e,t,r);return}}let s=new rm(this._orderedGroundPrimitives,this._classificationType,t.fillMaterialProperty,o,this._asynchronous);s.add(e,t,r),n.push(s)};qS.prototype.remove=function(e){let t=this._items,n=t.length;for(let i=n-1;i>=0;i--){let r=t[i];if(r.remove(e)){r.updaters.length===0&&(t.splice(i,1),r.destroy());break}}};qS.prototype.update=function(e){let t,n=this._items,i=n.length;for(t=i-1;t>=0;t--){let o=n[t];if(o.invalidated){n.splice(t,1);let s=o.updaters.values,a=s.length;for(let c=0;c<a;c++)this.add(e,s[c]);o.destroy()}}let r=!0;for(t=0;t<n.length;t++)r=n[t].update(e)&&r;return r};qS.prototype.getBoundingSphere=function(e,t){let n=this._items,i=n.length;for(let r=0;r<i;r++){let o=n[r];if(o.contains(e))return o.getBoundingSphere(e,t)}return Pt.FAILED};qS.prototype.removeAllPrimitives=function(){let e=this._items,t=e.length;for(let n=0;n<t;n++)e[n].destroy();this._items.length=0};var Cj=qS;var Qbt=[];function zve(e,t){let n=e._batches,i=n.length;for(let r=0;r<i;r++)n[r].remove(t)}function Vve(e,t,n){if(n.isDynamic){e._dynamicBatch.add(t,n);return}if(n.clampToGround&&n.fillEnabled){let s=n.classificationTypeProperty.getValue(t);e._groundBatches[s].add(t,n);return}let i;n.fillEnabled&&(i=n.shadowsProperty.getValue(t));let r=0;l(n.depthFailMaterialProperty)&&(r=n.depthFailMaterialProperty instanceof Kt?1:2);let o;l(i)&&(o=i+r*Dn.NUMBER_OF_SHADOW_MODES),n.fillEnabled&&(n.fillMaterialProperty instanceof Kt?e._colorBatches[o].add(t,n):e._materialBatches[o].add(t,n))}function Hp(e,t,n,i){i=i??e.groundPrimitives,n=n??e.primitives,this._scene=e,this._primitives=n,this._entityCollection=void 0,this._addedObjects=new zt,this._removedObjects=new zt,this._changedObjects=new zt;let r,o=Dn.NUMBER_OF_SHADOW_MODES;for(this._colorBatches=new Array(o*3),this._materialBatches=new Array(o*3),r=0;r<o;++r)this._colorBatches[r]=new em(n,Ys,void 0,!1,r),this._materialBatches[r]=new nm(n,Ac,void 0,!1,r),this._colorBatches[r+o]=new em(n,Ys,Ys,!1,r),this._materialBatches[r+o]=new nm(n,Ac,Ys,!1,r),this._colorBatches[r+o*2]=new em(n,Ys,Ac,!1,r),this._materialBatches[r+o*2]=new nm(n,Ac,Ac,!1,r);this._dynamicBatch=new bS(n,i);let s=ei.NUMBER_OF_CLASSIFICATION_TYPES;for(this._groundBatches=new Array(s),r=0;r<s;++r)this._groundBatches[r]=new Cj(i,r);this._batches=this._colorBatches.concat(this._materialBatches,this._dynamicBatch,this._groundBatches),this._subscriptions=new zt,this._updaters=new zt,this._entityCollection=t,t.collectionChanged.addEventListener(Hp.prototype._onCollectionChanged,this),this._onCollectionChanged(t,t.values,Qbt)}Hp.prototype.update=function(e){let t=this._addedObjects,n=t.values,i=this._removedObjects,r=i.values,o=this._changedObjects,s=o.values,a,c,u,f;for(a=s.length-1;a>-1;a--)c=s[a],u=c.id,f=this._updaters.get(u),f.entity===c?(zve(this,f),Vve(this,e,f)):(r.push(c),n.push(c));for(a=r.length-1;a>-1;a--)c=r[a],u=c.id,f=this._updaters.get(u),zve(this,f),f.destroy(),this._updaters.remove(u),this._subscriptions.get(u)(),this._subscriptions.remove(u);for(a=n.length-1;a>-1;a--)c=n[a],u=c.id,f=new Ej(c,this._scene),this._updaters.set(u,f),Vve(this,e,f),this._subscriptions.set(u,f.geometryChanged.addEventListener(Hp._onGeometryChanged,this));t.removeAll(),i.removeAll(),o.removeAll();let d=!0,p=this._batches,g=p.length;for(a=0;a<g;a++)d=p[a].update(e)&&d;return d};var ext=[],txt=new ue;Hp.prototype.getBoundingSphere=function(e,t){let n=ext,i=txt,r=0,o,s=this._batches,a=s.length,c=this._updaters.get(e.id);for(let u=0;u<a;u++){if(o=s[u].getBoundingSphere(c,i),o===Pt.PENDING)return Pt.PENDING;o===Pt.DONE&&(n[r]=ue.clone(i,n[r]),r++)}return r===0?Pt.FAILED:(n.length=r,ue.fromBoundingSpheres(n,t),Pt.DONE)};Hp.prototype.isDestroyed=function(){return!1};Hp.prototype.destroy=function(){this._entityCollection.collectionChanged.removeEventListener(Hp.prototype._onCollectionChanged,this),this._addedObjects.removeAll(),this._removedObjects.removeAll();let e,t=this._batches,n=t.length;for(e=0;e<n;e++)t[e].removeAllPrimitives();let i=this._subscriptions.values;for(n=i.length,e=0;e<n;e++)i[e]();return this._subscriptions.removeAll(),le(this)};Hp._onGeometryChanged=function(e){let t=this._removedObjects,n=this._changedObjects,i=e.entity,r=i.id;!l(t.get(r))&&!l(n.get(r))&&n.set(r,i)};Hp.prototype._onCollectionChanged=function(e,t,n){let i=this._addedObjects,r=this._removedObjects,o=this._changedObjects,s,a,c;for(s=n.length-1;s>-1;s--)c=n[s],a=c.id,i.remove(a)||(r.set(a,c),o.remove(a));for(s=t.length-1;s>-1;s--)c=t[s],a=c.id,r.remove(a)?o.set(a,c):i.set(a,c)};var vj=Hp;function ku(e){pu.initializeTerrainHeights(),Qm.initializeTerrainHeights();let t=e.scene,n=e.dataSourceCollection;this._eventHelper=new Qo,this._eventHelper.add(n.dataSourceAdded,this._onDataSourceAdded,this),this._eventHelper.add(n.dataSourceRemoved,this._onDataSourceRemoved,this),this._eventHelper.add(n.dataSourceMoved,this._onDataSourceMoved,this),this._eventHelper.add(t.postRender,this._postRender,this),this._dataSourceCollection=n,this._scene=t,this._visualizersCallback=e.visualizersCallback??ku.defaultVisualizersCallback;let i=!1,r=new ql,o=new ql;n.length>0&&(t.primitives.add(r),t.groundPrimitives.add(o),i=!0),this._primitives=r,this._groundPrimitives=o;for(let u=0,f=n.length;u<f;u++)this._onDataSourceAdded(n,n.get(u));let s=new g8;this._onDataSourceAdded(void 0,s),this._defaultDataSource=s;let a,c;if(!i){let u=this,f=function(){t.primitives.add(r),t.groundPrimitives.add(o),a(),c(),u._removeDefaultDataSourceListener=void 0,u._removeDataSourceCollectionListener=void 0};a=s.entities.collectionChanged.addEventListener(f),c=n.dataSourceAdded.addEventListener(f)}this._removeDefaultDataSourceListener=a,this._removeDataSourceCollectionListener=c,this._ready=!1}var YS=[];ku.registerVisualizer=function(e){YS.includes(e)||YS.push(e)};ku.unregisterVisualizer=function(e){if(YS.includes(e)){let t=YS.indexOf(e);YS.splice(t,1)}};ku.defaultVisualizersCallback=function(e,t,n){let i=n.entities;return[new sk(t,i),new dj(e,i,n._primitives,n._groundPrimitives),new hj(t,i),new mj(e,i),new n8(e,i),new xj(t,i),new bj(e,i),new vj(e,i,n._primitives,n._groundPrimitives),...YS.map(r=>new r(e,i))]};Object.defineProperties(ku.prototype,{scene:{get:function(){return this._scene}},dataSources:{get:function(){return this._dataSourceCollection}},defaultDataSource:{get:function(){return this._defaultDataSource}},ready:{get:function(){return this._ready}}});ku.prototype.isDestroyed=function(){return!1};ku.prototype.destroy=function(){this._eventHelper.removeAll();let e=this._dataSourceCollection;for(let t=0,n=e.length;t<n;++t)this._onDataSourceRemoved(this._dataSourceCollection,e.get(t));return this._onDataSourceRemoved(void 0,this._defaultDataSource),l(this._removeDefaultDataSourceListener)?(this._removeDefaultDataSourceListener(),this._removeDataSourceCollectionListener()):(this._scene.primitives.remove(this._primitives),this._scene.groundPrimitives.remove(this._groundPrimitives)),le(this)};ku.prototype.update=function(e){if(!Ni.initialized)return this._ready=!1,!1;let t=!0,n,i,r,o,s=this._dataSourceCollection,a=s.length;for(n=0;n<a;n++){let c=s.get(n);for(l(c.update)&&(t=c.update(e)&&t),r=c._visualizers,o=r.length,i=0;i<o;i++)t=r[i].update(e)&&t}for(r=this._defaultDataSource._visualizers,o=r.length,i=0;i<o;i++)t=r[i].update(e)&&t;return!this._ready&&t&&this._scene.requestRender(),this._ready=this._ready||t,t};ku.prototype._postRender=function(){let e=this._scene.frameState,t=this._dataSourceCollection,n=t.length;for(let i=0;i<n;i++){let r=t.get(i),o=r.credit;l(o)&&e.creditDisplay.addCreditToNextFrame(o);let s=r._resourceCredits;if(l(s)){let a=s.length;for(let c=0;c<a;c++)e.creditDisplay.addCreditToNextFrame(s[c])}}};var nxt=[],ixt=new ue;ku.prototype.getBoundingSphere=function(e,t,n){if(!this._ready)return Pt.PENDING;let i,r,o=this._defaultDataSource;if(!o.entities.contains(e)){o=void 0;let p=this._dataSourceCollection;for(r=p.length,i=0;i<r;i++){let g=p.get(i);if(g.entities.contains(e)){o=g;break}}}if(!l(o))return Pt.FAILED;let s=nxt,a=ixt,c=0,u,f=o._visualizers,d=f.length;for(i=0;i<d;i++){let p=f[i];if(l(p.getBoundingSphere)){if(u=f[i].getBoundingSphere(e,a),!t&&u===Pt.PENDING)return Pt.PENDING;u===Pt.DONE&&(s[c]=ue.clone(a,s[c]),c++)}}return c===0?Pt.FAILED:(s.length=c,ue.fromBoundingSpheres(s,n),Pt.DONE)};ku.prototype._onDataSourceAdded=function(e,t){let n=this._scene,i=this._primitives,r=this._groundPrimitives,o=i.add(new ql),s=r.add(new M8);t._primitives=o,t._groundPrimitives=s;let a=t.clustering;a._initialize(n),o.add(a),t._visualizers=this._visualizersCallback(n,a,t)};ku.prototype._onDataSourceRemoved=function(e,t){let n=this._primitives,i=this._groundPrimitives,r=t._primitives,o=t._groundPrimitives,s=t.clustering;r.remove(s);let a=t._visualizers,c=a.length;for(let u=0;u<c;u++)a[u].destroy();n.remove(r),i.remove(o),t._visualizers=void 0};ku.prototype._onDataSourceMoved=function(e,t,n){let i=this._primitives,r=this._groundPrimitives,o=e._primitives,s=e._groundPrimitives;t===n+1?(i.raise(o),r.raise(s)):t===n-1?(i.lower(o),r.lower(s)):t===0?(i.lowerToBottom(o),r.lowerToBottom(s),i.raise(o),r.raise(s)):(i.raiseToTop(o),r.raiseToTop(s))};var Sj=ku;function qee(e,t,n){this.heading=e??0,this.pitch=t??0,this.range=n??0}qee.clone=function(e,t){if(l(e))return l(t)||(t=new qee),t.heading=e.heading,t.pitch=e.pitch,t.range=e.range,t};var om=qee;var jve=new $,Hve=new $,Gve=new $,rxt=new M,wj=new h,Wve=new h,Yee=new h,Xee=new h,qve=new h,Yve=new h,oxt=new Le,sxt=new h,axt=new $,XS=new K,cxt=1.25;function lxt(e,t,n,i,r,o,s,a,c,u){let f=e.scene.mode,d=r.getValue(c,e._lastCartesian);if(l(d)){let p=!1,g=!1,m,y,A;if(f===re.SCENE3D){K.addSeconds(c,.001,XS);let I=r.getValue(XS,wj);if(l(I)||(K.addSeconds(c,-.001,XS),I=r.getValue(XS,wj),g=!0),l(I)){let R=At.computeFixedToIcrfMatrix(c,jve),O=At.computeFixedToIcrfMatrix(XS,Hve),L;!l(R)||!l(O)?(L=At.computeTemeToPseudoFixedMatrix(c,Gve),R=$.transpose(L,jve),O=At.computeTemeToPseudoFixedMatrix(XS,Hve),$.transpose(O,O)):L=$.transpose(R,Gve);let _=$.multiplyByVector(R,d,qve),C=$.multiplyByVector(O,I,Yve);h.subtract(_,C,Xee);let w=h.magnitude(Xee)*1e3,D=P.GRAVITATIONALPARAMETER,N=-D/(w*w-2*D/h.magnitude(_));N<0||N>cxt*u.maximumRadius?(m=Wve,h.normalize(d,m),h.negate(m,m),A=h.clone(h.UNIT_Z,Yee),y=h.cross(A,m,wj),h.magnitude(y)>P.EPSILON7&&(h.normalize(m,m),h.normalize(y,y),A=h.cross(m,y,Yee),h.normalize(A,A),p=!0)):h.equalsEpsilon(d,I,P.EPSILON7)||(A=Wve,h.normalize(_,A),h.normalize(C,C),y=h.cross(A,C,Yee),g&&(y=h.multiplyByScalar(y,-1,y)),h.equalsEpsilon(y,h.ZERO,P.EPSILON7)||(m=h.cross(y,A,wj),$.multiplyByVector(L,m,m),$.multiplyByVector(L,y,y),$.multiplyByVector(L,A,A),h.normalize(m,m),h.normalize(y,y),h.normalize(A,A),p=!0))}}l(e.boundingSphere)&&(d=e.boundingSphere.center);let b,x,T;i&&(b=h.clone(t.position,Xee),x=h.clone(t.direction,qve),T=h.clone(t.up,Yve));let E=rxt,v;l(s)&&(v=s.getValue(c,oxt));let S=o.getValue(c,sxt);if(a===W_.INERTIAL&&l(v))M.fromTranslationQuaternionRotationScale(d,v,h.ONE,E);else if(a===W_.VELOCITY&&l(S)){let I=At.rotationMatrixFromPositionVelocity(d,S,u,axt);M.fromRotationTranslation(I,d,E)}else a===W_.ENU||!p?At.eastNorthUpToFixedFrame(d,u,E):(E[0]=m.x,E[1]=m.y,E[2]=m.z,E[3]=0,E[4]=y.x,E[5]=y.y,E[6]=y.z,E[7]=0,E[8]=A.x,E[9]=A.y,E[10]=A.z,E[11]=0,E[12]=d.x,E[13]=d.y,E[14]=d.z,E[15]=0);t._setTransform(E),i&&(h.clone(b,t.position),h.clone(x,t.direction),h.clone(T,t.up),h.cross(x,T,t.right))}if(n){let p=f===re.SCENE2D||h.equals(e._offset3D,h.ZERO)?void 0:e._offset3D;t.lookAtTransform(t.transform,p)}}function RR(e,t,n){this.entity=e,this.scene=t,this.ellipsoid=n??ee.default,this.boundingSphere=void 0,this._lastEntity=void 0,this._mode=void 0,this._lastCartesian=new h,this._defaultOffset3D=void 0,this._velocityProperty=new lA(e.position,!0),this._offset3D=new h}Object.defineProperties(RR,{defaultOffset3D:{get:function(){return this._defaultOffset3D},set:function(e){this._defaultOffset3D=h.clone(e,new h)}}});RR.defaultOffset3D=new h(-14e3,3500,3500);var Ij=new om,uxt=new h;RR.prototype.update=function(e,t){let n=this.scene,i=this.ellipsoid,r=n.mode;if(r===re.MORPHING)return;let o=this.entity,s=o.trackingReferenceFrame,a=o.position;if(!l(a))return;let c=this._velocityProperty,u=o.orientation,f=o!==this._lastEntity,d=r!==this._mode,p=n.camera,g=f||d,m=!0;if(f){let y=o.viewFrom,A=l(y);if(!A&&l(t)){Ij.pitch=-P.PI_OVER_FOUR,Ij.range=0;let b=a.getValue(e,uxt);if(l(b)){let x=2-1/Math.max(1,h.magnitude(b)/i.maximumRadius);Ij.pitch*=x}p.viewBoundingSphere(t,Ij),this.boundingSphere=t,g=!1,m=!1}else(!A||!l(y.getValue(e,this._offset3D)))&&h.clone(RR._defaultOffset3D,this._offset3D)}else!d&&this._mode!==re.SCENE2D&&h.clone(p.position,this._offset3D);this._lastEntity=o,this._mode=r,lxt(this,p,g,m,a,c,u,s,e,i)};var Pj=RR;Gp();cc();cT();s6();XR();var Cwe={type:"module"},Ate="error",Jxt="messageerror",vwe,yte,Swe,bte=!0;try{bte=typeof structuredClone==Po&&structuredClone(new DOMException("","AbortError")).code!==ke}catch{}Twe(Zxt);function Zxt(e,t){let{baseURI:n,chunkSize:i,workerStartupTimeout:r}=t,{wasmURI:o}=t;if(!e.interface){typeof o==Po&&(o=o());let s;try{s=u6(e.workerURI,n,e)}catch{return gte(e),_te(e,t)}Object.assign(e,{worker:s,workerAlive:!1,terminated:!1,startupError:null,interface:{run:async()=>{try{return await Qxt(e,{chunkSize:i,wasmURI:o,baseURI:n,workerStartupTimeout:r})}catch(a){if(a&&a.workerStartupFailed)return gte(e),wwe(e),l6(e,t);if(a&&a.codecImportFailed){if(e.reader)return wwe(e),l6(e,t);e.onTaskFinished()}throw a}}}})}return e.interface}async function Qxt(e,t){if(!e.worker){let{startupError:g}=e;e.startupError=null;let m=g||new Error(dT);throw m.workerStartupFailed=!0,m}let n,i,r=new Promise((g,m)=>{n=g,i=m});Object.assign(e,{reader:null,writer:null,resolveResult:n,rejectResult:i,result:r});let{readable:o,options:s}=e,{writable:a,closed:c,abortPipe:u}=eTt(e.writable),f;try{f=xte({type:gwe,options:s,config:t,readable:o,writable:a},e)}catch(g){u();try{await c}catch{}throw e.onTaskFinished(),g}f||Object.assign(e,{reader:o.getReader(),writer:a.getWriter()});let{workerStartupTimeout:d}=t;!e.workerAlive&&Number.isFinite(d)&&d>=0&&(e.startupTimeout=setTimeout(()=>tTt(e),d));try{let g=await r;return await p(),await c,g}catch(g){await p(),u();try{await c}catch{}throw g}async function p(){if(!f&&!a.locked)try{await a.getWriter().close()}catch{}}}function eTt(e){let t=new AbortController,{writable:n,readable:i}=new TransformStream,r=i.pipeTo(e,{preventClose:!0,preventAbort:!0,signal:t.signal});return r.catch(()=>{}),{writable:n,closed:r,abortPipe:()=>t.abort()}}function wwe(e){let{reader:t}=e;t&&t.releaseLock(),e.reader=null,e.writer=null}function Tte(e){let{worker:t}=e;if(t)try{t.terminate()}catch{}e.interface=null}function u6(e,t,n,i,r=!0){let{createWorker:o}=n,s,a,c;if(o)s=o();else if(yte===ke||vwe!==e){let u=typeof e==Po;u?a=e(r):a=e;let f=a.startsWith("data:"),d=a.startsWith("blob:");if(f||d){i===ke&&(i=!1),i&&(c=Cwe);try{s=new Worker(a,c)}catch(p){if(d)try{URL.revokeObjectURL(a)}catch{}if(u&&d)return u6(e,t,n,i,!1);if(i)throw p;return u6(e,t,n,!0,!1)}}else{i===ke&&(i=!0),i&&(c=Cwe);try{a=new URL(a,t)}catch{}try{s=new Worker(a,c)}catch(p){if(i)return u6(e,t,n,!1,r);throw p}}vwe=e,yte=a,Swe=c}else s=new Worker(yte,Swe);return s.addEventListener(pwe,u=>{n.workerAlive=!0,Pwe(n),nTt(u,n)}),s.addEventListener(Ate,u=>Iwe(u,n)),s.addEventListener(Jxt,u=>Iwe(u,n)),s}function tTt(e){if(e.startupTimeout=null,e.workerAlive)return;let{rejectResult:t,writer:n}=e;if(Tte(e),e.worker=null,t){let i=new Error(dT);i.workerStartupFailed=!0,t(i),n&&n.releaseLock()}}function Pwe(e){let{startupTimeout:t}=e;t&&(clearTimeout(t),e.startupTimeout=null)}function Iwe(e,t){e.preventDefault&&e.preventDefault(),Pwe(t);let{workerAlive:n,rejectResult:i,writer:r,onTaskFinished:o}=t;Tte(t),n||(t.worker=null);let s=e.error||new Error(e.message||Ate);n||(s=Object.assign(new Error(s.message||Ate),{workerStartupFailed:!0}),t.startupError=s),i&&(i(s),r&&r.releaseLock(),n&&o())}function xte(e,{worker:t,writer:n,transferStreams:i,workerAlive:r}){try{let{value:o,readable:s,writable:a}=e,c=[];if(o&&(e.value=Hj(o),c.push(e.value.buffer)),i&&bte&&r?(s&&c.push(s),a&&c.push(a)):e.readable=e.writable=null,c.length)try{return t.postMessage(e,c),!0}catch{bte=!1,e.readable=e.writable=null,t.postMessage(e)}else t.postMessage(e)}catch(o){throw n&&n.releaseLock(),o}}async function nTt({data:e},t){let{type:n,value:i,messageId:r,result:o,error:s}=e,{reader:a,writer:c,resolveResult:u,rejectResult:f,onTaskFinished:d,generation:p}=t,g=()=>t.generation!=p;try{if(s){let{message:y,stack:A,code:b,name:x,outputSize:T,cause:E,codecImportFailed:v}=s,S=new Error(y);Object.assign(S,{stack:A,code:b,name:x,outputSize:T}),E&&(S.cause=Object.assign(new Error(E.message),{name:E.name})),v&&(S.codecImportFailed=!0),m(S)}else{if(n==_we){let{value:y,done:A}=await a.read();g()||xte({type:dte,value:y,done:A,messageId:r},t)}n==dte&&(await c.ready,await c.write(new Uint8Array(i)),g()||xte({type:ywe,messageId:r},t)),n==Awe&&m(null,o)}}catch(y){g()||(Tte(t),m(y))}function m(y,A){g()||(y?f(y):u(A),c&&c.releaseLock(),y&&y.codecImportFailed||d())}}Hne();cc();Gp();uT();XR();m6();A6();nte();cT();rw();$te();MR();var tie="File already exists",nie="Zip file comment exceeds 64KB",PIe="Invalid zip file comment (must be a Uint8Array)",DIe="File entry comment exceeds 64KB",RIe="Invalid file entry comment (must be a string)",OIe="Invalid date (must be a valid Date instance)",MIe="File entry name exceeds 64KB",iie="Version exceeds 65535",NIe="The strength must equal 1, 2, or 3",LIe="Encryption is not supported in USDZ files",FIe="Encryption is not supported when the 'passThrough' option is set",BIe="Invalid extra field (must be a Map)",kIe="Invalid extra field type (must be integer 0..65535)",UIe="Invalid extra field data (must be a Uint8Array)",K6="Extra field data exceeds 64KB",xEt="Compression method not supported",zIe=-2147483648,VIe=2147483647,AIe=BigInt(0),bIe=BigInt("0x7fffffffffffffff"),$6="Zip64 is not supported (set the 'zip64' option to 'true')",jIe="Undefined uncompressed size",HIe="Undefined compression method";var GIe="Undefined reader",WIe="Zip file not empty",qIe="Invalid uid (must be integer 0..2^32-1)",YIe="Invalid gid (must be integer 0..2^32-1)",XIe="Invalid UNIX mode (must be integer 0..65535)",KIe="Invalid unixExtraFieldType (must be 'infozip' or 'unix')",$Ie="uid/gid must be 0..65535 for unixExtraFieldType 'unix' (use 'infozip' for larger ids)",JIe="Invalid msdosAttributesRaw (must be integer 0..255)",ZIe="Invalid msdosAttributes (must be an object with boolean flags)",QIe="Invalid level (must be integer 0..9)",ePe="Signature data exceeds 64KB",xIe=new Uint8Array([7,0,2,0,65,69,3,0,0]),TEt=4,EEt=9,CEt=67,vEt=1,$ne="infozip",Jne="unix",SEt=9,Gne=0,TIe=[],uO=class{constructor(t,n={}){t=new pw(t);let{availableSize:i=oT,maxSize:r=oT}=t,o=i>0&&i!==oT&&r>0&&r!==oT;Object.assign(this,{writer:t,addSplitZipSignature:o,options:n,fileEntries:new Map,filenames:new Set,offset:n[OR]===ke?t.size||t.writable.size||0:n[OR],initialOffset:n[OR]===ke?0:n[OR]-(t.size||t.writable.size||0),pendingAddFileCalls:new Set,pendingErrors:[],bufferedWrites:0,lastFileEntry:ke})}prependZip(t){return Wne(this,wEt(this,t))}appendZip(t){return Wne(this,this.appendZipEntries(t))}async appendZipEntries(t){let n=this,{pendingAddFileCalls:i,filenames:r,fileEntries:o}=n;for(;i.size;)await Promise.allSettled(Array.from(i));let s,a=new Promise(f=>s=f);i.add(a);let c=[],u;try{t=new Gg(t),await vc(t),(t.size===ke||!t.readUint8Array)&&(t=new zu(await Yp(t.readable)),await vc(t));let{ZipReader:f}=await Promise.resolve().then(()=>(Hne(),pIe)),d=new f(t),p=await d.getEntries();await d.close(),await vc(n.writer);let{directoryOffset:g}=d;p.forEach(({filename:A})=>{if(r.has(A))throw new Error(tie);r.add(A),c.push(A)}),n.writerLocked=!0;let{lockWriter:m}=n;n.lockWriter=new Promise(A=>u=()=>{n.writerLocked=!1,A()}),await m,n.addSplitZipSignature&&(delete n.addSplitZipSignature,await qEt(t)||(await Zp(n.writer,nPe()),n.offset+=4));let y=await YEt(n,t,p,g);p.forEach(A=>{let{version:b,rawLastModDate:x,rawFilename:T,bitFlag:E,encrypted:v,uncompressedSize:S,compressedSize:I,extraFieldZip64:R}=A,{compressionMethod:O,rawExtraField:L}=A,{level:_,languageEncodingFlag:C,dataDescriptor:w}=E;L=tPe(L||dr),A.extraFieldAES&&(O=99);let D=Ji(L),N=!!R&&R.uncompressedSize!==ke,F=!!R&&R.compressedSize!==ke,V=aPe(_,C,w,v,O)&-7|_<<1,{headerArray:B,headerView:j}=sPe({version:b,bitFlag:V,compressionMethod:O,uncompressedSize:S,compressedSize:I,rawLastModDate:x,rawFilename:T,zip64CompressedSize:F,zip64UncompressedSize:N,extraFieldLength:D}),{crc32:k}=A;k!==ke&&Sc(j,10,k);let{offset:G,diskNumberStart:q}=y.get(A);Object.assign(A,{zip64UncompressedSize:N,zip64CompressedSize:F,offset:G,diskNumberStart:q,zip64DiskNumberStart:!1,rawExtraFieldZip64:dr,rawExtraFieldAES:dr,rawExtraFieldExtendedTimestamp:dr,rawExtraFieldNTFS:dr,rawExtraFieldUnix:dr,rawExtraField:L,rawCentralExtraField:dr,extendedTimestamp:!1,headerArray:B,headerView:j}),o.set(A.filename,A)})}catch(f){throw c.forEach(d=>r.delete(d)),f}finally{s(),i.delete(a),u&&u()}}add(t="",n,i={}){let r=this,{pendingAddFileCalls:o}=r,s=IEt(r,t,n,i);o.add(s);let a=()=>o.delete(s);return Promise.prototype.then.call(s,a,a),Wne(r,s)}remove(t){let{filenames:n,fileEntries:i}=this;if(typeof t==sT&&(t=i.get(t)),t&&t.filename!==ke){let{filename:r}=t;if(n.has(r)&&i.has(r))return n.delete(r),i.delete(r),!0}return!1}async close(t=dr,n={}){let i=this,{pendingAddFileCalls:r,writer:o}=this,{writable:s}=o;if(!(t instanceof Uint8Array))throw new Error(PIe);if(Ji(t)>65535)throw new Error(nie);for(;r.size;)await Promise.allSettled(Array.from(r));await Promise.allSettled(i.pendingErrors.map(u=>u.recorded));let a=i.pendingErrors.filter(u=>u.error&&!u.observed);if(a.length){let u=a.map(d=>d.error);a.forEach(d=>d.observed=!0);let[f]=u;try{f.entryErrors=u}catch{}throw f}return await VEt(i,t,n),!y6(o)&&Xi(i,n,Bj)||await s.getWriter().close(),o.getData?o.getData():s}};var Zne=class extends Promise{then(t,n){let{watcher:i}=this;return i&&(i.observed=!0),super.then(t,n)}};function Wne(e,t){let n=new Zne((r,o)=>Promise.prototype.then.call(t,r,o)),i={};return n.watcher=i,i.recorded=Promise.prototype.then.call(n,ke,r=>i.error=r),e.pendingErrors.push(i),n}async function wEt(e,t){if(e.filenames.size)throw new Error(WIe);await e.appendZipEntries(t)}async function IEt(e,t,n,i){if(i=Object.assign({},i),Xi(e,i,mT)&&!t.endsWith("/")&&(t+="/"),e.filenames.has(t))throw new Error(tie);e.filenames.add(t),Gne<Vg().maxWorkers?Gne++:await new Promise(r=>TIe.push(r));try{return await PEt(e,t,n,i)}catch(r){throw e.filenames.delete(t),r}finally{let r=TIe.shift();r?r():Gne--}}async function PEt(e,t,n,i){let r=DEt(e,t,i);({name:t}=r);let o=REt(e,t,i),{comment:s}=o,a=i[C6];e.fileEntries.set(t,ke);let c=e.lastFileEntry,u={},f;o.resolvedOptions.keepOrder&&(u.lockFileEntry=new Promise(p=>f=p)),e.lastFileEntry=u;let d;try{let{resolvedOptions:p}=o;p.level!=0&&p.compressionMethod===ke&&!p.passThrough&&!await Ewe(Vg())&&(p.level=0);let g=await OEt(e,n,o,i);({reader:n}=g);let m=fO(e.writer),y=Yg(e.writer);i=Object.assign({},i,r.resolvedOptions,o.resolvedOptions,g.resolvedOptions,{signature:i[E6],crc32:i.crc32===ke?i[E6]:i.crc32,offset:e.offset-m,diskNumberStart:y,[$S]:e.options[$S]});let A=FEt(i),b=kEt(i),x=Ji(A.localHeaderArray,b.dataDescriptorArray);d=await NEt(e,t,n,{headerInfo:A,dataDescriptorInfo:b,metadataSize:x,fileEntry:u,previousFileEntry:c,releaseLockFileEntry:f},i)}catch(p){throw e.fileEntries.delete(t),p}finally{f&&f(c&&c.lockFileEntry)}return Object.assign(d,{name:t,comment:s,extraField:a,[b6]:d.internalFileAttributes,[x6]:d.externalFileAttributes}),new CA(d)}function DEt(e,t,n){let i=Xi(e,n,Ute),r=Xi(e,n,jte,i?20:768),o=Xi(e,n,Gte),s=Sw(e,n,"uid"),a=Sw(e,n,"gid"),c=Sw(e,n,qte),u=Xi(e,n,xSe),f=Xi(e,n,Yte),d=Xi(e,n,Xte),p=Xi(e,n,Kte);if(ZS(s,4294967295,qIe),ZS(a,4294967295,YIe),ZS(c,65535,XIe),u!==ke&&u!==$ne&&u!==Jne)throw new Error(KIe);if(u===Jne&&(s!==ke&&s>65535||a!==ke&&a>65535))throw new Error($Ie);u===ke&&(s!==ke||a!==ke)&&(u=$ne);let g=Sw(e,n,Bte),m=Xi(e,n,kte),y=s!==ke||a!==ke||c!==ke||u||o,A=g!==ke||m!==ke;if(y?(i=!1,r=r&255|768):A&&(i=!0,r=r&255),ZS(g,255,JIe),m&&(typeof m!==Xve||Array.isArray(m)))throw new Error(ZIe);if(r>65535)throw new Error(iie);let b=oPe(e,n,Fte,x6),x=b!==ke;x||(b=0),!n[mT]&&t.endsWith("/")&&(n[mT]=!0);let T=Xi(e,n,mT);if(T?(t.endsWith("/")||(t+="/"),x||(b=16,i||(b|=16877<<16))):!i&&!x&&(o?b=493<<16:b=420<<16),!i){let S=c!==ke||!!(f||d||p),I=b>>16&65535;c=c===ke?I:c&65535,f?c|=2048:f=!!(c&2048),d?c|=1024:d=!!(c&1024),p?c|=512:p=!!(c&512),(!x||S)&&(T?c=c&-61441|16384:c&61440||(c|=32768),b=(c&65535)<<16|b&65535)}({msdosAttributesRaw:g,msdosAttributes:m}=BEt(g,m)),A&&(b=b&4294967295|g&255);let E=b>>16&65535,v=c!==ke&&(c&61440)==40960;return{name:t,resolvedOptions:{versionMadeBy:r,msDosCompatible:!!i,externalFileAttributes:b,unixExternalUpper:E,uid:s,gid:a,unixMode:c,unixExtraFieldType:u,symlink:v,setuid:f,setgid:d,sticky:p,msdosAttributesRaw:g,msdosAttributes:m}}}function REt(e,t,n){let i=Qne(e,n,bSe)||ew,r=i(t,kj);if(r===ke&&(r=ew(t)),Ji(r)>65535)throw new Error(MIe);let o=n[QR]||"";if(typeof o!=sT)throw new Error(RIe);let s=i(o,Uj);if(s===ke&&(s=ew(o)),Ji(s)>65535)throw new Error(DIe);let a=Xi(e,n,Vte);if(a!==ke&&a>65535)throw new Error(iie);let c=Kne(e,n,gw,new Date),u=Xi(e,n,_w),f=Kne(e,n,tO),d=Kne(e,n,nO),p=oPe(e,n,Lte,b6,0),g=Xi(e,n,Oj),m=Xi(e,n,Dj),y=Xi(e,n,Rj);jj(m,y);let A=Sw(e,n,uSe,3),b=Xi(e,n,Hte),x=Xi(e,n,fSe,!0),T=Xi(e,n,dSe),E=Xi(e,n,hSe,!0),v=Xi(e,n,Nj),S=Xi(e,n,Fj),I=Xi(e,n,pSe),R=Qne(e,n,gSe),O=Xi(e,n,_Se,!0),L=Vj(Xi(e,n,Mj)),_=Xi(e,n,ySe,!0),C=Xi(e,n,Wte),w=g||C===ke?ke:Zj(C);if(!g&&C!==ke&&C!==0&&C!==8&&!w)throw new Error(xEt);let D=Sw(e,n,mSe);if(ZS(D,SEt,QIe),e.options[$S]){if(m!==ke||y!==ke)throw new Error(LIe);D===ke&&C===ke&&(D=0)}g&&(D=ke);let N=Xi(e,n,Lj),F=Xi(e,n,$ee);I&&F===ke&&(F=!1),(F===ke||b&&!g)&&(F=!0),D!==ke&&D!=6&&(N=!1);let V=Xi(e,n,T6);if(!b&&(m!==ke||y!==ke)&&!(Number.isInteger(A)&&A>=1&&A<=3))throw new Error(NIe);let B=qne(n[C6]),j=qne(n[TSe]),k=qne(n[ESe]);return{comment:o,resolvedOptions:{rawFilename:r,rawComment:s,version:a,lastModDate:c,rawLastModDate:u,lastAccessDate:f,creationDate:d,internalFileAttributes:p,passThrough:g,password:m,rawPassword:y,encryptionStrength:A,zipCrypto:b,extendedTimestamp:x,ntfsTimestamp:T,keepOrder:E,useWebWorkers:v,transferStreams:S,bufferedWrite:I,createTempStream:R,dataDescriptorSignature:O,signal:L,useUnicodeFileNames:_,compressionMethod:C,format:w?w.format:ke,codecURI:w?w.codecURI:ke,codecVersionNeeded:w?w.versionNeeded:ke,level:D,useCompressionStream:N,dataDescriptor:F,zip64:V,rawExtraField:B,rawLocalExtraField:j,rawCentralExtraField:k}}}function qne(e){if(!e)return dr;if(!(e instanceof Map))throw new Error(BIe);let t=0,n=0;e.forEach((o,s)=>{if(Qee(s,65535,kIe),!(o instanceof Uint8Array))throw new Error(UIe);if(Ji(o)>65535)throw new Error(K6);t+=4+Ji(o)});let i=new Uint8Array(t),r=li(i);return e.forEach((o,s)=>{Jp(r,n,s),Jp(r,n+2,Ji(o)),mO(i,o,n+4),n+=4+Ji(o)}),i}async function OEt(e,t,{resolvedOptions:n},i){if(n.passThrough&&!t&&!Xi(e,i,mT))throw new Error(GIe);let r;return t&&(t=new Gg(t),await vc(t),{size:r}=t),Object.assign({reader:t},MEt(e,!!t,r,n,i))}function MEt(e,t,n,i,r){let{passThrough:o,zipCrypto:s,password:a,rawPassword:c,encryptionStrength:u}=i,{dataDescriptor:f,zip64:d,level:p,compressionMethod:g}=i,m=0,y=0;if(o&&t){if(y=r[eO],y===ke)throw new Error(jIe);if(g===ke)throw new Error(HIe)}let A=d===!0,b=Xi(e,r,zte);if(t&&o&&!b&&Ji(a,c))throw new Error(FIe);let x=t&&(!!(a&&Ji(a)||c&&Ji(c))||o&&b);t||(p=0,g=0);let T=x?s?12:16+u*4:0;t&&(o?(r.uncompressedSize=y,m=n===ke?IIe(y)+T:n):n===ke?(f=!0,(d||d===ke)&&(d=!0,y=m=4294967296)):(r.uncompressedSize=y=n,m=(eie(g,p)?IIe(y):y)+T));let E=!x&&(!t||n===0&&!o)&&!eie(g,p);E&&!s&&Xi(e,r,$ee)===ke&&(f=!1);let v=A||y>=4294967295,S=A||m>=4294967295;if(v||S){if(d===!1)throw new Error($6);d=!0}return d=d||!1,{maximumCompressedSize:m,resolvedOptions:{dataDescriptor:f,emptyEntry:E,zip64:d,zip64UncompressedSize:v,zip64CompressedSize:S,uncompressedSize:y,level:p,compressionMethod:g,encrypted:x}}}async function NEt(e,t,n,i,r){let{fileEntries:o,writer:s}=e,{keepOrder:a,dataDescriptor:c,emptyEntry:u,signal:f}=r,{headerInfo:d,fileEntry:p,previousFileEntry:g,releaseLockFileEntry:m}=i,y=e.options[$S],A=p,b,x,T,E,v,S=0,I,R=a&&g?g.lockFileEntry:ke;o.set(t,A);try{r.bufferedWrite||!a||e.writerLocked||e.bufferedWrites||!c&&!u?(b=!0,e.bufferedWrites++,r.createTempStream?I=await r.createTempStream():I=new TransformStream(ke,ke,{highWaterMark:oT}),I.size=0,await vc(s)):(I=s,await R,await O()),await vc(I);let _=fO(s);e.addSplitZipSignature&&!b&&await vIe(e,s),y&&!b&&EIe(i,e.offset-_);let{localHeaderArray:C}=d;b||await L();let w=Yg(s),D=dO(e,s);if(A.diskNumberStart=w,b||(E=!0,v=s.size,await Zp(I,C)),A=await LEt(n,I,A,i,Vg(),r),b||(E=!1),o.set(t,A),A.filename=t,b){if(await Promise.all([I.writable.getWriter().close(),R]),await O(),e.addSplitZipSignature&&await vIe(e,s),T=!0,v=s.size,await L(),A.diskNumberStart=Yg(s),A.offset=dO(e,s),y){let N=i.metadataSize;EIe(i,e.offset-fO(s)),A.size+=i.metadataSize-N}zEt(A,d.localHeaderView,r),await Zp(s,d.localHeaderArray),await iPe(I.readable,s,f,N=>S+=N),s.size+=I.size,T=!1}else A.diskNumberStart=w,A.offset=D;return e.offset+=A.size,A}catch(_){if(T||E){if(e.hasCorruptedEntries=!0,_)try{_.corruptedEntry=!0}catch{}e.offset+=s.size-v,b&&(e.offset+=S)}throw o.delete(t),_}finally{if(b&&e.bufferedWrites--,m&&m(R),x&&x(),b&&I&&I.dispose)try{await I.dispose()}catch{}}async function O(){e.writerLocked=!0;let{lockWriter:_}=e;e.lockWriter=new Promise(C=>x=()=>{e.writerLocked=!1,C()}),await _}async function L(){ww(s,Ji(d.localHeaderArray))&&await s.closeDisk()}}async function LEt(e,t,{diskNumberStart:n,lockFileEntry:i},r,o,s){let{headerInfo:a,dataDescriptorInfo:c,metadataSize:u}=r,{headerArray:f,headerView:d,lastModDate:p,rawLastModDate:g,encrypted:m,compressed:y,version:A,compressionMethod:b,rawExtraFieldZip64:x,localExtraFieldZip64Length:T,rawExtraFieldExtendedTimestamp:E,extraFieldExtendedTimestampFlag:v,rawExtraFieldNTFS:S,rawExtraFieldUnix:I,rawExtraFieldAES:R}=a,{dataDescriptorArray:O}=c,{rawFilename:L,lastAccessDate:_,creationDate:C,password:w,rawPassword:D,level:N,zip64:F,zip64UncompressedSize:V,zip64CompressedSize:B,zipCrypto:j,dataDescriptor:k,directory:G,executable:q,versionMadeBy:Q,rawComment:W,rawExtraField:J,rawCentralExtraField:Z,useWebWorkers:ae,transferStreams:Ae,onstart:fe,onprogress:xe,onend:ge,signal:we,encryptionStrength:ve,extendedTimestamp:Re,msDosCompatible:Qe,internalFileAttributes:He,externalFileAttributes:Ye,uid:Ke,gid:Pe,unixMode:qe,symlink:st,setuid:vt,setgid:jt,sticky:lt,unixExternalUpper:mt,msdosAttributesRaw:ft,msdosAttributes:Yt,useCompressionStream:rt,passThrough:ht,format:Li,codecURI:Yn}=s,yi={lockFileEntry:i,versionMadeBy:Q,zip64:F,directory:!!G,executable:!!q,filenameUTF8:!0,rawFilename:L,commentUTF8:!0,rawComment:W,rawExtraFieldZip64:x,localExtraFieldZip64Length:T,rawExtraFieldExtendedTimestamp:E,rawExtraFieldNTFS:S,rawExtraFieldUnix:I,rawExtraFieldAES:R,rawExtraField:J,rawCentralExtraField:Z,extendedTimestamp:Re,msDosCompatible:Qe,internalFileAttributes:He,externalFileAttributes:Ye,diskNumberStart:n,uid:Ke,gid:Pe,unixMode:qe,symlink:!!st,setuid:vt,setgid:jt,sticky:lt,unixExternalUpper:mt,msdosAttributesRaw:ft,msdosAttributes:Yt},{crc32:zi,uncompressedSize:Si}=s,ui=0;ht||(Si=0);let{writable:Ai}=t;if(e){let zn=am(Ste(e)),tn=e.size,Hn={options:{codecType:lw,inputSize:tn,level:N,rawPassword:D,password:w,encryptionStrength:ve,zipCrypto:m&&j,passwordVerification:m&&j&&g>>8&255,computeCrc32:!ht,compressed:y&&!ht,encrypted:m&&!ht,useWebWorkers:ae,useCompressionStream:rt,transferStreams:Ae,format:Li,codecURI:Yn,compressionMethod:b},config:o,streamOptions:{signal:we,size:tn,onstart:fe,onprogress:xe,onend:ge}};try{let Ki=await h6({readable:zn,writable:Ai},Hn);if(ui=Ki.outputSize,t.size+=ui,ht||(Si=Ki.inputSize,(!m||j)&&(zi=Ki.crc32)),!B&&ui>=4294967295||!V&&Si>=4294967295)throw new Error($6)}catch(Ki){throw Ki.outputSize!==ke&&(t.size+=Ki.outputSize),Ki}}return UEt({crc32:zi,compressedSize:ui,uncompressedSize:Si,headerInfo:a,dataDescriptorInfo:c},s),k&&await Zp(t,O),Object.assign(yi,{uncompressedSize:Si,compressedSize:ui,lastModDate:p,rawLastModDate:g,creationDate:C,lastAccessDate:_,encrypted:!!m,zipCrypto:!!j,size:u+ui,compressionMethod:b,version:A,headerArray:f,headerView:d,signature:zi,crc32:m&&!j&&!ht?ke:zi,extraFieldExtendedTimestampFlag:v,zip64UncompressedSize:V,zip64CompressedSize:B}),yi}function FEt(e){let{rawFilename:t,lastModDate:n,rawLastModDate:i,lastAccessDate:r,creationDate:o,level:s,zip64:a,zipCrypto:c,useUnicodeFileNames:u,dataDescriptor:f,directory:d,rawExtraField:p,rawLocalExtraField:g,encryptionStrength:m,extendedTimestamp:y,ntfsTimestamp:A,passThrough:b,encrypted:x,zip64UncompressedSize:T,zip64CompressedSize:E,uncompressedSize:v,crc32:S}=e,{version:I,compressionMethod:R}=e,O=!d&&eie(R,s),L,_=b||!O,C=a&&(e.bufferedWrite||!f||!T&&!E||_),w=C||a&&f&&(T||E);if(a&&(T||E)){let ge=Df(20);if(ge.writeUint16(1),ge.writeUint16(16),L=ge.array,C&&(ge.writeUint64(v),_)){let we=x?c?12:16+m*4:0;ge.writeUint64(b?0:v+we)}}else L=dr;let D;if(x&&!c){let xe=Df(Ji(xIe)+2);xe.writeUint16(39169),xe.writeBytes(xIe),D=xe.array,D[8]=m}else D=dr;let N,F,V;if(y){let xe=q6(n),ge=rPe(xe);if(ge){let ve=9+(r?4:0)+(o?4:0),Re=Df(ve);V=1+(r?2:0)+(o?4:0),Re.writeUint16(21589),Re.writeUint16(ve-4),Re.writeUint8(V),Re.writeUint32(xe),r&&Re.writeUint32(SIe(q6(r))),o&&Re.writeUint32(SIe(q6(o))),F=Re.array}else F=dr;if(A===ke?!ge||!!(r||o):A)try{let ve=Xne(n),Re=Df(36);Re.writeUint16(10),Re.writeUint16(32),Re.skip(4),Re.writeUint16(1),Re.writeUint16(24),Re.writeUint64(ve),Re.writeUint64(r?Xne(r):ve),Re.writeUint64(o?Xne(o):ve),N=Re.array}catch{N=dr}else N=dr}else N=F=dr;let B;try{let{uid:xe,gid:ge,unixExtraFieldType:we}=e;if(we==$ne&&(xe!==ke||ge!==ke)){let ve=CIe(xe===ke?0:xe),Re=CIe(ge===ke?0:ge),Qe=3+ve.length+Re.length,He=Df(4+Qe);He.writeUint16(30837),He.writeUint16(Qe),He.writeUint8(1),He.writeUint8(ve.length),He.writeBytes(ve),He.writeUint8(Re.length),He.writeBytes(Re),B=He.array}else if(we==Jne&&(xe!==ke||ge!==ke)){let ve=Df(8);ve.writeUint16(30805),ve.writeUint16(4),ve.writeUint16((xe===ke?0:xe)&65535),ve.writeUint16((ge===ke?0:ge)&65535),B=ve.array}else B=dr}catch{B=dr}R===ke&&(R=O?8:0),I===ke&&(I=R==0&&!d&&!x?10:20);let{codecVersionNeeded:j}=e;O&&j!==ke&&(I=I>j?I:j),a&&(I=I>45?I:45),x&&!c&&(I=I>51?I:51,b&&S!==ke&&(D[TEt]=vEt),Jp(li(D),EEt,R),R=99);let k=w?Ji(L):0,G=k+Ji(D,F,N,B,p,g),q=e[$S]?CEt:0;if(G+q>65535)throw new Error(K6);let Q=new Date(Math.ceil(Math.floor(n.getTime()/1e3)/2)*2e3),{headerArray:W,headerView:J,rawLastModDate:Z}=sPe({version:I,bitFlag:aPe(s,u,f,x,R),compressionMethod:R,uncompressedSize:v,lastModDate:Q<KS?KS:Q>Kee?Kee:Q,rawLastModDate:i,rawFilename:t,zip64CompressedSize:E,zip64UncompressedSize:T,extraFieldLength:G}),ae=Df(30+Ji(t)+G),Ae=ae.array,fe=li(Ae);return ae.writeUint32(67324752),ae.writeBytes(W),ae.writeBytes(t),w&&ae.writeBytes(L),ae.writeBytes(D),ae.writeBytes(F),ae.writeBytes(N),ae.writeBytes(B),ae.writeBytes(p),ae.writeBytes(g),f&&(E||Sc(fe,18,0),T||Sc(fe,22,0)),{localHeaderArray:Ae,localHeaderView:fe,headerArray:W,headerView:J,lastModDate:n,rawLastModDate:Z,encrypted:x,compressed:O,version:I,compressionMethod:R,extraFieldExtendedTimestampFlag:V,rawExtraFieldZip64:dr,localExtraFieldZip64Length:k,rawExtraFieldExtendedTimestamp:F,rawExtraFieldNTFS:N,rawExtraFieldUnix:B,rawExtraFieldAES:D,extraFieldLength:G}}function EIe(e,t){let{headerInfo:n}=e,{localHeaderArray:i,extraFieldLength:r}=n,o=64-(t+Ji(i))%64;o<4&&(o+=64);let s=new Uint8Array(o),a=li(s);Jp(a,0,6534),Jp(a,2,o-4);let c=i;n.localHeaderArray=i=new Uint8Array(Ji(c)+o),mO(i,c),mO(i,s,Ji(c));let u=li(i);Jp(u,28,r+o),n.localHeaderView=u,e.metadataSize+=o}function CIe(e){let t=new Uint8Array(4);li(t).setUint32(0,e,!0);let i=4;for(;i>1&&t[i-1]===0;)i--;return t.subarray(0,i)}function BEt(e,t){if(e!==ke)e=e&255;else if(t!==ke){let{readOnly:n,hidden:i,system:r,directory:o,archive:s}=t,a=0;n&&(a|=1),i&&(a|=2),r&&(a|=4),o&&(a|=16),s&&(a|=32),e=a&255}return t===ke&&(t={readOnly:!!(e&1),hidden:!!(e&2),system:!!(e&4),directory:!!(e&16),archive:!!(e&32)}),{msdosAttributesRaw:e,msdosAttributes:t}}function kEt({zip64:e,dataDescriptor:t,dataDescriptorSignature:n}){let i=dr,r,o=0,s=e?20:12;return n&&(s+=4),t&&(i=new Uint8Array(s),r=li(i),n&&(o=4,Sc(r,0,134695760))),{dataDescriptorArray:i,dataDescriptorView:r,dataDescriptorOffset:o}}function UEt({crc32:e,compressedSize:t,uncompressedSize:n,headerInfo:i,dataDescriptorInfo:r},{zip64:o,zipCrypto:s,passThrough:a,dataDescriptor:c}){let{headerView:u,encrypted:f}=i,{dataDescriptorView:d,dataDescriptorOffset:p}=r;(!f||s||a)&&e!==ke&&(Sc(u,10,e),c&&Sc(d,p,e)),o?c&&(hO(d,p+4,BigInt(t)),hO(d,p+12,BigInt(n))):(Sc(u,14,t),Sc(u,18,n),c&&(Sc(d,p+4,t),Sc(d,p+8,n)))}function zEt({rawFilename:e,encrypted:t,zip64:n,localExtraFieldZip64Length:i,crc32:r,compressedSize:o,uncompressedSize:s,zip64UncompressedSize:a,zip64CompressedSize:c},u,{dataDescriptor:f,passThrough:d}){if(f||((!t||d&&r!==ke)&&Sc(u,14,r),c||Sc(u,18,o),a||Sc(u,22,s)),n&&i){let p=30+Ji(e)+4;hO(u,p,BigInt(s)),hO(u,p+8,BigInt(o))}}async function VEt(e,t,n){let i=jEt(e.fileEntries),{directoryStart:r,directoryEnd:o,directoryArray:s}=await HEt(e,i,n),a=await GEt(e,s,n);await WEt(e,t,n,{directoryStart:r,directoryEnd:o,directoryDataLength:i,signatureLength:a})}function jEt(e){let t=0;for(let[,n]of e){let{rawFilename:i,rawExtraFieldAES:r,rawComment:o,rawExtraFieldNTFS:s,rawExtraFieldUnix:a,rawExtraField:c,rawCentralExtraField:u,extendedTimestamp:f,extraFieldExtendedTimestampFlag:d,lastModDate:p,zip64UncompressedSize:g,zip64CompressedSize:m,uncompressedSize:y,compressedSize:A}=n,b=n.offset>=4294967295,x=n.diskNumberStart>=65535,T;if(b||x||g||m){let I=4+(g?8:0)+(m?8:0)+(b?8:0)+(x?4:0),R=Df(I);R.writeUint16(1),R.writeUint16(I-4),g&&R.writeUint64(y),m&&R.writeUint64(A),b&&R.writeUint64(n.offset),x&&R.writeUint32(n.diskNumberStart),T=R.array}else T=dr;n.rawExtraFieldZip64=T,n.zip64Offset=b,n.zip64DiskNumberStart=x;let E,v=q6(p);if(f&&rPe(v)){let I=Df(9);I.writeUint16(21589),I.writeUint16(5),I.writeUint8(d),I.writeUint32(v),E=I.array}else E=dr;n.rawExtraFieldExtendedTimestamp=E;let S=Ji(T,r,s,a,E,c,u);if(S>65535)throw new Error(K6);t+=46+Ji(i,o)+S}return t}async function HEt(e,t,n){let{fileEntries:i,writer:r}=e,o=new Uint8Array(t);await vc(r);let s=0,a=0,c=Yg(r),u=fO(r),f=0;for(let[d,p]of Array.from(i.values()).entries()){let{offset:g,rawFilename:m,rawExtraFieldZip64:y,rawExtraFieldAES:A,rawExtraFieldExtendedTimestamp:b,rawExtraFieldNTFS:x,rawExtraFieldUnix:T,rawExtraField:E,rawCentralExtraField:v,rawComment:S,versionMadeBy:I,headerArray:R,headerView:O,zip64UncompressedSize:L,zip64CompressedSize:_,zip64DiskNumberStart:C,zip64Offset:w,internalFileAttributes:D,externalFileAttributes:N,diskNumberStart:F,uncompressedSize:V,compressedSize:B}=p,j=Ji(y,A,b,x,T,E,v),k=46+Ji(m,S)+j;ww(r,s+k-a)&&(await Zp(r,o.slice(a,s)),a=s,f=0,await r.closeDisk()),d==0&&(c=Yg(r),u=fO(r)),L||Sc(O,18,V),_||Sc(O,14,B),(w||C)&&p.version<45&&Jp(O,0,45);let G=Df(k);if(G.writeUint32(33639248),G.writeUint16(I),G.writeBytes(R.subarray(0,24)),G.writeUint16(j),G.writeUint16(Ji(S)),G.writeUint16(C?65535:F),G.writeUint16(D),G.writeUint32(N),G.writeUint32(w?4294967295:g),G.writeBytes(m),G.writeBytes(y),G.writeBytes(A),G.writeBytes(b),G.writeBytes(x),G.writeBytes(T),G.writeBytes(E),G.writeBytes(v),G.writeBytes(S),mO(o,G.array,s),s+=k,f++,n.onprogress)try{await n.onprogress(d+1,i.size,new CA(p))}catch{}}return await Zp(r,a?o.slice(a):o),{directoryStart:{diskNumber:c,diskOffset:u},directoryEnd:{diskNumber:Yg(r),entriesLength:f},directoryArray:o}}async function GEt(e,t,n){let i=Qne(e,n,ISe);if(i){let r=await i(t),o=Ji(r);if(o>65535)throw new Error(ePe);let s=Df(6+o);s.writeUint32(84233040),s.writeUint16(o),s.writeBytes(r);let{writer:a}=e;return ww(a,Ji(s.array))&&await a.closeDisk(),await Zp(a,s.array),6+o}return 0}async function WEt(e,t,n,i){let{writer:r}=e,{directoryStart:o,directoryEnd:s,signatureLength:a}=i,{directoryDataLength:c}=i,u=e.fileEntries.size,f=o.diskNumber,d=dO(e,o),p=Ji(t);if(p>65535)throw new Error(nie);let g=Xi(e,n,T6),m=Yg(r);if(ww(r,(g?98:22)+p)&&m++,d>=4294967295||c>=4294967295||u>=65535||m>=65535){if(g===!1)throw new Error($6);g=!0}let y=Df(g?98:22);ww(r,Ji(y.array)+p)&&await r.closeDisk(),m=Yg(r);let A=m==s.diskNumber?s.entriesLength:0;g&&(y.writeUint32(101075792),y.writeUint64(44),y.writeUint16(45),y.writeUint16(45),y.writeUint32(m),y.writeUint32(f),y.writeUint64(A),y.writeUint64(u),y.writeUint64(c),y.writeUint64(d),y.writeUint32(117853008),y.writeUint32(m),y.writeUint64(BigInt(dO(e,r))+BigInt(c)+BigInt(a)),y.writeUint32(m+1),Xi(e,n,ASe,!0)&&(m=65535,f=65535),A=65535,u=65535,d=4294967295,c=4294967295),y.writeUint32(101010256),y.writeUint16(m),y.writeUint16(f),y.writeUint16(A),y.writeUint16(u),y.writeUint32(c),y.writeUint32(d),y.writeUint16(p),await Zp(r,y.array),p&&await Zp(r,t)}function Df(e){let t=new Uint8Array(e),n=li(t),i=0;return{array:t,writeUint8:r=>{$Et(n,i,r),i+=1},writeUint16:r=>{Jp(n,i,r),i+=2},writeUint32:r=>{Sc(n,i,r),i+=4},writeUint64:r=>{hO(n,i,BigInt(r)),i+=8},writeBytes:r=>{mO(t,r,i),i+=Ji(r)},skip:r=>i+=r}}function Yg(e){let{diskNumber:t=0}=e;return t}function fO(e){let{diskOffset:t=0}=e;return t}function ww(e,t){let{availableSize:n=oT}=e;return t>n}function dO(e,{diskNumber:t=0,diskOffset:n=0}){return e.offset-n-(t?e.initialOffset:0)}async function qEt(e){let t=await Do(e,0,4);return KEt(li(t),0)==134695760}function tPe(e){let t=li(e),n=0;for(;n+4<=Ji(e);){let i=4+X6(t,n+2);if(X6(t,n)==1)return tPe(Gd(e.subarray(0,n),e.subarray(Math.min(n+i,Ji(e)))));n+=i}return e}async function YEt(e,t,n,i){let{writer:r}=e,o=new Map;if(r.closeDisk){let s=Array.from(n).sort((c,u)=>W6(t,c)-W6(t,u)),a=0;for(let c of s){let u=W6(t,c);await Yne(e,t,a,u-a),ww(r,await XEt(t,u))&&await r.closeDisk(),o.set(c,{offset:dO(e,r),diskNumberStart:Yg(r)}),a=u}await Yne(e,t,a,i-a)}else{let s=e.offset;await Yne(e,t,0,i),n.forEach(a=>o.set(a,{offset:s+W6(t,a),diskNumberStart:0}))}return o}async function Yne(e,t,n,i){if(i>0){let{writer:r}=e,o=0;try{await iPe(Ste(t,{offset:n,size:i}),r,ke,s=>o+=s)}catch(s){e.hasCorruptedEntries=!0;try{s.corruptedEntry=!0}catch{}throw s}finally{r.size+=o,e.offset+=o}}}async function XEt(e,t){let n=await Do(e,t,30);if(Ji(n)<30)return 30;let i=li(n);return 30+X6(i,26)+X6(i,28)}function W6(e,{offset:t,diskNumberStart:n}){return t+(e.getDiskOffset?e.getDiskOffset(n):0)}function nPe(){let e=new Uint8Array(4);return Sc(li(e),0,134695760),e}async function vIe(e,t){delete e.addSplitZipSignature,await Zp(t,nPe()),e.offset+=4}async function Zp(e,t){let{writable:n}=e,i=n.getWriter();try{await i.ready,e.size+=Ji(t),await i.write(t)}finally{i.releaseLock()}}async function iPe(e,t,n,i){let r=t.writable.getWriter();try{await e.pipeTo(new WritableStream({async write(o){await r.ready,await r.write(o),i(Ji(o))}}),{preventClose:!0,preventAbort:!0,signal:n})}finally{r.releaseLock()}}function Xne(e){if(e){let t=(BigInt(e.getTime())+BigInt(116444736e5))*BigInt(1e4);return t<AIe?AIe:t>bIe?bIe:t}}function q6(e){return Math.floor(e.getTime()/1e3)}function rPe(e){return e>=zIe&&e<=VIe}function SIe(e){return Math.min(VIe,Math.max(zIe,e))}function Xi(e,t,n,i){let r=t[n]===ke?e.options[n]:t[n];return r===ke?i:r}function Kne(e,t,n,i){let r=Xi(e,t,n,i);if(r===null)return i;if(r!==ke&&(typeof r.getTime!=Po||Number.isNaN(r.getTime())))throw new Error(OIe);return r}function Qne(e,t,n){return JS(Xi(e,t,n))}function oPe(e,t,n,i,r){let o=wIe(t,n,i),s=o===ke?wIe(e.options,n,i):o;return s===ke?r:s}function wIe(e,t,n){return e[t]===ke?e[n]:e[t]}function Sw(e,t,n,i){return aT(Xi(e,t,n,i))}function IIe(e){return e+5*(Math.floor(e/16383)+1)}function eie(e,t){return e===ke?t===ke||t>0:e!==0}function X6(e,t){return e.getUint16(t,!0)}function KEt(e,t){return e.getUint32(t,!0)}function $Et(e,t,n){e.setUint8(t,n)}function Jp(e,t,n){e.setUint16(t,n,!0)}function Sc(e,t,n){e.setUint32(t,n,!0)}function hO(e,t,n){e.setBigUint64(t,n,!0)}function mO(e,t,n){e.set(t,n)}function Ji(...e){let t=0;return e.forEach(n=>n&&(t+=n.length)),t}function sPe({version:e,bitFlag:t,compressionMethod:n,uncompressedSize:i,compressedSize:r,lastModDate:o,rawLastModDate:s,rawFilename:a,zip64CompressedSize:c,zip64UncompressedSize:u,extraFieldLength:f}){let d=Df(26),p=d.array,g=li(p);if(d.writeUint16(e),d.writeUint16(t),d.writeUint16(n),s===ke){let m=new Uint32Array(1),y=li(m);Jp(y,0,(o.getHours()<<6|o.getMinutes())<<5|o.getSeconds()/2),Jp(y,2,(o.getFullYear()-1980<<4|o.getMonth()+1)<<5|o.getDate()),s=m[0]}return d.writeUint32(s),d.skip(4),c||r!==ke?d.writeUint32(c?4294967295:r):d.skip(4),u||i!==ke?d.writeUint32(u?4294967295:i):d.skip(4),d.writeUint16(Ji(a)),d.writeUint16(f),{headerArray:p,headerView:g,rawLastModDate:s}}function aPe(e,t,n,i,r){let o=0;return t&&(o=o|2048),n&&(o=o|8),(r==8||r==9)&&(e>=0&&e<=3&&(o=o|6),e>3&&e<=5&&(o=o|4),e==9&&(o=o|2)),i&&(o=o|1),o}A6();MR();Gp();uT();cc();Gp();uT();fte();var ILi=1024*1024;rw();var RLi=1024*1024;var MLi=1024*1024;var NLi=512*1024;try{QS({baseURI:import.meta.url})}catch{}Gp();var ZEt=[3,4,5,6,7,8,9,10,11,13,15,17,19,23,27,31,35,43,51,59,67,83,99,115,131,163,195,227,258],QEt=[0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0],eCt=[1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577],tCt=[0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13],nCt=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15],gO=new Uint8Array(288);gO.fill(8,0,144),gO.fill(9,144,256),gO.fill(7,256,280),gO.fill(8,280,288);var iCt=new Uint8Array(30).fill(5);function pO(e){let t=new Uint16Array(16);for(let r of e)t[r]++;t[0]=0;let n=new Uint16Array(17);for(let r=1;r<=15;r++)n[r+1]=n[r]+t[r];let i=new Uint16Array(e.length);for(let r=0;r<e.length;r++)e[r]&&(i[n[e[r]]++]=r);return{l:t,symbols:i}}var Rf="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";function cPe(e){let t;e({wasmURI:()=>(t||(t="data:application/wasm;base64,"+(function(n){let i="",r=n.length,o=0;for(;o+2<r;o+=3){let a=n[o]<<16|n[o+1]<<8|n[o+2];i+=Rf[a>>18&63]+Rf[a>>12&63]+Rf[a>>6&63]+Rf[63&a]}let s=r-o;if(s===1){let a=n[o]<<16;i+=Rf[a>>18&63]+Rf[a>>12&63]+"=="}else if(s===2){let a=n[o]<<16|n[o+1]<<8;i+=Rf[a>>18&63]+Rf[a>>12&63]+Rf[a>>6&63]+"="}return i})((function(n){let i=0,r=0,o=0,s=new Uint8Array(1024),a=0,c=0;for(;!c;){c=f(1);let A=f(2);if(A==0)d();else if(A==1)p(pO(gO),pO(iCt));else{if(A!=2)throw new Error("invalid deflate block type");p(...g())}}return s.subarray(0,a);function u(){if(i>=n.length)throw new Error("unexpected end of deflate data");return n[i++]}function f(A){for(;o<A;)r|=u()<<o,o+=8;let b=r&(1<<A)-1;return r>>>=A,o-=A,b}function d(){r=0,o=0;let A=u()|u()<<8;i+=2,y(a+A);for(let b=0;b<A;b++)s[a++]=u()}function p(A,b){let x=m(A);for(;x!=256;){if(x<256)y(a+1),s[a++]=x;else{let T=x-257,E=ZEt[T]+f(QEt[T]),v=m(b),S=eCt[v]+f(tCt[v]);y(a+E);let I=a-S;for(let R=0;R<E;R++)s[a++]=s[I+R]}x=m(A)}}function g(){let A=f(5)+257,b=f(5)+1,x=f(4)+4,T=new Uint8Array(19);for(let I=0;I<x;I++)T[nCt[I]]=f(3);let E=pO(T),v=new Uint8Array(A+b),S=0;for(;S<v.length;){let I=m(E);if(I<16)v[S++]=I;else if(I==16){let R=v[S-1],O=f(2)+3;for(;O--;)v[S++]=R}else S+=I==17?f(3)+3:f(7)+11}return[pO(v.subarray(0,A)),pO(v.subarray(A))]}function m(A){let{l:b,symbols:x}=A,T=0,E=0,v=0;for(let S=1;S<=15;S++){T|=f(1);let I=b[S];if(T-E<I)return x[v+(T-E)];v+=I,E=E+I<<1,T<<=1}throw new Error("invalid huffman code")}function y(A){if(s.length<A){let b=2*s.length;for(;b<A;)b*=2;let x=new Uint8Array(b);x.set(s.subarray(0,a)),s=x}}})((function(n){let i=(n=String(n).replace(/[^A-Za-z0-9+/=]/g,"")).length,r=[];for(let o=0;o<i;o+=4){let s=Rf.indexOf(n[o])<<18|Rf.indexOf(n[o+1])<<12|(63&Rf.indexOf(n[o+2]))<<6|63&Rf.indexOf(n[o+3]);r.push(s>>16&255),n[o+2]!=="="&&r.push(s>>8&255),n[o+3]!=="="&&r.push(255&s)}return new Uint8Array(r)})("zb19kF3XcSd2vu7He/fdmTvAABzigUTfK0gaSxiBkqghRarWc2jODIcgBCXRH/6DVSQEDkXcBwJ8M08Q5ZX5hp+mbUnLcqlcjEsbY72qWOVIFVWFu6GztEXb9Fq70Wa5iVKljVUp1WYrqz82tXJKteVKKUT46z73fQwGIEhq7XAKfOd+ndOnT5/uPn26+6jT249qpZS+t/OgGQ718EGN/5nhUD1oh+GGFNWDSj2o9PDBeMj/6eGDyXBUdEN+RT+hh/YTd8baGe2SRCudqpbGf0qpVGltrLa2FWUqUq7tXNtEURRp5axyShkXWxfpx3S7HcVaP2WeMnGqh9pf+u0oS37DHY4f3Xz0wtYXjOqcPf/wudODzY8/cH7z8yqZG12ePX928MDW6c+rNJ+6p9rF6PqxrQtnNre3VTauZfP8Q2rm4Ojy3OntwQNnLpzf/tyjmw+p2Sw8kMaar6Teopi85Kbn5qZuffZXzj6m9s0290atj2rlxg80V7vbfmhzsu3mitveX0xectvzc1O3uO0Ds829pu2Do1rR9oJ7eGtzU5kDzc1dIMSPnj537sIZpTOu9Ozpc2d/ZVOpGx944Oz5h85ubZ4ZPPDw586fGZy9cP6BwenPnNvU6sYHNh/dPrN19rHB5vkHtgenz/Qe2NrcHlzY2lTR4SsefXZz8MCZz21tbZ4fqLh64IEzj59+4Oz5M1ubj26eHzyw+fiZzce48q3Nh89c+Nz5gbq9NauV11lLHep2bvj4LR9dbv/9PzF3GpV95/06G75H+aJXtY8qs3LlHyn/U33Srfhn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z6="gzip",As,Iw,Xg,_O,uPe;function fPe(e){if(As=e,{malloc:Iw,free:Xg,memory:_O}=As,typeof Iw!="function"||typeof Xg!="function"||!_O)throw As=Iw=Xg=_O=null,new Error("Invalid WASM module")}function dPe(e){uPe=e}function hPe(e,t,n={}){if(!As){let a=new Error("WASM module not loaded");throw a.cause=uPe,a}let i=typeof n.level=="number"?n.level:-1,r=typeof n.outBuffer=="number"?n.outBuffer:64*1024,o=typeof n.inBufferSize=="number"?n.inBufferSize:64*1024;return new TransformStream({start(){try{let a;if(this.out=Iw(r),this.in=Iw(o),this.inBufferSize=o,!this.out||!this.in)throw new Error("allocation failed");if(this._scratch=new Uint8Array(r),e?(this._process=As.deflate_process,this._last_consumed=As.deflate_last_consumed,this._end=As.deflate_end,this.streamHandle=As.deflate_new(),t===Z6?a=As.deflate_init_gzip(this.streamHandle,i):t===J6?a=As.deflate_init_raw(this.streamHandle,i):a=As.deflate_init(this.streamHandle,i)):t===lPe?(this._process=As.inflate9_process,this._last_consumed=As.inflate9_last_consumed,this._end=As.inflate9_end,this.streamHandle=As.inflate9_new(),a=As.inflate9_init_raw(this.streamHandle)):(this._process=As.inflate_process,this._last_consumed=As.inflate_last_consumed,this._end=As.inflate_end,this.streamHandle=As.inflate_new(),t===J6?a=As.inflate_init_raw(this.streamHandle):t===Z6?a=As.inflate_init_gzip(this.streamHandle):a=As.inflate_init(this.streamHandle)),a!==0)throw new Error("init failed:"+a)}catch(a){throw s(this),a}},transform(a,c){try{let u=a,f=new Uint8Array(_O.buffer),d=this._process,p=this._last_consumed,g=this.out,m=this._scratch,y=0;for(;y<u.length;){let A=Math.min(u.length-y,32768);if((!this.in||this.inBufferSize<A)&&(this.in&&Xg&&(Xg(this.in),this.in=0),this.in=Iw(A),this.inBufferSize=A,!this.in))throw new Error("allocation failed");f.set(u.subarray(y,y+A),this.in);let b=d(this.streamHandle,this.in,A,g,r,0),x=b&16777215;if(x&&(m.set(f.subarray(g,g+x),0),c.enqueue(m.slice(0,x))),!e){let E=b>>24&255,v=E&128?E-256:E;if(v<0)throw new Error("process error:"+v)}let T=p(this.streamHandle);if(T===0)break;y+=T}}catch(u){s(this),c.error(u)}},flush(a){try{let c=new Uint8Array(_O.buffer),u=this._process,f=this.out,d=this._scratch;for(;;){let p=u(this.streamHandle,0,0,f,r,4),g=p&16777215,m=p>>24&255;if(!e){let y=m&128?m-256:m;if(y<0)throw new Error("process error:"+y)}if(g&&(d.set(c.subarray(f,f+g),0),a.enqueue(d.slice(0,g))),m===1||g===0)break}}catch(c){a.error(c)}finally{let c=s(this);c!==0&&a.error(new Error("end error:"+c))}},cancel(){s(this)}});function s(a){let c=0;return a.streamHandle&&a._end&&(c=a._end(a.streamHandle)),a.streamHandle=0,a.in&&Xg&&Xg(a.in),a.in=0,a.out&&Xg&&Xg(a.out),a.out=0,c}}var xT=class{constructor(t=Q6,n){return hPe(!0,t,n)}},TT=class{constructor(t=Q6,n){return hPe(!1,t,n)}};xT.requiresModule=!0;TT.requiresModule=!0;xT.supportedFormats=[Q6,J6,Z6];TT.supportedFormats=[Q6,J6,Z6,lPe];var mPe=!1;async function pPe(e,{baseURI:t}){if(!mPe)try{await rCt(e,t),mPe=!0}catch(n){throw dPe(n),n}}async function rCt(e,t){let n,i;try{try{i=new URL(e,t)}catch{}n=await(await fetch(i)).arrayBuffer()}catch(o){if(e.startsWith("data:application/wasm;base64,"))n=oCt(e);else throw o}let r=await WebAssembly.instantiate(n);fPe(r.instance.exports)}function oCt(e){let t=e.split(",")[1],n=atob(t),i=n.length,r=new Uint8Array(i);for(let o=0;o<i;++o)r[o]=n.charCodeAt(o);return r.buffer}var eH;xwe({initModule:e=>{if(!eH){let{wasmURI:t}=e;typeof t==Po&&(t=t()),eH=pPe(t,e).catch(n=>{throw eH=null,n})}return eH}});QS({CompressionStreamFallback:xT,DecompressionStreamFallback:TT});cPe(QS);var rie=32,sCt="http://www.opengis.net/kml/2.2",um="http://www.google.com/kml/ext/2.2",aCt="http://www.w3.org/2000/xmlns/";function tH(e){this._files={},this._promises=[],this._count=0,this._modelCallback=e}var cCt=/^data:image\/([^,;]+)/;tH.prototype.texture=function(e){let t=this,n;if(typeof e=="string"||e instanceof De){if(e=De.createIfNeeded(e),!e.isDataUri)return e.url;let i=e.url.match(cCt);n=`texture_${++this._count}`,l(i)&&(n+=`.${i[1]}`);let r=e.fetchBlob().then(function(o){t._files[n]=o});return this._promises.push(r),n}if(e instanceof HTMLCanvasElement){n=`texture_${++this._count}.png`;let i=new Promise(r=>{e.toBlob(function(o){t._files[n]=o,r()})});return this._promises.push(i),n}return""};function lCt(e,t){return function(n){e._files[t]=n}}tH.prototype.model=function(e,t){let n=this._modelCallback;if(!l(n))throw new oe("Encountered a model entity while exporting to KML, but no model callback was supplied.");let i={},r=n(e,t,i);for(let o in i)if(i.hasOwnProperty(o)){let s=Promise.resolve(i[o]);this._promises.push(s),s.then(lCt(this,o))}return r};Object.defineProperties(tH.prototype,{promise:{get:function(){return Promise.all(this._promises)}},files:{get:function(){return this._files}}});function nH(e){this._time=e}nH.prototype.get=function(e,t,n){let i;return l(e)&&(i=l(e.getValue)?e.getValue(this._time,n):e),i??t};nH.prototype.getColor=function(e,t){let n=this.get(e,t);if(l(n))return CT(n)};nH.prototype.getMaterialType=function(e){if(l(e))return e.getType(this._time)};function oie(){this._ids={},this._styles={},this._count=0}oie.prototype.get=function(e){let t=this._ids,n=e.innerHTML;if(l(t[n]))return t[n];let i=`style-${++this._count}`;return e.setAttribute("id",i),i=`#${i}`,t[n]=i,this._styles[n]=e,i};oie.prototype.save=function(e){let t=this._styles,n=e.childNodes[0];for(let i in t)t.hasOwnProperty(i)&&e.insertBefore(t[i],n)};function yPe(){this._ids={}}yPe.prototype.get=function(e){if(!l(e))return this.get(Kn());let t=this._ids;return l(t[e])?`${e.toString()}-${++t[e]}`:(t[e]=0,e)};function sie(e){e=e??H.EMPTY_OBJECT;let t=e.entities,n=e.kmz??!1,i=sie._createState(e),r=t.values.filter(function(u){return!l(u.parent)}),o=i.kmlDoc,s=o.documentElement;s.setAttributeNS(aCt,"xmlns:gx",um);let a=o.createElement("Document");s.appendChild(a),bPe(i,a,r),i.styleCache.save(a);let c=i.externalFileHandler;return c.promise.then(function(){let f=new XMLSerializer().serializeToString(i.kmlDoc);return n?uCt(f,c.files):{kml:f,externalFiles:c.files}})}async function uCt(e,t){let n=Zt("ThirdParty/Workers/zip-web-worker.js"),i=Zt("ThirdParty/zip-module.wasm");LR({workerURI:n,wasmURI:i});let r=new mw("application/vnd.google-earth.kmz"),o=new uO(r);await o.add("doc.kml",new JR(e));let s=Object.keys(t);return await APe(o,s,t,0),await o.close(),{kmz:await r.getData()}}async function APe(e,t,n,i){if(t.length===i)return;let r=t[i];return await e.add(r,new zu(n[r])),APe(e,t,n,i+1)}sie._createState=function(e){let t=e.entities,n=new oie,i=t.computeAvailability(),r=l(e.time)?e.time:i.start,o=e.defaultAvailability??i,s=e.sampleDuration??60;o.start===nt.MINIMUM_VALUE?o.stop===nt.MAXIMUM_VALUE?o=new Cn:K.addSeconds(o.stop,-10*s,o.start):o.stop===nt.MAXIMUM_VALUE&&K.addSeconds(o.start,10*s,o.stop);let a=new tH(e.modelCallback);return{kmlDoc:document.implementation.createDocument(sCt,"kml"),ellipsoid:e.ellipsoid??ee.default,idManager:new yPe,styleCache:n,externalFileHandler:a,time:r,valueGetter:new nH(r),sampleDuration:s,defaultAvailability:new Ls([o])}};function bPe(e,t,n){let i=e.kmlDoc,r=e.styleCache,o=e.valueGetter,s=e.idManager,a=n.length,c,u,f;for(let d=0;d<a;++d){let p=n[d];c=[],u=[],f=[],fCt(e,p,u,f),dCt(e,p.polyline,u,f),_Pe(e,p.rectangle,u,f,c),_Pe(e,p.polygon,u,f,c),gCt(e,p,p.model,u,f);let g,m=p.availability;l(m)&&(g=i.createElement("TimeSpan"),K.equals(m.start,nt.MINIMUM_VALUE)||g.appendChild(Tn(i,"begin",K.toIso8601(m.start))),K.equals(m.stop,nt.MAXIMUM_VALUE)||g.appendChild(Tn(i,"end",K.toIso8601(m.stop))));for(let b=0;b<c.length;++b){let x=c[b];x.setAttribute("id",s.get(p.id)),x.appendChild(Tn(i,"name",p.name)),x.appendChild(Tn(i,"visibility",p.show)),x.appendChild(Tn(i,"description",p.description)),l(g)&&x.appendChild(g),t.appendChild(x)}let y=u.length;if(y>0){let b=i.createElement("Placemark");b.setAttribute("id",s.get(p.id));let x=p.name,T=p.label;if(l(T)){let v=i.createElement("LabelStyle"),S=o.get(T.text);x=l(S)&&S.length>0?S:x;let I=o.getColor(T.fillColor);l(I)&&(v.appendChild(Tn(i,"color",I)),v.appendChild(Tn(i,"colorMode","normal")));let R=o.get(T.scale);l(R)&&v.appendChild(Tn(i,"scale",R)),f.push(v)}b.appendChild(Tn(i,"name",x)),b.appendChild(Tn(i,"visibility",p.show)),b.appendChild(Tn(i,"description",p.description)),l(g)&&b.appendChild(g),t.appendChild(b);let E=f.length;if(E>0){let v=i.createElement("Style");for(let S=0;S<E;++S)v.appendChild(f[S]);b.appendChild(Tn(i,"styleUrl",r.get(v)))}if(u.length===1)b.appendChild(u[0]);else if(u.length>1){let v=i.createElement("MultiGeometry");for(let S=0;S<y;++S)v.appendChild(u[S]);b.appendChild(v)}}let A=p._children;if(A.length>0){let b=i.createElement("Folder");b.setAttribute("id",s.get(p.id)),b.appendChild(Tn(i,"name",p.name)),b.appendChild(Tn(i,"visibility",p.show)),b.appendChild(Tn(i,"description",p.description)),t.appendChild(b),bPe(e,b,A)}}}var ju=new h,Xl=new he,lm=new K;function fCt(e,t,n,i){let r=e.kmlDoc,o=e.ellipsoid,s=e.valueGetter,a=t.billboard??t.point;if(!l(a)&&!l(t.path))return;let c=t.position;if(!c.isConstant){xPe(e,t,a,n,i);return}s.get(c,void 0,ju);let u=Tn(r,"coordinates",ET(ju,o)),f=r.createElement("Point"),d=r.createElement("altitudeMode");d.appendChild(vT(e,a.heightReference)),f.appendChild(d),f.appendChild(u),n.push(f);let p=a instanceof Il?EPe(e,a):TPe(e,a);i.push(p)}function xPe(e,t,n,i,r){let o=e.kmlDoc,s=e.ellipsoid,a=e.valueGetter,c,u=t.position,f=!0;u instanceof Ec?(c=u.intervals,f=!1):c=t.availability??e.defaultAvailability;let d=n instanceof K_,p,g,m,y=[];for(p=0;p<c.length;++p){let b=c.get(p),x=f?u:b.data,T=o.createElement("altitudeMode");x instanceof Ug?(x=x._value,T.appendChild(vT(e,We.CLAMP_TO_GROUND))):l(n)?T.appendChild(vT(e,n.heightReference)):T.appendChild(vT(e,We.NONE));let E=[],v=[];if(x.isConstant){a.get(x,void 0,ju);let I=Tn(o,"coordinates",ET(ju,s));E.push(K.toIso8601(b.start)),v.push(I),E.push(K.toIso8601(b.stop)),v.push(I)}else if(x instanceof Cc)for(m=x._property._times,g=0;g<m.length;++g)E.push(K.toIso8601(m[g])),x.getValueInReferenceFrame(m[g],Wi.FIXED,ju),v.push(ET(ju,s));else if(x instanceof zd){m=x._times;let I=x._values;for(g=0;g<m.length;++g)E.push(K.toIso8601(m[g])),h.fromArray(I,g*3,ju),v.push(ET(ju,s))}else{let I=e.sampleDuration;b.start.clone(lm),b.isStartIncluded||K.addSeconds(lm,I,lm);let R=b.stop;for(;K.lessThan(lm,R);)x.getValue(lm,ju),E.push(K.toIso8601(lm)),v.push(ET(ju,s)),K.addSeconds(lm,I,lm);b.isStopIncluded&&K.equals(lm,R)&&(x.getValue(lm,ju),E.push(K.toIso8601(lm)),v.push(ET(ju,s)))}let S=o.createElementNS(um,"Track");S.appendChild(T);for(let I=0;I<E.length;++I){let R=Tn(o,"when",E[I]),O=Tn(o,"coord",v[I],um);S.appendChild(R),S.appendChild(O)}d&&S.appendChild(CPe(e,n)),y.push(S)}if(y.length===1)i.push(y[0]);else if(y.length>1){let b=o.createElementNS(um,"MultiTrack");for(p=0;p<y.length;++p)b.appendChild(y[p]);i.push(b)}if(l(n)&&!d){let b=n instanceof Il?EPe(e,n):TPe(e,n);r.push(b)}let A=t.path;if(l(A)){let b=a.get(A.width),x=A.material;if(l(x)||l(b)){let T=o.createElement("LineStyle");l(b)&&T.appendChild(Tn(o,"width",b)),aie(e,x,T),r.push(T)}}}function TPe(e,t){let n=e.kmlDoc,i=e.valueGetter,r=n.createElement("IconStyle"),o=i.getColor(t.color);l(o)&&(r.appendChild(Tn(n,"color",o)),r.appendChild(Tn(n,"colorMode","normal")));let s=i.get(t.pixelSize);return l(s)&&r.appendChild(Tn(n,"scale",s/rie)),r}function EPe(e,t){let n=e.kmlDoc,i=e.valueGetter,r=e.externalFileHandler,o=n.createElement("IconStyle"),s=i.get(t.image);if(l(s)){s=r.texture(s);let p=n.createElement("Icon");p.appendChild(Tn(n,"href",s));let g=i.get(t.imageSubRegion);l(g)&&(p.appendChild(Tn(n,"x",g.x,um)),p.appendChild(Tn(n,"y",g.y,um)),p.appendChild(Tn(n,"w",g.width,um)),p.appendChild(Tn(n,"h",g.height,um))),o.appendChild(p)}let a=i.getColor(t.color);l(a)&&(o.appendChild(Tn(n,"color",a)),o.appendChild(Tn(n,"colorMode","normal")));let c=i.get(t.scale);l(c)&&o.appendChild(Tn(n,"scale",c));let u=i.get(t.pixelOffset);if(l(u)){c=c??1,U.divideByScalar(u,c,u);let p=i.get(t.width,rie),g=i.get(t.height,rie),m=i.get(t.horizontalOrigin,Hi.CENTER);m===Hi.CENTER?u.x-=p*.5:m===Hi.RIGHT&&(u.x-=p);let y=i.get(t.verticalOrigin,qn.CENTER);y===qn.TOP?u.y+=g:y===qn.CENTER&&(u.y+=g*.5);let A=n.createElement("hotSpot");A.setAttribute("x",-u.x),A.setAttribute("y",u.y),A.setAttribute("xunits","pixels"),A.setAttribute("yunits","pixels"),o.appendChild(A)}let f=i.get(t.rotation),d=i.get(t.alignedAxis);return l(f)&&h.equals(h.UNIT_Z,d)&&(f=P.toDegrees(-f),f===0&&(f=360),o.appendChild(Tn(n,"heading",f))),o}function dCt(e,t,n,i){let r=e.kmlDoc,o=e.ellipsoid,s=e.valueGetter;if(!l(t))return;let a=r.createElement("LineString"),c=r.createElement("altitudeMode"),u=s.get(t.clampToGround,!1),f;u?(a.appendChild(Tn(r,"tessellate",!0)),f=r.createTextNode("clampToGround")):f=r.createTextNode("absolute"),c.appendChild(f),a.appendChild(c);let d=t.positions,p=s.get(d),g=Tn(r,"coordinates",ET(p,o));a.appendChild(g);let m=s.get(t.zIndex);u&&l(m)&&a.appendChild(Tn(r,"drawOrder",m,um)),n.push(a);let y=r.createElement("LineStyle"),A=s.get(t.width);l(A)&&y.appendChild(Tn(r,"width",A)),aie(e,t.material,y),i.push(y)}function hCt(e,t,n){let i=e.kmlDoc,r=e.valueGetter,o=r.get(t.height,0);n>0&&(o=n);let s=t.coordinates,a=r.get(s),c=[],u=[ie.northeast,ie.southeast,ie.southwest,ie.northwest];for(let g=0;g<4;++g)u[g](a,Xl),c.push(`${P.toDegrees(Xl.longitude)},${P.toDegrees(Xl.latitude)},${o}`);let f=Tn(i,"coordinates",c.join(" ")),d=i.createElement("outerBoundaryIs"),p=i.createElement("LinearRing");return p.appendChild(f),d.appendChild(p),[d]}function gPe(e,t,n,i){let r=e.kmlDoc,o=e.ellipsoid,s=[],a=t.length;for(let f=0;f<a;++f)he.fromCartesian(t[f],o,Xl),s.push(`${P.toDegrees(Xl.longitude)},${P.toDegrees(Xl.latitude)},${i?Xl.height:n}`);let c=Tn(r,"coordinates",s.join(" ")),u=r.createElement("LinearRing");return u.appendChild(c),u}function mCt(e,t,n){let i=e.kmlDoc,r=e.valueGetter,o=r.get(t.height,0),s=r.get(t.perPositionHeight,!1);!s&&n>0&&(o=n);let a=[],c=t.hierarchy,u=r.get(c),f=Array.isArray(u)?u:u.positions,d=i.createElement("outerBoundaryIs");d.appendChild(gPe(e,f,o,s)),a.push(d);let p=u.holes;if(l(p)){let g=p.length;for(let m=0;m<g;++m){let y=i.createElement("innerBoundaryIs");y.appendChild(gPe(e,p[m].positions,o,s)),a.push(y)}}return a}function _Pe(e,t,n,i,r){let o=e.kmlDoc,s=e.valueGetter;if(!l(t))return;let a=t instanceof ip;if(a&&s.getMaterialType(t.material)==="Image"){pCt(e,t,r);return}let c=o.createElement("Polygon"),u=s.get(t.extrudedHeight,0);u>0&&c.appendChild(Tn(o,"extrude",!0));let f=a?hCt(e,t,u):mCt(e,t,u),d=f.length;for(let A=0;A<d;++A)c.appendChild(f[A]);let p=o.createElement("altitudeMode");p.appendChild(vT(e,t.heightReference)),c.appendChild(p),n.push(c);let g=o.createElement("PolyStyle"),m=s.get(t.fill,!1);m&&g.appendChild(Tn(o,"fill",m)),aie(e,t.material,g);let y=s.get(t.outline,!1);if(y){g.appendChild(Tn(o,"outline",y));let A=o.createElement("LineStyle"),b=s.get(t.outlineWidth,1);A.appendChild(Tn(o,"width",b));let x=s.getColor(t.outlineColor,z.BLACK);A.appendChild(Tn(o,"color",x)),A.appendChild(Tn(o,"colorMode","normal")),i.push(A)}i.push(g)}function pCt(e,t,n){let i=e.kmlDoc,r=e.valueGetter,o=e.externalFileHandler,s=i.createElement("GroundOverlay"),a=i.createElement("altitudeMode");a.appendChild(vT(e,t.heightReference)),s.appendChild(a);let c=r.get(t.height);l(c)&&s.appendChild(Tn(i,"altitude",c));let u=r.get(t.coordinates),f=i.createElement("LatLonBox");f.appendChild(Tn(i,"north",P.toDegrees(u.north))),f.appendChild(Tn(i,"south",P.toDegrees(u.south))),f.appendChild(Tn(i,"east",P.toDegrees(u.east))),f.appendChild(Tn(i,"west",P.toDegrees(u.west))),s.appendChild(f);let d=r.get(t.material),p=o.texture(d.image),g=i.createElement("Icon");g.appendChild(Tn(i,"href",p)),s.appendChild(g);let m=d.color;l(m)&&s.appendChild(Tn(i,"color",CT(d.color))),n.push(s)}function CPe(e,t){let n=e.kmlDoc,i=e.valueGetter,r=e.externalFileHandler,o=n.createElement("Model"),s=i.get(t.scale);if(l(s)){let u=n.createElement("scale");u.appendChild(Tn(n,"x",s)),u.appendChild(Tn(n,"y",s)),u.appendChild(Tn(n,"z",s)),o.appendChild(u)}let a=n.createElement("Link"),c=r.model(t,e.time);return a.appendChild(Tn(n,"href",c)),o.appendChild(a),o}function gCt(e,t,n,i,r){let o=e.kmlDoc,s=e.ellipsoid,a=e.valueGetter;if(!l(n))return;let c=t.position;if(!c.isConstant){xPe(e,t,n,i,r);return}let u=CPe(e,n),f=o.createElement("altitudeMode");f.appendChild(vT(e,n.heightReference)),u.appendChild(f),a.get(c,void 0,ju),he.fromCartesian(ju,s,Xl);let d=o.createElement("Location");d.appendChild(Tn(o,"longitude",P.toDegrees(Xl.longitude))),d.appendChild(Tn(o,"latitude",P.toDegrees(Xl.latitude))),d.appendChild(Tn(o,"altitude",Xl.height)),u.appendChild(d),i.push(u)}function aie(e,t,n){let i=e.kmlDoc,r=e.valueGetter;if(!l(t))return;let o=r.get(t);if(!l(o))return;let s,a=r.getMaterialType(t),c,u;switch(a){case"Image":s=CT(z.WHITE);break;case"Color":case"Grid":case"PolylineGlow":case"PolylineArrow":case"PolylineDash":s=CT(o.color);break;case"PolylineOutline":s=CT(o.color),c=CT(o.outlineColor),u=o.outlineWidth,n.appendChild(Tn(i,"outerColor",c,um)),n.appendChild(Tn(i,"outerWidth",u,um));break;case"Stripe":s=CT(o.oddColor);break}l(s)&&(n.appendChild(Tn(i,"color",s)),n.appendChild(Tn(i,"colorMode","normal")))}function vT(e,t){let n=e.kmlDoc,r=e.valueGetter.get(t,We.NONE),o;switch(r){case We.NONE:o=n.createTextNode("absolute");break;case We.CLAMP_TO_GROUND:o=n.createTextNode("clampToGround");break;case We.RELATIVE_TO_GROUND:o=n.createTextNode("relativeToGround");break}return o}function ET(e,t){Array.isArray(e)||(e=[e]);let n=e.length,i=[];for(let r=0;r<n;++r)he.fromCartesian(e[r],t,Xl),i.push(`${P.toDegrees(Xl.longitude)},${P.toDegrees(Xl.latitude)},${Xl.height}`);return i.join(" ")}function Tn(e,t,n,i){n=n??"",typeof n=="boolean"&&(n=n?"1":"0");let r=l(i)?e.createElementNS(i,t):e.createElement(t),o=n==="string"&&n.indexOf("<")!==-1?e.createCDATASection(n):e.createTextNode(n);return r.appendChild(o),r}function CT(e){let t="",n=e.toBytes();for(let i=3;i>=0;--i)t+=n[i]<16?`0${n[i].toString(16)}`:n[i].toString(16);return t}var vPe=sie;function AO(){this._cache={}}AO.prototype.fromColor=function(e,t){return iH(void 0,void 0,e,t,this._cache)};AO.prototype.fromUrl=function(e,t,n){return iH(e,void 0,t,n,this._cache)};AO.prototype.fromMakiIconId=function(e,t,n){return iH(Zt(`Assets/Textures/maki/${encodeURIComponent(e)}.png`),void 0,t,n,this._cache)};AO.prototype.fromText=function(e,t,n){return iH(void 0,e,t,n,this._cache)};var _Ct=new z;function yCt(e,t,n){e.save(),e.scale(n/24,n/24),e.fillStyle=t.toCssColorString(),e.strokeStyle=t.brighten(.6,_Ct).toCssColorString(),e.lineWidth=.846,e.beginPath(),e.moveTo(6.72,.422),e.lineTo(17.28,.422),e.bezierCurveTo(18.553,.422,19.577,1.758,19.577,3.415),e.lineTo(19.577,10.973),e.bezierCurveTo(19.577,12.63,18.553,13.966,17.282,13.966),e.lineTo(14.386,14.008),e.lineTo(11.826,23.578),e.lineTo(9.614,14.008),e.lineTo(6.719,13.965),e.bezierCurveTo(5.446,13.983,4.422,12.629,4.422,10.972),e.lineTo(4.422,3.416),e.bezierCurveTo(4.423,1.76,5.447,.423,6.718,.423),e.closePath(),e.fill(),e.stroke(),e.restore()}function SPe(e,t,n){let i=n/2.5,r=i,o=i;t.width>t.height?o=i*(t.height/t.width):t.width<t.height&&(r=i*(t.width/t.height));let s=Math.round((n-r)/2),a=Math.round(7/24*n-o/2);e.globalCompositeOperation="destination-out",e.drawImage(t,s-1,a,r,o),e.drawImage(t,s,a-1,r,o),e.drawImage(t,s+1,a,r,o),e.drawImage(t,s,a+1,r,o),e.globalCompositeOperation="destination-over",e.fillStyle=z.BLACK.toCssColorString(),e.fillRect(s-1,a-1,r+2,o+2),e.globalCompositeOperation="destination-out",e.drawImage(t,s,a,r,o),e.globalCompositeOperation="destination-over",e.fillStyle=z.WHITE.toCssColorString(),e.fillRect(s-1,a-2,r+2,o+2)}var yO=new Array(4);function iH(e,t,n,i,r){yO[0]=e,yO[1]=t,yO[2]=n,yO[3]=i;let o=JSON.stringify(yO),s=r[o];if(l(s))return s;let a=document.createElement("canvas");a.width=i,a.height=i;let c=a.getContext("2d");if(yCt(c,n,i),l(e)){let f=De.createIfNeeded(e).fetchImage().then(function(d){return SPe(c,d,i),r[o]=a,a});return r[o]=f,f}else if(l(t)){let u=Ov(t,{font:`bold ${i}px sans-serif`});SPe(c,u,i)}return r[o]=a,a}var wA=AO;function cie(e){return e}function rH(e){if(e==null)return cie;var t,n,i=e.scale[0],r=e.scale[1],o=e.translate[0],s=e.translate[1];return function(a,c){c||(t=n=0);var u=2,f=a.length,d=new Array(f);for(d[0]=(t+=a[0])*i+o,d[1]=(n+=a[1])*r+s;u<f;)d[u]=a[u],++u;return d}}function wPe(e,t){for(var n,i=e.length,r=i-t;r<--i;)n=e[r],e[r++]=e[i],e[i]=n}function lie(e,t){return typeof t=="string"&&(t=e.objects[t]),t.type==="GeometryCollection"?{type:"FeatureCollection",features:t.geometries.map(function(n){return IPe(e,n)})}:IPe(e,t)}function IPe(e,t){var n=t.id,i=t.bbox,r=t.properties==null?{}:t.properties,o=uie(e,t);return n==null&&i==null?{type:"Feature",properties:r,geometry:o}:i==null?{type:"Feature",id:n,properties:r,geometry:o}:{type:"Feature",id:n,bbox:i,properties:r,geometry:o}}function uie(e,t){var n=rH(e.transform),i=e.arcs;function r(f,d){d.length&&d.pop();for(var p=i[f<0?~f:f],g=0,m=p.length;g<m;++g)d.push(n(p[g],g));f<0&&wPe(d,m)}function o(f){return n(f)}function s(f){for(var d=[],p=0,g=f.length;p<g;++p)r(f[p],d);return d.length<2&&d.push(d[0]),d}function a(f){for(var d=s(f);d.length<4;)d.push(d[0]);return d}function c(f){return f.map(a)}function u(f){var d=f.type,p;switch(d){case"GeometryCollection":return{type:d,geometries:f.geometries.map(u)};case"Point":p=o(f.coordinates);break;case"MultiPoint":p=f.coordinates.map(o);break;case"LineString":p=s(f.arcs);break;case"MultiLineString":p=f.arcs.map(s);break;case"Polygon":p=c(f.arcs);break;case"MultiPolygon":p=f.arcs.map(c);break;default:return null}return{type:d,coordinates:p}}return u(t)}function oH(e){return h.fromDegrees(e[0],e[1],e[2])}var fie={"urn:ogc:def:crs:OGC:1.3:CRS84":oH,"EPSG:4326":oH,"urn:ogc:def:crs:EPSG::4326":oH},PPe={},DPe={},die=48,hie,mie=z.ROYALBLUE,pie=z.YELLOW,gie=2,_ie=z.fromBytes(255,255,0,100),yie=!1,ECt={small:24,medium:48,large:64},CCt=["title","description","marker-size","marker-symbol","marker-color","stroke","stroke-opacity","stroke-width","fill","fill-opacity"];function RPe(e,t){let n="";for(let i in e)if(e.hasOwnProperty(i)){if(i===t||CCt.indexOf(i)!==-1)continue;let r=e[i];l(r)&&(typeof r=="object"?n+=`<tr><th>${i}</th><td>${RPe(r)}</td></tr>`:n+=`<tr><th>${i}</th><td>${r}</td></tr>`)}return n.length>0&&(n=`<table class="cesium-infoBox-defaultTable"><tbody>${n}</tbody></table>`),n}function vCt(e,t,n){let i;return function(r,o){return l(i)||(i=e(t,n)),i}}function SCt(e,t){return new rp(vCt(RPe,e,t),!0)}function sH(e,t,n){let i=e.id;if(!l(i)||e.type!=="Feature")i=Kn();else{let s=2,a=i;for(;l(t.getById(a));)a=`${i}_${s}`,s++;i=a}let r=t.getOrCreateEntity(i),o=e.properties;if(l(o)){r.properties=o;let s,a=o.title;if(l(a))r.name=a,s="title";else{let u=Number.MAX_VALUE;for(let f in o)if(o.hasOwnProperty(f)&&o[f]){let d=f.toLowerCase();if(u>1&&d==="title"){s=f;break}else u>2&&d==="name"?(u=2,s=f):u>3&&/title/i.test(f)?(u=3,s=f):u>4&&/name/i.test(f)&&(u=4,s=f)}l(s)&&(r.name=o[s])}let c=o.description;c!==null&&(r.description=l(c)?new hi(c):n(o,s))}return r}function Aie(e,t){let n=new Array(e.length);for(let i=0;i<e.length;i++)n[i]=t(e[i]);return n}var OPe={Feature:NPe,FeatureCollection:wCt,GeometryCollection:LPe,LineString:zPe,MultiLineString:VPe,MultiPoint:kPe,MultiPolygon:GPe,Point:BPe,Polygon:HPe,Topology:WPe},MPe={GeometryCollection:LPe,LineString:zPe,MultiLineString:VPe,MultiPoint:kPe,MultiPolygon:GPe,Point:BPe,Polygon:HPe,Topology:WPe};function NPe(e,t,n,i,r){if(t.geometry===null){sH(t,e._entityCollection,r.describe);return}if(!l(t.geometry))throw new oe("feature.geometry is required.");let o=t.geometry.type,s=MPe[o];if(!l(s))throw new oe(`Unknown geometry type: ${o}`);s(e,t,t.geometry,i,r)}function wCt(e,t,n,i,r){let o=t.features;for(let s=0,a=o.length;s<a;s++)NPe(e,o[s],void 0,i,r)}function LPe(e,t,n,i,r){let o=n.geometries;for(let s=0,a=o.length;s<a;s++){let c=o[s],u=c.type,f=MPe[u];if(!l(f))throw new oe(`Unknown geometry type: ${u}`);f(e,t,c,i,r)}}function FPe(e,t,n,i,r){let o=r.markerSymbol,s=r.markerColor,a=r.markerSize,c=t.properties;if(l(c)){let g=c["marker-color"];l(g)&&(s=z.fromCssColorString(g)),a=ECt[c["marker-size"]]??a;let m=c["marker-symbol"];l(m)&&(o=m)}let u;l(o)?o.length===1?u=e._pinBuilder.fromText(o.toUpperCase(),s,a):u=e._pinBuilder.fromMakiIconId(o,s,a):u=e._pinBuilder.fromColor(s,a);let f=new Il;f.verticalOrigin=new hi(qn.BOTTOM),i.length===2&&r.clampToGround&&(f.heightReference=We.CLAMP_TO_GROUND);let d=sH(t,e._entityCollection,r.describe);d.billboard=f,d.position=new gu(n(i));let p=Promise.resolve(u).then(function(g){f.image=new hi(g)}).catch(function(){f.image=new hi(e._pinBuilder.fromColor(s,a))});e._promises.push(p)}function BPe(e,t,n,i,r){FPe(e,t,i,n.coordinates,r)}function kPe(e,t,n,i,r){let o=n.coordinates;for(let s=0;s<o.length;s++)FPe(e,t,i,o[s],r)}function UPe(e,t,n,i,r){let o=r.strokeMaterialProperty,s=r.strokeWidthProperty,a=t.properties;if(l(a)){let f=a["stroke-width"];l(f)&&(s=new hi(f));let d,p=a.stroke;l(p)&&(d=z.fromCssColorString(p));let g=a["stroke-opacity"];l(g)&&g!==1&&(l(d)||(d=o.color.getValue().clone()),d.alpha=g),l(d)&&(o=new Kt(d))}let c=sH(t,e._entityCollection,r.describe),u=new Rl;c.polyline=u,u.clampToGround=r.clampToGround,u.material=o,u.width=s,u.positions=new hi(Aie(i,n)),u.arcType=ln.RHUMB}function zPe(e,t,n,i,r){UPe(e,t,i,n.coordinates,r)}function VPe(e,t,n,i,r){let o=n.coordinates;for(let s=0;s<o.length;s++)UPe(e,t,i,o[s],r)}function jPe(e,t,n,i,r){if(i.length===0||i[0].length===0)return;let o=r.strokeMaterialProperty.color,s=r.fillMaterialProperty,a=r.strokeWidthProperty,c=t.properties;if(l(c)){let g=c["stroke-width"];l(g)&&(a=new hi(g));let m,y=c.stroke;l(y)&&(m=z.fromCssColorString(y));let A=c["stroke-opacity"];l(A)&&A!==1&&(l(m)||(m=o.getValue().clone()),m.alpha=A),l(m)&&(o=new hi(m));let b,x=c.fill,T=s.color.getValue();l(x)&&(b=z.fromCssColorString(x),b.alpha=T.alpha),A=c["fill-opacity"],l(A)&&A!==T.alpha&&(l(b)||(b=T.clone()),b.alpha=A),l(b)&&(s=new Kt(b))}let u=new np;u.outline=new hi(!0),u.outlineColor=o,u.outlineWidth=a,u.material=s,u.arcType=ln.RHUMB;let f=[];for(let g=1,m=i.length;g<m;g++)f.push(new Hc(Aie(i[g],n)));let d=i[0];u.hierarchy=new hi(new Hc(Aie(d,n),f)),d[0].length>2?u.perPositionHeight=new hi(!0):r.clampToGround||(u.height=0);let p=sH(t,e._entityCollection,r.describe);p.polygon=u}function HPe(e,t,n,i,r){jPe(e,t,i,n.coordinates,r)}function GPe(e,t,n,i,r){let o=n.coordinates;for(let s=0;s<o.length;s++)jPe(e,t,i,o[s],r)}function WPe(e,t,n,i,r){for(let o in n.objects)if(n.objects.hasOwnProperty(o)){let s=lie(n,n.objects[o]),a=OPe[s.type];a(e,s,s,i,r)}}function IA(e){this._name=e,this._changed=new be,this._error=new be,this._isLoading=!1,this._loading=new be,this._entityCollection=new rc(this),this._promises=[],this._pinBuilder=new wA,this._entityCluster=new kd,this._credit=void 0,this._resourceCredits=[]}IA.load=function(e,t){return new IA().load(e,t)};Object.defineProperties(IA,{markerSize:{get:function(){return die},set:function(e){die=e}},markerSymbol:{get:function(){return hie},set:function(e){hie=e}},markerColor:{get:function(){return mie},set:function(e){mie=e}},stroke:{get:function(){return pie},set:function(e){pie=e}},strokeWidth:{get:function(){return gie},set:function(e){gie=e}},fill:{get:function(){return _ie},set:function(e){_ie=e}},clampToGround:{get:function(){return yie},set:function(e){yie=e}},crsNames:{get:function(){return fie}},crsLinkHrefs:{get:function(){return PPe}},crsLinkTypes:{get:function(){return DPe}}});Object.defineProperties(IA.prototype,{name:{get:function(){return this._name},set:function(e){this._name!==e&&(this._name=e,this._changed.raiseEvent(this))}},clock:{value:void 0,writable:!1},entities:{get:function(){return this._entityCollection}},isLoading:{get:function(){return this._isLoading}},changedEvent:{get:function(){return this._changed}},errorEvent:{get:function(){return this._error}},loadingEvent:{get:function(){return this._loading}},show:{get:function(){return this._entityCollection.show},set:function(e){this._entityCollection.show=e}},clustering:{get:function(){return this._entityCluster},set:function(e){this._entityCluster=e}},credit:{get:function(){return this._credit}}});IA.prototype.load=function(e,t){return qPe(this,e,t,!0)};IA.prototype.process=function(e,t){return qPe(this,e,t,!1)};function qPe(e,t,n,i){Fs.setLoading(e,!0),n=n??H.EMPTY_OBJECT;let r=n.credit;typeof r=="string"&&(r=new It(r)),e._credit=r;let o=t,s=n.sourceUri;if(typeof t=="string"||t instanceof De){t=De.createIfNeeded(t),o=t.fetchJson(),s=s??t.getUrlComponent();let a=e._resourceCredits,c=t.credits;if(l(c)){let u=c.length;for(let f=0;f<u;f++)a.push(c[f])}}return n={describe:n.describe??SCt,markerSize:n.markerSize??die,markerSymbol:n.markerSymbol??hie,markerColor:n.markerColor??mie,strokeWidthProperty:new hi(n.strokeWidth??gie),strokeMaterialProperty:new Kt(n.stroke??pie),fillMaterialProperty:new Kt(n.fill??_ie),clampToGround:n.clampToGround??yie},Promise.resolve(o).then(function(a){return ICt(e,a,n,s,i)}).catch(function(a){throw Fs.setLoading(e,!1),e._error.raiseEvent(e,a),a})}IA.prototype.update=function(e){return!0};function ICt(e,t,n,i,r){let o;l(i)&&(o=nA(i)),l(o)&&e._name!==o&&(e._name=o,e._changed.raiseEvent(e));let s=OPe[t.type];if(!l(s))throw new oe(`Unsupported GeoJSON object type: ${t.type}`);let a=t.crs,c=a!==null?oH:null;if(l(a)){if(!l(a.properties))throw new oe("crs.properties is undefined.");let u=a.properties;if(a.type==="name"){if(c=fie[u.name],!l(c))throw new oe(`Unknown crs name: ${u.name}`)}else if(a.type==="link"){let f=PPe[u.href];if(l(f)||(f=DPe[u.type]),!l(f))throw new oe(`Unable to resolve crs link: ${JSON.stringify(u)}`);c=f(u)}else if(a.type==="EPSG"){if(c=fie[`EPSG:${u.code}`],!l(c))throw new oe(`Unknown crs EPSG code: ${u.code}`)}else throw new oe(`Unknown crs type: ${a.type}`)}return Promise.resolve(c).then(function(u){return r&&e._entityCollection.removeAll(),u!==null&&s(e,t,t,u,n),Promise.all(e._promises).then(function(){return e._promises.length=0,Fs.setLoading(e,!1),e})})}var ST=IA;function PCt(e){return typeof e=="string"&&(e=document.getElementById(e)),e}var kn=PCt;var bie=function(e,t){return bie=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var r in i)Object.prototype.hasOwnProperty.call(i,r)&&(n[r]=i[r])},bie(e,t)};function Qp(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");bie(e,t);function n(){this.constructor=e}e.prototype=t===null?Object.create(t):(n.prototype=t.prototype,new n)}var Zs=function(){return Zs=Object.assign||function(t){for(var n,i=1,r=arguments.length;i<r;i++){n=arguments[i];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(t[o]=n[o])}return t},Zs.apply(this,arguments)};function YPe(e,t){var n=typeof Symbol=="function"&&e[Symbol.iterator];if(!n)return e;var i=n.call(e),r,o=[],s;try{for(;(t===void 0||t-- >0)&&!(r=i.next()).done;)o.push(r.value)}catch(a){s={error:a}}finally{try{r&&!r.done&&(n=i.return)&&n.call(i)}finally{if(s)throw s.error}}return o}function XPe(e,t,n){if(n||arguments.length===2)for(var i=0,r=t.length,o;i<r;i++)(o||!(i in t))&&(o||(o=Array.prototype.slice.call(t,0,i)),o[i]=t[i]);return e.concat(o||Array.prototype.slice.call(t))}var KPe="4.1.5";var $Pe=Object.prototype.hasOwnProperty;function Of(e){return typeof e=="boolean"}function JPe(e,t,n){var i;return e.length>t&&(n==null?(n="…",i=3):i=n.length,e=e.substring(0,t-i)+n),e}function PA(e,t){for(var n=e.length-1;n>=0;n--)t(e[n])===!0&&e.splice(n,1)}function fm(e){throw new Error("Unhandled case for value: '".concat(e,"'"))}var aH=/\s+/,cH=(function(){function e(t){t===void 0&&(t={}),this.tagName="",this.attrs={},this.innerHTML="",this.tagName=t.tagName||"",this.attrs=t.attrs||{},this.innerHTML=t.innerHtml||t.innerHTML||""}return e.prototype.setTagName=function(t){return this.tagName=t,this},e.prototype.getTagName=function(){return this.tagName},e.prototype.setAttr=function(t,n){var i=this.getAttrs();return i[t]=n,this},e.prototype.getAttr=function(t){return this.getAttrs()[t]},e.prototype.setAttrs=function(t){return Object.assign(this.getAttrs(),t),this},e.prototype.getAttrs=function(){return this.attrs},e.prototype.setClass=function(t){return this.setAttr("class",t)},e.prototype.addClass=function(t){for(var n=this.getClass(),i=n?n.split(aH):[],r=t.split(aH),o;o=r.shift();)i.indexOf(o)===-1&&i.push(o);return this.getAttrs().class=i.join(" "),this},e.prototype.removeClass=function(t){for(var n=this.getClass(),i=n?n.split(aH):[],r=t.split(aH),o;i.length&&(o=r.shift());){var s=i.indexOf(o);s!==-1&&i.splice(s,1)}return this.getAttrs().class=i.join(" "),this},e.prototype.getClass=function(){return this.getAttrs().class||""},e.prototype.hasClass=function(t){return(" "+this.getClass()+" ").indexOf(" "+t+" ")!==-1},e.prototype.setInnerHTML=function(t){return this.innerHTML=t,this},e.prototype.setInnerHtml=function(t){return this.setInnerHTML(t)},e.prototype.getInnerHTML=function(){return this.innerHTML||""},e.prototype.getInnerHtml=function(){return this.getInnerHTML()},e.prototype.toAnchorString=function(){var t=this.getTagName(),n=this.buildAttrsStr();return n=n?" "+n:"",["<",t,n,">",this.getInnerHtml(),"</",t,">"].join("")},e.prototype.buildAttrsStr=function(){var t=this.getAttrs(),n=[];for(var i in t)$Pe.call(t,i)&&n.push(i+'="'+t[i]+'"');return n.join(" ")},e})();function QPe(e,t,n){var i,r;if(n==null?(n="…",r=3,i=8):(r=n.length,i=n.length),e.length<=t)return e;var o=t-r,s=DCt(e);if(s.query){var a=s.query.match(/^(.*?)(?=(\?|#))(.*?)$/i);a&&(s.query=s.query.substr(0,a[1].length),e=ZPe(s))}if(e.length<=t||(s.host&&(s.host=s.host.replace(/^www\./,""),e=ZPe(s)),e.length<=t))return e;var c="";if(s.host&&(c+=s.host),c.length>=o)return s.host.length===t?(s.host.substr(0,t-r)+n).substr(0,o+i):xie(c,o,n).substr(0,o+i);var u="";if(s.path&&(u+="/"+s.path),s.query&&(u+="?"+s.query),u)if((c+u).length>=o){if((c+u).length==t)return(c+u).substr(0,t);var f=o-c.length;return(c+xie(u,f,n)).substr(0,o+i)}else c+=u;if(s.fragment){var d="#"+s.fragment;if((c+d).length>=o){if((c+d).length==t)return(c+d).substr(0,t);var p=o-c.length;return(c+xie(d,p,n)).substr(0,o+i)}else c+=d}if(s.scheme&&s.host){var g=s.scheme+"://";if((c+g).length<o)return(g+c).substr(0,t)}if(c.length<=t)return c;var m="";return o>0&&(m=c.substr(-1*Math.floor(o/2))),(c.substr(0,Math.ceil(o/2))+n+m).substr(0,o+i)}function DCt(e){var t={},n=e,i=n.match(/^([a-z]+):\/\//i);return i&&(t.scheme=i[1],n=n.slice(i[0].length)),i=n.match(/^(.*?)(?=(\?|#|\/|$))/i),i&&(t.host=i[1],n=n.slice(i[0].length)),i=n.match(/^\/(.*?)(?=(\?|#|$))/i),i&&(t.path=i[1],n=n.slice(i[0].length)),i=n.match(/^\?(.*?)(?=(#|$))/i),i&&(t.query=i[1],n=n.slice(i[0].length)),i=n.match(/^#(.*?)$/i),i&&(t.fragment=i[1]),t}function ZPe(e){var t="";return e.scheme&&e.host&&(t+=e.scheme+"://"),e.host&&(t+=e.host),e.path&&(t+="/"+e.path),e.query&&(t+="?"+e.query),e.fragment&&(t+="#"+e.fragment),t}function xie(e,t,n){var i=t/2,r=Math.ceil(i),o=-1*Math.floor(i),s="";return o<0&&(s=e.substr(o)),e.substr(0,r)+n+s}function eDe(e,t,n){if(e.length<=t)return e;var i,r;n==null?(n="…",i=8,r=3):(i=n.length,r=n.length);var o=t-r,s="";return o>0&&(s=e.substr(-1*Math.floor(o/2))),(e.substr(0,Math.ceil(o/2))+n+s).substr(0,o+i)}function tDe(e,t,n){return JPe(e,t,n)}var nDe=(function(){function e(t){t===void 0&&(t={}),this.newWindow=!1,this.truncate={},this.className="",this.newWindow=t.newWindow||!1,this.truncate=t.truncate||{},this.className=t.className||""}return e.prototype.build=function(t){return new cH({tagName:"a",attrs:this.createAttrs(t),innerHtml:this.processAnchorText(t.getAnchorText())})},e.prototype.createAttrs=function(t){var n={href:t.getAnchorHref()},i=this.createCssClass(t);return i&&(n.class=i),this.newWindow&&(n.target="_blank",n.rel="noopener noreferrer"),this.truncate.length&&this.truncate.length<t.getAnchorText().length&&(n.title=t.getAnchorHref()),n},e.prototype.createCssClass=function(t){var n=this.className;if(n){for(var i=[n],r=t.getCssClassSuffixes(),o=0,s=r.length;o<s;o++)i.push(n+"-"+r[o]);return i.join(" ")}else return""},e.prototype.processAnchorText=function(t){return t=this.doTruncate(t),t},e.prototype.doTruncate=function(t){var n=this.truncate;if(!n.length)return t;var i=n.length,r=n.location;return r==="smart"?QPe(t,i):r==="middle"?eDe(t,i):tDe(t,i)},e})();var e0=(function(){function e(t){this._=null,this.matchedText="",this.offset=0,this.tagBuilder=t.tagBuilder,this.matchedText=t.matchedText,this.offset=t.offset}return e.prototype.getMatchedText=function(){return this.matchedText},e.prototype.setOffset=function(t){this.offset=t},e.prototype.getOffset=function(){return this.offset},e.prototype.getCssClassSuffixes=function(){return[this.type]},e.prototype.buildTag=function(){return this.tagBuilder.build(this)},e})();function iDe(e){return e>=0&&e<=31||e==127}function Kg(e){return e>=65&&e<=90||e>=97&&e<=122}function Qs(e){return e>=48&&e<=57}function lH(e){return e==34||e==39}function DA(e){return e<8232?e<160?e>=9&&e<=13||e==32:e<5760?e==160:e==5760||e>=8192&&e<=8202:e<8287?e>=8232&&e<=8233||e==8239:e<12288?e==8287:e==12288||e==65279}function dm(e){return e<4800?e<2949?e<2451?e<1425?e<768?e<192?e<169?e<65?e>=48&&e<=57:e>=65&&e<=90||e>=97&&e<=122:e<181?e>=169&&e<=170||e==174:e==181||e==186:e<710?e<216?e>=192&&e<=214:e>=216&&e<=246||e>=248&&e<=705:e<748?e>=710&&e<=721||e>=736&&e<=740:e==748||e==750:e<910?e<895?e<886?e>=768&&e<=884:e>=886&&e<=887||e>=890&&e<=893:e<904?e==895||e==902:e>=904&&e<=906||e==908:e<1155?e<931?e>=910&&e<=929:e>=931&&e<=1013||e>=1015&&e<=1153:e<1369?e>=1155&&e<=1327||e>=1329&&e<=1366:e==1369||e>=1377&&e<=1415:e<1808?e<1552?e<1476?e<1471?e>=1425&&e<=1469:e==1471||e>=1473&&e<=1474:e<1488?e>=1476&&e<=1477||e==1479:e>=1488&&e<=1514||e>=1520&&e<=1522:e<1749?e<1568?e>=1552&&e<=1562:e>=1568&&e<=1641||e>=1646&&e<=1747:e<1770?e>=1749&&e<=1756||e>=1759&&e<=1768:e>=1770&&e<=1788||e==1791:e<2230?e<2042?e<1869?e>=1808&&e<=1866:e>=1869&&e<=1969||e>=1984&&e<=2037:e<2112?e==2042||e>=2048&&e<=2093:e>=2112&&e<=2139||e>=2208&&e<=2228:e<2406?e<2260?e>=2230&&e<=2237:e>=2260&&e<=2273||e>=2275&&e<=2403:e<2437?e>=2406&&e<=2415||e>=2417&&e<=2435:e>=2437&&e<=2444||e>=2447&&e<=2448:e<2693?e<2579?e<2519?e<2486?e<2474?e>=2451&&e<=2472:e>=2474&&e<=2480||e==2482:e<2503?e>=2486&&e<=2489||e>=2492&&e<=2500:e>=2503&&e<=2504||e>=2507&&e<=2510:e<2534?e<2524?e==2519:e>=2524&&e<=2525||e>=2527&&e<=2531:e<2565?e>=2534&&e<=2545||e>=2561&&e<=2563:e>=2565&&e<=2570||e>=2575&&e<=2576:e<2631?e<2613?e<2602?e>=2579&&e<=2600:e>=2602&&e<=2608||e>=2610&&e<=2611:e<2620?e>=2613&&e<=2614||e>=2616&&e<=2617:e==2620||e>=2622&&e<=2626:e<2649?e<2635?e>=2631&&e<=2632:e>=2635&&e<=2637||e==2641:e<2662?e>=2649&&e<=2652||e==2654:e>=2662&&e<=2677||e>=2689&&e<=2691:e<2821?e<2759?e<2730?e<2703?e>=2693&&e<=2701:e>=2703&&e<=2705||e>=2707&&e<=2728:e<2741?e>=2730&&e<=2736||e>=2738&&e<=2739:e>=2741&&e<=2745||e>=2748&&e<=2757:e<2784?e<2763?e>=2759&&e<=2761:e>=2763&&e<=2765||e==2768:e<2809?e>=2784&&e<=2787||e>=2790&&e<=2799:e==2809||e>=2817&&e<=2819:e<2887?e<2858?e<2831?e>=2821&&e<=2828:e>=2831&&e<=2832||e>=2835&&e<=2856:e<2869?e>=2858&&e<=2864||e>=2866&&e<=2867:e>=2869&&e<=2873||e>=2876&&e<=2884:e<2911?e<2902?e>=2887&&e<=2888||e>=2891&&e<=2893:e>=2902&&e<=2903||e>=2908&&e<=2909:e<2929?e>=2911&&e<=2915||e>=2918&&e<=2927:e==2929||e>=2946&&e<=2947:e<3517?e<3205?e<3046?e<2984?e<2969?e<2958?e>=2949&&e<=2954:e>=2958&&e<=2960||e>=2962&&e<=2965:e<2974?e>=2969&&e<=2970||e==2972:e>=2974&&e<=2975||e>=2979&&e<=2980:e<3014?e<2990?e>=2984&&e<=2986:e>=2990&&e<=3001||e>=3006&&e<=3010:e<3024?e>=3014&&e<=3016||e>=3018&&e<=3021:e==3024||e==3031:e<3142?e<3086?e<3072?e>=3046&&e<=3055:e>=3072&&e<=3075||e>=3077&&e<=3084:e<3114?e>=3086&&e<=3088||e>=3090&&e<=3112:e>=3114&&e<=3129||e>=3133&&e<=3140:e<3160?e<3146?e>=3142&&e<=3144:e>=3146&&e<=3149||e>=3157&&e<=3158:e<3174?e>=3160&&e<=3162||e>=3168&&e<=3171:e>=3174&&e<=3183||e>=3200&&e<=3203:e<3333?e<3274?e<3242?e<3214?e>=3205&&e<=3212:e>=3214&&e<=3216||e>=3218&&e<=3240:e<3260?e>=3242&&e<=3251||e>=3253&&e<=3257:e>=3260&&e<=3268||e>=3270&&e<=3272:e<3296?e<3285?e>=3274&&e<=3277:e>=3285&&e<=3286||e==3294:e<3313?e>=3296&&e<=3299||e>=3302&&e<=3311:e>=3313&&e<=3314||e>=3329&&e<=3331:e<3423?e<3389?e<3342?e>=3333&&e<=3340:e>=3342&&e<=3344||e>=3346&&e<=3386:e<3402?e>=3389&&e<=3396||e>=3398&&e<=3400:e>=3402&&e<=3406||e>=3412&&e<=3415:e<3458?e<3430?e>=3423&&e<=3427:e>=3430&&e<=3439||e>=3450&&e<=3455:e<3482?e>=3458&&e<=3459||e>=3461&&e<=3478:e>=3482&&e<=3505||e>=3507&&e<=3515:e<3804?e<3722?e<3570?e<3535?e<3520?e==3517:e>=3520&&e<=3526||e==3530:e<3544?e>=3535&&e<=3540||e==3542:e>=3544&&e<=3551||e>=3558&&e<=3567:e<3664?e<3585?e>=3570&&e<=3571:e>=3585&&e<=3642||e>=3648&&e<=3662:e<3716?e>=3664&&e<=3673||e>=3713&&e<=3714:e==3716||e>=3719&&e<=3720:e<3754?e<3737?e<3725?e==3722:e==3725||e>=3732&&e<=3735:e<3749?e>=3737&&e<=3743||e>=3745&&e<=3747:e==3749||e==3751:e<3776?e<3757?e>=3754&&e<=3755:e>=3757&&e<=3769||e>=3771&&e<=3773:e<3784?e>=3776&&e<=3780||e==3782:e>=3784&&e<=3789||e>=3792&&e<=3801:e<4176?e<3902?e<3872?e<3840?e>=3804&&e<=3807:e==3840||e>=3864&&e<=3865:e<3895?e>=3872&&e<=3881||e==3893:e==3895||e==3897:e<3974?e<3913?e>=3902&&e<=3911:e>=3913&&e<=3948||e>=3953&&e<=3972:e<4038?e>=3974&&e<=3991||e>=3993&&e<=4028:e==4038||e>=4096&&e<=4169:e<4688?e<4301?e<4256?e>=4176&&e<=4253:e>=4256&&e<=4293||e==4295:e<4348?e==4301||e>=4304&&e<=4346:e>=4348&&e<=4680||e>=4682&&e<=4685:e<4746?e<4698?e>=4688&&e<=4694||e==4696:e>=4698&&e<=4701||e>=4704&&e<=4744:e<4786?e>=4746&&e<=4749||e>=4752&&e<=4784:e>=4786&&e<=4789||e>=4792&&e<=4798:e<11035?e<7416?e<6176?e<5873?e<4992?e<4824?e<4802?e==4800:e>=4802&&e<=4805||e>=4808&&e<=4822:e<4888?e>=4824&&e<=4880||e>=4882&&e<=4885:e>=4888&&e<=4954||e>=4957&&e<=4959:e<5121?e<5024?e>=4992&&e<=5007:e>=5024&&e<=5109||e>=5112&&e<=5117:e<5761?e>=5121&&e<=5740||e>=5743&&e<=5759:e>=5761&&e<=5786||e>=5792&&e<=5866:e<6002?e<5920?e<5888?e>=5873&&e<=5880:e>=5888&&e<=5900||e>=5902&&e<=5908:e<5984?e>=5920&&e<=5940||e>=5952&&e<=5971:e>=5984&&e<=5996||e>=5998&&e<=6e3:e<6108?e<6016?e>=6002&&e<=6003:e>=6016&&e<=6099||e==6103:e<6155?e>=6108&&e<=6109||e>=6112&&e<=6121:e>=6155&&e<=6157||e>=6160&&e<=6169:e<6783?e<6512?e<6400?e<6272?e>=6176&&e<=6263:e>=6272&&e<=6314||e>=6320&&e<=6389:e<6448?e>=6400&&e<=6430||e>=6432&&e<=6443:e>=6448&&e<=6459||e>=6470&&e<=6509:e<6608?e<6528?e>=6512&&e<=6516:e>=6528&&e<=6571||e>=6576&&e<=6601:e<6688?e>=6608&&e<=6617||e>=6656&&e<=6683:e>=6688&&e<=6750||e>=6752&&e<=6780:e<7040?e<6832?e<6800?e>=6783&&e<=6793:e>=6800&&e<=6809||e==6823:e<6992?e>=6832&&e<=6846||e>=6912&&e<=6987:e>=6992&&e<=7001||e>=7019&&e<=7027:e<7245?e<7168?e>=7040&&e<=7155:e>=7168&&e<=7223||e>=7232&&e<=7241:e<7376?e>=7245&&e<=7293||e>=7296&&e<=7304:e>=7376&&e<=7378||e>=7380&&e<=7414:e<8450?e<8130?e<8025?e<7960?e<7424?e>=7416&&e<=7417:e>=7424&&e<=7669||e>=7675&&e<=7957:e<8008?e>=7960&&e<=7965||e>=7968&&e<=8005:e>=8008&&e<=8013||e>=8016&&e<=8023:e<8031?e<8027?e==8025:e==8027||e==8029:e<8118?e>=8031&&e<=8061||e>=8064&&e<=8116:e>=8118&&e<=8124||e==8126:e<8205?e<8150?e<8134?e>=8130&&e<=8132:e>=8134&&e<=8140||e>=8144&&e<=8147:e<8178?e>=8150&&e<=8155||e>=8160&&e<=8172:e>=8178&&e<=8180||e>=8182&&e<=8188:e<8305?e<8252?e==8205:e==8252||e==8265:e<8336?e==8305||e==8319:e>=8336&&e<=8348||e>=8400&&e<=8432:e<8579?e<8486?e<8469?e<8455?e==8450:e==8455||e>=8458&&e<=8467:e<8482?e==8469||e>=8473&&e<=8477:e==8482||e==8484:e<8495?e<8488?e==8486:e==8488||e>=8490&&e<=8493:e<8517?e>=8495&&e<=8505||e>=8508&&e<=8511:e>=8517&&e<=8521||e==8526:e<9410?e<9e3?e<8592?e>=8579&&e<=8580:e>=8592&&e<=8703||e>=8986&&e<=8987:e<9193?e==9e3||e==9167:e>=9193&&e<=9203||e>=9208&&e<=9210:e<9723?e<9654?e==9410||e>=9642&&e<=9643:e==9654||e==9664:e<10548?e>=9723&&e<=9726||e>=9728&&e<=10175:e>=10548&&e<=10549||e>=11013&&e<=11015:e<43259?e<12445?e<11688?e<11520?e<11264?e<11088?e>=11035&&e<=11036:e==11088||e==11093:e<11360?e>=11264&&e<=11310||e>=11312&&e<=11358:e>=11360&&e<=11492||e>=11499&&e<=11507:e<11568?e<11559?e>=11520&&e<=11557:e==11559||e==11565:e<11647?e>=11568&&e<=11623||e==11631:e>=11647&&e<=11670||e>=11680&&e<=11686:e<11744?e<11712?e<11696?e>=11688&&e<=11694:e>=11696&&e<=11702||e>=11704&&e<=11710:e<11728?e>=11712&&e<=11718||e>=11720&&e<=11726:e>=11728&&e<=11734||e>=11736&&e<=11742:e<12330?e<11823?e>=11744&&e<=11775:e==11823||e>=12293&&e<=12294:e<12353?e>=12330&&e<=12341||e>=12347&&e<=12349:e>=12353&&e<=12438||e>=12441&&e<=12442:e<42512?e<12951?e<12549?e<12449?e>=12445&&e<=12447:e>=12449&&e<=12538||e>=12540&&e<=12543:e<12704?e>=12549&&e<=12589||e>=12593&&e<=12686:e>=12704&&e<=12730||e>=12784&&e<=12799:e<19968?e<12953?e==12951:e==12953||e>=13312&&e<=19893:e<42192?e>=19968&&e<=40917||e>=40960&&e<=42124:e>=42192&&e<=42237||e>=42240&&e<=42508:e<42891?e<42623?e<42560?e>=42512&&e<=42539:e>=42560&&e<=42610||e>=42612&&e<=42621:e<42775?e>=42623&&e<=42725||e>=42736&&e<=42737:e>=42775&&e<=42783||e>=42786&&e<=42888:e<43072?e<42928?e>=42891&&e<=42926:e>=42928&&e<=42935||e>=42999&&e<=43047:e<43216?e>=43072&&e<=43123||e>=43136&&e<=43205:e>=43216&&e<=43225||e>=43232&&e<=43255:e<55243?e<43744?e<43488?e<43312?e<43261?e==43259:e==43261||e>=43264&&e<=43309:e<43392?e>=43312&&e<=43347||e>=43360&&e<=43388:e>=43392&&e<=43456||e>=43471&&e<=43481:e<43600?e<43520?e>=43488&&e<=43518:e>=43520&&e<=43574||e>=43584&&e<=43597:e<43642?e>=43600&&e<=43609||e>=43616&&e<=43638:e>=43642&&e<=43714||e>=43739&&e<=43741:e<43824?e<43785?e<43762?e>=43744&&e<=43759:e>=43762&&e<=43766||e>=43777&&e<=43782:e<43808?e>=43785&&e<=43790||e>=43793&&e<=43798:e>=43808&&e<=43814||e>=43816&&e<=43822:e<44012?e<43868?e>=43824&&e<=43866:e>=43868&&e<=43877||e>=43888&&e<=44010:e<44032?e>=44012&&e<=44013||e>=44016&&e<=44025:e>=44032&&e<=55203||e>=55216&&e<=55238:e<64848?e<64298?e<64112?e<55296?e>=55243&&e<=55291:e>=55296&&e<=57343||e>=63744&&e<=64109:e<64275?e>=64112&&e<=64217||e>=64256&&e<=64262:e>=64275&&e<=64279||e>=64285&&e<=64296:e<64320?e<64312?e>=64298&&e<=64310:e>=64312&&e<=64316||e==64318:e<64326?e>=64320&&e<=64321||e>=64323&&e<=64324:e>=64326&&e<=64433||e>=64467&&e<=64829:e<65296?e<65024?e<64914?e>=64848&&e<=64911:e>=64914&&e<=64967||e>=65008&&e<=65019:e<65136?e>=65024&&e<=65039||e>=65056&&e<=65071:e>=65136&&e<=65140||e>=65142&&e<=65276:e<65474?e<65345?e>=65296&&e<=65305||e>=65313&&e<=65338:e>=65345&&e<=65370||e>=65382&&e<=65470:e<65490?e>=65474&&e<=65479||e>=65482&&e<=65487:e>=65490&&e<=65495||e>=65498&&e<=65500}function rDe(e){return e<47?e<42?e==33||e>=35&&e<=39:e>=42&&e<=43||e==45:e<63?e==47||e==61:e<94?e==63:e>=94&&e<=96||e>=123&&e<=126}function oDe(e){return e<91?e<47?e>=35&&e<=43||e==45:e<61?e==47:e==61||e==64:e<95?e==91||e==93:e<123?e==95:e>=123&&e<=126||e==10003}function uH(e){return e<58?e<44?e==33:e==44||e==46:e<63?e>=58&&e<=59:e==63||e==94}function sDe(e){return e<91?e==40:e==91||e==123}function Tie(e){return e<93?e==41:e==93||e==125}var aDe=/^(?:xn--vermgensberatung-pwb|xn--vermgensberater-ctb|xn--clchc0ea0b2g2a9gcd|xn--w4r85el8fhu5dnra|travelersinsurance|vermögensberatung|xn--5su34j936bgsg|xn--bck1b9a5dre4c|xn--mgbah1a3hjkrd|xn--mgbai9azgqp6j|xn--mgberp4a5d4ar|xn--xkc2dl3a5ee0h|vermögensberater|xn--fzys8d69uvgm|xn--mgba7c0bbn0a|xn--mgbcpq6gpa1a|xn--xkc2al3hye2a|americanexpress|kerryproperties|sandvikcoromant|xn--i1b6b1a6a2e|xn--kcrx77d1x4a|xn--lgbbat1ad8j|xn--mgba3a4f16a|xn--mgbc0a9azcg|xn--nqv7fs00ema|americanfamily|weatherchannel|xn--54b7fta0cc|xn--6qq986b3xl|xn--80aqecdr1a|xn--b4w605ferd|xn--fiq228c5hs|xn--h2breg3eve|xn--jlq480n2rg|xn--mgba3a3ejt|xn--mgbaam7a8h|xn--mgbayh7gpa|xn--mgbbh1a71e|xn--mgbca7dzdo|xn--mgbi4ecexp|xn--mgbx4cd0ab|xn--rvc1e0am3e|international|lifeinsurance|wolterskluwer|xn--cckwcxetd|xn--eckvdtc9d|xn--fpcrj9c3d|xn--fzc2c9e2c|xn--h2brj9c8c|xn--tiq49xqyj|xn--yfro4i67o|xn--ygbi2ammx|construction|lplfinancial|scholarships|versicherung|xn--3e0b707e|xn--45br5cyl|xn--4dbrk0ce|xn--80adxhks|xn--80asehdb|xn--8y0a063a|xn--gckr3f0f|xn--mgb9awbf|xn--mgbab2bd|xn--mgbgu82a|xn--mgbpl2fh|xn--mgbt3dhd|xn--mk1bu44c|xn--ngbc5azd|xn--ngbe9e0a|xn--ogbpf8fl|xn--qcka1pmc|accountants|barclaycard|blackfriday|blockbuster|bridgestone|calvinklein|contractors|creditunion|engineering|enterprises|investments|kerryhotels|lamborghini|motorcycles|olayangroup|photography|playstation|productions|progressive|redumbrella|williamhill|xn--11b4c3d|xn--1ck2e1b|xn--1qqw23a|xn--2scrj9c|xn--3bst00m|xn--3ds443g|xn--3hcrj9c|xn--42c2d9a|xn--45brj9c|xn--55qw42g|xn--6frz82g|xn--80ao21a|xn--9krt00a|xn--cck2b3b|xn--czr694b|xn--d1acj3b|xn--efvy88h|xn--fct429k|xn--fjq720a|xn--flw351e|xn--g2xx48c|xn--gecrj9c|xn--gk3at1e|xn--h2brj9c|xn--hxt814e|xn--imr513n|xn--j6w193g|xn--jvr189m|xn--kprw13d|xn--kpry57d|xn--mgbbh1a|xn--mgbtx2b|xn--mix891f|xn--nyqy26a|xn--otu796d|xn--pgbs0dh|xn--q9jyb4c|xn--rhqv96g|xn--rovu88b|xn--s9brj9c|xn--ses554g|xn--t60b56a|xn--vuq861b|xn--w4rs40l|xn--xhq521b|xn--zfr164b|சிங்கப்பூர்|accountant|apartments|associates|basketball|bnpparibas|boehringer|capitalone|consulting|creditcard|cuisinella|eurovision|extraspace|foundation|healthcare|immobilien|industries|management|mitsubishi|nextdirect|properties|protection|prudential|realestate|republican|restaurant|schaeffler|tatamotors|technology|university|vlaanderen|xn--30rr7y|xn--3pxu8k|xn--45q11c|xn--4gbrim|xn--55qx5d|xn--5tzm5g|xn--80aswg|xn--90a3ac|xn--9dbq2a|xn--9et52u|xn--c2br7g|xn--cg4bki|xn--czrs0t|xn--czru2d|xn--fiq64b|xn--fiqs8s|xn--fiqz9s|xn--io0a7i|xn--kput3i|xn--mxtq1m|xn--o3cw4h|xn--pssy2u|xn--q7ce6a|xn--unup4y|xn--wgbh1c|xn--wgbl6a|xn--y9a3aq|accenture|allfinanz|amsterdam|analytics|aquarelle|barcelona|bloomberg|christmas|community|directory|education|equipment|fairwinds|financial|firestone|fresenius|furniture|goldpoint|hisamitsu|homedepot|homegoods|homesense|institute|insurance|kuokgroup|landrover|lifestyle|marketing|marshalls|melbourne|microsoft|panasonic|pramerica|richardli|shangrila|solutions|statebank|statefarm|stockholm|travelers|vacations|xn--90ais|xn--c1avg|xn--d1alf|xn--e1a4c|xn--fhbei|xn--j1aef|xn--j1amh|xn--l1acc|xn--ngbrx|xn--nqv7f|xn--p1acf|xn--qxa6a|xn--tckwe|xn--vhquv|yodobashi|موريتانيا|abudhabi|airforce|allstate|attorney|barclays|barefoot|bargains|baseball|boutique|bradesco|broadway|brussels|builders|business|capetown|catering|catholic|cipriani|cleaning|clinique|clothing|commbank|computer|delivery|deloitte|democrat|diamonds|discount|discover|download|engineer|ericsson|exchange|feedback|fidelity|firmdale|football|frontier|goodyear|grainger|graphics|hdfcbank|helsinki|holdings|hospital|infiniti|ipiranga|istanbul|jpmorgan|lighting|lundbeck|marriott|mckinsey|memorial|merckmsd|mortgage|observer|partners|pharmacy|pictures|plumbing|property|redstone|reliance|saarland|samsclub|security|services|shopping|softbank|software|stcgroup|supplies|training|vanguard|ventures|verisign|woodside|xn--90ae|xn--node|xn--p1ai|xn--qxam|yokohama|السعودية|abogado|academy|agakhan|alibaba|android|athleta|auction|audible|auspost|banamex|bauhaus|bestbuy|booking|brother|capital|caravan|careers|channel|charity|chintai|citadel|clubmed|college|cologne|company|compare|contact|cooking|corsica|country|coupons|courses|cricket|cruises|dentist|digital|domains|exposed|express|farmers|fashion|ferrari|ferrero|finance|fishing|fitness|flights|florist|flowers|forsale|frogans|fujitsu|gallery|genting|godaddy|grocery|guitars|hamburg|hangout|hitachi|holiday|hosting|hotmail|hyundai|ismaili|jewelry|juniper|kitchen|komatsu|lacaixa|lanxess|lasalle|latrobe|leclerc|limited|lincoln|markets|monster|netbank|netflix|network|neustar|okinawa|organic|origins|philips|pioneer|politie|realtor|recipes|rentals|reviews|rexroth|samsung|sandvik|schmidt|schwarz|science|shiksha|singles|staples|storage|support|surgery|systems|temasek|theater|theatre|tickets|toshiba|trading|walmart|wanggou|watches|weather|website|wedding|whoswho|windows|winners|yamaxun|youtube|zuerich|католик|البحرين|الجزائر|العليان|پاکستان|كاثوليك|இந்தியா|abbott|abbvie|africa|agency|airbus|airtel|alipay|alsace|alstom|amazon|anquan|aramco|author|bayern|beauty|berlin|bharti|bostik|boston|broker|camera|career|casino|center|chanel|chrome|church|circle|claims|clinic|coffee|comsec|condos|coupon|credit|cruise|dating|datsun|dealer|degree|dental|design|direct|doctor|dunlop|dupont|durban|emerck|energy|estate|events|expert|family|flickr|futbol|gallup|garden|george|giving|global|google|gratis|health|hermes|hiphop|hockey|hotels|hughes|imamat|insure|intuit|jaguar|joburg|juegos|kaufen|kindle|kosher|latino|lawyer|lefrak|living|locker|london|luxury|madrid|maison|makeup|market|mattel|mobile|monash|mormon|moscow|museum|nagoya|nissan|nissay|norton|nowruz|office|olayan|online|oracle|orange|otsuka|pfizer|photos|physio|pictet|quebec|racing|realty|reisen|repair|report|review|rogers|ryukyu|safety|sakura|sanofi|school|schule|search|secure|select|shouji|soccer|social|stream|studio|supply|suzuki|swatch|sydney|taipei|taobao|target|tattoo|tennis|tienda|tjmaxx|tkmaxx|toyota|travel|unicom|viajes|viking|villas|virgin|vision|voting|voyage|walter|webcam|xihuan|yachts|yandex|zappos|москва|онлайн|ابوظبي|ارامكو|الاردن|المغرب|امارات|فلسطين|مليسيا|भारतम्|இலங்கை|ファッション|actor|adult|aetna|amfam|amica|apple|archi|audio|autos|azure|baidu|beats|bible|bingo|black|boats|bosch|build|canon|cards|chase|cheap|cisco|citic|click|cloud|coach|codes|crown|cymru|dance|deals|delta|drive|dubai|earth|edeka|email|epson|faith|fedex|final|forex|forum|gallo|games|gifts|gives|glass|globo|gmail|green|gripe|group|gucci|guide|homes|honda|horse|house|hyatt|ikano|irish|jetzt|koeln|kyoto|lamer|lease|legal|lexus|lilly|loans|locus|lotte|lotto|mango|media|miami|money|movie|music|nexus|nikon|ninja|nokia|nowtv|omega|osaka|paris|parts|party|phone|photo|pizza|place|poker|praxi|press|prime|promo|quest|radio|rehab|reise|ricoh|rocks|rodeo|rugby|salon|sener|seven|sharp|shell|shoes|skype|sling|smart|smile|solar|space|sport|stada|store|study|style|sucks|swiss|tatar|tires|tirol|tmall|today|tokyo|tools|toray|total|tours|trade|trust|tunes|tushu|ubank|vegas|video|vodka|volvo|wales|watch|weber|weibo|works|world|xerox|yahoo|ישראל|ایران|بازار|بھارت|سودان|سورية|همراه|भारोत|संगठन|বাংলা|భారత్|ഭാരതം|嘉里大酒店|aarp|able|aero|akdn|ally|amex|arab|army|arpa|arte|asda|asia|audi|auto|baby|band|bank|bbva|beer|best|bike|bing|blog|blue|bofa|bond|book|buzz|cafe|call|camp|care|cars|casa|case|cash|cbre|cern|chat|citi|city|club|cool|coop|cyou|data|date|dclk|deal|dell|desi|diet|dish|docs|dvag|erni|fage|fail|fans|farm|fast|fido|film|fire|fish|flir|food|ford|free|fund|game|gbiz|gent|ggee|gift|gmbh|gold|golf|goog|guge|guru|hair|haus|hdfc|help|here|host|hsbc|icbc|ieee|imdb|immo|info|itau|java|jeep|jobs|jprs|kddi|kids|kiwi|kpmg|kred|land|lego|lgbt|lidl|life|like|limo|link|live|loan|love|ltda|luxe|maif|meet|meme|menu|mini|mint|mobi|moda|moto|name|navy|news|next|nico|nike|ollo|open|page|pars|pccw|pics|ping|pink|play|plus|pohl|porn|post|prod|prof|qpon|read|reit|rent|rest|rich|room|rsvp|ruhr|safe|sale|sarl|save|saxo|scot|seat|seek|sexy|shia|shop|show|silk|sina|site|skin|sncf|sohu|song|sony|spot|star|surf|talk|taxi|team|tech|teva|tiaa|tips|town|toys|tube|vana|visa|viva|vivo|vote|voto|wang|weir|wien|wiki|wine|work|xbox|yoga|zara|zero|zone|дети|сайт|بارت|بيتك|ڀارت|تونس|شبكة|عراق|عمان|موقع|भारत|ভারত|ভাৰত|ਭਾਰਤ|ભારત|ଭାରତ|ಭಾರತ|ලංකා|アマゾン|グーグル|クラウド|ポイント|组织机构|電訊盈科|香格里拉|aaa|abb|abc|aco|ads|aeg|afl|aig|anz|aol|app|art|aws|axa|bar|bbc|bbt|bcg|bcn|bet|bid|bio|biz|bms|bmw|bom|boo|bot|box|buy|bzh|cab|cal|cam|car|cat|cba|cbn|ceo|cfa|cfd|com|cpa|crs|dad|day|dds|dev|dhl|diy|dnp|dog|dot|dtv|dvr|eat|eco|edu|esq|eus|fan|fit|fly|foo|fox|frl|ftr|fun|fyi|gal|gap|gay|gdn|gea|gle|gmo|gmx|goo|gop|got|gov|hbo|hiv|hkt|hot|how|ibm|ice|icu|ifm|inc|ing|ink|int|ist|itv|jcb|jio|jll|jmp|jnj|jot|joy|kfh|kia|kim|kpn|krd|lat|law|lds|llc|llp|lol|lpl|ltd|man|map|mba|med|men|mil|mit|mlb|mls|mma|moe|moi|mom|mov|msd|mtn|mtr|nab|nba|nec|net|new|nfl|ngo|nhk|now|nra|nrw|ntt|nyc|obi|one|ong|onl|ooo|org|ott|ovh|pay|pet|phd|pid|pin|pnc|pro|pru|pub|pwc|red|ren|ril|rio|rip|run|rwe|sap|sas|sbi|sbs|scb|sew|sex|sfr|ski|sky|soy|spa|srl|stc|tab|tax|tci|tdk|tel|thd|tjx|top|trv|tui|tvs|ubs|uno|uol|ups|vet|vig|vin|vip|wed|win|wme|wow|wtc|wtf|xin|xxx|xyz|you|yun|zip|бел|ком|қаз|мкд|мон|орг|рус|срб|укр|հայ|קום|عرب|قطر|كوم|مصر|कॉम|नेट|คอม|ไทย|ລາວ|ストア|セール|みんな|中文网|亚马逊|天主教|我爱你|新加坡|淡马锡|飞利浦|ac|ad|ae|af|ag|ai|al|am|ao|aq|ar|as|at|au|aw|ax|az|ba|bb|bd|be|bf|bg|bh|bi|bj|bm|bn|bo|br|bs|bt|bv|bw|by|bz|ca|cc|cd|cf|cg|ch|ci|ck|cl|cm|cn|co|cr|cu|cv|cw|cx|cy|cz|de|dj|dk|dm|do|dz|ec|ee|eg|er|es|et|eu|fi|fj|fk|fm|fo|fr|ga|gb|gd|ge|gf|gg|gh|gi|gl|gm|gn|gp|gq|gr|gs|gt|gu|gw|gy|hk|hm|hn|hr|ht|hu|id|ie|il|im|in|io|iq|ir|is|it|je|jm|jo|jp|ke|kg|kh|ki|km|kn|kp|kr|kw|ky|kz|la|lb|lc|li|lk|lr|ls|lt|lu|lv|ly|ma|mc|md|me|mg|mh|mk|ml|mm|mn|mo|mp|mq|mr|ms|mt|mu|mv|mw|mx|my|mz|na|nc|ne|nf|ng|ni|nl|no|np|nr|nu|nz|om|pa|pe|pf|pg|ph|pk|pl|pm|pn|pr|ps|pt|pw|py|qa|re|ro|rs|ru|rw|sa|sb|sc|sd|se|sg|sh|si|sj|sk|sl|sm|sn|so|sr|ss|st|su|sv|sx|sy|sz|tc|td|tf|tg|th|tj|tk|tl|tm|tn|to|tr|tt|tv|tw|tz|ua|ug|uk|us|uy|uz|va|vc|ve|vg|vi|vn|vu|wf|ws|ye|yt|za|zm|zw|ελ|ευ|бг|ею|рф|გე|닷넷|닷컴|삼성|한국|コム|世界|中信|中国|中國|企业|佛山|信息|健康|八卦|公司|公益|台湾|台灣|商城|商店|商标|嘉里|在线|大拿|娱乐|家電|广东|微博|慈善|手机|招聘|政务|政府|新闻|时尚|書籍|机构|游戏|澳門|点看|移动|网址|网店|网站|网络|联通|谷歌|购物|通販|集团|食品|餐厅|香港)$/;var Eie=/https?:\/\//i,cDe=new RegExp("^"+Eie.source,"i"),RCt=/^(javascript|vbscript):/i,OCt=/^[A-Za-z][-.+A-Za-z0-9]*:(\/\/)?([^:/]*)/,MCt=/^(?:\/\/)?([^/#?:]+)/,Pw=Kg;function Cie(e){return Kg(e)||Qs(e)||e===43||e===45||e===46}var $g=dm;function fH(e){return e===95||$g(e)}function vie(e){return dm(e)||oDe(e)||uH(e)}function dH(e){return e===47||e===63||e===35}function Sie(e){return aDe.test(e.toLowerCase())}function lDe(e){if(RCt.test(e))return!1;var t=e.match(OCt);if(!t)return!1;var n=!!t[1],i=t[2];return n?!0:!(i.indexOf(".")===-1||!/[A-Za-z]/.test(i))}function uDe(e){var t=e.match(MCt);if(!t)return!1;var n=t[0],i=n.split(".");if(i.length<2)return!1;var r=i[i.length-1];return!!Sie(r)}var NCt=/^(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$/,LCt=/[:/?#]/;function fDe(e){var t=e.split(LCt,1)[0];return NCt.test(t)}var FCt=/^(https?:\/\/)?(?:www\.)?/i,BCt=/^\/\//,dDe=(function(e){Qp(t,e);function t(n){var i=e.call(this,n)||this;return i.type="url",i.url="",i.urlMatchType="scheme",i.protocolRelativeMatch=!1,i.stripPrefix={scheme:!0,www:!0},i.stripTrailingSlash=!0,i.decodePercentEncoding=!0,i.protocolPrepended=!1,i.urlMatchType=n.urlMatchType,i.url=n.url,i.protocolRelativeMatch=n.protocolRelativeMatch,i.stripPrefix=n.stripPrefix,i.stripTrailingSlash=n.stripTrailingSlash,i.decodePercentEncoding=n.decodePercentEncoding,i}return t.prototype.getType=function(){return"url"},t.prototype.getUrlMatchType=function(){return this.urlMatchType},t.prototype.getUrl=function(){var n=this.url;return!this.protocolRelativeMatch&&this.urlMatchType!=="scheme"&&!this.protocolPrepended&&(n=this.url="http://"+n,this.protocolPrepended=!0),n},t.prototype.getAnchorHref=function(){var n=this.getUrl();return n.replace(/&/g,"&")},t.prototype.getAnchorText=function(){var n=this.getMatchedText();return this.protocolRelativeMatch&&(n=zCt(n)),this.stripPrefix.scheme&&(n=kCt(n)),this.stripPrefix.www&&(n=UCt(n)),this.stripTrailingSlash&&(n=VCt(n)),this.decodePercentEncoding&&(n=jCt(n)),n},t})(e0);function kCt(e){return e.replace(cDe,"")}function UCt(e){return e.includes("www.")?e.replace(FCt,"$1"):e}function zCt(e){return e.replace(BCt,"")}function VCt(e){return e.charAt(e.length-1)==="/"&&(e=e.slice(0,-1)),e}function jCt(e){var t=e.replace(/%(?:22|26|27|3C|3E)/gi,function(n){return n==="%22"?""":n==="%26"?"&":n==="%27"?"'":n==="%3C"||n==="%3c"?"<":">"});if(t.includes("%"))try{return decodeURIComponent(t)}catch{}return t}var hDe=/^mailto:/i,wie=dm;function hH(e){return wie(e)||rDe(e)}function mDe(e){var t=e.split(".").pop();return Sie(t)}var pDe=(function(e){Qp(t,e);function t(n){var i=e.call(this,n)||this;return i.type="email",i.email="",i.email=n.email,i}return t.prototype.getType=function(){return"email"},t.prototype.getEmail=function(){return this.email},t.prototype.getAnchorHref=function(){return"mailto:"+this.email},t.prototype.getAnchorText=function(){return this.email},t})(e0);function Iie(e){return e===95||dm(e)}function gDe(e){return e.length<=140}var _De=["twitter","facebook","instagram","tiktok","youtube"];var yDe=(function(e){Qp(t,e);function t(n){var i=e.call(this,n)||this;return i.type="hashtag",i.serviceName="twitter",i.hashtag="",i.serviceName=n.serviceName,i.hashtag=n.hashtag,i}return t.prototype.getType=function(){return"hashtag"},t.prototype.getServiceName=function(){return this.serviceName},t.prototype.getHashtag=function(){return this.hashtag},t.prototype.getAnchorHref=function(){var n=this.serviceName,i=this.hashtag;switch(n){case"twitter":return"https://twitter.com/hashtag/"+i;case"facebook":return"https://www.facebook.com/hashtag/"+i;case"instagram":return"https://instagram.com/explore/tags/"+i;case"tiktok":return"https://www.tiktok.com/tag/"+i;case"youtube":return"https://youtube.com/hashtag/"+i;default:fm(n)}},t.prototype.getAnchorText=function(){return"#"+this.hashtag},t.prototype.getCssClassSuffixes=function(){var n=e.prototype.getCssClassSuffixes.call(this),i=this.getServiceName();return i&&n.push(i),n},t})(e0);var HCt={twitter:/^@\w{1,15}$/,instagram:/^@[_\w]{1,30}$/,soundcloud:/^@[-a-z0-9_]{3,25}$/,tiktok:/^@[.\w]{1,23}[\w]$/,youtube:/^@[-.·\w]{3,30}$/};function Pie(e){return e===45||e===46||e===95||Kg(e)||Qs(e)}function ADe(e,t){var n=HCt[t];return n.test(e)}var bDe=["twitter","instagram","soundcloud","tiktok","youtube"];var xDe=(function(e){Qp(t,e);function t(n){var i=e.call(this,n)||this;return i.type="mention",i.serviceName="twitter",i.mention="",i.mention=n.mention,i.serviceName=n.serviceName,i}return t.prototype.getType=function(){return"mention"},t.prototype.getMention=function(){return this.mention},t.prototype.getServiceName=function(){return this.serviceName},t.prototype.getAnchorHref=function(){switch(this.serviceName){case"twitter":return"https://twitter.com/"+this.mention;case"instagram":return"https://instagram.com/"+this.mention;case"soundcloud":return"https://soundcloud.com/"+this.mention;case"tiktok":return"https://www.tiktok.com/@"+this.mention;case"youtube":return"https://youtube.com/@"+this.mention;default:fm(this.serviceName)}},t.prototype.getAnchorText=function(){return"@"+this.mention},t.prototype.getCssClassSuffixes=function(){var n=e.prototype.getCssClassSuffixes.call(this),i=this.getServiceName();return i&&n.push(i),n},t})(e0);var GCt=/[-. ()]/,WCt=/(?:(?:(?:(\+)?\d{1,3}[-. ]?)?\(?\d{3}\)?[-. ]?\d{3}[-. ]?\d{4})|(?:(\+)(?:9[976]\d|8[987530]\d|6[987]\d|5[90]\d|42\d|3[875]\d|2[98654321]\d|9[8543210]|8[6421]|6[6543210]|5[87654321]|4[987654310]|3[9643210]|2[70]|7|1)[-. ]?(?:\d[-. ]?){6,12}\d+))([,;]+[0-9]+#?)*/,qCt=/(0([1-9]-?[1-9]\d{3}|[1-9]{2}-?\d{3}|[1-9]{2}\d{1}-?\d{2}|[1-9]{2}\d{2}-?\d{1})-?\d{4}|0[789]0-?\d{4}-?\d{4}|050-?\d{4}-?\d{4})/,YCt=new RegExp("^".concat(WCt.source,"|").concat(qCt.source,"$"));function Die(e){return e===45||e===46||e===32}function mH(e){return e===44||e===59}function TDe(e){var t=e.charAt(0)==="+"||GCt.test(e);return t&&YCt.test(e)}var EDe=(function(e){Qp(t,e);function t(n){var i=e.call(this,n)||this;return i.type="phone",i.number="",i.plusSign=!1,i.number=n.number,i.plusSign=n.plusSign,i}return t.prototype.getType=function(){return"phone"},t.prototype.getPhoneNumber=function(){return this.number},t.prototype.getNumber=function(){return this.getPhoneNumber()},t.prototype.getAnchorHref=function(){return"tel:"+(this.plusSign?"+":"")+this.number},t.prototype.getAnchorText=function(){return this.matchedText},t})(e0);var XCt=(function(){function e(t,n){this.charIdx=0,this.matches=[],this._stateMachines=[],this.schemeUrlMachinesCount=0,this.text=t,this.tagBuilder=n.tagBuilder,this.stripPrefix=n.stripPrefix,this.stripTrailingSlash=n.stripTrailingSlash,this.decodePercentEncoding=n.decodePercentEncoding,this.hashtagServiceName=n.hashtagServiceName,this.mentionServiceName=n.mentionServiceName}return Object.defineProperty(e.prototype,"stateMachines",{get:function(){return this._stateMachines},enumerable:!1,configurable:!0}),e.prototype.addMachine=function(t){this._stateMachines.push(t),vDe(t)&&this.schemeUrlMachinesCount++},e.prototype.removeMachine=function(t){this._stateMachines=this._stateMachines.filter(function(n){return n!==t}),vDe(t)&&this.schemeUrlMachinesCount--},e.prototype.hasSchemeUrlMachine=function(){return this.schemeUrlMachinesCount>0},e})();function SDe(e,t){for(var n=new XCt(e,t);n.charIdx<n.text.length;n.charIdx++){var i=e.charAt(n.charIdx),r=e.charCodeAt(n.charIdx);if(n.stateMachines.length===0)pH(n,i,r);else{for(var o=n.stateMachines.length-1;o>=0;o--){var s=n.stateMachines[o];switch(s.state){case 11:evt(n,s,r);break;case 12:tvt(n,s,r);break;case 0:KCt(n,s,r);break;case 1:$Ct(n,s,r);break;case 2:JCt(n,s,r);break;case 3:ZCt(n,s,r);break;case 4:QCt(n,s,i,r);break;case 5:nvt(n,s,r);break;case 6:ivt(n,s,i,r);break;case 7:rvt(n,s,i,r);break;case 13:ovt(n,s,r);break;case 14:svt(n,s,r);break;case 8:avt(n,s,r);break;case 9:cvt(n,s,r);break;case 10:lvt(n,s,r);break;case 15:uvt(n,s,i,r);break;case 16:fvt(n,s,i,r);break;case 17:dvt(n,s,i,r);break;case 18:hvt(n,s,i,r);break;case 19:mvt(n,s,i,r);break;case 20:pvt(n,s,r);break;case 21:gvt(n,s,r);break;case 22:wT(n,s,r);break;case 23:_vt(n,s,r);break;case 24:yvt(n,s,r);break;case 25:Avt(n,s,r);break;case 26:bvt(n,s,r);break;case 27:xvt(n,s,r);break;case 28:Tvt(n,s,r);break;case 29:Evt(n,s,r);break;case 30:Cvt(n,s,r);break;case 31:vvt(n,s,r);break;case 32:wvt(n,s,i,r);break;case 33:Ivt(n,s,r);break;case 34:Pvt(n,s,r);break;case 35:Dvt(n,s,r);break;case 36:Rvt(n,s,i,r);break;case 37:Svt(n,s,i,r);break;case 38:Ovt(n,s,i,r);break;case 39:Mvt(n,s,i,r);break;case 40:Nvt(n,s,r);break;case 41:Lvt(n,s,r);break;default:fm(s.state)}}if(!n.hasSchemeUrlMachine()&&n.charIdx>0&&Pw(r)){var a=n.text.charCodeAt(n.charIdx-1);Pw(a)||n.addMachine(gH(n.charIdx,0))}}}for(var c=n.stateMachines.length-1;c>=0;c--)n.stateMachines.forEach(function(u){return bs(n,u)});return n.matches}function pH(e,t,n){var i=e.charIdx;if(n===35)e.addMachine(zvt(i,28));else if(n===64)e.addMachine(Vvt(i,30));else if(n===47)e.addMachine(Oie(i,11));else if(n===43)e.addMachine(Rie(i,37));else if(n===40)e.addMachine(Rie(i,32));else{if(Qs(n)&&(e.addMachine(Rie(i,38)),e.addMachine(kvt(i,13))),wie(n)){var r=t.toLowerCase()==="m"?15:22;e.addMachine(Uvt(i,r))}Pw(n)&&e.addMachine(gH(i,0)),dm(n)&&e.addMachine(Oie(i,5))}}function KCt(e,t,n){n===58?t.state=2:n===45?t.state=1:Cie(n)||e.removeMachine(t)}function $Ct(e,t,n){var i=e.charIdx;n===45||(n===47?(e.removeMachine(t),e.addMachine(Oie(i,11))):Cie(n)?t.state=0:e.removeMachine(t))}function JCt(e,t,n){var i=e.charIdx;n===47?t.state=3:n===46?e.removeMachine(t):$g(n)?(t.state=5,Pw(n)&&e.addMachine(gH(i,0))):e.removeMachine(t)}function ZCt(e,t,n){n===47?t.state=4:vie(n)?(t.state=10,t.acceptStateReached=!0):bs(e,t)}function QCt(e,t,n,i){i===47?(t.state=10,t.acceptStateReached=!0):$g(i)?(t.state=5,t.acceptStateReached=!0):e.removeMachine(t)}function evt(e,t,n){n===47?t.state=12:e.removeMachine(t)}function tvt(e,t,n){$g(n)?t.state=5:e.removeMachine(t)}function nvt(e,t,n){n===46?t.state=7:n===45?t.state=6:n===58?t.state=8:dH(n)?t.state=10:fH(n)||bs(e,t)}function ivt(e,t,n,i){i===45||(i===46?bs(e,t):$g(i)?t.state=5:bs(e,t))}function rvt(e,t,n,i){i===46?bs(e,t):$g(i)?(t.state=5,t.acceptStateReached=!0):bs(e,t)}function ovt(e,t,n){n===46?t.state=14:n===58?t.state=8:Qs(n)||(dH(n)?t.state=10:dm(n)?e.removeMachine(t):bs(e,t))}function svt(e,t,n){Qs(n)?(t.octetsEncountered++,t.octetsEncountered===4&&(t.acceptStateReached=!0),t.state=13):bs(e,t)}function avt(e,t,n){Qs(n)?t.state=9:bs(e,t)}function cvt(e,t,n){Qs(n)||(dH(n)?t.state=10:bs(e,t))}function lvt(e,t,n){vie(n)||bs(e,t)}function uvt(e,t,n,i){n.toLowerCase()==="a"?t.state=16:wT(e,t,i)}function fvt(e,t,n,i){n.toLowerCase()==="i"?t.state=17:wT(e,t,i)}function dvt(e,t,n,i){n.toLowerCase()==="l"?t.state=18:wT(e,t,i)}function hvt(e,t,n,i){n.toLowerCase()==="t"?t.state=19:wT(e,t,i)}function mvt(e,t,n,i){n.toLowerCase()==="o"?t.state=20:wT(e,t,i)}function pvt(e,t,n){n===58?t.state=21:wT(e,t,n)}function gvt(e,t,n){hH(n)?t.state=22:e.removeMachine(t)}function wT(e,t,n){n===46?t.state=23:n===64?t.state=24:hH(n)?t.state=22:e.removeMachine(t)}function _vt(e,t,n){n===46||n===64?e.removeMachine(t):hH(n)?t.state=22:e.removeMachine(t)}function yvt(e,t,n){$g(n)?t.state=25:e.removeMachine(t)}function Avt(e,t,n){n===46?t.state=27:n===45?t.state=26:fH(n)||bs(e,t)}function bvt(e,t,n){n===45||n===46?bs(e,t):fH(n)?t.state=25:bs(e,t)}function xvt(e,t,n){n===46||n===45?bs(e,t):$g(n)?(t.state=25,t.acceptStateReached=!0):bs(e,t)}function Tvt(e,t,n){Iie(n)?(t.state=29,t.acceptStateReached=!0):e.removeMachine(t)}function Evt(e,t,n){Iie(n)||bs(e,t)}function Cvt(e,t,n){Pie(n)?(t.state=31,t.acceptStateReached=!0):e.removeMachine(t)}function vvt(e,t,n){Pie(n)||(dm(n)?e.removeMachine(t):bs(e,t))}function Svt(e,t,n,i){Qs(i)?t.state=38:(e.removeMachine(t),pH(e,n,i))}function wvt(e,t,n,i){Qs(i)?t.state=33:e.removeMachine(t),pH(e,n,i)}function Ivt(e,t,n){Qs(n)?t.state=34:e.removeMachine(t)}function Pvt(e,t,n){Qs(n)?t.state=35:e.removeMachine(t)}function Dvt(e,t,n){n===41?t.state=36:e.removeMachine(t)}function Rvt(e,t,n,i){Qs(i)?t.state=38:Die(i)?t.state=39:e.removeMachine(t)}function Ovt(e,t,n,i){var r=e.charIdx;t.acceptStateReached=!0,mH(i)?t.state=40:i===35?t.state=41:Qs(i)||(i===40?t.state=32:Die(i)?t.state=39:(bs(e,t),Pw(i)&&e.addMachine(gH(r,0))))}function Mvt(e,t,n,i){Qs(i)?t.state=38:i===40?t.state=32:(bs(e,t),pH(e,n,i))}function Nvt(e,t,n){mH(n)||(n===35?t.state=41:Qs(n)?t.state=38:bs(e,t))}function Lvt(e,t,n){mH(n)?t.state=40:Qs(n)?e.removeMachine(t):bs(e,t)}function bs(e,t){var n=e.matches,i=e.text,r=e.charIdx,o=e.tagBuilder,s=e.stripPrefix,a=e.stripTrailingSlash,c=e.decodePercentEncoding,u=e.hashtagServiceName,f=e.mentionServiceName;if(e.removeMachine(t),!!t.acceptStateReached){var d=t.startIdx,p=i.slice(t.startIdx,r);switch(p=Bvt(p),t.type){case 0:{var g=i.charCodeAt(t.startIdx-1);if(g===64)return;switch(t.matchType){case 0:{var m=Eie.exec(p);if(m&&(d=d+m.index,p=p.slice(m.index)),!lDe(p))return;break}case 1:{if(!uDe(p))return;break}case 2:{if(!fDe(p))return;break}default:fm(t)}n.push(new dDe({tagBuilder:o,matchedText:p,offset:d,urlMatchType:Fvt(t.matchType),url:p,protocolRelativeMatch:p.slice(0,2)==="//",stripPrefix:s,stripTrailingSlash:a,decodePercentEncoding:c}));break}case 1:{mDe(p)&&n.push(new pDe({tagBuilder:o,matchedText:p,offset:d,email:p.replace(hDe,"")}));break}case 2:{gDe(p)&&n.push(new yDe({tagBuilder:o,matchedText:p,offset:d,serviceName:u,hashtag:p.slice(1)}));break}case 3:{ADe(p,f)&&n.push(new xDe({tagBuilder:o,matchedText:p,offset:d,serviceName:f,mention:p.slice(1)}));break}case 4:{if(p=p.replace(/ +$/g,""),TDe(p)){var y=p.replace(/[^0-9,;#]/g,"");n.push(new EDe({tagBuilder:o,matchedText:p,offset:d,number:y,plusSign:p.charAt(0)==="+"}))}break}default:fm(t)}}}function Fvt(e){switch(e){case 0:return"scheme";case 1:return"tld";case 2:return"ipV4";default:fm(e)}}var CDe={")":"(","}":"{","]":"["};function Bvt(e){for(var t={"(":0,"{":0,"[":0},n=0;n<e.length;n++){var i=e.charAt(n),r=e.charCodeAt(n);sDe(r)?t[i]++:Tie(r)&&t[CDe[i]]--}for(var o=e.length-1;o>=0;){var i=e.charAt(o),r=e.charCodeAt(o);if(Tie(r)){var s=CDe[i];if(t[s]<0)t[s]++,o--;else break}else if(uH(r))o--;else break}return e.slice(0,o+1)}function gH(e,t){return{type:0,startIdx:e,state:t,acceptStateReached:!1,matchType:0}}function Oie(e,t){return{type:0,startIdx:e,state:t,acceptStateReached:!1,matchType:1}}function kvt(e,t){return{type:0,startIdx:e,state:t,acceptStateReached:!1,matchType:2,octetsEncountered:1}}function Uvt(e,t){return{type:1,startIdx:e,state:t,acceptStateReached:!1}}function zvt(e,t){return{type:2,startIdx:e,state:t,acceptStateReached:!1}}function Vvt(e,t){return{type:3,startIdx:e,state:t,acceptStateReached:!1}}function Rie(e,t){return{type:4,startIdx:e,state:t,acceptStateReached:!1}}function vDe(e){return e.type===0&&e.matchType===0}var t0=(function(){function e(t){t===void 0&&(t={}),this.idx=t.idx!==void 0?t.idx:-1,this.type=t.type||"tag",this.name=t.name||"",this.isOpening=!!t.isOpening,this.isClosing=!!t.isClosing}return e})(),Nie=new t0,jvt=(function(){function e(t,n){this.charIdx=0,this.state=0,this.currentDataIdx=0,this.currentTag=Nie,this.html=t,this.callbacks=n}return e})();function wDe(e,t){for(var n=new jvt(e,t),i=e.length;n.charIdx<i;){var r=e.charAt(n.charIdx),o=e.charCodeAt(n.charIdx);switch(n.state){case 0:Hvt(n,r);break;case 1:Gvt(n,r,o);break;case 2:qvt(n,r,o);break;case 3:Wvt(n,r,o);break;case 4:Yvt(n,r,o);break;case 5:Xvt(n,r,o);break;case 6:Kvt(n,r,o);break;case 7:$vt(n,r,o);break;case 8:Jvt(n,r);break;case 9:Zvt(n,r);break;case 10:Qvt(n,r,o);break;case 11:eSt(n,r,o);break;case 12:tSt(n,r);break;case 13:nSt(n);break;case 14:iSt(n,r);break;case 15:rSt(n,r);break;case 16:oSt(n,r);break;case 17:sSt(n,r);break;case 18:aSt(n,r);break;case 19:cSt(n,r);break;case 20:lSt(n,r);break;default:fm(n.state)}n.charIdx++}n.currentDataIdx<n.charIdx&&uSt(n)}function Hvt(e,t){t==="<"&&n0(e)}function Gvt(e,t,n){t==="!"?e.state=13:t==="/"?(e.state=2,e.currentTag=new t0(Zs(Zs({},e.currentTag),{isClosing:!0}))):t==="<"?n0(e):Kg(n)?(e.state=3,e.currentTag=new t0(Zs(Zs({},e.currentTag),{isOpening:!0}))):(e.state=0,e.currentTag=Nie)}function Wvt(e,t,n){DA(n)?(e.currentTag=new t0(Zs(Zs({},e.currentTag),{name:Mie(e)})),e.state=4):t==="<"?n0(e):t==="/"?(e.currentTag=new t0(Zs(Zs({},e.currentTag),{name:Mie(e)})),e.state=12):t===">"?(e.currentTag=new t0(Zs(Zs({},e.currentTag),{name:Mie(e)})),i0(e)):!Kg(n)&&!Qs(n)&&t!==":"&&Xd(e)}function qvt(e,t,n){t===">"?Xd(e):Kg(n)?e.state=3:Xd(e)}function Yvt(e,t,n){DA(n)||(t==="/"?e.state=12:t===">"?i0(e):t==="<"?n0(e):t==="="||lH(n)||iDe(n)?Xd(e):e.state=5)}function Xvt(e,t,n){DA(n)?e.state=6:t==="/"?e.state=12:t==="="?e.state=7:t===">"?i0(e):t==="<"?n0(e):lH(n)&&Xd(e)}function Kvt(e,t,n){DA(n)||(t==="/"?e.state=12:t==="="?e.state=7:t===">"?i0(e):t==="<"?n0(e):lH(n)?Xd(e):e.state=5)}function $vt(e,t,n){DA(n)||(t==='"'?e.state=8:t==="'"?e.state=9:/[>=`]/.test(t)?Xd(e):t==="<"?n0(e):e.state=10)}function Jvt(e,t){t==='"'&&(e.state=11)}function Zvt(e,t){t==="'"&&(e.state=11)}function Qvt(e,t,n){DA(n)?e.state=4:t===">"?i0(e):t==="<"&&n0(e)}function eSt(e,t,n){DA(n)?e.state=4:t==="/"?e.state=12:t===">"?i0(e):t==="<"?n0(e):(e.state=4,fSt(e))}function tSt(e,t){t===">"?(e.currentTag=new t0(Zs(Zs({},e.currentTag),{isClosing:!0})),i0(e)):Xd(e)}function nSt(e){var t=e.html,n=e.charIdx;t.slice(n,n+2)==="--"?(e.charIdx++,e.currentTag=new t0(Zs(Zs({},e.currentTag),{type:"comment"})),e.state=14):t.slice(n,n+7).toUpperCase()==="DOCTYPE"?(e.charIdx+=6,e.currentTag=new t0(Zs(Zs({},e.currentTag),{type:"doctype"})),e.state=20):Xd(e)}function iSt(e,t){t==="-"?e.state=15:t===">"?Xd(e):e.state=16}function rSt(e,t){t==="-"?e.state=18:t===">"?Xd(e):e.state=16}function oSt(e,t){t==="-"&&(e.state=17)}function sSt(e,t){t==="-"?e.state=18:e.state=16}function aSt(e,t){t===">"?i0(e):t==="!"?e.state=19:t==="-"||(e.state=16)}function cSt(e,t){t==="-"?e.state=17:t===">"?i0(e):e.state=16}function lSt(e,t){t===">"?i0(e):t==="<"&&n0(e)}function Xd(e){e.state=0,e.currentTag=Nie}function n0(e){e.state=1,e.currentTag=new t0({idx:e.charIdx})}function i0(e){var t=e.html.slice(e.currentDataIdx,e.currentTag.idx);t&&e.callbacks.onText(t,e.currentDataIdx);var n=e.currentTag;n.type==="comment"?e.callbacks.onComment(n.idx):n.type==="doctype"?e.callbacks.onDoctype(n.idx):(n.isOpening&&e.callbacks.onOpenTag(n.name,n.idx),n.isClosing&&e.callbacks.onCloseTag(n.name,n.idx)),Xd(e),e.currentDataIdx=e.charIdx+1}function uSt(e){var t=e.html.slice(e.currentDataIdx,e.charIdx);e.callbacks.onText(t,e.currentDataIdx),e.currentDataIdx=e.charIdx+1}function Mie(e){var t=e.currentTag.idx+(e.currentTag.isClosing?2:1);return e.html.slice(t,e.charIdx).toLowerCase()}function fSt(e){e.charIdx--}var dSt=(function(){function e(t){t===void 0&&(t={}),this.version=e.version,this.urls={},this.email=!0,this.phone=!0,this.hashtag=!1,this.mention=!1,this.newWindow=!0,this.stripPrefix={scheme:!0,www:!0},this.stripTrailingSlash=!0,this.decodePercentEncoding=!0,this.truncate={length:0,location:"end"},this.className="",this.replaceFn=null,this.context=void 0,this.sanitizeHtml=!1,this.tagBuilder=null,this.urls=hSt(t.urls),this.email=Of(t.email)?t.email:this.email,this.phone=Of(t.phone)?t.phone:this.phone,this.hashtag=t.hashtag||this.hashtag,this.mention=t.mention||this.mention,this.newWindow=Of(t.newWindow)?t.newWindow:this.newWindow,this.stripPrefix=mSt(t.stripPrefix),this.stripTrailingSlash=Of(t.stripTrailingSlash)?t.stripTrailingSlash:this.stripTrailingSlash,this.decodePercentEncoding=Of(t.decodePercentEncoding)?t.decodePercentEncoding:this.decodePercentEncoding,this.sanitizeHtml=t.sanitizeHtml||!1;var n=this.mention;if(n!==!1&&bDe.indexOf(n)===-1)throw new Error("invalid `mention` cfg '".concat(n,"' - see docs"));var i=this.hashtag;if(i!==!1&&_De.indexOf(i)===-1)throw new Error("invalid `hashtag` cfg '".concat(i,"' - see docs"));this.truncate=pSt(t.truncate),this.className=t.className||this.className,this.replaceFn=t.replaceFn||this.replaceFn,this.context=t.context||this}return e.link=function(t,n){var i=new e(n);return i.link(t)},e.parse=function(t,n){var i=new e(n);return i.parse(t)},e.prototype.parse=function(t){var n=this,i=["a","style","script"],r=0,o=[];return wDe(t,{onOpenTag:function(s){i.indexOf(s)>=0&&r++},onText:function(s,a){if(r===0){var c=/( | |<|<|>|>|"|"|')/gi,u=s.split(c),f=a;u.forEach(function(d,p){if(p%2===0){var g=n.parseText(d,f);o.push.apply(o,XPe([],YPe(g),!1))}f+=d.length})}},onCloseTag:function(s){i.indexOf(s)>=0&&(r=Math.max(r-1,0))},onComment:function(){},onDoctype:function(){}}),o=this.compactMatches(o),o=this.removeUnwantedMatches(o),o},e.prototype.compactMatches=function(t){t.sort(gSt);for(var n=0;n<t.length-1;){var i=t[n],r=i.getOffset(),o=i.getMatchedText().length;if(n+1<t.length&&t[n+1].getOffset()===r){var s=t[n+1].getMatchedText().length>o?n:n+1;t.splice(s,1);continue}n++}return t},e.prototype.removeUnwantedMatches=function(t){return this.hashtag||PA(t,function(n){return n.getType()==="hashtag"}),this.email||PA(t,function(n){return n.getType()==="email"}),this.phone||PA(t,function(n){return n.getType()==="phone"}),this.mention||PA(t,function(n){return n.getType()==="mention"}),this.urls.schemeMatches||PA(t,function(n){return n.getType()==="url"&&n.getUrlMatchType()==="scheme"}),this.urls.tldMatches||PA(t,function(n){return n.getType()==="url"&&n.getUrlMatchType()==="tld"}),this.urls.ipV4Matches||PA(t,function(n){return n.getType()==="url"&&n.getUrlMatchType()==="ipV4"}),t},e.prototype.parseText=function(t,n){n=n||0;for(var i=SDe(t,{tagBuilder:this.getTagBuilder(),stripPrefix:this.stripPrefix,stripTrailingSlash:this.stripTrailingSlash,decodePercentEncoding:this.decodePercentEncoding,hashtagServiceName:this.hashtag,mentionServiceName:this.mention||"twitter"}),r=0,o=i.length;r<o;r++)i[r].setOffset(n+i[r].getOffset());return i},e.prototype.link=function(t){if(!t)return"";this.sanitizeHtml&&(t=t.replace(/</g,"<").replace(/>/g,">"));for(var n=this.parse(t),i=new Array(n.length*2+1),r=0,o=0,s=n.length;o<s;o++){var a=n[o];i.push(t.substring(r,a.getOffset())),i.push(this.createMatchReturnVal(a)),r=a.getOffset()+a.getMatchedText().length}return i.push(t.substring(r)),i.join("")},e.prototype.createMatchReturnVal=function(t){var n;if(this.replaceFn&&(n=this.replaceFn.call(this.context,t)),typeof n=="string")return n;if(n===!1)return t.getMatchedText();if(n instanceof cH)return n.toAnchorString();var i=t.buildTag();return i.toAnchorString()},e.prototype.getTagBuilder=function(){var t=this.tagBuilder;return t||(t=this.tagBuilder=new nDe({newWindow:this.newWindow,truncate:this.truncate,className:this.className})),t},e.version=KPe,e})(),IDe=dSt;function hSt(e){return e==null&&(e=!0),Of(e)?{schemeMatches:e,tldMatches:e,ipV4Matches:e}:{schemeMatches:Of(e.schemeMatches)?e.schemeMatches:!0,tldMatches:Of(e.tldMatches)?e.tldMatches:!0,ipV4Matches:Of(e.ipV4Matches)?e.ipV4Matches:!0}}function mSt(e){return e==null&&(e=!0),Of(e)?{scheme:e,www:e}:{scheme:Of(e.scheme)?e.scheme:!0,www:Of(e.www)?e.www:!0}}function pSt(e){return typeof e=="number"?{length:e,location:"end"}:Zs({length:Number.POSITIVE_INFINITY,location:"end"},e)}function gSt(e,t){return e.getOffset()-t.getOffset()}var _H=IDe;var BDe;typeof DOMParser<"u"&&(BDe=new DOMParser);var _St=new _H({stripPrefix:!1,email:!1,replaceFn:function(e,t){return t.urlMatchType==="scheme"||t.urlMatchType==="www"}}),yH=32,PDe=2414016,DDe=1,RDe=16093e3,ODe=.1,ySt=[null,void 0,"http://www.topografix.com/GPX/1/1"],Kr={gpx:ySt};function ASt(e){return new Promise((t,n)=>{let i=new FileReader;i.addEventListener("load",function(){t(i.result)}),i.addEventListener("error",function(){n(i.error)}),i.readAsText(e)})}function Lie(e,t){let n=TO(e,"id");return n=l(n)?n:Kn(),t.getOrCreateEntity(n)}function Fie(e){let t=MDe(e,"lon"),n=MDe(e,"lat"),i=bO(e,"ele",Kr.gpx);return h.fromDegrees(t,n,i)}function MDe(e,t){if(!l(e))return;let n=e.getAttribute(t);if(n!==null){let i=parseFloat(n);return isNaN(i)?void 0:i}}function TO(e,t){if(!l(e))return;let n=e.getAttribute(t);return n!==null?n:void 0}function RA(e,t,n){if(!l(e))return;let i=e.childNodes,r=i.length;for(let o=0;o<r;o++){let s=i[o];if(s.localName===t&&n.indexOf(s.namespaceURI)!==-1)return s}}function Bie(e,t,n){if(!l(e))return;let i=[],r=e.getElementsByTagName(t),o=r.length;for(let s=0;s<o;s++){let a=r[s];a.localName===t&&n.indexOf(a.namespaceURI)!==-1&&i.push(a)}return i}function bO(e,t,n){let i=RA(e,t,n);if(l(i)){let r=parseFloat(i.textContent);return isNaN(r)?void 0:r}}function Hu(e,t,n){let i=RA(e,t,n);if(l(i))return i.textContent.trim()}function kDe(e){let t=new Il;return t.width=yH,t.height=yH,t.scaleByDistance=new qt(PDe,DDe,RDe,ODe),t.pixelOffsetScaleByDistance=new qt(PDe,DDe,RDe,ODe),t.verticalOrigin=new hi(qn.BOTTOM),t.image=e,t}function bSt(){let e=new tp;return e.translucencyByDistance=new qt(3e6,1,5e6,0),e.pixelOffset=new U(17,0),e.horizontalOrigin=Hi.LEFT,e.font="16px sans-serif",e.style=Io.FILL_AND_OUTLINE,e}function UDe(e){let t=new Rl;return t.width=4,t.material=new Gx,t.material.color=l(e)?e:z.RED,t.material.outlineWidth=2,t.material.outlineColor=z.BLACK,t}var NDe={time:{text:"Time",tag:"time"},comment:{text:"Comment",tag:"cmt"},description:{text:"Description",tag:"desc"},source:{text:"Source",tag:"src"},number:{text:"GPS track/route number",tag:"number"},type:{text:"Type",tag:"type"}},xO;typeof document<"u"&&(xO=document.createElement("div"));function kie(e,t){let n,i="",r=Object.keys(NDe),o=r.length;for(n=0;n<o;n++){let f=r[n],d=NDe[f];d.value=Hu(e,d.tag,Kr.gpx)??"",l(d.value)&&d.value!==""&&(i=`${i}<p>${d.text}: ${d.value}</p>`)}if(!l(i)||i==="")return;i=_St.link(i),xO.innerHTML=i;let s=xO.querySelectorAll("a");for(n=0;n<s.length;n++)s[n].setAttribute("target","_blank");let a=z.WHITE,c=z.BLACK,u='<div class="cesium-infoBox-description-lighter" style="';return u+="overflow:auto;",u+="word-wrap:break-word;",u+=`background-color:${a.toCssColorString()};`,u+=`color:${c.toCssColorString()};`,u+='">',u+=`${xO.innerHTML}</div>`,xO.innerHTML="",u}function zDe(e,t,n,i){let r=Fie(t),o=Lie(t,n);o.position=r;let s=l(i.waypointImage)?i.waypointImage:e._pinBuilder.fromMakiIconId("marker",z.RED,yH);o.billboard=kDe(s);let a=Hu(t,"name",Kr.gpx);o.name=a,o.label=bSt(),o.label.text=a,o.description=kie(t,o),i.clampToGround&&(o.billboard.heightReference=We.CLAMP_TO_GROUND,o.label.heightReference=We.CLAMP_TO_GROUND)}function xSt(e,t,n,i){let r=Lie(t,n);r.description=kie(t,r);let o=Bie(t,"rtept",Kr.gpx),s=new Array(o.length);for(let a=0;a<o.length;a++)zDe(e,o[a],n,i),s[a]=Fie(o[a]);r.polyline=UDe(i.routeColor),i.clampToGround&&(r.polyline.clampToGround=!0),r.polyline.positions=s}function TSt(e,t,n,i){let r=Lie(t,n);r.description=kie(t,r);let o=Bie(t,"trkseg",Kr.gpx),s=[],a=[],c,u=!0,f=new Cc;for(let d=0;d<o.length;d++)c=ESt(o[d]),s=s.concat(c.positions),c.times.length>0?(a=a.concat(c.times),f.addSamples(a,s),u=u&&!0):u=!1;if(u){let d=l(i.waypointImage)?i.waypointImage:e._pinBuilder.fromMakiIconId("marker",z.RED,yH);r.billboard=kDe(d),r.position=f,i.clampToGround&&(r.billboard.heightReference=We.CLAMP_TO_GROUND),r.availability=new Ls,r.availability.addInterval(new Cn({start:a[0],stop:a[a.length-1]}))}r.polyline=UDe(i.trackColor),r.polyline.positions=s,i.clampToGround&&(r.polyline.clampToGround=!0)}function ESt(e){let t={positions:[],times:[]},n=Bie(e,"trkpt",Kr.gpx),i;for(let r=0;r<n.length;r++){let o=Fie(n[r]);t.positions.push(o),i=Hu(n[r],"time",Kr.gpx),l(i)&&t.times.push(K.fromIso8601(i))}return t}function CSt(e){let t=RA(e,"metadata",Kr.gpx);if(l(t)){let n={name:Hu(t,"name",Kr.gpx),desc:Hu(t,"desc",Kr.gpx),author:vSt(t),copyright:wSt(t),link:VDe(t),time:Hu(t,"time",Kr.gpx),keywords:Hu(t,"keywords",Kr.gpx),bounds:ISt(t)};if(l(n.name)||l(n.desc)||l(n.author)||l(n.copyright)||l(n.link)||l(n.time)||l(n.keywords)||l(n.bounds))return n}}function vSt(e){let t=RA(e,"author",Kr.gpx);if(l(t)){let n={name:Hu(t,"name",Kr.gpx),email:SSt(t),link:VDe(t)};if(l(n.name)||l(n.email)||l(n.link))return n}}function SSt(e){let t=RA(e,"email",Kr.gpx);if(l(t)){let n=Hu(t,"id",Kr.gpx),i=Hu(t,"domain",Kr.gpx);return`${n}@${i}`}}function VDe(e){let t=RA(e,"link",Kr.gpx);if(l(t)){let n={href:TO(t,"href"),text:Hu(t,"text",Kr.gpx),mimeType:Hu(t,"type",Kr.gpx)};if(l(n.href)||l(n.text)||l(n.mimeType))return n}}function wSt(e){let t=RA(e,"copyright",Kr.gpx);if(l(t)){let n={author:TO(t,"author"),year:Hu(t,"year",Kr.gpx),license:Hu(t,"license",Kr.gpx)};if(l(n.author)||l(n.year)||l(n.license))return n}}function ISt(e){let t=RA(e,"bounds",Kr.gpx);if(l(t)){let n={minLat:bO(t,"minlat",Kr.gpx),maxLat:bO(t,"maxlat",Kr.gpx),minLon:bO(t,"minlon",Kr.gpx),maxLon:bO(t,"maxlon",Kr.gpx)};if(l(n.minLat)||l(n.maxLat)||l(n.minLon)||l(n.maxLon))return n}}var LDe={wpt:zDe,rte:xSt,trk:TSt};function PSt(e,t,n,i){let r=Object.keys(LDe),o=r.length;for(let s=0;s<o;s++){let a=r[s],c=LDe[a],u=t.childNodes,f=u.length;for(let d=0;d<f;d++){let p=u[d];p.localName===a&&Kr.gpx.indexOf(p.namespaceURI)!==-1&&c(e,p,n,i)}}}function FDe(e,t,n){let i=e._entityCollection;i.removeAll();let r=t.documentElement,o=TO(r,"version"),s=TO(r,"creator"),a,c=CSt(r);l(c)&&(a=c.name),r.localName==="gpx"?PSt(e,r,i,n):console.log(`GPX - Unsupported node: ${r.localName}`);let u,f=i.computeAvailability(),d=f.start,p=f.stop,g=K.equals(d,nt.MINIMUM_VALUE),m=K.equals(p,nt.MAXIMUM_VALUE);if(!g||!m){let A;g&&(A=new Date,A.setHours(0,0,0,0),d=K.fromDate(A)),m&&(A=new Date,A.setHours(24,0,0,0),p=K.fromDate(A)),u=new Np,u.startTime=d,u.stopTime=p,u.currentTime=K.clone(d),u.clockRange=Bs.LOOP_STOP,u.clockStep=Hr.SYSTEM_CLOCK_MULTIPLIER,u.multiplier=Math.round(Math.min(Math.max(K.secondsDifference(p,d)/60,1),31556900))}let y=!1;return e._name!==a&&(e._name=a,y=!0),e._creator!==s&&(e._creator=s,y=!0),DSt(e._metadata,c)&&(e._metadata=c,y=!0),e._version!==o&&(e._version=o,y=!0),u!==e._clock&&(y=!0,e._clock=u),y&&e._changed.raiseEvent(e),Fs.setLoading(e,!1),e}function DSt(e,t){return!l(e)&&!l(t)?!1:l(e)&&l(t)?e.name!==t.name||e.dec!==t.desc||e.src!==t.src||e.author!==t.author||e.copyright!==t.copyright||e.link!==t.link||e.time!==t.time||e.bounds!==t.bounds:!0}function RSt(e,t,n,i){i=i??H.EMPTY_OBJECT;let r=n;if(typeof n=="string"||n instanceof De){n=De.createIfNeeded(n),r=n.fetchBlob();let o=e._resourceCredits,s=n.credits;if(l(s)){let a=s.length;for(let c=0;c<a;c++)o.push(s[c])}}return Promise.resolve(r).then(function(o){return o instanceof Blob?ASt(o).then(function(s){let a,c;try{a=BDe.parseFromString(s,"application/xml")}catch(u){c=u.toString()}if(l(c)||a.body||a.documentElement.tagName==="parsererror"){let u=l(c)?c:a.documentElement.firstChild.nodeValue;throw u||(u=a.body.innerText),new oe(u)}return FDe(e,a,i)}):FDe(e,o,i)}).catch(function(o){return e._error.raiseEvent(e,o),console.log(o),Promise.reject(o)})}function Dw(){this._changed=new be,this._error=new be,this._loading=new be,this._clock=void 0,this._entityCollection=new rc(this),this._entityCluster=new kd,this._name=void 0,this._version=void 0,this._creator=void 0,this._metadata=void 0,this._isLoading=!1,this._pinBuilder=new wA}Dw.load=function(e,t){return new Dw().load(e,t)};Object.defineProperties(Dw.prototype,{name:{get:function(){return this._name}},version:{get:function(){return this._version}},creator:{get:function(){return this._creator}},metadata:{get:function(){return this._metadata}},clock:{get:function(){return this._clock}},entities:{get:function(){return this._entityCollection}},isLoading:{get:function(){return this._isLoading}},changedEvent:{get:function(){return this._changed}},errorEvent:{get:function(){return this._error}},loadingEvent:{get:function(){return this._loading}},show:{get:function(){return this._entityCollection.show},set:function(e){this._entityCollection.show=e}},clustering:{get:function(){return this._entityCluster},set:function(e){this._entityCluster=e}}});Dw.prototype.update=function(e){return!0};Dw.prototype.load=function(e,t){if(!l(e))throw new pe("data is required.");t=t??H.EMPTY_OBJECT,Fs.setLoading(this,!0);let n=this._name,i=this;return RSt(this,this._entityCollection,e,t).then(function(){let r,o=i._entityCollection.computeAvailability(),s=o.start,a=o.stop,c=K.equals(s,nt.MINIMUM_VALUE),u=K.equals(a,nt.MAXIMUM_VALUE);if(!c||!u){let d;c&&(d=new Date,d.setHours(0,0,0,0),s=K.fromDate(d)),u&&(d=new Date,d.setHours(24,0,0,0),a=K.fromDate(d)),r=new Np,r.startTime=s,r.stopTime=a,r.currentTime=K.clone(s),r.clockRange=Bs.LOOP_STOP,r.clockStep=Hr.SYSTEM_CLOCK_MULTIPLIER,r.multiplier=Math.round(Math.min(Math.max(K.secondsDifference(a,s)/60,1),31556900))}let f=!1;return r!==i._clock&&(i._clock=r,f=!0),n!==i._name&&(f=!0),f&&i._changed.raiseEvent(i),Fs.setLoading(i,!1),i}).catch(function(r){return Fs.setLoading(i,!1),i._error.raiseEvent(i,r),console.log(r),Promise.reject(r)})};var AH=Dw;function OSt(e,t){this.position=e,this.headingPitchRoll=t}var bH=OSt;var CO=js(ef(),1);function MSt(e,t){this.position=e,this.headingPitchRange=t}var xH=MSt;function TH(e,t){this.id=t,this.name=e,this.playlistIndex=0,this.playlist=[],this.tourStart=new be,this.tourEnd=new be,this.entryStart=new be,this.entryEnd=new be,this._activeEntries=[]}TH.prototype.addPlaylistEntry=function(e){this.playlist.push(e)};TH.prototype.play=function(e,t){this.tourStart.raiseEvent();let n=this;HDe.call(this,e,t,function(i){n.playlistIndex=0,i||jDe(n._activeEntries),n.tourEnd.raiseEvent(i)})};TH.prototype.stop=function(){jDe(this._activeEntries)};function jDe(e){for(let t=e.pop();t!==void 0;t=e.pop())t.stop()}function HDe(e,t,n){let i=this.playlist[this.playlistIndex];if(i){let r=NSt.bind(this,e,t,n);if(this._activeEntries.push(i),this.entryStart.raiseEvent(i),i.blocking)i.play(r,e.scene.camera,t);else{let o=this;i.play(function(){o.entryEnd.raiseEvent(i);let s=o._activeEntries.indexOf(i);s>=0&&o._activeEntries.splice(s,1)}),r(e,t,n)}}else l(n)&&n(!1)}function NSt(e,t,n,i){let r=this.playlist[this.playlistIndex];if(this.entryEnd.raiseEvent(r,i),i)n(i);else{let o=this._activeEntries.indexOf(r);o>=0&&this._activeEntries.splice(o,1),this.playlistIndex++,HDe.call(this,e,t,n)}}var EH=TH;var Zi=Object.freeze({Linear:Object.freeze({None:function(e){return e},In:function(e){return e},Out:function(e){return e},InOut:function(e){return e}}),Quadratic:Object.freeze({In:function(e){return e*e},Out:function(e){return e*(2-e)},InOut:function(e){return(e*=2)<1?.5*e*e:-.5*(--e*(e-2)-1)}}),Cubic:Object.freeze({In:function(e){return e*e*e},Out:function(e){return--e*e*e+1},InOut:function(e){return(e*=2)<1?.5*e*e*e:.5*((e-=2)*e*e+2)}}),Quartic:Object.freeze({In:function(e){return e*e*e*e},Out:function(e){return 1- --e*e*e*e},InOut:function(e){return(e*=2)<1?.5*e*e*e*e:-.5*((e-=2)*e*e*e-2)}}),Quintic:Object.freeze({In:function(e){return e*e*e*e*e},Out:function(e){return--e*e*e*e*e+1},InOut:function(e){return(e*=2)<1?.5*e*e*e*e*e:.5*((e-=2)*e*e*e*e+2)}}),Sinusoidal:Object.freeze({In:function(e){return 1-Math.sin((1-e)*Math.PI/2)},Out:function(e){return Math.sin(e*Math.PI/2)},InOut:function(e){return .5*(1-Math.sin(Math.PI*(.5-e)))}}),Exponential:Object.freeze({In:function(e){return e===0?0:Math.pow(1024,e-1)},Out:function(e){return e===1?1:1-Math.pow(2,-10*e)},InOut:function(e){return e===0?0:e===1?1:(e*=2)<1?.5*Math.pow(1024,e-1):.5*(-Math.pow(2,-10*(e-1))+2)}}),Circular:Object.freeze({In:function(e){return 1-Math.sqrt(1-e*e)},Out:function(e){return Math.sqrt(1- --e*e)},InOut:function(e){return(e*=2)<1?-.5*(Math.sqrt(1-e*e)-1):.5*(Math.sqrt(1-(e-=2)*e)+1)}}),Elastic:Object.freeze({In:function(e){return e===0?0:e===1?1:-Math.pow(2,10*(e-1))*Math.sin((e-1.1)*5*Math.PI)},Out:function(e){return e===0?0:e===1?1:Math.pow(2,-10*e)*Math.sin((e-.1)*5*Math.PI)+1},InOut:function(e){return e===0?0:e===1?1:(e*=2,e<1?-.5*Math.pow(2,10*(e-1))*Math.sin((e-1.1)*5*Math.PI):.5*Math.pow(2,-10*(e-1))*Math.sin((e-1.1)*5*Math.PI)+1)}}),Back:Object.freeze({In:function(e){var t=1.70158;return e===1?1:e*e*((t+1)*e-t)},Out:function(e){var t=1.70158;return e===0?0:--e*e*((t+1)*e+t)+1},InOut:function(e){var t=2.5949095;return(e*=2)<1?.5*(e*e*((t+1)*e-t)):.5*((e-=2)*e*((t+1)*e+t)+2)}}),Bounce:Object.freeze({In:function(e){return 1-Zi.Bounce.Out(1-e)},Out:function(e){return e<.36363636363636365?7.5625*e*e:e<.7272727272727273?7.5625*(e-=.5454545454545454)*e+.75:e<.9090909090909091?7.5625*(e-=.8181818181818182)*e+.9375:7.5625*(e-=.9545454545454546)*e+.984375},InOut:function(e){return e<.5?Zi.Bounce.In(e*2)*.5:Zi.Bounce.Out(e*2-1)*.5+.5}}),generatePow:function(e){return e===void 0&&(e=4),e=e<Number.EPSILON?Number.EPSILON:e,e=e>1e4?1e4:e,{In:function(t){return Math.pow(t,e)},Out:function(t){return 1-Math.pow(1-t,e)},InOut:function(t){return t<.5?Math.pow(t*2,e)/2:(1-Math.pow(2-t*2,e))/2+.5}}}}),EO=function(){return performance.now()},LSt=(function(){function e(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];this._tweens={},this._tweensAddedDuringUpdate={},this.add.apply(this,t)}return e.prototype.getAll=function(){var t=this;return Object.keys(this._tweens).map(function(n){return t._tweens[n]})},e.prototype.removeAll=function(){this._tweens={}},e.prototype.add=function(){for(var t,n=[],i=0;i<arguments.length;i++)n[i]=arguments[i];for(var r=0,o=n;r<o.length;r++){var s=o[r];(t=s._group)===null||t===void 0||t.remove(s),s._group=this,this._tweens[s.getId()]=s,this._tweensAddedDuringUpdate[s.getId()]=s}},e.prototype.remove=function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];for(var i=0,r=t;i<r.length;i++){var o=r[i];o._group=void 0,delete this._tweens[o.getId()],delete this._tweensAddedDuringUpdate[o.getId()]}},e.prototype.allStopped=function(){return this.getAll().every(function(t){return!t.isPlaying()})},e.prototype.update=function(t,n){t===void 0&&(t=EO()),n===void 0&&(n=!0);var i=Object.keys(this._tweens);if(i.length!==0)for(;i.length>0;){this._tweensAddedDuringUpdate={};for(var r=0;r<i.length;r++){var o=this._tweens[i[r]],s=!n;o&&o.update(t,s)===!1&&!n&&this.remove(o)}i=Object.keys(this._tweensAddedDuringUpdate)}},e})(),Rw={Linear:function(e,t){var n=e.length-1,i=n*t,r=Math.floor(i),o=Rw.Utils.Linear;return t<0?o(e[0],e[1],i):t>1?o(e[n],e[n-1],n-i):o(e[r],e[r+1>n?n:r+1],i-r)},Bezier:function(e,t){for(var n=0,i=e.length-1,r=Math.pow,o=Rw.Utils.Bernstein,s=0;s<=i;s++)n+=r(1-t,i-s)*r(t,s)*e[s]*o(i,s);return n},CatmullRom:function(e,t){var n=e.length-1,i=n*t,r=Math.floor(i),o=Rw.Utils.CatmullRom;return e[0]===e[n]?(t<0&&(r=Math.floor(i=n*(1+t))),o(e[(r-1+n)%n],e[r],e[(r+1)%n],e[(r+2)%n],i-r)):t<0?e[0]-(o(e[0],e[0],e[1],e[1],-i)-e[0]):t>1?e[n]-(o(e[n],e[n],e[n-1],e[n-1],i-n)-e[n]):o(e[r?r-1:0],e[r],e[n<r+1?n:r+1],e[n<r+2?n:r+2],i-r)},Utils:{Linear:function(e,t,n){return(t-e)*n+e},Bernstein:function(e,t){var n=Rw.Utils.Factorial;return n(e)/n(t)/n(e-t)},Factorial:(function(){var e=[1];return function(t){var n=1;if(e[t])return e[t];for(var i=t;i>1;i--)n*=i;return e[t]=n,n}})(),CatmullRom:function(e,t,n,i,r){var o=(n-e)*.5,s=(i-t)*.5,a=r*r,c=r*a;return(2*t-2*n+o+s)*c+(-3*t+3*n-2*o-s)*a+o*r+t}}},GDe=(function(){function e(){}return e.nextId=function(){return e._nextId++},e._nextId=0,e})(),Uie=new LSt,WDe=(function(){function e(t,n){this._isPaused=!1,this._pauseStart=0,this._valuesStart={},this._valuesEnd={},this._valuesStartRepeat={},this._duration=1e3,this._isDynamic=!1,this._initialRepeat=0,this._repeat=0,this._yoyo=!1,this._isPlaying=!1,this._reversed=!1,this._delayTime=0,this._startTime=0,this._easingFunction=Zi.Linear.None,this._interpolationFunction=Rw.Linear,this._chainedTweens=[],this._onStartCallbackFired=!1,this._onEveryStartCallbackFired=!1,this._id=GDe.nextId(),this._isChainStopped=!1,this._propertiesAreSetUp=!1,this._goToEnd=!1,this._object=t,typeof n=="object"?(this._group=n,n.add(this)):n===!0&&(this._group=Uie,Uie.add(this))}return e.prototype.getId=function(){return this._id},e.prototype.isPlaying=function(){return this._isPlaying},e.prototype.isPaused=function(){return this._isPaused},e.prototype.getDuration=function(){return this._duration},e.prototype.to=function(t,n){if(n===void 0&&(n=1e3),this._isPlaying)throw new Error("Can not call Tween.to() while Tween is already started or paused. Stop the Tween first.");return this._valuesEnd=t,this._propertiesAreSetUp=!1,this._duration=n<0?0:n,this},e.prototype.duration=function(t){return t===void 0&&(t=1e3),this._duration=t<0?0:t,this},e.prototype.dynamic=function(t){return t===void 0&&(t=!1),this._isDynamic=t,this},e.prototype.start=function(t,n){if(t===void 0&&(t=EO()),n===void 0&&(n=!1),this._isPlaying)return this;if(this._repeat=this._initialRepeat,this._reversed){this._reversed=!1;for(var i in this._valuesStartRepeat)this._swapEndStartRepeatValues(i),this._valuesStart[i]=this._valuesStartRepeat[i]}if(this._isPlaying=!0,this._isPaused=!1,this._onStartCallbackFired=!1,this._onEveryStartCallbackFired=!1,this._isChainStopped=!1,this._startTime=t,this._startTime+=this._delayTime,!this._propertiesAreSetUp||n){if(this._propertiesAreSetUp=!0,!this._isDynamic){var r={};for(var o in this._valuesEnd)r[o]=this._valuesEnd[o];this._valuesEnd=r}this._setupProperties(this._object,this._valuesStart,this._valuesEnd,this._valuesStartRepeat,n)}return this},e.prototype.startFromCurrentValues=function(t){return this.start(t,!0)},e.prototype._setupProperties=function(t,n,i,r,o){for(var s in i){var a=t[s],c=Array.isArray(a),u=c?"array":typeof a,f=!c&&Array.isArray(i[s]);if(!(u==="undefined"||u==="function")){if(f){var d=i[s];if(d.length===0)continue;for(var p=[a],g=0,m=d.length;g<m;g+=1){var y=this._handleRelativeValue(a,d[g]);if(isNaN(y)){f=!1,console.warn("Found invalid interpolation list. Skipping.");break}p.push(y)}f&&(i[s]=p)}if((u==="object"||c)&&a&&!f){n[s]=c?[]:{};var A=a;for(var b in A)n[s][b]=A[b];r[s]=c?[]:{};var d=i[s];if(!this._isDynamic){var x={};for(var b in d)x[b]=d[b];i[s]=d=x}this._setupProperties(A,n[s],d,r[s],o)}else(typeof n[s]>"u"||o)&&(n[s]=a),c||(n[s]*=1),f?r[s]=i[s].slice().reverse():r[s]=n[s]||0}}},e.prototype.stop=function(){return this._isChainStopped||(this._isChainStopped=!0,this.stopChainedTweens()),this._isPlaying?(this._isPlaying=!1,this._isPaused=!1,this._onStopCallback&&this._onStopCallback(this._object),this):this},e.prototype.end=function(){return this._goToEnd=!0,this.update(this._startTime+this._duration),this},e.prototype.pause=function(t){return t===void 0&&(t=EO()),this._isPaused||!this._isPlaying?this:(this._isPaused=!0,this._pauseStart=t,this)},e.prototype.resume=function(t){return t===void 0&&(t=EO()),!this._isPaused||!this._isPlaying?this:(this._isPaused=!1,this._startTime+=t-this._pauseStart,this._pauseStart=0,this)},e.prototype.stopChainedTweens=function(){for(var t=0,n=this._chainedTweens.length;t<n;t++)this._chainedTweens[t].stop();return this},e.prototype.group=function(t){return t?(t.add(this),this):(console.warn("tween.group() without args has been removed, use group.add(tween) instead."),this)},e.prototype.remove=function(){var t;return(t=this._group)===null||t===void 0||t.remove(this),this},e.prototype.delay=function(t){return t===void 0&&(t=0),this._delayTime=t,this},e.prototype.repeat=function(t){return t===void 0&&(t=0),this._initialRepeat=t,this._repeat=t,this},e.prototype.repeatDelay=function(t){return this._repeatDelayTime=t,this},e.prototype.yoyo=function(t){return t===void 0&&(t=!1),this._yoyo=t,this},e.prototype.easing=function(t){return t===void 0&&(t=Zi.Linear.None),this._easingFunction=t,this},e.prototype.interpolation=function(t){return t===void 0&&(t=Rw.Linear),this._interpolationFunction=t,this},e.prototype.chain=function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];return this._chainedTweens=t,this},e.prototype.onStart=function(t){return this._onStartCallback=t,this},e.prototype.onEveryStart=function(t){return this._onEveryStartCallback=t,this},e.prototype.onUpdate=function(t){return this._onUpdateCallback=t,this},e.prototype.onRepeat=function(t){return this._onRepeatCallback=t,this},e.prototype.onComplete=function(t){return this._onCompleteCallback=t,this},e.prototype.onStop=function(t){return this._onStopCallback=t,this},e.prototype.update=function(t,n){var i=this,r;if(t===void 0&&(t=EO()),n===void 0&&(n=e.autoStartOnUpdate),this._isPaused)return!0;var o;if(!this._goToEnd&&!this._isPlaying)if(n)this.start(t,!0);else return!1;if(this._goToEnd=!1,t<this._startTime)return!0;this._onStartCallbackFired===!1&&(this._onStartCallback&&this._onStartCallback(this._object),this._onStartCallbackFired=!0),this._onEveryStartCallbackFired===!1&&(this._onEveryStartCallback&&this._onEveryStartCallback(this._object),this._onEveryStartCallbackFired=!0);var s=t-this._startTime,a=this._duration+((r=this._repeatDelayTime)!==null&&r!==void 0?r:this._delayTime),c=this._duration+this._repeat*a,u=function(){if(i._duration===0||s>c)return 1;var y=Math.trunc(s/a),A=s-y*a,b=Math.min(A/i._duration,1);return b===0&&s===i._duration?1:b},f=u(),d=this._easingFunction(f);if(this._updateProperties(this._object,this._valuesStart,this._valuesEnd,d),this._onUpdateCallback&&this._onUpdateCallback(this._object,f),this._duration===0||s>=this._duration)if(this._repeat>0){var p=Math.min(Math.trunc((s-this._duration)/a)+1,this._repeat);isFinite(this._repeat)&&(this._repeat-=p);for(o in this._valuesStartRepeat)!this._yoyo&&typeof this._valuesEnd[o]=="string"&&(this._valuesStartRepeat[o]=this._valuesStartRepeat[o]+parseFloat(this._valuesEnd[o])),this._yoyo&&this._swapEndStartRepeatValues(o),this._valuesStart[o]=this._valuesStartRepeat[o];return this._yoyo&&(this._reversed=!this._reversed),this._startTime+=a*p,this._onRepeatCallback&&this._onRepeatCallback(this._object),this._onEveryStartCallbackFired=!1,!0}else{this._onCompleteCallback&&this._onCompleteCallback(this._object);for(var g=0,m=this._chainedTweens.length;g<m;g++)this._chainedTweens[g].start(this._startTime+this._duration,!1);return this._isPlaying=!1,!1}return!0},e.prototype._updateProperties=function(t,n,i,r){for(var o in i)if(n[o]!==void 0){var s=n[o]||0,a=i[o],c=Array.isArray(t[o]),u=Array.isArray(a),f=!c&&u;f?t[o]=this._interpolationFunction(a,r):typeof a=="object"&&a?this._updateProperties(t[o],s,a,r):(a=this._handleRelativeValue(s,a),typeof a=="number"&&(t[o]=s+(a-s)*r))}},e.prototype._handleRelativeValue=function(t,n){return typeof n!="string"?n:n.charAt(0)==="+"||n.charAt(0)==="-"?t+parseFloat(n):parseFloat(n)},e.prototype._swapEndStartRepeatValues=function(t){var n=this._valuesStartRepeat[t],i=this._valuesEnd[t];typeof i=="string"?this._valuesStartRepeat[t]=this._valuesStartRepeat[t]+parseFloat(i):this._valuesStartRepeat[t]=this._valuesEnd[t],this._valuesEnd[t]=n},e.autoStartOnUpdate=!1,e})();var J3i=GDe.nextId,r0=Uie,Z3i=r0.getAll.bind(r0),Q3i=r0.removeAll.bind(r0),eUi=r0.add.bind(r0),tUi=r0.remove.bind(r0),nUi=r0.update.bind(r0);var FSt={LINEAR_NONE:Zi.Linear.None,QUADRATIC_IN:Zi.Quadratic.In,QUADRATIC_OUT:Zi.Quadratic.Out,QUADRATIC_IN_OUT:Zi.Quadratic.InOut,CUBIC_IN:Zi.Cubic.In,CUBIC_OUT:Zi.Cubic.Out,CUBIC_IN_OUT:Zi.Cubic.InOut,QUARTIC_IN:Zi.Quartic.In,QUARTIC_OUT:Zi.Quartic.Out,QUARTIC_IN_OUT:Zi.Quartic.InOut,QUINTIC_IN:Zi.Quintic.In,QUINTIC_OUT:Zi.Quintic.Out,QUINTIC_IN_OUT:Zi.Quintic.InOut,SINUSOIDAL_IN:Zi.Sinusoidal.In,SINUSOIDAL_OUT:Zi.Sinusoidal.Out,SINUSOIDAL_IN_OUT:Zi.Sinusoidal.InOut,EXPONENTIAL_IN:Zi.Exponential.In,EXPONENTIAL_OUT:Zi.Exponential.Out,EXPONENTIAL_IN_OUT:Zi.Exponential.InOut,CIRCULAR_IN:Zi.Circular.In,CIRCULAR_OUT:Zi.Circular.Out,CIRCULAR_IN_OUT:Zi.Circular.InOut,ELASTIC_IN:Zi.Elastic.In,ELASTIC_OUT:Zi.Elastic.Out,ELASTIC_IN_OUT:Zi.Elastic.InOut,BACK_IN:Zi.Back.In,BACK_OUT:Zi.Back.Out,BACK_IN_OUT:Zi.Back.InOut,BOUNCE_IN:Zi.Bounce.In,BOUNCE_OUT:Zi.Bounce.Out,BOUNCE_IN_OUT:Zi.Bounce.InOut},ks=Object.freeze(FSt);function CH(e,t,n){this.type="KmlTourFlyTo",this.blocking=!0,this.activeCamera=null,this.activeCallback=null,this.duration=e,this.view=n,this.flyToMode=t}CH.prototype.play=function(e,t,n){if(this.activeCamera=t,l(e)&&e!==null){let r=this;this.activeCallback=function(o){delete r.activeCallback,delete r.activeCamera,e(l(o)?!1:o)}}let i=this.getCameraOptions(n);if(this.view.headingPitchRoll)t.flyTo(i);else if(this.view.headingPitchRange){let r=new ue(this.view.position);t.flyToBoundingSphere(r,i)}};CH.prototype.stop=function(){l(this.activeCamera)&&this.activeCamera.cancelFlight(),l(this.activeCallback)&&this.activeCallback(!0)};CH.prototype.getCameraOptions=function(e){let t={duration:this.duration};return l(this.activeCallback)&&(t.complete=this.activeCallback),this.flyToMode==="smooth"&&(t.easingFunction=ks.LINEAR_NONE),this.view.headingPitchRoll?(t.destination=this.view.position,t.orientation=this.view.headingPitchRoll):this.view.headingPitchRange&&(t.offset=this.view.headingPitchRange),l(e)&&(t=Mt(t,e)),t};var vH=CH;function zie(e){this.type="KmlTourWait",this.blocking=!0,this.duration=e,this.timeout=null}zie.prototype.play=function(e){let t=this;this.activeCallback=e,this.timeout=setTimeout(function(){delete t.activeCallback,e(!1)},this.duration*1e3)};zie.prototype.stop=function(){clearTimeout(this.timeout),l(this.activeCallback)&&this.activeCallback(!0)};var SH=zie;var t1e={avi:"video/x-msvideo",bmp:"image/bmp",bz2:"application/x-bzip2",chm:"application/vnd.ms-htmlhelp",css:"text/css",csv:"text/csv",doc:"application/msword",dvi:"application/x-dvi",eps:"application/postscript",flv:"video/x-flv",gif:"image/gif",gz:"application/x-gzip",htm:"text/html",html:"text/html",ico:"image/vnd.microsoft.icon",jnlp:"application/x-java-jnlp-file",jpeg:"image/jpeg",jpg:"image/jpeg",m3u:"audio/x-mpegurl",m4v:"video/mp4",mathml:"application/mathml+xml",mid:"audio/midi",midi:"audio/midi",mov:"video/quicktime",mp3:"audio/mpeg",mp4:"video/mp4",mp4v:"video/mp4",mpeg:"video/mpeg",mpg:"video/mpeg",odp:"application/vnd.oasis.opendocument.presentation",ods:"application/vnd.oasis.opendocument.spreadsheet",odt:"application/vnd.oasis.opendocument.text",ogg:"application/ogg",pdf:"application/pdf",png:"image/png",pps:"application/vnd.ms-powerpoint",ppt:"application/vnd.ms-powerpoint",ps:"application/postscript",qt:"video/quicktime",rdf:"application/rdf+xml",rss:"application/rss+xml",rtf:"application/rtf",svg:"image/svg+xml",swf:"application/x-shockwave-flash",text:"text/plain",tif:"image/tiff",tiff:"image/tiff",txt:"text/plain",wav:"audio/x-wav",wma:"audio/x-ms-wma",wmv:"video/x-ms-wmv",xml:"application/xml",zip:"application/zip",detectFromFilename:function(e){let t=e.toLowerCase();return t=S_(t),t1e[t]}},$ie;typeof DOMParser<"u"&&($ie=new DOMParser);var BSt=new _H({stripPrefix:!1,email:!1,replaceFn:function(e){return e.urlMatchType==="scheme"||e.urlMatchType==="www"}}),OA=32,qDe=2414016,YDe=1,XDe=16093e3,KDe=.1,$De=[null,void 0,"http://www.opengis.net/kml/2.2","http://earth.google.com/kml/2.2","http://earth.google.com/kml/2.1","http://earth.google.com/kml/2.0"],JDe=["http://www.google.com/kml/ext/2.2"],kSt=["http://www.w3.org/2005/Atom"],Ve={kml:$De,gx:JDe,atom:kSt,kmlgx:$De.concat(JDe)},Jie={Document:f1e,Folder:iwt,Placemark:rwt,NetworkLink:hwt,GroundOverlay:uwt,PhotoOverlay:m1e,ScreenOverlay:lwt,Tour:swt},Wie=class{constructor(t){this._dataSource=t,this._deferred=tf(),this._stack=[],this._promises=[],this._timeoutSet=!1,this._used=!1,this._started=0,this._timeThreshold=1e3}get dataSource(){return this._dataSource}addNodes(t,n){this._stack.push({nodes:t,index:0,processingData:n}),this._used=!0}addPromise(t){this._promises.push(t)}wait(){let t=this._deferred;return this._used||t.resolve(),Promise.all([t.promise,Promise.all(this._promises)])}process(){let t=this._stack.length===1;return t&&(this._started=Jg._getTimestamp()),this._process(t)}_giveUpTime(){if(this._timeoutSet)return;this._timeoutSet=!0,this._timeThreshold=50;let t=this;setTimeout(function(){t._timeoutSet=!1,t._started=Jg._getTimestamp(),t._process(!0)},0)}_nextNode(){let t=this._stack,n=t[t.length-1],i=n.index,r=n.nodes;if(i!==r.length)return++n.index,r[i]}_pop(){let t=this._stack;return t.pop(),t.length===0?(this._deferred.resolve(),!1):!0}_process(t){let n=this.dataSource,i=this._stack[this._stack.length-1].processingData,r=this._nextNode();for(;l(r);){let o=Jie[r.localName];if(l(o)&&(Ve.kml.indexOf(r.namespaceURI)!==-1||Ve.gx.indexOf(r.namespaceURI)!==-1)&&(o(n,r,i,this),this._timeoutSet||Jg._getTimestamp()>this._started+this._timeThreshold)){this._giveUpTime();return}r=this._nextNode()}this._pop()&&t&&this._process(!0)}};function USt(e){let t=e.slice(0,Math.min(4,e.size)),n=tf(),i=new FileReader;return i.addEventListener("load",function(){n.resolve(new DataView(i.result).getUint32(0,!1)===1347093252)}),i.addEventListener("error",function(){n.reject(i.error)}),i.readAsArrayBuffer(t),n.promise}function zSt(e){let t=tf(),n=new FileReader;return n.addEventListener("load",function(){t.resolve(n.result)}),n.addEventListener("error",function(){t.reject(n.error)}),n.readAsText(e),t.promise}function n1e(e){let t={xsi:"http://www.w3.org/2001/XMLSchema-instance"},n,i,r,o;for(let s in t)t.hasOwnProperty(s)&&(r=RegExp(`[< ]${s}:`),o=`xmlns:${s}=`,r.test(e)&&e.indexOf(o)===-1&&(l(n)||(n=e.substr(0,e.indexOf("<kml")+4),i=e.substr(n.length)),n+=` ${o}"${t[s]}"`));return l(n)&&(e=n+i),e}function i1e(e){let t=e.indexOf("xmlns:"),n=e.indexOf(">",t),i,r,o;for(;t!==-1&&t<n;)i=e.slice(t,e.indexOf('"',t)),r=t,t=e.indexOf(i,t+1),t!==-1?(o=e.indexOf('"',e.indexOf('"',t)+1),e=e.slice(0,t-1)+e.slice(o+1,e.length),t=e.indexOf("xmlns:",r-1)):t=e.indexOf("xmlns:",r+1);return e}async function VSt(e,t){let n=await e.getData(new ZR);n=n1e(n),n=i1e(n),t.kml=$ie.parseFromString(n,"application/xml")}async function Vie(e,t){let n=t1e.detectFromFilename(e.filename)??"application/octet-stream",i=await e.getData(new $R(n));t[e.filename]=i}function Mf(e,t,n,i){let r=i.keys,o=new CO.default("."),s=e.querySelectorAll(t);for(let a=0;a<s.length;a++){let c=s[a],u=c.getAttribute(n);if(l(u)){let d=new CO.default(u).absoluteTo(o).toString(),p=r.indexOf(d);if(p!==-1){let g=r[p];c.setAttribute(n,i[g]),t==="a"&&c.getAttribute("download")===null&&c.setAttribute("download",g)}}}}function Nf(e,t,n,i){let r=e.querySelectorAll(t);for(let o=0;o<r.length;o++){let s=r[o],a=s.getAttribute(n),c=Zie(a,i);l(c)&&s.setAttribute(n,c.url)}}function r1e(e,t,n){let i=Aa(e,"id");i=l(i)&&i.length!==0?i:Kn(),l(n)&&(i=n+i);let r=t.getById(i);return l(r)&&(i=Kn(),l(n)&&(i=n+i)),r=t.add(new Qr({id:i})),l(r.kml)||(r.addProperty("kml"),r.kml=new Kie),r}function vO(e,t){return e==="absolute"||e==="relativeToGround"||t==="relativeToSeaFloor"}function DH(e,t){if(!l(e))return h.fromDegrees(0,0,0,t);let n=e.match(/[^\s,\n]+/g);if(!l(n))return h.fromDegrees(0,0,0,t);let i=parseFloat(n[0]),r=parseFloat(n[1]),o=parseFloat(n[2]);return i=isNaN(i)?0:i,r=isNaN(r)?0:r,o=isNaN(o)?0:o,h.fromDegrees(i,r,o,t)}function wH(e,t){if(!l(e))return;let n=e.textContent.match(/[^\s\n]+/g);if(!l(n))return;let i=n.length,r=new Array(i),o=0;for(let s=0;s<i;s++)r[o++]=DH(n[s],t);return r}function MA(e,t){if(!l(e))return;let n=e.getAttribute(t);if(n!==null){let i=parseFloat(n);return isNaN(i)?void 0:i}}function Aa(e,t){if(!l(e))return;let n=e.getAttribute(t);return n!==null?n:void 0}function Qi(e,t,n){if(!l(e))return;let i=e.childNodes,r=i.length;for(let o=0;o<r;o++){let s=i[o];if(s.localName===t&&n.indexOf(s.namespaceURI)!==-1)return s}}function ZDe(e,t,n){if(!l(e))return;let i=[],r=e.getElementsByTagNameNS("*",t),o=r.length;for(let s=0;s<o;s++){let a=r[s];a.localName===t&&n.indexOf(a.namespaceURI)!==-1&&i.push(a)}return i}function hm(e,t,n){if(!l(e))return[];let i=[],r=e.childNodes,o=r.length;for(let s=0;s<o;s++){let a=r[s];a.localName===t&&n.indexOf(a.namespaceURI)!==-1&&i.push(a)}return i}function vi(e,t,n){let i=Qi(e,t,n);if(l(i)){let r=parseFloat(i.textContent);return isNaN(r)?void 0:r}}function Ln(e,t,n){let i=Qi(e,t,n);if(l(i))return i.textContent.trim()}function mm(e,t,n){let i=Qi(e,t,n);if(l(i)){let r=i.textContent.trim();return r==="1"||/^true$/i.test(r)}}function Zie(e,t,n){if(!l(e))return;let i;if(l(n)){e=e.replace(/\\/g,"/");let r=n[e];if(l(r))i=new De({url:r});else{let o=new CO.default(t.getUrlComponent()),s=new CO.default(e);r=n[s.absoluteTo(o)],l(r)&&(i=new De({url:r}))}}return l(i)||(i=t.getDerivedResource({url:e})),i}var Gu={maximumRed:void 0,red:void 0,maximumGreen:void 0,green:void 0,maximumBlue:void 0,blue:void 0};function qie(e,t){if(!l(e)||/^\s*$/gm.test(e))return;e[0]==="#"&&(e=e.substring(1));let n=parseInt(e.substring(0,2),16)/255,i=parseInt(e.substring(2,4),16)/255,r=parseInt(e.substring(4,6),16)/255,o=parseInt(e.substring(6,8),16)/255;return t?(o>0?(Gu.maximumRed=o,Gu.red=void 0):(Gu.maximumRed=void 0,Gu.red=0),r>0?(Gu.maximumGreen=r,Gu.green=void 0):(Gu.maximumGreen=void 0,Gu.green=0),i>0?(Gu.maximumBlue=i,Gu.blue=void 0):(Gu.maximumBlue=void 0,Gu.blue=0),Gu.alpha=n,z.fromRandom(Gu)):new z(o,r,i,n)}function IT(e,t,n){let i=Ln(e,t,n);if(l(i))return qie(i,Ln(e,"colorMode",n)==="random")}function jSt(e){let t=Qi(e,"TimeStamp",Ve.kmlgx),n=Ln(t,"when",Ve.kmlgx);if(!l(t)||!l(n)||n.length===0)return;let i=K.fromIso8601(n),r=new Ls;return r.addInterval(new Cn({start:i,stop:nt.MAXIMUM_VALUE})),r}function HSt(e){let t=Qi(e,"TimeSpan",Ve.kmlgx);if(!l(t))return;let n,i=Qi(t,"begin",Ve.kmlgx),r=l(i)?K.fromIso8601(i.textContent):void 0,o=Qi(t,"end",Ve.kmlgx),s=l(o)?K.fromIso8601(o.textContent):void 0;if(l(r)&&l(s)){if(K.lessThan(s,r)){let a=r;r=s,s=a}n=new Ls,n.addInterval(new Cn({start:r,stop:s}))}else l(r)?(n=new Ls,n.addInterval(new Cn({start:r,stop:nt.MAXIMUM_VALUE}))):l(s)&&(n=new Ls,n.addInterval(new Cn({start:nt.MINIMUM_VALUE,stop:s})));return n}function o1e(){let e=new Il;return e.width=OA,e.height=OA,e.scaleByDistance=new qt(qDe,YDe,XDe,KDe),e.pixelOffsetScaleByDistance=new qt(qDe,YDe,XDe,KDe),e}function Qie(){let e=new np;return e.outline=!0,e.outlineColor=z.WHITE,e}function s1e(){let e=new tp;return e.translucencyByDistance=new qt(3e6,1,5e6,0),e.pixelOffset=new U(17,0),e.horizontalOrigin=Hi.LEFT,e.font="16px sans-serif",e.style=Io.FILL_AND_OUTLINE,e}function ere(e,t,n,i,r){let o=Ln(e,"href",Ve.kml);if(!l(o)||o.length===0)return;if(o.indexOf("root://icons/palette-")===0){let a=o.charAt(21),c=vi(e,"x",Ve.gx)??0,u=vi(e,"y",Ve.gx)??0;c=Math.min(c/32,7),u=7-Math.min(u/32,7);let f=8*u+c;o=`https://maps.google.com/mapfiles/kml/pal${a}/icon${f}.png`}let s=Zie(o,n,i);if(r){let a=Ln(e,"refreshMode",Ve.kml),c=Ln(e,"viewRefreshMode",Ve.kml);a==="onInterval"||a==="onExpire"?yt(`kml-refreshMode-${a}`,`KML - Unsupported Icon refreshMode: ${a}`):(c==="onStop"||c==="onRegion")&&yt(`kml-refreshMode-${c}`,`KML - Unsupported Icon viewRefreshMode: ${c}`);let u=Ln(e,"viewBoundScale",Ve.kml)??1,f=c==="onStop"?"BBOX=[bboxWest],[bboxSouth],[bboxEast],[bboxNorth]":"",d=Ln(e,"viewFormat",Ve.kml)??f,p=Ln(e,"httpQuery",Ve.kml);l(d)&&s.setQueryParameters(Zf(PH(d))),l(p)&&s.setQueryParameters(Zf(PH(p)));let g=t._ellipsoid;return nre(s,t.camera,t.canvas,u,t._lastCameraView.bbox,g),s}return s}function GSt(e,t,n,i,r){let o=vi(t,"scale",Ve.kml),s=vi(t,"heading",Ve.kml),a=IT(t,"color",Ve.kml),c=Qi(t,"Icon",Ve.kml),u=ere(c,e,i,r,!1);l(c)&&!l(u)&&(u=!1);let f=vi(c,"x",Ve.gx),d=vi(c,"y",Ve.gx),p=vi(c,"w",Ve.gx),g=vi(c,"h",Ve.gx),m=Qi(t,"hotSpot",Ve.kml),y=MA(m,"x"),A=MA(m,"y"),b=Aa(m,"xunits"),x=Aa(m,"yunits"),T=n.billboard;l(T)||(T=o1e(),n.billboard=T),T.image=u,T.scale=o,T.color=a,(l(f)||l(d)||l(p)||l(g))&&(T.imageSubRegion=new et(f,d,p,g)),l(s)&&s!==0&&(T.rotation=P.toRadians(-s),T.alignedAxis=h.UNIT_Z),o=o??1;let E,v;l(y)&&(b==="pixels"?E=-y*o:b==="insetPixels"?E=(y-OA)*o:b==="fraction"&&(E=-y*OA*o),E+=OA*.5*o),l(A)&&(x==="pixels"?v=A*o:x==="insetPixels"?v=(-A+OA)*o:x==="fraction"&&(v=A*OA*o),v-=OA*.5*o),(l(E)||l(v))&&(T.pixelOffset=new U(E,v))}function IH(e,t,n,i,r){for(let o=0,s=t.childNodes.length;o<s;o++){let a=t.childNodes.item(o);if(a.localName==="IconStyle")GSt(e,a,n,i,r);else if(a.localName==="LabelStyle"){let c=n.label;l(c)||(c=s1e(),n.label=c),c.scale=vi(a,"scale",Ve.kml)??c.scale,c.fillColor=IT(a,"color",Ve.kml)??c.fillColor,c.text=n.name}else if(a.localName==="LineStyle"){let c=n.polyline;l(c)||(c=new Rl,n.polyline=c),c.width=vi(a,"width",Ve.kml),c.material=IT(a,"color",Ve.kml),l(IT(a,"outerColor",Ve.gx))&&yt("kml-gx:outerColor","KML - gx:outerColor is not supported in a LineStyle"),l(vi(a,"outerWidth",Ve.gx))&&yt("kml-gx:outerWidth","KML - gx:outerWidth is not supported in a LineStyle"),l(vi(a,"physicalWidth",Ve.gx))&&yt("kml-gx:physicalWidth","KML - gx:physicalWidth is not supported in a LineStyle"),l(mm(a,"labelVisibility",Ve.gx))&&yt("kml-gx:labelVisibility","KML - gx:labelVisibility is not supported in a LineStyle")}else if(a.localName==="PolyStyle"){let c=n.polygon;l(c)||(c=Qie(),n.polygon=c),c.material=IT(a,"color",Ve.kml)??c.material,c.fill=mm(a,"fill",Ve.kml)??c.fill,c.outline=mm(a,"outline",Ve.kml)??c.outline}else if(a.localName==="BalloonStyle"){let c=qie(Ln(a,"bgColor",Ve.kml))??z.WHITE,u=qie(Ln(a,"textColor",Ve.kml))??z.BLACK,f=Ln(a,"text",Ve.kml);n.addProperty("balloonStyle"),n.balloonStyle={bgColor:c,textColor:u,text:f}}else if(a.localName==="ListStyle"){let c=Ln(a,"listItemType",Ve.kml);(c==="radioFolder"||c==="checkOffOnly")&&yt(`kml-listStyle-${c}`,`KML - Unsupported ListStyle with listItemType: ${c}`)}}}function WSt(e,t,n,i,r){let o=new Qr,s,a=-1,c=t.childNodes,u=c.length;for(let d=0;d<u;d++){let p=c[d];(p.localName==="Style"||p.localName==="StyleMap")&&(a=d)}if(a!==-1){let d=c[a];if(d.localName==="Style")IH(e,d,o,i,r);else{let p=hm(d,"Pair",Ve.kml);for(let g=0;g<p.length;g++){let m=p[g],y=Ln(m,"key",Ve.kml);if(y==="normal"){let A=Ln(m,"styleUrl",Ve.kml);if(l(A))s=n.getById(A),l(s)||(s=n.getById(`#${A}`)),l(s)&&o.merge(s);else{let b=Qi(m,"Style",Ve.kml);IH(e,b,o,i,r)}}else yt(`kml-styleMap-${y}`,`KML - Unsupported StyleMap key: ${y}`)}}}let f=Ln(t,"styleUrl",Ve.kml);if(l(f)){let d=f;if(f[0]!=="#"&&f.indexOf("#")!==-1){let p=f.split("#"),g=p[0];d=`${i.getDerivedResource({url:g}).getUrlComponent()}#${p[1]}`}s=n.getById(d),l(s)||(s=n.getById(`#${d}`)),l(s)&&o.merge(s)}return o}function qSt(e,t,n){return t.fetchXML().then(function(i){return a1e(e,i,n,t,!0)})}function a1e(e,t,n,i,r,o){let s,a,c,u,f=ZDe(t,"Style",Ve.kml);if(l(f)){let y=f.length;for(s=0;s<y;s++)u=f[s],a=Aa(u,"id"),l(a)&&(a=`#${a}`,r&&l(i)&&(a=i.getUrlComponent()+a),l(n.getById(a))||(c=new Qr({id:a}),n.add(c),IH(e,u,c,i,o)))}let d=ZDe(t,"StyleMap",Ve.kml);if(l(d)){let y=d.length;for(s=0;s<y;s++){let A=d[s];if(a=Aa(A,"id"),l(a)){let b=hm(A,"Pair",Ve.kml);for(let x=0;x<b.length;x++){let T=b[x],E=Ln(T,"key",Ve.kml);if(E==="normal"){if(a=`#${a}`,r&&l(i)&&(a=i.getUrlComponent()+a),!l(n.getById(a))){c=n.getOrCreateEntity(a);let v=Ln(T,"styleUrl",Ve.kml);if(l(v)){v[0]!=="#"&&(v=`#${v}`),r&&l(i)&&(v=i.getUrlComponent()+v);let S=n.getById(v);l(S)&&c.merge(S)}else u=Qi(T,"Style",Ve.kml),IH(e,u,c,i,o)}}else yt(`kml-styleMap-${E}`,`KML - Unsupported StyleMap key: ${E}`)}}}}let p=[],g=t.getElementsByTagName("styleUrl"),m=g.length;for(s=0;s<m;s++){let y=g[s].textContent;if(y[0]!=="#"){let A=y.split("#");if(A.length===2){let b=A[0],x=i.getDerivedResource({url:b});p.push(qSt(e,x,n))}}}return p}function tre(e,t,n){let i=new oA(e,t.id,["position"]),r=new Ug(t.position);t.polyline=l(n.polyline)?n.polyline.clone():new Rl,t.polyline.positions=new iA([i,r])}function c1e(e,t){return!l(e)&&!l(t)||e==="clampToGround"?We.CLAMP_TO_GROUND:e==="relativeToGround"?We.RELATIVE_TO_GROUND:e==="absolute"?We.NONE:t==="clampToSeaFloor"?(yt("kml-gx:altitudeMode-clampToSeaFloor","KML - <gx:altitudeMode>:clampToSeaFloor is currently not supported, using <kml:altitudeMode>:clampToGround."),We.CLAMP_TO_GROUND):t==="relativeToSeaFloor"?(yt("kml-gx:altitudeMode-relativeToSeaFloor","KML - <gx:altitudeMode>:relativeToSeaFloor is currently not supported, using <kml:altitudeMode>:relativeToGround."),We.RELATIVE_TO_GROUND):(l(e)?yt("kml-altitudeMode-unknown",`KML - Unknown <kml:altitudeMode>:${e}, using <kml:altitudeMode>:CLAMP_TO_GROUND.`):yt("kml-gx:altitudeMode-unknown",`KML - Unknown <gx:altitudeMode>:${t}, using <kml:altitudeMode>:CLAMP_TO_GROUND.`),We.CLAMP_TO_GROUND)}function YSt(e,t,n){return n==="relativeToSeaFloor"||t==="absolute"||t==="relativeToGround"?e:((l(t)&&t!=="clampToGround"||l(n)&&n!=="clampToSeaFloor")&&yt("kml-altitudeMode-unknown",`KML - Unknown altitudeMode: ${t??n}`),new Ug(e))}function XSt(e,t,n,i){if(!l(e))return;if(n==="relativeToSeaFloor"||t==="absolute"||t==="relativeToGround")return e;(l(t)&&t!=="clampToGround"||l(n)&&n!=="clampToSeaFloor")&&yt("kml-altitudeMode-unknown",`KML - Unknown altitudeMode: ${t??n}`);let r=e.length;for(let o=0;o<r;o++){let s=e[o];i.scaleToGeodeticSurface(s,s)}return e}function RH(e,t,n,i){let r=t.label;l(r)||(r=l(n.label)?n.label.clone():s1e(),t.label=r),r.text=t.name;let o=t.billboard;if(l(o)||(o=l(n.billboard)?n.billboard.clone():o1e(),t.billboard=o),l(o.image)?o.image.getValue()||(o.image=void 0):o.image=e._pinBuilder.fromColor(z.YELLOW,64),l(o.scale)){let s=o.scale.getValue();s!==0?r.pixelOffset=new U(s*16+1,0):(r.pixelOffset=void 0,r.horizontalOrigin=void 0)}l(i)&&e._clampToGround&&(o.heightReference=i,r.heightReference=i)}function l1e(e,t){let n=e.path;l(n)||(n=new $_,n.leadTime=0,e.path=n);let i=t.polyline;l(i)&&(n.material=i.material,n.width=i.width)}function KSt(e,t,n,i,r){let o=Ln(n,"coordinates",Ve.kml),s=Ln(n,"altitudeMode",Ve.kml),a=Ln(n,"altitudeMode",Ve.gx),c=mm(n,"extrude",Ve.kml),u=e._ellipsoid,f=DH(o,u);return i.position=f,RH(e,i,r,c1e(s,a)),c&&vO(s,a)&&tre(t,i,r),!0}function QDe(e,t,n,i,r){let o=Qi(n,"coordinates",Ve.kml),s=Ln(n,"altitudeMode",Ve.kml),a=Ln(n,"altitudeMode",Ve.gx),c=mm(n,"extrude",Ve.kml),u=mm(n,"tessellate",Ve.kml),f=vO(s,a),d=vi(n,"drawOrder",Ve.gx),p=e._ellipsoid,g=wH(o,p),m=r.polyline;if(f&&c){let y=new J_;i.wall=y,y.positions=g;let A=r.polygon;l(A)&&(y.fill=A.fill,y.material=A.material),y.outline=!0,l(m)?(y.outlineColor=l(m.material)?m.material.color:z.WHITE,y.outlineWidth=m.width):l(A)&&(y.outlineColor=l(A.material)?A.material.color:z.WHITE)}else if(e._clampToGround&&!f&&u){let y=new Rl;y.clampToGround=!0,i.polyline=y,y.positions=g,l(m)?(y.material=l(m.material)?m.material.color.getValue(nt.MINIMUM_VALUE):z.WHITE,y.width=m.width??1):(y.material=z.WHITE,y.width=1),y.zIndex=d}else l(d)&&yt("kml-gx:drawOrder","KML - gx:drawOrder is not supported in LineStrings when clampToGround is false"),e._clampToGround&&!u&&yt("kml-line-tesselate","Ignoring clampToGround for KML lines without the tessellate flag."),m=l(m)?m.clone():new Rl,i.polyline=m,m.positions=XSt(g,s,a,p),(!u||f)&&(m.arcType=ln.NONE);return!0}function $St(e,t,n,i,r){let o=Qi(n,"outerBoundaryIs",Ve.kml),s=Qi(o,"LinearRing",Ve.kml),a=Qi(s,"coordinates",Ve.kml),c=e._ellipsoid,u=wH(a,c),f=mm(n,"extrude",Ve.kml),d=Ln(n,"altitudeMode",Ve.kml),p=Ln(n,"altitudeMode",Ve.gx),g=vO(d,p),m=l(r.polygon)?r.polygon.clone():Qie(),y=r.polyline;if(l(y)&&(m.outlineColor=l(y.material)?y.material.color:z.WHITE,m.outlineWidth=y.width),i.polygon=m,g?(m.perPositionHeight=!0,m.extrudedHeight=f?0:void 0):e._clampToGround||(m.height=0),l(u)){let A=new Hc(u),b=hm(n,"innerBoundaryIs",Ve.kml);for(let x=0;x<b.length;x++){s=hm(b[x],"LinearRing",Ve.kml);for(let T=0;T<s.length;T++)a=Qi(s[T],"coordinates",Ve.kml),u=wH(a,c),l(u)&&A.holes.push(new Hc(u))}m.hierarchy=A}return!0}function JSt(e,t,n,i,r){let o=Ln(n,"altitudeMode",Ve.kml),s=Ln(n,"altitudeMode",Ve.gx),a=hm(n,"coord",Ve.gx),c=hm(n,"angles",Ve.gx),u=hm(n,"when",Ve.kml),f=mm(n,"extrude",Ve.kml),d=vO(o,s),p=e._ellipsoid;c.length>0&&yt("kml-gx:angles","KML - gx:angles are not supported in gx:Tracks");let g=Math.min(a.length,u.length),m=[],y=[];for(let b=0;b<g;b++){let x=DH(a[b].textContent,p);m.push(x),y.push(K.fromIso8601(u[b].textContent))}let A=new Cc;return A.addSamples(y,m),i.position=A,RH(e,i,r,c1e(o,s)),l1e(i,r),i.availability=new Ls,u.length>0&&i.availability.addInterval(new Cn({start:y[0],stop:y[y.length-1]})),d&&f&&tre(t,i,r),!0}function e1e(e,t,n,i,r,o,s,a,c){let u=e[0],f=e[e.length-1],d=new Cc;d.addSamples(e,t),n.intervals.addInterval(new Cn({start:u,stop:f,isStartIncluded:c,isStopIncluded:c,data:YSt(d,s,a)})),i.addInterval(new Cn({start:u,stop:f,isStartIncluded:c,isStopIncluded:c})),r.intervals.addInterval(new Cn({start:u,stop:f,isStartIncluded:c,isStopIncluded:c,data:o}))}function ZSt(e,t,n,i,r){let o=mm(n,"interpolate",Ve.gx),s=hm(n,"Track",Ve.gx),a,c,u,f=!1,d=new cA,p=new Ls,g=new Ec,m=e._ellipsoid;for(let y=0,A=s.length;y<A;y++){let b=s[y],x=hm(b,"when",Ve.kml),T=hm(b,"coord",Ve.gx),E=Ln(b,"altitudeMode",Ve.kml),v=Ln(b,"altitudeMode",Ve.gx),S=vO(E,v),I=mm(b,"extrude",Ve.kml),R=Math.min(T.length,x.length),O=[];a=[];for(let L=0;L<R;L++){let _=DH(T[L].textContent,m);O.push(_),a.push(K.fromIso8601(x[L].textContent))}o&&(l(c)&&e1e([c,a[0]],[u,O[0]],g,p,d,!1,"absolute",void 0,!1),c=a[R-1],u=O[O.length-1]),e1e(a,O,g,p,d,S&&I,E,v,!0),f=f||S&&I}return i.availability=p,i.position=g,RH(e,i,r),l1e(i,r),f&&(tre(t,i,r),i.polyline.show=d),!0}var u1e={Point:KSt,LineString:QDe,LinearRing:QDe,Polygon:$St,Track:JSt,MultiTrack:ZSt,MultiGeometry:QSt,Model:ewt};function QSt(e,t,n,i,r,o){let s=n.childNodes,a=!1;for(let c=0,u=s.length;c<u;c++){let f=s.item(c),d=u1e[f.localName];if(l(d)){let p=r1e(f,t,o);p.parent=i,p.name=i.name,p.availability=i.availability,p.description=i.description,p.kml=i.kml,d(e,t,f,p,r)&&(a=!0)}}return a}function ewt(e,t,n,i,r){return yt("kml-unsupportedGeometry",`KML - Unsupported geometry: ${n.localName}`),!1}function twt(e,t){let n=Qi(e,"ExtendedData",Ve.kml);if(!l(n))return;l(Qi(n,"SchemaData",Ve.kml))&&yt("kml-schemaData","KML - SchemaData is unsupported"),l(Aa(n,"xmlns:prefix"))&&yt("kml-extendedData","KML - ExtendedData with xmlns:prefix is unsupported");let i={},r=hm(n,"Data",Ve.kml);if(l(r)){let o=r.length;for(let s=0;s<o;s++){let a=r[s],c=Aa(a,"name");l(c)&&(i[c]={displayName:Ln(a,"displayName",Ve.kml),value:Ln(a,"value",Ve.kml)})}}t.kml.extendedData=i}var kr;typeof document<"u"&&(kr=document.createElement("div"));function nwt(e,t,n,i,r){let o,s,a,c=t.kml,u=c.extendedData,f=Ln(e,"description",Ve.kml),d=t.balloonStyle??n.balloonStyle,p=z.WHITE,g=z.BLACK,m=f;l(d)&&(p=d.bgColor??z.WHITE,g=d.textColor??z.BLACK,m=d.text??f);let y;if(l(m)){if(m=m.replace("$[name]",t.name??""),m=m.replace("$[description]",f??""),m=m.replace("$[address]",c.address??""),m=m.replace("$[Snippet]",c.snippet??""),m=m.replace("$[id]",t.id),m=m.replace("$[geDirections]",""),l(u)){let x=m.match(/\$\[.+?\]/g);if(x!==null)for(o=0;o<x.length;o++){let T=x[o],E=T.substr(2,T.length-3),v=/\/displayName$/.test(E);E=E.replace(/\/displayName$/,""),y=u[E],l(y)&&(y=v?y.displayName:y.value),l(y)&&(m=m.replace(T,y??""))}}}else if(l(u)&&(a=Object.keys(u),a.length>0)){for(m='<table class="cesium-infoBox-defaultTable cesium-infoBox-defaultTable-lighter"><tbody>',o=0;o<a.length;o++)s=a[o],y=u[s],m+=`<tr><th>${y.displayName??s}</th><td>${y.value??""}</td></tr>`;m+="</tbody></table>"}if(!l(m))return;m=BSt.link(m),kr.innerHTML=m;let A=kr.querySelectorAll("a");for(o=0;o<A.length;o++)A[o].setAttribute("target","_blank");l(i)&&i.keys.length>1&&(Mf(kr,"a","href",i),Mf(kr,"link","href",i),Mf(kr,"area","href",i),Mf(kr,"img","src",i),Mf(kr,"iframe","src",i),Mf(kr,"video","src",i),Mf(kr,"audio","src",i),Mf(kr,"source","src",i),Mf(kr,"track","src",i),Mf(kr,"input","src",i),Mf(kr,"embed","src",i),Mf(kr,"script","src",i),Mf(kr,"video","poster",i)),Nf(kr,"a","href",r),Nf(kr,"link","href",r),Nf(kr,"area","href",r),Nf(kr,"img","src",r),Nf(kr,"iframe","src",r),Nf(kr,"video","src",r),Nf(kr,"audio","src",r),Nf(kr,"source","src",r),Nf(kr,"track","src",r),Nf(kr,"input","src",r),Nf(kr,"embed","src",r),Nf(kr,"script","src",r),Nf(kr,"video","poster",r);let b='<div class="cesium-infoBox-description-lighter" style="';b+="overflow:auto;",b+="word-wrap:break-word;",b+=`background-color:${p.toCssColorString()};`,b+=`color:${g.toCssColorString()};`,b+='">',b+=`${kr.innerHTML}</div>`,kr.innerHTML="",t.description=b}function OH(e,t,n){let i=n.entityCollection,r=n.parentEntity,o=n.sourceResource,s=n.uriResolver,a=r1e(t,i,n.context),c=a.kml,u=WSt(e,t,n.styleCollection,o,s),f=Ln(t,"name",Ve.kml);a.name=f,a.parent=r;let d=HSt(t);l(d)||(d=jSt(t)),a.availability=d,ire(a);function p(T){return T?T.show&&p(T.parent):!0}let g=mm(t,"visibility",Ve.kml);a.show=p(r)&&(g??!0);let m=Qi(t,"author",Ve.atom),y=c.author;y.name=Ln(m,"name",Ve.atom),y.uri=Ln(m,"uri",Ve.atom),y.email=Ln(m,"email",Ve.atom);let A=Qi(t,"link",Ve.atom),b=c.link;b.href=Aa(A,"href"),b.hreflang=Aa(A,"hreflang"),b.rel=Aa(A,"rel"),b.type=Aa(A,"type"),b.title=Aa(A,"title"),b.length=Aa(A,"length"),c.address=Ln(t,"address",Ve.kml),c.phoneNumber=Ln(t,"phoneNumber",Ve.kml),c.snippet=Ln(t,"Snippet",Ve.kml),twt(t,a),nwt(t,a,u,s,o);let x=e._ellipsoid;return h1e(t,a,x),d1e(t,a,x),l(Qi(t,"Region",Ve.kml))&&yt("kml-region","KML - Placemark Regions are unsupported"),{entity:a,styleEntity:u}}function f1e(e,t,n,i){i.addNodes(t.childNodes,n),i.process()}function iwt(e,t,n,i){let r=OH(e,t,n),o=Ze(n);o.parentEntity=r.entity,f1e(e,t,o,i)}function rwt(e,t,n,i){let r=OH(e,t,n),o=r.entity,s=r.styleEntity,a=!1,c=t.childNodes;for(let u=0,f=c.length;u<f&&!a;u++){let d=c.item(u),p=u1e[d.localName];l(p)&&(p(e,n.entityCollection,d,o,s,o.id),a=!0)}a||(o.merge(s),RH(e,o,s))}var owt={FlyTo:cwt,Wait:awt,SoundCue:jie,AnimatedUpdate:jie,TourControl:jie};function swt(e,t,n,i){let r=Ln(t,"name",Ve.kml),o=Aa(t,"id"),s=new EH(r,o),a=Qi(t,"Playlist",Ve.gx);if(a){let c=e._ellipsoid,u=a.childNodes;for(let f=0;f<u.length;f++){let d=u[f];if(d.localName){let p=owt[d.localName];p?p(s,d,c):console.log(`Unknown KML Tour playlist entry type ${d.localName}`)}}}e._kmlTours.push(s)}function jie(e,t){yt(`KML Tour unsupported node ${t.localName}`)}function awt(e,t){let n=vi(t,"duration",Ve.gx);e.addPlaylistEntry(new SH(n))}function cwt(e,t,n){let i=vi(t,"duration",Ve.gx),r=Ln(t,"flyToMode",Ve.gx),o={kml:{}};h1e(t,o,n),d1e(t,o,n);let s=o.kml.lookAt||o.kml.camera,a=new vH(i,r,s);e.addPlaylistEntry(a)}function d1e(e,t,n){let i=Qi(e,"Camera",Ve.kml);if(l(i)){let r=vi(i,"longitude",Ve.kml)??0,o=vi(i,"latitude",Ve.kml)??0,s=vi(i,"altitude",Ve.kml)??0,a=vi(i,"heading",Ve.kml)??0,c=vi(i,"tilt",Ve.kml)??0,u=vi(i,"roll",Ve.kml)??0,f=h.fromDegrees(r,o,s,n),d=kc.fromDegrees(a,c-90,u);t.kml.camera=new bH(f,d)}}function h1e(e,t,n){let i=Qi(e,"LookAt",Ve.kml);if(l(i)){let r=vi(i,"longitude",Ve.kml)??0,o=vi(i,"latitude",Ve.kml)??0,s=vi(i,"altitude",Ve.kml)??0,a=vi(i,"heading",Ve.kml),c=vi(i,"tilt",Ve.kml),u=vi(i,"range",Ve.kml)??0;c=P.toRadians(c??0),a=P.toRadians(a??0);let f=new om(a,c-P.PI_OVER_TWO,u),d=h.fromDegrees(r,o,s,n);t.kml.lookAt=new xH(d,f)}}function lwt(e,t,n,i){let r=n.screenOverlayContainer;if(!l(r))return;let o=n.sourceResource,s=n.uriResolver,a=Qi(t,"Icon",Ve.kml),c=ere(a,e,o,s,!1);if(!l(c))return;let u=document.createElement("img");e._screenOverlays.push(u),u.src=c.url,u.onload=function(){let f=["position: absolute"],d=Qi(t,"screenXY",Ve.kml),p=Qi(t,"overlayXY",Ve.kml),g=Qi(t,"size",Ve.kml),m,y,A,b,x,T;l(g)&&(m=MA(g,"x"),y=MA(g,"y"),A=Aa(g,"xunits"),b=Aa(g,"yunits"),l(m)&&m!==-1&&m!==0&&(A==="fraction"?x=`width: ${Math.floor(m*100)}%`:A==="pixels"&&(x=`width: ${m}px`),f.push(x)),l(y)&&y!==-1&&y!==0&&(b==="fraction"?T=`height: ${Math.floor(y*100)}%`:b==="pixels"&&(T=`height: ${y}px`),f.push(T))),u.style=f.join(";");let E=0,v=u.height;l(p)&&(m=MA(p,"x"),y=MA(p,"y"),A=Aa(p,"xunits"),b=Aa(p,"yunits"),l(m)&&(A==="fraction"?E=m*u.width:(A==="pixels"||A==="insetPixels")&&(E=m)),l(y)&&(b==="fraction"?v=y*u.height:(b==="pixels"||b==="insetPixels")&&(v=y))),l(d)&&(m=MA(d,"x"),y=MA(d,"y"),A=Aa(d,"xunits"),b=Aa(d,"yunits"),l(m)&&(A==="fraction"?x=`left: calc(${Math.floor(m*100)}% - ${E}px)`:A==="pixels"?x=`left: ${m-E}px`:A==="insetPixels"&&(x=`right: ${m-E}px`),f.push(x)),l(y)&&(b==="fraction"?T=`bottom: calc(${Math.floor(y*100)}% - ${v}px)`:b==="pixels"?T=`bottom: ${y-v}px`:b==="insetPixels"&&(T=`top: ${y-v}px`),f.push(T))),u.style=f.join(";")},r.appendChild(u)}function uwt(e,t,n,i){let o=OH(e,t,n).entity,s,a=!1,c=e._ellipsoid,u=wH(Qi(t,"LatLonQuad",Ve.gx),c),f=vi(t,"drawOrder",Ve.kml);if(l(u))s=Qie(),s.hierarchy=new Hc(u),s.zIndex=f,o.polygon=s,a=!0;else{s=new ip,s.zIndex=f,o.rectangle=s;let m=Qi(t,"LatLonBox",Ve.kml);if(l(m)){let y=vi(m,"west",Ve.kml),A=vi(m,"south",Ve.kml),b=vi(m,"east",Ve.kml),x=vi(m,"north",Ve.kml);l(y)&&(y=P.negativePiToPi(P.toRadians(y))),l(A)&&(A=P.clampToLatitudeRange(P.toRadians(A))),l(b)&&(b=P.negativePiToPi(P.toRadians(b))),l(x)&&(x=P.clampToLatitudeRange(P.toRadians(x))),s.coordinates=new ie(y,A,b,x);let T=vi(m,"rotation",Ve.kml);if(l(T)){let E=P.toRadians(T);s.rotation=E,s.stRotation=E}}}let d=Qi(t,"Icon",Ve.kml),p=ere(d,e,n.sourceResource,n.uriResolver,!0);if(l(p)){a&&yt("kml-gx:LatLonQuad","KML - gx:LatLonQuad Icon does not support texture projection.");let m=vi(d,"x",Ve.gx),y=vi(d,"y",Ve.gx),A=vi(d,"w",Ve.gx),b=vi(d,"h",Ve.gx);(l(m)||l(y)||l(A)||l(b))&&yt("kml-groundOverlay-xywh","KML - gx:x, gx:y, gx:w, gx:h aren't supported for GroundOverlays"),s.material=p,s.material.color=IT(t,"color",Ve.kml),s.material.transparent=!0}else s.material=IT(t,"color",Ve.kml);let g=Ln(t,"altitudeMode",Ve.kml);l(g)?g==="absolute"?(s.height=vi(t,"altitude",Ve.kml),s.zIndex=void 0):g!=="clampToGround"&&yt("kml-altitudeMode-unknown",`KML - Unknown altitudeMode: ${g}`):(g=Ln(t,"altitudeMode",Ve.gx),g==="relativeToSeaFloor"?(yt("kml-altitudeMode-relativeToSeaFloor","KML - altitudeMode relativeToSeaFloor is currently not supported, treating as absolute."),s.height=vi(t,"altitude",Ve.kml),s.zIndex=void 0):g==="clampToSeaFloor"?yt("kml-altitudeMode-clampToSeaFloor","KML - altitudeMode clampToSeaFloor is currently not supported, treating as clampToGround."):l(g)&&yt("kml-altitudeMode-unknown",`KML - Unknown altitudeMode: ${g}`))}function m1e(e,t,n,i){e._unsupportedNode.raiseEvent(e,n.parentEntity,t,n.entityCollection,n.styleCollection,n.sourceResource,n.uriResolver),yt(`kml-unsupportedFeature-${t.nodeName}`,`KML - Unsupported feature: ${t.nodeName}`)}var NA={INTERVAL:0,EXPIRE:1,STOP:2};function PH(e){if(!l(e)||e.length===0)return"";let t=e[0];return(t==="&"||t==="?")&&(e=e.substring(1)),e}var fwt=new ie,Ow=new he,Hie=new U,dwt=new h;function nre(e,t,n,i,r,o){function s(u){return u<-P.PI_OVER_TWO?-P.PI_OVER_TWO:u>P.PI_OVER_TWO?P.PI_OVER_TWO:u}function a(u){return u>P.PI?u-P.TWO_PI:u<-P.PI?u+P.TWO_PI:u}let c=wE(e.queryParameters);if(c=c.replace(/%5B/g,"[").replace(/%5D/g,"]"),l(t)&&t._mode!==re.MORPHING){let u,f;if(r=r??fwt,l(n)&&(Hie.x=n.clientWidth*.5,Hie.y=n.clientHeight*.5,u=t.pickEllipsoid(Hie,o,dwt)),l(u)?f=o.cartesianToCartographic(u,Ow):(f=ie.center(r,Ow),u=o.cartographicToCartesian(f)),l(i)&&!P.equalsEpsilon(i,1,P.EPSILON9)){let b=r.width*i*.5,x=r.height*i*.5;r=new ie(a(f.longitude-b),s(f.latitude-x),a(f.longitude+b),s(f.latitude+x))}c=c.replace("[bboxWest]",P.toDegrees(r.west).toString()),c=c.replace("[bboxSouth]",P.toDegrees(r.south).toString()),c=c.replace("[bboxEast]",P.toDegrees(r.east).toString()),c=c.replace("[bboxNorth]",P.toDegrees(r.north).toString());let d=P.toDegrees(f.longitude).toString(),p=P.toDegrees(f.latitude).toString();c=c.replace("[lookatLon]",d),c=c.replace("[lookatLat]",p),c=c.replace("[lookatTilt]",P.toDegrees(t.pitch).toString()),c=c.replace("[lookatHeading]",P.toDegrees(t.heading).toString()),c=c.replace("[lookatRange]",h.distance(t.positionWC,u)),c=c.replace("[lookatTerrainLon]",d),c=c.replace("[lookatTerrainLat]",p),c=c.replace("[lookatTerrainAlt]",f.height.toString()),o.cartesianToCartographic(t.positionWC,Ow),c=c.replace("[cameraLon]",P.toDegrees(Ow.longitude).toString()),c=c.replace("[cameraLat]",P.toDegrees(Ow.latitude).toString()),c=c.replace("[cameraAlt]",P.toDegrees(Ow.height).toString());let g=t.frustum,m=g.aspectRatio,y="",A="";if(l(m)){let b=P.toDegrees(g.fov);m>1?(y=b,A=b/m):(A=b,y=b*m)}c=c.replace("[horizFov]",y.toString()),c=c.replace("[vertFov]",A.toString())}else c=c.replace("[bboxWest]","-180"),c=c.replace("[bboxSouth]","-90"),c=c.replace("[bboxEast]","180"),c=c.replace("[bboxNorth]","90"),c=c.replace("[lookatLon]",""),c=c.replace("[lookatLat]",""),c=c.replace("[lookatRange]",""),c=c.replace("[lookatTilt]",""),c=c.replace("[lookatHeading]",""),c=c.replace("[lookatTerrainLon]",""),c=c.replace("[lookatTerrainLat]",""),c=c.replace("[lookatTerrainAlt]",""),c=c.replace("[cameraLon]",""),c=c.replace("[cameraLat]",""),c=c.replace("[cameraAlt]",""),c=c.replace("[horizFov]",""),c=c.replace("[vertFov]","");l(n)?(c=c.replace("[horizPixels]",n.clientWidth),c=c.replace("[vertPixels]",n.clientHeight)):(c=c.replace("[horizPixels]",""),c=c.replace("[vertPixels]","")),c=c.replace("[terrainEnabled]","1"),c=c.replace("[clientVersion]","1"),c=c.replace("[kmlVersion]","2.2"),c=c.replace("[clientName]","Cesium"),c=c.replace("[language]","English"),e.setQueryParameters(Zf(c))}function hwt(e,t,n,i){let o=OH(e,t,n).entity,s=n.sourceResource,a=n.uriResolver,c=Qi(t,"Link",Ve.kml);if(l(c)||(c=Qi(t,"Url",Ve.kml)),l(c)){let u=Ln(c,"href",Ve.kml),f,d;if(l(u)){let p=u;if(u=Zie(u,s,n.uriResolver),/^data:/.test(u.getUrlComponent()))/\.kmz/i.test(s.getUrlComponent())||(p=s.getDerivedResource({url:p}));else{if(p=u.clone(),f=Ln(c,"viewRefreshMode",Ve.kml),f==="onRegion"){yt("kml-refrehMode-onRegion","KML - Unsupported viewRefreshMode: onRegion");return}d=Ln(c,"viewBoundScale",Ve.kml)??1;let A=f==="onStop"?"BBOX=[bboxWest],[bboxSouth],[bboxEast],[bboxNorth]":"",b=Ln(c,"viewFormat",Ve.kml)??A,x=Ln(c,"httpQuery",Ve.kml);l(b)&&u.setQueryParameters(Zf(PH(b))),l(x)&&u.setQueryParameters(Zf(PH(x)));let T=e._ellipsoid;nre(u,e.camera,e.canvas,d,e._lastCameraView.bbox,T)}let g={sourceUri:p,uriResolver:a,context:o.id,screenOverlayContainer:n.screenOverlayContainer},m=new rc,y=Xie(e,m,u,g).then(function(A){let b=e._entityCollection,x=m.values;b.suspendEvents();for(let v=0;v<x.length;v++){let S=x[v];l(S.parent)||(S.parent=o,ire(S)),b.add(S)}b.resumeEvents();let T=Ln(c,"refreshMode",Ve.kml),E=vi(c,"refreshInterval",Ve.kml)??0;if(T==="onInterval"&&E>0||T==="onExpire"||f==="onStop"){let v=Qi(A,"NetworkLinkControl",Ve.kml),S=l(v),I=K.now(),R={id:Kn(),href:u,cookie:{},lastUpdated:I,updating:!1,entity:o,viewBoundScale:d,needsUpdate:!1,cameraUpdateTime:I},O=0;if(S&&(R.cookie=Zf(Ln(v,"cookie",Ve.kml)??""),O=vi(v,"minRefreshPeriod",Ve.kml)??0),T==="onInterval")S&&(E=Math.max(O,E)),R.refreshMode=NA.INTERVAL,R.time=E;else if(T==="onExpire"){let L;if(S&&(L=Ln(v,"expires",Ve.kml)),l(L))try{let _=K.fromIso8601(L),C=K.secondsDifference(_,I);C>0&&C<O&&K.addSeconds(I,O,_),R.refreshMode=NA.EXPIRE,R.time=_}catch{yt("kml-refreshMode-onInterval-onExpire","KML - NetworkLinkControl expires is not a valid date")}else yt("kml-refreshMode-onExpire","KML - refreshMode of onExpire requires the NetworkLinkControl to have an expires element")}else l(e.camera)?(R.refreshMode=NA.STOP,R.time=vi(c,"viewRefreshTime",Ve.kml)??0):yt("kml-refrehMode-onStop-noCamera","A NetworkLink with viewRefreshMode=onStop requires the `camera` property to be defined.");l(R.refreshMode)&&e._networkLinks.set(R.id,R)}}).catch(function(A){yt(`An error occured during loading ${u.url}`),e._error.raiseEvent(e,A)});i.addPromise(y)}}}function mwt(e,t,n,i){let r=Jie[t.localName];return l(r)?r(e,t,n,i):m1e(e,t,n,i)}function Yie(e,t,n,i,r,o,s){t.removeAll();let a=n.documentElement,c=a.localName==="Document"?a:Qi(a,"Document",Ve.kml),u=Ln(c,"name",Ve.kml);l(u)||(u=nA(i.getUrlComponent())),l(e._name)||(e._name=u);let f=new Jg._DeferredLoading(e),d=new rc(e);return Promise.all(a1e(e,n,d,i,!1,r)).then(function(){let p=n.documentElement;if(p.localName==="kml"){let m=p.childNodes;for(let y=0;y<m.length;y++){let A=m[y];if(l(Jie[A.localName])){p=A;break}}}let g={parentEntity:void 0,entityCollection:t,styleCollection:d,sourceResource:i,uriResolver:r,context:s,screenOverlayContainer:o};return t.suspendEvents(),mwt(e,p,g,f),t.resumeEvents(),f.wait().then(function(){return n.documentElement})})}async function pwt(e,t,n,i,r){let o=Zt("ThirdParty/Workers/zip-web-worker.js"),s=Zt("ThirdParty/zip-module.wasm");LR({workerURI:o,wasmURI:s});let a=new yT(new zu(n)),c=await a.getEntries(),u=[],f={},d;for(let p=0;p<c.length;p++){let g=c[p];g.directory||(/\.kml$/i.test(g.filename)&&(!l(d)||!/\//i.test(g.filename))?(l(d)&&u.push(Vie(d,f)),d=g):u.push(Vie(g,f)))}if(l(d)&&u.push(VSt(d,f)),await Promise.all(u),a.close(),!l(f.kml))throw new oe("KMZ file does not contain a KML document.");return f.keys=Object.keys(f),Yie(e,t,f.kml,i,f,r)}function Xie(e,t,n,i){i=i??H.EMPTY_OBJECT;let r=i.sourceUri,o=i.uriResolver,s=i.context,a=i.screenOverlayContainer,c=n;if(typeof n=="string"||n instanceof De){n=De.createIfNeeded(n),c=n.fetchBlob(),r=r??n.clone();let u=e._resourceCredits,f=n.credits;if(l(f)){let d=f.length;for(let p=0;p<d;p++)u.push(f[p])}}else r=r??De.DEFAULT.clone();return r=De.createIfNeeded(r),l(a)&&(a=kn(a)),Promise.resolve(c).then(function(u){return u instanceof Blob?USt(u).then(function(f){return f?pwt(e,t,u,r,a):zSt(u).then(function(d){d=n1e(d),d=i1e(d);let p,g;try{p=$ie.parseFromString(d,"application/xml")}catch(m){g=m.toString()}if(l(g)||p.body||p.documentElement.tagName==="parsererror"){let m=l(g)?g:p.documentElement.firstChild.nodeValue;throw m||(m=p.body.innerText),new oe(m)}return Yie(e,t,p,r,o,a,s)})}):Yie(e,t,u,r,o,a,s)}).catch(function(u){return e._error.raiseEvent(e,u),console.log(u),Promise.reject(u)})}var Jg=class e{constructor(t){t=t??H.EMPTY_OBJECT;let n=t.camera,i=t.canvas;this._changed=new be,this._error=new be,this._loading=new be,this._refresh=new be,this._unsupportedNode=new be,this._clock=void 0,this._entityCollection=new rc(this),this._name=void 0,this._isLoading=!1,this._pinBuilder=new wA,this._networkLinks=new zt,this._entityCluster=new kd,this.canvas=i,this.camera=n,this._lastCameraView={position:l(n)?h.clone(n.positionWC):void 0,direction:l(n)?h.clone(n.directionWC):void 0,up:l(n)?h.clone(n.upWC):void 0,bbox:l(n)?n.computeViewRectangle():ie.clone(ie.MAX_VALUE)},this._ellipsoid=t.ellipsoid??ee.default;let r=t.credit;typeof r=="string"&&(r=new It(r)),this._credit=r,this._resourceCredits=[],this._kmlTours=[],this._screenOverlays=[]}static load(t,n){return n=n??H.EMPTY_OBJECT,new e(n).load(t,n)}get name(){return this._name}set name(t){this._name!==t&&(this._name=t,this._changed.raiseEvent(this))}get clock(){return this._clock}get entities(){return this._entityCollection}get isLoading(){return this._isLoading}get changedEvent(){return this._changed}get errorEvent(){return this._error}get loadingEvent(){return this._loading}get refreshEvent(){return this._refresh}get unsupportedNodeEvent(){return this._unsupportedNode}get show(){return this._entityCollection.show}set show(t){this._entityCollection.show=t}get clustering(){return this._entityCluster}set clustering(t){this._entityCluster=t}get credit(){return this._credit}get kmlTours(){return this._kmlTours}load(t,n){n=n??H.EMPTY_OBJECT,Fs.setLoading(this,!0);let i=this._name;this._name=void 0,this._clampToGround=n.clampToGround??!1;let r=this;return Xie(this,this._entityCollection,t,n).then(function(){let o,s=r._entityCollection.computeAvailability(),a=s.start,c=s.stop,u=K.equals(a,nt.MINIMUM_VALUE),f=K.equals(c,nt.MAXIMUM_VALUE);if(!u||!f){let p;u&&(p=new Date,p.setHours(0,0,0,0),a=K.fromDate(p)),f&&(p=new Date,p.setHours(24,0,0,0),c=K.fromDate(p)),o=new Np,o.startTime=a,o.stopTime=c,o.currentTime=K.clone(a),o.clockRange=Bs.LOOP_STOP,o.clockStep=Hr.SYSTEM_CLOCK_MULTIPLIER,o.multiplier=Math.round(Math.min(Math.max(K.secondsDifference(c,a)/60,1),31556900))}let d=!1;return o!==r._clock&&(r._clock=o,d=!0),i!==r._name&&(d=!0),d&&r._changed.raiseEvent(r),Fs.setLoading(r,!1),r}).catch(function(o){return Fs.setLoading(r,!1),r._error.raiseEvent(r,o),console.log(o),Promise.reject(o)})}destroy(){for(;this._screenOverlays.length>0;)this._screenOverlays.pop().remove()}update(t){let n=this._networkLinks;if(n.length===0)return!0;let i=K.now(),r=this;Gie.removeAll();function o(d){let p=d._children,g=p.length;for(let m=0;m<g;++m){let y=p[m];Gie.set(y.id,y),o(y)}}let s=!1,a=this._lastCameraView,c=this.camera;l(c)&&!(c.positionWC.equalsEpsilon(a.position,P.EPSILON7)&&c.directionWC.equalsEpsilon(a.direction,P.EPSILON7)&&c.upWC.equalsEpsilon(a.up,P.EPSILON7))&&(a.position=h.clone(c.positionWC),a.direction=h.clone(c.directionWC),a.up=h.clone(c.upWC),a.bbox=c.computeViewRectangle(),s=!0);let u=new zt,f=!1;return n.values.forEach(function(d){let p=d.entity;if(!Gie.contains(p.id)){if(!d.updating){let g=!1;if(d.refreshMode===NA.INTERVAL?K.secondsDifference(i,d.lastUpdated)>d.time&&(g=!0):d.refreshMode===NA.EXPIRE?K.greaterThan(i,d.time)&&(g=!0):d.refreshMode===NA.STOP&&(s&&(d.needsUpdate=!0,d.cameraUpdateTime=i),d.needsUpdate&&K.secondsDifference(i,d.cameraUpdateTime)>=d.time&&(g=!0)),g){o(p),d.updating=!0;let m=new rc,y=d.href.clone();y.setQueryParameters(d.cookie);let A=r._ellipsoid??ee.default;nre(y,r.camera,r.canvas,d.viewBoundScale,a.bbox,A),Xie(r,m,y,{context:p.id}).then(gwt(r,d,m,u,y)).catch(function(b){let x=`NetworkLink ${d.href} refresh failed: ${b}`;console.log(x),r._error.raiseEvent(r,x)}),f=!0}}u.set(d.id,d)}}),f&&(this._networkLinks=u,this._changed.raiseEvent(this)),!0}};function ire(e){let t=e.parent;if(l(t)){let n=t.availability;if(l(n)){let i=e.availability;l(i)?i.intersect(n):e.availability=n}}}function gwt(e,t,n,i,r){return function(o){if(!i.contains(t.id))return;let s=!1,a=Qi(o,"NetworkLinkControl",Ve.kml),c=l(a),u=0;if(c){if(l(Qi(a,"Update",Ve.kml))){yt("kml-networkLinkControl-update","KML - NetworkLinkControl updates aren't supported."),t.updating=!1,i.remove(t.id);return}t.cookie=Zf(Ln(a,"cookie",Ve.kml)??""),u=vi(a,"minRefreshPeriod",Ve.kml)??0}let f=K.now(),d=t.refreshMode;if(d===NA.INTERVAL)l(a)&&(t.time=Math.max(u,t.time));else if(d===NA.EXPIRE){let I;if(l(a)&&(I=Ln(a,"expires",Ve.kml)),l(I))try{let R=K.fromIso8601(I),O=K.secondsDifference(R,f);O>0&&O<u&&K.addSeconds(f,u,R),t.time=R}catch{yt("kml-networkLinkControl-expires","KML - NetworkLinkControl expires is not a valid date"),s=!0}else yt("kml-refreshMode-onExpire","KML - refreshMode of onExpire requires the NetworkLinkControl to have an expires element"),s=!0}let p=t.entity,g=e._entityCollection,m=n.values;function y(I){g.remove(I);let R=I._children,O=R.length;for(let L=0;L<O;++L)y(R[L])}g.suspendEvents();let A=g.values.slice(),b;for(b=0;b<A.length;++b){let I=A[b];I.parent===p&&(I.parent=void 0,y(I))}for(g.resumeEvents(),g.suspendEvents(),b=0;b<m.length;b++){let I=m[b];l(I.parent)||(I.parent=p,ire(I)),g.add(I)}g.resumeEvents(),s?i.remove(t.id):t.lastUpdated=f;let x=g.computeAvailability(),T=x.start,E=x.stop,v=K.equals(T,nt.MINIMUM_VALUE),S=K.equals(E,nt.MAXIMUM_VALUE);if(!v||!S){let I=e._clock;(I.startTime!==T||I.stopTime!==E)&&(I.startTime=T,I.stopTime=E,e._changed.raiseEvent(e))}t.updating=!1,t.needsUpdate=!1,e._refresh.raiseEvent(e,r.getUrlComponent(!0))}}var Gie=new zt,Kie=class{constructor(){this.author={name:void 0,uri:void 0,email:void 0},this.link={href:void 0,hreflang:void 0,rel:void 0,type:void 0,title:void 0,length:void 0},this.address=void 0,this.phoneNumber=void 0,this.snippet=void 0,this.extendedData=void 0}};Jg._DeferredLoading=Wie;Jg._getTimestamp=xn;var Mw=Jg;function SO(){pe.throwInstantiationError()}SO.prototype.update=pe.throwInstantiationError;SO.prototype.getBoundingSphere=pe.throwInstantiationError;SO.prototype.isDestroyed=pe.throwInstantiationError;SO.prototype.destroy=pe.throwInstantiationError;var p1e=SO;async function _wt(e,t,n,i){return l(i)||(i=!1),bwt(e,t,n,i)}function ywt(e,t,n){let i=e[0],r=i.terrainProvider.requestTileGeometry(i.x,i.y,i.level);if(!r)return!1;let o;return n?o=r.then(_1e(i)):o=r.then(_1e(i)).catch(xwt(i)),e.shift(),t.push(o),!0}function Awt(e){return new Promise(function(t){setTimeout(t,e)})}function rre(e,t,n){return e.length?ywt(e,t,n)?rre(e,t,n):Awt(100).then(()=>rre(e,t,n)):Promise.resolve()}function bwt(e,t,n,i){let r=e.tilingScheme,o,s=[],a={};for(o=0;o<n.length;++o){let u=r.positionToTileXY(n[o],t);if(!l(u))continue;let f=u.toString();if(!a.hasOwnProperty(f)){let d={x:u.x,y:u.y,level:t,tilingScheme:r,terrainProvider:e,positions:[]};a[f]=d,s.push(d)}a[f].positions.push(n[o])}let c=[];return rre(s,c,i).then(function(){return Promise.all(c).then(function(){return n})})}function g1e(e,t,n){let i=t.interpolateHeight(n,e.longitude,e.latitude);return i===void 0?!1:(e.height=i,!0)}function _1e(e){let t=e.positions,n=e.tilingScheme.tileXYToRectangle(e.x,e.y,e.level);return function(i){let r=!1;for(let o=0;o<t.length;++o){let s=t[o];if(!g1e(s,i,n)){r=!0;break}}return r?i.createMesh({tilingScheme:e.tilingScheme,x:e.x,y:e.y,level:e.level,throttle:!1}).then(function(){for(let o=0;o<t.length;++o){let s=t[o];g1e(s,i,n)}}):Promise.resolve()}}function xwt(e){let t=e.positions;return function(){for(let n=0;n<t.length;++n){let i=t[n];i.height=void 0}}}var MH=_wt;var ore=new U;async function y1e(e,t,n){l(n)||(n=!1);let i=[],r=[],o=e.availability,s=[];for(let c=0;c<t.length;++c){let u=t[c],f=o.computeMaximumLevelAtPosition(u);if(r[c]=f,f===0){e.tilingScheme.positionToTileXY(u,1,ore);let p=e.loadTileDataAvailability(ore.x,ore.y,1);l(p)&&s.push(p)}let d=i[f];l(d)||(i[f]=d=[]),d.push(u)}await Promise.all(s),await Promise.all(i.map(function(c,u){if(l(c))return MH(e,u,c,n)}));let a=[];for(let c=0;c<t.length;++c){let u=t[c];o.computeMaximumLevelAtPosition(u)!==r[c]&&a.push(u)}return a.length>0&&await y1e(e,a,n),t}var Nw=y1e;async function sre(e,t){let n=t.terrainProvider,i=t.mapProjection,r=i.ellipsoid,o,s=t.camera.getRectangleCameraCoordinates(e);if(t.mode===re.SCENE3D?o=r.cartesianToCartographic(s):o=i.unproject(s),!l(n))return o;let a=n.availability;if(!l(a)||t.mode===re.SCENE2D)return o;let c=[ie.center(e),ie.southeast(e),ie.southwest(e),ie.northeast(e),ie.northwest(e)],u=await sre._sampleTerrainMostDetailed(n,c),f=!1,d=u.reduce(function(g,m){return l(m.height)?(f=!0,Math.max(m.height,g)):g},-Number.MAX_VALUE),p=o;return f&&(p.height+=d),p}sre._sampleTerrainMostDetailed=Nw;var Lw=sre;var A1e={NONE:0,LERC:1};Object.freeze(A1e);var pm=A1e;var b1e={NONE:0,BITS12:1};Object.freeze(b1e);var lc=b1e;var wO=new h,Twt=new h,Kd=new U,Ewt=new M,Cwt=new M,vwt=Math.pow(2,12);function wc(e,t,n,i,r,o,s,a,c,u){let f=lc.NONE,d,p;if(l(t)&&l(n)&&l(i)&&l(r)){let g=t.minimum,m=t.maximum,y=h.subtract(m,g,Twt),A=i-n;Math.max(h.maximumComponent(y),A)<vwt-1?f=lc.BITS12:f=lc.NONE;let x=M.fromScale(y,Ewt);x=M.setTranslation(x,g,x);let T=M.fromScale(h.fromElements(1/y.x,1/y.y,1/y.z,wO),Cwt);T=M.multiplyByTranslation(T,h.negate(g,wO),T),p=M.clone(r,new M);let E=M.getTranslation(r,wO);E=h.subtract(E,e,wO),p=M.setTranslation(p,E,p),p=M.multiply(p,x,p),d=M.inverseTransformation(r,new M),d=M.multiply(T,d,d),r=M.multiply(r,x,new M)}this.quantization=f,this.minimumHeight=n,this.maximumHeight=i,this.center=h.clone(e),this.toScaledENU=d,this.fromScaledENU=r,this.matrix=p,this.hasVertexNormals=o??!1,this.hasWebMercatorT=s??!1,this.hasGeodeticSurfaceNormals=a??!1,this.exaggeration=c??1,this.exaggerationRelativeHeight=u??0,this.stride=0,this._offsetGeodeticSurfaceNormal=0,this._offsetVertexNormal=0,this._calculateStrideAndOffsets()}wc.prototype.encode=function(e,t,n,i,r,o,s,a){let c=i.x,u=i.y;if(this.quantization===lc.BITS12){n=M.multiplyByPoint(this.toScaledENU,n,wO),n.x=P.clamp(n.x,0,1),n.y=P.clamp(n.y,0,1),n.z=P.clamp(n.z,0,1);let f=this.maximumHeight-this.minimumHeight,d=P.clamp((r-this.minimumHeight)/f,0,1);U.fromElements(n.x,n.y,Kd);let p=cn.compressTextureCoordinates(Kd);U.fromElements(n.z,d,Kd);let g=cn.compressTextureCoordinates(Kd);U.fromElements(c,u,Kd);let m=cn.compressTextureCoordinates(Kd);if(e[t++]=p,e[t++]=g,e[t++]=m,this.hasWebMercatorT){U.fromElements(s,0,Kd);let y=cn.compressTextureCoordinates(Kd);e[t++]=y}}else e[t++]=n.x-this.center.x,e[t++]=n.y-this.center.y,e[t++]=n.z-this.center.z,e[t++]=r,e[t++]=c,e[t++]=u,this.hasWebMercatorT&&(e[t++]=s);return this.hasVertexNormals&&(e[t++]=cn.octPackFloat(o)),this.hasGeodeticSurfaceNormals&&(e[t++]=a.x,e[t++]=a.y,e[t++]=a.z),t};var Swt=new h,x1e=new h;wc.prototype.addGeodeticSurfaceNormals=function(e,t,n){if(this.hasGeodeticSurfaceNormals)return;let i=this.stride,r=e.length/i;this.hasGeodeticSurfaceNormals=!0,this._calculateStrideAndOffsets();let o=this.stride;for(let s=0;s<r;s++){for(let f=0;f<i;f++){let d=s*i+f,p=s*o+f;t[p]=e[d]}let a=this.decodePosition(t,s,Swt),c=n.geodeticSurfaceNormal(a,x1e),u=s*o+this._offsetGeodeticSurfaceNormal;t[u]=c.x,t[u+1]=c.y,t[u+2]=c.z}};wc.prototype.removeGeodeticSurfaceNormals=function(e,t){if(!this.hasGeodeticSurfaceNormals)return;let n=this.stride,i=e.length/n;this.hasGeodeticSurfaceNormals=!1,this._calculateStrideAndOffsets();let r=this.stride;for(let o=0;o<i;o++)for(let s=0;s<r;s++){let a=o*n+s,c=o*r+s;t[c]=e[a]}};wc.prototype.decodePosition=function(e,t,n){if(l(n)||(n=new h),t*=this.stride,this.quantization===lc.BITS12){let i=cn.decompressTextureCoordinates(e[t],Kd);n.x=i.x,n.y=i.y;let r=cn.decompressTextureCoordinates(e[t+1],Kd);return n.z=r.x,M.multiplyByPoint(this.fromScaledENU,n,n)}return n.x=e[t],n.y=e[t+1],n.z=e[t+2],h.add(n,this.center,n)};wc.prototype.getExaggeratedPosition=function(e,t,n){n=this.decodePosition(e,t,n);let i=this.exaggeration,r=this.exaggerationRelativeHeight;if(i!==1&&this.hasGeodeticSurfaceNormals){let s=this.decodeGeodeticSurfaceNormal(e,t,x1e),a=this.decodeHeight(e,t),c=br.getHeight(a,i,r)-a;n.x+=s.x*c,n.y+=s.y*c,n.z+=s.z*c}return n};wc.prototype.decodeTextureCoordinates=function(e,t,n){return l(n)||(n=new U),t*=this.stride,this.quantization===lc.BITS12?cn.decompressTextureCoordinates(e[t+2],n):U.fromElements(e[t+4],e[t+5],n)};wc.prototype.decodeHeight=function(e,t){return t*=this.stride,this.quantization===lc.BITS12?cn.decompressTextureCoordinates(e[t+1],Kd).y*(this.maximumHeight-this.minimumHeight)+this.minimumHeight:e[t+3]};wc.prototype.decodeWebMercatorT=function(e,t){return t*=this.stride,this.quantization===lc.BITS12?cn.decompressTextureCoordinates(e[t+3],Kd).x:e[t+6]};wc.prototype.getOctEncodedNormal=function(e,t,n){t=t*this.stride+this._offsetVertexNormal;let i=e[t]/256,r=Math.floor(i),o=(i-r)*256;return U.fromElements(r,o,n)};wc.prototype.decodeNormal=function(e,t,n){let i=t*this.stride+this._offsetVertexNormal;return cn.octDecodeFloat(e[i],n)};wc.prototype.decodeGeodeticSurfaceNormal=function(e,t,n){return t=t*this.stride+this._offsetGeodeticSurfaceNormal,n.x=e[t],n.y=e[t+1],n.z=e[t+2],n};wc.prototype._calculateStrideAndOffsets=function(){let e=0;this.quantization===lc.BITS12?e+=3:e+=6,this.hasWebMercatorT&&(e+=1),this.hasVertexNormals&&(this._offsetVertexNormal=e,e+=1),this.hasGeodeticSurfaceNormals&&(this._offsetGeodeticSurfaceNormal=e,e+=3),this.stride=e};var NH={position3DAndHeight:0,textureCoordAndEncodedNormals:1,geodeticSurfaceNormal:2},LH={compressed0:0,compressed1:1,geodeticSurfaceNormal:2};wc.prototype.getAttributes=function(e){let t=Y.FLOAT,n=Y.getSizeInBytes(t),i=this.stride*n,r=0,o=[];function s(a,c){o.push({index:a,vertexBuffer:e,componentDatatype:t,componentsPerAttribute:c,offsetInBytes:r,strideInBytes:i}),r+=c*n}if(this.quantization===lc.NONE){s(NH.position3DAndHeight,4);let a=2;a+=this.hasWebMercatorT?1:0,a+=this.hasVertexNormals?1:0,s(NH.textureCoordAndEncodedNormals,a),this.hasGeodeticSurfaceNormals&&s(NH.geodeticSurfaceNormal,3)}else{let a=this.hasWebMercatorT||this.hasVertexNormals,c=this.hasWebMercatorT&&this.hasVertexNormals;s(LH.compressed0,a?4:3),c&&s(LH.compressed1,1),this.hasGeodeticSurfaceNormals&&s(LH.geodeticSurfaceNormal,3)}return o};wc.prototype.getAttributeLocations=function(){return this.quantization===lc.NONE?NH:LH};wc.clone=function(e,t){if(l(e))return l(t)||(t=new wc),t.quantization=e.quantization,t.minimumHeight=e.minimumHeight,t.maximumHeight=e.maximumHeight,t.center=h.clone(e.center),t.toScaledENU=M.clone(e.toScaledENU),t.fromScaledENU=M.clone(e.fromScaledENU),t.matrix=M.clone(e.matrix),t.hasVertexNormals=e.hasVertexNormals,t.hasWebMercatorT=e.hasWebMercatorT,t.hasGeodeticSurfaceNormals=e.hasGeodeticSurfaceNormals,t.exaggeration=e.exaggeration,t.exaggerationRelativeHeight=e.exaggerationRelativeHeight,t._calculateStrideAndOffsets(),t};var Ro=wc;var o0={};o0.DEFAULT_STRUCTURE=Object.freeze({heightScale:1,heightOffset:0,elementsPerHeight:1,stride:1,elementMultiplier:256,isBigEndian:!1});var are=new h,wwt=new M,Iwt=new h,Pwt=new h;o0.computeVertices=function(e){let t=Math.cos,n=Math.sin,i=Math.sqrt,r=Math.atan,o=Math.exp,s=P.PI_OVER_TWO,a=P.toRadians,c=e.heightmap,u=e.width,f=e.height,d=e.skirtHeight,p=d>0,g=e.isGeographic??!0,m=e.ellipsoid??ee.default,y=1/m.maximumRadius,A=ie.clone(e.nativeRectangle),b=ie.clone(e.rectangle),x,T,E,v;l(b)?(x=b.west,T=b.south,E=b.east,v=b.north):g?(x=a(A.west),T=a(A.south),E=a(A.east),v=a(A.north)):(x=A.west*y,T=s-2*r(o(-A.south*y)),E=A.east*y,v=s-2*r(o(-A.north*y)));let S=e.relativeToCenter,I=l(S);S=I?S:h.ZERO;let R=e.includeWebMercatorT??!1,O=e.exaggeration??1,L=e.exaggerationRelativeHeight??0,C=O!==1,w=e.structure??o0.DEFAULT_STRUCTURE,D=w.heightScale??o0.DEFAULT_STRUCTURE.heightScale,N=w.heightOffset??o0.DEFAULT_STRUCTURE.heightOffset,F=w.elementsPerHeight??o0.DEFAULT_STRUCTURE.elementsPerHeight,V=w.stride??o0.DEFAULT_STRUCTURE.stride,B=w.elementMultiplier??o0.DEFAULT_STRUCTURE.elementMultiplier,j=w.isBigEndian??o0.DEFAULT_STRUCTURE.isBigEndian,k=ie.computeWidth(A),G=ie.computeHeight(A),q=k/(u-1),Q=G/(f-1);g||(k*=y,G*=y);let W=m.radiiSquared,J=W.x,Z=W.y,ae=W.z,Ae=65536,fe=-65536,xe=At.eastNorthUpToFixedFrame(S,m),ge=M.inverseTransformation(xe,wwt),we,ve;R&&(we=Ti.geodeticLatitudeToMercatorAngle(T),ve=1/(Ti.geodeticLatitudeToMercatorAngle(v)-we));let Re=Iwt;Re.x=Number.POSITIVE_INFINITY,Re.y=Number.POSITIVE_INFINITY,Re.z=Number.POSITIVE_INFINITY;let Qe=Pwt;Qe.x=Number.NEGATIVE_INFINITY,Qe.y=Number.NEGATIVE_INFINITY,Qe.z=Number.NEGATIVE_INFINITY;let He=Number.POSITIVE_INFINITY,Ye=u*f,Ke=d>0?u*2+f*2:0,Pe=Ye+Ke,qe=new Array(Pe),st=new Array(Pe),vt=new Array(Pe),jt=R?new Array(Pe):[],lt=C?new Array(Pe):[],mt=0,ft=f,Yt=0,rt=u;p&&(--mt,++ft,--Yt,++rt);let ht=1e-5;for(let zn=mt;zn<ft;++zn){let tn=zn;tn<0&&(tn=0),tn>=f&&(tn=f-1);let Hn=A.north-Q*tn;g?Hn=a(Hn):Hn=s-2*r(o(-Hn*y));let Ki=(Hn-T)/(v-T);Ki=P.clamp(Ki,0,1);let wr=zn===mt,so=zn===ft-1;d>0&&(wr?Hn+=ht*G:so&&(Hn-=ht*G));let Ts=t(Hn),zs=n(Hn),$r=ae*zs,pi;R&&(pi=(Ti.geodeticLatitudeToMercatorAngle(Hn)-we)*ve);for(let ao=Yt;ao<rt;++ao){let nr=ao;nr<0&&(nr=0),nr>=u&&(nr=u-1);let jo=tn*(u*V)+nr*V,Fn;if(F===1)Fn=c[jo];else{Fn=0;let Wr;if(j)for(Wr=0;Wr<F;++Wr)Fn=Fn*B+c[jo+Wr];else for(Wr=F-1;Wr>=0;--Wr)Fn=Fn*B+c[jo+Wr]}Fn=Fn*D+N,fe=Math.max(fe,Fn),Ae=Math.min(Ae,Fn);let Vi=A.west+q*nr;g?Vi=a(Vi):Vi=Vi*y;let Fi=(Vi-x)/(E-x);Fi=P.clamp(Fi,0,1);let Ir=tn*u+nr;if(d>0){let Wr=ao===Yt,_l=ao===rt-1,w0=wr||so||Wr||_l;if((wr||so)&&(Wr||_l))continue;w0&&(Fn-=d,Wr?(Ir=Ye+(f-tn-1),Vi-=ht*k):so?Ir=Ye+f+(u-nr-1):_l?(Ir=Ye+f+u+tn,Vi+=ht*k):wr&&(Ir=Ye+f+u+f+nr))}let Mc=Ts*t(Vi),Yf=Ts*n(Vi),Rm=J*Mc,ch=Z*Yf,Om=1/i(Rm*Mc+ch*Yf+$r*zs),Es=Rm*Om,Ha=ch*Om,ub=$r*Om,ii=new h;ii.x=Es+Mc*Fn,ii.y=Ha+Yf*Fn,ii.z=ub+zs*Fn,M.multiplyByPoint(ge,ii,are),h.minimumByComponent(are,Re,Re),h.maximumByComponent(are,Qe,Qe),He=Math.min(He,Fn),qe[Ir]=ii,vt[Ir]=new U(Fi,Ki),st[Ir]=Fn,R&&(jt[Ir]=pi),C&&(lt[Ir]=m.geodeticSurfaceNormal(ii))}}let Li=ue.fromPoints(qe),Yn;l(b)&&(Yn=en.fromRectangle(b,Ae,fe,m));let yi;I&&(yi=new Op(m).computeHorizonCullingPointPossiblyUnderEllipsoid(S,qe,Ae));let zi=new sd(Re,Qe,S),Si=new Ro(S,zi,He,fe,xe,!1,R,C,O,L),ui=new Float32Array(Pe*Si.stride),Ai=0;for(let zn=0;zn<Pe;++zn)Ai=Si.encode(ui,Ai,qe[zn],vt[zn],st[zn],void 0,jt[zn],lt[zn]);return{vertices:ui,maximumHeight:fe,minimumHeight:Ae,encoding:Si,boundingSphere3D:Li,orientedBoundingBox:Yn,occludeePointInScaledSpace:yi}};var IO=o0;function LA(){pe.throwInstantiationError()}Object.defineProperties(LA.prototype,{credits:{get:pe.throwInstantiationError},waterMask:{get:pe.throwInstantiationError}});LA.prototype.interpolateHeight=pe.throwInstantiationError;LA.prototype.isChildAvailable=pe.throwInstantiationError;LA.prototype.createMesh=pe.throwInstantiationError;LA.prototype.upsample=pe.throwInstantiationError;LA.prototype.wasCreatedByUpsampling=pe.throwInstantiationError;LA.maximumAsynchronousTasks=5;var Lf=LA;var Dwt=3,lre=class{constructor(t,n,i){this._vertices=t,this._indices=n,this._encoding=i,this._inverseTransform=new M,this._needsRebuild=!0,this._rootNode=new ure}get needsRebuild(){return this._needsRebuild}set needsRebuild(t){this._needsRebuild=t}rayIntersect(t,n,i,r,o){this._needsRebuild&&Mwt(this,n);let s=this._inverseTransform,a=Owt;a.origin=M.multiplyByPoint(s,t.origin,a.origin),a.direction=M.multiplyByPointAsVector(s,t.direction,a.direction);let c=[];return E1e(this._rootNode,a,c),kwt(this,c,t,i,r,o)}},Rwt=new $n("incrementallyBuildTerrainPicker"),ure=class e{constructor(){this.x=0,this.y=0,this.level=0,this.aabb=T1e(this.x,this.y,this.level),this.intersectingTriangles=new Uint32Array(0),this.children=[],this.buildingChildren=!1}addChild(t){let n=new e;n.x=this.x*2+(t&1),n.y=this.y*2+(t>>1&1),n.level=this.level+1,n.aabb=T1e(n.x,n.y,n.level),this.children[t]=n}},Owt=new gn,FH=[new h,new h,new h];function Mwt(e,t){M.inverse(t,e._inverseTransform),e._needsRebuild=!1;let n=e._indices.length/3,i=new Uint32Array(n);for(let r=0;r<n;++r)i[r]=r;e._rootNode.intersectingTriangles=i,e._rootNode.children.length=0}var Nwt=new h,Lwt=new h;function T1e(e,t,n){let i=1/Math.pow(2,n),r=h.fromElements(e*i-.5,t*i-.5,-.5,Nwt),o=h.fromElements((e+1)*i-.5,(t+1)*i-.5,.5,Lwt);return sd.fromCorners(r,o)}function Fwt(e,t,n,i,r){h.pack(n[0],e,9*r),h.pack(n[1],e,9*r+3),h.pack(n[2],e,9*r+6),t[r]=i}var Bwt=new Gs;function E1e(e,t,n){let i=xi.rayAxisAlignedBoundingBox(t,e.aabb,Bwt);if(!l(i))return;if(!e.children.length||e.buildingChildren){n.push({node:e,interval:new Gs(i.start,i.stop)});return}for(let o=0;o<e.children.length;o++)E1e(e.children[o],t,n)}function kwt(e,t,n,i,r,o){let s=t.sort(function(c,u){return c.interval.start-u.interval.start}),a=Number.MAX_VALUE;for(let c=0;c<s.length;c++){let u=s[c],f=Uwt(e,n,u.node,i,r,o);if(a=Math.min(f,a),a!==Number.MAX_VALUE)break}if(a!==Number.MAX_VALUE)return gn.getPoint(n,a)}function Uwt(e,t,n,i,r,o){let s=Number.MAX_VALUE,a=e._encoding,c=e._indices,u=e._vertices,f=n.intersectingTriangles.length,p=!(n.level>=Dwt)&&!n.buildingChildren,g,m;p&&(g=new Float64Array(f*9),m=new Uint32Array(f));for(let y=0;y<f;y++){let A=n.intersectingTriangles[y],b=cre(a,r,o,t,u,c[3*A],FH[0]),x=cre(a,r,o,t,u,c[3*A+1],FH[1]),T=cre(a,r,o,t,u,c[3*A+2],FH[2]),E=xi.rayTriangleParametric(t,b,x,T,i);l(E)&&E<s&&E>=0&&(s=E),p&&Fwt(g,m,FH,A,y)}if(p){for(let y=0;y<4;y++)n.addChild(y);Vwt(e._inverseTransform,n,m,g)}return s}var zwt=new he;function cre(e,t,n,i,r,o,s){let a=e.getExaggeratedPosition(r,o,s);if(t===re.SCENE3D)return a;let u=n.ellipsoid.cartesianToCartographic(a,zwt);a=n.project(u,s),a=h.fromElements(a.z,a.x,a.y,s);let f=P.TWO_PI*n.ellipsoid.maximumRadius,d=Math.round((i.origin.y-a.y)/f);return a.y+=d*f,a}async function Vwt(e,t,n,i){t.buildingChildren=!0;let r=new Float64Array(16);M.pack(e,r,0);let o=new Float64Array(24);for(let f=0;f<4;f++)h.pack(t.children[f].aabb.minimum,o,f*6),h.pack(t.children[f].aabb.maximum,o,f*6+3);let s={aabbs:o,inverseTransform:r,triangleIndices:n,trianglePositions:i},a=[o.buffer,r.buffer,n.buffer,i.buffer],c=Rwt.scheduleTask(s,a);if(!l(c)){t.buildingChildren=!1;return}(await c).intersectingTrianglesArrays.forEach((f,d)=>{l(t.children[d])&&(t.children[d].intersectingTriangles=new Uint32Array(f))}),t.intersectingTriangles=new Uint32Array(0),t.buildingChildren=!1}var BH=lre;function PO(e,t,n,i,r,o,s,a,c,u,f,d,p,g,m,y,A){this.center=e,this.vertices=t,this.stride=f??6,this.indices=n,this.indexCountWithoutSkirts=i,this.vertexCountWithoutSkirts=r,this.minimumHeight=o,this.maximumHeight=s,this.rectangle=a,this.boundingSphere3D=c,this.occludeePointInScaledSpace=u,this.orientedBoundingBox=d,this.encoding=p,this.westIndicesSouthToNorth=g,this.southIndicesEastToWest=m,this.eastIndicesNorthToSouth=y,this.northIndicesWestToEast=A,this._transform=new M,this._lastPickSceneMode=void 0,this._terrainPicker=new BH(t,n,p)}PO.prototype.getTransform=function(e,t){return this._lastPickSceneMode===e?this._transform:(this._terrainPicker.needsRebuild=!0,!l(e)||e===re.SCENE3D?jwt(this,this._transform):Kwt(this,t,this._transform))};function jwt(e,t){let n=e.encoding.exaggeration,i=e.encoding.exaggerationRelativeHeight,r=br.getHeight(e.minimumHeight,n,i),o=br.getHeight(e.maximumHeight,n,i),s=en.fromRectangle(e.rectangle,r,o,ee.default,e.orientedBoundingBox);return en.computeTransformation(s,t),M.getScale(t,fre).z<=P.EPSILON16&&(fre.z=1,M.setScale(t,fre,t)),t}var Hwt=new h,Gwt=new h,Wwt=new he,qwt=new he,Ywt=new h,Xwt=new h,fre=new h;function Kwt(e,t,n){let i=e.encoding.exaggeration,r=e.encoding.exaggerationRelativeHeight,o=br.getHeight(e.minimumHeight,i,r),s=br.getHeight(e.maximumHeight,i,r),a=t.project(he.fromRadians(e.rectangle.west,e.rectangle.south,0,Wwt),Hwt),c=t.project(he.fromRadians(e.rectangle.east,e.rectangle.north,0,qwt),Gwt),u=s-o,f=h.fromElements(c.x-a.x,c.y-a.y,u>0?u:1,Ywt),d=h.fromElements(a.x+f.x*.5,a.y+f.y*.5,o+f.z*.5,Xwt);return M.fromTranslation(d,n),M.setScale(n,f,n),M.multiply(At.SWIZZLE_3D_TO_2D_MATRIX,n,n),n}PO.prototype.pick=function(e,t,n,i){let r=this._terrainPicker.rayIntersect(e,this.getTransform(n,i),t,n,i);return this._lastPickSceneMode=n,r};PO.prototype.updateExaggeration=function(e,t){this._terrainPicker._vertices=this.vertices,this._terrainPicker.needsRebuild=!0,this._lastPickSceneMode=void 0};PO.prototype.updateSceneMode=function(e){this._terrainPicker.needsRebuild=!0,this._lastPickSceneMode=void 0};var Ic=PO;function Zg(e){e=e??H.EMPTY_OBJECT,this._buffer=e.buffer,this._width=e.width,this._height=e.height,this._childTileMask=e.childTileMask??15,this._encoding=e.encoding??pm.NONE;let t=IO.DEFAULT_STRUCTURE,n=e.structure;l(n)?n!==t&&(n.heightScale=n.heightScale??t.heightScale,n.heightOffset=n.heightOffset??t.heightOffset,n.elementsPerHeight=n.elementsPerHeight??t.elementsPerHeight,n.stride=n.stride??t.stride,n.elementMultiplier=n.elementMultiplier??t.elementMultiplier,n.isBigEndian=n.isBigEndian??t.isBigEndian):n=t,this._structure=n,this._createdByUpsampling=e.createdByUpsampling??!1,this._waterMask=e.waterMask,this._skirtHeight=void 0,this._bufferType=this._encoding===pm.LERC?Float32Array:this._buffer.constructor,this._mesh=void 0}Object.defineProperties(Zg.prototype,{credits:{get:function(){}},waterMask:{get:function(){return this._waterMask}},childTileMask:{get:function(){return this._childTileMask}}});var C1e="createVerticesFromHeightmap",$wt=new $n(C1e),Jwt=new $n(C1e,Lf.maximumAsynchronousTasks);Zg.prototype.createMesh=function(e){e=e??H.EMPTY_OBJECT;let t=e.tilingScheme,n=e.x,i=e.y,r=e.level,o=e.exaggeration??1,s=e.exaggerationRelativeHeight??0,a=e.throttle??!0,c=t.ellipsoid,u=t.tileXYToNativeRectangle(n,i,r),f=t.tileXYToRectangle(n,i,r),d=c.cartographicToCartesian(ie.center(f)),p=this._structure,m=Xr.getEstimatedLevelZeroGeometricErrorForAHeightmap(c,this._width,t.getNumberOfXTilesAtLevel(0))/(1<<r);this._skirtHeight=Math.min(m*4,1e3);let A=(a?Jwt:$wt).scheduleTask({heightmap:this._buffer,structure:p,includeWebMercatorT:!0,width:this._width,height:this._height,nativeRectangle:u,rectangle:f,relativeToCenter:d,ellipsoid:c,skirtHeight:this._skirtHeight,isGeographic:t.projection instanceof ji,exaggeration:o,exaggerationRelativeHeight:s,encoding:this._encoding});if(!l(A))return;let b=this;return Promise.resolve(A).then(function(x){let T;b._skirtHeight>0?T=Xr.getRegularGridAndSkirtIndicesAndEdgeIndices(x.gridWidth,x.gridHeight):T=Xr.getRegularGridIndicesAndEdgeIndices(x.gridWidth,x.gridHeight);let E=x.gridWidth*x.gridHeight;return b._mesh=new Ic(d,new Float32Array(x.vertices),T.indices,T.indexCountWithoutSkirts,E,x.minimumHeight,x.maximumHeight,f,ue.clone(x.boundingSphere3D),h.clone(x.occludeePointInScaledSpace),x.numberOfAttributes,en.clone(x.orientedBoundingBox),Ro.clone(x.encoding),T.westIndicesSouthToNorth,T.southIndicesEastToWest,T.eastIndicesNorthToSouth,T.northIndicesWestToEast),b._buffer=void 0,b._mesh})};Zg.prototype._createMeshSync=function(e){let t=e.tilingScheme,n=e.x,i=e.y,r=e.level,o=e.exaggeration??1,s=e.exaggerationRelativeHeight??0,a=t.ellipsoid,c=t.tileXYToNativeRectangle(n,i,r),u=t.tileXYToRectangle(n,i,r),f=a.cartographicToCartesian(ie.center(u)),d=this._structure,g=Xr.getEstimatedLevelZeroGeometricErrorForAHeightmap(a,this._width,t.getNumberOfXTilesAtLevel(0))/(1<<r);this._skirtHeight=Math.min(g*4,1e3);let m=IO.computeVertices({heightmap:this._buffer,structure:d,includeWebMercatorT:!0,width:this._width,height:this._height,nativeRectangle:c,rectangle:u,relativeToCenter:f,ellipsoid:a,skirtHeight:this._skirtHeight,isGeographic:t.projection instanceof ji,exaggeration:o,exaggerationRelativeHeight:s});this._buffer=void 0;let y;this._skirtHeight>0?y=Xr.getRegularGridAndSkirtIndicesAndEdgeIndices(this._width,this._height):y=Xr.getRegularGridIndicesAndEdgeIndices(this._width,this._height);let A=m.gridWidth*m.gridHeight;return this._mesh=new Ic(f,m.vertices,y.indices,y.indexCountWithoutSkirts,A,m.minimumHeight,m.maximumHeight,u,m.boundingSphere3D,m.occludeePointInScaledSpace,m.encoding.stride,m.orientedBoundingBox,m.encoding,y.westIndicesSouthToNorth,y.southIndicesEastToWest,y.eastIndicesNorthToSouth,y.northIndicesWestToEast),this._mesh};Zg.prototype.interpolateHeight=function(e,t,n){let i=this._width,r=this._height,o=this._structure,s=o.stride,a=o.elementsPerHeight,c=o.elementMultiplier,u=o.isBigEndian,f=o.heightOffset,d=o.heightScale,p=l(this._mesh),g=this._encoding===pm.LERC;if(!p&&g)return;let y;if(p){let A=this._mesh.vertices,b=this._mesh.encoding;y=v1e(A,b,f,d,e,i,r,t,n)}else y=Zwt(this._buffer,a,c,s,u,e,i,r,t,n),y=y*d+f;return y};Zg.prototype.upsample=function(e,t,n,i,r,o,s){let a=this._mesh;if(!l(a))return;let c=this._width,u=this._height,f=this._structure,d=f.stride,p=new this._bufferType(c*u*d),g=a.vertices,m=a.encoding,y=e.tileXYToRectangle(t,n,i),A=e.tileXYToRectangle(r,o,s),b=f.heightOffset,x=f.heightScale,T=f.elementsPerHeight,E=f.elementMultiplier,v=f.isBigEndian,S=Math.pow(E,T-1);for(let I=0;I<u;++I){let R=P.lerp(A.north,A.south,I/(u-1));for(let O=0;O<c;++O){let L=P.lerp(A.west,A.east,O/(c-1)),_=v1e(g,m,b,x,y,c,u,L,R);_=_<f.lowestEncodedHeight?f.lowestEncodedHeight:_,_=_>f.highestEncodedHeight?f.highestEncodedHeight:_,Qwt(p,T,E,S,d,v,I*c+O,_)}}return Promise.resolve(new Zg({buffer:p,width:c,height:u,childTileMask:0,structure:this._structure,createdByUpsampling:!0}))};Zg.prototype.isChildAvailable=function(e,t,n,i){let r=2;return n!==e*2&&++r,i!==t*2&&(r-=2),(this._childTileMask&1<<r)!==0};Zg.prototype.wasCreatedByUpsampling=function(){return this._createdByUpsampling};function Zwt(e,t,n,i,r,o,s,a,c,u){let f=(c-o.west)*(s-1)/(o.east-o.west),d=(u-o.south)*(a-1)/(o.north-o.south),p=f|0,g=p+1;g>=s&&(g=s-1,p=s-2);let m=d|0,y=m+1;y>=a&&(y=a-1,m=a-2);let A=f-p,b=d-m;m=a-1-m,y=a-1-y;let x=kH(e,t,n,i,r,m*s+p),T=kH(e,t,n,i,r,m*s+g),E=kH(e,t,n,i,r,y*s+p),v=kH(e,t,n,i,r,y*s+g);return S1e(A,b,x,T,E,v)}function v1e(e,t,n,i,r,o,s,a,c){let u=(a-r.west)*(o-1)/(r.east-r.west),f=(c-r.south)*(s-1)/(r.north-r.south),d=u|0,p=d+1;p>=o&&(p=o-1,d=o-2);let g=f|0,m=g+1;m>=s&&(m=s-1,g=s-2);let y=u-d,A=f-g;g=s-1-g,m=s-1-m;let b=(t.decodeHeight(e,g*o+d)-n)/i,x=(t.decodeHeight(e,g*o+p)-n)/i,T=(t.decodeHeight(e,m*o+d)-n)/i,E=(t.decodeHeight(e,m*o+p)-n)/i;return S1e(y,A,b,x,T,E)}function S1e(e,t,n,i,r,o){return t<e?n+e*(i-n)+t*(o-i):n+e*(o-r)+t*(r-n)}function kH(e,t,n,i,r,o){o*=i;let s=0,a;if(r)for(a=0;a<t;++a)s=s*n+e[o+a];else for(a=t-1;a>=0;--a)s=s*n+e[o+a];return s}function Qwt(e,t,n,i,r,o,s,a){s*=r;let c;if(o)for(c=0;c<t-1;++c)e[s+c]=a/i|0,a-=e[s+c]*i,i/=n;else for(c=t-1;c>0;--c)e[s+c]=a/i|0,a-=e[s+c]*i,i/=n;e[s+c]=a}var ll=Zg;function Fw(e){e=e??H.EMPTY_OBJECT,this._tilingScheme=e.tilingScheme,l(this._tilingScheme)||(this._tilingScheme=new rr({ellipsoid:e.ellipsoid??ee.default})),this._levelZeroMaximumGeometricError=Xr.getEstimatedLevelZeroGeometricErrorForAHeightmap(this._tilingScheme.ellipsoid,64,this._tilingScheme.getNumberOfXTilesAtLevel(0)),this._errorEvent=new be}Object.defineProperties(Fw.prototype,{errorEvent:{get:function(){return this._errorEvent}},credit:{get:function(){}},tilingScheme:{get:function(){return this._tilingScheme}},hasWaterMask:{get:function(){return!1}},hasVertexNormals:{get:function(){return!1}},availability:{get:function(){}}});Fw.prototype.requestTileGeometry=function(e,t,n,i){return Promise.resolve(new ll({buffer:new Uint8Array(256),width:16,height:16}))};Fw.prototype.getLevelMaximumGeometricError=function(e){return this._levelZeroMaximumGeometricError/(1<<e)};Fw.prototype.getTileDataAvailable=function(e,t,n){};Fw.prototype.loadTileDataAvailability=function(e,t,n){};var Qg=Fw;var eIt=new U;function tIt(e,t){let n=e.unionClippingRegions,i=e.length,r=Ps.useFloatTexture(t),o=Ps.getTextureResolution(e,t,eIt),s=o.x,a=o.y,c=r?rIt(s,a):oIt(s,a);return c+=` -`,c+=n?nIt(i):iIt(i),c}function nIt(e){return`float clip(vec4 fragCoord, sampler2D clippingPlanes, mat4 clippingPlanesMatrix) +Url: ${e._contentHeader.uri}`,r++;let o={text:i.substring(1),position:n,font:`${19-r}px sans-serif`,showBackground:!0,disableDepthTestDistance:Number.POSITIVE_INFINITY};return t._tileDebugLabels.add(o)}function Eyt(e,t){let n=e._selectedTiles,i=n.length,r=e._emptyTiles,o=r.length;if(e._tileDebugLabels.removeAll(),e.debugPickedTileLabelOnly){if(l(e.debugPickedTile)){let s=l(e.debugPickPosition)?e.debugPickPosition:See(e.debugPickedTile),a=wee(e.debugPickedTile,e,s);a.pixelOffset=new U(15,-15)}}else{for(let s=0;s<i;++s){let a=n[s];wee(a,e,See(a))}for(let s=0;s<o;++s){let a=r[s];(a.hasTilesetContent||a.hasImplicitContent)&&wee(a,e,See(a))}}e._tileDebugLabels.update(t)}function Cyt(e,t,n){e._styleEngine.applyStyle(e),e._styleApplied=!0;let{commandList:i,context:r}=t,o=i.length,s=e._selectedTiles,a=e.isSkippingLevelOfDetail&&e._hasMixedContent&&r.stencilBuffer&&s.length>0;e._backfaceCommands.length=0,a&&(l(e._stencilClearCommand)||(e._stencilClearCommand=new fi({stencil:0,pass:Ie.CESIUM_3D_TILE,renderState:Ge.fromCache({stencilMask:Xt.SKIP_LOD_MASK})})),i.push(e._stencilClearCommand));let{statistics:c,tileVisible:u}=e,f=n.isRender,d=i.length;for(let m=0;m<s.length;++m){let y=s[m];f&&u.raiseEvent(y),yyt(e,y,t),y.update(e,t,n),c.incrementSelectionCounts(y.content),++c.selected}let p=e._emptyTiles;for(let m=0;m<p.length;++m)p[m].update(e,t,n);let g=i.length-d;if(e._backfaceCommands.trim(),a){let m=e._backfaceCommands.values,y=m.length;i.length+=y;for(let A=g-1;A>=0;--A)i[d+y+A]=i[d+A];for(let A=0;A<y;++A)i[d+A]=m[A]}g=i.length-o,c.numberOfCommands=g,f&&(e.pointCloudShading.attenuation&&e.pointCloudShading.eyeDomeLighting&&g>0&&e._pointCloudEyeDomeLighting.update(t,o,e.pointCloudShading,e.boundingSphere),e.debugShowGeometricError||e.debugShowRenderingStatistics||e.debugShowMemoryUsage||e.debugShowUrl?(l(e._tileDebugLabels)||(e._tileDebugLabels=new K0),Eyt(e,t)):e._tileDebugLabels=e._tileDebugLabels&&e._tileDebugLabels.destroy())}var gCe=[],vyt=[];function _Ce(e,t){let n=t,i=gCe;for(i.push(t);i.length>0;){t=i.pop();let r=t.children;for(let o=0;o<r.length;++o)i.push(r[o]);t!==n&&(Pyt(e,t),--e._statistics.numberOfTilesTotal)}n.children=[]}function yCe(e,t){e.tileUnload.raiseEvent(t),e._statistics.decrementLoadCounts(t.content),--e._statistics.numberOfTilesWithContentReady,t.unloadContent()}function ej(e,t){let n=e-t;return n<0?n+Yx.maximumFrameNumber:n}var Syt=64;function wyt(e,t,n){let i=vyt;for(i.length=0,i.push(e);i.length>0;){let r=i.pop(),o=r._contentState;if(o===Mr.LOADING||o===Mr.PROCESSING||!r.hasEmptyContent&&!r.hasTilesetContent&&o!==Mr.UNLOADED&&o!==Mr.FAILED||l(r.cacheNode)||Math.min(ej(t,r._visitedFrame),ej(t,r._touchedFrame),ej(t,r._selectedFrame),ej(t,r._requestedFrame))<n)return i.length=0,!0;let c=r.children;for(let u=0;u<c.length;++u)i.push(c[u])}return!1}function Iyt(e,t){let n=e._externalTilesetTiles,i=t.frameNumber,r=e._externalTilesetIdleFrames,o=e._externalTilesetSweepCount,s=0,a=0;for(;s<o&&a<Syt&&n.length>0;){++a,e._externalTilesetSweepIndex>=n.length&&(e._externalTilesetSweepIndex=0);let c=e._externalTilesetSweepIndex,u=n[c];if(u.isDestroyed()||!u.hasTilesetContent||u.children.length===0){n.splice(c,1);continue}++e._externalTilesetSweepIndex,++s,!wyt(u,i,r)&&(_Ce(e,u),u.unloadTilesetContent(),n.splice(c,1),e._externalTilesetSweepIndex=c)}}function Pyt(e,t){e._cache.unloadTile(e,t,yCe),t.destroy()}ro.prototype.trimLoadedTiles=function(){this._cache.trim()};function Dyt(e,t){let n=e._statistics,i=e._statisticsLast,r=n.numberOfPendingRequests,o=n.numberOfTilesProcessing,s=i.numberOfPendingRequests,a=i.numberOfTilesProcessing;Up.clone(n,i);let c=r!==s||o!==a;c&&t.afterRender.push(function(){return e.loadProgress.raiseEvent(r,o),!0}),e._tilesLoaded=n.numberOfPendingRequests===0&&n.numberOfTilesProcessing===0&&n.numberOfAttemptedRequests===0,c&&e._tilesLoaded&&(t.afterRender.push(function(){return e.allTilesLoaded.raiseEvent(),!0}),e._initialTilesLoaded||(e._initialTilesLoaded=!0,t.afterRender.push(function(){return e.initialTilesLoaded.raiseEvent(),!0})))}function Ryt(e){e._heatmap.resetMinimumMaximum(),e._minimumPriority.depth=Number.MAX_VALUE,e._maximumPriority.depth=-Number.MAX_VALUE,e._minimumPriority.foveatedFactor=Number.MAX_VALUE,e._maximumPriority.foveatedFactor=-Number.MAX_VALUE,e._minimumPriority.distance=Number.MAX_VALUE,e._maximumPriority.distance=-Number.MAX_VALUE,e._minimumPriority.reverseScreenSpaceError=Number.MAX_VALUE,e._maximumPriority.reverseScreenSpaceError=-Number.MAX_VALUE}function Oyt(e,t){t.frameNumber===e._updatedModelMatrixFrame&&l(e._previousModelMatrix)||(e._updatedModelMatrixFrame=t.frameNumber,e._modelMatrixChanged=!M.equals(e.modelMatrix,e._previousModelMatrix),e._modelMatrixChanged&&(e._previousModelMatrix=M.clone(e.modelMatrix,e._previousModelMatrix)))}function Myt(e,t,n,i){if(t.mode===re.MORPHING||!l(e._root))return!1;let r=e._statistics;r.clear(),++e._updatedVisibilityFrame,Ryt(e),Oyt(e,t),e._cullRequestsWhileMoving=e.cullRequestsWhileMoving&&!e._modelMatrixChanged;let o=e.getTraversal(i).selectTiles(e,t);if(i.requestTiles&&hyt(e),Cyt(e,t,i),Up.clone(r,n),i.isRender){let s=e._credits;if(l(s)&&r.selected!==0)for(let a=0;a<s.length;++a){let c=s[a];t.creditDisplay.addCreditToNextFrame(c)}}return o}function ACe(e){let t=e._credits;l(t)||(t=[]),t.length=0,l(e.resource.credits)&&e.resource.credits.forEach(i=>{t.push(It.clone(i))});let n=e.asset.extras;if(l(n)&&l(n.cesium)&&l(n.cesium.credits)){let i=n.cesium.credits;for(let r=0;r<i.length;++r){let o=i[r];t.push(new It(o.html))}}t.forEach(i=>i.showOnScreen=i.showOnScreen||e._showCreditsOnScreen),e._credits=t}ro.prototype.getTraversal=function(e){let{pass:t}=e;return t===po.MOST_DETAILED_PRELOAD||t===po.MOST_DETAILED_PICK?X8:this.isSkippingLevelOfDetail?J8:K8};ro.prototype.update=function(e){this.updateForPass(e,e.tilesetPassState)};ro.prototype.updateForPass=function(e,t){this.imageryLayers._update();let n=t.pass;if(n===po.PRELOAD&&(!this.preloadWhenHidden||this.show)||n===po.PRELOAD_FLIGHT&&(!this.preloadFlightDestinations||!this.show&&!this.preloadWhenHidden)||n===po.REQUEST_RENDER_MODE_DEFER_CHECK&&(!this._cullRequestsWhileMoving&&this.foveatedTimeDelay<=0||!this.show))return;let i=e.commandList,r=e.camera,o=e.cullingVolume;t.ready=!1;let s=po.getPassOptions(n),a=s.ignoreCommands,c=t.commandList??i,u=c.length;if(e.commandList=c,e.camera=t.camera??r,e.cullingVolume=t.cullingVolume??o,s.isRender){let d=this._environmentMapManager;l(this._root)&&(d.position=this.boundingSphere.center),d.update(e)}let f=this._statisticsPerPass[n];(this.show||a)&&(this._pass=n,t.ready=Myt(this,e,f,s)),a&&(c.length=u),e.commandList=i,e.camera=r,e.cullingVolume=o};ro.prototype.hasExtension=function(e){return l(this._extensionsUsed)?this._extensionsUsed.indexOf(e)>-1:!1};ro.prototype.isDestroyed=function(){return!1};ro.prototype.destroy=function(){if(this._tileDebugLabels=this._tileDebugLabels&&this._tileDebugLabels.destroy(),this._removeClippingPolygonAdded=this._removeClippingPolygonAdded&&this._removeClippingPolygonAdded(),this._removeClippingPolygonRemoved=this._removeClippingPolygonRemoved&&this._removeClippingPolygonRemoved(),this._clippingPlanes=this._clippingPlanes&&this._clippingPlanes.destroy(),this._clippingPolygons=void 0,l(this._root)){let e=gCe;for(e.push(this._root);e.length>0;){let t=e.pop();t.destroy();let n=t.children;for(let i=0;i<n.length;++i)e.push(n[i])}}return this._root=void 0,this._shouldDestroyImageBasedLighting&&!this._imageBasedLighting.isDestroyed()&&this._imageBasedLighting.destroy(),this._imageBasedLighting=void 0,this._environmentMapManager.isDestroyed()||this._environmentMapManager.destroy(),this._environmentMapManager=void 0,this._imageryLayers.isDestroyed()||(this.imageryLayers.layerAdded.removeEventListener(this._imageryLayersListener),this.imageryLayers.layerRemoved.removeEventListener(this._imageryLayersListener),this.imageryLayers.layerMoved.removeEventListener(this._imageryLayersListener),this.imageryLayers.layerShownOrHidden.removeEventListener(this._imageryLayersListener),this._imageryLayers.destroy()),this._imageryLayers=void 0,le(this)};ro.supportedExtensions={"3DTILES_metadata":!0,"3DTILES_implicit_tiling":!0,"3DTILES_content_gltf":!0,"3DTILES_content_gltf_vector":!0,"3DTILES_multiple_contents":!0,"3DTILES_bounding_volume_S2":!0,"3DTILES_batch_table_hierarchy":!0,"3DTILES_draco_point_compression":!0,MAXAR_content_geojson:!0};ro.checkSupportedExtensions=function(e){for(let t=0;t<e.length;t++)if(!ro.supportedExtensions[e[t]])throw new oe(`Unsupported 3D Tiles Extension: ${e[t]}`)};var Nyt=new gn,Lyt=new h,Fyt=new h,Byt=new he;ro.prototype.getHeight=function(e,t){let n=t.ellipsoid;l(n)||(n=ee.WGS84);let i=Nyt,r=n.cartographicToCartesian(e,Lyt),o=n.geodeticSurfaceNormal(r,i.direction);i.origin=h.add(r,h.multiplyByScalar(o,2*n.maximumRadius,i.origin),i.origin),i.direction=h.negate(o,i.direction);let s=this.pick(i,t.frameState,Fyt,this.maximumHeightQueryGeometricError);if(l(s))return n.cartesianToCartographic(s,Byt)?.height};ro.prototype.updateHeight=function(e,t,n){n=n??ee.WGS84;let i={positionCartographic:e,ellipsoid:n,callback:t,invoked:!1},r=()=>{let o=this._addHeightCallbacks,s=o.length;for(let a=0;a<s;++a)if(o[a]===i){o.splice(a,1);break}i.callback&&(i.callback=void 0)};return this._addHeightCallbacks.push(i),r};var kyt=new h;ro.prototype.pick=function(e,t,n,i){if(!t.context.webgl2&&!this._enablePick)return;let r=this._selectedTiles,o=r.length,s=[],a=e.origin.x,c=e.origin.y,u=e.origin.z,f=e.direction.x,d=e.direction.y,p=e.direction.z,g=f*f+d*d+p*p;for(let b=0;b<o;++b){let x=r[b];if(l(i)&&x.geometricError>i||!l(x.content))continue;let T=x.contentBoundingVolume.boundingSphere,E=T.center,v=a-E.x,S=c-E.y,I=u-E.z,R=2*(f*v+d*S+p*I),O=v*v+S*S+I*I-T.radius*T.radius;R*R-4*g*O<0||s.push(x)}let m=s.length,y,A=Number.POSITIVE_INFINITY;for(let b=0;b<m;++b){let T=s[b].content.pick(e,t,kyt);if(l(T)){let E=h.distanceSquared(T,e.origin);E<A&&(A=E,y=h.clone(T,n))}}return y};ro.prototype.isGltfExtensionUsed=function(e){if(this.hasExtension("3DTILES_content_gltf")){if(!l(this.extensions))return!1;let t=this.extensions["3DTILES_content_gltf"]?.extensionsUsed;return l(t)?t.indexOf(e)>-1:!1}return!1};ro.prototype.isGltfExtensionRequired=function(e){if(this.isGltfExtensionUsed(e)){let t=this.extensions["3DTILES_content_gltf"].extensionsRequired;return l(t)?t.indexOf(e)>-1:!1}return!1};var ts=ro;var Uyt=new M;function iA(e,t){t.collectionChanged.addEventListener(iA.prototype._onCollectionChanged,this),this._scene=e,this._primitives=e.primitives,this._entityCollection=t,this._tilesetHash={},this._entitiesToVisualize=new zt,this._onCollectionChanged(t,t.values,[],[])}iA.prototype.update=function(e){let t=this._entitiesToVisualize.values,n=this._tilesetHash,i=this._primitives;for(let r=0,o=t.length;r<o;r++){let s=t[r],a=s._tileset,c,u=n[s.id],f=s.isShowing&&s.isAvailable(e)&&X.getValueOrDefault(a._show,e,!0),d;f&&(d=s.computeModelMatrix(e,Uyt),c=De.createIfNeeded(X.getValueOrUndefined(a._uri,e)));let p=l(u)?u.tilesetPrimitive:void 0;if(!f){l(p)&&(p.show=!1);continue}(!l(u)||c.url!==u.url)&&(l(p)&&i.removeAndDestroy(p),delete n[s.id],zyt(c,n,s,i)),l(p)&&(p.show=!0,l(d)&&(p.modelMatrix=d),p.maximumScreenSpaceError=X.getValueOrDefault(a.maximumScreenSpaceError,e,p.maximumScreenSpaceError))}return!0};iA.prototype.isDestroyed=function(){return!1};iA.prototype.destroy=function(){this._entityCollection.collectionChanged.removeEventListener(iA.prototype._onCollectionChanged,this);let e=this._entitiesToVisualize.values,t=this._tilesetHash,n=this._primitives;for(let i=e.length-1;i>-1;i--)Iee(this,e[i],t,n);return le(this)};iA.prototype.getBoundingSphere=function(e,t){let n=this._tilesetHash[e.id];if(!l(n)||n.loadFail)return Pt.FAILED;let i=n.tilesetPrimitive;return l(i)?i.show?(ue.clone(i.boundingSphere,t),Pt.DONE):Pt.FAILED:Pt.PENDING};iA.prototype._onCollectionChanged=function(e,t,n,i){let r,o,s=this._entitiesToVisualize,a=this._tilesetHash,c=this._primitives;for(r=t.length-1;r>-1;r--)o=t[r],l(o._tileset)&&s.set(o.id,o);for(r=i.length-1;r>-1;r--)o=i[r],l(o._tileset)?s.set(o.id,o):(Iee(this,o,a,c),s.remove(o.id));for(r=n.length-1;r>-1;r--)o=n[r],Iee(this,o,a,c),s.remove(o.id)};function Iee(e,t,n,i){let r=n[t.id];l(r)&&(l(r.tilesetPrimitive)&&i.removeAndDestroy(r.tilesetPrimitive),delete n[t.id])}async function zyt(e,t,n,i){t[n.id]={url:e.url,loadFail:!1};try{let r=await ts.fromUrl(e);if(r.id=n,i.add(r),!l(t[n.id]))return;t[n.id].tilesetPrimitive=r}catch(r){console.error(r),t[n.id].loadFail=!0}}var tj=iA;function Kx(e,t,n){this._callback=void 0,this._isConstant=void 0,this._referenceFrame=n??Wi.FIXED,this._definitionChanged=new be,this.setCallback(e,t)}Object.defineProperties(Kx.prototype,{isConstant:{get:function(){return this._isConstant}},definitionChanged:{get:function(){return this._definitionChanged}},referenceFrame:{get:function(){return this._referenceFrame}}});var Vyt=new K;Kx.prototype.getValue=function(e,t){return l(e)||(e=K.now(Vyt)),this.getValueInReferenceFrame(e,Wi.FIXED,t)};Kx.prototype.setCallback=function(e,t){let n=this._callback!==e||this._isConstant!==t;this._callback=e,this._isConstant=t,n&&this._definitionChanged.raiseEvent(this)};Kx.prototype.getValueInReferenceFrame=function(e,t,n){let i=this._callback(e,n);return ip.convertToReferenceFrame(e,i,this._referenceFrame,t,n)};Kx.prototype.equals=function(e){return this===e||e instanceof Kx&&this._callback===e._callback&&this._isConstant===e._isConstant&&this._referenceFrame===e._referenceFrame};var nj=Kx;function Ree(e,t){return K.compare(e.start,t.start)}function gs(e){if(this._intervals=[],this._changedEvent=new be,l(e)){let t=e.length;for(let n=0;n<t;n++)this.addInterval(e[n])}}Object.defineProperties(gs.prototype,{changedEvent:{get:function(){return this._changedEvent}},start:{get:function(){let e=this._intervals;return e.length===0?void 0:e[0].start}},isStartIncluded:{get:function(){let e=this._intervals;return e.length===0?!1:e[0].isStartIncluded}},stop:{get:function(){let e=this._intervals,t=e.length;return t===0?void 0:e[t-1].stop}},isStopIncluded:{get:function(){let e=this._intervals,t=e.length;return t===0?!1:e[t-1].isStopIncluded}},length:{get:function(){return this._intervals.length}},isEmpty:{get:function(){return this._intervals.length===0}}});gs.prototype.equals=function(e,t){if(this===e)return!0;if(!(e instanceof gs))return!1;let n=this._intervals,i=e._intervals,r=n.length;if(r!==i.length)return!1;for(let o=0;o<r;o++)if(!Cn.equals(n[o],i[o],t))return!1;return!0};gs.prototype.get=function(e){return this._intervals[e]};gs.prototype.removeAll=function(){this._intervals.length>0&&(this._intervals.length=0,this._changedEvent.raiseEvent(this))};gs.prototype.findIntervalContainingDate=function(e){let t=this.indexOf(e);return t>=0?this._intervals[t]:void 0};gs.prototype.findDataForIntervalContainingDate=function(e){let t=this.indexOf(e);return t>=0?this._intervals[t].data:void 0};gs.prototype.contains=function(e){return this.indexOf(e)>=0};var Pee=new Cn;gs.prototype.indexOf=function(e){let t=this._intervals;Pee.start=e,Pee.stop=e;let n=Pr(t,Pee,Ree);return n>=0?t[n].isStartIncluded?n:n>0&&t[n-1].stop.equals(e)&&t[n-1].isStopIncluded?n-1:~n:(n=~n,n>0&&n-1<t.length&&Cn.contains(t[n-1],e)?n-1:~n)};gs.prototype.findInterval=function(e){e=e??H.EMPTY_OBJECT;let t=e.start,n=e.stop,i=e.isStartIncluded,r=e.isStopIncluded,o=this._intervals;for(let s=0,a=o.length;s<a;s++){let c=o[s];if((!l(t)||c.start.equals(t))&&(!l(n)||c.stop.equals(n))&&(!l(i)||c.isStartIncluded===i)&&(!l(r)||c.isStopIncluded===r))return o[s]}};gs.prototype.addInterval=function(e,t){if(e.isEmpty)return;let n=this._intervals;if(n.length===0||K.greaterThan(e.start,n[n.length-1].stop)){n.push(e),this._changedEvent.raiseEvent(this);return}let i=Pr(n,e,Ree);i<0?i=~i:i>0&&e.isStartIncluded&&n[i-1].isStartIncluded&&n[i-1].start.equals(e.start)?--i:i<n.length&&!e.isStartIncluded&&n[i].isStartIncluded&&n[i].start.equals(e.start)&&++i;let r;for(i>0&&(r=K.compare(n[i-1].stop,e.start),(r>0||r===0&&(n[i-1].isStopIncluded||e.isStartIncluded))&&((l(t)?t(n[i-1].data,e.data):n[i-1].data===e.data)?(K.greaterThan(e.stop,n[i-1].stop)?e=new Cn({start:n[i-1].start,stop:e.stop,isStartIncluded:n[i-1].isStartIncluded,isStopIncluded:e.isStopIncluded,data:e.data}):e=new Cn({start:n[i-1].start,stop:n[i-1].stop,isStartIncluded:n[i-1].isStartIncluded,isStopIncluded:n[i-1].isStopIncluded||e.stop.equals(n[i-1].stop)&&e.isStopIncluded,data:e.data}),n.splice(i-1,1),--i):(r=K.compare(n[i-1].stop,e.stop),(r>0||r===0&&n[i-1].isStopIncluded&&!e.isStopIncluded)&&n.splice(i,0,new Cn({start:e.stop,stop:n[i-1].stop,isStartIncluded:!e.isStopIncluded,isStopIncluded:n[i-1].isStopIncluded,data:n[i-1].data})),n[i-1]=new Cn({start:n[i-1].start,stop:e.start,isStartIncluded:n[i-1].isStartIncluded,isStopIncluded:!e.isStartIncluded,data:n[i-1].data}))));i<n.length&&(r=K.compare(e.stop,n[i].start),r>0||r===0&&(e.isStopIncluded||n[i].isStartIncluded));)if(l(t)?t(n[i].data,e.data):n[i].data===e.data)e=new Cn({start:e.start,stop:K.greaterThan(n[i].stop,e.stop)?n[i].stop:e.stop,isStartIncluded:e.isStartIncluded,isStopIncluded:K.greaterThan(n[i].stop,e.stop)?n[i].isStopIncluded:e.isStopIncluded,data:e.data}),n.splice(i,1);else if(n[i]=new Cn({start:e.stop,stop:n[i].stop,isStartIncluded:!e.isStopIncluded,isStopIncluded:n[i].isStopIncluded,data:n[i].data}),n[i].isEmpty)n.splice(i,1);else break;n.splice(i,0,e),this._changedEvent.raiseEvent(this)};gs.prototype.removeInterval=function(e){if(e.isEmpty)return!1;let t=this._intervals,n=Pr(t,e,Ree);n<0&&(n=~n);let i=!1;for(n>0&&(K.greaterThan(t[n-1].stop,e.start)||t[n-1].stop.equals(e.start)&&t[n-1].isStopIncluded&&e.isStartIncluded)&&(i=!0,(K.greaterThan(t[n-1].stop,e.stop)||t[n-1].isStopIncluded&&!e.isStopIncluded&&t[n-1].stop.equals(e.stop))&&t.splice(n,0,new Cn({start:e.stop,stop:t[n-1].stop,isStartIncluded:!e.isStopIncluded,isStopIncluded:t[n-1].isStopIncluded,data:t[n-1].data})),t[n-1]=new Cn({start:t[n-1].start,stop:e.start,isStartIncluded:t[n-1].isStartIncluded,isStopIncluded:!e.isStartIncluded,data:t[n-1].data})),n<t.length&&!e.isStartIncluded&&t[n].isStartIncluded&&e.start.equals(t[n].start)&&(i=!0,t.splice(n,0,new Cn({start:t[n].start,stop:t[n].start,isStartIncluded:!0,isStopIncluded:!0,data:t[n].data})),++n);n<t.length&&K.greaterThan(e.stop,t[n].stop);)i=!0,t.splice(n,1);return n<t.length&&e.stop.equals(t[n].stop)&&(i=!0,!e.isStopIncluded&&t[n].isStopIncluded?n+1<t.length&&t[n+1].start.equals(e.stop)&&t[n].data===t[n+1].data?(t.splice(n,1),t[n]=new Cn({start:t[n].start,stop:t[n].stop,isStartIncluded:!0,isStopIncluded:t[n].isStopIncluded,data:t[n].data})):t[n]=new Cn({start:e.stop,stop:e.stop,isStartIncluded:!0,isStopIncluded:!0,data:t[n].data}):t.splice(n,1)),n<t.length&&(K.greaterThan(e.stop,t[n].start)||e.stop.equals(t[n].start)&&e.isStopIncluded&&t[n].isStartIncluded)&&(i=!0,t[n]=new Cn({start:e.stop,stop:t[n].stop,isStartIncluded:!e.isStopIncluded,isStopIncluded:t[n].isStopIncluded,data:t[n].data})),i&&this._changedEvent.raiseEvent(this),i};gs.prototype.intersect=function(e,t,n){let i=new gs,r=0,o=0,s=this._intervals,a=e._intervals;for(;r<s.length&&o<a.length;){let c=s[r],u=a[o];if(K.lessThan(c.stop,u.start))++r;else if(K.lessThan(u.stop,c.start))++o;else{if(l(n)||l(t)&&t(c.data,u.data)||!l(t)&&u.data===c.data){let f=Cn.intersect(c,u,new Cn,n);f.isEmpty||i.addInterval(f,t)}K.lessThan(c.stop,u.stop)||c.stop.equals(u.stop)&&!c.isStopIncluded&&u.isStopIncluded?++r:++o}}return i};gs.fromJulianDateArray=function(e,t){l(t)||(t=new gs);let n=e.julianDates,i=n.length,r=e.dataCallback,o=e.isStartIncluded??!0,s=e.isStopIncluded??!0,a=e.leadingInterval??!1,c=e.trailingInterval??!1,u,f=0;a&&(++f,u=new Cn({start:it.MINIMUM_VALUE,stop:n[0],isStartIncluded:!0,isStopIncluded:!o}),u.data=l(r)?r(u,t.length):t.length,t.addInterval(u));for(let d=0;d<i-1;++d){let p=n[d],g=n[d+1];u=new Cn({start:p,stop:g,isStartIncluded:t.length===f?o:!0,isStopIncluded:d===i-2?s:!1}),u.data=l(r)?r(u,t.length):t.length,t.addInterval(u)}return c&&(u=new Cn({start:n[i-1],stop:it.MAXIMUM_VALUE,isStartIncluded:!s,isStopIncluded:!0}),u.data=l(r)?r(u,t.length):t.length,t.addInterval(u)),t};var ol=new Fm,lR=[0,31,28,31,30,31,30,31,31,30,31,30,31];function Dee(e,t,n){l(n)||(n=new K),K.toGregorianDate(e,ol);let i=ol.millisecond+t.millisecond,r=ol.second+t.second,o=ol.minute+t.minute,s=ol.hour+t.hour,a=ol.day+t.day,c=ol.month+t.month,u=ol.year+t.year;for(i>=1e3&&(r+=Math.floor(i/1e3),i=i%1e3),r>=60&&(o+=Math.floor(r/60),r=r%60),o>=60&&(s+=Math.floor(o/60),o=o%60),s>=24&&(a+=Math.floor(s/24),s=s%24),lR[2]=ou(u)?29:28;a>lR[c]||c>=13;)a>lR[c]&&(a-=lR[c],++c),c>=13&&(--c,u+=Math.floor(c/12),c=c%12,++c),lR[2]=ou(u)?29:28;return ol.millisecond=i,ol.second=r,ol.minute=o,ol.hour=s,ol.day=a,ol.month=c,ol.year=u,K.fromGregorianDate(ol,n)}var jyt=new K,Hyt=/P(?:([\d.,]+)Y)?(?:([\d.,]+)M)?(?:([\d.,]+)W)?(?:([\d.,]+)D)?(?:T(?:([\d.,]+)H)?(?:([\d.,]+)M)?(?:([\d.,]+)S)?)?/;function bCe(e,t){if(!l(e)||e.length===0)return!1;if(t.year=0,t.month=0,t.day=0,t.hour=0,t.minute=0,t.second=0,t.millisecond=0,e[0]==="P"){let n=e.match(Hyt);if(!l(n))return!1;if(l(n[1])&&(t.year=Number(n[1].replace(",","."))),l(n[2])&&(t.month=Number(n[2].replace(",","."))),l(n[3])&&(t.day=Number(n[3].replace(",","."))*7),l(n[4])&&(t.day+=Number(n[4].replace(",","."))),l(n[5])&&(t.hour=Number(n[5].replace(",","."))),l(n[6])&&(t.minute=Number(n[6].replace(",","."))),l(n[7])){let i=Number(n[7].replace(",","."));t.second=Math.floor(i),t.millisecond=i%1*1e3}}else e[e.length-1]!=="Z"&&(e+="Z"),K.toGregorianDate(K.fromIso8601(e,jyt),t);return t.year||t.month||t.day||t.hour||t.minute||t.second||t.millisecond}var uR=new Fm;gs.fromIso8601=function(e,t){let n=e.iso8601.split("/"),i=K.fromIso8601(n[0]),r=K.fromIso8601(n[1]),o=[];if(!bCe(n[2],uR))o.push(i,r);else{let s=K.clone(i);for(o.push(s);K.compare(s,r)<0;)s=Dee(s,uR),K.compare(r,s)<=0&&K.clone(r,s),o.push(s)}return gs.fromJulianDateArray({julianDates:o,isStartIncluded:e.isStartIncluded,isStopIncluded:e.isStopIncluded,leadingInterval:e.leadingInterval,trailingInterval:e.trailingInterval,dataCallback:e.dataCallback},t)};gs.fromIso8601DateArray=function(e,t){return gs.fromJulianDateArray({julianDates:e.iso8601Dates.map(function(n){return K.fromIso8601(n)}),isStartIncluded:e.isStartIncluded,isStopIncluded:e.isStopIncluded,leadingInterval:e.leadingInterval,trailingInterval:e.trailingInterval,dataCallback:e.dataCallback},t)};gs.fromIso8601DurationArray=function(e,t){let n=e.epoch,i=e.iso8601Durations,r=e.relativeToPrevious??!1,o=[],s,a,c=i.length;for(let u=0;u<c;++u)(bCe(i[u],uR)||u===0)&&(r&&l(a)?s=Dee(a,uR):s=Dee(n,uR),o.push(s),a=s);return gs.fromJulianDateArray({julianDates:o,isStartIncluded:e.isStartIncluded,isStopIncluded:e.isStopIncluded,leadingInterval:e.leadingInterval,trailingInterval:e.trailingInterval,dataCallback:e.dataCallback},t)};var Bs=gs;function Gyt(e,t,n,i){function r(){n.raiseEvent(e)}let o=[];t.removeAll();let s=i.length;for(let a=0;a<s;a++){let c=i.get(a);l(c.data)&&o.indexOf(c.data)===-1&&t.add(c.data.definitionChanged,r)}}function $x(){this._eventHelper=new Wo,this._definitionChanged=new be,this._intervals=new Bs,this._intervals.changedEvent.addEventListener($x.prototype._intervalsChanged,this)}Object.defineProperties($x.prototype,{isConstant:{get:function(){return this._intervals.isEmpty}},definitionChanged:{get:function(){return this._definitionChanged}},intervals:{get:function(){return this._intervals}}});var Wyt=new K;$x.prototype.getValue=function(e,t){l(e)||(e=K.now(Wyt));let n=this._intervals.findDataForIntervalContainingDate(e);if(l(n))return n.getValue(e,t)};$x.prototype.equals=function(e){return this===e||e instanceof $x&&this._intervals.equals(e._intervals,X.equals)};$x.prototype._intervalsChanged=function(){Gyt(this,this._eventHelper,this._definitionChanged,this._intervals),this._definitionChanged.raiseEvent(this)};var Wl=$x;function rA(e){this._referenceFrame=e??Wi.FIXED,this._definitionChanged=new be,this._composite=new Wl,this._composite.definitionChanged.addEventListener(rA.prototype._raiseDefinitionChanged,this)}Object.defineProperties(rA.prototype,{isConstant:{get:function(){return this._composite.isConstant}},definitionChanged:{get:function(){return this._definitionChanged}},intervals:{get:function(){return this._composite.intervals}},referenceFrame:{get:function(){return this._referenceFrame},set:function(e){this._referenceFrame=e}}});var qyt=new K;rA.prototype.getValue=function(e,t){return l(e)||(e=K.now(qyt)),this.getValueInReferenceFrame(e,Wi.FIXED,t)};rA.prototype.getValueInReferenceFrame=function(e,t,n){let i=this._composite._intervals.findDataForIntervalContainingDate(e);if(l(i))return i.getValueInReferenceFrame(e,t,n)};rA.prototype.equals=function(e){return this===e||e instanceof rA&&this._referenceFrame===e._referenceFrame&&this._composite.equals(e._composite,X.equals)};rA.prototype._raiseDefinitionChanged=function(){this._definitionChanged.raiseEvent(this)};var Ec=rA;var xCe={WHOLE:0,PORTIONS:1};Object.freeze(xCe);var Fg=xCe;function TCe(e,t,n){let i=new WeakRef(t),r=e.addEventListener(function(){let o=i.deref();l(o)?n.apply(o,arguments):r()});return r}function Jx(e){let t=e._targetProperty;if(!l(t)){let n=e._targetEntity;if(!l(n)){if(n=e._targetCollection.getById(e._targetId),!l(n)){e._targetEntity=e._targetProperty=void 0;return}e._removeTargetListener=TCe(n.definitionChanged,e,zd.prototype._onTargetEntityDefinitionChanged),e._targetEntity=n}let i=e._targetPropertyNames;t=e._targetEntity;for(let r=0,o=i.length;r<o&&l(t);++r)t=t[i[r]];e._targetProperty=t}return t}function zd(e,t,n){this._targetCollection=e,this._targetId=t,this._targetPropertyNames=n,this._targetProperty=void 0,this._targetEntity=void 0,this._definitionChanged=new be,this._removeTargetListener=void 0,TCe(e.collectionChanged,this,zd.prototype._onCollectionChanged)}Object.defineProperties(zd.prototype,{isConstant:{get:function(){return X.isConstant(Jx(this))}},definitionChanged:{get:function(){return this._definitionChanged}},referenceFrame:{get:function(){let e=Jx(this);return l(e)?e.referenceFrame:void 0}},targetId:{get:function(){return this._targetId}},targetCollection:{get:function(){return this._targetCollection}},targetPropertyNames:{get:function(){return this._targetPropertyNames}},resolvedProperty:{get:function(){return Jx(this)}}});zd.fromString=function(e,t){let n,i=[],r=!0,o=!1,s="";for(let a=0;a<t.length;++a){let c=t.charAt(a);o?(s+=c,o=!1):c==="\\"?o=!0:r&&c==="#"?(n=s,r=!1,s=""):!r&&c==="."?(i.push(s),s=""):s+=c}return i.push(s),new zd(e,n,i)};var Yyt=new K;zd.prototype.getValue=function(e,t){let n=Jx(this);return l(e)||(e=K.now(Yyt)),l(n)?n.getValue(e,t):void 0};zd.prototype.getValueInReferenceFrame=function(e,t,n){let i=Jx(this);return l(i)?i.getValueInReferenceFrame(e,t,n):void 0};zd.prototype.getType=function(e){let t=Jx(this);return l(t)?t.getType(e):void 0};zd.prototype.equals=function(e){if(this===e)return!0;let t=this._targetPropertyNames,n=e._targetPropertyNames;if(this._targetCollection!==e._targetCollection||this._targetId!==e._targetId||t.length!==n.length)return!1;let i=this._targetPropertyNames.length;for(let r=0;r<i;r++)if(t[r]!==n[r])return!1;return!0};zd.prototype._onTargetEntityDefinitionChanged=function(e,t,n,i){l(this._targetProperty)&&this._targetPropertyNames[0]===t&&(this._targetProperty=void 0,this._definitionChanged.raiseEvent(this))};zd.prototype._onCollectionChanged=function(e,t,n){let i=this._targetEntity;l(i)&&n.indexOf(i)!==-1?(this._removeTargetListener(),this._removeTargetListener=void 0,this._targetEntity=this._targetProperty=void 0):l(i)||(i=Jx(this),l(i)&&this._definitionChanged.raiseEvent(this))};var oA=zd;var ECe={NONE:0,HOLD:1,EXTRAPOLATE:2,LINEAR_EXTRAPOLATE:3};Object.freeze(ECe);var Bu=ECe;var Oee=class{static get type(){return"Linear"}static getRequiredDataPoints(t){return 2}static interpolateOrderZero(t,n,i,r,o){l(o)||(o=new Array(r));let s,a,c,u=n[0],f=n[1];for(s=0;s<r;s++)a=i[s],c=i[s+r],o[s]=((c-a)*t+f*a-u*c)/(f-u);return o}},Zx=Oee;var CCe={packedLength:1,pack:function(e,t,n){n=n??0,t[n]=e},unpack:function(e,t,n){return t=t??0,e[t]}};function vCe(e,t,n){let i,r=e.length,o=n.length,s=r+o;if(e.length=s,r!==t){let a=r-1;for(i=s-1;i>=t;i--)e[i]=e[a--]}for(i=0;i<o;i++)e[t++]=n[i]}function SCe(e,t){return e instanceof K?e:typeof e=="string"?K.fromIso8601(e):K.addSeconds(t,e,new K)}var Mee=[],Nee=[];function ij(e,t,n,i,r){let o=0,s,a,c,u,f,d;for(;o<i.length;){f=SCe(i[o],e),c=Pr(t,f,K.compare);let p=0,g=0;if(c<0){for(c=~c,u=c*r,a=void 0,d=t[c];o<i.length&&(f=SCe(i[o],e),!(l(a)&&K.compare(a,f)>=0||l(d)&&K.compare(f,d)>=0));){for(Mee[p++]=f,o=o+1,s=0;s<r;s++)Nee[g++]=i[o],o=o+1;a=f}p>0&&(Nee.length=g,vCe(n,u,Nee),Mee.length=p,vCe(t,c,Mee))}else{for(s=0;s<r;s++)o++,n[c*r+s]=i[o];o++}}}function Vd(e,t){let n=e;n===Number&&(n=CCe);let i=n.packedLength,r=n.packedInterpolationLength??i,o=0,s;if(l(t)){let a=t.length;s=new Array(a);for(let c=0;c<a;c++){let u=t[c];u===Number&&(u=CCe);let f=u.packedLength;i+=f,r+=u.packedInterpolationLength??f,s[c]=u}o=a}this._type=e,this._innerType=n,this._interpolationDegree=1,this._interpolationAlgorithm=Zx,this._lastInterpolationAlgorithm=Zx,this._numberOfPoints=0,this._times=[],this._values=[],this._xTable=[],this._yTable=[],this._packedLength=i,this._packedInterpolationLength=r,this._updateTableLength=!0,this._interpolationResult=new Array(r),this._definitionChanged=new be,this._derivativeTypes=t,this._innerDerivativeTypes=s,this._inputOrder=o,this._forwardExtrapolationType=Bu.NONE,this._forwardExtrapolationDuration=0,this._backwardExtrapolationType=Bu.NONE,this._backwardExtrapolationDuration=0}Object.defineProperties(Vd.prototype,{isConstant:{get:function(){return this._values.length===0}},definitionChanged:{get:function(){return this._definitionChanged}},type:{get:function(){return this._type}},derivativeTypes:{get:function(){return this._derivativeTypes}},interpolationDegree:{get:function(){return this._interpolationDegree}},interpolationAlgorithm:{get:function(){return this._interpolationAlgorithm}},forwardExtrapolationType:{get:function(){return this._forwardExtrapolationType},set:function(e){this._forwardExtrapolationType!==e&&(this._forwardExtrapolationType=e,this._definitionChanged.raiseEvent(this))}},forwardExtrapolationDuration:{get:function(){return this._forwardExtrapolationDuration},set:function(e){this._forwardExtrapolationDuration!==e&&(this._forwardExtrapolationDuration=e,this._definitionChanged.raiseEvent(this))}},backwardExtrapolationType:{get:function(){return this._backwardExtrapolationType},set:function(e){this._backwardExtrapolationType!==e&&(this._backwardExtrapolationType=e,this._definitionChanged.raiseEvent(this))}},backwardExtrapolationDuration:{get:function(){return this._backwardExtrapolationDuration},set:function(e){this._backwardExtrapolationDuration!==e&&(this._backwardExtrapolationDuration=e,this._definitionChanged.raiseEvent(this))}}});var Xyt=new K;Vd.prototype.getValue=function(e,t){l(e)||(e=K.now(Xyt));let n=this._times,i=n.length;if(i===0)return;let r,o=this._innerType,s=this._values,a=Pr(n,e,K.compare);var c=!1;if(a<0){if(a=~a,a===0){let S=n[a];if(r=this._backwardExtrapolationDuration,this._backwardExtrapolationType===Bu.NONE||r!==0&&K.secondsDifference(S,e)>r)return;if(this._backwardExtrapolationType===Bu.HOLD)return o.unpack(s,0,t);c=this._backwardExtrapolationType===Bu.LINEAR_EXTRAPOLATE}if(a>=i){a=i-1;let S=n[a];if(r=this._forwardExtrapolationDuration,this._forwardExtrapolationType===Bu.NONE||r!==0&&K.secondsDifference(e,S)>r)return;if(this._forwardExtrapolationType===Bu.HOLD)return a=i-1,o.unpack(s,a*o.packedLength,t);c=this._forwardExtrapolationType===Bu.LINEAR_EXTRAPOLATE}let d=this._xTable,p=this._yTable;var u,f;c?(u=Cesium.LinearApproximation,f=1):(u=this._interpolationAlgorithm,f=this._interpolationDegree),this._lastInterpolationAlgorithm!=u&&(this._lastInterpolationAlgorithm=u,this._updateTableLength=!0);let g=this._packedInterpolationLength,m=this._inputOrder;if(this._updateTableLength){this._updateTableLength=!1;let S=Math.min(u.getRequiredDataPoints(f,m),i);S!==this._numberOfPoints&&(this._numberOfPoints=S,d.length=S,p.length=S*g)}let y=this._numberOfPoints-1;if(y<1)return;let A=0,b=i-1;if(b-A+1>=y+1){let S=a-(y/2|0)-1;S<A&&(S=A);let I=S+y;I>b&&(I=b,S=I-y,S<A&&(S=A)),A=S,b=I}let T=b-A+1;for(let S=0;S<T;++S)d[S]=K.secondsDifference(n[A+S],n[b]);if(l(o.convertPackedArrayForInterpolation))o.convertPackedArrayForInterpolation(s,A,b,p);else{let S=0,I=this._packedLength,R=A*I,O=(b+1)*I;for(;R<O;)p[S]=s[R],R++,S++}let E=K.secondsDifference(e,n[b]),v;if(m===0||!l(u.interpolate))v=u.interpolateOrderZero(E,d,p,g,this._interpolationResult);else{let S=Math.floor(g/(m+1));v=u.interpolate(E,d,p,S,m,m,this._interpolationResult)}return l(o.unpackInterpolationResult)?o.unpackInterpolationResult(v,s,A,b,t):o.unpack(v,0,t)}return o.unpack(s,a*this._packedLength,t)};Vd.prototype.setInterpolationOptions=function(e){if(!l(e))return;let t=!1,n=e.interpolationAlgorithm,i=e.interpolationDegree;l(n)&&this._interpolationAlgorithm!==n&&(this._interpolationAlgorithm=n,t=!0),l(i)&&this._interpolationDegree!==i&&(this._interpolationDegree=i,t=!0),t&&(this._updateTableLength=!0,this._definitionChanged.raiseEvent(this))};Vd.prototype.addSample=function(e,t,n){let i=this._innerDerivativeTypes,r=l(i),o=this._innerType,s=[];if(s.push(e),o.pack(t,s,s.length),r){let a=i.length;for(let c=0;c<a;c++)i[c].pack(n[c],s,s.length)}ij(void 0,this._times,this._values,s,this._packedLength),this._updateTableLength=!0,this._definitionChanged.raiseEvent(this)};Vd.prototype.addSamples=function(e,t,n){let i=this._innerDerivativeTypes,r=l(i),o=this._innerType,s=e.length,a=[];for(let c=0;c<s;c++)if(a.push(e[c]),o.pack(t[c],a,a.length),r){let u=n[c],f=i.length;for(let d=0;d<f;d++)i[d].pack(u[d],a,a.length)}ij(void 0,this._times,this._values,a,this._packedLength),this._updateTableLength=!0,this._definitionChanged.raiseEvent(this)};Vd.prototype.getSample=function(e){let t=this._times,n=t.length;if(l(n))return e<0&&(e+=n),t[e]};Vd.prototype.addSamplesPackedArray=function(e,t){ij(t,this._times,this._values,e,this._packedLength),this._updateTableLength=!0,this._definitionChanged.raiseEvent(this)};Vd.prototype.removeSample=function(e){let t=Pr(this._times,e,K.compare);return t<0?!1:(wCe(this,t,1),!0)};function wCe(e,t,n){let i=e._packedLength;e._times.splice(t,n),e._values.splice(t*i,n*i),e._updateTableLength=!0,e._definitionChanged.raiseEvent(e)}Vd.prototype.removeSamples=function(e){let t=this._times,n=Pr(t,e.start,K.compare);n<0?n=~n:e.isStartIncluded||++n;let i=Pr(t,e.stop,K.compare);i<0?i=~i:e.isStopIncluded&&++i,wCe(this,n,i-n)};Vd.prototype.equals=function(e){if(this===e)return!0;if(!l(e)||this._type!==e._type||this._interpolationDegree!==e._interpolationDegree||this._interpolationAlgorithm!==e._interpolationAlgorithm)return!1;let t=this._derivativeTypes,n=l(t),i=e._derivativeTypes,r=l(i);if(n!==r)return!1;let o,s;if(n){if(s=t.length,s!==i.length)return!1;for(o=0;o<s;o++)if(t[o]!==i[o])return!1}let a=this._times,c=e._times;if(s=a.length,s!==c.length)return!1;for(o=0;o<s;o++)if(!K.equals(a[o],c[o]))return!1;let u=this._values,f=e._values;for(s=u.length,o=0;o<s;o++)if(u[o]!==f[o])return!1;return!0};Vd._mergeNewSamples=ij;var jd=Vd;function Hd(e,t){t=t??0;let n;if(t>0){n=new Array(t);for(let i=0;i<t;i++)n[i]=h}this._numberOfDerivatives=t,this._property=new jd(h,n),this._definitionChanged=new be,this._referenceFrame=e??Wi.FIXED,this._property._definitionChanged.addEventListener(function(){this._definitionChanged.raiseEvent(this)},this)}Object.defineProperties(Hd.prototype,{isConstant:{get:function(){return this._property.isConstant}},definitionChanged:{get:function(){return this._definitionChanged}},referenceFrame:{get:function(){return this._referenceFrame}},interpolationDegree:{get:function(){return this._property.interpolationDegree}},interpolationAlgorithm:{get:function(){return this._property.interpolationAlgorithm}},numberOfDerivatives:{get:function(){return this._numberOfDerivatives}},forwardExtrapolationType:{get:function(){return this._property.forwardExtrapolationType},set:function(e){this._property.forwardExtrapolationType=e}},forwardExtrapolationDuration:{get:function(){return this._property.forwardExtrapolationDuration},set:function(e){this._property.forwardExtrapolationDuration=e}},backwardExtrapolationType:{get:function(){return this._property.backwardExtrapolationType},set:function(e){this._property.backwardExtrapolationType=e}},backwardExtrapolationDuration:{get:function(){return this._property.backwardExtrapolationDuration},set:function(e){this._property.backwardExtrapolationDuration=e}}});var Kyt=new K;Hd.prototype.getValue=function(e,t){return l(e)||(e=K.now(Kyt)),this.getValueInReferenceFrame(e,Wi.FIXED,t)};Hd.prototype.getValueInReferenceFrame=function(e,t,n){if(n=this._property.getValue(e,n),l(n))return ip.convertToReferenceFrame(e,n,this._referenceFrame,t,n)};Hd.prototype.setInterpolationOptions=function(e){this._property.setInterpolationOptions(e)};Hd.prototype.addSample=function(e,t,n){let i=this._numberOfDerivatives;this._property.addSample(e,t,n)};Hd.prototype.addSamples=function(e,t,n){this._property.addSamples(e,t,n)};Hd.prototype.addSamplesPackedArray=function(e,t){this._property.addSamplesPackedArray(e,t)};Hd.prototype.removeSample=function(e){return this._property.removeSample(e)};Hd.prototype.removeSamples=function(e){this._property.removeSamples(e)};Hd.prototype.equals=function(e){return this===e||e instanceof Hd&&X.equals(this._property,e._property)&&this._referenceFrame===e._referenceFrame};var Cc=Hd;function sA(e){this._definitionChanged=new be,this._value=void 0,this._removeSubscription=void 0,this.setValue(e)}Object.defineProperties(sA.prototype,{isConstant:{get:function(){return X.isConstant(this._value)}},definitionChanged:{get:function(){return this._definitionChanged}},referenceFrame:{get:function(){return l(this._value)?this._value.referenceFrame:Wi.FIXED}}});var $yt=new K;sA.prototype.getValue=function(e,t){return l(e)||(e=K.now($yt)),this.getValueInReferenceFrame(e,Wi.FIXED,t)};sA.prototype.setValue=function(e){this._value!==e&&(this._value=e,l(this._removeSubscription)&&(this._removeSubscription(),this._removeSubscription=void 0),l(e)&&(this._removeSubscription=e.definitionChanged.addEventListener(this._raiseDefinitionChanged,this)),this._definitionChanged.raiseEvent(this))};sA.prototype.getValueInReferenceFrame=function(e,t,n){if(l(this._value))return n=this._value.getValueInReferenceFrame(e,t,n),l(n)?ee.default.scaleToGeodeticSurface(n,n):void 0};sA.prototype.equals=function(e){return this===e||e instanceof sA&&this._value===e._value};sA.prototype._raiseDefinitionChanged=function(){this._definitionChanged.raiseEvent(this)};var Bg=sA;function aA(e){this._definitionChanged=new be,this._intervals=new Bs,this._intervals.changedEvent.addEventListener(aA.prototype._intervalsChanged,this),this._referenceFrame=e??Wi.FIXED}Object.defineProperties(aA.prototype,{isConstant:{get:function(){return this._intervals.isEmpty}},definitionChanged:{get:function(){return this._definitionChanged}},intervals:{get:function(){return this._intervals}},referenceFrame:{get:function(){return this._referenceFrame}}});var Jyt=new K;aA.prototype.getValue=function(e,t){return l(e)||(e=K.now(Jyt)),this.getValueInReferenceFrame(e,Wi.FIXED,t)};aA.prototype.getValueInReferenceFrame=function(e,t,n){let i=this._intervals.findDataForIntervalContainingDate(e);if(l(i))return ip.convertToReferenceFrame(e,i,this._referenceFrame,t,n)};aA.prototype.equals=function(e){return this===e||e instanceof aA&&this._intervals.equals(e._intervals,X.equals)&&this._referenceFrame===e._referenceFrame};aA.prototype._intervalsChanged=function(){this._definitionChanged.raiseEvent(this)};var cA=aA;var ICe=new $,PCe=new $,DCe=new $,Zyt=new h,RCe=new h,Qyt=new h,eAt=new h,rj=new Le,oj=new M,sj=new $;function dR(e,t,n,i,r){if(!(!l(t)||!l(n))){if(h.subtract(t,n,r),l(i.orientation))i.orientation.getValue(e,rj)&&(Le.conjugate(rj,rj),$.fromQuaternion(rj,sj),$.multiplyByVector(sj,r,r));else if(l(Bee(e,i.position,oj)))M.inverse(oj,oj),M.getRotation(oj,sj),$.multiplyByVector(sj,r,r);else return;return r}}function Bee(e,t,n){let i=t.getValue(e,Zyt);if(l(i)){let r=K.addSeconds(e,.01,new K),o=t.getValue(r,RCe);if(l(o)&&!h.equalsEpsilon(i,o,P.EPSILON16)){let s=At.computeFixedToIcrfMatrix(e,ICe),a=At.computeFixedToIcrfMatrix(r,PCe),c;!l(s)||!l(a)?(c=At.computeTemeToPseudoFixedMatrix(e,DCe),s=$.transpose(c,ICe),a=At.computeTemeToPseudoFixedMatrix(r,PCe),$.transpose(a,a)):c=$.transpose(s,DCe);let u=Qyt;h.normalize(i,u),h.normalize(o,o),$.multiplyByVector(s,u,u),$.multiplyByVector(a,o,o);let f=h.cross(u,o,eAt);if(!h.equalsEpsilon(f,h.ZERO,P.EPSILON16)){let d=h.cross(f,u,RCe);return $.multiplyByVector(c,d,d),$.multiplyByVector(c,f,f),$.multiplyByVector(c,u,u),h.normalize(d,d),h.normalize(f,f),h.normalize(u,u),l(n)||(n=new M),n[0]=d.x,n[1]=d.y,n[2]=d.z,n[3]=0,n[4]=f.x,n[5]=f.y,n[6]=f.z,n[7]=0,n[8]=u.x,n[9]=u.y,n[10]=u.z,n[11]=0,n[12]=i.x,n[13]=i.y,n[14]=i.z,n[15]=1,n}}}}var OCe=60,kCe=1,UCe=new Cn,Lee=new Cn,Fee=new Cn;function MCe(e){this.entity=e,this.polyline=void 0,this.segmentPolylines=[],this.index=void 0,this.updater=void 0}var aj=new h;function tAt(e,t,n,i,r,o,s,a,c){let u,f,d=!1;o instanceof Qr&&(u=o,f=u.position,o=Wi.FIXED,d=!0);let p=a,g,m;g=e.getValueInReferenceFrame(t,o,c[p]),d?(m=f.getValueInReferenceFrame(t,o,aj),g=dR(t,g,m,u,g),l(g)&&(c[p++]=g)):l(g)&&(c[p++]=g);let y=!l(r)||K.lessThanOrEquals(r,t)||K.greaterThanOrEquals(r,n),A=0,b=i.length,x=i[A],T=n,E=!1,v,S,I;for(;A<b;){if(!y&&K.greaterThanOrEquals(x,r)&&(g=e.getValueInReferenceFrame(r,o,c[p]),d?(m=f.getValueInReferenceFrame(r,o,aj),l(g)&&l(m)&&(g=dR(r,g,m,u,g),l(g)&&(c[p++]=g))):l(g)&&(c[p++]=g),y=!0),K.greaterThan(x,t)&&K.lessThan(x,T)&&!x.equals(r)&&(g=e.getValueInReferenceFrame(x,o,c[p]),d?(m=f.getValueInReferenceFrame(x,o,aj),l(g)&&l(m)&&(g=dR(x,g,m,u,g),l(g)&&(c[p++]=g))):l(g)&&(c[p++]=g)),A<b-1){if(s>0&&!E){let R=i[A+1],O=K.secondsDifference(R,x);E=O>s,E&&(v=Math.ceil(O/s),S=0,I=O/Math.max(v,2),v=Math.max(v-1,1))}if(E&&S<v){x=K.addSeconds(x,I,new K),S++;continue}}E=!1,A++,x=i[A]}return g=e.getValueInReferenceFrame(n,o,c[p]),d?(m=f.getValueInReferenceFrame(n,o,aj),l(g)&&l(m)&&(g=dR(n,g,m,u,g),l(g)&&(c[p++]=g))):l(g)&&(c[p++]=g),p}function nAt(e,t,n,i,r,o,s,a){let c,u=0,f=s,d=t,p=!l(i)||K.lessThanOrEquals(i,t)||K.greaterThanOrEquals(i,n);for(;K.lessThan(d,n);)!p&&K.greaterThanOrEquals(d,i)&&(p=!0,c=e.getValueInReferenceFrame(i,r,a[f]),l(c)&&(a[f]=c,f++)),c=e.getValueInReferenceFrame(d,r,a[f]),l(c)&&(a[f]=c,f++),u++,d=K.addSeconds(t,o*u,new K);return c=e.getValueInReferenceFrame(n,r,a[f]),l(c)&&(a[f]=c,f++),f}function iAt(e,t,n,i,r,o,s,a){let c,u=0,f=s,d=t,p=Math.max(o,60),g=!l(i)||K.lessThanOrEquals(i,t)||K.greaterThanOrEquals(i,n);for(;K.lessThan(d,n);)!g&&K.greaterThanOrEquals(d,i)&&(g=!0,c=e.getValueInReferenceFrame(i,r,a[f]),l(c)&&(a[f]=c,f++)),c=e.getValueInReferenceFrame(d,r,a[f]),l(c)&&(a[f]=c,f++),u++,d=K.addSeconds(t,p*u,new K);return c=e.getValueInReferenceFrame(n,r,a[f]),l(c)&&(a[f]=c,f++),f}function rAt(e,t,n,i,r,o,s,a){Fee.start=t,Fee.stop=n;let c=s,u=e.intervals;for(let f=0;f<u.length;f++){let d=u.get(f);if(!Cn.intersect(d,Fee,UCe).isEmpty){let p=d.start;d.isStartIncluded||(d.isStopIncluded?p=d.stop:p=K.addSeconds(d.start,K.secondsDifference(d.stop,d.start)/2,new K));let g=e.getValueInReferenceFrame(p,r,a[c]);l(g)&&(a[c]=g,c++)}}return c}function oAt(e,t,n,i,r,o,s,a){let c=e.getValueInReferenceFrame(t,r,a[s]);return l(c)&&(a[s++]=c),s}function sAt(e,t,n,i,r,o,s,a){Lee.start=t,Lee.stop=n;let c=s,u=e.intervals;for(let f=0;f<u.length;f++){let d=u.get(f);if(!Cn.intersect(d,Lee,UCe).isEmpty){let p=d.start,g=d.stop,m=t;K.greaterThan(p,m)&&(m=p);let y=n;K.lessThan(g,y)&&(y=g),c=zCe(d.data,m,y,i,r,o,c,a)}}return c}function zCe(e,t,n,i,r,o,s,a){for(;e instanceof oA;)e=e.resolvedProperty;if(e instanceof Cc){let c=e._property._times;s=tAt(e,t,n,c,i,r,o,s,a)}else e instanceof nj?s=nAt(e,t,n,i,r,o,s,a):e instanceof Ec?s=sAt(e,t,n,i,r,o,s,a):e instanceof cA?s=rAt(e,t,n,i,r,o,s,a):e instanceof gu||e instanceof Bg&&X.isConstant(e)?s=oAt(e,t,n,i,r,o,s,a):s=iAt(e,t,n,i,r,o,s,a);return s}function kee(e,t,n,i,r,o,s){l(s)||(s=[]);let a=zCe(e,t,n,i,r,o,0,s);return s.length=a,s}var NCe=new $,LCe=new Le,FCe=new $,fR=new Cn,cj=new Cn,Qx=new Cn;function aAt(e){let t=[];if(!l(e))return t;for(let n in e){if(n[0]!=="_"||n==="_definitionChanged"||n.endsWith("Subscription"))continue;let i=e[n];l(i)&&typeof i.getValue=="function"&&!X.isConstant(i)&&t.push(i)}return t}function BCe(e,t,n,i,r,o,s,a,c,u,f){e.sort(K.compare),e=Lr(e,K.equalsEpsilon);let d=f;for(let p=0;p<e.length-1;p++){let g=e[p],m=e[p+1];if(!K.lessThan(g,m))continue;let y=K.addSeconds(g,K.secondsDifference(m,g)/2,new K),A=kee(t,g,m,n,c,a,[]);if(A.length<2)continue;let b=o.segmentPolylines[d];l(b)||(b=s.add(),b.id=r,o.segmentPolylines[d]=b),b.show=!0,b.positions=A,b.material=So.getValue(y,u,b.material),b.width=X.getValueOrDefault(i._width,n,kCe),d++}return d}function hR(e,t){this._unusedIndexes=[],this._polylineCollection=new Fp,this._scene=e,this._referenceFrame=t,e.primitives.add(this._polylineCollection)}hR.prototype.update=function(e){let t=this._referenceFrame;if(t===Wi.INERTIAL){let n=At.computeIcrfToFixedMatrix(e,NCe);l(n)||(n=At.computeTemeToPseudoFixedMatrix(e,NCe)),M.fromRotationTranslation(n,h.ZERO,this._polylineCollection.modelMatrix)}else if(t instanceof Qr){let n=t.position.getValue(e);l(t.orientation)?l(t.orientation.getValue(e,LCe))&&($.fromQuaternion(LCe,FCe),M.fromRotationTranslation(FCe,n,this._polylineCollection.modelMatrix)):Bee(e,t.position,this._polylineCollection.modelMatrix)}};hR.prototype.updateObject=function(e,t){let n=t.entity,i=n._path,r=n._position,o,s,a=i._show,c=t.polyline,u=n.isShowing&&n.isAvailable(e)&&(!l(a)||a.getValue(e));if(u){let m=X.getValueOrUndefined(i._leadTime,e),y=X.getValueOrUndefined(i._trailTime,e),A=n._availability,b=l(A),x=l(m),T=l(y);if(u=b||x&&T,u){if(T&&(o=K.addSeconds(e,-y,new K)),x&&(s=K.addSeconds(e,m,new K)),b){let E=A.start,v=A.stop;(!T||K.greaterThan(E,o))&&(o=E),(!x||K.lessThan(v,s))&&(s=v)}u=K.lessThan(o,s)}}if(!u){l(c)&&(this._unusedIndexes.push(t.index),t.polyline=void 0,c.show=!1,t.index=void 0);for(let m=0;m<t.segmentPolylines.length;m++)t.segmentPolylines[m].show=!1;return}if(!l(c)){let m=this._unusedIndexes;if(m.length>0){let A=m.pop();c=this._polylineCollection.get(A),t.index=A}else t.index=this._polylineCollection.length,c=this._polylineCollection.add();c.id=n,t.polyline=c}let f=X.getValueOrDefault(i._resolution,e,OCe),d=kee(r,o,s,e,this._referenceFrame,f,c.positions.slice());if(d.length<2){c.show=!1;for(let m=0;m<t.segmentPolylines.length;m++)t.segmentPolylines[m].show=!1;return}c.show=!0,c.positions=d,c.material=So.getValue(e,i.material,c.material);let p=X.getValueOrUndefined(i.materialMode,e),g=i.material;if(p===Fg.PORTIONS&&!g.isConstant){l(c)&&(c.show=!1);let m=f>0?f:OCe,y=g.intervals,A=0;if(l(y)){fR.start=o,fR.stop=s,fR.isStartIncluded=!0,fR.isStopIncluded=!0;for(let b=0;b<y.length;b++){let x=y.get(b);if(!Cn.intersect(x,fR,cj))continue;let T=cj.start,E=cj.stop;if(K.greaterThanOrEquals(T,E))continue;let v=aAt(x.data),S=[K.clone(T),K.clone(E)];for(let I=0;I<v.length;I++){let R=v[I],O=R.intervals;if(l(O))for(let L=0;L<O.length;L++){let _=O.get(L);Cn.intersect(_,cj,Qx)&&(K.greaterThan(Qx.start,T)&&K.lessThan(Qx.start,E)&&S.push(K.clone(Qx.start)),K.greaterThan(Qx.stop,T)&&K.lessThan(Qx.stop,E)&&S.push(K.clone(Qx.stop)))}else if(!X.isConstant(R)){let L=K.clone(T);for(;K.lessThan(L,E);)S.push(K.clone(L)),L=K.addSeconds(L,m,new K)}}A=BCe(S,r,e,i,n,t,this._polylineCollection,m,this._referenceFrame,x.data,A)}}else{let b=[K.clone(o),K.clone(s)],x=K.addSeconds(o,m,new K);for(;K.lessThan(x,s);)b.push(K.clone(x)),x=K.addSeconds(x,m,new K);A=BCe(b,r,e,i,n,t,this._polylineCollection,m,this._referenceFrame,i.material,A)}for(let b=A;b<t.segmentPolylines.length;b++)l(t.segmentPolylines[b])&&(t.segmentPolylines[b].show=!1)}else for(let m=0;m<t.segmentPolylines.length;m++)t.segmentPolylines[m].show=!1;c.width=X.getValueOrDefault(i._width,e,kCe),c.distanceDisplayCondition=X.getValueOrUndefined(i._distanceDisplayCondition,e,c.distanceDisplayCondition)};hR.prototype.removeObject=function(e){let t=e.polyline;l(t)&&(this._unusedIndexes.push(e.index),e.polyline=void 0,t.show=!1,t.id=void 0,e.index=void 0);for(let n=0;n<e.segmentPolylines.length;n++)e.segmentPolylines[n].show=!1;e.segmentPolylines.length=0};hR.prototype.destroy=function(){return this._scene.primitives.remove(this._polylineCollection),le(this)};function zp(e,t){t.collectionChanged.addEventListener(zp.prototype._onCollectionChanged,this),this._scene=e,this._updaters={},this._entityCollection=t,this._items=new zt,this._onCollectionChanged(t,t.values,[],[])}zp.prototype.update=function(e){let t=this._updaters;for(let i in t)t.hasOwnProperty(i)&&t[i].update(e);let n=this._items.values;if(n.length===0&&l(this._updaters)&&Object.keys(this._updaters).length>0){for(let i in t)t.hasOwnProperty(i)&&t[i].destroy();this._updaters={}}for(let i=0,r=n.length;i<r;i++){let o=n[i],s=o.entity,a=s._position,c=s._path,u=o.updater,f=!1,d=Wi.FIXED,p=d.toString();if(this._scene.mode===re.SCENE3D){let m=X.getValueOrUndefined(c.relativeTo,e);l(m)?m==="FIXED"?(d=Wi.FIXED,p=d.toString()):m==="INERTIAL"?(d=Wi.INERTIAL,p=d.toString()):(f=!0,d=this._entityCollection.getById(m),p=m):(d=a.referenceFrame,p=d.toString())}let g=this._updaters[p];if(u===g&&l(g)){g.updateObject(e,o);continue}l(u)&&u.removeObject(o),!(f&&!l(d))&&(l(g)||(g=new hR(this._scene,d),g.update(e),this._updaters[p]=g),o.updater=g,l(g)&&g.updateObject(e,o))}return!0};zp.prototype.isDestroyed=function(){return!1};zp.prototype.destroy=function(){this._entityCollection.collectionChanged.removeEventListener(zp.prototype._onCollectionChanged,this);let e=this._updaters;for(let t in e)e.hasOwnProperty(t)&&e[t].destroy();return le(this)};zp.prototype._onCollectionChanged=function(e,t,n,i){let r,o,s,a=this._items;for(r=t.length-1;r>-1;r--)o=t[r],l(o._path)&&l(o._position)&&a.set(o.id,new MCe(o));for(r=i.length-1;r>-1;r--)o=i[r],l(o._path)&&l(o._position)?a.contains(o.id)||a.set(o.id,new MCe(o)):(s=a.get(o.id),l(s)&&(l(s.updater)&&s.updater.removeObject(s),a.remove(o.id)));for(r=n.length-1;r>-1;r--)o=n[r],s=a.get(o.id),l(s)&&(l(s.updater)&&s.updater.removeObject(s),a.remove(o.id))};zp._subSample=kee;zp._computeVvlhTransform=Bee;zp._transformToEntityFrame=dR;var lj=zp;var VCe=z.WHITE,jCe=z.BLACK,HCe=0,GCe=1,WCe=0,qCe=Yo.NONE,YCe=new z,cAt=new h,XCe=new z,KCe=new qt,$Ce=new qt,JCe=new Gt;function ZCe(e){this.entity=e,this.pointPrimitive=void 0,this.billboard=void 0,this.color=void 0,this.outlineColor=void 0,this.pixelSize=void 0,this.outlineWidth=void 0}function lA(e,t){t.collectionChanged.addEventListener(lA.prototype._onCollectionChanged,this),this._cluster=e,this._entityCollection=t,this._items=new zt,this._onCollectionChanged(t,t.values,[],[])}lA.prototype.update=function(e){let t=this._items.values,n=this._cluster;for(let i=0,r=t.length;i<r;i++){let o=t[i],s=o.entity,a=s._point,c=o.pointPrimitive,u=o.billboard,f=X.getValueOrDefault(a._heightReference,e,We.NONE),d=s.isShowing&&s.isAvailable(e)&&X.getValueOrDefault(a._show,e,!0),p;if(d&&(p=X.getValueOrUndefined(s._position,e,cAt),d=l(p)),!d){mR(o,s,n);continue}X.isConstant(s._position)||(n._clusterDirty=!0);let g=!1,m=!1;if(f!==We.NONE&&!l(u)?(l(c)&&(mR(o,s,n),c=void 0),u=n.getBillboard(s),u.id=s,u.image=void 0,o.billboard=u,g=!0,m=h.equals(u.position,p)&&u.heightReference===f):f===We.NONE&&!l(c)&&(l(u)&&(mR(o,s,n),u=void 0),c=n.getPoint(s),c.id=s,o.pointPrimitive=c),l(c))c.show=!0,c.position=p,c.scaleByDistance=X.getValueOrUndefined(a._scaleByDistance,e,KCe),c.translucencyByDistance=X.getValueOrUndefined(a._translucencyByDistance,e,$Ce),c.color=X.getValueOrDefault(a._color,e,VCe,YCe),c.outlineColor=X.getValueOrDefault(a._outlineColor,e,jCe,XCe),c.outlineWidth=X.getValueOrDefault(a._outlineWidth,e,HCe),c.pixelSize=X.getValueOrDefault(a._pixelSize,e,GCe),c.distanceDisplayCondition=X.getValueOrUndefined(a._distanceDisplayCondition,e,JCe),c.disableDepthTestDistance=X.getValueOrDefault(a._disableDepthTestDistance,e,WCe),c.splitDirection=X.getValueOrDefault(a._splitDirection,e,qCe);else if(l(u)){u.show=!0,u.position=p,u.scaleByDistance=X.getValueOrUndefined(a._scaleByDistance,e,KCe),u.translucencyByDistance=X.getValueOrUndefined(a._translucencyByDistance,e,$Ce),u.distanceDisplayCondition=X.getValueOrUndefined(a._distanceDisplayCondition,e,JCe),u.disableDepthTestDistance=X.getValueOrDefault(a._disableDepthTestDistance,e,WCe),u.splitDirection=X.getValueOrDefault(a._splitDirection,e,qCe),u.heightReference=f;let y=X.getValueOrDefault(a._color,e,VCe,YCe),A=X.getValueOrDefault(a._outlineColor,e,jCe,XCe),b=Math.round(X.getValueOrDefault(a._outlineWidth,e,HCe)),x=Math.max(1,Math.round(X.getValueOrDefault(a._pixelSize,e,GCe)));if(b>0?(u.scale=1,g=g||b!==o.outlineWidth||x!==o.pixelSize||!z.equals(y,o.color)||!z.equals(A,o.outlineColor)):(u.scale=x/50,x=50,g=g||b!==o.outlineWidth||!z.equals(y,o.color)||!z.equals(A,o.outlineColor)),g){o.color=z.clone(y,o.color),o.outlineColor=z.clone(A,o.outlineColor),o.pixelSize=x,o.outlineWidth=b;let T=y.alpha,E=y.toCssColorString(),v=A.toCssColorString(),S=JSON.stringify([E,x,v,b]);u.setImage(S,gS(T,E,v,b,x))}m&&u._updateClamping()}}return!0};lA.prototype.getBoundingSphere=function(e,t){let n=this._items.get(e.id);if(!l(n)||!(l(n.pointPrimitive)||l(n.billboard)))return Pt.FAILED;if(l(n.pointPrimitive))t.center=h.clone(n.pointPrimitive.position,t.center);else{let i=n.billboard;if(i._clampedToSurface)t.center=h.clone(i._clampedPosition,t.center);else{let r=this._cluster._scene,o=this._items,s=Qm(r,n,i.position,[i],()=>o.get(e.id)===n);if(s===void 0)return Pt.PENDING;s===null?t.center=h.clone(i.position,t.center):t.center=W_(i.position,s,i.heightReference,r.ellipsoid??ee.default,t.center)}}return t.radius=0,Pt.DONE};lA.prototype.isDestroyed=function(){return!1};lA.prototype.destroy=function(){this._entityCollection.collectionChanged.removeEventListener(lA.prototype._onCollectionChanged,this);let e=this._entityCollection.values;for(let t=0;t<e.length;t++)this._cluster.removePoint(e[t]);return le(this)};lA.prototype._onCollectionChanged=function(e,t,n,i){let r,o,s=this._items,a=this._cluster;for(r=t.length-1;r>-1;r--)o=t[r],l(o._point)&&l(o._position)&&s.set(o.id,new ZCe(o));for(r=i.length-1;r>-1;r--)o=i[r],l(o._point)&&l(o._position)?s.contains(o.id)||s.set(o.id,new ZCe(o)):(mR(s.get(o.id),o,a),s.remove(o.id));for(r=n.length-1;r>-1;r--)o=n[r],mR(s.get(o.id),o,a),s.remove(o.id)};function mR(e,t,n){if(l(e)){let i=e.pointPrimitive;if(l(i)){e.pointPrimitive=void 0,n.removePoint(t);return}let r=e.billboard;l(r)&&(e.billboard=void 0,n.removeBillboard(t))}}var uj=lA;var ive=[];function lAt(e,t,n,i,r){let o=ive;o.length=r;let s,a=n.red,c=n.green,u=n.blue,f=n.alpha,d=i.red,p=i.green,g=i.blue,m=i.alpha;if(z.equals(n,i)){for(s=0;s<r;s++)o[s]=z.clone(n);return o}let y=(d-a)/r,A=(p-c)/r,b=(g-u)/r,x=(m-f)/r;for(s=0;s<r;s++)o[s]=new z(a+s*y,c+s*A,u+s*b,f+s*x);return o}function pR(e){e=e??H.EMPTY_OBJECT;let t=e.positions,n=e.colors,i=e.width??1,r=e.colorsPerVertex??!1;this._positions=t,this._colors=n,this._width=i,this._colorsPerVertex=r,this._vertexFormat=Be.clone(e.vertexFormat??Be.DEFAULT),this._arcType=e.arcType??ln.GEODESIC,this._granularity=e.granularity??P.RADIANS_PER_DEGREE,this._ellipsoid=ee.clone(e.ellipsoid??ee.default),this._workerName="createPolylineGeometry";let o=1+t.length*h.packedLength;o+=l(n)?1+n.length*z.packedLength:1,this.packedLength=o+ee.packedLength+Be.packedLength+4}pR.pack=function(e,t,n){n=n??0;let i,r=e._positions,o=r.length;for(t[n++]=o,i=0;i<o;++i,n+=h.packedLength)h.pack(r[i],t,n);let s=e._colors;for(o=l(s)?s.length:0,t[n++]=o,i=0;i<o;++i,n+=z.packedLength)z.pack(s[i],t,n);return ee.pack(e._ellipsoid,t,n),n+=ee.packedLength,Be.pack(e._vertexFormat,t,n),n+=Be.packedLength,t[n++]=e._width,t[n++]=e._colorsPerVertex?1:0,t[n++]=e._arcType,t[n]=e._granularity,t};var rve=ee.clone(ee.UNIT_SPHERE),ove=new Be,eT={positions:void 0,colors:void 0,ellipsoid:rve,vertexFormat:ove,width:void 0,colorsPerVertex:void 0,arcType:void 0,granularity:void 0};pR.unpack=function(e,t,n){t=t??0;let i,r=e[t++],o=new Array(r);for(i=0;i<r;++i,t+=h.packedLength)o[i]=h.unpack(e,t);r=e[t++];let s=r>0?new Array(r):void 0;for(i=0;i<r;++i,t+=z.packedLength)s[i]=z.unpack(e,t);let a=ee.unpack(e,t,rve);t+=ee.packedLength;let c=Be.unpack(e,t,ove);t+=Be.packedLength;let u=e[t++],f=e[t++]===1,d=e[t++],p=e[t];return l(n)?(n._positions=o,n._colors=s,n._ellipsoid=ee.clone(a,n._ellipsoid),n._vertexFormat=Be.clone(c,n._vertexFormat),n._width=u,n._colorsPerVertex=f,n._arcType=d,n._granularity=p,n):(eT.positions=o,eT.colors=s,eT.width=u,eT.colorsPerVertex=f,eT.arcType=d,eT.granularity=p,new pR(eT))};var QCe=new h,eve=new h,tve=new h,nve=new h;pR.createGeometry=function(e){let t=e._width,n=e._vertexFormat,i=e._colors,r=e._colorsPerVertex,o=e._arcType,s=e._granularity,a=e._ellipsoid,c,u,f,d=[],p=Lr(e._positions,h.equalsEpsilon,!1,d);if(l(i)&&d.length>0){let N=0,F=d[0];i=i.filter(function(V,B){let j;return r?j=B===F||B===0&&F===1:j=B+1===F,j?(N++,F=d[N],!1):!0})}let g=p.length;if(g<2||t<=0)return;if(o===ln.GEODESIC||o===ln.RHUMB){let N,F;o===ln.GEODESIC?(N=P.chordLength(s,a.maximumRadius),F=ar.numberOfPoints):(N=s,F=ar.numberOfPointsRhumbLine);let V=ar.extractHeights(p,a);if(l(i)){let B=1;for(c=0;c<g-1;++c)B+=F(p[c],p[c+1],N);let j=new Array(B),k=0;for(c=0;c<g-1;++c){let G=p[c],q=p[c+1],Q=i[c],W=F(G,q,N);if(r&&c<B){let J=i[c+1],Z=lAt(G,q,Q,J,W),ae=Z.length;for(u=0;u<ae;++u)j[k++]=Z[u]}else for(u=0;u<W;++u)j[k++]=z.clone(Q)}j[k]=z.clone(i[i.length-1]),i=j,ive.length=0}o===ln.GEODESIC?p=ar.generateCartesianArc({positions:p,minDistance:N,ellipsoid:a,height:V}):p=ar.generateCartesianRhumbArc({positions:p,granularity:N,ellipsoid:a,height:V})}g=p.length;let m=g*4-4,y=new Float64Array(m*3),A=new Float64Array(m*3),b=new Float64Array(m*3),x=new Float32Array(m*2),T=n.st?new Float32Array(m*2):void 0,E=l(i)?new Uint8Array(m*4):void 0,v=0,S=0,I=0,R=0,O;for(u=0;u<g;++u){u===0?(O=QCe,h.subtract(p[0],p[1],O),h.add(p[0],O,O)):O=p[u-1],h.clone(O,tve),h.clone(p[u],eve),u===g-1?(O=QCe,h.subtract(p[g-1],p[g-2],O),h.add(p[g-1],O,O)):O=p[u+1],h.clone(O,nve);let N,F;l(E)&&(u!==0&&!r?N=i[u-1]:N=i[u],u!==g-1&&(F=i[u]));let V=u===0?2:0,B=u===g-1?2:4;for(f=V;f<B;++f){h.pack(eve,y,v),h.pack(tve,A,v),h.pack(nve,b,v),v+=3;let j=f-2<0?-1:1;if(x[S++]=2*(f%2)-1,x[S++]=j*t,n.st&&(T[I++]=u/(g-1),T[I++]=Math.max(x[S-2],0)),l(E)){let k=f<2?N:F;E[R++]=z.floatToByte(k.red),E[R++]=z.floatToByte(k.green),E[R++]=z.floatToByte(k.blue),E[R++]=z.floatToByte(k.alpha)}}}let L=new En;L.position=new Ne({componentDatatype:Y.DOUBLE,componentsPerAttribute:3,values:y}),L.prevPosition=new Ne({componentDatatype:Y.DOUBLE,componentsPerAttribute:3,values:A}),L.nextPosition=new Ne({componentDatatype:Y.DOUBLE,componentsPerAttribute:3,values:b}),L.expandAndWidth=new Ne({componentDatatype:Y.FLOAT,componentsPerAttribute:2,values:x}),n.st&&(L.st=new Ne({componentDatatype:Y.FLOAT,componentsPerAttribute:2,values:T})),l(E)&&(L.color=new Ne({componentDatatype:Y.UNSIGNED_BYTE,componentsPerAttribute:4,values:E,normalize:!0}));let _=je.createTypedArray(m,g*6-6),C=0,w=0,D=g-1;for(u=0;u<D;++u)_[w++]=C,_[w++]=C+2,_[w++]=C+1,_[w++]=C+1,_[w++]=C+2,_[w++]=C+3,C+=4;return new wt({attributes:L,indices:_,primitiveType:Oe.TRIANGLES,boundingSphere:ue.fromPoints(p),geometryType:mh.POLYLINES})};var uA=pR;var uAt=new hi(0),fj={},sve=new z,fAt=new Kt(z.WHITE),dAt=new hi(!0),hAt=new hi(Pn.DISABLED),mAt=new hi(new Gt),pAt=new hi(Qn.BOTH);function gAt(){this.vertexFormat=void 0,this.positions=void 0,this.width=void 0,this.arcType=void 0,this.granularity=void 0}function _At(){this.positions=void 0,this.width=void 0,this.arcType=void 0,this.granularity=void 0}function im(e,t){this._entity=e,this._scene=t,this._entitySubscription=e.definitionChanged.addEventListener(im.prototype._onEntityPropertyChanged,this),this._fillEnabled=!1,this._dynamic=!1,this._geometryChanged=new be,this._showProperty=void 0,this._materialProperty=void 0,this._shadowsProperty=void 0,this._distanceDisplayConditionProperty=void 0,this._classificationTypeProperty=void 0,this._depthFailMaterialProperty=void 0,this._geometryOptions=new gAt,this._groundGeometryOptions=new _At,this._id=`polyline-${e.id}`,this._clampToGround=!1,this._supportsPolylinesOnTerrain=Qr.supportsPolylinesOnTerrain(t),this._zIndex=0,this._onEntityPropertyChanged(e,"polyline",e.polyline,void 0)}Object.defineProperties(im.prototype,{id:{get:function(){return this._id}},entity:{get:function(){return this._entity}},fillEnabled:{get:function(){return this._fillEnabled}},hasConstantFill:{get:function(){return!this._fillEnabled||!l(this._entity.availability)&&X.isConstant(this._showProperty)}},fillMaterialProperty:{get:function(){return this._materialProperty}},depthFailMaterialProperty:{get:function(){return this._depthFailMaterialProperty}},outlineEnabled:{value:!1},hasConstantOutline:{value:!0},outlineColorProperty:{value:void 0},shadowsProperty:{get:function(){return this._shadowsProperty}},distanceDisplayConditionProperty:{get:function(){return this._distanceDisplayConditionProperty}},classificationTypeProperty:{get:function(){return this._classificationTypeProperty}},isDynamic:{get:function(){return this._dynamic}},isClosed:{value:!1},geometryChanged:{get:function(){return this._geometryChanged}},arcType:{get:function(){return this._arcType}},clampToGround:{get:function(){return this._clampToGround&&this._supportsPolylinesOnTerrain}},zIndex:{get:function(){return this._zIndex}}});im.prototype.isOutlineVisible=function(e){return!1};im.prototype.isFilled=function(e){let t=this._entity;return(this._fillEnabled&&t.isAvailable(e)&&this._showProperty.getValue(e))??!1};im.prototype.createFillGeometryInstance=function(e){let t=this._entity,n=t.isAvailable(e),i=new Dn(n&&t.isShowing&&this._showProperty.getValue(e)),r=this._distanceDisplayConditionProperty.getValue(e),o=ti.fromDistanceDisplayCondition(r),s={show:i,distanceDisplayCondition:o},a;return this._materialProperty instanceof Kt&&(l(this._materialProperty.color)&&(this._materialProperty.color.isConstant||n)&&(a=this._materialProperty.color.getValue(e,sve)),l(a)||(a=z.WHITE),s.color=Jt.fromColor(a)),this.clampToGround?new Bt({id:t,geometry:new JE(this._groundGeometryOptions),attributes:s}):(l(this._depthFailMaterialProperty)&&this._depthFailMaterialProperty instanceof Kt&&(l(this._depthFailMaterialProperty.color)&&(this._depthFailMaterialProperty.color.isConstant||n)&&(a=this._depthFailMaterialProperty.color.getValue(e,sve)),l(a)||(a=z.WHITE),s.depthFailColor=Jt.fromColor(a)),new Bt({id:t,geometry:new uA(this._geometryOptions),attributes:s}))};im.prototype.createOutlineGeometryInstance=function(e){};im.prototype.isDestroyed=function(){return!1};im.prototype.destroy=function(){this._entitySubscription(),le(this)};im.prototype._onEntityPropertyChanged=function(e,t,n,i){if(!(t==="availability"||t==="polyline"))return;let r=this._entity.polyline;if(!l(r)){this._fillEnabled&&(this._fillEnabled=!1,this._geometryChanged.raiseEvent(this));return}let o=r.positions,s=r.show;if(l(s)&&s.isConstant&&!s.getValue(it.MINIMUM_VALUE)||!l(o)){this._fillEnabled&&(this._fillEnabled=!1,this._geometryChanged.raiseEvent(this));return}let a=r.zIndex,c=r.material??fAt,u=c instanceof Kt;this._materialProperty=c,this._depthFailMaterialProperty=r.depthFailMaterial,this._showProperty=s??dAt,this._shadowsProperty=r.shadows??hAt,this._distanceDisplayConditionProperty=r.distanceDisplayCondition??mAt,this._classificationTypeProperty=r.classificationType??pAt,this._fillEnabled=!0,this._zIndex=a??uAt;let f=r.width,d=r.arcType,p=r.clampToGround,g=r.granularity;if(!o.isConstant||!X.isConstant(f)||!X.isConstant(d)||!X.isConstant(g)||!X.isConstant(p)||!X.isConstant(a))this._dynamic||(this._dynamic=!0,this._geometryChanged.raiseEvent(this));else{let m=this._geometryOptions,y=o.getValue(it.MINIMUM_VALUE,m.positions);if(!l(y)||y.length<2){this._fillEnabled&&(this._fillEnabled=!1,this._geometryChanged.raiseEvent(this));return}let A;u&&(!l(this._depthFailMaterialProperty)||this._depthFailMaterialProperty instanceof Kt)?A=qs.VERTEX_FORMAT:A=yc.VERTEX_FORMAT,m.vertexFormat=A,m.positions=y,m.width=l(f)?f.getValue(it.MINIMUM_VALUE):void 0,m.arcType=l(d)?d.getValue(it.MINIMUM_VALUE):void 0,m.granularity=l(g)?g.getValue(it.MINIMUM_VALUE):void 0;let b=this._groundGeometryOptions;b.positions=y,b.width=m.width,b.arcType=m.arcType,b.granularity=m.granularity,this._clampToGround=l(p)?p.getValue(it.MINIMUM_VALUE):!1,!this._clampToGround&&l(a)&&yt("Entity polylines must have clampToGround: true when using zIndex. zIndex will be ignored."),this._dynamic=!1,this._geometryChanged.raiseEvent(this)}};im.prototype.createDynamicUpdater=function(e,t){return new gR(e,t,this)};var FS={positions:void 0,granularity:void 0,height:void 0,ellipsoid:void 0};function gR(e,t,n){this._line=void 0,this._primitives=e,this._groundPrimitives=t,this._groundPolylinePrimitive=void 0,this._material=void 0,this._geometryUpdater=n,this._positions=[]}function ave(e){if(l(e._line))return e._line;let t=e._primitives,n=e._geometryUpdater._scene.id+t._guid,i=fj[n];!l(i)||i.isDestroyed()?(i=new Fp,fj[n]=i,t.add(i)):t.contains(i)||t.add(i);let r=i.add();return r.id=e._geometryUpdater._entity,e._line=r,r}gR.prototype.update=function(e){let t=this._geometryUpdater,n=t._entity,i=n.polyline,r=i.positions,o=X.getValueOrUndefined(r,e,this._positions);t._clampToGround=X.getValueOrDefault(i._clampToGround,e,!1),t._groundGeometryOptions.positions=o,t._groundGeometryOptions.width=X.getValueOrDefault(i._width,e,1),t._groundGeometryOptions.arcType=X.getValueOrDefault(i._arcType,e,ln.GEODESIC),t._groundGeometryOptions.granularity=X.getValueOrDefault(i._granularity,e,9999);let s=this._groundPrimitives;if(l(this._groundPolylinePrimitive)&&(s.remove(this._groundPolylinePrimitive),this._groundPolylinePrimitive=void 0),t.clampToGround){if(!n.isShowing||!n.isAvailable(e)||!X.getValueOrDefault(i._show,e,!0)||!l(o)||o.length<2)return;let d=t.fillMaterialProperty,p;if(d instanceof Kt)p=new qs;else{let g=So.getValue(e,d,this._material);p=new yc({material:g,translucent:g.isTranslucent()}),this._material=g}this._groundPolylinePrimitive=s.add(new $m({geometryInstances:t.createFillGeometryInstance(e),appearance:p,classificationType:t.classificationTypeProperty.getValue(e),asynchronous:!1}),X.getValueOrUndefined(t.zIndex,e)),l(this._line)&&(this._line.show=!1);return}let a=ave(this);if(!n.isShowing||!n.isAvailable(e)||!X.getValueOrDefault(i._show,e,!0)){a.show=!1;return}if(!l(o)||o.length<2){a.show=!1;return}let c=ln.GEODESIC;c=X.getValueOrDefault(i._arcType,e,c);let u=t._scene.globe,f=t._scene.ellipsoid;c!==ln.NONE&&l(u)&&(FS.ellipsoid=f,FS.positions=o,FS.granularity=X.getValueOrUndefined(i._granularity,e),FS.height=ar.extractHeights(o,f),c===ln.GEODESIC?o=ar.generateCartesianArc(FS):o=ar.generateCartesianRhumbArc(FS)),a.show=!0,a.positions=o.slice(),a.material=So.getValue(e,t.fillMaterialProperty,a.material),a.width=X.getValueOrDefault(i._width,e,1),a.distanceDisplayCondition=X.getValueOrUndefined(i._distanceDisplayCondition,e,a.distanceDisplayCondition)};gR.prototype.getBoundingSphere=function(e){if(this._geometryUpdater.clampToGround){let t=this._groundPolylinePrimitive;if(l(t)&&t.show&&t.ready){let n=t.getGeometryInstanceAttributes(this._geometryUpdater._entity);if(l(n)&&l(n.boundingSphere))return ue.clone(n.boundingSphere,e),Pt.DONE}return l(t)&&!t.ready?Pt.PENDING:Pt.DONE}else{let t=ave(this);if(t.show&&t.positions.length>0)return ue.fromPoints(t.positions,e),Pt.DONE}return Pt.FAILED};gR.prototype.isDestroyed=function(){return!1};gR.prototype.destroy=function(){let t=this._geometryUpdater._scene.id+this._primitives._guid,n=fj[t];l(n)&&(n.remove(this._line),n.length===0&&(this._primitives.removeAndDestroy(n),delete fj[t])),l(this._groundPolylinePrimitive)&&this._groundPrimitives.remove(this._groundPolylinePrimitive),le(this)};var dj=im;var yAt=new z,AAt=new Gt,bAt=new Gt;function rm(e,t,n,i,r){let o;n instanceof Kt?o=qs:o=yc,this.orderedGroundPrimitives=e,this.classificationType=t,this.appearanceType=o,this.materialProperty=n,this.updaters=new zt,this.createPrimitive=!0,this.primitive=void 0,this.oldPrimitive=void 0,this.geometry=new zt,this.material=void 0,this.updatersWithAttributes=new zt,this.attributes=new zt,this.invalidated=!1,this.removeMaterialSubscription=n.definitionChanged.addEventListener(rm.prototype.onMaterialChanged,this),this.subscriptions=new zt,this.showsUpdated=new zt,this.zIndex=i,this._asynchronous=r}rm.prototype.onMaterialChanged=function(){this.invalidated=!0};rm.prototype.isMaterial=function(e){let t=this.materialProperty,n=e.fillMaterialProperty;return n===t||n instanceof Kt&&t instanceof Kt?!0:l(t)&&t.equals(n)};rm.prototype.add=function(e,t,n){let i=t.id;if(this.updaters.set(i,t),this.geometry.set(i,n),!t.hasConstantFill||!t.fillMaterialProperty.isConstant||!X.isConstant(t.distanceDisplayConditionProperty))this.updatersWithAttributes.set(i,t);else{let r=this;this.subscriptions.set(i,t.entity.definitionChanged.addEventListener(function(o,s,a,c){s==="isShowing"&&r.showsUpdated.set(t.id,t)}))}this.createPrimitive=!0};rm.prototype.remove=function(e){let t=e.id;if(this.createPrimitive=this.geometry.remove(t)||this.createPrimitive,this.updaters.remove(t)){this.updatersWithAttributes.remove(t);let n=this.subscriptions.get(t);return l(n)&&(n(),this.subscriptions.remove(t),this.showsUpdated.remove(t)),!0}return!1};rm.prototype.update=function(e){let t=!0,n=this.primitive,i=this.orderedGroundPrimitives,r=this.geometry.values,o;if(this.createPrimitive){if(r.length>0){l(n)&&(l(this.oldPrimitive)?i.remove(n):this.oldPrimitive=n);let a=this.appearanceType;n=new $m({show:!1,asynchronous:this._asynchronous,geometryInstances:r.slice(),appearance:new a,classificationType:this.classificationType}),this.appearanceType===yc&&(this.material=So.getValue(e,this.materialProperty,this.material),n.appearance.material=this.material),i.add(n,this.zIndex),t=!1}else{l(n)&&(i.remove(n),n=void 0);let a=this.oldPrimitive;l(a)&&(i.remove(a),this.oldPrimitive=void 0)}this.attributes.removeAll(),this.primitive=n,this.createPrimitive=!1}else if(l(n)&&n.ready){n.show=!0,l(this.oldPrimitive)&&(i.remove(this.oldPrimitive),this.oldPrimitive=void 0),this.appearanceType===yc&&(this.material=So.getValue(e,this.materialProperty,this.material),this.primitive.appearance.material=this.material);let s=this.updatersWithAttributes.values,a=s.length;for(o=0;o<a;o++){let c=s[o],u=c.entity,f=this.geometry.get(c.id),d=this.attributes.get(f.id.id);if(l(d)||(d=n.getGeometryInstanceAttributes(f.id),this.attributes.set(f.id.id,d)),!c.fillMaterialProperty.isConstant){let y=c.fillMaterialProperty.color,A=X.getValueOrDefault(y,e,z.WHITE,yAt);z.equals(d._lastColor,A)||(d._lastColor=z.clone(A,d._lastColor),d.color=Jt.toValue(A,d.color))}let p=u.isShowing&&(c.hasConstantFill||c.isFilled(e)),g=d.show[0]===1;p!==g&&(d.show=Dn.toValue(p,d.show));let m=c.distanceDisplayConditionProperty;if(!X.isConstant(m)){let y=X.getValueOrDefault(m,e,bAt,AAt);Gt.equals(y,d._lastDistanceDisplayCondition)||(d._lastDistanceDisplayCondition=Gt.clone(y,d._lastDistanceDisplayCondition),d.distanceDisplayCondition=ti.toValue(y,d.distanceDisplayCondition))}}this.updateShows(n)}else l(n)&&!n.ready&&(t=!1);return t};rm.prototype.updateShows=function(e){let t=this.showsUpdated.values,n=t.length;for(let i=0;i<n;i++){let r=t[i],o=r.entity,s=this.geometry.get(r.id),a=this.attributes.get(s.id.id);l(a)||(a=e.getGeometryInstanceAttributes(s.id),this.attributes.set(s.id.id,a));let c=o.isShowing,u=a.show[0]===1;c!==u&&(a.show=Dn.toValue(c,a.show),s.attributes.show.value[0]=a.show[0])}this.showsUpdated.removeAll()};rm.prototype.contains=function(e){return this.updaters.contains(e.id)};rm.prototype.getBoundingSphere=function(e,t){let n=this.primitive;if(!n.ready)return Pt.PENDING;let i=n.getGeometryInstanceAttributes(e.entity);return!l(i)||!l(i.boundingSphere)||l(i.show)&&i.show[0]===0?Pt.FAILED:(i.boundingSphere.clone(t),Pt.DONE)};rm.prototype.destroy=function(){let e=this.primitive,t=this.orderedGroundPrimitives;l(e)&&t.remove(e);let n=this.oldPrimitive;l(n)&&t.remove(n),this.removeMaterialSubscription()};function BS(e,t,n){this._items=[],this._orderedGroundPrimitives=e,this._classificationType=t,this._asynchronous=n??!0}BS.prototype.add=function(e,t){let n=this._items,i=n.length,r=t.createFillGeometryInstance(e),o=X.getValueOrDefault(t.zIndex,0);for(let a=0;a<i;++a){let c=n[a];if(c.isMaterial(t)&&c.zIndex===o){c.add(e,t,r);return}}let s=new rm(this._orderedGroundPrimitives,this._classificationType,t.fillMaterialProperty,o,this._asynchronous);s.add(e,t,r),n.push(s)};BS.prototype.remove=function(e){let t=this._items,n=t.length;for(let i=n-1;i>=0;i--){let r=t[i];if(r.remove(e)){r.updaters.length===0&&(t.splice(i,1),r.destroy());break}}};BS.prototype.update=function(e){let t,n=this._items,i=n.length;for(t=i-1;t>=0;t--){let o=n[t];if(o.invalidated){n.splice(t,1);let s=o.updaters.values,a=s.length;for(let c=0;c<a;c++)this.add(e,s[c]);o.destroy()}}let r=!0;for(t=0;t<n.length;t++)r=n[t].update(e)&&r;return r};BS.prototype.getBoundingSphere=function(e,t){let n=this._items,i=n.length;for(let r=0;r<i;r++){let o=n[r];if(o.contains(e))return o.getBoundingSphere(e,t)}return Pt.FAILED};BS.prototype.removeAllPrimitives=function(){let e=this._items,t=e.length;for(let n=0;n<t;n++)e[n].destroy();this._items.length=0};var hj=BS;var xAt=[];function cve(e,t){let n=e._batches,i=n.length;for(let r=0;r<i;r++)n[r].remove(t)}function lve(e,t,n){if(n.isDynamic){e._dynamicBatch.add(t,n);return}if(n.clampToGround&&n.fillEnabled){let s=n.classificationTypeProperty.getValue(t);e._groundBatches[s].add(t,n);return}let i;n.fillEnabled&&(i=n.shadowsProperty.getValue(t));let r=0;l(n.depthFailMaterialProperty)&&(r=n.depthFailMaterialProperty instanceof Kt?1:2);let o;l(i)&&(o=i+r*Pn.NUMBER_OF_SHADOW_MODES),n.fillEnabled&&(n.fillMaterialProperty instanceof Kt?e._colorBatches[o].add(t,n):e._materialBatches[o].add(t,n))}function Vp(e,t,n,i){i=i??e.groundPrimitives,n=n??e.primitives,this._scene=e,this._primitives=n,this._entityCollection=void 0,this._addedObjects=new zt,this._removedObjects=new zt,this._changedObjects=new zt;let r,o=Pn.NUMBER_OF_SHADOW_MODES;for(this._colorBatches=new Array(o*3),this._materialBatches=new Array(o*3),r=0;r<o;++r)this._colorBatches[r]=new Mh(n,qs,void 0,!1,r),this._materialBatches[r]=new Lh(n,yc,void 0,!1,r),this._colorBatches[r+o]=new Mh(n,qs,qs,!1,r),this._materialBatches[r+o]=new Lh(n,yc,qs,!1,r),this._colorBatches[r+o*2]=new Mh(n,qs,yc,!1,r),this._materialBatches[r+o*2]=new Lh(n,yc,yc,!1,r);this._dynamicBatch=new AC(n,i);let s=Qn.NUMBER_OF_CLASSIFICATION_TYPES;for(this._groundBatches=new Array(s),r=0;r<s;++r)this._groundBatches[r]=new hj(i,r);this._batches=this._colorBatches.concat(this._materialBatches,this._dynamicBatch,this._groundBatches),this._subscriptions=new zt,this._updaters=new zt,this._entityCollection=t,t.collectionChanged.addEventListener(Vp.prototype._onCollectionChanged,this),this._onCollectionChanged(t,t.values,xAt)}Vp.prototype.update=function(e){let t=this._addedObjects,n=t.values,i=this._removedObjects,r=i.values,o=this._changedObjects,s=o.values,a,c,u,f;for(a=s.length-1;a>-1;a--)c=s[a],u=c.id,f=this._updaters.get(u),f.entity===c?(cve(this,f),lve(this,e,f)):(r.push(c),n.push(c));for(a=r.length-1;a>-1;a--)c=r[a],u=c.id,f=this._updaters.get(u),cve(this,f),f.destroy(),this._updaters.remove(u),this._subscriptions.get(u)(),this._subscriptions.remove(u);for(a=n.length-1;a>-1;a--)c=n[a],u=c.id,f=new dj(c,this._scene),this._updaters.set(u,f),lve(this,e,f),this._subscriptions.set(u,f.geometryChanged.addEventListener(Vp._onGeometryChanged,this));t.removeAll(),i.removeAll(),o.removeAll();let d=!0,p=this._batches,g=p.length;for(a=0;a<g;a++)d=p[a].update(e)&&d;return d};var TAt=[],EAt=new ue;Vp.prototype.getBoundingSphere=function(e,t){let n=TAt,i=EAt,r=0,o,s=this._batches,a=s.length,c=this._updaters.get(e.id);for(let u=0;u<a;u++){if(o=s[u].getBoundingSphere(c,i),o===Pt.PENDING)return Pt.PENDING;o===Pt.DONE&&(n[r]=ue.clone(i,n[r]),r++)}return r===0?Pt.FAILED:(n.length=r,ue.fromBoundingSpheres(n,t),Pt.DONE)};Vp.prototype.isDestroyed=function(){return!1};Vp.prototype.destroy=function(){this._entityCollection.collectionChanged.removeEventListener(Vp.prototype._onCollectionChanged,this),this._addedObjects.removeAll(),this._removedObjects.removeAll();let e,t=this._batches,n=t.length;for(e=0;e<n;e++)t[e].removeAllPrimitives();let i=this._subscriptions.values;for(n=i.length,e=0;e<n;e++)i[e]();return this._subscriptions.removeAll(),le(this)};Vp._onGeometryChanged=function(e){let t=this._removedObjects,n=this._changedObjects,i=e.entity,r=i.id;!l(t.get(r))&&!l(n.get(r))&&n.set(r,i)};Vp.prototype._onCollectionChanged=function(e,t,n){let i=this._addedObjects,r=this._removedObjects,o=this._changedObjects,s,a,c;for(s=n.length-1;s>-1;s--)c=n[s],a=c.id,i.remove(a)||(r.set(a,c),o.remove(a));for(s=t.length-1;s>-1;s--)c=t[s],a=c.id,r.remove(a)?o.set(a,c):i.set(a,c)};var mj=Vp;function ku(e){pu.initializeTerrainHeights(),$m.initializeTerrainHeights();let t=e.scene,n=e.dataSourceCollection;this._eventHelper=new Wo,this._eventHelper.add(n.dataSourceAdded,this._onDataSourceAdded,this),this._eventHelper.add(n.dataSourceRemoved,this._onDataSourceRemoved,this),this._eventHelper.add(n.dataSourceMoved,this._onDataSourceMoved,this),this._eventHelper.add(t.postRender,this._postRender,this),this._dataSourceCollection=n,this._scene=t,this._visualizersCallback=e.visualizersCallback??ku.defaultVisualizersCallback;let i=!1,r=new Rl,o=new Rl;n.length>0&&(t.primitives.add(r),t.groundPrimitives.add(o),i=!0),this._primitives=r,this._groundPrimitives=o;for(let u=0,f=n.length;u<f;u++)this._onDataSourceAdded(n,n.get(u));let s=new n3;this._onDataSourceAdded(void 0,s),this._defaultDataSource=s;let a,c;if(!i){let u=this,f=function(){t.primitives.add(r),t.groundPrimitives.add(o),a(),c(),u._removeDefaultDataSourceListener=void 0,u._removeDataSourceCollectionListener=void 0};a=s.entities.collectionChanged.addEventListener(f),c=n.dataSourceAdded.addEventListener(f)}this._removeDefaultDataSourceListener=a,this._removeDataSourceCollectionListener=c,this._ready=!1}var kS=[];ku.registerVisualizer=function(e){kS.includes(e)||kS.push(e)};ku.unregisterVisualizer=function(e){if(kS.includes(e)){let t=kS.indexOf(e);kS.splice(t,1)}};ku.defaultVisualizersCallback=function(e,t,n){let i=n.entities;return[new qk(t,i),new fU(e,i,n._primitives,n._groundPrimitives),new dU(t,i),new J4(e,i),new tj(e,i),new uj(t,i),new lj(e,i),new mj(e,i,n._primitives,n._groundPrimitives),...kS.map(r=>new r(e,i))]};Object.defineProperties(ku.prototype,{scene:{get:function(){return this._scene}},dataSources:{get:function(){return this._dataSourceCollection}},defaultDataSource:{get:function(){return this._defaultDataSource}},ready:{get:function(){return this._ready}}});ku.prototype.isDestroyed=function(){return!1};ku.prototype.destroy=function(){this._eventHelper.removeAll();let e=this._dataSourceCollection;for(let t=0,n=e.length;t<n;++t)this._onDataSourceRemoved(this._dataSourceCollection,e.get(t));return this._onDataSourceRemoved(void 0,this._defaultDataSource),l(this._removeDefaultDataSourceListener)?(this._removeDefaultDataSourceListener(),this._removeDataSourceCollectionListener()):(this._scene.primitives.remove(this._primitives),this._scene.groundPrimitives.remove(this._groundPrimitives)),le(this)};ku.prototype.update=function(e){if(!Ni.initialized)return this._ready=!1,!1;let t=!0,n,i,r,o,s=this._dataSourceCollection,a=s.length;for(n=0;n<a;n++){let c=s.get(n);for(l(c.update)&&(t=c.update(e)&&t),r=c._visualizers,o=r.length,i=0;i<o;i++)t=r[i].update(e)&&t}for(r=this._defaultDataSource._visualizers,o=r.length,i=0;i<o;i++)t=r[i].update(e)&&t;return!this._ready&&t&&this._scene.requestRender(),this._ready=this._ready||t,t};ku.prototype._postRender=function(){let e=this._scene.frameState,t=this._dataSourceCollection,n=t.length;for(let i=0;i<n;i++){let r=t.get(i),o=r.credit;l(o)&&e.creditDisplay.addCreditToNextFrame(o);let s=r._resourceCredits;if(l(s)){let a=s.length;for(let c=0;c<a;c++)e.creditDisplay.addCreditToNextFrame(s[c])}}};var CAt=[],vAt=new ue;ku.prototype.getBoundingSphere=function(e,t,n){if(!this._ready)return Pt.PENDING;let i,r,o=this._defaultDataSource;if(!o.entities.contains(e)){o=void 0;let p=this._dataSourceCollection;for(r=p.length,i=0;i<r;i++){let g=p.get(i);if(g.entities.contains(e)){o=g;break}}}if(!l(o))return Pt.FAILED;let s=CAt,a=vAt,c=0,u,f=o._visualizers,d=f.length;for(i=0;i<d;i++){let p=f[i];if(l(p.getBoundingSphere)){if(u=f[i].getBoundingSphere(e,a),!t&&u===Pt.PENDING)return Pt.PENDING;u===Pt.DONE&&(s[c]=ue.clone(a,s[c]),c++)}}return c===0?Pt.FAILED:(s.length=c,ue.fromBoundingSpheres(s,n),Pt.DONE)};ku.prototype._onDataSourceAdded=function(e,t){let n=this._scene,i=this._primitives,r=this._groundPrimitives,o=i.add(new Rl),s=r.add(new Wk);t._primitives=o,t._groundPrimitives=s;let a=t.clustering;a._initialize(n),o.add(a),t._visualizers=this._visualizersCallback(n,a,t)};ku.prototype._onDataSourceRemoved=function(e,t){let n=this._primitives,i=this._groundPrimitives,r=t._primitives,o=t._groundPrimitives,s=t.clustering;r.remove(s);let a=t._visualizers,c=a.length;for(let u=0;u<c;u++)a[u].destroy();n.remove(r),i.remove(o),t._visualizers=void 0};ku.prototype._onDataSourceMoved=function(e,t,n){let i=this._primitives,r=this._groundPrimitives,o=e._primitives,s=e._groundPrimitives;t===n+1?(i.raise(o),r.raise(s)):t===n-1?(i.lower(o),r.lower(s)):t===0?(i.lowerToBottom(o),r.lowerToBottom(s),i.raise(o),r.raise(s)):(i.raiseToTop(o),r.raiseToTop(s))};var pj=ku;function US(e,t){this._position=void 0,this._subscription=void 0,this._definitionChanged=new be,this._normalize=t??!0,this.position=e}Object.defineProperties(US.prototype,{isConstant:{get:function(){return X.isConstant(this._position)}},definitionChanged:{get:function(){return this._definitionChanged}},position:{get:function(){return this._position},set:function(e){let t=this._position;t!==e&&(l(t)&&this._subscription(),this._position=e,l(e)&&(this._subscription=e._definitionChanged.addEventListener(function(){this._definitionChanged.raiseEvent(this)},this)),this._definitionChanged.raiseEvent(this))}},normalize:{get:function(){return this._normalize},set:function(e){this._normalize!==e&&(this._normalize=e,this._definitionChanged.raiseEvent(this))}}});var SAt=new h,uve=new h,fve=new K,wAt=new K,Uee=1/60;US.prototype.getValue=function(e,t){return this._getValue(e,t)};US.prototype._getValue=function(e,t,n){l(e)||(e=K.now(wAt)),l(t)||(t=new h);let i=this._position;if(X.isConstant(i))return this._normalize?void 0:h.clone(h.ZERO,t);let r=i.getValue(e,SAt),o=i.getValue(K.addSeconds(e,Uee,fve),uve);if(!l(r)||!l(o)&&(o=r,r=i.getValue(K.addSeconds(e,-Uee,fve),uve),!l(r)))return;if(h.equals(r,o))return this._normalize?void 0:h.clone(h.ZERO,t);l(n)&&r.clone(n);let s=h.subtract(o,r,t);return this._normalize?h.normalize(s,t):h.divideByScalar(s,Uee,t)};US.prototype.equals=function(e){return this===e||e instanceof US&&X.equals(this._position,e._position)};var fA=US;var dve=new $,hve=new $,mve=new $,IAt=new M,gj=new h,pve=new h,zee=new h,Vee=new h,gve=new h,_ve=new h,PAt=new Le,DAt=new h,RAt=new $,zS=new K,OAt=1.25;function MAt(e,t,n,i,r,o,s,a,c,u){let f=e.scene.mode,d=r.getValue(c,e._lastCartesian);if(l(d)){let p=!1,g=!1,m,y,A;if(f===re.SCENE3D){K.addSeconds(c,.001,zS);let I=r.getValue(zS,gj);if(l(I)||(K.addSeconds(c,-.001,zS),I=r.getValue(zS,gj),g=!0),l(I)){let R=At.computeFixedToIcrfMatrix(c,dve),O=At.computeFixedToIcrfMatrix(zS,hve),L;!l(R)||!l(O)?(L=At.computeTemeToPseudoFixedMatrix(c,mve),R=$.transpose(L,dve),O=At.computeTemeToPseudoFixedMatrix(zS,hve),$.transpose(O,O)):L=$.transpose(R,mve);let _=$.multiplyByVector(R,d,gve),C=$.multiplyByVector(O,I,_ve);h.subtract(_,C,Vee);let w=h.magnitude(Vee)*1e3,D=P.GRAVITATIONALPARAMETER,N=-D/(w*w-2*D/h.magnitude(_));N<0||N>OAt*u.maximumRadius?(m=pve,h.normalize(d,m),h.negate(m,m),A=h.clone(h.UNIT_Z,zee),y=h.cross(A,m,gj),h.magnitude(y)>P.EPSILON7&&(h.normalize(m,m),h.normalize(y,y),A=h.cross(m,y,zee),h.normalize(A,A),p=!0)):h.equalsEpsilon(d,I,P.EPSILON7)||(A=pve,h.normalize(_,A),h.normalize(C,C),y=h.cross(A,C,zee),g&&(y=h.multiplyByScalar(y,-1,y)),h.equalsEpsilon(y,h.ZERO,P.EPSILON7)||(m=h.cross(y,A,gj),$.multiplyByVector(L,m,m),$.multiplyByVector(L,y,y),$.multiplyByVector(L,A,A),h.normalize(m,m),h.normalize(y,y),h.normalize(A,A),p=!0))}}l(e.boundingSphere)&&(d=e.boundingSphere.center);let b,x,T;i&&(b=h.clone(t.position,Vee),x=h.clone(t.direction,gve),T=h.clone(t.up,_ve));let E=IAt,v;l(s)&&(v=s.getValue(c,PAt));let S=o.getValue(c,DAt);if(a===K_.INERTIAL&&l(v))M.fromTranslationQuaternionRotationScale(d,v,h.ONE,E);else if(a===K_.VELOCITY&&l(S)){let I=At.rotationMatrixFromPositionVelocity(d,S,u,RAt);M.fromRotationTranslation(I,d,E)}else a===K_.ENU||!p?At.eastNorthUpToFixedFrame(d,u,E):(E[0]=m.x,E[1]=m.y,E[2]=m.z,E[3]=0,E[4]=y.x,E[5]=y.y,E[6]=y.z,E[7]=0,E[8]=A.x,E[9]=A.y,E[10]=A.z,E[11]=0,E[12]=d.x,E[13]=d.y,E[14]=d.z,E[15]=0);t._setTransform(E),i&&(h.clone(b,t.position),h.clone(x,t.direction),h.clone(T,t.up),h.cross(x,T,t.right))}if(n){let p=f===re.SCENE2D||h.equals(e._offset3D,h.ZERO)?void 0:e._offset3D;t.lookAtTransform(t.transform,p)}}function _R(e,t,n){this.entity=e,this.scene=t,this.ellipsoid=n??ee.default,this.boundingSphere=void 0,this._lastEntity=void 0,this._mode=void 0,this._lastCartesian=new h,this._defaultOffset3D=void 0,this._velocityProperty=new fA(e.position,!0),this._offset3D=new h}Object.defineProperties(_R,{defaultOffset3D:{get:function(){return this._defaultOffset3D},set:function(e){this._defaultOffset3D=h.clone(e,new h)}}});_R.defaultOffset3D=new h(-14e3,3500,3500);var _j=new xh,NAt=new h;_R.prototype.update=function(e,t){let n=this.scene,i=this.ellipsoid,r=n.mode;if(r===re.MORPHING)return;let o=this.entity,s=o.trackingReferenceFrame,a=o.position;if(!l(a))return;let c=this._velocityProperty,u=o.orientation,f=o!==this._lastEntity,d=r!==this._mode,p=n.camera,g=f||d,m=!0;if(f){let y=o.viewFrom,A=l(y);if(!A&&l(t)){_j.pitch=-P.PI_OVER_FOUR,_j.range=0;let b=a.getValue(e,NAt);if(l(b)){let x=2-1/Math.max(1,h.magnitude(b)/i.maximumRadius);_j.pitch*=x}p.viewBoundingSphere(t,_j),this.boundingSphere=t,g=!1,m=!1}else(!A||!l(y.getValue(e,this._offset3D)))&&h.clone(_R._defaultOffset3D,this._offset3D)}else!d&&this._mode!==re.SCENE2D&&h.clone(p.position,this._offset3D);this._lastEntity=o,this._mode=r,MAt(this,p,g,m,a,c,u,s,e,i)};var yj=_R;function LAt(e){return typeof e=="string"&&(e=document.getElementById(e)),e}var kn=LAt;async function FAt(e,t,n,i){return l(i)||(i=!1),UAt(e,t,n,i)}function BAt(e,t,n){let i=e[0],r=i.terrainProvider.requestTileGeometry(i.x,i.y,i.level);if(!r)return!1;let o;return n?o=r.then(Ave(i)):o=r.then(Ave(i)).catch(zAt(i)),e.shift(),t.push(o),!0}function kAt(e){return new Promise(function(t){setTimeout(t,e)})}function jee(e,t,n){return e.length?BAt(e,t,n)?jee(e,t,n):kAt(100).then(()=>jee(e,t,n)):Promise.resolve()}function UAt(e,t,n,i){let r=e.tilingScheme,o,s=[],a={};for(o=0;o<n.length;++o){let u=r.positionToTileXY(n[o],t);if(!l(u))continue;let f=u.toString();if(!a.hasOwnProperty(f)){let d={x:u.x,y:u.y,level:t,tilingScheme:r,terrainProvider:e,positions:[]};a[f]=d,s.push(d)}a[f].positions.push(n[o])}let c=[];return jee(s,c,i).then(function(){return Promise.all(c).then(function(){return n})})}function yve(e,t,n){let i=t.interpolateHeight(n,e.longitude,e.latitude);return i===void 0?!1:(e.height=i,!0)}function Ave(e){let t=e.positions,n=e.tilingScheme.tileXYToRectangle(e.x,e.y,e.level);return function(i){let r=!1;for(let o=0;o<t.length;++o){let s=t[o];if(!yve(s,i,n)){r=!0;break}}return r?i.createMesh({tilingScheme:e.tilingScheme,x:e.x,y:e.y,level:e.level,throttle:!1}).then(function(){for(let o=0;o<t.length;++o){let s=t[o];yve(s,i,n)}}):Promise.resolve()}}function zAt(e){let t=e.positions;return function(){for(let n=0;n<t.length;++n){let i=t[n];i.height=void 0}}}var Aj=FAt;var Hee=new U;async function bve(e,t,n){l(n)||(n=!1);let i=[],r=[],o=e.availability,s=[];for(let c=0;c<t.length;++c){let u=t[c],f=o.computeMaximumLevelAtPosition(u);if(r[c]=f,f===0){e.tilingScheme.positionToTileXY(u,1,Hee);let p=e.loadTileDataAvailability(Hee.x,Hee.y,1);l(p)&&s.push(p)}let d=i[f];l(d)||(i[f]=d=[]),d.push(u)}await Promise.all(s),await Promise.all(i.map(function(c,u){if(l(c))return Aj(e,u,c,n)}));let a=[];for(let c=0;c<t.length;++c){let u=t[c];o.computeMaximumLevelAtPosition(u)!==r[c]&&a.push(u)}return a.length>0&&await bve(e,a,n),t}var VS=bve;async function Gee(e,t){let n=t.terrainProvider,i=t.mapProjection,r=i.ellipsoid,o,s=t.camera.getRectangleCameraCoordinates(e);if(t.mode===re.SCENE3D?o=r.cartesianToCartographic(s):o=i.unproject(s),!l(n))return o;let a=n.availability;if(!l(a)||t.mode===re.SCENE2D)return o;let c=[ie.center(e),ie.southeast(e),ie.southwest(e),ie.northeast(e),ie.northwest(e)],u=await Gee._sampleTerrainMostDetailed(n,c),f=!1,d=u.reduce(function(g,m){return l(m.height)?(f=!0,Math.max(m.height,g)):g},-Number.MAX_VALUE),p=o;return f&&(p.height+=d),p}Gee._sampleTerrainMostDetailed=VS;var jS=Gee;var xve={NONE:0,LERC:1};Object.freeze(xve);var om=xve;var Tve={NONE:0,BITS12:1};Object.freeze(Tve);var cc=Tve;var yR=new h,VAt=new h,Gd=new U,jAt=new M,HAt=new M,GAt=Math.pow(2,12);function vc(e,t,n,i,r,o,s,a,c,u){let f=cc.NONE,d,p;if(l(t)&&l(n)&&l(i)&&l(r)){let g=t.minimum,m=t.maximum,y=h.subtract(m,g,VAt),A=i-n;Math.max(h.maximumComponent(y),A)<GAt-1?f=cc.BITS12:f=cc.NONE;let x=M.fromScale(y,jAt);x=M.setTranslation(x,g,x);let T=M.fromScale(h.fromElements(1/y.x,1/y.y,1/y.z,yR),HAt);T=M.multiplyByTranslation(T,h.negate(g,yR),T),p=M.clone(r,new M);let E=M.getTranslation(r,yR);E=h.subtract(E,e,yR),p=M.setTranslation(p,E,p),p=M.multiply(p,x,p),d=M.inverseTransformation(r,new M),d=M.multiply(T,d,d),r=M.multiply(r,x,new M)}this.quantization=f,this.minimumHeight=n,this.maximumHeight=i,this.center=h.clone(e),this.toScaledENU=d,this.fromScaledENU=r,this.matrix=p,this.hasVertexNormals=o??!1,this.hasWebMercatorT=s??!1,this.hasGeodeticSurfaceNormals=a??!1,this.exaggeration=c??1,this.exaggerationRelativeHeight=u??0,this.stride=0,this._offsetGeodeticSurfaceNormal=0,this._offsetVertexNormal=0,this._calculateStrideAndOffsets()}vc.prototype.encode=function(e,t,n,i,r,o,s,a){let c=i.x,u=i.y;if(this.quantization===cc.BITS12){n=M.multiplyByPoint(this.toScaledENU,n,yR),n.x=P.clamp(n.x,0,1),n.y=P.clamp(n.y,0,1),n.z=P.clamp(n.z,0,1);let f=this.maximumHeight-this.minimumHeight,d=P.clamp((r-this.minimumHeight)/f,0,1);U.fromElements(n.x,n.y,Gd);let p=cn.compressTextureCoordinates(Gd);U.fromElements(n.z,d,Gd);let g=cn.compressTextureCoordinates(Gd);U.fromElements(c,u,Gd);let m=cn.compressTextureCoordinates(Gd);if(e[t++]=p,e[t++]=g,e[t++]=m,this.hasWebMercatorT){U.fromElements(s,0,Gd);let y=cn.compressTextureCoordinates(Gd);e[t++]=y}}else e[t++]=n.x-this.center.x,e[t++]=n.y-this.center.y,e[t++]=n.z-this.center.z,e[t++]=r,e[t++]=c,e[t++]=u,this.hasWebMercatorT&&(e[t++]=s);return this.hasVertexNormals&&(e[t++]=cn.octPackFloat(o)),this.hasGeodeticSurfaceNormals&&(e[t++]=a.x,e[t++]=a.y,e[t++]=a.z),t};var WAt=new h,Eve=new h;vc.prototype.addGeodeticSurfaceNormals=function(e,t,n){if(this.hasGeodeticSurfaceNormals)return;let i=this.stride,r=e.length/i;this.hasGeodeticSurfaceNormals=!0,this._calculateStrideAndOffsets();let o=this.stride;for(let s=0;s<r;s++){for(let f=0;f<i;f++){let d=s*i+f,p=s*o+f;t[p]=e[d]}let a=this.decodePosition(t,s,WAt),c=n.geodeticSurfaceNormal(a,Eve),u=s*o+this._offsetGeodeticSurfaceNormal;t[u]=c.x,t[u+1]=c.y,t[u+2]=c.z}};vc.prototype.removeGeodeticSurfaceNormals=function(e,t){if(!this.hasGeodeticSurfaceNormals)return;let n=this.stride,i=e.length/n;this.hasGeodeticSurfaceNormals=!1,this._calculateStrideAndOffsets();let r=this.stride;for(let o=0;o<i;o++)for(let s=0;s<r;s++){let a=o*n+s,c=o*r+s;t[c]=e[a]}};vc.prototype.decodePosition=function(e,t,n){if(l(n)||(n=new h),t*=this.stride,this.quantization===cc.BITS12){let i=cn.decompressTextureCoordinates(e[t],Gd);n.x=i.x,n.y=i.y;let r=cn.decompressTextureCoordinates(e[t+1],Gd);return n.z=r.x,M.multiplyByPoint(this.fromScaledENU,n,n)}return n.x=e[t],n.y=e[t+1],n.z=e[t+2],h.add(n,this.center,n)};vc.prototype.getExaggeratedPosition=function(e,t,n){n=this.decodePosition(e,t,n);let i=this.exaggeration,r=this.exaggerationRelativeHeight;if(i!==1&&this.hasGeodeticSurfaceNormals){let s=this.decodeGeodeticSurfaceNormal(e,t,Eve),a=this.decodeHeight(e,t),c=br.getHeight(a,i,r)-a;n.x+=s.x*c,n.y+=s.y*c,n.z+=s.z*c}return n};vc.prototype.decodeTextureCoordinates=function(e,t,n){return l(n)||(n=new U),t*=this.stride,this.quantization===cc.BITS12?cn.decompressTextureCoordinates(e[t+2],n):U.fromElements(e[t+4],e[t+5],n)};vc.prototype.decodeHeight=function(e,t){return t*=this.stride,this.quantization===cc.BITS12?cn.decompressTextureCoordinates(e[t+1],Gd).y*(this.maximumHeight-this.minimumHeight)+this.minimumHeight:e[t+3]};vc.prototype.decodeWebMercatorT=function(e,t){return t*=this.stride,this.quantization===cc.BITS12?cn.decompressTextureCoordinates(e[t+3],Gd).x:e[t+6]};vc.prototype.getOctEncodedNormal=function(e,t,n){t=t*this.stride+this._offsetVertexNormal;let i=e[t]/256,r=Math.floor(i),o=(i-r)*256;return U.fromElements(r,o,n)};vc.prototype.decodeNormal=function(e,t,n){let i=t*this.stride+this._offsetVertexNormal;return cn.octDecodeFloat(e[i],n)};vc.prototype.decodeGeodeticSurfaceNormal=function(e,t,n){return t=t*this.stride+this._offsetGeodeticSurfaceNormal,n.x=e[t],n.y=e[t+1],n.z=e[t+2],n};vc.prototype._calculateStrideAndOffsets=function(){let e=0;this.quantization===cc.BITS12?e+=3:e+=6,this.hasWebMercatorT&&(e+=1),this.hasVertexNormals&&(this._offsetVertexNormal=e,e+=1),this.hasGeodeticSurfaceNormals&&(this._offsetGeodeticSurfaceNormal=e,e+=3),this.stride=e};var bj={position3DAndHeight:0,textureCoordAndEncodedNormals:1,geodeticSurfaceNormal:2},xj={compressed0:0,compressed1:1,geodeticSurfaceNormal:2};vc.prototype.getAttributes=function(e){let t=Y.FLOAT,n=Y.getSizeInBytes(t),i=this.stride*n,r=0,o=[];function s(a,c){o.push({index:a,vertexBuffer:e,componentDatatype:t,componentsPerAttribute:c,offsetInBytes:r,strideInBytes:i}),r+=c*n}if(this.quantization===cc.NONE){s(bj.position3DAndHeight,4);let a=2;a+=this.hasWebMercatorT?1:0,a+=this.hasVertexNormals?1:0,s(bj.textureCoordAndEncodedNormals,a),this.hasGeodeticSurfaceNormals&&s(bj.geodeticSurfaceNormal,3)}else{let a=this.hasWebMercatorT||this.hasVertexNormals,c=this.hasWebMercatorT&&this.hasVertexNormals;s(xj.compressed0,a?4:3),c&&s(xj.compressed1,1),this.hasGeodeticSurfaceNormals&&s(xj.geodeticSurfaceNormal,3)}return o};vc.prototype.getAttributeLocations=function(){return this.quantization===cc.NONE?bj:xj};vc.clone=function(e,t){if(l(e))return l(t)||(t=new vc),t.quantization=e.quantization,t.minimumHeight=e.minimumHeight,t.maximumHeight=e.maximumHeight,t.center=h.clone(e.center),t.toScaledENU=M.clone(e.toScaledENU),t.fromScaledENU=M.clone(e.fromScaledENU),t.matrix=M.clone(e.matrix),t.hasVertexNormals=e.hasVertexNormals,t.hasWebMercatorT=e.hasWebMercatorT,t.hasGeodeticSurfaceNormals=e.hasGeodeticSurfaceNormals,t.exaggeration=e.exaggeration,t.exaggerationRelativeHeight=e.exaggerationRelativeHeight,t._calculateStrideAndOffsets(),t};var Po=vc;var jp={};jp.DEFAULT_STRUCTURE=Object.freeze({heightScale:1,heightOffset:0,elementsPerHeight:1,stride:1,elementMultiplier:256,isBigEndian:!1});var Wee=new h,qAt=new M,YAt=new h,XAt=new h;jp.computeVertices=function(e){let t=Math.cos,n=Math.sin,i=Math.sqrt,r=Math.atan,o=Math.exp,s=P.PI_OVER_TWO,a=P.toRadians,c=e.heightmap,u=e.width,f=e.height,d=e.skirtHeight,p=d>0,g=e.isGeographic??!0,m=e.ellipsoid??ee.default,y=1/m.maximumRadius,A=ie.clone(e.nativeRectangle),b=ie.clone(e.rectangle),x,T,E,v;l(b)?(x=b.west,T=b.south,E=b.east,v=b.north):g?(x=a(A.west),T=a(A.south),E=a(A.east),v=a(A.north)):(x=A.west*y,T=s-2*r(o(-A.south*y)),E=A.east*y,v=s-2*r(o(-A.north*y)));let S=e.relativeToCenter,I=l(S);S=I?S:h.ZERO;let R=e.includeWebMercatorT??!1,O=e.exaggeration??1,L=e.exaggerationRelativeHeight??0,C=O!==1,w=e.structure??jp.DEFAULT_STRUCTURE,D=w.heightScale??jp.DEFAULT_STRUCTURE.heightScale,N=w.heightOffset??jp.DEFAULT_STRUCTURE.heightOffset,F=w.elementsPerHeight??jp.DEFAULT_STRUCTURE.elementsPerHeight,V=w.stride??jp.DEFAULT_STRUCTURE.stride,B=w.elementMultiplier??jp.DEFAULT_STRUCTURE.elementMultiplier,j=w.isBigEndian??jp.DEFAULT_STRUCTURE.isBigEndian,k=ie.computeWidth(A),G=ie.computeHeight(A),q=k/(u-1),Q=G/(f-1);g||(k*=y,G*=y);let W=m.radiiSquared,J=W.x,Z=W.y,ae=W.z,Ae=65536,fe=-65536,xe=At.eastNorthUpToFixedFrame(S,m),ge=M.inverseTransformation(xe,qAt),we,ve;R&&(we=Ti.geodeticLatitudeToMercatorAngle(T),ve=1/(Ti.geodeticLatitudeToMercatorAngle(v)-we));let Re=YAt;Re.x=Number.POSITIVE_INFINITY,Re.y=Number.POSITIVE_INFINITY,Re.z=Number.POSITIVE_INFINITY;let Qe=XAt;Qe.x=Number.NEGATIVE_INFINITY,Qe.y=Number.NEGATIVE_INFINITY,Qe.z=Number.NEGATIVE_INFINITY;let He=Number.POSITIVE_INFINITY,Ye=u*f,Ke=d>0?u*2+f*2:0,Pe=Ye+Ke,qe=new Array(Pe),st=new Array(Pe),vt=new Array(Pe),jt=R?new Array(Pe):[],lt=C?new Array(Pe):[],mt=0,ft=f,Yt=0,rt=u;p&&(--mt,++ft,--Yt,++rt);let ht=1e-5;for(let zn=mt;zn<ft;++zn){let tn=zn;tn<0&&(tn=0),tn>=f&&(tn=f-1);let Hn=A.north-Q*tn;g?Hn=a(Hn):Hn=s-2*r(o(-Hn*y));let Ki=(Hn-T)/(v-T);Ki=P.clamp(Ki,0,1);let wr=zn===mt,so=zn===ft-1;d>0&&(wr?Hn+=ht*G:so&&(Hn-=ht*G));let Ts=t(Hn),zs=n(Hn),$r=ae*zs,pi;R&&(pi=(Ti.geodeticLatitudeToMercatorAngle(Hn)-we)*ve);for(let ao=Yt;ao<rt;++ao){let nr=ao;nr<0&&(nr=0),nr>=u&&(nr=u-1);let jo=tn*(u*V)+nr*V,Fn;if(F===1)Fn=c[jo];else{Fn=0;let Wr;if(j)for(Wr=0;Wr<F;++Wr)Fn=Fn*B+c[jo+Wr];else for(Wr=F-1;Wr>=0;--Wr)Fn=Fn*B+c[jo+Wr]}Fn=Fn*D+N,fe=Math.max(fe,Fn),Ae=Math.min(Ae,Fn);let Vi=A.west+q*nr;g?Vi=a(Vi):Vi=Vi*y;let Fi=(Vi-x)/(E-x);Fi=P.clamp(Fi,0,1);let Ir=tn*u+nr;if(d>0){let Wr=ao===Yt,_l=ao===rt-1,w0=wr||so||Wr||_l;if((wr||so)&&(Wr||_l))continue;w0&&(Fn-=d,Wr?(Ir=Ye+(f-tn-1),Vi-=ht*k):so?Ir=Ye+f+(u-nr-1):_l?(Ir=Ye+f+u+tn,Vi+=ht*k):wr&&(Ir=Ye+f+u+f+nr))}let Mc=Ts*t(Vi),qf=Ts*n(Vi),Rm=J*Mc,ch=Z*qf,Om=1/i(Rm*Mc+ch*qf+$r*zs),Es=Rm*Om,Ha=ch*Om,ub=$r*Om,ii=new h;ii.x=Es+Mc*Fn,ii.y=Ha+qf*Fn,ii.z=ub+zs*Fn,M.multiplyByPoint(ge,ii,Wee),h.minimumByComponent(Wee,Re,Re),h.maximumByComponent(Wee,Qe,Qe),He=Math.min(He,Fn),qe[Ir]=ii,vt[Ir]=new U(Fi,Ki),st[Ir]=Fn,R&&(jt[Ir]=pi),C&&(lt[Ir]=m.geodeticSurfaceNormal(ii))}}let Li=ue.fromPoints(qe),Yn;l(b)&&(Yn=en.fromRectangle(b,Ae,fe,m));let yi;I&&(yi=new tp(m).computeHorizonCullingPointPossiblyUnderEllipsoid(S,qe,Ae));let zi=new rd(Re,Qe,S),Si=new Po(S,zi,He,fe,xe,!1,R,C,O,L),ui=new Float32Array(Pe*Si.stride),Ai=0;for(let zn=0;zn<Pe;++zn)Ai=Si.encode(ui,Ai,qe[zn],vt[zn],st[zn],void 0,jt[zn],lt[zn]);return{vertices:ui,maximumHeight:fe,minimumHeight:Ae,encoding:Si,boundingSphere3D:Li,orientedBoundingBox:Yn,occludeePointInScaledSpace:yi}};var AR=jp;function dA(){pe.throwInstantiationError()}Object.defineProperties(dA.prototype,{credits:{get:pe.throwInstantiationError},waterMask:{get:pe.throwInstantiationError}});dA.prototype.interpolateHeight=pe.throwInstantiationError;dA.prototype.isChildAvailable=pe.throwInstantiationError;dA.prototype.createMesh=pe.throwInstantiationError;dA.prototype.upsample=pe.throwInstantiationError;dA.prototype.wasCreatedByUpsampling=pe.throwInstantiationError;dA.maximumAsynchronousTasks=5;var wf=dA;var KAt=3,Yee=class{constructor(t,n,i){this._vertices=t,this._indices=n,this._encoding=i,this._inverseTransform=new M,this._needsRebuild=!0,this._rootNode=new Xee}get needsRebuild(){return this._needsRebuild}set needsRebuild(t){this._needsRebuild=t}rayIntersect(t,n,i,r,o){this._needsRebuild&&ZAt(this,n);let s=this._inverseTransform,a=JAt;a.origin=M.multiplyByPoint(s,t.origin,a.origin),a.direction=M.multiplyByPointAsVector(s,t.direction,a.direction);let c=[];return vve(this._rootNode,a,c),ibt(this,c,t,i,r,o)}},$At=new $n("incrementallyBuildTerrainPicker"),Xee=class e{constructor(){this.x=0,this.y=0,this.level=0,this.aabb=Cve(this.x,this.y,this.level),this.intersectingTriangles=new Uint32Array(0),this.children=[],this.buildingChildren=!1}addChild(t){let n=new e;n.x=this.x*2+(t&1),n.y=this.y*2+(t>>1&1),n.level=this.level+1,n.aabb=Cve(n.x,n.y,n.level),this.children[t]=n}},JAt=new gn,Tj=[new h,new h,new h];function ZAt(e,t){M.inverse(t,e._inverseTransform),e._needsRebuild=!1;let n=e._indices.length/3,i=new Uint32Array(n);for(let r=0;r<n;++r)i[r]=r;e._rootNode.intersectingTriangles=i,e._rootNode.children.length=0}var QAt=new h,ebt=new h;function Cve(e,t,n){let i=1/Math.pow(2,n),r=h.fromElements(e*i-.5,t*i-.5,-.5,QAt),o=h.fromElements((e+1)*i-.5,(t+1)*i-.5,.5,ebt);return rd.fromCorners(r,o)}function tbt(e,t,n,i,r){h.pack(n[0],e,9*r),h.pack(n[1],e,9*r+3),h.pack(n[2],e,9*r+6),t[r]=i}var nbt=new Gs;function vve(e,t,n){let i=xi.rayAxisAlignedBoundingBox(t,e.aabb,nbt);if(!l(i))return;if(!e.children.length||e.buildingChildren){n.push({node:e,interval:new Gs(i.start,i.stop)});return}for(let o=0;o<e.children.length;o++)vve(e.children[o],t,n)}function ibt(e,t,n,i,r,o){let s=t.sort(function(c,u){return c.interval.start-u.interval.start}),a=Number.MAX_VALUE;for(let c=0;c<s.length;c++){let u=s[c],f=rbt(e,n,u.node,i,r,o);if(a=Math.min(f,a),a!==Number.MAX_VALUE)break}if(a!==Number.MAX_VALUE)return gn.getPoint(n,a)}function rbt(e,t,n,i,r,o){let s=Number.MAX_VALUE,a=e._encoding,c=e._indices,u=e._vertices,f=n.intersectingTriangles.length,p=!(n.level>=KAt)&&!n.buildingChildren,g,m;p&&(g=new Float64Array(f*9),m=new Uint32Array(f));for(let y=0;y<f;y++){let A=n.intersectingTriangles[y],b=qee(a,r,o,t,u,c[3*A],Tj[0]),x=qee(a,r,o,t,u,c[3*A+1],Tj[1]),T=qee(a,r,o,t,u,c[3*A+2],Tj[2]),E=xi.rayTriangleParametric(t,b,x,T,i);l(E)&&E<s&&E>=0&&(s=E),p&&tbt(g,m,Tj,A,y)}if(p){for(let y=0;y<4;y++)n.addChild(y);sbt(e._inverseTransform,n,m,g)}return s}var obt=new he;function qee(e,t,n,i,r,o,s){let a=e.getExaggeratedPosition(r,o,s);if(t===re.SCENE3D)return a;let u=n.ellipsoid.cartesianToCartographic(a,obt);a=n.project(u,s),a=h.fromElements(a.z,a.x,a.y,s);let f=P.TWO_PI*n.ellipsoid.maximumRadius,d=Math.round((i.origin.y-a.y)/f);return a.y+=d*f,a}async function sbt(e,t,n,i){t.buildingChildren=!0;let r=new Float64Array(16);M.pack(e,r,0);let o=new Float64Array(24);for(let f=0;f<4;f++)h.pack(t.children[f].aabb.minimum,o,f*6),h.pack(t.children[f].aabb.maximum,o,f*6+3);let s={aabbs:o,inverseTransform:r,triangleIndices:n,trianglePositions:i},a=[o.buffer,r.buffer,n.buffer,i.buffer],c=$At.scheduleTask(s,a);if(!l(c)){t.buildingChildren=!1;return}(await c).intersectingTrianglesArrays.forEach((f,d)=>{l(t.children[d])&&(t.children[d].intersectingTriangles=new Uint32Array(f))}),t.intersectingTriangles=new Uint32Array(0),t.buildingChildren=!1}var Ej=Yee;function bR(e,t,n,i,r,o,s,a,c,u,f,d,p,g,m,y,A){this.center=e,this.vertices=t,this.stride=f??6,this.indices=n,this.indexCountWithoutSkirts=i,this.vertexCountWithoutSkirts=r,this.minimumHeight=o,this.maximumHeight=s,this.rectangle=a,this.boundingSphere3D=c,this.occludeePointInScaledSpace=u,this.orientedBoundingBox=d,this.encoding=p,this.westIndicesSouthToNorth=g,this.southIndicesEastToWest=m,this.eastIndicesNorthToSouth=y,this.northIndicesWestToEast=A,this._transform=new M,this._lastPickSceneMode=void 0,this._terrainPicker=new Ej(t,n,p)}bR.prototype.getTransform=function(e,t){return this._lastPickSceneMode===e?this._transform:(this._terrainPicker.needsRebuild=!0,!l(e)||e===re.SCENE3D?abt(this,this._transform):mbt(this,t,this._transform))};function abt(e,t){let n=e.encoding.exaggeration,i=e.encoding.exaggerationRelativeHeight,r=br.getHeight(e.minimumHeight,n,i),o=br.getHeight(e.maximumHeight,n,i),s=en.fromRectangle(e.rectangle,r,o,ee.default,e.orientedBoundingBox);return en.computeTransformation(s,t),M.getScale(t,Kee).z<=P.EPSILON16&&(Kee.z=1,M.setScale(t,Kee,t)),t}var cbt=new h,lbt=new h,ubt=new he,fbt=new he,dbt=new h,hbt=new h,Kee=new h;function mbt(e,t,n){let i=e.encoding.exaggeration,r=e.encoding.exaggerationRelativeHeight,o=br.getHeight(e.minimumHeight,i,r),s=br.getHeight(e.maximumHeight,i,r),a=t.project(he.fromRadians(e.rectangle.west,e.rectangle.south,0,ubt),cbt),c=t.project(he.fromRadians(e.rectangle.east,e.rectangle.north,0,fbt),lbt),u=s-o,f=h.fromElements(c.x-a.x,c.y-a.y,u>0?u:1,dbt),d=h.fromElements(a.x+f.x*.5,a.y+f.y*.5,o+f.z*.5,hbt);return M.fromTranslation(d,n),M.setScale(n,f,n),M.multiply(At.SWIZZLE_3D_TO_2D_MATRIX,n,n),n}bR.prototype.pick=function(e,t,n,i){let r=this._terrainPicker.rayIntersect(e,this.getTransform(n,i),t,n,i);return this._lastPickSceneMode=n,r};bR.prototype.updateExaggeration=function(e,t){this._terrainPicker._vertices=this.vertices,this._terrainPicker.needsRebuild=!0,this._lastPickSceneMode=void 0};bR.prototype.updateSceneMode=function(e){this._terrainPicker.needsRebuild=!0,this._lastPickSceneMode=void 0};var Sc=bR;function kg(e){e=e??H.EMPTY_OBJECT,this._buffer=e.buffer,this._width=e.width,this._height=e.height,this._childTileMask=e.childTileMask??15,this._encoding=e.encoding??om.NONE;let t=AR.DEFAULT_STRUCTURE,n=e.structure;l(n)?n!==t&&(n.heightScale=n.heightScale??t.heightScale,n.heightOffset=n.heightOffset??t.heightOffset,n.elementsPerHeight=n.elementsPerHeight??t.elementsPerHeight,n.stride=n.stride??t.stride,n.elementMultiplier=n.elementMultiplier??t.elementMultiplier,n.isBigEndian=n.isBigEndian??t.isBigEndian):n=t,this._structure=n,this._createdByUpsampling=e.createdByUpsampling??!1,this._waterMask=e.waterMask,this._skirtHeight=void 0,this._bufferType=this._encoding===om.LERC?Float32Array:this._buffer.constructor,this._mesh=void 0}Object.defineProperties(kg.prototype,{credits:{get:function(){}},waterMask:{get:function(){return this._waterMask}},childTileMask:{get:function(){return this._childTileMask}}});var Sve="createVerticesFromHeightmap",pbt=new $n(Sve),gbt=new $n(Sve,wf.maximumAsynchronousTasks);kg.prototype.createMesh=function(e){e=e??H.EMPTY_OBJECT;let t=e.tilingScheme,n=e.x,i=e.y,r=e.level,o=e.exaggeration??1,s=e.exaggerationRelativeHeight??0,a=e.throttle??!0,c=t.ellipsoid,u=t.tileXYToNativeRectangle(n,i,r),f=t.tileXYToRectangle(n,i,r),d=c.cartographicToCartesian(ie.center(f)),p=this._structure,m=Xr.getEstimatedLevelZeroGeometricErrorForAHeightmap(c,this._width,t.getNumberOfXTilesAtLevel(0))/(1<<r);this._skirtHeight=Math.min(m*4,1e3);let A=(a?gbt:pbt).scheduleTask({heightmap:this._buffer,structure:p,includeWebMercatorT:!0,width:this._width,height:this._height,nativeRectangle:u,rectangle:f,relativeToCenter:d,ellipsoid:c,skirtHeight:this._skirtHeight,isGeographic:t.projection instanceof ji,exaggeration:o,exaggerationRelativeHeight:s,encoding:this._encoding});if(!l(A))return;let b=this;return Promise.resolve(A).then(function(x){let T;b._skirtHeight>0?T=Xr.getRegularGridAndSkirtIndicesAndEdgeIndices(x.gridWidth,x.gridHeight):T=Xr.getRegularGridIndicesAndEdgeIndices(x.gridWidth,x.gridHeight);let E=x.gridWidth*x.gridHeight;return b._mesh=new Sc(d,new Float32Array(x.vertices),T.indices,T.indexCountWithoutSkirts,E,x.minimumHeight,x.maximumHeight,f,ue.clone(x.boundingSphere3D),h.clone(x.occludeePointInScaledSpace),x.numberOfAttributes,en.clone(x.orientedBoundingBox),Po.clone(x.encoding),T.westIndicesSouthToNorth,T.southIndicesEastToWest,T.eastIndicesNorthToSouth,T.northIndicesWestToEast),b._buffer=void 0,b._mesh})};kg.prototype._createMeshSync=function(e){let t=e.tilingScheme,n=e.x,i=e.y,r=e.level,o=e.exaggeration??1,s=e.exaggerationRelativeHeight??0,a=t.ellipsoid,c=t.tileXYToNativeRectangle(n,i,r),u=t.tileXYToRectangle(n,i,r),f=a.cartographicToCartesian(ie.center(u)),d=this._structure,g=Xr.getEstimatedLevelZeroGeometricErrorForAHeightmap(a,this._width,t.getNumberOfXTilesAtLevel(0))/(1<<r);this._skirtHeight=Math.min(g*4,1e3);let m=AR.computeVertices({heightmap:this._buffer,structure:d,includeWebMercatorT:!0,width:this._width,height:this._height,nativeRectangle:c,rectangle:u,relativeToCenter:f,ellipsoid:a,skirtHeight:this._skirtHeight,isGeographic:t.projection instanceof ji,exaggeration:o,exaggerationRelativeHeight:s});this._buffer=void 0;let y;this._skirtHeight>0?y=Xr.getRegularGridAndSkirtIndicesAndEdgeIndices(this._width,this._height):y=Xr.getRegularGridIndicesAndEdgeIndices(this._width,this._height);let A=m.gridWidth*m.gridHeight;return this._mesh=new Sc(f,m.vertices,y.indices,y.indexCountWithoutSkirts,A,m.minimumHeight,m.maximumHeight,u,m.boundingSphere3D,m.occludeePointInScaledSpace,m.encoding.stride,m.orientedBoundingBox,m.encoding,y.westIndicesSouthToNorth,y.southIndicesEastToWest,y.eastIndicesNorthToSouth,y.northIndicesWestToEast),this._mesh};kg.prototype.interpolateHeight=function(e,t,n){let i=this._width,r=this._height,o=this._structure,s=o.stride,a=o.elementsPerHeight,c=o.elementMultiplier,u=o.isBigEndian,f=o.heightOffset,d=o.heightScale,p=l(this._mesh),g=this._encoding===om.LERC;if(!p&&g)return;let y;if(p){let A=this._mesh.vertices,b=this._mesh.encoding;y=wve(A,b,f,d,e,i,r,t,n)}else y=_bt(this._buffer,a,c,s,u,e,i,r,t,n),y=y*d+f;return y};kg.prototype.upsample=function(e,t,n,i,r,o,s){let a=this._mesh;if(!l(a))return;let c=this._width,u=this._height,f=this._structure,d=f.stride,p=new this._bufferType(c*u*d),g=a.vertices,m=a.encoding,y=e.tileXYToRectangle(t,n,i),A=e.tileXYToRectangle(r,o,s),b=f.heightOffset,x=f.heightScale,T=f.elementsPerHeight,E=f.elementMultiplier,v=f.isBigEndian,S=Math.pow(E,T-1);for(let I=0;I<u;++I){let R=P.lerp(A.north,A.south,I/(u-1));for(let O=0;O<c;++O){let L=P.lerp(A.west,A.east,O/(c-1)),_=wve(g,m,b,x,y,c,u,L,R);_=_<f.lowestEncodedHeight?f.lowestEncodedHeight:_,_=_>f.highestEncodedHeight?f.highestEncodedHeight:_,ybt(p,T,E,S,d,v,I*c+O,_)}}return Promise.resolve(new kg({buffer:p,width:c,height:u,childTileMask:0,structure:this._structure,createdByUpsampling:!0}))};kg.prototype.isChildAvailable=function(e,t,n,i){let r=2;return n!==e*2&&++r,i!==t*2&&(r-=2),(this._childTileMask&1<<r)!==0};kg.prototype.wasCreatedByUpsampling=function(){return this._createdByUpsampling};function _bt(e,t,n,i,r,o,s,a,c,u){let f=(c-o.west)*(s-1)/(o.east-o.west),d=(u-o.south)*(a-1)/(o.north-o.south),p=f|0,g=p+1;g>=s&&(g=s-1,p=s-2);let m=d|0,y=m+1;y>=a&&(y=a-1,m=a-2);let A=f-p,b=d-m;m=a-1-m,y=a-1-y;let x=Cj(e,t,n,i,r,m*s+p),T=Cj(e,t,n,i,r,m*s+g),E=Cj(e,t,n,i,r,y*s+p),v=Cj(e,t,n,i,r,y*s+g);return Ive(A,b,x,T,E,v)}function wve(e,t,n,i,r,o,s,a,c){let u=(a-r.west)*(o-1)/(r.east-r.west),f=(c-r.south)*(s-1)/(r.north-r.south),d=u|0,p=d+1;p>=o&&(p=o-1,d=o-2);let g=f|0,m=g+1;m>=s&&(m=s-1,g=s-2);let y=u-d,A=f-g;g=s-1-g,m=s-1-m;let b=(t.decodeHeight(e,g*o+d)-n)/i,x=(t.decodeHeight(e,g*o+p)-n)/i,T=(t.decodeHeight(e,m*o+d)-n)/i,E=(t.decodeHeight(e,m*o+p)-n)/i;return Ive(y,A,b,x,T,E)}function Ive(e,t,n,i,r,o){return t<e?n+e*(i-n)+t*(o-i):n+e*(o-r)+t*(r-n)}function Cj(e,t,n,i,r,o){o*=i;let s=0,a;if(r)for(a=0;a<t;++a)s=s*n+e[o+a];else for(a=t-1;a>=0;--a)s=s*n+e[o+a];return s}function ybt(e,t,n,i,r,o,s,a){s*=r;let c;if(o)for(c=0;c<t-1;++c)e[s+c]=a/i|0,a-=e[s+c]*i,i/=n;else for(c=t-1;c>0;--c)e[s+c]=a/i|0,a-=e[s+c]*i,i/=n;e[s+c]=a}var sl=kg;function HS(e){e=e??H.EMPTY_OBJECT,this._tilingScheme=e.tilingScheme,l(this._tilingScheme)||(this._tilingScheme=new ir({ellipsoid:e.ellipsoid??ee.default})),this._levelZeroMaximumGeometricError=Xr.getEstimatedLevelZeroGeometricErrorForAHeightmap(this._tilingScheme.ellipsoid,64,this._tilingScheme.getNumberOfXTilesAtLevel(0)),this._errorEvent=new be}Object.defineProperties(HS.prototype,{errorEvent:{get:function(){return this._errorEvent}},credit:{get:function(){}},tilingScheme:{get:function(){return this._tilingScheme}},hasWaterMask:{get:function(){return!1}},hasVertexNormals:{get:function(){return!1}},availability:{get:function(){}}});HS.prototype.requestTileGeometry=function(e,t,n,i){return Promise.resolve(new sl({buffer:new Uint8Array(256),width:16,height:16}))};HS.prototype.getLevelMaximumGeometricError=function(e){return this._levelZeroMaximumGeometricError/(1<<e)};HS.prototype.getTileDataAvailable=function(e,t,n){};HS.prototype.loadTileDataAvailability=function(e,t,n){};var Ug=HS;var Abt=new U;function bbt(e,t){let n=e.unionClippingRegions,i=e.length,r=Ds.useFloatTexture(t),o=Ds.getTextureResolution(e,t,Abt),s=o.x,a=o.y,c=r?Ebt(s,a):Cbt(s,a);return c+=` +`,c+=n?xbt(i):Tbt(i),c}function xbt(e){return`float clip(vec4 fragCoord, sampler2D clippingPlanes, mat4 clippingPlanesMatrix) { vec4 position = czm_windowToEyeCoordinates(fragCoord); vec3 clipNormal = vec3(0.0); @@ -9996,7 +9996,7 @@ Url: ${e._contentHeader.uri}`,r++;let o={text:i.substring(1),position:n,font:`${ } return clipAmount; } -`}function iIt(e){return`float clip(vec4 fragCoord, sampler2D clippingPlanes, mat4 clippingPlanesMatrix) +`}function Tbt(e){return`float clip(vec4 fragCoord, sampler2D clippingPlanes, mat4 clippingPlanesMatrix) { bool clipped = true; vec4 position = czm_windowToEyeCoordinates(fragCoord); @@ -10019,7 +10019,7 @@ Url: ${e._contentHeader.uri}`,r++;let o={text:i.substring(1),position:n,font:`${ } return clipAmount; } -`}function rIt(e,t){let n=1/e,i=1/t,r=`${n}`;r.indexOf(".")===-1&&(r+=".0");let o=`${i}`;return o.indexOf(".")===-1&&(o+=".0"),`vec4 getClippingPlane(highp sampler2D packedClippingPlanes, int clippingPlaneNumber, mat4 transform) +`}function Ebt(e,t){let n=1/e,i=1/t,r=`${n}`;r.indexOf(".")===-1&&(r+=".0");let o=`${i}`;return o.indexOf(".")===-1&&(o+=".0"),`vec4 getClippingPlane(highp sampler2D packedClippingPlanes, int clippingPlaneNumber, mat4 transform) { int pixY = clippingPlaneNumber / ${e}; int pixX = clippingPlaneNumber - (pixY * ${e}); @@ -10029,7 +10029,7 @@ Url: ${e._contentHeader.uri}`,r++;let o={text:i.substring(1),position:n,font:`${ vec4 plane = texture(packedClippingPlanes, vec2(u, v)); return czm_transformPlane(plane, transform); } -`}function oIt(e,t){let n=1/e,i=1/t,r=`${n}`;r.indexOf(".")===-1&&(r+=".0");let o=`${i}`;return o.indexOf(".")===-1&&(o+=".0"),`vec4 getClippingPlane(highp sampler2D packedClippingPlanes, int clippingPlaneNumber, mat4 transform) +`}function Cbt(e,t){let n=1/e,i=1/t,r=`${n}`;r.indexOf(".")===-1&&(r+=".0");let o=`${i}`;return o.indexOf(".")===-1&&(o+=".0"),`vec4 getClippingPlane(highp sampler2D packedClippingPlanes, int clippingPlaneNumber, mat4 transform) { int clippingPlaneStartIndex = clippingPlaneNumber * 2; int pixY = clippingPlaneStartIndex / ${e}; @@ -10044,7 +10044,7 @@ Url: ${e._contentHeader.uri}`,r++;let o={text:i.substring(1),position:n,font:`${ plane.w = czm_unpackFloat(texture(packedClippingPlanes, vec2(u + ${r}, v))); return czm_transformPlane(plane, transform); } -`}var Bw=tIt;var dre=class{constructor(t,n,i,r,o,s){this.numberOfDayTextures=t,this.flags=n,this.material=i,this.shaderProgram=r,this.clippingShaderState=o,this.clippingPolygonShaderState=s}},hre=class{constructor(){this.baseVertexShaderSource=void 0,this.baseFragmentShaderSource=void 0,this._shadersByTexturesFlags=[],this.material=void 0}getShaderProgram(t){let n=t.frameState,i=t.surfaceTile,r=t.numberOfDayTextures,o=t.applyBrightness,s=t.applyContrast,a=t.applyHue,c=t.applySaturation,u=t.applyGamma,f=t.applyAlpha,d=t.applyDayNightAlpha,p=t.applySplit,g=t.hasWaterMask,m=t.showReflectiveOcean,y=t.showOceanWaves,A=t.enableLighting,b=t.dynamicAtmosphereLighting,x=t.dynamicAtmosphereLightingFromSun,T=t.showGroundAtmosphere,E=t.perFragmentGroundAtmosphere,v=t.hasVertexNormals,S=t.useWebMercatorProjection,I=t.enableFog,R=t.enableClippingPlanes,O=t.clippingPlanes,L=t.enableClippingPolygons,_=t.clippingPolygons,C=t.clippedByBoundaries,w=t.hasImageryLayerCutout,D=t.colorCorrect,N=t.highlightFillTile,F=t.colorToAlpha,V=t.hasGeodeticSurfaceNormals,B=t.hasExaggeration,j=t.showUndergroundColor,k=t.translucent,G=i.vectorData,q=G?.show,Q=q&&G.hasPolylines,W=q&&G.hasPolygons,J=q&&t.vectorAntialias,Z=Q&&G.hasMeterWidths,ae=Z&&G.hasPixelWidths,Ae=0,fe="",ge=i.renderedMesh.encoding;ge.quantization===lc.BITS12&&(Ae=1,fe="QUANTIZATION_BITS12");let ve=0,Re="";C&&(ve=1,Re="TILE_LIMIT_RECTANGLE");let Qe=0,He="";w&&(Qe=1,He="APPLY_IMAGERY_CUTOUT");let Ye=n.mode,Ke=((Ye|+o<<2|+s<<3|+a<<4|+c<<5|+u<<6|+f<<7|+g<<8|+m<<9|+y<<10|+A<<11|+b<<12|+x<<13|+T<<14|+E<<15|+v<<16|+S<<17|+I<<18|Ae<<19|+p<<20|+R<<21|+L<<22|ve<<23|Qe<<24|+D<<25|+N<<26|+F<<27|+V<<28|+B<<29|+j<<30|+k<<31)>>>0)+(d?4294967296:0)+(q?8589934592:0)+(Q?17179869184:0)+(W?34359738368:0)+(J?68719476736:0)+(Z?137438953472:0)+(ae?274877906944:0),Pe=0;l(O)&&O.length>0&&(Pe=R?O.clippingPlanesState:0);let qe=0;l(_)&&_.length>0&&(qe=L?_.clippingPolygonsState:0);let st=i.surfaceShader;if(l(st)&&st.numberOfDayTextures===r&&st.flags===Ke&&st.material===this.material&&st.clippingShaderState===Pe&&st.clippingPolygonShaderState===qe)return st.shaderProgram;let vt=this._shadersByTexturesFlags[r];if(l(vt)||(vt=this._shadersByTexturesFlags[r]=[]),st=vt[Ke],!l(st)||st.material!==this.material||st.clippingShaderState!==Pe||st.clippingPolygonShaderState!==qe){let jt=this.baseVertexShaderSource.clone(),lt=this.baseFragmentShaderSource.clone();Pe!==0&<.sources.unshift(Bw(O,n.context)),jt.defines.push(fe),lt.defines.push(`TEXTURE_UNITS ${r}`,Re,He),o&<.defines.push("APPLY_BRIGHTNESS"),s&<.defines.push("APPLY_CONTRAST"),a&<.defines.push("APPLY_HUE"),c&<.defines.push("APPLY_SATURATION"),u&<.defines.push("APPLY_GAMMA"),f&<.defines.push("APPLY_ALPHA"),d&<.defines.push("APPLY_DAY_NIGHT_ALPHA"),g&<.defines.push("HAS_WATER_MASK"),m&&(lt.defines.push("SHOW_REFLECTIVE_OCEAN"),jt.defines.push("SHOW_REFLECTIVE_OCEAN")),y&<.defines.push("SHOW_OCEAN_WAVES"),F&<.defines.push("APPLY_COLOR_TO_ALPHA"),j&&(jt.defines.push("UNDERGROUND_COLOR"),lt.defines.push("UNDERGROUND_COLOR")),k&&(jt.defines.push("TRANSLUCENT"),lt.defines.push("TRANSLUCENT")),A&&(v?(jt.defines.push("ENABLE_VERTEX_LIGHTING"),lt.defines.push("ENABLE_VERTEX_LIGHTING")):(jt.defines.push("ENABLE_DAYNIGHT_SHADING"),lt.defines.push("ENABLE_DAYNIGHT_SHADING"))),b&&(jt.defines.push("DYNAMIC_ATMOSPHERE_LIGHTING"),lt.defines.push("DYNAMIC_ATMOSPHERE_LIGHTING"),x&&(jt.defines.push("DYNAMIC_ATMOSPHERE_LIGHTING_FROM_SUN"),lt.defines.push("DYNAMIC_ATMOSPHERE_LIGHTING_FROM_SUN"))),T&&(jt.defines.push("GROUND_ATMOSPHERE"),lt.defines.push("GROUND_ATMOSPHERE"),E&&(jt.defines.push("PER_FRAGMENT_GROUND_ATMOSPHERE"),lt.defines.push("PER_FRAGMENT_GROUND_ATMOSPHERE"))),jt.defines.push("INCLUDE_WEB_MERCATOR_Y"),lt.defines.push("INCLUDE_WEB_MERCATOR_Y"),I&&(jt.defines.push("FOG"),lt.defines.push("FOG")),p&<.defines.push("APPLY_SPLIT"),R&<.defines.push("ENABLE_CLIPPING_PLANES"),L&&(lt.defines.push("ENABLE_CLIPPING_POLYGONS"),_.inverse&<.defines.push("CLIPPING_INVERSE")),D&<.defines.push("COLOR_CORRECT"),N&<.defines.push("HIGHLIGHT_FILL_TILE"),V&&jt.defines.push("GEODETIC_SURFACE_NORMALS"),B&&jt.defines.push("EXAGGERATION"),q&&(lt.defines.push("HAS_VECTOR_LAYER"),Q&<.defines.push("HAS_VECTOR_POLYLINES"),W&<.defines.push("HAS_VECTOR_POLYGONS"),J&<.defines.push("VECTOR_ANTIALIAS"),Z&<.defines.push("VECTOR_WIDTH_IN_METERS"),ae&<.defines.push("VECTOR_WIDTH_MIXED_UNITS")),(q||L)&<.sources.unshift(U_);let mt=` vec4 computeDayColor(vec4 initialColor, vec3 textureCoordinates, float nightBlend) +`}var GS=bbt;var $ee=class{constructor(t,n,i,r,o,s){this.numberOfDayTextures=t,this.flags=n,this.material=i,this.shaderProgram=r,this.clippingShaderState=o,this.clippingPolygonShaderState=s}},Jee=class{constructor(){this.baseVertexShaderSource=void 0,this.baseFragmentShaderSource=void 0,this._shadersByTexturesFlags=[],this.material=void 0}getShaderProgram(t){let n=t.frameState,i=t.surfaceTile,r=t.numberOfDayTextures,o=t.applyBrightness,s=t.applyContrast,a=t.applyHue,c=t.applySaturation,u=t.applyGamma,f=t.applyAlpha,d=t.applyDayNightAlpha,p=t.applySplit,g=t.hasWaterMask,m=t.showReflectiveOcean,y=t.showOceanWaves,A=t.enableLighting,b=t.dynamicAtmosphereLighting,x=t.dynamicAtmosphereLightingFromSun,T=t.showGroundAtmosphere,E=t.perFragmentGroundAtmosphere,v=t.hasVertexNormals,S=t.useWebMercatorProjection,I=t.enableFog,R=t.enableClippingPlanes,O=t.clippingPlanes,L=t.enableClippingPolygons,_=t.clippingPolygons,C=t.clippedByBoundaries,w=t.hasImageryLayerCutout,D=t.colorCorrect,N=t.highlightFillTile,F=t.colorToAlpha,V=t.hasGeodeticSurfaceNormals,B=t.hasExaggeration,j=t.showUndergroundColor,k=t.translucent,G=i.vectorData,q=G?.show,Q=q&&G.hasPolylines,W=q&&G.hasPolygons,J=q&&t.vectorAntialias,Z=Q&&G.hasMeterWidths,ae=Z&&G.hasPixelWidths,Ae=0,fe="",ge=i.renderedMesh.encoding;ge.quantization===cc.BITS12&&(Ae=1,fe="QUANTIZATION_BITS12");let ve=0,Re="";C&&(ve=1,Re="TILE_LIMIT_RECTANGLE");let Qe=0,He="";w&&(Qe=1,He="APPLY_IMAGERY_CUTOUT");let Ye=n.mode,Ke=((Ye|+o<<2|+s<<3|+a<<4|+c<<5|+u<<6|+f<<7|+g<<8|+m<<9|+y<<10|+A<<11|+b<<12|+x<<13|+T<<14|+E<<15|+v<<16|+S<<17|+I<<18|Ae<<19|+p<<20|+R<<21|+L<<22|ve<<23|Qe<<24|+D<<25|+N<<26|+F<<27|+V<<28|+B<<29|+j<<30|+k<<31)>>>0)+(d?4294967296:0)+(q?8589934592:0)+(Q?17179869184:0)+(W?34359738368:0)+(J?68719476736:0)+(Z?137438953472:0)+(ae?274877906944:0),Pe=0;l(O)&&O.length>0&&(Pe=R?O.clippingPlanesState:0);let qe=0;l(_)&&_.length>0&&(qe=L?_.clippingPolygonsState:0);let st=i.surfaceShader;if(l(st)&&st.numberOfDayTextures===r&&st.flags===Ke&&st.material===this.material&&st.clippingShaderState===Pe&&st.clippingPolygonShaderState===qe)return st.shaderProgram;let vt=this._shadersByTexturesFlags[r];if(l(vt)||(vt=this._shadersByTexturesFlags[r]=[]),st=vt[Ke],!l(st)||st.material!==this.material||st.clippingShaderState!==Pe||st.clippingPolygonShaderState!==qe){let jt=this.baseVertexShaderSource.clone(),lt=this.baseFragmentShaderSource.clone();Pe!==0&<.sources.unshift(GS(O,n.context)),jt.defines.push(fe),lt.defines.push(`TEXTURE_UNITS ${r}`,Re,He),o&<.defines.push("APPLY_BRIGHTNESS"),s&<.defines.push("APPLY_CONTRAST"),a&<.defines.push("APPLY_HUE"),c&<.defines.push("APPLY_SATURATION"),u&<.defines.push("APPLY_GAMMA"),f&<.defines.push("APPLY_ALPHA"),d&<.defines.push("APPLY_DAY_NIGHT_ALPHA"),g&<.defines.push("HAS_WATER_MASK"),m&&(lt.defines.push("SHOW_REFLECTIVE_OCEAN"),jt.defines.push("SHOW_REFLECTIVE_OCEAN")),y&<.defines.push("SHOW_OCEAN_WAVES"),F&<.defines.push("APPLY_COLOR_TO_ALPHA"),j&&(jt.defines.push("UNDERGROUND_COLOR"),lt.defines.push("UNDERGROUND_COLOR")),k&&(jt.defines.push("TRANSLUCENT"),lt.defines.push("TRANSLUCENT")),A&&(v?(jt.defines.push("ENABLE_VERTEX_LIGHTING"),lt.defines.push("ENABLE_VERTEX_LIGHTING")):(jt.defines.push("ENABLE_DAYNIGHT_SHADING"),lt.defines.push("ENABLE_DAYNIGHT_SHADING"))),b&&(jt.defines.push("DYNAMIC_ATMOSPHERE_LIGHTING"),lt.defines.push("DYNAMIC_ATMOSPHERE_LIGHTING"),x&&(jt.defines.push("DYNAMIC_ATMOSPHERE_LIGHTING_FROM_SUN"),lt.defines.push("DYNAMIC_ATMOSPHERE_LIGHTING_FROM_SUN"))),T&&(jt.defines.push("GROUND_ATMOSPHERE"),lt.defines.push("GROUND_ATMOSPHERE"),E&&(jt.defines.push("PER_FRAGMENT_GROUND_ATMOSPHERE"),lt.defines.push("PER_FRAGMENT_GROUND_ATMOSPHERE"))),jt.defines.push("INCLUDE_WEB_MERCATOR_Y"),lt.defines.push("INCLUDE_WEB_MERCATOR_Y"),I&&(jt.defines.push("FOG"),lt.defines.push("FOG")),p&<.defines.push("APPLY_SPLIT"),R&<.defines.push("ENABLE_CLIPPING_PLANES"),L&&(lt.defines.push("ENABLE_CLIPPING_POLYGONS"),_.inverse&<.defines.push("CLIPPING_INVERSE")),D&<.defines.push("COLOR_CORRECT"),N&<.defines.push("HIGHLIGHT_FILL_TILE"),V&&jt.defines.push("GEODETIC_SURFACE_NORMALS"),B&&jt.defines.push("EXAGGERATION"),q&&(lt.defines.push("HAS_VECTOR_LAYER"),Q&<.defines.push("HAS_VECTOR_POLYLINES"),W&<.defines.push("HAS_VECTOR_POLYGONS"),J&<.defines.push("VECTOR_ANTIALIAS"),Z&<.defines.push("VECTOR_WIDTH_IN_METERS"),ae&<.defines.push("VECTOR_WIDTH_MIXED_UNITS")),(q||L)&<.sources.unshift(U_);let mt=` vec4 computeDayColor(vec4 initialColor, vec3 textureCoordinates, float nightBlend) { vec4 color = initialColor; `;w&&(mt+=` vec4 cutoutAndColorResult; @@ -10071,7 +10071,7 @@ Url: ${e._contentHeader.uri}`,r++;let o={text:i.substring(1),position:n,font:`${ nightBlend); `,w&&(mt+=` color = czm_branchFreeTernary(texelUnclipped, cutoutAndColorResult, color); `);mt+=` return color; - }`,lt.sources.push(mt),jt.sources.push(sIt(Ye)),jt.sources.push(aIt(S));let ft=Qt.fromCache({context:n.context,vertexShaderSource:jt,fragmentShaderSource:lt,attributeLocations:ge.getAttributeLocations()});st=vt[Ke]=new dre(r,Ke,this.material,ft,Pe,qe)}return i.surfaceShader=st,st.shaderProgram}destroy(){let t,n,i=this._shadersByTexturesFlags;for(let r in i)if(i.hasOwnProperty(r)){let o=i[r];if(!l(o))continue;for(t in o)o.hasOwnProperty(t)&&(n=o[t],l(n)&&n.shaderProgram.destroy())}return le(this)}};function sIt(e){let t="vec4 getPosition(vec3 position, float height, vec2 textureCoordinates) { return getPosition3DMode(position, height, textureCoordinates); }",n="vec4 getPosition(vec3 position, float height, vec2 textureCoordinates) { return getPositionColumbusViewMode(position, height, textureCoordinates); }",i="vec4 getPosition(vec3 position, float height, vec2 textureCoordinates) { return getPositionMorphingMode(position, height, textureCoordinates); }",r;switch(e){case re.SCENE3D:r=t;break;case re.SCENE2D:case re.COLUMBUS_VIEW:r=n;break;case re.MORPHING:r=i;break}return r}function aIt(e){return e?"float get2DYPositionFraction(vec2 textureCoordinates) { return get2DMercatorYPositionFraction(textureCoordinates); }":"float get2DYPositionFraction(vec2 textureCoordinates) { return get2DGeographicYPositionFraction(textureCoordinates); }"}var UH=hre;var w1e={NONE:-1,PARTIAL:0,FULL:1};Object.freeze(w1e);var ns=w1e;var I1e={START:0,LOADING:1,DONE:2,FAILED:3};Object.freeze(I1e);var uc=I1e;var P1e={FAILED:0,UNLOADED:1,RECEIVING:2,RECEIVED:3,TRANSFORMING:4,TRANSFORMED:5,READY:6};Object.freeze(P1e);var Ur=P1e;var s0=class e{constructor(){ut(this,"request");this.imagery=[],this.waterMaskTexture=void 0,this.waterMaskTranslationAndScale=new se(0,0,1,1),this.terrainData=void 0,this.vectorData=void 0,this.clippingPolygonData=void 0,this.vertexArray=void 0,this.tileBoundingRegion=void 0,this.occludeePointInScaledSpace=new h,this.boundingVolumeSourceTile=void 0,this.boundingVolumeIsFromMesh=!1,this.terrainState=Ur.UNLOADED,this.mesh=void 0,this.fill=void 0,this.pickBoundingSphere=new ue,this.surfaceShader=void 0,this.isClipped=!0,this.clippedByBoundaries=!1}get eligibleForUnloading(){let t=this.terrainState,i=!(t===Ur.RECEIVING||t===Ur.TRANSFORMING),r=this.imagery;for(let o=0,s=r.length;i&&o<s;++o){let a=r[o];i=!l(a.loadingImagery)||a.loadingImagery.state!==jn.TRANSITIONING}return i}get renderedMesh(){if(l(this.vertexArray))return this.mesh;if(l(this.fill))return this.fill.mesh}pick(t,n,i,r,o){if(!l(this.renderedMesh))return;let s=this.renderedMesh.pick(t,r,n,i);return h.clone(s,o)}freeResources(){l(this.waterMaskTexture)&&(--this.waterMaskTexture.referenceCount,this.waterMaskTexture.referenceCount===0&&this.waterMaskTexture.destroy(),this.waterMaskTexture=void 0),l(this.vectorData)&&(Ds.freeResources(this.vectorData),this.vectorData=void 0),l(this.clippingPolygonData)&&(Zc.releaseRectangleData(this.clippingPolygonData),this.clippingPolygonData=void 0),this.terrainData=void 0,this.terrainState=Ur.UNLOADED,this.mesh=void 0,this.fill=this.fill&&this.fill.destroy();let t=this.imagery;for(let n=0,i=t.length;n<i;++n)t[n].freeResources();this.imagery.length=0,this.freeVertexArray()}freeVertexArray(){e._freeVertexArray(this.vertexArray),this.vertexArray=void 0,e._freeVertexArray(this.wireframeVertexArray),this.wireframeVertexArray=void 0}static initialize(t,n,i,r){l(t.data)||(t.data=new e),t.state===uc.START&&(cIt(t,n,i,r),t.state=uc.LOADING)}static processStateMachine(t,n,i,r,o,s,a,c){e.initialize(t,i,r,o);let u=t.data;if(t.state===uc.LOADING&&lIt(t,n,i,r,o,s,a),c)return;let f=t.renderable;t.renderable=l(u.vertexArray);let d=u.terrainState===Ur.READY;t.upsampledFromParent=l(u.terrainData)&&u.terrainData.wasCreatedByUpsampling();let p=u.processImagery(t,i,n);if(d&&p){let g=t._loadedCallbacks,m={};for(let y in g)g.hasOwnProperty(y)&&(g[y](t)||(m[y]=g[y]));t._loadedCallbacks=m,t.state=uc.DONE}f&&(t.renderable=!0)}processImagery(t,n,i,r){let o=t.data,s=t.upsampledFromParent,a=!1,c=!0,u=o.imagery,f,d;for(f=0,d=u.length;f<d;++f){let p=u[f];if(!l(p.loadingImagery)){s=!1;continue}if(p.loadingImagery.state===jn.PLACEHOLDER){let m=p.loadingImagery.imageryLayer;if(m.ready){p.freeResources(),u.splice(f,1),m._createTileImagerySkeletons(t,n,f),--f,d=u.length;continue}else s=!1}let g=p.processStateMachine(t,i,r);c=c&&g,a=a||g||l(p.readyImagery),s=s&&l(p.loadingImagery)&&(p.loadingImagery.state===jn.FAILED||p.loadingImagery.state===jn.INVALID)}return t.upsampledFromParent=s,t.renderable=t.renderable&&(a||c),c}addGeodeticSurfaceNormals(t,n){D1e(this,!0,t,n)}removeGeodeticSurfaceNormals(t){D1e(this,!1,void 0,t)}updateExaggeration(t,n,i){let r=this,o=r.renderedMesh;if(o===void 0)return;let s=n.verticalExaggeration,a=n.verticalExaggerationRelativeHeight,c=s!==1,u=o.encoding,f=u.exaggeration!==s,d=u.exaggerationRelativeHeight!==a;if(f||d){if(f)if(c&&!u.hasGeodeticSurfaceNormals){let g=t.tilingScheme.ellipsoid;r.addGeodeticSurfaceNormals(g,n)}else!c&&u.hasGeodeticSurfaceNormals&&r.removeGeodeticSurfaceNormals(n);if(u.exaggeration=s,u.exaggerationRelativeHeight=a,i!==void 0){i._tileToUpdateHeights.push(t);let g=t.customData;for(let m of g)m.level=-1}o.updateExaggeration(s,a)}}updateSceneMode(t){let i=this.renderedMesh;i!==void 0&&i.updateSceneMode(t)}static _createVertexArrayForMesh(t,n){let i=n.vertices,r=tt.createVertexBuffer({context:t,typedArray:i,usage:Me.STATIC_DRAW}),o=n.encoding.getAttributes(r),s=n.indices.indexBuffers||{},a=s[t.id];if(!l(a)||a.isDestroyed()){let c=n.indices;a=tt.createIndexBuffer({context:t,typedArray:c,usage:Me.STATIC_DRAW,indexDatatype:je.fromSizeInBytes(c.BYTES_PER_ELEMENT)}),a.vertexArrayDestroyable=!1,a.referenceCount=1,s[t.id]=a,n.indices.indexBuffers=s}else++a.referenceCount;return new Vn({context:t,attributes:o,indexBuffer:a})}static _freeVertexArray(t){if(l(t)){let n=t.indexBuffer;t.isDestroyed()||t.destroy(),l(n)&&!n.isDestroyed()&&l(n.referenceCount)&&(--n.referenceCount,n.referenceCount===0&&n.destroy())}}_findAncestorTileWithTerrainData(t){let n=t.parent;for(;l(n)&&(!l(n.data)||!l(n.data.terrainData)||n.data.terrainData.wasCreatedByUpsampling());)n=n.parent;return n}_computeWaterMaskTranslationAndScale(t,n,i){let r=n.rectangle,o=t.rectangle,s=o.width,a=o.height,c=s/r.width,u=a/r.height;return i.x=c*(o.west-r.west)/s,i.y=u*(o.south-r.south)/a,i.z=c,i.w=u,i}};function D1e(e,t,n,i){let r=e.renderedMesh,o=r.vertices,s=r.encoding,a=o.length/s.stride,c=Ro.clone(s);c.hasGeodeticSurfaceNormals=t,c=Ro.clone(c);let u=c.stride,f=new Float32Array(a*u);t?s.addGeodeticSurfaceNormals(o,f,n):s.removeGeodeticSurfaceNormals(o,f),r.vertices=f,r.stride=u,r!==e.mesh?(s0._freeVertexArray(e.fill.vertexArray),e.fill.vertexArray=s0._createVertexArrayForMesh(i.context,r)):(s0._freeVertexArray(e.vertexArray),e.vertexArray=s0._createVertexArrayForMesh(i.context,r)),s0._freeVertexArray(e.wireframeVertexArray),e.wireframeVertexArray=void 0}function cIt(e,t,n,i){let r=t.getTileDataAvailable(e.x,e.y,e.level);if(!l(r)&&l(e.parent)){let s=e.parent,a=s.data;l(a)&&l(a.terrainData)&&(r=a.terrainData.isChildAvailable(s.x,s.y,e.x,e.y))}let o=e.data;r===!1&&(o.terrainState=Ur.FAILED);for(let s=0,a=i.length;s<a;++s){let c=i.get(s);c.show&&c._createTileImagerySkeletons(e,t)}}function lIt(e,t,n,i,r,o,s){let a=e.data,c=e.parent;if(a.terrainState===Ur.FAILED&&c!==void 0){let u=c.data;u!==void 0&&u.terrainData!==void 0&&u.terrainData.canUpsample!==!1||s0.processStateMachine(c,t,n,i,r,o,s,!0)}if(a.terrainState===Ur.FAILED&&uIt(a,e,t,n,e.x,e.y,e.level),a.terrainState===Ur.UNLOADED&&fIt(a,n,e.x,e.y,e.level),a.terrainState===Ur.RECEIVED&&hIt(a,t,n,e.x,e.y,e.level),a.terrainState===Ur.TRANSFORMED&&(mIt(a,t.context,n,e.x,e.y,e.level,s),a.updateExaggeration(e,t,o)),a.terrainState>=Ur.RECEIVED&&a.waterMaskTexture===void 0&&n.hasWaterMask)if(a.terrainData.waterMask!==void 0)gIt(t.context,a);else{let f=a._findAncestorTileWithTerrainData(e),d=f?.data;l(f)&&l(d.waterMaskTexture)&&(a.waterMaskTexture=d.waterMaskTexture,++a.waterMaskTexture.referenceCount,a._computeWaterMaskTranslationAndScale(e,f,a.waterMaskTranslationAndScale))}}function uIt(e,t,n,i,r,o,s){let a=t.parent;if(!a){t.state=uc.FAILED;return}let u=a.data.terrainData,f=a.x,d=a.y,p=a.level;if(!l(u))return;let g=u.upsample(i.tilingScheme,f,d,p,r,o,s);l(g)&&(e.terrainState=Ur.RECEIVING,Promise.resolve(g).then(function(m){l(m)&&(e.terrainData=m,e.terrainState=Ur.RECEIVED)}).catch(function(){e.terrainState=Ur.FAILED}))}function fIt(e,t,n,i,r){function o(c){if(!l(c)){e.terrainState=Ur.UNLOADED,e.request=void 0;return}e.terrainData=c,e.terrainState=Ur.RECEIVED,e.request=void 0}function s(c){if(e.request.state===wi.CANCELLED){e.terrainData=void 0,e.terrainState=Ur.UNLOADED,e.request=void 0;return}e.terrainState=Ur.FAILED,e.request=void 0;let u=`Failed to obtain terrain tile X: ${n} Y: ${i} Level: ${r}. Error message: "${c}"`;t._requestError=no.reportError(t._requestError,t,t.errorEvent,u,n,i,r),t._requestError.retry&&a()}function a(){let c=new Oo({throttle:!1,throttleByServer:!0,type:oa.TERRAIN});e.request=c;let u=t.requestTileGeometry(n,i,r,c);l(u)?(e.terrainState=Ur.RECEIVING,Promise.resolve(u).then(function(f){o(f)}).catch(function(f){s(f)})):(e.terrainState=Ur.UNLOADED,e.request=void 0)}a()}var dIt={tilingScheme:void 0,x:0,y:0,level:0,exaggeration:1,exaggerationRelativeHeight:0,throttle:!0};function hIt(e,t,n,i,r,o){let s=n.tilingScheme,a=dIt;a.tilingScheme=s,a.x=i,a.y=r,a.level=o,a.exaggeration=t.verticalExaggeration,a.exaggerationRelativeHeight=t.verticalExaggerationRelativeHeight,a.throttle=!0;let u=e.terrainData.createMesh(a);l(u)&&(e.terrainState=Ur.TRANSFORMING,Promise.resolve(u).then(function(f){e.mesh=f,e.terrainState=Ur.TRANSFORMED}).catch(function(){e.terrainState=Ur.FAILED}))}function mIt(e,t,n,i,r,o,s){e.vertexArray=s0._createVertexArrayForMesh(t,e.mesh),e.terrainState=Ur.READY,e.fill=e.fill&&e.fill.destroy(s)}function pIt(e){let t=e.cache.tile_waterMaskData;if(!l(t)){let n=Dt.create({context:e,pixelFormat:$e.LUMINANCE,pixelDatatype:ze.UNSIGNED_BYTE,source:{arrayBufferView:new Uint8Array([255]),width:1,height:1}});n.referenceCount=1;let i=new Ht({wrapS:hn.CLAMP_TO_EDGE,wrapT:hn.CLAMP_TO_EDGE,minificationFilter:Wt.LINEAR,magnificationFilter:Jn.LINEAR});t={allWaterTexture:n,sampler:i,destroy:function(){this.allWaterTexture.destroy()}},e.cache.tile_waterMaskData=t}return t}function gIt(e,t){let n=t.terrainData.waterMask,i=pIt(e),r,o=n.length;if(n instanceof ImageBitmap)r=Dt.create({context:e,source:n,sampler:i.sampler,flipY:!1,skipColorSpaceConversion:!0});else if(o===1)if(n[0]!==0)r=i.allWaterTexture;else return;else{let s=Math.sqrt(o);r=Dt.create({context:e,pixelFormat:$e.LUMINANCE,pixelDatatype:ze.UNSIGNED_BYTE,source:{width:s,height:s,arrayBufferView:n},sampler:i.sampler,flipY:!1}),r.referenceCount=0}++r.referenceCount,t.waterMaskTexture=r,se.fromElements(0,0,1,1,t.waterMaskTranslationAndScale)}var gm=s0;var _It={WEST:0,NORTH:1,EAST:2,SOUTH:3,NORTHWEST:4,NORTHEAST:5,SOUTHWEST:6,SOUTHEAST:7},In=_It;var R1e={NONE:0,CULLED:1,RENDERED:2,REFINED:3,RENDERED_AND_KICKED:6,REFINED_AND_KICKED:7,CULLED_BUT_NEEDED:9,wasKicked:function(e){return e>=R1e.RENDERED_AND_KICKED},originalResult:function(e){return e&3},kick:function(e){return e|4}},gi=R1e;function Uw(e){this.tile=e,this.frameLastUpdated=void 0,this.westMeshes=[],this.westTiles=[],this.southMeshes=[],this.southTiles=[],this.eastMeshes=[],this.eastTiles=[],this.northMeshes=[],this.northTiles=[],this.southwestMesh=void 0,this.southwestTile=void 0,this.southeastMesh=void 0,this.southeastTile=void 0,this.northwestMesh=void 0,this.northwestTile=void 0,this.northeastMesh=void 0,this.northeastTile=void 0,this.changedThisFrame=!0,this.visitedFrame=void 0,this.enqueuedFrame=void 0,this.mesh=void 0,this.vertexArray=void 0,this.waterMaskTexture=void 0,this.waterMaskTranslationAndScale=new se}Uw.prototype.update=function(e,t,n){this.changedThisFrame&&(k1e(e,t,this.tile,n),this.changedThisFrame=!1)};Uw.prototype.destroy=function(e){this._destroyVertexArray(e),l(this.waterMaskTexture)&&(--this.waterMaskTexture.referenceCount,this.waterMaskTexture.referenceCount===0&&this.waterMaskTexture.destroy(),this.waterMaskTexture=void 0)};Uw.prototype._destroyVertexArray=function(e){l(this.vertexArray)&&(l(e)?e.push(this.vertexArray):gm._freeVertexArray(this.vertexArray),this.vertexArray=void 0)};var yIt=new rx;Uw.updateFillTiles=function(e,t,n,i){let r=e._quadtree,o=r._levelZeroTiles,s=r._lastSelectionFrameNumber,a=yIt;a.clear();for(let u=0;u<t.length;++u){let f=t[u];l(f.data.vertexArray)&&a.enqueue(t[u])}let c=a.dequeue();for(;c!==void 0;){let u=c.findTileToWest(o),f=c.findTileToSouth(o),d=c.findTileToEast(o),p=c.findTileToNorth(o);ba(e,n,c,u,s,In.EAST,!1,a,i),ba(e,n,c,f,s,In.NORTH,!1,a,i),ba(e,n,c,d,s,In.WEST,!1,a,i),ba(e,n,c,p,s,In.SOUTH,!1,a,i);let g=u.findTileToNorth(o),m=u.findTileToSouth(o),y=d.findTileToNorth(o),A=d.findTileToSouth(o);ba(e,n,c,g,s,In.SOUTHEAST,!1,a,i),ba(e,n,c,y,s,In.SOUTHWEST,!1,a,i),ba(e,n,c,m,s,In.NORTHEAST,!1,a,i),ba(e,n,c,A,s,In.NORTHWEST,!1,a,i),c=a.dequeue()}};function ba(e,t,n,i,r,o,s,a,c){if(i===void 0)return;let u=i;for(;u&&(u._lastSelectionResultFrame!==r||gi.wasKicked(u._lastSelectionResult)||gi.originalResult(u._lastSelectionResult)===gi.CULLED);){if(s)return;let f=u.parent;if(o>=In.NORTHWEST&&f!==void 0)switch(o){case In.NORTHWEST:u=u===f.northwestChild?f:void 0;break;case In.NORTHEAST:u=u===f.northeastChild?f:void 0;break;case In.SOUTHWEST:u=u===f.southwestChild?f:void 0;break;case In.SOUTHEAST:u=u===f.southeastChild?f:void 0;break}else u=f}if(u!==void 0){if(u._lastSelectionResult===gi.RENDERED){if(l(u.data.vertexArray))return;AIt(e,t,n,u,o,r,a,c);return}if(gi.originalResult(i._lastSelectionResult)!==gi.CULLED)switch(o){case In.WEST:ba(e,t,n,i.northwestChild,r,o,!0,a,c),ba(e,t,n,i.southwestChild,r,o,!0,a,c);break;case In.EAST:ba(e,t,n,i.southeastChild,r,o,!0,a,c),ba(e,t,n,i.northeastChild,r,o,!0,a,c);break;case In.SOUTH:ba(e,t,n,i.southwestChild,r,o,!0,a,c),ba(e,t,n,i.southeastChild,r,o,!0,a,c);break;case In.NORTH:ba(e,t,n,i.northeastChild,r,o,!0,a,c),ba(e,t,n,i.northwestChild,r,o,!0,a,c);break;case In.NORTHWEST:ba(e,t,n,i.northwestChild,r,o,!0,a,c);break;case In.NORTHEAST:ba(e,t,n,i.northeastChild,r,o,!0,a,c);break;case In.SOUTHWEST:ba(e,t,n,i.southwestChild,r,o,!0,a,c);break;case In.SOUTHEAST:ba(e,t,n,i.southeastChild,r,o,!0,a,c);break;default:throw new pe("Invalid edge")}}}function AIt(e,t,n,i,r,o,s,a){let c=i.data;if(c.fill===void 0)c.fill=new Uw(i);else if(c.fill.visitedFrame===o)return;c.fill.enqueuedFrame!==o&&(c.fill.enqueuedFrame=o,c.fill.changedThisFrame=!1,s.enqueue(i)),bIt(e,t,n,i,r,a)}function bIt(e,t,n,i,r,o){let s=i.data.fill,a,c=n.data.fill;l(c)?(c.visitedFrame=t.frameNumber,c.changedThisFrame&&(k1e(e,t,n,o),c.changedThisFrame=!1),a=n.data.fill.mesh):a=n.data.mesh;let u,f;switch(r){case In.WEST:u=s.westMeshes,f=s.westTiles;break;case In.SOUTH:u=s.southMeshes,f=s.southTiles;break;case In.EAST:u=s.eastMeshes,f=s.eastTiles;break;case In.NORTH:u=s.northMeshes,f=s.northTiles;break;case In.NORTHWEST:s.changedThisFrame=s.changedThisFrame||s.northwestMesh!==a,s.northwestMesh=a,s.northwestTile=n;return;case In.NORTHEAST:s.changedThisFrame=s.changedThisFrame||s.northeastMesh!==a,s.northeastMesh=a,s.northeastTile=n;return;case In.SOUTHWEST:s.changedThisFrame=s.changedThisFrame||s.southwestMesh!==a,s.southwestMesh=a,s.southwestTile=n;return;case In.SOUTHEAST:s.changedThisFrame=s.changedThisFrame||s.southeastMesh!==a,s.southeastMesh=a,s.southeastTile=n;return}if(n.level<=i.level){s.changedThisFrame=s.changedThisFrame||u[0]!==a||u.length!==1,u[0]=a,f[0]=n,u.length=1,f.length=1;return}let d,p,g,m,y=n.rectangle,A,b=i.rectangle;switch(r){case In.WEST:for(A=(b.north-b.south)*P.EPSILON5,d=0;d<f.length&&(g=f[d],m=g.rectangle,!P.greaterThan(y.north,m.south,A));++d);for(p=d;p<f.length&&(g=f[p],m=g.rectangle,!P.greaterThanOrEquals(y.south,m.north,A));++p);break;case In.SOUTH:for(A=(b.east-b.west)*P.EPSILON5,d=0;d<f.length&&(g=f[d],m=g.rectangle,!P.lessThan(y.west,m.east,A));++d);for(p=d;p<f.length&&(g=f[p],m=g.rectangle,!P.lessThanOrEquals(y.east,m.west,A));++p);break;case In.EAST:for(A=(b.north-b.south)*P.EPSILON5,d=0;d<f.length&&(g=f[d],m=g.rectangle,!P.lessThan(y.south,m.north,A));++d);for(p=d;p<f.length&&(g=f[p],m=g.rectangle,!P.lessThanOrEquals(y.north,m.south,A));++p);break;case In.NORTH:for(A=(b.east-b.west)*P.EPSILON5,d=0;d<f.length&&(g=f[d],m=g.rectangle,!P.greaterThan(y.east,m.west,A));++d);for(p=d;p<f.length&&(g=f[p],m=g.rectangle,!P.greaterThanOrEquals(y.west,m.east,A));++p);break}p-d===1?(s.changedThisFrame=s.changedThisFrame||u[d]!==a,u[d]=a,f[d]=n):(s.changedThisFrame=!0,u.splice(d,p-d,a),f.splice(d,p-d,n))}var PT=new he,xIt=new he,kw=new h,_re=new h,mre=new U,pre=new U,Ff=new U;function qH(){this.height=0,this.encodedNormal=new U}function zH(e,t,n,i,r,o,s,a,c){if(l(r))return r;let u;if(l(o)&&l(s))u=(o.height+s.height)*.5;else if(l(o))u=o.height;else if(l(s))u=s.height;else if(l(a))u=a.height;else{let d=e.tile.data.tileBoundingRegion,p=0,g=0;l(d)&&(p=d.minimumHeight,g=d.maximumHeight),u=(p+g)*.5}return U1e(e,t,n,i,u,c),c}var TIt={minimumHeight:0,maximumHeight:0},EIt=new h,O1e=new qH,M1e=new qH,N1e=new qH,L1e=new qH,CIt=typeof Uint8Array<"u"?new Uint8Array(81):void 0,vIt={tilingScheme:void 0,x:0,y:0,level:0,exaggeration:1,exaggerationRelativeHeight:0};function k1e(e,t,n,i){gm.initialize(n,e.terrainProvider,e.vectorProvider,e._imageryLayers);let r=n.data,o=r.fill,s=n.rectangle,a=t.verticalExaggeration,c=t.verticalExaggerationRelativeHeight,u=a!==1,f=n.tilingScheme.ellipsoid,d=jH(o,f,0,1,o.northwestTile,o.northwestMesh,o.northTiles,o.northMeshes,o.westTiles,o.westMeshes,N1e),p=jH(o,f,0,0,o.southwestTile,o.southwestMesh,o.westTiles,o.westMeshes,o.southTiles,o.southMeshes,O1e),g=jH(o,f,1,0,o.southeastTile,o.southeastMesh,o.southTiles,o.southMeshes,o.eastTiles,o.eastMeshes,M1e),m=jH(o,f,1,1,o.northeastTile,o.northeastMesh,o.eastTiles,o.eastMeshes,o.northTiles,o.northMeshes,L1e);d=zH(o,f,0,1,d,p,m,g,N1e),p=zH(o,f,0,0,p,d,g,m,O1e),g=zH(o,f,1,1,g,p,m,d,M1e),m=zH(o,f,1,1,m,g,d,p,L1e);let y=p.height,A=g.height,b=d.height,x=m.height,T=Math.min(y,A,b,x),E=Math.max(y,A,b,x),v=(T+E)*.5,S,I,R=e.getLevelMaximumGeometricError(n.level),O=f.maximumRadius-R,L=Math.acos(O/f.maximumRadius)*4;if(L*=1.5,s.width>L&&E-T<=R){let w=new ll({width:9,height:9,buffer:CIt,structure:{heightOffset:E}}),D=vIt;D.tilingScheme=n.tilingScheme,D.x=n.x,D.y=n.y,D.level=n.level,D.exaggeration=a,D.exaggerationRelativeHeight=c,o.mesh=w._createMeshSync(D)}else{let w=u,D=ie.center(s,xIt);D.height=v;let N=f.cartographicToCartesian(D,EIt),F=new Ro(N,void 0,void 0,void 0,void 0,!0,!0,w,a,c),V=5,B;for(B=o.westMeshes,S=0,I=B.length;S<I;++S)V+=B[S].eastIndicesNorthToSouth.length;for(B=o.southMeshes,S=0,I=B.length;S<I;++S)V+=B[S].northIndicesWestToEast.length;for(B=o.eastMeshes,S=0,I=B.length;S<I;++S)V+=B[S].westIndicesSouthToNorth.length;for(B=o.northMeshes,S=0,I=B.length;S<I;++S)V+=B[S].southIndicesEastToWest.length;let j=TIt;j.minimumHeight=T,j.maximumHeight=E;let k=F.stride,G=new Float32Array(V*k),q=0,Q=q;q=VH(f,s,F,G,q,0,1,d.height,d.encodedNormal,1,j),q=GH(o,f,F,G,q,o.westTiles,o.westMeshes,In.EAST,j);let W=q;q=VH(f,s,F,G,q,0,0,p.height,p.encodedNormal,0,j),q=GH(o,f,F,G,q,o.southTiles,o.southMeshes,In.NORTH,j);let J=q;q=VH(f,s,F,G,q,1,0,g.height,g.encodedNormal,0,j),q=GH(o,f,F,G,q,o.eastTiles,o.eastMeshes,In.WEST,j);let Z=q;q=VH(f,s,F,G,q,1,1,m.height,m.encodedNormal,1,j),q=GH(o,f,F,G,q,o.northTiles,o.northMeshes,In.SOUTH,j),T=j.minimumHeight,E=j.maximumHeight;let ae=en.fromRectangle(s,T,E,n.tilingScheme.ellipsoid),Ae=Ti.geodeticLatitudeToMercatorAngle(s.south),fe=1/(Ti.geodeticLatitudeToMercatorAngle(s.north)-Ae),xe=(Ti.geodeticLatitudeToMercatorAngle(D.latitude)-Ae)*fe,ge=f.geodeticSurfaceNormalCartographic(PT,_re),we=cn.octEncode(ge,mre),ve=q;F.encode(G,q*k,ae.center,U.fromElements(.5,.5,Ff),v,we,xe,ge),++q;let Re=q,Qe=Re<256?1:2,He=(Re-1)*3,Ye=He*Qe,Ke=(G.length-Re*k)*Float32Array.BYTES_PER_ELEMENT,Pe;if(Ke>=Ye){let mt=Re*k*Float32Array.BYTES_PER_ELEMENT;Pe=Re<256?new Uint8Array(G.buffer,mt,He):new Uint16Array(G.buffer,mt,He)}else Pe=Re<256?new Uint8Array(He):new Uint16Array(He);G=new Float32Array(G.buffer,0,Re*k);let qe=0;for(S=0;S<Re-2;++S)Pe[qe++]=ve,Pe[qe++]=S,Pe[qe++]=S+1;Pe[qe++]=ve,Pe[qe++]=S,Pe[qe]=0;let st=[];for(S=W;S>=Q;--S)st.push(S);let vt=[];for(S=J;S>=W;--S)vt.push(S);let jt=[];for(S=Z;S>=J;--S)jt.push(S);let lt=[];for(lt.push(0),S=ve-1;S>=Z;--S)lt.push(S);o.mesh=new Ic(F.center,G,Pe,He,Re,T,E,s,ue.fromOrientedBoundingBox(ae),OIt(e,ae.center,s,T,E),F.stride,ae,F,st,vt,jt,lt)}let _=t.context;o._destroyVertexArray(i),o.vertexArray=gm._createVertexArrayForMesh(_,o.mesh),r.processImagery(n,e.terrainProvider,t,!0);let C=o.waterMaskTexture;if(o.waterMaskTexture=void 0,e.terrainProvider.hasWaterMask){let w=r._findAncestorTileWithTerrainData(n);l(w)&&l(w.data.waterMaskTexture)&&(o.waterMaskTexture=w.data.waterMaskTexture,++o.waterMaskTexture.referenceCount,r._computeWaterMaskTranslationAndScale(n,w,o.waterMaskTranslationAndScale))}l(C)&&(--C.referenceCount,C.referenceCount===0&&C.destroy())}function VH(e,t,n,i,r,o,s,a,c,u,f){let d=PT;d.longitude=P.lerp(t.west,t.east,o),d.latitude=P.lerp(t.south,t.north,s),d.height=a;let p=e.cartographicToCartesian(d,kw),g;n.hasGeodeticSurfaceNormals&&(g=e.geodeticSurfaceNormal(p,_re));let m=pre;return m.x=o,m.y=s,n.encode(i,r*n.stride,p,m,a,c,u,g),f.minimumHeight=Math.min(f.minimumHeight,a),f.maximumHeight=Math.max(f.maximumHeight,a),r+1}var WH=new ie;function DO(e,t,n,i){let r=e.rectangle,o=t.rectangle;t.x===0&&n.x===1&&e.x===e.tilingScheme.getNumberOfXTilesAtLevel(e.level)-1?(r=ie.clone(e.rectangle,WH),r.west-=P.TWO_PI,r.east-=P.TWO_PI):e.x===0&&n.x===0&&t.x===t.tilingScheme.getNumberOfXTilesAtLevel(t.level)-1&&(r=ie.clone(e.rectangle,WH),r.west+=P.TWO_PI,r.east+=P.TWO_PI);let s=r.east-r.west,a=(o.west-r.west)/s,c=(o.east-r.west)/s,u=r.north-r.south,f=(o.south-r.south)/u,d=(o.north-r.south)/u,p=(n.x-a)/(c-a),g=(n.y-f)/(d-f);return Math.abs(p)<Math.EPSILON5?p=0:Math.abs(p-1)<Math.EPSILON5&&(p=1),Math.abs(g)<Math.EPSILON5?g=0:Math.abs(g-1)<Math.EPSILON5&&(g=1),i.x=p,i.y=g,i}var SIt=new U;function gre(e,t,n,i,r){let o=e.encoding,s=e.vertices;if(r.height=o.decodeHeight(s,t),o.hasVertexNormals)o.getOctEncodedNormal(s,t,r.encodedNormal);else{let a=r.encodedNormal;a.x=0,a.y=0}}var wIt=new U,IIt=new h;function PIt(e,t,n,i,r,o,s,a,c,u){let f=i.encoding,d=i.vertices,p=DO(t,n,f.decodeTextureCoordinates(d,r,Ff),Ff),g=DO(t,n,f.decodeTextureCoordinates(d,o,pre),pre),m;c?m=(s-p.x)/(g.x-p.x):m=(a-p.y)/(g.y-p.y);let y=f.decodeHeight(d,r),A=f.decodeHeight(d,o),b=n.rectangle;PT.longitude=P.lerp(b.west,b.east,s),PT.latitude=P.lerp(b.south,b.north,a),u.height=PT.height=P.lerp(y,A,m);let x;if(f.hasVertexNormals){let T=f.getOctEncodedNormal(d,r,SIt),E=f.getOctEncodedNormal(d,o,wIt),v=cn.octDecode(T.x,T.y,kw),S=cn.octDecode(E.x,E.y,IIt);x=h.lerp(v,S,m,kw),h.normalize(x,x),cn.octEncode(x,u.encodedNormal)}else x=e.geodeticSurfaceNormalCartographic(PT,kw),cn.octEncode(x,u.encodedNormal)}function U1e(e,t,n,i,r,o){o.height=r;let s=t.geodeticSurfaceNormalCartographic(PT,kw);cn.octEncode(s,o.encodedNormal)}function jH(e,t,n,i,r,o,s,a,c,u,f){if(B1e(e,t,a,s,!1,n,i,f)||B1e(e,t,u,c,!0,n,i,f))return f;let p;if(yre(r,o))return n===0?i===0?p=o.eastIndicesNorthToSouth[0]:p=o.southIndicesEastToWest[0]:i===0?p=o.northIndicesWestToEast[0]:p=o.westIndicesSouthToNorth[0],gre(o,p,n,i,f),f;let g;if(n===0?i===0?g=HH(e.westMeshes,e.westTiles,In.EAST,e.southMeshes,e.southTiles,In.NORTH,n,i):g=HH(e.northMeshes,e.northTiles,In.SOUTH,e.westMeshes,e.westTiles,In.EAST,n,i):i===0?g=HH(e.southMeshes,e.southTiles,In.NORTH,e.eastMeshes,e.eastTiles,In.WEST,n,i):g=HH(e.eastMeshes,e.eastTiles,In.WEST,e.northMeshes,e.northTiles,In.SOUTH,n,i),l(g))return U1e(e,t,n,i,g,f),f}function HH(e,t,n,i,r,o,s,a){let c=F1e(e,t,!1,n,s,a),u=F1e(i,r,!0,o,s,a);return l(c)&&l(u)?(c+u)*.5:l(c)?c:u}function GH(e,t,n,i,r,o,s,a,c){for(let u=0;u<o.length;++u)r=DIt(e,t,n,i,r,o[u],s[u],a,c);return r}function DIt(e,t,n,i,r,o,s,a,c){let u;a===In.EAST&&e.tile.x===0?(u=ie.clone(o.rectangle,WH),u.west-=P.TWO_PI,u.east-=P.TWO_PI):a===In.WEST&&o.x===0&&(u=ie.clone(o.rectangle,WH),u.west+=P.TWO_PI,u.east+=P.TWO_PI);let f=e.tile.rectangle,d,p;r>0&&(n.decodeTextureCoordinates(i,r-1,Ff),d=Ff.x,p=Ff.y);let g,m;switch(a){case In.WEST:g=s.westIndicesSouthToNorth,m=!1;break;case In.NORTH:g=s.northIndicesWestToEast,m=!0;break;case In.EAST:g=s.eastIndicesNorthToSouth,m=!1;break;case In.SOUTH:g=s.southIndicesEastToWest,m=!0;break}let y=o,A=e.tile,b=s.encoding,x=s.vertices,T=n.stride,E,v;b.hasWebMercatorT&&(E=Ti.geodeticLatitudeToMercatorAngle(f.south),v=1/(Ti.geodeticLatitudeToMercatorAngle(f.north)-E));for(let S=0;S<g.length;++S){let I=g[S],R=b.decodeTextureCoordinates(x,I,Ff);DO(y,A,R,R);let O=R.x,L=R.y,_=m?O:L;if(_<0||_>1||Math.abs(O-d)<P.EPSILON5&&Math.abs(L-p)<P.EPSILON5)continue;let C=Math.abs(O)<P.EPSILON5||Math.abs(O-1)<P.EPSILON5,w=Math.abs(L)<P.EPSILON5||Math.abs(L-1)<P.EPSILON5;if(C&&w)continue;let D=b.decodePosition(x,I,kw),N=b.decodeHeight(x,I),F;b.hasVertexNormals?F=b.getOctEncodedNormal(x,I,mre):(F=mre,F.x=0,F.y=0);let V=L;if(b.hasWebMercatorT){let j=P.lerp(f.south,f.north,L);V=(Ti.geodeticLatitudeToMercatorAngle(j)-E)*v}let B;n.hasGeodeticSurfaceNormals&&(B=t.geodeticSurfaceNormal(D,_re)),n.encode(i,r*T,D,R,N,F,V,B),c.minimumHeight=Math.min(c.minimumHeight,N),c.maximumHeight=Math.max(c.maximumHeight,N),++r}return r}function F1e(e,t,n,i,r,o){let s,a,c;n?(s=0,a=e.length,c=1):(s=e.length-1,a=-1,c=-1);for(let u=s;u!==a;u+=c){let f=e[u],d=t[u];if(!yre(d,f))continue;let p;switch(i){case In.WEST:p=f.westIndicesSouthToNorth;break;case In.SOUTH:p=f.southIndicesEastToWest;break;case In.EAST:p=f.eastIndicesNorthToSouth;break;case In.NORTH:p=f.northIndicesWestToEast;break}let g=p[n?0:p.length-1];if(l(g))return f.encoding.decodeHeight(f.vertices,g)}}function yre(e,t){return l(t)&&(!l(e.data.fill)||!e.data.fill.changedThisFrame)}function B1e(e,t,n,i,r,o,s,a){let c,u,f,d,p,g=i[r?0:n.length-1],m=n[r?0:n.length-1];if(yre(g,m)&&(o===0?s===0?(c=r?m.northIndicesWestToEast:m.eastIndicesNorthToSouth,u=r,f=r):(c=r?m.eastIndicesNorthToSouth:m.southIndicesEastToWest,u=!r,f=!1):s===0?(c=r?m.westIndicesSouthToNorth:m.northIndicesWestToEast,u=!r,f=!0):(c=r?m.southIndicesEastToWest:m.westIndicesSouthToNorth,u=r,f=!r),c.length>0)){d=r?0:c.length-1,p=c[d],m.encoding.decodeTextureCoordinates(m.vertices,p,Ff);let y=DO(g,e.tile,Ff,Ff);if(y.x===o&&y.y===s)return gre(m,p,o,s,a),!0;if(d=Pr(c,u?o:s,function(A,b){m.encoding.decodeTextureCoordinates(m.vertices,A,Ff);let x=DO(g,e.tile,Ff,Ff);return f?u?x.x-o:x.y-s:u?o-x.x:s-x.y}),d<0){if(d=~d,d>0&&d<c.length)return PIt(t,g,e.tile,m,c[d-1],c[d],o,s,u,a),!0}else return gre(m,c[d],o,s,a),!0}return!1}var RIt=[new h,new h,new h,new h];function OIt(e,t,n,i,r,o){let s=e.quadtree._occluders.ellipsoid,a=s.ellipsoid,c=RIt;return h.fromRadians(n.west,n.south,r,a,c[0]),h.fromRadians(n.east,n.south,r,a,c[1]),h.fromRadians(n.west,n.north,r,a,c[2]),h.fromRadians(n.east,n.north,r,a,c[3]),s.computeHorizonCullingPointPossiblyUnderEllipsoid(t,c,i,o)}var RO=Uw;var Are=class e{constructor(t){this.lightingFadeOutDistance=65e5,this.lightingFadeInDistance=9e6,this.hasWaterMask=!1,this.showWaterEffect=!1,this.oceanNormalMap=void 0,this.zoomedOutOceanSpecularIntensity=.5,this.enableLighting=!1,this.dynamicAtmosphereLighting=!1,this.dynamicAtmosphereLightingFromSun=!1,this.showGroundAtmosphere=!1,this.shadows=Dn.RECEIVE_ONLY,this.vertexShadowDarkness=.3,this.fillHighlightColor=void 0,this.hueShift=0,this.saturationShift=0,this.brightnessShift=0,this.showSkirts=!0,this.backFaceCulling=!0,this.undergroundColor=void 0,this.undergroundColorAlphaByDistance=void 0,this.lambertDiffuseMultiplier=0,this.materialUniformMap=void 0,this._materialUniformMap=void 0,this._quadtree=void 0,this._terrainProvider=t.terrainProvider,this._vectorProvider=t.vectorProvider,this._imageryLayers=t.imageryLayers,this._surfaceShaderSet=t.surfaceShaderSet,this._renderState=void 0,this._blendRenderState=void 0,this._disableCullingRenderState=void 0,this._disableCullingBlendRenderState=void 0,this._errorEvent=new be,this._removeLayerAddedListener=this._imageryLayers.layerAdded.addEventListener(e.prototype._onLayerAdded,this),this._removeLayerRemovedListener=this._imageryLayers.layerRemoved.addEventListener(e.prototype._onLayerRemoved,this),this._removeLayerMovedListener=this._imageryLayers.layerMoved.addEventListener(e.prototype._onLayerMoved,this),this._removeLayerShownListener=this._imageryLayers.layerShownOrHidden.addEventListener(e.prototype._onLayerShownOrHidden,this),this._imageryLayersUpdatedEvent=new be,this._layerOrderChanged=!1,this._tilesToRenderByTextureCount=[],this._drawCommands=[],this._uniformMaps=[],this._usedDrawCommands=0,this._vertexArraysToDestroy=[],this._debug={wireframe:!1,boundingSphereTile:void 0,tilesRendered:0,texturesRendered:0},this._baseColor=void 0,this._firstPassInitialColor=void 0,this.baseColor=new z(0,0,.5,1),this._clippingPlanes=void 0,this._clippingPolygons=void 0,this._clippingPolygonsDirty=!1,this._removeClippingPolygonAdded=void 0,this._removeClippingPolygonRemoved=void 0,this.cartographicLimitRectangle=ie.clone(ie.MAX_VALUE),this._hasLoadedTilesThisFrame=!1,this._hasFillTilesThisFrame=!1,this._oldVerticalExaggeration=void 0,this._oldVerticalExaggerationRelativeHeight=void 0,this._oldSceneMode=re.SCENE3D}get baseColor(){return this._baseColor}set baseColor(t){this._baseColor=t,this._firstPassInitialColor=se.fromColor(t,this._firstPassInitialColor)}get quadtree(){return this._quadtree}set quadtree(t){this._quadtree=t}get tilingScheme(){if(l(this._terrainProvider))return this._terrainProvider.tilingScheme}get errorEvent(){return this._errorEvent}get imageryLayersUpdatedEvent(){return this._imageryLayersUpdatedEvent}get terrainProvider(){return this._terrainProvider}set terrainProvider(t){this._terrainProvider!==t&&(this._terrainProvider=t,l(this._quadtree)&&this._quadtree.invalidateAllTiles())}get vectorProvider(){return this._vectorProvider}get clippingPlanes(){return this._clippingPlanes}set clippingPlanes(t){Ps.setOwner(t,this,"_clippingPlanes")}get clippingPolygons(){return this._clippingPolygons}set clippingPolygons(t){if(t===this._clippingPolygons||(Zc.setOwner(t,this,"_clippingPolygons"),this._removeClippingPolygonAdded=this._removeClippingPolygonAdded&&this._removeClippingPolygonAdded(),this._removeClippingPolygonRemoved=this._removeClippingPolygonRemoved&&this._removeClippingPolygonRemoved(),this._clippingPolygonsDirty=!0,!l(t)))return;let n=()=>{this._clippingPolygonsDirty=!0};this._removeClippingPolygonAdded=t.polygonAdded.addEventListener(n),this._removeClippingPolygonRemoved=t.polygonRemoved.addEventListener(n)}update(t){this._imageryLayers._update()}initialize(t){this._imageryLayers.queueReprojectionCommands(t),this._layerOrderChanged&&(this._layerOrderChanged=!1,this._quadtree.forEachLoadedTile(function(o){o.data.imagery.sort(LIt)}));let n=this._vectorProvider;n.minimumTileScreenPixels=NIt(this),n.update(t.frameNumber),this._quadtree.forEachRenderedTile(o=>{let s=o.data;l(s.vectorData)?s.vectorData=n.updateTileData(o.x,o.y,o.level,t.context,s.vectorData,We.CLAMP_TO_TERRAIN):s.vectorData=n.requestTileData(o.x,o.y,o.level,t.context,We.CLAMP_TO_TERRAIN)}),n.makeClean(),UIt(this,t);let i=this._vertexArraysToDestroy,r=i.length;for(let o=0;o<r;++o)gm._freeVertexArray(i[o]);i.length=0}beginUpdate(t){let n=this._tilesToRenderByTextureCount;for(let o=0,s=n.length;o<s;++o){let a=n[o];l(a)&&(a.length=0)}let i=this._clippingPlanes;l(i)&&i.enabled&&i.update(t);let r=this._clippingPolygons;l(r)&&r.enabled&&r.update(t),this._usedDrawCommands=0,this._hasLoadedTilesThisFrame=!1,this._hasFillTilesThisFrame=!1}endUpdate(t){if(!l(this._renderState)){this._renderState=Ge.fromCache({cull:{enabled:!0},depthTest:{enabled:!0,func:yc.LESS}}),this._blendRenderState=Ge.fromCache({cull:{enabled:!0},depthTest:{enabled:!0,func:yc.LESS_OR_EQUAL},blending:nn.ALPHA_BLEND});let c=Ze(this._renderState,!0);c.cull.enabled=!1,this._disableCullingRenderState=Ge.fromCache(c),c=Ze(this._blendRenderState,!0),c.cull.enabled=!1,this._disableCullingBlendRenderState=Ge.fromCache(c)}this._hasFillTilesThisFrame&&this._hasLoadedTilesThisFrame&&RO.updateFillTiles(this,this._quadtree._tilesToRender,t,this._vertexArraysToDestroy);let n=this.quadtree,i=t.verticalExaggeration,r=t.verticalExaggerationRelativeHeight,o=this._oldVerticalExaggeration!==i||this._oldVerticalExaggerationRelativeHeight!==r;this._oldVerticalExaggeration=i,this._oldVerticalExaggerationRelativeHeight=r,o&&n.forEachLoadedTile(function(c){c.data.updateExaggeration(c,t,n)});let s=this._oldSceneMode!==t.mode;this._oldSceneMode=t.mode,s&&n.forEachLoadedTile(function(c){c.data.updateSceneMode(t.mode)}),this._clippingPolygonsDirty&&FIt(this);let a=this._tilesToRenderByTextureCount;for(let c=0,u=a.length;c<u;++c){let f=a[c];if(l(f))for(let d=0,p=f.length;d<p;++d){let g=f[d],m=g.data;BIt(this,g,m,t);let y=m.tileBoundingRegion;lPt(this,g,t),t.minimumTerrainHeight=Math.min(t.minimumTerrainHeight,y.minimumHeight)}}}updateForPick(t){let n=this._drawCommands;for(let i=0,r=this._usedDrawCommands;i<r;++i){let o=n[i];o.dirty=!0,o.derivedCommands.picking=void 0;let s=o.derivedCommands.logDepth?.command;l(s)&&(s.derivedCommands.picking=void 0),G1e(o,t)}}cancelReprojections(){this._imageryLayers.cancelReprojections()}getLevelMaximumGeometricError(t){return l(this._terrainProvider)?this._terrainProvider.getLevelMaximumGeometricError(t):0}loadTile(t,n){let i=n.data,r=!0,o;l(i)&&(r=i.boundingVolumeSourceTile!==n||n._lastSelectionResult===gi.CULLED_BUT_NEEDED,o=i.terrainState),gm.processStateMachine(n,t,this.terrainProvider,this.vectorProvider,this._imageryLayers,this.quadtree,this._vertexArraysToDestroy,r),i=n.data,r&&o!==i.terrainState&&this.computeTileVisibility(n,t,this.quadtree.occluders)!==ns.NONE&&i.boundingVolumeSourceTile===n&&(r=!1,gm.processStateMachine(n,t,this.terrainProvider,this.vectorProvider,this._imageryLayers,this.quadtree,this._vertexArraysToDestroy,r))}computeTileVisibility(t,n,i){let r=this.computeDistanceToTile(t,n);t._distance=r;let o=q1e(this,n);if(n.fog.enabled&&!o&&P.fog(r,n.fog.density)>=1)return ns.NONE;let s=t.data,a=s.tileBoundingRegion;if(s.boundingVolumeSourceTile===void 0)return ns.PARTIAL;let c=n.cullingVolume,u=a.boundingVolume;l(u)||(u=a.boundingSphere),s.clippedByBoundaries=!1;let f=XH(t.rectangle,this.cartographicLimitRectangle),d=ie.simpleIntersection(f,t.rectangle,W1e);if(!l(d))return ns.NONE;if(ie.equals(d,t.rectangle)||(s.clippedByBoundaries=!0),n.mode!==re.SCENE3D&&(u=zIt,ue.fromRectangleWithHeights2D(t.rectangle,n.mapProjection,a.minimumHeight,a.maximumHeight,u),h.fromElements(u.center.z,u.center.x,u.center.y,u.center),n.mode===re.MORPHING&&l(s.renderedMesh)&&(u=ue.union(a.boundingSphere,u,u))),!l(u))return ns.PARTIAL;let p=this._clippingPlanes;if(l(p)&&p.enabled){let b=p.computeIntersectionWithBoundingVolume(u);if(t.isClipped=b!==$t.INSIDE,b===$t.OUTSIDE)return ns.NONE}let g=this._clippingPolygons;if(l(g)&&g.enabled){let b=g.computeIntersectionWithBoundingVolume(a);t.isClipped=b!==$t.OUTSIDE}let m,y=c.computeVisibility(u);if(y===$t.OUTSIDE?m=ns.NONE:y===$t.INTERSECTING?m=ns.PARTIAL:y===$t.INSIDE&&(m=ns.FULL),m===ns.NONE)return m;let A=n.mode===re.SCENE3D&&n.camera.frustum instanceof _n;if(n.mode===re.SCENE3D&&!A&&l(i)&&!o){let b=s.occludeePointInScaledSpace;return!l(b)||i.ellipsoid.isScaledSpacePointVisiblePossiblyUnderEllipsoid(b,a.minimumHeight)?m:ns.NONE}return m}canRefine(t){let n=t.data;return l(n.terrainData)?!0:this.terrainProvider.getTileDataAvailable(t.x*2,t.y*2,t.level+1)!==void 0}canRenderWithoutLosingDetail(t){let n=t.data,i=HIt;i.length=this._imageryLayers.length;let r=!1,o=!1,s;l(n)&&(r=n.terrainState===Ur.READY,o=!0,s=n.imagery);let a,c;for(a=0,c=i.length;a<c;++a)i[a]=o;if(l(s))for(a=0,c=s.length;a<c;++a){let d=s[a],p=d.loadingImagery,g=!l(p)||p.state===jn.FAILED||p.state===jn.INVALID,m=(d.loadingImagery||d.readyImagery).imageryLayer._layerIndex;i[m]=g&&i[m]}let u=this.quadtree._lastSelectionFrameNumber,f=GIt;for(f.length=0,f.push(t.southwestChild,t.southeastChild,t.northwestChild,t.northeastChild);f.length>0;){let d=f.pop(),p=d._lastSelectionResultFrame===u?d._lastSelectionResult:gi.NONE;if(p===gi.RENDERED){let g=d.data;if(!l(g))continue;if(!r&&d.data.terrainState===Ur.READY)return!1;let m=d.data.imagery;for(a=0,c=m.length;a<c;++a){let y=m[a],A=y.loadingImagery,b=!l(A)||A.state===jn.FAILED||A.state===jn.INVALID,x=(y.loadingImagery||y.readyImagery).imageryLayer._layerIndex;if(b&&!i[x])return!1}}else p===gi.REFINED&&f.push(d.southwestChild,d.southeastChild,d.northwestChild,d.northeastChild)}return!0}computeTileLoadPriority(t,n){let i=t.data;if(i===void 0)return 0;let r=i.tileBoundingRegion.boundingVolume;if(r===void 0)return 0;let o=n.camera.positionWC,s=n.camera.directionWC,a=h.subtract(r.center,o,WIt),c=h.magnitude(a);return c<P.EPSILON5?0:(h.divideByScalar(a,c,a),(1-h.dot(a,s))*t._distance)}showTileThisFrame(t,n){let i=0,r=t.data,o=r.imagery;for(let c=0,u=o.length;c<u;++c){let f=o[c];l(f.readyImagery)&&f.readyImagery.imageryLayer.alpha!==0&&++i}let s=this._tilesToRenderByTextureCount[i];l(s)||(s=[],this._tilesToRenderByTextureCount[i]=s),s.push(t),l(r.vertexArray)?this._hasLoadedTilesThisFrame=!0:this._hasFillTilesThisFrame=!0;let a=this._debug;++a.tilesRendered,a.texturesRendered+=i}computeDistanceToTile(t,n){QIt(t,this,n);let i=t.data;if(i.boundingVolumeSourceTile===void 0)return 9999999999;let o=i.tileBoundingRegion,s=o.minimumHeight,a=o.maximumHeight;if(i.boundingVolumeSourceTile!==t){let u=n.camera.positionCartographic.height,f=Math.abs(u-s),d=Math.abs(u-a);f>d?(o.minimumHeight=s,o.maximumHeight=s):(o.minimumHeight=a,o.maximumHeight=a)}let c=o.distanceToCamera(n);return o.minimumHeight=s,o.maximumHeight=a,c}isDestroyed(){return!1}destroy(){return this._tileProvider=this._tileProvider&&this._tileProvider.destroy(),this._clippingPlanes=this._clippingPlanes&&this._clippingPlanes.destroy(),this._clippingPolygons=void 0,this._removeLayerAddedListener=this._removeLayerAddedListener&&this._removeLayerAddedListener(),this._removeLayerRemovedListener=this._removeLayerRemovedListener&&this._removeLayerRemovedListener(),this._removeLayerMovedListener=this._removeLayerMovedListener&&this._removeLayerMovedListener(),this._removeLayerShownListener=this._removeLayerShownListener&&this._removeLayerShownListener(),this._removeClippingPolygonAdded=this._removeClippingPolygonAdded&&this._removeClippingPolygonAdded(),this._removeClippingPolygonRemoved=this._removeClippingPolygonRemoved&&this._removeClippingPolygonRemoved(),le(this)}_onLayerAdded(t,n){if(!this.isDestroyed()&&t.show){let i=this._terrainProvider,r=this,o=this._imageryLayersUpdatedEvent,s=function(){t._imageryCache={},r._quadtree.forEachLoadedTile(function(a){if(l(a._loadedCallbacks[t._layerIndex]))return;let c,u=a.data.imagery,f=u.length,d=-1,p=0;for(c=0;c<f;++c){let m=u[c];if((m.readyImagery??m.loadingImagery).imageryLayer===t)d===-1&&(d=c),++p;else if(d!==-1)break}if(d===-1)return;let g=d+p;t._createTileImagerySkeletons(a,i,g)&&(a._loadedCallbacks[t._layerIndex]=ePt(p,t,i),a.state=uc.LOADING)})};if(t.ready){let a=t.imageryProvider;a._reload=s}this._quadtree.forEachLoadedTile(function(a){t._createTileImagerySkeletons(a,i)&&(a.state=uc.LOADING,a.level!==0&&(a._lastSelectionResultFrame!==r.quadtree._lastSelectionFrameNumber||a._lastSelectionResult!==gi.RENDERED)&&(a.renderable=!1))}),this._layerOrderChanged=!0,o.raiseEvent()}}_onLayerRemoved(t,n){this._quadtree.forEachLoadedTile(function(i){let r=i.data.imagery,o=-1,s=0;for(let a=0,c=r.length;a<c;++a){let u=r[a],f=u.loadingImagery;if(l(f)||(f=u.readyImagery),f.imageryLayer===t)o===-1&&(o=a),u.freeResources(),++s;else if(o!==-1)break}o!==-1&&r.splice(o,s)}),l(t.imageryProvider)&&(t.imageryProvider._reload=void 0),this._imageryLayersUpdatedEvent.raiseEvent()}_onLayerMoved(t,n,i){this._layerOrderChanged=!0,this._imageryLayersUpdatedEvent.raiseEvent()}_onLayerShownOrHidden(t,n,i){i?this._onLayerAdded(t,n):this._onLayerRemoved(t,n)}},MIt=new ie;function NIt(e){let t=e.getLevelMaximumGeometricError(0);if(t<=0)return e._vectorProvider.minimumTileScreenPixels;let n=e.tilingScheme;return n.tileXYToRectangle(0,0,0,MIt).width*n.ellipsoid.maximumRadius/t*e._quadtree.maximumScreenSpaceError/2}function LIt(e,t){let n=e.loadingImagery;l(n)||(n=e.readyImagery);let i=t.loadingImagery;return l(i)||(i=t.readyImagery),n.imageryLayer._layerIndex-i.imageryLayer._layerIndex}function FIt(e){e._quadtree.forEachLoadedTile(function(t){let n=t.data;l(n?.clippingPolygonData)&&(Zc.releaseRectangleData(n.clippingPolygonData),n.clippingPolygonData=void 0)}),e._clippingPolygonsDirty=!1}function BIt(e,t,n,i){let r=e._clippingPolygons;!l(r)||!r.enabled||!t.isClipped||l(n.clippingPolygonData)||(n.clippingPolygonData=r.requestRectangleData(t.rectangle,i.context))}function kIt(e,t){let n=e._clippingPolygons;return l(n)&&n.enabled&&n.length>0&&n.inverse&&(t.clippingPolygonData?.polygonRings.length??0)===0}function UIt(e,t){let n=t.creditDisplay,i=e._terrainProvider;l(i)&&l(i.credit)&&n.addCreditToNextFrame(i.credit);let r=e._imageryLayers;for(let o=0,s=r.length;o<s;++o){let a=r.get(o);a.ready&&a.show&&l(a.imageryProvider.credit)&&n.addCreditToNextFrame(a.imageryProvider.credit)}}function G1e(e,t){let n=t.globeTranslucencyState;if(n.translucent){let i=e.renderState.blending.enabled;n.pushDerivedCommands(e,i,t)}else t.commandList.push(e)}var zIt=new ue,W1e=new ie,VIt=new ie,jIt=new he;function XH(e,t){if(t.west<t.east)return t;let n=ie.clone(t,VIt);return ie.center(e,jIt).longitude>0?n.east=P.PI:n.west=-P.PI,n}function q1e(e,t){if(t.cameraUnderground||t.globeTranslucencyState.translucent)return!0;if(e.backFaceCulling)return!1;let n=e._clippingPlanes;if(l(n)&&n.enabled)return!0;let i=e._clippingPolygons;return!!(l(i)&&i.enabled||!ie.equals(e.cartographicLimitRectangle,ie.MAX_VALUE))}var HIt=[],GIt=[],WIt=new h,z1e=new M,YH=new M,qIt=new se,YIt=new se,XIt=new se,KIt=new h,V1e=new h,$It=new h,JIt=new h,ZIt=[new h,new h,new h,new h];function j1e(e,t,n,i,r,o){let s=e.quadtree._occluders.ellipsoid,a=s.ellipsoid,c=ZIt;return h.fromRadians(n.west,n.south,r,a,c[0]),h.fromRadians(n.east,n.south,r,a,c[1]),h.fromRadians(n.west,n.north,r,a,c[2]),h.fromRadians(n.east,n.north,r,a,c[3]),s.computeHorizonCullingPointPossiblyUnderEllipsoid(t,c,i,o)}function QIt(e,t,n){let i=e.data;i===void 0&&(i=e.data=new gm);let r=e.tilingScheme.ellipsoid;i.tileBoundingRegion===void 0&&(i.tileBoundingRegion=new Md({computeBoundingVolumes:!1,rectangle:e.rectangle,ellipsoid:r,minimumHeight:0,maximumHeight:0}));let o=i.tileBoundingRegion,s=o.minimumHeight,a=o.maximumHeight,c=!1,u=e,f=i.mesh,d=i.terrainData;if(f!==void 0&&f.minimumHeight!==void 0&&f.maximumHeight!==void 0)o.minimumHeight=f.minimumHeight,o.maximumHeight=f.maximumHeight,c=!0;else if(d!==void 0&&d._minimumHeight!==void 0&&d._maximumHeight!==void 0)o.minimumHeight=d._minimumHeight,o.maximumHeight=d._maximumHeight;else{o.minimumHeight=Number.NaN,o.maximumHeight=Number.NaN;let p=e.parent;for(;p!==void 0;){let g=p.data;if(g!==void 0){let m=g.mesh,y=g.terrainData;if(m!==void 0&&m.minimumHeight!==void 0&&m.maximumHeight!==void 0){o.minimumHeight=m.minimumHeight,o.maximumHeight=m.maximumHeight;break}else if(y!==void 0&&y._minimumHeight!==void 0&&y._maximumHeight!==void 0){o.minimumHeight=y._minimumHeight,o.maximumHeight=y._maximumHeight;break}}p=p.parent}u=p}if(u!==void 0){let p=n.verticalExaggeration,g=n.verticalExaggerationRelativeHeight;if(p!==1&&(c=!1,o.minimumHeight=br.getHeight(o.minimumHeight,p,g),o.maximumHeight=br.getHeight(o.maximumHeight,p,g)),c)i.boundingVolumeIsFromMesh||(o._orientedBoundingBox=en.clone(f.orientedBoundingBox,o._orientedBoundingBox),o._boundingSphere=ue.clone(f.boundingSphere3D,o._boundingSphere),i.occludeePointInScaledSpace=h.clone(f.occludeePointInScaledSpace,i.occludeePointInScaledSpace),l(i.occludeePointInScaledSpace)||(i.occludeePointInScaledSpace=j1e(t,o._orientedBoundingBox.center,e.rectangle,o.minimumHeight,o.maximumHeight,i.occludeePointInScaledSpace)));else{let y=o._orientedBoundingBox===void 0||o._boundingSphere===void 0;(o.minimumHeight!==s||o.maximumHeight!==a||y)&&(o.computeBoundingVolumes(r),i.occludeePointInScaledSpace=j1e(t,o._orientedBoundingBox.center,e.rectangle,o.minimumHeight,o.maximumHeight,i.occludeePointInScaledSpace))}i.boundingVolumeSourceTile=u,i.boundingVolumeIsFromMesh=c}else i.boundingVolumeSourceTile=void 0,i.boundingVolumeIsFromMesh=!1}function ePt(e,t,n){return function(i){let r,o,s=-1,a=i.data.imagery,c=a.length,u;for(u=0;u<c;++u)if(r=a[u],o=r.readyImagery??r.loadingImagery,o.imageryLayer===t){s=u;break}if(s!==-1){let f=s+e;if(r=a[f],o=l(r)?r.readyImagery??r.loadingImagery:void 0,!l(o)||o.imageryLayer!==t)return!t._createTileImagerySkeletons(i,n,f);for(u=s;u<f;++u)a[u].freeResources();a.splice(s,e)}return!0}}var tPt=new M,nPt=new M;function H1e(e,t){let n={u_initialColor:function(){return this.properties.initialColor},u_fillHighlightColor:function(){return this.properties.fillHighlightColor},u_zoomedOutOceanSpecularIntensity:function(){return this.properties.zoomedOutOceanSpecularIntensity},u_oceanNormalMap:function(){return this.properties.oceanNormalMap},u_atmosphereLightIntensity:function(){return this.properties.atmosphereLightIntensity},u_atmosphereRayleighCoefficient:function(){return this.properties.atmosphereRayleighCoefficient},u_atmosphereMieCoefficient:function(){return this.properties.atmosphereMieCoefficient},u_atmosphereRayleighScaleHeight:function(){return this.properties.atmosphereRayleighScaleHeight},u_atmosphereMieScaleHeight:function(){return this.properties.atmosphereMieScaleHeight},u_atmosphereMieAnisotropy:function(){return this.properties.atmosphereMieAnisotropy},u_lightingFadeDistance:function(){return this.properties.lightingFadeDistance},u_nightFadeDistance:function(){return this.properties.nightFadeDistance},u_center3D:function(){return this.properties.center3D},u_verticalExaggerationAndRelativeHeight:function(){return this.properties.verticalExaggerationAndRelativeHeight},u_tileRectangle:function(){return this.properties.tileRectangle},u_modifiedModelView:function(){let i=e.context.uniformState.view,r=M.multiplyByPoint(i,this.properties.rtc,V1e);return M.setTranslation(i,r,z1e),z1e},u_modifiedModelViewProjection:function(){let i=e.context.uniformState.view,r=e.context.uniformState.projection,o=M.multiplyByPoint(i,this.properties.rtc,V1e);return M.setTranslation(i,o,YH),M.multiply(r,YH,YH),YH},u_dayTextures:function(){return this.properties.dayTextures},u_dayTextureTranslationAndScale:function(){return this.properties.dayTextureTranslationAndScale},u_dayTextureTexCoordsRectangle:function(){return this.properties.dayTextureTexCoordsRectangle},u_dayTextureUseWebMercatorT:function(){return this.properties.dayTextureUseWebMercatorT},u_dayTextureAlpha:function(){return this.properties.dayTextureAlpha},u_dayTextureNightAlpha:function(){return this.properties.dayTextureNightAlpha},u_dayTextureDayAlpha:function(){return this.properties.dayTextureDayAlpha},u_dayTextureBrightness:function(){return this.properties.dayTextureBrightness},u_dayTextureContrast:function(){return this.properties.dayTextureContrast},u_dayTextureHue:function(){return this.properties.dayTextureHue},u_dayTextureSaturation:function(){return this.properties.dayTextureSaturation},u_dayTextureOneOverGamma:function(){return this.properties.dayTextureOneOverGamma},u_dayIntensity:function(){return this.properties.dayIntensity},u_southAndNorthLatitude:function(){return this.properties.southAndNorthLatitude},u_southMercatorYAndOneOverHeight:function(){return this.properties.southMercatorYAndOneOverHeight},u_waterMask:function(){return this.properties.waterMask},u_waterMaskTranslationAndScale:function(){return this.properties.waterMaskTranslationAndScale},u_minMaxHeight:function(){return this.properties.minMaxHeight},u_scaleAndBias:function(){return this.properties.scaleAndBias},u_dayTextureSplit:function(){return this.properties.dayTextureSplit},u_dayTextureCutoutRectangles:function(){return this.properties.dayTextureCutoutRectangles},u_clippingPlanes:function(){let i=t._clippingPlanes;return l(i)&&l(i.texture)?i.texture:e.context.defaultTexture},u_cartographicLimitRectangle:function(){return this.properties.localizedCartographicLimitRectangle},u_clippingPlanesMatrix:function(){let i=t._clippingPlanes,r=l(i)?M.multiply(e.context.uniformState.view,i.modelMatrix,tPt):M.IDENTITY;return M.inverseTranspose(r,nPt)},u_clippingPlanesEdgeStyle:function(){let i=this.properties.clippingPlanesEdgeColor;return i.alpha=this.properties.clippingPlanesEdgeWidth,i},u_minimumBrightness:function(){return e.fog.minimumBrightness},u_hsbShift:function(){return this.properties.hsbShift},u_colorsToAlpha:function(){return this.properties.colorsToAlpha},u_frontFaceAlphaByDistance:function(){return this.properties.frontFaceAlphaByDistance},u_backFaceAlphaByDistance:function(){return this.properties.backFaceAlphaByDistance},u_translucencyRectangle:function(){return this.properties.localizedTranslucencyRectangle},u_undergroundColor:function(){return this.properties.undergroundColor},u_undergroundColorAlphaByDistance:function(){return this.properties.undergroundColorAlphaByDistance},u_lambertDiffuseMultiplier:function(){return this.properties.lambertDiffuseMultiplier},u_vertexShadowDarkness:function(){return this.properties.vertexShadowDarkness},u_vectorSegmentTexture:function(){return this.properties.vectorSegmentTexture??e.context.defaultTexture},u_vectorWidthTexture:function(){return this.properties.vectorWidthTexture??e.context.defaultTexture},u_vectorColorTexture:function(){return this.properties.vectorColorTexture??e.context.defaultTexture},u_vectorPickColorTexture:function(){return this.properties.vectorPickColorTexture??e.context.defaultTexture},u_vectorSegmentPrimitiveIndicesTexture:function(){return this.properties.vectorSegmentPrimitiveIndicesTexture??e.context.defaultTexture},u_vectorGridCellIndicesTexture:function(){return this.properties.vectorGridCellIndicesTexture??e.context.defaultTexture},u_vectorPolygonEdgeTexture:function(){return this.properties.vectorPolygonEdgeTexture??e.context.defaultTexture},u_vectorPolygonEdgePrimitiveIndicesTexture:function(){return this.properties.vectorPolygonEdgePrimitiveIndicesTexture??e.context.defaultTexture},u_vectorPolygonGridCellIndicesTexture:function(){return this.properties.vectorPolygonGridCellIndicesTexture??e.context.defaultTexture},u_vectorMetersPerUv:function(){return this.properties.vectorMetersPerUv},u_clippingEdgeTexture:function(){return this.properties.clippingEdgeTexture??e.context.defaultTexture},u_clippingEdgePrimitiveIndicesTexture:function(){return this.properties.clippingEdgePrimitiveIndicesTexture??e.context.defaultTexture},u_clippingGridCellIndicesTexture:function(){return this.properties.clippingGridCellIndicesTexture??e.context.defaultTexture},properties:{initialColor:new se(0,0,.5,1),fillHighlightColor:new z(0,0,0,0),zoomedOutOceanSpecularIntensity:.5,oceanNormalMap:void 0,lightingFadeDistance:new U(65e5,9e6),nightFadeDistance:new U(1e7,4e7),atmosphereLightIntensity:10,atmosphereRayleighCoefficient:new h(55e-7,13e-6,284e-7),atmosphereMieCoefficient:new h(21e-6,21e-6,21e-6),atmosphereRayleighScaleHeight:1e4,atmosphereMieScaleHeight:3200,atmosphereMieAnisotropy:.9,hsbShift:new h,center3D:void 0,rtc:new h,modifiedModelView:new M,tileRectangle:new se,verticalExaggerationAndRelativeHeight:new U(1,0),dayTextures:[],dayTextureTranslationAndScale:[],dayTextureTexCoordsRectangle:[],dayTextureUseWebMercatorT:[],dayTextureAlpha:[],dayTextureNightAlpha:[],dayTextureDayAlpha:[],dayTextureBrightness:[],dayTextureContrast:[],dayTextureHue:[],dayTextureSaturation:[],dayTextureOneOverGamma:[],dayTextureSplit:[],dayTextureCutoutRectangles:[],dayIntensity:0,colorsToAlpha:[],southAndNorthLatitude:new U,southMercatorYAndOneOverHeight:new U,waterMask:void 0,waterMaskTranslationAndScale:new se,minMaxHeight:new U,scaleAndBias:new M,clippingPlanesEdgeColor:z.clone(z.WHITE),clippingPlanesEdgeWidth:0,localizedCartographicLimitRectangle:new se,frontFaceAlphaByDistance:new se,backFaceAlphaByDistance:new se,localizedTranslucencyRectangle:new se,undergroundColor:z.clone(z.TRANSPARENT),undergroundColorAlphaByDistance:new se,lambertDiffuseMultiplier:0,vertexShadowDarkness:0,vectorSegmentTexture:void 0,vectorWidthTexture:void 0,vectorColorTexture:void 0,vectorPickColorTexture:void 0,vectorSegmentPrimitiveIndicesTexture:void 0,vectorGridCellIndicesTexture:void 0,vectorPolygonEdgeTexture:void 0,vectorPolygonEdgePrimitiveIndicesTexture:void 0,vectorPolygonGridCellIndicesTexture:void 0,vectorMetersPerUv:new U,clippingEdgeTexture:void 0,clippingEdgePrimitiveIndicesTexture:void 0,clippingGridCellIndicesTexture:void 0}};return l(t.materialUniformMap)?Mt(n,t.materialUniformMap):n}function iPt(e,t){let n=t.data,i,r;if(l(n.vertexArray)?(i=n.mesh,r=n.vertexArray):l(n.fill)&&l(n.fill.vertexArray)&&(i=n.fill.mesh,r=n.fill.vertexArray),!(!l(i)||!l(r))){if(l(n.wireframeVertexArray)){if(n.wireframeVertexArray.mesh===i)return;n.wireframeVertexArray.destroy(),n.wireframeVertexArray=void 0}n.wireframeVertexArray=rPt(e,r,i),n.wireframeVertexArray.mesh=i}}function rPt(e,t,n){let r={indices:n.indices,primitiveType:Oe.TRIANGLES};Wn.toWireframe(r);let o=r.indices,s=tt.createIndexBuffer({context:e,typedArray:o,usage:Me.STATIC_DRAW,indexDatatype:je.fromSizeInBytes(o.BYTES_PER_ELEMENT)});return new Vn({context:e,attributes:t._attributes,indexBuffer:s})}var Y1e,X1e,KH;(function(){let e=new Bt({geometry:Jm.fromDimensions({dimensions:new h(2,2,2)})}),t=new Bt({geometry:new qy({radius:1})}),n=new M,i,r;function o(s){return new Mn({geometryInstances:s,appearance:new An({translucent:!1,flat:!0}),asynchronous:!1})}Y1e=function(s,a){return s===i||(KH(),i=s,n=M.fromRotationTranslation(s.halfAxes,s.center,n),e.modelMatrix=n,e.attributes.color=Jt.fromColor(a),r=o(e)),r},X1e=function(s,a){return s===i||(KH(),i=s,n=M.fromTranslation(s.center,n),n=M.multiplyByUniformScale(n,s.radius,n),t.modelMatrix=n,t.attributes.color=Jt.fromColor(a),r=o(t)),r},KH=function(){l(r)&&(r.destroy(),r=void 0,i=void 0)}})();var oPt=new se(0,0,0,0),sPt={frameState:void 0,surfaceTile:void 0,numberOfDayTextures:void 0,applyBrightness:void 0,applyContrast:void 0,applyHue:void 0,applySaturation:void 0,applyGamma:void 0,applyAlpha:void 0,applyDayNightAlpha:void 0,applySplit:void 0,showReflectiveOcean:void 0,showOceanWaves:void 0,enableLighting:void 0,dynamicAtmosphereLighting:void 0,dynamicAtmosphereLightingFromSun:void 0,showGroundAtmosphere:void 0,perFragmentGroundAtmosphere:void 0,hasVertexNormals:void 0,useWebMercatorProjection:void 0,enableFog:void 0,enableClippingPlanes:void 0,clippingPlanes:void 0,enableClippingPolygons:void 0,clippingPolygons:void 0,clippedByBoundaries:void 0,hasImageryLayerCutout:void 0,colorCorrect:void 0,colorToAlpha:void 0,hasGeodeticSurfaceNormals:void 0,hasExaggeration:void 0,vectorAntialias:void 0},aPt=z.TRANSPARENT,cPt=new qt;function lPt(e,t,n){let i=t.data;if(kIt(e,i))return;l(i.vertexArray)||(i.fill===void 0&&(i.fill=new RO(t)),i.fill.update(e,n));let r=n.creditDisplay,o=i.terrainData;if(l(o)&&l(o.credits)){let mt=o.credits;for(let ft=0,Yt=mt.length;ft<Yt;++ft)r.addCreditToNextFrame(mt[ft])}let s=Ut.maximumTextureImageUnits,a=i.waterMaskTexture,c=i.waterMaskTranslationAndScale;!l(a)&&l(i.fill)&&(a=i.fill.waterMaskTexture,c=i.fill.waterMaskTranslationAndScale);let u=n.cameraUnderground,f=n.globeTranslucencyState,d=f.translucent,p=f.frontFaceAlphaByDistance,g=f.backFaceAlphaByDistance,m=f.rectangle,y=e.undergroundColor??aPt,A=e.undergroundColorAlphaByDistance??cPt,b=q1e(e,n)&&n.mode===re.SCENE3D&&y.alpha>0&&(A.nearValue>0||A.farValue>0),x=e.lambertDiffuseMultiplier,T=e.vertexShadowDarkness,E=e.hasWaterMask&&l(a),v=E&&e.showWaterEffect,S=e.oceanNormalMap,I=v&&l(S),R=e.terrainProvider,O=l(R)&&e.terrainProvider.hasVertexNormals,L=n.fog.enabled&&n.fog.renderable&&!u,_=e.showGroundAtmosphere&&n.mode===re.SCENE3D,C=Dn.castShadows(e.shadows)&&!d,w=Dn.receiveShadows(e.shadows)&&!d,D=e.hueShift,N=e.saturationShift,F=e.brightnessShift,V=!(P.equalsEpsilon(D,0,P.EPSILON7)&&P.equalsEpsilon(N,0,P.EPSILON7)&&P.equalsEpsilon(F,0,P.EPSILON7)),B=!1;if(_){let mt=h.magnitude(n.camera.positionWC),ft=e.nightFadeOutDistance;B=mt>ft}E&&--s,I&&--s,l(n.shadowState)&&n.shadowState.shadowsEnabled&&--s,l(e.clippingPlanes)&&e.clippingPlanes.enabled&&--s,l(e.clippingPolygons)&&e.clippingPolygons.enabled&&(s-=3),s-=f.numberOfTextureUniforms;let j=i.renderedMesh,k=j.center,G=j.encoding,q=i.tileBoundingRegion,Q=n.verticalExaggeration,W=n.verticalExaggerationRelativeHeight,J=Q!==1,Z=G.hasGeodeticSurfaceNormals,ae=qIt,Ae=0,fe=0,xe=0,ge=0,we=!1;if(n.mode!==re.SCENE3D){let mt=n.mapProjection,ft=mt.project(ie.southwest(t.rectangle),$It),Yt=mt.project(ie.northeast(t.rectangle),JIt);if(ae.x=ft.x,ae.y=ft.y,ae.z=Yt.x,ae.w=Yt.y,n.mode!==re.MORPHING&&(k=KIt,k.x=0,k.y=(ae.z+ae.x)*.5,k.z=(ae.w+ae.y)*.5,ae.x-=k.y,ae.y-=k.z,ae.z-=k.y,ae.w-=k.z),n.mode===re.SCENE2D&&G.quantization===lc.BITS12){let rt=1/(Math.pow(2,12)-1)*.5,ht=(ae.z-ae.x)*rt,Li=(ae.w-ae.y)*rt;ae.x-=ht,ae.y-=Li,ae.z+=ht,ae.w+=Li}mt instanceof Ti&&(Ae=t.rectangle.south,fe=t.rectangle.north,xe=Ti.geodeticLatitudeToMercatorAngle(Ae),ge=1/(Ti.geodeticLatitudeToMercatorAngle(fe)-xe),we=!0)}let ve=sPt;ve.frameState=n,ve.surfaceTile=i,ve.hasWaterMask=E,ve.showReflectiveOcean=v,ve.showOceanWaves=I,ve.enableLighting=e.enableLighting,ve.dynamicAtmosphereLighting=e.dynamicAtmosphereLighting,ve.dynamicAtmosphereLightingFromSun=e.dynamicAtmosphereLightingFromSun,ve.showGroundAtmosphere=_,ve.atmosphereLightIntensity=e.atmosphereLightIntensity,ve.atmosphereRayleighCoefficient=e.atmosphereRayleighCoefficient,ve.atmosphereMieCoefficient=e.atmosphereMieCoefficient,ve.atmosphereRayleighScaleHeight=e.atmosphereRayleighScaleHeight,ve.atmosphereMieScaleHeight=e.atmosphereMieScaleHeight,ve.atmosphereMieAnisotropy=e.atmosphereMieAnisotropy,ve.perFragmentGroundAtmosphere=B,ve.hasVertexNormals=O,ve.useWebMercatorProjection=we,ve.clippedByBoundaries=i.clippedByBoundaries,ve.hasGeodeticSurfaceNormals=Z,ve.hasExaggeration=J,ve.vectorAntialias=e.vectorProvider.antialias;let Re=i.imagery,Qe=0,He=Re.length,Ye=e.showSkirts&&!u&&!d,Ke=e.backFaceCulling&&!u&&!d,Pe=Ke?e._renderState:e._disableCullingRenderState,qe=Ke?e._blendRenderState:e._disableCullingBlendRenderState,st=Pe,vt=e._firstPassInitialColor,jt=n.context;if(l(e._debug.boundingSphereTile)||KH(),e._materialUniformMap!==e.materialUniformMap){e._materialUniformMap=e.materialUniformMap;let mt=e._drawCommands.length;for(let ft=0;ft<mt;++ft)e._uniformMaps[ft]=H1e(n,e)}do{let mt=0,ft,Yt;if(e._drawCommands.length<=e._usedDrawCommands?(ft=new at,ft.owner=t,ft.cull=!1,ft.boundingVolume=new ue,ft.orientedBoundingBox=void 0,Yt=H1e(n,e),e._drawCommands.push(ft),e._uniformMaps.push(Yt)):(ft=e._drawCommands[e._usedDrawCommands],Yt=e._uniformMaps[e._usedDrawCommands]),ft.owner=t,++e._usedDrawCommands,t===e._debug.boundingSphereTile){let Es=q.boundingVolume,Ha=q.boundingSphere;l(Es)?Y1e(Es,z.RED).update(n):l(Ha)&&X1e(Ha,z.RED).update(n)}let rt=Yt.properties;se.clone(vt,rt.initialColor),rt.oceanNormalMap=S,rt.lightingFadeDistance.x=e.lightingFadeOutDistance,rt.lightingFadeDistance.y=e.lightingFadeInDistance,rt.nightFadeDistance.x=e.nightFadeOutDistance,rt.nightFadeDistance.y=e.nightFadeInDistance,rt.atmosphereLightIntensity=e.atmosphereLightIntensity,rt.atmosphereRayleighCoefficient=e.atmosphereRayleighCoefficient,rt.atmosphereMieCoefficient=e.atmosphereMieCoefficient,rt.atmosphereRayleighScaleHeight=e.atmosphereRayleighScaleHeight,rt.atmosphereMieScaleHeight=e.atmosphereMieScaleHeight,rt.atmosphereMieAnisotropy=e.atmosphereMieAnisotropy,rt.zoomedOutOceanSpecularIntensity=e.zoomedOutOceanSpecularIntensity;let ht=u?g:p,Li=u?p:g;l(ht)&&(se.fromElements(ht.near,ht.nearValue,ht.far,ht.farValue,rt.frontFaceAlphaByDistance),se.fromElements(Li.near,Li.nearValue,Li.far,Li.farValue,rt.backFaceAlphaByDistance)),se.fromElements(A.near,A.nearValue,A.far,A.farValue,rt.undergroundColorAlphaByDistance),z.clone(y,rt.undergroundColor),rt.lambertDiffuseMultiplier=x,rt.vertexShadowDarkness=T;let Yn=!l(i.vertexArray)&&l(e.fillHighlightColor)&&e.fillHighlightColor.alpha>0;Yn&&z.clone(e.fillHighlightColor,rt.fillHighlightColor),rt.verticalExaggerationAndRelativeHeight.x=Q,rt.verticalExaggerationAndRelativeHeight.y=W,rt.center3D=j.center,h.clone(k,rt.rtc),se.clone(ae,rt.tileRectangle),rt.southAndNorthLatitude.x=Ae,rt.southAndNorthLatitude.y=fe,rt.southMercatorYAndOneOverHeight.x=xe,rt.southMercatorYAndOneOverHeight.y=ge;let yi=YIt,zi=XH(t.rectangle,e.cartographicLimitRectangle),Si=XIt,ui=XH(t.rectangle,m);h.fromElements(D,N,F,rt.hsbShift);let Ai=t.rectangle,zn=1/Ai.width,tn=1/Ai.height;yi.x=(zi.west-Ai.west)*zn,yi.y=(zi.south-Ai.south)*tn,yi.z=(zi.east-Ai.west)*zn,yi.w=(zi.north-Ai.south)*tn,se.clone(yi,rt.localizedCartographicLimitRectangle),Si.x=(ui.west-Ai.west)*zn,Si.y=(ui.south-Ai.south)*tn,Si.z=(ui.east-Ai.west)*zn,Si.w=(ui.north-Ai.south)*tn,se.clone(Si,rt.localizedTranslucencyRectangle);let Hn=L&&P.fog(t._distance,n.fog.density)>P.EPSILON3;V=V&&(Hn||_);let Ki=!1,wr=!1,so=!1,Ts=!1,zs=!1,$r=!1,pi=!1,ao=!1,nr=!1,jo=!1;for(;mt<s&&Qe<He;){let Es=Re[Qe],Ha=Es.readyImagery;if(++Qe,!l(Ha)||Ha.imageryLayer.alpha===0)continue;let ub=Es.useWebMercatorT?Ha.textureWebMercator:Ha.texture,ii=Ha.imageryLayer;l(Es.textureTranslationAndScale)||(Es.textureTranslationAndScale=ii._calculateTextureTranslationAndScale(t,Es)),rt.dayTextures[mt]=ub,rt.dayTextureTranslationAndScale[mt]=Es.textureTranslationAndScale,rt.dayTextureTexCoordsRectangle[mt]=Es.textureCoordinateRectangle,rt.dayTextureUseWebMercatorT[mt]=Es.useWebMercatorT,rt.dayTextureAlpha[mt]=ii.alpha,$r=$r||rt.dayTextureAlpha[mt]!==1,rt.dayTextureNightAlpha[mt]=ii.nightAlpha,pi=pi||rt.dayTextureNightAlpha[mt]!==1,rt.dayTextureDayAlpha[mt]=ii.dayAlpha,pi=pi||rt.dayTextureDayAlpha[mt]!==1,rt.dayTextureBrightness[mt]=ii.brightness,Ki=Ki||rt.dayTextureBrightness[mt]!==Ms.DEFAULT_BRIGHTNESS,rt.dayTextureContrast[mt]=ii.contrast,wr=wr||rt.dayTextureContrast[mt]!==Ms.DEFAULT_CONTRAST,rt.dayTextureHue[mt]=ii.hue,so=so||rt.dayTextureHue[mt]!==Ms.DEFAULT_HUE,rt.dayTextureSaturation[mt]=ii.saturation,Ts=Ts||rt.dayTextureSaturation[mt]!==Ms.DEFAULT_SATURATION,rt.dayTextureOneOverGamma[mt]=1/ii.gamma,zs=zs||rt.dayTextureOneOverGamma[mt]!==1/Ms.DEFAULT_GAMMA,rt.dayTextureSplit[mt]=ii.splitDirection,ao=ao||rt.dayTextureSplit[mt]!==0;let Wr=rt.dayTextureCutoutRectangles[mt];if(l(Wr)||(Wr=rt.dayTextureCutoutRectangles[mt]=new se),se.clone(se.ZERO,Wr),l(ii.cutoutRectangle)){let Ca=XH(Ai,ii.cutoutRectangle),Mm=ie.simpleIntersection(Ca,Ai,W1e);nr=l(Mm)||nr,Wr.x=(Ca.west-Ai.west)*zn,Wr.y=(Ca.south-Ai.south)*tn,Wr.z=(Ca.east-Ai.west)*zn,Wr.w=(Ca.north-Ai.south)*tn}let _l=rt.colorsToAlpha[mt];l(_l)||(_l=rt.colorsToAlpha[mt]=new se);let w0=l(ii.colorToAlpha)&&ii.colorToAlphaThreshold>0;if(jo=jo||w0,w0){let Ca=ii.colorToAlpha;_l.x=Ca.red,_l.y=Ca.green,_l.z=Ca.blue,_l.w=ii.colorToAlphaThreshold}else _l.w=-1;if(l(Ha.credits)){let Ca=Ha.credits;for(let Mm=0,b_=Ca.length;Mm<b_;++Mm)r.addCreditToNextFrame(Ca[Mm])}++mt}rt.dayTextures.length=mt,rt.waterMask=a,se.clone(c,rt.waterMaskTranslationAndScale),rt.minMaxHeight.x=G.minimumHeight,rt.minMaxHeight.y=G.maximumHeight,M.clone(G.matrix,rt.scaleAndBias);let Fn=e._clippingPlanes,Vi=l(Fn)&&Fn.enabled&&t.isClipped;Vi&&(rt.clippingPlanesEdgeColor=z.clone(Fn.edgeColor,rt.clippingPlanesEdgeColor),rt.clippingPlanesEdgeWidth=Fn.edgeWidth);let Fi=i.vectorData;l(Fi)&&(rt.vectorSegmentTexture=Fi.polylineSegmentTexture,rt.vectorWidthTexture=Fi.widthTexture,rt.vectorColorTexture=Fi.colorTexture,rt.vectorPickColorTexture=Fi.pickColorTexture,rt.vectorSegmentPrimitiveIndicesTexture=Fi.polylineSegmentPrimitiveIndicesTexture,rt.vectorGridCellIndicesTexture=Fi.polylineGridCellIndicesTexture,rt.vectorPolygonEdgeTexture=Fi.polygonEdgeTexture,rt.vectorPolygonEdgePrimitiveIndicesTexture=Fi.polygonEdgePrimitiveIndicesTexture,rt.vectorPolygonGridCellIndicesTexture=Fi.polygonGridCellIndicesTexture,U.clone(Fi.metersPerUv,rt.vectorMetersPerUv));let Ir=i.clippingPolygonData;l(Ir)&&(rt.clippingEdgeTexture=Ir.polygonEdgeTexture,rt.clippingEdgePrimitiveIndicesTexture=Ir.polygonEdgePrimitiveIndicesTexture,rt.clippingGridCellIndicesTexture=Ir.polygonGridCellIndicesTexture);let Mc=e._clippingPolygons,Yf=(Ir?.polygonRings.length??0)>0,Rm=l(Mc)&&Mc.enabled&&Mc.length>0&&t.isClipped&&Yf;ve.numberOfDayTextures=mt,ve.applyBrightness=Ki,ve.applyContrast=wr,ve.applyHue=so,ve.applySaturation=Ts,ve.applyGamma=zs,ve.applyAlpha=$r,ve.applyDayNightAlpha=pi,ve.applySplit=ao,ve.enableFog=Hn,ve.enableClippingPlanes=Vi,ve.clippingPlanes=Fn,ve.enableClippingPolygons=Rm,ve.clippingPolygons=Mc,ve.hasImageryLayerCutout=nr,ve.colorCorrect=V,ve.highlightFillTile=Yn,ve.colorToAlpha=jo,ve.showUndergroundColor=b,ve.translucent=d;let ch=i.renderedMesh.indices.length;Ye||(ch=i.renderedMesh.indexCountWithoutSkirts),ft.shaderProgram=e._surfaceShaderSet.getShaderProgram(ve),ft.pickId=i.vectorData?.show?"vectorPickColorOver(vec4(0.0))":void 0,ft.castShadows=C,ft.receiveShadows=w,ft.renderState=st,ft.primitiveType=Oe.TRIANGLES,ft.vertexArray=i.vertexArray||i.fill.vertexArray,ft.count=ch,ft.uniformMap=Yt,ft.pass=Ie.GLOBE,e._debug.wireframe&&(iPt(jt,t),l(i.wireframeVertexArray)&&(ft.vertexArray=i.wireframeVertexArray,ft.primitiveType=Oe.LINES,ft.count=ch*2));let na=ft.boundingVolume,Om=ft.orientedBoundingBox;n.mode!==re.SCENE3D?(ue.fromRectangleWithHeights2D(t.rectangle,n.mapProjection,q.minimumHeight,q.maximumHeight,na),h.fromElements(na.center.z,na.center.x,na.center.y,na.center),n.mode===re.MORPHING&&ue.union(q.boundingSphere,na,na)):(ft.boundingVolume=ue.clone(q.boundingSphere,na),ft.orientedBoundingBox=en.clone(q.boundingVolume,Om)),ft.dirty=!0,d&&f.updateDerivedCommands(ft,n),G1e(ft,n),st=qe,vt=oPt}while(Qe<He)}var $H=Are;function K1e(){this._enabled=!1,this._frontFaceAlpha=1,this._frontFaceAlphaByDistance=void 0,this._backFaceAlpha=1,this._backFaceAlphaByDistance=void 0,this._rectangle=ie.clone(ie.MAX_VALUE)}Object.defineProperties(K1e.prototype,{enabled:{get:function(){return this._enabled},set:function(e){this._enabled=e}},frontFaceAlpha:{get:function(){return this._frontFaceAlpha},set:function(e){this._frontFaceAlpha=e}},frontFaceAlphaByDistance:{get:function(){return this._frontFaceAlphaByDistance},set:function(e){this._frontFaceAlphaByDistance=qt.clone(e,this._frontFaceAlphaByDistance)}},backFaceAlpha:{get:function(){return this._backFaceAlpha},set:function(e){this._backFaceAlpha=e}},backFaceAlphaByDistance:{get:function(){return this._backFaceAlphaByDistance},set:function(e){this._backFaceAlphaByDistance=qt.clone(e,this._backFaceAlphaByDistance)}},rectangle:{get:function(){return this._rectangle},set:function(e){l(e)||(e=ie.clone(ie.MAX_VALUE)),ie.clone(e,this._rectangle)}}});var JH=K1e;var bre=class{constructor(t){this._ellipsoid=new Op(t.ellipsoid,h.ZERO)}get ellipsoid(){return this._ellipsoid}},ZH=bre;var xre=class{constructor(t){this.maxSize=t,this.cache=new Map}get(t){if(!this.cache.has(t))return;let n=this.cache.get(t);return this.cache.delete(t),this.cache.set(t,n),n}set(t,n){if(this.cache.has(t))this.cache.delete(t);else if(this.cache.size>=this.maxSize){let i=this.cache.keys().next().value;this.cache.delete(i)}this.cache.set(t,n)}get size(){return this.cache.size}clear(){this.cache.clear()}},uPt=1e3,Tre=class e{constructor(t){this._tilingScheme=t.tilingScheme,this._x=t.x,this._y=t.y,this._level=t.level,this._parent=t.parent,this._rectangle=this._tilingScheme.tileXYToRectangle(this._x,this._y,this._level),this._southwestChild=void 0,this._southeastChild=void 0,this._northwestChild=void 0,this._northeastChild=void 0,this.replacementPrevious=void 0,this.replacementNext=void 0,this._distance=0,this._loadPriority=0,this._customData=new Set,this._customDataIterator=void 0,this._addedCustomData=[],this._removedCustomData=[],this._lastSelectionResult=gi.NONE,this._lastSelectionResultFrame=void 0,this._loadedCallbacks={},this._positionCache=new xre(uPt),this.state=uc.START,this.renderable=!1,this.upsampledFromParent=!1,this.data=void 0}static createLevelZeroTiles(t){let n=t.getNumberOfXTilesAtLevel(0),i=t.getNumberOfYTilesAtLevel(0),r=new Array(n*i),o=0;for(let s=0;s<i;++s)for(let a=0;a<n;++a)r[o++]=new e({tilingScheme:t,x:a,y:s,level:0});return r}_getCacheKey(t,n){return dPt(t.longitude,t.latitude,this._rectangle,n)}getPositionCacheEntry(t,n){return this._positionCache.get(this._getCacheKey(t,n))}setPositionCacheEntry(t,n,i){this._positionCache.set(this._getCacheKey(t,n),i)}clearPositionCache(){this._positionCache.size>0&&this._positionCache.clear()}updateCustomData(){let t=this._addedCustomData,n=this._removedCustomData;if(t.length===0&&n.length===0)return;let i=this.customData;for(let r=0;r<t.length;++r){let o=t[r];if(!l(o))continue;i.add(o);let s=$1e(this,o.positionCartographic);o._pendingAddTile=s,o._pendingAddIndex=s._addedCustomData.length,s._addedCustomData.push(o)}this._addedCustomData.length=0;for(let r=0;r<n.length;++r){let o=n[r];if(!l(o))continue;i.has(o)&&i.delete(o);let s=$1e(this,o.positionCartographic);if(o._pendingAddTile===s&&s._addedCustomData[o._pendingAddIndex]===o){s._addedCustomData[o._pendingAddIndex]=void 0,o._pendingAddTile=void 0;continue}s._removedCustomData.push(o)}this._removedCustomData.length=0}get tilingScheme(){return this._tilingScheme}get x(){return this._x}get y(){return this._y}get level(){return this._level}get parent(){return this._parent}get rectangle(){return this._rectangle}get children(){return[this.northwestChild,this.northeastChild,this.southwestChild,this.southeastChild]}get southwestChild(){return l(this._southwestChild)||(this._southwestChild=new e({tilingScheme:this.tilingScheme,x:this.x*2,y:this.y*2+1,level:this.level+1,parent:this})),this._southwestChild}get southeastChild(){return l(this._southeastChild)||(this._southeastChild=new e({tilingScheme:this.tilingScheme,x:this.x*2+1,y:this.y*2+1,level:this.level+1,parent:this})),this._southeastChild}get northwestChild(){return l(this._northwestChild)||(this._northwestChild=new e({tilingScheme:this.tilingScheme,x:this.x*2,y:this.y*2,level:this.level+1,parent:this})),this._northwestChild}get northeastChild(){return l(this._northeastChild)||(this._northeastChild=new e({tilingScheme:this.tilingScheme,x:this.x*2+1,y:this.y*2,level:this.level+1,parent:this})),this._northeastChild}get customData(){return this._customData}get needsLoading(){return this.state<uc.DONE}get eligibleForUnloading(){let t=!0;return l(this.data)&&(t=this.data.eligibleForUnloading,l(t)||(t=!0)),t}findLevelZeroTile(t,n,i){let r=this.tilingScheme.getNumberOfXTilesAtLevel(0);if(n<0?n+=r:n>=r&&(n-=r),!(i<0||i>=this.tilingScheme.getNumberOfYTilesAtLevel(0)))return t.filter(function(o){return o.x===n&&o.y===i})[0]}findTileToWest(t){let n=this.parent;if(n===void 0)return this.findLevelZeroTile(t,this.x-1,this.y);if(n.southeastChild===this)return n.southwestChild;if(n.northeastChild===this)return n.northwestChild;let i=n.findTileToWest(t);if(i!==void 0)return n.southwestChild===this?i.southeastChild:i.northeastChild}findTileToEast(t){let n=this.parent;if(n===void 0)return this.findLevelZeroTile(t,this.x+1,this.y);if(n.southwestChild===this)return n.southeastChild;if(n.northwestChild===this)return n.northeastChild;let i=n.findTileToEast(t);if(i!==void 0)return n.southeastChild===this?i.southwestChild:i.northwestChild}findTileToSouth(t){let n=this.parent;if(n===void 0)return this.findLevelZeroTile(t,this.x,this.y+1);if(n.northwestChild===this)return n.southwestChild;if(n.northeastChild===this)return n.southeastChild;let i=n.findTileToSouth(t);if(i!==void 0)return n.southwestChild===this?i.northwestChild:i.northeastChild}findTileToNorth(t){let n=this.parent;if(n===void 0)return this.findLevelZeroTile(t,this.x,this.y-1);if(n.southwestChild===this)return n.northwestChild;if(n.southeastChild===this)return n.northeastChild;let i=n.findTileToNorth(t);if(i!==void 0)return n.northwestChild===this?i.southwestChild:i.southeastChild}freeResources(){this.clearPositionCache(),this.state=uc.START,this.renderable=!1,this.upsampledFromParent=!1;let t=this.data;l(t)&&l(t.freeResources)&&t.freeResources(),QH(this._southwestChild),this._southwestChild=void 0,QH(this._southeastChild),this._southeastChild=void 0,QH(this._northwestChild),this._northwestChild=void 0,QH(this._northeastChild),this._northeastChild=void 0}},fPt=256;function dPt(e,t,n,i){let r=n.width/fPt*i,o=Math.floor(e/r)*r,s=Math.floor(t/r)*r;return`${o.toFixed(10)},${s.toFixed(10)}`}var hPt=new he;function $1e(e,t){let n=e.northwestChild.rectangle,i=ie.southeast(n,hPt),r=t.longitude>=i.longitude?1:0;switch((t.latitude<i.latitude?1:0)*2+r){case 0:return e.northwestChild;case 1:return e.northeastChild;case 2:return e.southwestChild;default:return e.southeastChild}}function QH(e){l(e)&&e.freeResources()}var eG=Tre;function tG(){this.head=void 0,this.tail=void 0,this.count=0,this._lastBeforeStartOfFrame=void 0}tG.prototype.markStartOfRenderFrame=function(){this._lastBeforeStartOfFrame=this.head};tG.prototype.trimTiles=function(e){let t=this.tail,n=!0;for(;n&&l(this._lastBeforeStartOfFrame)&&this.count>e&&l(t);){n=t!==this._lastBeforeStartOfFrame;let i=t.replacementPrevious;t.eligibleForUnloading&&(t.freeResources(),J1e(this,t)),t=i}};function J1e(e,t){let n=t.replacementPrevious,i=t.replacementNext;t===e._lastBeforeStartOfFrame&&(e._lastBeforeStartOfFrame=i),t===e.head?e.head=i:n.replacementNext=i,t===e.tail?e.tail=n:i.replacementPrevious=n,t.replacementPrevious=void 0,t.replacementNext=void 0,--e.count}tG.prototype.markTileRendered=function(e){let t=this.head;if(t===e){e===this._lastBeforeStartOfFrame&&(this._lastBeforeStartOfFrame=e.replacementNext);return}if(++this.count,!l(t)){e.replacementPrevious=void 0,e.replacementNext=void 0,this.head=e,this.tail=e;return}(l(e.replacementPrevious)||l(e.replacementNext))&&J1e(this,e),e.replacementPrevious=void 0,e.replacementNext=t,t.replacementPrevious=e,this.head=e};var nG=tG;function $d(e){this._tileProvider=e.tileProvider,this._tileProvider.quadtree=this,this._debug={enableDebugOutput:!1,maxDepth:0,maxDepthVisited:0,tilesVisited:0,tilesCulled:0,tilesRendered:0,tilesWaitingForChildren:0,lastMaxDepth:-1,lastMaxDepthVisited:-1,lastTilesVisited:-1,lastTilesCulled:-1,lastTilesRendered:-1,lastTilesWaitingForChildren:-1,suspendLodUpdate:!1};let n=this._tileProvider.tilingScheme.ellipsoid;this._tilesRenderedThisFrame=new Set,this._tilesToRender=[],this._tileLoadQueueHigh=[],this._tileLoadQueueMedium=[],this._tileLoadQueueLow=[],this._tileReplacementQueue=new nG,this._levelZeroTiles=void 0,this._loadQueueTimeSlice=5,this._tilesInvalidated=!1,this._addHeightCallbacks=[],this._removeHeightCallbacks=[],this._tileToUpdateHeights=[],this._updateHeightsTimeSlice=2,this._cameraPositionCartographic=void 0,this._cameraReferenceFrameOriginCartographic=void 0,this.maximumScreenSpaceError=e.maximumScreenSpaceError??2,this.tileCacheSize=e.tileCacheSize??100,this.loadingDescendantLimit=20,this.preloadAncestors=!0,this.preloadSiblings=!1,this._occluders=new ZH({ellipsoid:n}),this._tileLoadProgressEvent=new be,this._lastTileLoadQueueLength=0,this._lastSelectionFrameNumber=void 0}Object.defineProperties($d.prototype,{tileProvider:{get:function(){return this._tileProvider}},tileLoadProgressEvent:{get:function(){return this._tileLoadProgressEvent}},occluders:{get:function(){return this._occluders}}});$d.prototype.invalidateAllTiles=function(){this._tilesInvalidated=!0};function mPt(e){let t=e._tileReplacementQueue;t.head=void 0,t.tail=void 0,t.count=0,Q1e(e);let n=e._levelZeroTiles;if(l(n))for(let i=0;i<n.length;++i){let o=n[i].customData;for(let s of o)s.level=0,e._addHeightCallbacks.push(s);n[i].freeResources()}e._levelZeroTiles=void 0,e._tileProvider.cancelReprojections()}$d.prototype.forEachLoadedTile=function(e){let t=this._tileReplacementQueue.head;for(;l(t);)t.state!==uc.START&&e(t),t=t.replacementNext};$d.prototype.forEachRenderedTile=function(e){let t=this._tilesRenderedThisFrame;for(let n of t)e(n)};$d.prototype.updateHeight=function(e,t){let n=this,i={positionOnEllipsoidSurface:void 0,positionCartographic:e,level:-1,callback:t};return i.removeFunc=function(){let r=n._addHeightCallbacks,o=r.length,s=!1;for(let a=0;a<o;++a)if(r[a]===i){r.splice(a,1),s=!0;break}s||n._removeHeightCallbacks.push(i),i.callback&&(i.callback=void 0)},n._addHeightCallbacks.push(i),i.removeFunc};$d.prototype.update=function(e){l(this._tileProvider.update)&&this._tileProvider.update(e)};function Q1e(e){let t=e._debug;t.maxDepth=0,t.maxDepthVisited=0,t.tilesVisited=0,t.tilesCulled=0,t.tilesRendered=0,t.tilesWaitingForChildren=0,e._tileLoadQueueHigh.length=0,e._tileLoadQueueMedium.length=0,e._tileLoadQueueLow.length=0}$d.prototype.beginFrame=function(e){e.passes.render&&(this._tilesInvalidated&&(mPt(this),this._tilesInvalidated=!1),this._tileProvider.initialize(e),Q1e(this),!this._debug.suspendLodUpdate&&(this._tileReplacementQueue.markStartOfRenderFrame(),this._tilesRenderedThisFrame.clear()))};$d.prototype.render=function(e){let t=e.passes,n=this._tileProvider;t.render&&(n.beginUpdate(e),yPt(this,e),IPt(this,e),n.endUpdate(e)),t.pick&&this._tilesToRender.length>0&&n.updateForPick(e)};function pPt(e,t){let n=e._tileLoadQueueHigh.length+e._tileLoadQueueMedium.length+e._tileLoadQueueLow.length;if(n!==e._lastTileLoadQueueLength||e._tilesInvalidated){let r=be.prototype.raiseEvent.bind(e._tileLoadProgressEvent,n);t.afterRender.push(()=>(r(),!0)),e._lastTileLoadQueueLength=n}let i=e._debug;i.enableDebugOutput&&!i.suspendLodUpdate&&(i.maxDepth=e._tilesToRender.reduce(function(r,o){return Math.max(r,o.level)},-1),i.tilesRendered=e._tilesToRender.length,(i.tilesVisited!==i.lastTilesVisited||i.tilesRendered!==i.lastTilesRendered||i.tilesCulled!==i.lastTilesCulled||i.maxDepth!==i.lastMaxDepth||i.tilesWaitingForChildren!==i.lastTilesWaitingForChildren||i.maxDepthVisited!==i.lastMaxDepthVisited)&&(console.log(`Visited ${i.tilesVisited}, Rendered: ${i.tilesRendered}, Culled: ${i.tilesCulled}, Max Depth Rendered: ${i.maxDepth}, Max Depth Visited: ${i.maxDepthVisited}, Waiting for children: ${i.tilesWaitingForChildren}`),i.lastTilesVisited=i.tilesVisited,i.lastTilesRendered=i.tilesRendered,i.lastTilesCulled=i.tilesCulled,i.lastMaxDepth=i.maxDepth,i.lastTilesWaitingForChildren=i.tilesWaitingForChildren,i.lastMaxDepthVisited=i.maxDepthVisited))}$d.prototype.endFrame=function(e){!e.passes.render||e.mode===re.MORPHING||(CPt(this,e),wPt(this,e),pPt(this,e))};$d.prototype.isDestroyed=function(){return!1};$d.prototype.destroy=function(){this._tileProvider=this._tileProvider&&this._tileProvider.destroy()};var MO,Z1e=new he;function gPt(e,t){let n=ie.center(e.rectangle,Z1e),i=n.longitude-MO.longitude,r=n.latitude-MO.latitude;n=ie.center(t.rectangle,Z1e);let o=n.longitude-MO.longitude,s=n.latitude-MO.latitude;return i*i+r*r-(o*o+s*s)}var _Pt=new h,OO=[];function yPt(e,t){let n=e._debug;if(n.suspendLodUpdate)return;let i=e._tilesToRender;i.length=0;let r=e._tileProvider;if(!l(e._levelZeroTiles)){let d=r.tilingScheme;if(l(d)){let p=r.tilingScheme;e._levelZeroTiles=eG.createLevelZeroTiles(p);let g=e._levelZeroTiles.length;if(OO.length<g){OO=new Array(g);for(let m=0;m<g;++m)OO[m]===void 0&&(OO[m]=new NO)}}else return}e._occluders.ellipsoid.cameraPosition=t.camera.positionWC;let o=e._levelZeroTiles,s=o.length>1?e._occluders:void 0;MO=t.camera.positionCartographic,o.sort(gPt);let a=e._addHeightCallbacks,c=e._removeHeightCallbacks;a.forEach(d=>{let p=o.find(g=>ie.contains(g.rectangle,d.positionCartographic));p&&p._addedCustomData.push(d)}),c.forEach(d=>{let p=o.find(g=>ie.contains(g.rectangle,d.positionCartographic));p&&p._removedCustomData.push(d)}),o.forEach(d=>d.updateCustomData()),a.length=0,c.length=0;let u=t.camera;e._cameraPositionCartographic=u.positionCartographic;let f=M.getTranslation(u.transform,_Pt);e._cameraReferenceFrameOriginCartographic=e.tileProvider.tilingScheme.ellipsoid.cartesianToCartographic(f,e._cameraReferenceFrameOriginCartographic);for(let d=0;d<o.length;++d){let p=o[d];e._tileReplacementQueue.markTileRendered(p),p.renderable?Pc(e,p,r,t,s,!1,OO[d]):(e_(e,e._tileLoadQueueHigh,p,t),++n.tilesWaitingForChildren)}e._lastSelectionFrameNumber=t.frameNumber}function e_(e,t,n,i){n.needsLoading&&(e.tileProvider.computeTileLoadPriority!==void 0&&(n._loadPriority=e.tileProvider.computeTileLoadPriority(n,i)),t.push(n))}function NO(){this.allAreRenderable=!0,this.anyWereRenderedLastFrame=!1,this.notYetRenderableCount=0}function eRe(){this.southwest=new NO,this.southeast=new NO,this.northwest=new NO,this.northeast=new NO}eRe.prototype.combine=function(e){let t=this.southwest,n=this.southeast,i=this.northwest,r=this.northeast;e.allAreRenderable=t.allAreRenderable&&n.allAreRenderable&&i.allAreRenderable&&r.allAreRenderable,e.anyWereRenderedLastFrame=t.anyWereRenderedLastFrame||n.anyWereRenderedLastFrame||i.anyWereRenderedLastFrame||r.anyWereRenderedLastFrame,e.notYetRenderableCount=t.notYetRenderableCount+n.notYetRenderableCount+i.notYetRenderableCount+r.notYetRenderableCount};var Cre=new Array(31);for(let e=0;e<Cre.length;++e)Cre[e]=new eRe;function APt(e,t,n,i,r){let o=e._debug;++o.tilesVisited,e._tileReplacementQueue.markTileRendered(n),n.updateCustomData(),n.level>o.maxDepthVisited&&(o.maxDepthVisited=n.level);let s=TPt(e,t,n)<e.maximumScreenSpaceError,a=n.southwestChild,c=n.southeastChild,u=n.northwestChild,f=n.northeastChild,d=e._lastSelectionFrameNumber,p=n._lastSelectionResultFrame===d?n._lastSelectionResult:gi.NONE,g=e.tileProvider;if(s||i){let m=gi.originalResult(p)===gi.RENDERED,y=gi.originalResult(p)===gi.CULLED||p===gi.NONE,A=n.state===uc.DONE,b=m||y||A;if(b||l(g.canRenderWithoutLosingDetail)&&(b=g.canRenderWithoutLosingDetail(n)),b){s&&e_(e,e._tileLoadQueueMedium,n,t),iG(e,n),r.allAreRenderable=n.renderable,r.anyWereRenderedLastFrame=p===gi.RENDERED,r.notYetRenderableCount=n.renderable?0:1,n._lastSelectionResultFrame=t.frameNumber,n._lastSelectionResult=gi.RENDERED,r.anyWereRenderedLastFrame||e._tileToUpdateHeights.push(n);return}i=!0,s&&e_(e,e._tileLoadQueueHigh,n,t)}if(g.canRefine(n)){if(a.upsampledFromParent&&c.upsampledFromParent&&u.upsampledFromParent&&f.upsampledFromParent){iG(e,n),e_(e,e._tileLoadQueueMedium,n,t),e._tileReplacementQueue.markTileRendered(a),e._tileReplacementQueue.markTileRendered(c),e._tileReplacementQueue.markTileRendered(u),e._tileReplacementQueue.markTileRendered(f),r.allAreRenderable=n.renderable,r.anyWereRenderedLastFrame=p===gi.RENDERED,r.notYetRenderableCount=n.renderable?0:1,n._lastSelectionResultFrame=t.frameNumber,n._lastSelectionResult=gi.RENDERED,r.anyWereRenderedLastFrame||e._tileToUpdateHeights.push(n);return}n._lastSelectionResultFrame=t.frameNumber,n._lastSelectionResult=gi.REFINED;let y=e._tilesToRender.length,A=e._tileLoadQueueLow.length,b=e._tileLoadQueueMedium.length,x=e._tileLoadQueueHigh.length,T=e._tileToUpdateHeights.length;if(bPt(e,a,c,u,f,t,i,r),y!==e._tilesToRender.length){let E=r.allAreRenderable,v=r.anyWereRenderedLastFrame,S=r.notYetRenderableCount,I=!1;if(!E&&!v){let R=e._tilesToRender;for(let L=y;L<R.length;++L){let _=R[L];for(;_!==void 0&&_._lastSelectionResult!==gi.KICKED&&_!==n;)_._lastSelectionResult=gi.kick(_._lastSelectionResult),_=_.parent}e._tilesToRender.length=y,e._tileToUpdateHeights.length=T,iG(e,n),n._lastSelectionResult=gi.RENDERED;let O=p===gi.RENDERED;!O&&S>e.loadingDescendantLimit&&(e._tileLoadQueueLow.length=A,e._tileLoadQueueMedium.length=b,e._tileLoadQueueHigh.length=x,e_(e,e._tileLoadQueueMedium,n,t),r.notYetRenderableCount=n.renderable?0:1,I=!0),r.allAreRenderable=n.renderable,r.anyWereRenderedLastFrame=O,O||e._tileToUpdateHeights.push(n),++o.tilesWaitingForChildren}e.preloadAncestors&&!I&&e_(e,e._tileLoadQueueLow,n,t)}return}n._lastSelectionResultFrame=t.frameNumber,n._lastSelectionResult=gi.RENDERED,iG(e,n),e_(e,e._tileLoadQueueHigh,n,t),r.allAreRenderable=n.renderable,r.anyWereRenderedLastFrame=p===gi.RENDERED,r.notYetRenderableCount=n.renderable?0:1}function bPt(e,t,n,i,r,o,s,a){let c=o.camera.positionCartographic,u=e._tileProvider,f=e._occluders,d=Cre[t.level],p=d.southwest,g=d.southeast,m=d.northwest,y=d.northeast;c.longitude<t.rectangle.east?c.latitude<t.rectangle.north?(Pc(e,t,u,o,f,s,p),Pc(e,n,u,o,f,s,g),Pc(e,i,u,o,f,s,m),Pc(e,r,u,o,f,s,y)):(Pc(e,i,u,o,f,s,m),Pc(e,t,u,o,f,s,p),Pc(e,r,u,o,f,s,y),Pc(e,n,u,o,f,s,g)):c.latitude<t.rectangle.north?(Pc(e,n,u,o,f,s,g),Pc(e,t,u,o,f,s,p),Pc(e,r,u,o,f,s,y),Pc(e,i,u,o,f,s,m)):(Pc(e,r,u,o,f,s,y),Pc(e,i,u,o,f,s,m),Pc(e,n,u,o,f,s,g),Pc(e,t,u,o,f,s,p)),d.combine(a)}function xPt(e,t){let n=t.rectangle;return l(e._cameraPositionCartographic)&&ie.contains(n,e._cameraPositionCartographic)||l(e._cameraReferenceFrameOriginCartographic)&&ie.contains(n,e._cameraReferenceFrameOriginCartographic)}function Pc(e,t,n,i,r,o,s){if(n.computeTileVisibility(t,i,r)!==ns.NONE)return APt(e,i,t,o,s);if(++e._debug.tilesCulled,e._tileReplacementQueue.markTileRendered(t),s.allAreRenderable=!0,s.anyWereRenderedLastFrame=!1,s.notYetRenderableCount=0,xPt(e,t)){(!l(t.data)||!l(t.data.vertexArray))&&e_(e,e._tileLoadQueueMedium,t,i);let a=e._lastSelectionFrameNumber,c=t._lastSelectionResultFrame===a?t._lastSelectionResult:gi.NONE;c!==gi.CULLED_BUT_NEEDED&&c!==gi.RENDERED&&e._tileToUpdateHeights.push(t),t._lastSelectionResult=gi.CULLED_BUT_NEEDED}else e.preloadSiblings||t.level===0?(e_(e,e._tileLoadQueueLow,t,i),t._lastSelectionResult=gi.CULLED):t._lastSelectionResult=gi.CULLED;t._lastSelectionResultFrame=i.frameNumber}function TPt(e,t,n){if(t.mode===re.SCENE2D||t.camera.frustum instanceof _n||t.camera.frustum instanceof Ss)return EPt(e,t,n);let i=e._tileProvider.getLevelMaximumGeometricError(n.level),r=n._distance,o=t.context.drawingBufferHeight,s=t.camera.frustum.sseDenominator,a=i*o/(r*s);return t.fog.enabled&&(a-=P.fog(r,t.fog.density)*t.fog.sse),a/=t.pixelRatio,a}function EPt(e,t,n){let r=t.camera.frustum,o=r.offCenterFrustum;l(o)&&(r=o);let s=t.context,a=s.drawingBufferWidth,c=s.drawingBufferHeight,u=e._tileProvider.getLevelMaximumGeometricError(n.level),f=Math.max(r.top-r.bottom,r.right-r.left)/Math.max(a,c),d=u/f;return t.fog.enabled&&t.mode!==re.SCENE2D&&(d-=P.fog(n._distance,t.fog.density)*t.fog.sse),d/=t.pixelRatio,d}function iG(e,t){e._tilesToRender.push(t),e._tilesRenderedThisFrame.add(t)}function CPt(e,t){let n=e._tileLoadQueueHigh,i=e._tileLoadQueueMedium,r=e._tileLoadQueueLow;if(n.length===0&&i.length===0&&r.length===0)return;e._tileReplacementQueue.trimTiles(e.tileCacheSize);let o=xn()+e._loadQueueTimeSlice,s=e._tileProvider,a=Ere(e,t,s,o,n,!1);a=Ere(e,t,s,o,i,a),Ere(e,t,s,o,r,a)}function vPt(e,t){return e._loadPriority-t._loadPriority}function Ere(e,t,n,i,r,o){n.computeTileLoadPriority!==void 0&&r.sort(vPt);for(let s=0,a=r.length;s<a&&(xn()<i||!o);++s){let c=r[s];e._tileReplacementQueue.markTileRendered(c),n.loadTile(t,c),o=!0}return o}var zw=new gn,rG=new he,FA=new h,SPt=[];function wPt(e,t){if(!l(e.tileProvider.tilingScheme))return;let n=SPt;n.length=0;let i=e._tileToUpdateHeights,r=xn(),o=e._updateHeightsTimeSlice,s=r+o,a=t.mode,c=t.mapProjection,u=e.tileProvider.tilingScheme.ellipsoid,f;for(;i.length>0;){let d=i[0];if(!l(d.data)||!l(d.data.mesh)){let A=d._lastSelectionResultFrame===e._lastSelectionFrameNumber?d._lastSelectionResult:gi.NONE;(A===gi.RENDERED||A===gi.CULLED_BUT_NEEDED)&&n.push(d),d.clearPositionCache(),i.shift();continue}let p=d.customData;l(d._customDataIterator)||(d._customDataIterator=p.values());let g=d._customDataIterator,m=!1,y;for(;!(y=g.next()).done;){let A=y.value,b=d.data.terrainData,x=l(b)&&b.wasCreatedByUpsampling();if(d.level>A.level&&!x){let T,E=d.getPositionCacheEntry(A.positionCartographic,e.maximumScreenSpaceError);if(l(E))T=E;else{if(l(A.positionOnEllipsoidSurface)||(A.positionOnEllipsoidSurface=h.fromRadians(A.positionCartographic.longitude,A.positionCartographic.latitude,0,u)),a===re.SCENE3D){let v=u.geodeticSurfaceNormal(A.positionOnEllipsoidSurface,zw.direction),S=u.getSurfaceNormalIntersectionWithZAxis(A.positionOnEllipsoidSurface,11500,zw.origin);if(!l(S)){let I=0;l(d.data.tileBoundingRegion)&&(I=d.data.tileBoundingRegion.minimumHeight);let R=Math.min(I,-11500),O=h.multiplyByScalar(v,Math.abs(R)+1,FA);h.subtract(A.positionOnEllipsoidSurface,O,zw.origin)}}else he.clone(A.positionCartographic,rG),rG.height=-11500,c.project(rG,FA),h.fromElements(FA.z,FA.x,FA.y,FA),h.clone(FA,zw.origin),h.clone(h.UNIT_X,zw.direction);T=d.data.pick(zw,a,c,!1,FA),l(T)&&d.setPositionCacheEntry(A.positionCartographic,e.maximumScreenSpaceError,h.clone(T))}if(l(T)){if(l(A.callback)){let v=u.cartesianToCartographic(T,rG);A.callback(v)}A.level=d.level}}if(xn()>=s){m=!0;break}}if(m){d._customDataIterator=g;break}else d._customDataIterator=void 0,i.shift()}for(f=0;f<n.length;f++)i.push(n[f])}function IPt(e,t){let n=e._tileProvider,i=e._tilesToRender;for(let r=0,o=i.length;r<o;++r){let s=i[r];n.showTileThisFrame(s,t)}}var oG=$d;function _m(e){e=e??ee.default;let t=new Qg({ellipsoid:e}),n=new eS,i=new jy({tilingScheme:t.tilingScheme});this._ellipsoid=e,this._imageryLayerCollection=n,this._surfaceShaderSet=new UH,this._material=void 0,this._surface=new oG({tileProvider:new $H({terrainProvider:t,imageryLayers:n,surfaceShaderSet:this._surfaceShaderSet,vectorProvider:i})}),this._terrainProvider=t,this._terrainProviderChanged=new be,this._vectorProvider=i,this._undergroundColor=z.clone(z.BLACK),this._undergroundColorAlphaByDistance=new qt(e.maximumRadius/1e3,0,e.maximumRadius/5,1),this._translucency=new JH,Sre(this),this.show=!0,this._oceanNormalMapResourceDirty=!0,this._oceanNormalMapResource=new De({url:Zt("Assets/Textures/waterNormalsSmall.jpg")}),this.maximumScreenSpaceError=2,this.tileCacheSize=100,this.loadingDescendantLimit=20,this.preloadAncestors=!0,this.preloadSiblings=!1,this.fillHighlightColor=void 0,this.enableLighting=!1,this.lambertDiffuseMultiplier=.9,this.dynamicAtmosphereLighting=!0,this.dynamicAtmosphereLightingFromSun=!1,this.showGroundAtmosphere=ee.WGS84.equals(e),this.atmosphereLightIntensity=10,this.atmosphereRayleighCoefficient=new h(55e-7,13e-6,284e-7),this.atmosphereMieCoefficient=new h(21e-6,21e-6,21e-6),this.atmosphereRayleighScaleHeight=1e4,this.atmosphereMieScaleHeight=3200,this.atmosphereMieAnisotropy=.9,this.lightingFadeOutDistance=P.PI_OVER_TWO*e.minimumRadius,this.lightingFadeInDistance=P.PI*e.minimumRadius,this.nightFadeOutDistance=P.PI_OVER_TWO*e.minimumRadius,this.nightFadeInDistance=5*P.PI_OVER_TWO*e.minimumRadius,this.showWaterEffect=!0,this.depthTestAgainstTerrain=!1,this.shadows=Dn.RECEIVE_ONLY,this.atmosphereHueShift=0,this.atmosphereSaturationShift=0,this.atmosphereBrightnessShift=0,this.showSkirts=!0,this.backFaceCulling=!0,this._oceanNormalMap=void 0,this._zoomedOutOceanSpecularIntensity=void 0,this.vertexShadowDarkness=.3}Object.defineProperties(_m.prototype,{ellipsoid:{get:function(){return this._ellipsoid}},imageryLayers:{get:function(){return this._imageryLayerCollection}},imageryLayersUpdatedEvent:{get:function(){return this._surface.tileProvider.imageryLayersUpdatedEvent}},tilesLoaded:{get:function(){return l(this._surface)?this._surface._tileLoadQueueHigh.length===0&&this._surface._tileLoadQueueMedium.length===0&&this._surface._tileLoadQueueLow.length===0:!0}},baseColor:{get:function(){return this._surface.tileProvider.baseColor},set:function(e){this._surface.tileProvider.baseColor=e}},clippingPlanes:{get:function(){return this._surface.tileProvider.clippingPlanes},set:function(e){this._surface.tileProvider.clippingPlanes=e}},clippingPolygons:{get:function(){return this._surface.tileProvider.clippingPolygons},set:function(e){this._surface.tileProvider.clippingPolygons=e}},cartographicLimitRectangle:{get:function(){return this._surface.tileProvider.cartographicLimitRectangle},set:function(e){l(e)||(e=ie.clone(ie.MAX_VALUE)),this._surface.tileProvider.cartographicLimitRectangle=e}},oceanNormalMapUrl:{get:function(){return this._oceanNormalMapResource.url},set:function(e){this._oceanNormalMapResource.url=e,this._oceanNormalMapResourceDirty=!0}},terrainProvider:{get:function(){return this._terrainProvider},set:function(e){e!==this._terrainProvider&&(this._terrainProvider=e,l(e)&&(this._vectorProvider.tilingScheme=e.tilingScheme),this._terrainProviderChanged.raiseEvent(e),l(this._material)&&Sre(this))}},terrainProviderChanged:{get:function(){return this._terrainProviderChanged}},vectorProvider:{get:function(){return this._vectorProvider}},tileLoadProgressEvent:{get:function(){return this._surface.tileLoadProgressEvent}},material:{get:function(){return this._material},set:function(e){this._material!==e&&(this._material=e,Sre(this))}},undergroundColor:{get:function(){return this._undergroundColor},set:function(e){this._undergroundColor=z.clone(e,this._undergroundColor)}},undergroundColorAlphaByDistance:{get:function(){return this._undergroundColorAlphaByDistance},set:function(e){this._undergroundColorAlphaByDistance=qt.clone(e,this._undergroundColorAlphaByDistance)}},translucency:{get:function(){return this._translucency}}});function Sre(e){let t=[],n=l(e._material)&&(l(e._material.shaderSource.match(/slope/))||l(e._material.shaderSource.match("normalEC"))),i=[Xm,hP];l(e._material)&&(!n||e._terrainProvider.hasVertexNormals)?(i.push(e._material.shaderSource),t.push("APPLY_MATERIAL"),e._surface._tileProvider.materialUniformMap=e._material._uniforms):e._surface._tileProvider.materialUniformMap=void 0,i.push(F2),e._surfaceShaderSet.baseVertexShaderSource=new Xe({sources:[Xm,hP,B2],defines:t}),e._surfaceShaderSet.baseFragmentShaderSource=new Xe({sources:i,defines:t}),e._surfaceShaderSet.material=e._material}function PPt(e){return function(t,n){let i=ue.distanceSquaredTo(t.pickBoundingSphere,e),r=ue.distanceSquaredTo(n.pickBoundingSphere,e);return i-r}}var DPt=[],RPt={start:0,stop:0};_m.prototype.pickWorldCoordinates=function(e,t,n,i){n=n??!0;let r=t.mode,o=t.mapProjection,s=DPt;s.length=0;for(let u of this._surface._tilesRenderedThisFrame){let f=u.data;if(!l(f))continue;let d=f.pickBoundingSphere;if(r!==re.SCENE3D)f.pickBoundingSphere=d=ue.fromRectangleWithHeights2D(u.rectangle,o,f.tileBoundingRegion.minimumHeight,f.tileBoundingRegion.maximumHeight,d),h.fromElements(d.center.z,d.center.x,d.center.y,d.center);else if(l(f.renderedMesh))ue.clone(f.tileBoundingRegion.boundingSphere,d);else continue;let p=xi.raySphere(e,d,RPt);l(p)&&s.push(f)}s.sort(PPt(e.origin));let a,c=s.length;for(let u=0;u<c&&(a=s[u].pick(e,t.mode,t.mapProjection,n,i),!l(a));++u);return a};var OPt=new he;_m.prototype.pick=function(e,t,n){if(n=this.pickWorldCoordinates(e,t,!0,n),l(n)&&t.mode!==re.SCENE3D){n=h.fromElements(n.y,n.z,n.x,n);let i=t.mapProjection.unproject(n,OPt);n=this._ellipsoid.cartographicToCartesian(i,n)}return n};var MPt=new h,tRe=new h,NPt=new he,LPt=new gn;function vre(e,t){return l(e)&&ie.contains(e.rectangle,t)?e:void 0}_m.prototype.getHeight=function(e){let t=this._surface._levelZeroTiles;if(!l(t))return;let n,i,r=t.length;for(i=0;i<r&&(n=t[i],!ie.contains(n.rectangle,e));++i);if(i>=r)return;let o=n;for(;l(n);)n=vre(n._southwestChild,e)||vre(n._southeastChild,e)||vre(n._northwestChild,e)||n._northeastChild,l(n)&&l(n.data)&&l(n.data.renderedMesh)&&(o=n);if(n=o,!l(n)||!l(n.data)||!l(n.data.renderedMesh))return;let s=this._surface._tileProvider.tilingScheme.projection,a=this._surface._tileProvider.tilingScheme.ellipsoid,c=h.fromRadians(e.longitude,e.latitude,0,a,MPt),u=LPt,f=a.geodeticSurfaceNormal(c,u.direction),d=a.getSurfaceNormalIntersectionWithZAxis(c,11500,u.origin);if(!l(d)){let g;l(n.data.tileBoundingRegion)&&(g=n.data.tileBoundingRegion.minimumHeight);let m=Math.min(g??0,-11500),y=h.multiplyByScalar(f,Math.abs(m)+1,tRe);h.subtract(c,y,u.origin)}let p=n.data.pick(u,re.SCENE3D,s,!1,tRe);if(l(p))return a.cartesianToCartographic(p,NPt).height};_m.prototype.update=function(e){this.show&&e.passes.render&&this._surface.update(e)};_m.prototype.beginFrame=function(e){let t=this._surface,n=t.tileProvider,i=this.terrainProvider,r=l(i)&&i.hasWaterMask&&i.hasWaterMask;if(r&&this._oceanNormalMapResourceDirty){this._oceanNormalMapResourceDirty=!1;let a=this._oceanNormalMapResource,c=a.url;if(l(c)){let u=this;a.fetchImage().then(function(f){c===u._oceanNormalMapResource.url&&(u._oceanNormalMap=u._oceanNormalMap&&u._oceanNormalMap.destroy(),u._oceanNormalMap=new Dt({context:e.context,source:f}))})}else this._oceanNormalMap=this._oceanNormalMap&&this._oceanNormalMap.destroy()}let o=e.passes,s=e.mode;o.render&&(this.showGroundAtmosphere?this._zoomedOutOceanSpecularIntensity=.4:this._zoomedOutOceanSpecularIntensity=.5,t.maximumScreenSpaceError=this.maximumScreenSpaceError,t.tileCacheSize=this.tileCacheSize,t.loadingDescendantLimit=this.loadingDescendantLimit,t.preloadAncestors=this.preloadAncestors,t.preloadSiblings=this.preloadSiblings,n.terrainProvider=this.terrainProvider,n.lightingFadeOutDistance=this.lightingFadeOutDistance,n.lightingFadeInDistance=this.lightingFadeInDistance,n.nightFadeOutDistance=this.nightFadeOutDistance,n.nightFadeInDistance=this.nightFadeInDistance,n.zoomedOutOceanSpecularIntensity=s===re.SCENE3D?this._zoomedOutOceanSpecularIntensity:0,n.hasWaterMask=r,n.showWaterEffect=this.showWaterEffect,n.oceanNormalMap=this._oceanNormalMap,n.enableLighting=this.enableLighting,n.dynamicAtmosphereLighting=this.dynamicAtmosphereLighting,n.dynamicAtmosphereLightingFromSun=this.dynamicAtmosphereLightingFromSun,n.showGroundAtmosphere=this.showGroundAtmosphere,n.atmosphereLightIntensity=this.atmosphereLightIntensity,n.atmosphereRayleighCoefficient=this.atmosphereRayleighCoefficient,n.atmosphereMieCoefficient=this.atmosphereMieCoefficient,n.atmosphereRayleighScaleHeight=this.atmosphereRayleighScaleHeight,n.atmosphereMieScaleHeight=this.atmosphereMieScaleHeight,n.atmosphereMieAnisotropy=this.atmosphereMieAnisotropy,n.shadows=this.shadows,n.hueShift=this.atmosphereHueShift,n.saturationShift=this.atmosphereSaturationShift,n.brightnessShift=this.atmosphereBrightnessShift,n.fillHighlightColor=this.fillHighlightColor,n.showSkirts=this.showSkirts,n.backFaceCulling=this.backFaceCulling,n.vertexShadowDarkness=this.vertexShadowDarkness,n.undergroundColor=this._undergroundColor,n.undergroundColorAlphaByDistance=this._undergroundColorAlphaByDistance,n.lambertDiffuseMultiplier=this.lambertDiffuseMultiplier,t.beginFrame(e))};_m.prototype.render=function(e){this.show&&(l(this._material)&&this._material.update(e.context),this._surface.render(e))};_m.prototype.endFrame=function(e){this.show&&e.passes.render&&this._surface.endFrame(e)};_m.prototype.isDestroyed=function(){return!1};_m.prototype.destroy=function(){return this._surfaceShaderSet=this._surfaceShaderSet&&this._surfaceShaderSet.destroy(),this._surface=this._surface&&this._surface.destroy(),this._oceanNormalMap=this._oceanNormalMap&&this._oceanNormalMap.destroy(),le(this)};var sG=_m;function FPt(e,t,n,i){this.rightAscension=e,this.declination=t,this.rotation=n,this.rotationRate=i}var aG=FPt;var pRe={},BPt=32.184,kPt=2451545,nRe=-.0529921,iRe=-.1059842,rRe=13.0120009,oRe=13.3407154,sRe=.9856003,aRe=26.4057084,cRe=13.064993,lRe=.3287146,uRe=1.7484877,fRe=-.1589763,dRe=.0036096,hRe=.1643573,mRe=12.9590088,wre=new K;pRe.ComputeMoon=function(e,t){l(e)||(e=K.now()),wre=K.addSeconds(e,BPt,wre);let n=K.totalDays(wre)-kPt,i=n/Un.DAYS_PER_JULIAN_CENTURY,r=(125.045+nRe*n)*P.RADIANS_PER_DEGREE,o=(250.089+iRe*n)*P.RADIANS_PER_DEGREE,s=(260.008+rRe*n)*P.RADIANS_PER_DEGREE,a=(176.625+oRe*n)*P.RADIANS_PER_DEGREE,c=(357.529+sRe*n)*P.RADIANS_PER_DEGREE,u=(311.589+aRe*n)*P.RADIANS_PER_DEGREE,f=(134.963+cRe*n)*P.RADIANS_PER_DEGREE,d=(276.617+lRe*n)*P.RADIANS_PER_DEGREE,p=(34.226+uRe*n)*P.RADIANS_PER_DEGREE,g=(15.134+fRe*n)*P.RADIANS_PER_DEGREE,m=(119.743+dRe*n)*P.RADIANS_PER_DEGREE,y=(239.961+hRe*n)*P.RADIANS_PER_DEGREE,A=(25.053+mRe*n)*P.RADIANS_PER_DEGREE,b=Math.sin(r),x=Math.sin(o),T=Math.sin(s),E=Math.sin(a),v=Math.sin(c),S=Math.sin(u),I=Math.sin(f),R=Math.sin(d),O=Math.sin(p),L=Math.sin(g),_=Math.sin(m),C=Math.sin(y),w=Math.sin(A),D=Math.cos(r),N=Math.cos(o),F=Math.cos(s),V=Math.cos(a),B=Math.cos(c),j=Math.cos(u),k=Math.cos(f),G=Math.cos(d),q=Math.cos(p),Q=Math.cos(g),W=Math.cos(m),J=Math.cos(y),Z=Math.cos(A),ae=(269.9949+.0031*i-3.8787*b-.1204*x+.07*T-.0172*E+.0072*S-.0052*L+.0043*w)*P.RADIANS_PER_DEGREE,Ae=(66.5392+.013*i+1.5419*D+.0239*N-.0278*F+.0068*V-.0029*j+9e-4*k+8e-4*Q-9e-4*Z)*P.RADIANS_PER_DEGREE,fe=(38.3213+13.17635815*n-14e-13*n*n+3.561*b+.1208*x-.0642*T+.0158*E+.0252*v-.0066*S-.0047*I-.0046*R+.0028*O+.0052*L+.004*_+.0019*C-.0044*w)*P.RADIANS_PER_DEGREE,xe=(13.17635815-14e-13*(2*n)+3.561*D*nRe+.1208*N*iRe-.0642*F*rRe+.0158*V*oRe+.0252*B*sRe-.0066*j*aRe-.0047*k*cRe-.0046*G*lRe+.0028*q*uRe+.0052*Q*fRe+.004*W*dRe+.0019*J*hRe-.0044*Z*mRe)/86400*P.RADIANS_PER_DEGREE;return l(t)||(t=new aG),t.rightAscension=ae,t.declination=Ae,t.rotation=fe,t.rotationRate=xe,t};var cG=pRe;function gRe(e){(!l(e)||typeof e!="function")&&(e=cG.ComputeMoon),this._computeFunction=e}var UPt=new h,zPt=new h,VPt=new h;function jPt(e,t,n){let i=UPt;i.x=Math.cos(e+P.PI_OVER_TWO),i.y=Math.sin(e+P.PI_OVER_TWO),i.z=0;let r=Math.cos(t),o=VPt;o.x=r*Math.cos(e),o.y=r*Math.sin(e),o.z=Math.sin(t);let s=h.cross(o,i,zPt);return l(n)||(n=new $),n[0]=i.x,n[1]=s.x,n[2]=o.x,n[3]=i.y,n[4]=s.y,n[5]=o.y,n[6]=i.z,n[7]=s.z,n[8]=o.z,n}var HPt=new $,GPt=new Le;gRe.prototype.evaluate=function(e,t){l(e)||(e=K.now());let n=this._computeFunction(e),i=jPt(n.rightAscension,n.declination,t),r=P.zeroToTwoPi(n.rotation),o=Le.fromAxisAngle(h.UNIT_Z,r,GPt),s=$.fromQuaternion(Le.conjugate(o,o),HPt);return $.multiply(s,i,i)};var lG=gRe;var Ire={position:0};function uG(e){e=e??H.EMPTY_OBJECT,this.center=h.clone(e.center??h.ZERO),this._center=new h,this.radii=h.clone(e.radii),this._radii=new h,this._oneOverEllipsoidRadiiSquared=new h,this._boundingSphere=new ue,this.modelMatrix=M.clone(e.modelMatrix??M.IDENTITY),this._modelMatrix=new M,this._computedModelMatrix=new M,this.show=e.show??!0,this.material=e.material??ir.fromType(ir.ColorType),this._material=void 0,this._translucent=void 0,this.id=e.id,this._id=void 0,this.debugShowBoundingVolume=e.debugShowBoundingVolume??!1,this.onlySunLighting=e.onlySunLighting??!1,this._onlySunLighting=!1,this._depthTestEnabled=e.depthTestEnabled??!0,this._useLogDepth=!1,this._sp=void 0,this._rs=void 0,this._va=void 0,this._pickSP=void 0,this._pickId=void 0,this._colorCommand=new at({owner:e._owner??this}),this._pickCommand=new at({owner:e._owner??this,pickOnly:!0});let t=this;this._uniforms={u_radii:function(){return t.radii},u_oneOverEllipsoidRadiiSquared:function(){return t._oneOverEllipsoidRadiiSquared}},this._pickUniforms={czm_pickColor:function(){return t._pickId.color}}}function WPt(e){let t=e.cache.ellipsoidPrimitive_vertexArray;if(l(t))return t;let n=zc.createGeometry(zc.fromDimensions({dimensions:new h(2,2,2),vertexFormat:Be.POSITION_ONLY}));return t=Vn.fromGeometry({context:e,geometry:n,attributeLocations:Ire,bufferUsage:Me.STATIC_DRAW,interleave:!0}),e.cache.ellipsoidPrimitive_vertexArray=t,t}uG.prototype.update=function(e){if(!this.show||e.mode!==re.SCENE3D||!l(this.center)||!l(this.radii))return;let t=e.context,n=this.material.isTranslucent(),i=this._translucent!==n;(!l(this._rs)||i)&&(this._translucent=n,this._rs=Ge.fromCache({cull:{enabled:!0,face:Gi.FRONT},depthTest:{enabled:this._depthTestEnabled},depthMask:!n&&t.fragmentDepth,blending:n?nn.ALPHA_BLEND:void 0})),l(this._va)||(this._va=WPt(t));let r=!1,o=this.radii;if(!h.equals(this._radii,o)){h.clone(o,this._radii);let y=this._oneOverEllipsoidRadiiSquared;y.x=1/(o.x*o.x),y.y=1/(o.y*o.y),y.z=1/(o.z*o.z),r=!0}(!M.equals(this.modelMatrix,this._modelMatrix)||!h.equals(this.center,this._center))&&(M.clone(this.modelMatrix,this._modelMatrix),h.clone(this.center,this._center),M.multiplyByTranslation(this.modelMatrix,this.center,this._computedModelMatrix),r=!0),r&&(h.clone(h.ZERO,this._boundingSphere.center),this._boundingSphere.radius=h.maximumComponent(o),ue.transform(this._boundingSphere,this._computedModelMatrix,this._boundingSphere));let s=this._material!==this.material;this._material=this.material,this._material.update(t);let a=this.onlySunLighting!==this._onlySunLighting;this._onlySunLighting=this.onlySunLighting;let c=e.useLogDepth,u=this._useLogDepth!==c;this._useLogDepth=c;let f=this._colorCommand,d,p;(s||a||i||u)&&(d=new Xe({sources:[dP]}),p=new Xe({sources:[this.material.shaderSource,fP]}),this.onlySunLighting&&p.defines.push("ONLY_SUN_LIGHTING"),!n&&t.fragmentDepth&&p.defines.push("WRITE_DEPTH"),this._useLogDepth&&(d.defines.push("LOG_DEPTH"),p.defines.push("LOG_DEPTH")),this._sp=Qt.replaceCache({context:t,shaderProgram:this._sp,vertexShaderSource:d,fragmentShaderSource:p,attributeLocations:Ire}),f.vertexArray=this._va,f.renderState=this._rs,f.shaderProgram=this._sp,f.uniformMap=Mt(this._uniforms,this.material._uniforms),f.executeInClosestFrustum=n);let g=e.commandList,m=e.passes;if(m.render&&(f.boundingVolume=this._boundingSphere,f.debugShowBoundingVolume=this.debugShowBoundingVolume,f.modelMatrix=this._computedModelMatrix,f.pass=n?Ie.TRANSLUCENT:Ie.OPAQUE,g.push(f)),m.pick){let y=this._pickCommand;(!l(this._pickId)||this._id!==this.id)&&(this._id=this.id,this._pickId=this._pickId&&this._pickId.destroy(),this._pickId=t.createPickId({primitive:this,id:this.id})),(s||a||!l(this._pickSP)||u)&&(d=new Xe({sources:[dP]}),p=new Xe({sources:[this.material.shaderSource,fP],pickColorQualifier:"uniform"}),this.onlySunLighting&&p.defines.push("ONLY_SUN_LIGHTING"),!n&&t.fragmentDepth&&p.defines.push("WRITE_DEPTH"),this._useLogDepth&&(d.defines.push("LOG_DEPTH"),p.defines.push("LOG_DEPTH")),this._pickSP=Qt.replaceCache({context:t,shaderProgram:this._pickSP,vertexShaderSource:d,fragmentShaderSource:p,attributeLocations:Ire}),y.vertexArray=this._va,y.renderState=this._rs,y.shaderProgram=this._pickSP,y.uniformMap=Mt(Mt(this._uniforms,this._pickUniforms),this.material._uniforms),y.executeInClosestFrustum=n),y.boundingVolume=this._boundingSphere,y.modelMatrix=this._computedModelMatrix,y.pass=n?Ie.TRANSLUCENT:Ie.OPAQUE,g.push(y)}};uG.prototype.isDestroyed=function(){return!1};uG.prototype.destroy=function(){return this._sp=this._sp&&this._sp.destroy(),this._pickSP=this._pickSP&&this._pickSP.destroy(),this._pickId=this._pickId&&this._pickId.destroy(),le(this)};var fG=uG;function LO(e){e=e??H.EMPTY_OBJECT;let t=e.textureUrl;l(t)||(t=Zt("Assets/Textures/moonSmall.jpg")),this.show=e.show??!0,this.textureUrl=t,this._ellipsoid=e.ellipsoid??ee.MOON,this.onlySunLighting=e.onlySunLighting??!0,this._ellipsoidPrimitive=new fG({radii:this.ellipsoid.radii,material:ir.fromType(ir.ImageType),depthTestEnabled:!1,_owner:this}),this._ellipsoidPrimitive.material.translucent=!1,this._axes=new lG}Object.defineProperties(LO.prototype,{ellipsoid:{get:function(){return this._ellipsoid}}});var dG=new $,qPt=new $,YPt=new h,hG=[];LO.prototype.update=function(e){if(!this.show)return;let t=this._ellipsoidPrimitive;t.material.uniforms.image=this.textureUrl,t.onlySunLighting=this.onlySunLighting;let n=e.time;l(At.computeIcrfToFixedMatrix(n,dG))||At.computeTemeToPseudoFixedMatrix(n,dG);let i=this._axes.evaluate(n,qPt);$.transpose(i,i),$.multiply(dG,i,i);let r=Pb.computeMoonPositionInEarthInertialFrame(n,YPt);$.multiplyByVector(dG,r,r),M.fromRotationTranslation(i,r,t.modelMatrix);let o=e.commandList;return e.commandList=hG,hG.length=0,t.update(e),e.commandList=o,hG.length===1?hG[0]:void 0};LO.prototype.isDestroyed=function(){return!1};LO.prototype.destroy=function(){return this._ellipsoidPrimitive=this._ellipsoidPrimitive&&this._ellipsoidPrimitive.destroy(),le(this)};var mG=LO;var Pre=[],Dre=[];function XPt(e,t,n,i,r,o){let s=r-i+1,a=o-r,c=Pre,u=Dre,f,d;for(f=0;f<s;++f)c[f]=e[i+f];for(d=0;d<a;++d)u[d]=e[r+d+1];f=0,d=0;for(let p=i;p<=o;++p){let g=c[f],m=u[d];f<s&&(d>=a||t(g,m,n)<=0)?(e[p]=g,++f):d<a&&(e[p]=m,++d)}}function Rre(e,t,n,i,r){if(i>=r)return;let o=Math.floor((i+r)*.5);Rre(e,t,n,i,o),Rre(e,t,n,o+1,r),XPt(e,t,n,i,o,r)}function KPt(e,t,n){let i=e.length,r=Math.ceil(i*.5);Pre.length=r,Dre.length=r,Rre(e,t,n,0,i-1),Pre.length=0,Dre.length=0}var t_=KPt;function ul(e,t){this._occluderPosition=h.clone(e.center),this._occluderRadius=e.radius,this._horizonDistance=0,this._horizonPlaneNormal=void 0,this._horizonPlanePosition=void 0,this._cameraPosition=void 0,this.cameraPosition=t}var pG=new h;Object.defineProperties(ul.prototype,{position:{get:function(){return this._occluderPosition}},radius:{get:function(){return this._occluderRadius}},cameraPosition:{set:function(e){e=h.clone(e,this._cameraPosition);let t=h.subtract(this._occluderPosition,e,pG),n=h.magnitudeSquared(t),i=this._occluderRadius*this._occluderRadius,r,o,s;if(n>i){r=Math.sqrt(n-i),n=1/Math.sqrt(n),o=h.multiplyByScalar(t,n,pG);let a=r*r*n;s=h.add(e,h.multiplyByScalar(o,a,pG),pG)}else r=Number.MAX_VALUE;this._horizonDistance=r,this._horizonPlaneNormal=o,this._horizonPlanePosition=s,this._cameraPosition=e}}});ul.fromBoundingSphere=function(e,t,n){return l(n)?(h.clone(e.center,n._occluderPosition),n._occluderRadius=e.radius,n.cameraPosition=t,n):new ul(e,t)};var yRe=new h;ul.prototype.isPointVisible=function(e){if(this._horizonDistance!==Number.MAX_VALUE){let t=h.subtract(e,this._occluderPosition,yRe),n=this._occluderRadius;if(n=h.magnitudeSquared(t)-n*n,n>0)return n=Math.sqrt(n)+this._horizonDistance,t=h.subtract(e,this._cameraPosition,t),n*n>h.magnitudeSquared(t)}return!1};var $Pt=new h;ul.prototype.isBoundingSphereVisible=function(e){let t=h.clone(e.center,$Pt),n=e.radius;if(this._horizonDistance!==Number.MAX_VALUE){let i=h.subtract(t,this._occluderPosition,yRe),r=this._occluderRadius-n;if(r=h.magnitudeSquared(i)-r*r,n<this._occluderRadius)return r>0?(r=Math.sqrt(r)+this._horizonDistance,i=h.subtract(t,this._cameraPosition,i),r*r+n*n>h.magnitudeSquared(i)):!1;if(r>0){i=h.subtract(t,this._cameraPosition,i);let o=h.magnitudeSquared(i),s=this._occluderRadius*this._occluderRadius,a=n*n;return(this._horizonDistance*this._horizonDistance+s)*a>o*s?!0:(r=Math.sqrt(r)+this._horizonDistance,r*r+a>o)}return!0}return!1};var JPt=new h;ul.prototype.computeVisibility=function(e){let t=h.clone(e.center),n=e.radius;if(n>this._occluderRadius)return ns.FULL;if(this._horizonDistance!==Number.MAX_VALUE){let i=h.subtract(t,this._occluderPosition,JPt),r=this._occluderRadius-n,o=h.magnitudeSquared(i);if(r=o-r*r,r>0){r=Math.sqrt(r)+this._horizonDistance,i=h.subtract(t,this._cameraPosition,i);let s=h.magnitudeSquared(i);return r*r+n*n<s?ns.NONE:(r=this._occluderRadius+n,r=o-r*r,r>0?(r=Math.sqrt(r)+this._horizonDistance,s<r*r+n*n?ns.FULL:ns.PARTIAL):(i=h.subtract(t,this._horizonPlanePosition,i),h.dot(i,this._horizonPlaneNormal)>-n?ns.PARTIAL:ns.FULL))}}return ns.NONE};var gG=new h;ul.computeOccludeePoint=function(e,t,n){let i=h.clone(t),r=h.clone(e.center),o=e.radius,s=n.length,a=h.normalize(h.subtract(i,r,gG),gG),c=-h.dot(a,r),u=ul._anyRotationVector(r,a,c),f=ul._horizonToPlaneNormalDotProduct(e,a,c,u,n[0]);if(!f)return;let d;for(let g=1;g<s;++g){if(d=ul._horizonToPlaneNormalDotProduct(e,a,c,u,n[g]),!d)return;d<f&&(f=d)}if(f<.0017453283658983088)return;let p=o/f;return h.add(r,h.multiplyByScalar(a,p,gG),gG)};var ZPt=[];ul.computeOccludeePointFromRectangle=function(e,t){t=t??ee.default;let n=ie.subsample(e,t,0,ZPt),i=ue.fromPoints(n),r=h.ZERO;if(!h.equals(r,i.center))return ul.computeOccludeePoint(new ue(r,t.minimumRadius),i.center,n)};var QPt=new h;ul._anyRotationVector=function(e,t,n){let i=h.abs(t,QPt),r=i.x>i.y?0:1;(r===0&&i.z>i.x||r===1&&i.z>i.y)&&(r=2);let o=new h,s;r===0?(i.x=e.x,i.y=e.y+1,i.z=e.z+1,s=h.UNIT_X):r===1?(i.x=e.x+1,i.y=e.y,i.z=e.z+1,s=h.UNIT_Y):(i.x=e.x+1,i.y=e.y+1,i.z=e.z,s=h.UNIT_Z);let a=(h.dot(t,i)+n)/-h.dot(t,s);return h.normalize(h.subtract(h.add(i,h.multiplyByScalar(s,a,o),i),e,i),i)};var eDt=new h;ul._rotationVector=function(e,t,n,i,r){let o=h.subtract(i,e,eDt);if(o=h.normalize(o,o),h.dot(t,o)<.9999999847691291){let s=h.cross(t,o,o);if(h.magnitude(s)>P.EPSILON13)return h.normalize(s,new h)}return r};var Ore=new h,tDt=new h,_G=new h,_Re=new h;ul._horizonToPlaneNormalDotProduct=function(e,t,n,i,r){let o=h.clone(r,Ore),s=h.clone(e.center,tDt),a=e.radius,c=h.subtract(s,o,_G),u=h.magnitudeSquared(c),f=a*a;if(u<f)return!1;let d=u-f,p=Math.sqrt(d),m=1/Math.sqrt(u),A=p*m*p;c=h.normalize(c,c);let b=h.add(o,h.multiplyByScalar(c,A,_Re),_Re),x=Math.sqrt(d-A*A),T=this._rotationVector(s,t,n,o,i),E=h.fromElements(T.x*T.x*c.x+(T.x*T.y-T.z)*c.y+(T.x*T.z+T.y)*c.z,(T.x*T.y+T.z)*c.x+T.y*T.y*c.y+(T.y*T.z-T.x)*c.z,(T.x*T.z-T.y)*c.x+(T.y*T.z+T.x)*c.y+T.z*T.z*c.z,Ore);E=h.normalize(E,E);let v=h.multiplyByScalar(E,x,Ore);T=h.normalize(h.subtract(h.add(b,v,_G),s,_G),_G);let S=h.dot(t,T);T=h.normalize(h.subtract(h.subtract(b,v,T),s,T),T);let I=h.dot(t,T);return S<I?S:I};var yG=ul;function a0(e){e=e??H.EMPTY_OBJECT,this.left=e.left,this._left=void 0,this.right=e.right,this._right=void 0,this.top=e.top,this._top=void 0,this.bottom=e.bottom,this._bottom=void 0,this.near=e.near??1,this._near=this.near,this.far=e.far??5e8,this._far=this.far,this._cullingVolume=new aa,this._perspectiveMatrix=new M,this._infinitePerspective=new M}function Mre(e){let{top:t,bottom:n,right:i,left:r,near:o,far:s}=e;(t!==e._top||n!==e._bottom||r!==e._left||i!==e._right||o!==e._near||s!==e._far)&&(e._left=r,e._right=i,e._top=t,e._bottom=n,e._near=o,e._far=s,e._perspectiveMatrix=M.computePerspectiveOffCenter(r,i,n,t,o,s,e._perspectiveMatrix),e._infinitePerspective=M.computeInfinitePerspectiveOffCenter(r,i,n,t,o,e._infinitePerspective))}Object.defineProperties(a0.prototype,{projectionMatrix:{get:function(){return Mre(this),this._perspectiveMatrix}},infiniteProjectionMatrix:{get:function(){return Mre(this),this._infinitePerspective}}});var nDt=new h,iDt=new h,rDt=new h,oDt=new h;a0.prototype.computeCullingVolume=function(e,t,n){let i=this._cullingVolume.planes,r=this.top,o=this.bottom,s=this.right,a=this.left,c=this.near,u=this.far,f=h.cross(t,n,nDt),d=iDt;h.multiplyByScalar(t,c,d),h.add(e,d,d);let p=rDt;h.multiplyByScalar(t,u,p),h.add(e,p,p);let g=oDt;h.multiplyByScalar(f,a,g),h.add(d,g,g),h.subtract(g,e,g),h.normalize(g,g),h.cross(g,n,g),h.normalize(g,g);let m=i[0];return l(m)||(m=i[0]=new se),m.x=g.x,m.y=g.y,m.z=g.z,m.w=-h.dot(g,e),h.multiplyByScalar(f,s,g),h.add(d,g,g),h.subtract(g,e,g),h.cross(n,g,g),h.normalize(g,g),m=i[1],l(m)||(m=i[1]=new se),m.x=g.x,m.y=g.y,m.z=g.z,m.w=-h.dot(g,e),h.multiplyByScalar(n,o,g),h.add(d,g,g),h.subtract(g,e,g),h.cross(f,g,g),h.normalize(g,g),m=i[2],l(m)||(m=i[2]=new se),m.x=g.x,m.y=g.y,m.z=g.z,m.w=-h.dot(g,e),h.multiplyByScalar(n,r,g),h.add(d,g,g),h.subtract(g,e,g),h.cross(g,f,g),h.normalize(g,g),m=i[3],l(m)||(m=i[3]=new se),m.x=g.x,m.y=g.y,m.z=g.z,m.w=-h.dot(g,e),m=i[4],l(m)||(m=i[4]=new se),m.x=t.x,m.y=t.y,m.z=t.z,m.w=-h.dot(t,d),h.negate(t,g),m=i[5],l(m)||(m=i[5]=new se),m.x=g.x,m.y=g.y,m.z=g.z,m.w=-h.dot(g,p),this._cullingVolume};a0.prototype.getPixelDimensions=function(e,t,n,i,r){Mre(this);let o=1/this.near,s=this.top*o,a=2*i*n*s/t;s=this.right*o;let c=2*i*n*s/e;return r.x=c,r.y=a,r};a0.prototype.clone=function(e){return l(e)||(e=new a0),e.right=this.right,e.left=this.left,e.top=this.top,e.bottom=this.bottom,e.near=this.near,e.far=this.far,e._left=void 0,e._right=void 0,e._top=void 0,e._bottom=void 0,e._near=void 0,e._far=void 0,e};a0.prototype.equals=function(e){return l(e)&&e instanceof a0&&this.right===e.right&&this.left===e.left&&this.top===e.top&&this.bottom===e.bottom&&this.near===e.near&&this.far===e.far};a0.prototype.equalsEpsilon=function(e,t,n){return e===this||l(e)&&e instanceof a0&&P.equalsEpsilon(this.right,e.right,t,n)&&P.equalsEpsilon(this.left,e.left,t,n)&&P.equalsEpsilon(this.top,e.top,t,n)&&P.equalsEpsilon(this.bottom,e.bottom,t,n)&&P.equalsEpsilon(this.near,e.near,t,n)&&P.equalsEpsilon(this.far,e.far,t,n)};var Wu=a0;function qu(e){e=e??H.EMPTY_OBJECT,this._offCenterFrustum=new Wu,this.fov=e.fov,this._fov=void 0,this._fovy=void 0,this._sseDenominator=void 0,this.aspectRatio=e.aspectRatio,this._aspectRatio=void 0,this.near=e.near??1,this._near=this.near,this.far=e.far??5e8,this._far=this.far,this.xOffset=e.xOffset??0,this._xOffset=this.xOffset,this.yOffset=e.yOffset??0,this._yOffset=this.yOffset}qu.packedLength=6;qu.pack=function(e,t,n){return n=n??0,t[n++]=e.fov,t[n++]=e.aspectRatio,t[n++]=e.near,t[n++]=e.far,t[n++]=e.xOffset,t[n]=e.yOffset,t};qu.unpack=function(e,t,n){return t=t??0,l(n)||(n=new qu),n.fov=e[t++],n.aspectRatio=e[t++],n.near=e[t++],n.far=e[t++],n.xOffset=e[t++],n.yOffset=e[t],n};function ym(e){if(!(e.fov!==e._fov||e.aspectRatio!==e._aspectRatio||e.near!==e._near||e.far!==e._far||e.xOffset!==e._xOffset||e.yOffset!==e._yOffset))return;e._aspectRatio=e.aspectRatio,e._fov=e.fov,e._fovy=e.aspectRatio<=1?e.fov:Math.atan(Math.tan(e.fov*.5)/e.aspectRatio)*2,e._near=e.near,e._far=e.far,e._sseDenominator=2*Math.tan(.5*e._fovy),e._xOffset=e.xOffset,e._yOffset=e.yOffset;let n=e._offCenterFrustum;n.top=e.near*Math.tan(.5*e._fovy),n.bottom=-n.top,n.right=e.aspectRatio*n.top,n.left=-n.right,n.near=e.near,n.far=e.far,n.right+=e.xOffset,n.left+=e.xOffset,n.top+=e.yOffset,n.bottom+=e.yOffset}Object.defineProperties(qu.prototype,{projectionMatrix:{get:function(){return ym(this),this._offCenterFrustum.projectionMatrix}},infiniteProjectionMatrix:{get:function(){return ym(this),this._offCenterFrustum.infiniteProjectionMatrix}},fovy:{get:function(){return ym(this),this._fovy}},sseDenominator:{get:function(){return ym(this),this._sseDenominator}},offCenterFrustum:{get:function(){return ym(this),this._offCenterFrustum}}});qu.prototype.computeCullingVolume=function(e,t,n){return ym(this),this._offCenterFrustum.computeCullingVolume(e,t,n)};qu.prototype.getPixelDimensions=function(e,t,n,i,r){return ym(this),this._offCenterFrustum.getPixelDimensions(e,t,n,i,r)};qu.prototype.clone=function(e){return l(e)||(e=new qu),e.aspectRatio=this.aspectRatio,e.fov=this.fov,e.near=this.near,e.far=this.far,e._aspectRatio=void 0,e._fov=void 0,e._near=void 0,e._far=void 0,this._offCenterFrustum.clone(e._offCenterFrustum),e};qu.prototype.equals=function(e){return!l(e)||!(e instanceof qu)?!1:(ym(this),ym(e),this.fov===e.fov&&this.aspectRatio===e.aspectRatio&&this._offCenterFrustum.equals(e._offCenterFrustum))};qu.prototype.equalsEpsilon=function(e,t,n){return!l(e)||!(e instanceof qu)?!1:(ym(this),ym(e),P.equalsEpsilon(this.fov,e.fov,t,n)&&P.equalsEpsilon(this.aspectRatio,e.aspectRatio,t,n)&&this._offCenterFrustum.equalsEpsilon(e._offCenterFrustum,t,n))};var er=qu;function FO(){this._colorTexture=void 0,this._drawCommand=void 0}Object.defineProperties(FO.prototype,{colorTexture:{get:function(){return this._colorTexture}}});function sDt(e,t,n){let i=t.createViewportQuadCommand(p2,{framebuffer:n,renderState:Ge.fromCache({viewport:new et(0,0,256,256)})});e._drawCommand=i}FO.prototype.update=function(e){if(!l(this._colorTexture)){let t=e.context,n=new Dt({context:t,width:256,height:256,pixelFormat:$e.RGBA,pixelDatatype:ze.UNSIGNED_BYTE,sampler:Ht.NEAREST});this._colorTexture=n;let i=new vs({context:t,colorTextures:[n],destroyAttachments:!1});sDt(this,t,i),this._drawCommand.execute(t),i.destroy(),this._drawCommand.shaderProgram=this._drawCommand.shaderProgram&&this._drawCommand.shaderProgram.destroy()}};FO.prototype.isDestroyed=function(){return!1};FO.prototype.destroy=function(){return this._colorTexture=this._colorTexture&&this._colorTexture.destroy(),le(this)};var AG=FO;var TRe={};function aDt(e,t,n){let i,r,o;if(e instanceof er){let s=Math.tan(.5*e.fovy);return i=e.near,r=e.near*s,o=e.aspectRatio*r,Math.max(t*i/o,n*i/r)}else if(e instanceof Wu)return i=e.near,r=e.top,o=e.right,Math.max(t*i/o,n*i/r);return Math.max(t,n)}var cDt=new h,ARe=new h;function ERe(e,t,n,i){if(l(i)&&n(.5)>i){let r=n(0),o=n(1),s=n(.5),a=s-r,c=s-o;return function(u){let f=n(u);if(u<=.5){let p=(f-r)/a;return P.lerp(e,-P.PI_OVER_TWO,p)}let d=(f-o)/c;return P.lerp(-P.PI_OVER_TWO,t,1-d)}}return function(r){return P.lerp(e,t,r)}}function Lre(e,t,n,i,r){let o=r,s=Math.max(n,i);if(!l(o)){let a=e.position,c=t,u=e.up,f=e.right,d=e.frustum,p=h.subtract(a,c,cDt),g=h.magnitude(h.multiplyByScalar(u,h.dot(p,u),ARe)),m=h.magnitude(h.multiplyByScalar(f,h.dot(p,f),ARe));o=Math.min(aDt(d,g,m)*.2,1e9)}if(s<o){let u=-Math.pow((o-n)*1e6,.125),f=Math.pow((o-i)*1e6,1/8);return function(d){let p=d*(f-u)+u;return-Math.pow(p,8)/1e6+o}}return function(a){return P.lerp(n,i,a)}}function BO(e,t){return P.equalsEpsilon(e,P.TWO_PI,P.EPSILON11)&&(e=0),t>e+Math.PI?e+=P.TWO_PI:t<e-Math.PI&&(e-=P.TWO_PI),e}var CRe=new h;function lDt(e,t,n,i,r,o,s,a){let c=e.camera,u=h.clone(c.position,CRe),f=c.pitch,d=BO(c.heading,i),p=BO(c.roll,o),g=Lre(c,n,u.z,n.z,s),m=ERe(f,r,g,a);function y(A){let b=A.time/t;c.setView({orientation:{heading:P.lerp(d,i,b),pitch:m(b),roll:P.lerp(p,o,b)}}),U.lerp(u,n,b,c.position),c.position.z=g(b)}return y}function uDt(e,t){e.longitude<t.longitude?e.longitude+=P.TWO_PI:t.longitude+=P.TWO_PI}function fDt(e,t){let n=e.longitude-t.longitude;n<-P.PI?e.longitude+=P.TWO_PI:n>P.PI&&(t.longitude+=P.TWO_PI)}var dDt=new he,hDt=new he;function mDt(e,t,n,i,r,o,s,a,c,u){let f=e.camera,p=e.mapProjection.ellipsoid,g=he.clone(f.positionCartographic,dDt),m=f.pitch,y=BO(f.heading,i),A=BO(f.roll,o),b=p.cartesianToCartographic(n,hDt);g.longitude=P.zeroToTwoPi(g.longitude),b.longitude=P.zeroToTwoPi(b.longitude);let x=!1;if(l(a)){let S=P.zeroToTwoPi(a),I=Math.min(g.longitude,b.longitude),R=Math.max(g.longitude,b.longitude),O=S>=I&&S<=R;if(l(c)){let L=Math.abs(g.longitude-b.longitude),_=P.TWO_PI-L;(O?L:_)<(O?_:L)*c&&!O&&(x=!0)}else O||(x=!0)}x?uDt(g,b):fDt(g,b);let T=Lre(f,n,g.height,b.height,s),E=ERe(m,r,T,u);function v(){let S=g.longitude,I=b.longitude,R=g.latitude,O=b.latitude;return function(_){let C=_.time/t,w=h.fromRadians(P.lerp(S,I,C),P.lerp(R,O,C),T(C),p);f.setView({destination:w,orientation:{heading:P.lerp(y,i,C),pitch:E(C),roll:P.lerp(A,o,C)}})}}return v()}function pDt(e,t,n,i,r,o,s){let a=e.camera,c=h.clone(a.position,CRe),u=BO(a.heading,i),f=a.frustum.right-a.frustum.left,d=Lre(a,n,f,n.z,s);function p(g){let m=g.time/t;a.setView({orientation:{heading:P.lerp(u,i,m)}}),U.lerp(c,n,m,a.position);let y=d(m),A=a.frustum,b=A.top/A.right,x=(y-(A.right-A.left))*.5;A.right+=x,A.left-=x,A.top=b*A.right,A.bottom=-A.top}return p}var bRe=new he,gDt=new h;function Nre(e,t){return{startObject:{},stopObject:{},duration:0,complete:e,cancel:t}}function xRe(e,t){function n(){typeof t=="function"&&t(),e.enableInputs=!0}return n}TRe.createTween=function(e,t){t=t??H.EMPTY_OBJECT;let n=t.destination,i=e.mode;if(i===re.MORPHING)return Nre();let r=t.convert??!0,o=e.mapProjection,s=o.ellipsoid,a=t.maximumHeight,c=t.flyOverLongitude,u=t.flyOverLongitudeWeight,f=t.pitchAdjustHeight,d=t.easingFunction;r&&i!==re.SCENE3D&&(s.cartesianToCartographic(n,bRe),n=o.project(bRe,gDt));let p=e.camera,g=t.endTransform;l(g)&&p._setTransform(g);let m=t.duration;l(m)||(m=Math.ceil(h.distance(p.position,n)/1e6)+2,m=Math.min(m,3));let y=t.heading??0,A=t.pitch??-P.PI_OVER_TWO,b=t.roll??0,x=e.screenSpaceCameraController;x.enableInputs=!1;let T=xRe(x,t.complete),E=xRe(x,t.cancel),v=p.frustum,S=e.mode===re.SCENE2D;if(S=S&&U.equalsEpsilon(p.position,n,P.EPSILON6),S=S&&P.equalsEpsilon(Math.max(v.right-v.left,v.top-v.bottom),n.z,P.EPSILON6),S=S||e.mode!==re.SCENE2D&&h.equalsEpsilon(n,p.position,P.EPSILON10),S=S&&P.equalsEpsilon(P.negativePiToPi(y),P.negativePiToPi(p.heading),P.EPSILON10)&&P.equalsEpsilon(P.negativePiToPi(A),P.negativePiToPi(p.pitch),P.EPSILON10)&&P.equalsEpsilon(P.negativePiToPi(b),P.negativePiToPi(p.roll),P.EPSILON10),S)return Nre(T,E);let I=new Array(4);if(I[re.SCENE2D]=pDt,I[re.SCENE3D]=mDt,I[re.COLUMBUS_VIEW]=lDt,m<=0)return Nre(function(){I[i](e,1,n,y,A,b,a,c,u,f)({time:1}),typeof T=="function"&&T()},E);let R=I[i](e,m,n,y,A,b,a,c,u,f);if(!l(d)){let O=p.positionCartographic.height,L=i===re.SCENE3D?s.cartesianToCartographic(n).height:n.z;O>L&&O>11500?d=ks.CUBIC_OUT:d=ks.QUINTIC_IN_OUT}return{duration:m,easingFunction:d,startObject:{time:0},stopObject:{time:m},update:R,complete:T,cancel:E}};var bG=TRe;var vRe={ROTATE:0,INFINITE_SCROLL:1};Object.freeze(vRe);var Yu=vRe;function an(e){this._scene=e,this._transform=M.clone(M.IDENTITY),this._invTransform=M.clone(M.IDENTITY),this._actualTransform=M.clone(M.IDENTITY),this._actualInvTransform=M.clone(M.IDENTITY),this._transformChanged=!1,this.position=new h,this._position=new h,this._positionWC=new h,this._positionCartographic=new he,this._oldPositionWC=void 0,this.positionWCDeltaMagnitude=0,this.positionWCDeltaMagnitudeLastFrame=0,this.timeSinceMoved=0,this._lastMovedTimestamp=0,this.direction=new h,this._direction=new h,this._directionWC=new h,this.up=new h,this._up=new h,this._upWC=new h,this.right=new h,this._right=new h,this._rightWC=new h,this.frustum=new er,this.frustum.aspectRatio=e.drawingBufferWidth/e.drawingBufferHeight,this.frustum.fov=P.toRadians(60),this.defaultMoveAmount=1e5,this.defaultLookAmount=Math.PI/60,this.defaultRotateAmount=Math.PI/3600,this.defaultZoomAmount=1e5,this.constrainedAxis=void 0,this.maximumZoomFactor=1.5,this._moveStart=new be,this._moveEnd=new be,this._changed=new be,this._changedPosition=void 0,this._changedDirection=void 0,this._changedFrustum=void 0,this._changedHeading=void 0,this._changedRoll=void 0,this.percentageChanged=.5,this._viewMatrix=new M,this._invViewMatrix=new M,FRe(this),this._mode=re.SCENE3D,this._modeChanged=!0;let t=e.mapProjection;this._projection=t,this._maxCoord=t.project(new he(Math.PI,P.PI_OVER_TWO)),this._max2Dfrustum=void 0,XRe(this,an.DEFAULT_VIEW_RECTANGLE,this.position,!0);let n=h.magnitude(this.position);n+=n*an.DEFAULT_VIEW_FACTOR,h.normalize(this.position,this.position),h.multiplyByScalar(this.position,n,this.position)}an.TRANSFORM_2D=new M(0,0,1,0,1,0,0,0,0,1,0,0,0,0,0,1);an.TRANSFORM_2D_INVERSE=M.inverseTransformation(an.TRANSFORM_2D,new M);an.DEFAULT_VIEW_RECTANGLE=ie.fromDegrees(-95,-20,-70,90);an.DEFAULT_VIEW_FACTOR=.5;an.DEFAULT_OFFSET=new om(0,-P.PI_OVER_FOUR,0);function FRe(e){M.computeView(e._position,e._direction,e._up,e._right,e._viewMatrix),M.multiply(e._viewMatrix,e._actualInvTransform,e._viewMatrix),M.inverseTransformation(e._viewMatrix,e._invViewMatrix)}function _Dt(e){if(!l(e._oldPositionWC))e._oldPositionWC=h.clone(e.positionWC,e._oldPositionWC);else{e.positionWCDeltaMagnitudeLastFrame=e.positionWCDeltaMagnitude;let t=h.subtract(e.positionWC,e._oldPositionWC,e._oldPositionWC);e.positionWCDeltaMagnitude=h.magnitude(t),e._oldPositionWC=h.clone(e.positionWC,e._oldPositionWC),e.positionWCDeltaMagnitude>0?(e.timeSinceMoved=0,e._lastMovedTimestamp=xn()):e.timeSinceMoved=Math.max(xn()-e._lastMovedTimestamp,0)/1e3}}an.prototype.canPreloadFlight=function(){return l(this._currentFlight)&&this._mode!==re.SCENE2D};an.prototype._updateCameraChanged=function(){let e=this;if(_Dt(e),e._changed.numberOfListeners===0)return;let t=e.percentageChanged,n=e.heading;l(e._changedHeading)||(e._changedHeading=n);let i=Math.abs(e._changedHeading-n)%P.TWO_PI;i=i>P.PI?P.TWO_PI-i:i;let r=i/Math.PI;r>t&&(e._changedHeading=n);let o=e.roll;l(e._changedRoll)||(e._changedRoll=o);let s=Math.abs(e._changedRoll-o)%P.TWO_PI;s=s>P.PI?P.TWO_PI-s:s;let a=s/Math.PI;if(a>t&&(e._changedRoll=o),(a>t||r>t)&&e._changed.raiseEvent(Math.max(a,r)),e._mode===re.SCENE2D){if(!l(e._changedFrustum)){e._changedPosition=h.clone(e.position,e._changedPosition),e._changedFrustum=e.frustum.clone();return}let p=e.position,g=e._changedPosition,m=e.frustum,y=e._changedFrustum,A=p.x+m.left,b=p.x+m.right,x=g.x+y.left,T=g.x+y.right,E=p.y+m.bottom,v=p.y+m.top,S=g.y+y.bottom,I=g.y+y.top,R=Math.max(A,x),O=Math.min(b,T),L=Math.max(E,S),_=Math.min(v,I),C;if(R>=O||L>=v)C=1;else{let w=y;A<x&&b>T&&E<S&&v>I&&(w=m),C=1-(O-R)*(_-L)/((w.right-w.left)*(w.top-w.bottom))}C>t&&(e._changed.raiseEvent(C),e._changedPosition=h.clone(e.position,e._changedPosition),e._changedFrustum=e.frustum.clone(e._changedFrustum));return}if(!l(e._changedDirection)){e._changedPosition=h.clone(e.positionWC,e._changedPosition),e._changedDirection=h.clone(e.directionWC,e._changedDirection);return}let c=P.acosClamped(h.dot(e.directionWC,e._changedDirection)),u;l(e.frustum.fovy)?u=c/(e.frustum.fovy*.5):u=c;let d=h.distance(e.positionWC,e._changedPosition)/e.positionCartographic.height;(u>t||d>t)&&(e._changed.raiseEvent(Math.max(u,d)),e._changedPosition=h.clone(e.positionWC,e._changedPosition),e._changedDirection=h.clone(e.directionWC,e._changedDirection))};function yDt(e){At.basisTo2D(e._projection,e._transform,e._actualTransform)}var ADt=new he,bDt=new h,xG=new h,xDt=new se,TDt=new se,EDt=new se,CDt=new se,vDt=new se;function SDt(e){let t=e._projection,n=t.ellipsoid,i=M.getColumn(e._transform,3,xDt),r=n.cartesianToCartographic(i,ADt),o=t.project(r,bDt),s=TDt;s.x=o.z,s.y=o.x,s.z=o.y,s.w=1;let a=se.clone(se.UNIT_X,vDt),c=se.add(M.getColumn(e._transform,0,xG),i,xG);n.cartesianToCartographic(c,r),t.project(r,o);let u=EDt;u.x=o.z,u.y=o.x,u.z=o.y,u.w=0,h.subtract(u,s,u),u.x=0;let f=CDt;if(h.magnitudeSquared(u)>P.EPSILON10)h.cross(a,u,f);else{let d=se.add(M.getColumn(e._transform,1,xG),i,xG);n.cartesianToCartographic(d,r),t.project(r,o),f.x=o.z,f.y=o.x,f.z=o.y,f.w=0,h.subtract(f,s,f),f.x=0,h.magnitudeSquared(f)<P.EPSILON10&&(se.clone(se.UNIT_Y,u),se.clone(se.UNIT_Z,f))}h.cross(f,a,u),h.normalize(u,u),h.cross(a,u,f),h.normalize(f,f),M.setColumn(e._actualTransform,0,u,e._actualTransform),M.setColumn(e._actualTransform,1,f,e._actualTransform),M.setColumn(e._actualTransform,2,a,e._actualTransform),M.setColumn(e._actualTransform,3,s,e._actualTransform)}var Fre=new h;function dl(e){let t=e._mode,n=!1,i=0;t===re.SCENE2D&&(i=e.frustum.right-e.frustum.left,n=i!==e._positionCartographic.height);let r=e._position,o=!h.equals(r,e.position)||n;o&&(r=h.clone(e.position,e._position));let s=e._direction,a=!h.equals(s,e.direction);a&&(h.normalize(e.direction,e.direction),s=h.clone(e.direction,e._direction));let c=e._up,u=!h.equals(c,e.up);u&&(h.normalize(e.up,e.up),c=h.clone(e.up,e._up));let f=e._right,d=!h.equals(f,e.right);d&&(h.normalize(e.right,e.right),f=h.clone(e.right,e._right));let p=e._transformChanged||e._modeChanged;e._transformChanged=!1,p&&(M.inverseTransformation(e._transform,e._invTransform),e._mode===re.COLUMBUS_VIEW||e._mode===re.SCENE2D?M.equals(M.IDENTITY,e._transform)?M.clone(an.TRANSFORM_2D,e._actualTransform):e._mode===re.COLUMBUS_VIEW?yDt(e):SDt(e):M.clone(e._transform,e._actualTransform),M.inverseTransformation(e._actualTransform,e._actualInvTransform),e._modeChanged=!1);let g=e._actualTransform;if(o||p)if(e._positionWC=M.multiplyByPoint(g,r,e._positionWC),t===re.SCENE3D||t===re.MORPHING)e._positionCartographic=e._projection.ellipsoid.cartesianToCartographic(e._positionWC,e._positionCartographic);else{let m=Fre;m.x=e._positionWC.y,m.y=e._positionWC.z,m.z=e._positionWC.x,t===re.SCENE2D&&(m.z=i),e._projection.unproject(m,e._positionCartographic)}if(a||u||d){let m=h.dot(s,h.cross(c,f,Fre));if(Math.abs(1-m)>P.EPSILON2){let y=1/h.magnitudeSquared(c),A=h.dot(c,s)*y,b=h.multiplyByScalar(s,A,Fre);c=h.normalize(h.subtract(c,b,e._up),e._up),h.clone(c,e.up),f=h.cross(s,c,e._right),h.clone(f,e.right)}}(a||p)&&(e._directionWC=M.multiplyByPointAsVector(g,s,e._directionWC),h.normalize(e._directionWC,e._directionWC)),(u||p)&&(e._upWC=M.multiplyByPointAsVector(g,c,e._upWC),h.normalize(e._upWC,e._upWC)),(d||p)&&(e._rightWC=M.multiplyByPointAsVector(g,f,e._rightWC),h.normalize(e._rightWC,e._rightWC)),(o||a||u||d||p)&&FRe(e)}function BRe(e,t){let n;return P.equalsEpsilon(Math.abs(e.z),1,P.EPSILON3)?n=Math.atan2(t.y,t.x)-P.PI_OVER_TWO:n=Math.atan2(e.y,e.x)-P.PI_OVER_TWO,P.TWO_PI-P.zeroToTwoPi(n)}function kRe(e){return P.PI_OVER_TWO-P.acosClamped(e.z)}function URe(e,t,n){let i=0;return P.equalsEpsilon(Math.abs(e.z),1,P.EPSILON3)||(i=Math.atan2(-n.z,t.z),i=P.zeroToTwoPi(i+P.TWO_PI)),i}var CG=new M,vG=new M;Object.defineProperties(an.prototype,{transform:{get:function(){return this._transform}},inverseTransform:{get:function(){return dl(this),this._invTransform}},viewMatrix:{get:function(){return dl(this),this._viewMatrix}},inverseViewMatrix:{get:function(){return dl(this),this._invViewMatrix}},positionCartographic:{get:function(){return dl(this),this._positionCartographic}},positionWC:{get:function(){return dl(this),this._positionWC}},directionWC:{get:function(){return dl(this),this._directionWC}},upWC:{get:function(){return dl(this),this._upWC}},rightWC:{get:function(){return dl(this),this._rightWC}},heading:{get:function(){if(this._mode!==re.MORPHING){let e=this._projection.ellipsoid,t=M.clone(this._transform,CG),n=At.eastNorthUpToFixedFrame(this.positionWC,e,vG);this._setTransform(n);let i=BRe(this.direction,this.up);return this._setTransform(t),i}}},pitch:{get:function(){if(this._mode!==re.MORPHING){let e=this._projection.ellipsoid,t=M.clone(this._transform,CG),n=At.eastNorthUpToFixedFrame(this.positionWC,e,vG);this._setTransform(n);let i=kRe(this.direction);return this._setTransform(t),i}}},roll:{get:function(){if(this._mode!==re.MORPHING){let e=this._projection.ellipsoid,t=M.clone(this._transform,CG),n=At.eastNorthUpToFixedFrame(this.positionWC,e,vG);this._setTransform(n);let i=URe(this.direction,this.up,this.right);return this._setTransform(t),i}}},moveStart:{get:function(){return this._moveStart}},moveEnd:{get:function(){return this._moveEnd}},changed:{get:function(){return this._changed}}});an.prototype.update=function(e){let t=!1;if(e!==this._mode&&(this._mode=e,this._modeChanged=e!==re.MORPHING,t=this._mode===re.SCENE2D),t){let n=this._max2Dfrustum=this.frustum.clone(),i=2,r=n.top/n.right;n.right=this._maxCoord.x*i,n.left=-n.right,n.top=r*n.right,n.bottom=-n.top}this._mode===re.SCENE2D&&HRe(this,this.position)};var wDt=new h,IDt=new h,PDt=new h;an.prototype._setTransform=function(e){let t=h.clone(this.positionWC,wDt),n=h.clone(this.upWC,IDt),i=h.clone(this.directionWC,PDt);M.clone(e,this._transform),this._transformChanged=!0,dl(this);let r=this._actualInvTransform;M.multiplyByPoint(r,t,this.position),M.multiplyByPointAsVector(r,i,this.direction),M.multiplyByPointAsVector(r,n,this.up),h.cross(this.direction,this.up,this.right),dl(this)};var DDt=new U,RDt=new gn,ODt=new h,MDt=new h;function zRe(e){if(!M.equals(M.IDENTITY,e.transform))return h.magnitude(e.position);let t=e._scene,n=t.globe,i=DDt;i.x=t.drawingBufferWidth/t.pixelRatio/2,i.y=t.drawingBufferHeight/t.pixelRatio/2;let r;if(l(n)){let a=e.getPickRay(i,RDt);r=n.pickWorldCoordinates(a,t,!0,ODt)}let o;t.pickPositionSupported&&(o=t.pickPositionWorldCoordinates(i,MDt));let s;if(l(r)||l(o)){let a=l(o)?h.distance(o,e.positionWC):Number.POSITIVE_INFINITY,c=l(r)?h.distance(r,e.positionWC):Number.POSITIVE_INFINITY;s=Math.min(a,c)}else s=Math.max(e.positionCartographic.height,0);return s}an.prototype._adjustOrthographicFrustum=function(e){this.frustum instanceof _n&&(!e&&this._positionCartographic.height<15e4||(this.frustum.width=zRe(this)))};var SG=new h,Vre=new M,NDt=new M,jre=new Le,Hre=new $,VRe=new he;function LDt(e,t,n){let i=M.clone(e.transform,Vre),r=At.eastNorthUpToFixedFrame(t,e._projection.ellipsoid,NDt);e._setTransform(r),h.clone(h.ZERO,e.position),n.heading=n.heading-P.PI_OVER_TWO;let o=Le.fromHeadingPitchRoll(n,jre),s=$.fromQuaternion(o,Hre);$.getColumn(s,0,e.direction),$.getColumn(s,2,e.up),h.cross(e.direction,e.up,e.right),e._setTransform(i),e._adjustOrthographicFrustum(!0)}function FDt(e,t,n,i){let r=M.clone(e.transform,Vre);if(e._setTransform(M.IDENTITY),!h.equals(t,e.positionWC)){if(i){let a=e._projection,c=a.ellipsoid.cartesianToCartographic(t,VRe);t=a.project(c,SG)}h.clone(t,e.position)}n.heading=n.heading-P.PI_OVER_TWO;let o=Le.fromHeadingPitchRoll(n,jre),s=$.fromQuaternion(o,Hre);$.getColumn(s,0,e.direction),$.getColumn(s,2,e.up),h.cross(e.direction,e.up,e.right),e._setTransform(r),e._adjustOrthographicFrustum(!0)}function BDt(e,t,n,i){let r=M.clone(e.transform,Vre);if(e._setTransform(M.IDENTITY),!h.equals(t,e.positionWC)){if(i){let c=e._projection,u=c.ellipsoid.cartesianToCartographic(t,VRe);t=c.project(u,SG)}U.clone(t,e.position);let o=-t.z*.5,s=-o,a=e.frustum;if(s>o){let c=a.top/a.right;a.right=s,a.left=o,a.top=a.right*c,a.bottom=-a.top}}if(e._scene.mapMode2D===Yu.ROTATE){n.heading=n.heading-P.PI_OVER_TWO,n.pitch=-P.PI_OVER_TWO,n.roll=0;let o=Le.fromHeadingPitchRoll(n,jre),s=$.fromQuaternion(o,Hre);$.getColumn(s,2,e.up),h.cross(e.direction,e.up,e.right)}e._setTransform(r)}var kDt=new h,UDt=new h,zDt=new h;function jRe(e,t,n,i){let r=h.clone(n.direction,kDt),o=h.clone(n.up,UDt);if(e._scene.mode===re.SCENE3D){let a=e._projection.ellipsoid,c=At.eastNorthUpToFixedFrame(t,a,CG),u=M.inverseTransformation(c,vG);M.multiplyByPointAsVector(u,r,r),M.multiplyByPointAsVector(u,o,o)}let s=h.cross(r,o,zDt);return i.heading=BRe(r,o),i.pitch=kRe(r),i.roll=URe(r,o,s),i}var zre={destination:void 0,orientation:{direction:void 0,up:void 0,heading:void 0,pitch:void 0,roll:void 0},convert:void 0,endTransform:void 0},Vw=new kc;an.prototype.setView=function(e){e=e??H.EMPTY_OBJECT;let t=e.orientation??H.EMPTY_OBJECT,n=this._mode;if(n===re.MORPHING)return;l(e.endTransform)&&this._setTransform(e.endTransform);let i=e.convert??!0,r=e.destination??h.clone(this.positionWC,SG);l(r)&&l(r.west)&&(r=this.getRectangleCameraCoordinates(r,SG),i=!1),l(t.direction)&&(t=jRe(this,r,t,zre.orientation)),Vw.heading=t.heading??0,Vw.pitch=t.pitch??-P.PI_OVER_TWO,Vw.roll=t.roll??0,n===re.SCENE3D?LDt(this,r,Vw):n===re.SCENE2D?BDt(this,r,Vw,i):FDt(this,r,Vw,i)};var VDt=new h;an.prototype.flyHome=function(e){let t=this._mode;if(t===re.MORPHING&&this._scene.completeMorph(),t===re.SCENE2D)this.flyTo({destination:an.DEFAULT_VIEW_RECTANGLE,duration:e,endTransform:M.IDENTITY});else if(t===re.SCENE3D){let n=this.getRectangleCameraCoordinates(an.DEFAULT_VIEW_RECTANGLE),i=h.magnitude(n);i+=i*an.DEFAULT_VIEW_FACTOR,h.normalize(n,n),h.multiplyByScalar(n,i,n),this.flyTo({destination:n,duration:e,endTransform:M.IDENTITY})}else if(t===re.COLUMBUS_VIEW){let n=this._projection.ellipsoid.maximumRadius,i=new h(0,-1,1);i=h.multiplyByScalar(h.normalize(i,i),5*n,i),this.flyTo({destination:i,duration:e,orientation:{heading:0,pitch:-Math.acos(h.normalize(i,VDt).z),roll:0},endTransform:M.IDENTITY,convert:!1})}};an.prototype.worldToCameraCoordinates=function(e,t){return l(t)||(t=new se),dl(this),M.multiplyByVector(this._actualInvTransform,e,t)};an.prototype.worldToCameraCoordinatesPoint=function(e,t){return l(t)||(t=new h),dl(this),M.multiplyByPoint(this._actualInvTransform,e,t)};an.prototype.worldToCameraCoordinatesVector=function(e,t){return l(t)||(t=new h),dl(this),M.multiplyByPointAsVector(this._actualInvTransform,e,t)};an.prototype.cameraToWorldCoordinates=function(e,t){return l(t)||(t=new se),dl(this),M.multiplyByVector(this._actualTransform,e,t)};an.prototype.cameraToWorldCoordinatesPoint=function(e,t){return l(t)||(t=new h),dl(this),M.multiplyByPoint(this._actualTransform,e,t)};an.prototype.cameraToWorldCoordinatesVector=function(e,t){return l(t)||(t=new h),dl(this),M.multiplyByPointAsVector(this._actualTransform,e,t)};function HRe(e,t){let n=e._scene.mapMode2D===Yu.ROTATE,i=e._maxCoord.x,r=e._maxCoord.y,o,s;n?(s=i,o=-s):(s=t.x-i*2,o=t.x+i*2),t.x>i&&(t.x=s),t.x<-i&&(t.x=o),t.y>r&&(t.y=r),t.y<-r&&(t.y=-r)}var SRe=new h;an.prototype.move=function(e,t){let n=this.position;h.multiplyByScalar(e,t,SRe),h.add(n,SRe,n),this._mode===re.SCENE2D&&HRe(this,n),this._adjustOrthographicFrustum(!0)};an.prototype.moveForward=function(e){e=e??this.defaultMoveAmount,this._mode===re.SCENE2D?wG(this,e):this.move(this.direction,e)};an.prototype.moveBackward=function(e){e=e??this.defaultMoveAmount,this._mode===re.SCENE2D?wG(this,-e):this.move(this.direction,-e)};an.prototype.moveUp=function(e){e=e??this.defaultMoveAmount,this.move(this.up,e)};an.prototype.moveDown=function(e){e=e??this.defaultMoveAmount,this.move(this.up,-e)};an.prototype.moveRight=function(e){e=e??this.defaultMoveAmount,this.move(this.right,e)};an.prototype.moveLeft=function(e){e=e??this.defaultMoveAmount,this.move(this.right,-e)};an.prototype.lookLeft=function(e){e=e??this.defaultLookAmount,this._mode!==re.SCENE2D&&this.look(this.up,-e)};an.prototype.lookRight=function(e){e=e??this.defaultLookAmount,this._mode!==re.SCENE2D&&this.look(this.up,e)};an.prototype.lookUp=function(e){e=e??this.defaultLookAmount,this._mode!==re.SCENE2D&&this.look(this.right,-e)};an.prototype.lookDown=function(e){e=e??this.defaultLookAmount,this._mode!==re.SCENE2D&&this.look(this.right,e)};var jDt=new Le,HDt=new $;an.prototype.look=function(e,t){let n=t??this.defaultLookAmount,i=Le.fromAxisAngle(e,-n,jDt),r=$.fromQuaternion(i,HDt),o=this.direction,s=this.up,a=this.right;$.multiplyByVector(r,o,o),$.multiplyByVector(r,s,s),$.multiplyByVector(r,a,a)};an.prototype.twistLeft=function(e){e=e??this.defaultLookAmount,this.look(this.direction,e)};an.prototype.twistRight=function(e){e=e??this.defaultLookAmount,this.look(this.direction,-e)};var GDt=new Le,WDt=new $;an.prototype.rotate=function(e,t){let n=t??this.defaultRotateAmount,i=Le.fromAxisAngle(e,-n,GDt),r=$.fromQuaternion(i,WDt);$.multiplyByVector(r,this.position,this.position),$.multiplyByVector(r,this.direction,this.direction),$.multiplyByVector(r,this.up,this.up),h.cross(this.direction,this.up,this.right),h.cross(this.right,this.direction,this.up),this._adjustOrthographicFrustum(!1)};an.prototype.rotateDown=function(e){e=e??this.defaultRotateAmount,GRe(this,e)};an.prototype.rotateUp=function(e){e=e??this.defaultRotateAmount,GRe(this,-e)};var qDt=new h,YDt=new h,XDt=new h,wRe=new h;function GRe(e,t){let n=e.position;if(l(e.constrainedAxis)&&!h.equalsEpsilon(e.position,h.ZERO,P.EPSILON2)){let i=h.normalize(n,qDt),r=h.equalsEpsilon(i,e.constrainedAxis,P.EPSILON2),o=h.equalsEpsilon(i,h.negate(e.constrainedAxis,wRe),P.EPSILON2);if(!r&&!o){let s=h.normalize(e.constrainedAxis,YDt),a=h.dot(i,s),c=P.acosClamped(a);t>0&&t>c&&(t=c-P.EPSILON4),a=h.dot(i,h.negate(s,wRe)),c=P.acosClamped(a),t<0&&-t>c&&(t=-c+P.EPSILON4);let u=h.cross(s,i,XDt);e.rotate(u,t)}else(r&&t<0||o&&t>0)&&e.rotate(e.right,t)}else e.rotate(e.right,t)}an.prototype.rotateRight=function(e){e=e??this.defaultRotateAmount,WRe(this,-e)};an.prototype.rotateLeft=function(e){e=e??this.defaultRotateAmount,WRe(this,e)};function WRe(e,t){l(e.constrainedAxis)?e.rotate(e.constrainedAxis,t):e.rotate(e.up,t)}function wG(e,t){let n=e.frustum,i;if(t=t*.5,Math.abs(n.top)+Math.abs(n.bottom)>Math.abs(n.left)+Math.abs(n.right)){let r=n.top-t,o=n.bottom+t,s=e._maxCoord.y;e._scene.mapMode2D===Yu.ROTATE&&(s*=e.maximumZoomFactor),o>s&&(o=s,r=-s),r<=o&&(r=1,o=-1),i=n.right/n.top,n.top=r,n.bottom=o,n.right=n.top*i,n.left=-n.right}else{let r=n.right-t,o=n.left+t,s=e._maxCoord.x;e._scene.mapMode2D===Yu.ROTATE&&(s*=e.maximumZoomFactor),r>s&&(r=s,o=-s),r<=o&&(r=1,o=-1),i=n.top/n.right,n.right=r,n.left=o,n.top=n.right*i,n.bottom=-n.top}}function qRe(e,t){e.move(e.direction,t)}an.prototype.zoomIn=function(e){e=e??this.defaultZoomAmount,this._mode===re.SCENE2D?wG(this,e):qRe(this,e)};an.prototype.zoomOut=function(e){e=e??this.defaultZoomAmount,this._mode===re.SCENE2D?wG(this,-e):qRe(this,-e)};an.prototype.getMagnitude=function(){if(this._mode===re.SCENE3D)return h.magnitude(this.position);if(this._mode===re.COLUMBUS_VIEW)return Math.abs(this.position.z);if(this._mode===re.SCENE2D)return Math.max(this.frustum.right-this.frustum.left,this.frustum.top-this.frustum.bottom)};var KDt=new M;an.prototype.lookAt=function(e,t){let i=this._scene.ellipsoid??ee.default,r=At.eastNorthUpToFixedFrame(e,i,KDt);this.lookAtTransform(r,t)};var $Dt=new h,JDt=new Le,ZDt=new Le,QDt=new $;function YRe(e,t,n,i){t=P.clamp(t,-P.PI_OVER_TWO,P.PI_OVER_TWO),e=P.zeroToTwoPi(e)-P.PI_OVER_TWO;let r=Le.fromAxisAngle(h.UNIT_Y,-t,JDt),o=Le.fromAxisAngle(h.UNIT_Z,-e,ZDt),s=Le.multiply(o,r,o),a=$.fromQuaternion(s,QDt),c=h.clone(h.UNIT_X,i);return $.multiplyByVector(a,c,c),h.negate(c,c),h.multiplyByScalar(c,n,c),c}an.prototype.lookAtTransform=function(e,t){if(this._setTransform(e),!l(t))return;let n;if(l(t.heading)?n=YRe(t.heading,t.pitch,t.range,$Dt):n=t,this._mode===re.SCENE2D){U.clone(U.ZERO,this.position),h.negate(n,this.up),this.up.z=0,h.magnitudeSquared(this.up)<P.EPSILON10&&h.clone(h.UNIT_Y,this.up),h.normalize(this.up,this.up),this._setTransform(M.IDENTITY),h.negate(h.UNIT_Z,this.direction),h.cross(this.direction,this.up,this.right),h.normalize(this.right,this.right);let i=this.frustum,r=i.top/i.right;i.right=h.magnitude(n)*.5,i.left=-i.right,i.top=r*i.right,i.bottom=-i.top,this._setTransform(e);return}h.clone(n,this.position),h.negate(this.position,this.direction),h.normalize(this.direction,this.direction),h.cross(this.direction,h.UNIT_Z,this.right),h.magnitudeSquared(this.right)<P.EPSILON10&&h.clone(h.UNIT_X,this.right),h.normalize(this.right,this.right),h.cross(this.right,this.direction,this.up),h.normalize(this.up,this.up),this._adjustOrthographicFrustum(!0)};var e1t=new M,IRe=new h,t1t=new h,PRe=new h;an.prototype.lookAtWorldPosition=function(e,t=ee.default){let n=M.clone(this._transform,e1t);this._setTransform(M.IDENTITY);let i=h.subtract(e,this.positionWC,IRe);h.magnitudeSquared(i)<P.EPSILON8&&(i=h.clone(this.directionWC,IRe)),i=h.normalize(i,this.direction);let r=t.geodeticSurfaceNormal(e,t1t),o=h.cross(i,r,PRe);h.magnitudeSquared(o)<P.EPSILON8&&(o=h.clone(this.rightWC,PRe)),h.normalize(o,this.right);let s=h.cross(o,i,this.up);h.normalize(s,this.up),this._setTransform(n)};var kO=new he,n1t=new he,i1t=new h,r1t=new h,o1t=new h,s1t=new h,a1t=new h,c1t=new h,l1t=new h,Bre=new h,u1t={direction:new h,right:new h,up:new h},DRe;function fl(e,t,n,i){return Math.abs(h.dot(t,n))/i-h.dot(e,n)}function XRe(e,t,n,i){let r=e._projection.ellipsoid,o=i?e:u1t,{north:s,south:a,west:c}=t,{east:u}=t;c>u&&(u+=P.TWO_PI);let f=(c+u)*.5,d;if(a<-P.PI_OVER_TWO+P.RADIANS_PER_DEGREE&&s>P.PI_OVER_TWO-P.RADIANS_PER_DEGREE)d=0;else{let O=kO;O.longitude=f,O.latitude=s,O.height=0;let L=n1t;L.longitude=f,L.latitude=a,L.height=0;let _=DRe;(!l(_)||_.ellipsoid!==r)&&(DRe=_=new q_(void 0,void 0,r)),_.setEndPoints(O,L),d=_.interpolateUsingFraction(.5,kO).latitude}let p=kO;p.longitude=f,p.latitude=d,p.height=0;let g=r.cartographicToCartesian(p,l1t),m=kO;m.longitude=u,m.latitude=s;let y=r.cartographicToCartesian(m,i1t);m.longitude=c;let A=r.cartographicToCartesian(m,o1t);m.longitude=f;let b=r.cartographicToCartesian(m,a1t);m.latitude=a;let x=r.cartographicToCartesian(m,c1t);m.longitude=u;let T=r.cartographicToCartesian(m,s1t);m.longitude=c;let E=r.cartographicToCartesian(m,r1t);h.subtract(A,g,A),h.subtract(T,g,T),h.subtract(y,g,y),h.subtract(E,g,E),h.subtract(b,g,b),h.subtract(x,g,x);let v=r.geodeticSurfaceNormal(g,o.direction);h.negate(v,v);let S=h.cross(v,h.UNIT_Z,o.right);h.normalize(S,S);let I=h.cross(S,v,o.up),R;if(e.frustum instanceof _n){let O=Math.max(h.distance(y,A),h.distance(T,E)),L=Math.max(h.distance(y,T),h.distance(A,E)),_,C,w=e.frustum._offCenterFrustum,D=w.right/w.top,N=L*D;O>N?(_=O,C=_/D):(C=L,_=N),R=Math.max(_,C)}else{let O=Math.tan(e.frustum.fovy*.5),L=e.frustum.aspectRatio*O;if(R=Math.max(fl(v,I,A,O),fl(v,I,T,O),fl(v,I,y,O),fl(v,I,E,O),fl(v,I,b,O),fl(v,I,x,O),fl(v,S,A,L),fl(v,S,T,L),fl(v,S,y,L),fl(v,S,E,L),fl(v,S,b,L),fl(v,S,x,L)),a<0&&s>0){let _=kO;_.longitude=c,_.latitude=0,_.height=0;let C=r.cartographicToCartesian(_,Bre);h.subtract(C,g,C),R=Math.max(R,fl(v,I,C,O),fl(v,S,C,L)),_.longitude=u,C=r.cartographicToCartesian(_,Bre),h.subtract(C,g,C),R=Math.max(R,fl(v,I,C,O),fl(v,S,C,L))}}return h.add(g,h.multiplyByScalar(v,-R,Bre),n)}var f1t=new he,d1t=new h,h1t=new h;function m1t(e,t,n){let i=e._projection;t.west>t.east&&(t=ie.MAX_VALUE);let r=e._actualTransform,o=e._actualInvTransform,s=f1t;s.longitude=t.east,s.latitude=t.north;let a=i.project(s,d1t);M.multiplyByPoint(r,a,a),M.multiplyByPoint(o,a,a),s.longitude=t.west,s.latitude=t.south;let c=i.project(s,h1t);if(M.multiplyByPoint(r,c,c),M.multiplyByPoint(o,c,c),n.x=(a.x-c.x)*.5+c.x,n.y=(a.y-c.y)*.5+c.y,l(e.frustum.fovy)){let u=Math.tan(e.frustum.fovy*.5),f=e.frustum.aspectRatio*u;n.z=Math.max((a.x-c.x)/f,(a.y-c.y)/u)*.5}else{let u=a.x-c.x,f=a.y-c.y;n.z=Math.max(u,f)}return n}var p1t=new he,g1t=new h,_1t=new h;function y1t(e,t,n){let i=e._projection,r=t.east;t.west>t.east&&(e._scene.mapMode2D===Yu.INFINITE_SCROLL?r+=P.TWO_PI:(t=ie.MAX_VALUE,r=t.east));let o=p1t;o.longitude=r,o.latitude=t.north;let s=i.project(o,g1t);o.longitude=t.west,o.latitude=t.south;let a=i.project(o,_1t),c=Math.abs(s.x-a.x)*.5,u=Math.abs(s.y-a.y)*.5,f,d,p=e.frustum.right/e.frustum.top,g=u*p;return c>g?(f=c,d=f/p):(d=u,f=g),u=Math.max(2*f,2*d),n.x=(s.x-a.x)*.5+a.x,n.y=(s.y-a.y)*.5+a.y,o=i.unproject(n,o),o.height=u,n=i.project(o,n),n}an.prototype.getRectangleCameraCoordinates=function(e,t){let n=this._mode;if(l(t)||(t=new h),n===re.SCENE3D)return XRe(this,e,t);if(n===re.COLUMBUS_VIEW)return m1t(this,e,t);if(n===re.SCENE2D)return y1t(this,e,t)};var A1t=new gn;function b1t(e,t,n,i){n=n??ee.default;let r=e.getPickRay(t,A1t),o=xi.rayEllipsoid(r,n);if(!o)return;let s=o.start>0?o.start:o.stop;return gn.getPoint(r,s,i)}var x1t=new gn;function T1t(e,t,n,i){let o=e.getPickRay(t,x1t).origin;o=h.fromElements(o.y,o.z,0,o);let s=n.unproject(o);if(!(s.latitude<-P.PI_OVER_TWO||s.latitude>P.PI_OVER_TWO))return n.ellipsoid.cartographicToCartesian(s,i)}var E1t=new gn;function C1t(e,t,n,i){let r=e.getPickRay(t,E1t),o=-r.origin.x/r.direction.x;gn.getPoint(r,o,i);let s=n.unproject(new h(i.y,i.z,0));if(!(s.latitude<-P.PI_OVER_TWO||s.latitude>P.PI_OVER_TWO||s.longitude<-Math.PI||s.longitude>Math.PI))return n.ellipsoid.cartographicToCartesian(s,i)}an.prototype.pickEllipsoid=function(e,t,n){let i=this._scene.canvas;if(!(i.clientWidth===0||i.clientHeight===0)){if(l(n)||(n=new h),t=t??ee.default,this._mode===re.SCENE3D)n=b1t(this,e,t,n);else if(this._mode===re.SCENE2D)n=T1t(this,e,this._projection,n);else if(this._mode===re.COLUMBUS_VIEW)n=C1t(this,e,this._projection,n);else return;return n}};var v1t=new h,S1t=new h,w1t=new h;function I1t(e,t,n){let i=e._scene.canvas,r=i.clientWidth,o=i.clientHeight,s=Math.tan(e.frustum.fovy*.5),a=e.frustum.aspectRatio*s,c=e.frustum.near,u=2/r*t.x-1,f=2/o*(o-t.y)-1,d=e.positionWC;h.clone(d,n.origin);let p=h.multiplyByScalar(e.directionWC,c,v1t);h.add(d,p,p);let g=h.multiplyByScalar(e.rightWC,u*c*a,S1t),m=h.multiplyByScalar(e.upWC,f*c*s,w1t),y=h.add(p,g,n.direction);return h.add(y,m,y),h.subtract(y,d,y),h.normalize(y,y),n}var TG=new h;function P1t(e,t,n){let i=e._scene.canvas,r=i.clientWidth,o=i.clientHeight,s=e.frustum,a=s.offCenterFrustum;l(a)&&(s=a);let c=2/r*t.x-1;c*=(s.right-s.left)*.5;let u=2/o*(o-t.y)-1;u*=(s.top-s.bottom)*.5;let f=n.origin;if(h.clone(e.positionWC,f),h.multiplyByScalar(e.rightWC,c,TG),h.add(TG,f,f),h.multiplyByScalar(e.upWC,u,TG),h.add(TG,f,f),h.clone(e.directionWC,n.direction),e._mode===re.SCENE2D&&e._scene.mapMode2D===Yu.INFINITE_SCROLL){let d=e._maxCoord.x;f.y=P.mod(f.y+d,2*d)-d}return n}an.prototype.getPickRay=function(e,t){l(t)||(t=new gn);let n=this._scene.canvas;if(n.clientWidth<=0||n.clientHeight<=0)return;let i=this.frustum;return l(i.aspectRatio)&&l(i.fov)&&l(i.near)?I1t(this,e,t):P1t(this,e,t)};var D1t=new h,R1t=new h;an.prototype.distanceToBoundingSphere=function(e){let t=h.subtract(this.positionWC,e.center,D1t),n=h.multiplyByScalar(this.directionWC,h.dot(t,this.directionWC),R1t);return Math.max(0,h.magnitude(n)-e.radius)};var O1t=new U;an.prototype.getPixelSize=function(e,t,n){let i=this.distanceToBoundingSphere(e),r=this.frustum.getPixelDimensions(t,n,i,this._scene.pixelRatio,O1t);return Math.max(r.x,r.y)};function M1t(e,t,n,i,r,o){let s=h.clone(t);n.y>i?s.y-=n.y-i:n.y<-i&&(s.y+=-i-n.y),n.z>r?s.z-=n.z-r:n.z<-r&&(s.z+=-r-n.z);function a(c){let u=h.lerp(t,s,c.time,new h);e.worldToCameraCoordinatesPoint(u,e.position)}return{easingFunction:ks.EXPONENTIAL_OUT,startObject:{time:0},stopObject:{time:1},duration:o,update:a}}var N1t=new h,RRe=new h,L1t=new h,F1t=new h;function B1t(e,t){let n=e.position,i=e.direction,r=e.worldToCameraCoordinatesVector(h.UNIT_X,N1t),o=-h.dot(r,n)/h.dot(r,i),s=h.add(n,h.multiplyByScalar(i,o,RRe),RRe);e.cameraToWorldCoordinatesPoint(s,s),n=e.cameraToWorldCoordinatesPoint(e.position,L1t);let a=Math.tan(e.frustum.fovy*.5),c=e.frustum.aspectRatio*a,u=h.magnitude(h.subtract(n,s,F1t)),f=c*u,d=a*u,p=e._maxCoord.x,g=e._maxCoord.y,m=Math.max(f-p,p),y=Math.max(d-g,g);if(n.z<-m||n.z>m||n.y<-y||n.y>y){let A=s.y<-m||s.y>m,b=s.z<-y||s.z>y;if(A||b)return M1t(e,n,s,m,y,t)}}an.prototype.createCorrectPositionTween=function(e){if(this._mode===re.COLUMBUS_VIEW)return B1t(this,e)};var k1t=new h,Va={destination:void 0,heading:void 0,pitch:void 0,roll:void 0,duration:void 0,complete:void 0,cancel:void 0,endTransform:void 0,maximumHeight:void 0,easingFunction:void 0};an.prototype.cancelFlight=function(){l(this._currentFlight)&&(this._currentFlight.cancelTween(),this._currentFlight=void 0)};an.prototype.completeFlight=function(){if(l(this._currentFlight)){this._currentFlight.cancelTween();let e={destination:void 0,orientation:{heading:void 0,pitch:void 0,roll:void 0}};e.destination=Va.destination,e.orientation.heading=Va.heading,e.orientation.pitch=Va.pitch,e.orientation.roll=Va.roll,this.setView(e),l(this._currentFlight.complete)&&this._currentFlight.complete(),this._currentFlight=void 0}};an.prototype.flyTo=function(e){e=e??H.EMPTY_OBJECT;let t=e.destination;if(this._mode===re.MORPHING)return;this.cancelFlight();let i=t instanceof ie;i&&(t=this.getRectangleCameraCoordinates(t,k1t));let r=e.orientation??H.EMPTY_OBJECT;if(l(r.direction)&&(r=jRe(this,t,r,zre.orientation)),l(e.duration)&&e.duration<=0){let f=zre;f.destination=e.destination,f.orientation.heading=r.heading,f.orientation.pitch=r.pitch,f.orientation.roll=r.roll,f.convert=e.convert,f.endTransform=e.endTransform,this.setView(f),typeof e.complete=="function"&&e.complete();return}let o=this,s;Va.destination=t,Va.heading=r.heading,Va.pitch=r.pitch,Va.roll=r.roll,Va.duration=e.duration,Va.complete=function(){s===o._currentFlight&&(o._currentFlight=void 0),l(e.complete)&&e.complete()},Va.cancel=e.cancel,Va.endTransform=e.endTransform,Va.convert=i?!1:e.convert,Va.maximumHeight=e.maximumHeight,Va.pitchAdjustHeight=e.pitchAdjustHeight,Va.flyOverLongitude=e.flyOverLongitude,Va.flyOverLongitudeWeight=e.flyOverLongitudeWeight,Va.easingFunction=e.easingFunction;let a=this._scene,c=bG.createTween(a,Va);if(c.duration===0){typeof c.complete=="function"&&c.complete();return}s=a.tweens.add(c),this._currentFlight=s;let u=this._scene.preloadFlightCamera;this._mode!==re.SCENE2D&&(l(u)||(u=an.clone(this)),u.setView({destination:t,orientation:r}),this._scene.preloadFlightCullingVolume=u.frustum.computeCullingVolume(u.positionWC,u.directionWC,u.upWC))};function U1t(e,t){let n=e.frustum,i=Math.tan(n.fovy*.5),r=n.aspectRatio*i;return Math.max(t/r,t/i)}function z1t(e,t){let n=e.frustum,i=n.offCenterFrustum;l(i)&&(n=i);let r,o,s=n.right/n.top,a=t*s;return t>a?(r=t,o=r/s):(o=t,r=a),Math.max(r,o)*1.5}var V1t=100;function KRe(e,t,n){n=om.clone(l(n)?n:an.DEFAULT_OFFSET);let i=e._scene.screenSpaceCameraController.minimumZoomDistance,r=e._scene.screenSpaceCameraController.maximumZoomDistance,o=n.range;if(!l(o)||o===0){let s=t.radius;s===0?n.range=V1t:e.frustum instanceof _n||e._mode===re.SCENE2D?n.range=z1t(e,s):n.range=U1t(e,s),n.range=P.clamp(n.range,i,r)}return n}an.prototype.viewBoundingSphere=function(e,t){t=KRe(this,e,t),this.lookAt(e.center,t)};var j1t=new M,ORe=new h,H1t=new h,G1t=new h,W1t=new h,q1t=new se,Y1t=new Le,X1t=new $;an.prototype.flyToBoundingSphere=function(e,t){t=t??H.EMPTY_OBJECT;let n=this._mode===re.SCENE2D||this._mode===re.COLUMBUS_VIEW;this._setTransform(M.IDENTITY);let i=KRe(this,e,t.offset),r;n?r=h.multiplyByScalar(h.UNIT_Z,i.range,ORe):r=YRe(i.heading,i.pitch,i.range,ORe);let s=this._scene.ellipsoid??ee.default,a=At.eastNorthUpToFixedFrame(e.center,s,j1t);M.multiplyByPoint(a,r,r);let c,u;if(!n){if(c=h.subtract(e.center,r,H1t),h.normalize(c,c),u=M.multiplyByPointAsVector(a,h.UNIT_Z,G1t),1-Math.abs(h.dot(c,u))<P.EPSILON6){let d=Le.fromAxisAngle(c,i.heading,Y1t),p=$.fromQuaternion(d,X1t);h.fromCartesian4(M.getColumn(a,1,q1t),u),$.multiplyByVector(p,u,u)}let f=h.cross(c,u,W1t);h.cross(f,c,u),h.normalize(u,u)}this.flyTo({destination:r,orientation:{direction:c,up:u},duration:t.duration,complete:t.complete,cancel:t.cancel,endTransform:t.endTransform,maximumHeight:t.maximumHeight,easingFunction:t.easingFunction,flyOverLongitude:t.flyOverLongitude,flyOverLongitudeWeight:t.flyOverLongitudeWeight,pitchAdjustHeight:t.pitchAdjustHeight})};var MRe=new h,NRe=new h,kre=new h,LRe=new h,UO=[new h,new h,new h,new h];function K1t(e,t){let n=t.radii,i=e.positionWC,r=h.multiplyComponents(t.oneOverRadii,i,MRe),o=h.magnitude(r),s=h.normalize(r,NRe),a,c;h.equalsEpsilon(s,h.UNIT_Z,P.EPSILON10)?(a=new h(0,1,0),c=new h(0,0,1)):(a=h.normalize(h.cross(h.UNIT_Z,s,kre),kre),c=h.normalize(h.cross(s,a,LRe),LRe));let u=Math.sqrt(h.magnitudeSquared(r)-1),f=h.multiplyByScalar(s,1/o,MRe),d=u/o,p=h.multiplyByScalar(a,d,NRe),g=h.multiplyByScalar(c,d,kre),m=h.add(f,g,UO[0]);h.subtract(m,p,m),h.multiplyComponents(n,m,m);let y=h.subtract(f,g,UO[1]);h.subtract(y,p,y),h.multiplyComponents(n,y,y);let A=h.subtract(f,g,UO[2]);h.add(A,p,A),h.multiplyComponents(n,A,A);let b=h.add(f,g,UO[3]);return h.add(b,p,b),h.multiplyComponents(n,b,b),UO}var Ure=new U,$1t=new h,BA=[new he,new he,new he,new he];function EG(e,t,n,i,r,o){Ure.x=e,Ure.y=t;let s=i.pickEllipsoid(Ure,r,$1t);return l(s)?(BA[n]=r.cartesianToCartographic(s,BA[n]),1):(BA[n]=r.cartesianToCartographic(o[n],BA[n]),0)}an.prototype.computeViewRectangle=function(e,t){e=e??ee.default;let n=this.frustum.computeCullingVolume(this.positionWC,this.directionWC,this.upWC),i=new ue(h.ZERO,e.maximumRadius);if(n.computeVisibility(i)===$t.OUTSIDE)return;let o=this._scene.canvas,s=o.clientWidth,a=o.clientHeight,c=0,u=K1t(this,e);if(c+=EG(0,0,0,this,e,u),c+=EG(0,a,1,this,e,u),c+=EG(s,a,2,this,e,u),c+=EG(s,0,3,this,e,u),c<2)return ie.MAX_VALUE;t=ie.fromCartographicArray(BA,t);let f=0,d=BA[3].longitude;for(let p=0;p<4;++p){let g=BA[p].longitude,m=Math.abs(g-d);m>P.PI?f+=P.TWO_PI-m:f+=m,d=g}return P.equalsEpsilon(Math.abs(f),P.TWO_PI,P.EPSILON9)&&(t.west=-P.PI,t.east=P.PI,BA[0].latitude>=0?t.north=P.PI_OVER_TWO:t.south=-P.PI_OVER_TWO),t};an.prototype.switchToPerspectiveFrustum=function(){if(this._mode===re.SCENE2D||this.frustum instanceof er)return;let e=this._scene;this.frustum=new er,this.frustum.aspectRatio=e.drawingBufferWidth/e.drawingBufferHeight,this.frustum.fov=P.toRadians(60)};an.prototype.switchToOrthographicFrustum=function(){if(this._mode===re.SCENE2D||this.frustum instanceof _n)return;let e=zRe(this),t=this._scene;this.frustum=new _n,this.frustum.aspectRatio=t.drawingBufferWidth/t.drawingBufferHeight,this.frustum.width=e};an.clone=function(e,t){return l(t)||(t=new an(e._scene)),h.clone(e.position,t.position),h.clone(e.direction,t.direction),h.clone(e.up,t.up),h.clone(e.right,t.right),M.clone(e._transform,t.transform),t._transformChanged=!0,t.frustum=e.frustum.clone(),t};var Nr=an;function J1t(e){this.pass=e.pass,this.commandList=e.commandList,this.camera=e.camera,this.cullingVolume=e.cullingVolume,this.ready=!1}var Am=J1t;var Gre=class{constructor(){this._controllers=[],this._needsUpdate=new Set}get controllerCount(){return this._controllers.length}registerController(t,n,i){let r=i??this.controllerCount;this._controllers.splice(r,0,t),this._needsUpdate.add(t),t.connectedCallback(n)}unregisterController(t,n){let i=this._controllers,r=i.indexOf(t);r!==-1&&(i.splice(r,1),t.disconnectedCallback(n))}update(t,n){for(let i of this._controllers)i.enabled&&(this._needsUpdate.has(i)&&(i.firstUpdate(t,n),this._needsUpdate.delete(i)),i.update(t,n))}},IG=Gre;var tOe=js(ef(),1),$Re=576,Z1t=100,zO="#ffffff",VO="#48b";function nOe(e,t){this.credit=e,this.count=t??1}function Q1t(e,t){let n=e.length;for(let i=0;i<n;i++){let r=e[i];if(It.equals(r,t))return!0}return!1}function eRt(e){let t=e._previousCesiumCredit,n=e._currentCesiumCredit;It.equals(n,t)||(l(t)&&e._cesiumCreditContainer.removeChild(t.element),l(n)&&e._cesiumCreditContainer.appendChild(n.element),e._previousCesiumCredit=n)}var iOe="cesium-credit-delimiter";function JRe(e){let t=document.createElement("span");return t.textContent=e,t.className=iOe,t}function ZRe(e,t){if(l(t)){let n=document.createElement(t);n._creditId=e._creditId,n.appendChild(e),e=n}return e}function QRe(e,t,n,i){let r=e.childNodes,o=-1;t.sort(function(s,a){return a.count-s.count});for(let s=0;s<t.length;++s){let a=t[s].credit;if(l(a)){if(o=s,l(n)&&(o*=2,s>0)){let u=o-1;if(r.length<=u)e.appendChild(JRe(n));else{let f=r[u];f.className!==iOe&&e.replaceChild(JRe(n),f)}}let c=a.element;if(r.length<=o)e.appendChild(ZRe(c,i));else{let u=r[o];u._creditId!==a._id&&e.replaceChild(ZRe(c,i),u)}}}for(++o;o<r.length;)e.removeChild(r[o])}function tRt(e){let t=e._lightboxCredits,n=e.viewport.clientWidth,i=e.viewport.clientHeight;n!==e._lastViewportWidth&&(n<$Re?(t.className="cesium-credit-lightbox cesium-credit-lightbox-mobile",t.style.marginTop="0"):(t.className="cesium-credit-lightbox cesium-credit-lightbox-expanded",t.style.marginTop=`${Math.floor((i-t.clientHeight)*.5)}px`),e._lastViewportWidth=n),n>=$Re&&i!==e._lastViewportHeight&&(t.style.marginTop=`${Math.floor((i-t.clientHeight)*.5)}px`,e._lastViewportHeight=i)}function eOe(e){return function(t){t.key!=="Enter"&&t.key!==" "||(t.preventDefault(),t.stopPropagation(),e())}}function nRt(e){let t=` + }`,lt.sources.push(mt),jt.sources.push(vbt(Ye)),jt.sources.push(Sbt(S));let ft=Qt.fromCache({context:n.context,vertexShaderSource:jt,fragmentShaderSource:lt,attributeLocations:ge.getAttributeLocations()});st=vt[Ke]=new $ee(r,Ke,this.material,ft,Pe,qe)}return i.surfaceShader=st,st.shaderProgram}destroy(){let t,n,i=this._shadersByTexturesFlags;for(let r in i)if(i.hasOwnProperty(r)){let o=i[r];if(!l(o))continue;for(t in o)o.hasOwnProperty(t)&&(n=o[t],l(n)&&n.shaderProgram.destroy())}return le(this)}};function vbt(e){let t="vec4 getPosition(vec3 position, float height, vec2 textureCoordinates) { return getPosition3DMode(position, height, textureCoordinates); }",n="vec4 getPosition(vec3 position, float height, vec2 textureCoordinates) { return getPositionColumbusViewMode(position, height, textureCoordinates); }",i="vec4 getPosition(vec3 position, float height, vec2 textureCoordinates) { return getPositionMorphingMode(position, height, textureCoordinates); }",r;switch(e){case re.SCENE3D:r=t;break;case re.SCENE2D:case re.COLUMBUS_VIEW:r=n;break;case re.MORPHING:r=i;break}return r}function Sbt(e){return e?"float get2DYPositionFraction(vec2 textureCoordinates) { return get2DMercatorYPositionFraction(textureCoordinates); }":"float get2DYPositionFraction(vec2 textureCoordinates) { return get2DGeographicYPositionFraction(textureCoordinates); }"}var vj=Jee;var Pve={NONE:-1,PARTIAL:0,FULL:1};Object.freeze(Pve);var ns=Pve;var Dve={START:0,LOADING:1,DONE:2,FAILED:3};Object.freeze(Dve);var lc=Dve;var Rve={FAILED:0,UNLOADED:1,RECEIVING:2,RECEIVED:3,TRANSFORMING:4,TRANSFORMED:5,READY:6};Object.freeze(Rve);var kr=Rve;var Hp=class e{constructor(){ut(this,"request");this.imagery=[],this.waterMaskTexture=void 0,this.waterMaskTranslationAndScale=new se(0,0,1,1),this.terrainData=void 0,this.vectorData=void 0,this.clippingPolygonData=void 0,this.vertexArray=void 0,this.tileBoundingRegion=void 0,this.occludeePointInScaledSpace=new h,this.boundingVolumeSourceTile=void 0,this.boundingVolumeIsFromMesh=!1,this.terrainState=kr.UNLOADED,this.mesh=void 0,this.fill=void 0,this.pickBoundingSphere=new ue,this.surfaceShader=void 0,this.isClipped=!0,this.clippedByBoundaries=!1}get eligibleForUnloading(){let t=this.terrainState,i=!(t===kr.RECEIVING||t===kr.TRANSFORMING),r=this.imagery;for(let o=0,s=r.length;i&&o<s;++o){let a=r[o];i=!l(a.loadingImagery)||a.loadingImagery.state!==jn.TRANSITIONING}return i}get renderedMesh(){if(l(this.vertexArray))return this.mesh;if(l(this.fill))return this.fill.mesh}pick(t,n,i,r,o){if(!l(this.renderedMesh))return;let s=this.renderedMesh.pick(t,r,n,i);return h.clone(s,o)}freeResources(){l(this.waterMaskTexture)&&(--this.waterMaskTexture.referenceCount,this.waterMaskTexture.referenceCount===0&&this.waterMaskTexture.destroy(),this.waterMaskTexture=void 0),l(this.vectorData)&&(Rs.freeResources(this.vectorData),this.vectorData=void 0),l(this.clippingPolygonData)&&($c.releaseRectangleData(this.clippingPolygonData),this.clippingPolygonData=void 0),this.terrainData=void 0,this.terrainState=kr.UNLOADED,this.mesh=void 0,this.fill=this.fill&&this.fill.destroy();let t=this.imagery;for(let n=0,i=t.length;n<i;++n)t[n].freeResources();this.imagery.length=0,this.freeVertexArray()}freeVertexArray(){e._freeVertexArray(this.vertexArray),this.vertexArray=void 0,e._freeVertexArray(this.wireframeVertexArray),this.wireframeVertexArray=void 0}static initialize(t,n,i,r){l(t.data)||(t.data=new e),t.state===lc.START&&(wbt(t,n,i,r),t.state=lc.LOADING)}static processStateMachine(t,n,i,r,o,s,a,c){e.initialize(t,i,r,o);let u=t.data;if(t.state===lc.LOADING&&Ibt(t,n,i,r,o,s,a),c)return;let f=t.renderable;t.renderable=l(u.vertexArray);let d=u.terrainState===kr.READY;t.upsampledFromParent=l(u.terrainData)&&u.terrainData.wasCreatedByUpsampling();let p=u.processImagery(t,i,n);if(d&&p){let g=t._loadedCallbacks,m={};for(let y in g)g.hasOwnProperty(y)&&(g[y](t)||(m[y]=g[y]));t._loadedCallbacks=m,t.state=lc.DONE}f&&(t.renderable=!0)}processImagery(t,n,i,r){let o=t.data,s=t.upsampledFromParent,a=!1,c=!0,u=o.imagery,f,d;for(f=0,d=u.length;f<d;++f){let p=u[f];if(!l(p.loadingImagery)){s=!1;continue}if(p.loadingImagery.state===jn.PLACEHOLDER){let m=p.loadingImagery.imageryLayer;if(m.ready){p.freeResources(),u.splice(f,1),m._createTileImagerySkeletons(t,n,f),--f,d=u.length;continue}else s=!1}let g=p.processStateMachine(t,i,r);c=c&&g,a=a||g||l(p.readyImagery),s=s&&l(p.loadingImagery)&&(p.loadingImagery.state===jn.FAILED||p.loadingImagery.state===jn.INVALID)}return t.upsampledFromParent=s,t.renderable=t.renderable&&(a||c),c}addGeodeticSurfaceNormals(t,n){Ove(this,!0,t,n)}removeGeodeticSurfaceNormals(t){Ove(this,!1,void 0,t)}updateExaggeration(t,n,i){let r=this,o=r.renderedMesh;if(o===void 0)return;let s=n.verticalExaggeration,a=n.verticalExaggerationRelativeHeight,c=s!==1,u=o.encoding,f=u.exaggeration!==s,d=u.exaggerationRelativeHeight!==a;if(f||d){if(f)if(c&&!u.hasGeodeticSurfaceNormals){let g=t.tilingScheme.ellipsoid;r.addGeodeticSurfaceNormals(g,n)}else!c&&u.hasGeodeticSurfaceNormals&&r.removeGeodeticSurfaceNormals(n);if(u.exaggeration=s,u.exaggerationRelativeHeight=a,i!==void 0){i._tileToUpdateHeights.push(t);let g=t.customData;for(let m of g)m.level=-1}o.updateExaggeration(s,a)}}updateSceneMode(t){let i=this.renderedMesh;i!==void 0&&i.updateSceneMode(t)}static _createVertexArrayForMesh(t,n){let i=n.vertices,r=tt.createVertexBuffer({context:t,typedArray:i,usage:Me.STATIC_DRAW}),o=n.encoding.getAttributes(r),s=n.indices.indexBuffers||{},a=s[t.id];if(!l(a)||a.isDestroyed()){let c=n.indices;a=tt.createIndexBuffer({context:t,typedArray:c,usage:Me.STATIC_DRAW,indexDatatype:je.fromSizeInBytes(c.BYTES_PER_ELEMENT)}),a.vertexArrayDestroyable=!1,a.referenceCount=1,s[t.id]=a,n.indices.indexBuffers=s}else++a.referenceCount;return new Vn({context:t,attributes:o,indexBuffer:a})}static _freeVertexArray(t){if(l(t)){let n=t.indexBuffer;t.isDestroyed()||t.destroy(),l(n)&&!n.isDestroyed()&&l(n.referenceCount)&&(--n.referenceCount,n.referenceCount===0&&n.destroy())}}_findAncestorTileWithTerrainData(t){let n=t.parent;for(;l(n)&&(!l(n.data)||!l(n.data.terrainData)||n.data.terrainData.wasCreatedByUpsampling());)n=n.parent;return n}_computeWaterMaskTranslationAndScale(t,n,i){let r=n.rectangle,o=t.rectangle,s=o.width,a=o.height,c=s/r.width,u=a/r.height;return i.x=c*(o.west-r.west)/s,i.y=u*(o.south-r.south)/a,i.z=c,i.w=u,i}};function Ove(e,t,n,i){let r=e.renderedMesh,o=r.vertices,s=r.encoding,a=o.length/s.stride,c=Po.clone(s);c.hasGeodeticSurfaceNormals=t,c=Po.clone(c);let u=c.stride,f=new Float32Array(a*u);t?s.addGeodeticSurfaceNormals(o,f,n):s.removeGeodeticSurfaceNormals(o,f),r.vertices=f,r.stride=u,r!==e.mesh?(Hp._freeVertexArray(e.fill.vertexArray),e.fill.vertexArray=Hp._createVertexArrayForMesh(i.context,r)):(Hp._freeVertexArray(e.vertexArray),e.vertexArray=Hp._createVertexArrayForMesh(i.context,r)),Hp._freeVertexArray(e.wireframeVertexArray),e.wireframeVertexArray=void 0}function wbt(e,t,n,i){let r=t.getTileDataAvailable(e.x,e.y,e.level);if(!l(r)&&l(e.parent)){let s=e.parent,a=s.data;l(a)&&l(a.terrainData)&&(r=a.terrainData.isChildAvailable(s.x,s.y,e.x,e.y))}let o=e.data;r===!1&&(o.terrainState=kr.FAILED);for(let s=0,a=i.length;s<a;++s){let c=i.get(s);c.show&&c._createTileImagerySkeletons(e,t)}}function Ibt(e,t,n,i,r,o,s){let a=e.data,c=e.parent;if(a.terrainState===kr.FAILED&&c!==void 0){let u=c.data;u!==void 0&&u.terrainData!==void 0&&u.terrainData.canUpsample!==!1||Hp.processStateMachine(c,t,n,i,r,o,s,!0)}if(a.terrainState===kr.FAILED&&Pbt(a,e,t,n,e.x,e.y,e.level),a.terrainState===kr.UNLOADED&&Dbt(a,n,e.x,e.y,e.level),a.terrainState===kr.RECEIVED&&Obt(a,t,n,e.x,e.y,e.level),a.terrainState===kr.TRANSFORMED&&(Mbt(a,t.context,n,e.x,e.y,e.level,s),a.updateExaggeration(e,t,o)),a.terrainState>=kr.RECEIVED&&a.waterMaskTexture===void 0&&n.hasWaterMask)if(a.terrainData.waterMask!==void 0)Lbt(t.context,a);else{let f=a._findAncestorTileWithTerrainData(e),d=f?.data;l(f)&&l(d.waterMaskTexture)&&(a.waterMaskTexture=d.waterMaskTexture,++a.waterMaskTexture.referenceCount,a._computeWaterMaskTranslationAndScale(e,f,a.waterMaskTranslationAndScale))}}function Pbt(e,t,n,i,r,o,s){let a=t.parent;if(!a){t.state=lc.FAILED;return}let u=a.data.terrainData,f=a.x,d=a.y,p=a.level;if(!l(u))return;let g=u.upsample(i.tilingScheme,f,d,p,r,o,s);l(g)&&(e.terrainState=kr.RECEIVING,Promise.resolve(g).then(function(m){l(m)&&(e.terrainData=m,e.terrainState=kr.RECEIVED)}).catch(function(){e.terrainState=kr.FAILED}))}function Dbt(e,t,n,i,r){function o(c){if(!l(c)){e.terrainState=kr.UNLOADED,e.request=void 0;return}e.terrainData=c,e.terrainState=kr.RECEIVED,e.request=void 0}function s(c){if(e.request.state===wi.CANCELLED){e.terrainData=void 0,e.terrainState=kr.UNLOADED,e.request=void 0;return}e.terrainState=kr.FAILED,e.request=void 0;let u=`Failed to obtain terrain tile X: ${n} Y: ${i} Level: ${r}. Error message: "${c}"`;t._requestError=no.reportError(t._requestError,t,t.errorEvent,u,n,i,r),t._requestError.retry&&a()}function a(){let c=new Oo({throttle:!1,throttleByServer:!0,type:oa.TERRAIN});e.request=c;let u=t.requestTileGeometry(n,i,r,c);l(u)?(e.terrainState=kr.RECEIVING,Promise.resolve(u).then(function(f){o(f)}).catch(function(f){s(f)})):(e.terrainState=kr.UNLOADED,e.request=void 0)}a()}var Rbt={tilingScheme:void 0,x:0,y:0,level:0,exaggeration:1,exaggerationRelativeHeight:0,throttle:!0};function Obt(e,t,n,i,r,o){let s=n.tilingScheme,a=Rbt;a.tilingScheme=s,a.x=i,a.y=r,a.level=o,a.exaggeration=t.verticalExaggeration,a.exaggerationRelativeHeight=t.verticalExaggerationRelativeHeight,a.throttle=!0;let u=e.terrainData.createMesh(a);l(u)&&(e.terrainState=kr.TRANSFORMING,Promise.resolve(u).then(function(f){e.mesh=f,e.terrainState=kr.TRANSFORMED}).catch(function(){e.terrainState=kr.FAILED}))}function Mbt(e,t,n,i,r,o,s){e.vertexArray=Hp._createVertexArrayForMesh(t,e.mesh),e.terrainState=kr.READY,e.fill=e.fill&&e.fill.destroy(s)}function Nbt(e){let t=e.cache.tile_waterMaskData;if(!l(t)){let n=Dt.create({context:e,pixelFormat:$e.LUMINANCE,pixelDatatype:ze.UNSIGNED_BYTE,source:{arrayBufferView:new Uint8Array([255]),width:1,height:1}});n.referenceCount=1;let i=new Ht({wrapS:hn.CLAMP_TO_EDGE,wrapT:hn.CLAMP_TO_EDGE,minificationFilter:Wt.LINEAR,magnificationFilter:Jn.LINEAR});t={allWaterTexture:n,sampler:i,destroy:function(){this.allWaterTexture.destroy()}},e.cache.tile_waterMaskData=t}return t}function Lbt(e,t){let n=t.terrainData.waterMask,i=Nbt(e),r,o=n.length;if(n instanceof ImageBitmap)r=Dt.create({context:e,source:n,sampler:i.sampler,flipY:!1,skipColorSpaceConversion:!0});else if(o===1)if(n[0]!==0)r=i.allWaterTexture;else return;else{let s=Math.sqrt(o);r=Dt.create({context:e,pixelFormat:$e.LUMINANCE,pixelDatatype:ze.UNSIGNED_BYTE,source:{width:s,height:s,arrayBufferView:n},sampler:i.sampler,flipY:!1}),r.referenceCount=0}++r.referenceCount,t.waterMaskTexture=r,se.fromElements(0,0,1,1,t.waterMaskTranslationAndScale)}var sm=Hp;var Fbt={WEST:0,NORTH:1,EAST:2,SOUTH:3,NORTHWEST:4,NORTHEAST:5,SOUTHWEST:6,SOUTHEAST:7},In=Fbt;var Mve={NONE:0,CULLED:1,RENDERED:2,REFINED:3,RENDERED_AND_KICKED:6,REFINED_AND_KICKED:7,CULLED_BUT_NEEDED:9,wasKicked:function(e){return e>=Mve.RENDERED_AND_KICKED},originalResult:function(e){return e&3},kick:function(e){return e|4}},gi=Mve;function qS(e){this.tile=e,this.frameLastUpdated=void 0,this.westMeshes=[],this.westTiles=[],this.southMeshes=[],this.southTiles=[],this.eastMeshes=[],this.eastTiles=[],this.northMeshes=[],this.northTiles=[],this.southwestMesh=void 0,this.southwestTile=void 0,this.southeastMesh=void 0,this.southeastTile=void 0,this.northwestMesh=void 0,this.northwestTile=void 0,this.northeastMesh=void 0,this.northeastTile=void 0,this.changedThisFrame=!0,this.visitedFrame=void 0,this.enqueuedFrame=void 0,this.mesh=void 0,this.vertexArray=void 0,this.waterMaskTexture=void 0,this.waterMaskTranslationAndScale=new se}qS.prototype.update=function(e,t,n){this.changedThisFrame&&(zve(e,t,this.tile,n),this.changedThisFrame=!1)};qS.prototype.destroy=function(e){this._destroyVertexArray(e),l(this.waterMaskTexture)&&(--this.waterMaskTexture.referenceCount,this.waterMaskTexture.referenceCount===0&&this.waterMaskTexture.destroy(),this.waterMaskTexture=void 0)};qS.prototype._destroyVertexArray=function(e){l(this.vertexArray)&&(l(e)?e.push(this.vertexArray):sm._freeVertexArray(this.vertexArray),this.vertexArray=void 0)};var Bbt=new Zb;qS.updateFillTiles=function(e,t,n,i){let r=e._quadtree,o=r._levelZeroTiles,s=r._lastSelectionFrameNumber,a=Bbt;a.clear();for(let u=0;u<t.length;++u){let f=t[u];l(f.data.vertexArray)&&a.enqueue(t[u])}let c=a.dequeue();for(;c!==void 0;){let u=c.findTileToWest(o),f=c.findTileToSouth(o),d=c.findTileToEast(o),p=c.findTileToNorth(o);Aa(e,n,c,u,s,In.EAST,!1,a,i),Aa(e,n,c,f,s,In.NORTH,!1,a,i),Aa(e,n,c,d,s,In.WEST,!1,a,i),Aa(e,n,c,p,s,In.SOUTH,!1,a,i);let g=u.findTileToNorth(o),m=u.findTileToSouth(o),y=d.findTileToNorth(o),A=d.findTileToSouth(o);Aa(e,n,c,g,s,In.SOUTHEAST,!1,a,i),Aa(e,n,c,y,s,In.SOUTHWEST,!1,a,i),Aa(e,n,c,m,s,In.NORTHEAST,!1,a,i),Aa(e,n,c,A,s,In.NORTHWEST,!1,a,i),c=a.dequeue()}};function Aa(e,t,n,i,r,o,s,a,c){if(i===void 0)return;let u=i;for(;u&&(u._lastSelectionResultFrame!==r||gi.wasKicked(u._lastSelectionResult)||gi.originalResult(u._lastSelectionResult)===gi.CULLED);){if(s)return;let f=u.parent;if(o>=In.NORTHWEST&&f!==void 0)switch(o){case In.NORTHWEST:u=u===f.northwestChild?f:void 0;break;case In.NORTHEAST:u=u===f.northeastChild?f:void 0;break;case In.SOUTHWEST:u=u===f.southwestChild?f:void 0;break;case In.SOUTHEAST:u=u===f.southeastChild?f:void 0;break}else u=f}if(u!==void 0){if(u._lastSelectionResult===gi.RENDERED){if(l(u.data.vertexArray))return;kbt(e,t,n,u,o,r,a,c);return}if(gi.originalResult(i._lastSelectionResult)!==gi.CULLED)switch(o){case In.WEST:Aa(e,t,n,i.northwestChild,r,o,!0,a,c),Aa(e,t,n,i.southwestChild,r,o,!0,a,c);break;case In.EAST:Aa(e,t,n,i.southeastChild,r,o,!0,a,c),Aa(e,t,n,i.northeastChild,r,o,!0,a,c);break;case In.SOUTH:Aa(e,t,n,i.southwestChild,r,o,!0,a,c),Aa(e,t,n,i.southeastChild,r,o,!0,a,c);break;case In.NORTH:Aa(e,t,n,i.northeastChild,r,o,!0,a,c),Aa(e,t,n,i.northwestChild,r,o,!0,a,c);break;case In.NORTHWEST:Aa(e,t,n,i.northwestChild,r,o,!0,a,c);break;case In.NORTHEAST:Aa(e,t,n,i.northeastChild,r,o,!0,a,c);break;case In.SOUTHWEST:Aa(e,t,n,i.southwestChild,r,o,!0,a,c);break;case In.SOUTHEAST:Aa(e,t,n,i.southeastChild,r,o,!0,a,c);break;default:throw new pe("Invalid edge")}}}function kbt(e,t,n,i,r,o,s,a){let c=i.data;if(c.fill===void 0)c.fill=new qS(i);else if(c.fill.visitedFrame===o)return;c.fill.enqueuedFrame!==o&&(c.fill.enqueuedFrame=o,c.fill.changedThisFrame=!1,s.enqueue(i)),Ubt(e,t,n,i,r,a)}function Ubt(e,t,n,i,r,o){let s=i.data.fill,a,c=n.data.fill;l(c)?(c.visitedFrame=t.frameNumber,c.changedThisFrame&&(zve(e,t,n,o),c.changedThisFrame=!1),a=n.data.fill.mesh):a=n.data.mesh;let u,f;switch(r){case In.WEST:u=s.westMeshes,f=s.westTiles;break;case In.SOUTH:u=s.southMeshes,f=s.southTiles;break;case In.EAST:u=s.eastMeshes,f=s.eastTiles;break;case In.NORTH:u=s.northMeshes,f=s.northTiles;break;case In.NORTHWEST:s.changedThisFrame=s.changedThisFrame||s.northwestMesh!==a,s.northwestMesh=a,s.northwestTile=n;return;case In.NORTHEAST:s.changedThisFrame=s.changedThisFrame||s.northeastMesh!==a,s.northeastMesh=a,s.northeastTile=n;return;case In.SOUTHWEST:s.changedThisFrame=s.changedThisFrame||s.southwestMesh!==a,s.southwestMesh=a,s.southwestTile=n;return;case In.SOUTHEAST:s.changedThisFrame=s.changedThisFrame||s.southeastMesh!==a,s.southeastMesh=a,s.southeastTile=n;return}if(n.level<=i.level){s.changedThisFrame=s.changedThisFrame||u[0]!==a||u.length!==1,u[0]=a,f[0]=n,u.length=1,f.length=1;return}let d,p,g,m,y=n.rectangle,A,b=i.rectangle;switch(r){case In.WEST:for(A=(b.north-b.south)*P.EPSILON5,d=0;d<f.length&&(g=f[d],m=g.rectangle,!P.greaterThan(y.north,m.south,A));++d);for(p=d;p<f.length&&(g=f[p],m=g.rectangle,!P.greaterThanOrEquals(y.south,m.north,A));++p);break;case In.SOUTH:for(A=(b.east-b.west)*P.EPSILON5,d=0;d<f.length&&(g=f[d],m=g.rectangle,!P.lessThan(y.west,m.east,A));++d);for(p=d;p<f.length&&(g=f[p],m=g.rectangle,!P.lessThanOrEquals(y.east,m.west,A));++p);break;case In.EAST:for(A=(b.north-b.south)*P.EPSILON5,d=0;d<f.length&&(g=f[d],m=g.rectangle,!P.lessThan(y.south,m.north,A));++d);for(p=d;p<f.length&&(g=f[p],m=g.rectangle,!P.lessThanOrEquals(y.north,m.south,A));++p);break;case In.NORTH:for(A=(b.east-b.west)*P.EPSILON5,d=0;d<f.length&&(g=f[d],m=g.rectangle,!P.greaterThan(y.east,m.west,A));++d);for(p=d;p<f.length&&(g=f[p],m=g.rectangle,!P.greaterThanOrEquals(y.west,m.east,A));++p);break}p-d===1?(s.changedThisFrame=s.changedThisFrame||u[d]!==a,u[d]=a,f[d]=n):(s.changedThisFrame=!0,u.splice(d,p-d,a),f.splice(d,p-d,n))}var tT=new he,zbt=new he,WS=new h,tte=new h,Zee=new U,Qee=new U,If=new U;function Oj(){this.height=0,this.encodedNormal=new U}function Sj(e,t,n,i,r,o,s,a,c){if(l(r))return r;let u;if(l(o)&&l(s))u=(o.height+s.height)*.5;else if(l(o))u=o.height;else if(l(s))u=s.height;else if(l(a))u=a.height;else{let d=e.tile.data.tileBoundingRegion,p=0,g=0;l(d)&&(p=d.minimumHeight,g=d.maximumHeight),u=(p+g)*.5}return Vve(e,t,n,i,u,c),c}var Vbt={minimumHeight:0,maximumHeight:0},jbt=new h,Nve=new Oj,Lve=new Oj,Fve=new Oj,Bve=new Oj,Hbt=typeof Uint8Array<"u"?new Uint8Array(81):void 0,Gbt={tilingScheme:void 0,x:0,y:0,level:0,exaggeration:1,exaggerationRelativeHeight:0};function zve(e,t,n,i){sm.initialize(n,e.terrainProvider,e.vectorProvider,e._imageryLayers);let r=n.data,o=r.fill,s=n.rectangle,a=t.verticalExaggeration,c=t.verticalExaggerationRelativeHeight,u=a!==1,f=n.tilingScheme.ellipsoid,d=Ij(o,f,0,1,o.northwestTile,o.northwestMesh,o.northTiles,o.northMeshes,o.westTiles,o.westMeshes,Fve),p=Ij(o,f,0,0,o.southwestTile,o.southwestMesh,o.westTiles,o.westMeshes,o.southTiles,o.southMeshes,Nve),g=Ij(o,f,1,0,o.southeastTile,o.southeastMesh,o.southTiles,o.southMeshes,o.eastTiles,o.eastMeshes,Lve),m=Ij(o,f,1,1,o.northeastTile,o.northeastMesh,o.eastTiles,o.eastMeshes,o.northTiles,o.northMeshes,Bve);d=Sj(o,f,0,1,d,p,m,g,Fve),p=Sj(o,f,0,0,p,d,g,m,Nve),g=Sj(o,f,1,1,g,p,m,d,Lve),m=Sj(o,f,1,1,m,g,d,p,Bve);let y=p.height,A=g.height,b=d.height,x=m.height,T=Math.min(y,A,b,x),E=Math.max(y,A,b,x),v=(T+E)*.5,S,I,R=e.getLevelMaximumGeometricError(n.level),O=f.maximumRadius-R,L=Math.acos(O/f.maximumRadius)*4;if(L*=1.5,s.width>L&&E-T<=R){let w=new sl({width:9,height:9,buffer:Hbt,structure:{heightOffset:E}}),D=Gbt;D.tilingScheme=n.tilingScheme,D.x=n.x,D.y=n.y,D.level=n.level,D.exaggeration=a,D.exaggerationRelativeHeight=c,o.mesh=w._createMeshSync(D)}else{let w=u,D=ie.center(s,zbt);D.height=v;let N=f.cartographicToCartesian(D,jbt),F=new Po(N,void 0,void 0,void 0,void 0,!0,!0,w,a,c),V=5,B;for(B=o.westMeshes,S=0,I=B.length;S<I;++S)V+=B[S].eastIndicesNorthToSouth.length;for(B=o.southMeshes,S=0,I=B.length;S<I;++S)V+=B[S].northIndicesWestToEast.length;for(B=o.eastMeshes,S=0,I=B.length;S<I;++S)V+=B[S].westIndicesSouthToNorth.length;for(B=o.northMeshes,S=0,I=B.length;S<I;++S)V+=B[S].southIndicesEastToWest.length;let j=Vbt;j.minimumHeight=T,j.maximumHeight=E;let k=F.stride,G=new Float32Array(V*k),q=0,Q=q;q=wj(f,s,F,G,q,0,1,d.height,d.encodedNormal,1,j),q=Dj(o,f,F,G,q,o.westTiles,o.westMeshes,In.EAST,j);let W=q;q=wj(f,s,F,G,q,0,0,p.height,p.encodedNormal,0,j),q=Dj(o,f,F,G,q,o.southTiles,o.southMeshes,In.NORTH,j);let J=q;q=wj(f,s,F,G,q,1,0,g.height,g.encodedNormal,0,j),q=Dj(o,f,F,G,q,o.eastTiles,o.eastMeshes,In.WEST,j);let Z=q;q=wj(f,s,F,G,q,1,1,m.height,m.encodedNormal,1,j),q=Dj(o,f,F,G,q,o.northTiles,o.northMeshes,In.SOUTH,j),T=j.minimumHeight,E=j.maximumHeight;let ae=en.fromRectangle(s,T,E,n.tilingScheme.ellipsoid),Ae=Ti.geodeticLatitudeToMercatorAngle(s.south),fe=1/(Ti.geodeticLatitudeToMercatorAngle(s.north)-Ae),xe=(Ti.geodeticLatitudeToMercatorAngle(D.latitude)-Ae)*fe,ge=f.geodeticSurfaceNormalCartographic(tT,tte),we=cn.octEncode(ge,Zee),ve=q;F.encode(G,q*k,ae.center,U.fromElements(.5,.5,If),v,we,xe,ge),++q;let Re=q,Qe=Re<256?1:2,He=(Re-1)*3,Ye=He*Qe,Ke=(G.length-Re*k)*Float32Array.BYTES_PER_ELEMENT,Pe;if(Ke>=Ye){let mt=Re*k*Float32Array.BYTES_PER_ELEMENT;Pe=Re<256?new Uint8Array(G.buffer,mt,He):new Uint16Array(G.buffer,mt,He)}else Pe=Re<256?new Uint8Array(He):new Uint16Array(He);G=new Float32Array(G.buffer,0,Re*k);let qe=0;for(S=0;S<Re-2;++S)Pe[qe++]=ve,Pe[qe++]=S,Pe[qe++]=S+1;Pe[qe++]=ve,Pe[qe++]=S,Pe[qe]=0;let st=[];for(S=W;S>=Q;--S)st.push(S);let vt=[];for(S=J;S>=W;--S)vt.push(S);let jt=[];for(S=Z;S>=J;--S)jt.push(S);let lt=[];for(lt.push(0),S=ve-1;S>=Z;--S)lt.push(S);o.mesh=new Sc(F.center,G,Pe,He,Re,T,E,s,ue.fromOrientedBoundingBox(ae),Jbt(e,ae.center,s,T,E),F.stride,ae,F,st,vt,jt,lt)}let _=t.context;o._destroyVertexArray(i),o.vertexArray=sm._createVertexArrayForMesh(_,o.mesh),r.processImagery(n,e.terrainProvider,t,!0);let C=o.waterMaskTexture;if(o.waterMaskTexture=void 0,e.terrainProvider.hasWaterMask){let w=r._findAncestorTileWithTerrainData(n);l(w)&&l(w.data.waterMaskTexture)&&(o.waterMaskTexture=w.data.waterMaskTexture,++o.waterMaskTexture.referenceCount,r._computeWaterMaskTranslationAndScale(n,w,o.waterMaskTranslationAndScale))}l(C)&&(--C.referenceCount,C.referenceCount===0&&C.destroy())}function wj(e,t,n,i,r,o,s,a,c,u,f){let d=tT;d.longitude=P.lerp(t.west,t.east,o),d.latitude=P.lerp(t.south,t.north,s),d.height=a;let p=e.cartographicToCartesian(d,WS),g;n.hasGeodeticSurfaceNormals&&(g=e.geodeticSurfaceNormal(p,tte));let m=Qee;return m.x=o,m.y=s,n.encode(i,r*n.stride,p,m,a,c,u,g),f.minimumHeight=Math.min(f.minimumHeight,a),f.maximumHeight=Math.max(f.maximumHeight,a),r+1}var Rj=new ie;function xR(e,t,n,i){let r=e.rectangle,o=t.rectangle;t.x===0&&n.x===1&&e.x===e.tilingScheme.getNumberOfXTilesAtLevel(e.level)-1?(r=ie.clone(e.rectangle,Rj),r.west-=P.TWO_PI,r.east-=P.TWO_PI):e.x===0&&n.x===0&&t.x===t.tilingScheme.getNumberOfXTilesAtLevel(t.level)-1&&(r=ie.clone(e.rectangle,Rj),r.west+=P.TWO_PI,r.east+=P.TWO_PI);let s=r.east-r.west,a=(o.west-r.west)/s,c=(o.east-r.west)/s,u=r.north-r.south,f=(o.south-r.south)/u,d=(o.north-r.south)/u,p=(n.x-a)/(c-a),g=(n.y-f)/(d-f);return Math.abs(p)<Math.EPSILON5?p=0:Math.abs(p-1)<Math.EPSILON5&&(p=1),Math.abs(g)<Math.EPSILON5?g=0:Math.abs(g-1)<Math.EPSILON5&&(g=1),i.x=p,i.y=g,i}var Wbt=new U;function ete(e,t,n,i,r){let o=e.encoding,s=e.vertices;if(r.height=o.decodeHeight(s,t),o.hasVertexNormals)o.getOctEncodedNormal(s,t,r.encodedNormal);else{let a=r.encodedNormal;a.x=0,a.y=0}}var qbt=new U,Ybt=new h;function Xbt(e,t,n,i,r,o,s,a,c,u){let f=i.encoding,d=i.vertices,p=xR(t,n,f.decodeTextureCoordinates(d,r,If),If),g=xR(t,n,f.decodeTextureCoordinates(d,o,Qee),Qee),m;c?m=(s-p.x)/(g.x-p.x):m=(a-p.y)/(g.y-p.y);let y=f.decodeHeight(d,r),A=f.decodeHeight(d,o),b=n.rectangle;tT.longitude=P.lerp(b.west,b.east,s),tT.latitude=P.lerp(b.south,b.north,a),u.height=tT.height=P.lerp(y,A,m);let x;if(f.hasVertexNormals){let T=f.getOctEncodedNormal(d,r,Wbt),E=f.getOctEncodedNormal(d,o,qbt),v=cn.octDecode(T.x,T.y,WS),S=cn.octDecode(E.x,E.y,Ybt);x=h.lerp(v,S,m,WS),h.normalize(x,x),cn.octEncode(x,u.encodedNormal)}else x=e.geodeticSurfaceNormalCartographic(tT,WS),cn.octEncode(x,u.encodedNormal)}function Vve(e,t,n,i,r,o){o.height=r;let s=t.geodeticSurfaceNormalCartographic(tT,WS);cn.octEncode(s,o.encodedNormal)}function Ij(e,t,n,i,r,o,s,a,c,u,f){if(Uve(e,t,a,s,!1,n,i,f)||Uve(e,t,u,c,!0,n,i,f))return f;let p;if(nte(r,o))return n===0?i===0?p=o.eastIndicesNorthToSouth[0]:p=o.southIndicesEastToWest[0]:i===0?p=o.northIndicesWestToEast[0]:p=o.westIndicesSouthToNorth[0],ete(o,p,n,i,f),f;let g;if(n===0?i===0?g=Pj(e.westMeshes,e.westTiles,In.EAST,e.southMeshes,e.southTiles,In.NORTH,n,i):g=Pj(e.northMeshes,e.northTiles,In.SOUTH,e.westMeshes,e.westTiles,In.EAST,n,i):i===0?g=Pj(e.southMeshes,e.southTiles,In.NORTH,e.eastMeshes,e.eastTiles,In.WEST,n,i):g=Pj(e.eastMeshes,e.eastTiles,In.WEST,e.northMeshes,e.northTiles,In.SOUTH,n,i),l(g))return Vve(e,t,n,i,g,f),f}function Pj(e,t,n,i,r,o,s,a){let c=kve(e,t,!1,n,s,a),u=kve(i,r,!0,o,s,a);return l(c)&&l(u)?(c+u)*.5:l(c)?c:u}function Dj(e,t,n,i,r,o,s,a,c){for(let u=0;u<o.length;++u)r=Kbt(e,t,n,i,r,o[u],s[u],a,c);return r}function Kbt(e,t,n,i,r,o,s,a,c){let u;a===In.EAST&&e.tile.x===0?(u=ie.clone(o.rectangle,Rj),u.west-=P.TWO_PI,u.east-=P.TWO_PI):a===In.WEST&&o.x===0&&(u=ie.clone(o.rectangle,Rj),u.west+=P.TWO_PI,u.east+=P.TWO_PI);let f=e.tile.rectangle,d,p;r>0&&(n.decodeTextureCoordinates(i,r-1,If),d=If.x,p=If.y);let g,m;switch(a){case In.WEST:g=s.westIndicesSouthToNorth,m=!1;break;case In.NORTH:g=s.northIndicesWestToEast,m=!0;break;case In.EAST:g=s.eastIndicesNorthToSouth,m=!1;break;case In.SOUTH:g=s.southIndicesEastToWest,m=!0;break}let y=o,A=e.tile,b=s.encoding,x=s.vertices,T=n.stride,E,v;b.hasWebMercatorT&&(E=Ti.geodeticLatitudeToMercatorAngle(f.south),v=1/(Ti.geodeticLatitudeToMercatorAngle(f.north)-E));for(let S=0;S<g.length;++S){let I=g[S],R=b.decodeTextureCoordinates(x,I,If);xR(y,A,R,R);let O=R.x,L=R.y,_=m?O:L;if(_<0||_>1||Math.abs(O-d)<P.EPSILON5&&Math.abs(L-p)<P.EPSILON5)continue;let C=Math.abs(O)<P.EPSILON5||Math.abs(O-1)<P.EPSILON5,w=Math.abs(L)<P.EPSILON5||Math.abs(L-1)<P.EPSILON5;if(C&&w)continue;let D=b.decodePosition(x,I,WS),N=b.decodeHeight(x,I),F;b.hasVertexNormals?F=b.getOctEncodedNormal(x,I,Zee):(F=Zee,F.x=0,F.y=0);let V=L;if(b.hasWebMercatorT){let j=P.lerp(f.south,f.north,L);V=(Ti.geodeticLatitudeToMercatorAngle(j)-E)*v}let B;n.hasGeodeticSurfaceNormals&&(B=t.geodeticSurfaceNormal(D,tte)),n.encode(i,r*T,D,R,N,F,V,B),c.minimumHeight=Math.min(c.minimumHeight,N),c.maximumHeight=Math.max(c.maximumHeight,N),++r}return r}function kve(e,t,n,i,r,o){let s,a,c;n?(s=0,a=e.length,c=1):(s=e.length-1,a=-1,c=-1);for(let u=s;u!==a;u+=c){let f=e[u],d=t[u];if(!nte(d,f))continue;let p;switch(i){case In.WEST:p=f.westIndicesSouthToNorth;break;case In.SOUTH:p=f.southIndicesEastToWest;break;case In.EAST:p=f.eastIndicesNorthToSouth;break;case In.NORTH:p=f.northIndicesWestToEast;break}let g=p[n?0:p.length-1];if(l(g))return f.encoding.decodeHeight(f.vertices,g)}}function nte(e,t){return l(t)&&(!l(e.data.fill)||!e.data.fill.changedThisFrame)}function Uve(e,t,n,i,r,o,s,a){let c,u,f,d,p,g=i[r?0:n.length-1],m=n[r?0:n.length-1];if(nte(g,m)&&(o===0?s===0?(c=r?m.northIndicesWestToEast:m.eastIndicesNorthToSouth,u=r,f=r):(c=r?m.eastIndicesNorthToSouth:m.southIndicesEastToWest,u=!r,f=!1):s===0?(c=r?m.westIndicesSouthToNorth:m.northIndicesWestToEast,u=!r,f=!0):(c=r?m.southIndicesEastToWest:m.westIndicesSouthToNorth,u=r,f=!r),c.length>0)){d=r?0:c.length-1,p=c[d],m.encoding.decodeTextureCoordinates(m.vertices,p,If);let y=xR(g,e.tile,If,If);if(y.x===o&&y.y===s)return ete(m,p,o,s,a),!0;if(d=Pr(c,u?o:s,function(A,b){m.encoding.decodeTextureCoordinates(m.vertices,A,If);let x=xR(g,e.tile,If,If);return f?u?x.x-o:x.y-s:u?o-x.x:s-x.y}),d<0){if(d=~d,d>0&&d<c.length)return Xbt(t,g,e.tile,m,c[d-1],c[d],o,s,u,a),!0}else return ete(m,c[d],o,s,a),!0}return!1}var $bt=[new h,new h,new h,new h];function Jbt(e,t,n,i,r,o){let s=e.quadtree._occluders.ellipsoid,a=s.ellipsoid,c=$bt;return h.fromRadians(n.west,n.south,r,a,c[0]),h.fromRadians(n.east,n.south,r,a,c[1]),h.fromRadians(n.west,n.north,r,a,c[2]),h.fromRadians(n.east,n.north,r,a,c[3]),s.computeHorizonCullingPointPossiblyUnderEllipsoid(t,c,i,o)}var TR=qS;var ite=class e{constructor(t){this.lightingFadeOutDistance=65e5,this.lightingFadeInDistance=9e6,this.hasWaterMask=!1,this.showWaterEffect=!1,this.oceanNormalMap=void 0,this.zoomedOutOceanSpecularIntensity=.5,this.enableLighting=!1,this.dynamicAtmosphereLighting=!1,this.dynamicAtmosphereLightingFromSun=!1,this.showGroundAtmosphere=!1,this.shadows=Pn.RECEIVE_ONLY,this.vertexShadowDarkness=.3,this.fillHighlightColor=void 0,this.hueShift=0,this.saturationShift=0,this.brightnessShift=0,this.showSkirts=!0,this.backFaceCulling=!0,this.undergroundColor=void 0,this.undergroundColorAlphaByDistance=void 0,this.lambertDiffuseMultiplier=0,this.materialUniformMap=void 0,this._materialUniformMap=void 0,this._quadtree=void 0,this._terrainProvider=t.terrainProvider,this._vectorProvider=t.vectorProvider,this._imageryLayers=t.imageryLayers,this._surfaceShaderSet=t.surfaceShaderSet,this._renderState=void 0,this._blendRenderState=void 0,this._disableCullingRenderState=void 0,this._disableCullingBlendRenderState=void 0,this._errorEvent=new be,this._removeLayerAddedListener=this._imageryLayers.layerAdded.addEventListener(e.prototype._onLayerAdded,this),this._removeLayerRemovedListener=this._imageryLayers.layerRemoved.addEventListener(e.prototype._onLayerRemoved,this),this._removeLayerMovedListener=this._imageryLayers.layerMoved.addEventListener(e.prototype._onLayerMoved,this),this._removeLayerShownListener=this._imageryLayers.layerShownOrHidden.addEventListener(e.prototype._onLayerShownOrHidden,this),this._imageryLayersUpdatedEvent=new be,this._layerOrderChanged=!1,this._tilesToRenderByTextureCount=[],this._drawCommands=[],this._uniformMaps=[],this._usedDrawCommands=0,this._vertexArraysToDestroy=[],this._debug={wireframe:!1,boundingSphereTile:void 0,tilesRendered:0,texturesRendered:0},this._baseColor=void 0,this._firstPassInitialColor=void 0,this.baseColor=new z(0,0,.5,1),this._clippingPlanes=void 0,this._clippingPolygons=void 0,this._clippingPolygonsDirty=!1,this._removeClippingPolygonAdded=void 0,this._removeClippingPolygonRemoved=void 0,this.cartographicLimitRectangle=ie.clone(ie.MAX_VALUE),this._hasLoadedTilesThisFrame=!1,this._hasFillTilesThisFrame=!1,this._oldVerticalExaggeration=void 0,this._oldVerticalExaggerationRelativeHeight=void 0,this._oldSceneMode=re.SCENE3D}get baseColor(){return this._baseColor}set baseColor(t){this._baseColor=t,this._firstPassInitialColor=se.fromColor(t,this._firstPassInitialColor)}get quadtree(){return this._quadtree}set quadtree(t){this._quadtree=t}get tilingScheme(){if(l(this._terrainProvider))return this._terrainProvider.tilingScheme}get errorEvent(){return this._errorEvent}get imageryLayersUpdatedEvent(){return this._imageryLayersUpdatedEvent}get terrainProvider(){return this._terrainProvider}set terrainProvider(t){this._terrainProvider!==t&&(this._terrainProvider=t,l(this._quadtree)&&this._quadtree.invalidateAllTiles())}get vectorProvider(){return this._vectorProvider}get clippingPlanes(){return this._clippingPlanes}set clippingPlanes(t){Ds.setOwner(t,this,"_clippingPlanes")}get clippingPolygons(){return this._clippingPolygons}set clippingPolygons(t){if(t===this._clippingPolygons||($c.setOwner(t,this,"_clippingPolygons"),this._removeClippingPolygonAdded=this._removeClippingPolygonAdded&&this._removeClippingPolygonAdded(),this._removeClippingPolygonRemoved=this._removeClippingPolygonRemoved&&this._removeClippingPolygonRemoved(),this._clippingPolygonsDirty=!0,!l(t)))return;let n=()=>{this._clippingPolygonsDirty=!0};this._removeClippingPolygonAdded=t.polygonAdded.addEventListener(n),this._removeClippingPolygonRemoved=t.polygonRemoved.addEventListener(n)}update(t){this._imageryLayers._update()}initialize(t){this._imageryLayers.queueReprojectionCommands(t),this._layerOrderChanged&&(this._layerOrderChanged=!1,this._quadtree.forEachLoadedTile(function(o){o.data.imagery.sort(ext)}));let n=this._vectorProvider;n.minimumTileScreenPixels=Qbt(this),n.update(t.frameNumber),this._quadtree.forEachRenderedTile(o=>{let s=o.data;l(s.vectorData)?s.vectorData=n.updateTileData(o.x,o.y,o.level,t.context,s.vectorData,We.CLAMP_TO_TERRAIN):s.vectorData=n.requestTileData(o.x,o.y,o.level,t.context,We.CLAMP_TO_TERRAIN)}),n.makeClean(),rxt(this,t);let i=this._vertexArraysToDestroy,r=i.length;for(let o=0;o<r;++o)sm._freeVertexArray(i[o]);i.length=0}beginUpdate(t){let n=this._tilesToRenderByTextureCount;for(let o=0,s=n.length;o<s;++o){let a=n[o];l(a)&&(a.length=0)}let i=this._clippingPlanes;l(i)&&i.enabled&&i.update(t);let r=this._clippingPolygons;l(r)&&r.enabled&&r.update(t),this._usedDrawCommands=0,this._hasLoadedTilesThisFrame=!1,this._hasFillTilesThisFrame=!1}endUpdate(t){if(!l(this._renderState)){this._renderState=Ge.fromCache({cull:{enabled:!0},depthTest:{enabled:!0,func:Ac.LESS}}),this._blendRenderState=Ge.fromCache({cull:{enabled:!0},depthTest:{enabled:!0,func:Ac.LESS_OR_EQUAL},blending:nn.ALPHA_BLEND});let c=Ze(this._renderState,!0);c.cull.enabled=!1,this._disableCullingRenderState=Ge.fromCache(c),c=Ze(this._blendRenderState,!0),c.cull.enabled=!1,this._disableCullingBlendRenderState=Ge.fromCache(c)}this._hasFillTilesThisFrame&&this._hasLoadedTilesThisFrame&&TR.updateFillTiles(this,this._quadtree._tilesToRender,t,this._vertexArraysToDestroy);let n=this.quadtree,i=t.verticalExaggeration,r=t.verticalExaggerationRelativeHeight,o=this._oldVerticalExaggeration!==i||this._oldVerticalExaggerationRelativeHeight!==r;this._oldVerticalExaggeration=i,this._oldVerticalExaggerationRelativeHeight=r,o&&n.forEachLoadedTile(function(c){c.data.updateExaggeration(c,t,n)});let s=this._oldSceneMode!==t.mode;this._oldSceneMode=t.mode,s&&n.forEachLoadedTile(function(c){c.data.updateSceneMode(t.mode)}),this._clippingPolygonsDirty&&txt(this);let a=this._tilesToRenderByTextureCount;for(let c=0,u=a.length;c<u;++c){let f=a[c];if(l(f))for(let d=0,p=f.length;d<p;++d){let g=f[d],m=g.data;nxt(this,g,m,t);let y=m.tileBoundingRegion;Ixt(this,g,t),t.minimumTerrainHeight=Math.min(t.minimumTerrainHeight,y.minimumHeight)}}}updateForPick(t){let n=this._drawCommands;for(let i=0,r=this._usedDrawCommands;i<r;++i){let o=n[i];o.dirty=!0,o.derivedCommands.picking=void 0;let s=o.derivedCommands.logDepth?.command;l(s)&&(s.derivedCommands.picking=void 0),qve(o,t)}}cancelReprojections(){this._imageryLayers.cancelReprojections()}getLevelMaximumGeometricError(t){return l(this._terrainProvider)?this._terrainProvider.getLevelMaximumGeometricError(t):0}loadTile(t,n){let i=n.data,r=!0,o;l(i)&&(r=i.boundingVolumeSourceTile!==n||n._lastSelectionResult===gi.CULLED_BUT_NEEDED,o=i.terrainState),sm.processStateMachine(n,t,this.terrainProvider,this.vectorProvider,this._imageryLayers,this.quadtree,this._vertexArraysToDestroy,r),i=n.data,r&&o!==i.terrainState&&this.computeTileVisibility(n,t,this.quadtree.occluders)!==ns.NONE&&i.boundingVolumeSourceTile===n&&(r=!1,sm.processStateMachine(n,t,this.terrainProvider,this.vectorProvider,this._imageryLayers,this.quadtree,this._vertexArraysToDestroy,r))}computeTileVisibility(t,n,i){let r=this.computeDistanceToTile(t,n);t._distance=r;let o=Xve(this,n);if(n.fog.enabled&&!o&&P.fog(r,n.fog.density)>=1)return ns.NONE;let s=t.data,a=s.tileBoundingRegion;if(s.boundingVolumeSourceTile===void 0)return ns.PARTIAL;let c=n.cullingVolume,u=a.boundingVolume;l(u)||(u=a.boundingSphere),s.clippedByBoundaries=!1;let f=Nj(t.rectangle,this.cartographicLimitRectangle),d=ie.simpleIntersection(f,t.rectangle,Yve);if(!l(d))return ns.NONE;if(ie.equals(d,t.rectangle)||(s.clippedByBoundaries=!0),n.mode!==re.SCENE3D&&(u=oxt,ue.fromRectangleWithHeights2D(t.rectangle,n.mapProjection,a.minimumHeight,a.maximumHeight,u),h.fromElements(u.center.z,u.center.x,u.center.y,u.center),n.mode===re.MORPHING&&l(s.renderedMesh)&&(u=ue.union(a.boundingSphere,u,u))),!l(u))return ns.PARTIAL;let p=this._clippingPlanes;if(l(p)&&p.enabled){let b=p.computeIntersectionWithBoundingVolume(u);if(t.isClipped=b!==$t.INSIDE,b===$t.OUTSIDE)return ns.NONE}let g=this._clippingPolygons;if(l(g)&&g.enabled){let b=g.computeIntersectionWithBoundingVolume(a);t.isClipped=b!==$t.OUTSIDE}let m,y=c.computeVisibility(u);if(y===$t.OUTSIDE?m=ns.NONE:y===$t.INTERSECTING?m=ns.PARTIAL:y===$t.INSIDE&&(m=ns.FULL),m===ns.NONE)return m;let A=n.mode===re.SCENE3D&&n.camera.frustum instanceof _n;if(n.mode===re.SCENE3D&&!A&&l(i)&&!o){let b=s.occludeePointInScaledSpace;return!l(b)||i.ellipsoid.isScaledSpacePointVisiblePossiblyUnderEllipsoid(b,a.minimumHeight)?m:ns.NONE}return m}canRefine(t){let n=t.data;return l(n.terrainData)?!0:this.terrainProvider.getTileDataAvailable(t.x*2,t.y*2,t.level+1)!==void 0}canRenderWithoutLosingDetail(t){let n=t.data,i=cxt;i.length=this._imageryLayers.length;let r=!1,o=!1,s;l(n)&&(r=n.terrainState===kr.READY,o=!0,s=n.imagery);let a,c;for(a=0,c=i.length;a<c;++a)i[a]=o;if(l(s))for(a=0,c=s.length;a<c;++a){let d=s[a],p=d.loadingImagery,g=!l(p)||p.state===jn.FAILED||p.state===jn.INVALID,m=(d.loadingImagery||d.readyImagery).imageryLayer._layerIndex;i[m]=g&&i[m]}let u=this.quadtree._lastSelectionFrameNumber,f=lxt;for(f.length=0,f.push(t.southwestChild,t.southeastChild,t.northwestChild,t.northeastChild);f.length>0;){let d=f.pop(),p=d._lastSelectionResultFrame===u?d._lastSelectionResult:gi.NONE;if(p===gi.RENDERED){let g=d.data;if(!l(g))continue;if(!r&&d.data.terrainState===kr.READY)return!1;let m=d.data.imagery;for(a=0,c=m.length;a<c;++a){let y=m[a],A=y.loadingImagery,b=!l(A)||A.state===jn.FAILED||A.state===jn.INVALID,x=(y.loadingImagery||y.readyImagery).imageryLayer._layerIndex;if(b&&!i[x])return!1}}else p===gi.REFINED&&f.push(d.southwestChild,d.southeastChild,d.northwestChild,d.northeastChild)}return!0}computeTileLoadPriority(t,n){let i=t.data;if(i===void 0)return 0;let r=i.tileBoundingRegion.boundingVolume;if(r===void 0)return 0;let o=n.camera.positionWC,s=n.camera.directionWC,a=h.subtract(r.center,o,uxt),c=h.magnitude(a);return c<P.EPSILON5?0:(h.divideByScalar(a,c,a),(1-h.dot(a,s))*t._distance)}showTileThisFrame(t,n){let i=0,r=t.data,o=r.imagery;for(let c=0,u=o.length;c<u;++c){let f=o[c];l(f.readyImagery)&&f.readyImagery.imageryLayer.alpha!==0&&++i}let s=this._tilesToRenderByTextureCount[i];l(s)||(s=[],this._tilesToRenderByTextureCount[i]=s),s.push(t),l(r.vertexArray)?this._hasLoadedTilesThisFrame=!0:this._hasFillTilesThisFrame=!0;let a=this._debug;++a.tilesRendered,a.texturesRendered+=i}computeDistanceToTile(t,n){yxt(t,this,n);let i=t.data;if(i.boundingVolumeSourceTile===void 0)return 9999999999;let o=i.tileBoundingRegion,s=o.minimumHeight,a=o.maximumHeight;if(i.boundingVolumeSourceTile!==t){let u=n.camera.positionCartographic.height,f=Math.abs(u-s),d=Math.abs(u-a);f>d?(o.minimumHeight=s,o.maximumHeight=s):(o.minimumHeight=a,o.maximumHeight=a)}let c=o.distanceToCamera(n);return o.minimumHeight=s,o.maximumHeight=a,c}isDestroyed(){return!1}destroy(){return this._tileProvider=this._tileProvider&&this._tileProvider.destroy(),this._clippingPlanes=this._clippingPlanes&&this._clippingPlanes.destroy(),this._clippingPolygons=void 0,this._removeLayerAddedListener=this._removeLayerAddedListener&&this._removeLayerAddedListener(),this._removeLayerRemovedListener=this._removeLayerRemovedListener&&this._removeLayerRemovedListener(),this._removeLayerMovedListener=this._removeLayerMovedListener&&this._removeLayerMovedListener(),this._removeLayerShownListener=this._removeLayerShownListener&&this._removeLayerShownListener(),this._removeClippingPolygonAdded=this._removeClippingPolygonAdded&&this._removeClippingPolygonAdded(),this._removeClippingPolygonRemoved=this._removeClippingPolygonRemoved&&this._removeClippingPolygonRemoved(),le(this)}_onLayerAdded(t,n){if(!this.isDestroyed()&&t.show){let i=this._terrainProvider,r=this,o=this._imageryLayersUpdatedEvent,s=function(){t._imageryCache={},r._quadtree.forEachLoadedTile(function(a){if(l(a._loadedCallbacks[t._layerIndex]))return;let c,u=a.data.imagery,f=u.length,d=-1,p=0;for(c=0;c<f;++c){let m=u[c];if((m.readyImagery??m.loadingImagery).imageryLayer===t)d===-1&&(d=c),++p;else if(d!==-1)break}if(d===-1)return;let g=d+p;t._createTileImagerySkeletons(a,i,g)&&(a._loadedCallbacks[t._layerIndex]=Axt(p,t,i),a.state=lc.LOADING)})};if(t.ready){let a=t.imageryProvider;a._reload=s}this._quadtree.forEachLoadedTile(function(a){t._createTileImagerySkeletons(a,i)&&(a.state=lc.LOADING,a.level!==0&&(a._lastSelectionResultFrame!==r.quadtree._lastSelectionFrameNumber||a._lastSelectionResult!==gi.RENDERED)&&(a.renderable=!1))}),this._layerOrderChanged=!0,o.raiseEvent()}}_onLayerRemoved(t,n){this._quadtree.forEachLoadedTile(function(i){let r=i.data.imagery,o=-1,s=0;for(let a=0,c=r.length;a<c;++a){let u=r[a],f=u.loadingImagery;if(l(f)||(f=u.readyImagery),f.imageryLayer===t)o===-1&&(o=a),u.freeResources(),++s;else if(o!==-1)break}o!==-1&&r.splice(o,s)}),l(t.imageryProvider)&&(t.imageryProvider._reload=void 0),this._imageryLayersUpdatedEvent.raiseEvent()}_onLayerMoved(t,n,i){this._layerOrderChanged=!0,this._imageryLayersUpdatedEvent.raiseEvent()}_onLayerShownOrHidden(t,n,i){i?this._onLayerAdded(t,n):this._onLayerRemoved(t,n)}},Zbt=new ie;function Qbt(e){let t=e.getLevelMaximumGeometricError(0);if(t<=0)return e._vectorProvider.minimumTileScreenPixels;let n=e.tilingScheme;return n.tileXYToRectangle(0,0,0,Zbt).width*n.ellipsoid.maximumRadius/t*e._quadtree.maximumScreenSpaceError/2}function ext(e,t){let n=e.loadingImagery;l(n)||(n=e.readyImagery);let i=t.loadingImagery;return l(i)||(i=t.readyImagery),n.imageryLayer._layerIndex-i.imageryLayer._layerIndex}function txt(e){e._quadtree.forEachLoadedTile(function(t){let n=t.data;l(n?.clippingPolygonData)&&($c.releaseRectangleData(n.clippingPolygonData),n.clippingPolygonData=void 0)}),e._clippingPolygonsDirty=!1}function nxt(e,t,n,i){let r=e._clippingPolygons;!l(r)||!r.enabled||!t.isClipped||l(n.clippingPolygonData)||(n.clippingPolygonData=r.requestRectangleData(t.rectangle,i.context))}function ixt(e,t){let n=e._clippingPolygons;return l(n)&&n.enabled&&n.length>0&&n.inverse&&(t.clippingPolygonData?.polygonRings.length??0)===0}function rxt(e,t){let n=t.creditDisplay,i=e._terrainProvider;l(i)&&l(i.credit)&&n.addCreditToNextFrame(i.credit);let r=e._imageryLayers;for(let o=0,s=r.length;o<s;++o){let a=r.get(o);a.ready&&a.show&&l(a.imageryProvider.credit)&&n.addCreditToNextFrame(a.imageryProvider.credit)}}function qve(e,t){let n=t.globeTranslucencyState;if(n.translucent){let i=e.renderState.blending.enabled;n.pushDerivedCommands(e,i,t)}else t.commandList.push(e)}var oxt=new ue,Yve=new ie,sxt=new ie,axt=new he;function Nj(e,t){if(t.west<t.east)return t;let n=ie.clone(t,sxt);return ie.center(e,axt).longitude>0?n.east=P.PI:n.west=-P.PI,n}function Xve(e,t){if(t.cameraUnderground||t.globeTranslucencyState.translucent)return!0;if(e.backFaceCulling)return!1;let n=e._clippingPlanes;if(l(n)&&n.enabled)return!0;let i=e._clippingPolygons;return!!(l(i)&&i.enabled||!ie.equals(e.cartographicLimitRectangle,ie.MAX_VALUE))}var cxt=[],lxt=[],uxt=new h,jve=new M,Mj=new M,fxt=new se,dxt=new se,hxt=new se,mxt=new h,Hve=new h,pxt=new h,gxt=new h,_xt=[new h,new h,new h,new h];function Gve(e,t,n,i,r,o){let s=e.quadtree._occluders.ellipsoid,a=s.ellipsoid,c=_xt;return h.fromRadians(n.west,n.south,r,a,c[0]),h.fromRadians(n.east,n.south,r,a,c[1]),h.fromRadians(n.west,n.north,r,a,c[2]),h.fromRadians(n.east,n.north,r,a,c[3]),s.computeHorizonCullingPointPossiblyUnderEllipsoid(t,c,i,o)}function yxt(e,t,n){let i=e.data;i===void 0&&(i=e.data=new sm);let r=e.tilingScheme.ellipsoid;i.tileBoundingRegion===void 0&&(i.tileBoundingRegion=new Ud({computeBoundingVolumes:!1,rectangle:e.rectangle,ellipsoid:r,minimumHeight:0,maximumHeight:0}));let o=i.tileBoundingRegion,s=o.minimumHeight,a=o.maximumHeight,c=!1,u=e,f=i.mesh,d=i.terrainData;if(f!==void 0&&f.minimumHeight!==void 0&&f.maximumHeight!==void 0)o.minimumHeight=f.minimumHeight,o.maximumHeight=f.maximumHeight,c=!0;else if(d!==void 0&&d._minimumHeight!==void 0&&d._maximumHeight!==void 0)o.minimumHeight=d._minimumHeight,o.maximumHeight=d._maximumHeight;else{o.minimumHeight=Number.NaN,o.maximumHeight=Number.NaN;let p=e.parent;for(;p!==void 0;){let g=p.data;if(g!==void 0){let m=g.mesh,y=g.terrainData;if(m!==void 0&&m.minimumHeight!==void 0&&m.maximumHeight!==void 0){o.minimumHeight=m.minimumHeight,o.maximumHeight=m.maximumHeight;break}else if(y!==void 0&&y._minimumHeight!==void 0&&y._maximumHeight!==void 0){o.minimumHeight=y._minimumHeight,o.maximumHeight=y._maximumHeight;break}}p=p.parent}u=p}if(u!==void 0){let p=n.verticalExaggeration,g=n.verticalExaggerationRelativeHeight;if(p!==1&&(c=!1,o.minimumHeight=br.getHeight(o.minimumHeight,p,g),o.maximumHeight=br.getHeight(o.maximumHeight,p,g)),c)i.boundingVolumeIsFromMesh||(o._orientedBoundingBox=en.clone(f.orientedBoundingBox,o._orientedBoundingBox),o._boundingSphere=ue.clone(f.boundingSphere3D,o._boundingSphere),i.occludeePointInScaledSpace=h.clone(f.occludeePointInScaledSpace,i.occludeePointInScaledSpace),l(i.occludeePointInScaledSpace)||(i.occludeePointInScaledSpace=Gve(t,o._orientedBoundingBox.center,e.rectangle,o.minimumHeight,o.maximumHeight,i.occludeePointInScaledSpace)));else{let y=o._orientedBoundingBox===void 0||o._boundingSphere===void 0;(o.minimumHeight!==s||o.maximumHeight!==a||y)&&(o.computeBoundingVolumes(r),i.occludeePointInScaledSpace=Gve(t,o._orientedBoundingBox.center,e.rectangle,o.minimumHeight,o.maximumHeight,i.occludeePointInScaledSpace))}i.boundingVolumeSourceTile=u,i.boundingVolumeIsFromMesh=c}else i.boundingVolumeSourceTile=void 0,i.boundingVolumeIsFromMesh=!1}function Axt(e,t,n){return function(i){let r,o,s=-1,a=i.data.imagery,c=a.length,u;for(u=0;u<c;++u)if(r=a[u],o=r.readyImagery??r.loadingImagery,o.imageryLayer===t){s=u;break}if(s!==-1){let f=s+e;if(r=a[f],o=l(r)?r.readyImagery??r.loadingImagery:void 0,!l(o)||o.imageryLayer!==t)return!t._createTileImagerySkeletons(i,n,f);for(u=s;u<f;++u)a[u].freeResources();a.splice(s,e)}return!0}}var bxt=new M,xxt=new M;function Wve(e,t){let n={u_initialColor:function(){return this.properties.initialColor},u_fillHighlightColor:function(){return this.properties.fillHighlightColor},u_zoomedOutOceanSpecularIntensity:function(){return this.properties.zoomedOutOceanSpecularIntensity},u_oceanNormalMap:function(){return this.properties.oceanNormalMap},u_atmosphereLightIntensity:function(){return this.properties.atmosphereLightIntensity},u_atmosphereRayleighCoefficient:function(){return this.properties.atmosphereRayleighCoefficient},u_atmosphereMieCoefficient:function(){return this.properties.atmosphereMieCoefficient},u_atmosphereRayleighScaleHeight:function(){return this.properties.atmosphereRayleighScaleHeight},u_atmosphereMieScaleHeight:function(){return this.properties.atmosphereMieScaleHeight},u_atmosphereMieAnisotropy:function(){return this.properties.atmosphereMieAnisotropy},u_lightingFadeDistance:function(){return this.properties.lightingFadeDistance},u_nightFadeDistance:function(){return this.properties.nightFadeDistance},u_center3D:function(){return this.properties.center3D},u_verticalExaggerationAndRelativeHeight:function(){return this.properties.verticalExaggerationAndRelativeHeight},u_tileRectangle:function(){return this.properties.tileRectangle},u_modifiedModelView:function(){let i=e.context.uniformState.view,r=M.multiplyByPoint(i,this.properties.rtc,Hve);return M.setTranslation(i,r,jve),jve},u_modifiedModelViewProjection:function(){let i=e.context.uniformState.view,r=e.context.uniformState.projection,o=M.multiplyByPoint(i,this.properties.rtc,Hve);return M.setTranslation(i,o,Mj),M.multiply(r,Mj,Mj),Mj},u_dayTextures:function(){return this.properties.dayTextures},u_dayTextureTranslationAndScale:function(){return this.properties.dayTextureTranslationAndScale},u_dayTextureTexCoordsRectangle:function(){return this.properties.dayTextureTexCoordsRectangle},u_dayTextureUseWebMercatorT:function(){return this.properties.dayTextureUseWebMercatorT},u_dayTextureAlpha:function(){return this.properties.dayTextureAlpha},u_dayTextureNightAlpha:function(){return this.properties.dayTextureNightAlpha},u_dayTextureDayAlpha:function(){return this.properties.dayTextureDayAlpha},u_dayTextureBrightness:function(){return this.properties.dayTextureBrightness},u_dayTextureContrast:function(){return this.properties.dayTextureContrast},u_dayTextureHue:function(){return this.properties.dayTextureHue},u_dayTextureSaturation:function(){return this.properties.dayTextureSaturation},u_dayTextureOneOverGamma:function(){return this.properties.dayTextureOneOverGamma},u_dayIntensity:function(){return this.properties.dayIntensity},u_southAndNorthLatitude:function(){return this.properties.southAndNorthLatitude},u_southMercatorYAndOneOverHeight:function(){return this.properties.southMercatorYAndOneOverHeight},u_waterMask:function(){return this.properties.waterMask},u_waterMaskTranslationAndScale:function(){return this.properties.waterMaskTranslationAndScale},u_minMaxHeight:function(){return this.properties.minMaxHeight},u_scaleAndBias:function(){return this.properties.scaleAndBias},u_dayTextureSplit:function(){return this.properties.dayTextureSplit},u_dayTextureCutoutRectangles:function(){return this.properties.dayTextureCutoutRectangles},u_clippingPlanes:function(){let i=t._clippingPlanes;return l(i)&&l(i.texture)?i.texture:e.context.defaultTexture},u_cartographicLimitRectangle:function(){return this.properties.localizedCartographicLimitRectangle},u_clippingPlanesMatrix:function(){let i=t._clippingPlanes,r=l(i)?M.multiply(e.context.uniformState.view,i.modelMatrix,bxt):M.IDENTITY;return M.inverseTranspose(r,xxt)},u_clippingPlanesEdgeStyle:function(){let i=this.properties.clippingPlanesEdgeColor;return i.alpha=this.properties.clippingPlanesEdgeWidth,i},u_minimumBrightness:function(){return e.fog.minimumBrightness},u_hsbShift:function(){return this.properties.hsbShift},u_colorsToAlpha:function(){return this.properties.colorsToAlpha},u_frontFaceAlphaByDistance:function(){return this.properties.frontFaceAlphaByDistance},u_backFaceAlphaByDistance:function(){return this.properties.backFaceAlphaByDistance},u_translucencyRectangle:function(){return this.properties.localizedTranslucencyRectangle},u_undergroundColor:function(){return this.properties.undergroundColor},u_undergroundColorAlphaByDistance:function(){return this.properties.undergroundColorAlphaByDistance},u_lambertDiffuseMultiplier:function(){return this.properties.lambertDiffuseMultiplier},u_vertexShadowDarkness:function(){return this.properties.vertexShadowDarkness},u_vectorSegmentTexture:function(){return this.properties.vectorSegmentTexture??e.context.defaultTexture},u_vectorWidthTexture:function(){return this.properties.vectorWidthTexture??e.context.defaultTexture},u_vectorColorTexture:function(){return this.properties.vectorColorTexture??e.context.defaultTexture},u_vectorPickColorTexture:function(){return this.properties.vectorPickColorTexture??e.context.defaultTexture},u_vectorSegmentPrimitiveIndicesTexture:function(){return this.properties.vectorSegmentPrimitiveIndicesTexture??e.context.defaultTexture},u_vectorGridCellIndicesTexture:function(){return this.properties.vectorGridCellIndicesTexture??e.context.defaultTexture},u_vectorPolygonEdgeTexture:function(){return this.properties.vectorPolygonEdgeTexture??e.context.defaultTexture},u_vectorPolygonEdgePrimitiveIndicesTexture:function(){return this.properties.vectorPolygonEdgePrimitiveIndicesTexture??e.context.defaultTexture},u_vectorPolygonGridCellIndicesTexture:function(){return this.properties.vectorPolygonGridCellIndicesTexture??e.context.defaultTexture},u_vectorMetersPerUv:function(){return this.properties.vectorMetersPerUv},u_clippingEdgeTexture:function(){return this.properties.clippingEdgeTexture??e.context.defaultTexture},u_clippingEdgePrimitiveIndicesTexture:function(){return this.properties.clippingEdgePrimitiveIndicesTexture??e.context.defaultTexture},u_clippingGridCellIndicesTexture:function(){return this.properties.clippingGridCellIndicesTexture??e.context.defaultTexture},properties:{initialColor:new se(0,0,.5,1),fillHighlightColor:new z(0,0,0,0),zoomedOutOceanSpecularIntensity:.5,oceanNormalMap:void 0,lightingFadeDistance:new U(65e5,9e6),nightFadeDistance:new U(1e7,4e7),atmosphereLightIntensity:10,atmosphereRayleighCoefficient:new h(55e-7,13e-6,284e-7),atmosphereMieCoefficient:new h(21e-6,21e-6,21e-6),atmosphereRayleighScaleHeight:1e4,atmosphereMieScaleHeight:3200,atmosphereMieAnisotropy:.9,hsbShift:new h,center3D:void 0,rtc:new h,modifiedModelView:new M,tileRectangle:new se,verticalExaggerationAndRelativeHeight:new U(1,0),dayTextures:[],dayTextureTranslationAndScale:[],dayTextureTexCoordsRectangle:[],dayTextureUseWebMercatorT:[],dayTextureAlpha:[],dayTextureNightAlpha:[],dayTextureDayAlpha:[],dayTextureBrightness:[],dayTextureContrast:[],dayTextureHue:[],dayTextureSaturation:[],dayTextureOneOverGamma:[],dayTextureSplit:[],dayTextureCutoutRectangles:[],dayIntensity:0,colorsToAlpha:[],southAndNorthLatitude:new U,southMercatorYAndOneOverHeight:new U,waterMask:void 0,waterMaskTranslationAndScale:new se,minMaxHeight:new U,scaleAndBias:new M,clippingPlanesEdgeColor:z.clone(z.WHITE),clippingPlanesEdgeWidth:0,localizedCartographicLimitRectangle:new se,frontFaceAlphaByDistance:new se,backFaceAlphaByDistance:new se,localizedTranslucencyRectangle:new se,undergroundColor:z.clone(z.TRANSPARENT),undergroundColorAlphaByDistance:new se,lambertDiffuseMultiplier:0,vertexShadowDarkness:0,vectorSegmentTexture:void 0,vectorWidthTexture:void 0,vectorColorTexture:void 0,vectorPickColorTexture:void 0,vectorSegmentPrimitiveIndicesTexture:void 0,vectorGridCellIndicesTexture:void 0,vectorPolygonEdgeTexture:void 0,vectorPolygonEdgePrimitiveIndicesTexture:void 0,vectorPolygonGridCellIndicesTexture:void 0,vectorMetersPerUv:new U,clippingEdgeTexture:void 0,clippingEdgePrimitiveIndicesTexture:void 0,clippingGridCellIndicesTexture:void 0}};return l(t.materialUniformMap)?Mt(n,t.materialUniformMap):n}function Txt(e,t){let n=t.data,i,r;if(l(n.vertexArray)?(i=n.mesh,r=n.vertexArray):l(n.fill)&&l(n.fill.vertexArray)&&(i=n.fill.mesh,r=n.fill.vertexArray),!(!l(i)||!l(r))){if(l(n.wireframeVertexArray)){if(n.wireframeVertexArray.mesh===i)return;n.wireframeVertexArray.destroy(),n.wireframeVertexArray=void 0}n.wireframeVertexArray=Ext(e,r,i),n.wireframeVertexArray.mesh=i}}function Ext(e,t,n){let r={indices:n.indices,primitiveType:Oe.TRIANGLES};Wn.toWireframe(r);let o=r.indices,s=tt.createIndexBuffer({context:e,typedArray:o,usage:Me.STATIC_DRAW,indexDatatype:je.fromSizeInBytes(o.BYTES_PER_ELEMENT)});return new Vn({context:e,attributes:t._attributes,indexBuffer:s})}var Kve,$ve,Lj;(function(){let e=new Bt({geometry:cp.fromDimensions({dimensions:new h(2,2,2)})}),t=new Bt({geometry:new Qy({radius:1})}),n=new M,i,r;function o(s){return new Mn({geometryInstances:s,appearance:new An({translucent:!1,flat:!0}),asynchronous:!1})}Kve=function(s,a){return s===i||(Lj(),i=s,n=M.fromRotationTranslation(s.halfAxes,s.center,n),e.modelMatrix=n,e.attributes.color=Jt.fromColor(a),r=o(e)),r},$ve=function(s,a){return s===i||(Lj(),i=s,n=M.fromTranslation(s.center,n),n=M.multiplyByUniformScale(n,s.radius,n),t.modelMatrix=n,t.attributes.color=Jt.fromColor(a),r=o(t)),r},Lj=function(){l(r)&&(r.destroy(),r=void 0,i=void 0)}})();var Cxt=new se(0,0,0,0),vxt={frameState:void 0,surfaceTile:void 0,numberOfDayTextures:void 0,applyBrightness:void 0,applyContrast:void 0,applyHue:void 0,applySaturation:void 0,applyGamma:void 0,applyAlpha:void 0,applyDayNightAlpha:void 0,applySplit:void 0,showReflectiveOcean:void 0,showOceanWaves:void 0,enableLighting:void 0,dynamicAtmosphereLighting:void 0,dynamicAtmosphereLightingFromSun:void 0,showGroundAtmosphere:void 0,perFragmentGroundAtmosphere:void 0,hasVertexNormals:void 0,useWebMercatorProjection:void 0,enableFog:void 0,enableClippingPlanes:void 0,clippingPlanes:void 0,enableClippingPolygons:void 0,clippingPolygons:void 0,clippedByBoundaries:void 0,hasImageryLayerCutout:void 0,colorCorrect:void 0,colorToAlpha:void 0,hasGeodeticSurfaceNormals:void 0,hasExaggeration:void 0,vectorAntialias:void 0},Sxt=z.TRANSPARENT,wxt=new qt;function Ixt(e,t,n){let i=t.data;if(ixt(e,i))return;l(i.vertexArray)||(i.fill===void 0&&(i.fill=new TR(t)),i.fill.update(e,n));let r=n.creditDisplay,o=i.terrainData;if(l(o)&&l(o.credits)){let mt=o.credits;for(let ft=0,Yt=mt.length;ft<Yt;++ft)r.addCreditToNextFrame(mt[ft])}let s=Ut.maximumTextureImageUnits,a=i.waterMaskTexture,c=i.waterMaskTranslationAndScale;!l(a)&&l(i.fill)&&(a=i.fill.waterMaskTexture,c=i.fill.waterMaskTranslationAndScale);let u=n.cameraUnderground,f=n.globeTranslucencyState,d=f.translucent,p=f.frontFaceAlphaByDistance,g=f.backFaceAlphaByDistance,m=f.rectangle,y=e.undergroundColor??Sxt,A=e.undergroundColorAlphaByDistance??wxt,b=Xve(e,n)&&n.mode===re.SCENE3D&&y.alpha>0&&(A.nearValue>0||A.farValue>0),x=e.lambertDiffuseMultiplier,T=e.vertexShadowDarkness,E=e.hasWaterMask&&l(a),v=E&&e.showWaterEffect,S=e.oceanNormalMap,I=v&&l(S),R=e.terrainProvider,O=l(R)&&e.terrainProvider.hasVertexNormals,L=n.fog.enabled&&n.fog.renderable&&!u,_=e.showGroundAtmosphere&&n.mode===re.SCENE3D,C=Pn.castShadows(e.shadows)&&!d,w=Pn.receiveShadows(e.shadows)&&!d,D=e.hueShift,N=e.saturationShift,F=e.brightnessShift,V=!(P.equalsEpsilon(D,0,P.EPSILON7)&&P.equalsEpsilon(N,0,P.EPSILON7)&&P.equalsEpsilon(F,0,P.EPSILON7)),B=!1;if(_){let mt=h.magnitude(n.camera.positionWC),ft=e.nightFadeOutDistance;B=mt>ft}E&&--s,I&&--s,l(n.shadowState)&&n.shadowState.shadowsEnabled&&--s,l(e.clippingPlanes)&&e.clippingPlanes.enabled&&--s,l(e.clippingPolygons)&&e.clippingPolygons.enabled&&(s-=3),s-=f.numberOfTextureUniforms;let j=i.renderedMesh,k=j.center,G=j.encoding,q=i.tileBoundingRegion,Q=n.verticalExaggeration,W=n.verticalExaggerationRelativeHeight,J=Q!==1,Z=G.hasGeodeticSurfaceNormals,ae=fxt,Ae=0,fe=0,xe=0,ge=0,we=!1;if(n.mode!==re.SCENE3D){let mt=n.mapProjection,ft=mt.project(ie.southwest(t.rectangle),pxt),Yt=mt.project(ie.northeast(t.rectangle),gxt);if(ae.x=ft.x,ae.y=ft.y,ae.z=Yt.x,ae.w=Yt.y,n.mode!==re.MORPHING&&(k=mxt,k.x=0,k.y=(ae.z+ae.x)*.5,k.z=(ae.w+ae.y)*.5,ae.x-=k.y,ae.y-=k.z,ae.z-=k.y,ae.w-=k.z),n.mode===re.SCENE2D&&G.quantization===cc.BITS12){let rt=1/(Math.pow(2,12)-1)*.5,ht=(ae.z-ae.x)*rt,Li=(ae.w-ae.y)*rt;ae.x-=ht,ae.y-=Li,ae.z+=ht,ae.w+=Li}mt instanceof Ti&&(Ae=t.rectangle.south,fe=t.rectangle.north,xe=Ti.geodeticLatitudeToMercatorAngle(Ae),ge=1/(Ti.geodeticLatitudeToMercatorAngle(fe)-xe),we=!0)}let ve=vxt;ve.frameState=n,ve.surfaceTile=i,ve.hasWaterMask=E,ve.showReflectiveOcean=v,ve.showOceanWaves=I,ve.enableLighting=e.enableLighting,ve.dynamicAtmosphereLighting=e.dynamicAtmosphereLighting,ve.dynamicAtmosphereLightingFromSun=e.dynamicAtmosphereLightingFromSun,ve.showGroundAtmosphere=_,ve.atmosphereLightIntensity=e.atmosphereLightIntensity,ve.atmosphereRayleighCoefficient=e.atmosphereRayleighCoefficient,ve.atmosphereMieCoefficient=e.atmosphereMieCoefficient,ve.atmosphereRayleighScaleHeight=e.atmosphereRayleighScaleHeight,ve.atmosphereMieScaleHeight=e.atmosphereMieScaleHeight,ve.atmosphereMieAnisotropy=e.atmosphereMieAnisotropy,ve.perFragmentGroundAtmosphere=B,ve.hasVertexNormals=O,ve.useWebMercatorProjection=we,ve.clippedByBoundaries=i.clippedByBoundaries,ve.hasGeodeticSurfaceNormals=Z,ve.hasExaggeration=J,ve.vectorAntialias=e.vectorProvider.antialias;let Re=i.imagery,Qe=0,He=Re.length,Ye=e.showSkirts&&!u&&!d,Ke=e.backFaceCulling&&!u&&!d,Pe=Ke?e._renderState:e._disableCullingRenderState,qe=Ke?e._blendRenderState:e._disableCullingBlendRenderState,st=Pe,vt=e._firstPassInitialColor,jt=n.context;if(l(e._debug.boundingSphereTile)||Lj(),e._materialUniformMap!==e.materialUniformMap){e._materialUniformMap=e.materialUniformMap;let mt=e._drawCommands.length;for(let ft=0;ft<mt;++ft)e._uniformMaps[ft]=Wve(n,e)}do{let mt=0,ft,Yt;if(e._drawCommands.length<=e._usedDrawCommands?(ft=new at,ft.owner=t,ft.cull=!1,ft.boundingVolume=new ue,ft.orientedBoundingBox=void 0,Yt=Wve(n,e),e._drawCommands.push(ft),e._uniformMaps.push(Yt)):(ft=e._drawCommands[e._usedDrawCommands],Yt=e._uniformMaps[e._usedDrawCommands]),ft.owner=t,++e._usedDrawCommands,t===e._debug.boundingSphereTile){let Es=q.boundingVolume,Ha=q.boundingSphere;l(Es)?Kve(Es,z.RED).update(n):l(Ha)&&$ve(Ha,z.RED).update(n)}let rt=Yt.properties;se.clone(vt,rt.initialColor),rt.oceanNormalMap=S,rt.lightingFadeDistance.x=e.lightingFadeOutDistance,rt.lightingFadeDistance.y=e.lightingFadeInDistance,rt.nightFadeDistance.x=e.nightFadeOutDistance,rt.nightFadeDistance.y=e.nightFadeInDistance,rt.atmosphereLightIntensity=e.atmosphereLightIntensity,rt.atmosphereRayleighCoefficient=e.atmosphereRayleighCoefficient,rt.atmosphereMieCoefficient=e.atmosphereMieCoefficient,rt.atmosphereRayleighScaleHeight=e.atmosphereRayleighScaleHeight,rt.atmosphereMieScaleHeight=e.atmosphereMieScaleHeight,rt.atmosphereMieAnisotropy=e.atmosphereMieAnisotropy,rt.zoomedOutOceanSpecularIntensity=e.zoomedOutOceanSpecularIntensity;let ht=u?g:p,Li=u?p:g;l(ht)&&(se.fromElements(ht.near,ht.nearValue,ht.far,ht.farValue,rt.frontFaceAlphaByDistance),se.fromElements(Li.near,Li.nearValue,Li.far,Li.farValue,rt.backFaceAlphaByDistance)),se.fromElements(A.near,A.nearValue,A.far,A.farValue,rt.undergroundColorAlphaByDistance),z.clone(y,rt.undergroundColor),rt.lambertDiffuseMultiplier=x,rt.vertexShadowDarkness=T;let Yn=!l(i.vertexArray)&&l(e.fillHighlightColor)&&e.fillHighlightColor.alpha>0;Yn&&z.clone(e.fillHighlightColor,rt.fillHighlightColor),rt.verticalExaggerationAndRelativeHeight.x=Q,rt.verticalExaggerationAndRelativeHeight.y=W,rt.center3D=j.center,h.clone(k,rt.rtc),se.clone(ae,rt.tileRectangle),rt.southAndNorthLatitude.x=Ae,rt.southAndNorthLatitude.y=fe,rt.southMercatorYAndOneOverHeight.x=xe,rt.southMercatorYAndOneOverHeight.y=ge;let yi=dxt,zi=Nj(t.rectangle,e.cartographicLimitRectangle),Si=hxt,ui=Nj(t.rectangle,m);h.fromElements(D,N,F,rt.hsbShift);let Ai=t.rectangle,zn=1/Ai.width,tn=1/Ai.height;yi.x=(zi.west-Ai.west)*zn,yi.y=(zi.south-Ai.south)*tn,yi.z=(zi.east-Ai.west)*zn,yi.w=(zi.north-Ai.south)*tn,se.clone(yi,rt.localizedCartographicLimitRectangle),Si.x=(ui.west-Ai.west)*zn,Si.y=(ui.south-Ai.south)*tn,Si.z=(ui.east-Ai.west)*zn,Si.w=(ui.north-Ai.south)*tn,se.clone(Si,rt.localizedTranslucencyRectangle);let Hn=L&&P.fog(t._distance,n.fog.density)>P.EPSILON3;V=V&&(Hn||_);let Ki=!1,wr=!1,so=!1,Ts=!1,zs=!1,$r=!1,pi=!1,ao=!1,nr=!1,jo=!1;for(;mt<s&&Qe<He;){let Es=Re[Qe],Ha=Es.readyImagery;if(++Qe,!l(Ha)||Ha.imageryLayer.alpha===0)continue;let ub=Es.useWebMercatorT?Ha.textureWebMercator:Ha.texture,ii=Ha.imageryLayer;l(Es.textureTranslationAndScale)||(Es.textureTranslationAndScale=ii._calculateTextureTranslationAndScale(t,Es)),rt.dayTextures[mt]=ub,rt.dayTextureTranslationAndScale[mt]=Es.textureTranslationAndScale,rt.dayTextureTexCoordsRectangle[mt]=Es.textureCoordinateRectangle,rt.dayTextureUseWebMercatorT[mt]=Es.useWebMercatorT,rt.dayTextureAlpha[mt]=ii.alpha,$r=$r||rt.dayTextureAlpha[mt]!==1,rt.dayTextureNightAlpha[mt]=ii.nightAlpha,pi=pi||rt.dayTextureNightAlpha[mt]!==1,rt.dayTextureDayAlpha[mt]=ii.dayAlpha,pi=pi||rt.dayTextureDayAlpha[mt]!==1,rt.dayTextureBrightness[mt]=ii.brightness,Ki=Ki||rt.dayTextureBrightness[mt]!==Ns.DEFAULT_BRIGHTNESS,rt.dayTextureContrast[mt]=ii.contrast,wr=wr||rt.dayTextureContrast[mt]!==Ns.DEFAULT_CONTRAST,rt.dayTextureHue[mt]=ii.hue,so=so||rt.dayTextureHue[mt]!==Ns.DEFAULT_HUE,rt.dayTextureSaturation[mt]=ii.saturation,Ts=Ts||rt.dayTextureSaturation[mt]!==Ns.DEFAULT_SATURATION,rt.dayTextureOneOverGamma[mt]=1/ii.gamma,zs=zs||rt.dayTextureOneOverGamma[mt]!==1/Ns.DEFAULT_GAMMA,rt.dayTextureSplit[mt]=ii.splitDirection,ao=ao||rt.dayTextureSplit[mt]!==0;let Wr=rt.dayTextureCutoutRectangles[mt];if(l(Wr)||(Wr=rt.dayTextureCutoutRectangles[mt]=new se),se.clone(se.ZERO,Wr),l(ii.cutoutRectangle)){let Ca=Nj(Ai,ii.cutoutRectangle),Mm=ie.simpleIntersection(Ca,Ai,Yve);nr=l(Mm)||nr,Wr.x=(Ca.west-Ai.west)*zn,Wr.y=(Ca.south-Ai.south)*tn,Wr.z=(Ca.east-Ai.west)*zn,Wr.w=(Ca.north-Ai.south)*tn}let _l=rt.colorsToAlpha[mt];l(_l)||(_l=rt.colorsToAlpha[mt]=new se);let w0=l(ii.colorToAlpha)&&ii.colorToAlphaThreshold>0;if(jo=jo||w0,w0){let Ca=ii.colorToAlpha;_l.x=Ca.red,_l.y=Ca.green,_l.z=Ca.blue,_l.w=ii.colorToAlphaThreshold}else _l.w=-1;if(l(Ha.credits)){let Ca=Ha.credits;for(let Mm=0,b_=Ca.length;Mm<b_;++Mm)r.addCreditToNextFrame(Ca[Mm])}++mt}rt.dayTextures.length=mt,rt.waterMask=a,se.clone(c,rt.waterMaskTranslationAndScale),rt.minMaxHeight.x=G.minimumHeight,rt.minMaxHeight.y=G.maximumHeight,M.clone(G.matrix,rt.scaleAndBias);let Fn=e._clippingPlanes,Vi=l(Fn)&&Fn.enabled&&t.isClipped;Vi&&(rt.clippingPlanesEdgeColor=z.clone(Fn.edgeColor,rt.clippingPlanesEdgeColor),rt.clippingPlanesEdgeWidth=Fn.edgeWidth);let Fi=i.vectorData;l(Fi)&&(rt.vectorSegmentTexture=Fi.polylineSegmentTexture,rt.vectorWidthTexture=Fi.widthTexture,rt.vectorColorTexture=Fi.colorTexture,rt.vectorPickColorTexture=Fi.pickColorTexture,rt.vectorSegmentPrimitiveIndicesTexture=Fi.polylineSegmentPrimitiveIndicesTexture,rt.vectorGridCellIndicesTexture=Fi.polylineGridCellIndicesTexture,rt.vectorPolygonEdgeTexture=Fi.polygonEdgeTexture,rt.vectorPolygonEdgePrimitiveIndicesTexture=Fi.polygonEdgePrimitiveIndicesTexture,rt.vectorPolygonGridCellIndicesTexture=Fi.polygonGridCellIndicesTexture,U.clone(Fi.metersPerUv,rt.vectorMetersPerUv));let Ir=i.clippingPolygonData;l(Ir)&&(rt.clippingEdgeTexture=Ir.polygonEdgeTexture,rt.clippingEdgePrimitiveIndicesTexture=Ir.polygonEdgePrimitiveIndicesTexture,rt.clippingGridCellIndicesTexture=Ir.polygonGridCellIndicesTexture);let Mc=e._clippingPolygons,qf=(Ir?.polygonRings.length??0)>0,Rm=l(Mc)&&Mc.enabled&&Mc.length>0&&t.isClipped&&qf;ve.numberOfDayTextures=mt,ve.applyBrightness=Ki,ve.applyContrast=wr,ve.applyHue=so,ve.applySaturation=Ts,ve.applyGamma=zs,ve.applyAlpha=$r,ve.applyDayNightAlpha=pi,ve.applySplit=ao,ve.enableFog=Hn,ve.enableClippingPlanes=Vi,ve.clippingPlanes=Fn,ve.enableClippingPolygons=Rm,ve.clippingPolygons=Mc,ve.hasImageryLayerCutout=nr,ve.colorCorrect=V,ve.highlightFillTile=Yn,ve.colorToAlpha=jo,ve.showUndergroundColor=b,ve.translucent=d;let ch=i.renderedMesh.indices.length;Ye||(ch=i.renderedMesh.indexCountWithoutSkirts),ft.shaderProgram=e._surfaceShaderSet.getShaderProgram(ve),ft.pickId=i.vectorData?.show?"vectorPickColorOver(vec4(0.0))":void 0,ft.castShadows=C,ft.receiveShadows=w,ft.renderState=st,ft.primitiveType=Oe.TRIANGLES,ft.vertexArray=i.vertexArray||i.fill.vertexArray,ft.count=ch,ft.uniformMap=Yt,ft.pass=Ie.GLOBE,e._debug.wireframe&&(Txt(jt,t),l(i.wireframeVertexArray)&&(ft.vertexArray=i.wireframeVertexArray,ft.primitiveType=Oe.LINES,ft.count=ch*2));let na=ft.boundingVolume,Om=ft.orientedBoundingBox;n.mode!==re.SCENE3D?(ue.fromRectangleWithHeights2D(t.rectangle,n.mapProjection,q.minimumHeight,q.maximumHeight,na),h.fromElements(na.center.z,na.center.x,na.center.y,na.center),n.mode===re.MORPHING&&ue.union(q.boundingSphere,na,na)):(ft.boundingVolume=ue.clone(q.boundingSphere,na),ft.orientedBoundingBox=en.clone(q.boundingVolume,Om)),ft.dirty=!0,d&&f.updateDerivedCommands(ft,n),qve(ft,n),st=qe,vt=Cxt}while(Qe<He)}var Fj=ite;function Jve(){this._enabled=!1,this._frontFaceAlpha=1,this._frontFaceAlphaByDistance=void 0,this._backFaceAlpha=1,this._backFaceAlphaByDistance=void 0,this._rectangle=ie.clone(ie.MAX_VALUE)}Object.defineProperties(Jve.prototype,{enabled:{get:function(){return this._enabled},set:function(e){this._enabled=e}},frontFaceAlpha:{get:function(){return this._frontFaceAlpha},set:function(e){this._frontFaceAlpha=e}},frontFaceAlphaByDistance:{get:function(){return this._frontFaceAlphaByDistance},set:function(e){this._frontFaceAlphaByDistance=qt.clone(e,this._frontFaceAlphaByDistance)}},backFaceAlpha:{get:function(){return this._backFaceAlpha},set:function(e){this._backFaceAlpha=e}},backFaceAlphaByDistance:{get:function(){return this._backFaceAlphaByDistance},set:function(e){this._backFaceAlphaByDistance=qt.clone(e,this._backFaceAlphaByDistance)}},rectangle:{get:function(){return this._rectangle},set:function(e){l(e)||(e=ie.clone(ie.MAX_VALUE)),ie.clone(e,this._rectangle)}}});var Bj=Jve;var rte=class{constructor(t){this._ellipsoid=new tp(t.ellipsoid,h.ZERO)}get ellipsoid(){return this._ellipsoid}},kj=rte;var ote=class{constructor(t){this.maxSize=t,this.cache=new Map}get(t){if(!this.cache.has(t))return;let n=this.cache.get(t);return this.cache.delete(t),this.cache.set(t,n),n}set(t,n){if(this.cache.has(t))this.cache.delete(t);else if(this.cache.size>=this.maxSize){let i=this.cache.keys().next().value;this.cache.delete(i)}this.cache.set(t,n)}get size(){return this.cache.size}clear(){this.cache.clear()}},Pxt=1e3,ste=class e{constructor(t){this._tilingScheme=t.tilingScheme,this._x=t.x,this._y=t.y,this._level=t.level,this._parent=t.parent,this._rectangle=this._tilingScheme.tileXYToRectangle(this._x,this._y,this._level),this._southwestChild=void 0,this._southeastChild=void 0,this._northwestChild=void 0,this._northeastChild=void 0,this.replacementPrevious=void 0,this.replacementNext=void 0,this._distance=0,this._loadPriority=0,this._customData=new Set,this._customDataIterator=void 0,this._addedCustomData=[],this._removedCustomData=[],this._lastSelectionResult=gi.NONE,this._lastSelectionResultFrame=void 0,this._loadedCallbacks={},this._positionCache=new ote(Pxt),this.state=lc.START,this.renderable=!1,this.upsampledFromParent=!1,this.data=void 0}static createLevelZeroTiles(t){let n=t.getNumberOfXTilesAtLevel(0),i=t.getNumberOfYTilesAtLevel(0),r=new Array(n*i),o=0;for(let s=0;s<i;++s)for(let a=0;a<n;++a)r[o++]=new e({tilingScheme:t,x:a,y:s,level:0});return r}_getCacheKey(t,n){return Rxt(t.longitude,t.latitude,this._rectangle,n)}getPositionCacheEntry(t,n){return this._positionCache.get(this._getCacheKey(t,n))}setPositionCacheEntry(t,n,i){this._positionCache.set(this._getCacheKey(t,n),i)}clearPositionCache(){this._positionCache.size>0&&this._positionCache.clear()}updateCustomData(){let t=this._addedCustomData,n=this._removedCustomData;if(t.length===0&&n.length===0)return;let i=this.customData;for(let r=0;r<t.length;++r){let o=t[r];if(!l(o))continue;i.add(o);let s=Zve(this,o.positionCartographic);o._pendingAddTile=s,o._pendingAddIndex=s._addedCustomData.length,s._addedCustomData.push(o)}this._addedCustomData.length=0;for(let r=0;r<n.length;++r){let o=n[r];if(!l(o))continue;i.has(o)&&i.delete(o);let s=Zve(this,o.positionCartographic);if(o._pendingAddTile===s&&s._addedCustomData[o._pendingAddIndex]===o){s._addedCustomData[o._pendingAddIndex]=void 0,o._pendingAddTile=void 0;continue}s._removedCustomData.push(o)}this._removedCustomData.length=0}get tilingScheme(){return this._tilingScheme}get x(){return this._x}get y(){return this._y}get level(){return this._level}get parent(){return this._parent}get rectangle(){return this._rectangle}get children(){return[this.northwestChild,this.northeastChild,this.southwestChild,this.southeastChild]}get southwestChild(){return l(this._southwestChild)||(this._southwestChild=new e({tilingScheme:this.tilingScheme,x:this.x*2,y:this.y*2+1,level:this.level+1,parent:this})),this._southwestChild}get southeastChild(){return l(this._southeastChild)||(this._southeastChild=new e({tilingScheme:this.tilingScheme,x:this.x*2+1,y:this.y*2+1,level:this.level+1,parent:this})),this._southeastChild}get northwestChild(){return l(this._northwestChild)||(this._northwestChild=new e({tilingScheme:this.tilingScheme,x:this.x*2,y:this.y*2,level:this.level+1,parent:this})),this._northwestChild}get northeastChild(){return l(this._northeastChild)||(this._northeastChild=new e({tilingScheme:this.tilingScheme,x:this.x*2+1,y:this.y*2,level:this.level+1,parent:this})),this._northeastChild}get customData(){return this._customData}get needsLoading(){return this.state<lc.DONE}get eligibleForUnloading(){let t=!0;return l(this.data)&&(t=this.data.eligibleForUnloading,l(t)||(t=!0)),t}findLevelZeroTile(t,n,i){let r=this.tilingScheme.getNumberOfXTilesAtLevel(0);if(n<0?n+=r:n>=r&&(n-=r),!(i<0||i>=this.tilingScheme.getNumberOfYTilesAtLevel(0)))return t.filter(function(o){return o.x===n&&o.y===i})[0]}findTileToWest(t){let n=this.parent;if(n===void 0)return this.findLevelZeroTile(t,this.x-1,this.y);if(n.southeastChild===this)return n.southwestChild;if(n.northeastChild===this)return n.northwestChild;let i=n.findTileToWest(t);if(i!==void 0)return n.southwestChild===this?i.southeastChild:i.northeastChild}findTileToEast(t){let n=this.parent;if(n===void 0)return this.findLevelZeroTile(t,this.x+1,this.y);if(n.southwestChild===this)return n.southeastChild;if(n.northwestChild===this)return n.northeastChild;let i=n.findTileToEast(t);if(i!==void 0)return n.southeastChild===this?i.southwestChild:i.northwestChild}findTileToSouth(t){let n=this.parent;if(n===void 0)return this.findLevelZeroTile(t,this.x,this.y+1);if(n.northwestChild===this)return n.southwestChild;if(n.northeastChild===this)return n.southeastChild;let i=n.findTileToSouth(t);if(i!==void 0)return n.southwestChild===this?i.northwestChild:i.northeastChild}findTileToNorth(t){let n=this.parent;if(n===void 0)return this.findLevelZeroTile(t,this.x,this.y-1);if(n.southwestChild===this)return n.northwestChild;if(n.southeastChild===this)return n.northeastChild;let i=n.findTileToNorth(t);if(i!==void 0)return n.northwestChild===this?i.southwestChild:i.southeastChild}freeResources(){this.clearPositionCache(),this.state=lc.START,this.renderable=!1,this.upsampledFromParent=!1;let t=this.data;l(t)&&l(t.freeResources)&&t.freeResources(),Uj(this._southwestChild),this._southwestChild=void 0,Uj(this._southeastChild),this._southeastChild=void 0,Uj(this._northwestChild),this._northwestChild=void 0,Uj(this._northeastChild),this._northeastChild=void 0}},Dxt=256;function Rxt(e,t,n,i){let r=n.width/Dxt*i,o=Math.floor(e/r)*r,s=Math.floor(t/r)*r;return`${o.toFixed(10)},${s.toFixed(10)}`}var Oxt=new he;function Zve(e,t){let n=e.northwestChild.rectangle,i=ie.southeast(n,Oxt),r=t.longitude>=i.longitude?1:0;switch((t.latitude<i.latitude?1:0)*2+r){case 0:return e.northwestChild;case 1:return e.northeastChild;case 2:return e.southwestChild;default:return e.southeastChild}}function Uj(e){l(e)&&e.freeResources()}var zj=ste;function Vj(){this.head=void 0,this.tail=void 0,this.count=0,this._lastBeforeStartOfFrame=void 0}Vj.prototype.markStartOfRenderFrame=function(){this._lastBeforeStartOfFrame=this.head};Vj.prototype.trimTiles=function(e){let t=this.tail,n=!0;for(;n&&l(this._lastBeforeStartOfFrame)&&this.count>e&&l(t);){n=t!==this._lastBeforeStartOfFrame;let i=t.replacementPrevious;t.eligibleForUnloading&&(t.freeResources(),Qve(this,t)),t=i}};function Qve(e,t){let n=t.replacementPrevious,i=t.replacementNext;t===e._lastBeforeStartOfFrame&&(e._lastBeforeStartOfFrame=i),t===e.head?e.head=i:n.replacementNext=i,t===e.tail?e.tail=n:i.replacementPrevious=n,t.replacementPrevious=void 0,t.replacementNext=void 0,--e.count}Vj.prototype.markTileRendered=function(e){let t=this.head;if(t===e){e===this._lastBeforeStartOfFrame&&(this._lastBeforeStartOfFrame=e.replacementNext);return}if(++this.count,!l(t)){e.replacementPrevious=void 0,e.replacementNext=void 0,this.head=e,this.tail=e;return}(l(e.replacementPrevious)||l(e.replacementNext))&&Qve(this,e),e.replacementPrevious=void 0,e.replacementNext=t,t.replacementPrevious=e,this.head=e};var jj=Vj;function Wd(e){this._tileProvider=e.tileProvider,this._tileProvider.quadtree=this,this._debug={enableDebugOutput:!1,maxDepth:0,maxDepthVisited:0,tilesVisited:0,tilesCulled:0,tilesRendered:0,tilesWaitingForChildren:0,lastMaxDepth:-1,lastMaxDepthVisited:-1,lastTilesVisited:-1,lastTilesCulled:-1,lastTilesRendered:-1,lastTilesWaitingForChildren:-1,suspendLodUpdate:!1};let n=this._tileProvider.tilingScheme.ellipsoid;this._tilesRenderedThisFrame=new Set,this._tilesToRender=[],this._tileLoadQueueHigh=[],this._tileLoadQueueMedium=[],this._tileLoadQueueLow=[],this._tileReplacementQueue=new jj,this._levelZeroTiles=void 0,this._loadQueueTimeSlice=5,this._tilesInvalidated=!1,this._addHeightCallbacks=[],this._removeHeightCallbacks=[],this._tileToUpdateHeights=[],this._updateHeightsTimeSlice=2,this._cameraPositionCartographic=void 0,this._cameraReferenceFrameOriginCartographic=void 0,this.maximumScreenSpaceError=e.maximumScreenSpaceError??2,this.tileCacheSize=e.tileCacheSize??100,this.loadingDescendantLimit=20,this.preloadAncestors=!0,this.preloadSiblings=!1,this._occluders=new kj({ellipsoid:n}),this._tileLoadProgressEvent=new be,this._lastTileLoadQueueLength=0,this._lastSelectionFrameNumber=void 0}Object.defineProperties(Wd.prototype,{tileProvider:{get:function(){return this._tileProvider}},tileLoadProgressEvent:{get:function(){return this._tileLoadProgressEvent}},occluders:{get:function(){return this._occluders}}});Wd.prototype.invalidateAllTiles=function(){this._tilesInvalidated=!0};function Mxt(e){let t=e._tileReplacementQueue;t.head=void 0,t.tail=void 0,t.count=0,tSe(e);let n=e._levelZeroTiles;if(l(n))for(let i=0;i<n.length;++i){let o=n[i].customData;for(let s of o)s.level=0,e._addHeightCallbacks.push(s);n[i].freeResources()}e._levelZeroTiles=void 0,e._tileProvider.cancelReprojections()}Wd.prototype.forEachLoadedTile=function(e){let t=this._tileReplacementQueue.head;for(;l(t);)t.state!==lc.START&&e(t),t=t.replacementNext};Wd.prototype.forEachRenderedTile=function(e){let t=this._tilesRenderedThisFrame;for(let n of t)e(n)};Wd.prototype.updateHeight=function(e,t){let n=this,i={positionOnEllipsoidSurface:void 0,positionCartographic:e,level:-1,callback:t};return i.removeFunc=function(){let r=n._addHeightCallbacks,o=r.length,s=!1;for(let a=0;a<o;++a)if(r[a]===i){r.splice(a,1),s=!0;break}s||n._removeHeightCallbacks.push(i),i.callback&&(i.callback=void 0)},n._addHeightCallbacks.push(i),i.removeFunc};Wd.prototype.update=function(e){l(this._tileProvider.update)&&this._tileProvider.update(e)};function tSe(e){let t=e._debug;t.maxDepth=0,t.maxDepthVisited=0,t.tilesVisited=0,t.tilesCulled=0,t.tilesRendered=0,t.tilesWaitingForChildren=0,e._tileLoadQueueHigh.length=0,e._tileLoadQueueMedium.length=0,e._tileLoadQueueLow.length=0}Wd.prototype.beginFrame=function(e){e.passes.render&&(this._tilesInvalidated&&(Mxt(this),this._tilesInvalidated=!1),this._tileProvider.initialize(e),tSe(this),!this._debug.suspendLodUpdate&&(this._tileReplacementQueue.markStartOfRenderFrame(),this._tilesRenderedThisFrame.clear()))};Wd.prototype.render=function(e){let t=e.passes,n=this._tileProvider;t.render&&(n.beginUpdate(e),Bxt(this,e),Yxt(this,e),n.endUpdate(e)),t.pick&&this._tilesToRender.length>0&&n.updateForPick(e)};function Nxt(e,t){let n=e._tileLoadQueueHigh.length+e._tileLoadQueueMedium.length+e._tileLoadQueueLow.length;if(n!==e._lastTileLoadQueueLength||e._tilesInvalidated){let r=be.prototype.raiseEvent.bind(e._tileLoadProgressEvent,n);t.afterRender.push(()=>(r(),!0)),e._lastTileLoadQueueLength=n}let i=e._debug;i.enableDebugOutput&&!i.suspendLodUpdate&&(i.maxDepth=e._tilesToRender.reduce(function(r,o){return Math.max(r,o.level)},-1),i.tilesRendered=e._tilesToRender.length,(i.tilesVisited!==i.lastTilesVisited||i.tilesRendered!==i.lastTilesRendered||i.tilesCulled!==i.lastTilesCulled||i.maxDepth!==i.lastMaxDepth||i.tilesWaitingForChildren!==i.lastTilesWaitingForChildren||i.maxDepthVisited!==i.lastMaxDepthVisited)&&(console.log(`Visited ${i.tilesVisited}, Rendered: ${i.tilesRendered}, Culled: ${i.tilesCulled}, Max Depth Rendered: ${i.maxDepth}, Max Depth Visited: ${i.maxDepthVisited}, Waiting for children: ${i.tilesWaitingForChildren}`),i.lastTilesVisited=i.tilesVisited,i.lastTilesRendered=i.tilesRendered,i.lastTilesCulled=i.tilesCulled,i.lastMaxDepth=i.maxDepth,i.lastTilesWaitingForChildren=i.tilesWaitingForChildren,i.lastMaxDepthVisited=i.maxDepthVisited))}Wd.prototype.endFrame=function(e){!e.passes.render||e.mode===re.MORPHING||(Hxt(this,e),qxt(this,e),Nxt(this,e))};Wd.prototype.isDestroyed=function(){return!1};Wd.prototype.destroy=function(){this._tileProvider=this._tileProvider&&this._tileProvider.destroy()};var CR,eSe=new he;function Lxt(e,t){let n=ie.center(e.rectangle,eSe),i=n.longitude-CR.longitude,r=n.latitude-CR.latitude;n=ie.center(t.rectangle,eSe);let o=n.longitude-CR.longitude,s=n.latitude-CR.latitude;return i*i+r*r-(o*o+s*s)}var Fxt=new h,ER=[];function Bxt(e,t){let n=e._debug;if(n.suspendLodUpdate)return;let i=e._tilesToRender;i.length=0;let r=e._tileProvider;if(!l(e._levelZeroTiles)){let d=r.tilingScheme;if(l(d)){let p=r.tilingScheme;e._levelZeroTiles=zj.createLevelZeroTiles(p);let g=e._levelZeroTiles.length;if(ER.length<g){ER=new Array(g);for(let m=0;m<g;++m)ER[m]===void 0&&(ER[m]=new vR)}}else return}e._occluders.ellipsoid.cameraPosition=t.camera.positionWC;let o=e._levelZeroTiles,s=o.length>1?e._occluders:void 0;CR=t.camera.positionCartographic,o.sort(Lxt);let a=e._addHeightCallbacks,c=e._removeHeightCallbacks;a.forEach(d=>{let p=o.find(g=>ie.contains(g.rectangle,d.positionCartographic));p&&p._addedCustomData.push(d)}),c.forEach(d=>{let p=o.find(g=>ie.contains(g.rectangle,d.positionCartographic));p&&p._removedCustomData.push(d)}),o.forEach(d=>d.updateCustomData()),a.length=0,c.length=0;let u=t.camera;e._cameraPositionCartographic=u.positionCartographic;let f=M.getTranslation(u.transform,Fxt);e._cameraReferenceFrameOriginCartographic=e.tileProvider.tilingScheme.ellipsoid.cartesianToCartographic(f,e._cameraReferenceFrameOriginCartographic);for(let d=0;d<o.length;++d){let p=o[d];e._tileReplacementQueue.markTileRendered(p),p.renderable?wc(e,p,r,t,s,!1,ER[d]):(zg(e,e._tileLoadQueueHigh,p,t),++n.tilesWaitingForChildren)}e._lastSelectionFrameNumber=t.frameNumber}function zg(e,t,n,i){n.needsLoading&&(e.tileProvider.computeTileLoadPriority!==void 0&&(n._loadPriority=e.tileProvider.computeTileLoadPriority(n,i)),t.push(n))}function vR(){this.allAreRenderable=!0,this.anyWereRenderedLastFrame=!1,this.notYetRenderableCount=0}function nSe(){this.southwest=new vR,this.southeast=new vR,this.northwest=new vR,this.northeast=new vR}nSe.prototype.combine=function(e){let t=this.southwest,n=this.southeast,i=this.northwest,r=this.northeast;e.allAreRenderable=t.allAreRenderable&&n.allAreRenderable&&i.allAreRenderable&&r.allAreRenderable,e.anyWereRenderedLastFrame=t.anyWereRenderedLastFrame||n.anyWereRenderedLastFrame||i.anyWereRenderedLastFrame||r.anyWereRenderedLastFrame,e.notYetRenderableCount=t.notYetRenderableCount+n.notYetRenderableCount+i.notYetRenderableCount+r.notYetRenderableCount};var cte=new Array(31);for(let e=0;e<cte.length;++e)cte[e]=new nSe;function kxt(e,t,n,i,r){let o=e._debug;++o.tilesVisited,e._tileReplacementQueue.markTileRendered(n),n.updateCustomData(),n.level>o.maxDepthVisited&&(o.maxDepthVisited=n.level);let s=Vxt(e,t,n)<e.maximumScreenSpaceError,a=n.southwestChild,c=n.southeastChild,u=n.northwestChild,f=n.northeastChild,d=e._lastSelectionFrameNumber,p=n._lastSelectionResultFrame===d?n._lastSelectionResult:gi.NONE,g=e.tileProvider;if(s||i){let m=gi.originalResult(p)===gi.RENDERED,y=gi.originalResult(p)===gi.CULLED||p===gi.NONE,A=n.state===lc.DONE,b=m||y||A;if(b||l(g.canRenderWithoutLosingDetail)&&(b=g.canRenderWithoutLosingDetail(n)),b){s&&zg(e,e._tileLoadQueueMedium,n,t),Hj(e,n),r.allAreRenderable=n.renderable,r.anyWereRenderedLastFrame=p===gi.RENDERED,r.notYetRenderableCount=n.renderable?0:1,n._lastSelectionResultFrame=t.frameNumber,n._lastSelectionResult=gi.RENDERED,r.anyWereRenderedLastFrame||e._tileToUpdateHeights.push(n);return}i=!0,s&&zg(e,e._tileLoadQueueHigh,n,t)}if(g.canRefine(n)){if(a.upsampledFromParent&&c.upsampledFromParent&&u.upsampledFromParent&&f.upsampledFromParent){Hj(e,n),zg(e,e._tileLoadQueueMedium,n,t),e._tileReplacementQueue.markTileRendered(a),e._tileReplacementQueue.markTileRendered(c),e._tileReplacementQueue.markTileRendered(u),e._tileReplacementQueue.markTileRendered(f),r.allAreRenderable=n.renderable,r.anyWereRenderedLastFrame=p===gi.RENDERED,r.notYetRenderableCount=n.renderable?0:1,n._lastSelectionResultFrame=t.frameNumber,n._lastSelectionResult=gi.RENDERED,r.anyWereRenderedLastFrame||e._tileToUpdateHeights.push(n);return}n._lastSelectionResultFrame=t.frameNumber,n._lastSelectionResult=gi.REFINED;let y=e._tilesToRender.length,A=e._tileLoadQueueLow.length,b=e._tileLoadQueueMedium.length,x=e._tileLoadQueueHigh.length,T=e._tileToUpdateHeights.length;if(Uxt(e,a,c,u,f,t,i,r),y!==e._tilesToRender.length){let E=r.allAreRenderable,v=r.anyWereRenderedLastFrame,S=r.notYetRenderableCount,I=!1;if(!E&&!v){let R=e._tilesToRender;for(let L=y;L<R.length;++L){let _=R[L];for(;_!==void 0&&_._lastSelectionResult!==gi.KICKED&&_!==n;)_._lastSelectionResult=gi.kick(_._lastSelectionResult),_=_.parent}e._tilesToRender.length=y,e._tileToUpdateHeights.length=T,Hj(e,n),n._lastSelectionResult=gi.RENDERED;let O=p===gi.RENDERED;!O&&S>e.loadingDescendantLimit&&(e._tileLoadQueueLow.length=A,e._tileLoadQueueMedium.length=b,e._tileLoadQueueHigh.length=x,zg(e,e._tileLoadQueueMedium,n,t),r.notYetRenderableCount=n.renderable?0:1,I=!0),r.allAreRenderable=n.renderable,r.anyWereRenderedLastFrame=O,O||e._tileToUpdateHeights.push(n),++o.tilesWaitingForChildren}e.preloadAncestors&&!I&&zg(e,e._tileLoadQueueLow,n,t)}return}n._lastSelectionResultFrame=t.frameNumber,n._lastSelectionResult=gi.RENDERED,Hj(e,n),zg(e,e._tileLoadQueueHigh,n,t),r.allAreRenderable=n.renderable,r.anyWereRenderedLastFrame=p===gi.RENDERED,r.notYetRenderableCount=n.renderable?0:1}function Uxt(e,t,n,i,r,o,s,a){let c=o.camera.positionCartographic,u=e._tileProvider,f=e._occluders,d=cte[t.level],p=d.southwest,g=d.southeast,m=d.northwest,y=d.northeast;c.longitude<t.rectangle.east?c.latitude<t.rectangle.north?(wc(e,t,u,o,f,s,p),wc(e,n,u,o,f,s,g),wc(e,i,u,o,f,s,m),wc(e,r,u,o,f,s,y)):(wc(e,i,u,o,f,s,m),wc(e,t,u,o,f,s,p),wc(e,r,u,o,f,s,y),wc(e,n,u,o,f,s,g)):c.latitude<t.rectangle.north?(wc(e,n,u,o,f,s,g),wc(e,t,u,o,f,s,p),wc(e,r,u,o,f,s,y),wc(e,i,u,o,f,s,m)):(wc(e,r,u,o,f,s,y),wc(e,i,u,o,f,s,m),wc(e,n,u,o,f,s,g),wc(e,t,u,o,f,s,p)),d.combine(a)}function zxt(e,t){let n=t.rectangle;return l(e._cameraPositionCartographic)&&ie.contains(n,e._cameraPositionCartographic)||l(e._cameraReferenceFrameOriginCartographic)&&ie.contains(n,e._cameraReferenceFrameOriginCartographic)}function wc(e,t,n,i,r,o,s){if(n.computeTileVisibility(t,i,r)!==ns.NONE)return kxt(e,i,t,o,s);if(++e._debug.tilesCulled,e._tileReplacementQueue.markTileRendered(t),s.allAreRenderable=!0,s.anyWereRenderedLastFrame=!1,s.notYetRenderableCount=0,zxt(e,t)){(!l(t.data)||!l(t.data.vertexArray))&&zg(e,e._tileLoadQueueMedium,t,i);let a=e._lastSelectionFrameNumber,c=t._lastSelectionResultFrame===a?t._lastSelectionResult:gi.NONE;c!==gi.CULLED_BUT_NEEDED&&c!==gi.RENDERED&&e._tileToUpdateHeights.push(t),t._lastSelectionResult=gi.CULLED_BUT_NEEDED}else e.preloadSiblings||t.level===0?(zg(e,e._tileLoadQueueLow,t,i),t._lastSelectionResult=gi.CULLED):t._lastSelectionResult=gi.CULLED;t._lastSelectionResultFrame=i.frameNumber}function Vxt(e,t,n){if(t.mode===re.SCENE2D||t.camera.frustum instanceof _n||t.camera.frustum instanceof Ss)return jxt(e,t,n);let i=e._tileProvider.getLevelMaximumGeometricError(n.level),r=n._distance,o=t.context.drawingBufferHeight,s=t.camera.frustum.sseDenominator,a=i*o/(r*s);return t.fog.enabled&&(a-=P.fog(r,t.fog.density)*t.fog.sse),a/=t.pixelRatio,a}function jxt(e,t,n){let r=t.camera.frustum,o=r.offCenterFrustum;l(o)&&(r=o);let s=t.context,a=s.drawingBufferWidth,c=s.drawingBufferHeight,u=e._tileProvider.getLevelMaximumGeometricError(n.level),f=Math.max(r.top-r.bottom,r.right-r.left)/Math.max(a,c),d=u/f;return t.fog.enabled&&t.mode!==re.SCENE2D&&(d-=P.fog(n._distance,t.fog.density)*t.fog.sse),d/=t.pixelRatio,d}function Hj(e,t){e._tilesToRender.push(t),e._tilesRenderedThisFrame.add(t)}function Hxt(e,t){let n=e._tileLoadQueueHigh,i=e._tileLoadQueueMedium,r=e._tileLoadQueueLow;if(n.length===0&&i.length===0&&r.length===0)return;e._tileReplacementQueue.trimTiles(e.tileCacheSize);let o=xn()+e._loadQueueTimeSlice,s=e._tileProvider,a=ate(e,t,s,o,n,!1);a=ate(e,t,s,o,i,a),ate(e,t,s,o,r,a)}function Gxt(e,t){return e._loadPriority-t._loadPriority}function ate(e,t,n,i,r,o){n.computeTileLoadPriority!==void 0&&r.sort(Gxt);for(let s=0,a=r.length;s<a&&(xn()<i||!o);++s){let c=r[s];e._tileReplacementQueue.markTileRendered(c),n.loadTile(t,c),o=!0}return o}var YS=new gn,Gj=new he,hA=new h,Wxt=[];function qxt(e,t){if(!l(e.tileProvider.tilingScheme))return;let n=Wxt;n.length=0;let i=e._tileToUpdateHeights,r=xn(),o=e._updateHeightsTimeSlice,s=r+o,a=t.mode,c=t.mapProjection,u=e.tileProvider.tilingScheme.ellipsoid,f;for(;i.length>0;){let d=i[0];if(!l(d.data)||!l(d.data.mesh)){let A=d._lastSelectionResultFrame===e._lastSelectionFrameNumber?d._lastSelectionResult:gi.NONE;(A===gi.RENDERED||A===gi.CULLED_BUT_NEEDED)&&n.push(d),d.clearPositionCache(),i.shift();continue}let p=d.customData;l(d._customDataIterator)||(d._customDataIterator=p.values());let g=d._customDataIterator,m=!1,y;for(;!(y=g.next()).done;){let A=y.value,b=d.data.terrainData,x=l(b)&&b.wasCreatedByUpsampling();if(d.level>A.level&&!x){let T,E=d.getPositionCacheEntry(A.positionCartographic,e.maximumScreenSpaceError);if(l(E))T=E;else{if(l(A.positionOnEllipsoidSurface)||(A.positionOnEllipsoidSurface=h.fromRadians(A.positionCartographic.longitude,A.positionCartographic.latitude,0,u)),a===re.SCENE3D){let v=u.geodeticSurfaceNormal(A.positionOnEllipsoidSurface,YS.direction),S=u.getSurfaceNormalIntersectionWithZAxis(A.positionOnEllipsoidSurface,11500,YS.origin);if(!l(S)){let I=0;l(d.data.tileBoundingRegion)&&(I=d.data.tileBoundingRegion.minimumHeight);let R=Math.min(I,-11500),O=h.multiplyByScalar(v,Math.abs(R)+1,hA);h.subtract(A.positionOnEllipsoidSurface,O,YS.origin)}}else he.clone(A.positionCartographic,Gj),Gj.height=-11500,c.project(Gj,hA),h.fromElements(hA.z,hA.x,hA.y,hA),h.clone(hA,YS.origin),h.clone(h.UNIT_X,YS.direction);T=d.data.pick(YS,a,c,!1,hA),l(T)&&d.setPositionCacheEntry(A.positionCartographic,e.maximumScreenSpaceError,h.clone(T))}if(l(T)){if(l(A.callback)){let v=u.cartesianToCartographic(T,Gj);A.callback(v)}A.level=d.level}}if(xn()>=s){m=!0;break}}if(m){d._customDataIterator=g;break}else d._customDataIterator=void 0,i.shift()}for(f=0;f<n.length;f++)i.push(n[f])}function Yxt(e,t){let n=e._tileProvider,i=e._tilesToRender;for(let r=0,o=i.length;r<o;++r){let s=i[r];n.showTileThisFrame(s,t)}}var Wj=Wd;function am(e){e=e??ee.default;let t=new Ug({ellipsoid:e}),n=new LS,i=new $y({tilingScheme:t.tilingScheme});this._ellipsoid=e,this._imageryLayerCollection=n,this._surfaceShaderSet=new vj,this._material=void 0,this._surface=new Wj({tileProvider:new Fj({terrainProvider:t,imageryLayers:n,surfaceShaderSet:this._surfaceShaderSet,vectorProvider:i})}),this._terrainProvider=t,this._terrainProviderChanged=new be,this._vectorProvider=i,this._undergroundColor=z.clone(z.BLACK),this._undergroundColorAlphaByDistance=new qt(e.maximumRadius/1e3,0,e.maximumRadius/5,1),this._translucency=new Bj,ute(this),this.show=!0,this._oceanNormalMapResourceDirty=!0,this._oceanNormalMapResource=new De({url:Zt("Assets/Textures/waterNormalsSmall.jpg")}),this.maximumScreenSpaceError=2,this.tileCacheSize=100,this.loadingDescendantLimit=20,this.preloadAncestors=!0,this.preloadSiblings=!1,this.fillHighlightColor=void 0,this.enableLighting=!1,this.lambertDiffuseMultiplier=.9,this.dynamicAtmosphereLighting=!0,this.dynamicAtmosphereLightingFromSun=!1,this.showGroundAtmosphere=ee.WGS84.equals(e),this.atmosphereLightIntensity=10,this.atmosphereRayleighCoefficient=new h(55e-7,13e-6,284e-7),this.atmosphereMieCoefficient=new h(21e-6,21e-6,21e-6),this.atmosphereRayleighScaleHeight=1e4,this.atmosphereMieScaleHeight=3200,this.atmosphereMieAnisotropy=.9,this.lightingFadeOutDistance=P.PI_OVER_TWO*e.minimumRadius,this.lightingFadeInDistance=P.PI*e.minimumRadius,this.nightFadeOutDistance=P.PI_OVER_TWO*e.minimumRadius,this.nightFadeInDistance=5*P.PI_OVER_TWO*e.minimumRadius,this.showWaterEffect=!0,this.depthTestAgainstTerrain=!1,this.shadows=Pn.RECEIVE_ONLY,this.atmosphereHueShift=0,this.atmosphereSaturationShift=0,this.atmosphereBrightnessShift=0,this.showSkirts=!0,this.backFaceCulling=!0,this._oceanNormalMap=void 0,this._zoomedOutOceanSpecularIntensity=void 0,this.vertexShadowDarkness=.3}Object.defineProperties(am.prototype,{ellipsoid:{get:function(){return this._ellipsoid}},imageryLayers:{get:function(){return this._imageryLayerCollection}},imageryLayersUpdatedEvent:{get:function(){return this._surface.tileProvider.imageryLayersUpdatedEvent}},tilesLoaded:{get:function(){return l(this._surface)?this._surface._tileLoadQueueHigh.length===0&&this._surface._tileLoadQueueMedium.length===0&&this._surface._tileLoadQueueLow.length===0:!0}},baseColor:{get:function(){return this._surface.tileProvider.baseColor},set:function(e){this._surface.tileProvider.baseColor=e}},clippingPlanes:{get:function(){return this._surface.tileProvider.clippingPlanes},set:function(e){this._surface.tileProvider.clippingPlanes=e}},clippingPolygons:{get:function(){return this._surface.tileProvider.clippingPolygons},set:function(e){this._surface.tileProvider.clippingPolygons=e}},cartographicLimitRectangle:{get:function(){return this._surface.tileProvider.cartographicLimitRectangle},set:function(e){l(e)||(e=ie.clone(ie.MAX_VALUE)),this._surface.tileProvider.cartographicLimitRectangle=e}},oceanNormalMapUrl:{get:function(){return this._oceanNormalMapResource.url},set:function(e){this._oceanNormalMapResource.url=e,this._oceanNormalMapResourceDirty=!0}},terrainProvider:{get:function(){return this._terrainProvider},set:function(e){e!==this._terrainProvider&&(this._terrainProvider=e,l(e)&&(this._vectorProvider.tilingScheme=e.tilingScheme),this._terrainProviderChanged.raiseEvent(e),l(this._material)&&ute(this))}},terrainProviderChanged:{get:function(){return this._terrainProviderChanged}},vectorProvider:{get:function(){return this._vectorProvider}},tileLoadProgressEvent:{get:function(){return this._surface.tileLoadProgressEvent}},material:{get:function(){return this._material},set:function(e){this._material!==e&&(this._material=e,ute(this))}},undergroundColor:{get:function(){return this._undergroundColor},set:function(e){this._undergroundColor=z.clone(e,this._undergroundColor)}},undergroundColorAlphaByDistance:{get:function(){return this._undergroundColorAlphaByDistance},set:function(e){this._undergroundColorAlphaByDistance=qt.clone(e,this._undergroundColorAlphaByDistance)}},translucency:{get:function(){return this._translucency}}});function ute(e){let t=[],n=l(e._material)&&(l(e._material.shaderSource.match(/slope/))||l(e._material.shaderSource.match("normalEC"))),i=[Xm,hP];l(e._material)&&(!n||e._terrainProvider.hasVertexNormals)?(i.push(e._material.shaderSource),t.push("APPLY_MATERIAL"),e._surface._tileProvider.materialUniformMap=e._material._uniforms):e._surface._tileProvider.materialUniformMap=void 0,i.push(F2),e._surfaceShaderSet.baseVertexShaderSource=new Xe({sources:[Xm,hP,B2],defines:t}),e._surfaceShaderSet.baseFragmentShaderSource=new Xe({sources:i,defines:t}),e._surfaceShaderSet.material=e._material}function Xxt(e){return function(t,n){let i=ue.distanceSquaredTo(t.pickBoundingSphere,e),r=ue.distanceSquaredTo(n.pickBoundingSphere,e);return i-r}}var Kxt=[],$xt={start:0,stop:0};am.prototype.pickWorldCoordinates=function(e,t,n,i){n=n??!0;let r=t.mode,o=t.mapProjection,s=Kxt;s.length=0;for(let u of this._surface._tilesRenderedThisFrame){let f=u.data;if(!l(f))continue;let d=f.pickBoundingSphere;if(r!==re.SCENE3D)f.pickBoundingSphere=d=ue.fromRectangleWithHeights2D(u.rectangle,o,f.tileBoundingRegion.minimumHeight,f.tileBoundingRegion.maximumHeight,d),h.fromElements(d.center.z,d.center.x,d.center.y,d.center);else if(l(f.renderedMesh))ue.clone(f.tileBoundingRegion.boundingSphere,d);else continue;let p=xi.raySphere(e,d,$xt);l(p)&&s.push(f)}s.sort(Xxt(e.origin));let a,c=s.length;for(let u=0;u<c&&(a=s[u].pick(e,t.mode,t.mapProjection,n,i),!l(a));++u);return a};var Jxt=new he;am.prototype.pick=function(e,t,n){if(n=this.pickWorldCoordinates(e,t,!0,n),l(n)&&t.mode!==re.SCENE3D){n=h.fromElements(n.y,n.z,n.x,n);let i=t.mapProjection.unproject(n,Jxt);n=this._ellipsoid.cartographicToCartesian(i,n)}return n};var Zxt=new h,iSe=new h,Qxt=new he,eTt=new gn;function lte(e,t){return l(e)&&ie.contains(e.rectangle,t)?e:void 0}am.prototype.getHeight=function(e){let t=this._surface._levelZeroTiles;if(!l(t))return;let n,i,r=t.length;for(i=0;i<r&&(n=t[i],!ie.contains(n.rectangle,e));++i);if(i>=r)return;let o=n;for(;l(n);)n=lte(n._southwestChild,e)||lte(n._southeastChild,e)||lte(n._northwestChild,e)||n._northeastChild,l(n)&&l(n.data)&&l(n.data.renderedMesh)&&(o=n);if(n=o,!l(n)||!l(n.data)||!l(n.data.renderedMesh))return;let s=this._surface._tileProvider.tilingScheme.projection,a=this._surface._tileProvider.tilingScheme.ellipsoid,c=h.fromRadians(e.longitude,e.latitude,0,a,Zxt),u=eTt,f=a.geodeticSurfaceNormal(c,u.direction),d=a.getSurfaceNormalIntersectionWithZAxis(c,11500,u.origin);if(!l(d)){let g;l(n.data.tileBoundingRegion)&&(g=n.data.tileBoundingRegion.minimumHeight);let m=Math.min(g??0,-11500),y=h.multiplyByScalar(f,Math.abs(m)+1,iSe);h.subtract(c,y,u.origin)}let p=n.data.pick(u,re.SCENE3D,s,!1,iSe);if(l(p))return a.cartesianToCartographic(p,Qxt).height};am.prototype.update=function(e){this.show&&e.passes.render&&this._surface.update(e)};am.prototype.beginFrame=function(e){let t=this._surface,n=t.tileProvider,i=this.terrainProvider,r=l(i)&&i.hasWaterMask&&i.hasWaterMask;if(r&&this._oceanNormalMapResourceDirty){this._oceanNormalMapResourceDirty=!1;let a=this._oceanNormalMapResource,c=a.url;if(l(c)){let u=this;a.fetchImage().then(function(f){c===u._oceanNormalMapResource.url&&(u._oceanNormalMap=u._oceanNormalMap&&u._oceanNormalMap.destroy(),u._oceanNormalMap=new Dt({context:e.context,source:f}))})}else this._oceanNormalMap=this._oceanNormalMap&&this._oceanNormalMap.destroy()}let o=e.passes,s=e.mode;o.render&&(this.showGroundAtmosphere?this._zoomedOutOceanSpecularIntensity=.4:this._zoomedOutOceanSpecularIntensity=.5,t.maximumScreenSpaceError=this.maximumScreenSpaceError,t.tileCacheSize=this.tileCacheSize,t.loadingDescendantLimit=this.loadingDescendantLimit,t.preloadAncestors=this.preloadAncestors,t.preloadSiblings=this.preloadSiblings,n.terrainProvider=this.terrainProvider,n.lightingFadeOutDistance=this.lightingFadeOutDistance,n.lightingFadeInDistance=this.lightingFadeInDistance,n.nightFadeOutDistance=this.nightFadeOutDistance,n.nightFadeInDistance=this.nightFadeInDistance,n.zoomedOutOceanSpecularIntensity=s===re.SCENE3D?this._zoomedOutOceanSpecularIntensity:0,n.hasWaterMask=r,n.showWaterEffect=this.showWaterEffect,n.oceanNormalMap=this._oceanNormalMap,n.enableLighting=this.enableLighting,n.dynamicAtmosphereLighting=this.dynamicAtmosphereLighting,n.dynamicAtmosphereLightingFromSun=this.dynamicAtmosphereLightingFromSun,n.showGroundAtmosphere=this.showGroundAtmosphere,n.atmosphereLightIntensity=this.atmosphereLightIntensity,n.atmosphereRayleighCoefficient=this.atmosphereRayleighCoefficient,n.atmosphereMieCoefficient=this.atmosphereMieCoefficient,n.atmosphereRayleighScaleHeight=this.atmosphereRayleighScaleHeight,n.atmosphereMieScaleHeight=this.atmosphereMieScaleHeight,n.atmosphereMieAnisotropy=this.atmosphereMieAnisotropy,n.shadows=this.shadows,n.hueShift=this.atmosphereHueShift,n.saturationShift=this.atmosphereSaturationShift,n.brightnessShift=this.atmosphereBrightnessShift,n.fillHighlightColor=this.fillHighlightColor,n.showSkirts=this.showSkirts,n.backFaceCulling=this.backFaceCulling,n.vertexShadowDarkness=this.vertexShadowDarkness,n.undergroundColor=this._undergroundColor,n.undergroundColorAlphaByDistance=this._undergroundColorAlphaByDistance,n.lambertDiffuseMultiplier=this.lambertDiffuseMultiplier,t.beginFrame(e))};am.prototype.render=function(e){this.show&&(l(this._material)&&this._material.update(e.context),this._surface.render(e))};am.prototype.endFrame=function(e){this.show&&e.passes.render&&this._surface.endFrame(e)};am.prototype.isDestroyed=function(){return!1};am.prototype.destroy=function(){return this._surfaceShaderSet=this._surfaceShaderSet&&this._surfaceShaderSet.destroy(),this._surface=this._surface&&this._surface.destroy(),this._oceanNormalMap=this._oceanNormalMap&&this._oceanNormalMap.destroy(),le(this)};var qj=am;function tTt(e,t,n,i){this.rightAscension=e,this.declination=t,this.rotation=n,this.rotationRate=i}var Yj=tTt;var _Se={},nTt=32.184,iTt=2451545,rSe=-.0529921,oSe=-.1059842,sSe=13.0120009,aSe=13.3407154,cSe=.9856003,lSe=26.4057084,uSe=13.064993,fSe=.3287146,dSe=1.7484877,hSe=-.1589763,mSe=.0036096,pSe=.1643573,gSe=12.9590088,fte=new K;_Se.ComputeMoon=function(e,t){l(e)||(e=K.now()),fte=K.addSeconds(e,nTt,fte);let n=K.totalDays(fte)-iTt,i=n/Un.DAYS_PER_JULIAN_CENTURY,r=(125.045+rSe*n)*P.RADIANS_PER_DEGREE,o=(250.089+oSe*n)*P.RADIANS_PER_DEGREE,s=(260.008+sSe*n)*P.RADIANS_PER_DEGREE,a=(176.625+aSe*n)*P.RADIANS_PER_DEGREE,c=(357.529+cSe*n)*P.RADIANS_PER_DEGREE,u=(311.589+lSe*n)*P.RADIANS_PER_DEGREE,f=(134.963+uSe*n)*P.RADIANS_PER_DEGREE,d=(276.617+fSe*n)*P.RADIANS_PER_DEGREE,p=(34.226+dSe*n)*P.RADIANS_PER_DEGREE,g=(15.134+hSe*n)*P.RADIANS_PER_DEGREE,m=(119.743+mSe*n)*P.RADIANS_PER_DEGREE,y=(239.961+pSe*n)*P.RADIANS_PER_DEGREE,A=(25.053+gSe*n)*P.RADIANS_PER_DEGREE,b=Math.sin(r),x=Math.sin(o),T=Math.sin(s),E=Math.sin(a),v=Math.sin(c),S=Math.sin(u),I=Math.sin(f),R=Math.sin(d),O=Math.sin(p),L=Math.sin(g),_=Math.sin(m),C=Math.sin(y),w=Math.sin(A),D=Math.cos(r),N=Math.cos(o),F=Math.cos(s),V=Math.cos(a),B=Math.cos(c),j=Math.cos(u),k=Math.cos(f),G=Math.cos(d),q=Math.cos(p),Q=Math.cos(g),W=Math.cos(m),J=Math.cos(y),Z=Math.cos(A),ae=(269.9949+.0031*i-3.8787*b-.1204*x+.07*T-.0172*E+.0072*S-.0052*L+.0043*w)*P.RADIANS_PER_DEGREE,Ae=(66.5392+.013*i+1.5419*D+.0239*N-.0278*F+.0068*V-.0029*j+9e-4*k+8e-4*Q-9e-4*Z)*P.RADIANS_PER_DEGREE,fe=(38.3213+13.17635815*n-14e-13*n*n+3.561*b+.1208*x-.0642*T+.0158*E+.0252*v-.0066*S-.0047*I-.0046*R+.0028*O+.0052*L+.004*_+.0019*C-.0044*w)*P.RADIANS_PER_DEGREE,xe=(13.17635815-14e-13*(2*n)+3.561*D*rSe+.1208*N*oSe-.0642*F*sSe+.0158*V*aSe+.0252*B*cSe-.0066*j*lSe-.0047*k*uSe-.0046*G*fSe+.0028*q*dSe+.0052*Q*hSe+.004*W*mSe+.0019*J*pSe-.0044*Z*gSe)/86400*P.RADIANS_PER_DEGREE;return l(t)||(t=new Yj),t.rightAscension=ae,t.declination=Ae,t.rotation=fe,t.rotationRate=xe,t};var Xj=_Se;function ySe(e){(!l(e)||typeof e!="function")&&(e=Xj.ComputeMoon),this._computeFunction=e}var rTt=new h,oTt=new h,sTt=new h;function aTt(e,t,n){let i=rTt;i.x=Math.cos(e+P.PI_OVER_TWO),i.y=Math.sin(e+P.PI_OVER_TWO),i.z=0;let r=Math.cos(t),o=sTt;o.x=r*Math.cos(e),o.y=r*Math.sin(e),o.z=Math.sin(t);let s=h.cross(o,i,oTt);return l(n)||(n=new $),n[0]=i.x,n[1]=s.x,n[2]=o.x,n[3]=i.y,n[4]=s.y,n[5]=o.y,n[6]=i.z,n[7]=s.z,n[8]=o.z,n}var cTt=new $,lTt=new Le;ySe.prototype.evaluate=function(e,t){l(e)||(e=K.now());let n=this._computeFunction(e),i=aTt(n.rightAscension,n.declination,t),r=P.zeroToTwoPi(n.rotation),o=Le.fromAxisAngle(h.UNIT_Z,r,lTt),s=$.fromQuaternion(Le.conjugate(o,o),cTt);return $.multiply(s,i,i)};var Kj=ySe;var dte={position:0};function $j(e){e=e??H.EMPTY_OBJECT,this.center=h.clone(e.center??h.ZERO),this._center=new h,this.radii=h.clone(e.radii),this._radii=new h,this._oneOverEllipsoidRadiiSquared=new h,this._boundingSphere=new ue,this.modelMatrix=M.clone(e.modelMatrix??M.IDENTITY),this._modelMatrix=new M,this._computedModelMatrix=new M,this.show=e.show??!0,this.material=e.material??rr.fromType(rr.ColorType),this._material=void 0,this._translucent=void 0,this.id=e.id,this._id=void 0,this.debugShowBoundingVolume=e.debugShowBoundingVolume??!1,this.onlySunLighting=e.onlySunLighting??!1,this._onlySunLighting=!1,this._depthTestEnabled=e.depthTestEnabled??!0,this._useLogDepth=!1,this._sp=void 0,this._rs=void 0,this._va=void 0,this._pickSP=void 0,this._pickId=void 0,this._colorCommand=new at({owner:e._owner??this}),this._pickCommand=new at({owner:e._owner??this,pickOnly:!0});let t=this;this._uniforms={u_radii:function(){return t.radii},u_oneOverEllipsoidRadiiSquared:function(){return t._oneOverEllipsoidRadiiSquared}},this._pickUniforms={czm_pickColor:function(){return t._pickId.color}}}function uTt(e){let t=e.cache.ellipsoidPrimitive_vertexArray;if(l(t))return t;let n=zc.createGeometry(zc.fromDimensions({dimensions:new h(2,2,2),vertexFormat:Be.POSITION_ONLY}));return t=Vn.fromGeometry({context:e,geometry:n,attributeLocations:dte,bufferUsage:Me.STATIC_DRAW,interleave:!0}),e.cache.ellipsoidPrimitive_vertexArray=t,t}$j.prototype.update=function(e){if(!this.show||e.mode!==re.SCENE3D||!l(this.center)||!l(this.radii))return;let t=e.context,n=this.material.isTranslucent(),i=this._translucent!==n;(!l(this._rs)||i)&&(this._translucent=n,this._rs=Ge.fromCache({cull:{enabled:!0,face:Hi.FRONT},depthTest:{enabled:this._depthTestEnabled},depthMask:!n&&t.fragmentDepth,blending:n?nn.ALPHA_BLEND:void 0})),l(this._va)||(this._va=uTt(t));let r=!1,o=this.radii;if(!h.equals(this._radii,o)){h.clone(o,this._radii);let y=this._oneOverEllipsoidRadiiSquared;y.x=1/(o.x*o.x),y.y=1/(o.y*o.y),y.z=1/(o.z*o.z),r=!0}(!M.equals(this.modelMatrix,this._modelMatrix)||!h.equals(this.center,this._center))&&(M.clone(this.modelMatrix,this._modelMatrix),h.clone(this.center,this._center),M.multiplyByTranslation(this.modelMatrix,this.center,this._computedModelMatrix),r=!0),r&&(h.clone(h.ZERO,this._boundingSphere.center),this._boundingSphere.radius=h.maximumComponent(o),ue.transform(this._boundingSphere,this._computedModelMatrix,this._boundingSphere));let s=this._material!==this.material;this._material=this.material,this._material.update(t);let a=this.onlySunLighting!==this._onlySunLighting;this._onlySunLighting=this.onlySunLighting;let c=e.useLogDepth,u=this._useLogDepth!==c;this._useLogDepth=c;let f=this._colorCommand,d,p;(s||a||i||u)&&(d=new Xe({sources:[dP]}),p=new Xe({sources:[this.material.shaderSource,fP]}),this.onlySunLighting&&p.defines.push("ONLY_SUN_LIGHTING"),!n&&t.fragmentDepth&&p.defines.push("WRITE_DEPTH"),this._useLogDepth&&(d.defines.push("LOG_DEPTH"),p.defines.push("LOG_DEPTH")),this._sp=Qt.replaceCache({context:t,shaderProgram:this._sp,vertexShaderSource:d,fragmentShaderSource:p,attributeLocations:dte}),f.vertexArray=this._va,f.renderState=this._rs,f.shaderProgram=this._sp,f.uniformMap=Mt(this._uniforms,this.material._uniforms),f.executeInClosestFrustum=n);let g=e.commandList,m=e.passes;if(m.render&&(f.boundingVolume=this._boundingSphere,f.debugShowBoundingVolume=this.debugShowBoundingVolume,f.modelMatrix=this._computedModelMatrix,f.pass=n?Ie.TRANSLUCENT:Ie.OPAQUE,g.push(f)),m.pick){let y=this._pickCommand;(!l(this._pickId)||this._id!==this.id)&&(this._id=this.id,this._pickId=this._pickId&&this._pickId.destroy(),this._pickId=t.createPickId({primitive:this,id:this.id})),(s||a||!l(this._pickSP)||u)&&(d=new Xe({sources:[dP]}),p=new Xe({sources:[this.material.shaderSource,fP],pickColorQualifier:"uniform"}),this.onlySunLighting&&p.defines.push("ONLY_SUN_LIGHTING"),!n&&t.fragmentDepth&&p.defines.push("WRITE_DEPTH"),this._useLogDepth&&(d.defines.push("LOG_DEPTH"),p.defines.push("LOG_DEPTH")),this._pickSP=Qt.replaceCache({context:t,shaderProgram:this._pickSP,vertexShaderSource:d,fragmentShaderSource:p,attributeLocations:dte}),y.vertexArray=this._va,y.renderState=this._rs,y.shaderProgram=this._pickSP,y.uniformMap=Mt(Mt(this._uniforms,this._pickUniforms),this.material._uniforms),y.executeInClosestFrustum=n),y.boundingVolume=this._boundingSphere,y.modelMatrix=this._computedModelMatrix,y.pass=n?Ie.TRANSLUCENT:Ie.OPAQUE,g.push(y)}};$j.prototype.isDestroyed=function(){return!1};$j.prototype.destroy=function(){return this._sp=this._sp&&this._sp.destroy(),this._pickSP=this._pickSP&&this._pickSP.destroy(),this._pickId=this._pickId&&this._pickId.destroy(),le(this)};var Jj=$j;function SR(e){e=e??H.EMPTY_OBJECT;let t=e.textureUrl;l(t)||(t=Zt("Assets/Textures/moonSmall.jpg")),this.show=e.show??!0,this.textureUrl=t,this._ellipsoid=e.ellipsoid??ee.MOON,this.onlySunLighting=e.onlySunLighting??!0,this._ellipsoidPrimitive=new Jj({radii:this.ellipsoid.radii,material:rr.fromType(rr.ImageType),depthTestEnabled:!1,_owner:this}),this._ellipsoidPrimitive.material.translucent=!1,this._axes=new Kj}Object.defineProperties(SR.prototype,{ellipsoid:{get:function(){return this._ellipsoid}}});var Zj=new $,fTt=new $,dTt=new h,Qj=[];SR.prototype.update=function(e){if(!this.show)return;let t=this._ellipsoidPrimitive;t.material.uniforms.image=this.textureUrl,t.onlySunLighting=this.onlySunLighting;let n=e.time;l(At.computeIcrfToFixedMatrix(n,Zj))||At.computeTemeToPseudoFixedMatrix(n,Zj);let i=this._axes.evaluate(n,fTt);$.transpose(i,i),$.multiply(Zj,i,i);let r=Pb.computeMoonPositionInEarthInertialFrame(n,dTt);$.multiplyByVector(Zj,r,r),M.fromRotationTranslation(i,r,t.modelMatrix);let o=e.commandList;return e.commandList=Qj,Qj.length=0,t.update(e),e.commandList=o,Qj.length===1?Qj[0]:void 0};SR.prototype.isDestroyed=function(){return!1};SR.prototype.destroy=function(){return this._ellipsoidPrimitive=this._ellipsoidPrimitive&&this._ellipsoidPrimitive.destroy(),le(this)};var e6=SR;var hte=[],mte=[];function hTt(e,t,n,i,r,o){let s=r-i+1,a=o-r,c=hte,u=mte,f,d;for(f=0;f<s;++f)c[f]=e[i+f];for(d=0;d<a;++d)u[d]=e[r+d+1];f=0,d=0;for(let p=i;p<=o;++p){let g=c[f],m=u[d];f<s&&(d>=a||t(g,m,n)<=0)?(e[p]=g,++f):d<a&&(e[p]=m,++d)}}function pte(e,t,n,i,r){if(i>=r)return;let o=Math.floor((i+r)*.5);pte(e,t,n,i,o),pte(e,t,n,o+1,r),hTt(e,t,n,i,o,r)}function mTt(e,t,n){let i=e.length,r=Math.ceil(i*.5);hte.length=r,mte.length=r,pte(e,t,n,0,i-1),hte.length=0,mte.length=0}var Vg=mTt;function al(e,t){this._occluderPosition=h.clone(e.center),this._occluderRadius=e.radius,this._horizonDistance=0,this._horizonPlaneNormal=void 0,this._horizonPlanePosition=void 0,this._cameraPosition=void 0,this.cameraPosition=t}var t6=new h;Object.defineProperties(al.prototype,{position:{get:function(){return this._occluderPosition}},radius:{get:function(){return this._occluderRadius}},cameraPosition:{set:function(e){e=h.clone(e,this._cameraPosition);let t=h.subtract(this._occluderPosition,e,t6),n=h.magnitudeSquared(t),i=this._occluderRadius*this._occluderRadius,r,o,s;if(n>i){r=Math.sqrt(n-i),n=1/Math.sqrt(n),o=h.multiplyByScalar(t,n,t6);let a=r*r*n;s=h.add(e,h.multiplyByScalar(o,a,t6),t6)}else r=Number.MAX_VALUE;this._horizonDistance=r,this._horizonPlaneNormal=o,this._horizonPlanePosition=s,this._cameraPosition=e}}});al.fromBoundingSphere=function(e,t,n){return l(n)?(h.clone(e.center,n._occluderPosition),n._occluderRadius=e.radius,n.cameraPosition=t,n):new al(e,t)};var bSe=new h;al.prototype.isPointVisible=function(e){if(this._horizonDistance!==Number.MAX_VALUE){let t=h.subtract(e,this._occluderPosition,bSe),n=this._occluderRadius;if(n=h.magnitudeSquared(t)-n*n,n>0)return n=Math.sqrt(n)+this._horizonDistance,t=h.subtract(e,this._cameraPosition,t),n*n>h.magnitudeSquared(t)}return!1};var pTt=new h;al.prototype.isBoundingSphereVisible=function(e){let t=h.clone(e.center,pTt),n=e.radius;if(this._horizonDistance!==Number.MAX_VALUE){let i=h.subtract(t,this._occluderPosition,bSe),r=this._occluderRadius-n;if(r=h.magnitudeSquared(i)-r*r,n<this._occluderRadius)return r>0?(r=Math.sqrt(r)+this._horizonDistance,i=h.subtract(t,this._cameraPosition,i),r*r+n*n>h.magnitudeSquared(i)):!1;if(r>0){i=h.subtract(t,this._cameraPosition,i);let o=h.magnitudeSquared(i),s=this._occluderRadius*this._occluderRadius,a=n*n;return(this._horizonDistance*this._horizonDistance+s)*a>o*s?!0:(r=Math.sqrt(r)+this._horizonDistance,r*r+a>o)}return!0}return!1};var gTt=new h;al.prototype.computeVisibility=function(e){let t=h.clone(e.center),n=e.radius;if(n>this._occluderRadius)return ns.FULL;if(this._horizonDistance!==Number.MAX_VALUE){let i=h.subtract(t,this._occluderPosition,gTt),r=this._occluderRadius-n,o=h.magnitudeSquared(i);if(r=o-r*r,r>0){r=Math.sqrt(r)+this._horizonDistance,i=h.subtract(t,this._cameraPosition,i);let s=h.magnitudeSquared(i);return r*r+n*n<s?ns.NONE:(r=this._occluderRadius+n,r=o-r*r,r>0?(r=Math.sqrt(r)+this._horizonDistance,s<r*r+n*n?ns.FULL:ns.PARTIAL):(i=h.subtract(t,this._horizonPlanePosition,i),h.dot(i,this._horizonPlaneNormal)>-n?ns.PARTIAL:ns.FULL))}}return ns.NONE};var n6=new h;al.computeOccludeePoint=function(e,t,n){let i=h.clone(t),r=h.clone(e.center),o=e.radius,s=n.length,a=h.normalize(h.subtract(i,r,n6),n6),c=-h.dot(a,r),u=al._anyRotationVector(r,a,c),f=al._horizonToPlaneNormalDotProduct(e,a,c,u,n[0]);if(!f)return;let d;for(let g=1;g<s;++g){if(d=al._horizonToPlaneNormalDotProduct(e,a,c,u,n[g]),!d)return;d<f&&(f=d)}if(f<.0017453283658983088)return;let p=o/f;return h.add(r,h.multiplyByScalar(a,p,n6),n6)};var _Tt=[];al.computeOccludeePointFromRectangle=function(e,t){t=t??ee.default;let n=ie.subsample(e,t,0,_Tt),i=ue.fromPoints(n),r=h.ZERO;if(!h.equals(r,i.center))return al.computeOccludeePoint(new ue(r,t.minimumRadius),i.center,n)};var yTt=new h;al._anyRotationVector=function(e,t,n){let i=h.abs(t,yTt),r=i.x>i.y?0:1;(r===0&&i.z>i.x||r===1&&i.z>i.y)&&(r=2);let o=new h,s;r===0?(i.x=e.x,i.y=e.y+1,i.z=e.z+1,s=h.UNIT_X):r===1?(i.x=e.x+1,i.y=e.y,i.z=e.z+1,s=h.UNIT_Y):(i.x=e.x+1,i.y=e.y+1,i.z=e.z,s=h.UNIT_Z);let a=(h.dot(t,i)+n)/-h.dot(t,s);return h.normalize(h.subtract(h.add(i,h.multiplyByScalar(s,a,o),i),e,i),i)};var ATt=new h;al._rotationVector=function(e,t,n,i,r){let o=h.subtract(i,e,ATt);if(o=h.normalize(o,o),h.dot(t,o)<.9999999847691291){let s=h.cross(t,o,o);if(h.magnitude(s)>P.EPSILON13)return h.normalize(s,new h)}return r};var gte=new h,bTt=new h,i6=new h,ASe=new h;al._horizonToPlaneNormalDotProduct=function(e,t,n,i,r){let o=h.clone(r,gte),s=h.clone(e.center,bTt),a=e.radius,c=h.subtract(s,o,i6),u=h.magnitudeSquared(c),f=a*a;if(u<f)return!1;let d=u-f,p=Math.sqrt(d),m=1/Math.sqrt(u),A=p*m*p;c=h.normalize(c,c);let b=h.add(o,h.multiplyByScalar(c,A,ASe),ASe),x=Math.sqrt(d-A*A),T=this._rotationVector(s,t,n,o,i),E=h.fromElements(T.x*T.x*c.x+(T.x*T.y-T.z)*c.y+(T.x*T.z+T.y)*c.z,(T.x*T.y+T.z)*c.x+T.y*T.y*c.y+(T.y*T.z-T.x)*c.z,(T.x*T.z-T.y)*c.x+(T.y*T.z+T.x)*c.y+T.z*T.z*c.z,gte);E=h.normalize(E,E);let v=h.multiplyByScalar(E,x,gte);T=h.normalize(h.subtract(h.add(b,v,i6),s,i6),i6);let S=h.dot(t,T);T=h.normalize(h.subtract(h.subtract(b,v,T),s,T),T);let I=h.dot(t,T);return S<I?S:I};var r6=al;function Gp(e){e=e??H.EMPTY_OBJECT,this.left=e.left,this._left=void 0,this.right=e.right,this._right=void 0,this.top=e.top,this._top=void 0,this.bottom=e.bottom,this._bottom=void 0,this.near=e.near??1,this._near=this.near,this.far=e.far??5e8,this._far=this.far,this._cullingVolume=new aa,this._perspectiveMatrix=new M,this._infinitePerspective=new M}function _te(e){let{top:t,bottom:n,right:i,left:r,near:o,far:s}=e;(t!==e._top||n!==e._bottom||r!==e._left||i!==e._right||o!==e._near||s!==e._far)&&(e._left=r,e._right=i,e._top=t,e._bottom=n,e._near=o,e._far=s,e._perspectiveMatrix=M.computePerspectiveOffCenter(r,i,n,t,o,s,e._perspectiveMatrix),e._infinitePerspective=M.computeInfinitePerspectiveOffCenter(r,i,n,t,o,e._infinitePerspective))}Object.defineProperties(Gp.prototype,{projectionMatrix:{get:function(){return _te(this),this._perspectiveMatrix}},infiniteProjectionMatrix:{get:function(){return _te(this),this._infinitePerspective}}});var xTt=new h,TTt=new h,ETt=new h,CTt=new h;Gp.prototype.computeCullingVolume=function(e,t,n){let i=this._cullingVolume.planes,r=this.top,o=this.bottom,s=this.right,a=this.left,c=this.near,u=this.far,f=h.cross(t,n,xTt),d=TTt;h.multiplyByScalar(t,c,d),h.add(e,d,d);let p=ETt;h.multiplyByScalar(t,u,p),h.add(e,p,p);let g=CTt;h.multiplyByScalar(f,a,g),h.add(d,g,g),h.subtract(g,e,g),h.normalize(g,g),h.cross(g,n,g),h.normalize(g,g);let m=i[0];return l(m)||(m=i[0]=new se),m.x=g.x,m.y=g.y,m.z=g.z,m.w=-h.dot(g,e),h.multiplyByScalar(f,s,g),h.add(d,g,g),h.subtract(g,e,g),h.cross(n,g,g),h.normalize(g,g),m=i[1],l(m)||(m=i[1]=new se),m.x=g.x,m.y=g.y,m.z=g.z,m.w=-h.dot(g,e),h.multiplyByScalar(n,o,g),h.add(d,g,g),h.subtract(g,e,g),h.cross(f,g,g),h.normalize(g,g),m=i[2],l(m)||(m=i[2]=new se),m.x=g.x,m.y=g.y,m.z=g.z,m.w=-h.dot(g,e),h.multiplyByScalar(n,r,g),h.add(d,g,g),h.subtract(g,e,g),h.cross(g,f,g),h.normalize(g,g),m=i[3],l(m)||(m=i[3]=new se),m.x=g.x,m.y=g.y,m.z=g.z,m.w=-h.dot(g,e),m=i[4],l(m)||(m=i[4]=new se),m.x=t.x,m.y=t.y,m.z=t.z,m.w=-h.dot(t,d),h.negate(t,g),m=i[5],l(m)||(m=i[5]=new se),m.x=g.x,m.y=g.y,m.z=g.z,m.w=-h.dot(g,p),this._cullingVolume};Gp.prototype.getPixelDimensions=function(e,t,n,i,r){_te(this);let o=1/this.near,s=this.top*o,a=2*i*n*s/t;s=this.right*o;let c=2*i*n*s/e;return r.x=c,r.y=a,r};Gp.prototype.clone=function(e){return l(e)||(e=new Gp),e.right=this.right,e.left=this.left,e.top=this.top,e.bottom=this.bottom,e.near=this.near,e.far=this.far,e._left=void 0,e._right=void 0,e._top=void 0,e._bottom=void 0,e._near=void 0,e._far=void 0,e};Gp.prototype.equals=function(e){return l(e)&&e instanceof Gp&&this.right===e.right&&this.left===e.left&&this.top===e.top&&this.bottom===e.bottom&&this.near===e.near&&this.far===e.far};Gp.prototype.equalsEpsilon=function(e,t,n){return e===this||l(e)&&e instanceof Gp&&P.equalsEpsilon(this.right,e.right,t,n)&&P.equalsEpsilon(this.left,e.left,t,n)&&P.equalsEpsilon(this.top,e.top,t,n)&&P.equalsEpsilon(this.bottom,e.bottom,t,n)&&P.equalsEpsilon(this.near,e.near,t,n)&&P.equalsEpsilon(this.far,e.far,t,n)};var Uu=Gp;function zu(e){e=e??H.EMPTY_OBJECT,this._offCenterFrustum=new Uu,this.fov=e.fov,this._fov=void 0,this._fovy=void 0,this._sseDenominator=void 0,this.aspectRatio=e.aspectRatio,this._aspectRatio=void 0,this.near=e.near??1,this._near=this.near,this.far=e.far??5e8,this._far=this.far,this.xOffset=e.xOffset??0,this._xOffset=this.xOffset,this.yOffset=e.yOffset??0,this._yOffset=this.yOffset}zu.packedLength=6;zu.pack=function(e,t,n){return n=n??0,t[n++]=e.fov,t[n++]=e.aspectRatio,t[n++]=e.near,t[n++]=e.far,t[n++]=e.xOffset,t[n]=e.yOffset,t};zu.unpack=function(e,t,n){return t=t??0,l(n)||(n=new zu),n.fov=e[t++],n.aspectRatio=e[t++],n.near=e[t++],n.far=e[t++],n.xOffset=e[t++],n.yOffset=e[t],n};function cm(e){if(!(e.fov!==e._fov||e.aspectRatio!==e._aspectRatio||e.near!==e._near||e.far!==e._far||e.xOffset!==e._xOffset||e.yOffset!==e._yOffset))return;e._aspectRatio=e.aspectRatio,e._fov=e.fov,e._fovy=e.aspectRatio<=1?e.fov:Math.atan(Math.tan(e.fov*.5)/e.aspectRatio)*2,e._near=e.near,e._far=e.far,e._sseDenominator=2*Math.tan(.5*e._fovy),e._xOffset=e.xOffset,e._yOffset=e.yOffset;let n=e._offCenterFrustum;n.top=e.near*Math.tan(.5*e._fovy),n.bottom=-n.top,n.right=e.aspectRatio*n.top,n.left=-n.right,n.near=e.near,n.far=e.far,n.right+=e.xOffset,n.left+=e.xOffset,n.top+=e.yOffset,n.bottom+=e.yOffset}Object.defineProperties(zu.prototype,{projectionMatrix:{get:function(){return cm(this),this._offCenterFrustum.projectionMatrix}},infiniteProjectionMatrix:{get:function(){return cm(this),this._offCenterFrustum.infiniteProjectionMatrix}},fovy:{get:function(){return cm(this),this._fovy}},sseDenominator:{get:function(){return cm(this),this._sseDenominator}},offCenterFrustum:{get:function(){return cm(this),this._offCenterFrustum}}});zu.prototype.computeCullingVolume=function(e,t,n){return cm(this),this._offCenterFrustum.computeCullingVolume(e,t,n)};zu.prototype.getPixelDimensions=function(e,t,n,i,r){return cm(this),this._offCenterFrustum.getPixelDimensions(e,t,n,i,r)};zu.prototype.clone=function(e){return l(e)||(e=new zu),e.aspectRatio=this.aspectRatio,e.fov=this.fov,e.near=this.near,e.far=this.far,e._aspectRatio=void 0,e._fov=void 0,e._near=void 0,e._far=void 0,this._offCenterFrustum.clone(e._offCenterFrustum),e};zu.prototype.equals=function(e){return!l(e)||!(e instanceof zu)?!1:(cm(this),cm(e),this.fov===e.fov&&this.aspectRatio===e.aspectRatio&&this._offCenterFrustum.equals(e._offCenterFrustum))};zu.prototype.equalsEpsilon=function(e,t,n){return!l(e)||!(e instanceof zu)?!1:(cm(this),cm(e),P.equalsEpsilon(this.fov,e.fov,t,n)&&P.equalsEpsilon(this.aspectRatio,e.aspectRatio,t,n)&&this._offCenterFrustum.equalsEpsilon(e._offCenterFrustum,t,n))};var Ji=zu;function wR(){this._colorTexture=void 0,this._drawCommand=void 0}Object.defineProperties(wR.prototype,{colorTexture:{get:function(){return this._colorTexture}}});function vTt(e,t,n){let i=t.createViewportQuadCommand(p2,{framebuffer:n,renderState:Ge.fromCache({viewport:new et(0,0,256,256)})});e._drawCommand=i}wR.prototype.update=function(e){if(!l(this._colorTexture)){let t=e.context,n=new Dt({context:t,width:256,height:256,pixelFormat:$e.RGBA,pixelDatatype:ze.UNSIGNED_BYTE,sampler:Ht.NEAREST});this._colorTexture=n;let i=new vs({context:t,colorTextures:[n],destroyAttachments:!1});vTt(this,t,i),this._drawCommand.execute(t),i.destroy(),this._drawCommand.shaderProgram=this._drawCommand.shaderProgram&&this._drawCommand.shaderProgram.destroy()}};wR.prototype.isDestroyed=function(){return!1};wR.prototype.destroy=function(){return this._colorTexture=this._colorTexture&&this._colorTexture.destroy(),le(this)};var o6=wR;var Zi=Object.freeze({Linear:Object.freeze({None:function(e){return e},In:function(e){return e},Out:function(e){return e},InOut:function(e){return e}}),Quadratic:Object.freeze({In:function(e){return e*e},Out:function(e){return e*(2-e)},InOut:function(e){return(e*=2)<1?.5*e*e:-.5*(--e*(e-2)-1)}}),Cubic:Object.freeze({In:function(e){return e*e*e},Out:function(e){return--e*e*e+1},InOut:function(e){return(e*=2)<1?.5*e*e*e:.5*((e-=2)*e*e+2)}}),Quartic:Object.freeze({In:function(e){return e*e*e*e},Out:function(e){return 1- --e*e*e*e},InOut:function(e){return(e*=2)<1?.5*e*e*e*e:-.5*((e-=2)*e*e*e-2)}}),Quintic:Object.freeze({In:function(e){return e*e*e*e*e},Out:function(e){return--e*e*e*e*e+1},InOut:function(e){return(e*=2)<1?.5*e*e*e*e*e:.5*((e-=2)*e*e*e*e+2)}}),Sinusoidal:Object.freeze({In:function(e){return 1-Math.sin((1-e)*Math.PI/2)},Out:function(e){return Math.sin(e*Math.PI/2)},InOut:function(e){return .5*(1-Math.sin(Math.PI*(.5-e)))}}),Exponential:Object.freeze({In:function(e){return e===0?0:Math.pow(1024,e-1)},Out:function(e){return e===1?1:1-Math.pow(2,-10*e)},InOut:function(e){return e===0?0:e===1?1:(e*=2)<1?.5*Math.pow(1024,e-1):.5*(-Math.pow(2,-10*(e-1))+2)}}),Circular:Object.freeze({In:function(e){return 1-Math.sqrt(1-e*e)},Out:function(e){return Math.sqrt(1- --e*e)},InOut:function(e){return(e*=2)<1?-.5*(Math.sqrt(1-e*e)-1):.5*(Math.sqrt(1-(e-=2)*e)+1)}}),Elastic:Object.freeze({In:function(e){return e===0?0:e===1?1:-Math.pow(2,10*(e-1))*Math.sin((e-1.1)*5*Math.PI)},Out:function(e){return e===0?0:e===1?1:Math.pow(2,-10*e)*Math.sin((e-.1)*5*Math.PI)+1},InOut:function(e){return e===0?0:e===1?1:(e*=2,e<1?-.5*Math.pow(2,10*(e-1))*Math.sin((e-1.1)*5*Math.PI):.5*Math.pow(2,-10*(e-1))*Math.sin((e-1.1)*5*Math.PI)+1)}}),Back:Object.freeze({In:function(e){var t=1.70158;return e===1?1:e*e*((t+1)*e-t)},Out:function(e){var t=1.70158;return e===0?0:--e*e*((t+1)*e+t)+1},InOut:function(e){var t=2.5949095;return(e*=2)<1?.5*(e*e*((t+1)*e-t)):.5*((e-=2)*e*((t+1)*e+t)+2)}}),Bounce:Object.freeze({In:function(e){return 1-Zi.Bounce.Out(1-e)},Out:function(e){return e<.36363636363636365?7.5625*e*e:e<.7272727272727273?7.5625*(e-=.5454545454545454)*e+.75:e<.9090909090909091?7.5625*(e-=.8181818181818182)*e+.9375:7.5625*(e-=.9545454545454546)*e+.984375},InOut:function(e){return e<.5?Zi.Bounce.In(e*2)*.5:Zi.Bounce.Out(e*2-1)*.5+.5}}),generatePow:function(e){return e===void 0&&(e=4),e=e<Number.EPSILON?Number.EPSILON:e,e=e>1e4?1e4:e,{In:function(t){return Math.pow(t,e)},Out:function(t){return 1-Math.pow(1-t,e)},InOut:function(t){return t<.5?Math.pow(t*2,e)/2:(1-Math.pow(2-t*2,e))/2+.5}}}}),IR=function(){return performance.now()},STt=(function(){function e(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];this._tweens={},this._tweensAddedDuringUpdate={},this.add.apply(this,t)}return e.prototype.getAll=function(){var t=this;return Object.keys(this._tweens).map(function(n){return t._tweens[n]})},e.prototype.removeAll=function(){this._tweens={}},e.prototype.add=function(){for(var t,n=[],i=0;i<arguments.length;i++)n[i]=arguments[i];for(var r=0,o=n;r<o.length;r++){var s=o[r];(t=s._group)===null||t===void 0||t.remove(s),s._group=this,this._tweens[s.getId()]=s,this._tweensAddedDuringUpdate[s.getId()]=s}},e.prototype.remove=function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];for(var i=0,r=t;i<r.length;i++){var o=r[i];o._group=void 0,delete this._tweens[o.getId()],delete this._tweensAddedDuringUpdate[o.getId()]}},e.prototype.allStopped=function(){return this.getAll().every(function(t){return!t.isPlaying()})},e.prototype.update=function(t,n){t===void 0&&(t=IR()),n===void 0&&(n=!0);var i=Object.keys(this._tweens);if(i.length!==0)for(;i.length>0;){this._tweensAddedDuringUpdate={};for(var r=0;r<i.length;r++){var o=this._tweens[i[r]],s=!n;o&&o.update(t,s)===!1&&!n&&this.remove(o)}i=Object.keys(this._tweensAddedDuringUpdate)}},e})(),XS={Linear:function(e,t){var n=e.length-1,i=n*t,r=Math.floor(i),o=XS.Utils.Linear;return t<0?o(e[0],e[1],i):t>1?o(e[n],e[n-1],n-i):o(e[r],e[r+1>n?n:r+1],i-r)},Bezier:function(e,t){for(var n=0,i=e.length-1,r=Math.pow,o=XS.Utils.Bernstein,s=0;s<=i;s++)n+=r(1-t,i-s)*r(t,s)*e[s]*o(i,s);return n},CatmullRom:function(e,t){var n=e.length-1,i=n*t,r=Math.floor(i),o=XS.Utils.CatmullRom;return e[0]===e[n]?(t<0&&(r=Math.floor(i=n*(1+t))),o(e[(r-1+n)%n],e[r],e[(r+1)%n],e[(r+2)%n],i-r)):t<0?e[0]-(o(e[0],e[0],e[1],e[1],-i)-e[0]):t>1?e[n]-(o(e[n],e[n],e[n-1],e[n-1],i-n)-e[n]):o(e[r?r-1:0],e[r],e[n<r+1?n:r+1],e[n<r+2?n:r+2],i-r)},Utils:{Linear:function(e,t,n){return(t-e)*n+e},Bernstein:function(e,t){var n=XS.Utils.Factorial;return n(e)/n(t)/n(e-t)},Factorial:(function(){var e=[1];return function(t){var n=1;if(e[t])return e[t];for(var i=t;i>1;i--)n*=i;return e[t]=n,n}})(),CatmullRom:function(e,t,n,i,r){var o=(n-e)*.5,s=(i-t)*.5,a=r*r,c=r*a;return(2*t-2*n+o+s)*c+(-3*t+3*n-2*o-s)*a+o*r+t}}},xSe=(function(){function e(){}return e.nextId=function(){return e._nextId++},e._nextId=0,e})(),yte=new STt,TSe=(function(){function e(t,n){this._isPaused=!1,this._pauseStart=0,this._valuesStart={},this._valuesEnd={},this._valuesStartRepeat={},this._duration=1e3,this._isDynamic=!1,this._initialRepeat=0,this._repeat=0,this._yoyo=!1,this._isPlaying=!1,this._reversed=!1,this._delayTime=0,this._startTime=0,this._easingFunction=Zi.Linear.None,this._interpolationFunction=XS.Linear,this._chainedTweens=[],this._onStartCallbackFired=!1,this._onEveryStartCallbackFired=!1,this._id=xSe.nextId(),this._isChainStopped=!1,this._propertiesAreSetUp=!1,this._goToEnd=!1,this._object=t,typeof n=="object"?(this._group=n,n.add(this)):n===!0&&(this._group=yte,yte.add(this))}return e.prototype.getId=function(){return this._id},e.prototype.isPlaying=function(){return this._isPlaying},e.prototype.isPaused=function(){return this._isPaused},e.prototype.getDuration=function(){return this._duration},e.prototype.to=function(t,n){if(n===void 0&&(n=1e3),this._isPlaying)throw new Error("Can not call Tween.to() while Tween is already started or paused. Stop the Tween first.");return this._valuesEnd=t,this._propertiesAreSetUp=!1,this._duration=n<0?0:n,this},e.prototype.duration=function(t){return t===void 0&&(t=1e3),this._duration=t<0?0:t,this},e.prototype.dynamic=function(t){return t===void 0&&(t=!1),this._isDynamic=t,this},e.prototype.start=function(t,n){if(t===void 0&&(t=IR()),n===void 0&&(n=!1),this._isPlaying)return this;if(this._repeat=this._initialRepeat,this._reversed){this._reversed=!1;for(var i in this._valuesStartRepeat)this._swapEndStartRepeatValues(i),this._valuesStart[i]=this._valuesStartRepeat[i]}if(this._isPlaying=!0,this._isPaused=!1,this._onStartCallbackFired=!1,this._onEveryStartCallbackFired=!1,this._isChainStopped=!1,this._startTime=t,this._startTime+=this._delayTime,!this._propertiesAreSetUp||n){if(this._propertiesAreSetUp=!0,!this._isDynamic){var r={};for(var o in this._valuesEnd)r[o]=this._valuesEnd[o];this._valuesEnd=r}this._setupProperties(this._object,this._valuesStart,this._valuesEnd,this._valuesStartRepeat,n)}return this},e.prototype.startFromCurrentValues=function(t){return this.start(t,!0)},e.prototype._setupProperties=function(t,n,i,r,o){for(var s in i){var a=t[s],c=Array.isArray(a),u=c?"array":typeof a,f=!c&&Array.isArray(i[s]);if(!(u==="undefined"||u==="function")){if(f){var d=i[s];if(d.length===0)continue;for(var p=[a],g=0,m=d.length;g<m;g+=1){var y=this._handleRelativeValue(a,d[g]);if(isNaN(y)){f=!1,console.warn("Found invalid interpolation list. Skipping.");break}p.push(y)}f&&(i[s]=p)}if((u==="object"||c)&&a&&!f){n[s]=c?[]:{};var A=a;for(var b in A)n[s][b]=A[b];r[s]=c?[]:{};var d=i[s];if(!this._isDynamic){var x={};for(var b in d)x[b]=d[b];i[s]=d=x}this._setupProperties(A,n[s],d,r[s],o)}else(typeof n[s]>"u"||o)&&(n[s]=a),c||(n[s]*=1),f?r[s]=i[s].slice().reverse():r[s]=n[s]||0}}},e.prototype.stop=function(){return this._isChainStopped||(this._isChainStopped=!0,this.stopChainedTweens()),this._isPlaying?(this._isPlaying=!1,this._isPaused=!1,this._onStopCallback&&this._onStopCallback(this._object),this):this},e.prototype.end=function(){return this._goToEnd=!0,this.update(this._startTime+this._duration),this},e.prototype.pause=function(t){return t===void 0&&(t=IR()),this._isPaused||!this._isPlaying?this:(this._isPaused=!0,this._pauseStart=t,this)},e.prototype.resume=function(t){return t===void 0&&(t=IR()),!this._isPaused||!this._isPlaying?this:(this._isPaused=!1,this._startTime+=t-this._pauseStart,this._pauseStart=0,this)},e.prototype.stopChainedTweens=function(){for(var t=0,n=this._chainedTweens.length;t<n;t++)this._chainedTweens[t].stop();return this},e.prototype.group=function(t){return t?(t.add(this),this):(console.warn("tween.group() without args has been removed, use group.add(tween) instead."),this)},e.prototype.remove=function(){var t;return(t=this._group)===null||t===void 0||t.remove(this),this},e.prototype.delay=function(t){return t===void 0&&(t=0),this._delayTime=t,this},e.prototype.repeat=function(t){return t===void 0&&(t=0),this._initialRepeat=t,this._repeat=t,this},e.prototype.repeatDelay=function(t){return this._repeatDelayTime=t,this},e.prototype.yoyo=function(t){return t===void 0&&(t=!1),this._yoyo=t,this},e.prototype.easing=function(t){return t===void 0&&(t=Zi.Linear.None),this._easingFunction=t,this},e.prototype.interpolation=function(t){return t===void 0&&(t=XS.Linear),this._interpolationFunction=t,this},e.prototype.chain=function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];return this._chainedTweens=t,this},e.prototype.onStart=function(t){return this._onStartCallback=t,this},e.prototype.onEveryStart=function(t){return this._onEveryStartCallback=t,this},e.prototype.onUpdate=function(t){return this._onUpdateCallback=t,this},e.prototype.onRepeat=function(t){return this._onRepeatCallback=t,this},e.prototype.onComplete=function(t){return this._onCompleteCallback=t,this},e.prototype.onStop=function(t){return this._onStopCallback=t,this},e.prototype.update=function(t,n){var i=this,r;if(t===void 0&&(t=IR()),n===void 0&&(n=e.autoStartOnUpdate),this._isPaused)return!0;var o;if(!this._goToEnd&&!this._isPlaying)if(n)this.start(t,!0);else return!1;if(this._goToEnd=!1,t<this._startTime)return!0;this._onStartCallbackFired===!1&&(this._onStartCallback&&this._onStartCallback(this._object),this._onStartCallbackFired=!0),this._onEveryStartCallbackFired===!1&&(this._onEveryStartCallback&&this._onEveryStartCallback(this._object),this._onEveryStartCallbackFired=!0);var s=t-this._startTime,a=this._duration+((r=this._repeatDelayTime)!==null&&r!==void 0?r:this._delayTime),c=this._duration+this._repeat*a,u=function(){if(i._duration===0||s>c)return 1;var y=Math.trunc(s/a),A=s-y*a,b=Math.min(A/i._duration,1);return b===0&&s===i._duration?1:b},f=u(),d=this._easingFunction(f);if(this._updateProperties(this._object,this._valuesStart,this._valuesEnd,d),this._onUpdateCallback&&this._onUpdateCallback(this._object,f),this._duration===0||s>=this._duration)if(this._repeat>0){var p=Math.min(Math.trunc((s-this._duration)/a)+1,this._repeat);isFinite(this._repeat)&&(this._repeat-=p);for(o in this._valuesStartRepeat)!this._yoyo&&typeof this._valuesEnd[o]=="string"&&(this._valuesStartRepeat[o]=this._valuesStartRepeat[o]+parseFloat(this._valuesEnd[o])),this._yoyo&&this._swapEndStartRepeatValues(o),this._valuesStart[o]=this._valuesStartRepeat[o];return this._yoyo&&(this._reversed=!this._reversed),this._startTime+=a*p,this._onRepeatCallback&&this._onRepeatCallback(this._object),this._onEveryStartCallbackFired=!1,!0}else{this._onCompleteCallback&&this._onCompleteCallback(this._object);for(var g=0,m=this._chainedTweens.length;g<m;g++)this._chainedTweens[g].start(this._startTime+this._duration,!1);return this._isPlaying=!1,!1}return!0},e.prototype._updateProperties=function(t,n,i,r){for(var o in i)if(n[o]!==void 0){var s=n[o]||0,a=i[o],c=Array.isArray(t[o]),u=Array.isArray(a),f=!c&&u;f?t[o]=this._interpolationFunction(a,r):typeof a=="object"&&a?this._updateProperties(t[o],s,a,r):(a=this._handleRelativeValue(s,a),typeof a=="number"&&(t[o]=s+(a-s)*r))}},e.prototype._handleRelativeValue=function(t,n){return typeof n!="string"?n:n.charAt(0)==="+"||n.charAt(0)==="-"?t+parseFloat(n):parseFloat(n)},e.prototype._swapEndStartRepeatValues=function(t){var n=this._valuesStartRepeat[t],i=this._valuesEnd[t];typeof i=="string"?this._valuesStartRepeat[t]=this._valuesStartRepeat[t]+parseFloat(i):this._valuesStartRepeat[t]=this._valuesEnd[t],this._valuesEnd[t]=n},e.autoStartOnUpdate=!1,e})();var uFi=xSe.nextId,Wp=yte,fFi=Wp.getAll.bind(Wp),dFi=Wp.removeAll.bind(Wp),hFi=Wp.add.bind(Wp),mFi=Wp.remove.bind(Wp),pFi=Wp.update.bind(Wp);var wTt={LINEAR_NONE:Zi.Linear.None,QUADRATIC_IN:Zi.Quadratic.In,QUADRATIC_OUT:Zi.Quadratic.Out,QUADRATIC_IN_OUT:Zi.Quadratic.InOut,CUBIC_IN:Zi.Cubic.In,CUBIC_OUT:Zi.Cubic.Out,CUBIC_IN_OUT:Zi.Cubic.InOut,QUARTIC_IN:Zi.Quartic.In,QUARTIC_OUT:Zi.Quartic.Out,QUARTIC_IN_OUT:Zi.Quartic.InOut,QUINTIC_IN:Zi.Quintic.In,QUINTIC_OUT:Zi.Quintic.Out,QUINTIC_IN_OUT:Zi.Quintic.InOut,SINUSOIDAL_IN:Zi.Sinusoidal.In,SINUSOIDAL_OUT:Zi.Sinusoidal.Out,SINUSOIDAL_IN_OUT:Zi.Sinusoidal.InOut,EXPONENTIAL_IN:Zi.Exponential.In,EXPONENTIAL_OUT:Zi.Exponential.Out,EXPONENTIAL_IN_OUT:Zi.Exponential.InOut,CIRCULAR_IN:Zi.Circular.In,CIRCULAR_OUT:Zi.Circular.Out,CIRCULAR_IN_OUT:Zi.Circular.InOut,ELASTIC_IN:Zi.Elastic.In,ELASTIC_OUT:Zi.Elastic.Out,ELASTIC_IN_OUT:Zi.Elastic.InOut,BACK_IN:Zi.Back.In,BACK_OUT:Zi.Back.Out,BACK_IN_OUT:Zi.Back.InOut,BOUNCE_IN:Zi.Bounce.In,BOUNCE_OUT:Zi.Bounce.Out,BOUNCE_IN_OUT:Zi.Bounce.InOut},ks=Object.freeze(wTt);var SSe={};function ITt(e,t,n){let i,r,o;if(e instanceof Ji){let s=Math.tan(.5*e.fovy);return i=e.near,r=e.near*s,o=e.aspectRatio*r,Math.max(t*i/o,n*i/r)}else if(e instanceof Uu)return i=e.near,r=e.top,o=e.right,Math.max(t*i/o,n*i/r);return Math.max(t,n)}var PTt=new h,ESe=new h;function wSe(e,t,n,i){if(l(i)&&n(.5)>i){let r=n(0),o=n(1),s=n(.5),a=s-r,c=s-o;return function(u){let f=n(u);if(u<=.5){let p=(f-r)/a;return P.lerp(e,-P.PI_OVER_TWO,p)}let d=(f-o)/c;return P.lerp(-P.PI_OVER_TWO,t,1-d)}}return function(r){return P.lerp(e,t,r)}}function bte(e,t,n,i,r){let o=r,s=Math.max(n,i);if(!l(o)){let a=e.position,c=t,u=e.up,f=e.right,d=e.frustum,p=h.subtract(a,c,PTt),g=h.magnitude(h.multiplyByScalar(u,h.dot(p,u),ESe)),m=h.magnitude(h.multiplyByScalar(f,h.dot(p,f),ESe));o=Math.min(ITt(d,g,m)*.2,1e9)}if(s<o){let u=-Math.pow((o-n)*1e6,.125),f=Math.pow((o-i)*1e6,1/8);return function(d){let p=d*(f-u)+u;return-Math.pow(p,8)/1e6+o}}return function(a){return P.lerp(n,i,a)}}function PR(e,t){return P.equalsEpsilon(e,P.TWO_PI,P.EPSILON11)&&(e=0),t>e+Math.PI?e+=P.TWO_PI:t<e-Math.PI&&(e-=P.TWO_PI),e}var ISe=new h;function DTt(e,t,n,i,r,o,s,a){let c=e.camera,u=h.clone(c.position,ISe),f=c.pitch,d=PR(c.heading,i),p=PR(c.roll,o),g=bte(c,n,u.z,n.z,s),m=wSe(f,r,g,a);function y(A){let b=A.time/t;c.setView({orientation:{heading:P.lerp(d,i,b),pitch:m(b),roll:P.lerp(p,o,b)}}),U.lerp(u,n,b,c.position),c.position.z=g(b)}return y}function RTt(e,t){e.longitude<t.longitude?e.longitude+=P.TWO_PI:t.longitude+=P.TWO_PI}function OTt(e,t){let n=e.longitude-t.longitude;n<-P.PI?e.longitude+=P.TWO_PI:n>P.PI&&(t.longitude+=P.TWO_PI)}var MTt=new he,NTt=new he;function LTt(e,t,n,i,r,o,s,a,c,u){let f=e.camera,p=e.mapProjection.ellipsoid,g=he.clone(f.positionCartographic,MTt),m=f.pitch,y=PR(f.heading,i),A=PR(f.roll,o),b=p.cartesianToCartographic(n,NTt);g.longitude=P.zeroToTwoPi(g.longitude),b.longitude=P.zeroToTwoPi(b.longitude);let x=!1;if(l(a)){let S=P.zeroToTwoPi(a),I=Math.min(g.longitude,b.longitude),R=Math.max(g.longitude,b.longitude),O=S>=I&&S<=R;if(l(c)){let L=Math.abs(g.longitude-b.longitude),_=P.TWO_PI-L;(O?L:_)<(O?_:L)*c&&!O&&(x=!0)}else O||(x=!0)}x?RTt(g,b):OTt(g,b);let T=bte(f,n,g.height,b.height,s),E=wSe(m,r,T,u);function v(){let S=g.longitude,I=b.longitude,R=g.latitude,O=b.latitude;return function(_){let C=_.time/t,w=h.fromRadians(P.lerp(S,I,C),P.lerp(R,O,C),T(C),p);f.setView({destination:w,orientation:{heading:P.lerp(y,i,C),pitch:E(C),roll:P.lerp(A,o,C)}})}}return v()}function FTt(e,t,n,i,r,o,s){let a=e.camera,c=h.clone(a.position,ISe),u=PR(a.heading,i),f=a.frustum.right-a.frustum.left,d=bte(a,n,f,n.z,s);function p(g){let m=g.time/t;a.setView({orientation:{heading:P.lerp(u,i,m)}}),U.lerp(c,n,m,a.position);let y=d(m),A=a.frustum,b=A.top/A.right,x=(y-(A.right-A.left))*.5;A.right+=x,A.left-=x,A.top=b*A.right,A.bottom=-A.top}return p}var CSe=new he,BTt=new h;function Ate(e,t){return{startObject:{},stopObject:{},duration:0,complete:e,cancel:t}}function vSe(e,t){function n(){typeof t=="function"&&t(),e.enableInputs=!0}return n}SSe.createTween=function(e,t){t=t??H.EMPTY_OBJECT;let n=t.destination,i=e.mode;if(i===re.MORPHING)return Ate();let r=t.convert??!0,o=e.mapProjection,s=o.ellipsoid,a=t.maximumHeight,c=t.flyOverLongitude,u=t.flyOverLongitudeWeight,f=t.pitchAdjustHeight,d=t.easingFunction;r&&i!==re.SCENE3D&&(s.cartesianToCartographic(n,CSe),n=o.project(CSe,BTt));let p=e.camera,g=t.endTransform;l(g)&&p._setTransform(g);let m=t.duration;l(m)||(m=Math.ceil(h.distance(p.position,n)/1e6)+2,m=Math.min(m,3));let y=t.heading??0,A=t.pitch??-P.PI_OVER_TWO,b=t.roll??0,x=e.screenSpaceCameraController;x.enableInputs=!1;let T=vSe(x,t.complete),E=vSe(x,t.cancel),v=p.frustum,S=e.mode===re.SCENE2D;if(S=S&&U.equalsEpsilon(p.position,n,P.EPSILON6),S=S&&P.equalsEpsilon(Math.max(v.right-v.left,v.top-v.bottom),n.z,P.EPSILON6),S=S||e.mode!==re.SCENE2D&&h.equalsEpsilon(n,p.position,P.EPSILON10),S=S&&P.equalsEpsilon(P.negativePiToPi(y),P.negativePiToPi(p.heading),P.EPSILON10)&&P.equalsEpsilon(P.negativePiToPi(A),P.negativePiToPi(p.pitch),P.EPSILON10)&&P.equalsEpsilon(P.negativePiToPi(b),P.negativePiToPi(p.roll),P.EPSILON10),S)return Ate(T,E);let I=new Array(4);if(I[re.SCENE2D]=FTt,I[re.SCENE3D]=LTt,I[re.COLUMBUS_VIEW]=DTt,m<=0)return Ate(function(){I[i](e,1,n,y,A,b,a,c,u,f)({time:1}),typeof T=="function"&&T()},E);let R=I[i](e,m,n,y,A,b,a,c,u,f);if(!l(d)){let O=p.positionCartographic.height,L=i===re.SCENE3D?s.cartesianToCartographic(n).height:n.z;O>L&&O>11500?d=ks.CUBIC_OUT:d=ks.QUINTIC_IN_OUT}return{duration:m,easingFunction:d,startObject:{time:0},stopObject:{time:m},update:R,complete:T,cancel:E}};var s6=SSe;var PSe={ROTATE:0,INFINITE_SCROLL:1};Object.freeze(PSe);var Vu=PSe;function an(e){this._scene=e,this._transform=M.clone(M.IDENTITY),this._invTransform=M.clone(M.IDENTITY),this._actualTransform=M.clone(M.IDENTITY),this._actualInvTransform=M.clone(M.IDENTITY),this._transformChanged=!1,this.position=new h,this._position=new h,this._positionWC=new h,this._positionCartographic=new he,this._oldPositionWC=void 0,this.positionWCDeltaMagnitude=0,this.positionWCDeltaMagnitudeLastFrame=0,this.timeSinceMoved=0,this._lastMovedTimestamp=0,this.direction=new h,this._direction=new h,this._directionWC=new h,this.up=new h,this._up=new h,this._upWC=new h,this.right=new h,this._right=new h,this._rightWC=new h,this.frustum=new Ji,this.frustum.aspectRatio=e.drawingBufferWidth/e.drawingBufferHeight,this.frustum.fov=P.toRadians(60),this.defaultMoveAmount=1e5,this.defaultLookAmount=Math.PI/60,this.defaultRotateAmount=Math.PI/3600,this.defaultZoomAmount=1e5,this.constrainedAxis=void 0,this.maximumZoomFactor=1.5,this._moveStart=new be,this._moveEnd=new be,this._changed=new be,this._changedPosition=void 0,this._changedDirection=void 0,this._changedFrustum=void 0,this._changedHeading=void 0,this._changedRoll=void 0,this.percentageChanged=.5,this._viewMatrix=new M,this._invViewMatrix=new M,zSe(this),this._mode=re.SCENE3D,this._modeChanged=!0;let t=e.mapProjection;this._projection=t,this._maxCoord=t.project(new he(Math.PI,P.PI_OVER_TWO)),this._max2Dfrustum=void 0,ZSe(this,an.DEFAULT_VIEW_RECTANGLE,this.position,!0);let n=h.magnitude(this.position);n+=n*an.DEFAULT_VIEW_FACTOR,h.normalize(this.position,this.position),h.multiplyByScalar(this.position,n,this.position)}an.TRANSFORM_2D=new M(0,0,1,0,1,0,0,0,0,1,0,0,0,0,0,1);an.TRANSFORM_2D_INVERSE=M.inverseTransformation(an.TRANSFORM_2D,new M);an.DEFAULT_VIEW_RECTANGLE=ie.fromDegrees(-95,-20,-70,90);an.DEFAULT_VIEW_FACTOR=.5;an.DEFAULT_OFFSET=new xh(0,-P.PI_OVER_FOUR,0);function zSe(e){M.computeView(e._position,e._direction,e._up,e._right,e._viewMatrix),M.multiply(e._viewMatrix,e._actualInvTransform,e._viewMatrix),M.inverseTransformation(e._viewMatrix,e._invViewMatrix)}function kTt(e){if(!l(e._oldPositionWC))e._oldPositionWC=h.clone(e.positionWC,e._oldPositionWC);else{e.positionWCDeltaMagnitudeLastFrame=e.positionWCDeltaMagnitude;let t=h.subtract(e.positionWC,e._oldPositionWC,e._oldPositionWC);e.positionWCDeltaMagnitude=h.magnitude(t),e._oldPositionWC=h.clone(e.positionWC,e._oldPositionWC),e.positionWCDeltaMagnitude>0?(e.timeSinceMoved=0,e._lastMovedTimestamp=xn()):e.timeSinceMoved=Math.max(xn()-e._lastMovedTimestamp,0)/1e3}}an.prototype.canPreloadFlight=function(){return l(this._currentFlight)&&this._mode!==re.SCENE2D};an.prototype._updateCameraChanged=function(){let e=this;if(kTt(e),e._changed.numberOfListeners===0)return;let t=e.percentageChanged,n=e.heading;l(e._changedHeading)||(e._changedHeading=n);let i=Math.abs(e._changedHeading-n)%P.TWO_PI;i=i>P.PI?P.TWO_PI-i:i;let r=i/Math.PI;r>t&&(e._changedHeading=n);let o=e.roll;l(e._changedRoll)||(e._changedRoll=o);let s=Math.abs(e._changedRoll-o)%P.TWO_PI;s=s>P.PI?P.TWO_PI-s:s;let a=s/Math.PI;if(a>t&&(e._changedRoll=o),(a>t||r>t)&&e._changed.raiseEvent(Math.max(a,r)),e._mode===re.SCENE2D){if(!l(e._changedFrustum)){e._changedPosition=h.clone(e.position,e._changedPosition),e._changedFrustum=e.frustum.clone();return}let p=e.position,g=e._changedPosition,m=e.frustum,y=e._changedFrustum,A=p.x+m.left,b=p.x+m.right,x=g.x+y.left,T=g.x+y.right,E=p.y+m.bottom,v=p.y+m.top,S=g.y+y.bottom,I=g.y+y.top,R=Math.max(A,x),O=Math.min(b,T),L=Math.max(E,S),_=Math.min(v,I),C;if(R>=O||L>=v)C=1;else{let w=y;A<x&&b>T&&E<S&&v>I&&(w=m),C=1-(O-R)*(_-L)/((w.right-w.left)*(w.top-w.bottom))}C>t&&(e._changed.raiseEvent(C),e._changedPosition=h.clone(e.position,e._changedPosition),e._changedFrustum=e.frustum.clone(e._changedFrustum));return}if(!l(e._changedDirection)){e._changedPosition=h.clone(e.positionWC,e._changedPosition),e._changedDirection=h.clone(e.directionWC,e._changedDirection);return}let c=P.acosClamped(h.dot(e.directionWC,e._changedDirection)),u;l(e.frustum.fovy)?u=c/(e.frustum.fovy*.5):u=c;let d=h.distance(e.positionWC,e._changedPosition)/e.positionCartographic.height;(u>t||d>t)&&(e._changed.raiseEvent(Math.max(u,d)),e._changedPosition=h.clone(e.positionWC,e._changedPosition),e._changedDirection=h.clone(e.directionWC,e._changedDirection))};function UTt(e){At.basisTo2D(e._projection,e._transform,e._actualTransform)}var zTt=new he,VTt=new h,a6=new h,jTt=new se,HTt=new se,GTt=new se,WTt=new se,qTt=new se;function YTt(e){let t=e._projection,n=t.ellipsoid,i=M.getColumn(e._transform,3,jTt),r=n.cartesianToCartographic(i,zTt),o=t.project(r,VTt),s=HTt;s.x=o.z,s.y=o.x,s.z=o.y,s.w=1;let a=se.clone(se.UNIT_X,qTt),c=se.add(M.getColumn(e._transform,0,a6),i,a6);n.cartesianToCartographic(c,r),t.project(r,o);let u=GTt;u.x=o.z,u.y=o.x,u.z=o.y,u.w=0,h.subtract(u,s,u),u.x=0;let f=WTt;if(h.magnitudeSquared(u)>P.EPSILON10)h.cross(a,u,f);else{let d=se.add(M.getColumn(e._transform,1,a6),i,a6);n.cartesianToCartographic(d,r),t.project(r,o),f.x=o.z,f.y=o.x,f.z=o.y,f.w=0,h.subtract(f,s,f),f.x=0,h.magnitudeSquared(f)<P.EPSILON10&&(se.clone(se.UNIT_Y,u),se.clone(se.UNIT_Z,f))}h.cross(f,a,u),h.normalize(u,u),h.cross(a,u,f),h.normalize(f,f),M.setColumn(e._actualTransform,0,u,e._actualTransform),M.setColumn(e._actualTransform,1,f,e._actualTransform),M.setColumn(e._actualTransform,2,a,e._actualTransform),M.setColumn(e._actualTransform,3,s,e._actualTransform)}var xte=new h;function ll(e){let t=e._mode,n=!1,i=0;t===re.SCENE2D&&(i=e.frustum.right-e.frustum.left,n=i!==e._positionCartographic.height);let r=e._position,o=!h.equals(r,e.position)||n;o&&(r=h.clone(e.position,e._position));let s=e._direction,a=!h.equals(s,e.direction);a&&(h.normalize(e.direction,e.direction),s=h.clone(e.direction,e._direction));let c=e._up,u=!h.equals(c,e.up);u&&(h.normalize(e.up,e.up),c=h.clone(e.up,e._up));let f=e._right,d=!h.equals(f,e.right);d&&(h.normalize(e.right,e.right),f=h.clone(e.right,e._right));let p=e._transformChanged||e._modeChanged;e._transformChanged=!1,p&&(M.inverseTransformation(e._transform,e._invTransform),e._mode===re.COLUMBUS_VIEW||e._mode===re.SCENE2D?M.equals(M.IDENTITY,e._transform)?M.clone(an.TRANSFORM_2D,e._actualTransform):e._mode===re.COLUMBUS_VIEW?UTt(e):YTt(e):M.clone(e._transform,e._actualTransform),M.inverseTransformation(e._actualTransform,e._actualInvTransform),e._modeChanged=!1);let g=e._actualTransform;if(o||p)if(e._positionWC=M.multiplyByPoint(g,r,e._positionWC),t===re.SCENE3D||t===re.MORPHING)e._positionCartographic=e._projection.ellipsoid.cartesianToCartographic(e._positionWC,e._positionCartographic);else{let m=xte;m.x=e._positionWC.y,m.y=e._positionWC.z,m.z=e._positionWC.x,t===re.SCENE2D&&(m.z=i),e._projection.unproject(m,e._positionCartographic)}if(a||u||d){let m=h.dot(s,h.cross(c,f,xte));if(Math.abs(1-m)>P.EPSILON2){let y=1/h.magnitudeSquared(c),A=h.dot(c,s)*y,b=h.multiplyByScalar(s,A,xte);c=h.normalize(h.subtract(c,b,e._up),e._up),h.clone(c,e.up),f=h.cross(s,c,e._right),h.clone(f,e.right)}}(a||p)&&(e._directionWC=M.multiplyByPointAsVector(g,s,e._directionWC),h.normalize(e._directionWC,e._directionWC)),(u||p)&&(e._upWC=M.multiplyByPointAsVector(g,c,e._upWC),h.normalize(e._upWC,e._upWC)),(d||p)&&(e._rightWC=M.multiplyByPointAsVector(g,f,e._rightWC),h.normalize(e._rightWC,e._rightWC)),(o||a||u||d||p)&&zSe(e)}function VSe(e,t){let n;return P.equalsEpsilon(Math.abs(e.z),1,P.EPSILON3)?n=Math.atan2(t.y,t.x)-P.PI_OVER_TWO:n=Math.atan2(e.y,e.x)-P.PI_OVER_TWO,P.TWO_PI-P.zeroToTwoPi(n)}function jSe(e){return P.PI_OVER_TWO-P.acosClamped(e.z)}function HSe(e,t,n){let i=0;return P.equalsEpsilon(Math.abs(e.z),1,P.EPSILON3)||(i=Math.atan2(-n.z,t.z),i=P.zeroToTwoPi(i+P.TWO_PI)),i}var u6=new M,f6=new M;Object.defineProperties(an.prototype,{transform:{get:function(){return this._transform}},inverseTransform:{get:function(){return ll(this),this._invTransform}},viewMatrix:{get:function(){return ll(this),this._viewMatrix}},inverseViewMatrix:{get:function(){return ll(this),this._invViewMatrix}},positionCartographic:{get:function(){return ll(this),this._positionCartographic}},positionWC:{get:function(){return ll(this),this._positionWC}},directionWC:{get:function(){return ll(this),this._directionWC}},upWC:{get:function(){return ll(this),this._upWC}},rightWC:{get:function(){return ll(this),this._rightWC}},heading:{get:function(){if(this._mode!==re.MORPHING){let e=this._projection.ellipsoid,t=M.clone(this._transform,u6),n=At.eastNorthUpToFixedFrame(this.positionWC,e,f6);this._setTransform(n);let i=VSe(this.direction,this.up);return this._setTransform(t),i}}},pitch:{get:function(){if(this._mode!==re.MORPHING){let e=this._projection.ellipsoid,t=M.clone(this._transform,u6),n=At.eastNorthUpToFixedFrame(this.positionWC,e,f6);this._setTransform(n);let i=jSe(this.direction);return this._setTransform(t),i}}},roll:{get:function(){if(this._mode!==re.MORPHING){let e=this._projection.ellipsoid,t=M.clone(this._transform,u6),n=At.eastNorthUpToFixedFrame(this.positionWC,e,f6);this._setTransform(n);let i=HSe(this.direction,this.up,this.right);return this._setTransform(t),i}}},moveStart:{get:function(){return this._moveStart}},moveEnd:{get:function(){return this._moveEnd}},changed:{get:function(){return this._changed}}});an.prototype.update=function(e){let t=!1;if(e!==this._mode&&(this._mode=e,this._modeChanged=e!==re.MORPHING,t=this._mode===re.SCENE2D),t){let n=this._max2Dfrustum=this.frustum.clone(),i=2,r=n.top/n.right;n.right=this._maxCoord.x*i,n.left=-n.right,n.top=r*n.right,n.bottom=-n.top}this._mode===re.SCENE2D&&YSe(this,this.position)};var XTt=new h,KTt=new h,$Tt=new h;an.prototype._setTransform=function(e){let t=h.clone(this.positionWC,XTt),n=h.clone(this.upWC,KTt),i=h.clone(this.directionWC,$Tt);M.clone(e,this._transform),this._transformChanged=!0,ll(this);let r=this._actualInvTransform;M.multiplyByPoint(r,t,this.position),M.multiplyByPointAsVector(r,i,this.direction),M.multiplyByPointAsVector(r,n,this.up),h.cross(this.direction,this.up,this.right),ll(this)};var JTt=new U,ZTt=new gn,QTt=new h,eEt=new h;function GSe(e){if(!M.equals(M.IDENTITY,e.transform))return h.magnitude(e.position);let t=e._scene,n=t.globe,i=JTt;i.x=t.drawingBufferWidth/t.pixelRatio/2,i.y=t.drawingBufferHeight/t.pixelRatio/2;let r;if(l(n)){let a=e.getPickRay(i,ZTt);r=n.pickWorldCoordinates(a,t,!0,QTt)}let o;t.pickPositionSupported&&(o=t.pickPositionWorldCoordinates(i,eEt));let s;if(l(r)||l(o)){let a=l(o)?h.distance(o,e.positionWC):Number.POSITIVE_INFINITY,c=l(r)?h.distance(r,e.positionWC):Number.POSITIVE_INFINITY;s=Math.min(a,c)}else s=Math.max(e.positionCartographic.height,0);return s}an.prototype._adjustOrthographicFrustum=function(e){this.frustum instanceof _n&&(!e&&this._positionCartographic.height<15e4||(this.frustum.width=GSe(this)))};var d6=new h,Ste=new M,tEt=new M,wte=new Le,Ite=new $,WSe=new he;function nEt(e,t,n){let i=M.clone(e.transform,Ste),r=At.eastNorthUpToFixedFrame(t,e._projection.ellipsoid,tEt);e._setTransform(r),h.clone(h.ZERO,e.position),n.heading=n.heading-P.PI_OVER_TWO;let o=Le.fromHeadingPitchRoll(n,wte),s=$.fromQuaternion(o,Ite);$.getColumn(s,0,e.direction),$.getColumn(s,2,e.up),h.cross(e.direction,e.up,e.right),e._setTransform(i),e._adjustOrthographicFrustum(!0)}function iEt(e,t,n,i){let r=M.clone(e.transform,Ste);if(e._setTransform(M.IDENTITY),!h.equals(t,e.positionWC)){if(i){let a=e._projection,c=a.ellipsoid.cartesianToCartographic(t,WSe);t=a.project(c,d6)}h.clone(t,e.position)}n.heading=n.heading-P.PI_OVER_TWO;let o=Le.fromHeadingPitchRoll(n,wte),s=$.fromQuaternion(o,Ite);$.getColumn(s,0,e.direction),$.getColumn(s,2,e.up),h.cross(e.direction,e.up,e.right),e._setTransform(r),e._adjustOrthographicFrustum(!0)}function rEt(e,t,n,i){let r=M.clone(e.transform,Ste);if(e._setTransform(M.IDENTITY),!h.equals(t,e.positionWC)){if(i){let c=e._projection,u=c.ellipsoid.cartesianToCartographic(t,WSe);t=c.project(u,d6)}U.clone(t,e.position);let o=-t.z*.5,s=-o,a=e.frustum;if(s>o){let c=a.top/a.right;a.right=s,a.left=o,a.top=a.right*c,a.bottom=-a.top}}if(e._scene.mapMode2D===Vu.ROTATE){n.heading=n.heading-P.PI_OVER_TWO,n.pitch=-P.PI_OVER_TWO,n.roll=0;let o=Le.fromHeadingPitchRoll(n,wte),s=$.fromQuaternion(o,Ite);$.getColumn(s,2,e.up),h.cross(e.direction,e.up,e.right)}e._setTransform(r)}var oEt=new h,sEt=new h,aEt=new h;function qSe(e,t,n,i){let r=h.clone(n.direction,oEt),o=h.clone(n.up,sEt);if(e._scene.mode===re.SCENE3D){let a=e._projection.ellipsoid,c=At.eastNorthUpToFixedFrame(t,a,u6),u=M.inverseTransformation(c,f6);M.multiplyByPointAsVector(u,r,r),M.multiplyByPointAsVector(u,o,o)}let s=h.cross(r,o,aEt);return i.heading=VSe(r,o),i.pitch=jSe(r),i.roll=HSe(r,o,s),i}var vte={destination:void 0,orientation:{direction:void 0,up:void 0,heading:void 0,pitch:void 0,roll:void 0},convert:void 0,endTransform:void 0},KS=new kc;an.prototype.setView=function(e){e=e??H.EMPTY_OBJECT;let t=e.orientation??H.EMPTY_OBJECT,n=this._mode;if(n===re.MORPHING)return;l(e.endTransform)&&this._setTransform(e.endTransform);let i=e.convert??!0,r=e.destination??h.clone(this.positionWC,d6);l(r)&&l(r.west)&&(r=this.getRectangleCameraCoordinates(r,d6),i=!1),l(t.direction)&&(t=qSe(this,r,t,vte.orientation)),KS.heading=t.heading??0,KS.pitch=t.pitch??-P.PI_OVER_TWO,KS.roll=t.roll??0,n===re.SCENE3D?nEt(this,r,KS):n===re.SCENE2D?rEt(this,r,KS,i):iEt(this,r,KS,i)};var cEt=new h;an.prototype.flyHome=function(e){let t=this._mode;if(t===re.MORPHING&&this._scene.completeMorph(),t===re.SCENE2D)this.flyTo({destination:an.DEFAULT_VIEW_RECTANGLE,duration:e,endTransform:M.IDENTITY});else if(t===re.SCENE3D){let n=this.getRectangleCameraCoordinates(an.DEFAULT_VIEW_RECTANGLE),i=h.magnitude(n);i+=i*an.DEFAULT_VIEW_FACTOR,h.normalize(n,n),h.multiplyByScalar(n,i,n),this.flyTo({destination:n,duration:e,endTransform:M.IDENTITY})}else if(t===re.COLUMBUS_VIEW){let n=this._projection.ellipsoid.maximumRadius,i=new h(0,-1,1);i=h.multiplyByScalar(h.normalize(i,i),5*n,i),this.flyTo({destination:i,duration:e,orientation:{heading:0,pitch:-Math.acos(h.normalize(i,cEt).z),roll:0},endTransform:M.IDENTITY,convert:!1})}};an.prototype.worldToCameraCoordinates=function(e,t){return l(t)||(t=new se),ll(this),M.multiplyByVector(this._actualInvTransform,e,t)};an.prototype.worldToCameraCoordinatesPoint=function(e,t){return l(t)||(t=new h),ll(this),M.multiplyByPoint(this._actualInvTransform,e,t)};an.prototype.worldToCameraCoordinatesVector=function(e,t){return l(t)||(t=new h),ll(this),M.multiplyByPointAsVector(this._actualInvTransform,e,t)};an.prototype.cameraToWorldCoordinates=function(e,t){return l(t)||(t=new se),ll(this),M.multiplyByVector(this._actualTransform,e,t)};an.prototype.cameraToWorldCoordinatesPoint=function(e,t){return l(t)||(t=new h),ll(this),M.multiplyByPoint(this._actualTransform,e,t)};an.prototype.cameraToWorldCoordinatesVector=function(e,t){return l(t)||(t=new h),ll(this),M.multiplyByPointAsVector(this._actualTransform,e,t)};function YSe(e,t){let n=e._scene.mapMode2D===Vu.ROTATE,i=e._maxCoord.x,r=e._maxCoord.y,o,s;n?(s=i,o=-s):(s=t.x-i*2,o=t.x+i*2),t.x>i&&(t.x=s),t.x<-i&&(t.x=o),t.y>r&&(t.y=r),t.y<-r&&(t.y=-r)}var DSe=new h;an.prototype.move=function(e,t){let n=this.position;h.multiplyByScalar(e,t,DSe),h.add(n,DSe,n),this._mode===re.SCENE2D&&YSe(this,n),this._adjustOrthographicFrustum(!0)};an.prototype.moveForward=function(e){e=e??this.defaultMoveAmount,this._mode===re.SCENE2D?h6(this,e):this.move(this.direction,e)};an.prototype.moveBackward=function(e){e=e??this.defaultMoveAmount,this._mode===re.SCENE2D?h6(this,-e):this.move(this.direction,-e)};an.prototype.moveUp=function(e){e=e??this.defaultMoveAmount,this.move(this.up,e)};an.prototype.moveDown=function(e){e=e??this.defaultMoveAmount,this.move(this.up,-e)};an.prototype.moveRight=function(e){e=e??this.defaultMoveAmount,this.move(this.right,e)};an.prototype.moveLeft=function(e){e=e??this.defaultMoveAmount,this.move(this.right,-e)};an.prototype.lookLeft=function(e){e=e??this.defaultLookAmount,this._mode!==re.SCENE2D&&this.look(this.up,-e)};an.prototype.lookRight=function(e){e=e??this.defaultLookAmount,this._mode!==re.SCENE2D&&this.look(this.up,e)};an.prototype.lookUp=function(e){e=e??this.defaultLookAmount,this._mode!==re.SCENE2D&&this.look(this.right,-e)};an.prototype.lookDown=function(e){e=e??this.defaultLookAmount,this._mode!==re.SCENE2D&&this.look(this.right,e)};var lEt=new Le,uEt=new $;an.prototype.look=function(e,t){let n=t??this.defaultLookAmount,i=Le.fromAxisAngle(e,-n,lEt),r=$.fromQuaternion(i,uEt),o=this.direction,s=this.up,a=this.right;$.multiplyByVector(r,o,o),$.multiplyByVector(r,s,s),$.multiplyByVector(r,a,a)};an.prototype.twistLeft=function(e){e=e??this.defaultLookAmount,this.look(this.direction,e)};an.prototype.twistRight=function(e){e=e??this.defaultLookAmount,this.look(this.direction,-e)};var fEt=new Le,dEt=new $;an.prototype.rotate=function(e,t){let n=t??this.defaultRotateAmount,i=Le.fromAxisAngle(e,-n,fEt),r=$.fromQuaternion(i,dEt);$.multiplyByVector(r,this.position,this.position),$.multiplyByVector(r,this.direction,this.direction),$.multiplyByVector(r,this.up,this.up),h.cross(this.direction,this.up,this.right),h.cross(this.right,this.direction,this.up),this._adjustOrthographicFrustum(!1)};an.prototype.rotateDown=function(e){e=e??this.defaultRotateAmount,XSe(this,e)};an.prototype.rotateUp=function(e){e=e??this.defaultRotateAmount,XSe(this,-e)};var hEt=new h,mEt=new h,pEt=new h,RSe=new h;function XSe(e,t){let n=e.position;if(l(e.constrainedAxis)&&!h.equalsEpsilon(e.position,h.ZERO,P.EPSILON2)){let i=h.normalize(n,hEt),r=h.equalsEpsilon(i,e.constrainedAxis,P.EPSILON2),o=h.equalsEpsilon(i,h.negate(e.constrainedAxis,RSe),P.EPSILON2);if(!r&&!o){let s=h.normalize(e.constrainedAxis,mEt),a=h.dot(i,s),c=P.acosClamped(a);t>0&&t>c&&(t=c-P.EPSILON4),a=h.dot(i,h.negate(s,RSe)),c=P.acosClamped(a),t<0&&-t>c&&(t=-c+P.EPSILON4);let u=h.cross(s,i,pEt);e.rotate(u,t)}else(r&&t<0||o&&t>0)&&e.rotate(e.right,t)}else e.rotate(e.right,t)}an.prototype.rotateRight=function(e){e=e??this.defaultRotateAmount,KSe(this,-e)};an.prototype.rotateLeft=function(e){e=e??this.defaultRotateAmount,KSe(this,e)};function KSe(e,t){l(e.constrainedAxis)?e.rotate(e.constrainedAxis,t):e.rotate(e.up,t)}function h6(e,t){let n=e.frustum,i;if(t=t*.5,Math.abs(n.top)+Math.abs(n.bottom)>Math.abs(n.left)+Math.abs(n.right)){let r=n.top-t,o=n.bottom+t,s=e._maxCoord.y;e._scene.mapMode2D===Vu.ROTATE&&(s*=e.maximumZoomFactor),o>s&&(o=s,r=-s),r<=o&&(r=1,o=-1),i=n.right/n.top,n.top=r,n.bottom=o,n.right=n.top*i,n.left=-n.right}else{let r=n.right-t,o=n.left+t,s=e._maxCoord.x;e._scene.mapMode2D===Vu.ROTATE&&(s*=e.maximumZoomFactor),r>s&&(r=s,o=-s),r<=o&&(r=1,o=-1),i=n.top/n.right,n.right=r,n.left=o,n.top=n.right*i,n.bottom=-n.top}}function $Se(e,t){e.move(e.direction,t)}an.prototype.zoomIn=function(e){e=e??this.defaultZoomAmount,this._mode===re.SCENE2D?h6(this,e):$Se(this,e)};an.prototype.zoomOut=function(e){e=e??this.defaultZoomAmount,this._mode===re.SCENE2D?h6(this,-e):$Se(this,-e)};an.prototype.getMagnitude=function(){if(this._mode===re.SCENE3D)return h.magnitude(this.position);if(this._mode===re.COLUMBUS_VIEW)return Math.abs(this.position.z);if(this._mode===re.SCENE2D)return Math.max(this.frustum.right-this.frustum.left,this.frustum.top-this.frustum.bottom)};var gEt=new M;an.prototype.lookAt=function(e,t){let i=this._scene.ellipsoid??ee.default,r=At.eastNorthUpToFixedFrame(e,i,gEt);this.lookAtTransform(r,t)};var _Et=new h,yEt=new Le,AEt=new Le,bEt=new $;function JSe(e,t,n,i){t=P.clamp(t,-P.PI_OVER_TWO,P.PI_OVER_TWO),e=P.zeroToTwoPi(e)-P.PI_OVER_TWO;let r=Le.fromAxisAngle(h.UNIT_Y,-t,yEt),o=Le.fromAxisAngle(h.UNIT_Z,-e,AEt),s=Le.multiply(o,r,o),a=$.fromQuaternion(s,bEt),c=h.clone(h.UNIT_X,i);return $.multiplyByVector(a,c,c),h.negate(c,c),h.multiplyByScalar(c,n,c),c}an.prototype.lookAtTransform=function(e,t){if(this._setTransform(e),!l(t))return;let n;if(l(t.heading)?n=JSe(t.heading,t.pitch,t.range,_Et):n=t,this._mode===re.SCENE2D){U.clone(U.ZERO,this.position),h.negate(n,this.up),this.up.z=0,h.magnitudeSquared(this.up)<P.EPSILON10&&h.clone(h.UNIT_Y,this.up),h.normalize(this.up,this.up),this._setTransform(M.IDENTITY),h.negate(h.UNIT_Z,this.direction),h.cross(this.direction,this.up,this.right),h.normalize(this.right,this.right);let i=this.frustum,r=i.top/i.right;i.right=h.magnitude(n)*.5,i.left=-i.right,i.top=r*i.right,i.bottom=-i.top,this._setTransform(e);return}h.clone(n,this.position),h.negate(this.position,this.direction),h.normalize(this.direction,this.direction),h.cross(this.direction,h.UNIT_Z,this.right),h.magnitudeSquared(this.right)<P.EPSILON10&&h.clone(h.UNIT_X,this.right),h.normalize(this.right,this.right),h.cross(this.right,this.direction,this.up),h.normalize(this.up,this.up),this._adjustOrthographicFrustum(!0)};var xEt=new M,OSe=new h,TEt=new h,MSe=new h;an.prototype.lookAtWorldPosition=function(e,t=ee.default){let n=M.clone(this._transform,xEt);this._setTransform(M.IDENTITY);let i=h.subtract(e,this.positionWC,OSe);h.magnitudeSquared(i)<P.EPSILON8&&(i=h.clone(this.directionWC,OSe)),i=h.normalize(i,this.direction);let r=t.geodeticSurfaceNormal(e,TEt),o=h.cross(i,r,MSe);h.magnitudeSquared(o)<P.EPSILON8&&(o=h.clone(this.rightWC,MSe)),h.normalize(o,this.right);let s=h.cross(o,i,this.up);h.normalize(s,this.up),this._setTransform(n)};var DR=new he,EEt=new he,CEt=new h,vEt=new h,SEt=new h,wEt=new h,IEt=new h,PEt=new h,DEt=new h,Tte=new h,REt={direction:new h,right:new h,up:new h},NSe;function cl(e,t,n,i){return Math.abs(h.dot(t,n))/i-h.dot(e,n)}function ZSe(e,t,n,i){let r=e._projection.ellipsoid,o=i?e:REt,{north:s,south:a,west:c}=t,{east:u}=t;c>u&&(u+=P.TWO_PI);let f=(c+u)*.5,d;if(a<-P.PI_OVER_TWO+P.RADIANS_PER_DEGREE&&s>P.PI_OVER_TWO-P.RADIANS_PER_DEGREE)d=0;else{let O=DR;O.longitude=f,O.latitude=s,O.height=0;let L=EEt;L.longitude=f,L.latitude=a,L.height=0;let _=NSe;(!l(_)||_.ellipsoid!==r)&&(NSe=_=new z_(void 0,void 0,r)),_.setEndPoints(O,L),d=_.interpolateUsingFraction(.5,DR).latitude}let p=DR;p.longitude=f,p.latitude=d,p.height=0;let g=r.cartographicToCartesian(p,DEt),m=DR;m.longitude=u,m.latitude=s;let y=r.cartographicToCartesian(m,CEt);m.longitude=c;let A=r.cartographicToCartesian(m,SEt);m.longitude=f;let b=r.cartographicToCartesian(m,IEt);m.latitude=a;let x=r.cartographicToCartesian(m,PEt);m.longitude=u;let T=r.cartographicToCartesian(m,wEt);m.longitude=c;let E=r.cartographicToCartesian(m,vEt);h.subtract(A,g,A),h.subtract(T,g,T),h.subtract(y,g,y),h.subtract(E,g,E),h.subtract(b,g,b),h.subtract(x,g,x);let v=r.geodeticSurfaceNormal(g,o.direction);h.negate(v,v);let S=h.cross(v,h.UNIT_Z,o.right);h.normalize(S,S);let I=h.cross(S,v,o.up),R;if(e.frustum instanceof _n){let O=Math.max(h.distance(y,A),h.distance(T,E)),L=Math.max(h.distance(y,T),h.distance(A,E)),_,C,w=e.frustum._offCenterFrustum,D=w.right/w.top,N=L*D;O>N?(_=O,C=_/D):(C=L,_=N),R=Math.max(_,C)}else{let O=Math.tan(e.frustum.fovy*.5),L=e.frustum.aspectRatio*O;if(R=Math.max(cl(v,I,A,O),cl(v,I,T,O),cl(v,I,y,O),cl(v,I,E,O),cl(v,I,b,O),cl(v,I,x,O),cl(v,S,A,L),cl(v,S,T,L),cl(v,S,y,L),cl(v,S,E,L),cl(v,S,b,L),cl(v,S,x,L)),a<0&&s>0){let _=DR;_.longitude=c,_.latitude=0,_.height=0;let C=r.cartographicToCartesian(_,Tte);h.subtract(C,g,C),R=Math.max(R,cl(v,I,C,O),cl(v,S,C,L)),_.longitude=u,C=r.cartographicToCartesian(_,Tte),h.subtract(C,g,C),R=Math.max(R,cl(v,I,C,O),cl(v,S,C,L))}}return h.add(g,h.multiplyByScalar(v,-R,Tte),n)}var OEt=new he,MEt=new h,NEt=new h;function LEt(e,t,n){let i=e._projection;t.west>t.east&&(t=ie.MAX_VALUE);let r=e._actualTransform,o=e._actualInvTransform,s=OEt;s.longitude=t.east,s.latitude=t.north;let a=i.project(s,MEt);M.multiplyByPoint(r,a,a),M.multiplyByPoint(o,a,a),s.longitude=t.west,s.latitude=t.south;let c=i.project(s,NEt);if(M.multiplyByPoint(r,c,c),M.multiplyByPoint(o,c,c),n.x=(a.x-c.x)*.5+c.x,n.y=(a.y-c.y)*.5+c.y,l(e.frustum.fovy)){let u=Math.tan(e.frustum.fovy*.5),f=e.frustum.aspectRatio*u;n.z=Math.max((a.x-c.x)/f,(a.y-c.y)/u)*.5}else{let u=a.x-c.x,f=a.y-c.y;n.z=Math.max(u,f)}return n}var FEt=new he,BEt=new h,kEt=new h;function UEt(e,t,n){let i=e._projection,r=t.east;t.west>t.east&&(e._scene.mapMode2D===Vu.INFINITE_SCROLL?r+=P.TWO_PI:(t=ie.MAX_VALUE,r=t.east));let o=FEt;o.longitude=r,o.latitude=t.north;let s=i.project(o,BEt);o.longitude=t.west,o.latitude=t.south;let a=i.project(o,kEt),c=Math.abs(s.x-a.x)*.5,u=Math.abs(s.y-a.y)*.5,f,d,p=e.frustum.right/e.frustum.top,g=u*p;return c>g?(f=c,d=f/p):(d=u,f=g),u=Math.max(2*f,2*d),n.x=(s.x-a.x)*.5+a.x,n.y=(s.y-a.y)*.5+a.y,o=i.unproject(n,o),o.height=u,n=i.project(o,n),n}an.prototype.getRectangleCameraCoordinates=function(e,t){let n=this._mode;if(l(t)||(t=new h),n===re.SCENE3D)return ZSe(this,e,t);if(n===re.COLUMBUS_VIEW)return LEt(this,e,t);if(n===re.SCENE2D)return UEt(this,e,t)};var zEt=new gn;function VEt(e,t,n,i){n=n??ee.default;let r=e.getPickRay(t,zEt),o=xi.rayEllipsoid(r,n);if(!o)return;let s=o.start>0?o.start:o.stop;return gn.getPoint(r,s,i)}var jEt=new gn;function HEt(e,t,n,i){let o=e.getPickRay(t,jEt).origin;o=h.fromElements(o.y,o.z,0,o);let s=n.unproject(o);if(!(s.latitude<-P.PI_OVER_TWO||s.latitude>P.PI_OVER_TWO))return n.ellipsoid.cartographicToCartesian(s,i)}var GEt=new gn;function WEt(e,t,n,i){let r=e.getPickRay(t,GEt),o=-r.origin.x/r.direction.x;gn.getPoint(r,o,i);let s=n.unproject(new h(i.y,i.z,0));if(!(s.latitude<-P.PI_OVER_TWO||s.latitude>P.PI_OVER_TWO||s.longitude<-Math.PI||s.longitude>Math.PI))return n.ellipsoid.cartographicToCartesian(s,i)}an.prototype.pickEllipsoid=function(e,t,n){let i=this._scene.canvas;if(!(i.clientWidth===0||i.clientHeight===0)){if(l(n)||(n=new h),t=t??ee.default,this._mode===re.SCENE3D)n=VEt(this,e,t,n);else if(this._mode===re.SCENE2D)n=HEt(this,e,this._projection,n);else if(this._mode===re.COLUMBUS_VIEW)n=WEt(this,e,this._projection,n);else return;return n}};var qEt=new h,YEt=new h,XEt=new h;function KEt(e,t,n){let i=e._scene.canvas,r=i.clientWidth,o=i.clientHeight,s=Math.tan(e.frustum.fovy*.5),a=e.frustum.aspectRatio*s,c=e.frustum.near,u=2/r*t.x-1,f=2/o*(o-t.y)-1,d=e.positionWC;h.clone(d,n.origin);let p=h.multiplyByScalar(e.directionWC,c,qEt);h.add(d,p,p);let g=h.multiplyByScalar(e.rightWC,u*c*a,YEt),m=h.multiplyByScalar(e.upWC,f*c*s,XEt),y=h.add(p,g,n.direction);return h.add(y,m,y),h.subtract(y,d,y),h.normalize(y,y),n}var c6=new h;function $Et(e,t,n){let i=e._scene.canvas,r=i.clientWidth,o=i.clientHeight,s=e.frustum,a=s.offCenterFrustum;l(a)&&(s=a);let c=2/r*t.x-1;c*=(s.right-s.left)*.5;let u=2/o*(o-t.y)-1;u*=(s.top-s.bottom)*.5;let f=n.origin;if(h.clone(e.positionWC,f),h.multiplyByScalar(e.rightWC,c,c6),h.add(c6,f,f),h.multiplyByScalar(e.upWC,u,c6),h.add(c6,f,f),h.clone(e.directionWC,n.direction),e._mode===re.SCENE2D&&e._scene.mapMode2D===Vu.INFINITE_SCROLL){let d=e._maxCoord.x;f.y=P.mod(f.y+d,2*d)-d}return n}an.prototype.getPickRay=function(e,t){l(t)||(t=new gn);let n=this._scene.canvas;if(n.clientWidth<=0||n.clientHeight<=0)return;let i=this.frustum;return l(i.aspectRatio)&&l(i.fov)&&l(i.near)?KEt(this,e,t):$Et(this,e,t)};var JEt=new h,ZEt=new h;an.prototype.distanceToBoundingSphere=function(e){let t=h.subtract(this.positionWC,e.center,JEt),n=h.multiplyByScalar(this.directionWC,h.dot(t,this.directionWC),ZEt);return Math.max(0,h.magnitude(n)-e.radius)};var QEt=new U;an.prototype.getPixelSize=function(e,t,n){let i=this.distanceToBoundingSphere(e),r=this.frustum.getPixelDimensions(t,n,i,this._scene.pixelRatio,QEt);return Math.max(r.x,r.y)};function eCt(e,t,n,i,r,o){let s=h.clone(t);n.y>i?s.y-=n.y-i:n.y<-i&&(s.y+=-i-n.y),n.z>r?s.z-=n.z-r:n.z<-r&&(s.z+=-r-n.z);function a(c){let u=h.lerp(t,s,c.time,new h);e.worldToCameraCoordinatesPoint(u,e.position)}return{easingFunction:ks.EXPONENTIAL_OUT,startObject:{time:0},stopObject:{time:1},duration:o,update:a}}var tCt=new h,LSe=new h,nCt=new h,iCt=new h;function rCt(e,t){let n=e.position,i=e.direction,r=e.worldToCameraCoordinatesVector(h.UNIT_X,tCt),o=-h.dot(r,n)/h.dot(r,i),s=h.add(n,h.multiplyByScalar(i,o,LSe),LSe);e.cameraToWorldCoordinatesPoint(s,s),n=e.cameraToWorldCoordinatesPoint(e.position,nCt);let a=Math.tan(e.frustum.fovy*.5),c=e.frustum.aspectRatio*a,u=h.magnitude(h.subtract(n,s,iCt)),f=c*u,d=a*u,p=e._maxCoord.x,g=e._maxCoord.y,m=Math.max(f-p,p),y=Math.max(d-g,g);if(n.z<-m||n.z>m||n.y<-y||n.y>y){let A=s.y<-m||s.y>m,b=s.z<-y||s.z>y;if(A||b)return eCt(e,n,s,m,y,t)}}an.prototype.createCorrectPositionTween=function(e){if(this._mode===re.COLUMBUS_VIEW)return rCt(this,e)};var oCt=new h,Va={destination:void 0,heading:void 0,pitch:void 0,roll:void 0,duration:void 0,complete:void 0,cancel:void 0,endTransform:void 0,maximumHeight:void 0,easingFunction:void 0};an.prototype.cancelFlight=function(){l(this._currentFlight)&&(this._currentFlight.cancelTween(),this._currentFlight=void 0)};an.prototype.completeFlight=function(){if(l(this._currentFlight)){this._currentFlight.cancelTween();let e={destination:void 0,orientation:{heading:void 0,pitch:void 0,roll:void 0}};e.destination=Va.destination,e.orientation.heading=Va.heading,e.orientation.pitch=Va.pitch,e.orientation.roll=Va.roll,this.setView(e),l(this._currentFlight.complete)&&this._currentFlight.complete(),this._currentFlight=void 0}};an.prototype.flyTo=function(e){e=e??H.EMPTY_OBJECT;let t=e.destination;if(this._mode===re.MORPHING)return;this.cancelFlight();let i=t instanceof ie;i&&(t=this.getRectangleCameraCoordinates(t,oCt));let r=e.orientation??H.EMPTY_OBJECT;if(l(r.direction)&&(r=qSe(this,t,r,vte.orientation)),l(e.duration)&&e.duration<=0){let f=vte;f.destination=e.destination,f.orientation.heading=r.heading,f.orientation.pitch=r.pitch,f.orientation.roll=r.roll,f.convert=e.convert,f.endTransform=e.endTransform,this.setView(f),typeof e.complete=="function"&&e.complete();return}let o=this,s;Va.destination=t,Va.heading=r.heading,Va.pitch=r.pitch,Va.roll=r.roll,Va.duration=e.duration,Va.complete=function(){s===o._currentFlight&&(o._currentFlight=void 0),l(e.complete)&&e.complete()},Va.cancel=e.cancel,Va.endTransform=e.endTransform,Va.convert=i?!1:e.convert,Va.maximumHeight=e.maximumHeight,Va.pitchAdjustHeight=e.pitchAdjustHeight,Va.flyOverLongitude=e.flyOverLongitude,Va.flyOverLongitudeWeight=e.flyOverLongitudeWeight,Va.easingFunction=e.easingFunction;let a=this._scene,c=s6.createTween(a,Va);if(c.duration===0){typeof c.complete=="function"&&c.complete();return}s=a.tweens.add(c),this._currentFlight=s;let u=this._scene.preloadFlightCamera;this._mode!==re.SCENE2D&&(l(u)||(u=an.clone(this)),u.setView({destination:t,orientation:r}),this._scene.preloadFlightCullingVolume=u.frustum.computeCullingVolume(u.positionWC,u.directionWC,u.upWC))};function sCt(e,t){let n=e.frustum,i=Math.tan(n.fovy*.5),r=n.aspectRatio*i;return Math.max(t/r,t/i)}function aCt(e,t){let n=e.frustum,i=n.offCenterFrustum;l(i)&&(n=i);let r,o,s=n.right/n.top,a=t*s;return t>a?(r=t,o=r/s):(o=t,r=a),Math.max(r,o)*1.5}var cCt=100;function QSe(e,t,n){n=xh.clone(l(n)?n:an.DEFAULT_OFFSET);let i=e._scene.screenSpaceCameraController.minimumZoomDistance,r=e._scene.screenSpaceCameraController.maximumZoomDistance,o=n.range;if(!l(o)||o===0){let s=t.radius;s===0?n.range=cCt:e.frustum instanceof _n||e._mode===re.SCENE2D?n.range=aCt(e,s):n.range=sCt(e,s),n.range=P.clamp(n.range,i,r)}return n}an.prototype.viewBoundingSphere=function(e,t){t=QSe(this,e,t),this.lookAt(e.center,t)};var lCt=new M,FSe=new h,uCt=new h,fCt=new h,dCt=new h,hCt=new se,mCt=new Le,pCt=new $;an.prototype.flyToBoundingSphere=function(e,t){t=t??H.EMPTY_OBJECT;let n=this._mode===re.SCENE2D||this._mode===re.COLUMBUS_VIEW;this._setTransform(M.IDENTITY);let i=QSe(this,e,t.offset),r;n?r=h.multiplyByScalar(h.UNIT_Z,i.range,FSe):r=JSe(i.heading,i.pitch,i.range,FSe);let s=this._scene.ellipsoid??ee.default,a=At.eastNorthUpToFixedFrame(e.center,s,lCt);M.multiplyByPoint(a,r,r);let c,u;if(!n){if(c=h.subtract(e.center,r,uCt),h.normalize(c,c),u=M.multiplyByPointAsVector(a,h.UNIT_Z,fCt),1-Math.abs(h.dot(c,u))<P.EPSILON6){let d=Le.fromAxisAngle(c,i.heading,mCt),p=$.fromQuaternion(d,pCt);h.fromCartesian4(M.getColumn(a,1,hCt),u),$.multiplyByVector(p,u,u)}let f=h.cross(c,u,dCt);h.cross(f,c,u),h.normalize(u,u)}this.flyTo({destination:r,orientation:{direction:c,up:u},duration:t.duration,complete:t.complete,cancel:t.cancel,endTransform:t.endTransform,maximumHeight:t.maximumHeight,easingFunction:t.easingFunction,flyOverLongitude:t.flyOverLongitude,flyOverLongitudeWeight:t.flyOverLongitudeWeight,pitchAdjustHeight:t.pitchAdjustHeight})};var BSe=new h,kSe=new h,Ete=new h,USe=new h,RR=[new h,new h,new h,new h];function gCt(e,t){let n=t.radii,i=e.positionWC,r=h.multiplyComponents(t.oneOverRadii,i,BSe),o=h.magnitude(r),s=h.normalize(r,kSe),a,c;h.equalsEpsilon(s,h.UNIT_Z,P.EPSILON10)?(a=new h(0,1,0),c=new h(0,0,1)):(a=h.normalize(h.cross(h.UNIT_Z,s,Ete),Ete),c=h.normalize(h.cross(s,a,USe),USe));let u=Math.sqrt(h.magnitudeSquared(r)-1),f=h.multiplyByScalar(s,1/o,BSe),d=u/o,p=h.multiplyByScalar(a,d,kSe),g=h.multiplyByScalar(c,d,Ete),m=h.add(f,g,RR[0]);h.subtract(m,p,m),h.multiplyComponents(n,m,m);let y=h.subtract(f,g,RR[1]);h.subtract(y,p,y),h.multiplyComponents(n,y,y);let A=h.subtract(f,g,RR[2]);h.add(A,p,A),h.multiplyComponents(n,A,A);let b=h.add(f,g,RR[3]);return h.add(b,p,b),h.multiplyComponents(n,b,b),RR}var Cte=new U,_Ct=new h,mA=[new he,new he,new he,new he];function l6(e,t,n,i,r,o){Cte.x=e,Cte.y=t;let s=i.pickEllipsoid(Cte,r,_Ct);return l(s)?(mA[n]=r.cartesianToCartographic(s,mA[n]),1):(mA[n]=r.cartesianToCartographic(o[n],mA[n]),0)}an.prototype.computeViewRectangle=function(e,t){e=e??ee.default;let n=this.frustum.computeCullingVolume(this.positionWC,this.directionWC,this.upWC),i=new ue(h.ZERO,e.maximumRadius);if(n.computeVisibility(i)===$t.OUTSIDE)return;let o=this._scene.canvas,s=o.clientWidth,a=o.clientHeight,c=0,u=gCt(this,e);if(c+=l6(0,0,0,this,e,u),c+=l6(0,a,1,this,e,u),c+=l6(s,a,2,this,e,u),c+=l6(s,0,3,this,e,u),c<2)return ie.MAX_VALUE;t=ie.fromCartographicArray(mA,t);let f=0,d=mA[3].longitude;for(let p=0;p<4;++p){let g=mA[p].longitude,m=Math.abs(g-d);m>P.PI?f+=P.TWO_PI-m:f+=m,d=g}return P.equalsEpsilon(Math.abs(f),P.TWO_PI,P.EPSILON9)&&(t.west=-P.PI,t.east=P.PI,mA[0].latitude>=0?t.north=P.PI_OVER_TWO:t.south=-P.PI_OVER_TWO),t};an.prototype.switchToPerspectiveFrustum=function(){if(this._mode===re.SCENE2D||this.frustum instanceof Ji)return;let e=this._scene;this.frustum=new Ji,this.frustum.aspectRatio=e.drawingBufferWidth/e.drawingBufferHeight,this.frustum.fov=P.toRadians(60)};an.prototype.switchToOrthographicFrustum=function(){if(this._mode===re.SCENE2D||this.frustum instanceof _n)return;let e=GSe(this),t=this._scene;this.frustum=new _n,this.frustum.aspectRatio=t.drawingBufferWidth/t.drawingBufferHeight,this.frustum.width=e};an.clone=function(e,t){return l(t)||(t=new an(e._scene)),h.clone(e.position,t.position),h.clone(e.direction,t.direction),h.clone(e.up,t.up),h.clone(e.right,t.right),M.clone(e._transform,t.transform),t._transformChanged=!0,t.frustum=e.frustum.clone(),t};var Nr=an;function yCt(e){this.pass=e.pass,this.commandList=e.commandList,this.camera=e.camera,this.cullingVolume=e.cullingVolume,this.ready=!1}var lm=yCt;var Pte=class{constructor(){this._controllers=[],this._needsUpdate=new Set}get controllerCount(){return this._controllers.length}registerController(t,n,i){let r=i??this.controllerCount;this._controllers.splice(r,0,t),this._needsUpdate.add(t),t.connectedCallback(n)}unregisterController(t,n){let i=this._controllers,r=i.indexOf(t);r!==-1&&(i.splice(r,1),t.disconnectedCallback(n))}update(t,n){for(let i of this._controllers)i.enabled&&(this._needsUpdate.has(i)&&(i.firstUpdate(t,n),this._needsUpdate.delete(i)),i.update(t,n))}},m6=Pte;var owe=js(ef(),1),ewe=576,ACt=100,OR="#ffffff",MR="#48b";function swe(e,t){this.credit=e,this.count=t??1}function bCt(e,t){let n=e.length;for(let i=0;i<n;i++){let r=e[i];if(It.equals(r,t))return!0}return!1}function xCt(e){let t=e._previousCesiumCredit,n=e._currentCesiumCredit;It.equals(n,t)||(l(t)&&e._cesiumCreditContainer.removeChild(t.element),l(n)&&e._cesiumCreditContainer.appendChild(n.element),e._previousCesiumCredit=n)}var awe="cesium-credit-delimiter";function twe(e){let t=document.createElement("span");return t.textContent=e,t.className=awe,t}function nwe(e,t){if(l(t)){let n=document.createElement(t);n._creditId=e._creditId,n.appendChild(e),e=n}return e}function iwe(e,t,n,i){let r=e.childNodes,o=-1;t.sort(function(s,a){return a.count-s.count});for(let s=0;s<t.length;++s){let a=t[s].credit;if(l(a)){if(o=s,l(n)&&(o*=2,s>0)){let u=o-1;if(r.length<=u)e.appendChild(twe(n));else{let f=r[u];f.className!==awe&&e.replaceChild(twe(n),f)}}let c=a.element;if(r.length<=o)e.appendChild(nwe(c,i));else{let u=r[o];u._creditId!==a._id&&e.replaceChild(nwe(c,i),u)}}}for(++o;o<r.length;)e.removeChild(r[o])}function TCt(e){let t=e._lightboxCredits,n=e.viewport.clientWidth,i=e.viewport.clientHeight;n!==e._lastViewportWidth&&(n<ewe?(t.className="cesium-credit-lightbox cesium-credit-lightbox-mobile",t.style.marginTop="0"):(t.className="cesium-credit-lightbox cesium-credit-lightbox-expanded",t.style.marginTop=`${Math.floor((i-t.clientHeight)*.5)}px`),e._lastViewportWidth=n),n>=ewe&&i!==e._lastViewportHeight&&(t.style.marginTop=`${Math.floor((i-t.clientHeight)*.5)}px`,e._lastViewportHeight=i)}function rwe(e){return function(t){t.key!=="Enter"&&t.key!==" "||(t.preventDefault(),t.stopPropagation(),e())}}function ECt(e){let t=` .cesium-credit-lightbox-overlay { display: none; z-index: 1; @@ -10085,19 +10085,19 @@ Url: ${e._contentHeader.uri}`,r++;let o={text:i.substring(1),position:n,font:`${ .cesium-credit-lightbox { background-color: #303336; - color: ${zO}; + color: ${OR}; position: relative; - min-height: ${Z1t}px; + min-height: ${ACt}px; margin: auto; } .cesium-credit-lightbox > ul > li a, .cesium-credit-lightbox > ul > li a:visited, .cesium-credit-wrapper a, .cesium-credit-wrapper a:visited { - color: ${zO}; + color: ${OR}; } .cesium-credit-lightbox > ul > li a:hover { - color: ${VO}; + color: ${MR}; } .cesium-credit-lightbox.cesium-credit-lightbox-expanded { border: 1px solid #444; @@ -10117,10 +10117,10 @@ Url: ${e._contentHeader.uri}`,r++;let o={text:i.substring(1),position:n,font:`${ position: absolute; top: 0; right: 6px; - color: ${zO}; + color: ${OR}; } .cesium-credit-lightbox-close:hover { - color: ${VO}; + color: ${MR}; } .cesium-credit-lightbox > ul { margin: 0; @@ -10139,20 +10139,20 @@ Url: ${e._contentHeader.uri}`,r++;let o={text:i.substring(1),position:n,font:`${ padding-left: 5px; cursor: pointer; text-decoration: underline; - color: ${zO}; + color: ${OR}; } .cesium-credit-expand-link:hover { - color: ${VO}; + color: ${MR}; } .cesium-credit-expand-link:focus-visible, .cesium-credit-lightbox-close:focus-visible { - outline: 2px solid ${VO}; + outline: 2px solid ${MR}; outline-offset: 2px; } .cesium-credit-text { - color: ${zO}; + color: ${OR}; } .cesium-credit-delimiter { @@ -10165,13 +10165,13 @@ Url: ${e._contentHeader.uri}`,r++;let o={text:i.substring(1),position:n,font:`${ } .cesium-credit-textContainer a:hover { - color: ${VO} + color: ${MR} } .cesium-credit-textContainer .cesium-credit-wrapper:first-of-type { padding-left: 5px; } -`;function n(o){if(o.shadowRoot)return o.shadowRoot;if(o.getRootNode){let s=o.getRootNode();if(s instanceof ShadowRoot)return s}}let i=n(e)??document.head,r=document.createElement("style");r.innerHTML=t,i.appendChild(r)}function Vo(e,t,n){let i=this;n=n??document.body;let r=document.createElement("div");r.className="cesium-credit-lightbox-overlay",n.appendChild(r);let o=document.createElement("div");o.className="cesium-credit-lightbox",o.setAttribute("role","dialog"),o.setAttribute("aria-modal","true"),o.setAttribute("aria-label","Data attribution"),r.appendChild(o);function s(y){o.contains(y.target)||i.hideLightbox()}r.addEventListener("click",s,!1);function a(y){y.key==="Escape"&&(y.preventDefault(),i.hideLightbox())}r.addEventListener("keydown",a,!1);let c=document.createElement("div");c.className="cesium-credit-lightbox-title",c.textContent="Data provided by:",o.appendChild(c);let u=document.createElement("a");u.onclick=this.hideLightbox.bind(this),u.onkeydown=eOe(this.hideLightbox.bind(this)),u.innerHTML="×",u.className="cesium-credit-lightbox-close",u.setAttribute("role","button"),u.setAttribute("tabindex","0"),u.setAttribute("aria-label","Close data attribution"),o.appendChild(u);let f=document.createElement("ul");o.appendChild(f);let d=document.createElement("div");d.className="cesium-credit-logoContainer",d.style.display="inline",e.appendChild(d);let p=document.createElement("div");p.className="cesium-credit-textContainer",p.style.display="inline",e.appendChild(p);let g=document.createElement("a");g.className="cesium-credit-expand-link",g.onclick=this.showLightbox.bind(this),g.onkeydown=eOe(this.showLightbox.bind(this)),g.textContent="Data attribution",g.setAttribute("role","button"),g.setAttribute("tabindex","0"),g.setAttribute("aria-haspopup","dialog"),g.setAttribute("aria-expanded","false"),e.appendChild(g),nRt(e);let m=It.clone(Vo.cesiumCredit);this._delimiter=t??"\u2022",this._screenContainer=p,this._cesiumCreditContainer=d,this._lastViewportHeight=void 0,this._lastViewportWidth=void 0,this._lightboxCredits=o,this._creditList=f,this._lightbox=r,this._hideLightbox=s,this._hideLightboxOnEscape=a,this._expandLink=g,this._closeButton=u,this._expanded=!1,this._staticCredits=[],this._cesiumCredit=m,this._previousCesiumCredit=void 0,this._currentCesiumCredit=m,this._creditDisplayElementPool=[],this._creditDisplayElementIndex=0,this._currentFrameCredits={screenCredits:new zt,lightboxCredits:new zt},this._defaultCredit=void 0,this.viewport=n,this.container=e}function rOe(e,t,n,i){i=i??1;let r=t.get(n.id);if(l(r))r.count<Number.MAX_VALUE&&(r.count+=i);else{let o=e._creditDisplayElementPool,s=e._creditDisplayElementPoolIndex;s<o.length?(r=o[s],r.credit=n,r.count=i):(r=new nOe(n,i),o.push(r)),++e._creditDisplayElementPoolIndex,t.set(n.id,r)}}Vo.prototype.addCreditToNextFrame=function(e){if(e.isIon()){l(this._defaultCredit)||(this._defaultCredit=It.clone(oOe())),this._currentCesiumCredit=this._defaultCredit;return}let t;e.showOnScreen?t=this._currentFrameCredits.screenCredits:t=this._currentFrameCredits.lightboxCredits,rOe(this,t,e)};Vo.prototype.addStaticCredit=function(e){let t=this._staticCredits;Q1t(t,e)||t.push(e)};Vo.prototype.removeStaticCredit=function(e){let t=this._staticCredits,n=t.indexOf(e);n!==-1&&t.splice(n,1)};Vo.prototype.showLightbox=function(){this._lightbox.style.display="block",this._expanded=!0,this._expandLink.setAttribute("aria-expanded","true"),this._closeButton.focus()};Vo.prototype.hideLightbox=function(){this._lightbox.style.display="none",this._expanded=!1,this._expandLink.setAttribute("aria-expanded","false"),this._expandLink.focus()};Vo.prototype.update=function(){this._expanded&&tRt(this)};Vo.prototype.beginFrame=function(){let e=this._currentFrameCredits;this._creditDisplayElementPoolIndex=0;let t=e.screenCredits,n=e.lightboxCredits;t.removeAll(),n.removeAll();let i=this._staticCredits;for(let r=0;r<i.length;++r){let o=i[r],s=o.showOnScreen?t:n;o.isIon()&&It.equals(Vo.cesiumCredit,this._cesiumCredit)||rOe(this,s,o,Number.MAX_VALUE)}It.equals(Vo.cesiumCredit,this._cesiumCredit)||(this._cesiumCredit=It.clone(Vo.cesiumCredit)),this._currentCesiumCredit=this._cesiumCredit};Vo.prototype.endFrame=function(){let e=this._currentFrameCredits.screenCredits.values;QRe(this._screenContainer,e,this._delimiter,void 0);let t=this._currentFrameCredits.lightboxCredits.values;this._expandLink.style.display=t.length>0?"inline":"none",QRe(this._creditList,t,void 0,"li"),eRt(this)};Vo.prototype.destroy=function(){return this._lightbox.removeEventListener("click",this._hideLightbox,!1),this._lightbox.removeEventListener("keydown",this._hideLightboxOnEscape,!1),this.container.removeChild(this._cesiumCreditContainer),this.container.removeChild(this._screenContainer),this.container.removeChild(this._expandLink),this.viewport.removeChild(this._lightbox),le(this)};Vo.prototype.isDestroyed=function(){return!1};Vo._cesiumCredit=void 0;Vo._cesiumCreditInitialized=!1;var PG;function oOe(){if(!l(PG)){let e=Zt("Assets/Images/ion-credit.png");e.indexOf("http://")!==0&&e.indexOf("https://")!==0&&e.indexOf("data:")!==0&&(e=new tOe.default(e).path()),PG=new It(`<a href="https://cesium.com/" target="_blank"><img src="${e}" style="vertical-align: -7px" title="Cesium ion"/></a>`,!0)}return Vo._cesiumCreditInitialized||(Vo._cesiumCredit=PG,Vo._cesiumCreditInitialized=!0),PG}Object.defineProperties(Vo,{cesiumCredit:{get:function(){return oOe(),Vo._cesiumCredit},set:function(e){Vo._cesiumCredit=e,Vo._cesiumCreditInitialized=!0}}});Vo.CreditDisplayElement=nOe;var DG=Vo;var RG=0,iRt=1;function DT(e){let t=e.frustum,n=e.orientation,i=e.origin,r=e.vertexFormat??Be.DEFAULT,o=e._drawNearPlane??!0,s,a;t instanceof er?(s=RG,a=er.packedLength):t instanceof _n&&(s=iRt,a=_n.packedLength),this._frustumType=s,this._frustum=t.clone(),this._origin=h.clone(i),this._orientation=Le.clone(n),this._drawNearPlane=o,this._vertexFormat=r,this._workerName="createFrustumGeometry",this.packedLength=2+a+h.packedLength+Le.packedLength+Be.packedLength}DT.pack=function(e,t,n){n=n??0;let i=e._frustumType,r=e._frustum;return t[n++]=i,i===RG?(er.pack(r,t,n),n+=er.packedLength):(_n.pack(r,t,n),n+=_n.packedLength),h.pack(e._origin,t,n),n+=h.packedLength,Le.pack(e._orientation,t,n),n+=Le.packedLength,Be.pack(e._vertexFormat,t,n),n+=Be.packedLength,t[n]=e._drawNearPlane?1:0,t};var rRt=new er,oRt=new _n,sRt=new Le,aRt=new h,cRt=new Be;DT.unpack=function(e,t,n){t=t??0;let i=e[t++],r;i===RG?(r=er.unpack(e,t,rRt),t+=er.packedLength):(r=_n.unpack(e,t,oRt),t+=_n.packedLength);let o=h.unpack(e,t,aRt);t+=h.packedLength;let s=Le.unpack(e,t,sRt);t+=Le.packedLength;let a=Be.unpack(e,t,cRt);t+=Be.packedLength;let c=e[t]===1;if(!l(n))return new DT({frustum:r,origin:o,orientation:s,vertexFormat:a,_drawNearPlane:c});let u=i===n._frustumType?n._frustum:void 0;return n._frustum=r.clone(u),n._frustumType=i,n._origin=h.clone(o,n._origin),n._orientation=Le.clone(s,n._orientation),n._vertexFormat=Be.clone(a,n._vertexFormat),n._drawNearPlane=c,n};function jw(e,t,n,i,r,o,s,a){let c=e/3*2;for(let u=0;u<4;++u)l(t)&&(t[e]=o.x,t[e+1]=o.y,t[e+2]=o.z),l(n)&&(n[e]=s.x,n[e+1]=s.y,n[e+2]=s.z),l(i)&&(i[e]=a.x,i[e+1]=a.y,i[e+2]=a.z),e+=3;r[c]=0,r[c+1]=0,r[c+2]=1,r[c+3]=0,r[c+4]=1,r[c+5]=1,r[c+6]=0,r[c+7]=1}var lRt=new $,uRt=new M,Wre=new M,sOe=new h,aOe=new h,cOe=new h,fRt=new h,dRt=new h,hRt=new h,kA=new Array(3),jO=new Array(4);jO[0]=new se(-1,-1,1,1);jO[1]=new se(1,-1,1,1);jO[2]=new se(1,1,1,1);jO[3]=new se(-1,1,1,1);var lOe=new Array(4);for(let e=0;e<4;++e)lOe[e]=new se;DT._computeNearFarPlanes=function(e,t,n,i,r,o,s,a){let c=$.fromQuaternion(t,lRt),u=o??sOe,f=s??aOe,d=a??cOe;u=$.getColumn(c,0,u),f=$.getColumn(c,1,f),d=$.getColumn(c,2,d),h.normalize(u,u),h.normalize(f,f),h.normalize(d,d),h.negate(u,u);let p=M.computeView(e,d,f,u,uRt),g,m,y=i.projectionMatrix;if(n===RG){let A=M.multiply(y,p,Wre);m=M.inverse(A,Wre)}else g=M.inverseTransformation(p,Wre);l(m)?(kA[0]=i.near,kA[1]=i.far):(kA[0]=0,kA[1]=i.near,kA[2]=i.far);for(let A=0;A<2;++A)for(let b=0;b<4;++b){let x=se.clone(jO[b],lOe[b]);if(l(m)){x=M.multiplyByVector(m,x,x);let T=1/x.w;h.multiplyByScalar(x,T,x),h.subtract(x,e,x),h.normalize(x,x);let E=h.dot(d,x);h.multiplyByScalar(x,kA[A]/E,x),h.add(x,e,x)}else{let T=i.offCenterFrustum;l(T)&&(i=T);let E=kA[A],v=kA[A+1];x.x=(x.x*(i.right-i.left)+i.left+i.right)*.5,x.y=(x.y*(i.top-i.bottom)+i.bottom+i.top)*.5,x.z=(x.z*(E-v)-E-v)*.5,x.w=1,M.multiplyByVector(g,x,x)}r[12*A+b*3]=x.x,r[12*A+b*3+1]=x.y,r[12*A+b*3+2]=x.z}};DT.createGeometry=function(e){let t=e._frustumType,n=e._frustum,i=e._origin,r=e._orientation,o=e._drawNearPlane,s=e._vertexFormat,a=o?6:5,c=new Float64Array(72);DT._computeNearFarPlanes(i,r,t,n,c);let u=24;c[u]=c[12],c[u+1]=c[13],c[u+2]=c[14],c[u+3]=c[0],c[u+4]=c[1],c[u+5]=c[2],c[u+6]=c[9],c[u+7]=c[10],c[u+8]=c[11],c[u+9]=c[21],c[u+10]=c[22],c[u+11]=c[23],u+=12,c[u]=c[15],c[u+1]=c[16],c[u+2]=c[17],c[u+3]=c[3],c[u+4]=c[4],c[u+5]=c[5],c[u+6]=c[0],c[u+7]=c[1],c[u+8]=c[2],c[u+9]=c[12],c[u+10]=c[13],c[u+11]=c[14],u+=12,c[u]=c[3],c[u+1]=c[4],c[u+2]=c[5],c[u+3]=c[15],c[u+4]=c[16],c[u+5]=c[17],c[u+6]=c[18],c[u+7]=c[19],c[u+8]=c[20],c[u+9]=c[6],c[u+10]=c[7],c[u+11]=c[8],u+=12,c[u]=c[6],c[u+1]=c[7],c[u+2]=c[8],c[u+3]=c[18],c[u+4]=c[19],c[u+5]=c[20],c[u+6]=c[21],c[u+7]=c[22],c[u+8]=c[23],c[u+9]=c[9],c[u+10]=c[10],c[u+11]=c[11],o||(c=c.subarray(12));let f=new En({position:new Ne({componentDatatype:Y.DOUBLE,componentsPerAttribute:3,values:c})});if(l(s.normal)||l(s.tangent)||l(s.bitangent)||l(s.st)){let p=l(s.normal)?new Float32Array(12*a):void 0,g=l(s.tangent)?new Float32Array(12*a):void 0,m=l(s.bitangent)?new Float32Array(12*a):void 0,y=l(s.st)?new Float32Array(8*a):void 0,A=sOe,b=aOe,x=cOe,T=h.negate(A,fRt),E=h.negate(b,dRt),v=h.negate(x,hRt);u=0,o&&(jw(u,p,g,m,y,v,A,b),u+=12),jw(u,p,g,m,y,x,T,b),u+=12,jw(u,p,g,m,y,T,v,b),u+=12,jw(u,p,g,m,y,E,v,T),u+=12,jw(u,p,g,m,y,A,x,b),u+=12,jw(u,p,g,m,y,b,x,T),l(p)&&(f.normal=new Ne({componentDatatype:Y.FLOAT,componentsPerAttribute:3,values:p})),l(g)&&(f.tangent=new Ne({componentDatatype:Y.FLOAT,componentsPerAttribute:3,values:g})),l(m)&&(f.bitangent=new Ne({componentDatatype:Y.FLOAT,componentsPerAttribute:3,values:m})),l(y)&&(f.st=new Ne({componentDatatype:Y.FLOAT,componentsPerAttribute:2,values:y}))}let d=new Uint16Array(6*a);for(let p=0;p<a;++p){let g=p*6,m=p*4;d[g]=m,d[g+1]=m+1,d[g+2]=m+2,d[g+3]=m,d[g+4]=m+2,d[g+5]=m+3}return new wt({attributes:f,indices:d,primitiveType:Oe.TRIANGLES,boundingSphere:ue.fromVertices(c)})};var Hw=DT;var qre=0,mRt=1;function HO(e){let t=e.frustum,n=e.orientation,i=e.origin,r=e._drawNearPlane??!0,o,s;t instanceof er?(o=qre,s=er.packedLength):t instanceof _n&&(o=mRt,s=_n.packedLength),this._frustumType=o,this._frustum=t.clone(),this._origin=h.clone(i),this._orientation=Le.clone(n),this._drawNearPlane=r,this._workerName="createFrustumOutlineGeometry",this.packedLength=2+s+h.packedLength+Le.packedLength}HO.pack=function(e,t,n){n=n??0;let i=e._frustumType,r=e._frustum;return t[n++]=i,i===qre?(er.pack(r,t,n),n+=er.packedLength):(_n.pack(r,t,n),n+=_n.packedLength),h.pack(e._origin,t,n),n+=h.packedLength,Le.pack(e._orientation,t,n),n+=Le.packedLength,t[n]=e._drawNearPlane?1:0,t};var pRt=new er,gRt=new _n,_Rt=new Le,yRt=new h;HO.unpack=function(e,t,n){t=t??0;let i=e[t++],r;i===qre?(r=er.unpack(e,t,pRt),t+=er.packedLength):(r=_n.unpack(e,t,gRt),t+=_n.packedLength);let o=h.unpack(e,t,yRt);t+=h.packedLength;let s=Le.unpack(e,t,_Rt);t+=Le.packedLength;let a=e[t]===1;if(!l(n))return new HO({frustum:r,origin:o,orientation:s,_drawNearPlane:a});let c=i===n._frustumType?n._frustum:void 0;return n._frustum=r.clone(c),n._frustumType=i,n._origin=h.clone(o,n._origin),n._orientation=Le.clone(s,n._orientation),n._drawNearPlane=a,n};HO.createGeometry=function(e){let t=e._frustumType,n=e._frustum,i=e._origin,r=e._orientation,o=e._drawNearPlane,s=new Float64Array(24);Hw._computeNearFarPlanes(i,r,t,n,s);let a=new En({position:new Ne({componentDatatype:Y.DOUBLE,componentsPerAttribute:3,values:s})}),c,u,f=o?2:1,d=new Uint16Array(8*(f+1)),p=o?0:1;for(;p<2;++p)c=o?p*8:0,u=p*4,d[c]=u,d[c+1]=u+1,d[c+2]=u+1,d[c+3]=u+2,d[c+4]=u+2,d[c+5]=u+3,d[c+6]=u+3,d[c+7]=u;for(p=0;p<2;++p)c=(f+p)*8,u=p*4,d[c]=u,d[c+1]=u+4,d[c+2]=u+1,d[c+3]=u+5,d[c+4]=u+2,d[c+5]=u+6,d[c+6]=u+3,d[c+7]=u+7;return new wt({attributes:a,indices:d,primitiveType:Oe.LINES,boundingSphere:ue.fromVertices(s)})};var OG=HO;function MG(e){e=e??H.EMPTY_OBJECT,this._camera=e.camera,this._frustumSplits=e.frustumSplits,this._color=e.color??z.CYAN,this._updateOnChange=e.updateOnChange??!0,this.show=e.show??!0,this.id=e.id,this._id=void 0,this._outlinePrimitives=[],this._planesPrimitives=[]}var ARt=new h,bRt=new $,xRt=new Le,TRt=new er,ERt=new Wu,CRt=new _n,vRt=new Ss,SRt=new z,wRt=[1,1e5];MG.prototype.update=function(e){if(!this.show)return;let t=this._planesPrimitives,n=this._outlinePrimitives,i,r;if(this._updateOnChange){for(r=t.length,i=0;i<r;++i)n[i]=n[i]&&n[i].destroy(),t[i]=t[i]&&t[i].destroy();t.length=0,n.length=0}if(t.length===0){let o=this._camera,s=o.frustum,a;s instanceof er?a=TRt:s instanceof Wu?a=ERt:s instanceof _n?a=CRt:a=vRt,a=s.clone(a);let c,u=this._frustumSplits;!l(u)||u.length<=1?(u=wRt,u[0]=this._camera.frustum.near,u[1]=this._camera.frustum.far,c=1):c=u.length-1;let f=o.positionWC,d=o.directionWC,p=o.upWC,g=o.rightWC;g=h.negate(g,ARt);let m=bRt;$.setColumn(m,0,g,m),$.setColumn(m,1,p,m),$.setColumn(m,2,d,m);let y=Le.fromRotationMatrix(m,xRt);for(t.length=n.length=c,i=0;i<c;++i)a.near=u[i],a.far=u[i+1],t[i]=new Mn({geometryInstances:new Bt({geometry:new Hw({origin:f,orientation:y,frustum:a,_drawNearPlane:i===0}),attributes:{color:Jt.fromColor(z.fromAlpha(this._color,.1,SRt))},id:this.id,pickPrimitive:this}),appearance:new An({translucent:!0,flat:!0}),asynchronous:!1}),n[i]=new Mn({geometryInstances:new Bt({geometry:new OG({origin:f,orientation:y,frustum:a,_drawNearPlane:i===0}),attributes:{color:Jt.fromColor(this._color)},id:this.id,pickPrimitive:this}),appearance:new An({translucent:!1,flat:!0}),asynchronous:!1})}for(r=t.length,i=0;i<r;++i)n[i].update(e),t[i].update(e)};MG.prototype.isDestroyed=function(){return!1};MG.prototype.destroy=function(){let e=this._planesPrimitives.length;for(let t=0;t<e;++t)this._outlinePrimitives[t]=this._outlinePrimitives[t]&&this._outlinePrimitives[t].destroy(),this._planesPrimitives[t]=this._planesPrimitives[t]&&this._planesPrimitives[t].destroy();return le(this)};var n_=MG;function WO(e){this._rs=void 0,this._sp=void 0,this._va=void 0,this._command=void 0,this._mode=void 0,this._useLogDepth=!1,this._ellipsoidOffset=e??0}var GO=dn.supportsTypedArrays()?new Float32Array(12):[],uOe=new h,fOe=new h,Yre=new h,dOe=new h,NG=new h;function IRt(e,t){let n=e.radii,i=t.camera,r,o,s;if(i.frustum instanceof _n)r=h.ZERO,o=i.rightWC,s=i.upWC;else{let d=i.positionWC,p=h.multiplyComponents(e.oneOverRadii,d,uOe),g=h.normalize(p,fOe),m=h.normalize(h.cross(h.UNIT_Z,p,Yre),Yre),y=h.normalize(h.cross(g,m,dOe),dOe),A=h.magnitude(p),b=Math.sqrt(A*A-1);r=h.multiplyByScalar(g,1/A,uOe);let x=b/A;o=h.multiplyByScalar(m,x,fOe),s=h.multiplyByScalar(y,x,Yre)}let a=h.add(r,s,NG);h.subtract(a,o,a),h.multiplyComponents(n,a,a),h.pack(a,GO,0);let c=h.subtract(r,s,NG);h.subtract(c,o,c),h.multiplyComponents(n,c,c),h.pack(c,GO,3);let u=h.add(r,s,NG);h.add(u,o,u),h.multiplyComponents(n,u,u),h.pack(u,GO,6);let f=h.subtract(r,s,NG);return h.add(f,o,f),h.multiplyComponents(n,f,f),h.pack(f,GO,9),GO}WO.prototype.update=function(e){if(this._mode=e.mode,e.mode!==re.SCENE3D)return;let t=e.context,n=e.mapProjection.ellipsoid.radii,i=new ee(n.x+this._ellipsoidOffset,n.y+this._ellipsoidOffset,n.z+this._ellipsoidOffset),r=e.useLogDepth;if(l(this._command)||(this._rs=Ge.fromCache({cull:{enabled:!0},depthTest:{enabled:!0},colorMask:{red:!1,green:!1,blue:!1,alpha:!1}}),this._command=new at({renderState:this._rs,boundingVolume:new ue(h.ZERO,i.maximumRadius),pass:Ie.OPAQUE,owner:this})),!l(this._sp)||this._useLogDepth!==r){this._useLogDepth=r;let s=new Xe({sources:[N2]}),a=new Xe({sources:[M2]});r&&(a.defines.push("LOG_DEPTH"),s.defines.push("LOG_DEPTH")),this._sp=Qt.replaceCache({shaderProgram:this._sp,context:t,vertexShaderSource:s,fragmentShaderSource:a,attributeLocations:{position:0}}),this._command.shaderProgram=this._sp}let o=IRt(i,e);if(l(this._va))this._va.getAttribute(0).vertexBuffer.copyFromArrayView(o);else{let s=new wt({attributes:{position:new Ne({componentDatatype:Y.FLOAT,componentsPerAttribute:3,values:o})},indices:[0,1,2,2,1,3],primitiveType:Oe.TRIANGLES});this._va=Vn.fromGeometry({context:t,geometry:s,attributeLocations:{position:0},bufferUsage:Me.DYNAMIC_DRAW}),this._command.vertexArray=this._va}};WO.prototype.execute=function(e,t){this._mode===re.SCENE3D&&this._command.execute(e,t)};WO.prototype.isDestroyed=function(){return!1};WO.prototype.destroy=function(){this._sp=this._sp&&this._sp.destroy(),this._va=this._va&&this._va.destroy()};var LG=WO;function RT(){}var PRt=/\bgl_FragDepth\b/,DRt=/\bdiscard\b/;function RRt(e,t){let n=e.shaderCache.getDerivedShaderProgram(t,"depthOnly");if(l(n))return n;let i=t.fragmentShaderSource,r=!1,o=i.sources;for(let a=0;a<o.length;++a)if(PRt.test(o[a])||DRt.test(o[a])){r=!0;break}let s=i.defines.indexOf("LOG_DEPTH")>=0;if(!r&&!s){let a=`void main() +`;function n(o){if(o.shadowRoot)return o.shadowRoot;if(o.getRootNode){let s=o.getRootNode();if(s instanceof ShadowRoot)return s}}let i=n(e)??document.head,r=document.createElement("style");r.innerHTML=t,i.appendChild(r)}function zo(e,t,n){let i=this;n=n??document.body;let r=document.createElement("div");r.className="cesium-credit-lightbox-overlay",n.appendChild(r);let o=document.createElement("div");o.className="cesium-credit-lightbox",o.setAttribute("role","dialog"),o.setAttribute("aria-modal","true"),o.setAttribute("aria-label","Data attribution"),r.appendChild(o);function s(y){o.contains(y.target)||i.hideLightbox()}r.addEventListener("click",s,!1);function a(y){y.key==="Escape"&&(y.preventDefault(),i.hideLightbox())}r.addEventListener("keydown",a,!1);let c=document.createElement("div");c.className="cesium-credit-lightbox-title",c.textContent="Data provided by:",o.appendChild(c);let u=document.createElement("a");u.onclick=this.hideLightbox.bind(this),u.onkeydown=rwe(this.hideLightbox.bind(this)),u.innerHTML="×",u.className="cesium-credit-lightbox-close",u.setAttribute("role","button"),u.setAttribute("tabindex","0"),u.setAttribute("aria-label","Close data attribution"),o.appendChild(u);let f=document.createElement("ul");o.appendChild(f);let d=document.createElement("div");d.className="cesium-credit-logoContainer",d.style.display="inline",e.appendChild(d);let p=document.createElement("div");p.className="cesium-credit-textContainer",p.style.display="inline",e.appendChild(p);let g=document.createElement("a");g.className="cesium-credit-expand-link",g.onclick=this.showLightbox.bind(this),g.onkeydown=rwe(this.showLightbox.bind(this)),g.textContent="Data attribution",g.setAttribute("role","button"),g.setAttribute("tabindex","0"),g.setAttribute("aria-haspopup","dialog"),g.setAttribute("aria-expanded","false"),e.appendChild(g),ECt(e);let m=It.clone(zo.cesiumCredit);this._delimiter=t??"\u2022",this._screenContainer=p,this._cesiumCreditContainer=d,this._lastViewportHeight=void 0,this._lastViewportWidth=void 0,this._lightboxCredits=o,this._creditList=f,this._lightbox=r,this._hideLightbox=s,this._hideLightboxOnEscape=a,this._expandLink=g,this._closeButton=u,this._expanded=!1,this._staticCredits=[],this._cesiumCredit=m,this._previousCesiumCredit=void 0,this._currentCesiumCredit=m,this._creditDisplayElementPool=[],this._creditDisplayElementIndex=0,this._currentFrameCredits={screenCredits:new zt,lightboxCredits:new zt},this._defaultCredit=void 0,this.viewport=n,this.container=e}function cwe(e,t,n,i){i=i??1;let r=t.get(n.id);if(l(r))r.count<Number.MAX_VALUE&&(r.count+=i);else{let o=e._creditDisplayElementPool,s=e._creditDisplayElementPoolIndex;s<o.length?(r=o[s],r.credit=n,r.count=i):(r=new swe(n,i),o.push(r)),++e._creditDisplayElementPoolIndex,t.set(n.id,r)}}zo.prototype.addCreditToNextFrame=function(e){if(e.isIon()){l(this._defaultCredit)||(this._defaultCredit=It.clone(lwe())),this._currentCesiumCredit=this._defaultCredit;return}let t;e.showOnScreen?t=this._currentFrameCredits.screenCredits:t=this._currentFrameCredits.lightboxCredits,cwe(this,t,e)};zo.prototype.addStaticCredit=function(e){let t=this._staticCredits;bCt(t,e)||t.push(e)};zo.prototype.removeStaticCredit=function(e){let t=this._staticCredits,n=t.indexOf(e);n!==-1&&t.splice(n,1)};zo.prototype.showLightbox=function(){this._lightbox.style.display="block",this._expanded=!0,this._expandLink.setAttribute("aria-expanded","true"),this._closeButton.focus()};zo.prototype.hideLightbox=function(){this._lightbox.style.display="none",this._expanded=!1,this._expandLink.setAttribute("aria-expanded","false"),this._expandLink.focus()};zo.prototype.update=function(){this._expanded&&TCt(this)};zo.prototype.beginFrame=function(){let e=this._currentFrameCredits;this._creditDisplayElementPoolIndex=0;let t=e.screenCredits,n=e.lightboxCredits;t.removeAll(),n.removeAll();let i=this._staticCredits;for(let r=0;r<i.length;++r){let o=i[r],s=o.showOnScreen?t:n;o.isIon()&&It.equals(zo.cesiumCredit,this._cesiumCredit)||cwe(this,s,o,Number.MAX_VALUE)}It.equals(zo.cesiumCredit,this._cesiumCredit)||(this._cesiumCredit=It.clone(zo.cesiumCredit)),this._currentCesiumCredit=this._cesiumCredit};zo.prototype.endFrame=function(){let e=this._currentFrameCredits.screenCredits.values;iwe(this._screenContainer,e,this._delimiter,void 0);let t=this._currentFrameCredits.lightboxCredits.values;this._expandLink.style.display=t.length>0?"inline":"none",iwe(this._creditList,t,void 0,"li"),xCt(this)};zo.prototype.destroy=function(){return this._lightbox.removeEventListener("click",this._hideLightbox,!1),this._lightbox.removeEventListener("keydown",this._hideLightboxOnEscape,!1),this.container.removeChild(this._cesiumCreditContainer),this.container.removeChild(this._screenContainer),this.container.removeChild(this._expandLink),this.viewport.removeChild(this._lightbox),le(this)};zo.prototype.isDestroyed=function(){return!1};zo._cesiumCredit=void 0;zo._cesiumCreditInitialized=!1;var p6;function lwe(){if(!l(p6)){let e=Zt("Assets/Images/ion-credit.png");e.indexOf("http://")!==0&&e.indexOf("https://")!==0&&e.indexOf("data:")!==0&&(e=new owe.default(e).path()),p6=new It(`<a href="https://cesium.com/" target="_blank"><img src="${e}" style="vertical-align: -7px" title="Cesium ion"/></a>`,!0)}return zo._cesiumCreditInitialized||(zo._cesiumCredit=p6,zo._cesiumCreditInitialized=!0),p6}Object.defineProperties(zo,{cesiumCredit:{get:function(){return lwe(),zo._cesiumCredit},set:function(e){zo._cesiumCredit=e,zo._cesiumCreditInitialized=!0}}});zo.CreditDisplayElement=swe;var g6=zo;var _6=0,CCt=1;function nT(e){let t=e.frustum,n=e.orientation,i=e.origin,r=e.vertexFormat??Be.DEFAULT,o=e._drawNearPlane??!0,s,a;t instanceof Ji?(s=_6,a=Ji.packedLength):t instanceof _n&&(s=CCt,a=_n.packedLength),this._frustumType=s,this._frustum=t.clone(),this._origin=h.clone(i),this._orientation=Le.clone(n),this._drawNearPlane=o,this._vertexFormat=r,this._workerName="createFrustumGeometry",this.packedLength=2+a+h.packedLength+Le.packedLength+Be.packedLength}nT.pack=function(e,t,n){n=n??0;let i=e._frustumType,r=e._frustum;return t[n++]=i,i===_6?(Ji.pack(r,t,n),n+=Ji.packedLength):(_n.pack(r,t,n),n+=_n.packedLength),h.pack(e._origin,t,n),n+=h.packedLength,Le.pack(e._orientation,t,n),n+=Le.packedLength,Be.pack(e._vertexFormat,t,n),n+=Be.packedLength,t[n]=e._drawNearPlane?1:0,t};var vCt=new Ji,SCt=new _n,wCt=new Le,ICt=new h,PCt=new Be;nT.unpack=function(e,t,n){t=t??0;let i=e[t++],r;i===_6?(r=Ji.unpack(e,t,vCt),t+=Ji.packedLength):(r=_n.unpack(e,t,SCt),t+=_n.packedLength);let o=h.unpack(e,t,ICt);t+=h.packedLength;let s=Le.unpack(e,t,wCt);t+=Le.packedLength;let a=Be.unpack(e,t,PCt);t+=Be.packedLength;let c=e[t]===1;if(!l(n))return new nT({frustum:r,origin:o,orientation:s,vertexFormat:a,_drawNearPlane:c});let u=i===n._frustumType?n._frustum:void 0;return n._frustum=r.clone(u),n._frustumType=i,n._origin=h.clone(o,n._origin),n._orientation=Le.clone(s,n._orientation),n._vertexFormat=Be.clone(a,n._vertexFormat),n._drawNearPlane=c,n};function $S(e,t,n,i,r,o,s,a){let c=e/3*2;for(let u=0;u<4;++u)l(t)&&(t[e]=o.x,t[e+1]=o.y,t[e+2]=o.z),l(n)&&(n[e]=s.x,n[e+1]=s.y,n[e+2]=s.z),l(i)&&(i[e]=a.x,i[e+1]=a.y,i[e+2]=a.z),e+=3;r[c]=0,r[c+1]=0,r[c+2]=1,r[c+3]=0,r[c+4]=1,r[c+5]=1,r[c+6]=0,r[c+7]=1}var DCt=new $,RCt=new M,Dte=new M,uwe=new h,fwe=new h,dwe=new h,OCt=new h,MCt=new h,NCt=new h,pA=new Array(3),NR=new Array(4);NR[0]=new se(-1,-1,1,1);NR[1]=new se(1,-1,1,1);NR[2]=new se(1,1,1,1);NR[3]=new se(-1,1,1,1);var hwe=new Array(4);for(let e=0;e<4;++e)hwe[e]=new se;nT._computeNearFarPlanes=function(e,t,n,i,r,o,s,a){let c=$.fromQuaternion(t,DCt),u=o??uwe,f=s??fwe,d=a??dwe;u=$.getColumn(c,0,u),f=$.getColumn(c,1,f),d=$.getColumn(c,2,d),h.normalize(u,u),h.normalize(f,f),h.normalize(d,d),h.negate(u,u);let p=M.computeView(e,d,f,u,RCt),g,m,y=i.projectionMatrix;if(n===_6){let A=M.multiply(y,p,Dte);m=M.inverse(A,Dte)}else g=M.inverseTransformation(p,Dte);l(m)?(pA[0]=i.near,pA[1]=i.far):(pA[0]=0,pA[1]=i.near,pA[2]=i.far);for(let A=0;A<2;++A)for(let b=0;b<4;++b){let x=se.clone(NR[b],hwe[b]);if(l(m)){x=M.multiplyByVector(m,x,x);let T=1/x.w;h.multiplyByScalar(x,T,x),h.subtract(x,e,x),h.normalize(x,x);let E=h.dot(d,x);h.multiplyByScalar(x,pA[A]/E,x),h.add(x,e,x)}else{let T=i.offCenterFrustum;l(T)&&(i=T);let E=pA[A],v=pA[A+1];x.x=(x.x*(i.right-i.left)+i.left+i.right)*.5,x.y=(x.y*(i.top-i.bottom)+i.bottom+i.top)*.5,x.z=(x.z*(E-v)-E-v)*.5,x.w=1,M.multiplyByVector(g,x,x)}r[12*A+b*3]=x.x,r[12*A+b*3+1]=x.y,r[12*A+b*3+2]=x.z}};nT.createGeometry=function(e){let t=e._frustumType,n=e._frustum,i=e._origin,r=e._orientation,o=e._drawNearPlane,s=e._vertexFormat,a=o?6:5,c=new Float64Array(72);nT._computeNearFarPlanes(i,r,t,n,c);let u=24;c[u]=c[12],c[u+1]=c[13],c[u+2]=c[14],c[u+3]=c[0],c[u+4]=c[1],c[u+5]=c[2],c[u+6]=c[9],c[u+7]=c[10],c[u+8]=c[11],c[u+9]=c[21],c[u+10]=c[22],c[u+11]=c[23],u+=12,c[u]=c[15],c[u+1]=c[16],c[u+2]=c[17],c[u+3]=c[3],c[u+4]=c[4],c[u+5]=c[5],c[u+6]=c[0],c[u+7]=c[1],c[u+8]=c[2],c[u+9]=c[12],c[u+10]=c[13],c[u+11]=c[14],u+=12,c[u]=c[3],c[u+1]=c[4],c[u+2]=c[5],c[u+3]=c[15],c[u+4]=c[16],c[u+5]=c[17],c[u+6]=c[18],c[u+7]=c[19],c[u+8]=c[20],c[u+9]=c[6],c[u+10]=c[7],c[u+11]=c[8],u+=12,c[u]=c[6],c[u+1]=c[7],c[u+2]=c[8],c[u+3]=c[18],c[u+4]=c[19],c[u+5]=c[20],c[u+6]=c[21],c[u+7]=c[22],c[u+8]=c[23],c[u+9]=c[9],c[u+10]=c[10],c[u+11]=c[11],o||(c=c.subarray(12));let f=new En({position:new Ne({componentDatatype:Y.DOUBLE,componentsPerAttribute:3,values:c})});if(l(s.normal)||l(s.tangent)||l(s.bitangent)||l(s.st)){let p=l(s.normal)?new Float32Array(12*a):void 0,g=l(s.tangent)?new Float32Array(12*a):void 0,m=l(s.bitangent)?new Float32Array(12*a):void 0,y=l(s.st)?new Float32Array(8*a):void 0,A=uwe,b=fwe,x=dwe,T=h.negate(A,OCt),E=h.negate(b,MCt),v=h.negate(x,NCt);u=0,o&&($S(u,p,g,m,y,v,A,b),u+=12),$S(u,p,g,m,y,x,T,b),u+=12,$S(u,p,g,m,y,T,v,b),u+=12,$S(u,p,g,m,y,E,v,T),u+=12,$S(u,p,g,m,y,A,x,b),u+=12,$S(u,p,g,m,y,b,x,T),l(p)&&(f.normal=new Ne({componentDatatype:Y.FLOAT,componentsPerAttribute:3,values:p})),l(g)&&(f.tangent=new Ne({componentDatatype:Y.FLOAT,componentsPerAttribute:3,values:g})),l(m)&&(f.bitangent=new Ne({componentDatatype:Y.FLOAT,componentsPerAttribute:3,values:m})),l(y)&&(f.st=new Ne({componentDatatype:Y.FLOAT,componentsPerAttribute:2,values:y}))}let d=new Uint16Array(6*a);for(let p=0;p<a;++p){let g=p*6,m=p*4;d[g]=m,d[g+1]=m+1,d[g+2]=m+2,d[g+3]=m,d[g+4]=m+2,d[g+5]=m+3}return new wt({attributes:f,indices:d,primitiveType:Oe.TRIANGLES,boundingSphere:ue.fromVertices(c)})};var JS=nT;var Rte=0,LCt=1;function LR(e){let t=e.frustum,n=e.orientation,i=e.origin,r=e._drawNearPlane??!0,o,s;t instanceof Ji?(o=Rte,s=Ji.packedLength):t instanceof _n&&(o=LCt,s=_n.packedLength),this._frustumType=o,this._frustum=t.clone(),this._origin=h.clone(i),this._orientation=Le.clone(n),this._drawNearPlane=r,this._workerName="createFrustumOutlineGeometry",this.packedLength=2+s+h.packedLength+Le.packedLength}LR.pack=function(e,t,n){n=n??0;let i=e._frustumType,r=e._frustum;return t[n++]=i,i===Rte?(Ji.pack(r,t,n),n+=Ji.packedLength):(_n.pack(r,t,n),n+=_n.packedLength),h.pack(e._origin,t,n),n+=h.packedLength,Le.pack(e._orientation,t,n),n+=Le.packedLength,t[n]=e._drawNearPlane?1:0,t};var FCt=new Ji,BCt=new _n,kCt=new Le,UCt=new h;LR.unpack=function(e,t,n){t=t??0;let i=e[t++],r;i===Rte?(r=Ji.unpack(e,t,FCt),t+=Ji.packedLength):(r=_n.unpack(e,t,BCt),t+=_n.packedLength);let o=h.unpack(e,t,UCt);t+=h.packedLength;let s=Le.unpack(e,t,kCt);t+=Le.packedLength;let a=e[t]===1;if(!l(n))return new LR({frustum:r,origin:o,orientation:s,_drawNearPlane:a});let c=i===n._frustumType?n._frustum:void 0;return n._frustum=r.clone(c),n._frustumType=i,n._origin=h.clone(o,n._origin),n._orientation=Le.clone(s,n._orientation),n._drawNearPlane=a,n};LR.createGeometry=function(e){let t=e._frustumType,n=e._frustum,i=e._origin,r=e._orientation,o=e._drawNearPlane,s=new Float64Array(24);JS._computeNearFarPlanes(i,r,t,n,s);let a=new En({position:new Ne({componentDatatype:Y.DOUBLE,componentsPerAttribute:3,values:s})}),c,u,f=o?2:1,d=new Uint16Array(8*(f+1)),p=o?0:1;for(;p<2;++p)c=o?p*8:0,u=p*4,d[c]=u,d[c+1]=u+1,d[c+2]=u+1,d[c+3]=u+2,d[c+4]=u+2,d[c+5]=u+3,d[c+6]=u+3,d[c+7]=u;for(p=0;p<2;++p)c=(f+p)*8,u=p*4,d[c]=u,d[c+1]=u+4,d[c+2]=u+1,d[c+3]=u+5,d[c+4]=u+2,d[c+5]=u+6,d[c+6]=u+3,d[c+7]=u+7;return new wt({attributes:a,indices:d,primitiveType:Oe.LINES,boundingSphere:ue.fromVertices(s)})};var y6=LR;function A6(e){e=e??H.EMPTY_OBJECT,this._camera=e.camera,this._frustumSplits=e.frustumSplits,this._color=e.color??z.CYAN,this._updateOnChange=e.updateOnChange??!0,this.show=e.show??!0,this.id=e.id,this._id=void 0,this._outlinePrimitives=[],this._planesPrimitives=[]}var zCt=new h,VCt=new $,jCt=new Le,HCt=new Ji,GCt=new Uu,WCt=new _n,qCt=new Ss,YCt=new z,XCt=[1,1e5];A6.prototype.update=function(e){if(!this.show)return;let t=this._planesPrimitives,n=this._outlinePrimitives,i,r;if(this._updateOnChange){for(r=t.length,i=0;i<r;++i)n[i]=n[i]&&n[i].destroy(),t[i]=t[i]&&t[i].destroy();t.length=0,n.length=0}if(t.length===0){let o=this._camera,s=o.frustum,a;s instanceof Ji?a=HCt:s instanceof Uu?a=GCt:s instanceof _n?a=WCt:a=qCt,a=s.clone(a);let c,u=this._frustumSplits;!l(u)||u.length<=1?(u=XCt,u[0]=this._camera.frustum.near,u[1]=this._camera.frustum.far,c=1):c=u.length-1;let f=o.positionWC,d=o.directionWC,p=o.upWC,g=o.rightWC;g=h.negate(g,zCt);let m=VCt;$.setColumn(m,0,g,m),$.setColumn(m,1,p,m),$.setColumn(m,2,d,m);let y=Le.fromRotationMatrix(m,jCt);for(t.length=n.length=c,i=0;i<c;++i)a.near=u[i],a.far=u[i+1],t[i]=new Mn({geometryInstances:new Bt({geometry:new JS({origin:f,orientation:y,frustum:a,_drawNearPlane:i===0}),attributes:{color:Jt.fromColor(z.fromAlpha(this._color,.1,YCt))},id:this.id,pickPrimitive:this}),appearance:new An({translucent:!0,flat:!0}),asynchronous:!1}),n[i]=new Mn({geometryInstances:new Bt({geometry:new y6({origin:f,orientation:y,frustum:a,_drawNearPlane:i===0}),attributes:{color:Jt.fromColor(this._color)},id:this.id,pickPrimitive:this}),appearance:new An({translucent:!1,flat:!0}),asynchronous:!1})}for(r=t.length,i=0;i<r;++i)n[i].update(e),t[i].update(e)};A6.prototype.isDestroyed=function(){return!1};A6.prototype.destroy=function(){let e=this._planesPrimitives.length;for(let t=0;t<e;++t)this._outlinePrimitives[t]=this._outlinePrimitives[t]&&this._outlinePrimitives[t].destroy(),this._planesPrimitives[t]=this._planesPrimitives[t]&&this._planesPrimitives[t].destroy();return le(this)};var jg=A6;function BR(e){this._rs=void 0,this._sp=void 0,this._va=void 0,this._command=void 0,this._mode=void 0,this._useLogDepth=!1,this._ellipsoidOffset=e??0}var FR=dn.supportsTypedArrays()?new Float32Array(12):[],mwe=new h,pwe=new h,Ote=new h,gwe=new h,b6=new h;function KCt(e,t){let n=e.radii,i=t.camera,r,o,s;if(i.frustum instanceof _n)r=h.ZERO,o=i.rightWC,s=i.upWC;else{let d=i.positionWC,p=h.multiplyComponents(e.oneOverRadii,d,mwe),g=h.normalize(p,pwe),m=h.normalize(h.cross(h.UNIT_Z,p,Ote),Ote),y=h.normalize(h.cross(g,m,gwe),gwe),A=h.magnitude(p),b=Math.sqrt(A*A-1);r=h.multiplyByScalar(g,1/A,mwe);let x=b/A;o=h.multiplyByScalar(m,x,pwe),s=h.multiplyByScalar(y,x,Ote)}let a=h.add(r,s,b6);h.subtract(a,o,a),h.multiplyComponents(n,a,a),h.pack(a,FR,0);let c=h.subtract(r,s,b6);h.subtract(c,o,c),h.multiplyComponents(n,c,c),h.pack(c,FR,3);let u=h.add(r,s,b6);h.add(u,o,u),h.multiplyComponents(n,u,u),h.pack(u,FR,6);let f=h.subtract(r,s,b6);return h.add(f,o,f),h.multiplyComponents(n,f,f),h.pack(f,FR,9),FR}BR.prototype.update=function(e){if(this._mode=e.mode,e.mode!==re.SCENE3D)return;let t=e.context,n=e.mapProjection.ellipsoid.radii,i=new ee(n.x+this._ellipsoidOffset,n.y+this._ellipsoidOffset,n.z+this._ellipsoidOffset),r=e.useLogDepth;if(l(this._command)||(this._rs=Ge.fromCache({cull:{enabled:!0},depthTest:{enabled:!0},colorMask:{red:!1,green:!1,blue:!1,alpha:!1}}),this._command=new at({renderState:this._rs,boundingVolume:new ue(h.ZERO,i.maximumRadius),pass:Ie.OPAQUE,owner:this})),!l(this._sp)||this._useLogDepth!==r){this._useLogDepth=r;let s=new Xe({sources:[N2]}),a=new Xe({sources:[M2]});r&&(a.defines.push("LOG_DEPTH"),s.defines.push("LOG_DEPTH")),this._sp=Qt.replaceCache({shaderProgram:this._sp,context:t,vertexShaderSource:s,fragmentShaderSource:a,attributeLocations:{position:0}}),this._command.shaderProgram=this._sp}let o=KCt(i,e);if(l(this._va))this._va.getAttribute(0).vertexBuffer.copyFromArrayView(o);else{let s=new wt({attributes:{position:new Ne({componentDatatype:Y.FLOAT,componentsPerAttribute:3,values:o})},indices:[0,1,2,2,1,3],primitiveType:Oe.TRIANGLES});this._va=Vn.fromGeometry({context:t,geometry:s,attributeLocations:{position:0},bufferUsage:Me.DYNAMIC_DRAW}),this._command.vertexArray=this._va}};BR.prototype.execute=function(e,t){this._mode===re.SCENE3D&&this._command.execute(e,t)};BR.prototype.isDestroyed=function(){return!1};BR.prototype.destroy=function(){this._sp=this._sp&&this._sp.destroy(),this._va=this._va&&this._va.destroy()};var x6=BR;function iT(){}var $Ct=/\bgl_FragDepth\b/,JCt=/\bdiscard\b/;function ZCt(e,t){let n=e.shaderCache.getDerivedShaderProgram(t,"depthOnly");if(l(n))return n;let i=t.fragmentShaderSource,r=!1,o=i.sources;for(let a=0;a<o.length;++a)if($Ct.test(o[a])||JCt.test(o[a])){r=!0;break}let s=i.defines.indexOf("LOG_DEPTH")>=0;if(!r&&!s){let a=`void main() { out_FragColor = vec4(1.0); } @@ -10180,32 +10180,32 @@ Url: ${e._contentHeader.uri}`,r++;let o={text:i.substring(1),position:n,font:`${ out_FragColor = vec4(1.0); czm_writeLogDepth(); } -`;i=new Xe({defines:["LOG_DEPTH"],sources:[a]})}return e.shaderCache.createDerivedShaderProgram(t,"depthOnly",{vertexShaderSource:t.vertexShaderSource,fragmentShaderSource:i,attributeLocations:t._attributeLocations})}function ORt(e,t){let n=e._depthOnlyRenderStateCache,i=n[t.id];if(l(i))return i;let r=Ge.getState(t);r.depthMask=!0,r.colorMask={red:!1,green:!1,blue:!1,alpha:!1};let o=Ge.fromCache(r);return n[t.id]=o,o}RT.createDepthOnlyDerivedCommand=function(e,t,n,i){l(i)||(i={});let r=i.depthOnlyCommand?.shaderProgram,o=i.depthOnlyCommand?.renderState;return i.depthOnlyCommand=at.shallowClone(t,i.depthOnlyCommand),!l(r)||i.shaderProgramId!==t.shaderProgram.id?(i.depthOnlyCommand.shaderProgram=RRt(n,t.shaderProgram),i.depthOnlyCommand.renderState=ORt(e,t.renderState),i.shaderProgramId=t.shaderProgram.id):(i.depthOnlyCommand.shaderProgram=r,i.depthOnlyCommand.renderState=o),i};var MRt=/\s+czm_writeLogDepth\(/,NRt=/\s+czm_vertexLogDepth\(/;function LRt(e,t){if(t.fragmentShaderSource.defines.indexOf("LOG_DEPTH_READ_ONLY")>=0)return t;let i=e.shaderCache.getDerivedShaderProgram(t,"logDepth");if(l(i))return i;let r=t._attributeLocations,o=t.vertexShaderSource.clone(),s=t.fragmentShaderSource.clone();o.defines=l(o.defines)?o.defines.slice(0):[],o.defines.push("LOG_DEPTH"),s.defines=l(s.defines)?s.defines.slice(0):[],s.defines.push("LOG_DEPTH");let a=!1,c=o.sources;for(let f=0;f<c.length;++f)if(NRt.test(c[f])){a=!0;break}if(!a){for(let d=0;d<c.length;++d)c[d]=Xe.replaceMain(c[d],"czm_log_depth_main");c.push(` +`;i=new Xe({defines:["LOG_DEPTH"],sources:[a]})}return e.shaderCache.createDerivedShaderProgram(t,"depthOnly",{vertexShaderSource:t.vertexShaderSource,fragmentShaderSource:i,attributeLocations:t._attributeLocations})}function QCt(e,t){let n=e._depthOnlyRenderStateCache,i=n[t.id];if(l(i))return i;let r=Ge.getState(t);r.depthMask=!0,r.colorMask={red:!1,green:!1,blue:!1,alpha:!1};let o=Ge.fromCache(r);return n[t.id]=o,o}iT.createDepthOnlyDerivedCommand=function(e,t,n,i){l(i)||(i={});let r=i.depthOnlyCommand?.shaderProgram,o=i.depthOnlyCommand?.renderState;return i.depthOnlyCommand=at.shallowClone(t,i.depthOnlyCommand),!l(r)||i.shaderProgramId!==t.shaderProgram.id?(i.depthOnlyCommand.shaderProgram=ZCt(n,t.shaderProgram),i.depthOnlyCommand.renderState=QCt(e,t.renderState),i.shaderProgramId=t.shaderProgram.id):(i.depthOnlyCommand.shaderProgram=r,i.depthOnlyCommand.renderState=o),i};var evt=/\s+czm_writeLogDepth\(/,tvt=/\s+czm_vertexLogDepth\(/;function nvt(e,t){if(t.fragmentShaderSource.defines.indexOf("LOG_DEPTH_READ_ONLY")>=0)return t;let i=e.shaderCache.getDerivedShaderProgram(t,"logDepth");if(l(i))return i;let r=t._attributeLocations,o=t.vertexShaderSource.clone(),s=t.fragmentShaderSource.clone();o.defines=l(o.defines)?o.defines.slice(0):[],o.defines.push("LOG_DEPTH"),s.defines=l(s.defines)?s.defines.slice(0):[],s.defines.push("LOG_DEPTH");let a=!1,c=o.sources;for(let f=0;f<c.length;++f)if(tvt.test(c[f])){a=!0;break}if(!a){for(let d=0;d<c.length;++d)c[d]=Xe.replaceMain(c[d],"czm_log_depth_main");c.push(` void main() { czm_log_depth_main(); czm_vertexLogDepth(); } -`)}c=s.sources,a=!1;for(let f=0;f<c.length;++f)MRt.test(c[f])&&(a=!0);s.defines.indexOf("LOG_DEPTH_WRITE")!==-1&&(a=!0);let u="";if(!a){for(let f=0;f<c.length;f++)c[f]=Xe.replaceMain(c[f],"czm_log_depth_main");u=` +`)}c=s.sources,a=!1;for(let f=0;f<c.length;++f)evt.test(c[f])&&(a=!0);s.defines.indexOf("LOG_DEPTH_WRITE")!==-1&&(a=!0);let u="";if(!a){for(let f=0;f<c.length;f++)c[f]=Xe.replaceMain(c[f],"czm_log_depth_main");u=` void main() { czm_log_depth_main(); czm_writeLogDepth(); } -`}return c.push(u),e.shaderCache.createDerivedShaderProgram(t,"logDepth",{vertexShaderSource:o,fragmentShaderSource:s,attributeLocations:r})}RT.createLogDepthCommand=function(e,t,n){l(n)||(n={});let i=n.command?.shaderProgram;return n.command=at.shallowClone(e,n.command),!l(i)||n.shaderProgramId!==e.shaderProgram.id?(n.command.shaderProgram=LRt(t,e.shaderProgram),n.shaderProgramId=e.shaderProgram.id):n.command.shaderProgram=i,n};function FRt(e,t,n){let i=e.shaderCache.getDerivedShaderProgram(t,"pick");if(l(i))return i;let r=t._attributeLocations,{sources:o,defines:s}=t.fragmentShaderSource,c=o.some(g=>g.includes("out_FragData"))?"out_FragData_0":"out_FragColor",u=`void main () +`}return c.push(u),e.shaderCache.createDerivedShaderProgram(t,"logDepth",{vertexShaderSource:o,fragmentShaderSource:s,attributeLocations:r})}iT.createLogDepthCommand=function(e,t,n){l(n)||(n={});let i=n.command?.shaderProgram;return n.command=at.shallowClone(e,n.command),!l(i)||n.shaderProgramId!==e.shaderProgram.id?(n.command.shaderProgram=nvt(t,e.shaderProgram),n.shaderProgramId=e.shaderProgram.id):n.command.shaderProgram=i,n};function ivt(e,t,n){let i=e.shaderCache.getDerivedShaderProgram(t,"pick");if(l(i))return i;let r=t._attributeLocations,{sources:o,defines:s}=t.fragmentShaderSource,c=o.some(g=>g.includes("out_FragData"))?"out_FragData_0":"out_FragColor",u=`void main () { czm_non_pick_main(); if (${c}.a == 0.0) { discard; } ${c} = ${n}; -} `,f=o.length,d=new Array(f+1);for(let g=0;g<f;++g)d[g]=Xe.replaceMain(o[g],"czm_non_pick_main");d[f]=u;let p=new Xe({sources:d,defines:s});return e.shaderCache.createDerivedShaderProgram(t,"pick",{vertexShaderSource:t.vertexShaderSource,fragmentShaderSource:p,attributeLocations:r})}function Xre(e,t){let n=e.picking.pickRenderStateCache,i=n[t.id];if(l(i))return i;let r=Ge.getState(t);r.blending.enabled=!1,r.depthMask=!0;let o=Ge.fromCache(r);return n[t.id]=o,o}RT.createPickDerivedCommand=function(e,t,n,i){l(i)||(i={});let r=i.pickCommand?.shaderProgram,o=i.pickCommand?.renderState;return i.pickCommand=at.shallowClone(t,i.pickCommand),!l(r)||i.shaderProgramId!==t.shaderProgram.id?(i.pickCommand.shaderProgram=FRt(n,t.shaderProgram,t.pickId),i.pickCommand.renderState=Xre(e,t.renderState),i.shaderProgramId=t.shaderProgram.id):(i.pickCommand.shaderProgram=r,i.pickCommand.renderState=o),i};var BRt=`uint rgba8UnormToUint32(vec4 c) +} `,f=o.length,d=new Array(f+1);for(let g=0;g<f;++g)d[g]=Xe.replaceMain(o[g],"czm_non_pick_main");d[f]=u;let p=new Xe({sources:d,defines:s});return e.shaderCache.createDerivedShaderProgram(t,"pick",{vertexShaderSource:t.vertexShaderSource,fragmentShaderSource:p,attributeLocations:r})}function Mte(e,t){let n=e.picking.pickRenderStateCache,i=n[t.id];if(l(i))return i;let r=Ge.getState(t);r.blending.enabled=!1,r.depthMask=!0;let o=Ge.fromCache(r);return n[t.id]=o,o}iT.createPickDerivedCommand=function(e,t,n,i){l(i)||(i={});let r=i.pickCommand?.shaderProgram,o=i.pickCommand?.renderState;return i.pickCommand=at.shallowClone(t,i.pickCommand),!l(r)||i.shaderProgramId!==t.shaderProgram.id?(i.pickCommand.shaderProgram=ivt(n,t.shaderProgram,t.pickId),i.pickCommand.renderState=Mte(e,t.renderState),i.shaderProgramId=t.shaderProgram.id):(i.pickCommand.shaderProgram=r,i.pickCommand.renderState=o),i};var rvt=`uint rgba8UnormToUint32(vec4 c) { uvec4 b = uvec4(c * 255.0 + 0.5); return (b.r) | (b.g << 8u) | (b.b << 16u) | (b.a << 24u); } -`;function kRt(e,t,n){let i=e.shaderCache.getDerivedShaderProgram(t,"snap");if(l(i))return i;let r=t._attributeLocations,{sources:o,defines:s}=t.fragmentShaderSource,c=o.some(g=>g.includes("out_FragData"))?"out_FragData_0":"out_FragColor",u=`${BRt} +`;function ovt(e,t,n){let i=e.shaderCache.getDerivedShaderProgram(t,"snap");if(l(i))return i;let r=t._attributeLocations,{sources:o,defines:s}=t.fragmentShaderSource,c=o.some(g=>g.includes("out_FragData"))?"out_FragData_0":"out_FragColor",u=`${rvt} void main () { czm_non_snap_main(); @@ -10213,11 +10213,11 @@ void main () discard; } ${c} = ${n}; -} `,f=o.length,d=new Array(f+1);for(let g=0;g<f;++g)d[g]=Xe.replaceMain(o[g],"czm_non_snap_main");d[f]=u;let p=new Xe({sources:d,defines:s});return e.shaderCache.createDerivedShaderProgram(t,"snap",{vertexShaderSource:t.vertexShaderSource,fragmentShaderSource:p,attributeLocations:r})}RT.createSnapDerivedCommand=function(e,t,n,i){l(i)||(i={});let r=i.snapCommand?.shaderProgram,o=i.snapCommand?.renderState;return i.snapCommand=at.shallowClone(t,i.snapCommand),!l(r)||i.shaderProgramId!==t.shaderProgram.id?(i.snapCommand.shaderProgram=kRt(n,t.shaderProgram,t.snapId),i.snapCommand.renderState=Xre(e,t.renderState),i.shaderProgramId=t.shaderProgram.id):(i.snapCommand.shaderProgram=r,i.snapCommand.renderState=o),i};function Gw(e,t,n){let i=e.length;for(let r=0;r<i;r++)e[r].trimStart().split(/\s+/)[0]===t&&(e[r]=`${t} ${n}`)}function URt(e){return e.isArray?e.arrayLength:bt.getComponentCount(e.type)}function hOe(e,t,n){return`((${e} - float(${t})) / float(${n}))`}function mOe(e,t){let n=Ft.getMaximum(t);return`(${e}) / float(${n})`}function zRt(e,t){let n="float(value)";if(t.hasValueTransform){let i=t.offset,r=t.scale;n=hOe(n,i,r)}return e.normalized||(n=mOe(n,e.componentType)),n}function VRt(e,t,n){let r=`float(${`value.${n}`})`;if(t.hasValueTransform){let o=t.offset[n],s=t.scale[n];r=hOe(r,o,s)}return e.normalized||(r=mOe(r,e.componentType)),r}function jRt(e,t,n){let i=n.schemaId,r=n.className,o=n.propertyName,s=`pickMetadata-${i}-${r}-${o}`,a=e.shaderCache.getDerivedShaderProgram(t,s);if(l(a))return a;let c=n.metadataProperty,u=n.classProperty,f=u.getGlslType(),d=["0.0","0.0","0.0","0.0"],p=URt(u);if(p===1)d[0]=zRt(u,c);else{let A=["x","y","z","w"];for(let b=0;b<p;b++)d[b]=VRt(u,c,A[b])}let g=t.fragmentShaderSource.defines.slice();g.push(xd.METADATA_PICKING_ENABLED),Gw(g,xd.METADATA_PICKING_VALUE_TYPE,f),Gw(g,xd.METADATA_PICKING_VALUE_STRING,`metadata.${o}`),Gw(g,xd.METADATA_PICKING_VALUE_COMPONENT_X,d[0]),Gw(g,xd.METADATA_PICKING_VALUE_COMPONENT_Y,d[1]),Gw(g,xd.METADATA_PICKING_VALUE_COMPONENT_Z,d[2]),Gw(g,xd.METADATA_PICKING_VALUE_COMPONENT_W,d[3]);let m=new Xe({sources:t.fragmentShaderSource.sources,defines:g});return e.shaderCache.createDerivedShaderProgram(t,s,{vertexShaderSource:t.vertexShaderSource,fragmentShaderSource:m,attributeLocations:t._attributeLocations})}RT.createPickMetadataDerivedCommand=function(e,t,n,i){return l(i)||(i={}),i.pickMetadataCommand=at.shallowClone(t,i.pickMetadataCommand),i.pickMetadataCommand.shaderProgram=jRt(n,t.shaderProgram,t.pickedMetadataInfo),i.pickMetadataCommand.renderState=Xre(e,t.renderState),i.shaderProgramId=t.shaderProgram.id,i};function HRt(e,t){let n=e.shaderCache.getDerivedShaderProgram(t,"HDR");if(l(n))return n;let i=t._attributeLocations,r=t.vertexShaderSource.clone(),o=t.fragmentShaderSource.clone();return r.defines=l(r.defines)?r.defines.slice(0):[],r.defines.push("HDR"),o.defines=l(o.defines)?o.defines.slice(0):[],o.defines.push("HDR"),e.shaderCache.createDerivedShaderProgram(t,"HDR",{vertexShaderSource:r,fragmentShaderSource:o,attributeLocations:i})}RT.createHdrCommand=function(e,t,n){l(n)||(n={});let i=n.command?.shaderProgram;return n.command=at.shallowClone(e,n.command),!l(i)||n.shaderProgramId!==e.shaderProgram.id?(n.command.shaderProgram=HRt(t,e.shaderProgram),n.shaderProgramId=e.shaderProgram.id):n.command.shaderProgram=i,n};var c0=RT;function FG(e){this._scene=e,this._lastAlpha=void 0,this._lastBeta=void 0,this._lastGamma=void 0,this._alpha=void 0,this._beta=void 0,this._gamma=void 0;let t=this;function n(i){let r=i.alpha;if(!l(r)){t._alpha=void 0,t._beta=void 0,t._gamma=void 0;return}t._alpha=P.toRadians(r),t._beta=P.toRadians(i.beta),t._gamma=P.toRadians(i.gamma)}window.addEventListener("deviceorientation",n,!1),this._removeListener=function(){window.removeEventListener("deviceorientation",n,!1)}}var GRt=new Le,pOe=new Le,WRt=new $;function qRt(e,t,n,i){let r=e.direction,o=e.right,s=e.up,a=Le.fromAxisAngle(r,n,pOe),c=Le.fromAxisAngle(o,i,GRt),u=Le.multiply(c,a,c),f=Le.fromAxisAngle(s,t,pOe);Le.multiply(f,u,u);let d=$.fromQuaternion(u,WRt);$.multiplyByVector(d,o,o),$.multiplyByVector(d,s,s),$.multiplyByVector(d,r,r)}FG.prototype.update=function(){if(!l(this._alpha))return;l(this._lastAlpha)||(this._lastAlpha=this._alpha,this._lastBeta=this._beta,this._lastGamma=this._gamma);let e=this._lastAlpha-this._alpha,t=this._lastBeta-this._beta,n=this._lastGamma-this._gamma;qRt(this._scene.camera,-e,t,n),this._lastAlpha=this._alpha,this._lastBeta=this._beta,this._lastGamma=this._gamma};FG.prototype.isDestroyed=function(){return!1};FG.prototype.destroy=function(){return this._removeListener(),le(this)};var BG=FG;function Kre(){this.enabled=!0,this.renderable=!0,this.density=6e-4,this.heightScalar=.001,this._heightFalloff=.59,this.maxHeight=8e5,this.visualDensityScalar=.15,this.screenSpaceErrorFactor=2,this.minimumBrightness=.03}Object.defineProperties(Kre.prototype,{heightFalloff:{get:function(){return this._heightFalloff},set:function(e){this._heightFalloff=e}}});var YRt=new h;Kre.prototype.update=function(e){if(!(e.fog.enabled=this.enabled))return;e.fog.renderable=this.renderable;let n=e.camera,i=n.positionCartographic;if(!l(i)||i.height>this.maxHeight||e.mode!==re.SCENE3D){e.fog.enabled=!1,e.fog.density=0;return}let r=i.height,o=this.density*this.heightScalar*Math.pow(Math.max(r/this.maxHeight,P.EPSILON4),-Math.max(this._heightFalloff,0)),s=h.normalize(n.positionWC,YRt),a=Math.abs(h.dot(n.directionWC,s));o*=1-a,e.fog.density=o,e.fog.visualDensityScalar=this.visualDensityScalar,e.fog.sse=this.screenSpaceErrorFactor,e.fog.minimumBrightness=this.minimumBrightness};var kG=Kre;var fc={OPAQUE_FRONT_FACE:0,OPAQUE_BACK_FACE:1,DEPTH_ONLY_FRONT_FACE:2,DEPTH_ONLY_BACK_FACE:3,DEPTH_ONLY_FRONT_AND_BACK_FACE:4,TRANSLUCENT_FRONT_FACE:5,TRANSLUCENT_BACK_FACE:6,TRANSLUCENT_FRONT_FACE_MANUAL_DEPTH_TEST:7,TRANSLUCENT_BACK_FACE_MANUAL_DEPTH_TEST:8,PICK_FRONT_FACE:9,PICK_BACK_FACE:10,DERIVED_COMMANDS_MAXIMUM_LENGTH:11},OT=fc.DERIVED_COMMANDS_MAXIMUM_LENGTH,vOe=["opaqueFrontFaceCommand","opaqueBackFaceCommand","depthOnlyFrontFaceCommand","depthOnlyBackFaceCommand","depthOnlyFrontAndBackFaceCommand","translucentFrontFaceCommand","translucentBackFaceCommand","translucentFrontFaceManualDepthTestCommand","translucentBackFaceManualDepthTestCommand","pickFrontFaceCommand","pickBackFaceCommand"];function MT(){this._frontFaceAlphaByDistance=new qt(0,1,0,1),this._backFaceAlphaByDistance=new qt(0,1,0,1),this._frontFaceTranslucent=!1,this._backFaceTranslucent=!1,this._requiresManualDepthTest=!1,this._sunVisibleThroughGlobe=!1,this._environmentVisible=!1,this._useDepthPlane=!1,this._numberOfTextureUniforms=0,this._globeTranslucencyFramebuffer=void 0,this._rectangle=ie.clone(ie.MAX_VALUE),this._derivedCommandKey=0,this._derivedCommandsDirty=!1,this._derivedCommandPacks=void 0,this._derivedCommandTypes=new Array(OT),this._derivedBlendCommandTypes=new Array(OT),this._derivedPickCommandTypes=new Array(OT),this._derivedCommandTypesToUpdate=new Array(OT),this._derivedCommandsLength=0,this._derivedBlendCommandsLength=0,this._derivedPickCommandsLength=0,this._derivedCommandsToUpdateLength=0}Object.defineProperties(MT.prototype,{frontFaceAlphaByDistance:{get:function(){return this._frontFaceAlphaByDistance}},backFaceAlphaByDistance:{get:function(){return this._backFaceAlphaByDistance}},translucent:{get:function(){return this._frontFaceTranslucent}},sunVisibleThroughGlobe:{get:function(){return this._sunVisibleThroughGlobe}},environmentVisible:{get:function(){return this._environmentVisible}},useDepthPlane:{get:function(){return this._useDepthPlane}},numberOfTextureUniforms:{get:function(){return this._numberOfTextureUniforms}},rectangle:{get:function(){return this._rectangle}}});MT.prototype.update=function(e){let t=e.globe;if(!l(t)||!t.show){this._frontFaceTranslucent=!1,this._backFaceTranslucent=!1,this._sunVisibleThroughGlobe=!0,this._environmentVisible=!0,this._useDepthPlane=!1;return}this._frontFaceAlphaByDistance=gOe(t.translucency.enabled,t.translucency.frontFaceAlpha,t.translucency.frontFaceAlphaByDistance,this._frontFaceAlphaByDistance),this._backFaceAlphaByDistance=gOe(t.translucency.enabled,t.translucency.backFaceAlpha,t.translucency.backFaceAlphaByDistance,this._backFaceAlphaByDistance),this._frontFaceTranslucent=_Oe(t.translucency.enabled,this._frontFaceAlphaByDistance,t),this._backFaceTranslucent=_Oe(t.translucency.enabled,this._backFaceAlphaByDistance,t),this._requiresManualDepthTest=JRt(this,e,t),this._sunVisibleThroughGlobe=XRt(this,e),this._environmentVisible=KRt(this,e),this._useDepthPlane=$Rt(this,e),this._numberOfTextureUniforms=ZRt(this),this._rectangle=ie.clone(t.translucency.rectangle,this._rectangle),QRt(this,e)};function gOe(e,t,n,i){return e?l(n)?(qt.clone(n,i),i.nearValue*=t,i.farValue*=t,i):(i.nearValue=t,i.farValue=t,i):(i.nearValue=1,i.farValue=1,i)}function _Oe(e,t,n){return e&&(n.baseColor.alpha<1||t.nearValue<1||t.farValue<1)}function XRt(e,t){let n=e._frontFaceTranslucent,i=e._backFaceTranslucent;return n&&(t.cameraUnderground||i)}function KRt(e,t){return!t.cameraUnderground||e._frontFaceTranslucent}function $Rt(e,t){return!t.cameraUnderground&&!e._frontFaceTranslucent}function JRt(e,t,n){return e._frontFaceTranslucent&&!e._backFaceTranslucent&&!n.depthTestAgainstTerrain&&t.mode!==re.SCENE2D&&t.context.depthTexture}function ZRt(e){let t=0;return e._frontFaceTranslucent&&++t,e._requiresManualDepthTest&&++t,t}function QRt(e,t){e._derivedCommandsLength=$re(e,t,!1,!1,e._derivedCommandTypes),e._derivedBlendCommandsLength=$re(e,t,!0,!1,e._derivedBlendCommandTypes),e._derivedPickCommandsLength=$re(e,t,!1,!0,e._derivedPickCommandTypes);let n,i=0;for(n=0;n<e._derivedCommandsLength;++n)i|=1<<e._derivedCommandTypes[n];for(n=0;n<e._derivedBlendCommandsLength;++n)i|=1<<e._derivedBlendCommandTypes[n];for(n=0;n<e._derivedPickCommandsLength;++n)i|=1<<e._derivedPickCommandTypes[n];let r=0;for(n=0;n<OT;++n)(i&1<<n)>0&&(e._derivedCommandTypesToUpdate[r++]=n);e._derivedCommandsToUpdateLength=r;let o=i!==e._derivedCommandKey;e._derivedCommandKey=i,e._derivedCommandsDirty=o,!l(e._derivedCommandPacks)&&e._frontFaceTranslucent&&(e._derivedCommandPacks=mOt())}function $re(e,t,n,i,r){let o=0,s=e._frontFaceTranslucent,a=e._backFaceTranslucent;if(!s)return o;let c=t.cameraUnderground,u=e._requiresManualDepthTest,f=i?fc.PICK_FRONT_FACE:u?fc.TRANSLUCENT_FRONT_FACE_MANUAL_DEPTH_TEST:fc.TRANSLUCENT_FRONT_FACE,d=i?fc.PICK_BACK_FACE:u?fc.TRANSLUCENT_BACK_FACE_MANUAL_DEPTH_TEST:fc.TRANSLUCENT_BACK_FACE;return t.mode===re.SCENE2D?(r[o++]=fc.DEPTH_ONLY_FRONT_FACE,r[o++]=f,o):(a?(n||(r[o++]=fc.DEPTH_ONLY_FRONT_AND_BACK_FACE),c?(r[o++]=f,r[o++]=d):(r[o++]=d,r[o++]=f)):c?(n||(r[o++]=fc.DEPTH_ONLY_BACK_FACE),r[o++]=fc.OPAQUE_FRONT_FACE,r[o++]=d):(n||(r[o++]=fc.DEPTH_ONLY_FRONT_FACE),r[o++]=fc.OPAQUE_BACK_FACE,r[o++]=f),o)}function Jd(e,t){let n=e.indexOf(t);n>-1&&e.splice(n,1)}function yOe(e,t){return e.indexOf(t)>-1}function eOt(e,t){Jd(e.defines,"TRANSLUCENT"),Jd(t.defines,"TRANSLUCENT")}function tOt(e,t){Jd(e.defines,"GROUND_ATMOSPHERE"),Jd(t.defines,"GROUND_ATMOSPHERE"),Jd(e.defines,"FOG"),Jd(t.defines,"FOG"),Jd(e.defines,"TRANSLUCENT"),Jd(t.defines,"TRANSLUCENT")}function Jre(e,t){if(yOe(t.defines,"TILE_LIMIT_RECTANGLE")||yOe(t.defines,"ENABLE_CLIPPING_PLANES"))return;let n=`void main() +} `,f=o.length,d=new Array(f+1);for(let g=0;g<f;++g)d[g]=Xe.replaceMain(o[g],"czm_non_snap_main");d[f]=u;let p=new Xe({sources:d,defines:s});return e.shaderCache.createDerivedShaderProgram(t,"snap",{vertexShaderSource:t.vertexShaderSource,fragmentShaderSource:p,attributeLocations:r})}iT.createSnapDerivedCommand=function(e,t,n,i){l(i)||(i={});let r=i.snapCommand?.shaderProgram,o=i.snapCommand?.renderState;return i.snapCommand=at.shallowClone(t,i.snapCommand),!l(r)||i.shaderProgramId!==t.shaderProgram.id?(i.snapCommand.shaderProgram=ovt(n,t.shaderProgram,t.snapId),i.snapCommand.renderState=Mte(e,t.renderState),i.shaderProgramId=t.shaderProgram.id):(i.snapCommand.shaderProgram=r,i.snapCommand.renderState=o),i};function ZS(e,t,n){let i=e.length;for(let r=0;r<i;r++)e[r].trimStart().split(/\s+/)[0]===t&&(e[r]=`${t} ${n}`)}function svt(e){return e.isArray?e.arrayLength:bt.getComponentCount(e.type)}function _we(e,t,n){return`((${e} - float(${t})) / float(${n}))`}function ywe(e,t){let n=Lt.getMaximum(t);return`(${e}) / float(${n})`}function avt(e,t){let n="float(value)";if(t.hasValueTransform){let i=t.offset,r=t.scale;n=_we(n,i,r)}return e.normalized||(n=ywe(n,e.componentType)),n}function cvt(e,t,n){let r=`float(${`value.${n}`})`;if(t.hasValueTransform){let o=t.offset[n],s=t.scale[n];r=_we(r,o,s)}return e.normalized||(r=ywe(r,e.componentType)),r}function lvt(e,t,n){let i=n.schemaId,r=n.className,o=n.propertyName,s=`pickMetadata-${i}-${r}-${o}`,a=e.shaderCache.getDerivedShaderProgram(t,s);if(l(a))return a;let c=n.metadataProperty,u=n.classProperty,f=u.getGlslType(),d=["0.0","0.0","0.0","0.0"],p=svt(u);if(p===1)d[0]=avt(u,c);else{let A=["x","y","z","w"];for(let b=0;b<p;b++)d[b]=cvt(u,c,A[b])}let g=t.fragmentShaderSource.defines.slice();g.push(Rd.METADATA_PICKING_ENABLED),ZS(g,Rd.METADATA_PICKING_VALUE_TYPE,f),ZS(g,Rd.METADATA_PICKING_VALUE_STRING,`metadata.${o}`),ZS(g,Rd.METADATA_PICKING_VALUE_COMPONENT_X,d[0]),ZS(g,Rd.METADATA_PICKING_VALUE_COMPONENT_Y,d[1]),ZS(g,Rd.METADATA_PICKING_VALUE_COMPONENT_Z,d[2]),ZS(g,Rd.METADATA_PICKING_VALUE_COMPONENT_W,d[3]);let m=new Xe({sources:t.fragmentShaderSource.sources,defines:g});return e.shaderCache.createDerivedShaderProgram(t,s,{vertexShaderSource:t.vertexShaderSource,fragmentShaderSource:m,attributeLocations:t._attributeLocations})}iT.createPickMetadataDerivedCommand=function(e,t,n,i){return l(i)||(i={}),i.pickMetadataCommand=at.shallowClone(t,i.pickMetadataCommand),i.pickMetadataCommand.shaderProgram=lvt(n,t.shaderProgram,t.pickedMetadataInfo),i.pickMetadataCommand.renderState=Mte(e,t.renderState),i.shaderProgramId=t.shaderProgram.id,i};function uvt(e,t){let n=e.shaderCache.getDerivedShaderProgram(t,"HDR");if(l(n))return n;let i=t._attributeLocations,r=t.vertexShaderSource.clone(),o=t.fragmentShaderSource.clone();return r.defines=l(r.defines)?r.defines.slice(0):[],r.defines.push("HDR"),o.defines=l(o.defines)?o.defines.slice(0):[],o.defines.push("HDR"),e.shaderCache.createDerivedShaderProgram(t,"HDR",{vertexShaderSource:r,fragmentShaderSource:o,attributeLocations:i})}iT.createHdrCommand=function(e,t,n){l(n)||(n={});let i=n.command?.shaderProgram;return n.command=at.shallowClone(e,n.command),!l(i)||n.shaderProgramId!==e.shaderProgram.id?(n.command.shaderProgram=uvt(t,e.shaderProgram),n.shaderProgramId=e.shaderProgram.id):n.command.shaderProgram=i,n};var qp=iT;function T6(e){this._scene=e,this._lastAlpha=void 0,this._lastBeta=void 0,this._lastGamma=void 0,this._alpha=void 0,this._beta=void 0,this._gamma=void 0;let t=this;function n(i){let r=i.alpha;if(!l(r)){t._alpha=void 0,t._beta=void 0,t._gamma=void 0;return}t._alpha=P.toRadians(r),t._beta=P.toRadians(i.beta),t._gamma=P.toRadians(i.gamma)}window.addEventListener("deviceorientation",n,!1),this._removeListener=function(){window.removeEventListener("deviceorientation",n,!1)}}var fvt=new Le,Awe=new Le,dvt=new $;function hvt(e,t,n,i){let r=e.direction,o=e.right,s=e.up,a=Le.fromAxisAngle(r,n,Awe),c=Le.fromAxisAngle(o,i,fvt),u=Le.multiply(c,a,c),f=Le.fromAxisAngle(s,t,Awe);Le.multiply(f,u,u);let d=$.fromQuaternion(u,dvt);$.multiplyByVector(d,o,o),$.multiplyByVector(d,s,s),$.multiplyByVector(d,r,r)}T6.prototype.update=function(){if(!l(this._alpha))return;l(this._lastAlpha)||(this._lastAlpha=this._alpha,this._lastBeta=this._beta,this._lastGamma=this._gamma);let e=this._lastAlpha-this._alpha,t=this._lastBeta-this._beta,n=this._lastGamma-this._gamma;hvt(this._scene.camera,-e,t,n),this._lastAlpha=this._alpha,this._lastBeta=this._beta,this._lastGamma=this._gamma};T6.prototype.isDestroyed=function(){return!1};T6.prototype.destroy=function(){return this._removeListener(),le(this)};var E6=T6;function Nte(){this.enabled=!0,this.renderable=!0,this.density=6e-4,this.heightScalar=.001,this._heightFalloff=.59,this.maxHeight=8e5,this.visualDensityScalar=.15,this.screenSpaceErrorFactor=2,this.minimumBrightness=.03}Object.defineProperties(Nte.prototype,{heightFalloff:{get:function(){return this._heightFalloff},set:function(e){this._heightFalloff=e}}});var mvt=new h;Nte.prototype.update=function(e){if(!(e.fog.enabled=this.enabled))return;e.fog.renderable=this.renderable;let n=e.camera,i=n.positionCartographic;if(!l(i)||i.height>this.maxHeight||e.mode!==re.SCENE3D){e.fog.enabled=!1,e.fog.density=0;return}let r=i.height,o=this.density*this.heightScalar*Math.pow(Math.max(r/this.maxHeight,P.EPSILON4),-Math.max(this._heightFalloff,0)),s=h.normalize(n.positionWC,mvt),a=Math.abs(h.dot(n.directionWC,s));o*=1-a,e.fog.density=o,e.fog.visualDensityScalar=this.visualDensityScalar,e.fog.sse=this.screenSpaceErrorFactor,e.fog.minimumBrightness=this.minimumBrightness};var C6=Nte;var uc={OPAQUE_FRONT_FACE:0,OPAQUE_BACK_FACE:1,DEPTH_ONLY_FRONT_FACE:2,DEPTH_ONLY_BACK_FACE:3,DEPTH_ONLY_FRONT_AND_BACK_FACE:4,TRANSLUCENT_FRONT_FACE:5,TRANSLUCENT_BACK_FACE:6,TRANSLUCENT_FRONT_FACE_MANUAL_DEPTH_TEST:7,TRANSLUCENT_BACK_FACE_MANUAL_DEPTH_TEST:8,PICK_FRONT_FACE:9,PICK_BACK_FACE:10,DERIVED_COMMANDS_MAXIMUM_LENGTH:11},rT=uc.DERIVED_COMMANDS_MAXIMUM_LENGTH,Pwe=["opaqueFrontFaceCommand","opaqueBackFaceCommand","depthOnlyFrontFaceCommand","depthOnlyBackFaceCommand","depthOnlyFrontAndBackFaceCommand","translucentFrontFaceCommand","translucentBackFaceCommand","translucentFrontFaceManualDepthTestCommand","translucentBackFaceManualDepthTestCommand","pickFrontFaceCommand","pickBackFaceCommand"];function oT(){this._frontFaceAlphaByDistance=new qt(0,1,0,1),this._backFaceAlphaByDistance=new qt(0,1,0,1),this._frontFaceTranslucent=!1,this._backFaceTranslucent=!1,this._requiresManualDepthTest=!1,this._sunVisibleThroughGlobe=!1,this._environmentVisible=!1,this._useDepthPlane=!1,this._numberOfTextureUniforms=0,this._globeTranslucencyFramebuffer=void 0,this._rectangle=ie.clone(ie.MAX_VALUE),this._derivedCommandKey=0,this._derivedCommandsDirty=!1,this._derivedCommandPacks=void 0,this._derivedCommandTypes=new Array(rT),this._derivedBlendCommandTypes=new Array(rT),this._derivedPickCommandTypes=new Array(rT),this._derivedCommandTypesToUpdate=new Array(rT),this._derivedCommandsLength=0,this._derivedBlendCommandsLength=0,this._derivedPickCommandsLength=0,this._derivedCommandsToUpdateLength=0}Object.defineProperties(oT.prototype,{frontFaceAlphaByDistance:{get:function(){return this._frontFaceAlphaByDistance}},backFaceAlphaByDistance:{get:function(){return this._backFaceAlphaByDistance}},translucent:{get:function(){return this._frontFaceTranslucent}},sunVisibleThroughGlobe:{get:function(){return this._sunVisibleThroughGlobe}},environmentVisible:{get:function(){return this._environmentVisible}},useDepthPlane:{get:function(){return this._useDepthPlane}},numberOfTextureUniforms:{get:function(){return this._numberOfTextureUniforms}},rectangle:{get:function(){return this._rectangle}}});oT.prototype.update=function(e){let t=e.globe;if(!l(t)||!t.show){this._frontFaceTranslucent=!1,this._backFaceTranslucent=!1,this._sunVisibleThroughGlobe=!0,this._environmentVisible=!0,this._useDepthPlane=!1;return}this._frontFaceAlphaByDistance=bwe(t.translucency.enabled,t.translucency.frontFaceAlpha,t.translucency.frontFaceAlphaByDistance,this._frontFaceAlphaByDistance),this._backFaceAlphaByDistance=bwe(t.translucency.enabled,t.translucency.backFaceAlpha,t.translucency.backFaceAlphaByDistance,this._backFaceAlphaByDistance),this._frontFaceTranslucent=xwe(t.translucency.enabled,this._frontFaceAlphaByDistance,t),this._backFaceTranslucent=xwe(t.translucency.enabled,this._backFaceAlphaByDistance,t),this._requiresManualDepthTest=yvt(this,e,t),this._sunVisibleThroughGlobe=pvt(this,e),this._environmentVisible=gvt(this,e),this._useDepthPlane=_vt(this,e),this._numberOfTextureUniforms=Avt(this),this._rectangle=ie.clone(t.translucency.rectangle,this._rectangle),bvt(this,e)};function bwe(e,t,n,i){return e?l(n)?(qt.clone(n,i),i.nearValue*=t,i.farValue*=t,i):(i.nearValue=t,i.farValue=t,i):(i.nearValue=1,i.farValue=1,i)}function xwe(e,t,n){return e&&(n.baseColor.alpha<1||t.nearValue<1||t.farValue<1)}function pvt(e,t){let n=e._frontFaceTranslucent,i=e._backFaceTranslucent;return n&&(t.cameraUnderground||i)}function gvt(e,t){return!t.cameraUnderground||e._frontFaceTranslucent}function _vt(e,t){return!t.cameraUnderground&&!e._frontFaceTranslucent}function yvt(e,t,n){return e._frontFaceTranslucent&&!e._backFaceTranslucent&&!n.depthTestAgainstTerrain&&t.mode!==re.SCENE2D&&t.context.depthTexture}function Avt(e){let t=0;return e._frontFaceTranslucent&&++t,e._requiresManualDepthTest&&++t,t}function bvt(e,t){e._derivedCommandsLength=Lte(e,t,!1,!1,e._derivedCommandTypes),e._derivedBlendCommandsLength=Lte(e,t,!0,!1,e._derivedBlendCommandTypes),e._derivedPickCommandsLength=Lte(e,t,!1,!0,e._derivedPickCommandTypes);let n,i=0;for(n=0;n<e._derivedCommandsLength;++n)i|=1<<e._derivedCommandTypes[n];for(n=0;n<e._derivedBlendCommandsLength;++n)i|=1<<e._derivedBlendCommandTypes[n];for(n=0;n<e._derivedPickCommandsLength;++n)i|=1<<e._derivedPickCommandTypes[n];let r=0;for(n=0;n<rT;++n)(i&1<<n)>0&&(e._derivedCommandTypesToUpdate[r++]=n);e._derivedCommandsToUpdateLength=r;let o=i!==e._derivedCommandKey;e._derivedCommandKey=i,e._derivedCommandsDirty=o,!l(e._derivedCommandPacks)&&e._frontFaceTranslucent&&(e._derivedCommandPacks=Lvt())}function Lte(e,t,n,i,r){let o=0,s=e._frontFaceTranslucent,a=e._backFaceTranslucent;if(!s)return o;let c=t.cameraUnderground,u=e._requiresManualDepthTest,f=i?uc.PICK_FRONT_FACE:u?uc.TRANSLUCENT_FRONT_FACE_MANUAL_DEPTH_TEST:uc.TRANSLUCENT_FRONT_FACE,d=i?uc.PICK_BACK_FACE:u?uc.TRANSLUCENT_BACK_FACE_MANUAL_DEPTH_TEST:uc.TRANSLUCENT_BACK_FACE;return t.mode===re.SCENE2D?(r[o++]=uc.DEPTH_ONLY_FRONT_FACE,r[o++]=f,o):(a?(n||(r[o++]=uc.DEPTH_ONLY_FRONT_AND_BACK_FACE),c?(r[o++]=f,r[o++]=d):(r[o++]=d,r[o++]=f)):c?(n||(r[o++]=uc.DEPTH_ONLY_BACK_FACE),r[o++]=uc.OPAQUE_FRONT_FACE,r[o++]=d):(n||(r[o++]=uc.DEPTH_ONLY_FRONT_FACE),r[o++]=uc.OPAQUE_BACK_FACE,r[o++]=f),o)}function qd(e,t){let n=e.indexOf(t);n>-1&&e.splice(n,1)}function Twe(e,t){return e.indexOf(t)>-1}function xvt(e,t){qd(e.defines,"TRANSLUCENT"),qd(t.defines,"TRANSLUCENT")}function Tvt(e,t){qd(e.defines,"GROUND_ATMOSPHERE"),qd(t.defines,"GROUND_ATMOSPHERE"),qd(e.defines,"FOG"),qd(t.defines,"FOG"),qd(e.defines,"TRANSLUCENT"),qd(t.defines,"TRANSLUCENT")}function Fte(e,t){if(Twe(t.defines,"TILE_LIMIT_RECTANGLE")||Twe(t.defines,"ENABLE_CLIPPING_PLANES"))return;let n=`void main() { out_FragColor = vec4(1.0); } -`;t.sources=[n]}function Zre(e,t){let n=t.sources,i=n.length;for(let o=0;o<i;++o)n[o]=Xe.replaceMain(n[o],"czm_globe_translucency_main");n.push(` +`;t.sources=[n]}function Bte(e,t){let n=t.sources,i=n.length;for(let o=0;o<i;++o)n[o]=Xe.replaceMain(n[o],"czm_globe_translucency_main");n.push(` uniform sampler2D u_classificationTexture; void main() @@ -10244,7 +10244,7 @@ void main() } out_FragColor = classificationColor * vec4(classificationColor.aaa, 1.0) + out_FragColor * (1.0 - classificationColor.a); } -`)}function SOe(e,t){Zre(e,t),Jd(e.defines,"GROUND_ATMOSPHERE"),Jd(t.defines,"GROUND_ATMOSPHERE"),Jd(e.defines,"FOG"),Jd(t.defines,"FOG")}function nOt(e,t){Zre(e,t),e.defines.push("GENERATE_POSITION"),t.defines.push("MANUAL_DEPTH_TEST")}function iOt(e,t){SOe(e,t),e.defines.push("GENERATE_POSITION"),t.defines.push("MANUAL_DEPTH_TEST")}function AOe(e,t){let n=`uniform sampler2D u_classificationTexture; +`)}function Dwe(e,t){Bte(e,t),qd(e.defines,"GROUND_ATMOSPHERE"),qd(t.defines,"GROUND_ATMOSPHERE"),qd(e.defines,"FOG"),qd(t.defines,"FOG")}function Evt(e,t){Bte(e,t),e.defines.push("GENERATE_POSITION"),t.defines.push("MANUAL_DEPTH_TEST")}function Cvt(e,t){Dwe(e,t),e.defines.push("GENERATE_POSITION"),t.defines.push("MANUAL_DEPTH_TEST")}function Ewe(e,t){let n=`uniform sampler2D u_classificationTexture; void main() { vec2 st = gl_FragCoord.xy / czm_viewport.zw; @@ -10255,13 +10255,13 @@ void main() } out_FragColor = pickColor; } -`;t.sources=[n]}function rOt(e,t,n,i,r,o){if(!l(r))return t;if(!i&&l(n))return n;let s=e.shaderCache.getDerivedShaderProgram(t,o);if(!l(s)){let a=t._attributeLocations,c=t.vertexShaderSource.clone(),u=t.fragmentShaderSource.clone();c.defines=l(c.defines)?c.defines.slice(0):[],u.defines=l(u.defines)?u.defines.slice(0):[],r(c,u),s=e.shaderCache.createDerivedShaderProgram(t,o,{vertexShaderSource:c,fragmentShaderSource:u,attributeLocations:a})}return s}function oOt(e){e.cull.face=Gi.BACK,e.cull.enabled=!0}function sOt(e){e.cull.face=Gi.FRONT,e.cull.enabled=!0}function aOt(e){e.cull.face=Gi.BACK,e.cull.enabled=!0,e.colorMask={red:!1,green:!1,blue:!1,alpha:!1}}function cOt(e){e.cull.face=Gi.FRONT,e.cull.enabled=!0,e.colorMask={red:!1,green:!1,blue:!1,alpha:!1}}function lOt(e){e.cull.enabled=!1,e.colorMask={red:!1,green:!1,blue:!1,alpha:!1}}function bOe(e){e.cull.face=Gi.BACK,e.cull.enabled=!0,e.depthMask=!1,e.blending=nn.ALPHA_BLEND}function xOe(e){e.cull.face=Gi.FRONT,e.cull.enabled=!0,e.depthMask=!1,e.blending=nn.ALPHA_BLEND}function uOt(e){e.cull.face=Gi.BACK,e.cull.enabled=!0,e.blending.enabled=!1}function fOt(e){e.cull.face=Gi.FRONT,e.cull.enabled=!0,e.blending.enabled=!1}function dOt(e,t,n,i,r){if(!l(i))return e;if(!n&&l(t))return t;let o=r[e.id];if(!l(o)){let s=Ge.getState(e);i(s),o=Ge.fromCache(s),r[e.id]=o}return o}function Ww(e){return{u_classificationTexture:function(){return e._globeTranslucencyFramebuffer.classificationTexture}}}function hOt(e,t,n,i,r){return l(r)?!i&&l(n)?n:Mt(t,r(e),!1):t}function bm(e){this.pass=e.pass,this.pickOnly=e.pickOnly,this.getShaderProgramFunction=e.getShaderProgramFunction,this.getRenderStateFunction=e.getRenderStateFunction,this.getUniformMapFunction=e.getUniformMapFunction,this.renderStateCache={}}function mOt(){return[new bm({pass:Ie.GLOBE,pickOnly:!1,getShaderProgramFunction:eOt,getRenderStateFunction:oOt,getUniformMapFunction:void 0}),new bm({pass:Ie.GLOBE,pickOnly:!1,getShaderProgramFunction:tOt,getRenderStateFunction:sOt,getUniformMapFunction:void 0}),new bm({pass:Ie.GLOBE,pickOnly:!1,getShaderProgramFunction:Jre,getRenderStateFunction:aOt,getUniformMapFunction:void 0}),new bm({pass:Ie.GLOBE,pickOnly:!1,getShaderProgramFunction:Jre,getRenderStateFunction:cOt,getUniformMapFunction:void 0}),new bm({pass:Ie.GLOBE,pickOnly:!1,getShaderProgramFunction:Jre,getRenderStateFunction:lOt,getUniformMapFunction:void 0}),new bm({pass:Ie.TRANSLUCENT,pickOnly:!1,getShaderProgramFunction:Zre,getRenderStateFunction:bOe,getUniformMapFunction:Ww}),new bm({pass:Ie.TRANSLUCENT,pickOnly:!1,getShaderProgramFunction:SOe,getRenderStateFunction:xOe,getUniformMapFunction:Ww}),new bm({pass:Ie.TRANSLUCENT,pickOnly:!1,getShaderProgramFunction:nOt,getRenderStateFunction:bOe,getUniformMapFunction:Ww}),new bm({pass:Ie.TRANSLUCENT,pickOnly:!1,getShaderProgramFunction:iOt,getRenderStateFunction:xOe,getUniformMapFunction:Ww}),new bm({pass:Ie.TRANSLUCENT,pickOnly:!0,getShaderProgramFunction:AOe,getRenderStateFunction:uOt,getUniformMapFunction:Ww}),new bm({pass:Ie.TRANSLUCENT,pickOnly:!0,getShaderProgramFunction:AOe,getRenderStateFunction:fOt,getUniformMapFunction:Ww})]}var TOe=new Array(OT),EOe=new Array(OT);MT.prototype.updateDerivedCommands=function(e,t){let n=this._derivedCommandTypesToUpdate,i=this._derivedCommandsToUpdateLength;if(i!==0){for(let r=0;r<i;++r)EOe[r]=this._derivedCommandPacks[n[r]],TOe[r]=vOe[n[r]];pOt(this,e,i,n,TOe,EOe,t)}};function pOt(e,t,n,i,r,o,s){let a=t.derivedCommands.globeTranslucency,c=e._derivedCommandsDirty;if(t.dirty||!l(a)||c){t.dirty=!1,l(a)||(a={},t.derivedCommands.globeTranslucency=a);let u=s.frameNumber,f=a.uniformMapDirtyFrame??0,d=a.shaderProgramDirtyFrame??0,p=a.renderStateDirtyFrame??0,g=a.uniformMap!==t.uniformMap,m=a.shaderProgramId!==t.shaderProgram.id,y=a.renderStateId!==t.renderState.id;g&&(a.uniformMapDirtyFrame=u),m&&(a.shaderProgramDirtyFrame=u),y&&(a.renderStateDirtyFrame=u),a.uniformMap=t.uniformMap,a.shaderProgramId=t.shaderProgram.id,a.renderStateId=t.renderState.id;for(let A=0;A<n;++A){let b=o[A],x=i[A],T=r[A],E=a[T],v,S,I;l(E)?(v=E.uniformMap,S=E.shaderProgram,I=E.renderState):(v=void 0,S=void 0,I=void 0),E=at.shallowClone(t,E),a[T]=E;let R=E.derivedCommands.uniformMapDirtyFrame??0,O=E.derivedCommands.shaderProgramDirtyFrame??0,L=E.derivedCommands.renderStateDirtyFrame??0,_=g||R<f,C=m||O<d,w=y||L<p;_&&(E.derivedCommands.uniformMapDirtyFrame=u),C&&(E.derivedCommands.shaderProgramDirtyFrame=u),w&&(E.derivedCommands.renderStateDirtyFrame=u),E.derivedCommands.type=x,E.pass=b.pass,E.pickOnly=b.pickOnly,E.uniformMap=hOt(e,t.uniformMap,v,_,b.getUniformMapFunction),E.shaderProgram=rOt(s.context,t.shaderProgram,S,C,b.getShaderProgramFunction,T),E.renderState=dOt(t.renderState,I,w,b.getRenderStateFunction,b.renderStateCache)}}}MT.prototype.pushDerivedCommands=function(e,t,n){let i=n.passes.pick||n.passes.pickVoxel;if(i&&t)return;let r=this._derivedCommandTypes,o=this._derivedCommandsLength;if(i?(r=this._derivedPickCommandTypes,o=this._derivedPickCommandsLength):t&&(r=this._derivedBlendCommandTypes,o=this._derivedBlendCommandsLength),o===0){n.commandList.push(e);return}let s=e.derivedCommands.globeTranslucency;for(let a=0;a<o;++a){let c=vOe[r[a]];n.commandList.push(s[c])}};function wOe(e,t,n,i,r,o){for(let s=0;s<t;++s){let a=e[s],c=a.derivedCommands.type;(!l(o)||o.indexOf(c)>-1)&&n(a,i,r)}}function COe(e,t,n,i,r){for(let o=0;o<t;++o)n(e[o],i,r)}var gOt=[fc.OPAQUE_FRONT_FACE,fc.OPAQUE_BACK_FACE],_Ot=[fc.DEPTH_ONLY_FRONT_FACE,fc.DEPTH_ONLY_BACK_FACE,fc.DEPTH_ONLY_FRONT_AND_BACK_FACE];MT.prototype.executeGlobeCommands=function(e,t,n,i,r){let o=i.context,s=e.commands[Ie.GLOBE],a=e.indices[Ie.GLOBE];a!==0&&(this._globeTranslucencyFramebuffer=n,n.clearClassification(o,r),wOe(s,a,t,i,r,gOt))};MT.prototype.executeGlobeClassificationCommands=function(e,t,n,i,r){let{context:o}=i,{uniformState:s}=o,a=e.commands[Ie.GLOBE],c=e.indices[Ie.GLOBE],u=e.commands[Ie.TERRAIN_CLASSIFICATION],f=e.indices[Ie.TERRAIN_CLASSIFICATION];if(c===0||f===0)return;let d=this._frontFaceTranslucent,p=this._backFaceTranslucent;if((!d||!p)&&COe(u,f,t,i,r),!d&&!p)return;this._globeTranslucencyFramebuffer=n;let g=s.globeDepthTexture,m=r.framebuffer;if(r.framebuffer=n.classificationFramebuffer,wOe(a,c,t,i,r,_Ot),o.depthTexture){let y=n.packDepth(o,r);s.globeDepthTexture=y}COe(u,f,t,i,r),s.globeDepthTexture=g,r.framebuffer=m};var UG=MT;var Bf=`uniform sampler2D colorTexture; +`;t.sources=[n]}function vvt(e,t,n,i,r,o){if(!l(r))return t;if(!i&&l(n))return n;let s=e.shaderCache.getDerivedShaderProgram(t,o);if(!l(s)){let a=t._attributeLocations,c=t.vertexShaderSource.clone(),u=t.fragmentShaderSource.clone();c.defines=l(c.defines)?c.defines.slice(0):[],u.defines=l(u.defines)?u.defines.slice(0):[],r(c,u),s=e.shaderCache.createDerivedShaderProgram(t,o,{vertexShaderSource:c,fragmentShaderSource:u,attributeLocations:a})}return s}function Svt(e){e.cull.face=Hi.BACK,e.cull.enabled=!0}function wvt(e){e.cull.face=Hi.FRONT,e.cull.enabled=!0}function Ivt(e){e.cull.face=Hi.BACK,e.cull.enabled=!0,e.colorMask={red:!1,green:!1,blue:!1,alpha:!1}}function Pvt(e){e.cull.face=Hi.FRONT,e.cull.enabled=!0,e.colorMask={red:!1,green:!1,blue:!1,alpha:!1}}function Dvt(e){e.cull.enabled=!1,e.colorMask={red:!1,green:!1,blue:!1,alpha:!1}}function Cwe(e){e.cull.face=Hi.BACK,e.cull.enabled=!0,e.depthMask=!1,e.blending=nn.ALPHA_BLEND}function vwe(e){e.cull.face=Hi.FRONT,e.cull.enabled=!0,e.depthMask=!1,e.blending=nn.ALPHA_BLEND}function Rvt(e){e.cull.face=Hi.BACK,e.cull.enabled=!0,e.blending.enabled=!1}function Ovt(e){e.cull.face=Hi.FRONT,e.cull.enabled=!0,e.blending.enabled=!1}function Mvt(e,t,n,i,r){if(!l(i))return e;if(!n&&l(t))return t;let o=r[e.id];if(!l(o)){let s=Ge.getState(e);i(s),o=Ge.fromCache(s),r[e.id]=o}return o}function QS(e){return{u_classificationTexture:function(){return e._globeTranslucencyFramebuffer.classificationTexture}}}function Nvt(e,t,n,i,r){return l(r)?!i&&l(n)?n:Mt(t,r(e),!1):t}function um(e){this.pass=e.pass,this.pickOnly=e.pickOnly,this.getShaderProgramFunction=e.getShaderProgramFunction,this.getRenderStateFunction=e.getRenderStateFunction,this.getUniformMapFunction=e.getUniformMapFunction,this.renderStateCache={}}function Lvt(){return[new um({pass:Ie.GLOBE,pickOnly:!1,getShaderProgramFunction:xvt,getRenderStateFunction:Svt,getUniformMapFunction:void 0}),new um({pass:Ie.GLOBE,pickOnly:!1,getShaderProgramFunction:Tvt,getRenderStateFunction:wvt,getUniformMapFunction:void 0}),new um({pass:Ie.GLOBE,pickOnly:!1,getShaderProgramFunction:Fte,getRenderStateFunction:Ivt,getUniformMapFunction:void 0}),new um({pass:Ie.GLOBE,pickOnly:!1,getShaderProgramFunction:Fte,getRenderStateFunction:Pvt,getUniformMapFunction:void 0}),new um({pass:Ie.GLOBE,pickOnly:!1,getShaderProgramFunction:Fte,getRenderStateFunction:Dvt,getUniformMapFunction:void 0}),new um({pass:Ie.TRANSLUCENT,pickOnly:!1,getShaderProgramFunction:Bte,getRenderStateFunction:Cwe,getUniformMapFunction:QS}),new um({pass:Ie.TRANSLUCENT,pickOnly:!1,getShaderProgramFunction:Dwe,getRenderStateFunction:vwe,getUniformMapFunction:QS}),new um({pass:Ie.TRANSLUCENT,pickOnly:!1,getShaderProgramFunction:Evt,getRenderStateFunction:Cwe,getUniformMapFunction:QS}),new um({pass:Ie.TRANSLUCENT,pickOnly:!1,getShaderProgramFunction:Cvt,getRenderStateFunction:vwe,getUniformMapFunction:QS}),new um({pass:Ie.TRANSLUCENT,pickOnly:!0,getShaderProgramFunction:Ewe,getRenderStateFunction:Rvt,getUniformMapFunction:QS}),new um({pass:Ie.TRANSLUCENT,pickOnly:!0,getShaderProgramFunction:Ewe,getRenderStateFunction:Ovt,getUniformMapFunction:QS})]}var Swe=new Array(rT),wwe=new Array(rT);oT.prototype.updateDerivedCommands=function(e,t){let n=this._derivedCommandTypesToUpdate,i=this._derivedCommandsToUpdateLength;if(i!==0){for(let r=0;r<i;++r)wwe[r]=this._derivedCommandPacks[n[r]],Swe[r]=Pwe[n[r]];Fvt(this,e,i,n,Swe,wwe,t)}};function Fvt(e,t,n,i,r,o,s){let a=t.derivedCommands.globeTranslucency,c=e._derivedCommandsDirty;if(t.dirty||!l(a)||c){t.dirty=!1,l(a)||(a={},t.derivedCommands.globeTranslucency=a);let u=s.frameNumber,f=a.uniformMapDirtyFrame??0,d=a.shaderProgramDirtyFrame??0,p=a.renderStateDirtyFrame??0,g=a.uniformMap!==t.uniformMap,m=a.shaderProgramId!==t.shaderProgram.id,y=a.renderStateId!==t.renderState.id;g&&(a.uniformMapDirtyFrame=u),m&&(a.shaderProgramDirtyFrame=u),y&&(a.renderStateDirtyFrame=u),a.uniformMap=t.uniformMap,a.shaderProgramId=t.shaderProgram.id,a.renderStateId=t.renderState.id;for(let A=0;A<n;++A){let b=o[A],x=i[A],T=r[A],E=a[T],v,S,I;l(E)?(v=E.uniformMap,S=E.shaderProgram,I=E.renderState):(v=void 0,S=void 0,I=void 0),E=at.shallowClone(t,E),a[T]=E;let R=E.derivedCommands.uniformMapDirtyFrame??0,O=E.derivedCommands.shaderProgramDirtyFrame??0,L=E.derivedCommands.renderStateDirtyFrame??0,_=g||R<f,C=m||O<d,w=y||L<p;_&&(E.derivedCommands.uniformMapDirtyFrame=u),C&&(E.derivedCommands.shaderProgramDirtyFrame=u),w&&(E.derivedCommands.renderStateDirtyFrame=u),E.derivedCommands.type=x,E.pass=b.pass,E.pickOnly=b.pickOnly,E.uniformMap=Nvt(e,t.uniformMap,v,_,b.getUniformMapFunction),E.shaderProgram=vvt(s.context,t.shaderProgram,S,C,b.getShaderProgramFunction,T),E.renderState=Mvt(t.renderState,I,w,b.getRenderStateFunction,b.renderStateCache)}}}oT.prototype.pushDerivedCommands=function(e,t,n){let i=n.passes.pick||n.passes.pickVoxel;if(i&&t)return;let r=this._derivedCommandTypes,o=this._derivedCommandsLength;if(i?(r=this._derivedPickCommandTypes,o=this._derivedPickCommandsLength):t&&(r=this._derivedBlendCommandTypes,o=this._derivedBlendCommandsLength),o===0){n.commandList.push(e);return}let s=e.derivedCommands.globeTranslucency;for(let a=0;a<o;++a){let c=Pwe[r[a]];n.commandList.push(s[c])}};function Rwe(e,t,n,i,r,o){for(let s=0;s<t;++s){let a=e[s],c=a.derivedCommands.type;(!l(o)||o.indexOf(c)>-1)&&n(a,i,r)}}function Iwe(e,t,n,i,r){for(let o=0;o<t;++o)n(e[o],i,r)}var Bvt=[uc.OPAQUE_FRONT_FACE,uc.OPAQUE_BACK_FACE],kvt=[uc.DEPTH_ONLY_FRONT_FACE,uc.DEPTH_ONLY_BACK_FACE,uc.DEPTH_ONLY_FRONT_AND_BACK_FACE];oT.prototype.executeGlobeCommands=function(e,t,n,i,r){let o=i.context,s=e.commands[Ie.GLOBE],a=e.indices[Ie.GLOBE];a!==0&&(this._globeTranslucencyFramebuffer=n,n.clearClassification(o,r),Rwe(s,a,t,i,r,Bvt))};oT.prototype.executeGlobeClassificationCommands=function(e,t,n,i,r){let{context:o}=i,{uniformState:s}=o,a=e.commands[Ie.GLOBE],c=e.indices[Ie.GLOBE],u=e.commands[Ie.TERRAIN_CLASSIFICATION],f=e.indices[Ie.TERRAIN_CLASSIFICATION];if(c===0||f===0)return;let d=this._frontFaceTranslucent,p=this._backFaceTranslucent;if((!d||!p)&&Iwe(u,f,t,i,r),!d&&!p)return;this._globeTranslucencyFramebuffer=n;let g=s.globeDepthTexture,m=r.framebuffer;if(r.framebuffer=n.classificationFramebuffer,Rwe(a,c,t,i,r,kvt),o.depthTexture){let y=n.packDepth(o,r);s.globeDepthTexture=y}Iwe(u,f,t,i,r),s.globeDepthTexture=g,r.framebuffer=m};var v6=oT;var Pf=`uniform sampler2D colorTexture; in vec2 v_textureCoordinates; void main() { out_FragColor = texture(colorTexture, v_textureCoordinates); } -`;function l0(){this._numSamples=1,this.previousFramebuffer=void 0,this._previousFramebuffer=void 0,this._depthStencilTexture=void 0,this._depthStencilRenderbuffer=void 0,this._fbo=new ci({depthStencil:!0,createDepthAttachments:!1}),this._fboClassified=new ci({depthStencil:!0,createDepthAttachments:!1}),this._rsUnclassified=void 0,this._rsClassified=void 0,this._unclassifiedCommand=void 0,this._classifiedCommand=void 0,this._translucentCommand=void 0,this._clearColorCommand=new fi({color:new z(0,0,0,0),owner:this}),this._clearCommand=new fi({color:new z(0,0,0,0),depth:1,stencil:0});let e=this;this._uniformMap={colorTexture:function(){return e._fbo.getColorTexture()},depthTexture:function(){return e._depthStencilTexture},classifiedTexture:function(){return e._fboClassified.getColorTexture()}}}Object.defineProperties(l0.prototype,{unclassifiedCommand:{get:function(){return this._unclassifiedCommand}}});l0.isTranslucencySupported=function(e){return e.depthTexture&&e.fragmentDepth};var yOt={depthMask:!1,stencilTest:{enabled:!0,frontFunction:ti.EQUAL,frontOperation:{fail:Rt.KEEP,zFail:Rt.KEEP,zPass:Rt.KEEP},backFunction:ti.NEVER,reference:0,mask:Xt.CLASSIFICATION_MASK},blending:nn.ALPHA_BLEND},AOt={depthMask:!1,stencilTest:{enabled:!0,frontFunction:ti.NOT_EQUAL,frontOperation:{fail:Rt.KEEP,zFail:Rt.KEEP,zPass:Rt.KEEP},backFunction:ti.NEVER,reference:0,mask:Xt.CLASSIFICATION_MASK},blending:nn.ALPHA_BLEND},bOt={depthMask:!0,depthTest:{enabled:!0},stencilTest:Xt.setCesium3DTileBit(),stencilMask:Xt.CESIUM_3D_TILE_MASK,blending:nn.ALPHA_BLEND},xOt=`uniform sampler2D colorTexture; +`;function Yp(){this._numSamples=1,this.previousFramebuffer=void 0,this._previousFramebuffer=void 0,this._depthStencilTexture=void 0,this._depthStencilRenderbuffer=void 0,this._fbo=new ci({depthStencil:!0,createDepthAttachments:!1}),this._fboClassified=new ci({depthStencil:!0,createDepthAttachments:!1}),this._rsUnclassified=void 0,this._rsClassified=void 0,this._unclassifiedCommand=void 0,this._classifiedCommand=void 0,this._translucentCommand=void 0,this._clearColorCommand=new fi({color:new z(0,0,0,0),owner:this}),this._clearCommand=new fi({color:new z(0,0,0,0),depth:1,stencil:0});let e=this;this._uniformMap={colorTexture:function(){return e._fbo.getColorTexture()},depthTexture:function(){return e._depthStencilTexture},classifiedTexture:function(){return e._fboClassified.getColorTexture()}}}Object.defineProperties(Yp.prototype,{unclassifiedCommand:{get:function(){return this._unclassifiedCommand}}});Yp.isTranslucencySupported=function(e){return e.depthTexture&&e.fragmentDepth};var Uvt={depthMask:!1,stencilTest:{enabled:!0,frontFunction:ei.EQUAL,frontOperation:{fail:Rt.KEEP,zFail:Rt.KEEP,zPass:Rt.KEEP},backFunction:ei.NEVER,reference:0,mask:Xt.CLASSIFICATION_MASK},blending:nn.ALPHA_BLEND},zvt={depthMask:!1,stencilTest:{enabled:!0,frontFunction:ei.NOT_EQUAL,frontOperation:{fail:Rt.KEEP,zFail:Rt.KEEP,zPass:Rt.KEEP},backFunction:ei.NEVER,reference:0,mask:Xt.CLASSIFICATION_MASK},blending:nn.ALPHA_BLEND},Vvt={depthMask:!0,depthTest:{enabled:!0},stencilTest:Xt.setCesium3DTileBit(),stencilMask:Xt.CESIUM_3D_TILE_MASK,blending:nn.ALPHA_BLEND},jvt=`uniform sampler2D colorTexture; uniform sampler2D depthTexture; uniform sampler2D classifiedTexture; in vec2 v_textureCoordinates; @@ -10289,7 +10289,7 @@ void main() out_FragColor = color * highlightColor; gl_FragDepth = texture(depthTexture, v_textureCoordinates).r; } -`,TOt=`uniform sampler2D colorTexture; +`,Hvt=`uniform sampler2D colorTexture; in vec2 v_textureCoordinates; void main() { @@ -10304,7 +10304,7 @@ void main() out_FragColor = color; #endif } -`;l0.prototype.update=function(e,t,n){let i=this._fbo.getColorTexture(),r=this.previousFramebuffer!==this._previousFramebuffer;this._previousFramebuffer=this.previousFramebuffer;let o=this._numSamples!==t,s=e.drawingBufferWidth,a=e.drawingBufferHeight,c=!l(i)||i.width!==s||i.height!==a;if((c||r||o)&&(this._numSamples=t,this._depthStencilTexture=this._depthStencilTexture&&this._depthStencilTexture.destroy(),this._depthStencilRenderbuffer=this._depthStencilRenderbuffer&&this._depthStencilRenderbuffer.destroy(),l(this._previousFramebuffer)||(this._depthStencilTexture=new Dt({context:e,width:s,height:a,pixelFormat:$e.DEPTH_STENCIL,pixelDatatype:ze.UNSIGNED_INT_24_8}),t>1&&(this._depthStencilRenderbuffer=new rd({context:e,width:s,height:a,format:fu.DEPTH24_STENCIL8,numSamples:t})))),!l(this._fbo.framebuffer)||c||r||o){this._fbo.destroy(),this._fboClassified.destroy();let u,f;l(this._previousFramebuffer)?(u=n.getDepthStencilTexture(),f=n.getDepthStencilRenderbuffer()):(u=this._depthStencilTexture,f=this._depthStencilRenderbuffer),this._fbo.setDepthStencilTexture(u),l(f)&&this._fbo.setDepthStencilRenderbuffer(f),this._fbo.update(e,s,a,t),l(this._previousFramebuffer)||(this._fboClassified.setDepthStencilTexture(u),this._fboClassified.update(e,s,a))}if(l(this._rsUnclassified)||(this._rsUnclassified=Ge.fromCache(yOt),this._rsClassified=Ge.fromCache(AOt),this._rsDefault=Ge.fromCache(bOt)),!l(this._unclassifiedCommand)||r||o){l(this._unclassifiedCommand)&&(this._unclassifiedCommand.shaderProgram=this._unclassifiedCommand.shaderProgram&&this._unclassifiedCommand.shaderProgram.destroy(),this._classifiedCommand.shaderProgram=this._classifiedCommand.shaderProgram&&this._classifiedCommand.shaderProgram.destroy());let u=l(this._previousFramebuffer)?TOt:xOt,f=new Xe({defines:["UNCLASSIFIED"],sources:[u]}),d=new Xe({sources:[u]});this._unclassifiedCommand=e.createViewportQuadCommand(f,{renderState:l(this._previousFramebuffer)?this._rsUnclassified:this._rsDefault,uniformMap:this._uniformMap,owner:this}),this._classifiedCommand=e.createViewportQuadCommand(d,{renderState:l(this._previousFramebuffer)?this._rsClassified:this._rsDefault,uniformMap:this._uniformMap,owner:this}),l(this._translucentCommand)&&(this._translucentCommand.shaderProgram=this._translucentCommand.shaderProgram&&this._translucentCommand.shaderProgram.destroy()),l(this._previousFramebuffer)||(this._translucentCommand=e.createViewportQuadCommand(Bf,{renderState:this._rsUnclassified,uniformMap:this._uniformMap,owner:this}))}};l0.prototype.prepareTextures=function(e,t){this._fbo._numSamples>1&&this._fbo.prepareTextures(e,t)};l0.prototype.clear=function(e,t){l(this._previousFramebuffer)?this._fbo.clear(e,this._clearColorCommand,t):(this._fbo.clear(e,this._clearCommand,t),this._fboClassified.clear(e,this._clearCommand,t))};l0.prototype.executeClassified=function(e,t){if(!l(this._previousFramebuffer)){let n=t.framebuffer;this.prepareTextures(e,!0),t.framebuffer=this._fboClassified.framebuffer,this._translucentCommand.execute(e,t),t.framebuffer=n}this._classifiedCommand.execute(e,t)};l0.prototype.executeUnclassified=function(e,t){this._unclassifiedCommand.execute(e,t)};l0.prototype.isDestroyed=function(){return!1};l0.prototype.destroy=function(){return this._fbo.destroy(),this._fboClassified.destroy(),this._depthStencilTexture=this._depthStencilTexture&&this._depthStencilTexture.destroy(),this._depthStencilRenderbuffer=this._depthStencilRenderbuffer&&this._depthStencilRenderbuffer.destroy(),l(this._unclassifiedCommand)&&(this._unclassifiedCommand.shaderProgram=this._unclassifiedCommand.shaderProgram&&this._unclassifiedCommand.shaderProgram.destroy(),this._classifiedCommand.shaderProgram=this._classifiedCommand.shaderProgram&&this._classifiedCommand.shaderProgram.destroy()),le(this)};var qO=l0;function zG(e){this._total=e,this.usedThisFrame=0,this.stolenFromMeThisFrame=0,this.starvedThisFrame=!1,this.starvedLastFrame=!1}Object.defineProperties(zG.prototype,{total:{get:function(){return this._total}}});function UA(e){let t=new Array(Xc.NUMBER_OF_JOB_TYPES);t[Xc.TEXTURE]=new zG(l(e)?e[Xc.TEXTURE]:10),t[Xc.PROGRAM]=new zG(l(e)?e[Xc.PROGRAM]:10),t[Xc.BUFFER]=new zG(l(e)?e[Xc.BUFFER]:30);let n=t.length,i,r=0;for(i=0;i<n;++i)r+=t[i].total;let o=new Array(n);for(i=0;i<n;++i)o[i]=!1;this._totalBudget=r,this._totalUsedThisFrame=0,this._budgets=t,this._executedThisFrame=o}UA.getTimestamp=xn;Object.defineProperties(UA.prototype,{totalBudget:{get:function(){return this._totalBudget}}});UA.prototype.disableThisFrame=function(){this._totalUsedThisFrame=this._totalBudget};UA.prototype.resetBudgets=function(){let e=this._budgets,t=e.length;for(let n=0;n<t;++n){let i=e[n];i.starvedLastFrame=i.starvedThisFrame,i.starvedThisFrame=!1,i.usedThisFrame=0,i.stolenFromMeThisFrame=0}this._totalUsedThisFrame=0};UA.prototype.execute=function(e,t){let n=this._budgets,i=n[t],r=this._executedThisFrame[t];if(this._totalUsedThisFrame>=this._totalBudget&&r)return i.starvedThisFrame=!0,!1;let o;if(i.usedThisFrame+i.stolenFromMeThisFrame>=i.total){let c=n.length,u;for(u=0;u<c&&(o=n[u],!(o.usedThisFrame+o.stolenFromMeThisFrame<o.total&&!o.starvedLastFrame));++u);if(u===c&&r)return!1;r&&(i.starvedThisFrame=!0)}let s=UA.getTimestamp();e.execute();let a=UA.getTimestamp()-s;return this._totalUsedThisFrame+=a,o?o.stolenFromMeThisFrame+=a:i.usedThisFrame+=a,this._executedThisFrame[t]=!0,!0};var VG=UA;function jG(e){e=e??H.EMPTY_OBJECT;let t=kn(e.container);this._container=t;let n=document.createElement("div");n.className="cesium-performanceDisplay";let i=document.createElement("div");i.className="cesium-performanceDisplay-fps",this._fpsText=document.createTextNode(""),i.appendChild(this._fpsText);let r=document.createElement("div");r.className="cesium-performanceDisplay-ms",this._msText=document.createTextNode(""),r.appendChild(this._msText),n.appendChild(r),n.appendChild(i),this._container.appendChild(n),this._lastFpsSampleTime=xn(),this._lastMsSampleTime=xn(),this._fpsFrameCount=0,this._msFrameCount=0,this._throttled=!1;let o=document.createElement("div");o.className="cesium-performanceDisplay-throttled",this._throttledText=document.createTextNode(""),o.appendChild(this._throttledText),n.appendChild(o)}Object.defineProperties(jG.prototype,{throttled:{get:function(){return this._throttled},set:function(e){this._throttled!==e&&(e?this._throttledText.nodeValue="(throttled)":this._throttledText.nodeValue="",this._throttled=e)}}});jG.prototype.update=function(e){let t=xn(),n=e??!0;this._fpsFrameCount++;let i=t-this._lastFpsSampleTime;if(i>1e3){let o="N/A";n&&(o=this._fpsFrameCount*1e3/i|0),this._fpsText.nodeValue=`${o} FPS`,this._lastFpsSampleTime=t,this._fpsFrameCount=0}this._msFrameCount++;let r=t-this._lastMsSampleTime;if(r>200){let o="N/A";n&&(o=(r/this._msFrameCount).toFixed(2)),this._msText.nodeValue=`${o} MS`,this._lastMsSampleTime=t,this._msFrameCount=0}};jG.prototype.destroy=function(){return le(this)};var zA=jG;var dc={};dc.decodeRawMetadataValue=function(e,t,n){switch(e){case Ft.INT8:return t.getInt8(n);case Ft.UINT8:return t.getUint8(n);case Ft.INT16:return t.getInt16(n,!0);case Ft.UINT16:return t.getUint16(n,!0);case Ft.INT32:return t.getInt32(n,!0);case Ft.UINT32:return t.getUint32(n,!0);case Ft.INT64:return t.getBigInt64(n,!0);case Ft.UINT64:return t.getBigUint64(n,!0);case Ft.FLOAT32:return t.getFloat32(n,!0);case Ft.FLOAT64:return t.getFloat64(n,!0)}throw new oe(`Invalid component type: ${e}`)};dc.decodeRawMetadataValueComponent=function(e,t,n){let i=e.componentType,r=dc.decodeRawMetadataValue(i,t,n);return e.normalized?Ft.normalize(r,i):r};dc.decodeRawMetadataValueElement=function(e,t,n){let i=e.componentType,r=Ft.getSizeInBytes(i),o=e.type,s=bt.getComponentCount(o),a=r*s;if(s>1){let f=Array(s);for(let d=0;d<s;d++){let p=n*a+d*r,g=dc.decodeRawMetadataValueComponent(e,t,p);f[d]=g}return f}let c=n*a;return dc.decodeRawMetadataValueComponent(e,t,c)};dc.decodeRawMetadataValues=function(e,t){let n=new DataView(t.buffer,t.byteOffset,t.byteLength);if(e.isArray){let r=e.arrayLength,o=Array(r);for(let s=0;s<r;s++){let a=dc.decodeRawMetadataValueElement(e,n,s);o[s]=a}return o}return dc.decodeRawMetadataValueElement(e,n,0)};dc.convertToObjectType=function(e,t){if(!l(t)||e===bt.SCALAR||e===bt.STRING||e===bt.BOOLEAN||e===bt.ENUM)return t;let n=t.map(i=>Number(i));switch(e){case bt.VEC2:return U.unpack(n,0,new U);case bt.VEC3:return h.unpack(n,0,new h);case bt.VEC4:return se.unpack(n,0,new se);case bt.MAT2:return $i.unpack(n,0,new $i);case bt.MAT3:return $.unpack(n,0,new $);case bt.MAT4:return M.unpack(n,0,new M)}throw new oe(`Invalid metadata object type: ${e}`)};dc.convertFromObjectType=function(e,t){if(!l(t)||e===bt.SCALAR||e===bt.STRING||e===bt.BOOLEAN||e===bt.ENUM)return t;switch(e){case bt.VEC2:return U.pack(t,Array(2));case bt.VEC3:return h.pack(t,Array(3));case bt.VEC4:return se.pack(t,Array(4));case bt.MAT2:return $i.pack(t,Array(4));case bt.MAT3:return $.pack(t,Array(9));case bt.MAT4:return M.pack(t,Array(16))}throw new oe(`Invalid metadata object type: ${e}`)};dc.decodeMetadataValues=function(e,t,n){let i=dc.decodeRawMetadataValues(e,n);if(t.hasValueTransform){let o=dc.convertFromObjectType(e.type,t.offset),s=dc.convertFromObjectType(e.type,t.scale);i=Z0.valueTransformInPlace(i,o,s,Ft.applyValueTransform)}if(e.isArray){let o=e.arrayLength,s=Array(o);for(let a=0;a<o;a++){let c=i[a],u=dc.convertToObjectType(e.type,c);s[a]=u}return s}return dc.convertToObjectType(e.type,i)};var HG=Object.freeze(dc);function NT(){this._framebuffer=new ci,this._textureToCopy=void 0,this._copyDepthCommand=void 0}Object.defineProperties(NT.prototype,{framebuffer:{get:function(){return this._framebuffer.framebuffer}}});function EOt(e,t,n){let{width:i,height:r}=n;e._framebuffer.update(t,i,r)}function COt(e,t,n){l(e._copyDepthCommand)||(e._copyDepthCommand=t.createViewportQuadCommand(`uniform highp sampler2D colorTexture; +`;Yp.prototype.update=function(e,t,n){let i=this._fbo.getColorTexture(),r=this.previousFramebuffer!==this._previousFramebuffer;this._previousFramebuffer=this.previousFramebuffer;let o=this._numSamples!==t,s=e.drawingBufferWidth,a=e.drawingBufferHeight,c=!l(i)||i.width!==s||i.height!==a;if((c||r||o)&&(this._numSamples=t,this._depthStencilTexture=this._depthStencilTexture&&this._depthStencilTexture.destroy(),this._depthStencilRenderbuffer=this._depthStencilRenderbuffer&&this._depthStencilRenderbuffer.destroy(),l(this._previousFramebuffer)||(this._depthStencilTexture=new Dt({context:e,width:s,height:a,pixelFormat:$e.DEPTH_STENCIL,pixelDatatype:ze.UNSIGNED_INT_24_8}),t>1&&(this._depthStencilRenderbuffer=new id({context:e,width:s,height:a,format:fu.DEPTH24_STENCIL8,numSamples:t})))),!l(this._fbo.framebuffer)||c||r||o){this._fbo.destroy(),this._fboClassified.destroy();let u,f;l(this._previousFramebuffer)?(u=n.getDepthStencilTexture(),f=n.getDepthStencilRenderbuffer()):(u=this._depthStencilTexture,f=this._depthStencilRenderbuffer),this._fbo.setDepthStencilTexture(u),l(f)&&this._fbo.setDepthStencilRenderbuffer(f),this._fbo.update(e,s,a,t),l(this._previousFramebuffer)||(this._fboClassified.setDepthStencilTexture(u),this._fboClassified.update(e,s,a))}if(l(this._rsUnclassified)||(this._rsUnclassified=Ge.fromCache(Uvt),this._rsClassified=Ge.fromCache(zvt),this._rsDefault=Ge.fromCache(Vvt)),!l(this._unclassifiedCommand)||r||o){l(this._unclassifiedCommand)&&(this._unclassifiedCommand.shaderProgram=this._unclassifiedCommand.shaderProgram&&this._unclassifiedCommand.shaderProgram.destroy(),this._classifiedCommand.shaderProgram=this._classifiedCommand.shaderProgram&&this._classifiedCommand.shaderProgram.destroy());let u=l(this._previousFramebuffer)?Hvt:jvt,f=new Xe({defines:["UNCLASSIFIED"],sources:[u]}),d=new Xe({sources:[u]});this._unclassifiedCommand=e.createViewportQuadCommand(f,{renderState:l(this._previousFramebuffer)?this._rsUnclassified:this._rsDefault,uniformMap:this._uniformMap,owner:this}),this._classifiedCommand=e.createViewportQuadCommand(d,{renderState:l(this._previousFramebuffer)?this._rsClassified:this._rsDefault,uniformMap:this._uniformMap,owner:this}),l(this._translucentCommand)&&(this._translucentCommand.shaderProgram=this._translucentCommand.shaderProgram&&this._translucentCommand.shaderProgram.destroy()),l(this._previousFramebuffer)||(this._translucentCommand=e.createViewportQuadCommand(Pf,{renderState:this._rsUnclassified,uniformMap:this._uniformMap,owner:this}))}};Yp.prototype.prepareTextures=function(e,t){this._fbo._numSamples>1&&this._fbo.prepareTextures(e,t)};Yp.prototype.clear=function(e,t){l(this._previousFramebuffer)?this._fbo.clear(e,this._clearColorCommand,t):(this._fbo.clear(e,this._clearCommand,t),this._fboClassified.clear(e,this._clearCommand,t))};Yp.prototype.executeClassified=function(e,t){if(!l(this._previousFramebuffer)){let n=t.framebuffer;this.prepareTextures(e,!0),t.framebuffer=this._fboClassified.framebuffer,this._translucentCommand.execute(e,t),t.framebuffer=n}this._classifiedCommand.execute(e,t)};Yp.prototype.executeUnclassified=function(e,t){this._unclassifiedCommand.execute(e,t)};Yp.prototype.isDestroyed=function(){return!1};Yp.prototype.destroy=function(){return this._fbo.destroy(),this._fboClassified.destroy(),this._depthStencilTexture=this._depthStencilTexture&&this._depthStencilTexture.destroy(),this._depthStencilRenderbuffer=this._depthStencilRenderbuffer&&this._depthStencilRenderbuffer.destroy(),l(this._unclassifiedCommand)&&(this._unclassifiedCommand.shaderProgram=this._unclassifiedCommand.shaderProgram&&this._unclassifiedCommand.shaderProgram.destroy(),this._classifiedCommand.shaderProgram=this._classifiedCommand.shaderProgram&&this._classifiedCommand.shaderProgram.destroy()),le(this)};var kR=Yp;function S6(e){this._total=e,this.usedThisFrame=0,this.stolenFromMeThisFrame=0,this.starvedThisFrame=!1,this.starvedLastFrame=!1}Object.defineProperties(S6.prototype,{total:{get:function(){return this._total}}});function gA(e){let t=new Array(Zc.NUMBER_OF_JOB_TYPES);t[Zc.TEXTURE]=new S6(l(e)?e[Zc.TEXTURE]:10),t[Zc.PROGRAM]=new S6(l(e)?e[Zc.PROGRAM]:10),t[Zc.BUFFER]=new S6(l(e)?e[Zc.BUFFER]:30);let n=t.length,i,r=0;for(i=0;i<n;++i)r+=t[i].total;let o=new Array(n);for(i=0;i<n;++i)o[i]=!1;this._totalBudget=r,this._totalUsedThisFrame=0,this._budgets=t,this._executedThisFrame=o}gA.getTimestamp=xn;Object.defineProperties(gA.prototype,{totalBudget:{get:function(){return this._totalBudget}}});gA.prototype.disableThisFrame=function(){this._totalUsedThisFrame=this._totalBudget};gA.prototype.resetBudgets=function(){let e=this._budgets,t=e.length;for(let n=0;n<t;++n){let i=e[n];i.starvedLastFrame=i.starvedThisFrame,i.starvedThisFrame=!1,i.usedThisFrame=0,i.stolenFromMeThisFrame=0}this._totalUsedThisFrame=0};gA.prototype.execute=function(e,t){let n=this._budgets,i=n[t],r=this._executedThisFrame[t];if(this._totalUsedThisFrame>=this._totalBudget&&r)return i.starvedThisFrame=!0,!1;let o;if(i.usedThisFrame+i.stolenFromMeThisFrame>=i.total){let c=n.length,u;for(u=0;u<c&&(o=n[u],!(o.usedThisFrame+o.stolenFromMeThisFrame<o.total&&!o.starvedLastFrame));++u);if(u===c&&r)return!1;r&&(i.starvedThisFrame=!0)}let s=gA.getTimestamp();e.execute();let a=gA.getTimestamp()-s;return this._totalUsedThisFrame+=a,o?o.stolenFromMeThisFrame+=a:i.usedThisFrame+=a,this._executedThisFrame[t]=!0,!0};var w6=gA;function I6(e){e=e??H.EMPTY_OBJECT;let t=kn(e.container);this._container=t;let n=document.createElement("div");n.className="cesium-performanceDisplay";let i=document.createElement("div");i.className="cesium-performanceDisplay-fps",this._fpsText=document.createTextNode(""),i.appendChild(this._fpsText);let r=document.createElement("div");r.className="cesium-performanceDisplay-ms",this._msText=document.createTextNode(""),r.appendChild(this._msText),n.appendChild(r),n.appendChild(i),this._container.appendChild(n),this._lastFpsSampleTime=xn(),this._lastMsSampleTime=xn(),this._fpsFrameCount=0,this._msFrameCount=0,this._throttled=!1;let o=document.createElement("div");o.className="cesium-performanceDisplay-throttled",this._throttledText=document.createTextNode(""),o.appendChild(this._throttledText),n.appendChild(o)}Object.defineProperties(I6.prototype,{throttled:{get:function(){return this._throttled},set:function(e){this._throttled!==e&&(e?this._throttledText.nodeValue="(throttled)":this._throttledText.nodeValue="",this._throttled=e)}}});I6.prototype.update=function(e){let t=xn(),n=e??!0;this._fpsFrameCount++;let i=t-this._lastFpsSampleTime;if(i>1e3){let o="N/A";n&&(o=this._fpsFrameCount*1e3/i|0),this._fpsText.nodeValue=`${o} FPS`,this._lastFpsSampleTime=t,this._fpsFrameCount=0}this._msFrameCount++;let r=t-this._lastMsSampleTime;if(r>200){let o="N/A";n&&(o=(r/this._msFrameCount).toFixed(2)),this._msText.nodeValue=`${o} MS`,this._lastMsSampleTime=t,this._msFrameCount=0}};I6.prototype.destroy=function(){return le(this)};var _A=I6;var fc={};fc.decodeRawMetadataValue=function(e,t,n){switch(e){case Lt.INT8:return t.getInt8(n);case Lt.UINT8:return t.getUint8(n);case Lt.INT16:return t.getInt16(n,!0);case Lt.UINT16:return t.getUint16(n,!0);case Lt.INT32:return t.getInt32(n,!0);case Lt.UINT32:return t.getUint32(n,!0);case Lt.INT64:return t.getBigInt64(n,!0);case Lt.UINT64:return t.getBigUint64(n,!0);case Lt.FLOAT32:return t.getFloat32(n,!0);case Lt.FLOAT64:return t.getFloat64(n,!0)}throw new oe(`Invalid component type: ${e}`)};fc.decodeRawMetadataValueComponent=function(e,t,n){let i=e.componentType,r=fc.decodeRawMetadataValue(i,t,n);return e.normalized?Lt.normalize(r,i):r};fc.decodeRawMetadataValueElement=function(e,t,n){let i=e.componentType,r=Lt.getSizeInBytes(i),o=e.type,s=bt.getComponentCount(o),a=r*s;if(s>1){let f=Array(s);for(let d=0;d<s;d++){let p=n*a+d*r,g=fc.decodeRawMetadataValueComponent(e,t,p);f[d]=g}return f}let c=n*a;return fc.decodeRawMetadataValueComponent(e,t,c)};fc.decodeRawMetadataValues=function(e,t){let n=new DataView(t.buffer,t.byteOffset,t.byteLength);if(e.isArray){let r=e.arrayLength,o=Array(r);for(let s=0;s<r;s++){let a=fc.decodeRawMetadataValueElement(e,n,s);o[s]=a}return o}return fc.decodeRawMetadataValueElement(e,n,0)};fc.convertToObjectType=function(e,t){if(!l(t)||e===bt.SCALAR||e===bt.STRING||e===bt.BOOLEAN||e===bt.ENUM)return t;let n=t.map(i=>Number(i));switch(e){case bt.VEC2:return U.unpack(n,0,new U);case bt.VEC3:return h.unpack(n,0,new h);case bt.VEC4:return se.unpack(n,0,new se);case bt.MAT2:return $i.unpack(n,0,new $i);case bt.MAT3:return $.unpack(n,0,new $);case bt.MAT4:return M.unpack(n,0,new M)}throw new oe(`Invalid metadata object type: ${e}`)};fc.convertFromObjectType=function(e,t){if(!l(t)||e===bt.SCALAR||e===bt.STRING||e===bt.BOOLEAN||e===bt.ENUM)return t;switch(e){case bt.VEC2:return U.pack(t,Array(2));case bt.VEC3:return h.pack(t,Array(3));case bt.VEC4:return se.pack(t,Array(4));case bt.MAT2:return $i.pack(t,Array(4));case bt.MAT3:return $.pack(t,Array(9));case bt.MAT4:return M.pack(t,Array(16))}throw new oe(`Invalid metadata object type: ${e}`)};fc.decodeMetadataValues=function(e,t,n){let i=fc.decodeRawMetadataValues(e,n);if(t.hasValueTransform){let o=fc.convertFromObjectType(e.type,t.offset),s=fc.convertFromObjectType(e.type,t.scale);i=lg.valueTransformInPlace(i,o,s,Lt.applyValueTransform)}if(e.isArray){let o=e.arrayLength,s=Array(o);for(let a=0;a<o;a++){let c=i[a],u=fc.convertToObjectType(e.type,c);s[a]=u}return s}return fc.convertToObjectType(e.type,i)};var P6=Object.freeze(fc);function sT(){this._framebuffer=new ci,this._textureToCopy=void 0,this._copyDepthCommand=void 0}Object.defineProperties(sT.prototype,{framebuffer:{get:function(){return this._framebuffer.framebuffer}}});function Gvt(e,t,n){let{width:i,height:r}=n;e._framebuffer.update(t,i,r)}function Wvt(e,t,n){l(e._copyDepthCommand)||(e._copyDepthCommand=t.createViewportQuadCommand(`uniform highp sampler2D colorTexture; in vec2 v_textureCoordinates; @@ -10316,24 +10316,24 @@ void main() out_FragColor = czm_branchFreeTernary(globeDepth <= 0.0 || globeDepth >= 1.0 || depth < globeDepth && depth > 0.0 && depth < 1.0, czm_packDepth(depth), globeDepthPacked); } -`,{renderState:Ge.fromCache(),uniformMap:{colorTexture:function(){return e._textureToCopy}},owner:e})),e._textureToCopy=n,e._copyDepthCommand.framebuffer=e.framebuffer}NT.prototype.update=function(e,t){EOt(this,e,t),COt(this,e,t)};var vOt=new se,SOt=new se(1,1/255,1/65025,1/16581375);NT.prototype.getDepth=function(e,t,n){if(!l(this.framebuffer))return;let i=e.readPixels({x:t,y:n,width:1,height:1,framebuffer:this.framebuffer}),r=se.unpack(i,0,vOt);return se.divideByScalar(r,255,r),se.dot(r,SOt)};NT.prototype.executeCopyDepth=function(e,t){this._copyDepthCommand.execute(e,t)};NT.prototype.isDestroyed=function(){return!1};NT.prototype.destroy=function(){return this._framebuffer.destroy(),l(this._copyDepthCommand)&&(this._copyDepthCommand.shaderProgram=l(this._copyDepthCommand.shaderProgram)&&this._copyDepthCommand.shaderProgram.destroy()),le(this)};var GG=NT;function VA(){this._framebufferManager=new ci({colorAttachmentsLength:3,createColorAttachments:!0,depthStencil:!0,supportsDepthTexture:!0,color:!0}),this._framebuffer=void 0,this._colorTexture=void 0,this._idTexture=void 0,this._depthTexture=void 0,this._depthStencilTexture=void 0,this._clearCommand=new fi({color:new z(0,0,0,0),depth:1,stencil:0,owner:this})}Object.defineProperties(VA.prototype,{framebuffer:{get:function(){return this._framebuffer}},colorTexture:{get:function(){return this._colorTexture}},idTexture:{get:function(){return this._idTexture}},depthTexture:{get:function(){return this._depthTexture}},depthStencilTexture:{get:function(){return this._depthStencilTexture}}});VA.prototype.update=function(e,t,n,i,r){let o=t.width,s=t.height,a=n?e.halfFloatingPointTexture?ze.HALF_FLOAT:ze.FLOAT:ze.UNSIGNED_BYTE,c=this._framebufferManager.update(e,o,s,1,a,$e.RGBA);return this._framebufferManager.framebuffer&&(this._framebuffer=this._framebufferManager.framebuffer,this._colorTexture=l(i)?i:this._framebufferManager.getColorTexture(0),this._idTexture=this._framebufferManager.getColorTexture(1),this._depthTexture=this._framebufferManager.getColorTexture(2),this._depthStencilTexture=l(r)?r:this._framebufferManager.getDepthStencilTexture()),c};VA.prototype.clear=function(e,t,n){this.getClearCommand(n).execute(e,t)};VA.prototype.getClearCommand=function(e){return this._clearCommand.framebuffer=this._framebuffer,l(e)&&z.clone(e,this._clearCommand.color),this._clearCommand};VA.prototype.getFramebuffer=function(e,t,n,i){return this.update(e,t,!1,n,i),this._framebuffer};VA.prototype.isDestroyed=function(){return!1};VA.prototype.destroy=function(){return this._framebufferManager=this._framebufferManager&&this._framebufferManager.destroy(),this._clearCommand=void 0,le(this)};var WG=VA;function LT(){this._framebufferManager=new ci({colorAttachmentsLength:1,createColorAttachments:!0,depthStencil:!0,supportsDepthTexture:!0,color:!0}),this._framebuffer=void 0,this._idTexture=void 0,this._depthStencilTexture=void 0,this._clearCommand=new fi({color:new z(0,0,0,0),depth:1,stencil:0,owner:this})}Object.defineProperties(LT.prototype,{framebuffer:{get:function(){return this._framebuffer}},idTexture:{get:function(){return this._idTexture}},depthStencilTexture:{get:function(){return this._depthStencilTexture}}});LT.prototype.update=function(e,t,n){let i=t.width,r=t.height,o=e.colorBufferFloat?ze.FLOAT:ze.UNSIGNED_BYTE,s=this._framebufferManager.update(e,i,r,1,o,$e.RED);return this._framebufferManager.framebuffer&&(this._framebuffer=this._framebufferManager.framebuffer,this._idTexture=this._framebufferManager.getColorTexture(0),this._depthStencilTexture=this._framebufferManager.getDepthStencilTexture()),s};LT.prototype.getClearCommand=function(e){return this._clearCommand.framebuffer=this._framebuffer,l(e)&&z.clone(e,this._clearCommand.color),this._clearCommand};LT.prototype.releaseResources=function(){l(this._framebuffer)&&(this._framebufferManager.destroy(),this._framebuffer=void 0,this._idTexture=void 0,this._depthStencilTexture=void 0)};LT.prototype.isDestroyed=function(){return!1};LT.prototype.destroy=function(){return this._framebufferManager=this._framebufferManager&&this._framebufferManager.destroy(),this._clearCommand=void 0,le(this)};var qG=LT;function wOt(e,t){this.near=e??0,this.far=t??0;let n=Ie.NUMBER_OF_PASSES,i=new Array(n),r=new Array(n);for(let o=0;o<n;++o)i[o]=[],r[o]=0;this.commands=i,this.indices=r}var YG=wOt;var FT=`uniform highp sampler2D u_depthTexture; +`,{renderState:Ge.fromCache(),uniformMap:{colorTexture:function(){return e._textureToCopy}},owner:e})),e._textureToCopy=n,e._copyDepthCommand.framebuffer=e.framebuffer}sT.prototype.update=function(e,t){Gvt(this,e,t),Wvt(this,e,t)};var qvt=new se,Yvt=new se(1,1/255,1/65025,1/16581375);sT.prototype.getDepth=function(e,t,n){if(!l(this.framebuffer))return;let i=e.readPixels({x:t,y:n,width:1,height:1,framebuffer:this.framebuffer}),r=se.unpack(i,0,qvt);return se.divideByScalar(r,255,r),se.dot(r,Yvt)};sT.prototype.executeCopyDepth=function(e,t){this._copyDepthCommand.execute(e,t)};sT.prototype.isDestroyed=function(){return!1};sT.prototype.destroy=function(){return this._framebuffer.destroy(),l(this._copyDepthCommand)&&(this._copyDepthCommand.shaderProgram=l(this._copyDepthCommand.shaderProgram)&&this._copyDepthCommand.shaderProgram.destroy()),le(this)};var D6=sT;function yA(){this._framebufferManager=new ci({colorAttachmentsLength:3,createColorAttachments:!0,depthStencil:!0,supportsDepthTexture:!0,color:!0}),this._framebuffer=void 0,this._colorTexture=void 0,this._idTexture=void 0,this._depthTexture=void 0,this._depthStencilTexture=void 0,this._clearCommand=new fi({color:new z(0,0,0,0),depth:1,stencil:0,owner:this})}Object.defineProperties(yA.prototype,{framebuffer:{get:function(){return this._framebuffer}},colorTexture:{get:function(){return this._colorTexture}},idTexture:{get:function(){return this._idTexture}},depthTexture:{get:function(){return this._depthTexture}},depthStencilTexture:{get:function(){return this._depthStencilTexture}}});yA.prototype.update=function(e,t,n,i,r){let o=t.width,s=t.height,a=n?e.halfFloatingPointTexture?ze.HALF_FLOAT:ze.FLOAT:ze.UNSIGNED_BYTE,c=this._framebufferManager.update(e,o,s,1,a,$e.RGBA);return this._framebufferManager.framebuffer&&(this._framebuffer=this._framebufferManager.framebuffer,this._colorTexture=l(i)?i:this._framebufferManager.getColorTexture(0),this._idTexture=this._framebufferManager.getColorTexture(1),this._depthTexture=this._framebufferManager.getColorTexture(2),this._depthStencilTexture=l(r)?r:this._framebufferManager.getDepthStencilTexture()),c};yA.prototype.clear=function(e,t,n){this.getClearCommand(n).execute(e,t)};yA.prototype.getClearCommand=function(e){return this._clearCommand.framebuffer=this._framebuffer,l(e)&&z.clone(e,this._clearCommand.color),this._clearCommand};yA.prototype.getFramebuffer=function(e,t,n,i){return this.update(e,t,!1,n,i),this._framebuffer};yA.prototype.isDestroyed=function(){return!1};yA.prototype.destroy=function(){return this._framebufferManager=this._framebufferManager&&this._framebufferManager.destroy(),this._clearCommand=void 0,le(this)};var R6=yA;function aT(){this._framebufferManager=new ci({colorAttachmentsLength:1,createColorAttachments:!0,depthStencil:!0,supportsDepthTexture:!0,color:!0}),this._framebuffer=void 0,this._idTexture=void 0,this._depthStencilTexture=void 0,this._clearCommand=new fi({color:new z(0,0,0,0),depth:1,stencil:0,owner:this})}Object.defineProperties(aT.prototype,{framebuffer:{get:function(){return this._framebuffer}},idTexture:{get:function(){return this._idTexture}},depthStencilTexture:{get:function(){return this._depthStencilTexture}}});aT.prototype.update=function(e,t,n){let i=t.width,r=t.height,o=e.colorBufferFloat?ze.FLOAT:ze.UNSIGNED_BYTE,s=this._framebufferManager.update(e,i,r,1,o,$e.RED);return this._framebufferManager.framebuffer&&(this._framebuffer=this._framebufferManager.framebuffer,this._idTexture=this._framebufferManager.getColorTexture(0),this._depthStencilTexture=this._framebufferManager.getDepthStencilTexture()),s};aT.prototype.getClearCommand=function(e){return this._clearCommand.framebuffer=this._framebuffer,l(e)&&z.clone(e,this._clearCommand.color),this._clearCommand};aT.prototype.releaseResources=function(){l(this._framebuffer)&&(this._framebufferManager.destroy(),this._framebuffer=void 0,this._idTexture=void 0,this._depthStencilTexture=void 0)};aT.prototype.isDestroyed=function(){return!1};aT.prototype.destroy=function(){return this._framebufferManager=this._framebufferManager&&this._framebufferManager.destroy(),this._clearCommand=void 0,le(this)};var O6=aT;function Xvt(e,t){this.near=e??0,this.far=t??0;let n=Ie.NUMBER_OF_PASSES,i=new Array(n),r=new Array(n);for(let o=0;o<n;++o)i[o]=[],r[o]=0;this.commands=i,this.indices=r}var M6=Xvt;var cT=`uniform highp sampler2D u_depthTexture; in vec2 v_textureCoordinates; void main() { out_FragColor = czm_packDepth(texture(u_depthTexture, v_textureCoordinates).r); } -`;function u0(){this._picking=!1,this._snapping=!1,this._numSamples=1,this._tempCopyDepthTexture=void 0,this._pickColorFramebuffer=new ci({depthStencil:!0,supportsDepthTexture:!0}),this._snapColorFramebuffer=new ci({depthStencil:!0,supportsDepthTexture:!0,pixelDatatype:ze.FLOAT,pixelFormat:$e.RGBA}),this._outputFramebuffer=new ci({depthStencil:!0,supportsDepthTexture:!0}),this._copyDepthFramebuffer=new ci,this._tempCopyDepthFramebuffer=new ci,this._updateDepthFramebuffer=new ci({createColorAttachments:!1,createDepthAttachments:!1,depthStencil:!0}),this._clearGlobeColorCommand=void 0,this._copyColorCommand=void 0,this._copyDepthCommand=void 0,this._tempCopyDepthCommand=void 0,this._updateDepthCommand=void 0,this._viewport=new et,this._rs=void 0,this._rsBlend=void 0,this._rsUpdate=void 0,this._useScissorTest=!1,this._scissorRectangle=void 0,this._useHdr=void 0,this._clearGlobeDepth=void 0}Object.defineProperties(u0.prototype,{colorFramebufferManager:{get:function(){return this._snapping?this._snapColorFramebuffer:this._picking?this._pickColorFramebuffer:this._outputFramebuffer}},framebuffer:{get:function(){return this.colorFramebufferManager.framebuffer}},depthStencilTexture:{get:function(){return this.colorFramebufferManager.getDepthStencilTexture()}},picking:{get:function(){return this._picking},set:function(e){this._picking=e}},snapping:{get:function(){return this._snapping},set:function(e){this._snapping=e}}});function IOe(e,t,n,i,r){let o=e._viewport;o.width=n,o.height=i;let s=!et.equals(o,r.viewport),a=s!==e._useScissorTest;e._useScissorTest=s,et.equals(e._scissorRectangle,r.viewport)||(e._scissorRectangle=et.clone(r.viewport,e._scissorRectangle),a=!0),(!l(e._rs)||!et.equals(o,e._rs.viewport)||a)&&(e._rs=Ge.fromCache({viewport:o,scissorTest:{enabled:e._useScissorTest,rectangle:e._scissorRectangle}}),e._rsBlend=Ge.fromCache({viewport:o,scissorTest:{enabled:e._useScissorTest,rectangle:e._scissorRectangle},blending:nn.ALPHA_BLEND}),e._rsUpdate=Ge.fromCache({viewport:o,scissorTest:{enabled:e._useScissorTest,rectangle:e._scissorRectangle},stencilTest:{enabled:!0,frontFunction:ti.EQUAL,frontOperation:{fail:Rt.KEEP,zFail:Rt.KEEP,zPass:Rt.KEEP},backFunction:ti.NEVER,reference:Xt.CESIUM_3D_TILE_MASK,mask:Xt.CESIUM_3D_TILE_MASK}})),l(e._copyDepthCommand)||(e._copyDepthCommand=t.createViewportQuadCommand(FT,{uniformMap:{u_depthTexture:function(){return e.colorFramebufferManager.getDepthStencilTexture()}},owner:e})),e._copyDepthCommand.framebuffer=e._copyDepthFramebuffer.framebuffer,e._copyDepthCommand.renderState=e._rs,l(e._copyColorCommand)||(e._copyColorCommand=t.createViewportQuadCommand(Bf,{uniformMap:{colorTexture:function(){return e.colorFramebufferManager.getColorTexture()}},owner:e})),e._copyColorCommand.renderState=e._rs,l(e._tempCopyDepthCommand)||(e._tempCopyDepthCommand=t.createViewportQuadCommand(FT,{uniformMap:{u_depthTexture:function(){return e._tempCopyDepthTexture}},owner:e})),e._tempCopyDepthCommand.framebuffer=e._tempCopyDepthFramebuffer.framebuffer,e._tempCopyDepthCommand.renderState=e._rs,l(e._updateDepthCommand)||(e._updateDepthCommand=t.createViewportQuadCommand(Bf,{uniformMap:{colorTexture:function(){return e._tempCopyDepthFramebuffer.getColorTexture()}},owner:e})),e._updateDepthCommand.framebuffer=e._updateDepthFramebuffer.framebuffer,e._updateDepthCommand.renderState=e._rsUpdate,l(e._clearGlobeColorCommand)||(e._clearGlobeColorCommand=new fi({color:new z(0,0,0,0),stencil:0,owner:e})),e._clearGlobeColorCommand.framebuffer=e.framebuffer}u0.prototype.update=function(e,t,n,i,r,o){let{width:s,height:a}=n,c=r?e.halfFloatingPointTexture?ze.HALF_FLOAT:ze.FLOAT:ze.UNSIGNED_BYTE;this._numSamples=i,this.snapping?this._snapColorFramebuffer.update(e,s,a):this.picking?this._pickColorFramebuffer.update(e,s,a):this._outputFramebuffer.update(e,s,a,i,c),this._copyDepthFramebuffer.update(e,s,a),IOe(this,e,s,a,t),e.uniformState.globeDepthTexture=void 0,this._clearGlobeDepth=o};u0.prototype.prepareColorTextures=function(e,t){!this.picking&&this._numSamples>1&&this._outputFramebuffer.prepareTextures(e,t)};u0.prototype.executeCopyDepth=function(e,t){l(this._copyDepthCommand)&&(this.prepareColorTextures(e),this._copyDepthCommand.execute(e,t),e.uniformState.globeDepthTexture=this._copyDepthFramebuffer.getColorTexture())};u0.prototype.executeUpdateDepth=function(e,t,n){let i=l(n)?n:t.framebuffer.depthStencilTexture;if(!this._clearGlobeDepth&&i===this.colorFramebufferManager.getDepthStencilTexture()){l(this._copyDepthCommand)&&this._copyDepthCommand.execute(e,t);return}if(!l(this._updateDepthCommand))return;let r=this._updateDepthFramebuffer;if(!l(r.framebuffer)||r.getDepthStencilTexture()!==i||r.getColorTexture()!==this._copyDepthFramebuffer.getColorTexture()){let o=this._copyDepthFramebuffer.getColorTexture(),{width:s,height:a}=o;this._tempCopyDepthFramebuffer.destroy(),this._tempCopyDepthFramebuffer.update(e,s,a),r.setColorTexture(o,0),r.setDepthStencilTexture(i),r.update(e,s,a),IOe(this,e,s,a,t)}this._tempCopyDepthTexture=i,this._tempCopyDepthCommand.execute(e,t),this._updateDepthCommand.execute(e,t)};u0.prototype.executeCopyColor=function(e,t){l(this._copyColorCommand)&&this._copyColorCommand.execute(e,t)};u0.prototype.clear=function(e,t,n){let i=this._clearGlobeColorCommand;l(i)&&(z.clone(n,i.color),this.colorFramebufferManager.clear(e,i,t))};u0.prototype.isDestroyed=function(){return!1};u0.prototype.destroy=function(){return this._pickColorFramebuffer.destroy(),this._snapColorFramebuffer.destroy(),this._outputFramebuffer.destroy(),this._copyDepthFramebuffer.destroy(),this._tempCopyDepthFramebuffer.destroy(),this._updateDepthFramebuffer.destroy(),l(this._copyColorCommand)&&(this._copyColorCommand.shaderProgram=this._copyColorCommand.shaderProgram.destroy()),l(this._copyDepthCommand)&&(this._copyDepthCommand.shaderProgram=this._copyDepthCommand.shaderProgram.destroy()),l(this._tempCopyDepthCommand)&&(this._tempCopyDepthCommand.shaderProgram=this._tempCopyDepthCommand.shaderProgram.destroy()),l(this._updateDepthCommand)&&(this._updateDepthCommand.shaderProgram=this._updateDepthCommand.shaderProgram.destroy()),le(this)};var XG=u0;function BT(){this._framebuffer=new ci({depthStencil:!0,supportsDepthTexture:!0}),this._packedDepthFramebuffer=new ci,this._renderState=void 0,this._packedDepthCommand=void 0,this._clearCommand=void 0,this._viewport=new et,this._useScissorTest=!1,this._scissorRectangle=void 0,this._useHdr=void 0}Object.defineProperties(BT.prototype,{classificationTexture:{get:function(){return this._framebuffer.getColorTexture()}},classificationFramebuffer:{get:function(){return this._framebuffer.framebuffer}},packedDepthFramebuffer:{get:function(){return this._packedDepthFramebuffer.framebuffer}},depthStencilTexture:{get:function(){return this._framebuffer.getDepthStencilTexture()}},depthStencilRenderbuffer:{get:function(){return this._framebuffer.getDepthStencilRenderbuffer()}},packedDepthTexture:{get:function(){return this._packedDepthFramebuffer.getColorTexture()}}});function IOt(e){e._framebuffer.destroy(),e._packedDepthFramebuffer.destroy()}function POt(e,t,n,i,r){let o=r?t.halfFloatingPointTexture?ze.HALF_FLOAT:ze.FLOAT:ze.UNSIGNED_BYTE;e._framebuffer.update(t,n,i,1,o),e._packedDepthFramebuffer.update(t,n,i)}function DOt(e,t,n,i,r){e._viewport.width=n,e._viewport.height=i;let o=!et.equals(e._viewport,r.viewport),s=o!==e._useScissorTest;e._useScissorTest=o,et.equals(e._scissorRectangle,r.viewport)||(e._scissorRectangle=et.clone(r.viewport,e._scissorRectangle),s=!0),(!l(e._renderState)||!et.equals(e._viewport,e._renderState.viewport)||s)&&(e._renderState=Ge.fromCache({viewport:e._viewport,scissorTest:{enabled:e._useScissorTest,rectangle:e._scissorRectangle}})),l(e._packedDepthCommand)||(e._packedDepthCommand=t.createViewportQuadCommand(FT,{uniformMap:{u_depthTexture:function(){return e.depthStencilTexture}},owner:e})),l(e._clearCommand)||(e._clearCommand=new fi({color:new z(0,0,0,0),depth:1,stencil:0,owner:e})),e._packedDepthCommand.framebuffer=e._packedDepthFramebuffer.framebuffer,e._packedDepthCommand.renderState=e._renderState,e._clearCommand.framebuffer=e.classificationFramebuffer,e._clearCommand.renderState=e._renderState}BT.prototype.updateAndClear=function(e,t,n,i){let r=t.width,o=t.height;POt(this,n,r,o,e),DOt(this,n,r,o,i),this._useHdr=e};BT.prototype.clearClassification=function(e,t){this._clearCommand.execute(e,t)};BT.prototype.packDepth=function(e,t){return this._packedDepthCommand.execute(e,t),this.packedDepthTexture};BT.prototype.isDestroyed=function(){return!1};BT.prototype.destroy=function(){return IOt(this),le(this)};var KG=BT;function i_(e){this._numSamples=1,this._translucentMultipassSupport=!1,this._translucentMRTSupport=!1;let t=e.colorBufferFloat&&e.depthTexture&&e.floatBlend;this._translucentMRTSupport=e.drawBuffers&&t,this._translucentMultipassSupport=!this._translucentMRTSupport&&t,this._opaqueFBO=void 0,this._opaqueTexture=void 0,this._depthStencilTexture=void 0,this._accumulationTexture=void 0,this._translucentFBO=new ci({colorAttachmentsLength:this._translucentMRTSupport?2:1,createColorAttachments:!1,createDepthAttachments:!1,depth:!0}),this._alphaFBO=new ci({createColorAttachments:!1,createDepthAttachments:!1,depth:!0}),this._adjustTranslucentFBO=new ci({colorAttachmentsLength:this._translucentMRTSupport?2:1,createColorAttachments:!1}),this._adjustAlphaFBO=new ci({createColorAttachments:!1}),this._opaqueClearCommand=new fi({color:new z(0,0,0,0),owner:this}),this._translucentMRTClearCommand=new fi({color:new z(0,0,0,1),owner:this}),this._translucentMultipassClearCommand=new fi({color:new z(0,0,0,0),owner:this}),this._alphaClearCommand=new fi({color:new z(1,1,1,1),owner:this}),this._translucentRenderStateCache={},this._alphaRenderStateCache={},this._compositeCommand=void 0,this._adjustTranslucentCommand=void 0,this._adjustAlphaCommand=void 0,this._viewport=new et,this._rs=void 0,this._useScissorTest=!1,this._scissorRectangle=void 0,this._useHDR=!1}function POe(e){e._accumulationTexture=e._accumulationTexture&&!e._accumulationTexture.isDestroyed()&&e._accumulationTexture.destroy(),e._revealageTexture=e._revealageTexture&&!e._revealageTexture.isDestroyed()&&e._revealageTexture.destroy()}function Qre(e){e._translucentFBO.destroy(),e._alphaFBO.destroy(),e._adjustTranslucentFBO.destroy(),e._adjustAlphaFBO.destroy()}function DOe(e){POe(e),Qre(e)}function ROt(e,t,n,i){POe(e),e._accumulationTexture=new Dt({context:t,width:n,height:i,pixelFormat:$e.RGBA,pixelDatatype:ze.FLOAT}),e._revealageTexture=new Dt({context:t,pixelFormat:$e.RGBA,pixelDatatype:ze.FLOAT,width:n,height:i,flipY:!1})}function OOt(e,t){Qre(e);let n=te.FRAMEBUFFER_COMPLETE,i=!0,{width:r,height:o}=e._accumulationTexture;if(e._translucentMRTSupport&&(e._translucentFBO.setColorTexture(e._accumulationTexture,0),e._translucentFBO.setColorTexture(e._revealageTexture,1),e._translucentFBO.setDepthStencilTexture(e._depthStencilTexture),e._translucentFBO.update(t,r,o),e._adjustTranslucentFBO.setColorTexture(e._accumulationTexture,0),e._adjustTranslucentFBO.setColorTexture(e._revealageTexture,1),e._adjustTranslucentFBO.update(t,r,o),(e._translucentFBO.status!==n||e._adjustTranslucentFBO.status!==n)&&(Qre(e),e._translucentMRTSupport=!1)),!e._translucentMRTSupport){e._translucentFBO.setColorTexture(e._accumulationTexture),e._translucentFBO.setDepthStencilTexture(e._depthStencilTexture),e._translucentFBO.update(t,r,o),e._alphaFBO.setColorTexture(e._revealageTexture),e._alphaFBO.setDepthStencilTexture(e._depthStencilTexture),e._alphaFBO.update(t,r,o),e._adjustTranslucentFBO.setColorTexture(e._accumulationTexture),e._adjustTranslucentFBO.update(t,r,o),e._adjustAlphaFBO.setColorTexture(e._revealageTexture),e._adjustAlphaFBO.update(t,r,o);let s=e._translucentFBO.status===n,a=e._alphaFBO.status===n,c=e._adjustTranslucentFBO.status===n,u=e._adjustAlphaFBO.status===n;(!s||!a||!c||!u)&&(DOe(e),e._translucentMultipassSupport=!1,i=!1)}return i}i_.prototype.update=function(e,t,n,i,r){if(!this.isSupported())return;this._opaqueFBO=n,this._opaqueTexture=n.getColorTexture(0),this._depthStencilTexture=n.getDepthStencilTexture();let{width:o,height:s}=this._opaqueTexture,a=this._accumulationTexture,c=!l(a)||a.width!==o||a.height!==s||i!==this._useHDR,u=this._numSamples!==r;if((c||u)&&(this._numSamples=r,ROt(this,e,o,s)),(!l(this._translucentFBO.framebuffer)||c||u)&&!OOt(this,e))return;this._useHDR=i;let f=this,d,p;l(this._compositeCommand)||(d=new Xe({sources:[w2]}),this._translucentMRTSupport&&d.defines.push("MRT"),p={u_opaque:function(){return f._opaqueTexture},u_accumulation:function(){return f._accumulationTexture},u_revealage:function(){return f._revealageTexture}},this._compositeCommand=e.createViewportQuadCommand(d,{uniformMap:p,owner:this})),l(this._adjustTranslucentCommand)||(this._translucentMRTSupport?(d=new Xe({defines:["MRT"],sources:[uP]}),p={u_bgColor:function(){return f._translucentMRTClearCommand.color},u_depthTexture:function(){return f._depthStencilTexture}},this._adjustTranslucentCommand=e.createViewportQuadCommand(d,{uniformMap:p,owner:this})):this._translucentMultipassSupport&&(d=new Xe({sources:[uP]}),p={u_bgColor:function(){return f._translucentMultipassClearCommand.color},u_depthTexture:function(){return f._depthStencilTexture}},this._adjustTranslucentCommand=e.createViewportQuadCommand(d,{uniformMap:p,owner:this}),p={u_bgColor:function(){return f._alphaClearCommand.color},u_depthTexture:function(){return f._depthStencilTexture}},this._adjustAlphaCommand=e.createViewportQuadCommand(d,{uniformMap:p,owner:this}))),this._viewport.width=o,this._viewport.height=s;let g=!et.equals(this._viewport,t.viewport),m=g!==this._useScissorTest;this._useScissorTest=g,et.equals(this._scissorRectangle,t.viewport)||(this._scissorRectangle=et.clone(t.viewport,this._scissorRectangle),m=!0),(!l(this._rs)||!et.equals(this._viewport,this._rs.viewport)||m)&&(this._rs=Ge.fromCache({viewport:this._viewport,scissorTest:{enabled:this._useScissorTest,rectangle:this._scissorRectangle}})),l(this._compositeCommand)&&(this._compositeCommand.renderState=this._rs),this._adjustTranslucentCommand&&(this._adjustTranslucentCommand.renderState=this._rs),l(this._adjustAlphaCommand)&&(this._adjustAlphaCommand.renderState=this._rs)};var MOt={enabled:!0,color:new z(0,0,0,0),equationRgb:Vc.ADD,equationAlpha:Vc.ADD,functionSourceRgb:Zr.ONE,functionDestinationRgb:Zr.ONE,functionSourceAlpha:Zr.ZERO,functionDestinationAlpha:Zr.ONE_MINUS_SOURCE_ALPHA},NOt={enabled:!0,color:new z(0,0,0,0),equationRgb:Vc.ADD,equationAlpha:Vc.ADD,functionSourceRgb:Zr.ONE,functionDestinationRgb:Zr.ONE,functionSourceAlpha:Zr.ONE,functionDestinationAlpha:Zr.ONE},LOt={enabled:!0,color:new z(0,0,0,0),equationRgb:Vc.ADD,equationAlpha:Vc.ADD,functionSourceRgb:Zr.ZERO,functionDestinationRgb:Zr.ONE_MINUS_SOURCE_ALPHA,functionSourceAlpha:Zr.ZERO,functionDestinationAlpha:Zr.ONE_MINUS_SOURCE_ALPHA};function eoe(e,t,n,i){let r=n[i.id];if(!l(r)){let o=Ge.getState(i);o.depthMask=!1,o.blending=t,r=Ge.fromCache(o),n[i.id]=r}return r}function FOt(e,t,n){return eoe(t,MOt,e._translucentRenderStateCache,n)}function BOt(e,t,n){return eoe(t,NOt,e._translucentRenderStateCache,n)}function kOt(e,t,n){return eoe(t,LOt,e._alphaRenderStateCache,n)}var UOt=` vec3 Ci = czm_out_FragColor.rgb * czm_out_FragColor.a; +`;function Xp(){this._picking=!1,this._snapping=!1,this._numSamples=1,this._tempCopyDepthTexture=void 0,this._pickColorFramebuffer=new ci({depthStencil:!0,supportsDepthTexture:!0}),this._snapColorFramebuffer=new ci({depthStencil:!0,supportsDepthTexture:!0,pixelDatatype:ze.FLOAT,pixelFormat:$e.RGBA}),this._outputFramebuffer=new ci({depthStencil:!0,supportsDepthTexture:!0}),this._copyDepthFramebuffer=new ci,this._tempCopyDepthFramebuffer=new ci,this._updateDepthFramebuffer=new ci({createColorAttachments:!1,createDepthAttachments:!1,depthStencil:!0}),this._clearGlobeColorCommand=void 0,this._copyColorCommand=void 0,this._copyDepthCommand=void 0,this._tempCopyDepthCommand=void 0,this._updateDepthCommand=void 0,this._viewport=new et,this._rs=void 0,this._rsBlend=void 0,this._rsUpdate=void 0,this._useScissorTest=!1,this._scissorRectangle=void 0,this._useHdr=void 0,this._clearGlobeDepth=void 0}Object.defineProperties(Xp.prototype,{colorFramebufferManager:{get:function(){return this._snapping?this._snapColorFramebuffer:this._picking?this._pickColorFramebuffer:this._outputFramebuffer}},framebuffer:{get:function(){return this.colorFramebufferManager.framebuffer}},depthStencilTexture:{get:function(){return this.colorFramebufferManager.getDepthStencilTexture()}},picking:{get:function(){return this._picking},set:function(e){this._picking=e}},snapping:{get:function(){return this._snapping},set:function(e){this._snapping=e}}});function Owe(e,t,n,i,r){let o=e._viewport;o.width=n,o.height=i;let s=!et.equals(o,r.viewport),a=s!==e._useScissorTest;e._useScissorTest=s,et.equals(e._scissorRectangle,r.viewport)||(e._scissorRectangle=et.clone(r.viewport,e._scissorRectangle),a=!0),(!l(e._rs)||!et.equals(o,e._rs.viewport)||a)&&(e._rs=Ge.fromCache({viewport:o,scissorTest:{enabled:e._useScissorTest,rectangle:e._scissorRectangle}}),e._rsBlend=Ge.fromCache({viewport:o,scissorTest:{enabled:e._useScissorTest,rectangle:e._scissorRectangle},blending:nn.ALPHA_BLEND}),e._rsUpdate=Ge.fromCache({viewport:o,scissorTest:{enabled:e._useScissorTest,rectangle:e._scissorRectangle},stencilTest:{enabled:!0,frontFunction:ei.EQUAL,frontOperation:{fail:Rt.KEEP,zFail:Rt.KEEP,zPass:Rt.KEEP},backFunction:ei.NEVER,reference:Xt.CESIUM_3D_TILE_MASK,mask:Xt.CESIUM_3D_TILE_MASK}})),l(e._copyDepthCommand)||(e._copyDepthCommand=t.createViewportQuadCommand(cT,{uniformMap:{u_depthTexture:function(){return e.colorFramebufferManager.getDepthStencilTexture()}},owner:e})),e._copyDepthCommand.framebuffer=e._copyDepthFramebuffer.framebuffer,e._copyDepthCommand.renderState=e._rs,l(e._copyColorCommand)||(e._copyColorCommand=t.createViewportQuadCommand(Pf,{uniformMap:{colorTexture:function(){return e.colorFramebufferManager.getColorTexture()}},owner:e})),e._copyColorCommand.renderState=e._rs,l(e._tempCopyDepthCommand)||(e._tempCopyDepthCommand=t.createViewportQuadCommand(cT,{uniformMap:{u_depthTexture:function(){return e._tempCopyDepthTexture}},owner:e})),e._tempCopyDepthCommand.framebuffer=e._tempCopyDepthFramebuffer.framebuffer,e._tempCopyDepthCommand.renderState=e._rs,l(e._updateDepthCommand)||(e._updateDepthCommand=t.createViewportQuadCommand(Pf,{uniformMap:{colorTexture:function(){return e._tempCopyDepthFramebuffer.getColorTexture()}},owner:e})),e._updateDepthCommand.framebuffer=e._updateDepthFramebuffer.framebuffer,e._updateDepthCommand.renderState=e._rsUpdate,l(e._clearGlobeColorCommand)||(e._clearGlobeColorCommand=new fi({color:new z(0,0,0,0),stencil:0,owner:e})),e._clearGlobeColorCommand.framebuffer=e.framebuffer}Xp.prototype.update=function(e,t,n,i,r,o){let{width:s,height:a}=n,c=r?e.halfFloatingPointTexture?ze.HALF_FLOAT:ze.FLOAT:ze.UNSIGNED_BYTE;this._numSamples=i,this.snapping?this._snapColorFramebuffer.update(e,s,a):this.picking?this._pickColorFramebuffer.update(e,s,a):this._outputFramebuffer.update(e,s,a,i,c),this._copyDepthFramebuffer.update(e,s,a),Owe(this,e,s,a,t),e.uniformState.globeDepthTexture=void 0,this._clearGlobeDepth=o};Xp.prototype.prepareColorTextures=function(e,t){!this.picking&&this._numSamples>1&&this._outputFramebuffer.prepareTextures(e,t)};Xp.prototype.executeCopyDepth=function(e,t){l(this._copyDepthCommand)&&(this.prepareColorTextures(e),this._copyDepthCommand.execute(e,t),e.uniformState.globeDepthTexture=this._copyDepthFramebuffer.getColorTexture())};Xp.prototype.executeUpdateDepth=function(e,t,n){let i=l(n)?n:t.framebuffer.depthStencilTexture;if(!this._clearGlobeDepth&&i===this.colorFramebufferManager.getDepthStencilTexture()){l(this._copyDepthCommand)&&this._copyDepthCommand.execute(e,t);return}if(!l(this._updateDepthCommand))return;let r=this._updateDepthFramebuffer;if(!l(r.framebuffer)||r.getDepthStencilTexture()!==i||r.getColorTexture()!==this._copyDepthFramebuffer.getColorTexture()){let o=this._copyDepthFramebuffer.getColorTexture(),{width:s,height:a}=o;this._tempCopyDepthFramebuffer.destroy(),this._tempCopyDepthFramebuffer.update(e,s,a),r.setColorTexture(o,0),r.setDepthStencilTexture(i),r.update(e,s,a),Owe(this,e,s,a,t)}this._tempCopyDepthTexture=i,this._tempCopyDepthCommand.execute(e,t),this._updateDepthCommand.execute(e,t)};Xp.prototype.executeCopyColor=function(e,t){l(this._copyColorCommand)&&this._copyColorCommand.execute(e,t)};Xp.prototype.clear=function(e,t,n){let i=this._clearGlobeColorCommand;l(i)&&(z.clone(n,i.color),this.colorFramebufferManager.clear(e,i,t))};Xp.prototype.isDestroyed=function(){return!1};Xp.prototype.destroy=function(){return this._pickColorFramebuffer.destroy(),this._snapColorFramebuffer.destroy(),this._outputFramebuffer.destroy(),this._copyDepthFramebuffer.destroy(),this._tempCopyDepthFramebuffer.destroy(),this._updateDepthFramebuffer.destroy(),l(this._copyColorCommand)&&(this._copyColorCommand.shaderProgram=this._copyColorCommand.shaderProgram.destroy()),l(this._copyDepthCommand)&&(this._copyDepthCommand.shaderProgram=this._copyDepthCommand.shaderProgram.destroy()),l(this._tempCopyDepthCommand)&&(this._tempCopyDepthCommand.shaderProgram=this._tempCopyDepthCommand.shaderProgram.destroy()),l(this._updateDepthCommand)&&(this._updateDepthCommand.shaderProgram=this._updateDepthCommand.shaderProgram.destroy()),le(this)};var N6=Xp;function lT(){this._framebuffer=new ci({depthStencil:!0,supportsDepthTexture:!0}),this._packedDepthFramebuffer=new ci,this._renderState=void 0,this._packedDepthCommand=void 0,this._clearCommand=void 0,this._viewport=new et,this._useScissorTest=!1,this._scissorRectangle=void 0,this._useHdr=void 0}Object.defineProperties(lT.prototype,{classificationTexture:{get:function(){return this._framebuffer.getColorTexture()}},classificationFramebuffer:{get:function(){return this._framebuffer.framebuffer}},packedDepthFramebuffer:{get:function(){return this._packedDepthFramebuffer.framebuffer}},depthStencilTexture:{get:function(){return this._framebuffer.getDepthStencilTexture()}},depthStencilRenderbuffer:{get:function(){return this._framebuffer.getDepthStencilRenderbuffer()}},packedDepthTexture:{get:function(){return this._packedDepthFramebuffer.getColorTexture()}}});function Kvt(e){e._framebuffer.destroy(),e._packedDepthFramebuffer.destroy()}function $vt(e,t,n,i,r){let o=r?t.halfFloatingPointTexture?ze.HALF_FLOAT:ze.FLOAT:ze.UNSIGNED_BYTE;e._framebuffer.update(t,n,i,1,o),e._packedDepthFramebuffer.update(t,n,i)}function Jvt(e,t,n,i,r){e._viewport.width=n,e._viewport.height=i;let o=!et.equals(e._viewport,r.viewport),s=o!==e._useScissorTest;e._useScissorTest=o,et.equals(e._scissorRectangle,r.viewport)||(e._scissorRectangle=et.clone(r.viewport,e._scissorRectangle),s=!0),(!l(e._renderState)||!et.equals(e._viewport,e._renderState.viewport)||s)&&(e._renderState=Ge.fromCache({viewport:e._viewport,scissorTest:{enabled:e._useScissorTest,rectangle:e._scissorRectangle}})),l(e._packedDepthCommand)||(e._packedDepthCommand=t.createViewportQuadCommand(cT,{uniformMap:{u_depthTexture:function(){return e.depthStencilTexture}},owner:e})),l(e._clearCommand)||(e._clearCommand=new fi({color:new z(0,0,0,0),depth:1,stencil:0,owner:e})),e._packedDepthCommand.framebuffer=e._packedDepthFramebuffer.framebuffer,e._packedDepthCommand.renderState=e._renderState,e._clearCommand.framebuffer=e.classificationFramebuffer,e._clearCommand.renderState=e._renderState}lT.prototype.updateAndClear=function(e,t,n,i){let r=t.width,o=t.height;$vt(this,n,r,o,e),Jvt(this,n,r,o,i),this._useHdr=e};lT.prototype.clearClassification=function(e,t){this._clearCommand.execute(e,t)};lT.prototype.packDepth=function(e,t){return this._packedDepthCommand.execute(e,t),this.packedDepthTexture};lT.prototype.isDestroyed=function(){return!1};lT.prototype.destroy=function(){return Kvt(this),le(this)};var L6=lT;function Hg(e){this._numSamples=1,this._translucentMultipassSupport=!1,this._translucentMRTSupport=!1;let t=e.colorBufferFloat&&e.depthTexture&&e.floatBlend;this._translucentMRTSupport=e.drawBuffers&&t,this._translucentMultipassSupport=!this._translucentMRTSupport&&t,this._opaqueFBO=void 0,this._opaqueTexture=void 0,this._depthStencilTexture=void 0,this._accumulationTexture=void 0,this._translucentFBO=new ci({colorAttachmentsLength:this._translucentMRTSupport?2:1,createColorAttachments:!1,createDepthAttachments:!1,depth:!0}),this._alphaFBO=new ci({createColorAttachments:!1,createDepthAttachments:!1,depth:!0}),this._adjustTranslucentFBO=new ci({colorAttachmentsLength:this._translucentMRTSupport?2:1,createColorAttachments:!1}),this._adjustAlphaFBO=new ci({createColorAttachments:!1}),this._opaqueClearCommand=new fi({color:new z(0,0,0,0),owner:this}),this._translucentMRTClearCommand=new fi({color:new z(0,0,0,1),owner:this}),this._translucentMultipassClearCommand=new fi({color:new z(0,0,0,0),owner:this}),this._alphaClearCommand=new fi({color:new z(1,1,1,1),owner:this}),this._translucentRenderStateCache={},this._alphaRenderStateCache={},this._compositeCommand=void 0,this._adjustTranslucentCommand=void 0,this._adjustAlphaCommand=void 0,this._viewport=new et,this._rs=void 0,this._useScissorTest=!1,this._scissorRectangle=void 0,this._useHDR=!1}function Mwe(e){e._accumulationTexture=e._accumulationTexture&&!e._accumulationTexture.isDestroyed()&&e._accumulationTexture.destroy(),e._revealageTexture=e._revealageTexture&&!e._revealageTexture.isDestroyed()&&e._revealageTexture.destroy()}function kte(e){e._translucentFBO.destroy(),e._alphaFBO.destroy(),e._adjustTranslucentFBO.destroy(),e._adjustAlphaFBO.destroy()}function Nwe(e){Mwe(e),kte(e)}function Zvt(e,t,n,i){Mwe(e),e._accumulationTexture=new Dt({context:t,width:n,height:i,pixelFormat:$e.RGBA,pixelDatatype:ze.FLOAT}),e._revealageTexture=new Dt({context:t,pixelFormat:$e.RGBA,pixelDatatype:ze.FLOAT,width:n,height:i,flipY:!1})}function Qvt(e,t){kte(e);let n=te.FRAMEBUFFER_COMPLETE,i=!0,{width:r,height:o}=e._accumulationTexture;if(e._translucentMRTSupport&&(e._translucentFBO.setColorTexture(e._accumulationTexture,0),e._translucentFBO.setColorTexture(e._revealageTexture,1),e._translucentFBO.setDepthStencilTexture(e._depthStencilTexture),e._translucentFBO.update(t,r,o),e._adjustTranslucentFBO.setColorTexture(e._accumulationTexture,0),e._adjustTranslucentFBO.setColorTexture(e._revealageTexture,1),e._adjustTranslucentFBO.update(t,r,o),(e._translucentFBO.status!==n||e._adjustTranslucentFBO.status!==n)&&(kte(e),e._translucentMRTSupport=!1)),!e._translucentMRTSupport){e._translucentFBO.setColorTexture(e._accumulationTexture),e._translucentFBO.setDepthStencilTexture(e._depthStencilTexture),e._translucentFBO.update(t,r,o),e._alphaFBO.setColorTexture(e._revealageTexture),e._alphaFBO.setDepthStencilTexture(e._depthStencilTexture),e._alphaFBO.update(t,r,o),e._adjustTranslucentFBO.setColorTexture(e._accumulationTexture),e._adjustTranslucentFBO.update(t,r,o),e._adjustAlphaFBO.setColorTexture(e._revealageTexture),e._adjustAlphaFBO.update(t,r,o);let s=e._translucentFBO.status===n,a=e._alphaFBO.status===n,c=e._adjustTranslucentFBO.status===n,u=e._adjustAlphaFBO.status===n;(!s||!a||!c||!u)&&(Nwe(e),e._translucentMultipassSupport=!1,i=!1)}return i}Hg.prototype.update=function(e,t,n,i,r){if(!this.isSupported())return;this._opaqueFBO=n,this._opaqueTexture=n.getColorTexture(0),this._depthStencilTexture=n.getDepthStencilTexture();let{width:o,height:s}=this._opaqueTexture,a=this._accumulationTexture,c=!l(a)||a.width!==o||a.height!==s||i!==this._useHDR,u=this._numSamples!==r;if((c||u)&&(this._numSamples=r,Zvt(this,e,o,s)),(!l(this._translucentFBO.framebuffer)||c||u)&&!Qvt(this,e))return;this._useHDR=i;let f=this,d,p;l(this._compositeCommand)||(d=new Xe({sources:[w2]}),this._translucentMRTSupport&&d.defines.push("MRT"),p={u_opaque:function(){return f._opaqueTexture},u_accumulation:function(){return f._accumulationTexture},u_revealage:function(){return f._revealageTexture}},this._compositeCommand=e.createViewportQuadCommand(d,{uniformMap:p,owner:this})),l(this._adjustTranslucentCommand)||(this._translucentMRTSupport?(d=new Xe({defines:["MRT"],sources:[uP]}),p={u_bgColor:function(){return f._translucentMRTClearCommand.color},u_depthTexture:function(){return f._depthStencilTexture}},this._adjustTranslucentCommand=e.createViewportQuadCommand(d,{uniformMap:p,owner:this})):this._translucentMultipassSupport&&(d=new Xe({sources:[uP]}),p={u_bgColor:function(){return f._translucentMultipassClearCommand.color},u_depthTexture:function(){return f._depthStencilTexture}},this._adjustTranslucentCommand=e.createViewportQuadCommand(d,{uniformMap:p,owner:this}),p={u_bgColor:function(){return f._alphaClearCommand.color},u_depthTexture:function(){return f._depthStencilTexture}},this._adjustAlphaCommand=e.createViewportQuadCommand(d,{uniformMap:p,owner:this}))),this._viewport.width=o,this._viewport.height=s;let g=!et.equals(this._viewport,t.viewport),m=g!==this._useScissorTest;this._useScissorTest=g,et.equals(this._scissorRectangle,t.viewport)||(this._scissorRectangle=et.clone(t.viewport,this._scissorRectangle),m=!0),(!l(this._rs)||!et.equals(this._viewport,this._rs.viewport)||m)&&(this._rs=Ge.fromCache({viewport:this._viewport,scissorTest:{enabled:this._useScissorTest,rectangle:this._scissorRectangle}})),l(this._compositeCommand)&&(this._compositeCommand.renderState=this._rs),this._adjustTranslucentCommand&&(this._adjustTranslucentCommand.renderState=this._rs),l(this._adjustAlphaCommand)&&(this._adjustAlphaCommand.renderState=this._rs)};var eSt={enabled:!0,color:new z(0,0,0,0),equationRgb:jc.ADD,equationAlpha:jc.ADD,functionSourceRgb:Zr.ONE,functionDestinationRgb:Zr.ONE,functionSourceAlpha:Zr.ZERO,functionDestinationAlpha:Zr.ONE_MINUS_SOURCE_ALPHA},tSt={enabled:!0,color:new z(0,0,0,0),equationRgb:jc.ADD,equationAlpha:jc.ADD,functionSourceRgb:Zr.ONE,functionDestinationRgb:Zr.ONE,functionSourceAlpha:Zr.ONE,functionDestinationAlpha:Zr.ONE},nSt={enabled:!0,color:new z(0,0,0,0),equationRgb:jc.ADD,equationAlpha:jc.ADD,functionSourceRgb:Zr.ZERO,functionDestinationRgb:Zr.ONE_MINUS_SOURCE_ALPHA,functionSourceAlpha:Zr.ZERO,functionDestinationAlpha:Zr.ONE_MINUS_SOURCE_ALPHA};function Ute(e,t,n,i){let r=n[i.id];if(!l(r)){let o=Ge.getState(i);o.depthMask=!1,o.blending=t,r=Ge.fromCache(o),n[i.id]=r}return r}function iSt(e,t,n){return Ute(t,eSt,e._translucentRenderStateCache,n)}function rSt(e,t,n){return Ute(t,tSt,e._translucentRenderStateCache,n)}function oSt(e,t,n){return Ute(t,nSt,e._alphaRenderStateCache,n)}var sSt=` vec3 Ci = czm_out_FragColor.rgb * czm_out_FragColor.a; float ai = czm_out_FragColor.a; float wzi = czm_alphaWeight(ai); out_FragData_0 = vec4(Ci * wzi, ai); out_FragData_1 = vec4(ai * wzi); -`,zOt=` vec3 Ci = czm_out_FragColor.rgb * czm_out_FragColor.a; +`,aSt=` vec3 Ci = czm_out_FragColor.rgb * czm_out_FragColor.a; float ai = czm_out_FragColor.a; float wzi = czm_alphaWeight(ai); out_FragColor = vec4(Ci, ai) * wzi; -`,VOt=` float ai = czm_out_FragColor.a; +`,cSt=` float ai = czm_out_FragColor.a; out_FragColor = vec4(ai); -`;function toe(e,t,n,i){let{shaderCache:r}=e,o=r.getDerivedShaderProgram(t,n);if(l(o))return o;let s=t._attributeLocations,a=t.fragmentShaderSource.clone();a.sources=a.sources.map(function(f){return Xe.replaceMain(f,"czm_translucent_main").replace(/out_FragColor/g,"czm_out_FragColor").replace(/layout\s*\(location\s*=\s*0\)\s*out\s+vec4\s+out_FragColor;/g,"").replace(/\bdiscard\b/g,"czm_discard = true").replace(/czm_phong/g,"czm_translucentPhong")}),a.sources.splice(0,0,`#define CESIUM_REDIRECTED_COLOR_OUTPUT +`;function zte(e,t,n,i){let{shaderCache:r}=e,o=r.getDerivedShaderProgram(t,n);if(l(o))return o;let s=t._attributeLocations,a=t.fragmentShaderSource.clone();a.sources=a.sources.map(function(f){return Xe.replaceMain(f,"czm_translucent_main").replace(/out_FragColor/g,"czm_out_FragColor").replace(/layout\s*\(location\s*=\s*0\)\s*out\s+vec4\s+out_FragColor;/g,"").replace(/\bdiscard\b/g,"czm_discard = true").replace(/czm_phong/g,"czm_translucentPhong")}),a.sources.splice(0,0,`#define CESIUM_REDIRECTED_COLOR_OUTPUT vec4 czm_out_FragColor; bool czm_discard = false; `);let c=[...i.matchAll(/out_FragData_(\d+)/g)],u="";for(let f=0;f<c.length;f++){let d=c[f];u=`layout (location = ${d[1]}) out vec4 ${d[0]}; @@ -10345,12 +10345,12 @@ ${u}`}return a.sources.push(u),a.sources.push(`void main() discard; } ${i}} -`),r.createDerivedShaderProgram(t,n,{vertexShaderSource:t.vertexShaderSource,fragmentShaderSource:a,attributeLocations:s})}function jOt(e,t){return toe(e,t,"translucentMRT",UOt)}function HOt(e,t){return toe(e,t,"translucentMultipass",zOt)}function GOt(e,t){return toe(e,t,"alphaMultipass",VOt)}i_.prototype.createDerivedCommands=function(e,t,n){if(l(n)||(n={}),this._translucentMRTSupport){let a,c;return l(n.translucentCommand)&&(a=n.translucentCommand.shaderProgram,c=n.translucentCommand.renderState),n.translucentCommand=at.shallowClone(e,n.translucentCommand),!l(a)||n.shaderProgramId!==e.shaderProgram.id?(n.translucentCommand.shaderProgram=jOt(t,e.shaderProgram),n.translucentCommand.renderState=FOt(this,t,e.renderState),n.shaderProgramId=e.shaderProgram.id):(n.translucentCommand.shaderProgram=a,n.translucentCommand.renderState=c),n}let i,r,o,s;return l(n.translucentCommand)&&(i=n.translucentCommand.shaderProgram,r=n.translucentCommand.renderState,o=n.alphaCommand.shaderProgram,s=n.alphaCommand.renderState),n.translucentCommand=at.shallowClone(e,n.translucentCommand),n.alphaCommand=at.shallowClone(e,n.alphaCommand),!l(i)||n.shaderProgramId!==e.shaderProgram.id?(n.translucentCommand.shaderProgram=HOt(t,e.shaderProgram),n.translucentCommand.renderState=BOt(this,t,e.renderState),n.alphaCommand.shaderProgram=GOt(t,e.shaderProgram),n.alphaCommand.renderState=kOt(this,t,e.renderState),n.shaderProgramId=e.shaderProgram.id):(n.translucentCommand.shaderProgram=i,n.translucentCommand.renderState=r,n.alphaCommand.shaderProgram=o,n.alphaCommand.renderState=s),n};function WOt(e,t,n,i,r,o){let{context:s,frameState:a}=t,{useLogDepth:c,shadowState:u}=a,f=t._hdr,d=i.framebuffer,p=u.lightShadowsEnabled;i.framebuffer=e._adjustTranslucentFBO.framebuffer,e._adjustTranslucentCommand.execute(s,i),i.framebuffer=e._adjustAlphaFBO.framebuffer,e._adjustAlphaCommand.execute(s,i);let g=e._opaqueFBO.framebuffer;i.framebuffer=e._translucentFBO.framebuffer;for(let m=0;m<r.length;++m){let y=r[m];y=c?y.derivedCommands.logDepth.command:y,y=f?y.derivedCommands.hdr.command:y;let A=p&&y.receiveShadows?y.derivedCommands.oit.shadows.translucentCommand:y.derivedCommands.oit.translucentCommand;n(A,t,i,g)}if(l(o)){let m=o.unclassifiedCommand,y=p&&m.receiveShadows?m.derivedCommands.oit.shadows.translucentCommand:m.derivedCommands.oit.translucentCommand;n(y,t,i,g)}i.framebuffer=e._alphaFBO.framebuffer;for(let m=0;m<r.length;++m){let y=r[m];y=c?y.derivedCommands.logDepth.command:y,y=f?y.derivedCommands.hdr.command:y;let A=p&&y.receiveShadows?y.derivedCommands.oit.shadows.alphaCommand:y.derivedCommands.oit.alphaCommand;n(A,t,i,g)}if(l(o)){let m=o.unclassifiedCommand,y=p&&m.receiveShadows?m.derivedCommands.oit.shadows.alphaCommand:m.derivedCommands.oit.alphaCommand;n(y,t,i,g)}i.framebuffer=d}function qOt(e,t,n,i,r,o){let{context:s,frameState:a}=t,{useLogDepth:c,shadowState:u}=a,f=t._hdr,d=i.framebuffer,p=u.lightShadowsEnabled;i.framebuffer=e._adjustTranslucentFBO.framebuffer,e._adjustTranslucentCommand.execute(s,i);let g=e._opaqueFBO.framebuffer;i.framebuffer=e._translucentFBO.framebuffer;for(let m=0;m<r.length;++m){let y=r[m];y=c?y.derivedCommands.logDepth.command:y,y=f?y.derivedCommands.hdr.command:y;let A=p&&y.receiveShadows?y.derivedCommands.oit.shadows.translucentCommand:y.derivedCommands.oit.translucentCommand;n(A,t,i,g)}if(l(o)){let m=o.unclassifiedCommand,y=p&&m.receiveShadows?m.derivedCommands.oit.shadows.translucentCommand:m.derivedCommands.oit.translucentCommand;n(y,t,i,g)}i.framebuffer=d}i_.prototype.executeCommands=function(e,t,n,i,r){if(this._translucentMRTSupport){qOt(this,e,t,n,i,r);return}WOt(this,e,t,n,i,r)};i_.prototype.execute=function(e,t){this._compositeCommand.execute(e,t)};i_.prototype.clear=function(e,t,n){let i=t.framebuffer;t.framebuffer=this._opaqueFBO.framebuffer,z.clone(n,this._opaqueClearCommand.color),this._opaqueClearCommand.execute(e,t),t.framebuffer=this._translucentFBO.framebuffer,(this._translucentMRTSupport?this._translucentMRTClearCommand:this._translucentMultipassClearCommand).execute(e,t),this._translucentMultipassSupport&&(t.framebuffer=this._alphaFBO.framebuffer,this._alphaClearCommand.execute(e,t)),t.framebuffer=i};i_.prototype.isSupported=function(){return this._translucentMRTSupport||this._translucentMultipassSupport};i_.prototype.isDestroyed=function(){return!1};i_.prototype.destroy=function(){return DOe(this),l(this._compositeCommand)&&(this._compositeCommand.shaderProgram=this._compositeCommand.shaderProgram&&this._compositeCommand.shaderProgram.destroy()),l(this._adjustTranslucentCommand)&&(this._adjustTranslucentCommand.shaderProgram=this._adjustTranslucentCommand.shaderProgram&&this._adjustTranslucentCommand.shaderProgram.destroy()),l(this._adjustAlphaCommand)&&(this._adjustAlphaCommand.shaderProgram=this._adjustAlphaCommand.shaderProgram&&this._adjustAlphaCommand.shaderProgram.destroy()),le(this)};var $G=i_;function YO(){this._framebuffer=new ci({color:!1,depthStencil:!0,supportsDepthTexture:!0}),this._passState=void 0}Object.defineProperties(YO.prototype,{framebuffer:{get:function(){return this._framebuffer.framebuffer}}});function YOt(e){e._framebuffer.destroy()}function XOt(e,t){let n=t.drawingBufferWidth,i=t.drawingBufferHeight;e._framebuffer.update(t,n,i);let r=new gc(t);r.blendingEnabled=!1,r.scissorTest={enabled:!0,rectangle:new et},r.viewport=new et,e._passState=r}YO.prototype.update=function(e,t,n){let i=n.width,r=n.height;this._framebuffer.isDirty(i,r)&&XOt(this,e);let o=this.framebuffer,s=this._passState;return s.framebuffer=o,s.viewport.width=i,s.viewport.height=r,s.scissorTest.rectangle.x=t.x,s.scissorTest.rectangle.y=r-t.y,s.scissorTest.rectangle.width=1,s.scissorTest.rectangle.height=1,s};YO.prototype.isDestroyed=function(){return!1};YO.prototype.destroy=function(){return YOt(this),le(this)};var JG=YO;function kT(e){let t=new gc(e);t.blendingEnabled=!1,t.scissorTest={enabled:!0,rectangle:new et},t.viewport=new et,this._context=e,this._fb=new ci({depthStencil:!0}),this._passState=t,this._width=0,this._height=0}function ROe(e,t,n,i,r=1){let o=Math.max(n,i),s=o*o,a=Math.floor(n*.5),c=Math.floor(i*.5),u=0,f=0,d=0,p=-1,g=new Set;for(let m=0;m<s;++m){if(-a<=u&&u<=a&&-c<=f&&f<=c){let y=4*((c-f)*n+u+a),A=z.bytesToRgba(t[y],t[y+1],t[y+2],t[y+3]),b=e.getObjectByPickColor(A);if(l(b)&&(g.add(b),g.size>=r))break}if(u===f||u<0&&-u===f||u>0&&u===1-f){let y=d;d=-p,p=y}u+=d,f+=p}return[...g]}kT.prototype.begin=function(e,t){let n=this._context,{width:i,height:r}=t;return et.clone(e,this._passState.scissorTest.rectangle),this._width=i,this._height=r,this._fb.update(n,i,r),this._passState.framebuffer=this._fb.framebuffer,this._passState.viewport.width=i,this._passState.viewport.height=r,this._passState};kT.prototype.endAsync=async function(e,t,n=1){let i=e.width??1,r=e.height??1,o=this._context,s=this._fb.framebuffer,a=ze.UNSIGNED_BYTE,c=$e.RGBA;l(s)&&s.numberOfColorAttachments>0&&(a=s.getColorTexture(0).pixelDatatype,c=s.getColorTexture(0).pixelFormat);let u=o.readPixelsToPBO({x:e.x,y:e.y,width:i,height:r,framebuffer:s}),f=f2.create({context:o});try{await f.waitForSignal(g=>t.afterRender.push(g));let d=$e.createTypedArray(c,a,i,r);return u.getBufferData(d),ROe(o,d,i,r,n)}catch{throw new oe("Async Picking Request Timeout")}finally{f.destroy(),u.destroy()}};kT.prototype.end=function(e,t=1){let n=e.width??1,i=e.height??1,r=this._context,o=r.readPixels({x:e.x,y:e.y,width:n,height:i,framebuffer:this._fb.framebuffer});return ROe(r,o,n,i,t)};kT.prototype.readCenterPixel=function(e){let t=e.width??1,n=e.height??1,r=this._context.readPixels({x:e.x,y:e.y,width:t,height:n,framebuffer:this._fb.framebuffer}),o=Math.floor(t*.5),a=4*(Math.floor(n*.5)*t+o);return r.slice(a,a+4)};kT.prototype.isDestroyed=function(){return!1};kT.prototype.destroy=function(){return this._fb.destroy(),le(this)};var ZG=kT;function r_(){this._numSamples=1,this._colorFramebuffer=new ci({depthStencil:!0,supportsDepthTexture:!0}),this._idFramebuffer=new ci({depthStencil:!0,supportsDepthTexture:!0}),this._idClearColor=new z(0,0,0,0),this._clearCommand=new fi({color:new z(0,0,0,0),depth:1,owner:this})}function KOt(e){e._colorFramebuffer.destroy(),e._idFramebuffer.destroy()}Object.defineProperties(r_.prototype,{framebuffer:{get:function(){return this._colorFramebuffer.framebuffer}},idFramebuffer:{get:function(){return this._idFramebuffer.framebuffer}},depthStencilTexture:{get:function(){return this._colorFramebuffer.getDepthStencilTexture()}}});r_.prototype.update=function(e,t,n,i){let r=t.width,o=t.height,s=n?e.halfFloatingPointTexture?ze.HALF_FLOAT:ze.FLOAT:ze.UNSIGNED_BYTE;this._numSamples=i,this._colorFramebuffer.update(e,r,o,i,s),this._idFramebuffer.update(e,r,o)};r_.prototype.clear=function(e,t,n){z.clone(n,this._clearCommand.color),z.clone(this._idClearColor,this._clearCommand.color),this._colorFramebuffer.clear(e,this._clearCommand,t),this._idFramebuffer.clear(e,this._clearCommand,t)};r_.prototype.getFramebuffer=function(){return this._colorFramebuffer.framebuffer};r_.prototype.getIdFramebuffer=function(){return this._idFramebuffer.framebuffer};r_.prototype.prepareColorTextures=function(e){this._numSamples>1&&this._colorFramebuffer.prepareTextures(e)};r_.prototype.isDestroyed=function(){return!1};r_.prototype.destroy=function(){return KOt(this),le(this)};var qw=r_;function jA(){}var $Ot={HAS_CLIPPING_PLANES:!0,ENABLE_CLIPPING_POLYGONS:!0};jA.hasClippingForShadowCast=function(e){let t=e.defines;return l(t)&&t.some(function(n){return $Ot[n]===!0})};jA.getShadowCastShaderKeyword=function(e,t,n,i,r){return`castShadow ${e} ${t} ${n} ${i} ${r}`};jA.createShadowCastVertexShader=function(e,t,n){let i=e.defines.slice(0),r=e.sources.slice(0);i.push("SHADOW_MAP"),n&&i.push("GENERATE_POSITION");let o=Xe.findPositionVarying(e),s=l(o);if(t&&!s){let a=r.length;for(let u=0;u<a;++u)r[u]=Xe.replaceMain(r[u],"czm_shadow_cast_main");r.push(`out vec3 v_positionEC; +`),r.createDerivedShaderProgram(t,n,{vertexShaderSource:t.vertexShaderSource,fragmentShaderSource:a,attributeLocations:s})}function lSt(e,t){return zte(e,t,"translucentMRT",sSt)}function uSt(e,t){return zte(e,t,"translucentMultipass",aSt)}function fSt(e,t){return zte(e,t,"alphaMultipass",cSt)}Hg.prototype.createDerivedCommands=function(e,t,n){if(l(n)||(n={}),this._translucentMRTSupport){let a,c;return l(n.translucentCommand)&&(a=n.translucentCommand.shaderProgram,c=n.translucentCommand.renderState),n.translucentCommand=at.shallowClone(e,n.translucentCommand),!l(a)||n.shaderProgramId!==e.shaderProgram.id?(n.translucentCommand.shaderProgram=lSt(t,e.shaderProgram),n.translucentCommand.renderState=iSt(this,t,e.renderState),n.shaderProgramId=e.shaderProgram.id):(n.translucentCommand.shaderProgram=a,n.translucentCommand.renderState=c),n}let i,r,o,s;return l(n.translucentCommand)&&(i=n.translucentCommand.shaderProgram,r=n.translucentCommand.renderState,o=n.alphaCommand.shaderProgram,s=n.alphaCommand.renderState),n.translucentCommand=at.shallowClone(e,n.translucentCommand),n.alphaCommand=at.shallowClone(e,n.alphaCommand),!l(i)||n.shaderProgramId!==e.shaderProgram.id?(n.translucentCommand.shaderProgram=uSt(t,e.shaderProgram),n.translucentCommand.renderState=rSt(this,t,e.renderState),n.alphaCommand.shaderProgram=fSt(t,e.shaderProgram),n.alphaCommand.renderState=oSt(this,t,e.renderState),n.shaderProgramId=e.shaderProgram.id):(n.translucentCommand.shaderProgram=i,n.translucentCommand.renderState=r,n.alphaCommand.shaderProgram=o,n.alphaCommand.renderState=s),n};function dSt(e,t,n,i,r,o){let{context:s,frameState:a}=t,{useLogDepth:c,shadowState:u}=a,f=t._hdr,d=i.framebuffer,p=u.lightShadowsEnabled;i.framebuffer=e._adjustTranslucentFBO.framebuffer,e._adjustTranslucentCommand.execute(s,i),i.framebuffer=e._adjustAlphaFBO.framebuffer,e._adjustAlphaCommand.execute(s,i);let g=e._opaqueFBO.framebuffer;i.framebuffer=e._translucentFBO.framebuffer;for(let m=0;m<r.length;++m){let y=r[m];y=c?y.derivedCommands.logDepth.command:y,y=f?y.derivedCommands.hdr.command:y;let A=p&&y.receiveShadows?y.derivedCommands.oit.shadows.translucentCommand:y.derivedCommands.oit.translucentCommand;n(A,t,i,g)}if(l(o)){let m=o.unclassifiedCommand,y=p&&m.receiveShadows?m.derivedCommands.oit.shadows.translucentCommand:m.derivedCommands.oit.translucentCommand;n(y,t,i,g)}i.framebuffer=e._alphaFBO.framebuffer;for(let m=0;m<r.length;++m){let y=r[m];y=c?y.derivedCommands.logDepth.command:y,y=f?y.derivedCommands.hdr.command:y;let A=p&&y.receiveShadows?y.derivedCommands.oit.shadows.alphaCommand:y.derivedCommands.oit.alphaCommand;n(A,t,i,g)}if(l(o)){let m=o.unclassifiedCommand,y=p&&m.receiveShadows?m.derivedCommands.oit.shadows.alphaCommand:m.derivedCommands.oit.alphaCommand;n(y,t,i,g)}i.framebuffer=d}function hSt(e,t,n,i,r,o){let{context:s,frameState:a}=t,{useLogDepth:c,shadowState:u}=a,f=t._hdr,d=i.framebuffer,p=u.lightShadowsEnabled;i.framebuffer=e._adjustTranslucentFBO.framebuffer,e._adjustTranslucentCommand.execute(s,i);let g=e._opaqueFBO.framebuffer;i.framebuffer=e._translucentFBO.framebuffer;for(let m=0;m<r.length;++m){let y=r[m];y=c?y.derivedCommands.logDepth.command:y,y=f?y.derivedCommands.hdr.command:y;let A=p&&y.receiveShadows?y.derivedCommands.oit.shadows.translucentCommand:y.derivedCommands.oit.translucentCommand;n(A,t,i,g)}if(l(o)){let m=o.unclassifiedCommand,y=p&&m.receiveShadows?m.derivedCommands.oit.shadows.translucentCommand:m.derivedCommands.oit.translucentCommand;n(y,t,i,g)}i.framebuffer=d}Hg.prototype.executeCommands=function(e,t,n,i,r){if(this._translucentMRTSupport){hSt(this,e,t,n,i,r);return}dSt(this,e,t,n,i,r)};Hg.prototype.execute=function(e,t){this._compositeCommand.execute(e,t)};Hg.prototype.clear=function(e,t,n){let i=t.framebuffer;t.framebuffer=this._opaqueFBO.framebuffer,z.clone(n,this._opaqueClearCommand.color),this._opaqueClearCommand.execute(e,t),t.framebuffer=this._translucentFBO.framebuffer,(this._translucentMRTSupport?this._translucentMRTClearCommand:this._translucentMultipassClearCommand).execute(e,t),this._translucentMultipassSupport&&(t.framebuffer=this._alphaFBO.framebuffer,this._alphaClearCommand.execute(e,t)),t.framebuffer=i};Hg.prototype.isSupported=function(){return this._translucentMRTSupport||this._translucentMultipassSupport};Hg.prototype.isDestroyed=function(){return!1};Hg.prototype.destroy=function(){return Nwe(this),l(this._compositeCommand)&&(this._compositeCommand.shaderProgram=this._compositeCommand.shaderProgram&&this._compositeCommand.shaderProgram.destroy()),l(this._adjustTranslucentCommand)&&(this._adjustTranslucentCommand.shaderProgram=this._adjustTranslucentCommand.shaderProgram&&this._adjustTranslucentCommand.shaderProgram.destroy()),l(this._adjustAlphaCommand)&&(this._adjustAlphaCommand.shaderProgram=this._adjustAlphaCommand.shaderProgram&&this._adjustAlphaCommand.shaderProgram.destroy()),le(this)};var F6=Hg;function UR(){this._framebuffer=new ci({color:!1,depthStencil:!0,supportsDepthTexture:!0}),this._passState=void 0}Object.defineProperties(UR.prototype,{framebuffer:{get:function(){return this._framebuffer.framebuffer}}});function mSt(e){e._framebuffer.destroy()}function pSt(e,t){let n=t.drawingBufferWidth,i=t.drawingBufferHeight;e._framebuffer.update(t,n,i);let r=new gc(t);r.blendingEnabled=!1,r.scissorTest={enabled:!0,rectangle:new et},r.viewport=new et,e._passState=r}UR.prototype.update=function(e,t,n){let i=n.width,r=n.height;this._framebuffer.isDirty(i,r)&&pSt(this,e);let o=this.framebuffer,s=this._passState;return s.framebuffer=o,s.viewport.width=i,s.viewport.height=r,s.scissorTest.rectangle.x=t.x,s.scissorTest.rectangle.y=r-t.y,s.scissorTest.rectangle.width=1,s.scissorTest.rectangle.height=1,s};UR.prototype.isDestroyed=function(){return!1};UR.prototype.destroy=function(){return mSt(this),le(this)};var B6=UR;function uT(e){let t=new gc(e);t.blendingEnabled=!1,t.scissorTest={enabled:!0,rectangle:new et},t.viewport=new et,this._context=e,this._fb=new ci({depthStencil:!0}),this._passState=t,this._width=0,this._height=0}function Lwe(e,t,n,i,r=1){let o=Math.max(n,i),s=o*o,a=Math.floor(n*.5),c=Math.floor(i*.5),u=0,f=0,d=0,p=-1,g=new Set;for(let m=0;m<s;++m){if(-a<=u&&u<=a&&-c<=f&&f<=c){let y=4*((c-f)*n+u+a),A=z.bytesToRgba(t[y],t[y+1],t[y+2],t[y+3]),b=e.getObjectByPickColor(A);if(l(b)&&(g.add(b),g.size>=r))break}if(u===f||u<0&&-u===f||u>0&&u===1-f){let y=d;d=-p,p=y}u+=d,f+=p}return[...g]}uT.prototype.begin=function(e,t){let n=this._context,{width:i,height:r}=t;return et.clone(e,this._passState.scissorTest.rectangle),this._width=i,this._height=r,this._fb.update(n,i,r),this._passState.framebuffer=this._fb.framebuffer,this._passState.viewport.width=i,this._passState.viewport.height=r,this._passState};uT.prototype.endAsync=async function(e,t,n=1){let i=e.width??1,r=e.height??1,o=this._context,s=this._fb.framebuffer,a=ze.UNSIGNED_BYTE,c=$e.RGBA;l(s)&&s.numberOfColorAttachments>0&&(a=s.getColorTexture(0).pixelDatatype,c=s.getColorTexture(0).pixelFormat);let u=o.readPixelsToPBO({x:e.x,y:e.y,width:i,height:r,framebuffer:s}),f=f2.create({context:o});try{await f.waitForSignal(g=>t.afterRender.push(g));let d=$e.createTypedArray(c,a,i,r);return u.getBufferData(d),Lwe(o,d,i,r,n)}catch{throw new oe("Async Picking Request Timeout")}finally{f.destroy(),u.destroy()}};uT.prototype.end=function(e,t=1){let n=e.width??1,i=e.height??1,r=this._context,o=r.readPixels({x:e.x,y:e.y,width:n,height:i,framebuffer:this._fb.framebuffer});return Lwe(r,o,n,i,t)};uT.prototype.readCenterPixel=function(e){let t=e.width??1,n=e.height??1,r=this._context.readPixels({x:e.x,y:e.y,width:t,height:n,framebuffer:this._fb.framebuffer}),o=Math.floor(t*.5),a=4*(Math.floor(n*.5)*t+o);return r.slice(a,a+4)};uT.prototype.isDestroyed=function(){return!1};uT.prototype.destroy=function(){return this._fb.destroy(),le(this)};var k6=uT;function Gg(){this._numSamples=1,this._colorFramebuffer=new ci({depthStencil:!0,supportsDepthTexture:!0}),this._idFramebuffer=new ci({depthStencil:!0,supportsDepthTexture:!0}),this._idClearColor=new z(0,0,0,0),this._clearCommand=new fi({color:new z(0,0,0,0),depth:1,owner:this})}function gSt(e){e._colorFramebuffer.destroy(),e._idFramebuffer.destroy()}Object.defineProperties(Gg.prototype,{framebuffer:{get:function(){return this._colorFramebuffer.framebuffer}},idFramebuffer:{get:function(){return this._idFramebuffer.framebuffer}},depthStencilTexture:{get:function(){return this._colorFramebuffer.getDepthStencilTexture()}}});Gg.prototype.update=function(e,t,n,i){let r=t.width,o=t.height,s=n?e.halfFloatingPointTexture?ze.HALF_FLOAT:ze.FLOAT:ze.UNSIGNED_BYTE;this._numSamples=i,this._colorFramebuffer.update(e,r,o,i,s),this._idFramebuffer.update(e,r,o)};Gg.prototype.clear=function(e,t,n){z.clone(n,this._clearCommand.color),z.clone(this._idClearColor,this._clearCommand.color),this._colorFramebuffer.clear(e,this._clearCommand,t),this._idFramebuffer.clear(e,this._clearCommand,t)};Gg.prototype.getFramebuffer=function(){return this._colorFramebuffer.framebuffer};Gg.prototype.getIdFramebuffer=function(){return this._idFramebuffer.framebuffer};Gg.prototype.prepareColorTextures=function(e){this._numSamples>1&&this._colorFramebuffer.prepareTextures(e)};Gg.prototype.isDestroyed=function(){return!1};Gg.prototype.destroy=function(){return gSt(this),le(this)};var ew=Gg;function AA(){}var _St={HAS_CLIPPING_PLANES:!0,ENABLE_CLIPPING_POLYGONS:!0};AA.hasClippingForShadowCast=function(e){let t=e.defines;return l(t)&&t.some(function(n){return _St[n]===!0})};AA.getShadowCastShaderKeyword=function(e,t,n,i,r){return`castShadow ${e} ${t} ${n} ${i} ${r}`};AA.createShadowCastVertexShader=function(e,t,n){let i=e.defines.slice(0),r=e.sources.slice(0);i.push("SHADOW_MAP"),n&&i.push("GENERATE_POSITION");let o=Xe.findPositionVarying(e),s=l(o);if(t&&!s){let a=r.length;for(let u=0;u<a;++u)r[u]=Xe.replaceMain(r[u],"czm_shadow_cast_main");r.push(`out vec3 v_positionEC; void main() { czm_shadow_cast_main(); v_positionEC = (czm_inverseProjection * gl_Position).xyz; -}`)}return new Xe({defines:i,sources:r})};jA.createShadowCastFragmentShader=function(e,t,n,i,r){let o=e.defines.slice(0),s=e.sources.slice(0);o.push("SHADOW_MAP");let a=Xe.findPositionVarying(e),c=l(a);c||(a="v_positionEC");let u=s.length;for(let d=0;d<u;++d)s[d]=Xe.replaceMain(s[d],"czm_shadow_cast_main");let f="";return t&&(c||(f+=`in vec3 v_positionEC; +}`)}return new Xe({defines:i,sources:r})};AA.createShadowCastFragmentShader=function(e,t,n,i,r){let o=e.defines.slice(0),s=e.sources.slice(0);o.push("SHADOW_MAP");let a=Xe.findPositionVarying(e),c=l(a);c||(a="v_positionEC");let u=s.length;for(let d=0;d<u;++d)s[d]=Xe.replaceMain(s[d],"czm_shadow_cast_main");let f="";return t&&(c||(f+=`in vec3 v_positionEC; `),f+=`uniform vec4 shadowMap_lightPositionEC; `),i&&r?f+=`void main() { @@ -10374,7 +10374,7 @@ void main() `:n?f+=` out_FragColor = vec4(1.0); `:f+=` out_FragColor = czm_packDepth(gl_FragCoord.z); `,f+=`} -`,s.push(f),new Xe({defines:o,sources:s})};jA.getShadowReceiveShaderKeyword=function(e,t,n,i){let r=e._usesDepthTexture,o=e._polygonOffsetSupported,s=e._isPointLight,a=e._isSpotLight,c=e._numberOfCascades>1,u=e.debugCascadeColors,f=e.softShadows;return`receiveShadow ${r}${o}${s}${a}${c}${u}${f}${t}${n}${i}`};jA.createShadowReceiveVertexShader=function(e,t,n){let i=e.defines.slice(0),r=e.sources.slice(0);return i.push("SHADOW_MAP"),t&&(n?i.push("GENERATE_POSITION_AND_NORMAL"):i.push("GENERATE_POSITION")),new Xe({defines:i,sources:r})};jA.createShadowReceiveFragmentShader=function(e,t,n,i,r){let o=Xe.findNormalVarying(e),s=!i&&l(o)||i&&r,a=Xe.findPositionVarying(e),c=l(a),u=t._usesDepthTexture,f=t._polygonOffsetSupported,d=t._isPointLight,p=t._isSpotLight,g=t._numberOfCascades>1,m=t.debugCascadeColors,y=t.softShadows,A=d?t._pointBias:i?t._terrainBias:t._primitiveBias,b=e.defines.slice(0),x=e.sources.slice(0),T=x.length;for(let S=0;S<T;++S)x[S]=Xe.replaceMain(x[S],"czm_shadow_receive_main");d?b.push("USE_CUBE_MAP_SHADOW"):u&&b.push("USE_SHADOW_DEPTH_TEXTURE"),y&&!d&&b.push("USE_SOFT_SHADOWS"),g&&n&&i&&(s?b.push("ENABLE_VERTEX_LIGHTING"):b.push("ENABLE_DAYNIGHT_SHADING")),n&&A.normalShading&&s&&(b.push("USE_NORMAL_SHADING"),A.normalShadingSmooth>0&&b.push("USE_NORMAL_SHADING_SMOOTH"));let E="";d?E+=`uniform samplerCube shadowMap_textureCube; +`,s.push(f),new Xe({defines:o,sources:s})};AA.getShadowReceiveShaderKeyword=function(e,t,n,i){let r=e._usesDepthTexture,o=e._polygonOffsetSupported,s=e._isPointLight,a=e._isSpotLight,c=e._numberOfCascades>1,u=e.debugCascadeColors,f=e.softShadows;return`receiveShadow ${r}${o}${s}${a}${c}${u}${f}${t}${n}${i}`};AA.createShadowReceiveVertexShader=function(e,t,n){let i=e.defines.slice(0),r=e.sources.slice(0);return i.push("SHADOW_MAP"),t&&(n?i.push("GENERATE_POSITION_AND_NORMAL"):i.push("GENERATE_POSITION")),new Xe({defines:i,sources:r})};AA.createShadowReceiveFragmentShader=function(e,t,n,i,r){let o=Xe.findNormalVarying(e),s=!i&&l(o)||i&&r,a=Xe.findPositionVarying(e),c=l(a),u=t._usesDepthTexture,f=t._polygonOffsetSupported,d=t._isPointLight,p=t._isSpotLight,g=t._numberOfCascades>1,m=t.debugCascadeColors,y=t.softShadows,A=d?t._pointBias:i?t._terrainBias:t._primitiveBias,b=e.defines.slice(0),x=e.sources.slice(0),T=x.length;for(let S=0;S<T;++S)x[S]=Xe.replaceMain(x[S],"czm_shadow_receive_main");d?b.push("USE_CUBE_MAP_SHADOW"):u&&b.push("USE_SHADOW_DEPTH_TEXTURE"),y&&!d&&b.push("USE_SOFT_SHADOWS"),g&&n&&i&&(s?b.push("ENABLE_VERTEX_LIGHTING"):b.push("ENABLE_DAYNIGHT_SHADING")),n&&A.normalShading&&s&&(b.push("USE_NORMAL_SHADING"),A.normalShadingSmooth>0&&b.push("USE_NORMAL_SHADING_SMOOTH"));let E="";d?E+=`uniform samplerCube shadowMap_textureCube; `:E+=`uniform sampler2D shadowMap_texture; `;let v;return c?v=` return vec4(${a}, 1.0); `:v=`#ifndef LOG_DEPTH @@ -10485,7 +10485,7 @@ ${m?` // Draw cascade colors for debugging float visibility = czm_shadowVisibility(shadowMap_texture, shadowParameters); `,E+=` out_FragColor.rgb *= visibility; } -`,x.push(E),new Xe({defines:b,sources:x})};var f0=jA;function d0(e){e=e??H.EMPTY_OBJECT;let t=e.context;this._enabled=e.enabled??!0,this._softShadows=e.softShadows??!1,this._normalOffset=e.normalOffset??!0,this.dirty=!0,this.fromLightSource=e.fromLightSource??!0,this.darkness=e.darkness??.3,this._darkness=this.darkness,this.fadingEnabled=e.fadingEnabled??!0,this.maximumDistance=e.maximumDistance??5e3,this._outOfView=!1,this._outOfViewPrevious=!1,this._needsUpdate=!0;let n=!0;(dn.isEdge()||(dn.isChrome()||dn.isFirefox())&&dn.isWindows()&&!t.depthTexture)&&(n=!1),this._polygonOffsetSupported=n,this._terrainBias={polygonOffset:n,polygonOffsetFactor:1.1,polygonOffsetUnits:4,normalOffset:this._normalOffset,normalOffsetScale:.5,normalShading:!0,normalShadingSmooth:.3,depthBias:1e-4},this._primitiveBias={polygonOffset:n,polygonOffsetFactor:1.1,polygonOffsetUnits:4,normalOffset:this._normalOffset,normalOffsetScale:.1,normalShading:!0,normalShadingSmooth:.05,depthBias:2e-5},this._pointBias={polygonOffset:!1,polygonOffsetFactor:1.1,polygonOffsetUnits:4,normalOffset:this._normalOffset,normalOffsetScale:0,normalShading:!0,normalShadingSmooth:.1,depthBias:5e-4},this._depthAttachment=void 0,this._colorAttachment=void 0,this._shadowMapMatrix=new M,this._shadowMapTexture=void 0,this._lightDirectionEC=new h,this._lightPositionEC=new se,this._distance=0,this._lightCamera=e.lightCamera,this._shadowMapCamera=new QG,this._shadowMapCullingVolume=void 0,this._sceneCamera=void 0,this._boundingSphere=new ue,this._isPointLight=e.isPointLight??!1,this._pointLightRadius=e.pointLightRadius??100,this._cascadesEnabled=this._isPointLight?!1:e.cascadesEnabled??!0,this._numberOfCascades=this._cascadesEnabled?e.numberOfCascades??4:0,this._fitNearFar=!0,this._maximumCascadeDistances=[25,150,700,Number.MAX_VALUE],this._textureSize=new U,this._isSpotLight=!1,this._cascadesEnabled?this._shadowMapCamera.frustum=new Ss:l(this._lightCamera.frustum.fov)&&(this._isSpotLight=!0),this._cascadeSplits=[new se,new se],this._cascadeMatrices=[new M,new M,new M,new M],this._cascadeDistances=new se;let i;this._isPointLight?i=6:this._cascadesEnabled?i=this._numberOfCascades:i=1,this._passes=new Array(i);for(let r=0;r<i;++r)this._passes[r]=new JOt(t);this.debugShow=!1,this.debugFreezeFrame=!1,this._debugFreezeFrame=!1,this._debugCascadeColors=!1,this._debugLightFrustum=void 0,this._debugCameraFrustum=void 0,this._debugCascadeFrustums=new Array(this._numberOfCascades),this._debugShadowViewCommand=void 0,this._usesDepthTexture=t.depthTexture,this._isPointLight&&(this._usesDepthTexture=!1),this._primitiveRenderState=void 0,this._terrainRenderState=void 0,this._pointRenderState=void 0,ioe(this),this._clearCommand=new fi({depth:1,color:new z}),this._clearPassState=new gc(t),this._size=e.size??2048,this.size=this._size}d0.MAXIMUM_DISTANCE=2e4;function JOt(e){this.camera=new QG,this.passState=new gc(e),this.framebuffer=void 0,this.textureOffsets=void 0,this.commandList=[],this.cullingVolume=void 0}function noe(e,t){return Ge.fromCache({cull:{enabled:!0,face:Gi.BACK},depthTest:{enabled:!0},colorMask:{red:e,green:e,blue:e,alpha:e},depthMask:!0,polygonOffset:{enabled:t.polygonOffset,factor:t.polygonOffsetFactor,units:t.polygonOffsetUnits}})}function ioe(e){let t=!e._usesDepthTexture;e._primitiveRenderState=noe(t,e._primitiveBias),e._terrainRenderState=noe(t,e._terrainBias),e._pointRenderState=noe(t,e._pointBias)}d0.prototype.debugCreateRenderStates=function(){ioe(this)};Object.defineProperties(d0.prototype,{enabled:{get:function(){return this._enabled},set:function(e){this.dirty=this._enabled!==e,this._enabled=e}},normalOffset:{get:function(){return this._normalOffset},set:function(e){this.dirty=this._normalOffset!==e,this._normalOffset=e,this._terrainBias.normalOffset=e,this._primitiveBias.normalOffset=e,this._pointBias.normalOffset=e}},softShadows:{get:function(){return this._softShadows},set:function(e){this.dirty=this._softShadows!==e,this._softShadows=e}},size:{get:function(){return this._size},set:function(e){iMt(this,e)}},outOfView:{get:function(){return this._outOfView}},shadowMapCullingVolume:{get:function(){return this._shadowMapCullingVolume}},passes:{get:function(){return this._passes}},isPointLight:{get:function(){return this._isPointLight}},debugCascadeColors:{get:function(){return this._debugCascadeColors},set:function(e){this.dirty=this._debugCascadeColors!==e,this._debugCascadeColors=e}}});function roe(e){let t=e._passes.length;for(let n=0;n<t;++n){let i=e._passes[n],r=i.framebuffer;l(r)&&!r.isDestroyed()&&r.destroy(),i.framebuffer=void 0}e._depthAttachment=e._depthAttachment&&e._depthAttachment.destroy(),e._colorAttachment=e._colorAttachment&&e._colorAttachment.destroy()}function ZOt(e,t){let n=new rd({context:t,width:e._textureSize.x,height:e._textureSize.y,format:fu.DEPTH_COMPONENT16}),i=new Dt({context:t,width:e._textureSize.x,height:e._textureSize.y,pixelFormat:$e.RGBA,pixelDatatype:ze.UNSIGNED_BYTE,sampler:Ht.NEAREST}),r=new vs({context:t,depthRenderbuffer:n,colorTextures:[i],destroyAttachments:!1}),o=e._passes.length;for(let s=0;s<o;++s){let a=e._passes[s];a.framebuffer=r,a.passState.framebuffer=r}e._shadowMapTexture=i,e._depthAttachment=n,e._colorAttachment=i}function QOt(e,t){let n=new Dt({context:t,width:e._textureSize.x,height:e._textureSize.y,pixelFormat:$e.DEPTH_STENCIL,pixelDatatype:ze.UNSIGNED_INT_24_8,sampler:Ht.NEAREST}),i=new vs({context:t,depthStencilTexture:n,destroyAttachments:!1}),r=e._passes.length;for(let o=0;o<r;++o){let s=e._passes[o];s.framebuffer=i,s.passState.framebuffer=i}e._shadowMapTexture=n,e._depthAttachment=n}function eMt(e,t){let n=new rd({context:t,width:e._textureSize.x,height:e._textureSize.y,format:fu.DEPTH_COMPONENT16}),i=new ls({context:t,width:e._textureSize.x,height:e._textureSize.y,pixelFormat:$e.RGBA,pixelDatatype:ze.UNSIGNED_BYTE,sampler:Ht.NEAREST}),r=[i.negativeX,i.negativeY,i.negativeZ,i.positiveX,i.positiveY,i.positiveZ];for(let o=0;o<6;++o){let s=new vs({context:t,depthRenderbuffer:n,colorTextures:[r[o]],destroyAttachments:!1}),a=e._passes[o];a.framebuffer=s,a.passState.framebuffer=s}e._shadowMapTexture=i,e._depthAttachment=n,e._colorAttachment=i}function NOe(e,t){e._isPointLight?eMt(e,t):e._usesDepthTexture?QOt(e,t):ZOt(e,t)}function tMt(e,t){e._usesDepthTexture&&e._passes[0].framebuffer.status!==te.FRAMEBUFFER_COMPLETE&&(e._usesDepthTexture=!1,ioe(e),roe(e),NOe(e,t))}function nMt(e,t){(!l(e._passes[0].framebuffer)||e._shadowMapTexture.width!==e._textureSize.x)&&(roe(e),NOe(e,t),tMt(e,t),LOe(e,t))}function LOe(e,t,n){n=n??0,(e._isPointLight||n===0)&&(e._clearCommand.framebuffer=e._passes[n].framebuffer,e._clearCommand.execute(t,e._clearPassState))}function iMt(e,t){e._size=t;let n=e._passes,i=n.length,r=e._textureSize;if(e._isPointLight){t=Ut.maximumCubeMapSize>=t?t:Ut.maximumCubeMapSize,r.x=t,r.y=t;let o=new et(0,0,t,t);n[0].passState.viewport=o,n[1].passState.viewport=o,n[2].passState.viewport=o,n[3].passState.viewport=o,n[4].passState.viewport=o,n[5].passState.viewport=o}else i===1?(t=Ut.maximumTextureSize>=t?t:Ut.maximumTextureSize,r.x=t,r.y=t,n[0].passState.viewport=new et(0,0,t,t)):i===4&&(t=Ut.maximumTextureSize>=t*2?t:Ut.maximumTextureSize/2,r.x=t*2,r.y=t*2,n[0].passState.viewport=new et(0,0,t,t),n[1].passState.viewport=new et(t,0,t,t),n[2].passState.viewport=new et(0,t,t,t),n[3].passState.viewport=new et(t,t,t,t));e._clearPassState.viewport=new et(0,0,r.x,r.y);for(let o=0;o<i;++o){let s=n[o],a=s.passState.viewport,c=a.x/r.x,u=a.y/r.y,f=a.width/r.x,d=a.height/r.y;s.textureOffsets=new M(f,0,0,c,0,d,0,u,0,0,1,0,0,0,0,1)}}var rMt=new et;function oMt(e,t){let n;e._isPointLight?n=`uniform samplerCube shadowMap_textureCube; +`,x.push(E),new Xe({defines:b,sources:x})};var Kp=AA;function $p(e){e=e??H.EMPTY_OBJECT;let t=e.context;this._enabled=e.enabled??!0,this._softShadows=e.softShadows??!1,this._normalOffset=e.normalOffset??!0,this.dirty=!0,this.fromLightSource=e.fromLightSource??!0,this.darkness=e.darkness??.3,this._darkness=this.darkness,this.fadingEnabled=e.fadingEnabled??!0,this.maximumDistance=e.maximumDistance??5e3,this._outOfView=!1,this._outOfViewPrevious=!1,this._needsUpdate=!0;let n=!0;(dn.isEdge()||(dn.isChrome()||dn.isFirefox())&&dn.isWindows()&&!t.depthTexture)&&(n=!1),this._polygonOffsetSupported=n,this._terrainBias={polygonOffset:n,polygonOffsetFactor:1.1,polygonOffsetUnits:4,normalOffset:this._normalOffset,normalOffsetScale:.5,normalShading:!0,normalShadingSmooth:.3,depthBias:1e-4},this._primitiveBias={polygonOffset:n,polygonOffsetFactor:1.1,polygonOffsetUnits:4,normalOffset:this._normalOffset,normalOffsetScale:.1,normalShading:!0,normalShadingSmooth:.05,depthBias:2e-5},this._pointBias={polygonOffset:!1,polygonOffsetFactor:1.1,polygonOffsetUnits:4,normalOffset:this._normalOffset,normalOffsetScale:0,normalShading:!0,normalShadingSmooth:.1,depthBias:5e-4},this._depthAttachment=void 0,this._colorAttachment=void 0,this._shadowMapMatrix=new M,this._shadowMapTexture=void 0,this._lightDirectionEC=new h,this._lightPositionEC=new se,this._distance=0,this._lightCamera=e.lightCamera,this._shadowMapCamera=new U6,this._shadowMapCullingVolume=void 0,this._sceneCamera=void 0,this._boundingSphere=new ue,this._isPointLight=e.isPointLight??!1,this._pointLightRadius=e.pointLightRadius??100,this._cascadesEnabled=this._isPointLight?!1:e.cascadesEnabled??!0,this._numberOfCascades=this._cascadesEnabled?e.numberOfCascades??4:0,this._fitNearFar=!0,this._maximumCascadeDistances=[25,150,700,Number.MAX_VALUE],this._textureSize=new U,this._isSpotLight=!1,this._cascadesEnabled?this._shadowMapCamera.frustum=new Ss:l(this._lightCamera.frustum.fov)&&(this._isSpotLight=!0),this._cascadeSplits=[new se,new se],this._cascadeMatrices=[new M,new M,new M,new M],this._cascadeDistances=new se;let i;this._isPointLight?i=6:this._cascadesEnabled?i=this._numberOfCascades:i=1,this._passes=new Array(i);for(let r=0;r<i;++r)this._passes[r]=new ySt(t);this.debugShow=!1,this.debugFreezeFrame=!1,this._debugFreezeFrame=!1,this._debugCascadeColors=!1,this._debugLightFrustum=void 0,this._debugCameraFrustum=void 0,this._debugCascadeFrustums=new Array(this._numberOfCascades),this._debugShadowViewCommand=void 0,this._usesDepthTexture=t.depthTexture,this._isPointLight&&(this._usesDepthTexture=!1),this._primitiveRenderState=void 0,this._terrainRenderState=void 0,this._pointRenderState=void 0,jte(this),this._clearCommand=new fi({depth:1,color:new z}),this._clearPassState=new gc(t),this._size=e.size??2048,this.size=this._size}$p.MAXIMUM_DISTANCE=2e4;function ySt(e){this.camera=new U6,this.passState=new gc(e),this.framebuffer=void 0,this.textureOffsets=void 0,this.commandList=[],this.cullingVolume=void 0}function Vte(e,t){return Ge.fromCache({cull:{enabled:!0,face:Hi.BACK},depthTest:{enabled:!0},colorMask:{red:e,green:e,blue:e,alpha:e},depthMask:!0,polygonOffset:{enabled:t.polygonOffset,factor:t.polygonOffsetFactor,units:t.polygonOffsetUnits}})}function jte(e){let t=!e._usesDepthTexture;e._primitiveRenderState=Vte(t,e._primitiveBias),e._terrainRenderState=Vte(t,e._terrainBias),e._pointRenderState=Vte(t,e._pointBias)}$p.prototype.debugCreateRenderStates=function(){jte(this)};Object.defineProperties($p.prototype,{enabled:{get:function(){return this._enabled},set:function(e){this.dirty=this._enabled!==e,this._enabled=e}},normalOffset:{get:function(){return this._normalOffset},set:function(e){this.dirty=this._normalOffset!==e,this._normalOffset=e,this._terrainBias.normalOffset=e,this._primitiveBias.normalOffset=e,this._pointBias.normalOffset=e}},softShadows:{get:function(){return this._softShadows},set:function(e){this.dirty=this._softShadows!==e,this._softShadows=e}},size:{get:function(){return this._size},set:function(e){CSt(this,e)}},outOfView:{get:function(){return this._outOfView}},shadowMapCullingVolume:{get:function(){return this._shadowMapCullingVolume}},passes:{get:function(){return this._passes}},isPointLight:{get:function(){return this._isPointLight}},debugCascadeColors:{get:function(){return this._debugCascadeColors},set:function(e){this.dirty=this._debugCascadeColors!==e,this._debugCascadeColors=e}}});function Hte(e){let t=e._passes.length;for(let n=0;n<t;++n){let i=e._passes[n],r=i.framebuffer;l(r)&&!r.isDestroyed()&&r.destroy(),i.framebuffer=void 0}e._depthAttachment=e._depthAttachment&&e._depthAttachment.destroy(),e._colorAttachment=e._colorAttachment&&e._colorAttachment.destroy()}function ASt(e,t){let n=new id({context:t,width:e._textureSize.x,height:e._textureSize.y,format:fu.DEPTH_COMPONENT16}),i=new Dt({context:t,width:e._textureSize.x,height:e._textureSize.y,pixelFormat:$e.RGBA,pixelDatatype:ze.UNSIGNED_BYTE,sampler:Ht.NEAREST}),r=new vs({context:t,depthRenderbuffer:n,colorTextures:[i],destroyAttachments:!1}),o=e._passes.length;for(let s=0;s<o;++s){let a=e._passes[s];a.framebuffer=r,a.passState.framebuffer=r}e._shadowMapTexture=i,e._depthAttachment=n,e._colorAttachment=i}function bSt(e,t){let n=new Dt({context:t,width:e._textureSize.x,height:e._textureSize.y,pixelFormat:$e.DEPTH_STENCIL,pixelDatatype:ze.UNSIGNED_INT_24_8,sampler:Ht.NEAREST}),i=new vs({context:t,depthStencilTexture:n,destroyAttachments:!1}),r=e._passes.length;for(let o=0;o<r;++o){let s=e._passes[o];s.framebuffer=i,s.passState.framebuffer=i}e._shadowMapTexture=n,e._depthAttachment=n}function xSt(e,t){let n=new id({context:t,width:e._textureSize.x,height:e._textureSize.y,format:fu.DEPTH_COMPONENT16}),i=new ls({context:t,width:e._textureSize.x,height:e._textureSize.y,pixelFormat:$e.RGBA,pixelDatatype:ze.UNSIGNED_BYTE,sampler:Ht.NEAREST}),r=[i.negativeX,i.negativeY,i.negativeZ,i.positiveX,i.positiveY,i.positiveZ];for(let o=0;o<6;++o){let s=new vs({context:t,depthRenderbuffer:n,colorTextures:[r[o]],destroyAttachments:!1}),a=e._passes[o];a.framebuffer=s,a.passState.framebuffer=s}e._shadowMapTexture=i,e._depthAttachment=n,e._colorAttachment=i}function kwe(e,t){e._isPointLight?xSt(e,t):e._usesDepthTexture?bSt(e,t):ASt(e,t)}function TSt(e,t){e._usesDepthTexture&&e._passes[0].framebuffer.status!==te.FRAMEBUFFER_COMPLETE&&(e._usesDepthTexture=!1,jte(e),Hte(e),kwe(e,t))}function ESt(e,t){(!l(e._passes[0].framebuffer)||e._shadowMapTexture.width!==e._textureSize.x)&&(Hte(e),kwe(e,t),TSt(e,t),Uwe(e,t))}function Uwe(e,t,n){n=n??0,(e._isPointLight||n===0)&&(e._clearCommand.framebuffer=e._passes[n].framebuffer,e._clearCommand.execute(t,e._clearPassState))}function CSt(e,t){e._size=t;let n=e._passes,i=n.length,r=e._textureSize;if(e._isPointLight){t=Ut.maximumCubeMapSize>=t?t:Ut.maximumCubeMapSize,r.x=t,r.y=t;let o=new et(0,0,t,t);n[0].passState.viewport=o,n[1].passState.viewport=o,n[2].passState.viewport=o,n[3].passState.viewport=o,n[4].passState.viewport=o,n[5].passState.viewport=o}else i===1?(t=Ut.maximumTextureSize>=t?t:Ut.maximumTextureSize,r.x=t,r.y=t,n[0].passState.viewport=new et(0,0,t,t)):i===4&&(t=Ut.maximumTextureSize>=t*2?t:Ut.maximumTextureSize/2,r.x=t*2,r.y=t*2,n[0].passState.viewport=new et(0,0,t,t),n[1].passState.viewport=new et(t,0,t,t),n[2].passState.viewport=new et(0,t,t,t),n[3].passState.viewport=new et(t,t,t,t));e._clearPassState.viewport=new et(0,0,r.x,r.y);for(let o=0;o<i;++o){let s=n[o],a=s.passState.viewport,c=a.x/r.x,u=a.y/r.y,f=a.width/r.x,d=a.height/r.y;s.textureOffsets=new M(f,0,0,c,0,d,0,u,0,0,1,0,0,0,0,1)}}var vSt=new et;function SSt(e,t){let n;e._isPointLight?n=`uniform samplerCube shadowMap_textureCube; in vec2 v_textureCoordinates; void main() { @@ -10546,7 +10546,7 @@ ${e._usesDepthTexture?` float shadow = texture(shadowMap_texture, v_textureCo `:` float shadow = czm_unpackDepth(texture(shadowMap_texture, v_textureCoordinates)); `} out_FragColor = vec4(vec3(shadow), 1.0); } -`;let i=t.createViewportQuadCommand(n,{uniformMap:{shadowMap_texture:function(){return e._shadowMapTexture},shadowMap_textureCube:function(){return e._shadowMapTexture}}});return i.pass=Ie.OVERLAY,i}function sMt(e,t){let n=t.context,i=t.context.drawingBufferWidth,r=t.context.drawingBufferHeight,o=Math.min(i,r)*.3,s=rMt;s.x=i-o,s.y=0,s.width=o,s.height=o;let a=e._debugShadowViewCommand;l(a)||(a=oMt(e,n),e._debugShadowViewCommand=a),(!l(a.renderState)||!et.equals(a.renderState.viewport,s))&&(a.renderState=Ge.fromCache({viewport:et.clone(s)})),t.commandList.push(e._debugShadowViewCommand)}var h0=new Array(8);h0[0]=new se(-1,-1,-1,1);h0[1]=new se(1,-1,-1,1);h0[2]=new se(1,1,-1,1);h0[3]=new se(-1,1,-1,1);h0[4]=new se(-1,-1,1,1);h0[5]=new se(1,-1,1,1);h0[6]=new se(1,1,1,1);h0[7]=new se(-1,1,1,1);var HA=new M,ooe=new Array(8);for(let e=0;e<8;++e)ooe[e]=new se;function aMt(e,t){let n=new Bt({geometry:new Jm({minimum:new h(-.5,-.5,-.5),maximum:new h(.5,.5,.5)}),attributes:{color:Jt.fromColor(t)}}),i=new Bt({geometry:new qy({radius:.5}),attributes:{color:Jt.fromColor(t)}});return new Mn({geometryInstances:[n,i],appearance:new An({translucent:!1,flat:!0}),asynchronous:!1,modelMatrix:e})}var cMt=[z.RED,z.GREEN,z.BLUE,z.MAGENTA],lMt=new h;function uMt(e,t){sMt(e,t);let n=e.debugFreezeFrame&&!e._debugFreezeFrame;if(e._debugFreezeFrame=e.debugFreezeFrame,e.debugFreezeFrame&&(n&&(e._debugCameraFrustum=e._debugCameraFrustum&&e._debugCameraFrustum.destroy(),e._debugCameraFrustum=new n_({camera:e._sceneCamera,color:z.CYAN,updateOnChange:!1})),e._debugCameraFrustum.update(t)),e._cascadesEnabled){if(e.debugFreezeFrame){n&&(e._debugLightFrustum=e._debugLightFrustum&&e._debugLightFrustum.destroy(),e._debugLightFrustum=new n_({camera:e._shadowMapCamera,color:z.YELLOW,updateOnChange:!1})),e._debugLightFrustum.update(t);for(let i=0;i<e._numberOfCascades;++i)n&&(e._debugCascadeFrustums[i]=e._debugCascadeFrustums[i]&&e._debugCascadeFrustums[i].destroy(),e._debugCascadeFrustums[i]=new n_({camera:e._passes[i].camera,color:cMt[i],updateOnChange:!1})),e._debugCascadeFrustums[i].update(t)}}else if(e._isPointLight){if(!l(e._debugLightFrustum)||e._needsUpdate){let i=e._shadowMapCamera.positionWC,r=Le.IDENTITY,o=e._pointLightRadius*2,s=h.fromElements(o,o,o,lMt),a=M.fromTranslationQuaternionRotationScale(i,r,s,HA);e._debugLightFrustum=e._debugLightFrustum&&e._debugLightFrustum.destroy(),e._debugLightFrustum=aMt(a,z.YELLOW)}e._debugLightFrustum.update(t)}else(!l(e._debugLightFrustum)||e._needsUpdate)&&(e._debugLightFrustum=new n_({camera:e._shadowMapCamera,color:z.YELLOW,updateOnChange:!1})),e._debugLightFrustum.update(t)}function QG(){this.viewMatrix=new M,this.inverseViewMatrix=new M,this.frustum=void 0,this.positionCartographic=new he,this.positionWC=new h,this.directionWC=h.clone(h.UNIT_Z),this.upWC=h.clone(h.UNIT_Y),this.rightWC=h.clone(h.UNIT_X),this.viewProjectionMatrix=new M}QG.prototype.clone=function(e){M.clone(e.viewMatrix,this.viewMatrix),M.clone(e.inverseViewMatrix,this.inverseViewMatrix),this.frustum=e.frustum.clone(this.frustum),he.clone(e.positionCartographic,this.positionCartographic),h.clone(e.positionWC,this.positionWC),h.clone(e.directionWC,this.directionWC),h.clone(e.upWC,this.upWC),h.clone(e.rightWC,this.rightWC)};var fMt=new M(.5,0,0,.5,0,.5,0,.5,0,0,.5,.5,0,0,0,1);QG.prototype.getViewProjection=function(){let e=this.viewMatrix,t=this.frustum.projectionMatrix;return M.multiply(t,e,this.viewProjectionMatrix),M.multiply(fMt,this.viewProjectionMatrix,this.viewProjectionMatrix),this.viewProjectionMatrix};var dMt=new Array(5),hMt=new er,mMt=new Array(4),FOe=new h,BOe=new h;function pMt(e,t){let n=e._shadowMapCamera,i=e._sceneCamera,r=i.frustum.near,o=i.frustum.far,s=e._numberOfCascades,a,c=o-r,u=o/r,f=.9,d=!1;t.shadowState.closestObjectSize<200&&(d=!0,f=.9);let p=mMt,g=dMt;for(g[0]=r,g[s]=o,a=0;a<s;++a){let L=(a+1)/s,_=r*Math.pow(u,L),C=r+c*L,w=P.lerp(C,_,f);g[a+1]=w,p[a]=w-g[a]}if(d){for(a=0;a<s;++a)p[a]=Math.min(p[a],e._maximumCascadeDistances[a]);let L=g[0];for(a=0;a<s-1;++a)L+=p[a],g[a+1]=L}se.unpack(g,0,e._cascadeSplits[0]),se.unpack(g,1,e._cascadeSplits[1]),se.unpack(p,0,e._cascadeDistances);let m=n.frustum,y=m.left,A=m.right,b=m.bottom,x=m.top,T=m.near,E=m.far,v=n.positionWC,S=n.directionWC,I=n.upWC,R=i.frustum.clone(hMt),O=n.getViewProjection();for(a=0;a<s;++a){R.near=g[a],R.far=g[a+1];let L=M.multiply(R.projectionMatrix,i.viewMatrix,HA),_=M.inverse(L,HA),C=M.multiply(O,_,HA),w=h.fromElements(Number.MAX_VALUE,Number.MAX_VALUE,Number.MAX_VALUE,FOe),D=h.fromElements(-Number.MAX_VALUE,-Number.MAX_VALUE,-Number.MAX_VALUE,BOe);for(let j=0;j<8;++j){let k=se.clone(h0[j],ooe[j]);M.multiplyByVector(C,k,k),h.divideByScalar(k,k.w,k),h.minimumByComponent(k,w,w),h.maximumByComponent(k,D,D)}w.x=Math.max(w.x,0),w.y=Math.max(w.y,0),w.z=0,D.x=Math.min(D.x,1),D.y=Math.min(D.y,1),D.z=Math.min(D.z,1);let N=e._passes[a],F=N.camera;F.clone(n);let V=F.frustum;V.left=y+w.x*(A-y),V.right=y+D.x*(A-y),V.bottom=b+w.y*(x-b),V.top=b+D.y*(x-b),V.near=T+w.z*(E-T),V.far=T+D.z*(E-T),N.cullingVolume=F.frustum.computeCullingVolume(v,S,I);let B=e._cascadeMatrices[a];M.multiply(F.getViewProjection(),i.inverseViewMatrix,B),M.multiply(N.textureOffsets,B,B)}}var gMt=new M,_Mt=new h,yMt=new h,OOe=new h;function AMt(e,t){let n=e._shadowMapCamera,i=e._sceneCamera,r=M.multiply(i.frustum.projectionMatrix,i.viewMatrix,HA),o=M.inverse(r,HA),s=n.directionWC,a=i.directionWC;h.equalsEpsilon(s,a,P.EPSILON10)&&(a=i.upWC);let c=h.cross(s,a,_Mt);a=h.cross(c,s,yMt),h.normalize(a,a),h.normalize(c,c);let u=h.fromElements(0,0,0,OOe),f=M.computeView(u,s,a,c,gMt),d=M.multiply(f,o,HA),p=h.fromElements(Number.MAX_VALUE,Number.MAX_VALUE,Number.MAX_VALUE,FOe),g=h.fromElements(-Number.MAX_VALUE,-Number.MAX_VALUE,-Number.MAX_VALUE,BOe);for(let E=0;E<8;++E){let v=se.clone(h0[E],ooe[E]);M.multiplyByVector(d,v,v),h.divideByScalar(v,v.w,v),h.minimumByComponent(v,p,p),h.maximumByComponent(v,g,g)}g.z+=1e3,p.z-=10;let m=OOe;m.x=-(.5*(p.x+g.x)),m.y=-(.5*(p.y+g.y)),m.z=-g.z;let y=M.fromTranslation(m,HA);f=M.multiply(y,f,f);let A=.5*(g.x-p.x),b=.5*(g.y-p.y),x=g.z-p.z,T=n.frustum;T.left=-A,T.right=A,T.bottom=-b,T.top=b,T.near=.01,T.far=x,M.clone(f,n.viewMatrix),M.inverse(f,n.inverseViewMatrix),M.getTranslation(n.inverseViewMatrix,n.positionWC),t.mapProjection.ellipsoid.cartesianToCartographic(n.positionWC,n.positionCartographic),h.clone(s,n.directionWC),h.clone(a,n.upWC),h.clone(c,n.rightWC)}var bMt=[new h(-1,0,0),new h(0,-1,0),new h(0,0,-1),new h(1,0,0),new h(0,1,0),new h(0,0,1)],xMt=[new h(0,-1,0),new h(0,0,-1),new h(0,-1,0),new h(0,-1,0),new h(0,0,1),new h(0,-1,0)],TMt=[new h(0,0,1),new h(1,0,0),new h(-1,0,0),new h(0,0,-1),new h(1,0,0),new h(1,0,0)];function EMt(e,t){let n=new er;n.fov=P.PI_OVER_TWO,n.near=1,n.far=e._pointLightRadius,n.aspectRatio=1;for(let i=0;i<6;++i){let r=e._passes[i].camera;r.positionWC=e._shadowMapCamera.positionWC,r.positionCartographic=t.mapProjection.ellipsoid.cartesianToCartographic(r.positionWC,r.positionCartographic),r.directionWC=bMt[i],r.upWC=xMt[i],r.rightWC=TMt[i],M.computeView(r.positionWC,r.directionWC,r.upWC,r.rightWC,r.viewMatrix),M.inverse(r.viewMatrix,r.inverseViewMatrix),r.frustum=n}}var CMt=new h,vMt=new h,kOe=new ue,MOe=kOe.center;function SMt(e,t){let n=e._sceneCamera,i=e._shadowMapCamera,r=kOe;if(e._cascadesEnabled){if(n.frustum.near>=e.maximumDistance){e._outOfView=!0,e._needsUpdate=!1;return}let o=t.mapProjection.ellipsoid.geodeticSurfaceNormal(n.positionWC,CMt),s=h.negate(i.directionWC,vMt),a=h.dot(o,s);if(e.fadingEnabled){let c=P.clamp(a/.1,0,1);e._darkness=P.lerp(1,e.darkness,c)}else e._darkness=e.darkness;if(a<0){e._outOfView=!0,e._needsUpdate=!1;return}e._needsUpdate=!0,e._outOfView=!1}else if(e._isPointLight)r.center=i.positionWC,r.radius=e._pointLightRadius,e._outOfView=t.cullingVolume.computeVisibility(r)===$t.OUTSIDE,e._needsUpdate=!e._outOfView&&!e._boundingSphere.equals(r),ue.clone(r,e._boundingSphere);else{let o=i.frustum.far/2,s=h.add(i.positionWC,h.multiplyByScalar(i.directionWC,o,MOe),MOe);r.center=s,r.radius=o,e._outOfView=t.cullingVolume.computeVisibility(r)===$t.OUTSIDE,e._needsUpdate=!e._outOfView&&!e._boundingSphere.equals(r),ue.clone(r,e._boundingSphere)}}function wMt(e,t){let n=t.camera,i=e._lightCamera,r=e._sceneCamera,o=e._shadowMapCamera;e._cascadesEnabled?h.clone(i.directionWC,o.directionWC):e._isPointLight?h.clone(i.positionWC,o.positionWC):o.clone(i);let s=e._lightDirectionEC;M.multiplyByPointAsVector(n.viewMatrix,o.directionWC,s),h.normalize(s,s),h.negate(s,s),M.multiplyByPoint(n.viewMatrix,o.positionWC,e._lightPositionEC),e._lightPositionEC.w=e._pointLightRadius;let a,c;e._fitNearFar?(a=Math.min(t.shadowState.nearPlane,e.maximumDistance),c=Math.min(t.shadowState.farPlane,e.maximumDistance),c=Math.max(c,a+1)):(a=n.frustum.near,c=e.maximumDistance),e._sceneCamera=Nr.clone(n,r),n.frustum.clone(e._sceneCamera.frustum),e._sceneCamera.frustum.near=a,e._sceneCamera.frustum.far=c,e._distance=c-a,SMt(e,t),!e._outOfViewPrevious&&e._outOfView&&(e._needsUpdate=!0),e._outOfViewPrevious=e._outOfView}d0.prototype.update=function(e){if(wMt(this,e),this._needsUpdate)if(nMt(this,e.context),this._isPointLight&&EMt(this,e),this._cascadesEnabled&&(AMt(this,e),this._numberOfCascades>1&&pMt(this,e)),this._isPointLight)this._shadowMapCullingVolume=aa.fromBoundingSphere(this._boundingSphere);else{let t=this._shadowMapCamera,n=t.positionWC,i=t.directionWC,r=t.upWC;this._shadowMapCullingVolume=t.frustum.computeCullingVolume(n,i,r),this._passes.length===1&&this._passes[0].camera.clone(t)}if(this._passes.length===1){let t=this._sceneCamera.inverseViewMatrix;M.multiply(this._shadowMapCamera.getViewProjection(),t,this._shadowMapMatrix)}this.debugShow&&uMt(this,e)};d0.prototype.updatePass=function(e,t){LOe(this,e,t)};var IMt=new U;function UOe(e,t,n){let i=e._isPointLight?e._pointBias:n?e._terrainBias:e._primitiveBias,r={shadowMap_texture:function(){return e._shadowMapTexture},shadowMap_textureCube:function(){return e._shadowMapTexture},shadowMap_matrix:function(){return e._shadowMapMatrix},shadowMap_cascadeSplits:function(){return e._cascadeSplits},shadowMap_cascadeMatrices:function(){return e._cascadeMatrices},shadowMap_lightDirectionEC:function(){return e._lightDirectionEC},shadowMap_lightPositionEC:function(){return e._lightPositionEC},shadowMap_cascadeDistances:function(){return e._cascadeDistances},shadowMap_texelSizeDepthBiasAndNormalShadingSmooth:function(){let o=IMt;return o.x=1/e._textureSize.x,o.y=1/e._textureSize.y,se.fromElements(o.x,o.y,i.depthBias,i.normalShadingSmooth,this.combinedUniforms1)},shadowMap_normalOffsetScaleDistanceMaxDistanceAndDarkness:function(){return se.fromElements(i.normalOffsetScale,e._distance,e.maximumDistance,e._darkness,this.combinedUniforms2)},combinedUniforms1:new se,combinedUniforms2:new se};return Mt(t,r,!1)}function PMt(e,t,n,i,r,o){let s,a,c;if(l(o)&&(s=o.shaderProgram,a=o.renderState,c=o.uniformMap),o=at.shallowClone(n,o),o.castShadows=!0,o.receiveShadows=!1,!l(s)||r!==n.shaderProgram.id||t){let u=n.shaderProgram,f=n.pass===Ie.GLOBE,d=n.pass!==Ie.TRANSLUCENT,p=e._isPointLight,g=e._usesDepthTexture,m=u.vertexShaderSource,y=u.fragmentShaderSource,A=d&&f0.hasClippingForShadowCast(y),b=f0.getShadowCastShaderKeyword(p,f,g,d,A);if(s=i.shaderCache.getDerivedShaderProgram(u,b),!l(s)){let T=f0.createShadowCastVertexShader(m,p,f),E=f0.createShadowCastFragmentShader(y,p,g,d,A);s=i.shaderCache.createDerivedShaderProgram(u,b,{vertexShaderSource:T,fragmentShaderSource:E,attributeLocations:u._attributeLocations})}a=e._primitiveRenderState,p?a=e._pointRenderState:f&&(a=e._terrainRenderState),n.renderState.cull.enabled||(a=Ze(a,!1),a.cull=Ze(a.cull,!1),a.cull.enabled=!1,a=Ge.fromCache(a)),c=UOe(e,n.uniformMap,f)}return o.shaderProgram=s,o.renderState=a,o.uniformMap=c,o}d0.createReceiveDerivedCommand=function(e,t,n,i,r){l(r)||(r={});let o=e.length>0,s=t.shaderProgram,a=s.vertexShaderSource,c=s.fragmentShaderSource,u=t.pass===Ie.GLOBE,f=!1;if(u&&(f=t.owner.data.renderedMesh.encoding.hasVertexNormals),t.receiveShadows&&o){let d,p;l(r.receiveCommand)&&(d=r.receiveCommand.shaderProgram,p=r.receiveCommand.uniformMap),r.receiveCommand=at.shallowClone(t,r.receiveCommand),r.castShadows=!1,r.receiveShadows=!0;let g=r.receiveShaderCastShadows!==t.castShadows,m=r.receiveShaderProgramId!==t.shaderProgram.id;if(!l(d)||m||n||g){let y=f0.getShadowReceiveShaderKeyword(e[0],t.castShadows,u,f);if(d=i.shaderCache.getDerivedShaderProgram(s,y),!l(d)){let A=f0.createShadowReceiveVertexShader(a,u,f),b=f0.createShadowReceiveFragmentShader(c,e[0],t.castShadows,u,f);d=i.shaderCache.createDerivedShaderProgram(s,y,{vertexShaderSource:A,fragmentShaderSource:b,attributeLocations:s._attributeLocations})}p=UOe(e[0],t.uniformMap,u)}r.receiveCommand.shaderProgram=d,r.receiveCommand.uniformMap=p,r.receiveShaderProgramId=t.shaderProgram.id,r.receiveShaderCastShadows=t.castShadows}return r};d0.createCastDerivedCommand=function(e,t,n,i,r){if(l(r)||(r={}),t.castShadows){let o=r.castCommands;l(o)||(o=r.castCommands=[]);let s=r.castShaderProgramId,a=e.length;o.length=a;for(let c=0;c<a;++c)o[c]=PMt(e[c],n,t,i,s,o[c]);r.castShaderProgramId=t.shaderProgram.id}return r};d0.prototype.isDestroyed=function(){return!1};d0.prototype.destroy=function(){roe(this),this._debugLightFrustum=this._debugLightFrustum&&this._debugLightFrustum.destroy(),this._debugCameraFrustum=this._debugCameraFrustum&&this._debugCameraFrustum.destroy(),this._debugShadowViewCommand=this._debugShadowViewCommand&&this._debugShadowViewCommand.shaderProgram&&this._debugShadowViewCommand.shaderProgram.destroy();for(let e=0;e<this._numberOfCascades;++e)this._debugCascadeFrustums[e]=this._debugCascadeFrustums[e]&&this._debugCascadeFrustums[e].destroy();return le(this)};var GA=d0;var Yw=`uniform sampler2D colorTexture; +`;let i=t.createViewportQuadCommand(n,{uniformMap:{shadowMap_texture:function(){return e._shadowMapTexture},shadowMap_textureCube:function(){return e._shadowMapTexture}}});return i.pass=Ie.OVERLAY,i}function wSt(e,t){let n=t.context,i=t.context.drawingBufferWidth,r=t.context.drawingBufferHeight,o=Math.min(i,r)*.3,s=vSt;s.x=i-o,s.y=0,s.width=o,s.height=o;let a=e._debugShadowViewCommand;l(a)||(a=SSt(e,n),e._debugShadowViewCommand=a),(!l(a.renderState)||!et.equals(a.renderState.viewport,s))&&(a.renderState=Ge.fromCache({viewport:et.clone(s)})),t.commandList.push(e._debugShadowViewCommand)}var Jp=new Array(8);Jp[0]=new se(-1,-1,-1,1);Jp[1]=new se(1,-1,-1,1);Jp[2]=new se(1,1,-1,1);Jp[3]=new se(-1,1,-1,1);Jp[4]=new se(-1,-1,1,1);Jp[5]=new se(1,-1,1,1);Jp[6]=new se(1,1,1,1);Jp[7]=new se(-1,1,1,1);var bA=new M,Gte=new Array(8);for(let e=0;e<8;++e)Gte[e]=new se;function ISt(e,t){let n=new Bt({geometry:new cp({minimum:new h(-.5,-.5,-.5),maximum:new h(.5,.5,.5)}),attributes:{color:Jt.fromColor(t)}}),i=new Bt({geometry:new Qy({radius:.5}),attributes:{color:Jt.fromColor(t)}});return new Mn({geometryInstances:[n,i],appearance:new An({translucent:!1,flat:!0}),asynchronous:!1,modelMatrix:e})}var PSt=[z.RED,z.GREEN,z.BLUE,z.MAGENTA],DSt=new h;function RSt(e,t){wSt(e,t);let n=e.debugFreezeFrame&&!e._debugFreezeFrame;if(e._debugFreezeFrame=e.debugFreezeFrame,e.debugFreezeFrame&&(n&&(e._debugCameraFrustum=e._debugCameraFrustum&&e._debugCameraFrustum.destroy(),e._debugCameraFrustum=new jg({camera:e._sceneCamera,color:z.CYAN,updateOnChange:!1})),e._debugCameraFrustum.update(t)),e._cascadesEnabled){if(e.debugFreezeFrame){n&&(e._debugLightFrustum=e._debugLightFrustum&&e._debugLightFrustum.destroy(),e._debugLightFrustum=new jg({camera:e._shadowMapCamera,color:z.YELLOW,updateOnChange:!1})),e._debugLightFrustum.update(t);for(let i=0;i<e._numberOfCascades;++i)n&&(e._debugCascadeFrustums[i]=e._debugCascadeFrustums[i]&&e._debugCascadeFrustums[i].destroy(),e._debugCascadeFrustums[i]=new jg({camera:e._passes[i].camera,color:PSt[i],updateOnChange:!1})),e._debugCascadeFrustums[i].update(t)}}else if(e._isPointLight){if(!l(e._debugLightFrustum)||e._needsUpdate){let i=e._shadowMapCamera.positionWC,r=Le.IDENTITY,o=e._pointLightRadius*2,s=h.fromElements(o,o,o,DSt),a=M.fromTranslationQuaternionRotationScale(i,r,s,bA);e._debugLightFrustum=e._debugLightFrustum&&e._debugLightFrustum.destroy(),e._debugLightFrustum=ISt(a,z.YELLOW)}e._debugLightFrustum.update(t)}else(!l(e._debugLightFrustum)||e._needsUpdate)&&(e._debugLightFrustum=new jg({camera:e._shadowMapCamera,color:z.YELLOW,updateOnChange:!1})),e._debugLightFrustum.update(t)}function U6(){this.viewMatrix=new M,this.inverseViewMatrix=new M,this.frustum=void 0,this.positionCartographic=new he,this.positionWC=new h,this.directionWC=h.clone(h.UNIT_Z),this.upWC=h.clone(h.UNIT_Y),this.rightWC=h.clone(h.UNIT_X),this.viewProjectionMatrix=new M}U6.prototype.clone=function(e){M.clone(e.viewMatrix,this.viewMatrix),M.clone(e.inverseViewMatrix,this.inverseViewMatrix),this.frustum=e.frustum.clone(this.frustum),he.clone(e.positionCartographic,this.positionCartographic),h.clone(e.positionWC,this.positionWC),h.clone(e.directionWC,this.directionWC),h.clone(e.upWC,this.upWC),h.clone(e.rightWC,this.rightWC)};var OSt=new M(.5,0,0,.5,0,.5,0,.5,0,0,.5,.5,0,0,0,1);U6.prototype.getViewProjection=function(){let e=this.viewMatrix,t=this.frustum.projectionMatrix;return M.multiply(t,e,this.viewProjectionMatrix),M.multiply(OSt,this.viewProjectionMatrix,this.viewProjectionMatrix),this.viewProjectionMatrix};var MSt=new Array(5),NSt=new Ji,LSt=new Array(4),zwe=new h,Vwe=new h;function FSt(e,t){let n=e._shadowMapCamera,i=e._sceneCamera,r=i.frustum.near,o=i.frustum.far,s=e._numberOfCascades,a,c=o-r,u=o/r,f=.9,d=!1;t.shadowState.closestObjectSize<200&&(d=!0,f=.9);let p=LSt,g=MSt;for(g[0]=r,g[s]=o,a=0;a<s;++a){let L=(a+1)/s,_=r*Math.pow(u,L),C=r+c*L,w=P.lerp(C,_,f);g[a+1]=w,p[a]=w-g[a]}if(d){for(a=0;a<s;++a)p[a]=Math.min(p[a],e._maximumCascadeDistances[a]);let L=g[0];for(a=0;a<s-1;++a)L+=p[a],g[a+1]=L}se.unpack(g,0,e._cascadeSplits[0]),se.unpack(g,1,e._cascadeSplits[1]),se.unpack(p,0,e._cascadeDistances);let m=n.frustum,y=m.left,A=m.right,b=m.bottom,x=m.top,T=m.near,E=m.far,v=n.positionWC,S=n.directionWC,I=n.upWC,R=i.frustum.clone(NSt),O=n.getViewProjection();for(a=0;a<s;++a){R.near=g[a],R.far=g[a+1];let L=M.multiply(R.projectionMatrix,i.viewMatrix,bA),_=M.inverse(L,bA),C=M.multiply(O,_,bA),w=h.fromElements(Number.MAX_VALUE,Number.MAX_VALUE,Number.MAX_VALUE,zwe),D=h.fromElements(-Number.MAX_VALUE,-Number.MAX_VALUE,-Number.MAX_VALUE,Vwe);for(let j=0;j<8;++j){let k=se.clone(Jp[j],Gte[j]);M.multiplyByVector(C,k,k),h.divideByScalar(k,k.w,k),h.minimumByComponent(k,w,w),h.maximumByComponent(k,D,D)}w.x=Math.max(w.x,0),w.y=Math.max(w.y,0),w.z=0,D.x=Math.min(D.x,1),D.y=Math.min(D.y,1),D.z=Math.min(D.z,1);let N=e._passes[a],F=N.camera;F.clone(n);let V=F.frustum;V.left=y+w.x*(A-y),V.right=y+D.x*(A-y),V.bottom=b+w.y*(x-b),V.top=b+D.y*(x-b),V.near=T+w.z*(E-T),V.far=T+D.z*(E-T),N.cullingVolume=F.frustum.computeCullingVolume(v,S,I);let B=e._cascadeMatrices[a];M.multiply(F.getViewProjection(),i.inverseViewMatrix,B),M.multiply(N.textureOffsets,B,B)}}var BSt=new M,kSt=new h,USt=new h,Fwe=new h;function zSt(e,t){let n=e._shadowMapCamera,i=e._sceneCamera,r=M.multiply(i.frustum.projectionMatrix,i.viewMatrix,bA),o=M.inverse(r,bA),s=n.directionWC,a=i.directionWC;h.equalsEpsilon(s,a,P.EPSILON10)&&(a=i.upWC);let c=h.cross(s,a,kSt);a=h.cross(c,s,USt),h.normalize(a,a),h.normalize(c,c);let u=h.fromElements(0,0,0,Fwe),f=M.computeView(u,s,a,c,BSt),d=M.multiply(f,o,bA),p=h.fromElements(Number.MAX_VALUE,Number.MAX_VALUE,Number.MAX_VALUE,zwe),g=h.fromElements(-Number.MAX_VALUE,-Number.MAX_VALUE,-Number.MAX_VALUE,Vwe);for(let E=0;E<8;++E){let v=se.clone(Jp[E],Gte[E]);M.multiplyByVector(d,v,v),h.divideByScalar(v,v.w,v),h.minimumByComponent(v,p,p),h.maximumByComponent(v,g,g)}g.z+=1e3,p.z-=10;let m=Fwe;m.x=-(.5*(p.x+g.x)),m.y=-(.5*(p.y+g.y)),m.z=-g.z;let y=M.fromTranslation(m,bA);f=M.multiply(y,f,f);let A=.5*(g.x-p.x),b=.5*(g.y-p.y),x=g.z-p.z,T=n.frustum;T.left=-A,T.right=A,T.bottom=-b,T.top=b,T.near=.01,T.far=x,M.clone(f,n.viewMatrix),M.inverse(f,n.inverseViewMatrix),M.getTranslation(n.inverseViewMatrix,n.positionWC),t.mapProjection.ellipsoid.cartesianToCartographic(n.positionWC,n.positionCartographic),h.clone(s,n.directionWC),h.clone(a,n.upWC),h.clone(c,n.rightWC)}var VSt=[new h(-1,0,0),new h(0,-1,0),new h(0,0,-1),new h(1,0,0),new h(0,1,0),new h(0,0,1)],jSt=[new h(0,-1,0),new h(0,0,-1),new h(0,-1,0),new h(0,-1,0),new h(0,0,1),new h(0,-1,0)],HSt=[new h(0,0,1),new h(1,0,0),new h(-1,0,0),new h(0,0,-1),new h(1,0,0),new h(1,0,0)];function GSt(e,t){let n=new Ji;n.fov=P.PI_OVER_TWO,n.near=1,n.far=e._pointLightRadius,n.aspectRatio=1;for(let i=0;i<6;++i){let r=e._passes[i].camera;r.positionWC=e._shadowMapCamera.positionWC,r.positionCartographic=t.mapProjection.ellipsoid.cartesianToCartographic(r.positionWC,r.positionCartographic),r.directionWC=VSt[i],r.upWC=jSt[i],r.rightWC=HSt[i],M.computeView(r.positionWC,r.directionWC,r.upWC,r.rightWC,r.viewMatrix),M.inverse(r.viewMatrix,r.inverseViewMatrix),r.frustum=n}}var WSt=new h,qSt=new h,jwe=new ue,Bwe=jwe.center;function YSt(e,t){let n=e._sceneCamera,i=e._shadowMapCamera,r=jwe;if(e._cascadesEnabled){if(n.frustum.near>=e.maximumDistance){e._outOfView=!0,e._needsUpdate=!1;return}let o=t.mapProjection.ellipsoid.geodeticSurfaceNormal(n.positionWC,WSt),s=h.negate(i.directionWC,qSt),a=h.dot(o,s);if(e.fadingEnabled){let c=P.clamp(a/.1,0,1);e._darkness=P.lerp(1,e.darkness,c)}else e._darkness=e.darkness;if(a<0){e._outOfView=!0,e._needsUpdate=!1;return}e._needsUpdate=!0,e._outOfView=!1}else if(e._isPointLight)r.center=i.positionWC,r.radius=e._pointLightRadius,e._outOfView=t.cullingVolume.computeVisibility(r)===$t.OUTSIDE,e._needsUpdate=!e._outOfView&&!e._boundingSphere.equals(r),ue.clone(r,e._boundingSphere);else{let o=i.frustum.far/2,s=h.add(i.positionWC,h.multiplyByScalar(i.directionWC,o,Bwe),Bwe);r.center=s,r.radius=o,e._outOfView=t.cullingVolume.computeVisibility(r)===$t.OUTSIDE,e._needsUpdate=!e._outOfView&&!e._boundingSphere.equals(r),ue.clone(r,e._boundingSphere)}}function XSt(e,t){let n=t.camera,i=e._lightCamera,r=e._sceneCamera,o=e._shadowMapCamera;e._cascadesEnabled?h.clone(i.directionWC,o.directionWC):e._isPointLight?h.clone(i.positionWC,o.positionWC):o.clone(i);let s=e._lightDirectionEC;M.multiplyByPointAsVector(n.viewMatrix,o.directionWC,s),h.normalize(s,s),h.negate(s,s),M.multiplyByPoint(n.viewMatrix,o.positionWC,e._lightPositionEC),e._lightPositionEC.w=e._pointLightRadius;let a,c;e._fitNearFar?(a=Math.min(t.shadowState.nearPlane,e.maximumDistance),c=Math.min(t.shadowState.farPlane,e.maximumDistance),c=Math.max(c,a+1)):(a=n.frustum.near,c=e.maximumDistance),e._sceneCamera=Nr.clone(n,r),n.frustum.clone(e._sceneCamera.frustum),e._sceneCamera.frustum.near=a,e._sceneCamera.frustum.far=c,e._distance=c-a,YSt(e,t),!e._outOfViewPrevious&&e._outOfView&&(e._needsUpdate=!0),e._outOfViewPrevious=e._outOfView}$p.prototype.update=function(e){if(XSt(this,e),this._needsUpdate)if(ESt(this,e.context),this._isPointLight&&GSt(this,e),this._cascadesEnabled&&(zSt(this,e),this._numberOfCascades>1&&FSt(this,e)),this._isPointLight)this._shadowMapCullingVolume=aa.fromBoundingSphere(this._boundingSphere);else{let t=this._shadowMapCamera,n=t.positionWC,i=t.directionWC,r=t.upWC;this._shadowMapCullingVolume=t.frustum.computeCullingVolume(n,i,r),this._passes.length===1&&this._passes[0].camera.clone(t)}if(this._passes.length===1){let t=this._sceneCamera.inverseViewMatrix;M.multiply(this._shadowMapCamera.getViewProjection(),t,this._shadowMapMatrix)}this.debugShow&&RSt(this,e)};$p.prototype.updatePass=function(e,t){Uwe(this,e,t)};var KSt=new U;function Hwe(e,t,n){let i=e._isPointLight?e._pointBias:n?e._terrainBias:e._primitiveBias,r={shadowMap_texture:function(){return e._shadowMapTexture},shadowMap_textureCube:function(){return e._shadowMapTexture},shadowMap_matrix:function(){return e._shadowMapMatrix},shadowMap_cascadeSplits:function(){return e._cascadeSplits},shadowMap_cascadeMatrices:function(){return e._cascadeMatrices},shadowMap_lightDirectionEC:function(){return e._lightDirectionEC},shadowMap_lightPositionEC:function(){return e._lightPositionEC},shadowMap_cascadeDistances:function(){return e._cascadeDistances},shadowMap_texelSizeDepthBiasAndNormalShadingSmooth:function(){let o=KSt;return o.x=1/e._textureSize.x,o.y=1/e._textureSize.y,se.fromElements(o.x,o.y,i.depthBias,i.normalShadingSmooth,this.combinedUniforms1)},shadowMap_normalOffsetScaleDistanceMaxDistanceAndDarkness:function(){return se.fromElements(i.normalOffsetScale,e._distance,e.maximumDistance,e._darkness,this.combinedUniforms2)},combinedUniforms1:new se,combinedUniforms2:new se};return Mt(t,r,!1)}function $St(e,t,n,i,r,o){let s,a,c;if(l(o)&&(s=o.shaderProgram,a=o.renderState,c=o.uniformMap),o=at.shallowClone(n,o),o.castShadows=!0,o.receiveShadows=!1,!l(s)||r!==n.shaderProgram.id||t){let u=n.shaderProgram,f=n.pass===Ie.GLOBE,d=n.pass!==Ie.TRANSLUCENT,p=e._isPointLight,g=e._usesDepthTexture,m=u.vertexShaderSource,y=u.fragmentShaderSource,A=d&&Kp.hasClippingForShadowCast(y),b=Kp.getShadowCastShaderKeyword(p,f,g,d,A);if(s=i.shaderCache.getDerivedShaderProgram(u,b),!l(s)){let T=Kp.createShadowCastVertexShader(m,p,f),E=Kp.createShadowCastFragmentShader(y,p,g,d,A);s=i.shaderCache.createDerivedShaderProgram(u,b,{vertexShaderSource:T,fragmentShaderSource:E,attributeLocations:u._attributeLocations})}a=e._primitiveRenderState,p?a=e._pointRenderState:f&&(a=e._terrainRenderState),n.renderState.cull.enabled||(a=Ze(a,!1),a.cull=Ze(a.cull,!1),a.cull.enabled=!1,a=Ge.fromCache(a)),c=Hwe(e,n.uniformMap,f)}return o.shaderProgram=s,o.renderState=a,o.uniformMap=c,o}$p.createReceiveDerivedCommand=function(e,t,n,i,r){l(r)||(r={});let o=e.length>0,s=t.shaderProgram,a=s.vertexShaderSource,c=s.fragmentShaderSource,u=t.pass===Ie.GLOBE,f=!1;if(u&&(f=t.owner.data.renderedMesh.encoding.hasVertexNormals),t.receiveShadows&&o){let d,p;l(r.receiveCommand)&&(d=r.receiveCommand.shaderProgram,p=r.receiveCommand.uniformMap),r.receiveCommand=at.shallowClone(t,r.receiveCommand),r.castShadows=!1,r.receiveShadows=!0;let g=r.receiveShaderCastShadows!==t.castShadows,m=r.receiveShaderProgramId!==t.shaderProgram.id;if(!l(d)||m||n||g){let y=Kp.getShadowReceiveShaderKeyword(e[0],t.castShadows,u,f);if(d=i.shaderCache.getDerivedShaderProgram(s,y),!l(d)){let A=Kp.createShadowReceiveVertexShader(a,u,f),b=Kp.createShadowReceiveFragmentShader(c,e[0],t.castShadows,u,f);d=i.shaderCache.createDerivedShaderProgram(s,y,{vertexShaderSource:A,fragmentShaderSource:b,attributeLocations:s._attributeLocations})}p=Hwe(e[0],t.uniformMap,u)}r.receiveCommand.shaderProgram=d,r.receiveCommand.uniformMap=p,r.receiveShaderProgramId=t.shaderProgram.id,r.receiveShaderCastShadows=t.castShadows}return r};$p.createCastDerivedCommand=function(e,t,n,i,r){if(l(r)||(r={}),t.castShadows){let o=r.castCommands;l(o)||(o=r.castCommands=[]);let s=r.castShaderProgramId,a=e.length;o.length=a;for(let c=0;c<a;++c)o[c]=$St(e[c],n,t,i,s,o[c]);r.castShaderProgramId=t.shaderProgram.id}return r};$p.prototype.isDestroyed=function(){return!1};$p.prototype.destroy=function(){Hte(this),this._debugLightFrustum=this._debugLightFrustum&&this._debugLightFrustum.destroy(),this._debugCameraFrustum=this._debugCameraFrustum&&this._debugCameraFrustum.destroy(),this._debugShadowViewCommand=this._debugShadowViewCommand&&this._debugShadowViewCommand.shaderProgram&&this._debugShadowViewCommand.shaderProgram.destroy();for(let e=0;e<this._numberOfCascades;++e)this._debugCascadeFrustums[e]=this._debugCascadeFrustums[e]&&this._debugCascadeFrustums[e].destroy();return le(this)};var xA=$p;var tw=`uniform sampler2D colorTexture; #ifdef DEBUG_SHOW_DEPTH uniform sampler2D u_packedTranslucentDepth; #endif @@ -10572,7 +10572,7 @@ color.rgb /= color.a; out_FragColor = color; #endif } -`;var DMt=!1;function WA(e){this._drawClassificationFBO=new ci({createDepthAttachments:!1}),this._accumulationFBO=new ci({createDepthAttachments:!1}),this._packFBO=new ci,this._opaqueDepthStencilTexture=void 0,this._textureToComposite=void 0,this._translucentDepthStencilTexture=void 0,this._packDepthCommand=void 0,this._accumulateCommand=void 0,this._compositeCommand=void 0,this._copyCommand=void 0,this._clearColorCommand=new fi({color:new z(0,0,0,0),owner:this}),this._clearDepthStencilCommand=new fi({depth:1,stencil:0,owner:this}),this._supported=e.depthTexture,this._viewport=new et,this._rsDepth=void 0,this._rsAccumulate=void 0,this._rsComp=void 0,this._useScissorTest=void 0,this._scissorRectangle=void 0,this._hasTranslucentDepth=!1,this._frustumsDrawn=0}Object.defineProperties(WA.prototype,{hasTranslucentDepth:{get:function(){return this._hasTranslucentDepth}}});function zOe(e){e._textureToComposite=void 0,e._translucentDepthStencilTexture=e._translucentDepthStencilTexture&&!e._translucentDepthStencilTexture.isDestroyed()&&e._translucentDepthStencilTexture.destroy()}function VOe(e){e._drawClassificationFBO.destroy(),e._accumulationFBO.destroy(),e._packFBO.destroy()}function RMt(e,t,n,i){zOe(e),e._translucentDepthStencilTexture=new Dt({context:t,width:n,height:i,pixelFormat:$e.DEPTH_STENCIL,pixelDatatype:ze.UNSIGNED_INT_24_8,sampler:Ht.NEAREST})}function OMt(e,t,n,i){VOe(e),e._drawClassificationFBO.setDepthStencilTexture(e._translucentDepthStencilTexture),e._drawClassificationFBO.update(t,n,i),e._accumulationFBO.setDepthStencilTexture(e._translucentDepthStencilTexture),e._accumulationFBO.update(t,n,i),e._packFBO.update(t,n,i)}function MMt(e,t,n,i){if(!e.isSupported())return;e._opaqueDepthStencilTexture=i;let r=e._opaqueDepthStencilTexture.width,o=e._opaqueDepthStencilTexture.height;e._drawClassificationFBO.isDirty(r,o)&&(RMt(e,t,r,o),OMt(e,t,r,o));let s,a;if(l(e._packDepthCommand)||(s=new Xe({sources:[S2]}),a={u_opaqueDepthTexture:function(){return e._opaqueDepthStencilTexture},u_translucentDepthTexture:function(){return e._translucentDepthStencilTexture}},e._packDepthCommand=t.createViewportQuadCommand(s,{uniformMap:a,owner:e})),!l(e._compositeCommand)){s=new Xe({sources:[Yw]}),a={colorTexture:function(){return e._textureToComposite}},DMt&&(s.defines=["DEBUG_SHOW_DEPTH"],a.u_packedTranslucentDepth=function(){return e._packFBO.getColorTexture()}),e._compositeCommand=t.createViewportQuadCommand(s,{uniformMap:a,owner:e});let f=e._compositeCommand,d=f.shaderProgram,p=t.shaderCache.createDerivedShaderProgram(d,"pick",{vertexShaderSource:d.vertexShaderSource,fragmentShaderSource:new Xe({sources:s.sources,defines:["PICK"]}),attributeLocations:d._attributeLocations}),g=at.shallowClone(f);g.shaderProgram=p,f.derivedCommands.pick=g}l(e._copyCommand)||(s=new Xe({sources:[Yw]}),a={colorTexture:function(){return e._drawClassificationFBO.getColorTexture()}},e._copyCommand=t.createViewportQuadCommand(s,{uniformMap:a,owner:e})),l(e._accumulateCommand)||(s=new Xe({sources:[Yw]}),a={colorTexture:function(){return e._drawClassificationFBO.getColorTexture()}},e._accumulateCommand=t.createViewportQuadCommand(s,{uniformMap:a,owner:e})),e._viewport.width=r,e._viewport.height=o;let c=!et.equals(e._viewport,n.viewport),u=c!==e._useScissorTest;e._useScissorTest=c,et.equals(e._scissorRectangle,n.viewport)||(e._scissorRectangle=et.clone(n.viewport,e._scissorRectangle),u=!0),(!l(e._rsDepth)||!et.equals(e._viewport,e._rsDepth.viewport)||u)&&(e._rsDepth=Ge.fromCache({viewport:e._viewport,scissorTest:{enabled:e._useScissorTest,rectangle:e._scissorRectangle}})),l(e._packDepthCommand)&&(e._packDepthCommand.renderState=e._rsDepth),(!l(e._rsAccumulate)||!et.equals(e._viewport,e._rsAccumulate.viewport)||u)&&(e._rsAccumulate=Ge.fromCache({viewport:e._viewport,scissorTest:{enabled:e._useScissorTest,rectangle:e._scissorRectangle},stencilTest:{enabled:!0,frontFunction:ti.EQUAL,reference:Xt.CESIUM_3D_TILE_MASK}})),l(e._accumulateCommand)&&(e._accumulateCommand.renderState=e._rsAccumulate),(!l(e._rsComp)||!et.equals(e._viewport,e._rsComp.viewport)||u)&&(e._rsComp=Ge.fromCache({viewport:e._viewport,scissorTest:{enabled:e._useScissorTest,rectangle:e._scissorRectangle},blending:nn.ALPHA_BLEND})),l(e._compositeCommand)&&(e._compositeCommand.renderState=e._rsComp,e._compositeCommand.derivedCommands.pick.renderState=e._rsComp)}WA.prototype.executeTranslucentCommands=function(e,t,n,i,r){let o=e.frameState.useLogDepth,s=e.context,a=n.framebuffer;for(let c=0;c<i.length;++c){let u=i[c];if(u=o?u.derivedCommands.logDepth.command:u,u.depthForTranslucentClassification){this._hasTranslucentDepth=!0;break}}if(this._hasTranslucentDepth){MMt(this,s,n,r),n.framebuffer=this._drawClassificationFBO.framebuffer,this._clearDepthStencilCommand.execute(s,n);for(let c=0;c<i.length;++c){let u=i[c];if(u=o?u.derivedCommands.logDepth.command:u,!u.depthForTranslucentClassification)continue;let f=u.derivedCommands.depth.depthOnlyCommand;t(f,e,n)}this._frustumsDrawn+=this._hasTranslucentDepth?1:0,this._hasTranslucentDepth&&(n.framebuffer=this._packFBO.framebuffer,this._packDepthCommand.execute(s,n)),n.framebuffer=a}};WA.prototype.executeClassificationCommands=function(e,t,n,i){if(!this._hasTranslucentDepth)return;let r=e.context,o=r.uniformState,s=n.framebuffer;n.framebuffer=this._accumulationFBO.framebuffer,this._accumulateCommand.execute(r,n),n.framebuffer=this._drawClassificationFBO.framebuffer,this._frustumsDrawn>1&&this._clearColorCommand.execute(r,n),o.updatePass(Ie.CESIUM_3D_TILE_CLASSIFICATION);let a=o.globeDepthTexture;o.globeDepthTexture=this._packFBO.getColorTexture();let c=i.commands[Ie.CESIUM_3D_TILE_CLASSIFICATION],u=i.indices[Ie.CESIUM_3D_TILE_CLASSIFICATION];for(let f=0;f<u;++f)t(c[f],e,n);o.globeDepthTexture=a,n.framebuffer=s,this._frustumsDrawn!==1&&(n.framebuffer=this._accumulationFBO.framebuffer,this._accumulateCommand.execute(r,n),n.framebuffer=s)};WA.prototype.execute=function(e,t){if(!this._hasTranslucentDepth)return;this._frustumsDrawn===1?this._textureToComposite=this._drawClassificationFBO.getColorTexture():this._textureToComposite=this._accumulationFBO.getColorTexture(),(e.frameState.passes.pick?this._compositeCommand.derivedCommands.pick:this._compositeCommand).execute(e.context,t),NMt(this,e,t)};function NMt(e,t,n){if(!e._hasTranslucentDepth)return;let i=n.framebuffer;n.framebuffer=e._drawClassificationFBO.framebuffer,e._clearColorCommand.execute(t._context,n),n.framebuffer=i,e._frustumsDrawn>1&&(n.framebuffer=e._accumulationFBO.framebuffer,e._clearColorCommand.execute(t._context,n)),e._hasTranslucentDepth=!1,e._frustumsDrawn=0}WA.prototype.isSupported=function(){return this._supported};WA.prototype.isDestroyed=function(){return!1};WA.prototype.destroy=function(){return zOe(this),VOe(this),l(this._compositeCommand)&&(this._compositeCommand.shaderProgram=this._compositeCommand.shaderProgram&&this._compositeCommand.shaderProgram.destroy()),l(this._packDepthCommand)&&(this._packDepthCommand.shaderProgram=this._packDepthCommand.shaderProgram&&this._packDepthCommand.shaderProgram.destroy()),le(this)};var e5=WA;function LMt(){this.command=void 0,this.near=void 0,this.far=void 0}function t5(e,t,n){let i=e.context,r;i.depthTexture&&(r=new XG);let o;e._useOIT&&i.depthTexture&&(o=new $G(i));let s=new gc(i);s.viewport=et.clone(n),this.camera=t,this._cameraClone=Nr.clone(t),this._cameraStartFired=!1,this._cameraMovedTime=void 0,this.viewport=n,this.passState=s,this.pickFramebuffer=new ZG(i),this.snapFramebuffer=void 0,this.pickDepthFramebuffer=new JG,this.sceneFramebuffer=new qw,this.edgeFramebuffer=new WG,this.planarFillIdFramebuffer=new qG,this.globeDepth=r,this.globeTranslucencyFramebuffer=new KG,this.oit=o,this.translucentTileClassification=new e5(i),this.pickDepths=[],this.frustumCommandsList=[],this.debugFrustumStatistics=void 0,this._commandExtents=[]}var soe=new h,aoe=new h;function FMt(e,t,n){let i=Math.max(h.maximumComponent(h.abs(e.position,soe)),h.maximumComponent(h.abs(t.position,aoe))),r=1/Math.max(1,i);return h.multiplyByScalar(e.position,r,soe),h.multiplyByScalar(t.position,r,aoe),h.equalsEpsilon(soe,aoe,n)&&h.equalsEpsilon(e.direction,t.direction,n)&&h.equalsEpsilon(e.up,t.up,n)&&h.equalsEpsilon(e.right,t.right,n)&&M.equalsEpsilon(e.transform,t.transform,n)&&e.frustum.equalsEpsilon(t.frustum,n)}t5.prototype.checkForCameraUpdates=function(e){let t=this.camera,n=this._cameraClone;return FMt(t,n,P.EPSILON15)?(this._cameraStartFired&&xn()-this._cameraMovedTime>e.cameraEventWaitTime&&(t.moveEnd.raiseEvent(),this._cameraStartFired=!1),!1):(this._cameraStartFired||(t.moveStart.raiseEvent(),this._cameraStartFired=!0),this._cameraMovedTime=xn(),Nr.clone(t,n),!0)};function BMt(e,t,n,i){let{frameState:r}=t,{camera:o,useLogDepth:s}=r,a=s?t.logarithmicDepthFarToNearRatio:t.farToNearRatio,c=t.mode===re.SCENE2D,u=t.nearToFarDistance2D;i*=1+P.EPSILON2,n=Math.min(Math.max(n,o.frustum.near),o.frustum.far),i=Math.max(Math.min(i,o.frustum.far),n);let f;c?(i=Math.min(i,o.position.z+t.nearToFarDistance2D),n=Math.min(n,i),f=Math.ceil(Math.max(1,i-n)/t.nearToFarDistance2D)):f=Math.ceil(Math.log(i/n)/Math.log(a));let{frustumCommandsList:d}=e;d.length=f;for(let p=0;p<f;++p){let g,m;c?(g=Math.min(i-u,n+p*u),m=Math.min(i,g+u)):(g=Math.max(n,Math.pow(a,p)*n),m=Math.min(i,a*g)),l(d[p])?(d[p].near=g,d[p].far=m):d[p]=new YG(g,m)}}function kMt(e,t,n){let{command:i,near:r,far:o}=n;t.debugShowFrustums&&(i.debugOverlappingFrustums=0);let{frustumCommandsList:s}=e;for(let a=0;a<s.length;++a){let c=s[a];if(r>c.far)continue;if(o<c.near)break;let u=i.pass,f=c.indices[u]++;if(c.commands[u][f]=i,t.debugShowFrustums&&(i.debugOverlappingFrustums|=1<<a),i.executeInClosestFrustum)break}if(t.debugShowFrustums){let{debugFrustumStatistics:a}=e,{debugOverlappingFrustums:c}=i,u=a.commandsInFrustums;u[c]=l(u[c])?u[c]+1:1,++a.totalCommands}t.updateDerivedCommands(i)}var jOe=new aa,UMt=new Gs;t5.prototype.createPotentiallyVisibleSet=function(e){let{frameState:t}=e,{camera:n,commandList:i,shadowState:r}=t,{positionWC:o,directionWC:s,frustum:a}=n,c=e._computeCommandList,u=e._overlayCommandList;e.debugShowFrustums&&(this.debugFrustumStatistics={totalCommands:0,commandsInFrustums:{}});let f=this.frustumCommandsList;for(let O=0;O<f.length;++O)for(let L=0;L<Ie.NUMBER_OF_PASSES;++L)f[O].indices[L]=0;c.length=0,u.length=0;let d=this._commandExtents,p=d.length,g=0,m=+Number.MAX_VALUE,y=-Number.MAX_VALUE,{shadowsEnabled:A}=r,b=+Number.MAX_VALUE,x=-Number.MAX_VALUE,T=Number.MAX_VALUE,E=t.mode===re.SCENE3D?t.occluder:void 0,{cullingVolume:v}=t,S=jOe.planes;for(let O=0;O<5;++O)S[O]=v.planes[O];v=jOe;for(let O=0;O<i.length;++O){let L=i[O],{pass:_,boundingVolume:C}=L;if(_===Ie.COMPUTE)c.push(L);else if(_===Ie.OVERLAY)u.push(L);else{let w,D;if(l(C)){if(!e.isVisible(v,L,E))continue;let F=C.computePlaneDistances(o,s,UMt);if(w=F.start,D=F.stop,m=Math.min(m,w),y=Math.max(y,D),A&&L.receiveShadows&&w<GA.MAXIMUM_DISTANCE&&!(_===Ie.GLOBE&&w<-100&&D>100)){let V=D-w;_!==Ie.GLOBE&&w<100&&(T=Math.min(T,V)),b=Math.min(b,w),x=Math.max(x,D)}}else L instanceof fi?(w=a.near,D=a.far):(w=a.near,D=a.far,m=Math.min(m,w),y=Math.max(y,D));let N=d[g];l(N)||(N=d[g]=new LMt),N.command=L,N.near=w,N.far=D,g++}}A&&(b=Math.min(Math.max(b,a.near),a.far),x=Math.max(Math.min(x,a.far),b),r.nearPlane=b,r.farPlane=x,r.closestObjectSize=T),BMt(this,e,m,y);for(let O=0;O<g;O++)kMt(this,e,d[O]);if(g<p)for(let O=g;O<p;O++){let L=d[O];if(!l(L.command))break;L.command=void 0}for(let O=0;O<f.length;++O){let{commands:L,indices:_}=f[O];for(let C=0;C<L.length;++C){let w=L[C];for(let D=_[C];D<w.length&&l(w[D]);++D)w[D]=void 0}}let I=f.length,{frustumSplits:R}=t;R.length=I+1;for(let O=0;O<I;++O)R[O]=f[O].near,O===I-1&&(R[O+1]=f[O].far)};t5.prototype.destroy=function(){this.pickFramebuffer=this.pickFramebuffer&&this.pickFramebuffer.destroy(),this.snapFramebuffer=this.snapFramebuffer&&this.snapFramebuffer.destroy(),this.pickDepthFramebuffer=this.pickDepthFramebuffer&&this.pickDepthFramebuffer.destroy(),this.sceneFramebuffer=this.sceneFramebuffer&&this.sceneFramebuffer.destroy(),this.edgeFramebuffer=this.edgeFramebuffer&&this.edgeFramebuffer.destroy(),this.planarFillIdFramebuffer=this.planarFillIdFramebuffer&&this.planarFillIdFramebuffer.destroy(),this.globeDepth=this.globeDepth&&this.globeDepth.destroy(),this.oit=this.oit&&this.oit.destroy(),this.translucentTileClassification=this.translucentTileClassification&&this.translucentTileClassification.destroy(),this.globeTranslucencyFramebuffer=this.globeTranslucencyFramebuffer&&this.globeTranslucencyFramebuffer.destroy();let e=this.pickDepths;for(let t=0;t<e.length;++t)e[t].destroy()};var Xw=t5;var GOe=.1,zMt=new Am({pass:po.MOST_DETAILED_PRELOAD}),VMt=new Am({pass:po.MOST_DETAILED_PICK}),XO=new Am({pass:po.PICK});function xa(e){this._mostDetailedRayPicks=[],this.pickRenderStateCache={},this._pickPositionCache={},this._pickPositionCacheDirty=!1;let t=new et(0,0,1,1),n=new Nr(e);n.frustum=new _n({width:GOe,aspectRatio:1,near:.1}),this._pickOffscreenView=new Xw(e,n,t)}xa.prototype.update=function(){this._pickPositionCacheDirty=!0};xa.prototype.getPickDepth=function(e,t){let n=e.view.pickDepths,i=n[t];return l(i)||(i=new GG,n[t]=i),i};var jMt=new Ss,HMt=new h,n5=new h,GMt=new U,WMt=new M;function qMt(e,t,n,i,r){let o=e.camera,s=o.frustum,a=s.offCenterFrustum;l(a)&&(s=a);let c=2*(t.x-r.x)/r.width-1;c*=(s.right-s.left)*.5;let u=2*(r.height-t.y-r.y)/r.height-1;u*=(s.top-s.bottom)*.5;let f=M.clone(o.transform,WMt);o._setTransform(M.IDENTITY);let d=h.clone(o.position,HMt);h.multiplyByScalar(o.right,c,n5),h.add(n5,d,d),h.multiplyByScalar(o.up,u,n5),h.add(n5,d,d),o._setTransform(f),e.mode===re.SCENE2D&&h.fromElements(d.z,d.x,d.y,d);let p=s.getPixelDimensions(r.width,r.height,1,1,GMt),g=jMt;return g.right=p.x*.5,g.left=-g.right,g.top=p.y*.5,g.bottom=-g.top,g.near=s.near,g.far=s.far,g.computeCullingVolume(d,o.directionWC,o.upWC)}var YMt=new Wu,XMt=new U;function KMt(e,t,n,i,r){let o=e.camera,s=o.frustum,a=s.near,c=Math.tan(s.fovy*.5),u=s.aspectRatio*c,f=2*(t.x-r.x)/r.width-1,d=2*(r.height-t.y-r.y)/r.height-1,p=f*a*u,g=d*a*c,m=s.getPixelDimensions(r.width,r.height,1,1,XMt),y=m.x*n*.5,A=m.y*i*.5,b=YMt;return b.top=g+A,b.bottom=g-A,b.right=p+y,b.left=p-y,b.near=a,b.far=s.far,b.computeCullingVolume(o.positionWC,o.directionWC,o.upWC)}function i5(e,t,n,i,r){let o=e.camera.frustum;return o instanceof _n||o instanceof Ss?qMt(e,t,n,i,r):KMt(e,t,n,i,r)}var KO=new et(0,0,3,3),r5=new U,$O=new z(0,0,0,0);function coe(e,t,n,i,r){return r.width=n??3,r.height=i??r.width,r.x=t.x-(r.width-1)*.5,r.y=e-t.y-(r.height-1)*.5,r}function JO(e,t,n,i,r,o){let{context:s,frameState:a,defaultView:c}=e,{viewport:u,pickFramebuffer:f}=c,d=o?.framebuffer??f;e.view=c,u.x=0,u.y=0,u.width=s.drawingBufferWidth,u.height=s.drawingBufferHeight;let p=c.passState;p.viewport=et.clone(u,p.viewport);let g=pr.transformWindowToDrawingBuffer(e,t,r5);coe(s.drawingBufferHeight,g,i,r,n),e.jobScheduler.disableThisFrame(),e.updateFrameState(),a.cullingVolume=i5(e,g,n.width,n.height,u),a.invertClassification=!1,a.passes.pick=!0,a.passes.snap=o?.snap??!1,a.tilesetPassState=XO,s.uniformState.update(a),e.updateEnvironment(),p=d.begin(n,u),e.updateAndExecuteCommands(p,$O),e.resolveFramebuffers(p)}function ZO(e){let{context:t}=e;t.endFrame()}xa.prototype.pickAsync=async function(e,t,n,i,r=1){let{context:o,frameState:s,defaultView:a}=e,{pickFramebuffer:c}=a,u=KO;JO(e,t,u,n,i);let f;return o.webgl2?f=c.endAsync(u,s,r):(f=c.end(u,r),f=Promise.resolve(f),yt("picking-async-fallback","Fallback to synchronous picking because async operation requires WebGL2 context.")),ZO(e),f};xa.prototype.pick=function(e,t,n,i,r=1){let{defaultView:o}=e,{pickFramebuffer:s}=o,a=KO;JO(e,t,a,n,i);let c=s.end(a,r);return ZO(e),c};xa.prototype.pickVoxelCoordinate=function(e,t,n,i){let{context:r,frameState:o,defaultView:s}=e,{viewport:a,pickFramebuffer:c}=s;e.view=s,a.x=0,a.y=0,a.width=r.drawingBufferWidth,a.height=r.drawingBufferHeight;let u=s.passState;u.viewport=et.clone(a,u.viewport);let f=pr.transformWindowToDrawingBuffer(e,t,r5),d=coe(r.drawingBufferHeight,f,n,i,KO);e.jobScheduler.disableThisFrame(),e.updateFrameState(),o.cullingVolume=i5(e,f,d.width,d.height,a),o.invertClassification=!1,o.passes.pickVoxel=!0,o.tilesetPassState=XO,r.uniformState.update(o),e.updateEnvironment(),u=c.begin(d,a),e.updateAndExecuteCommands(u,$O),e.resolveFramebuffers(u);let p=c.readCenterPixel(d);return r.endFrame(),p};xa.prototype.pickMetadata=function(e,t,n){let{context:i,frameState:r,defaultView:o}=e,{viewport:s,pickFramebuffer:a}=o;e.view=o,s.x=0,s.y=0,s.width=i.drawingBufferWidth,s.height=i.drawingBufferHeight;let c=o.passState;c.viewport=et.clone(s,c.viewport);let u=pr.transformWindowToDrawingBuffer(e,t,r5),f=coe(i.drawingBufferHeight,u,1,1,KO);e.jobScheduler.disableThisFrame(),e.updateFrameState(),r.cullingVolume=i5(e,u,f.width,f.height,s),r.invertClassification=!1,r.passes.pick=!0,r.tilesetPassState=XO,r.pickingMetadata=!0,r.pickedMetadataInfo=n,i.uniformState.update(r),e.updateEnvironment(),c=a.begin(f,s),e.updateAndExecuteCommands(c,$O);let d=e._environmentState.useOIT;e._environmentState.useOIT=!1,e.resolveFramebuffers(c),e._environmentState.useOIT=d;let p=a.readCenterPixel(f);return i.endFrame(),r.pickingMetadata=!1,HG.decodeMetadataValues(n.classProperty,n.metadataProperty,p)};function $Mt(e,t){let{defaultView:n,context:i,frameState:r,environmentState:o}=e,{viewport:s,pickDepthFramebuffer:a}=n;e.view=n,s.x=0,s.y=0,s.width=i.drawingBufferWidth,s.height=i.drawingBufferHeight;let c=n.passState;c.viewport=et.clone(s,c.viewport),e.clearPasses(r.passes),r.passes.pick=!0,r.passes.depth=!0,r.cullingVolume=i5(e,t,1,1,s),r.tilesetPassState=XO,e.updateEnvironment(),o.renderTranslucentDepthForPick=!0,c=a.update(i,t,s),e.updateAndExecuteCommands(c,$O),e.resolveFramebuffers(c),i.endFrame()}var JMt=new er,ZMt=new Wu,QMt=new _n,eNt=new Ss;xa.prototype.pickPositionWorldCoordinates=function(e,t,n){if(!e.useDepthPicking)return;let i=t.toString();if(this._pickPositionCacheDirty)this._pickPositionCache={},this._pickPositionCacheDirty=!1;else if(this._pickPositionCache.hasOwnProperty(i))return h.clone(this._pickPositionCache[i],n);let{context:r,frameState:o,camera:s,defaultView:a}=e,{uniformState:c}=r;e.view=a;let u=pr.transformWindowToDrawingBuffer(e,t,r5);e.pickTranslucentDepth?$Mt(e,u):(e.updateFrameState(),c.update(o),e.updateEnvironment()),u.y=e.drawingBufferHeight-u.y;let f;l(s.frustum.fov)?f=s.frustum.clone(JMt):l(s.frustum.infiniteProjectionMatrix)?f=s.frustum.clone(ZMt):l(s.frustum.width)?f=s.frustum.clone(QMt):f=s.frustum.clone(eNt);let{frustumCommandsList:d}=a,p=d.length;for(let g=0;g<p;++g){let y=this.getPickDepth(e,g).getDepth(r,u.x,u.y);if(l(y)&&y>0&&y<1){let A=d[g],b;return e.mode===re.SCENE2D?(b=s.position.z,s.position.z=b-A.near+1,f.far=Math.max(1,A.far-A.near),f.near=1,c.update(o),c.updateFrustum(f)):(f.near=A.near*(g!==0?e.opaqueFrustumNearOffset:1),f.far=A.far,c.updateFrustum(f)),n=pr.drawingBufferToWorldCoordinates(e,u,y,n),e.mode===re.SCENE2D&&(s.position.z=b,c.update(o)),this._pickPositionCache[i]=h.clone(n),n}}this._pickPositionCache[i]=void 0};var tNt=new he;xa.prototype.pickPosition=function(e,t,n){if(n=this.pickPositionWorldCoordinates(e,t,n),l(n)&&e.mode!==re.SCENE3D){h.fromElements(n.y,n.z,n.x,n);let i=e.mapProjection,r=i.ellipsoid,o=i.unproject(n,tNt);r.cartographicToCartesian(o,n)}return n};function nNt(e,t,n,i,r,o){for(let s of e){let a=s.object,c=s.position,u=s.exclude;if(l(c)&&!l(a))return n.push(s),!0;if(!l(a)||!l(a.primitive)||!u&&(n.push(s),n.length>=t))return!0;let f=a.primitive,d=!1;if(typeof f.getGeometryInstanceAttributes=="function"&&l(a.id)){let p=f.getGeometryInstanceAttributes(a.id);l(p)&&l(p.show)&&(d=!0,p.show=Pn.toValue(!1,p.show),r.push(p))}a instanceof ua&&(d=!0,a.show=!1,o.push(a)),d||(f.show=!1,i.push(f))}}function WOe(e,t){let n=[],i=[],r=[],o=[];l(t)||(t=Number.MAX_VALUE);let s=e(t);for(;l(s)&&s.length>0&&!nNt(s,t,n,i,r,o);)s=e(t-n.length);for(let a=0;a<i.length;++a)i[a].show=!0;for(let a=0;a<r.length;++a){let c=r[a];c.show=Pn.toValue(!0,c.show)}for(let a=0;a<o.length;++a)o[a].show=!0;return n}xa.prototype.drillPick=function(e,t,n,i,r){return WOe(a=>this.pick(e,t,i,r,a).map(u=>({object:u,position:void 0,exclude:!1})),n).map(a=>a.object)};var HOe=new h,iNt=new h;function rNt(e,t,n){this.ray=e,this.width=t,this.tilesets=n,this.ready=!1;let i=this;this.promise=new Promise(r=>{i._completePick=()=>{r()}})}function qOe(e,t,n,i){let r=t.direction,o=h.mostOrthogonalAxis(r,HOe),s=h.cross(r,o,HOe),a=h.cross(r,s,iNt);return i.position=t.origin,i.direction=r,i.up=a,i.right=s,i.frustum.width=n??GOe,i.frustum.computeCullingVolume(i.positionWC,i.directionWC,i.upWC)}function oNt(e,t,n){let i=t.frameState,{ray:r,width:o,tilesets:s}=n,a=e._pickOffscreenView.camera,c=qOe(e,r,o,a),u=zMt;u.camera=a,u.cullingVolume=c;let f=!0,d=s.length;for(let p=0;p<d;++p){let g=s[p];g.show&&t.primitives.contains(g)&&(g.updateForPass(i,u),f=f&&u.ready)}return f&&n._completePick(),f}xa.prototype.updateMostDetailedRayPicks=function(e){let t=this._mostDetailedRayPicks;for(let n=0;n<t.length;++n)oNt(this,e,t[n])&&t.splice(n--,1)};function YOe(e,t,n){for(let i=0;i<e.length;++i){let r=e.get(i);r.show&&(l(r.isCesium3DTileset)?(!l(t)||t.indexOf(r)===-1)&&n.push(r):r instanceof ql&&YOe(r,t,n))}}function o5(e,t,n,i,r,o){let s=[];if(YOe(t.primitives,i,s),s.length===0)return Promise.resolve(o());let a=new rNt(n,r,s);return e._mostDetailedRayPicks.push(a),a.promise.then(function(){return o()})}function sNt(e,t){return!l(e)||!l(t)||t.length===0?!1:t.indexOf(e)>-1||t.indexOf(e.primitive)>-1||t.indexOf(e.id)>-1}function aNt(e,t,n,i,r,o,s){let{context:a,frameState:c}=t,u=a.uniformState,f=e._pickOffscreenView;t.view=f,qOe(e,n,r,f.camera);let d=et.clone(f.viewport,KO),p=f.pickFramebuffer.begin(d,f.viewport);t.jobScheduler.disableThisFrame(),t.updateFrameState(),c.invertClassification=!1,c.passes.pick=!0,c.passes.offscreen=!0,s?c.tilesetPassState=VMt:c.tilesetPassState=XO,u.update(c),t.updateEnvironment(),t.updateAndExecuteCommands(p,$O),t.resolveFramebuffers(p);let g,m=f.pickFramebuffer.end(d,1)[0];if(t.context.depthTexture){let{frustumCommandsList:y}=f,A=y.length;for(let b=0;b<A;++b){let T=e.getPickDepth(t,b).getDepth(a,0,0);if(l(T)&&T>0&&T<1){let E=y[b],v=E.near*(b!==0?t.opaqueFrustumNearOffset:1),S=E.far,I=v+T*(S-v);g=gn.getPoint(n,I);break}}}if(t.view=t.defaultView,a.endFrame(),l(m)||l(g))return{object:m,position:g,exclude:!l(g)&&o||sNt(m,i)}}function loe(e,t,n,i,r,o,s,a){return WOe(function(){let u=aNt(e,t,n,r,o,s,a);return u?[u]:void 0},i)}function Kw(e,t,n,i,r,o,s){let a=loe(e,t,n,1,i,r,o,s);if(a.length>0)return a[0]}function s5(e,t){return new Promise((n,i)=>{t.then(function(r){let o=e.postRender.addEventListener(function(){o(),n(r)});e.requestRender()}).catch(function(r){i(r)})})}xa.prototype.pickFromRay=function(e,t,n,i){return Kw(this,e,t,n,i,!1,!1)};xa.prototype.drillPickFromRay=function(e,t,n,i,r){return loe(this,e,t,n,i,r,!1,!1)};xa.prototype.pickFromRayMostDetailed=function(e,t,n,i){let r=this;return t=gn.clone(t),n=l(n)?n.slice():n,s5(e,o5(r,e,t,n,i,function(){return Kw(r,e,t,n,i,!1,!0)}))};xa.prototype.drillPickFromRayMostDetailed=function(e,t,n,i,r){let o=this;return t=gn.clone(t),i=l(i)?i.slice():i,s5(e,o5(o,e,t,i,r,function(){return loe(o,e,t,n,i,r,!1,!0)}))};var cNt=new h,lNt=new h,uNt=new gn,XOe=new he;function uoe(e,t){let n=e.ellipsoid,i=Ni._defaultMaxTerrainHeight,r=n.geodeticSurfaceNormalCartographic(t,lNt),o=he.toCartesian(t,n,cNt),s=uNt;s.origin=o,s.direction=r;let a=new gn;return gn.getPoint(s,i,a.origin),h.negate(r,a.direction),a}function KOe(e,t){let n=e.ellipsoid,i=he.fromCartesian(t,n,XOe);return uoe(e,i)}function $Oe(e,t){let n=e.ellipsoid;return he.fromCartesian(t,n,XOe).height}function fNt(e,t,n,i,r){let o=uoe(t,n);return o5(e,t,o,i,r,function(){let s=Kw(e,t,o,i,r,!0,!0);if(l(s))return $Oe(t,s.position)})}function dNt(e,t,n,i,r,o){let s=KOe(t,n);return o5(e,t,s,i,r,function(){let a=Kw(e,t,s,i,r,!0,!0);if(l(a))return h.clone(a.position,o)})}xa.prototype.sampleHeight=function(e,t,n,i){let r=uoe(e,t),o=Kw(this,e,r,n,i,!0,!1);if(l(o))return $Oe(e,o.position)};xa.prototype.clampToHeight=function(e,t,n,i,r){let o=KOe(e,t),s=Kw(this,e,o,n,i,!0,!1);if(l(s))return h.clone(s.position,r)};xa.prototype.sampleHeightMostDetailed=function(e,t,n,i){n=l(n)?n.slice():n;let r=t.length,o=new Array(r);for(let s=0;s<r;++s)o[s]=fNt(this,e,t[s],n,i);return s5(e,Promise.all(o).then(function(s){let a=s.length;for(let c=0;c<a;++c)t[c].height=s[c];return t}))};xa.prototype.clampToHeightMostDetailed=function(e,t,n,i){n=l(n)?n.slice():n;let r=t.length,o=new Array(r);for(let s=0;s<r;++s)o[s]=dNt(this,e,t[s],n,i,t[s]);return s5(e,Promise.all(o).then(function(s){let a=s.length;for(let c=0;c<a;++c)t[c]=s[c];return t}))};xa.prototype.destroy=function(){this._pickOffscreenView=this._pickOffscreenView&&this._pickOffscreenView.destroy()};var a5=xa;var c5=`uniform sampler2D colorTexture; +`;var JSt=!1;function TA(e){this._drawClassificationFBO=new ci({createDepthAttachments:!1}),this._accumulationFBO=new ci({createDepthAttachments:!1}),this._packFBO=new ci,this._opaqueDepthStencilTexture=void 0,this._textureToComposite=void 0,this._translucentDepthStencilTexture=void 0,this._packDepthCommand=void 0,this._accumulateCommand=void 0,this._compositeCommand=void 0,this._copyCommand=void 0,this._clearColorCommand=new fi({color:new z(0,0,0,0),owner:this}),this._clearDepthStencilCommand=new fi({depth:1,stencil:0,owner:this}),this._supported=e.depthTexture,this._viewport=new et,this._rsDepth=void 0,this._rsAccumulate=void 0,this._rsComp=void 0,this._useScissorTest=void 0,this._scissorRectangle=void 0,this._hasTranslucentDepth=!1,this._frustumsDrawn=0}Object.defineProperties(TA.prototype,{hasTranslucentDepth:{get:function(){return this._hasTranslucentDepth}}});function Gwe(e){e._textureToComposite=void 0,e._translucentDepthStencilTexture=e._translucentDepthStencilTexture&&!e._translucentDepthStencilTexture.isDestroyed()&&e._translucentDepthStencilTexture.destroy()}function Wwe(e){e._drawClassificationFBO.destroy(),e._accumulationFBO.destroy(),e._packFBO.destroy()}function ZSt(e,t,n,i){Gwe(e),e._translucentDepthStencilTexture=new Dt({context:t,width:n,height:i,pixelFormat:$e.DEPTH_STENCIL,pixelDatatype:ze.UNSIGNED_INT_24_8,sampler:Ht.NEAREST})}function QSt(e,t,n,i){Wwe(e),e._drawClassificationFBO.setDepthStencilTexture(e._translucentDepthStencilTexture),e._drawClassificationFBO.update(t,n,i),e._accumulationFBO.setDepthStencilTexture(e._translucentDepthStencilTexture),e._accumulationFBO.update(t,n,i),e._packFBO.update(t,n,i)}function ewt(e,t,n,i){if(!e.isSupported())return;e._opaqueDepthStencilTexture=i;let r=e._opaqueDepthStencilTexture.width,o=e._opaqueDepthStencilTexture.height;e._drawClassificationFBO.isDirty(r,o)&&(ZSt(e,t,r,o),QSt(e,t,r,o));let s,a;if(l(e._packDepthCommand)||(s=new Xe({sources:[S2]}),a={u_opaqueDepthTexture:function(){return e._opaqueDepthStencilTexture},u_translucentDepthTexture:function(){return e._translucentDepthStencilTexture}},e._packDepthCommand=t.createViewportQuadCommand(s,{uniformMap:a,owner:e})),!l(e._compositeCommand)){s=new Xe({sources:[tw]}),a={colorTexture:function(){return e._textureToComposite}},JSt&&(s.defines=["DEBUG_SHOW_DEPTH"],a.u_packedTranslucentDepth=function(){return e._packFBO.getColorTexture()}),e._compositeCommand=t.createViewportQuadCommand(s,{uniformMap:a,owner:e});let f=e._compositeCommand,d=f.shaderProgram,p=t.shaderCache.createDerivedShaderProgram(d,"pick",{vertexShaderSource:d.vertexShaderSource,fragmentShaderSource:new Xe({sources:s.sources,defines:["PICK"]}),attributeLocations:d._attributeLocations}),g=at.shallowClone(f);g.shaderProgram=p,f.derivedCommands.pick=g}l(e._copyCommand)||(s=new Xe({sources:[tw]}),a={colorTexture:function(){return e._drawClassificationFBO.getColorTexture()}},e._copyCommand=t.createViewportQuadCommand(s,{uniformMap:a,owner:e})),l(e._accumulateCommand)||(s=new Xe({sources:[tw]}),a={colorTexture:function(){return e._drawClassificationFBO.getColorTexture()}},e._accumulateCommand=t.createViewportQuadCommand(s,{uniformMap:a,owner:e})),e._viewport.width=r,e._viewport.height=o;let c=!et.equals(e._viewport,n.viewport),u=c!==e._useScissorTest;e._useScissorTest=c,et.equals(e._scissorRectangle,n.viewport)||(e._scissorRectangle=et.clone(n.viewport,e._scissorRectangle),u=!0),(!l(e._rsDepth)||!et.equals(e._viewport,e._rsDepth.viewport)||u)&&(e._rsDepth=Ge.fromCache({viewport:e._viewport,scissorTest:{enabled:e._useScissorTest,rectangle:e._scissorRectangle}})),l(e._packDepthCommand)&&(e._packDepthCommand.renderState=e._rsDepth),(!l(e._rsAccumulate)||!et.equals(e._viewport,e._rsAccumulate.viewport)||u)&&(e._rsAccumulate=Ge.fromCache({viewport:e._viewport,scissorTest:{enabled:e._useScissorTest,rectangle:e._scissorRectangle},stencilTest:{enabled:!0,frontFunction:ei.EQUAL,reference:Xt.CESIUM_3D_TILE_MASK}})),l(e._accumulateCommand)&&(e._accumulateCommand.renderState=e._rsAccumulate),(!l(e._rsComp)||!et.equals(e._viewport,e._rsComp.viewport)||u)&&(e._rsComp=Ge.fromCache({viewport:e._viewport,scissorTest:{enabled:e._useScissorTest,rectangle:e._scissorRectangle},blending:nn.ALPHA_BLEND})),l(e._compositeCommand)&&(e._compositeCommand.renderState=e._rsComp,e._compositeCommand.derivedCommands.pick.renderState=e._rsComp)}TA.prototype.executeTranslucentCommands=function(e,t,n,i,r){let o=e.frameState.useLogDepth,s=e.context,a=n.framebuffer;for(let c=0;c<i.length;++c){let u=i[c];if(u=o?u.derivedCommands.logDepth.command:u,u.depthForTranslucentClassification){this._hasTranslucentDepth=!0;break}}if(this._hasTranslucentDepth){ewt(this,s,n,r),n.framebuffer=this._drawClassificationFBO.framebuffer,this._clearDepthStencilCommand.execute(s,n);for(let c=0;c<i.length;++c){let u=i[c];if(u=o?u.derivedCommands.logDepth.command:u,!u.depthForTranslucentClassification)continue;let f=u.derivedCommands.depth.depthOnlyCommand;t(f,e,n)}this._frustumsDrawn+=this._hasTranslucentDepth?1:0,this._hasTranslucentDepth&&(n.framebuffer=this._packFBO.framebuffer,this._packDepthCommand.execute(s,n)),n.framebuffer=a}};TA.prototype.executeClassificationCommands=function(e,t,n,i){if(!this._hasTranslucentDepth)return;let r=e.context,o=r.uniformState,s=n.framebuffer;n.framebuffer=this._accumulationFBO.framebuffer,this._accumulateCommand.execute(r,n),n.framebuffer=this._drawClassificationFBO.framebuffer,this._frustumsDrawn>1&&this._clearColorCommand.execute(r,n),o.updatePass(Ie.CESIUM_3D_TILE_CLASSIFICATION);let a=o.globeDepthTexture;o.globeDepthTexture=this._packFBO.getColorTexture();let c=i.commands[Ie.CESIUM_3D_TILE_CLASSIFICATION],u=i.indices[Ie.CESIUM_3D_TILE_CLASSIFICATION];for(let f=0;f<u;++f)t(c[f],e,n);o.globeDepthTexture=a,n.framebuffer=s,this._frustumsDrawn!==1&&(n.framebuffer=this._accumulationFBO.framebuffer,this._accumulateCommand.execute(r,n),n.framebuffer=s)};TA.prototype.execute=function(e,t){if(!this._hasTranslucentDepth)return;this._frustumsDrawn===1?this._textureToComposite=this._drawClassificationFBO.getColorTexture():this._textureToComposite=this._accumulationFBO.getColorTexture(),(e.frameState.passes.pick?this._compositeCommand.derivedCommands.pick:this._compositeCommand).execute(e.context,t),twt(this,e,t)};function twt(e,t,n){if(!e._hasTranslucentDepth)return;let i=n.framebuffer;n.framebuffer=e._drawClassificationFBO.framebuffer,e._clearColorCommand.execute(t._context,n),n.framebuffer=i,e._frustumsDrawn>1&&(n.framebuffer=e._accumulationFBO.framebuffer,e._clearColorCommand.execute(t._context,n)),e._hasTranslucentDepth=!1,e._frustumsDrawn=0}TA.prototype.isSupported=function(){return this._supported};TA.prototype.isDestroyed=function(){return!1};TA.prototype.destroy=function(){return Gwe(this),Wwe(this),l(this._compositeCommand)&&(this._compositeCommand.shaderProgram=this._compositeCommand.shaderProgram&&this._compositeCommand.shaderProgram.destroy()),l(this._packDepthCommand)&&(this._packDepthCommand.shaderProgram=this._packDepthCommand.shaderProgram&&this._packDepthCommand.shaderProgram.destroy()),le(this)};var z6=TA;function nwt(){this.command=void 0,this.near=void 0,this.far=void 0}function V6(e,t,n){let i=e.context,r;i.depthTexture&&(r=new N6);let o;e._useOIT&&i.depthTexture&&(o=new F6(i));let s=new gc(i);s.viewport=et.clone(n),this.camera=t,this._cameraClone=Nr.clone(t),this._cameraStartFired=!1,this._cameraMovedTime=void 0,this.viewport=n,this.passState=s,this.pickFramebuffer=new k6(i),this.snapFramebuffer=void 0,this.pickDepthFramebuffer=new B6,this.sceneFramebuffer=new ew,this.edgeFramebuffer=new R6,this.planarFillIdFramebuffer=new O6,this.globeDepth=r,this.globeTranslucencyFramebuffer=new L6,this.oit=o,this.translucentTileClassification=new z6(i),this.pickDepths=[],this.frustumCommandsList=[],this.debugFrustumStatistics=void 0,this._commandExtents=[]}var Wte=new h,qte=new h;function iwt(e,t,n){let i=Math.max(h.maximumComponent(h.abs(e.position,Wte)),h.maximumComponent(h.abs(t.position,qte))),r=1/Math.max(1,i);return h.multiplyByScalar(e.position,r,Wte),h.multiplyByScalar(t.position,r,qte),h.equalsEpsilon(Wte,qte,n)&&h.equalsEpsilon(e.direction,t.direction,n)&&h.equalsEpsilon(e.up,t.up,n)&&h.equalsEpsilon(e.right,t.right,n)&&M.equalsEpsilon(e.transform,t.transform,n)&&e.frustum.equalsEpsilon(t.frustum,n)}V6.prototype.checkForCameraUpdates=function(e){let t=this.camera,n=this._cameraClone;return iwt(t,n,P.EPSILON15)?(this._cameraStartFired&&xn()-this._cameraMovedTime>e.cameraEventWaitTime&&(t.moveEnd.raiseEvent(),this._cameraStartFired=!1),!1):(this._cameraStartFired||(t.moveStart.raiseEvent(),this._cameraStartFired=!0),this._cameraMovedTime=xn(),Nr.clone(t,n),!0)};function rwt(e,t,n,i){let{frameState:r}=t,{camera:o,useLogDepth:s}=r,a=s?t.logarithmicDepthFarToNearRatio:t.farToNearRatio,c=t.mode===re.SCENE2D,u=t.nearToFarDistance2D;i*=1+P.EPSILON2,n=Math.min(Math.max(n,o.frustum.near),o.frustum.far),i=Math.max(Math.min(i,o.frustum.far),n);let f;c?(i=Math.min(i,o.position.z+t.nearToFarDistance2D),n=Math.min(n,i),f=Math.ceil(Math.max(1,i-n)/t.nearToFarDistance2D)):f=Math.ceil(Math.log(i/n)/Math.log(a));let{frustumCommandsList:d}=e;d.length=f;for(let p=0;p<f;++p){let g,m;c?(g=Math.min(i-u,n+p*u),m=Math.min(i,g+u)):(g=Math.max(n,Math.pow(a,p)*n),m=Math.min(i,a*g)),l(d[p])?(d[p].near=g,d[p].far=m):d[p]=new M6(g,m)}}function owt(e,t,n){let{command:i,near:r,far:o}=n;t.debugShowFrustums&&(i.debugOverlappingFrustums=0);let{frustumCommandsList:s}=e;for(let a=0;a<s.length;++a){let c=s[a];if(r>c.far)continue;if(o<c.near)break;let u=i.pass,f=c.indices[u]++;if(c.commands[u][f]=i,t.debugShowFrustums&&(i.debugOverlappingFrustums|=1<<a),i.executeInClosestFrustum)break}if(t.debugShowFrustums){let{debugFrustumStatistics:a}=e,{debugOverlappingFrustums:c}=i,u=a.commandsInFrustums;u[c]=l(u[c])?u[c]+1:1,++a.totalCommands}t.updateDerivedCommands(i)}var qwe=new aa,swt=new Gs;V6.prototype.createPotentiallyVisibleSet=function(e){let{frameState:t}=e,{camera:n,commandList:i,shadowState:r}=t,{positionWC:o,directionWC:s,frustum:a}=n,c=e._computeCommandList,u=e._overlayCommandList;e.debugShowFrustums&&(this.debugFrustumStatistics={totalCommands:0,commandsInFrustums:{}});let f=this.frustumCommandsList;for(let O=0;O<f.length;++O)for(let L=0;L<Ie.NUMBER_OF_PASSES;++L)f[O].indices[L]=0;c.length=0,u.length=0;let d=this._commandExtents,p=d.length,g=0,m=+Number.MAX_VALUE,y=-Number.MAX_VALUE,{shadowsEnabled:A}=r,b=+Number.MAX_VALUE,x=-Number.MAX_VALUE,T=Number.MAX_VALUE,E=t.mode===re.SCENE3D?t.occluder:void 0,{cullingVolume:v}=t,S=qwe.planes;for(let O=0;O<5;++O)S[O]=v.planes[O];v=qwe;for(let O=0;O<i.length;++O){let L=i[O],{pass:_,boundingVolume:C}=L;if(_===Ie.COMPUTE)c.push(L);else if(_===Ie.OVERLAY)u.push(L);else{let w,D;if(l(C)){if(!e.isVisible(v,L,E))continue;let F=C.computePlaneDistances(o,s,swt);if(w=F.start,D=F.stop,m=Math.min(m,w),y=Math.max(y,D),A&&L.receiveShadows&&w<xA.MAXIMUM_DISTANCE&&!(_===Ie.GLOBE&&w<-100&&D>100)){let V=D-w;_!==Ie.GLOBE&&w<100&&(T=Math.min(T,V)),b=Math.min(b,w),x=Math.max(x,D)}}else L instanceof fi?(w=a.near,D=a.far):(w=a.near,D=a.far,m=Math.min(m,w),y=Math.max(y,D));let N=d[g];l(N)||(N=d[g]=new nwt),N.command=L,N.near=w,N.far=D,g++}}A&&(b=Math.min(Math.max(b,a.near),a.far),x=Math.max(Math.min(x,a.far),b),r.nearPlane=b,r.farPlane=x,r.closestObjectSize=T),rwt(this,e,m,y);for(let O=0;O<g;O++)owt(this,e,d[O]);if(g<p)for(let O=g;O<p;O++){let L=d[O];if(!l(L.command))break;L.command=void 0}for(let O=0;O<f.length;++O){let{commands:L,indices:_}=f[O];for(let C=0;C<L.length;++C){let w=L[C];for(let D=_[C];D<w.length&&l(w[D]);++D)w[D]=void 0}}let I=f.length,{frustumSplits:R}=t;R.length=I+1;for(let O=0;O<I;++O)R[O]=f[O].near,O===I-1&&(R[O+1]=f[O].far)};V6.prototype.destroy=function(){this.pickFramebuffer=this.pickFramebuffer&&this.pickFramebuffer.destroy(),this.snapFramebuffer=this.snapFramebuffer&&this.snapFramebuffer.destroy(),this.pickDepthFramebuffer=this.pickDepthFramebuffer&&this.pickDepthFramebuffer.destroy(),this.sceneFramebuffer=this.sceneFramebuffer&&this.sceneFramebuffer.destroy(),this.edgeFramebuffer=this.edgeFramebuffer&&this.edgeFramebuffer.destroy(),this.planarFillIdFramebuffer=this.planarFillIdFramebuffer&&this.planarFillIdFramebuffer.destroy(),this.globeDepth=this.globeDepth&&this.globeDepth.destroy(),this.oit=this.oit&&this.oit.destroy(),this.translucentTileClassification=this.translucentTileClassification&&this.translucentTileClassification.destroy(),this.globeTranslucencyFramebuffer=this.globeTranslucencyFramebuffer&&this.globeTranslucencyFramebuffer.destroy();let e=this.pickDepths;for(let t=0;t<e.length;++t)e[t].destroy()};var nw=V6;var Xwe=.1,awt=new lm({pass:po.MOST_DETAILED_PRELOAD}),cwt=new lm({pass:po.MOST_DETAILED_PICK}),zR=new lm({pass:po.PICK});function ba(e){this._mostDetailedRayPicks=[],this.pickRenderStateCache={},this._pickPositionCache={},this._pickPositionCacheDirty=!1;let t=new et(0,0,1,1),n=new Nr(e);n.frustum=new _n({width:Xwe,aspectRatio:1,near:.1}),this._pickOffscreenView=new nw(e,n,t)}ba.prototype.update=function(){this._pickPositionCacheDirty=!0};ba.prototype.getPickDepth=function(e,t){let n=e.view.pickDepths,i=n[t];return l(i)||(i=new D6,n[t]=i),i};var lwt=new Ss,uwt=new h,j6=new h,fwt=new U,dwt=new M;function hwt(e,t,n,i,r){let o=e.camera,s=o.frustum,a=s.offCenterFrustum;l(a)&&(s=a);let c=2*(t.x-r.x)/r.width-1;c*=(s.right-s.left)*.5;let u=2*(r.height-t.y-r.y)/r.height-1;u*=(s.top-s.bottom)*.5;let f=M.clone(o.transform,dwt);o._setTransform(M.IDENTITY);let d=h.clone(o.position,uwt);h.multiplyByScalar(o.right,c,j6),h.add(j6,d,d),h.multiplyByScalar(o.up,u,j6),h.add(j6,d,d),o._setTransform(f),e.mode===re.SCENE2D&&h.fromElements(d.z,d.x,d.y,d);let p=s.getPixelDimensions(r.width,r.height,1,1,fwt),g=lwt;return g.right=p.x*.5,g.left=-g.right,g.top=p.y*.5,g.bottom=-g.top,g.near=s.near,g.far=s.far,g.computeCullingVolume(d,o.directionWC,o.upWC)}var mwt=new Uu,pwt=new U;function gwt(e,t,n,i,r){let o=e.camera,s=o.frustum,a=s.near,c=Math.tan(s.fovy*.5),u=s.aspectRatio*c,f=2*(t.x-r.x)/r.width-1,d=2*(r.height-t.y-r.y)/r.height-1,p=f*a*u,g=d*a*c,m=s.getPixelDimensions(r.width,r.height,1,1,pwt),y=m.x*n*.5,A=m.y*i*.5,b=mwt;return b.top=g+A,b.bottom=g-A,b.right=p+y,b.left=p-y,b.near=a,b.far=s.far,b.computeCullingVolume(o.positionWC,o.directionWC,o.upWC)}function H6(e,t,n,i,r){let o=e.camera.frustum;return o instanceof _n||o instanceof Ss?hwt(e,t,n,i,r):gwt(e,t,n,i,r)}var VR=new et(0,0,3,3),G6=new U,jR=new z(0,0,0,0);function Yte(e,t,n,i,r){return r.width=n??3,r.height=i??r.width,r.x=t.x-(r.width-1)*.5,r.y=e-t.y-(r.height-1)*.5,r}function HR(e,t,n,i,r,o){let{context:s,frameState:a,defaultView:c}=e,{viewport:u,pickFramebuffer:f}=c,d=o?.framebuffer??f;e.view=c,u.x=0,u.y=0,u.width=s.drawingBufferWidth,u.height=s.drawingBufferHeight;let p=c.passState;p.viewport=et.clone(u,p.viewport);let g=pr.transformWindowToDrawingBuffer(e,t,G6);Yte(s.drawingBufferHeight,g,i,r,n),e.jobScheduler.disableThisFrame(),e.updateFrameState(),a.cullingVolume=H6(e,g,n.width,n.height,u),a.invertClassification=!1,a.passes.pick=!0,a.passes.snap=o?.snap??!1,a.tilesetPassState=zR,s.uniformState.update(a),e.updateEnvironment(),p=d.begin(n,u),e.updateAndExecuteCommands(p,jR),e.resolveFramebuffers(p)}function GR(e){let{context:t}=e;t.endFrame()}ba.prototype.pickAsync=async function(e,t,n,i,r=1){let{context:o,frameState:s,defaultView:a}=e,{pickFramebuffer:c}=a,u=VR;HR(e,t,u,n,i);let f;return o.webgl2?f=c.endAsync(u,s,r):(f=c.end(u,r),f=Promise.resolve(f),yt("picking-async-fallback","Fallback to synchronous picking because async operation requires WebGL2 context.")),GR(e),f};ba.prototype.pick=function(e,t,n,i,r=1){let{defaultView:o}=e,{pickFramebuffer:s}=o,a=VR;HR(e,t,a,n,i);let c=s.end(a,r);return GR(e),c};ba.prototype.pickVoxelCoordinate=function(e,t,n,i){let{context:r,frameState:o,defaultView:s}=e,{viewport:a,pickFramebuffer:c}=s;e.view=s,a.x=0,a.y=0,a.width=r.drawingBufferWidth,a.height=r.drawingBufferHeight;let u=s.passState;u.viewport=et.clone(a,u.viewport);let f=pr.transformWindowToDrawingBuffer(e,t,G6),d=Yte(r.drawingBufferHeight,f,n,i,VR);e.jobScheduler.disableThisFrame(),e.updateFrameState(),o.cullingVolume=H6(e,f,d.width,d.height,a),o.invertClassification=!1,o.passes.pickVoxel=!0,o.tilesetPassState=zR,r.uniformState.update(o),e.updateEnvironment(),u=c.begin(d,a),e.updateAndExecuteCommands(u,jR),e.resolveFramebuffers(u);let p=c.readCenterPixel(d);return r.endFrame(),p};ba.prototype.pickMetadata=function(e,t,n){let{context:i,frameState:r,defaultView:o}=e,{viewport:s,pickFramebuffer:a}=o;e.view=o,s.x=0,s.y=0,s.width=i.drawingBufferWidth,s.height=i.drawingBufferHeight;let c=o.passState;c.viewport=et.clone(s,c.viewport);let u=pr.transformWindowToDrawingBuffer(e,t,G6),f=Yte(i.drawingBufferHeight,u,1,1,VR);e.jobScheduler.disableThisFrame(),e.updateFrameState(),r.cullingVolume=H6(e,u,f.width,f.height,s),r.invertClassification=!1,r.passes.pick=!0,r.tilesetPassState=zR,r.pickingMetadata=!0,r.pickedMetadataInfo=n,i.uniformState.update(r),e.updateEnvironment(),c=a.begin(f,s),e.updateAndExecuteCommands(c,jR);let d=e._environmentState.useOIT;e._environmentState.useOIT=!1,e.resolveFramebuffers(c),e._environmentState.useOIT=d;let p=a.readCenterPixel(f);return i.endFrame(),r.pickingMetadata=!1,P6.decodeMetadataValues(n.classProperty,n.metadataProperty,p)};function _wt(e,t){let{defaultView:n,context:i,frameState:r,environmentState:o}=e,{viewport:s,pickDepthFramebuffer:a}=n;e.view=n,s.x=0,s.y=0,s.width=i.drawingBufferWidth,s.height=i.drawingBufferHeight;let c=n.passState;c.viewport=et.clone(s,c.viewport),e.clearPasses(r.passes),r.passes.pick=!0,r.passes.depth=!0,r.cullingVolume=H6(e,t,1,1,s),r.tilesetPassState=zR,e.updateEnvironment(),o.renderTranslucentDepthForPick=!0,c=a.update(i,t,s),e.updateAndExecuteCommands(c,jR),e.resolveFramebuffers(c),i.endFrame()}var ywt=new Ji,Awt=new Uu,bwt=new _n,xwt=new Ss;ba.prototype.pickPositionWorldCoordinates=function(e,t,n){if(!e.useDepthPicking)return;let i=t.toString();if(this._pickPositionCacheDirty)this._pickPositionCache={},this._pickPositionCacheDirty=!1;else if(this._pickPositionCache.hasOwnProperty(i))return h.clone(this._pickPositionCache[i],n);let{context:r,frameState:o,camera:s,defaultView:a}=e,{uniformState:c}=r;e.view=a;let u=pr.transformWindowToDrawingBuffer(e,t,G6);e.pickTranslucentDepth?_wt(e,u):(e.updateFrameState(),c.update(o),e.updateEnvironment()),u.y=e.drawingBufferHeight-u.y;let f;l(s.frustum.fov)?f=s.frustum.clone(ywt):l(s.frustum.infiniteProjectionMatrix)?f=s.frustum.clone(Awt):l(s.frustum.width)?f=s.frustum.clone(bwt):f=s.frustum.clone(xwt);let{frustumCommandsList:d}=a,p=d.length;for(let g=0;g<p;++g){let y=this.getPickDepth(e,g).getDepth(r,u.x,u.y);if(l(y)&&y>0&&y<1){let A=d[g],b;return e.mode===re.SCENE2D?(b=s.position.z,s.position.z=b-A.near+1,f.far=Math.max(1,A.far-A.near),f.near=1,c.update(o),c.updateFrustum(f)):(f.near=A.near*(g!==0?e.opaqueFrustumNearOffset:1),f.far=A.far,c.updateFrustum(f)),n=pr.drawingBufferToWorldCoordinates(e,u,y,n),e.mode===re.SCENE2D&&(s.position.z=b,c.update(o)),this._pickPositionCache[i]=h.clone(n),n}}this._pickPositionCache[i]=void 0};var Twt=new he;ba.prototype.pickPosition=function(e,t,n){if(n=this.pickPositionWorldCoordinates(e,t,n),l(n)&&e.mode!==re.SCENE3D){h.fromElements(n.y,n.z,n.x,n);let i=e.mapProjection,r=i.ellipsoid,o=i.unproject(n,Twt);r.cartographicToCartesian(o,n)}return n};function Ewt(e,t,n,i,r,o){for(let s of e){let a=s.object,c=s.position,u=s.exclude;if(l(c)&&!l(a))return n.push(s),!0;if(!l(a)||!l(a.primitive)||!u&&(n.push(s),n.length>=t))return!0;let f=a.primitive,d=!1;if(typeof f.getGeometryInstanceAttributes=="function"&&l(a.id)){let p=f.getGeometryInstanceAttributes(a.id);l(p)&&l(p.show)&&(d=!0,p.show=Dn.toValue(!1,p.show),r.push(p))}a instanceof ma&&(d=!0,a.show=!1,o.push(a)),d||(f.show=!1,i.push(f))}}function Kwe(e,t){let n=[],i=[],r=[],o=[];l(t)||(t=Number.MAX_VALUE);let s=e(t);for(;l(s)&&s.length>0&&!Ewt(s,t,n,i,r,o);)s=e(t-n.length);for(let a=0;a<i.length;++a)i[a].show=!0;for(let a=0;a<r.length;++a){let c=r[a];c.show=Dn.toValue(!0,c.show)}for(let a=0;a<o.length;++a)o[a].show=!0;return n}ba.prototype.drillPick=function(e,t,n,i,r){return Kwe(a=>this.pick(e,t,i,r,a).map(u=>({object:u,position:void 0,exclude:!1})),n).map(a=>a.object)};var Ywe=new h,Cwt=new h;function vwt(e,t,n){this.ray=e,this.width=t,this.tilesets=n,this.ready=!1;let i=this;this.promise=new Promise(r=>{i._completePick=()=>{r()}})}function $we(e,t,n,i){let r=t.direction,o=h.mostOrthogonalAxis(r,Ywe),s=h.cross(r,o,Ywe),a=h.cross(r,s,Cwt);return i.position=t.origin,i.direction=r,i.up=a,i.right=s,i.frustum.width=n??Xwe,i.frustum.computeCullingVolume(i.positionWC,i.directionWC,i.upWC)}function Swt(e,t,n){let i=t.frameState,{ray:r,width:o,tilesets:s}=n,a=e._pickOffscreenView.camera,c=$we(e,r,o,a),u=awt;u.camera=a,u.cullingVolume=c;let f=!0,d=s.length;for(let p=0;p<d;++p){let g=s[p];g.show&&t.primitives.contains(g)&&(g.updateForPass(i,u),f=f&&u.ready)}return f&&n._completePick(),f}ba.prototype.updateMostDetailedRayPicks=function(e){let t=this._mostDetailedRayPicks;for(let n=0;n<t.length;++n)Swt(this,e,t[n])&&t.splice(n--,1)};function Jwe(e,t,n){for(let i=0;i<e.length;++i){let r=e.get(i);r.show&&(l(r.isCesium3DTileset)?(!l(t)||t.indexOf(r)===-1)&&n.push(r):r instanceof Rl&&Jwe(r,t,n))}}function W6(e,t,n,i,r,o){let s=[];if(Jwe(t.primitives,i,s),s.length===0)return Promise.resolve(o());let a=new vwt(n,r,s);return e._mostDetailedRayPicks.push(a),a.promise.then(function(){return o()})}function wwt(e,t){return!l(e)||!l(t)||t.length===0?!1:t.indexOf(e)>-1||t.indexOf(e.primitive)>-1||t.indexOf(e.id)>-1}function Iwt(e,t,n,i,r,o,s){let{context:a,frameState:c}=t,u=a.uniformState,f=e._pickOffscreenView;t.view=f,$we(e,n,r,f.camera);let d=et.clone(f.viewport,VR),p=f.pickFramebuffer.begin(d,f.viewport);t.jobScheduler.disableThisFrame(),t.updateFrameState(),c.invertClassification=!1,c.passes.pick=!0,c.passes.offscreen=!0,s?c.tilesetPassState=cwt:c.tilesetPassState=zR,u.update(c),t.updateEnvironment(),t.updateAndExecuteCommands(p,jR),t.resolveFramebuffers(p);let g,m=f.pickFramebuffer.end(d,1)[0];if(t.context.depthTexture){let{frustumCommandsList:y}=f,A=y.length;for(let b=0;b<A;++b){let T=e.getPickDepth(t,b).getDepth(a,0,0);if(l(T)&&T>0&&T<1){let E=y[b],v=E.near*(b!==0?t.opaqueFrustumNearOffset:1),S=E.far,I=v+T*(S-v);g=gn.getPoint(n,I);break}}}if(t.view=t.defaultView,a.endFrame(),l(m)||l(g))return{object:m,position:g,exclude:!l(g)&&o||wwt(m,i)}}function Xte(e,t,n,i,r,o,s,a){return Kwe(function(){let u=Iwt(e,t,n,r,o,s,a);return u?[u]:void 0},i)}function iw(e,t,n,i,r,o,s){let a=Xte(e,t,n,1,i,r,o,s);if(a.length>0)return a[0]}function q6(e,t){return new Promise((n,i)=>{t.then(function(r){let o=e.postRender.addEventListener(function(){o(),n(r)});e.requestRender()}).catch(function(r){i(r)})})}ba.prototype.pickFromRay=function(e,t,n,i){return iw(this,e,t,n,i,!1,!1)};ba.prototype.drillPickFromRay=function(e,t,n,i,r){return Xte(this,e,t,n,i,r,!1,!1)};ba.prototype.pickFromRayMostDetailed=function(e,t,n,i){let r=this;return t=gn.clone(t),n=l(n)?n.slice():n,q6(e,W6(r,e,t,n,i,function(){return iw(r,e,t,n,i,!1,!0)}))};ba.prototype.drillPickFromRayMostDetailed=function(e,t,n,i,r){let o=this;return t=gn.clone(t),i=l(i)?i.slice():i,q6(e,W6(o,e,t,i,r,function(){return Xte(o,e,t,n,i,r,!1,!0)}))};var Pwt=new h,Dwt=new h,Rwt=new gn,Zwe=new he;function Kte(e,t){let n=e.ellipsoid,i=Ni._defaultMaxTerrainHeight,r=n.geodeticSurfaceNormalCartographic(t,Dwt),o=he.toCartesian(t,n,Pwt),s=Rwt;s.origin=o,s.direction=r;let a=new gn;return gn.getPoint(s,i,a.origin),h.negate(r,a.direction),a}function Qwe(e,t){let n=e.ellipsoid,i=he.fromCartesian(t,n,Zwe);return Kte(e,i)}function eIe(e,t){let n=e.ellipsoid;return he.fromCartesian(t,n,Zwe).height}function Owt(e,t,n,i,r){let o=Kte(t,n);return W6(e,t,o,i,r,function(){let s=iw(e,t,o,i,r,!0,!0);if(l(s))return eIe(t,s.position)})}function Mwt(e,t,n,i,r,o){let s=Qwe(t,n);return W6(e,t,s,i,r,function(){let a=iw(e,t,s,i,r,!0,!0);if(l(a))return h.clone(a.position,o)})}ba.prototype.sampleHeight=function(e,t,n,i){let r=Kte(e,t),o=iw(this,e,r,n,i,!0,!1);if(l(o))return eIe(e,o.position)};ba.prototype.clampToHeight=function(e,t,n,i,r){let o=Qwe(e,t),s=iw(this,e,o,n,i,!0,!1);if(l(s))return h.clone(s.position,r)};ba.prototype.sampleHeightMostDetailed=function(e,t,n,i){n=l(n)?n.slice():n;let r=t.length,o=new Array(r);for(let s=0;s<r;++s)o[s]=Owt(this,e,t[s],n,i);return q6(e,Promise.all(o).then(function(s){let a=s.length;for(let c=0;c<a;++c)t[c].height=s[c];return t}))};ba.prototype.clampToHeightMostDetailed=function(e,t,n,i){n=l(n)?n.slice():n;let r=t.length,o=new Array(r);for(let s=0;s<r;++s)o[s]=Mwt(this,e,t[s],n,i,t[s]);return q6(e,Promise.all(o).then(function(s){let a=s.length;for(let c=0;c<a;++c)t[c]=s[c];return t}))};ba.prototype.destroy=function(){this._pickOffscreenView=this._pickOffscreenView&&this._pickOffscreenView.destroy()};var Y6=ba;var X6=`uniform sampler2D colorTexture; in vec2 v_textureCoordinates; #ifdef AUTO_EXPOSURE uniform sampler2D autoExposure; @@ -10592,7 +10592,7 @@ color = czm_acesTonemapping(color); color = czm_inverseGamma(color); out_FragColor = vec4(color, fragmentColor.a); } -`;var l5=`precision highp float; +`;var K6=`precision highp float; uniform sampler2D randomTexture; uniform sampler2D depthTexture; uniform float intensity; @@ -10700,7 +10700,7 @@ ao = 1.0 - clamp(ao, 0.0, 1.0); ao = pow(ao, intensity); out_FragColor = vec4(vec3(ao), 1.0); } -`;var u5=`uniform sampler2D colorTexture; +`;var $6=`uniform sampler2D colorTexture; uniform sampler2D ambientOcclusionTexture; uniform bool ambientOcclusionOnly; in vec2 v_textureCoordinates; @@ -10710,7 +10710,7 @@ vec4 color = texture(colorTexture, v_textureCoordinates); vec4 ao = texture(ambientOcclusionTexture, v_textureCoordinates); out_FragColor = ambientOcclusionOnly ? ao : ao * color; } -`;var f5=`uniform sampler2D colorTexture; +`;var J6=`uniform sampler2D colorTexture; uniform float gradations; in vec2 v_textureCoordinates; void main(void) @@ -10727,7 +10727,7 @@ float darkness = luminance * gradations; darkness = (darkness - fract(darkness)) / gradations; out_FragColor = vec4(vec3(darkness), 1.0); } -`;var d5=`uniform sampler2D colorTexture; +`;var Z6=`uniform sampler2D colorTexture; uniform sampler2D bloomTexture; uniform bool glowOnly; in vec2 v_textureCoordinates; @@ -10743,7 +10743,7 @@ return; vec4 bloom = texture(bloomTexture, v_textureCoordinates); out_FragColor = glowOnly ? bloom : bloom + color; } -`;var h5=`uniform sampler2D colorTexture; +`;var Q6=`uniform sampler2D colorTexture; uniform float brightness; in vec2 v_textureCoordinates; void main(void) @@ -10752,7 +10752,7 @@ vec3 rgb = texture(colorTexture, v_textureCoordinates).rgb; vec3 target = vec3(0.0); out_FragColor = vec4(mix(target, rgb, brightness), 1.0); } -`;var m5=`uniform sampler2D colorTexture; +`;var eH=`uniform sampler2D colorTexture; uniform float contrast; uniform float brightness; in vec2 v_textureCoordinates; @@ -10766,7 +10766,7 @@ float factor = (259.0 * (contrast + 255.0)) / (255.0 * (259.0 - contrast)); sceneColor = factor * (sceneColor - vec3(0.5)) + vec3(0.5); out_FragColor = vec4(sceneColor, 1.0); } -`;var p5=`uniform sampler2D colorTexture; +`;var tH=`uniform sampler2D colorTexture; uniform sampler2D blurTexture; uniform sampler2D depthTexture; uniform float focalDistance; @@ -10801,14 +10801,14 @@ vec4 posInCamera = toEye(v_textureCoordinates, depth); float d = computeDepthBlur(-posInCamera.z); out_FragColor = mix(texture(colorTexture, v_textureCoordinates), texture(blurTexture, v_textureCoordinates), d); } -`;var g5=`uniform sampler2D depthTexture; +`;var nH=`uniform sampler2D depthTexture; in vec2 v_textureCoordinates; void main(void) { float depth = czm_readDepth(depthTexture, v_textureCoordinates); out_FragColor = vec4(vec3(depth), 1.0); } -`;var _5=`uniform sampler2D depthTexture; +`;var iH=`uniform sampler2D depthTexture; uniform float length; uniform vec4 color; in vec2 v_textureCoordinates; @@ -10858,7 +10858,7 @@ vertEdge += texture(depthTexture, v_textureCoordinates + vec2(dir * padx, pady)) float len = sqrt(horizEdge * horizEdge + vertEdge * vertEdge); out_FragColor = vec4(color.rgb, len > length ? color.a : 0.0); } -`;var y5=`uniform sampler2D colorTexture; +`;var rH=`uniform sampler2D colorTexture; in vec2 v_textureCoordinates; #ifdef AUTO_EXPOSURE uniform sampler2D autoExposure; @@ -10887,7 +10887,7 @@ float w = ((white * (A * white + C * B) + D * E) / (white * ( A * white + B) + D c = czm_inverseGamma(c / w); out_FragColor = vec4(c, fragmentColor.a); } -`;var A5=`uniform sampler2D colorTexture; +`;var oH=`uniform sampler2D colorTexture; in vec2 v_textureCoordinates; #ifdef AUTO_EXPOSURE uniform sampler2D autoExposure; @@ -10907,7 +10907,7 @@ color = czm_pbrNeutralTonemapping(color); color = czm_inverseGamma(color); out_FragColor = vec4(color, fragmentColor.a); } -`;var b5=`in vec2 v_textureCoordinates; +`;var sH=`in vec2 v_textureCoordinates; uniform sampler2D colorTexture; const float fxaaQualitySubpix = 0.5; const float fxaaQualityEdgeThreshold = 0.125; @@ -10925,7 +10925,7 @@ fxaaQualityEdgeThresholdMin); float alpha = texture(colorTexture, v_textureCoordinates).a; out_FragColor = vec4(color.rgb, alpha); } -`;var UT=`#define SAMPLES 8 +`;var fT=`#define SAMPLES 8 uniform float delta; uniform float sigma; uniform float direction; @@ -10959,7 +10959,7 @@ result += texture(colorTexture, st + offset) * g.x; } out_FragColor = result; } -`;var x5=`uniform sampler2D colorTexture; +`;var aH=`uniform sampler2D colorTexture; uniform sampler2D dirtTexture; uniform sampler2D starTexture; uniform vec2 dirtTextureDimensions; @@ -11074,7 +11074,7 @@ result *= texture(starTexture, lensStarTexcoord) * pow(weightForLensFlare, 1.0) result += texture(colorTexture, v_textureCoordinates); out_FragColor = result; } -`;var T5=`uniform sampler2D colorTexture; +`;var cH=`uniform sampler2D colorTexture; uniform vec3 white; in vec2 v_textureCoordinates; #ifdef AUTO_EXPOSURE @@ -11096,7 +11096,7 @@ color = (color * (1.0 + color / white)) / (1.0 + color); color = czm_inverseGamma(color); out_FragColor = vec4(color, fragmentColor.a); } -`;var E5=`uniform sampler2D colorTexture; +`;var lH=`uniform sampler2D colorTexture; in vec2 v_textureCoordinates; float rand(vec2 co) { @@ -11109,7 +11109,7 @@ vec3 rgb = texture(colorTexture, v_textureCoordinates).rgb; vec3 green = vec3(0.0, 1.0, 0.0); out_FragColor = vec4((noiseValue + rgb) * green, 1.0); } -`;var C5=`uniform sampler2D colorTexture; +`;var uH=`uniform sampler2D colorTexture; in vec2 v_textureCoordinates; #ifdef AUTO_EXPOSURE uniform sampler2D autoExposure; @@ -11130,7 +11130,7 @@ color = color / (1.0 + color); color = czm_inverseGamma(color); out_FragColor = vec4(color, fragmentColor.a); } -`;var v5=`uniform sampler2D colorTexture; +`;var fH=`uniform sampler2D colorTexture; uniform sampler2D silhouetteTexture; in vec2 v_textureCoordinates; void main(void) @@ -11139,7 +11139,7 @@ vec4 silhouetteColor = texture(silhouetteTexture, v_textureCoordinates); vec4 color = texture(colorTexture, v_textureCoordinates); out_FragColor = mix(color, silhouetteColor, silhouetteColor.a); } -`;function zT(){this._uniformMap=void 0,this._command=void 0,this._colorTexture=void 0,this._depthTexture=void 0,this._ready=!1,this._name="czm_autoexposure",this._logDepthChanged=void 0,this._useLogDepth=void 0,this._framebuffers=void 0,this._previousLuminance=new ci,this._commands=void 0,this._clearCommand=void 0,this._minMaxLuminance=new U,this.enabled=!0,this._enabled=!0,this.minimumLuminance=.1,this.maximumLuminance=10}Object.defineProperties(zT.prototype,{ready:{get:function(){return this._ready}},name:{get:function(){return this._name}},outputTexture:{get:function(){let e=this._framebuffers;if(l(e))return e[e.length-1].getColorTexture(0)}}});function JOe(e){let t=e._framebuffers;if(!l(t))return;let n=t.length;for(let i=0;i<n;++i)t[i].destroy();e._framebuffers=void 0,e._previousLuminance.destroy(),e._previousLuminance=void 0}function hNt(e,t){JOe(e);let n=e._width,i=e._height,r=t.halfFloatingPointTexture?ze.HALF_FLOAT:ze.FLOAT,o=Math.ceil(Math.log(Math.max(n,i))/Math.log(3)),s=new Array(o);for(let c=0;c<o;++c)n=Math.max(Math.ceil(n/3),1),i=Math.max(Math.ceil(i/3),1),s[c]=new ci,s[c].update(t,n,i,1,r);let a=s[o-1].getColorTexture(0);e._previousLuminance.update(t,a.width,a.height,1,r),e._framebuffers=s}function ZOe(e){let t=e._commands;if(!l(t))return;let n=t.length;for(let i=0;i<n;++i)t[i].shaderProgram.destroy();e._commands=void 0}function mNt(e,t){let n;if(t===0)n={colorTexture:function(){return e._colorTexture},colorTextureDimensions:function(){return e._colorTexture.dimensions}};else{let i=e._framebuffers[t-1].getColorTexture(0);n={colorTexture:function(){return i},colorTextureDimensions:function(){return i.dimensions}}}return n.minMaxLuminance=function(){return e._minMaxLuminance},n.previousLuminance=function(){return e._previousLuminance.getColorTexture(0)},n}function pNt(e,t){let n=`uniform sampler2D colorTexture; +`;function dT(){this._uniformMap=void 0,this._command=void 0,this._colorTexture=void 0,this._depthTexture=void 0,this._ready=!1,this._name="czm_autoexposure",this._logDepthChanged=void 0,this._useLogDepth=void 0,this._framebuffers=void 0,this._previousLuminance=new ci,this._commands=void 0,this._clearCommand=void 0,this._minMaxLuminance=new U,this.enabled=!0,this._enabled=!0,this.minimumLuminance=.1,this.maximumLuminance=10}Object.defineProperties(dT.prototype,{ready:{get:function(){return this._ready}},name:{get:function(){return this._name}},outputTexture:{get:function(){let e=this._framebuffers;if(l(e))return e[e.length-1].getColorTexture(0)}}});function tIe(e){let t=e._framebuffers;if(!l(t))return;let n=t.length;for(let i=0;i<n;++i)t[i].destroy();e._framebuffers=void 0,e._previousLuminance.destroy(),e._previousLuminance=void 0}function Nwt(e,t){tIe(e);let n=e._width,i=e._height,r=t.halfFloatingPointTexture?ze.HALF_FLOAT:ze.FLOAT,o=Math.ceil(Math.log(Math.max(n,i))/Math.log(3)),s=new Array(o);for(let c=0;c<o;++c)n=Math.max(Math.ceil(n/3),1),i=Math.max(Math.ceil(i/3),1),s[c]=new ci,s[c].update(t,n,i,1,r);let a=s[o-1].getColorTexture(0);e._previousLuminance.update(t,a.width,a.height,1,r),e._framebuffers=s}function nIe(e){let t=e._commands;if(!l(t))return;let n=t.length;for(let i=0;i<n;++i)t[i].shaderProgram.destroy();e._commands=void 0}function Lwt(e,t){let n;if(t===0)n={colorTexture:function(){return e._colorTexture},colorTextureDimensions:function(){return e._colorTexture.dimensions}};else{let i=e._framebuffers[t-1].getColorTexture(0);n={colorTexture:function(){return i},colorTextureDimensions:function(){return i.dimensions}}}return n.minMaxLuminance=function(){return e._minMaxLuminance},n.previousLuminance=function(){return e._previousLuminance.getColorTexture(0)},n}function Fwt(e,t){let n=`uniform sampler2D colorTexture; in vec2 v_textureCoordinates; float sampleTexture(vec2 offset) { `;return e===0?n+=` vec4 color = texture(colorTexture, v_textureCoordinates + offset); @@ -11176,7 +11176,7 @@ void main() { color = clamp(color, minMaxLuminance.x, minMaxLuminance.y); `),n+=` out_FragColor = vec4(color); } -`,n}function gNt(e,t){ZOe(e);let n=e._framebuffers,i=n.length,r=new Array(i);for(let o=0;o<i;++o)r[o]=t.createViewportQuadCommand(pNt(o,i),{framebuffer:n[o].framebuffer,uniformMap:mNt(e,o)});e._commands=r}zT.prototype.clear=function(e){let t=this._framebuffers;if(!l(t))return;let n=this._clearCommand;l(n)||(n=this._clearCommand=new fi({color:new z(0,0,0,0),framebuffer:void 0}));let i=t.length;for(let r=0;r<i;++r)t[r].clear(e,n)};zT.prototype.update=function(e){let t=e.drawingBufferWidth,n=e.drawingBufferHeight;(t!==this._width||n!==this._height)&&(this._width=t,this._height=n,hNt(this,e),gNt(this,e),this._ready||(this._ready=!0)),this._minMaxLuminance.x=this.minimumLuminance,this._minMaxLuminance.y=this.maximumLuminance;let i=this._framebuffers,r=i[i.length-1];i[i.length-1]=this._previousLuminance,this._commands[this._commands.length-1].framebuffer=this._previousLuminance.framebuffer,this._previousLuminance=r};zT.prototype.execute=function(e,t){this._colorTexture=t;let n=this._commands;if(!l(n))return;let i=n.length;for(let r=0;r<i;++r)n[r].execute(e)};zT.prototype.isDestroyed=function(){return!1};zT.prototype.destroy=function(){return JOe(this),ZOe(this),le(this)};var S5=zT;var _Nt={NEAREST:0,LINEAR:1},Zd=_Nt;function o_(e){e=e??H.EMPTY_OBJECT;let{name:t=Kn(),fragmentShader:n,uniforms:i,textureScale:r=1,forcePowerOfTwo:o=!1,sampleMode:s=Zd.NEAREST,pixelFormat:a=$e.RGBA,pixelDatatype:c=ze.UNSIGNED_BYTE,clearColor:u=z.BLACK,scissorRectangle:f}=e;this._fragmentShader=n,this._uniforms=i,this._textureScale=r,this._forcePowerOfTwo=o,this._sampleMode=s,this._pixelFormat=a,this._pixelDatatype=c,this._clearColor=u,this._uniformMap=void 0,this._command=void 0,this._colorTexture=void 0,this._depthTexture=void 0,this._idTexture=void 0,this._actualUniforms={},this._dirtyUniforms=[],this._texturesToRelease=[],this._texturesToCreate=[],this._texturePromise=void 0;let d=new gc;d.scissorTest={enabled:!0,rectangle:l(f)?et.clone(f):new et},this._passState=d,this._ready=!1,this._name=t,this._logDepthChanged=void 0,this._useLogDepth=void 0,this._selectedIdTexture=void 0,this._selected=void 0,this._selectedShadow=void 0,this._parentSelected=void 0,this._parentSelectedShadow=void 0,this._combinedSelected=void 0,this._combinedSelectedShadow=void 0,this._selectedLength=0,this._parentSelectedLength=0,this._selectedDirty=!0,this._textureCache=void 0,this._index=void 0,this.enabled=!0,this._enabled=!0}Object.defineProperties(o_.prototype,{ready:{get:function(){return this._ready}},name:{get:function(){return this._name}},fragmentShader:{get:function(){return this._fragmentShader}},uniforms:{get:function(){return this._uniforms}},textureScale:{get:function(){return this._textureScale}},forcePowerOfTwo:{get:function(){return this._forcePowerOfTwo}},sampleMode:{get:function(){return this._sampleMode}},pixelFormat:{get:function(){return this._pixelFormat}},pixelDatatype:{get:function(){return this._pixelDatatype}},clearColor:{get:function(){return this._clearColor}},scissorRectangle:{get:function(){return this._passState.scissorTest.rectangle}},outputTexture:{get:function(){if(l(this._textureCache)){let e=this._textureCache.getFramebuffer(this._name);if(l(e))return e.getColorTexture(0)}}},selected:{get:function(){return this._selected},set:function(e){this._selected=e}},parentSelected:{get:function(){return this._parentSelected},set:function(e){this._parentSelected=e}}});var yNt=/uniform\s+sampler2D\s+depthTexture/g;o_.prototype._isSupported=function(e){return!yNt.test(this._fragmentShader)||e.depthTexture};function ANt(e,t,n){let i=t[n];return(typeof i=="string"||i instanceof HTMLCanvasElement||i instanceof HTMLImageElement||i instanceof HTMLVideoElement||i instanceof ImageData)&&e._dirtyUniforms.push(n),{get:function(){return t[n]},set:function(r){let o=t[n];t[n]=r;let s=e._actualUniforms,a=s[n];l(a)&&a!==o&&a instanceof Dt&&!l(e._textureCache.getStageByName(n))&&(e._texturesToRelease.push(a),delete s[n],delete s[`${n}Dimensions`]),o instanceof Dt&&e._texturesToRelease.push(o),typeof r=="string"||r instanceof HTMLCanvasElement||r instanceof HTMLImageElement||r instanceof HTMLVideoElement||r instanceof ImageData?e._dirtyUniforms.push(n):s[n]=r}}}function bNt(e,t){return function(){let n=e._actualUniforms[t];return typeof n=="function"?n():n}}function xNt(e,t){return function(){let n=e[t]();if(l(n))return n.dimensions}}function TNt(e){if(l(e._uniformMap))return;let t={},n={},i=e._uniforms,r=e._actualUniforms;for(let o in i){if(!i.hasOwnProperty(o))continue;typeof i[o]!="function"?(t[o]=bNt(e,o),n[o]=ANt(e,i,o)):(t[o]=i[o],n[o]=i[o]),r[o]=i[o];let s=t[o]();(typeof s=="string"||s instanceof Dt||s instanceof HTMLImageElement||s instanceof HTMLCanvasElement||s instanceof HTMLVideoElement)&&(t[`${o}Dimensions`]=xNt(t,o))}e._uniforms={},Object.defineProperties(e._uniforms,n),e._uniformMap=Mt(t,{colorTexture:function(){return e._colorTexture},colorTextureDimensions:function(){return e._colorTexture.dimensions},depthTexture:function(){return e._depthTexture},depthTextureDimensions:function(){return e._depthTexture.dimensions},czm_idTexture:function(){return e._idTexture},czm_selectedIdTexture:function(){return e._selectedIdTexture},czm_selectedIdTextureStep:function(){return 1/e._selectedIdTexture.width}})}function ENt(e,t){return e=e.replace(/in\s+vec2\s+v_textureCoordinates;/g,""),`#define CZM_SELECTED_FEATURE +`,n}function Bwt(e,t){nIe(e);let n=e._framebuffers,i=n.length,r=new Array(i);for(let o=0;o<i;++o)r[o]=t.createViewportQuadCommand(Fwt(o,i),{framebuffer:n[o].framebuffer,uniformMap:Lwt(e,o)});e._commands=r}dT.prototype.clear=function(e){let t=this._framebuffers;if(!l(t))return;let n=this._clearCommand;l(n)||(n=this._clearCommand=new fi({color:new z(0,0,0,0),framebuffer:void 0}));let i=t.length;for(let r=0;r<i;++r)t[r].clear(e,n)};dT.prototype.update=function(e){let t=e.drawingBufferWidth,n=e.drawingBufferHeight;(t!==this._width||n!==this._height)&&(this._width=t,this._height=n,Nwt(this,e),Bwt(this,e),this._ready||(this._ready=!0)),this._minMaxLuminance.x=this.minimumLuminance,this._minMaxLuminance.y=this.maximumLuminance;let i=this._framebuffers,r=i[i.length-1];i[i.length-1]=this._previousLuminance,this._commands[this._commands.length-1].framebuffer=this._previousLuminance.framebuffer,this._previousLuminance=r};dT.prototype.execute=function(e,t){this._colorTexture=t;let n=this._commands;if(!l(n))return;let i=n.length;for(let r=0;r<i;++r)n[r].execute(e)};dT.prototype.isDestroyed=function(){return!1};dT.prototype.destroy=function(){return tIe(this),nIe(this),le(this)};var dH=dT;var kwt={NEAREST:0,LINEAR:1},Yd=kwt;function Wg(e){e=e??H.EMPTY_OBJECT;let{name:t=Kn(),fragmentShader:n,uniforms:i,textureScale:r=1,forcePowerOfTwo:o=!1,sampleMode:s=Yd.NEAREST,pixelFormat:a=$e.RGBA,pixelDatatype:c=ze.UNSIGNED_BYTE,clearColor:u=z.BLACK,scissorRectangle:f}=e;this._fragmentShader=n,this._uniforms=i,this._textureScale=r,this._forcePowerOfTwo=o,this._sampleMode=s,this._pixelFormat=a,this._pixelDatatype=c,this._clearColor=u,this._uniformMap=void 0,this._command=void 0,this._colorTexture=void 0,this._depthTexture=void 0,this._idTexture=void 0,this._actualUniforms={},this._dirtyUniforms=[],this._texturesToRelease=[],this._texturesToCreate=[],this._texturePromise=void 0;let d=new gc;d.scissorTest={enabled:!0,rectangle:l(f)?et.clone(f):new et},this._passState=d,this._ready=!1,this._name=t,this._logDepthChanged=void 0,this._useLogDepth=void 0,this._selectedIdTexture=void 0,this._selected=void 0,this._selectedShadow=void 0,this._parentSelected=void 0,this._parentSelectedShadow=void 0,this._combinedSelected=void 0,this._combinedSelectedShadow=void 0,this._selectedLength=0,this._parentSelectedLength=0,this._selectedDirty=!0,this._textureCache=void 0,this._index=void 0,this.enabled=!0,this._enabled=!0}Object.defineProperties(Wg.prototype,{ready:{get:function(){return this._ready}},name:{get:function(){return this._name}},fragmentShader:{get:function(){return this._fragmentShader}},uniforms:{get:function(){return this._uniforms}},textureScale:{get:function(){return this._textureScale}},forcePowerOfTwo:{get:function(){return this._forcePowerOfTwo}},sampleMode:{get:function(){return this._sampleMode}},pixelFormat:{get:function(){return this._pixelFormat}},pixelDatatype:{get:function(){return this._pixelDatatype}},clearColor:{get:function(){return this._clearColor}},scissorRectangle:{get:function(){return this._passState.scissorTest.rectangle}},outputTexture:{get:function(){if(l(this._textureCache)){let e=this._textureCache.getFramebuffer(this._name);if(l(e))return e.getColorTexture(0)}}},selected:{get:function(){return this._selected},set:function(e){this._selected=e}},parentSelected:{get:function(){return this._parentSelected},set:function(e){this._parentSelected=e}}});var Uwt=/uniform\s+sampler2D\s+depthTexture/g;Wg.prototype._isSupported=function(e){return!Uwt.test(this._fragmentShader)||e.depthTexture};function zwt(e,t,n){let i=t[n];return(typeof i=="string"||i instanceof HTMLCanvasElement||i instanceof HTMLImageElement||i instanceof HTMLVideoElement||i instanceof ImageData)&&e._dirtyUniforms.push(n),{get:function(){return t[n]},set:function(r){let o=t[n];t[n]=r;let s=e._actualUniforms,a=s[n];l(a)&&a!==o&&a instanceof Dt&&!l(e._textureCache.getStageByName(n))&&(e._texturesToRelease.push(a),delete s[n],delete s[`${n}Dimensions`]),o instanceof Dt&&e._texturesToRelease.push(o),typeof r=="string"||r instanceof HTMLCanvasElement||r instanceof HTMLImageElement||r instanceof HTMLVideoElement||r instanceof ImageData?e._dirtyUniforms.push(n):s[n]=r}}}function Vwt(e,t){return function(){let n=e._actualUniforms[t];return typeof n=="function"?n():n}}function jwt(e,t){return function(){let n=e[t]();if(l(n))return n.dimensions}}function Hwt(e){if(l(e._uniformMap))return;let t={},n={},i=e._uniforms,r=e._actualUniforms;for(let o in i){if(!i.hasOwnProperty(o))continue;typeof i[o]!="function"?(t[o]=Vwt(e,o),n[o]=zwt(e,i,o)):(t[o]=i[o],n[o]=i[o]),r[o]=i[o];let s=t[o]();(typeof s=="string"||s instanceof Dt||s instanceof HTMLImageElement||s instanceof HTMLCanvasElement||s instanceof HTMLVideoElement)&&(t[`${o}Dimensions`]=jwt(t,o))}e._uniforms={},Object.defineProperties(e._uniforms,n),e._uniformMap=Mt(t,{colorTexture:function(){return e._colorTexture},colorTextureDimensions:function(){return e._colorTexture.dimensions},depthTexture:function(){return e._depthTexture},depthTextureDimensions:function(){return e._depthTexture.dimensions},czm_idTexture:function(){return e._idTexture},czm_selectedIdTexture:function(){return e._selectedIdTexture},czm_selectedIdTextureStep:function(){return 1/e._selectedIdTexture.width}})}function Gwt(e,t){return e=e.replace(/in\s+vec2\s+v_textureCoordinates;/g,""),`#define CZM_SELECTED_FEATURE uniform sampler2D czm_idTexture; uniform sampler2D czm_selectedIdTexture; uniform float czm_selectedIdTextureStep; @@ -11200,8 +11200,8 @@ bool czm_selected() return czm_selected(vec2(0.0)); } -${e}`}function CNt(e,t){if(l(e._command)&&!e._logDepthChanged&&!e._selectedDirty)return;let n=e._fragmentShader;if(l(e._selectedIdTexture)){let r=e._selectedIdTexture.width;n=ENt(n,r)}let i=new Xe({defines:[e._useLogDepth?"LOG_DEPTH":""],sources:[n]});e._command=t.createViewportQuadCommand(i,{uniformMap:e._uniformMap,owner:e})}function vNt(e){let t=e._sampleMode,n,i;t===Zd.LINEAR?(n=Wt.LINEAR,i=Jn.LINEAR):(n=Wt.NEAREST,i=Jn.NEAREST);let r=e._sampler;(!l(r)||r.minificationFilter!==n||r.magnificationFilter!==i)&&(e._sampler=new Ht({wrapS:hn.CLAMP_TO_EDGE,wrapT:hn.CLAMP_TO_EDGE,minificationFilter:n,magnificationFilter:i}))}function SNt(e,t){return function(n){e._texturesToCreate.push({name:t,source:n})}}function wNt(e,t){return function(){return e._textureCache.getOutputTexture(t)}}function INt(e,t){let n=e._texturesToRelease;for(let a=0;a<n.length;++a){let c=n[a];l(c)&&c.destroy()}n.length=0;let i=e._texturesToCreate;for(let a=0;a<i.length;++a){let{name:c,source:u}=i[a];e._actualUniforms[c]=new Dt({context:t,source:u})}i.length=0;let r=e._dirtyUniforms;if(r.length===0&&!l(e._texturePromise)){e._ready=!0;return}if(r.length===0||l(e._texturePromise))return;let o=e._uniforms,s=[];for(let a=0;a<r.length;++a){let c=r[a],u=o[c],f=e._textureCache.getStageByName(u);if(l(f))e._actualUniforms[c]=wNt(e,u);else if(typeof u=="string"){let d=new De({url:u});s.push(d.fetchImage().then(SNt(e,c)))}else e._texturesToCreate.push({name:c,source:u})}r.length=0,s.length>0?(e._ready=!1,e._texturePromise=Promise.all(s).then(function(){e._ready=!0,e._texturePromise=void 0})):e._ready=!0}function QOe(e){l(e._command)&&(e._command.shaderProgram=e._command.shaderProgram&&e._command.shaderProgram.destroy(),e._command=void 0),e._selectedIdTexture=e._selectedIdTexture&&e._selectedIdTexture.destroy();let t=e._textureCache;if(!l(t))return;let n=e._uniforms,i=e._actualUniforms;for(let r in i){if(!i.hasOwnProperty(r))continue;let o=i[r];o instanceof Dt&&(l(t.getStageByName(n[r]))||o.destroy(),e._dirtyUniforms.push(r))}}function PNt(e){let t=l(e._selected)?e._selected.length:0,n=l(e._parentSelected)?e._parentSelected:0,i=e._selected!==e._selectedShadow||t!==e._selectedLength||e._parentSelected!==e._parentSelectedShadow||n!==e._parentSelectedLength;if(l(e._selected)&&l(e._parentSelected)?e._combinedSelected=e._selected.concat(e._parentSelected):l(e._parentSelected)?e._combinedSelected=e._parentSelected:e._combinedSelected=e._selected,!i&&l(e._combinedSelected)){if(!l(e._combinedSelectedShadow))return!0;for(let r=0;r<e._combinedSelected.length;++r)if(e._combinedSelected[r]!==e._combinedSelectedShadow[r])return!0}return i}function DNt(e,t){if(!e._selectedDirty)return;e._selectedIdTexture=e._selectedIdTexture&&e._selectedIdTexture.destroy(),e._selectedIdTexture=void 0;let n=e._combinedSelected;if(!l(n))return;let i=0;for(let c=0;c<n.length;++c){let u=n[c];l(u.pickIds)?i+=u.pickIds.length:l(u.pickId)&&++i}let r=Ut.maximumTextureSize;if(i>r&&(o_._oneTimeWarning("postProcessStageSelectedTextureSize",`The number of selected feature ids (${i}) exceeds the maximum texture size (${r}). Features beyond the limit will not have the post-process effect applied.`),i=r),n.length===0||i===0){let c=new Uint8Array([255,255,255,255]);e._selectedIdTexture=new Dt({context:t,pixelFormat:$e.RGBA,pixelDatatype:ze.UNSIGNED_BYTE,source:{arrayBufferView:c,width:1,height:1},sampler:Ht.NEAREST});return}let o=0,s=i*4,a=new Uint8Array(s);for(let c=0;c<n.length&&o<s;++c){let u=n[c];if(l(u.pickIds)){let f=u.pickIds,d=f.length;for(let p=0;p<d&&o<s;++p){let g=f[p].color;a[o]=z.floatToByte(g.red),a[o+1]=z.floatToByte(g.green),a[o+2]=z.floatToByte(g.blue),a[o+3]=z.floatToByte(g.alpha),o+=4}}else if(l(u.pickId)){let f=u.pickId.color;a[o]=z.floatToByte(f.red),a[o+1]=z.floatToByte(f.green),a[o+2]=z.floatToByte(f.blue),a[o+3]=z.floatToByte(f.alpha),o+=4}}e._selectedIdTexture=new Dt({context:t,pixelFormat:$e.RGBA,pixelDatatype:ze.UNSIGNED_BYTE,source:{arrayBufferView:a,width:i,height:1},sampler:Ht.NEAREST})}o_.prototype.update=function(e,t){if(this.enabled!==this._enabled&&!this.enabled&&QOe(this),this._enabled=this.enabled,!this._enabled||(this._logDepthChanged=t!==this._useLogDepth,this._useLogDepth=t,this._selectedDirty=PNt(this),this._selectedShadow=this._selected,this._parentSelectedShadow=this._parentSelected,this._combinedSelectedShadow=this._combinedSelected,this._selectedLength=l(this._selected)?this._selected.length:0,this._parentSelectedLength=l(this._parentSelected)?this._parentSelected.length:0,DNt(this,e),TNt(this),INt(this,e),CNt(this,e),vNt(this),this._selectedDirty=!1,!this._ready))return;let n=this._textureCache.getFramebuffer(this._name);if(this._command.framebuffer=n,!l(n))return;let i=n.getColorTexture(0),r;(i.width!==e.drawingBufferWidth||i.height!==e.drawingBufferHeight)&&(r=this._renderState,(!l(r)||i.width!==r.viewport.width||i.height!==r.viewport.height)&&(this._renderState=Ge.fromCache({viewport:new et(0,0,i.width,i.height)}))),this._command.renderState=r};o_.prototype.execute=function(e,t,n,i){if(!l(this._command)||!l(this._command.framebuffer)||!this._ready||!this._enabled)return;this._colorTexture=t,this._depthTexture=n,this._idTexture=i,Ht.equals(this._colorTexture.sampler,this._sampler)||(this._colorTexture.sampler=this._sampler);let r=this.scissorRectangle.width>0&&this.scissorRectangle.height>0?this._passState:void 0;l(r)&&(r.context=e),this._command.execute(e,r)};o_.prototype.isDestroyed=function(){return!1};o_.prototype.destroy=function(){return QOe(this),le(this)};o_._oneTimeWarning=yt;var zr=o_;function VT(e){e=e??H.EMPTY_OBJECT,this._stages=e.stages,this._inputPreviousStageTexture=e.inputPreviousStageTexture??!0;let t=e.name;l(t)||(t=Kn()),this._name=t,this._uniforms=e.uniforms,this._textureCache=void 0,this._index=void 0,this._selected=void 0,this._selectedShadow=void 0,this._parentSelected=void 0,this._parentSelectedShadow=void 0,this._combinedSelected=void 0,this._combinedSelectedShadow=void 0,this._selectedLength=0,this._parentSelectedLength=0,this._selectedDirty=!0}Object.defineProperties(VT.prototype,{ready:{get:function(){let e=this._stages,t=e.length;for(let n=0;n<t;++n)if(!e[n].ready)return!1;return!0}},name:{get:function(){return this._name}},enabled:{get:function(){return this._stages[0].enabled},set:function(e){let t=this._stages,n=t.length;for(let i=0;i<n;++i)t[i].enabled=e}},uniforms:{get:function(){return this._uniforms}},inputPreviousStageTexture:{get:function(){return this._inputPreviousStageTexture}},length:{get:function(){return this._stages.length}},selected:{get:function(){return this._selected},set:function(e){this._selected=e}},parentSelected:{get:function(){return this._parentSelected},set:function(e){this._parentSelected=e}}});VT.prototype._isSupported=function(e){let t=this._stages,n=t.length;for(let i=0;i<n;++i)if(!t[i]._isSupported(e))return!1;return!0};VT.prototype.get=function(e){return this._stages[e]};function RNt(e){let t=l(e._selected)?e._selected.length:0,n=l(e._parentSelected)?e._parentSelected:0,i=e._selected!==e._selectedShadow||t!==e._selectedLength;if(i=i||e._parentSelected!==e._parentSelectedShadow||n!==e._parentSelectedLength,l(e._selected)&&l(e._parentSelected)?e._combinedSelected=e._selected.concat(e._parentSelected):l(e._parentSelected)?e._combinedSelected=e._parentSelected:e._combinedSelected=e._selected,!i&&l(e._combinedSelected)){if(!l(e._combinedSelectedShadow))return!0;t=e._combinedSelected.length;for(let r=0;r<t;++r)if(e._combinedSelected[r]!==e._combinedSelectedShadow[r])return!0}return i}VT.prototype.update=function(e,t){this._selectedDirty=RNt(this),this._selectedShadow=this._selected,this._parentSelectedShadow=this._parentSelected,this._combinedSelectedShadow=this._combinedSelected,this._selectedLength=l(this._selected)?this._selected.length:0,this._parentSelectedLength=l(this._parentSelected)?this._parentSelected.length:0;let n=this._stages,i=n.length;for(let r=0;r<i;++r){let o=n[r];this._selectedDirty&&(o.parentSelected=this._combinedSelected),o.update(e,t)}};VT.prototype.isDestroyed=function(){return!1};VT.prototype.destroy=function(){let e=this._stages,t=e.length;for(let n=0;n<t;++n)e[n].destroy();return le(this)};var kf=VT;var is={};function foe(e){let r=`#define USE_STEP_SIZE -${UT}`,o=new zr({name:`${e}_x_direction`,fragmentShader:r,uniforms:{delta:1,sigma:2,stepSize:1,direction:0},sampleMode:Zd.LINEAR}),s=new zr({name:`${e}_y_direction`,fragmentShader:r,uniforms:{delta:1,sigma:2,stepSize:1,direction:1},sampleMode:Zd.LINEAR}),a={};return Object.defineProperties(a,{delta:{get:function(){return o.uniforms.delta},set:function(c){let u=o.uniforms,f=s.uniforms;u.delta=f.delta=c}},sigma:{get:function(){return o.uniforms.sigma},set:function(c){let u=o.uniforms,f=s.uniforms;u.sigma=f.sigma=c}},stepSize:{get:function(){return o.uniforms.stepSize},set:function(c){let u=o.uniforms,f=s.uniforms;u.stepSize=f.stepSize=c}}}),new kf({name:e,stages:[o,s],uniforms:a})}is.createBlurStage=function(){return foe("czm_blur")};is.createDepthOfFieldStage=function(){let e=foe("czm_depth_of_field_blur"),t=new zr({name:"czm_depth_of_field_composite",fragmentShader:p5,uniforms:{focalDistance:5,blurTexture:e.name}}),n={};return Object.defineProperties(n,{focalDistance:{get:function(){return t.uniforms.focalDistance},set:function(i){t.uniforms.focalDistance=i}},delta:{get:function(){return e.uniforms.delta},set:function(i){e.uniforms.delta=i}},sigma:{get:function(){return e.uniforms.sigma},set:function(i){e.uniforms.sigma=i}},stepSize:{get:function(){return e.uniforms.stepSize},set:function(i){e.uniforms.stepSize=i}}}),new kf({name:"czm_depth_of_field",stages:[e,t],inputPreviousStageTexture:!1,uniforms:n})};is.isDepthOfFieldSupported=function(e){return e.context.depthTexture};is.createEdgeDetectionStage=function(){let e=Kn();return new zr({name:`czm_edge_detection_${e}`,fragmentShader:_5,uniforms:{length:.25,color:z.clone(z.BLACK)}})};is.isEdgeDetectionSupported=function(e){return e.context.depthTexture};function ONt(e){if(!l(e))return is.createEdgeDetectionStage();let t=new kf({name:"czm_edge_detection_multiple",stages:e,inputPreviousStageTexture:!1}),n={},i="",r="";for(let a=0;a<e.length;++a)i+=`uniform sampler2D edgeTexture${a}; +${e}`}function Wwt(e,t){if(l(e._command)&&!e._logDepthChanged&&!e._selectedDirty)return;let n=e._fragmentShader;if(l(e._selectedIdTexture)){let r=e._selectedIdTexture.width;n=Gwt(n,r)}let i=new Xe({defines:[e._useLogDepth?"LOG_DEPTH":""],sources:[n]});e._command=t.createViewportQuadCommand(i,{uniformMap:e._uniformMap,owner:e})}function qwt(e){let t=e._sampleMode,n,i;t===Yd.LINEAR?(n=Wt.LINEAR,i=Jn.LINEAR):(n=Wt.NEAREST,i=Jn.NEAREST);let r=e._sampler;(!l(r)||r.minificationFilter!==n||r.magnificationFilter!==i)&&(e._sampler=new Ht({wrapS:hn.CLAMP_TO_EDGE,wrapT:hn.CLAMP_TO_EDGE,minificationFilter:n,magnificationFilter:i}))}function Ywt(e,t){return function(n){e._texturesToCreate.push({name:t,source:n})}}function Xwt(e,t){return function(){return e._textureCache.getOutputTexture(t)}}function Kwt(e,t){let n=e._texturesToRelease;for(let a=0;a<n.length;++a){let c=n[a];l(c)&&c.destroy()}n.length=0;let i=e._texturesToCreate;for(let a=0;a<i.length;++a){let{name:c,source:u}=i[a];e._actualUniforms[c]=new Dt({context:t,source:u})}i.length=0;let r=e._dirtyUniforms;if(r.length===0&&!l(e._texturePromise)){e._ready=!0;return}if(r.length===0||l(e._texturePromise))return;let o=e._uniforms,s=[];for(let a=0;a<r.length;++a){let c=r[a],u=o[c],f=e._textureCache.getStageByName(u);if(l(f))e._actualUniforms[c]=Xwt(e,u);else if(typeof u=="string"){let d=new De({url:u});s.push(d.fetchImage().then(Ywt(e,c)))}else e._texturesToCreate.push({name:c,source:u})}r.length=0,s.length>0?(e._ready=!1,e._texturePromise=Promise.all(s).then(function(){e._ready=!0,e._texturePromise=void 0})):e._ready=!0}function iIe(e){l(e._command)&&(e._command.shaderProgram=e._command.shaderProgram&&e._command.shaderProgram.destroy(),e._command=void 0),e._selectedIdTexture=e._selectedIdTexture&&e._selectedIdTexture.destroy();let t=e._textureCache;if(!l(t))return;let n=e._uniforms,i=e._actualUniforms;for(let r in i){if(!i.hasOwnProperty(r))continue;let o=i[r];o instanceof Dt&&(l(t.getStageByName(n[r]))||o.destroy(),e._dirtyUniforms.push(r))}}function $wt(e){let t=l(e._selected)?e._selected.length:0,n=l(e._parentSelected)?e._parentSelected:0,i=e._selected!==e._selectedShadow||t!==e._selectedLength||e._parentSelected!==e._parentSelectedShadow||n!==e._parentSelectedLength;if(l(e._selected)&&l(e._parentSelected)?e._combinedSelected=e._selected.concat(e._parentSelected):l(e._parentSelected)?e._combinedSelected=e._parentSelected:e._combinedSelected=e._selected,!i&&l(e._combinedSelected)){if(!l(e._combinedSelectedShadow))return!0;for(let r=0;r<e._combinedSelected.length;++r)if(e._combinedSelected[r]!==e._combinedSelectedShadow[r])return!0}return i}function Jwt(e,t){if(!e._selectedDirty)return;e._selectedIdTexture=e._selectedIdTexture&&e._selectedIdTexture.destroy(),e._selectedIdTexture=void 0;let n=e._combinedSelected;if(!l(n))return;let i=0;for(let c=0;c<n.length;++c){let u=n[c];l(u.pickIds)?i+=u.pickIds.length:l(u.pickId)&&++i}let r=Ut.maximumTextureSize;if(i>r&&(Wg._oneTimeWarning("postProcessStageSelectedTextureSize",`The number of selected feature ids (${i}) exceeds the maximum texture size (${r}). Features beyond the limit will not have the post-process effect applied.`),i=r),n.length===0||i===0){let c=new Uint8Array([255,255,255,255]);e._selectedIdTexture=new Dt({context:t,pixelFormat:$e.RGBA,pixelDatatype:ze.UNSIGNED_BYTE,source:{arrayBufferView:c,width:1,height:1},sampler:Ht.NEAREST});return}let o=0,s=i*4,a=new Uint8Array(s);for(let c=0;c<n.length&&o<s;++c){let u=n[c];if(l(u.pickIds)){let f=u.pickIds,d=f.length;for(let p=0;p<d&&o<s;++p){let g=f[p].color;a[o]=z.floatToByte(g.red),a[o+1]=z.floatToByte(g.green),a[o+2]=z.floatToByte(g.blue),a[o+3]=z.floatToByte(g.alpha),o+=4}}else if(l(u.pickId)){let f=u.pickId.color;a[o]=z.floatToByte(f.red),a[o+1]=z.floatToByte(f.green),a[o+2]=z.floatToByte(f.blue),a[o+3]=z.floatToByte(f.alpha),o+=4}}e._selectedIdTexture=new Dt({context:t,pixelFormat:$e.RGBA,pixelDatatype:ze.UNSIGNED_BYTE,source:{arrayBufferView:a,width:i,height:1},sampler:Ht.NEAREST})}Wg.prototype.update=function(e,t){if(this.enabled!==this._enabled&&!this.enabled&&iIe(this),this._enabled=this.enabled,!this._enabled||(this._logDepthChanged=t!==this._useLogDepth,this._useLogDepth=t,this._selectedDirty=$wt(this),this._selectedShadow=this._selected,this._parentSelectedShadow=this._parentSelected,this._combinedSelectedShadow=this._combinedSelected,this._selectedLength=l(this._selected)?this._selected.length:0,this._parentSelectedLength=l(this._parentSelected)?this._parentSelected.length:0,Jwt(this,e),Hwt(this),Kwt(this,e),Wwt(this,e),qwt(this),this._selectedDirty=!1,!this._ready))return;let n=this._textureCache.getFramebuffer(this._name);if(this._command.framebuffer=n,!l(n))return;let i=n.getColorTexture(0),r;(i.width!==e.drawingBufferWidth||i.height!==e.drawingBufferHeight)&&(r=this._renderState,(!l(r)||i.width!==r.viewport.width||i.height!==r.viewport.height)&&(this._renderState=Ge.fromCache({viewport:new et(0,0,i.width,i.height)}))),this._command.renderState=r};Wg.prototype.execute=function(e,t,n,i){if(!l(this._command)||!l(this._command.framebuffer)||!this._ready||!this._enabled)return;this._colorTexture=t,this._depthTexture=n,this._idTexture=i,Ht.equals(this._colorTexture.sampler,this._sampler)||(this._colorTexture.sampler=this._sampler);let r=this.scissorRectangle.width>0&&this.scissorRectangle.height>0?this._passState:void 0;l(r)&&(r.context=e),this._command.execute(e,r)};Wg.prototype.isDestroyed=function(){return!1};Wg.prototype.destroy=function(){return iIe(this),le(this)};Wg._oneTimeWarning=yt;var Ur=Wg;function hT(e){e=e??H.EMPTY_OBJECT,this._stages=e.stages,this._inputPreviousStageTexture=e.inputPreviousStageTexture??!0;let t=e.name;l(t)||(t=Kn()),this._name=t,this._uniforms=e.uniforms,this._textureCache=void 0,this._index=void 0,this._selected=void 0,this._selectedShadow=void 0,this._parentSelected=void 0,this._parentSelectedShadow=void 0,this._combinedSelected=void 0,this._combinedSelectedShadow=void 0,this._selectedLength=0,this._parentSelectedLength=0,this._selectedDirty=!0}Object.defineProperties(hT.prototype,{ready:{get:function(){let e=this._stages,t=e.length;for(let n=0;n<t;++n)if(!e[n].ready)return!1;return!0}},name:{get:function(){return this._name}},enabled:{get:function(){return this._stages[0].enabled},set:function(e){let t=this._stages,n=t.length;for(let i=0;i<n;++i)t[i].enabled=e}},uniforms:{get:function(){return this._uniforms}},inputPreviousStageTexture:{get:function(){return this._inputPreviousStageTexture}},length:{get:function(){return this._stages.length}},selected:{get:function(){return this._selected},set:function(e){this._selected=e}},parentSelected:{get:function(){return this._parentSelected},set:function(e){this._parentSelected=e}}});hT.prototype._isSupported=function(e){let t=this._stages,n=t.length;for(let i=0;i<n;++i)if(!t[i]._isSupported(e))return!1;return!0};hT.prototype.get=function(e){return this._stages[e]};function Zwt(e){let t=l(e._selected)?e._selected.length:0,n=l(e._parentSelected)?e._parentSelected:0,i=e._selected!==e._selectedShadow||t!==e._selectedLength;if(i=i||e._parentSelected!==e._parentSelectedShadow||n!==e._parentSelectedLength,l(e._selected)&&l(e._parentSelected)?e._combinedSelected=e._selected.concat(e._parentSelected):l(e._parentSelected)?e._combinedSelected=e._parentSelected:e._combinedSelected=e._selected,!i&&l(e._combinedSelected)){if(!l(e._combinedSelectedShadow))return!0;t=e._combinedSelected.length;for(let r=0;r<t;++r)if(e._combinedSelected[r]!==e._combinedSelectedShadow[r])return!0}return i}hT.prototype.update=function(e,t){this._selectedDirty=Zwt(this),this._selectedShadow=this._selected,this._parentSelectedShadow=this._parentSelected,this._combinedSelectedShadow=this._combinedSelected,this._selectedLength=l(this._selected)?this._selected.length:0,this._parentSelectedLength=l(this._parentSelected)?this._parentSelected.length:0;let n=this._stages,i=n.length;for(let r=0;r<i;++r){let o=n[r];this._selectedDirty&&(o.parentSelected=this._combinedSelected),o.update(e,t)}};hT.prototype.isDestroyed=function(){return!1};hT.prototype.destroy=function(){let e=this._stages,t=e.length;for(let n=0;n<t;++n)e[n].destroy();return le(this)};var Df=hT;var is={};function $te(e){let r=`#define USE_STEP_SIZE +${fT}`,o=new Ur({name:`${e}_x_direction`,fragmentShader:r,uniforms:{delta:1,sigma:2,stepSize:1,direction:0},sampleMode:Yd.LINEAR}),s=new Ur({name:`${e}_y_direction`,fragmentShader:r,uniforms:{delta:1,sigma:2,stepSize:1,direction:1},sampleMode:Yd.LINEAR}),a={};return Object.defineProperties(a,{delta:{get:function(){return o.uniforms.delta},set:function(c){let u=o.uniforms,f=s.uniforms;u.delta=f.delta=c}},sigma:{get:function(){return o.uniforms.sigma},set:function(c){let u=o.uniforms,f=s.uniforms;u.sigma=f.sigma=c}},stepSize:{get:function(){return o.uniforms.stepSize},set:function(c){let u=o.uniforms,f=s.uniforms;u.stepSize=f.stepSize=c}}}),new Df({name:e,stages:[o,s],uniforms:a})}is.createBlurStage=function(){return $te("czm_blur")};is.createDepthOfFieldStage=function(){let e=$te("czm_depth_of_field_blur"),t=new Ur({name:"czm_depth_of_field_composite",fragmentShader:tH,uniforms:{focalDistance:5,blurTexture:e.name}}),n={};return Object.defineProperties(n,{focalDistance:{get:function(){return t.uniforms.focalDistance},set:function(i){t.uniforms.focalDistance=i}},delta:{get:function(){return e.uniforms.delta},set:function(i){e.uniforms.delta=i}},sigma:{get:function(){return e.uniforms.sigma},set:function(i){e.uniforms.sigma=i}},stepSize:{get:function(){return e.uniforms.stepSize},set:function(i){e.uniforms.stepSize=i}}}),new Df({name:"czm_depth_of_field",stages:[e,t],inputPreviousStageTexture:!1,uniforms:n})};is.isDepthOfFieldSupported=function(e){return e.context.depthTexture};is.createEdgeDetectionStage=function(){let e=Kn();return new Ur({name:`czm_edge_detection_${e}`,fragmentShader:iH,uniforms:{length:.25,color:z.clone(z.BLACK)}})};is.isEdgeDetectionSupported=function(e){return e.context.depthTexture};function Qwt(e){if(!l(e))return is.createEdgeDetectionStage();let t=new Df({name:"czm_edge_detection_multiple",stages:e,inputPreviousStageTexture:!1}),n={},i="",r="";for(let a=0;a<e.length;++a)i+=`uniform sampler2D edgeTexture${a}; `,r+=` vec4 edge${a} = texture(edgeTexture${a}, v_textureCoordinates); if (edge${a}.a > 0.0) { @@ -11216,14 +11216,14 @@ void main() { ${r} } out_FragColor = color; } -`,s=new zr({name:"czm_edge_detection_combine",fragmentShader:o,uniforms:n});return new kf({name:"czm_edge_detection_composite",stages:[t,s]})}is.createSilhouetteStage=function(e){let t=ONt(e),n=new zr({name:"czm_silhouette_color_edges",fragmentShader:v5,uniforms:{silhouetteTexture:t.name}});return new kf({name:"czm_silhouette",stages:[t,n],inputPreviousStageTexture:!1,uniforms:t.uniforms})};is.isSilhouetteSupported=function(e){return e.context.depthTexture};is.createBloomStage=function(){let e=new zr({name:"czm_bloom_contrast_bias",fragmentShader:m5,uniforms:{contrast:128,brightness:-.3}}),t=foe("czm_bloom_blur"),n=new kf({name:"czm_bloom_contrast_bias_blur",stages:[e,t]}),i=new zr({name:"czm_bloom_generate_composite",fragmentShader:d5,uniforms:{glowOnly:!1,bloomTexture:n.name}}),r={};return Object.defineProperties(r,{glowOnly:{get:function(){return i.uniforms.glowOnly},set:function(o){i.uniforms.glowOnly=o}},contrast:{get:function(){return e.uniforms.contrast},set:function(o){e.uniforms.contrast=o}},brightness:{get:function(){return e.uniforms.brightness},set:function(o){e.uniforms.brightness=o}},delta:{get:function(){return t.uniforms.delta},set:function(o){t.uniforms.delta=o}},sigma:{get:function(){return t.uniforms.sigma},set:function(o){t.uniforms.sigma=o}},stepSize:{get:function(){return t.uniforms.stepSize},set:function(o){t.uniforms.stepSize=o}}}),new kf({name:"czm_bloom",stages:[n,i],inputPreviousStageTexture:!1,uniforms:r})};is.createAmbientOcclusionStage=function(){let e=new zr({name:"czm_ambient_occlusion_generate",fragmentShader:l5,uniforms:{intensity:3,bias:.1,lengthCap:.26,directionCount:8,stepCount:32,randomTexture:void 0}}),t=new zr({name:"czm_ambient_occlusion_composite",fragmentShader:u5,uniforms:{ambientOcclusionOnly:!1,ambientOcclusionTexture:e.name}}),n={};return Object.defineProperties(n,{intensity:{get:function(){return e.uniforms.intensity},set:function(i){e.uniforms.intensity=i}},bias:{get:function(){return e.uniforms.bias},set:function(i){e.uniforms.bias=i}},lengthCap:{get:function(){return e.uniforms.lengthCap},set:function(i){e.uniforms.lengthCap=i}},directionCount:{get:function(){return e.uniforms.directionCount},set:function(i){e.uniforms.directionCount=i}},stepCount:{get:function(){return e.uniforms.stepCount},set:function(i){e.uniforms.stepCount=i}},randomTexture:{get:function(){return e.uniforms.randomTexture},set:function(i){e.uniforms.randomTexture=i}},ambientOcclusionOnly:{get:function(){return t.uniforms.ambientOcclusionOnly},set:function(i){t.uniforms.ambientOcclusionOnly=i}}}),new kf({name:"czm_ambient_occlusion",stages:[e,t],inputPreviousStageTexture:!1,uniforms:n})};is.isAmbientOcclusionSupported=function(e){return e.context.depthTexture};var MNt=`#define FXAA_QUALITY_PRESET 39 +`,s=new Ur({name:"czm_edge_detection_combine",fragmentShader:o,uniforms:n});return new Df({name:"czm_edge_detection_composite",stages:[t,s]})}is.createSilhouetteStage=function(e){let t=Qwt(e),n=new Ur({name:"czm_silhouette_color_edges",fragmentShader:fH,uniforms:{silhouetteTexture:t.name}});return new Df({name:"czm_silhouette",stages:[t,n],inputPreviousStageTexture:!1,uniforms:t.uniforms})};is.isSilhouetteSupported=function(e){return e.context.depthTexture};is.createBloomStage=function(){let e=new Ur({name:"czm_bloom_contrast_bias",fragmentShader:eH,uniforms:{contrast:128,brightness:-.3}}),t=$te("czm_bloom_blur"),n=new Df({name:"czm_bloom_contrast_bias_blur",stages:[e,t]}),i=new Ur({name:"czm_bloom_generate_composite",fragmentShader:Z6,uniforms:{glowOnly:!1,bloomTexture:n.name}}),r={};return Object.defineProperties(r,{glowOnly:{get:function(){return i.uniforms.glowOnly},set:function(o){i.uniforms.glowOnly=o}},contrast:{get:function(){return e.uniforms.contrast},set:function(o){e.uniforms.contrast=o}},brightness:{get:function(){return e.uniforms.brightness},set:function(o){e.uniforms.brightness=o}},delta:{get:function(){return t.uniforms.delta},set:function(o){t.uniforms.delta=o}},sigma:{get:function(){return t.uniforms.sigma},set:function(o){t.uniforms.sigma=o}},stepSize:{get:function(){return t.uniforms.stepSize},set:function(o){t.uniforms.stepSize=o}}}),new Df({name:"czm_bloom",stages:[n,i],inputPreviousStageTexture:!1,uniforms:r})};is.createAmbientOcclusionStage=function(){let e=new Ur({name:"czm_ambient_occlusion_generate",fragmentShader:K6,uniforms:{intensity:3,bias:.1,lengthCap:.26,directionCount:8,stepCount:32,randomTexture:void 0}}),t=new Ur({name:"czm_ambient_occlusion_composite",fragmentShader:$6,uniforms:{ambientOcclusionOnly:!1,ambientOcclusionTexture:e.name}}),n={};return Object.defineProperties(n,{intensity:{get:function(){return e.uniforms.intensity},set:function(i){e.uniforms.intensity=i}},bias:{get:function(){return e.uniforms.bias},set:function(i){e.uniforms.bias=i}},lengthCap:{get:function(){return e.uniforms.lengthCap},set:function(i){e.uniforms.lengthCap=i}},directionCount:{get:function(){return e.uniforms.directionCount},set:function(i){e.uniforms.directionCount=i}},stepCount:{get:function(){return e.uniforms.stepCount},set:function(i){e.uniforms.stepCount=i}},randomTexture:{get:function(){return e.uniforms.randomTexture},set:function(i){e.uniforms.randomTexture=i}},ambientOcclusionOnly:{get:function(){return t.uniforms.ambientOcclusionOnly},set:function(i){t.uniforms.ambientOcclusionOnly=i}}}),new Df({name:"czm_ambient_occlusion",stages:[e,t],inputPreviousStageTexture:!1,uniforms:n})};is.isAmbientOcclusionSupported=function(e){return e.context.depthTexture};var eIt=`#define FXAA_QUALITY_PRESET 39 ${L2} -${b5}`;is.createFXAAStage=function(){return new zr({name:"czm_FXAA",fragmentShader:MNt,sampleMode:Zd.LINEAR})};is.createAcesTonemappingStage=function(e){let t=e?`#define AUTO_EXPOSURE -`:"";return t+=c5,new zr({name:"czm_aces",fragmentShader:t,uniforms:{autoExposure:void 0,exposure:1}})};is.createFilmicTonemappingStage=function(e){let t=e?`#define AUTO_EXPOSURE -`:"";return t+=y5,new zr({name:"czm_filmic",fragmentShader:t,uniforms:{autoExposure:void 0,exposure:1}})};is.createPbrNeutralTonemappingStage=function(e){let t=e?`#define AUTO_EXPOSURE -`:"";return t+=A5,new zr({name:"czm_pbr_neutral",fragmentShader:t,uniforms:{autoExposure:void 0,exposure:1}})};is.createReinhardTonemappingStage=function(e){let t=e?`#define AUTO_EXPOSURE -`:"";return t+=C5,new zr({name:"czm_reinhard",fragmentShader:t,uniforms:{autoExposure:void 0,exposure:1}})};is.createModifiedReinhardTonemappingStage=function(e){let t=e?`#define AUTO_EXPOSURE -`:"";return t+=T5,new zr({name:"czm_modified_reinhard",fragmentShader:t,uniforms:{white:z.WHITE,autoExposure:void 0,exposure:1}})};is.createAutoExposureStage=function(){return new S5};is.createBlackAndWhiteStage=function(){return new zr({name:"czm_black_and_white",fragmentShader:f5,uniforms:{gradations:5}})};is.createBrightnessStage=function(){return new zr({name:"czm_brightness",fragmentShader:h5,uniforms:{brightness:.5}})};is.createNightVisionStage=function(){return new zr({name:"czm_night_vision",fragmentShader:E5})};is.createDepthViewStage=function(){return new zr({name:"czm_depth_view",fragmentShader:g5})};is.createLensFlareStage=function(){return new zr({name:"czm_lens_flare",fragmentShader:x5,uniforms:{dirtTexture:Zt("Assets/Textures/LensFlare/DirtMask.jpg"),starTexture:Zt("Assets/Textures/LensFlare/StarBurst.jpg"),intensity:2,distortion:10,ghostDispersal:.4,haloWidth:.4,dirtAmount:.4,earthRadius:ee.WGS84.maximumRadius}})};var Qd=is;function s_(e){this._collection=e,this._framebuffers=[],this._stageNameToFramebuffer={},this._width=void 0,this._height=void 0,this._updateDependencies=!1}function eM(e){for(;l(e.length);)e=e.get(e.length-1);return e.name}function doe(e,t,n,i,r){if(!i.enabled||!i._isSupported(t))return r;let o=n[i.name]={};if(l(r)){let a=e.getStageByName(r);o[eM(a)]=!0}let s=i.uniforms;if(l(s)){let a=Object.getOwnPropertyNames(s),c=a.length;for(let u=0;u<c;++u){let f=s[a[u]];if(typeof f=="string"){let d=e.getStageByName(f);l(d)&&(o[eM(d)]=!0)}}}return i.name}function QO(e,t,n,i,r){if(l(i.enabled)&&!i.enabled||l(i._isSupported)&&!i._isSupported(t))return r;let o=r,s=!l(i.inputPreviousStageTexture)||i.inputPreviousStageTexture,a=r,c=i.length;for(let d=0;d<c;++d){let p=i.get(d);l(p.length)?a=QO(e,t,n,p,r):a=doe(e,t,n,p,r),s&&(r=a)}let u,f;if(s)for(u=1;u<c;++u)f=eM(i.get(u)),l(n[f])||(n[f]={}),n[f][o]=!0;else for(u=1;u<c;++u){f=eM(i.get(u));let d=n[f];for(let p=0;p<u;++p)d[eM(i.get(p))]=!0}return a}function NNt(e,t){let n={};if(l(e.ambientOcclusion)){let i=e.ambientOcclusion,r=e.bloom,o=e._tonemapping,s=e.fxaa,a=QO(e,t,n,i,void 0);a=QO(e,t,n,r,a),a=doe(e,t,n,o,a),a=QO(e,t,n,e,a),doe(e,t,n,s,a)}else QO(e,t,n,e,void 0);return n}function LNt(e,t,n){let r=e._collection.getStageByName(t),o=r._textureScale,s=r._forcePowerOfTwo,a=r._pixelFormat,c=r._pixelDatatype,u=r._clearColor,f,d,p=e._framebuffers,g=p.length;for(f=0;f<g;++f){if(d=p[f],o!==d.textureScale||s!==d.forcePowerOfTwo||a!==d.pixelFormat||c!==d.pixelDatatype||!z.equals(u,d.clearColor))continue;let m=d.stages,y=m.length,A=!1;for(let b=0;b<y;++b)if(n[m[b]]){A=!0;break}if(!A)break}return l(d)&&f<g?(d.stages.push(t),d):(d={textureScale:o,forcePowerOfTwo:s,pixelFormat:a,pixelDatatype:c,clearColor:u,stages:[t],buffer:new ci({pixelFormat:a,pixelDatatype:c}),clear:void 0},p.push(d),d)}function FNt(e,t){let n=NNt(e._collection,t);for(let i in n)n.hasOwnProperty(i)&&(e._stageNameToFramebuffer[i]=LNt(e,i,n[i]))}function hoe(e){let t=e._framebuffers,n=t.length;for(let i=0;i<n;++i)t[i].buffer.destroy()}function BNt(e,t){let n=e._width,i=e._height,r=e._framebuffers,o=r.length;for(let s=0;s<o;++s){let a=r[s],c=a.textureScale,u=Math.ceil(n*c),f=Math.ceil(i*c),d=Math.min(u,f);a.forcePowerOfTwo&&(P.isPowerOfTwo(d)||(d=P.nextPowerOfTwo(d)),u=d,f=d),a.buffer.update(t,u,f),a.clear=new fi({color:a.clearColor,framebuffer:a.buffer.framebuffer})}}s_.prototype.updateDependencies=function(){this._updateDependencies=!0};s_.prototype.update=function(e){let t=this._collection,n=this._updateDependencies,i=l(t.ambientOcclusion)&&t.ambientOcclusion.enabled&&t.ambientOcclusion._isSupported(e),r=l(t.bloom)&&t.bloom.enabled&&t.bloom._isSupported(e),o=l(t._tonemapping)&&t._tonemapping.enabled&&t._tonemapping._isSupported(e),s=l(t.fxaa)&&t.fxaa.enabled&&t.fxaa._isSupported(e),a=!l(t._activeStages)||t._activeStages.length>0||i||r||o||s;if((n||!a&&this._framebuffers.length>0)&&(hoe(this),this._framebuffers.length=0,this._stageNameToFramebuffer={},this._width=void 0,this._height=void 0),!n&&!a)return;this._framebuffers.length===0&&FNt(this,e);let c=e.drawingBufferWidth,u=e.drawingBufferHeight,f=this._width!==c||this._height!==u;!n&&!f||(this._width=c,this._height=u,this._updateDependencies=!1,hoe(this),BNt(this,e))};s_.prototype.clear=function(e){let t=this._framebuffers;for(let n=0;n<t.length;++n)t[n].clear.execute(e)};s_.prototype.getStageByName=function(e){return this._collection.getStageByName(e)};s_.prototype.getOutputTexture=function(e){return this._collection.getOutputTexture(e)};s_.prototype.getFramebuffer=function(e){let t=this._stageNameToFramebuffer[e];if(l(t))return t.buffer.framebuffer};s_.prototype.isDestroyed=function(){return!1};s_.prototype.destroy=function(){return hoe(this),le(this)};var $w=s_;var eMe={REINHARD:"REINHARD",MODIFIED_REINHARD:"MODIFIED_REINHARD",FILMIC:"FILMIC",ACES:"ACES",PBR_NEUTRAL:"PBR_NEUTRAL"};Object.freeze(eMe);var qA=eMe;var moe=[];function Kl(){let e=Qd.createFXAAStage(),t=Qd.createAmbientOcclusionStage(),n=Qd.createBloomStage();this._autoExposureEnabled=!1,this._autoExposure=Qd.createAutoExposureStage(),this._exposure=1,this._tonemapping=void 0,this._tonemapper=void 0,this.tonemapper=qA.PBR_NEUTRAL;let i=this._tonemapping;e.enabled=!1,t.enabled=!1,n.enabled=!1,i.enabled=!1;let r=new $w(this),o={},s=moe;for(s.push(e,t,n,i);s.length>0;){let c=s.pop();o[c.name]=c,c._textureCache=r;let u=c.length;if(l(u))for(let f=0;f<u;++f)s.push(c.get(f))}this._stages=[],this._activeStages=[],this._previousActiveStages=[],this._randomTexture=void 0;let a=this;t.uniforms.randomTexture=function(){return a._randomTexture},this._ao=t,this._bloom=n,this._fxaa=e,this._aoEnabled=void 0,this._bloomEnabled=void 0,this._tonemappingEnabled=void 0,this._fxaaEnabled=void 0,this._activeStagesChanged=!1,this._stagesRemoved=!1,this._textureCacheDirty=!1,this._stageNames=o,this._textureCache=r}Object.defineProperties(Kl.prototype,{ready:{get:function(){let e=!1,t=this._stages,n=t.length;for(let a=n-1;a>=0;--a){let c=t[a];e=e||c.ready&&c.enabled}let i=this._fxaa,r=this._ao,o=this._bloom,s=this._tonemapping;return e=e||i.ready&&i.enabled,e=e||r.ready&&r.enabled,e=e||o.ready&&o.enabled,e=e||s.ready&&s.enabled,e}},fxaa:{get:function(){return this._fxaa}},ambientOcclusion:{get:function(){return this._ao}},bloom:{get:function(){return this._bloom}},length:{get:function(){return poe(this),this._stages.length}},outputTexture:{get:function(){let e=this._fxaa;if(e.enabled&&e.ready)return this.getOutputTexture(e.name);let t=this._stages,n=t.length;for(let s=n-1;s>=0;--s){let a=t[s];if(l(a)&&a.ready&&a.enabled)return this.getOutputTexture(a.name)}let i=this._tonemapping;if(i.enabled&&i.ready)return this.getOutputTexture(i.name);let r=this._bloom;if(r.enabled&&r.ready)return this.getOutputTexture(r.name);let o=this._ao;if(o.enabled&&o.ready)return this.getOutputTexture(o.name)}},hasSelected:{get:function(){let e=this._stages.slice();for(;e.length>0;){let t=e.pop();if(!l(t))continue;if(l(t.selected))return!0;let n=t.length;if(l(n))for(let i=0;i<n;++i)e.push(t.get(i))}return!1}},tonemapper:{get:function(){return this._tonemapper},set:function(e){if(this._tonemapper===e)return;l(this._tonemapping)&&(delete this._stageNames[this._tonemapping.name],this._tonemapping.destroy());let t=this._autoExposureEnabled,n;switch(e){case qA.REINHARD:n=Qd.createReinhardTonemappingStage(t);break;case qA.MODIFIED_REINHARD:n=Qd.createModifiedReinhardTonemappingStage(t);break;case qA.FILMIC:n=Qd.createFilmicTonemappingStage(t);break;case qA.PBR_NEUTRAL:n=Qd.createPbrNeutralTonemappingStage(t);break;default:n=Qd.createAcesTonemappingStage(t);break}if(t){let i=this._autoExposure;n.uniforms.autoExposure=function(){return i.outputTexture}}else n.uniforms.exposure=this._exposure;this._tonemapper=e,this._tonemapping=n,l(this._stageNames)&&(this._stageNames[n.name]=n,n._textureCache=this._textureCache),this._textureCacheDirty=!0}},exposure:{get:function(){return this._exposure},set:function(e){this._tonemapping.uniforms.exposure=e,this._exposure=e}}});function poe(e){if(!e._stagesRemoved)return;e._stagesRemoved=!1;let t=[],n=e._stages;for(let i=0,r=0;i<n.length;++i){let o=n[i];o&&(o._index=r++,t.push(o))}e._stages=t}Kl.prototype.add=function(e){let t=this._stageNames,n=moe;for(n.push(e);n.length>0;){let r=n.pop();t[r.name]=r,r._textureCache=this._textureCache;let o=r.length;if(l(o))for(let s=0;s<o;++s)n.push(r.get(s))}let i=this._stages;return e._index=i.length,i.push(e),this._textureCacheDirty=!0,e};Kl.prototype.remove=function(e){if(!this.contains(e))return!1;let t=this._stageNames,n=moe;for(n.push(e);n.length>0;){let i=n.pop();delete t[i.name];let r=i.length;if(l(r))for(let o=0;o<r;++o)n.push(i.get(o))}return this._stages[e._index]=void 0,this._stagesRemoved=!0,this._textureCacheDirty=!0,e._index=void 0,e._textureCache=void 0,e.destroy(),!0};Kl.prototype.contains=function(e){return l(e)&&l(e._index)&&e._textureCache===this._textureCache};Kl.prototype.get=function(e){return poe(this),this._stages[e]};Kl.prototype.removeAll=function(){let e=this._stages,t=e.length;for(let n=0;n<t;++n)this.remove(e[n]);e.length=0};Kl.prototype.getStageByName=function(e){return this._stageNames[e]};Kl.prototype.update=function(e,t,n){poe(this);let i=this._activeStages,r=this._activeStages=this._previousActiveStages;this._previousActiveStages=i;let o=this._stages;r.length=o.length;let s=0;for(let b=0;b<o.length;++b){let x=o[b];x.ready&&x.enabled&&x._isSupported(e)&&(r[s++]=x)}r.length=s;let a=s!==i.length;if(!a){for(let b=0;b<s;++b)if(r[b]!==i[b]){a=!0;break}}let c=this._ao,u=this._bloom,f=this._autoExposure,d=this._tonemapping,p=this._fxaa;d.enabled=n;let g=c.enabled&&c._isSupported(e),m=u.enabled&&u._isSupported(e),y=d.enabled&&d._isSupported(e),A=p.enabled&&p._isSupported(e);if((a||this._textureCacheDirty||g!==this._aoEnabled||m!==this._bloomEnabled||y!==this._tonemappingEnabled||A!==this._fxaaEnabled)&&(this._textureCache.updateDependencies(),this._aoEnabled=g,this._bloomEnabled=m,this._tonemappingEnabled=y,this._fxaaEnabled=A,this._textureCacheDirty=!1),l(this._randomTexture)&&!g&&(this._randomTexture.destroy(),this._randomTexture=void 0),!l(this._randomTexture)&&g){let x=new Uint8Array(196608);for(let T=0;T<196608;T+=3)x[T]=Math.floor(Math.random()*255);this._randomTexture=new Dt({context:e,pixelFormat:$e.RGB,pixelDatatype:ze.UNSIGNED_BYTE,source:{arrayBufferView:x,width:256,height:256},sampler:new Ht({wrapS:hn.REPEAT,wrapT:hn.REPEAT,minificationFilter:Wt.NEAREST,magnificationFilter:Jn.NEAREST})})}this._textureCache.update(e),p.update(e,t),c.update(e,t),u.update(e,t),d.update(e,t),this._autoExposureEnabled&&f.update(e,t);for(let b=0;b<o.length;++b)o[b].update(e,t);s=0;for(let b=0;b<o.length;++b){let x=o[b];x.ready&&x.enabled&&x._isSupported(e)&&s++}a=s!==r.length,a&&this.update(e,t,n)};Kl.prototype.clear=function(e){this._textureCache.clear(e),this._autoExposureEnabled&&this._autoExposure.clear(e)};function jT(e){for(;l(e.length);)e=e.get(e.length-1);return e.outputTexture}Kl.prototype.getOutputTexture=function(e){let t=this.getStageByName(e);if(l(t))return jT(t)};function m0(e,t,n,i,r){if(l(e.execute)){e.execute(t,n,i,r);return}if(e.inputPreviousStageTexture){m0(e.get(0),t,n,i,r);for(let o=1;o<e.length;++o)m0(e.get(o),t,jT(e.get(o-1)),i,r)}else for(let o=0;o<e.length;++o)m0(e.get(o),t,n,i,r)}Kl.prototype.execute=function(e,t,n,i){let r=this._activeStages,o=r.length,s=this._fxaa,a=this._ao,c=this._bloom,u=this._autoExposure,f=this._tonemapping,d=a.enabled&&a._isSupported(e),p=c.enabled&&c._isSupported(e),g=this._autoExposureEnabled,m=f.enabled&&f._isSupported(e),y=s.enabled&&s._isSupported(e);if(!y&&!d&&!p&&!m&&o===0)return;let A=t;d&&a.ready&&(m0(a,e,A,n,i),A=jT(a)),p&&c.ready&&(m0(c,e,A,n,i),A=jT(c)),g&&u.ready&&m0(u,e,A,n,i),m&&f.ready&&(m0(f,e,A,n,i),A=jT(f));let b=A;if(o>0){m0(r[0],e,A,n,i);for(let x=1;x<o;++x)m0(r[x],e,jT(r[x-1]),n,i);b=jT(r[o-1])}y&&s.ready&&m0(s,e,b,n,i)};Kl.prototype.copy=function(e,t){if(!l(this._copyColorCommand)){let n=this;this._copyColorCommand=e.createViewportQuadCommand(Bf,{uniformMap:{colorTexture:function(){return n.outputTexture}},owner:this})}this._copyColorCommand.framebuffer=t,this._copyColorCommand.execute(e)};Kl.prototype.isDestroyed=function(){return!1};Kl.prototype.destroy=function(){return this._fxaa.destroy(),this._ao.destroy(),this._bloom.destroy(),this._autoExposure.destroy(),this._tonemapping.destroy(),this.removeAll(),this._textureCache=this._textureCache&&this._textureCache.destroy(),le(this)};var w5=Kl;var tMe={SHIFT:0,CTRL:1,ALT:2};Object.freeze(tMe);var oo=tMe;var nMe={LEFT_DOWN:0,LEFT_UP:1,LEFT_CLICK:2,LEFT_DOUBLE_CLICK:3,RIGHT_DOWN:5,RIGHT_UP:6,RIGHT_CLICK:7,MIDDLE_DOWN:10,MIDDLE_UP:11,MIDDLE_CLICK:12,MOUSE_MOVE:15,WHEEL:16,PINCH_START:17,PINCH_END:18,PINCH_MOVE:19};Object.freeze(nMe);var fn=nMe;function YA(e,t,n){let i=e._element;if(i===document)return n.x=t.clientX,n.y=t.clientY,n;let r=i.getBoundingClientRect();return n.x=t.clientX-r.left,n.y=t.clientY-r.top,n}function xoe(e,t){if(!l(t))return`${e}`;let n=Array.isArray(t)?t.toSorted():[t];return`${e}+${n.join("+")}`}function HT(e){let t=[];if(e.shiftKey&&t.push(oo.SHIFT),e.ctrlKey&&t.push(oo.CTRL),e.altKey&&t.push(oo.ALT),t.length)return t}var xs={LEFT:0,MIDDLE:1,RIGHT:2};function Uf(e,t,n,i){function r(o){i(e,o)}n.addEventListener(t,r,{capture:!1,passive:!1}),e._removalFunctions.push(function(){n.removeEventListener(t,r,!1)})}function kNt(e){let t=e._element,n=l(t.disableRootEvents)?t:document;dn.supportsPointerEvents()?(Uf(e,"pointerdown",t,GNt),Uf(e,"pointerup",t,dMe),Uf(e,"pointermove",t,WNt),Uf(e,"pointercancel",t,dMe)):(Uf(e,"mousedown",t,hMe),Uf(e,"mouseup",n,mMe),Uf(e,"mousemove",n,pMe),Uf(e,"touchstart",t,jNt),Uf(e,"touchend",n,aMe),Uf(e,"touchmove",n,HNt),Uf(e,"touchcancel",n,aMe)),Uf(e,"dblclick",t,zNt);let i;"onwheel"in t?i="wheel":document.onmousewheel!==void 0?i="mousewheel":i="DOMMouseScroll",Uf(e,i,t,VNt)}function UNt(e){let t=e._removalFunctions;for(let n=0;n<t.length;++n)t[n]()}var iMe={position:new U};function Toe(e){e._lastSeenTouchEvent=xn()}function Eoe(e){return xn()-e._lastSeenTouchEvent>xm.mouseEmulationIgnoreMilliseconds}function boe(e,t,n){let i=e.x-t.x,r=e.y-t.y;return Math.sqrt(i*i+r*r)<n}function hMe(e,t){if(!Eoe(e))return;let n=t.button;e._buttonDown[n]=!0;let i;if(n===xs.LEFT)i=fn.LEFT_DOWN;else if(n===xs.MIDDLE)i=fn.MIDDLE_DOWN;else if(n===xs.RIGHT)i=fn.RIGHT_DOWN;else return;let r=YA(e,t,e._primaryPosition);U.clone(r,e._primaryStartPosition),U.clone(r,e._primaryPreviousPosition);let o=HT(t),s=e.getInputAction(i,o);l(s)&&(U.clone(r,iMe.position),s(iMe),t.preventDefault())}var rMe={position:new U},oMe={position:new U};function goe(e,t,n,i){let r=HT(i),o=e.getInputAction(t,r),s=e.getInputAction(n,r);if(l(o)||l(s)){let a=YA(e,i,e._primaryPosition);if(l(o)&&(U.clone(a,rMe.position),o(rMe)),l(s)){let c=e._primaryStartPosition;boe(c,a,e._clickPixelTolerance)&&(U.clone(a,oMe.position),s(oMe))}}}function mMe(e,t){if(!Eoe(e))return;let n=t.button;n!==xs.LEFT&&n!==xs.MIDDLE&&n!==xs.RIGHT||(e._buttonDown[xs.LEFT]&&(goe(e,fn.LEFT_UP,fn.LEFT_CLICK,t),e._buttonDown[xs.LEFT]=!1),e._buttonDown[xs.MIDDLE]&&(goe(e,fn.MIDDLE_UP,fn.MIDDLE_CLICK,t),e._buttonDown[xs.MIDDLE]=!1),e._buttonDown[xs.RIGHT]&&(goe(e,fn.RIGHT_UP,fn.RIGHT_CLICK,t),e._buttonDown[xs.RIGHT]=!1))}var _oe={startPosition:new U,endPosition:new U};function pMe(e,t){if(!Eoe(e))return;let n=HT(t),i=YA(e,t,e._primaryPosition),r=e._primaryPreviousPosition,o=e.getInputAction(fn.MOUSE_MOVE,n);l(o)&&(U.clone(r,_oe.startPosition),U.clone(i,_oe.endPosition),o(_oe)),U.clone(i,r),(e._buttonDown[xs.LEFT]||e._buttonDown[xs.MIDDLE]||e._buttonDown[xs.RIGHT])&&t.preventDefault()}var sMe={position:new U};function zNt(e,t){let n=t.button,i;if(n===xs.LEFT)i=fn.LEFT_DOUBLE_CLICK;else return;let r=HT(t),o=e.getInputAction(i,r);l(o)&&(YA(e,t,sMe.position),o(sMe))}function VNt(e,t){let n;if(l(t.deltaY)){let o=t.deltaMode;o===t.DOM_DELTA_PIXEL?n=-t.deltaY:o===t.DOM_DELTA_LINE?n=-t.deltaY*40:n=-t.deltaY*120}else t.detail>0?n=t.detail*-120:n=t.wheelDelta;if(!l(n))return;let i=HT(t),r=e.getInputAction(fn.WHEEL,i);l(r)&&(r(n),t.preventDefault())}function jNt(e,t){Toe(e);let n=t.changedTouches,i,r=n.length,o,s,a=e._positions;for(i=0;i<r;++i)o=n[i],s=o.identifier,a.set(s,YA(e,o,new U));I5(e,t);let c=e._previousPositions;for(i=0;i<r;++i)o=n[i],s=o.identifier,c.set(s,U.clone(a.get(s)))}function aMe(e,t){Toe(e);let n=t.changedTouches,i,r=n.length,o,s,a=e._positions;for(i=0;i<r;++i)o=n[i],s=o.identifier,a.remove(s);I5(e,t);let c=e._previousPositions;for(i=0;i<r;++i)o=n[i],s=o.identifier,c.remove(s)}var cMe={position:new U},yoe={position1:new U,position2:new U},lMe={position:new U},uMe={position:new U},fMe={position:new U};function I5(e,t){let n=HT(t),i=e._positions,r=i.length,o,s,a=e._isPinching;if(r!==1&&e._buttonDown[xs.LEFT]){if(e._buttonDown[xs.LEFT]=!1,l(e._touchHoldTimer)&&(clearTimeout(e._touchHoldTimer),e._touchHoldTimer=void 0),o=e.getInputAction(fn.LEFT_UP,n),l(o)&&(U.clone(e._primaryPosition,lMe.position),o(lMe)),r===0&&!e._isTouchHolding&&(s=e.getInputAction(fn.LEFT_CLICK,n),l(s))){let c=e._primaryStartPosition,u=e._previousPositions.values[0];boe(c,u,e._clickPixelTolerance)&&(U.clone(e._primaryPosition,uMe.position),s(uMe))}e._isTouchHolding=!1}if(r===0&&a&&(e._isPinching=!1,o=e.getInputAction(fn.PINCH_END,n),l(o)&&o()),r===1&&!a){let c=i.values[0];U.clone(c,e._primaryPosition),U.clone(c,e._primaryStartPosition),U.clone(c,e._primaryPreviousPosition),e._buttonDown[xs.LEFT]=!0,o=e.getInputAction(fn.LEFT_DOWN,n),l(o)&&(U.clone(c,cMe.position),o(cMe)),e._touchHoldTimer=setTimeout(function(){if(!e.isDestroyed()&&(e._touchHoldTimer=void 0,e._isTouchHolding=!0,s=e.getInputAction(fn.RIGHT_CLICK,n),l(s))){let u=e._primaryStartPosition,f=e._previousPositions.values[0];boe(u,f,e._holdPixelTolerance)&&(U.clone(e._primaryPosition,fMe.position),s(fMe))}},xm.touchHoldDelayMilliseconds),t.preventDefault()}r===2&&!a&&(e._isPinching=!0,o=e.getInputAction(fn.PINCH_START,n),l(o)&&(U.clone(i.values[0],yoe.position1),U.clone(i.values[1],yoe.position2),o(yoe),t.preventDefault()))}function HNt(e,t){Toe(e);let n=t.changedTouches,i,r=n.length,o,s,a=e._positions;for(i=0;i<r;++i){o=n[i],s=o.identifier;let u=a.get(s);l(u)&&YA(e,o,u)}gMe(e,t);let c=e._previousPositions;for(i=0;i<r;++i)o=n[i],s=o.identifier,U.clone(a.get(s),c.get(s))}var Aoe={startPosition:new U,endPosition:new U},tM={distance:{startPosition:new U,endPosition:new U},angleAndHeight:{startPosition:new U,endPosition:new U}};function gMe(e,t){let n=HT(t),i=e._positions,r=e._previousPositions,o=i.length,s;if(o===1&&e._buttonDown[xs.LEFT]){let a=i.values[0];U.clone(a,e._primaryPosition);let c=e._primaryPreviousPosition;s=e.getInputAction(fn.MOUSE_MOVE,n),l(s)&&(U.clone(c,Aoe.startPosition),U.clone(a,Aoe.endPosition),s(Aoe)),U.clone(a,c),t.preventDefault()}else if(o===2&&e._isPinching&&(s=e.getInputAction(fn.PINCH_MOVE,n),l(s))){let a=i.values[0],c=i.values[1],u=r.values[0],f=r.values[1],d=c.x-a.x,p=c.y-a.y,g=Math.sqrt(d*d+p*p)*.25,m=f.x-u.x,y=f.y-u.y,A=Math.sqrt(m*m+y*y)*.25,b=(c.y+a.y)*.125,x=(f.y+u.y)*.125,T=Math.atan2(p,d),E=Math.atan2(y,m);U.fromElements(0,A,tM.distance.startPosition),U.fromElements(0,g,tM.distance.endPosition),U.fromElements(E,x,tM.angleAndHeight.startPosition),U.fromElements(T,b,tM.angleAndHeight.endPosition),s(tM)}}function GNt(e,t){if(t.target.setPointerCapture(t.pointerId),t.pointerType==="touch"){let n=e._positions,i=t.pointerId;n.set(i,YA(e,t,new U)),I5(e,t),e._previousPositions.set(i,U.clone(n.get(i)))}else hMe(e,t)}function dMe(e,t){if(t.pointerType==="touch"){let n=e._positions,i=t.pointerId;n.remove(i),I5(e,t),e._previousPositions.remove(i)}else mMe(e,t)}function WNt(e,t){if(t.pointerType==="touch"){let n=e._positions,i=t.pointerId,r=n.get(i);if(!l(r))return;YA(e,t,r),gMe(e,t);let o=e._previousPositions;U.clone(n.get(i),o.get(i))}else pMe(e,t)}function xm(e){this._inputEvents={},this._buttonDown={[xs.LEFT]:!1,[xs.MIDDLE]:!1,[xs.RIGHT]:!1},this._isPinching=!1,this._isTouchHolding=!1,this._lastSeenTouchEvent=-xm.mouseEmulationIgnoreMilliseconds,this._primaryStartPosition=new U,this._primaryPosition=new U,this._primaryPreviousPosition=new U,this._positions=new zt,this._previousPositions=new zt,this._removalFunctions=[],this._touchHoldTimer=void 0,this._clickPixelTolerance=5,this._holdPixelTolerance=25,this._element=e??document,kNt(this)}xm.prototype.setInputAction=function(e,t,n){let i=xoe(t,n);this._inputEvents[i]=e};xm.prototype.getInputAction=function(e,t){let n=xoe(e,t);return this._inputEvents[n]};xm.prototype.removeInputAction=function(e,t){let n=xoe(e,t);delete this._inputEvents[n]};xm.prototype.isDestroyed=function(){return!1};xm.prototype.destroy=function(){return UNt(this),le(this)};xm.mouseEmulationIgnoreMilliseconds=800;xm.touchHoldDelayMilliseconds=1500;var Ta=xm;function GT(e){this._scene=e,this._currentTweens=[],this._morphHandler=void 0,this._morphCancelled=!1,this._completeMorph=void 0,this._morphToOrthographic=!1}GT.prototype.completeMorph=function(){l(this._completeMorph)&&this._completeMorph()};GT.prototype.morphTo2D=function(e,t){l(this._completeMorph)&&this._completeMorph();let n=this._scene;this._previousMode=n.mode,this._morphToOrthographic=n.camera.frustum instanceof _n,!(this._previousMode===re.SCENE2D||this._previousMode===re.MORPHING)&&(this._scene.morphStart.raiseEvent(this,this._previousMode,re.SCENE2D,!0),n._mode=re.MORPHING,n.camera._setTransform(M.IDENTITY),this._previousMode===re.COLUMBUS_VIEW?CLt(this,e):RLt(this,e,t),e===0&&l(this._completeMorph)&&this._completeMorph())};var qNt=new h,YNt=new h,XNt=new h,KNt=new h,$Nt=new h,JNt=new h,ZNt=new h,QNt=new he,eLt=new M,tLt=new er,nLt=new _n,iLt={position:void 0,direction:void 0,up:void 0,position2D:void 0,direction2D:void 0,up2D:void 0,frustum:void 0};GT.prototype.morphToColumbusView=function(e,t){l(this._completeMorph)&&this._completeMorph();let n=this._scene;if(this._previousMode=n.mode,this._previousMode===re.COLUMBUS_VIEW||this._previousMode===re.MORPHING)return;this._scene.morphStart.raiseEvent(this,this._previousMode,re.COLUMBUS_VIEW,!0),n.camera._setTransform(M.IDENTITY);let i=qNt,r=YNt,o=XNt;if(e>0)i.x=0,i.y=-1,i.z=1,i=h.multiplyByScalar(h.normalize(i,i),5*t.maximumRadius,i),h.negate(h.normalize(i,r),r),h.cross(h.UNIT_X,r,o);else{let u=n.camera;if(this._previousMode===re.SCENE2D)h.clone(u.position,i),i.z=u.frustum.right-u.frustum.left,h.negate(h.UNIT_Z,r),h.clone(h.UNIT_Y,o);else{h.clone(u.positionWC,i),h.clone(u.directionWC,r),h.clone(u.upWC,o);let f=t.scaleToGeodeticSurface(i,ZNt),d=At.eastNorthUpToFixedFrame(f,t,eLt);M.inverseTransformation(d,d),n.mapProjection.project(t.cartesianToCartographic(i,QNt),i),M.multiplyByPointAsVector(d,r,r),M.multiplyByPointAsVector(d,o,o)}}let s;this._morphToOrthographic?(s=nLt,s.width=n.camera.frustum.right-n.camera.frustum.left,s.aspectRatio=n.drawingBufferWidth/n.drawingBufferHeight):(s=tLt,s.aspectRatio=n.drawingBufferWidth/n.drawingBufferHeight,s.fov=P.toRadians(60));let a=iLt;a.position=i,a.direction=r,a.up=o,a.frustum=s;let c=MLt(a);nM(this,c),this._previousMode===re.SCENE2D?OLt(this,e,a,c):(a.position2D=M.multiplyByPoint(Nr.TRANSFORM_2D,i,KNt),a.direction2D=M.multiplyByPointAsVector(Nr.TRANSFORM_2D,r,$Nt),a.up2D=M.multiplyByPointAsVector(Nr.TRANSFORM_2D,o,JNt),n._mode=re.MORPHING,wMe(this,e,a,c)),e===0&&l(this._completeMorph)&&this._completeMorph()};var Soe={position:new h,direction:new h,up:new h,frustum:void 0},yMe=new er;GT.prototype.morphTo3D=function(e,t){l(this._completeMorph)&&this._completeMorph();let n=this._scene;if(this._previousMode=n.mode,!(this._previousMode===re.SCENE3D||this._previousMode===re.MORPHING)){if(this._scene.morphStart.raiseEvent(this,this._previousMode,re.SCENE3D,!0),n._mode=re.MORPHING,n.camera._setTransform(M.IDENTITY),this._previousMode===re.SCENE2D)mLt(this,e,t);else{let i;e>0?(i=Soe,h.fromDegrees(0,0,5*t.maximumRadius,t,i.position),h.negate(i.position,i.direction),h.normalize(i.direction,i.direction),h.clone(h.UNIT_Z,i.up)):i=AMe(this,t);let r,o=n.camera;o.frustum instanceof _n?r=o.frustum.clone():(r=yMe,r.aspectRatio=n.drawingBufferWidth/n.drawingBufferHeight,r.fov=P.toRadians(60)),i.frustum=r;let s=PMe(i);nM(this,s),voe(this,e,i,s)}e===0&&l(this._completeMorph)&&this._completeMorph()}};GT.prototype.isDestroyed=function(){return!1};GT.prototype.destroy=function(){return P5(this),le(this)};function nM(e,t){if(e._scene.completeMorphOnUserInput){e._morphHandler=new Ta(e._scene.canvas);let n=function(){e._morphCancelled=!0,e._scene.camera.cancelFlight(),t(e)};e._completeMorph=n,e._morphHandler.setInputAction(n,fn.LEFT_DOWN),e._morphHandler.setInputAction(n,fn.MIDDLE_DOWN),e._morphHandler.setInputAction(n,fn.RIGHT_DOWN),e._morphHandler.setInputAction(n,fn.WHEEL)}}function P5(e){let t=e._currentTweens;for(let n=0;n<t.length;++n)t[n].cancelTween();e._currentTweens.length=0,e._morphHandler=e._morphHandler&&e._morphHandler.destroy()}var rLt=new he,oLt=new h,sLt=new M;function AMe(e,t){let n=e._scene,i=n.camera,r=Soe,o=r.position,s=r.direction,a=r.up,c=n.mapProjection.unproject(i.position,rLt);t.cartographicToCartesian(c,o);let u=t.scaleToGeodeticSurface(o,oLt),f=At.eastNorthUpToFixedFrame(u,t,sLt);return M.multiplyByPointAsVector(f,i.direction,s),M.multiplyByPointAsVector(f,i.up,a),r}var aLt=new h,cLt=new h,lLt=new h,uLt=new h,fLt=new h,dLt=new h;function voe(e,t,n,i){t*=.5;let r=e._scene,o=r.camera,s=h.clone(o.position,aLt),a=h.clone(o.direction,cLt),c=h.clone(o.up,lLt),u=M.multiplyByPoint(Nr.TRANSFORM_2D_INVERSE,n.position,uLt),f=M.multiplyByPointAsVector(Nr.TRANSFORM_2D_INVERSE,n.direction,fLt),d=M.multiplyByPointAsVector(Nr.TRANSFORM_2D_INVERSE,n.up,dLt);function p(m){eh(s,u,m.time,o.position),eh(a,f,m.time,o.direction),eh(c,d,m.time,o.up),h.cross(o.direction,o.up,o.right),h.normalize(o.right,o.right)}let g=r.tweens.add({duration:t,easingFunction:ks.QUARTIC_OUT,startObject:{time:0},stopObject:{time:1},update:p,complete:function(){IMe(e,r,0,1,t,i)}});e._currentTweens.push(g)}var hLt=new _n,bMe=new h,xMe=new h,TMe=new h,woe=new h,EMe=new h,CMe=new h;function mLt(e,t,n){t/=3;let i=e._scene,r=i.camera,o;t>0?(o=Soe,h.fromDegrees(0,0,5*n.maximumRadius,n,o.position),h.negate(o.position,o.direction),h.normalize(o.direction,o.direction),h.clone(h.UNIT_Z,o.up)):(r.position.z=r.frustum.right-r.frustum.left,o=AMe(e,n));let s;e._morphToOrthographic?(s=hLt,s.aspectRatio=i.drawingBufferWidth/i.drawingBufferHeight,s.width=r.frustum.right-r.frustum.left):(s=yMe,s.aspectRatio=i.drawingBufferWidth/i.drawingBufferHeight,s.fov=P.toRadians(60)),o.frustum=s;let a=PMe(o);nM(e,a);let c;e._morphToOrthographic?c=function(){voe(e,t,o,a)}:c=function(){SMe(e,t,o,function(){voe(e,t,o,a)})},t>0?(i._mode=re.SCENE2D,r.flyTo({duration:t,destination:h.fromDegrees(0,0,5*n.maximumRadius,n,woe),complete:function(){i._mode=re.MORPHING,c()}})):c()}function eh(e,t,n,i){return h.lerp(e,t,n,i)}function vMe(e,t,n,i,r){let o=e._scene,s=o.camera;if(s.frustum instanceof _n)return;let a=s.frustum.fov,c=P.RADIANS_PER_DEGREE*.5,u=n.position.z*Math.tan(a*.5);s.frustum.far=u/Math.tan(c*.5)+1e7;function f(p){s.frustum.fov=P.lerp(a,c,p.time);let g=u/Math.tan(s.frustum.fov*.5);i(s,g)}let d=o.tweens.add({duration:t,easingFunction:ks.QUARTIC_OUT,startObject:{time:0},stopObject:{time:1},update:f,complete:function(){s.frustum=n.frustum.clone(),r(e)}});e._currentTweens.push(d)}var pLt=new h,gLt=new h,_Lt=new h,Coe=new h,yLt=new h,ALt=new h,bLt=new Ss,xLt=new gn,TLt=new h,ELt={position:void 0,direction:void 0,up:void 0,frustum:void 0};function CLt(e,t){t*=.5;let n=e._scene,i=n.camera,r=h.clone(i.position,pLt),o=h.clone(i.direction,gLt),s=h.clone(i.up,_Lt),a=h.negate(h.UNIT_Z,yLt),c=h.clone(h.UNIT_Y,ALt),u=Coe;if(t>0)h.clone(h.ZERO,Coe),u.z=5*n.ellipsoid.maximumRadius;else{h.clone(r,Coe);let A=xLt;M.multiplyByPoint(Nr.TRANSFORM_2D,r,A.origin),M.multiplyByPointAsVector(Nr.TRANSFORM_2D,o,A.direction);let b=n.globe;if(l(b)){let x=b.pickWorldCoordinates(A,n,!0,TLt);l(x)&&(M.multiplyByPoint(Nr.TRANSFORM_2D_INVERSE,x,u),u.z+=h.distance(r,u))}}let f=bLt;f.right=u.z*.5,f.left=-f.right,f.top=f.right*(n.drawingBufferHeight/n.drawingBufferWidth),f.bottom=-f.top;let d=ELt;d.position=u,d.direction=a,d.up=c,d.frustum=f;let p=DMe(d);nM(e,p);function g(A){eh(r,u,A.time,i.position),eh(o,a,A.time,i.direction),eh(s,c,A.time,i.up),h.cross(i.direction,i.up,i.right),h.normalize(i.right,i.right),i._adjustOrthographicFrustum(!0)}function m(A,b){A.position.z=b}let y=n.tweens.add({duration:t,easingFunction:ks.QUARTIC_OUT,startObject:{time:0},stopObject:{time:1},update:g,complete:function(){vMe(e,t,d,m,p)}});e._currentTweens.push(y)}var _Me=new he,vLt={position:new h,direction:new h,up:new h,position2D:new h,direction2D:new h,up2D:new h,frustum:new Ss},SLt={position:new h,direction:new h,up:new h,frustum:void 0},wLt=new h,ILt=new gn,PLt=new M,DLt=new h;function RLt(e,t,n){t*=.5;let i=e._scene,r=i.camera,o=vLt;if(t>0)h.clone(h.ZERO,o.position),o.position.z=5*n.maximumRadius,h.negate(h.UNIT_Z,o.direction),h.clone(h.UNIT_Y,o.up);else{n.cartesianToCartographic(r.positionWC,_Me),i.mapProjection.project(_Me,o.position),h.negate(h.UNIT_Z,o.direction),h.clone(h.UNIT_Y,o.up);let d=ILt;h.clone(o.position2D,d.origin);let p=h.clone(r.directionWC,d.direction),g=n.scaleToGeodeticSurface(r.positionWC,DLt),m=At.eastNorthUpToFixedFrame(g,n,PLt);M.inverseTransformation(m,m),M.multiplyByPointAsVector(m,p,p),M.multiplyByPointAsVector(Nr.TRANSFORM_2D,p,p);let y=i.globe;if(l(y)){let A=y.pickWorldCoordinates(d,i,!0,wLt);if(l(A)){let b=h.distance(o.position2D,A);A.x+=b,h.clone(A,o.position2D)}}}function s(d,p){d.position.x=p}M.multiplyByPoint(Nr.TRANSFORM_2D,o.position,o.position2D),M.multiplyByPointAsVector(Nr.TRANSFORM_2D,o.direction,o.direction2D),M.multiplyByPointAsVector(Nr.TRANSFORM_2D,o.up,o.up2D);let a=o.frustum;a.right=o.position.z*.5,a.left=-a.right,a.top=a.right*(i.drawingBufferHeight/i.drawingBufferWidth),a.bottom=-a.top;let c=SLt;M.multiplyByPoint(Nr.TRANSFORM_2D_INVERSE,o.position2D,c.position),h.clone(o.direction,c.direction),h.clone(o.up,c.up),c.frustum=a;let u=DMe(c);nM(e,u);function f(){vMe(e,t,o,s,u)}wMe(e,t,o,f)}function SMe(e,t,n,i){let r=e._scene,o=r.camera,s=o.frustum.right-o.frustum.left;o.frustum=n.frustum.clone();let a=o.frustum.fov,c=P.RADIANS_PER_DEGREE*.5,u=s*Math.tan(a*.5);o.frustum.far=u/Math.tan(c*.5)+1e7,o.frustum.fov=c;function f(p){o.frustum.fov=P.lerp(c,a,p.time),o.position.z=u/Math.tan(o.frustum.fov*.5)}let d=r.tweens.add({duration:t,easingFunction:ks.QUARTIC_OUT,startObject:{time:0},stopObject:{time:1},update:f,complete:function(){i(e)}});e._currentTweens.push(d)}function OLt(e,t,n,i){t*=.5;let r=e._scene,o=r.camera,s=h.clone(n.position,woe),a=h.clone(n.direction,EMe),c=h.clone(n.up,CMe);r._mode=re.MORPHING;function u(){o.frustum=n.frustum.clone();let f=h.clone(o.position,bMe),d=h.clone(o.direction,xMe),p=h.clone(o.up,TMe);f.z=s.z;function g(y){eh(f,s,y.time,o.position),eh(d,a,y.time,o.direction),eh(p,c,y.time,o.up),h.cross(o.direction,o.up,o.right),h.normalize(o.right,o.right)}let m=r.tweens.add({duration:t,easingFunction:ks.QUARTIC_OUT,startObject:{time:0},stopObject:{time:1},update:g,complete:function(){i(e)}});e._currentTweens.push(m)}e._morphToOrthographic?u():SMe(e,0,n,u)}function wMe(e,t,n,i){let r=e._scene,o=r.camera,s=h.clone(o.position,bMe),a=h.clone(o.direction,xMe),c=h.clone(o.up,TMe),u=h.clone(n.position2D,woe),f=h.clone(n.direction2D,EMe),d=h.clone(n.up2D,CMe);function p(m){eh(s,u,m.time,o.position),eh(a,f,m.time,o.direction),eh(c,d,m.time,o.up),h.cross(o.direction,o.up,o.right),h.normalize(o.right,o.right),o._adjustOrthographicFrustum(!0)}let g=r.tweens.add({duration:t,easingFunction:ks.QUARTIC_OUT,startObject:{time:0},stopObject:{time:1},update:p,complete:function(){IMe(e,r,1,0,t,i)}});e._currentTweens.push(g)}function IMe(e,t,n,i,r,o){let s={object:t,property:"morphTime",startValue:n,stopValue:i,duration:r,easingFunction:ks.QUARTIC_OUT};l(o)&&(s.complete=function(){o(e)});let a=t.tweens.addProperty(s);e._currentTweens.push(a)}function PMe(e){return function(t){let n=t._scene;n._mode=re.SCENE3D,n.morphTime=re.getMorphTime(re.SCENE3D),P5(t);let i=n.camera;(t._previousMode!==re.MORPHING||t._morphCancelled)&&(t._morphCancelled=!1,h.clone(e.position,i.position),h.clone(e.direction,i.direction),h.clone(e.up,i.up),h.cross(i.direction,i.up,i.right),h.normalize(i.right,i.right),i.frustum=e.frustum.clone());let r=i.frustum;n.frameState.useLogDepth&&(r.near=.1,r.far=1e10);let o=l(t._completeMorph);t._completeMorph=void 0,n.camera.update(n.mode),t._scene.morphComplete.raiseEvent(t,t._previousMode,re.SCENE3D,o)}}function DMe(e){return function(t){let n=t._scene;n._mode=re.SCENE2D,n.morphTime=re.getMorphTime(re.SCENE2D),P5(t);let i=n.camera;h.clone(e.position,i.position),i.position.z=n.ellipsoid.maximumRadius*2,h.clone(e.direction,i.direction),h.clone(e.up,i.up),h.cross(i.direction,i.up,i.right),h.normalize(i.right,i.right),i.frustum=e.frustum.clone();let r=l(t._completeMorph);t._completeMorph=void 0,n.camera.update(n.mode),t._scene.morphComplete.raiseEvent(t,t._previousMode,re.SCENE2D,r)}}function MLt(e){return function(t){let n=t._scene;n._mode=re.COLUMBUS_VIEW,n.morphTime=re.getMorphTime(re.COLUMBUS_VIEW),P5(t);let i=n.camera;(t._previousModeMode!==re.MORPHING||t._morphCancelled)&&(t._morphCancelled=!1,h.clone(e.position,i.position),h.clone(e.direction,i.direction),h.clone(e.up,i.up),h.cross(i.direction,i.up,i.right),h.normalize(i.right,i.right));let r=i.frustum;n.frameState.useLogDepth&&(r.near=.1,r.far=1e10);let o=l(t._completeMorph);t._completeMorph=void 0,n.camera.update(n.mode),t._scene.morphComplete.raiseEvent(t,t._previousMode,re.COLUMBUS_VIEW,o)}}var D5=GT;var RMe={LEFT_DRAG:0,RIGHT_DRAG:1,MIDDLE_DRAG:2,WHEEL:3,PINCH:4};Object.freeze(RMe);var mr=RMe;var FMe=[oo.SHIFT,oo.CTRL,oo.ALT,[oo.SHIFT,oo.CTRL],[oo.SHIFT,oo.ALT],[oo.CTRL,oo.ALT],[oo.SHIFT,oo.CTRL,oo.ALT]];function ja(e,t){if(!l(t))return`${e}`;let n=Array.isArray(t)?t.toSorted():[t];return`${e}+${n.join("+")}`}function NLt(e,t){U.clone(e.distance.startPosition,t.distance.startPosition),U.clone(e.distance.endPosition,t.distance.endPosition),U.clone(e.angleAndHeight.startPosition,t.angleAndHeight.startPosition),U.clone(e.angleAndHeight.endPosition,t.angleAndHeight.endPosition)}function OMe(e,t,n){let i=ja(mr.PINCH,t),r=e._update,o=e._isDown,s=e._eventStartPosition,a=e._pressTime,c=e._releaseTime;r[i]=!0,o[i]=!1,s[i]=new U;let u=e._movement[i];l(u)||(u=e._movement[i]={}),u.distance={startPosition:new U,endPosition:new U},u.angleAndHeight={startPosition:new U,endPosition:new U},u.prevAngle=0,e._eventHandler.setInputAction(function(f){e._buttonsDown++,o[i]=!0,a[i]=new Date,U.lerp(f.position1,f.position2,.5,s[i])},fn.PINCH_START,t),e._eventHandler.setInputAction(function(){e._buttonsDown=Math.max(e._buttonsDown-1,0),o[i]=!1,c[i]=new Date},fn.PINCH_END,t),e._eventHandler.setInputAction(function(f){if(o[i]){r[i]?(NLt(f,u),r[i]=!1,u.prevAngle=u.angleAndHeight.startPosition.x):(U.clone(f.distance.endPosition,u.distance.endPosition),U.clone(f.angleAndHeight.endPosition,u.angleAndHeight.endPosition));let d=u.angleAndHeight.endPosition.x,p=u.prevAngle,g=Math.PI*2;for(;d>=p+Math.PI;)d-=g;for(;d<p-Math.PI;)d+=g;u.angleAndHeight.endPosition.x=-d*n.clientWidth/12,u.angleAndHeight.startPosition.x=-p*n.clientWidth/12}},fn.PINCH_MOVE,t)}function MMe(e,t){let n=ja(mr.WHEEL,t),i=e._pressTime,r=e._releaseTime,o=e._update;o[n]=!0;let s=e._movement[n];l(s)||(s=e._movement[n]={});let a=e._lastMovement[n];l(a)||(a=e._lastMovement[n]={startPosition:new U,endPosition:new U,valid:!1}),s.startPosition=new U,U.clone(U.ZERO,s.startPosition),s.endPosition=new U,e._eventHandler.setInputAction(function(c){let u=7.5*P.toRadians(c);i[n]=r[n]=new Date,s.endPosition.x=0,s.endPosition.y=u,U.clone(s.endPosition,a.endPosition),a.valid=!0,o[n]=!1},fn.WHEEL,t)}function Jw(e,t,n){let i=ja(n,t),r=e._isDown,o=e._eventStartPosition,s=e._pressTime;r[i]=!1,o[i]=new U;let a=e._lastMovement[i];l(a)||(a=e._lastMovement[i]={startPosition:new U,endPosition:new U,valid:!1});let c,u;n===mr.LEFT_DRAG?(c=fn.LEFT_DOWN,u=fn.LEFT_UP):n===mr.RIGHT_DRAG?(c=fn.RIGHT_DOWN,u=fn.RIGHT_UP):n===mr.MIDDLE_DRAG&&(c=fn.MIDDLE_DOWN,u=fn.MIDDLE_UP),e._eventHandler.setInputAction(function(f){e._buttonsDown++,a.valid=!1,r[i]=!0,s[i]=new Date,U.clone(f.position,o[i])},c,t),e._eventHandler.setInputAction(function(){Ioe(ja(n,void 0),e);for(let f of FMe){let d=ja(n,f);Ioe(d,e)}},u,t)}function Ioe(e,t){let n=t._releaseTime,i=t._isDown;i[e]&&(t._buttonsDown=Math.max(t._buttonsDown-1,0)),i[e]=!1,n[e]=new Date}function NMe(e,t){U.clone(e.startPosition,t.startPosition),U.clone(e.endPosition,t.endPosition)}function LLt(e,t,n){let i=n._isDown,r=!1,o=ja(e,t);for(let[c,u]of Object.entries(i))c.startsWith(e)&&u&&c!==o&&(r=!0,Ioe(c,n));if(!r)return;let s=n._pressTime,a=n._lastMovement[o];l(a)||(a=n._lastMovement[o]={startPosition:new U,endPosition:new U,valid:!1}),n._buttonsDown++,a.valid=!1,i[o]=!0,s[o]=new Date}function LMe(e,t){let n=e._update,i=e._movement,r=e._lastMovement,o=e._isDown;for(let s in mr)if(mr.hasOwnProperty(s)){let a=mr[s];if(l(a)){let c=ja(a,t);n[c]=!0,l(e._lastMovement[c])||(e._lastMovement[c]={startPosition:new U,endPosition:new U,valid:!1}),l(e._movement[c])||(e._movement[c]={startPosition:new U,endPosition:new U})}}e._eventHandler.setInputAction(function(s){for(let a in mr)if(mr.hasOwnProperty(a)){let c=mr[a];if(l(c)){let u=ja(c,t);LLt(c,t,e),o[u]&&(n[u]?(NMe(i[u],r[u]),r[u].valid=!0,NMe(s,i[u]),n[u]=!1):U.clone(s.endPosition,i[u].endPosition))}}U.clone(s.endPosition,e._currentMousePosition)},fn.MOUSE_MOVE,t)}function th(e){this._eventHandler=new Ta(e),this._update={},this._movement={},this._lastMovement={},this._isDown={},this._eventStartPosition={},this._pressTime={},this._releaseTime={},this._buttonsDown=0,this._currentMousePosition=new U,MMe(this,void 0),OMe(this,void 0,e),Jw(this,void 0,mr.LEFT_DRAG),Jw(this,void 0,mr.RIGHT_DRAG),Jw(this,void 0,mr.MIDDLE_DRAG),LMe(this,void 0);for(let t of FMe)MMe(this,t),OMe(this,t,e),Jw(this,t,mr.LEFT_DRAG),Jw(this,t,mr.RIGHT_DRAG),Jw(this,t,mr.MIDDLE_DRAG),LMe(this,t)}Object.defineProperties(th.prototype,{currentMousePosition:{get:function(){return this._currentMousePosition}},anyButtonDown:{get:function(){let e=!this._update[ja(mr.WHEEL)]||!this._update[ja(mr.WHEEL,oo.SHIFT)]||!this._update[ja(mr.WHEEL,oo.CTRL)]||!this._update[ja(mr.WHEEL,oo.ALT)];return this._buttonsDown>0||e}}});th.prototype.isMoving=function(e,t){let n=ja(e,t);return!this._update[n]};th.prototype.getMovement=function(e,t){let n=ja(e,t);return this._movement[n]};th.prototype.getLastMovement=function(e,t){let n=ja(e,t),i=this._lastMovement[n];if(i.valid)return i};th.prototype.isButtonDown=function(e,t){let n=ja(e,t);return this._isDown[n]};th.prototype.getStartMousePosition=function(e,t){if(e===mr.WHEEL)return this._currentMousePosition;let n=ja(e,t);return this._eventStartPosition[n]};th.prototype.getButtonPressTime=function(e,t){let n=ja(e,t);return this._pressTime[n]};th.prototype.getButtonReleaseTime=function(e,t){let n=ja(e,t);return this._releaseTime[n]};th.prototype.reset=function(){for(let e in this._update)this._update.hasOwnProperty(e)&&(this._update[e]=!0)};th.prototype.isDestroyed=function(){return!1};th.prototype.destroy=function(){return this._eventHandler=this._eventHandler&&this._eventHandler.destroy(),le(this)};var R5=th;function O5(e,t,n,i,r,o,s,a,c,u){this._tweens=e,this._tweenjs=t,this._startObject=Ze(n),this._stopObject=Ze(i),this._duration=r,this._delay=o,this._easingFunction=s,this._update=a,this._complete=c,this.cancel=u,this.needsStart=!0}Object.defineProperties(O5.prototype,{startObject:{get:function(){return this._startObject}},stopObject:{get:function(){return this._stopObject}},duration:{get:function(){return this._duration}},delay:{get:function(){return this._delay}},easingFunction:{get:function(){return this._easingFunction}},update:{get:function(){return this._update}},complete:{get:function(){return this._complete}},tweenjs:{get:function(){return this._tweenjs}}});O5.prototype.cancelTween=function(){this._tweens.remove(this)};function Tm(){this._tweens=[]}Object.defineProperties(Tm.prototype,{length:{get:function(){return this._tweens.length}}});Tm.prototype.add=function(e){if(e=e??H.EMPTY_OBJECT,e.duration===0)return l(e.complete)&&e.complete(),new O5(this);let t=e.duration/Un.SECONDS_PER_MILLISECOND,n=e.delay??0,i=n/Un.SECONDS_PER_MILLISECOND,r=e.easingFunction??ks.LINEAR_NONE,o=e.startObject,s=new WDe(o);s.to(Ze(e.stopObject),t),s.delay(i),s.easing(r),l(e.update)&&s.onUpdate(function(){e.update(o)}),s.onComplete(e.complete??null),s.repeat(e._repeat??0);let a=new O5(this,s,e.startObject,e.stopObject,e.duration,n,r,e.update,e.complete,e.cancel);return this._tweens.push(a),a};Tm.prototype.addProperty=function(e){e=e??H.EMPTY_OBJECT;let t=e.object,n=e.property,i=e.startValue,r=e.stopValue;function o(s){t[n]=s.value}return this.add({startObject:{value:i},stopObject:{value:r},duration:e.duration??3,delay:e.delay,easingFunction:e.easingFunction,update:o,complete:e.complete,cancel:e.cancel,_repeat:e._repeat})};Tm.prototype.addAlpha=function(e){e=e??H.EMPTY_OBJECT;let t=e.material,n=[];for(let r in t.uniforms)t.uniforms.hasOwnProperty(r)&&l(t.uniforms[r])&&l(t.uniforms[r].alpha)&&n.push(r);function i(r){let o=n.length;for(let s=0;s<o;++s)t.uniforms[n[s]].alpha=r.alpha}return this.add({startObject:{alpha:e.startValue??0},stopObject:{alpha:e.stopValue??1},duration:e.duration??3,delay:e.delay,easingFunction:e.easingFunction,update:i,complete:e.complete,cancel:e.cancel})};Tm.prototype.addOffsetIncrement=function(e){e=e??H.EMPTY_OBJECT;let n=e.material.uniforms;return this.addProperty({object:n,property:"offset",startValue:n.offset,stopValue:n.offset+1,duration:e.duration,delay:e.delay,easingFunction:e.easingFunction,update:e.update,cancel:e.cancel,_repeat:1/0})};Tm.prototype.remove=function(e){if(!l(e))return!1;let t=this._tweens.indexOf(e);return t!==-1?(e.tweenjs.stop(),l(e.cancel)&&e.cancel(),this._tweens.splice(t,1),!0):!1};Tm.prototype.removeAll=function(){let e=this._tweens;for(let t=0;t<e.length;++t){let n=e[t];n.tweenjs.stop(),l(n.cancel)&&n.cancel()}e.length=0};Tm.prototype.contains=function(e){return l(e)&&this._tweens.indexOf(e)!==-1};Tm.prototype.get=function(e){return this._tweens[e]};Tm.prototype.update=function(e){let t=this._tweens,n=0;for(e=l(e)?e/Un.SECONDS_PER_MILLISECOND:xn();n<t.length;){let i=t[n],r=i.tweenjs;if(i.needsStart)i.needsStart=!1,r.start(e);else if(r.update(e))n++;else{if(t[n]?.needsStart)continue;r.stop(),t.splice(n,1)}}};var Zw=Tm;function rM(e){this.enableInputs=!0,this.enableTranslate=!0,this.enableZoom=!0,this.enableRotate=!0,this.enableTilt=!0,this.enableLook=!0,this.inertiaSpin=.9,this.inertiaTranslate=.9,this.inertiaZoom=.8,this.maximumMovementRatio=.1,this.bounceAnimationTime=3,this.minimumZoomDistance=1,this.maximumZoomDistance=Number.POSITIVE_INFINITY,this.zoomFactor=5,this.translateEventTypes=mr.LEFT_DRAG,this.zoomEventTypes=[mr.RIGHT_DRAG,mr.WHEEL,mr.PINCH],this.rotateEventTypes=mr.LEFT_DRAG,this.tiltEventTypes=[mr.MIDDLE_DRAG,mr.PINCH,{eventType:mr.LEFT_DRAG,modifier:oo.CTRL},{eventType:mr.RIGHT_DRAG,modifier:oo.CTRL}],this.lookEventTypes={eventType:mr.LEFT_DRAG,modifier:oo.SHIFT};let t=e.ellipsoid??ee.default;this.minimumPickingTerrainHeight=ee.WGS84.equals(t)?15e4:t.minimumRadius*.025,this._minimumPickingTerrainHeight=this.minimumPickingTerrainHeight,this.minimumPickingTerrainDistanceWithInertia=ee.WGS84.equals(t)?4e3:t.minimumRadius*63e-5,this.minimumCollisionTerrainHeight=ee.WGS84.equals(t)?15e3:t.minimumRadius*.0025,this._minimumCollisionTerrainHeight=this.minimumCollisionTerrainHeight,this.minimumTrackBallHeight=ee.WGS84.equals(t)?75e5:t.minimumRadius*1.175,this._minimumTrackBallHeight=this.minimumTrackBallHeight,this.enableCollisionDetection=!0,this.maximumTiltAngle=void 0,this._scene=e,this._globe=void 0,this._ellipsoid=t,this._lastGlobeHeight=0,this._aggregator=new R5(e.canvas),this._lastInertiaSpinMovement=void 0,this._lastInertiaZoomMovement=void 0,this._lastInertiaTranslateMovement=void 0,this._lastInertiaTiltMovement=void 0,this._inertiaDisablers={_lastInertiaZoomMovement:["_lastInertiaSpinMovement","_lastInertiaTranslateMovement","_lastInertiaTiltMovement"],_lastInertiaTiltMovement:["_lastInertiaSpinMovement","_lastInertiaTranslateMovement"]},this._tweens=new Zw,this._tween=void 0,this._horizontalRotationAxis=void 0,this._tiltCenterMousePosition=new U(-1,-1),this._tiltCenter=new h,this._rotateMousePosition=new U(-1,-1),this._rotateStartPosition=new h,this._strafeStartPosition=new h,this._strafeMousePosition=new U,this._strafeEndMousePosition=new U,this._zoomMouseStart=new U(-1,-1),this._zoomWorldPosition=new h,this._useZoomWorldPosition=!1,this._panLastMousePosition=new U,this._panLastWorldPosition=new h,this._tiltCVOffMap=!1,this._looking=!1,this._rotating=!1,this._strafing=!1,this._zoomingOnVector=!1,this._zoomingUnderground=!1,this._rotatingZoom=!1,this._adjustedHeightForTerrain=!1,this._cameraUnderground=!1;let n=e.mapProjection;this._maxCoord=n.project(new he(Math.PI,P.PI_OVER_TWO)),this._rotateFactor=void 0,this._rotateRateRangeAdjustment=void 0,this._maximumRotateRate=1.77,this._minimumRotateRate=1/5e3,this._minimumZoomRate=20,this._maximumZoomRate=5906376272e3,this._minimumUndergroundPickDistance=2e3,this._maximumUndergroundPickDistance=1e4}function FLt(e,t){if(e<0)return 0;let n=(1-t)*25;return Math.exp(-n*e)}function BLt(e){return U.equalsEpsilon(e.startPosition,e.endPosition,P.EPSILON14)}var kLt=.4;function ULt(e,t,n,i,r,o,s){let a=o[s];l(a)||(a=o[s]={startPosition:new U,endPosition:new U,motion:new U,inertiaEnabled:!0});let c=e.getButtonPressTime(t,n),u=e.getButtonReleaseTime(t,n),f=c&&u&&(u.getTime()-c.getTime())/1e3,p=u&&(new Date().getTime()-u.getTime())/1e3;if(c&&u&&f<kLt){let g=FLt(p,i),m=e.getLastMovement(t,n);if(!l(m)||BLt(m)||!a.inertiaEnabled||(a.motion.x=(m.endPosition.x-m.startPosition.x)*.5,a.motion.y=(m.endPosition.y-m.startPosition.y)*.5,a.startPosition=U.clone(m.startPosition,a.startPosition),a.endPosition=U.multiplyByScalar(a.motion,g,a.endPosition),a.endPosition=U.add(a.startPosition,a.endPosition,a.endPosition),isNaN(a.endPosition.x)||isNaN(a.endPosition.y)||U.distance(a.startPosition,a.endPosition)<.5))return;if(!e.isButtonDown(t,n)){let y=e.getStartMousePosition(t,n);r(o,y,a)}}}function zLt(e,t){if(l(t)){let n=e[t];l(n)&&(n.inertiaEnabled=!0);let i=e._inertiaDisablers[t];if(l(i)){let r=i.length;for(let o=0;o<r;++o)n=e[i[o]],l(n)&&(n.inertiaEnabled=!1)}}}var BMe=[];function $l(e,t,n,i,r,o){if(!l(n))return;let s=e._aggregator;Array.isArray(n)||(BMe[0]=n,n=BMe);let a=n.length;for(let c=0;c<a;++c){let u=n[c],f=l(u.eventType)?u.eventType:u,d=u.modifier,p=s.isMoving(f,d)&&s.getMovement(f,d),g=s.getStartMousePosition(f,d);e.enableInputs&&t&&(p?(i(e,g,p),zLt(e,o)):r<1&&ULt(s,f,d,r,i,e,o))}}var M5=new gn,VLt=new h,jLt=new U,HLt=new h,GLt=new U,WLt=new h,qLt=new h,YLt=new h,XLt=new h,KMe=new h,KLt=new h,$Lt=new h,JLt=new h,ZLt=new h,QLt=new h,eFt=new h,tFt=new h,nFt=new h,iFt=new h,rFt=new h,WT=new h,kMe=new h,UMe=new h,Poe={orientation:new kc};function Boe(e,t,n,i,r,o){let s=1;l(o)&&(s=P.clamp(Math.abs(o),.25,1));let a=n.endPosition.y-n.startPosition.y,u=a>0?e.minimumZoomDistance*s:0,f=e.maximumZoomDistance,d=r-u,p=i*d;p=P.clamp(p,e._minimumZoomRate,e._maximumZoomRate);let g=a/e._scene.canvas.clientHeight;g=Math.min(g,e.maximumMovementRatio);let m=p*g;if(e.enableCollisionDetection||e.minimumZoomDistance===0||!l(e._globe)){if(m>0&&Math.abs(r-u)<1||m<0&&Math.abs(r-f)<1)return;r-m<u?m=r-u-1:r-m>f&&(m=r-f)}let y=e._scene,A=y.camera,b=y.mode,x=Poe.orientation;x.heading=A.heading,x.pitch=A.pitch,x.roll=A.roll;let T=n.inertiaEnabled??U.equals(t,e._zoomMouseStart),E=e._zoomingOnVector,v=e._rotatingZoom,S;if(T||(e._zoomMouseStart=U.clone(t,e._zoomMouseStart),l(e._globe)&&b===re.SCENE2D?(S=A.getPickRay(t,M5).origin,S=h.fromElements(S.y,S.z,S.x)):l(e._globe)&&(S=a_(e,t,VLt)),l(S)?(e._useZoomWorldPosition=!0,e._zoomWorldPosition=h.clone(S,e._zoomWorldPosition)):e._useZoomWorldPosition=!1,E=e._zoomingOnVector=!1,v=e._rotatingZoom=!1,e._zoomingUnderground=e._cameraUnderground),!e._useZoomWorldPosition){A.zoomIn(m);return}let I=b===re.COLUMBUS_VIEW;if(A.positionCartographic.height<2e6&&(v=!0),!T||v){if(b===re.SCENE2D){let R=e._zoomWorldPosition,O=A.position;if(!h.equals(R,O)&&A.positionCartographic.height<e._maxCoord.x*2){let L=A.position.x,_=h.subtract(R,O,HLt);h.normalize(_,_);let C=h.distance(R,O)*m/(A.getMagnitude()*.5);A.move(_,C*.5),(A.position.x<0&&L>0||A.position.x>0&&L<0)&&(S=A.getPickRay(t,M5).origin,S=h.fromElements(S.y,S.z,S.x),e._zoomWorldPosition=h.clone(S,e._zoomWorldPosition))}}else if(b===re.SCENE3D){let R=h.normalize(A.position,KMe);if(e._cameraUnderground||e._zoomingUnderground||A.positionCartographic.height<3e3&&Math.abs(h.dot(A.direction,R))<.6)I=!0;else{let O=y.canvas,L=GLt;L.x=O.clientWidth/2,L.y=O.clientHeight/2;let _=a_(e,L,WLt);if(!l(_))I=!0;else if(A.positionCartographic.height<1e6)if(h.dot(A.direction,R)>=-.5)I=!0;else{let C=$Lt;h.clone(A.position,C);let w=e._zoomWorldPosition,D=KLt;if(D=h.normalize(w,D),h.dot(D,R)<0)return;let N=rFt,F=QLt;h.clone(A.direction,F),h.add(C,h.multiplyByScalar(F,1e3,WT),N);let V=eFt,B=tFt;h.subtract(w,C,V),h.normalize(V,B);let j=h.dot(R,B);if(j>=0){e._zoomMouseStart.x=-1;return}let k=Math.acos(-j),G=h.magnitude(C),q=h.magnitude(w),Q=G-m,W=h.magnitude(V),J=Math.asin(P.clamp(W/q*Math.sin(k),-1,1)),Z=Math.asin(P.clamp(Q/q*Math.sin(k),-1,1)),ae=J-Z+k,Ae=JLt;h.normalize(C,Ae);let fe=ZLt;fe=h.cross(B,Ae,fe),fe=h.normalize(fe,fe),h.normalize(h.cross(Ae,fe,WT),F),h.multiplyByScalar(h.normalize(N,WT),h.magnitude(N)-m,N),h.normalize(C,C),h.multiplyByScalar(C,Q,C);let xe=nFt;h.multiplyByScalar(h.add(h.multiplyByScalar(Ae,Math.cos(ae)-1,kMe),h.multiplyByScalar(F,Math.sin(ae),UMe),WT),Q,xe),h.add(C,xe,C),h.normalize(N,Ae),h.normalize(h.cross(Ae,fe,WT),F);let ge=iFt;h.multiplyByScalar(h.add(h.multiplyByScalar(Ae,Math.cos(ae)-1,kMe),h.multiplyByScalar(F,Math.sin(ae),UMe),WT),h.magnitude(N),ge),h.add(N,ge,N),h.clone(C,A.position),h.normalize(h.subtract(N,C,WT),A.direction),h.clone(A.direction,A.direction),h.cross(A.direction,A.up,A.right),h.cross(A.right,A.direction,A.up),A.setView(Poe);return}else{let C=h.normalize(_,qLt),w=h.normalize(e._zoomWorldPosition,YLt),D=h.dot(w,C);if(D>0&&D<1){let N=P.acosClamped(D),F=h.cross(w,C,XLt),V=Math.abs(N)>P.toRadians(20)?A.positionCartographic.height*.75:A.positionCartographic.height-m,B=m/V;A.rotate(F,N*B)}}}}e._rotatingZoom=!I}if(!T&&I||E){let R,O=pr.worldToWindowCoordinates(y,e._zoomWorldPosition,jLt);b!==re.COLUMBUS_VIEW&&U.equals(t,e._zoomMouseStart)&&l(O)?R=A.getPickRay(O,M5):R=A.getPickRay(t,M5);let L=R.direction;(b===re.COLUMBUS_VIEW||b===re.SCENE2D)&&h.fromElements(L.y,L.z,L.x,L),A.move(L,m),e._zoomingOnVector=!0}else A.zoomIn(m);e._cameraUnderground||A.setView(Poe)}var oFt=new gn,sFt=new gn,aFt=new h;function cFt(e,t,n){let r=e._scene.camera,o=r.getPickRay(n.startPosition,oFt).origin,s=r.getPickRay(n.endPosition,sFt).origin;o=h.fromElements(o.y,o.z,o.x,o),s=h.fromElements(s.y,s.z,s.x,s);let a=h.subtract(o,s,aFt),c=h.magnitude(a);c>0&&(h.normalize(a,a),r.move(a,c))}function zMe(e,t,n){l(n.distance)&&(n=n.distance);let r=e._scene.camera;Boe(e,t,n,e.zoomFactor,r.getMagnitude())}var lFt=new U,uFt=new U;function VMe(e,t,n){if(l(n.angleAndHeight)){fFt(e,t,n.angleAndHeight);return}let i=e._scene,r=i.camera,o=i.canvas,s=o.clientWidth,a=o.clientHeight,c=lFt;c.x=2/s*n.startPosition.x-1,c.y=2/a*(a-n.startPosition.y)-1,c=U.normalize(c,c);let u=uFt;u.x=2/s*n.endPosition.x-1,u.y=2/a*(a-n.endPosition.y)-1,u=U.normalize(u,u);let f=P.acosClamped(c.x);c.y<0&&(f=P.TWO_PI-f);let d=P.acosClamped(u.x);u.y<0&&(d=P.TWO_PI-d);let p=d-f;r.twistRight(p)}function fFt(e,t,n){let i=e._rotateFactor*e._rotateRateRangeAdjustment;i>e._maximumRotateRate&&(i=e._maximumRotateRate),i<e._minimumRotateRate&&(i=e._minimumRotateRate);let r=e._scene,o=r.camera,s=r.canvas,a=(n.endPosition.x-n.startPosition.x)/s.clientWidth;a=Math.min(a,e.maximumMovementRatio);let c=i*a*Math.PI*4;o.twistRight(c)}function dFt(e){let t=e._scene.mapMode2D===Yu.ROTATE;M.equals(M.IDENTITY,e._scene.camera.transform)?($l(e,e.enableTranslate,e.translateEventTypes,cFt,e.inertiaTranslate,"_lastInertiaTranslateMovement"),$l(e,e.enableZoom,e.zoomEventTypes,zMe,e.inertiaZoom,"_lastInertiaZoomMovement"),t&&$l(e,e.enableRotate,e.tiltEventTypes,VMe,e.inertiaSpin,"_lastInertiaTiltMovement")):($l(e,e.enableZoom,e.zoomEventTypes,zMe,e.inertiaZoom,"_lastInertiaZoomMovement"),t&&$l(e,e.enableRotate,e.translateEventTypes,VMe,e.inertiaSpin,"_lastInertiaSpinMovement"))}var $Me=new gn,hFt=new h,mFt=new h;function a_(e,t,n){let i=e._scene,r=e._globe,o=i.camera,s;if(i.pickPositionSupported&&(s=i.pickPositionWorldCoordinates(t,hFt)),!l(r))return h.clone(s,n);let a=!e._cameraUnderground,c=o.getPickRay(t,$Me),u=r.pickWorldCoordinates(c,i,a,mFt),f=l(s)?h.distance(s,o.positionWC):Number.POSITIVE_INFINITY,d=l(u)?h.distance(u,o.positionWC):Number.POSITIVE_INFINITY;return f<d?h.clone(s,n):h.clone(u,n)}var pFt=new he;function z5(e){let t=e._ellipsoid,n=e._scene,i=n.camera,r=n.mode,o=0;if(r===re.SCENE3D){let c=t.cartesianToCartographic(i.position,pFt);l(c)&&(o=c.height)}else o=i.position.z;let s=e._scene.globeHeight??0;return Math.abs(s-o)}var gFt=new h;function JMe(e,t){let n=t.origin,i=t.direction,r=z5(e),o=h.normalize(n,gFt),s=Math.abs(h.dot(o,i));return s=Math.max(s,.5)*2,r*s}function ZMe(e,t,n,i){let r=h.distance(t.origin,n),o=z5(e),s=P.clamp(o*5,e._minimumUndergroundPickDistance,e._maximumUndergroundPickDistance);return r>s&&(r=Math.min(r,o/5),r=Math.max(r,100)),gn.getPoint(t,r,i)}function QMe(e,t,n,i){let r;return l(n)?(r=h.distance(t.origin,n),r>e._maximumUndergroundPickDistance&&(r=z5(e))):r=z5(e),gn.getPoint(t,r,i)}var _Ft=new U;function eNe(e,t){let n=t.endPosition,i=U.subtract(t.endPosition,t.startPosition,_Ft),r=e._strafeEndMousePosition;U.add(r,i,r),t.endPosition=r,koe(e,t,e._strafeStartPosition),t.endPosition=n}var jMe=new gn,yFt=new gn,Doe=new h,AFt=new h,bFt=new h,xFt=new h,TFt=new sn(h.UNIT_X,0),EFt=new U,CFt=new U;function vFt(e,t,n){if(h.equals(t,e._translateMousePosition)||(e._looking=!1),h.equals(t,e._strafeMousePosition)||(e._strafing=!1),e._looking){Vf(e,t,n);return}if(e._strafing){eNe(e,n);return}let r=e._scene.camera,o=e._cameraUnderground,s=U.clone(n.startPosition,EFt),a=U.clone(n.endPosition,CFt),c=r.getPickRay(s,jMe),u=h.clone(h.ZERO,xFt),f=h.UNIT_X,d;if(r.position.z<e._minimumPickingTerrainHeight&&(d=a_(e,s,Doe),l(d)&&(u.x=d.x)),o||u.x>r.position.z&&l(d)){let T=d;o&&(T=QMe(e,c,d,Doe)),U.clone(t,e._strafeMousePosition),U.clone(t,e._strafeEndMousePosition),h.clone(T,e._strafeStartPosition),e._strafing=!0,koe(e,n,e._strafeStartPosition);return}let p=sn.fromPointNormal(u,f,TFt);c=r.getPickRay(s,jMe);let g=xi.rayPlane(c,p,Doe),m=r.getPickRay(a,yFt),y=xi.rayPlane(m,p,AFt);if(!l(g)||!l(y)){e._looking=!0,Vf(e,t,n),U.clone(t,e._translateMousePosition);return}let A=h.subtract(g,y,bFt),b=A.x;A.x=A.y,A.y=A.z,A.z=b;let x=h.magnitude(A);x>P.EPSILON6&&(h.normalize(A,A),r.move(A,x))}var tNe=new U,F5=new gn,B5=new h,SFt=new h,nNe=new M,wFt=new M,IFt=new h,PFt=new sn(h.UNIT_X,0),Roe=new h,Noe=new he,iNe=new M,DFt=new Le,RFt=new $,k5=new h;function OFt(e,t,n){if(l(n.angleAndHeight)&&(n=n.angleAndHeight),U.equals(t,e._tiltCenterMousePosition)||(e._tiltCVOffMap=!1,e._looking=!1),e._looking){Vf(e,t,n);return}let r=e._scene.camera;e._tiltCVOffMap||!e.onMap()||Math.abs(r.position.z)>e._minimumPickingTerrainHeight?(e._tiltCVOffMap=!0,MFt(e,t,n)):NFt(e,t,n)}function MFt(e,t,n){let i=e._scene,r=i.camera,o=i.canvas,s=tNe;s.x=o.clientWidth/2,s.y=o.clientHeight/2;let a=r.getPickRay(s,F5),c=h.UNIT_X,u=a.origin,f=a.direction,d,p=h.dot(c,f);if(Math.abs(p)>P.EPSILON6&&(d=-h.dot(c,u)/p),!l(d)||d<=0){e._looking=!0,Vf(e,t,n),U.clone(t,e._tiltCenterMousePosition);return}let g=h.multiplyByScalar(f,d,B5);h.add(u,g,g);let m=i.mapProjection,y=m.ellipsoid;h.fromElements(g.y,g.z,g.x,g);let A=m.unproject(g,Noe);y.cartographicToCartesian(A,g);let b=At.eastNorthUpToFixedFrame(g,y,nNe),x=e._globe,T=e._ellipsoid;e._globe=void 0,e._ellipsoid=ee.UNIT_SPHERE,e._rotateFactor=1,e._rotateRateRangeAdjustment=1;let E=M.clone(r.transform,iNe);r._setTransform(b),zf(e,t,n,h.UNIT_Z),r._setTransform(E),e._globe=x,e._ellipsoid=T;let v=T.maximumRadius;e._rotateFactor=1/v,e._rotateRateRangeAdjustment=v}function NFt(e,t,n){let i=e._scene,r=i.camera,o=e._cameraUnderground,s,a,c=h.UNIT_X;if(U.equals(t,e._tiltCenterMousePosition))s=h.clone(e._tiltCenter,B5);else{if(r.position.z<e._minimumPickingTerrainHeight&&(s=a_(e,t,B5)),!l(s)){a=r.getPickRay(t,F5);let _=a.origin,C=a.direction,w,D=h.dot(c,C);if(Math.abs(D)>P.EPSILON6&&(w=-h.dot(c,_)/D),!l(w)||w<=0){e._looking=!0,Vf(e,t,n),U.clone(t,e._tiltCenterMousePosition);return}s=h.multiplyByScalar(C,w,B5),h.add(_,s,s)}o&&(l(a)||(a=r.getPickRay(t,F5)),ZMe(e,a,s,s)),U.clone(t,e._tiltCenterMousePosition),h.clone(s,e._tiltCenter)}let u=i.canvas,f=tNe;f.x=u.clientWidth/2,f.y=e._tiltCenterMousePosition.y,a=r.getPickRay(f,F5);let d=h.clone(h.ZERO,IFt);d.x=s.x;let p=sn.fromPointNormal(d,c,PFt),g=xi.rayPlane(a,p,SFt),m=r._projection,y=m.ellipsoid;h.fromElements(s.y,s.z,s.x,s);let A=m.unproject(s,Noe);y.cartographicToCartesian(A,s);let b=At.eastNorthUpToFixedFrame(s,y,nNe),x;l(g)?(h.fromElements(g.y,g.z,g.x,g),A=m.unproject(g,Noe),y.cartographicToCartesian(A,g),x=At.eastNorthUpToFixedFrame(g,y,wFt)):x=b;let T=e._globe,E=e._ellipsoid;e._globe=void 0,e._ellipsoid=ee.UNIT_SPHERE,e._rotateFactor=1,e._rotateRateRangeAdjustment=1;let v=h.UNIT_Z,S=M.clone(r.transform,iNe);r._setTransform(b);let I=h.cross(h.UNIT_Z,h.normalize(r.position,Roe),Roe),R=h.dot(r.right,I);if(zf(e,t,n,v,!1,!0),r._setTransform(x),R<0){let _=n.startPosition.y-n.endPosition.y;(o&&_<0||!o&&_>0)&&(v=void 0);let C=r.constrainedAxis;r.constrainedAxis=void 0,zf(e,t,n,v,!0,!1),r.constrainedAxis=C}else zf(e,t,n,v,!0,!1);if(l(r.constrainedAxis)){let _=h.cross(r.direction,r.constrainedAxis,k5);h.equalsEpsilon(_,h.ZERO,P.EPSILON6)||(h.dot(_,r.right)<0&&h.negate(_,_),h.cross(_,r.direction,r.up),h.cross(r.direction,r.up,r.right),h.normalize(r.up,r.up),h.normalize(r.right,r.right))}r._setTransform(S),e._globe=T,e._ellipsoid=E;let O=E.maximumRadius;e._rotateFactor=1/O,e._rotateRateRangeAdjustment=O;let L=h.clone(r.positionWC,Roe);if(e.enableCollisionDetection&&Voe(e,!0),!h.equals(r.positionWC,L)){r._setTransform(x),r.worldToCameraCoordinatesPoint(L,L);let _=h.magnitudeSquared(L);h.magnitudeSquared(r.position)>_&&(h.normalize(r.position,r.position),h.multiplyByScalar(r.position,Math.sqrt(_),r.position));let C=h.angleBetween(L,r.position),w=h.cross(L,r.position,L);h.normalize(w,w);let D=Le.fromAxisAngle(w,C,DFt),N=$.fromQuaternion(D,RFt);$.multiplyByVector(N,r.direction,r.direction),$.multiplyByVector(N,r.up,r.up),h.cross(r.direction,r.up,r.right),h.cross(r.right,r.direction,r.up),r._setTransform(S)}}var rNe=new U,oNe=new gn,sNe=new h;function LFt(e,t,n){l(n.distance)&&(n=n.distance);let i=e._scene,r=i.camera,o=i.canvas,s=e._cameraUnderground,a;s?a=t:(a=rNe,a.x=o.clientWidth/2,a.y=o.clientHeight/2);let c=r.getPickRay(a,oNe),u=c.origin,f=c.direction,d=r.position.z,p;d<e._minimumPickingTerrainHeight&&(p=a_(e,a,sNe));let g;if(l(p)&&(g=h.distance(u,p)),s){let m=JMe(e,c,d);l(g)?g=Math.min(g,m):g=m}if(!l(g)){let m=h.UNIT_X;g=-h.dot(m,u)/h.dot(m,f)}Boe(e,t,n,e.zoomFactor,g)}function FFt(e){let n=e._scene.camera;if(!M.equals(M.IDENTITY,n.transform))$l(e,e.enableRotate,e.rotateEventTypes,zf,e.inertiaSpin,"_lastInertiaSpinMovement"),$l(e,e.enableZoom,e.zoomEventTypes,cNe,e.inertiaZoom,"_lastInertiaZoomMovement");else{let i=e._tweens;if(e._aggregator.anyButtonDown&&i.removeAll(),$l(e,e.enableTilt,e.tiltEventTypes,OFt,e.inertiaSpin,"_lastInertiaTiltMovement"),$l(e,e.enableTranslate,e.translateEventTypes,vFt,e.inertiaTranslate,"_lastInertiaTranslateMovement"),$l(e,e.enableZoom,e.zoomEventTypes,LFt,e.inertiaZoom,"_lastInertiaZoomMovement"),$l(e,e.enableLook,e.lookEventTypes,Vf),!e._aggregator.anyButtonDown&&!i.contains(e._tween)){let r=n.createCorrectPositionTween(e.bounceAnimationTime);l(r)&&(e._tween=i.add(r))}i.update()}}var BFt=new gn,kFt=new sn(h.UNIT_X,0),UFt=new h,zFt=new h;function koe(e,t,n){let i=e._scene,r=i.camera,o=r.getPickRay(t.endPosition,BFt),s=h.clone(r.direction,zFt);i.mode===re.COLUMBUS_VIEW&&h.fromElements(s.z,s.x,s.y,s);let a=sn.fromPointNormal(n,s,kFt),c=xi.rayPlane(o,a,UFt);l(c)&&(s=h.subtract(n,c,s),i.mode===re.COLUMBUS_VIEW&&h.fromElements(s.y,s.z,s.x,s),h.add(r.position,s,r.position))}var HMe=new h,aNe=new he,Loe=new h,Foe=new ee,VFt=new h,jFt=new h,HFt=new h;function GFt(e,t,n){let r=e._scene.camera,o=e._cameraUnderground,s=e._ellipsoid;if(!M.equals(r.transform,M.IDENTITY)){zf(e,t,n);return}let a,c,u=s.geodeticSurfaceNormal(r.position,VFt);if(U.equals(t,e._rotateMousePosition)){if(e._looking)Vf(e,t,n,u);else if(e._rotating)zf(e,t,n);else if(e._strafing)eNe(e,n);else{if(h.magnitude(r.position)<h.magnitude(e._rotateStartPosition))return;a=h.magnitude(e._rotateStartPosition),c=Loe,c.x=c.y=c.z=a,s=ee.fromCartesian3(c,Foe),Moe(e,t,n,s)}return}e._looking=!1,e._rotating=!1,e._strafing=!1;let f=s.cartesianToCartographic(r.positionWC,aNe).height,d=e._globe;if(l(d)&&f<e._minimumPickingTerrainHeight){let p=a_(e,n.startPosition,HFt);if(l(p)){let g,m=r.getPickRay(n.startPosition,$Me);if(o)g=!0,QMe(e,m,p,p);else{let y=s.geodeticSurfaceNormal(p,jFt);Math.abs(h.dot(m.direction,y))<.05?g=!0:g=h.magnitude(r.position)<h.magnitude(p)}g?(U.clone(t,e._strafeEndMousePosition),h.clone(p,e._strafeStartPosition),e._strafing=!0,koe(e,n,e._strafeStartPosition)):(a=h.magnitude(p),c=Loe,c.x=c.y=c.z=a,s=ee.fromCartesian3(c,Foe),Moe(e,t,n,s),h.clone(p,e._rotateStartPosition))}else e._looking=!0,Vf(e,t,n,u)}else l(r.pickEllipsoid(n.startPosition,e._ellipsoid,HMe))?(Moe(e,t,n,e._ellipsoid),h.clone(HMe,e._rotateStartPosition)):f>e._minimumTrackBallHeight?(e._rotating=!0,zf(e,t,n)):(e._looking=!0,Vf(e,t,n,u));U.clone(t,e._rotateMousePosition)}function zf(e,t,n,i,r,o){r=r??!1,o=o??!1;let s=e._scene,a=s.camera,c=s.canvas,u=a.constrainedAxis;l(i)&&(a.constrainedAxis=i);let f=h.magnitude(a.position),d=e._rotateFactor*(f-e._rotateRateRangeAdjustment);d>e._maximumRotateRate&&(d=e._maximumRotateRate),d<e._minimumRotateRate&&(d=e._minimumRotateRate);let p=(n.startPosition.x-n.endPosition.x)/c.clientWidth,g=(n.startPosition.y-n.endPosition.y)/c.clientHeight;p=Math.min(p,e.maximumMovementRatio),g=Math.min(g,e.maximumMovementRatio);let m=d*p*Math.PI*2,y=d*g*Math.PI;if(l(i)&&l(e.maximumTiltAngle)){let A=e.maximumTiltAngle,b=h.dot(a.direction,i),x=Math.PI-Math.acos(b)+y;x>A&&(y-=x-A)}r||a.rotateRight(m),o||a.rotateUp(y),a.constrainedAxis=u}var Ooe=se.clone(se.UNIT_W),GMe=se.clone(se.UNIT_W),N5=new h,Qw=new h,L5=new h,WMe=new h,WFt=new U,qFt=new U,YFt=new U,XFt=new U,KFt=new gn;function Moe(e,t,n,i){let r=e._scene,o=r.camera,s=U.clone(n.startPosition,WFt),a=U.clone(n.endPosition,qFt),c=i.cartesianToCartographic(o.positionWC,aNe).height,u,f;if(!n.inertiaEnabled&&c<e._minimumPickingTerrainHeight&&(u=h.clone(e._panLastWorldPosition,Ooe),!l(e._globe)&&!U.equalsEpsilon(s,e._panLastMousePosition)&&(u=a_(e,s,Ooe)),!l(e._globe)&&l(u))){let d=h.subtract(u,o.positionWC,Qw),p=h.multiplyByScalar(o.directionWC,h.dot(o.directionWC,d),Qw),g=h.magnitude(p),m=o.frustum.getPixelDimensions(r.drawingBufferWidth,r.drawingBufferHeight,g,r.pixelRatio,XFt),y=U.subtract(a,s,YFt),A=h.multiplyByScalar(o.rightWC,y.x*m.x,Qw),b=h.normalize(o.positionWC,KMe),x=o.getPickRay(a,KFt).direction,T=h.subtract(x,h.projectVector(x,o.rightWC,L5),L5),E=h.angleBetween(T,o.directionWC),v=1;l(o.frustum.fov)&&(v=Math.max(Math.tan(E),.1));let S=Math.abs(h.dot(o.directionWC,b)),I=-y.y*m.y*2/Math.sqrt(v)*(1-S),R=h.multiplyByScalar(x,I,L5);S=Math.abs(h.dot(o.upWC,b));let O=h.multiplyByScalar(o.upWC,-y.y*(1-S)*m.y,WMe);f=h.add(u,A,GMe),f=h.add(f,R,f),f=h.add(f,O,f),h.clone(f,e._panLastWorldPosition),U.clone(a,e._panLastMousePosition)}if((!l(u)||!l(f))&&(u=o.pickEllipsoid(s,i,Ooe),f=o.pickEllipsoid(a,i,GMe)),!l(u)||!l(f)){e._rotating=!0,zf(e,t,n);return}if(u=o.worldToCameraCoordinates(u,u),f=o.worldToCameraCoordinates(f,f),l(o.constrainedAxis)){let d=o.constrainedAxis,p=h.mostOrthogonalAxis(d,N5);h.cross(p,d,p),h.normalize(p,p);let g=h.cross(d,p,Qw),m=h.magnitude(u),y=h.dot(d,u),A=Math.acos(y/m),b=h.multiplyByScalar(d,y,L5);h.subtract(u,b,b),h.normalize(b,b);let x=h.magnitude(f),T=h.dot(d,f),E=Math.acos(T/x),v=h.multiplyByScalar(d,T,WMe);h.subtract(f,v,v),h.normalize(v,v);let S=Math.acos(h.dot(b,p));h.dot(b,g)<0&&(S=P.TWO_PI-S);let I=Math.acos(h.dot(v,p));h.dot(v,g)<0&&(I=P.TWO_PI-I);let R=S-I,O;h.equalsEpsilon(d,o.position,P.EPSILON2)?O=o.right:O=h.cross(d,o.position,N5);let L=h.cross(d,O,N5),_=h.dot(L,h.subtract(u,d,Qw)),C=h.dot(L,h.subtract(f,d,Qw)),w;_>0&&C>0?w=E-A:_>0&&C<=0?h.dot(o.position,d)>0?w=-A-E:w=A+E:w=A-E,o.rotateRight(R),o.rotateUp(w)}else{h.normalize(u,u),h.normalize(f,f);let d=h.dot(u,f),p=h.cross(u,f,N5);if(d<1&&!h.equalsEpsilon(p,h.ZERO,P.EPSILON14)){let g=Math.acos(d);o.rotate(p,g)}}}var $Ft=new h,JFt=new he,qMe=0;function cNe(e,t,n){l(n.distance)&&(n=n.distance);let i=n.inertiaEnabled,r=e._ellipsoid,o=e._scene,s=o.camera,a=o.canvas,c=e._cameraUnderground,u;c?u=t:(u=rNe,u.x=a.clientWidth/2,u.y=a.clientHeight/2);let f=s.getPickRay(u,oNe),d,p=r.cartesianToCartographic(s.position,JFt).height,g=Math.abs(qMe)<e.minimumPickingTerrainDistanceWithInertia;(i?g:p<e._minimumPickingTerrainHeight)&&(d=a_(e,u,sNe));let y;if(l(d)&&(y=h.distance(f.origin,d)),!l(e._globe)&&l(y)&&s.getMagnitude()<y&&(y=void 0),l(y)&&(qMe=y),c){let b=JMe(e,f,p);l(y)?y=Math.min(y,b):y=b}l(y)||(y=p);let A=h.normalize(s.position,$Ft);Boe(e,t,n,e.zoomFactor,y,h.dot(A,s.direction))}var lNe=new U,U5=new gn,iM=new h,ZFt=new h,uNe=new M,QFt=new M,fNe=new M,eBt=new Le,tBt=new $,Uoe=new he,zoe=new h;function nBt(e,t,n){let r=e._scene.camera;if(!M.equals(r.transform,M.IDENTITY))return;if(l(n.angleAndHeight)&&(n=n.angleAndHeight),U.equals(t,e._tiltCenterMousePosition)||(e._tiltOnEllipsoid=!1,e._looking=!1),e._looking){let a=e._ellipsoid.geodeticSurfaceNormal(r.position,zoe);Vf(e,t,n,a);return}let s=e._ellipsoid.cartesianToCartographic(r.position,Uoe);e._tiltOnEllipsoid||s.height>e._minimumCollisionTerrainHeight?(e._tiltOnEllipsoid=!0,rBt(e,t,n)):oBt(e,t,n)}var iBt=new he;function rBt(e,t,n){let i=e._ellipsoid,r=e._scene,o=r.camera,s=e.minimumZoomDistance*.25,a=i.cartesianToCartographic(o.positionWC,iBt).height;if(a-s-1<P.EPSILON3&&n.endPosition.y-n.startPosition.y<0)return;let c=r.canvas,u=lNe;u.x=c.clientWidth/2,u.y=c.clientHeight/2;let f=o.getPickRay(u,U5),d,p=xi.rayEllipsoid(f,i);if(l(p))d=gn.getPoint(f,p.start,iM);else if(a>e._minimumTrackBallHeight){let x=xi.grazingAltitudeLocation(f,i);if(!l(x))return;let T=i.cartesianToCartographic(x,Uoe);T.height=0,d=i.cartographicToCartesian(T,iM)}else{e._looking=!0;let x=e._ellipsoid.geodeticSurfaceNormal(o.position,zoe);Vf(e,t,n,x),U.clone(t,e._tiltCenterMousePosition);return}let g=At.eastNorthUpToFixedFrame(d,i,uNe),m=e._globe,y=e._ellipsoid;e._globe=void 0,e._ellipsoid=ee.UNIT_SPHERE,e._rotateFactor=1,e._rotateRateRangeAdjustment=1;let A=M.clone(o.transform,fNe);o._setTransform(g),zf(e,t,n,h.UNIT_Z),o._setTransform(A),e._globe=m,e._ellipsoid=y;let b=y.maximumRadius;e._rotateFactor=1/b,e._rotateRateRangeAdjustment=b}function oBt(e,t,n){let i=e._ellipsoid,r=e._scene,o=r.camera,s=e._cameraUnderground,a,c,u;if(U.equals(t,e._tiltCenterMousePosition))a=h.clone(e._tiltCenter,iM);else{if(a=a_(e,t,iM),!l(a)){if(c=o.getPickRay(t,U5),u=xi.rayEllipsoid(c,i),!l(u)){if(i.cartesianToCartographic(o.position,Uoe).height<=e._minimumTrackBallHeight){e._looking=!0;let C=e._ellipsoid.geodeticSurfaceNormal(o.position,zoe);Vf(e,t,n,C),U.clone(t,e._tiltCenterMousePosition)}return}a=gn.getPoint(c,u.start,iM)}s&&(l(c)||(c=o.getPickRay(t,U5)),ZMe(e,c,a,a)),U.clone(t,e._tiltCenterMousePosition),h.clone(a,e._tiltCenter)}let f=r.canvas,d=lNe;d.x=f.clientWidth/2,d.y=e._tiltCenterMousePosition.y,c=o.getPickRay(d,U5);let p=h.magnitude(a),g=h.fromElements(p,p,p,Loe),m=ee.fromCartesian3(g,Foe);if(u=xi.rayEllipsoid(c,m),!l(u))return;let y=h.magnitude(c.origin)>p?u.start:u.stop,A=gn.getPoint(c,y,ZFt),b=At.eastNorthUpToFixedFrame(a,i,uNe),x=At.eastNorthUpToFixedFrame(A,m,QFt),T=e._globe,E=e._ellipsoid;e._globe=void 0,e._ellipsoid=ee.UNIT_SPHERE,e._rotateFactor=1,e._rotateRateRangeAdjustment=1;let v=h.UNIT_Z,S=M.clone(o.transform,fNe);o._setTransform(x);let I=h.cross(A,o.positionWC,k5);if(h.dot(o.rightWC,I)<0){let _=n.startPosition.y-n.endPosition.y;(s&&_<0||!s&&_>0)&&(v=void 0);let C=o.constrainedAxis;o.constrainedAxis=void 0,zf(e,t,n,v,!0,!1),o.constrainedAxis=C}else zf(e,t,n,v,!0,!1);if(o._setTransform(b),zf(e,t,n,v,!1,!0),l(o.constrainedAxis)){let _=h.cross(o.direction,o.constrainedAxis,k5);h.equalsEpsilon(_,h.ZERO,P.EPSILON6)||(h.dot(_,o.right)<0&&h.negate(_,_),h.cross(_,o.direction,o.up),h.cross(o.direction,o.up,o.right),h.normalize(o.up,o.up),h.normalize(o.right,o.right))}o._setTransform(S),e._globe=T,e._ellipsoid=E;let O=E.maximumRadius;e._rotateFactor=1/O,e._rotateRateRangeAdjustment=O;let L=h.clone(o.positionWC,k5);if(e.enableCollisionDetection&&Voe(e,!0),!h.equals(o.positionWC,L)){o._setTransform(x),o.worldToCameraCoordinatesPoint(L,L);let _=h.magnitudeSquared(L);h.magnitudeSquared(o.position)>_&&(h.normalize(o.position,o.position),h.multiplyByScalar(o.position,Math.sqrt(_),o.position));let C=h.angleBetween(L,o.position),w=h.cross(L,o.position,L);h.normalize(w,w);let D=Le.fromAxisAngle(w,C,eBt),N=$.fromQuaternion(D,tBt);$.multiplyByVector(N,o.direction,o.direction),$.multiplyByVector(N,o.up,o.up),h.cross(o.direction,o.up,o.right),h.cross(o.right,o.direction,o.up),o._setTransform(S)}}var sBt=new U,aBt=new U,YMe=new gn,XMe=new gn,cBt=new h,lBt=new h;function Vf(e,t,n,i){let o=e._scene.camera,s=sBt;s.x=n.startPosition.x,s.y=0;let a=aBt;a.x=n.endPosition.x,a.y=0;let c=o.getPickRay(s,YMe),u=o.getPickRay(a,XMe),f=0,d,p;o.frustum instanceof _n?(d=c.origin,p=u.origin,h.add(o.direction,d,d),h.add(o.direction,p,p),h.subtract(d,o.position,d),h.subtract(p,o.position,p),h.normalize(d,d),h.normalize(p,p)):(d=c.direction,p=u.direction);let g=h.dot(d,p);g<1&&(f=Math.acos(g)),f=n.startPosition.x>n.endPosition.x?-f:f;let m=e._horizontalRotationAxis;if(l(i)?o.look(i,-f):l(m)?o.look(m,-f):o.lookLeft(f),s.x=0,s.y=n.startPosition.y,a.x=0,a.y=n.endPosition.y,c=o.getPickRay(s,YMe),u=o.getPickRay(a,XMe),f=0,o.frustum instanceof _n?(d=c.origin,p=u.origin,h.add(o.direction,d,d),h.add(o.direction,p,p),h.subtract(d,o.position,d),h.subtract(p,o.position,p),h.normalize(d,d),h.normalize(p,p)):(d=c.direction,p=u.direction),g=h.dot(d,p),g<1&&(f=Math.acos(g)),f=n.startPosition.y>n.endPosition.y?-f:f,i=i??m,l(i)){let y=o.direction,A=h.negate(i,cBt),b=h.equalsEpsilon(y,i,P.EPSILON2),x=h.equalsEpsilon(y,A,P.EPSILON2);if(!b&&!x){g=h.dot(y,i);let T=P.acosClamped(g);f>0&&f>T&&(f=T-P.EPSILON4),g=h.dot(y,A),T=P.acosClamped(g),f<0&&-f>T&&(f=-T+P.EPSILON4);let E=h.cross(i,y,lBt);o.look(E,f)}else(b&&f<0||x&&f>0)&&o.look(o.right,-f)}else o.lookUp(f)}function uBt(e){$l(e,e.enableRotate,e.rotateEventTypes,GFt,e.inertiaSpin,"_lastInertiaSpinMovement"),$l(e,e.enableZoom,e.zoomEventTypes,cNe,e.inertiaZoom,"_lastInertiaZoomMovement"),$l(e,e.enableTilt,e.tiltEventTypes,nBt,e.inertiaSpin,"_lastInertiaTiltMovement"),$l(e,e.enableLook,e.lookEventTypes,Vf)}var fBt=new M,dBt=new he;function Voe(e,t){e._adjustedHeightForTerrain=!0;let n=e._scene,i=n.mode;if(i===re.SCENE2D||i===re.MORPHING)return;let r=n.camera,o=n.ellipsoid??ee.WGS84,s=n.mapProjection,a,c;M.equals(r.transform,M.IDENTITY)||(a=M.clone(r.transform,fBt),c=h.magnitude(r.position),r._setTransform(M.IDENTITY));let u=dBt;i===re.SCENE3D?o.cartesianToCartographic(r.position,u):s.unproject(r.position,u);let f=!1;if(u.height<e._minimumCollisionTerrainHeight){let d=e._scene.globeHeight;if(l(d)){let p=d+e.minimumZoomDistance,g=d-e._lastGlobeHeight,m=g/e._lastGlobeHeight;u.height<p&&(t||Math.abs(m)<=.1)&&(u.height=p,i===re.SCENE3D?o.cartographicToCartesian(u,r.position):s.project(u,r.position),f=!0),t||Math.abs(m)<=.1?e._lastGlobeHeight=d:e._lastGlobeHeight+=g*.1}}l(a)&&(r._setTransform(a),f&&(h.normalize(r.position,r.position),h.negate(r.position,r.direction),h.multiplyByScalar(r.position,Math.max(c,e.minimumZoomDistance),r.position),h.normalize(r.direction,r.direction),h.cross(r.direction,r.up,r.right),h.cross(r.right,r.direction,r.up)))}rM.prototype.onMap=function(){let e=this._scene,t=e.mode,n=e.camera;return t===re.COLUMBUS_VIEW?Math.abs(n.position.x)-this._maxCoord.x<0&&Math.abs(n.position.y)-this._maxCoord.y<0:!0};var hBt=new h,mBt=new h;rM.prototype.update=function(){let e=this._scene,{camera:t,globe:n,mode:i}=e;M.equals(t.transform,M.IDENTITY)?(this._globe=n,this._ellipsoid=e.ellipsoid??ee.default):(this._globe=void 0,this._ellipsoid=ee.UNIT_SPHERE);let{verticalExaggeration:r,verticalExaggerationRelativeHeight:o}=e;this._minimumCollisionTerrainHeight=br.getHeight(this.minimumCollisionTerrainHeight,r,o),this._minimumPickingTerrainHeight=br.getHeight(this.minimumPickingTerrainHeight,r,o),this._minimumTrackBallHeight=br.getHeight(this.minimumTrackBallHeight,r,o),this._cameraUnderground=e.cameraUnderground&&l(this._globe);let s=this._ellipsoid.maximumRadius;this._rotateFactor=1/s,this._rotateRateRangeAdjustment=s,this._adjustedHeightForTerrain=!1;let a=h.clone(t.positionWC,hBt),c=h.clone(t.directionWC,mBt);if(i===re.SCENE2D?dFt(this):i===re.COLUMBUS_VIEW?(this._horizontalRotationAxis=h.UNIT_Z,FFt(this)):i===re.SCENE3D&&(this._horizontalRotationAxis=void 0,uBt(this)),this.enableCollisionDetection&&!this._adjustedHeightForTerrain){let u=!h.equals(a,t.positionWC)||!h.equals(c,t.directionWC);Voe(this,u)}this._aggregator.reset()};rM.prototype.isDestroyed=function(){return!1};rM.prototype.destroy=function(){return this._tweens.removeAll(),this._aggregator=this._aggregator&&this._aggregator.destroy(),le(this)};var V5=rM;function oM(e){let t=new gc(e);t.blendingEnabled=!1,t.scissorTest={enabled:!0,rectangle:new et},t.viewport=new et,this._context=e,this._fb=new ci({depthStencil:!0,pixelDatatype:ze.FLOAT,pixelFormat:$e.RGBA}),this._passState=t}function pBt(e,t,n,i){let r=Math.max(n,i),o=r*r,s=Math.floor(n*.5),a=Math.floor(i*.5),c=0,u=0,f=0,d=-1,p=[];for(let g=0;g<o;++g){if(-s<=c&&c<=s&&-a<=u&&u<=a){let m=4*((a-u)*n+c+s),y=t[m],A=e.getObjectByPickColor(y);l(A)&&p.push({object:A,isEdge:t[m+1]>0,depth:t[m+2],x:c,y:u})}if(c===u||c<0&&-c===u||c>0&&c===1-u){let m=f;f=-d,d=m}c+=f,u+=d}return p}oM.prototype.begin=function(e,t){let n=this._context,{width:i,height:r}=t;return et.clone(e,this._passState.scissorTest.rectangle),this._fb.update(n,i,r),this._passState.framebuffer=this._fb.framebuffer,this._passState.viewport.width=i,this._passState.viewport.height=r,this._passState};oM.prototype.end=function(e){let t=e.width??1,n=e.height??1,i=this._context,r=i.readPixels({x:e.x,y:e.y,width:t,height:n,pixelDatatype:ze.FLOAT,framebuffer:this._fb.framebuffer});return pBt(i,r,t,n)};oM.prototype.isDestroyed=function(){return!1};oM.prototype.destroy=function(){return this._fb.destroy(),le(this)};var j5=oM;var sM={},gBt=new et(0,0,3,3),_Bt=new U,yBt=new U,ABt=new gn,bBt=new h,xBt=3,TBt=.1,dNe=9;function joe(e){return Math.sqrt(e.x*e.x+e.y*e.y)}function hNe(e){let t=Number.POSITIVE_INFINITY;for(let s of e)!s.isEdge&&joe(s)<=xBt&&(t=Math.min(t,s.depth));let n=t*(1+TBt),i=e.filter(s=>!s.isEdge||s.depth<=n),r=i.some(s=>s.isEdge);return i.filter(s=>s.isEdge===r).reduce((s,a)=>joe(a)<joe(s)?a:s)}function mNe(e,t){let n,i=Number.POSITIVE_INFINITY;for(let r of e){if(r.isEdge||r.object!==t)continue;let o=r.x*r.x+r.y*r.y;o<i&&(n=r,i=o)}return n}function Hoe(e,t,n){let i=_Bt;i.x=t.x+n.x,i.y=t.y+n.y;let r=e.camera.getPickRay(i,ABt);if(!l(r))return;let o=h.dot(r.direction,e.camera.directionWC);if(o<=0)return;let s=n.depth/o,a=h.multiplyByScalar(r.direction,s,bBt);return h.add(r.origin,a,new h)}sM.snap=function(e,t,n){let i=n?.width??25,r=n?.height??i,{context:o,defaultView:s}=e;if(!o.colorBufferFloat){yt("snap-color-buffer-float","Scene.snap requires the EXT_color_buffer_float extension, which is not supported on this platform.");return}l(s.snapFramebuffer)||(s.snapFramebuffer=new j5(o));let a=s.snapFramebuffer,c=gBt;JO(e,t,c,i,r,{framebuffer:a,snap:!0});let u=a.end(c);if(ZO(e),u.length===0)return;let f=hNe(u);if(!l(f))return;let d=Hoe(e,t,f);if(!l(d))return;let p=d;if(f.isEdge){let g=yBt;g.x=t.x+f.x,g.y=t.y+f.y,JO(e,g,c,dNe,dNe,{framebuffer:a,snap:!0});let m=a.end(c);ZO(e);let y=mNe(m,f.object);p=l(y)?Hoe(e,g,y):void 0}return{object:f.object,isEdge:f.isEdge,position:d,surfacePosition:p,screenPosition:new U(t.x+f.x,t.y+f.y)}};sM._selectBestHit=hNe;sM._nearestSurfaceHit=mNe;sM._snapHitToWorld=Hoe;var H5=sM;var G5=`uniform sampler2D colorTexture; +${sH}`;is.createFXAAStage=function(){return new Ur({name:"czm_FXAA",fragmentShader:eIt,sampleMode:Yd.LINEAR})};is.createAcesTonemappingStage=function(e){let t=e?`#define AUTO_EXPOSURE +`:"";return t+=X6,new Ur({name:"czm_aces",fragmentShader:t,uniforms:{autoExposure:void 0,exposure:1}})};is.createFilmicTonemappingStage=function(e){let t=e?`#define AUTO_EXPOSURE +`:"";return t+=rH,new Ur({name:"czm_filmic",fragmentShader:t,uniforms:{autoExposure:void 0,exposure:1}})};is.createPbrNeutralTonemappingStage=function(e){let t=e?`#define AUTO_EXPOSURE +`:"";return t+=oH,new Ur({name:"czm_pbr_neutral",fragmentShader:t,uniforms:{autoExposure:void 0,exposure:1}})};is.createReinhardTonemappingStage=function(e){let t=e?`#define AUTO_EXPOSURE +`:"";return t+=uH,new Ur({name:"czm_reinhard",fragmentShader:t,uniforms:{autoExposure:void 0,exposure:1}})};is.createModifiedReinhardTonemappingStage=function(e){let t=e?`#define AUTO_EXPOSURE +`:"";return t+=cH,new Ur({name:"czm_modified_reinhard",fragmentShader:t,uniforms:{white:z.WHITE,autoExposure:void 0,exposure:1}})};is.createAutoExposureStage=function(){return new dH};is.createBlackAndWhiteStage=function(){return new Ur({name:"czm_black_and_white",fragmentShader:J6,uniforms:{gradations:5}})};is.createBrightnessStage=function(){return new Ur({name:"czm_brightness",fragmentShader:Q6,uniforms:{brightness:.5}})};is.createNightVisionStage=function(){return new Ur({name:"czm_night_vision",fragmentShader:lH})};is.createDepthViewStage=function(){return new Ur({name:"czm_depth_view",fragmentShader:nH})};is.createLensFlareStage=function(){return new Ur({name:"czm_lens_flare",fragmentShader:aH,uniforms:{dirtTexture:Zt("Assets/Textures/LensFlare/DirtMask.jpg"),starTexture:Zt("Assets/Textures/LensFlare/StarBurst.jpg"),intensity:2,distortion:10,ghostDispersal:.4,haloWidth:.4,dirtAmount:.4,earthRadius:ee.WGS84.maximumRadius}})};var Xd=is;function qg(e){this._collection=e,this._framebuffers=[],this._stageNameToFramebuffer={},this._width=void 0,this._height=void 0,this._updateDependencies=!1}function qR(e){for(;l(e.length);)e=e.get(e.length-1);return e.name}function Jte(e,t,n,i,r){if(!i.enabled||!i._isSupported(t))return r;let o=n[i.name]={};if(l(r)){let a=e.getStageByName(r);o[qR(a)]=!0}let s=i.uniforms;if(l(s)){let a=Object.getOwnPropertyNames(s),c=a.length;for(let u=0;u<c;++u){let f=s[a[u]];if(typeof f=="string"){let d=e.getStageByName(f);l(d)&&(o[qR(d)]=!0)}}}return i.name}function WR(e,t,n,i,r){if(l(i.enabled)&&!i.enabled||l(i._isSupported)&&!i._isSupported(t))return r;let o=r,s=!l(i.inputPreviousStageTexture)||i.inputPreviousStageTexture,a=r,c=i.length;for(let d=0;d<c;++d){let p=i.get(d);l(p.length)?a=WR(e,t,n,p,r):a=Jte(e,t,n,p,r),s&&(r=a)}let u,f;if(s)for(u=1;u<c;++u)f=qR(i.get(u)),l(n[f])||(n[f]={}),n[f][o]=!0;else for(u=1;u<c;++u){f=qR(i.get(u));let d=n[f];for(let p=0;p<u;++p)d[qR(i.get(p))]=!0}return a}function tIt(e,t){let n={};if(l(e.ambientOcclusion)){let i=e.ambientOcclusion,r=e.bloom,o=e._tonemapping,s=e.fxaa,a=WR(e,t,n,i,void 0);a=WR(e,t,n,r,a),a=Jte(e,t,n,o,a),a=WR(e,t,n,e,a),Jte(e,t,n,s,a)}else WR(e,t,n,e,void 0);return n}function nIt(e,t,n){let r=e._collection.getStageByName(t),o=r._textureScale,s=r._forcePowerOfTwo,a=r._pixelFormat,c=r._pixelDatatype,u=r._clearColor,f,d,p=e._framebuffers,g=p.length;for(f=0;f<g;++f){if(d=p[f],o!==d.textureScale||s!==d.forcePowerOfTwo||a!==d.pixelFormat||c!==d.pixelDatatype||!z.equals(u,d.clearColor))continue;let m=d.stages,y=m.length,A=!1;for(let b=0;b<y;++b)if(n[m[b]]){A=!0;break}if(!A)break}return l(d)&&f<g?(d.stages.push(t),d):(d={textureScale:o,forcePowerOfTwo:s,pixelFormat:a,pixelDatatype:c,clearColor:u,stages:[t],buffer:new ci({pixelFormat:a,pixelDatatype:c}),clear:void 0},p.push(d),d)}function iIt(e,t){let n=tIt(e._collection,t);for(let i in n)n.hasOwnProperty(i)&&(e._stageNameToFramebuffer[i]=nIt(e,i,n[i]))}function Zte(e){let t=e._framebuffers,n=t.length;for(let i=0;i<n;++i)t[i].buffer.destroy()}function rIt(e,t){let n=e._width,i=e._height,r=e._framebuffers,o=r.length;for(let s=0;s<o;++s){let a=r[s],c=a.textureScale,u=Math.ceil(n*c),f=Math.ceil(i*c),d=Math.min(u,f);a.forcePowerOfTwo&&(P.isPowerOfTwo(d)||(d=P.nextPowerOfTwo(d)),u=d,f=d),a.buffer.update(t,u,f),a.clear=new fi({color:a.clearColor,framebuffer:a.buffer.framebuffer})}}qg.prototype.updateDependencies=function(){this._updateDependencies=!0};qg.prototype.update=function(e){let t=this._collection,n=this._updateDependencies,i=l(t.ambientOcclusion)&&t.ambientOcclusion.enabled&&t.ambientOcclusion._isSupported(e),r=l(t.bloom)&&t.bloom.enabled&&t.bloom._isSupported(e),o=l(t._tonemapping)&&t._tonemapping.enabled&&t._tonemapping._isSupported(e),s=l(t.fxaa)&&t.fxaa.enabled&&t.fxaa._isSupported(e),a=!l(t._activeStages)||t._activeStages.length>0||i||r||o||s;if((n||!a&&this._framebuffers.length>0)&&(Zte(this),this._framebuffers.length=0,this._stageNameToFramebuffer={},this._width=void 0,this._height=void 0),!n&&!a)return;this._framebuffers.length===0&&iIt(this,e);let c=e.drawingBufferWidth,u=e.drawingBufferHeight,f=this._width!==c||this._height!==u;!n&&!f||(this._width=c,this._height=u,this._updateDependencies=!1,Zte(this),rIt(this,e))};qg.prototype.clear=function(e){let t=this._framebuffers;for(let n=0;n<t.length;++n)t[n].clear.execute(e)};qg.prototype.getStageByName=function(e){return this._collection.getStageByName(e)};qg.prototype.getOutputTexture=function(e){return this._collection.getOutputTexture(e)};qg.prototype.getFramebuffer=function(e){let t=this._stageNameToFramebuffer[e];if(l(t))return t.buffer.framebuffer};qg.prototype.isDestroyed=function(){return!1};qg.prototype.destroy=function(){return Zte(this),le(this)};var rw=qg;var rIe={REINHARD:"REINHARD",MODIFIED_REINHARD:"MODIFIED_REINHARD",FILMIC:"FILMIC",ACES:"ACES",PBR_NEUTRAL:"PBR_NEUTRAL"};Object.freeze(rIe);var EA=rIe;var Qte=[];function ql(){let e=Xd.createFXAAStage(),t=Xd.createAmbientOcclusionStage(),n=Xd.createBloomStage();this._autoExposureEnabled=!1,this._autoExposure=Xd.createAutoExposureStage(),this._exposure=1,this._tonemapping=void 0,this._tonemapper=void 0,this.tonemapper=EA.PBR_NEUTRAL;let i=this._tonemapping;e.enabled=!1,t.enabled=!1,n.enabled=!1,i.enabled=!1;let r=new rw(this),o={},s=Qte;for(s.push(e,t,n,i);s.length>0;){let c=s.pop();o[c.name]=c,c._textureCache=r;let u=c.length;if(l(u))for(let f=0;f<u;++f)s.push(c.get(f))}this._stages=[],this._activeStages=[],this._previousActiveStages=[],this._randomTexture=void 0;let a=this;t.uniforms.randomTexture=function(){return a._randomTexture},this._ao=t,this._bloom=n,this._fxaa=e,this._aoEnabled=void 0,this._bloomEnabled=void 0,this._tonemappingEnabled=void 0,this._fxaaEnabled=void 0,this._activeStagesChanged=!1,this._stagesRemoved=!1,this._textureCacheDirty=!1,this._stageNames=o,this._textureCache=r}Object.defineProperties(ql.prototype,{ready:{get:function(){let e=!1,t=this._stages,n=t.length;for(let a=n-1;a>=0;--a){let c=t[a];e=e||c.ready&&c.enabled}let i=this._fxaa,r=this._ao,o=this._bloom,s=this._tonemapping;return e=e||i.ready&&i.enabled,e=e||r.ready&&r.enabled,e=e||o.ready&&o.enabled,e=e||s.ready&&s.enabled,e}},fxaa:{get:function(){return this._fxaa}},ambientOcclusion:{get:function(){return this._ao}},bloom:{get:function(){return this._bloom}},length:{get:function(){return ene(this),this._stages.length}},outputTexture:{get:function(){let e=this._fxaa;if(e.enabled&&e.ready)return this.getOutputTexture(e.name);let t=this._stages,n=t.length;for(let s=n-1;s>=0;--s){let a=t[s];if(l(a)&&a.ready&&a.enabled)return this.getOutputTexture(a.name)}let i=this._tonemapping;if(i.enabled&&i.ready)return this.getOutputTexture(i.name);let r=this._bloom;if(r.enabled&&r.ready)return this.getOutputTexture(r.name);let o=this._ao;if(o.enabled&&o.ready)return this.getOutputTexture(o.name)}},hasSelected:{get:function(){let e=this._stages.slice();for(;e.length>0;){let t=e.pop();if(!l(t))continue;if(l(t.selected))return!0;let n=t.length;if(l(n))for(let i=0;i<n;++i)e.push(t.get(i))}return!1}},tonemapper:{get:function(){return this._tonemapper},set:function(e){if(this._tonemapper===e)return;l(this._tonemapping)&&(delete this._stageNames[this._tonemapping.name],this._tonemapping.destroy());let t=this._autoExposureEnabled,n;switch(e){case EA.REINHARD:n=Xd.createReinhardTonemappingStage(t);break;case EA.MODIFIED_REINHARD:n=Xd.createModifiedReinhardTonemappingStage(t);break;case EA.FILMIC:n=Xd.createFilmicTonemappingStage(t);break;case EA.PBR_NEUTRAL:n=Xd.createPbrNeutralTonemappingStage(t);break;default:n=Xd.createAcesTonemappingStage(t);break}if(t){let i=this._autoExposure;n.uniforms.autoExposure=function(){return i.outputTexture}}else n.uniforms.exposure=this._exposure;this._tonemapper=e,this._tonemapping=n,l(this._stageNames)&&(this._stageNames[n.name]=n,n._textureCache=this._textureCache),this._textureCacheDirty=!0}},exposure:{get:function(){return this._exposure},set:function(e){this._tonemapping.uniforms.exposure=e,this._exposure=e}}});function ene(e){if(!e._stagesRemoved)return;e._stagesRemoved=!1;let t=[],n=e._stages;for(let i=0,r=0;i<n.length;++i){let o=n[i];o&&(o._index=r++,t.push(o))}e._stages=t}ql.prototype.add=function(e){let t=this._stageNames,n=Qte;for(n.push(e);n.length>0;){let r=n.pop();t[r.name]=r,r._textureCache=this._textureCache;let o=r.length;if(l(o))for(let s=0;s<o;++s)n.push(r.get(s))}let i=this._stages;return e._index=i.length,i.push(e),this._textureCacheDirty=!0,e};ql.prototype.remove=function(e){if(!this.contains(e))return!1;let t=this._stageNames,n=Qte;for(n.push(e);n.length>0;){let i=n.pop();delete t[i.name];let r=i.length;if(l(r))for(let o=0;o<r;++o)n.push(i.get(o))}return this._stages[e._index]=void 0,this._stagesRemoved=!0,this._textureCacheDirty=!0,e._index=void 0,e._textureCache=void 0,e.destroy(),!0};ql.prototype.contains=function(e){return l(e)&&l(e._index)&&e._textureCache===this._textureCache};ql.prototype.get=function(e){return ene(this),this._stages[e]};ql.prototype.removeAll=function(){let e=this._stages,t=e.length;for(let n=0;n<t;++n)this.remove(e[n]);e.length=0};ql.prototype.getStageByName=function(e){return this._stageNames[e]};ql.prototype.update=function(e,t,n){ene(this);let i=this._activeStages,r=this._activeStages=this._previousActiveStages;this._previousActiveStages=i;let o=this._stages;r.length=o.length;let s=0;for(let b=0;b<o.length;++b){let x=o[b];x.ready&&x.enabled&&x._isSupported(e)&&(r[s++]=x)}r.length=s;let a=s!==i.length;if(!a){for(let b=0;b<s;++b)if(r[b]!==i[b]){a=!0;break}}let c=this._ao,u=this._bloom,f=this._autoExposure,d=this._tonemapping,p=this._fxaa;d.enabled=n;let g=c.enabled&&c._isSupported(e),m=u.enabled&&u._isSupported(e),y=d.enabled&&d._isSupported(e),A=p.enabled&&p._isSupported(e);if((a||this._textureCacheDirty||g!==this._aoEnabled||m!==this._bloomEnabled||y!==this._tonemappingEnabled||A!==this._fxaaEnabled)&&(this._textureCache.updateDependencies(),this._aoEnabled=g,this._bloomEnabled=m,this._tonemappingEnabled=y,this._fxaaEnabled=A,this._textureCacheDirty=!1),l(this._randomTexture)&&!g&&(this._randomTexture.destroy(),this._randomTexture=void 0),!l(this._randomTexture)&&g){let x=new Uint8Array(196608);for(let T=0;T<196608;T+=3)x[T]=Math.floor(Math.random()*255);this._randomTexture=new Dt({context:e,pixelFormat:$e.RGB,pixelDatatype:ze.UNSIGNED_BYTE,source:{arrayBufferView:x,width:256,height:256},sampler:new Ht({wrapS:hn.REPEAT,wrapT:hn.REPEAT,minificationFilter:Wt.NEAREST,magnificationFilter:Jn.NEAREST})})}this._textureCache.update(e),p.update(e,t),c.update(e,t),u.update(e,t),d.update(e,t),this._autoExposureEnabled&&f.update(e,t);for(let b=0;b<o.length;++b)o[b].update(e,t);s=0;for(let b=0;b<o.length;++b){let x=o[b];x.ready&&x.enabled&&x._isSupported(e)&&s++}a=s!==r.length,a&&this.update(e,t,n)};ql.prototype.clear=function(e){this._textureCache.clear(e),this._autoExposureEnabled&&this._autoExposure.clear(e)};function mT(e){for(;l(e.length);)e=e.get(e.length-1);return e.outputTexture}ql.prototype.getOutputTexture=function(e){let t=this.getStageByName(e);if(l(t))return mT(t)};function Zp(e,t,n,i,r){if(l(e.execute)){e.execute(t,n,i,r);return}if(e.inputPreviousStageTexture){Zp(e.get(0),t,n,i,r);for(let o=1;o<e.length;++o)Zp(e.get(o),t,mT(e.get(o-1)),i,r)}else for(let o=0;o<e.length;++o)Zp(e.get(o),t,n,i,r)}ql.prototype.execute=function(e,t,n,i){let r=this._activeStages,o=r.length,s=this._fxaa,a=this._ao,c=this._bloom,u=this._autoExposure,f=this._tonemapping,d=a.enabled&&a._isSupported(e),p=c.enabled&&c._isSupported(e),g=this._autoExposureEnabled,m=f.enabled&&f._isSupported(e),y=s.enabled&&s._isSupported(e);if(!y&&!d&&!p&&!m&&o===0)return;let A=t;d&&a.ready&&(Zp(a,e,A,n,i),A=mT(a)),p&&c.ready&&(Zp(c,e,A,n,i),A=mT(c)),g&&u.ready&&Zp(u,e,A,n,i),m&&f.ready&&(Zp(f,e,A,n,i),A=mT(f));let b=A;if(o>0){Zp(r[0],e,A,n,i);for(let x=1;x<o;++x)Zp(r[x],e,mT(r[x-1]),n,i);b=mT(r[o-1])}y&&s.ready&&Zp(s,e,b,n,i)};ql.prototype.copy=function(e,t){if(!l(this._copyColorCommand)){let n=this;this._copyColorCommand=e.createViewportQuadCommand(Pf,{uniformMap:{colorTexture:function(){return n.outputTexture}},owner:this})}this._copyColorCommand.framebuffer=t,this._copyColorCommand.execute(e)};ql.prototype.isDestroyed=function(){return!1};ql.prototype.destroy=function(){return this._fxaa.destroy(),this._ao.destroy(),this._bloom.destroy(),this._autoExposure.destroy(),this._tonemapping.destroy(),this.removeAll(),this._textureCache=this._textureCache&&this._textureCache.destroy(),le(this)};var hH=ql;var oIe={SHIFT:0,CTRL:1,ALT:2};Object.freeze(oIe);var oo=oIe;var sIe={LEFT_DOWN:0,LEFT_UP:1,LEFT_CLICK:2,LEFT_DOUBLE_CLICK:3,RIGHT_DOWN:5,RIGHT_UP:6,RIGHT_CLICK:7,MIDDLE_DOWN:10,MIDDLE_UP:11,MIDDLE_CLICK:12,MOUSE_MOVE:15,WHEEL:16,PINCH_START:17,PINCH_END:18,PINCH_MOVE:19};Object.freeze(sIe);var fn=sIe;function CA(e,t,n){let i=e._element;if(i===document)return n.x=t.clientX,n.y=t.clientY,n;let r=i.getBoundingClientRect();return n.x=t.clientX-r.left,n.y=t.clientY-r.top,n}function sne(e,t){if(!l(t))return`${e}`;let n=Array.isArray(t)?t.toSorted():[t];return`${e}+${n.join("+")}`}function pT(e){let t=[];if(e.shiftKey&&t.push(oo.SHIFT),e.ctrlKey&&t.push(oo.CTRL),e.altKey&&t.push(oo.ALT),t.length)return t}var _s={LEFT:0,MIDDLE:1,RIGHT:2};function Rf(e,t,n,i){function r(o){i(e,o)}n.addEventListener(t,r,{capture:!1,passive:!1}),e._removalFunctions.push(function(){n.removeEventListener(t,r,!1)})}function oIt(e){let t=e._element,n=l(t.disableRootEvents)?t:document;dn.supportsPointerEvents()?(Rf(e,"pointerdown",t,fIt),Rf(e,"pointerup",t,gIe),Rf(e,"pointermove",t,dIt),Rf(e,"pointercancel",t,gIe)):(Rf(e,"mousedown",t,_Ie),Rf(e,"mouseup",n,yIe),Rf(e,"mousemove",n,AIe),Rf(e,"touchstart",t,lIt),Rf(e,"touchend",n,fIe),Rf(e,"touchmove",n,uIt),Rf(e,"touchcancel",n,fIe)),Rf(e,"dblclick",t,aIt);let i;"onwheel"in t?i="wheel":document.onmousewheel!==void 0?i="mousewheel":i="DOMMouseScroll",Rf(e,i,t,cIt)}function sIt(e){let t=e._removalFunctions;for(let n=0;n<t.length;++n)t[n]()}var aIe={position:new U};function ane(e){e._lastSeenTouchEvent=xn()}function cne(e){return xn()-e._lastSeenTouchEvent>fm.mouseEmulationIgnoreMilliseconds}function one(e,t,n){let i=e.x-t.x,r=e.y-t.y;return Math.sqrt(i*i+r*r)<n}function _Ie(e,t){if(!cne(e))return;let n=t.button;e._buttonDown[n]=!0;let i;if(n===_s.LEFT)i=fn.LEFT_DOWN;else if(n===_s.MIDDLE)i=fn.MIDDLE_DOWN;else if(n===_s.RIGHT)i=fn.RIGHT_DOWN;else return;let r=CA(e,t,e._primaryPosition);U.clone(r,e._primaryStartPosition),U.clone(r,e._primaryPreviousPosition);let o=pT(t),s=e.getInputAction(i,o);l(s)&&(U.clone(r,aIe.position),s(aIe),t.preventDefault())}var cIe={position:new U},lIe={position:new U};function tne(e,t,n,i){let r=pT(i),o=e.getInputAction(t,r),s=e.getInputAction(n,r);if(l(o)||l(s)){let a=CA(e,i,e._primaryPosition);if(l(o)&&(U.clone(a,cIe.position),o(cIe)),l(s)){let c=e._primaryStartPosition;one(c,a,e._clickPixelTolerance)&&(U.clone(a,lIe.position),s(lIe))}}}function yIe(e,t){if(!cne(e))return;let n=t.button;n!==_s.LEFT&&n!==_s.MIDDLE&&n!==_s.RIGHT||(e._buttonDown[_s.LEFT]&&(tne(e,fn.LEFT_UP,fn.LEFT_CLICK,t),e._buttonDown[_s.LEFT]=!1),e._buttonDown[_s.MIDDLE]&&(tne(e,fn.MIDDLE_UP,fn.MIDDLE_CLICK,t),e._buttonDown[_s.MIDDLE]=!1),e._buttonDown[_s.RIGHT]&&(tne(e,fn.RIGHT_UP,fn.RIGHT_CLICK,t),e._buttonDown[_s.RIGHT]=!1))}var nne={startPosition:new U,endPosition:new U};function AIe(e,t){if(!cne(e))return;let n=pT(t),i=CA(e,t,e._primaryPosition),r=e._primaryPreviousPosition,o=e.getInputAction(fn.MOUSE_MOVE,n);l(o)&&(U.clone(r,nne.startPosition),U.clone(i,nne.endPosition),o(nne)),U.clone(i,r),(e._buttonDown[_s.LEFT]||e._buttonDown[_s.MIDDLE]||e._buttonDown[_s.RIGHT])&&t.preventDefault()}var uIe={position:new U};function aIt(e,t){let n=t.button,i;if(n===_s.LEFT)i=fn.LEFT_DOUBLE_CLICK;else return;let r=pT(t),o=e.getInputAction(i,r);l(o)&&(CA(e,t,uIe.position),o(uIe))}function cIt(e,t){let n;if(l(t.deltaY)){let o=t.deltaMode;o===t.DOM_DELTA_PIXEL?n=-t.deltaY:o===t.DOM_DELTA_LINE?n=-t.deltaY*40:n=-t.deltaY*120}else t.detail>0?n=t.detail*-120:n=t.wheelDelta;if(!l(n))return;let i=pT(t),r=e.getInputAction(fn.WHEEL,i);l(r)&&(r(n),t.preventDefault())}function lIt(e,t){ane(e);let n=t.changedTouches,i,r=n.length,o,s,a=e._positions;for(i=0;i<r;++i)o=n[i],s=o.identifier,a.set(s,CA(e,o,new U));mH(e,t);let c=e._previousPositions;for(i=0;i<r;++i)o=n[i],s=o.identifier,c.set(s,U.clone(a.get(s)))}function fIe(e,t){ane(e);let n=t.changedTouches,i,r=n.length,o,s,a=e._positions;for(i=0;i<r;++i)o=n[i],s=o.identifier,a.remove(s);mH(e,t);let c=e._previousPositions;for(i=0;i<r;++i)o=n[i],s=o.identifier,c.remove(s)}var dIe={position:new U},ine={position1:new U,position2:new U},hIe={position:new U},mIe={position:new U},pIe={position:new U};function mH(e,t){let n=pT(t),i=e._positions,r=i.length,o,s,a=e._isPinching;if(r!==1&&e._buttonDown[_s.LEFT]){if(e._buttonDown[_s.LEFT]=!1,l(e._touchHoldTimer)&&(clearTimeout(e._touchHoldTimer),e._touchHoldTimer=void 0),o=e.getInputAction(fn.LEFT_UP,n),l(o)&&(U.clone(e._primaryPosition,hIe.position),o(hIe)),r===0&&!e._isTouchHolding&&(s=e.getInputAction(fn.LEFT_CLICK,n),l(s))){let c=e._primaryStartPosition,u=e._previousPositions.values[0];one(c,u,e._clickPixelTolerance)&&(U.clone(e._primaryPosition,mIe.position),s(mIe))}e._isTouchHolding=!1}if(r===0&&a&&(e._isPinching=!1,o=e.getInputAction(fn.PINCH_END,n),l(o)&&o()),r===1&&!a){let c=i.values[0];U.clone(c,e._primaryPosition),U.clone(c,e._primaryStartPosition),U.clone(c,e._primaryPreviousPosition),e._buttonDown[_s.LEFT]=!0,o=e.getInputAction(fn.LEFT_DOWN,n),l(o)&&(U.clone(c,dIe.position),o(dIe)),e._touchHoldTimer=setTimeout(function(){if(!e.isDestroyed()&&(e._touchHoldTimer=void 0,e._isTouchHolding=!0,s=e.getInputAction(fn.RIGHT_CLICK,n),l(s))){let u=e._primaryStartPosition,f=e._previousPositions.values[0];one(u,f,e._holdPixelTolerance)&&(U.clone(e._primaryPosition,pIe.position),s(pIe))}},fm.touchHoldDelayMilliseconds),t.preventDefault()}r===2&&!a&&(e._isPinching=!0,o=e.getInputAction(fn.PINCH_START,n),l(o)&&(U.clone(i.values[0],ine.position1),U.clone(i.values[1],ine.position2),o(ine),t.preventDefault()))}function uIt(e,t){ane(e);let n=t.changedTouches,i,r=n.length,o,s,a=e._positions;for(i=0;i<r;++i){o=n[i],s=o.identifier;let u=a.get(s);l(u)&&CA(e,o,u)}bIe(e,t);let c=e._previousPositions;for(i=0;i<r;++i)o=n[i],s=o.identifier,U.clone(a.get(s),c.get(s))}var rne={startPosition:new U,endPosition:new U},YR={distance:{startPosition:new U,endPosition:new U},angleAndHeight:{startPosition:new U,endPosition:new U}};function bIe(e,t){let n=pT(t),i=e._positions,r=e._previousPositions,o=i.length,s;if(o===1&&e._buttonDown[_s.LEFT]){let a=i.values[0];U.clone(a,e._primaryPosition);let c=e._primaryPreviousPosition;s=e.getInputAction(fn.MOUSE_MOVE,n),l(s)&&(U.clone(c,rne.startPosition),U.clone(a,rne.endPosition),s(rne)),U.clone(a,c),t.preventDefault()}else if(o===2&&e._isPinching&&(s=e.getInputAction(fn.PINCH_MOVE,n),l(s))){let a=i.values[0],c=i.values[1],u=r.values[0],f=r.values[1],d=c.x-a.x,p=c.y-a.y,g=Math.sqrt(d*d+p*p)*.25,m=f.x-u.x,y=f.y-u.y,A=Math.sqrt(m*m+y*y)*.25,b=(c.y+a.y)*.125,x=(f.y+u.y)*.125,T=Math.atan2(p,d),E=Math.atan2(y,m);U.fromElements(0,A,YR.distance.startPosition),U.fromElements(0,g,YR.distance.endPosition),U.fromElements(E,x,YR.angleAndHeight.startPosition),U.fromElements(T,b,YR.angleAndHeight.endPosition),s(YR)}}function fIt(e,t){if(t.target.setPointerCapture(t.pointerId),t.pointerType==="touch"){let n=e._positions,i=t.pointerId;n.set(i,CA(e,t,new U)),mH(e,t),e._previousPositions.set(i,U.clone(n.get(i)))}else _Ie(e,t)}function gIe(e,t){if(t.pointerType==="touch"){let n=e._positions,i=t.pointerId;n.remove(i),mH(e,t),e._previousPositions.remove(i)}else yIe(e,t)}function dIt(e,t){if(t.pointerType==="touch"){let n=e._positions,i=t.pointerId,r=n.get(i);if(!l(r))return;CA(e,t,r),bIe(e,t);let o=e._previousPositions;U.clone(n.get(i),o.get(i))}else AIe(e,t)}function fm(e){this._inputEvents={},this._buttonDown={[_s.LEFT]:!1,[_s.MIDDLE]:!1,[_s.RIGHT]:!1},this._isPinching=!1,this._isTouchHolding=!1,this._lastSeenTouchEvent=-fm.mouseEmulationIgnoreMilliseconds,this._primaryStartPosition=new U,this._primaryPosition=new U,this._primaryPreviousPosition=new U,this._positions=new zt,this._previousPositions=new zt,this._removalFunctions=[],this._touchHoldTimer=void 0,this._clickPixelTolerance=5,this._holdPixelTolerance=25,this._element=e??document,oIt(this)}fm.prototype.setInputAction=function(e,t,n){let i=sne(t,n);this._inputEvents[i]=e};fm.prototype.getInputAction=function(e,t){let n=sne(e,t);return this._inputEvents[n]};fm.prototype.removeInputAction=function(e,t){let n=sne(e,t);delete this._inputEvents[n]};fm.prototype.isDestroyed=function(){return!1};fm.prototype.destroy=function(){return sIt(this),le(this)};fm.mouseEmulationIgnoreMilliseconds=800;fm.touchHoldDelayMilliseconds=1500;var xa=fm;function gT(e){this._scene=e,this._currentTweens=[],this._morphHandler=void 0,this._morphCancelled=!1,this._completeMorph=void 0,this._morphToOrthographic=!1}gT.prototype.completeMorph=function(){l(this._completeMorph)&&this._completeMorph()};gT.prototype.morphTo2D=function(e,t){l(this._completeMorph)&&this._completeMorph();let n=this._scene;this._previousMode=n.mode,this._morphToOrthographic=n.camera.frustum instanceof _n,!(this._previousMode===re.SCENE2D||this._previousMode===re.MORPHING)&&(this._scene.morphStart.raiseEvent(this,this._previousMode,re.SCENE2D,!0),n._mode=re.MORPHING,n.camera._setTransform(M.IDENTITY),this._previousMode===re.COLUMBUS_VIEW?WIt(this,e):ZIt(this,e,t),e===0&&l(this._completeMorph)&&this._completeMorph())};var hIt=new h,mIt=new h,pIt=new h,gIt=new h,_It=new h,yIt=new h,AIt=new h,bIt=new he,xIt=new M,TIt=new Ji,EIt=new _n,CIt={position:void 0,direction:void 0,up:void 0,position2D:void 0,direction2D:void 0,up2D:void 0,frustum:void 0};gT.prototype.morphToColumbusView=function(e,t){l(this._completeMorph)&&this._completeMorph();let n=this._scene;if(this._previousMode=n.mode,this._previousMode===re.COLUMBUS_VIEW||this._previousMode===re.MORPHING)return;this._scene.morphStart.raiseEvent(this,this._previousMode,re.COLUMBUS_VIEW,!0),n.camera._setTransform(M.IDENTITY);let i=hIt,r=mIt,o=pIt;if(e>0)i.x=0,i.y=-1,i.z=1,i=h.multiplyByScalar(h.normalize(i,i),5*t.maximumRadius,i),h.negate(h.normalize(i,r),r),h.cross(h.UNIT_X,r,o);else{let u=n.camera;if(this._previousMode===re.SCENE2D)h.clone(u.position,i),i.z=u.frustum.right-u.frustum.left,h.negate(h.UNIT_Z,r),h.clone(h.UNIT_Y,o);else{h.clone(u.positionWC,i),h.clone(u.directionWC,r),h.clone(u.upWC,o);let f=t.scaleToGeodeticSurface(i,AIt),d=At.eastNorthUpToFixedFrame(f,t,xIt);M.inverseTransformation(d,d),n.mapProjection.project(t.cartesianToCartographic(i,bIt),i),M.multiplyByPointAsVector(d,r,r),M.multiplyByPointAsVector(d,o,o)}}let s;this._morphToOrthographic?(s=EIt,s.width=n.camera.frustum.right-n.camera.frustum.left,s.aspectRatio=n.drawingBufferWidth/n.drawingBufferHeight):(s=TIt,s.aspectRatio=n.drawingBufferWidth/n.drawingBufferHeight,s.fov=P.toRadians(60));let a=CIt;a.position=i,a.direction=r,a.up=o,a.frustum=s;let c=ePt(a);XR(this,c),this._previousMode===re.SCENE2D?QIt(this,e,a,c):(a.position2D=M.multiplyByPoint(Nr.TRANSFORM_2D,i,gIt),a.direction2D=M.multiplyByPointAsVector(Nr.TRANSFORM_2D,r,_It),a.up2D=M.multiplyByPointAsVector(Nr.TRANSFORM_2D,o,yIt),n._mode=re.MORPHING,RIe(this,e,a,c)),e===0&&l(this._completeMorph)&&this._completeMorph()};var fne={position:new h,direction:new h,up:new h,frustum:void 0},TIe=new Ji;gT.prototype.morphTo3D=function(e,t){l(this._completeMorph)&&this._completeMorph();let n=this._scene;if(this._previousMode=n.mode,!(this._previousMode===re.SCENE3D||this._previousMode===re.MORPHING)){if(this._scene.morphStart.raiseEvent(this,this._previousMode,re.SCENE3D,!0),n._mode=re.MORPHING,n.camera._setTransform(M.IDENTITY),this._previousMode===re.SCENE2D)LIt(this,e,t);else{let i;e>0?(i=fne,h.fromDegrees(0,0,5*t.maximumRadius,t,i.position),h.negate(i.position,i.direction),h.normalize(i.direction,i.direction),h.clone(h.UNIT_Z,i.up)):i=EIe(this,t);let r,o=n.camera;o.frustum instanceof _n?r=o.frustum.clone():(r=TIe,r.aspectRatio=n.drawingBufferWidth/n.drawingBufferHeight,r.fov=P.toRadians(60)),i.frustum=r;let s=MIe(i);XR(this,s),une(this,e,i,s)}e===0&&l(this._completeMorph)&&this._completeMorph()}};gT.prototype.isDestroyed=function(){return!1};gT.prototype.destroy=function(){return pH(this),le(this)};function XR(e,t){if(e._scene.completeMorphOnUserInput){e._morphHandler=new xa(e._scene.canvas);let n=function(){e._morphCancelled=!0,e._scene.camera.cancelFlight(),t(e)};e._completeMorph=n,e._morphHandler.setInputAction(n,fn.LEFT_DOWN),e._morphHandler.setInputAction(n,fn.MIDDLE_DOWN),e._morphHandler.setInputAction(n,fn.RIGHT_DOWN),e._morphHandler.setInputAction(n,fn.WHEEL)}}function pH(e){let t=e._currentTweens;for(let n=0;n<t.length;++n)t[n].cancelTween();e._currentTweens.length=0,e._morphHandler=e._morphHandler&&e._morphHandler.destroy()}var vIt=new he,SIt=new h,wIt=new M;function EIe(e,t){let n=e._scene,i=n.camera,r=fne,o=r.position,s=r.direction,a=r.up,c=n.mapProjection.unproject(i.position,vIt);t.cartographicToCartesian(c,o);let u=t.scaleToGeodeticSurface(o,SIt),f=At.eastNorthUpToFixedFrame(u,t,wIt);return M.multiplyByPointAsVector(f,i.direction,s),M.multiplyByPointAsVector(f,i.up,a),r}var IIt=new h,PIt=new h,DIt=new h,RIt=new h,OIt=new h,MIt=new h;function une(e,t,n,i){t*=.5;let r=e._scene,o=r.camera,s=h.clone(o.position,IIt),a=h.clone(o.direction,PIt),c=h.clone(o.up,DIt),u=M.multiplyByPoint(Nr.TRANSFORM_2D_INVERSE,n.position,RIt),f=M.multiplyByPointAsVector(Nr.TRANSFORM_2D_INVERSE,n.direction,OIt),d=M.multiplyByPointAsVector(Nr.TRANSFORM_2D_INVERSE,n.up,MIt);function p(m){Kd(s,u,m.time,o.position),Kd(a,f,m.time,o.direction),Kd(c,d,m.time,o.up),h.cross(o.direction,o.up,o.right),h.normalize(o.right,o.right)}let g=r.tweens.add({duration:t,easingFunction:ks.QUARTIC_OUT,startObject:{time:0},stopObject:{time:1},update:p,complete:function(){OIe(e,r,0,1,t,i)}});e._currentTweens.push(g)}var NIt=new _n,CIe=new h,vIe=new h,SIe=new h,dne=new h,wIe=new h,IIe=new h;function LIt(e,t,n){t/=3;let i=e._scene,r=i.camera,o;t>0?(o=fne,h.fromDegrees(0,0,5*n.maximumRadius,n,o.position),h.negate(o.position,o.direction),h.normalize(o.direction,o.direction),h.clone(h.UNIT_Z,o.up)):(r.position.z=r.frustum.right-r.frustum.left,o=EIe(e,n));let s;e._morphToOrthographic?(s=NIt,s.aspectRatio=i.drawingBufferWidth/i.drawingBufferHeight,s.width=r.frustum.right-r.frustum.left):(s=TIe,s.aspectRatio=i.drawingBufferWidth/i.drawingBufferHeight,s.fov=P.toRadians(60)),o.frustum=s;let a=MIe(o);XR(e,a);let c;e._morphToOrthographic?c=function(){une(e,t,o,a)}:c=function(){DIe(e,t,o,function(){une(e,t,o,a)})},t>0?(i._mode=re.SCENE2D,r.flyTo({duration:t,destination:h.fromDegrees(0,0,5*n.maximumRadius,n,dne),complete:function(){i._mode=re.MORPHING,c()}})):c()}function Kd(e,t,n,i){return h.lerp(e,t,n,i)}function PIe(e,t,n,i,r){let o=e._scene,s=o.camera;if(s.frustum instanceof _n)return;let a=s.frustum.fov,c=P.RADIANS_PER_DEGREE*.5,u=n.position.z*Math.tan(a*.5);s.frustum.far=u/Math.tan(c*.5)+1e7;function f(p){s.frustum.fov=P.lerp(a,c,p.time);let g=u/Math.tan(s.frustum.fov*.5);i(s,g)}let d=o.tweens.add({duration:t,easingFunction:ks.QUARTIC_OUT,startObject:{time:0},stopObject:{time:1},update:f,complete:function(){s.frustum=n.frustum.clone(),r(e)}});e._currentTweens.push(d)}var FIt=new h,BIt=new h,kIt=new h,lne=new h,UIt=new h,zIt=new h,VIt=new Ss,jIt=new gn,HIt=new h,GIt={position:void 0,direction:void 0,up:void 0,frustum:void 0};function WIt(e,t){t*=.5;let n=e._scene,i=n.camera,r=h.clone(i.position,FIt),o=h.clone(i.direction,BIt),s=h.clone(i.up,kIt),a=h.negate(h.UNIT_Z,UIt),c=h.clone(h.UNIT_Y,zIt),u=lne;if(t>0)h.clone(h.ZERO,lne),u.z=5*n.ellipsoid.maximumRadius;else{h.clone(r,lne);let A=jIt;M.multiplyByPoint(Nr.TRANSFORM_2D,r,A.origin),M.multiplyByPointAsVector(Nr.TRANSFORM_2D,o,A.direction);let b=n.globe;if(l(b)){let x=b.pickWorldCoordinates(A,n,!0,HIt);l(x)&&(M.multiplyByPoint(Nr.TRANSFORM_2D_INVERSE,x,u),u.z+=h.distance(r,u))}}let f=VIt;f.right=u.z*.5,f.left=-f.right,f.top=f.right*(n.drawingBufferHeight/n.drawingBufferWidth),f.bottom=-f.top;let d=GIt;d.position=u,d.direction=a,d.up=c,d.frustum=f;let p=NIe(d);XR(e,p);function g(A){Kd(r,u,A.time,i.position),Kd(o,a,A.time,i.direction),Kd(s,c,A.time,i.up),h.cross(i.direction,i.up,i.right),h.normalize(i.right,i.right),i._adjustOrthographicFrustum(!0)}function m(A,b){A.position.z=b}let y=n.tweens.add({duration:t,easingFunction:ks.QUARTIC_OUT,startObject:{time:0},stopObject:{time:1},update:g,complete:function(){PIe(e,t,d,m,p)}});e._currentTweens.push(y)}var xIe=new he,qIt={position:new h,direction:new h,up:new h,position2D:new h,direction2D:new h,up2D:new h,frustum:new Ss},YIt={position:new h,direction:new h,up:new h,frustum:void 0},XIt=new h,KIt=new gn,$It=new M,JIt=new h;function ZIt(e,t,n){t*=.5;let i=e._scene,r=i.camera,o=qIt;if(t>0)h.clone(h.ZERO,o.position),o.position.z=5*n.maximumRadius,h.negate(h.UNIT_Z,o.direction),h.clone(h.UNIT_Y,o.up);else{n.cartesianToCartographic(r.positionWC,xIe),i.mapProjection.project(xIe,o.position),h.negate(h.UNIT_Z,o.direction),h.clone(h.UNIT_Y,o.up);let d=KIt;h.clone(o.position2D,d.origin);let p=h.clone(r.directionWC,d.direction),g=n.scaleToGeodeticSurface(r.positionWC,JIt),m=At.eastNorthUpToFixedFrame(g,n,$It);M.inverseTransformation(m,m),M.multiplyByPointAsVector(m,p,p),M.multiplyByPointAsVector(Nr.TRANSFORM_2D,p,p);let y=i.globe;if(l(y)){let A=y.pickWorldCoordinates(d,i,!0,XIt);if(l(A)){let b=h.distance(o.position2D,A);A.x+=b,h.clone(A,o.position2D)}}}function s(d,p){d.position.x=p}M.multiplyByPoint(Nr.TRANSFORM_2D,o.position,o.position2D),M.multiplyByPointAsVector(Nr.TRANSFORM_2D,o.direction,o.direction2D),M.multiplyByPointAsVector(Nr.TRANSFORM_2D,o.up,o.up2D);let a=o.frustum;a.right=o.position.z*.5,a.left=-a.right,a.top=a.right*(i.drawingBufferHeight/i.drawingBufferWidth),a.bottom=-a.top;let c=YIt;M.multiplyByPoint(Nr.TRANSFORM_2D_INVERSE,o.position2D,c.position),h.clone(o.direction,c.direction),h.clone(o.up,c.up),c.frustum=a;let u=NIe(c);XR(e,u);function f(){PIe(e,t,o,s,u)}RIe(e,t,o,f)}function DIe(e,t,n,i){let r=e._scene,o=r.camera,s=o.frustum.right-o.frustum.left;o.frustum=n.frustum.clone();let a=o.frustum.fov,c=P.RADIANS_PER_DEGREE*.5,u=s*Math.tan(a*.5);o.frustum.far=u/Math.tan(c*.5)+1e7,o.frustum.fov=c;function f(p){o.frustum.fov=P.lerp(c,a,p.time),o.position.z=u/Math.tan(o.frustum.fov*.5)}let d=r.tweens.add({duration:t,easingFunction:ks.QUARTIC_OUT,startObject:{time:0},stopObject:{time:1},update:f,complete:function(){i(e)}});e._currentTweens.push(d)}function QIt(e,t,n,i){t*=.5;let r=e._scene,o=r.camera,s=h.clone(n.position,dne),a=h.clone(n.direction,wIe),c=h.clone(n.up,IIe);r._mode=re.MORPHING;function u(){o.frustum=n.frustum.clone();let f=h.clone(o.position,CIe),d=h.clone(o.direction,vIe),p=h.clone(o.up,SIe);f.z=s.z;function g(y){Kd(f,s,y.time,o.position),Kd(d,a,y.time,o.direction),Kd(p,c,y.time,o.up),h.cross(o.direction,o.up,o.right),h.normalize(o.right,o.right)}let m=r.tweens.add({duration:t,easingFunction:ks.QUARTIC_OUT,startObject:{time:0},stopObject:{time:1},update:g,complete:function(){i(e)}});e._currentTweens.push(m)}e._morphToOrthographic?u():DIe(e,0,n,u)}function RIe(e,t,n,i){let r=e._scene,o=r.camera,s=h.clone(o.position,CIe),a=h.clone(o.direction,vIe),c=h.clone(o.up,SIe),u=h.clone(n.position2D,dne),f=h.clone(n.direction2D,wIe),d=h.clone(n.up2D,IIe);function p(m){Kd(s,u,m.time,o.position),Kd(a,f,m.time,o.direction),Kd(c,d,m.time,o.up),h.cross(o.direction,o.up,o.right),h.normalize(o.right,o.right),o._adjustOrthographicFrustum(!0)}let g=r.tweens.add({duration:t,easingFunction:ks.QUARTIC_OUT,startObject:{time:0},stopObject:{time:1},update:p,complete:function(){OIe(e,r,1,0,t,i)}});e._currentTweens.push(g)}function OIe(e,t,n,i,r,o){let s={object:t,property:"morphTime",startValue:n,stopValue:i,duration:r,easingFunction:ks.QUARTIC_OUT};l(o)&&(s.complete=function(){o(e)});let a=t.tweens.addProperty(s);e._currentTweens.push(a)}function MIe(e){return function(t){let n=t._scene;n._mode=re.SCENE3D,n.morphTime=re.getMorphTime(re.SCENE3D),pH(t);let i=n.camera;(t._previousMode!==re.MORPHING||t._morphCancelled)&&(t._morphCancelled=!1,h.clone(e.position,i.position),h.clone(e.direction,i.direction),h.clone(e.up,i.up),h.cross(i.direction,i.up,i.right),h.normalize(i.right,i.right),i.frustum=e.frustum.clone());let r=i.frustum;n.frameState.useLogDepth&&(r.near=.1,r.far=1e10);let o=l(t._completeMorph);t._completeMorph=void 0,n.camera.update(n.mode),t._scene.morphComplete.raiseEvent(t,t._previousMode,re.SCENE3D,o)}}function NIe(e){return function(t){let n=t._scene;n._mode=re.SCENE2D,n.morphTime=re.getMorphTime(re.SCENE2D),pH(t);let i=n.camera;h.clone(e.position,i.position),i.position.z=n.ellipsoid.maximumRadius*2,h.clone(e.direction,i.direction),h.clone(e.up,i.up),h.cross(i.direction,i.up,i.right),h.normalize(i.right,i.right),i.frustum=e.frustum.clone();let r=l(t._completeMorph);t._completeMorph=void 0,n.camera.update(n.mode),t._scene.morphComplete.raiseEvent(t,t._previousMode,re.SCENE2D,r)}}function ePt(e){return function(t){let n=t._scene;n._mode=re.COLUMBUS_VIEW,n.morphTime=re.getMorphTime(re.COLUMBUS_VIEW),pH(t);let i=n.camera;(t._previousModeMode!==re.MORPHING||t._morphCancelled)&&(t._morphCancelled=!1,h.clone(e.position,i.position),h.clone(e.direction,i.direction),h.clone(e.up,i.up),h.cross(i.direction,i.up,i.right),h.normalize(i.right,i.right));let r=i.frustum;n.frameState.useLogDepth&&(r.near=.1,r.far=1e10);let o=l(t._completeMorph);t._completeMorph=void 0,n.camera.update(n.mode),t._scene.morphComplete.raiseEvent(t,t._previousMode,re.COLUMBUS_VIEW,o)}}var gH=gT;var LIe={LEFT_DRAG:0,RIGHT_DRAG:1,MIDDLE_DRAG:2,WHEEL:3,PINCH:4};Object.freeze(LIe);var fr=LIe;var zIe=[oo.SHIFT,oo.CTRL,oo.ALT,[oo.SHIFT,oo.CTRL],[oo.SHIFT,oo.ALT],[oo.CTRL,oo.ALT],[oo.SHIFT,oo.CTRL,oo.ALT]];function ja(e,t){if(!l(t))return`${e}`;let n=Array.isArray(t)?t.toSorted():[t];return`${e}+${n.join("+")}`}function tPt(e,t){U.clone(e.distance.startPosition,t.distance.startPosition),U.clone(e.distance.endPosition,t.distance.endPosition),U.clone(e.angleAndHeight.startPosition,t.angleAndHeight.startPosition),U.clone(e.angleAndHeight.endPosition,t.angleAndHeight.endPosition)}function FIe(e,t,n){let i=ja(fr.PINCH,t),r=e._update,o=e._isDown,s=e._eventStartPosition,a=e._pressTime,c=e._releaseTime;r[i]=!0,o[i]=!1,s[i]=new U;let u=e._movement[i];l(u)||(u=e._movement[i]={}),u.distance={startPosition:new U,endPosition:new U},u.angleAndHeight={startPosition:new U,endPosition:new U},u.prevAngle=0,e._eventHandler.setInputAction(function(f){e._buttonsDown++,o[i]=!0,a[i]=new Date,U.lerp(f.position1,f.position2,.5,s[i])},fn.PINCH_START,t),e._eventHandler.setInputAction(function(){e._buttonsDown=Math.max(e._buttonsDown-1,0),o[i]=!1,c[i]=new Date},fn.PINCH_END,t),e._eventHandler.setInputAction(function(f){if(o[i]){r[i]?(tPt(f,u),r[i]=!1,u.prevAngle=u.angleAndHeight.startPosition.x):(U.clone(f.distance.endPosition,u.distance.endPosition),U.clone(f.angleAndHeight.endPosition,u.angleAndHeight.endPosition));let d=u.angleAndHeight.endPosition.x,p=u.prevAngle,g=Math.PI*2;for(;d>=p+Math.PI;)d-=g;for(;d<p-Math.PI;)d+=g;u.angleAndHeight.endPosition.x=-d*n.clientWidth/12,u.angleAndHeight.startPosition.x=-p*n.clientWidth/12}},fn.PINCH_MOVE,t)}function BIe(e,t){let n=ja(fr.WHEEL,t),i=e._pressTime,r=e._releaseTime,o=e._update;o[n]=!0;let s=e._movement[n];l(s)||(s=e._movement[n]={});let a=e._lastMovement[n];l(a)||(a=e._lastMovement[n]={startPosition:new U,endPosition:new U,valid:!1}),s.startPosition=new U,U.clone(U.ZERO,s.startPosition),s.endPosition=new U,e._eventHandler.setInputAction(function(c){let u=7.5*P.toRadians(c);i[n]=r[n]=new Date,s.endPosition.x=0,s.endPosition.y=u,U.clone(s.endPosition,a.endPosition),a.valid=!0,o[n]=!1},fn.WHEEL,t)}function ow(e,t,n){let i=ja(n,t),r=e._isDown,o=e._eventStartPosition,s=e._pressTime;r[i]=!1,o[i]=new U;let a=e._lastMovement[i];l(a)||(a=e._lastMovement[i]={startPosition:new U,endPosition:new U,valid:!1});let c,u;n===fr.LEFT_DRAG?(c=fn.LEFT_DOWN,u=fn.LEFT_UP):n===fr.RIGHT_DRAG?(c=fn.RIGHT_DOWN,u=fn.RIGHT_UP):n===fr.MIDDLE_DRAG&&(c=fn.MIDDLE_DOWN,u=fn.MIDDLE_UP),e._eventHandler.setInputAction(function(f){e._buttonsDown++,a.valid=!1,r[i]=!0,s[i]=new Date,U.clone(f.position,o[i])},c,t),e._eventHandler.setInputAction(function(){hne(ja(n,void 0),e);for(let f of zIe){let d=ja(n,f);hne(d,e)}},u,t)}function hne(e,t){let n=t._releaseTime,i=t._isDown;i[e]&&(t._buttonsDown=Math.max(t._buttonsDown-1,0)),i[e]=!1,n[e]=new Date}function kIe(e,t){U.clone(e.startPosition,t.startPosition),U.clone(e.endPosition,t.endPosition)}function nPt(e,t,n){let i=n._isDown,r=!1,o=ja(e,t);for(let[c,u]of Object.entries(i))c.startsWith(e)&&u&&c!==o&&(r=!0,hne(c,n));if(!r)return;let s=n._pressTime,a=n._lastMovement[o];l(a)||(a=n._lastMovement[o]={startPosition:new U,endPosition:new U,valid:!1}),n._buttonsDown++,a.valid=!1,i[o]=!0,s[o]=new Date}function UIe(e,t){let n=e._update,i=e._movement,r=e._lastMovement,o=e._isDown;for(let s in fr)if(fr.hasOwnProperty(s)){let a=fr[s];if(l(a)){let c=ja(a,t);n[c]=!0,l(e._lastMovement[c])||(e._lastMovement[c]={startPosition:new U,endPosition:new U,valid:!1}),l(e._movement[c])||(e._movement[c]={startPosition:new U,endPosition:new U})}}e._eventHandler.setInputAction(function(s){for(let a in fr)if(fr.hasOwnProperty(a)){let c=fr[a];if(l(c)){let u=ja(c,t);nPt(c,t,e),o[u]&&(n[u]?(kIe(i[u],r[u]),r[u].valid=!0,kIe(s,i[u]),n[u]=!1):U.clone(s.endPosition,i[u].endPosition))}}U.clone(s.endPosition,e._currentMousePosition)},fn.MOUSE_MOVE,t)}function $d(e){this._eventHandler=new xa(e),this._update={},this._movement={},this._lastMovement={},this._isDown={},this._eventStartPosition={},this._pressTime={},this._releaseTime={},this._buttonsDown=0,this._currentMousePosition=new U,BIe(this,void 0),FIe(this,void 0,e),ow(this,void 0,fr.LEFT_DRAG),ow(this,void 0,fr.RIGHT_DRAG),ow(this,void 0,fr.MIDDLE_DRAG),UIe(this,void 0);for(let t of zIe)BIe(this,t),FIe(this,t,e),ow(this,t,fr.LEFT_DRAG),ow(this,t,fr.RIGHT_DRAG),ow(this,t,fr.MIDDLE_DRAG),UIe(this,t)}Object.defineProperties($d.prototype,{currentMousePosition:{get:function(){return this._currentMousePosition}},anyButtonDown:{get:function(){let e=!this._update[ja(fr.WHEEL)]||!this._update[ja(fr.WHEEL,oo.SHIFT)]||!this._update[ja(fr.WHEEL,oo.CTRL)]||!this._update[ja(fr.WHEEL,oo.ALT)];return this._buttonsDown>0||e}}});$d.prototype.isMoving=function(e,t){let n=ja(e,t);return!this._update[n]};$d.prototype.getMovement=function(e,t){let n=ja(e,t);return this._movement[n]};$d.prototype.getLastMovement=function(e,t){let n=ja(e,t),i=this._lastMovement[n];if(i.valid)return i};$d.prototype.isButtonDown=function(e,t){let n=ja(e,t);return this._isDown[n]};$d.prototype.getStartMousePosition=function(e,t){if(e===fr.WHEEL)return this._currentMousePosition;let n=ja(e,t);return this._eventStartPosition[n]};$d.prototype.getButtonPressTime=function(e,t){let n=ja(e,t);return this._pressTime[n]};$d.prototype.getButtonReleaseTime=function(e,t){let n=ja(e,t);return this._releaseTime[n]};$d.prototype.reset=function(){for(let e in this._update)this._update.hasOwnProperty(e)&&(this._update[e]=!0)};$d.prototype.isDestroyed=function(){return!1};$d.prototype.destroy=function(){return this._eventHandler=this._eventHandler&&this._eventHandler.destroy(),le(this)};var _H=$d;function yH(e,t,n,i,r,o,s,a,c,u){this._tweens=e,this._tweenjs=t,this._startObject=Ze(n),this._stopObject=Ze(i),this._duration=r,this._delay=o,this._easingFunction=s,this._update=a,this._complete=c,this.cancel=u,this.needsStart=!0}Object.defineProperties(yH.prototype,{startObject:{get:function(){return this._startObject}},stopObject:{get:function(){return this._stopObject}},duration:{get:function(){return this._duration}},delay:{get:function(){return this._delay}},easingFunction:{get:function(){return this._easingFunction}},update:{get:function(){return this._update}},complete:{get:function(){return this._complete}},tweenjs:{get:function(){return this._tweenjs}}});yH.prototype.cancelTween=function(){this._tweens.remove(this)};function dm(){this._tweens=[]}Object.defineProperties(dm.prototype,{length:{get:function(){return this._tweens.length}}});dm.prototype.add=function(e){if(e=e??H.EMPTY_OBJECT,e.duration===0)return l(e.complete)&&e.complete(),new yH(this);let t=e.duration/Un.SECONDS_PER_MILLISECOND,n=e.delay??0,i=n/Un.SECONDS_PER_MILLISECOND,r=e.easingFunction??ks.LINEAR_NONE,o=e.startObject,s=new TSe(o);s.to(Ze(e.stopObject),t),s.delay(i),s.easing(r),l(e.update)&&s.onUpdate(function(){e.update(o)}),s.onComplete(e.complete??null),s.repeat(e._repeat??0);let a=new yH(this,s,e.startObject,e.stopObject,e.duration,n,r,e.update,e.complete,e.cancel);return this._tweens.push(a),a};dm.prototype.addProperty=function(e){e=e??H.EMPTY_OBJECT;let t=e.object,n=e.property,i=e.startValue,r=e.stopValue;function o(s){t[n]=s.value}return this.add({startObject:{value:i},stopObject:{value:r},duration:e.duration??3,delay:e.delay,easingFunction:e.easingFunction,update:o,complete:e.complete,cancel:e.cancel,_repeat:e._repeat})};dm.prototype.addAlpha=function(e){e=e??H.EMPTY_OBJECT;let t=e.material,n=[];for(let r in t.uniforms)t.uniforms.hasOwnProperty(r)&&l(t.uniforms[r])&&l(t.uniforms[r].alpha)&&n.push(r);function i(r){let o=n.length;for(let s=0;s<o;++s)t.uniforms[n[s]].alpha=r.alpha}return this.add({startObject:{alpha:e.startValue??0},stopObject:{alpha:e.stopValue??1},duration:e.duration??3,delay:e.delay,easingFunction:e.easingFunction,update:i,complete:e.complete,cancel:e.cancel})};dm.prototype.addOffsetIncrement=function(e){e=e??H.EMPTY_OBJECT;let n=e.material.uniforms;return this.addProperty({object:n,property:"offset",startValue:n.offset,stopValue:n.offset+1,duration:e.duration,delay:e.delay,easingFunction:e.easingFunction,update:e.update,cancel:e.cancel,_repeat:1/0})};dm.prototype.remove=function(e){if(!l(e))return!1;let t=this._tweens.indexOf(e);return t!==-1?(e.tweenjs.stop(),l(e.cancel)&&e.cancel(),this._tweens.splice(t,1),!0):!1};dm.prototype.removeAll=function(){let e=this._tweens;for(let t=0;t<e.length;++t){let n=e[t];n.tweenjs.stop(),l(n.cancel)&&n.cancel()}e.length=0};dm.prototype.contains=function(e){return l(e)&&this._tweens.indexOf(e)!==-1};dm.prototype.get=function(e){return this._tweens[e]};dm.prototype.update=function(e){let t=this._tweens,n=0;for(e=l(e)?e/Un.SECONDS_PER_MILLISECOND:xn();n<t.length;){let i=t[n],r=i.tweenjs;if(i.needsStart)i.needsStart=!1,r.start(e);else if(r.update(e))n++;else{if(t[n]?.needsStart)continue;r.stop(),t.splice(n,1)}}};var sw=dm;function $R(e){this.enableInputs=!0,this.enableTranslate=!0,this.enableZoom=!0,this.enableRotate=!0,this.enableTilt=!0,this.enableLook=!0,this.inertiaSpin=.9,this.inertiaTranslate=.9,this.inertiaZoom=.8,this.maximumMovementRatio=.1,this.bounceAnimationTime=3,this.minimumZoomDistance=1,this.maximumZoomDistance=Number.POSITIVE_INFINITY,this.zoomFactor=5,this.translateEventTypes=fr.LEFT_DRAG,this.zoomEventTypes=[fr.RIGHT_DRAG,fr.WHEEL,fr.PINCH],this.rotateEventTypes=fr.LEFT_DRAG,this.tiltEventTypes=[fr.MIDDLE_DRAG,fr.PINCH,{eventType:fr.LEFT_DRAG,modifier:oo.CTRL},{eventType:fr.RIGHT_DRAG,modifier:oo.CTRL}],this.lookEventTypes={eventType:fr.LEFT_DRAG,modifier:oo.SHIFT};let t=e.ellipsoid??ee.default;this.minimumPickingTerrainHeight=ee.WGS84.equals(t)?15e4:t.minimumRadius*.025,this._minimumPickingTerrainHeight=this.minimumPickingTerrainHeight,this.minimumPickingTerrainDistanceWithInertia=ee.WGS84.equals(t)?4e3:t.minimumRadius*63e-5,this.minimumCollisionTerrainHeight=ee.WGS84.equals(t)?15e3:t.minimumRadius*.0025,this._minimumCollisionTerrainHeight=this.minimumCollisionTerrainHeight,this.minimumTrackBallHeight=ee.WGS84.equals(t)?75e5:t.minimumRadius*1.175,this._minimumTrackBallHeight=this.minimumTrackBallHeight,this.enableCollisionDetection=!0,this.maximumTiltAngle=void 0,this._scene=e,this._globe=void 0,this._ellipsoid=t,this._lastGlobeHeight=0,this._aggregator=new _H(e.canvas),this._lastInertiaSpinMovement=void 0,this._lastInertiaZoomMovement=void 0,this._lastInertiaTranslateMovement=void 0,this._lastInertiaTiltMovement=void 0,this._inertiaDisablers={_lastInertiaZoomMovement:["_lastInertiaSpinMovement","_lastInertiaTranslateMovement","_lastInertiaTiltMovement"],_lastInertiaTiltMovement:["_lastInertiaSpinMovement","_lastInertiaTranslateMovement"]},this._tweens=new sw,this._tween=void 0,this._horizontalRotationAxis=void 0,this._tiltCenterMousePosition=new U(-1,-1),this._tiltCenter=new h,this._rotateMousePosition=new U(-1,-1),this._rotateStartPosition=new h,this._strafeStartPosition=new h,this._strafeMousePosition=new U,this._strafeEndMousePosition=new U,this._zoomMouseStart=new U(-1,-1),this._zoomWorldPosition=new h,this._useZoomWorldPosition=!1,this._panLastMousePosition=new U,this._panLastWorldPosition=new h,this._tiltCVOffMap=!1,this._looking=!1,this._rotating=!1,this._strafing=!1,this._zoomingOnVector=!1,this._zoomingUnderground=!1,this._rotatingZoom=!1,this._adjustedHeightForTerrain=!1,this._cameraUnderground=!1;let n=e.mapProjection;this._maxCoord=n.project(new he(Math.PI,P.PI_OVER_TWO)),this._rotateFactor=void 0,this._rotateRateRangeAdjustment=void 0,this._maximumRotateRate=1.77,this._minimumRotateRate=1/5e3,this._minimumZoomRate=20,this._maximumZoomRate=5906376272e3,this._minimumUndergroundPickDistance=2e3,this._maximumUndergroundPickDistance=1e4}function iPt(e,t){if(e<0)return 0;let n=(1-t)*25;return Math.exp(-n*e)}function rPt(e){return U.equalsEpsilon(e.startPosition,e.endPosition,P.EPSILON14)}var oPt=.4;function sPt(e,t,n,i,r,o,s){let a=o[s];l(a)||(a=o[s]={startPosition:new U,endPosition:new U,motion:new U,inertiaEnabled:!0});let c=e.getButtonPressTime(t,n),u=e.getButtonReleaseTime(t,n),f=c&&u&&(u.getTime()-c.getTime())/1e3,p=u&&(new Date().getTime()-u.getTime())/1e3;if(c&&u&&f<oPt){let g=iPt(p,i),m=e.getLastMovement(t,n);if(!l(m)||rPt(m)||!a.inertiaEnabled||(a.motion.x=(m.endPosition.x-m.startPosition.x)*.5,a.motion.y=(m.endPosition.y-m.startPosition.y)*.5,a.startPosition=U.clone(m.startPosition,a.startPosition),a.endPosition=U.multiplyByScalar(a.motion,g,a.endPosition),a.endPosition=U.add(a.startPosition,a.endPosition,a.endPosition),isNaN(a.endPosition.x)||isNaN(a.endPosition.y)||U.distance(a.startPosition,a.endPosition)<.5))return;if(!e.isButtonDown(t,n)){let y=e.getStartMousePosition(t,n);r(o,y,a)}}}function aPt(e,t){if(l(t)){let n=e[t];l(n)&&(n.inertiaEnabled=!0);let i=e._inertiaDisablers[t];if(l(i)){let r=i.length;for(let o=0;o<r;++o)n=e[i[o]],l(n)&&(n.inertiaEnabled=!1)}}}var VIe=[];function Yl(e,t,n,i,r,o){if(!l(n))return;let s=e._aggregator;Array.isArray(n)||(VIe[0]=n,n=VIe);let a=n.length;for(let c=0;c<a;++c){let u=n[c],f=l(u.eventType)?u.eventType:u,d=u.modifier,p=s.isMoving(f,d)&&s.getMovement(f,d),g=s.getStartMousePosition(f,d);e.enableInputs&&t&&(p?(i(e,g,p),aPt(e,o)):r<1&&sPt(s,f,d,r,i,e,o))}}var AH=new gn,cPt=new h,lPt=new U,uPt=new h,fPt=new U,dPt=new h,hPt=new h,mPt=new h,pPt=new h,QIe=new h,gPt=new h,_Pt=new h,yPt=new h,APt=new h,bPt=new h,xPt=new h,TPt=new h,EPt=new h,CPt=new h,vPt=new h,_T=new h,jIe=new h,HIe=new h,mne={orientation:new kc};function Tne(e,t,n,i,r,o){let s=1;l(o)&&(s=P.clamp(Math.abs(o),.25,1));let a=n.endPosition.y-n.startPosition.y,u=a>0?e.minimumZoomDistance*s:0,f=e.maximumZoomDistance,d=r-u,p=i*d;p=P.clamp(p,e._minimumZoomRate,e._maximumZoomRate);let g=a/e._scene.canvas.clientHeight;g=Math.min(g,e.maximumMovementRatio);let m=p*g;if(e.enableCollisionDetection||e.minimumZoomDistance===0||!l(e._globe)){if(m>0&&Math.abs(r-u)<1||m<0&&Math.abs(r-f)<1)return;r-m<u?m=r-u-1:r-m>f&&(m=r-f)}let y=e._scene,A=y.camera,b=y.mode,x=mne.orientation;x.heading=A.heading,x.pitch=A.pitch,x.roll=A.roll;let T=n.inertiaEnabled??U.equals(t,e._zoomMouseStart),E=e._zoomingOnVector,v=e._rotatingZoom,S;if(T||(e._zoomMouseStart=U.clone(t,e._zoomMouseStart),l(e._globe)&&b===re.SCENE2D?(S=A.getPickRay(t,AH).origin,S=h.fromElements(S.y,S.z,S.x)):l(e._globe)&&(S=Yg(e,t,cPt)),l(S)?(e._useZoomWorldPosition=!0,e._zoomWorldPosition=h.clone(S,e._zoomWorldPosition)):e._useZoomWorldPosition=!1,E=e._zoomingOnVector=!1,v=e._rotatingZoom=!1,e._zoomingUnderground=e._cameraUnderground),!e._useZoomWorldPosition){A.zoomIn(m);return}let I=b===re.COLUMBUS_VIEW;if(A.positionCartographic.height<2e6&&(v=!0),!T||v){if(b===re.SCENE2D){let R=e._zoomWorldPosition,O=A.position;if(!h.equals(R,O)&&A.positionCartographic.height<e._maxCoord.x*2){let L=A.position.x,_=h.subtract(R,O,uPt);h.normalize(_,_);let C=h.distance(R,O)*m/(A.getMagnitude()*.5);A.move(_,C*.5),(A.position.x<0&&L>0||A.position.x>0&&L<0)&&(S=A.getPickRay(t,AH).origin,S=h.fromElements(S.y,S.z,S.x),e._zoomWorldPosition=h.clone(S,e._zoomWorldPosition))}}else if(b===re.SCENE3D){let R=h.normalize(A.position,QIe);if(e._cameraUnderground||e._zoomingUnderground||A.positionCartographic.height<3e3&&Math.abs(h.dot(A.direction,R))<.6)I=!0;else{let O=y.canvas,L=fPt;L.x=O.clientWidth/2,L.y=O.clientHeight/2;let _=Yg(e,L,dPt);if(!l(_))I=!0;else if(A.positionCartographic.height<1e6)if(h.dot(A.direction,R)>=-.5)I=!0;else{let C=_Pt;h.clone(A.position,C);let w=e._zoomWorldPosition,D=gPt;if(D=h.normalize(w,D),h.dot(D,R)<0)return;let N=vPt,F=bPt;h.clone(A.direction,F),h.add(C,h.multiplyByScalar(F,1e3,_T),N);let V=xPt,B=TPt;h.subtract(w,C,V),h.normalize(V,B);let j=h.dot(R,B);if(j>=0){e._zoomMouseStart.x=-1;return}let k=Math.acos(-j),G=h.magnitude(C),q=h.magnitude(w),Q=G-m,W=h.magnitude(V),J=Math.asin(P.clamp(W/q*Math.sin(k),-1,1)),Z=Math.asin(P.clamp(Q/q*Math.sin(k),-1,1)),ae=J-Z+k,Ae=yPt;h.normalize(C,Ae);let fe=APt;fe=h.cross(B,Ae,fe),fe=h.normalize(fe,fe),h.normalize(h.cross(Ae,fe,_T),F),h.multiplyByScalar(h.normalize(N,_T),h.magnitude(N)-m,N),h.normalize(C,C),h.multiplyByScalar(C,Q,C);let xe=EPt;h.multiplyByScalar(h.add(h.multiplyByScalar(Ae,Math.cos(ae)-1,jIe),h.multiplyByScalar(F,Math.sin(ae),HIe),_T),Q,xe),h.add(C,xe,C),h.normalize(N,Ae),h.normalize(h.cross(Ae,fe,_T),F);let ge=CPt;h.multiplyByScalar(h.add(h.multiplyByScalar(Ae,Math.cos(ae)-1,jIe),h.multiplyByScalar(F,Math.sin(ae),HIe),_T),h.magnitude(N),ge),h.add(N,ge,N),h.clone(C,A.position),h.normalize(h.subtract(N,C,_T),A.direction),h.clone(A.direction,A.direction),h.cross(A.direction,A.up,A.right),h.cross(A.right,A.direction,A.up),A.setView(mne);return}else{let C=h.normalize(_,hPt),w=h.normalize(e._zoomWorldPosition,mPt),D=h.dot(w,C);if(D>0&&D<1){let N=P.acosClamped(D),F=h.cross(w,C,pPt),V=Math.abs(N)>P.toRadians(20)?A.positionCartographic.height*.75:A.positionCartographic.height-m,B=m/V;A.rotate(F,N*B)}}}}e._rotatingZoom=!I}if(!T&&I||E){let R,O=pr.worldToWindowCoordinates(y,e._zoomWorldPosition,lPt);b!==re.COLUMBUS_VIEW&&U.equals(t,e._zoomMouseStart)&&l(O)?R=A.getPickRay(O,AH):R=A.getPickRay(t,AH);let L=R.direction;(b===re.COLUMBUS_VIEW||b===re.SCENE2D)&&h.fromElements(L.y,L.z,L.x,L),A.move(L,m),e._zoomingOnVector=!0}else A.zoomIn(m);e._cameraUnderground||A.setView(mne)}var SPt=new gn,wPt=new gn,IPt=new h;function PPt(e,t,n){let r=e._scene.camera,o=r.getPickRay(n.startPosition,SPt).origin,s=r.getPickRay(n.endPosition,wPt).origin;o=h.fromElements(o.y,o.z,o.x,o),s=h.fromElements(s.y,s.z,s.x,s);let a=h.subtract(o,s,IPt),c=h.magnitude(a);c>0&&(h.normalize(a,a),r.move(a,c))}function GIe(e,t,n){l(n.distance)&&(n=n.distance);let r=e._scene.camera;Tne(e,t,n,e.zoomFactor,r.getMagnitude())}var DPt=new U,RPt=new U;function WIe(e,t,n){if(l(n.angleAndHeight)){OPt(e,t,n.angleAndHeight);return}let i=e._scene,r=i.camera,o=i.canvas,s=o.clientWidth,a=o.clientHeight,c=DPt;c.x=2/s*n.startPosition.x-1,c.y=2/a*(a-n.startPosition.y)-1,c=U.normalize(c,c);let u=RPt;u.x=2/s*n.endPosition.x-1,u.y=2/a*(a-n.endPosition.y)-1,u=U.normalize(u,u);let f=P.acosClamped(c.x);c.y<0&&(f=P.TWO_PI-f);let d=P.acosClamped(u.x);u.y<0&&(d=P.TWO_PI-d);let p=d-f;r.twistRight(p)}function OPt(e,t,n){let i=e._rotateFactor*e._rotateRateRangeAdjustment;i>e._maximumRotateRate&&(i=e._maximumRotateRate),i<e._minimumRotateRate&&(i=e._minimumRotateRate);let r=e._scene,o=r.camera,s=r.canvas,a=(n.endPosition.x-n.startPosition.x)/s.clientWidth;a=Math.min(a,e.maximumMovementRatio);let c=i*a*Math.PI*4;o.twistRight(c)}function MPt(e){let t=e._scene.mapMode2D===Vu.ROTATE;M.equals(M.IDENTITY,e._scene.camera.transform)?(Yl(e,e.enableTranslate,e.translateEventTypes,PPt,e.inertiaTranslate,"_lastInertiaTranslateMovement"),Yl(e,e.enableZoom,e.zoomEventTypes,GIe,e.inertiaZoom,"_lastInertiaZoomMovement"),t&&Yl(e,e.enableRotate,e.tiltEventTypes,WIe,e.inertiaSpin,"_lastInertiaTiltMovement")):(Yl(e,e.enableZoom,e.zoomEventTypes,GIe,e.inertiaZoom,"_lastInertiaZoomMovement"),t&&Yl(e,e.enableRotate,e.translateEventTypes,WIe,e.inertiaSpin,"_lastInertiaSpinMovement"))}var ePe=new gn,NPt=new h,LPt=new h;function Yg(e,t,n){let i=e._scene,r=e._globe,o=i.camera,s;if(i.pickPositionSupported&&(s=i.pickPositionWorldCoordinates(t,NPt)),!l(r))return h.clone(s,n);let a=!e._cameraUnderground,c=o.getPickRay(t,ePe),u=r.pickWorldCoordinates(c,i,a,LPt),f=l(s)?h.distance(s,o.positionWC):Number.POSITIVE_INFINITY,d=l(u)?h.distance(u,o.positionWC):Number.POSITIVE_INFINITY;return f<d?h.clone(s,n):h.clone(u,n)}var FPt=new he;function SH(e){let t=e._ellipsoid,n=e._scene,i=n.camera,r=n.mode,o=0;if(r===re.SCENE3D){let c=t.cartesianToCartographic(i.position,FPt);l(c)&&(o=c.height)}else o=i.position.z;let s=e._scene.globeHeight??0;return Math.abs(s-o)}var BPt=new h;function tPe(e,t){let n=t.origin,i=t.direction,r=SH(e),o=h.normalize(n,BPt),s=Math.abs(h.dot(o,i));return s=Math.max(s,.5)*2,r*s}function nPe(e,t,n,i){let r=h.distance(t.origin,n),o=SH(e),s=P.clamp(o*5,e._minimumUndergroundPickDistance,e._maximumUndergroundPickDistance);return r>s&&(r=Math.min(r,o/5),r=Math.max(r,100)),gn.getPoint(t,r,i)}function iPe(e,t,n,i){let r;return l(n)?(r=h.distance(t.origin,n),r>e._maximumUndergroundPickDistance&&(r=SH(e))):r=SH(e),gn.getPoint(t,r,i)}var kPt=new U;function rPe(e,t){let n=t.endPosition,i=U.subtract(t.endPosition,t.startPosition,kPt),r=e._strafeEndMousePosition;U.add(r,i,r),t.endPosition=r,Ene(e,t,e._strafeStartPosition),t.endPosition=n}var qIe=new gn,UPt=new gn,pne=new h,zPt=new h,VPt=new h,jPt=new h,HPt=new sn(h.UNIT_X,0),GPt=new U,WPt=new U;function qPt(e,t,n){if(h.equals(t,e._translateMousePosition)||(e._looking=!1),h.equals(t,e._strafeMousePosition)||(e._strafing=!1),e._looking){Mf(e,t,n);return}if(e._strafing){rPe(e,n);return}let r=e._scene.camera,o=e._cameraUnderground,s=U.clone(n.startPosition,GPt),a=U.clone(n.endPosition,WPt),c=r.getPickRay(s,qIe),u=h.clone(h.ZERO,jPt),f=h.UNIT_X,d;if(r.position.z<e._minimumPickingTerrainHeight&&(d=Yg(e,s,pne),l(d)&&(u.x=d.x)),o||u.x>r.position.z&&l(d)){let T=d;o&&(T=iPe(e,c,d,pne)),U.clone(t,e._strafeMousePosition),U.clone(t,e._strafeEndMousePosition),h.clone(T,e._strafeStartPosition),e._strafing=!0,Ene(e,n,e._strafeStartPosition);return}let p=sn.fromPointNormal(u,f,HPt);c=r.getPickRay(s,qIe);let g=xi.rayPlane(c,p,pne),m=r.getPickRay(a,UPt),y=xi.rayPlane(m,p,zPt);if(!l(g)||!l(y)){e._looking=!0,Mf(e,t,n),U.clone(t,e._translateMousePosition);return}let A=h.subtract(g,y,VPt),b=A.x;A.x=A.y,A.y=A.z,A.z=b;let x=h.magnitude(A);x>P.EPSILON6&&(h.normalize(A,A),r.move(A,x))}var oPe=new U,TH=new gn,EH=new h,YPt=new h,sPe=new M,XPt=new M,KPt=new h,$Pt=new sn(h.UNIT_X,0),gne=new h,Ane=new he,aPe=new M,JPt=new Le,ZPt=new $,CH=new h;function QPt(e,t,n){if(l(n.angleAndHeight)&&(n=n.angleAndHeight),U.equals(t,e._tiltCenterMousePosition)||(e._tiltCVOffMap=!1,e._looking=!1),e._looking){Mf(e,t,n);return}let r=e._scene.camera;e._tiltCVOffMap||!e.onMap()||Math.abs(r.position.z)>e._minimumPickingTerrainHeight?(e._tiltCVOffMap=!0,eDt(e,t,n)):tDt(e,t,n)}function eDt(e,t,n){let i=e._scene,r=i.camera,o=i.canvas,s=oPe;s.x=o.clientWidth/2,s.y=o.clientHeight/2;let a=r.getPickRay(s,TH),c=h.UNIT_X,u=a.origin,f=a.direction,d,p=h.dot(c,f);if(Math.abs(p)>P.EPSILON6&&(d=-h.dot(c,u)/p),!l(d)||d<=0){e._looking=!0,Mf(e,t,n),U.clone(t,e._tiltCenterMousePosition);return}let g=h.multiplyByScalar(f,d,EH);h.add(u,g,g);let m=i.mapProjection,y=m.ellipsoid;h.fromElements(g.y,g.z,g.x,g);let A=m.unproject(g,Ane);y.cartographicToCartesian(A,g);let b=At.eastNorthUpToFixedFrame(g,y,sPe),x=e._globe,T=e._ellipsoid;e._globe=void 0,e._ellipsoid=ee.UNIT_SPHERE,e._rotateFactor=1,e._rotateRateRangeAdjustment=1;let E=M.clone(r.transform,aPe);r._setTransform(b),Of(e,t,n,h.UNIT_Z),r._setTransform(E),e._globe=x,e._ellipsoid=T;let v=T.maximumRadius;e._rotateFactor=1/v,e._rotateRateRangeAdjustment=v}function tDt(e,t,n){let i=e._scene,r=i.camera,o=e._cameraUnderground,s,a,c=h.UNIT_X;if(U.equals(t,e._tiltCenterMousePosition))s=h.clone(e._tiltCenter,EH);else{if(r.position.z<e._minimumPickingTerrainHeight&&(s=Yg(e,t,EH)),!l(s)){a=r.getPickRay(t,TH);let _=a.origin,C=a.direction,w,D=h.dot(c,C);if(Math.abs(D)>P.EPSILON6&&(w=-h.dot(c,_)/D),!l(w)||w<=0){e._looking=!0,Mf(e,t,n),U.clone(t,e._tiltCenterMousePosition);return}s=h.multiplyByScalar(C,w,EH),h.add(_,s,s)}o&&(l(a)||(a=r.getPickRay(t,TH)),nPe(e,a,s,s)),U.clone(t,e._tiltCenterMousePosition),h.clone(s,e._tiltCenter)}let u=i.canvas,f=oPe;f.x=u.clientWidth/2,f.y=e._tiltCenterMousePosition.y,a=r.getPickRay(f,TH);let d=h.clone(h.ZERO,KPt);d.x=s.x;let p=sn.fromPointNormal(d,c,$Pt),g=xi.rayPlane(a,p,YPt),m=r._projection,y=m.ellipsoid;h.fromElements(s.y,s.z,s.x,s);let A=m.unproject(s,Ane);y.cartographicToCartesian(A,s);let b=At.eastNorthUpToFixedFrame(s,y,sPe),x;l(g)?(h.fromElements(g.y,g.z,g.x,g),A=m.unproject(g,Ane),y.cartographicToCartesian(A,g),x=At.eastNorthUpToFixedFrame(g,y,XPt)):x=b;let T=e._globe,E=e._ellipsoid;e._globe=void 0,e._ellipsoid=ee.UNIT_SPHERE,e._rotateFactor=1,e._rotateRateRangeAdjustment=1;let v=h.UNIT_Z,S=M.clone(r.transform,aPe);r._setTransform(b);let I=h.cross(h.UNIT_Z,h.normalize(r.position,gne),gne),R=h.dot(r.right,I);if(Of(e,t,n,v,!1,!0),r._setTransform(x),R<0){let _=n.startPosition.y-n.endPosition.y;(o&&_<0||!o&&_>0)&&(v=void 0);let C=r.constrainedAxis;r.constrainedAxis=void 0,Of(e,t,n,v,!0,!1),r.constrainedAxis=C}else Of(e,t,n,v,!0,!1);if(l(r.constrainedAxis)){let _=h.cross(r.direction,r.constrainedAxis,CH);h.equalsEpsilon(_,h.ZERO,P.EPSILON6)||(h.dot(_,r.right)<0&&h.negate(_,_),h.cross(_,r.direction,r.up),h.cross(r.direction,r.up,r.right),h.normalize(r.up,r.up),h.normalize(r.right,r.right))}r._setTransform(S),e._globe=T,e._ellipsoid=E;let O=E.maximumRadius;e._rotateFactor=1/O,e._rotateRateRangeAdjustment=O;let L=h.clone(r.positionWC,gne);if(e.enableCollisionDetection&&Sne(e,!0),!h.equals(r.positionWC,L)){r._setTransform(x),r.worldToCameraCoordinatesPoint(L,L);let _=h.magnitudeSquared(L);h.magnitudeSquared(r.position)>_&&(h.normalize(r.position,r.position),h.multiplyByScalar(r.position,Math.sqrt(_),r.position));let C=h.angleBetween(L,r.position),w=h.cross(L,r.position,L);h.normalize(w,w);let D=Le.fromAxisAngle(w,C,JPt),N=$.fromQuaternion(D,ZPt);$.multiplyByVector(N,r.direction,r.direction),$.multiplyByVector(N,r.up,r.up),h.cross(r.direction,r.up,r.right),h.cross(r.right,r.direction,r.up),r._setTransform(S)}}var cPe=new U,lPe=new gn,uPe=new h;function nDt(e,t,n){l(n.distance)&&(n=n.distance);let i=e._scene,r=i.camera,o=i.canvas,s=e._cameraUnderground,a;s?a=t:(a=cPe,a.x=o.clientWidth/2,a.y=o.clientHeight/2);let c=r.getPickRay(a,lPe),u=c.origin,f=c.direction,d=r.position.z,p;d<e._minimumPickingTerrainHeight&&(p=Yg(e,a,uPe));let g;if(l(p)&&(g=h.distance(u,p)),s){let m=tPe(e,c,d);l(g)?g=Math.min(g,m):g=m}if(!l(g)){let m=h.UNIT_X;g=-h.dot(m,u)/h.dot(m,f)}Tne(e,t,n,e.zoomFactor,g)}function iDt(e){let n=e._scene.camera;if(!M.equals(M.IDENTITY,n.transform))Yl(e,e.enableRotate,e.rotateEventTypes,Of,e.inertiaSpin,"_lastInertiaSpinMovement"),Yl(e,e.enableZoom,e.zoomEventTypes,dPe,e.inertiaZoom,"_lastInertiaZoomMovement");else{let i=e._tweens;if(e._aggregator.anyButtonDown&&i.removeAll(),Yl(e,e.enableTilt,e.tiltEventTypes,QPt,e.inertiaSpin,"_lastInertiaTiltMovement"),Yl(e,e.enableTranslate,e.translateEventTypes,qPt,e.inertiaTranslate,"_lastInertiaTranslateMovement"),Yl(e,e.enableZoom,e.zoomEventTypes,nDt,e.inertiaZoom,"_lastInertiaZoomMovement"),Yl(e,e.enableLook,e.lookEventTypes,Mf),!e._aggregator.anyButtonDown&&!i.contains(e._tween)){let r=n.createCorrectPositionTween(e.bounceAnimationTime);l(r)&&(e._tween=i.add(r))}i.update()}}var rDt=new gn,oDt=new sn(h.UNIT_X,0),sDt=new h,aDt=new h;function Ene(e,t,n){let i=e._scene,r=i.camera,o=r.getPickRay(t.endPosition,rDt),s=h.clone(r.direction,aDt);i.mode===re.COLUMBUS_VIEW&&h.fromElements(s.z,s.x,s.y,s);let a=sn.fromPointNormal(n,s,oDt),c=xi.rayPlane(o,a,sDt);l(c)&&(s=h.subtract(n,c,s),i.mode===re.COLUMBUS_VIEW&&h.fromElements(s.y,s.z,s.x,s),h.add(r.position,s,r.position))}var YIe=new h,fPe=new he,bne=new h,xne=new ee,cDt=new h,lDt=new h,uDt=new h;function fDt(e,t,n){let r=e._scene.camera,o=e._cameraUnderground,s=e._ellipsoid;if(!M.equals(r.transform,M.IDENTITY)){Of(e,t,n);return}let a,c,u=s.geodeticSurfaceNormal(r.position,cDt);if(U.equals(t,e._rotateMousePosition)){if(e._looking)Mf(e,t,n,u);else if(e._rotating)Of(e,t,n);else if(e._strafing)rPe(e,n);else{if(h.magnitude(r.position)<h.magnitude(e._rotateStartPosition))return;a=h.magnitude(e._rotateStartPosition),c=bne,c.x=c.y=c.z=a,s=ee.fromCartesian3(c,xne),yne(e,t,n,s)}return}e._looking=!1,e._rotating=!1,e._strafing=!1;let f=s.cartesianToCartographic(r.positionWC,fPe).height,d=e._globe;if(l(d)&&f<e._minimumPickingTerrainHeight){let p=Yg(e,n.startPosition,uDt);if(l(p)){let g,m=r.getPickRay(n.startPosition,ePe);if(o)g=!0,iPe(e,m,p,p);else{let y=s.geodeticSurfaceNormal(p,lDt);Math.abs(h.dot(m.direction,y))<.05?g=!0:g=h.magnitude(r.position)<h.magnitude(p)}g?(U.clone(t,e._strafeEndMousePosition),h.clone(p,e._strafeStartPosition),e._strafing=!0,Ene(e,n,e._strafeStartPosition)):(a=h.magnitude(p),c=bne,c.x=c.y=c.z=a,s=ee.fromCartesian3(c,xne),yne(e,t,n,s),h.clone(p,e._rotateStartPosition))}else e._looking=!0,Mf(e,t,n,u)}else l(r.pickEllipsoid(n.startPosition,e._ellipsoid,YIe))?(yne(e,t,n,e._ellipsoid),h.clone(YIe,e._rotateStartPosition)):f>e._minimumTrackBallHeight?(e._rotating=!0,Of(e,t,n)):(e._looking=!0,Mf(e,t,n,u));U.clone(t,e._rotateMousePosition)}function Of(e,t,n,i,r,o){r=r??!1,o=o??!1;let s=e._scene,a=s.camera,c=s.canvas,u=a.constrainedAxis;l(i)&&(a.constrainedAxis=i);let f=h.magnitude(a.position),d=e._rotateFactor*(f-e._rotateRateRangeAdjustment);d>e._maximumRotateRate&&(d=e._maximumRotateRate),d<e._minimumRotateRate&&(d=e._minimumRotateRate);let p=(n.startPosition.x-n.endPosition.x)/c.clientWidth,g=(n.startPosition.y-n.endPosition.y)/c.clientHeight;p=Math.min(p,e.maximumMovementRatio),g=Math.min(g,e.maximumMovementRatio);let m=d*p*Math.PI*2,y=d*g*Math.PI;if(l(i)&&l(e.maximumTiltAngle)){let A=e.maximumTiltAngle,b=h.dot(a.direction,i),x=Math.PI-Math.acos(b)+y;x>A&&(y-=x-A)}r||a.rotateRight(m),o||a.rotateUp(y),a.constrainedAxis=u}var _ne=se.clone(se.UNIT_W),XIe=se.clone(se.UNIT_W),bH=new h,aw=new h,xH=new h,KIe=new h,dDt=new U,hDt=new U,mDt=new U,pDt=new U,gDt=new gn;function yne(e,t,n,i){let r=e._scene,o=r.camera,s=U.clone(n.startPosition,dDt),a=U.clone(n.endPosition,hDt),c=i.cartesianToCartographic(o.positionWC,fPe).height,u,f;if(!n.inertiaEnabled&&c<e._minimumPickingTerrainHeight&&(u=h.clone(e._panLastWorldPosition,_ne),!l(e._globe)&&!U.equalsEpsilon(s,e._panLastMousePosition)&&(u=Yg(e,s,_ne)),!l(e._globe)&&l(u))){let d=h.subtract(u,o.positionWC,aw),p=h.multiplyByScalar(o.directionWC,h.dot(o.directionWC,d),aw),g=h.magnitude(p),m=o.frustum.getPixelDimensions(r.drawingBufferWidth,r.drawingBufferHeight,g,r.pixelRatio,pDt),y=U.subtract(a,s,mDt),A=h.multiplyByScalar(o.rightWC,y.x*m.x,aw),b=h.normalize(o.positionWC,QIe),x=o.getPickRay(a,gDt).direction,T=h.subtract(x,h.projectVector(x,o.rightWC,xH),xH),E=h.angleBetween(T,o.directionWC),v=1;l(o.frustum.fov)&&(v=Math.max(Math.tan(E),.1));let S=Math.abs(h.dot(o.directionWC,b)),I=-y.y*m.y*2/Math.sqrt(v)*(1-S),R=h.multiplyByScalar(x,I,xH);S=Math.abs(h.dot(o.upWC,b));let O=h.multiplyByScalar(o.upWC,-y.y*(1-S)*m.y,KIe);f=h.add(u,A,XIe),f=h.add(f,R,f),f=h.add(f,O,f),h.clone(f,e._panLastWorldPosition),U.clone(a,e._panLastMousePosition)}if((!l(u)||!l(f))&&(u=o.pickEllipsoid(s,i,_ne),f=o.pickEllipsoid(a,i,XIe)),!l(u)||!l(f)){e._rotating=!0,Of(e,t,n);return}if(u=o.worldToCameraCoordinates(u,u),f=o.worldToCameraCoordinates(f,f),l(o.constrainedAxis)){let d=o.constrainedAxis,p=h.mostOrthogonalAxis(d,bH);h.cross(p,d,p),h.normalize(p,p);let g=h.cross(d,p,aw),m=h.magnitude(u),y=h.dot(d,u),A=Math.acos(y/m),b=h.multiplyByScalar(d,y,xH);h.subtract(u,b,b),h.normalize(b,b);let x=h.magnitude(f),T=h.dot(d,f),E=Math.acos(T/x),v=h.multiplyByScalar(d,T,KIe);h.subtract(f,v,v),h.normalize(v,v);let S=Math.acos(h.dot(b,p));h.dot(b,g)<0&&(S=P.TWO_PI-S);let I=Math.acos(h.dot(v,p));h.dot(v,g)<0&&(I=P.TWO_PI-I);let R=S-I,O;h.equalsEpsilon(d,o.position,P.EPSILON2)?O=o.right:O=h.cross(d,o.position,bH);let L=h.cross(d,O,bH),_=h.dot(L,h.subtract(u,d,aw)),C=h.dot(L,h.subtract(f,d,aw)),w;_>0&&C>0?w=E-A:_>0&&C<=0?h.dot(o.position,d)>0?w=-A-E:w=A+E:w=A-E,o.rotateRight(R),o.rotateUp(w)}else{h.normalize(u,u),h.normalize(f,f);let d=h.dot(u,f),p=h.cross(u,f,bH);if(d<1&&!h.equalsEpsilon(p,h.ZERO,P.EPSILON14)){let g=Math.acos(d);o.rotate(p,g)}}}var _Dt=new h,yDt=new he,$Ie=0;function dPe(e,t,n){l(n.distance)&&(n=n.distance);let i=n.inertiaEnabled,r=e._ellipsoid,o=e._scene,s=o.camera,a=o.canvas,c=e._cameraUnderground,u;c?u=t:(u=cPe,u.x=a.clientWidth/2,u.y=a.clientHeight/2);let f=s.getPickRay(u,lPe),d,p=r.cartesianToCartographic(s.position,yDt).height,g=Math.abs($Ie)<e.minimumPickingTerrainDistanceWithInertia;(i?g:p<e._minimumPickingTerrainHeight)&&(d=Yg(e,u,uPe));let y;if(l(d)&&(y=h.distance(f.origin,d)),!l(e._globe)&&l(y)&&s.getMagnitude()<y&&(y=void 0),l(y)&&($Ie=y),c){let b=tPe(e,f,p);l(y)?y=Math.min(y,b):y=b}l(y)||(y=p);let A=h.normalize(s.position,_Dt);Tne(e,t,n,e.zoomFactor,y,h.dot(A,s.direction))}var hPe=new U,vH=new gn,KR=new h,ADt=new h,mPe=new M,bDt=new M,pPe=new M,xDt=new Le,TDt=new $,Cne=new he,vne=new h;function EDt(e,t,n){let r=e._scene.camera;if(!M.equals(r.transform,M.IDENTITY))return;if(l(n.angleAndHeight)&&(n=n.angleAndHeight),U.equals(t,e._tiltCenterMousePosition)||(e._tiltOnEllipsoid=!1,e._looking=!1),e._looking){let a=e._ellipsoid.geodeticSurfaceNormal(r.position,vne);Mf(e,t,n,a);return}let s=e._ellipsoid.cartesianToCartographic(r.position,Cne);e._tiltOnEllipsoid||s.height>e._minimumCollisionTerrainHeight?(e._tiltOnEllipsoid=!0,vDt(e,t,n)):SDt(e,t,n)}var CDt=new he;function vDt(e,t,n){let i=e._ellipsoid,r=e._scene,o=r.camera,s=e.minimumZoomDistance*.25,a=i.cartesianToCartographic(o.positionWC,CDt).height;if(a-s-1<P.EPSILON3&&n.endPosition.y-n.startPosition.y<0)return;let c=r.canvas,u=hPe;u.x=c.clientWidth/2,u.y=c.clientHeight/2;let f=o.getPickRay(u,vH),d,p=xi.rayEllipsoid(f,i);if(l(p))d=gn.getPoint(f,p.start,KR);else if(a>e._minimumTrackBallHeight){let x=xi.grazingAltitudeLocation(f,i);if(!l(x))return;let T=i.cartesianToCartographic(x,Cne);T.height=0,d=i.cartographicToCartesian(T,KR)}else{e._looking=!0;let x=e._ellipsoid.geodeticSurfaceNormal(o.position,vne);Mf(e,t,n,x),U.clone(t,e._tiltCenterMousePosition);return}let g=At.eastNorthUpToFixedFrame(d,i,mPe),m=e._globe,y=e._ellipsoid;e._globe=void 0,e._ellipsoid=ee.UNIT_SPHERE,e._rotateFactor=1,e._rotateRateRangeAdjustment=1;let A=M.clone(o.transform,pPe);o._setTransform(g),Of(e,t,n,h.UNIT_Z),o._setTransform(A),e._globe=m,e._ellipsoid=y;let b=y.maximumRadius;e._rotateFactor=1/b,e._rotateRateRangeAdjustment=b}function SDt(e,t,n){let i=e._ellipsoid,r=e._scene,o=r.camera,s=e._cameraUnderground,a,c,u;if(U.equals(t,e._tiltCenterMousePosition))a=h.clone(e._tiltCenter,KR);else{if(a=Yg(e,t,KR),!l(a)){if(c=o.getPickRay(t,vH),u=xi.rayEllipsoid(c,i),!l(u)){if(i.cartesianToCartographic(o.position,Cne).height<=e._minimumTrackBallHeight){e._looking=!0;let C=e._ellipsoid.geodeticSurfaceNormal(o.position,vne);Mf(e,t,n,C),U.clone(t,e._tiltCenterMousePosition)}return}a=gn.getPoint(c,u.start,KR)}s&&(l(c)||(c=o.getPickRay(t,vH)),nPe(e,c,a,a)),U.clone(t,e._tiltCenterMousePosition),h.clone(a,e._tiltCenter)}let f=r.canvas,d=hPe;d.x=f.clientWidth/2,d.y=e._tiltCenterMousePosition.y,c=o.getPickRay(d,vH);let p=h.magnitude(a),g=h.fromElements(p,p,p,bne),m=ee.fromCartesian3(g,xne);if(u=xi.rayEllipsoid(c,m),!l(u))return;let y=h.magnitude(c.origin)>p?u.start:u.stop,A=gn.getPoint(c,y,ADt),b=At.eastNorthUpToFixedFrame(a,i,mPe),x=At.eastNorthUpToFixedFrame(A,m,bDt),T=e._globe,E=e._ellipsoid;e._globe=void 0,e._ellipsoid=ee.UNIT_SPHERE,e._rotateFactor=1,e._rotateRateRangeAdjustment=1;let v=h.UNIT_Z,S=M.clone(o.transform,pPe);o._setTransform(x);let I=h.cross(A,o.positionWC,CH);if(h.dot(o.rightWC,I)<0){let _=n.startPosition.y-n.endPosition.y;(s&&_<0||!s&&_>0)&&(v=void 0);let C=o.constrainedAxis;o.constrainedAxis=void 0,Of(e,t,n,v,!0,!1),o.constrainedAxis=C}else Of(e,t,n,v,!0,!1);if(o._setTransform(b),Of(e,t,n,v,!1,!0),l(o.constrainedAxis)){let _=h.cross(o.direction,o.constrainedAxis,CH);h.equalsEpsilon(_,h.ZERO,P.EPSILON6)||(h.dot(_,o.right)<0&&h.negate(_,_),h.cross(_,o.direction,o.up),h.cross(o.direction,o.up,o.right),h.normalize(o.up,o.up),h.normalize(o.right,o.right))}o._setTransform(S),e._globe=T,e._ellipsoid=E;let O=E.maximumRadius;e._rotateFactor=1/O,e._rotateRateRangeAdjustment=O;let L=h.clone(o.positionWC,CH);if(e.enableCollisionDetection&&Sne(e,!0),!h.equals(o.positionWC,L)){o._setTransform(x),o.worldToCameraCoordinatesPoint(L,L);let _=h.magnitudeSquared(L);h.magnitudeSquared(o.position)>_&&(h.normalize(o.position,o.position),h.multiplyByScalar(o.position,Math.sqrt(_),o.position));let C=h.angleBetween(L,o.position),w=h.cross(L,o.position,L);h.normalize(w,w);let D=Le.fromAxisAngle(w,C,xDt),N=$.fromQuaternion(D,TDt);$.multiplyByVector(N,o.direction,o.direction),$.multiplyByVector(N,o.up,o.up),h.cross(o.direction,o.up,o.right),h.cross(o.right,o.direction,o.up),o._setTransform(S)}}var wDt=new U,IDt=new U,JIe=new gn,ZIe=new gn,PDt=new h,DDt=new h;function Mf(e,t,n,i){let o=e._scene.camera,s=wDt;s.x=n.startPosition.x,s.y=0;let a=IDt;a.x=n.endPosition.x,a.y=0;let c=o.getPickRay(s,JIe),u=o.getPickRay(a,ZIe),f=0,d,p;o.frustum instanceof _n?(d=c.origin,p=u.origin,h.add(o.direction,d,d),h.add(o.direction,p,p),h.subtract(d,o.position,d),h.subtract(p,o.position,p),h.normalize(d,d),h.normalize(p,p)):(d=c.direction,p=u.direction);let g=h.dot(d,p);g<1&&(f=Math.acos(g)),f=n.startPosition.x>n.endPosition.x?-f:f;let m=e._horizontalRotationAxis;if(l(i)?o.look(i,-f):l(m)?o.look(m,-f):o.lookLeft(f),s.x=0,s.y=n.startPosition.y,a.x=0,a.y=n.endPosition.y,c=o.getPickRay(s,JIe),u=o.getPickRay(a,ZIe),f=0,o.frustum instanceof _n?(d=c.origin,p=u.origin,h.add(o.direction,d,d),h.add(o.direction,p,p),h.subtract(d,o.position,d),h.subtract(p,o.position,p),h.normalize(d,d),h.normalize(p,p)):(d=c.direction,p=u.direction),g=h.dot(d,p),g<1&&(f=Math.acos(g)),f=n.startPosition.y>n.endPosition.y?-f:f,i=i??m,l(i)){let y=o.direction,A=h.negate(i,PDt),b=h.equalsEpsilon(y,i,P.EPSILON2),x=h.equalsEpsilon(y,A,P.EPSILON2);if(!b&&!x){g=h.dot(y,i);let T=P.acosClamped(g);f>0&&f>T&&(f=T-P.EPSILON4),g=h.dot(y,A),T=P.acosClamped(g),f<0&&-f>T&&(f=-T+P.EPSILON4);let E=h.cross(i,y,DDt);o.look(E,f)}else(b&&f<0||x&&f>0)&&o.look(o.right,-f)}else o.lookUp(f)}function RDt(e){Yl(e,e.enableRotate,e.rotateEventTypes,fDt,e.inertiaSpin,"_lastInertiaSpinMovement"),Yl(e,e.enableZoom,e.zoomEventTypes,dPe,e.inertiaZoom,"_lastInertiaZoomMovement"),Yl(e,e.enableTilt,e.tiltEventTypes,EDt,e.inertiaSpin,"_lastInertiaTiltMovement"),Yl(e,e.enableLook,e.lookEventTypes,Mf)}var ODt=new M,MDt=new he;function Sne(e,t){e._adjustedHeightForTerrain=!0;let n=e._scene,i=n.mode;if(i===re.SCENE2D||i===re.MORPHING)return;let r=n.camera,o=n.ellipsoid??ee.WGS84,s=n.mapProjection,a,c;M.equals(r.transform,M.IDENTITY)||(a=M.clone(r.transform,ODt),c=h.magnitude(r.position),r._setTransform(M.IDENTITY));let u=MDt;i===re.SCENE3D?o.cartesianToCartographic(r.position,u):s.unproject(r.position,u);let f=!1;if(u.height<e._minimumCollisionTerrainHeight){let d=e._scene.globeHeight;if(l(d)){let p=d+e.minimumZoomDistance,g=d-e._lastGlobeHeight,m=g/e._lastGlobeHeight;u.height<p&&(t||Math.abs(m)<=.1)&&(u.height=p,i===re.SCENE3D?o.cartographicToCartesian(u,r.position):s.project(u,r.position),f=!0),t||Math.abs(m)<=.1?e._lastGlobeHeight=d:e._lastGlobeHeight+=g*.1}}l(a)&&(r._setTransform(a),f&&(h.normalize(r.position,r.position),h.negate(r.position,r.direction),h.multiplyByScalar(r.position,Math.max(c,e.minimumZoomDistance),r.position),h.normalize(r.direction,r.direction),h.cross(r.direction,r.up,r.right),h.cross(r.right,r.direction,r.up)))}$R.prototype.onMap=function(){let e=this._scene,t=e.mode,n=e.camera;return t===re.COLUMBUS_VIEW?Math.abs(n.position.x)-this._maxCoord.x<0&&Math.abs(n.position.y)-this._maxCoord.y<0:!0};var NDt=new h,LDt=new h;$R.prototype.update=function(){let e=this._scene,{camera:t,globe:n,mode:i}=e;M.equals(t.transform,M.IDENTITY)?(this._globe=n,this._ellipsoid=e.ellipsoid??ee.default):(this._globe=void 0,this._ellipsoid=ee.UNIT_SPHERE);let{verticalExaggeration:r,verticalExaggerationRelativeHeight:o}=e;this._minimumCollisionTerrainHeight=br.getHeight(this.minimumCollisionTerrainHeight,r,o),this._minimumPickingTerrainHeight=br.getHeight(this.minimumPickingTerrainHeight,r,o),this._minimumTrackBallHeight=br.getHeight(this.minimumTrackBallHeight,r,o),this._cameraUnderground=e.cameraUnderground&&l(this._globe);let s=this._ellipsoid.maximumRadius;this._rotateFactor=1/s,this._rotateRateRangeAdjustment=s,this._adjustedHeightForTerrain=!1;let a=h.clone(t.positionWC,NDt),c=h.clone(t.directionWC,LDt);if(i===re.SCENE2D?MPt(this):i===re.COLUMBUS_VIEW?(this._horizontalRotationAxis=h.UNIT_Z,iDt(this)):i===re.SCENE3D&&(this._horizontalRotationAxis=void 0,RDt(this)),this.enableCollisionDetection&&!this._adjustedHeightForTerrain){let u=!h.equals(a,t.positionWC)||!h.equals(c,t.directionWC);Sne(this,u)}this._aggregator.reset()};$R.prototype.isDestroyed=function(){return!1};$R.prototype.destroy=function(){return this._tweens.removeAll(),this._aggregator=this._aggregator&&this._aggregator.destroy(),le(this)};var wH=$R;function JR(e){let t=new gc(e);t.blendingEnabled=!1,t.scissorTest={enabled:!0,rectangle:new et},t.viewport=new et,this._context=e,this._fb=new ci({depthStencil:!0,pixelDatatype:ze.FLOAT,pixelFormat:$e.RGBA}),this._passState=t}function FDt(e,t,n,i){let r=Math.max(n,i),o=r*r,s=Math.floor(n*.5),a=Math.floor(i*.5),c=0,u=0,f=0,d=-1,p=[];for(let g=0;g<o;++g){if(-s<=c&&c<=s&&-a<=u&&u<=a){let m=4*((a-u)*n+c+s),y=t[m],A=e.getObjectByPickColor(y);l(A)&&p.push({object:A,isEdge:t[m+1]>0,depth:t[m+2],x:c,y:u})}if(c===u||c<0&&-c===u||c>0&&c===1-u){let m=f;f=-d,d=m}c+=f,u+=d}return p}JR.prototype.begin=function(e,t){let n=this._context,{width:i,height:r}=t;return et.clone(e,this._passState.scissorTest.rectangle),this._fb.update(n,i,r),this._passState.framebuffer=this._fb.framebuffer,this._passState.viewport.width=i,this._passState.viewport.height=r,this._passState};JR.prototype.end=function(e){let t=e.width??1,n=e.height??1,i=this._context,r=i.readPixels({x:e.x,y:e.y,width:t,height:n,pixelDatatype:ze.FLOAT,framebuffer:this._fb.framebuffer});return FDt(i,r,t,n)};JR.prototype.isDestroyed=function(){return!1};JR.prototype.destroy=function(){return this._fb.destroy(),le(this)};var IH=JR;var ZR={},BDt=new et(0,0,3,3),kDt=new U,UDt=new U,zDt=new gn,VDt=new h,jDt=3,HDt=.1,gPe=9;function wne(e){return Math.sqrt(e.x*e.x+e.y*e.y)}function _Pe(e){let t=Number.POSITIVE_INFINITY;for(let s of e)!s.isEdge&&wne(s)<=jDt&&(t=Math.min(t,s.depth));let n=t*(1+HDt),i=e.filter(s=>!s.isEdge||s.depth<=n),r=i.some(s=>s.isEdge);return i.filter(s=>s.isEdge===r).reduce((s,a)=>wne(a)<wne(s)?a:s)}function yPe(e,t){let n,i=Number.POSITIVE_INFINITY;for(let r of e){if(r.isEdge||r.object!==t)continue;let o=r.x*r.x+r.y*r.y;o<i&&(n=r,i=o)}return n}function Ine(e,t,n){let i=kDt;i.x=t.x+n.x,i.y=t.y+n.y;let r=e.camera.getPickRay(i,zDt);if(!l(r))return;let o=h.dot(r.direction,e.camera.directionWC);if(o<=0)return;let s=n.depth/o,a=h.multiplyByScalar(r.direction,s,VDt);return h.add(r.origin,a,new h)}ZR.snap=function(e,t,n){let i=n?.width??25,r=n?.height??i,{context:o,defaultView:s}=e;if(!o.colorBufferFloat){yt("snap-color-buffer-float","Scene.snap requires the EXT_color_buffer_float extension, which is not supported on this platform.");return}l(s.snapFramebuffer)||(s.snapFramebuffer=new IH(o));let a=s.snapFramebuffer,c=BDt;HR(e,t,c,i,r,{framebuffer:a,snap:!0});let u=a.end(c);if(GR(e),u.length===0)return;let f=_Pe(u);if(!l(f))return;let d=Ine(e,t,f);if(!l(d))return;let p=d;if(f.isEdge){let g=UDt;g.x=t.x+f.x,g.y=t.y+f.y,HR(e,g,c,gPe,gPe,{framebuffer:a,snap:!0});let m=a.end(c);GR(e);let y=yPe(m,f.object);p=l(y)?Ine(e,g,y):void 0}return{object:f.object,isEdge:f.isEdge,position:d,surfacePosition:p,screenPosition:new U(t.x+f.x,t.y+f.y)}};ZR._selectBestHit=_Pe;ZR._nearestSurfaceHit=yPe;ZR._snapHitToWorld=Ine;var PH=ZR;var DH=`uniform sampler2D colorTexture; uniform sampler2D colorTexture2; uniform vec2 center; uniform float radius; @@ -11236,7 +11236,7 @@ float x = length(gl_FragCoord.xy - center) / radius; float t = smoothstep(0.5, 0.8, x); out_FragColor = mix(color0 + color1, color1, t); } -`;var W5=`uniform sampler2D colorTexture; +`;var RH=`uniform sampler2D colorTexture; uniform float avgLuminance; uniform float threshold; uniform float offset; @@ -11257,7 +11257,7 @@ float brightness = brightLum / (offset + brightLum); xyz.r = brightness; out_FragColor = vec4(czm_XYZToRGB(xyz), 1.0); } -`;function c_(){this._sceneFramebuffer=new qw;let e=.125,t=new Array(6);t[0]=new zr({fragmentShader:Bf,textureScale:e,forcePowerOfTwo:!0,sampleMode:Zd.LINEAR});let n=t[1]=new zr({fragmentShader:W5,uniforms:{avgLuminance:.5,threshold:.25,offset:.1},textureScale:e,forcePowerOfTwo:!0}),i=this;this._delta=1,this._sigma=2,this._blurStep=new U,t[2]=new zr({fragmentShader:UT,uniforms:{step:function(){return i._blurStep.x=i._blurStep.y=1/n.outputTexture.width,i._blurStep},delta:function(){return i._delta},sigma:function(){return i._sigma},direction:0},textureScale:e,forcePowerOfTwo:!0}),t[3]=new zr({fragmentShader:UT,uniforms:{step:function(){return i._blurStep.x=i._blurStep.y=1/n.outputTexture.width,i._blurStep},delta:function(){return i._delta},sigma:function(){return i._sigma},direction:1},textureScale:e,forcePowerOfTwo:!0}),t[4]=new zr({fragmentShader:Bf,sampleMode:Zd.LINEAR}),this._uCenter=new U,this._uRadius=void 0,t[5]=new zr({fragmentShader:G5,uniforms:{center:function(){return i._uCenter},radius:function(){return i._uRadius},colorTexture2:function(){return i._sceneFramebuffer.framebuffer.getColorTexture(0)}}}),this._stages=new kf({stages:t});let r=new $w(this),o=t.length;for(let s=0;s<o;++s)t[s]._textureCache=r;this._textureCache=r,this.length=t.length}c_.prototype.get=function(e){return this._stages.get(e)};c_.prototype.getStageByName=function(e){let t=this._stages.length;for(let n=0;n<t;++n){let i=this._stages.get(n);if(i.name===e)return i}};var EBt=new se,pNe=new U,CBt=new U,gNe=new M;function vBt(e,t,n){let i=t.uniformState,r=i.sunPositionWC,o=i.view,s=i.viewProjection,a=i.projection,c=M.computeViewportTransformation(n,0,1,gNe),u=M.multiplyByPoint(o,r,EBt),f=At.pointToGLWindowCoordinates(s,c,r,pNe);u.x+=P.SOLAR_RADIUS;let d=At.pointToGLWindowCoordinates(a,c,u,u),p=U.magnitude(U.subtract(d,f,d))*30*2,g=CBt;g.x=p,g.y=p,e._uCenter=U.clone(f,e._uCenter),e._uRadius=Math.max(g.x,g.y)*.15;let m=t.drawingBufferWidth,y=t.drawingBufferHeight,A=e._stages,b=A.get(0),x=b.outputTexture.width,T=b.outputTexture.height,E=new et;E.width=x,E.height=T,c=M.computeViewportTransformation(E,0,1,gNe),f=At.pointToGLWindowCoordinates(s,c,r,pNe),g.x*=x/m,g.y*=T/y;let v=b.scissorRectangle;v.x=Math.max(f.x-g.x*.5,0),v.y=Math.max(f.y-g.y*.5,0),v.width=Math.min(g.x,m),v.height=Math.min(g.y,y);for(let S=1;S<4;++S)et.clone(v,A.get(S).scissorRectangle)}c_.prototype.clear=function(e,t,n){this._sceneFramebuffer.clear(e,t,n),this._textureCache.clear(e)};c_.prototype.update=function(e){let t=e.context,n=e.viewport,i=this._sceneFramebuffer;i.update(t,n);let r=i.framebuffer;return this._textureCache.update(t),this._stages.update(t,!1),vBt(this,t,n),r};c_.prototype.execute=function(e){let t=this._sceneFramebuffer.framebuffer.getColorTexture(0),n=this._stages,i=n.length;n.get(0).execute(e,t);for(let r=1;r<i;++r)n.get(r).execute(e,n.get(r-1).outputTexture)};c_.prototype.copy=function(e,t){if(!l(this._copyColorCommand)){let n=this;this._copyColorCommand=e.createViewportQuadCommand(Bf,{uniformMap:{colorTexture:function(){return n._stages.get(n._stages.length-1).outputTexture}},owner:this})}this._copyColorCommand.framebuffer=t,this._copyColorCommand.execute(e)};c_.prototype.isDestroyed=function(){return!1};c_.prototype.destroy=function(){return this._textureCache.destroy(),this._stages.destroy(),le(this)};var q5=c_;function _Ne(){this._cachedShowFrustumsShaders={}}function SBt(e){let t={},n=e.vertexAttributes;for(let i in n)n.hasOwnProperty(i)&&(t[i]=n[i].index);return t}function wBt(e,t){let n=e.context,i=t,r=i.fragmentShaderSource.clone(),o=[];r.sources=r.sources.map(function(f){f=Xe.replaceMain(f,"czm_Debug_main");let d=/out_FragData_(\d+)/g,p;for(;(p=d.exec(f))!==null;)o.indexOf(p[1])===-1&&o.push(p[1]);return f});let s=o.length,a="";a+=`uniform vec3 debugShowCommandsColor; +`;function Xg(){this._sceneFramebuffer=new ew;let e=.125,t=new Array(6);t[0]=new Ur({fragmentShader:Pf,textureScale:e,forcePowerOfTwo:!0,sampleMode:Yd.LINEAR});let n=t[1]=new Ur({fragmentShader:RH,uniforms:{avgLuminance:.5,threshold:.25,offset:.1},textureScale:e,forcePowerOfTwo:!0}),i=this;this._delta=1,this._sigma=2,this._blurStep=new U,t[2]=new Ur({fragmentShader:fT,uniforms:{step:function(){return i._blurStep.x=i._blurStep.y=1/n.outputTexture.width,i._blurStep},delta:function(){return i._delta},sigma:function(){return i._sigma},direction:0},textureScale:e,forcePowerOfTwo:!0}),t[3]=new Ur({fragmentShader:fT,uniforms:{step:function(){return i._blurStep.x=i._blurStep.y=1/n.outputTexture.width,i._blurStep},delta:function(){return i._delta},sigma:function(){return i._sigma},direction:1},textureScale:e,forcePowerOfTwo:!0}),t[4]=new Ur({fragmentShader:Pf,sampleMode:Yd.LINEAR}),this._uCenter=new U,this._uRadius=void 0,t[5]=new Ur({fragmentShader:DH,uniforms:{center:function(){return i._uCenter},radius:function(){return i._uRadius},colorTexture2:function(){return i._sceneFramebuffer.framebuffer.getColorTexture(0)}}}),this._stages=new Df({stages:t});let r=new rw(this),o=t.length;for(let s=0;s<o;++s)t[s]._textureCache=r;this._textureCache=r,this.length=t.length}Xg.prototype.get=function(e){return this._stages.get(e)};Xg.prototype.getStageByName=function(e){let t=this._stages.length;for(let n=0;n<t;++n){let i=this._stages.get(n);if(i.name===e)return i}};var GDt=new se,APe=new U,WDt=new U,bPe=new M;function qDt(e,t,n){let i=t.uniformState,r=i.sunPositionWC,o=i.view,s=i.viewProjection,a=i.projection,c=M.computeViewportTransformation(n,0,1,bPe),u=M.multiplyByPoint(o,r,GDt),f=At.pointToGLWindowCoordinates(s,c,r,APe);u.x+=P.SOLAR_RADIUS;let d=At.pointToGLWindowCoordinates(a,c,u,u),p=U.magnitude(U.subtract(d,f,d))*30*2,g=WDt;g.x=p,g.y=p,e._uCenter=U.clone(f,e._uCenter),e._uRadius=Math.max(g.x,g.y)*.15;let m=t.drawingBufferWidth,y=t.drawingBufferHeight,A=e._stages,b=A.get(0),x=b.outputTexture.width,T=b.outputTexture.height,E=new et;E.width=x,E.height=T,c=M.computeViewportTransformation(E,0,1,bPe),f=At.pointToGLWindowCoordinates(s,c,r,APe),g.x*=x/m,g.y*=T/y;let v=b.scissorRectangle;v.x=Math.max(f.x-g.x*.5,0),v.y=Math.max(f.y-g.y*.5,0),v.width=Math.min(g.x,m),v.height=Math.min(g.y,y);for(let S=1;S<4;++S)et.clone(v,A.get(S).scissorRectangle)}Xg.prototype.clear=function(e,t,n){this._sceneFramebuffer.clear(e,t,n),this._textureCache.clear(e)};Xg.prototype.update=function(e){let t=e.context,n=e.viewport,i=this._sceneFramebuffer;i.update(t,n);let r=i.framebuffer;return this._textureCache.update(t),this._stages.update(t,!1),qDt(this,t,n),r};Xg.prototype.execute=function(e){let t=this._sceneFramebuffer.framebuffer.getColorTexture(0),n=this._stages,i=n.length;n.get(0).execute(e,t);for(let r=1;r<i;++r)n.get(r).execute(e,n.get(r-1).outputTexture)};Xg.prototype.copy=function(e,t){if(!l(this._copyColorCommand)){let n=this;this._copyColorCommand=e.createViewportQuadCommand(Pf,{uniformMap:{colorTexture:function(){return n._stages.get(n._stages.length-1).outputTexture}},owner:this})}this._copyColorCommand.framebuffer=t,this._copyColorCommand.execute(e)};Xg.prototype.isDestroyed=function(){return!1};Xg.prototype.destroy=function(){return this._textureCache.destroy(),this._stages.destroy(),le(this)};var OH=Xg;function xPe(){this._cachedShowFrustumsShaders={}}function YDt(e){let t={},n=e.vertexAttributes;for(let i in n)n.hasOwnProperty(i)&&(t[i]=n[i].index);return t}function XDt(e,t){let n=e.context,i=t,r=i.fragmentShaderSource.clone(),o=[];r.sources=r.sources.map(function(f){f=Xe.replaceMain(f,"czm_Debug_main");let d=/out_FragData_(\d+)/g,p;for(;(p=d.exec(f))!==null;)o.indexOf(p[1])===-1&&o.push(p[1]);return f});let s=o.length,a="";a+=`uniform vec3 debugShowCommandsColor; `,a+=`uniform vec3 debugShowFrustumsColor; `,a+=`void main() { @@ -11266,11 +11266,11 @@ out_FragColor = vec4(czm_XYZToRGB(xyz), 1.0); `,a+=` out_FragData_${o[c]}.rgb *= debugShowFrustumsColor; `;else a+=` out_FragColor.rgb *= debugShowCommandsColor; `,a+=` out_FragColor.rgb *= debugShowFrustumsColor; -`;a+="}",r.sources.push(a);let u=SBt(i);return Qt.fromCache({context:n,vertexShaderSource:i.vertexShaderSource,fragmentShaderSource:r,attributeLocations:u})}var aM=new z;function IBt(e,t){let n;return l(t.uniformMap)?n=t.uniformMap:n={},l(n.debugShowCommandsColor)||l(n.debugShowFrustumsColor)||(n.debugShowCommandsColor=function(){return e.debugShowCommands?(l(t._debugColor)||(t._debugColor=z.fromRandom()),t._debugColor):z.WHITE},n.debugShowFrustumsColor=function(){return e.debugShowFrustums?(aM.red=t.debugOverlappingFrustums&1?1:0,aM.green=t.debugOverlappingFrustums&2?1:0,aM.blue=t.debugOverlappingFrustums&4?1:0,aM.alpha=1,aM):z.WHITE}),n}var PBt=new at;_Ne.prototype.executeDebugShowFrustumsCommand=function(e,t,n){let i=t.shaderProgram.id,r=this._cachedShowFrustumsShaders[i];l(r)||(r=wBt(e,t.shaderProgram),this._cachedShowFrustumsShaders[i]=r);let o=at.shallowClone(t,PBt);o.shaderProgram=r,o.uniformMap=IBt(e,t),o.execute(e.context,n)};var Y5=_Ne;function qT(e,t,n){this._primitive=e,this._tileIndex=t,this._sampleIndex=n,this._metadata={},this._orientedBoundingBox=new en}qT.fromKeyframeNode=function(e,t,n,i){let r=new qT(e,t,n),{spatialNode:o,content:s}=i;return r._metadata=DBt(e,s,n),r._orientedBoundingBox=OBt(e,o,n,r._orientedBoundingBox),r};function DBt(e,t,n){if(!l(t)||!l(t.metadata))return;let{names:i,types:r}=e.provider,{metadata:o}=t,s={};for(let a=0;a<i.length;a++){let c=i[a],u=bt.getComponentCount(r[a]),f=o[a].slice(n*u,(n+1)*u);s[c]=f}return s}var yNe=new h,RBt=new h;function OBt(e,t,n,i){let r=t.dimensions,o=r.x*r.y,s=Math.floor(n/o),a=n-s*o,c=Math.floor(a/r.x),u=a-c*r.x,f=h.fromElements(u,c,s,yNe),d=h.divideComponents(h.subtract(f,e._paddingBefore,yNe),e.dimensions,RBt);return e._shape.computeOrientedBoundingBoxForSample(t,e.dimensions,d,i)}Object.defineProperties(qT.prototype,{metadata:{get:function(){return this._metadata}},primitive:{get:function(){return this._primitive}},sampleIndex:{get:function(){return this._sampleIndex}},tileIndex:{get:function(){return this._tileIndex}},orientedBoundingBox:{get:function(){return this._orientedBoundingBox.clone()}}});qT.prototype.hasProperty=function(e){return l(this._metadata[e])};qT.prototype.getNames=function(){return Object.keys(this._metadata)};qT.prototype.getProperty=function(e){return this._metadata[e]};var X5=qT;function MBt(e,t){let n=document.createElement("canvas");n.width=t,n.height=1;let i=n.getContext("2d"),r=i.createLinearGradient(0,0,n.width,0),o=1/(e.length-1);for(let c=0;c<e.length;c++){let u=e[c],f=c*o,d=u.toCssColorString();r.addColorStop(f,d)}i.fillStyle=r,i.fillRect(0,0,n.width,n.height);let s=i.getImageData(0,0,n.width,n.height);return new Uint8Array(s.data.buffer)}var K5=MBt;var ANe={FLOAT:"float",VEC2:"vec2",VEC3:"vec3",VEC4:"vec4",INT:"int",INT_VEC2:"ivec2",INT_VEC3:"ivec3",INT_VEC4:"ivec4",BOOL:"bool",BOOL_VEC2:"bvec2",BOOL_VEC3:"bvec3",BOOL_VEC4:"bvec4",MAT2:"mat2",MAT3:"mat3",MAT4:"mat4",SAMPLER_2D:"sampler2D",SAMPLER_CUBE:"samplerCube"};Object.freeze(ANe);var l_=ANe;function NBt(e,t,n){let i=new Uint8ClampedArray(e.buffer),r=new ImageData(i,t,n),o=document.createElement("canvas");return o.width=t,o.height=n,o.getContext("2d").putImageData(r,0,0),o}var $5=NBt;function eI(){this._defaultTexture=void 0,this._textures={},this._loadedImages=[],this._lastUpdatedFrame=-1}eI.prototype.getTexture=function(e){return this._textures[e]};function LBt(e,t,n){n.resource.fetchImage().then(function(i){e._loadedImages.push({id:t,image:i,textureUniform:n})}).catch(function(){let i=e._textures[t];l(i)&&i!==e._defaultTexture&&i.destroy(),e._textures[t]=e._defaultTexture})}eI.prototype.loadTexture2D=function(e,t){l(t.typedArray)?this._loadedImages.push({id:e,textureUniform:t}):LBt(this,e,t)};function FBt(e,t,n){let{id:i,textureUniform:r,image:o}=t,s=n.webgl2?J5(r,o,n):BBt(r,o,n),a=e._textures[i];l(a)&&a!==n.defaultTexture&&a.destroy(),e._textures[i]=s}function J5(e,t,n){let{typedArray:i,sampler:r}=e,o=l(i)?xNe(e,n):new Dt({context:n,source:t,sampler:r});return bNe(r)&&o.generateMipmap(),o}function BBt(e,t,n){let{typedArray:i,sampler:r}=e,o=bNe(r),s=r.wrapS===hn.REPEAT||r.wrapS===hn.MIRRORED_REPEAT||r.wrapT===hn.REPEAT||r.wrapT===hn.MIRRORED_REPEAT,{width:a,height:c}=l(i)?e:t,u=[a,c].every(P.isPowerOfTwo);if((o||s)&&!u)if(l(i)){if(e.pixelDatatype===ze.UNSIGNED_BYTE){let d=$5(i,a,c),p=ex(d);return J5({sampler:r},p,n)}}else{let d=ex(t);return J5(e,d,n)}else return J5(e,t,n);return o?console.warn("Texture requires resizing for mipmaps but pixelDataType cannot be resized. The texture may be rendered incorrectly."):s&&console.warn("Texture requires resizing for wrapping but pixelDataType cannot be resized. The texture may be rendered incorrectly."),xNe(e,n)}function bNe(e){return[Wt.NEAREST_MIPMAP_NEAREST,Wt.NEAREST_MIPMAP_LINEAR,Wt.LINEAR_MIPMAP_NEAREST,Wt.LINEAR_MIPMAP_LINEAR].includes(e.minificationFilter)}function xNe(e,t){let{pixelFormat:n,pixelDatatype:i,width:r,height:o,typedArray:s,sampler:a}=e;return new Dt({context:t,pixelFormat:n,pixelDatatype:i,source:{arrayBufferView:s,width:r,height:o},sampler:a,flipY:!1})}eI.prototype.update=function(e){if(e.frameNumber===this._lastUpdatedFrame)return;this._lastUpdatedFrame=e.frameNumber;let t=e.context;this._defaultTexture=t.defaultTexture;let n=this._loadedImages;for(let i=0;i<n.length;i++){let r=n[i];FBt(this,r,t)}n.length=0};eI.prototype.isDestroyed=function(){return!1};eI.prototype.destroy=function(){let e=this._textures;for(let t in e)if(e.hasOwnProperty(t)){let n=e[t];n!==this._defaultTexture&&n.destroy()}return le(this)};var Z5=eI;function cM(e){e=e??H.EMPTY_OBJECT,this.mode=e.mode??Iy.MODIFY_MATERIAL,this.lightingModel=e.lightingModel,this.uniforms=e.uniforms??H.EMPTY_OBJECT,this.varyings=e.varyings??H.EMPTY_OBJECT,this.vertexShaderText=e.vertexShaderText,this.fragmentShaderText=e.fragmentShaderText,this.translucencyMode=e.translucencyMode??mx.INHERIT,this._textureManager=new Z5,this._defaultTexture=void 0,this.uniformMap=kBt(this),this.usedVariablesVertex={attributeSet:{},featureIdSet:{},metadataSet:{}},this.usedVariablesFragment={attributeSet:{},featureIdSet:{},metadataSet:{},materialSet:{}},VBt(this),jBt(this)}function kBt(e){let t=e.uniforms,n={};for(let i in t)if(t.hasOwnProperty(i)){let r=t[i];r.type===l_.SAMPLER_2D?(e._textureManager.loadTexture2D(i,r.value),n[i]=UBt(e,i)):n[i]=zBt(e,i)}return n}function UBt(e,t){return function(){return e._textureManager.getTexture(t)??e._defaultTexture}}function zBt(e,t){return function(){return e.uniforms[t].value}}function YT(e,t,n){let i;for(;(i=t.exec(e))!==null;){let r=i[1];n[r]=!0}}function VBt(e){let t=/[vf]sInput\.attributes\.(\w+)/g,n=/[vf]sInput\.featureIds\.(\w+)/g,i=/[vf]sInput\.(?:metadata|metadataClass|metadataStatistics)\.(\w+)/g,r,o=e.vertexShaderText;l(o)&&(r=e.usedVariablesVertex.attributeSet,YT(o,t,r),r=e.usedVariablesVertex.featureIdSet,YT(o,n,r),r=e.usedVariablesVertex.metadataSet,YT(o,i,r));let s=e.fragmentShaderText;if(l(s)){r=e.usedVariablesFragment.attributeSet,YT(s,t,r),r=e.usedVariablesFragment.featureIdSet,YT(s,n,r),r=e.usedVariablesFragment.metadataSet,YT(s,i,r);let a=/material\.(\w+)/g,c=e.usedVariablesFragment.materialSet;YT(s,a,c)}}function TNe(e){let t=/^.*MC$/,n=/^.*WC$/,i=/^.*EC$/;return t.test(e)?`${e} (model coordinates)`:n.test(e)?`${e} (Cartesian world coordinates)`:i.test(e)?`${e} (eye coordinates)`:e}function hl(e,t,n,i){if(e.hasOwnProperty(t)){let r=`${TNe(t)} is not available in the ${i} shader. Did you mean ${TNe(n)} instead?`;throw new pe(r)}}function jBt(e){let t=e.usedVariablesVertex.attributeSet;hl(t,"position","positionMC","vertex"),hl(t,"normal","normalMC","vertex"),hl(t,"tangent","tangentMC","vertex"),hl(t,"bitangent","bitangentMC","vertex"),hl(t,"positionWC","positionMC","vertex"),hl(t,"positionEC","positionMC","vertex"),hl(t,"normalEC","normalMC","vertex"),hl(t,"tangentEC","tangentMC","vertex"),hl(t,"bitangentEC","bitangentMC","vertex");let n=e.usedVariablesFragment.attributeSet;hl(n,"position","positionEC","fragment"),hl(n,"normal","normalEC","fragment"),hl(n,"tangent","tangentEC","fragment"),hl(n,"bitangent","bitangentEC","fragment"),hl(n,"normalMC","normalEC","fragment"),hl(n,"tangentMC","tangentEC","fragment"),hl(n,"bitangentMC","bitangentEC","fragment")}cM.prototype.setUniform=function(e,t){let n=this.uniforms[e];n.type===l_.SAMPLER_2D?this._textureManager.loadTexture2D(e,t):l(t.clone)?n.value=t.clone(n.value):n.value=t};cM.prototype.update=function(e){this._defaultTexture=e.context.defaultTexture,this._textureManager.update(e)};cM.prototype.isDestroyed=function(){return!1};cM.prototype.destroy=function(){this._textureManager=this._textureManager&&this._textureManager.destroy(),le(this)};var u_=cM;function HBt(e){e=e??H.EMPTY_OBJECT,this.typedArray=e.typedArray,this.width=e.width,this.height=e.height,this.pixelFormat=e.pixelFormat??$e.RGBA,this.pixelDatatype=e.pixelDatatype??ze.UNSIGNED_BYTE;let t=e.url;typeof t=="string"&&(t=De.createIfNeeded(t)),this.resource=t;let i=e.repeat??!0?hn.REPEAT:hn.CLAMP_TO_EDGE;this.sampler=new Ht({wrapS:i,wrapT:i,minificationFilter:e.minificationFilter,magnificationFilter:e.magnificationFilter,maximumAnisotropy:e.maximumAnisotropy})}var Q5=HBt;function GBt(e){let{names:t,types:n,componentTypes:i,minimumValues:r,maximumValues:o}=e;for(let s=0;s<t.length;s++){if(!WBt(r?.[s],o?.[s]))continue;let a=qBt(t[s],n[s],i[s],r[s],o[s]);if(l(a))return a}}function WBt(e,t){if(!Array.isArray(e)||!Array.isArray(t))return!1;let n=Math.min(...e),i=Math.max(...t);return n<i}function qBt(e,t,n,i,r){if(t===bt.VEC4&&n===Ft.FLOAT32)return YBt(e,i,r);if(t===bt.SCALAR&&n===Ft.FLOAT32)return XBt(e,i,r)}function YBt(e,t,n){let i=Math.min(...t),r=Math.max(...n);if(!(i<0||r>1))return new u_({fragmentShaderText:`void fragmentMain(FragmentInput fsInput, inout czm_modelMaterial material) +`;a+="}",r.sources.push(a);let u=YDt(i);return Qt.fromCache({context:n,vertexShaderSource:i.vertexShaderSource,fragmentShaderSource:r,attributeLocations:u})}var QR=new z;function KDt(e,t){let n;return l(t.uniformMap)?n=t.uniformMap:n={},l(n.debugShowCommandsColor)||l(n.debugShowFrustumsColor)||(n.debugShowCommandsColor=function(){return e.debugShowCommands?(l(t._debugColor)||(t._debugColor=z.fromRandom()),t._debugColor):z.WHITE},n.debugShowFrustumsColor=function(){return e.debugShowFrustums?(QR.red=t.debugOverlappingFrustums&1?1:0,QR.green=t.debugOverlappingFrustums&2?1:0,QR.blue=t.debugOverlappingFrustums&4?1:0,QR.alpha=1,QR):z.WHITE}),n}var $Dt=new at;xPe.prototype.executeDebugShowFrustumsCommand=function(e,t,n){let i=t.shaderProgram.id,r=this._cachedShowFrustumsShaders[i];l(r)||(r=XDt(e,t.shaderProgram),this._cachedShowFrustumsShaders[i]=r);let o=at.shallowClone(t,$Dt);o.shaderProgram=r,o.uniformMap=KDt(e,t),o.execute(e.context,n)};var MH=xPe;function yT(e,t,n){this._primitive=e,this._tileIndex=t,this._sampleIndex=n,this._metadata={},this._orientedBoundingBox=new en}yT.fromKeyframeNode=function(e,t,n,i){let r=new yT(e,t,n),{spatialNode:o,content:s}=i;return r._metadata=JDt(e,s,n),r._orientedBoundingBox=QDt(e,o,n,r._orientedBoundingBox),r};function JDt(e,t,n){if(!l(t)||!l(t.metadata))return;let{names:i,types:r}=e.provider,{metadata:o}=t,s={};for(let a=0;a<i.length;a++){let c=i[a],u=bt.getComponentCount(r[a]),f=o[a].slice(n*u,(n+1)*u);s[c]=f}return s}var TPe=new h,ZDt=new h;function QDt(e,t,n,i){let r=t.dimensions,o=r.x*r.y,s=Math.floor(n/o),a=n-s*o,c=Math.floor(a/r.x),u=a-c*r.x,f=h.fromElements(u,c,s,TPe),d=h.divideComponents(h.subtract(f,e._paddingBefore,TPe),e.dimensions,ZDt);return e._shape.computeOrientedBoundingBoxForSample(t,e.dimensions,d,i)}Object.defineProperties(yT.prototype,{metadata:{get:function(){return this._metadata}},primitive:{get:function(){return this._primitive}},sampleIndex:{get:function(){return this._sampleIndex}},tileIndex:{get:function(){return this._tileIndex}},orientedBoundingBox:{get:function(){return this._orientedBoundingBox.clone()}}});yT.prototype.hasProperty=function(e){return l(this._metadata[e])};yT.prototype.getNames=function(){return Object.keys(this._metadata)};yT.prototype.getProperty=function(e){return this._metadata[e]};var NH=yT;function e1t(e,t){let n=document.createElement("canvas");n.width=t,n.height=1;let i=n.getContext("2d"),r=i.createLinearGradient(0,0,n.width,0),o=1/(e.length-1);for(let c=0;c<e.length;c++){let u=e[c],f=c*o,d=u.toCssColorString();r.addColorStop(f,d)}i.fillStyle=r,i.fillRect(0,0,n.width,n.height);let s=i.getImageData(0,0,n.width,n.height);return new Uint8Array(s.data.buffer)}var LH=e1t;var EPe={FLOAT:"float",VEC2:"vec2",VEC3:"vec3",VEC4:"vec4",INT:"int",INT_VEC2:"ivec2",INT_VEC3:"ivec3",INT_VEC4:"ivec4",BOOL:"bool",BOOL_VEC2:"bvec2",BOOL_VEC3:"bvec3",BOOL_VEC4:"bvec4",MAT2:"mat2",MAT3:"mat3",MAT4:"mat4",SAMPLER_2D:"sampler2D",SAMPLER_CUBE:"samplerCube"};Object.freeze(EPe);var Kg=EPe;function t1t(e,t,n){let i=new Uint8ClampedArray(e.buffer),r=new ImageData(i,t,n),o=document.createElement("canvas");return o.width=t,o.height=n,o.getContext("2d").putImageData(r,0,0),o}var FH=t1t;function cw(){this._defaultTexture=void 0,this._textures={},this._loadedImages=[],this._lastUpdatedFrame=-1}cw.prototype.getTexture=function(e){return this._textures[e]};function n1t(e,t,n){n.resource.fetchImage().then(function(i){e._loadedImages.push({id:t,image:i,textureUniform:n})}).catch(function(){let i=e._textures[t];l(i)&&i!==e._defaultTexture&&i.destroy(),e._textures[t]=e._defaultTexture})}cw.prototype.loadTexture2D=function(e,t){l(t.typedArray)?this._loadedImages.push({id:e,textureUniform:t}):n1t(this,e,t)};function i1t(e,t,n){let{id:i,textureUniform:r,image:o}=t,s=n.webgl2?BH(r,o,n):r1t(r,o,n),a=e._textures[i];l(a)&&a!==n.defaultTexture&&a.destroy(),e._textures[i]=s}function BH(e,t,n){let{typedArray:i,sampler:r}=e,o=l(i)?vPe(e,n):new Dt({context:n,source:t,sampler:r});return CPe(r)&&o.generateMipmap(),o}function r1t(e,t,n){let{typedArray:i,sampler:r}=e,o=CPe(r),s=r.wrapS===hn.REPEAT||r.wrapS===hn.MIRRORED_REPEAT||r.wrapT===hn.REPEAT||r.wrapT===hn.MIRRORED_REPEAT,{width:a,height:c}=l(i)?e:t,u=[a,c].every(P.isPowerOfTwo);if((o||s)&&!u)if(l(i)){if(e.pixelDatatype===ze.UNSIGNED_BYTE){let d=FH(i,a,c),p=px(d);return BH({sampler:r},p,n)}}else{let d=px(t);return BH(e,d,n)}else return BH(e,t,n);return o?console.warn("Texture requires resizing for mipmaps but pixelDataType cannot be resized. The texture may be rendered incorrectly."):s&&console.warn("Texture requires resizing for wrapping but pixelDataType cannot be resized. The texture may be rendered incorrectly."),vPe(e,n)}function CPe(e){return[Wt.NEAREST_MIPMAP_NEAREST,Wt.NEAREST_MIPMAP_LINEAR,Wt.LINEAR_MIPMAP_NEAREST,Wt.LINEAR_MIPMAP_LINEAR].includes(e.minificationFilter)}function vPe(e,t){let{pixelFormat:n,pixelDatatype:i,width:r,height:o,typedArray:s,sampler:a}=e;return new Dt({context:t,pixelFormat:n,pixelDatatype:i,source:{arrayBufferView:s,width:r,height:o},sampler:a,flipY:!1})}cw.prototype.update=function(e){if(e.frameNumber===this._lastUpdatedFrame)return;this._lastUpdatedFrame=e.frameNumber;let t=e.context;this._defaultTexture=t.defaultTexture;let n=this._loadedImages;for(let i=0;i<n.length;i++){let r=n[i];i1t(this,r,t)}n.length=0};cw.prototype.isDestroyed=function(){return!1};cw.prototype.destroy=function(){let e=this._textures;for(let t in e)if(e.hasOwnProperty(t)){let n=e[t];n!==this._defaultTexture&&n.destroy()}return le(this)};var kH=cw;function eO(e){e=e??H.EMPTY_OBJECT,this.mode=e.mode??Py.MODIFY_MATERIAL,this.lightingModel=e.lightingModel,this.uniforms=e.uniforms??H.EMPTY_OBJECT,this.varyings=e.varyings??H.EMPTY_OBJECT,this.vertexShaderText=e.vertexShaderText,this.fragmentShaderText=e.fragmentShaderText,this.translucencyMode=e.translucencyMode??Sx.INHERIT,this._textureManager=new kH,this._defaultTexture=void 0,this.uniformMap=o1t(this),this.usedVariablesVertex={attributeSet:{},featureIdSet:{},metadataSet:{}},this.usedVariablesFragment={attributeSet:{},featureIdSet:{},metadataSet:{},materialSet:{}},c1t(this),l1t(this)}function o1t(e){let t=e.uniforms,n={};for(let i in t)if(t.hasOwnProperty(i)){let r=t[i];r.type===Kg.SAMPLER_2D?(e._textureManager.loadTexture2D(i,r.value),n[i]=s1t(e,i)):n[i]=a1t(e,i)}return n}function s1t(e,t){return function(){return e._textureManager.getTexture(t)??e._defaultTexture}}function a1t(e,t){return function(){return e.uniforms[t].value}}function AT(e,t,n){let i;for(;(i=t.exec(e))!==null;){let r=i[1];n[r]=!0}}function c1t(e){let t=/[vf]sInput\.attributes\.(\w+)/g,n=/[vf]sInput\.featureIds\.(\w+)/g,i=/[vf]sInput\.(?:metadata|metadataClass|metadataStatistics)\.(\w+)/g,r,o=e.vertexShaderText;l(o)&&(r=e.usedVariablesVertex.attributeSet,AT(o,t,r),r=e.usedVariablesVertex.featureIdSet,AT(o,n,r),r=e.usedVariablesVertex.metadataSet,AT(o,i,r));let s=e.fragmentShaderText;if(l(s)){r=e.usedVariablesFragment.attributeSet,AT(s,t,r),r=e.usedVariablesFragment.featureIdSet,AT(s,n,r),r=e.usedVariablesFragment.metadataSet,AT(s,i,r);let a=/material\.(\w+)/g,c=e.usedVariablesFragment.materialSet;AT(s,a,c)}}function SPe(e){let t=/^.*MC$/,n=/^.*WC$/,i=/^.*EC$/;return t.test(e)?`${e} (model coordinates)`:n.test(e)?`${e} (Cartesian world coordinates)`:i.test(e)?`${e} (eye coordinates)`:e}function ul(e,t,n,i){if(e.hasOwnProperty(t)){let r=`${SPe(t)} is not available in the ${i} shader. Did you mean ${SPe(n)} instead?`;throw new pe(r)}}function l1t(e){let t=e.usedVariablesVertex.attributeSet;ul(t,"position","positionMC","vertex"),ul(t,"normal","normalMC","vertex"),ul(t,"tangent","tangentMC","vertex"),ul(t,"bitangent","bitangentMC","vertex"),ul(t,"positionWC","positionMC","vertex"),ul(t,"positionEC","positionMC","vertex"),ul(t,"normalEC","normalMC","vertex"),ul(t,"tangentEC","tangentMC","vertex"),ul(t,"bitangentEC","bitangentMC","vertex");let n=e.usedVariablesFragment.attributeSet;ul(n,"position","positionEC","fragment"),ul(n,"normal","normalEC","fragment"),ul(n,"tangent","tangentEC","fragment"),ul(n,"bitangent","bitangentEC","fragment"),ul(n,"normalMC","normalEC","fragment"),ul(n,"tangentMC","tangentEC","fragment"),ul(n,"bitangentMC","bitangentEC","fragment")}eO.prototype.setUniform=function(e,t){let n=this.uniforms[e];n.type===Kg.SAMPLER_2D?this._textureManager.loadTexture2D(e,t):l(t.clone)?n.value=t.clone(n.value):n.value=t};eO.prototype.update=function(e){this._defaultTexture=e.context.defaultTexture,this._textureManager.update(e)};eO.prototype.isDestroyed=function(){return!1};eO.prototype.destroy=function(){this._textureManager=this._textureManager&&this._textureManager.destroy(),le(this)};var $g=eO;function u1t(e){e=e??H.EMPTY_OBJECT,this.typedArray=e.typedArray,this.width=e.width,this.height=e.height,this.pixelFormat=e.pixelFormat??$e.RGBA,this.pixelDatatype=e.pixelDatatype??ze.UNSIGNED_BYTE;let t=e.url;typeof t=="string"&&(t=De.createIfNeeded(t)),this.resource=t;let i=e.repeat??!0?hn.REPEAT:hn.CLAMP_TO_EDGE;this.sampler=new Ht({wrapS:i,wrapT:i,minificationFilter:e.minificationFilter,magnificationFilter:e.magnificationFilter,maximumAnisotropy:e.maximumAnisotropy})}var UH=u1t;function f1t(e){let{names:t,types:n,componentTypes:i,minimumValues:r,maximumValues:o}=e;for(let s=0;s<t.length;s++){if(!d1t(r?.[s],o?.[s]))continue;let a=h1t(t[s],n[s],i[s],r[s],o[s]);if(l(a))return a}}function d1t(e,t){if(!Array.isArray(e)||!Array.isArray(t))return!1;let n=Math.min(...e),i=Math.max(...t);return n<i}function h1t(e,t,n,i,r){if(t===bt.VEC4&&n===Lt.FLOAT32)return m1t(e,i,r);if(t===bt.SCALAR&&n===Lt.FLOAT32)return p1t(e,i,r)}function m1t(e,t,n){let i=Math.min(...t),r=Math.max(...n);if(!(i<0||r>1))return new $g({fragmentShaderText:`void fragmentMain(FragmentInput fsInput, inout czm_modelMaterial material) { material.diffuse = fsInput.metadata.${e}.rgb; material.alpha = fsInput.metadata.${e}.a; -}`})}function XBt(e,t,n){let r=K5([new z(.267,.004,.329),new z(.282,.14,.457),new z(.254,.265,.53),new z(.207,.372,.553),new z(.164,.471,.558),new z(.128,.567,.551),new z(.135,.659,.518),new z(.194,.741,.443),new z(.282,.819,.369),new z(.396,.898,.301),new z(.538,.965,.236),new z(.741,.998,.149),new z(.993,1,.144)],128),o=new Q5({typedArray:r,width:128,height:1});return new u_({uniforms:{u_colorMap:{type:l_.SAMPLER_2D,value:o},u_minimumValue:{type:l_.FLOAT,value:t[0]},u_maximumValue:{type:l_.FLOAT,value:n[0]}},fragmentShaderText:`void fragmentMain(FragmentInput fsInput, inout czm_modelMaterial material) +}`})}function p1t(e,t,n){let r=LH([new z(.267,.004,.329),new z(.282,.14,.457),new z(.254,.265,.53),new z(.207,.372,.553),new z(.164,.471,.558),new z(.128,.567,.551),new z(.135,.659,.518),new z(.194,.741,.443),new z(.282,.819,.369),new z(.396,.898,.301),new z(.538,.965,.236),new z(.741,.998,.149),new z(.993,1,.144)],128),o=new UH({typedArray:r,width:128,height:1});return new $g({uniforms:{u_colorMap:{type:Kg.SAMPLER_2D,value:o},u_minimumValue:{type:Kg.FLOAT,value:t[0]},u_maximumValue:{type:Kg.FLOAT,value:n[0]}},fragmentShaderText:`void fragmentMain(FragmentInput fsInput, inout czm_modelMaterial material) { float value = fsInput.metadata.${e}; vec3 voxelNormal = fsInput.attributes.normalEC; @@ -11282,7 +11282,7 @@ out_FragColor = vec4(czm_XYZToRGB(xyz), 1.0); material.diffuse = texture(u_colorMap, vec2(lerp, 0.5)).rgb * lighting; material.alpha = 1.0; } - }`})}var lM=GBt;function KBt(e,t){let{shaderBuilder:n}=e,{names:i,types:r,componentTypes:o,minimumValues:s,maximumValues:a}=t._provider,c=r.length,u=l(s)&&l(a);n.addDefine("METADATA_COUNT",c,de.FRAGMENT),u&&n.addDefine("STATISTICS",void 0,de.FRAGMENT);for(let _=0;_<c;_++){let C=i[_],w=e9(r[_]),D=`PropertyStatistics_${C}`,N=`PropertyStatistics_${C}`;n.addStruct(D,N,de.FRAGMENT),n.addStructField(D,w,"min"),n.addStructField(D,w,"max")}let f="MetadataStatistics",d="MetadataStatistics",p="metadataStatistics";n.addStruct(f,d,de.FRAGMENT);for(let _=0;_<c;_++){let C=i[_],w=`PropertyStatistics_${C}`,D=C;n.addStructField(f,w,D)}let g="Metadata",m="Metadata",y="metadata";n.addStruct(g,m,de.FRAGMENT);for(let _=0;_<c;_++){let C=e9(r[_]);n.addStructField(g,C,i[_])}let A="Attributes",b="Attributes",x="attributes";n.addStruct(A,b,de.FRAGMENT),n.addStructField(A,"vec3","positionEC"),n.addStructField(A,"vec3","normalEC");let T="Voxel",E="Voxel",v="voxel";n.addStruct(T,E,de.FRAGMENT),n.addStructField(T,"vec3","viewDirUv"),n.addStructField(T,"float","travelDistance"),n.addStructField(T,"int","stepCount"),n.addStructField(T,"int","tileIndex"),n.addStructField(T,"int","sampleIndex"),n.addStructField(T,"float","distanceToDepthBuffer");let S="FragmentInput";n.addStruct(S,"FragmentInput",de.FRAGMENT),n.addStructField(S,d,p),n.addStructField(S,m,y),n.addStructField(S,b,x),n.addStructField(S,E,v);let R="Properties",O="Properties",L="properties";n.addStruct(R,O,de.FRAGMENT);for(let _=0;_<c;_++){let C=e9(r[_]);n.addStructField(R,C,i[_])}{let _="clearProperties";n.addFunction(_,`${O} clearProperties()`,de.FRAGMENT),n.addFunctionLines(_,[`${O} ${L};`]);for(let C=0;C<c;C++){let w=e9(r[C],o[C]);n.addFunctionLines(_,[`${L}.${i[C]} = ${w}(0.0);`])}n.addFunctionLines(_,[`return ${L};`])}{let _="sumProperties";n.addFunction(_,`${O} sumProperties(${O} propertiesA, ${O} propertiesB)`,de.FRAGMENT),n.addFunctionLines(_,[`${O} ${L};`]);for(let C=0;C<c;C++){let w=i[C];n.addFunctionLines(_,[`${L}.${w} = propertiesA.${w} + propertiesB.${w};`])}n.addFunctionLines(_,[`return ${L};`])}{let _="scaleProperties";n.addFunction(_,`${O} scaleProperties(${O} ${L}, float scale)`,de.FRAGMENT),n.addFunctionLines(_,[`${O} scaledProperties = ${L};`]);for(let C=0;C<c;C++)n.addFunctionLines(_,[`scaledProperties.${i[C]} *= scale;`]);n.addFunctionLines(_,["return scaledProperties;"])}{let _="mixProperties";n.addFunction(_,`${O} mixProperties(${O} propertiesA, ${O} propertiesB, float mixFactor)`,de.FRAGMENT),n.addFunctionLines(_,[`${O} ${L};`]);for(let C=0;C<c;C++){let w=i[C];n.addFunctionLines(_,[`${L}.${w} = mix(propertiesA.${w}, propertiesB.${w}, mixFactor);`])}n.addFunctionLines(_,[`return ${L};`])}{let _="copyPropertiesToMetadata";n.addFunction(_,`void copyPropertiesToMetadata(in ${O} ${L}, inout ${m} ${y})`,de.FRAGMENT);for(let C=0;C<c;C++){let w=i[C];n.addFunctionLines(_,[`${y}.${w} = ${L}.${w};`])}}if(u){let _="setStatistics";n.addFunction(_,`void setStatistics(inout ${d} ${p})`,de.FRAGMENT);for(let C=0;C<c;C++){let w=i[C],D=r[C],N=bt.getComponentCount(D);for(let F=0;F<N;F++){let V=JBt(D,F),B=s[C][F],j=a[C][F];!l(B)||!l(j)||n.addFunctionLines(_,[`${p}.${w}.min${V} = ${ENe(B)};`,`${p}.${w}.max${V} = ${ENe(j)};`])}}}{let _="getPropertiesFromMegatextureAtUv";n.addFunction(_,`${O} getPropertiesFromMegatextureAtUv(vec3 texcoord)`,de.FRAGMENT),n.addFunctionLines(_,[`${O} ${L};`]);for(let C=0;C<c;C++){let w=r[C],D=o[C],N=$Bt(w,D);n.addFunctionLines(_,[`properties.${i[C]} = texture(u_megatextureTextures[${C}], texcoord)${N};`])}n.addFunctionLines(_,[`return ${L};`])}}function e9(e){if(e===bt.SCALAR)return"float";if(e===bt.VEC2)return"vec2";if(e===bt.VEC3)return"vec3";if(e===bt.VEC4)return"vec4"}function $Bt(e){if(e===bt.SCALAR)return".r";if(e===bt.VEC2)return".ra";if(e===bt.VEC3)return".rgb";if(e===bt.VEC4)return""}function ENe(e){let t=e.toString();return t.indexOf(".")===-1&&(t=`${e}.0`),t}function JBt(e,t){return e===bt.SCALAR?"":`[${t}]`}var t9=KBt;function Em(e){let{planes:t,modelMatrix:n=M.IDENTITY,unionClippingRegions:i=!1}=e??H.EMPTY_OBJECT;if(this._planes=[],this.modelMatrix=M.clone(n),this.planeAdded=new be,this.planeRemoved=new be,this._unionClippingRegions=i,this._testIntersection=i?CNe:vNe,this._float32View=void 0,this._clippingPlanesTexture=void 0,l(t))for(let r=0;r<t.length;++r)this.add(t[r])}function CNe(e){return e===$t.OUTSIDE}function vNe(e){return e===$t.INSIDE}Object.defineProperties(Em.prototype,{length:{get:function(){return this._planes.length}},unionClippingRegions:{get:function(){return this._unionClippingRegions},set:function(e){this._unionClippingRegions!==e&&(this._unionClippingRegions=e,this._testIntersection=e?CNe:vNe)}},texture:{get:function(){return this._clippingPlanesTexture}},clippingPlanesState:{get:function(){return this._unionClippingRegions?this._planes.length:-this._planes.length}}});Em.prototype.add=function(e){let t=this._planes.length;e.index=t,this._planes.push(e),this.planeAdded.raiseEvent(e,t)};Em.prototype.get=function(e){return this._planes[e]};function SNe(e,t){for(let n=0;n<e.length;++n)if(sn.equals(e[n],t))return n;return-1}Em.prototype.contains=function(e){return SNe(this._planes,e)!==-1};Em.prototype.remove=function(e){let t=this._planes,n=SNe(t,e);if(n===-1)return!1;e instanceof fa&&(e.onChangeCallback=void 0,e.index=-1);let i=t.length-1;for(let r=n;r<i;++r){let o=t[r+1];t[r]=o,o instanceof fa&&(o.index=r)}return t.length=i,this.planeRemoved.raiseEvent(e,n),!0};Em.prototype.removeAll=function(){let e=this._planes;for(let t=0;t<e.length;++t){let n=e[t];n instanceof fa&&(n.onChangeCallback=void 0,n.index=-1),this.planeRemoved.raiseEvent(n,t)}this._planes=[]};var ZBt=new sn(h.fromElements(1,0,0),0);function QBt(e,t){let n=e._float32View,i=e._planes,r=0;for(let o=0;o<i.length;++o){let{normal:s,distance:a}=t2t(i[o],t,ZBt);n[r]=s.x,n[r+1]=s.y,n[r+2]=s.z,n[r+3]=a,r+=4}}var Goe=new se,e2t=new h;function t2t(e,t,n){let{normal:i,distance:r}=e,o=se.fromElements(i.x,i.y,i.z,r,Goe),s=M.multiplyByVector(t,o,Goe),a=h.fromCartesian4(s,e2t);return s=se.divideByScalar(s,h.magnitude(a),Goe),sn.fromCartesian4(s,n)}function wNe(e,t){return t.x=Math.min(e,Ut.maximumTextureSize),t.y=Math.ceil(e/t.x),t}var n2t=new U;Em.prototype.update=function(e,t){let n=this._clippingPlanesTexture,i=this.length;if(l(n)){let s=n.width*n.height;(s<i||i<.25*s)&&(n.destroy(),n=void 0,this._clippingPlanesTexture=void 0)}if(this.length===0)return;if(!l(n)){let s=wNe(i,n2t);s.y*=2,n=new Dt({context:e.context,width:s.x,height:s.y,pixelFormat:$e.RGBA,pixelDatatype:ze.FLOAT,sampler:Ht.NEAREST,flipY:!1}),this._float32View=new Float32Array(s.x*s.y*4),this._clippingPlanesTexture=n}let{width:r,height:o}=n;QBt(this,t),n.copyFrom({source:{width:r,height:o,arrayBufferView:this._float32View}})};Em.getTextureResolution=function(e,t,n){let i=e.texture;if(l(i))return n.x=i.width,n.y=i.height,n;let r=e.length,o=wNe(r,n);return o.y*=2,o};Em.prototype.isDestroyed=function(){return!1};Em.prototype.destroy=function(){return this._clippingPlanesTexture=this._clippingPlanesTexture&&this._clippingPlanesTexture.destroy(),le(this)};var XA=Em;var n9=`struct Ray { + }`})}var tO=f1t;function g1t(e,t){let{shaderBuilder:n}=e,{names:i,types:r,componentTypes:o,minimumValues:s,maximumValues:a}=t._provider,c=r.length,u=l(s)&&l(a);n.addDefine("METADATA_COUNT",c,de.FRAGMENT),u&&n.addDefine("STATISTICS",void 0,de.FRAGMENT);for(let _=0;_<c;_++){let C=i[_],w=zH(r[_]),D=`PropertyStatistics_${C}`,N=`PropertyStatistics_${C}`;n.addStruct(D,N,de.FRAGMENT),n.addStructField(D,w,"min"),n.addStructField(D,w,"max")}let f="MetadataStatistics",d="MetadataStatistics",p="metadataStatistics";n.addStruct(f,d,de.FRAGMENT);for(let _=0;_<c;_++){let C=i[_],w=`PropertyStatistics_${C}`,D=C;n.addStructField(f,w,D)}let g="Metadata",m="Metadata",y="metadata";n.addStruct(g,m,de.FRAGMENT);for(let _=0;_<c;_++){let C=zH(r[_]);n.addStructField(g,C,i[_])}let A="Attributes",b="Attributes",x="attributes";n.addStruct(A,b,de.FRAGMENT),n.addStructField(A,"vec3","positionEC"),n.addStructField(A,"vec3","normalEC");let T="Voxel",E="Voxel",v="voxel";n.addStruct(T,E,de.FRAGMENT),n.addStructField(T,"vec3","viewDirUv"),n.addStructField(T,"float","travelDistance"),n.addStructField(T,"int","stepCount"),n.addStructField(T,"int","tileIndex"),n.addStructField(T,"int","sampleIndex"),n.addStructField(T,"float","distanceToDepthBuffer");let S="FragmentInput";n.addStruct(S,"FragmentInput",de.FRAGMENT),n.addStructField(S,d,p),n.addStructField(S,m,y),n.addStructField(S,b,x),n.addStructField(S,E,v);let R="Properties",O="Properties",L="properties";n.addStruct(R,O,de.FRAGMENT);for(let _=0;_<c;_++){let C=zH(r[_]);n.addStructField(R,C,i[_])}{let _="clearProperties";n.addFunction(_,`${O} clearProperties()`,de.FRAGMENT),n.addFunctionLines(_,[`${O} ${L};`]);for(let C=0;C<c;C++){let w=zH(r[C],o[C]);n.addFunctionLines(_,[`${L}.${i[C]} = ${w}(0.0);`])}n.addFunctionLines(_,[`return ${L};`])}{let _="sumProperties";n.addFunction(_,`${O} sumProperties(${O} propertiesA, ${O} propertiesB)`,de.FRAGMENT),n.addFunctionLines(_,[`${O} ${L};`]);for(let C=0;C<c;C++){let w=i[C];n.addFunctionLines(_,[`${L}.${w} = propertiesA.${w} + propertiesB.${w};`])}n.addFunctionLines(_,[`return ${L};`])}{let _="scaleProperties";n.addFunction(_,`${O} scaleProperties(${O} ${L}, float scale)`,de.FRAGMENT),n.addFunctionLines(_,[`${O} scaledProperties = ${L};`]);for(let C=0;C<c;C++)n.addFunctionLines(_,[`scaledProperties.${i[C]} *= scale;`]);n.addFunctionLines(_,["return scaledProperties;"])}{let _="mixProperties";n.addFunction(_,`${O} mixProperties(${O} propertiesA, ${O} propertiesB, float mixFactor)`,de.FRAGMENT),n.addFunctionLines(_,[`${O} ${L};`]);for(let C=0;C<c;C++){let w=i[C];n.addFunctionLines(_,[`${L}.${w} = mix(propertiesA.${w}, propertiesB.${w}, mixFactor);`])}n.addFunctionLines(_,[`return ${L};`])}{let _="copyPropertiesToMetadata";n.addFunction(_,`void copyPropertiesToMetadata(in ${O} ${L}, inout ${m} ${y})`,de.FRAGMENT);for(let C=0;C<c;C++){let w=i[C];n.addFunctionLines(_,[`${y}.${w} = ${L}.${w};`])}}if(u){let _="setStatistics";n.addFunction(_,`void setStatistics(inout ${d} ${p})`,de.FRAGMENT);for(let C=0;C<c;C++){let w=i[C],D=r[C],N=bt.getComponentCount(D);for(let F=0;F<N;F++){let V=y1t(D,F),B=s[C][F],j=a[C][F];!l(B)||!l(j)||n.addFunctionLines(_,[`${p}.${w}.min${V} = ${wPe(B)};`,`${p}.${w}.max${V} = ${wPe(j)};`])}}}{let _="getPropertiesFromMegatextureAtUv";n.addFunction(_,`${O} getPropertiesFromMegatextureAtUv(vec3 texcoord)`,de.FRAGMENT),n.addFunctionLines(_,[`${O} ${L};`]);for(let C=0;C<c;C++){let w=r[C],D=o[C],N=_1t(w,D);n.addFunctionLines(_,[`properties.${i[C]} = texture(u_megatextureTextures[${C}], texcoord)${N};`])}n.addFunctionLines(_,[`return ${L};`])}}function zH(e){if(e===bt.SCALAR)return"float";if(e===bt.VEC2)return"vec2";if(e===bt.VEC3)return"vec3";if(e===bt.VEC4)return"vec4"}function _1t(e){if(e===bt.SCALAR)return".r";if(e===bt.VEC2)return".ra";if(e===bt.VEC3)return".rgb";if(e===bt.VEC4)return""}function wPe(e){let t=e.toString();return t.indexOf(".")===-1&&(t=`${e}.0`),t}function y1t(e,t){return e===bt.SCALAR?"":`[${t}]`}var VH=g1t;function hm(e){let{planes:t,modelMatrix:n=M.IDENTITY,unionClippingRegions:i=!1}=e??H.EMPTY_OBJECT;if(this._planes=[],this.modelMatrix=M.clone(n),this.planeAdded=new be,this.planeRemoved=new be,this._unionClippingRegions=i,this._testIntersection=i?IPe:PPe,this._float32View=void 0,this._clippingPlanesTexture=void 0,l(t))for(let r=0;r<t.length;++r)this.add(t[r])}function IPe(e){return e===$t.OUTSIDE}function PPe(e){return e===$t.INSIDE}Object.defineProperties(hm.prototype,{length:{get:function(){return this._planes.length}},unionClippingRegions:{get:function(){return this._unionClippingRegions},set:function(e){this._unionClippingRegions!==e&&(this._unionClippingRegions=e,this._testIntersection=e?IPe:PPe)}},texture:{get:function(){return this._clippingPlanesTexture}},clippingPlanesState:{get:function(){return this._unionClippingRegions?this._planes.length:-this._planes.length}}});hm.prototype.add=function(e){let t=this._planes.length;e.index=t,this._planes.push(e),this.planeAdded.raiseEvent(e,t)};hm.prototype.get=function(e){return this._planes[e]};function DPe(e,t){for(let n=0;n<e.length;++n)if(sn.equals(e[n],t))return n;return-1}hm.prototype.contains=function(e){return DPe(this._planes,e)!==-1};hm.prototype.remove=function(e){let t=this._planes,n=DPe(t,e);if(n===-1)return!1;e instanceof fa&&(e.onChangeCallback=void 0,e.index=-1);let i=t.length-1;for(let r=n;r<i;++r){let o=t[r+1];t[r]=o,o instanceof fa&&(o.index=r)}return t.length=i,this.planeRemoved.raiseEvent(e,n),!0};hm.prototype.removeAll=function(){let e=this._planes;for(let t=0;t<e.length;++t){let n=e[t];n instanceof fa&&(n.onChangeCallback=void 0,n.index=-1),this.planeRemoved.raiseEvent(n,t)}this._planes=[]};var A1t=new sn(h.fromElements(1,0,0),0);function b1t(e,t){let n=e._float32View,i=e._planes,r=0;for(let o=0;o<i.length;++o){let{normal:s,distance:a}=T1t(i[o],t,A1t);n[r]=s.x,n[r+1]=s.y,n[r+2]=s.z,n[r+3]=a,r+=4}}var Pne=new se,x1t=new h;function T1t(e,t,n){let{normal:i,distance:r}=e,o=se.fromElements(i.x,i.y,i.z,r,Pne),s=M.multiplyByVector(t,o,Pne),a=h.fromCartesian4(s,x1t);return s=se.divideByScalar(s,h.magnitude(a),Pne),sn.fromCartesian4(s,n)}function RPe(e,t){return t.x=Math.min(e,Ut.maximumTextureSize),t.y=Math.ceil(e/t.x),t}var E1t=new U;hm.prototype.update=function(e,t){let n=this._clippingPlanesTexture,i=this.length;if(l(n)){let s=n.width*n.height;(s<i||i<.25*s)&&(n.destroy(),n=void 0,this._clippingPlanesTexture=void 0)}if(this.length===0)return;if(!l(n)){let s=RPe(i,E1t);s.y*=2,n=new Dt({context:e.context,width:s.x,height:s.y,pixelFormat:$e.RGBA,pixelDatatype:ze.FLOAT,sampler:Ht.NEAREST,flipY:!1}),this._float32View=new Float32Array(s.x*s.y*4),this._clippingPlanesTexture=n}let{width:r,height:o}=n;b1t(this,t),n.copyFrom({source:{width:r,height:o,arrayBufferView:this._float32View}})};hm.getTextureResolution=function(e,t,n){let i=e.texture;if(l(i))return n.x=i.width,n.y=i.height,n;let r=e.length,o=RPe(r,n);return o.y*=2,o};hm.prototype.isDestroyed=function(){return!1};hm.prototype.destroy=function(){return this._clippingPlanesTexture=this._clippingPlanesTexture&&this._clippingPlanesTexture.destroy(),le(this)};var vA=hm;var jH=`struct Ray { vec3 pos; vec3 dir; }; @@ -11292,7 +11292,7 @@ return min(min(v.x, v.y), v.z); float maxComponent(in vec3 v) { return max(max(v.x, v.y), v.z); } -`;var i9=`#define STEP_COUNT_MAX 1000 // Harcoded value because GLSL doesn't like variable length loops +`;var HH=`#define STEP_COUNT_MAX 1000 // Harcoded value because GLSL doesn't like variable length loops #if defined(PICKING_VOXEL) #define ALPHA_ACCUM_MAX 0.1 #else @@ -11474,7 +11474,7 @@ out_FragColor = vec4(megatextureId, sampleIndex); out_FragColor = colorAccum; #endif } -`;var r9=`in vec2 position; +`;var GH=`in vec2 position; uniform vec4 u_ndcSpaceAxisAlignedBoundingBox; void main() { vec2 aabbMin = u_ndcSpaceAxisAlignedBoundingBox.xy; @@ -11483,7 +11483,7 @@ vec2 translation = 0.5 * (aabbMax + aabbMin); vec2 scale = 0.5 * (aabbMax - aabbMin); gl_Position = vec4(position * scale + translation, 0.0, 1.0); } -`;var o9=`#define NO_HIT (-czm_infinity) +`;var WH=`#define NO_HIT (-czm_infinity) #define INF_HIT (czm_infinity * 0.5) struct RayShapeIntersection { vec4 entry; @@ -11591,7 +11591,7 @@ break; return shapeIntersection; } #endif -`;var s9=`void intersectDepth(in vec2 screenCoord, in Ray ray, inout Intersections ix) { +`;var qH=`void intersectDepth(in vec2 screenCoord, in Ray ray, inout Intersections ix) { float logDepthOrDepth = czm_unpackDepth(texture(czm_globeDepthTexture, screenCoord)); float entry; float exit; @@ -11609,7 +11609,7 @@ ix.distanceToDepthBuffer = entry; setIntersectionPair(ix, DEPTH_INTERSECTION_INDEX, vec2(entry, exit)); #endif } -`;var a9=`uniform sampler2D u_clippingPlanesTexture; +`;var YH=`uniform sampler2D u_clippingPlanesTexture; uniform mat4 u_clippingPlanesMatrix; vec4 intersectPlane(in Ray ray, in vec4 plane) { vec3 n = plane.xyz; @@ -11672,7 +11672,7 @@ setShapeIntersection(ix, CLIPPING_PLANES_INTERSECTION_INDEX, clippingVolume); #endif } #endif -`;var uM=`vec4 transformNormalToEC(in vec4 intersection) { +`;var nO=`vec4 transformNormalToEC(in vec4 intersection) { return vec4(normalize(czm_normal * intersection.xyz), intersection.w); } RayShapeIntersection transformNormalsToEC(in RayShapeIntersection ix) { @@ -11756,7 +11756,7 @@ return transformNormalsToEC(RayShapeIntersection(last, farSide)); return transformNormalsToEC(RayShapeIntersection(miss, miss)); } } -`;var c9=`uniform sampler2D u_renderBoundPlanesTexture; +`;var XH=`uniform sampler2D u_renderBoundPlanesTexture; RayShapeIntersection intersectBoundPlanes(in Ray ray) { vec4 lastEntry = vec4(ray.dir, -INF_HIT); vec4 firstExit = vec4(-ray.dir, +INF_HIT); @@ -11780,7 +11780,7 @@ void intersectShape(in Ray rayUV, in Ray rayEC, inout Intersections ix) RayShapeIntersection intersection = intersectBoundPlanes(rayEC); setShapeIntersection(ix, BOX_INTERSECTION_INDEX, intersection); } -`;var l9=`uniform vec2 u_cylinderRenderRadiusMinMax; +`;var KH=`uniform vec2 u_cylinderRenderRadiusMinMax; #if defined(CYLINDER_HAS_RENDER_BOUNDS_ANGLE) uniform vec2 u_cylinderRenderAngleMinMax; #endif @@ -11863,7 +11863,7 @@ setShapeIntersection(ix, CYLINDER_INTERSECTION_INDEX_ANGLE + 0, wedgeIntersects[ setShapeIntersection(ix, CYLINDER_INTERSECTION_INDEX_ANGLE + 1, wedgeIntersects[1]); #endif } -`;var u9=`#if defined(ELLIPSOID_HAS_RENDER_BOUNDS_LONGITUDE) +`;var $H=`#if defined(ELLIPSOID_HAS_RENDER_BOUNDS_LONGITUDE) uniform vec2 u_ellipsoidRenderLongitudeMinMax; #endif uniform float u_eccentricitySquared; @@ -12064,7 +12064,7 @@ setShapeIntersection(ix, ELLIPSOID_INTERSECTION_INDEX_LONGITUDE + 0, wedgeInters setShapeIntersection(ix, ELLIPSOID_INTERSECTION_INDEX_LONGITUDE + 1, wedgeIntersects[1]); #endif } -`;var tI=`RayShapeIntersection intersectScene(in vec2 screenCoord, in Ray ray, in Ray rayEC, out Intersections ix) { +`;var lw=`RayShapeIntersection intersectScene(in vec2 screenCoord, in Ray ray, in Ray rayEC, out Intersections ix) { intersectShape(ray, rayEC, ix); RayShapeIntersection intersection = getFirstIntersection(ix); if (intersection.entry.w == NO_HIT) { @@ -12088,7 +12088,7 @@ intersection.entry.w = max(intersection.entry.w, 0.0); #endif return intersection; } -`;var f9=`uniform vec3 u_boxLocalToShapeUvScale; +`;var JH=`uniform vec3 u_boxLocalToShapeUvScale; uniform ivec4 u_cameraTileCoordinates; uniform vec3 u_cameraTileUv; uniform mat3 u_boxEcToXyz; @@ -12111,7 +12111,7 @@ ivec3 tileCoordinateChange = tileCoordinate - u_cameraTileCoordinates.xyz; vec3 tileUv = clamp(tileUvSum - vec3(tileCoordinateChange), 0.0, 1.0); return TileAndUvCoordinate(ivec4(tileCoordinate, u_cameraTileCoordinates.w), tileUv); } -`;var d9=`uniform vec3 u_cylinderLocalToShapeUvScale; +`;var ZH=`uniform vec3 u_cylinderLocalToShapeUvScale; uniform float u_cylinderShapeUvAngleRangeOrigin; uniform mat3 u_cylinderEcToRadialTangentUp; uniform ivec4 u_cameraTileCoordinates; @@ -12185,7 +12185,7 @@ tileUv.y = clamp(tileUv.y, 0.0, 1.0); tileUv.z = clamp(tileUv.z, 0.0, 1.0); return TileAndUvCoordinate(ivec4(tileCoordinate, u_cameraTileCoordinates.w), tileUv); } -`;var h9=`uniform vec3 u_cameraPositionCartographic; +`;var QH=`uniform vec3 u_cameraPositionCartographic; uniform vec2 u_ellipsoidCurvatureAtLatitude; uniform mat3 u_ellipsoidEcToEastNorthUp; uniform vec3 u_ellipsoidRadii; @@ -12304,7 +12304,7 @@ tileUv.y = clamp(tileUv.y, 0.0, 1.0); tileUv.z = clamp(tileUv.z, 0.0, 1.0); return TileAndUvCoordinate(ivec4(tileCoordinate, u_cameraTileCoordinates.w), tileUv); } -`;var m9=`#define OCTREE_FLAG_INTERNAL 0 +`;var eG=`#define OCTREE_FLAG_INTERNAL 0 #define OCTREE_FLAG_LEAF 1 #define OCTREE_FLAG_PACKED_LEAF_FROM_PARENT 2 #define OCTREE_MAX_LEVELS 32 // Harcoded value because GLSL doesn't like variable length loops @@ -12505,7 +12505,7 @@ addSampleCoordinates(tileAndUv, sampleDatas[0]); addSampleCoordinates(tileAndUv, sampleDatas[1]); #endif } -`;var p9=`uniform ivec3 u_megatextureTileCounts; +`;var tG=`uniform ivec3 u_megatextureTileCounts; vec3 index1DTo3DTexCoord(int index) { int tilesPerZ = u_megatextureTileCounts.x * u_megatextureTileCounts.y; @@ -12540,19 +12540,19 @@ properties = sumProperties(properties, tempProperties); return properties; #endif } -`;var INe={Z_UP:0,Y_UP:1};Object.freeze(INe);var f_=INe;function i2t(e){let t=new F_;this.shaderBuilder=t;let n=e._customShader,i=Mt(e._uniformMap,n.uniformMap);e._uniformMap=i;let r=n.uniforms;for(let m in r)if(r.hasOwnProperty(m)){let y=r[m];t.addUniform(y.type,m,de.FRAGMENT)}t.addUniform("sampler3D","u_megatextureTextures[METADATA_COUNT]",de.FRAGMENT),this.uniformMap=i;let o=e._clippingPlanes,s=l(o)&&o.enabled?o.length:0;this.clippingPlanes=o,this.clippingPlanesLength=s;let a=e._shape.renderBoundPlanes,c=a?.length??0;this.renderBoundPlanes=a,this.renderBoundPlanesLength=c,t.addVertexLines([r9]),e.provider.metadataOrder===f_.Y_UP&&t.addDefine("Y_UP_METADATA_ORDER",void 0,de.FRAGMENT);let u=e._provider.shape;u==="BOX"?t.addDefine("SHAPE_BOX",void 0,de.FRAGMENT):u==="CYLINDER"?t.addDefine("SHAPE_CYLINDER",void 0,de.FRAGMENT):u==="ELLIPSOID"&&t.addDefine("SHAPE_ELLIPSOID",void 0,de.FRAGMENT),t.addFragmentLines([n.fragmentShaderText,"#line 0",m9,n9,p9,o9,a9,s9]),s>0&&(t.addDefine("CLIPPING_PLANES",void 0,de.FRAGMENT),t.addDefine("CLIPPING_PLANES_COUNT",s,de.FRAGMENT),o.unionClippingRegions&&t.addDefine("CLIPPING_PLANES_UNION",void 0,de.FRAGMENT)),e._depthTest&&t.addDefine("DEPTH_TEST",void 0,de.FRAGMENT),u==="BOX"?t.addFragmentLines([f9,c9,tI]):u==="CYLINDER"?t.addFragmentLines([d9,uM,l9,tI]):u==="ELLIPSOID"&&t.addFragmentLines([h9,uM,u9,tI]),t.addFragmentLines([i9]);let f=e._shape,d=f.shaderDefines;for(let m in d)if(d.hasOwnProperty(m)){let y=d[m];l(y)&&(y=y===!0?void 0:y,t.addDefine(m,y,de.FRAGMENT))}let p=f.shaderMaximumIntersectionsLength;s>0&&(t.addDefine("CLIPPING_PLANES_INTERSECTION_INDEX",p,de.FRAGMENT),s===1?p+=1:o.unionClippingRegions?p+=2:p+=1),e._depthTest&&(t.addDefine("DEPTH_INTERSECTION_INDEX",p,de.FRAGMENT),p+=1),t.addDefine("INTERSECTION_COUNT",p,de.FRAGMENT),(!h.equals(e.paddingBefore,h.ZERO)||!h.equals(e.paddingAfter,h.ZERO))&&t.addDefine("PADDING",void 0,de.FRAGMENT),e._useLogDepth&&t.addDefine("LOG_DEPTH_READ_ONLY",void 0,de.FRAGMENT);let g=e._traversal;t.addDefine("SAMPLE_COUNT",`${g._sampleCount}`,de.FRAGMENT)}var g9=i2t;var PNe=new U;function r2t(e,t){let n=new g9(e);t9(n,e);let{shaderBuilder:i,clippingPlanes:r,clippingPlanesLength:o,renderBoundPlanes:s,renderBoundPlanesLength:a}=n;if(o>0){let T="getClippingPlane",E=`vec4 ${T}(highp sampler2D packedPlanes, int planeNumber)`,v=Ps.getTextureResolution(r,t,PNe),S=DNe(v);i.addFunction(T,E,de.FRAGMENT),i.addFunctionLines(T,[S])}if(a>0){let T="getBoundPlane",E=`vec4 ${T}(highp sampler2D packedPlanes, int planeNumber)`,v=XA.getTextureResolution(s,t,PNe),S=DNe(v);i.addFunction(T,E,de.FRAGMENT),i.addFunctionLines(T,[S])}let c=i.clone();c.addDefine("PICKING",void 0,de.FRAGMENT);let u=i.clone();u.addDefine("PICKING_VOXEL",void 0,de.FRAGMENT);let f=i.buildShaderProgram(t),d=c.buildShaderProgram(t),p=u.buildShaderProgram(t),g=Ge.fromCache({cull:{enabled:!0,face:Gi.BACK},depthTest:{enabled:!1},depthMask:!1,blending:nn.PRE_MULTIPLIED_ALPHA_BLEND}),m=t.getViewportQuadVertexArray(),y=e._depthTest,A=new at({vertexArray:m,primitiveType:Oe.TRIANGLES,renderState:g,shaderProgram:f,uniformMap:n.uniformMap,modelMatrix:e._compoundModelMatrix,pass:Ie.VOXELS,executeInClosestFrustum:!0,owner:this,cull:y,occlude:y}),b=at.shallowClone(A,new at);b.shaderProgram=d,b.pickOnly=!0;let x=at.shallowClone(A,new at);if(x.shaderProgram=p,x.pickOnly=!0,l(e._drawCommand)){let T=e._drawCommand;T.shaderProgram=T.shaderProgram&&T.shaderProgram.destroy()}if(l(e._drawCommandPick)){let T=e._drawCommandPick;T.shaderProgram=T.shaderProgram&&T.shaderProgram.destroy()}if(l(e._drawCommandPickVoxel)){let T=e._drawCommandPickVoxel;T.shaderProgram=T.shaderProgram&&T.shaderProgram.destroy()}e._drawCommand=A,e._drawCommandPick=b,e._drawCommandPickVoxel=x}function DNe(e){let t=e.x,n=e.y,i=1/t,r=1/n,o=`${i}`;o.indexOf(".")===-1&&(o+=".0");let s=`${r}`;return s.indexOf(".")===-1&&(s+=".0"),`int pixY = planeNumber / ${t}; +`;var OPe={Z_UP:0,Y_UP:1};Object.freeze(OPe);var Jg=OPe;function C1t(e){let t=new F_;this.shaderBuilder=t;let n=e._customShader,i=Mt(e._uniformMap,n.uniformMap);e._uniformMap=i;let r=n.uniforms;for(let m in r)if(r.hasOwnProperty(m)){let y=r[m];t.addUniform(y.type,m,de.FRAGMENT)}t.addUniform("sampler3D","u_megatextureTextures[METADATA_COUNT]",de.FRAGMENT),this.uniformMap=i;let o=e._clippingPlanes,s=l(o)&&o.enabled?o.length:0;this.clippingPlanes=o,this.clippingPlanesLength=s;let a=e._shape.renderBoundPlanes,c=a?.length??0;this.renderBoundPlanes=a,this.renderBoundPlanesLength=c,t.addVertexLines([GH]),e.provider.metadataOrder===Jg.Y_UP&&t.addDefine("Y_UP_METADATA_ORDER",void 0,de.FRAGMENT);let u=e._provider.shape;u==="BOX"?t.addDefine("SHAPE_BOX",void 0,de.FRAGMENT):u==="CYLINDER"?t.addDefine("SHAPE_CYLINDER",void 0,de.FRAGMENT):u==="ELLIPSOID"&&t.addDefine("SHAPE_ELLIPSOID",void 0,de.FRAGMENT),t.addFragmentLines([n.fragmentShaderText,"#line 0",eG,jH,tG,WH,YH,qH]),s>0&&(t.addDefine("CLIPPING_PLANES",void 0,de.FRAGMENT),t.addDefine("CLIPPING_PLANES_COUNT",s,de.FRAGMENT),o.unionClippingRegions&&t.addDefine("CLIPPING_PLANES_UNION",void 0,de.FRAGMENT)),e._depthTest&&t.addDefine("DEPTH_TEST",void 0,de.FRAGMENT),u==="BOX"?t.addFragmentLines([JH,XH,lw]):u==="CYLINDER"?t.addFragmentLines([ZH,nO,KH,lw]):u==="ELLIPSOID"&&t.addFragmentLines([QH,nO,$H,lw]),t.addFragmentLines([HH]);let f=e._shape,d=f.shaderDefines;for(let m in d)if(d.hasOwnProperty(m)){let y=d[m];l(y)&&(y=y===!0?void 0:y,t.addDefine(m,y,de.FRAGMENT))}let p=f.shaderMaximumIntersectionsLength;s>0&&(t.addDefine("CLIPPING_PLANES_INTERSECTION_INDEX",p,de.FRAGMENT),s===1?p+=1:o.unionClippingRegions?p+=2:p+=1),e._depthTest&&(t.addDefine("DEPTH_INTERSECTION_INDEX",p,de.FRAGMENT),p+=1),t.addDefine("INTERSECTION_COUNT",p,de.FRAGMENT),(!h.equals(e.paddingBefore,h.ZERO)||!h.equals(e.paddingAfter,h.ZERO))&&t.addDefine("PADDING",void 0,de.FRAGMENT),e._useLogDepth&&t.addDefine("LOG_DEPTH_READ_ONLY",void 0,de.FRAGMENT);let g=e._traversal;t.addDefine("SAMPLE_COUNT",`${g._sampleCount}`,de.FRAGMENT)}var nG=C1t;var MPe=new U;function v1t(e,t){let n=new nG(e);VH(n,e);let{shaderBuilder:i,clippingPlanes:r,clippingPlanesLength:o,renderBoundPlanes:s,renderBoundPlanesLength:a}=n;if(o>0){let T="getClippingPlane",E=`vec4 ${T}(highp sampler2D packedPlanes, int planeNumber)`,v=Ds.getTextureResolution(r,t,MPe),S=NPe(v);i.addFunction(T,E,de.FRAGMENT),i.addFunctionLines(T,[S])}if(a>0){let T="getBoundPlane",E=`vec4 ${T}(highp sampler2D packedPlanes, int planeNumber)`,v=vA.getTextureResolution(s,t,MPe),S=NPe(v);i.addFunction(T,E,de.FRAGMENT),i.addFunctionLines(T,[S])}let c=i.clone();c.addDefine("PICKING",void 0,de.FRAGMENT);let u=i.clone();u.addDefine("PICKING_VOXEL",void 0,de.FRAGMENT);let f=i.buildShaderProgram(t),d=c.buildShaderProgram(t),p=u.buildShaderProgram(t),g=Ge.fromCache({cull:{enabled:!0,face:Hi.BACK},depthTest:{enabled:!1},depthMask:!1,blending:nn.PRE_MULTIPLIED_ALPHA_BLEND}),m=t.getViewportQuadVertexArray(),y=e._depthTest,A=new at({vertexArray:m,primitiveType:Oe.TRIANGLES,renderState:g,shaderProgram:f,uniformMap:n.uniformMap,modelMatrix:e._compoundModelMatrix,pass:Ie.VOXELS,executeInClosestFrustum:!0,owner:this,cull:y,occlude:y}),b=at.shallowClone(A,new at);b.shaderProgram=d,b.pickOnly=!0;let x=at.shallowClone(A,new at);if(x.shaderProgram=p,x.pickOnly=!0,l(e._drawCommand)){let T=e._drawCommand;T.shaderProgram=T.shaderProgram&&T.shaderProgram.destroy()}if(l(e._drawCommandPick)){let T=e._drawCommandPick;T.shaderProgram=T.shaderProgram&&T.shaderProgram.destroy()}if(l(e._drawCommandPickVoxel)){let T=e._drawCommandPickVoxel;T.shaderProgram=T.shaderProgram&&T.shaderProgram.destroy()}e._drawCommand=A,e._drawCommandPick=b,e._drawCommandPickVoxel=x}function NPe(e){let t=e.x,n=e.y,i=1/t,r=1/n,o=`${i}`;o.indexOf(".")===-1&&(o+=".0");let s=`${r}`;return s.indexOf(".")===-1&&(s+=".0"),`int pixY = planeNumber / ${t}; int pixX = planeNumber - (pixY * ${t}); // Sample from center of pixel float u = (float(pixX) + 0.5) * ${o}; float v = (float(pixY) + 0.5) * ${s}; - return texture(packedPlanes, vec2(u, v));`}var _9=r2t;function d_(e){let{loader:t,metadata:n}=e;this._loader=t,this._metadata=n,this._resourcesLoaded=!1,this._ready=!1}Object.defineProperties(d_.prototype,{ready:{get:function(){return this._ready}},metadata:{get:function(){return this._metadata}}});d_.fromMetadataArray=function(e){return new d_({metadata:e})};d_.fromGltf=async function(e){let t=new _d({gltfResource:e,releaseGltfJson:!1,loadAttributesAsTypedArray:!0});try{await t.load()}catch(n){throw t.destroy(),n}return new d_({loader:t})};d_.prototype.update=function(e,t){let n=this._loader;if(!this._ready){if(t.afterRender.push(()=>!0),!l(n)){this._ready=!0;return}if(this._resourcesLoaded){let{structuralMetadata:i,scene:r}=n.components,{attributes:o}=r.nodes[0].primitives[0];this._metadata=o2t(o,i,e),this._ready=!0;return}this._resourcesLoaded=n.process(t)}};function o2t(e,t,n){let{className:i,names:r,types:o,componentTypes:s}=n.provider,a=t.propertyAttributes.find(f=>f.class.id===i),{properties:c}=a,u=new Array(r.length);for(let f=0;f<e.length;f++){let d=c[r[f]].attribute,p=e.find(A=>A.name===d);if(!l(p))continue;let g=Ft.toComponentDatatype(s[f]),m=bt.getComponentCount(o[f]),y=p.count*m;u[f]=Y.createArrayBufferView(g,p.typedArray.buffer,p.typedArray.byteOffset+p.byteOffset,y)}return u}d_.prototype.isDestroyed=function(){return!1};d_.prototype.destroy=function(){return this._loader=this._loader&&this._loader.destroy(),le(this)};var nI=d_;function ml(){this._orientedBoundingBox=new en,this._boundingSphere=new ue,this._boundTransform=new M,this._shapeTransform=new M,this._minBounds=ml.DefaultMinBounds.clone(),this._maxBounds=ml.DefaultMaxBounds.clone(),this._renderMinBounds=ml.DefaultMinBounds.clone(),this._renderMaxBounds=ml.DefaultMaxBounds.clone();let{DefaultMinBounds:e,DefaultMaxBounds:t}=ml,n=[new fa(h.negate(h.UNIT_X,new h),e.x),new fa(h.negate(h.UNIT_Y,new h),e.y),new fa(h.negate(h.UNIT_Z,new h),e.z),new fa(h.UNIT_X,-t.x),new fa(h.UNIT_Y,-t.y),new fa(h.UNIT_Z,-t.z)];this._renderBoundPlanes=new XA({planes:n}),this._localToShapeUvTranslate=new h,this._shaderUniforms={boxEcToXyz:new $,boxLocalToShapeUvScale:new h},this._shaderDefines={BOX_INTERSECTION_INDEX:void 0},this._shaderMaximumIntersectionsLength=0}Object.defineProperties(ml.prototype,{orientedBoundingBox:{get:function(){return this._orientedBoundingBox}},renderBoundPlanes:{get:function(){return this._renderBoundPlanes}},boundingSphere:{get:function(){return this._boundingSphere}},boundTransform:{get:function(){return this._boundTransform}},shapeTransform:{get:function(){return this._shapeTransform}},shaderUniforms:{get:function(){return this._shaderUniforms}},shaderDefines:{get:function(){return this._shaderDefines}},shaderMaximumIntersectionsLength:{get:function(){return this._shaderMaximumIntersectionsLength}}});var s2t=new h,a2t=new h,c2t=new $,l2t=new h,u2t=new h;ml.prototype.update=function(e,t,n,i,r){i=i??t.clone(l2t),r=r??n.clone(u2t),t=h.clone(t,this._minBounds),n=h.clone(n,this._maxBounds);let o=h.clamp(t,i,r,this._renderMinBounds),s=h.clamp(n,i,r,this._renderMaxBounds),a=M.getScale(e,a2t);if(o.x>s.x||o.y>s.y||o.z>s.z||(o.x===s.x)+(o.y===s.y)+(o.z===s.z)>=2||a.x===0||a.y===0||a.z===0)return!1;let c=this._renderBoundPlanes;c.get(0).distance=o.x,c.get(1).distance=o.y,c.get(2).distance=o.z,c.get(3).distance=-s.x,c.get(4).distance=-s.y,c.get(5).distance=-s.z,this._shapeTransform=M.clone(e,this._shapeTransform),this._orientedBoundingBox=Yoe(o,s,this._shapeTransform,this._orientedBoundingBox),this._boundTransform=M.fromRotationTranslation(this._orientedBoundingBox.halfAxes,this._orientedBoundingBox.center,this._boundTransform),this._boundingSphere=ue.fromOrientedBoundingBox(this._orientedBoundingBox,this._boundingSphere);let u=this._shaderUniforms,f=this._shaderDefines;for(let y in f)f.hasOwnProperty(y)&&(f[y]=void 0);let d=0;f.BOX_INTERSECTION_INDEX=d,d+=1;let p=t,g=n,m=h.fromElements(Woe(p.x,g.x),Woe(p.y,g.y),Woe(p.z,g.z),u.boxLocalToShapeUvScale);return this._localToShapeUvTranslate=h.negate(h.multiplyComponents(m,p,this._localToShapeUvTranslate),this._localToShapeUvTranslate),this._shaderMaximumIntersectionsLength=d,!0};function Woe(e,t){return P.equalsEpsilon(e,t,P.EPSILON7)?1:1/(t-e)}var f2t=new M;ml.prototype.updateViewTransforms=function(e){let t=this._shaderUniforms,n=M.inverse(this._shapeTransform,f2t),i=M.getMatrix3(n,t.boxEcToXyz),r=e.context.uniformState.inverseViewRotation;$.multiply(i,r,t.boxEcToXyz)};ml.prototype.convertLocalToShapeUvSpace=function(e,t){let{boxLocalToShapeUvScale:n}=this._shaderUniforms,i=this._localToShapeUvTranslate;return h.add(h.multiplyComponents(e,n,t),i,t)};var y9=new h,qoe=new h;ml.prototype.computeOrientedBoundingBoxForTile=function(e,t,n,i,r){let o=this._minBounds,s=this._maxBounds,a=1/Math.pow(2,e),c=h.fromElements(P.lerp(o.x,s.x,a*t),P.lerp(o.y,s.y,a*n),P.lerp(o.z,s.z,a*i),y9),u=h.fromElements(P.lerp(o.x,s.x,a*(t+1)),P.lerp(o.y,s.y,a*(n+1)),P.lerp(o.z,s.z,a*(i+1)),qoe);return Yoe(c,u,this._shapeTransform,r)};var RNe=new h;ml.prototype.computeOrientedBoundingBoxForSample=function(e,t,n,i){let r=1/Math.pow(2,e.level),o=h.divideComponents(h.ONE,t,RNe),s=h.multiplyByScalar(o,r,RNe),a=h.multiplyByScalar(h.fromElements(e.x+n.x,e.y+n.y,e.z+n.z,y9),r,y9),c=h.add(a,s,qoe),u=this._minBounds,f=this._maxBounds,d=h.fromElements(P.lerp(u.x,f.x,a.x),P.lerp(u.y,f.y,a.y),P.lerp(u.z,f.z,a.z),y9),p=h.fromElements(P.lerp(u.x,f.x,c.x),P.lerp(u.y,f.y,c.y),P.lerp(u.z,f.z,c.z),qoe);return Yoe(d,p,this._shapeTransform,i)};ml.DefaultMinBounds=Object.freeze(new h(-1,-1,-1));ml.DefaultMaxBounds=Object.freeze(new h(1,1,1));var ONe=new h;function Yoe(e,t,n,i){let r=ml.DefaultMinBounds,o=ml.DefaultMaxBounds;if(h.equals(e,r)&&h.equals(t,o))i.center=M.getTranslation(n,i.center),i.halfAxes=M.getMatrix3(n,i.halfAxes);else{let a=M.getScale(n,ONe),c=h.midpoint(e,t,s2t);i.center=M.multiplyByPoint(n,c,i.center),a=h.fromElements(a.x*.5*(t.x-e.x),a.y*.5*(t.y-e.y),a.z*.5*(t.z-e.z),ONe);let u=M.getRotation(n,c2t);i.halfAxes=$.setScale(u,a,i.halfAxes)}return i}var iI=ml;function jf(){this._orientedBoundingBox=new en,this._boundingSphere=new ue,this._boundTransform=new M,this._shapeTransform=new M,this._minBounds=jf.DefaultMinBounds.clone(),this._maxBounds=jf.DefaultMaxBounds.clone();let{DefaultMinBounds:e,DefaultMaxBounds:t}=jf,n=[new fa(h.negate(h.UNIT_Z,new h),e.z),new fa(h.UNIT_Z,-t.z)];this._renderBoundPlanes=new XA({planes:n}),this._localToShapeUvTranslate=new h,this._shaderUniforms={cameraShapePosition:new h,cylinderEcToRadialTangentUp:new $,cylinderRenderRadiusMinMax:new U,cylinderRenderAngleMinMax:new U,cylinderLocalToShapeUvScale:new h,cylinderShapeUvAngleRangeOrigin:0},this._shaderDefines={CYLINDER_HAS_SHAPE_BOUNDS_ANGLE:void 0,CYLINDER_HAS_RENDER_BOUNDS_RADIUS_MIN:void 0,CYLINDER_HAS_RENDER_BOUNDS_RADIUS_FLAT:void 0,CYLINDER_HAS_RENDER_BOUNDS_ANGLE:void 0,CYLINDER_HAS_RENDER_BOUNDS_ANGLE_RANGE_EQUAL_ZERO:void 0,CYLINDER_HAS_RENDER_BOUNDS_ANGLE_RANGE_UNDER_HALF:void 0,CYLINDER_HAS_RENDER_BOUNDS_ANGLE_RANGE_OVER_HALF:void 0,CYLINDER_INTERSECTION_INDEX_RADIUS_MAX:void 0,CYLINDER_INTERSECTION_INDEX_RADIUS_MIN:void 0,CYLINDER_INTERSECTION_INDEX_ANGLE:void 0},this._shaderMaximumIntersectionsLength=0}Object.defineProperties(jf.prototype,{orientedBoundingBox:{get:function(){return this._orientedBoundingBox}},renderBoundPlanes:{get:function(){return this._renderBoundPlanes}},boundingSphere:{get:function(){return this._boundingSphere}},boundTransform:{get:function(){return this._boundTransform}},shapeTransform:{get:function(){return this._shapeTransform}},shaderUniforms:{get:function(){return this._shaderUniforms}},shaderDefines:{get:function(){return this._shaderDefines}},shaderMaximumIntersectionsLength:{get:function(){return this._shaderMaximumIntersectionsLength}}});var d2t=new h,h2t=new h,m2t=new h,p2t=new h,g2t=new h,_2t=new M,y2t=new h,MNe=new U;jf.prototype.update=function(e,t,n,i,r){i=i??t.clone(h2t),r=r??n.clone(m2t),t=h.clone(t,this._minBounds),n=h.clone(n,this._maxBounds);let{DefaultMinBounds:o,DefaultMaxBounds:s}=jf,a=s.y-o.y,c=.5*a,u=P.EPSILON10,f=P.EPSILON10;t.x=Math.max(0,t.x),n.x=Math.max(0,n.x),t.y=P.negativePiToPi(t.y),n.y=P.negativePiToPi(n.y),i.y=P.negativePiToPi(i.y),r.y=P.negativePiToPi(r.y);let d=h.maximumByComponent(t,i,p2t),p=h.minimumByComponent(n,r,g2t),g=M.getScale(e,d2t);if(p.x===0||d.x>p.x||d.z>p.z||P.equalsEpsilon(g.x,0,void 0,u)||P.equalsEpsilon(g.y,0,void 0,u)||P.equalsEpsilon(g.z,0,void 0,u))return!1;let m=this._renderBoundPlanes;m.get(0).distance=d.z,m.get(1).distance=-p.z,this._shapeTransform=M.clone(e,this._shapeTransform),this._orientedBoundingBox=$oe(d,p,this._shapeTransform,this._orientedBoundingBox),this._boundTransform=M.fromRotationTranslation(this._orientedBoundingBox.halfAxes,this._orientedBoundingBox.center,this._boundTransform),this._boundingSphere=ue.fromOrientedBoundingBox(this._orientedBoundingBox,this._boundingSphere);let y=n.y<t.y,A=n.y-t.y+y*a,b=p.y<d.y,x=p.y-d.y+b*a,T=x>=c-f&&x<a-f,E=x>f&&x<c-f,v=x<=f,S=T||E||v,I=this._shaderUniforms,R=this._shaderDefines;for(let q in R)R.hasOwnProperty(q)&&(R[q]=void 0);let O=0;R.CYLINDER_INTERSECTION_INDEX_RADIUS_MAX=O,O+=1,A<a-f&&(R.CYLINDER_HAS_SHAPE_BOUNDS_ANGLE=!0),d.x!==o.x&&(R.CYLINDER_HAS_RENDER_BOUNDS_RADIUS_MIN=!0,R.CYLINDER_INTERSECTION_INDEX_RADIUS_MIN=O,O+=1),I.cylinderRenderRadiusMinMax=U.fromElements(d.x,p.x,I.cylinderRenderRadiusMinMax),d.x===p.x&&(R.CYLINDER_HAS_RENDER_BOUNDS_RADIUS_FLAT=!0);let L=n.x-t.x,_=0,C=1;L!==0&&(_=1/L,C=-t.x*_);let w=n.z-t.z,D=0,N=1;w!==0&&(D=1/w,N=-t.z*D),S&&(R.CYLINDER_HAS_RENDER_BOUNDS_ANGLE=!0,R.CYLINDER_INTERSECTION_INDEX_ANGLE=O,T?(R.CYLINDER_HAS_RENDER_BOUNDS_ANGLE_RANGE_UNDER_HALF=!0,O+=1):E?(R.CYLINDER_HAS_RENDER_BOUNDS_ANGLE_RANGE_OVER_HALF=!0,O+=2):v&&(R.CYLINDER_HAS_RENDER_BOUNDS_ANGLE_RANGE_EQUAL_ZERO=!0,O+=2),I.cylinderRenderAngleMinMax=U.fromElements(d.y,p.y,I.cylinderRenderAngleMinMax));let F=(t.y-o.y)/a,V=(n.y-o.y)/a,B=1-A/a,j=(V+.5*B)%1;I.cylinderShapeUvAngleRangeOrigin=j;let k=0,G=1;if(A>f){k=a/A;let q=F-j;G=-k*(q-Math.floor(q))}return I.cylinderLocalToShapeUvScale=h.fromElements(_,k,D,I.cylinderLocalToShapeUvScale),this._localToShapeUvTranslate=h.fromElements(C,G,N,this._localToShapeUvTranslate),this._shaderMaximumIntersectionsLength=O,!0};var A2t=new $,b2t=new $,x2t=new M;jf.prototype.updateViewTransforms=function(e){let t=this._shaderUniforms,n=M.inverse(this._shapeTransform,_2t),i=M.multiplyByPoint(n,e.camera.positionWC,y2t);t.cameraShapePosition=h.fromElements(U.magnitude(i),Math.atan2(i.y,i.x),i.z,t.cameraShapePosition);let r=U.normalize(U.fromCartesian3(i,MNe),MNe),o=$.fromRowMajorArray([r.x,r.y,0,-r.y,r.x,0,0,0,1],A2t),s=e.context.uniformState.inverseView,a=M.multiplyTransformation(n,s,x2t),c=M.getMatrix3(a,b2t);t.cylinderEcToRadialTangentUp=$.multiply(o,c,t.cylinderEcToRadialTangentUp)};jf.prototype.convertLocalToShapeUvSpace=function(e,t){let n=Math.hypot(e.x,e.y),i=Math.atan2(e.y,e.x),r=e.z,{cylinderLocalToShapeUvScale:o,cylinderShapeUvAngleRangeOrigin:s}=this._shaderUniforms,a=this._localToShapeUvTranslate;return n=n*o.x+a.x,i=(i+Math.PI)/(2*Math.PI),i-=s,i=i-Math.floor(i),i=i*o.y+a.y,r=r*o.z+a.z,h.fromElements(n,i,r,t)};var A9=new h,Koe=new h;jf.prototype.computeOrientedBoundingBoxForTile=function(e,t,n,i,r){let o=this._minBounds,s=this._maxBounds,a=1/Math.pow(2,e),c=h.fromElements(P.lerp(o.x,s.x,t*a),P.lerp(o.y,s.y,n*a),P.lerp(o.z,s.z,i*a),A9),u=h.fromElements(P.lerp(o.x,s.x,(t+1)*a),P.lerp(o.y,s.y,(n+1)*a),P.lerp(o.z,s.z,(i+1)*a),Koe);return $oe(c,u,this._shapeTransform,r)};var NNe=new h;jf.prototype.computeOrientedBoundingBoxForSample=function(e,t,n,i){let r=1/Math.pow(2,e.level),o=h.divideComponents(h.ONE,t,NNe),s=h.multiplyByScalar(o,r,NNe),a=h.multiplyByScalar(h.fromElements(e.x+n.x,e.y+n.y,e.z+n.z,A9),r,A9),c=h.add(a,s,Koe),u=this._minBounds,f=this._maxBounds,d=h.fromElements(P.lerp(u.x,f.x,a.x),P.lerp(u.y,f.y,a.y),P.lerp(u.z,f.z,a.z),A9),p=h.fromElements(P.lerp(u.x,f.x,c.x),P.lerp(u.y,f.y,c.y),P.lerp(u.z,f.z,c.z),Koe);return $oe(d,p,this._shapeTransform,i)};jf.DefaultMinBounds=Object.freeze(new h(0,-P.PI,-1));jf.DefaultMaxBounds=Object.freeze(new h(1,+P.PI,1));var T2t=5,E2t=new Array(T2t),C2t=new h,v2t=new $,S2t=new M,w2t=new M,I2t=new M,Xoe=new M,P2t=new h,D2t=new h,R2t=new h,FNe=new Array(8);for(let e=0;e<8;e++)FNe[e]=new h;function LNe(e,t,n){return Math.abs(se.dot(e,t))<n}function O2t(e){let t=M.getColumn(e,0,P2t),n=M.getColumn(e,1,D2t),i=M.getColumn(e,2,R2t),r=P.EPSILON4;return LNe(t,n,r)&&LNe(n,i,r)}function M2t(e,t){let n=FNe;h.fromElements(-.5,-.5,-.5,n[0]),h.fromElements(-.5,-.5,.5,n[1]),h.fromElements(-.5,.5,-.5,n[2]),h.fromElements(-.5,.5,.5,n[3]),h.fromElements(.5,-.5,-.5,n[4]),h.fromElements(.5,-.5,.5,n[5]),h.fromElements(.5,.5,-.5,n[6]),h.fromElements(.5,.5,.5,n[7]);for(let i=0;i<8;++i)M.multiplyByPoint(e,n[i],n[i]);return en.fromPoints(n,t)}var N2t=new h;function $oe(e,t,n,i){let r=e.x,o=t.x,s=e.y,a=t.y<s?t.y+P.TWO_PI:t.y,c=e.z,u=t.z,f=a-s,d=s+f*.5,p=E2t,g=0;p[g++]=s,p[g++]=a,p[g++]=d,f>P.PI&&(p[g++]=d-P.PI_OVER_TWO,p[g++]=d+P.PI_OVER_TWO);let m=Number.POSITIVE_INFINITY,y=Number.POSITIVE_INFINITY,A=Number.NEGATIVE_INFINITY,b=Number.NEGATIVE_INFINITY;for(let F=0;F<g;++F){let V=p[F]-d,B=Math.cos(V),j=Math.sin(V),k=B*r,G=j*r,q=B*o,Q=j*o;m=Math.min(m,k,q),y=Math.min(y,G,Q),A=Math.max(A,k,q),b=Math.max(b,G,Q)}let x=A-m,T=b-y,E=u-c,v=(m+A)*.5,S=(y+b)*.5,I=(c+u)*.5,R=h.fromElements(v,S,I,C2t),O=$.fromRotationZ(d,v2t),L=h.fromElements(x,T,E,N2t),_=M.fromScale(L,I2t),C=M.fromRotation(O,w2t),w=M.fromTranslation(R,S2t),D=M.multiplyTransformation(C,M.multiplyTransformation(w,_,Xoe),Xoe),N=M.multiplyTransformation(n,D,Xoe);return O2t(N)?en.fromTransformation(N,i):M2t(N,i)}var rI=jf;function nh(){this._orientedBoundingBox=new en,this._boundingSphere=new ue,this._boundTransform=new M,this._shapeTransform=new M,this._rectangle=new ie,this._minimumHeight=nh.DefaultMinBounds.z,this._maximumHeight=nh.DefaultMaxBounds.z,this._ellipsoid=new ee,this._translation=new h,this._rotation=new $,this._localToShapeUvTranslate=new h,this._shaderUniforms={cameraPositionCartographic:new h,ellipsoidEcToEastNorthUp:new $,ellipsoidRadii:new h,eccentricitySquared:0,evoluteScale:new U,ellipsoidCurvatureAtLatitude:new U,ellipsoidInverseRadiiSquared:new h,ellipsoidRenderLongitudeMinMax:new U,ellipsoidShapeUvLongitudeRangeOrigin:0,ellipsoidShapeUvLongitudeMinMaxMid:new h,ellipsoidLocalToShapeUvScale:new h,ellipsoidRenderLatitudeSinMinMax:new U,clipMinMaxHeight:new U},this._shaderDefines={ELLIPSOID_HAS_RENDER_BOUNDS_LONGITUDE:void 0,ELLIPSOID_HAS_RENDER_BOUNDS_LONGITUDE_RANGE_EQUAL_ZERO:void 0,ELLIPSOID_HAS_RENDER_BOUNDS_LONGITUDE_RANGE_UNDER_HALF:void 0,ELLIPSOID_HAS_RENDER_BOUNDS_LONGITUDE_RANGE_OVER_HALF:void 0,ELLIPSOID_HAS_SHAPE_BOUNDS_LONGITUDE:void 0,ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MAX_UNDER_HALF:void 0,ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MAX_EQUAL_HALF:void 0,ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MAX_OVER_HALF:void 0,ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MIN_UNDER_HALF:void 0,ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MIN_EQUAL_HALF:void 0,ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MIN_OVER_HALF:void 0,ELLIPSOID_HAS_SHAPE_BOUNDS_LATITUDE:void 0,ELLIPSOID_INTERSECTION_INDEX_LONGITUDE:void 0,ELLIPSOID_INTERSECTION_INDEX_LATITUDE_MAX:void 0,ELLIPSOID_INTERSECTION_INDEX_LATITUDE_MIN:void 0,ELLIPSOID_INTERSECTION_INDEX_HEIGHT_MAX:void 0,ELLIPSOID_INTERSECTION_INDEX_HEIGHT_MIN:void 0},this._shaderMaximumIntersectionsLength=0}Object.defineProperties(nh.prototype,{orientedBoundingBox:{get:function(){return this._orientedBoundingBox}},boundingSphere:{get:function(){return this._boundingSphere}},boundTransform:{get:function(){return this._boundTransform}},shapeTransform:{get:function(){return this._shapeTransform}},shaderUniforms:{get:function(){return this._shaderUniforms}},shaderDefines:{get:function(){return this._shaderDefines}},shaderMaximumIntersectionsLength:{get:function(){return this._shaderMaximumIntersectionsLength}}});var L2t=new h,F2t=new h,B2t=new h,k2t=new h,U2t=new h,z2t=new h,V2t=new h,j2t=new h,BNe=new h,kNe=new h,H2t=new ie;nh.prototype.update=function(e,t,n,i,r){let{DefaultMinBounds:o,DefaultMaxBounds:s}=nh;i=i??o,r=r??s;let a=P.EPSILON10,c=P.EPSILON10,u=P.EPSILON10,f=P.EPSILON3,d=M.getScale(e,j2t),p=h.clone(o,L2t);p.z=-h.minimumComponent(d);let g=h.clamp(t,p,s,F2t),m=h.clamp(n,p,s,B2t),y=h.clamp(i,p,s,k2t),A=h.clamp(r,p,s,U2t),b=h.maximumByComponent(g,y,z2t),x=h.minimumByComponent(m,A,V2t),T=h.add(d,h.fromElements(m.z,m.z,m.z,BNe),BNe),E=h.add(d,h.fromElements(x.z,x.z,x.z,kNe),kNe);if(b.y>x.y||b.y===s.y||x.y===o.y||b.z>x.z||P.equalsEpsilon(E,h.ZERO,void 0,a))return!1;this._rectangle=ie.fromRadians(g.x,g.y,m.x,m.y),this._translation=M.getTranslation(e,this._translation),this._rotation=M.getRotation(e,this._rotation),this._ellipsoid=ee.fromCartesian3(d,this._ellipsoid),this._minimumHeight=g.z,this._maximumHeight=m.z;let v=ie.fromRadians(b.x,b.y,x.x,x.y,H2t);this._orientedBoundingBox=Joe(v,b.z,x.z,this._ellipsoid,this._translation,this._rotation,this._orientedBoundingBox),this._shapeTransform=M.fromRotationTranslation(this._rotation,this._translation,this._shapeTransform),this._boundTransform=M.fromRotationTranslation(this._orientedBoundingBox.halfAxes,this._orientedBoundingBox.center,this._boundTransform),this._boundingSphere=ue.fromOrientedBoundingBox(this._orientedBoundingBox,this._boundingSphere);let S=s.x-o.x,I=.5*S,R=x.x<b.x,O=x.x-b.x+R*S,L=O<=c,_=O>=I-c&&O<S-c,C=O>c&&O<I-c,w=L||_||C,D=m.x<g.x,N=m.x-g.x+D*S,F=N>I+c&&N<S-c,V=N>=I-c&&N<=I+c,B=N<I-c,j=F||V||B,k=x.y<-f,G=x.y>=-f&&x.y<=+f,q=x.y>+f&&x.y<s.y-u,Q=k||G||q,W=b.y>o.y+u&&b.y<-f,J=b.y>=-f&&b.y<=+f,Z=b.y>+f,ae=W||J||Z,Ae=Q||ae,fe=m.y-g.y,xe=m.y<-f,ge=m.y>=-f&&m.y<=+f,we=m.y>+f&&m.y<s.y-u,ve=xe||ge||we,Re=g.y>o.y+u&&g.y<-f,Qe=g.y>=-f&&g.y<=+f,He=g.y>+f,Ke=ve||(Re||Qe||He),Pe=this._shaderUniforms,qe=this._shaderDefines;for(let Yn in qe)qe.hasOwnProperty(Yn)&&(qe[Yn]=void 0);Pe.ellipsoidRadii=h.clone(T,Pe.ellipsoidRadii);let{x:st,z:vt}=Pe.ellipsoidRadii,jt=vt/st;Pe.eccentricitySquared=1-jt*jt,Pe.evoluteScale=U.fromElements((st*st-vt*vt)/st,(vt*vt-st*st)/vt,Pe.evoluteScale),Pe.ellipsoidInverseRadiiSquared=h.divideComponents(h.ONE,h.multiplyComponents(Pe.ellipsoidRadii,Pe.ellipsoidRadii,Pe.ellipsoidInverseRadiiSquared),Pe.ellipsoidInverseRadiiSquared);let lt=0;qe.ELLIPSOID_INTERSECTION_INDEX_HEIGHT_MAX=lt,lt+=1,qe.ELLIPSOID_INTERSECTION_INDEX_HEIGHT_MIN=lt,lt+=1,Pe.clipMinMaxHeight=U.fromElements(b.z-m.z,x.z-m.z,Pe.clipMinMaxHeight);let mt=m.z-g.z,ft=mt===0?0:1/mt;w&&(qe.ELLIPSOID_HAS_RENDER_BOUNDS_LONGITUDE=!0,qe.ELLIPSOID_INTERSECTION_INDEX_LONGITUDE=lt,_?(qe.ELLIPSOID_HAS_RENDER_BOUNDS_LONGITUDE_RANGE_UNDER_HALF=!0,lt+=1):C?(qe.ELLIPSOID_HAS_RENDER_BOUNDS_LONGITUDE_RANGE_OVER_HALF=!0,lt+=2):L&&(qe.ELLIPSOID_HAS_RENDER_BOUNDS_LONGITUDE_RANGE_EQUAL_ZERO=!0,lt+=2),Pe.ellipsoidRenderLongitudeMinMax=U.fromElements(b.x,x.x,Pe.ellipsoidRenderLongitudeMinMax));let Yt=0,rt=1;if(j){qe.ELLIPSOID_HAS_SHAPE_BOUNDS_LONGITUDE=!0;let Yn=(g.x-o.x)/S,yi=(m.x-o.x)/S,zi=1-N/S,Si=(yi+.5*zi)%1;if(Pe.ellipsoidShapeUvLongitudeRangeOrigin=Si,N>c){Yt=S/N;let ui=Yn-Si;rt=-Yt*(ui-Math.floor(ui))}}Ae&&(ae&&(qe.ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MIN=!0,qe.ELLIPSOID_INTERSECTION_INDEX_LATITUDE_MIN=lt,W?(qe.ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MIN_UNDER_HALF=!0,lt+=1):J?(qe.ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MIN_EQUAL_HALF=!0,lt+=1):Z&&(qe.ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MIN_OVER_HALF=!0,lt+=2)),Q&&(qe.ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MAX=!0,qe.ELLIPSOID_INTERSECTION_INDEX_LATITUDE_MAX=lt,k?(qe.ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MAX_UNDER_HALF=!0,lt+=2):G?(qe.ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MAX_EQUAL_HALF=!0,lt+=1):q&&(qe.ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MAX_OVER_HALF=!0,lt+=1)),Pe.ellipsoidRenderLatitudeSinMinMax=U.fromElements(Math.sin(b.y),Math.sin(x.y),Pe.ellipsoidRenderLatitudeSinMinMax));let ht=0,Li=1;return Ke&&(qe.ELLIPSOID_HAS_SHAPE_BOUNDS_LATITUDE=!0,fe>u&&(ht=(s.y-o.y)/fe,Li=(o.y-g.y)/fe)),Pe.ellipsoidLocalToShapeUvScale=h.fromElements(Yt,ht,ft,Pe.ellipsoidLocalToShapeUvScale),this._localToShapeUvTranslate=h.fromElements(rt,Li,0,this._localToShapeUvTranslate),this._shaderMaximumIntersectionsLength=lt,!0};var G2t=new he,W2t=new h,q2t=new M,UNe=new $;nh.prototype.updateViewTransforms=function(e){let t=this._shaderUniforms,n=this._ellipsoid,i=e.camera.positionWC,r=n.cartesianToCartographic(i,G2t);h.fromElements(r.longitude,r.latitude,r.height,t.cameraPositionCartographic);let o=h.fromRadians(r.longitude,r.latitude,0,n,W2t);t.ellipsoidCurvatureAtLatitude=n.getLocalCurvature(o,t.ellipsoidCurvatureAtLatitude);let s=At.eastNorthUpToFixedFrame(o,n,q2t),a=M.getRotation(s,UNe),c=e.context.uniformState.viewRotation,u=$.multiply(c,a,UNe);t.ellipsoidEcToEastNorthUp=$.transpose(u,t.ellipsoidEcToEastNorthUp)};var qNe=new ie;nh.prototype.computeOrientedBoundingBoxForTile=function(e,t,n,i,r){let o=1/Math.pow(2,e),s=t*o,a=(t+1)*o,c=n*o,u=(n+1)*o,f=i*o,d=(i+1)*o,p=ie.subsection(this._rectangle,s,c,a,u,qNe),g=P.lerp(this._minimumHeight,this._maximumHeight,f),m=P.lerp(this._minimumHeight,this._maximumHeight,d);return Joe(p,g,m,this._ellipsoid,this._translation,this._rotation,r)};var Y2t=new U,X2t=new U,fM=new U,zNe=new U,VNe=new U,dM=new U;function K2t(e,t,n,i){let r=U.abs(e,Y2t),o=U.fromElements(1/t.x,1/t.y,X2t),s=U.fromElements(Math.SQRT1_2,Math.SQRT1_2,fM),a=U.multiplyComponents(t,s,zNe),c=U.fromElements(n.x*s.x*s.x*s.x,n.y*s.y*s.y*s.y,VNe);for(let u=0;u<3;++u){let f=U.magnitude(U.subtract(a,c,dM)),d=U.normalize(U.subtract(r,c,dM),dM),p=U.multiplyByScalar(d,f,dM);s=U.multiplyComponents(U.add(p,c,fM),o,fM),s=U.normalize(U.clamp(s,U.ZERO,U.ONE,fM),fM),a=U.multiplyComponents(t,s,zNe),c=U.fromElements(n.x*s.x*s.x*s.x,n.y*s.y*s.y*s.y,VNe)}return h.fromElements(Math.sign(e.x)*a.x,Math.sign(e.y)*a.y,U.magnitude(U.subtract(a,c,dM)),i)}var $2t=new U,jNe=new U,J2t=new h,HNe=new U;nh.prototype.convertLocalToShapeUvSpace=function(e,t){let n=Math.atan2(e.y,e.x),{ellipsoidRadii:i,evoluteScale:r,ellipsoidInverseRadiiSquared:o,ellipsoidShapeUvLongitudeRangeOrigin:s,ellipsoidLocalToShapeUvScale:a}=this._shaderUniforms,c=this._localToShapeUvTranslate,u=Math.hypot(e.x,e.y),f=U.fromElements(u,e.z,jNe),d=K2t(f,U.fromElements(i.x,i.z,$2t),r,J2t),p=U.normalize(U.fromElements(d.x*o.x,d.y*o.z,HNe),HNe),g=Math.atan2(p.y,p.x),m=U.magnitude(f)<U.magnitude(d)?-1:1,y=U.subtract(f,d,jNe),A=m*U.magnitude(y),{ELLIPSOID_HAS_SHAPE_BOUNDS_LONGITUDE:b,ELLIPSOID_HAS_SHAPE_BOUNDS_LATITUDE:x}=this._shaderDefines;return n=(n+Math.PI)/(2*Math.PI),l(b)&&(n-=s,n=n-Math.floor(n),n=n*a.x+c.x),g=(g+Math.PI/2)/Math.PI,l(x)&&(g=g*a.y+c.y),A=1+A*a.z,h.fromElements(n,g,A,t)};var GNe=new h,WNe=new h,Z2t=new h;nh.prototype.computeOrientedBoundingBoxForSample=function(e,t,n,i){let r=1/Math.pow(2,e.level),o=h.divideComponents(h.ONE,t,GNe),s=h.multiplyByScalar(o,r,GNe),a=h.multiplyByScalar(h.fromElements(e.x+n.x,e.y+n.y,e.z+n.z,WNe),r,WNe),c=h.add(a,s,Z2t),u=ie.subsection(this._rectangle,a.x,a.y,c.x,c.y,qNe),f=P.lerp(this._minimumHeight,this._maximumHeight,a.z),d=P.lerp(this._minimumHeight,this._maximumHeight,c.z);return Joe(u,f,d,this._ellipsoid,this._translation,this._rotation,i)};function Joe(e,t,n,i,r,o,s){return s=en.fromRectangle(e,t,n,i,s),s.center=h.add(s.center,r,s.center),s.halfAxes=$.multiply(s.halfAxes,o,s.halfAxes),s}nh.DefaultMinBounds=Object.freeze(new h(-P.PI,-P.PI_OVER_TWO,-ee.WGS84.minimumRadius));nh.DefaultMaxBounds=Object.freeze(new h(P.PI,P.PI_OVER_TWO,10*ee.WGS84.maximumRadius));var oI=nh;var Xu={BOX:"BOX",ELLIPSOID:"ELLIPSOID",CYLINDER:"CYLINDER"};Xu.getMinBounds=function(e){switch(e){case Xu.BOX:return iI.DefaultMinBounds;case Xu.ELLIPSOID:return oI.DefaultMinBounds;case Xu.CYLINDER:return rI.DefaultMinBounds}};Xu.getMaxBounds=function(e){switch(e){case Xu.BOX:return iI.DefaultMaxBounds;case Xu.ELLIPSOID:return oI.DefaultMaxBounds;case Xu.CYLINDER:return rI.DefaultMaxBounds}};Xu.getShapeConstructor=function(e){switch(e){case Xu.BOX:return iI;case Xu.ELLIPSOID:return oI;case Xu.CYLINDER:return rI}};Object.freeze(Xu);var Dc=Xu;function Cm(e){this._comparator=e.comparator,this._maximumLength=e.maximumLength,this._array=l(e.maximumLength)?new Array(e.maximumLength):[],this._length=0}Object.defineProperties(Cm.prototype,{length:{get:function(){return this._length}},maximumLength:{get:function(){return this._maximumLength},set:function(e){if(l(e)){for(;this._length>e;)this.removeMinimum();this._array.length=e}this._maximumLength=e}},internalArray:{get:function(){return this._array}},comparator:{get:function(){return this._comparator}}});Cm.prototype.clone=function(){let e=this._maximumLength,t=this._comparator,n=this._array,i=this._length,r=new Cm({comparator:t,maximumLength:e});r._length=i;for(let o=0;o<i;o++)r._array[o]=n[o];return r};Cm.prototype.reset=function(){this._length=0;let e=this._maximumLength;if(l(e))for(let t=0;t<e;t++)this._array[t]=void 0;else this._array.length=0};Cm.prototype.resort=function(){let e=this._length;for(let t=0;t<e;t++)YNe(this,t)};Cm.prototype.insert=function(e){let t,n=this._maximumLength;if(l(n)){if(n===0)return;if(this._length===n){let r=this._array[0];if(this._comparator(e,r)<=0)return e;t=this.removeMinimum()}}let i=this._length;return this._array[i]=e,this._length++,YNe(this,i),t};Cm.prototype.removeMinimum=function(){let e=this._length;if(e===0)return;this._length--;let t=this._array[0];return e>=2&&(this._array[0]=this._array[e-1],XNe(this,0)),this._array[e-1]=void 0,t};Cm.prototype.removeMaximum=function(){let e=this._length;if(e===0)return;this._length--;let t;if(e<=2)t=this._array[e-1];else{let n=Zoe(this,1,2)?1:2;t=this._array[n],this._array[n]=this._array[e-1],e>=4&&XNe(this,n)}return this._array[e-1]=void 0,t};Cm.prototype.getMinimum=function(){if(this._length!==0)return this._array[0]};Cm.prototype.getMaximum=function(){let e=this._length;if(e!==0)return e<=2?this._array[e-1]:this._array[Zoe(this,1,2)?1:2]};function b9(e,t,n){let i=e._array,r=i[t];i[t]=i[n],i[n]=r}function hM(e,t,n){return e._comparator(e._array[t],e._array[n])<0}function Zoe(e,t,n){return e._comparator(e._array[t],e._array[n])>0}function YNe(e,t){if(t===0)return;let n=Math.floor(P.log2(t+1))%2===0,i=Math.floor((t-1)/2),r=hM(e,t,i);for(r!==n&&(b9(e,t,i),t=i);t>=3;){let o=Math.floor((t-3)/4);if(hM(e,t,o)!==r)break;b9(e,t,o),t=o}}function XNe(e,t){let n=e._length,i=Math.floor(P.log2(t+1))%2===0,r;for(;(r=2*t+1)<n;){let o=r,s=r+1;if(s<n){hM(e,s,o)===i&&(o=s);let a=2*r+1,c=Math.max(Math.min(n-a,4),0);for(let u=0;u<c;u++){let f=a+u;hM(e,f,o)===i&&(o=f)}}if(hM(e,o,t)===i&&(b9(e,o,t),o!==r&&o!==s)){let a=Math.floor((o-1)/2);Zoe(e,o,a)===i&&b9(e,o,a)}t=o}}var KA=Cm;var Qoe=Object.freeze({UNLOADED:0,RECEIVING:1,PROCESSING:2,LOADED:3,FAILED:4,UNAVAILABLE:5});function mM(e,t){this.spatialNode=e,this.keyframe=t,this.state=Qoe.UNLOADED,this.content=void 0,this.megatextureIndex=-1,this.priority=-Number.MAX_VALUE,this.highPriorityFrameNumber=-1}mM.prototype.unload=function(){this.content=this.content&&this.content.destroy(),this.spatialNode=void 0,this.state=Qoe.UNLOADED,this.megatextureIndex=-1,this.priority=-Number.MAX_VALUE,this.highPriorityFrameNumber=-1};mM.priorityComparator=function(e,t){return e.priority-t.priority};mM.searchComparator=function(e,t){return e.keyframe-t.keyframe};mM.LoadState=Qoe;var Gr=mM;function p0(e,t,n,i,r=134217728,o){let s=Q2t(i),a=ekt(n),c=n*Ft.getSizeInBytes(i),u=p0.get3DTextureDimension(t,c,r,o),f=h.divideComponents(u,t,new h);this.channelCount=n,this.componentType=i,this.textureMemoryByteLength=c*u.x*u.y*u.z,this.tileCounts=h.clone(f,new h),this.voxelCountPerTile=h.clone(t,new h),this.maximumTileCount=f.x*f.y*f.z,this.texture=new d2({context:e,pixelFormat:a,pixelDatatype:s,flipY:!1,width:u.x,height:u.y,depth:u.z,sampler:new Ht({wrapR:hn.CLAMP_TO_EDGE,wrapS:hn.CLAMP_TO_EDGE,wrapT:hn.CLAMP_TO_EDGE,minificationFilter:Wt.LINEAR,magnificationFilter:Jn.LINEAR})}),this.nodes=new Array(this.maximumTileCount);for(let d=0;d<this.maximumTileCount;d++)this.nodes[d]=new tkt(d);for(let d=0;d<this.maximumTileCount;d++){let p=this.nodes[d];p.previousNode=d>0?this.nodes[d-1]:void 0,p.nextNode=d<this.maximumTileCount-1?this.nodes[d+1]:void 0}this.occupiedList=void 0,this.emptyList=this.nodes[0],this.occupiedCount=0,this._nearestSampling=!1}Object.defineProperties(p0.prototype,{nearestSampling:{get:function(){return this._nearestSampling},set:function(e){this._nearestSampling!==e&&(e?this.texture.sampler=Ht.NEAREST:this.texture.sampler=new Ht({wrapR:hn.CLAMP_TO_EDGE,wrapS:hn.CLAMP_TO_EDGE,wrapT:hn.CLAMP_TO_EDGE,minificationFilter:Wt.LINEAR,magnificationFilter:Jn.LINEAR}),this._nearestSampling=e)}}});function Q2t(e){if(e===Ft.FLOAT32||e===Ft.FLOAT64)return ze.FLOAT;if(e===Ft.UINT8)return ze.UNSIGNED_BYTE}function ekt(e){switch(e){case 1:return $e.RED;case 2:return $e.RG;case 3:return $e.RGB;case 4:return $e.RGBA}}function tkt(e){this.index=e,this.nextNode=void 0,this.previousNode=void 0}p0.prototype.add=function(e){if(this.isFull())throw new pe("Trying to add when there are no empty spots");let t=this.emptyList;this.emptyList=this.emptyList.nextNode,l(this.emptyList)&&(this.emptyList.previousNode=void 0),t.nextNode=this.occupiedList,l(t.nextNode)&&(t.nextNode.previousNode=t),this.occupiedList=t;let n=t.index;return this.writeDataToTexture(n,e),this.occupiedCount++,n};p0.prototype.remove=function(e){if(e<0||e>=this.maximumTileCount)throw new pe("Megatexture index out of bounds");let t=this.nodes[e];l(t.previousNode)&&(t.previousNode.nextNode=t.nextNode),l(t.nextNode)&&(t.nextNode.previousNode=t.previousNode),t.nextNode=this.emptyList,l(t.nextNode)&&(t.nextNode.previousNode=t),t.previousNode=void 0,this.emptyList=t,this.occupiedCount--};p0.prototype.isFull=function(){return this.emptyList===void 0};p0.get3DTextureDimension=function(e,t,n,i){let{maximum3DTextureSize:r}=Ut;if(h.maximumComponent(e)>r)throw new oe("The GL context does not support a 3D texture large enough to contain a tile with the given dimensions.");let o=t*e.x*e.y*e.z,s=Math.floor(n/o);if(s<1)throw new oe("Not enough texture memory available to create a megatexture with the given tile dimensions.");l(i)?i=Math.min(i,s):i=s;let a=Object.entries(e).sort((f,d)=>d[1]-f[1]),c=a.map(([f,d])=>Math.floor(r/d));for(let f=0;f<3;f++){let d=KNe(c);if(d<i)break;let p=c.slice();p.splice(f,1);let g=p[0]*p[1],m=d-i,y=Math.floor(m/g);c[f]-=y}KNe(c)>s&&(c[2]=Math.floor(s/(c[0]*c[1])));let u=new h;for(let f=0;f<3;f++){let[d,p]=a[f];u[d]=c[f]*p}return u};function KNe(e){return e.reduce((t,n)=>t*n)}p0.prototype.writeDataToTexture=function(e,t){let{tileCounts:n,voxelCountPerTile:i}=this,r={arrayBufferView:t,width:i.x,height:i.y,depth:i.z},o=n.x*n.y,s=Math.floor(e/o),a=e-s*o,c=Math.floor(a/n.x),u=a-c*n.x,f={source:r,xOffset:u*i.x,yOffset:c*i.y,zOffset:s*i.z};this.texture.copyFrom(f)};p0.prototype.isDestroyed=function(){return!1};p0.prototype.destroy=function(){return this.texture=this.texture&&this.texture.destroy(),le(this)};var x9=p0;function ih(e,t,n,i,r,o,s){this.children=void 0,this.parent=r,this.level=e,this.x=t,this.y=n,this.z=i,this.dimensions=h.clone(s),this.keyframeNodes=[],this.renderableKeyframeNodes=[],this.renderableKeyframeNodeLerp=0,this.renderableKeyframeNodePrevious=void 0,this.renderableKeyframeNodeNext=void 0,this.orientedBoundingBox=new en,this.approximateVoxelSize=0,this.screenSpaceError=0,this.visitedFrameNumber=-1,this.computeBoundingVolumes(o)}var nkt=new h;ih.prototype.computeBoundingVolumes=function(e){this.orientedBoundingBox=e.computeOrientedBoundingBoxForTile(this.level,this.x,this.y,this.z,this.orientedBoundingBox);let t=$.getScale(this.orientedBoundingBox.halfAxes,nkt),n=2*h.maximumComponent(t);this.approximateVoxelSize=n/h.minimumComponent(this.dimensions)};ih.prototype.constructChildNodes=function(e){let{level:t,x:n,y:i,z:r}=this,o=n*2,s=i*2,a=r*2,c=s+1,u=o+1,f=a+1,d=t+1,p=[[d,o,s,a],[d,u,s,a],[d,o,c,a],[d,u,c,a],[d,o,s,f],[d,u,s,f],[d,o,c,f],[d,u,c,f]];this.children=p.map(([g,m,y,A])=>new ih(g,m,y,A,this,e,this.dimensions))};ih.prototype.visibility=function(e,t){let n=this.orientedBoundingBox;return e.cullingVolume.computeVisibilityWithPlaneMask(n,t)};ih.prototype.computeScreenSpaceError=function(e,t){let n=this.orientedBoundingBox,i=Math.sqrt(n.distanceSquaredTo(e));i=Math.max(i,P.EPSILON7);let r=this.approximateVoxelSize,o=t*(r/i);this.screenSpaceError=o};var $Ne={keyframe:0};function pM(e,t){return $Ne.keyframe=e,Pr(t,$Ne,Gr.searchComparator)}ih.prototype.computeSurroundingRenderableKeyframeNodes=function(e){let t=this,n=t.level,i=Math.floor(e),r=Math.ceil(e),o,s,a=+Number.MAX_VALUE,c=+Number.MAX_VALUE;for(;l(t);){let{renderableKeyframeNodes:d}=t;if(d.length>=1){let p=ikt(i,d),g=d[p],m=r===i||i<g.keyframe?p:Math.min(p+1,d.length-1),y=d[m],A=i-g.keyframe,b=JNe(n-t.level,A);b<a&&(a=b,o=g);let x=y.keyframe-r,T=JNe(n-t.level,x);if(T<c&&(c=T,s=y),A===0&&x===0)break}t=t.parent}if(this.renderableKeyframeNodePrevious=o,this.renderableKeyframeNodeNext=s,!l(o)||!l(s))return;let u=o.keyframe,f=s.keyframe;this.renderableKeyframeNodeLerp=u===f?0:P.clamp((e-u)/(f-u),0,1)};function ikt(e,t){let n=pM(e,t);return n<0?P.clamp(~n-1,0,t.length-1):n}function JNe(e,t){let n=Math.exp(e*4),i=t>=0?1:-200;return e*n+t*i}ih.prototype.isVisited=function(e){return this.visitedFrameNumber===e};ih.prototype.createKeyframeNode=function(e){let t=pM(e,this.keyframeNodes);if(t<0){t=~t;let n=new Gr(this,e);this.keyframeNodes.splice(t,0,n)}};ih.prototype.destroyKeyframeNode=function(e,t){let n=e.keyframe,i=pM(n,this.keyframeNodes);if(i<0)throw new pe("Keyframe node does not exist.");if(this.keyframeNodes.splice(i,1),e.megatextureIndex!==-1){for(let o=0;o<t.length;o++)t[o].remove(e.megatextureIndex);let r=pM(n,this.renderableKeyframeNodes);if(r<0)throw new pe("Renderable keyframe node does not exist.");this.renderableKeyframeNodes.splice(r,1)}e.unload()};ih.prototype.addKeyframeNodeToMegatextures=function(e,t){if(e.megatextureIndex!==-1||e.content.metadata.length!==t.length)throw new pe("Keyframe node cannot be added to megatexture");let{metadata:n}=e.content;for(let o=0;o<t.length;o++){let s=t[o];e.megatextureIndex=s.add(n[o])}let i=this.renderableKeyframeNodes,r=pM(e.keyframe,i);if(r>=0)throw new pe("Keyframe already renderable");r=~r,i.splice(r,0,e)};ih.prototype.isRenderable=function(e){let t=this.renderableKeyframeNodePrevious,n=this.renderableKeyframeNodeNext,i=this.level;return l(t)&&l(n)&&(t.spatialNode.level===i||n.spatialNode.level===i)&&this.visitedFrameNumber===e};var T9=ih;function $A(e,t,n,i){let{provider:r,dimensions:o,inputDimensions:s}=e,{types:a,componentTypes:c}=r;l(i)?i=Math.min(Math.max(0,i),512*1024*1024):i=128*1024*1024,this._primitive=e,this.textureMemoryByteLength=0,this.megatextures=new Array(a.length);let u=l(r.maximumTileCount)?r.maximumTileCount:l(r.availableLevels)?(8**r.availableLevels-1)/7:void 0;for(let b=0;b<a.length;b++){let x=a[b],T=bt.getComponentCount(x),E=c[b];this.megatextures[b]=new x9(t,s,T,E,i,u),this.textureMemoryByteLength+=this.megatextures[b].textureMemoryByteLength}let f=this.megatextures[0].maximumTileCount;this._simultaneousRequestCount=0,this._debugPrint=!1,this._calculateStatistics=this._primitive._calculateStatistics??!1,this._frameNumber=0;let d=e._shape;this.rootNode=new T9(0,0,0,0,void 0,d,o),this._priorityQueue=new KA({maximumLength:f,comparator:Gr.priorityComparator}),this._highPriorityKeyframeNodes=new Array(f),this._highPriorityKeyframeNodeCount=0,this._keyframeNodesInMegatexture=new Array(f),this._keyframeCount=n,this._sampleCount=void 0,this._keyframeLocation=0,this._binaryTreeKeyframeWeighting=new Array(n),this._initialTilesLoaded=!1;let p=this._binaryTreeKeyframeWeighting;p[0]=0,p[n-1]=0,ese(p,1,n-2,0);let g=9,m=2048,y=Math.floor(m/g),A=Math.ceil(f/y);this.internalNodeTexture=new Dt({context:t,pixelFormat:$e.RGBA,pixelDatatype:ze.UNSIGNED_BYTE,flipY:!1,width:m,height:A,sampler:new Ht({minificationFilter:Wt.NEAREST,magnificationFilter:Jn.NEAREST})}),this.internalNodeTilesPerRow=y,this.internalNodeTexelSizeUv=new U(1/m,1/A),this.leafNodeTexture=void 0,this.leafNodeTilesPerRow=void 0,this.leafNodeTexelSizeUv=new U}$A.prototype.findKeyframeNode=function(e){return this._keyframeNodesInMegatexture.find(function(t){return t.megatextureIndex===e})};function ese(e,t,n,i){if(t>n)return;let r=Math.floor((t+n)/2);e[r]=i,ese(e,t,r-1,i+1),ese(e,r+1,n,i+1)}$A.simultaneousRequestCountMaximum=50;$A.prototype.update=function(e,t,n,i){let r=this._primitive,o=e.context,s=this.megatextures[0].maximumTileCount,a=this._keyframeCount,c=r._levelBlendFactor,u=c>0,f=a>1,d=(u?2:1)*(f?2:1);this._sampleCount=d;let p=d>=2;if(p&&!l(this.leafNodeTexture)){let T=Math.floor(512),E=Math.ceil(s/T);this.leafNodeTexture=new Dt({context:o,pixelFormat:$e.RGBA,pixelDatatype:ze.UNSIGNED_BYTE,flipY:!1,width:1024,height:E,sampler:new Ht({minificationFilter:Wt.NEAREST,magnificationFilter:Jn.NEAREST})}),this.leafNodeTexelSizeUv=U.fromElements(1/1024,1/E,this.leafNodeTexelSizeUv),this.leafNodeTilesPerRow=T}else!p&&l(this.leafNodeTexture)&&(this.leafNodeTexture=this.leafNodeTexture.destroy());if(this._keyframeLocation=P.clamp(t,0,a-1),n&&ZNe(this,this.rootNode),i)return;this._frameNumber=e.frameNumber;let g=xn();skt(this,e),akt(this,e);let m=xn();dkt(this,d,c);let y=xn(),A=r.loadProgress.numberOfListeners>0||r.allTilesLoaded.numberOfListeners>0||r.initialTilesLoaded.numberOfListeners>0;if(this._debugPrint||this._calculateStatistics||A){let b=m-g,x=y-m,T=y-g;fkt(this,e,b,x,T)}};$A.prototype.isRenderable=function(e){return e.isRenderable(this._frameNumber)};$A.prototype.isDestroyed=function(){return!1};$A.prototype.destroy=function(){let e=this.megatextures,t=e.length;for(let n=0;n<t;n++)e[n]=e[n]&&e[n].destroy();return this.textureMemoryByteLength=0,this.internalNodeTexture=this.internalNodeTexture&&this.internalNodeTexture.destroy(),this.leafNodeTexture=this.leafNodeTexture&&this.leafNodeTexture.destroy(),le(this)};function ZNe(e,t){if(t.computeBoundingVolumes(e._primitive._shape),l(t.children))for(let n=0;n<8;n++){let i=t.children[n];ZNe(e,i)}}function rkt(e,t){if(e._simultaneousRequestCount>=$A.simultaneousRequestCountMaximum)return;let i=e._primitive.provider,{keyframe:r,spatialNode:o}=t;if(l(i.availableLevels)&&o.level>=i.availableLevels)return;function s(f){e._simultaneousRequestCount--,t.content=f,t.state=l(f)?Gr.LoadState.PROCESSING:Gr.LoadState.UNAVAILABLE}function a(f){e._simultaneousRequestCount--,t.state=Gr.LoadState.FAILED,e._primitive.tileFailed.raiseEvent()}let c={tileLevel:o.level,tileX:o.x,tileY:o.y,tileZ:o.z,keyframe:r},u=i.requestData(c);l(u)&&(e._simultaneousRequestCount++,t.state=Gr.LoadState.RECEIVING,u.then(s).catch(a))}function okt(e){return e/(1+e)}function skt(e,t){let n=e._frameNumber,i=e._priorityQueue;i.reset(),QNe(e.rootNode,aa.MASK_INDETERMINATE,e,t);let r=e._highPriorityKeyframeNodes,o=0,s;for(;i.length>0;)s=i.removeMaximum(),s.highPriorityFrameNumber=n,r[o]=s,o++;e._highPriorityKeyframeNodeCount=o}function akt(e,t){let n=e.megatextures[0],i=n.occupiedCount,r=e._keyframeNodesInMegatexture;r.length=i,r.sort(ckt);let o=e._highPriorityKeyframeNodes,s=e._highPriorityKeyframeNodeCount,a=0,c=0;for(let u=0;u<s;u++){let f=o[u];if(!(f.state===Gr.LoadState.LOADED||f.spatialNode===void 0)&&(f.state===Gr.LoadState.UNLOADED&&rkt(e,f),f.state===Gr.LoadState.PROCESSING)){let{content:d}=f;if(d.update(e._primitive,t),!d.ready)continue;if(!lkt(d.metadata,e)){f.content=void 0,f.state=Gr.LoadState.FAILED,e._primitive.tileFailed.raiseEvent();continue}let p;if(n.isFull()){p=i-1-a,a++;let g=r[p];e._primitive.tileUnload.raiseEvent(),g.spatialNode.destroyKeyframeNode(g,e.megatextures)}else p=i+c,c++;f.spatialNode.addKeyframeNodeToMegatextures(f,e.megatextures),f.state=Gr.LoadState.LOADED,r[p]=f,e._primitive.tileLoad.raiseEvent()}}}function ckt(e,t){return e.highPriorityFrameNumber===t.highPriorityFrameNumber?t.priority-e.priority:t.highPriorityFrameNumber-e.highPriorityFrameNumber}function lkt(e,t){let n=t._primitive.provider.types.length;if(!Array.isArray(e)||e.length!==n)return!1;let{megatextures:i}=t;for(let r=0;r<n;r++){let{voxelCountPerTile:o,channelCount:s}=i[r],{x:a,y:c,z:u}=o,f=a*c*u,d=e[r],p=f*s;if(d.length!==p)return!1}return!0}function QNe(e,t,n,i){let{camera:r,context:o,pixelRatio:s,frameNumber:a}=i,{positionWC:c,frustum:u}=r,d=o.drawingBufferHeight/s/u.sseDenominator;if(e.computeScreenSpaceError(c,d),t=e.visibility(i,t),t===aa.MASK_OUTSIDE)return;e.visitedFrameNumber=a;let p=n._primitive,g=p._shape,m=p.screenSpaceError,y=n._priorityQueue,A=n._keyframeCount,b=P.clamp(Math.floor(n._keyframeLocation),0,A-2),x=b+1;if(A===1)e.createKeyframeNode(0);else if(e.keyframeNodes.length!==A)for(let I=0;I<A;I++)e.createKeyframeNode(I);let{screenSpaceError:T,keyframeNodes:E}=e,v=okt(T),S=!1;for(let I=0;I<E.length;I++){let R=E[I];R.priority=10*v+ukt(b,R.keyframe,x,n),R.state!==Gr.LoadState.UNAVAILABLE&&R.state!==Gr.LoadState.FAILED&&R.priority!==-Number.MAX_VALUE&&y.insert(R),R.state===Gr.LoadState.LOADED&&(S=!0)}if(T<m||!S){e.children=void 0;return}l(e.children)||e.constructChildNodes(g);for(let I=0;I<8;I++){let R=e.children[I];QNe(R,t,n,i)}}function ukt(e,t,n,i){let r=Math.min(Math.abs(t-e),Math.abs(t-n)),o=Math.max(e,i._keyframeCount-n-1,1),s=Math.pow(1-r/o,4),a=Math.exp(-i._binaryTreeKeyframeWeighting[t]);return P.lerp(a,s,.15+.85*s)}function fkt(e,t,n,i,r){let o=e._keyframeCount,s=e.rootNode,a=Object.keys(Gr.LoadState).length,c=new Array(a),u=new Array(a),f=0;for(let S=0;S<a;S++){let I=new Array(o).fill(0);c[S]=I,u[S]=0}function d(S){let I=S.keyframeNodes;for(let R=0;R<I.length;R++){let O=I[R],L=O.keyframe,_=O.state;c[_][L]+=1,u[_]+=1,f++}if(l(S.children))for(let R=0;R<8;R++){let O=S.children[R];d(O)}}d(s),e._primitive.statistics.numberOfTilesWithContentReady=u[Gr.LoadState.LOADED],e._primitive.statistics.visited=f;let p=u[Gr.LoadState.RECEIVING],g=u[Gr.LoadState.PROCESSING],m=p!==e._primitive.statistics.numberOfPendingRequests||g!==e._primitive.statistics.numberOfTilesProcessing;if(m&&t.afterRender.push(function(){return e._primitive.loadProgress.raiseEvent(p,g),!0}),e._primitive.statistics.numberOfPendingRequests=p,e._primitive.statistics.numberOfTilesProcessing=g,m&&(p===0&&g===0)&&(t.afterRender.push(function(){return e._primitive.allTilesLoaded.raiseEvent(),!0}),e._initialTilesLoaded||(e._initialTilesLoaded=!0,t.afterRender.push(function(){return e._primitive.initialTilesLoaded.raiseEvent(),!0}))),!e._debugPrint)return;let A=`KEYFRAMES: ${c[Gr.LoadState.LOADED]}`,b=`UNLOADED: ${u[Gr.LoadState.UNLOADED]} | RECEIVING: ${u[Gr.LoadState.RECEIVING]} | PROCESSING: ${u[Gr.LoadState.PROCESSING]} | LOADED: ${u[Gr.LoadState.LOADED]} | FAILED: ${u[Gr.LoadState.FAILED]} | UNAVAILABLE: ${u[Gr.LoadState.UNAVAILABLE]} | TOTAL: ${f}`,x=Math.round(n*100)/100,T=Math.round(i*100)/100,E=Math.round(r*100)/100,v=`LOAD: ${x} | OCT: ${T} | ALL: ${E}`;console.log(`${A} || ${b} || ${v}`)}var E9={INTERNAL:0,LEAF:1,PACKED_LEAF_FROM_PARENT:2};function dkt(e,t,n){let i=e._primitive._screenSpaceError,r=e._keyframeLocation,o=e._frameNumber,s=t>=2,a=0,c=0,u=[],f=[];function d(g,m,y,A,b){let x=!1;if(l(g.children))for(let T=0;T<8;T++){let E=g.children[T];E.computeSurroundingRenderableKeyframeNodes(r),E.isRenderable(o)&&(x=!0)}if(x){u[b]=E9.INTERNAL<<16|m,u[y]=A,a++,A=m,b=A*9+1;for(let T=0;T<8;T++){let E=g.children[T];m=a,y=m*9+0,d(E,m,y,A,b+T)}}else{if(e._primitive.tileVisible.raiseEvent(),s){let T=c*5,E=g.renderableKeyframeNodePrevious,v=g.level-E.spatialNode.level,S=E.spatialNode.parent,I=l(S)?S.renderableKeyframeNodePrevious:E,R=hkt(g,i,n),O=v,L=1,_=E.megatextureIndex,C=I.megatextureIndex;f[T+0]=R,f[T+1]=O,f[T+2]=L,f[T+3]=_,f[T+4]=C,u[b]=E9.LEAF<<16|c}else{let T=g.renderableKeyframeNodePrevious,v=g.level-T.spatialNode.level===0?E9.LEAF:E9.PACKED_LEAF_FROM_PARENT;u[b]=v<<16|T.megatextureIndex}c++}}let p=e.rootNode;p.computeSurroundingRenderableKeyframeNodes(r),p.isRenderable(o)&&d(p,0,0,0,0),mkt(u,9,e.internalNodeTilesPerRow,e.internalNodeTexture),s&&pkt(f,2,e.leafNodeTilesPerRow,e.leafNodeTexture)}function hkt(e,t,n){if(e.parent===void 0)return 0;let i=e.screenSpaceError,r=e.parent.screenSpaceError,s=((t-i)/(r-i)+n-1)/n;return P.clamp(s,0,1)}function mkt(e,t,n,i){let r=$e.componentsLength(i.pixelFormat),o=Math.ceil(e.length/t),s=Math.max(1,t*Math.min(o,n)),a=Math.max(1,Math.ceil(o/n)),c=new Uint8Array(s*a*r);for(let d=0;d<e.length;d++){let p=e[d],g=d*r;for(let m=0;m<r;m++)c[g+m]=p>>>m*8&255}let f={source:{arrayBufferView:c,width:s,height:a},xOffset:0,yOffset:0};i.copyFrom(f)}function pkt(e,t,n,i){let r=$e.componentsLength(i.pixelFormat),o=5,s=Math.ceil(e.length/o),a=Math.max(1,t*Math.min(s,n)),c=Math.max(1,Math.ceil(s/n)),u=new Uint8Array(a*c*r);for(let p=0;p<s;p++){let g=e[p*o+0],m=e[p*o+1],y=e[p*o+2],A=e[p*o+3],b=e[p*o+4],x=P.clamp(Math.floor(65536*g),0,65535);u[p*8+0]=x>>>0&255,u[p*8+1]=x>>>8&255,u[p*8+2]=m&255,u[p*8+3]=y&255,u[p*8+4]=A>>>0&255,u[p*8+5]=A>>>8&255,u[p*8+6]=b>>>0&255,u[p*8+7]=b>>>8&255}let d={source:{arrayBufferView:u,width:a,height:c},xOffset:0,yOffset:0};i.copyFrom(d)}var C9=$A;function g0(e){e=e??H.EMPTY_OBJECT;let{provider:t=g0.DefaultProvider,modelMatrix:n=M.IDENTITY,customShader:i=lM(t),clock:r,calculateStatistics:o=!1}=e;this._ready=!1,this._provider=t,this._traversal=void 0,this._statistics=new Pp,this._calculateStatistics=o;let{shape:s,minBounds:a=Dc.getMinBounds(s),maxBounds:c=Dc.getMaxBounds(s),dimensions:u,paddingBefore:f=h.ZERO,paddingAfter:d=h.ZERO,metadataOrder:p,availableLevels:g=1}=t;this._dimensions=h.clone(u),this._paddingBefore=h.clone(f),this._paddingAfter=h.clone(d),this._inputDimensions=gkt(u,f,d,p),this._availableLevels=g,this._minBounds=a.clone(),this._minBoundsOld=new h,this._maxBounds=c.clone(),this._maxBoundsOld=new h,this._minClippingBounds=a.clone(),this._minClippingBoundsOld=new h,this._maxClippingBounds=c.clone(),this._maxClippingBoundsOld=new h,this._verticalExaggeration=1,this._verticalExaggerationRelativeHeight=0,this._clippingPlanes=void 0,this._clippingPlanesState=0,this._clippingPlanesEnabled=!1,this._modelMatrix=M.clone(n),this._modelMatrixOld=M.clone(this._modelMatrix),this._customShader=i??g0.DefaultCustomShader,this._customShaderCompilationEvent=new be,this._shaderDirty=!0,this._drawCommand=void 0,this._drawCommandPick=void 0,this._pickId=void 0,this._clock=r,this._transformPositionLocalToWorld=new M,this._transformPositionWorldToLocal=new M,this._transformPlaneLocalToView=new M,this._transformDirectionWorldToLocal=new $,this._nearestSampling=!1,this._levelBlendFactor=0,this._stepSizeMultiplier=1,this._depthTest=!0,this._useLogDepth=void 0,this._screenSpaceError=4,this._debugPolylines=new Sp,this._debugDraw=!1,this._disableRender=!1,this._disableUpdate=!1;let m=Dc.getShapeConstructor(s);this._shape=new m,tLe(this),this._shapeVisible=nLe(this),this._uniforms={octreeInternalNodeTexture:void 0,octreeInternalNodeTilesPerRow:0,octreeInternalNodeTexelSizeUv:new U,octreeLeafNodeTexture:void 0,octreeLeafNodeTilesPerRow:0,octreeLeafNodeTexelSizeUv:new U,megatextureTextures:[],megatextureTileCounts:new h,dimensions:this._dimensions,inputDimensions:this._inputDimensions,paddingBefore:this._paddingBefore,paddingAfter:this._paddingAfter,transformPositionViewToLocal:new M,transformDirectionViewToLocal:new $,cameraPositionLocal:new h,cameraDirectionLocal:new h,cameraTileCoordinates:new se,cameraTileUv:new h,ndcSpaceAxisAlignedBoundingBox:new se,clippingPlanesTexture:void 0,clippingPlanesMatrix:new M,renderBoundPlanesTexture:void 0,stepSize:this._stepSizeMultiplier,pickColor:new z},this._shapeDefinesOld={},this._uniformMap={};let y=this._uniforms,A=this._uniformMap;for(let b in y)if(y.hasOwnProperty(b)){let x=`u_${b}`;A[x]=function(){return y[b]}}_kt(this,this._shape),this.tileLoad=new be,this.tileVisible=new be,this.tileFailed=new be,this.tileUnload=new be,this.loadProgress=new be,this.allTilesLoaded=new be,this.initialTilesLoaded=new be}function gkt(e,t,n,i){let r=h.add(e,t,new h);if(h.add(r,n,r),i===f_.Y_UP){let o=r.y;r.y=r.z,r.z=o}return r}function _kt(e,t){let n=e._uniformMap,{shaderUniforms:i,shaderDefines:r}=t;for(let o in i)if(i.hasOwnProperty(o)){let s=`u_${o}`;n[s]=function(){return i[o]}}e._shapeDefinesOld=Ze(r,!0)}Object.defineProperties(g0.prototype,{ready:{get:function(){return this._ready}},provider:{get:function(){return this._provider}},boundingSphere:{get:function(){return this._shape.boundingSphere}},orientedBoundingBox:{get:function(){return this._shape.orientedBoundingBox}},modelMatrix:{get:function(){return this._modelMatrix},set:function(e){this._modelMatrix=M.clone(e,this._modelMatrix)}},shape:{get:function(){return this._provider.shape}},dimensions:{get:function(){return this._dimensions}},inputDimensions:{get:function(){return this._inputDimensions}},paddingBefore:{get:function(){return this._paddingBefore}},paddingAfter:{get:function(){return this._paddingAfter}},minimumValues:{get:function(){return this._provider.minimumValues}},maximumValues:{get:function(){return this._provider.maximumValues}},show:{get:function(){return!this._disableRender},set:function(e){this._disableRender=!e}},disableUpdate:{get:function(){return this._disableUpdate},set:function(e){this._disableUpdate=e}},debugDraw:{get:function(){return this._debugDraw},set:function(e){this._debugDraw=e}},depthTest:{get:function(){return this._depthTest},set:function(e){this._depthTest!==e&&(this._depthTest=e,this._shaderDirty=!0)}},nearestSampling:{get:function(){return this._nearestSampling},set:function(e){this._nearestSampling=e}},levelBlendFactor:{get:function(){return this._levelBlendFactor},set:function(e){this._levelBlendFactor=P.clamp(e,0,1)}},screenSpaceError:{get:function(){return this._screenSpaceError},set:function(e){this._screenSpaceError=e}},stepSize:{get:function(){return this._stepSizeMultiplier},set:function(e){this._stepSizeMultiplier=e}},minBounds:{get:function(){return this._minBounds},set:function(e){this._minBounds=h.clone(e,this._minBounds)}},maxBounds:{get:function(){return this._maxBounds},set:function(e){this._maxBounds=h.clone(e,this._maxBounds)}},minClippingBounds:{get:function(){return this._minClippingBounds},set:function(e){this._minClippingBounds=h.clone(e,this._minClippingBounds)}},maxClippingBounds:{get:function(){return this._maxClippingBounds},set:function(e){this._maxClippingBounds=h.clone(e,this._maxClippingBounds)}},clippingPlanes:{get:function(){return this._clippingPlanes},set:function(e){Ps.setOwner(e,this,"_clippingPlanes")}},customShader:{get:function(){return this._customShader},set:function(e){if(e===this._customShader)return;let t=this._uniformMap,i=this._customShader.uniformMap;for(let r in i)i.hasOwnProperty(r)&&delete t[r];if(l(e))this._customShader=e;else{let r=lM(this._provider);this._customShader=r??g0.DefaultCustomShader}this._shaderDirty=!0}},customShaderCompilationEvent:{get:function(){return this._customShaderCompilationEvent}},statistics:{get:function(){return this._statistics}}});var ykt=new se,Akt=new se,bkt=new M,xkt=new M,Tkt=new h,Ekt=new se;g0.prototype.update=function(e){let t=this._provider,n=this._uniforms;this._customShader.update(e);let i=e.context;if(!this._ready){Dkt(this,t,i),e.afterRender.push(()=>(this._ready=!0,!0));return}let r=tLe(this),o=Pkt(this,e);if((r||o)&&(this._shapeVisible=nLe(this),zkt(this)&&(this._shaderDirty=!0)),!this._shapeVisible)return;this._shape.updateViewTransforms(e);let s=Vkt(t.timeIntervalCollection,this._clock),a=this._traversal,c=a._sampleCount;if(a.update(e,s,r,this._disableUpdate),c!==a._sampleCount&&(this._shaderDirty=!0),!a.isRenderable(a.rootNode)||(this._debugDraw&&Kkt(this,e),this._disableRender))return;this._useLogDepth!==e.useLogDepth&&(this._useLogDepth=e.useLogDepth,this._shaderDirty=!0),jkt(this,e)&&(this._shaderDirty=!0);let f=a.leafNodeTexture;l(f)&&(n.octreeLeafNodeTexture=a.leafNodeTexture,n.octreeLeafNodeTexelSizeUv=U.clone(a.leafNodeTexelSizeUv,n.octreeLeafNodeTexelSizeUv),n.octreeLeafNodeTilesPerRow=a.leafNodeTilesPerRow),this._shaderDirty&&(_9(this,i),this._shaderDirty=!1);let d=i.uniformState.viewProjection,{orientedBoundingBox:p}=this._shape,g=Wkt(p,d,Akt);if(g.x===1||g.y===1||g.z===-1||g.w===-1)return;n.ndcSpaceAxisAlignedBoundingBox=se.clone(g,n.ndcSpaceAxisAlignedBoundingBox);let y=i.uniformState.inverseView,A=M.multiplyTransformation(this._transformPositionWorldToLocal,y,n.transformPositionViewToLocal);this._transformPlaneLocalToView=M.transpose(A,this._transformPlaneLocalToView);let b=i.uniformState.inverseViewRotation;n.transformDirectionViewToLocal=$.multiply(this._transformDirectionWorldToLocal,b,n.transformDirectionViewToLocal),n.cameraPositionLocal=M.multiplyByPoint(this._transformPositionWorldToLocal,e.camera.positionWC,n.cameraPositionLocal),n.cameraDirectionLocal=$.multiplyByVector(this._transformDirectionWorldToLocal,e.camera.directionWC,n.cameraDirectionLocal);let x=Skt(this,n.cameraPositionLocal,Ekt);n.cameraTileCoordinates=se.fromElements(Math.floor(x.x),Math.floor(x.y),Math.floor(x.z),x.w,n.cameraTileCoordinates),n.cameraTileUv=h.fromElements(x.x-Math.floor(x.x),x.y-Math.floor(x.y),x.z-Math.floor(x.z),n.cameraTileUv),n.stepSize=this._stepSizeMultiplier,Ckt(this),vkt(this,e);let T=e.passes.pick?this._drawCommandPick:e.passes.pickVoxel?this._drawCommandPickVoxel:this._drawCommand;T.boundingVolume=this._shape.boundingSphere,e.commandList.push(T)};function Ckt(e){let{megatextures:t}=e._traversal;for(let n=0;n<t.length;++n)t[n].nearestSampling=e._nearestSampling}function vkt(e,t){let n=e._uniforms,{renderBoundPlanes:i}=e._shape;l(i)&&(i.update(t,e._transformPlaneLocalToView),n.renderBoundPlanesTexture=i.texture)}function Skt(e,t,n){let i=e._shape.convertLocalToShapeUvSpace(t,Tkt),r=e._availableLevels,o=2**(r-1);return se.fromElements(i.x*o,i.y*o,i.z*o,r-1,n)}var wkt=new h,tse=new h,Ikt=new he;function Pkt(e,t){let{verticalExaggeration:n,verticalExaggerationRelativeHeight:i}=t;return e._verticalExaggeration===n&&e._verticalExaggerationRelativeHeight===i?!1:(e._verticalExaggeration=n,e._verticalExaggerationRelativeHeight=i,!0)}function Dkt(e,t,n){let i=e._uniforms;e._pickId=n.createPickId({primitive:e}),i.pickColor=z.clone(e._pickId.color,i.pickColor);let r=t.keyframeCount??1;e._traversal=new C9(e,n,r),e.statistics.texturesByteLength=e._traversal.textureMemoryByteLength,Ukt(e._traversal,i)}function tLe(e){return gM(e,"_modelMatrix","_modelMatrixOld")+gM(e,"_minBounds","_minBoundsOld")+gM(e,"_maxBounds","_maxBoundsOld")+gM(e,"_minClippingBounds","_minClippingBoundsOld")+gM(e,"_maxClippingBounds","_maxClippingBoundsOld")>0}function gM(e,t,n){let i=e[t],r=e[n],o=!i.equals(r);return o&&i.clone(r),o?1:0}var Rkt=new h,Okt=new h,Mkt=new h,Nkt=new h,Lkt=new M,Fkt=new M;function nLe(e){let t=e._verticalExaggeration,n=e._verticalExaggerationRelativeHeight,i=h.clone(e._minBounds,Rkt),r=h.clone(e._maxBounds,Okt),o=h.clone(e._minClippingBounds,Mkt),s=h.clone(e._maxClippingBounds,Nkt),a=M.clone(e._modelMatrix,Lkt);if(e.shape===Dc.ELLIPSOID)i.z=br.getHeight(e._minBounds.z,t,n),r.z=br.getHeight(e._maxBounds.z,t,n),o.z=br.getHeight(e._minClippingBounds.z,t,n),s.z=br.getHeight(e._maxClippingBounds.z,t,n);else{let m=h.fromElements(1,1,t,wkt);M.multiplyByScale(a,m,a),M.multiplyByTranslation(a,kkt(e),a)}let c=e._provider,u=c.shapeTransform??M.IDENTITY,f=c.globalTransform??M.IDENTITY,d=M.multiplyTransformation(f,a,Fkt);M.multiplyTransformation(d,u,d);let p=e._shape;return p.update(d,i,r,o,s)?(e._transformPositionLocalToWorld=M.clone(p.shapeTransform,e._transformPositionLocalToWorld),e._transformPositionWorldToLocal=M.inverse(e._transformPositionLocalToWorld,e._transformPositionWorldToLocal),e._transformDirectionWorldToLocal=M.getMatrix3(e._transformPositionWorldToLocal,e._transformDirectionWorldToLocal),!0):!1}var Bkt=new h;function kkt(e){let t=e._verticalExaggeration,n=e._verticalExaggerationRelativeHeight,{shapeTransform:i=M.IDENTITY,globalTransform:r=M.IDENTITY}=e._provider,o=M.getTranslation(i,tse),s=M.multiplyByPoint(e._modelMatrix,o,tse),a=M.multiplyByPoint(r,s,tse),u=ee.WGS84.cartesianToCartographic(a,Ikt),f=0;l(u)&&(f=u.height);let d=br.getHeight(f,t,n);return h.fromElements(0,0,(d-f)/t,Bkt)}function Ukt(e,t){t.octreeInternalNodeTexture=e.internalNodeTexture,t.octreeInternalNodeTexelSizeUv=U.clone(e.internalNodeTexelSizeUv,t.octreeInternalNodeTexelSizeUv),t.octreeInternalNodeTilesPerRow=e.internalNodeTilesPerRow;let{megatextures:n}=e,i=n[0];t.megatextureTextures=new Array(n.length);for(let r=0;r<n.length;r++)t.megatextureTextures[r]=n[r].texture;t.megatextureTileCounts=h.clone(i.tileCounts,t.megatextureTileCounts)}function zkt(e){let{shaderDefines:t}=e._shape,n=Object.keys(t).some(i=>t[i]!==e._shapeDefinesOld[i]);return n&&(e._shapeDefinesOld=Ze(t,!0)),n}function Vkt(e,t){if(!l(e)||!l(t))return 0;let n=t.currentTime,i,r=e.indexOf(n);r>=0?i=e.get(r):(r=~r,r===e.length?(r=e.length-1,i=e.get(r),n=i.stop):(i=e.get(r),n=i.start));let o=K.secondsDifference(i.stop,i.start),a=K.secondsDifference(n,i.start)/o;return r+a}function jkt(e,t){let n=e.clippingPlanes;if(!l(n))return!1;n.update(t);let{clippingPlanesState:i,enabled:r}=n;if(r){let o=e._uniforms;o.clippingPlanesTexture=n.texture,o.clippingPlanesMatrix=M.transpose(M.multiplyTransformation(M.inverse(n.modelMatrix,o.clippingPlanesMatrix),e._transformPositionLocalToWorld,o.clippingPlanesMatrix),o.clippingPlanesMatrix)}return e._clippingPlanesState===i&&e._clippingPlanesEnabled===r?!1:(e._clippingPlanesState=i,e._clippingPlanesEnabled=r,!0)}g0.prototype.isDestroyed=function(){return!1};g0.prototype.destroy=function(){let e=this._drawCommand;l(e)&&(e.shaderProgram=e.shaderProgram&&e.shaderProgram.destroy());let t=this._drawCommandPick;return l(t)&&(t.shaderProgram=t.shaderProgram&&t.shaderProgram.destroy()),this._pickId=this._pickId&&this._pickId.destroy(),this._traversal=this._traversal&&this._traversal.destroy(),this.statistics.texturesByteLength=0,this._clippingPlanes=this._clippingPlanes&&this._clippingPlanes.destroy(),le(this)};var eLe=new Array(new se(-1,-1,-1,1),new se(1,-1,-1,1),new se(-1,1,-1,1),new se(1,1,-1,1),new se(-1,-1,1,1),new se(1,-1,1,1),new se(-1,1,1,1),new se(1,1,1,1)),Hkt=new Array(1,2,4,0,3,5,0,3,6,1,2,7,0,5,6,1,4,7,2,4,7,3,5,6),Gkt=new Array(new se,new se,new se,new se,new se,new se,new se,new se);function Wkt(e,t,n){let i=M.fromRotationTranslation(e.halfAxes,e.center,bkt),r=M.multiply(t,i,xkt),o=+Number.MAX_VALUE,s=-Number.MAX_VALUE,a=+Number.MAX_VALUE,c=-Number.MAX_VALUE,u,f=Gkt,d=eLe.length;for(u=0;u<d;u++)M.multiplyByVector(r,eLe[u],f[u]);for(u=0;u<d;u++){let p=f[u];if(p.z>=-p.w){let g=p.x/p.w,m=p.y/p.w;o=Math.min(o,g),s=Math.max(s,g),a=Math.min(a,m),c=Math.max(c,m)}else for(let g=0;g<3;g++){let m=Hkt[u*3+g],y=f[m];if(y.z>=-y.w){let A=p.z+p.w,b=y.z+y.w,x=A/(A-b),T=se.lerp(p,y,x,ykt),E=T.x/T.w,v=T.y/T.w;o=Math.min(o,E),s=Math.max(s,E),a=Math.min(a,v),c=Math.max(c,v)}}}return o=P.clamp(o,-1,1),a=P.clamp(a,-1,1),s=P.clamp(s,-1,1),c=P.clamp(c,-1,1),n=se.fromElements(o,a,s,c,n),n}var nse=3e7,qkt=new h(nse,0,0),Ykt=new h(0,nse,0),Xkt=new h(0,0,nse);function Kkt(e,t){let n=e._traversal,i=e._debugPolylines;i.removeAll();function r(c,u,f,d){i.add({positions:[c,u],width:d,material:ir.fromType("Color",{color:f})})}function o(c,u,f){let d=c.computeCorners();r(d[0],d[1],u,f),r(d[2],d[3],u,f),r(d[4],d[5],u,f),r(d[6],d[7],u,f),r(d[0],d[2],u,f),r(d[4],d[6],u,f),r(d[1],d[3],u,f),r(d[5],d[7],u,f),r(d[0],d[4],u,f),r(d[2],d[6],u,f),r(d[1],d[5],u,f),r(d[3],d[7],u,f)}function s(c){if(!n.isRenderable(c))return;let u=c.level,d=Math.max(1,5/Math.pow(2,u)),g=[z.RED,z.LIME,z.BLUE][u%3];if(o(c.orientedBoundingBox,g,d),l(c.children))for(let m=0;m<8;m++)s(c.children[m])}o(e._shape.orientedBoundingBox,z.WHITE,5),s(n.rootNode);let a=10;r(h.ZERO,qkt,z.RED,a),r(h.ZERO,Ykt,z.LIME,a),r(h.ZERO,Xkt,z.BLUE,a),i.update(t)}g0.DefaultCustomShader=new u_({fragmentShaderText:`void fragmentMain(FragmentInput fsInput, inout czm_modelMaterial material) + return texture(packedPlanes, vec2(u, v));`}var iG=v1t;function Zg(e){let{loader:t,metadata:n}=e;this._loader=t,this._metadata=n,this._resourcesLoaded=!1,this._ready=!1}Object.defineProperties(Zg.prototype,{ready:{get:function(){return this._ready}},metadata:{get:function(){return this._metadata}}});Zg.fromMetadataArray=function(e){return new Zg({metadata:e})};Zg.fromGltf=async function(e){let t=new wd({gltfResource:e,releaseGltfJson:!1,loadAttributesAsTypedArray:!0});try{await t.load()}catch(n){throw t.destroy(),n}return new Zg({loader:t})};Zg.prototype.update=function(e,t){let n=this._loader;if(!this._ready){if(t.afterRender.push(()=>!0),!l(n)){this._ready=!0;return}if(this._resourcesLoaded){let{structuralMetadata:i,scene:r}=n.components,{attributes:o}=r.nodes[0].primitives[0];this._metadata=S1t(o,i,e),this._ready=!0;return}this._resourcesLoaded=n.process(t)}};function S1t(e,t,n){let{className:i,names:r,types:o,componentTypes:s}=n.provider,a=t.propertyAttributes.find(f=>f.class.id===i),{properties:c}=a,u=new Array(r.length);for(let f=0;f<e.length;f++){let d=c[r[f]].attribute,p=e.find(A=>A.name===d);if(!l(p))continue;let g=Lt.toComponentDatatype(s[f]),m=bt.getComponentCount(o[f]),y=p.count*m;u[f]=Y.createArrayBufferView(g,p.typedArray.buffer,p.typedArray.byteOffset+p.byteOffset,y)}return u}Zg.prototype.isDestroyed=function(){return!1};Zg.prototype.destroy=function(){return this._loader=this._loader&&this._loader.destroy(),le(this)};var uw=Zg;function fl(){this._orientedBoundingBox=new en,this._boundingSphere=new ue,this._boundTransform=new M,this._shapeTransform=new M,this._minBounds=fl.DefaultMinBounds.clone(),this._maxBounds=fl.DefaultMaxBounds.clone(),this._renderMinBounds=fl.DefaultMinBounds.clone(),this._renderMaxBounds=fl.DefaultMaxBounds.clone();let{DefaultMinBounds:e,DefaultMaxBounds:t}=fl,n=[new fa(h.negate(h.UNIT_X,new h),e.x),new fa(h.negate(h.UNIT_Y,new h),e.y),new fa(h.negate(h.UNIT_Z,new h),e.z),new fa(h.UNIT_X,-t.x),new fa(h.UNIT_Y,-t.y),new fa(h.UNIT_Z,-t.z)];this._renderBoundPlanes=new vA({planes:n}),this._localToShapeUvTranslate=new h,this._shaderUniforms={boxEcToXyz:new $,boxLocalToShapeUvScale:new h},this._shaderDefines={BOX_INTERSECTION_INDEX:void 0},this._shaderMaximumIntersectionsLength=0}Object.defineProperties(fl.prototype,{orientedBoundingBox:{get:function(){return this._orientedBoundingBox}},renderBoundPlanes:{get:function(){return this._renderBoundPlanes}},boundingSphere:{get:function(){return this._boundingSphere}},boundTransform:{get:function(){return this._boundTransform}},shapeTransform:{get:function(){return this._shapeTransform}},shaderUniforms:{get:function(){return this._shaderUniforms}},shaderDefines:{get:function(){return this._shaderDefines}},shaderMaximumIntersectionsLength:{get:function(){return this._shaderMaximumIntersectionsLength}}});var w1t=new h,I1t=new h,P1t=new $,D1t=new h,R1t=new h;fl.prototype.update=function(e,t,n,i,r){i=i??t.clone(D1t),r=r??n.clone(R1t),t=h.clone(t,this._minBounds),n=h.clone(n,this._maxBounds);let o=h.clamp(t,i,r,this._renderMinBounds),s=h.clamp(n,i,r,this._renderMaxBounds),a=M.getScale(e,I1t);if(o.x>s.x||o.y>s.y||o.z>s.z||(o.x===s.x)+(o.y===s.y)+(o.z===s.z)>=2||a.x===0||a.y===0||a.z===0)return!1;let c=this._renderBoundPlanes;c.get(0).distance=o.x,c.get(1).distance=o.y,c.get(2).distance=o.z,c.get(3).distance=-s.x,c.get(4).distance=-s.y,c.get(5).distance=-s.z,this._shapeTransform=M.clone(e,this._shapeTransform),this._orientedBoundingBox=One(o,s,this._shapeTransform,this._orientedBoundingBox),this._boundTransform=M.fromRotationTranslation(this._orientedBoundingBox.halfAxes,this._orientedBoundingBox.center,this._boundTransform),this._boundingSphere=ue.fromOrientedBoundingBox(this._orientedBoundingBox,this._boundingSphere);let u=this._shaderUniforms,f=this._shaderDefines;for(let y in f)f.hasOwnProperty(y)&&(f[y]=void 0);let d=0;f.BOX_INTERSECTION_INDEX=d,d+=1;let p=t,g=n,m=h.fromElements(Dne(p.x,g.x),Dne(p.y,g.y),Dne(p.z,g.z),u.boxLocalToShapeUvScale);return this._localToShapeUvTranslate=h.negate(h.multiplyComponents(m,p,this._localToShapeUvTranslate),this._localToShapeUvTranslate),this._shaderMaximumIntersectionsLength=d,!0};function Dne(e,t){return P.equalsEpsilon(e,t,P.EPSILON7)?1:1/(t-e)}var O1t=new M;fl.prototype.updateViewTransforms=function(e){let t=this._shaderUniforms,n=M.inverse(this._shapeTransform,O1t),i=M.getMatrix3(n,t.boxEcToXyz),r=e.context.uniformState.inverseViewRotation;$.multiply(i,r,t.boxEcToXyz)};fl.prototype.convertLocalToShapeUvSpace=function(e,t){let{boxLocalToShapeUvScale:n}=this._shaderUniforms,i=this._localToShapeUvTranslate;return h.add(h.multiplyComponents(e,n,t),i,t)};var rG=new h,Rne=new h;fl.prototype.computeOrientedBoundingBoxForTile=function(e,t,n,i,r){let o=this._minBounds,s=this._maxBounds,a=1/Math.pow(2,e),c=h.fromElements(P.lerp(o.x,s.x,a*t),P.lerp(o.y,s.y,a*n),P.lerp(o.z,s.z,a*i),rG),u=h.fromElements(P.lerp(o.x,s.x,a*(t+1)),P.lerp(o.y,s.y,a*(n+1)),P.lerp(o.z,s.z,a*(i+1)),Rne);return One(c,u,this._shapeTransform,r)};var LPe=new h;fl.prototype.computeOrientedBoundingBoxForSample=function(e,t,n,i){let r=1/Math.pow(2,e.level),o=h.divideComponents(h.ONE,t,LPe),s=h.multiplyByScalar(o,r,LPe),a=h.multiplyByScalar(h.fromElements(e.x+n.x,e.y+n.y,e.z+n.z,rG),r,rG),c=h.add(a,s,Rne),u=this._minBounds,f=this._maxBounds,d=h.fromElements(P.lerp(u.x,f.x,a.x),P.lerp(u.y,f.y,a.y),P.lerp(u.z,f.z,a.z),rG),p=h.fromElements(P.lerp(u.x,f.x,c.x),P.lerp(u.y,f.y,c.y),P.lerp(u.z,f.z,c.z),Rne);return One(d,p,this._shapeTransform,i)};fl.DefaultMinBounds=Object.freeze(new h(-1,-1,-1));fl.DefaultMaxBounds=Object.freeze(new h(1,1,1));var FPe=new h;function One(e,t,n,i){let r=fl.DefaultMinBounds,o=fl.DefaultMaxBounds;if(h.equals(e,r)&&h.equals(t,o))i.center=M.getTranslation(n,i.center),i.halfAxes=M.getMatrix3(n,i.halfAxes);else{let a=M.getScale(n,FPe),c=h.midpoint(e,t,w1t);i.center=M.multiplyByPoint(n,c,i.center),a=h.fromElements(a.x*.5*(t.x-e.x),a.y*.5*(t.y-e.y),a.z*.5*(t.z-e.z),FPe);let u=M.getRotation(n,P1t);i.halfAxes=$.setScale(u,a,i.halfAxes)}return i}var fw=fl;function Nf(){this._orientedBoundingBox=new en,this._boundingSphere=new ue,this._boundTransform=new M,this._shapeTransform=new M,this._minBounds=Nf.DefaultMinBounds.clone(),this._maxBounds=Nf.DefaultMaxBounds.clone();let{DefaultMinBounds:e,DefaultMaxBounds:t}=Nf,n=[new fa(h.negate(h.UNIT_Z,new h),e.z),new fa(h.UNIT_Z,-t.z)];this._renderBoundPlanes=new vA({planes:n}),this._localToShapeUvTranslate=new h,this._shaderUniforms={cameraShapePosition:new h,cylinderEcToRadialTangentUp:new $,cylinderRenderRadiusMinMax:new U,cylinderRenderAngleMinMax:new U,cylinderLocalToShapeUvScale:new h,cylinderShapeUvAngleRangeOrigin:0},this._shaderDefines={CYLINDER_HAS_SHAPE_BOUNDS_ANGLE:void 0,CYLINDER_HAS_RENDER_BOUNDS_RADIUS_MIN:void 0,CYLINDER_HAS_RENDER_BOUNDS_RADIUS_FLAT:void 0,CYLINDER_HAS_RENDER_BOUNDS_ANGLE:void 0,CYLINDER_HAS_RENDER_BOUNDS_ANGLE_RANGE_EQUAL_ZERO:void 0,CYLINDER_HAS_RENDER_BOUNDS_ANGLE_RANGE_UNDER_HALF:void 0,CYLINDER_HAS_RENDER_BOUNDS_ANGLE_RANGE_OVER_HALF:void 0,CYLINDER_INTERSECTION_INDEX_RADIUS_MAX:void 0,CYLINDER_INTERSECTION_INDEX_RADIUS_MIN:void 0,CYLINDER_INTERSECTION_INDEX_ANGLE:void 0},this._shaderMaximumIntersectionsLength=0}Object.defineProperties(Nf.prototype,{orientedBoundingBox:{get:function(){return this._orientedBoundingBox}},renderBoundPlanes:{get:function(){return this._renderBoundPlanes}},boundingSphere:{get:function(){return this._boundingSphere}},boundTransform:{get:function(){return this._boundTransform}},shapeTransform:{get:function(){return this._shapeTransform}},shaderUniforms:{get:function(){return this._shaderUniforms}},shaderDefines:{get:function(){return this._shaderDefines}},shaderMaximumIntersectionsLength:{get:function(){return this._shaderMaximumIntersectionsLength}}});var M1t=new h,N1t=new h,L1t=new h,F1t=new h,B1t=new h,k1t=new M,U1t=new h,BPe=new U;Nf.prototype.update=function(e,t,n,i,r){i=i??t.clone(N1t),r=r??n.clone(L1t),t=h.clone(t,this._minBounds),n=h.clone(n,this._maxBounds);let{DefaultMinBounds:o,DefaultMaxBounds:s}=Nf,a=s.y-o.y,c=.5*a,u=P.EPSILON10,f=P.EPSILON10;t.x=Math.max(0,t.x),n.x=Math.max(0,n.x),t.y=P.negativePiToPi(t.y),n.y=P.negativePiToPi(n.y),i.y=P.negativePiToPi(i.y),r.y=P.negativePiToPi(r.y);let d=h.maximumByComponent(t,i,F1t),p=h.minimumByComponent(n,r,B1t),g=M.getScale(e,M1t);if(p.x===0||d.x>p.x||d.z>p.z||P.equalsEpsilon(g.x,0,void 0,u)||P.equalsEpsilon(g.y,0,void 0,u)||P.equalsEpsilon(g.z,0,void 0,u))return!1;let m=this._renderBoundPlanes;m.get(0).distance=d.z,m.get(1).distance=-p.z,this._shapeTransform=M.clone(e,this._shapeTransform),this._orientedBoundingBox=Lne(d,p,this._shapeTransform,this._orientedBoundingBox),this._boundTransform=M.fromRotationTranslation(this._orientedBoundingBox.halfAxes,this._orientedBoundingBox.center,this._boundTransform),this._boundingSphere=ue.fromOrientedBoundingBox(this._orientedBoundingBox,this._boundingSphere);let y=n.y<t.y,A=n.y-t.y+y*a,b=p.y<d.y,x=p.y-d.y+b*a,T=x>=c-f&&x<a-f,E=x>f&&x<c-f,v=x<=f,S=T||E||v,I=this._shaderUniforms,R=this._shaderDefines;for(let q in R)R.hasOwnProperty(q)&&(R[q]=void 0);let O=0;R.CYLINDER_INTERSECTION_INDEX_RADIUS_MAX=O,O+=1,A<a-f&&(R.CYLINDER_HAS_SHAPE_BOUNDS_ANGLE=!0),d.x!==o.x&&(R.CYLINDER_HAS_RENDER_BOUNDS_RADIUS_MIN=!0,R.CYLINDER_INTERSECTION_INDEX_RADIUS_MIN=O,O+=1),I.cylinderRenderRadiusMinMax=U.fromElements(d.x,p.x,I.cylinderRenderRadiusMinMax),d.x===p.x&&(R.CYLINDER_HAS_RENDER_BOUNDS_RADIUS_FLAT=!0);let L=n.x-t.x,_=0,C=1;L!==0&&(_=1/L,C=-t.x*_);let w=n.z-t.z,D=0,N=1;w!==0&&(D=1/w,N=-t.z*D),S&&(R.CYLINDER_HAS_RENDER_BOUNDS_ANGLE=!0,R.CYLINDER_INTERSECTION_INDEX_ANGLE=O,T?(R.CYLINDER_HAS_RENDER_BOUNDS_ANGLE_RANGE_UNDER_HALF=!0,O+=1):E?(R.CYLINDER_HAS_RENDER_BOUNDS_ANGLE_RANGE_OVER_HALF=!0,O+=2):v&&(R.CYLINDER_HAS_RENDER_BOUNDS_ANGLE_RANGE_EQUAL_ZERO=!0,O+=2),I.cylinderRenderAngleMinMax=U.fromElements(d.y,p.y,I.cylinderRenderAngleMinMax));let F=(t.y-o.y)/a,V=(n.y-o.y)/a,B=1-A/a,j=(V+.5*B)%1;I.cylinderShapeUvAngleRangeOrigin=j;let k=0,G=1;if(A>f){k=a/A;let q=F-j;G=-k*(q-Math.floor(q))}return I.cylinderLocalToShapeUvScale=h.fromElements(_,k,D,I.cylinderLocalToShapeUvScale),this._localToShapeUvTranslate=h.fromElements(C,G,N,this._localToShapeUvTranslate),this._shaderMaximumIntersectionsLength=O,!0};var z1t=new $,V1t=new $,j1t=new M;Nf.prototype.updateViewTransforms=function(e){let t=this._shaderUniforms,n=M.inverse(this._shapeTransform,k1t),i=M.multiplyByPoint(n,e.camera.positionWC,U1t);t.cameraShapePosition=h.fromElements(U.magnitude(i),Math.atan2(i.y,i.x),i.z,t.cameraShapePosition);let r=U.normalize(U.fromCartesian3(i,BPe),BPe),o=$.fromRowMajorArray([r.x,r.y,0,-r.y,r.x,0,0,0,1],z1t),s=e.context.uniformState.inverseView,a=M.multiplyTransformation(n,s,j1t),c=M.getMatrix3(a,V1t);t.cylinderEcToRadialTangentUp=$.multiply(o,c,t.cylinderEcToRadialTangentUp)};Nf.prototype.convertLocalToShapeUvSpace=function(e,t){let n=Math.hypot(e.x,e.y),i=Math.atan2(e.y,e.x),r=e.z,{cylinderLocalToShapeUvScale:o,cylinderShapeUvAngleRangeOrigin:s}=this._shaderUniforms,a=this._localToShapeUvTranslate;return n=n*o.x+a.x,i=(i+Math.PI)/(2*Math.PI),i-=s,i=i-Math.floor(i),i=i*o.y+a.y,r=r*o.z+a.z,h.fromElements(n,i,r,t)};var oG=new h,Nne=new h;Nf.prototype.computeOrientedBoundingBoxForTile=function(e,t,n,i,r){let o=this._minBounds,s=this._maxBounds,a=1/Math.pow(2,e),c=h.fromElements(P.lerp(o.x,s.x,t*a),P.lerp(o.y,s.y,n*a),P.lerp(o.z,s.z,i*a),oG),u=h.fromElements(P.lerp(o.x,s.x,(t+1)*a),P.lerp(o.y,s.y,(n+1)*a),P.lerp(o.z,s.z,(i+1)*a),Nne);return Lne(c,u,this._shapeTransform,r)};var kPe=new h;Nf.prototype.computeOrientedBoundingBoxForSample=function(e,t,n,i){let r=1/Math.pow(2,e.level),o=h.divideComponents(h.ONE,t,kPe),s=h.multiplyByScalar(o,r,kPe),a=h.multiplyByScalar(h.fromElements(e.x+n.x,e.y+n.y,e.z+n.z,oG),r,oG),c=h.add(a,s,Nne),u=this._minBounds,f=this._maxBounds,d=h.fromElements(P.lerp(u.x,f.x,a.x),P.lerp(u.y,f.y,a.y),P.lerp(u.z,f.z,a.z),oG),p=h.fromElements(P.lerp(u.x,f.x,c.x),P.lerp(u.y,f.y,c.y),P.lerp(u.z,f.z,c.z),Nne);return Lne(d,p,this._shapeTransform,i)};Nf.DefaultMinBounds=Object.freeze(new h(0,-P.PI,-1));Nf.DefaultMaxBounds=Object.freeze(new h(1,+P.PI,1));var H1t=5,G1t=new Array(H1t),W1t=new h,q1t=new $,Y1t=new M,X1t=new M,K1t=new M,Mne=new M,$1t=new h,J1t=new h,Z1t=new h,zPe=new Array(8);for(let e=0;e<8;e++)zPe[e]=new h;function UPe(e,t,n){return Math.abs(se.dot(e,t))<n}function Q1t(e){let t=M.getColumn(e,0,$1t),n=M.getColumn(e,1,J1t),i=M.getColumn(e,2,Z1t),r=P.EPSILON4;return UPe(t,n,r)&&UPe(n,i,r)}function eRt(e,t){let n=zPe;h.fromElements(-.5,-.5,-.5,n[0]),h.fromElements(-.5,-.5,.5,n[1]),h.fromElements(-.5,.5,-.5,n[2]),h.fromElements(-.5,.5,.5,n[3]),h.fromElements(.5,-.5,-.5,n[4]),h.fromElements(.5,-.5,.5,n[5]),h.fromElements(.5,.5,-.5,n[6]),h.fromElements(.5,.5,.5,n[7]);for(let i=0;i<8;++i)M.multiplyByPoint(e,n[i],n[i]);return en.fromPoints(n,t)}var tRt=new h;function Lne(e,t,n,i){let r=e.x,o=t.x,s=e.y,a=t.y<s?t.y+P.TWO_PI:t.y,c=e.z,u=t.z,f=a-s,d=s+f*.5,p=G1t,g=0;p[g++]=s,p[g++]=a,p[g++]=d,f>P.PI&&(p[g++]=d-P.PI_OVER_TWO,p[g++]=d+P.PI_OVER_TWO);let m=Number.POSITIVE_INFINITY,y=Number.POSITIVE_INFINITY,A=Number.NEGATIVE_INFINITY,b=Number.NEGATIVE_INFINITY;for(let F=0;F<g;++F){let V=p[F]-d,B=Math.cos(V),j=Math.sin(V),k=B*r,G=j*r,q=B*o,Q=j*o;m=Math.min(m,k,q),y=Math.min(y,G,Q),A=Math.max(A,k,q),b=Math.max(b,G,Q)}let x=A-m,T=b-y,E=u-c,v=(m+A)*.5,S=(y+b)*.5,I=(c+u)*.5,R=h.fromElements(v,S,I,W1t),O=$.fromRotationZ(d,q1t),L=h.fromElements(x,T,E,tRt),_=M.fromScale(L,K1t),C=M.fromRotation(O,X1t),w=M.fromTranslation(R,Y1t),D=M.multiplyTransformation(C,M.multiplyTransformation(w,_,Mne),Mne),N=M.multiplyTransformation(n,D,Mne);return Q1t(N)?en.fromTransformation(N,i):eRt(N,i)}var dw=Nf;function Jd(){this._orientedBoundingBox=new en,this._boundingSphere=new ue,this._boundTransform=new M,this._shapeTransform=new M,this._rectangle=new ie,this._minimumHeight=Jd.DefaultMinBounds.z,this._maximumHeight=Jd.DefaultMaxBounds.z,this._ellipsoid=new ee,this._translation=new h,this._rotation=new $,this._localToShapeUvTranslate=new h,this._shaderUniforms={cameraPositionCartographic:new h,ellipsoidEcToEastNorthUp:new $,ellipsoidRadii:new h,eccentricitySquared:0,evoluteScale:new U,ellipsoidCurvatureAtLatitude:new U,ellipsoidInverseRadiiSquared:new h,ellipsoidRenderLongitudeMinMax:new U,ellipsoidShapeUvLongitudeRangeOrigin:0,ellipsoidShapeUvLongitudeMinMaxMid:new h,ellipsoidLocalToShapeUvScale:new h,ellipsoidRenderLatitudeSinMinMax:new U,clipMinMaxHeight:new U},this._shaderDefines={ELLIPSOID_HAS_RENDER_BOUNDS_LONGITUDE:void 0,ELLIPSOID_HAS_RENDER_BOUNDS_LONGITUDE_RANGE_EQUAL_ZERO:void 0,ELLIPSOID_HAS_RENDER_BOUNDS_LONGITUDE_RANGE_UNDER_HALF:void 0,ELLIPSOID_HAS_RENDER_BOUNDS_LONGITUDE_RANGE_OVER_HALF:void 0,ELLIPSOID_HAS_SHAPE_BOUNDS_LONGITUDE:void 0,ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MAX_UNDER_HALF:void 0,ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MAX_EQUAL_HALF:void 0,ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MAX_OVER_HALF:void 0,ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MIN_UNDER_HALF:void 0,ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MIN_EQUAL_HALF:void 0,ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MIN_OVER_HALF:void 0,ELLIPSOID_HAS_SHAPE_BOUNDS_LATITUDE:void 0,ELLIPSOID_INTERSECTION_INDEX_LONGITUDE:void 0,ELLIPSOID_INTERSECTION_INDEX_LATITUDE_MAX:void 0,ELLIPSOID_INTERSECTION_INDEX_LATITUDE_MIN:void 0,ELLIPSOID_INTERSECTION_INDEX_HEIGHT_MAX:void 0,ELLIPSOID_INTERSECTION_INDEX_HEIGHT_MIN:void 0},this._shaderMaximumIntersectionsLength=0}Object.defineProperties(Jd.prototype,{orientedBoundingBox:{get:function(){return this._orientedBoundingBox}},boundingSphere:{get:function(){return this._boundingSphere}},boundTransform:{get:function(){return this._boundTransform}},shapeTransform:{get:function(){return this._shapeTransform}},shaderUniforms:{get:function(){return this._shaderUniforms}},shaderDefines:{get:function(){return this._shaderDefines}},shaderMaximumIntersectionsLength:{get:function(){return this._shaderMaximumIntersectionsLength}}});var nRt=new h,iRt=new h,rRt=new h,oRt=new h,sRt=new h,aRt=new h,cRt=new h,lRt=new h,VPe=new h,jPe=new h,uRt=new ie;Jd.prototype.update=function(e,t,n,i,r){let{DefaultMinBounds:o,DefaultMaxBounds:s}=Jd;i=i??o,r=r??s;let a=P.EPSILON10,c=P.EPSILON10,u=P.EPSILON10,f=P.EPSILON3,d=M.getScale(e,lRt),p=h.clone(o,nRt);p.z=-h.minimumComponent(d);let g=h.clamp(t,p,s,iRt),m=h.clamp(n,p,s,rRt),y=h.clamp(i,p,s,oRt),A=h.clamp(r,p,s,sRt),b=h.maximumByComponent(g,y,aRt),x=h.minimumByComponent(m,A,cRt),T=h.add(d,h.fromElements(m.z,m.z,m.z,VPe),VPe),E=h.add(d,h.fromElements(x.z,x.z,x.z,jPe),jPe);if(b.y>x.y||b.y===s.y||x.y===o.y||b.z>x.z||P.equalsEpsilon(E,h.ZERO,void 0,a))return!1;this._rectangle=ie.fromRadians(g.x,g.y,m.x,m.y),this._translation=M.getTranslation(e,this._translation),this._rotation=M.getRotation(e,this._rotation),this._ellipsoid=ee.fromCartesian3(d,this._ellipsoid),this._minimumHeight=g.z,this._maximumHeight=m.z;let v=ie.fromRadians(b.x,b.y,x.x,x.y,uRt);this._orientedBoundingBox=Fne(v,b.z,x.z,this._ellipsoid,this._translation,this._rotation,this._orientedBoundingBox),this._shapeTransform=M.fromRotationTranslation(this._rotation,this._translation,this._shapeTransform),this._boundTransform=M.fromRotationTranslation(this._orientedBoundingBox.halfAxes,this._orientedBoundingBox.center,this._boundTransform),this._boundingSphere=ue.fromOrientedBoundingBox(this._orientedBoundingBox,this._boundingSphere);let S=s.x-o.x,I=.5*S,R=x.x<b.x,O=x.x-b.x+R*S,L=O<=c,_=O>=I-c&&O<S-c,C=O>c&&O<I-c,w=L||_||C,D=m.x<g.x,N=m.x-g.x+D*S,F=N>I+c&&N<S-c,V=N>=I-c&&N<=I+c,B=N<I-c,j=F||V||B,k=x.y<-f,G=x.y>=-f&&x.y<=+f,q=x.y>+f&&x.y<s.y-u,Q=k||G||q,W=b.y>o.y+u&&b.y<-f,J=b.y>=-f&&b.y<=+f,Z=b.y>+f,ae=W||J||Z,Ae=Q||ae,fe=m.y-g.y,xe=m.y<-f,ge=m.y>=-f&&m.y<=+f,we=m.y>+f&&m.y<s.y-u,ve=xe||ge||we,Re=g.y>o.y+u&&g.y<-f,Qe=g.y>=-f&&g.y<=+f,He=g.y>+f,Ke=ve||(Re||Qe||He),Pe=this._shaderUniforms,qe=this._shaderDefines;for(let Yn in qe)qe.hasOwnProperty(Yn)&&(qe[Yn]=void 0);Pe.ellipsoidRadii=h.clone(T,Pe.ellipsoidRadii);let{x:st,z:vt}=Pe.ellipsoidRadii,jt=vt/st;Pe.eccentricitySquared=1-jt*jt,Pe.evoluteScale=U.fromElements((st*st-vt*vt)/st,(vt*vt-st*st)/vt,Pe.evoluteScale),Pe.ellipsoidInverseRadiiSquared=h.divideComponents(h.ONE,h.multiplyComponents(Pe.ellipsoidRadii,Pe.ellipsoidRadii,Pe.ellipsoidInverseRadiiSquared),Pe.ellipsoidInverseRadiiSquared);let lt=0;qe.ELLIPSOID_INTERSECTION_INDEX_HEIGHT_MAX=lt,lt+=1,qe.ELLIPSOID_INTERSECTION_INDEX_HEIGHT_MIN=lt,lt+=1,Pe.clipMinMaxHeight=U.fromElements(b.z-m.z,x.z-m.z,Pe.clipMinMaxHeight);let mt=m.z-g.z,ft=mt===0?0:1/mt;w&&(qe.ELLIPSOID_HAS_RENDER_BOUNDS_LONGITUDE=!0,qe.ELLIPSOID_INTERSECTION_INDEX_LONGITUDE=lt,_?(qe.ELLIPSOID_HAS_RENDER_BOUNDS_LONGITUDE_RANGE_UNDER_HALF=!0,lt+=1):C?(qe.ELLIPSOID_HAS_RENDER_BOUNDS_LONGITUDE_RANGE_OVER_HALF=!0,lt+=2):L&&(qe.ELLIPSOID_HAS_RENDER_BOUNDS_LONGITUDE_RANGE_EQUAL_ZERO=!0,lt+=2),Pe.ellipsoidRenderLongitudeMinMax=U.fromElements(b.x,x.x,Pe.ellipsoidRenderLongitudeMinMax));let Yt=0,rt=1;if(j){qe.ELLIPSOID_HAS_SHAPE_BOUNDS_LONGITUDE=!0;let Yn=(g.x-o.x)/S,yi=(m.x-o.x)/S,zi=1-N/S,Si=(yi+.5*zi)%1;if(Pe.ellipsoidShapeUvLongitudeRangeOrigin=Si,N>c){Yt=S/N;let ui=Yn-Si;rt=-Yt*(ui-Math.floor(ui))}}Ae&&(ae&&(qe.ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MIN=!0,qe.ELLIPSOID_INTERSECTION_INDEX_LATITUDE_MIN=lt,W?(qe.ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MIN_UNDER_HALF=!0,lt+=1):J?(qe.ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MIN_EQUAL_HALF=!0,lt+=1):Z&&(qe.ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MIN_OVER_HALF=!0,lt+=2)),Q&&(qe.ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MAX=!0,qe.ELLIPSOID_INTERSECTION_INDEX_LATITUDE_MAX=lt,k?(qe.ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MAX_UNDER_HALF=!0,lt+=2):G?(qe.ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MAX_EQUAL_HALF=!0,lt+=1):q&&(qe.ELLIPSOID_HAS_RENDER_BOUNDS_LATITUDE_MAX_OVER_HALF=!0,lt+=1)),Pe.ellipsoidRenderLatitudeSinMinMax=U.fromElements(Math.sin(b.y),Math.sin(x.y),Pe.ellipsoidRenderLatitudeSinMinMax));let ht=0,Li=1;return Ke&&(qe.ELLIPSOID_HAS_SHAPE_BOUNDS_LATITUDE=!0,fe>u&&(ht=(s.y-o.y)/fe,Li=(o.y-g.y)/fe)),Pe.ellipsoidLocalToShapeUvScale=h.fromElements(Yt,ht,ft,Pe.ellipsoidLocalToShapeUvScale),this._localToShapeUvTranslate=h.fromElements(rt,Li,0,this._localToShapeUvTranslate),this._shaderMaximumIntersectionsLength=lt,!0};var fRt=new he,dRt=new h,hRt=new M,HPe=new $;Jd.prototype.updateViewTransforms=function(e){let t=this._shaderUniforms,n=this._ellipsoid,i=e.camera.positionWC,r=n.cartesianToCartographic(i,fRt);h.fromElements(r.longitude,r.latitude,r.height,t.cameraPositionCartographic);let o=h.fromRadians(r.longitude,r.latitude,0,n,dRt);t.ellipsoidCurvatureAtLatitude=n.getLocalCurvature(o,t.ellipsoidCurvatureAtLatitude);let s=At.eastNorthUpToFixedFrame(o,n,hRt),a=M.getRotation(s,HPe),c=e.context.uniformState.viewRotation,u=$.multiply(c,a,HPe);t.ellipsoidEcToEastNorthUp=$.transpose(u,t.ellipsoidEcToEastNorthUp)};var $Pe=new ie;Jd.prototype.computeOrientedBoundingBoxForTile=function(e,t,n,i,r){let o=1/Math.pow(2,e),s=t*o,a=(t+1)*o,c=n*o,u=(n+1)*o,f=i*o,d=(i+1)*o,p=ie.subsection(this._rectangle,s,c,a,u,$Pe),g=P.lerp(this._minimumHeight,this._maximumHeight,f),m=P.lerp(this._minimumHeight,this._maximumHeight,d);return Fne(p,g,m,this._ellipsoid,this._translation,this._rotation,r)};var mRt=new U,pRt=new U,iO=new U,GPe=new U,WPe=new U,rO=new U;function gRt(e,t,n,i){let r=U.abs(e,mRt),o=U.fromElements(1/t.x,1/t.y,pRt),s=U.fromElements(Math.SQRT1_2,Math.SQRT1_2,iO),a=U.multiplyComponents(t,s,GPe),c=U.fromElements(n.x*s.x*s.x*s.x,n.y*s.y*s.y*s.y,WPe);for(let u=0;u<3;++u){let f=U.magnitude(U.subtract(a,c,rO)),d=U.normalize(U.subtract(r,c,rO),rO),p=U.multiplyByScalar(d,f,rO);s=U.multiplyComponents(U.add(p,c,iO),o,iO),s=U.normalize(U.clamp(s,U.ZERO,U.ONE,iO),iO),a=U.multiplyComponents(t,s,GPe),c=U.fromElements(n.x*s.x*s.x*s.x,n.y*s.y*s.y*s.y,WPe)}return h.fromElements(Math.sign(e.x)*a.x,Math.sign(e.y)*a.y,U.magnitude(U.subtract(a,c,rO)),i)}var _Rt=new U,qPe=new U,yRt=new h,YPe=new U;Jd.prototype.convertLocalToShapeUvSpace=function(e,t){let n=Math.atan2(e.y,e.x),{ellipsoidRadii:i,evoluteScale:r,ellipsoidInverseRadiiSquared:o,ellipsoidShapeUvLongitudeRangeOrigin:s,ellipsoidLocalToShapeUvScale:a}=this._shaderUniforms,c=this._localToShapeUvTranslate,u=Math.hypot(e.x,e.y),f=U.fromElements(u,e.z,qPe),d=gRt(f,U.fromElements(i.x,i.z,_Rt),r,yRt),p=U.normalize(U.fromElements(d.x*o.x,d.y*o.z,YPe),YPe),g=Math.atan2(p.y,p.x),m=U.magnitude(f)<U.magnitude(d)?-1:1,y=U.subtract(f,d,qPe),A=m*U.magnitude(y),{ELLIPSOID_HAS_SHAPE_BOUNDS_LONGITUDE:b,ELLIPSOID_HAS_SHAPE_BOUNDS_LATITUDE:x}=this._shaderDefines;return n=(n+Math.PI)/(2*Math.PI),l(b)&&(n-=s,n=n-Math.floor(n),n=n*a.x+c.x),g=(g+Math.PI/2)/Math.PI,l(x)&&(g=g*a.y+c.y),A=1+A*a.z,h.fromElements(n,g,A,t)};var XPe=new h,KPe=new h,ARt=new h;Jd.prototype.computeOrientedBoundingBoxForSample=function(e,t,n,i){let r=1/Math.pow(2,e.level),o=h.divideComponents(h.ONE,t,XPe),s=h.multiplyByScalar(o,r,XPe),a=h.multiplyByScalar(h.fromElements(e.x+n.x,e.y+n.y,e.z+n.z,KPe),r,KPe),c=h.add(a,s,ARt),u=ie.subsection(this._rectangle,a.x,a.y,c.x,c.y,$Pe),f=P.lerp(this._minimumHeight,this._maximumHeight,a.z),d=P.lerp(this._minimumHeight,this._maximumHeight,c.z);return Fne(u,f,d,this._ellipsoid,this._translation,this._rotation,i)};function Fne(e,t,n,i,r,o,s){return s=en.fromRectangle(e,t,n,i,s),s.center=h.add(s.center,r,s.center),s.halfAxes=$.multiply(s.halfAxes,o,s.halfAxes),s}Jd.DefaultMinBounds=Object.freeze(new h(-P.PI,-P.PI_OVER_TWO,-ee.WGS84.minimumRadius));Jd.DefaultMaxBounds=Object.freeze(new h(P.PI,P.PI_OVER_TWO,10*ee.WGS84.maximumRadius));var hw=Jd;var ju={BOX:"BOX",ELLIPSOID:"ELLIPSOID",CYLINDER:"CYLINDER"};ju.getMinBounds=function(e){switch(e){case ju.BOX:return fw.DefaultMinBounds;case ju.ELLIPSOID:return hw.DefaultMinBounds;case ju.CYLINDER:return dw.DefaultMinBounds}};ju.getMaxBounds=function(e){switch(e){case ju.BOX:return fw.DefaultMaxBounds;case ju.ELLIPSOID:return hw.DefaultMaxBounds;case ju.CYLINDER:return dw.DefaultMaxBounds}};ju.getShapeConstructor=function(e){switch(e){case ju.BOX:return fw;case ju.ELLIPSOID:return hw;case ju.CYLINDER:return dw}};Object.freeze(ju);var Ic=ju;function mm(e){this._comparator=e.comparator,this._maximumLength=e.maximumLength,this._array=l(e.maximumLength)?new Array(e.maximumLength):[],this._length=0}Object.defineProperties(mm.prototype,{length:{get:function(){return this._length}},maximumLength:{get:function(){return this._maximumLength},set:function(e){if(l(e)){for(;this._length>e;)this.removeMinimum();this._array.length=e}this._maximumLength=e}},internalArray:{get:function(){return this._array}},comparator:{get:function(){return this._comparator}}});mm.prototype.clone=function(){let e=this._maximumLength,t=this._comparator,n=this._array,i=this._length,r=new mm({comparator:t,maximumLength:e});r._length=i;for(let o=0;o<i;o++)r._array[o]=n[o];return r};mm.prototype.reset=function(){this._length=0;let e=this._maximumLength;if(l(e))for(let t=0;t<e;t++)this._array[t]=void 0;else this._array.length=0};mm.prototype.resort=function(){let e=this._length;for(let t=0;t<e;t++)JPe(this,t)};mm.prototype.insert=function(e){let t,n=this._maximumLength;if(l(n)){if(n===0)return;if(this._length===n){let r=this._array[0];if(this._comparator(e,r)<=0)return e;t=this.removeMinimum()}}let i=this._length;return this._array[i]=e,this._length++,JPe(this,i),t};mm.prototype.removeMinimum=function(){let e=this._length;if(e===0)return;this._length--;let t=this._array[0];return e>=2&&(this._array[0]=this._array[e-1],ZPe(this,0)),this._array[e-1]=void 0,t};mm.prototype.removeMaximum=function(){let e=this._length;if(e===0)return;this._length--;let t;if(e<=2)t=this._array[e-1];else{let n=Bne(this,1,2)?1:2;t=this._array[n],this._array[n]=this._array[e-1],e>=4&&ZPe(this,n)}return this._array[e-1]=void 0,t};mm.prototype.getMinimum=function(){if(this._length!==0)return this._array[0]};mm.prototype.getMaximum=function(){let e=this._length;if(e!==0)return e<=2?this._array[e-1]:this._array[Bne(this,1,2)?1:2]};function sG(e,t,n){let i=e._array,r=i[t];i[t]=i[n],i[n]=r}function oO(e,t,n){return e._comparator(e._array[t],e._array[n])<0}function Bne(e,t,n){return e._comparator(e._array[t],e._array[n])>0}function JPe(e,t){if(t===0)return;let n=Math.floor(P.log2(t+1))%2===0,i=Math.floor((t-1)/2),r=oO(e,t,i);for(r!==n&&(sG(e,t,i),t=i);t>=3;){let o=Math.floor((t-3)/4);if(oO(e,t,o)!==r)break;sG(e,t,o),t=o}}function ZPe(e,t){let n=e._length,i=Math.floor(P.log2(t+1))%2===0,r;for(;(r=2*t+1)<n;){let o=r,s=r+1;if(s<n){oO(e,s,o)===i&&(o=s);let a=2*r+1,c=Math.max(Math.min(n-a,4),0);for(let u=0;u<c;u++){let f=a+u;oO(e,f,o)===i&&(o=f)}}if(oO(e,o,t)===i&&(sG(e,o,t),o!==r&&o!==s)){let a=Math.floor((o-1)/2);Bne(e,o,a)===i&&sG(e,o,a)}t=o}}var SA=mm;var kne=Object.freeze({UNLOADED:0,RECEIVING:1,PROCESSING:2,LOADED:3,FAILED:4,UNAVAILABLE:5});function sO(e,t){this.spatialNode=e,this.keyframe=t,this.state=kne.UNLOADED,this.content=void 0,this.megatextureIndex=-1,this.priority=-Number.MAX_VALUE,this.highPriorityFrameNumber=-1}sO.prototype.unload=function(){this.content=this.content&&this.content.destroy(),this.spatialNode=void 0,this.state=kne.UNLOADED,this.megatextureIndex=-1,this.priority=-Number.MAX_VALUE,this.highPriorityFrameNumber=-1};sO.priorityComparator=function(e,t){return e.priority-t.priority};sO.searchComparator=function(e,t){return e.keyframe-t.keyframe};sO.LoadState=kne;var Gr=sO;function Qp(e,t,n,i,r=134217728,o){let s=bRt(i),a=xRt(n),c=n*Lt.getSizeInBytes(i),u=Qp.get3DTextureDimension(t,c,r,o),f=h.divideComponents(u,t,new h);this.channelCount=n,this.componentType=i,this.textureMemoryByteLength=c*u.x*u.y*u.z,this.tileCounts=h.clone(f,new h),this.voxelCountPerTile=h.clone(t,new h),this.maximumTileCount=f.x*f.y*f.z,this.texture=new d2({context:e,pixelFormat:a,pixelDatatype:s,flipY:!1,width:u.x,height:u.y,depth:u.z,sampler:new Ht({wrapR:hn.CLAMP_TO_EDGE,wrapS:hn.CLAMP_TO_EDGE,wrapT:hn.CLAMP_TO_EDGE,minificationFilter:Wt.LINEAR,magnificationFilter:Jn.LINEAR})}),this.nodes=new Array(this.maximumTileCount);for(let d=0;d<this.maximumTileCount;d++)this.nodes[d]=new TRt(d);for(let d=0;d<this.maximumTileCount;d++){let p=this.nodes[d];p.previousNode=d>0?this.nodes[d-1]:void 0,p.nextNode=d<this.maximumTileCount-1?this.nodes[d+1]:void 0}this.occupiedList=void 0,this.emptyList=this.nodes[0],this.occupiedCount=0,this._nearestSampling=!1}Object.defineProperties(Qp.prototype,{nearestSampling:{get:function(){return this._nearestSampling},set:function(e){this._nearestSampling!==e&&(e?this.texture.sampler=Ht.NEAREST:this.texture.sampler=new Ht({wrapR:hn.CLAMP_TO_EDGE,wrapS:hn.CLAMP_TO_EDGE,wrapT:hn.CLAMP_TO_EDGE,minificationFilter:Wt.LINEAR,magnificationFilter:Jn.LINEAR}),this._nearestSampling=e)}}});function bRt(e){if(e===Lt.FLOAT32||e===Lt.FLOAT64)return ze.FLOAT;if(e===Lt.UINT8)return ze.UNSIGNED_BYTE}function xRt(e){switch(e){case 1:return $e.RED;case 2:return $e.RG;case 3:return $e.RGB;case 4:return $e.RGBA}}function TRt(e){this.index=e,this.nextNode=void 0,this.previousNode=void 0}Qp.prototype.add=function(e){if(this.isFull())throw new pe("Trying to add when there are no empty spots");let t=this.emptyList;this.emptyList=this.emptyList.nextNode,l(this.emptyList)&&(this.emptyList.previousNode=void 0),t.nextNode=this.occupiedList,l(t.nextNode)&&(t.nextNode.previousNode=t),this.occupiedList=t;let n=t.index;return this.writeDataToTexture(n,e),this.occupiedCount++,n};Qp.prototype.remove=function(e){if(e<0||e>=this.maximumTileCount)throw new pe("Megatexture index out of bounds");let t=this.nodes[e];l(t.previousNode)&&(t.previousNode.nextNode=t.nextNode),l(t.nextNode)&&(t.nextNode.previousNode=t.previousNode),t.nextNode=this.emptyList,l(t.nextNode)&&(t.nextNode.previousNode=t),t.previousNode=void 0,this.emptyList=t,this.occupiedCount--};Qp.prototype.isFull=function(){return this.emptyList===void 0};Qp.get3DTextureDimension=function(e,t,n,i){let{maximum3DTextureSize:r}=Ut;if(h.maximumComponent(e)>r)throw new oe("The GL context does not support a 3D texture large enough to contain a tile with the given dimensions.");let o=t*e.x*e.y*e.z,s=Math.floor(n/o);if(s<1)throw new oe("Not enough texture memory available to create a megatexture with the given tile dimensions.");l(i)?i=Math.min(i,s):i=s;let a=Object.entries(e).sort((f,d)=>d[1]-f[1]),c=a.map(([f,d])=>Math.floor(r/d));for(let f=0;f<3;f++){let d=QPe(c);if(d<i)break;let p=c.slice();p.splice(f,1);let g=p[0]*p[1],m=d-i,y=Math.floor(m/g);c[f]-=y}QPe(c)>s&&(c[2]=Math.floor(s/(c[0]*c[1])));let u=new h;for(let f=0;f<3;f++){let[d,p]=a[f];u[d]=c[f]*p}return u};function QPe(e){return e.reduce((t,n)=>t*n)}Qp.prototype.writeDataToTexture=function(e,t){let{tileCounts:n,voxelCountPerTile:i}=this,r={arrayBufferView:t,width:i.x,height:i.y,depth:i.z},o=n.x*n.y,s=Math.floor(e/o),a=e-s*o,c=Math.floor(a/n.x),u=a-c*n.x,f={source:r,xOffset:u*i.x,yOffset:c*i.y,zOffset:s*i.z};this.texture.copyFrom(f)};Qp.prototype.isDestroyed=function(){return!1};Qp.prototype.destroy=function(){return this.texture=this.texture&&this.texture.destroy(),le(this)};var aG=Qp;function Zd(e,t,n,i,r,o,s){this.children=void 0,this.parent=r,this.level=e,this.x=t,this.y=n,this.z=i,this.dimensions=h.clone(s),this.keyframeNodes=[],this.renderableKeyframeNodes=[],this.renderableKeyframeNodeLerp=0,this.renderableKeyframeNodePrevious=void 0,this.renderableKeyframeNodeNext=void 0,this.orientedBoundingBox=new en,this.approximateVoxelSize=0,this.screenSpaceError=0,this.visitedFrameNumber=-1,this.computeBoundingVolumes(o)}var ERt=new h;Zd.prototype.computeBoundingVolumes=function(e){this.orientedBoundingBox=e.computeOrientedBoundingBoxForTile(this.level,this.x,this.y,this.z,this.orientedBoundingBox);let t=$.getScale(this.orientedBoundingBox.halfAxes,ERt),n=2*h.maximumComponent(t);this.approximateVoxelSize=n/h.minimumComponent(this.dimensions)};Zd.prototype.constructChildNodes=function(e){let{level:t,x:n,y:i,z:r}=this,o=n*2,s=i*2,a=r*2,c=s+1,u=o+1,f=a+1,d=t+1,p=[[d,o,s,a],[d,u,s,a],[d,o,c,a],[d,u,c,a],[d,o,s,f],[d,u,s,f],[d,o,c,f],[d,u,c,f]];this.children=p.map(([g,m,y,A])=>new Zd(g,m,y,A,this,e,this.dimensions))};Zd.prototype.visibility=function(e,t){let n=this.orientedBoundingBox;return e.cullingVolume.computeVisibilityWithPlaneMask(n,t)};Zd.prototype.computeScreenSpaceError=function(e,t){let n=this.orientedBoundingBox,i=Math.sqrt(n.distanceSquaredTo(e));i=Math.max(i,P.EPSILON7);let r=this.approximateVoxelSize,o=t*(r/i);this.screenSpaceError=o};var eDe={keyframe:0};function aO(e,t){return eDe.keyframe=e,Pr(t,eDe,Gr.searchComparator)}Zd.prototype.computeSurroundingRenderableKeyframeNodes=function(e){let t=this,n=t.level,i=Math.floor(e),r=Math.ceil(e),o,s,a=+Number.MAX_VALUE,c=+Number.MAX_VALUE;for(;l(t);){let{renderableKeyframeNodes:d}=t;if(d.length>=1){let p=CRt(i,d),g=d[p],m=r===i||i<g.keyframe?p:Math.min(p+1,d.length-1),y=d[m],A=i-g.keyframe,b=tDe(n-t.level,A);b<a&&(a=b,o=g);let x=y.keyframe-r,T=tDe(n-t.level,x);if(T<c&&(c=T,s=y),A===0&&x===0)break}t=t.parent}if(this.renderableKeyframeNodePrevious=o,this.renderableKeyframeNodeNext=s,!l(o)||!l(s))return;let u=o.keyframe,f=s.keyframe;this.renderableKeyframeNodeLerp=u===f?0:P.clamp((e-u)/(f-u),0,1)};function CRt(e,t){let n=aO(e,t);return n<0?P.clamp(~n-1,0,t.length-1):n}function tDe(e,t){let n=Math.exp(e*4),i=t>=0?1:-200;return e*n+t*i}Zd.prototype.isVisited=function(e){return this.visitedFrameNumber===e};Zd.prototype.createKeyframeNode=function(e){let t=aO(e,this.keyframeNodes);if(t<0){t=~t;let n=new Gr(this,e);this.keyframeNodes.splice(t,0,n)}};Zd.prototype.destroyKeyframeNode=function(e,t){let n=e.keyframe,i=aO(n,this.keyframeNodes);if(i<0)throw new pe("Keyframe node does not exist.");if(this.keyframeNodes.splice(i,1),e.megatextureIndex!==-1){for(let o=0;o<t.length;o++)t[o].remove(e.megatextureIndex);let r=aO(n,this.renderableKeyframeNodes);if(r<0)throw new pe("Renderable keyframe node does not exist.");this.renderableKeyframeNodes.splice(r,1)}e.unload()};Zd.prototype.addKeyframeNodeToMegatextures=function(e,t){if(e.megatextureIndex!==-1||e.content.metadata.length!==t.length)throw new pe("Keyframe node cannot be added to megatexture");let{metadata:n}=e.content;for(let o=0;o<t.length;o++){let s=t[o];e.megatextureIndex=s.add(n[o])}let i=this.renderableKeyframeNodes,r=aO(e.keyframe,i);if(r>=0)throw new pe("Keyframe already renderable");r=~r,i.splice(r,0,e)};Zd.prototype.isRenderable=function(e){let t=this.renderableKeyframeNodePrevious,n=this.renderableKeyframeNodeNext,i=this.level;return l(t)&&l(n)&&(t.spatialNode.level===i||n.spatialNode.level===i)&&this.visitedFrameNumber===e};var cG=Zd;function wA(e,t,n,i){let{provider:r,dimensions:o,inputDimensions:s}=e,{types:a,componentTypes:c}=r;l(i)?i=Math.min(Math.max(0,i),512*1024*1024):i=128*1024*1024,this._primitive=e,this.textureMemoryByteLength=0,this.megatextures=new Array(a.length);let u=l(r.maximumTileCount)?r.maximumTileCount:l(r.availableLevels)?(8**r.availableLevels-1)/7:void 0;for(let b=0;b<a.length;b++){let x=a[b],T=bt.getComponentCount(x),E=c[b];this.megatextures[b]=new aG(t,s,T,E,i,u),this.textureMemoryByteLength+=this.megatextures[b].textureMemoryByteLength}let f=this.megatextures[0].maximumTileCount;this._simultaneousRequestCount=0,this._debugPrint=!1,this._calculateStatistics=this._primitive._calculateStatistics??!1,this._frameNumber=0;let d=e._shape;this.rootNode=new cG(0,0,0,0,void 0,d,o),this._priorityQueue=new SA({maximumLength:f,comparator:Gr.priorityComparator}),this._highPriorityKeyframeNodes=new Array(f),this._highPriorityKeyframeNodeCount=0,this._keyframeNodesInMegatexture=new Array(f),this._keyframeCount=n,this._sampleCount=void 0,this._keyframeLocation=0,this._binaryTreeKeyframeWeighting=new Array(n),this._initialTilesLoaded=!1;let p=this._binaryTreeKeyframeWeighting;p[0]=0,p[n-1]=0,Une(p,1,n-2,0);let g=9,m=2048,y=Math.floor(m/g),A=Math.ceil(f/y);this.internalNodeTexture=new Dt({context:t,pixelFormat:$e.RGBA,pixelDatatype:ze.UNSIGNED_BYTE,flipY:!1,width:m,height:A,sampler:new Ht({minificationFilter:Wt.NEAREST,magnificationFilter:Jn.NEAREST})}),this.internalNodeTilesPerRow=y,this.internalNodeTexelSizeUv=new U(1/m,1/A),this.leafNodeTexture=void 0,this.leafNodeTilesPerRow=void 0,this.leafNodeTexelSizeUv=new U}wA.prototype.findKeyframeNode=function(e){return this._keyframeNodesInMegatexture.find(function(t){return t.megatextureIndex===e})};function Une(e,t,n,i){if(t>n)return;let r=Math.floor((t+n)/2);e[r]=i,Une(e,t,r-1,i+1),Une(e,r+1,n,i+1)}wA.simultaneousRequestCountMaximum=50;wA.prototype.update=function(e,t,n,i){let r=this._primitive,o=e.context,s=this.megatextures[0].maximumTileCount,a=this._keyframeCount,c=r._levelBlendFactor,u=c>0,f=a>1,d=(u?2:1)*(f?2:1);this._sampleCount=d;let p=d>=2;if(p&&!l(this.leafNodeTexture)){let T=Math.floor(512),E=Math.ceil(s/T);this.leafNodeTexture=new Dt({context:o,pixelFormat:$e.RGBA,pixelDatatype:ze.UNSIGNED_BYTE,flipY:!1,width:1024,height:E,sampler:new Ht({minificationFilter:Wt.NEAREST,magnificationFilter:Jn.NEAREST})}),this.leafNodeTexelSizeUv=U.fromElements(1/1024,1/E,this.leafNodeTexelSizeUv),this.leafNodeTilesPerRow=T}else!p&&l(this.leafNodeTexture)&&(this.leafNodeTexture=this.leafNodeTexture.destroy());if(this._keyframeLocation=P.clamp(t,0,a-1),n&&nDe(this,this.rootNode),i)return;this._frameNumber=e.frameNumber;let g=xn();wRt(this,e),IRt(this,e);let m=xn();MRt(this,d,c);let y=xn(),A=r.loadProgress.numberOfListeners>0||r.allTilesLoaded.numberOfListeners>0||r.initialTilesLoaded.numberOfListeners>0;if(this._debugPrint||this._calculateStatistics||A){let b=m-g,x=y-m,T=y-g;ORt(this,e,b,x,T)}};wA.prototype.isRenderable=function(e){return e.isRenderable(this._frameNumber)};wA.prototype.isDestroyed=function(){return!1};wA.prototype.destroy=function(){let e=this.megatextures,t=e.length;for(let n=0;n<t;n++)e[n]=e[n]&&e[n].destroy();return this.textureMemoryByteLength=0,this.internalNodeTexture=this.internalNodeTexture&&this.internalNodeTexture.destroy(),this.leafNodeTexture=this.leafNodeTexture&&this.leafNodeTexture.destroy(),le(this)};function nDe(e,t){if(t.computeBoundingVolumes(e._primitive._shape),l(t.children))for(let n=0;n<8;n++){let i=t.children[n];nDe(e,i)}}function vRt(e,t){if(e._simultaneousRequestCount>=wA.simultaneousRequestCountMaximum)return;let i=e._primitive.provider,{keyframe:r,spatialNode:o}=t;if(l(i.availableLevels)&&o.level>=i.availableLevels)return;function s(f){e._simultaneousRequestCount--,t.content=f,t.state=l(f)?Gr.LoadState.PROCESSING:Gr.LoadState.UNAVAILABLE}function a(f){e._simultaneousRequestCount--,t.state=Gr.LoadState.FAILED,e._primitive.tileFailed.raiseEvent()}let c={tileLevel:o.level,tileX:o.x,tileY:o.y,tileZ:o.z,keyframe:r},u=i.requestData(c);l(u)&&(e._simultaneousRequestCount++,t.state=Gr.LoadState.RECEIVING,u.then(s).catch(a))}function SRt(e){return e/(1+e)}function wRt(e,t){let n=e._frameNumber,i=e._priorityQueue;i.reset(),iDe(e.rootNode,aa.MASK_INDETERMINATE,e,t);let r=e._highPriorityKeyframeNodes,o=0,s;for(;i.length>0;)s=i.removeMaximum(),s.highPriorityFrameNumber=n,r[o]=s,o++;e._highPriorityKeyframeNodeCount=o}function IRt(e,t){let n=e.megatextures[0],i=n.occupiedCount,r=e._keyframeNodesInMegatexture;r.length=i,r.sort(PRt);let o=e._highPriorityKeyframeNodes,s=e._highPriorityKeyframeNodeCount,a=0,c=0;for(let u=0;u<s;u++){let f=o[u];if(!(f.state===Gr.LoadState.LOADED||f.spatialNode===void 0)&&(f.state===Gr.LoadState.UNLOADED&&vRt(e,f),f.state===Gr.LoadState.PROCESSING)){let{content:d}=f;if(d.update(e._primitive,t),!d.ready)continue;if(!DRt(d.metadata,e)){f.content=void 0,f.state=Gr.LoadState.FAILED,e._primitive.tileFailed.raiseEvent();continue}let p;if(n.isFull()){p=i-1-a,a++;let g=r[p];e._primitive.tileUnload.raiseEvent(),g.spatialNode.destroyKeyframeNode(g,e.megatextures)}else p=i+c,c++;f.spatialNode.addKeyframeNodeToMegatextures(f,e.megatextures),f.state=Gr.LoadState.LOADED,r[p]=f,e._primitive.tileLoad.raiseEvent()}}}function PRt(e,t){return e.highPriorityFrameNumber===t.highPriorityFrameNumber?t.priority-e.priority:t.highPriorityFrameNumber-e.highPriorityFrameNumber}function DRt(e,t){let n=t._primitive.provider.types.length;if(!Array.isArray(e)||e.length!==n)return!1;let{megatextures:i}=t;for(let r=0;r<n;r++){let{voxelCountPerTile:o,channelCount:s}=i[r],{x:a,y:c,z:u}=o,f=a*c*u,d=e[r],p=f*s;if(d.length!==p)return!1}return!0}function iDe(e,t,n,i){let{camera:r,context:o,pixelRatio:s,frameNumber:a}=i,{positionWC:c,frustum:u}=r,d=o.drawingBufferHeight/s/u.sseDenominator;if(e.computeScreenSpaceError(c,d),t=e.visibility(i,t),t===aa.MASK_OUTSIDE)return;e.visitedFrameNumber=a;let p=n._primitive,g=p._shape,m=p.screenSpaceError,y=n._priorityQueue,A=n._keyframeCount,b=P.clamp(Math.floor(n._keyframeLocation),0,A-2),x=b+1;if(A===1)e.createKeyframeNode(0);else if(e.keyframeNodes.length!==A)for(let I=0;I<A;I++)e.createKeyframeNode(I);let{screenSpaceError:T,keyframeNodes:E}=e,v=SRt(T),S=!1;for(let I=0;I<E.length;I++){let R=E[I];R.priority=10*v+RRt(b,R.keyframe,x,n),R.state!==Gr.LoadState.UNAVAILABLE&&R.state!==Gr.LoadState.FAILED&&R.priority!==-Number.MAX_VALUE&&y.insert(R),R.state===Gr.LoadState.LOADED&&(S=!0)}if(T<m||!S){e.children=void 0;return}l(e.children)||e.constructChildNodes(g);for(let I=0;I<8;I++){let R=e.children[I];iDe(R,t,n,i)}}function RRt(e,t,n,i){let r=Math.min(Math.abs(t-e),Math.abs(t-n)),o=Math.max(e,i._keyframeCount-n-1,1),s=Math.pow(1-r/o,4),a=Math.exp(-i._binaryTreeKeyframeWeighting[t]);return P.lerp(a,s,.15+.85*s)}function ORt(e,t,n,i,r){let o=e._keyframeCount,s=e.rootNode,a=Object.keys(Gr.LoadState).length,c=new Array(a),u=new Array(a),f=0;for(let S=0;S<a;S++){let I=new Array(o).fill(0);c[S]=I,u[S]=0}function d(S){let I=S.keyframeNodes;for(let R=0;R<I.length;R++){let O=I[R],L=O.keyframe,_=O.state;c[_][L]+=1,u[_]+=1,f++}if(l(S.children))for(let R=0;R<8;R++){let O=S.children[R];d(O)}}d(s),e._primitive.statistics.numberOfTilesWithContentReady=u[Gr.LoadState.LOADED],e._primitive.statistics.visited=f;let p=u[Gr.LoadState.RECEIVING],g=u[Gr.LoadState.PROCESSING],m=p!==e._primitive.statistics.numberOfPendingRequests||g!==e._primitive.statistics.numberOfTilesProcessing;if(m&&t.afterRender.push(function(){return e._primitive.loadProgress.raiseEvent(p,g),!0}),e._primitive.statistics.numberOfPendingRequests=p,e._primitive.statistics.numberOfTilesProcessing=g,m&&(p===0&&g===0)&&(t.afterRender.push(function(){return e._primitive.allTilesLoaded.raiseEvent(),!0}),e._initialTilesLoaded||(e._initialTilesLoaded=!0,t.afterRender.push(function(){return e._primitive.initialTilesLoaded.raiseEvent(),!0}))),!e._debugPrint)return;let A=`KEYFRAMES: ${c[Gr.LoadState.LOADED]}`,b=`UNLOADED: ${u[Gr.LoadState.UNLOADED]} | RECEIVING: ${u[Gr.LoadState.RECEIVING]} | PROCESSING: ${u[Gr.LoadState.PROCESSING]} | LOADED: ${u[Gr.LoadState.LOADED]} | FAILED: ${u[Gr.LoadState.FAILED]} | UNAVAILABLE: ${u[Gr.LoadState.UNAVAILABLE]} | TOTAL: ${f}`,x=Math.round(n*100)/100,T=Math.round(i*100)/100,E=Math.round(r*100)/100,v=`LOAD: ${x} | OCT: ${T} | ALL: ${E}`;console.log(`${A} || ${b} || ${v}`)}var lG={INTERNAL:0,LEAF:1,PACKED_LEAF_FROM_PARENT:2};function MRt(e,t,n){let i=e._primitive._screenSpaceError,r=e._keyframeLocation,o=e._frameNumber,s=t>=2,a=0,c=0,u=[],f=[];function d(g,m,y,A,b){let x=!1;if(l(g.children))for(let T=0;T<8;T++){let E=g.children[T];E.computeSurroundingRenderableKeyframeNodes(r),E.isRenderable(o)&&(x=!0)}if(x){u[b]=lG.INTERNAL<<16|m,u[y]=A,a++,A=m,b=A*9+1;for(let T=0;T<8;T++){let E=g.children[T];m=a,y=m*9+0,d(E,m,y,A,b+T)}}else{if(e._primitive.tileVisible.raiseEvent(),s){let T=c*5,E=g.renderableKeyframeNodePrevious,v=g.level-E.spatialNode.level,S=E.spatialNode.parent,I=l(S)?S.renderableKeyframeNodePrevious:E,R=NRt(g,i,n),O=v,L=1,_=E.megatextureIndex,C=I.megatextureIndex;f[T+0]=R,f[T+1]=O,f[T+2]=L,f[T+3]=_,f[T+4]=C,u[b]=lG.LEAF<<16|c}else{let T=g.renderableKeyframeNodePrevious,v=g.level-T.spatialNode.level===0?lG.LEAF:lG.PACKED_LEAF_FROM_PARENT;u[b]=v<<16|T.megatextureIndex}c++}}let p=e.rootNode;p.computeSurroundingRenderableKeyframeNodes(r),p.isRenderable(o)&&d(p,0,0,0,0),LRt(u,9,e.internalNodeTilesPerRow,e.internalNodeTexture),s&&FRt(f,2,e.leafNodeTilesPerRow,e.leafNodeTexture)}function NRt(e,t,n){if(e.parent===void 0)return 0;let i=e.screenSpaceError,r=e.parent.screenSpaceError,s=((t-i)/(r-i)+n-1)/n;return P.clamp(s,0,1)}function LRt(e,t,n,i){let r=$e.componentsLength(i.pixelFormat),o=Math.ceil(e.length/t),s=Math.max(1,t*Math.min(o,n)),a=Math.max(1,Math.ceil(o/n)),c=new Uint8Array(s*a*r);for(let d=0;d<e.length;d++){let p=e[d],g=d*r;for(let m=0;m<r;m++)c[g+m]=p>>>m*8&255}let f={source:{arrayBufferView:c,width:s,height:a},xOffset:0,yOffset:0};i.copyFrom(f)}function FRt(e,t,n,i){let r=$e.componentsLength(i.pixelFormat),o=5,s=Math.ceil(e.length/o),a=Math.max(1,t*Math.min(s,n)),c=Math.max(1,Math.ceil(s/n)),u=new Uint8Array(a*c*r);for(let p=0;p<s;p++){let g=e[p*o+0],m=e[p*o+1],y=e[p*o+2],A=e[p*o+3],b=e[p*o+4],x=P.clamp(Math.floor(65536*g),0,65535);u[p*8+0]=x>>>0&255,u[p*8+1]=x>>>8&255,u[p*8+2]=m&255,u[p*8+3]=y&255,u[p*8+4]=A>>>0&255,u[p*8+5]=A>>>8&255,u[p*8+6]=b>>>0&255,u[p*8+7]=b>>>8&255}let d={source:{arrayBufferView:u,width:a,height:c},xOffset:0,yOffset:0};i.copyFrom(d)}var uG=wA;function e0(e){e=e??H.EMPTY_OBJECT;let{provider:t=e0.DefaultProvider,modelMatrix:n=M.IDENTITY,customShader:i=tO(t),clock:r,calculateStatistics:o=!1}=e;this._ready=!1,this._provider=t,this._traversal=void 0,this._statistics=new Up,this._calculateStatistics=o;let{shape:s,minBounds:a=Ic.getMinBounds(s),maxBounds:c=Ic.getMaxBounds(s),dimensions:u,paddingBefore:f=h.ZERO,paddingAfter:d=h.ZERO,metadataOrder:p,availableLevels:g=1}=t;this._dimensions=h.clone(u),this._paddingBefore=h.clone(f),this._paddingAfter=h.clone(d),this._inputDimensions=BRt(u,f,d,p),this._availableLevels=g,this._minBounds=a.clone(),this._minBoundsOld=new h,this._maxBounds=c.clone(),this._maxBoundsOld=new h,this._minClippingBounds=a.clone(),this._minClippingBoundsOld=new h,this._maxClippingBounds=c.clone(),this._maxClippingBoundsOld=new h,this._verticalExaggeration=1,this._verticalExaggerationRelativeHeight=0,this._clippingPlanes=void 0,this._clippingPlanesState=0,this._clippingPlanesEnabled=!1,this._modelMatrix=M.clone(n),this._modelMatrixOld=M.clone(this._modelMatrix),this._customShader=i??e0.DefaultCustomShader,this._customShaderCompilationEvent=new be,this._shaderDirty=!0,this._drawCommand=void 0,this._drawCommandPick=void 0,this._pickId=void 0,this._clock=r,this._transformPositionLocalToWorld=new M,this._transformPositionWorldToLocal=new M,this._transformPlaneLocalToView=new M,this._transformDirectionWorldToLocal=new $,this._nearestSampling=!1,this._levelBlendFactor=0,this._stepSizeMultiplier=1,this._depthTest=!0,this._useLogDepth=void 0,this._screenSpaceError=4,this._debugPolylines=new Fp,this._debugDraw=!1,this._disableRender=!1,this._disableUpdate=!1;let m=Ic.getShapeConstructor(s);this._shape=new m,oDe(this),this._shapeVisible=sDe(this),this._uniforms={octreeInternalNodeTexture:void 0,octreeInternalNodeTilesPerRow:0,octreeInternalNodeTexelSizeUv:new U,octreeLeafNodeTexture:void 0,octreeLeafNodeTilesPerRow:0,octreeLeafNodeTexelSizeUv:new U,megatextureTextures:[],megatextureTileCounts:new h,dimensions:this._dimensions,inputDimensions:this._inputDimensions,paddingBefore:this._paddingBefore,paddingAfter:this._paddingAfter,transformPositionViewToLocal:new M,transformDirectionViewToLocal:new $,cameraPositionLocal:new h,cameraDirectionLocal:new h,cameraTileCoordinates:new se,cameraTileUv:new h,ndcSpaceAxisAlignedBoundingBox:new se,clippingPlanesTexture:void 0,clippingPlanesMatrix:new M,renderBoundPlanesTexture:void 0,stepSize:this._stepSizeMultiplier,pickColor:new z},this._shapeDefinesOld={},this._uniformMap={};let y=this._uniforms,A=this._uniformMap;for(let b in y)if(y.hasOwnProperty(b)){let x=`u_${b}`;A[x]=function(){return y[b]}}kRt(this,this._shape),this.tileLoad=new be,this.tileVisible=new be,this.tileFailed=new be,this.tileUnload=new be,this.loadProgress=new be,this.allTilesLoaded=new be,this.initialTilesLoaded=new be}function BRt(e,t,n,i){let r=h.add(e,t,new h);if(h.add(r,n,r),i===Jg.Y_UP){let o=r.y;r.y=r.z,r.z=o}return r}function kRt(e,t){let n=e._uniformMap,{shaderUniforms:i,shaderDefines:r}=t;for(let o in i)if(i.hasOwnProperty(o)){let s=`u_${o}`;n[s]=function(){return i[o]}}e._shapeDefinesOld=Ze(r,!0)}Object.defineProperties(e0.prototype,{ready:{get:function(){return this._ready}},provider:{get:function(){return this._provider}},boundingSphere:{get:function(){return this._shape.boundingSphere}},orientedBoundingBox:{get:function(){return this._shape.orientedBoundingBox}},modelMatrix:{get:function(){return this._modelMatrix},set:function(e){this._modelMatrix=M.clone(e,this._modelMatrix)}},shape:{get:function(){return this._provider.shape}},dimensions:{get:function(){return this._dimensions}},inputDimensions:{get:function(){return this._inputDimensions}},paddingBefore:{get:function(){return this._paddingBefore}},paddingAfter:{get:function(){return this._paddingAfter}},minimumValues:{get:function(){return this._provider.minimumValues}},maximumValues:{get:function(){return this._provider.maximumValues}},show:{get:function(){return!this._disableRender},set:function(e){this._disableRender=!e}},disableUpdate:{get:function(){return this._disableUpdate},set:function(e){this._disableUpdate=e}},debugDraw:{get:function(){return this._debugDraw},set:function(e){this._debugDraw=e}},depthTest:{get:function(){return this._depthTest},set:function(e){this._depthTest!==e&&(this._depthTest=e,this._shaderDirty=!0)}},nearestSampling:{get:function(){return this._nearestSampling},set:function(e){this._nearestSampling=e}},levelBlendFactor:{get:function(){return this._levelBlendFactor},set:function(e){this._levelBlendFactor=P.clamp(e,0,1)}},screenSpaceError:{get:function(){return this._screenSpaceError},set:function(e){this._screenSpaceError=e}},stepSize:{get:function(){return this._stepSizeMultiplier},set:function(e){this._stepSizeMultiplier=e}},minBounds:{get:function(){return this._minBounds},set:function(e){this._minBounds=h.clone(e,this._minBounds)}},maxBounds:{get:function(){return this._maxBounds},set:function(e){this._maxBounds=h.clone(e,this._maxBounds)}},minClippingBounds:{get:function(){return this._minClippingBounds},set:function(e){this._minClippingBounds=h.clone(e,this._minClippingBounds)}},maxClippingBounds:{get:function(){return this._maxClippingBounds},set:function(e){this._maxClippingBounds=h.clone(e,this._maxClippingBounds)}},clippingPlanes:{get:function(){return this._clippingPlanes},set:function(e){Ds.setOwner(e,this,"_clippingPlanes")}},customShader:{get:function(){return this._customShader},set:function(e){if(e===this._customShader)return;let t=this._uniformMap,i=this._customShader.uniformMap;for(let r in i)i.hasOwnProperty(r)&&delete t[r];if(l(e))this._customShader=e;else{let r=tO(this._provider);this._customShader=r??e0.DefaultCustomShader}this._shaderDirty=!0}},customShaderCompilationEvent:{get:function(){return this._customShaderCompilationEvent}},statistics:{get:function(){return this._statistics}}});var URt=new se,zRt=new se,VRt=new M,jRt=new M,HRt=new h,GRt=new se;e0.prototype.update=function(e){let t=this._provider,n=this._uniforms;this._customShader.update(e);let i=e.context;if(!this._ready){JRt(this,t,i),e.afterRender.push(()=>(this._ready=!0,!0));return}let r=oDe(this),o=$Rt(this,e);if((r||o)&&(this._shapeVisible=sDe(this),aOt(this)&&(this._shaderDirty=!0)),!this._shapeVisible)return;this._shape.updateViewTransforms(e);let s=cOt(t.timeIntervalCollection,this._clock),a=this._traversal,c=a._sampleCount;if(a.update(e,s,r,this._disableUpdate),c!==a._sampleCount&&(this._shaderDirty=!0),!a.isRenderable(a.rootNode)||(this._debugDraw&&gOt(this,e),this._disableRender))return;this._useLogDepth!==e.useLogDepth&&(this._useLogDepth=e.useLogDepth,this._shaderDirty=!0),lOt(this,e)&&(this._shaderDirty=!0);let f=a.leafNodeTexture;l(f)&&(n.octreeLeafNodeTexture=a.leafNodeTexture,n.octreeLeafNodeTexelSizeUv=U.clone(a.leafNodeTexelSizeUv,n.octreeLeafNodeTexelSizeUv),n.octreeLeafNodeTilesPerRow=a.leafNodeTilesPerRow),this._shaderDirty&&(iG(this,i),this._shaderDirty=!1);let d=i.uniformState.viewProjection,{orientedBoundingBox:p}=this._shape,g=dOt(p,d,zRt);if(g.x===1||g.y===1||g.z===-1||g.w===-1)return;n.ndcSpaceAxisAlignedBoundingBox=se.clone(g,n.ndcSpaceAxisAlignedBoundingBox);let y=i.uniformState.inverseView,A=M.multiplyTransformation(this._transformPositionWorldToLocal,y,n.transformPositionViewToLocal);this._transformPlaneLocalToView=M.transpose(A,this._transformPlaneLocalToView);let b=i.uniformState.inverseViewRotation;n.transformDirectionViewToLocal=$.multiply(this._transformDirectionWorldToLocal,b,n.transformDirectionViewToLocal),n.cameraPositionLocal=M.multiplyByPoint(this._transformPositionWorldToLocal,e.camera.positionWC,n.cameraPositionLocal),n.cameraDirectionLocal=$.multiplyByVector(this._transformDirectionWorldToLocal,e.camera.directionWC,n.cameraDirectionLocal);let x=YRt(this,n.cameraPositionLocal,GRt);n.cameraTileCoordinates=se.fromElements(Math.floor(x.x),Math.floor(x.y),Math.floor(x.z),x.w,n.cameraTileCoordinates),n.cameraTileUv=h.fromElements(x.x-Math.floor(x.x),x.y-Math.floor(x.y),x.z-Math.floor(x.z),n.cameraTileUv),n.stepSize=this._stepSizeMultiplier,WRt(this),qRt(this,e);let T=e.passes.pick?this._drawCommandPick:e.passes.pickVoxel?this._drawCommandPickVoxel:this._drawCommand;T.boundingVolume=this._shape.boundingSphere,e.commandList.push(T)};function WRt(e){let{megatextures:t}=e._traversal;for(let n=0;n<t.length;++n)t[n].nearestSampling=e._nearestSampling}function qRt(e,t){let n=e._uniforms,{renderBoundPlanes:i}=e._shape;l(i)&&(i.update(t,e._transformPlaneLocalToView),n.renderBoundPlanesTexture=i.texture)}function YRt(e,t,n){let i=e._shape.convertLocalToShapeUvSpace(t,HRt),r=e._availableLevels,o=2**(r-1);return se.fromElements(i.x*o,i.y*o,i.z*o,r-1,n)}var XRt=new h,zne=new h,KRt=new he;function $Rt(e,t){let{verticalExaggeration:n,verticalExaggerationRelativeHeight:i}=t;return e._verticalExaggeration===n&&e._verticalExaggerationRelativeHeight===i?!1:(e._verticalExaggeration=n,e._verticalExaggerationRelativeHeight=i,!0)}function JRt(e,t,n){let i=e._uniforms;e._pickId=n.createPickId({primitive:e}),i.pickColor=z.clone(e._pickId.color,i.pickColor);let r=t.keyframeCount??1;e._traversal=new uG(e,n,r),e.statistics.texturesByteLength=e._traversal.textureMemoryByteLength,sOt(e._traversal,i)}function oDe(e){return cO(e,"_modelMatrix","_modelMatrixOld")+cO(e,"_minBounds","_minBoundsOld")+cO(e,"_maxBounds","_maxBoundsOld")+cO(e,"_minClippingBounds","_minClippingBoundsOld")+cO(e,"_maxClippingBounds","_maxClippingBoundsOld")>0}function cO(e,t,n){let i=e[t],r=e[n],o=!i.equals(r);return o&&i.clone(r),o?1:0}var ZRt=new h,QRt=new h,eOt=new h,tOt=new h,nOt=new M,iOt=new M;function sDe(e){let t=e._verticalExaggeration,n=e._verticalExaggerationRelativeHeight,i=h.clone(e._minBounds,ZRt),r=h.clone(e._maxBounds,QRt),o=h.clone(e._minClippingBounds,eOt),s=h.clone(e._maxClippingBounds,tOt),a=M.clone(e._modelMatrix,nOt);if(e.shape===Ic.ELLIPSOID)i.z=br.getHeight(e._minBounds.z,t,n),r.z=br.getHeight(e._maxBounds.z,t,n),o.z=br.getHeight(e._minClippingBounds.z,t,n),s.z=br.getHeight(e._maxClippingBounds.z,t,n);else{let m=h.fromElements(1,1,t,XRt);M.multiplyByScale(a,m,a),M.multiplyByTranslation(a,oOt(e),a)}let c=e._provider,u=c.shapeTransform??M.IDENTITY,f=c.globalTransform??M.IDENTITY,d=M.multiplyTransformation(f,a,iOt);M.multiplyTransformation(d,u,d);let p=e._shape;return p.update(d,i,r,o,s)?(e._transformPositionLocalToWorld=M.clone(p.shapeTransform,e._transformPositionLocalToWorld),e._transformPositionWorldToLocal=M.inverse(e._transformPositionLocalToWorld,e._transformPositionWorldToLocal),e._transformDirectionWorldToLocal=M.getMatrix3(e._transformPositionWorldToLocal,e._transformDirectionWorldToLocal),!0):!1}var rOt=new h;function oOt(e){let t=e._verticalExaggeration,n=e._verticalExaggerationRelativeHeight,{shapeTransform:i=M.IDENTITY,globalTransform:r=M.IDENTITY}=e._provider,o=M.getTranslation(i,zne),s=M.multiplyByPoint(e._modelMatrix,o,zne),a=M.multiplyByPoint(r,s,zne),u=ee.WGS84.cartesianToCartographic(a,KRt),f=0;l(u)&&(f=u.height);let d=br.getHeight(f,t,n);return h.fromElements(0,0,(d-f)/t,rOt)}function sOt(e,t){t.octreeInternalNodeTexture=e.internalNodeTexture,t.octreeInternalNodeTexelSizeUv=U.clone(e.internalNodeTexelSizeUv,t.octreeInternalNodeTexelSizeUv),t.octreeInternalNodeTilesPerRow=e.internalNodeTilesPerRow;let{megatextures:n}=e,i=n[0];t.megatextureTextures=new Array(n.length);for(let r=0;r<n.length;r++)t.megatextureTextures[r]=n[r].texture;t.megatextureTileCounts=h.clone(i.tileCounts,t.megatextureTileCounts)}function aOt(e){let{shaderDefines:t}=e._shape,n=Object.keys(t).some(i=>t[i]!==e._shapeDefinesOld[i]);return n&&(e._shapeDefinesOld=Ze(t,!0)),n}function cOt(e,t){if(!l(e)||!l(t))return 0;let n=t.currentTime,i,r=e.indexOf(n);r>=0?i=e.get(r):(r=~r,r===e.length?(r=e.length-1,i=e.get(r),n=i.stop):(i=e.get(r),n=i.start));let o=K.secondsDifference(i.stop,i.start),a=K.secondsDifference(n,i.start)/o;return r+a}function lOt(e,t){let n=e.clippingPlanes;if(!l(n))return!1;n.update(t);let{clippingPlanesState:i,enabled:r}=n;if(r){let o=e._uniforms;o.clippingPlanesTexture=n.texture,o.clippingPlanesMatrix=M.transpose(M.multiplyTransformation(M.inverse(n.modelMatrix,o.clippingPlanesMatrix),e._transformPositionLocalToWorld,o.clippingPlanesMatrix),o.clippingPlanesMatrix)}return e._clippingPlanesState===i&&e._clippingPlanesEnabled===r?!1:(e._clippingPlanesState=i,e._clippingPlanesEnabled=r,!0)}e0.prototype.isDestroyed=function(){return!1};e0.prototype.destroy=function(){let e=this._drawCommand;l(e)&&(e.shaderProgram=e.shaderProgram&&e.shaderProgram.destroy());let t=this._drawCommandPick;return l(t)&&(t.shaderProgram=t.shaderProgram&&t.shaderProgram.destroy()),this._pickId=this._pickId&&this._pickId.destroy(),this._traversal=this._traversal&&this._traversal.destroy(),this.statistics.texturesByteLength=0,this._clippingPlanes=this._clippingPlanes&&this._clippingPlanes.destroy(),le(this)};var rDe=new Array(new se(-1,-1,-1,1),new se(1,-1,-1,1),new se(-1,1,-1,1),new se(1,1,-1,1),new se(-1,-1,1,1),new se(1,-1,1,1),new se(-1,1,1,1),new se(1,1,1,1)),uOt=new Array(1,2,4,0,3,5,0,3,6,1,2,7,0,5,6,1,4,7,2,4,7,3,5,6),fOt=new Array(new se,new se,new se,new se,new se,new se,new se,new se);function dOt(e,t,n){let i=M.fromRotationTranslation(e.halfAxes,e.center,VRt),r=M.multiply(t,i,jRt),o=+Number.MAX_VALUE,s=-Number.MAX_VALUE,a=+Number.MAX_VALUE,c=-Number.MAX_VALUE,u,f=fOt,d=rDe.length;for(u=0;u<d;u++)M.multiplyByVector(r,rDe[u],f[u]);for(u=0;u<d;u++){let p=f[u];if(p.z>=-p.w){let g=p.x/p.w,m=p.y/p.w;o=Math.min(o,g),s=Math.max(s,g),a=Math.min(a,m),c=Math.max(c,m)}else for(let g=0;g<3;g++){let m=uOt[u*3+g],y=f[m];if(y.z>=-y.w){let A=p.z+p.w,b=y.z+y.w,x=A/(A-b),T=se.lerp(p,y,x,URt),E=T.x/T.w,v=T.y/T.w;o=Math.min(o,E),s=Math.max(s,E),a=Math.min(a,v),c=Math.max(c,v)}}}return o=P.clamp(o,-1,1),a=P.clamp(a,-1,1),s=P.clamp(s,-1,1),c=P.clamp(c,-1,1),n=se.fromElements(o,a,s,c,n),n}var Vne=3e7,hOt=new h(Vne,0,0),mOt=new h(0,Vne,0),pOt=new h(0,0,Vne);function gOt(e,t){let n=e._traversal,i=e._debugPolylines;i.removeAll();function r(c,u,f,d){i.add({positions:[c,u],width:d,material:rr.fromType("Color",{color:f})})}function o(c,u,f){let d=c.computeCorners();r(d[0],d[1],u,f),r(d[2],d[3],u,f),r(d[4],d[5],u,f),r(d[6],d[7],u,f),r(d[0],d[2],u,f),r(d[4],d[6],u,f),r(d[1],d[3],u,f),r(d[5],d[7],u,f),r(d[0],d[4],u,f),r(d[2],d[6],u,f),r(d[1],d[5],u,f),r(d[3],d[7],u,f)}function s(c){if(!n.isRenderable(c))return;let u=c.level,d=Math.max(1,5/Math.pow(2,u)),g=[z.RED,z.LIME,z.BLUE][u%3];if(o(c.orientedBoundingBox,g,d),l(c.children))for(let m=0;m<8;m++)s(c.children[m])}o(e._shape.orientedBoundingBox,z.WHITE,5),s(n.rootNode);let a=10;r(h.ZERO,hOt,z.RED,a),r(h.ZERO,mOt,z.LIME,a),r(h.ZERO,pOt,z.BLUE,a),i.update(t)}e0.DefaultCustomShader=new $g({fragmentShaderText:`void fragmentMain(FragmentInput fsInput, inout czm_modelMaterial material) { vec3 voxelNormal = fsInput.attributes.normalEC; float diffuse = max(0.0, dot(voxelNormal, czm_lightDirectionEC)); float lighting = 0.5 + 0.5 * diffuse; material.diffuse = vec3(lighting); material.alpha = 1.0; -}`});function iLe(){this.shape=Dc.BOX,this.dimensions=new h(1,1,1),this.names=["data"],this.types=[bt.SCALAR],this.componentTypes=[Ft.FLOAT32],this.maximumTileCount=1}iLe.prototype.requestData=function(e){if((l(e)?e.tileLevel??0:0)>=1)return;let n=new nI({metadata:[new Float32Array(1)]});return Promise.resolve(n)};g0.DefaultProvider=new iLe;var XT=g0;function $kt(e,t,n,i){if(!l(e)||l(t)&&e.id!==t)return;let o=(e.classes||{})[n];if(!l(o))return;let a=(o.properties||{})[i];if(l(a))return a}var v9=$kt;function Jkt(e,t,n,i,r){this.schemaId=e,this.className=t,this.propertyName=n,this.classProperty=i,this.metadataProperty=r}var S9=Jkt;function Zkt(e,t,n){if(!l(e))return;let i=e.propertyTextures;for(let r of i)if(r.class.id===t){let a=r.properties[n];if(l(a))return a}}var w9=Zkt;var P9=function(e){return function(){e.frameState.afterRender.push(function(){e.requestRender()})}};function _i(e){e=e??H.EMPTY_OBJECT;let t=e.canvas,n=e.creditContainer,i=e.creditViewport,r=e.contextOptions instanceof u2;if(r)this._context=e.contextOptions.createSceneContext(t);else{let u=Ze(e.contextOptions);this._context=new qE(t,u)}let o=this._context,s=l(n);s||(n=document.createElement("div"),n.style.position="absolute",n.style.bottom="0",n.style["text-shadow"]="0 0 2px #000000",n.style.color="#ffffff",n.style["font-size"]="10px",n.style["padding-right"]="5px",t.parentNode.appendChild(n)),l(i)||(i=t.parentNode),this._id=Kn(),this._jobScheduler=new VG,this._heightQueryCache=new Map,this._heightQueryFrame=-1,this._frameState=new Bx(o,new DG(n,"\u2022",i),this._jobScheduler),this._frameState.scene3DOnly=e.scene3DOnly??!1,this._removeCreditContainer=!s,this._creditContainer=n,this._canvas=t,this._computeEngine=new tL(o),this._ellipsoid=e.ellipsoid??ee.default,this._globe=void 0,this._globeTranslucencyState=new UG,this._primitives=new ql({countReferences:r}),this._groundPrimitives=new ql({countReferences:r}),this._globeHeight=void 0,this._globeHeightDirty=!0,this._cameraUnderground=!1,this._removeUpdateHeightCallback=void 0,this._logDepthBuffer=_i.defaultLogDepthBuffer&&o.fragmentDepth,this._logDepthBufferDirty=!0,this._tweens=new Zw,this._shaderFrameCount=0,this._sunPostProcess=void 0,this._computeCommandList=[],this._overlayCommandList=[],this._useOIT=e.orderIndependentTranslucency??!0,this._executeOITFunction=void 0,this._depthPlane=new LG(e.depthPlaneEllipsoidOffset),this._clearColorCommand=new fi({color:new z,stencil:0,owner:this}),this._depthClearCommand=new fi({depth:1,owner:this}),this._stencilClearCommand=new fi({stencil:0}),this._classificationStencilClearCommand=new fi({stencil:0,renderState:Ge.fromCache({stencilMask:Xt.CLASSIFICATION_MASK})}),this._depthOnlyRenderStateCache={},this._transitioner=new D5(this),this._preUpdate=new be,this._postUpdate=new be,this._renderError=new be,this._preRender=new be,this._postRender=new be,this._controllerHost=new IG,this._minimumDisableDepthTestDistance=0,this._debugInspector=new Y5,this._msaaSamples=e.msaaSamples??4,this.rethrowRenderErrors=!1,this.completeMorphOnUserInput=!0,this.morphStart=new be,this.morphComplete=new be,this.skyBox=void 0,this.skyAtmosphere=void 0,this.sun=void 0,this.sunBloom=!0,this._sunBloom=void 0,this.moon=void 0,this.backgroundColor=z.clone(z.BLACK),this._mode=re.SCENE3D,this._mapProjection=l(e.mapProjection)?e.mapProjection:new ji(this._ellipsoid),this.morphTime=1,this.farToNearRatio=1e3,this.logarithmicDepthFarToNearRatio=1e9,this.nearToFarDistance2D=175e4,this.verticalExaggeration=1,this.verticalExaggerationRelativeHeight=0,this.debugCommandFilter=void 0,this.debugShowCommands=!1,this.debugShowFrustums=!1,this.debugShowFramesPerSecond=!1,this.debugShowDepthFrustum=1,this.debugShowFrustumPlanes=!1,this._debugShowFrustumPlanes=!1,this._debugFrustumPlanes=void 0,this.useDepthPicking=!0,this.pickTranslucentDepth=!1,this.cameraEventWaitTime=500,this.atmosphere=new KC,this.fog=new kG,this.fog.enabled=ee.WGS84.equals(this._ellipsoid),ee.WGS84.equals(this._ellipsoid)||(Nr.DEFAULT_VIEW_RECTANGLE=ie.fromDegrees(-45,-45,45,45)),this._shadowMapCamera=new Nr(this),this.shadowMap=new GA({context:o,lightCamera:this._shadowMapCamera,enabled:e.shadows??!1}),this.invertClassification=!1,this.invertClassificationColor=z.clone(z.WHITE),this._actualInvertClassificationColor=z.clone(this._invertClassificationColor),this._invertClassification=new qO,this.focalLength=void 0,this.eyeSeparation=void 0,this.postProcessStages=new w5,this._brdfLutGenerator=new AG,this._performanceDisplay=void 0,this._debugVolume=void 0,this._screenSpaceCameraController=new V5(this),this._cameraUnderground=!1,this._mapMode2D=e.mapMode2D??Yu.INFINITE_SCROLL,this._environmentState={skyBoxCommand:void 0,skyAtmosphereCommand:void 0,sunDrawCommand:void 0,sunComputeCommand:void 0,moonCommand:void 0,isSunVisible:!1,isMoonVisible:!1,isReadyForAtmosphere:!1,isSkyAtmosphereVisible:!1,clearGlobeDepth:!1,useDepthPlane:!1,renderTranslucentDepthForPick:!1,originalFramebuffer:void 0,useGlobeDepthFramebuffer:!1,useOIT:!1,useInvertClassification:!1,usePostProcess:!1,usePostProcessSelected:!1,useWebVR:!1},this._useWebVR=!1,this._cameraVR=void 0,this._aspectRatioVR=void 0,this.requestRenderMode=e.requestRenderMode??!1,this._renderRequested=!0,this.maximumRenderTimeChange=e.maximumRenderTimeChange??0,this._lastRenderTime=void 0,this._frameRateMonitor=void 0,this._removeRequestListenerCallback=El.requestCompletedEvent.addEventListener(P9(this)),this._removeTaskProcessorListenerCallback=$n.taskCompletedEvent.addEventListener(P9(this)),this._removeGlobeCallbacks=[],this._removeTerrainProviderReadyListener=void 0;let a=new et(0,0,o.drawingBufferWidth,o.drawingBufferHeight),c=new Nr(this);this._logDepthBuffer&&(c.frustum.near=.1,c.frustum.far=1e10),this.preloadFlightCamera=new Nr(this),this.preloadFlightCullingVolume=void 0,this._picking=new a5(this),this._defaultView=new Xw(this,c,a),this._view=this._defaultView,this._hdr=void 0,this._hdrDirty=void 0,this.highDynamicRange=!1,this.gamma=2.2,this.sphericalHarmonicCoefficients=void 0,this.specularEnvironmentMaps=void 0,this._specularEnvironmentCubeMap=void 0,this.light=new N_,this._enableEdgeVisibility=!1,this._enablePlanarFillId=!1,lLe(this,0,K.now()),this.updateFrameState(),this.initializeFrame()}_i.defaultLogDepthBuffer=!0;function Qkt(e,t){for(let i=0;i<e._removeGlobeCallbacks.length;++i)e._removeGlobeCallbacks[i]();e._removeGlobeCallbacks.length=0;let n=[];l(t)&&(n.push(t.imageryLayersUpdatedEvent.addEventListener(P9(e))),n.push(t.terrainProviderChanged.addEventListener(P9(e)))),e._removeGlobeCallbacks=n}Object.defineProperties(_i.prototype,{canvas:{get:function(){return this._canvas}},drawingBufferHeight:{get:function(){return this._context.drawingBufferHeight}},drawingBufferWidth:{get:function(){return this._context.drawingBufferWidth}},maximumAliasedLineWidth:{get:function(){return Ut.maximumAliasedLineWidth}},maximumCubeMapSize:{get:function(){return Ut.maximumCubeMapSize}},pickPositionSupported:{get:function(){return this._context.depthTexture}},sampleHeightSupported:{get:function(){return this._context.depthTexture}},clampToHeightSupported:{get:function(){return this._context.depthTexture}},invertClassificationSupported:{get:function(){return this._context.depthTexture}},specularEnvironmentMapsSupported:{get:function(){return op.isSupported(this._context)}},ellipsoid:{get:function(){return this._ellipsoid}},globe:{get:function(){return this._globe},set:function(e){this._globe=this._globe&&this._globe.destroy(),this._globe=e,Qkt(this,e)}},primitives:{get:function(){return this._primitives}},groundPrimitives:{get:function(){return this._groundPrimitives}},camera:{get:function(){return this._view.camera},set:function(e){this._view.camera=e}},view:{get:function(){return this._view},set:function(e){this._view=e}},defaultView:{get:function(){return this._defaultView}},picking:{get:function(){return this._picking}},controllerHost:{get:function(){return this._controllerHost}},screenSpaceCameraController:{get:function(){return this._screenSpaceCameraController}},mapProjection:{get:function(){return this._mapProjection}},jobScheduler:{get:function(){return this._jobScheduler}},frameState:{get:function(){return this._frameState}},environmentState:{get:function(){return this._environmentState}},tweens:{get:function(){return this._tweens}},imageryLayers:{get:function(){if(l(this.globe))return this.globe.imageryLayers}},terrainProvider:{get:function(){if(l(this.globe))return this.globe.terrainProvider},set:function(e){this._removeTerrainProviderReadyListener=this._removeTerrainProviderReadyListener&&this._removeTerrainProviderReadyListener(),l(this.globe)&&(this.globe.terrainProvider=e)}},terrainProviderChanged:{get:function(){if(l(this.globe))return this.globe.terrainProviderChanged}},vectorProvider:{get:function(){return this.globe?.vectorProvider}},preUpdate:{get:function(){return this._preUpdate}},postUpdate:{get:function(){return this._postUpdate}},renderError:{get:function(){return this._renderError}},preRender:{get:function(){return this._preRender}},postRender:{get:function(){return this._postRender}},lastRenderTime:{get:function(){return this._lastRenderTime}},context:{get:function(){return this._context}},debugFrustumStatistics:{get:function(){return this._view.debugFrustumStatistics}},scene3DOnly:{get:function(){return this._frameState.scene3DOnly}},orderIndependentTranslucency:{get:function(){return this._useOIT}},id:{get:function(){return this._id}},mode:{get:function(){return this._mode},set:function(e){e===re.SCENE2D?this.morphTo2D(0):e===re.SCENE3D?this.morphTo3D(0):e===re.COLUMBUS_VIEW&&this.morphToColumbusView(0),this._mode=e}},frustumCommandsList:{get:function(){return this._view.frustumCommandsList}},numberOfFrustums:{get:function(){return this._view.frustumCommandsList.length}},useWebVR:{get:function(){return this._useWebVR},set:function(e){this._useWebVR=e,this._useWebVR?(this._frameState.creditDisplay.container.style.visibility="hidden",this._cameraVR=new Nr(this),l(this._deviceOrientationCameraController)||(this._deviceOrientationCameraController=new BG(this)),this._aspectRatioVR=this.camera.frustum.aspectRatio):(this._frameState.creditDisplay.container.style.visibility="visible",this._cameraVR=void 0,this._deviceOrientationCameraController=this._deviceOrientationCameraController&&!this._deviceOrientationCameraController.isDestroyed()&&this._deviceOrientationCameraController.destroy(),this.camera.frustum.aspectRatio=this._aspectRatioVR,this.camera.frustum.xOffset=0)}},mapMode2D:{get:function(){return this._mapMode2D}},splitPosition:{get:function(){return this._frameState.splitPosition},set:function(e){this._frameState.splitPosition=e}},minimumDisableDepthTestDistance:{get:function(){return this._minimumDisableDepthTestDistance},set:function(e){this._minimumDisableDepthTestDistance=e}},logarithmicDepthBuffer:{get:function(){return this._logDepthBuffer},set:function(e){e=this._context.fragmentDepth&&e,this._logDepthBuffer!==e&&(this._logDepthBuffer=e,this._logDepthBufferDirty=!0)}},gamma:{get:function(){return this._context.uniformState.gamma},set:function(e){this._context.uniformState.gamma=e}},highDynamicRange:{get:function(){return this._hdr},set:function(e){let t=this._context,n=e&&t.depthTexture&&(t.colorBufferFloat||t.colorBufferHalfFloat);this._hdrDirty=n!==this._hdr,this._hdr=n}},highDynamicRangeSupported:{get:function(){let e=this._context;return e.depthTexture&&(e.colorBufferFloat||e.colorBufferHalfFloat)}},cameraUnderground:{get:function(){return this._cameraUnderground}},msaaSamples:{get:function(){return this._msaaSamples},set:function(e){e=Math.min(e,Ut.maximumSamples),this._msaaSamples=e}},msaaSupported:{get:function(){return this._context.msaa}},pixelRatio:{get:function(){return this._frameState.pixelRatio},set:function(e){this._frameState.pixelRatio=e}},opaqueFrustumNearOffset:{get:function(){return .9999}},globeHeight:{get:function(){return this._globeHeight}}});_i.prototype.getCompressedTextureFormatSupported=function(e){let t=this.context;return(e==="WEBGL_compressed_texture_s3tc"||e==="s3tc")&&t.s3tc||(e==="WEBGL_compressed_texture_pvrtc"||e==="pvrtc")&&t.pvrtc||(e==="WEBGL_compressed_texture_etc"||e==="etc")&&t.etc||(e==="WEBGL_compressed_texture_etc1"||e==="etc1")&&t.etc1||(e==="WEBGL_compressed_texture_astc"||e==="astc")&&t.astc||(e==="EXT_texture_compression_bptc"||e==="bc7")&&t.bc7};function e3t(e,t){let n=e.pickedMetadataInfo,i=t.pickedMetadataInfo;return n?.schemaId!==i?.schemaId||n?.className!==i?.className||n?.propertyName!==i?.propertyName}function rLe(e,t,n){let i=e._frameState,r=e._context,o=e._view.oit,{lightShadowMaps:s,lightShadowsEnabled:a}=i.shadowState,c=t.derivedCommands;l(t.pickId)&&(c.picking=c0.createPickDerivedCommand(e,t,r,c.picking)),l(t.snapId)&&i.passes.snap&&(c.snapping=c0.createSnapDerivedCommand(e,t,r,c.snapping)),i.pickingMetadata&&t.pickMetadataAllowed&&(t.pickedMetadataInfo=i.pickedMetadataInfo,l(t.pickedMetadataInfo)&&(c.pickingMetadata=c0.createPickMetadataDerivedCommand(e,t,r,c.pickingMetadata))),t.pickOnly||(c.depth=c0.createDepthOnlyDerivedCommand(e,t,r,c.depth)),c.originalCommand=t,e._hdr&&(c.hdr=c0.createHdrCommand(t,r,c.hdr),t=c.hdr.command,c=t.derivedCommands),a&&t.receiveShadows&&(c.shadows=GA.createReceiveDerivedCommand(s,t,n,r,c.shadows)),t.pass===Ie.TRANSLUCENT&&l(o)&&o.isSupported()&&(a&&t.receiveShadows?(c.oit=l(c.oit)?c.oit:{},c.oit.shadows=o.createDerivedCommands(c.shadows.receiveCommand,r,c.oit.shadows)):c.oit=o.createDerivedCommands(t,r,c.oit))}_i.prototype.updateDerivedCommands=function(e){let{derivedCommands:t}=e;if(!l(t))return;let n=this._frameState,{shadowState:i,useLogDepth:r}=this._frameState,o=this._context,s=!1,a=i.lastDirtyTime;e.lastDirtyTime!==a&&(e.lastDirtyTime=a,e.dirty=!0,s=!0);let c=this._hdr,u=l(t.logDepth),f=l(t.hdr),d=l(t.originalCommand),p=r&&!u,g=c&&!f,m=(!r||!c)&&!d,y=n.pickingMetadata&&e3t(e,n),A=n.passes.snap&&l(e.snapId)&&!l(t.snapping);if(e.dirty=e.dirty||p||g||m||y||A,!e.dirty)return;e.dirty=!1;let{shadowsEnabled:b,shadowMaps:x}=i;b&&e.castShadows&&(t.shadows=GA.createCastDerivedCommand(x,e,s,o,t.shadows)),(u||p)&&(t.logDepth=c0.createLogDepthCommand(e,o,t.logDepth),rLe(this,t.logDepth.command,s)),(d||m)&&rLe(this,e,s)};var t3t=new Am({pass:po.RENDER}),ise=new Am({pass:po.PRELOAD}),rse=new Am({pass:po.PRELOAD_FLIGHT}),n3t=new Am({pass:po.REQUEST_RENDER_MODE_DEFER_CHECK}),oLe=new ue,ose;function i3t(e){if(!(e._mode!==re.SCENE3D||!e.globe?.show||e._cameraUnderground||e._globeTranslucencyState.translucent))return oLe.radius=e.ellipsoid.minimumRadius+e.frameState.minimumTerrainHeight,ose=yG.fromBoundingSphere(oLe,e.camera.positionWC,ose),ose}_i.prototype.clearPasses=function(e){e.render=!1,e.pick=!1,e.pickVoxel=!1,e.snap=!1,e.depth=!1,e.postProcess=!1,e.offscreen=!1};function lLe(e,t,n){let i=e._frameState;i.frameNumber=t,i.time=K.clone(n,i.time)}_i.prototype.updateFrameState=function(){let e=this.camera,t=this._frameState;t.commandList.length=0,t.shadowMaps.length=0,t.brdfLutGenerator=this._brdfLutGenerator,t.environmentMap=this.skyBox&&this.skyBox._cubeMap,t.mode=this._mode,t.morphTime=this.morphTime,t.mapProjection=this.mapProjection,t.camera=e,t.cullingVolume=e.frustum.computeCullingVolume(e.positionWC,e.directionWC,e.upWC),t.occluder=i3t(this),t.minimumTerrainHeight=0,t.minimumDisableDepthTestDistance=this._minimumDisableDepthTestDistance,t.invertClassification=this.invertClassification,t.useLogDepth=this._logDepthBuffer&&!(this.camera.frustum instanceof _n||this.camera.frustum instanceof Ss),t.light=this.light,t.cameraUnderground=this._cameraUnderground,t.globeTranslucencyState=this._globeTranslucencyState;let{globe:n}=this;l(n)&&n._terrainExaggerationChanged&&(this.verticalExaggeration=n._terrainExaggeration,this.verticalExaggerationRelativeHeight=n._terrainExaggerationRelativeHeight,n._terrainExaggerationChanged=!1),t.verticalExaggeration=this.verticalExaggeration,t.verticalExaggerationRelativeHeight=this.verticalExaggerationRelativeHeight,l(this._specularEnvironmentCubeMap)&&this._specularEnvironmentCubeMap.ready?(t.specularEnvironmentMaps=this._specularEnvironmentCubeMap.texture,t.specularEnvironmentMapsMaximumLOD=this._specularEnvironmentCubeMap.maximumMipmapLevel):(t.specularEnvironmentMaps=void 0,t.specularEnvironmentMapsMaximumLOD=void 0),t.sphericalHarmonicCoefficients=this.sphericalHarmonicCoefficients,this._actualInvertClassificationColor=z.clone(this.invertClassificationColor,this._actualInvertClassificationColor),qO.isTranslucencySupported(this._context)||(this._actualInvertClassificationColor.alpha=1),t.invertClassificationColor=this._actualInvertClassificationColor,l(this.globe)?t.maximumScreenSpaceError=this.globe.maximumScreenSpaceError:t.maximumScreenSpaceError=2,this.clearPasses(t.passes),t.tilesetPassState=void 0};_i.prototype.isVisible=function(e,t,n){if(!l(t))return!1;let{boundingVolume:i}=t;return!l(i)||!t.cull?!0:e.computeVisibility(i)===$t.OUTSIDE?!1:!l(n)||!t.occlude||!i.isOccluded(n)};var I9=new M(0,0,1,0,1,0,0,0,0,1,0,0,0,0,0,1);I9=M.inverseTransformation(I9,I9);function r3t(e,t,n,i){let r=t._frameState,o=r.context,s=e.boundingVolume;l(t._debugVolume)&&t._debugVolume.destroy();let a=h.clone(s.center);if(r.mode!==re.SCENE3D){a=M.multiplyByPoint(I9,a,a);let m=r.mapProjection,y=m.unproject(a);a=m.ellipsoid.cartographicToCartesian(y)}let c,u,{radius:f}=s;l(f)?(c=ac.createGeometry(new ac({radii:new h(f,f,f),vertexFormat:An.FLAT_VERTEX_FORMAT})),u=M.fromTranslation(a)):(c=zc.createGeometry(zc.fromDimensions({dimensions:new h(2,2,2),vertexFormat:An.FLAT_VERTEX_FORMAT})),u=M.fromRotationTranslation(s.halfAxes,a,new M)),t._debugVolume=new Mn({geometryInstances:new Bt({geometry:Wn.toWireframe(c),modelMatrix:u,attributes:{color:new Jt(1,0,0,1)}}),appearance:new An({flat:!0,translucent:!1}),asynchronous:!1});let d=r.commandList,p=r.commandList=[];t._debugVolume.update(r),e=p[0],r.useLogDepth&&(e=c0.createLogDepthCommand(e,o).command);let g;l(i)&&(g=n.framebuffer,n.framebuffer=i),e.execute(o,n),l(g)&&(n.framebuffer=g),r.commandList=d}function Jl(e,t,n,i){let r=t._frameState,o=t._context;if(l(t.debugCommandFilter)&&!t.debugCommandFilter(e))return;if(e instanceof fi){e.execute(o,n);return}e.debugShowBoundingVolume&&l(e.boundingVolume)&&r3t(e,t,n,i),r.useLogDepth&&l(e.derivedCommands.logDepth)&&(e=e.derivedCommands.logDepth.command);let s=r.passes;if(!s.pick&&!s.pickVoxel&&!s.depth&&t._hdr&&l(e.derivedCommands)&&l(e.derivedCommands.hdr)&&(e=e.derivedCommands.hdr.command),s.pick||s.depth){if(s.pick&&!s.depth){if(r.passes.snap){l(e.derivedCommands.snapping)?(e=e.derivedCommands.snapping.snapCommand,e.execute(o,n)):l(e.derivedCommands.depth)&&(e=e.derivedCommands.depth.depthOnlyCommand,e.execute(o,n));return}if(r.pickingMetadata&&l(e.derivedCommands.pickingMetadata)){e=e.derivedCommands.pickingMetadata.pickMetadataCommand,e.execute(o,n);return}if(!r.pickingMetadata&&l(e.derivedCommands.picking)){e=e.derivedCommands.picking.pickCommand,e.execute(o,n);return}}else if(l(e.derivedCommands.depth)){e=e.derivedCommands.depth.depthOnlyCommand,e.execute(o,n);return}}if(t.debugShowCommands||t.debugShowFrustums){t._debugInspector.executeDebugShowFrustumsCommand(t,e,n);return}r.shadowState.lightShadowsEnabled&&e.receiveShadows&&l(e.derivedCommands.shadows)?e.derivedCommands.shadows.receiveCommand.execute(o,n):e.execute(o,n)}function sLe(e,t,n){let{derivedCommands:i}=e;if(!l(i))return;let r=t._frameState,o=t._context;r.useLogDepth&&l(i.logDepth)&&(e=i.logDepth.command);let{picking:s,pickingMetadata:a,depth:c}=e.derivedCommands;l(a)&&(e=i.pickingMetadata.pickMetadataCommand,e.execute(o,n)),l(s)?(e=s.pickCommand,e.execute(o,n)):l(c)&&(e=c.depthOnlyCommand,e.execute(o,n))}function uLe(e,t,n){return t.boundingVolume.distanceSquaredTo(n)-e.boundingVolume.distanceSquaredTo(n)}var o3t=new h;function aLe(e,t){let n=h.subtract(e,t,o3t),i=Math.max(0,h.magnitude(n));return i*i}function s3t(e,t,n){let i=e.boundingVolume,r=t.boundingVolume;return aLe(r.center,n)-aLe(i.center,n)}function a3t(e,t,n){return e.boundingVolume.distanceSquaredTo(n)-t.boundingVolume.distanceSquaredTo(n)+P.EPSILON12}function c3t(e,t,n,i,r){t_(i,uLe,e.camera.positionWC),l(r)&&t(r.unclassifiedCommand,e,n);for(let o=0;o<i.length;++o)t(i[o],e,n)}function l3t(e,t,n,i,r){t_(i,a3t,e.camera.positionWC),l(r)&&t(r.unclassifiedCommand,e,n);for(let o=0;o<i.length;++o)t(i[o],e,n)}function u3t(e,t,n){e.context.uniformState.updatePass(Ie.VOXELS);let i=n.commands[Ie.VOXELS];i.length=n.indices[Ie.VOXELS],t_(i,uLe,e.camera.positionWC);for(let r=0;r<i.length;++r)Jl(i[r],e,t)}function f3t(e,t,n){e.context.uniformState.updatePass(Ie.GAUSSIAN_SPLATS);let i=n.commands[Ie.GAUSSIAN_SPLATS];i.length=n.indices[Ie.GAUSSIAN_SPLATS],t_(i,s3t,e.camera.positionWC);for(let r=0;r<i.length;++r)Jl(i[r],e,t)}var d3t=new er,h3t=new Wu,m3t=new _n,p3t=new Ss;function g3t(e){let{frustum:t}=e;return l(t.fov)?t.clone(d3t):l(t.infiniteProjectionMatrix)?t.clone(h3t):l(t.width)?t.clone(m3t):t.clone(p3t)}function _3t(e){if(e._environmentState.useOIT){if(!l(e._executeOITFunction)){let{view:t,context:n}=e;e._executeOITFunction=function(i,r,o,s,a){t.globeDepth.prepareColorTextures(n),t.oit.executeCommands(i,r,o,s,a)}}return e._executeOITFunction}return e.frameState.passes.render?c3t:l3t}function y3t(e,t,n){let{frameState:i,context:r}=e,{pick:o,pickVoxel:s}=i.passes,a=o||s,c;!a&&e._environmentState.useInvertClassification&&i.invertClassificationColor.alpha<1&&(c=e._invertClassification);let u=_3t(e);r.uniformState.updatePass(Ie.TRANSLUCENT);let f=n.commands[Ie.TRANSLUCENT];f.length=n.indices[Ie.TRANSLUCENT],u(e,Jl,t,f,c)}function A3t(e,t,n){let{translucentTileClassification:i,globeDepth:r}=e._view;if(!(n.indices[Ie.CESIUM_3D_TILE_CLASSIFICATION]>0)||!i.isSupported())return;let s=n.commands[Ie.TRANSLUCENT];i.executeTranslucentCommands(e,Jl,t,s,r.depthStencilTexture),i.executeClassificationCommands(e,Jl,t,n)}function b3t(e,t,n){e.context.uniformState.updatePass(Ie.CESIUM_3D_TILE_EDGES);let i=t.framebuffer;e.context.uniformState.edgeColorTexture=e.context.defaultTexture,e.context.uniformState.edgeIdTexture=e.context.defaultTexture,e.context.uniformState.edgeDepthTexture=e.context.defaultTexture,e._enableEdgeVisibility&&l(e._view)&&l(e._view.edgeFramebuffer)&&(t.framebuffer=e._view.edgeFramebuffer.framebuffer);let r=n.commands[Ie.CESIUM_3D_TILE_EDGES],o=n.indices[Ie.CESIUM_3D_TILE_EDGES];e._enableEdgeVisibility&&l(e._view)&&l(e._view.edgeFramebuffer)&&e._view.edgeFramebuffer.getClearCommand(new z(0,0,0,0)).execute(e.context,t);for(let s=0;s<o;++s)Jl(r[s],e,t);t.framebuffer=i}function x3t(e,t,n){let{context:i}=e,{uniformState:r}=i;r.updatePass(Ie.CESIUM_3D_TILE_PLANAR_FILL_ID),r.planarFillIdTexture=i.defaultTexture;let o=e._view,s=o&&o.planarFillIdFramebuffer,a=n.commands[Ie.CESIUM_3D_TILE_PLANAR_FILL_ID],c=n.indices[Ie.CESIUM_3D_TILE_PLANAR_FILL_ID];if(c!==0&&e._enablePlanarFillId&&l(s)&&l(s.framebuffer)){let u=t.framebuffer;t.framebuffer=s.framebuffer,s.getClearCommand(new z(0,0,0,0)).execute(i,t);for(let d=0;d<c;++d)Jl(a[d],e,t);t.framebuffer=u}}function T3t(e,t,n){e.context.uniformState.updatePass(Ie.CESIUM_3D_TILE_EDGES_DIRECT);let i=n.commands[Ie.CESIUM_3D_TILE_EDGES_DIRECT],r=n.indices[Ie.CESIUM_3D_TILE_EDGES_DIRECT];for(let o=0;o<r;++o)Jl(i[o],e,t)}function ase(e,t){let{camera:n,context:i,frameState:r}=e,{uniformState:o}=i;o.updateCamera(n),o.planarFillIdTexture=i.defaultTexture;let s=g3t(n);s.near=n.frustum.near,s.far=n.frustum.far;let a=r.passes,c=a.pick||a.pickVoxel;c||E3t(e,t);let{clearGlobeDepth:u,renderTranslucentDepthForPick:f,useDepthPlane:d,useGlobeDepthFramebuffer:p,useInvertClassification:g,usePostProcessSelected:m}=e._environmentState,{globeDepth:y,globeTranslucencyFramebuffer:A,sceneFramebuffer:b,frustumCommandsList:x}=e._view,T=x.length,E=e._globeTranslucencyState,v=e._depthClearCommand,S=e._stencilClearCommand,I=e._classificationStencilClearCommand,R=e._depthPlane,O=n.position.z;function L(C,w){o.updatePass(w);let D=C.commands[w],N=C.indices[w];for(let F=0;F<N;++F)Jl(D[F],e,t);return N}function _(C,w){o.updatePass(w);let D=C.commands[w],N=C.indices[w];for(let F=0;F<N;++F)sLe(D[F],e,t)}for(let C=0;C<T;++C){let w=T-C-1,D=x[w];e.mode===re.SCENE2D?(n.position.z=O-D.near+1,s.far=Math.max(1,D.far-D.near),s.near=1,o.update(r),o.updateFrustum(s)):(s.near=w!==0?D.near*e.opaqueFrustumNearOffset:D.near,s.far=D.far,o.updateFrustum(s)),v.execute(i,t),i.stencilBuffer&&S.execute(i,t),E.translucent?(o.updatePass(Ie.GLOBE),E.executeGlobeCommands(D,Jl,A,e,t)):L(D,Ie.GLOBE),p&&y.executeCopyDepth(i,t),f||(E.translucent?(o.updatePass(Ie.TERRAIN_CLASSIFICATION),E.executeGlobeClassificationCommands(D,Jl,A,e,t)):L(D,Ie.TERRAIN_CLASSIFICATION)),u&&(v.execute(i,t),d&&R.execute(i,t));let N;if(b3t(e,t,D),e._enableEdgeVisibility&&l(e._view)&&l(e._view.edgeFramebuffer)){let V=e._view.edgeFramebuffer.colorTexture;l(V)?e.context.uniformState.edgeColorTexture=V:e.context.uniformState.edgeColorTexture=e.context.defaultTexture;let B=e._view.edgeFramebuffer.idTexture;l(B)?e.context.uniformState.edgeIdTexture=B:e.context.uniformState.edgeIdTexture=e.context.defaultTexture;let j=e._view.edgeFramebuffer.depthTexture;l(j)?e.context.uniformState.edgeDepthTexture=j:e.context.uniformState.edgeDepthTexture=e.context.defaultTexture}else e.context.uniformState.edgeColorTexture=e.context.defaultTexture,e.context.uniformState.edgeIdTexture=e.context.defaultTexture,e.context.uniformState.edgeDepthTexture=e.context.defaultTexture;if(x3t(e,t,D),e._enablePlanarFillId&&l(e._view)&&l(e._view.planarFillIdFramebuffer)){let V=e._view.planarFillIdFramebuffer.idTexture;o.planarFillIdTexture=l(V)?V:i.defaultTexture}else o.planarFillIdTexture=i.defaultTexture;if(!g||c||f)N=L(D,Ie.CESIUM_3D_TILE),N>0&&(p&&(y.prepareColorTextures(i,u),y.executeUpdateDepth(i,t,y.depthStencilTexture)),f||(N=L(D,Ie.CESIUM_3D_TILE_CLASSIFICATION)));else{e._invertClassification.clear(i,t);let V=t.framebuffer;t.framebuffer=e._invertClassification._fbo.framebuffer,L(D,Ie.CESIUM_3D_TILE),p&&(e._invertClassification.prepareTextures(i),y.executeUpdateDepth(i,t,e._invertClassification._fbo.getDepthStencilTexture())),N=L(D,Ie.CESIUM_3D_TILE_CLASSIFICATION_IGNORE_SHOW),t.framebuffer=V,e._invertClassification.executeClassified(i,t),r.invertClassificationColor.alpha===1&&e._invertClassification.executeUnclassified(i,t),N>0&&i.stencilBuffer&&I.execute(i,t),N=L(D,Ie.CESIUM_3D_TILE_CLASSIFICATION)}if(N>0&&i.stencilBuffer&&S.execute(i,t),u3t(e,t,D),L(D,Ie.OPAQUE),T3t(e,t,D),f3t(e,t,D),w!==0&&e.mode!==re.SCENE2D&&(s.near=D.near,o.updateFrustum(s)),y3t(e,t,D),A3t(e,t,D),i.depthTexture&&e.useDepthPicking&&(p||f)){let V=e._picking.getPickDepth(e,w);V.update(i,y.depthStencilTexture),V.executeCopyDepth(i,t)}if(c||!m)continue;let F=t.framebuffer;t.framebuffer=b.getIdFramebuffer(),s.near=w!==0?D.near*e.opaqueFrustumNearOffset:D.near,s.far=D.far,o.updateFrustum(s),E.translucent?(o.updatePass(Ie.GLOBE),E.executeGlobeCommands(D,sLe,A,e,t)):_(D,Ie.GLOBE),u&&(v.framebuffer=t.framebuffer,v.execute(i,t),v.framebuffer=void 0),u&&d&&R.execute(i,t),_(D,Ie.CESIUM_3D_TILE),_(D,Ie.OPAQUE),_(D,Ie.TRANSLUCENT),t.framebuffer=F}}function E3t(e,t){let{context:n,environmentState:i,view:r}=e;if(n.uniformState.updatePass(Ie.ENVIRONMENT),l(i.skyBoxCommand)&&Jl(i.skyBoxCommand,e,t),i.isSkyAtmosphereVisible&&Jl(i.skyAtmosphereCommand,e,t),i.isSunVisible&&(i.sunDrawCommand.execute(n,t),e.sunBloom&&!i.useWebVR)){let s;i.useGlobeDepthFramebuffer?s=r.globeDepth.framebuffer:i.usePostProcess?s=r.sceneFramebuffer.framebuffer:s=i.originalFramebuffer,e._sunPostProcess.execute(n),e._sunPostProcess.copy(n,s),t.framebuffer=s}i.isMoonVisible&&i.moonCommand.execute(n,t);let o=e.frameState.panoramaCommandList;for(let s=o.length-1;s>=0;s--){let a=o[s];l(a.shaderProgram)?Jl(o[s],e,t):o.splice(s,1)}}function fLe(e){e.context.uniformState.updatePass(Ie.COMPUTE);let t=e._environmentState.sunComputeCommand;l(t)&&t.execute(e._computeEngine);let n=e._computeCommandList;for(let i=0;i<n.length;++i)n[i].execute(e._computeEngine)}function C3t(e,t){e.context.uniformState.updatePass(Ie.OVERLAY);let n=e.context,i=e._overlayCommandList;for(let r=0;r<i.length;++r)i[r].execute(n,t)}function v3t(e,t,n){let{shadowMapCullingVolume:i,isPointLight:r,passes:o}=n,s=o.length,a=[Ie.GLOBE,Ie.CESIUM_3D_TILE,Ie.OPAQUE,Ie.TRANSLUCENT];for(let c=0;c<t.length;++c){let u=t[c];if(e.updateDerivedCommands(u),!(!u.castShadows||a.indexOf(u.pass)<0||!e.isVisible(i,u)))if(r)for(let f=0;f<s;++f)o[f].commandList.push(u);else if(s===1)o[0].commandList.push(u);else{let f=!1;for(let d=s-1;d>=0;--d){let p=o[d].cullingVolume;if(e.isVisible(p,u))o[d].commandList.push(u),f=!0;else if(f)break}}}}function dLe(e){let{shadowState:t,commandList:n}=e.frameState,{shadowsEnabled:i,shadowMaps:r}=t;if(!i)return;let{context:o}=e,{uniformState:s}=o;for(let a=0;a<r.length;++a){let c=r[a];if(c.outOfView)continue;let{passes:u}=c;for(let f=0;f<u.length;++f)u[f].commandList.length=0;v3t(e,n,c);for(let f=0;f<u.length;++f){let d=c.passes[f],{camera:p,commandList:g}=d;s.updateCamera(p),c.updatePass(o,f);for(let m=0;m<g.length;++m){let y=g[m];s.updatePass(y.pass);let A=y.derivedCommands.shadows.castCommands[a];Jl(A,e,d.passState)}}}}var S3t=new h;_i.prototype.updateAndExecuteCommands=function(e,t){z3t(this,e,t),this._environmentState.useWebVR?w3t(this,e,t):this._frameState.mode!==re.SCENE2D||this._mapMode2D===Yu.ROTATE?JA(!0,this,e):F3t(this,e)};function w3t(e,t){let n=e._view,i=n.camera,o=e._environmentState.renderTranslucentDepthForPick;mLe(e),n.createPotentiallyVisibleSet(e),fLe(e),o||dLe(e);let s=t.viewport;s.x=0,s.y=0,s.width=s.width*.5;let a=Nr.clone(i,e._cameraVR);a.frustum=i.frustum;let c=i.frustum.near,u=c*(e.focalLength??5),f=e.eyeSeparation??u/30,d=h.multiplyByScalar(a.right,f*.5,S3t);i.frustum.aspectRatio=s.width/s.height;let p=.5*f*c/u;h.add(a.position,d,i.position),i.frustum.xOffset=p,ase(e,t),s.x=s.width,h.subtract(a.position,d,i.position),i.frustum.xOffset=-p,ase(e,t),Nr.clone(a,i)}var I3t=new he(Math.PI,P.PI_OVER_TWO),P3t=new h,D3t=new h,R3t=new M,O3t=new M,M3t=new h,N3t=new h,L3t=new et;function F3t(e,t){let{frameState:n,camera:i}=e,{uniformState:r}=e.context,o=t.viewport,s=et.clone(o,L3t);t.viewport=s;let a=I3t,c=P3t;e.mapProjection.project(a,c);let f=h.clone(i.position,D3t),d=M.clone(i.transform,O3t),p=i.frustum.clone();i._setTransform(M.IDENTITY);let g=M.computeViewportTransformation(s,0,1,R3t),m=i.frustum.projectionMatrix,y=i.positionWC.y,A=h.fromElements(P.sign(y)*c.x-y,0,-i.positionWC.x,M3t),b=At.pointToGLWindowCoordinates(m,g,A,N3t);b.x=Math.floor(b.x);let x=s.x,T=s.width;if(y===0||b.x<=x||b.x>=x+T)JA(!0,e,t);else if(Math.abs(x+T*.5-b.x)<1)s.width=b.x-s.x,i.position.x*=P.sign(i.position.x),i.frustum.right=0,n.cullingVolume=i.frustum.computeCullingVolume(i.positionWC,i.directionWC,i.upWC),r.update(n),JA(!0,e,t),s.x=b.x,i.position.x=-i.position.x,i.frustum.right=-i.frustum.left,i.frustum.left=0,n.cullingVolume=i.frustum.computeCullingVolume(i.positionWC,i.directionWC,i.upWC),r.update(n),JA(!1,e,t);else if(b.x>x+T*.5){s.width=b.x-x;let E=i.frustum.right;i.frustum.right=c.x-y,n.cullingVolume=i.frustum.computeCullingVolume(i.positionWC,i.directionWC,i.upWC),r.update(n),JA(!0,e,t),s.x=b.x,s.width=x+T-b.x,i.position.x=-i.position.x,i.frustum.left=-i.frustum.right,i.frustum.right=E-i.frustum.right*2,n.cullingVolume=i.frustum.computeCullingVolume(i.positionWC,i.directionWC,i.upWC),r.update(n),JA(!1,e,t)}else{s.x=b.x,s.width=x+T-b.x;let E=i.frustum.left;i.frustum.left=-c.x-y,n.cullingVolume=i.frustum.computeCullingVolume(i.positionWC,i.directionWC,i.upWC),r.update(n),JA(!0,e,t),s.x=x,s.width=b.x-x,i.position.x=-i.position.x,i.frustum.right=-i.frustum.left,i.frustum.left=E-i.frustum.left*2,n.cullingVolume=i.frustum.computeCullingVolume(i.positionWC,i.directionWC,i.upWC),r.update(n),JA(!1,e,t)}i._setTransform(d),h.clone(f,i.position),i.frustum=p.clone(),t.viewport=o}function JA(e,t,n){let i=t._view,{renderTranslucentDepthForPick:r}=t._environmentState;e||(t.frameState.commandList.length=0),mLe(t),i.createPotentiallyVisibleSet(t),e&&(fLe(t),r||dLe(t)),ase(t,n)}var cLe=new aa;function hLe(e,t,n){if(!e.show)return;let i=e.length;for(let r=0;r<i;++r){let o=e.get(r);if(o instanceof ql){hLe(o,t,n);continue}o.show&&jy.isSupported(o)&&us(o.heightReference)&&t.markForFrame(o,n,o.heightReference)}}function B3t(e,t){let n=e.vectorProvider;if(!l(n))return;let i=t.frameNumber;hLe(e._primitives,n,i)}_i.prototype.updateEnvironment=function(){let e=this._frameState,t=this._view,n=this._environmentState,i=e.passes.render,r=e.passes.offscreen,o=this.atmosphere,s=this.skyAtmosphere,a=this.globe,c=this._globeTranslucencyState;if(!i||this._mode!==re.SCENE2D&&t.camera.frustum instanceof _n||!c.environmentVisible)n.skyAtmosphereCommand=void 0,n.skyBoxCommand=void 0,n.sunDrawCommand=void 0,n.sunComputeCommand=void 0,n.moonCommand=void 0;else{if(l(s)){if(l(a))s.setDynamicLighting(xy.fromGlobeFlags(a)),n.isReadyForAtmosphere=n.isReadyForAtmosphere||!a.show||a._surface._tilesToRender.length>0;else{let b=o.dynamicLighting;s.setDynamicLighting(b),n.isReadyForAtmosphere=!0}n.skyAtmosphereCommand=s.update(e,a),l(n.skyAtmosphereCommand)&&this.updateDerivedCommands(n.skyAtmosphereCommand)}else n.skyAtmosphereCommand=void 0;n.skyBoxCommand=l(this.skyBox)?this.skyBox.update(e,this._hdr):void 0;let A=l(this.sun)?this.sun.update(e,t.passState,this._hdr):void 0;n.sunDrawCommand=l(A)?A.drawCommand:void 0,n.sunComputeCommand=l(A)?A.computeCommand:void 0,n.moonCommand=l(this.moon)?this.moon.update(e):void 0}let u=n.clearGlobeDepth=l(a)&&a.show&&(!a.depthTestAgainstTerrain||this.mode===re.SCENE2D);(n.useDepthPlane=u&&this.mode===re.SCENE3D&&c.useDepthPlane)&&this._depthPlane.update(e),n.renderTranslucentDepthForPick=!1,n.useWebVR=this._useWebVR&&this.mode!==re.SCENE2D&&!r;let d=e.mode===re.SCENE3D&&!c.sunVisibleThroughGlobe?e.occluder:void 0,p=e.cullingVolume,g=cLe.planes;for(let A=0;A<5;++A)g[A]=p.planes[A];p=cLe,n.isSkyAtmosphereVisible=l(n.skyAtmosphereCommand)&&n.isReadyForAtmosphere,n.isSunVisible=this.isVisible(p,n.sunDrawCommand,d),n.isMoonVisible=this.isVisible(p,n.moonCommand,d);let m=this.specularEnvironmentMaps,y=this._specularEnvironmentCubeMap;l(m)&&y?.url!==m?(l(y)&&y.destroy(),this._specularEnvironmentCubeMap=new op(m)):!l(m)&&l(y)&&(y.destroy(),this._specularEnvironmentCubeMap=void 0),l(this._specularEnvironmentCubeMap)&&this._specularEnvironmentCubeMap.update(e),B3t(this,e)};function k3t(e){let t=e._frameState;e.debugShowFrustumPlanes!==e._debugShowFrustumPlanes&&(e.debugShowFrustumPlanes?e._debugFrustumPlanes=new n_({camera:e.camera,updateOnChange:!1,frustumSplits:t.frustumSplits}):e._debugFrustumPlanes=e._debugFrustumPlanes&&e._debugFrustumPlanes.destroy(),e._debugShowFrustumPlanes=e.debugShowFrustumPlanes),l(e._debugFrustumPlanes)&&e._debugFrustumPlanes.update(t)}function U3t(e){let t=e._frameState,{passes:n,shadowState:i,shadowMaps:r}=t,o=r.length,s=o>0&&!n.pick&&!n.pickVoxel&&e.mode===re.SCENE3D;if(s!==i.shadowsEnabled&&(++i.lastDirtyTime,i.shadowsEnabled=s),i.lightShadowsEnabled=!1,!!s){for(let a=0;a<o;++a)if(r[a]!==i.shadowMaps[a]){++i.lastDirtyTime;break}i.shadowMaps.length=0,i.lightShadowMaps.length=0;for(let a=0;a<o;++a){let c=r[a];c.update(t),i.shadowMaps.push(c),c.fromLightSource&&(i.lightShadowMaps.push(c),i.lightShadowsEnabled=!0),c.dirty&&(++i.lastDirtyTime,c.dirty=!1)}}}function mLe(e){let t=e._frameState;t.edgeVisibilityRequested=!1,t.planarFillRequested=!1,e._groundPrimitives.update(t),e._primitives.update(t),t.edgeVisibilityRequested&&e._enableEdgeVisibility===!1&&(e._enableEdgeVisibility=!0),e._enablePlanarFillId=t.planarFillRequested,k3t(e),U3t(e),e._globe&&e._globe.render(t)}function z3t(e,t,n){let i=e._context,r=e._frameState,o=e._environmentState,s=e._view,a=r.passes,c=a.pick||a.pickVoxel;l(s.globeDepth)&&(s.globeDepth.picking=c,s.globeDepth.snapping=a.snap);let u=o.useWebVR;o.originalFramebuffer=t.framebuffer,l(e.sun)&&e.sunBloom!==e._sunBloom?(e.sunBloom&&!u?e._sunPostProcess=new q5:l(e._sunPostProcess)&&(e._sunPostProcess=e._sunPostProcess.destroy()),e._sunBloom=e.sunBloom):!l(e.sun)&&l(e._sunPostProcess)&&(e._sunPostProcess=e._sunPostProcess.destroy(),e._sunBloom=!1);let f=e._clearColorCommand;z.clone(n,f.color),f.execute(i,t);let d=o.useGlobeDepthFramebuffer=l(s.globeDepth);d&&(s.globeDepth.update(i,t,s.viewport,e.msaaSamples,e._hdr,o.clearGlobeDepth),s.globeDepth.clear(i,t,n));let p=s.oit,g=o.useOIT=!c&&l(p)&&p.isSupported();g&&(p.update(i,t,s.globeDepth.colorFramebufferManager,e._hdr,e.msaaSamples),p.clear(i,t,n),o.useOIT=p.isSupported());let m=e.postProcessStages,y=o.usePostProcess=!c&&(e._hdr||m.length>0||m.ambientOcclusion.enabled||m.fxaa.enabled||m.bloom.enabled);o.usePostProcessSelected=!1,y&&(s.sceneFramebuffer.update(i,s.viewport,e._hdr,e.msaaSamples),s.sceneFramebuffer.clear(i,t,n),m.update(i,r.useLogDepth,e._hdr),m.clear(i),y=o.usePostProcess=m.ready,o.usePostProcessSelected=y&&m.hasSelected),o.isSunVisible&&e.sunBloom&&!u?(t.framebuffer=e._sunPostProcess.update(t),e._sunPostProcess.clear(i,t,n)):d?t.framebuffer=s.globeDepth.framebuffer:y&&(t.framebuffer=s.sceneFramebuffer.framebuffer),l(t.framebuffer)&&f.execute(i,t);let A=o.useInvertClassification=!c&&l(t.framebuffer)&&e.invertClassification;if(!c&&e._enableEdgeVisibility&&s.edgeFramebuffer.update(i,s.viewport,e._hdr),!c&&e._enablePlanarFillId?s.planarFillIdFramebuffer.update(i,s.viewport,e._hdr):c||s.planarFillIdFramebuffer.releaseResources(),A){let T;if(r.invertClassificationColor.alpha===1&&d&&(T=s.globeDepth.framebuffer),l(T)||i.depthTexture){if(e._invertClassification.previousFramebuffer=T,e._invertClassification.update(i,e.msaaSamples,s.globeDepth.colorFramebufferManager),e._invertClassification.clear(i,t),r.invertClassificationColor.alpha<1&&g){let E=e._invertClassification.unclassifiedCommand,v=E.derivedCommands;v.oit=p.createDerivedCommands(E,i,v.oit)}}else o.useInvertClassification=!1}e._globeTranslucencyState.translucent&&s.globeTranslucencyFramebuffer.updateAndClear(e._hdr,s.viewport,i,t)}_i.prototype.resolveFramebuffers=function(e){let t=this._context,n=this._environmentState,i=this._view,{globeDepth:r,translucentTileClassification:o}=i;l(r)&&r.prepareColorTextures(t);let{useOIT:s,useGlobeDepthFramebuffer:a,usePostProcess:c,originalFramebuffer:u}=n,f=a?r.colorFramebufferManager:void 0,d=i.sceneFramebuffer._colorFramebuffer,p=i.sceneFramebuffer.idFramebuffer;if(s&&(e.framebuffer=c?d.framebuffer:u,i.oit.execute(t,e)),o.hasTranslucentDepth&&o.isSupported()&&o.execute(this,e),c){i.sceneFramebuffer.prepareColorTextures(t);let g=d;a&&!s&&(g=f);let m=this.postProcessStages,y=g.getColorTexture(0),A=p.getColorTexture(0),b=(f??d).getDepthStencilTexture();m.execute(t,y,b,A),m.copy(t,u)}!s&&!c&&a&&(e.framebuffer=u,r.executeCopyColor(t,e))};function V3t(e){let t=e._frameState.afterRender,n=t.slice();t.length=0;for(let i=0;i<n.length;++i)n[i]()&&e.requestRender()}function j3t(e){if(e.mode===re.MORPHING)return;let t=e.camera.positionCartographic;return e.getHeight(t)}function pLe(e,t,n){let i=Number.NEGATIVE_INFINITY;if(e instanceof ql){let r=e.length;for(let o=0;o<r;++o){let s=e.get(o),a=pLe(s,t,n);l(a)&&a>i&&(i=a)}}else if(e.isCesium3DTileset&&e.show&&e.enableCollision){let r=e.getHeight(t,n);if(l(r)&&r>i)return r}return i}_i.prototype.getHeight=function(e,t){if(!l(e))return;let n=this._frameState.frameNumber;this._heightQueryFrame!==n&&(this._heightQueryFrame=n,this._heightQueryCache.clear());let i=`${t}:${e.longitude.toFixed(8)}:${e.latitude.toFixed(8)}`,r=this._heightQueryCache.get(i);if(r!==void 0)return r===null?void 0:r;let o=H3t(this,e,t);return this._heightQueryCache.set(i,o===void 0?null:o),o};function H3t(e,t,n){let i=n===We.CLAMP_TO_TERRAIN||n===We.RELATIVE_TO_TERRAIN,r=n===We.CLAMP_TO_3D_TILE||n===We.RELATIVE_TO_3D_TILE;if(!l(t))return;let o=Number.NEGATIVE_INFINITY;if(!i){let a=pLe(e.primitives,t,e);l(a)&&a>o&&(o=a)}let s=e._globe;if(!r&&l(s)&&s.show){let a=s.getHeight(t);a>o&&(o=a)}if(o>Number.NEGATIVE_INFINITY)return o}var sse=new he;_i.prototype.updateHeight=function(e,t,n){let i=this._ellipsoid,r=g=>{he.clone(e,sse);let m;l(g)&&(m=g.height),l(m)||(m=this.getHeight(e,n)),l(m)&&(sse.height=m,t(sse))},o=n===We.CLAMP_TO_TERRAIN||n===We.RELATIVE_TO_TERRAIN,s=n===We.CLAMP_TO_3D_TILE||n===We.RELATIVE_TO_3D_TILE,a;!s&&l(this.globe)&&(a=this.globe._surface.updateHeight(e,r));let c={},u=g=>{if(o||g.isDestroyed()||!g.isCesium3DTileset)return;let m=g.updateHeight(e,r,i);c[g.id]=m};if(!o){let g=this.primitives.length;for(let m=0;m<g;++m){let y=this.primitives.get(m);u(y)}}let f=this.primitives.primitiveAdded.addEventListener(u),d=this.primitives.primitiveRemoved.addEventListener(g=>{g.isDestroyed()||!g.isCesium3DTileset||(l(c[g.id])&&c[g.id](),delete c[g.id])});return()=>{a=a&&a(),Object.values(c).forEach(g=>g()),c={},f(),d()}};function G3t(e){let t=e.camera,n=e._mode,i=e._screenSpaceCameraController,r=t.positionCartographic;if(!l(r))return!1;if(!i.onMap()&&r.height<0)return!0;if(n===re.SCENE2D||n===re.MORPHING)return!1;let o=e._globeHeight;return l(o)&&r.height<o}_i.prototype.initializeFrame=function(){if(this._shaderFrameCount++===120&&(this._shaderFrameCount=0,this._context.shaderCache.destroyReleasedShaderPrograms(),this._context.textureCache.destroyReleasedTextures()),this._tweens.update(),this._globeHeightDirty){l(this._removeUpdateHeightCallback)&&(this._removeUpdateHeightCallback(),this._removeUpdateHeightCallback=void 0),this._globeHeight=j3t(this),this._globeHeightDirty=!1;let e=this.camera.positionCartographic;this._removeUpdateHeightCallback=this.updateHeight(e,t=>{this.isDestroyed()||(this._globeHeight=t.height)})}this._cameraUnderground=G3t(this),this._globeTranslucencyState.update(this),this._screenSpaceCameraController.update(),l(this._deviceOrientationCameraController)&&this._deviceOrientationCameraController.update(),this.camera.update(this._mode),this.camera._updateCameraChanged()};function W3t(e,t){if(e.debugShowFramesPerSecond){if(!l(e._performanceDisplay)){let n=document.createElement("div");n.className="cesium-performanceDisplay-defaultContainer",e._canvas.parentNode.appendChild(n);let r=new zA({container:n});e._performanceDisplay=r,e._performanceContainer=n}e._performanceDisplay.throttled=e.requestRenderMode,e._performanceDisplay.update(t)}else l(e._performanceDisplay)&&(e._performanceDisplay=e._performanceDisplay&&e._performanceDisplay.destroy(),e._performanceContainer.parentNode.removeChild(e._performanceContainer))}function q3t(e){e._jobScheduler.resetBudgets();let t=e._frameState;e.primitives.prePassesUpdate(t),l(e.globe)&&e.globe.update(t),e._picking.update(),t.creditDisplay.update()}function Y3t(e){e.primitives.postPassesUpdate(e._frameState),El.update()}var X3t=new z;function K3t(e){let t=e._frameState,n=e.context,{uniformState:i}=n,r=e._defaultView;e._view=r,e.updateFrameState(),t.passes.render=!0,t.passes.postProcess=e.postProcessStages.hasSelected,t.tilesetPassState=t3t;let o=e.backgroundColor??z.BLACK;e._hdr&&(o=z.clone(o,X3t),o.red=Math.pow(o.red,e.gamma),o.green=Math.pow(o.green,e.gamma),o.blue=Math.pow(o.blue,e.gamma)),t.backgroundColor=o,t.atmosphere=e.atmosphere,e.fog.update(t),i.update(t);let s=e.shadowMap;l(s)&&s.enabled&&(!l(e.light)||e.light instanceof N_?h.negate(i.sunDirectionWC,e._shadowMapCamera.direction):h.clone(e.light.direction,e._shadowMapCamera.direction),t.shadowMaps.push(s)),e._computeCommandList.length=0,e._overlayCommandList.length=0;let a=r.viewport;a.x=0,a.y=0,a.width=n.drawingBufferWidth,a.height=n.drawingBufferHeight;let c=r.passState;c.framebuffer=void 0,c.blendingEnabled=void 0,c.scissorTest=void 0,c.viewport=et.clone(a,c.viewport),n.beginFrame(),l(e.globe)&&e.globe.beginFrame(t),e.updateEnvironment(),e.updateAndExecuteCommands(c,o),e.resolveFramebuffers(c),c.framebuffer=void 0,C3t(e,c),l(e.globe)&&(e.globe.endFrame(t),e.globe.tilesLoaded||(e._renderRequested=!0)),n.endFrame()}function KT(e,t){try{t(e)}catch(n){if(e._renderError.raiseEvent(e,n),e.rethrowRenderErrors)throw n}}function $3t(e){return e._picking.updateMostDetailedRayPicks(e)}_i.prototype.render=function(e){this._preUpdate.raiseEvent(this,e);let t=this._frameState;t.newFrame=!1,l(e)||(e=K.now()),this._controllerHost.update(this,e);let n=this._view.checkForCameraUpdates(this);n&&(this._globeHeightDirty=!0);let i=!this.requestRenderMode||this._renderRequested||n||this._logDepthBufferDirty||this._hdrDirty||this.mode===re.MORPHING;if(!i&&l(this.maximumRenderTimeChange)&&l(this._lastRenderTime)){let r=Math.abs(K.secondsDifference(this._lastRenderTime,e));i=i||r>this.maximumRenderTimeChange}if(i){this._lastRenderTime=K.clone(e,this._lastRenderTime),this._renderRequested=!1,this._logDepthBufferDirty=!1,this._hdrDirty=!1;let r=P.incrementWrap(t.frameNumber,Bx.maximumFrameNumber,1);lLe(this,r,e),t.newFrame=!0}KT(this,q3t),this.primitives.show&&(KT(this,$3t),KT(this,J3t),KT(this,Z3t),i||KT(this,Q3t)),this._postUpdate.raiseEvent(this,e),i&&(this._preRender.raiseEvent(this,e),t.creditDisplay.beginFrame(),KT(this,K3t)),W3t(this,i),KT(this,Y3t),V3t(this),i&&(this._postRender.raiseEvent(this,e),t.creditDisplay.endFrame())};_i.prototype.forceRender=function(e){this._renderRequested=!0,this.render(e)};_i.prototype.requestRender=function(){this._renderRequested=!0};_i.prototype.clampLineWidth=function(e){return Math.max(Ut.minimumAliasedLineWidth,Math.min(e,Ut.maximumAliasedLineWidth))};_i.prototype.pick=function(e,t,n){return this._picking.pick(this,e,t,n,1)[0]};_i.prototype.snap=function(e,t){return H5.snap(this,e,t)};_i.prototype.pickAsync=async function(e,t,n){return(await this._picking.pickAsync(this,e,t,n,1))[0]};_i.prototype.pickVoxel=function(e,t,n){let i=this.pick(e,t,n);if(!l(i))return;let r=i.primitive;if(!(r instanceof XT))return;let o=this._picking.pickVoxelCoordinate(this,e,t,n),s=255*o[0]+o[1],a=r._traversal.findKeyframeNode(s);if(!l(a))return;let c=255*o[2]+o[3];return X5.fromKeyframeNode(r,s,c,a)};_i.prototype.pickMetadata=function(e,t,n,i){let r=this.pick(e);if(!l(r))return;let o=r.detail?.model?.structuralMetadata;if(!l(o))return;let s=o.schema,a=v9(s,t,n,i);if(!l(a))return;let c=w9(o,n,i);if(!l(c))return;let u=new S9(t,n,i,a,c);return this._picking.pickMetadata(this,e,u)};_i.prototype.pickMetadataSchema=function(e){let t=this.pick(e);return l(t)?t.detail?.model?.structuralMetadata?.schema:void 0};_i.prototype.pickPositionWorldCoordinates=function(e,t){return this._picking.pickPositionWorldCoordinates(this,e,t)};_i.prototype.pickPosition=function(e,t){return this._picking.pickPosition(this,e,t)};_i.prototype.drillPick=function(e,t,n,i){return this._picking.drillPick(this,e,t,n,i)};function J3t(e){let t=e._frameState;ise.camera=t.camera,ise.cullingVolume=t.cullingVolume,e.primitives.updateForPass(t,ise)}function Z3t(e){let t=e._frameState;if(!t.camera.canPreloadFlight())return;rse.camera=e.preloadFlightCamera,rse.cullingVolume=e.preloadFlightCullingVolume,e.primitives.updateForPass(t,rse)}function Q3t(e){e.primitives.updateForPass(e._frameState,n3t)}_i.prototype.pickFromRay=function(e,t,n){return this._picking.pickFromRay(this,e,t,n)};_i.prototype.drillPickFromRay=function(e,t,n,i){return this._picking.drillPickFromRay(this,e,t,n,i)};_i.prototype.pickFromRayMostDetailed=function(e,t,n){return this._picking.pickFromRayMostDetailed(this,e,t,n)};_i.prototype.drillPickFromRayMostDetailed=function(e,t,n,i){return this._picking.drillPickFromRayMostDetailed(this,e,t,n,i)};_i.prototype.sampleHeight=function(e,t,n){return this._picking.sampleHeight(this,e,t,n)};_i.prototype.clampToHeight=function(e,t,n,i){return this._picking.clampToHeight(this,e,t,n,i)};_i.prototype.sampleHeightMostDetailed=function(e,t,n){return this._picking.sampleHeightMostDetailed(this,e,t,n)};_i.prototype.clampToHeightMostDetailed=function(e,t,n){return this._picking.clampToHeightMostDetailed(this,e,t,n)};_i.prototype.cartesianToCanvasCoordinates=function(e,t){return pr.worldToWindowCoordinates(this,e,t)};_i.prototype.completeMorph=function(){this._transitioner.completeMorph()};_i.prototype.morphTo2D=function(e){e=e??2,this._transitioner.morphTo2D(e,this._ellipsoid)};_i.prototype.morphToColumbusView=function(e){e=e??2,this._transitioner.morphToColumbusView(e,this._ellipsoid)};_i.prototype.morphTo3D=function(e){e=e??2,this._transitioner.morphTo3D(e,this._ellipsoid)};function eUt(e,t){if(e._removeTerrainProviderReadyListener=e._removeTerrainProviderReadyListener&&e._removeTerrainProviderReadyListener(),t.ready){l(e.globe)&&(e.globe.terrainProvider=t.provider);return}e.globe.terrainProvider=void 0,e._removeTerrainProviderReadyListener=t.readyEvent.addEventListener(n=>{l(e)&&l(e.globe)&&(e.globe.terrainProvider=n),e._removeTerrainProviderReadyListener()})}_i.prototype.setTerrain=function(e){return eUt(this,e),e};_i.prototype.isDestroyed=function(){return!1};_i.prototype.destroy=function(){this._tweens.removeAll(),this._computeEngine=this._computeEngine&&this._computeEngine.destroy(),this._screenSpaceCameraController=this._screenSpaceCameraController&&this._screenSpaceCameraController.destroy(),this._deviceOrientationCameraController=this._deviceOrientationCameraController&&!this._deviceOrientationCameraController.isDestroyed()&&this._deviceOrientationCameraController.destroy(),this._primitives=this._primitives&&this._primitives.destroy(),this._groundPrimitives=this._groundPrimitives&&this._groundPrimitives.destroy(),this._globe=this._globe&&this._globe.destroy(),this._removeTerrainProviderReadyListener=this._removeTerrainProviderReadyListener&&this._removeTerrainProviderReadyListener(),this.skyBox=this.skyBox&&this.skyBox.destroy(),this.skyAtmosphere=this.skyAtmosphere&&this.skyAtmosphere.destroy(),this._debugSphere=this._debugSphere&&this._debugSphere.destroy(),this.sun=this.sun&&this.sun.destroy(),this._sunPostProcess=this._sunPostProcess&&this._sunPostProcess.destroy(),this._depthPlane=this._depthPlane&&this._depthPlane.destroy(),this._transitioner=this._transitioner&&this._transitioner.destroy(),this._debugFrustumPlanes=this._debugFrustumPlanes&&this._debugFrustumPlanes.destroy(),this._brdfLutGenerator=this._brdfLutGenerator&&this._brdfLutGenerator.destroy(),this._picking=this._picking&&this._picking.destroy(),this._defaultView=this._defaultView&&this._defaultView.destroy(),this._view=void 0,this._removeCreditContainer&&this._canvas.parentNode.removeChild(this._creditContainer),this.postProcessStages=this.postProcessStages&&this.postProcessStages.destroy(),this._context=this._context&&this._context.destroy(),this._frameState.creditDisplay=this._frameState.creditDisplay&&this._frameState.creditDisplay.destroy(),l(this._performanceDisplay)&&(this._performanceDisplay=this._performanceDisplay&&this._performanceDisplay.destroy(),this._performanceContainer.parentNode.removeChild(this._performanceContainer)),this._removeRequestListenerCallback(),this._removeTaskProcessorListenerCallback();for(let e=0;e<this._removeGlobeCallbacks.length;++e)this._removeGlobeCallbacks[e]();return this._removeGlobeCallbacks.length=0,l(this._removeUpdateHeightCallback)&&(this._removeUpdateHeightCallback(),this._removeUpdateHeightCallback=void 0),le(this)};var D9=_i;function sI(e){e=e??ee.WGS84,this.show=!0,this.perFragmentAtmosphere=!1,this._ellipsoid=e;let t=1.025,n=h.multiplyByScalar(e.radii,t,new h);this._scaleMatrix=M.fromScale(n),this._modelMatrix=new M,this._command=new at({owner:this,modelMatrix:this._modelMatrix}),this._spSkyFromSpace=void 0,this._spSkyFromAtmosphere=void 0,this._flags=void 0,this.atmosphereLightIntensity=50,this.atmosphereRayleighCoefficient=new h(55e-7,13e-6,284e-7),this.atmosphereMieCoefficient=new h(21e-6,21e-6,21e-6),this.atmosphereRayleighScaleHeight=1e4,this.atmosphereMieScaleHeight=3200,this.atmosphereMieAnisotropy=.9,this.hueShift=0,this.saturationShift=0,this.brightnessShift=0,this._hueSaturationBrightness=new h;let i=new h;i.x=e.maximumRadius*t,i.y=e.maximumRadius,i.z=0,this._radiiAndDynamicAtmosphereColor=i;let r=this;this._command.uniformMap={u_radiiAndDynamicAtmosphereColor:function(){return r._radiiAndDynamicAtmosphereColor},u_hsbShift:function(){return r._hueSaturationBrightness.x=r.hueShift,r._hueSaturationBrightness.y=r.saturationShift,r._hueSaturationBrightness.z=r.brightnessShift,r._hueSaturationBrightness},u_atmosphereLightIntensity:function(){return r.atmosphereLightIntensity},u_atmosphereRayleighCoefficient:function(){return r.atmosphereRayleighCoefficient},u_atmosphereMieCoefficient:function(){return r.atmosphereMieCoefficient},u_atmosphereRayleighScaleHeight:function(){return r.atmosphereRayleighScaleHeight},u_atmosphereMieScaleHeight:function(){return r.atmosphereMieScaleHeight},u_atmosphereMieAnisotropy:function(){return r.atmosphereMieAnisotropy}}}Object.defineProperties(sI.prototype,{ellipsoid:{get:function(){return this._ellipsoid}}});sI.prototype.setDynamicLighting=function(e){this._radiiAndDynamicAtmosphereColor.z=e};var cse=new M;sI.prototype.update=function(e,t){if(!this.show)return;let n=e.mode;if(n!==re.SCENE3D&&n!==re.MORPHING||!e.passes.render)return;let i=M.fromRotationTranslation(e.context.uniformState.inverseViewRotation,h.ZERO,cse),r=M.multiplyTransformation(i,qi.Y_UP_TO_Z_UP,cse),o=M.multiply(this._scaleMatrix,r,cse);M.clone(o,this._modelMatrix);let s=e.context,a=tUt(this),c=e.globeTranslucencyState.translucent,u=this.perFragmentAtmosphere||c||!l(t)||!t.show,f=this._command;if(!l(f.vertexArray)){let p=ac.createGeometry(new ac({radii:new h(1,1,1),slicePartitions:256,stackPartitions:256,vertexFormat:Be.POSITION_ONLY}));f.vertexArray=Vn.fromGeometry({context:s,geometry:p,attributeLocations:Wn.createAttributeLocations(p),bufferUsage:Me.STATIC_DRAW}),f.renderState=Ge.fromCache({cull:{enabled:!0,face:Gi.FRONT},blending:nn.ALPHA_BLEND,depthMask:!1})}let d=a|u<<2|c<<3;if(d!==this._flags){this._flags=d;let p=[];a&&p.push("COLOR_CORRECT"),u&&p.push("PER_FRAGMENT_ATMOSPHERE"),c&&p.push("GLOBE_TRANSLUCENT");let g=new Xe({defines:p,sources:[Xm,pP,$2]}),m=new Xe({defines:p,sources:[Xm,pP,K2]});this._spSkyAtmosphere=Qt.fromCache({context:s,vertexShaderSource:g,fragmentShaderSource:m}),f.shaderProgram=this._spSkyAtmosphere}return f};function tUt(e){return!(P.equalsEpsilon(e.hueShift,0,P.EPSILON7)&&P.equalsEpsilon(e.saturationShift,0,P.EPSILON7)&&P.equalsEpsilon(e.brightnessShift,0,P.EPSILON7))}sI.prototype.isDestroyed=function(){return!1};sI.prototype.destroy=function(){let e=this._command;return e.vertexArray=e.vertexArray&&e.vertexArray.destroy(),this._spSkyAtmosphere=this._spSkyAtmosphere&&this._spSkyAtmosphere.destroy(),le(this)};var R9=sI;function _M(e){this.sources=e.sources,this._sources=void 0,this._transform=e.transform,this.show=e.show??!0,this._returnCommand=e.returnCommand??!1,this._addToPanoramaCommandList=!this._returnCommand,this._command=new at({modelMatrix:M.clone(M.IDENTITY),owner:this,pass:Ie.ENVIRONMENT}),this._cubeMap=void 0,this._attributeLocations=void 0,this._useHdr=void 0,this._hasError=!1,this._error=void 0;let t=e.credit;typeof t=="string"&&(t=new It(t)),this._credit=t}Object.defineProperties(_M.prototype,{transform:{get:function(){return this._transform}},credit:{get:function(){return l(this._credit)?this._credit:void 0}}});_M.prototype.update=function(e,t){let n=this,{mode:i,passes:r,context:o,panoramaCommandList:s}=e;if(!this.show||i!==re.SCENE3D&&i!==re.MORPHING||!r.render)return;if(this._hasError){let c=this._error;throw this._hasError=!1,this._error=void 0,c}if(this._sources!==this.sources){this._sources=this.sources;let c=this.sources;typeof c.positiveX=="string"?s2(o,this._sources).then(function(u){n._cubeMap=n._cubeMap&&n._cubeMap.destroy(),n._cubeMap=u}).catch(u=>{this._hasError=!0,this._error=u}):(this._cubeMap=this._cubeMap&&this._cubeMap.destroy(),this._cubeMap=new ls({context:o,source:c})),this._addToPanoramaCommandList=!0}let a=this._command;if(!l(a.vertexArray)){a.uniformMap={u_cubeMap:function(){return n._cubeMap},u_cubeMapPanoramaTransform:function(){return n._transform}};let c=zc.createGeometry(zc.fromDimensions({dimensions:new h(2,2,2),vertexFormat:Be.POSITION_ONLY})),u=this._attributeLocations=Wn.createAttributeLocations(c);a.vertexArray=Vn.fromGeometry({context:o,geometry:c,attributeLocations:u,bufferUsage:Me.STATIC_DRAW}),a.renderState=Ge.fromCache({depthTest:{enabled:!1},depthMask:!1,blending:nn.ALPHA_BLEND}),this._addToPanoramaCommandList=!0}if(!l(a.shaderProgram)||this._useHdr!==t){let c=new Xe({defines:[t?"HDR":""],sources:[J2]});a.shaderProgram=Qt.fromCache({context:o,vertexShaderSource:l(this._transform)?O2:Z2,fragmentShaderSource:c,attributeLocations:this._attributeLocations}),this._useHdr=t,this._addToPanoramaCommandList=!0}if(l(this._cubeMap)){if(this.show&&l(this._credit)&&!this._returnCommand&&e.creditDisplay.addCreditToNextFrame(this._credit),this._returnCommand)return a;this._addToPanoramaCommandList&&(s.push(a),this._addToPanoramaCommandList=!1)}};_M.prototype.isDestroyed=function(){return!1};_M.prototype.destroy=function(){let e=this._command;return e.vertexArray=e.vertexArray&&e.vertexArray.destroy(),e.shaderProgram=e.shaderProgram&&e.shaderProgram.destroy(),this._cubeMap=this._cubeMap&&this._cubeMap.destroy(),le(this)};var aI=_M;function $T(e){this._sources=e.sources,this._show=e.show??!0,this._panorama=new aI({sources:this._sources,show:this._show,returnCommand:!0})}Object.defineProperties($T.prototype,{sources:{get:function(){return this._panorama.sources},set:function(e){this._panorama.sources=e}},show:{get:function(){return this._panorama.show},set:function(e){this._panorama.show=e}}});$T.prototype.update=function(e,t){let{mode:n,passes:i}=e;if(!(n!==re.SCENE3D&&n!==re.MORPHING)&&i.render)return this._panorama.update(e,t)};$T.prototype.isDestroyed=function(){return!1};$T.prototype.destroy=function(){return this._panorama=this._panorama&&this._panorama.destroy(),le(this)};function cI(e){return Zt(`Assets/Textures/SkyBox/tycho2t3_80_${e}.jpg`)}$T.createEarthSkyBox=function(){return new $T({sources:{positiveX:cI("px"),negativeX:cI("mx"),positiveY:cI("py"),negativeY:cI("my"),positiveZ:cI("pz"),negativeZ:cI("mz")}})};var O9=$T;function AM(){this.show=!0,this._drawCommand=new at({primitiveType:Oe.TRIANGLES,boundingVolume:new ue,owner:this}),this._commands={drawCommand:this._drawCommand,computeCommand:void 0},this._boundingVolume=new ue,this._boundingVolume2D=new ue,this._texture=void 0,this._drawingBufferWidth=void 0,this._drawingBufferHeight=void 0,this._radiusTS=void 0,this._size=void 0,this.glowFactor=1,this._glowFactorDirty=!1,this._useHdr=void 0;let e=this;this._uniformMap={u_texture:function(){return e._texture},u_size:function(){return e._size}}}Object.defineProperties(AM.prototype,{glowFactor:{get:function(){return this._glowFactor},set:function(e){e=Math.max(e,0),this._glowFactor=e,this._glowFactorDirty=!0}}});var nUt=new U,iUt=new U,rUt=new se,yM=new se;AM.prototype.update=function(e,t,n){if(!this.show)return;let i=e.mode;if(i===re.SCENE2D||i===re.MORPHING||!e.passes.render)return;let r=e.context,o=t.viewport.width,s=t.viewport.height;if(!l(this._texture)||o!==this._drawingBufferWidth||s!==this._drawingBufferHeight||this._glowFactorDirty||n!==this._useHdr){this._texture=this._texture&&this._texture.destroy(),this._drawingBufferWidth=o,this._drawingBufferHeight=s,this._glowFactorDirty=!1,this._useHdr=n;let E=Math.max(o,s);E=Math.pow(2,Math.ceil(Math.log(E)/Math.log(2))-2),E=Math.max(1,E);let v=n?r.halfFloatingPointTexture?ze.HALF_FLOAT:ze.FLOAT:ze.UNSIGNED_BYTE;this._texture=new Dt({context:r,width:E,height:E,pixelFormat:$e.RGBA,pixelDatatype:v}),this._glowLengthTS=this._glowFactor*5,this._radiusTS=1/(1+2*this._glowLengthTS)*.5;let S=this,I={u_radiusTS:function(){return S._radiusTS}};this._commands.computeCommand=new Jf({fragmentShaderSource:ek,outputTexture:this._texture,uniformMap:I,persists:!1,owner:this,postExecute:function(){S._commands.computeCommand=void 0}})}let a=this._drawCommand;if(!l(a.vertexArray)){let E={direction:0},v=new Uint8Array(8);v[0]=0,v[1]=0,v[2]=255,v[3]=0,v[4]=255,v[5]=255,v[6]=0,v[7]=255;let S=tt.createVertexBuffer({context:r,typedArray:v,usage:Me.STATIC_DRAW}),I=[{index:E.direction,vertexBuffer:S,componentsPerAttribute:2,normalize:!0,componentDatatype:Y.UNSIGNED_BYTE}],R=tt.createIndexBuffer({context:r,typedArray:new Uint16Array([0,1,2,0,2,3]),usage:Me.STATIC_DRAW,indexDatatype:je.UNSIGNED_SHORT});a.vertexArray=new Vn({context:r,attributes:I,indexBuffer:R}),a.shaderProgram=Qt.fromCache({context:r,vertexShaderSource:tk,fragmentShaderSource:Q2,attributeLocations:E}),a.renderState=Ge.fromCache({blending:nn.ALPHA_BLEND}),a.uniformMap=this._uniformMap}let c=r.uniformState.sunPositionWC,u=r.uniformState.sunPositionColumbusView,f=this._boundingVolume,d=this._boundingVolume2D;h.clone(c,f.center),d.center.x=u.z,d.center.y=u.x,d.center.z=u.y,f.radius=P.SOLAR_RADIUS+P.SOLAR_RADIUS*this._glowLengthTS,d.radius=f.radius,i===re.SCENE3D?ue.clone(f,a.boundingVolume):i===re.COLUMBUS_VIEW&&ue.clone(d,a.boundingVolume);let p=pr.computeActualEllipsoidPosition(e,c,yM),g=h.magnitude(h.subtract(p,e.camera.position,yM)),m=r.uniformState.projection,y=rUt;y.x=0,y.y=0,y.z=-g,y.w=1;let A=M.multiplyByVector(m,y,yM),b=pr.clipToGLWindowCoordinates(t.viewport,A,nUt);y.x=P.SOLAR_RADIUS;let x=M.multiplyByVector(m,y,yM),T=pr.clipToGLWindowCoordinates(t.viewport,x,iUt);return this._size=U.magnitude(U.subtract(T,b,yM)),this._size=2*this._size*(1+2*this._glowLengthTS),this._size=Math.ceil(this._size),this._commands};AM.prototype.isDestroyed=function(){return!1};AM.prototype.destroy=function(){let e=this._drawCommand;return e.vertexArray=e.vertexArray&&e.vertexArray.destroy(),e.shaderProgram=e.shaderProgram&&e.shaderProgram.destroy(),this._texture=this._texture&&this._texture.destroy(),le(this)};var M9=AM;var yLe=js(rN(),1);function oUt(e,t,n){return` float clipDistance = clip(gl_FragCoord, ${e}, ${t}); +}`});function aDe(){this.shape=Ic.BOX,this.dimensions=new h(1,1,1),this.names=["data"],this.types=[bt.SCALAR],this.componentTypes=[Lt.FLOAT32],this.maximumTileCount=1}aDe.prototype.requestData=function(e){if((l(e)?e.tileLevel??0:0)>=1)return;let n=new uw({metadata:[new Float32Array(1)]});return Promise.resolve(n)};e0.DefaultProvider=new aDe;var bT=e0;function _Ot(e,t,n,i){if(!l(e)||l(t)&&e.id!==t)return;let o=(e.classes||{})[n];if(!l(o))return;let a=(o.properties||{})[i];if(l(a))return a}var fG=_Ot;function yOt(e,t,n,i,r){this.schemaId=e,this.className=t,this.propertyName=n,this.classProperty=i,this.metadataProperty=r}var dG=yOt;function AOt(e,t,n){if(!l(e))return;let i=e.propertyTextures;for(let r of i)if(r.class.id===t){let a=r.properties[n];if(l(a))return a}}var hG=AOt;var pG=function(e){return function(){e.frameState.afterRender.push(function(){e.requestRender()})}};function _i(e){e=e??H.EMPTY_OBJECT;let t=e.canvas,n=e.creditContainer,i=e.creditViewport,r=e.contextOptions instanceof u2;if(r)this._context=e.contextOptions.createSceneContext(t);else{let u=Ze(e.contextOptions);this._context=new qE(t,u)}let o=this._context,s=l(n);s||(n=document.createElement("div"),n.style.position="absolute",n.style.bottom="0",n.style["text-shadow"]="0 0 2px #000000",n.style.color="#ffffff",n.style["font-size"]="10px",n.style["padding-right"]="5px",t.parentNode.appendChild(n)),l(i)||(i=t.parentNode),this._id=Kn(),this._jobScheduler=new w6,this._heightQueryCache=new Map,this._heightQueryFrame=-1,this._frameState=new Yx(o,new g6(n,"\u2022",i),this._jobScheduler),this._frameState.scene3DOnly=e.scene3DOnly??!1,this._removeCreditContainer=!s,this._creditContainer=n,this._canvas=t,this._computeEngine=new tL(o),this._ellipsoid=e.ellipsoid??ee.default,this._globe=void 0,this._globeTranslucencyState=new v6,this._primitives=new Rl({countReferences:r}),this._groundPrimitives=new Rl({countReferences:r}),this._globeHeight=void 0,this._globeHeightDirty=!0,this._cameraUnderground=!1,this._removeUpdateHeightCallback=void 0,this._logDepthBuffer=_i.defaultLogDepthBuffer&&o.fragmentDepth,this._logDepthBufferDirty=!0,this._tweens=new sw,this._shaderFrameCount=0,this._sunPostProcess=void 0,this._computeCommandList=[],this._overlayCommandList=[],this._useOIT=e.orderIndependentTranslucency??!0,this._executeOITFunction=void 0,this._depthPlane=new x6(e.depthPlaneEllipsoidOffset),this._clearColorCommand=new fi({color:new z,stencil:0,owner:this}),this._depthClearCommand=new fi({depth:1,owner:this}),this._stencilClearCommand=new fi({stencil:0}),this._classificationStencilClearCommand=new fi({stencil:0,renderState:Ge.fromCache({stencilMask:Xt.CLASSIFICATION_MASK})}),this._depthOnlyRenderStateCache={},this._transitioner=new gH(this),this._preUpdate=new be,this._postUpdate=new be,this._renderError=new be,this._preRender=new be,this._postRender=new be,this._controllerHost=new m6,this._minimumDisableDepthTestDistance=0,this._debugInspector=new MH,this._msaaSamples=e.msaaSamples??4,this.rethrowRenderErrors=!1,this.completeMorphOnUserInput=!0,this.morphStart=new be,this.morphComplete=new be,this.skyBox=void 0,this.skyAtmosphere=void 0,this.sun=void 0,this.sunBloom=!0,this._sunBloom=void 0,this.moon=void 0,this.backgroundColor=z.clone(z.BLACK),this._mode=re.SCENE3D,this._mapProjection=l(e.mapProjection)?e.mapProjection:new ji(this._ellipsoid),this.morphTime=1,this.farToNearRatio=1e3,this.logarithmicDepthFarToNearRatio=1e9,this.nearToFarDistance2D=175e4,this.verticalExaggeration=1,this.verticalExaggerationRelativeHeight=0,this.debugCommandFilter=void 0,this.debugShowCommands=!1,this.debugShowFrustums=!1,this.debugShowFramesPerSecond=!1,this.debugShowDepthFrustum=1,this.debugShowFrustumPlanes=!1,this._debugShowFrustumPlanes=!1,this._debugFrustumPlanes=void 0,this.useDepthPicking=!0,this.pickTranslucentDepth=!1,this.cameraEventWaitTime=500,this.atmosphere=new Av,this.fog=new C6,this.fog.enabled=ee.WGS84.equals(this._ellipsoid),ee.WGS84.equals(this._ellipsoid)||(Nr.DEFAULT_VIEW_RECTANGLE=ie.fromDegrees(-45,-45,45,45)),this._shadowMapCamera=new Nr(this),this.shadowMap=new xA({context:o,lightCamera:this._shadowMapCamera,enabled:e.shadows??!1}),this.invertClassification=!1,this.invertClassificationColor=z.clone(z.WHITE),this._actualInvertClassificationColor=z.clone(this._invertClassificationColor),this._invertClassification=new kR,this.focalLength=void 0,this.eyeSeparation=void 0,this.postProcessStages=new hH,this._brdfLutGenerator=new o6,this._performanceDisplay=void 0,this._debugVolume=void 0,this._screenSpaceCameraController=new wH(this),this._cameraUnderground=!1,this._mapMode2D=e.mapMode2D??Vu.INFINITE_SCROLL,this._environmentState={skyBoxCommand:void 0,skyAtmosphereCommand:void 0,sunDrawCommand:void 0,sunComputeCommand:void 0,moonCommand:void 0,isSunVisible:!1,isMoonVisible:!1,isReadyForAtmosphere:!1,isSkyAtmosphereVisible:!1,clearGlobeDepth:!1,useDepthPlane:!1,renderTranslucentDepthForPick:!1,originalFramebuffer:void 0,useGlobeDepthFramebuffer:!1,useOIT:!1,useInvertClassification:!1,usePostProcess:!1,usePostProcessSelected:!1,useWebVR:!1},this._useWebVR=!1,this._cameraVR=void 0,this._aspectRatioVR=void 0,this.requestRenderMode=e.requestRenderMode??!1,this._renderRequested=!0,this.maximumRenderTimeChange=e.maximumRenderTimeChange??0,this._lastRenderTime=void 0,this._frameRateMonitor=void 0,this._removeRequestListenerCallback=El.requestCompletedEvent.addEventListener(pG(this)),this._removeTaskProcessorListenerCallback=$n.taskCompletedEvent.addEventListener(pG(this)),this._removeGlobeCallbacks=[],this._removeTerrainProviderReadyListener=void 0;let a=new et(0,0,o.drawingBufferWidth,o.drawingBufferHeight),c=new Nr(this);this._logDepthBuffer&&(c.frustum.near=.1,c.frustum.far=1e10),this.preloadFlightCamera=new Nr(this),this.preloadFlightCullingVolume=void 0,this._picking=new Y6(this),this._defaultView=new nw(this,c,a),this._view=this._defaultView,this._hdr=void 0,this._hdrDirty=void 0,this.highDynamicRange=!1,this.gamma=2.2,this.sphericalHarmonicCoefficients=void 0,this.specularEnvironmentMaps=void 0,this._specularEnvironmentCubeMap=void 0,this.light=new N_,this._enableEdgeVisibility=!1,this._enablePlanarFillId=!1,hDe(this,0,K.now()),this.updateFrameState(),this.initializeFrame()}_i.defaultLogDepthBuffer=!0;function bOt(e,t){for(let i=0;i<e._removeGlobeCallbacks.length;++i)e._removeGlobeCallbacks[i]();e._removeGlobeCallbacks.length=0;let n=[];l(t)&&(n.push(t.imageryLayersUpdatedEvent.addEventListener(pG(e))),n.push(t.terrainProviderChanged.addEventListener(pG(e)))),e._removeGlobeCallbacks=n}Object.defineProperties(_i.prototype,{canvas:{get:function(){return this._canvas}},drawingBufferHeight:{get:function(){return this._context.drawingBufferHeight}},drawingBufferWidth:{get:function(){return this._context.drawingBufferWidth}},maximumAliasedLineWidth:{get:function(){return Ut.maximumAliasedLineWidth}},maximumCubeMapSize:{get:function(){return Ut.maximumCubeMapSize}},pickPositionSupported:{get:function(){return this._context.depthTexture}},sampleHeightSupported:{get:function(){return this._context.depthTexture}},clampToHeightSupported:{get:function(){return this._context.depthTexture}},invertClassificationSupported:{get:function(){return this._context.depthTexture}},specularEnvironmentMapsSupported:{get:function(){return Ep.isSupported(this._context)}},ellipsoid:{get:function(){return this._ellipsoid}},globe:{get:function(){return this._globe},set:function(e){this._globe=this._globe&&this._globe.destroy(),this._globe=e,bOt(this,e)}},primitives:{get:function(){return this._primitives}},groundPrimitives:{get:function(){return this._groundPrimitives}},camera:{get:function(){return this._view.camera},set:function(e){this._view.camera=e}},view:{get:function(){return this._view},set:function(e){this._view=e}},defaultView:{get:function(){return this._defaultView}},picking:{get:function(){return this._picking}},controllerHost:{get:function(){return this._controllerHost}},screenSpaceCameraController:{get:function(){return this._screenSpaceCameraController}},mapProjection:{get:function(){return this._mapProjection}},jobScheduler:{get:function(){return this._jobScheduler}},frameState:{get:function(){return this._frameState}},environmentState:{get:function(){return this._environmentState}},tweens:{get:function(){return this._tweens}},imageryLayers:{get:function(){if(l(this.globe))return this.globe.imageryLayers}},terrainProvider:{get:function(){if(l(this.globe))return this.globe.terrainProvider},set:function(e){this._removeTerrainProviderReadyListener=this._removeTerrainProviderReadyListener&&this._removeTerrainProviderReadyListener(),l(this.globe)&&(this.globe.terrainProvider=e)}},terrainProviderChanged:{get:function(){if(l(this.globe))return this.globe.terrainProviderChanged}},vectorProvider:{get:function(){return this.globe?.vectorProvider}},preUpdate:{get:function(){return this._preUpdate}},postUpdate:{get:function(){return this._postUpdate}},renderError:{get:function(){return this._renderError}},preRender:{get:function(){return this._preRender}},postRender:{get:function(){return this._postRender}},lastRenderTime:{get:function(){return this._lastRenderTime}},context:{get:function(){return this._context}},debugFrustumStatistics:{get:function(){return this._view.debugFrustumStatistics}},scene3DOnly:{get:function(){return this._frameState.scene3DOnly}},orderIndependentTranslucency:{get:function(){return this._useOIT}},id:{get:function(){return this._id}},mode:{get:function(){return this._mode},set:function(e){e===re.SCENE2D?this.morphTo2D(0):e===re.SCENE3D?this.morphTo3D(0):e===re.COLUMBUS_VIEW&&this.morphToColumbusView(0),this._mode=e}},frustumCommandsList:{get:function(){return this._view.frustumCommandsList}},numberOfFrustums:{get:function(){return this._view.frustumCommandsList.length}},useWebVR:{get:function(){return this._useWebVR},set:function(e){this._useWebVR=e,this._useWebVR?(this._frameState.creditDisplay.container.style.visibility="hidden",this._cameraVR=new Nr(this),l(this._deviceOrientationCameraController)||(this._deviceOrientationCameraController=new E6(this)),this._aspectRatioVR=this.camera.frustum.aspectRatio):(this._frameState.creditDisplay.container.style.visibility="visible",this._cameraVR=void 0,this._deviceOrientationCameraController=this._deviceOrientationCameraController&&!this._deviceOrientationCameraController.isDestroyed()&&this._deviceOrientationCameraController.destroy(),this.camera.frustum.aspectRatio=this._aspectRatioVR,this.camera.frustum.xOffset=0)}},mapMode2D:{get:function(){return this._mapMode2D}},splitPosition:{get:function(){return this._frameState.splitPosition},set:function(e){this._frameState.splitPosition=e}},minimumDisableDepthTestDistance:{get:function(){return this._minimumDisableDepthTestDistance},set:function(e){this._minimumDisableDepthTestDistance=e}},logarithmicDepthBuffer:{get:function(){return this._logDepthBuffer},set:function(e){e=this._context.fragmentDepth&&e,this._logDepthBuffer!==e&&(this._logDepthBuffer=e,this._logDepthBufferDirty=!0)}},gamma:{get:function(){return this._context.uniformState.gamma},set:function(e){this._context.uniformState.gamma=e}},highDynamicRange:{get:function(){return this._hdr},set:function(e){let t=this._context,n=e&&t.depthTexture&&(t.colorBufferFloat||t.colorBufferHalfFloat);this._hdrDirty=n!==this._hdr,this._hdr=n}},highDynamicRangeSupported:{get:function(){let e=this._context;return e.depthTexture&&(e.colorBufferFloat||e.colorBufferHalfFloat)}},cameraUnderground:{get:function(){return this._cameraUnderground}},msaaSamples:{get:function(){return this._msaaSamples},set:function(e){e=Math.min(e,Ut.maximumSamples),this._msaaSamples=e}},msaaSupported:{get:function(){return this._context.msaa}},pixelRatio:{get:function(){return this._frameState.pixelRatio},set:function(e){this._frameState.pixelRatio=e}},opaqueFrustumNearOffset:{get:function(){return .9999}},globeHeight:{get:function(){return this._globeHeight}}});_i.prototype.getCompressedTextureFormatSupported=function(e){let t=this.context;return(e==="WEBGL_compressed_texture_s3tc"||e==="s3tc")&&t.s3tc||(e==="WEBGL_compressed_texture_pvrtc"||e==="pvrtc")&&t.pvrtc||(e==="WEBGL_compressed_texture_etc"||e==="etc")&&t.etc||(e==="WEBGL_compressed_texture_etc1"||e==="etc1")&&t.etc1||(e==="WEBGL_compressed_texture_astc"||e==="astc")&&t.astc||(e==="EXT_texture_compression_bptc"||e==="bc7")&&t.bc7};function xOt(e,t){let n=e.pickedMetadataInfo,i=t.pickedMetadataInfo;return n?.schemaId!==i?.schemaId||n?.className!==i?.className||n?.propertyName!==i?.propertyName}function cDe(e,t,n){let i=e._frameState,r=e._context,o=e._view.oit,{lightShadowMaps:s,lightShadowsEnabled:a}=i.shadowState,c=t.derivedCommands;l(t.pickId)&&(c.picking=qp.createPickDerivedCommand(e,t,r,c.picking)),l(t.snapId)&&i.passes.snap&&(c.snapping=qp.createSnapDerivedCommand(e,t,r,c.snapping)),i.pickingMetadata&&t.pickMetadataAllowed&&(t.pickedMetadataInfo=i.pickedMetadataInfo,l(t.pickedMetadataInfo)&&(c.pickingMetadata=qp.createPickMetadataDerivedCommand(e,t,r,c.pickingMetadata))),t.pickOnly||(c.depth=qp.createDepthOnlyDerivedCommand(e,t,r,c.depth)),c.originalCommand=t,e._hdr&&(c.hdr=qp.createHdrCommand(t,r,c.hdr),t=c.hdr.command,c=t.derivedCommands),a&&t.receiveShadows&&(c.shadows=xA.createReceiveDerivedCommand(s,t,n,r,c.shadows)),t.pass===Ie.TRANSLUCENT&&l(o)&&o.isSupported()&&(a&&t.receiveShadows?(c.oit=l(c.oit)?c.oit:{},c.oit.shadows=o.createDerivedCommands(c.shadows.receiveCommand,r,c.oit.shadows)):c.oit=o.createDerivedCommands(t,r,c.oit))}_i.prototype.updateDerivedCommands=function(e){let{derivedCommands:t}=e;if(!l(t))return;let n=this._frameState,{shadowState:i,useLogDepth:r}=this._frameState,o=this._context,s=!1,a=i.lastDirtyTime;e.lastDirtyTime!==a&&(e.lastDirtyTime=a,e.dirty=!0,s=!0);let c=this._hdr,u=l(t.logDepth),f=l(t.hdr),d=l(t.originalCommand),p=r&&!u,g=c&&!f,m=(!r||!c)&&!d,y=n.pickingMetadata&&xOt(e,n),A=n.passes.snap&&l(e.snapId)&&!l(t.snapping);if(e.dirty=e.dirty||p||g||m||y||A,!e.dirty)return;e.dirty=!1;let{shadowsEnabled:b,shadowMaps:x}=i;b&&e.castShadows&&(t.shadows=xA.createCastDerivedCommand(x,e,s,o,t.shadows)),(u||p)&&(t.logDepth=qp.createLogDepthCommand(e,o,t.logDepth),cDe(this,t.logDepth.command,s)),(d||m)&&cDe(this,e,s)};var TOt=new lm({pass:po.RENDER}),jne=new lm({pass:po.PRELOAD}),Hne=new lm({pass:po.PRELOAD_FLIGHT}),EOt=new lm({pass:po.REQUEST_RENDER_MODE_DEFER_CHECK}),lDe=new ue,Gne;function COt(e){if(!(e._mode!==re.SCENE3D||!e.globe?.show||e._cameraUnderground||e._globeTranslucencyState.translucent))return lDe.radius=e.ellipsoid.minimumRadius+e.frameState.minimumTerrainHeight,Gne=r6.fromBoundingSphere(lDe,e.camera.positionWC,Gne),Gne}_i.prototype.clearPasses=function(e){e.render=!1,e.pick=!1,e.pickVoxel=!1,e.snap=!1,e.depth=!1,e.postProcess=!1,e.offscreen=!1};function hDe(e,t,n){let i=e._frameState;i.frameNumber=t,i.time=K.clone(n,i.time)}_i.prototype.updateFrameState=function(){let e=this.camera,t=this._frameState;t.commandList.length=0,t.shadowMaps.length=0,t.brdfLutGenerator=this._brdfLutGenerator,t.environmentMap=this.skyBox&&this.skyBox._cubeMap,t.mode=this._mode,t.morphTime=this.morphTime,t.mapProjection=this.mapProjection,t.camera=e,t.cullingVolume=e.frustum.computeCullingVolume(e.positionWC,e.directionWC,e.upWC),t.occluder=COt(this),t.minimumTerrainHeight=0,t.minimumDisableDepthTestDistance=this._minimumDisableDepthTestDistance,t.invertClassification=this.invertClassification,t.useLogDepth=this._logDepthBuffer&&!(this.camera.frustum instanceof _n||this.camera.frustum instanceof Ss),t.light=this.light,t.cameraUnderground=this._cameraUnderground,t.globeTranslucencyState=this._globeTranslucencyState;let{globe:n}=this;l(n)&&n._terrainExaggerationChanged&&(this.verticalExaggeration=n._terrainExaggeration,this.verticalExaggerationRelativeHeight=n._terrainExaggerationRelativeHeight,n._terrainExaggerationChanged=!1),t.verticalExaggeration=this.verticalExaggeration,t.verticalExaggerationRelativeHeight=this.verticalExaggerationRelativeHeight,l(this._specularEnvironmentCubeMap)&&this._specularEnvironmentCubeMap.ready?(t.specularEnvironmentMaps=this._specularEnvironmentCubeMap.texture,t.specularEnvironmentMapsMaximumLOD=this._specularEnvironmentCubeMap.maximumMipmapLevel):(t.specularEnvironmentMaps=void 0,t.specularEnvironmentMapsMaximumLOD=void 0),t.sphericalHarmonicCoefficients=this.sphericalHarmonicCoefficients,this._actualInvertClassificationColor=z.clone(this.invertClassificationColor,this._actualInvertClassificationColor),kR.isTranslucencySupported(this._context)||(this._actualInvertClassificationColor.alpha=1),t.invertClassificationColor=this._actualInvertClassificationColor,l(this.globe)?t.maximumScreenSpaceError=this.globe.maximumScreenSpaceError:t.maximumScreenSpaceError=2,this.clearPasses(t.passes),t.tilesetPassState=void 0};_i.prototype.isVisible=function(e,t,n){if(!l(t))return!1;let{boundingVolume:i}=t;return!l(i)||!t.cull?!0:e.computeVisibility(i)===$t.OUTSIDE?!1:!l(n)||!t.occlude||!i.isOccluded(n)};var mG=new M(0,0,1,0,1,0,0,0,0,1,0,0,0,0,0,1);mG=M.inverseTransformation(mG,mG);function vOt(e,t,n,i){let r=t._frameState,o=r.context,s=e.boundingVolume;l(t._debugVolume)&&t._debugVolume.destroy();let a=h.clone(s.center);if(r.mode!==re.SCENE3D){a=M.multiplyByPoint(mG,a,a);let m=r.mapProjection,y=m.unproject(a);a=m.ellipsoid.cartographicToCartesian(y)}let c,u,{radius:f}=s;l(f)?(c=Qa.createGeometry(new Qa({radii:new h(f,f,f),vertexFormat:An.FLAT_VERTEX_FORMAT})),u=M.fromTranslation(a)):(c=zc.createGeometry(zc.fromDimensions({dimensions:new h(2,2,2),vertexFormat:An.FLAT_VERTEX_FORMAT})),u=M.fromRotationTranslation(s.halfAxes,a,new M)),t._debugVolume=new Mn({geometryInstances:new Bt({geometry:Wn.toWireframe(c),modelMatrix:u,attributes:{color:new Jt(1,0,0,1)}}),appearance:new An({flat:!0,translucent:!1}),asynchronous:!1});let d=r.commandList,p=r.commandList=[];t._debugVolume.update(r),e=p[0],r.useLogDepth&&(e=qp.createLogDepthCommand(e,o).command);let g;l(i)&&(g=n.framebuffer,n.framebuffer=i),e.execute(o,n),l(g)&&(n.framebuffer=g),r.commandList=d}function Xl(e,t,n,i){let r=t._frameState,o=t._context;if(l(t.debugCommandFilter)&&!t.debugCommandFilter(e))return;if(e instanceof fi){e.execute(o,n);return}e.debugShowBoundingVolume&&l(e.boundingVolume)&&vOt(e,t,n,i),r.useLogDepth&&l(e.derivedCommands.logDepth)&&(e=e.derivedCommands.logDepth.command);let s=r.passes;if(!s.pick&&!s.pickVoxel&&!s.depth&&t._hdr&&l(e.derivedCommands)&&l(e.derivedCommands.hdr)&&(e=e.derivedCommands.hdr.command),s.pick||s.depth){if(s.pick&&!s.depth){if(r.passes.snap){l(e.derivedCommands.snapping)?(e=e.derivedCommands.snapping.snapCommand,e.execute(o,n)):l(e.derivedCommands.depth)&&(e=e.derivedCommands.depth.depthOnlyCommand,e.execute(o,n));return}if(r.pickingMetadata&&l(e.derivedCommands.pickingMetadata)){e=e.derivedCommands.pickingMetadata.pickMetadataCommand,e.execute(o,n);return}if(!r.pickingMetadata&&l(e.derivedCommands.picking)){e=e.derivedCommands.picking.pickCommand,e.execute(o,n);return}}else if(l(e.derivedCommands.depth)){e=e.derivedCommands.depth.depthOnlyCommand,e.execute(o,n);return}}if(t.debugShowCommands||t.debugShowFrustums){t._debugInspector.executeDebugShowFrustumsCommand(t,e,n);return}r.shadowState.lightShadowsEnabled&&e.receiveShadows&&l(e.derivedCommands.shadows)?e.derivedCommands.shadows.receiveCommand.execute(o,n):e.execute(o,n)}function uDe(e,t,n){let{derivedCommands:i}=e;if(!l(i))return;let r=t._frameState,o=t._context;r.useLogDepth&&l(i.logDepth)&&(e=i.logDepth.command);let{picking:s,pickingMetadata:a,depth:c}=e.derivedCommands;l(a)&&(e=i.pickingMetadata.pickMetadataCommand,e.execute(o,n)),l(s)?(e=s.pickCommand,e.execute(o,n)):l(c)&&(e=c.depthOnlyCommand,e.execute(o,n))}function mDe(e,t,n){return t.boundingVolume.distanceSquaredTo(n)-e.boundingVolume.distanceSquaredTo(n)}var SOt=new h;function fDe(e,t){let n=h.subtract(e,t,SOt),i=Math.max(0,h.magnitude(n));return i*i}function wOt(e,t,n){let i=e.boundingVolume,r=t.boundingVolume;return fDe(r.center,n)-fDe(i.center,n)}function IOt(e,t,n){return e.boundingVolume.distanceSquaredTo(n)-t.boundingVolume.distanceSquaredTo(n)+P.EPSILON12}function POt(e,t,n,i,r){Vg(i,mDe,e.camera.positionWC),l(r)&&t(r.unclassifiedCommand,e,n);for(let o=0;o<i.length;++o)t(i[o],e,n)}function DOt(e,t,n,i,r){Vg(i,IOt,e.camera.positionWC),l(r)&&t(r.unclassifiedCommand,e,n);for(let o=0;o<i.length;++o)t(i[o],e,n)}function ROt(e,t,n){e.context.uniformState.updatePass(Ie.VOXELS);let i=n.commands[Ie.VOXELS];i.length=n.indices[Ie.VOXELS],Vg(i,mDe,e.camera.positionWC);for(let r=0;r<i.length;++r)Xl(i[r],e,t)}function OOt(e,t,n){e.context.uniformState.updatePass(Ie.GAUSSIAN_SPLATS);let i=n.commands[Ie.GAUSSIAN_SPLATS];i.length=n.indices[Ie.GAUSSIAN_SPLATS],Vg(i,wOt,e.camera.positionWC);for(let r=0;r<i.length;++r)Xl(i[r],e,t)}var MOt=new Ji,NOt=new Uu,LOt=new _n,FOt=new Ss;function BOt(e){let{frustum:t}=e;return l(t.fov)?t.clone(MOt):l(t.infiniteProjectionMatrix)?t.clone(NOt):l(t.width)?t.clone(LOt):t.clone(FOt)}function kOt(e){if(e._environmentState.useOIT){if(!l(e._executeOITFunction)){let{view:t,context:n}=e;e._executeOITFunction=function(i,r,o,s,a){t.globeDepth.prepareColorTextures(n),t.oit.executeCommands(i,r,o,s,a)}}return e._executeOITFunction}return e.frameState.passes.render?POt:DOt}function UOt(e,t,n){let{frameState:i,context:r}=e,{pick:o,pickVoxel:s}=i.passes,a=o||s,c;!a&&e._environmentState.useInvertClassification&&i.invertClassificationColor.alpha<1&&(c=e._invertClassification);let u=kOt(e);r.uniformState.updatePass(Ie.TRANSLUCENT);let f=n.commands[Ie.TRANSLUCENT];f.length=n.indices[Ie.TRANSLUCENT],u(e,Xl,t,f,c)}function zOt(e,t,n){let{translucentTileClassification:i,globeDepth:r}=e._view;if(!(n.indices[Ie.CESIUM_3D_TILE_CLASSIFICATION]>0)||!i.isSupported())return;let s=n.commands[Ie.TRANSLUCENT];i.executeTranslucentCommands(e,Xl,t,s,r.depthStencilTexture),i.executeClassificationCommands(e,Xl,t,n)}function VOt(e,t,n){e.context.uniformState.updatePass(Ie.CESIUM_3D_TILE_EDGES);let i=t.framebuffer;e.context.uniformState.edgeColorTexture=e.context.defaultTexture,e.context.uniformState.edgeIdTexture=e.context.defaultTexture,e.context.uniformState.edgeDepthTexture=e.context.defaultTexture,e._enableEdgeVisibility&&l(e._view)&&l(e._view.edgeFramebuffer)&&(t.framebuffer=e._view.edgeFramebuffer.framebuffer);let r=n.commands[Ie.CESIUM_3D_TILE_EDGES],o=n.indices[Ie.CESIUM_3D_TILE_EDGES];e._enableEdgeVisibility&&l(e._view)&&l(e._view.edgeFramebuffer)&&e._view.edgeFramebuffer.getClearCommand(new z(0,0,0,0)).execute(e.context,t);for(let s=0;s<o;++s)Xl(r[s],e,t);t.framebuffer=i}function jOt(e,t,n){let{context:i}=e,{uniformState:r}=i;r.updatePass(Ie.CESIUM_3D_TILE_PLANAR_FILL_ID),r.planarFillIdTexture=i.defaultTexture;let o=e._view,s=o&&o.planarFillIdFramebuffer,a=n.commands[Ie.CESIUM_3D_TILE_PLANAR_FILL_ID],c=n.indices[Ie.CESIUM_3D_TILE_PLANAR_FILL_ID];if(c!==0&&e._enablePlanarFillId&&l(s)&&l(s.framebuffer)){let u=t.framebuffer;t.framebuffer=s.framebuffer,s.getClearCommand(new z(0,0,0,0)).execute(i,t);for(let d=0;d<c;++d)Xl(a[d],e,t);t.framebuffer=u}}function HOt(e,t,n){e.context.uniformState.updatePass(Ie.CESIUM_3D_TILE_EDGES_DIRECT);let i=n.commands[Ie.CESIUM_3D_TILE_EDGES_DIRECT],r=n.indices[Ie.CESIUM_3D_TILE_EDGES_DIRECT];for(let o=0;o<r;++o)Xl(i[o],e,t)}function qne(e,t){let{camera:n,context:i,frameState:r}=e,{uniformState:o}=i;o.updateCamera(n),o.planarFillIdTexture=i.defaultTexture;let s=BOt(n);s.near=n.frustum.near,s.far=n.frustum.far;let a=r.passes,c=a.pick||a.pickVoxel;c||GOt(e,t);let{clearGlobeDepth:u,renderTranslucentDepthForPick:f,useDepthPlane:d,useGlobeDepthFramebuffer:p,useInvertClassification:g,usePostProcessSelected:m}=e._environmentState,{globeDepth:y,globeTranslucencyFramebuffer:A,sceneFramebuffer:b,frustumCommandsList:x}=e._view,T=x.length,E=e._globeTranslucencyState,v=e._depthClearCommand,S=e._stencilClearCommand,I=e._classificationStencilClearCommand,R=e._depthPlane,O=n.position.z;function L(C,w){o.updatePass(w);let D=C.commands[w],N=C.indices[w];for(let F=0;F<N;++F)Xl(D[F],e,t);return N}function _(C,w){o.updatePass(w);let D=C.commands[w],N=C.indices[w];for(let F=0;F<N;++F)uDe(D[F],e,t)}for(let C=0;C<T;++C){let w=T-C-1,D=x[w];e.mode===re.SCENE2D?(n.position.z=O-D.near+1,s.far=Math.max(1,D.far-D.near),s.near=1,o.update(r),o.updateFrustum(s)):(s.near=w!==0?D.near*e.opaqueFrustumNearOffset:D.near,s.far=D.far,o.updateFrustum(s)),v.execute(i,t),i.stencilBuffer&&S.execute(i,t),E.translucent?(o.updatePass(Ie.GLOBE),E.executeGlobeCommands(D,Xl,A,e,t)):L(D,Ie.GLOBE),p&&y.executeCopyDepth(i,t),f||(E.translucent?(o.updatePass(Ie.TERRAIN_CLASSIFICATION),E.executeGlobeClassificationCommands(D,Xl,A,e,t)):L(D,Ie.TERRAIN_CLASSIFICATION)),u&&(v.execute(i,t),d&&R.execute(i,t));let N;if(VOt(e,t,D),e._enableEdgeVisibility&&l(e._view)&&l(e._view.edgeFramebuffer)){let V=e._view.edgeFramebuffer.colorTexture;l(V)?e.context.uniformState.edgeColorTexture=V:e.context.uniformState.edgeColorTexture=e.context.defaultTexture;let B=e._view.edgeFramebuffer.idTexture;l(B)?e.context.uniformState.edgeIdTexture=B:e.context.uniformState.edgeIdTexture=e.context.defaultTexture;let j=e._view.edgeFramebuffer.depthTexture;l(j)?e.context.uniformState.edgeDepthTexture=j:e.context.uniformState.edgeDepthTexture=e.context.defaultTexture}else e.context.uniformState.edgeColorTexture=e.context.defaultTexture,e.context.uniformState.edgeIdTexture=e.context.defaultTexture,e.context.uniformState.edgeDepthTexture=e.context.defaultTexture;if(jOt(e,t,D),e._enablePlanarFillId&&l(e._view)&&l(e._view.planarFillIdFramebuffer)){let V=e._view.planarFillIdFramebuffer.idTexture;o.planarFillIdTexture=l(V)?V:i.defaultTexture}else o.planarFillIdTexture=i.defaultTexture;if(!g||c||f)N=L(D,Ie.CESIUM_3D_TILE),N>0&&(p&&(y.prepareColorTextures(i,u),y.executeUpdateDepth(i,t,y.depthStencilTexture)),f||(N=L(D,Ie.CESIUM_3D_TILE_CLASSIFICATION)));else{e._invertClassification.clear(i,t);let V=t.framebuffer;t.framebuffer=e._invertClassification._fbo.framebuffer,L(D,Ie.CESIUM_3D_TILE),p&&(e._invertClassification.prepareTextures(i),y.executeUpdateDepth(i,t,e._invertClassification._fbo.getDepthStencilTexture())),N=L(D,Ie.CESIUM_3D_TILE_CLASSIFICATION_IGNORE_SHOW),t.framebuffer=V,e._invertClassification.executeClassified(i,t),r.invertClassificationColor.alpha===1&&e._invertClassification.executeUnclassified(i,t),N>0&&i.stencilBuffer&&I.execute(i,t),N=L(D,Ie.CESIUM_3D_TILE_CLASSIFICATION)}if(N>0&&i.stencilBuffer&&S.execute(i,t),ROt(e,t,D),L(D,Ie.OPAQUE),HOt(e,t,D),OOt(e,t,D),w!==0&&e.mode!==re.SCENE2D&&(s.near=D.near,o.updateFrustum(s)),UOt(e,t,D),zOt(e,t,D),i.depthTexture&&e.useDepthPicking&&(p||f)){let V=e._picking.getPickDepth(e,w);V.update(i,y.depthStencilTexture),V.executeCopyDepth(i,t)}if(c||!m)continue;let F=t.framebuffer;t.framebuffer=b.getIdFramebuffer(),s.near=w!==0?D.near*e.opaqueFrustumNearOffset:D.near,s.far=D.far,o.updateFrustum(s),E.translucent?(o.updatePass(Ie.GLOBE),E.executeGlobeCommands(D,uDe,A,e,t)):_(D,Ie.GLOBE),u&&(v.framebuffer=t.framebuffer,v.execute(i,t),v.framebuffer=void 0),u&&d&&R.execute(i,t),_(D,Ie.CESIUM_3D_TILE),_(D,Ie.OPAQUE),_(D,Ie.TRANSLUCENT),t.framebuffer=F}}function GOt(e,t){let{context:n,environmentState:i,view:r}=e;if(n.uniformState.updatePass(Ie.ENVIRONMENT),l(i.skyBoxCommand)&&Xl(i.skyBoxCommand,e,t),i.isSkyAtmosphereVisible&&Xl(i.skyAtmosphereCommand,e,t),i.isSunVisible&&(i.sunDrawCommand.execute(n,t),e.sunBloom&&!i.useWebVR)){let s;i.useGlobeDepthFramebuffer?s=r.globeDepth.framebuffer:i.usePostProcess?s=r.sceneFramebuffer.framebuffer:s=i.originalFramebuffer,e._sunPostProcess.execute(n),e._sunPostProcess.copy(n,s),t.framebuffer=s}i.isMoonVisible&&i.moonCommand.execute(n,t);let o=e.frameState.panoramaCommandList;for(let s=o.length-1;s>=0;s--){let a=o[s];l(a.shaderProgram)?Xl(o[s],e,t):o.splice(s,1)}}function pDe(e){e.context.uniformState.updatePass(Ie.COMPUTE);let t=e._environmentState.sunComputeCommand;l(t)&&t.execute(e._computeEngine);let n=e._computeCommandList;for(let i=0;i<n.length;++i)n[i].execute(e._computeEngine)}function WOt(e,t){e.context.uniformState.updatePass(Ie.OVERLAY);let n=e.context,i=e._overlayCommandList;for(let r=0;r<i.length;++r)i[r].execute(n,t)}function qOt(e,t,n){let{shadowMapCullingVolume:i,isPointLight:r,passes:o}=n,s=o.length,a=[Ie.GLOBE,Ie.CESIUM_3D_TILE,Ie.OPAQUE,Ie.TRANSLUCENT];for(let c=0;c<t.length;++c){let u=t[c];if(e.updateDerivedCommands(u),!(!u.castShadows||a.indexOf(u.pass)<0||!e.isVisible(i,u)))if(r)for(let f=0;f<s;++f)o[f].commandList.push(u);else if(s===1)o[0].commandList.push(u);else{let f=!1;for(let d=s-1;d>=0;--d){let p=o[d].cullingVolume;if(e.isVisible(p,u))o[d].commandList.push(u),f=!0;else if(f)break}}}}function gDe(e){let{shadowState:t,commandList:n}=e.frameState,{shadowsEnabled:i,shadowMaps:r}=t;if(!i)return;let{context:o}=e,{uniformState:s}=o;for(let a=0;a<r.length;++a){let c=r[a];if(c.outOfView)continue;let{passes:u}=c;for(let f=0;f<u.length;++f)u[f].commandList.length=0;qOt(e,n,c);for(let f=0;f<u.length;++f){let d=c.passes[f],{camera:p,commandList:g}=d;s.updateCamera(p),c.updatePass(o,f);for(let m=0;m<g.length;++m){let y=g[m];s.updatePass(y.pass);let A=y.derivedCommands.shadows.castCommands[a];Xl(A,e,d.passState)}}}}var YOt=new h;_i.prototype.updateAndExecuteCommands=function(e,t){aMt(this,e,t),this._environmentState.useWebVR?XOt(this,e,t):this._frameState.mode!==re.SCENE2D||this._mapMode2D===Vu.ROTATE?IA(!0,this,e):iMt(this,e)};function XOt(e,t){let n=e._view,i=n.camera,o=e._environmentState.renderTranslucentDepthForPick;yDe(e),n.createPotentiallyVisibleSet(e),pDe(e),o||gDe(e);let s=t.viewport;s.x=0,s.y=0,s.width=s.width*.5;let a=Nr.clone(i,e._cameraVR);a.frustum=i.frustum;let c=i.frustum.near,u=c*(e.focalLength??5),f=e.eyeSeparation??u/30,d=h.multiplyByScalar(a.right,f*.5,YOt);i.frustum.aspectRatio=s.width/s.height;let p=.5*f*c/u;h.add(a.position,d,i.position),i.frustum.xOffset=p,qne(e,t),s.x=s.width,h.subtract(a.position,d,i.position),i.frustum.xOffset=-p,qne(e,t),Nr.clone(a,i)}var KOt=new he(Math.PI,P.PI_OVER_TWO),$Ot=new h,JOt=new h,ZOt=new M,QOt=new M,eMt=new h,tMt=new h,nMt=new et;function iMt(e,t){let{frameState:n,camera:i}=e,{uniformState:r}=e.context,o=t.viewport,s=et.clone(o,nMt);t.viewport=s;let a=KOt,c=$Ot;e.mapProjection.project(a,c);let f=h.clone(i.position,JOt),d=M.clone(i.transform,QOt),p=i.frustum.clone();i._setTransform(M.IDENTITY);let g=M.computeViewportTransformation(s,0,1,ZOt),m=i.frustum.projectionMatrix,y=i.positionWC.y,A=h.fromElements(P.sign(y)*c.x-y,0,-i.positionWC.x,eMt),b=At.pointToGLWindowCoordinates(m,g,A,tMt);b.x=Math.floor(b.x);let x=s.x,T=s.width;if(y===0||b.x<=x||b.x>=x+T)IA(!0,e,t);else if(Math.abs(x+T*.5-b.x)<1)s.width=b.x-s.x,i.position.x*=P.sign(i.position.x),i.frustum.right=0,n.cullingVolume=i.frustum.computeCullingVolume(i.positionWC,i.directionWC,i.upWC),r.update(n),IA(!0,e,t),s.x=b.x,i.position.x=-i.position.x,i.frustum.right=-i.frustum.left,i.frustum.left=0,n.cullingVolume=i.frustum.computeCullingVolume(i.positionWC,i.directionWC,i.upWC),r.update(n),IA(!1,e,t);else if(b.x>x+T*.5){s.width=b.x-x;let E=i.frustum.right;i.frustum.right=c.x-y,n.cullingVolume=i.frustum.computeCullingVolume(i.positionWC,i.directionWC,i.upWC),r.update(n),IA(!0,e,t),s.x=b.x,s.width=x+T-b.x,i.position.x=-i.position.x,i.frustum.left=-i.frustum.right,i.frustum.right=E-i.frustum.right*2,n.cullingVolume=i.frustum.computeCullingVolume(i.positionWC,i.directionWC,i.upWC),r.update(n),IA(!1,e,t)}else{s.x=b.x,s.width=x+T-b.x;let E=i.frustum.left;i.frustum.left=-c.x-y,n.cullingVolume=i.frustum.computeCullingVolume(i.positionWC,i.directionWC,i.upWC),r.update(n),IA(!0,e,t),s.x=x,s.width=b.x-x,i.position.x=-i.position.x,i.frustum.right=-i.frustum.left,i.frustum.left=E-i.frustum.left*2,n.cullingVolume=i.frustum.computeCullingVolume(i.positionWC,i.directionWC,i.upWC),r.update(n),IA(!1,e,t)}i._setTransform(d),h.clone(f,i.position),i.frustum=p.clone(),t.viewport=o}function IA(e,t,n){let i=t._view,{renderTranslucentDepthForPick:r}=t._environmentState;e||(t.frameState.commandList.length=0),yDe(t),i.createPotentiallyVisibleSet(t),e&&(pDe(t),r||gDe(t)),qne(t,n)}var dDe=new aa;function _De(e,t,n){if(!e.show)return;let i=e.length;for(let r=0;r<i;++r){let o=e.get(r);if(o instanceof Rl){_De(o,t,n);continue}o.show&&$y.isSupported(o)&&fs(o.heightReference)&&t.markForFrame(o,n,o.heightReference)}}function rMt(e,t){let n=e.vectorProvider;if(!l(n))return;let i=t.frameNumber;_De(e._primitives,n,i)}_i.prototype.updateEnvironment=function(){let e=this._frameState,t=this._view,n=this._environmentState,i=e.passes.render,r=e.passes.offscreen,o=this.atmosphere,s=this.skyAtmosphere,a=this.globe,c=this._globeTranslucencyState;if(!i||this._mode!==re.SCENE2D&&t.camera.frustum instanceof _n||!c.environmentVisible)n.skyAtmosphereCommand=void 0,n.skyBoxCommand=void 0,n.sunDrawCommand=void 0,n.sunComputeCommand=void 0,n.moonCommand=void 0;else{if(l(s)){if(l(a))s.setDynamicLighting(my.fromGlobeFlags(a)),n.isReadyForAtmosphere=n.isReadyForAtmosphere||!a.show||a._surface._tilesToRender.length>0;else{let b=o.dynamicLighting;s.setDynamicLighting(b),n.isReadyForAtmosphere=!0}n.skyAtmosphereCommand=s.update(e,a),l(n.skyAtmosphereCommand)&&this.updateDerivedCommands(n.skyAtmosphereCommand)}else n.skyAtmosphereCommand=void 0;n.skyBoxCommand=l(this.skyBox)?this.skyBox.update(e,this._hdr):void 0;let A=l(this.sun)?this.sun.update(e,t.passState,this._hdr):void 0;n.sunDrawCommand=l(A)?A.drawCommand:void 0,n.sunComputeCommand=l(A)?A.computeCommand:void 0,n.moonCommand=l(this.moon)?this.moon.update(e):void 0}let u=n.clearGlobeDepth=l(a)&&a.show&&(!a.depthTestAgainstTerrain||this.mode===re.SCENE2D);(n.useDepthPlane=u&&this.mode===re.SCENE3D&&c.useDepthPlane)&&this._depthPlane.update(e),n.renderTranslucentDepthForPick=!1,n.useWebVR=this._useWebVR&&this.mode!==re.SCENE2D&&!r;let d=e.mode===re.SCENE3D&&!c.sunVisibleThroughGlobe?e.occluder:void 0,p=e.cullingVolume,g=dDe.planes;for(let A=0;A<5;++A)g[A]=p.planes[A];p=dDe,n.isSkyAtmosphereVisible=l(n.skyAtmosphereCommand)&&n.isReadyForAtmosphere,n.isSunVisible=this.isVisible(p,n.sunDrawCommand,d),n.isMoonVisible=this.isVisible(p,n.moonCommand,d);let m=this.specularEnvironmentMaps,y=this._specularEnvironmentCubeMap;l(m)&&y?.url!==m?(l(y)&&y.destroy(),this._specularEnvironmentCubeMap=new Ep(m)):!l(m)&&l(y)&&(y.destroy(),this._specularEnvironmentCubeMap=void 0),l(this._specularEnvironmentCubeMap)&&this._specularEnvironmentCubeMap.update(e),rMt(this,e)};function oMt(e){let t=e._frameState;e.debugShowFrustumPlanes!==e._debugShowFrustumPlanes&&(e.debugShowFrustumPlanes?e._debugFrustumPlanes=new jg({camera:e.camera,updateOnChange:!1,frustumSplits:t.frustumSplits}):e._debugFrustumPlanes=e._debugFrustumPlanes&&e._debugFrustumPlanes.destroy(),e._debugShowFrustumPlanes=e.debugShowFrustumPlanes),l(e._debugFrustumPlanes)&&e._debugFrustumPlanes.update(t)}function sMt(e){let t=e._frameState,{passes:n,shadowState:i,shadowMaps:r}=t,o=r.length,s=o>0&&!n.pick&&!n.pickVoxel&&e.mode===re.SCENE3D;if(s!==i.shadowsEnabled&&(++i.lastDirtyTime,i.shadowsEnabled=s),i.lightShadowsEnabled=!1,!!s){for(let a=0;a<o;++a)if(r[a]!==i.shadowMaps[a]){++i.lastDirtyTime;break}i.shadowMaps.length=0,i.lightShadowMaps.length=0;for(let a=0;a<o;++a){let c=r[a];c.update(t),i.shadowMaps.push(c),c.fromLightSource&&(i.lightShadowMaps.push(c),i.lightShadowsEnabled=!0),c.dirty&&(++i.lastDirtyTime,c.dirty=!1)}}}function yDe(e){let t=e._frameState;t.edgeVisibilityRequested=!1,t.planarFillRequested=!1,e._groundPrimitives.update(t),e._primitives.update(t),t.edgeVisibilityRequested&&e._enableEdgeVisibility===!1&&(e._enableEdgeVisibility=!0),e._enablePlanarFillId=t.planarFillRequested,oMt(e),sMt(e),e._globe&&e._globe.render(t)}function aMt(e,t,n){let i=e._context,r=e._frameState,o=e._environmentState,s=e._view,a=r.passes,c=a.pick||a.pickVoxel;l(s.globeDepth)&&(s.globeDepth.picking=c,s.globeDepth.snapping=a.snap);let u=o.useWebVR;o.originalFramebuffer=t.framebuffer,l(e.sun)&&e.sunBloom!==e._sunBloom?(e.sunBloom&&!u?e._sunPostProcess=new OH:l(e._sunPostProcess)&&(e._sunPostProcess=e._sunPostProcess.destroy()),e._sunBloom=e.sunBloom):!l(e.sun)&&l(e._sunPostProcess)&&(e._sunPostProcess=e._sunPostProcess.destroy(),e._sunBloom=!1);let f=e._clearColorCommand;z.clone(n,f.color),f.execute(i,t);let d=o.useGlobeDepthFramebuffer=l(s.globeDepth);d&&(s.globeDepth.update(i,t,s.viewport,e.msaaSamples,e._hdr,o.clearGlobeDepth),s.globeDepth.clear(i,t,n));let p=s.oit,g=o.useOIT=!c&&l(p)&&p.isSupported();g&&(p.update(i,t,s.globeDepth.colorFramebufferManager,e._hdr,e.msaaSamples),p.clear(i,t,n),o.useOIT=p.isSupported());let m=e.postProcessStages,y=o.usePostProcess=!c&&(e._hdr||m.length>0||m.ambientOcclusion.enabled||m.fxaa.enabled||m.bloom.enabled);o.usePostProcessSelected=!1,y&&(s.sceneFramebuffer.update(i,s.viewport,e._hdr,e.msaaSamples),s.sceneFramebuffer.clear(i,t,n),m.update(i,r.useLogDepth,e._hdr),m.clear(i),y=o.usePostProcess=m.ready,o.usePostProcessSelected=y&&m.hasSelected),o.isSunVisible&&e.sunBloom&&!u?(t.framebuffer=e._sunPostProcess.update(t),e._sunPostProcess.clear(i,t,n)):d?t.framebuffer=s.globeDepth.framebuffer:y&&(t.framebuffer=s.sceneFramebuffer.framebuffer),l(t.framebuffer)&&f.execute(i,t);let A=o.useInvertClassification=!c&&l(t.framebuffer)&&e.invertClassification;if(!c&&e._enableEdgeVisibility&&s.edgeFramebuffer.update(i,s.viewport,e._hdr),!c&&e._enablePlanarFillId?s.planarFillIdFramebuffer.update(i,s.viewport,e._hdr):c||s.planarFillIdFramebuffer.releaseResources(),A){let T;if(r.invertClassificationColor.alpha===1&&d&&(T=s.globeDepth.framebuffer),l(T)||i.depthTexture){if(e._invertClassification.previousFramebuffer=T,e._invertClassification.update(i,e.msaaSamples,s.globeDepth.colorFramebufferManager),e._invertClassification.clear(i,t),r.invertClassificationColor.alpha<1&&g){let E=e._invertClassification.unclassifiedCommand,v=E.derivedCommands;v.oit=p.createDerivedCommands(E,i,v.oit)}}else o.useInvertClassification=!1}e._globeTranslucencyState.translucent&&s.globeTranslucencyFramebuffer.updateAndClear(e._hdr,s.viewport,i,t)}_i.prototype.resolveFramebuffers=function(e){let t=this._context,n=this._environmentState,i=this._view,{globeDepth:r,translucentTileClassification:o}=i;l(r)&&r.prepareColorTextures(t);let{useOIT:s,useGlobeDepthFramebuffer:a,usePostProcess:c,originalFramebuffer:u}=n,f=a?r.colorFramebufferManager:void 0,d=i.sceneFramebuffer._colorFramebuffer,p=i.sceneFramebuffer.idFramebuffer;if(s&&(e.framebuffer=c?d.framebuffer:u,i.oit.execute(t,e)),o.hasTranslucentDepth&&o.isSupported()&&o.execute(this,e),c){i.sceneFramebuffer.prepareColorTextures(t);let g=d;a&&!s&&(g=f);let m=this.postProcessStages,y=g.getColorTexture(0),A=p.getColorTexture(0),b=(f??d).getDepthStencilTexture();m.execute(t,y,b,A),m.copy(t,u)}!s&&!c&&a&&(e.framebuffer=u,r.executeCopyColor(t,e))};function cMt(e){let t=e._frameState.afterRender,n=t.slice();t.length=0;for(let i=0;i<n.length;++i)n[i]()&&e.requestRender()}function lMt(e){if(e.mode===re.MORPHING)return;let t=e.camera.positionCartographic;return e.getHeight(t)}function ADe(e,t,n){let i=Number.NEGATIVE_INFINITY;if(e instanceof Rl){let r=e.length;for(let o=0;o<r;++o){let s=e.get(o),a=ADe(s,t,n);l(a)&&a>i&&(i=a)}}else if(e.isCesium3DTileset&&e.show&&e.enableCollision){let r=e.getHeight(t,n);if(l(r)&&r>i)return r}return i}_i.prototype.getHeight=function(e,t){if(!l(e))return;let n=this._frameState.frameNumber;this._heightQueryFrame!==n&&(this._heightQueryFrame=n,this._heightQueryCache.clear());let i=`${t}:${e.longitude.toFixed(8)}:${e.latitude.toFixed(8)}`,r=this._heightQueryCache.get(i);if(r!==void 0)return r===null?void 0:r;let o=uMt(this,e,t);return this._heightQueryCache.set(i,o===void 0?null:o),o};function uMt(e,t,n){let i=n===We.CLAMP_TO_TERRAIN||n===We.RELATIVE_TO_TERRAIN,r=n===We.CLAMP_TO_3D_TILE||n===We.RELATIVE_TO_3D_TILE;if(!l(t))return;let o=Number.NEGATIVE_INFINITY;if(!i){let a=ADe(e.primitives,t,e);l(a)&&a>o&&(o=a)}let s=e._globe;if(!r&&l(s)&&s.show){let a=s.getHeight(t);a>o&&(o=a)}if(o>Number.NEGATIVE_INFINITY)return o}var Wne=new he;_i.prototype.updateHeight=function(e,t,n){let i=this._ellipsoid,r=g=>{he.clone(e,Wne);let m;l(g)&&(m=g.height),l(m)||(m=this.getHeight(e,n)),l(m)&&(Wne.height=m,t(Wne))},o=n===We.CLAMP_TO_TERRAIN||n===We.RELATIVE_TO_TERRAIN,s=n===We.CLAMP_TO_3D_TILE||n===We.RELATIVE_TO_3D_TILE,a;!s&&l(this.globe)&&(a=this.globe._surface.updateHeight(e,r));let c={},u=g=>{if(o||g.isDestroyed()||!g.isCesium3DTileset)return;let m=g.updateHeight(e,r,i);c[g.id]=m};if(!o){let g=this.primitives.length;for(let m=0;m<g;++m){let y=this.primitives.get(m);u(y)}}let f=this.primitives.primitiveAdded.addEventListener(u),d=this.primitives.primitiveRemoved.addEventListener(g=>{g.isDestroyed()||!g.isCesium3DTileset||(l(c[g.id])&&c[g.id](),delete c[g.id])});return()=>{a=a&&a(),Object.values(c).forEach(g=>g()),c={},f(),d()}};function fMt(e){let t=e.camera,n=e._mode,i=e._screenSpaceCameraController,r=t.positionCartographic;if(!l(r))return!1;if(!i.onMap()&&r.height<0)return!0;if(n===re.SCENE2D||n===re.MORPHING)return!1;let o=e._globeHeight;return l(o)&&r.height<o}_i.prototype.initializeFrame=function(){if(this._shaderFrameCount++===120&&(this._shaderFrameCount=0,this._context.shaderCache.destroyReleasedShaderPrograms(),this._context.textureCache.destroyReleasedTextures()),this._tweens.update(),this._globeHeightDirty){l(this._removeUpdateHeightCallback)&&(this._removeUpdateHeightCallback(),this._removeUpdateHeightCallback=void 0),this._globeHeight=lMt(this),this._globeHeightDirty=!1;let e=this.camera.positionCartographic;this._removeUpdateHeightCallback=this.updateHeight(e,t=>{this.isDestroyed()||(this._globeHeight=t.height)})}this._cameraUnderground=fMt(this),this._globeTranslucencyState.update(this),this._screenSpaceCameraController.update(),l(this._deviceOrientationCameraController)&&this._deviceOrientationCameraController.update(),this.camera.update(this._mode),this.camera._updateCameraChanged()};function dMt(e,t){if(e.debugShowFramesPerSecond){if(!l(e._performanceDisplay)){let n=document.createElement("div");n.className="cesium-performanceDisplay-defaultContainer",e._canvas.parentNode.appendChild(n);let r=new _A({container:n});e._performanceDisplay=r,e._performanceContainer=n}e._performanceDisplay.throttled=e.requestRenderMode,e._performanceDisplay.update(t)}else l(e._performanceDisplay)&&(e._performanceDisplay=e._performanceDisplay&&e._performanceDisplay.destroy(),e._performanceContainer.parentNode.removeChild(e._performanceContainer))}function hMt(e){e._jobScheduler.resetBudgets();let t=e._frameState;e.primitives.prePassesUpdate(t),l(e.globe)&&e.globe.update(t),e._picking.update(),t.creditDisplay.update()}function mMt(e){e.primitives.postPassesUpdate(e._frameState),El.update()}var pMt=new z;function gMt(e){let t=e._frameState,n=e.context,{uniformState:i}=n,r=e._defaultView;e._view=r,e.updateFrameState(),t.passes.render=!0,t.passes.postProcess=e.postProcessStages.hasSelected,t.tilesetPassState=TOt;let o=e.backgroundColor??z.BLACK;e._hdr&&(o=z.clone(o,pMt),o.red=Math.pow(o.red,e.gamma),o.green=Math.pow(o.green,e.gamma),o.blue=Math.pow(o.blue,e.gamma)),t.backgroundColor=o,t.atmosphere=e.atmosphere,e.fog.update(t),i.update(t);let s=e.shadowMap;l(s)&&s.enabled&&(!l(e.light)||e.light instanceof N_?h.negate(i.sunDirectionWC,e._shadowMapCamera.direction):h.clone(e.light.direction,e._shadowMapCamera.direction),t.shadowMaps.push(s)),e._computeCommandList.length=0,e._overlayCommandList.length=0;let a=r.viewport;a.x=0,a.y=0,a.width=n.drawingBufferWidth,a.height=n.drawingBufferHeight;let c=r.passState;c.framebuffer=void 0,c.blendingEnabled=void 0,c.scissorTest=void 0,c.viewport=et.clone(a,c.viewport),n.beginFrame(),l(e.globe)&&e.globe.beginFrame(t),e.updateEnvironment(),e.updateAndExecuteCommands(c,o),e.resolveFramebuffers(c),c.framebuffer=void 0,WOt(e,c),l(e.globe)&&(e.globe.endFrame(t),e.globe.tilesLoaded||(e._renderRequested=!0)),n.endFrame()}function xT(e,t){try{t(e)}catch(n){if(e._renderError.raiseEvent(e,n),e.rethrowRenderErrors)throw n}}function _Mt(e){return e._picking.updateMostDetailedRayPicks(e)}_i.prototype.render=function(e){this._preUpdate.raiseEvent(this,e);let t=this._frameState;t.newFrame=!1,l(e)||(e=K.now()),this._controllerHost.update(this,e);let n=this._view.checkForCameraUpdates(this);n&&(this._globeHeightDirty=!0);let i=!this.requestRenderMode||this._renderRequested||n||this._logDepthBufferDirty||this._hdrDirty||this.mode===re.MORPHING;if(!i&&l(this.maximumRenderTimeChange)&&l(this._lastRenderTime)){let r=Math.abs(K.secondsDifference(this._lastRenderTime,e));i=i||r>this.maximumRenderTimeChange}if(i){this._lastRenderTime=K.clone(e,this._lastRenderTime),this._renderRequested=!1,this._logDepthBufferDirty=!1,this._hdrDirty=!1;let r=P.incrementWrap(t.frameNumber,Yx.maximumFrameNumber,1);hDe(this,r,e),t.newFrame=!0}xT(this,hMt),this.primitives.show&&(xT(this,_Mt),xT(this,yMt),xT(this,AMt),i||xT(this,bMt)),this._postUpdate.raiseEvent(this,e),i&&(this._preRender.raiseEvent(this,e),t.creditDisplay.beginFrame(),xT(this,gMt)),dMt(this,i),xT(this,mMt),cMt(this),i&&(this._postRender.raiseEvent(this,e),t.creditDisplay.endFrame())};_i.prototype.forceRender=function(e){this._renderRequested=!0,this.render(e)};_i.prototype.requestRender=function(){this._renderRequested=!0};_i.prototype.clampLineWidth=function(e){return Math.max(Ut.minimumAliasedLineWidth,Math.min(e,Ut.maximumAliasedLineWidth))};_i.prototype.pick=function(e,t,n){return this._picking.pick(this,e,t,n,1)[0]};_i.prototype.snap=function(e,t){return PH.snap(this,e,t)};_i.prototype.pickAsync=async function(e,t,n){return(await this._picking.pickAsync(this,e,t,n,1))[0]};_i.prototype.pickVoxel=function(e,t,n){let i=this.pick(e,t,n);if(!l(i))return;let r=i.primitive;if(!(r instanceof bT))return;let o=this._picking.pickVoxelCoordinate(this,e,t,n),s=255*o[0]+o[1],a=r._traversal.findKeyframeNode(s);if(!l(a))return;let c=255*o[2]+o[3];return NH.fromKeyframeNode(r,s,c,a)};_i.prototype.pickMetadata=function(e,t,n,i){let r=this.pick(e);if(!l(r))return;let o=r.detail?.model?.structuralMetadata;if(!l(o))return;let s=o.schema,a=fG(s,t,n,i);if(!l(a))return;let c=hG(o,n,i);if(!l(c))return;let u=new dG(t,n,i,a,c);return this._picking.pickMetadata(this,e,u)};_i.prototype.pickMetadataSchema=function(e){let t=this.pick(e);return l(t)?t.detail?.model?.structuralMetadata?.schema:void 0};_i.prototype.pickPositionWorldCoordinates=function(e,t){return this._picking.pickPositionWorldCoordinates(this,e,t)};_i.prototype.pickPosition=function(e,t){return this._picking.pickPosition(this,e,t)};_i.prototype.drillPick=function(e,t,n,i){return this._picking.drillPick(this,e,t,n,i)};function yMt(e){let t=e._frameState;jne.camera=t.camera,jne.cullingVolume=t.cullingVolume,e.primitives.updateForPass(t,jne)}function AMt(e){let t=e._frameState;if(!t.camera.canPreloadFlight())return;Hne.camera=e.preloadFlightCamera,Hne.cullingVolume=e.preloadFlightCullingVolume,e.primitives.updateForPass(t,Hne)}function bMt(e){e.primitives.updateForPass(e._frameState,EOt)}_i.prototype.pickFromRay=function(e,t,n){return this._picking.pickFromRay(this,e,t,n)};_i.prototype.drillPickFromRay=function(e,t,n,i){return this._picking.drillPickFromRay(this,e,t,n,i)};_i.prototype.pickFromRayMostDetailed=function(e,t,n){return this._picking.pickFromRayMostDetailed(this,e,t,n)};_i.prototype.drillPickFromRayMostDetailed=function(e,t,n,i){return this._picking.drillPickFromRayMostDetailed(this,e,t,n,i)};_i.prototype.sampleHeight=function(e,t,n){return this._picking.sampleHeight(this,e,t,n)};_i.prototype.clampToHeight=function(e,t,n,i){return this._picking.clampToHeight(this,e,t,n,i)};_i.prototype.sampleHeightMostDetailed=function(e,t,n){return this._picking.sampleHeightMostDetailed(this,e,t,n)};_i.prototype.clampToHeightMostDetailed=function(e,t,n){return this._picking.clampToHeightMostDetailed(this,e,t,n)};_i.prototype.cartesianToCanvasCoordinates=function(e,t){return pr.worldToWindowCoordinates(this,e,t)};_i.prototype.completeMorph=function(){this._transitioner.completeMorph()};_i.prototype.morphTo2D=function(e){e=e??2,this._transitioner.morphTo2D(e,this._ellipsoid)};_i.prototype.morphToColumbusView=function(e){e=e??2,this._transitioner.morphToColumbusView(e,this._ellipsoid)};_i.prototype.morphTo3D=function(e){e=e??2,this._transitioner.morphTo3D(e,this._ellipsoid)};function xMt(e,t){if(e._removeTerrainProviderReadyListener=e._removeTerrainProviderReadyListener&&e._removeTerrainProviderReadyListener(),t.ready){l(e.globe)&&(e.globe.terrainProvider=t.provider);return}e.globe.terrainProvider=void 0,e._removeTerrainProviderReadyListener=t.readyEvent.addEventListener(n=>{l(e)&&l(e.globe)&&(e.globe.terrainProvider=n),e._removeTerrainProviderReadyListener()})}_i.prototype.setTerrain=function(e){return xMt(this,e),e};_i.prototype.isDestroyed=function(){return!1};_i.prototype.destroy=function(){this._tweens.removeAll(),this._computeEngine=this._computeEngine&&this._computeEngine.destroy(),this._screenSpaceCameraController=this._screenSpaceCameraController&&this._screenSpaceCameraController.destroy(),this._deviceOrientationCameraController=this._deviceOrientationCameraController&&!this._deviceOrientationCameraController.isDestroyed()&&this._deviceOrientationCameraController.destroy(),this._primitives=this._primitives&&this._primitives.destroy(),this._groundPrimitives=this._groundPrimitives&&this._groundPrimitives.destroy(),this._globe=this._globe&&this._globe.destroy(),this._removeTerrainProviderReadyListener=this._removeTerrainProviderReadyListener&&this._removeTerrainProviderReadyListener(),this.skyBox=this.skyBox&&this.skyBox.destroy(),this.skyAtmosphere=this.skyAtmosphere&&this.skyAtmosphere.destroy(),this._debugSphere=this._debugSphere&&this._debugSphere.destroy(),this.sun=this.sun&&this.sun.destroy(),this._sunPostProcess=this._sunPostProcess&&this._sunPostProcess.destroy(),this._depthPlane=this._depthPlane&&this._depthPlane.destroy(),this._transitioner=this._transitioner&&this._transitioner.destroy(),this._debugFrustumPlanes=this._debugFrustumPlanes&&this._debugFrustumPlanes.destroy(),this._brdfLutGenerator=this._brdfLutGenerator&&this._brdfLutGenerator.destroy(),this._picking=this._picking&&this._picking.destroy(),this._defaultView=this._defaultView&&this._defaultView.destroy(),this._view=void 0,this._removeCreditContainer&&this._canvas.parentNode.removeChild(this._creditContainer),this.postProcessStages=this.postProcessStages&&this.postProcessStages.destroy(),this._context=this._context&&this._context.destroy(),this._frameState.creditDisplay=this._frameState.creditDisplay&&this._frameState.creditDisplay.destroy(),l(this._performanceDisplay)&&(this._performanceDisplay=this._performanceDisplay&&this._performanceDisplay.destroy(),this._performanceContainer.parentNode.removeChild(this._performanceContainer)),this._removeRequestListenerCallback(),this._removeTaskProcessorListenerCallback();for(let e=0;e<this._removeGlobeCallbacks.length;++e)this._removeGlobeCallbacks[e]();return this._removeGlobeCallbacks.length=0,l(this._removeUpdateHeightCallback)&&(this._removeUpdateHeightCallback(),this._removeUpdateHeightCallback=void 0),le(this)};var gG=_i;function mw(e){e=e??ee.WGS84,this.show=!0,this.perFragmentAtmosphere=!1,this._ellipsoid=e;let t=1.025,n=h.multiplyByScalar(e.radii,t,new h);this._scaleMatrix=M.fromScale(n),this._modelMatrix=new M,this._command=new at({owner:this,modelMatrix:this._modelMatrix}),this._spSkyFromSpace=void 0,this._spSkyFromAtmosphere=void 0,this._flags=void 0,this.atmosphereLightIntensity=50,this.atmosphereRayleighCoefficient=new h(55e-7,13e-6,284e-7),this.atmosphereMieCoefficient=new h(21e-6,21e-6,21e-6),this.atmosphereRayleighScaleHeight=1e4,this.atmosphereMieScaleHeight=3200,this.atmosphereMieAnisotropy=.9,this.hueShift=0,this.saturationShift=0,this.brightnessShift=0,this._hueSaturationBrightness=new h;let i=new h;i.x=e.maximumRadius*t,i.y=e.maximumRadius,i.z=0,this._radiiAndDynamicAtmosphereColor=i;let r=this;this._command.uniformMap={u_radiiAndDynamicAtmosphereColor:function(){return r._radiiAndDynamicAtmosphereColor},u_hsbShift:function(){return r._hueSaturationBrightness.x=r.hueShift,r._hueSaturationBrightness.y=r.saturationShift,r._hueSaturationBrightness.z=r.brightnessShift,r._hueSaturationBrightness},u_atmosphereLightIntensity:function(){return r.atmosphereLightIntensity},u_atmosphereRayleighCoefficient:function(){return r.atmosphereRayleighCoefficient},u_atmosphereMieCoefficient:function(){return r.atmosphereMieCoefficient},u_atmosphereRayleighScaleHeight:function(){return r.atmosphereRayleighScaleHeight},u_atmosphereMieScaleHeight:function(){return r.atmosphereMieScaleHeight},u_atmosphereMieAnisotropy:function(){return r.atmosphereMieAnisotropy}}}Object.defineProperties(mw.prototype,{ellipsoid:{get:function(){return this._ellipsoid}}});mw.prototype.setDynamicLighting=function(e){this._radiiAndDynamicAtmosphereColor.z=e};var Yne=new M;mw.prototype.update=function(e,t){if(!this.show)return;let n=e.mode;if(n!==re.SCENE3D&&n!==re.MORPHING||!e.passes.render)return;let i=M.fromRotationTranslation(e.context.uniformState.inverseViewRotation,h.ZERO,Yne),r=M.multiplyTransformation(i,qi.Y_UP_TO_Z_UP,Yne),o=M.multiply(this._scaleMatrix,r,Yne);M.clone(o,this._modelMatrix);let s=e.context,a=TMt(this),c=e.globeTranslucencyState.translucent,u=this.perFragmentAtmosphere||c||!l(t)||!t.show,f=this._command;if(!l(f.vertexArray)){let p=Qa.createGeometry(new Qa({radii:new h(1,1,1),slicePartitions:256,stackPartitions:256,vertexFormat:Be.POSITION_ONLY}));f.vertexArray=Vn.fromGeometry({context:s,geometry:p,attributeLocations:Wn.createAttributeLocations(p),bufferUsage:Me.STATIC_DRAW}),f.renderState=Ge.fromCache({cull:{enabled:!0,face:Hi.FRONT},blending:nn.ALPHA_BLEND,depthMask:!1})}let d=a|u<<2|c<<3;if(d!==this._flags){this._flags=d;let p=[];a&&p.push("COLOR_CORRECT"),u&&p.push("PER_FRAGMENT_ATMOSPHERE"),c&&p.push("GLOBE_TRANSLUCENT");let g=new Xe({defines:p,sources:[Xm,pP,$2]}),m=new Xe({defines:p,sources:[Xm,pP,K2]});this._spSkyAtmosphere=Qt.fromCache({context:s,vertexShaderSource:g,fragmentShaderSource:m}),f.shaderProgram=this._spSkyAtmosphere}return f};function TMt(e){return!(P.equalsEpsilon(e.hueShift,0,P.EPSILON7)&&P.equalsEpsilon(e.saturationShift,0,P.EPSILON7)&&P.equalsEpsilon(e.brightnessShift,0,P.EPSILON7))}mw.prototype.isDestroyed=function(){return!1};mw.prototype.destroy=function(){let e=this._command;return e.vertexArray=e.vertexArray&&e.vertexArray.destroy(),this._spSkyAtmosphere=this._spSkyAtmosphere&&this._spSkyAtmosphere.destroy(),le(this)};var _G=mw;function lO(e){this.sources=e.sources,this._sources=void 0,this._transform=e.transform,this.show=e.show??!0,this._returnCommand=e.returnCommand??!1,this._addToPanoramaCommandList=!this._returnCommand,this._command=new at({modelMatrix:M.clone(M.IDENTITY),owner:this,pass:Ie.ENVIRONMENT}),this._cubeMap=void 0,this._attributeLocations=void 0,this._useHdr=void 0,this._hasError=!1,this._error=void 0;let t=e.credit;typeof t=="string"&&(t=new It(t)),this._credit=t}Object.defineProperties(lO.prototype,{transform:{get:function(){return this._transform}},credit:{get:function(){return l(this._credit)?this._credit:void 0}}});lO.prototype.update=function(e,t){let n=this,{mode:i,passes:r,context:o,panoramaCommandList:s}=e;if(!this.show||i!==re.SCENE3D&&i!==re.MORPHING||!r.render)return;if(this._hasError){let c=this._error;throw this._hasError=!1,this._error=void 0,c}if(this._sources!==this.sources){this._sources=this.sources;let c=this.sources;typeof c.positiveX=="string"?s2(o,this._sources).then(function(u){n._cubeMap=n._cubeMap&&n._cubeMap.destroy(),n._cubeMap=u}).catch(u=>{this._hasError=!0,this._error=u}):(this._cubeMap=this._cubeMap&&this._cubeMap.destroy(),this._cubeMap=new ls({context:o,source:c})),this._addToPanoramaCommandList=!0}let a=this._command;if(!l(a.vertexArray)){a.uniformMap={u_cubeMap:function(){return n._cubeMap},u_cubeMapPanoramaTransform:function(){return n._transform}};let c=zc.createGeometry(zc.fromDimensions({dimensions:new h(2,2,2),vertexFormat:Be.POSITION_ONLY})),u=this._attributeLocations=Wn.createAttributeLocations(c);a.vertexArray=Vn.fromGeometry({context:o,geometry:c,attributeLocations:u,bufferUsage:Me.STATIC_DRAW}),a.renderState=Ge.fromCache({depthTest:{enabled:!1},depthMask:!1,blending:nn.ALPHA_BLEND}),this._addToPanoramaCommandList=!0}if(!l(a.shaderProgram)||this._useHdr!==t){let c=new Xe({defines:[t?"HDR":""],sources:[J2]});a.shaderProgram=Qt.fromCache({context:o,vertexShaderSource:l(this._transform)?O2:Z2,fragmentShaderSource:c,attributeLocations:this._attributeLocations}),this._useHdr=t,this._addToPanoramaCommandList=!0}if(l(this._cubeMap)){if(this.show&&l(this._credit)&&!this._returnCommand&&e.creditDisplay.addCreditToNextFrame(this._credit),this._returnCommand)return a;this._addToPanoramaCommandList&&(s.push(a),this._addToPanoramaCommandList=!1)}};lO.prototype.isDestroyed=function(){return!1};lO.prototype.destroy=function(){let e=this._command;return e.vertexArray=e.vertexArray&&e.vertexArray.destroy(),e.shaderProgram=e.shaderProgram&&e.shaderProgram.destroy(),this._cubeMap=this._cubeMap&&this._cubeMap.destroy(),le(this)};var pw=lO;function TT(e){this._sources=e.sources,this._show=e.show??!0,this._panorama=new pw({sources:this._sources,show:this._show,returnCommand:!0})}Object.defineProperties(TT.prototype,{sources:{get:function(){return this._panorama.sources},set:function(e){this._panorama.sources=e}},show:{get:function(){return this._panorama.show},set:function(e){this._panorama.show=e}}});TT.prototype.update=function(e,t){let{mode:n,passes:i}=e;if(!(n!==re.SCENE3D&&n!==re.MORPHING)&&i.render)return this._panorama.update(e,t)};TT.prototype.isDestroyed=function(){return!1};TT.prototype.destroy=function(){return this._panorama=this._panorama&&this._panorama.destroy(),le(this)};function gw(e){return Zt(`Assets/Textures/SkyBox/tycho2t3_80_${e}.jpg`)}TT.createEarthSkyBox=function(){return new TT({sources:{positiveX:gw("px"),negativeX:gw("mx"),positiveY:gw("py"),negativeY:gw("my"),positiveZ:gw("pz"),negativeZ:gw("mz")}})};var yG=TT;function fO(){this.show=!0,this._drawCommand=new at({primitiveType:Oe.TRIANGLES,boundingVolume:new ue,owner:this}),this._commands={drawCommand:this._drawCommand,computeCommand:void 0},this._boundingVolume=new ue,this._boundingVolume2D=new ue,this._texture=void 0,this._drawingBufferWidth=void 0,this._drawingBufferHeight=void 0,this._radiusTS=void 0,this._size=void 0,this.glowFactor=1,this._glowFactorDirty=!1,this._useHdr=void 0;let e=this;this._uniformMap={u_texture:function(){return e._texture},u_size:function(){return e._size}}}Object.defineProperties(fO.prototype,{glowFactor:{get:function(){return this._glowFactor},set:function(e){e=Math.max(e,0),this._glowFactor=e,this._glowFactorDirty=!0}}});var EMt=new U,CMt=new U,vMt=new se,uO=new se;fO.prototype.update=function(e,t,n){if(!this.show)return;let i=e.mode;if(i===re.SCENE2D||i===re.MORPHING||!e.passes.render)return;let r=e.context,o=t.viewport.width,s=t.viewport.height;if(!l(this._texture)||o!==this._drawingBufferWidth||s!==this._drawingBufferHeight||this._glowFactorDirty||n!==this._useHdr){this._texture=this._texture&&this._texture.destroy(),this._drawingBufferWidth=o,this._drawingBufferHeight=s,this._glowFactorDirty=!1,this._useHdr=n;let E=Math.max(o,s);E=Math.pow(2,Math.ceil(Math.log(E)/Math.log(2))-2),E=Math.max(1,E);let v=n?r.halfFloatingPointTexture?ze.HALF_FLOAT:ze.FLOAT:ze.UNSIGNED_BYTE;this._texture=new Dt({context:r,width:E,height:E,pixelFormat:$e.RGBA,pixelDatatype:v}),this._glowLengthTS=this._glowFactor*5,this._radiusTS=1/(1+2*this._glowLengthTS)*.5;let S=this,I={u_radiusTS:function(){return S._radiusTS}};this._commands.computeCommand=new $f({fragmentShaderSource:ek,outputTexture:this._texture,uniformMap:I,persists:!1,owner:this,postExecute:function(){S._commands.computeCommand=void 0}})}let a=this._drawCommand;if(!l(a.vertexArray)){let E={direction:0},v=new Uint8Array(8);v[0]=0,v[1]=0,v[2]=255,v[3]=0,v[4]=255,v[5]=255,v[6]=0,v[7]=255;let S=tt.createVertexBuffer({context:r,typedArray:v,usage:Me.STATIC_DRAW}),I=[{index:E.direction,vertexBuffer:S,componentsPerAttribute:2,normalize:!0,componentDatatype:Y.UNSIGNED_BYTE}],R=tt.createIndexBuffer({context:r,typedArray:new Uint16Array([0,1,2,0,2,3]),usage:Me.STATIC_DRAW,indexDatatype:je.UNSIGNED_SHORT});a.vertexArray=new Vn({context:r,attributes:I,indexBuffer:R}),a.shaderProgram=Qt.fromCache({context:r,vertexShaderSource:tk,fragmentShaderSource:Q2,attributeLocations:E}),a.renderState=Ge.fromCache({blending:nn.ALPHA_BLEND}),a.uniformMap=this._uniformMap}let c=r.uniformState.sunPositionWC,u=r.uniformState.sunPositionColumbusView,f=this._boundingVolume,d=this._boundingVolume2D;h.clone(c,f.center),d.center.x=u.z,d.center.y=u.x,d.center.z=u.y,f.radius=P.SOLAR_RADIUS+P.SOLAR_RADIUS*this._glowLengthTS,d.radius=f.radius,i===re.SCENE3D?ue.clone(f,a.boundingVolume):i===re.COLUMBUS_VIEW&&ue.clone(d,a.boundingVolume);let p=pr.computeActualEllipsoidPosition(e,c,uO),g=h.magnitude(h.subtract(p,e.camera.position,uO)),m=r.uniformState.projection,y=vMt;y.x=0,y.y=0,y.z=-g,y.w=1;let A=M.multiplyByVector(m,y,uO),b=pr.clipToGLWindowCoordinates(t.viewport,A,EMt);y.x=P.SOLAR_RADIUS;let x=M.multiplyByVector(m,y,uO),T=pr.clipToGLWindowCoordinates(t.viewport,x,CMt);return this._size=U.magnitude(U.subtract(T,b,uO)),this._size=2*this._size*(1+2*this._glowLengthTS),this._size=Math.ceil(this._size),this._commands};fO.prototype.isDestroyed=function(){return!1};fO.prototype.destroy=function(){let e=this._drawCommand;return e.vertexArray=e.vertexArray&&e.vertexArray.destroy(),e.shaderProgram=e.shaderProgram&&e.shaderProgram.destroy(),this._texture=this._texture&&this._texture.destroy(),le(this)};var AG=fO;var TDe=js(rN(),1);function SMt(e,t,n){return` float clipDistance = clip(gl_FragCoord, ${e}, ${t}); vec4 clippingPlanesEdgeColor = vec4(1.0); clippingPlanesEdgeColor.rgb = ${n}.rgb; float clippingPlanesEdgeWidth = ${n}.a; @@ -12560,7 +12560,7 @@ return properties; { out_FragColor = clippingPlanesEdgeColor; } -`}var N9=oUt;var sUt={modifyFragmentShader:function(t){return t=Xe.replaceMain(t,"czm_splitter_main"),t+=`uniform float czm_splitDirection; +`}var bG=SMt;var wMt={modifyFragmentShader:function(t){return t=Xe.replaceMain(t,"czm_splitter_main"),t+=`uniform float czm_splitDirection; void main() { #ifndef SHADOW_MAP @@ -12569,9 +12569,9 @@ void main() #endif czm_splitter_main(); } -`,t},addUniforms:function(t,n){n.czm_splitDirection=function(){return t.splitDirection}}},bM=sUt;var JT={NEEDS_DECODE:0,DECODING:1,READY:2,FAILED:3};function xM(e){this._parsedContent=void 0,this._drawCommand=void 0,this._isTranslucent=!1,this._styleTranslucent=!1,this._constantColor=z.clone(z.DARKGRAY),this._highlightColor=z.clone(z.WHITE),this._pointSize=1,this._rtcCenter=void 0,this._quantizedVolumeScale=void 0,this._quantizedVolumeOffset=void 0,this._styleableShaderAttributes=void 0,this._isQuantized=!1,this._isOctEncoded16P=!1,this._isRGB565=!1,this._hasColors=!1,this._hasNormals=!1,this._hasBatchIds=!1,this._decodingState=JT.READY,this._dequantizeInShader=!0,this._isQuantizedDraco=!1,this._isOctEncodedDraco=!1,this._quantizedRange=0,this._octEncodedRange=0,this.backFaceCulling=!1,this._backFaceCulling=!1,this.normalShading=!0,this._normalShading=!0,this._opaqueRenderState=void 0,this._translucentRenderState=void 0,this._mode=void 0,this._ready=!1,this._pointsLength=0,this._geometryByteLength=0,this._vertexShaderLoaded=e.vertexShaderLoaded,this._fragmentShaderLoaded=e.fragmentShaderLoaded,this._uniformMapLoaded=e.uniformMapLoaded,this._batchTableLoaded=e.batchTableLoaded,this._pickIdLoaded=e.pickIdLoaded,this._opaquePass=e.opaquePass??Ie.OPAQUE,this._cull=e.cull??!0,this.style=void 0,this._style=void 0,this.styleDirty=!1,this.modelMatrix=M.clone(M.IDENTITY),this._modelMatrix=M.clone(M.IDENTITY),this.time=0,this.shadows=Dn.ENABLED,this._boundingSphere=void 0,this.clippingPlanes=void 0,this.isClipped=!1,this.clippingPlanesDirty=!1,this.clippingPlanesOriginMatrix=void 0,this.attenuation=!1,this._attenuation=!1,this.geometricError=0,this.geometricErrorScale=1,this.maximumAttenuation=this._pointSize,this.splitDirection=e.splitDirection??Wo.NONE,this._splittingEnabled=!1,this._error=void 0,aUt(this,e)}Object.defineProperties(xM.prototype,{pointsLength:{get:function(){return this._pointsLength}},geometryByteLength:{get:function(){return this._geometryByteLength}},ready:{get:function(){return this._ready}},color:{get:function(){return z.clone(this._highlightColor)},set:function(e){this._highlightColor=z.clone(e,this._highlightColor)}},boundingSphere:{get:function(){if(l(this._drawCommand))return this._drawCommand.boundingVolume},set:function(e){this._boundingSphere=ue.clone(e,this._boundingSphere)}}});function aUt(e,t){let n=Pv.parse(t.arrayBuffer,t.byteOffset);if(e._parsedContent=n,e._rtcCenter=n.rtcCenter,e._hasNormals=n.hasNormals,e._hasColors=n.hasColors,e._hasBatchIds=n.hasBatchIds,e._isTranslucent=n.isTranslucent,!n.hasBatchIds&&l(n.batchTableBinary)&&(n.styleableProperties=lp.getBinaryProperties(n.pointsLength,n.batchTableJson,n.batchTableBinary)),l(n.draco)){let a=n.draco;e._decodingState=JT.NEEDS_DECODE,a.dequantizeInShader=e._dequantizeInShader}let i=n.positions;l(i)&&(e._isQuantized=i.isQuantized,e._quantizedVolumeScale=i.quantizedVolumeScale,e._quantizedVolumeOffset=i.quantizedVolumeOffset,e._quantizedRange=i.quantizedRange);let r=n.normals;l(r)&&(e._isOctEncoded16P=r.octEncoded);let o=n.colors;l(o)&&(l(o.constantColor)&&(e._constantColor=z.clone(o.constantColor,e._constantColor),e._hasColors=!1),e._isRGB565=o.isRGB565);let s=n.batchIds;l(n.batchIds)&&(s.name="BATCH_ID",s.semantic="BATCH_ID",s.setIndex=void 0),n.hasBatchIds&&e._batchTableLoaded(n.batchLength,n.batchTableJson,n.batchTableBinary),e._pointsLength=n.pointsLength}var cUt=new h,lUt=new h,uUt=new h,gLe,L9;function fUt(e){if(!l(L9)){gLe=new yLe.default(0),L9=new Array(e);for(let t=0;t<e;++t)L9[t]=gLe.random()}return L9}function dUt(e){let n=e.length/3,i=Math.min(n,20),r=fUt(20),o=Number.MAX_VALUE,s=-Number.MAX_VALUE,a=h.fromElements(o,o,o,cUt),c=h.fromElements(s,s,s,lUt);for(let f=0;f<i;++f){let d=Math.floor(r[f]*n),p=h.unpack(e,d*3,uUt);h.minimumByComponent(a,p,a),h.maximumByComponent(c,p,c)}let u=ue.fromCornerPoints(a,c);return u.radius+=P.EPSILON2,u}function _Le(e,t){let n=Y.fromTypedArray(e);return n===Y.INT||n===Y.UNSIGNED_INT||n===Y.DOUBLE?(yt("Cast pnts property to floats",`Point cloud property "${t}" will be cast to a float array because INT, UNSIGNED_INT, and DOUBLE are not valid WebGL vertex attribute types. Some precision may be lost.`),new Float32Array(e)):e}var hUt=new se,mUt=new se,pUt=new z,ALe=0,F9=1,hse=2,bLe=3,gUt=4,lse=new M,_Ut=new M;function yUt(e,t){let n=t.context,i=e._parsedContent,r=e._pointsLength,o=i.positions,s=i.colors,a=i.normals,c=i.batchIds,u=i.styleableProperties,f=l(u),d=e._isQuantized,p=e._isQuantizedDraco,g=e._isOctEncoded16P,m=e._isOctEncodedDraco,y=e._quantizedRange,A=e._octEncodedRange,b=e._isRGB565,x=e._isTranslucent,T=e._hasColors,E=e._hasNormals,v=e._hasBatchIds,S,I,R=[],O={};if(e._styleableShaderAttributes=O,f){let B=gUt;for(let j in u)if(u.hasOwnProperty(j)){let k=u[j],G=_Le(k.typedArray,j);S=k.componentCount,I=Y.fromTypedArray(G);let q=tt.createVertexBuffer({context:n,typedArray:G,usage:Me.STATIC_DRAW});e._geometryByteLength+=q.sizeInBytes;let Q={index:B,vertexBuffer:q,componentsPerAttribute:S,componentDatatype:I,normalize:!1,offsetInBytes:0,strideInBytes:0};R.push(Q),O[j]={location:B,componentCount:S},++B}}let L=tt.createVertexBuffer({context:n,typedArray:o.typedArray,usage:Me.STATIC_DRAW});e._geometryByteLength+=L.sizeInBytes;let _;T&&(_=tt.createVertexBuffer({context:n,typedArray:s.typedArray,usage:Me.STATIC_DRAW}),e._geometryByteLength+=_.sizeInBytes);let C;E&&(C=tt.createVertexBuffer({context:n,typedArray:a.typedArray,usage:Me.STATIC_DRAW}),e._geometryByteLength+=C.sizeInBytes);let w;v&&(c.typedArray=_Le(c.typedArray,"batchIds"),w=tt.createVertexBuffer({context:n,typedArray:c.typedArray,usage:Me.STATIC_DRAW}),e._geometryByteLength+=w.sizeInBytes);let D=[];if(d?I=Y.UNSIGNED_SHORT:p?I=y<=255?Y.UNSIGNED_BYTE:Y.UNSIGNED_SHORT:I=Y.FLOAT,D.push({index:ALe,vertexBuffer:L,componentsPerAttribute:3,componentDatatype:I,normalize:!1,offsetInBytes:0,strideInBytes:0}),e._cull&&(d||p?e._boundingSphere=ue.fromCornerPoints(h.ZERO,e._quantizedVolumeScale):e._boundingSphere=dUt(o.typedArray)),T)if(b)D.push({index:F9,vertexBuffer:_,componentsPerAttribute:1,componentDatatype:Y.UNSIGNED_SHORT,normalize:!1,offsetInBytes:0,strideInBytes:0});else{let B=x?4:3;D.push({index:F9,vertexBuffer:_,componentsPerAttribute:B,componentDatatype:Y.UNSIGNED_BYTE,normalize:!0,offsetInBytes:0,strideInBytes:0})}E&&(g?(S=2,I=Y.UNSIGNED_BYTE):m?(S=2,I=A<=255?Y.UNSIGNED_BYTE:Y.UNSIGNED_SHORT):(S=3,I=Y.FLOAT),D.push({index:hse,vertexBuffer:C,componentsPerAttribute:S,componentDatatype:I,normalize:!1,offsetInBytes:0,strideInBytes:0})),v&&D.push({index:bLe,vertexBuffer:w,componentsPerAttribute:1,componentDatatype:Y.fromTypedArray(c.typedArray),normalize:!1,offsetInBytes:0,strideInBytes:0}),f&&(D=D.concat(R));let N=new Vn({context:n,attributes:D}),F={depthTest:{enabled:!0}},V={depthTest:{enabled:!0},depthMask:!1,blending:nn.ALPHA_BLEND};e._opaquePass===Ie.CESIUM_3D_TILE&&(F.stencilTest=Xt.setCesium3DTileBit(),F.stencilMask=Xt.CESIUM_3D_TILE_MASK,V.stencilTest=Xt.setCesium3DTileBit(),V.stencilMask=Xt.CESIUM_3D_TILE_MASK),e._opaqueRenderState=Ge.fromCache(F),e._translucentRenderState=Ge.fromCache(V),e._drawCommand=new at({boundingVolume:new ue,cull:e._cull,modelMatrix:new M,primitiveType:Oe.POINTS,vertexArray:N,count:r,shaderProgram:void 0,uniformMap:void 0,renderState:x?e._translucentRenderState:e._opaqueRenderState,pass:x?Ie.TRANSLUCENT:e._opaquePass,owner:e,castShadows:!1,receiveShadows:!1,pickId:e._pickIdLoaded()})}function AUt(e,t){let n=t.context,i=e._isQuantized,r=e._isQuantizedDraco,o=e._isOctEncodedDraco,s={u_pointSizeAndTimeAndGeometricErrorAndDepthMultiplier:function(){let a=hUt;if(a.x=e._attenuation?e.maximumAttenuation:e._pointSize,a.x*=t.pixelRatio,a.y=e.time,e._attenuation){let c=t.camera.frustum,u;t.mode===re.SCENE2D||c instanceof _n?u=Number.POSITIVE_INFINITY:u=n.drawingBufferHeight/t.camera.frustum.sseDenominator,a.z=e.geometricError*e.geometricErrorScale,a.w=u}return a},u_highlightColor:function(){return e._highlightColor},u_constantColor:function(){return e._constantColor},u_clippingPlanes:function(){let a=e.clippingPlanes;return e.isClipped?a.texture:n.defaultTexture},u_clippingPlanesEdgeStyle:function(){let a=e.clippingPlanes;if(!l(a))return z.TRANSPARENT;let c=z.clone(a.edgeColor,pUt);return c.alpha=a.edgeWidth,c},u_clippingPlanesMatrix:function(){let a=e.clippingPlanes;if(!l(a))return M.IDENTITY;let c=e.clippingPlanesOriginMatrix??e._modelMatrix;M.multiply(n.uniformState.view3D,c,lse);let u=M.multiply(lse,a.modelMatrix,lse);return M.inverseTranspose(u,_Ut)}};bM.addUniforms(e,s),(i||r||o)&&(s=Mt(s,{u_quantizedVolumeScaleAndOctEncodedRange:function(){let a=mUt;if(l(e._quantizedVolumeScale)){let c=h.clone(e._quantizedVolumeScale,a);h.divideByScalar(c,e._quantizedRange,a)}return a.w=e._octEncodedRange,a}})),l(e._uniformMapLoaded)&&(s=e._uniformMapLoaded(s)),e._drawCommand.uniformMap=s}function use(e,t){let n=/czm_3dtiles_property_(\d+)/g,i=n.exec(e);for(;i!==null;){let r=parseInt(i[1]);t.indexOf(r)===-1&&t.push(r),i=n.exec(e)}}function fse(e,t){e=e.slice(e.indexOf(` -`));let n=/czm_3dtiles_builtin_property_(\w+)/g,i=n.exec(e);for(;i!==null;){let r=i[1];t.indexOf(r)===-1&&t.push(r),i=n.exec(e)}}function dse(e,t){let n=e.numberOfAttributes;for(let i=0;i<n;++i){let r=e.getAttribute(i);if(r.index===t)return r}}var bUt={POSITION:"czm_3dtiles_builtin_property_POSITION",POSITION_ABSOLUTE:"czm_3dtiles_builtin_property_POSITION_ABSOLUTE",COLOR:"czm_3dtiles_builtin_property_COLOR",NORMAL:"czm_3dtiles_builtin_property_NORMAL"};function xUt(e,t,n){let i,r,o,s=t.context,a=l(n),c=e._isQuantized,u=e._isQuantizedDraco,f=e._isOctEncoded16P,d=e._isOctEncodedDraco,p=e._isRGB565,g=e._isTranslucent,m=e._hasColors,y=e._hasNormals,A=e._hasBatchIds,b=e._backFaceCulling,x=e._normalShading,T=e._drawCommand.vertexArray,E=e.clippingPlanes,v=e._attenuation,S,I,R,O=g,L=Ze(bUt),_={},C=e._styleableShaderAttributes;for(r in C)C.hasOwnProperty(r)&&(o=C[r],L[r]=`czm_3dtiles_property_${o.location}`,_[o.location]=o);if(a){let fe={translucent:!1},xe="(vec3 czm_3dtiles_builtin_property_POSITION, vec3 czm_3dtiles_builtin_property_POSITION_ABSOLUTE, vec4 czm_3dtiles_builtin_property_COLOR, vec3 czm_3dtiles_builtin_property_NORMAL)";S=n.getColorShaderFunction(`getColorFromStyle${xe}`,L,fe),I=n.getShowShaderFunction(`getShowFromStyle${xe}`,L,fe),R=n.getPointSizeShaderFunction(`getPointSizeFromStyle${xe}`,L,fe),l(S)&&fe.translucent&&(O=!0)}e._styleTranslucent=O;let w=l(S),D=l(I),N=l(R),F=e.isClipped,V=[],B=[];w&&(use(S,V),fse(S,B)),D&&(use(I,V),fse(I,B)),N&&(use(R,V),fse(R,B));let j=B.indexOf("COLOR")>=0,k=B.indexOf("NORMAL")>=0;if(k&&!y)throw new oe("Style references the NORMAL semantic but the point cloud does not have normals");for(r in C)if(C.hasOwnProperty(r)){o=C[r];let fe=V.indexOf(o.location)>=0,xe=dse(T,o.location);xe.enabled=fe}let G=m&&(!w||j);if(m){let fe=dse(T,F9);fe.enabled=G}let q=y&&(x||b||k);if(y){let fe=dse(T,hse);fe.enabled=q}let Q={a_position:ALe};G&&(Q.a_color=F9),q&&(Q.a_normal=hse),A&&(Q.a_batchId=bLe);let W="",J=V.length;for(i=0;i<J;++i){let fe=V[i];o=_[fe];let xe=o.componentCount,ge=`czm_3dtiles_property_${fe}`,we;xe===1?we="float":we=`vec${xe}`,W+=`in ${we} ${ge}; -`,Q[ge]=o.location}AUt(e,t);let Z=`in vec3 a_position; +`,t},addUniforms:function(t,n){n.czm_splitDirection=function(){return t.splitDirection}}},dO=wMt;var ET={NEEDS_DECODE:0,DECODING:1,READY:2,FAILED:3};function hO(e){this._parsedContent=void 0,this._drawCommand=void 0,this._isTranslucent=!1,this._styleTranslucent=!1,this._constantColor=z.clone(z.DARKGRAY),this._highlightColor=z.clone(z.WHITE),this._pointSize=1,this._rtcCenter=void 0,this._quantizedVolumeScale=void 0,this._quantizedVolumeOffset=void 0,this._styleableShaderAttributes=void 0,this._isQuantized=!1,this._isOctEncoded16P=!1,this._isRGB565=!1,this._hasColors=!1,this._hasNormals=!1,this._hasBatchIds=!1,this._decodingState=ET.READY,this._dequantizeInShader=!0,this._isQuantizedDraco=!1,this._isOctEncodedDraco=!1,this._quantizedRange=0,this._octEncodedRange=0,this.backFaceCulling=!1,this._backFaceCulling=!1,this.normalShading=!0,this._normalShading=!0,this._opaqueRenderState=void 0,this._translucentRenderState=void 0,this._mode=void 0,this._ready=!1,this._pointsLength=0,this._geometryByteLength=0,this._vertexShaderLoaded=e.vertexShaderLoaded,this._fragmentShaderLoaded=e.fragmentShaderLoaded,this._uniformMapLoaded=e.uniformMapLoaded,this._batchTableLoaded=e.batchTableLoaded,this._pickIdLoaded=e.pickIdLoaded,this._opaquePass=e.opaquePass??Ie.OPAQUE,this._cull=e.cull??!0,this.style=void 0,this._style=void 0,this.styleDirty=!1,this.modelMatrix=M.clone(M.IDENTITY),this._modelMatrix=M.clone(M.IDENTITY),this.time=0,this.shadows=Pn.ENABLED,this._boundingSphere=void 0,this.clippingPlanes=void 0,this.isClipped=!1,this.clippingPlanesDirty=!1,this.clippingPlanesOriginMatrix=void 0,this.attenuation=!1,this._attenuation=!1,this.geometricError=0,this.geometricErrorScale=1,this.maximumAttenuation=this._pointSize,this.splitDirection=e.splitDirection??Yo.NONE,this._splittingEnabled=!1,this._error=void 0,IMt(this,e)}Object.defineProperties(hO.prototype,{pointsLength:{get:function(){return this._pointsLength}},geometryByteLength:{get:function(){return this._geometryByteLength}},ready:{get:function(){return this._ready}},color:{get:function(){return z.clone(this._highlightColor)},set:function(e){this._highlightColor=z.clone(e,this._highlightColor)}},boundingSphere:{get:function(){if(l(this._drawCommand))return this._drawCommand.boundingVolume},set:function(e){this._boundingSphere=ue.clone(e,this._boundingSphere)}}});function IMt(e,t){let n=fS.parse(t.arrayBuffer,t.byteOffset);if(e._parsedContent=n,e._rtcCenter=n.rtcCenter,e._hasNormals=n.hasNormals,e._hasColors=n.hasColors,e._hasBatchIds=n.hasBatchIds,e._isTranslucent=n.isTranslucent,!n.hasBatchIds&&l(n.batchTableBinary)&&(n.styleableProperties=vp.getBinaryProperties(n.pointsLength,n.batchTableJson,n.batchTableBinary)),l(n.draco)){let a=n.draco;e._decodingState=ET.NEEDS_DECODE,a.dequantizeInShader=e._dequantizeInShader}let i=n.positions;l(i)&&(e._isQuantized=i.isQuantized,e._quantizedVolumeScale=i.quantizedVolumeScale,e._quantizedVolumeOffset=i.quantizedVolumeOffset,e._quantizedRange=i.quantizedRange);let r=n.normals;l(r)&&(e._isOctEncoded16P=r.octEncoded);let o=n.colors;l(o)&&(l(o.constantColor)&&(e._constantColor=z.clone(o.constantColor,e._constantColor),e._hasColors=!1),e._isRGB565=o.isRGB565);let s=n.batchIds;l(n.batchIds)&&(s.name="BATCH_ID",s.semantic="BATCH_ID",s.setIndex=void 0),n.hasBatchIds&&e._batchTableLoaded(n.batchLength,n.batchTableJson,n.batchTableBinary),e._pointsLength=n.pointsLength}var PMt=new h,DMt=new h,RMt=new h,bDe,xG;function OMt(e){if(!l(xG)){bDe=new TDe.default(0),xG=new Array(e);for(let t=0;t<e;++t)xG[t]=bDe.random()}return xG}function MMt(e){let n=e.length/3,i=Math.min(n,20),r=OMt(20),o=Number.MAX_VALUE,s=-Number.MAX_VALUE,a=h.fromElements(o,o,o,PMt),c=h.fromElements(s,s,s,DMt);for(let f=0;f<i;++f){let d=Math.floor(r[f]*n),p=h.unpack(e,d*3,RMt);h.minimumByComponent(a,p,a),h.maximumByComponent(c,p,c)}let u=ue.fromCornerPoints(a,c);return u.radius+=P.EPSILON2,u}function xDe(e,t){let n=Y.fromTypedArray(e);return n===Y.INT||n===Y.UNSIGNED_INT||n===Y.DOUBLE?(yt("Cast pnts property to floats",`Point cloud property "${t}" will be cast to a float array because INT, UNSIGNED_INT, and DOUBLE are not valid WebGL vertex attribute types. Some precision may be lost.`),new Float32Array(e)):e}var NMt=new se,LMt=new se,FMt=new z,EDe=0,TG=1,Zne=2,CDe=3,BMt=4,Xne=new M,kMt=new M;function UMt(e,t){let n=t.context,i=e._parsedContent,r=e._pointsLength,o=i.positions,s=i.colors,a=i.normals,c=i.batchIds,u=i.styleableProperties,f=l(u),d=e._isQuantized,p=e._isQuantizedDraco,g=e._isOctEncoded16P,m=e._isOctEncodedDraco,y=e._quantizedRange,A=e._octEncodedRange,b=e._isRGB565,x=e._isTranslucent,T=e._hasColors,E=e._hasNormals,v=e._hasBatchIds,S,I,R=[],O={};if(e._styleableShaderAttributes=O,f){let B=BMt;for(let j in u)if(u.hasOwnProperty(j)){let k=u[j],G=xDe(k.typedArray,j);S=k.componentCount,I=Y.fromTypedArray(G);let q=tt.createVertexBuffer({context:n,typedArray:G,usage:Me.STATIC_DRAW});e._geometryByteLength+=q.sizeInBytes;let Q={index:B,vertexBuffer:q,componentsPerAttribute:S,componentDatatype:I,normalize:!1,offsetInBytes:0,strideInBytes:0};R.push(Q),O[j]={location:B,componentCount:S},++B}}let L=tt.createVertexBuffer({context:n,typedArray:o.typedArray,usage:Me.STATIC_DRAW});e._geometryByteLength+=L.sizeInBytes;let _;T&&(_=tt.createVertexBuffer({context:n,typedArray:s.typedArray,usage:Me.STATIC_DRAW}),e._geometryByteLength+=_.sizeInBytes);let C;E&&(C=tt.createVertexBuffer({context:n,typedArray:a.typedArray,usage:Me.STATIC_DRAW}),e._geometryByteLength+=C.sizeInBytes);let w;v&&(c.typedArray=xDe(c.typedArray,"batchIds"),w=tt.createVertexBuffer({context:n,typedArray:c.typedArray,usage:Me.STATIC_DRAW}),e._geometryByteLength+=w.sizeInBytes);let D=[];if(d?I=Y.UNSIGNED_SHORT:p?I=y<=255?Y.UNSIGNED_BYTE:Y.UNSIGNED_SHORT:I=Y.FLOAT,D.push({index:EDe,vertexBuffer:L,componentsPerAttribute:3,componentDatatype:I,normalize:!1,offsetInBytes:0,strideInBytes:0}),e._cull&&(d||p?e._boundingSphere=ue.fromCornerPoints(h.ZERO,e._quantizedVolumeScale):e._boundingSphere=MMt(o.typedArray)),T)if(b)D.push({index:TG,vertexBuffer:_,componentsPerAttribute:1,componentDatatype:Y.UNSIGNED_SHORT,normalize:!1,offsetInBytes:0,strideInBytes:0});else{let B=x?4:3;D.push({index:TG,vertexBuffer:_,componentsPerAttribute:B,componentDatatype:Y.UNSIGNED_BYTE,normalize:!0,offsetInBytes:0,strideInBytes:0})}E&&(g?(S=2,I=Y.UNSIGNED_BYTE):m?(S=2,I=A<=255?Y.UNSIGNED_BYTE:Y.UNSIGNED_SHORT):(S=3,I=Y.FLOAT),D.push({index:Zne,vertexBuffer:C,componentsPerAttribute:S,componentDatatype:I,normalize:!1,offsetInBytes:0,strideInBytes:0})),v&&D.push({index:CDe,vertexBuffer:w,componentsPerAttribute:1,componentDatatype:Y.fromTypedArray(c.typedArray),normalize:!1,offsetInBytes:0,strideInBytes:0}),f&&(D=D.concat(R));let N=new Vn({context:n,attributes:D}),F={depthTest:{enabled:!0}},V={depthTest:{enabled:!0},depthMask:!1,blending:nn.ALPHA_BLEND};e._opaquePass===Ie.CESIUM_3D_TILE&&(F.stencilTest=Xt.setCesium3DTileBit(),F.stencilMask=Xt.CESIUM_3D_TILE_MASK,V.stencilTest=Xt.setCesium3DTileBit(),V.stencilMask=Xt.CESIUM_3D_TILE_MASK),e._opaqueRenderState=Ge.fromCache(F),e._translucentRenderState=Ge.fromCache(V),e._drawCommand=new at({boundingVolume:new ue,cull:e._cull,modelMatrix:new M,primitiveType:Oe.POINTS,vertexArray:N,count:r,shaderProgram:void 0,uniformMap:void 0,renderState:x?e._translucentRenderState:e._opaqueRenderState,pass:x?Ie.TRANSLUCENT:e._opaquePass,owner:e,castShadows:!1,receiveShadows:!1,pickId:e._pickIdLoaded()})}function zMt(e,t){let n=t.context,i=e._isQuantized,r=e._isQuantizedDraco,o=e._isOctEncodedDraco,s={u_pointSizeAndTimeAndGeometricErrorAndDepthMultiplier:function(){let a=NMt;if(a.x=e._attenuation?e.maximumAttenuation:e._pointSize,a.x*=t.pixelRatio,a.y=e.time,e._attenuation){let c=t.camera.frustum,u;t.mode===re.SCENE2D||c instanceof _n?u=Number.POSITIVE_INFINITY:u=n.drawingBufferHeight/t.camera.frustum.sseDenominator,a.z=e.geometricError*e.geometricErrorScale,a.w=u}return a},u_highlightColor:function(){return e._highlightColor},u_constantColor:function(){return e._constantColor},u_clippingPlanes:function(){let a=e.clippingPlanes;return e.isClipped?a.texture:n.defaultTexture},u_clippingPlanesEdgeStyle:function(){let a=e.clippingPlanes;if(!l(a))return z.TRANSPARENT;let c=z.clone(a.edgeColor,FMt);return c.alpha=a.edgeWidth,c},u_clippingPlanesMatrix:function(){let a=e.clippingPlanes;if(!l(a))return M.IDENTITY;let c=e.clippingPlanesOriginMatrix??e._modelMatrix;M.multiply(n.uniformState.view3D,c,Xne);let u=M.multiply(Xne,a.modelMatrix,Xne);return M.inverseTranspose(u,kMt)}};dO.addUniforms(e,s),(i||r||o)&&(s=Mt(s,{u_quantizedVolumeScaleAndOctEncodedRange:function(){let a=LMt;if(l(e._quantizedVolumeScale)){let c=h.clone(e._quantizedVolumeScale,a);h.divideByScalar(c,e._quantizedRange,a)}return a.w=e._octEncodedRange,a}})),l(e._uniformMapLoaded)&&(s=e._uniformMapLoaded(s)),e._drawCommand.uniformMap=s}function Kne(e,t){let n=/czm_3dtiles_property_(\d+)/g,i=n.exec(e);for(;i!==null;){let r=parseInt(i[1]);t.indexOf(r)===-1&&t.push(r),i=n.exec(e)}}function $ne(e,t){e=e.slice(e.indexOf(` +`));let n=/czm_3dtiles_builtin_property_(\w+)/g,i=n.exec(e);for(;i!==null;){let r=i[1];t.indexOf(r)===-1&&t.push(r),i=n.exec(e)}}function Jne(e,t){let n=e.numberOfAttributes;for(let i=0;i<n;++i){let r=e.getAttribute(i);if(r.index===t)return r}}var VMt={POSITION:"czm_3dtiles_builtin_property_POSITION",POSITION_ABSOLUTE:"czm_3dtiles_builtin_property_POSITION_ABSOLUTE",COLOR:"czm_3dtiles_builtin_property_COLOR",NORMAL:"czm_3dtiles_builtin_property_NORMAL"};function jMt(e,t,n){let i,r,o,s=t.context,a=l(n),c=e._isQuantized,u=e._isQuantizedDraco,f=e._isOctEncoded16P,d=e._isOctEncodedDraco,p=e._isRGB565,g=e._isTranslucent,m=e._hasColors,y=e._hasNormals,A=e._hasBatchIds,b=e._backFaceCulling,x=e._normalShading,T=e._drawCommand.vertexArray,E=e.clippingPlanes,v=e._attenuation,S,I,R,O=g,L=Ze(VMt),_={},C=e._styleableShaderAttributes;for(r in C)C.hasOwnProperty(r)&&(o=C[r],L[r]=`czm_3dtiles_property_${o.location}`,_[o.location]=o);if(a){let fe={translucent:!1},xe="(vec3 czm_3dtiles_builtin_property_POSITION, vec3 czm_3dtiles_builtin_property_POSITION_ABSOLUTE, vec4 czm_3dtiles_builtin_property_COLOR, vec3 czm_3dtiles_builtin_property_NORMAL)";S=n.getColorShaderFunction(`getColorFromStyle${xe}`,L,fe),I=n.getShowShaderFunction(`getShowFromStyle${xe}`,L,fe),R=n.getPointSizeShaderFunction(`getPointSizeFromStyle${xe}`,L,fe),l(S)&&fe.translucent&&(O=!0)}e._styleTranslucent=O;let w=l(S),D=l(I),N=l(R),F=e.isClipped,V=[],B=[];w&&(Kne(S,V),$ne(S,B)),D&&(Kne(I,V),$ne(I,B)),N&&(Kne(R,V),$ne(R,B));let j=B.indexOf("COLOR")>=0,k=B.indexOf("NORMAL")>=0;if(k&&!y)throw new oe("Style references the NORMAL semantic but the point cloud does not have normals");for(r in C)if(C.hasOwnProperty(r)){o=C[r];let fe=V.indexOf(o.location)>=0,xe=Jne(T,o.location);xe.enabled=fe}let G=m&&(!w||j);if(m){let fe=Jne(T,TG);fe.enabled=G}let q=y&&(x||b||k);if(y){let fe=Jne(T,Zne);fe.enabled=q}let Q={a_position:EDe};G&&(Q.a_color=TG),q&&(Q.a_normal=Zne),A&&(Q.a_batchId=CDe);let W="",J=V.length;for(i=0;i<J;++i){let fe=V[i];o=_[fe];let xe=o.componentCount,ge=`czm_3dtiles_property_${fe}`,we;xe===1?we="float":we=`vec${xe}`,W+=`in ${we} ${ge}; +`,Q[ge]=o.location}zMt(e,t);let Z=`in vec3 a_position; out vec4 v_color; uniform vec4 u_pointSizeAndTimeAndGeometricErrorAndDepthMultiplier; uniform vec4 u_constantColor; @@ -12642,43 +12642,15 @@ const float NORMALIZE_5 = 1.0 / 32.0; uniform mat4 u_clippingPlanesMatrix; uniform vec4 u_clippingPlanesEdgeStyle; `,ae+=` -`,ae+=Bw(E,s),ae+=` +`,ae+=GS(E,s),ae+=` `),ae+=`void main() { out_FragColor = czm_gammaCorrect(v_color); -`,F&&(ae+=N9("u_clippingPlanes","u_clippingPlanesMatrix","u_clippingPlanesEdgeStyle")),ae+=`} -`,e.splitDirection!==Wo.NONE&&(ae=bM.modifyFragmentShader(ae)),l(e._vertexShaderLoaded)&&(Z=e._vertexShaderLoaded(Z)),l(e._fragmentShaderLoaded)&&(ae=e._fragmentShaderLoaded(ae));let Ae=e._drawCommand;l(Ae.shaderProgram)&&Ae.shaderProgram.destroy(),Ae.shaderProgram=Qt.fromCache({context:s,vertexShaderSource:Z,fragmentShaderSource:ae,attributeLocations:Q});try{Ae.shaderProgram._bind()}catch{throw new oe("Error generating style shader: this may be caused by a type mismatch, index out-of-bounds, or other syntax error.")}}function TUt(e,t){if(e._decodingState===JT.READY)return!1;if(e._decodingState===JT.NEEDS_DECODE){let n=e._parsedContent,i=n.draco,r=uy.decodePointCloud(i,t);l(r)&&(e._decodingState=JT.DECODING,r.then(function(o){e._decodingState=JT.READY;let s=l(o.POSITION)?o.POSITION.array:void 0,a=l(o.RGB)?o.RGB.array:void 0,c=l(o.RGBA)?o.RGBA.array:void 0,u=l(o.NORMAL)?o.NORMAL.array:void 0,f=l(o.BATCH_ID)?o.BATCH_ID.array:void 0,d=l(s)&&l(o.POSITION.data.quantization),p=l(u)&&l(o.NORMAL.data.quantization);if(d){let A=o.POSITION.data.quantization,b=A.range;e._quantizedVolumeScale=h.fromElements(b,b,b),e._quantizedVolumeOffset=h.unpack(A.minValues),e._quantizedRange=(1<<A.quantizationBits)-1,e._isQuantizedDraco=!0}p&&(e._octEncodedRange=(1<<o.NORMAL.data.quantization.quantizationBits)-1,e._isOctEncodedDraco=!0);let g=n.styleableProperties,m=i.batchTableProperties;for(let A in m)if(m.hasOwnProperty(A)){let b=o[A];l(g)||(g={}),g[A]={typedArray:b.array,componentCount:b.data.componentsPerAttribute}}l(s)&&(n.positions={typedArray:s});let y=c??a;l(y)&&(n.colors={typedArray:y}),l(u)&&(n.normals={typedArray:u}),l(f)&&(n.batchIds={typedArray:f}),n.styleableProperties=g}).catch(function(o){e._decodingState=JT.FAILED,e._error=o}))}return!0}var EUt=new se,CUt=new h;xM.prototype.update=function(e){let t=e.context;if(l(this._error)){let u=this._error;throw this._error=void 0,u}if(TUt(this,t))return;let i=!1,r=!M.equals(this._modelMatrix,this.modelMatrix);if(this._mode!==e.mode&&(this._mode=e.mode,r=!0),l(this._drawCommand)||(yUt(this,e),r=!0,i=!0,this._ready=!0,this._parsedContent=void 0),r){M.clone(this.modelMatrix,this._modelMatrix);let u=this._drawCommand.modelMatrix;if(M.clone(this._modelMatrix,u),l(this._rtcCenter)&&M.multiplyByTranslation(u,this._rtcCenter,u),l(this._quantizedVolumeOffset)&&M.multiplyByTranslation(u,this._quantizedVolumeOffset,u),e.mode!==re.SCENE3D){let d=e.mapProjection,p=M.getColumn(u,3,EUt);se.equals(p,se.UNIT_W)||At.basisTo2D(d,u,u)}let f=this._drawCommand.boundingVolume;if(ue.clone(this._boundingSphere,f),this._cull){let d=f.center;M.multiplyByPoint(u,d,d);let p=M.getScale(u,CUt);f.radius*=h.maximumComponent(p)}}this.clippingPlanesDirty&&(this.clippingPlanesDirty=!1,i=!0),this._attenuation!==this.attenuation&&(this._attenuation=this.attenuation,i=!0),this.backFaceCulling!==this._backFaceCulling&&(this._backFaceCulling=this.backFaceCulling,i=!0),this.normalShading!==this._normalShading&&(this._normalShading=this.normalShading,i=!0),(this._style!==this.style||this.styleDirty)&&(this._style=this.style,this.styleDirty=!1,i=!0);let o=this.splitDirection!==Wo.NONE;this._splittingEnabled!==o&&(this._splittingEnabled=o,i=!0),i&&xUt(this,e,this._style),this._drawCommand.castShadows=Dn.castShadows(this.shadows),this._drawCommand.receiveShadows=Dn.receiveShadows(this.shadows);let s=this._highlightColor.alpha<1||this._constantColor.alpha<1||this._styleTranslucent;this._drawCommand.renderState=s?this._translucentRenderState:this._opaqueRenderState,this._drawCommand.pass=s?Ie.TRANSLUCENT:this._opaquePass;let a=e.commandList,c=e.passes;(c.render||c.pick)&&a.push(this._drawCommand)};xM.prototype.isDestroyed=function(){return!1};xM.prototype.destroy=function(){let e=this._drawCommand;return l(e)&&(e.vertexArray=e.vertexArray&&e.vertexArray.destroy(),e.shaderProgram=e.shaderProgram&&e.shaderProgram.destroy()),le(this)};var B9=xM;function QT(e){e=e??H.EMPTY_OBJECT,this.show=e.show??!0,this.modelMatrix=M.clone(e.modelMatrix??M.IDENTITY),this.shadows=e.shadows??Dn.ENABLED,this.maximumMemoryUsage=e.maximumMemoryUsage??256,this.shading=new ng(e.shading),this.style=e.style,this.frameFailed=new be,this.frameChanged=new be,this._clock=e.clock,this._intervals=e.intervals,this._clippingPlanes=void 0,this.clippingPlanes=e.clippingPlanes,this._pointCloudEyeDomeLighting=new vy,this._loadTimestamp=void 0,this._clippingPlanesState=0,this._styleDirty=!1,this._pickId=void 0,this._totalMemoryUsageInBytes=0,this._frames=[],this._previousInterval=void 0,this._nextInterval=void 0,this._lastRenderedFrame=void 0,this._clockMultiplier=0,this._runningSum=0,this._runningLength=0,this._runningIndex=0,this._runningSamples=new Array(5).fill(0),this._runningAverage=0}Object.defineProperties(QT.prototype,{clippingPlanes:{get:function(){return this._clippingPlanes},set:function(e){Ps.setOwner(e,this,"_clippingPlanes")}},totalMemoryUsageInBytes:{get:function(){return this._totalMemoryUsageInBytes}},boundingSphere:{get:function(){if(l(this._lastRenderedFrame))return this._lastRenderedFrame.pointCloud.boundingSphere}}});function vUt(e){return`uniform vec4 czm_pickColor; -${e}`}function SUt(e){return function(t){return Mt(t,{czm_pickColor:function(){return e._pickId.color}})}}function wUt(){return"czm_pickColor"}QT.prototype.makeStyleDirty=function(){this._styleDirty=!0};QT.prototype._getAverageLoadTime=function(){return this._runningLength===0?.05:this._runningAverage};var IUt=new K;function pse(e){let t=e._clock,n=t.canAnimate&&t.shouldAnimate,i=t.multiplier;return n?i:0}function ZT(e,t){return e._intervals.indexOf(t.start)}function PUt(e,t){let n=e._intervals,i=e._clock,r=pse(e);if(r===0)return;let o=e._getAverageLoadTime(),s=K.addSeconds(i.currentTime,o*r,IUt),a=n.indexOf(s),c=ZT(e,t);return a===c&&(r>=0?++a:--a),n.get(a)}function DUt(e){let t=e._intervals,i=e._clock.currentTime,r=t.indexOf(i);return t.get(r)}function RUt(e,t,n){let i=pse(e),r=ZT(e,t),o=ZT(e,n);return i>=0?r>=o:r<=o}function TLe(e,t){return function(n){let i=l(n.message)?n.message:n.toString();e.frameFailed.numberOfListeners>0?e.frameFailed.raiseEvent({uri:t,message:i}):(console.log(`A frame failed to load: ${t}`),console.log(`Error: ${i}`))}}function OUt(e,t,n){let i=ZT(e,t),r=e._frames,o=r[i];if(!l(o)){let s=t.data.transform,a=l(s)?M.fromArray(s):void 0,c=t.data.uri;o={pointCloud:void 0,transform:a,timestamp:xn(),sequential:!0,ready:!1,touchedFrameNumber:n.frameNumber,uri:c},r[i]=o,De.fetchArrayBuffer({url:c}).then(function(u){o.pointCloud=new B9({arrayBuffer:u,cull:!0,fragmentShaderLoaded:vUt,uniformMapLoaded:SUt(e),pickIdLoaded:wUt})}).catch(TLe(e,c))}return o}function MUt(e,t){e._runningSum+=t,e._runningSum-=e._runningSamples[e._runningIndex],e._runningSamples[e._runningIndex]=t,e._runningLength=Math.min(e._runningLength+1,e._runningSamples.length),e._runningIndex=(e._runningIndex+1)%e._runningSamples.length,e._runningAverage=e._runningSum/e._runningLength}function NUt(e,t,n,i){t.touchedFrameNumber<i.frameNumber-1&&(t.sequential=!1);let r=t.pointCloud;if(l(r)&&!t.ready){let o=i.commandList,s=o.length;if(ELe(e,t,n,i),r.ready&&(t.ready=!0,e._totalMemoryUsageInBytes+=r.geometryByteLength,o.length=s,t.sequential)){let a=(xn()-t.timestamp)/1e3;MUt(e,a)}}t.touchedFrameNumber=i.frameNumber}var LUt=new M;function FUt(e,t){let n=e.shading;return l(n)&&l(n.baseResolution)?n.baseResolution:l(t.boundingSphere)?P.cbrt(t.boundingSphere.volume()/t.pointsLength):0}function BUt(e){let t=e.shading;return l(t)&&l(t.maximumAttenuation)?t.maximumAttenuation:10}var kUt=new ng;function ELe(e,t,n,i){let r=e.shading??kUt,o=t.pointCloud,s=t.transform??M.IDENTITY;o.modelMatrix=M.multiplyTransformation(e.modelMatrix,s,LUt),o.style=e.style,o.time=n.timeSinceLoad,o.shadows=e.shadows,o.clippingPlanes=e._clippingPlanes,o.isClipped=n.isClipped,o.attenuation=r.attenuation,o.backFaceCulling=r.backFaceCulling,o.normalShading=r.normalShading,o.geometricError=FUt(e,o),o.geometricErrorScale=r.geometricErrorScale,o.maximumAttenuation=BUt(e);try{o.update(i)}catch(a){TLe(e,t.uri)(a)}t.touchedFrameNumber=i.frameNumber}function mse(e,t,n,i){let r=OUt(e,t,i);NUt(e,r,n,i)}function UUt(e){return function(t){return t.touchedFrameNumber<e.frameNumber}}function CLe(e,t){let n=e._frames,i=n.length;for(let r=0;r<i;++r){let o=n[r];if(l(o)&&(!l(t)||t(o))){let s=o.pointCloud;o.ready&&(e._totalMemoryUsageInBytes-=s.geometryByteLength),l(s)&&s.destroy(),o===e._lastRenderedFrame&&(e._lastRenderedFrame=void 0),n[r]=void 0}}}function zUt(e,t){let n=ZT(e,t),i=e._frames[n];if(l(i)&&i.ready)return i}function xLe(e,t,n,i,r){return l(n)?n.ready?!0:(mse(e,t,i,r),n.ready):!1}function VUt(e,t,n,i,r){let o,s,a,c=e._intervals,u=e._frames,f=ZT(e,n),d=ZT(e,t);if(f>=d){for(o=f;o>=d;--o)if(s=c.get(o),a=u[o],xLe(e,s,a,i,r))return s}else for(o=f;o<=d;++o)if(s=c.get(o),a=u[o],xLe(e,s,a,i,r))return s;return t}function jUt(e,t,n){let i=e._frames,r=i.length;for(let o=0;o<r;++o){let s=i[o];l(s)&&l(s.pointCloud)&&(s.pointCloud.clippingPlanesDirty=t,s.pointCloud.styleDirty=n)}}var lI={timeSinceLoad:0,isClipped:!1,clippingPlanesDirty:!1};QT.prototype.update=function(e){if(e.mode===re.MORPHING||!this.show)return;l(this._pickId)||(this._pickId=e.context.createPickId({primitive:this})),l(this._loadTimestamp)||(this._loadTimestamp=K.clone(e.time));let t=Math.max(K.secondsDifference(e.time,this._loadTimestamp)*1e3,0),n=this._clippingPlanes,i=0,r=!1,o=l(n)&&n.enabled;o&&(n.update(e),i=n.clippingPlanesState),this._clippingPlanesState!==i&&(this._clippingPlanesState=i,r=!0);let s=this._styleDirty;this._styleDirty=!1,(r||s)&&jUt(this,r,s),lI.timeSinceLoad=t,lI.isClipped=o;let a=this.shading,c=this._pointCloudEyeDomeLighting,u=e.commandList,f=u.length,d=this._previousInterval,p=this._nextInterval,g=DUt(this);if(!l(g))return;let m=!1,y=pse(this),A=y===0;y!==this._clockMultiplier&&(m=!0,this._clockMultiplier=y),(!l(d)||A)&&(d=g),(!l(p)||m||RUt(this,g,p))&&(p=PUt(this,g)),d=VUt(this,d,g,lI,e);let b=zUt(this,d);l(b)||(mse(this,d,lI,e),b=this._lastRenderedFrame),l(b)&&ELe(this,b,lI,e),l(p)&&mse(this,p,lI,e);let x=this;l(b)&&!l(this._lastRenderedFrame)&&e.afterRender.push(function(){return!0}),l(b)&&b!==this._lastRenderedFrame&&x.frameChanged.numberOfListeners>0&&e.afterRender.push(function(){return x.frameChanged.raiseEvent(x),!0}),this._previousInterval=d,this._nextInterval=p,this._lastRenderedFrame=b;let T=this._totalMemoryUsageInBytes,E=this.maximumMemoryUsage*1024*1024;T>E&&CLe(this,UUt(e));let S=u.length-f;l(a)&&a.attenuation&&a.eyeDomeLighting&&S>0&&c.update(e,f,a,this.boundingSphere)};QT.prototype.isDestroyed=function(){return!1};QT.prototype.destroy=function(){return CLe(this),this._clippingPlanes=this._clippingPlanes&&this._clippingPlanes.destroy(),this._pickId=this._pickId&&this._pickId.destroy(),le(this)};var TM=QT;function wLe(e,t){if(l(t)){let n=t.clock;l(n)&&n.getValue(e)}}function HUt(e){e._renderLoopRunning=!0;let t=0;function n(i){if(!e.isDestroyed())if(e._useDefaultRenderLoop)try{let r=e._targetFrameRate;if(!l(r))e.resize(),e.render(),requestAnimationFrame(n);else{let o=1e3/r,s=i-t;s>o&&(e.resize(),e.render(),t=i-s%o),requestAnimationFrame(n)}}catch(r){e._useDefaultRenderLoop=!1,e._renderLoopRunning=!1,e._showRenderLoopErrors&&e.showErrorPanel("An error occurred while rendering. Rendering has stopped.",void 0,r)}else e._renderLoopRunning=!1}requestAnimationFrame(n)}function ILe(e){let t=e._useBrowserRecommendedResolution?1:window.devicePixelRatio;return t*=e._resolutionScale,l(e._scene)&&(e._scene.pixelRatio=t),t}function PLe(e){let t=e._canvas,n=t.clientWidth,i=t.clientHeight,r=ILe(e);e._canvasClientWidth=n,e._canvasClientHeight=i,n*=r,i*=r,t.width=n,t.height=i,e._canRender=n!==0&&i!==0,e._lastDevicePixelRatio=window.devicePixelRatio}function DLe(e){let t=e._canvas,n=t.width,i=t.height;if(n!==0&&i!==0){let r=e._scene.camera.frustum;l(r.aspectRatio)?r.aspectRatio=n/i:(r.top=r.right*(i/n),r.bottom=-r.top)}}function Vr(e,t){e=kn(e),t=t??H.EMPTY_OBJECT;let n=document.createElement("div");n.className="cesium-widget",e.appendChild(n);let i=document.createElement("canvas"),r=dn.supportsImageRenderingPixelated();this._supportsImageRenderingPixelated=r,r&&(i.style.imageRendering=dn.imageRenderingValue()),i.oncontextmenu=function(){return!1},i.onselectstart=function(){return!1};function o(){i!==i.ownerDocument.activeElement&&i.ownerDocument.activeElement.blur()}(t.blurActiveElementOnCanvasFocus??!0)&&(i.addEventListener("mousedown",o),i.addEventListener("pointerdown",o)),n.appendChild(i);let a=document.createElement("div");a.className="cesium-widget-credits";let c=l(t.creditContainer)?kn(t.creditContainer):n;c.appendChild(a);let u=l(t.creditViewport)?kn(t.creditViewport):n,f=t.showRenderLoopErrors??!0,d=t.useBrowserRecommendedResolution??!0;this._element=n,this._container=e,this._canvas=i,this._canvasClientWidth=0,this._canvasClientHeight=0,this._lastDevicePixelRatio=0,this._creditViewport=u,this._creditContainer=c,this._innerCreditContainer=a,this._canRender=!1,this._renderLoopRunning=!1,this._showRenderLoopErrors=f,this._resolutionScale=1,this._useBrowserRecommendedResolution=d,this._forceResize=!1,this._entityView=void 0,this._clockTrackedDataSource=void 0,this._trackedEntity=void 0,this._needTrackedEntityUpdate=!1,this._zoomIsFlight=!1,this._zoomTarget=void 0,this._zoomPromise=void 0,this._zoomOptions=void 0,this._trackedEntityChanged=new be,this._allowDataSourcesToSuspendAnimation=!0,this._clock=l(t.clock)?t.clock:new Mp,l(t.shouldAnimate)&&(this._clock.shouldAnimate=t.shouldAnimate),PLe(this);try{let p=t.ellipsoid??ee.default,g=new D9({canvas:i,contextOptions:t.contextOptions,creditContainer:a,creditViewport:u,ellipsoid:p,mapProjection:t.mapProjection,orderIndependentTranslucency:t.orderIndependentTranslucency,scene3DOnly:t.scene3DOnly??!1,shadows:t.shadows,mapMode2D:t.mapMode2D,requestRenderMode:t.requestRenderMode,maximumRenderTimeChange:t.maximumRenderTimeChange,depthPlaneEllipsoidOffset:t.depthPlaneEllipsoidOffset,msaaSamples:t.msaaSamples});this._scene=g,g.camera.constrainedAxis=h.UNIT_Z,ILe(this),DLe(this);let m=t.globe;l(m)||(m=new sG(p)),m!==!1&&(g.globe=m,g.globe.shadows=t.terrainShadows??Dn.RECEIVE_ONLY);let y=t.skyBox;!l(y)&&ee.WGS84.equals(p)&&(y=O9.createEarthSkyBox()),y!==!1&&(g.skyBox=y,g.sun=new M9,ee.WGS84.equals(p)&&(g.moon=new mG));let A=t.skyAtmosphere;!l(A)&&ee.WGS84.equals(p)&&(A=new R9(p),A.show=t.globe!==!1&&m.show),A!==!1&&(g.skyAtmosphere=A);let b=t.baseLayer;t.globe!==!1&&b!==!1&&(l(b)||(b=Ms.fromWorldImagery()),g.imageryLayers.add(b)),l(t.terrainProvider)&&t.globe!==!1&&(g.terrainProvider=t.terrainProvider),l(t.terrain)&&t.globe!==!1&&g.setTerrain(t.terrain),this._screenSpaceEventHandler=new Ta(i),l(t.sceneMode)&&(t.sceneMode===re.SCENE2D&&this._scene.morphTo2D(0),t.sceneMode===re.COLUMBUS_VIEW&&this._scene.morphToColumbusView(0)),this._useDefaultRenderLoop=void 0,this.useDefaultRenderLoop=t.useDefaultRenderLoop??!0,this._targetFrameRate=void 0,this.targetFrameRate=t.targetFrameRate;let x=this;this._onRenderError=function(R,O){x._useDefaultRenderLoop=!1,x._renderLoopRunning=!1,x._showRenderLoopErrors&&x.showErrorPanel("An error occurred while rendering. Rendering has stopped.",void 0,O)},g.renderError.addEventListener(this._onRenderError);let T=t.dataSources,E=!1;l(T)||(T=new R8,E=!0);let v=new Sj({scene:g,dataSourceCollection:T}),S=new Qo;this._dataSourceChangedListeners={},this._automaticallyTrackDataSourceClocks=t.automaticallyTrackDataSourceClocks??!0,this._dataSourceCollection=T,this._destroyDataSourceCollection=E,this._dataSourceDisplay=v,this._eventHelper=S,this._canAnimateUpdateCallback=this._updateCanAnimate,S.add(this._clock.onTick,Vr.prototype._onTick,this),S.add(g.morphStart,Vr.prototype._clearTrackedObject,this),S.add(T.dataSourceAdded,Vr.prototype._onDataSourceAdded,this),S.add(T.dataSourceRemoved,Vr.prototype._onDataSourceRemoved,this),S.add(g.postRender,Vr.prototype._postRender,this);let I=T.length;for(let R=0;R<I;R++)this._dataSourceAdded(T,T.get(R));this._dataSourceAdded(void 0,v.defaultDataSource),S.add(T.dataSourceAdded,Vr.prototype._dataSourceAdded,this),S.add(T.dataSourceRemoved,Vr.prototype._dataSourceRemoved,this)}catch(p){throw f&&this.showErrorPanel("Error constructing CesiumWidget.",'Visit <a href="http://get.webgl.org">http://get.webgl.org</a> to verify that your web browser and hardware support WebGL. Consider trying a different web browser or updating your video drivers. Detailed error information is below:',p),p}}Object.defineProperties(Vr.prototype,{container:{get:function(){return this._container}},canvas:{get:function(){return this._canvas}},creditContainer:{get:function(){return this._creditContainer}},creditViewport:{get:function(){return this._creditViewport}},scene:{get:function(){return this._scene}},imageryLayers:{get:function(){return this._scene.imageryLayers}},terrainProvider:{get:function(){return this._scene.terrainProvider},set:function(e){this._scene.terrainProvider=e}},creditDisplay:{get:function(){return this._scene.frameState.creditDisplay}},dataSourceDisplay:{get:function(){return this._dataSourceDisplay}},entities:{get:function(){return this._dataSourceDisplay.defaultDataSource.entities}},dataSources:{get:function(){return this._dataSourceCollection}},camera:{get:function(){return this._scene.camera}},ellipsoid:{get:function(){return this._scene.ellipsoid}},clock:{get:function(){return this._clock}},screenSpaceEventHandler:{get:function(){return this._screenSpaceEventHandler}},targetFrameRate:{get:function(){return this._targetFrameRate},set:function(e){this._targetFrameRate=e}},useDefaultRenderLoop:{get:function(){return this._useDefaultRenderLoop},set:function(e){this._useDefaultRenderLoop!==e&&(this._useDefaultRenderLoop=e,e&&!this._renderLoopRunning&&HUt(this))}},resolutionScale:{get:function(){return this._resolutionScale},set:function(e){this._resolutionScale!==e&&(this._resolutionScale=e,this._forceResize=!0)}},useBrowserRecommendedResolution:{get:function(){return this._useBrowserRecommendedResolution},set:function(e){this._useBrowserRecommendedResolution!==e&&(this._useBrowserRecommendedResolution=e,this._forceResize=!0)}},allowDataSourcesToSuspendAnimation:{get:function(){return this._allowDataSourcesToSuspendAnimation},set:function(e){this._allowDataSourcesToSuspendAnimation=e}},trackedEntity:{get:function(){return this._trackedEntity},set:function(e){if(this._trackedEntity!==e){this._trackedEntity=e,gse(this);let t=this.scene,n=t.mode;!l(e)||!l(e.position)?(this._needTrackedEntityUpdate=!1,(n===re.COLUMBUS_VIEW||n===re.SCENE2D)&&(t.screenSpaceCameraController.enableTranslate=!0),(n===re.COLUMBUS_VIEW||n===re.SCENE3D)&&(t.screenSpaceCameraController.enableTilt=!0),this._entityView=void 0,this.camera.lookAtTransform(M.IDENTITY)):this._needTrackedEntityUpdate=!0,this._trackedEntityChanged.raiseEvent(e),this.scene.requestRender()}}},trackedEntityChanged:{get:function(){return this._trackedEntityChanged}},clockTrackedDataSource:{get:function(){return this._clockTrackedDataSource},set:function(e){this._clockTrackedDataSource!==e&&(this._clockTrackedDataSource=e,wLe(this.clock,e))}}});Vr.prototype.showErrorPanel=function(e,t,n){let i=this._element,r=document.createElement("div");r.className="cesium-widget-errorPanel";let o=document.createElement("div");o.className="cesium-widget-errorPanel-content",r.appendChild(o);let s=document.createElement("div");s.className="cesium-widget-errorPanel-header",s.appendChild(document.createTextNode(e)),o.appendChild(s);let a=document.createElement("div");a.className="cesium-widget-errorPanel-scroll",o.appendChild(a);function c(){a.style.maxHeight=`${Math.max(Math.round(i.clientHeight*.9-100),30)}px`}c(),l(window.addEventListener)&&window.addEventListener("resize",c,!1);let u=l(t),f=l(n);if(u||f){let g=document.createElement("div");if(g.className="cesium-widget-errorPanel-message",a.appendChild(g),f){let m=cg(n);u||(typeof n=="string"&&(n=new Error(n)),t=cg({name:n.name,message:n.message}),m=n.stack),typeof console<"u"&&console.error(`${e} +`,F&&(ae+=bG("u_clippingPlanes","u_clippingPlanesMatrix","u_clippingPlanesEdgeStyle")),ae+=`} +`,e.splitDirection!==Yo.NONE&&(ae=dO.modifyFragmentShader(ae)),l(e._vertexShaderLoaded)&&(Z=e._vertexShaderLoaded(Z)),l(e._fragmentShaderLoaded)&&(ae=e._fragmentShaderLoaded(ae));let Ae=e._drawCommand;l(Ae.shaderProgram)&&Ae.shaderProgram.destroy(),Ae.shaderProgram=Qt.fromCache({context:s,vertexShaderSource:Z,fragmentShaderSource:ae,attributeLocations:Q});try{Ae.shaderProgram._bind()}catch{throw new oe("Error generating style shader: this may be caused by a type mismatch, index out-of-bounds, or other syntax error.")}}function HMt(e,t){if(e._decodingState===ET.READY)return!1;if(e._decodingState===ET.NEEDS_DECODE){let n=e._parsedContent,i=n.draco,r=Ey.decodePointCloud(i,t);l(r)&&(e._decodingState=ET.DECODING,r.then(function(o){e._decodingState=ET.READY;let s=l(o.POSITION)?o.POSITION.array:void 0,a=l(o.RGB)?o.RGB.array:void 0,c=l(o.RGBA)?o.RGBA.array:void 0,u=l(o.NORMAL)?o.NORMAL.array:void 0,f=l(o.BATCH_ID)?o.BATCH_ID.array:void 0,d=l(s)&&l(o.POSITION.data.quantization),p=l(u)&&l(o.NORMAL.data.quantization);if(d){let A=o.POSITION.data.quantization,b=A.range;e._quantizedVolumeScale=h.fromElements(b,b,b),e._quantizedVolumeOffset=h.unpack(A.minValues),e._quantizedRange=(1<<A.quantizationBits)-1,e._isQuantizedDraco=!0}p&&(e._octEncodedRange=(1<<o.NORMAL.data.quantization.quantizationBits)-1,e._isOctEncodedDraco=!0);let g=n.styleableProperties,m=i.batchTableProperties;for(let A in m)if(m.hasOwnProperty(A)){let b=o[A];l(g)||(g={}),g[A]={typedArray:b.array,componentCount:b.data.componentsPerAttribute}}l(s)&&(n.positions={typedArray:s});let y=c??a;l(y)&&(n.colors={typedArray:y}),l(u)&&(n.normals={typedArray:u}),l(f)&&(n.batchIds={typedArray:f}),n.styleableProperties=g}).catch(function(o){e._decodingState=ET.FAILED,e._error=o}))}return!0}var GMt=new se,WMt=new h;hO.prototype.update=function(e){let t=e.context;if(l(this._error)){let u=this._error;throw this._error=void 0,u}if(HMt(this,t))return;let i=!1,r=!M.equals(this._modelMatrix,this.modelMatrix);if(this._mode!==e.mode&&(this._mode=e.mode,r=!0),l(this._drawCommand)||(UMt(this,e),r=!0,i=!0,this._ready=!0,this._parsedContent=void 0),r){M.clone(this.modelMatrix,this._modelMatrix);let u=this._drawCommand.modelMatrix;if(M.clone(this._modelMatrix,u),l(this._rtcCenter)&&M.multiplyByTranslation(u,this._rtcCenter,u),l(this._quantizedVolumeOffset)&&M.multiplyByTranslation(u,this._quantizedVolumeOffset,u),e.mode!==re.SCENE3D){let d=e.mapProjection,p=M.getColumn(u,3,GMt);se.equals(p,se.UNIT_W)||At.basisTo2D(d,u,u)}let f=this._drawCommand.boundingVolume;if(ue.clone(this._boundingSphere,f),this._cull){let d=f.center;M.multiplyByPoint(u,d,d);let p=M.getScale(u,WMt);f.radius*=h.maximumComponent(p)}}this.clippingPlanesDirty&&(this.clippingPlanesDirty=!1,i=!0),this._attenuation!==this.attenuation&&(this._attenuation=this.attenuation,i=!0),this.backFaceCulling!==this._backFaceCulling&&(this._backFaceCulling=this.backFaceCulling,i=!0),this.normalShading!==this._normalShading&&(this._normalShading=this.normalShading,i=!0),(this._style!==this.style||this.styleDirty)&&(this._style=this.style,this.styleDirty=!1,i=!0);let o=this.splitDirection!==Yo.NONE;this._splittingEnabled!==o&&(this._splittingEnabled=o,i=!0),i&&jMt(this,e,this._style),this._drawCommand.castShadows=Pn.castShadows(this.shadows),this._drawCommand.receiveShadows=Pn.receiveShadows(this.shadows);let s=this._highlightColor.alpha<1||this._constantColor.alpha<1||this._styleTranslucent;this._drawCommand.renderState=s?this._translucentRenderState:this._opaqueRenderState,this._drawCommand.pass=s?Ie.TRANSLUCENT:this._opaquePass;let a=e.commandList,c=e.passes;(c.render||c.pick)&&a.push(this._drawCommand)};hO.prototype.isDestroyed=function(){return!1};hO.prototype.destroy=function(){let e=this._drawCommand;return l(e)&&(e.vertexArray=e.vertexArray&&e.vertexArray.destroy(),e.shaderProgram=e.shaderProgram&&e.shaderProgram.destroy()),le(this)};var EG=hO;function vT(e){e=e??H.EMPTY_OBJECT,this.show=e.show??!0,this.modelMatrix=M.clone(e.modelMatrix??M.IDENTITY),this.shadows=e.shadows??Pn.ENABLED,this.maximumMemoryUsage=e.maximumMemoryUsage??256,this.shading=new ug(e.shading),this.style=e.style,this.frameFailed=new be,this.frameChanged=new be,this._clock=e.clock,this._intervals=e.intervals,this._clippingPlanes=void 0,this.clippingPlanes=e.clippingPlanes,this._pointCloudEyeDomeLighting=new vy,this._loadTimestamp=void 0,this._clippingPlanesState=0,this._styleDirty=!1,this._pickId=void 0,this._totalMemoryUsageInBytes=0,this._frames=[],this._previousInterval=void 0,this._nextInterval=void 0,this._lastRenderedFrame=void 0,this._clockMultiplier=0,this._runningSum=0,this._runningLength=0,this._runningIndex=0,this._runningSamples=new Array(5).fill(0),this._runningAverage=0}Object.defineProperties(vT.prototype,{clippingPlanes:{get:function(){return this._clippingPlanes},set:function(e){Ds.setOwner(e,this,"_clippingPlanes")}},totalMemoryUsageInBytes:{get:function(){return this._totalMemoryUsageInBytes}},boundingSphere:{get:function(){if(l(this._lastRenderedFrame))return this._lastRenderedFrame.pointCloud.boundingSphere}}});function qMt(e){return`uniform vec4 czm_pickColor; +${e}`}function YMt(e){return function(t){return Mt(t,{czm_pickColor:function(){return e._pickId.color}})}}function XMt(){return"czm_pickColor"}vT.prototype.makeStyleDirty=function(){this._styleDirty=!0};vT.prototype._getAverageLoadTime=function(){return this._runningLength===0?.05:this._runningAverage};var KMt=new K;function eie(e){let t=e._clock,n=t.canAnimate&&t.shouldAnimate,i=t.multiplier;return n?i:0}function CT(e,t){return e._intervals.indexOf(t.start)}function $Mt(e,t){let n=e._intervals,i=e._clock,r=eie(e);if(r===0)return;let o=e._getAverageLoadTime(),s=K.addSeconds(i.currentTime,o*r,KMt),a=n.indexOf(s),c=CT(e,t);return a===c&&(r>=0?++a:--a),n.get(a)}function JMt(e){let t=e._intervals,i=e._clock.currentTime,r=t.indexOf(i);return t.get(r)}function ZMt(e,t,n){let i=eie(e),r=CT(e,t),o=CT(e,n);return i>=0?r>=o:r<=o}function SDe(e,t){return function(n){let i=l(n.message)?n.message:n.toString();e.frameFailed.numberOfListeners>0?e.frameFailed.raiseEvent({uri:t,message:i}):(console.log(`A frame failed to load: ${t}`),console.log(`Error: ${i}`))}}function QMt(e,t,n){let i=CT(e,t),r=e._frames,o=r[i];if(!l(o)){let s=t.data.transform,a=l(s)?M.fromArray(s):void 0,c=t.data.uri;o={pointCloud:void 0,transform:a,timestamp:xn(),sequential:!0,ready:!1,touchedFrameNumber:n.frameNumber,uri:c},r[i]=o,De.fetchArrayBuffer({url:c}).then(function(u){o.pointCloud=new EG({arrayBuffer:u,cull:!0,fragmentShaderLoaded:qMt,uniformMapLoaded:YMt(e),pickIdLoaded:XMt})}).catch(SDe(e,c))}return o}function eNt(e,t){e._runningSum+=t,e._runningSum-=e._runningSamples[e._runningIndex],e._runningSamples[e._runningIndex]=t,e._runningLength=Math.min(e._runningLength+1,e._runningSamples.length),e._runningIndex=(e._runningIndex+1)%e._runningSamples.length,e._runningAverage=e._runningSum/e._runningLength}function tNt(e,t,n,i){t.touchedFrameNumber<i.frameNumber-1&&(t.sequential=!1);let r=t.pointCloud;if(l(r)&&!t.ready){let o=i.commandList,s=o.length;if(wDe(e,t,n,i),r.ready&&(t.ready=!0,e._totalMemoryUsageInBytes+=r.geometryByteLength,o.length=s,t.sequential)){let a=(xn()-t.timestamp)/1e3;eNt(e,a)}}t.touchedFrameNumber=i.frameNumber}var nNt=new M;function iNt(e,t){let n=e.shading;return l(n)&&l(n.baseResolution)?n.baseResolution:l(t.boundingSphere)?P.cbrt(t.boundingSphere.volume()/t.pointsLength):0}function rNt(e){let t=e.shading;return l(t)&&l(t.maximumAttenuation)?t.maximumAttenuation:10}var oNt=new ug;function wDe(e,t,n,i){let r=e.shading??oNt,o=t.pointCloud,s=t.transform??M.IDENTITY;o.modelMatrix=M.multiplyTransformation(e.modelMatrix,s,nNt),o.style=e.style,o.time=n.timeSinceLoad,o.shadows=e.shadows,o.clippingPlanes=e._clippingPlanes,o.isClipped=n.isClipped,o.attenuation=r.attenuation,o.backFaceCulling=r.backFaceCulling,o.normalShading=r.normalShading,o.geometricError=iNt(e,o),o.geometricErrorScale=r.geometricErrorScale,o.maximumAttenuation=rNt(e);try{o.update(i)}catch(a){SDe(e,t.uri)(a)}t.touchedFrameNumber=i.frameNumber}function Qne(e,t,n,i){let r=QMt(e,t,i);tNt(e,r,n,i)}function sNt(e){return function(t){return t.touchedFrameNumber<e.frameNumber}}function IDe(e,t){let n=e._frames,i=n.length;for(let r=0;r<i;++r){let o=n[r];if(l(o)&&(!l(t)||t(o))){let s=o.pointCloud;o.ready&&(e._totalMemoryUsageInBytes-=s.geometryByteLength),l(s)&&s.destroy(),o===e._lastRenderedFrame&&(e._lastRenderedFrame=void 0),n[r]=void 0}}}function aNt(e,t){let n=CT(e,t),i=e._frames[n];if(l(i)&&i.ready)return i}function vDe(e,t,n,i,r){return l(n)?n.ready?!0:(Qne(e,t,i,r),n.ready):!1}function cNt(e,t,n,i,r){let o,s,a,c=e._intervals,u=e._frames,f=CT(e,n),d=CT(e,t);if(f>=d){for(o=f;o>=d;--o)if(s=c.get(o),a=u[o],vDe(e,s,a,i,r))return s}else for(o=f;o<=d;++o)if(s=c.get(o),a=u[o],vDe(e,s,a,i,r))return s;return t}function lNt(e,t,n){let i=e._frames,r=i.length;for(let o=0;o<r;++o){let s=i[o];l(s)&&l(s.pointCloud)&&(s.pointCloud.clippingPlanesDirty=t,s.pointCloud.styleDirty=n)}}var _w={timeSinceLoad:0,isClipped:!1,clippingPlanesDirty:!1};vT.prototype.update=function(e){if(e.mode===re.MORPHING||!this.show)return;l(this._pickId)||(this._pickId=e.context.createPickId({primitive:this})),l(this._loadTimestamp)||(this._loadTimestamp=K.clone(e.time));let t=Math.max(K.secondsDifference(e.time,this._loadTimestamp)*1e3,0),n=this._clippingPlanes,i=0,r=!1,o=l(n)&&n.enabled;o&&(n.update(e),i=n.clippingPlanesState),this._clippingPlanesState!==i&&(this._clippingPlanesState=i,r=!0);let s=this._styleDirty;this._styleDirty=!1,(r||s)&&lNt(this,r,s),_w.timeSinceLoad=t,_w.isClipped=o;let a=this.shading,c=this._pointCloudEyeDomeLighting,u=e.commandList,f=u.length,d=this._previousInterval,p=this._nextInterval,g=JMt(this);if(!l(g))return;let m=!1,y=eie(this),A=y===0;y!==this._clockMultiplier&&(m=!0,this._clockMultiplier=y),(!l(d)||A)&&(d=g),(!l(p)||m||ZMt(this,g,p))&&(p=$Mt(this,g)),d=cNt(this,d,g,_w,e);let b=aNt(this,d);l(b)||(Qne(this,d,_w,e),b=this._lastRenderedFrame),l(b)&&wDe(this,b,_w,e),l(p)&&Qne(this,p,_w,e);let x=this;l(b)&&!l(this._lastRenderedFrame)&&e.afterRender.push(function(){return!0}),l(b)&&b!==this._lastRenderedFrame&&x.frameChanged.numberOfListeners>0&&e.afterRender.push(function(){return x.frameChanged.raiseEvent(x),!0}),this._previousInterval=d,this._nextInterval=p,this._lastRenderedFrame=b;let T=this._totalMemoryUsageInBytes,E=this.maximumMemoryUsage*1024*1024;T>E&&IDe(this,sNt(e));let S=u.length-f;l(a)&&a.attenuation&&a.eyeDomeLighting&&S>0&&c.update(e,f,a,this.boundingSphere)};vT.prototype.isDestroyed=function(){return!1};vT.prototype.destroy=function(){return IDe(this),this._clippingPlanes=this._clippingPlanes&&this._clippingPlanes.destroy(),this._pickId=this._pickId&&this._pickId.destroy(),le(this)};var mO=vT;function RDe(e,t){if(l(t)){let n=t.clock;l(n)&&n.getValue(e)}}function uNt(e){e._renderLoopRunning=!0;let t=0;function n(i){if(!e.isDestroyed())if(e._useDefaultRenderLoop)try{let r=e._targetFrameRate;if(!l(r))e.resize(),e.render(),requestAnimationFrame(n);else{let o=1e3/r,s=i-t;s>o&&(e.resize(),e.render(),t=i-s%o),requestAnimationFrame(n)}}catch(r){e._useDefaultRenderLoop=!1,e._renderLoopRunning=!1,e._showRenderLoopErrors&&e.showErrorPanel("An error occurred while rendering. Rendering has stopped.",void 0,r)}else e._renderLoopRunning=!1}requestAnimationFrame(n)}function ODe(e){let t=e._useBrowserRecommendedResolution?1:window.devicePixelRatio;return t*=e._resolutionScale,l(e._scene)&&(e._scene.pixelRatio=t),t}function MDe(e){let t=e._canvas,n=t.clientWidth,i=t.clientHeight,r=ODe(e);e._canvasClientWidth=n,e._canvasClientHeight=i,n*=r,i*=r,t.width=n,t.height=i,e._canRender=n!==0&&i!==0,e._lastDevicePixelRatio=window.devicePixelRatio}function NDe(e){let t=e._canvas,n=t.width,i=t.height;if(n!==0&&i!==0){let r=e._scene.camera.frustum;l(r.aspectRatio)?r.aspectRatio=n/i:(r.top=r.right*(i/n),r.bottom=-r.top)}}function zr(e,t){e=kn(e),t=t??H.EMPTY_OBJECT;let n=document.createElement("div");n.className="cesium-widget",e.appendChild(n);let i=document.createElement("canvas"),r=dn.supportsImageRenderingPixelated();this._supportsImageRenderingPixelated=r,r&&(i.style.imageRendering=dn.imageRenderingValue()),i.oncontextmenu=function(){return!1},i.onselectstart=function(){return!1};function o(){i!==i.ownerDocument.activeElement&&i.ownerDocument.activeElement.blur()}(t.blurActiveElementOnCanvasFocus??!0)&&(i.addEventListener("mousedown",o),i.addEventListener("pointerdown",o)),n.appendChild(i);let a=document.createElement("div");a.className="cesium-widget-credits";let c=l(t.creditContainer)?kn(t.creditContainer):n;c.appendChild(a);let u=l(t.creditViewport)?kn(t.creditViewport):n,f=t.showRenderLoopErrors??!0,d=t.useBrowserRecommendedResolution??!0;this._element=n,this._container=e,this._canvas=i,this._canvasClientWidth=0,this._canvasClientHeight=0,this._lastDevicePixelRatio=0,this._creditViewport=u,this._creditContainer=c,this._innerCreditContainer=a,this._canRender=!1,this._renderLoopRunning=!1,this._showRenderLoopErrors=f,this._resolutionScale=1,this._useBrowserRecommendedResolution=d,this._forceResize=!1,this._entityView=void 0,this._clockTrackedDataSource=void 0,this._trackedEntity=void 0,this._needTrackedEntityUpdate=!1,this._zoomIsFlight=!1,this._zoomTarget=void 0,this._zoomPromise=void 0,this._zoomOptions=void 0,this._trackedEntityChanged=new be,this._allowDataSourcesToSuspendAnimation=!0,this._clock=l(t.clock)?t.clock:new Km,l(t.shouldAnimate)&&(this._clock.shouldAnimate=t.shouldAnimate),MDe(this);try{let p=t.ellipsoid??ee.default,g=new gG({canvas:i,contextOptions:t.contextOptions,creditContainer:a,creditViewport:u,ellipsoid:p,mapProjection:t.mapProjection,orderIndependentTranslucency:t.orderIndependentTranslucency,scene3DOnly:t.scene3DOnly??!1,shadows:t.shadows,mapMode2D:t.mapMode2D,requestRenderMode:t.requestRenderMode,maximumRenderTimeChange:t.maximumRenderTimeChange,depthPlaneEllipsoidOffset:t.depthPlaneEllipsoidOffset,msaaSamples:t.msaaSamples});this._scene=g,g.camera.constrainedAxis=h.UNIT_Z,ODe(this),NDe(this);let m=t.globe;l(m)||(m=new qj(p)),m!==!1&&(g.globe=m,g.globe.shadows=t.terrainShadows??Pn.RECEIVE_ONLY);let y=t.skyBox;!l(y)&&ee.WGS84.equals(p)&&(y=yG.createEarthSkyBox()),y!==!1&&(g.skyBox=y,g.sun=new AG,ee.WGS84.equals(p)&&(g.moon=new e6));let A=t.skyAtmosphere;!l(A)&&ee.WGS84.equals(p)&&(A=new _G(p),A.show=t.globe!==!1&&m.show),A!==!1&&(g.skyAtmosphere=A);let b=t.baseLayer;t.globe!==!1&&b!==!1&&(l(b)||(b=Ns.fromWorldImagery()),g.imageryLayers.add(b)),l(t.terrainProvider)&&t.globe!==!1&&(g.terrainProvider=t.terrainProvider),l(t.terrain)&&t.globe!==!1&&g.setTerrain(t.terrain),this._screenSpaceEventHandler=new xa(i),l(t.sceneMode)&&(t.sceneMode===re.SCENE2D&&this._scene.morphTo2D(0),t.sceneMode===re.COLUMBUS_VIEW&&this._scene.morphToColumbusView(0)),this._useDefaultRenderLoop=void 0,this.useDefaultRenderLoop=t.useDefaultRenderLoop??!0,this._targetFrameRate=void 0,this.targetFrameRate=t.targetFrameRate;let x=this;this._onRenderError=function(R,O){x._useDefaultRenderLoop=!1,x._renderLoopRunning=!1,x._showRenderLoopErrors&&x.showErrorPanel("An error occurred while rendering. Rendering has stopped.",void 0,O)},g.renderError.addEventListener(this._onRenderError);let T=t.dataSources,E=!1;l(T)||(T=new ak,E=!0);let v=new pj({scene:g,dataSourceCollection:T}),S=new Wo;this._dataSourceChangedListeners={},this._automaticallyTrackDataSourceClocks=t.automaticallyTrackDataSourceClocks??!0,this._dataSourceCollection=T,this._destroyDataSourceCollection=E,this._dataSourceDisplay=v,this._eventHelper=S,this._canAnimateUpdateCallback=this._updateCanAnimate,S.add(this._clock.onTick,zr.prototype._onTick,this),S.add(g.morphStart,zr.prototype._clearTrackedObject,this),S.add(T.dataSourceAdded,zr.prototype._onDataSourceAdded,this),S.add(T.dataSourceRemoved,zr.prototype._onDataSourceRemoved,this),S.add(g.postRender,zr.prototype._postRender,this);let I=T.length;for(let R=0;R<I;R++)this._dataSourceAdded(T,T.get(R));this._dataSourceAdded(void 0,v.defaultDataSource),S.add(T.dataSourceAdded,zr.prototype._dataSourceAdded,this),S.add(T.dataSourceRemoved,zr.prototype._dataSourceRemoved,this)}catch(p){throw f&&this.showErrorPanel("Error constructing CesiumWidget.",'Visit <a href="http://get.webgl.org">http://get.webgl.org</a> to verify that your web browser and hardware support WebGL. Consider trying a different web browser or updating your video drivers. Detailed error information is below:',p),p}}Object.defineProperties(zr.prototype,{container:{get:function(){return this._container}},canvas:{get:function(){return this._canvas}},creditContainer:{get:function(){return this._creditContainer}},creditViewport:{get:function(){return this._creditViewport}},scene:{get:function(){return this._scene}},imageryLayers:{get:function(){return this._scene.imageryLayers}},terrainProvider:{get:function(){return this._scene.terrainProvider},set:function(e){this._scene.terrainProvider=e}},creditDisplay:{get:function(){return this._scene.frameState.creditDisplay}},dataSourceDisplay:{get:function(){return this._dataSourceDisplay}},entities:{get:function(){return this._dataSourceDisplay.defaultDataSource.entities}},dataSources:{get:function(){return this._dataSourceCollection}},camera:{get:function(){return this._scene.camera}},ellipsoid:{get:function(){return this._scene.ellipsoid}},clock:{get:function(){return this._clock}},screenSpaceEventHandler:{get:function(){return this._screenSpaceEventHandler}},targetFrameRate:{get:function(){return this._targetFrameRate},set:function(e){this._targetFrameRate=e}},useDefaultRenderLoop:{get:function(){return this._useDefaultRenderLoop},set:function(e){this._useDefaultRenderLoop!==e&&(this._useDefaultRenderLoop=e,e&&!this._renderLoopRunning&&uNt(this))}},resolutionScale:{get:function(){return this._resolutionScale},set:function(e){this._resolutionScale!==e&&(this._resolutionScale=e,this._forceResize=!0)}},useBrowserRecommendedResolution:{get:function(){return this._useBrowserRecommendedResolution},set:function(e){this._useBrowserRecommendedResolution!==e&&(this._useBrowserRecommendedResolution=e,this._forceResize=!0)}},allowDataSourcesToSuspendAnimation:{get:function(){return this._allowDataSourcesToSuspendAnimation},set:function(e){this._allowDataSourcesToSuspendAnimation=e}},trackedEntity:{get:function(){return this._trackedEntity},set:function(e){if(this._trackedEntity!==e){this._trackedEntity=e,tie(this);let t=this.scene,n=t.mode;!l(e)||!l(e.position)?(this._needTrackedEntityUpdate=!1,(n===re.COLUMBUS_VIEW||n===re.SCENE2D)&&(t.screenSpaceCameraController.enableTranslate=!0),(n===re.COLUMBUS_VIEW||n===re.SCENE3D)&&(t.screenSpaceCameraController.enableTilt=!0),this._entityView=void 0,this.camera.lookAtTransform(M.IDENTITY)):this._needTrackedEntityUpdate=!0,this._trackedEntityChanged.raiseEvent(e),this.scene.requestRender()}}},trackedEntityChanged:{get:function(){return this._trackedEntityChanged}},clockTrackedDataSource:{get:function(){return this._clockTrackedDataSource},set:function(e){this._clockTrackedDataSource!==e&&(this._clockTrackedDataSource=e,RDe(this.clock,e))}}});zr.prototype.showErrorPanel=function(e,t,n){let i=this._element,r=document.createElement("div");r.className="cesium-widget-errorPanel";let o=document.createElement("div");o.className="cesium-widget-errorPanel-content",r.appendChild(o);let s=document.createElement("div");s.className="cesium-widget-errorPanel-header",s.appendChild(document.createTextNode(e)),o.appendChild(s);let a=document.createElement("div");a.className="cesium-widget-errorPanel-scroll",o.appendChild(a);function c(){a.style.maxHeight=`${Math.max(Math.round(i.clientHeight*.9-100),30)}px`}c(),l(window.addEventListener)&&window.addEventListener("resize",c,!1);let u=l(t),f=l(n);if(u||f){let g=document.createElement("div");if(g.className="cesium-widget-errorPanel-message",a.appendChild(g),f){let m=z0(n);u||(typeof n=="string"&&(n=new Error(n)),t=z0({name:n.name,message:n.message}),m=n.stack),typeof console<"u"&&console.error(`${e} ${t} -${m}`);let y=document.createElement("div");y.className="cesium-widget-errorPanel-message-details collapsed";let A=document.createElement("span");A.className="cesium-widget-errorPanel-more-details",A.appendChild(document.createTextNode("See more...")),y.appendChild(A),y.onclick=function(b){y.removeChild(A),y.appendChild(document.createTextNode(m)),y.className="cesium-widget-errorPanel-message-details",o.className="cesium-widget-errorPanel-content expanded",y.onclick=void 0},a.appendChild(y)}g.innerHTML=`<p>${t}</p>`}let d=document.createElement("div");d.className="cesium-widget-errorPanel-buttonPanel",o.appendChild(d);let p=document.createElement("button");p.setAttribute("type","button"),p.className="cesium-button",p.appendChild(document.createTextNode("OK")),p.onclick=function(){l(c)&&l(window.removeEventListener)&&window.removeEventListener("resize",c,!1),i.removeChild(r)},d.appendChild(p),i.appendChild(r)};Vr.prototype.isDestroyed=function(){return!1};Vr.prototype.destroy=function(){let e=this.dataSources,t=e.length;for(let n=0;n<t;n++)this._dataSourceRemoved(e,e.get(n));this._dataSourceRemoved(void 0,this._dataSourceDisplay.defaultDataSource),this._dataSourceDisplay=this._dataSourceDisplay.destroy(),l(this._scene)&&(this._scene.renderError.removeEventListener(this._onRenderError),this._scene=this._scene.destroy()),this._container.removeChild(this._element),this._creditContainer.removeChild(this._innerCreditContainer),this._eventHelper.removeAll(),this._destroyDataSourceCollection&&(this._dataSourceCollection=this._dataSourceCollection.destroy()),le(this)};Vr.prototype.resize=function(){let e=this._canvas;!this._forceResize&&this._canvasClientWidth===e.clientWidth&&this._canvasClientHeight===e.clientHeight&&this._lastDevicePixelRatio===window.devicePixelRatio||(this._forceResize=!1,PLe(this),DLe(this),this._scene.requestRender())};Vr.prototype.render=function(){if(this._canRender){this._scene.initializeFrame();let e=this._clock.tick();this._scene.render(e)}else this._clock.tick()};Vr.prototype._dataSourceAdded=function(e,t){t.entities.collectionChanged.addEventListener(Vr.prototype._onEntityCollectionChanged,this)};Vr.prototype._dataSourceRemoved=function(e,t){let n=t.entities;n.collectionChanged.removeEventListener(Vr.prototype._onEntityCollectionChanged,this),l(this.trackedEntity)&&n.getById(this.trackedEntity.id)===this.trackedEntity&&(this.trackedEntity=void 0)};Vr.prototype._updateCanAnimate=function(e){this._clock.canAnimate=e};var GUt=new ue;Vr.prototype._onTick=function(e){let t=e.currentTime,n=this._dataSourceDisplay.update(t);this._allowDataSourcesToSuspendAnimation&&this._canAnimateUpdateCallback(n);let i=this._entityView;if(l(i)){let r=this._trackedEntity;this._dataSourceDisplay.getBoundingSphere(r,!1,i.boundingSphere??GUt)===Pt.DONE&&i.update(t)}};Vr.prototype._onEntityCollectionChanged=function(e,t,n){let i=n.length;for(let r=0;r<i;r++){let o=n[r];this.trackedEntity===o&&(this.trackedEntity=void 0)}};Vr.prototype._clearTrackedObject=function(){this.trackedEntity=void 0};Vr.prototype._onDataSourceChanged=function(e){this.clockTrackedDataSource===e&&wLe(this.clock,e)};Vr.prototype._onDataSourceAdded=function(e,t){this._automaticallyTrackDataSourceClocks&&(this.clockTrackedDataSource=t);let n=t.entities.id,i=this._eventHelper.add(t.changedEvent,Vr.prototype._onDataSourceChanged,this);this._dataSourceChangedListeners[n]=i};Vr.prototype._onDataSourceRemoved=function(e,t){let n=this.clockTrackedDataSource===t,i=t.entities.id;if(this._dataSourceChangedListeners[i](),this._dataSourceChangedListeners[i]=void 0,n){let r=e.length;this._automaticallyTrackDataSourceClocks&&r>0?this.clockTrackedDataSource=e.get(r-1):this.clockTrackedDataSource=void 0}};Vr.prototype.addController=function(e){return this.scene.controllerHost.registerController(e,this.container)};Vr.prototype.removeController=function(e){return this.scene.controllerHost.unregisterController(e,this.container)};Vr.prototype.zoomTo=function(e,t){return RLe(this,e,{offset:t},!1)};Vr.prototype.flyTo=function(e,t){return RLe(this,e,t,!0)};function RLe(e,t,n,i){gse(e);let r=new Promise(o=>{e._completeZoom=function(s){o(s)}});return e._zoomPromise=r,e._zoomIsFlight=i,e._zoomOptions=n,Promise.resolve(t).then(function(o){if(e._zoomPromise===r){if(o instanceof Ms){let s;l(o.imageryProvider)?s=Promise.resolve(o.getImageryRectangle()):s=new Promise(a=>{let c=o.readyEvent.addEventListener(()=>{c(),a(o.getImageryRectangle())})}),s.then(function(a){return Lw(a,e.scene)}).then(function(a){e._zoomPromise===r&&(e._zoomTarget=a)});return}if(o instanceof Zo||o instanceof TM||o instanceof XT||o instanceof da){e._zoomTarget=o;return}if(o.isLoading&&l(o.loadingEvent)){let s=o.loadingEvent.addEventListener(function(){s(),e._zoomPromise===r&&(e._zoomTarget=o.entities.values.slice(0))});return}if(Array.isArray(o)){e._zoomTarget=o.slice(0);return}o=o.values??o,l(o.entities)&&(o=o.entities.values),Array.isArray(o)?e._zoomTarget=o.slice(0):e._zoomTarget=[o]}}),e.scene.requestRender(),r}function EM(e){e._zoomPromise=void 0,e._zoomTarget=void 0,e._zoomOptions=void 0}function gse(e){let t=e._zoomPromise;l(t)&&(EM(e),e._completeZoom(!1))}Vr.prototype._postRender=function(){WUt(this),qUt(this)};var vLe=new ue;function WUt(e){let t=e._zoomTarget;if(!l(t)||e.scene.mode===re.MORPHING)return;let n=e.scene,i=n.camera,r=e._zoomOptions??{},o;function s(f){l(r.offset)||(r.offset=new om(0,-.5,f.radius)),o={offset:r.offset,duration:r.duration,maximumHeight:r.maximumHeight,complete:function(){e._completeZoom(!0)},cancel:function(){e._completeZoom(!1)}},e._zoomIsFlight?i.flyToBoundingSphere(f,o):(i.viewBoundingSphere(f,r.offset),i.lookAtTransform(M.IDENTITY),e._completeZoom(!0)),EM(e)}if(t instanceof TM){if(l(t.boundingSphere)){s(t.boundingSphere);return}let f=t.frameChanged.addEventListener(function(d){s(d.boundingSphere),f()});return}if(t instanceof Zo||t instanceof XT){s(t.boundingSphere);return}if(t instanceof da){s(t.boundingVolume);return}if(t instanceof he){o={destination:n.ellipsoid.cartographicToCartesian(t),duration:r.duration,maximumHeight:r.maximumHeight,complete:function(){e._completeZoom(!0)},cancel:function(){e._completeZoom(!1)}},e._zoomIsFlight?i.flyTo(o):(i.setView(o),e._completeZoom(!0)),EM(e);return}let a=t,c=[];for(let f=0,d=a.length;f<d;f++){let p=e._dataSourceDisplay.getBoundingSphere(a[f],!1,vLe);if(p===Pt.PENDING)return;p!==Pt.FAILED&&c.push(ue.clone(vLe))}if(c.length===0){gse(e);return}e.trackedEntity=void 0;let u=ue.fromBoundingSpheres(c);e._zoomIsFlight?(EM(e),i.flyToBoundingSphere(u,{duration:r.duration,maximumHeight:r.maximumHeight,complete:function(){e._completeZoom(!0)},cancel:function(){e._completeZoom(!1)},offset:r.offset})):(i.viewBoundingSphere(u,r.offset),i.lookAtTransform(M.IDENTITY),EM(e),e._completeZoom(!0))}var SLe=new ue;function qUt(e){if(!e._needTrackedEntityUpdate)return;let t=e._trackedEntity,n=e.clock.currentTime,i=X.getValueOrUndefined(t.position,n);if(!l(i))return;let r=e.scene,o=e._dataSourceDisplay.getBoundingSphere(t,!1,SLe);if(o===Pt.PENDING)return;let s=r.mode;(s===re.COLUMBUS_VIEW||s===re.SCENE2D)&&(r.screenSpaceCameraController.enableTranslate=!1),(s===re.COLUMBUS_VIEW||s===re.SCENE3D)&&(r.screenSpaceCameraController.enableTilt=!1);let a=o!==Pt.FAILED?SLe:void 0;e._entityView=new Pj(t,r,r.ellipsoid),e._entityView.update(n,a),e._needTrackedEntityUpdate=!1}var k9=Vr;function dI(e,t){this._tilingScheme=e,this._maximumLevel=t,this._rootNodes=[]}var eE=new ie;function YUt(e,t,n,i){let r=i.length;for(let o=0;o<r;++o){let s=i[o];if(s.x===t&&s.y===n&&s.level===e)return!0}return!1}dI.prototype.addAvailableTileRange=function(e,t,n,i,r){let o=this._tilingScheme,s=this._rootNodes;if(e===0)for(let p=n;p<=r;++p)for(let g=t;g<=i;++g)YUt(e,g,p,s)||s.push(new uI(o,void 0,0,g,p));o.tileXYToRectangle(t,n,e,eE);let a=eE.west,c=eE.north;o.tileXYToRectangle(i,r,e,eE);let u=eE.east,f=eE.south,d=new ZUt(e,a,f,u,c);for(let p=0;p<s.length;++p){let g=s[p];_se(g.extent,d)&&QUt(this._maximumLevel,g,d)}};dI.prototype.computeMaximumLevelAtPosition=function(e){let t;for(let n=0;n<this._rootNodes.length;++n){let i=this._rootNodes[n];if(fI(i.extent,e)){t=i;break}}return l(t)?CM(void 0,t,e):-1};var XUt=[],KUt=[],$Ut=new ie,JUt=new ie;dI.prototype.computeBestAvailableLevelOverRectangle=function(e){let t=XUt;t.length=0,e.east<e.west?(t.push(ie.fromRadians(-Math.PI,e.south,e.east,e.north,$Ut)),t.push(ie.fromRadians(e.west,e.south,Math.PI,e.north,JUt))):t.push(e);let n=KUt;n.length=0;let i;for(i=0;i<this._rootNodes.length;++i)vM(n,this._rootNodes[i],t);for(i=n.length-1;i>=0;--i)if(l(n[i])&&n[i].length===0)return i;return 0};var OLe=new he;dI.prototype.isTileAvailable=function(e,t,n){let i=this._tilingScheme.tileXYToRectangle(t,n,e,eE);return ie.center(i,OLe),this.computeMaximumLevelAtPosition(OLe)>=e};dI.prototype.computeChildMaskForTile=function(e,t,n){let i=e+1;if(i>=this._maximumLevel)return 0;let r=0;return r|=this.isTileAvailable(i,2*t,2*n+1)?1:0,r|=this.isTileAvailable(i,2*t+1,2*n+1)?2:0,r|=this.isTileAvailable(i,2*t,2*n)?4:0,r|=this.isTileAvailable(i,2*t+1,2*n)?8:0,r};function uI(e,t,n,i,r){this.tilingScheme=e,this.parent=t,this.level=n,this.x=i,this.y=r,this.extent=e.tileXYToRectangle(i,r,n),this.rectangles=[],this._sw=void 0,this._se=void 0,this._nw=void 0,this._ne=void 0}Object.defineProperties(uI.prototype,{nw:{get:function(){return this._nw||(this._nw=new uI(this.tilingScheme,this,this.level+1,this.x*2,this.y*2)),this._nw}},ne:{get:function(){return this._ne||(this._ne=new uI(this.tilingScheme,this,this.level+1,this.x*2+1,this.y*2)),this._ne}},sw:{get:function(){return this._sw||(this._sw=new uI(this.tilingScheme,this,this.level+1,this.x*2,this.y*2+1)),this._sw}},se:{get:function(){return this._se||(this._se=new uI(this.tilingScheme,this,this.level+1,this.x*2+1,this.y*2+1)),this._se}}});function ZUt(e,t,n,i,r){this.level=e,this.west=t,this.south=n,this.east=i,this.north=r}function _se(e,t){let n=Math.max(e.west,t.west),i=Math.max(e.south,t.south),r=Math.min(e.east,t.east),o=Math.min(e.north,t.north);return i<o&&n<r}function QUt(e,t,n){for(;t.level<e;)if(U9(t.nw.extent,n))t=t.nw;else if(U9(t.ne.extent,n))t=t.ne;else if(U9(t.sw.extent,n))t=t.sw;else if(U9(t.se.extent,n))t=t.se;else break;if(t.rectangles.length===0||t.rectangles[t.rectangles.length-1].level<=n.level)t.rectangles.push(n);else{let i=Pr(t.rectangles,n.level,ezt);i<0&&(i=~i),t.rectangles.splice(i,0,n)}}function ezt(e,t){return e.level-t}function U9(e,t){return t.west>=e.west&&t.east<=e.east&&t.south>=e.south&&t.north<=e.north}function fI(e,t){return t.longitude>=e.west&&t.longitude<=e.east&&t.latitude>=e.south&&t.latitude<=e.north}function CM(e,t,n){let i=0,r=!1;for(;!r;){let o=t._nw&&fI(t._nw.extent,n),s=t._ne&&fI(t._ne.extent,n),a=t._sw&&fI(t._sw.extent,n),c=t._se&&fI(t._se.extent,n);if(o+s+a+c>1){o&&(i=Math.max(i,CM(t,t._nw,n))),s&&(i=Math.max(i,CM(t,t._ne,n))),a&&(i=Math.max(i,CM(t,t._sw,n))),c&&(i=Math.max(i,CM(t,t._se,n)));break}else o?t=t._nw:s?t=t._ne:a?t=t._sw:c?t=t._se:r=!0}for(;t!==e;){let o=t.rectangles;for(let s=o.length-1;s>=0&&o[s].level>i;--s){let a=o[s];fI(a,n)&&(i=a.level)}t=t.parent}return i}function vM(e,t,n){if(!t)return;let i,r=!1;for(i=0;i<n.length;++i)r=r||_se(t.extent,n[i]);if(!r)return;let o=t.rectangles;for(i=0;i<o.length;++i){let s=o[i];e[s.level]||(e[s.level]=n),e[s.level]=tzt(e[s.level],s)}vM(e,t._nw,n),vM(e,t._ne,n),vM(e,t._sw,n),vM(e,t._se,n)}function tzt(e,t){let n=[];for(let i=0;i<e.length;++i){let r=e[i];_se(r,t)?(r.west<t.west&&n.push(new ie(r.west,r.south,t.west,r.north)),r.east>t.east&&n.push(new ie(t.east,r.south,r.east,r.north)),r.south<t.south&&n.push(new ie(Math.max(t.west,r.west),r.south,Math.min(t.east,r.east),t.south)),r.north>t.north&&n.push(new ie(Math.max(t.west,r.west),t.north,Math.min(t.east,r.east),r.north))):n.push(r)}return n}var _0=dI;var nzt=15;function MLe(e){this.ellipsoid=e.ellipsoid??ee.default,this.credit=void 0,this.tilingScheme=void 0,this.height=void 0,this.width=void 0,this.encoding=void 0,this.lodCount=void 0,this.hasAvailability=!1,this.tilesAvailable=void 0,this.tilesAvailabilityLoaded=void 0,this.levelZeroMaximumGeometricError=void 0,this.terrainDataStructure=void 0}MLe.prototype.build=function(e){e._credit=this.credit,e._tilingScheme=this.tilingScheme,e._height=this.height,e._width=this.width,e._encoding=this.encoding,e._lodCount=this.lodCount,e._hasAvailability=this.hasAvailability,e._tilesAvailable=this.tilesAvailable,e._tilesAvailabilityLoaded=this.tilesAvailabilityLoaded,e._levelZeroMaximumGeometricError=this.levelZeroMaximumGeometricError,e._terrainDataStructure=this.terrainDataStructure};function izt(e,t){let n=t.copyrightText;l(n)&&(e.credit=new It(n));let i=t.spatialReference,r=i.latestWkid??i.wkid,o=t.extent,s={ellipsoid:e.ellipsoid};if(r===4326)s.rectangle=ie.fromDegrees(o.xmin,o.ymin,o.xmax,o.ymax),e.tilingScheme=new rr(s);else if(r===3857){let u=Math.PI*e.ellipsoid.maximumRadius;t.extent.xmax>u&&(t.extent.xmax=u),t.extent.ymax>u&&(t.extent.ymax=u),t.extent.xmin<-u&&(t.extent.xmin=-u),t.extent.ymin<-u&&(t.extent.ymin=-u),s.rectangleSouthwestInMeters=new U(o.xmin,o.ymin),s.rectangleNortheastInMeters=new U(o.xmax,o.ymax),e.tilingScheme=new Bo(s)}else throw new oe("Invalid spatial reference");let a=t.tileInfo;if(!l(a))throw new oe("tileInfo is required");e.width=a.rows+1,e.height=a.cols+1,e.encoding=a.format==="LERC"?pm.LERC:pm.NONE,e.lodCount=a.lods.length-1,(e.hasAvailability=t.capabilities.indexOf("Tilemap")!==-1)&&(e.tilesAvailable=new _0(e.tilingScheme,e.lodCount),e.tilesAvailable.addAvailableTileRange(0,0,0,e.tilingScheme.getNumberOfXTilesAtLevel(0),e.tilingScheme.getNumberOfYTilesAtLevel(0)),e.tilesAvailabilityLoaded=new _0(e.tilingScheme,e.lodCount)),e.levelZeroMaximumGeometricError=Xr.getEstimatedLevelZeroGeometricErrorForAHeightmap(e.tilingScheme.ellipsoid,e.width,e.tilingScheme.getNumberOfXTilesAtLevel(0)),t.bandCount>1&&console.log("ArcGISTiledElevationTerrainProvider: Terrain data has more than 1 band. Using the first one."),l(t.minValues)&&l(t.maxValues)?e.terrainDataStructure={elementMultiplier:1,lowestEncodedHeight:t.minValues[0],highestEncodedHeight:t.maxValues[0]}:e.terrainDataStructure={elementMultiplier:1}}async function rzt(e,t,n){try{let i=await t.fetchJson();izt(e,i)}catch(i){let r=`An error occurred while accessing ${t}.`;throw no.reportError(void 0,n,l(n)?n._errorEvent:void 0,r),i}}function ZA(){this._resource=void 0,this._credit=void 0,this._tilingScheme=void 0,this._levelZeroMaximumGeometricError=void 0,this._maxLevel=void 0,this._terrainDataStructure=void 0,this._width=void 0,this._height=void 0,this._encoding=void 0,this._lodCount=void 0,this._hasAvailability=!1,this._tilesAvailable=void 0,this._tilesAvailabilityLoaded=void 0,this._availableCache={},this._errorEvent=new be}Object.defineProperties(ZA.prototype,{errorEvent:{get:function(){return this._errorEvent}},credit:{get:function(){return this._credit}},tilingScheme:{get:function(){return this._tilingScheme}},hasWaterMask:{get:function(){return!1}},hasVertexNormals:{get:function(){return!1}},availability:{get:function(){return this._tilesAvailable}}});ZA.fromUrl=async function(e,t){t=t??H.EMPTY_OBJECT,e=await Promise.resolve(e);let n=De.createIfNeeded(e);n.appendForwardSlash(),l(t.token)&&(n=n.getDerivedResource({queryParameters:{token:t.token}}));let i=n.getDerivedResource({queryParameters:{f:"pjson"}}),r=new MLe(t);await rzt(r,i);let o=new ZA(t);return r.build(o),o._resource=n,o};ZA.prototype.requestTileGeometry=function(e,t,n,i){let r=this._resource.getDerivedResource({url:`tile/${n}/${t}/${e}`,request:i}),o=this._hasAvailability,s=Promise.resolve(!0),a;if(o&&!l(yse(this,n+1,e*2,t*2))){let d=NLe(this,n+1,e*2,t*2);s=d.promise,a=d.request}let c=r.fetchArrayBuffer();if(!l(c)||!l(s))return;let u=this,f=this._tilesAvailable;return Promise.all([c,s]).then(function(d){return new ll({buffer:d[0],width:u._width,height:u._height,childTileMask:o?f.computeChildMaskForTile(n,e,t):nzt,structure:u._terrainDataStructure,encoding:u._encoding})}).catch(async function(d){if(l(a)&&a.state===wi.CANCELLED){i.cancel();try{await i.deferred?.promise}catch{}return i.state=wi.CANCELLED,Promise.reject(d)}return Promise.reject(d)})};function yse(e,t,n,i){if(!e._hasAvailability)return;let r=e._tilesAvailabilityLoaded,o=e._tilesAvailable;if(t>e._lodCount)return!1;if(o.isTileAvailable(t,n,i))return!0;if(r.isTileAvailable(t,n,i))return!1}ZA.prototype.getLevelMaximumGeometricError=function(e){return this._levelZeroMaximumGeometricError/(1<<e)};ZA.prototype.getTileDataAvailable=function(e,t,n){if(!this._hasAvailability)return;let i=yse(this,n,e,t);if(l(i))return i;NLe(this,n,e,t)};ZA.prototype.loadTileDataAvailability=function(e,t,n){};function ozt(e,t,n,i){let r=t-1,o=n-1,s=i[e.y*t+e.x],a=[],c={startX:e.x,startY:e.y,endX:0,endY:0},u=new U(e.x+1,e.y+1),f=!1,d=!1;for(;!(f&&d);){let p=u.x,g=d?u.y+1:u.y;if(!f){for(let m=e.y;m<g;++m)if(i[m*t+u.x]!==s){f=!0;break}f?(a.push(new U(u.x,e.y)),--u.x,--p,c.endX=u.x):u.x===r?(c.endX=u.x,f=!0):++u.x}if(!d){let m=u.y*t;for(let y=e.x;y<=p;++y)if(i[m+y]!==s){d=!0;break}d?(a.push(new U(e.x,u.y)),--u.y,c.endY=u.y):u.y===o?(c.endY=u.y,d=!0):++u.y}}return{endingIndices:a,range:c,value:s}}function szt(e,t,n,i,r){let o=[];if(r.every(function(c){return c===r[0]}))return r[0]===1&&o.push({startX:e,startY:t,endX:e+n-1,endY:t+i-1}),o;let a=[new U(0,0)];for(;a.length>0;){let c=a.pop(),u=ozt(c,n,i,r);if(u.value===1){let d=u.range;d.startX+=e,d.endX+=e,d.startY+=t,d.endY+=t,o.push(d)}let f=u.endingIndices;f.length>0&&(a=a.concat(f))}return o}function NLe(e,t,n,i){if(!e._hasAvailability)return{};let r=Math.floor(n/128)*128,o=Math.floor(i/128)*128,s=Math.min(1<<t,128),a=`tilemap/${t}/${o}/${r}/${s}/${s}`,c=e._availableCache;if(l(c[a]))return c[a];let u=new Oo({throttle:!1,throttleByServer:!0,type:oa.TERRAIN}),d=e._resource.getDerivedResource({url:a,request:u}).fetchJson();return l(d)?(d=d.then(function(p){let g=szt(r,o,s,s,p.data);e._tilesAvailabilityLoaded.addAvailableTileRange(t,r,o,r+s,o+s);let m=e._tilesAvailable;for(let y=0;y<g.length;++y){let A=g[y];m.addAvailableTileRange(t,A.startX,A.startY,A.endX,A.endY)}return yse(e,t,n,i)}),c[a]={promise:d,request:u},d=d.finally(function(p){return delete c[a],p}),{promise:d,request:u}):{}}var LLe=ZA;var FLe="https://dev.virtualearth.net/REST/v1/Locations";function Ase(e){e=e??H.EMPTY_OBJECT;let t=e.key;this._key=t;let n={key:t};l(e.culture)&&(n.culture=e.culture),this._resource=new De({url:FLe,queryParameters:n}),this._credit=new It('<img src="http://dev.virtualearth.net/Branding/logo_powered_by.png"/>',!1)}Object.defineProperties(Ase.prototype,{url:{get:function(){return FLe}},key:{get:function(){return this._key}},credit:{get:function(){return this._credit}}});Ase.prototype.geocode=async function(e){return this._resource.getDerivedResource({queryParameters:{query:e}}).fetchJsonp("jsonp").then(function(n){return n.resourceSets.length===0?[]:n.resourceSets[0].resources.map(function(r){let o=r.bbox,s=o[0],a=o[1],c=o[2],u=o[3];return{displayName:r.name,destination:ie.fromDegrees(a,s,u,c)}})})};var BLe=Ase;function bse(){}Object.defineProperties(bse.prototype,{credit:{get:function(){}}});bse.prototype.geocode=function(e){let t=e.match(/[^\s,\n]+/g);if(t.length===2||t.length===3){let n=+t[0],i=+t[1],r=t.length===3?+t[2]:300;if(isNaN(n)&&isNaN(i)){let o=/^(\d+.?\d*)([nsew])/i;for(let s=0;s<t.length;++s){let a=t[s].match(o);o.test(t[s])&&a.length===3&&(/^[ns]/i.test(a[2])?i=/^[n]/i.test(a[2])?+a[1]:-a[1]:/^[ew]/i.test(a[2])&&(n=/^[e]/i.test(a[2])?+a[1]:-a[1]))}}if(!isNaN(n)&&!isNaN(i)&&!isNaN(r)){let o={displayName:e,destination:h.fromDegrees(n,i,r)};return Promise.resolve([o])}}return Promise.resolve([])};var kLe=bse;var azt=new se,ULe=new h,hI=new h;function czt(e){let t=e.points,n=e.times;if(t.length<3){let i=n[0],r=1/(n[1]-i),o=t[0],s=t[1];return function(a,c){l(c)||(c=new h);let u=(a-i)*r;return h.lerp(o,s,u,c)}}return function(i,r){l(r)||(r=new h);let o=e._lastTimeIndex=e.findTimeInterval(i,e._lastTimeIndex),s=(i-n[o])/(n[o+1]-n[o]),a=azt;a.z=s,a.y=s*s,a.x=a.y*s,a.w=1;let c,u,f,d,p;return o===0?(c=t[0],u=t[1],f=e.firstTangent,d=h.subtract(t[2],c,ULe),h.multiplyByScalar(d,.5,d),p=M.multiplyByVector(ux.hermiteCoefficientMatrix,a,a)):o===t.length-2?(c=t[o],u=t[o+1],d=e.lastTangent,f=h.subtract(u,t[o-1],ULe),h.multiplyByScalar(f,.5,f),p=M.multiplyByVector(ux.hermiteCoefficientMatrix,a,a)):(c=t[o-1],u=t[o],f=t[o+1],d=t[o+2],p=M.multiplyByVector(QA.catmullRomCoefficientMatrix,a,a)),r=h.multiplyByScalar(c,p.x,r),h.multiplyByScalar(u,p.y,hI),h.add(r,hI,r),h.multiplyByScalar(f,p.z,hI),h.add(r,hI,r),h.multiplyByScalar(d,p.w,hI),h.add(r,hI,r)}}var lzt=new h,uzt=new h;function QA(e){e=e??H.EMPTY_OBJECT;let t=e.points,n=e.times,i=e.firstTangent,r=e.lastTangent;if(t.length>2&&(l(i)||(i=lzt,h.multiplyByScalar(t[1],2,i),h.subtract(i,t[2],i),h.subtract(i,t[0],i),h.multiplyByScalar(i,.5,i)),!l(r))){let o=t.length-1;r=uzt,h.multiplyByScalar(t[o-1],2,r),h.subtract(t[o],r,r),h.add(r,t[o-2],r),h.multiplyByScalar(r,.5,r)}this._times=n,this._points=t,this._firstTangent=h.clone(i),this._lastTangent=h.clone(r),this._evaluateFunction=czt(this),this._lastTimeIndex=0}Object.defineProperties(QA.prototype,{times:{get:function(){return this._times}},points:{get:function(){return this._points}},firstTangent:{get:function(){return this._firstTangent}},lastTangent:{get:function(){return this._lastTangent}}});QA.catmullRomCoefficientMatrix=new M(-.5,1,-.5,0,1.5,-2.5,0,1,-1.5,2,.5,0,.5,-.5,0,0);QA.prototype.findTimeInterval=Or.prototype.findTimeInterval;QA.prototype.wrapTime=Or.prototype.wrapTime;QA.prototype.clampTime=Or.prototype.clampTime;QA.prototype.evaluate=function(e,t){return this._evaluateFunction(e,t)};var zLe=QA;var xse={},fzt={positions:void 0,normals:void 0,indices:void 0,edgeIndicesWest:void 0,edgeIndicesSouth:void 0,edgeIndicesEast:void 0,edgeIndicesNorth:void 0},dzt=new he,hzt=new h,mzt=new M,pzt=new M,gzt=new M,_zt=new h,yzt=new h,Azt=new h,bzt=new h,xzt=new he,Tzt=new U,SM=new h,Ezt=new U,Czt=new h,vzt=new h,z9=function(e,t){return e-t};xse.createMesh=async function(e){e=e??H.EMPTY_OBJECT;let{exaggeration:t=1,exaggerationRelativeHeight:n=0,hasVertexNormals:i,hasWebMercatorT:r,gltf:o,minimumHeight:s,maximumHeight:a,skirtHeight:c}=e,f=t!==1,d=ue.clone(e.boundingSphere,new ue),p=en.clone(e.orientedBoundingBox,new en),g=h.clone(e.horizonOcclusionPoint,new h),m=ee.clone(e.ellipsoid,new ee),y=ie.clone(e.rectangle,new ie);await(o.extensionsRequired!==void 0&&o.extensionsRequired.indexOf("EXT_meshopt_compression")!==-1?ly.ready:Promise.resolve(void 0));let x=y.west,T=y.south,E=y.north,v=y.width,S=y.height,I=ie.center(y,dzt);I.height=.5*(s+a);let R=he.toCartesian(I,m,hzt),O=At.eastNorthUpToFixedFrame(R,m,mzt),L=M.inverseTransformation(O,pzt),_=M.unpack(o.nodes[0].matrix,0,gzt);_=M.multiply(qi.Y_UP_TO_Z_UP,_,_);let C=rVt(o,i,fzt),w=Xr.getSkirtVertexCount(C.edgeIndicesWest,C.edgeIndicesSouth,C.edgeIndicesEast,C.edgeIndicesNorth),D=C.positions,N=C.normals,F=C.indices,V=D.length/3,B=V+w,j=F.length,k=Xr.getSkirtIndexCountWithFilledCorners(w),G=B<=65535?Uint16Array:Uint32Array,q=new G(j+k);q.set(F);let Q=new G(C.edgeIndicesWest),W=new G(C.edgeIndicesSouth),J=new G(C.edgeIndicesEast),Z=new G(C.edgeIndicesNorth),ae=new G(Q).sort(),Ae=new G(W).sort(),fe=new G(J).sort(),xe=new G(Z).sort(),ge=Ti.geodeticLatitudeToMercatorAngle(T),ve=1/(Ti.geodeticLatitudeToMercatorAngle(E)-ge),Re=h.fromElements(Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY,_zt),Qe=h.fromElements(Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY,yzt),He=new Ro(d.center,void 0,void 0,void 0,void 0,i,r,f,t,n),Ye=He.stride,Ke=new Float32Array(B*Ye),Pe=0;for(let st=0;st<V;st++){let vt=h.unpack(D,st*3,Azt),jt=M.multiplyByPoint(_,vt,bzt),lt=he.fromCartesian(jt,m,xzt),{longitude:mt,latitude:ft,height:Yt}=lt,rt=(mt-x)/v,ht=(ft-T)/S;rt=P.clamp(rt,0,1),ht=P.clamp(ht,0,1),Pr(ae,st,z9)>=0?rt=0:Pr(fe,st,z9)>=0&&(rt=1),Pr(Ae,st,z9)>=0?ht=0:Pr(xe,st,z9)>=0&&(ht=1);let Li=U.fromElements(rt,ht,Tzt),Yn;if(i){let ui=h.unpack(N,st*3,SM);ui=M.multiplyByPointAsVector(_,ui,SM),ui=h.normalize(ui,SM),Yn=cn.octEncode(ui,Ezt)}let yi;r&&(yi=(Ti.geodeticLatitudeToMercatorAngle(ft)-ge)*ve);let zi;f&&(zi=m.geodeticSurfaceNormal(jt,Czt)),Pe=He.encode(Ke,Pe,jt,Li,Yt,Yn,yi,zi);let Si=M.multiplyByPoint(L,jt,vzt);Re=h.minimumByComponent(Si,Re,Re),Qe=h.maximumByComponent(Si,Qe,Qe)}let qe=new Ic(h.clone(He.center,new h),Ke,q,j,V,s,a,y,ue.clone(d,new ue),h.clone(g,new h),Ye,en.clone(p,new en),He,Q,W,J,Z);return YLe(qe,y,m,Re,Qe,O,L,c),Promise.resolve(qe)};var Szt=new U,wzt=new U,Izt=new Array(6),Pzt=new U,Dzt=new U,Rzt=new U,Ozt=new h,Mzt=new h,Nzt=new h,Lzt=new he,Fzt=new h,Bzt=new he,kzt=new he,VLe=new h,Uzt=new h,zzt=new h,Vzt=new h,jzt=new h,Hzt=new h,Gzt=new h,Wzt=new h,qzt=new M,Yzt=new M,jLe=new U,Xzt=new U,Kzt=new h,$zt=new ue,Jzt=new en,Zzt=new sd,HLe=new h,GLe=new U,Qzt=new U,WLe=new h,eVt=new h;function tVt(e){let t=e.meshes[0].primitives[0],n=e.accessors[t.attributes.POSITION],i=e.bufferViews[n.bufferView],r=n.count,o=i.extensions?i.extensions.EXT_meshopt_compression:void 0;if(o===void 0){let g=e.buffers[i.buffer].extras._pipeline.source;return new Float32Array(g.buffer,g.byteOffset+(i.byteOffset??0)+(n.byteOffset??0),r*3)}let s=e.buffers[o.buffer].extras._pipeline.source,a=new Uint8Array(s.buffer,s.byteOffset+(o.byteOffset??0)+(n.byteOffset??0),o.byteLength),c=o.byteStride,u=c===4?Uint8Array:Uint16Array,f=new u(r*4);ly.decodeVertexBuffer(new Uint8Array(f.buffer),r,c,a);let d=(1<<f.BYTES_PER_ELEMENT*8)-1,p=new Float32Array(r*3);for(let g=0;g<r;g++)p[g*3+0]=f[g*4+0]/d,p[g*3+1]=f[g*4+1]/d,p[g*3+2]=f[g*4+2]/d;return p}function nVt(e){let t=e.meshes[0].primitives[0],n=e.accessors[t.attributes.NORMAL],i=e.bufferViews[n.bufferView],r=n.count,o=i.extensions?i.extensions.EXT_meshopt_compression:void 0;if(o===void 0){let d=e.buffers[i.buffer].extras._pipeline.source;return new Float32Array(d.buffer,d.byteOffset+(i.byteOffset??0)+(n.byteOffset??0),r*3)}let s=e.buffers[o.buffer].extras._pipeline.source,a=new Uint8Array(s.buffer,s.byteOffset+(o.byteOffset??0)+(n.byteOffset??0),o.byteLength),c=o.byteStride,u=new Int8Array(r*c);ly.decodeVertexBuffer(new Uint8Array(u.buffer),r,c,a);let f=new Float32Array(r*3);for(let d=0;d<r;d++){let p=Math.max(u[d*4+0]/127,-1),g=Math.max(u[d*4+1]/127,-1),m=1-(Math.abs(p)+Math.abs(g));if(m<0){let A=p,b=g;p=(1-Math.abs(b))*P.signNotZero(A),g=(1-Math.abs(A))*P.signNotZero(b)}let y=SM;y.x=p,y.y=g,y.z=m,y=h.normalize(y,SM),f[d*3+0]=y.x,f[d*3+1]=y.y,f[d*3+2]=y.z}return f}function iVt(e){let t=e.meshes[0].primitives[0],n=e.accessors[t.indices],i=e.bufferViews[n.bufferView],r=n.count,o=n.componentType===Y.UNSIGNED_SHORT?Uint16Array:Uint32Array,s=i.extensions?i.extensions.EXT_meshopt_compression:void 0;if(s===void 0){let f=e.buffers[i.buffer].extras._pipeline.source;return new o(f.buffer,f.byteOffset+(i.byteOffset??0)+(n.byteOffset??0),r)}let a=e.buffers[s.buffer].extras._pipeline.source,c=new Uint8Array(a.buffer,a.byteOffset+(s.byteOffset??0)+(n.byteOffset??0),s.byteLength),u=new o(r);return ly.decodeIndexBuffer(new Uint8Array(u.buffer),r,s.byteStride,c),u}function V9(e,t){let n=e.meshes[0].primitives[0],i=e.accessors[n.extensions.CESIUM_tile_edges[t]],r=e.bufferViews[i.bufferView],o=i.count,s=i.componentType===Y.UNSIGNED_SHORT?Uint16Array:Uint32Array,a=r.extensions?r.extensions.EXT_meshopt_compression:void 0;if(a===void 0){let p=e.buffers[r.buffer].extras._pipeline.source;return new s(p.buffer,p.byteOffset+(r.byteOffset??0)+(i.byteOffset??0),o)}let c=e.buffers[a.buffer].extras._pipeline.source,u=new Uint8Array(c.buffer,c.byteOffset+(a.byteOffset??0)+(i.byteOffset??0),a.byteLength),f=new s(o),d=a.byteStride;return ly.decodeIndexSequence(new Uint8Array(f.buffer),o,d,u),f}function rVt(e,t,n){return n.positions=tVt(e),n.normals=t?nVt(e):void 0,n.indices=iVt(e),n.edgeIndicesWest=V9(e,"left"),n.edgeIndicesSouth=V9(e,"bottom"),n.edgeIndicesEast=V9(e,"right"),n.edgeIndicesNorth=V9(e,"top"),n}xse.upsampleMesh=function(e){e=e??H.EMPTY_OBJECT;let{isEastChild:t,isNorthChild:n,parentMinimumHeight:i,parentMaximumHeight:r,skirtHeight:o}=e,s=e.parentIndexCountWithoutSkirts,a=e.parentIndices,c=e.parentVertexCountWithoutSkirts,u=e.parentVertices,f=Ro.clone(e.parentEncoding,new Ro),d=f.hasVertexNormals,p=f.hasWebMercatorT,g=f.exaggeration,m=f.exaggerationRelativeHeight,A=g!==1,b=ie.clone(e.rectangle,new ie),x=ee.clone(e.ellipsoid),T=[],E=[],v=[],S=[],I=[],R=[],O=[],L=[];_Vt(t,n,s,a,c,u,f,S,I,R,O,L,T,v,E);let _=ie.center(b,Lzt);_.height=.5*(i+r);let C=he.toCartesian(_,x,Fzt),w=T.length,D=new Ro(C,void 0,void 0,void 0,void 0,d,p,A,g,m),N=D.stride,F=Xr.getSkirtVertexCount(I,R,O,L),V=w+F,B=S.length,j=Xr.getSkirtIndexCountWithFilledCorners(F),k=B+j,G=V<=65535?Uint16Array:Uint32Array,q=new G(k);q.set(S);let Q=new G(I),W=new G(R),J=new G(O),Z=new G(L),ae=new Float32Array(V*N),Ae=0,fe=At.eastNorthUpToFixedFrame(C,x,qzt),xe=M.inverseTransformation(fe,Yzt),ge=b.west,we=b.east,ve=b.south,Re=b.north,Qe=Ti.geodeticLatitudeToMercatorAngle(ve),Ye=1/(Ti.geodeticLatitudeToMercatorAngle(Re)-Qe),Ke=Number.POSITIVE_INFINITY,Pe=Number.NEGATIVE_INFINITY,qe=h.fromElements(Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY,Gzt),st=h.fromElements(Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY,Wzt);for(let Yt=0;Yt<w;Yt++){let rt=T[Yt],ht=a[rt*3+0],Li=a[rt*3+1],Yn=a[rt*3+2],yi=Xzt;yi.x=E[Yt*2+0],yi.y=E[Yt*2+1];let zi=yi.x,Si=yi.y,ui=v[Yt*2+0],Ai=v[Yt*2+1],zn=1-ui-Ai,tn=f.decodeHeight(u,ht),Hn=f.decodeHeight(u,Li),Ki=f.decodeHeight(u,Yn),wr=tn*ui+Hn*Ai+Ki*zn;Ke=Math.min(wr,Ke),Pe=Math.max(wr,Pe);let so=P.lerp(ge,we,zi),Ts=P.lerp(ve,Re,Si),zs=he.fromRadians(so,Ts,wr,kzt),$r=he.toCartesian(zs,x,Uzt),pi=M.multiplyByPoint(xe,$r,Vzt);qe=h.minimumByComponent(pi,qe,qe),st=h.maximumByComponent(pi,st,st);let ao;if(d){let Fn=f.decodeNormal(u,ht,Ozt),Vi=f.decodeNormal(u,Li,Mzt),Fi=f.decodeNormal(u,Yn,Nzt),Ir=h.fromElements(Fn.x*ui+Vi.x*Ai+Fi.x*zn,Fn.y*ui+Vi.y*Ai+Fi.y*zn,Fn.z*ui+Vi.z*Ai+Fi.z*zn,HLe);Ir=h.normalize(Ir,HLe),ao=cn.octEncode(Ir,Qzt)}let nr;p&&(nr=(Ti.geodeticLatitudeToMercatorAngle(Ts)-Qe)*Ye);let jo;A&&(jo=x.geodeticSurfaceNormal($r,eVt)),Ae=D.encode(ae,Ae,$r,yi,wr,ao,nr,jo)}let vt=en.fromRectangle(b,Ke,Pe,x,Jzt),jt=ue.fromVertices(ae,D.center,N,$zt),mt=new Op(x).computeHorizonCullingPointFromVerticesPossiblyUnderEllipsoid(D.center,ae,N,D.center,Ke,Kzt),ft=new Ic(h.clone(D.center,new h),ae,q,B,w,Ke,Pe,b,ue.clone(jt),h.clone(mt),N,en.clone(vt),D,Q,W,J,Z);return YLe(ft,b,x,qe,st,fe,xe,o),ft};function YLe(e,t,n,i,r,o,s,a){let{encoding:c}=e,u=c.stride,f=e.vertices,{hasVertexNormals:d,hasWebMercatorT:p,exaggeration:g,exaggerationRelativeHeight:m}=c,A=g!==1,b=e.vertexCountWithoutSkirts,x=b*u,T=f.length/u,E=T-b,v=e.indices,S=e.indexCountWithoutSkirts,I=e.westIndicesSouthToNorth,R=e.southIndicesEastToWest,O=e.eastIndicesNorthToSouth,L=e.northIndicesWestToEast;Xr.addSkirtIndicesWithFilledCorners(I,R,O,L,b,v,S);let _=0,C=_+I.length,w=C+R.length,D=w+O.length,N=[I,R,O,L],F=[_,C,w,D],V=[-1,0,1,0],B=[0,-1,0,1],j=h.clone(i,jzt),k=h.clone(r,Hzt),G=e.maximumHeight,q=e.minimumHeight-a;for(let J=0;J<E;J++){let Z;for(Z=0;Z<3&&!(J<F[Z+1]);Z++);let ae=N[Z][J-F[Z]],Ae=c.decodeTextureCoordinates(f,ae,jLe),fe=1e-4,xe=Ae.x+V[Z]*fe,ge=Ae.y+B[Z]*fe,we=P.lerp(t.west,t.east,xe),ve=P.clamp(P.lerp(t.south,t.north,ge),-P.PI_OVER_TWO,+P.PI_OVER_TWO),Qe=c.decodeHeight(f,ae)-a,He=he.fromRadians(we,ve,Qe,Bzt),Ye=he.toCartesian(He,n,VLe),Ke;d&&(Ke=c.getOctEncodedNormal(f,ae,GLe));let Pe;p&&(Pe=c.decodeWebMercatorT(f,ae));let qe;A&&(qe=n.geodeticSurfaceNormal(Ye,WLe)),x=c.encode(f,x,Ye,Ae,Qe,Ke,Pe,qe);let st=M.multiplyByPoint(s,Ye,zzt);h.minimumByComponent(st,j,j),h.maximumByComponent(st,k,k)}let Q=sd.fromCorners(j,k,Zzt),W=new Ro(c.center,Q,q,G,o,c.hasVertexNormals,c.hasWebMercatorT,A,g,m);if(c.quantization!==W.quantization){let J=W,Z=J.stride,ae=new Float32Array(T*Z),Ae=0;for(let fe=0;fe<T;fe++)Ae=J.encode(ae,Ae,c.decodePosition(f,fe,VLe),c.decodeTextureCoordinates(f,fe,jLe),c.decodeHeight(f,fe),c.hasVertexNormals?c.getOctEncodedNormal(f,fe,GLe):void 0,c.hasWebMercatorT?c.decodeWebMercatorT(f,fe):void 0,c.hasGeodeticSurfaceNormals?c.decodeGeodeticSurfaceNormal(f,fe,WLe):void 0);e.vertices=ae,e.stride=Z,e.encoding=J}return e}var Tse=0,oVt=1,Ese=2,Cse=3,sVt=4,aVt=new h,cVt=[new h,new h,new h,new h,new h,new h],lVt=[new U,new U,new U,new U,new U,new U],uVt=[new h,new h,new h,new h,new h,new h],fVt=[new U,new U,new U,new U,new U,new U];function qLe(e,t,n,i){switch(n){case Tse:return P.sign(i.x-e.x);case Ese:return P.sign(t.x-i.x);case Cse:return P.sign(i.y-e.y);default:return P.sign(t.y-i.y)}}function dVt(e,t,n,i,r,o){let s,a,c;switch(n){case Tse:s=(e.x-i.x)/(r.x-i.x),a=e.x,c=i.y+(r.y-i.y)*s;break;case Ese:s=(t.x-i.x)/(r.x-i.x),a=t.x,c=i.y+(r.y-i.y)*s;break;case Cse:s=(e.y-i.y)/(r.y-i.y),a=i.x+(r.x-i.x)*s,c=e.y;break;default:s=(t.y-i.y)/(r.y-i.y),a=i.x+(r.x-i.x)*s,c=t.y;break}return h.fromElements(a,c,s,o)}var hVt={length:0,coordinates:[new U,new U,new U,new U,new U,new U],barycentricCoordinates:[new h,new h,new h,new h,new h,new h]};function mVt(e,t,n,i,r,o,s,a){let c,u=lVt,f=cVt,d=3,p=fVt;U.clone(r,p[0]),U.clone(o,p[1]),U.clone(s,p[2]);let g=uVt;h.fromElements(1,0,0,g[0]),h.fromElements(0,1,0,g[1]),h.fromElements(0,0,1,g[2]);for(let m=0;m<t;m++){let y=(e+m)%sVt,A=u,b=f;u=p,f=g,c=d,p=A,g=b,d=0;let x=c-1,T=u[x],E=f[x],v=qLe(n,i,y,T);for(let S=0;S<c;S++){let I=u[S],R=f[S],O=qLe(n,i,y,I);if(v*O===-1){let L=dVt(n,i,y,T,I,aVt),{x:_,y:C,z:w}=L,D=1-w,N=E.x*D+R.x*w,F=E.y*D+R.y*w,V=E.z*D+R.z*w;U.fromElements(_,C,p[d]),h.fromElements(N,F,V,g[d]),d++}O>=0&&(U.clone(I,p[d]),h.clone(R,g[d]),d++),T=I,E=R,v=O}if(d===0)break}a.length=d;for(let m=0;m<d;m++)U.clone(p[m],a.coordinates[m]),h.clone(g[m],a.barycentricCoordinates[m]);return a}function pVt(e,t,n,i,r,o,s,a){return mVt(e?t?Cse:Tse:t?Ese:oVt,2,n,i,r,o,s,a)}var gVt=[[],[0],[1],[0,1],[2],[0,2],[1,2],[0,1,2]];function _Vt(e,t,n,i,r,o,s,a,c,u,f,d,p,g,m){let y={},A=e?.5:0,b=e?1:.5,x=t?.5:0,T=t?1:.5,E=Szt;E.x=A,E.y=x;let v=wzt;v.x=b,v.y=T;let S=0;for(let I=0;I<n;I+=3){let R=i[I+0],O=i[I+1],L=i[I+2],_=s.decodeTextureCoordinates(o,R,Pzt),C=s.decodeTextureCoordinates(o,O,Dzt),w=s.decodeTextureCoordinates(o,L,Rzt),D=pVt(e,t,E,v,_,C,w,hVt),N=D.length;if(N<3)continue;let F=Izt;for(let k=0;k<N;k++){let G=D.barycentricCoordinates[k],q=G.x,Q=G.y,W=G.z,J=Math.ceil(q)|Math.ceil(Q)<<1|Math.ceil(W)<<2,Z=gVt[J],ae,Ae=!1;if(Z.length===1){let fe=Z[0],ge=i[I+fe];ae=y[ge],ae===void 0&&(Ae=!0,ae=S++,y[ge]=ae)}else if(Z.length===2){let fe=Z[0],xe=Z[1],ge=i[I+fe],we=i[I+xe],ve=D.barycentricCoordinates[(k+N-1)%N],Re=Math.ceil(ve.x)|Math.ceil(ve.y)<<1|Math.ceil(ve.z)<<2,Qe=J===Re,He=Math.min(ge,we),Ye=Math.max(ge,we),Ke=r+2*(He*r+Ye),Pe=Ke+0,qe=Ke+1,st=y[Pe],vt=y[qe],jt=!Qe==(st===void 0||vt===void 0);if(ae=jt?st:vt,ae===void 0){Ae=!0,ae=S++;let lt=jt?Pe:qe;y[lt]=ae}}else Ae=!0,ae=S++;if(F[k]=ae,Ae){let fe=I/3;p.push(fe);let xe=D.coordinates[k],ge=(xe.x-A)/(b-A),we=(xe.y-x)/(T-x);m.push(ge,we),g.push(q,Q),ge===0?c.push(ae):ge===1&&f.push(ae),we===0?u.push(ae):we===1&&d.push(ae)}}let V=F[0],B=F[1],j=F[2];a.push(V,B,j);for(let k=3;k<N;k++)B=j,j=F[k],a.push(V,B,j)}c.sort(function(I,R){return m[I*2+1]-m[R*2+1]}),u.sort(function(I,R){return m[R*2+0]-m[I*2+0]}),f.sort(function(I,R){return m[R*2+1]-m[I*2+1]}),d.sort(function(I,R){return m[I*2+0]-m[R*2+0]})}var wM=xse;var j9={};j9.clipTriangleAtAxisAlignedThreshold=function(e,t,n,i,r,o){l(o)?o.length=0:o=[];let s,a,c;t?(s=n<e,a=i<e,c=r<e):(s=n>e,a=i>e,c=r>e);let u=s+a+c,f,d,p,g,m,y;return u===1?s?(f=(e-n)/(i-n),d=(e-n)/(r-n),o.push(1),o.push(2),d!==1&&(o.push(-1),o.push(0),o.push(2),o.push(d)),f!==1&&(o.push(-1),o.push(0),o.push(1),o.push(f))):a?(p=(e-i)/(r-i),g=(e-i)/(n-i),o.push(2),o.push(0),g!==1&&(o.push(-1),o.push(1),o.push(0),o.push(g)),p!==1&&(o.push(-1),o.push(1),o.push(2),o.push(p))):c&&(m=(e-r)/(n-r),y=(e-r)/(i-r),o.push(0),o.push(1),y!==1&&(o.push(-1),o.push(2),o.push(1),o.push(y)),m!==1&&(o.push(-1),o.push(2),o.push(0),o.push(m))):u===2?!s&&n!==e?(g=(e-i)/(n-i),m=(e-r)/(n-r),o.push(0),o.push(-1),o.push(1),o.push(0),o.push(g),o.push(-1),o.push(2),o.push(0),o.push(m)):!a&&i!==e?(y=(e-r)/(i-r),f=(e-n)/(i-n),o.push(1),o.push(-1),o.push(2),o.push(1),o.push(y),o.push(-1),o.push(0),o.push(1),o.push(f)):!c&&r!==e&&(d=(e-n)/(r-n),p=(e-i)/(r-i),o.push(2),o.push(-1),o.push(0),o.push(2),o.push(d),o.push(-1),o.push(1),o.push(2),o.push(p)):u!==3&&(o.push(0),o.push(1),o.push(2)),o};j9.computeBarycentricCoordinates=function(e,t,n,i,r,o,s,a,c){let u=n-s,f=s-r,d=o-a,p=i-a,g=1/(d*u+f*p),m=t-a,y=e-s,A=(d*y+f*m)*g,b=(-p*y+u*m)*g,x=1-A-b;return l(c)?(c.x=A,c.y=b,c.z=x,c):new h(A,b,x)};j9.computeLineSegmentLineSegmentIntersection=function(e,t,n,i,r,o,s,a,c){let u=(s-r)*(t-o)-(a-o)*(e-r),f=(n-e)*(t-o)-(i-t)*(e-r),d=(a-o)*(n-e)-(s-r)*(i-t);if(d===0)return;let p=u/d,g=f/d;if(p>=0&&p<=1&&g>=0&&g<=1)return l(c)||(c=new U),c.x=e+p*(n-e),c.y=t+p*(i-t),c};var y0=j9;function m_(e){e=e??H.EMPTY_OBJECT,this._minimumHeight=e.minimumHeight,this._maximumHeight=e.maximumHeight,this._skirtHeight=e.skirtHeight,this._boundingSphere=ue.clone(e.boundingSphere,new ue),this._orientedBoundingBox=en.clone(e.orientedBoundingBox,new en),this._horizonOcclusionPoint=h.clone(e.horizonOcclusionPoint,new h),this._hasVertexNormals=e.requestVertexNormals??!1,this._hasWaterMask=e.requestWaterMask??!1,this._hasWebMercatorT=!0,this._credits=e.credits,this._childTileMask=e.childTileMask??15,this._gltf=e.gltf,this._mesh=void 0,this._waterMask=e.waterMask}Object.defineProperties(m_.prototype,{credits:{get:function(){return this._credits}},waterMask:{get:function(){return this._waterMask}}});m_.prototype.interpolateHeight=function(e,t,n){let i=this._mesh;return i===void 0?void 0:KLe(i,e,t,n)};m_.prototype.isChildAvailable=function(e,t,n,i){let r=2;return n!==e*2&&++r,i!==t*2&&(r-=2),(this._childTileMask&1<<r)!==0};var XLe="createVerticesFromCesium3DTilesTerrain",yVt=new $n(XLe),AVt=new $n(XLe,Lf.maximumAsynchronousTasks);m_.prototype.createMesh=function(e){e=e??H.EMPTY_OBJECT;let n=e.throttle??!0?AVt:yVt,i=e.tilingScheme,r=i.ellipsoid,o=e.x,s=e.y,a=e.level,c=i.tileXYToRectangle(o,s,a,new ie),u=this._gltf,f=n.scheduleTask({ellipsoid:r,rectangle:c,hasVertexNormals:this._hasVertexNormals,hasWaterMask:this._hasWaterMask,hasWebMercatorT:this._hasWebMercatorT,gltf:u,minimumHeight:this._minimumHeight,maximumHeight:this._maximumHeight,boundingSphere:this._boundingSphere,orientedBoundingBox:this._orientedBoundingBox,horizonOcclusionPoint:this._horizonOcclusionPoint,skirtHeight:this._skirtHeight,exaggeration:e.exaggeration,exaggerationRelativeHeight:e.exaggerationRelativeHeight});if(!l(f))return;let d=this;return Promise.resolve(f).then(function(p){let g=p,m=Ro.clone(g.encoding,new Ro),y=new Float32Array(g.verticesBuffer),A=y.length/m.stride,b=g.vertexCountWithoutSkirts,x=A<=65535?Uint16Array:Uint32Array,T=new x(g.indicesBuffer),E=new x(g.westIndicesBuffer),v=new x(g.eastIndicesBuffer),S=new x(g.southIndicesBuffer),I=new x(g.northIndicesBuffer),R=g.indexCountWithoutSkirts,O=d._minimumHeight,L=d._maximumHeight,_=h.clone(m.center,new h),C=ue.clone(d._boundingSphere,new ue),w=h.clone(d._horizonOcclusionPoint,new h),D=en.clone(d._orientedBoundingBox,new en),N=new Ic(_,y,T,R,b,O,L,c,C,w,m.stride,D,m,E,S,v,I);return d._mesh=N,Promise.resolve(N)})};m_.prototype._createMeshSync=function(e){e=e??H.EMPTY_OBJECT;let t=e.tilingScheme,n=t.ellipsoid,i=e.x,r=e.y,o=e.level,s=t.tileXYToRectangle(i,r,o,new ie),a=wM.createMesh({ellipsoid:n,rectangle:s,hasVertexNormals:this._hasVertexNormals,hasWebMercatorT:this._hasWebMercatorT,gltf:this._gltf,minimumHeight:this._minimumHeight,maximumHeight:this._maximumHeight,boundingSphere:this._boundingSphere,orientedBoundingBox:this._orientedBoundingBox,horizonOcclusionPoint:this._horizonOcclusionPoint,skirtHeight:this._skirtHeight,exaggeration:e.exaggeration,exaggerationRelativeHeight:e.exaggerationRelativeHeight}),c=this;return Promise.resolve(a).then(function(u){return c._mesh=u,Promise.resolve(u)})};m_.prototype.upsample=function(e,t,n,i,r,o,s){let a=this._mesh;return a===void 0?void 0:H9(!1,a,this._skirtHeight,this._credits,e,t,n,i,r,o,s)};m_.prototype._upsampleSync=function(e,t,n,i,r,o,s){let a=this._mesh;return a===void 0?void 0:H9(!0,a,this._skirtHeight,this._credits,e,t,n,i,r,o,s)};m_.prototype.wasCreatedByUpsampling=function(){return!1};function h_(e){e=e??H.EMPTY_OBJECT,this._mesh=e.terrainMesh,this._skirtHeight=e.skirtHeight,this._credits=e.credits}h_.prototype.createMesh=function(e){return e=e??H.EMPTY_OBJECT,Promise.resolve(this._mesh)};h_.prototype.upsample=function(e,t,n,i,r,o,s){return H9(!1,this._mesh,this._skirtHeight,this._credits,e,t,n,i,r,o,s)};h_.prototype._upsampleSync=function(e,t,n,i,r,o,s){return H9(!0,this._mesh,this._skirtHeight,this._credits,e,t,n,i,r,o,s)};h_.prototype.interpolateHeight=function(e,t,n){let i=this._mesh;return KLe(i,e,t,n)};h_.prototype.wasCreatedByUpsampling=function(){return!0};h_.prototype.isChildAvailable=function(e,t,n,i){return!1};Object.defineProperties(h_.prototype,{credits:{get:function(){return this._credits}},waterMask:{get:function(){}}});var bVt=new $n("upsampleVerticesFromCesium3DTilesTerrain",Lf.maximumAsynchronousTasks);function H9(e,t,n,i,r,o,s,a,c,u,f){if(f-a>1)throw new pe("Upsampling through more than one level at a time is not currently supported.");let p=n*.5,g=o*2!==c,m=s*2===u,y=r.tileXYToRectangle(c,u,f,new ie),A=r.ellipsoid,b={isEastChild:g,isNorthChild:m,rectangle:y,ellipsoid:A,skirtHeight:p,parentVertices:t.vertices,parentIndices:t.indices,parentVertexCountWithoutSkirts:t.vertexCountWithoutSkirts,parentIndexCountWithoutSkirts:t.indexCountWithoutSkirts,parentMinimumHeight:t.minimumHeight,parentMaximumHeight:t.maximumHeight,parentEncoding:t.encoding};if(e){let T=wM.upsampleMesh(b),E=new h_({terrainMesh:T,skirtHeight:p,credits:i});return Promise.resolve(E)}let x=bVt.scheduleTask(b);if(x!==void 0)return x.then(function(T){let E=Ro.clone(T.encoding,new Ro),v=E.stride,S=new Float32Array(T.verticesBuffer),I=S.length/v,R=T.vertexCountWithoutSkirts,O=I<=65535?Uint16Array:Uint32Array,L=new O(T.indicesBuffer),_=new O(T.westIndicesBuffer),C=new O(T.eastIndicesBuffer),w=new O(T.southIndicesBuffer),D=new O(T.northIndicesBuffer),N=T.indexCountWithoutSkirts,F=T.minimumHeight,V=T.maximumHeight,B=h.clone(E.center,new h),j=ue.clone(T.boundingSphere,new ue),k=h.clone(T.horizonOcclusionPoint,new h),G=en.clone(T.orientedBoundingBox,new en),q=new Ic(B,S,L,N,R,F,V,y,j,k,v,G,E,_,w,C,D),Q=new h_({terrainMesh:q,skirtHeight:p,credits:i});return Promise.resolve(Q)})}var xVt=new U,TVt=new U,EVt=new U,CVt=new h;function KLe(e,t,n,i){let r=P.clamp((n-t.west)/t.width,0,1),o=P.clamp((i-t.south)/t.height,0,1),{vertices:s,encoding:a,indices:c}=e;for(let u=0;u<e.indexCountWithoutSkirts;u+=3){let f=c[u],d=c[u+1],p=c[u+2],g=a.decodeTextureCoordinates(s,f,xVt),m=a.decodeTextureCoordinates(s,d,TVt),y=a.decodeTextureCoordinates(s,p,EVt),A=Math.min(g.x,m.x,y.x),b=Math.max(g.x,m.x,y.x),x=Math.min(g.y,m.y,y.y),T=Math.max(g.y,m.y,y.y);if(r>=A&&r<=b&&o>=x&&o<=T){let E=y0.computeBarycentricCoordinates(r,o,g.x,g.y,m.x,m.y,y.x,y.y,CVt);if(E.x>=0&&E.y>=0&&E.z>=0){let v=a.decodeHeight(s,f),S=a.decodeHeight(s,d),I=a.decodeHeight(s,p);return E.x*v+E.y*S+E.z*I}}}return 0}var G9=m_;function A0(e){e=e??H.EMPTY_OBJECT;let t=e.credit;typeof t=="string"&&(t=new It(t)),this._credit=t,this._tileCredits=void 0,this._errorEvent=new be,this._ellipsoid=e.ellipsoid??ee.WGS84,this._tilingScheme=new rr({ellipsoid:this._ellipsoid}),this._subtreeCache=new tE({provider:this}),this._tileset0=void 0,this._tileset1=void 0,this._resource=void 0,this._requestVertexNormals=e.requestVertexNormals??!1,this._requestWaterMask=e.requestWaterMask??!1}A0.fromUrl=async function(e,t){t=t??H.EMPTY_OBJECT,e=await Promise.resolve(e);let n=De.createIfNeeded(e),i;try{i=await n.fetchJson()}catch(f){throw new oe("Could not load tileset JSON",f)}let r=new A0(t);r._tileCredits=n.credits,r._resource=n;let o=i.root.children,s=o[0],a=o[1],c=i.schema,u=Eu.fromJson(c);return r._tileset0=new Cg(n,s,u),r._tileset1=new Cg(n,a,u),r};A0.fromIonAssetId=async function(e,t){let n=await Yo.fromAssetId(e);return A0.fromUrl(n,t)};var vVt=new Array(3);A0.prototype.requestTileGeometry=async function(e,t,n,i){let r=JLe(n,e),o=r===0?this._tileset0:this._tileset1,s=ZLe(o,n,e,t),a=s.getSubtreeCoordinates(),c=this._subtreeCache,u=c.find(r,a),f=this._requestWaterMask,d=this,p;if(u===void 0){let x=o.subtreeUriTemplate.getDerivedResource({templateValues:a.getTemplateValues()});p=o.baseResource.getDerivedResource({url:x.url}).fetchArrayBuffer().then(async function(E){if(u=c.find(r,a),u===void 0){let v=new Uint8Array(E);u=await py.fromSubtreeJson(d._resource,void 0,v,o,a),c.addSubtree(r,u)}return u})}else p=Promise.resolve(u);let g=o.contentUriTemplates[0].getDerivedResource({templateValues:s.getTemplateValues()}),m=o.baseResource.getDerivedResource({url:g.url}),y=m.fetchArrayBuffer();if(y===void 0)return;let A=y.then(x=>RC(new Uint8Array(x))),b=vVt;b[0]=p,b[1]=A,b[2]=f?A.then(x=>SVt(x,m)):void 0;try{let x=await Promise.all(b),T=x[0],E=x[1],v=x[2],S=T.getTileMetadataView(s),I=S.getPropertyBySemantic(Ph.TILE_MINIMUM_HEIGHT),R=S.getPropertyBySemantic(Ph.TILE_MAXIMUM_HEIGHT),O=S.getPropertyBySemantic(Ph.TILE_BOUNDING_SPHERE),L=ue.unpack(O,0,new ue),_=S.getPropertyBySemantic(Ph.TILE_HORIZON_OCCLUSION_POINT),w=d._tilingScheme.tileXYToRectangle(e,t,n,new ie),D=d._ellipsoid,N=en.fromRectangle(w,I,R,D,new en),F=d.getLevelMaximumGeometricError(n)*5,V=W9(o,T,s,0,0),B=W9(o,T,s,1,0),j=W9(o,T,s,0,1),k=W9(o,T,s,1,1),G=(V?1:0)|(B?2:0)|(j?4:0)|(k?8:0),q=new G9({gltf:E,minimumHeight:I,maximumHeight:R,boundingSphere:L,orientedBoundingBox:N,horizonOcclusionPoint:_,skirtHeight:F,requestVertexNormals:d._requestVertexNormals,childTileMask:G,credits:d._tileCredits,waterMask:v});return Promise.resolve(q)}catch(x){console.log(`Could not load subtree: ${r} ${a.level} ${a.x} ${a.y}: ${x}`),console.log(`Could not load tile: ${r} ${s.level} ${s.x} ${s.y}: ${x}`);return}};A0.prototype.getTileDataAvailable=function(e,t,n){let i=this._subtreeCache,r=JLe(n,e),o=r===0?this._tileset0:this._tileset1,s=ZLe(o,n,e,t),a=s.getSubtreeCoordinates(),c=i.find(r,a);if(c!==void 0)return c.tileIsAvailableAtCoordinates(s);if(a.isImplicitTilesetRoot())return s.isSubtreeRoot()?!0:void 0;let u=a.getParentSubtreeCoordinates(),f=i.find(r,u);if(f!==void 0)return f.childSubtreeIsAvailableAtCoordinates(a)?s.isSubtreeRoot()?!0:void 0:!1};function JLe(e,t){let n=1<<e;return t/n|0}function ZLe(e,t,n,i){let r=1<<t,o=t,s=n%r,a=r-i-1,{subdivisionScheme:c,subtreeLevels:u}=e;return new vg({subdivisionScheme:c,subtreeLevels:u,level:o,x:s,y:a})}async function SVt(e,t){let n=e.extensions?.EXT_structural_metadata;if(!l(n)||!l(n.propertyTextures))return;let i=new tx({schema:n.schema});await i.load();let r=i.schema,o,s;if(l(r.classes)){for(let g in r.classes)if(r.classes.hasOwnProperty(g)&&(o=r.classes[g],s=o.propertiesBySemantic.WATERMASK,l(s)))break}if(!l(s))return;let a=n.propertyTextures.find(g=>g.class===o.id);if(!l(a))throw new pe(`Expected a propertyTexture with a class ${o.id}`);let c=a.properties[s.id],u=e.textures[c.index],f=e.images[u.source]?.bufferView,d=Bi.getBufferViewLoader({gltf:e,bufferViewId:f,gltfResource:t,baseResource:t});return await d.load(),await fy({uint8Array:new Uint8Array(d.typedArray),format:"image/png",flipY:!1,skipColorSpaceConversion:!0})}function W9(e,t,n,i,r){let o=n.isBottomOfSubtree(),a=vse(e,1,i,r),c=n.getDescendantCoordinates(a);return o?t.childSubtreeIsAvailableAtCoordinates(c):t.tileIsAvailableAtCoordinates(c)}function vse(e,t,n,i){let{subdivisionScheme:r,subtreeLevels:o}=e;return new vg({subdivisionScheme:r,subtreeLevels:o,level:t,x:n,y:i})}A0.prototype.loadTileDataAvailability=function(e,t,n){};A0.prototype.getLevelMaximumGeometricError=function(e){let t=this._ellipsoid;return Xr.getEstimatedLevelZeroGeometricErrorForAHeightmap(t,64,2)/(1<<e)};Object.defineProperties(A0.prototype,{errorEvent:{get:function(){return this._errorEvent}},credit:{get:function(){return this._credit}},tilingScheme:{get:function(){return this._tilingScheme}},hasWaterMask:{get:function(){return this._requestWaterMask}},hasVertexNormals:{get:function(){return this._requestVertexNormals}},availability:{get:function(){return this._subtreeCache}}});function wVt(e,t,n){this.rootId=e,this.subtree=t,this.stamp=n}function tE(e){this._maximumSubtreeCount=e.maximumSubtreeCount??0,this._subtreeRequestCounter=0,this._queue=new KA({comparator:tE.comparator}),this._provider=e.provider}tE.comparator=function(e,t){let n=e.subtree.implicitCoordinates,i=t.subtree.implicitCoordinates;return n.isAncestor(i)?1:i.isAncestor(n)?-1:e.stamp-t.stamp};tE.prototype.addSubtree=function(e,t){let n=new wVt(e,t,this._subtreeRequestCounter);this._queue.insert(n),this._subtreeRequestCounter++;let i=t.implicitCoordinates;if(i.level>0){let r=i.getParentSubtreeCoordinates(),o=this.find(e,r)}if(this._maximumSubtreeCount>0)for(;this._queue.length>this._maximumSubtreeCount&&this._queue.getMinimum()!==n;)this._queue.removeMinimum()};tE.prototype.find=function(e,t){let n=this._queue,i=n.internalArray,{level:r,x:o,y:s}=t;for(let a=0;a<n.length;a++){let c=i[a],u=c.rootId,f=c.subtree.implicitCoordinates;if(u===e&&f.level===r&&f.x===o&&f.y===s)return c.subtree}};tE.prototype._computeMaximumImplicitTileCoordinatesAtPosition=function(e){let{longitude:t,latitude:n}=e,i=this._provider,r=t<0?0:1,o=r===0?i._tileset0:i._tileset1,s=o.subtreeLevels,a=vse(o,0,0,0),c=this.find(r,a);if(c===void 0)return;let u=c.implicitCoordinates,f=u.x,d=u.y,p=u.level,g=-P.PI,m=+P.PI,y=P.lerp(g,m,r/2),A=P.lerp(g,m,(r+1)/2),b=-P.PI*.5,x=+P.PI*.5,T=0,E=0,v=!0;for(;v;){let I=1/(1<<p),R=(A-y)*I,O=y+f*R,L=(x-b)*I,_=b+d*L;T=(t-O)/R,E=(n-_)/L;let C=$Le(o,u,T,E,s);if(c.childSubtreeIsAvailableAtCoordinates(C)){let w=this.find(r,C);if(w!==void 0)c=w,u=c.implicitCoordinates,f=u.x,d=u.y,p=u.level;else return C}else v=!1}let S;for(let I=0;I<s;I++){let R=$Le(o,u,T,E,I);if(c.tileIsAvailableAtCoordinates(R))S=R;else break}return S};function $Le(e,t,n,i,r){let o=1<<r,s=P.clamp(n*o|0,0,o-1),a=P.clamp(i*o|0,0,o-1),c=vse(e,r,s,a);return t.getDescendantCoordinates(c)}tE.prototype.computeMaximumLevelAtPosition=function(e){let t=this._computeMaximumImplicitTileCoordinatesAtPosition(e);return t===void 0?0:t.level};var QLe=A0;function eb(e){e=e??H.EMPTY_OBJECT,this._quantizedVertices=e.quantizedVertices,this._encodedNormals=e.encodedNormals,this._indices=e.indices,this._minimumHeight=e.minimumHeight,this._maximumHeight=e.maximumHeight,this._boundingSphere=e.boundingSphere,this._orientedBoundingBox=e.orientedBoundingBox,this._horizonOcclusionPoint=e.horizonOcclusionPoint,this._credits=e.credits;let t=this._quantizedVertices.length/3,n=this._uValues=this._quantizedVertices.subarray(0,t),i=this._vValues=this._quantizedVertices.subarray(t,2*t);this._heightValues=this._quantizedVertices.subarray(2*t,3*t);function r(s,a){return i[s]-i[a]}function o(s,a){return n[s]-n[a]}this._westIndices=Y9(e.westIndices,r,t),this._southIndices=Y9(e.southIndices,o,t),this._eastIndices=Y9(e.eastIndices,r,t),this._northIndices=Y9(e.northIndices,o,t),this._westSkirtHeight=e.westSkirtHeight,this._southSkirtHeight=e.southSkirtHeight,this._eastSkirtHeight=e.eastSkirtHeight,this._northSkirtHeight=e.northSkirtHeight,this._childTileMask=e.childTileMask??15,this._createdByUpsampling=e.createdByUpsampling??!1,this._waterMask=e.waterMask,this._mesh=void 0}Object.defineProperties(eb.prototype,{credits:{get:function(){return this._credits}},waterMask:{get:function(){return this._waterMask}},childTileMask:{get:function(){return this._childTileMask}},canUpsample:{get:function(){return l(this._mesh)}}});var q9=[];function Y9(e,t,n){q9.length=e.length;let i=!1;for(let r=0,o=e.length;r<o;++r)q9[r]=e[r],i=i||r>0&&t(e[r-1],e[r])>0;return i?(q9.sort(t),je.createTypedArray(n,q9)):e}var eFe="createVerticesFromQuantizedTerrainMesh",IVt=new $n(eFe),PVt=new $n(eFe,Lf.maximumAsynchronousTasks);eb.prototype.createMesh=function(e){e=e??H.EMPTY_OBJECT;let t=e.tilingScheme,n=e.x,i=e.y,r=e.level,o=e.exaggeration??1,s=e.exaggerationRelativeHeight??0,a=e.throttle??!0,c=t.ellipsoid,u=t.tileXYToRectangle(n,i,r),d=(a?PVt:IVt).scheduleTask({minimumHeight:this._minimumHeight,maximumHeight:this._maximumHeight,quantizedVertices:this._quantizedVertices,octEncodedNormals:this._encodedNormals,includeWebMercatorT:!0,indices:this._indices,westIndices:this._westIndices,southIndices:this._southIndices,eastIndices:this._eastIndices,northIndices:this._northIndices,westSkirtHeight:this._westSkirtHeight,southSkirtHeight:this._southSkirtHeight,eastSkirtHeight:this._eastSkirtHeight,northSkirtHeight:this._northSkirtHeight,rectangle:u,relativeToCenter:this._boundingSphere.center,ellipsoid:c,exaggeration:o,exaggerationRelativeHeight:s});if(!l(d))return;let p=this;return Promise.resolve(d).then(function(g){let m=p._quantizedVertices.length/3,y=m+p._westIndices.length+p._southIndices.length+p._eastIndices.length+p._northIndices.length,A=je.createTypedArray(y,g.indices),b=new Float32Array(g.vertices),x=g.center,T=g.minimumHeight,E=g.maximumHeight,v=p._boundingSphere,S=p._orientedBoundingBox,I=h.clone(g.occludeePointInScaledSpace)??p._horizonOcclusionPoint,R=g.vertexStride,O=Ro.clone(g.encoding);return p._mesh=new Ic(x,b,A,g.indexCountWithoutSkirts,m,T,E,u,v,I,R,S,O,g.westIndicesSouthToNorth,g.southIndicesEastToWest,g.eastIndicesNorthToSouth,g.northIndicesWestToEast),p._quantizedVertices=void 0,p._encodedNormals=void 0,p._indices=void 0,p._uValues=void 0,p._vValues=void 0,p._heightValues=void 0,p._westIndices=void 0,p._southIndices=void 0,p._eastIndices=void 0,p._northIndices=void 0,p._mesh})};var DVt=new $n("upsampleQuantizedTerrainMesh",Lf.maximumAsynchronousTasks);eb.prototype.upsample=function(e,t,n,i,r,o,s){let a=this._mesh;if(!l(this._mesh))return;let c=t*2!==r,u=n*2===o,f=e.ellipsoid,d=e.tileXYToRectangle(r,o,s),p=DVt.scheduleTask({vertices:a.vertices,vertexCountWithoutSkirts:a.vertexCountWithoutSkirts,indices:a.indices,indexCountWithoutSkirts:a.indexCountWithoutSkirts,encoding:a.encoding,minimumHeight:this._minimumHeight,maximumHeight:this._maximumHeight,isEastChild:c,isNorthChild:u,childRectangle:d,ellipsoid:f});if(!l(p))return;let g=Math.min(this._westSkirtHeight,this._eastSkirtHeight);g=Math.min(g,this._southSkirtHeight),g=Math.min(g,this._northSkirtHeight);let m=c?g*.5:this._westSkirtHeight,y=u?g*.5:this._southSkirtHeight,A=c?this._eastSkirtHeight:g*.5,b=u?this._northSkirtHeight:g*.5,x=this._credits;return Promise.resolve(p).then(function(T){let E=new Uint16Array(T.vertices),v=je.createTypedArray(E.length/3,T.indices),S;return l(T.encodedNormals)&&(S=new Uint8Array(T.encodedNormals)),new eb({quantizedVertices:E,indices:v,encodedNormals:S,minimumHeight:T.minimumHeight,maximumHeight:T.maximumHeight,boundingSphere:ue.clone(T.boundingSphere),orientedBoundingBox:en.clone(T.orientedBoundingBox),horizonOcclusionPoint:h.clone(T.horizonOcclusionPoint),westIndices:T.westIndices,southIndices:T.southIndices,eastIndices:T.eastIndices,northIndices:T.northIndices,westSkirtHeight:m,southSkirtHeight:y,eastSkirtHeight:A,northSkirtHeight:b,childTileMask:0,credits:x,createdByUpsampling:!0})})};var Sse=32767,tFe=new h;eb.prototype.interpolateHeight=function(e,t,n){let i=P.clamp((t-e.west)/e.width,0,1);i*=Sse;let r=P.clamp((n-e.south)/e.height,0,1);return r*=Sse,l(this._mesh)?NVt(this,i,r):LVt(this,i,r)};function nFe(e,t,n,i,r,o,s,a){let c=Math.min(n,r,s),u=Math.max(n,r,s),f=Math.min(i,o,a),d=Math.max(i,o,a);return e>=c&&e<=u&&t>=f&&t<=d}var RVt=new U,OVt=new U,MVt=new U;function NVt(e,t,n){let i=e._mesh,r=i.vertices,o=i.encoding,s=i.indices;for(let a=0,c=s.length;a<c;a+=3){let u=s[a],f=s[a+1],d=s[a+2],p=o.decodeTextureCoordinates(r,u,RVt),g=o.decodeTextureCoordinates(r,f,OVt),m=o.decodeTextureCoordinates(r,d,MVt);if(nFe(t,n,p.x,p.y,g.x,g.y,m.x,m.y)){let y=y0.computeBarycentricCoordinates(t,n,p.x,p.y,g.x,g.y,m.x,m.y,tFe);if(y.x>=-1e-15&&y.y>=-1e-15&&y.z>=-1e-15){let A=o.decodeHeight(r,u),b=o.decodeHeight(r,f),x=o.decodeHeight(r,d);return y.x*A+y.y*b+y.z*x}}}}function LVt(e,t,n){let i=e._uValues,r=e._vValues,o=e._heightValues,s=e._indices;for(let a=0,c=s.length;a<c;a+=3){let u=s[a],f=s[a+1],d=s[a+2],p=i[u],g=i[f],m=i[d],y=r[u],A=r[f],b=r[d];if(nFe(t,n,p,y,g,A,m,b)){let x=y0.computeBarycentricCoordinates(t,n,p,y,g,A,m,b,tFe);if(x.x>=-1e-15&&x.y>=-1e-15&&x.z>=-1e-15){let T=x.x*o[u]+x.y*o[f]+x.z*o[d];return P.lerp(e._minimumHeight,e._maximumHeight,T/Sse)}}}}eb.prototype.isChildAvailable=function(e,t,n,i){let r=2;return n!==e*2&&++r,i!==t*2&&(r-=2),(this._childTileMask&1<<r)!==0};eb.prototype.wasCreatedByUpsampling=function(){return this._createdByUpsampling};var mI=eb;function FVt(e){this.resource=e.resource,this.version=e.version,this.isHeightmap=e.isHeightmap,this.tileUrlTemplates=e.tileUrlTemplates,this.availability=e.availability,this.hasVertexNormals=e.hasVertexNormals,this.hasWaterMask=e.hasWaterMask,this.hasMetadata=e.hasMetadata,this.availabilityLevels=e.availabilityLevels,this.availabilityTilesLoaded=e.availabilityTilesLoaded,this.littleEndianExtensionSize=e.littleEndianExtensionSize,this.availabilityPromiseCache={}}function rFe(e){this.requestVertexNormals=e.requestVertexNormals??!1,this.requestWaterMask=e.requestWaterMask??!1,this.requestMetadata=e.requestMetadata??!0,this.ellipsoid=e.ellipsoid??ee.default,this.heightmapWidth=65,this.heightmapStructure=void 0,this.hasWaterMask=!1,this.hasMetadata=!1,this.hasVertexNormals=!1,this.scheme=void 0,this.lastResource=void 0,this.layerJsonResource=void 0,this.previousError=void 0,this.availability=void 0,this.tilingScheme=void 0,this.levelZeroMaximumGeometricError=void 0,this.heightmapStructure=void 0,this.layers=[],this.attribution="",this.overallAvailability=[],this.overallMaxZoom=0,this.tileCredits=[]}rFe.prototype.build=function(e){e._heightmapWidth=this.heightmapWidth,e._scheme=this.scheme;let t=l(this.lastResource.credits)?this.lastResource.credits:[];e._tileCredits=t.concat(this.tileCredits),e._availability=this.availability,e._tilingScheme=this.tilingScheme,e._requestWaterMask=this.requestWaterMask,e._levelZeroMaximumGeometricError=this.levelZeroMaximumGeometricError,e._heightmapStructure=this.heightmapStructure,e._layers=this.layers,e._hasWaterMask=this.hasWaterMask,e._hasVertexNormals=this.hasVertexNormals,e._hasMetadata=this.hasMetadata};async function oFe(e,t,n){if(!t.format){let y="The tile format is not specified in the layer.json file.";throw e.previousError=no.reportError(e.previousError,n,l(n)?n._errorEvent:void 0,y),new oe(y)}if(!t.tiles||t.tiles.length===0){let y="The layer.json file does not specify any tile URL templates.";throw e.previousError=no.reportError(e.previousError,n,l(n)?n._errorEvent:void 0,y),new oe(y)}let i=!1,r=!1,o=!1,s=!0,a=!1;if(t.format==="heightmap-1.0")a=!0,l(e.heightmapStructure)||(e.heightmapStructure={heightScale:1/5,heightOffset:-1e3,elementsPerHeight:1,stride:1,elementMultiplier:256,isBigEndian:!1,lowestEncodedHeight:0,highestEncodedHeight:256*256-1}),r=!0,e.requestWaterMask=!0;else if(t.format.indexOf("quantized-mesh-1.")!==0){let y=`The tile format "${t.format}" is invalid or not supported.`;throw e.previousError=no.reportError(e.previousError,n,l(n)?n._errorEvent:void 0,y),new oe(y)}let c=t.tiles,u=t.maxzoom;if(e.overallMaxZoom=Math.max(e.overallMaxZoom,u),!t.projection||t.projection==="EPSG:4326")e.tilingScheme=new rr({numberOfLevelZeroTilesX:2,numberOfLevelZeroTilesY:1,ellipsoid:e.ellipsoid});else if(t.projection==="EPSG:3857")e.tilingScheme=new Bo({numberOfLevelZeroTilesX:1,numberOfLevelZeroTilesY:1,ellipsoid:e.ellipsoid});else{let y=`The projection "${t.projection}" is invalid or not supported.`;throw e.previousError=no.reportError(e.previousError,n,l(n)?n._errorEvent:void 0,y),new oe(y)}if(e.levelZeroMaximumGeometricError=Xr.getEstimatedLevelZeroGeometricErrorForAHeightmap(e.tilingScheme.ellipsoid,e.heightmapWidth,e.tilingScheme.getNumberOfXTilesAtLevel(0)),!t.scheme||t.scheme==="tms"||t.scheme==="slippyMap")e.scheme=t.scheme;else{let y=`The scheme "${t.scheme}" is invalid or not supported.`;throw e.previousError=no.reportError(e.previousError,n,l(n)?n._errorEvent:void 0,y),new oe(y)}let f;l(t.extensions)&&t.extensions.indexOf("octvertexnormals")!==-1?i=!0:l(t.extensions)&&t.extensions.indexOf("vertexnormals")!==-1&&(i=!0,s=!1),l(t.extensions)&&t.extensions.indexOf("watermask")!==-1&&(r=!0),l(t.extensions)&&t.extensions.indexOf("metadata")!==-1&&(o=!0);let d=t.metadataAvailability,p=t.available,g;if(l(p)&&!l(d)){g=new _0(e.tilingScheme,p.length);for(let y=0;y<p.length;++y){let A=p[y],b=e.tilingScheme.getNumberOfYTilesAtLevel(y);l(e.overallAvailability[y])||(e.overallAvailability[y]=[]);for(let x=0;x<A.length;++x){let T=A[x],E=b-T.endY-1,v=b-T.startY-1;e.overallAvailability[y].push([T.startX,E,T.endX,v]),g.addAvailableTileRange(y,T.startX,E,T.endX,v)}}}else l(d)&&(f=new _0(e.tilingScheme,u),g=new _0(e.tilingScheme,u),e.overallAvailability[0]=[[0,0,1,0]],g.addAvailableTileRange(0,0,0,1,0));e.hasWaterMask=e.hasWaterMask||r,e.hasVertexNormals=e.hasVertexNormals||i,e.hasMetadata=e.hasMetadata||o,l(t.attribution)&&(e.attribution.length>0&&(e.attribution+=" "),e.attribution+=t.attribution),e.layers.push(new FVt({resource:e.lastResource,version:t.version,isHeightmap:a,tileUrlTemplates:c,availability:g,hasVertexNormals:i,hasWaterMask:r,hasMetadata:o,availabilityLevels:d,availabilityTilesLoaded:f,littleEndianExtensionSize:s}));let m=t.parentUrl;return l(m)?l(g)?(e.lastResource=e.lastResource.getDerivedResource({url:m}),e.lastResource.appendForwardSlash(),e.layerJsonResource=e.lastResource.getDerivedResource({url:"layer.json"}),await Pse(e),!0):(console.log("A layer.json can't have a parentUrl if it does't have an available array."),!0):!0}function BVt(e,t,n){let i=`An error occurred while accessing ${e.layerJsonResource.url}.`;if(l(t)&&(i+=` -${t.message}`),e.previousError=no.reportError(e.previousError,n,l(n)?n._errorEvent:void 0,i),e.previousError.retry)return Pse(e,n);throw new oe(i)}async function kVt(e,t,n){await oFe(e,t,n);let i=e.overallAvailability.length;if(i>0){let r=e.availability=new _0(e.tilingScheme,e.overallMaxZoom);for(let o=0;o<i;++o){let s=e.overallAvailability[o];for(let a=0;a<s.length;++a){let c=s[a];r.addAvailableTileRange(o,c[0],c[1],c[2],c[3])}}}if(e.attribution.length>0){let r=new It(e.attribution);e.tileCredits.push(r)}return!0}async function Pse(e,t){try{let n=await e.layerJsonResource.fetchJson();return kVt(e,n,t)}catch(n){return l(n)&&n.statusCode===404?(await oFe(e,{tilejson:"2.1.0",format:"heightmap-1.0",version:"1.0.0",scheme:"tms",tiles:["{z}/{x}/{y}.terrain?v={version}"]},t),!0):BVt(e,n,t)}}function vm(e){e=e??H.EMPTY_OBJECT,this._heightmapWidth=void 0,this._heightmapStructure=void 0,this._hasWaterMask=!1,this._hasVertexNormals=!1,this._hasMetadata=!1,this._scheme=void 0,this._ellipsoid=e.ellipsoid,this._requestVertexNormals=e.requestVertexNormals??!1,this._requestWaterMask=e.requestWaterMask??!1,this._requestMetadata=e.requestMetadata??!0,this._errorEvent=new be;let t=e.credit;typeof t=="string"&&(t=new It(t)),this._credit=t,this._availability=void 0,this._tilingScheme=void 0,this._levelZeroMaximumGeometricError=void 0,this._layers=void 0,this._tileCredits=void 0}var wse={OCT_VERTEX_NORMALS:1,WATER_MASK:2,METADATA:4};function iFe(e){return!l(e)||e.length===0?{Accept:"application/vnd.quantized-mesh,application/octet-stream;q=0.9,*/*;q=0.01"}:{Accept:`application/vnd.quantized-mesh;extensions=${e.join("-")},application/octet-stream;q=0.9,*/*;q=0.01`}}function UVt(e,t,n,i,r){let o=new Uint16Array(t,0,e._heightmapWidth*e._heightmapWidth);return new ll({buffer:o,childTileMask:new Uint8Array(t,o.byteLength,1)[0],waterMask:new Uint8Array(t,o.byteLength+1,t.byteLength-o.byteLength-1),width:e._heightmapWidth,height:e._heightmapWidth,structure:e._heightmapStructure,credits:e._tileCredits})}function zVt(e,t,n,i,r,o){let s=o.littleEndianExtensionSize,a=0,c=3,u=c+1,f=Float64Array.BYTES_PER_ELEMENT*c,d=Float64Array.BYTES_PER_ELEMENT*u,g=Uint16Array.BYTES_PER_ELEMENT*3,m=3,y=Uint16Array.BYTES_PER_ELEMENT,A=y*m,b=new DataView(t),x=new h(b.getFloat64(a,!0),b.getFloat64(a+8,!0),b.getFloat64(a+16,!0));a+=f;let T=b.getFloat32(a,!0);a+=Float32Array.BYTES_PER_ELEMENT;let E=b.getFloat32(a,!0);a+=Float32Array.BYTES_PER_ELEMENT;let v=new ue(new h(b.getFloat64(a,!0),b.getFloat64(a+8,!0),b.getFloat64(a+16,!0)),b.getFloat64(a+f,!0));a+=d;let S=new h(b.getFloat64(a,!0),b.getFloat64(a+8,!0),b.getFloat64(a+16,!0));a+=f;let I=b.getUint32(a,!0);a+=Uint32Array.BYTES_PER_ELEMENT;let R=new Uint16Array(t,a,I*3);a+=I*g,I>64*1024&&(y=Uint32Array.BYTES_PER_ELEMENT,A=y*m);let O=R.subarray(0,I),L=R.subarray(I,2*I),_=R.subarray(I*2,3*I);cn.zigZagDeltaDecode(O,L,_),a%y!==0&&(a+=y-a%y);let C=b.getUint32(a,!0);a+=Uint32Array.BYTES_PER_ELEMENT;let w=je.createTypedArrayFromArrayBuffer(I,t,a,C*m);a+=C*A;let D=0,N=w.length;for(let fe=0;fe<N;++fe){let xe=w[fe];w[fe]=D-xe,xe===0&&++D}let F=b.getUint32(a,!0);a+=Uint32Array.BYTES_PER_ELEMENT;let V=je.createTypedArrayFromArrayBuffer(I,t,a,F);a+=F*y;let B=b.getUint32(a,!0);a+=Uint32Array.BYTES_PER_ELEMENT;let j=je.createTypedArrayFromArrayBuffer(I,t,a,B);a+=B*y;let k=b.getUint32(a,!0);a+=Uint32Array.BYTES_PER_ELEMENT;let G=je.createTypedArrayFromArrayBuffer(I,t,a,k);a+=k*y;let q=b.getUint32(a,!0);a+=Uint32Array.BYTES_PER_ELEMENT;let Q=je.createTypedArrayFromArrayBuffer(I,t,a,q);a+=q*y;let W,J;for(;a<b.byteLength;){let fe=b.getUint8(a,!0);a+=Uint8Array.BYTES_PER_ELEMENT;let xe=b.getUint32(a,s);if(a+=Uint32Array.BYTES_PER_ELEMENT,fe===wse.OCT_VERTEX_NORMALS&&e._requestVertexNormals)W=new Uint8Array(t,a,I*2);else if(fe===wse.WATER_MASK&&e._requestWaterMask)J=new Uint8Array(t,a,xe);else if(fe===wse.METADATA&&e._requestMetadata){let ge=b.getUint32(a,!0);if(ge>0){let ve=No(new Uint8Array(t),a+Uint32Array.BYTES_PER_ELEMENT,ge).available;if(l(ve))for(let Re=0;Re<ve.length;++Re){let Qe=n+Re+1,He=ve[Re],Ye=e._tilingScheme.getNumberOfYTilesAtLevel(Qe);for(let Ke=0;Ke<He.length;++Ke){let Pe=He[Ke],qe=Ye-Pe.endY-1,st=Ye-Pe.startY-1;e.availability.addAvailableTileRange(Qe,Pe.startX,qe,Pe.endX,st),o.availability.addAvailableTileRange(Qe,Pe.startX,qe,Pe.endX,st)}}}o.availabilityTilesLoaded.addAvailableTileRange(n,i,r,i,r)}a+=xe}let Z=e.getLevelMaximumGeometricError(n)*5,ae=e._tilingScheme.tileXYToRectangle(i,r,n),Ae=en.fromRectangle(ae,T,E,e._tilingScheme.ellipsoid);return new mI({center:x,minimumHeight:T,maximumHeight:E,boundingSphere:v,orientedBoundingBox:Ae,horizonOcclusionPoint:S,quantizedVertices:R,encodedNormals:W,indices:w,westIndices:V,southIndices:j,eastIndices:G,northIndices:Q,westSkirtHeight:Z,southSkirtHeight:Z,eastSkirtHeight:Z,northSkirtHeight:Z,childTileMask:e.availability.computeChildMaskForTile(n,i,r),waterMask:J,credits:e._tileCredits})}vm.prototype.requestTileGeometry=function(e,t,n,i){let r=this._layers,o,s=r.length,a=!1,c=Promise.resolve();if(s===1)o=r[0];else for(let u=0;u<s;++u){let f=r[u];if(!l(f.availability)||f.availability.isTileAvailable(n,e,t)){o=f;break}let d=Dse(this,e,t,n,f,u===0);d.result&&(a=!0,c=c.then(()=>d.promise))}return!l(o)&&a?c.then(()=>new Promise(u=>{setTimeout(()=>{let f=this.requestTileGeometry(e,t,n,i);u(f)},0)})):sFe(this,e,t,n,o,i)};function sFe(e,t,n,i,r,o){if(!l(r))return Promise.reject(new oe("Terrain tile doesn't exist"));let s=r.tileUrlTemplates;if(s.length===0)return;let a;!e._scheme||e._scheme==="tms"?a=e._tilingScheme.getNumberOfYTilesAtLevel(i)-n-1:a=n;let c=[];e._requestVertexNormals&&r.hasVertexNormals&&c.push(r.littleEndianExtensionSize?"octvertexnormals":"vertexnormals"),e._requestWaterMask&&r.hasWaterMask&&c.push("watermask"),e._requestMetadata&&r.hasMetadata&&c.push("metadata");let u,f,d=s[(t+a+i)%s.length],p=r.resource;l(p._ionEndpoint)&&!l(p._ionEndpoint.externalType)?(c.length!==0&&(f={extensions:c.join("-")}),u=iFe(void 0)):u=iFe(c);let g=p.getDerivedResource({url:d,templateValues:{version:r.version,z:i,x:t,y:a},queryParameters:f,headers:u,request:o}).fetchArrayBuffer();if(l(g))return g.then(function(m){return l(m)?l(e._heightmapStructure)?UVt(e,m,i,t,n):zVt(e,m,i,t,n,r):Promise.reject(new oe("Mesh buffer doesn't exist."))})}Object.defineProperties(vm.prototype,{errorEvent:{get:function(){return this._errorEvent}},credit:{get:function(){return this._credit}},tilingScheme:{get:function(){return this._tilingScheme}},hasWaterMask:{get:function(){return this._hasWaterMask&&this._requestWaterMask}},hasVertexNormals:{get:function(){return this._hasVertexNormals&&this._requestVertexNormals}},hasMetadata:{get:function(){return this._hasMetadata&&this._requestMetadata}},requestVertexNormals:{get:function(){return this._requestVertexNormals}},requestWaterMask:{get:function(){return this._requestWaterMask}},requestMetadata:{get:function(){return this._requestMetadata}},availability:{get:function(){return this._availability}}});vm.prototype.getLevelMaximumGeometricError=function(e){return this._levelZeroMaximumGeometricError/(1<<e)};vm.fromIonAssetId=async function(e,t){let n=await Yo.fromAssetId(e);return vm.fromUrl(n,t)};vm.fromUrl=async function(e,t){t=t??H.EMPTY_OBJECT,e=await Promise.resolve(e);let n=De.createIfNeeded(e);n.appendForwardSlash();let i=new rFe(t);i.lastResource=n,i.layerJsonResource=i.lastResource.getDerivedResource({url:"layer.json"}),await Pse(i);let r=new vm(t);return i.build(r),r};vm.prototype.getTileDataAvailable=function(e,t,n){if(!l(this._availability))return;if(n>this._availability._maximumLevel)return!1;if(this._availability.isTileAvailable(n,e,t))return!0;if(!this._hasMetadata)return!1;let i=this._layers,r=i.length;for(let o=0;o<r;++o)if(Dse(this,e,t,n,i[o],o===0).result)return;return!1};vm.prototype.loadTileDataAvailability=function(e,t,n){if(!l(this._availability)||n>this._availability._maximumLevel||this._availability.isTileAvailable(n,e,t)||!this._hasMetadata)return;let i=this._layers,r=i.length;for(let o=0;o<r;++o){let s=Dse(this,e,t,n,i[o],o===0);if(l(s.promise))return s.promise}};function Ise(e,t,n,i){if(i===0)return;let r=e.availabilityLevels,o=i%r===0?i-r:(i/r|0)*r,s=1<<i-o,a=t/s|0,c=n/s|0;return{level:o,x:a,y:c}}function Dse(e,t,n,i,r,o){if(!l(r.availabilityLevels))return{result:!1};let s,a=function(){delete r.availabilityPromiseCache[s]},c=r.availabilityTilesLoaded,u=r.availability,f=Ise(r,t,n,i);for(;l(f);){if(u.isTileAvailable(f.level,f.x,f.y)&&!c.isTileAvailable(f.level,f.x,f.y)){let d;if(!o&&(s=`${f.level}-${f.x}-${f.y}`,d=r.availabilityPromiseCache[s],!l(d))){let p=new Oo({throttle:!1,throttleByServer:!0,type:oa.TERRAIN});d=sFe(e,f.x,f.y,f.level,r,p),l(d)&&(r.availabilityPromiseCache[s]=d,d.then(a))}return{result:!0,promise:d}}f=Ise(r,f.x,f.y,f.level)}return{result:!1}}vm._getAvailabilityTile=Ise;var pI=vm;function p_(e){e=e??H.EMPTY_OBJECT;let t=e.radius,n={center:e.center,semiMajorAxis:t,semiMinorAxis:t,ellipsoid:e.ellipsoid,height:e.height,extrudedHeight:e.extrudedHeight,granularity:e.granularity,vertexFormat:e.vertexFormat,stRotation:e.stRotation,shadowVolume:e.shadowVolume};this._ellipseGeometry=new Fu(n),this._workerName="createCircleGeometry"}p_.packedLength=Fu.packedLength;p_.pack=function(e,t,n){return Fu.pack(e._ellipseGeometry,t,n)};var aFe=new Fu({center:new h,semiMajorAxis:1,semiMinorAxis:1}),Rc={center:new h,radius:void 0,ellipsoid:ee.clone(ee.default),height:void 0,extrudedHeight:void 0,granularity:void 0,vertexFormat:new Be,stRotation:void 0,semiMajorAxis:void 0,semiMinorAxis:void 0,shadowVolume:void 0};p_.unpack=function(e,t,n){let i=Fu.unpack(e,t,aFe);return Rc.center=h.clone(i._center,Rc.center),Rc.ellipsoid=ee.clone(i._ellipsoid,Rc.ellipsoid),Rc.ellipsoid=ee.clone(i._ellipsoid,aFe._ellipsoid),Rc.height=i._height,Rc.extrudedHeight=i._extrudedHeight,Rc.granularity=i._granularity,Rc.vertexFormat=Be.clone(i._vertexFormat,Rc.vertexFormat),Rc.stRotation=i._stRotation,Rc.shadowVolume=i._shadowVolume,l(n)?(Rc.semiMajorAxis=i._semiMajorAxis,Rc.semiMinorAxis=i._semiMinorAxis,n._ellipseGeometry=new Fu(Rc),n):(Rc.radius=i._semiMajorAxis,new p_(Rc))};p_.createGeometry=function(e){return Fu.createGeometry(e._ellipseGeometry)};p_.createShadowVolume=function(e,t,n){let i=e._ellipseGeometry._granularity,r=e._ellipseGeometry._ellipsoid,o=t(i,r),s=n(i,r);return new p_({center:e._ellipseGeometry._center,radius:e._ellipseGeometry._semiMajorAxis,ellipsoid:r,stRotation:e._ellipseGeometry._stRotation,granularity:i,extrudedHeight:o,height:s,vertexFormat:Be.POSITION_ONLY,shadowVolume:!0})};Object.defineProperties(p_.prototype,{rectangle:{get:function(){return this._ellipseGeometry.rectangle}},textureCoordinateRotationPoints:{get:function(){return this._ellipseGeometry.textureCoordinateRotationPoints}}});var cFe=p_;function gI(e){e=e??H.EMPTY_OBJECT;let t=e.radius,n={center:e.center,semiMajorAxis:t,semiMinorAxis:t,ellipsoid:e.ellipsoid,height:e.height,extrudedHeight:e.extrudedHeight,granularity:e.granularity,numberOfVerticalLines:e.numberOfVerticalLines};this._ellipseGeometry=new jd(n),this._workerName="createCircleOutlineGeometry"}gI.packedLength=jd.packedLength;gI.pack=function(e,t,n){return jd.pack(e._ellipseGeometry,t,n)};var VVt=new jd({center:new h,semiMajorAxis:1,semiMinorAxis:1}),Hf={center:new h,radius:void 0,ellipsoid:ee.clone(ee.UNIT_SPHERE),height:void 0,extrudedHeight:void 0,granularity:void 0,numberOfVerticalLines:void 0,semiMajorAxis:void 0,semiMinorAxis:void 0};gI.unpack=function(e,t,n){let i=jd.unpack(e,t,VVt);return Hf.center=h.clone(i._center,Hf.center),Hf.ellipsoid=ee.clone(i._ellipsoid,Hf.ellipsoid),Hf.height=i._height,Hf.extrudedHeight=i._extrudedHeight,Hf.granularity=i._granularity,Hf.numberOfVerticalLines=i._numberOfVerticalLines,l(n)?(Hf.semiMajorAxis=i._semiMajorAxis,Hf.semiMinorAxis=i._semiMinorAxis,n._ellipseGeometry=new jd(Hf),n):(Hf.radius=i._semiMajorAxis,new gI(Hf))};gI.createGeometry=function(e){return jd.createGeometry(e._ellipseGeometry)};var lFe=gI;function jVt(e){return e=e??H.EMPTY_OBJECT,pI.fromIonAssetId(2426648,{requestVertexNormals:e.requestVertexNormals??!1})}var X9=jVt;function HVt(e){return e=e??H.EMPTY_OBJECT,pI.fromIonAssetId(1,{requestVertexNormals:e.requestVertexNormals??!1,requestWaterMask:e.requestWaterMask??!1,ellipsoid:ee.WGS84})}var _I=HVt;function yI(e){e=e??H.EMPTY_OBJECT,this._callback=e.callback,this._tilingScheme=e.tilingScheme,l(this._tilingScheme)||(this._tilingScheme=new rr({ellipsoid:e.ellipsoid??ee.default})),this._width=e.width,this._height=e.height;let t=Math.max(this._width,this._height);this._levelZeroMaximumGeometricError=Xr.getEstimatedLevelZeroGeometricErrorForAHeightmap(this._tilingScheme.ellipsoid,t,this._tilingScheme.getNumberOfXTilesAtLevel(0)),this._errorEvent=new be;let n=e.credit;typeof n=="string"&&(n=new It(n)),this._credit=n}Object.defineProperties(yI.prototype,{errorEvent:{get:function(){return this._errorEvent}},credit:{get:function(){return this._credit}},tilingScheme:{get:function(){return this._tilingScheme}},hasWaterMask:{get:function(){return!1}},hasVertexNormals:{get:function(){return!1}},availability:{get:function(){}},width:{get:function(){return this._width}},height:{get:function(){return this._height}}});yI.prototype.requestTileGeometry=function(e,t,n,i){let r=this._callback(e,t,n);if(!l(r))return;let o=this._width,s=this._height;return Promise.resolve(r).then(function(a){let c=a;return Array.isArray(c)&&(c=new Float64Array(c)),new ll({buffer:c,width:o,height:s})})};yI.prototype.getLevelMaximumGeometricError=function(e){return this._levelZeroMaximumGeometricError/(1<<e)};yI.prototype.getTileDataAvailable=function(e,t,n){};yI.prototype.loadTileDataAvailability=function(e,t,n){};var uFe=yI;var GVt=1953029805,WVt=2917034100;function Rse(e,t){if(Rse.passThroughDataForTesting)return t;let n=e.byteLength;if(n===0||n%4!==0)throw new oe("The length of key must be greater than 0 and a multiple of 4.");let i=new DataView(t),r=i.getUint32(0,!0);if(r===GVt||r===WVt)return t;let o=new DataView(e),s=0,a=t.byteLength,c=a-a%8,u=n,f,d=8;for(;s<c;)for(d=(d+8)%24,f=d;s<c&&f<u;)i.setUint32(s,i.getUint32(s,!0)^o.getUint32(f,!0),!0),i.setUint32(s+4,i.getUint32(s+4,!0)^o.getUint32(f+4,!0),!0),s+=8,f+=24;if(s<a)for(f>=u&&(d=(d+8)%24,f=d);s<a;)i.setUint8(s,i.getUint8(s)^o.getUint8(f)),s++,f++}Rse.passThroughDataForTesting=!1;var K9=Rse;function fFe(e){this.proxy=e}fFe.prototype.getURL=function(e){let t=this.proxy.indexOf("?")===-1?"?":"";return this.proxy+t+encodeURIComponent(e)};var dFe=fFe;function $9(){pe.throwInstantiationError()}Object.defineProperties($9.prototype,{credit:{get:pe.throwInstantiationError}});$9.getCreditsFromResult=function(e){if(l(e.attributions))return e.attributions.map(It.getIonCredit)};$9.prototype.geocode=pe.throwInstantiationError;var IM=$9;var hFe={SEARCH:0,AUTOCOMPLETE:1};Object.freeze(hFe);var nE=hFe;function mFe(){pe.throwInstantiationError()}mFe.createGeometry=function(e){pe.throwInstantiationError()};var pFe=mFe;var JVt=js(Ose(),1);function qVt(e,t){return(e&t)!==0}var Zl=qVt;var YVt=[1,2,4,8],gFe=15,XVt=16,KVt=64,$Vt=128;function b0(e,t,n,i,r,o){this._bits=e,this.cnodeVersion=t,this.imageryVersion=n,this.terrainVersion=i,this.imageryProvider=r,this.terrainProvider=o,this.ancestorHasTerrain=!1,this.terrainState=void 0}b0.clone=function(e,t){return l(t)?(t._bits=e._bits,t.cnodeVersion=e.cnodeVersion,t.imageryVersion=e.imageryVersion,t.terrainVersion=e.terrainVersion,t.imageryProvider=e.imageryProvider,t.terrainProvider=e.terrainProvider):t=new b0(e._bits,e.cnodeVersion,e.imageryVersion,e.terrainVersion,e.imageryProvider,e.terrainProvider),t.ancestorHasTerrain=e.ancestorHasTerrain,t.terrainState=e.terrainState,t};b0.prototype.setParent=function(e){this.ancestorHasTerrain=e.ancestorHasTerrain||this.hasTerrain()};b0.prototype.hasSubtree=function(){return Zl(this._bits,XVt)};b0.prototype.hasImagery=function(){return Zl(this._bits,KVt)};b0.prototype.hasTerrain=function(){return Zl(this._bits,$Vt)};b0.prototype.hasChildren=function(){return Zl(this._bits,gFe)};b0.prototype.hasChild=function(e){return Zl(this._bits,YVt[e])};b0.prototype.getChildBitmask=function(){return this._bits&gFe};var J9=b0;function ZVt(e){let t=e.length,n=new ArrayBuffer(t),i=new Uint8Array(n);for(let r=0;r<t;++r)i[r]=e.charCodeAt(r);return n}var QVt=ZVt(`E\xF4\xBD\vy\xE2jE"\x92,\xCDq\xF8IFgQ\0B%\xC6\xE8a,f)\b\xC64\xDCjb%y -wmi\xD6\xF0\x9Ck\x93\xA1\xBDNu\xE0A[\xDF@V\f\xD9\xBBr\x9B\x81|3S\xEEOl\xD4q\xB0{\xC0\x7FEVZ\xADwUe\v3\x92*\xACl5\xC50s\xF83>mF8J\xB4\xDD\xF0.\xDDu\xDA\x8CDt"\xFAa"\f3"So\xAF9D\v\x8C9\xD99L\xB9\xBF\x7F\xAB\\\x8CP_\x9F"ux\xE9\x07q\x91h;\xC1\xC4\x9B\x7F\xF0<VqH\x82'UfYNe\x98u\xA3aF}a?A\0\x9F\xD7\xB44M\xCE\x87F\xB0\xD5\xB8\x8A'{\x8B\xDC+\xBBMg0\xC8\xD1\xF6\\\x8FP\xFA[/F\x9Bn5/'C.\xEB -\f^\xA5s\x1Be4\xE5l.jC'c#U\xA9?q{gC}:\xAF\xCD\xE2TU\x9C\xFDK\xC6\xE2\x9F/(\xED\xCB\\\xC6-f\x07\x88\xA7;/*"N\xB0k.\xDD\r\x95}}G\xBAC\xB2\xB2+>M\xAA>}\xE6\xCEI\x89\xC6\xE6x\fa1-\xA4O\xA5~q \x88\xEC\r1\xE8N\v\0nPh}=\b\r\x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xAF\xF0VldI\x9C'\xADxtO\xC2\x87\xDEV9\0\xDAw\v\xCB-\x1B\x89\xFB5O\xF5\bQ\`\xC1 -ZGM&30x\xDA\xC0\x9CFG\xE2[y\`In7gS ->\xE9\xECF9\xB2\xF14\r\xC6\x84Sun\xE1\fY\xD9\xDE)\x85{II\xA5wy\xBEIV.6\xE7\v:\xBBOb{\xD2M1\x95/\xBD8{\xA8O!\xE1\xECFpv\x95})"x\x88 -\x90\xDD\x9D\\\xDA\xDEQ\xCF\xF0\xFCYRe|3\xDF\xF3H\xDA\xBB*u\xDB\`\xB2\xD4\xFC\xED\x1B\xEC\x7F5\xA8\xFF(1\x07-\xC8\xDC\x88F|\x8A["`);function Gf(e){this.imageryPresent=!0,this.protoImagery=void 0,this.terrainPresent=!0,this.negativeAltitudeExponentBias=32,this.negativeAltitudeThreshold=P.EPSILON12,this.providers={},this.key=void 0,this._resource=void 0,this._quadPacketVersion=1,this._tileInfo={},this._subtreePromises={}}Object.defineProperties(Gf.prototype,{url:{get:function(){return this._resource.url}},proxy:{get:function(){return this._resource.proxy}},resource:{get:function(){return this._resource}}});Gf.fromUrl=async function(e){let t=e;typeof t!="string"&&!(t instanceof De)&&(t=e.url);let n=De.createIfNeeded(t);n.appendForwardSlash();let i=new Gf;i._resource=n;try{await e4t(i),await i.getQuadTreePacket("",i._quadPacketVersion)}catch(r){let o=`An error occurred while accessing ${yFe(i,"",1).url}: ${r}`;throw new oe(o)}return i};Gf.tileXYToQuadKey=function(e,t,n){let i="";for(let r=n;r>=0;--r){let o=1<<r,s=0;Zl(t,o)?Zl(e,o)&&(s|=1):(s|=2,Zl(e,o)||(s|=1)),i+=s}return i};Gf.quadKeyToTileXY=function(e){let t=0,n=0,i=e.length-1;for(let r=i;r>=0;--r){let o=1<<r,s=+e[i-r];Zl(s,2)?Zl(s,1)||(t|=o):(n|=o,Zl(s,1)&&(t|=o))}return{x:t,y:n,level:i}};Gf.prototype.isValid=function(e){let t=this.getTileInformationFromQuadKey(e);if(l(t))return t!==null;let n=!0,i=e,r;for(;i.length>1;)if(r=i.substring(i.length-1),i=i.substring(0,i.length-1),t=this.getTileInformationFromQuadKey(i),l(t)){!t.hasSubtree()&&!t.hasChild(parseInt(r))&&(n=!1);break}else if(t===null){n=!1;break}return n};var _Fe=new $n("decodeGoogleEarthEnterprisePacket");Gf.prototype.getQuadTreePacket=function(e,t,n){t=t??1,e=e??"";let r=yFe(this,e,t,n).fetchArrayBuffer();if(!l(r))return;let o=this._tileInfo,s=this.key;return r.then(function(a){return _Fe.scheduleTask({buffer:a,quadKey:e,type:"Metadata",key:s},[a]).then(function(u){let f,d=-1;if(e!==""){d=e.length+1;let m=u[e];f=o[e],f._bits|=m._bits,delete u[e]}let p=Object.keys(u);p.sort(function(m,y){return m.length-y.length});let g=p.length;for(let m=0;m<g;++m){let y=p[m];if(u[y]!==null){let b=J9.clone(u[y]),x=y.length;if(x===d)b.setParent(f);else if(x>1){let T=o[y.substring(0,y.length-1)];b.setParent(T)}o[y]=b}else o[y]=null}})})};Gf.prototype.populateSubtree=function(e,t,n,i){let r=Gf.tileXYToQuadKey(e,t,n);return Lse(this,r,i)};function Lse(e,t,n){let i=e._tileInfo,r=t,o=i[r];if(l(o)&&(!o.hasSubtree()||o.hasChildren()))return o;for(;o===void 0&&r.length>1;)r=r.substring(0,r.length-1),o=i[r];let s,a=e._subtreePromises,c=a[r];if(l(c))return c.then(function(){return s=new Oo({throttle:n.throttle,throttleByServer:n.throttleByServer,type:n.type,priorityFunction:n.priorityFunction}),Lse(e,t,s)});if(!l(o)||!o.hasSubtree())return Promise.reject(new oe(`Couldn't load metadata for tile ${t}`));if(c=e.getQuadTreePacket(r,o.cnodeVersion,n),!!l(c))return a[r]=c,c.then(function(){return s=new Oo({throttle:n.throttle,throttleByServer:n.throttleByServer,type:n.type,priorityFunction:n.priorityFunction}),Lse(e,t,s)}).finally(function(){delete a[r]})}Gf.prototype.getTileInformation=function(e,t,n){let i=Gf.tileXYToQuadKey(e,t,n);return this._tileInfo[i]};Gf.prototype.getTileInformationFromQuadKey=function(e){return this._tileInfo[e]};function yFe(e,t,n,i){return e._resource.getDerivedResource({url:`flatfile?q2-0${t}-q.${n.toString()}`,request:i})}var Mse,Nse;function e4t(e){let t=e._resource.getDerivedResource({url:"dbRoot.v5",queryParameters:{output:"proto"}});if(!l(Nse)){let n=Zt("ThirdParty/google-earth-dbroot-parser.js"),i=window.cesiumGoogleEarthDbRootParser;Nse=SE(n).then(function(){Mse=window.cesiumGoogleEarthDbRootParser(JVt),l(i)?window.cesiumGoogleEarthDbRootParser=i:delete window.cesiumGoogleEarthDbRootParser})}return Nse.then(function(){return t.fetchArrayBuffer()}).then(function(n){let i=Mse.EncryptedDbRootProto.decode(new Uint8Array(n)),r=i.encryptionData,o=r.byteOffset,s=o+r.byteLength,a=e.key=r.buffer.slice(o,s);r=i.dbrootData,o=r.byteOffset,s=o+r.byteLength;let c=r.buffer.slice(o,s);return _Fe.scheduleTask({buffer:c,type:"DbRoot",key:a},[c])}).then(function(n){let i=Mse.DbRootProto.decode(new Uint8Array(n.buffer));if(e.imageryPresent=i.imageryPresent??e.imageryPresent,e.protoImagery=i.protoImagery,e.terrainPresent=i.terrainPresent??e.terrainPresent,l(i.endSnippet)&&l(i.endSnippet.model)){let a=i.endSnippet.model;e.negativeAltitudeExponentBias=a.negativeAltitudeExponentBias??e.negativeAltitudeExponentBias,e.negativeAltitudeThreshold=a.compressedNegativeAltitudeThreshold??e.negativeAltitudeThreshold}l(i.databaseVersion)&&(e._quadPacketVersion=i.databaseVersion.quadtreeVersion??e._quadPacketVersion);let r=e.providers,o=i.providerInfo??[],s=o.length;for(let a=0;a<s;++a){let c=o[a],u=c.copyrightString;l(u)&&(r[c.providerId]=new It(u.value))}}).catch(function(){console.log(`Failed to retrieve ${t.url}. Using defaults.`),e.key=QVt})}var tb=Gf;function iE(e){e=e??H.EMPTY_OBJECT,this._buffer=e.buffer,this._credits=e.credits,this._negativeAltitudeExponentBias=e.negativeAltitudeExponentBias,this._negativeElevationThreshold=e.negativeElevationThreshold;let t=e.childTileMask??15,n=t&3;n|=t&4?8:0,n|=t&8?4:0,this._childTileMask=n,this._createdByUpsampling=e.createdByUpsampling??!1,this._skirtHeight=void 0,this._bufferType=this._buffer.constructor,this._mesh=void 0,this._minimumHeight=void 0,this._maximumHeight=void 0}Object.defineProperties(iE.prototype,{credits:{get:function(){return this._credits}},waterMask:{get:function(){}}});var xFe="createVerticesFromGoogleEarthEnterpriseBuffer",t4t=new $n(xFe),n4t=new $n(xFe,Lf.maximumAsynchronousTasks),AFe=new ie,Z9=new ie;iE.prototype.createMesh=function(e){e=e??H.EMPTY_OBJECT;let t=e.tilingScheme,n=e.x,i=e.y,r=e.level,o=e.exaggeration??1,s=e.exaggerationRelativeHeight??0,a=e.throttle??!0,c=t.ellipsoid;t.tileXYToNativeRectangle(n,i,r,AFe),t.tileXYToRectangle(n,i,r,Z9);let u=c.cartographicToCartesian(ie.center(Z9)),d=40075.16/(1<<r);this._skirtHeight=Math.min(d*8,1e3);let g=(a?n4t:t4t).scheduleTask({buffer:this._buffer,nativeRectangle:AFe,rectangle:Z9,relativeToCenter:u,ellipsoid:c,skirtHeight:this._skirtHeight,exaggeration:o,exaggerationRelativeHeight:s,includeWebMercatorT:!0,negativeAltitudeExponentBias:this._negativeAltitudeExponentBias,negativeElevationThreshold:this._negativeElevationThreshold});if(!l(g))return;let m=this;return g.then(function(y){return m._mesh=new Ic(u,new Float32Array(y.vertices),new Uint16Array(y.indices),y.indexCountWithoutSkirts,y.vertexCountWithoutSkirts,y.minimumHeight,y.maximumHeight,Z9,ue.clone(y.boundingSphere3D),h.clone(y.occludeePointInScaledSpace),y.numberOfAttributes,en.clone(y.orientedBoundingBox),Ro.clone(y.encoding),y.westIndicesSouthToNorth,y.southIndicesEastToWest,y.eastIndicesNorthToSouth,y.northIndicesWestToEast),m._minimumHeight=y.minimumHeight,m._maximumHeight=y.maximumHeight,m._buffer=void 0,m._mesh})};iE.prototype.interpolateHeight=function(e,t,n){let i=P.clamp((t-e.west)/e.width,0,1),r=P.clamp((n-e.south)/e.height,0,1);return l(this._mesh)?a4t(this,i,r):u4t(this,i,r,e)};var i4t=new $n("upsampleQuantizedTerrainMesh",Lf.maximumAsynchronousTasks);iE.prototype.upsample=function(e,t,n,i,r,o,s){let a=this._mesh;if(!l(this._mesh))return;let c=t*2!==r,u=n*2===o,f=e.ellipsoid,d=e.tileXYToRectangle(r,o,s),p=i4t.scheduleTask({vertices:a.vertices,indices:a.indices,indexCountWithoutSkirts:a.indexCountWithoutSkirts,vertexCountWithoutSkirts:a.vertexCountWithoutSkirts,encoding:a.encoding,minimumHeight:this._minimumHeight,maximumHeight:this._maximumHeight,isEastChild:c,isNorthChild:u,childRectangle:d,ellipsoid:f});if(!l(p))return;let g=this;return p.then(function(m){let y=new Uint16Array(m.vertices),A=je.createTypedArray(y.length/3,m.indices),b=g._skirtHeight;return new mI({quantizedVertices:y,indices:A,minimumHeight:m.minimumHeight,maximumHeight:m.maximumHeight,boundingSphere:ue.clone(m.boundingSphere),orientedBoundingBox:en.clone(m.orientedBoundingBox),horizonOcclusionPoint:h.clone(m.horizonOcclusionPoint),westIndices:m.westIndices,southIndices:m.southIndices,eastIndices:m.eastIndices,northIndices:m.northIndices,westSkirtHeight:b,southSkirtHeight:b,eastSkirtHeight:b,northSkirtHeight:b,childTileMask:0,createdByUpsampling:!0,credits:g._credits})})};iE.prototype.isChildAvailable=function(e,t,n,i){let r=2;return n!==e*2&&++r,i!==t*2&&(r-=2),(this._childTileMask&1<<r)!==0};iE.prototype.wasCreatedByUpsampling=function(){return this._createdByUpsampling};var r4t=new U,o4t=new U,s4t=new U,TFe=new h;function a4t(e,t,n){let i=e._mesh,r=i.vertices,o=i.encoding,s=i.indices;for(let a=0,c=s.length;a<c;a+=3){let u=s[a],f=s[a+1],d=s[a+2],p=o.decodeTextureCoordinates(r,u,r4t),g=o.decodeTextureCoordinates(r,f,o4t),m=o.decodeTextureCoordinates(r,d,s4t),y=y0.computeBarycentricCoordinates(t,n,p.x,p.y,g.x,g.y,m.x,m.y,TFe);if(y.x>=-1e-15&&y.y>=-1e-15&&y.z>=-1e-15){let A=o.decodeHeight(r,u),b=o.decodeHeight(r,f),x=o.decodeHeight(r,d);return y.x*A+y.y*b+y.z*x}}}var c4t=Uint16Array.BYTES_PER_ELEMENT,bFe=Uint32Array.BYTES_PER_ELEMENT,Fse=Int32Array.BYTES_PER_ELEMENT,l4t=Float32Array.BYTES_PER_ELEMENT,Bse=Float64Array.BYTES_PER_ELEMENT;function u4t(e,t,n,i){let r=e._buffer,o=0,s=0,a=0;n>.5?(t>.5?(o=2,s=.5):o=3,a=.5):t>.5&&(o=1,s=.5);let c=new DataView(r),u=0;for(let v=0;v<o;++v)u+=c.getUint32(u,!0),u+=bFe;u+=bFe,u+=2*Bse;let f=P.toRadians(c.getFloat64(u,!0)*180);u+=Bse;let d=P.toRadians(c.getFloat64(u,!0)*180);u+=Bse;let p=i.width/f/2,g=i.height/d/2,m=c.getInt32(u,!0);u+=Fse;let y=c.getInt32(u,!0)*3;u+=Fse,u+=Fse;let A=new Array(m),b=new Array(m),x=new Array(m),T;for(T=0;T<m;++T)A[T]=s+c.getUint8(u++)*p,b[T]=a+c.getUint8(u++)*g,x[T]=c.getFloat32(u,!0)*6371010,u+=l4t;let E=new Array(y);for(T=0;T<y;++T)E[T]=c.getUint16(u,!0),u+=c4t;for(T=0;T<y;T+=3){let v=E[T],S=E[T+1],I=E[T+2],R=A[v],O=A[S],L=A[I],_=b[v],C=b[S],w=b[I],D=y0.computeBarycentricCoordinates(t,n,R,_,O,C,L,w,TFe);if(D.x>=-1e-15&&D.y>=-1e-15&&D.z>=-1e-15)return D.x*x[v]+D.y*x[S]+D.z*x[I]}}var DM=iE;var rh={UNKNOWN:0,NONE:1,SELF:2,PARENT:3},Q9=new K;function e7(){this._terrainCache={},this._lastTidy=K.now()}e7.prototype.add=function(e,t){this._terrainCache[e]={buffer:t,timestamp:K.now()}};e7.prototype.get=function(e){let n=this._terrainCache[e];if(l(n))return delete this._terrainCache[e],n.buffer};e7.prototype.tidy=function(){if(K.now(Q9),K.secondsDifference(Q9,this._lastTidy)>10){let e=this._terrainCache,t=Object.keys(e),n=t.length;for(let i=0;i<n;++i){let r=t[i],o=e[r];K.secondsDifference(Q9,o.timestamp)>10&&delete e[r]}K.clone(Q9,this._lastTidy)}};function nb(e){e=e??H.EMPTY_OBJECT,this._tilingScheme=new rr({numberOfLevelZeroTilesX:2,numberOfLevelZeroTilesY:2,rectangle:new ie(-P.PI,-P.PI,P.PI,P.PI),ellipsoid:e.ellipsoid});let t=e.credit;typeof t=="string"&&(t=new It(t)),this._credit=t,this._levelZeroMaximumGeometricError=40075.16,this._terrainCache=new e7,this._terrainPromises={},this._terrainRequests={},this._errorEvent=new be}Object.defineProperties(nb.prototype,{url:{get:function(){return this._metadata.url}},proxy:{get:function(){return this._metadata.proxy}},tilingScheme:{get:function(){return this._tilingScheme}},errorEvent:{get:function(){return this._errorEvent}},credit:{get:function(){return this._credit}},hasWaterMask:{get:function(){return!1}},hasVertexNormals:{get:function(){return!1}},availability:{get:function(){}}});nb.fromMetadata=function(e,t){if(!e.terrainPresent)throw new oe(`The server ${e.url} doesn't have terrain`);let n=new nb(t);return n._metadata=e,n};var f4t=new $n("decodeGoogleEarthEnterprisePacket");function EFe(e,t,n){let i=t.getChildBitmask();if(t.terrainState===rh.PARENT){i=0;for(let r=0;r<4;++r){let o=n.getTileInformationFromQuadKey(e+r.toString());l(o)&&o.hasTerrain()&&(i|=1<<r)}}return i}nb.prototype.requestTileGeometry=function(e,t,n,i){let r=tb.tileXYToQuadKey(e,t,n),o=this._terrainCache,s=this._metadata,a=s.getTileInformationFromQuadKey(r);if(!l(a))return Promise.reject(new oe("Terrain tile doesn't exist"));let c=a.terrainState;l(c)||(c=a.terrainState=rh.UNKNOWN);let u=o.get(r);if(l(u)){let b=s.providers[a.terrainProvider];return Promise.resolve(new DM({buffer:u,childTileMask:EFe(r,a,s),credits:l(b)?[b]:void 0,negativeAltitudeExponentBias:s.negativeAltitudeExponentBias,negativeElevationThreshold:s.negativeAltitudeThreshold}))}if(o.tidy(),a.ancestorHasTerrain){if(c===rh.NONE)return Promise.reject(new oe("Terrain tile doesn't exist"))}else return Promise.resolve(new ll({buffer:new Uint8Array(256),width:16,height:16}));let f,d=r,p=-1;switch(c){case rh.SELF:p=a.terrainVersion;break;case rh.PARENT:d=d.substring(0,d.length-1),f=s.getTileInformationFromQuadKey(d),p=f.terrainVersion;break;case rh.UNKNOWN:a.hasTerrain()?p=a.terrainVersion:(d=d.substring(0,d.length-1),f=s.getTileInformationFromQuadKey(d),l(f)&&f.hasTerrain()&&(p=f.terrainVersion));break}if(p<0)return Promise.reject(new oe("Terrain tile doesn't exist"));let g=this._terrainPromises,m=this._terrainRequests,y,A;if(l(g[d]))y=g[d],A=m[d];else{A=i;let b=d4t(this,d,p,A).fetchArrayBuffer();if(!l(b))return;y=b.then(function(x){return l(x)?f4t.scheduleTask({buffer:x,type:"Terrain",key:s.key},[x]).then(function(T){let E=s.getTileInformationFromQuadKey(d);E.terrainState=rh.SELF,o.add(d,T[0]);let v=E.terrainProvider,S=T.length-1;for(let I=0;I<S;++I){let R=d+I.toString(),O=s.getTileInformationFromQuadKey(R);l(O)&&(o.add(R,T[I+1]),O.terrainState=rh.PARENT,O.terrainProvider===0&&(O.terrainProvider=v))}}):Promise.reject(new oe("Failed to load terrain."))}),g[d]=y,m[d]=A,y=y.finally(function(){delete g[d],delete m[d]})}return y.then(function(){let b=o.get(r);if(l(b)){let x=s.providers[a.terrainProvider];return new DM({buffer:b,childTileMask:EFe(r,a,s),credits:l(x)?[x]:void 0,negativeAltitudeExponentBias:s.negativeAltitudeExponentBias,negativeElevationThreshold:s.negativeAltitudeThreshold})}return Promise.reject(new oe("Failed to load terrain."))}).catch(function(b){return A.state===wi.CANCELLED?(i.state=A.state,Promise.reject(b)):(a.terrainState=rh.NONE,Promise.reject(b))})};nb.prototype.getLevelMaximumGeometricError=function(e){return this._levelZeroMaximumGeometricError/(1<<e)};nb.prototype.getTileDataAvailable=function(e,t,n){let i=this._metadata,r=tb.tileXYToQuadKey(e,t,n),o=i.getTileInformation(e,t,n);if(o===null)return!1;if(l(o)){if(!o.ancestorHasTerrain)return!0;let s=o.terrainState;if(s===rh.NONE)return!1;if((!l(s)||s===rh.UNKNOWN)&&(o.terrainState=rh.UNKNOWN,!o.hasTerrain())){r=r.substring(0,r.length-1);let a=i.getTileInformationFromQuadKey(r);if(!l(a)||!a.hasTerrain())return!1}return!0}if(i.isValid(r)){let s=new Oo({throttle:!1,throttleByServer:!0,type:oa.TERRAIN});i.populateSubtree(e,t,n,s)}return!1};nb.prototype.loadTileDataAvailability=function(e,t,n){};function d4t(e,t,n,i){return n=l(n)&&n>0?n:1,e._metadata.resource.getDerivedResource({url:`flatfile?f1c-0${t}-t.${n.toString()}`,request:i})}var CFe=nb;var h4t="https://maps.googleapis.com/maps/api/geocode/json",vFe='<img alt="Google" src="https://assets.ion.cesium.com/google-credit.png" style="vertical-align:-5px">';function kse(e){e=e??H.EMPTY_OBJECT;let t=e.key;this._resource=new De({url:h4t,queryParameters:{key:t}}),this._credit=new It(vFe,!0)}Object.defineProperties(kse.prototype,{credit:{get:function(){return this._credit}}});kse.prototype.geocode=async function(e){let n=await this._resource.getDerivedResource({queryParameters:{address:e}}).fetchJson();if(n.status==="ZERO_RESULTS")return[];if(n.status!=="OK")throw new oe(`GoogleGeocoderService got a bad response ${n.status}: ${n.error_message}`);return n.results.map(r=>{let o=r.geometry.viewport.southwest,s=r.geometry.viewport.northeast;return{displayName:r.formatted_address,destination:ie.fromDegrees(o.lng,o.lat,s.lng,s.lat),attribution:{html:vFe,collapsible:!1}}})};var SFe=kse;var Use=class{constructor(){ut(this,"type")}getRequiredDataPoints(t){pe.throwInstantiationError()}interpolateOrderZero(t,n,i,r,o){pe.throwInstantiationError()}interpolate(t,n,i,r,o,s,a){pe.throwInstantiationError()}},wFe=Use;var IFe={GOOGLE:"GOOGLE",BING:"BING",DEFAULT:"DEFAULT"};Object.freeze(IFe);var ib=IFe;function zse(e){this._url=De.createIfNeeded(e),this._url.appendForwardSlash()}Object.defineProperties(zse.prototype,{url:{get:function(){return this._url}},credit:{get:function(){}}});zse.prototype.geocode=async function(e,t){return this._url.getDerivedResource({url:t===nE.AUTOCOMPLETE?"autocomplete":"search",queryParameters:{text:e}}).fetchJson().then(function(i){return i.features.map(function(r){let o,s=r.bbox;if(l(s))o=ie.fromDegrees(s[0],s[1],s[2],s[3]);else{let a=r.geometry.coordinates[0],c=r.geometry.coordinates[1];o=h.fromDegrees(a,c)}return{displayName:r.properties.label,destination:o,attributions:i.attributions}})})};var t7=zse;function m4t(e){if(!Object.values(ib).some(t=>t===e))throw new pe(`Invalid geocodeProviderType: "${e}"`)}var PFe=Object.freeze({[ib.GOOGLE]:"google",[ib.BING]:"bing",[ib.DEFAULT]:void 0});function p4t(e){return PFe[e]}function g4t(e){return Object.entries(PFe).find(t=>t[1]===e)[0]}function Vse(e){e=e??H.EMPTY_OBJECT;let t=e.geocodeProviderType??ib.DEFAULT,n=e.accessToken??uf.defaultAccessToken,i=De.createIfNeeded(e.server??uf.defaultServer);i.appendForwardSlash();let r=uf.getDefaultTokenCredit(n);l(r)&&e.scene.frameState.creditDisplay.addStaticCredit(It.clone(r));let o=i.getDerivedResource({url:"v1/geocode"});l(n)&&o.appendQueryParameters({access_token:n}),this._accessToken=n,this._server=i,this._pelias=new t7(o),this.geocodeProviderType=t}Object.defineProperties(Vse.prototype,{credit:{get:function(){}},geocodeProviderType:{get:function(){return g4t(this._pelias.url.queryParameters.geocoder)},set:function(e){m4t(e);let t={...this._pelias.url.queryParameters,geocoder:p4t(e)};l(t.geocoder)||delete t.geocoder,this._pelias.url.setQueryParameters(t)}}});Vse.prototype.geocode=async function(e,t){return this._pelias.geocode(e,t)};var AI=Vse;var DFe={NONE:0,POINT:1,SEGMENT:2,CURVE:3,ARC:4,SURFACE:5};Object.freeze(DFe);var RFe=DFe;var OFe={NONE:0,NOT_IN_RANGE:1,IN_RANGE:2};Object.freeze(OFe);var MFe=OFe;var NFe={NEAREST:1,NEAREST_KEYPOINT:2,CENTER:8};Object.freeze(NFe);var n7=NFe;var LFe={NONE:0,WIRE:1,SHEET:2,SOLID:3,MESH:4,TEXT:5};Object.freeze(LFe);var FFe=LFe;function BFe(e){if(!(!l(e)||!l(e.longitude)||!l(e.latitude)))return h.fromDegrees(e.longitude,e.latitude,e.height??0)}function kFe(e){let t=he.fromCartesian(e);return{longitude:P.toDegrees(t.longitude),latitude:P.toDegrees(t.latitude),height:t.height}}function _4t(e){let t=[],n=new se;for(let i=0;i<4;i++)M.getRow(e,i,n),t.push([n.x,n.y,n.z,n.w]);return t}function y4t(e,t,n){return M.fromRowMajorArray([e/2,0,0,e/2,0,-t/2,0,t/2,0,0,.5,.5,0,0,0,1],n)}var A4t=new M,b4t=new M,i7=class e{constructor(t){this._assetId=t.assetId,this._resource=t.resource,this.ecefTransform=t.ecefTransform}get assetId(){return this._assetId}static async fromAssetId(t,n){n=n??H.EMPTY_OBJECT;let i=n.accessToken??uf.defaultAccessToken,r=De.createIfNeeded(n.server??uf.defaultServer);r.appendForwardSlash();let o={url:`assets/${t}/`,headers:Yo._addClientHeaders()};l(i)&&(o.queryParameters={access_token:i});let s=r.getDerivedResource(o),a=await s.getDerivedResource({url:"ecef"}).fetchJson();if(!l(a?.ecefTransform))throw new oe(`Cesium ion asset ${t} is not geolocated; snapping requires geolocation`);let c=M.fromRowMajorArray(a.ecefTransform.flat());return new e({assetId:t,resource:s,ecefTransform:c})}_computeWorldToView(t,n,i,r){r=r??new M;let o=y4t(n,i,A4t);return M.multiply(t.viewMatrix,this.ecefTransform,r),M.multiply(t.frustum.projectionMatrix,r,r),M.multiply(o,r,r)}async snap(t){let n=this._computeWorldToView(t.camera,t.canvasWidth,t.canvasHeight,b4t),i={testPoint:kFe(t.testPoint),closePoint:kFe(t.closePoint??t.testPoint),snapAperture:t.snapAperture??e.DEFAULT_SNAP_APERTURE,snapMode:t.snapMode??n7.NEAREST,worldToView:_4t(n)},r;try{r=await this._resource.getDerivedResource({url:`elements/${t.elementId}/snap`}).post(JSON.stringify(i),{headers:{"Content-Type":"application/json"},responseType:"json"})}catch(s){if(s?.statusCode===404||s?.statusCode===400&&typeof s.response?.message=="string"&&s.response.message.includes("No snap possible"))return;throw s}if(!l(r))return;let o={heat:r.heat,geometryType:r.geomType,parentGeometryType:r.parentGeomType,normal:r.normal,curve:r.curve};return o.snapPoint=BFe(r.snapPoint),o.hitPoint=BFe(r.hitPoint),o}};i7.DEFAULT_SNAP_APERTURE=12;var UFe=i7;var ea={};ea.ExportStatus=Object.freeze({NotStarted:"NotStarted",InProgress:"InProgress",Complete:"Complete",Invalid:"Invalid"});ea.ExportType=Object.freeze({IMODEL:"IMODEL",CESIUM:"CESIUM","3DTILES":"3DTILES"});ea.RealityDataType=Object.freeze({Cesium3DTiles:"Cesium3DTiles",PNTS:"PNTS",RealityMesh3DTiles:"RealityMesh3DTiles",Terrain3DTiles:"Terrain3DTiles",GaussianSplat3DTiles:"GS_3DT",KML:"KML",GeoJSON:"GeoJSON",Unstructured:"Unstructured"});ea.defaultAccessToken=void 0;ea.defaultShareKey=void 0;ea._getAuthorizationHeader=function(){return l(ea.defaultShareKey)?`Basic ${ea.defaultShareKey}`:`Bearer ${ea.defaultAccessToken}`};ea.apiEndpoint=new De({url:"https://api.bentley.com"});ea.getExports=async function(e,t){let n=new De({url:`${ea.apiEndpoint}mesh-export`,headers:{Authorization:ea._getAuthorizationHeader(),Accept:"application/vnd.bentley.itwin-platform.v1+json",Prefer:"return=representation"},queryParameters:{iModelId:e,exportType:ea.ExportType["3DTILES"],$top:"5",client:"CesiumJS"}});typeof CESIUM_VERSION<"u"&&n.appendQueryParameters({clientVersion:CESIUM_VERSION}),l(t)&&t!==""&&n.appendQueryParameters({changesetId:t});try{return await n.fetchJson()}catch(i){let r=JSON.parse(i.response);if(i.statusCode===401){let o=r.error.details?.[0].code??"";throw new oe(`Unauthorized, bad token, wrong scopes or headers bad. ${o}`)}else{if(i.statusCode===403)throw console.error(r.error.code,r.error.message),new oe("Not allowed, forbidden");if(i.statusCode===422)throw new oe(`Unprocessable Entity:${r.error.code} ${r.error.message}`);if(i.statusCode===429)throw new oe("Too many requests")}throw new oe(`Unknown request failure ${i.statusCode}`)}};ea.getRealityDataMetadata=async function(e,t){let n=new De({url:`${ea.apiEndpoint}reality-management/reality-data/${t}`,headers:{Authorization:ea._getAuthorizationHeader(),Accept:"application/vnd.bentley.itwin-platform.v1+json"},queryParameters:{iTwinId:e}});try{return(await n.fetchJson()).realityData}catch(i){let r=JSON.parse(i.response);if(i.statusCode===401){let o=r.error.details?.[0].code??"";throw new oe(`Unauthorized, bad token, wrong scopes or headers bad. ${o}`)}else{if(i.statusCode===403)throw console.error(r.error.code,r.error.message),new oe("Not allowed, forbidden");if(i.statusCode===404)throw new oe(`Reality data not found: ${e}, ${t}`);if(i.statusCode===422)throw new oe(`Unprocessable Entity:${r.error.code} ${r.error.message}`);if(i.statusCode===429)throw new oe("Too many requests")}throw new oe(`Unknown request failure ${i.statusCode}`)}};ea.getRealityDataURL=async function(e,t,n){let i=new De({url:`${ea.apiEndpoint}reality-management/reality-data/${t}/readaccess`,headers:{Authorization:ea._getAuthorizationHeader(),Accept:"application/vnd.bentley.itwin-platform.v1+json"},queryParameters:{iTwinId:e}});try{let o=(await i.fetchJson())._links.containerUrl.href,s=new URL(o);return s.pathname=`${s.pathname}/${n}`,s.toString()}catch(r){let o=JSON.parse(r.response);if(r.statusCode===401){let s=o.error.details?.[0].code??"";throw new oe(`Unauthorized, bad token, wrong scopes or headers bad. ${s}`)}else{if(r.statusCode===403)throw console.error(o.error.code,o.error.message),new oe("Not allowed, forbidden");if(r.statusCode===404)throw new oe(`Reality data not found: ${e}, ${t}`);if(r.statusCode===422)throw new oe(`Unprocessable Entity:${o.error.code} ${o.error.message}`);if(r.statusCode===429)throw new oe("Too many requests")}throw new oe(`Unknown request failure ${r.statusCode}`)}};var Ea=ea;var jse=class{constructor(){ut(this,"ellipsoid")}project(t,n){pe.throwInstantiationError()}unproject(t,n){pe.throwInstantiationError()}},zFe=jse;function bI(e){e=e??H.EMPTY_OBJECT;let t=e.weights,n=e.times;this._times=n,this._weights=t,this._count=t.length/n.length,this._lastTimeIndex=0}Object.defineProperties(bI.prototype,{times:{get:function(){return this._times}},weights:{get:function(){return this._weights}}});bI.prototype.findTimeInterval=Or.prototype.findTimeInterval;bI.prototype.wrapTime=Or.prototype.wrapTime;bI.prototype.clampTime=Or.prototype.clampTime;bI.prototype.evaluate=function(e,t){let n=this.weights,i=this.times,r=this._lastTimeIndex=this.findTimeInterval(e,this._lastTimeIndex),o=(e-i[r])/(i[r+1]-i[r]);l(t)||(t=new Array(this._count));for(let s=0;s<this._count;s++){let a=r*this._count+s;t[s]=n[a]*(1-o)+n[a+this._count]*o}return t};var VFe=bI;function Hse(e,t,n){e=De.createIfNeeded(e),e.appendForwardSlash(),e.setQueryParameters({key:t}),this._url=e,this._params=n??{},this._credit=new It('Geodata copyright <a href="https://www.openstreetmap.org/">OpenStreetMap</a> contributors',!1)}Object.defineProperties(Hse.prototype,{url:{get:function(){return this._url}},params:{get:function(){return this._params}},credit:{get:function(){return this._credit}}});Hse.prototype.geocode=async function(e){return this._url.getDerivedResource({url:"json",queryParameters:Mt(this._params,{q:e})}).fetchJson().then(function(n){return n.results.map(function(i){let r,o=i.bounds;if(l(o))r=ie.fromDegrees(o.southwest.lng,o.southwest.lat,o.northeast.lng,o.northeast.lat);else{let{lng:s,lat:a}=i.geometry;r=h.fromDegrees(s,a)}return{displayName:i.formatted,destination:r}})})};var jFe=Hse;var x4t={packedLength:void 0,pack:pe.throwInstantiationError,unpack:pe.throwInstantiationError},HFe=x4t;var T4t={packedInterpolationLength:void 0,convertPackedArrayForInterpolation:pe.throwInstantiationError,unpackInterpolationResult:pe.throwInstantiationError},GFe=T4t;var E4t=new h;function C4t(e,t,n,i){let r=BE(e,t,n,i,E4t);return l(r)?r.x>0&&r.y>0&&r.z>0:!1}var WFe=C4t;function qFe(){pe.throwInstantiationError()}qFe.prototype.getURL=pe.throwInstantiationError;var YFe=qFe;function v4t(e,t,n,i,r,o,s){let a=lr.numberOfPoints(e,t,r),c,u=n.red,f=n.green,d=n.blue,p=n.alpha,g=i.red,m=i.green,y=i.blue,A=i.alpha;if(z.equals(n,i)){for(c=0;c<a;c++)o[s++]=z.floatToByte(u),o[s++]=z.floatToByte(f),o[s++]=z.floatToByte(d),o[s++]=z.floatToByte(p);return s}let b=(g-u)/a,x=(m-f)/a,T=(y-d)/a,E=(A-p)/a,v=s;for(c=0;c<a;c++)o[v++]=z.floatToByte(u+c*b),o[v++]=z.floatToByte(f+c*x),o[v++]=z.floatToByte(d+c*T),o[v++]=z.floatToByte(p+c*E);return v}function RM(e){e=e??H.EMPTY_OBJECT;let t=e.positions,n=e.colors,i=e.colorsPerVertex??!1;this._positions=t,this._colors=n,this._colorsPerVertex=i,this._arcType=e.arcType??ln.GEODESIC,this._granularity=e.granularity??P.RADIANS_PER_DEGREE,this._ellipsoid=e.ellipsoid??ee.default,this._workerName="createSimplePolylineGeometry";let r=1+t.length*h.packedLength;r+=l(n)?1+n.length*z.packedLength:1,this.packedLength=r+ee.packedLength+3}RM.pack=function(e,t,n){n=n??0;let i,r=e._positions,o=r.length;for(t[n++]=o,i=0;i<o;++i,n+=h.packedLength)h.pack(r[i],t,n);let s=e._colors;for(o=l(s)?s.length:0,t[n++]=o,i=0;i<o;++i,n+=z.packedLength)z.pack(s[i],t,n);return ee.pack(e._ellipsoid,t,n),n+=ee.packedLength,t[n++]=e._colorsPerVertex?1:0,t[n++]=e._arcType,t[n]=e._granularity,t};RM.unpack=function(e,t,n){t=t??0;let i,r=e[t++],o=new Array(r);for(i=0;i<r;++i,t+=h.packedLength)o[i]=h.unpack(e,t);r=e[t++];let s=r>0?new Array(r):void 0;for(i=0;i<r;++i,t+=z.packedLength)s[i]=z.unpack(e,t);let a=ee.unpack(e,t);t+=ee.packedLength;let c=e[t++]===1,u=e[t++],f=e[t];return l(n)?(n._positions=o,n._colors=s,n._ellipsoid=a,n._colorsPerVertex=c,n._arcType=u,n._granularity=f,n):new RM({positions:o,colors:s,ellipsoid:a,colorsPerVertex:c,arcType:u,granularity:f})};var r7=new Array(2),o7=new Array(2),S4t={positions:r7,height:o7,ellipsoid:void 0,minDistance:void 0,granularity:void 0};RM.createGeometry=function(e){let t=e._positions,n=e._colors,i=e._colorsPerVertex,r=e._arcType,o=e._granularity,s=e._ellipsoid,a=P.chordLength(o,s.maximumRadius),c=l(n)&&!i,u,f=t.length,d,p,g,m,y=0;if(r===ln.GEODESIC||r===ln.RHUMB){let E,v,S;r===ln.GEODESIC?(E=P.chordLength(o,s.maximumRadius),v=lr.numberOfPoints,S=lr.generateArc):(E=o,v=lr.numberOfPointsRhumbLine,S=lr.generateRhumbArc);let I=lr.extractHeights(t,s),R=S4t;if(r===ln.GEODESIC?R.minDistance=a:R.granularity=o,R.ellipsoid=s,c){let O=0;for(u=0;u<f-1;u++)O+=v(t[u],t[u+1],E)+1;d=new Float64Array(O*3),g=new Uint8Array(O*4),R.positions=r7,R.height=o7;let L=0;for(u=0;u<f-1;++u){r7[0]=t[u],r7[1]=t[u+1],o7[0]=I[u],o7[1]=I[u+1];let _=S(R);if(l(n)){let C=_.length/3;m=n[u];for(let w=0;w<C;++w)g[L++]=z.floatToByte(m.red),g[L++]=z.floatToByte(m.green),g[L++]=z.floatToByte(m.blue),g[L++]=z.floatToByte(m.alpha)}d.set(_,y),y+=_.length}}else if(R.positions=t,R.height=I,d=new Float64Array(S(R)),l(n)){for(g=new Uint8Array(d.length/3*4),u=0;u<f-1;++u){let L=t[u],_=t[u+1],C=n[u],w=n[u+1];y=v4t(L,_,C,w,a,g,y)}let O=n[f-1];g[y++]=z.floatToByte(O.red),g[y++]=z.floatToByte(O.green),g[y++]=z.floatToByte(O.blue),g[y]=z.floatToByte(O.alpha)}}else{p=c?f*2-2:f,d=new Float64Array(p*3),g=l(n)?new Uint8Array(p*4):void 0;let E=0,v=0;for(u=0;u<f;++u){let S=t[u];if(c&&u>0&&(h.pack(S,d,E),E+=3,m=n[u-1],g[v++]=z.floatToByte(m.red),g[v++]=z.floatToByte(m.green),g[v++]=z.floatToByte(m.blue),g[v++]=z.floatToByte(m.alpha)),c&&u===f-1)break;h.pack(S,d,E),E+=3,l(n)&&(m=n[u],g[v++]=z.floatToByte(m.red),g[v++]=z.floatToByte(m.green),g[v++]=z.floatToByte(m.blue),g[v++]=z.floatToByte(m.alpha))}}let A=new En;A.position=new Ne({componentDatatype:Y.DOUBLE,componentsPerAttribute:3,values:d}),l(n)&&(A.color=new Ne({componentDatatype:Y.UNSIGNED_BYTE,componentsPerAttribute:4,values:g,normalize:!0})),p=d.length/3;let b=(p-1)*2,x=je.createTypedArray(p,b),T=0;for(u=0;u<p-1;++u)x[T++]=u,x[T++]=u+1;return new wt({attributes:A,indices:x,primitiveType:Oe.LINES,boundingSphere:ue.fromPoints(t)})};var XFe=RM;var s7=class{constructor(){pe.throwInstantiationError()}async snap(t){pe.throwInstantiationError()}};s7.DEFAULT_SNAP_APERTURE=void 0;var KFe=s7;function xI(e){let t=e.radius??1,i={radii:new h(t,t,t),stackPartitions:e.stackPartitions,slicePartitions:e.slicePartitions,vertexFormat:e.vertexFormat};this._ellipsoidGeometry=new ac(i),this._workerName="createSphereGeometry"}xI.packedLength=ac.packedLength;xI.pack=function(e,t,n){return ac.pack(e._ellipsoidGeometry,t,n)};var w4t=new ac,rb={radius:void 0,radii:new h,vertexFormat:new Be,stackPartitions:void 0,slicePartitions:void 0};xI.unpack=function(e,t,n){let i=ac.unpack(e,t,w4t);return rb.vertexFormat=Be.clone(i._vertexFormat,rb.vertexFormat),rb.stackPartitions=i._stackPartitions,rb.slicePartitions=i._slicePartitions,l(n)?(h.clone(i._radii,rb.radii),n._ellipsoidGeometry=new ac(rb),n):(rb.radius=i._radii.x,new xI(rb))};xI.createGeometry=function(e){return ac.createGeometry(e._ellipsoidGeometry)};var a7=xI;function I4t(e){return e<=.04045?e*.07739938080495357:Math.pow((e+.055)*.9478672985781991,2.4)}var TI=I4t;var Gse=class{constructor(t){ut(this,"ellipsoid");ut(this,"rectangle");ut(this,"projection")}getNumberOfXTilesAtLevel(t){pe.throwInstantiationError()}getNumberOfYTilesAtLevel(t){pe.throwInstantiationError()}rectangleToNativeRectangle(t,n){pe.throwInstantiationError()}tileXYToNativeRectangle(t,n,i,r){pe.throwInstantiationError()}tileXYToRectangle(t,n,i,r){pe.throwInstantiationError()}positionToTileXY(t,n,i){pe.throwInstantiationError()}},$Fe=Gse;function rE(e){e=e??H.EMPTY_OBJECT,this._clock=void 0,this._element=void 0,this._clockSubscription=void 0,this._seekFunction=void 0,this._lastPlaybackRate=void 0,this.clock=e.clock,this.element=e.element,this.epoch=e.epoch??nt.MINIMUM_VALUE,this.tolerance=e.tolerance??1,this._seeking=!1,this._seekFunction=void 0,this._firstTickAfterSeek=!1}Object.defineProperties(rE.prototype,{clock:{get:function(){return this._clock},set:function(e){let t=this._clock;t!==e&&(l(t)&&(this._clockSubscription(),this._clockSubscription=void 0),l(e)&&(this._clockSubscription=e.onTick.addEventListener(rE.prototype._onTick,this)),this._clock=e)}},element:{get:function(){return this._element},set:function(e){let t=this._element;t!==e&&(l(t)&&t.removeEventListener("seeked",this._seekFunction,!1),l(e)&&(this._seeking=!1,this._seekFunction=P4t(this),e.addEventListener("seeked",this._seekFunction,!1)),this._element=e,this._seeking=!1,this._firstTickAfterSeek=!1)}}});rE.prototype.destroy=function(){return this.element=void 0,this.clock=void 0,le(this)};rE.prototype.isDestroyed=function(){return!1};rE.prototype._trySetPlaybackRate=function(e){if(this._lastPlaybackRate===e.multiplier)return;let t=this._element;try{t.playbackRate=e.multiplier}catch{t.playbackRate=0}this._lastPlaybackRate=e.multiplier};rE.prototype._onTick=function(e){let t=this._element;if(!l(t)||t.readyState<2)return;let n=t.paused,i=e.shouldAnimate;if(i===n&&(i?t.play():t.pause()),this._seeking||this._firstTickAfterSeek){this._firstTickAfterSeek=!1;return}this._trySetPlaybackRate(e);let r=e.currentTime,o=this.epoch??nt.MINIMUM_VALUE,s=K.secondsDifference(r,o),a=t.duration,c,u=t.currentTime;t.loop?(s=s%a,s<0&&(s=a-s),c=s):s>a?c=a:s<0?c=0:c=s;let f=i?this.tolerance??1:.001;Math.abs(c-u)>f&&(this._seeking=!0,t.currentTime=c)};function P4t(e){return function(){e._seeking=!1,e._firstTickAfterSeek=!0}}var JFe=rE;function D4t(e,t){this.rectangle=e,this.maxLevel=t}function ZFe(e){this.ellipsoid=e.ellipsoid??ee.default,this.tilingScheme=void 0,this.heightmapWidth=void 0,this.heightmapHeight=void 0,this.levelZeroMaximumGeometricError=void 0,this.rectangles=[]}ZFe.prototype.build=function(e){e._tilingScheme=this.tilingScheme,e._heightmapWidth=this.heightmapWidth,e._heightmapHeight=this.heightmapHeight,e._levelZeroMaximumGeometricError=this.levelZeroMaximumGeometricError,e._rectangles=this.rectangles};function R4t(e,t){let n=t.getElementsByTagName("SRS")[0].textContent;if(n==="EPSG:4326")e.tilingScheme=new rr({ellipsoid:e.ellipsoid});else throw new oe(`SRS ${n} is not supported`);let i=t.getElementsByTagName("TileFormat")[0];e.heightmapWidth=parseInt(i.getAttribute("width"),10),e.heightmapHeight=parseInt(i.getAttribute("height"),10),e.levelZeroMaximumGeometricError=Xr.getEstimatedLevelZeroGeometricErrorForAHeightmap(e.ellipsoid,Math.min(e.heightmapWidth,e.heightmapHeight),e.tilingScheme.getNumberOfXTilesAtLevel(0));let r=t.getElementsByTagName("DataExtent");for(let o=0;o<r.length;++o){let s=r[o],a=P.toRadians(parseFloat(s.getAttribute("minx"))),c=P.toRadians(parseFloat(s.getAttribute("miny"))),u=P.toRadians(parseFloat(s.getAttribute("maxx"))),f=P.toRadians(parseFloat(s.getAttribute("maxy"))),d=parseInt(s.getAttribute("maxlevel"),10);e.rectangles.push(new D4t(new ie(a,c,u,f),d))}}function O4t(e,t,n){let i=`An error occurred while accessing ${e.url}`;throw l(t)&&l(t.message)&&(i=`${i}: ${t.message}`),no.reportError(void 0,n,l(n)?n._errorEvent:void 0,i),new oe(i)}async function M4t(e,t,n){try{let i=await t.fetchXML();R4t(e,i)}catch(i){O4t(t,i,n)}}function ob(e){e=e??H.EMPTY_OBJECT,this._errorEvent=new be,this._terrainDataStructure={heightScale:1/1e3,heightOffset:-1e3,elementsPerHeight:3,stride:4,elementMultiplier:256,isBigEndian:!0,lowestEncodedHeight:0,highestEncodedHeight:256*256*256-1};let t=e.credit;typeof t=="string"&&(t=new It(t)),this._credit=t,this._tilingScheme=void 0,this._rectangles=[]}Object.defineProperties(ob.prototype,{errorEvent:{get:function(){return this._errorEvent}},credit:{get:function(){return this._credit}},tilingScheme:{get:function(){return this._tilingScheme}},hasWaterMask:{get:function(){return!1}},hasVertexNormals:{get:function(){return!1}},availability:{get:function(){}}});ob.fromUrl=async function(e,t){t=t??H.EMPTY_OBJECT;let n=new ZFe(t),i=De.createIfNeeded(e);await M4t(n,i);let r=new ob(t);return n.build(r),r._resource=i,r};ob.prototype.requestTileGeometry=function(e,t,n,i){let r=this._tilingScheme.getNumberOfYTilesAtLevel(n),s=this._resource.getDerivedResource({url:`${n}/${e}/${r-t-1}.tif`,queryParameters:{cesium:!0},request:i}).fetchImage({preferImageBitmap:!0});if(!l(s))return;let a=this;return Promise.resolve(s).then(function(c){return new ll({buffer:Bm(c),width:a._heightmapWidth,height:a._heightmapHeight,childTileMask:N4t(a,e,t,n),structure:a._terrainDataStructure})})};ob.prototype.getLevelMaximumGeometricError=function(e){return this._levelZeroMaximumGeometricError/(1<<e)};var QFe=new ie;function N4t(e,t,n,i){let r=e._tilingScheme,o=e._rectangles,s=r.tileXYToRectangle(t,n,i),a=0;for(let c=0;c<o.length&&a!==15;++c){let u=o[c];if(u.maxLevel<=i)continue;let f=u.rectangle,d=ie.intersection(f,s,QFe);l(d)&&(c7(r,f,t*2,n*2,i+1)&&(a|=4),c7(r,f,t*2+1,n*2,i+1)&&(a|=8),c7(r,f,t*2,n*2+1,i+1)&&(a|=1),c7(r,f,t*2+1,n*2+1,i+1)&&(a|=2))}return a}function c7(e,t,n,i,r){let o=e.tileXYToRectangle(n,i,r);return l(ie.intersection(o,t,QFe))}ob.prototype.getTileDataAvailable=function(e,t,n){};ob.prototype.loadTileDataAvailability=function(e,t,n){};var eBe=ob;var tBe={VK_FORMAT_UNDEFINED:0,VK_FORMAT_R4G4_UNORM_PACK8:1,VK_FORMAT_R4G4B4A4_UNORM_PACK16:2,VK_FORMAT_B4G4R4A4_UNORM_PACK16:3,VK_FORMAT_R5G6B5_UNORM_PACK16:4,VK_FORMAT_B5G6R5_UNORM_PACK16:5,VK_FORMAT_R5G5B5A1_UNORM_PACK16:6,VK_FORMAT_B5G5R5A1_UNORM_PACK16:7,VK_FORMAT_A1R5G5B5_UNORM_PACK16:8,VK_FORMAT_R8_UNORM:9,VK_FORMAT_R8_SNORM:10,VK_FORMAT_R8_USCALED:11,VK_FORMAT_R8_SSCALED:12,VK_FORMAT_R8_UINT:13,VK_FORMAT_R8_SINT:14,VK_FORMAT_R8_SRGB:15,VK_FORMAT_R8G8_UNORM:16,VK_FORMAT_R8G8_SNORM:17,VK_FORMAT_R8G8_USCALED:18,VK_FORMAT_R8G8_SSCALED:19,VK_FORMAT_R8G8_UINT:20,VK_FORMAT_R8G8_SINT:21,VK_FORMAT_R8G8_SRGB:22,VK_FORMAT_R8G8B8_UNORM:23,VK_FORMAT_R8G8B8_SNORM:24,VK_FORMAT_R8G8B8_USCALED:25,VK_FORMAT_R8G8B8_SSCALED:26,VK_FORMAT_R8G8B8_UINT:27,VK_FORMAT_R8G8B8_SINT:28,VK_FORMAT_R8G8B8_SRGB:29,VK_FORMAT_B8G8R8_UNORM:30,VK_FORMAT_B8G8R8_SNORM:31,VK_FORMAT_B8G8R8_USCALED:32,VK_FORMAT_B8G8R8_SSCALED:33,VK_FORMAT_B8G8R8_UINT:34,VK_FORMAT_B8G8R8_SINT:35,VK_FORMAT_B8G8R8_SRGB:36,VK_FORMAT_R8G8B8A8_UNORM:37,VK_FORMAT_R8G8B8A8_SNORM:38,VK_FORMAT_R8G8B8A8_USCALED:39,VK_FORMAT_R8G8B8A8_SSCALED:40,VK_FORMAT_R8G8B8A8_UINT:41,VK_FORMAT_R8G8B8A8_SINT:42,VK_FORMAT_R8G8B8A8_SRGB:43,VK_FORMAT_B8G8R8A8_UNORM:44,VK_FORMAT_B8G8R8A8_SNORM:45,VK_FORMAT_B8G8R8A8_USCALED:46,VK_FORMAT_B8G8R8A8_SSCALED:47,VK_FORMAT_B8G8R8A8_UINT:48,VK_FORMAT_B8G8R8A8_SINT:49,VK_FORMAT_B8G8R8A8_SRGB:50,VK_FORMAT_A8B8G8R8_UNORM_PACK32:51,VK_FORMAT_A8B8G8R8_SNORM_PACK32:52,VK_FORMAT_A8B8G8R8_USCALED_PACK32:53,VK_FORMAT_A8B8G8R8_SSCALED_PACK32:54,VK_FORMAT_A8B8G8R8_UINT_PACK32:55,VK_FORMAT_A8B8G8R8_SINT_PACK32:56,VK_FORMAT_A8B8G8R8_SRGB_PACK32:57,VK_FORMAT_A2R10G10B10_UNORM_PACK32:58,VK_FORMAT_A2R10G10B10_SNORM_PACK32:59,VK_FORMAT_A2R10G10B10_USCALED_PACK32:60,VK_FORMAT_A2R10G10B10_SSCALED_PACK32:61,VK_FORMAT_A2R10G10B10_UINT_PACK32:62,VK_FORMAT_A2R10G10B10_SINT_PACK32:63,VK_FORMAT_A2B10G10R10_UNORM_PACK32:64,VK_FORMAT_A2B10G10R10_SNORM_PACK32:65,VK_FORMAT_A2B10G10R10_USCALED_PACK32:66,VK_FORMAT_A2B10G10R10_SSCALED_PACK32:67,VK_FORMAT_A2B10G10R10_UINT_PACK32:68,VK_FORMAT_A2B10G10R10_SINT_PACK32:69,VK_FORMAT_R16_UNORM:70,VK_FORMAT_R16_SNORM:71,VK_FORMAT_R16_USCALED:72,VK_FORMAT_R16_SSCALED:73,VK_FORMAT_R16_UINT:74,VK_FORMAT_R16_SINT:75,VK_FORMAT_R16_SFLOAT:76,VK_FORMAT_R16G16_UNORM:77,VK_FORMAT_R16G16_SNORM:78,VK_FORMAT_R16G16_USCALED:79,VK_FORMAT_R16G16_SSCALED:80,VK_FORMAT_R16G16_UINT:81,VK_FORMAT_R16G16_SINT:82,VK_FORMAT_R16G16_SFLOAT:83,VK_FORMAT_R16G16B16_UNORM:84,VK_FORMAT_R16G16B16_SNORM:85,VK_FORMAT_R16G16B16_USCALED:86,VK_FORMAT_R16G16B16_SSCALED:87,VK_FORMAT_R16G16B16_UINT:88,VK_FORMAT_R16G16B16_SINT:89,VK_FORMAT_R16G16B16_SFLOAT:90,VK_FORMAT_R16G16B16A16_UNORM:91,VK_FORMAT_R16G16B16A16_SNORM:92,VK_FORMAT_R16G16B16A16_USCALED:93,VK_FORMAT_R16G16B16A16_SSCALED:94,VK_FORMAT_R16G16B16A16_UINT:95,VK_FORMAT_R16G16B16A16_SINT:96,VK_FORMAT_R16G16B16A16_SFLOAT:97,VK_FORMAT_R32_UINT:98,VK_FORMAT_R32_SINT:99,VK_FORMAT_R32_SFLOAT:100,VK_FORMAT_R32G32_UINT:101,VK_FORMAT_R32G32_SINT:102,VK_FORMAT_R32G32_SFLOAT:103,VK_FORMAT_R32G32B32_UINT:104,VK_FORMAT_R32G32B32_SINT:105,VK_FORMAT_R32G32B32_SFLOAT:106,VK_FORMAT_R32G32B32A32_UINT:107,VK_FORMAT_R32G32B32A32_SINT:108,VK_FORMAT_R32G32B32A32_SFLOAT:109,VK_FORMAT_R64_UINT:110,VK_FORMAT_R64_SINT:111,VK_FORMAT_R64_SFLOAT:112,VK_FORMAT_R64G64_UINT:113,VK_FORMAT_R64G64_SINT:114,VK_FORMAT_R64G64_SFLOAT:115,VK_FORMAT_R64G64B64_UINT:116,VK_FORMAT_R64G64B64_SINT:117,VK_FORMAT_R64G64B64_SFLOAT:118,VK_FORMAT_R64G64B64A64_UINT:119,VK_FORMAT_R64G64B64A64_SINT:120,VK_FORMAT_R64G64B64A64_SFLOAT:121,VK_FORMAT_B10G11R11_UFLOAT_PACK32:122,VK_FORMAT_E5B9G9R9_UFLOAT_PACK32:123,VK_FORMAT_D16_UNORM:124,VK_FORMAT_X8_D24_UNORM_PACK32:125,VK_FORMAT_D32_SFLOAT:126,VK_FORMAT_S8_UINT:127,VK_FORMAT_D16_UNORM_S8_UINT:128,VK_FORMAT_D24_UNORM_S8_UINT:129,VK_FORMAT_D32_SFLOAT_S8_UINT:130,VK_FORMAT_BC1_RGB_UNORM_BLOCK:131,VK_FORMAT_BC1_RGB_SRGB_BLOCK:132,VK_FORMAT_BC1_RGBA_UNORM_BLOCK:133,VK_FORMAT_BC1_RGBA_SRGB_BLOCK:134,VK_FORMAT_BC2_UNORM_BLOCK:135,VK_FORMAT_BC2_SRGB_BLOCK:136,VK_FORMAT_BC3_UNORM_BLOCK:137,VK_FORMAT_BC3_SRGB_BLOCK:138,VK_FORMAT_BC4_UNORM_BLOCK:139,VK_FORMAT_BC4_SNORM_BLOCK:140,VK_FORMAT_BC5_UNORM_BLOCK:141,VK_FORMAT_BC5_SNORM_BLOCK:142,VK_FORMAT_BC6H_UFLOAT_BLOCK:143,VK_FORMAT_BC6H_SFLOAT_BLOCK:144,VK_FORMAT_BC7_UNORM_BLOCK:145,VK_FORMAT_BC7_SRGB_BLOCK:146,VK_FORMAT_ETC2_R8G8B8_UNORM_BLOCK:147,VK_FORMAT_ETC2_R8G8B8_SRGB_BLOCK:148,VK_FORMAT_ETC2_R8G8B8A1_UNORM_BLOCK:149,VK_FORMAT_ETC2_R8G8B8A1_SRGB_BLOCK:150,VK_FORMAT_ETC2_R8G8B8A8_UNORM_BLOCK:151,VK_FORMAT_ETC2_R8G8B8A8_SRGB_BLOCK:152,VK_FORMAT_EAC_R11_UNORM_BLOCK:153,VK_FORMAT_EAC_R11_SNORM_BLOCK:154,VK_FORMAT_EAC_R11G11_UNORM_BLOCK:155,VK_FORMAT_EAC_R11G11_SNORM_BLOCK:156,VK_FORMAT_ASTC_4x4_UNORM_BLOCK:157,VK_FORMAT_ASTC_4x4_SRGB_BLOCK:158,VK_FORMAT_ASTC_5x4_UNORM_BLOCK:159,VK_FORMAT_ASTC_5x4_SRGB_BLOCK:160,VK_FORMAT_ASTC_5x5_UNORM_BLOCK:161,VK_FORMAT_ASTC_5x5_SRGB_BLOCK:162,VK_FORMAT_ASTC_6x5_UNORM_BLOCK:163,VK_FORMAT_ASTC_6x5_SRGB_BLOCK:164,VK_FORMAT_ASTC_6x6_UNORM_BLOCK:165,VK_FORMAT_ASTC_6x6_SRGB_BLOCK:166,VK_FORMAT_ASTC_8x5_UNORM_BLOCK:167,VK_FORMAT_ASTC_8x5_SRGB_BLOCK:168,VK_FORMAT_ASTC_8x6_UNORM_BLOCK:169,VK_FORMAT_ASTC_8x6_SRGB_BLOCK:170,VK_FORMAT_ASTC_8x8_UNORM_BLOCK:171,VK_FORMAT_ASTC_8x8_SRGB_BLOCK:172,VK_FORMAT_ASTC_10x5_UNORM_BLOCK:173,VK_FORMAT_ASTC_10x5_SRGB_BLOCK:174,VK_FORMAT_ASTC_10x6_UNORM_BLOCK:175,VK_FORMAT_ASTC_10x6_SRGB_BLOCK:176,VK_FORMAT_ASTC_10x8_UNORM_BLOCK:177,VK_FORMAT_ASTC_10x8_SRGB_BLOCK:178,VK_FORMAT_ASTC_10x10_UNORM_BLOCK:179,VK_FORMAT_ASTC_10x10_SRGB_BLOCK:180,VK_FORMAT_ASTC_12x10_UNORM_BLOCK:181,VK_FORMAT_ASTC_12x10_SRGB_BLOCK:182,VK_FORMAT_ASTC_12x12_UNORM_BLOCK:183,VK_FORMAT_ASTC_12x12_SRGB_BLOCK:184,VK_FORMAT_G8B8G8R8_422_UNORM:1000156e3,VK_FORMAT_B8G8R8G8_422_UNORM:1000156001,VK_FORMAT_G8_B8_R8_3PLANE_420_UNORM:1000156002,VK_FORMAT_G8_B8R8_2PLANE_420_UNORM:1000156003,VK_FORMAT_G8_B8_R8_3PLANE_422_UNORM:1000156004,VK_FORMAT_G8_B8R8_2PLANE_422_UNORM:1000156005,VK_FORMAT_G8_B8_R8_3PLANE_444_UNORM:1000156006,VK_FORMAT_R10X6_UNORM_PACK16:1000156007,VK_FORMAT_R10X6G10X6_UNORM_2PACK16:1000156008,VK_FORMAT_R10X6G10X6B10X6A10X6_UNORM_4PACK16:1000156009,VK_FORMAT_G10X6B10X6G10X6R10X6_422_UNORM_4PACK16:1000156010,VK_FORMAT_B10X6G10X6R10X6G10X6_422_UNORM_4PACK16:1000156011,VK_FORMAT_G10X6_B10X6_R10X6_3PLANE_420_UNORM_3PACK16:1000156012,VK_FORMAT_G10X6_B10X6R10X6_2PLANE_420_UNORM_3PACK16:1000156013,VK_FORMAT_G10X6_B10X6_R10X6_3PLANE_422_UNORM_3PACK16:1000156014,VK_FORMAT_G10X6_B10X6R10X6_2PLANE_422_UNORM_3PACK16:1000156015,VK_FORMAT_G10X6_B10X6_R10X6_3PLANE_444_UNORM_3PACK16:1000156016,VK_FORMAT_R12X4_UNORM_PACK16:1000156017,VK_FORMAT_R12X4G12X4_UNORM_2PACK16:1000156018,VK_FORMAT_R12X4G12X4B12X4A12X4_UNORM_4PACK16:1000156019,VK_FORMAT_G12X4B12X4G12X4R12X4_422_UNORM_4PACK16:1000156020,VK_FORMAT_B12X4G12X4R12X4G12X4_422_UNORM_4PACK16:1000156021,VK_FORMAT_G12X4_B12X4_R12X4_3PLANE_420_UNORM_3PACK16:1000156022,VK_FORMAT_G12X4_B12X4R12X4_2PLANE_420_UNORM_3PACK16:1000156023,VK_FORMAT_G12X4_B12X4_R12X4_3PLANE_422_UNORM_3PACK16:1000156024,VK_FORMAT_G12X4_B12X4R12X4_2PLANE_422_UNORM_3PACK16:1000156025,VK_FORMAT_G12X4_B12X4_R12X4_3PLANE_444_UNORM_3PACK16:1000156026,VK_FORMAT_G16B16G16R16_422_UNORM:1000156027,VK_FORMAT_B16G16R16G16_422_UNORM:1000156028,VK_FORMAT_G16_B16_R16_3PLANE_420_UNORM:1000156029,VK_FORMAT_G16_B16R16_2PLANE_420_UNORM:1000156030,VK_FORMAT_G16_B16_R16_3PLANE_422_UNORM:1000156031,VK_FORMAT_G16_B16R16_2PLANE_422_UNORM:1000156032,VK_FORMAT_G16_B16_R16_3PLANE_444_UNORM:1000156033,VK_FORMAT_PVRTC1_2BPP_UNORM_BLOCK_IMG:1000054e3,VK_FORMAT_PVRTC1_4BPP_UNORM_BLOCK_IMG:1000054001,VK_FORMAT_PVRTC2_2BPP_UNORM_BLOCK_IMG:1000054002,VK_FORMAT_PVRTC2_4BPP_UNORM_BLOCK_IMG:1000054003,VK_FORMAT_PVRTC1_2BPP_SRGB_BLOCK_IMG:1000054004,VK_FORMAT_PVRTC1_4BPP_SRGB_BLOCK_IMG:1000054005,VK_FORMAT_PVRTC2_2BPP_SRGB_BLOCK_IMG:1000054006,VK_FORMAT_PVRTC2_4BPP_SRGB_BLOCK_IMG:1000054007,VK_FORMAT_ASTC_4x4_SFLOAT_BLOCK_EXT:1000066e3,VK_FORMAT_ASTC_5x4_SFLOAT_BLOCK_EXT:1000066001,VK_FORMAT_ASTC_5x5_SFLOAT_BLOCK_EXT:1000066002,VK_FORMAT_ASTC_6x5_SFLOAT_BLOCK_EXT:1000066003,VK_FORMAT_ASTC_6x6_SFLOAT_BLOCK_EXT:1000066004,VK_FORMAT_ASTC_8x5_SFLOAT_BLOCK_EXT:1000066005,VK_FORMAT_ASTC_8x6_SFLOAT_BLOCK_EXT:1000066006,VK_FORMAT_ASTC_8x8_SFLOAT_BLOCK_EXT:1000066007,VK_FORMAT_ASTC_10x5_SFLOAT_BLOCK_EXT:1000066008,VK_FORMAT_ASTC_10x6_SFLOAT_BLOCK_EXT:1000066009,VK_FORMAT_ASTC_10x8_SFLOAT_BLOCK_EXT:1000066010,VK_FORMAT_ASTC_10x10_SFLOAT_BLOCK_EXT:1000066011,VK_FORMAT_ASTC_12x10_SFLOAT_BLOCK_EXT:1000066012,VK_FORMAT_ASTC_12x12_SFLOAT_BLOCK_EXT:1000066013,VK_FORMAT_G8B8G8R8_422_UNORM_KHR:1000156e3,VK_FORMAT_B8G8R8G8_422_UNORM_KHR:1000156001,VK_FORMAT_G8_B8_R8_3PLANE_420_UNORM_KHR:1000156002,VK_FORMAT_G8_B8R8_2PLANE_420_UNORM_KHR:1000156003,VK_FORMAT_G8_B8_R8_3PLANE_422_UNORM_KHR:1000156004,VK_FORMAT_G8_B8R8_2PLANE_422_UNORM_KHR:1000156005,VK_FORMAT_G8_B8_R8_3PLANE_444_UNORM_KHR:1000156006,VK_FORMAT_R10X6_UNORM_PACK16_KHR:1000156007,VK_FORMAT_R10X6G10X6_UNORM_2PACK16_KHR:1000156008,VK_FORMAT_R10X6G10X6B10X6A10X6_UNORM_4PACK16_KHR:1000156009,VK_FORMAT_G10X6B10X6G10X6R10X6_422_UNORM_4PACK16_KHR:1000156010,VK_FORMAT_B10X6G10X6R10X6G10X6_422_UNORM_4PACK16_KHR:1000156011,VK_FORMAT_G10X6_B10X6_R10X6_3PLANE_420_UNORM_3PACK16_KHR:1000156012,VK_FORMAT_G10X6_B10X6R10X6_2PLANE_420_UNORM_3PACK16_KHR:1000156013,VK_FORMAT_G10X6_B10X6_R10X6_3PLANE_422_UNORM_3PACK16_KHR:1000156014,VK_FORMAT_G10X6_B10X6R10X6_2PLANE_422_UNORM_3PACK16_KHR:1000156015,VK_FORMAT_G10X6_B10X6_R10X6_3PLANE_444_UNORM_3PACK16_KHR:1000156016,VK_FORMAT_R12X4_UNORM_PACK16_KHR:1000156017,VK_FORMAT_R12X4G12X4_UNORM_2PACK16_KHR:1000156018,VK_FORMAT_R12X4G12X4B12X4A12X4_UNORM_4PACK16_KHR:1000156019,VK_FORMAT_G12X4B12X4G12X4R12X4_422_UNORM_4PACK16_KHR:1000156020,VK_FORMAT_B12X4G12X4R12X4G12X4_422_UNORM_4PACK16_KHR:1000156021,VK_FORMAT_G12X4_B12X4_R12X4_3PLANE_420_UNORM_3PACK16_KHR:1000156022,VK_FORMAT_G12X4_B12X4R12X4_2PLANE_420_UNORM_3PACK16_KHR:1000156023,VK_FORMAT_G12X4_B12X4_R12X4_3PLANE_422_UNORM_3PACK16_KHR:1000156024,VK_FORMAT_G12X4_B12X4R12X4_2PLANE_422_UNORM_3PACK16_KHR:1000156025,VK_FORMAT_G12X4_B12X4_R12X4_3PLANE_444_UNORM_3PACK16_KHR:1000156026,VK_FORMAT_G16B16G16R16_422_UNORM_KHR:1000156027,VK_FORMAT_B16G16R16G16_422_UNORM_KHR:1000156028,VK_FORMAT_G16_B16_R16_3PLANE_420_UNORM_KHR:1000156029,VK_FORMAT_G16_B16R16_2PLANE_420_UNORM_KHR:1000156030,VK_FORMAT_G16_B16_R16_3PLANE_422_UNORM_KHR:1000156031,VK_FORMAT_G16_B16R16_2PLANE_422_UNORM_KHR:1000156032,VK_FORMAT_G16_B16_R16_3PLANE_444_UNORM_KHR:1000156033};Object.freeze(tBe);var nBe=tBe;function L4t(e){switch(e){case te.FLOAT:return"float";case te.FLOAT_VEC2:return"vec2";case te.FLOAT_VEC3:return"vec3";case te.FLOAT_VEC4:return"vec4";case te.FLOAT_MAT2:return"mat2";case te.FLOAT_MAT3:return"mat3";case te.FLOAT_MAT4:return"mat4";case te.SAMPLER_2D:return"sampler2D";case te.BOOL:return"bool"}}var iBe=L4t;function F4t(e,t,n){return function(){n.apply(e,arguments),t.apply(e,arguments)}}var l7=F4t;var B4t=new h(1,1,1);function Wse(e){e=e??B4t,this._dimensions=h.clone(e)}Object.defineProperties(Wse.prototype,{dimensions:{get:function(){return this._dimensions},set:function(e){h.clone(e,this._dimensions)}}});var k4t=new h;Wse.prototype.emit=function(e){let t=this._dimensions,n=h.multiplyByScalar(t,.5,k4t),i=P.randomBetween(-n.x,n.x),r=P.randomBetween(-n.y,n.y),o=P.randomBetween(-n.z,n.z);e.position=h.fromElements(i,r,o,e.position),e.velocity=h.normalize(e.position,e.velocity)};var rBe=Wse;var qse=0,oBe=new h,u7=new h,U4t=new Bo;function z4t(e,t,n){let i=t.tileX,r=t.tileY,o=t.tileZ,s=n?.featureIdProperty,a=U4t.tileXYToRectangle(i,r,o),c=ie.center(a),u=h.fromRadians(c.longitude,c.latitude,0),f=4294967295,d=f,p=f,g=new Map,m=new Map,y=[],A=[],b=[],x=0;function T(){let B=(4-x%4)%4;B>0&&(b.push(new Uint8Array(B)),x+=B)}function E(B,j){T();let k=x;b.push(new Uint8Array(B.buffer,B.byteOffset,B.byteLength)),x+=B.byteLength;let G=y.length;return y.push({buffer:0,byteOffset:k,byteLength:B.byteLength,target:j}),G}function v(B,j){let k=E(B,j.target),G=bt.getComponentCount(j.type),q={bufferView:k,byteOffset:0,componentType:j.componentType,count:B.length/G,type:j.type};l(j.min)&&(q.min=j.min),l(j.max)&&(q.max=j.max);let Q=A.length;return A.push(q),Q}function S(B){let j=Number.POSITIVE_INFINITY,k=Number.POSITIVE_INFINITY,G=Number.POSITIVE_INFINITY,q=Number.NEGATIVE_INFINITY,Q=Number.NEGATIVE_INFINITY,W=Number.NEGATIVE_INFINITY;for(let J=0;J<B.length;J+=3){let Z=B[J],ae=B[J+1],Ae=B[J+2];Z<j&&(j=Z),ae<k&&(k=ae),Ae<G&&(G=Ae),Z>q&&(q=Z),ae>Q&&(Q=ae),Ae>W&&(W=Ae)}return{min:[j,k,G],max:[q,Q,W]}}function I(B,j,k){if(k.length===0)return;let G=new Uint32Array(k),q=v(G,{type:"SCALAR",componentType:Y.UNSIGNED_INT,target:te.ARRAY_BUFFER});B._FEATURE_ID_0=q;let Q={featureCount:g.size,nullFeatureId:d,attribute:0};m.size>0&&(Q.propertyTable=0),j.EXT_mesh_features={featureIds:[Q]}}function R(B,j){j=j??4;let k=(j-x%j)%j;k>0&&(b.push(new Uint8Array(k)),x+=k);let G=x;b.push(B),x+=B.byteLength;let q=y.length;return y.push({buffer:0,byteOffset:G,byteLength:B.byteLength}),q}function O(){if(m.size===0)return;let B=new Map;for(let q of m.values())for(let[Q,W]of Object.entries(q)){if(!l(W))continue;let J=typeof W,Z;J==="string"?Z="STRING":J==="number"?Z="SCALAR":J==="boolean"?Z="BOOLEAN":Z="STRING";let ae=B.get(Q);l(ae)?ae!==Z&&B.set(Q,"STRING"):B.set(Q,Z)}if(B.size===0)return;let j={};for(let[q,Q]of B)Q==="SCALAR"?j[q]={type:"SCALAR",componentType:"FLOAT64"}:Q==="BOOLEAN"?j[q]={type:"BOOLEAN"}:j[q]={type:"STRING"};let k={},G=g.size;for(let[q,Q]of B)if(Q==="SCALAR"){let W=new Float64Array(G);for(let Z=0;Z<G;Z++){let Ae=m.get(Z)?.[q];W[Z]=typeof Ae=="number"&&Number.isFinite(Ae)?Ae:NaN}let J=R(new Uint8Array(W.buffer,W.byteOffset,W.byteLength),8);k[q]={values:J}}else if(Q==="BOOLEAN"){let W=Math.ceil(G/8),J=new Uint8Array(W);for(let ae=0;ae<G;ae++)m.get(ae)?.[q]&&(J[ae>>3]|=1<<(ae&7));let Z=R(J);k[q]={values:Z}}else{let W=new TextEncoder,J=[],Z=new Uint32Array(G+1),ae=0;for(let we=0;we<G;we++){Z[we]=ae;let Re=m.get(we)?.[q],Qe;Re==null?Qe="":typeof Re=="string"?Qe=Re:Qe=String(Re);let He=W.encode(Qe);J.push(He),ae+=He.byteLength}Z[G]=ae;let Ae=new Uint8Array(ae),fe=0;for(let we of J)Ae.set(we,fe),fe+=we.byteLength;let xe=R(Ae),ge=R(new Uint8Array(Z.buffer,Z.byteOffset,Z.byteLength));k[q]={values:xe,stringOffsets:ge,stringOffsetType:"UINT32"}}return{schema:{classes:{mvt_feature:{properties:j}}},propertyTables:[{class:"mvt_feature",count:G,properties:k}]}}let L=[],_=[],C=[u.x,u.y,u.z];for(let B of e.layers){let j=B.extent,k=[],G=[],q=[],Q=[],W=[],J=0,Z=[],ae=[],Ae=[],fe=[],xe=[],ge=[],we=[],ve=0;for(let He of B.features){let Ye=l(s)?j4t(He,s,g)??d:V4t(He,g);if(Ye!==d&&!m.has(Ye)){let Ke=Object.assign({},He.properties);Ke._layer=B.name??"",m.set(Ye,Ke)}if(He.type==="Point"){let Ke=He.geometry;for(let Pe of Ke)Yse(Pe,i,r,o,j,qse,u,k),G.push(Ye);continue}if(He.type==="LineString"){let Ke=He.geometry;for(let Pe of Ke){let qe=q.length/3;for(let st of Pe)Yse(st,i,r,o,j,qse,u,q),Q.push(Ye);for(let st=0;st<Pe.length;st++)W.push(qe+st);W.push(p),J++}continue}if(He.type==="Polygon"){let Ke=He.geometry,Pe=H4t(Ke);for(let qe of Pe){let st=[qe.outerRing,...qe.holes],vt=[],jt=[],lt=[],mt=0;for(let ht=0;ht<st.length;ht++){let Li=st[ht];ht>0&<.push(mt);for(let Yn of Li)vt.push(new U(Yn.x,Yn.y)),Yse(Yn,i,r,o,j,qse,u,jt),mt++}if(vt.length<3)continue;let ft=mi.triangulate(vt,lt.length>0?lt:void 0);if(!l(ft)||ft.length===0){yt("buildVectorGltfFromMVT-triangulation-failed","Polygon triangulation failed; skipping polygon.");continue}let Yt=Z.length/3,rt=Ae.length;fe.push(Yt),xe.push(rt),ge.push(lt.length);for(let ht=0;ht<lt.length;ht++)we.push(Yt+lt[ht]);for(let ht=0;ht<jt.length;ht++)Z.push(jt[ht]);for(let ht=0;ht<jt.length/3;ht++)ae.push(Ye);for(let ht=0;ht<ft.length;ht++)Ae.push(ft[ht]+Yt);ve++}}}if(k.length===0&&q.length===0&&Z.length===0)continue;W.length>0&&W[W.length-1]===p&&W.pop();let Re=[];if(k.length>0){let He=new Float32Array(k),Ye=S(He),Pe={POSITION:v(He,{type:"VEC3",componentType:Y.FLOAT,target:te.ARRAY_BUFFER,min:Ye.min,max:Ye.max})},qe={CESIUM_mesh_vector:{vector:!0,count:He.length/3}};I(Pe,qe,G),Re.push({mode:Oe.POINTS,attributes:Pe,extensions:qe})}if(q.length>0&&W.length>1){let He=new Float32Array(q),Ye=new Uint32Array(W),Ke=S(He),Pe=v(He,{type:"VEC3",componentType:Y.FLOAT,target:te.ARRAY_BUFFER,min:Ke.min,max:Ke.max}),qe=v(Ye,{type:"SCALAR",componentType:Y.UNSIGNED_INT,target:te.ELEMENT_ARRAY_BUFFER}),st={POSITION:Pe},vt={CESIUM_mesh_vector:{vector:!0,count:J}};I(st,vt,Q),Re.push({mode:Oe.LINE_STRIP,indices:qe,attributes:st,extensions:vt})}if(Z.length>0&&Ae.length>=3){let He=new Float32Array(Z),Ye=new Uint32Array(Ae),Ke=new Uint32Array(fe),Pe=new Uint32Array(xe),qe=we.length>0,st=qe?new Uint32Array(ge):void 0,vt=qe?new Uint32Array(we):void 0,jt=S(He),lt=v(He,{type:"VEC3",componentType:Y.FLOAT,target:te.ARRAY_BUFFER,min:jt.min,max:jt.max}),mt=v(Ye,{type:"SCALAR",componentType:Y.UNSIGNED_INT,target:te.ELEMENT_ARRAY_BUFFER}),ft=v(Ke,{type:"SCALAR",componentType:Y.UNSIGNED_INT,target:te.ARRAY_BUFFER}),Yt=v(Pe,{type:"SCALAR",componentType:Y.UNSIGNED_INT,target:te.ARRAY_BUFFER}),rt=l(st)?v(st,{type:"SCALAR",componentType:Y.UNSIGNED_INT,target:te.ARRAY_BUFFER}):void 0,ht=l(vt)?v(vt,{type:"SCALAR",componentType:Y.UNSIGNED_INT,target:te.ARRAY_BUFFER}):void 0,Li={POSITION:lt},Yn={CESIUM_mesh_vector:{vector:!0,count:ve,polygonAttributeOffsets:ft,polygonIndicesOffsets:Yt}};qe&&(Yn.CESIUM_mesh_vector.polygonHoleCounts=rt,Yn.CESIUM_mesh_vector.polygonHoleOffsets=ht),I(Li,Yn,ae),Re.push({mode:Oe.TRIANGLES,indices:mt,attributes:Li,extensions:Yn})}if(Re.length===0)continue;let Qe=L.length;L.push({primitives:Re}),_.push({name:B.name,mesh:Qe,translation:C})}if(_.length===0)return;let w=O(),D=Y4t(b,x),N=["CESIUM_mesh_vector"];g.size>0&&N.push("EXT_mesh_features"),l(w)&&N.push("EXT_structural_metadata");let F=_.map((B,j)=>j),V={asset:{version:"2.0"},extensionsUsed:N,scene:0,scenes:[{nodes:F}],nodes:_,meshes:L,accessors:A,bufferViews:y,buffers:[{byteLength:D.byteLength}],extensions:void 0};return l(w)&&(V.extensions={EXT_structural_metadata:w}),q4t(V,D)}function V4t(e,t){let n=t.get(e);return l(n)||(n=t.size,t.set(e,n)),n}function j4t(e,t,n){let i=e.properties;if(!l(i))return;let r=i[t];if(!l(r)||typeof r!="string"&&typeof r!="number"&&typeof r!="boolean"||typeof r=="number"&&!Number.isFinite(r))return;let o=`${typeof r}:${r}`,s=n.get(o);return l(s)||(s=n.size,n.set(o,s)),s}function H4t(e){let t=[];for(let n of e){let i=W4t(n);if(i.length<3)continue;G4t(i)<=0?t.push({outerRing:i,holes:[]}):t.length>0&&t[t.length-1].holes.push(i)}return t}function G4t(e){let t=0;for(let n=0,i=e.length-1;n<e.length;i=n++)t+=(e[i].x+e[n].x)*(e[i].y-e[n].y);return t/2}function W4t(e){return e.length>1&&e[0].x===e[e.length-1].x&&e[0].y===e[e.length-1].y?e.slice(0,e.length-1):e}function Yse(e,t,n,i,r,o,s,a){let c=1<<i,u=(t+e.x/r)/c,f=(n+e.y/r)/c,d=u*2*Math.PI-Math.PI,p=Math.atan(Math.sinh(Math.PI*(1-2*f)));h.fromRadians(d,p,o,void 0,oBe),h.subtract(oBe,s,u7),a.push(u7.x,u7.y,u7.z)}function q4t(e,t){let s=new TextEncoder().encode(JSON.stringify(e)),a=Math.ceil(s.length/4)*4,c=new Uint8Array(a);c.fill(32),c.set(s);let u=Math.ceil(t.byteLength/4)*4,f=new Uint8Array(u);f.set(t);let d=20+a+8+u,p=new Uint8Array(d),g=new DataView(p.buffer),m=0;return g.setUint32(m,1179937895,!0),m+=4,g.setUint32(m,2,!0),m+=4,g.setUint32(m,d,!0),m+=4,g.setUint32(m,a,!0),m+=4,g.setUint32(m,1313821514,!0),m+=4,p.set(c,m),m+=a,g.setUint32(m,u,!0),m+=4,g.setUint32(m,5130562,!0),m+=4,p.set(f,m),p}function Y4t(e,t){let n=new Uint8Array(t),i=0;for(let r of e)n.set(r,i),i+=r.byteLength;return n}var f7=z4t;var Xse=class{constructor(){ut(this,"featuresLength");ut(this,"pointsLength");ut(this,"trianglesLength");ut(this,"geometryByteLength");ut(this,"texturesByteLength");ut(this,"batchTableByteLength");ut(this,"innerContents");ut(this,"ready");ut(this,"tileset");ut(this,"tile");ut(this,"url");ut(this,"batchTable");ut(this,"metadata");ut(this,"group");this.featurePropertiesDirty=!1}hasProperty(t,n){pe.throwInstantiationError()}getFeature(t){pe.throwInstantiationError()}applyDebugSettings(t,n){pe.throwInstantiationError()}applyStyle(t){pe.throwInstantiationError()}update(t,n){pe.throwInstantiationError()}pick(t,n,i){pe.throwInstantiationError()}isDestroyed(){pe.throwInstantiationError()}destroy(){pe.throwInstantiationError()}},sBe=Xse;function OM(e){e=e??H.EMPTY_OBJECT,this._maximumSubtreeCount=e.maximumSubtreeCount??0,this._subtreeRequestCounter=0,this._queue=new KA({comparator:OM.comparator})}OM.prototype.addSubtree=function(e){let t=new X4t(e,this._subtreeRequestCounter);this._subtreeRequestCounter++,this._queue.insert(t);let n=e.implicitCoordinates;if(n.level>0){let i=n.getParentSubtreeCoordinates(),r=this.find(i)}if(this._maximumSubtreeCount>0)for(;this._queue.length>this._maximumSubtreeCount&&this._queue.getMinimum()!==t;)this._queue.removeMinimum()};OM.prototype.find=function(e){let t=this._queue,n=t.internalArray,i=t.length;for(let r=0;r<i;r++){let o=n[r],a=o.subtree.implicitCoordinates;if(e.isEqual(a))return o.subtree}};OM.comparator=function(e,t){let n=e.subtree.implicitCoordinates,i=t.subtree.implicitCoordinates;return n.isAncestor(i)?1:i.isAncestor(n)?-1:e.stamp-t.stamp};function X4t(e,t){this.subtree=e,this.stamp=t}var d7=OM;function MM(e){e=e??H.EMPTY_OBJECT;let{className:t,names:n,types:i,componentTypes:r,shape:o,dimensions:s,paddingBefore:a=h.ZERO.clone(),paddingAfter:c=h.ZERO.clone(),globalTransform:u=M.IDENTITY.clone(),shapeTransform:f=M.IDENTITY.clone(),minBounds:d,maxBounds:p,minimumValues:g,maximumValues:m,maximumTileCount:y}=e;this._shapeTransform=f,this._globalTransform=u,this._shape=o,this._minBounds=d,this._maxBounds=p,this._dimensions=s,this._paddingBefore=a,this._paddingAfter=c,this._className=t,this._names=n,this._types=i,this._componentTypes=r,this._metadataOrder=o===Dc.ELLIPSOID?f_.Z_UP:f_.Y_UP,this._minimumValues=g,this._maximumValues=m,this._maximumTileCount=y,this._availableLevels=void 0,this._implicitTileset=void 0,this._subtreeCache=new d7}Object.defineProperties(MM.prototype,{globalTransform:{get:function(){return this._globalTransform}},shapeTransform:{get:function(){return this._shapeTransform}},shape:{get:function(){return this._shape}},minBounds:{get:function(){return this._minBounds}},maxBounds:{get:function(){return this._maxBounds}},dimensions:{get:function(){return this._dimensions}},paddingBefore:{get:function(){return this._paddingBefore}},paddingAfter:{get:function(){return this._paddingAfter}},className:{get:function(){return this._className}},names:{get:function(){return this._names}},types:{get:function(){return this._types}},componentTypes:{get:function(){return this._componentTypes}},metadataOrder:{get:function(){return this._metadataOrder}},minimumValues:{get:function(){return this._minimumValues}},maximumValues:{get:function(){return this._maximumValues}},maximumTileCount:{get:function(){return this._maximumTileCount}},availableLevels:{get:function(){return this._availableLevels}}});MM.fromUrl=async function(e){let t=De.createIfNeeded(e),n=await t.fetchJson();$4t(n);let i=i8t(n,t);await i.load();let{root:r}=n,o=sr(n,"3DTILES_metadata")?n.extensions["3DTILES_metadata"]:n,s=new Zv({metadataJson:o,schema:i.schema}),a=r.content.extensions["3DTILES_content_voxels"],c=a.class,u=r8t(s,c);Object.assign(u,J4t(r)),l(r.transform)?u.globalTransform=M.unpack(r.transform):u.globalTransform=M.clone(M.IDENTITY),u.dimensions=h.unpack(a.dimensions),u.maximumTileCount=K4t(s),l(a.padding)&&(u.paddingBefore=h.unpack(a.padding.before),u.paddingAfter=h.unpack(a.padding.after));let f=new MM(u),d=new Cg(t,r,i.schema);return f._implicitTileset=d,f._availableLevels=d.availableLevels,Bi.unload(i),f};function K4t(e){if(l(e.tileset))return e.tileset.getPropertyBySemantic(Ph.TILESET_TILE_COUNT)}function $4t(e){let t=e.root;if(!l(t.content))throw new oe("Root must have content");if(!sr(t.content,"3DTILES_content_voxels"))throw new oe("Root tile content must have 3DTILES_content_voxels extension");if(!sr(t,"3DTILES_implicit_tiling")&&!l(t.implicitTiling))throw new oe("Root tile must have implicit tiling");if(!l(e.schema)&&!l(e.schemaUri)&&!sr(e,"3DTILES_metadata"))throw new oe("Tileset must have a metadata schema")}function J4t(e){let t=e.boundingVolume;if(l(t.box))return t8t(t.box);if(l(t.region))return Z4t(t.region);if(sr(t,"3DTILES_bounding_volume_cylinder"))return n8t(t.extensions["3DTILES_bounding_volume_cylinder"]);throw new oe("Only box, region and 3DTILES_bounding_volume_cylinder are supported in Cesium3DTilesVoxelProvider")}function Z4t(e){let t=e[0],n=e[1],i=e[2],r=e[3],o=e[4],s=e[5],a=M.fromScale(ee.WGS84.radii),c=new h(t,n,o),u=new h(i,r,s);return{shape:Dc.ELLIPSOID,minBounds:c,maxBounds:u,shapeTransform:a}}var Q4t=new h,e8t=new $;function t8t(e){let t=en.unpack(e),n=$.getScale(t.halfAxes,Q4t),i=$.getRotation(t.halfAxes,e8t);return{shape:Dc.BOX,minBounds:h.negate(n,new h),maxBounds:h.clone(n),shapeTransform:M.fromRotationTranslation(i,t.center)}}function n8t(e){let{minRadius:t,maxRadius:n,height:i,minAngle:r=-P.PI,maxAngle:o=P.PI,translation:s=[0,0,0],rotation:a=[0,0,0,1]}=e,c=-.5*i+s[2],u=.5*i+s[2],f=M.fromTranslationQuaternionRotationScale(h.unpack(s),Le.unpack(a),h.ONE);return{shape:Dc.CYLINDER,minBounds:h.fromElements(t,r,c),maxBounds:h.fromElements(n,o,u),shapeTransform:f}}function i8t(e,t){let{schemaUri:n,schema:i}=e;return l(n)?Bi.getSchemaLoader({resource:t.getDerivedResource({url:n})}):Bi.getSchemaLoader({schema:i})}function r8t(e,t){let{schema:n,statistics:i}=e,r=i?.classes[t],o=n.classes[t].properties,s=Object.entries(o).map(([g,m])=>{let{type:y,componentType:A}=m,b=r?.properties[g].min,x=r?.properties[g].max,T=bt.getComponentCount(y),E=aBe(b,T),v=aBe(x,T);return{id:g,type:y,componentType:A,minValue:E,maxValue:v}}),a=s.map(g=>g.id),c=s.map(g=>g.type),u=s.map(g=>g.componentType),f=s.map(g=>g.minValue),d=s.map(g=>g.maxValue),p=f.some(l);return{className:t,names:a,types:c,componentTypes:u,minimumValues:p?f:void 0,maximumValues:p?d:void 0}}function aBe(e,t){if(!l(e))return;let n=Array.isArray(e)?e:[e];return Array.from({length:t},(i,r)=>n[r])}async function o8t(e,t){let n=e._implicitTileset,i=e._subtreeCache,r=i.find(t);if(l(r))return r;let o=n.subtreeUriTemplate.getDerivedResource({templateValues:t.getTemplateValues()}),s=n.baseResource.getDerivedResource({url:o.url}),a=await s.fetchArrayBuffer();if(r=i.find(t),l(r))return r;let c=Hy(a);return r=await py.fromSubtreeJson(s,c.jsonPayload,c.binaryPayload,n,t),i.addSubtree(r),r}MM.prototype.requestData=async function(e){e=e??H.EMPTY_OBJECT;let{tileLevel:t=0,tileX:n=0,tileY:i=0,tileZ:r=0,keyframe:o=0}=e;if(o!==0)return Promise.reject("3D Tiles currently doesn't support time-dynamic data.");let s=this._implicitTileset,a=new vg({subdivisionScheme:s.subdivisionScheme,subtreeLevels:s.subtreeLevels,level:t,x:n,y:i,z:r}),c=a.isSubtreeRoot()&&a.level>0,u=c?a.getParentSubtreeCoordinates():a.getSubtreeCoordinates(),d=await o8t(this,u);if(!(c?d.childSubtreeIsAvailableAtCoordinates:d.tileIsAvailableAtCoordinates).call(d,a))return Promise.reject(`Tile is not available at level ${t}, x ${n}, y ${i}, z ${r}.`);let{contentUriTemplates:m,baseResource:y}=s,A=m[0].getDerivedResource({templateValues:a.getTemplateValues()}),b=y.getDerivedResource({url:A.url});return nI.fromGltf(b)};var cBe=MM;function Kse(e){e=e??1,this._radius=e??1}Object.defineProperties(Kse.prototype,{radius:{get:function(){return this._radius},set:function(e){this._radius=e}}});Kse.prototype.emit=function(e){let t=P.randomBetween(0,P.TWO_PI),n=P.randomBetween(0,this._radius),i=n*Math.cos(t),r=n*Math.sin(t),o=0;e.position=h.fromElements(i,r,o,e.position),e.velocity=h.clone(h.UNIT_Z,e.velocity)};var h7=Kse;var m7={CUMULUS:0};m7.validate=function(e){return e===m7.CUMULUS};Object.freeze(m7);var NM=m7;function Sm(e,t){if(e=e??H.EMPTY_OBJECT,this._show=e.show??!0,this._position=h.clone(e.position??h.ZERO),!l(e.scale)&&l(e.maximumSize))this._maximumSize=h.clone(e.maximumSize),this._scale=new U(this._maximumSize.x,this._maximumSize.y);else{this._scale=U.clone(e.scale??new U(20,12));let n=new h(this._scale.x,this._scale.y,Math.min(this._scale.x,this._scale.y)/1.5);this._maximumSize=h.clone(e.maximumSize??n)}this._slice=e.slice??-1,this._color=z.clone(e.color??z.WHITE),this._brightness=e.brightness??1,this._cloudCollection=t,this._index=-1}var s8t=Sm.SHOW_INDEX=0,a8t=Sm.POSITION_INDEX=1,c8t=Sm.SCALE_INDEX=2,l8t=Sm.MAXIMUM_SIZE_INDEX=3,u8t=Sm.SLICE_INDEX=4,f8t=Sm.BRIGHTNESS_INDEX=5,d8t=Sm.COLOR_INDEX=6;Sm.NUMBER_OF_PROPERTIES=7;function oE(e,t){let n=e._cloudCollection;l(n)&&(n._updateCloud(e,t),e._dirty=!0)}Object.defineProperties(Sm.prototype,{show:{get:function(){return this._show},set:function(e){this._show!==e&&(this._show=e,oE(this,s8t))}},position:{get:function(){return this._position},set:function(e){let t=this._position;h.equals(t,e)||(h.clone(e,t),oE(this,a8t))}},scale:{get:function(){return this._scale},set:function(e){let t=this._scale;U.equals(t,e)||(U.clone(e,t),oE(this,c8t))}},maximumSize:{get:function(){return this._maximumSize},set:function(e){let t=this._maximumSize;h.equals(t,e)||(h.clone(e,t),oE(this,l8t))}},color:{get:function(){return this._color},set:function(e){let t=this._color;z.equals(t,e)||(z.clone(e,t),oE(this,d8t))}},slice:{get:function(){return this._slice},set:function(e){this._slice!==e&&(this._slice=e,oE(this,u8t))}},brightness:{get:function(){return this._brightness},set:function(e){this._brightness!==e&&(this._brightness=e,oE(this,f8t))}}});Sm.prototype._destroy=function(){this._cloudCollection=void 0};var oh=Sm;var Wf,p7=new h,h8t={positionHighAndScaleX:0,positionLowAndScaleY:1,packedAttribute0:2,packedAttribute1:3,color:4},m8t={direction:0,positionHighAndScaleX:1,positionLowAndScaleY:2,packedAttribute0:3,packedAttribute1:4,color:5},p8t=oh.SHOW_INDEX,g8t=oh.POSITION_INDEX,_8t=oh.SCALE_INDEX,y8t=oh.MAXIMUM_SIZE_INDEX,A8t=oh.SLICE_INDEX,b8t=oh.BRIGHTNESS_INDEX,x8t=oh.NUMBER_OF_PROPERTIES,T8t=oh.COLOR_INDEX;function wm(e){e=e??H.EMPTY_OBJECT,this._clouds=[],this._cloudsToUpdate=[],this._cloudsToUpdateIndex=0,this._cloudsRemoved=!1,this._createVertexArray=!1,this._propertiesChanged=new Uint32Array(x8t),this._noiseTexture=void 0,this._textureSliceWidth=128,this._noiseTextureRows=4,this.noiseDetail=e.noiseDetail??16,this.noiseOffset=h.clone(e.noiseOffset??h.ZERO),this._loading=!1,this._ready=!1;let t=this;this._uniforms={u_noiseTexture:function(){return t._noiseTexture},u_noiseTextureDimensions:lBe(t),u_noiseDetail:function(){return t.noiseDetail}},this._vaNoise=void 0,this._spNoise=void 0,this._spCreated=!1,this._sp=void 0,this._rs=void 0,this.show=e.show??!0,this._colorCommands=[],this.debugBillboards=e.debugBillboards??!1,this._compiledDebugBillboards=!1,this.debugEllipsoids=e.debugEllipsoids??!1,this._compiledDebugEllipsoids=!1}function lBe(e){return function(){return p7.x=e._textureSliceWidth,p7.y=e._noiseTextureRows,p7.z=1/e._noiseTextureRows,p7}}Object.defineProperties(wm.prototype,{length:{get:function(){return Jse(this),this._clouds.length}}});function uBe(e){let t=e.length;for(let n=0;n<t;++n)e[n]&&e[n]._destroy()}wm.prototype.add=function(e){e=e??H.EMPTY_OBJECT;let t=e.cloudType??NM.CUMULUS,n;return t===NM.CUMULUS&&(n=new oh(e,this),n._index=this._clouds.length,this._clouds.push(n),this._createVertexArray=!0),n};wm.prototype.remove=function(e){return this.contains(e)?(this._clouds[e._index]=void 0,this._cloudsRemoved=!0,this._createVertexArray=!0,e._destroy(),!0):!1};wm.prototype.removeAll=function(){uBe(this._clouds),this._clouds=[],this._cloudsToUpdate=[],this._cloudsToUpdateIndex=0,this._cloudsRemoved=!1,this._createVertexArray=!0};function Jse(e){if(e._cloudsRemoved){e._cloudsRemoved=!1;let t=[],n=e._clouds,i=n.length;for(let r=0,o=0;r<i;++r){let s=n[r];l(s)&&(n._index=o++,t.push(s))}e._clouds=t}}wm.prototype._updateCloud=function(e,t){e._dirty||(this._cloudsToUpdate[this._cloudsToUpdateIndex++]=e),++this._propertiesChanged[t]};wm.prototype.contains=function(e){return l(e)&&e._cloudCollection===this};wm.prototype.get=function(e){return Jse(this),this._clouds[e]};var E8t=new Float32Array([-1,-1,1,-1,1,1,-1,1]),C8t=new Uint16Array([0,1,2,0,2,3]);function v8t(e){let t=tt.createVertexBuffer({context:e,typedArray:E8t,usage:Me.STATIC_DRAW}),n=tt.createIndexBuffer({context:e,typedArray:C8t,usage:Me.STATIC_DRAW,indexDatatype:je.UNSIGNED_SHORT}),i=[{index:0,vertexBuffer:t,componentsPerAttribute:2,componentDatatype:Y.FLOAT}];return new Vn({context:e,attributes:i,indexBuffer:n})}var Zse;function S8t(e){let n=e.cache.cloudCollection_indexBufferBatched;if(l(n))return n;let i=16384*6-6,r=new Uint16Array(i);for(let o=0,s=0;o<i;o+=6,s+=4)r[o]=s,r[o+1]=s+1,r[o+2]=s+2,r[o+3]=s,r[o+4]=s+2,r[o+5]=s+3;return n=tt.createIndexBuffer({context:e,typedArray:r,usage:Me.STATIC_DRAW,indexDatatype:je.UNSIGNED_SHORT}),n.vertexArrayDestroyable=!1,e.cache.cloudCollection_indexBufferBatched=n,n}function w8t(e){let t=e.cache.cloudCollection_indexBufferInstanced;return l(t)||(t=tt.createIndexBuffer({context:e,typedArray:new Uint16Array([0,1,2,0,2,3]),usage:Me.STATIC_DRAW,indexDatatype:je.UNSIGNED_SHORT}),t.vertexArrayDestroyable=!1,e.cache.cloudCollection_indexBufferInstanced=t),t}function I8t(e){let t=e.cache.cloudCollection_vertexBufferInstanced;return l(t)||(t=tt.createVertexBuffer({context:e,typedArray:new Float32Array([0,0,1,0,1,1,0,1]),usage:Me.STATIC_DRAW}),t.vertexArrayDestroyable=!1,e.cache.cloudCollection_vertexBufferInstanced=t),t}function P8t(e,t,n){let i=[{index:Wf.positionHighAndScaleX,componentsPerAttribute:4,componentDatatype:Y.FLOAT,usage:Me.STATIC_DRAW},{index:Wf.positionLowAndScaleY,componentsPerAttribute:4,componentDatatype:Y.FLOAT,usage:Me.STATIC_DRAW},{index:Wf.packedAttribute0,componentsPerAttribute:4,componentDatatype:Y.FLOAT,usage:Me.STATIC_DRAW},{index:Wf.packedAttribute1,componentsPerAttribute:4,componentDatatype:Y.FLOAT,usage:Me.STATIC_DRAW},{index:Wf.color,componentsPerAttribute:4,componentDatatype:Y.UNSIGNED_BYTE,normalize:!0,usage:Me.STATIC_DRAW}];n&&i.push({index:Wf.direction,componentsPerAttribute:2,componentDatatype:Y.FLOAT,vertexBuffer:I8t(e)});let r=n?t:4*t;return new k_(e,i,r,n)}var $se=new Sn;function fBe(e,t,n,i){let r,o=n[Wf.positionHighAndScaleX],s=n[Wf.positionLowAndScaleY],a=i.position;Sn.fromCartesian(a,$se);let c=i.scale,u=$se.high,f=$se.low;e._instanced?(r=i._index,o(r,u.x,u.y,u.z,c.x),s(r,f.x,f.y,f.z,c.y)):(r=i._index*4,o(r+0,u.x,u.y,u.z,c.x),o(r+1,u.x,u.y,u.z,c.x),o(r+2,u.x,u.y,u.z,c.x),o(r+3,u.x,u.y,u.z,c.x),s(r+0,f.x,f.y,f.z,c.y),s(r+1,f.x,f.y,f.z,c.y),s(r+2,f.x,f.y,f.z,c.y),s(r+3,f.x,f.y,f.z,c.y))}function dBe(e,t,n,i){let r,o=n[Wf.packedAttribute0],s=i.show,a=i.brightness;e._instanced?(r=i._index,o(r,s,a,0,0)):(r=i._index*4,o(r+0,s,a,0,0),o(r+1,s,a,1,0),o(r+2,s,a,1,1),o(r+3,s,a,0,1))}function hBe(e,t,n,i){let r,o=n[Wf.packedAttribute1],s=i.maximumSize,a=i.slice;e._instanced?(r=i._index,o(r,s.x,s.y,s.z,a)):(r=i._index*4,o(r+0,s.x,s.y,s.z,a),o(r+1,s.x,s.y,s.z,a),o(r+2,s.x,s.y,s.z,a),o(r+3,s.x,s.y,s.z,a))}function mBe(e,t,n,i){let r,o=n[Wf.color],s=i.color,a=z.floatToByte(s.red),c=z.floatToByte(s.green),u=z.floatToByte(s.blue),f=z.floatToByte(s.alpha);e._instanced?(r=i._index,o(r,a,c,u,f)):(r=i._index*4,o(r+0,a,c,u,f),o(r+1,a,c,u,f),o(r+2,a,c,u,f),o(r+3,a,c,u,f))}function D8t(e,t,n,i){fBe(e,t,n,i),dBe(e,t,n,i),hBe(e,t,n,i),mBe(e,t,n,i)}function R8t(e,t,n,i){let r=e,o=r._textureSliceWidth,s=r._noiseTextureRows,a=t.context;r._vaNoise=v8t(a),r._spNoise=Qt.fromCache({context:a,vertexShaderSource:n,fragmentShaderSource:i,attributeLocations:{position:0}});let c=r.noiseDetail,u=r.noiseOffset;r._noiseTexture=new Dt({context:a,width:o*o/s,height:o*s,pixelDatatype:ze.UNSIGNED_BYTE,pixelFormat:$e.RGBA,sampler:new Ht({wrapS:hn.REPEAT,wrapT:hn.REPEAT,minificationFilter:Wt.NEAREST,magnificationFilter:Jn.NEAREST})});let f=new Jf({vertexArray:r._vaNoise,shaderProgram:r._spNoise,outputTexture:r._noiseTexture,uniformMap:{u_noiseTextureDimensions:lBe(r),u_noiseDetail:function(){return c},u_noiseOffset:function(){return u}},persists:!1,owner:e,postExecute:function(d){r._ready=!0,r._loading=!1}});t.commandList.push(f),r._loading=!0}function O8t(e,t){let n=e,i=t.context;n._createVertexArray=!1,n._vaf=n._vaf&&n._vaf.destroy();let r=e._clouds,o=r.length;if(o>0){n._vaf=P8t(i,o,n._instanced);let s=n._vaf.writers,a;for(a=0;a<o;++a){let c=r[a];D8t(e,t,s,c)}n._vaf.commit(Zse(i))}}var M8t=[];function N8t(e,t){let n=t.context,i=e,o=i._clouds.length,s=i._cloudsToUpdate,a=i._cloudsToUpdateIndex,c=i._propertiesChanged,u=M8t;u.length=0,(c[g8t]||c[_8t])&&u.push(fBe),(c[p8t]||c[b8t])&&u.push(dBe),(c[y8t]||c[A8t])&&u.push(hBe),c[T8t]&&u.push(mBe);let f=u.length,d=i._vaf.writers,p,g,m;if(a/o>.1){for(p=0;p<a;++p)for(g=s[p],g._dirty=!1,m=0;m<f;++m)u[m](e,t,d,g);i._vaf.commit(Zse(n))}else{for(p=0;p<a;++p){for(g=s[p],g._dirty=!1,m=0;m<f;++m)u[m](e,t,d,g);i._instanced?i._vaf.subCommit(g._index,1):i._vaf.subCommit(g._index*4,4)}i._vaf.endSubCommits()}i._cloudsToUpdateIndex=0}function L8t(e,t,n,i){let r=t.context,o=e,s=new Xe({defines:[],sources:[n]});o._instanced&&s.defines.push("INSTANCED");let a=new Xe({defines:[],sources:[i]});o.debugBillboards&&a.defines.push("DEBUG_BILLBOARDS"),o.debugEllipsoids&&a.defines.push("DEBUG_ELLIPSOIDS"),o._sp=Qt.replaceCache({context:r,shaderProgram:o._sp,vertexShaderSource:s,fragmentShaderSource:a,attributeLocations:Wf}),o._rs=Ge.fromCache({depthTest:{enabled:!0,func:te.LESS},depthMask:!1,blending:nn.ALPHA_BLEND}),o._spCreated=!0,o._compiledDebugBillboards=o.debugBillboards,o._compiledDebugEllipsoids=o.debugEllipsoids}function F8t(e,t){let n=e,i=t.passes,r=n._uniforms,o=t.commandList;if(i.render){let s=n._colorCommands,a=n._vaf.va,c=a.length;s.length=c;for(let u=0;u<c;u++){let f=s[u];l(f)||(f=s[u]=new at),f.pass=Ie.TRANSLUCENT,f.owner=e,f.uniformMap=r,f.count=a[u].indicesCount,f.vertexArray=a[u].va,f.shaderProgram=n._sp,f.renderState=n._rs,n._instanced&&(f.count=6,f.instanceCount=n._clouds.length),o.push(f)}}}wm.prototype.update=function(e){if(Jse(this),!this.show)return;let t=this.debugBillboards||this.debugEllipsoids;this._ready=t?!0:l(this._noiseTexture),!this._ready&&!this._loading&&!t&&R8t(this,e,v2,C2),this._instanced=e.context.instancedArrays,Wf=this._instanced?m8t:h8t,Zse=this._instanced?w8t:S8t;let i=this._clouds.length,r=this._cloudsToUpdate,o=this._cloudsToUpdateIndex;this._createVertexArray?O8t(this,e):o>0&&N8t(this,e),o>i*1.5&&(r.length=i),!(!l(this._vaf)||!l(this._vaf.va)||!this._ready&!t)&&((!this._spCreated||this.debugBillboards!==this._compiledDebugBillboards||this.debugEllipsoids!==this._compiledDebugEllipsoids)&&L8t(this,e,E2,T2),F8t(this,e))};wm.prototype.isDestroyed=function(){return!1};wm.prototype.destroy=function(){return this._noiseTexture=this._noiseTexture&&this._noiseTexture.destroy(),this._sp=this._sp&&this._sp.destroy(),this._vaf=this._vaf&&this._vaf.destroy(),uBe(this._clouds),le(this)};var pBe=wm;var B8t=P.toRadians(30);function Qse(e){this._angle=e??B8t}Object.defineProperties(Qse.prototype,{angle:{get:function(){return this._angle},set:function(e){this._angle=e}}});Qse.prototype.emit=function(e){let t=Math.tan(this._angle),n=P.randomBetween(0,P.TWO_PI),i=P.randomBetween(0,t),r=i*Math.cos(n),o=i*Math.sin(n),s=1;e.velocity=h.fromElements(r,o,s,e.velocity),h.normalize(e.velocity,e.velocity),e.position=h.clone(h.ZERO,e.position)};var gBe=Qse;var k8t=new z,U8t=new z,z8t=new z,V8t=new z,_Be=new se,LM=new Uint8Array(4);function yBe(e,t,n,i){let r=t.height===n.height?0:(e-t.height)/(n.height-t.height);return z.lerp(t.color,n.color,r,i)}function g7(e,t){return{height:e,color:z.clone(t)}}function ABe(e){return e=e.filter(function(t,n,i){let r=n>0,o=n<i.length-1,s=r?t.height===i[n-1].height:!0,a=o?t.height===i[n+1].height:!0;return!s||!a}),e=e.filter(function(t,n,i){let r=n>0,o=n<i.length-1,s=r?z.equals(t.color,i[n-1].color):!1,a=o?z.equals(t.color,i[n+1].color):!1;return!s||!a}),e=e.filter(function(t,n,i){let r=n>0,o=r?z.equals(t.color,i[n-1].color):!1,s=r?t.height===i[n-1].height:!0;return!o||!s}),e}function j8t(e){let t,n,i=[],r=e.length;for(t=0;t<r;t++){let o=e[t],s=o.entries,a=s.length,c=[];for(n=0;n<a;n++){let g=s[n],m=P.clamp(g.height,Ku._minimumHeight,Ku._maximumHeight),y=z.clone(g.color,k8t);y.red*=y.alpha,y.green*=y.alpha,y.blue*=y.alpha,c.push(g7(m,y))}let u=!0,f=!0;for(n=0;n<a-1;n++){let g=c[n+0],m=c[n+1];u=u&&g.height<=m.height,f=f&&g.height>=m.height}f?c=c.reverse():u||t_(c,function(g,m){return P.sign(g.height-m.height)});let d=o.extendDownwards??!1,p=o.extendUpwards??!1;c.length===1&&!d&&!p&&(d=!0,p=!0),d&&c.splice(0,0,g7(Ku._minimumHeight,c[0].color)),p&&c.splice(c.length,0,g7(Ku._maximumHeight,c[c.length-1].color)),c=ABe(c),i.push(c)}return i}function H8t(e){let t=j8t(e),n=[],i,r;function o(u,f){n.push(g7(u,f))}function s(u,f,d){let p=z.multiplyByScalar(d,1-f.alpha,V8t);p=z.add(p,f,p),o(u,p)}let a=t.length;for(r=0;r<a;r++){let u=t[r],f=0,d=0;i=n,n=[];let p=u.length,g=i.length;for(;f<p||d<g;){let m=f<p?u[f]:void 0,y=f>0?u[f-1]:void 0,A=f<p-1?u[f+1]:void 0,b=d<g?i[d]:void 0,x=d>0?i[d-1]:void 0,T=d<g-1?i[d+1]:void 0;if(l(m)&&l(b)&&m.height===b.height){let E=l(T)&&b.height===T.height,v=!l(x),S=!l(T),I=l(A)&&m.height===A.height,R=!l(y),O=!l(A);E?I?(s(m.height,m.color,b.color),s(m.height,A.color,T.color)):R?(o(m.height,b.color),s(m.height,m.color,T.color)):O?(s(m.height,m.color,b.color),o(m.height,T.color)):(s(m.height,m.color,b.color),s(m.height,m.color,T.color)):v?I?(o(m.height,m.color),s(m.height,A.color,b.color)):O?(o(m.height,m.color),o(m.height,b.color)):(R||o(m.height,m.color),s(m.height,m.color,b.color)):S?I?(s(m.height,m.color,b.color),o(m.height,A.color)):R?(o(m.height,b.color),o(m.height,m.color)):O?s(m.height,m.color,b.color):(s(m.height,m.color,b.color),o(m.height,m.color)):I?(s(m.height,m.color,b.color),s(m.height,A.color,b.color)):R?(o(m.height,b.color),s(m.height,m.color,b.color)):O?(s(m.height,m.color,b.color),o(m.height,b.color)):s(m.height,m.color,b.color),f+=I?2:1,d+=E?2:1}else if(l(m)&&l(b)&&l(x)&&m.height<b.height){let E=yBe(m.height,x,b,z8t);l(y)?l(A)?s(m.height,m.color,E):(s(m.height,m.color,E),o(m.height,E)):(o(m.height,E),s(m.height,m.color,E)),f++}else if(l(b)&&l(m)&&l(y)&&b.height<m.height){let E=yBe(b.height,y,m,U8t);l(x)?l(T)?s(b.height,E,b.color):(s(b.height,E,b.color),o(b.height,E)):(o(b.height,E),s(b.height,E,b.color)),d++}else l(m)&&(!l(b)||m.height<b.height)?(l(b)&&!l(x)&&!l(A)?(o(m.height,m.color),o(m.height,Ku._emptyColor),o(b.height,Ku._emptyColor)):(!l(b)&&l(x)&&!l(y)&&(o(x.height,Ku._emptyColor),o(m.height,Ku._emptyColor)),o(m.height,m.color)),f++):l(b)&&(!l(m)||b.height<m.height)&&(o(b.height,b.color),d++)}}return ABe(n)}function Ku(e){let{scene:t,layers:n}=e??H.EMPTY_OBJECT,{context:i}=t,r=H8t(n),o=r.length,s,a,c;if(!Ku._useFloatTexture(i)){a=ze.UNSIGNED_BYTE,c=$e.RGBA,s=new Uint8Array(o*4);for(let g=0;g<o;g++)se.packFloat(r[g].height,_Be),se.pack(_Be,s,g*4)}else{a=ze.FLOAT,c=i.webgl2?$e.RED:$e.LUMINANCE,s=new Float32Array(o);for(let g=0;g<o;g++)s[g]=r[g].height}let f=Dt.create({context:i,pixelFormat:c,pixelDatatype:a,source:{arrayBufferView:s,width:o,height:1},sampler:new Ht({wrapS:hn.CLAMP_TO_EDGE,wrapT:hn.CLAMP_TO_EDGE,minificationFilter:Wt.NEAREST,magnificationFilter:Jn.NEAREST})}),d=new Uint8Array(o*4);for(let g=0;g<o;g++)r[g].color.toBytes(LM),d[g*4+0]=LM[0],d[g*4+1]=LM[1],d[g*4+2]=LM[2],d[g*4+3]=LM[3];let p=Dt.create({context:i,pixelFormat:$e.RGBA,pixelDatatype:ze.UNSIGNED_BYTE,source:{arrayBufferView:d,width:o,height:1},sampler:new Ht({wrapS:hn.CLAMP_TO_EDGE,wrapT:hn.CLAMP_TO_EDGE,minificationFilter:Wt.LINEAR,magnificationFilter:Jn.LINEAR})});return ir.fromType("ElevationBand",{heights:f,colors:p})}Ku._useFloatTexture=function(e){return e.floatingPointTexture};Ku._maximumHeight=5906376425472;Ku._minimumHeight=-5906376425472;Ku._emptyColor=new z(0,0,0,0);var bBe=Ku;async function G8t(e,t){t=t??{},t.cacheBytes=t.cacheBytes??1536*1024*1024,t.maximumCacheOverflowBytes=t.maximumCacheOverflowBytes??1024*1024*1024,t.enableCollision=t.enableCollision??!0,e=e??H.EMPTY_OBJECT,e.onlyUsingWithGoogleGeocoder||yt("google-tiles-with-google-geocoder","Only the Google geocoder can be used with Google Photorealistic 3D Tiles. Set the `geocode` property of Viewer constructor options. You can set additionalOptions.onlyUsingWithGoogleGeocoder to hide this warning once you have configured the geocoder.");let n=e.key??Fa.defaultApiKey;if(!l(n))return W8t(t);let i,r=Fa.getDefaultCredit();l(r)&&(i=[r]);let o=new De({url:`${Fa.mapTilesApiEndpoint}v1/3dtiles/root.json`,queryParameters:{key:n},credits:i});return Zo.fromUrl(o,t)}var xBe={};async function W8t(e){let i=xBe[2275207];l(i)||(i=Yo.fromAssetId(2275207),xBe[2275207]=i);let r=await i;return Zo.fromUrl(r,e)}var TBe=G8t;async function q8t(e){let t=await Zo.fromIonAssetId(96188,e);e=e??H.EMPTY_OBJECT;let n=e.style;if(!l(n)){let i=(e.defaultColor??z.WHITE).toCssColorString();n=new Vy({color:`Boolean(\${feature['cesium#color']}) ? color(\${feature['cesium#color']}) : ${i}`})}return t.style=n,t}var EBe=q8t;function Y8t(e){e=e??H.EMPTY_OBJECT;let t=[],n=e.geometry;(!l(n.attributes)||!l(n.primitiveType))&&(n=n.constructor.createGeometry(n));let i=n.attributes,r=M.clone(e.modelMatrix??M.IDENTITY),o=e.length??1e4;if(l(i.normal)&&t.push(new Bt({geometry:Wn.createLineSegmentsForVectors(n,"normal",o),attributes:{color:new Jt(1,0,0,1)},modelMatrix:r})),l(i.tangent)&&t.push(new Bt({geometry:Wn.createLineSegmentsForVectors(n,"tangent",o),attributes:{color:new Jt(0,1,0,1)},modelMatrix:r})),l(i.bitangent)&&t.push(new Bt({geometry:Wn.createLineSegmentsForVectors(n,"bitangent",o),attributes:{color:new Jt(0,0,1,1)},modelMatrix:r})),t.length>0)return new Mn({asynchronous:!1,geometryInstances:t,appearance:new An({flat:!0,translucent:!1})})}var CBe=Y8t;function FM(e){e=e??H.EMPTY_OBJECT;let t=e.attributeName,n=e.perInstanceAttribute;l(n)||(n=!1);let i=e.glslDatatype??"vec3",r=`v_${t}`,o;if(t==="normal"||t==="tangent"||t==="bitangent")o=`vec4 getColor() { return vec4((${r} + vec3(1.0)) * 0.5, 1.0); } -`;else switch(t==="st"&&(i="vec2"),i){case"float":o=`vec4 getColor() { return vec4(vec3(${r}), 1.0); } -`;break;case"vec2":o=`vec4 getColor() { return vec4(${r}, 0.0, 1.0); } -`;break;case"vec3":o=`vec4 getColor() { return vec4(${r}, 1.0); } -`;break;case"vec4":o=`vec4 getColor() { return ${r}; } -`;break}let s=`in vec3 position3DHigh; -in vec3 position3DLow; -in float batchId; -${n?"":`in ${i} ${t}; -`}out ${i} ${r}; -void main() -{ -vec4 p = czm_translateRelativeToEye(position3DHigh, position3DLow); -${n?`${r} = czm_batchTable_${t}(batchId); -`:`${r} = ${t}; -`}gl_Position = czm_modelViewProjectionRelativeToEye * p; -}`,a=`in ${i} ${r}; -${o} -void main() -{ -out_FragColor = getColor(); -}`;this.material=void 0,this.translucent=e.translucent??!1,this._vertexShaderSource=e.vertexShaderSource??s,this._fragmentShaderSource=e.fragmentShaderSource??a,this._renderState=Rr.getDefaultRenderState(!1,!1,e.renderState),this._closed=e.closed??!1,this._attributeName=t,this._glslDatatype=i}Object.defineProperties(FM.prototype,{vertexShaderSource:{get:function(){return this._vertexShaderSource}},fragmentShaderSource:{get:function(){return this._fragmentShaderSource}},renderState:{get:function(){return this._renderState}},closed:{get:function(){return this._closed}},attributeName:{get:function(){return this._attributeName}},glslDatatype:{get:function(){return this._glslDatatype}}});FM.prototype.getFragmentShaderSource=Rr.prototype.getFragmentShaderSource;FM.prototype.isTranslucent=Rr.prototype.isTranslucent;FM.prototype.getRenderState=Rr.prototype.getRenderState;var vBe=FM;function _7(e){e=e??H.EMPTY_OBJECT,this.length=e.length??1e7,this._length=void 0,this.width=e.width??2,this._width=void 0,this.show=e.show??!0,this.modelMatrix=M.clone(e.modelMatrix??M.IDENTITY),this._modelMatrix=new M,this.id=e.id,this._id=void 0,this._primitive=void 0}_7.prototype.update=function(e){if(this.show){if(!l(this._primitive)||!M.equals(this._modelMatrix,this.modelMatrix)||this._length!==this.length||this._width!==this.width||this._id!==this.id){this._modelMatrix=M.clone(this.modelMatrix,this._modelMatrix),this._length=this.length,this._width=this.width,this._id=this.id,l(this._primitive)&&this._primitive.destroy(),this.modelMatrix[12]===0&&this.modelMatrix[13]===0&&this.modelMatrix[14]===0&&(this.modelMatrix[14]=.01);let t=new Bt({geometry:new yA({positions:[h.ZERO,h.UNIT_X],width:this.width,vertexFormat:Ys.VERTEX_FORMAT,colors:[z.RED,z.RED],arcType:ln.NONE}),modelMatrix:M.multiplyByUniformScale(this.modelMatrix,this.length,new M),id:this.id,pickPrimitive:this}),n=new Bt({geometry:new yA({positions:[h.ZERO,h.UNIT_Y],width:this.width,vertexFormat:Ys.VERTEX_FORMAT,colors:[z.GREEN,z.GREEN],arcType:ln.NONE}),modelMatrix:M.multiplyByUniformScale(this.modelMatrix,this.length,new M),id:this.id,pickPrimitive:this}),i=new Bt({geometry:new yA({positions:[h.ZERO,h.UNIT_Z],width:this.width,vertexFormat:Ys.VERTEX_FORMAT,colors:[z.BLUE,z.BLUE],arcType:ln.NONE}),modelMatrix:M.multiplyByUniformScale(this.modelMatrix,this.length,new M),id:this.id,pickPrimitive:this});this._primitive=new Mn({geometryInstances:[t,n,i],appearance:new Ys,asynchronous:!1})}this._primitive.update(e)}};_7.prototype.isDestroyed=function(){return!1};_7.prototype.destroy=function(){return this._primitive=this._primitive&&this._primitive.destroy(),le(this)};var y7=_7;var X8t=new TextDecoder,A7={UNKNOWN:0,POINT:1,LINESTRING:2,POLYGON:3},K8t={LAYERS:3},BM={NAME:1,FEATURES:2,KEYS:3,VALUES:4,EXTENT:5},eae={TAGS:2,TYPE:3,GEOMETRY:4},sE={STRING:1,FLOAT:2,DOUBLE:3,INT64:4,UINT64:5,SINT64:6,BOOL:7},$8t=["Unknown","Point","LineString","Polygon"];function J8t(e){let t=new Uint8Array(e),n=[],i=0;for(;i<t.length;){let r=b7(t,i,t.length),o=r.fieldNumber,s=r.wireType;if(i=r.newPos,o===K8t.LAYERS&&s===2){let a=g_(t,i,t.length);i=a.newPos;let c=$u(i,a.value,t.length,"layer");n.push(Z8t(t,i,c)),i=c}else i=x7(t,i,s,t.length)}return{layers:n}}function Z8t(e,t,n){let i=t,r="",o=4096,s=[],a=[],c=[];for(;i<n;){let f=b7(e,i,n),d=f.fieldNumber,p=f.wireType;if(i=f.newPos,d===BM.NAME&&p===2){let g=g_(e,i,n);i=g.newPos;let m=$u(i,g.value,n,"layer name");r=nae(e,i,g.value),i=m}else if(d===BM.FEATURES&&p===2){let g=g_(e,i,n);i=g.newPos;let m=$u(i,g.value,n,"feature");c.push({start:i,end:m}),i=m}else if(d===BM.KEYS&&p===2){let g=g_(e,i,n);i=g.newPos;let m=$u(i,g.value,n,"key");s.push(nae(e,i,g.value)),i=m}else if(d===BM.VALUES&&p===2){let g=g_(e,i,n);i=g.newPos;let m=$u(i,g.value,n,"value"),y=tjt(e,i,m);a.push(y),i=m}else if(d===BM.EXTENT&&p===0){let g=EI(e,i,n);o=g.value,i=g.newPos}else i=x7(e,i,p,n)}let u=c.map(({start:f,end:d})=>Q8t(e,f,d,s,a));return{name:r,extent:o,features:u}}function Q8t(e,t,n,i,r){let o=t,s=A7.UNKNOWN,a=[],c=[];for(;o<n;){let d=b7(e,o,n),p=d.fieldNumber,g=d.wireType;if(o=d.newPos,p===eae.TYPE&&g===0){let m=EI(e,o,n);s=m.value,o=m.newPos}else if(p===eae.TAGS&&g===2){let m=g_(e,o,n);o=m.newPos;let y=$u(o,m.value,n,"feature tags");for(;o<y;){let A=EI(e,o,y);a.push(A.value),o=A.newPos}}else if(p===eae.GEOMETRY&&g===2){let m=g_(e,o,n);o=m.newPos;let y=$u(o,m.value,n,"feature geometry");for(;o<y;){let A=EI(e,o,y);c.push(A.value),o=A.newPos}}else o=x7(e,o,g,n)}let u={};for(let d=0;d<a.length-1;d+=2){let p=i[a[d]],g=r[a[d+1]];typeof p!="string"||g===void 0||(u[p]=g)}let f=ejt(s,c);return{type:$8t[s]??"Unknown",geometry:f,properties:u}}function ejt(e,t){let n=0,i=0,r=0;if(e===A7.POINT){let o=[];for(;n<t.length;){let s=t[n++],a=s&7,c=s>>3;if(a===1)for(let u=0;u<c;u++)i+=x0(t[n++]),r+=x0(t[n++]),o.push({x:i,y:r})}return o}if(e===A7.LINESTRING){let o=[],s=null;for(;n<t.length;){let a=t[n++],c=a&7,u=a>>3;if(c===1)s!==null&&o.push(s),s=[],i+=x0(t[n++]),r+=x0(t[n++]),s.push({x:i,y:r});else if(c===2)for(let f=0;f<u;f++)i+=x0(t[n++]),r+=x0(t[n++]),s.push({x:i,y:r})}return s!==null&&o.push(s),o}if(e===A7.POLYGON){let o=[],s=null;for(;n<t.length;){let a=t[n++],c=a&7,u=a>>3;if(c===1)s!==null&&o.push(s),s=[],i+=x0(t[n++]),r+=x0(t[n++]),s.push({x:i,y:r});else if(c===2)for(let f=0;f<u;f++)i+=x0(t[n++]),r+=x0(t[n++]),s.push({x:i,y:r});else c===7&&s!==null&&s.length>0&&(s.push({x:s[0].x,y:s[0].y}),o.push(s),s=null)}return s!==null&&o.push(s),o}return[]}function tjt(e,t,n){let i=t;for(;i<n;){let r=b7(e,i,n),o=r.fieldNumber,s=r.wireType;if(i=r.newPos,o===sE.STRING&&s===2){let a=g_(e,i,n);i=a.newPos;let c=$u(i,a.value,n,"string value");return nae(e,i,c-i)}else{if(o===sE.FLOAT&&s===5)return $u(i,4,n,"float value"),new DataView(e.buffer,e.byteOffset+i,4).getFloat32(0,!0);if(o===sE.DOUBLE&&s===1)return $u(i,8,n,"double value"),new DataView(e.buffer,e.byteOffset+i,8).getFloat64(0,!0);if(o===sE.INT64&&s===0){let a=CI(e,i,n);return tae(a.value)}else if(o===sE.UINT64&&s===0){let a=CI(e,i,n);return tae(a.value)}else if(o===sE.SINT64&&s===0){let a=CI(e,i,n);return tae(njt(a.value))}else if(o===sE.BOOL&&s===0)return EI(e,i,n).value!==0}i=x7(e,i,s,n)}}function b7(e,t,n){let i=EI(e,t,n);return{fieldNumber:i.value>>>3,wireType:i.value&7,newPos:i.newPos}}function EI(e,t,n){let i=CI(e,t,n,5);if(i.value>0xffffffffn)throw new oe("Invalid MVT uint32 varint.");return{value:Number(i.value),newPos:i.newPos}}function g_(e,t,n){let i=CI(e,t,n);if(i.value>BigInt(Number.MAX_SAFE_INTEGER))throw new oe("Invalid MVT length varint.");return{value:Number(i.value),newPos:i.newPos}}function CI(e,t,n,i){let r=0n,o=0n,s=0,a=i??10;for(;;){if(t>=n||t>=e.length)throw new oe("Invalid MVT: truncated varint.");let c=e[t++];if(r|=BigInt(c&127)<<o,s++,(c&128)===0)break;if(s>=a)throw new oe("Invalid MVT: varint is too long.");o+=7n}return{value:r,newPos:t}}function nae(e,t,n){let i=$u(t,n,e.length,"string");return X8t.decode(e.subarray(t,i))}function $u(e,t,n,i){if(!Number.isFinite(t)||t<0)throw new oe(`Invalid MVT ${i}: invalid length.`);let r=e+t;if(!Number.isFinite(r)||r<e||r>n)throw new oe(`Invalid MVT ${i}: length exceeds available bytes.`);return r}function x7(e,t,n,i){if(n===0)return CI(e,t,i).newPos;if(n===1)return $u(t,8,i,"fixed64 field");if(n===2){let r=g_(e,t,i);return $u(r.newPos,r.value,i,"length-delimited field")}else if(n===5)return $u(t,4,i,"fixed32 field");throw new oe(`Unsupported protobuf wire type: ${n}`)}function x0(e){return e>>>1^-(e&1)}function njt(e){return e>>1n^-(e&1n)}function tae(e){return e<=BigInt(Number.MAX_SAFE_INTEGER)&&e>=BigInt(Number.MIN_SAFE_INTEGER)?Number(e):e}var T7=J8t;function ijt(e){this.direction=h.clone(e.direction),this.color=z.clone(e.color??z.WHITE),this.intensity=e.intensity??1}var SBe=ijt;var E7=`in vec3 v_positionMC; +${m}`);let y=document.createElement("div");y.className="cesium-widget-errorPanel-message-details collapsed";let A=document.createElement("span");A.className="cesium-widget-errorPanel-more-details",A.appendChild(document.createTextNode("See more...")),y.appendChild(A),y.onclick=function(b){y.removeChild(A),y.appendChild(document.createTextNode(m)),y.className="cesium-widget-errorPanel-message-details",o.className="cesium-widget-errorPanel-content expanded",y.onclick=void 0},a.appendChild(y)}g.innerHTML=`<p>${t}</p>`}let d=document.createElement("div");d.className="cesium-widget-errorPanel-buttonPanel",o.appendChild(d);let p=document.createElement("button");p.setAttribute("type","button"),p.className="cesium-button",p.appendChild(document.createTextNode("OK")),p.onclick=function(){l(c)&&l(window.removeEventListener)&&window.removeEventListener("resize",c,!1),i.removeChild(r)},d.appendChild(p),i.appendChild(r)};zr.prototype.isDestroyed=function(){return!1};zr.prototype.destroy=function(){let e=this.dataSources,t=e.length;for(let n=0;n<t;n++)this._dataSourceRemoved(e,e.get(n));this._dataSourceRemoved(void 0,this._dataSourceDisplay.defaultDataSource),this._dataSourceDisplay=this._dataSourceDisplay.destroy(),l(this._scene)&&(this._scene.renderError.removeEventListener(this._onRenderError),this._scene=this._scene.destroy()),this._container.removeChild(this._element),this._creditContainer.removeChild(this._innerCreditContainer),this._eventHelper.removeAll(),this._destroyDataSourceCollection&&(this._dataSourceCollection=this._dataSourceCollection.destroy()),le(this)};zr.prototype.resize=function(){let e=this._canvas;!this._forceResize&&this._canvasClientWidth===e.clientWidth&&this._canvasClientHeight===e.clientHeight&&this._lastDevicePixelRatio===window.devicePixelRatio||(this._forceResize=!1,MDe(this),NDe(this),this._scene.requestRender())};zr.prototype.render=function(){if(this._canRender){this._scene.initializeFrame();let e=this._clock.tick();this._scene.render(e)}else this._clock.tick()};zr.prototype._dataSourceAdded=function(e,t){t.entities.collectionChanged.addEventListener(zr.prototype._onEntityCollectionChanged,this)};zr.prototype._dataSourceRemoved=function(e,t){let n=t.entities;n.collectionChanged.removeEventListener(zr.prototype._onEntityCollectionChanged,this),l(this.trackedEntity)&&n.getById(this.trackedEntity.id)===this.trackedEntity&&(this.trackedEntity=void 0)};zr.prototype._updateCanAnimate=function(e){this._clock.canAnimate=e};var fNt=new ue;zr.prototype._onTick=function(e){let t=e.currentTime,n=this._dataSourceDisplay.update(t);this._allowDataSourcesToSuspendAnimation&&this._canAnimateUpdateCallback(n);let i=this._entityView;if(l(i)){let r=this._trackedEntity;this._dataSourceDisplay.getBoundingSphere(r,!1,i.boundingSphere??fNt)===Pt.DONE&&i.update(t)}};zr.prototype._onEntityCollectionChanged=function(e,t,n){let i=n.length;for(let r=0;r<i;r++){let o=n[r];this.trackedEntity===o&&(this.trackedEntity=void 0)}};zr.prototype._clearTrackedObject=function(){this.trackedEntity=void 0};zr.prototype._onDataSourceChanged=function(e){this.clockTrackedDataSource===e&&RDe(this.clock,e)};zr.prototype._onDataSourceAdded=function(e,t){this._automaticallyTrackDataSourceClocks&&(this.clockTrackedDataSource=t);let n=t.entities.id,i=this._eventHelper.add(t.changedEvent,zr.prototype._onDataSourceChanged,this);this._dataSourceChangedListeners[n]=i};zr.prototype._onDataSourceRemoved=function(e,t){let n=this.clockTrackedDataSource===t,i=t.entities.id;if(this._dataSourceChangedListeners[i](),this._dataSourceChangedListeners[i]=void 0,n){let r=e.length;this._automaticallyTrackDataSourceClocks&&r>0?this.clockTrackedDataSource=e.get(r-1):this.clockTrackedDataSource=void 0}};zr.prototype.addController=function(e){return this.scene.controllerHost.registerController(e,this.container)};zr.prototype.removeController=function(e){return this.scene.controllerHost.unregisterController(e,this.container)};zr.prototype.zoomTo=function(e,t){return LDe(this,e,{offset:t},!1)};zr.prototype.flyTo=function(e,t){return LDe(this,e,t,!0)};function LDe(e,t,n,i){tie(e);let r=new Promise(o=>{e._completeZoom=function(s){o(s)}});return e._zoomPromise=r,e._zoomIsFlight=i,e._zoomOptions=n,Promise.resolve(t).then(function(o){if(e._zoomPromise===r){if(o instanceof Ns){let s;l(o.imageryProvider)?s=Promise.resolve(o.getImageryRectangle()):s=new Promise(a=>{let c=o.readyEvent.addEventListener(()=>{c(),a(o.getImageryRectangle())})}),s.then(function(a){return jS(a,e.scene)}).then(function(a){e._zoomPromise===r&&(e._zoomTarget=a)});return}if(o instanceof ts||o instanceof mO||o instanceof bT||o instanceof da){e._zoomTarget=o;return}if(o.isLoading&&l(o.loadingEvent)){let s=o.loadingEvent.addEventListener(function(){s(),e._zoomPromise===r&&(e._zoomTarget=o.entities.values.slice(0))});return}if(Array.isArray(o)){e._zoomTarget=o.slice(0);return}o=o.values??o,l(o.entities)&&(o=o.entities.values),Array.isArray(o)?e._zoomTarget=o.slice(0):e._zoomTarget=[o]}}),e.scene.requestRender(),r}function pO(e){e._zoomPromise=void 0,e._zoomTarget=void 0,e._zoomOptions=void 0}function tie(e){let t=e._zoomPromise;l(t)&&(pO(e),e._completeZoom(!1))}zr.prototype._postRender=function(){dNt(this),hNt(this)};var PDe=new ue;function dNt(e){let t=e._zoomTarget;if(!l(t)||e.scene.mode===re.MORPHING)return;let n=e.scene,i=n.camera,r=e._zoomOptions??{},o;function s(f){l(r.offset)||(r.offset=new xh(0,-.5,f.radius)),o={offset:r.offset,duration:r.duration,maximumHeight:r.maximumHeight,complete:function(){e._completeZoom(!0)},cancel:function(){e._completeZoom(!1)}},e._zoomIsFlight?i.flyToBoundingSphere(f,o):(i.viewBoundingSphere(f,r.offset),i.lookAtTransform(M.IDENTITY),e._completeZoom(!0)),pO(e)}if(t instanceof mO){if(l(t.boundingSphere)){s(t.boundingSphere);return}let f=t.frameChanged.addEventListener(function(d){s(d.boundingSphere),f()});return}if(t instanceof ts||t instanceof bT){s(t.boundingSphere);return}if(t instanceof da){s(t.boundingVolume);return}if(t instanceof he){o={destination:n.ellipsoid.cartographicToCartesian(t),duration:r.duration,maximumHeight:r.maximumHeight,complete:function(){e._completeZoom(!0)},cancel:function(){e._completeZoom(!1)}},e._zoomIsFlight?i.flyTo(o):(i.setView(o),e._completeZoom(!0)),pO(e);return}let a=t,c=[];for(let f=0,d=a.length;f<d;f++){let p=e._dataSourceDisplay.getBoundingSphere(a[f],!1,PDe);if(p===Pt.PENDING)return;p!==Pt.FAILED&&c.push(ue.clone(PDe))}if(c.length===0){tie(e);return}e.trackedEntity=void 0;let u=ue.fromBoundingSpheres(c);e._zoomIsFlight?(pO(e),i.flyToBoundingSphere(u,{duration:r.duration,maximumHeight:r.maximumHeight,complete:function(){e._completeZoom(!0)},cancel:function(){e._completeZoom(!1)},offset:r.offset})):(i.viewBoundingSphere(u,r.offset),i.lookAtTransform(M.IDENTITY),pO(e),e._completeZoom(!0))}var DDe=new ue;function hNt(e){if(!e._needTrackedEntityUpdate)return;let t=e._trackedEntity,n=e.clock.currentTime,i=X.getValueOrUndefined(t.position,n);if(!l(i))return;let r=e.scene,o=e._dataSourceDisplay.getBoundingSphere(t,!1,DDe);if(o===Pt.PENDING)return;let s=r.mode;(s===re.COLUMBUS_VIEW||s===re.SCENE2D)&&(r.screenSpaceCameraController.enableTranslate=!1),(s===re.COLUMBUS_VIEW||s===re.SCENE3D)&&(r.screenSpaceCameraController.enableTilt=!1);let a=o!==Pt.FAILED?DDe:void 0;e._entityView=new yj(t,r,r.ellipsoid),e._entityView.update(n,a),e._needTrackedEntityUpdate=!1}var CG=zr;var mNt=z.WHITE,pNt=z.BLACK,gNt=new U(2,2);function yw(e){e=e??H.EMPTY_OBJECT,this._definitionChanged=new be,this._evenColor=void 0,this._evenColorSubscription=void 0,this._oddColor=void 0,this._oddColorSubscription=void 0,this._repeat=void 0,this._repeatSubscription=void 0,this.evenColor=e.evenColor,this.oddColor=e.oddColor,this.repeat=e.repeat}Object.defineProperties(yw.prototype,{isConstant:{get:function(){return X.isConstant(this._evenColor)&&X.isConstant(this._oddColor)&&X.isConstant(this._repeat)}},definitionChanged:{get:function(){return this._definitionChanged}},evenColor:me("evenColor"),oddColor:me("oddColor"),repeat:me("repeat")});yw.prototype.getType=function(e){return"Checkerboard"};var _Nt=new K;yw.prototype.getValue=function(e,t){return l(e)||(e=K.now(_Nt)),l(t)||(t={}),t.lightColor=X.getValueOrClonedDefault(this._evenColor,e,mNt,t.lightColor),t.darkColor=X.getValueOrClonedDefault(this._oddColor,e,pNt,t.darkColor),t.repeat=X.getValueOrDefault(this._repeat,e,gNt),t};yw.prototype.equals=function(e){return this===e||e instanceof yw&&X.equals(this._evenColor,e._evenColor)&&X.equals(this._oddColor,e._oddColor)&&X.equals(this._repeat,e._repeat)};var gO=yw;var vG={id:void 0},Aw=new Array(2);function nie(e){let t=e.propertyNames,n=t.length;for(let i=0;i<n;i++)e[t[i]]=void 0;e._name=void 0,e._availability=void 0}function FDe(e,t,n,i){Aw[0]=n,Aw[1]=i.id,t[JSON.stringify(Aw)]=i.definitionChanged.addEventListener(ys.prototype._onDefinitionChanged,e)}function BDe(e,t,n,i){Aw[0]=n,Aw[1]=i.id;let r=JSON.stringify(Aw);t[r](),t[r]=void 0}function PA(e){if(e._shouldRecomposite=!0,e._suspendCount!==0)return;let t=e._collections,n=t.length,i=e._collectionsCopy,r=i.length,o,s,a,c,u,f=e._composite,d=new Ja(e),p=e._eventHash,g;for(o=0;o<r;o++)for(u=i[o],u.collectionChanged.removeEventListener(ys.prototype._onCollectionChanged,e),a=u.values,g=u.id,c=a.length-1;c>-1;c--)s=a[c],BDe(e,p,g,s);for(o=n-1;o>=0;o--)for(u=t[o],u.collectionChanged.addEventListener(ys.prototype._onCollectionChanged,e),a=u.values,g=u.id,c=a.length-1;c>-1;c--){s=a[c],FDe(e,p,g,s);let y=d.getById(s.id);l(y)||(y=f.getById(s.id),l(y)?nie(y):(vG.id=s.id,y=new Qr(vG)),d.add(y)),y.merge(s)}e._collectionsCopy=t.slice(0),f.suspendEvents(),f.removeAll();let m=d.values;for(o=0;o<m.length;o++)f.add(m[o]);f.resumeEvents()}function ys(e,t){this._owner=t,this._composite=new Ja(this),this._suspendCount=0,this._collections=l(e)?e.slice():[],this._collectionsCopy=[],this._id=Kn(),this._eventHash={},PA(this),this._shouldRecomposite=!1}Object.defineProperties(ys.prototype,{collectionChanged:{get:function(){return this._composite._collectionChanged}},id:{get:function(){return this._id}},values:{get:function(){return this._composite.values}},owner:{get:function(){return this._owner}}});ys.prototype.addCollection=function(e,t){l(t)?this._collections.splice(t,0,e):this._collections.push(e),PA(this)};ys.prototype.removeCollection=function(e){let t=this._collections.indexOf(e);return t!==-1?(this._collections.splice(t,1),PA(this),!0):!1};ys.prototype.removeAllCollections=function(){this._collections.length=0,PA(this)};ys.prototype.containsCollection=function(e){return this._collections.indexOf(e)!==-1};ys.prototype.contains=function(e){return this._composite.contains(e)};ys.prototype.indexOfCollection=function(e){return this._collections.indexOf(e)};ys.prototype.getCollection=function(e){return this._collections[e]};ys.prototype.getCollectionsLength=function(){return this._collections.length};function SG(e,t){return e.indexOf(t)}function kDe(e,t,n){let i=e._collections;if(t=P.clamp(t,0,i.length-1),n=P.clamp(n,0,i.length-1),t===n)return;let r=i[t];i[t]=i[n],i[n]=r,PA(e)}ys.prototype.raiseCollection=function(e){let t=SG(this._collections,e);kDe(this,t,t+1)};ys.prototype.lowerCollection=function(e){let t=SG(this._collections,e);kDe(this,t,t-1)};ys.prototype.raiseCollectionToTop=function(e){let t=SG(this._collections,e);t!==this._collections.length-1&&(this._collections.splice(t,1),this._collections.push(e),PA(this))};ys.prototype.lowerCollectionToBottom=function(e){let t=SG(this._collections,e);t!==0&&(this._collections.splice(t,1),this._collections.splice(0,0,e),PA(this))};ys.prototype.suspendEvents=function(){this._suspendCount++,this._composite.suspendEvents()};ys.prototype.resumeEvents=function(){this._suspendCount--,this._shouldRecomposite&&this._suspendCount===0&&(PA(this),this._shouldRecomposite=!1),this._composite.resumeEvents()};ys.prototype.computeAvailability=function(){return this._composite.computeAvailability()};ys.prototype.getById=function(e){return this._composite.getById(e)};ys.prototype._onCollectionChanged=function(e,t,n){let i=this._collectionsCopy,r=i.length,o=this._composite;o.suspendEvents();let s,a,c,u,f=n.length,d=this._eventHash,p=e.id;for(s=0;s<f;s++){let m=n[s];BDe(this,d,p,m);let y=m.id;for(a=r-1;a>=0;a--)c=i[a].getById(y),l(c)&&(l(u)||(u=o.getById(y),nie(u)),u.merge(c));l(u)||o.removeById(y),u=void 0}let g=t.length;for(s=0;s<g;s++){let m=t[s];FDe(this,d,p,m);let y=m.id;for(a=r-1;a>=0;a--)c=i[a].getById(y),l(c)&&(l(u)||(u=o.getById(y),l(u)?nie(u):(vG.id=y,u=new Qr(vG),o.add(u))),u.merge(c));u=void 0}o.resumeEvents()};ys.prototype._onDefinitionChanged=function(e,t,n,i){let r=this._collections,o=this._composite,s=r.length,a=e.id,c=o.getById(a),u=c[t],f=!l(u),d=!0;for(let p=s-1;p>=0;p--){let g=r[p].getById(e.id);if(l(g)){let m=g[t];if(l(m)){if(d)if(d=!1,l(m.merge)&&l(m.clone))u=m.clone(u);else{u=m;break}u.merge(m)}}}f&&c.propertyNames.indexOf(t)===-1&&c.addProperty(t),c[t]=u};var UDe=ys;function DA(){this._definitionChanged=new be,this._composite=new Wl,this._composite.definitionChanged.addEventListener(DA.prototype._raiseDefinitionChanged,this)}Object.defineProperties(DA.prototype,{isConstant:{get:function(){return this._composite.isConstant}},definitionChanged:{get:function(){return this._definitionChanged}},intervals:{get:function(){return this._composite._intervals}}});DA.prototype.getType=function(e){let t=this._composite._intervals.findDataForIntervalContainingDate(e);if(l(t))return t.getType(e)};var yNt=new K;DA.prototype.getValue=function(e,t){l(e)||(e=K.now(yNt));let n=this._composite._intervals.findDataForIntervalContainingDate(e);if(l(n))return n.getValue(e,t)};DA.prototype.equals=function(e){return this===e||e instanceof DA&&this._composite.equals(e._composite,X.equals)};DA.prototype._raiseDefinitionChanged=function(){this._definitionChanged.raiseEvent(this)};var _O=DA;var zDe=js(ef(),1);function ANt(e){let t=new zDe.default(e);t.normalize();let n=t.path(),i=n.lastIndexOf("/");return i!==-1&&(n=n.substr(i+1)),n}var RA=ANt;var bNt=P.factorial;function iie(e,t,n,i,r,o){let s=0,a,c,u;if(i>0){for(c=0;c<r;c++){for(a=!1,u=0;u<o.length&&!a;u++)c===o[u]&&(a=!0);a||(o.push(c),s+=iie(e,t,n,i-1,r,o),o.splice(o.length-1,1))}return s}for(s=1,c=0;c<r;c++){for(a=!1,u=0;u<o.length&&!a;u++)c===o[u]&&(a=!0);a||(s*=e-n[t[c]])}return s}var xNt=[],rie=class{static get type(){return"Hermite"}static getRequiredDataPoints(t,n){return n=n??0,Math.max(Math.floor((t+1)/(n+1)),2)}static interpolateOrderZero(t,n,i,r,o){l(o)||(o=new Array(r));let s,a,c,u,f,d,p=n.length,g=new Array(r);for(s=0;s<r;s++){o[s]=0;let b=new Array(p);for(g[s]=b,a=0;a<p;a++)b[a]=[]}let m=p,y=new Array(m);for(s=0;s<m;s++)y[s]=s;let A=p-1;for(u=0;u<r;u++){for(a=0;a<m;a++)d=y[a]*r+u,g[u][0].push(i[d]);for(s=1;s<m;s++){let b=!1;for(a=0;a<m-s;a++){let x=n[y[a]],T=n[y[a+s]],E;T-x<=0?(d=y[a]*r+r*s+u,E=i[d],g[u][s].push(E/bNt(s))):(E=g[u][s-1][a+1]-g[u][s-1][a],g[u][s].push(E/(T-x))),b=b||E!==0}b||(A=s-1)}}for(c=0,f=0;c<=f;c++)for(s=c;s<=A;s++){let b=iie(t,y,n,c,s,[]);for(u=0;u<r;u++){let x=g[u][s][0];o[u+c*r]+=x*b}}return o}static interpolate(t,n,i,r,o,s,a){let c=r*(s+1);l(a)||(a=new Array(c));for(let x=0;x<c;x++)a[x]=0;let u=n.length,f=new Array(u*(o+1)),d;for(d=0;d<u;d++)for(let x=0;x<o+1;x++)f[d*(o+1)+x]=d;let p=f.length,g=xNt,m=TNt(g,f,n,i,r,o),y=[],A=p*(p+1)/2,b=Math.min(m,s);for(let x=0;x<=b;x++)for(d=x;d<=m;d++){y.length=0;let T=iie(t,f,n,x,d,y),E=Math.floor(d*(1-d)/2)+p*d;for(let v=0;v<r;v++){let S=Math.floor(v*A),I=g[S+E];a[v+x*r]+=I*T}}return a}};function TNt(e,t,n,i,r,o){let s,a,c=-1,u=t.length,f=u*(u+1)/2;for(let d=0;d<r;d++){let p=Math.floor(d*f);for(s=0;s<u;s++)a=t[s]*r*(o+1)+d,e[p+s]=i[a];for(let g=1;g<u;g++){let m=0,y=Math.floor(g*(1-g)/2)+u*g,A=!1;for(s=0;s<u-g;s++){let b=n[t[s]],x=n[t[s+g]],T,E;if(x-b<=0)a=t[s]*r*(o+1)+r*g+d,T=i[a],E=T/P.factorial(g),e[p+y+m]=E,m++;else{let v=Math.floor((g-1)*(2-g)/2)+u*(g-1);T=e[p+v+s+1]-e[p+v+s],E=T/(x-b),e[p+y+m]=E,m++}A=A||T!==0}A&&(c=Math.max(c,g))}}return c}var wG=rie;var oie=class{static get type(){return"Lagrange"}static getRequiredDataPoints(t){return Math.max(t+1,2)}static interpolateOrderZero(t,n,i,r,o){l(o)||(o=new Array(r));let s,a,c=n.length;for(s=0;s<r;s++)o[s]=0;for(s=0;s<c;s++){let u=1;for(a=0;a<c;a++)if(a!==s){let f=n[s]-n[a];u*=(t-n[a])/f}for(a=0;a<r;a++)o[a]+=u*i[s*r+a]}return o}},IG=oie;function dl(e,t,n){this.clock=e??0,this.cone=t??0,this.magnitude=n??1}dl.fromCartesian3=function(e,t){let n=e.x,i=e.y,r=e.z,o=n*n+i*i;return l(t)||(t=new dl),t.clock=Math.atan2(i,n),t.cone=Math.atan2(Math.sqrt(o),r),t.magnitude=Math.sqrt(o+r*r),t};dl.clone=function(e,t){if(l(e))return l(t)?(t.clock=e.clock,t.cone=e.cone,t.magnitude=e.magnitude,t):new dl(e.clock,e.cone,e.magnitude)};dl.normalize=function(e,t){return l(t)?(t.clock=e.clock,t.cone=e.cone,t.magnitude=1,t):new dl(e.clock,e.cone,1)};dl.equals=function(e,t){return e===t||l(e)&&l(t)&&e.clock===t.clock&&e.cone===t.cone&&e.magnitude===t.magnitude};dl.equalsEpsilon=function(e,t,n){return n=n??0,e===t||l(e)&&l(t)&&Math.abs(e.clock-t.clock)<=n&&Math.abs(e.cone-t.cone)<=n&&Math.abs(e.magnitude-t.magnitude)<=n};dl.prototype.equals=function(e){return dl.equals(this,e)};dl.prototype.clone=function(e){return dl.clone(this,e)};dl.prototype.equalsEpsilon=function(e,t){return dl.equalsEpsilon(this,e,t)};dl.prototype.toString=function(){return`(${this.clock}, ${this.cone}, ${this.magnitude})`};var PG=dl;var IO=js(ef(),1);function ST(){this._definitionChanged=new be,this._startTime=void 0,this._stopTime=void 0,this._currentTime=void 0,this._clockRange=void 0,this._clockStep=void 0,this._multiplier=void 0}Object.defineProperties(ST.prototype,{definitionChanged:{get:function(){return this._definitionChanged}},startTime:_u("startTime"),stopTime:_u("stopTime"),currentTime:_u("currentTime"),clockRange:_u("clockRange"),clockStep:_u("clockStep"),multiplier:_u("multiplier")});ST.prototype.clone=function(e){return l(e)||(e=new ST),e.startTime=this.startTime,e.stopTime=this.stopTime,e.currentTime=this.currentTime,e.clockRange=this.clockRange,e.clockStep=this.clockStep,e.multiplier=this.multiplier,e};ST.prototype.equals=function(e){return this===e||l(e)&&K.equals(this.startTime,e.startTime)&&K.equals(this.stopTime,e.stopTime)&&K.equals(this.currentTime,e.currentTime)&&this.clockRange===e.clockRange&&this.clockStep===e.clockStep&&this.multiplier===e.multiplier};ST.prototype.merge=function(e){this.startTime=this.startTime??e.startTime,this.stopTime=this.stopTime??e.stopTime,this.currentTime=this.currentTime??e.currentTime,this.clockRange=this.clockRange??e.clockRange,this.clockStep=this.clockStep??e.clockStep,this.multiplier=this.multiplier??e.multiplier};ST.prototype.getValue=function(e){return l(e)||(e=new Km),e.startTime=this.startTime??e.startTime,e.stopTime=this.stopTime??e.stopTime,e.currentTime=this.currentTime??e.currentTime,e.clockRange=this.clockRange??e.clockRange,e.multiplier=this.multiplier??e.multiplier,e.clockStep=this.clockStep??e.clockStep,e};var t0=ST;var ENt=z.WHITE,CNt=.1,vNt=new U(8,8),SNt=new U(0,0),wNt=new U(1,1);function bw(e){e=e??H.EMPTY_OBJECT,this._definitionChanged=new be,this._color=void 0,this._colorSubscription=void 0,this._cellAlpha=void 0,this._cellAlphaSubscription=void 0,this._lineCount=void 0,this._lineCountSubscription=void 0,this._lineThickness=void 0,this._lineThicknessSubscription=void 0,this._lineOffset=void 0,this._lineOffsetSubscription=void 0,this.color=e.color,this.cellAlpha=e.cellAlpha,this.lineCount=e.lineCount,this.lineThickness=e.lineThickness,this.lineOffset=e.lineOffset}Object.defineProperties(bw.prototype,{isConstant:{get:function(){return X.isConstant(this._color)&&X.isConstant(this._cellAlpha)&&X.isConstant(this._lineCount)&&X.isConstant(this._lineThickness)&&X.isConstant(this._lineOffset)}},definitionChanged:{get:function(){return this._definitionChanged}},color:me("color"),cellAlpha:me("cellAlpha"),lineCount:me("lineCount"),lineThickness:me("lineThickness"),lineOffset:me("lineOffset")});bw.prototype.getType=function(e){return"Grid"};var INt=new K;bw.prototype.getValue=function(e,t){return l(e)||(e=K.now(INt)),l(t)||(t={}),t.color=X.getValueOrClonedDefault(this._color,e,ENt,t.color),t.cellAlpha=X.getValueOrDefault(this._cellAlpha,e,CNt),t.lineCount=X.getValueOrClonedDefault(this._lineCount,e,vNt,t.lineCount),t.lineThickness=X.getValueOrClonedDefault(this._lineThickness,e,wNt,t.lineThickness),t.lineOffset=X.getValueOrClonedDefault(this._lineOffset,e,SNt,t.lineOffset),t};bw.prototype.equals=function(e){return this===e||e instanceof bw&&X.equals(this._color,e._color)&&X.equals(this._cellAlpha,e._cellAlpha)&&X.equals(this._lineCount,e._lineCount)&&X.equals(this._lineThickness,e._lineThickness)&&X.equals(this._lineOffset,e._lineOffset)};var yO=bw;function xw(e){this._definitionChanged=new be,this._color=void 0,this._colorSubscription=void 0,this.color=e}Object.defineProperties(xw.prototype,{isConstant:{get:function(){return X.isConstant(this._color)}},definitionChanged:{get:function(){return this._definitionChanged}},color:me("color")});xw.prototype.getType=function(e){return"PolylineArrow"};var PNt=new K;xw.prototype.getValue=function(e,t){return l(e)||(e=K.now(PNt)),l(t)||(t={}),t.color=X.getValueOrClonedDefault(this._color,e,z.WHITE,t.color),t};xw.prototype.equals=function(e){return this===e||e instanceof xw&&X.equals(this._color,e._color)};var AO=xw;var DNt=z.WHITE,RNt=z.TRANSPARENT,ONt=16,MNt=255;function Tw(e){e=e??H.EMPTY_OBJECT,this._definitionChanged=new be,this._color=void 0,this._colorSubscription=void 0,this._gapColor=void 0,this._gapColorSubscription=void 0,this._dashLength=void 0,this._dashLengthSubscription=void 0,this._dashPattern=void 0,this._dashPatternSubscription=void 0,this.color=e.color,this.gapColor=e.gapColor,this.dashLength=e.dashLength,this.dashPattern=e.dashPattern}Object.defineProperties(Tw.prototype,{isConstant:{get:function(){return X.isConstant(this._color)&&X.isConstant(this._gapColor)&&X.isConstant(this._dashLength)&&X.isConstant(this._dashPattern)}},definitionChanged:{get:function(){return this._definitionChanged}},color:me("color"),gapColor:me("gapColor"),dashLength:me("dashLength"),dashPattern:me("dashPattern")});Tw.prototype.getType=function(e){return"PolylineDash"};var NNt=new K;Tw.prototype.getValue=function(e,t){return l(e)||(e=K.now(NNt)),l(t)||(t={}),t.color=X.getValueOrClonedDefault(this._color,e,DNt,t.color),t.gapColor=X.getValueOrClonedDefault(this._gapColor,e,RNt,t.gapColor),t.dashLength=X.getValueOrDefault(this._dashLength,e,ONt,t.dashLength),t.dashPattern=X.getValueOrDefault(this._dashPattern,e,MNt,t.dashPattern),t};Tw.prototype.equals=function(e){return this===e||e instanceof Tw&&X.equals(this._color,e._color)&&X.equals(this._gapColor,e._gapColor)&&X.equals(this._dashLength,e._dashLength)&&X.equals(this._dashPattern,e._dashPattern)};var bO=Tw;var LNt=z.WHITE,FNt=.25,BNt=1;function Ew(e){e=e??H.EMPTY_OBJECT,this._definitionChanged=new be,this._color=void 0,this._colorSubscription=void 0,this._glowPower=void 0,this._glowPowerSubscription=void 0,this._taperPower=void 0,this._taperPowerSubscription=void 0,this.color=e.color,this.glowPower=e.glowPower,this.taperPower=e.taperPower}Object.defineProperties(Ew.prototype,{isConstant:{get:function(){return X.isConstant(this._color)&&X.isConstant(this._glow)}},definitionChanged:{get:function(){return this._definitionChanged}},color:me("color"),glowPower:me("glowPower"),taperPower:me("taperPower")});Ew.prototype.getType=function(e){return"PolylineGlow"};var kNt=new K;Ew.prototype.getValue=function(e,t){return l(e)||(e=K.now(kNt)),l(t)||(t={}),t.color=X.getValueOrClonedDefault(this._color,e,LNt,t.color),t.glowPower=X.getValueOrDefault(this._glowPower,e,FNt,t.glowPower),t.taperPower=X.getValueOrDefault(this._taperPower,e,BNt,t.taperPower),t};Ew.prototype.equals=function(e){return this===e||e instanceof Ew&&X.equals(this._color,e._color)&&X.equals(this._glowPower,e._glowPower)&&X.equals(this._taperPower,e._taperPower)};var xO=Ew;var UNt=z.WHITE,zNt=z.BLACK,VNt=1;function Cw(e){e=e??H.EMPTY_OBJECT,this._definitionChanged=new be,this._color=void 0,this._colorSubscription=void 0,this._outlineColor=void 0,this._outlineColorSubscription=void 0,this._outlineWidth=void 0,this._outlineWidthSubscription=void 0,this.color=e.color,this.outlineColor=e.outlineColor,this.outlineWidth=e.outlineWidth}Object.defineProperties(Cw.prototype,{isConstant:{get:function(){return X.isConstant(this._color)&&X.isConstant(this._outlineColor)&&X.isConstant(this._outlineWidth)}},definitionChanged:{get:function(){return this._definitionChanged}},color:me("color"),outlineColor:me("outlineColor"),outlineWidth:me("outlineWidth")});Cw.prototype.getType=function(e){return"PolylineOutline"};var jNt=new K;Cw.prototype.getValue=function(e,t){return l(e)||(e=K.now(jNt)),l(t)||(t={}),t.color=X.getValueOrClonedDefault(this._color,e,UNt,t.color),t.outlineColor=X.getValueOrClonedDefault(this._outlineColor,e,zNt,t.outlineColor),t.outlineWidth=X.getValueOrDefault(this._outlineWidth,e,VNt),t};Cw.prototype.equals=function(e){return this===e||e instanceof Cw&&X.equals(this._color,e._color)&&X.equals(this._outlineColor,e._outlineColor)&&X.equals(this._outlineWidth,e._outlineWidth)};var wT=Cw;function Qg(e,t){this._value=void 0,this._definitionChanged=new be,this._eventHelper=new Wo,this._referenceFrame=t??Wi.FIXED,this.setValue(e)}Object.defineProperties(Qg.prototype,{isConstant:{get:function(){let e=this._value;if(!l(e))return!0;let t=e.length;for(let n=0;n<t;n++)if(!X.isConstant(e[n]))return!1;return!0}},definitionChanged:{get:function(){return this._definitionChanged}},referenceFrame:{get:function(){return this._referenceFrame}}});var HNt=new K;Qg.prototype.getValue=function(e,t){return l(e)||(e=K.now(HNt)),this.getValueInReferenceFrame(e,Wi.FIXED,t)};Qg.prototype.getValueInReferenceFrame=function(e,t,n){let i=this._value;if(!l(i))return;let r=i.length;l(n)||(n=new Array(r));let o=0,s=0;for(;o<r;){let c=i[o].getValueInReferenceFrame(e,t,n[o]);l(c)&&(n[s]=c,s++),o++}return n.length=s,n};Qg.prototype.setValue=function(e){let t=this._eventHelper;if(t.removeAll(),l(e)){this._value=e.slice();let n=e.length;for(let i=0;i<n;i++){let r=e[i];l(r)&&t.add(r.definitionChanged,Qg.prototype._raiseDefinitionChanged,this)}}else this._value=void 0;this._definitionChanged.raiseEvent(this)};Qg.prototype.equals=function(e){return this===e||e instanceof Qg&&this._referenceFrame===e._referenceFrame&&X.arrayEquals(this._value,e._value)};Qg.prototype._raiseDefinitionChanged=function(){this._definitionChanged.raiseEvent(this)};var OA=Qg;function MA(e){this._value=void 0,this._definitionChanged=new be,this._eventHelper=new Wo,this.setValue(e)}Object.defineProperties(MA.prototype,{isConstant:{get:function(){let e=this._value;if(!l(e))return!0;let t=e.length;for(let n=0;n<t;n++)if(!X.isConstant(e[n]))return!1;return!0}},definitionChanged:{get:function(){return this._definitionChanged}}});var GNt=new K;MA.prototype.getValue=function(e,t){l(e)||(e=K.now(GNt));let n=this._value;if(!l(n))return;let i=n.length;l(t)||(t=new Array(i));let r=0,o=0;for(;r<i;){let a=this._value[r].getValue(e,t[r]);l(a)&&(t[o]=a,o++),r++}return t.length=o,t};MA.prototype.setValue=function(e){let t=this._eventHelper;if(t.removeAll(),l(e)){this._value=e.slice();let n=e.length;for(let i=0;i<n;i++){let r=e[i];l(r)&&t.add(r.definitionChanged,MA.prototype._raiseDefinitionChanged,this)}}else this._value=void 0;this._definitionChanged.raiseEvent(this)};MA.prototype.equals=function(e){return this===e||e instanceof MA&&X.arrayEquals(this._value,e._value)};MA.prototype._raiseDefinitionChanged=function(){this._definitionChanged.raiseEvent(this)};var TO=MA;var WNt={packedLength:1,pack:function(e,t,n){return n=n??0,t[n]=e,t},unpack:function(e,t,n){return t=t??0,e[t]},convertPackedArrayForInterpolation:function(e,t,n,i){l(i)||(i=[]),t=t??0,n=n??e.length;let r;for(let o=0,s=n-t+1;o<s;o++){let a=e[t+o];o===0||Math.abs(r-a)<Math.PI?i[o]=a:i[o]=a-P.TWO_PI,r=a}},unpackInterpolationResult:function(e,t,n,i,r){return r=e[0],r<0?r+P.TWO_PI:r}},pm=WNt;var VDe={HORIZONTAL:0,VERTICAL:1};Object.freeze(VDe);var n0=VDe;var qNt=n0.HORIZONTAL,YNt=z.WHITE,XNt=z.BLACK,KNt=0,$Nt=1;function vw(e){e=e??H.EMPTY_OBJECT,this._definitionChanged=new be,this._orientation=void 0,this._orientationSubscription=void 0,this._evenColor=void 0,this._evenColorSubscription=void 0,this._oddColor=void 0,this._oddColorSubscription=void 0,this._offset=void 0,this._offsetSubscription=void 0,this._repeat=void 0,this._repeatSubscription=void 0,this.orientation=e.orientation,this.evenColor=e.evenColor,this.oddColor=e.oddColor,this.offset=e.offset,this.repeat=e.repeat}Object.defineProperties(vw.prototype,{isConstant:{get:function(){return X.isConstant(this._orientation)&&X.isConstant(this._evenColor)&&X.isConstant(this._oddColor)&&X.isConstant(this._offset)&&X.isConstant(this._repeat)}},definitionChanged:{get:function(){return this._definitionChanged}},orientation:me("orientation"),evenColor:me("evenColor"),oddColor:me("oddColor"),offset:me("offset"),repeat:me("repeat")});vw.prototype.getType=function(e){return"Stripe"};var JNt=new K;vw.prototype.getValue=function(e,t){return l(e)||(e=K.now(JNt)),l(t)||(t={}),t.horizontal=X.getValueOrDefault(this._orientation,e,qNt)===n0.HORIZONTAL,t.evenColor=X.getValueOrClonedDefault(this._evenColor,e,YNt,t.evenColor),t.oddColor=X.getValueOrClonedDefault(this._oddColor,e,XNt,t.oddColor),t.offset=X.getValueOrDefault(this._offset,e,KNt),t.repeat=X.getValueOrDefault(this._repeat,e,$Nt),t};vw.prototype.equals=function(e){return this===e||e instanceof vw&&X.equals(this._orientation,e._orientation)&&X.equals(this._evenColor,e._evenColor)&&X.equals(this._oddColor,e._oddColor)&&X.equals(this._offset,e._offset)&&X.equals(this._repeat,e._repeat)};var EO=vw;function IT(){this._definitionChanged=new be,this._intervals=new Bs,this._intervals.changedEvent.addEventListener(IT.prototype._intervalsChanged,this)}Object.defineProperties(IT.prototype,{isConstant:{get:function(){return this._intervals.isEmpty}},definitionChanged:{get:function(){return this._definitionChanged}},intervals:{get:function(){return this._intervals}}});var ZNt=new K;IT.prototype.getValue=function(e,t){l(e)||(e=K.now(ZNt));let n=this._intervals.findDataForIntervalContainingDate(e);return l(n)&&typeof n.clone=="function"?n.clone(t):n};IT.prototype.equals=function(e){return this===e||e instanceof IT&&this._intervals.equals(e._intervals,X.equals)};IT.prototype._intervalsChanged=function(){this._definitionChanged.raiseEvent(this)};var NA=IT;function CO(e,t){this._velocityVectorProperty=new fA(e,!0),this._subscription=void 0,this._ellipsoid=void 0,this._definitionChanged=new be,this.ellipsoid=t??ee.default;let n=this;this._velocityVectorProperty.definitionChanged.addEventListener(function(){n._definitionChanged.raiseEvent(n)})}Object.defineProperties(CO.prototype,{isConstant:{get:function(){return X.isConstant(this._velocityVectorProperty)}},definitionChanged:{get:function(){return this._definitionChanged}},position:{get:function(){return this._velocityVectorProperty.position},set:function(e){this._velocityVectorProperty.position=e}},ellipsoid:{get:function(){return this._ellipsoid},set:function(e){this._ellipsoid!==e&&(this._ellipsoid=e,this._definitionChanged.raiseEvent(this))}}});var jDe=new h,QNt=new h,HDe=new $,eLt=new K;CO.prototype.getValue=function(e,t){l(e)||(e=K.now(eLt));let n=this._velocityVectorProperty._getValue(e,QNt,jDe);if(l(n))return At.rotationMatrixFromPositionVelocity(jDe,n,this._ellipsoid,HDe),Le.fromRotationMatrix(HDe,t)};CO.prototype.equals=function(e){return this===e||e instanceof CO&&X.equals(this._velocityVectorProperty,e._velocityVectorProperty)&&(this._ellipsoid===e._ellipsoid||this._ellipsoid.equals(e._ellipsoid))};var DG=CO;var e_={COMPLETE:0,BELOW_ELLIPSOID_HORIZON:1,ABOVE_ELLIPSOID_HORIZON:2};e_.validate=function(e){return e===e_.COMPLETE||e===e_.BELOW_ELLIPSOID_HORIZON||e===e_.ABOVE_ELLIPSOID_HORIZON};e_.toString=function(e){switch(e){case e_.COMPLETE:return"COMPLETE";case e_.BELOW_ELLIPSOID_HORIZON:return"BELOW_ELLIPSOID_HORIZON";case e_.ABOVE_ELLIPSOID_HORIZON:return"ABOVE_ELLIPSOID_HORIZON";default:throw new pe("SensorVolumePortionToDisplay value is not valid and cannot be converted to a String.")}};var vO=e_;function LA(){}LA.packedLength=h.packedLength;LA.unpack=h.unpack;LA.pack=h.pack;var sie;function SO(e,t){return t[0]==="#"&&(t=sie+t),oA.fromString(e,t)}function GDe(e,t,n){if(l(n.reference))return SO(t,n.reference);if(l(n.velocityReference)){let i=SO(t,n.velocityReference);switch(e){case h:case LA:return new fA(i,e===LA);case Le:return new DG(i)}}throw new oe(`${JSON.stringify(n)} is not valid CZML.`)}function tLt(e,t){return new lp(function(n,i){return t(e.getValue(n,i))},e.isConstant)}var dr=new h,Kl=new PG,hl=new he,PT=new Cn,RG=new Le;function nLt(e){let t=e.rgbaf;if(l(t))return t;let n=e.rgba;if(!l(n))return;let i=n.length;if(i===z.packedLength)return[z.byteToFloat(n[0]),z.byteToFloat(n[1]),z.byteToFloat(n[2]),z.byteToFloat(n[3])];t=new Array(i);for(let r=0;r<i;r+=5)t[r]=n[r],t[r+1]=z.byteToFloat(n[r+1]),t[r+2]=z.byteToFloat(n[r+2]),t[r+3]=z.byteToFloat(n[r+3]),t[r+4]=z.byteToFloat(n[r+4]);return t}function WDe(e,t){let n=e.uri??e;return l(t)?t.getDerivedResource({url:n}):De.createIfNeeded(n)}function iLt(e){let t=e.wsen;if(l(t))return t;let n=e.wsenDegrees;if(!l(n))return;let i=n.length;if(i===ie.packedLength)return[P.toRadians(n[0]),P.toRadians(n[1]),P.toRadians(n[2]),P.toRadians(n[3])];t=new Array(i);for(let r=0;r<i;r+=5)t[r]=n[r],t[r+1]=P.toRadians(n[r+1]),t[r+2]=P.toRadians(n[r+2]),t[r+3]=P.toRadians(n[r+3]),t[r+4]=P.toRadians(n[r+4]);return t}function rLt(e){let t=e.length;if(Kl.magnitude=1,t===2)return Kl.clock=e[0],Kl.cone=e[1],h.fromSpherical(Kl,dr),[dr.x,dr.y,dr.z];let n=new Array(t/3*4);for(let i=0,r=0;i<t;i+=3,r+=4)n[r]=e[i],Kl.clock=e[i+1],Kl.cone=e[i+2],h.fromSpherical(Kl,dr),n[r+1]=dr.x,n[r+2]=dr.y,n[r+3]=dr.z;return n}function oLt(e){let t=e.length;if(t===3)return Kl.clock=e[0],Kl.cone=e[1],Kl.magnitude=e[2],h.fromSpherical(Kl,dr),[dr.x,dr.y,dr.z];let n=new Array(t);for(let i=0;i<t;i+=4)n[i]=e[i],Kl.clock=e[i+1],Kl.cone=e[i+2],Kl.magnitude=e[i+3],h.fromSpherical(Kl,dr),n[i+1]=dr.x,n[i+2]=dr.y,n[i+3]=dr.z;return n}function sLt(e){let t=e.length;if(t===3)return hl.longitude=e[0],hl.latitude=e[1],hl.height=e[2],ee.default.cartographicToCartesian(hl,dr),[dr.x,dr.y,dr.z];let n=new Array(t);for(let i=0;i<t;i+=4)n[i]=e[i],hl.longitude=e[i+1],hl.latitude=e[i+2],hl.height=e[i+3],ee.default.cartographicToCartesian(hl,dr),n[i+1]=dr.x,n[i+2]=dr.y,n[i+3]=dr.z;return n}function aLt(e){let t=e.length;if(t===3)return hl.longitude=P.toRadians(e[0]),hl.latitude=P.toRadians(e[1]),hl.height=e[2],ee.default.cartographicToCartesian(hl,dr),[dr.x,dr.y,dr.z];let n=new Array(t);for(let i=0;i<t;i+=4)n[i]=e[i],hl.longitude=P.toRadians(e[i+1]),hl.latitude=P.toRadians(e[i+2]),hl.height=e[i+3],ee.default.cartographicToCartesian(hl,dr),n[i+1]=dr.x,n[i+2]=dr.y,n[i+3]=dr.z;return n}function aie(e){let t=e.cartesian;if(l(t))return t;let n=e.cartesianVelocity;if(l(n))return n;let i=e.unitCartesian;if(l(i))return i;let r=e.unitSpherical;if(l(r))return rLt(r);let o=e.spherical;if(l(o))return oLt(o);let s=e.cartographicRadians;if(l(s))return sLt(s);let a=e.cartographicDegrees;if(l(a))return aLt(a);throw new oe(`${JSON.stringify(e)} is not a valid CZML interval.`)}function qDe(e,t){h.unpack(e,t,dr),h.normalize(dr,dr),h.pack(dr,e,t)}function cLt(e){let t=aie(e);if(t.length===3)return qDe(t,0),t;for(let n=1;n<t.length;n+=4)qDe(t,n);return t}function YDe(e,t){Le.unpack(e,t,RG),Le.normalize(RG,RG),Le.pack(RG,e,t)}function lLt(e){let t=e.unitQuaternion;if(l(t)){if(t.length===4)return YDe(t,0),t;for(let n=1;n<t.length;n+=5)YDe(t,n)}return t}function XDe(e){return typeof e=="boolean"?Boolean:typeof e=="number"?Number:typeof e=="string"?String:e.hasOwnProperty("array")?Array:e.hasOwnProperty("boolean")?Boolean:e.hasOwnProperty("boundingRectangle")?et:e.hasOwnProperty("cartesian2")?U:e.hasOwnProperty("cartesian")||e.hasOwnProperty("spherical")||e.hasOwnProperty("cartographicRadians")||e.hasOwnProperty("cartographicDegrees")?h:e.hasOwnProperty("unitCartesian")||e.hasOwnProperty("unitSpherical")?LA:e.hasOwnProperty("rgba")||e.hasOwnProperty("rgbaf")?z:e.hasOwnProperty("arcType")?ln:e.hasOwnProperty("classificationType")?Qn:e.hasOwnProperty("colorBlendMode")?Ul:e.hasOwnProperty("cornerType")?sr:e.hasOwnProperty("heightReference")?We:e.hasOwnProperty("horizontalOrigin")?Gi:e.hasOwnProperty("date")?K:e.hasOwnProperty("labelStyle")?Co:e.hasOwnProperty("number")?Number:e.hasOwnProperty("nearFarScalar")?qt:e.hasOwnProperty("distanceDisplayCondition")?Gt:e.hasOwnProperty("object")||e.hasOwnProperty("value")?Object:e.hasOwnProperty("unitQuaternion")?Le:e.hasOwnProperty("pathMode")?Fg:e.hasOwnProperty("shadowMode")?Pn:e.hasOwnProperty("string")?String:e.hasOwnProperty("stripeOrientation")?n0:e.hasOwnProperty("wsen")||e.hasOwnProperty("wsenDegrees")?ie:e.hasOwnProperty("uri")?IO.default:e.hasOwnProperty("verticalOrigin")?qn:Object}function uLt(e,t,n){switch(e){case ln:return ln[t.arcType??t];case Array:return t.array;case Boolean:return t.boolean??t;case et:return t.boundingRectangle;case U:return t.cartesian2;case h:return aie(t);case LA:return cLt(t);case z:return nLt(t);case Qn:return Qn[t.classificationType??t];case Ul:return Ul[t.colorBlendMode??t];case sr:return sr[t.cornerType??t];case We:return We[t.heightReference??t];case Gi:return Gi[t.horizontalOrigin??t];case Image:return WDe(t,n);case K:return K.fromIso8601(t.date??t);case Co:return Co[t.labelStyle??t];case Number:return t.number??t;case qt:return t.nearFarScalar;case Gt:return t.distanceDisplayCondition;case Object:return t.object??t.value??t;case Fg:return Fg[t.pathMode??t];case Le:return lLt(t);case pm:return t.number??t;case vO:return vO[t.portionToDisplay??t];case Pn:return Pn[t.shadowMode??t.shadows??t];case String:return t.string??t;case n0:return n0[t.stripeOrientation??t];case ie:return iLt(t);case IO.default:return WDe(t,n);case qn:return qn[t.verticalOrigin??t];default:throw new oe(`Unknown CzmlDataSource interval type: ${e}`)}}var fLt={HERMITE:wG,LAGRANGE:IG,LINEAR:Zx};function OG(e,t){let n=e.interpolationAlgorithm,i=e.interpolationDegree;(l(n)||l(i))&&t.setInterpolationOptions({interpolationAlgorithm:fLt[n],interpolationDegree:i});let r=e.forwardExtrapolationType;l(r)&&(t.forwardExtrapolationType=Bu[r]);let o=e.forwardExtrapolationDuration;l(o)&&(t.forwardExtrapolationDuration=o);let s=e.backwardExtrapolationType;l(s)&&(t.backwardExtrapolationType=Bu[s]);let a=e.backwardExtrapolationDuration;l(a)&&(t.backwardExtrapolationDuration=a)}var KDe={iso8601:void 0};function Vo(e){if(l(e))return KDe.iso8601=e,Cn.fromIso8601(KDe)}function cie(e){let t=it.MAXIMUM_INTERVAL.clone();return t.data=e,t}function $De(e){let t=new Wl;return t.intervals.addInterval(cie(e)),t}function JDe(e){let t=new Ec(e.referenceFrame);return t.intervals.addInterval(cie(e)),t}function MG(e,t,n,i,r,o,s){let a=Vo(i.interval);l(r)&&(l(a)?a=Cn.intersect(a,r,PT):a=r);let c,u,f,d=!l(i.reference)&&!l(i.velocityReference),p=l(a)&&!a.equals(it.MAXIMUM_INTERVAL);if(i.delete===!0){if(!p){t[n]=void 0;return}return c1e(t[n],a)}let g=!1;if(d){if(u=uLt(e,i,o),!l(u))return;c=e.packedLength??1,f=u.length??1,g=!l(i.array)&&typeof u!="string"&&f>c&&e!==Object}let m=typeof e.unpack=="function"&&e!==pm;if(!g&&!p){d?t[n]=new hi(m?e.unpack(u,0):u):t[n]=GDe(e,s,i);return}let y=t[n],A,b=i.epoch;if(l(b)&&(A=K.fromIso8601(b)),g&&!p){y instanceof jd||(t[n]=y=new jd(e)),y.addSamplesPackedArray(u,A),OG(i,y);return}let x;if(!g&&p){a=a.clone(),d?a.data=m?e.unpack(u,0):u:a.data=GDe(e,s,i),l(y)||(t[n]=y=d?new NA:new Wl),d&&y instanceof NA?y.intervals.addInterval(a):y instanceof Wl?(d&&(a.data=new hi(a.data)),y.intervals.addInterval(a)):(t[n]=y=$De(y),d&&(a.data=new hi(a.data)),y.intervals.addInterval(a));return}l(y)||(t[n]=y=new Wl),y instanceof Wl||(t[n]=y=$De(y));let T=y.intervals;x=T.findInterval(a),(!l(x)||!(x.data instanceof jd))&&(x=a.clone(),x.data=new jd(e),T.addInterval(x)),x.data.addSamplesPackedArray(u,A),OG(i,x.data)}function c1e(e,t){if(e instanceof jd){e.removeSamples(t);return}else if(e instanceof NA){e.intervals.removeInterval(t);return}else if(e instanceof Wl){let n=e.intervals;for(let i=0;i<n.length;++i){let r=Cn.intersect(n.get(i),t,PT);r.isEmpty||c1e(r.data,t)}n.removeInterval(t);return}}function Ee(e,t,n,i,r,o,s){if(l(i))if(Array.isArray(i))for(let a=0,c=i.length;a<c;++a)MG(e,t,n,i[a],r,o,s);else MG(e,t,n,i,r,o,s)}function ZDe(e,t,n,i,r,o){let s=Vo(n.interval);l(i)&&(l(s)?s=Cn.intersect(s,i,PT):s=i);let a=l(n.cartesianVelocity)?1:0,c=h.packedLength*(a+1),u,f,d=!l(n.reference),p=l(s)&&!s.equals(it.MAXIMUM_INTERVAL);if(n.delete===!0){if(!p){e[t]=void 0;return}return l1e(e[t],s)}let g,m=!1;if(d&&(l(n.referenceFrame)&&(g=Wi[n.referenceFrame]),g=g??Wi.FIXED,u=aie(n),f=u.length??1,m=f>c),!m&&!p){d?e[t]=new gu(h.unpack(u),g):e[t]=SO(o,n.reference);return}let y=e[t],A,b=n.epoch;if(l(b)&&(A=K.fromIso8601(b)),m&&!p){(!(y instanceof Cc)||l(g)&&y.referenceFrame!==g)&&(e[t]=y=new Cc(g,a)),y.addSamplesPackedArray(u,A),OG(n,y);return}let x;if(!m&&p){s=s.clone(),d?s.data=h.unpack(u):s.data=SO(o,n.reference),l(y)||(d?y=new cA(g):y=new Ec(g),e[t]=y),d&&y instanceof cA&&l(g)&&y.referenceFrame===g?y.intervals.addInterval(s):y instanceof Ec?(d&&(s.data=new gu(s.data,g)),y.intervals.addInterval(s)):(e[t]=y=JDe(y),d&&(s.data=new gu(s.data,g)),y.intervals.addInterval(s));return}l(y)?y instanceof Ec||(e[t]=y=JDe(y)):e[t]=y=new Ec(g);let T=y.intervals;x=T.findInterval(s),(!l(x)||!(x.data instanceof Cc)||l(g)&&x.data.referenceFrame!==g)&&(x=s.clone(),x.data=new Cc(g,a),T.addInterval(x)),x.data.addSamplesPackedArray(u,A),OG(n,x.data)}function l1e(e,t){if(e instanceof Cc){e.removeSamples(t);return}else if(e instanceof cA){e.intervals.removeInterval(t);return}else if(e instanceof Ec){let n=e.intervals;for(let i=0;i<n.length;++i){let r=Cn.intersect(n.get(i),t,PT);r.isEmpty||l1e(r.data,t)}n.removeInterval(t);return}}function u1e(e,t,n,i,r,o){if(l(n))if(Array.isArray(n))for(let s=0,a=n.length;s<a;++s)ZDe(e,t,n[s],i,r,o);else ZDe(e,t,n,i,r,o)}function QDe(e,t,n,i){l(n.references)?NG(e,t,n.references,n.interval,i,TO,Wl):(l(n.cartesian2)?n.array=U.unpackArray(n.cartesian2):l(n.cartesian)&&(n.array=U.unpackArray(n.cartesian)),l(n.array)&&Ee(Array,e,t,n,void 0,void 0,i))}function e1e(e,t,n,i,r,o){let s=Vo(n.interval);l(i)&&(l(s)?s=Cn.intersect(s,i,PT):s=i);let a=e[t],c,u;if(l(s)){a instanceof _O||(a=new _O,e[t]=a);let d=a.intervals;u=d.findInterval({start:s.start,stop:s.stop}),l(u)?c=u.data:(u=s.clone(),d.addInterval(u))}else c=a;let f;l(n.solidColor)?(c instanceof Kt||(c=new Kt),f=n.solidColor,Ee(z,c,"color",f.color,void 0,void 0,o)):l(n.grid)?(c instanceof yO||(c=new yO),f=n.grid,Ee(z,c,"color",f.color,void 0,r,o),Ee(Number,c,"cellAlpha",f.cellAlpha,void 0,r,o),Ee(U,c,"lineCount",f.lineCount,void 0,r,o),Ee(U,c,"lineThickness",f.lineThickness,void 0,r,o),Ee(U,c,"lineOffset",f.lineOffset,void 0,r,o)):l(n.image)?(c instanceof jb||(c=new jb),f=n.image,Ee(Image,c,"image",f.image,void 0,r,o),Ee(U,c,"repeat",f.repeat,void 0,r,o),Ee(z,c,"color",f.color,void 0,r,o),Ee(Boolean,c,"transparent",f.transparent,void 0,r,o)):l(n.stripe)?(c instanceof EO||(c=new EO),f=n.stripe,Ee(n0,c,"orientation",f.orientation,void 0,r,o),Ee(z,c,"evenColor",f.evenColor,void 0,r,o),Ee(z,c,"oddColor",f.oddColor,void 0,r,o),Ee(Number,c,"offset",f.offset,void 0,r,o),Ee(Number,c,"repeat",f.repeat,void 0,r,o)):l(n.polylineOutline)?(c instanceof wT||(c=new wT),f=n.polylineOutline,Ee(z,c,"color",f.color,void 0,r,o),Ee(z,c,"outlineColor",f.outlineColor,void 0,r,o),Ee(Number,c,"outlineWidth",f.outlineWidth,void 0,r,o)):l(n.polylineGlow)?(c instanceof xO||(c=new xO),f=n.polylineGlow,Ee(z,c,"color",f.color,void 0,r,o),Ee(Number,c,"glowPower",f.glowPower,void 0,r,o),Ee(Number,c,"taperPower",f.taperPower,void 0,r,o)):l(n.polylineArrow)?(c instanceof AO||(c=new AO),f=n.polylineArrow,Ee(z,c,"color",f.color,void 0,void 0,o)):l(n.polylineDash)?(c instanceof bO||(c=new bO),f=n.polylineDash,Ee(z,c,"color",f.color,void 0,void 0,o),Ee(z,c,"gapColor",f.gapColor,void 0,void 0,o),Ee(Number,c,"dashLength",f.dashLength,void 0,r,o),Ee(Number,c,"dashPattern",f.dashPattern,void 0,r,o)):l(n.checkerboard)&&(c instanceof gO||(c=new gO),f=n.checkerboard,Ee(z,c,"evenColor",f.evenColor,void 0,r,o),Ee(z,c,"oddColor",f.oddColor,void 0,r,o),Ee(U,c,"repeat",f.repeat,void 0,r,o)),l(u)?u.data=c:e[t]=c}function Lf(e,t,n,i,r,o){if(l(n))if(Array.isArray(n))for(let s=0,a=n.length;s<a;++s)e1e(e,t,n[s],i,r,o);else e1e(e,t,n,i,r,o)}function dLt(e,t,n,i){let r=t.name;l(r)&&(e.name=t.name)}function hLt(e,t,n,i){let r=t.description;l(r)&&Ee(String,e,"description",r,void 0,i,n)}function mLt(e,t,n,i){let r=t.position;l(r)&&u1e(e,"position",r,void 0,i,n)}function pLt(e,t,n,i){let r=t.viewFrom;l(r)&&Ee(h,e,"viewFrom",r,void 0,i,n)}function gLt(e,t,n,i){let r=t.orientation;l(r)&&Ee(Le,e,"orientation",r,void 0,i,n)}function _Lt(e,t,n,i){let r=t.properties;if(l(r)){l(e.properties)||(e.properties=new yu);for(let o in r)if(r.hasOwnProperty(o)){e.properties.hasProperty(o)||e.properties.addProperty(o);let s=r[o];if(Array.isArray(s))for(let a=0,c=s.length;a<c;++a)MG(XDe(s[a]),e.properties,o,s[a],void 0,i,n);else MG(XDe(s),e.properties,o,s,void 0,i,n)}}}function NG(e,t,n,i,r,o,s){let a=n.map(function(c){return SO(r,c)});if(l(i)){i=Vo(i);let c=e[t];if(!(c instanceof s)){let u=new s;u.intervals.addInterval(cie(c)),e[t]=c=u}i.data=new o(a),c.intervals.addInterval(i)}else e[t]=new o(a)}function t1e(e,t,n,i){let r=n.references;l(r)?NG(e,t,r,n.interval,i,TO,Wl):Ee(Array,e,t,n,void 0,void 0,i)}function n1e(e,t,n,i){if(l(n))if(Array.isArray(n))for(let r=0,o=n.length;r<o;++r)t1e(e,t,n[r],i);else t1e(e,t,n,i)}function i1e(e,t,n,i){let r=n.references;l(r)?NG(e,t,r,n.interval,i,OA,Ec):(l(n.cartesian)?n.array=h.unpackArray(n.cartesian):l(n.cartographicRadians)?n.array=h.fromRadiansArrayHeights(n.cartographicRadians,ee.default):l(n.cartographicDegrees)&&(n.array=h.fromDegreesArrayHeights(n.cartographicDegrees,ee.default)),l(n.array)&&Ee(Array,e,t,n,void 0,void 0,i))}function PO(e,t,n,i){if(l(n))if(Array.isArray(n))for(let r=0,o=n.length;r<o;++r)i1e(e,t,n[r],i);else i1e(e,t,n,i)}function yLt(e){return h.unpackArray(e)}function ALt(e){return h.fromRadiansArrayHeights(e,ee.default)}function bLt(e){return h.fromDegreesArrayHeights(e,ee.default)}function r1e(e,t,n,i){let r=n.references;if(l(r)){let o=r.map(function(s){let a={};return NG(a,"positions",s,n.interval,i,OA,Ec),a.positions});e[t]=new OA(o)}else l(n.cartesian)?n.array=n.cartesian.map(yLt):l(n.cartographicRadians)?n.array=n.cartographicRadians.map(ALt):l(n.cartographicDegrees)&&(n.array=n.cartographicDegrees.map(bLt)),l(n.array)&&Ee(Array,e,t,n,void 0,void 0,i)}function xLt(e,t,n,i){if(l(n))if(Array.isArray(n))for(let r=0,o=n.length;r<o;++r)r1e(e,t,n[r],i);else r1e(e,t,n,i)}function TLt(e,t,n,i){if(l(n))if(Array.isArray(n))for(let r=0,o=n.length;r<o;r++)QDe(e,t,n[r],i);else QDe(e,t,n,i)}function ELt(e,t,n,i){let r=t.availability;if(!l(r))return;let o;if(Array.isArray(r))for(let s=0,a=r.length;s<a;++s)l(o)||(o=new Bs),o.addInterval(Vo(r[s]));else o=new Bs,o.addInterval(Vo(r));e.availability=o}function CLt(e,t,n,i,r){l(t)&&Ee(LA,e,"alignedAxis",t,n,i,r)}function vLt(e,t,n,i){let r=t.billboard;if(!l(r))return;let o=Vo(r.interval),s=e.billboard;l(s)||(e.billboard=s=new Ol),Ee(Boolean,s,"show",r.show,o,i,n),Ee(Image,s,"image",r.image,o,i,n),Ee(Number,s,"scale",r.scale,o,i,n),Ee(U,s,"pixelOffset",r.pixelOffset,o,i,n),Ee(h,s,"eyeOffset",r.eyeOffset,o,i,n),Ee(Gi,s,"horizontalOrigin",r.horizontalOrigin,o,i,n),Ee(qn,s,"verticalOrigin",r.verticalOrigin,o,i,n),Ee(We,s,"heightReference",r.heightReference,o,i,n),Ee(z,s,"color",r.color,o,i,n),Ee(pm,s,"rotation",r.rotation,o,i,n),CLt(s,r.alignedAxis,o,i,n),Ee(Boolean,s,"sizeInMeters",r.sizeInMeters,o,i,n),Ee(Number,s,"width",r.width,o,i,n),Ee(Number,s,"height",r.height,o,i,n),Ee(qt,s,"scaleByDistance",r.scaleByDistance,o,i,n),Ee(qt,s,"translucencyByDistance",r.translucencyByDistance,o,i,n),Ee(qt,s,"pixelOffsetScaleByDistance",r.pixelOffsetScaleByDistance,o,i,n),Ee(et,s,"imageSubRegion",r.imageSubRegion,o,i,n),Ee(Gt,s,"distanceDisplayCondition",r.distanceDisplayCondition,o,i,n),Ee(Number,s,"disableDepthTestDistance",r.disableDepthTestDistance,o,i,n)}function SLt(e,t,n,i){let r=t.box;if(!l(r))return;let o=Vo(r.interval),s=e.box;l(s)||(e.box=s=new cC),Ee(Boolean,s,"show",r.show,o,i,n),Ee(h,s,"dimensions",r.dimensions,o,i,n),Ee(We,s,"heightReference",r.heightReference,o,i,n),Ee(Boolean,s,"fill",r.fill,o,i,n),Lf(s,"material",r.material,o,i,n),Ee(Boolean,s,"outline",r.outline,o,i,n),Ee(z,s,"outlineColor",r.outlineColor,o,i,n),Ee(Number,s,"outlineWidth",r.outlineWidth,o,i,n),Ee(Pn,s,"shadows",r.shadows,o,i,n),Ee(Gt,s,"distanceDisplayCondition",r.distanceDisplayCondition,o,i,n)}function wLt(e,t,n,i){let r=t.corridor;if(!l(r))return;let o=Vo(r.interval),s=e.corridor;l(s)||(e.corridor=s=new uC),Ee(Boolean,s,"show",r.show,o,i,n),PO(s,"positions",r.positions,n),Ee(Number,s,"width",r.width,o,i,n),Ee(Number,s,"height",r.height,o,i,n),Ee(We,s,"heightReference",r.heightReference,o,i,n),Ee(Number,s,"extrudedHeight",r.extrudedHeight,o,i,n),Ee(We,s,"extrudedHeightReference",r.extrudedHeightReference,o,i,n),Ee(sr,s,"cornerType",r.cornerType,o,i,n),Ee(Number,s,"granularity",r.granularity,o,i,n),Ee(Boolean,s,"fill",r.fill,o,i,n),Lf(s,"material",r.material,o,i,n),Ee(Boolean,s,"outline",r.outline,o,i,n),Ee(z,s,"outlineColor",r.outlineColor,o,i,n),Ee(Number,s,"outlineWidth",r.outlineWidth,o,i,n),Ee(Pn,s,"shadows",r.shadows,o,i,n),Ee(Gt,s,"distanceDisplayCondition",r.distanceDisplayCondition,o,i,n),Ee(Qn,s,"classificationType",r.classificationType,o,i,n),Ee(Number,s,"zIndex",r.zIndex,o,i,n)}function ILt(e,t,n,i){let r=t.cylinder;if(!l(r))return;let o=Vo(r.interval),s=e.cylinder;l(s)||(e.cylinder=s=new fC),Ee(Boolean,s,"show",r.show,o,i,n),Ee(Number,s,"length",r.length,o,i,n),Ee(Number,s,"topRadius",r.topRadius,o,i,n),Ee(Number,s,"bottomRadius",r.bottomRadius,o,i,n),Ee(We,s,"heightReference",r.heightReference,o,i,n),Ee(Boolean,s,"fill",r.fill,o,i,n),Lf(s,"material",r.material,o,i,n),Ee(Boolean,s,"outline",r.outline,o,i,n),Ee(z,s,"outlineColor",r.outlineColor,o,i,n),Ee(Number,s,"outlineWidth",r.outlineWidth,o,i,n),Ee(Number,s,"numberOfVerticalLines",r.numberOfVerticalLines,o,i,n),Ee(Number,s,"slices",r.slices,o,i,n),Ee(Pn,s,"shadows",r.shadows,o,i,n),Ee(Gt,s,"distanceDisplayCondition",r.distanceDisplayCondition,o,i,n)}function PLt(e,t){let n=e.version;if(l(n)&&typeof n=="string"){let o=n.split(".");if(o.length===2){if(o[0]!=="1")throw new oe("Cesium only supports CZML version 1.");t._version=n}}if(!l(t._version))throw new oe("CZML version information invalid. It is expected to be a property on the document object in the <Major>.<Minor> version format.");let i=t._documentPacket;l(e.name)&&(i.name=e.name);let r=e.clock;if(l(r)){let o=i.clock;l(o)?(o.interval=r.interval??o.interval,o.currentTime=r.currentTime??o.currentTime,o.range=r.range??o.range,o.step=r.step??o.step,o.multiplier=r.multiplier??o.multiplier):i.clock={interval:r.interval,currentTime:r.currentTime,range:r.range,step:r.step,multiplier:r.multiplier}}}function DLt(e,t,n,i){let r=t.ellipse;if(!l(r))return;let o=Vo(r.interval),s=e.ellipse;l(s)||(e.ellipse=s=new dC),Ee(Boolean,s,"show",r.show,o,i,n),Ee(Number,s,"semiMajorAxis",r.semiMajorAxis,o,i,n),Ee(Number,s,"semiMinorAxis",r.semiMinorAxis,o,i,n),Ee(Number,s,"height",r.height,o,i,n),Ee(We,s,"heightReference",r.heightReference,o,i,n),Ee(Number,s,"extrudedHeight",r.extrudedHeight,o,i,n),Ee(We,s,"extrudedHeightReference",r.extrudedHeightReference,o,i,n),Ee(pm,s,"rotation",r.rotation,o,i,n),Ee(pm,s,"stRotation",r.stRotation,o,i,n),Ee(Number,s,"granularity",r.granularity,o,i,n),Ee(Boolean,s,"fill",r.fill,o,i,n),Lf(s,"material",r.material,o,i,n),Ee(Boolean,s,"outline",r.outline,o,i,n),Ee(z,s,"outlineColor",r.outlineColor,o,i,n),Ee(Number,s,"outlineWidth",r.outlineWidth,o,i,n),Ee(Number,s,"numberOfVerticalLines",r.numberOfVerticalLines,o,i,n),Ee(Pn,s,"shadows",r.shadows,o,i,n),Ee(Gt,s,"distanceDisplayCondition",r.distanceDisplayCondition,o,i,n),Ee(Qn,s,"classificationType",r.classificationType,o,i,n),Ee(Number,s,"zIndex",r.zIndex,o,i,n)}function RLt(e,t,n,i){let r=t.ellipsoid;if(!l(r))return;let o=Vo(r.interval),s=e.ellipsoid;l(s)||(e.ellipsoid=s=new hC),Ee(Boolean,s,"show",r.show,o,i,n),Ee(h,s,"radii",r.radii,o,i,n),Ee(h,s,"innerRadii",r.innerRadii,o,i,n),Ee(Number,s,"minimumClock",r.minimumClock,o,i,n),Ee(Number,s,"maximumClock",r.maximumClock,o,i,n),Ee(Number,s,"minimumCone",r.minimumCone,o,i,n),Ee(Number,s,"maximumCone",r.maximumCone,o,i,n),Ee(We,s,"heightReference",r.heightReference,o,i,n),Ee(Boolean,s,"fill",r.fill,o,i,n),Lf(s,"material",r.material,o,i,n),Ee(Boolean,s,"outline",r.outline,o,i,n),Ee(z,s,"outlineColor",r.outlineColor,o,i,n),Ee(Number,s,"outlineWidth",r.outlineWidth,o,i,n),Ee(Number,s,"stackPartitions",r.stackPartitions,o,i,n),Ee(Number,s,"slicePartitions",r.slicePartitions,o,i,n),Ee(Number,s,"subdivisions",r.subdivisions,o,i,n),Ee(Pn,s,"shadows",r.shadows,o,i,n),Ee(Gt,s,"distanceDisplayCondition",r.distanceDisplayCondition,o,i,n)}function OLt(e,t,n,i){let r=t.label;if(!l(r))return;let o=Vo(r.interval),s=e.label;l(s)||(e.label=s=new rp),Ee(Boolean,s,"show",r.show,o,i,n),Ee(String,s,"text",r.text,o,i,n),Ee(String,s,"font",r.font,o,i,n),Ee(Co,s,"style",r.style,o,i,n),Ee(Number,s,"scale",r.scale,o,i,n),Ee(Boolean,s,"showBackground",r.showBackground,o,i,n),Ee(z,s,"backgroundColor",r.backgroundColor,o,i,n),Ee(U,s,"backgroundPadding",r.backgroundPadding,o,i,n),Ee(U,s,"pixelOffset",r.pixelOffset,o,i,n),Ee(h,s,"eyeOffset",r.eyeOffset,o,i,n),Ee(Gi,s,"horizontalOrigin",r.horizontalOrigin,o,i,n),Ee(qn,s,"verticalOrigin",r.verticalOrigin,o,i,n),Ee(We,s,"heightReference",r.heightReference,o,i,n),Ee(z,s,"fillColor",r.fillColor,o,i,n),Ee(z,s,"outlineColor",r.outlineColor,o,i,n),Ee(Number,s,"outlineWidth",r.outlineWidth,o,i,n),Ee(qt,s,"translucencyByDistance",r.translucencyByDistance,o,i,n),Ee(qt,s,"pixelOffsetScaleByDistance",r.pixelOffsetScaleByDistance,o,i,n),Ee(qt,s,"scaleByDistance",r.scaleByDistance,o,i,n),Ee(Gt,s,"distanceDisplayCondition",r.distanceDisplayCondition,o,i,n),Ee(Number,s,"disableDepthTestDistance",r.disableDepthTestDistance,o,i,n)}function MLt(e,t,n,i){let r=t.model;if(!l(r))return;let o=Vo(r.interval),s=e.model;l(s)||(e.model=s=new J_),Ee(Boolean,s,"show",r.show,o,i,n),Ee(IO.default,s,"uri",r.gltf,o,i,n),Ee(Number,s,"scale",r.scale,o,i,n),Ee(Number,s,"minimumPixelSize",r.minimumPixelSize,o,i,n),Ee(Number,s,"maximumScale",r.maximumScale,o,i,n),Ee(Boolean,s,"incrementallyLoadTextures",r.incrementallyLoadTextures,o,i,n),Ee(Boolean,s,"runAnimations",r.runAnimations,o,i,n),Ee(Boolean,s,"clampAnimations",r.clampAnimations,o,i,n),Ee(Pn,s,"shadows",r.shadows,o,i,n),Ee(We,s,"heightReference",r.heightReference,o,i,n),Ee(z,s,"silhouetteColor",r.silhouetteColor,o,i,n),Ee(Number,s,"silhouetteSize",r.silhouetteSize,o,i,n),Ee(z,s,"color",r.color,o,i,n),Ee(Ul,s,"colorBlendMode",r.colorBlendMode,o,i,n),Ee(Number,s,"colorBlendAmount",r.colorBlendAmount,o,i,n),Ee(Gt,s,"distanceDisplayCondition",r.distanceDisplayCondition,o,i,n);let a,c,u=r.nodeTransformations;if(l(u))if(Array.isArray(u))for(a=0,c=u.length;a<c;++a)o1e(s,u[a],o,i,n);else o1e(s,u,o,i,n);let f=r.articulations;if(l(f))if(Array.isArray(f))for(a=0,c=f.length;a<c;++a)s1e(s,f[a],o,i,n);else s1e(s,f,o,i,n)}function o1e(e,t,n,i,r){let o=Vo(t.interval);l(n)&&(l(o)?o=Cn.intersect(o,n,PT):o=n);let s=e.nodeTransformations,a=Object.keys(t);for(let c=0,u=a.length;c<u;++c){let f=a[c];if(f==="interval")continue;let d=t[f];if(!l(d))continue;l(s)||(e.nodeTransformations=s=new yu),s.hasProperty(f)||s.addProperty(f);let p=s[f];l(p)||(s[f]=p=new mC),Ee(h,p,"translation",d.translation,o,i,r),Ee(Le,p,"rotation",d.rotation,o,i,r),Ee(h,p,"scale",d.scale,o,i,r)}}function s1e(e,t,n,i,r){let o=Vo(t.interval);l(n)&&(l(o)?o=Cn.intersect(o,n,PT):o=n);let s=e.articulations,a=Object.keys(t);for(let c=0,u=a.length;c<u;++c){let f=a[c];if(f==="interval")continue;let d=t[f];l(d)&&(l(s)||(e.articulations=s=new yu),s.hasProperty(f)||s.addProperty(f),Ee(Number,s,f,d,o,i,r))}}function NLt(e,t,n,i){let r=t.path;if(!l(r))return;let o=Vo(r.interval),s=e.path;l(s)||(e.path=s=new Z_),Ee(Boolean,s,"show",r.show,o,i,n),Ee(Number,s,"leadTime",r.leadTime,o,i,n),Ee(Number,s,"trailTime",r.trailTime,o,i,n),Ee(Number,s,"width",r.width,o,i,n),Ee(Number,s,"resolution",r.resolution,o,i,n),Lf(s,"material",r.material,o,i,n),Ee(Gt,s,"distanceDisplayCondition",r.distanceDisplayCondition,o,i,n),Ee(String,s,"relativeTo",r.relativeTo,o,i,n),Ee(Fg,s,"materialMode",r.materialMode,o,i,n)}function LLt(e,t,n,i){let r=t.point;if(!l(r))return;let o=Vo(r.interval),s=e.point;l(s)||(e.point=s=new gC),Ee(Boolean,s,"show",r.show,o,i,n),Ee(Number,s,"pixelSize",r.pixelSize,o,i,n),Ee(We,s,"heightReference",r.heightReference,o,i,n),Ee(z,s,"color",r.color,o,i,n),Ee(z,s,"outlineColor",r.outlineColor,o,i,n),Ee(Number,s,"outlineWidth",r.outlineWidth,o,i,n),Ee(qt,s,"scaleByDistance",r.scaleByDistance,o,i,n),Ee(qt,s,"translucencyByDistance",r.translucencyByDistance,o,i,n),Ee(Gt,s,"distanceDisplayCondition",r.distanceDisplayCondition,o,i,n),Ee(Number,s,"disableDepthTestDistance",r.disableDepthTestDistance,o,i,n)}function wO(e){this.polygon=e,this._definitionChanged=new be}Object.defineProperties(wO.prototype,{isConstant:{get:function(){let e=this.polygon._positions,t=this.polygon._holes;return(!l(e)||e.isConstant)&&(!l(t)||t.isConstant)}},definitionChanged:{get:function(){return this._definitionChanged}}});wO.prototype.getValue=function(e,t){let n;l(this.polygon._positions)&&(n=this.polygon._positions.getValue(e));let i;return l(this.polygon._holes)&&(i=this.polygon._holes.getValue(e),l(i)&&(i=i.map(function(r){return new Wc(r)}))),l(t)?(t.positions=n,t.holes=i,t):new Wc(n,i)};wO.prototype.equals=function(e){return this===e||e instanceof wO&&X.equals(this.polygon._positions,e.polygon._positions)&&X.equals(this.polygon._holes,e.polygon._holes)};function FLt(e,t,n,i){let r=t.polygon;if(!l(r))return;let o=Vo(r.interval),s=e.polygon;l(s)||(e.polygon=s=new op),Ee(Boolean,s,"show",r.show,o,i,n),PO(s,"_positions",r.positions,n),xLt(s,"_holes",r.holes,n),(l(s._positions)||l(s._holes))&&(s.hierarchy=new wO(s)),Ee(Number,s,"height",r.height,o,i,n),Ee(We,s,"heightReference",r.heightReference,o,i,n),Ee(Number,s,"extrudedHeight",r.extrudedHeight,o,i,n),Ee(We,s,"extrudedHeightReference",r.extrudedHeightReference,o,i,n),Ee(pm,s,"stRotation",r.stRotation,o,i,n),Ee(Number,s,"granularity",r.granularity,o,i,n),Ee(Boolean,s,"fill",r.fill,o,i,n),Lf(s,"material",r.material,o,i,n),Ee(Boolean,s,"outline",r.outline,o,i,n),Ee(z,s,"outlineColor",r.outlineColor,o,i,n),Ee(Number,s,"outlineWidth",r.outlineWidth,o,i,n),Ee(Boolean,s,"perPositionHeight",r.perPositionHeight,o,i,n),Ee(Boolean,s,"closeTop",r.closeTop,o,i,n),Ee(Boolean,s,"closeBottom",r.closeBottom,o,i,n),Ee(ln,s,"arcType",r.arcType,o,i,n),Ee(Pn,s,"shadows",r.shadows,o,i,n),Ee(Gt,s,"distanceDisplayCondition",r.distanceDisplayCondition,o,i,n),Ee(Qn,s,"classificationType",r.classificationType,o,i,n),Ee(Number,s,"zIndex",r.zIndex,o,i,n)}function BLt(e){return e?ln.GEODESIC:ln.NONE}function kLt(e,t,n,i){let r=t.polyline;if(!l(r))return;let o=Vo(r.interval),s=e.polyline;if(l(s)||(e.polyline=s=new Ml),Ee(Boolean,s,"show",r.show,o,i,n),PO(s,"positions",r.positions,n),Ee(Number,s,"width",r.width,o,i,n),Ee(Number,s,"granularity",r.granularity,o,i,n),Lf(s,"material",r.material,o,i,n),Lf(s,"depthFailMaterial",r.depthFailMaterial,o,i,n),Ee(ln,s,"arcType",r.arcType,o,i,n),Ee(Boolean,s,"clampToGround",r.clampToGround,o,i,n),Ee(Pn,s,"shadows",r.shadows,o,i,n),Ee(Gt,s,"distanceDisplayCondition",r.distanceDisplayCondition,o,i,n),Ee(Qn,s,"classificationType",r.classificationType,o,i,n),Ee(Number,s,"zIndex",r.zIndex,o,i,n),l(r.followSurface)&&!l(r.arcType)){let a={};Ee(Boolean,a,"followSurface",r.followSurface,o,i,n),s.arcType=tLt(a.followSurface,BLt)}}function ULt(e,t,n,i){let r=t.polylineVolume;if(!l(r))return;let o=Vo(r.interval),s=e.polylineVolume;l(s)||(e.polylineVolume=s=new _C),PO(s,"positions",r.positions,n),TLt(s,"shape",r.shape,n),Ee(Boolean,s,"show",r.show,o,i,n),Ee(sr,s,"cornerType",r.cornerType,o,i,n),Ee(Boolean,s,"fill",r.fill,o,i,n),Lf(s,"material",r.material,o,i,n),Ee(Boolean,s,"outline",r.outline,o,i,n),Ee(z,s,"outlineColor",r.outlineColor,o,i,n),Ee(Number,s,"outlineWidth",r.outlineWidth,o,i,n),Ee(Number,s,"granularity",r.granularity,o,i,n),Ee(Pn,s,"shadows",r.shadows,o,i,n),Ee(Gt,s,"distanceDisplayCondition",r.distanceDisplayCondition,o,i,n)}function zLt(e,t,n,i){let r=t.rectangle;if(!l(r))return;let o=Vo(r.interval),s=e.rectangle;l(s)||(e.rectangle=s=new sp),Ee(Boolean,s,"show",r.show,o,i,n),Ee(ie,s,"coordinates",r.coordinates,o,i,n),Ee(Number,s,"height",r.height,o,i,n),Ee(We,s,"heightReference",r.heightReference,o,i,n),Ee(Number,s,"extrudedHeight",r.extrudedHeight,o,i,n),Ee(We,s,"extrudedHeightReference",r.extrudedHeightReference,o,i,n),Ee(pm,s,"rotation",r.rotation,o,i,n),Ee(pm,s,"stRotation",r.stRotation,o,i,n),Ee(Number,s,"granularity",r.granularity,o,i,n),Ee(Boolean,s,"fill",r.fill,o,i,n),Lf(s,"material",r.material,o,i,n),Ee(Boolean,s,"outline",r.outline,o,i,n),Ee(z,s,"outlineColor",r.outlineColor,o,i,n),Ee(Number,s,"outlineWidth",r.outlineWidth,o,i,n),Ee(Pn,s,"shadows",r.shadows,o,i,n),Ee(Gt,s,"distanceDisplayCondition",r.distanceDisplayCondition,o,i,n),Ee(Qn,s,"classificationType",r.classificationType,o,i,n),Ee(Number,s,"zIndex",r.zIndex,o,i,n)}function VLt(e,t,n,i){let r=t.tileset;if(!l(r))return;let o=Vo(r.interval),s=e.tileset;l(s)||(e.tileset=s=new pC),Ee(Boolean,s,"show",r.show,o,i,n),Ee(IO.default,s,"uri",r.uri,o,i,n),Ee(Number,s,"maximumScreenSpaceError",r.maximumScreenSpaceError,o,i,n)}function jLt(e,t,n,i){let r=t.wall;if(!l(r))return;let o=Vo(r.interval),s=e.wall;l(s)||(e.wall=s=new Q_),Ee(Boolean,s,"show",r.show,o,i,n),PO(s,"positions",r.positions,n),n1e(s,"minimumHeights",r.minimumHeights,n),n1e(s,"maximumHeights",r.maximumHeights,n),Ee(Number,s,"granularity",r.granularity,o,i,n),Ee(Boolean,s,"fill",r.fill,o,i,n),Lf(s,"material",r.material,o,i,n),Ee(Boolean,s,"outline",r.outline,o,i,n),Ee(z,s,"outlineColor",r.outlineColor,o,i,n),Ee(Number,s,"outlineWidth",r.outlineWidth,o,i,n),Ee(Pn,s,"shadows",r.shadows,o,i,n),Ee(Gt,s,"distanceDisplayCondition",r.distanceDisplayCondition,o,i,n)}function a1e(e,t,n,i,r){let o=e.id;if(l(o)||(o=Kn()),sie=o,!l(r._version)&&o!=="document")throw new oe("The first CZML packet is required to be the document object.");if(e.delete===!0)t.removeById(o);else if(o==="document")PLt(e,r);else{let s=t.getOrCreateEntity(o),a=e.parent;l(a)&&(s.parent=t.getOrCreateEntity(a));for(let c=n.length-1;c>-1;c--)n[c](s,e,t,i)}sie=void 0}function HLt(e){let t,n=e._documentPacket.clock;if(!l(n)){if(!l(e._clock)){let r=e._entityCollection.computeAvailability();if(!r.start.equals(it.MINIMUM_VALUE)){let o=r.start,s=r.stop,a=K.secondsDifference(s,o),c=Math.round(a/120);return t=new t0,t.startTime=K.clone(o),t.stopTime=K.clone(s),t.clockRange=ws.LOOP_STOP,t.multiplier=c,t.currentTime=K.clone(o),t.clockStep=jr.SYSTEM_CLOCK_MULTIPLIER,e._clock=t,!0}}return!1}l(e._clock)?t=e._clock.clone():(t=new t0,t.startTime=it.MINIMUM_VALUE.clone(),t.stopTime=it.MAXIMUM_VALUE.clone(),t.currentTime=it.MINIMUM_VALUE.clone(),t.clockRange=ws.LOOP_STOP,t.clockStep=jr.SYSTEM_CLOCK_MULTIPLIER,t.multiplier=1);let i=Vo(n.interval);return l(i)&&(t.startTime=i.start,t.stopTime=i.stop),l(n.currentTime)&&(t.currentTime=K.fromIso8601(n.currentTime)),l(n.range)&&(t.clockRange=ws[n.range]??ws.LOOP_STOP),l(n.step)&&(t.clockStep=jr[n.step]??jr.SYSTEM_CLOCK_MULTIPLIER),l(n.multiplier)&&(t.multiplier=n.multiplier),t.equals(e._clock)?!1:(e._clock=t.clone(e._clock),!0)}function f1e(e,t,n,i){n=n??H.EMPTY_OBJECT;let r=t,o=n.sourceUri,s=n.credit;if(typeof s=="string"&&(s=new It(s)),e._credit=s,typeof t=="string"||t instanceof De){t=De.createIfNeeded(t),r=t.fetchJson(),o=o??t.clone();let a=e._resourceCredits,c=t.credits;if(l(c)){let u=c.length;for(let f=0;f<u;f++)a.push(c[f])}}return o=De.createIfNeeded(o),Ps.setLoading(e,!0),Promise.resolve(r).then(function(a){return GLt(e,a,o,i)}).catch(function(a){return Ps.setLoading(e,!1),e._error.raiseEvent(e,a),console.log(a),Promise.reject(a)})}function GLt(e,t,n,i){Ps.setLoading(e,!0);let r=e._entityCollection;i&&(e._version=void 0,e._documentPacket=new d1e,r.removeAll()),Js._processCzml(t,r,n,void 0,e);let o=HLt(e),s=e._documentPacket;return l(s.name)&&e._name!==s.name?(e._name=s.name,o=!0):!l(e._name)&&l(n)&&(e._name=RA(n.getUrlComponent()),o=!0),Ps.setLoading(e,!1),o&&e._changed.raiseEvent(e),e}function d1e(){this.name=void 0,this.clock=void 0}function Js(e){this._name=e,this._changed=new be,this._error=new be,this._isLoading=!1,this._loading=new be,this._clock=void 0,this._documentPacket=new d1e,this._version=void 0,this._entityCollection=new Ja(this),this._entityCluster=new dd,this._credit=void 0,this._resourceCredits=[]}Js.load=function(e,t){return new Js().load(e,t)};Object.defineProperties(Js.prototype,{name:{get:function(){return this._name}},clock:{get:function(){return this._clock}},entities:{get:function(){return this._entityCollection}},isLoading:{get:function(){return this._isLoading}},changedEvent:{get:function(){return this._changed}},errorEvent:{get:function(){return this._error}},loadingEvent:{get:function(){return this._loading}},show:{get:function(){return this._entityCollection.show},set:function(e){this._entityCollection.show=e}},clustering:{get:function(){return this._entityCluster},set:function(e){this._entityCluster=e}},credit:{get:function(){return this._credit}}});Js.updaters=[vLt,SLt,wLt,ILt,DLt,RLt,OLt,MLt,dLt,hLt,NLt,LLt,FLt,kLt,ULt,_Lt,zLt,mLt,VLt,pLt,jLt,gLt,ELt];Js.registerUpdater=function(e){Js.updaters.includes(e)||Js.updaters.push(e)};Js.unregisterUpdater=function(e){if(Js.updaters.includes(e)){let t=Js.updaters.indexOf(e);Js.updaters.splice(t,1)}};Js.prototype.process=function(e,t){return f1e(this,e,t,!1)};Js.prototype.load=function(e,t){return f1e(this,e,t,!0)};Js.prototype.update=function(e){return!0};Js.processPacketData=Ee;Js.processPositionPacketData=u1e;Js.processMaterialPacketData=Lf;Js._processCzml=function(e,t,n,i,r){if(i=i??Js.updaters,Array.isArray(e))for(let o=0,s=e.length;o<s;++o)a1e(e[o],t,i,n,r);else a1e(e,t,i,n,r)};var LG=Js;i0();dc();MT();d5();qO();var HRe={type:"module"},Mie="error",RFt="messageerror",GRe,Oie,WRe,Nie=!0;try{Nie=typeof structuredClone==Do&&structuredClone(new DOMException("","AbortError")).code!==ke}catch{}VRe(OFt);function OFt(e,t){let{baseURI:n,chunkSize:i,workerStartupTimeout:r}=t,{wasmURI:o}=t;if(!e.interface){typeof o==Do&&(o=o());let s;try{s=g5(e.workerURI,n,e)}catch{return Die(e),Rie(e,t)}Object.assign(e,{worker:s,workerAlive:!1,terminated:!1,startupError:null,interface:{run:async()=>{try{return await MFt(e,{chunkSize:i,wasmURI:o,baseURI:n,workerStartupTimeout:r})}catch(a){if(a&&a.workerStartupFailed)return Die(e),qRe(e),p5(e,t);if(a&&a.codecImportFailed){if(e.reader)return qRe(e),p5(e,t);e.onTaskFinished()}throw a}}}})}return e.interface}async function MFt(e,t){if(!e.worker){let{startupError:g}=e;e.startupError=null;let m=g||new Error(BT);throw m.workerStartupFailed=!0,m}let n,i,r=new Promise((g,m)=>{n=g,i=m});Object.assign(e,{reader:null,writer:null,resolveResult:n,rejectResult:i,result:r});let{readable:o,options:s}=e,{writable:a,closed:c,abortPipe:u}=NFt(e.writable),f;try{f=Lie({type:LRe,options:s,config:t,readable:o,writable:a},e)}catch(g){u();try{await c}catch{}throw e.onTaskFinished(),g}f||Object.assign(e,{reader:o.getReader(),writer:a.getWriter()});let{workerStartupTimeout:d}=t;!e.workerAlive&&Number.isFinite(d)&&d>=0&&(e.startupTimeout=setTimeout(()=>LFt(e),d));try{let g=await r;return await p(),await c,g}catch(g){await p(),u();try{await c}catch{}throw g}async function p(){if(!f&&!a.locked)try{await a.getWriter().close()}catch{}}}function NFt(e){let t=new AbortController,{writable:n,readable:i}=new TransformStream,r=i.pipeTo(e,{preventClose:!0,preventAbort:!0,signal:t.signal});return r.catch(()=>{}),{writable:n,closed:r,abortPipe:()=>t.abort()}}function qRe(e){let{reader:t}=e;t&&t.releaseLock(),e.reader=null,e.writer=null}function Fie(e){let{worker:t}=e;if(t)try{t.terminate()}catch{}e.interface=null}function g5(e,t,n,i,r=!0){let{createWorker:o}=n,s,a,c;if(o)s=o();else if(Oie===ke||GRe!==e){let u=typeof e==Do;u?a=e(r):a=e;let f=a.startsWith("data:"),d=a.startsWith("blob:");if(f||d){i===ke&&(i=!1),i&&(c=HRe);try{s=new Worker(a,c)}catch(p){if(d)try{URL.revokeObjectURL(a)}catch{}if(u&&d)return g5(e,t,n,i,!1);if(i)throw p;return g5(e,t,n,!0,!1)}}else{i===ke&&(i=!0),i&&(c=HRe);try{a=new URL(a,t)}catch{}try{s=new Worker(a,c)}catch(p){if(i)return g5(e,t,n,!1,r);throw p}}GRe=e,Oie=a,WRe=c}else s=new Worker(Oie,WRe);return s.addEventListener(NRe,u=>{n.workerAlive=!0,XRe(n),FFt(u,n)}),s.addEventListener(Mie,u=>YRe(u,n)),s.addEventListener(RFt,u=>YRe(u,n)),s}function LFt(e){if(e.startupTimeout=null,e.workerAlive)return;let{rejectResult:t,writer:n}=e;if(Fie(e),e.worker=null,t){let i=new Error(BT);i.workerStartupFailed=!0,t(i),n&&n.releaseLock()}}function XRe(e){let{startupTimeout:t}=e;t&&(clearTimeout(t),e.startupTimeout=null)}function YRe(e,t){e.preventDefault&&e.preventDefault(),XRe(t);let{workerAlive:n,rejectResult:i,writer:r,onTaskFinished:o}=t;Fie(t),n||(t.worker=null);let s=e.error||new Error(e.message||Mie);n||(s=Object.assign(new Error(s.message||Mie),{workerStartupFailed:!0}),t.startupError=s),i&&(i(s),r&&r.releaseLock(),n&&o())}function Lie(e,{worker:t,writer:n,transferStreams:i,workerAlive:r}){try{let{value:o,readable:s,writable:a}=e,c=[];if(o&&(e.value=KG(o),c.push(e.value.buffer)),i&&Nie&&r?(s&&c.push(s),a&&c.push(a)):e.readable=e.writable=null,c.length)try{return t.postMessage(e,c),!0}catch{Nie=!1,e.readable=e.writable=null,t.postMessage(e)}else t.postMessage(e)}catch(o){throw n&&n.releaseLock(),o}}async function FFt({data:e},t){let{type:n,value:i,messageId:r,result:o,error:s}=e,{reader:a,writer:c,resolveResult:u,rejectResult:f,onTaskFinished:d,generation:p}=t,g=()=>t.generation!=p;try{if(s){let{message:y,stack:A,code:b,name:x,outputSize:T,cause:E,codecImportFailed:v}=s,S=new Error(y);Object.assign(S,{stack:A,code:b,name:x,outputSize:T}),E&&(S.cause=Object.assign(new Error(E.message),{name:E.name})),v&&(S.codecImportFailed=!0),m(S)}else{if(n==FRe){let{value:y,done:A}=await a.read();g()||Lie({type:Sie,value:y,done:A,messageId:r},t)}n==Sie&&(await c.ready,await c.write(new Uint8Array(i)),g()||Lie({type:BRe,messageId:r},t)),n==kRe&&m(null,o)}}catch(y){g()||(Fie(t),m(y))}function m(y,A){g()||(y?f(y):u(A),c&&c.releaseLock(),y&&y.codecImportFailed||d())}}ioe();dc();i0();LT();qO();b5();v5();gie();MT();Lw();ure();RO();var poe="File already exists",goe="Zip file comment exceeds 64KB",XOe="Invalid zip file comment (must be a Uint8Array)",KOe="File entry comment exceeds 64KB",$Oe="Invalid file entry comment (must be a string)",JOe="Invalid date (must be a valid Date instance)",ZOe="File entry name exceeds 64KB",_oe="Version exceeds 65535",QOe="The strength must equal 1, 2, or 3",eMe="Encryption is not supported in USDZ files",tMe="Encryption is not supported when the 'passThrough' option is set",nMe="Invalid extra field (must be a Map)",iMe="Invalid extra field type (must be integer 0..65535)",rMe="Invalid extra field data (must be a Uint8Array)",t9="Extra field data exceeds 64KB",t2t="Compression method not supported",oMe=-2147483648,sMe=2147483647,kOe=BigInt(0),UOe=BigInt("0x7fffffffffffffff"),n9="Zip64 is not supported (set the 'zip64' option to 'true')",aMe="Undefined uncompressed size",cMe="Undefined compression method";var lMe="Undefined reader",uMe="Zip file not empty",fMe="Invalid uid (must be integer 0..2^32-1)",dMe="Invalid gid (must be integer 0..2^32-1)",hMe="Invalid UNIX mode (must be integer 0..65535)",mMe="Invalid unixExtraFieldType (must be 'infozip' or 'unix')",pMe="uid/gid must be 0..65535 for unixExtraFieldType 'unix' (use 'infozip' for larger ids)",gMe="Invalid msdosAttributesRaw (must be integer 0..255)",_Me="Invalid msdosAttributes (must be an object with boolean flags)",yMe="Invalid level (must be integer 0..9)",AMe="Signature data exceeds 64KB",zOe=new Uint8Array([7,0,2,0,65,69,3,0,0]),n2t=4,i2t=9,r2t=67,o2t=1,uoe="infozip",foe="unix",s2t=9,roe=0,VOe=[],cM=class{constructor(t,n={}){t=new qw(t);let{availableSize:i=DT,maxSize:r=DT}=t,o=i>0&&i!==DT&&r>0&&r!==DT;Object.assign(this,{writer:t,addSplitZipSignature:o,options:n,fileEntries:new Map,filenames:new Set,offset:n[DO]===ke?t.size||t.writable.size||0:n[DO],initialOffset:n[DO]===ke?0:n[DO]-(t.size||t.writable.size||0),pendingAddFileCalls:new Set,pendingErrors:[],bufferedWrites:0,lastFileEntry:ke})}prependZip(t){return ooe(this,a2t(this,t))}appendZip(t){return ooe(this,this.appendZipEntries(t))}async appendZipEntries(t){let n=this,{pendingAddFileCalls:i,filenames:r,fileEntries:o}=n;for(;i.size;)await Promise.allSettled(Array.from(i));let s,a=new Promise(f=>s=f);i.add(a);let c=[],u;try{t=new o_(t),await Pc(t),(t.size===ke||!t.readUint8Array)&&(t=new Gu(await s0(t.readable)),await Pc(t));let{ZipReader:f}=await Promise.resolve().then(()=>(ioe(),NOe)),d=new f(t),p=await d.getEntries();await d.close(),await Pc(n.writer);let{directoryOffset:g}=d;p.forEach(({filename:A})=>{if(r.has(A))throw new Error(poe);r.add(A),c.push(A)}),n.writerLocked=!0;let{lockWriter:m}=n;n.lockWriter=new Promise(A=>u=()=>{n.writerLocked=!1,A()}),await m,n.addSplitZipSignature&&(delete n.addSplitZipSignature,await S2t(t)||(await f0(n.writer,xMe()),n.offset+=4));let y=await w2t(n,t,p,g);p.forEach(A=>{let{version:b,rawLastModDate:x,rawFilename:T,bitFlag:E,encrypted:v,uncompressedSize:S,compressedSize:I,extraFieldZip64:R}=A,{compressionMethod:O,rawExtraField:L}=A,{level:_,languageEncodingFlag:C,dataDescriptor:w}=E;L=bMe(L||hr),A.extraFieldAES&&(O=99);let D=Qi(L),N=!!R&&R.uncompressedSize!==ke,F=!!R&&R.compressedSize!==ke,V=SMe(_,C,w,v,O)&-7|_<<1,{headerArray:B,headerView:j}=vMe({version:b,bitFlag:V,compressionMethod:O,uncompressedSize:S,compressedSize:I,rawLastModDate:x,rawFilename:T,zip64CompressedSize:F,zip64UncompressedSize:N,extraFieldLength:D}),{crc32:k}=A;k!==ke&&Dc(j,10,k);let{offset:G,diskNumberStart:q}=y.get(A);Object.assign(A,{zip64UncompressedSize:N,zip64CompressedSize:F,offset:G,diskNumberStart:q,zip64DiskNumberStart:!1,rawExtraFieldZip64:hr,rawExtraFieldAES:hr,rawExtraFieldExtendedTimestamp:hr,rawExtraFieldNTFS:hr,rawExtraFieldUnix:hr,rawExtraField:L,rawCentralExtraField:hr,extendedTimestamp:!1,headerArray:B,headerView:j}),o.set(A.filename,A)})}catch(f){throw c.forEach(d=>r.delete(d)),f}finally{s(),i.delete(a),u&&u()}}add(t="",n,i={}){let r=this,{pendingAddFileCalls:o}=r,s=c2t(r,t,n,i);o.add(s);let a=()=>o.delete(s);return Promise.prototype.then.call(s,a,a),ooe(r,s)}remove(t){let{filenames:n,fileEntries:i}=this;if(typeof t==RT&&(t=i.get(t)),t&&t.filename!==ke){let{filename:r}=t;if(n.has(r)&&i.has(r))return n.delete(r),i.delete(r),!0}return!1}async close(t=hr,n={}){let i=this,{pendingAddFileCalls:r,writer:o}=this,{writable:s}=o;if(!(t instanceof Uint8Array))throw new Error(XOe);if(Qi(t)>65535)throw new Error(goe);for(;r.size;)await Promise.allSettled(Array.from(r));await Promise.allSettled(i.pendingErrors.map(u=>u.recorded));let a=i.pendingErrors.filter(u=>u.error&&!u.observed);if(a.length){let u=a.map(d=>d.error);a.forEach(d=>d.observed=!0);let[f]=u;try{f.entryErrors=u}catch{}throw f}return await x2t(i,t,n),!C5(o)&&Xi(i,n,HG)||await s.getWriter().close(),o.getData?o.getData():s}};var doe=class extends Promise{then(t,n){let{watcher:i}=this;return i&&(i.observed=!0),super.then(t,n)}};function ooe(e,t){let n=new doe((r,o)=>Promise.prototype.then.call(t,r,o)),i={};return n.watcher=i,i.recorded=Promise.prototype.then.call(n,ke,r=>i.error=r),e.pendingErrors.push(i),n}async function a2t(e,t){if(e.filenames.size)throw new Error(uMe);await e.appendZipEntries(t)}async function c2t(e,t,n,i){if(i=Object.assign({},i),Xi(e,i,UT)&&!t.endsWith("/")&&(t+="/"),e.filenames.has(t))throw new Error(poe);e.filenames.add(t),roe<n_().maxWorkers?roe++:await new Promise(r=>VOe.push(r));try{return await l2t(e,t,n,i)}catch(r){throw e.filenames.delete(t),r}finally{let r=VOe.shift();r?r():roe--}}async function l2t(e,t,n,i){let r=u2t(e,t,i);({name:t}=r);let o=f2t(e,t,i),{comment:s}=o,a=i[D5];e.fileEntries.set(t,ke);let c=e.lastFileEntry,u={},f;o.resolvedOptions.keepOrder&&(u.lockFileEntry=new Promise(p=>f=p)),e.lastFileEntry=u;let d;try{let{resolvedOptions:p}=o;p.level!=0&&p.compressionMethod===ke&&!p.passThrough&&!await jRe(n_())&&(p.level=0);let g=await d2t(e,n,o,i);({reader:n}=g);let m=lM(e.writer),y=c_(e.writer);i=Object.assign({},i,r.resolvedOptions,o.resolvedOptions,g.resolvedOptions,{signature:i[P5],crc32:i.crc32===ke?i[P5]:i.crc32,offset:e.offset-m,diskNumberStart:y,[ww]:e.options[ww]});let A=g2t(i),b=y2t(i),x=Qi(A.localHeaderArray,b.dataDescriptorArray);d=await m2t(e,t,n,{headerInfo:A,dataDescriptorInfo:b,metadataSize:x,fileEntry:u,previousFileEntry:c,releaseLockFileEntry:f},i)}catch(p){throw e.fileEntries.delete(t),p}finally{f&&f(c&&c.lockFileEntry)}return Object.assign(d,{name:t,comment:s,extraField:a,[S5]:d.internalFileAttributes,[w5]:d.externalFileAttributes}),new VA(d)}function u2t(e,t,n){let i=Xi(e,n,Qie),r=Xi(e,n,nre,i?20:768),o=Xi(e,n,rre),s=iI(e,n,"uid"),a=iI(e,n,"gid"),c=iI(e,n,sre),u=Xi(e,n,z1e),f=Xi(e,n,are),d=Xi(e,n,cre),p=Xi(e,n,lre);if(Pw(s,4294967295,fMe),Pw(a,4294967295,dMe),Pw(c,65535,hMe),u!==ke&&u!==uoe&&u!==foe)throw new Error(mMe);if(u===foe&&(s!==ke&&s>65535||a!==ke&&a>65535))throw new Error(pMe);u===ke&&(s!==ke||a!==ke)&&(u=uoe);let g=iI(e,n,Jie),m=Xi(e,n,Zie),y=s!==ke||a!==ke||c!==ke||u||o,A=g!==ke||m!==ke;if(y?(i=!1,r=r&255|768):A&&(i=!0,r=r&255),Pw(g,255,gMe),m&&(typeof m!==h1e||Array.isArray(m)))throw new Error(_Me);if(r>65535)throw new Error(_oe);let b=CMe(e,n,$ie,w5),x=b!==ke;x||(b=0),!n[UT]&&t.endsWith("/")&&(n[UT]=!0);let T=Xi(e,n,UT);if(T?(t.endsWith("/")||(t+="/"),x||(b=16,i||(b|=16877<<16))):!i&&!x&&(o?b=493<<16:b=420<<16),!i){let S=c!==ke||!!(f||d||p),I=b>>16&65535;c=c===ke?I:c&65535,f?c|=2048:f=!!(c&2048),d?c|=1024:d=!!(c&1024),p?c|=512:p=!!(c&512),(!x||S)&&(T?c=c&-61441|16384:c&61440||(c|=32768),b=(c&65535)<<16|b&65535)}({msdosAttributesRaw:g,msdosAttributes:m}=_2t(g,m)),A&&(b=b&4294967295|g&255);let E=b>>16&65535,v=c!==ke&&(c&61440)==40960;return{name:t,resolvedOptions:{versionMadeBy:r,msDosCompatible:!!i,externalFileAttributes:b,unixExternalUpper:E,uid:s,gid:a,unixMode:c,unixExtraFieldType:u,symlink:v,setuid:f,setgid:d,sticky:p,msdosAttributesRaw:g,msdosAttributes:m}}}function f2t(e,t,n){let i=hoe(e,n,U1e)||Rw,r=i(t,GG);if(r===ke&&(r=Rw(t)),Qi(r)>65535)throw new Error(ZOe);let o=n[JO]||"";if(typeof o!=RT)throw new Error($Oe);let s=i(o,WG);if(s===ke&&(s=Rw(o)),Qi(s)>65535)throw new Error(KOe);let a=Xi(e,n,tre);if(a!==ke&&a>65535)throw new Error(_oe);let c=loe(e,n,Yw,new Date),u=Xi(e,n,Xw),f=loe(e,n,QO),d=loe(e,n,eM),p=CMe(e,n,Kie,S5,0),g=Xi(e,n,kG),m=Xi(e,n,FG),y=Xi(e,n,BG);XG(m,y);let A=iI(e,n,P1e,3),b=Xi(e,n,ire),x=Xi(e,n,D1e,!0),T=Xi(e,n,R1e),E=Xi(e,n,O1e,!0),v=Xi(e,n,zG),S=Xi(e,n,jG),I=Xi(e,n,N1e),R=hoe(e,n,L1e),O=Xi(e,n,F1e,!0),L=YG(Xi(e,n,UG)),_=Xi(e,n,B1e,!0),C=Xi(e,n,ore),w=g||C===ke?ke:r5(C);if(!g&&C!==ke&&C!==0&&C!==8&&!w)throw new Error(t2t);let D=iI(e,n,M1e);if(Pw(D,s2t,yMe),e.options[ww]){if(m!==ke||y!==ke)throw new Error(eMe);D===ke&&C===ke&&(D=0)}g&&(D=ke);let N=Xi(e,n,VG),F=Xi(e,n,uie);I&&F===ke&&(F=!1),(F===ke||b&&!g)&&(F=!0),D!==ke&&D!=6&&(N=!1);let V=Xi(e,n,I5);if(!b&&(m!==ke||y!==ke)&&!(Number.isInteger(A)&&A>=1&&A<=3))throw new Error(QOe);let B=soe(n[D5]),j=soe(n[V1e]),k=soe(n[j1e]);return{comment:o,resolvedOptions:{rawFilename:r,rawComment:s,version:a,lastModDate:c,rawLastModDate:u,lastAccessDate:f,creationDate:d,internalFileAttributes:p,passThrough:g,password:m,rawPassword:y,encryptionStrength:A,zipCrypto:b,extendedTimestamp:x,ntfsTimestamp:T,keepOrder:E,useWebWorkers:v,transferStreams:S,bufferedWrite:I,createTempStream:R,dataDescriptorSignature:O,signal:L,useUnicodeFileNames:_,compressionMethod:C,format:w?w.format:ke,codecURI:w?w.codecURI:ke,codecVersionNeeded:w?w.versionNeeded:ke,level:D,useCompressionStream:N,dataDescriptor:F,zip64:V,rawExtraField:B,rawLocalExtraField:j,rawCentralExtraField:k}}}function soe(e){if(!e)return hr;if(!(e instanceof Map))throw new Error(nMe);let t=0,n=0;e.forEach((o,s)=>{if(hie(s,65535,iMe),!(o instanceof Uint8Array))throw new Error(rMe);if(Qi(o)>65535)throw new Error(t9);t+=4+Qi(o)});let i=new Uint8Array(t),r=li(i);return e.forEach((o,s)=>{u0(r,n,s),u0(r,n+2,Qi(o)),dM(i,o,n+4),n+=4+Qi(o)}),i}async function d2t(e,t,{resolvedOptions:n},i){if(n.passThrough&&!t&&!Xi(e,i,UT))throw new Error(lMe);let r;return t&&(t=new o_(t),await Pc(t),{size:r}=t),Object.assign({reader:t},h2t(e,!!t,r,n,i))}function h2t(e,t,n,i,r){let{passThrough:o,zipCrypto:s,password:a,rawPassword:c,encryptionStrength:u}=i,{dataDescriptor:f,zip64:d,level:p,compressionMethod:g}=i,m=0,y=0;if(o&&t){if(y=r[ZO],y===ke)throw new Error(aMe);if(g===ke)throw new Error(cMe)}let A=d===!0,b=Xi(e,r,ere);if(t&&o&&!b&&Qi(a,c))throw new Error(tMe);let x=t&&(!!(a&&Qi(a)||c&&Qi(c))||o&&b);t||(p=0,g=0);let T=x?s?12:16+u*4:0;t&&(o?(r.uncompressedSize=y,m=n===ke?YOe(y)+T:n):n===ke?(f=!0,(d||d===ke)&&(d=!0,y=m=4294967296)):(r.uncompressedSize=y=n,m=(moe(g,p)?YOe(y):y)+T));let E=!x&&(!t||n===0&&!o)&&!moe(g,p);E&&!s&&Xi(e,r,uie)===ke&&(f=!1);let v=A||y>=4294967295,S=A||m>=4294967295;if(v||S){if(d===!1)throw new Error(n9);d=!0}return d=d||!1,{maximumCompressedSize:m,resolvedOptions:{dataDescriptor:f,emptyEntry:E,zip64:d,zip64UncompressedSize:v,zip64CompressedSize:S,uncompressedSize:y,level:p,compressionMethod:g,encrypted:x}}}async function m2t(e,t,n,i,r){let{fileEntries:o,writer:s}=e,{keepOrder:a,dataDescriptor:c,emptyEntry:u,signal:f}=r,{headerInfo:d,fileEntry:p,previousFileEntry:g,releaseLockFileEntry:m}=i,y=e.options[ww],A=p,b,x,T,E,v,S=0,I,R=a&&g?g.lockFileEntry:ke;o.set(t,A);try{r.bufferedWrite||!a||e.writerLocked||e.bufferedWrites||!c&&!u?(b=!0,e.bufferedWrites++,r.createTempStream?I=await r.createTempStream():I=new TransformStream(ke,ke,{highWaterMark:DT}),I.size=0,await Pc(s)):(I=s,await R,await O()),await Pc(I);let _=lM(s);e.addSplitZipSignature&&!b&&await GOe(e,s),y&&!b&&jOe(i,e.offset-_);let{localHeaderArray:C}=d;b||await L();let w=c_(s),D=uM(e,s);if(A.diskNumberStart=w,b||(E=!0,v=s.size,await f0(I,C)),A=await p2t(n,I,A,i,n_(),r),b||(E=!1),o.set(t,A),A.filename=t,b){if(await Promise.all([I.writable.getWriter().close(),R]),await O(),e.addSplitZipSignature&&await GOe(e,s),T=!0,v=s.size,await L(),A.diskNumberStart=c_(s),A.offset=uM(e,s),y){let N=i.metadataSize;jOe(i,e.offset-lM(s)),A.size+=i.metadataSize-N}b2t(A,d.localHeaderView,r),await f0(s,d.localHeaderArray),await TMe(I.readable,s,f,N=>S+=N),s.size+=I.size,T=!1}else A.diskNumberStart=w,A.offset=D;return e.offset+=A.size,A}catch(_){if(T||E){if(e.hasCorruptedEntries=!0,_)try{_.corruptedEntry=!0}catch{}e.offset+=s.size-v,b&&(e.offset+=S)}throw o.delete(t),_}finally{if(b&&e.bufferedWrites--,m&&m(R),x&&x(),b&&I&&I.dispose)try{await I.dispose()}catch{}}async function O(){e.writerLocked=!0;let{lockWriter:_}=e;e.lockWriter=new Promise(C=>x=()=>{e.writerLocked=!1,C()}),await _}async function L(){rI(s,Qi(d.localHeaderArray))&&await s.closeDisk()}}async function p2t(e,t,{diskNumberStart:n,lockFileEntry:i},r,o,s){let{headerInfo:a,dataDescriptorInfo:c,metadataSize:u}=r,{headerArray:f,headerView:d,lastModDate:p,rawLastModDate:g,encrypted:m,compressed:y,version:A,compressionMethod:b,rawExtraFieldZip64:x,localExtraFieldZip64Length:T,rawExtraFieldExtendedTimestamp:E,extraFieldExtendedTimestampFlag:v,rawExtraFieldNTFS:S,rawExtraFieldUnix:I,rawExtraFieldAES:R}=a,{dataDescriptorArray:O}=c,{rawFilename:L,lastAccessDate:_,creationDate:C,password:w,rawPassword:D,level:N,zip64:F,zip64UncompressedSize:V,zip64CompressedSize:B,zipCrypto:j,dataDescriptor:k,directory:G,executable:q,versionMadeBy:Q,rawComment:W,rawExtraField:J,rawCentralExtraField:Z,useWebWorkers:ae,transferStreams:Ae,onstart:fe,onprogress:xe,onend:ge,signal:we,encryptionStrength:ve,extendedTimestamp:Re,msDosCompatible:Qe,internalFileAttributes:He,externalFileAttributes:Ye,uid:Ke,gid:Pe,unixMode:qe,symlink:st,setuid:vt,setgid:jt,sticky:lt,unixExternalUpper:mt,msdosAttributesRaw:ft,msdosAttributes:Yt,useCompressionStream:rt,passThrough:ht,format:Li,codecURI:Yn}=s,yi={lockFileEntry:i,versionMadeBy:Q,zip64:F,directory:!!G,executable:!!q,filenameUTF8:!0,rawFilename:L,commentUTF8:!0,rawComment:W,rawExtraFieldZip64:x,localExtraFieldZip64Length:T,rawExtraFieldExtendedTimestamp:E,rawExtraFieldNTFS:S,rawExtraFieldUnix:I,rawExtraFieldAES:R,rawExtraField:J,rawCentralExtraField:Z,extendedTimestamp:Re,msDosCompatible:Qe,internalFileAttributes:He,externalFileAttributes:Ye,diskNumberStart:n,uid:Ke,gid:Pe,unixMode:qe,symlink:!!st,setuid:vt,setgid:jt,sticky:lt,unixExternalUpper:mt,msdosAttributesRaw:ft,msdosAttributes:Yt},{crc32:zi,uncompressedSize:Si}=s,ui=0;ht||(Si=0);let{writable:Ai}=t;if(e){let zn=_m(zie(e)),tn=e.size,Hn={options:{codecType:zw,inputSize:tn,level:N,rawPassword:D,password:w,encryptionStrength:ve,zipCrypto:m&&j,passwordVerification:m&&j&&g>>8&255,computeCrc32:!ht,compressed:y&&!ht,encrypted:m&&!ht,useWebWorkers:ae,useCompressionStream:rt,transferStreams:Ae,format:Li,codecURI:Yn,compressionMethod:b},config:o,streamOptions:{signal:we,size:tn,onstart:fe,onprogress:xe,onend:ge}};try{let Ki=await A5({readable:zn,writable:Ai},Hn);if(ui=Ki.outputSize,t.size+=ui,ht||(Si=Ki.inputSize,(!m||j)&&(zi=Ki.crc32)),!B&&ui>=4294967295||!V&&Si>=4294967295)throw new Error(n9)}catch(Ki){throw Ki.outputSize!==ke&&(t.size+=Ki.outputSize),Ki}}return A2t({crc32:zi,compressedSize:ui,uncompressedSize:Si,headerInfo:a,dataDescriptorInfo:c},s),k&&await f0(t,O),Object.assign(yi,{uncompressedSize:Si,compressedSize:ui,lastModDate:p,rawLastModDate:g,creationDate:C,lastAccessDate:_,encrypted:!!m,zipCrypto:!!j,size:u+ui,compressionMethod:b,version:A,headerArray:f,headerView:d,signature:zi,crc32:m&&!j&&!ht?ke:zi,extraFieldExtendedTimestampFlag:v,zip64UncompressedSize:V,zip64CompressedSize:B}),yi}function g2t(e){let{rawFilename:t,lastModDate:n,rawLastModDate:i,lastAccessDate:r,creationDate:o,level:s,zip64:a,zipCrypto:c,useUnicodeFileNames:u,dataDescriptor:f,directory:d,rawExtraField:p,rawLocalExtraField:g,encryptionStrength:m,extendedTimestamp:y,ntfsTimestamp:A,passThrough:b,encrypted:x,zip64UncompressedSize:T,zip64CompressedSize:E,uncompressedSize:v,crc32:S}=e,{version:I,compressionMethod:R}=e,O=!d&&moe(R,s),L,_=b||!O,C=a&&(e.bufferedWrite||!f||!T&&!E||_),w=C||a&&f&&(T||E);if(a&&(T||E)){let ge=Bf(20);if(ge.writeUint16(1),ge.writeUint16(16),L=ge.array,C&&(ge.writeUint64(v),_)){let we=x?c?12:16+m*4:0;ge.writeUint64(b?0:v+we)}}else L=hr;let D;if(x&&!c){let xe=Bf(Qi(zOe)+2);xe.writeUint16(39169),xe.writeBytes(zOe),D=xe.array,D[8]=m}else D=hr;let N,F,V;if(y){let xe=Z5(n),ge=EMe(xe);if(ge){let ve=9+(r?4:0)+(o?4:0),Re=Bf(ve);V=1+(r?2:0)+(o?4:0),Re.writeUint16(21589),Re.writeUint16(ve-4),Re.writeUint8(V),Re.writeUint32(xe),r&&Re.writeUint32(WOe(Z5(r))),o&&Re.writeUint32(WOe(Z5(o))),F=Re.array}else F=hr;if(A===ke?!ge||!!(r||o):A)try{let ve=coe(n),Re=Bf(36);Re.writeUint16(10),Re.writeUint16(32),Re.skip(4),Re.writeUint16(1),Re.writeUint16(24),Re.writeUint64(ve),Re.writeUint64(r?coe(r):ve),Re.writeUint64(o?coe(o):ve),N=Re.array}catch{N=hr}else N=hr}else N=F=hr;let B;try{let{uid:xe,gid:ge,unixExtraFieldType:we}=e;if(we==uoe&&(xe!==ke||ge!==ke)){let ve=HOe(xe===ke?0:xe),Re=HOe(ge===ke?0:ge),Qe=3+ve.length+Re.length,He=Bf(4+Qe);He.writeUint16(30837),He.writeUint16(Qe),He.writeUint8(1),He.writeUint8(ve.length),He.writeBytes(ve),He.writeUint8(Re.length),He.writeBytes(Re),B=He.array}else if(we==foe&&(xe!==ke||ge!==ke)){let ve=Bf(8);ve.writeUint16(30805),ve.writeUint16(4),ve.writeUint16((xe===ke?0:xe)&65535),ve.writeUint16((ge===ke?0:ge)&65535),B=ve.array}else B=hr}catch{B=hr}R===ke&&(R=O?8:0),I===ke&&(I=R==0&&!d&&!x?10:20);let{codecVersionNeeded:j}=e;O&&j!==ke&&(I=I>j?I:j),a&&(I=I>45?I:45),x&&!c&&(I=I>51?I:51,b&&S!==ke&&(D[n2t]=o2t),u0(li(D),i2t,R),R=99);let k=w?Qi(L):0,G=k+Qi(D,F,N,B,p,g),q=e[ww]?r2t:0;if(G+q>65535)throw new Error(t9);let Q=new Date(Math.ceil(Math.floor(n.getTime()/1e3)/2)*2e3),{headerArray:W,headerView:J,rawLastModDate:Z}=vMe({version:I,bitFlag:SMe(s,u,f,x,R),compressionMethod:R,uncompressedSize:v,lastModDate:Q<Sw?Sw:Q>lie?lie:Q,rawLastModDate:i,rawFilename:t,zip64CompressedSize:E,zip64UncompressedSize:T,extraFieldLength:G}),ae=Bf(30+Qi(t)+G),Ae=ae.array,fe=li(Ae);return ae.writeUint32(67324752),ae.writeBytes(W),ae.writeBytes(t),w&&ae.writeBytes(L),ae.writeBytes(D),ae.writeBytes(F),ae.writeBytes(N),ae.writeBytes(B),ae.writeBytes(p),ae.writeBytes(g),f&&(E||Dc(fe,18,0),T||Dc(fe,22,0)),{localHeaderArray:Ae,localHeaderView:fe,headerArray:W,headerView:J,lastModDate:n,rawLastModDate:Z,encrypted:x,compressed:O,version:I,compressionMethod:R,extraFieldExtendedTimestampFlag:V,rawExtraFieldZip64:hr,localExtraFieldZip64Length:k,rawExtraFieldExtendedTimestamp:F,rawExtraFieldNTFS:N,rawExtraFieldUnix:B,rawExtraFieldAES:D,extraFieldLength:G}}function jOe(e,t){let{headerInfo:n}=e,{localHeaderArray:i,extraFieldLength:r}=n,o=64-(t+Qi(i))%64;o<4&&(o+=64);let s=new Uint8Array(o),a=li(s);u0(a,0,6534),u0(a,2,o-4);let c=i;n.localHeaderArray=i=new Uint8Array(Qi(c)+o),dM(i,c),dM(i,s,Qi(c));let u=li(i);u0(u,28,r+o),n.localHeaderView=u,e.metadataSize+=o}function HOe(e){let t=new Uint8Array(4);li(t).setUint32(0,e,!0);let i=4;for(;i>1&&t[i-1]===0;)i--;return t.subarray(0,i)}function _2t(e,t){if(e!==ke)e=e&255;else if(t!==ke){let{readOnly:n,hidden:i,system:r,directory:o,archive:s}=t,a=0;n&&(a|=1),i&&(a|=2),r&&(a|=4),o&&(a|=16),s&&(a|=32),e=a&255}return t===ke&&(t={readOnly:!!(e&1),hidden:!!(e&2),system:!!(e&4),directory:!!(e&16),archive:!!(e&32)}),{msdosAttributesRaw:e,msdosAttributes:t}}function y2t({zip64:e,dataDescriptor:t,dataDescriptorSignature:n}){let i=hr,r,o=0,s=e?20:12;return n&&(s+=4),t&&(i=new Uint8Array(s),r=li(i),n&&(o=4,Dc(r,0,134695760))),{dataDescriptorArray:i,dataDescriptorView:r,dataDescriptorOffset:o}}function A2t({crc32:e,compressedSize:t,uncompressedSize:n,headerInfo:i,dataDescriptorInfo:r},{zip64:o,zipCrypto:s,passThrough:a,dataDescriptor:c}){let{headerView:u,encrypted:f}=i,{dataDescriptorView:d,dataDescriptorOffset:p}=r;(!f||s||a)&&e!==ke&&(Dc(u,10,e),c&&Dc(d,p,e)),o?c&&(fM(d,p+4,BigInt(t)),fM(d,p+12,BigInt(n))):(Dc(u,14,t),Dc(u,18,n),c&&(Dc(d,p+4,t),Dc(d,p+8,n)))}function b2t({rawFilename:e,encrypted:t,zip64:n,localExtraFieldZip64Length:i,crc32:r,compressedSize:o,uncompressedSize:s,zip64UncompressedSize:a,zip64CompressedSize:c},u,{dataDescriptor:f,passThrough:d}){if(f||((!t||d&&r!==ke)&&Dc(u,14,r),c||Dc(u,18,o),a||Dc(u,22,s)),n&&i){let p=30+Qi(e)+4;fM(u,p,BigInt(s)),fM(u,p+8,BigInt(o))}}async function x2t(e,t,n){let i=T2t(e.fileEntries),{directoryStart:r,directoryEnd:o,directoryArray:s}=await E2t(e,i,n),a=await C2t(e,s,n);await v2t(e,t,n,{directoryStart:r,directoryEnd:o,directoryDataLength:i,signatureLength:a})}function T2t(e){let t=0;for(let[,n]of e){let{rawFilename:i,rawExtraFieldAES:r,rawComment:o,rawExtraFieldNTFS:s,rawExtraFieldUnix:a,rawExtraField:c,rawCentralExtraField:u,extendedTimestamp:f,extraFieldExtendedTimestampFlag:d,lastModDate:p,zip64UncompressedSize:g,zip64CompressedSize:m,uncompressedSize:y,compressedSize:A}=n,b=n.offset>=4294967295,x=n.diskNumberStart>=65535,T;if(b||x||g||m){let I=4+(g?8:0)+(m?8:0)+(b?8:0)+(x?4:0),R=Bf(I);R.writeUint16(1),R.writeUint16(I-4),g&&R.writeUint64(y),m&&R.writeUint64(A),b&&R.writeUint64(n.offset),x&&R.writeUint32(n.diskNumberStart),T=R.array}else T=hr;n.rawExtraFieldZip64=T,n.zip64Offset=b,n.zip64DiskNumberStart=x;let E,v=Z5(p);if(f&&EMe(v)){let I=Bf(9);I.writeUint16(21589),I.writeUint16(5),I.writeUint8(d),I.writeUint32(v),E=I.array}else E=hr;n.rawExtraFieldExtendedTimestamp=E;let S=Qi(T,r,s,a,E,c,u);if(S>65535)throw new Error(t9);t+=46+Qi(i,o)+S}return t}async function E2t(e,t,n){let{fileEntries:i,writer:r}=e,o=new Uint8Array(t);await Pc(r);let s=0,a=0,c=c_(r),u=lM(r),f=0;for(let[d,p]of Array.from(i.values()).entries()){let{offset:g,rawFilename:m,rawExtraFieldZip64:y,rawExtraFieldAES:A,rawExtraFieldExtendedTimestamp:b,rawExtraFieldNTFS:x,rawExtraFieldUnix:T,rawExtraField:E,rawCentralExtraField:v,rawComment:S,versionMadeBy:I,headerArray:R,headerView:O,zip64UncompressedSize:L,zip64CompressedSize:_,zip64DiskNumberStart:C,zip64Offset:w,internalFileAttributes:D,externalFileAttributes:N,diskNumberStart:F,uncompressedSize:V,compressedSize:B}=p,j=Qi(y,A,b,x,T,E,v),k=46+Qi(m,S)+j;rI(r,s+k-a)&&(await f0(r,o.slice(a,s)),a=s,f=0,await r.closeDisk()),d==0&&(c=c_(r),u=lM(r)),L||Dc(O,18,V),_||Dc(O,14,B),(w||C)&&p.version<45&&u0(O,0,45);let G=Bf(k);if(G.writeUint32(33639248),G.writeUint16(I),G.writeBytes(R.subarray(0,24)),G.writeUint16(j),G.writeUint16(Qi(S)),G.writeUint16(C?65535:F),G.writeUint16(D),G.writeUint32(N),G.writeUint32(w?4294967295:g),G.writeBytes(m),G.writeBytes(y),G.writeBytes(A),G.writeBytes(b),G.writeBytes(x),G.writeBytes(T),G.writeBytes(E),G.writeBytes(v),G.writeBytes(S),dM(o,G.array,s),s+=k,f++,n.onprogress)try{await n.onprogress(d+1,i.size,new VA(p))}catch{}}return await f0(r,a?o.slice(a):o),{directoryStart:{diskNumber:c,diskOffset:u},directoryEnd:{diskNumber:c_(r),entriesLength:f},directoryArray:o}}async function C2t(e,t,n){let i=hoe(e,n,Y1e);if(i){let r=await i(t),o=Qi(r);if(o>65535)throw new Error(AMe);let s=Bf(6+o);s.writeUint32(84233040),s.writeUint16(o),s.writeBytes(r);let{writer:a}=e;return rI(a,Qi(s.array))&&await a.closeDisk(),await f0(a,s.array),6+o}return 0}async function v2t(e,t,n,i){let{writer:r}=e,{directoryStart:o,directoryEnd:s,signatureLength:a}=i,{directoryDataLength:c}=i,u=e.fileEntries.size,f=o.diskNumber,d=uM(e,o),p=Qi(t);if(p>65535)throw new Error(goe);let g=Xi(e,n,I5),m=c_(r);if(rI(r,(g?98:22)+p)&&m++,d>=4294967295||c>=4294967295||u>=65535||m>=65535){if(g===!1)throw new Error(n9);g=!0}let y=Bf(g?98:22);rI(r,Qi(y.array)+p)&&await r.closeDisk(),m=c_(r);let A=m==s.diskNumber?s.entriesLength:0;g&&(y.writeUint32(101075792),y.writeUint64(44),y.writeUint16(45),y.writeUint16(45),y.writeUint32(m),y.writeUint32(f),y.writeUint64(A),y.writeUint64(u),y.writeUint64(c),y.writeUint64(d),y.writeUint32(117853008),y.writeUint32(m),y.writeUint64(BigInt(uM(e,r))+BigInt(c)+BigInt(a)),y.writeUint32(m+1),Xi(e,n,k1e,!0)&&(m=65535,f=65535),A=65535,u=65535,d=4294967295,c=4294967295),y.writeUint32(101010256),y.writeUint16(m),y.writeUint16(f),y.writeUint16(A),y.writeUint16(u),y.writeUint32(c),y.writeUint32(d),y.writeUint16(p),await f0(r,y.array),p&&await f0(r,t)}function Bf(e){let t=new Uint8Array(e),n=li(t),i=0;return{array:t,writeUint8:r=>{D2t(n,i,r),i+=1},writeUint16:r=>{u0(n,i,r),i+=2},writeUint32:r=>{Dc(n,i,r),i+=4},writeUint64:r=>{fM(n,i,BigInt(r)),i+=8},writeBytes:r=>{dM(t,r,i),i+=Qi(r)},skip:r=>i+=r}}function c_(e){let{diskNumber:t=0}=e;return t}function lM(e){let{diskOffset:t=0}=e;return t}function rI(e,t){let{availableSize:n=DT}=e;return t>n}function uM(e,{diskNumber:t=0,diskOffset:n=0}){return e.offset-n-(t?e.initialOffset:0)}async function S2t(e){let t=await Ro(e,0,4);return P2t(li(t),0)==134695760}function bMe(e){let t=li(e),n=0;for(;n+4<=Qi(e);){let i=4+e9(t,n+2);if(e9(t,n)==1)return bMe(Qd(e.subarray(0,n),e.subarray(Math.min(n+i,Qi(e)))));n+=i}return e}async function w2t(e,t,n,i){let{writer:r}=e,o=new Map;if(r.closeDisk){let s=Array.from(n).sort((c,u)=>J5(t,c)-J5(t,u)),a=0;for(let c of s){let u=J5(t,c);await aoe(e,t,a,u-a),rI(r,await I2t(t,u))&&await r.closeDisk(),o.set(c,{offset:uM(e,r),diskNumberStart:c_(r)}),a=u}await aoe(e,t,a,i-a)}else{let s=e.offset;await aoe(e,t,0,i),n.forEach(a=>o.set(a,{offset:s+J5(t,a),diskNumberStart:0}))}return o}async function aoe(e,t,n,i){if(i>0){let{writer:r}=e,o=0;try{await TMe(zie(t,{offset:n,size:i}),r,ke,s=>o+=s)}catch(s){e.hasCorruptedEntries=!0;try{s.corruptedEntry=!0}catch{}throw s}finally{r.size+=o,e.offset+=o}}}async function I2t(e,t){let n=await Ro(e,t,30);if(Qi(n)<30)return 30;let i=li(n);return 30+e9(i,26)+e9(i,28)}function J5(e,{offset:t,diskNumberStart:n}){return t+(e.getDiskOffset?e.getDiskOffset(n):0)}function xMe(){let e=new Uint8Array(4);return Dc(li(e),0,134695760),e}async function GOe(e,t){delete e.addSplitZipSignature,await f0(t,xMe()),e.offset+=4}async function f0(e,t){let{writable:n}=e,i=n.getWriter();try{await i.ready,e.size+=Qi(t),await i.write(t)}finally{i.releaseLock()}}async function TMe(e,t,n,i){let r=t.writable.getWriter();try{await e.pipeTo(new WritableStream({async write(o){await r.ready,await r.write(o),i(Qi(o))}}),{preventClose:!0,preventAbort:!0,signal:n})}finally{r.releaseLock()}}function coe(e){if(e){let t=(BigInt(e.getTime())+BigInt(116444736e5))*BigInt(1e4);return t<kOe?kOe:t>UOe?UOe:t}}function Z5(e){return Math.floor(e.getTime()/1e3)}function EMe(e){return e>=oMe&&e<=sMe}function WOe(e){return Math.min(sMe,Math.max(oMe,e))}function Xi(e,t,n,i){let r=t[n]===ke?e.options[n]:t[n];return r===ke?i:r}function loe(e,t,n,i){let r=Xi(e,t,n,i);if(r===null)return i;if(r!==ke&&(typeof r.getTime!=Do||Number.isNaN(r.getTime())))throw new Error(JOe);return r}function hoe(e,t,n){return Iw(Xi(e,t,n))}function CMe(e,t,n,i,r){let o=qOe(t,n,i),s=o===ke?qOe(e.options,n,i):o;return s===ke?r:s}function qOe(e,t,n){return e[t]===ke?e[n]:e[t]}function iI(e,t,n,i){return OT(Xi(e,t,n,i))}function YOe(e){return e+5*(Math.floor(e/16383)+1)}function moe(e,t){return e===ke?t===ke||t>0:e!==0}function e9(e,t){return e.getUint16(t,!0)}function P2t(e,t){return e.getUint32(t,!0)}function D2t(e,t,n){e.setUint8(t,n)}function u0(e,t,n){e.setUint16(t,n,!0)}function Dc(e,t,n){e.setUint32(t,n,!0)}function fM(e,t,n){e.setBigUint64(t,n,!0)}function dM(e,t,n){e.set(t,n)}function Qi(...e){let t=0;return e.forEach(n=>n&&(t+=n.length)),t}function vMe({version:e,bitFlag:t,compressionMethod:n,uncompressedSize:i,compressedSize:r,lastModDate:o,rawLastModDate:s,rawFilename:a,zip64CompressedSize:c,zip64UncompressedSize:u,extraFieldLength:f}){let d=Bf(26),p=d.array,g=li(p);if(d.writeUint16(e),d.writeUint16(t),d.writeUint16(n),s===ke){let m=new Uint32Array(1),y=li(m);u0(y,0,(o.getHours()<<6|o.getMinutes())<<5|o.getSeconds()/2),u0(y,2,(o.getFullYear()-1980<<4|o.getMonth()+1)<<5|o.getDate()),s=m[0]}return d.writeUint32(s),d.skip(4),c||r!==ke?d.writeUint32(c?4294967295:r):d.skip(4),u||i!==ke?d.writeUint32(u?4294967295:i):d.skip(4),d.writeUint16(Qi(a)),d.writeUint16(f),{headerArray:p,headerView:g,rawLastModDate:s}}function SMe(e,t,n,i,r){let o=0;return t&&(o=o|2048),n&&(o=o|8),(r==8||r==9)&&(e>=0&&e<=3&&(o=o|6),e>3&&e<=5&&(o=o|4),e==9&&(o=o|2)),i&&(o=o|1),o}v5();RO();i0();LT();dc();i0();LT();vie();var otr=1024*1024;Lw();var ctr=1024*1024;var utr=1024*1024;var ftr=512*1024;try{Dw({baseURI:import.meta.url})}catch{}i0();var O2t=[3,4,5,6,7,8,9,10,11,13,15,17,19,23,27,31,35,43,51,59,67,83,99,115,131,163,195,227,258],M2t=[0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0],N2t=[1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577],L2t=[0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13],F2t=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15],mM=new Uint8Array(288);mM.fill(8,0,144),mM.fill(9,144,256),mM.fill(7,256,280),mM.fill(8,280,288);var B2t=new Uint8Array(30).fill(5);function hM(e){let t=new Uint16Array(16);for(let r of e)t[r]++;t[0]=0;let n=new Uint16Array(17);for(let r=1;r<=15;r++)n[r+1]=n[r]+t[r];let i=new Uint16Array(e.length);for(let r=0;r<e.length;r++)e[r]&&(i[n[e[r]]++]=r);return{l:t,symbols:i}}var kf="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";function wMe(e){let t;e({wasmURI:()=>(t||(t="data:application/wasm;base64,"+(function(n){let i="",r=n.length,o=0;for(;o+2<r;o+=3){let a=n[o]<<16|n[o+1]<<8|n[o+2];i+=kf[a>>18&63]+kf[a>>12&63]+kf[a>>6&63]+kf[63&a]}let s=r-o;if(s===1){let a=n[o]<<16;i+=kf[a>>18&63]+kf[a>>12&63]+"=="}else if(s===2){let a=n[o]<<16|n[o+1]<<8;i+=kf[a>>18&63]+kf[a>>12&63]+kf[a>>6&63]+"="}return i})((function(n){let i=0,r=0,o=0,s=new Uint8Array(1024),a=0,c=0;for(;!c;){c=f(1);let A=f(2);if(A==0)d();else if(A==1)p(hM(mM),hM(B2t));else{if(A!=2)throw new Error("invalid deflate block type");p(...g())}}return s.subarray(0,a);function u(){if(i>=n.length)throw new Error("unexpected end of deflate data");return n[i++]}function f(A){for(;o<A;)r|=u()<<o,o+=8;let b=r&(1<<A)-1;return r>>>=A,o-=A,b}function d(){r=0,o=0;let A=u()|u()<<8;i+=2,y(a+A);for(let b=0;b<A;b++)s[a++]=u()}function p(A,b){let x=m(A);for(;x!=256;){if(x<256)y(a+1),s[a++]=x;else{let T=x-257,E=O2t[T]+f(M2t[T]),v=m(b),S=N2t[v]+f(L2t[v]);y(a+E);let I=a-S;for(let R=0;R<E;R++)s[a++]=s[I+R]}x=m(A)}}function g(){let A=f(5)+257,b=f(5)+1,x=f(4)+4,T=new Uint8Array(19);for(let I=0;I<x;I++)T[F2t[I]]=f(3);let E=hM(T),v=new Uint8Array(A+b),S=0;for(;S<v.length;){let I=m(E);if(I<16)v[S++]=I;else if(I==16){let R=v[S-1],O=f(2)+3;for(;O--;)v[S++]=R}else S+=I==17?f(3)+3:f(7)+11}return[hM(v.subarray(0,A)),hM(v.subarray(A))]}function m(A){let{l:b,symbols:x}=A,T=0,E=0,v=0;for(let S=1;S<=15;S++){T|=f(1);let I=b[S];if(T-E<I)return x[v+(T-E)];v+=I,E=E+I<<1,T<<=1}throw new Error("invalid huffman code")}function y(A){if(s.length<A){let b=2*s.length;for(;b<A;)b*=2;let x=new Uint8Array(b);x.set(s.subarray(0,a)),s=x}}})((function(n){let i=(n=String(n).replace(/[^A-Za-z0-9+/=]/g,"")).length,r=[];for(let o=0;o<i;o+=4){let s=kf.indexOf(n[o])<<18|kf.indexOf(n[o+1])<<12|(63&kf.indexOf(n[o+2]))<<6|63&kf.indexOf(n[o+3]);r.push(s>>16&255),n[o+2]!=="="&&r.push(s>>8&255),n[o+3]!=="="&&r.push(255&s)}return new Uint8Array(r)})("zb19kF3XcSd2vu7He/fdmTvAABzigUTfK0gaSxiBkqghRarWc2jODIcgBCXRH/6DVSQEDkXcBwJ8M08Q5ZX5hp+mbUnLcqlcjEsbY72qWOVIFVWFu6GztEXb9Fq70Wa5iVKljVUp1WYrqz82tXJKteVKKUT46z73fQwGIEhq7XAKfOd+ndOnT5/uPn26+6jT249qpZS+t/OgGQ718EGN/5nhUD1oh+GGFNWDSj2o9PDBeMj/6eGDyXBUdEN+RT+hh/YTd8baGe2SRCudqpbGf0qpVGltrLa2FWUqUq7tXNtEURRp5axyShkXWxfpx3S7HcVaP2WeMnGqh9pf+u0oS37DHY4f3Xz0wtYXjOqcPf/wudODzY8/cH7z8yqZG12ePX928MDW6c+rNJ+6p9rF6PqxrQtnNre3VTauZfP8Q2rm4Ojy3OntwQNnLpzf/tyjmw+p2Sw8kMaar6Teopi85Kbn5qZuffZXzj6m9s0290atj2rlxg80V7vbfm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X1ZfUV9RdFdSu2kSmmt1M1aqVml1KU1pVRL+nezknvc13Bvv1IqUf7SXHZSNj/H/8yuf3bXP7frXzT1z7+wL9vcXdXuT5vX4/AvCf/S8K8V/rXDvyz864R/Of/zr+7P3tNUnzQTZ26fSpNW3I4y17G5mdGzyv/1/uzRhNt2KuV/iserUGkox6zVp+EdUGOLYSn4flPGKEmZ3iwrjTJKRisnZaONVkVL+R/PZy06oQWr/x8=")))),t)})}dc();i0();qO();b5();var o9="deflate",i9="deflate-raw",IMe="deflate64-raw",r9="gzip",bs,oI,l_,pM,PMe;function DMe(e){if(bs=e,{malloc:oI,free:l_,memory:pM}=bs,typeof oI!="function"||typeof l_!="function"||!pM)throw bs=oI=l_=pM=null,new Error("Invalid WASM module")}function RMe(e){PMe=e}function OMe(e,t,n={}){if(!bs){let a=new Error("WASM module not loaded");throw a.cause=PMe,a}let i=typeof n.level=="number"?n.level:-1,r=typeof n.outBuffer=="number"?n.outBuffer:64*1024,o=typeof n.inBufferSize=="number"?n.inBufferSize:64*1024;return new TransformStream({start(){try{let a;if(this.out=oI(r),this.in=oI(o),this.inBufferSize=o,!this.out||!this.in)throw new Error("allocation failed");if(this._scratch=new Uint8Array(r),e?(this._process=bs.deflate_process,this._last_consumed=bs.deflate_last_consumed,this._end=bs.deflate_end,this.streamHandle=bs.deflate_new(),t===r9?a=bs.deflate_init_gzip(this.streamHandle,i):t===i9?a=bs.deflate_init_raw(this.streamHandle,i):a=bs.deflate_init(this.streamHandle,i)):t===IMe?(this._process=bs.inflate9_process,this._last_consumed=bs.inflate9_last_consumed,this._end=bs.inflate9_end,this.streamHandle=bs.inflate9_new(),a=bs.inflate9_init_raw(this.streamHandle)):(this._process=bs.inflate_process,this._last_consumed=bs.inflate_last_consumed,this._end=bs.inflate_end,this.streamHandle=bs.inflate_new(),t===i9?a=bs.inflate_init_raw(this.streamHandle):t===r9?a=bs.inflate_init_gzip(this.streamHandle):a=bs.inflate_init(this.streamHandle)),a!==0)throw new Error("init failed:"+a)}catch(a){throw s(this),a}},transform(a,c){try{let u=a,f=new Uint8Array(pM.buffer),d=this._process,p=this._last_consumed,g=this.out,m=this._scratch,y=0;for(;y<u.length;){let A=Math.min(u.length-y,32768);if((!this.in||this.inBufferSize<A)&&(this.in&&l_&&(l_(this.in),this.in=0),this.in=oI(A),this.inBufferSize=A,!this.in))throw new Error("allocation failed");f.set(u.subarray(y,y+A),this.in);let b=d(this.streamHandle,this.in,A,g,r,0),x=b&16777215;if(x&&(m.set(f.subarray(g,g+x),0),c.enqueue(m.slice(0,x))),!e){let E=b>>24&255,v=E&128?E-256:E;if(v<0)throw new Error("process error:"+v)}let T=p(this.streamHandle);if(T===0)break;y+=T}}catch(u){s(this),c.error(u)}},flush(a){try{let c=new Uint8Array(pM.buffer),u=this._process,f=this.out,d=this._scratch;for(;;){let p=u(this.streamHandle,0,0,f,r,4),g=p&16777215,m=p>>24&255;if(!e){let y=m&128?m-256:m;if(y<0)throw new Error("process error:"+y)}if(g&&(d.set(c.subarray(f,f+g),0),a.enqueue(d.slice(0,g))),m===1||g===0)break}}catch(c){a.error(c)}finally{let c=s(this);c!==0&&a.error(new Error("end error:"+c))}},cancel(){s(this)}});function s(a){let c=0;return a.streamHandle&&a._end&&(c=a._end(a.streamHandle)),a.streamHandle=0,a.in&&l_&&l_(a.in),a.in=0,a.out&&l_&&l_(a.out),a.out=0,c}}var qT=class{constructor(t=o9,n){return OMe(!0,t,n)}},YT=class{constructor(t=o9,n){return OMe(!1,t,n)}};qT.requiresModule=!0;YT.requiresModule=!0;qT.supportedFormats=[o9,i9,r9];YT.supportedFormats=[o9,i9,r9,IMe];var MMe=!1;async function NMe(e,{baseURI:t}){if(!MMe)try{await k2t(e,t),MMe=!0}catch(n){throw RMe(n),n}}async function k2t(e,t){let n,i;try{try{i=new URL(e,t)}catch{}n=await(await fetch(i)).arrayBuffer()}catch(o){if(e.startsWith("data:application/wasm;base64,"))n=U2t(e);else throw o}let r=await WebAssembly.instantiate(n);DMe(r.instance.exports)}function U2t(e){let t=e.split(",")[1],n=atob(t),i=n.length,r=new Uint8Array(i);for(let o=0;o<i;++o)r[o]=n.charCodeAt(o);return r.buffer}var s9;zRe({initModule:e=>{if(!s9){let{wasmURI:t}=e;typeof t==Do&&(t=t()),s9=NMe(t,e).catch(n=>{throw s9=null,n})}return s9}});Dw({CompressionStreamFallback:qT,DecompressionStreamFallback:YT});wMe(Dw);var yoe=32,z2t="http://www.opengis.net/kml/2.2",bm="http://www.google.com/kml/ext/2.2",V2t="http://www.w3.org/2000/xmlns/";function a9(e){this._files={},this._promises=[],this._count=0,this._modelCallback=e}var j2t=/^data:image\/([^,;]+)/;a9.prototype.texture=function(e){let t=this,n;if(typeof e=="string"||e instanceof De){if(e=De.createIfNeeded(e),!e.isDataUri)return e.url;let i=e.url.match(j2t);n=`texture_${++this._count}`,l(i)&&(n+=`.${i[1]}`);let r=e.fetchBlob().then(function(o){t._files[n]=o});return this._promises.push(r),n}if(e instanceof HTMLCanvasElement){n=`texture_${++this._count}.png`;let i=new Promise(r=>{e.toBlob(function(o){t._files[n]=o,r()})});return this._promises.push(i),n}return""};function H2t(e,t){return function(n){e._files[t]=n}}a9.prototype.model=function(e,t){let n=this._modelCallback;if(!l(n))throw new oe("Encountered a model entity while exporting to KML, but no model callback was supplied.");let i={},r=n(e,t,i);for(let o in i)if(i.hasOwnProperty(o)){let s=Promise.resolve(i[o]);this._promises.push(s),s.then(H2t(this,o))}return r};Object.defineProperties(a9.prototype,{promise:{get:function(){return Promise.all(this._promises)}},files:{get:function(){return this._files}}});function c9(e){this._time=e}c9.prototype.get=function(e,t,n){let i;return l(e)&&(i=l(e.getValue)?e.getValue(this._time,n):e),i??t};c9.prototype.getColor=function(e,t){let n=this.get(e,t);if(l(n))return KT(n)};c9.prototype.getMaterialType=function(e){if(l(e))return e.getType(this._time)};function Aoe(){this._ids={},this._styles={},this._count=0}Aoe.prototype.get=function(e){let t=this._ids,n=e.innerHTML;if(l(t[n]))return t[n];let i=`style-${++this._count}`;return e.setAttribute("id",i),i=`#${i}`,t[n]=i,this._styles[n]=e,i};Aoe.prototype.save=function(e){let t=this._styles,n=e.childNodes[0];for(let i in t)t.hasOwnProperty(i)&&e.insertBefore(t[i],n)};function BMe(){this._ids={}}BMe.prototype.get=function(e){if(!l(e))return this.get(Kn());let t=this._ids;return l(t[e])?`${e.toString()}-${++t[e]}`:(t[e]=0,e)};function boe(e){e=e??H.EMPTY_OBJECT;let t=e.entities,n=e.kmz??!1,i=boe._createState(e),r=t.values.filter(function(u){return!l(u.parent)}),o=i.kmlDoc,s=o.documentElement;s.setAttributeNS(V2t,"xmlns:gx",bm);let a=o.createElement("Document");s.appendChild(a),UMe(i,a,r),i.styleCache.save(a);let c=i.externalFileHandler;return c.promise.then(function(){let f=new XMLSerializer().serializeToString(i.kmlDoc);return n?G2t(f,c.files):{kml:f,externalFiles:c.files}})}async function G2t(e,t){let n=Zt("ThirdParty/Workers/zip-web-worker.js"),i=Zt("ThirdParty/zip-module.wasm");MO({workerURI:n,wasmURI:i});let r=new Ww("application/vnd.google-earth.kmz"),o=new cM(r);await o.add("doc.kml",new KO(e));let s=Object.keys(t);return await kMe(o,s,t,0),await o.close(),{kmz:await r.getData()}}async function kMe(e,t,n,i){if(t.length===i)return;let r=t[i];return await e.add(r,new Gu(n[r])),kMe(e,t,n,i+1)}boe._createState=function(e){let t=e.entities,n=new Aoe,i=t.computeAvailability(),r=l(e.time)?e.time:i.start,o=e.defaultAvailability??i,s=e.sampleDuration??60;o.start===it.MINIMUM_VALUE?o.stop===it.MAXIMUM_VALUE?o=new Cn:K.addSeconds(o.stop,-10*s,o.start):o.stop===it.MAXIMUM_VALUE&&K.addSeconds(o.start,10*s,o.stop);let a=new a9(e.modelCallback);return{kmlDoc:document.implementation.createDocument(z2t,"kml"),ellipsoid:e.ellipsoid??ee.default,idManager:new BMe,styleCache:n,externalFileHandler:a,time:r,valueGetter:new c9(r),sampleDuration:s,defaultAvailability:new Bs([o])}};function UMe(e,t,n){let i=e.kmlDoc,r=e.styleCache,o=e.valueGetter,s=e.idManager,a=n.length,c,u,f;for(let d=0;d<a;++d){let p=n[d];c=[],u=[],f=[],W2t(e,p,u,f),q2t(e,p.polyline,u,f),FMe(e,p.rectangle,u,f,c),FMe(e,p.polygon,u,f,c),$2t(e,p,p.model,u,f);let g,m=p.availability;l(m)&&(g=i.createElement("TimeSpan"),K.equals(m.start,it.MINIMUM_VALUE)||g.appendChild(Tn(i,"begin",K.toIso8601(m.start))),K.equals(m.stop,it.MAXIMUM_VALUE)||g.appendChild(Tn(i,"end",K.toIso8601(m.stop))));for(let b=0;b<c.length;++b){let x=c[b];x.setAttribute("id",s.get(p.id)),x.appendChild(Tn(i,"name",p.name)),x.appendChild(Tn(i,"visibility",p.show)),x.appendChild(Tn(i,"description",p.description)),l(g)&&x.appendChild(g),t.appendChild(x)}let y=u.length;if(y>0){let b=i.createElement("Placemark");b.setAttribute("id",s.get(p.id));let x=p.name,T=p.label;if(l(T)){let v=i.createElement("LabelStyle"),S=o.get(T.text);x=l(S)&&S.length>0?S:x;let I=o.getColor(T.fillColor);l(I)&&(v.appendChild(Tn(i,"color",I)),v.appendChild(Tn(i,"colorMode","normal")));let R=o.get(T.scale);l(R)&&v.appendChild(Tn(i,"scale",R)),f.push(v)}b.appendChild(Tn(i,"name",x)),b.appendChild(Tn(i,"visibility",p.show)),b.appendChild(Tn(i,"description",p.description)),l(g)&&b.appendChild(g),t.appendChild(b);let E=f.length;if(E>0){let v=i.createElement("Style");for(let S=0;S<E;++S)v.appendChild(f[S]);b.appendChild(Tn(i,"styleUrl",r.get(v)))}if(u.length===1)b.appendChild(u[0]);else if(u.length>1){let v=i.createElement("MultiGeometry");for(let S=0;S<y;++S)v.appendChild(u[S]);b.appendChild(v)}}let A=p._children;if(A.length>0){let b=i.createElement("Folder");b.setAttribute("id",s.get(p.id)),b.appendChild(Tn(i,"name",p.name)),b.appendChild(Tn(i,"visibility",p.show)),b.appendChild(Tn(i,"description",p.description)),t.appendChild(b),UMe(e,b,A)}}}var qu=new h,Jl=new he,Am=new K;function W2t(e,t,n,i){let r=e.kmlDoc,o=e.ellipsoid,s=e.valueGetter,a=t.billboard??t.point;if(!l(a)&&!l(t.path))return;let c=t.position;if(!c.isConstant){zMe(e,t,a,n,i);return}s.get(c,void 0,qu);let u=Tn(r,"coordinates",XT(qu,o)),f=r.createElement("Point"),d=r.createElement("altitudeMode");d.appendChild($T(e,a.heightReference)),f.appendChild(d),f.appendChild(u),n.push(f);let p=a instanceof Ol?jMe(e,a):VMe(e,a);i.push(p)}function zMe(e,t,n,i,r){let o=e.kmlDoc,s=e.ellipsoid,a=e.valueGetter,c,u=t.position,f=!0;u instanceof Ec?(c=u.intervals,f=!1):c=t.availability??e.defaultAvailability;let d=n instanceof J_,p,g,m,y=[];for(p=0;p<c.length;++p){let b=c.get(p),x=f?u:b.data,T=o.createElement("altitudeMode");x instanceof Bg?(x=x._value,T.appendChild($T(e,We.CLAMP_TO_GROUND))):l(n)?T.appendChild($T(e,n.heightReference)):T.appendChild($T(e,We.NONE));let E=[],v=[];if(x.isConstant){a.get(x,void 0,qu);let I=Tn(o,"coordinates",XT(qu,s));E.push(K.toIso8601(b.start)),v.push(I),E.push(K.toIso8601(b.stop)),v.push(I)}else if(x instanceof Cc)for(m=x._property._times,g=0;g<m.length;++g)E.push(K.toIso8601(m[g])),x.getValueInReferenceFrame(m[g],Wi.FIXED,qu),v.push(XT(qu,s));else if(x instanceof jd){m=x._times;let I=x._values;for(g=0;g<m.length;++g)E.push(K.toIso8601(m[g])),h.fromArray(I,g*3,qu),v.push(XT(qu,s))}else{let I=e.sampleDuration;b.start.clone(Am),b.isStartIncluded||K.addSeconds(Am,I,Am);let R=b.stop;for(;K.lessThan(Am,R);)x.getValue(Am,qu),E.push(K.toIso8601(Am)),v.push(XT(qu,s)),K.addSeconds(Am,I,Am);b.isStopIncluded&&K.equals(Am,R)&&(x.getValue(Am,qu),E.push(K.toIso8601(Am)),v.push(XT(qu,s)))}let S=o.createElementNS(bm,"Track");S.appendChild(T);for(let I=0;I<E.length;++I){let R=Tn(o,"when",E[I]),O=Tn(o,"coord",v[I],bm);S.appendChild(R),S.appendChild(O)}d&&S.appendChild(HMe(e,n)),y.push(S)}if(y.length===1)i.push(y[0]);else if(y.length>1){let b=o.createElementNS(bm,"MultiTrack");for(p=0;p<y.length;++p)b.appendChild(y[p]);i.push(b)}if(l(n)&&!d){let b=n instanceof Ol?jMe(e,n):VMe(e,n);r.push(b)}let A=t.path;if(l(A)){let b=a.get(A.width),x=A.material;if(l(x)||l(b)){let T=o.createElement("LineStyle");l(b)&&T.appendChild(Tn(o,"width",b)),xoe(e,x,T),r.push(T)}}}function VMe(e,t){let n=e.kmlDoc,i=e.valueGetter,r=n.createElement("IconStyle"),o=i.getColor(t.color);l(o)&&(r.appendChild(Tn(n,"color",o)),r.appendChild(Tn(n,"colorMode","normal")));let s=i.get(t.pixelSize);return l(s)&&r.appendChild(Tn(n,"scale",s/yoe)),r}function jMe(e,t){let n=e.kmlDoc,i=e.valueGetter,r=e.externalFileHandler,o=n.createElement("IconStyle"),s=i.get(t.image);if(l(s)){s=r.texture(s);let p=n.createElement("Icon");p.appendChild(Tn(n,"href",s));let g=i.get(t.imageSubRegion);l(g)&&(p.appendChild(Tn(n,"x",g.x,bm)),p.appendChild(Tn(n,"y",g.y,bm)),p.appendChild(Tn(n,"w",g.width,bm)),p.appendChild(Tn(n,"h",g.height,bm))),o.appendChild(p)}let a=i.getColor(t.color);l(a)&&(o.appendChild(Tn(n,"color",a)),o.appendChild(Tn(n,"colorMode","normal")));let c=i.get(t.scale);l(c)&&o.appendChild(Tn(n,"scale",c));let u=i.get(t.pixelOffset);if(l(u)){c=c??1,U.divideByScalar(u,c,u);let p=i.get(t.width,yoe),g=i.get(t.height,yoe),m=i.get(t.horizontalOrigin,Gi.CENTER);m===Gi.CENTER?u.x-=p*.5:m===Gi.RIGHT&&(u.x-=p);let y=i.get(t.verticalOrigin,qn.CENTER);y===qn.TOP?u.y+=g:y===qn.CENTER&&(u.y+=g*.5);let A=n.createElement("hotSpot");A.setAttribute("x",-u.x),A.setAttribute("y",u.y),A.setAttribute("xunits","pixels"),A.setAttribute("yunits","pixels"),o.appendChild(A)}let f=i.get(t.rotation),d=i.get(t.alignedAxis);return l(f)&&h.equals(h.UNIT_Z,d)&&(f=P.toDegrees(-f),f===0&&(f=360),o.appendChild(Tn(n,"heading",f))),o}function q2t(e,t,n,i){let r=e.kmlDoc,o=e.ellipsoid,s=e.valueGetter;if(!l(t))return;let a=r.createElement("LineString"),c=r.createElement("altitudeMode"),u=s.get(t.clampToGround,!1),f;u?(a.appendChild(Tn(r,"tessellate",!0)),f=r.createTextNode("clampToGround")):f=r.createTextNode("absolute"),c.appendChild(f),a.appendChild(c);let d=t.positions,p=s.get(d),g=Tn(r,"coordinates",XT(p,o));a.appendChild(g);let m=s.get(t.zIndex);u&&l(m)&&a.appendChild(Tn(r,"drawOrder",m,bm)),n.push(a);let y=r.createElement("LineStyle"),A=s.get(t.width);l(A)&&y.appendChild(Tn(r,"width",A)),xoe(e,t.material,y),i.push(y)}function Y2t(e,t,n){let i=e.kmlDoc,r=e.valueGetter,o=r.get(t.height,0);n>0&&(o=n);let s=t.coordinates,a=r.get(s),c=[],u=[ie.northeast,ie.southeast,ie.southwest,ie.northwest];for(let g=0;g<4;++g)u[g](a,Jl),c.push(`${P.toDegrees(Jl.longitude)},${P.toDegrees(Jl.latitude)},${o}`);let f=Tn(i,"coordinates",c.join(" ")),d=i.createElement("outerBoundaryIs"),p=i.createElement("LinearRing");return p.appendChild(f),d.appendChild(p),[d]}function LMe(e,t,n,i){let r=e.kmlDoc,o=e.ellipsoid,s=[],a=t.length;for(let f=0;f<a;++f)he.fromCartesian(t[f],o,Jl),s.push(`${P.toDegrees(Jl.longitude)},${P.toDegrees(Jl.latitude)},${i?Jl.height:n}`);let c=Tn(r,"coordinates",s.join(" ")),u=r.createElement("LinearRing");return u.appendChild(c),u}function X2t(e,t,n){let i=e.kmlDoc,r=e.valueGetter,o=r.get(t.height,0),s=r.get(t.perPositionHeight,!1);!s&&n>0&&(o=n);let a=[],c=t.hierarchy,u=r.get(c),f=Array.isArray(u)?u:u.positions,d=i.createElement("outerBoundaryIs");d.appendChild(LMe(e,f,o,s)),a.push(d);let p=u.holes;if(l(p)){let g=p.length;for(let m=0;m<g;++m){let y=i.createElement("innerBoundaryIs");y.appendChild(LMe(e,p[m].positions,o,s)),a.push(y)}}return a}function FMe(e,t,n,i,r){let o=e.kmlDoc,s=e.valueGetter;if(!l(t))return;let a=t instanceof sp;if(a&&s.getMaterialType(t.material)==="Image"){K2t(e,t,r);return}let c=o.createElement("Polygon"),u=s.get(t.extrudedHeight,0);u>0&&c.appendChild(Tn(o,"extrude",!0));let f=a?Y2t(e,t,u):X2t(e,t,u),d=f.length;for(let A=0;A<d;++A)c.appendChild(f[A]);let p=o.createElement("altitudeMode");p.appendChild($T(e,t.heightReference)),c.appendChild(p),n.push(c);let g=o.createElement("PolyStyle"),m=s.get(t.fill,!1);m&&g.appendChild(Tn(o,"fill",m)),xoe(e,t.material,g);let y=s.get(t.outline,!1);if(y){g.appendChild(Tn(o,"outline",y));let A=o.createElement("LineStyle"),b=s.get(t.outlineWidth,1);A.appendChild(Tn(o,"width",b));let x=s.getColor(t.outlineColor,z.BLACK);A.appendChild(Tn(o,"color",x)),A.appendChild(Tn(o,"colorMode","normal")),i.push(A)}i.push(g)}function K2t(e,t,n){let i=e.kmlDoc,r=e.valueGetter,o=e.externalFileHandler,s=i.createElement("GroundOverlay"),a=i.createElement("altitudeMode");a.appendChild($T(e,t.heightReference)),s.appendChild(a);let c=r.get(t.height);l(c)&&s.appendChild(Tn(i,"altitude",c));let u=r.get(t.coordinates),f=i.createElement("LatLonBox");f.appendChild(Tn(i,"north",P.toDegrees(u.north))),f.appendChild(Tn(i,"south",P.toDegrees(u.south))),f.appendChild(Tn(i,"east",P.toDegrees(u.east))),f.appendChild(Tn(i,"west",P.toDegrees(u.west))),s.appendChild(f);let d=r.get(t.material),p=o.texture(d.image),g=i.createElement("Icon");g.appendChild(Tn(i,"href",p)),s.appendChild(g);let m=d.color;l(m)&&s.appendChild(Tn(i,"color",KT(d.color))),n.push(s)}function HMe(e,t){let n=e.kmlDoc,i=e.valueGetter,r=e.externalFileHandler,o=n.createElement("Model"),s=i.get(t.scale);if(l(s)){let u=n.createElement("scale");u.appendChild(Tn(n,"x",s)),u.appendChild(Tn(n,"y",s)),u.appendChild(Tn(n,"z",s)),o.appendChild(u)}let a=n.createElement("Link"),c=r.model(t,e.time);return a.appendChild(Tn(n,"href",c)),o.appendChild(a),o}function $2t(e,t,n,i,r){let o=e.kmlDoc,s=e.ellipsoid,a=e.valueGetter;if(!l(n))return;let c=t.position;if(!c.isConstant){zMe(e,t,n,i,r);return}let u=HMe(e,n),f=o.createElement("altitudeMode");f.appendChild($T(e,n.heightReference)),u.appendChild(f),a.get(c,void 0,qu),he.fromCartesian(qu,s,Jl);let d=o.createElement("Location");d.appendChild(Tn(o,"longitude",P.toDegrees(Jl.longitude))),d.appendChild(Tn(o,"latitude",P.toDegrees(Jl.latitude))),d.appendChild(Tn(o,"altitude",Jl.height)),u.appendChild(d),i.push(u)}function xoe(e,t,n){let i=e.kmlDoc,r=e.valueGetter;if(!l(t))return;let o=r.get(t);if(!l(o))return;let s,a=r.getMaterialType(t),c,u;switch(a){case"Image":s=KT(z.WHITE);break;case"Color":case"Grid":case"PolylineGlow":case"PolylineArrow":case"PolylineDash":s=KT(o.color);break;case"PolylineOutline":s=KT(o.color),c=KT(o.outlineColor),u=o.outlineWidth,n.appendChild(Tn(i,"outerColor",c,bm)),n.appendChild(Tn(i,"outerWidth",u,bm));break;case"Stripe":s=KT(o.oddColor);break}l(s)&&(n.appendChild(Tn(i,"color",s)),n.appendChild(Tn(i,"colorMode","normal")))}function $T(e,t){let n=e.kmlDoc,r=e.valueGetter.get(t,We.NONE),o;switch(r){case We.NONE:o=n.createTextNode("absolute");break;case We.CLAMP_TO_GROUND:o=n.createTextNode("clampToGround");break;case We.RELATIVE_TO_GROUND:o=n.createTextNode("relativeToGround");break}return o}function XT(e,t){Array.isArray(e)||(e=[e]);let n=e.length,i=[];for(let r=0;r<n;++r)he.fromCartesian(e[r],t,Jl),i.push(`${P.toDegrees(Jl.longitude)},${P.toDegrees(Jl.latitude)},${Jl.height}`);return i.join(" ")}function Tn(e,t,n,i){n=n??"",typeof n=="boolean"&&(n=n?"1":"0");let r=l(i)?e.createElementNS(i,t):e.createElement(t),o=n==="string"&&n.indexOf("<")!==-1?e.createCDATASection(n):e.createTextNode(n);return r.appendChild(o),r}function KT(e){let t="",n=e.toBytes();for(let i=3;i>=0;--i)t+=n[i]<16?`0${n[i].toString(16)}`:n[i].toString(16);return t}var GMe=boe;function _M(){this._cache={}}_M.prototype.fromColor=function(e,t){return l9(void 0,void 0,e,t,this._cache)};_M.prototype.fromUrl=function(e,t,n){return l9(e,void 0,t,n,this._cache)};_M.prototype.fromMakiIconId=function(e,t,n){return l9(Zt(`Assets/Textures/maki/${encodeURIComponent(e)}.png`),void 0,t,n,this._cache)};_M.prototype.fromText=function(e,t,n){return l9(void 0,e,t,n,this._cache)};var J2t=new z;function Z2t(e,t,n){e.save(),e.scale(n/24,n/24),e.fillStyle=t.toCssColorString(),e.strokeStyle=t.brighten(.6,J2t).toCssColorString(),e.lineWidth=.846,e.beginPath(),e.moveTo(6.72,.422),e.lineTo(17.28,.422),e.bezierCurveTo(18.553,.422,19.577,1.758,19.577,3.415),e.lineTo(19.577,10.973),e.bezierCurveTo(19.577,12.63,18.553,13.966,17.282,13.966),e.lineTo(14.386,14.008),e.lineTo(11.826,23.578),e.lineTo(9.614,14.008),e.lineTo(6.719,13.965),e.bezierCurveTo(5.446,13.983,4.422,12.629,4.422,10.972),e.lineTo(4.422,3.416),e.bezierCurveTo(4.423,1.76,5.447,.423,6.718,.423),e.closePath(),e.fill(),e.stroke(),e.restore()}function WMe(e,t,n){let i=n/2.5,r=i,o=i;t.width>t.height?o=i*(t.height/t.width):t.width<t.height&&(r=i*(t.width/t.height));let s=Math.round((n-r)/2),a=Math.round(7/24*n-o/2);e.globalCompositeOperation="destination-out",e.drawImage(t,s-1,a,r,o),e.drawImage(t,s,a-1,r,o),e.drawImage(t,s+1,a,r,o),e.drawImage(t,s,a+1,r,o),e.globalCompositeOperation="destination-over",e.fillStyle=z.BLACK.toCssColorString(),e.fillRect(s-1,a-1,r+2,o+2),e.globalCompositeOperation="destination-out",e.drawImage(t,s,a,r,o),e.globalCompositeOperation="destination-over",e.fillStyle=z.WHITE.toCssColorString(),e.fillRect(s-1,a-2,r+2,o+2)}var gM=new Array(4);function l9(e,t,n,i,r){gM[0]=e,gM[1]=t,gM[2]=n,gM[3]=i;let o=JSON.stringify(gM),s=r[o];if(l(s))return s;let a=document.createElement("canvas");a.width=i,a.height=i;let c=a.getContext("2d");if(Z2t(c,n,i),l(e)){let f=De.createIfNeeded(e).fetchImage().then(function(d){return WMe(c,d,i),r[o]=a,a});return r[o]=f,f}else if(l(t)){let u=rC(t,{font:`bold ${i}px sans-serif`});WMe(c,u,i)}return r[o]=a,a}var GA=_M;function Toe(e){return e}function u9(e){if(e==null)return Toe;var t,n,i=e.scale[0],r=e.scale[1],o=e.translate[0],s=e.translate[1];return function(a,c){c||(t=n=0);var u=2,f=a.length,d=new Array(f);for(d[0]=(t+=a[0])*i+o,d[1]=(n+=a[1])*r+s;u<f;)d[u]=a[u],++u;return d}}function qMe(e,t){for(var n,i=e.length,r=i-t;r<--i;)n=e[r],e[r++]=e[i],e[i]=n}function Eoe(e,t){return typeof t=="string"&&(t=e.objects[t]),t.type==="GeometryCollection"?{type:"FeatureCollection",features:t.geometries.map(function(n){return YMe(e,n)})}:YMe(e,t)}function YMe(e,t){var n=t.id,i=t.bbox,r=t.properties==null?{}:t.properties,o=Coe(e,t);return n==null&&i==null?{type:"Feature",properties:r,geometry:o}:i==null?{type:"Feature",id:n,properties:r,geometry:o}:{type:"Feature",id:n,bbox:i,properties:r,geometry:o}}function Coe(e,t){var n=u9(e.transform),i=e.arcs;function r(f,d){d.length&&d.pop();for(var p=i[f<0?~f:f],g=0,m=p.length;g<m;++g)d.push(n(p[g],g));f<0&&qMe(d,m)}function o(f){return n(f)}function s(f){for(var d=[],p=0,g=f.length;p<g;++p)r(f[p],d);return d.length<2&&d.push(d[0]),d}function a(f){for(var d=s(f);d.length<4;)d.push(d[0]);return d}function c(f){return f.map(a)}function u(f){var d=f.type,p;switch(d){case"GeometryCollection":return{type:d,geometries:f.geometries.map(u)};case"Point":p=o(f.coordinates);break;case"MultiPoint":p=f.coordinates.map(o);break;case"LineString":p=s(f.arcs);break;case"MultiLineString":p=f.arcs.map(s);break;case"Polygon":p=c(f.arcs);break;case"MultiPolygon":p=f.arcs.map(c);break;default:return null}return{type:d,coordinates:p}}return u(t)}function f9(e){return h.fromDegrees(e[0],e[1],e[2])}var voe={"urn:ogc:def:crs:OGC:1.3:CRS84":f9,"EPSG:4326":f9,"urn:ogc:def:crs:EPSG::4326":f9},XMe={},KMe={},Soe=48,woe,Ioe=z.ROYALBLUE,Poe=z.YELLOW,Doe=2,Roe=z.fromBytes(255,255,0,100),Ooe=!1,ikt={small:24,medium:48,large:64},rkt=["title","description","marker-size","marker-symbol","marker-color","stroke","stroke-opacity","stroke-width","fill","fill-opacity"];function $Me(e,t){let n="";for(let i in e)if(e.hasOwnProperty(i)){if(i===t||rkt.indexOf(i)!==-1)continue;let r=e[i];l(r)&&(typeof r=="object"?n+=`<tr><th>${i}</th><td>${$Me(r)}</td></tr>`:n+=`<tr><th>${i}</th><td>${r}</td></tr>`)}return n.length>0&&(n=`<table class="cesium-infoBox-defaultTable"><tbody>${n}</tbody></table>`),n}function okt(e,t,n){let i;return function(r,o){return l(i)||(i=e(t,n)),i}}function skt(e,t){return new lp(okt($Me,e,t),!0)}function d9(e,t,n){let i=e.id;if(!l(i)||e.type!=="Feature")i=Kn();else{let s=2,a=i;for(;l(t.getById(a));)a=`${i}_${s}`,s++;i=a}let r=t.getOrCreateEntity(i),o=e.properties;if(l(o)){r.properties=o;let s,a=o.title;if(l(a))r.name=a,s="title";else{let u=Number.MAX_VALUE;for(let f in o)if(o.hasOwnProperty(f)&&o[f]){let d=f.toLowerCase();if(u>1&&d==="title"){s=f;break}else u>2&&d==="name"?(u=2,s=f):u>3&&/title/i.test(f)?(u=3,s=f):u>4&&/name/i.test(f)&&(u=4,s=f)}l(s)&&(r.name=o[s])}let c=o.description;c!==null&&(r.description=l(c)?new hi(c):n(o,s))}return r}function Moe(e,t){let n=new Array(e.length);for(let i=0;i<e.length;i++)n[i]=t(e[i]);return n}var JMe={Feature:QMe,FeatureCollection:akt,GeometryCollection:eNe,LineString:oNe,MultiLineString:sNe,MultiPoint:iNe,MultiPolygon:lNe,Point:nNe,Polygon:cNe,Topology:uNe},ZMe={GeometryCollection:eNe,LineString:oNe,MultiLineString:sNe,MultiPoint:iNe,MultiPolygon:lNe,Point:nNe,Polygon:cNe,Topology:uNe};function QMe(e,t,n,i,r){if(t.geometry===null){d9(t,e._entityCollection,r.describe);return}if(!l(t.geometry))throw new oe("feature.geometry is required.");let o=t.geometry.type,s=ZMe[o];if(!l(s))throw new oe(`Unknown geometry type: ${o}`);s(e,t,t.geometry,i,r)}function akt(e,t,n,i,r){let o=t.features;for(let s=0,a=o.length;s<a;s++)QMe(e,o[s],void 0,i,r)}function eNe(e,t,n,i,r){let o=n.geometries;for(let s=0,a=o.length;s<a;s++){let c=o[s],u=c.type,f=ZMe[u];if(!l(f))throw new oe(`Unknown geometry type: ${u}`);f(e,t,c,i,r)}}function tNe(e,t,n,i,r){let o=r.markerSymbol,s=r.markerColor,a=r.markerSize,c=t.properties;if(l(c)){let g=c["marker-color"];l(g)&&(s=z.fromCssColorString(g)),a=ikt[c["marker-size"]]??a;let m=c["marker-symbol"];l(m)&&(o=m)}let u;l(o)?o.length===1?u=e._pinBuilder.fromText(o.toUpperCase(),s,a):u=e._pinBuilder.fromMakiIconId(o,s,a):u=e._pinBuilder.fromColor(s,a);let f=new Ol;f.verticalOrigin=new hi(qn.BOTTOM),i.length===2&&r.clampToGround&&(f.heightReference=We.CLAMP_TO_GROUND);let d=d9(t,e._entityCollection,r.describe);d.billboard=f,d.position=new gu(n(i));let p=Promise.resolve(u).then(function(g){f.image=new hi(g)}).catch(function(){f.image=new hi(e._pinBuilder.fromColor(s,a))});e._promises.push(p)}function nNe(e,t,n,i,r){tNe(e,t,i,n.coordinates,r)}function iNe(e,t,n,i,r){let o=n.coordinates;for(let s=0;s<o.length;s++)tNe(e,t,i,o[s],r)}function rNe(e,t,n,i,r){let o=r.strokeMaterialProperty,s=r.strokeWidthProperty,a=t.properties;if(l(a)){let f=a["stroke-width"];l(f)&&(s=new hi(f));let d,p=a.stroke;l(p)&&(d=z.fromCssColorString(p));let g=a["stroke-opacity"];l(g)&&g!==1&&(l(d)||(d=o.color.getValue().clone()),d.alpha=g),l(d)&&(o=new Kt(d))}let c=d9(t,e._entityCollection,r.describe),u=new Ml;c.polyline=u,u.clampToGround=r.clampToGround,u.material=o,u.width=s,u.positions=new hi(Moe(i,n)),u.arcType=ln.RHUMB}function oNe(e,t,n,i,r){rNe(e,t,i,n.coordinates,r)}function sNe(e,t,n,i,r){let o=n.coordinates;for(let s=0;s<o.length;s++)rNe(e,t,i,o[s],r)}function aNe(e,t,n,i,r){if(i.length===0||i[0].length===0)return;let o=r.strokeMaterialProperty.color,s=r.fillMaterialProperty,a=r.strokeWidthProperty,c=t.properties;if(l(c)){let g=c["stroke-width"];l(g)&&(a=new hi(g));let m,y=c.stroke;l(y)&&(m=z.fromCssColorString(y));let A=c["stroke-opacity"];l(A)&&A!==1&&(l(m)||(m=o.getValue().clone()),m.alpha=A),l(m)&&(o=new hi(m));let b,x=c.fill,T=s.color.getValue();l(x)&&(b=z.fromCssColorString(x),b.alpha=T.alpha),A=c["fill-opacity"],l(A)&&A!==T.alpha&&(l(b)||(b=T.clone()),b.alpha=A),l(b)&&(s=new Kt(b))}let u=new op;u.outline=new hi(!0),u.outlineColor=o,u.outlineWidth=a,u.material=s,u.arcType=ln.RHUMB;let f=[];for(let g=1,m=i.length;g<m;g++)f.push(new Wc(Moe(i[g],n)));let d=i[0];u.hierarchy=new hi(new Wc(Moe(d,n),f)),d[0].length>2?u.perPositionHeight=new hi(!0):r.clampToGround||(u.height=0);let p=d9(t,e._entityCollection,r.describe);p.polygon=u}function cNe(e,t,n,i,r){aNe(e,t,i,n.coordinates,r)}function lNe(e,t,n,i,r){let o=n.coordinates;for(let s=0;s<o.length;s++)aNe(e,t,i,o[s],r)}function uNe(e,t,n,i,r){for(let o in n.objects)if(n.objects.hasOwnProperty(o)){let s=Eoe(n,n.objects[o]),a=JMe[s.type];a(e,s,s,i,r)}}function WA(e){this._name=e,this._changed=new be,this._error=new be,this._isLoading=!1,this._loading=new be,this._entityCollection=new Ja(this),this._promises=[],this._pinBuilder=new GA,this._entityCluster=new dd,this._credit=void 0,this._resourceCredits=[]}WA.load=function(e,t){return new WA().load(e,t)};Object.defineProperties(WA,{markerSize:{get:function(){return Soe},set:function(e){Soe=e}},markerSymbol:{get:function(){return woe},set:function(e){woe=e}},markerColor:{get:function(){return Ioe},set:function(e){Ioe=e}},stroke:{get:function(){return Poe},set:function(e){Poe=e}},strokeWidth:{get:function(){return Doe},set:function(e){Doe=e}},fill:{get:function(){return Roe},set:function(e){Roe=e}},clampToGround:{get:function(){return Ooe},set:function(e){Ooe=e}},crsNames:{get:function(){return voe}},crsLinkHrefs:{get:function(){return XMe}},crsLinkTypes:{get:function(){return KMe}}});Object.defineProperties(WA.prototype,{name:{get:function(){return this._name},set:function(e){this._name!==e&&(this._name=e,this._changed.raiseEvent(this))}},clock:{value:void 0,writable:!1},entities:{get:function(){return this._entityCollection}},isLoading:{get:function(){return this._isLoading}},changedEvent:{get:function(){return this._changed}},errorEvent:{get:function(){return this._error}},loadingEvent:{get:function(){return this._loading}},show:{get:function(){return this._entityCollection.show},set:function(e){this._entityCollection.show=e}},clustering:{get:function(){return this._entityCluster},set:function(e){this._entityCluster=e}},credit:{get:function(){return this._credit}}});WA.prototype.load=function(e,t){return fNe(this,e,t,!0)};WA.prototype.process=function(e,t){return fNe(this,e,t,!1)};function fNe(e,t,n,i){Ps.setLoading(e,!0),n=n??H.EMPTY_OBJECT;let r=n.credit;typeof r=="string"&&(r=new It(r)),e._credit=r;let o=t,s=n.sourceUri;if(typeof t=="string"||t instanceof De){t=De.createIfNeeded(t),o=t.fetchJson(),s=s??t.getUrlComponent();let a=e._resourceCredits,c=t.credits;if(l(c)){let u=c.length;for(let f=0;f<u;f++)a.push(c[f])}}return n={describe:n.describe??skt,markerSize:n.markerSize??Soe,markerSymbol:n.markerSymbol??woe,markerColor:n.markerColor??Ioe,strokeWidthProperty:new hi(n.strokeWidth??Doe),strokeMaterialProperty:new Kt(n.stroke??Poe),fillMaterialProperty:new Kt(n.fill??Roe),clampToGround:n.clampToGround??Ooe},Promise.resolve(o).then(function(a){return ckt(e,a,n,s,i)}).catch(function(a){throw Ps.setLoading(e,!1),e._error.raiseEvent(e,a),a})}WA.prototype.update=function(e){return!0};function ckt(e,t,n,i,r){let o;l(i)&&(o=RA(i)),l(o)&&e._name!==o&&(e._name=o,e._changed.raiseEvent(e));let s=JMe[t.type];if(!l(s))throw new oe(`Unsupported GeoJSON object type: ${t.type}`);let a=t.crs,c=a!==null?f9:null;if(l(a)){if(!l(a.properties))throw new oe("crs.properties is undefined.");let u=a.properties;if(a.type==="name"){if(c=voe[u.name],!l(c))throw new oe(`Unknown crs name: ${u.name}`)}else if(a.type==="link"){let f=XMe[u.href];if(l(f)||(f=KMe[u.type]),!l(f))throw new oe(`Unable to resolve crs link: ${JSON.stringify(u)}`);c=f(u)}else if(a.type==="EPSG"){if(c=voe[`EPSG:${u.code}`],!l(c))throw new oe(`Unknown crs EPSG code: ${u.code}`)}else throw new oe(`Unknown crs type: ${a.type}`)}return Promise.resolve(c).then(function(u){return r&&e._entityCollection.removeAll(),u!==null&&s(e,t,t,u,n),Promise.all(e._promises).then(function(){return e._promises.length=0,Ps.setLoading(e,!1),e})})}var JT=WA;var Noe=function(e,t){return Noe=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,i){n.__proto__=i}||function(n,i){for(var r in i)Object.prototype.hasOwnProperty.call(i,r)&&(n[r]=i[r])},Noe(e,t)};function d0(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");Noe(e,t);function n(){this.constructor=e}e.prototype=t===null?Object.create(t):(n.prototype=t.prototype,new n)}var Zs=function(){return Zs=Object.assign||function(t){for(var n,i=1,r=arguments.length;i<r;i++){n=arguments[i];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(t[o]=n[o])}return t},Zs.apply(this,arguments)};function dNe(e,t){var n=typeof Symbol=="function"&&e[Symbol.iterator];if(!n)return e;var i=n.call(e),r,o=[],s;try{for(;(t===void 0||t-- >0)&&!(r=i.next()).done;)o.push(r.value)}catch(a){s={error:a}}finally{try{r&&!r.done&&(n=i.return)&&n.call(i)}finally{if(s)throw s.error}}return o}function hNe(e,t,n){if(n||arguments.length===2)for(var i=0,r=t.length,o;i<r;i++)(o||!(i in t))&&(o||(o=Array.prototype.slice.call(t,0,i)),o[i]=t[i]);return e.concat(o||Array.prototype.slice.call(t))}var mNe="4.1.5";var pNe=Object.prototype.hasOwnProperty;function Uf(e){return typeof e=="boolean"}function gNe(e,t,n){var i;return e.length>t&&(n==null?(n="…",i=3):i=n.length,e=e.substring(0,t-i)+n),e}function qA(e,t){for(var n=e.length-1;n>=0;n--)t(e[n])===!0&&e.splice(n,1)}function xm(e){throw new Error("Unhandled case for value: '".concat(e,"'"))}var h9=/\s+/,m9=(function(){function e(t){t===void 0&&(t={}),this.tagName="",this.attrs={},this.innerHTML="",this.tagName=t.tagName||"",this.attrs=t.attrs||{},this.innerHTML=t.innerHtml||t.innerHTML||""}return e.prototype.setTagName=function(t){return this.tagName=t,this},e.prototype.getTagName=function(){return this.tagName},e.prototype.setAttr=function(t,n){var i=this.getAttrs();return i[t]=n,this},e.prototype.getAttr=function(t){return this.getAttrs()[t]},e.prototype.setAttrs=function(t){return Object.assign(this.getAttrs(),t),this},e.prototype.getAttrs=function(){return this.attrs},e.prototype.setClass=function(t){return this.setAttr("class",t)},e.prototype.addClass=function(t){for(var n=this.getClass(),i=n?n.split(h9):[],r=t.split(h9),o;o=r.shift();)i.indexOf(o)===-1&&i.push(o);return this.getAttrs().class=i.join(" "),this},e.prototype.removeClass=function(t){for(var n=this.getClass(),i=n?n.split(h9):[],r=t.split(h9),o;i.length&&(o=r.shift());){var s=i.indexOf(o);s!==-1&&i.splice(s,1)}return this.getAttrs().class=i.join(" "),this},e.prototype.getClass=function(){return this.getAttrs().class||""},e.prototype.hasClass=function(t){return(" "+this.getClass()+" ").indexOf(" "+t+" ")!==-1},e.prototype.setInnerHTML=function(t){return this.innerHTML=t,this},e.prototype.setInnerHtml=function(t){return this.setInnerHTML(t)},e.prototype.getInnerHTML=function(){return this.innerHTML||""},e.prototype.getInnerHtml=function(){return this.getInnerHTML()},e.prototype.toAnchorString=function(){var t=this.getTagName(),n=this.buildAttrsStr();return n=n?" "+n:"",["<",t,n,">",this.getInnerHtml(),"</",t,">"].join("")},e.prototype.buildAttrsStr=function(){var t=this.getAttrs(),n=[];for(var i in t)pNe.call(t,i)&&n.push(i+'="'+t[i]+'"');return n.join(" ")},e})();function yNe(e,t,n){var i,r;if(n==null?(n="…",r=3,i=8):(r=n.length,i=n.length),e.length<=t)return e;var o=t-r,s=lkt(e);if(s.query){var a=s.query.match(/^(.*?)(?=(\?|#))(.*?)$/i);a&&(s.query=s.query.substr(0,a[1].length),e=_Ne(s))}if(e.length<=t||(s.host&&(s.host=s.host.replace(/^www\./,""),e=_Ne(s)),e.length<=t))return e;var c="";if(s.host&&(c+=s.host),c.length>=o)return s.host.length===t?(s.host.substr(0,t-r)+n).substr(0,o+i):Loe(c,o,n).substr(0,o+i);var u="";if(s.path&&(u+="/"+s.path),s.query&&(u+="?"+s.query),u)if((c+u).length>=o){if((c+u).length==t)return(c+u).substr(0,t);var f=o-c.length;return(c+Loe(u,f,n)).substr(0,o+i)}else c+=u;if(s.fragment){var d="#"+s.fragment;if((c+d).length>=o){if((c+d).length==t)return(c+d).substr(0,t);var p=o-c.length;return(c+Loe(d,p,n)).substr(0,o+i)}else c+=d}if(s.scheme&&s.host){var g=s.scheme+"://";if((c+g).length<o)return(g+c).substr(0,t)}if(c.length<=t)return c;var m="";return o>0&&(m=c.substr(-1*Math.floor(o/2))),(c.substr(0,Math.ceil(o/2))+n+m).substr(0,o+i)}function lkt(e){var t={},n=e,i=n.match(/^([a-z]+):\/\//i);return i&&(t.scheme=i[1],n=n.slice(i[0].length)),i=n.match(/^(.*?)(?=(\?|#|\/|$))/i),i&&(t.host=i[1],n=n.slice(i[0].length)),i=n.match(/^\/(.*?)(?=(\?|#|$))/i),i&&(t.path=i[1],n=n.slice(i[0].length)),i=n.match(/^\?(.*?)(?=(#|$))/i),i&&(t.query=i[1],n=n.slice(i[0].length)),i=n.match(/^#(.*?)$/i),i&&(t.fragment=i[1]),t}function _Ne(e){var t="";return e.scheme&&e.host&&(t+=e.scheme+"://"),e.host&&(t+=e.host),e.path&&(t+="/"+e.path),e.query&&(t+="?"+e.query),e.fragment&&(t+="#"+e.fragment),t}function Loe(e,t,n){var i=t/2,r=Math.ceil(i),o=-1*Math.floor(i),s="";return o<0&&(s=e.substr(o)),e.substr(0,r)+n+s}function ANe(e,t,n){if(e.length<=t)return e;var i,r;n==null?(n="…",i=8,r=3):(i=n.length,r=n.length);var o=t-r,s="";return o>0&&(s=e.substr(-1*Math.floor(o/2))),(e.substr(0,Math.ceil(o/2))+n+s).substr(0,o+i)}function bNe(e,t,n){return gNe(e,t,n)}var xNe=(function(){function e(t){t===void 0&&(t={}),this.newWindow=!1,this.truncate={},this.className="",this.newWindow=t.newWindow||!1,this.truncate=t.truncate||{},this.className=t.className||""}return e.prototype.build=function(t){return new m9({tagName:"a",attrs:this.createAttrs(t),innerHtml:this.processAnchorText(t.getAnchorText())})},e.prototype.createAttrs=function(t){var n={href:t.getAnchorHref()},i=this.createCssClass(t);return i&&(n.class=i),this.newWindow&&(n.target="_blank",n.rel="noopener noreferrer"),this.truncate.length&&this.truncate.length<t.getAnchorText().length&&(n.title=t.getAnchorHref()),n},e.prototype.createCssClass=function(t){var n=this.className;if(n){for(var i=[n],r=t.getCssClassSuffixes(),o=0,s=r.length;o<s;o++)i.push(n+"-"+r[o]);return i.join(" ")}else return""},e.prototype.processAnchorText=function(t){return t=this.doTruncate(t),t},e.prototype.doTruncate=function(t){var n=this.truncate;if(!n.length)return t;var i=n.length,r=n.location;return r==="smart"?yNe(t,i):r==="middle"?ANe(t,i):bNe(t,i)},e})();var h0=(function(){function e(t){this._=null,this.matchedText="",this.offset=0,this.tagBuilder=t.tagBuilder,this.matchedText=t.matchedText,this.offset=t.offset}return e.prototype.getMatchedText=function(){return this.matchedText},e.prototype.setOffset=function(t){this.offset=t},e.prototype.getOffset=function(){return this.offset},e.prototype.getCssClassSuffixes=function(){return[this.type]},e.prototype.buildTag=function(){return this.tagBuilder.build(this)},e})();function TNe(e){return e>=0&&e<=31||e==127}function u_(e){return e>=65&&e<=90||e>=97&&e<=122}function Qs(e){return e>=48&&e<=57}function p9(e){return e==34||e==39}function YA(e){return e<8232?e<160?e>=9&&e<=13||e==32:e<5760?e==160:e==5760||e>=8192&&e<=8202:e<8287?e>=8232&&e<=8233||e==8239:e<12288?e==8287:e==12288||e==65279}function Tm(e){return e<4800?e<2949?e<2451?e<1425?e<768?e<192?e<169?e<65?e>=48&&e<=57:e>=65&&e<=90||e>=97&&e<=122:e<181?e>=169&&e<=170||e==174:e==181||e==186:e<710?e<216?e>=192&&e<=214:e>=216&&e<=246||e>=248&&e<=705:e<748?e>=710&&e<=721||e>=736&&e<=740:e==748||e==750:e<910?e<895?e<886?e>=768&&e<=884:e>=886&&e<=887||e>=890&&e<=893:e<904?e==895||e==902:e>=904&&e<=906||e==908:e<1155?e<931?e>=910&&e<=929:e>=931&&e<=1013||e>=1015&&e<=1153:e<1369?e>=1155&&e<=1327||e>=1329&&e<=1366:e==1369||e>=1377&&e<=1415:e<1808?e<1552?e<1476?e<1471?e>=1425&&e<=1469:e==1471||e>=1473&&e<=1474:e<1488?e>=1476&&e<=1477||e==1479:e>=1488&&e<=1514||e>=1520&&e<=1522:e<1749?e<1568?e>=1552&&e<=1562:e>=1568&&e<=1641||e>=1646&&e<=1747:e<1770?e>=1749&&e<=1756||e>=1759&&e<=1768:e>=1770&&e<=1788||e==1791:e<2230?e<2042?e<1869?e>=1808&&e<=1866:e>=1869&&e<=1969||e>=1984&&e<=2037:e<2112?e==2042||e>=2048&&e<=2093:e>=2112&&e<=2139||e>=2208&&e<=2228:e<2406?e<2260?e>=2230&&e<=2237:e>=2260&&e<=2273||e>=2275&&e<=2403:e<2437?e>=2406&&e<=2415||e>=2417&&e<=2435:e>=2437&&e<=2444||e>=2447&&e<=2448:e<2693?e<2579?e<2519?e<2486?e<2474?e>=2451&&e<=2472:e>=2474&&e<=2480||e==2482:e<2503?e>=2486&&e<=2489||e>=2492&&e<=2500:e>=2503&&e<=2504||e>=2507&&e<=2510:e<2534?e<2524?e==2519:e>=2524&&e<=2525||e>=2527&&e<=2531:e<2565?e>=2534&&e<=2545||e>=2561&&e<=2563:e>=2565&&e<=2570||e>=2575&&e<=2576:e<2631?e<2613?e<2602?e>=2579&&e<=2600:e>=2602&&e<=2608||e>=2610&&e<=2611:e<2620?e>=2613&&e<=2614||e>=2616&&e<=2617:e==2620||e>=2622&&e<=2626:e<2649?e<2635?e>=2631&&e<=2632:e>=2635&&e<=2637||e==2641:e<2662?e>=2649&&e<=2652||e==2654:e>=2662&&e<=2677||e>=2689&&e<=2691:e<2821?e<2759?e<2730?e<2703?e>=2693&&e<=2701:e>=2703&&e<=2705||e>=2707&&e<=2728:e<2741?e>=2730&&e<=2736||e>=2738&&e<=2739:e>=2741&&e<=2745||e>=2748&&e<=2757:e<2784?e<2763?e>=2759&&e<=2761:e>=2763&&e<=2765||e==2768:e<2809?e>=2784&&e<=2787||e>=2790&&e<=2799:e==2809||e>=2817&&e<=2819:e<2887?e<2858?e<2831?e>=2821&&e<=2828:e>=2831&&e<=2832||e>=2835&&e<=2856:e<2869?e>=2858&&e<=2864||e>=2866&&e<=2867:e>=2869&&e<=2873||e>=2876&&e<=2884:e<2911?e<2902?e>=2887&&e<=2888||e>=2891&&e<=2893:e>=2902&&e<=2903||e>=2908&&e<=2909:e<2929?e>=2911&&e<=2915||e>=2918&&e<=2927:e==2929||e>=2946&&e<=2947:e<3517?e<3205?e<3046?e<2984?e<2969?e<2958?e>=2949&&e<=2954:e>=2958&&e<=2960||e>=2962&&e<=2965:e<2974?e>=2969&&e<=2970||e==2972:e>=2974&&e<=2975||e>=2979&&e<=2980:e<3014?e<2990?e>=2984&&e<=2986:e>=2990&&e<=3001||e>=3006&&e<=3010:e<3024?e>=3014&&e<=3016||e>=3018&&e<=3021:e==3024||e==3031:e<3142?e<3086?e<3072?e>=3046&&e<=3055:e>=3072&&e<=3075||e>=3077&&e<=3084:e<3114?e>=3086&&e<=3088||e>=3090&&e<=3112:e>=3114&&e<=3129||e>=3133&&e<=3140:e<3160?e<3146?e>=3142&&e<=3144:e>=3146&&e<=3149||e>=3157&&e<=3158:e<3174?e>=3160&&e<=3162||e>=3168&&e<=3171:e>=3174&&e<=3183||e>=3200&&e<=3203:e<3333?e<3274?e<3242?e<3214?e>=3205&&e<=3212:e>=3214&&e<=3216||e>=3218&&e<=3240:e<3260?e>=3242&&e<=3251||e>=3253&&e<=3257:e>=3260&&e<=3268||e>=3270&&e<=3272:e<3296?e<3285?e>=3274&&e<=3277:e>=3285&&e<=3286||e==3294:e<3313?e>=3296&&e<=3299||e>=3302&&e<=3311:e>=3313&&e<=3314||e>=3329&&e<=3331:e<3423?e<3389?e<3342?e>=3333&&e<=3340:e>=3342&&e<=3344||e>=3346&&e<=3386:e<3402?e>=3389&&e<=3396||e>=3398&&e<=3400:e>=3402&&e<=3406||e>=3412&&e<=3415:e<3458?e<3430?e>=3423&&e<=3427:e>=3430&&e<=3439||e>=3450&&e<=3455:e<3482?e>=3458&&e<=3459||e>=3461&&e<=3478:e>=3482&&e<=3505||e>=3507&&e<=3515:e<3804?e<3722?e<3570?e<3535?e<3520?e==3517:e>=3520&&e<=3526||e==3530:e<3544?e>=3535&&e<=3540||e==3542:e>=3544&&e<=3551||e>=3558&&e<=3567:e<3664?e<3585?e>=3570&&e<=3571:e>=3585&&e<=3642||e>=3648&&e<=3662:e<3716?e>=3664&&e<=3673||e>=3713&&e<=3714:e==3716||e>=3719&&e<=3720:e<3754?e<3737?e<3725?e==3722:e==3725||e>=3732&&e<=3735:e<3749?e>=3737&&e<=3743||e>=3745&&e<=3747:e==3749||e==3751:e<3776?e<3757?e>=3754&&e<=3755:e>=3757&&e<=3769||e>=3771&&e<=3773:e<3784?e>=3776&&e<=3780||e==3782:e>=3784&&e<=3789||e>=3792&&e<=3801:e<4176?e<3902?e<3872?e<3840?e>=3804&&e<=3807:e==3840||e>=3864&&e<=3865:e<3895?e>=3872&&e<=3881||e==3893:e==3895||e==3897:e<3974?e<3913?e>=3902&&e<=3911:e>=3913&&e<=3948||e>=3953&&e<=3972:e<4038?e>=3974&&e<=3991||e>=3993&&e<=4028:e==4038||e>=4096&&e<=4169:e<4688?e<4301?e<4256?e>=4176&&e<=4253:e>=4256&&e<=4293||e==4295:e<4348?e==4301||e>=4304&&e<=4346:e>=4348&&e<=4680||e>=4682&&e<=4685:e<4746?e<4698?e>=4688&&e<=4694||e==4696:e>=4698&&e<=4701||e>=4704&&e<=4744:e<4786?e>=4746&&e<=4749||e>=4752&&e<=4784:e>=4786&&e<=4789||e>=4792&&e<=4798:e<11035?e<7416?e<6176?e<5873?e<4992?e<4824?e<4802?e==4800:e>=4802&&e<=4805||e>=4808&&e<=4822:e<4888?e>=4824&&e<=4880||e>=4882&&e<=4885:e>=4888&&e<=4954||e>=4957&&e<=4959:e<5121?e<5024?e>=4992&&e<=5007:e>=5024&&e<=5109||e>=5112&&e<=5117:e<5761?e>=5121&&e<=5740||e>=5743&&e<=5759:e>=5761&&e<=5786||e>=5792&&e<=5866:e<6002?e<5920?e<5888?e>=5873&&e<=5880:e>=5888&&e<=5900||e>=5902&&e<=5908:e<5984?e>=5920&&e<=5940||e>=5952&&e<=5971:e>=5984&&e<=5996||e>=5998&&e<=6e3:e<6108?e<6016?e>=6002&&e<=6003:e>=6016&&e<=6099||e==6103:e<6155?e>=6108&&e<=6109||e>=6112&&e<=6121:e>=6155&&e<=6157||e>=6160&&e<=6169:e<6783?e<6512?e<6400?e<6272?e>=6176&&e<=6263:e>=6272&&e<=6314||e>=6320&&e<=6389:e<6448?e>=6400&&e<=6430||e>=6432&&e<=6443:e>=6448&&e<=6459||e>=6470&&e<=6509:e<6608?e<6528?e>=6512&&e<=6516:e>=6528&&e<=6571||e>=6576&&e<=6601:e<6688?e>=6608&&e<=6617||e>=6656&&e<=6683:e>=6688&&e<=6750||e>=6752&&e<=6780:e<7040?e<6832?e<6800?e>=6783&&e<=6793:e>=6800&&e<=6809||e==6823:e<6992?e>=6832&&e<=6846||e>=6912&&e<=6987:e>=6992&&e<=7001||e>=7019&&e<=7027:e<7245?e<7168?e>=7040&&e<=7155:e>=7168&&e<=7223||e>=7232&&e<=7241:e<7376?e>=7245&&e<=7293||e>=7296&&e<=7304:e>=7376&&e<=7378||e>=7380&&e<=7414:e<8450?e<8130?e<8025?e<7960?e<7424?e>=7416&&e<=7417:e>=7424&&e<=7669||e>=7675&&e<=7957:e<8008?e>=7960&&e<=7965||e>=7968&&e<=8005:e>=8008&&e<=8013||e>=8016&&e<=8023:e<8031?e<8027?e==8025:e==8027||e==8029:e<8118?e>=8031&&e<=8061||e>=8064&&e<=8116:e>=8118&&e<=8124||e==8126:e<8205?e<8150?e<8134?e>=8130&&e<=8132:e>=8134&&e<=8140||e>=8144&&e<=8147:e<8178?e>=8150&&e<=8155||e>=8160&&e<=8172:e>=8178&&e<=8180||e>=8182&&e<=8188:e<8305?e<8252?e==8205:e==8252||e==8265:e<8336?e==8305||e==8319:e>=8336&&e<=8348||e>=8400&&e<=8432:e<8579?e<8486?e<8469?e<8455?e==8450:e==8455||e>=8458&&e<=8467:e<8482?e==8469||e>=8473&&e<=8477:e==8482||e==8484:e<8495?e<8488?e==8486:e==8488||e>=8490&&e<=8493:e<8517?e>=8495&&e<=8505||e>=8508&&e<=8511:e>=8517&&e<=8521||e==8526:e<9410?e<9e3?e<8592?e>=8579&&e<=8580:e>=8592&&e<=8703||e>=8986&&e<=8987:e<9193?e==9e3||e==9167:e>=9193&&e<=9203||e>=9208&&e<=9210:e<9723?e<9654?e==9410||e>=9642&&e<=9643:e==9654||e==9664:e<10548?e>=9723&&e<=9726||e>=9728&&e<=10175:e>=10548&&e<=10549||e>=11013&&e<=11015:e<43259?e<12445?e<11688?e<11520?e<11264?e<11088?e>=11035&&e<=11036:e==11088||e==11093:e<11360?e>=11264&&e<=11310||e>=11312&&e<=11358:e>=11360&&e<=11492||e>=11499&&e<=11507:e<11568?e<11559?e>=11520&&e<=11557:e==11559||e==11565:e<11647?e>=11568&&e<=11623||e==11631:e>=11647&&e<=11670||e>=11680&&e<=11686:e<11744?e<11712?e<11696?e>=11688&&e<=11694:e>=11696&&e<=11702||e>=11704&&e<=11710:e<11728?e>=11712&&e<=11718||e>=11720&&e<=11726:e>=11728&&e<=11734||e>=11736&&e<=11742:e<12330?e<11823?e>=11744&&e<=11775:e==11823||e>=12293&&e<=12294:e<12353?e>=12330&&e<=12341||e>=12347&&e<=12349:e>=12353&&e<=12438||e>=12441&&e<=12442:e<42512?e<12951?e<12549?e<12449?e>=12445&&e<=12447:e>=12449&&e<=12538||e>=12540&&e<=12543:e<12704?e>=12549&&e<=12589||e>=12593&&e<=12686:e>=12704&&e<=12730||e>=12784&&e<=12799:e<19968?e<12953?e==12951:e==12953||e>=13312&&e<=19893:e<42192?e>=19968&&e<=40917||e>=40960&&e<=42124:e>=42192&&e<=42237||e>=42240&&e<=42508:e<42891?e<42623?e<42560?e>=42512&&e<=42539:e>=42560&&e<=42610||e>=42612&&e<=42621:e<42775?e>=42623&&e<=42725||e>=42736&&e<=42737:e>=42775&&e<=42783||e>=42786&&e<=42888:e<43072?e<42928?e>=42891&&e<=42926:e>=42928&&e<=42935||e>=42999&&e<=43047:e<43216?e>=43072&&e<=43123||e>=43136&&e<=43205:e>=43216&&e<=43225||e>=43232&&e<=43255:e<55243?e<43744?e<43488?e<43312?e<43261?e==43259:e==43261||e>=43264&&e<=43309:e<43392?e>=43312&&e<=43347||e>=43360&&e<=43388:e>=43392&&e<=43456||e>=43471&&e<=43481:e<43600?e<43520?e>=43488&&e<=43518:e>=43520&&e<=43574||e>=43584&&e<=43597:e<43642?e>=43600&&e<=43609||e>=43616&&e<=43638:e>=43642&&e<=43714||e>=43739&&e<=43741:e<43824?e<43785?e<43762?e>=43744&&e<=43759:e>=43762&&e<=43766||e>=43777&&e<=43782:e<43808?e>=43785&&e<=43790||e>=43793&&e<=43798:e>=43808&&e<=43814||e>=43816&&e<=43822:e<44012?e<43868?e>=43824&&e<=43866:e>=43868&&e<=43877||e>=43888&&e<=44010:e<44032?e>=44012&&e<=44013||e>=44016&&e<=44025:e>=44032&&e<=55203||e>=55216&&e<=55238:e<64848?e<64298?e<64112?e<55296?e>=55243&&e<=55291:e>=55296&&e<=57343||e>=63744&&e<=64109:e<64275?e>=64112&&e<=64217||e>=64256&&e<=64262:e>=64275&&e<=64279||e>=64285&&e<=64296:e<64320?e<64312?e>=64298&&e<=64310:e>=64312&&e<=64316||e==64318:e<64326?e>=64320&&e<=64321||e>=64323&&e<=64324:e>=64326&&e<=64433||e>=64467&&e<=64829:e<65296?e<65024?e<64914?e>=64848&&e<=64911:e>=64914&&e<=64967||e>=65008&&e<=65019:e<65136?e>=65024&&e<=65039||e>=65056&&e<=65071:e>=65136&&e<=65140||e>=65142&&e<=65276:e<65474?e<65345?e>=65296&&e<=65305||e>=65313&&e<=65338:e>=65345&&e<=65370||e>=65382&&e<=65470:e<65490?e>=65474&&e<=65479||e>=65482&&e<=65487:e>=65490&&e<=65495||e>=65498&&e<=65500}function ENe(e){return e<47?e<42?e==33||e>=35&&e<=39:e>=42&&e<=43||e==45:e<63?e==47||e==61:e<94?e==63:e>=94&&e<=96||e>=123&&e<=126}function CNe(e){return e<91?e<47?e>=35&&e<=43||e==45:e<61?e==47:e==61||e==64:e<95?e==91||e==93:e<123?e==95:e>=123&&e<=126||e==10003}function g9(e){return e<58?e<44?e==33:e==44||e==46:e<63?e>=58&&e<=59:e==63||e==94}function vNe(e){return e<91?e==40:e==91||e==123}function Foe(e){return e<93?e==41:e==93||e==125}var SNe=/^(?:xn--vermgensberatung-pwb|xn--vermgensberater-ctb|xn--clchc0ea0b2g2a9gcd|xn--w4r85el8fhu5dnra|travelersinsurance|vermögensberatung|xn--5su34j936bgsg|xn--bck1b9a5dre4c|xn--mgbah1a3hjkrd|xn--mgbai9azgqp6j|xn--mgberp4a5d4ar|xn--xkc2dl3a5ee0h|vermögensberater|xn--fzys8d69uvgm|xn--mgba7c0bbn0a|xn--mgbcpq6gpa1a|xn--xkc2al3hye2a|americanexpress|kerryproperties|sandvikcoromant|xn--i1b6b1a6a2e|xn--kcrx77d1x4a|xn--lgbbat1ad8j|xn--mgba3a4f16a|xn--mgbc0a9azcg|xn--nqv7fs00ema|americanfamily|weatherchannel|xn--54b7fta0cc|xn--6qq986b3xl|xn--80aqecdr1a|xn--b4w605ferd|xn--fiq228c5hs|xn--h2breg3eve|xn--jlq480n2rg|xn--mgba3a3ejt|xn--mgbaam7a8h|xn--mgbayh7gpa|xn--mgbbh1a71e|xn--mgbca7dzdo|xn--mgbi4ecexp|xn--mgbx4cd0ab|xn--rvc1e0am3e|international|lifeinsurance|wolterskluwer|xn--cckwcxetd|xn--eckvdtc9d|xn--fpcrj9c3d|xn--fzc2c9e2c|xn--h2brj9c8c|xn--tiq49xqyj|xn--yfro4i67o|xn--ygbi2ammx|construction|lplfinancial|scholarships|versicherung|xn--3e0b707e|xn--45br5cyl|xn--4dbrk0ce|xn--80adxhks|xn--80asehdb|xn--8y0a063a|xn--gckr3f0f|xn--mgb9awbf|xn--mgbab2bd|xn--mgbgu82a|xn--mgbpl2fh|xn--mgbt3dhd|xn--mk1bu44c|xn--ngbc5azd|xn--ngbe9e0a|xn--ogbpf8fl|xn--qcka1pmc|accountants|barclaycard|blackfriday|blockbuster|bridgestone|calvinklein|contractors|creditunion|engineering|enterprises|investments|kerryhotels|lamborghini|motorcycles|olayangroup|photography|playstation|productions|progressive|redumbrella|williamhill|xn--11b4c3d|xn--1ck2e1b|xn--1qqw23a|xn--2scrj9c|xn--3bst00m|xn--3ds443g|xn--3hcrj9c|xn--42c2d9a|xn--45brj9c|xn--55qw42g|xn--6frz82g|xn--80ao21a|xn--9krt00a|xn--cck2b3b|xn--czr694b|xn--d1acj3b|xn--efvy88h|xn--fct429k|xn--fjq720a|xn--flw351e|xn--g2xx48c|xn--gecrj9c|xn--gk3at1e|xn--h2brj9c|xn--hxt814e|xn--imr513n|xn--j6w193g|xn--jvr189m|xn--kprw13d|xn--kpry57d|xn--mgbbh1a|xn--mgbtx2b|xn--mix891f|xn--nyqy26a|xn--otu796d|xn--pgbs0dh|xn--q9jyb4c|xn--rhqv96g|xn--rovu88b|xn--s9brj9c|xn--ses554g|xn--t60b56a|xn--vuq861b|xn--w4rs40l|xn--xhq521b|xn--zfr164b|சிங்கப்பூர்|accountant|apartments|associates|basketball|bnpparibas|boehringer|capitalone|consulting|creditcard|cuisinella|eurovision|extraspace|foundation|healthcare|immobilien|industries|management|mitsubishi|nextdirect|properties|protection|prudential|realestate|republican|restaurant|schaeffler|tatamotors|technology|university|vlaanderen|xn--30rr7y|xn--3pxu8k|xn--45q11c|xn--4gbrim|xn--55qx5d|xn--5tzm5g|xn--80aswg|xn--90a3ac|xn--9dbq2a|xn--9et52u|xn--c2br7g|xn--cg4bki|xn--czrs0t|xn--czru2d|xn--fiq64b|xn--fiqs8s|xn--fiqz9s|xn--io0a7i|xn--kput3i|xn--mxtq1m|xn--o3cw4h|xn--pssy2u|xn--q7ce6a|xn--unup4y|xn--wgbh1c|xn--wgbl6a|xn--y9a3aq|accenture|allfinanz|amsterdam|analytics|aquarelle|barcelona|bloomberg|christmas|community|directory|education|equipment|fairwinds|financial|firestone|fresenius|furniture|goldpoint|hisamitsu|homedepot|homegoods|homesense|institute|insurance|kuokgroup|landrover|lifestyle|marketing|marshalls|melbourne|microsoft|panasonic|pramerica|richardli|shangrila|solutions|statebank|statefarm|stockholm|travelers|vacations|xn--90ais|xn--c1avg|xn--d1alf|xn--e1a4c|xn--fhbei|xn--j1aef|xn--j1amh|xn--l1acc|xn--ngbrx|xn--nqv7f|xn--p1acf|xn--qxa6a|xn--tckwe|xn--vhquv|yodobashi|موريتانيا|abudhabi|airforce|allstate|attorney|barclays|barefoot|bargains|baseball|boutique|bradesco|broadway|brussels|builders|business|capetown|catering|catholic|cipriani|cleaning|clinique|clothing|commbank|computer|delivery|deloitte|democrat|diamonds|discount|discover|download|engineer|ericsson|exchange|feedback|fidelity|firmdale|football|frontier|goodyear|grainger|graphics|hdfcbank|helsinki|holdings|hospital|infiniti|ipiranga|istanbul|jpmorgan|lighting|lundbeck|marriott|mckinsey|memorial|merckmsd|mortgage|observer|partners|pharmacy|pictures|plumbing|property|redstone|reliance|saarland|samsclub|security|services|shopping|softbank|software|stcgroup|supplies|training|vanguard|ventures|verisign|woodside|xn--90ae|xn--node|xn--p1ai|xn--qxam|yokohama|السعودية|abogado|academy|agakhan|alibaba|android|athleta|auction|audible|auspost|banamex|bauhaus|bestbuy|booking|brother|capital|caravan|careers|channel|charity|chintai|citadel|clubmed|college|cologne|company|compare|contact|cooking|corsica|country|coupons|courses|cricket|cruises|dentist|digital|domains|exposed|express|farmers|fashion|ferrari|ferrero|finance|fishing|fitness|flights|florist|flowers|forsale|frogans|fujitsu|gallery|genting|godaddy|grocery|guitars|hamburg|hangout|hitachi|holiday|hosting|hotmail|hyundai|ismaili|jewelry|juniper|kitchen|komatsu|lacaixa|lanxess|lasalle|latrobe|leclerc|limited|lincoln|markets|monster|netbank|netflix|network|neustar|okinawa|organic|origins|philips|pioneer|politie|realtor|recipes|rentals|reviews|rexroth|samsung|sandvik|schmidt|schwarz|science|shiksha|singles|staples|storage|support|surgery|systems|temasek|theater|theatre|tickets|toshiba|trading|walmart|wanggou|watches|weather|website|wedding|whoswho|windows|winners|yamaxun|youtube|zuerich|католик|البحرين|الجزائر|العليان|پاکستان|كاثوليك|இந்தியா|abbott|abbvie|africa|agency|airbus|airtel|alipay|alsace|alstom|amazon|anquan|aramco|author|bayern|beauty|berlin|bharti|bostik|boston|broker|camera|career|casino|center|chanel|chrome|church|circle|claims|clinic|coffee|comsec|condos|coupon|credit|cruise|dating|datsun|dealer|degree|dental|design|direct|doctor|dunlop|dupont|durban|emerck|energy|estate|events|expert|family|flickr|futbol|gallup|garden|george|giving|global|google|gratis|health|hermes|hiphop|hockey|hotels|hughes|imamat|insure|intuit|jaguar|joburg|juegos|kaufen|kindle|kosher|latino|lawyer|lefrak|living|locker|london|luxury|madrid|maison|makeup|market|mattel|mobile|monash|mormon|moscow|museum|nagoya|nissan|nissay|norton|nowruz|office|olayan|online|oracle|orange|otsuka|pfizer|photos|physio|pictet|quebec|racing|realty|reisen|repair|report|review|rogers|ryukyu|safety|sakura|sanofi|school|schule|search|secure|select|shouji|soccer|social|stream|studio|supply|suzuki|swatch|sydney|taipei|taobao|target|tattoo|tennis|tienda|tjmaxx|tkmaxx|toyota|travel|unicom|viajes|viking|villas|virgin|vision|voting|voyage|walter|webcam|xihuan|yachts|yandex|zappos|москва|онлайн|ابوظبي|ارامكو|الاردن|المغرب|امارات|فلسطين|مليسيا|भारतम्|இலங்கை|ファッション|actor|adult|aetna|amfam|amica|apple|archi|audio|autos|azure|baidu|beats|bible|bingo|black|boats|bosch|build|canon|cards|chase|cheap|cisco|citic|click|cloud|coach|codes|crown|cymru|dance|deals|delta|drive|dubai|earth|edeka|email|epson|faith|fedex|final|forex|forum|gallo|games|gifts|gives|glass|globo|gmail|green|gripe|group|gucci|guide|homes|honda|horse|house|hyatt|ikano|irish|jetzt|koeln|kyoto|lamer|lease|legal|lexus|lilly|loans|locus|lotte|lotto|mango|media|miami|money|movie|music|nexus|nikon|ninja|nokia|nowtv|omega|osaka|paris|parts|party|phone|photo|pizza|place|poker|praxi|press|prime|promo|quest|radio|rehab|reise|ricoh|rocks|rodeo|rugby|salon|sener|seven|sharp|shell|shoes|skype|sling|smart|smile|solar|space|sport|stada|store|study|style|sucks|swiss|tatar|tires|tirol|tmall|today|tokyo|tools|toray|total|tours|trade|trust|tunes|tushu|ubank|vegas|video|vodka|volvo|wales|watch|weber|weibo|works|world|xerox|yahoo|ישראל|ایران|بازار|بھارت|سودان|سورية|همراه|भारोत|संगठन|বাংলা|భారత్|ഭാരതം|嘉里大酒店|aarp|able|aero|akdn|ally|amex|arab|army|arpa|arte|asda|asia|audi|auto|baby|band|bank|bbva|beer|best|bike|bing|blog|blue|bofa|bond|book|buzz|cafe|call|camp|care|cars|casa|case|cash|cbre|cern|chat|citi|city|club|cool|coop|cyou|data|date|dclk|deal|dell|desi|diet|dish|docs|dvag|erni|fage|fail|fans|farm|fast|fido|film|fire|fish|flir|food|ford|free|fund|game|gbiz|gent|ggee|gift|gmbh|gold|golf|goog|guge|guru|hair|haus|hdfc|help|here|host|hsbc|icbc|ieee|imdb|immo|info|itau|java|jeep|jobs|jprs|kddi|kids|kiwi|kpmg|kred|land|lego|lgbt|lidl|life|like|limo|link|live|loan|love|ltda|luxe|maif|meet|meme|menu|mini|mint|mobi|moda|moto|name|navy|news|next|nico|nike|ollo|open|page|pars|pccw|pics|ping|pink|play|plus|pohl|porn|post|prod|prof|qpon|read|reit|rent|rest|rich|room|rsvp|ruhr|safe|sale|sarl|save|saxo|scot|seat|seek|sexy|shia|shop|show|silk|sina|site|skin|sncf|sohu|song|sony|spot|star|surf|talk|taxi|team|tech|teva|tiaa|tips|town|toys|tube|vana|visa|viva|vivo|vote|voto|wang|weir|wien|wiki|wine|work|xbox|yoga|zara|zero|zone|дети|сайт|بارت|بيتك|ڀارت|تونس|شبكة|عراق|عمان|موقع|भारत|ভারত|ভাৰত|ਭਾਰਤ|ભારત|ଭାରତ|ಭಾರತ|ලංකා|アマゾン|グーグル|クラウド|ポイント|组织机构|電訊盈科|香格里拉|aaa|abb|abc|aco|ads|aeg|afl|aig|anz|aol|app|art|aws|axa|bar|bbc|bbt|bcg|bcn|bet|bid|bio|biz|bms|bmw|bom|boo|bot|box|buy|bzh|cab|cal|cam|car|cat|cba|cbn|ceo|cfa|cfd|com|cpa|crs|dad|day|dds|dev|dhl|diy|dnp|dog|dot|dtv|dvr|eat|eco|edu|esq|eus|fan|fit|fly|foo|fox|frl|ftr|fun|fyi|gal|gap|gay|gdn|gea|gle|gmo|gmx|goo|gop|got|gov|hbo|hiv|hkt|hot|how|ibm|ice|icu|ifm|inc|ing|ink|int|ist|itv|jcb|jio|jll|jmp|jnj|jot|joy|kfh|kia|kim|kpn|krd|lat|law|lds|llc|llp|lol|lpl|ltd|man|map|mba|med|men|mil|mit|mlb|mls|mma|moe|moi|mom|mov|msd|mtn|mtr|nab|nba|nec|net|new|nfl|ngo|nhk|now|nra|nrw|ntt|nyc|obi|one|ong|onl|ooo|org|ott|ovh|pay|pet|phd|pid|pin|pnc|pro|pru|pub|pwc|red|ren|ril|rio|rip|run|rwe|sap|sas|sbi|sbs|scb|sew|sex|sfr|ski|sky|soy|spa|srl|stc|tab|tax|tci|tdk|tel|thd|tjx|top|trv|tui|tvs|ubs|uno|uol|ups|vet|vig|vin|vip|wed|win|wme|wow|wtc|wtf|xin|xxx|xyz|you|yun|zip|бел|ком|қаз|мкд|мон|орг|рус|срб|укр|հայ|קום|عرب|قطر|كوم|مصر|कॉम|नेट|คอม|ไทย|ລາວ|ストア|セール|みんな|中文网|亚马逊|天主教|我爱你|新加坡|淡马锡|飞利浦|ac|ad|ae|af|ag|ai|al|am|ao|aq|ar|as|at|au|aw|ax|az|ba|bb|bd|be|bf|bg|bh|bi|bj|bm|bn|bo|br|bs|bt|bv|bw|by|bz|ca|cc|cd|cf|cg|ch|ci|ck|cl|cm|cn|co|cr|cu|cv|cw|cx|cy|cz|de|dj|dk|dm|do|dz|ec|ee|eg|er|es|et|eu|fi|fj|fk|fm|fo|fr|ga|gb|gd|ge|gf|gg|gh|gi|gl|gm|gn|gp|gq|gr|gs|gt|gu|gw|gy|hk|hm|hn|hr|ht|hu|id|ie|il|im|in|io|iq|ir|is|it|je|jm|jo|jp|ke|kg|kh|ki|km|kn|kp|kr|kw|ky|kz|la|lb|lc|li|lk|lr|ls|lt|lu|lv|ly|ma|mc|md|me|mg|mh|mk|ml|mm|mn|mo|mp|mq|mr|ms|mt|mu|mv|mw|mx|my|mz|na|nc|ne|nf|ng|ni|nl|no|np|nr|nu|nz|om|pa|pe|pf|pg|ph|pk|pl|pm|pn|pr|ps|pt|pw|py|qa|re|ro|rs|ru|rw|sa|sb|sc|sd|se|sg|sh|si|sj|sk|sl|sm|sn|so|sr|ss|st|su|sv|sx|sy|sz|tc|td|tf|tg|th|tj|tk|tl|tm|tn|to|tr|tt|tv|tw|tz|ua|ug|uk|us|uy|uz|va|vc|ve|vg|vi|vn|vu|wf|ws|ye|yt|za|zm|zw|ελ|ευ|бг|ею|рф|გე|닷넷|닷컴|삼성|한국|コム|世界|中信|中国|中國|企业|佛山|信息|健康|八卦|公司|公益|台湾|台灣|商城|商店|商标|嘉里|在线|大拿|娱乐|家電|广东|微博|慈善|手机|招聘|政务|政府|新闻|时尚|書籍|机构|游戏|澳門|点看|移动|网址|网店|网站|网络|联通|谷歌|购物|通販|集团|食品|餐厅|香港)$/;var Boe=/https?:\/\//i,wNe=new RegExp("^"+Boe.source,"i"),ukt=/^(javascript|vbscript):/i,fkt=/^[A-Za-z][-.+A-Za-z0-9]*:(\/\/)?([^:/]*)/,dkt=/^(?:\/\/)?([^/#?:]+)/,sI=u_;function koe(e){return u_(e)||Qs(e)||e===43||e===45||e===46}var f_=Tm;function _9(e){return e===95||f_(e)}function Uoe(e){return Tm(e)||CNe(e)||g9(e)}function y9(e){return e===47||e===63||e===35}function zoe(e){return SNe.test(e.toLowerCase())}function INe(e){if(ukt.test(e))return!1;var t=e.match(fkt);if(!t)return!1;var n=!!t[1],i=t[2];return n?!0:!(i.indexOf(".")===-1||!/[A-Za-z]/.test(i))}function PNe(e){var t=e.match(dkt);if(!t)return!1;var n=t[0],i=n.split(".");if(i.length<2)return!1;var r=i[i.length-1];return!!zoe(r)}var hkt=/^(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$/,mkt=/[:/?#]/;function DNe(e){var t=e.split(mkt,1)[0];return hkt.test(t)}var pkt=/^(https?:\/\/)?(?:www\.)?/i,gkt=/^\/\//,RNe=(function(e){d0(t,e);function t(n){var i=e.call(this,n)||this;return i.type="url",i.url="",i.urlMatchType="scheme",i.protocolRelativeMatch=!1,i.stripPrefix={scheme:!0,www:!0},i.stripTrailingSlash=!0,i.decodePercentEncoding=!0,i.protocolPrepended=!1,i.urlMatchType=n.urlMatchType,i.url=n.url,i.protocolRelativeMatch=n.protocolRelativeMatch,i.stripPrefix=n.stripPrefix,i.stripTrailingSlash=n.stripTrailingSlash,i.decodePercentEncoding=n.decodePercentEncoding,i}return t.prototype.getType=function(){return"url"},t.prototype.getUrlMatchType=function(){return this.urlMatchType},t.prototype.getUrl=function(){var n=this.url;return!this.protocolRelativeMatch&&this.urlMatchType!=="scheme"&&!this.protocolPrepended&&(n=this.url="http://"+n,this.protocolPrepended=!0),n},t.prototype.getAnchorHref=function(){var n=this.getUrl();return n.replace(/&/g,"&")},t.prototype.getAnchorText=function(){var n=this.getMatchedText();return this.protocolRelativeMatch&&(n=Akt(n)),this.stripPrefix.scheme&&(n=_kt(n)),this.stripPrefix.www&&(n=ykt(n)),this.stripTrailingSlash&&(n=bkt(n)),this.decodePercentEncoding&&(n=xkt(n)),n},t})(h0);function _kt(e){return e.replace(wNe,"")}function ykt(e){return e.includes("www.")?e.replace(pkt,"$1"):e}function Akt(e){return e.replace(gkt,"")}function bkt(e){return e.charAt(e.length-1)==="/"&&(e=e.slice(0,-1)),e}function xkt(e){var t=e.replace(/%(?:22|26|27|3C|3E)/gi,function(n){return n==="%22"?""":n==="%26"?"&":n==="%27"?"'":n==="%3C"||n==="%3c"?"<":">"});if(t.includes("%"))try{return decodeURIComponent(t)}catch{}return t}var ONe=/^mailto:/i,Voe=Tm;function A9(e){return Voe(e)||ENe(e)}function MNe(e){var t=e.split(".").pop();return zoe(t)}var NNe=(function(e){d0(t,e);function t(n){var i=e.call(this,n)||this;return i.type="email",i.email="",i.email=n.email,i}return t.prototype.getType=function(){return"email"},t.prototype.getEmail=function(){return this.email},t.prototype.getAnchorHref=function(){return"mailto:"+this.email},t.prototype.getAnchorText=function(){return this.email},t})(h0);function joe(e){return e===95||Tm(e)}function LNe(e){return e.length<=140}var FNe=["twitter","facebook","instagram","tiktok","youtube"];var BNe=(function(e){d0(t,e);function t(n){var i=e.call(this,n)||this;return i.type="hashtag",i.serviceName="twitter",i.hashtag="",i.serviceName=n.serviceName,i.hashtag=n.hashtag,i}return t.prototype.getType=function(){return"hashtag"},t.prototype.getServiceName=function(){return this.serviceName},t.prototype.getHashtag=function(){return this.hashtag},t.prototype.getAnchorHref=function(){var n=this.serviceName,i=this.hashtag;switch(n){case"twitter":return"https://twitter.com/hashtag/"+i;case"facebook":return"https://www.facebook.com/hashtag/"+i;case"instagram":return"https://instagram.com/explore/tags/"+i;case"tiktok":return"https://www.tiktok.com/tag/"+i;case"youtube":return"https://youtube.com/hashtag/"+i;default:xm(n)}},t.prototype.getAnchorText=function(){return"#"+this.hashtag},t.prototype.getCssClassSuffixes=function(){var n=e.prototype.getCssClassSuffixes.call(this),i=this.getServiceName();return i&&n.push(i),n},t})(h0);var Tkt={twitter:/^@\w{1,15}$/,instagram:/^@[_\w]{1,30}$/,soundcloud:/^@[-a-z0-9_]{3,25}$/,tiktok:/^@[.\w]{1,23}[\w]$/,youtube:/^@[-.·\w]{3,30}$/};function Hoe(e){return e===45||e===46||e===95||u_(e)||Qs(e)}function kNe(e,t){var n=Tkt[t];return n.test(e)}var UNe=["twitter","instagram","soundcloud","tiktok","youtube"];var zNe=(function(e){d0(t,e);function t(n){var i=e.call(this,n)||this;return i.type="mention",i.serviceName="twitter",i.mention="",i.mention=n.mention,i.serviceName=n.serviceName,i}return t.prototype.getType=function(){return"mention"},t.prototype.getMention=function(){return this.mention},t.prototype.getServiceName=function(){return this.serviceName},t.prototype.getAnchorHref=function(){switch(this.serviceName){case"twitter":return"https://twitter.com/"+this.mention;case"instagram":return"https://instagram.com/"+this.mention;case"soundcloud":return"https://soundcloud.com/"+this.mention;case"tiktok":return"https://www.tiktok.com/@"+this.mention;case"youtube":return"https://youtube.com/@"+this.mention;default:xm(this.serviceName)}},t.prototype.getAnchorText=function(){return"@"+this.mention},t.prototype.getCssClassSuffixes=function(){var n=e.prototype.getCssClassSuffixes.call(this),i=this.getServiceName();return i&&n.push(i),n},t})(h0);var Ekt=/[-. ()]/,Ckt=/(?:(?:(?:(\+)?\d{1,3}[-. ]?)?\(?\d{3}\)?[-. ]?\d{3}[-. ]?\d{4})|(?:(\+)(?:9[976]\d|8[987530]\d|6[987]\d|5[90]\d|42\d|3[875]\d|2[98654321]\d|9[8543210]|8[6421]|6[6543210]|5[87654321]|4[987654310]|3[9643210]|2[70]|7|1)[-. ]?(?:\d[-. ]?){6,12}\d+))([,;]+[0-9]+#?)*/,vkt=/(0([1-9]-?[1-9]\d{3}|[1-9]{2}-?\d{3}|[1-9]{2}\d{1}-?\d{2}|[1-9]{2}\d{2}-?\d{1})-?\d{4}|0[789]0-?\d{4}-?\d{4}|050-?\d{4}-?\d{4})/,Skt=new RegExp("^".concat(Ckt.source,"|").concat(vkt.source,"$"));function Goe(e){return e===45||e===46||e===32}function b9(e){return e===44||e===59}function VNe(e){var t=e.charAt(0)==="+"||Ekt.test(e);return t&&Skt.test(e)}var jNe=(function(e){d0(t,e);function t(n){var i=e.call(this,n)||this;return i.type="phone",i.number="",i.plusSign=!1,i.number=n.number,i.plusSign=n.plusSign,i}return t.prototype.getType=function(){return"phone"},t.prototype.getPhoneNumber=function(){return this.number},t.prototype.getNumber=function(){return this.getPhoneNumber()},t.prototype.getAnchorHref=function(){return"tel:"+(this.plusSign?"+":"")+this.number},t.prototype.getAnchorText=function(){return this.matchedText},t})(h0);var wkt=(function(){function e(t,n){this.charIdx=0,this.matches=[],this._stateMachines=[],this.schemeUrlMachinesCount=0,this.text=t,this.tagBuilder=n.tagBuilder,this.stripPrefix=n.stripPrefix,this.stripTrailingSlash=n.stripTrailingSlash,this.decodePercentEncoding=n.decodePercentEncoding,this.hashtagServiceName=n.hashtagServiceName,this.mentionServiceName=n.mentionServiceName}return Object.defineProperty(e.prototype,"stateMachines",{get:function(){return this._stateMachines},enumerable:!1,configurable:!0}),e.prototype.addMachine=function(t){this._stateMachines.push(t),GNe(t)&&this.schemeUrlMachinesCount++},e.prototype.removeMachine=function(t){this._stateMachines=this._stateMachines.filter(function(n){return n!==t}),GNe(t)&&this.schemeUrlMachinesCount--},e.prototype.hasSchemeUrlMachine=function(){return this.schemeUrlMachinesCount>0},e})();function WNe(e,t){for(var n=new wkt(e,t);n.charIdx<n.text.length;n.charIdx++){var i=e.charAt(n.charIdx),r=e.charCodeAt(n.charIdx);if(n.stateMachines.length===0)x9(n,i,r);else{for(var o=n.stateMachines.length-1;o>=0;o--){var s=n.stateMachines[o];switch(s.state){case 11:Mkt(n,s,r);break;case 12:Nkt(n,s,r);break;case 0:Ikt(n,s,r);break;case 1:Pkt(n,s,r);break;case 2:Dkt(n,s,r);break;case 3:Rkt(n,s,r);break;case 4:Okt(n,s,i,r);break;case 5:Lkt(n,s,r);break;case 6:Fkt(n,s,i,r);break;case 7:Bkt(n,s,i,r);break;case 13:kkt(n,s,r);break;case 14:Ukt(n,s,r);break;case 8:zkt(n,s,r);break;case 9:Vkt(n,s,r);break;case 10:jkt(n,s,r);break;case 15:Hkt(n,s,i,r);break;case 16:Gkt(n,s,i,r);break;case 17:Wkt(n,s,i,r);break;case 18:qkt(n,s,i,r);break;case 19:Ykt(n,s,i,r);break;case 20:Xkt(n,s,r);break;case 21:Kkt(n,s,r);break;case 22:ZT(n,s,r);break;case 23:$kt(n,s,r);break;case 24:Jkt(n,s,r);break;case 25:Zkt(n,s,r);break;case 26:Qkt(n,s,r);break;case 27:e3t(n,s,r);break;case 28:t3t(n,s,r);break;case 29:n3t(n,s,r);break;case 30:i3t(n,s,r);break;case 31:r3t(n,s,r);break;case 32:s3t(n,s,i,r);break;case 33:a3t(n,s,r);break;case 34:c3t(n,s,r);break;case 35:l3t(n,s,r);break;case 36:u3t(n,s,i,r);break;case 37:o3t(n,s,i,r);break;case 38:f3t(n,s,i,r);break;case 39:d3t(n,s,i,r);break;case 40:h3t(n,s,r);break;case 41:m3t(n,s,r);break;default:xm(s.state)}}if(!n.hasSchemeUrlMachine()&&n.charIdx>0&&sI(r)){var a=n.text.charCodeAt(n.charIdx-1);sI(a)||n.addMachine(T9(n.charIdx,0))}}}for(var c=n.stateMachines.length-1;c>=0;c--)n.stateMachines.forEach(function(u){return xs(n,u)});return n.matches}function x9(e,t,n){var i=e.charIdx;if(n===35)e.addMachine(A3t(i,28));else if(n===64)e.addMachine(b3t(i,30));else if(n===47)e.addMachine(qoe(i,11));else if(n===43)e.addMachine(Woe(i,37));else if(n===40)e.addMachine(Woe(i,32));else{if(Qs(n)&&(e.addMachine(Woe(i,38)),e.addMachine(_3t(i,13))),Voe(n)){var r=t.toLowerCase()==="m"?15:22;e.addMachine(y3t(i,r))}sI(n)&&e.addMachine(T9(i,0)),Tm(n)&&e.addMachine(qoe(i,5))}}function Ikt(e,t,n){n===58?t.state=2:n===45?t.state=1:koe(n)||e.removeMachine(t)}function Pkt(e,t,n){var i=e.charIdx;n===45||(n===47?(e.removeMachine(t),e.addMachine(qoe(i,11))):koe(n)?t.state=0:e.removeMachine(t))}function Dkt(e,t,n){var i=e.charIdx;n===47?t.state=3:n===46?e.removeMachine(t):f_(n)?(t.state=5,sI(n)&&e.addMachine(T9(i,0))):e.removeMachine(t)}function Rkt(e,t,n){n===47?t.state=4:Uoe(n)?(t.state=10,t.acceptStateReached=!0):xs(e,t)}function Okt(e,t,n,i){i===47?(t.state=10,t.acceptStateReached=!0):f_(i)?(t.state=5,t.acceptStateReached=!0):e.removeMachine(t)}function Mkt(e,t,n){n===47?t.state=12:e.removeMachine(t)}function Nkt(e,t,n){f_(n)?t.state=5:e.removeMachine(t)}function Lkt(e,t,n){n===46?t.state=7:n===45?t.state=6:n===58?t.state=8:y9(n)?t.state=10:_9(n)||xs(e,t)}function Fkt(e,t,n,i){i===45||(i===46?xs(e,t):f_(i)?t.state=5:xs(e,t))}function Bkt(e,t,n,i){i===46?xs(e,t):f_(i)?(t.state=5,t.acceptStateReached=!0):xs(e,t)}function kkt(e,t,n){n===46?t.state=14:n===58?t.state=8:Qs(n)||(y9(n)?t.state=10:Tm(n)?e.removeMachine(t):xs(e,t))}function Ukt(e,t,n){Qs(n)?(t.octetsEncountered++,t.octetsEncountered===4&&(t.acceptStateReached=!0),t.state=13):xs(e,t)}function zkt(e,t,n){Qs(n)?t.state=9:xs(e,t)}function Vkt(e,t,n){Qs(n)||(y9(n)?t.state=10:xs(e,t))}function jkt(e,t,n){Uoe(n)||xs(e,t)}function Hkt(e,t,n,i){n.toLowerCase()==="a"?t.state=16:ZT(e,t,i)}function Gkt(e,t,n,i){n.toLowerCase()==="i"?t.state=17:ZT(e,t,i)}function Wkt(e,t,n,i){n.toLowerCase()==="l"?t.state=18:ZT(e,t,i)}function qkt(e,t,n,i){n.toLowerCase()==="t"?t.state=19:ZT(e,t,i)}function Ykt(e,t,n,i){n.toLowerCase()==="o"?t.state=20:ZT(e,t,i)}function Xkt(e,t,n){n===58?t.state=21:ZT(e,t,n)}function Kkt(e,t,n){A9(n)?t.state=22:e.removeMachine(t)}function ZT(e,t,n){n===46?t.state=23:n===64?t.state=24:A9(n)?t.state=22:e.removeMachine(t)}function $kt(e,t,n){n===46||n===64?e.removeMachine(t):A9(n)?t.state=22:e.removeMachine(t)}function Jkt(e,t,n){f_(n)?t.state=25:e.removeMachine(t)}function Zkt(e,t,n){n===46?t.state=27:n===45?t.state=26:_9(n)||xs(e,t)}function Qkt(e,t,n){n===45||n===46?xs(e,t):_9(n)?t.state=25:xs(e,t)}function e3t(e,t,n){n===46||n===45?xs(e,t):f_(n)?(t.state=25,t.acceptStateReached=!0):xs(e,t)}function t3t(e,t,n){joe(n)?(t.state=29,t.acceptStateReached=!0):e.removeMachine(t)}function n3t(e,t,n){joe(n)||xs(e,t)}function i3t(e,t,n){Hoe(n)?(t.state=31,t.acceptStateReached=!0):e.removeMachine(t)}function r3t(e,t,n){Hoe(n)||(Tm(n)?e.removeMachine(t):xs(e,t))}function o3t(e,t,n,i){Qs(i)?t.state=38:(e.removeMachine(t),x9(e,n,i))}function s3t(e,t,n,i){Qs(i)?t.state=33:e.removeMachine(t),x9(e,n,i)}function a3t(e,t,n){Qs(n)?t.state=34:e.removeMachine(t)}function c3t(e,t,n){Qs(n)?t.state=35:e.removeMachine(t)}function l3t(e,t,n){n===41?t.state=36:e.removeMachine(t)}function u3t(e,t,n,i){Qs(i)?t.state=38:Goe(i)?t.state=39:e.removeMachine(t)}function f3t(e,t,n,i){var r=e.charIdx;t.acceptStateReached=!0,b9(i)?t.state=40:i===35?t.state=41:Qs(i)||(i===40?t.state=32:Goe(i)?t.state=39:(xs(e,t),sI(i)&&e.addMachine(T9(r,0))))}function d3t(e,t,n,i){Qs(i)?t.state=38:i===40?t.state=32:(xs(e,t),x9(e,n,i))}function h3t(e,t,n){b9(n)||(n===35?t.state=41:Qs(n)?t.state=38:xs(e,t))}function m3t(e,t,n){b9(n)?t.state=40:Qs(n)?e.removeMachine(t):xs(e,t)}function xs(e,t){var n=e.matches,i=e.text,r=e.charIdx,o=e.tagBuilder,s=e.stripPrefix,a=e.stripTrailingSlash,c=e.decodePercentEncoding,u=e.hashtagServiceName,f=e.mentionServiceName;if(e.removeMachine(t),!!t.acceptStateReached){var d=t.startIdx,p=i.slice(t.startIdx,r);switch(p=g3t(p),t.type){case 0:{var g=i.charCodeAt(t.startIdx-1);if(g===64)return;switch(t.matchType){case 0:{var m=Boe.exec(p);if(m&&(d=d+m.index,p=p.slice(m.index)),!INe(p))return;break}case 1:{if(!PNe(p))return;break}case 2:{if(!DNe(p))return;break}default:xm(t)}n.push(new RNe({tagBuilder:o,matchedText:p,offset:d,urlMatchType:p3t(t.matchType),url:p,protocolRelativeMatch:p.slice(0,2)==="//",stripPrefix:s,stripTrailingSlash:a,decodePercentEncoding:c}));break}case 1:{MNe(p)&&n.push(new NNe({tagBuilder:o,matchedText:p,offset:d,email:p.replace(ONe,"")}));break}case 2:{LNe(p)&&n.push(new BNe({tagBuilder:o,matchedText:p,offset:d,serviceName:u,hashtag:p.slice(1)}));break}case 3:{kNe(p,f)&&n.push(new zNe({tagBuilder:o,matchedText:p,offset:d,serviceName:f,mention:p.slice(1)}));break}case 4:{if(p=p.replace(/ +$/g,""),VNe(p)){var y=p.replace(/[^0-9,;#]/g,"");n.push(new jNe({tagBuilder:o,matchedText:p,offset:d,number:y,plusSign:p.charAt(0)==="+"}))}break}default:xm(t)}}}function p3t(e){switch(e){case 0:return"scheme";case 1:return"tld";case 2:return"ipV4";default:xm(e)}}var HNe={")":"(","}":"{","]":"["};function g3t(e){for(var t={"(":0,"{":0,"[":0},n=0;n<e.length;n++){var i=e.charAt(n),r=e.charCodeAt(n);vNe(r)?t[i]++:Foe(r)&&t[HNe[i]]--}for(var o=e.length-1;o>=0;){var i=e.charAt(o),r=e.charCodeAt(o);if(Foe(r)){var s=HNe[i];if(t[s]<0)t[s]++,o--;else break}else if(g9(r))o--;else break}return e.slice(0,o+1)}function T9(e,t){return{type:0,startIdx:e,state:t,acceptStateReached:!1,matchType:0}}function qoe(e,t){return{type:0,startIdx:e,state:t,acceptStateReached:!1,matchType:1}}function _3t(e,t){return{type:0,startIdx:e,state:t,acceptStateReached:!1,matchType:2,octetsEncountered:1}}function y3t(e,t){return{type:1,startIdx:e,state:t,acceptStateReached:!1}}function A3t(e,t){return{type:2,startIdx:e,state:t,acceptStateReached:!1}}function b3t(e,t){return{type:3,startIdx:e,state:t,acceptStateReached:!1}}function Woe(e,t){return{type:4,startIdx:e,state:t,acceptStateReached:!1}}function GNe(e){return e.type===0&&e.matchType===0}var m0=(function(){function e(t){t===void 0&&(t={}),this.idx=t.idx!==void 0?t.idx:-1,this.type=t.type||"tag",this.name=t.name||"",this.isOpening=!!t.isOpening,this.isClosing=!!t.isClosing}return e})(),Xoe=new m0,x3t=(function(){function e(t,n){this.charIdx=0,this.state=0,this.currentDataIdx=0,this.currentTag=Xoe,this.html=t,this.callbacks=n}return e})();function qNe(e,t){for(var n=new x3t(e,t),i=e.length;n.charIdx<i;){var r=e.charAt(n.charIdx),o=e.charCodeAt(n.charIdx);switch(n.state){case 0:T3t(n,r);break;case 1:E3t(n,r,o);break;case 2:v3t(n,r,o);break;case 3:C3t(n,r,o);break;case 4:S3t(n,r,o);break;case 5:w3t(n,r,o);break;case 6:I3t(n,r,o);break;case 7:P3t(n,r,o);break;case 8:D3t(n,r);break;case 9:R3t(n,r);break;case 10:O3t(n,r,o);break;case 11:M3t(n,r,o);break;case 12:N3t(n,r);break;case 13:L3t(n);break;case 14:F3t(n,r);break;case 15:B3t(n,r);break;case 16:k3t(n,r);break;case 17:U3t(n,r);break;case 18:z3t(n,r);break;case 19:V3t(n,r);break;case 20:j3t(n,r);break;default:xm(n.state)}n.charIdx++}n.currentDataIdx<n.charIdx&&H3t(n)}function T3t(e,t){t==="<"&&p0(e)}function E3t(e,t,n){t==="!"?e.state=13:t==="/"?(e.state=2,e.currentTag=new m0(Zs(Zs({},e.currentTag),{isClosing:!0}))):t==="<"?p0(e):u_(n)?(e.state=3,e.currentTag=new m0(Zs(Zs({},e.currentTag),{isOpening:!0}))):(e.state=0,e.currentTag=Xoe)}function C3t(e,t,n){YA(n)?(e.currentTag=new m0(Zs(Zs({},e.currentTag),{name:Yoe(e)})),e.state=4):t==="<"?p0(e):t==="/"?(e.currentTag=new m0(Zs(Zs({},e.currentTag),{name:Yoe(e)})),e.state=12):t===">"?(e.currentTag=new m0(Zs(Zs({},e.currentTag),{name:Yoe(e)})),g0(e)):!u_(n)&&!Qs(n)&&t!==":"&&ih(e)}function v3t(e,t,n){t===">"?ih(e):u_(n)?e.state=3:ih(e)}function S3t(e,t,n){YA(n)||(t==="/"?e.state=12:t===">"?g0(e):t==="<"?p0(e):t==="="||p9(n)||TNe(n)?ih(e):e.state=5)}function w3t(e,t,n){YA(n)?e.state=6:t==="/"?e.state=12:t==="="?e.state=7:t===">"?g0(e):t==="<"?p0(e):p9(n)&&ih(e)}function I3t(e,t,n){YA(n)||(t==="/"?e.state=12:t==="="?e.state=7:t===">"?g0(e):t==="<"?p0(e):p9(n)?ih(e):e.state=5)}function P3t(e,t,n){YA(n)||(t==='"'?e.state=8:t==="'"?e.state=9:/[>=`]/.test(t)?ih(e):t==="<"?p0(e):e.state=10)}function D3t(e,t){t==='"'&&(e.state=11)}function R3t(e,t){t==="'"&&(e.state=11)}function O3t(e,t,n){YA(n)?e.state=4:t===">"?g0(e):t==="<"&&p0(e)}function M3t(e,t,n){YA(n)?e.state=4:t==="/"?e.state=12:t===">"?g0(e):t==="<"?p0(e):(e.state=4,G3t(e))}function N3t(e,t){t===">"?(e.currentTag=new m0(Zs(Zs({},e.currentTag),{isClosing:!0})),g0(e)):ih(e)}function L3t(e){var t=e.html,n=e.charIdx;t.slice(n,n+2)==="--"?(e.charIdx++,e.currentTag=new m0(Zs(Zs({},e.currentTag),{type:"comment"})),e.state=14):t.slice(n,n+7).toUpperCase()==="DOCTYPE"?(e.charIdx+=6,e.currentTag=new m0(Zs(Zs({},e.currentTag),{type:"doctype"})),e.state=20):ih(e)}function F3t(e,t){t==="-"?e.state=15:t===">"?ih(e):e.state=16}function B3t(e,t){t==="-"?e.state=18:t===">"?ih(e):e.state=16}function k3t(e,t){t==="-"&&(e.state=17)}function U3t(e,t){t==="-"?e.state=18:e.state=16}function z3t(e,t){t===">"?g0(e):t==="!"?e.state=19:t==="-"||(e.state=16)}function V3t(e,t){t==="-"?e.state=17:t===">"?g0(e):e.state=16}function j3t(e,t){t===">"?g0(e):t==="<"&&p0(e)}function ih(e){e.state=0,e.currentTag=Xoe}function p0(e){e.state=1,e.currentTag=new m0({idx:e.charIdx})}function g0(e){var t=e.html.slice(e.currentDataIdx,e.currentTag.idx);t&&e.callbacks.onText(t,e.currentDataIdx);var n=e.currentTag;n.type==="comment"?e.callbacks.onComment(n.idx):n.type==="doctype"?e.callbacks.onDoctype(n.idx):(n.isOpening&&e.callbacks.onOpenTag(n.name,n.idx),n.isClosing&&e.callbacks.onCloseTag(n.name,n.idx)),ih(e),e.currentDataIdx=e.charIdx+1}function H3t(e){var t=e.html.slice(e.currentDataIdx,e.charIdx);e.callbacks.onText(t,e.currentDataIdx),e.currentDataIdx=e.charIdx+1}function Yoe(e){var t=e.currentTag.idx+(e.currentTag.isClosing?2:1);return e.html.slice(t,e.charIdx).toLowerCase()}function G3t(e){e.charIdx--}var W3t=(function(){function e(t){t===void 0&&(t={}),this.version=e.version,this.urls={},this.email=!0,this.phone=!0,this.hashtag=!1,this.mention=!1,this.newWindow=!0,this.stripPrefix={scheme:!0,www:!0},this.stripTrailingSlash=!0,this.decodePercentEncoding=!0,this.truncate={length:0,location:"end"},this.className="",this.replaceFn=null,this.context=void 0,this.sanitizeHtml=!1,this.tagBuilder=null,this.urls=q3t(t.urls),this.email=Uf(t.email)?t.email:this.email,this.phone=Uf(t.phone)?t.phone:this.phone,this.hashtag=t.hashtag||this.hashtag,this.mention=t.mention||this.mention,this.newWindow=Uf(t.newWindow)?t.newWindow:this.newWindow,this.stripPrefix=Y3t(t.stripPrefix),this.stripTrailingSlash=Uf(t.stripTrailingSlash)?t.stripTrailingSlash:this.stripTrailingSlash,this.decodePercentEncoding=Uf(t.decodePercentEncoding)?t.decodePercentEncoding:this.decodePercentEncoding,this.sanitizeHtml=t.sanitizeHtml||!1;var n=this.mention;if(n!==!1&&UNe.indexOf(n)===-1)throw new Error("invalid `mention` cfg '".concat(n,"' - see docs"));var i=this.hashtag;if(i!==!1&&FNe.indexOf(i)===-1)throw new Error("invalid `hashtag` cfg '".concat(i,"' - see docs"));this.truncate=X3t(t.truncate),this.className=t.className||this.className,this.replaceFn=t.replaceFn||this.replaceFn,this.context=t.context||this}return e.link=function(t,n){var i=new e(n);return i.link(t)},e.parse=function(t,n){var i=new e(n);return i.parse(t)},e.prototype.parse=function(t){var n=this,i=["a","style","script"],r=0,o=[];return qNe(t,{onOpenTag:function(s){i.indexOf(s)>=0&&r++},onText:function(s,a){if(r===0){var c=/( | |<|<|>|>|"|"|')/gi,u=s.split(c),f=a;u.forEach(function(d,p){if(p%2===0){var g=n.parseText(d,f);o.push.apply(o,hNe([],dNe(g),!1))}f+=d.length})}},onCloseTag:function(s){i.indexOf(s)>=0&&(r=Math.max(r-1,0))},onComment:function(){},onDoctype:function(){}}),o=this.compactMatches(o),o=this.removeUnwantedMatches(o),o},e.prototype.compactMatches=function(t){t.sort(K3t);for(var n=0;n<t.length-1;){var i=t[n],r=i.getOffset(),o=i.getMatchedText().length;if(n+1<t.length&&t[n+1].getOffset()===r){var s=t[n+1].getMatchedText().length>o?n:n+1;t.splice(s,1);continue}n++}return t},e.prototype.removeUnwantedMatches=function(t){return this.hashtag||qA(t,function(n){return n.getType()==="hashtag"}),this.email||qA(t,function(n){return n.getType()==="email"}),this.phone||qA(t,function(n){return n.getType()==="phone"}),this.mention||qA(t,function(n){return n.getType()==="mention"}),this.urls.schemeMatches||qA(t,function(n){return n.getType()==="url"&&n.getUrlMatchType()==="scheme"}),this.urls.tldMatches||qA(t,function(n){return n.getType()==="url"&&n.getUrlMatchType()==="tld"}),this.urls.ipV4Matches||qA(t,function(n){return n.getType()==="url"&&n.getUrlMatchType()==="ipV4"}),t},e.prototype.parseText=function(t,n){n=n||0;for(var i=WNe(t,{tagBuilder:this.getTagBuilder(),stripPrefix:this.stripPrefix,stripTrailingSlash:this.stripTrailingSlash,decodePercentEncoding:this.decodePercentEncoding,hashtagServiceName:this.hashtag,mentionServiceName:this.mention||"twitter"}),r=0,o=i.length;r<o;r++)i[r].setOffset(n+i[r].getOffset());return i},e.prototype.link=function(t){if(!t)return"";this.sanitizeHtml&&(t=t.replace(/</g,"<").replace(/>/g,">"));for(var n=this.parse(t),i=new Array(n.length*2+1),r=0,o=0,s=n.length;o<s;o++){var a=n[o];i.push(t.substring(r,a.getOffset())),i.push(this.createMatchReturnVal(a)),r=a.getOffset()+a.getMatchedText().length}return i.push(t.substring(r)),i.join("")},e.prototype.createMatchReturnVal=function(t){var n;if(this.replaceFn&&(n=this.replaceFn.call(this.context,t)),typeof n=="string")return n;if(n===!1)return t.getMatchedText();if(n instanceof m9)return n.toAnchorString();var i=t.buildTag();return i.toAnchorString()},e.prototype.getTagBuilder=function(){var t=this.tagBuilder;return t||(t=this.tagBuilder=new xNe({newWindow:this.newWindow,truncate:this.truncate,className:this.className})),t},e.version=mNe,e})(),YNe=W3t;function q3t(e){return e==null&&(e=!0),Uf(e)?{schemeMatches:e,tldMatches:e,ipV4Matches:e}:{schemeMatches:Uf(e.schemeMatches)?e.schemeMatches:!0,tldMatches:Uf(e.tldMatches)?e.tldMatches:!0,ipV4Matches:Uf(e.ipV4Matches)?e.ipV4Matches:!0}}function Y3t(e){return e==null&&(e=!0),Uf(e)?{scheme:e,www:e}:{scheme:Uf(e.scheme)?e.scheme:!0,www:Uf(e.www)?e.www:!0}}function X3t(e){return typeof e=="number"?{length:e,location:"end"}:Zs({length:Number.POSITIVE_INFINITY,location:"end"},e)}function K3t(e,t){return e.getOffset()-t.getOffset()}var E9=YNe;var nLe;typeof DOMParser<"u"&&(nLe=new DOMParser);var $3t=new E9({stripPrefix:!1,email:!1,replaceFn:function(e,t){return t.urlMatchType==="scheme"||t.urlMatchType==="www"}}),C9=32,XNe=2414016,KNe=1,$Ne=16093e3,JNe=.1,J3t=[null,void 0,"http://www.topografix.com/GPX/1/1"],Kr={gpx:J3t};function Z3t(e){return new Promise((t,n)=>{let i=new FileReader;i.addEventListener("load",function(){t(i.result)}),i.addEventListener("error",function(){n(i.error)}),i.readAsText(e)})}function Koe(e,t){let n=bM(e,"id");return n=l(n)?n:Kn(),t.getOrCreateEntity(n)}function $oe(e){let t=ZNe(e,"lon"),n=ZNe(e,"lat"),i=yM(e,"ele",Kr.gpx);return h.fromDegrees(t,n,i)}function ZNe(e,t){if(!l(e))return;let n=e.getAttribute(t);if(n!==null){let i=parseFloat(n);return isNaN(i)?void 0:i}}function bM(e,t){if(!l(e))return;let n=e.getAttribute(t);return n!==null?n:void 0}function XA(e,t,n){if(!l(e))return;let i=e.childNodes,r=i.length;for(let o=0;o<r;o++){let s=i[o];if(s.localName===t&&n.indexOf(s.namespaceURI)!==-1)return s}}function Joe(e,t,n){if(!l(e))return;let i=[],r=e.getElementsByTagName(t),o=r.length;for(let s=0;s<o;s++){let a=r[s];a.localName===t&&n.indexOf(a.namespaceURI)!==-1&&i.push(a)}return i}function yM(e,t,n){let i=XA(e,t,n);if(l(i)){let r=parseFloat(i.textContent);return isNaN(r)?void 0:r}}function Yu(e,t,n){let i=XA(e,t,n);if(l(i))return i.textContent.trim()}function iLe(e){let t=new Ol;return t.width=C9,t.height=C9,t.scaleByDistance=new qt(XNe,KNe,$Ne,JNe),t.pixelOffsetScaleByDistance=new qt(XNe,KNe,$Ne,JNe),t.verticalOrigin=new hi(qn.BOTTOM),t.image=e,t}function Q3t(){let e=new rp;return e.translucencyByDistance=new qt(3e6,1,5e6,0),e.pixelOffset=new U(17,0),e.horizontalOrigin=Gi.LEFT,e.font="16px sans-serif",e.style=Co.FILL_AND_OUTLINE,e}function rLe(e){let t=new Ml;return t.width=4,t.material=new wT,t.material.color=l(e)?e:z.RED,t.material.outlineWidth=2,t.material.outlineColor=z.BLACK,t}var QNe={time:{text:"Time",tag:"time"},comment:{text:"Comment",tag:"cmt"},description:{text:"Description",tag:"desc"},source:{text:"Source",tag:"src"},number:{text:"GPS track/route number",tag:"number"},type:{text:"Type",tag:"type"}},AM;typeof document<"u"&&(AM=document.createElement("div"));function Zoe(e,t){let n,i="",r=Object.keys(QNe),o=r.length;for(n=0;n<o;n++){let f=r[n],d=QNe[f];d.value=Yu(e,d.tag,Kr.gpx)??"",l(d.value)&&d.value!==""&&(i=`${i}<p>${d.text}: ${d.value}</p>`)}if(!l(i)||i==="")return;i=$3t.link(i),AM.innerHTML=i;let s=AM.querySelectorAll("a");for(n=0;n<s.length;n++)s[n].setAttribute("target","_blank");let a=z.WHITE,c=z.BLACK,u='<div class="cesium-infoBox-description-lighter" style="';return u+="overflow:auto;",u+="word-wrap:break-word;",u+=`background-color:${a.toCssColorString()};`,u+=`color:${c.toCssColorString()};`,u+='">',u+=`${AM.innerHTML}</div>`,AM.innerHTML="",u}function oLe(e,t,n,i){let r=$oe(t),o=Koe(t,n);o.position=r;let s=l(i.waypointImage)?i.waypointImage:e._pinBuilder.fromMakiIconId("marker",z.RED,C9);o.billboard=iLe(s);let a=Yu(t,"name",Kr.gpx);o.name=a,o.label=Q3t(),o.label.text=a,o.description=Zoe(t,o),i.clampToGround&&(o.billboard.heightReference=We.CLAMP_TO_GROUND,o.label.heightReference=We.CLAMP_TO_GROUND)}function eUt(e,t,n,i){let r=Koe(t,n);r.description=Zoe(t,r);let o=Joe(t,"rtept",Kr.gpx),s=new Array(o.length);for(let a=0;a<o.length;a++)oLe(e,o[a],n,i),s[a]=$oe(o[a]);r.polyline=rLe(i.routeColor),i.clampToGround&&(r.polyline.clampToGround=!0),r.polyline.positions=s}function tUt(e,t,n,i){let r=Koe(t,n);r.description=Zoe(t,r);let o=Joe(t,"trkseg",Kr.gpx),s=[],a=[],c,u=!0,f=new Cc;for(let d=0;d<o.length;d++)c=nUt(o[d]),s=s.concat(c.positions),c.times.length>0?(a=a.concat(c.times),f.addSamples(a,s),u=u&&!0):u=!1;if(u){let d=l(i.waypointImage)?i.waypointImage:e._pinBuilder.fromMakiIconId("marker",z.RED,C9);r.billboard=iLe(d),r.position=f,i.clampToGround&&(r.billboard.heightReference=We.CLAMP_TO_GROUND),r.availability=new Bs,r.availability.addInterval(new Cn({start:a[0],stop:a[a.length-1]}))}r.polyline=rLe(i.trackColor),r.polyline.positions=s,i.clampToGround&&(r.polyline.clampToGround=!0)}function nUt(e){let t={positions:[],times:[]},n=Joe(e,"trkpt",Kr.gpx),i;for(let r=0;r<n.length;r++){let o=$oe(n[r]);t.positions.push(o),i=Yu(n[r],"time",Kr.gpx),l(i)&&t.times.push(K.fromIso8601(i))}return t}function iUt(e){let t=XA(e,"metadata",Kr.gpx);if(l(t)){let n={name:Yu(t,"name",Kr.gpx),desc:Yu(t,"desc",Kr.gpx),author:rUt(t),copyright:sUt(t),link:sLe(t),time:Yu(t,"time",Kr.gpx),keywords:Yu(t,"keywords",Kr.gpx),bounds:aUt(t)};if(l(n.name)||l(n.desc)||l(n.author)||l(n.copyright)||l(n.link)||l(n.time)||l(n.keywords)||l(n.bounds))return n}}function rUt(e){let t=XA(e,"author",Kr.gpx);if(l(t)){let n={name:Yu(t,"name",Kr.gpx),email:oUt(t),link:sLe(t)};if(l(n.name)||l(n.email)||l(n.link))return n}}function oUt(e){let t=XA(e,"email",Kr.gpx);if(l(t)){let n=Yu(t,"id",Kr.gpx),i=Yu(t,"domain",Kr.gpx);return`${n}@${i}`}}function sLe(e){let t=XA(e,"link",Kr.gpx);if(l(t)){let n={href:bM(t,"href"),text:Yu(t,"text",Kr.gpx),mimeType:Yu(t,"type",Kr.gpx)};if(l(n.href)||l(n.text)||l(n.mimeType))return n}}function sUt(e){let t=XA(e,"copyright",Kr.gpx);if(l(t)){let n={author:bM(t,"author"),year:Yu(t,"year",Kr.gpx),license:Yu(t,"license",Kr.gpx)};if(l(n.author)||l(n.year)||l(n.license))return n}}function aUt(e){let t=XA(e,"bounds",Kr.gpx);if(l(t)){let n={minLat:yM(t,"minlat",Kr.gpx),maxLat:yM(t,"maxlat",Kr.gpx),minLon:yM(t,"minlon",Kr.gpx),maxLon:yM(t,"maxlon",Kr.gpx)};if(l(n.minLat)||l(n.maxLat)||l(n.minLon)||l(n.maxLon))return n}}var eLe={wpt:oLe,rte:eUt,trk:tUt};function cUt(e,t,n,i){let r=Object.keys(eLe),o=r.length;for(let s=0;s<o;s++){let a=r[s],c=eLe[a],u=t.childNodes,f=u.length;for(let d=0;d<f;d++){let p=u[d];p.localName===a&&Kr.gpx.indexOf(p.namespaceURI)!==-1&&c(e,p,n,i)}}}function tLe(e,t,n){let i=e._entityCollection;i.removeAll();let r=t.documentElement,o=bM(r,"version"),s=bM(r,"creator"),a,c=iUt(r);l(c)&&(a=c.name),r.localName==="gpx"?cUt(e,r,i,n):console.log(`GPX - Unsupported node: ${r.localName}`);let u,f=i.computeAvailability(),d=f.start,p=f.stop,g=K.equals(d,it.MINIMUM_VALUE),m=K.equals(p,it.MAXIMUM_VALUE);if(!g||!m){let A;g&&(A=new Date,A.setHours(0,0,0,0),d=K.fromDate(A)),m&&(A=new Date,A.setHours(24,0,0,0),p=K.fromDate(A)),u=new t0,u.startTime=d,u.stopTime=p,u.currentTime=K.clone(d),u.clockRange=ws.LOOP_STOP,u.clockStep=jr.SYSTEM_CLOCK_MULTIPLIER,u.multiplier=Math.round(Math.min(Math.max(K.secondsDifference(p,d)/60,1),31556900))}let y=!1;return e._name!==a&&(e._name=a,y=!0),e._creator!==s&&(e._creator=s,y=!0),lUt(e._metadata,c)&&(e._metadata=c,y=!0),e._version!==o&&(e._version=o,y=!0),u!==e._clock&&(y=!0,e._clock=u),y&&e._changed.raiseEvent(e),Ps.setLoading(e,!1),e}function lUt(e,t){return!l(e)&&!l(t)?!1:l(e)&&l(t)?e.name!==t.name||e.dec!==t.desc||e.src!==t.src||e.author!==t.author||e.copyright!==t.copyright||e.link!==t.link||e.time!==t.time||e.bounds!==t.bounds:!0}function uUt(e,t,n,i){i=i??H.EMPTY_OBJECT;let r=n;if(typeof n=="string"||n instanceof De){n=De.createIfNeeded(n),r=n.fetchBlob();let o=e._resourceCredits,s=n.credits;if(l(s)){let a=s.length;for(let c=0;c<a;c++)o.push(s[c])}}return Promise.resolve(r).then(function(o){return o instanceof Blob?Z3t(o).then(function(s){let a,c;try{a=nLe.parseFromString(s,"application/xml")}catch(u){c=u.toString()}if(l(c)||a.body||a.documentElement.tagName==="parsererror"){let u=l(c)?c:a.documentElement.firstChild.nodeValue;throw u||(u=a.body.innerText),new oe(u)}return tLe(e,a,i)}):tLe(e,o,i)}).catch(function(o){return e._error.raiseEvent(e,o),console.log(o),Promise.reject(o)})}function aI(){this._changed=new be,this._error=new be,this._loading=new be,this._clock=void 0,this._entityCollection=new Ja(this),this._entityCluster=new dd,this._name=void 0,this._version=void 0,this._creator=void 0,this._metadata=void 0,this._isLoading=!1,this._pinBuilder=new GA}aI.load=function(e,t){return new aI().load(e,t)};Object.defineProperties(aI.prototype,{name:{get:function(){return this._name}},version:{get:function(){return this._version}},creator:{get:function(){return this._creator}},metadata:{get:function(){return this._metadata}},clock:{get:function(){return this._clock}},entities:{get:function(){return this._entityCollection}},isLoading:{get:function(){return this._isLoading}},changedEvent:{get:function(){return this._changed}},errorEvent:{get:function(){return this._error}},loadingEvent:{get:function(){return this._loading}},show:{get:function(){return this._entityCollection.show},set:function(e){this._entityCollection.show=e}},clustering:{get:function(){return this._entityCluster},set:function(e){this._entityCluster=e}}});aI.prototype.update=function(e){return!0};aI.prototype.load=function(e,t){if(!l(e))throw new pe("data is required.");t=t??H.EMPTY_OBJECT,Ps.setLoading(this,!0);let n=this._name,i=this;return uUt(this,this._entityCollection,e,t).then(function(){let r,o=i._entityCollection.computeAvailability(),s=o.start,a=o.stop,c=K.equals(s,it.MINIMUM_VALUE),u=K.equals(a,it.MAXIMUM_VALUE);if(!c||!u){let d;c&&(d=new Date,d.setHours(0,0,0,0),s=K.fromDate(d)),u&&(d=new Date,d.setHours(24,0,0,0),a=K.fromDate(d)),r=new t0,r.startTime=s,r.stopTime=a,r.currentTime=K.clone(s),r.clockRange=ws.LOOP_STOP,r.clockStep=jr.SYSTEM_CLOCK_MULTIPLIER,r.multiplier=Math.round(Math.min(Math.max(K.secondsDifference(a,s)/60,1),31556900))}let f=!1;return r!==i._clock&&(i._clock=r,f=!0),n!==i._name&&(f=!0),f&&i._changed.raiseEvent(i),Ps.setLoading(i,!1),i}).catch(function(r){return Ps.setLoading(i,!1),i._error.raiseEvent(i,r),console.log(r),Promise.reject(r)})};var v9=aI;function fUt(e,t){this.position=e,this.headingPitchRoll=t}var S9=fUt;var xM=js(ef(),1);function dUt(e,t){this.position=e,this.headingPitchRange=t}var w9=dUt;function I9(e,t){this.id=t,this.name=e,this.playlistIndex=0,this.playlist=[],this.tourStart=new be,this.tourEnd=new be,this.entryStart=new be,this.entryEnd=new be,this._activeEntries=[]}I9.prototype.addPlaylistEntry=function(e){this.playlist.push(e)};I9.prototype.play=function(e,t){this.tourStart.raiseEvent();let n=this;cLe.call(this,e,t,function(i){n.playlistIndex=0,i||aLe(n._activeEntries),n.tourEnd.raiseEvent(i)})};I9.prototype.stop=function(){aLe(this._activeEntries)};function aLe(e){for(let t=e.pop();t!==void 0;t=e.pop())t.stop()}function cLe(e,t,n){let i=this.playlist[this.playlistIndex];if(i){let r=hUt.bind(this,e,t,n);if(this._activeEntries.push(i),this.entryStart.raiseEvent(i),i.blocking)i.play(r,e.scene.camera,t);else{let o=this;i.play(function(){o.entryEnd.raiseEvent(i);let s=o._activeEntries.indexOf(i);s>=0&&o._activeEntries.splice(s,1)}),r(e,t,n)}}else l(n)&&n(!1)}function hUt(e,t,n,i){let r=this.playlist[this.playlistIndex];if(this.entryEnd.raiseEvent(r,i),i)n(i);else{let o=this._activeEntries.indexOf(r);o>=0&&this._activeEntries.splice(o,1),this.playlistIndex++,cLe.call(this,e,t,n)}}var P9=I9;function D9(e,t,n){this.type="KmlTourFlyTo",this.blocking=!0,this.activeCamera=null,this.activeCallback=null,this.duration=e,this.view=n,this.flyToMode=t}D9.prototype.play=function(e,t,n){if(this.activeCamera=t,l(e)&&e!==null){let r=this;this.activeCallback=function(o){delete r.activeCallback,delete r.activeCamera,e(l(o)?!1:o)}}let i=this.getCameraOptions(n);if(this.view.headingPitchRoll)t.flyTo(i);else if(this.view.headingPitchRange){let r=new ue(this.view.position);t.flyToBoundingSphere(r,i)}};D9.prototype.stop=function(){l(this.activeCamera)&&this.activeCamera.cancelFlight(),l(this.activeCallback)&&this.activeCallback(!0)};D9.prototype.getCameraOptions=function(e){let t={duration:this.duration};return l(this.activeCallback)&&(t.complete=this.activeCallback),this.flyToMode==="smooth"&&(t.easingFunction=ks.LINEAR_NONE),this.view.headingPitchRoll?(t.destination=this.view.position,t.orientation=this.view.headingPitchRoll):this.view.headingPitchRange&&(t.offset=this.view.headingPitchRange),l(e)&&(t=Mt(t,e)),t};var R9=D9;function Qoe(e){this.type="KmlTourWait",this.blocking=!0,this.duration=e,this.timeout=null}Qoe.prototype.play=function(e){let t=this;this.activeCallback=e,this.timeout=setTimeout(function(){delete t.activeCallback,e(!1)},this.duration*1e3)};Qoe.prototype.stop=function(){clearTimeout(this.timeout),l(this.activeCallback)&&this.activeCallback(!0)};var O9=Qoe;var yLe={avi:"video/x-msvideo",bmp:"image/bmp",bz2:"application/x-bzip2",chm:"application/vnd.ms-htmlhelp",css:"text/css",csv:"text/csv",doc:"application/msword",dvi:"application/x-dvi",eps:"application/postscript",flv:"video/x-flv",gif:"image/gif",gz:"application/x-gzip",htm:"text/html",html:"text/html",ico:"image/vnd.microsoft.icon",jnlp:"application/x-java-jnlp-file",jpeg:"image/jpeg",jpg:"image/jpeg",m3u:"audio/x-mpegurl",m4v:"video/mp4",mathml:"application/mathml+xml",mid:"audio/midi",midi:"audio/midi",mov:"video/quicktime",mp3:"audio/mpeg",mp4:"video/mp4",mp4v:"video/mp4",mpeg:"video/mpeg",mpg:"video/mpeg",odp:"application/vnd.oasis.opendocument.presentation",ods:"application/vnd.oasis.opendocument.spreadsheet",odt:"application/vnd.oasis.opendocument.text",ogg:"application/ogg",pdf:"application/pdf",png:"image/png",pps:"application/vnd.ms-powerpoint",ppt:"application/vnd.ms-powerpoint",ps:"application/postscript",qt:"video/quicktime",rdf:"application/rdf+xml",rss:"application/rss+xml",rtf:"application/rtf",svg:"image/svg+xml",swf:"application/x-shockwave-flash",text:"text/plain",tif:"image/tiff",tiff:"image/tiff",txt:"text/plain",wav:"audio/x-wav",wma:"audio/x-ms-wma",wmv:"video/x-ms-wmv",xml:"application/xml",zip:"application/zip",detectFromFilename:function(e){let t=e.toLowerCase();return t=S_(t),yLe[t]}},lse;typeof DOMParser<"u"&&(lse=new DOMParser);var mUt=new E9({stripPrefix:!1,email:!1,replaceFn:function(e){return e.urlMatchType==="scheme"||e.urlMatchType==="www"}}),KA=32,lLe=2414016,uLe=1,fLe=16093e3,dLe=.1,hLe=[null,void 0,"http://www.opengis.net/kml/2.2","http://earth.google.com/kml/2.2","http://earth.google.com/kml/2.1","http://earth.google.com/kml/2.0"],mLe=["http://www.google.com/kml/ext/2.2"],pUt=["http://www.w3.org/2005/Atom"],Ve={kml:hLe,gx:mLe,atom:pUt,kmlgx:hLe.concat(mLe)},use={Document:ILe,Folder:NUt,Placemark:LUt,NetworkLink:GUt,GroundOverlay:VUt,PhotoOverlay:RLe,ScreenOverlay:zUt,Tour:BUt},rse=class{constructor(t){this._dataSource=t,this._deferred=tf(),this._stack=[],this._promises=[],this._timeoutSet=!1,this._used=!1,this._started=0,this._timeThreshold=1e3}get dataSource(){return this._dataSource}addNodes(t,n){this._stack.push({nodes:t,index:0,processingData:n}),this._used=!0}addPromise(t){this._promises.push(t)}wait(){let t=this._deferred;return this._used||t.resolve(),Promise.all([t.promise,Promise.all(this._promises)])}process(){let t=this._stack.length===1;return t&&(this._started=d_._getTimestamp()),this._process(t)}_giveUpTime(){if(this._timeoutSet)return;this._timeoutSet=!0,this._timeThreshold=50;let t=this;setTimeout(function(){t._timeoutSet=!1,t._started=d_._getTimestamp(),t._process(!0)},0)}_nextNode(){let t=this._stack,n=t[t.length-1],i=n.index,r=n.nodes;if(i!==r.length)return++n.index,r[i]}_pop(){let t=this._stack;return t.pop(),t.length===0?(this._deferred.resolve(),!1):!0}_process(t){let n=this.dataSource,i=this._stack[this._stack.length-1].processingData,r=this._nextNode();for(;l(r);){let o=use[r.localName];if(l(o)&&(Ve.kml.indexOf(r.namespaceURI)!==-1||Ve.gx.indexOf(r.namespaceURI)!==-1)&&(o(n,r,i,this),this._timeoutSet||d_._getTimestamp()>this._started+this._timeThreshold)){this._giveUpTime();return}r=this._nextNode()}this._pop()&&t&&this._process(!0)}};function gUt(e){let t=e.slice(0,Math.min(4,e.size)),n=tf(),i=new FileReader;return i.addEventListener("load",function(){n.resolve(new DataView(i.result).getUint32(0,!1)===1347093252)}),i.addEventListener("error",function(){n.reject(i.error)}),i.readAsArrayBuffer(t),n.promise}function _Ut(e){let t=tf(),n=new FileReader;return n.addEventListener("load",function(){t.resolve(n.result)}),n.addEventListener("error",function(){t.reject(n.error)}),n.readAsText(e),t.promise}function ALe(e){let t={xsi:"http://www.w3.org/2001/XMLSchema-instance"},n,i,r,o;for(let s in t)t.hasOwnProperty(s)&&(r=RegExp(`[< ]${s}:`),o=`xmlns:${s}=`,r.test(e)&&e.indexOf(o)===-1&&(l(n)||(n=e.substr(0,e.indexOf("<kml")+4),i=e.substr(n.length)),n+=` ${o}"${t[s]}"`));return l(n)&&(e=n+i),e}function bLe(e){let t=e.indexOf("xmlns:"),n=e.indexOf(">",t),i,r,o;for(;t!==-1&&t<n;)i=e.slice(t,e.indexOf('"',t)),r=t,t=e.indexOf(i,t+1),t!==-1?(o=e.indexOf('"',e.indexOf('"',t)+1),e=e.slice(0,t-1)+e.slice(o+1,e.length),t=e.indexOf("xmlns:",r-1)):t=e.indexOf("xmlns:",r+1);return e}async function yUt(e,t){let n=await e.getData(new $O);n=ALe(n),n=bLe(n),t.kml=lse.parseFromString(n,"application/xml")}async function ese(e,t){let n=yLe.detectFromFilename(e.filename)??"application/octet-stream",i=await e.getData(new XO(n));t[e.filename]=i}function zf(e,t,n,i){let r=i.keys,o=new xM.default("."),s=e.querySelectorAll(t);for(let a=0;a<s.length;a++){let c=s[a],u=c.getAttribute(n);if(l(u)){let d=new xM.default(u).absoluteTo(o).toString(),p=r.indexOf(d);if(p!==-1){let g=r[p];c.setAttribute(n,i[g]),t==="a"&&c.getAttribute("download")===null&&c.setAttribute("download",g)}}}}function Vf(e,t,n,i){let r=e.querySelectorAll(t);for(let o=0;o<r.length;o++){let s=r[o],a=s.getAttribute(n),c=fse(a,i);l(c)&&s.setAttribute(n,c.url)}}function xLe(e,t,n){let i=Ta(e,"id");i=l(i)&&i.length!==0?i:Kn(),l(n)&&(i=n+i);let r=t.getById(i);return l(r)&&(i=Kn(),l(n)&&(i=n+i)),r=t.add(new Qr({id:i})),l(r.kml)||(r.addProperty("kml"),r.kml=new cse),r}function TM(e,t){return e==="absolute"||e==="relativeToGround"||t==="relativeToSeaFloor"}function F9(e,t){if(!l(e))return h.fromDegrees(0,0,0,t);let n=e.match(/[^\s,\n]+/g);if(!l(n))return h.fromDegrees(0,0,0,t);let i=parseFloat(n[0]),r=parseFloat(n[1]),o=parseFloat(n[2]);return i=isNaN(i)?0:i,r=isNaN(r)?0:r,o=isNaN(o)?0:o,h.fromDegrees(i,r,o,t)}function M9(e,t){if(!l(e))return;let n=e.textContent.match(/[^\s\n]+/g);if(!l(n))return;let i=n.length,r=new Array(i),o=0;for(let s=0;s<i;s++)r[o++]=F9(n[s],t);return r}function $A(e,t){if(!l(e))return;let n=e.getAttribute(t);if(n!==null){let i=parseFloat(n);return isNaN(i)?void 0:i}}function Ta(e,t){if(!l(e))return;let n=e.getAttribute(t);return n!==null?n:void 0}function er(e,t,n){if(!l(e))return;let i=e.childNodes,r=i.length;for(let o=0;o<r;o++){let s=i[o];if(s.localName===t&&n.indexOf(s.namespaceURI)!==-1)return s}}function pLe(e,t,n){if(!l(e))return;let i=[],r=e.getElementsByTagNameNS("*",t),o=r.length;for(let s=0;s<o;s++){let a=r[s];a.localName===t&&n.indexOf(a.namespaceURI)!==-1&&i.push(a)}return i}function Em(e,t,n){if(!l(e))return[];let i=[],r=e.childNodes,o=r.length;for(let s=0;s<o;s++){let a=r[s];a.localName===t&&n.indexOf(a.namespaceURI)!==-1&&i.push(a)}return i}function vi(e,t,n){let i=er(e,t,n);if(l(i)){let r=parseFloat(i.textContent);return isNaN(r)?void 0:r}}function Ln(e,t,n){let i=er(e,t,n);if(l(i))return i.textContent.trim()}function Cm(e,t,n){let i=er(e,t,n);if(l(i)){let r=i.textContent.trim();return r==="1"||/^true$/i.test(r)}}function fse(e,t,n){if(!l(e))return;let i;if(l(n)){e=e.replace(/\\/g,"/");let r=n[e];if(l(r))i=new De({url:r});else{let o=new xM.default(t.getUrlComponent()),s=new xM.default(e);r=n[s.absoluteTo(o)],l(r)&&(i=new De({url:r}))}}return l(i)||(i=t.getDerivedResource({url:e})),i}var Xu={maximumRed:void 0,red:void 0,maximumGreen:void 0,green:void 0,maximumBlue:void 0,blue:void 0};function ose(e,t){if(!l(e)||/^\s*$/gm.test(e))return;e[0]==="#"&&(e=e.substring(1));let n=parseInt(e.substring(0,2),16)/255,i=parseInt(e.substring(2,4),16)/255,r=parseInt(e.substring(4,6),16)/255,o=parseInt(e.substring(6,8),16)/255;return t?(o>0?(Xu.maximumRed=o,Xu.red=void 0):(Xu.maximumRed=void 0,Xu.red=0),r>0?(Xu.maximumGreen=r,Xu.green=void 0):(Xu.maximumGreen=void 0,Xu.green=0),i>0?(Xu.maximumBlue=i,Xu.blue=void 0):(Xu.maximumBlue=void 0,Xu.blue=0),Xu.alpha=n,z.fromRandom(Xu)):new z(o,r,i,n)}function QT(e,t,n){let i=Ln(e,t,n);if(l(i))return ose(i,Ln(e,"colorMode",n)==="random")}function AUt(e){let t=er(e,"TimeStamp",Ve.kmlgx),n=Ln(t,"when",Ve.kmlgx);if(!l(t)||!l(n)||n.length===0)return;let i=K.fromIso8601(n),r=new Bs;return r.addInterval(new Cn({start:i,stop:it.MAXIMUM_VALUE})),r}function bUt(e){let t=er(e,"TimeSpan",Ve.kmlgx);if(!l(t))return;let n,i=er(t,"begin",Ve.kmlgx),r=l(i)?K.fromIso8601(i.textContent):void 0,o=er(t,"end",Ve.kmlgx),s=l(o)?K.fromIso8601(o.textContent):void 0;if(l(r)&&l(s)){if(K.lessThan(s,r)){let a=r;r=s,s=a}n=new Bs,n.addInterval(new Cn({start:r,stop:s}))}else l(r)?(n=new Bs,n.addInterval(new Cn({start:r,stop:it.MAXIMUM_VALUE}))):l(s)&&(n=new Bs,n.addInterval(new Cn({start:it.MINIMUM_VALUE,stop:s})));return n}function TLe(){let e=new Ol;return e.width=KA,e.height=KA,e.scaleByDistance=new qt(lLe,uLe,fLe,dLe),e.pixelOffsetScaleByDistance=new qt(lLe,uLe,fLe,dLe),e}function dse(){let e=new op;return e.outline=!0,e.outlineColor=z.WHITE,e}function ELe(){let e=new rp;return e.translucencyByDistance=new qt(3e6,1,5e6,0),e.pixelOffset=new U(17,0),e.horizontalOrigin=Gi.LEFT,e.font="16px sans-serif",e.style=Co.FILL_AND_OUTLINE,e}function hse(e,t,n,i,r){let o=Ln(e,"href",Ve.kml);if(!l(o)||o.length===0)return;if(o.indexOf("root://icons/palette-")===0){let a=o.charAt(21),c=vi(e,"x",Ve.gx)??0,u=vi(e,"y",Ve.gx)??0;c=Math.min(c/32,7),u=7-Math.min(u/32,7);let f=8*u+c;o=`https://maps.google.com/mapfiles/kml/pal${a}/icon${f}.png`}let s=fse(o,n,i);if(r){let a=Ln(e,"refreshMode",Ve.kml),c=Ln(e,"viewRefreshMode",Ve.kml);a==="onInterval"||a==="onExpire"?yt(`kml-refreshMode-${a}`,`KML - Unsupported Icon refreshMode: ${a}`):(c==="onStop"||c==="onRegion")&&yt(`kml-refreshMode-${c}`,`KML - Unsupported Icon viewRefreshMode: ${c}`);let u=Ln(e,"viewBoundScale",Ve.kml)??1,f=c==="onStop"?"BBOX=[bboxWest],[bboxSouth],[bboxEast],[bboxNorth]":"",d=Ln(e,"viewFormat",Ve.kml)??f,p=Ln(e,"httpQuery",Ve.kml);l(d)&&s.setQueryParameters(Jf(L9(d))),l(p)&&s.setQueryParameters(Jf(L9(p)));let g=t._ellipsoid;return pse(s,t.camera,t.canvas,u,t._lastCameraView.bbox,g),s}return s}function xUt(e,t,n,i,r){let o=vi(t,"scale",Ve.kml),s=vi(t,"heading",Ve.kml),a=QT(t,"color",Ve.kml),c=er(t,"Icon",Ve.kml),u=hse(c,e,i,r,!1);l(c)&&!l(u)&&(u=!1);let f=vi(c,"x",Ve.gx),d=vi(c,"y",Ve.gx),p=vi(c,"w",Ve.gx),g=vi(c,"h",Ve.gx),m=er(t,"hotSpot",Ve.kml),y=$A(m,"x"),A=$A(m,"y"),b=Ta(m,"xunits"),x=Ta(m,"yunits"),T=n.billboard;l(T)||(T=TLe(),n.billboard=T),T.image=u,T.scale=o,T.color=a,(l(f)||l(d)||l(p)||l(g))&&(T.imageSubRegion=new et(f,d,p,g)),l(s)&&s!==0&&(T.rotation=P.toRadians(-s),T.alignedAxis=h.UNIT_Z),o=o??1;let E,v;l(y)&&(b==="pixels"?E=-y*o:b==="insetPixels"?E=(y-KA)*o:b==="fraction"&&(E=-y*KA*o),E+=KA*.5*o),l(A)&&(x==="pixels"?v=A*o:x==="insetPixels"?v=(-A+KA)*o:x==="fraction"&&(v=A*KA*o),v-=KA*.5*o),(l(E)||l(v))&&(T.pixelOffset=new U(E,v))}function N9(e,t,n,i,r){for(let o=0,s=t.childNodes.length;o<s;o++){let a=t.childNodes.item(o);if(a.localName==="IconStyle")xUt(e,a,n,i,r);else if(a.localName==="LabelStyle"){let c=n.label;l(c)||(c=ELe(),n.label=c),c.scale=vi(a,"scale",Ve.kml)??c.scale,c.fillColor=QT(a,"color",Ve.kml)??c.fillColor,c.text=n.name}else if(a.localName==="LineStyle"){let c=n.polyline;l(c)||(c=new Ml,n.polyline=c),c.width=vi(a,"width",Ve.kml),c.material=QT(a,"color",Ve.kml),l(QT(a,"outerColor",Ve.gx))&&yt("kml-gx:outerColor","KML - gx:outerColor is not supported in a LineStyle"),l(vi(a,"outerWidth",Ve.gx))&&yt("kml-gx:outerWidth","KML - gx:outerWidth is not supported in a LineStyle"),l(vi(a,"physicalWidth",Ve.gx))&&yt("kml-gx:physicalWidth","KML - gx:physicalWidth is not supported in a LineStyle"),l(Cm(a,"labelVisibility",Ve.gx))&&yt("kml-gx:labelVisibility","KML - gx:labelVisibility is not supported in a LineStyle")}else if(a.localName==="PolyStyle"){let c=n.polygon;l(c)||(c=dse(),n.polygon=c),c.material=QT(a,"color",Ve.kml)??c.material,c.fill=Cm(a,"fill",Ve.kml)??c.fill,c.outline=Cm(a,"outline",Ve.kml)??c.outline}else if(a.localName==="BalloonStyle"){let c=ose(Ln(a,"bgColor",Ve.kml))??z.WHITE,u=ose(Ln(a,"textColor",Ve.kml))??z.BLACK,f=Ln(a,"text",Ve.kml);n.addProperty("balloonStyle"),n.balloonStyle={bgColor:c,textColor:u,text:f}}else if(a.localName==="ListStyle"){let c=Ln(a,"listItemType",Ve.kml);(c==="radioFolder"||c==="checkOffOnly")&&yt(`kml-listStyle-${c}`,`KML - Unsupported ListStyle with listItemType: ${c}`)}}}function TUt(e,t,n,i,r){let o=new Qr,s,a=-1,c=t.childNodes,u=c.length;for(let d=0;d<u;d++){let p=c[d];(p.localName==="Style"||p.localName==="StyleMap")&&(a=d)}if(a!==-1){let d=c[a];if(d.localName==="Style")N9(e,d,o,i,r);else{let p=Em(d,"Pair",Ve.kml);for(let g=0;g<p.length;g++){let m=p[g],y=Ln(m,"key",Ve.kml);if(y==="normal"){let A=Ln(m,"styleUrl",Ve.kml);if(l(A))s=n.getById(A),l(s)||(s=n.getById(`#${A}`)),l(s)&&o.merge(s);else{let b=er(m,"Style",Ve.kml);N9(e,b,o,i,r)}}else yt(`kml-styleMap-${y}`,`KML - Unsupported StyleMap key: ${y}`)}}}let f=Ln(t,"styleUrl",Ve.kml);if(l(f)){let d=f;if(f[0]!=="#"&&f.indexOf("#")!==-1){let p=f.split("#"),g=p[0];d=`${i.getDerivedResource({url:g}).getUrlComponent()}#${p[1]}`}s=n.getById(d),l(s)||(s=n.getById(`#${d}`)),l(s)&&o.merge(s)}return o}function EUt(e,t,n){return t.fetchXML().then(function(i){return CLe(e,i,n,t,!0)})}function CLe(e,t,n,i,r,o){let s,a,c,u,f=pLe(t,"Style",Ve.kml);if(l(f)){let y=f.length;for(s=0;s<y;s++)u=f[s],a=Ta(u,"id"),l(a)&&(a=`#${a}`,r&&l(i)&&(a=i.getUrlComponent()+a),l(n.getById(a))||(c=new Qr({id:a}),n.add(c),N9(e,u,c,i,o)))}let d=pLe(t,"StyleMap",Ve.kml);if(l(d)){let y=d.length;for(s=0;s<y;s++){let A=d[s];if(a=Ta(A,"id"),l(a)){let b=Em(A,"Pair",Ve.kml);for(let x=0;x<b.length;x++){let T=b[x],E=Ln(T,"key",Ve.kml);if(E==="normal"){if(a=`#${a}`,r&&l(i)&&(a=i.getUrlComponent()+a),!l(n.getById(a))){c=n.getOrCreateEntity(a);let v=Ln(T,"styleUrl",Ve.kml);if(l(v)){v[0]!=="#"&&(v=`#${v}`),r&&l(i)&&(v=i.getUrlComponent()+v);let S=n.getById(v);l(S)&&c.merge(S)}else u=er(T,"Style",Ve.kml),N9(e,u,c,i,o)}}else yt(`kml-styleMap-${E}`,`KML - Unsupported StyleMap key: ${E}`)}}}}let p=[],g=t.getElementsByTagName("styleUrl"),m=g.length;for(s=0;s<m;s++){let y=g[s].textContent;if(y[0]!=="#"){let A=y.split("#");if(A.length===2){let b=A[0],x=i.getDerivedResource({url:b});p.push(EUt(e,x,n))}}}return p}function mse(e,t,n){let i=new oA(e,t.id,["position"]),r=new Bg(t.position);t.polyline=l(n.polyline)?n.polyline.clone():new Ml,t.polyline.positions=new OA([i,r])}function vLe(e,t){return!l(e)&&!l(t)||e==="clampToGround"?We.CLAMP_TO_GROUND:e==="relativeToGround"?We.RELATIVE_TO_GROUND:e==="absolute"?We.NONE:t==="clampToSeaFloor"?(yt("kml-gx:altitudeMode-clampToSeaFloor","KML - <gx:altitudeMode>:clampToSeaFloor is currently not supported, using <kml:altitudeMode>:clampToGround."),We.CLAMP_TO_GROUND):t==="relativeToSeaFloor"?(yt("kml-gx:altitudeMode-relativeToSeaFloor","KML - <gx:altitudeMode>:relativeToSeaFloor is currently not supported, using <kml:altitudeMode>:relativeToGround."),We.RELATIVE_TO_GROUND):(l(e)?yt("kml-altitudeMode-unknown",`KML - Unknown <kml:altitudeMode>:${e}, using <kml:altitudeMode>:CLAMP_TO_GROUND.`):yt("kml-gx:altitudeMode-unknown",`KML - Unknown <gx:altitudeMode>:${t}, using <kml:altitudeMode>:CLAMP_TO_GROUND.`),We.CLAMP_TO_GROUND)}function CUt(e,t,n){return n==="relativeToSeaFloor"||t==="absolute"||t==="relativeToGround"?e:((l(t)&&t!=="clampToGround"||l(n)&&n!=="clampToSeaFloor")&&yt("kml-altitudeMode-unknown",`KML - Unknown altitudeMode: ${t??n}`),new Bg(e))}function vUt(e,t,n,i){if(!l(e))return;if(n==="relativeToSeaFloor"||t==="absolute"||t==="relativeToGround")return e;(l(t)&&t!=="clampToGround"||l(n)&&n!=="clampToSeaFloor")&&yt("kml-altitudeMode-unknown",`KML - Unknown altitudeMode: ${t??n}`);let r=e.length;for(let o=0;o<r;o++){let s=e[o];i.scaleToGeodeticSurface(s,s)}return e}function B9(e,t,n,i){let r=t.label;l(r)||(r=l(n.label)?n.label.clone():ELe(),t.label=r),r.text=t.name;let o=t.billboard;if(l(o)||(o=l(n.billboard)?n.billboard.clone():TLe(),t.billboard=o),l(o.image)?o.image.getValue()||(o.image=void 0):o.image=e._pinBuilder.fromColor(z.YELLOW,64),l(o.scale)){let s=o.scale.getValue();s!==0?r.pixelOffset=new U(s*16+1,0):(r.pixelOffset=void 0,r.horizontalOrigin=void 0)}l(i)&&e._clampToGround&&(o.heightReference=i,r.heightReference=i)}function SLe(e,t){let n=e.path;l(n)||(n=new Z_,n.leadTime=0,e.path=n);let i=t.polyline;l(i)&&(n.material=i.material,n.width=i.width)}function SUt(e,t,n,i,r){let o=Ln(n,"coordinates",Ve.kml),s=Ln(n,"altitudeMode",Ve.kml),a=Ln(n,"altitudeMode",Ve.gx),c=Cm(n,"extrude",Ve.kml),u=e._ellipsoid,f=F9(o,u);return i.position=f,B9(e,i,r,vLe(s,a)),c&&TM(s,a)&&mse(t,i,r),!0}function gLe(e,t,n,i,r){let o=er(n,"coordinates",Ve.kml),s=Ln(n,"altitudeMode",Ve.kml),a=Ln(n,"altitudeMode",Ve.gx),c=Cm(n,"extrude",Ve.kml),u=Cm(n,"tessellate",Ve.kml),f=TM(s,a),d=vi(n,"drawOrder",Ve.gx),p=e._ellipsoid,g=M9(o,p),m=r.polyline;if(f&&c){let y=new Q_;i.wall=y,y.positions=g;let A=r.polygon;l(A)&&(y.fill=A.fill,y.material=A.material),y.outline=!0,l(m)?(y.outlineColor=l(m.material)?m.material.color:z.WHITE,y.outlineWidth=m.width):l(A)&&(y.outlineColor=l(A.material)?A.material.color:z.WHITE)}else if(e._clampToGround&&!f&&u){let y=new Ml;y.clampToGround=!0,i.polyline=y,y.positions=g,l(m)?(y.material=l(m.material)?m.material.color.getValue(it.MINIMUM_VALUE):z.WHITE,y.width=m.width??1):(y.material=z.WHITE,y.width=1),y.zIndex=d}else l(d)&&yt("kml-gx:drawOrder","KML - gx:drawOrder is not supported in LineStrings when clampToGround is false"),e._clampToGround&&!u&&yt("kml-line-tesselate","Ignoring clampToGround for KML lines without the tessellate flag."),m=l(m)?m.clone():new Ml,i.polyline=m,m.positions=vUt(g,s,a,p),(!u||f)&&(m.arcType=ln.NONE);return!0}function wUt(e,t,n,i,r){let o=er(n,"outerBoundaryIs",Ve.kml),s=er(o,"LinearRing",Ve.kml),a=er(s,"coordinates",Ve.kml),c=e._ellipsoid,u=M9(a,c),f=Cm(n,"extrude",Ve.kml),d=Ln(n,"altitudeMode",Ve.kml),p=Ln(n,"altitudeMode",Ve.gx),g=TM(d,p),m=l(r.polygon)?r.polygon.clone():dse(),y=r.polyline;if(l(y)&&(m.outlineColor=l(y.material)?y.material.color:z.WHITE,m.outlineWidth=y.width),i.polygon=m,g?(m.perPositionHeight=!0,m.extrudedHeight=f?0:void 0):e._clampToGround||(m.height=0),l(u)){let A=new Wc(u),b=Em(n,"innerBoundaryIs",Ve.kml);for(let x=0;x<b.length;x++){s=Em(b[x],"LinearRing",Ve.kml);for(let T=0;T<s.length;T++)a=er(s[T],"coordinates",Ve.kml),u=M9(a,c),l(u)&&A.holes.push(new Wc(u))}m.hierarchy=A}return!0}function IUt(e,t,n,i,r){let o=Ln(n,"altitudeMode",Ve.kml),s=Ln(n,"altitudeMode",Ve.gx),a=Em(n,"coord",Ve.gx),c=Em(n,"angles",Ve.gx),u=Em(n,"when",Ve.kml),f=Cm(n,"extrude",Ve.kml),d=TM(o,s),p=e._ellipsoid;c.length>0&&yt("kml-gx:angles","KML - gx:angles are not supported in gx:Tracks");let g=Math.min(a.length,u.length),m=[],y=[];for(let b=0;b<g;b++){let x=F9(a[b].textContent,p);m.push(x),y.push(K.fromIso8601(u[b].textContent))}let A=new Cc;return A.addSamples(y,m),i.position=A,B9(e,i,r,vLe(o,s)),SLe(i,r),i.availability=new Bs,u.length>0&&i.availability.addInterval(new Cn({start:y[0],stop:y[y.length-1]})),d&&f&&mse(t,i,r),!0}function _Le(e,t,n,i,r,o,s,a,c){let u=e[0],f=e[e.length-1],d=new Cc;d.addSamples(e,t),n.intervals.addInterval(new Cn({start:u,stop:f,isStartIncluded:c,isStopIncluded:c,data:CUt(d,s,a)})),i.addInterval(new Cn({start:u,stop:f,isStartIncluded:c,isStopIncluded:c})),r.intervals.addInterval(new Cn({start:u,stop:f,isStartIncluded:c,isStopIncluded:c,data:o}))}function PUt(e,t,n,i,r){let o=Cm(n,"interpolate",Ve.gx),s=Em(n,"Track",Ve.gx),a,c,u,f=!1,d=new NA,p=new Bs,g=new Ec,m=e._ellipsoid;for(let y=0,A=s.length;y<A;y++){let b=s[y],x=Em(b,"when",Ve.kml),T=Em(b,"coord",Ve.gx),E=Ln(b,"altitudeMode",Ve.kml),v=Ln(b,"altitudeMode",Ve.gx),S=TM(E,v),I=Cm(b,"extrude",Ve.kml),R=Math.min(T.length,x.length),O=[];a=[];for(let L=0;L<R;L++){let _=F9(T[L].textContent,m);O.push(_),a.push(K.fromIso8601(x[L].textContent))}o&&(l(c)&&_Le([c,a[0]],[u,O[0]],g,p,d,!1,"absolute",void 0,!1),c=a[R-1],u=O[O.length-1]),_Le(a,O,g,p,d,S&&I,E,v,!0),f=f||S&&I}return i.availability=p,i.position=g,B9(e,i,r),SLe(i,r),f&&(mse(t,i,r),i.polyline.show=d),!0}var wLe={Point:SUt,LineString:gLe,LinearRing:gLe,Polygon:wUt,Track:IUt,MultiTrack:PUt,MultiGeometry:DUt,Model:RUt};function DUt(e,t,n,i,r,o){let s=n.childNodes,a=!1;for(let c=0,u=s.length;c<u;c++){let f=s.item(c),d=wLe[f.localName];if(l(d)){let p=xLe(f,t,o);p.parent=i,p.name=i.name,p.availability=i.availability,p.description=i.description,p.kml=i.kml,d(e,t,f,p,r)&&(a=!0)}}return a}function RUt(e,t,n,i,r){return yt("kml-unsupportedGeometry",`KML - Unsupported geometry: ${n.localName}`),!1}function OUt(e,t){let n=er(e,"ExtendedData",Ve.kml);if(!l(n))return;l(er(n,"SchemaData",Ve.kml))&&yt("kml-schemaData","KML - SchemaData is unsupported"),l(Ta(n,"xmlns:prefix"))&&yt("kml-extendedData","KML - ExtendedData with xmlns:prefix is unsupported");let i={},r=Em(n,"Data",Ve.kml);if(l(r)){let o=r.length;for(let s=0;s<o;s++){let a=r[s],c=Ta(a,"name");l(c)&&(i[c]={displayName:Ln(a,"displayName",Ve.kml),value:Ln(a,"value",Ve.kml)})}}t.kml.extendedData=i}var Vr;typeof document<"u"&&(Vr=document.createElement("div"));function MUt(e,t,n,i,r){let o,s,a,c=t.kml,u=c.extendedData,f=Ln(e,"description",Ve.kml),d=t.balloonStyle??n.balloonStyle,p=z.WHITE,g=z.BLACK,m=f;l(d)&&(p=d.bgColor??z.WHITE,g=d.textColor??z.BLACK,m=d.text??f);let y;if(l(m)){if(m=m.replace("$[name]",t.name??""),m=m.replace("$[description]",f??""),m=m.replace("$[address]",c.address??""),m=m.replace("$[Snippet]",c.snippet??""),m=m.replace("$[id]",t.id),m=m.replace("$[geDirections]",""),l(u)){let x=m.match(/\$\[.+?\]/g);if(x!==null)for(o=0;o<x.length;o++){let T=x[o],E=T.substr(2,T.length-3),v=/\/displayName$/.test(E);E=E.replace(/\/displayName$/,""),y=u[E],l(y)&&(y=v?y.displayName:y.value),l(y)&&(m=m.replace(T,y??""))}}}else if(l(u)&&(a=Object.keys(u),a.length>0)){for(m='<table class="cesium-infoBox-defaultTable cesium-infoBox-defaultTable-lighter"><tbody>',o=0;o<a.length;o++)s=a[o],y=u[s],m+=`<tr><th>${y.displayName??s}</th><td>${y.value??""}</td></tr>`;m+="</tbody></table>"}if(!l(m))return;m=mUt.link(m),Vr.innerHTML=m;let A=Vr.querySelectorAll("a");for(o=0;o<A.length;o++)A[o].setAttribute("target","_blank");l(i)&&i.keys.length>1&&(zf(Vr,"a","href",i),zf(Vr,"link","href",i),zf(Vr,"area","href",i),zf(Vr,"img","src",i),zf(Vr,"iframe","src",i),zf(Vr,"video","src",i),zf(Vr,"audio","src",i),zf(Vr,"source","src",i),zf(Vr,"track","src",i),zf(Vr,"input","src",i),zf(Vr,"embed","src",i),zf(Vr,"script","src",i),zf(Vr,"video","poster",i)),Vf(Vr,"a","href",r),Vf(Vr,"link","href",r),Vf(Vr,"area","href",r),Vf(Vr,"img","src",r),Vf(Vr,"iframe","src",r),Vf(Vr,"video","src",r),Vf(Vr,"audio","src",r),Vf(Vr,"source","src",r),Vf(Vr,"track","src",r),Vf(Vr,"input","src",r),Vf(Vr,"embed","src",r),Vf(Vr,"script","src",r),Vf(Vr,"video","poster",r);let b='<div class="cesium-infoBox-description-lighter" style="';b+="overflow:auto;",b+="word-wrap:break-word;",b+=`background-color:${p.toCssColorString()};`,b+=`color:${g.toCssColorString()};`,b+='">',b+=`${Vr.innerHTML}</div>`,Vr.innerHTML="",t.description=b}function k9(e,t,n){let i=n.entityCollection,r=n.parentEntity,o=n.sourceResource,s=n.uriResolver,a=xLe(t,i,n.context),c=a.kml,u=TUt(e,t,n.styleCollection,o,s),f=Ln(t,"name",Ve.kml);a.name=f,a.parent=r;let d=bUt(t);l(d)||(d=AUt(t)),a.availability=d,gse(a);function p(T){return T?T.show&&p(T.parent):!0}let g=Cm(t,"visibility",Ve.kml);a.show=p(r)&&(g??!0);let m=er(t,"author",Ve.atom),y=c.author;y.name=Ln(m,"name",Ve.atom),y.uri=Ln(m,"uri",Ve.atom),y.email=Ln(m,"email",Ve.atom);let A=er(t,"link",Ve.atom),b=c.link;b.href=Ta(A,"href"),b.hreflang=Ta(A,"hreflang"),b.rel=Ta(A,"rel"),b.type=Ta(A,"type"),b.title=Ta(A,"title"),b.length=Ta(A,"length"),c.address=Ln(t,"address",Ve.kml),c.phoneNumber=Ln(t,"phoneNumber",Ve.kml),c.snippet=Ln(t,"Snippet",Ve.kml),OUt(t,a),MUt(t,a,u,s,o);let x=e._ellipsoid;return DLe(t,a,x),PLe(t,a,x),l(er(t,"Region",Ve.kml))&&yt("kml-region","KML - Placemark Regions are unsupported"),{entity:a,styleEntity:u}}function ILe(e,t,n,i){i.addNodes(t.childNodes,n),i.process()}function NUt(e,t,n,i){let r=k9(e,t,n),o=Ze(n);o.parentEntity=r.entity,ILe(e,t,o,i)}function LUt(e,t,n,i){let r=k9(e,t,n),o=r.entity,s=r.styleEntity,a=!1,c=t.childNodes;for(let u=0,f=c.length;u<f&&!a;u++){let d=c.item(u),p=wLe[d.localName];l(p)&&(p(e,n.entityCollection,d,o,s,o.id),a=!0)}a||(o.merge(s),B9(e,o,s))}var FUt={FlyTo:UUt,Wait:kUt,SoundCue:tse,AnimatedUpdate:tse,TourControl:tse};function BUt(e,t,n,i){let r=Ln(t,"name",Ve.kml),o=Ta(t,"id"),s=new P9(r,o),a=er(t,"Playlist",Ve.gx);if(a){let c=e._ellipsoid,u=a.childNodes;for(let f=0;f<u.length;f++){let d=u[f];if(d.localName){let p=FUt[d.localName];p?p(s,d,c):console.log(`Unknown KML Tour playlist entry type ${d.localName}`)}}}e._kmlTours.push(s)}function tse(e,t){yt(`KML Tour unsupported node ${t.localName}`)}function kUt(e,t){let n=vi(t,"duration",Ve.gx);e.addPlaylistEntry(new O9(n))}function UUt(e,t,n){let i=vi(t,"duration",Ve.gx),r=Ln(t,"flyToMode",Ve.gx),o={kml:{}};DLe(t,o,n),PLe(t,o,n);let s=o.kml.lookAt||o.kml.camera,a=new R9(i,r,s);e.addPlaylistEntry(a)}function PLe(e,t,n){let i=er(e,"Camera",Ve.kml);if(l(i)){let r=vi(i,"longitude",Ve.kml)??0,o=vi(i,"latitude",Ve.kml)??0,s=vi(i,"altitude",Ve.kml)??0,a=vi(i,"heading",Ve.kml)??0,c=vi(i,"tilt",Ve.kml)??0,u=vi(i,"roll",Ve.kml)??0,f=h.fromDegrees(r,o,s,n),d=kc.fromDegrees(a,c-90,u);t.kml.camera=new S9(f,d)}}function DLe(e,t,n){let i=er(e,"LookAt",Ve.kml);if(l(i)){let r=vi(i,"longitude",Ve.kml)??0,o=vi(i,"latitude",Ve.kml)??0,s=vi(i,"altitude",Ve.kml)??0,a=vi(i,"heading",Ve.kml),c=vi(i,"tilt",Ve.kml),u=vi(i,"range",Ve.kml)??0;c=P.toRadians(c??0),a=P.toRadians(a??0);let f=new xh(a,c-P.PI_OVER_TWO,u),d=h.fromDegrees(r,o,s,n);t.kml.lookAt=new w9(d,f)}}function zUt(e,t,n,i){let r=n.screenOverlayContainer;if(!l(r))return;let o=n.sourceResource,s=n.uriResolver,a=er(t,"Icon",Ve.kml),c=hse(a,e,o,s,!1);if(!l(c))return;let u=document.createElement("img");e._screenOverlays.push(u),u.src=c.url,u.onload=function(){let f=["position: absolute"],d=er(t,"screenXY",Ve.kml),p=er(t,"overlayXY",Ve.kml),g=er(t,"size",Ve.kml),m,y,A,b,x,T;l(g)&&(m=$A(g,"x"),y=$A(g,"y"),A=Ta(g,"xunits"),b=Ta(g,"yunits"),l(m)&&m!==-1&&m!==0&&(A==="fraction"?x=`width: ${Math.floor(m*100)}%`:A==="pixels"&&(x=`width: ${m}px`),f.push(x)),l(y)&&y!==-1&&y!==0&&(b==="fraction"?T=`height: ${Math.floor(y*100)}%`:b==="pixels"&&(T=`height: ${y}px`),f.push(T))),u.style=f.join(";");let E=0,v=u.height;l(p)&&(m=$A(p,"x"),y=$A(p,"y"),A=Ta(p,"xunits"),b=Ta(p,"yunits"),l(m)&&(A==="fraction"?E=m*u.width:(A==="pixels"||A==="insetPixels")&&(E=m)),l(y)&&(b==="fraction"?v=y*u.height:(b==="pixels"||b==="insetPixels")&&(v=y))),l(d)&&(m=$A(d,"x"),y=$A(d,"y"),A=Ta(d,"xunits"),b=Ta(d,"yunits"),l(m)&&(A==="fraction"?x=`left: calc(${Math.floor(m*100)}% - ${E}px)`:A==="pixels"?x=`left: ${m-E}px`:A==="insetPixels"&&(x=`right: ${m-E}px`),f.push(x)),l(y)&&(b==="fraction"?T=`bottom: calc(${Math.floor(y*100)}% - ${v}px)`:b==="pixels"?T=`bottom: ${y-v}px`:b==="insetPixels"&&(T=`top: ${y-v}px`),f.push(T))),u.style=f.join(";")},r.appendChild(u)}function VUt(e,t,n,i){let o=k9(e,t,n).entity,s,a=!1,c=e._ellipsoid,u=M9(er(t,"LatLonQuad",Ve.gx),c),f=vi(t,"drawOrder",Ve.kml);if(l(u))s=dse(),s.hierarchy=new Wc(u),s.zIndex=f,o.polygon=s,a=!0;else{s=new sp,s.zIndex=f,o.rectangle=s;let m=er(t,"LatLonBox",Ve.kml);if(l(m)){let y=vi(m,"west",Ve.kml),A=vi(m,"south",Ve.kml),b=vi(m,"east",Ve.kml),x=vi(m,"north",Ve.kml);l(y)&&(y=P.negativePiToPi(P.toRadians(y))),l(A)&&(A=P.clampToLatitudeRange(P.toRadians(A))),l(b)&&(b=P.negativePiToPi(P.toRadians(b))),l(x)&&(x=P.clampToLatitudeRange(P.toRadians(x))),s.coordinates=new ie(y,A,b,x);let T=vi(m,"rotation",Ve.kml);if(l(T)){let E=P.toRadians(T);s.rotation=E,s.stRotation=E}}}let d=er(t,"Icon",Ve.kml),p=hse(d,e,n.sourceResource,n.uriResolver,!0);if(l(p)){a&&yt("kml-gx:LatLonQuad","KML - gx:LatLonQuad Icon does not support texture projection.");let m=vi(d,"x",Ve.gx),y=vi(d,"y",Ve.gx),A=vi(d,"w",Ve.gx),b=vi(d,"h",Ve.gx);(l(m)||l(y)||l(A)||l(b))&&yt("kml-groundOverlay-xywh","KML - gx:x, gx:y, gx:w, gx:h aren't supported for GroundOverlays"),s.material=p,s.material.color=QT(t,"color",Ve.kml),s.material.transparent=!0}else s.material=QT(t,"color",Ve.kml);let g=Ln(t,"altitudeMode",Ve.kml);l(g)?g==="absolute"?(s.height=vi(t,"altitude",Ve.kml),s.zIndex=void 0):g!=="clampToGround"&&yt("kml-altitudeMode-unknown",`KML - Unknown altitudeMode: ${g}`):(g=Ln(t,"altitudeMode",Ve.gx),g==="relativeToSeaFloor"?(yt("kml-altitudeMode-relativeToSeaFloor","KML - altitudeMode relativeToSeaFloor is currently not supported, treating as absolute."),s.height=vi(t,"altitude",Ve.kml),s.zIndex=void 0):g==="clampToSeaFloor"?yt("kml-altitudeMode-clampToSeaFloor","KML - altitudeMode clampToSeaFloor is currently not supported, treating as clampToGround."):l(g)&&yt("kml-altitudeMode-unknown",`KML - Unknown altitudeMode: ${g}`))}function RLe(e,t,n,i){e._unsupportedNode.raiseEvent(e,n.parentEntity,t,n.entityCollection,n.styleCollection,n.sourceResource,n.uriResolver),yt(`kml-unsupportedFeature-${t.nodeName}`,`KML - Unsupported feature: ${t.nodeName}`)}var JA={INTERVAL:0,EXPIRE:1,STOP:2};function L9(e){if(!l(e)||e.length===0)return"";let t=e[0];return(t==="&"||t==="?")&&(e=e.substring(1)),e}var jUt=new ie,cI=new he,nse=new U,HUt=new h;function pse(e,t,n,i,r,o){function s(u){return u<-P.PI_OVER_TWO?-P.PI_OVER_TWO:u>P.PI_OVER_TWO?P.PI_OVER_TWO:u}function a(u){return u>P.PI?u-P.TWO_PI:u<-P.PI?u+P.TWO_PI:u}let c=wE(e.queryParameters);if(c=c.replace(/%5B/g,"[").replace(/%5D/g,"]"),l(t)&&t._mode!==re.MORPHING){let u,f;if(r=r??jUt,l(n)&&(nse.x=n.clientWidth*.5,nse.y=n.clientHeight*.5,u=t.pickEllipsoid(nse,o,HUt)),l(u)?f=o.cartesianToCartographic(u,cI):(f=ie.center(r,cI),u=o.cartographicToCartesian(f)),l(i)&&!P.equalsEpsilon(i,1,P.EPSILON9)){let b=r.width*i*.5,x=r.height*i*.5;r=new ie(a(f.longitude-b),s(f.latitude-x),a(f.longitude+b),s(f.latitude+x))}c=c.replace("[bboxWest]",P.toDegrees(r.west).toString()),c=c.replace("[bboxSouth]",P.toDegrees(r.south).toString()),c=c.replace("[bboxEast]",P.toDegrees(r.east).toString()),c=c.replace("[bboxNorth]",P.toDegrees(r.north).toString());let d=P.toDegrees(f.longitude).toString(),p=P.toDegrees(f.latitude).toString();c=c.replace("[lookatLon]",d),c=c.replace("[lookatLat]",p),c=c.replace("[lookatTilt]",P.toDegrees(t.pitch).toString()),c=c.replace("[lookatHeading]",P.toDegrees(t.heading).toString()),c=c.replace("[lookatRange]",h.distance(t.positionWC,u)),c=c.replace("[lookatTerrainLon]",d),c=c.replace("[lookatTerrainLat]",p),c=c.replace("[lookatTerrainAlt]",f.height.toString()),o.cartesianToCartographic(t.positionWC,cI),c=c.replace("[cameraLon]",P.toDegrees(cI.longitude).toString()),c=c.replace("[cameraLat]",P.toDegrees(cI.latitude).toString()),c=c.replace("[cameraAlt]",P.toDegrees(cI.height).toString());let g=t.frustum,m=g.aspectRatio,y="",A="";if(l(m)){let b=P.toDegrees(g.fov);m>1?(y=b,A=b/m):(A=b,y=b*m)}c=c.replace("[horizFov]",y.toString()),c=c.replace("[vertFov]",A.toString())}else c=c.replace("[bboxWest]","-180"),c=c.replace("[bboxSouth]","-90"),c=c.replace("[bboxEast]","180"),c=c.replace("[bboxNorth]","90"),c=c.replace("[lookatLon]",""),c=c.replace("[lookatLat]",""),c=c.replace("[lookatRange]",""),c=c.replace("[lookatTilt]",""),c=c.replace("[lookatHeading]",""),c=c.replace("[lookatTerrainLon]",""),c=c.replace("[lookatTerrainLat]",""),c=c.replace("[lookatTerrainAlt]",""),c=c.replace("[cameraLon]",""),c=c.replace("[cameraLat]",""),c=c.replace("[cameraAlt]",""),c=c.replace("[horizFov]",""),c=c.replace("[vertFov]","");l(n)?(c=c.replace("[horizPixels]",n.clientWidth),c=c.replace("[vertPixels]",n.clientHeight)):(c=c.replace("[horizPixels]",""),c=c.replace("[vertPixels]","")),c=c.replace("[terrainEnabled]","1"),c=c.replace("[clientVersion]","1"),c=c.replace("[kmlVersion]","2.2"),c=c.replace("[clientName]","Cesium"),c=c.replace("[language]","English"),e.setQueryParameters(Jf(c))}function GUt(e,t,n,i){let o=k9(e,t,n).entity,s=n.sourceResource,a=n.uriResolver,c=er(t,"Link",Ve.kml);if(l(c)||(c=er(t,"Url",Ve.kml)),l(c)){let u=Ln(c,"href",Ve.kml),f,d;if(l(u)){let p=u;if(u=fse(u,s,n.uriResolver),/^data:/.test(u.getUrlComponent()))/\.kmz/i.test(s.getUrlComponent())||(p=s.getDerivedResource({url:p}));else{if(p=u.clone(),f=Ln(c,"viewRefreshMode",Ve.kml),f==="onRegion"){yt("kml-refrehMode-onRegion","KML - Unsupported viewRefreshMode: onRegion");return}d=Ln(c,"viewBoundScale",Ve.kml)??1;let A=f==="onStop"?"BBOX=[bboxWest],[bboxSouth],[bboxEast],[bboxNorth]":"",b=Ln(c,"viewFormat",Ve.kml)??A,x=Ln(c,"httpQuery",Ve.kml);l(b)&&u.setQueryParameters(Jf(L9(b))),l(x)&&u.setQueryParameters(Jf(L9(x)));let T=e._ellipsoid;pse(u,e.camera,e.canvas,d,e._lastCameraView.bbox,T)}let g={sourceUri:p,uriResolver:a,context:o.id,screenOverlayContainer:n.screenOverlayContainer},m=new Ja,y=ase(e,m,u,g).then(function(A){let b=e._entityCollection,x=m.values;b.suspendEvents();for(let v=0;v<x.length;v++){let S=x[v];l(S.parent)||(S.parent=o,gse(S)),b.add(S)}b.resumeEvents();let T=Ln(c,"refreshMode",Ve.kml),E=vi(c,"refreshInterval",Ve.kml)??0;if(T==="onInterval"&&E>0||T==="onExpire"||f==="onStop"){let v=er(A,"NetworkLinkControl",Ve.kml),S=l(v),I=K.now(),R={id:Kn(),href:u,cookie:{},lastUpdated:I,updating:!1,entity:o,viewBoundScale:d,needsUpdate:!1,cameraUpdateTime:I},O=0;if(S&&(R.cookie=Jf(Ln(v,"cookie",Ve.kml)??""),O=vi(v,"minRefreshPeriod",Ve.kml)??0),T==="onInterval")S&&(E=Math.max(O,E)),R.refreshMode=JA.INTERVAL,R.time=E;else if(T==="onExpire"){let L;if(S&&(L=Ln(v,"expires",Ve.kml)),l(L))try{let _=K.fromIso8601(L),C=K.secondsDifference(_,I);C>0&&C<O&&K.addSeconds(I,O,_),R.refreshMode=JA.EXPIRE,R.time=_}catch{yt("kml-refreshMode-onInterval-onExpire","KML - NetworkLinkControl expires is not a valid date")}else yt("kml-refreshMode-onExpire","KML - refreshMode of onExpire requires the NetworkLinkControl to have an expires element")}else l(e.camera)?(R.refreshMode=JA.STOP,R.time=vi(c,"viewRefreshTime",Ve.kml)??0):yt("kml-refrehMode-onStop-noCamera","A NetworkLink with viewRefreshMode=onStop requires the `camera` property to be defined.");l(R.refreshMode)&&e._networkLinks.set(R.id,R)}}).catch(function(A){yt(`An error occured during loading ${u.url}`),e._error.raiseEvent(e,A)});i.addPromise(y)}}}function WUt(e,t,n,i){let r=use[t.localName];return l(r)?r(e,t,n,i):RLe(e,t,n,i)}function sse(e,t,n,i,r,o,s){t.removeAll();let a=n.documentElement,c=a.localName==="Document"?a:er(a,"Document",Ve.kml),u=Ln(c,"name",Ve.kml);l(u)||(u=RA(i.getUrlComponent())),l(e._name)||(e._name=u);let f=new d_._DeferredLoading(e),d=new Ja(e);return Promise.all(CLe(e,n,d,i,!1,r)).then(function(){let p=n.documentElement;if(p.localName==="kml"){let m=p.childNodes;for(let y=0;y<m.length;y++){let A=m[y];if(l(use[A.localName])){p=A;break}}}let g={parentEntity:void 0,entityCollection:t,styleCollection:d,sourceResource:i,uriResolver:r,context:s,screenOverlayContainer:o};return t.suspendEvents(),WUt(e,p,g,f),t.resumeEvents(),f.wait().then(function(){return n.documentElement})})}async function qUt(e,t,n,i,r){let o=Zt("ThirdParty/Workers/zip-web-worker.js"),s=Zt("ThirdParty/zip-module.wasm");MO({workerURI:o,wasmURI:s});let a=new HT(new Gu(n)),c=await a.getEntries(),u=[],f={},d;for(let p=0;p<c.length;p++){let g=c[p];g.directory||(/\.kml$/i.test(g.filename)&&(!l(d)||!/\//i.test(g.filename))?(l(d)&&u.push(ese(d,f)),d=g):u.push(ese(g,f)))}if(l(d)&&u.push(yUt(d,f)),await Promise.all(u),a.close(),!l(f.kml))throw new oe("KMZ file does not contain a KML document.");return f.keys=Object.keys(f),sse(e,t,f.kml,i,f,r)}function ase(e,t,n,i){i=i??H.EMPTY_OBJECT;let r=i.sourceUri,o=i.uriResolver,s=i.context,a=i.screenOverlayContainer,c=n;if(typeof n=="string"||n instanceof De){n=De.createIfNeeded(n),c=n.fetchBlob(),r=r??n.clone();let u=e._resourceCredits,f=n.credits;if(l(f)){let d=f.length;for(let p=0;p<d;p++)u.push(f[p])}}else r=r??De.DEFAULT.clone();return r=De.createIfNeeded(r),l(a)&&(a=kn(a)),Promise.resolve(c).then(function(u){return u instanceof Blob?gUt(u).then(function(f){return f?qUt(e,t,u,r,a):_Ut(u).then(function(d){d=ALe(d),d=bLe(d);let p,g;try{p=lse.parseFromString(d,"application/xml")}catch(m){g=m.toString()}if(l(g)||p.body||p.documentElement.tagName==="parsererror"){let m=l(g)?g:p.documentElement.firstChild.nodeValue;throw m||(m=p.body.innerText),new oe(m)}return sse(e,t,p,r,o,a,s)})}):sse(e,t,u,r,o,a,s)}).catch(function(u){return e._error.raiseEvent(e,u),console.log(u),Promise.reject(u)})}var d_=class e{constructor(t){t=t??H.EMPTY_OBJECT;let n=t.camera,i=t.canvas;this._changed=new be,this._error=new be,this._loading=new be,this._refresh=new be,this._unsupportedNode=new be,this._clock=void 0,this._entityCollection=new Ja(this),this._name=void 0,this._isLoading=!1,this._pinBuilder=new GA,this._networkLinks=new zt,this._entityCluster=new dd,this.canvas=i,this.camera=n,this._lastCameraView={position:l(n)?h.clone(n.positionWC):void 0,direction:l(n)?h.clone(n.directionWC):void 0,up:l(n)?h.clone(n.upWC):void 0,bbox:l(n)?n.computeViewRectangle():ie.clone(ie.MAX_VALUE)},this._ellipsoid=t.ellipsoid??ee.default;let r=t.credit;typeof r=="string"&&(r=new It(r)),this._credit=r,this._resourceCredits=[],this._kmlTours=[],this._screenOverlays=[]}static load(t,n){return n=n??H.EMPTY_OBJECT,new e(n).load(t,n)}get name(){return this._name}set name(t){this._name!==t&&(this._name=t,this._changed.raiseEvent(this))}get clock(){return this._clock}get entities(){return this._entityCollection}get isLoading(){return this._isLoading}get changedEvent(){return this._changed}get errorEvent(){return this._error}get loadingEvent(){return this._loading}get refreshEvent(){return this._refresh}get unsupportedNodeEvent(){return this._unsupportedNode}get show(){return this._entityCollection.show}set show(t){this._entityCollection.show=t}get clustering(){return this._entityCluster}set clustering(t){this._entityCluster=t}get credit(){return this._credit}get kmlTours(){return this._kmlTours}load(t,n){n=n??H.EMPTY_OBJECT,Ps.setLoading(this,!0);let i=this._name;this._name=void 0,this._clampToGround=n.clampToGround??!1;let r=this;return ase(this,this._entityCollection,t,n).then(function(){let o,s=r._entityCollection.computeAvailability(),a=s.start,c=s.stop,u=K.equals(a,it.MINIMUM_VALUE),f=K.equals(c,it.MAXIMUM_VALUE);if(!u||!f){let p;u&&(p=new Date,p.setHours(0,0,0,0),a=K.fromDate(p)),f&&(p=new Date,p.setHours(24,0,0,0),c=K.fromDate(p)),o=new t0,o.startTime=a,o.stopTime=c,o.currentTime=K.clone(a),o.clockRange=ws.LOOP_STOP,o.clockStep=jr.SYSTEM_CLOCK_MULTIPLIER,o.multiplier=Math.round(Math.min(Math.max(K.secondsDifference(c,a)/60,1),31556900))}let d=!1;return o!==r._clock&&(r._clock=o,d=!0),i!==r._name&&(d=!0),d&&r._changed.raiseEvent(r),Ps.setLoading(r,!1),r}).catch(function(o){return Ps.setLoading(r,!1),r._error.raiseEvent(r,o),console.log(o),Promise.reject(o)})}destroy(){for(;this._screenOverlays.length>0;)this._screenOverlays.pop().remove()}update(t){let n=this._networkLinks;if(n.length===0)return!0;let i=K.now(),r=this;ise.removeAll();function o(d){let p=d._children,g=p.length;for(let m=0;m<g;++m){let y=p[m];ise.set(y.id,y),o(y)}}let s=!1,a=this._lastCameraView,c=this.camera;l(c)&&!(c.positionWC.equalsEpsilon(a.position,P.EPSILON7)&&c.directionWC.equalsEpsilon(a.direction,P.EPSILON7)&&c.upWC.equalsEpsilon(a.up,P.EPSILON7))&&(a.position=h.clone(c.positionWC),a.direction=h.clone(c.directionWC),a.up=h.clone(c.upWC),a.bbox=c.computeViewRectangle(),s=!0);let u=new zt,f=!1;return n.values.forEach(function(d){let p=d.entity;if(!ise.contains(p.id)){if(!d.updating){let g=!1;if(d.refreshMode===JA.INTERVAL?K.secondsDifference(i,d.lastUpdated)>d.time&&(g=!0):d.refreshMode===JA.EXPIRE?K.greaterThan(i,d.time)&&(g=!0):d.refreshMode===JA.STOP&&(s&&(d.needsUpdate=!0,d.cameraUpdateTime=i),d.needsUpdate&&K.secondsDifference(i,d.cameraUpdateTime)>=d.time&&(g=!0)),g){o(p),d.updating=!0;let m=new Ja,y=d.href.clone();y.setQueryParameters(d.cookie);let A=r._ellipsoid??ee.default;pse(y,r.camera,r.canvas,d.viewBoundScale,a.bbox,A),ase(r,m,y,{context:p.id}).then(YUt(r,d,m,u,y)).catch(function(b){let x=`NetworkLink ${d.href} refresh failed: ${b}`;console.log(x),r._error.raiseEvent(r,x)}),f=!0}}u.set(d.id,d)}}),f&&(this._networkLinks=u,this._changed.raiseEvent(this)),!0}};function gse(e){let t=e.parent;if(l(t)){let n=t.availability;if(l(n)){let i=e.availability;l(i)?i.intersect(n):e.availability=n}}}function YUt(e,t,n,i,r){return function(o){if(!i.contains(t.id))return;let s=!1,a=er(o,"NetworkLinkControl",Ve.kml),c=l(a),u=0;if(c){if(l(er(a,"Update",Ve.kml))){yt("kml-networkLinkControl-update","KML - NetworkLinkControl updates aren't supported."),t.updating=!1,i.remove(t.id);return}t.cookie=Jf(Ln(a,"cookie",Ve.kml)??""),u=vi(a,"minRefreshPeriod",Ve.kml)??0}let f=K.now(),d=t.refreshMode;if(d===JA.INTERVAL)l(a)&&(t.time=Math.max(u,t.time));else if(d===JA.EXPIRE){let I;if(l(a)&&(I=Ln(a,"expires",Ve.kml)),l(I))try{let R=K.fromIso8601(I),O=K.secondsDifference(R,f);O>0&&O<u&&K.addSeconds(f,u,R),t.time=R}catch{yt("kml-networkLinkControl-expires","KML - NetworkLinkControl expires is not a valid date"),s=!0}else yt("kml-refreshMode-onExpire","KML - refreshMode of onExpire requires the NetworkLinkControl to have an expires element"),s=!0}let p=t.entity,g=e._entityCollection,m=n.values;function y(I){g.remove(I);let R=I._children,O=R.length;for(let L=0;L<O;++L)y(R[L])}g.suspendEvents();let A=g.values.slice(),b;for(b=0;b<A.length;++b){let I=A[b];I.parent===p&&(I.parent=void 0,y(I))}for(g.resumeEvents(),g.suspendEvents(),b=0;b<m.length;b++){let I=m[b];l(I.parent)||(I.parent=p,gse(I)),g.add(I)}g.resumeEvents(),s?i.remove(t.id):t.lastUpdated=f;let x=g.computeAvailability(),T=x.start,E=x.stop,v=K.equals(T,it.MINIMUM_VALUE),S=K.equals(E,it.MAXIMUM_VALUE);if(!v||!S){let I=e._clock;(I.startTime!==T||I.stopTime!==E)&&(I.startTime=T,I.stopTime=E,e._changed.raiseEvent(e))}t.updating=!1,t.needsUpdate=!1,e._refresh.raiseEvent(e,r.getUrlComponent(!0))}}var ise=new zt,cse=class{constructor(){this.author={name:void 0,uri:void 0,email:void 0},this.link={href:void 0,hreflang:void 0,rel:void 0,type:void 0,title:void 0,length:void 0},this.address=void 0,this.phoneNumber=void 0,this.snippet=void 0,this.extendedData=void 0}};d_._DeferredLoading=rse;d_._getTimestamp=xn;var lI=d_;function EM(){pe.throwInstantiationError()}EM.prototype.update=pe.throwInstantiationError;EM.prototype.getBoundingSphere=pe.throwInstantiationError;EM.prototype.isDestroyed=pe.throwInstantiationError;EM.prototype.destroy=pe.throwInstantiationError;var OLe=EM;var U9=`in vec3 v_positionMC; in vec3 v_positionEC; in vec2 v_st; void main() @@ -12702,7 +12674,7 @@ out_FragColor = vec4(material.diffuse + material.emission, material.alpha); out_FragColor = czm_phong(normalize(positionToEyeEC), material, czm_lightDirectionEC); #endif } -`;var C7=`in vec3 position3DHigh; +`;var z9=`in vec3 position3DHigh; in vec3 position3DLow; in vec2 st; in float batchId; @@ -12717,7 +12689,7 @@ v_positionEC = (czm_modelViewRelativeToEye * p).xyz; v_st = st; gl_Position = czm_modelViewProjectionRelativeToEye * p; } -`;function aE(e){e=e??H.EMPTY_OBJECT;let t=e.translucent??!0,n=e.aboveGround??!1;this.material=l(e.material)?e.material:ir.fromType(ir.ColorType),this.translucent=e.translucent??!0,this._vertexShaderSource=e.vertexShaderSource??C7,this._fragmentShaderSource=e.fragmentShaderSource??E7,this._renderState=Rr.getDefaultRenderState(t,!n,e.renderState),this._closed=!1,this._flat=e.flat??!1,this._faceForward=e.faceForward??n,this._aboveGround=n}Object.defineProperties(aE.prototype,{vertexShaderSource:{get:function(){return this._vertexShaderSource}},fragmentShaderSource:{get:function(){return this._fragmentShaderSource}},renderState:{get:function(){return this._renderState}},closed:{get:function(){return this._closed}},vertexFormat:{get:function(){return aE.VERTEX_FORMAT}},flat:{get:function(){return this._flat}},faceForward:{get:function(){return this._faceForward}},aboveGround:{get:function(){return this._aboveGround}}});aE.VERTEX_FORMAT=Be.POSITION_AND_ST;aE.prototype.getFragmentShaderSource=Rr.prototype.getFragmentShaderSource;aE.prototype.isTranslucent=Rr.prototype.isTranslucent;aE.prototype.getRenderState=Rr.prototype.getRenderState;var wBe=aE;var rjt=1e5;function kM(e){e=e??H.EMPTY_OBJECT;let t=e.credit;typeof t=="string"&&(t=new It(t)),this._credit=t,this._radius=l(e.radius)?e.radius:rjt,this._image=e.image,this._transform=l(e.transform)?e.transform:M.IDENTITY,this._repeatHorizontal=l(e.repeatHorizontal)?e.repeatHorizontal:1,this._repeatVertical=l(e.repeatVertical)?e.repeatVertical:1;let n=new a7({radius:this._radius,vertexFormat:Be.ALL}),i=new Bt({geometry:n,modelMatrix:this._transform}),r=new ir({fabric:{type:"Image",uniforms:{image:this._image,repeat:new U(-this._repeatHorizontal,this._repeatVertical)}}});return this._primitive=new Mn({geometryInstances:i,appearance:new Cr({material:r,closed:!0,faceForward:!1,flat:!0,translucent:!1,renderState:{cull:{enabled:!1}}}),credit:this._credit}),this}Object.defineProperties(kM.prototype,{radius:{get:function(){return this._radius}},image:{get:function(){return this._image}},transform:{get:function(){return this._transform}},credit:{get:function(){return l(this._credit)?this._credit:void 0}},show:{get:function(){return l(this._primitive)?this._primitive.show:void 0},set:function(e){l(this._primitive)&&(this._primitive.show=e)}}});kM.prototype.update=function(e){return l(this._credit)&&e.creditDisplay.addCreditToNextFrame(this._credit),this._primitive.update(e)};kM.prototype.destroy=function(){return this._primitive=this._primitive&&this._primitive.destroy(),le(this)};kM.prototype.isDestroyed=function(){return this._primitive.isDestroyed()};var IBe=kM;function Ju(e){this._scene=e.scene,this.samplingWindow=e.samplingWindow??Ju.defaultSettings.samplingWindow,this.quietPeriod=e.quietPeriod??Ju.defaultSettings.quietPeriod,this.warmupPeriod=e.warmupPeriod??Ju.defaultSettings.warmupPeriod,this.minimumFrameRateDuringWarmup=e.minimumFrameRateDuringWarmup??Ju.defaultSettings.minimumFrameRateDuringWarmup,this.minimumFrameRateAfterWarmup=e.minimumFrameRateAfterWarmup??Ju.defaultSettings.minimumFrameRateAfterWarmup,this._lowFrameRate=new be,this._nominalFrameRate=new be,this._frameTimes=[],this._needsQuietPeriod=!0,this._quietPeriodEndTime=0,this._warmupPeriodEndTime=0,this._frameRateIsLow=!1,this._lastFramesPerSecond=void 0,this._pauseCount=0;let t=this;this._preUpdateRemoveListener=this._scene.preUpdate.addEventListener(function(r,o){ojt(t,o)}),this._hiddenPropertyName=document.hidden!==void 0?"hidden":document.mozHidden!==void 0?"mozHidden":document.msHidden!==void 0?"msHidden":document.webkitHidden!==void 0?"webkitHidden":void 0;let n=document.hidden!==void 0?"visibilitychange":document.mozHidden!==void 0?"mozvisibilitychange":document.msHidden!==void 0?"msvisibilitychange":document.webkitHidden!==void 0?"webkitvisibilitychange":void 0;function i(){sjt(t)}this._visibilityChangeRemoveListener=void 0,l(n)&&(document.addEventListener(n,i,!1),this._visibilityChangeRemoveListener=function(){document.removeEventListener(n,i,!1)})}Ju.defaultSettings={samplingWindow:5,quietPeriod:2,warmupPeriod:5,minimumFrameRateDuringWarmup:4,minimumFrameRateAfterWarmup:8};Ju.fromScene=function(e){return(!l(e._frameRateMonitor)||e._frameRateMonitor.isDestroyed())&&(e._frameRateMonitor=new Ju({scene:e})),e._frameRateMonitor};Object.defineProperties(Ju.prototype,{scene:{get:function(){return this._scene}},lowFrameRate:{get:function(){return this._lowFrameRate}},nominalFrameRate:{get:function(){return this._nominalFrameRate}},lastFramesPerSecond:{get:function(){return this._lastFramesPerSecond}}});Ju.prototype.pause=function(){++this._pauseCount,this._pauseCount===1&&(this._frameTimes.length=0,this._lastFramesPerSecond=void 0)};Ju.prototype.unpause=function(){--this._pauseCount,this._pauseCount<=0&&(this._pauseCount=0,this._needsQuietPeriod=!0)};Ju.prototype.isDestroyed=function(){return!1};Ju.prototype.destroy=function(){return this._preUpdateRemoveListener(),l(this._visibilityChangeRemoveListener)&&this._visibilityChangeRemoveListener(),le(this)};function ojt(e,t){if(e._pauseCount>0)return;let n=xn();if(e._needsQuietPeriod)e._needsQuietPeriod=!1,e._frameTimes.length=0,e._quietPeriodEndTime=n+e.quietPeriod/Un.SECONDS_PER_MILLISECOND,e._warmupPeriodEndTime=e._quietPeriodEndTime+(e.warmupPeriod+e.samplingWindow)/Un.SECONDS_PER_MILLISECOND;else if(n>=e._quietPeriodEndTime){e._frameTimes.push(n);let i=n-e.samplingWindow/Un.SECONDS_PER_MILLISECOND;if(e._frameTimes.length>=2&&e._frameTimes[0]<=i){for(;e._frameTimes.length>=2&&e._frameTimes[1]<i;)e._frameTimes.shift();let r=(n-e._frameTimes[0])/(e._frameTimes.length-1);e._lastFramesPerSecond=1e3/r;let o=1e3/(n>e._warmupPeriodEndTime?e.minimumFrameRateAfterWarmup:e.minimumFrameRateDuringWarmup);r>o?e._frameRateIsLow||(e._frameRateIsLow=!0,e._needsQuietPeriod=!0,e.lowFrameRate.raiseEvent(e.scene,e._lastFramesPerSecond)):e._frameRateIsLow&&(e._frameRateIsLow=!1,e._needsQuietPeriod=!0,e.nominalFrameRate.raiseEvent(e.scene,e._lastFramesPerSecond))}}}function sjt(e){document[e._hiddenPropertyName]?e.pause():e.unpause()}var v7=Ju;var rae=class e{constructor(t){t=t??H.EMPTY_OBJECT;let n=ajt(t.geoJson),i=t.allowPicking??!0,r=t.ellipsoid??ee.default,o=new Float64Array(0);function s(g){return o.length<g&&(o=new Float64Array(g)),o}this.show=t.show??!0,this._url=t.url,this._ids=n.ids,this._properties=n.properties,this._featureCount=n.ids.length,this._pickObjectFactory=t.pickObjectFactory,this._points=void 0,this._polylines=void 0,this._polygons=void 0,this._heightReference=t.heightReference??We.NONE,this._scene=t.scene;let a=this._heightReference,c=this._scene;n.pointCount>0&&(this._points=new bf({primitiveCountMax:n.pointCount,allowPicking:i})),n.polylineCount>0&&(this._polylines=new Ul({primitiveCountMax:n.polylineCount,vertexCountMax:n.polylineVertexCount,allowPicking:i,heightReference:a})),n.polygonCount>0&&(this._polygons=new Za({primitiveCountMax:n.polygonCount,vertexCountMax:n.polygonVertexCount,holeCountMax:n.polygonHoleCount,triangleCountMax:n.polygonTriangleCount,allowPicking:i,heightReference:a}));let u=new h,f=0,d=0,p=0;for(let g=0;g<n.features.length;g++){let m=n.features[g],y=m.featureId,A=this._properties[y];for(let b=0;b<m.points.length;b++){let x=f++;this._points.add({featureId:y,position:NBe(m.points[b],r,u),pickObject:i?iae(this,x,this._points,tl,A):void 0})}for(let b=0;b<m.polylines.length;b++){let x=d++;this._polylines.add({featureId:y,positions:PBe(m.polylines[b],r,s),pickObject:i?iae(this,x,this._polylines,Oa,A):void 0})}for(let b=0;b<m.polygons.length;b++){let x=m.polygons[b],T=p++;this._polygons.add({featureId:y,positions:PBe(x.positions,r,s),holes:x.holes,triangles:x.triangles,pickObject:i?iae(this,T,this._polygons,Lo,A):void 0})}}}get url(){let t=this._url;if(l(t))return t instanceof De?t.getUrlComponent(!0):t}get featureCount(){return this._featureCount}get ids(){return this._ids}get properties(){return this._properties}get points(){return this._points}get polylines(){return this._polylines}get polygons(){return this._polygons}static async fromUrl(t,n){let i=De.createIfNeeded(t),r=await i.fetchJson();if(!l(r))throw new oe(`Failed to load GeoJSON from ${i.getUrlComponent(!0)}.`);return e.fromGeoJson(r,{...n,url:i})}static fromGeoJson(t,n){return new e({...n,geoJson:t})}getId(t){return this._ids[t]}getProperties(t){return this._properties[t]}update(t){if(!this.show)return;let n=this._points,i=this._polylines,r=this._polygons,o=t.frameNumber,s=this._heightReference,a=us(s)?this._scene.vectorProvider:null;l(n)&&n.update(t),l(i)&&(l(a)?a.markForFrame(i,o,s):i.update(t)),l(r)&&(l(a)?a.markForFrame(r,o,s):r.update(t))}destroy(){let t=us(this._heightReference)?this._scene.vectorProvider:null;return this._points&&(this._points.destroy(),this._points=void 0),this._polylines&&(l(t)&&t.remove(this._polylines),this._polylines.destroy(),this._polylines=void 0),this._polygons&&(l(t)&&t.remove(this._polygons),this._polygons.destroy(),this._polygons=void 0),le(this)}isDestroyed(){return!1}};function iae(e,t,n,i,r){return l(e._pickObjectFactory)?e._pickObjectFactory(t,n,r):{index:t,collection:n,get primitive(){return n.get(t,new i)},parentPrimitive:e,properties:r}}function ajt(e){let t=cjt(e),n=[],i=[],r=[],o=0,s=0,a=0,c=0,u=0,f=0,d=0;for(let p=0;p<t.length;p++){let g=t[p],m={points:[],polylines:[],polygons:[]};if(DBe(g.geometry,m),m.points.length===0&&m.polylines.length===0&&m.polygons.length===0)continue;let y=i.length;i.push(g.id),r.push(Ajt(g.properties)?g.properties:H.EMPTY_OBJECT);for(let A=0;A<m.polygons.length;A++){let b=m.polygons[A];f+=b.holes.length,d+=b.triangles.length/3,u+=b.positions.length}for(let A=0;A<m.polylines.length;A++)a+=m.polylines[A].length;o+=m.points.length,s+=m.polylines.length,c+=m.polygons.length,n.push({featureId:y,points:m.points,polylines:m.polylines,polygons:m.polygons})}return{features:n,ids:i,properties:r,pointCount:o,polylineCount:s,polylineVertexCount:a,polygonCount:c,polygonVertexCount:u,polygonHoleCount:f,polygonTriangleCount:d}}function cjt(e){if(!l(e)||!l(e.type))throw new oe("GeoJSON object must define 'type'.");switch(e.type){case"FeatureCollection":return e.features;case"Feature":return[e];default:if(_jt(e.type))return[{type:"Feature",geometry:e,properties:H.EMPTY_OBJECT,id:void 0}];throw new oe(`Unsupported GeoJSON type: ${e.type}`)}}function DBe(e,t){if(!(!l(e)||!l(e.type)))switch(e.type){case"Point":RBe(e.coordinates,t.points);return;case"MultiPoint":ujt(e.coordinates,t.points);return;case"LineString":OBe(e.coordinates,t.polylines);return;case"MultiLineString":fjt(e.coordinates,t.polylines);return;case"Polygon":MBe(e.coordinates,t.polygons);return;case"MultiPolygon":djt(e.coordinates,t.polygons);return;case"GeometryCollection":ljt(e.geometries,t);return;default:return}}function ljt(e,t){if(Array.isArray(e))for(let n=0;n<e.length;n++)DBe(e[n],t)}function RBe(e,t){let n=oae(e);l(n)&&t.push(n)}function ujt(e,t){for(let n=0;n<e.length;n++)RBe(e[n],t)}function OBe(e,t){let n=hjt(e);l(n)&&n.length>=2&&t.push(n)}function fjt(e,t){for(let n=0;n<e.length;n++)OBe(e[n],t)}function MBe(e,t){let n=mjt(e);l(n)&&t.push(n)}function djt(e,t){for(let n=0;n<e.length;n++)MBe(e[n],t)}function hjt(e){if(!Array.isArray(e))return;let t=[];for(let n=0;n<e.length;n++){let i=oae(e[n]);l(i)&&t.push(i)}return t.length>=2?t:void 0}function mjt(e){if(!Array.isArray(e)||e.length===0)return;let t=[];for(let a=0;a<e.length;a++){let c=pjt(e[a]);l(c)&&t.push(c)}if(t.length===0||t[0].length<3)return;let i=[],r=[],o=[];for(let a=0;a<t.length;a++){let c=t[a];if(!(c.length<3)){a>0&&o.push(r.length);for(let u=0;u<c.length;u++){let f=c[u];r.push(f),i.push(new U(f[0],f[1]))}}}if(r.length<3)return;let s=mi.triangulate(i,o);if(!(!l(s)||s.length<3))return{positions:r,holes:new Uint32Array(o),triangles:new Uint32Array(s)}}function pjt(e){if(!Array.isArray(e))return;let t=[];for(let n=0;n<e.length;n++){let i=oae(e[n]);l(i)&&t.push(i)}if(!(t.length<3))return t.length>1&&gjt(t[0],t[t.length-1])&&t.pop(),t.length>=3?t:void 0}function oae(e){if(!Array.isArray(e)||e.length<2)return;let t=e[0],n=e[1],i=e[2]??0;if(!(!Number.isFinite(t)||!Number.isFinite(n)||!Number.isFinite(i)))return[t,n,i]}function gjt(e,t){return e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]}function _jt(e){return e==="Point"||e==="MultiPoint"||e==="LineString"||e==="MultiLineString"||e==="Polygon"||e==="MultiPolygon"||e==="GeometryCollection"}function NBe(e,t,n){return h.fromDegrees(e[0],e[1],e[2]??0,t,n)}var yjt=new h;function PBe(e,t,n){let i=e.length*3,r=n(i);for(let o=0;o<e.length;o++){let s=NBe(e[o],t,yjt);r[o*3]=s.x,r[o*3+1]=s.y,r[o*3+2]=s.z}return r.subarray(0,i)}function Ajt(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}var LBe=rae;var FBe=js(Ose(),1);function sae(){this._image=new Image}sae.prototype.isReady=function(){return!0};sae.prototype.shouldDiscardImage=function(e){return e===this._image};function cE(e){e=e??H.EMPTY_OBJECT,this._defaultAlpha=void 0,this._defaultNightAlpha=void 0,this._defaultDayAlpha=void 0,this._defaultBrightness=void 0,this._defaultContrast=void 0,this._defaultHue=void 0,this._defaultSaturation=void 0,this._defaultGamma=void 0,this._defaultMinificationFilter=void 0,this._defaultMagnificationFilter=void 0,this._tileDiscardPolicy=e.tileDiscardPolicy,this._tilingScheme=new rr({numberOfLevelZeroTilesX:2,numberOfLevelZeroTilesY:2,rectangle:new ie(-P.PI,-P.PI,P.PI,P.PI),ellipsoid:e.ellipsoid});let t=e.credit;typeof t=="string"&&(t=new It(t)),this._credit=t,this._tileWidth=256,this._tileHeight=256,this._maximumLevel=23,l(this._tileDiscardPolicy)||(this._tileDiscardPolicy=new sae),this._errorEvent=new be}Object.defineProperties(cE.prototype,{url:{get:function(){return this._metadata.url}},proxy:{get:function(){return this._metadata.proxy}},tileWidth:{get:function(){return this._tileWidth}},tileHeight:{get:function(){return this._tileHeight}},maximumLevel:{get:function(){return this._maximumLevel}},minimumLevel:{get:function(){return 0}},tilingScheme:{get:function(){return this._tilingScheme}},rectangle:{get:function(){return this._tilingScheme.rectangle}},tileDiscardPolicy:{get:function(){return this._tileDiscardPolicy}},errorEvent:{get:function(){return this._errorEvent}},credit:{get:function(){return this._credit}},hasAlphaChannel:{get:function(){return!1}}});cE.fromMetadata=function(e,t){if(!e.imageryPresent)throw new oe(`The server ${e.url} doesn't have imagery`);let n=new cE(t);return n._metadata=e,n};cE.prototype.getTileCredits=function(e,t,n){let i=this._metadata,r=i.getTileInformation(e,t,n);if(l(r)){let o=i.providers[r.imageryProvider];if(l(o))return[o]}};cE.prototype.requestImage=function(e,t,n,i){let r=this._tileDiscardPolicy._image,o=this._metadata,s=tb.tileXYToQuadKey(e,t,n),a=o.getTileInformation(e,t,n);if(!l(a)){if(o.isValid(s)){let u=new Oo({throttle:i.throttle,throttleByServer:i.throttleByServer,type:i.type,priorityFunction:i.priorityFunction});o.populateSubtree(e,t,n,u);return}return Promise.resolve(r)}if(!a.hasImagery())return Promise.resolve(r);let c=bjt(this,a,e,t,n,i).fetchArrayBuffer();if(l(c))return c.then(function(u){K9(o.key,u);let f=new Uint8Array(u),d,p=o.protoImagery;if((!l(p)||!p)&&(d=xjt(f)),!l(d)&&(!l(p)||p)){let g=Tjt(f);d=g.imageType,f=g.imageData}return!l(d)||!l(f)?r:fy({uint8Array:f,format:d,flipY:!0})})};cE.prototype.pickFeatures=function(e,t,n,i,r){};function bjt(e,t,n,i,r,o){let s=tb.tileXYToQuadKey(n,i,r),a=t.imageryVersion;return a=l(a)&&a>0?a:1,e._metadata.resource.getDerivedResource({url:`flatfile?f1-0${s}-i.${a.toString()}`,request:o})}function xjt(e){let t="JFIF";if(e[6]===t.charCodeAt(0)&&e[7]===t.charCodeAt(1)&&e[8]===t.charCodeAt(2)&&e[9]===t.charCodeAt(3))return"image/jpeg";let n="PNG";if(e[1]===n.charCodeAt(0)&&e[2]===n.charCodeAt(1)&&e[3]===n.charCodeAt(2))return"image/png"}function Tjt(e){let t=FBe.Reader.create(e),n=t.len,i={};for(;t.pos<n;){let s=t.uint32(),a;switch(s>>>3){case 1:i.imageType=t.uint32();break;case 2:i.imageData=t.bytes();break;case 3:i.alphaType=t.uint32();break;case 4:i.imageAlpha=t.bytes();break;case 5:if(a=i.copyrightIds,l(a)||(a=i.copyrightIds=[]),(s&7)===2){let c=t.uint32()+t.pos;for(;t.pos<c;)a.push(t.uint32())}else a.push(t.uint32());break;default:t.skipType(s&7);break}}let r=i.imageType;if(l(r))switch(r){case 0:i.imageType="image/jpeg";break;case 4:i.imageType="image/png";break;default:throw new oe("GoogleEarthEnterpriseImageryProvider: Unsupported image type.")}let o=i.alphaType;return l(o)&&o!==0&&(console.log("GoogleEarthEnterpriseImageryProvider: External alpha not supported."),delete i.alphaType,delete i.imageAlpha),i}var BBe=cE;var Ejt=600;function T0(e){e=e??H.EMPTY_OBJECT,this._key=l(e.key)?e.key:Fa.defaultApiKey,this._baseResource=De.createIfNeeded(e.url??Fa.streetViewStaticApiEndpoint),this._metadataResource=this._baseResource.getDerivedResource({url:"streetview/metadata"}),this._tileSize=e.tileSize??Ejt}Object.defineProperties(T0.prototype,{});T0.prototype.loadPanorama=async function(e){let t=e.cartographic,n=e.tileSize??this._tileSize,i=`${n}x${n}`,r=e.signature,{panoId:o}=e;l(o)||(o=(await this.getNearestPanoId(t)).panoId);let s=Fa.getDefaultCredit(),a=h.fromDegrees(P.toDegrees(t.longitude),P.toDegrees(t.latitude),0),c=[this._loadFaceImage({heading:0,pitch:0,tileSizeString:i,panoId:o,signature:r}),this._loadFaceImage({heading:180,pitch:0,tileSizeString:i,panoId:o,signature:r}),this._loadFaceImage({heading:-90,pitch:-90,tileSizeString:i,panoId:o,signature:r}),this._loadFaceImage({heading:-90,pitch:90,tileSizeString:i,panoId:o,signature:r}),this._loadFaceImage({heading:270,pitch:0,tileSizeString:i,panoId:o,signature:r}),this._loadFaceImage({heading:90,pitch:0,tileSizeString:i,panoId:o,signature:r})],[u,f,d,p,g,m]=await Promise.all(c),y=At.localFrameToFixedFrameGenerator("north","down"),A=M.getMatrix3(y(a,ee.default),new $);return new aI({sources:{positiveX:u,negativeX:f,positiveY:d,negativeY:p,positiveZ:g,negativeZ:m},transform:A,credit:s})};T0.prototype.getNearestPanoId=async function(e,t){let i=[P.toDegrees(e.latitude),P.toDegrees(e.longitude)].join(","),o=await this._metadataResource.getDerivedResource({queryParameters:{key:this._key,location:i,radius:t??50}}).fetchJson();if(o.status!=="OK")throw new pe(`GoogleStreetViewCubeMapPanoramaProvider metadata error: ${o.status}`);return{panoId:o.pano_id,latitude:o.location.lat,longitude:o.location.lng}};T0.prototype.getPanoIdMetadata=async function(e){let n=await this._metadataResource.getDerivedResource({queryParameters:{key:this._key,pano:e}}).fetchJson();if(n.status!=="OK")throw new pe(`GoogleStreetViewCubeMapPanoramaProvider metadata error: ${n.status}`);return n};T0.prototype._loadFaceImage=async function(e){let t=this._buildFaceUrl(e);try{return await De.fetchImage({url:t,preferImageBitmap:!0,flipY:!0})}catch{throw new pe(`Failed to load Street View face image: ${t}`)}};T0.prototype._buildFaceUrl=function(e){let{heading:t,pitch:n,tileSizeString:i,panoId:r,signature:o}=e;return this._baseResource.getDerivedResource({queryParameters:{size:i,pano:r,heading:t,pitch:n,key:this._key,...l(o)&&{signature:o}}}).url};T0.fromUrl=async function(e){if(e=e??{},e.key=e.key??Fa.defaultStreetViewStaticApiKey??Fa.defaultApiKey,!l(e.key)&&!l(Fa.defaultStreetViewStaticApiKey)&&!l(Fa.defaultApiKey))throw new pe("options.key, GoogleMaps.defaultStreetViewStaticApiKey or GoogleMaps.defaultApiKey is required.");return new T0({...e})};T0._parseMetadata=function(e){return{cartographic:he.fromDegrees(e.location.lng,e.location.lat,0)}};var kBe=T0;var Cjt=new z(1,1,1,.4),vjt=new z(0,1,0,.05),Sjt=new z(0,.5,0,.2);function lE(e){e=e??H.EMPTY_OBJECT,this._defaultAlpha=void 0,this._defaultNightAlpha=void 0,this._defaultDayAlpha=void 0,this._defaultBrightness=void 0,this._defaultContrast=void 0,this._defaultHue=void 0,this._defaultSaturation=void 0,this._defaultGamma=void 0,this._defaultMinificationFilter=void 0,this._defaultMagnificationFilter=void 0,this._tilingScheme=l(e.tilingScheme)?e.tilingScheme:new rr({ellipsoid:e.ellipsoid}),this._cells=e.cells??8,this._color=e.color??Cjt,this._glowColor=e.glowColor??vjt,this._glowWidth=e.glowWidth??6,this._backgroundColor=e.backgroundColor??Sjt,this._errorEvent=new be,this._tileWidth=e.tileWidth??256,this._tileHeight=e.tileHeight??256,this._canvasSize=e.canvasSize??256,this._canvas=this._createGridCanvas()}Object.defineProperties(lE.prototype,{proxy:{get:function(){}},tileWidth:{get:function(){return this._tileWidth}},tileHeight:{get:function(){return this._tileHeight}},maximumLevel:{get:function(){}},minimumLevel:{get:function(){}},tilingScheme:{get:function(){return this._tilingScheme}},rectangle:{get:function(){return this._tilingScheme.rectangle}},tileDiscardPolicy:{get:function(){}},errorEvent:{get:function(){return this._errorEvent}},credit:{get:function(){}},hasAlphaChannel:{get:function(){return!0}}});lE.prototype._drawGrid=function(e){let n=this._canvasSize;for(let i=0;i<=this._cells;++i){let o=1+i/this._cells*(n-1);e.moveTo(o,0),e.lineTo(o,n),e.moveTo(0,o),e.lineTo(n,o)}e.stroke()};lE.prototype._createGridCanvas=function(){let e=document.createElement("canvas");e.width=this._canvasSize,e.height=this._canvasSize;let t=0,n=this._canvasSize,i=e.getContext("2d"),r=this._backgroundColor.toCssColorString();i.fillStyle=r,i.fillRect(t,t,n,n);let o=this._glowColor.toCssColorString();i.strokeStyle=o,i.lineWidth=this._glowWidth,i.strokeRect(t,t,n,n),this._drawGrid(i),i.lineWidth=this._glowWidth*.5,i.strokeRect(t,t,n,n),this._drawGrid(i);let s=this._color.toCssColorString();return i.strokeStyle=s,i.lineWidth=2,i.strokeRect(t,t,n,n),i.lineWidth=1,this._drawGrid(i),e};lE.prototype.getTileCredits=function(e,t,n){};lE.prototype.requestImage=function(e,t,n,i){return Promise.resolve(this._canvas)};lE.prototype.pickFeatures=function(e,t,n,i,r){};var UBe=lE;function Im(){}Im._maxDecodingConcurrency=Math.max(dn.hardwareConcurrency-1,1);Im._decodeTaskProcessor=new $n("decodeI3S",Im._maxDecodingConcurrency);Im._promise=void 0;async function wjt(){if(await Im._decodeTaskProcessor.initWebAssemblyModule({wasmBinaryFile:"ThirdParty/draco_decoder.wasm"}))return Im._decodeTaskProcessor;throw new oe("I3S decoder could not be initialized.")}Im.decode=async function(e,t,n,i,r){return l(Im._promise)||(Im._promise=wjt()),Im._promise.then(function(o){let s=n._parent._data,a=n._parent._inverseRotationMatrix,c=0,u=0,f=0;l(s.obb)?(c=s.obb.center[0],u=s.obb.center[1],f=s.obb.center[2]):l(s.mbs)&&(c=s.mbs[0],u=s.mbs[1],f=s.mbs[2]);let d=$.fromRotationX(-P.PI_OVER_TWO),p=new $;$.multiply(d,a,p);let g=he.fromDegrees(c,u,f),m=ee.WGS84.cartographicToCartesian(g),y={binaryData:n._data,featureData:l(i)&&l(i[0])?i[0].data:void 0,schema:t,bufferInfo:n._geometryBufferInfo,ellipsoidRadiiSquare:ee.WGS84.radiiSquared,url:e,geoidDataList:n._dataProvider._geoidDataList,cartographicCenter:g,cartesianCenter:m,parentRotation:p,enableFeatures:n._dataProvider.showFeatures,splitGeometryByColorTransparency:n._dataProvider.adjustMaterialAlphaMode,symbologyData:r,calculateNormals:n._dataProvider.calculateNormals};return o.scheduleTask(y)})};var S7=Im;function aae(e,t){this._parent=e,this._dataProvider=e._dataProvider,this._layer=e._layer,l(this._parent._nodeIndex)?this._resource=this._parent._layer.resource.getDerivedResource({url:`nodes/${this._parent._data.mesh.attribute.resource}/${t}`}):this._resource=this._parent.resource.getDerivedResource({url:t})}Object.defineProperties(aae.prototype,{resource:{get:function(){return this._resource}},data:{get:function(){return this._data}}});aae.prototype.load=async function(){return this._data=await E0.loadJson(this._resource),this._data};var w7=aae;function __(e,t){this._storageInfo=t,this._parent=e,this._dataProvider=e._dataProvider,this._loadPromise=void 0;let n=`attributes/${t.key}/0`;l(this._parent._nodeIndex)?this._resource=this._parent._layer.resource.getDerivedResource({url:`nodes/${this._parent._data.mesh.attribute.resource}/${n}`}):this._resource=this._parent.resource.getDerivedResource({url:n})}Object.defineProperties(__.prototype,{resource:{get:function(){return this._resource}},header:{get:function(){return this._header}},values:{get:function(){if(l(this._values)){if(l(this._values.attributeValues))return this._values.attributeValues;if(l(this._values.objectIds))return this._values.objectIds}return[]}},name:{get:function(){return this._storageInfo.name}}});function I7(e){return e==="UInt8"||e==="Int8"?1:e==="UInt16"||e==="Int16"?2:e==="UInt32"||e==="Int32"||e==="Oid32"||e==="Float32"?4:e==="UInt64"||e==="Int64"||e==="Float64"?8:0}function Ijt(e){return e==="String"?1:I7(e)}async function Pjt(e){let t=await e._dataProvider._loadBinary(e._resource),n=new DataView(t);e._data=t,e._validateHeader(n);let i=e._parseHeader(n),r=e._getBodyOffset(i);e._validateBody(n,r),e._parseBody(n,r)}__.prototype.load=function(){return l(this._loadPromise)?this._loadPromise:(this._loadPromise=Pjt(this).catch(function(e){console.error(e)}),this._loadPromise)};__.prototype._parseValue=function(e,t,n){let i;if(t==="UInt8")i=e.getUint8(n),n+=1;else if(t==="Int8")i=e.getInt8(n),n+=1;else if(t==="UInt16")i=e.getUint16(n,!0),n+=2;else if(t==="Int16")i=e.getInt16(n,!0),n+=2;else if(t==="UInt32")i=e.getUint32(n,!0),n+=4;else if(t==="Oid32")i=e.getUint32(n,!0),n+=4;else if(t==="Int32")i=e.getInt32(n,!0),n+=4;else if(t==="UInt64"){let r=e.getUint32(n,!0),o=e.getUint32(n+4,!0);i=r+Math.pow(2,32)*o,n+=8}else if(t==="Int64"){let r=e.getUint32(n,!0),o=e.getUint32(n+4,!0);o<Math.pow(2,31)?i=r+Math.pow(2,32)*o:i=r+Math.pow(2,32)*(o-Math.pow(2,32)),n+=8}else t==="Float32"?(i=e.getFloat32(n,!0),n+=4):t==="Float64"?(i=e.getFloat64(n,!0),n+=8):t==="String"&&(i=String.fromCharCode(e.getUint8(n)),n+=1);return{value:i,offset:n}};__.prototype._parseHeader=function(e){let t=0;this._header={};for(let n=0;n<this._storageInfo.header.length;n++){let i=this._storageInfo.header[n],r=this._parseValue(e,i.valueType,t);this._header[i.property]=r.value,t=r.offset}return t};__.prototype._parseBody=function(e,t){this._values={};for(let n=0;n<this._storageInfo.ordering.length;n++){let i=this._storageInfo.ordering[n],r=i==="ObjectIds"?"objectIds":i,o=this._storageInfo[r];if(l(o)){this._values[r]=[];for(let s=0;s<this._header.count;++s)if(o.valueType!=="String"){let a=this._parseValue(e,o.valueType,t);this._values[r].push(a.value),t=a.offset}else{let a=this._values.attributeByteCounts[s],c="";for(let u=0;u<a;++u){let f=this._parseValue(e,o.valueType,t);f.value.charCodeAt(0)!==0&&(c+=f.value),t=f.offset}this._values[r].push(c)}}}};__.prototype._getBodyOffset=function(e){let t=0;return l(this._storageInfo.attributeValues)?t=I7(this._storageInfo.attributeValues.valueType):l(this._storageInfo.objectIds)&&(t=I7(this._storageInfo.objectIds.valueType)),t>0?Math.ceil(e/t)*t:e};__.prototype._validateHeader=function(e){let t=0;for(let n=0;n<this._storageInfo.header.length;n++){let i=this._storageInfo.header[n];t+=Ijt(i.valueType)}if(e.byteLength<t)throw new oe(`Invalid attribute buffer size (field: ${this.name}, header: ${t}, actual: ${e.byteLength})`)};__.prototype._validateBody=function(e,t){if(!l(this._header.count))throw new oe(`Invalid attribute buffer (field: ${this.name}, count is missing)`);let n;for(let i=0;i<this._storageInfo.ordering.length&&t<e.byteLength;i++){let r=this._storageInfo.ordering[i],o=r==="ObjectIds"?"objectIds":r,s=this._storageInfo[o];if(l(s))if(s.valueType!=="String"){o==="attributeByteCounts"&&(n=t);let a=I7(s.valueType);t+=a*this._header.count}else{if(!l(n))throw new oe(`Invalid attribute buffer (field: ${this.name}, attributeByteCounts is missing)`);for(let a=0;a<this._header.count&&t<e.byteLength;++a){let c=this._parseValue(e,this._storageInfo.attributeByteCounts.valueType,n);t+=c.value,n=c.offset}}else throw new oe(`Invalid attribute buffer (field: ${this.name}, ${o} is missing)`)}if(e.byteLength<t)throw new oe(`Invalid attribute buffer size (field: ${this.name}, expected: ${t}, actual: ${e.byteLength})`)};var P7=__;function UM(e,t){let n=e._dataProvider,i=e._layer,r;l(e._nodeIndex)?r=i.resource.getDerivedResource({url:`nodes/${e._data.mesh.geometry.resource}/${t}`}):r=e.resource.getDerivedResource({url:t}),this._parent=e,this._dataProvider=n,this._layer=i,this._resource=r,this._customAttributes=void 0}Object.defineProperties(UM.prototype,{resource:{get:function(){return this._resource}},data:{get:function(){return this._data}},customAttributes:{get:function(){return this._customAttributes}}});UM.prototype.load=function(){let e=this;return this._dataProvider._loadBinary(this._resource).then(function(t){return e._data=t,t})};var Djt=new h,Rjt=new h,Ojt=new h,Mjt=new h,Njt=new h;function cae(e,t,n,i){let r=h.subtract(i,n,Djt),o=h.cross(r,h.subtract(e,n,Rjt),Mjt),s=h.cross(r,h.subtract(t,n,Ojt),Njt);return h.dot(o,s)>=0}var Ljt=new h,Fjt=new h,Bjt=new h,kjt=new h,Ujt=new h,zjt=new h,Vjt=new h,jjt=new h,Hjt=new h,Gjt=new h;UM.prototype.getClosestPointIndexOnTriangle=function(e,t,n){if(l(this._customAttributes)&&l(this._customAttributes.positions)){let i=new h(e,t,n);i.x-=this._customAttributes.cartesianCenter.x,i.y-=this._customAttributes.cartesianCenter.y,i.z-=this._customAttributes.cartesianCenter.z,$.multiplyByVector(this._customAttributes.parentRotation,i,i);let r=Number.MAX_VALUE,o,s,a,c,u=this._customAttributes.positions,f=this._customAttributes.indices,d;l(f)?d=f.length:d=u.length/3;for(let p=0;p<d;p++){let g,m,y;l(f)?(g=f[p],m=f[p+1],y=f[p+2]):(g=p*3,m=p*3+1,y=p*3+2);let A=h.fromElements(u[g*3],u[g*3+1],u[g*3+2],Ljt),b=h.fromElements(u[m*3],u[m*3+1],u[m*3+2],Fjt),x=new h(u[y*3],u[y*3+1],u[y*3+2],Bjt);if(!cae(i,A,b,x)||!cae(i,b,A,x)||!cae(i,x,A,b))continue;let T=h.subtract(b,A,kjt),E=h.subtract(x,A,Ujt),v=h.cross(T,E,zjt);if(h.magnitude(v)===0)continue;let S=h.normalize(v,Vjt),I=h.subtract(i,A,jjt),R=Math.abs(h.dot(I,S));if(R<r){r=R,o=p;let O=h.magnitudeSquared(h.subtract(i,A,I)),L=h.magnitudeSquared(h.subtract(i,b,Hjt)),_=h.magnitudeSquared(h.subtract(i,x,Gjt));O<L&&O<_?(a=g,c=A,s=O):L<_?(a=m,c=b,s=L):(a=y,c=x,s=_)}}if(l(o))return{index:a,distanceSquared:s,distance:Math.sqrt(s),queriedPosition:i,closestPosition:h.clone(c)}}return{index:-1,distanceSquared:Number.Infinity,distance:Number.Infinity}};function zBe(e){let t=[],n=e.length;for(let i=0;i<n;i++)i<3?t.push(TI(e[i])):t.push(e[i]);return t}UM.prototype._generateGltf=function(e,t,n,i,r,o,s,a){let c={pbrMetallicRoughness:{metallicFactor:0},doubleSided:!0,name:"Material"},u=!1,f,d="";if(l(this._parent._data.mesh)&&l(this._layer._data.materialDefinitions)){let T=this._parent._data.mesh.material.definition;if(T>=0&&T<this._layer._data.materialDefinitions.length){if(f=this._layer._data.materialDefinitions[T],c=f,l(c.pbrMetallicRoughness)&&l(c.pbrMetallicRoughness.baseColorTexture)){u=!0,c.pbrMetallicRoughness.baseColorTexture.index=0;let E="0";if(l(this._layer._data.textureSetDefinitions))for(let v=0;v<this._layer._data.textureSetDefinitions.length;v++){let S=this._layer._data.textureSetDefinitions[v];for(let I=0;I<S.formats.length;I++){let R=S.formats[I];if(R.format==="jpg"){E=R.name;break}}}l(this._parent._data.mesh)&&this._parent._data.mesh.material.resource>=0&&(d=this._layer.resource.getDerivedResource({url:`nodes/${this._parent._data.mesh.material.resource}/textures/${E}`}).url)}l(c.pbrMetallicRoughness)&&l(c.pbrMetallicRoughness.baseColorFactor)&&(c.pbrMetallicRoughness.baseColorFactor=zBe(c.pbrMetallicRoughness.baseColorFactor)),l(c.emissiveFactor)&&(c.emissiveFactor=zBe(c.emissiveFactor))}}else l(this._parent._data.textureData)&&(u=!0,d=this._parent.resource.getDerivedResource({url:`${this._parent._data.textureData[0].href}`}).url,c.pbrMetallicRoughness.baseColorTexture={index:0});l(c.alphaMode)&&(c.alphaMode=c.alphaMode.toUpperCase());let p=[],g=[],m=[];u&&(p=[{sampler:0,source:0}],g=[{uri:d}],m=[{magFilter:9729,minFilter:9986,wrapS:10497,wrapT:10497}]);let y=[],A=n.length;for(let x=0;x<A;x++){let T=n[x].primitives,E=T.length;for(let v=0;v<E;v++){let S=T[v];if(l(S.material)){for(;S.material>=y.length;){let R=Ze(c,!0);y.push(R)}let I=y[S.material];l(S.extra)&&S.extra.isTransparent?l(I.alphaMode)||(I.alphaMode="BLEND"):I.alphaMode==="BLEND"&&(I.alphaMode="OPAQUE")}}}return{scene:0,scenes:[{nodes:e}],nodes:t,meshes:n,buffers:i,bufferViews:r,accessors:o,materials:y,textures:p,images:g,samplers:m,asset:{version:"2.0"},extensions:s,extensionsUsed:a}};var zM=UM;function pl(e,t,n){let i,r,o,s;n?(i=0,r=e):(i=e._level+1,r=e._layer),typeof t=="number"?o=t:s=e.resource.getDerivedResource({url:`${t}/`}),this._parent=e,this._dataProvider=e._dataProvider,this._isRoot=n,this._level=i,this._layer=r,this._nodeIndex=o,this._resource=s,this._isLoading=!1,this._tile=void 0,this._data=void 0,this._geometryData=[],this._featureData=[],this._fields={},this._children=[],this._childrenReadyPromise=void 0,this._globalTransform=void 0,this._inverseGlobalTransform=void 0,this._inverseRotationMatrix=void 0,this._symbologyData=void 0}Object.defineProperties(pl.prototype,{resource:{get:function(){return this._resource}},layer:{get:function(){return this._layer}},parent:{get:function(){return this._parent}},children:{get:function(){return this._children}},geometryData:{get:function(){return this._geometryData}},featureData:{get:function(){return this._featureData}},fields:{get:function(){return this._fields}},tile:{get:function(){return this._tile}},data:{get:function(){return this._data}}});pl.prototype.load=async function(){let e=this;function t(){if(!e._isRoot){let r=e._create3DTileDefinition();e._tile=new Wh(e._layer._tileset,e._dataProvider.resource,r,e._parent._tile),e._tile._i3sNode=e}}if(!l(this._nodeIndex)){let r=await E0.loadJson(this._resource);e._data=r,t();return}let n=await this._layer._getNodeInNodePages(this._nodeIndex);e._data=n;let i;e._isRoot?i="nodes/root/":l(n.mesh)&&(i=`../${n.mesh.geometry.resource}/`),l(i)&&l(e._parent.resource)&&(e._resource=e._parent.resource.getDerivedResource({url:i})),t()};function VBe(e,t){let n=new P7(e,t);return e._fields[t.name]=n,n.load()}pl.prototype.loadFields=function(){let e=this._layer._data.attributeStorageInfo,t=[];if(l(e))for(let n=0;n<e.length;n++){let i=e[n],r=this._fields[i.name];l(r)?t.push(r.load()):t.push(VBe(this,i))}return Promise.all(t)};pl.prototype.loadField=function(e){let t=this._fields[e];if(l(t))return t.load();let n=this._layer._data.attributeStorageInfo;if(l(n))for(let i=0;i<n.length;i++){let r=n[i];if(r.name===e)return VBe(this,r)}return Promise.resolve()};pl.prototype.getFieldsForPickedPosition=function(e){let t=this.geometryData[0];if(!l(t.customAttributes.featureIndex))return{};let n=t.getClosestPointIndexOnTriangle(e.x,e.y,e.z);if(n.index===-1||n.index>t.customAttributes.featureIndex.length)return{};let i=t.customAttributes.featureIndex[n.index];return this.getFieldsForFeature(i)};pl.prototype.getFieldsForFeature=function(e){let t={};for(let n in this.fields)if(this.fields.hasOwnProperty(n)){let i=this.fields[n];e>=0&&e<i.values.length&&(t[i.name]=i.values[e])}return t};pl.prototype._loadChildren=function(){let e=this;if(l(this._childrenReadyPromise))return this._childrenReadyPromise;let t=[];if(l(e._data.children))for(let n=0;n<e._data.children.length;n++){let i=e._data.children[n],r=new pl(e,i.href??i,!1);e._children.push(r),t.push(r.load())}return this._childrenReadyPromise=Promise.all(t).then(function(){for(let n=0;n<e._children.length;n++)e._tile.children.push(e._children[n]._tile)}),this._childrenReadyPromise};pl.prototype._loadGeometryData=function(){let e=[];if(l(this._data.geometryData))for(let t=0;t<this._data.geometryData.length;t++){let n=new zM(this,this._data.geometryData[t].href);this._geometryData.push(n),e.push(n.load())}else if(l(this._data.mesh)){let t=this._layer._findBestGeometryBuffers(this._data.mesh.geometry.definition,["position","uv0"]),n=`./geometries/${t.bufferIndex}/`,i=new zM(this,n);i._geometryDefinitions=t.definition,i._geometryBufferInfo=t.geometryBufferInfo,this._geometryData.push(i),e.push(i.load())}return Promise.all(e)};pl.prototype._loadFeatureData=function(){let e=[];if(l(this._data.featureData))for(let t=0;t<this._data.featureData.length;t++){let n=new w7(this,this._data.featureData[t].href);this._featureData.push(n),e.push(n.load())}return Promise.all(e)};pl.prototype._clearGeometryData=function(){this._geometryData=[]};pl.prototype._create3DTileDefinition=function(){let e=this._data.obb,t=this._data.mbs;if(!l(e)&&!l(t)){console.error("Failed to load I3S node. Bounding volume is required.");return}let n;if(l(e)?n=he.fromDegrees(e.center[0],e.center[1],e.center[2]):n=he.fromDegrees(t[0],t[1],t[2]),l(this._dataProvider._geoidDataList)&&l(n))for(let b=0;b<this._dataProvider._geoidDataList.length;b++){let x=this._dataProvider._geoidDataList[b],T=x.projection.project(n);if(T.x>x.nativeExtent.west&&T.x<x.nativeExtent.east&&T.y>x.nativeExtent.south&&T.y<x.nativeExtent.north){n.height+=Xjt(T.x,T.y,x);break}}let i,r,o;l(e)?(i={box:[0,0,0,e.halfSize[0],0,0,0,e.halfSize[1],0,0,0,e.halfSize[2]]},o=Math.max(Math.max(this._data.obb.halfSize[0],this._data.obb.halfSize[1]),this._data.obb.halfSize[2]),r=ee.WGS84.cartographicToCartesian(n)):(i={sphere:[0,0,0,t[3]]},r=ee.WGS84.cartographicToCartesian(n),o=this._data.mbs[3]),o*=2;let s=1/0;if(l(this._data.lodThreshold))if(this._layer._data.nodePages.lodSelectionMetricType==="maxScreenThresholdSQ"){let b=Math.sqrt(this._data.lodThreshold/(Math.PI*.25));s=o/b}else if(this._layer._data.nodePages.lodSelectionMetricType==="maxScreenThreshold"){let b=this._data.lodThreshold;s=o/b}else console.error("Invalid lodSelectionMetricType in Layer");else if(l(this._data.lodSelection))for(let b=0;b<this._data.lodSelection.length;b++)this._data.lodSelection[b].metricType==="maxScreenThreshold"&&(s=o/this._data.lodSelection[b].maxError);s===1/0&&(s=1e5);let a=s*16,c=new kc(0,0,0),u=At.headingPitchRollQuaternion(r,c);l(this._data.obb)&&(u=new Le(this._data.obb.quaternion[0],this._data.obb.quaternion[1],this._data.obb.quaternion[2],this._data.obb.quaternion[3]));let f=$.fromQuaternion(u),d=$.inverse(f,new $),p=new M(f[0],f[1],f[2],0,f[3],f[4],f[5],0,f[6],f[7],f[8],0,r.x,r.y,r.z,1),g=M.inverse(p,new M),m=M.clone(p);l(this._parent._globalTransform)&&M.multiply(p,this._parent._inverseGlobalTransform,m),this._globalTransform=p,this._inverseGlobalTransform=g,this._inverseRotationMatrix=d;let y=[];for(let b=0;b<this._children.length;b++)y.push(this._children[b]._create3DTileDefinition());return{children:y,refine:"REPLACE",boundingVolume:i,transform:[m[0],m[4],m[8],m[12],m[1],m[5],m[9],m[13],m[2],m[6],m[10],m[14],m[3],m[7],m[11],m[15]],content:{uri:l(this._resource)?this._resource.url:void 0},geometricError:a}};pl.prototype._loadSymbology=async function(){!l(this._symbologyData)&&l(this._layer._symbology)&&(this._symbologyData=await this._layer._symbology._getSymbology(this))};pl.prototype._createContentURL=async function(){let e={scene:0,scenes:[{nodes:[0]}],nodes:[{name:"singleNode"}],meshes:[],buffers:[],bufferViews:[],accessors:[],materials:[],textures:[],images:[],samplers:[],asset:{version:"2.0"}},t=[this._loadGeometryData()];if(this._dataProvider.legacyVersion16&&t.push(this._loadFeatureData()),await Promise.all(t),l(this._geometryData)&&this._geometryData.length>0){this._dataProvider._applySymbology&&await this._loadSymbology();let r=this._geometryData[0].resource.url,o=this._layer._data.store.defaultGeometrySchema,s=this._geometryData[0],a=await S7.decode(r,o,s,this._featureData[0],this._symbologyData);if(!l(a))return;e=s._generateGltf(a.meshData.nodesInScene,a.meshData.nodes,a.meshData.meshes,a.meshData.buffers,a.meshData.bufferViews,a.meshData.accessors,a.meshData.rootExtensions,a.meshData.extensionsUsed),this._geometryData[0]._customAttributes=a.meshData._customAttributes}let n=this._dataProvider._binarizeGltf(e),i=new Blob([n],{type:"application/binary"});return URL.createObjectURL(i)};async function Wjt(e){let t=e._layer._filters,n=[];for(let i=0;i<t.length;i++){let r=e.loadField(t[i].name);n.push(r)}return await Promise.all(n),t}function qjt(e,t,n){if(!l(n.values)||n.values.length===0)return!1;let i=l(t)?t.values:[],r;e<i.length&&(r=i[e]);let o=!1;for(let s=0;s<n.values.length;s++)if(n.values[s]===r){o=!0;break}return o}async function jBe(e,t){let n=e._tile.content.batchTable;if(l(n)&&n.featuresLength>0){n.setAllShow(!0);let i=await Wjt(e);if(i.length>0)for(let r=0;r<n.featuresLength;r++)for(let o=0;o<i.length;o++){let s=i[o];if(!qjt(r,e._fields[s.name],s)){n.setShow(r,!1);break}}}t.show=!0}pl.prototype._filterFeatures=function(){let e=[];for(let n=0;n<this._children.length;n++){let i=this._children[n]._filterFeatures();e.push(i)}let t=this._tile?.content?._model;if(l(this._geometryData)&&this._geometryData.length>0&&l(t)&&t.ready){t.show=!1;let n=jBe(this,t);e.push(n)}return Promise.all(e)};Wh.prototype._hookedRequestContent=Wh.prototype.requestContent;Wh.prototype.requestContent=function(){if(!this.tileset._isI3STileSet)return this._hookedRequestContent();if(!this._isLoading){this._isLoading=!0;let e=this;return this._i3sNode._createContentURL().then(t=>{if(!l(t)){e._isLoading=!1;return}return e._contentResource=new De({url:t}),e._hookedRequestContent()}).then(t=>{let n=t?._model;return l(e._i3sNode._geometryData)&&e._i3sNode._geometryData.length>0&&l(n)&&(n.show=!1,n.readyEvent.addEventListener(()=>{jBe(e._i3sNode,n)})),e._isLoading=!1,t})}};function Yjt(e,t,n,i,r,o){let s=n*(1-e)+i*e,a=r*(1-e)+o*e;return s*(1-t)+a*t}function D7(e,t,n,i){let r=e+t*n;return i[r]}function Xjt(e,t,n){let i=n.nativeExtent,r=(e-i.west)/(i.east-i.west)*(n.width-1),o=(t-i.south)/(i.north-i.south)*(n.height-1),s=Math.floor(r),a=Math.floor(o);r-=s,o-=a;let c=s<n.width?s+1:s,u=a<n.height?a+1:a;a=n.height-1-a,u=n.height-1-u;let f=D7(s,a,n.width,n.buffer),d=D7(c,a,n.width,n.buffer),p=D7(s,u,n.width,n.buffer),g=D7(c,u,n.width,n.buffer),m=Yjt(r,o,f,d,p,g);return m=m*n.scale+n.offset,m}Object.defineProperties(Wh.prototype,{i3sNode:{get:function(){return this._i3sNode}}});var VM=pl;function R7(e){this._layer=e,this._defaultSymbology=void 0,this._valueFields=[],this._uniqueValueHash=void 0,this._classBreaksHash=void 0,this._parseLayerSymbology()}Object.defineProperties(R7.prototype,{defaultSymbology:{get:function(){return this._defaultSymbology}}});function lae(e,t){let n=[];for(let i=0;i<e.length;i++){let r=z.byteToFloat(e[i]);i<3?n.push(TI(r)):n.push(r)}return n.length===3&&(l(t)?n.push(1-t/100):n.push(1)),n}function vI(e,t){let n={edges:void 0,material:void 0};if(l(e)&&l(e.symbolLayers))for(let i=0;i<e.symbolLayers.length;i++){let r=e.symbolLayers[i];if(r.type==="Fill"){let o=r.edges,s=r.outline;if(l(o)?(n.edges={},l(o.color)&&(n.edges.color=lae(o.color,o.transparency))):l(s)&&(n.edges={},l(s.color)&&(n.edges.color=lae(s.color,s.transparency))),!t){let a=r.material;l(a)&&(n.material={colorMixMode:a.colorMixMode},l(a.color)&&(n.material.color=lae(a.color,a.transparency)))}break}}return n}function Kjt(e,t){if(l(e.uniqueValueGroups)){let n={};for(let i=0;i<e.uniqueValueGroups.length;i++){let r=e.uniqueValueGroups[i].classes;if(l(r))for(let o=0;o<r.length;o++){let s=vI(r[o].symbol,t),a=r[o].values;for(let c=0;c<a.length;c++){let u=a[c],f=n;for(let d=0;d<u.length;d++){let p=u[d];d===u.length-1?f[p]=s:(l(f[p])||(f[p]={}),f=f[p])}}}}return n}if(l(e.uniqueValueInfos)){let n={};for(let i=0;i<e.uniqueValueInfos.length;i++){let r=e.uniqueValueInfos[i];n[r.value]=vI(r.symbol,t)}return n}}function $jt(e,t){if(l(e.classBreakInfos)){let n=[...e.classBreakInfos];n.sort(function(r,o){let s=r.classMaxValue??r.classMinValue,a=o.classMaxValue??o.classMinValue;return s-a});let i={ranges:[],symbols:[]};l(e.minValue)&&(i.ranges.push(e.minValue),i.symbols.push(void 0));for(let r=0;r<n.length;r++){let o=n[r];l(o.classMinValue)&&(i.ranges.length===0||o.classMinValue>i.ranges[i.ranges.length-1])&&(i.ranges.push(o.classMinValue),i.symbols.push(void 0)),l(o.classMaxValue)&&(i.ranges.length===0||o.classMaxValue>i.ranges[i.ranges.length-1])&&(i.ranges.push(o.classMaxValue),i.symbols.push(vI(o.symbol,t)))}return i.symbols.push(void 0),i}}R7.prototype._parseLayerSymbology=function(){let e=this._layer.data.drawingInfo;if(l(e)&&l(e.renderer)){let t=this._layer.data.cachedDrawingInfo,n=l(t)&&t.color===!0,i=e.renderer;i.type==="simple"?this._defaultSymbology=vI(i.symbol,n):i.type==="uniqueValue"?(this._defaultSymbology=vI(i.defaultSymbol,n),this._valueFields.push(i.field1),l(i.field2)&&this._valueFields.push(i.field2),l(i.field3)&&this._valueFields.push(i.field3),this._uniqueValueHash=Kjt(i,n)):i.type==="classBreaks"&&(this._defaultSymbology=vI(i.defaultSymbol,n),this._valueFields.push(i.field),this._classBreaksHash=$jt(i,n))}};function HBe(e,t,n,i){let r=t[n];if(i<r.length){let o=r[i],s=e[o];return l(s)&&++n<t.length?HBe(s,t,n,i):s}}function Jjt(e,t){let n=0,i=e.length;if(n<i)do{let r=n+i>>>1;e[r]<t?n=r+1:i=r}while(n<i);return n}function Zjt(e,t,n){let i=t[n],r=Jjt(e.ranges,i);return e.symbols[r]}R7.prototype._getSymbology=async function(e){let t={default:this._defaultSymbology};if(this._valueFields.length>0){let n=[];for(let o=0;o<this._valueFields.length;o++)n.push(e.loadField(this._valueFields[o]));await Promise.all(n);let i=[];for(let o=0;o<this._valueFields.length;o++)i.push(e.fields[this._valueFields[o]].values);let r;if(l(this._uniqueValueHash)?r=o=>HBe(this._uniqueValueHash,i,0,o):l(this._classBreaksHash)&&(r=o=>Zjt(this._classBreaksHash,i[0],o)),l(r)){let o=i[0];for(let s=0;s<o.length;s++){let a=r(s);l(a)&&(t[s]=a)}}}return t};var O7=R7;function Zu(e,t,n){this._dataProvider=e,this._parent=n,!l(t.href)&&l(t.id)&&(t.href=`layers/${t.id}`);let i=this._parent.resource.getUrlComponent(),r;i.match(/layers\/\d/)?r=`${i}`.replace(/\/+$/,""):r=`${i}`.replace(/\/?$/,"/").concat(`${t.href}`),this._version=t.store.version;let o=this._version.split(".");this._majorVersion=parseInt(o[0]),this._minorVersion=o.length>1?parseInt(o[1]):0,this._resource=new De({url:r}),this._resource.setQueryParameters(this._dataProvider.resource.queryParameters),this._resource.appendForwardSlash(),this._data=t,this._rootNode=void 0,this._nodePages={},this._nodePageFetches={},this._extent=void 0,this._tileset=void 0,this._geometryDefinitions=void 0,this._filters=[],this._symbology=void 0,this._computeGeometryDefinitions(!0),this._computeExtent()}Object.defineProperties(Zu.prototype,{resource:{get:function(){return this._resource}},rootNode:{get:function(){return this._rootNode}},tileset:{get:function(){return this._tileset}},data:{get:function(){return this._data}},version:{get:function(){return this._version}},majorVersion:{get:function(){return this._majorVersion}},minorVersion:{get:function(){return this._minorVersion}},legacyVersion16:{get:function(){if(l(this.version))return this.majorVersion<1||this.majorVersion===1&&this.minorVersion<=6}}});Zu.prototype.load=async function(e){if(this._data.spatialReference.wkid!==4326)throw new oe(`Unsupported spatial reference: ${this._data.spatialReference.wkid}`);if(this._dataProvider.applySymbology&&(this._symbology=new O7(this)),await this._dataProvider.loadGeoidData(),await this._loadRootNode(e),await this._create3DTileset(e),this._rootNode._tile=this._tileset._root,this._tileset._root._i3sNode=this._rootNode,this.legacyVersion16)return this._rootNode._loadChildren()};Zu.prototype._computeGeometryDefinitions=function(e){if(this._geometryDefinitions=[],l(this._data.geometryDefinitions))for(let t=0;t<this._data.geometryDefinitions.length;t++){let n=[],i=this._data.geometryDefinitions[t].geometryBuffers;for(let r=0;r<i.length;r++){let o=i[r],s=[],a=!1;if(l(o.compressedAttributes)&&e){a=!0;let c=o.compressedAttributes.attributes;for(let u=0;u<c.length;u++)s.push(c[u])}else for(let c in o)c!=="offset"&&s.push(c);n.push({compressed:a,attributes:s,index:i.indexOf(o)})}n.sort(function(r,o){return r.compressed&&!o.compressed?-1:!r.compressed&&o.compressed?1:r.attributes.length-o.attributes.length}),this._geometryDefinitions.push(n)}};Zu.prototype._findBestGeometryBuffers=function(e,t){let n=this._geometryDefinitions[e];if(l(n)){for(let i=0;i<n.length;++i){let r=n[i],o=!1,s=r.attributes;for(let a=0;a<t.length;a++)if(!s.includes(t[a])){o=!0;break}if(!o)return{bufferIndex:r.index,definition:n,geometryBufferInfo:r}}if(l(n[0]))return{bufferIndex:0,definition:n,geometryBufferInfo:n[0]}}};Zu.prototype._loadRootNode=function(e){if(l(this._data.nodePages)){let t=0;l(this._data.nodePages.rootIndex)&&(t=this._data.nodePages.rootIndex),this._rootNode=new VM(this,t,!0)}else this._rootNode=new VM(this,this._data.store.rootNode,!0);return this._rootNode.load(e)};Zu.prototype._getNodeInNodePages=function(e){let t=Math.floor(e/this._data.nodePages.nodesPerPage),n=e%this._data.nodePages.nodesPerPage;return this._loadNodePage(t).then(function(i){return i.nodes[n]})};Zu._fetchJson=function(e){return e.fetchJson()};Zu.prototype._loadNodePage=function(e){let t=this;if(!l(this._nodePageFetches[e])){let n=this.resource.getDerivedResource({url:`nodepages/${e}/`}),i=Zu._fetchJson(n).then(function(r){return l(r.error)&&r.error.code!==200?Promise.reject(r.error):(t._nodePages[e]=r.nodes,r)});this._nodePageFetches[e]=i}return this._nodePageFetches[e]};Zu.prototype._computeExtent=function(){l(this._data.fullExtent)?this._extent=ie.fromDegrees(this._data.fullExtent.xmin,this._data.fullExtent.ymin,this._data.fullExtent.xmax,this._data.fullExtent.ymax):l(this._data.store.extent)&&(this._extent=ie.fromDegrees(this._data.store.extent[0],this._data.store.extent[1],this._data.store.extent[2],this._data.store.extent[3]))};Zu.prototype._create3DTileset=async function(e){let t={asset:{version:"1.0"},geometricError:Number.MAX_VALUE,root:this._rootNode._create3DTileDefinition()},n=new Blob([JSON.stringify(t)],{type:"application/json"}),i=URL.createObjectURL(n),r=this._symbology?.defaultSymbology?.edges?.color;l(r)&&!l(e?.outlineColor)&&(e=l(e)?Ze(e):{},e.outlineColor=z.fromCartesian4(se.fromArray(r))),this._tileset=await Zo.fromUrl(i,e),this._tileset.show=this._parent.show,this._tileset._isI3STileSet=!0,this._tileset.tileUnload.addEventListener(function(o){o._i3sNode._clearGeometryData(),URL.revokeObjectURL(o._contentResource._url),o._contentResource=o._i3sNode.resource}),this._tileset.tileVisible.addEventListener(function(o){l(o._i3sNode)&&o._i3sNode._loadChildren()})};Zu.prototype._updateVisibility=function(){l(this._tileset)&&(this._tileset.show=this._parent.show)};Zu.prototype.filterByAttributes=function(e){this._filters=l(e)?Ze(e,!0):[];let t=this._rootNode;return l(t)?t._filterFeatures():Promise.resolve()};var SI=Zu;function M7(e,t){this._dataProvider=e,this._resource=new De({url:t}),this._resource.setQueryParameters(e.resource.queryParameters),this._resource.appendForwardSlash()}Object.defineProperties(M7.prototype,{resource:{get:function(){return this._resource}},data:{get:function(){return this._data}},names:{get:function(){let e=[],t=this._data.summary;if(l(t))for(let n=0;n<t.length;++n)e.push(t[n].fieldName);return e}}});M7.prototype.load=async function(){return this._data=await E0.loadJson(this._resource),this._data};M7.prototype._getValues=function(e){let t=this._data.summary;if(l(t))for(let n=0;n<t.length;++n){let i=t[n];if(i.fieldName===e)return l(i.mostFrequentValues)?[...i.mostFrequentValues]:[]}};var N7=M7;function jM(e,t,n){this._dataProvider=e,this._parent=t,this._data=n,this._name=n.name,this._modelName=n.modelName,this._visibility=n.visibility??!0,this._resource=void 0,this._sublayers=[],this._i3sLayers=[]}Object.defineProperties(jM.prototype,{resource:{get:function(){return this._resource}},data:{get:function(){return this._data}},name:{get:function(){return this._name}},modelName:{get:function(){return this._modelName}},sublayers:{get:function(){return this._sublayers}},visibility:{get:function(){return this._visibility},set:function(e){if(this._visibility!==e){this._visibility=e;for(let t=0;t<this._i3sLayers.length;t++)this._i3sLayers[t]._updateVisibility()}}},show:{get:function(){return this._visibility&&this._parent.show}}});jM._fromData=async function(e,t,n,i){let r=new jM(e,i,n);if(r._data.layerType==="group"){let o=r._data.sublayers;if(l(o)){let s=[];for(let c=0;c<o.length;c++){let u=jM._fromData(e,t,o[c],r);s.push(u)}let a=await Promise.all(s);for(let c=0;c<a.length;c++){let u=a[c];r._sublayers.push(u),r._i3sLayers.push(...u._i3sLayers)}}}else if(r._data.layerType==="3DObject"){let o=t.concat(`/sublayers/${r._data.id}`),s=new De({url:o});s.setQueryParameters(e.resource.queryParameters),s.appendForwardSlash(),r._resource=s;let a=await E0.loadJson(r._resource),c=new SI(e,a,r);r._i3sLayers.push(c)}else console.log(`${r._data.layerType} layer ${r._data.name} is skipped as not supported.`);return r};var L7=jM;var qBe=js(GBe(),1);function ta(e){e=e??H.EMPTY_OBJECT,this._name=e.name,this._show=e.show??!0,this._geoidTiledTerrainProvider=e.geoidTiledTerrainProvider,this._showFeatures=e.showFeatures??!1,this._adjustMaterialAlphaMode=e.adjustMaterialAlphaMode??!1,this._applySymbology=e.applySymbology??!1,this._calculateNormals=e.calculateNormals??!1,this._cesium3dTilesetOptions=e.cesium3dTilesetOptions??H.EMPTY_OBJECT,this._layers=[],this._sublayers=[],this._data=void 0,this._extent=void 0,this._geoidDataPromise=void 0,this._geoidDataList=void 0,this._decoderTaskProcessor=void 0,this._taskProcessorReadyPromise=void 0,this._attributeStatistics=[],this._layersExtent=[]}Object.defineProperties(ta.prototype,{name:{get:function(){return this._name}},show:{get:function(){return this._show},set:function(e){if(this._show!==e){this._show=e;for(let t=0;t<this._layers.length;t++)this._layers[t]._updateVisibility()}}},geoidTiledTerrainProvider:{get:function(){return this._geoidTiledTerrainProvider}},layers:{get:function(){return this._layers}},sublayers:{get:function(){return this._sublayers}},data:{get:function(){return this._data}},extent:{get:function(){return this._extent}},resource:{get:function(){return this._resource}},showFeatures:{get:function(){return this._showFeatures}},adjustMaterialAlphaMode:{get:function(){return this._adjustMaterialAlphaMode}},applySymbology:{get:function(){return this._applySymbology}},calculateNormals:{get:function(){return this._calculateNormals}}});ta.prototype.destroy=function(){for(let e=0;e<this._layers.length;e++)l(this._layers[e]._tileset)&&this._layers[e]._tileset.destroy();return le(this)};ta.prototype.isDestroyed=function(){return!1};ta.prototype.update=function(e){for(let t=0;t<this._layers.length;t++)l(this._layers[t]._tileset)&&this._layers[t]._tileset.update(e)};ta.prototype.prePassesUpdate=function(e){for(let t=0;t<this._layers.length;t++)l(this._layers[t]._tileset)&&this._layers[t]._tileset.prePassesUpdate(e)};ta.prototype.postPassesUpdate=function(e){for(let t=0;t<this._layers.length;t++)l(this._layers[t]._tileset)&&this._layers[t]._tileset.postPassesUpdate(e)};ta.prototype.updateForPass=function(e,t){for(let n=0;n<this._layers.length;n++)l(this._layers[n]._tileset)&&this._layers[n]._tileset.updateForPass(e,t)};function Qjt(e,t){let n=e.resource.getUrlComponent(),i;return n.match(/layers\/\d/)?i=`${n}`.replace(/\/+$/,""):i=`${n}`.replace(/\/?$/,"/").concat(`layers/${t}`),i}async function WBe(e,t,n){if(t.layerType==="Building"){l(n.showFeatures)||(e._showFeatures=!0),l(n.adjustMaterialAlphaMode)||(e._adjustMaterialAlphaMode=!0),l(n.applySymbology)||(e._applySymbology=!0),l(n.calculateNormals)||(e._calculateNormals=!0);let i=Qjt(e,t.id);if(l(t.sublayers)){let r=[];for(let s=0;s<t.sublayers.length;s++){let a=L7._fromData(e,i,t.sublayers[s],e);r.push(a)}let o=await Promise.all(r);for(let s=0;s<o.length;s++){let a=o[s];e._sublayers.push(a),e._layers.push(...a._i3sLayers)}}if(l(t.statisticsHRef)){let r=i.concat(`/${t.statisticsHRef}`),o=new N7(e,r);await o.load(),e._attributeStatistics.push(o)}if(l(t.fullExtent)){let r=ie.fromDegrees(t.fullExtent.xmin,t.fullExtent.ymin,t.fullExtent.xmax,t.fullExtent.ymax);e._layersExtent.push(r)}}else if(t.layerType==="3DObject"||t.layerType==="IntegratedMesh"){!l(n.calculateNormals)&&!l(t.textureSetDefinitions)&&(e._calculateNormals=!0);let i=new SI(e,t,e);e._layers.push(i),l(i._extent)&&e._layersExtent.push(i._extent)}else console.log(`${t.layerType} layer ${t.name} is skipped as not supported.`)}ta.fromUrl=async function(e,t){t=t??H.EMPTY_OBJECT;let n=De.createIfNeeded(e);n.setQueryParameters({f:"pjson"},!0);let i=await ta.loadJson(n),r=new ta(t);if(r._resource=n,r._data=i,l(i.layers)){let s=[];for(let a=0;a<i.layers.length;a++){let c=WBe(r,i.layers[a],t);s.push(c)}await Promise.all(s)}else await WBe(r,i,t);r._computeExtent();let o=[];for(let s=0;s<r._layers.length;s++)o.push(r._layers[s].load(t.cesium3dTilesetOptions));return await Promise.all(o),r};ta._fetchJson=function(e){return e.fetchJson()};ta.loadJson=async function(e){let t=await ta._fetchJson(e);if(l(t.error)){if(console.error("Failed to fetch I3S ",e.url),l(t.error.message)&&console.error(t.error.message),l(t.error.details))for(let n=0;n<t.error.details.length;n++)console.log(t.error.details[n]);throw new oe(t.error)}return t};ta.prototype._loadBinary=async function(e){let t=await e.fetchArrayBuffer();if(t.byteLength>0&&new Uint8Array(t)[0]===123&&new TextDecoder().decode(t).includes("404"))throw new oe(`Failed to load binary: ${e.url}`);return t};ta.prototype._binarizeGltf=function(e){let n=new TextEncoder().encode(JSON.stringify(e)),i=new Uint8Array(n.byteLength+20),r={magic:new Uint8Array(i.buffer,0,4),version:new Uint32Array(i.buffer,4,1),length:new Uint32Array(i.buffer,8,1),chunkLength:new Uint32Array(i.buffer,12,1),chunkType:new Uint32Array(i.buffer,16,1),chunkData:new Uint8Array(i.buffer,20,n.byteLength)};return r.magic[0]=103,r.magic[1]=108,r.magic[2]=84,r.magic[3]=70,r.version[0]=2,r.length[0]=i.byteLength,r.chunkLength[0]=n.byteLength,r.chunkType[0]=1313821514,r.chunkData.set(n),i};var e6t=new U;function t6t(e,t){let n=e.tilingScheme,i=[],r={},o=e._lodCount,s=he.fromRadians(t.west,t.north),a=he.fromRadians(t.east,t.south),c=n.positionToTileXY(s,o),u=n.positionToTileXY(a,o);for(let d=c.x;d<=u.x;d++)for(let p=c.y;p<=u.y;p++){let g=U.fromElements(d,p,e6t),m=g.toString();if(!r.hasOwnProperty(m)){let y={x:g.x,y:g.y,level:o,tilingScheme:n,terrainProvider:e,positions:[]};r[m]=y,i.push(y)}}let f=[];for(let d=0;d<i.length;++d){let p=i[d],g=p.terrainProvider.requestTileGeometry(p.x,p.y,p.level);f.push(g)}return Promise.all(f).then(function(d){let p=[];for(let g=0;g<d.length;g++){let m={tilingScheme:n,x:i[g].x,y:i[g].y,level:i[g].level},y=d[g],A="Geographic";n._projection instanceof Ti&&(A="WebMercator");let b={projectionType:A,projection:n._projection,nativeExtent:n.tileXYToNativeRectangle(m.x,m.y,m.level),height:y._height,width:y._width,scale:y._structure.heightScale,offset:y._structure.heightOffset};if(y._encoding===pm.LERC){let x=qBe.default.decode(y._buffer);b.buffer=x.pixels[0]}else b.buffer=y._buffer;p.push(b)}return p})}async function n6t(e){let t=e._geoidTiledTerrainProvider;if(l(t))try{let n=await t6t(t,e._extent);e._geoidDataList=n}catch{console.log("Error retrieving Geoid Terrain tiles - no geoid conversion will be performed.")}}ta.prototype.loadGeoidData=async function(){return l(this._geoidDataPromise)?this._geoidDataPromise:(this._geoidDataPromise=n6t(this),this._geoidDataPromise)};ta.prototype._computeExtent=function(){let e;for(let t=0;t<this._layersExtent.length;t++){let n=this._layersExtent[t];l(e)?ie.union(e,n,e):e=ie.clone(n)}this._extent=e};ta.prototype.getAttributeNames=function(){let e=[];for(let t=0;t<this._attributeStatistics.length;++t)e.push(...this._attributeStatistics[t].names);return e};ta.prototype.getAttributeValues=function(e){for(let t=0;t<this._attributeStatistics.length;++t){let n=this._attributeStatistics[t]._getValues(e);if(l(n))return n}return[]};ta.prototype.filterByAttributes=function(e){let t=[];for(let n=0;n<this._layers.length;n++){let i=this._layers[n].filterByAttributes(e);t.push(i)}return Promise.all(t)};var E0=ta;var HM={};HM.createTilesetFromIModelId=async function({iModelId:e,changesetId:t,tilesetOptions:n}){let{exports:i}=await Ea.getExports(e,t);if(i.length>0&&i.every(c=>c.status===Ea.ExportStatus.Invalid))throw new oe(`All exports for this iModel are Invalid: ${e}`);let r=i.find(c=>c.status===Ea.ExportStatus.Complete);if(!l(r))return;let o=new URL(r._links.mesh.href);o.pathname=`${o.pathname}/tileset.json`;let s=o.toString(),a=new De({url:s});return Zo.fromUrl(a,n)};HM.createTilesetForRealityDataId=async function({iTwinId:e,realityDataId:t,type:n,rootDocument:i,tilesetOptions:r}){if(!l(n)||!l(i)){let c=await Ea.getRealityDataMetadata(e,t);i=c.rootDocument,n=c.type}if(![Ea.RealityDataType.Cesium3DTiles,Ea.RealityDataType.PNTS,Ea.RealityDataType.RealityMesh3DTiles,Ea.RealityDataType.Terrain3DTiles,Ea.RealityDataType.GaussianSplat3DTiles].includes(n))throw new oe(`Reality data type is not a mesh type: ${n}`);let s=await Ea.getRealityDataURL(e,t,i),a={maximumScreenSpaceError:4,...r};return Zo.fromUrl(s,a)};HM.createDataSourceForRealityDataId=async function({iTwinId:e,realityDataId:t,type:n,rootDocument:i}){if(!l(n)||!l(i)){let s=await Ea.getRealityDataMetadata(e,t);i=s.rootDocument,n=s.type}if(![Ea.RealityDataType.KML,Ea.RealityDataType.GeoJSON].includes(n))throw new oe(`Reality data type is not a data source type: ${n}`);let o=await Ea.getRealityDataURL(e,t,i);return n===Ea.RealityDataType.GeoJSON?ST.load(o):Mw.load(o)};HM.loadGeospatialFeatures=async function({iTwinId:e,collectionId:t,limit:n}){let i=n??1e4,r=`${Ea.apiEndpoint}geospatial-features/itwins/${e}/ogc/collections/${t}/items`,o=new De({url:r,headers:{Authorization:Ea._getAuthorizationHeader(),Accept:"application/vnd.bentley.itwin-platform.v1+json"},queryParameters:{limit:i,client:"CesiumJS"}});return ST.load(o)};var YBe=HM;function XBe(){}Object.defineProperties(XBe.prototype,{color:{get:pe.throwInstantiationError},intensity:{get:pe.throwInstantiationError}});var KBe=XBe;var i6t=/\/$/,$Be=new It('© <a href="https://www.mapbox.com/about/maps/">Mapbox</a> © <a href="http://www.openstreetmap.org/copyright">OpenStreetMap</a> <strong><a href="https://www.mapbox.com/map-feedback/">Improve this map</a></strong>');function wI(e){e=e??H.EMPTY_OBJECT;let t=e.styleId,n=e.accessToken;this._defaultAlpha=void 0,this._defaultNightAlpha=void 0,this._defaultDayAlpha=void 0,this._defaultBrightness=void 0,this._defaultContrast=void 0,this._defaultHue=void 0,this._defaultSaturation=void 0,this._defaultGamma=void 0,this._defaultMinificationFilter=void 0,this._defaultMagnificationFilter=void 0;let i=De.createIfNeeded(e.url??"https://api.mapbox.com/styles/v1/");this._styleId=t,this._accessToken=n;let r=e.tilesize??512;this._tilesize=r;let o=e.username??"mapbox";this._username=o;let s=l(e.scaleFactor)?"@2x":"",a=i.getUrlComponent();i6t.test(a)||(a+="/"),a+=`${this._username}/${t}/tiles/${this._tilesize}/{z}/{x}/{y}${s}`,i.url=a,i.setQueryParameters({access_token:n});let c;l(e.credit)?(c=e.credit,typeof c=="string"&&(c=new It(c))):c=$Be,this._resource=i,this._imageryProvider=new Rs({url:i,credit:c,ellipsoid:e.ellipsoid,minimumLevel:e.minimumLevel,maximumLevel:e.maximumLevel,rectangle:e.rectangle})}Object.defineProperties(wI.prototype,{url:{get:function(){return this._imageryProvider.url}},rectangle:{get:function(){return this._imageryProvider.rectangle}},tileWidth:{get:function(){return this._imageryProvider.tileWidth}},tileHeight:{get:function(){return this._imageryProvider.tileHeight}},maximumLevel:{get:function(){return this._imageryProvider.maximumLevel}},minimumLevel:{get:function(){return this._imageryProvider.minimumLevel}},tilingScheme:{get:function(){return this._imageryProvider.tilingScheme}},tileDiscardPolicy:{get:function(){return this._imageryProvider.tileDiscardPolicy}},errorEvent:{get:function(){return this._imageryProvider.errorEvent}},credit:{get:function(){return this._imageryProvider.credit}},proxy:{get:function(){return this._imageryProvider.proxy}},hasAlphaChannel:{get:function(){return this._imageryProvider.hasAlphaChannel}}});wI.prototype.getTileCredits=function(e,t,n){};wI.prototype.requestImage=function(e,t,n,i){return this._imageryProvider.requestImage(e,t,n,i)};wI.prototype.pickFeatures=function(e,t,n,i,r){return this._imageryProvider.pickFeatures(e,t,n,i,r)};wI._defaultCredit=$Be;var JBe=wI;var r6t=0,o6t=14,s6t=-1e3,a6t=1e4,c6t=2*Math.PI*ee.WGS84.maximumRadius,l6t=256,u6t=new ie,f6t=new ie,uae=class{constructor(t,n){n=n??{},this._resource=De.createIfNeeded(t),this._urlTemplate=this._resource.url,this._extent=ie.clone(n.extent),this._minZoom=n.minZoom??r6t,this._maxZoom=n.maxZoom??o6t,this._featureIdProperty=n.featureIdProperty,this._heightReference=n.heightReference,this._scene=n.scene,this._show=!0,this._tileset=void 0,this._tilesetJsonUrl=void 0}static async fromUrl(t,n){let i=new this(t,n);return await i._initializeTileset(),i}get urlTemplate(){return this._urlTemplate}get resource(){return this._resource}get extent(){return this._extent}get tileset(){return this._tileset}get show(){return this._show}set show(t){this._show=t,l(this._tileset)&&(this._tileset.show=t)}_createRuntimeTilesetOptions(){return{minZoom:this._minZoom,maxZoom:this._maxZoom,extent:this._extent}}_createTilesetLoadOptions(){return{heightReference:this._heightReference,scene:this._scene}}_configureTileset(t){}_createCodec(){}async _initializeTileset(){let t=d6t(this._resource,this._createRuntimeTilesetOptions()),n=new Blob([JSON.stringify(t)],{type:"application/json"}),i=URL.createObjectURL(n);this._tilesetJsonUrl=i;try{this._tileset=await Zo.fromUrl(i,this._createTilesetLoadOptions())}catch(r){throw URL.revokeObjectURL(i),this._tilesetJsonUrl=void 0,r}URL.revokeObjectURL(i),this._tilesetJsonUrl=void 0,this._configureTileset(this._tileset),this._tileset._runtimeContentCodec=this._createCodec(),this._tileset.show=this._show}update(t){l(this._tileset)&&this._tileset.update(t)}prePassesUpdate(t){l(this._tileset)&&this._tileset.prePassesUpdate(t)}postPassesUpdate(t){l(this._tileset)&&this._tileset.postPassesUpdate(t)}updateForPass(t,n){l(this._tileset)&&this._tileset.updateForPass(t,n)}isDestroyed(){return!1}destroy(){return l(this._tileset)&&(this._tileset.destroy(),this._tileset=void 0),l(this._tilesetJsonUrl)&&(URL.revokeObjectURL(this._tilesetJsonUrl),this._tilesetJsonUrl=void 0),this._resource=void 0,this._extent=void 0,this._featureIdProperty=void 0,le(this)}};function d6t(e,t){let n=new Bo,i=l(t.extent)?ie.clone(t.extent):ie.clone(n.rectangle),r=m6t(n,i,t.minZoom),o={boundingVolume:{region:e2e(i)},geometricError:QBe(0),refine:"REPLACE",children:[]};for(let s=r.minY;s<=r.maxY;s++)for(let a=r.minX;a<=r.maxX;a++){let c=ZBe(n,e,i,t.minZoom,t.maxZoom,a,s);l(c)&&o.children.push(c)}return o.children.length===0&&(o.geometricError=0),{asset:{version:"1.1"},geometricError:o.geometricError,root:o}}function ZBe(e,t,n,i,r,o,s){if(!p6t(e,i,o,s,n,u6t,f6t))return;let a=e.tileXYToRectangle(o,s,i,new ie),c={boundingVolume:{region:e2e(a)},geometricError:i<r?QBe(i):0,refine:"REPLACE",content:{uri:h6t(t,i,o,s)}};if(i>=r)return c;let u=i+1,f=[];for(let d=s*2;d<=s*2+1;d++)for(let p=o*2;p<=o*2+1;p++){let g=ZBe(e,t,n,u,r,p,d);l(g)&&f.push(g)}return f.length>0?c.children=f:c.geometricError=0,c}function h6t(e,t,n,i){let o=e.url.replace(/\{z\}/gi,`${t}`).replace(/\{x\}/gi,`${n}`).replace(/\{y\}/gi,`${i}`);return fh(o)}function QBe(e){return c6t/((1<<e)*l6t)}function e2e(e){return[e.west,e.south,e.east,e.north,s6t,a6t]}function m6t(e,t,n){let i=(1<<n)-1,r=he.fromRadians(t.west,t.north),o=he.fromRadians(t.east,t.south),s=e.positionToTileXY(r,n),a=e.positionToTileXY(o,n);return!l(s)||!l(a)||t.west>t.east?{minX:0,maxX:i,minY:0,maxY:i}:{minX:P.clamp(Math.min(s.x,a.x),0,i),maxX:P.clamp(Math.max(s.x,a.x),0,i),minY:P.clamp(Math.min(s.y,a.y),0,i),maxY:P.clamp(Math.max(s.y,a.y),0,i)}}function p6t(e,t,n,i,r,o,s){let a=e.tileXYToRectangle(n,i,t,o);return l(ie.intersection(a,r,s))}var B7=uae;var k7=class extends B7{static async fromUrl(t,n){return super.fromUrl(t,n)}_createTilesetLoadOptions(){return{...super._createTilesetLoadOptions(),skipLevelOfDetail:!1,enablePick:!0,featureIdLabel:"featureId_0",instanceFeatureIdLabel:"instanceFeatureId_0"}}_configureTileset(t){t._modelUpAxis=qi.Z,t._modelForwardAxis=qi.X}_createCodec(){let t=this._featureIdProperty;return{contentType:"mvt",missingTilePolicy:{statusCodes:[404,204]},createContent:async(n,i,r,o)=>{let s=T7(o),a=t2e(r.getUrlComponent(!0)),c=f7(s,a,{featureIdProperty:t});if(!l(c)){if(!g6t(s))return new yg(n,i);throw new oe("Decoded MVT tile did not produce vector glTF content.")}return Ix.fromGltf(n,i,r,c)}}}};function t2e(e){let t=e.match(/\/(\d+)\/(\d+)\/(\d+)(?:\.[^/?#]+)?(?:[?#]|$)/i);return t?{tileZ:parseInt(t[1],10),tileX:parseInt(t[2],10),tileY:parseInt(t[3],10)}:(yt("MVTDataProvider.parseTileCoordinates",`MVT tile URL did not match /{z}/{x}/{y} pattern. Falling back to z/x/y = 0/0/0. URL: ${e}`),{tileZ:0,tileX:0,tileY:0})}function g6t(e){let t=e.layers;for(let n=0;n<t.length;n++)if(t[n].features.length>0)return!0;return!1}k7._parseTileCoordinates=t2e;var n2e=k7;function fae(e){}fae.prototype.isReady=function(){return!0};fae.prototype.shouldDiscardImage=function(e){return!1};var i2e=fae;var _6t=new It("MapQuest, Open Street Map and contributors, CC-BY-SA");function U7(e){e=e??H.EMPTY_OBJECT;let t=De.createIfNeeded(e.url??"https://tile.openstreetmap.org/");t.appendForwardSlash(),t.url+=`{z}/{x}/{y}${e.retinaTiles?"@2x":""}.${e.fileExtension??"png"}`;let n=new Bo({ellipsoid:e.ellipsoid}),i=256,r=256,o=e.minimumLevel??0,s=e.maximumLevel,a=e.rectangle??n.rectangle,c=n.positionToTileXY(ie.southwest(a),o),u=n.positionToTileXY(ie.northeast(a),o),f=(Math.abs(u.x-c.x)+1)*(Math.abs(u.y-c.y)+1),d=e.credit??_6t;typeof d=="string"&&(d=new It(d)),Rs.call(this,{url:t,credit:d,tilingScheme:n,tileWidth:i,tileHeight:r,minimumLevel:o,maximumLevel:s,rectangle:a})}l(Object.create)&&(U7.prototype=Object.create(Rs.prototype),U7.prototype.constructor=U7);var sb=U7;function r2e(){pe.throwInstantiationError()}Object.defineProperties(r2e.prototype,{show:{get:pe.throwInstantiationError,set:pe.throwInstantiationError},transform:{get:pe.throwInstantiationError},credit:{get:pe.throwInstantiationError}});var o2e=r2e;function z7(){pe.throwInstantiationError()}Object.defineProperties(z7.prototype,{});z7.fromUrl=function(e){pe.throwInstantiationError()};z7.prototype.loadPanorama=function(e){pe.throwInstantiationError()};var s2e=z7;var y6t=new U(1,1);function dae(e){e=e??H.EMPTY_OBJECT,this.mass=e.mass??1,this.position=h.clone(e.position??h.ZERO),this.velocity=h.clone(e.velocity??h.ZERO),this.life=e.life??Number.MAX_VALUE,this.image=e.image,this.startColor=z.clone(e.startColor??z.WHITE),this.endColor=z.clone(e.endColor??z.WHITE),this.startScale=e.startScale??1,this.endScale=e.endScale??1,this.imageSize=U.clone(e.imageSize??y6t),this._age=0,this._normalizedAge=0,this._billboard=void 0}Object.defineProperties(dae.prototype,{age:{get:function(){return this._age}},normalizedAge:{get:function(){return this._normalizedAge}}});var a2e=new h;dae.prototype.update=function(e,t){return h.multiplyByScalar(this.velocity,e,a2e),h.add(this.position,a2e,this.position),l(t)&&t(this,e),this._age+=e,this.life===Number.MAX_VALUE?this._normalizedAge=0:this._normalizedAge=this._age/this.life,this._age<=this.life};var GM=dae;function c2e(e){e=e??H.EMPTY_OBJECT,this.time=e.time??0,this.minimum=e.minimum??0,this.maximum=e.maximum??50,this._complete=!1}Object.defineProperties(c2e.prototype,{complete:{get:function(){return this._complete}}});var l2e=c2e;function u2e(e){}u2e.prototype.emit=function(e){pe.throwInstantiationError()};var f2e=u2e;var d2e=new U(1,1);function WM(e){e=e??H.EMPTY_OBJECT,this.show=e.show??!0,this.updateCallback=e.updateCallback,this.loop=e.loop??!0,this.image=e.image??void 0;let t=e.emitter;l(t)||(t=new h7(.5)),this._emitter=t,this._bursts=e.bursts,this._modelMatrix=M.clone(e.modelMatrix??M.IDENTITY),this._emitterModelMatrix=M.clone(e.emitterModelMatrix??M.IDENTITY),this._matrixDirty=!0,this._combinedMatrix=new M,this._startColor=z.clone(e.color??e.startColor??z.WHITE),this._endColor=z.clone(e.color??e.endColor??z.WHITE),this._startScale=e.scale??e.startScale??1,this._endScale=e.scale??e.endScale??1,this._emissionRate=e.emissionRate??5,this._minimumSpeed=e.speed??e.minimumSpeed??1,this._maximumSpeed=e.speed??e.maximumSpeed??1,this._minimumParticleLife=e.particleLife??e.minimumParticleLife??5,this._maximumParticleLife=e.particleLife??e.maximumParticleLife??5,this._minimumMass=e.mass??e.minimumMass??1,this._maximumMass=e.mass??e.maximumMass??1,this._minimumImageSize=U.clone(e.imageSize??e.minimumImageSize??d2e),this._maximumImageSize=U.clone(e.imageSize??e.maximumImageSize??d2e),this._sizeInMeters=e.sizeInMeters??!1,this._lifetime=e.lifetime??Number.MAX_VALUE,this._billboardCollection=void 0,this._particles=[],this._particlePool=[],this._previousTime=void 0,this._currentTime=0,this._carryOver=0,this._complete=new be,this._isComplete=!1,this._updateParticlePool=!0,this._particleEstimate=0}Object.defineProperties(WM.prototype,{emitter:{get:function(){return this._emitter},set:function(e){this._emitter=e}},bursts:{get:function(){return this._bursts},set:function(e){this._bursts=e,this._updateParticlePool=!0}},modelMatrix:{get:function(){return this._modelMatrix},set:function(e){this._matrixDirty=this._matrixDirty||!M.equals(this._modelMatrix,e),M.clone(e,this._modelMatrix)}},emitterModelMatrix:{get:function(){return this._emitterModelMatrix},set:function(e){this._matrixDirty=this._matrixDirty||!M.equals(this._emitterModelMatrix,e),M.clone(e,this._emitterModelMatrix)}},startColor:{get:function(){return this._startColor},set:function(e){z.clone(e,this._startColor)}},endColor:{get:function(){return this._endColor},set:function(e){z.clone(e,this._endColor)}},startScale:{get:function(){return this._startScale},set:function(e){this._startScale=e}},endScale:{get:function(){return this._endScale},set:function(e){this._endScale=e}},emissionRate:{get:function(){return this._emissionRate},set:function(e){this._emissionRate=e,this._updateParticlePool=!0}},minimumSpeed:{get:function(){return this._minimumSpeed},set:function(e){this._minimumSpeed=e}},maximumSpeed:{get:function(){return this._maximumSpeed},set:function(e){this._maximumSpeed=e}},minimumParticleLife:{get:function(){return this._minimumParticleLife},set:function(e){this._minimumParticleLife=e}},maximumParticleLife:{get:function(){return this._maximumParticleLife},set:function(e){this._maximumParticleLife=e,this._updateParticlePool=!0}},minimumMass:{get:function(){return this._minimumMass},set:function(e){this._minimumMass=e}},maximumMass:{get:function(){return this._maximumMass},set:function(e){this._maximumMass=e}},minimumImageSize:{get:function(){return this._minimumImageSize},set:function(e){this._minimumImageSize=e}},maximumImageSize:{get:function(){return this._maximumImageSize},set:function(e){this._maximumImageSize=e}},sizeInMeters:{get:function(){return this._sizeInMeters},set:function(e){this._sizeInMeters=e}},lifetime:{get:function(){return this._lifetime},set:function(e){this._lifetime=e}},complete:{get:function(){return this._complete}},isComplete:{get:function(){return this._isComplete}}});function A6t(e){let t=e._emissionRate,n=e._maximumParticleLife,i=0,r=e._bursts;if(l(r)){let d=r.length;for(let p=0;p<d;++p)i+=r[p].maximum}let o=e._billboardCollection,s=e.image,a=Math.ceil(t*n+i),c=e._particles,u=e._particlePool,f=Math.max(a-c.length-u.length,0);for(let d=0;d<f;++d){let p=new GM;p._billboard=o.add({image:s,show:!1}),u.push(p)}e._particleEstimate=a}function b6t(e){let t=e._particlePool.pop();return l(t)||(t=new GM),t}function x6t(e,t){e._particlePool.push(t)}function T6t(e){let t=e._particles,n=e._particlePool,i=e._billboardCollection,r=t.length,o=n.length,s=e._particleEstimate,a=o-Math.max(s-r-o,0);for(let c=a;c<o;++c){let u=n[c];i.remove(u._billboard)}n.length=a}function E6t(e){l(e._billboard)&&(e._billboard.show=!1)}function h2e(e,t){let n=t._billboard;l(n)||(n=t._billboard=e._billboardCollection.add({image:t.image})),n.width=t.imageSize.x,n.height=t.imageSize.y,n.position=t.position,n.sizeInMeters=e.sizeInMeters,n.show=!0;let i=P.lerp(t.startColor.red,t.endColor.red,t.normalizedAge),r=P.lerp(t.startColor.green,t.endColor.green,t.normalizedAge),o=P.lerp(t.startColor.blue,t.endColor.blue,t.normalizedAge),s=P.lerp(t.startColor.alpha,t.endColor.alpha,t.normalizedAge);n.color=new z(i,r,o,s),n.scale=P.lerp(t.startScale,t.endScale,t.normalizedAge)}function C6t(e,t){t.startColor=z.clone(e._startColor,t.startColor),t.endColor=z.clone(e._endColor,t.endColor),t.startScale=e._startScale,t.endScale=e._endScale,t.image=e.image,t.life=P.randomBetween(e._minimumParticleLife,e._maximumParticleLife),t.mass=P.randomBetween(e._minimumMass,e._maximumMass),t.imageSize.x=P.randomBetween(e._minimumImageSize.x,e._maximumImageSize.x),t.imageSize.y=P.randomBetween(e._minimumImageSize.y,e._maximumImageSize.y),t._normalizedAge=0,t._age=0;let n=P.randomBetween(e._minimumSpeed,e._maximumSpeed);h.multiplyByScalar(t.velocity,n,t.velocity),e._particles.push(t)}function v6t(e,t){if(e._isComplete)return 0;t=P.mod(t,e._lifetime);let n=t*e._emissionRate,i=Math.floor(n);if(e._carryOver+=n-i,e._carryOver>1&&(i++,e._carryOver-=1),l(e.bursts)){let r=e.bursts.length;for(let o=0;o<r;o++){let s=e.bursts[o],a=e._currentTime;l(s)&&!s._complete&&a>s.time&&(i+=P.randomBetween(s.minimum,s.maximum),s._complete=!0)}}return i}var V7=new h;WM.prototype.update=function(e){if(!this.show)return;l(this._billboardCollection)||(this._billboardCollection=new wd),this._updateParticlePool&&(A6t(this),this._updateParticlePool=!1);let t=0;this._previousTime&&(t=K.secondsDifference(e.time,this._previousTime)),t<0&&(t=0);let n=this._particles,i=this._emitter,r=this.updateCallback,o,s,a=n.length;for(o=0;o<a;++o)s=n[o],s.update(t,r)?h2e(this,s):(E6t(s),x6t(this,s),n[o]=n[a-1],--o,--a);n.length=a;let c=v6t(this,t);if(c>0&&l(i)){this._matrixDirty&&(this._combinedMatrix=M.multiply(this.modelMatrix,this.emitterModelMatrix,this._combinedMatrix),this._matrixDirty=!1);let u=this._combinedMatrix;for(o=0;o<c;o++)s=b6t(this),this._emitter.emit(s),h.add(s.position,s.velocity,V7),M.multiplyByPoint(u,V7,V7),s.position=M.multiplyByPoint(u,s.position,s.position),h.subtract(V7,s.position,s.velocity),h.normalize(s.velocity,s.velocity),C6t(this,s),h2e(this,s)}if(this._billboardCollection.update(e),this._previousTime=K.clone(e.time,this._previousTime),this._currentTime+=t,this._lifetime!==Number.MAX_VALUE&&this._currentTime>this._lifetime)if(this.loop){if(this._currentTime=P.mod(this._currentTime,this._lifetime),this.bursts){let u=this.bursts.length;for(o=0;o<u;o++)this.bursts[o]._complete=!1}}else this._isComplete=!0,this._complete.raiseEvent(this);e.frameNumber%120===0&&T6t(this)};WM.prototype.isDestroyed=function(){return!1};WM.prototype.destroy=function(){return this._billboardCollection=this._billboardCollection&&this._billboardCollection.destroy(),le(this)};var m2e=WM;var hae=class{constructor(){ut(this,"quadtree");ut(this,"tilingScheme");ut(this,"errorEvent");pe.throwInstantiationError()}static computeDefaultLevelZeroMaximumGeometricError(t){return t.ellipsoid.maximumRadius*2*Math.PI*.25/(65*t.getNumberOfXTilesAtLevel(0))}update(t,n){pe.throwInstantiationError()}beginUpdate(t,n,i){pe.throwInstantiationError()}endUpdate(t,n,i){pe.throwInstantiationError()}getLevelMaximumGeometricError(t){pe.throwInstantiationError()}loadTile(t,n,i){pe.throwInstantiationError()}computeTileVisibility(t,n,i){pe.throwInstantiationError()}showTileThisFrame(t,n,i,r){pe.throwInstantiationError()}computeDistanceToTile(t,n){pe.throwInstantiationError()}isDestroyed(){pe.throwInstantiationError()}destroy(){pe.throwInstantiationError()}},p2e=hae;function mae(e){e=e??1,this._radius=e??1}Object.defineProperties(mae.prototype,{radius:{get:function(){return this._radius},set:function(e){this._radius=e}}});mae.prototype.emit=function(e){let t=P.randomBetween(0,P.TWO_PI),n=P.randomBetween(0,P.PI),i=P.randomBetween(0,this._radius),r=i*Math.cos(t)*Math.sin(n),o=i*Math.sin(t)*Math.sin(n),s=i*Math.cos(n);e.position=h.fromElements(r,o,s,e.position),e.velocity=h.normalize(e.position,e.velocity)};var g2e=mae;function qM(){}qM.prototype.evaluate=function(e,t){pe.throwInstantiationError()};qM.prototype.evaluateColor=function(e,t){pe.throwInstantiationError()};qM.prototype.getShaderFunction=function(e,t,n,i){pe.throwInstantiationError()};qM.prototype.getVariables=function(){pe.throwInstantiationError()};var _2e=qM;function II(e){this._ready=!1,this._provider=void 0,this._errorEvent=new be,this._readyEvent=new be,w6t(this,e)}Object.defineProperties(II.prototype,{errorEvent:{get:function(){return this._errorEvent}},readyEvent:{get:function(){return this._readyEvent}},ready:{get:function(){return this._ready}},provider:{get:function(){return this._provider}}});II.fromWorldTerrain=function(e){return new II(_I(e))};II.fromWorldBathymetry=function(e){return new II(X9(e))};function S6t(e,t){e.numberOfListeners>0?e.raiseEvent(t):console.error(t)}async function w6t(e,t){let n;try{n=await Promise.resolve(t),e._provider=n,e._ready=!0,e._readyEvent.raiseEvent(n)}catch(i){S6t(e._errorEvent,i)}}var j7=II;function PI(){}PI.prototype.boundingVolume=void 0;PI.prototype.boundingSphere=void 0;PI.prototype.distanceToCamera=function(e){pe.throwInstantiationError()};PI.prototype.intersectPlane=function(e){pe.throwInstantiationError()};PI.prototype.createDebugVolume=function(e){pe.throwInstantiationError()};var y2e=PI;function YM(e){e=e??H.EMPTY_OBJECT,this._tilingScheme=l(e.tilingScheme)?e.tilingScheme:new rr({ellipsoid:e.ellipsoid}),this._color=e.color??z.YELLOW,this._errorEvent=new be,this._tileWidth=e.tileWidth??256,this._tileHeight=e.tileHeight??256,this._defaultAlpha=void 0,this._defaultNightAlpha=void 0,this._defaultDayAlpha=void 0,this._defaultBrightness=void 0,this._defaultContrast=void 0,this._defaultHue=void 0,this._defaultSaturation=void 0,this._defaultGamma=void 0,this._defaultMinificationFilter=void 0,this._defaultMagnificationFilter=void 0}Object.defineProperties(YM.prototype,{proxy:{get:function(){}},tileWidth:{get:function(){return this._tileWidth}},tileHeight:{get:function(){return this._tileHeight}},maximumLevel:{get:function(){}},minimumLevel:{get:function(){}},tilingScheme:{get:function(){return this._tilingScheme}},rectangle:{get:function(){return this._tilingScheme.rectangle}},tileDiscardPolicy:{get:function(){}},errorEvent:{get:function(){return this._errorEvent}},credit:{get:function(){}},hasAlphaChannel:{get:function(){return!0}}});YM.prototype.getTileCredits=function(e,t,n){};YM.prototype.requestImage=function(e,t,n,i){let r=document.createElement("canvas");r.width=256,r.height=256;let o=r.getContext("2d"),s=this._color.toCssColorString();return o.strokeStyle=s,o.lineWidth=2,o.strokeRect(1,1,255,255),o.font="bold 25px Arial",o.textAlign="center",o.fillStyle=s,o.fillText(`L: ${n}`,124,86),o.fillText(`X: ${e}`,124,136),o.fillText(`Y: ${t}`,124,186),Promise.resolve(r)};YM.prototype.pickFeatures=function(e,t,n,i,r){};var H7=YM;function pae(e){pe.throwInstantiationError()}pae.prototype.isReady=pe.throwInstantiationError;pae.prototype.shouldDiscardImage=pe.throwInstantiationError;var A2e=pae;var b2e={START:0,LOADING:1,READY:2,UPSAMPLED_ONLY:3};Object.freeze(b2e);var x2e=b2e;function G7(e,t){this.show=!0,l(e)||(e=new et),this.rectangle=et.clone(e),l(t)||(t=ir.fromType(ir.ColorType,{color:new z(1,1,1,1)})),this.material=t,this._material=void 0,this._overlayCommand=void 0,this._rs=void 0}G7.prototype.update=function(e){if(!this.show)return;let t=this._rs;if((!l(t)||!et.equals(t.viewport,this.rectangle))&&(this._rs=Ge.fromCache({blending:nn.ALPHA_BLEND,viewport:this.rectangle})),e.passes.render){let i=e.context;if(this._material!==this.material||!l(this._overlayCommand)){this._material=this.material,l(this._overlayCommand)&&this._overlayCommand.shaderProgram.destroy();let r=new Xe({sources:[this._material.shaderSource,ok]});this._overlayCommand=i.createViewportQuadCommand(r,{renderState:this._rs,uniformMap:this._material._uniforms,owner:this}),this._overlayCommand.pass=Ie.OVERLAY}this._material.update(i),this._overlayCommand.renderState=this._rs,this._overlayCommand.uniformMap=this._material._uniforms,e.commandList.push(this._overlayCommand)}};G7.prototype.isDestroyed=function(){return!1};G7.prototype.destroy=function(){return l(this._overlayCommand)&&(this._overlayCommand.shaderProgram=this._overlayCommand.shaderProgram&&this._overlayCommand.shaderProgram.destroy()),le(this)};var T2e=G7;var gae=class{constructor(){ut(this,"globalTransform");ut(this,"shapeTransform");ut(this,"shape");ut(this,"minBounds");ut(this,"maxBounds");ut(this,"dimensions");ut(this,"paddingBefore");ut(this,"paddingAfter");ut(this,"names");ut(this,"types");ut(this,"componentTypes");ut(this,"minimumValues");ut(this,"maximumValues");ut(this,"maximumTileCount");ut(this,"availableLevels");ut(this,"keyframeCount");ut(this,"timeIntervalCollection");pe.throwInstantiationError()}requestData(t){pe.throwInstantiationError()}},E2e=gae;function y_(){pe.throwInstantiationError()}Object.defineProperties(y_.prototype,{orientedBoundingBox:{get:pe.throwInstantiationError},boundingSphere:{get:pe.throwInstantiationError},boundTransform:{get:pe.throwInstantiationError},shapeTransform:{get:pe.throwInstantiationError},shaderUniforms:{get:pe.throwInstantiationError},shaderDefines:{get:pe.throwInstantiationError},shaderMaximumIntersectionsLength:{get:pe.throwInstantiationError}});y_.prototype.update=pe.throwInstantiationError;y_.prototype.updateViewTransforms=pe.throwInstantiationError;y_.prototype.convertLocalToShapeUvSpace=pe.throwInstantiationError;y_.prototype.computeOrientedBoundingBoxForTile=pe.throwInstantiationError;y_.prototype.computeOrientedBoundingBoxForSample=pe.throwInstantiationError;y_.DefaultMinBounds=pe.throwInstantiationError;y_.DefaultMaxBounds=pe.throwInstantiationError;var C2e=y_;var v2e=`uniform sampler2D u_depthTexture; +`;var MLe=`uniform sampler2D u_depthTexture; in vec2 v_textureCoordinates; void main() { @@ -12729,8 +12701,36 @@ float z_ndc = (2.0 * z_window - n_range - f_range) / (f_range - n_range); float scale = pow(z_ndc * 0.5 + 0.5, 8.0); out_FragColor = vec4(mix(vec3(0.0), vec3(1.0), scale), 1.0); } -`;var _ae=class{get enabled(){return pe.throwInstantiationError()}set enabled(t){pe.throwInstantiationError()}connectedCallback(t){pe.throwInstantiationError()}disconnectedCallback(t){pe.throwInstantiationError()}update(t,n){pe.throwInstantiationError()}firstUpdate(t,n){pe.throwInstantiationError()}},S2e=_ae;var w2e=new h,I6t=new sn(h.UNIT_X,0),P6t=new gn,D6t=new U(1,1,1);function C0(e,t,n,i=D6t){let{camera:r,ellipsoid:o}=e,s=o.scaleToGeodeticSurface(r.positionWC,w2e);if(!l(s))return;let a=h.magnitude(r.positionWC),c=h.magnitude(s),u=a<=c,f=o.geodeticSurfaceNormal(r.positionWC,w2e),d=h.dot(f,r.directionWC),p=d>0;if(u||p){let g=sn.fromPointNormal(r.positionWC,f,I6t),{clientHeight:m}=e.canvas,y=i.y*m/(2*Math.tan(r.frustum.fovy*.5));g.distance-=d*y;let A=r.getPickRay(t,P6t);return xi.rayPlane(A,g,n)}return r.pickEllipsoid(t,o,n)}var I2e={LEFT:0,MIDDLE:1,RIGHT:2};Object.freeze(I2e);var hc=I2e;function R6t(e){if(e===hc.LEFT)return fn.LEFT_DOWN;if(e===hc.MIDDLE)return fn.MIDDLE_DOWN;if(e===hc.RIGHT)return fn.RIGHT_DOWN}function O6t(e){if(e===hc.LEFT)return fn.LEFT_UP;if(e===hc.MIDDLE)return fn.MIDDLE_UP;if(e===hc.RIGHT)return fn.RIGHT_UP}var yae=class{static registerDragInputBindings(t,n,i){let r=new Set,o={isDragging:!1};for(let s of n){o.isDragging=!1;let a=R6t(s.button),c=O6t(s.button);l(a)&&t.setInputAction((...u)=>{o.isDragging=!0,l(i.start)&&i.start(...u)},a,s.modifier),l(c)&&(t.setInputAction((...u)=>{o.isDragging&&(o.isDragging=!1,l(i.end)&&i.end(...u))},c,s.modifier),t.setInputAction((...u)=>{o.isDragging&&(o.isDragging=!1,l(i.end)&&i.end(...u))},c)),r.add(s.modifier)}for(let s of r)t.setInputAction((...a)=>{o.isDragging&&l(i.change)&&i.change(...a)},fn.MOUSE_MOVE,s);return o}},v0=yae;var Aae=class e{static _getDefaultDragInputs(){return[Object.freeze({button:hc.LEFT})]}constructor(t=H.EMPTY_OBJECT){this._enabled=!0,this._handler=void 0,this._lastUpdateTime=void 0,this.dragInputs=t.dragInputs??e._getDefaultDragInputs(),this._dragInputState=void 0,this._panDelta=new U,this._panPosition=new U,this.pickWorldPosition=C0,this._ellipsoidNormal=new h,this._ellipsoidSurfacePosition=new h,this._panDirectionX=new h,this._panDirectionY=new h,this._pixelSize=new U,this._panVelocity=new U,this.panSpeed=1,this.inertiaEnabled=!0,this.inertialDecay=6,this.maximumMovementRatio=.1}get enabled(){return this._enabled}set enabled(t){this._enabled=t,t?(this._lastUpdateTime=xn(),this._panDelta.x=0,this._panDelta.y=0):l(this._dragInputState)&&(this._dragInputState.isDragging=!1)}get isDragging(){return l(this._dragInputState)&&this._dragInputState.isDragging}connectedCallback(t){let n=new Ta(t);this._handler=n,this._dragInputState=v0.registerDragInputBindings(n,this.dragInputs,{start:this._handleStartPan.bind(this),change:this._handlePan.bind(this)})}disconnectedCallback(t){let n=this._handler;l(n)&&!n.isDestroyed()&&n.destroy()}firstUpdate(){this._lastUpdateTime=xn(),this._panDelta.x=0,this._panDelta.y=0}update(t){let n=(xn()-this._lastUpdateTime)*Un.SECONDS_PER_MILLISECOND,{camera:i,ellipsoid:r,canvas:o}=t,s=-this._panDelta.x,a=this._panDelta.y;if(this.inertiaEnabled&&!this.isDragging){let E=Math.exp(-this.inertialDecay*n);this._panVelocity.x*=E,this._panVelocity.y*=E,s=this._panVelocity.x*n,a=this._panVelocity.y*n}let{clientWidth:c,clientHeight:u}=o;if(n===0||c===0||u===0||Math.abs(s)<=P.EPSILON3&&Math.abs(a)<=P.EPSILON3){this._lastUpdateTime=xn(),this._panDelta.x=0,this._panDelta.y=0;return}let f=this._panPosition,d=this.pickWorldPosition(t,f,this._ellipsoidSurfacePosition);l(d)||(d=r.scaleToGeodeticSurface(i.positionWC,this._ellipsoidSurfacePosition));let p=h.clone(i.rightWC,this._panDirectionX);p=h.normalize(p,this._panDirectionX);let g=h.normalize(d,this._panDirectionY),m=h.distance(i.positionWC,d),{drawingBufferWidth:y,drawingBufferHeight:A,pixelRatio:b}=t,x=i.frustum.getPixelDimensions(y,A,m,b,this._pixelSize),T=this.maximumMovementRatio*Math.max(c,u);s=P.clamp(s,-T,T),this._panVelocity.x=s/n,s*=this.panSpeed*x.x,a=P.clamp(a,-T,T),this._panVelocity.y=a/n,a*=this.panSpeed*x.y,i.move(p,s),i.move(g,a),this._lastUpdateTime=xn(),this._panDelta.x=0,this._panDelta.y=0}_handleStartPan(){this.enabled&&(this._panDelta.x=0,this._panDelta.y=0)}_handlePan(t){this._panDelta.x+=t.endPosition.x-t.startPosition.x,this._panDelta.y+=t.endPosition.y-t.startPosition.y,this._panPosition.x=t.endPosition.x,this._panPosition.y=t.endPosition.y}},W7=Aae;var bae=class e{static _getDefaultDragInputs(){return[Object.freeze({button:hc.LEFT})]}constructor(t=H.EMPTY_OBJECT){this._enabled=!0,this._handler=void 0,this._lastUpdateTime=void 0,this.dragInputs=t.dragInputs??e._getDefaultDragInputs(),this._dragInputState=void 0,this._panDelta=new U,this._panPosition=new U,this.pickWorldPosition=C0,this._ellipsoidNormal=new h,this._ellipsoidSurfacePosition=new h,this._panDirectionX=new h,this._panDirectionY=new h,this._pixelSize=new U,this._panVelocity=new U,this.panSpeed=1,this.inertiaEnabled=!0,this.inertialDecay=6,this.maximumMovementRatio=.1}get enabled(){return this._enabled}set enabled(t){this._enabled=t,t?(this._panDelta.x=0,this._panDelta.y=0):l(this._dragInputState)&&(this._dragInputState.isDragging=!1)}get isDragging(){return l(this._dragInputState)&&this._dragInputState.isDragging}connectedCallback(t){let n=new Ta(t);this._handler=n,this._dragInputState=v0.registerDragInputBindings(n,this.dragInputs,{start:this._handleStartPan.bind(this),change:this._handlePan.bind(this)})}disconnectedCallback(t){let n=this._handler;l(n)&&!n.isDestroyed()&&n.destroy()}firstUpdate(){this._lastUpdateTime=xn(),this._panDelta.x=0,this._panDelta.y=0}update(t){let n=(xn()-this._lastUpdateTime)*Un.SECONDS_PER_MILLISECOND,i=-this._panDelta.x,r=this._panDelta.y;if(this.inertiaEnabled&&!this.isDragging){let S=Math.exp(-this.inertialDecay*n);this._panVelocity.x*=S,this._panVelocity.y*=S,i=this._panVelocity.x*n,r=this._panVelocity.y*n}let{camera:o,ellipsoid:s,canvas:a}=t,{clientWidth:c,clientHeight:u}=a;if(n===0||c===0||u===0||Math.abs(i)<=P.EPSILON3&&Math.abs(r)<=P.EPSILON3){this._lastUpdateTime=xn(),this._panDelta.x=0,this._panDelta.y=0;return}let f=this._panPosition,d=this.pickWorldPosition(t,f,this._ellipsoidSurfacePosition);l(d)||(d=s.scaleToGeodeticSurface(o.positionWC,this._ellipsoidSurfacePosition));let p=s.geodeticSurfaceNormal(d,this._ellipsoidNormal),g=h.clone(o.rightWC,this._panDirectionX);g=h.normalize(g,this._panDirectionX);let m=h.clone(o.upWC,this._panDirectionY),y=Math.abs(h.dot(p,o.directionWC));P.lessThan(y,1,P.EPSILON6)&&(m=h.cross(p,g,this._panDirectionY)),m=h.normalize(m,this._panDirectionY);let A=h.distance(o.positionWC,d),{drawingBufferWidth:b,drawingBufferHeight:x,pixelRatio:T}=t,E=o.frustum.getPixelDimensions(b,x,A,T,this._pixelSize),v=this.maximumMovementRatio*Math.max(c,u);i=P.clamp(i,-v,v),this._panVelocity.x=i/n,i*=this.panSpeed*E.x,r=P.clamp(r,-v,v),this._panVelocity.y=r/n,r*=this.panSpeed*E.y,o.move(g,i),o.move(m,r),this._lastUpdateTime=xn(),this._panDelta.x=0,this._panDelta.y=0}_handleStartPan(t){this.enabled&&(this._panDelta.x=0,this._panDelta.y=0)}_handlePan(t){this._panDelta.x+=t.endPosition.x-t.startPosition.x,this._panDelta.y+=t.endPosition.y-t.startPosition.y,this._panPosition.x=t.endPosition.x,this._panPosition.y=t.endPosition.y}},q7=bae;var xae=class{constructor(){this._elevatorController=new W7,this._mapController=new q7,this._enabled=!0,this._ellipsoidNormal=new h,this.angleThreshold=P.toRadians(125)}get enabled(){return this._enabled}set enabled(t){this._enabled=t}get elevatorController(){return this._elevatorController}get mapController(){return this._mapController}connectedCallback(t){this._elevatorController.connectedCallback(t),this._mapController.connectedCallback(t)}disconnectedCallback(t){this._elevatorController.disconnectedCallback(t),this._mapController.disconnectedCallback(t)}firstUpdate(){this._elevatorController.firstUpdate(),this._mapController.firstUpdate()}update(t){let n=t.camera,i=t.ellipsoid.geodeticSurfaceNormal(n.positionWC,this._ellipsoidNormal),r=Math.abs(h.angleBetween(i,n.directionWC));(r<this.angleThreshold&&r>Math.PI-this.angleThreshold?this._elevatorController:this._mapController).update(t)}},P2e=xae;var Tae=class e{static _getDefaultDragInputs(){return[Object.freeze({button:hc.LEFT,modifier:oo.CTRL}),Object.freeze({button:hc.RIGHT})]}constructor(t=H.EMPTY_OBJECT){this._enabled=!0,this._handler=void 0,this._lastUpdateTime=void 0,this.tiltEnabled=!0,this.orbitEnabled=!0,this.useDragPosition=!1,this.dragInputs=t.dragInputs??e._getDefaultDragInputs(),this._dragInputState=void 0,this._dragDelta=new U,this._screenSpaceDragPosition=new U,this._screenSpaceOrigin=new U,this.pickWorldPosition=C0,this._hasTarget=!1,this._target=new h,this._axis=new h,this.tiltMagnitude=2,this.dampingEnabled=!0,this.tiltAnimationDuration=.0045,this.maximumTiltVelocity=P.PI,this.minimumTiltVelocity=P.EPSILON20,this.orbitMagnitude=2,this.orbitAnimationDuration=.0045,this.maximumOrbitVelocity=P.TWO_PI,this.minimumOrbitVelocity=P.EPSILON20,this._tiltAxis=new h,this._tiltQuaternion=new Le,this._tiltOffset=new h,this._tiltOrigin=new h,this._tiltDampenedResults={velocity:0,value:0},this._orbitTargetEnu=new M,this._orbitTargetEast=new h,this._orbitQuaternion=new Le,this._orbitOffset=new h,this._orbitLookOffset=new h,this._orbitOrigin=new h,this._orbitDampenedResults={velocity:0,value:0},this.maximumMovementRatio=.1}get enabled(){return this._enabled}set enabled(t){this._enabled=t,t?(this._lastUpdateTime=xn(),this._dragDelta.x=0,this._dragDelta.y=0):l(this._dragInputState)&&(this._dragInputState.isDragging=!1)}get isDragging(){return l(this._dragInputState)&&this._dragInputState.isDragging}connectedCallback(t){let n=new Ta(t);this._handler=n,this._dragInputState=v0.registerDragInputBindings(n,this.dragInputs,{start:this._handleStartDrag.bind(this),change:this._handleDrag.bind(this)})}disconnectedCallback(t){let n=this._handler;l(n)&&!n.isDestroyed()&&n.destroy()}firstUpdate(){this._lastUpdateTime=xn(),this._dragDelta.x=0,this._dragDelta.y=0}_handleStartDrag(t){this.enabled&&(this._hasTarget=!1,this._screenSpaceDragPosition.x=t.position.x,this._screenSpaceDragPosition.y=t.position.y,this._dragDelta.x=0,this._dragDelta.y=0)}_handleDrag(t){this._dragDelta.x+=t.endPosition.x-t.startPosition.x,this._dragDelta.y+=t.endPosition.y-t.startPosition.y}get tiltAngle(){return this._tiltDampenedResults.value}get tiltVelocity(){return this._tiltDampenedResults.velocity}set tiltVelocity(t){this._tiltDampenedResults.velocity=t}get orbitAngle(){return this._orbitDampenedResults.value}get orbitVelocity(){return this._orbitDampenedResults.velocity}set orbitVelocity(t){this._orbitDampenedResults.velocity=t}orbit(t,n,i,r,o,s=ee.default){let a=At.eastNorthUpToFixedFrame(n,s,this._orbitTargetEnu),c=M.multiplyByPointAsVector(a,h.UNIT_X,this._orbitTargetEast),u=h.angleBetween(t.directionWC,c);if(Math.abs(this.orbitVelocity)<this.minimumOrbitVelocity&&(this.orbitVelocity=0),!this.isDragging&&this.dampingEnabled&&(r+=this.orbitVelocity*o),r===0)return;let f=u+r,d=this.dampingEnabled?this.maximumOrbitVelocity*this.orbitMagnitude:void 0,p=this.dampingEnabled?this.orbitAnimationDuration:void 0;this._orbitDampenedResults=P.smoothDamp(u,f,this.orbitVelocity,o,d,p,this._orbitDampenedResults);let g=this.orbitAngle-u,m=$.fromQuaternion(Le.fromAxisAngle(i,-g,this._orbitQuaternion)),y=h.subtract(t.positionWC,n,this._orbitOffset),A=h.dot(y,t.directionWC),b=h.multiplyByScalar(t.directionWC,A,this._orbitLookOffset),x=h.subtract(y,b,this._orbitLookOffset),T=$.multiplyByVector(m,y,this._orbitOffset),E=$.multiplyByVector(m,x,this._orbitLookOffset);h.add(n,T,t.position);let v=h.add(n,E,this._orbitOrigin);t.lookAtWorldPosition(v,s)}tilt(t,n,i,r,o,s=ee.default){if(Math.abs(this.tiltVelocity)<this.minimumTiltVelocity&&(this.tiltVelocity=0),!this.isDragging&&this.dampingEnabled&&(r+=this.tiltVelocity*o),r===0)return;let a=h.angleBetween(t.direction,i);(a<P.PI_OVER_TWO&&r>0||a>P.PI_OVER_TWO&&r<0)&&(r*=Math.abs(Math.sin(a)));let c=a+r,u=this.dampingEnabled?this.maximumTiltVelocity*this.tiltMagnitude:void 0,f=this.dampingEnabled?this.tiltAnimationDuration:void 0;P.smoothDamp(a,c,this.tiltVelocity,o,u,f,this._tiltDampenedResults);let d=this.tiltAngle-a,p=$.fromQuaternion(Le.fromAxisAngle(t.rightWC,-d,this._tiltQuaternion)),g=h.subtract(t.position,n,this._tiltOffset),m=h.dot(g,t.directionWC),y=h.multiplyByScalar(t.directionWC,m,this._tiltOffset),A=h.subtract(t.position,y,this._tiltOrigin),b=$.multiplyByVector(p,y,this._tiltOffset);h.add(A,b,t.position),t.lookAtWorldPosition(A,s)}update(t){let n=(xn()-this._lastUpdateTime)*Un.SECONDS_PER_MILLISECOND,{canvas:i}=t,{clientWidth:r,clientHeight:o}=i;if(n===0||r===0||o===0){this._lastUpdateTime=xn(),this._dragDelta.x=0,this._dragDelta.y=0;return}let s=this._target;if(this.isDragging&&!this._hasTarget){let a=this._screenSpaceDragPosition;this.useDragPosition||(a=this._screenSpaceOrigin,a.x=r/2,a.y=o/2);let c=this.pickWorldPosition(t,a,this._target),u=l(c);this._hasTarget=u,s=c}if(this._hasTarget){let{camera:a,ellipsoid:c}=t,u=c.geodeticSurfaceNormal(s,this._axis),f=h.negate(u,this._axis);if(this.orbitEnabled){let d=this._dragDelta.x/r;d=P.clamp(d,-this.maximumMovementRatio,this.maximumMovementRatio),d*=this.orbitMagnitude*P.TWO_PI,this.orbit(a,s,f,d,n,c)}if(this.tiltEnabled){let d=this._dragDelta.y/o;d=P.clamp(d,-this.maximumMovementRatio,this.maximumMovementRatio),d*=this.tiltMagnitude*P.PI,this.tilt(a,s,f,d,n,c)}}this._lastUpdateTime=xn(),this._dragDelta.x=0,this._dragDelta.y=0}},D2e=Tae;var Eae=class e{static _getDefaultDragInputs(){return[Object.freeze({button:hc.MIDDLE})]}static _getDefaultScrollInputs(){return[fn.WHEEL]}constructor(t=H.EMPTY_OBJECT){this._enabled=!0,this._handler=void 0,this._lastUpdateTime=void 0,this.usePointerPosition=!1,this.dragInputs=t.dragInputs??e._getDefaultDragInputs(),this.scrollInputs=t.scrollInputs??e._getDefaultScrollInputs(),this._dragInputState=void 0,this._dragDelta=new U,this._scrollDelta=0,this._zoomInputVelocity=0,this._screenSpaceScrollPosition=new U,this._screenSpaceDragPosition=new U,this._screenSpaceOrigin=new U,this.zoomSensitivity=.2,this.pickWorldPosition=C0,this.zoomDistanceRatio=.4,this.inertiaEnabled=!1,this.inertialDecay=6,this.minimumZoomDistance=0,this.maximumZoomDistance=1e5,this.minimumZoomVelocity=P.EPSILON20,this.maximumZoomVelocity=1,this.dampingEnabled=!0,this.zoomAnimationDuration=.45,this._target=new h,this._zoomDirection=new h,this._zoomDampenedResults={velocity:0,value:0}}get enabled(){return this._enabled}set enabled(t){this._enabled=t,t?(this._lastUpdateTime=xn(),this._scrollDelta=0,this._dragDelta.x=0,this._dragDelta.y=0):l(this._dragInputState)&&(this._dragInputState.isDragging=!1)}get isDragging(){return l(this._dragInputState)&&this._dragInputState.isDragging}connectedCallback(t){let n=new Ta(t);this._handler=n;for(let i of this.scrollInputs)n.setInputAction(this._handleZoom.bind(this),i);n.setInputAction(this._handleZoomPosition.bind(this),fn.MOUSE_MOVE),this._dragInputState=v0.registerDragInputBindings(n,this.dragInputs,{start:this._handleStartDrag.bind(this),change:this._handleDrag.bind(this)})}disconnectedCallback(t){let n=this._handler;l(n)&&!n.isDestroyed()&&n.destroy()}firstUpdate(){this._lastUpdateTime=xn(),this._scrollDelta=0,this._dragDelta.x=0,this._dragDelta.y=0}get zoomDistance(){return this._zoomDampenedResults.value}get zoomVelocity(){return this._zoomDampenedResults.velocity}set zoomVelocity(t){this._zoomDampenedResults.velocity=t}update(t){let i=(xn()-this._lastUpdateTime)*Un.SECONDS_PER_MILLISECOND,{canvas:r}=t,{clientWidth:o,clientHeight:s}=r;if(i===0||o===0||s===0){this._lastUpdateTime=xn(),this._scrollDelta=0,this._dragDelta.x=0,this._dragDelta.y=0;return}let a=this._scrollDelta+this._dragDelta.y;if(a===0&&this.inertiaEnabled){let A=Math.exp(-this.inertialDecay*i);this._zoomInputVelocity*=A,a=this._zoomInputVelocity*i}if(Math.abs(this.zoomVelocity)<this.minimumZoomVelocity&&a<=P.EPSILON3&&a>=-P.EPSILON3&&this.zoomVelocity<=P.EPSILON3){this._lastUpdateTime=xn(),this._scrollDelta=0,this._dragDelta.x=0,this._dragDelta.y=0,this.zoomVelocity=0;return}this._zoomInputVelocity=P.clamp(a/i,-this.maximumZoomVelocity,this.maximumZoomVelocity);let{camera:c,ellipsoid:u}=t,f=c.direction,d=h.magnitude(c.positionWC)-u.maximumRadius,p=this.isDragging?this._screenSpaceDragPosition:this._screenSpaceScrollPosition;this.useDragPosition||(p=this._screenSpaceOrigin,p.x=o/2,p.y=s/2);let g=this.pickWorldPosition(t,p,this._target);l(g)&&(f=h.subtract(g,c.positionWC,this._zoomDirection),f=h.normalize(f,this._zoomDirection),d=h.distance(g,c.positionWC)),d=P.clamp(d,d>0?this.minimumZoomDistance:-this.maximumZoomDistance,d>0?this.maximumZoomDistance:-this.minimumZoomDistance);let m=a*d*this.zoomDistanceRatio,y=this.dampingEnabled?this.zoomAnimationDuration:void 0;this._zoomDampenedResults=P.smoothDamp(0,m,this.zoomVelocity,i,void 0,y,this._zoomDampenedResults),c.move(f,this.zoomDistance),this._lastUpdateTime=xn(),this._scrollDelta=0,this._dragDelta.x=0,this._dragDelta.y=0}_handleZoom(t){this._scrollDelta+=t*this.zoomSensitivity}_handleZoomPosition(t){this._screenSpaceScrollPosition.x=t.endPosition.x,this._screenSpaceScrollPosition.y=t.endPosition.y}_handleStartDrag(t){this.enabled&&(this._screenSpaceDragPosition.x=t.position.x,this._screenSpaceDragPosition.y=t.position.y,this._dragDelta.x=0,this._dragDelta.y=0)}_handleDrag(t){this._dragDelta.x+=t.endPosition.x-t.startPosition.x,this._dragDelta.y+=t.endPosition.y-t.startPosition.y}},R2e=Eae;var O2e={FLOAT:"float",VEC2:"vec2",VEC3:"vec3",VEC4:"vec4",MAT2:"mat2",MAT3:"mat3",MAT4:"mat4"};Object.freeze(O2e);var M2e=O2e;var N2e={SIGX:"SIGX",SIGY:"SIGY",SIGZ:"SIGZ",VARX:"VARX",VARY:"VARY",VARZ:"VARZ",SIGR:"VARZ"};Object.freeze(N2e);var L2e=N2e;function M6t(e){async function t({data:i}){let r=[],o={id:i.id,result:void 0,error:void 0};self.CESIUM_BASE_URL=i.baseUrl;try{let s=await e(i.parameters,r);o.result=s}catch(s){s instanceof Error?o.error={name:s.name,message:s.message,stack:s.stack}:o.error=s}i.canTransferArrayBuffer||(r.length=0);try{postMessage(o,r)}catch(s){o.result=void 0,o.error=`postMessage failed with error: ${cg(s)} - with responseMessage: ${JSON.stringify(o)}`,postMessage(o)}}function n(i){postMessage({id:i.data?.id,error:`postMessage failed with error: ${JSON.stringify(i)}`})}return self.onmessage=t,self.onmessageerror=n,self}var F2e=M6t;globalThis.CESIUM_VERSION="1.145.0";var XM;typeof ko<"u"&&(XM=ko);(function(){/*! +`;function dI(e,t){this._tilingScheme=e,this._maximumLevel=t,this._rootNodes=[]}var eE=new ie;function XUt(e,t,n,i){let r=i.length;for(let o=0;o<r;++o){let s=i[o];if(s.x===t&&s.y===n&&s.level===e)return!0}return!1}dI.prototype.addAvailableTileRange=function(e,t,n,i,r){let o=this._tilingScheme,s=this._rootNodes;if(e===0)for(let p=n;p<=r;++p)for(let g=t;g<=i;++g)XUt(e,g,p,s)||s.push(new uI(o,void 0,0,g,p));o.tileXYToRectangle(t,n,e,eE);let a=eE.west,c=eE.north;o.tileXYToRectangle(i,r,e,eE);let u=eE.east,f=eE.south,d=new QUt(e,a,f,u,c);for(let p=0;p<s.length;++p){let g=s[p];_se(g.extent,d)&&ezt(this._maximumLevel,g,d)}};dI.prototype.computeMaximumLevelAtPosition=function(e){let t;for(let n=0;n<this._rootNodes.length;++n){let i=this._rootNodes[n];if(fI(i.extent,e)){t=i;break}}return l(t)?CM(void 0,t,e):-1};var KUt=[],$Ut=[],JUt=new ie,ZUt=new ie;dI.prototype.computeBestAvailableLevelOverRectangle=function(e){let t=KUt;t.length=0,e.east<e.west?(t.push(ie.fromRadians(-Math.PI,e.south,e.east,e.north,JUt)),t.push(ie.fromRadians(e.west,e.south,Math.PI,e.north,ZUt))):t.push(e);let n=$Ut;n.length=0;let i;for(i=0;i<this._rootNodes.length;++i)vM(n,this._rootNodes[i],t);for(i=n.length-1;i>=0;--i)if(l(n[i])&&n[i].length===0)return i;return 0};var NLe=new he;dI.prototype.isTileAvailable=function(e,t,n){let i=this._tilingScheme.tileXYToRectangle(t,n,e,eE);return ie.center(i,NLe),this.computeMaximumLevelAtPosition(NLe)>=e};dI.prototype.computeChildMaskForTile=function(e,t,n){let i=e+1;if(i>=this._maximumLevel)return 0;let r=0;return r|=this.isTileAvailable(i,2*t,2*n+1)?1:0,r|=this.isTileAvailable(i,2*t+1,2*n+1)?2:0,r|=this.isTileAvailable(i,2*t,2*n)?4:0,r|=this.isTileAvailable(i,2*t+1,2*n)?8:0,r};function uI(e,t,n,i,r){this.tilingScheme=e,this.parent=t,this.level=n,this.x=i,this.y=r,this.extent=e.tileXYToRectangle(i,r,n),this.rectangles=[],this._sw=void 0,this._se=void 0,this._nw=void 0,this._ne=void 0}Object.defineProperties(uI.prototype,{nw:{get:function(){return this._nw||(this._nw=new uI(this.tilingScheme,this,this.level+1,this.x*2,this.y*2)),this._nw}},ne:{get:function(){return this._ne||(this._ne=new uI(this.tilingScheme,this,this.level+1,this.x*2+1,this.y*2)),this._ne}},sw:{get:function(){return this._sw||(this._sw=new uI(this.tilingScheme,this,this.level+1,this.x*2,this.y*2+1)),this._sw}},se:{get:function(){return this._se||(this._se=new uI(this.tilingScheme,this,this.level+1,this.x*2+1,this.y*2+1)),this._se}}});function QUt(e,t,n,i,r){this.level=e,this.west=t,this.south=n,this.east=i,this.north=r}function _se(e,t){let n=Math.max(e.west,t.west),i=Math.max(e.south,t.south),r=Math.min(e.east,t.east),o=Math.min(e.north,t.north);return i<o&&n<r}function ezt(e,t,n){for(;t.level<e;)if(V9(t.nw.extent,n))t=t.nw;else if(V9(t.ne.extent,n))t=t.ne;else if(V9(t.sw.extent,n))t=t.sw;else if(V9(t.se.extent,n))t=t.se;else break;if(t.rectangles.length===0||t.rectangles[t.rectangles.length-1].level<=n.level)t.rectangles.push(n);else{let i=Pr(t.rectangles,n.level,tzt);i<0&&(i=~i),t.rectangles.splice(i,0,n)}}function tzt(e,t){return e.level-t}function V9(e,t){return t.west>=e.west&&t.east<=e.east&&t.south>=e.south&&t.north<=e.north}function fI(e,t){return t.longitude>=e.west&&t.longitude<=e.east&&t.latitude>=e.south&&t.latitude<=e.north}function CM(e,t,n){let i=0,r=!1;for(;!r;){let o=t._nw&&fI(t._nw.extent,n),s=t._ne&&fI(t._ne.extent,n),a=t._sw&&fI(t._sw.extent,n),c=t._se&&fI(t._se.extent,n);if(o+s+a+c>1){o&&(i=Math.max(i,CM(t,t._nw,n))),s&&(i=Math.max(i,CM(t,t._ne,n))),a&&(i=Math.max(i,CM(t,t._sw,n))),c&&(i=Math.max(i,CM(t,t._se,n)));break}else o?t=t._nw:s?t=t._ne:a?t=t._sw:c?t=t._se:r=!0}for(;t!==e;){let o=t.rectangles;for(let s=o.length-1;s>=0&&o[s].level>i;--s){let a=o[s];fI(a,n)&&(i=a.level)}t=t.parent}return i}function vM(e,t,n){if(!t)return;let i,r=!1;for(i=0;i<n.length;++i)r=r||_se(t.extent,n[i]);if(!r)return;let o=t.rectangles;for(i=0;i<o.length;++i){let s=o[i];e[s.level]||(e[s.level]=n),e[s.level]=nzt(e[s.level],s)}vM(e,t._nw,n),vM(e,t._ne,n),vM(e,t._sw,n),vM(e,t._se,n)}function nzt(e,t){let n=[];for(let i=0;i<e.length;++i){let r=e[i];_se(r,t)?(r.west<t.west&&n.push(new ie(r.west,r.south,t.west,r.north)),r.east>t.east&&n.push(new ie(t.east,r.south,r.east,r.north)),r.south<t.south&&n.push(new ie(Math.max(t.west,r.west),r.south,Math.min(t.east,r.east),t.south)),r.north>t.north&&n.push(new ie(Math.max(t.west,r.west),t.north,Math.min(t.east,r.east),r.north))):n.push(r)}return n}var _0=dI;var izt=15;function LLe(e){this.ellipsoid=e.ellipsoid??ee.default,this.credit=void 0,this.tilingScheme=void 0,this.height=void 0,this.width=void 0,this.encoding=void 0,this.lodCount=void 0,this.hasAvailability=!1,this.tilesAvailable=void 0,this.tilesAvailabilityLoaded=void 0,this.levelZeroMaximumGeometricError=void 0,this.terrainDataStructure=void 0}LLe.prototype.build=function(e){e._credit=this.credit,e._tilingScheme=this.tilingScheme,e._height=this.height,e._width=this.width,e._encoding=this.encoding,e._lodCount=this.lodCount,e._hasAvailability=this.hasAvailability,e._tilesAvailable=this.tilesAvailable,e._tilesAvailabilityLoaded=this.tilesAvailabilityLoaded,e._levelZeroMaximumGeometricError=this.levelZeroMaximumGeometricError,e._terrainDataStructure=this.terrainDataStructure};function rzt(e,t){let n=t.copyrightText;l(n)&&(e.credit=new It(n));let i=t.spatialReference,r=i.latestWkid??i.wkid,o=t.extent,s={ellipsoid:e.ellipsoid};if(r===4326)s.rectangle=ie.fromDegrees(o.xmin,o.ymin,o.xmax,o.ymax),e.tilingScheme=new ir(s);else if(r===3857){let u=Math.PI*e.ellipsoid.maximumRadius;t.extent.xmax>u&&(t.extent.xmax=u),t.extent.ymax>u&&(t.extent.ymax=u),t.extent.xmin<-u&&(t.extent.xmin=-u),t.extent.ymin<-u&&(t.extent.ymin=-u),s.rectangleSouthwestInMeters=new U(o.xmin,o.ymin),s.rectangleNortheastInMeters=new U(o.xmax,o.ymax),e.tilingScheme=new Uo(s)}else throw new oe("Invalid spatial reference");let a=t.tileInfo;if(!l(a))throw new oe("tileInfo is required");e.width=a.rows+1,e.height=a.cols+1,e.encoding=a.format==="LERC"?om.LERC:om.NONE,e.lodCount=a.lods.length-1,(e.hasAvailability=t.capabilities.indexOf("Tilemap")!==-1)&&(e.tilesAvailable=new _0(e.tilingScheme,e.lodCount),e.tilesAvailable.addAvailableTileRange(0,0,0,e.tilingScheme.getNumberOfXTilesAtLevel(0),e.tilingScheme.getNumberOfYTilesAtLevel(0)),e.tilesAvailabilityLoaded=new _0(e.tilingScheme,e.lodCount)),e.levelZeroMaximumGeometricError=Xr.getEstimatedLevelZeroGeometricErrorForAHeightmap(e.tilingScheme.ellipsoid,e.width,e.tilingScheme.getNumberOfXTilesAtLevel(0)),t.bandCount>1&&console.log("ArcGISTiledElevationTerrainProvider: Terrain data has more than 1 band. Using the first one."),l(t.minValues)&&l(t.maxValues)?e.terrainDataStructure={elementMultiplier:1,lowestEncodedHeight:t.minValues[0],highestEncodedHeight:t.maxValues[0]}:e.terrainDataStructure={elementMultiplier:1}}async function ozt(e,t,n){try{let i=await t.fetchJson();rzt(e,i)}catch(i){let r=`An error occurred while accessing ${t}.`;throw no.reportError(void 0,n,l(n)?n._errorEvent:void 0,r),i}}function ZA(){this._resource=void 0,this._credit=void 0,this._tilingScheme=void 0,this._levelZeroMaximumGeometricError=void 0,this._maxLevel=void 0,this._terrainDataStructure=void 0,this._width=void 0,this._height=void 0,this._encoding=void 0,this._lodCount=void 0,this._hasAvailability=!1,this._tilesAvailable=void 0,this._tilesAvailabilityLoaded=void 0,this._availableCache={},this._errorEvent=new be}Object.defineProperties(ZA.prototype,{errorEvent:{get:function(){return this._errorEvent}},credit:{get:function(){return this._credit}},tilingScheme:{get:function(){return this._tilingScheme}},hasWaterMask:{get:function(){return!1}},hasVertexNormals:{get:function(){return!1}},availability:{get:function(){return this._tilesAvailable}}});ZA.fromUrl=async function(e,t){t=t??H.EMPTY_OBJECT,e=await Promise.resolve(e);let n=De.createIfNeeded(e);n.appendForwardSlash(),l(t.token)&&(n=n.getDerivedResource({queryParameters:{token:t.token}}));let i=n.getDerivedResource({queryParameters:{f:"pjson"}}),r=new LLe(t);await ozt(r,i);let o=new ZA(t);return r.build(o),o._resource=n,o};ZA.prototype.requestTileGeometry=function(e,t,n,i){let r=this._resource.getDerivedResource({url:`tile/${n}/${t}/${e}`,request:i}),o=this._hasAvailability,s=Promise.resolve(!0),a;if(o&&!l(yse(this,n+1,e*2,t*2))){let d=FLe(this,n+1,e*2,t*2);s=d.promise,a=d.request}let c=r.fetchArrayBuffer();if(!l(c)||!l(s))return;let u=this,f=this._tilesAvailable;return Promise.all([c,s]).then(function(d){return new sl({buffer:d[0],width:u._width,height:u._height,childTileMask:o?f.computeChildMaskForTile(n,e,t):izt,structure:u._terrainDataStructure,encoding:u._encoding})}).catch(async function(d){if(l(a)&&a.state===wi.CANCELLED){i.cancel();try{await i.deferred?.promise}catch{}return i.state=wi.CANCELLED,Promise.reject(d)}return Promise.reject(d)})};function yse(e,t,n,i){if(!e._hasAvailability)return;let r=e._tilesAvailabilityLoaded,o=e._tilesAvailable;if(t>e._lodCount)return!1;if(o.isTileAvailable(t,n,i))return!0;if(r.isTileAvailable(t,n,i))return!1}ZA.prototype.getLevelMaximumGeometricError=function(e){return this._levelZeroMaximumGeometricError/(1<<e)};ZA.prototype.getTileDataAvailable=function(e,t,n){if(!this._hasAvailability)return;let i=yse(this,n,e,t);if(l(i))return i;FLe(this,n,e,t)};ZA.prototype.loadTileDataAvailability=function(e,t,n){};function szt(e,t,n,i){let r=t-1,o=n-1,s=i[e.y*t+e.x],a=[],c={startX:e.x,startY:e.y,endX:0,endY:0},u=new U(e.x+1,e.y+1),f=!1,d=!1;for(;!(f&&d);){let p=u.x,g=d?u.y+1:u.y;if(!f){for(let m=e.y;m<g;++m)if(i[m*t+u.x]!==s){f=!0;break}f?(a.push(new U(u.x,e.y)),--u.x,--p,c.endX=u.x):u.x===r?(c.endX=u.x,f=!0):++u.x}if(!d){let m=u.y*t;for(let y=e.x;y<=p;++y)if(i[m+y]!==s){d=!0;break}d?(a.push(new U(e.x,u.y)),--u.y,c.endY=u.y):u.y===o?(c.endY=u.y,d=!0):++u.y}}return{endingIndices:a,range:c,value:s}}function azt(e,t,n,i,r){let o=[];if(r.every(function(c){return c===r[0]}))return r[0]===1&&o.push({startX:e,startY:t,endX:e+n-1,endY:t+i-1}),o;let a=[new U(0,0)];for(;a.length>0;){let c=a.pop(),u=szt(c,n,i,r);if(u.value===1){let d=u.range;d.startX+=e,d.endX+=e,d.startY+=t,d.endY+=t,o.push(d)}let f=u.endingIndices;f.length>0&&(a=a.concat(f))}return o}function FLe(e,t,n,i){if(!e._hasAvailability)return{};let r=Math.floor(n/128)*128,o=Math.floor(i/128)*128,s=Math.min(1<<t,128),a=`tilemap/${t}/${o}/${r}/${s}/${s}`,c=e._availableCache;if(l(c[a]))return c[a];let u=new Oo({throttle:!1,throttleByServer:!0,type:oa.TERRAIN}),d=e._resource.getDerivedResource({url:a,request:u}).fetchJson();return l(d)?(d=d.then(function(p){let g=azt(r,o,s,s,p.data);e._tilesAvailabilityLoaded.addAvailableTileRange(t,r,o,r+s,o+s);let m=e._tilesAvailable;for(let y=0;y<g.length;++y){let A=g[y];m.addAvailableTileRange(t,A.startX,A.startY,A.endX,A.endY)}return yse(e,t,n,i)}),c[a]={promise:d,request:u},d=d.finally(function(p){return delete c[a],p}),{promise:d,request:u}):{}}var BLe=ZA;var kLe="https://dev.virtualearth.net/REST/v1/Locations";function Ase(e){e=e??H.EMPTY_OBJECT;let t=e.key;this._key=t;let n={key:t};l(e.culture)&&(n.culture=e.culture),this._resource=new De({url:kLe,queryParameters:n}),this._credit=new It('<img src="http://dev.virtualearth.net/Branding/logo_powered_by.png"/>',!1)}Object.defineProperties(Ase.prototype,{url:{get:function(){return kLe}},key:{get:function(){return this._key}},credit:{get:function(){return this._credit}}});Ase.prototype.geocode=async function(e){return this._resource.getDerivedResource({queryParameters:{query:e}}).fetchJsonp("jsonp").then(function(n){return n.resourceSets.length===0?[]:n.resourceSets[0].resources.map(function(r){let o=r.bbox,s=o[0],a=o[1],c=o[2],u=o[3];return{displayName:r.name,destination:ie.fromDegrees(a,s,u,c)}})})};var ULe=Ase;function bse(){}Object.defineProperties(bse.prototype,{credit:{get:function(){}}});bse.prototype.geocode=function(e){let t=e.match(/[^\s,\n]+/g);if(t.length===2||t.length===3){let n=+t[0],i=+t[1],r=t.length===3?+t[2]:300;if(isNaN(n)&&isNaN(i)){let o=/^(\d+.?\d*)([nsew])/i;for(let s=0;s<t.length;++s){let a=t[s].match(o);o.test(t[s])&&a.length===3&&(/^[ns]/i.test(a[2])?i=/^[n]/i.test(a[2])?+a[1]:-a[1]:/^[ew]/i.test(a[2])&&(n=/^[e]/i.test(a[2])?+a[1]:-a[1]))}}if(!isNaN(n)&&!isNaN(i)&&!isNaN(r)){let o={displayName:e,destination:h.fromDegrees(n,i,r)};return Promise.resolve([o])}}return Promise.resolve([])};var zLe=bse;var czt=new se,VLe=new h,hI=new h;function lzt(e){let t=e.points,n=e.times;if(t.length<3){let i=n[0],r=1/(n[1]-i),o=t[0],s=t[1];return function(a,c){l(c)||(c=new h);let u=(a-i)*r;return h.lerp(o,s,u,c)}}return function(i,r){l(r)||(r=new h);let o=e._lastTimeIndex=e.findTimeInterval(i,e._lastTimeIndex),s=(i-n[o])/(n[o+1]-n[o]),a=czt;a.z=s,a.y=s*s,a.x=a.y*s,a.w=1;let c,u,f,d,p;return o===0?(c=t[0],u=t[1],f=e.firstTangent,d=h.subtract(t[2],c,VLe),h.multiplyByScalar(d,.5,d),p=M.multiplyByVector(Tx.hermiteCoefficientMatrix,a,a)):o===t.length-2?(c=t[o],u=t[o+1],d=e.lastTangent,f=h.subtract(u,t[o-1],VLe),h.multiplyByScalar(f,.5,f),p=M.multiplyByVector(Tx.hermiteCoefficientMatrix,a,a)):(c=t[o-1],u=t[o],f=t[o+1],d=t[o+2],p=M.multiplyByVector(QA.catmullRomCoefficientMatrix,a,a)),r=h.multiplyByScalar(c,p.x,r),h.multiplyByScalar(u,p.y,hI),h.add(r,hI,r),h.multiplyByScalar(f,p.z,hI),h.add(r,hI,r),h.multiplyByScalar(d,p.w,hI),h.add(r,hI,r)}}var uzt=new h,fzt=new h;function QA(e){e=e??H.EMPTY_OBJECT;let t=e.points,n=e.times,i=e.firstTangent,r=e.lastTangent;if(t.length>2&&(l(i)||(i=uzt,h.multiplyByScalar(t[1],2,i),h.subtract(i,t[2],i),h.subtract(i,t[0],i),h.multiplyByScalar(i,.5,i)),!l(r))){let o=t.length-1;r=fzt,h.multiplyByScalar(t[o-1],2,r),h.subtract(t[o],r,r),h.add(r,t[o-2],r),h.multiplyByScalar(r,.5,r)}this._times=n,this._points=t,this._firstTangent=h.clone(i),this._lastTangent=h.clone(r),this._evaluateFunction=lzt(this),this._lastTimeIndex=0}Object.defineProperties(QA.prototype,{times:{get:function(){return this._times}},points:{get:function(){return this._points}},firstTangent:{get:function(){return this._firstTangent}},lastTangent:{get:function(){return this._lastTangent}}});QA.catmullRomCoefficientMatrix=new M(-.5,1,-.5,0,1.5,-2.5,0,1,-1.5,2,.5,0,.5,-.5,0,0);QA.prototype.findTimeInterval=Or.prototype.findTimeInterval;QA.prototype.wrapTime=Or.prototype.wrapTime;QA.prototype.clampTime=Or.prototype.clampTime;QA.prototype.evaluate=function(e,t){return this._evaluateFunction(e,t)};var jLe=QA;var xse={},dzt={positions:void 0,normals:void 0,indices:void 0,edgeIndicesWest:void 0,edgeIndicesSouth:void 0,edgeIndicesEast:void 0,edgeIndicesNorth:void 0},hzt=new he,mzt=new h,pzt=new M,gzt=new M,_zt=new M,yzt=new h,Azt=new h,bzt=new h,xzt=new h,Tzt=new he,Ezt=new U,SM=new h,Czt=new U,vzt=new h,Szt=new h,j9=function(e,t){return e-t};xse.createMesh=async function(e){e=e??H.EMPTY_OBJECT;let{exaggeration:t=1,exaggerationRelativeHeight:n=0,hasVertexNormals:i,hasWebMercatorT:r,gltf:o,minimumHeight:s,maximumHeight:a,skirtHeight:c}=e,f=t!==1,d=ue.clone(e.boundingSphere,new ue),p=en.clone(e.orientedBoundingBox,new en),g=h.clone(e.horizonOcclusionPoint,new h),m=ee.clone(e.ellipsoid,new ee),y=ie.clone(e.rectangle,new ie);await(o.extensionsRequired!==void 0&&o.extensionsRequired.indexOf("EXT_meshopt_compression")!==-1?Ty.ready:Promise.resolve(void 0));let x=y.west,T=y.south,E=y.north,v=y.width,S=y.height,I=ie.center(y,hzt);I.height=.5*(s+a);let R=he.toCartesian(I,m,mzt),O=At.eastNorthUpToFixedFrame(R,m,pzt),L=M.inverseTransformation(O,gzt),_=M.unpack(o.nodes[0].matrix,0,_zt);_=M.multiply(qi.Y_UP_TO_Z_UP,_,_);let C=oVt(o,i,dzt),w=Xr.getSkirtVertexCount(C.edgeIndicesWest,C.edgeIndicesSouth,C.edgeIndicesEast,C.edgeIndicesNorth),D=C.positions,N=C.normals,F=C.indices,V=D.length/3,B=V+w,j=F.length,k=Xr.getSkirtIndexCountWithFilledCorners(w),G=B<=65535?Uint16Array:Uint32Array,q=new G(j+k);q.set(F);let Q=new G(C.edgeIndicesWest),W=new G(C.edgeIndicesSouth),J=new G(C.edgeIndicesEast),Z=new G(C.edgeIndicesNorth),ae=new G(Q).sort(),Ae=new G(W).sort(),fe=new G(J).sort(),xe=new G(Z).sort(),ge=Ti.geodeticLatitudeToMercatorAngle(T),ve=1/(Ti.geodeticLatitudeToMercatorAngle(E)-ge),Re=h.fromElements(Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY,yzt),Qe=h.fromElements(Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY,Azt),He=new Po(d.center,void 0,void 0,void 0,void 0,i,r,f,t,n),Ye=He.stride,Ke=new Float32Array(B*Ye),Pe=0;for(let st=0;st<V;st++){let vt=h.unpack(D,st*3,bzt),jt=M.multiplyByPoint(_,vt,xzt),lt=he.fromCartesian(jt,m,Tzt),{longitude:mt,latitude:ft,height:Yt}=lt,rt=(mt-x)/v,ht=(ft-T)/S;rt=P.clamp(rt,0,1),ht=P.clamp(ht,0,1),Pr(ae,st,j9)>=0?rt=0:Pr(fe,st,j9)>=0&&(rt=1),Pr(Ae,st,j9)>=0?ht=0:Pr(xe,st,j9)>=0&&(ht=1);let Li=U.fromElements(rt,ht,Ezt),Yn;if(i){let ui=h.unpack(N,st*3,SM);ui=M.multiplyByPointAsVector(_,ui,SM),ui=h.normalize(ui,SM),Yn=cn.octEncode(ui,Czt)}let yi;r&&(yi=(Ti.geodeticLatitudeToMercatorAngle(ft)-ge)*ve);let zi;f&&(zi=m.geodeticSurfaceNormal(jt,vzt)),Pe=He.encode(Ke,Pe,jt,Li,Yt,Yn,yi,zi);let Si=M.multiplyByPoint(L,jt,Szt);Re=h.minimumByComponent(Si,Re,Re),Qe=h.maximumByComponent(Si,Qe,Qe)}let qe=new Sc(h.clone(He.center,new h),Ke,q,j,V,s,a,y,ue.clone(d,new ue),h.clone(g,new h),Ye,en.clone(p,new en),He,Q,W,J,Z);return KLe(qe,y,m,Re,Qe,O,L,c),Promise.resolve(qe)};var wzt=new U,Izt=new U,Pzt=new Array(6),Dzt=new U,Rzt=new U,Ozt=new U,Mzt=new h,Nzt=new h,Lzt=new h,Fzt=new he,Bzt=new h,kzt=new he,Uzt=new he,HLe=new h,zzt=new h,Vzt=new h,jzt=new h,Hzt=new h,Gzt=new h,Wzt=new h,qzt=new h,Yzt=new M,Xzt=new M,GLe=new U,Kzt=new U,$zt=new h,Jzt=new ue,Zzt=new en,Qzt=new rd,WLe=new h,qLe=new U,eVt=new U,YLe=new h,tVt=new h;function nVt(e){let t=e.meshes[0].primitives[0],n=e.accessors[t.attributes.POSITION],i=e.bufferViews[n.bufferView],r=n.count,o=i.extensions?i.extensions.EXT_meshopt_compression:void 0;if(o===void 0){let g=e.buffers[i.buffer].extras._pipeline.source;return new Float32Array(g.buffer,g.byteOffset+(i.byteOffset??0)+(n.byteOffset??0),r*3)}let s=e.buffers[o.buffer].extras._pipeline.source,a=new Uint8Array(s.buffer,s.byteOffset+(o.byteOffset??0)+(n.byteOffset??0),o.byteLength),c=o.byteStride,u=c===4?Uint8Array:Uint16Array,f=new u(r*4);Ty.decodeVertexBuffer(new Uint8Array(f.buffer),r,c,a);let d=(1<<f.BYTES_PER_ELEMENT*8)-1,p=new Float32Array(r*3);for(let g=0;g<r;g++)p[g*3+0]=f[g*4+0]/d,p[g*3+1]=f[g*4+1]/d,p[g*3+2]=f[g*4+2]/d;return p}function iVt(e){let t=e.meshes[0].primitives[0],n=e.accessors[t.attributes.NORMAL],i=e.bufferViews[n.bufferView],r=n.count,o=i.extensions?i.extensions.EXT_meshopt_compression:void 0;if(o===void 0){let d=e.buffers[i.buffer].extras._pipeline.source;return new Float32Array(d.buffer,d.byteOffset+(i.byteOffset??0)+(n.byteOffset??0),r*3)}let s=e.buffers[o.buffer].extras._pipeline.source,a=new Uint8Array(s.buffer,s.byteOffset+(o.byteOffset??0)+(n.byteOffset??0),o.byteLength),c=o.byteStride,u=new Int8Array(r*c);Ty.decodeVertexBuffer(new Uint8Array(u.buffer),r,c,a);let f=new Float32Array(r*3);for(let d=0;d<r;d++){let p=Math.max(u[d*4+0]/127,-1),g=Math.max(u[d*4+1]/127,-1),m=1-(Math.abs(p)+Math.abs(g));if(m<0){let A=p,b=g;p=(1-Math.abs(b))*P.signNotZero(A),g=(1-Math.abs(A))*P.signNotZero(b)}let y=SM;y.x=p,y.y=g,y.z=m,y=h.normalize(y,SM),f[d*3+0]=y.x,f[d*3+1]=y.y,f[d*3+2]=y.z}return f}function rVt(e){let t=e.meshes[0].primitives[0],n=e.accessors[t.indices],i=e.bufferViews[n.bufferView],r=n.count,o=n.componentType===Y.UNSIGNED_SHORT?Uint16Array:Uint32Array,s=i.extensions?i.extensions.EXT_meshopt_compression:void 0;if(s===void 0){let f=e.buffers[i.buffer].extras._pipeline.source;return new o(f.buffer,f.byteOffset+(i.byteOffset??0)+(n.byteOffset??0),r)}let a=e.buffers[s.buffer].extras._pipeline.source,c=new Uint8Array(a.buffer,a.byteOffset+(s.byteOffset??0)+(n.byteOffset??0),s.byteLength),u=new o(r);return Ty.decodeIndexBuffer(new Uint8Array(u.buffer),r,s.byteStride,c),u}function H9(e,t){let n=e.meshes[0].primitives[0],i=e.accessors[n.extensions.CESIUM_tile_edges[t]],r=e.bufferViews[i.bufferView],o=i.count,s=i.componentType===Y.UNSIGNED_SHORT?Uint16Array:Uint32Array,a=r.extensions?r.extensions.EXT_meshopt_compression:void 0;if(a===void 0){let p=e.buffers[r.buffer].extras._pipeline.source;return new s(p.buffer,p.byteOffset+(r.byteOffset??0)+(i.byteOffset??0),o)}let c=e.buffers[a.buffer].extras._pipeline.source,u=new Uint8Array(c.buffer,c.byteOffset+(a.byteOffset??0)+(i.byteOffset??0),a.byteLength),f=new s(o),d=a.byteStride;return Ty.decodeIndexSequence(new Uint8Array(f.buffer),o,d,u),f}function oVt(e,t,n){return n.positions=nVt(e),n.normals=t?iVt(e):void 0,n.indices=rVt(e),n.edgeIndicesWest=H9(e,"left"),n.edgeIndicesSouth=H9(e,"bottom"),n.edgeIndicesEast=H9(e,"right"),n.edgeIndicesNorth=H9(e,"top"),n}xse.upsampleMesh=function(e){e=e??H.EMPTY_OBJECT;let{isEastChild:t,isNorthChild:n,parentMinimumHeight:i,parentMaximumHeight:r,skirtHeight:o}=e,s=e.parentIndexCountWithoutSkirts,a=e.parentIndices,c=e.parentVertexCountWithoutSkirts,u=e.parentVertices,f=Po.clone(e.parentEncoding,new Po),d=f.hasVertexNormals,p=f.hasWebMercatorT,g=f.exaggeration,m=f.exaggerationRelativeHeight,A=g!==1,b=ie.clone(e.rectangle,new ie),x=ee.clone(e.ellipsoid),T=[],E=[],v=[],S=[],I=[],R=[],O=[],L=[];yVt(t,n,s,a,c,u,f,S,I,R,O,L,T,v,E);let _=ie.center(b,Fzt);_.height=.5*(i+r);let C=he.toCartesian(_,x,Bzt),w=T.length,D=new Po(C,void 0,void 0,void 0,void 0,d,p,A,g,m),N=D.stride,F=Xr.getSkirtVertexCount(I,R,O,L),V=w+F,B=S.length,j=Xr.getSkirtIndexCountWithFilledCorners(F),k=B+j,G=V<=65535?Uint16Array:Uint32Array,q=new G(k);q.set(S);let Q=new G(I),W=new G(R),J=new G(O),Z=new G(L),ae=new Float32Array(V*N),Ae=0,fe=At.eastNorthUpToFixedFrame(C,x,Yzt),xe=M.inverseTransformation(fe,Xzt),ge=b.west,we=b.east,ve=b.south,Re=b.north,Qe=Ti.geodeticLatitudeToMercatorAngle(ve),Ye=1/(Ti.geodeticLatitudeToMercatorAngle(Re)-Qe),Ke=Number.POSITIVE_INFINITY,Pe=Number.NEGATIVE_INFINITY,qe=h.fromElements(Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY,Wzt),st=h.fromElements(Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY,qzt);for(let Yt=0;Yt<w;Yt++){let rt=T[Yt],ht=a[rt*3+0],Li=a[rt*3+1],Yn=a[rt*3+2],yi=Kzt;yi.x=E[Yt*2+0],yi.y=E[Yt*2+1];let zi=yi.x,Si=yi.y,ui=v[Yt*2+0],Ai=v[Yt*2+1],zn=1-ui-Ai,tn=f.decodeHeight(u,ht),Hn=f.decodeHeight(u,Li),Ki=f.decodeHeight(u,Yn),wr=tn*ui+Hn*Ai+Ki*zn;Ke=Math.min(wr,Ke),Pe=Math.max(wr,Pe);let so=P.lerp(ge,we,zi),Ts=P.lerp(ve,Re,Si),zs=he.fromRadians(so,Ts,wr,Uzt),$r=he.toCartesian(zs,x,zzt),pi=M.multiplyByPoint(xe,$r,jzt);qe=h.minimumByComponent(pi,qe,qe),st=h.maximumByComponent(pi,st,st);let ao;if(d){let Fn=f.decodeNormal(u,ht,Mzt),Vi=f.decodeNormal(u,Li,Nzt),Fi=f.decodeNormal(u,Yn,Lzt),Ir=h.fromElements(Fn.x*ui+Vi.x*Ai+Fi.x*zn,Fn.y*ui+Vi.y*Ai+Fi.y*zn,Fn.z*ui+Vi.z*Ai+Fi.z*zn,WLe);Ir=h.normalize(Ir,WLe),ao=cn.octEncode(Ir,eVt)}let nr;p&&(nr=(Ti.geodeticLatitudeToMercatorAngle(Ts)-Qe)*Ye);let jo;A&&(jo=x.geodeticSurfaceNormal($r,tVt)),Ae=D.encode(ae,Ae,$r,yi,wr,ao,nr,jo)}let vt=en.fromRectangle(b,Ke,Pe,x,Zzt),jt=ue.fromVertices(ae,D.center,N,Jzt),mt=new tp(x).computeHorizonCullingPointFromVerticesPossiblyUnderEllipsoid(D.center,ae,N,D.center,Ke,$zt),ft=new Sc(h.clone(D.center,new h),ae,q,B,w,Ke,Pe,b,ue.clone(jt),h.clone(mt),N,en.clone(vt),D,Q,W,J,Z);return KLe(ft,b,x,qe,st,fe,xe,o),ft};function KLe(e,t,n,i,r,o,s,a){let{encoding:c}=e,u=c.stride,f=e.vertices,{hasVertexNormals:d,hasWebMercatorT:p,exaggeration:g,exaggerationRelativeHeight:m}=c,A=g!==1,b=e.vertexCountWithoutSkirts,x=b*u,T=f.length/u,E=T-b,v=e.indices,S=e.indexCountWithoutSkirts,I=e.westIndicesSouthToNorth,R=e.southIndicesEastToWest,O=e.eastIndicesNorthToSouth,L=e.northIndicesWestToEast;Xr.addSkirtIndicesWithFilledCorners(I,R,O,L,b,v,S);let _=0,C=_+I.length,w=C+R.length,D=w+O.length,N=[I,R,O,L],F=[_,C,w,D],V=[-1,0,1,0],B=[0,-1,0,1],j=h.clone(i,Hzt),k=h.clone(r,Gzt),G=e.maximumHeight,q=e.minimumHeight-a;for(let J=0;J<E;J++){let Z;for(Z=0;Z<3&&!(J<F[Z+1]);Z++);let ae=N[Z][J-F[Z]],Ae=c.decodeTextureCoordinates(f,ae,GLe),fe=1e-4,xe=Ae.x+V[Z]*fe,ge=Ae.y+B[Z]*fe,we=P.lerp(t.west,t.east,xe),ve=P.clamp(P.lerp(t.south,t.north,ge),-P.PI_OVER_TWO,+P.PI_OVER_TWO),Qe=c.decodeHeight(f,ae)-a,He=he.fromRadians(we,ve,Qe,kzt),Ye=he.toCartesian(He,n,HLe),Ke;d&&(Ke=c.getOctEncodedNormal(f,ae,qLe));let Pe;p&&(Pe=c.decodeWebMercatorT(f,ae));let qe;A&&(qe=n.geodeticSurfaceNormal(Ye,YLe)),x=c.encode(f,x,Ye,Ae,Qe,Ke,Pe,qe);let st=M.multiplyByPoint(s,Ye,Vzt);h.minimumByComponent(st,j,j),h.maximumByComponent(st,k,k)}let Q=rd.fromCorners(j,k,Qzt),W=new Po(c.center,Q,q,G,o,c.hasVertexNormals,c.hasWebMercatorT,A,g,m);if(c.quantization!==W.quantization){let J=W,Z=J.stride,ae=new Float32Array(T*Z),Ae=0;for(let fe=0;fe<T;fe++)Ae=J.encode(ae,Ae,c.decodePosition(f,fe,HLe),c.decodeTextureCoordinates(f,fe,GLe),c.decodeHeight(f,fe),c.hasVertexNormals?c.getOctEncodedNormal(f,fe,qLe):void 0,c.hasWebMercatorT?c.decodeWebMercatorT(f,fe):void 0,c.hasGeodeticSurfaceNormals?c.decodeGeodeticSurfaceNormal(f,fe,YLe):void 0);e.vertices=ae,e.stride=Z,e.encoding=J}return e}var Tse=0,sVt=1,Ese=2,Cse=3,aVt=4,cVt=new h,lVt=[new h,new h,new h,new h,new h,new h],uVt=[new U,new U,new U,new U,new U,new U],fVt=[new h,new h,new h,new h,new h,new h],dVt=[new U,new U,new U,new U,new U,new U];function XLe(e,t,n,i){switch(n){case Tse:return P.sign(i.x-e.x);case Ese:return P.sign(t.x-i.x);case Cse:return P.sign(i.y-e.y);default:return P.sign(t.y-i.y)}}function hVt(e,t,n,i,r,o){let s,a,c;switch(n){case Tse:s=(e.x-i.x)/(r.x-i.x),a=e.x,c=i.y+(r.y-i.y)*s;break;case Ese:s=(t.x-i.x)/(r.x-i.x),a=t.x,c=i.y+(r.y-i.y)*s;break;case Cse:s=(e.y-i.y)/(r.y-i.y),a=i.x+(r.x-i.x)*s,c=e.y;break;default:s=(t.y-i.y)/(r.y-i.y),a=i.x+(r.x-i.x)*s,c=t.y;break}return h.fromElements(a,c,s,o)}var mVt={length:0,coordinates:[new U,new U,new U,new U,new U,new U],barycentricCoordinates:[new h,new h,new h,new h,new h,new h]};function pVt(e,t,n,i,r,o,s,a){let c,u=uVt,f=lVt,d=3,p=dVt;U.clone(r,p[0]),U.clone(o,p[1]),U.clone(s,p[2]);let g=fVt;h.fromElements(1,0,0,g[0]),h.fromElements(0,1,0,g[1]),h.fromElements(0,0,1,g[2]);for(let m=0;m<t;m++){let y=(e+m)%aVt,A=u,b=f;u=p,f=g,c=d,p=A,g=b,d=0;let x=c-1,T=u[x],E=f[x],v=XLe(n,i,y,T);for(let S=0;S<c;S++){let I=u[S],R=f[S],O=XLe(n,i,y,I);if(v*O===-1){let L=hVt(n,i,y,T,I,cVt),{x:_,y:C,z:w}=L,D=1-w,N=E.x*D+R.x*w,F=E.y*D+R.y*w,V=E.z*D+R.z*w;U.fromElements(_,C,p[d]),h.fromElements(N,F,V,g[d]),d++}O>=0&&(U.clone(I,p[d]),h.clone(R,g[d]),d++),T=I,E=R,v=O}if(d===0)break}a.length=d;for(let m=0;m<d;m++)U.clone(p[m],a.coordinates[m]),h.clone(g[m],a.barycentricCoordinates[m]);return a}function gVt(e,t,n,i,r,o,s,a){return pVt(e?t?Cse:Tse:t?Ese:sVt,2,n,i,r,o,s,a)}var _Vt=[[],[0],[1],[0,1],[2],[0,2],[1,2],[0,1,2]];function yVt(e,t,n,i,r,o,s,a,c,u,f,d,p,g,m){let y={},A=e?.5:0,b=e?1:.5,x=t?.5:0,T=t?1:.5,E=wzt;E.x=A,E.y=x;let v=Izt;v.x=b,v.y=T;let S=0;for(let I=0;I<n;I+=3){let R=i[I+0],O=i[I+1],L=i[I+2],_=s.decodeTextureCoordinates(o,R,Dzt),C=s.decodeTextureCoordinates(o,O,Rzt),w=s.decodeTextureCoordinates(o,L,Ozt),D=gVt(e,t,E,v,_,C,w,mVt),N=D.length;if(N<3)continue;let F=Pzt;for(let k=0;k<N;k++){let G=D.barycentricCoordinates[k],q=G.x,Q=G.y,W=G.z,J=Math.ceil(q)|Math.ceil(Q)<<1|Math.ceil(W)<<2,Z=_Vt[J],ae,Ae=!1;if(Z.length===1){let fe=Z[0],ge=i[I+fe];ae=y[ge],ae===void 0&&(Ae=!0,ae=S++,y[ge]=ae)}else if(Z.length===2){let fe=Z[0],xe=Z[1],ge=i[I+fe],we=i[I+xe],ve=D.barycentricCoordinates[(k+N-1)%N],Re=Math.ceil(ve.x)|Math.ceil(ve.y)<<1|Math.ceil(ve.z)<<2,Qe=J===Re,He=Math.min(ge,we),Ye=Math.max(ge,we),Ke=r+2*(He*r+Ye),Pe=Ke+0,qe=Ke+1,st=y[Pe],vt=y[qe],jt=!Qe==(st===void 0||vt===void 0);if(ae=jt?st:vt,ae===void 0){Ae=!0,ae=S++;let lt=jt?Pe:qe;y[lt]=ae}}else Ae=!0,ae=S++;if(F[k]=ae,Ae){let fe=I/3;p.push(fe);let xe=D.coordinates[k],ge=(xe.x-A)/(b-A),we=(xe.y-x)/(T-x);m.push(ge,we),g.push(q,Q),ge===0?c.push(ae):ge===1&&f.push(ae),we===0?u.push(ae):we===1&&d.push(ae)}}let V=F[0],B=F[1],j=F[2];a.push(V,B,j);for(let k=3;k<N;k++)B=j,j=F[k],a.push(V,B,j)}c.sort(function(I,R){return m[I*2+1]-m[R*2+1]}),u.sort(function(I,R){return m[R*2+0]-m[I*2+0]}),f.sort(function(I,R){return m[R*2+1]-m[I*2+1]}),d.sort(function(I,R){return m[I*2+0]-m[R*2+0]})}var wM=xse;var G9={};G9.clipTriangleAtAxisAlignedThreshold=function(e,t,n,i,r,o){l(o)?o.length=0:o=[];let s,a,c;t?(s=n<e,a=i<e,c=r<e):(s=n>e,a=i>e,c=r>e);let u=s+a+c,f,d,p,g,m,y;return u===1?s?(f=(e-n)/(i-n),d=(e-n)/(r-n),o.push(1),o.push(2),d!==1&&(o.push(-1),o.push(0),o.push(2),o.push(d)),f!==1&&(o.push(-1),o.push(0),o.push(1),o.push(f))):a?(p=(e-i)/(r-i),g=(e-i)/(n-i),o.push(2),o.push(0),g!==1&&(o.push(-1),o.push(1),o.push(0),o.push(g)),p!==1&&(o.push(-1),o.push(1),o.push(2),o.push(p))):c&&(m=(e-r)/(n-r),y=(e-r)/(i-r),o.push(0),o.push(1),y!==1&&(o.push(-1),o.push(2),o.push(1),o.push(y)),m!==1&&(o.push(-1),o.push(2),o.push(0),o.push(m))):u===2?!s&&n!==e?(g=(e-i)/(n-i),m=(e-r)/(n-r),o.push(0),o.push(-1),o.push(1),o.push(0),o.push(g),o.push(-1),o.push(2),o.push(0),o.push(m)):!a&&i!==e?(y=(e-r)/(i-r),f=(e-n)/(i-n),o.push(1),o.push(-1),o.push(2),o.push(1),o.push(y),o.push(-1),o.push(0),o.push(1),o.push(f)):!c&&r!==e&&(d=(e-n)/(r-n),p=(e-i)/(r-i),o.push(2),o.push(-1),o.push(0),o.push(2),o.push(d),o.push(-1),o.push(1),o.push(2),o.push(p)):u!==3&&(o.push(0),o.push(1),o.push(2)),o};G9.computeBarycentricCoordinates=function(e,t,n,i,r,o,s,a,c){let u=n-s,f=s-r,d=o-a,p=i-a,g=1/(d*u+f*p),m=t-a,y=e-s,A=(d*y+f*m)*g,b=(-p*y+u*m)*g,x=1-A-b;return l(c)?(c.x=A,c.y=b,c.z=x,c):new h(A,b,x)};G9.computeLineSegmentLineSegmentIntersection=function(e,t,n,i,r,o,s,a,c){let u=(s-r)*(t-o)-(a-o)*(e-r),f=(n-e)*(t-o)-(i-t)*(e-r),d=(a-o)*(n-e)-(s-r)*(i-t);if(d===0)return;let p=u/d,g=f/d;if(p>=0&&p<=1&&g>=0&&g<=1)return l(c)||(c=new U),c.x=e+p*(n-e),c.y=t+p*(i-t),c};var y0=G9;function m_(e){e=e??H.EMPTY_OBJECT,this._minimumHeight=e.minimumHeight,this._maximumHeight=e.maximumHeight,this._skirtHeight=e.skirtHeight,this._boundingSphere=ue.clone(e.boundingSphere,new ue),this._orientedBoundingBox=en.clone(e.orientedBoundingBox,new en),this._horizonOcclusionPoint=h.clone(e.horizonOcclusionPoint,new h),this._hasVertexNormals=e.requestVertexNormals??!1,this._hasWaterMask=e.requestWaterMask??!1,this._hasWebMercatorT=!0,this._credits=e.credits,this._childTileMask=e.childTileMask??15,this._gltf=e.gltf,this._mesh=void 0,this._waterMask=e.waterMask}Object.defineProperties(m_.prototype,{credits:{get:function(){return this._credits}},waterMask:{get:function(){return this._waterMask}}});m_.prototype.interpolateHeight=function(e,t,n){let i=this._mesh;return i===void 0?void 0:JLe(i,e,t,n)};m_.prototype.isChildAvailable=function(e,t,n,i){let r=2;return n!==e*2&&++r,i!==t*2&&(r-=2),(this._childTileMask&1<<r)!==0};var $Le="createVerticesFromCesium3DTilesTerrain",AVt=new $n($Le),bVt=new $n($Le,wf.maximumAsynchronousTasks);m_.prototype.createMesh=function(e){e=e??H.EMPTY_OBJECT;let n=e.throttle??!0?bVt:AVt,i=e.tilingScheme,r=i.ellipsoid,o=e.x,s=e.y,a=e.level,c=i.tileXYToRectangle(o,s,a,new ie),u=this._gltf,f=n.scheduleTask({ellipsoid:r,rectangle:c,hasVertexNormals:this._hasVertexNormals,hasWaterMask:this._hasWaterMask,hasWebMercatorT:this._hasWebMercatorT,gltf:u,minimumHeight:this._minimumHeight,maximumHeight:this._maximumHeight,boundingSphere:this._boundingSphere,orientedBoundingBox:this._orientedBoundingBox,horizonOcclusionPoint:this._horizonOcclusionPoint,skirtHeight:this._skirtHeight,exaggeration:e.exaggeration,exaggerationRelativeHeight:e.exaggerationRelativeHeight});if(!l(f))return;let d=this;return Promise.resolve(f).then(function(p){let g=p,m=Po.clone(g.encoding,new Po),y=new Float32Array(g.verticesBuffer),A=y.length/m.stride,b=g.vertexCountWithoutSkirts,x=A<=65535?Uint16Array:Uint32Array,T=new x(g.indicesBuffer),E=new x(g.westIndicesBuffer),v=new x(g.eastIndicesBuffer),S=new x(g.southIndicesBuffer),I=new x(g.northIndicesBuffer),R=g.indexCountWithoutSkirts,O=d._minimumHeight,L=d._maximumHeight,_=h.clone(m.center,new h),C=ue.clone(d._boundingSphere,new ue),w=h.clone(d._horizonOcclusionPoint,new h),D=en.clone(d._orientedBoundingBox,new en),N=new Sc(_,y,T,R,b,O,L,c,C,w,m.stride,D,m,E,S,v,I);return d._mesh=N,Promise.resolve(N)})};m_.prototype._createMeshSync=function(e){e=e??H.EMPTY_OBJECT;let t=e.tilingScheme,n=t.ellipsoid,i=e.x,r=e.y,o=e.level,s=t.tileXYToRectangle(i,r,o,new ie),a=wM.createMesh({ellipsoid:n,rectangle:s,hasVertexNormals:this._hasVertexNormals,hasWebMercatorT:this._hasWebMercatorT,gltf:this._gltf,minimumHeight:this._minimumHeight,maximumHeight:this._maximumHeight,boundingSphere:this._boundingSphere,orientedBoundingBox:this._orientedBoundingBox,horizonOcclusionPoint:this._horizonOcclusionPoint,skirtHeight:this._skirtHeight,exaggeration:e.exaggeration,exaggerationRelativeHeight:e.exaggerationRelativeHeight}),c=this;return Promise.resolve(a).then(function(u){return c._mesh=u,Promise.resolve(u)})};m_.prototype.upsample=function(e,t,n,i,r,o,s){let a=this._mesh;return a===void 0?void 0:W9(!1,a,this._skirtHeight,this._credits,e,t,n,i,r,o,s)};m_.prototype._upsampleSync=function(e,t,n,i,r,o,s){let a=this._mesh;return a===void 0?void 0:W9(!0,a,this._skirtHeight,this._credits,e,t,n,i,r,o,s)};m_.prototype.wasCreatedByUpsampling=function(){return!1};function h_(e){e=e??H.EMPTY_OBJECT,this._mesh=e.terrainMesh,this._skirtHeight=e.skirtHeight,this._credits=e.credits}h_.prototype.createMesh=function(e){return e=e??H.EMPTY_OBJECT,Promise.resolve(this._mesh)};h_.prototype.upsample=function(e,t,n,i,r,o,s){return W9(!1,this._mesh,this._skirtHeight,this._credits,e,t,n,i,r,o,s)};h_.prototype._upsampleSync=function(e,t,n,i,r,o,s){return W9(!0,this._mesh,this._skirtHeight,this._credits,e,t,n,i,r,o,s)};h_.prototype.interpolateHeight=function(e,t,n){let i=this._mesh;return JLe(i,e,t,n)};h_.prototype.wasCreatedByUpsampling=function(){return!0};h_.prototype.isChildAvailable=function(e,t,n,i){return!1};Object.defineProperties(h_.prototype,{credits:{get:function(){return this._credits}},waterMask:{get:function(){}}});var xVt=new $n("upsampleVerticesFromCesium3DTilesTerrain",wf.maximumAsynchronousTasks);function W9(e,t,n,i,r,o,s,a,c,u,f){if(f-a>1)throw new pe("Upsampling through more than one level at a time is not currently supported.");let p=n*.5,g=o*2!==c,m=s*2===u,y=r.tileXYToRectangle(c,u,f,new ie),A=r.ellipsoid,b={isEastChild:g,isNorthChild:m,rectangle:y,ellipsoid:A,skirtHeight:p,parentVertices:t.vertices,parentIndices:t.indices,parentVertexCountWithoutSkirts:t.vertexCountWithoutSkirts,parentIndexCountWithoutSkirts:t.indexCountWithoutSkirts,parentMinimumHeight:t.minimumHeight,parentMaximumHeight:t.maximumHeight,parentEncoding:t.encoding};if(e){let T=wM.upsampleMesh(b),E=new h_({terrainMesh:T,skirtHeight:p,credits:i});return Promise.resolve(E)}let x=xVt.scheduleTask(b);if(x!==void 0)return x.then(function(T){let E=Po.clone(T.encoding,new Po),v=E.stride,S=new Float32Array(T.verticesBuffer),I=S.length/v,R=T.vertexCountWithoutSkirts,O=I<=65535?Uint16Array:Uint32Array,L=new O(T.indicesBuffer),_=new O(T.westIndicesBuffer),C=new O(T.eastIndicesBuffer),w=new O(T.southIndicesBuffer),D=new O(T.northIndicesBuffer),N=T.indexCountWithoutSkirts,F=T.minimumHeight,V=T.maximumHeight,B=h.clone(E.center,new h),j=ue.clone(T.boundingSphere,new ue),k=h.clone(T.horizonOcclusionPoint,new h),G=en.clone(T.orientedBoundingBox,new en),q=new Sc(B,S,L,N,R,F,V,y,j,k,v,G,E,_,w,C,D),Q=new h_({terrainMesh:q,skirtHeight:p,credits:i});return Promise.resolve(Q)})}var TVt=new U,EVt=new U,CVt=new U,vVt=new h;function JLe(e,t,n,i){let r=P.clamp((n-t.west)/t.width,0,1),o=P.clamp((i-t.south)/t.height,0,1),{vertices:s,encoding:a,indices:c}=e;for(let u=0;u<e.indexCountWithoutSkirts;u+=3){let f=c[u],d=c[u+1],p=c[u+2],g=a.decodeTextureCoordinates(s,f,TVt),m=a.decodeTextureCoordinates(s,d,EVt),y=a.decodeTextureCoordinates(s,p,CVt),A=Math.min(g.x,m.x,y.x),b=Math.max(g.x,m.x,y.x),x=Math.min(g.y,m.y,y.y),T=Math.max(g.y,m.y,y.y);if(r>=A&&r<=b&&o>=x&&o<=T){let E=y0.computeBarycentricCoordinates(r,o,g.x,g.y,m.x,m.y,y.x,y.y,vVt);if(E.x>=0&&E.y>=0&&E.z>=0){let v=a.decodeHeight(s,f),S=a.decodeHeight(s,d),I=a.decodeHeight(s,p);return E.x*v+E.y*S+E.z*I}}}return 0}var q9=m_;function A0(e){e=e??H.EMPTY_OBJECT;let t=e.credit;typeof t=="string"&&(t=new It(t)),this._credit=t,this._tileCredits=void 0,this._errorEvent=new be,this._ellipsoid=e.ellipsoid??ee.WGS84,this._tilingScheme=new ir({ellipsoid:this._ellipsoid}),this._subtreeCache=new tE({provider:this}),this._tileset0=void 0,this._tileset1=void 0,this._resource=void 0,this._requestVertexNormals=e.requestVertexNormals??!1,this._requestWaterMask=e.requestWaterMask??!1}A0.fromUrl=async function(e,t){t=t??H.EMPTY_OBJECT,e=await Promise.resolve(e);let n=De.createIfNeeded(e),i;try{i=await n.fetchJson()}catch(f){throw new oe("Could not load tileset JSON",f)}let r=new A0(t);r._tileCredits=n.credits,r._resource=n;let o=i.root.children,s=o[0],a=o[1],c=i.schema,u=Su.fromJson(c);return r._tileset0=new Og(n,s,u),r._tileset1=new Og(n,a,u),r};A0.fromIonAssetId=async function(e,t){let n=await es.fromAssetId(e);return A0.fromUrl(n,t)};var SVt=new Array(3);A0.prototype.requestTileGeometry=async function(e,t,n,i){let r=QLe(n,e),o=r===0?this._tileset0:this._tileset1,s=eFe(o,n,e,t),a=s.getSubtreeCoordinates(),c=this._subtreeCache,u=c.find(r,a),f=this._requestWaterMask,d=this,p;if(u===void 0){let x=o.subtreeUriTemplate.getDerivedResource({templateValues:a.getTemplateValues()});p=o.baseResource.getDerivedResource({url:x.url}).fetchArrayBuffer().then(async function(E){if(u=c.find(r,a),u===void 0){let v=new Uint8Array(E);u=await Hy.fromSubtreeJson(d._resource,void 0,v,o,a),c.addSubtree(r,u)}return u})}else p=Promise.resolve(u);let g=o.contentUriTemplates[0].getDerivedResource({templateValues:s.getTemplateValues()}),m=o.baseResource.getDerivedResource({url:g.url}),y=m.fetchArrayBuffer();if(y===void 0)return;let A=y.then(x=>wv(new Uint8Array(x))),b=SVt;b[0]=p,b[1]=A,b[2]=f?A.then(x=>wVt(x,m)):void 0;try{let x=await Promise.all(b),T=x[0],E=x[1],v=x[2],S=T.getTileMetadataView(s),I=S.getPropertyBySemantic(Xh.TILE_MINIMUM_HEIGHT),R=S.getPropertyBySemantic(Xh.TILE_MAXIMUM_HEIGHT),O=S.getPropertyBySemantic(Xh.TILE_BOUNDING_SPHERE),L=ue.unpack(O,0,new ue),_=S.getPropertyBySemantic(Xh.TILE_HORIZON_OCCLUSION_POINT),w=d._tilingScheme.tileXYToRectangle(e,t,n,new ie),D=d._ellipsoid,N=en.fromRectangle(w,I,R,D,new en),F=d.getLevelMaximumGeometricError(n)*5,V=Y9(o,T,s,0,0),B=Y9(o,T,s,1,0),j=Y9(o,T,s,0,1),k=Y9(o,T,s,1,1),G=(V?1:0)|(B?2:0)|(j?4:0)|(k?8:0),q=new q9({gltf:E,minimumHeight:I,maximumHeight:R,boundingSphere:L,orientedBoundingBox:N,horizonOcclusionPoint:_,skirtHeight:F,requestVertexNormals:d._requestVertexNormals,childTileMask:G,credits:d._tileCredits,waterMask:v});return Promise.resolve(q)}catch(x){console.log(`Could not load subtree: ${r} ${a.level} ${a.x} ${a.y}: ${x}`),console.log(`Could not load tile: ${r} ${s.level} ${s.x} ${s.y}: ${x}`);return}};A0.prototype.getTileDataAvailable=function(e,t,n){let i=this._subtreeCache,r=QLe(n,e),o=r===0?this._tileset0:this._tileset1,s=eFe(o,n,e,t),a=s.getSubtreeCoordinates(),c=i.find(r,a);if(c!==void 0)return c.tileIsAvailableAtCoordinates(s);if(a.isImplicitTilesetRoot())return s.isSubtreeRoot()?!0:void 0;let u=a.getParentSubtreeCoordinates(),f=i.find(r,u);if(f!==void 0)return f.childSubtreeIsAvailableAtCoordinates(a)?s.isSubtreeRoot()?!0:void 0:!1};function QLe(e,t){let n=1<<e;return t/n|0}function eFe(e,t,n,i){let r=1<<t,o=t,s=n%r,a=r-i-1,{subdivisionScheme:c,subtreeLevels:u}=e;return new Mg({subdivisionScheme:c,subtreeLevels:u,level:o,x:s,y:a})}async function wVt(e,t){let n=e.extensions?.EXT_structural_metadata;if(!l(n)||!l(n.propertyTextures))return;let i=new gx({schema:n.schema});await i.load();let r=i.schema,o,s;if(l(r.classes)){for(let g in r.classes)if(r.classes.hasOwnProperty(g)&&(o=r.classes[g],s=o.propertiesBySemantic.WATERMASK,l(s)))break}if(!l(s))return;let a=n.propertyTextures.find(g=>g.class===o.id);if(!l(a))throw new pe(`Expected a propertyTexture with a class ${o.id}`);let c=a.properties[s.id],u=e.textures[c.index],f=e.images[u.source]?.bufferView,d=ki.getBufferViewLoader({gltf:e,bufferViewId:f,gltfResource:t,baseResource:t});return await d.load(),await Cy({uint8Array:new Uint8Array(d.typedArray),format:"image/png",flipY:!1,skipColorSpaceConversion:!0})}function Y9(e,t,n,i,r){let o=n.isBottomOfSubtree(),a=vse(e,1,i,r),c=n.getDescendantCoordinates(a);return o?t.childSubtreeIsAvailableAtCoordinates(c):t.tileIsAvailableAtCoordinates(c)}function vse(e,t,n,i){let{subdivisionScheme:r,subtreeLevels:o}=e;return new Mg({subdivisionScheme:r,subtreeLevels:o,level:t,x:n,y:i})}A0.prototype.loadTileDataAvailability=function(e,t,n){};A0.prototype.getLevelMaximumGeometricError=function(e){let t=this._ellipsoid;return Xr.getEstimatedLevelZeroGeometricErrorForAHeightmap(t,64,2)/(1<<e)};Object.defineProperties(A0.prototype,{errorEvent:{get:function(){return this._errorEvent}},credit:{get:function(){return this._credit}},tilingScheme:{get:function(){return this._tilingScheme}},hasWaterMask:{get:function(){return this._requestWaterMask}},hasVertexNormals:{get:function(){return this._requestVertexNormals}},availability:{get:function(){return this._subtreeCache}}});function IVt(e,t,n){this.rootId=e,this.subtree=t,this.stamp=n}function tE(e){this._maximumSubtreeCount=e.maximumSubtreeCount??0,this._subtreeRequestCounter=0,this._queue=new SA({comparator:tE.comparator}),this._provider=e.provider}tE.comparator=function(e,t){let n=e.subtree.implicitCoordinates,i=t.subtree.implicitCoordinates;return n.isAncestor(i)?1:i.isAncestor(n)?-1:e.stamp-t.stamp};tE.prototype.addSubtree=function(e,t){let n=new IVt(e,t,this._subtreeRequestCounter);this._queue.insert(n),this._subtreeRequestCounter++;let i=t.implicitCoordinates;if(i.level>0){let r=i.getParentSubtreeCoordinates(),o=this.find(e,r)}if(this._maximumSubtreeCount>0)for(;this._queue.length>this._maximumSubtreeCount&&this._queue.getMinimum()!==n;)this._queue.removeMinimum()};tE.prototype.find=function(e,t){let n=this._queue,i=n.internalArray,{level:r,x:o,y:s}=t;for(let a=0;a<n.length;a++){let c=i[a],u=c.rootId,f=c.subtree.implicitCoordinates;if(u===e&&f.level===r&&f.x===o&&f.y===s)return c.subtree}};tE.prototype._computeMaximumImplicitTileCoordinatesAtPosition=function(e){let{longitude:t,latitude:n}=e,i=this._provider,r=t<0?0:1,o=r===0?i._tileset0:i._tileset1,s=o.subtreeLevels,a=vse(o,0,0,0),c=this.find(r,a);if(c===void 0)return;let u=c.implicitCoordinates,f=u.x,d=u.y,p=u.level,g=-P.PI,m=+P.PI,y=P.lerp(g,m,r/2),A=P.lerp(g,m,(r+1)/2),b=-P.PI*.5,x=+P.PI*.5,T=0,E=0,v=!0;for(;v;){let I=1/(1<<p),R=(A-y)*I,O=y+f*R,L=(x-b)*I,_=b+d*L;T=(t-O)/R,E=(n-_)/L;let C=ZLe(o,u,T,E,s);if(c.childSubtreeIsAvailableAtCoordinates(C)){let w=this.find(r,C);if(w!==void 0)c=w,u=c.implicitCoordinates,f=u.x,d=u.y,p=u.level;else return C}else v=!1}let S;for(let I=0;I<s;I++){let R=ZLe(o,u,T,E,I);if(c.tileIsAvailableAtCoordinates(R))S=R;else break}return S};function ZLe(e,t,n,i,r){let o=1<<r,s=P.clamp(n*o|0,0,o-1),a=P.clamp(i*o|0,0,o-1),c=vse(e,r,s,a);return t.getDescendantCoordinates(c)}tE.prototype.computeMaximumLevelAtPosition=function(e){let t=this._computeMaximumImplicitTileCoordinatesAtPosition(e);return t===void 0?0:t.level};var tFe=A0;function eb(e){e=e??H.EMPTY_OBJECT,this._quantizedVertices=e.quantizedVertices,this._encodedNormals=e.encodedNormals,this._indices=e.indices,this._minimumHeight=e.minimumHeight,this._maximumHeight=e.maximumHeight,this._boundingSphere=e.boundingSphere,this._orientedBoundingBox=e.orientedBoundingBox,this._horizonOcclusionPoint=e.horizonOcclusionPoint,this._credits=e.credits;let t=this._quantizedVertices.length/3,n=this._uValues=this._quantizedVertices.subarray(0,t),i=this._vValues=this._quantizedVertices.subarray(t,2*t);this._heightValues=this._quantizedVertices.subarray(2*t,3*t);function r(s,a){return i[s]-i[a]}function o(s,a){return n[s]-n[a]}this._westIndices=K9(e.westIndices,r,t),this._southIndices=K9(e.southIndices,o,t),this._eastIndices=K9(e.eastIndices,r,t),this._northIndices=K9(e.northIndices,o,t),this._westSkirtHeight=e.westSkirtHeight,this._southSkirtHeight=e.southSkirtHeight,this._eastSkirtHeight=e.eastSkirtHeight,this._northSkirtHeight=e.northSkirtHeight,this._childTileMask=e.childTileMask??15,this._createdByUpsampling=e.createdByUpsampling??!1,this._waterMask=e.waterMask,this._mesh=void 0}Object.defineProperties(eb.prototype,{credits:{get:function(){return this._credits}},waterMask:{get:function(){return this._waterMask}},childTileMask:{get:function(){return this._childTileMask}},canUpsample:{get:function(){return l(this._mesh)}}});var X9=[];function K9(e,t,n){X9.length=e.length;let i=!1;for(let r=0,o=e.length;r<o;++r)X9[r]=e[r],i=i||r>0&&t(e[r-1],e[r])>0;return i?(X9.sort(t),je.createTypedArray(n,X9)):e}var nFe="createVerticesFromQuantizedTerrainMesh",PVt=new $n(nFe),DVt=new $n(nFe,wf.maximumAsynchronousTasks);eb.prototype.createMesh=function(e){e=e??H.EMPTY_OBJECT;let t=e.tilingScheme,n=e.x,i=e.y,r=e.level,o=e.exaggeration??1,s=e.exaggerationRelativeHeight??0,a=e.throttle??!0,c=t.ellipsoid,u=t.tileXYToRectangle(n,i,r),d=(a?DVt:PVt).scheduleTask({minimumHeight:this._minimumHeight,maximumHeight:this._maximumHeight,quantizedVertices:this._quantizedVertices,octEncodedNormals:this._encodedNormals,includeWebMercatorT:!0,indices:this._indices,westIndices:this._westIndices,southIndices:this._southIndices,eastIndices:this._eastIndices,northIndices:this._northIndices,westSkirtHeight:this._westSkirtHeight,southSkirtHeight:this._southSkirtHeight,eastSkirtHeight:this._eastSkirtHeight,northSkirtHeight:this._northSkirtHeight,rectangle:u,relativeToCenter:this._boundingSphere.center,ellipsoid:c,exaggeration:o,exaggerationRelativeHeight:s});if(!l(d))return;let p=this;return Promise.resolve(d).then(function(g){let m=p._quantizedVertices.length/3,y=m+p._westIndices.length+p._southIndices.length+p._eastIndices.length+p._northIndices.length,A=je.createTypedArray(y,g.indices),b=new Float32Array(g.vertices),x=g.center,T=g.minimumHeight,E=g.maximumHeight,v=p._boundingSphere,S=p._orientedBoundingBox,I=h.clone(g.occludeePointInScaledSpace)??p._horizonOcclusionPoint,R=g.vertexStride,O=Po.clone(g.encoding);return p._mesh=new Sc(x,b,A,g.indexCountWithoutSkirts,m,T,E,u,v,I,R,S,O,g.westIndicesSouthToNorth,g.southIndicesEastToWest,g.eastIndicesNorthToSouth,g.northIndicesWestToEast),p._quantizedVertices=void 0,p._encodedNormals=void 0,p._indices=void 0,p._uValues=void 0,p._vValues=void 0,p._heightValues=void 0,p._westIndices=void 0,p._southIndices=void 0,p._eastIndices=void 0,p._northIndices=void 0,p._mesh})};var RVt=new $n("upsampleQuantizedTerrainMesh",wf.maximumAsynchronousTasks);eb.prototype.upsample=function(e,t,n,i,r,o,s){let a=this._mesh;if(!l(this._mesh))return;let c=t*2!==r,u=n*2===o,f=e.ellipsoid,d=e.tileXYToRectangle(r,o,s),p=RVt.scheduleTask({vertices:a.vertices,vertexCountWithoutSkirts:a.vertexCountWithoutSkirts,indices:a.indices,indexCountWithoutSkirts:a.indexCountWithoutSkirts,encoding:a.encoding,minimumHeight:this._minimumHeight,maximumHeight:this._maximumHeight,isEastChild:c,isNorthChild:u,childRectangle:d,ellipsoid:f});if(!l(p))return;let g=Math.min(this._westSkirtHeight,this._eastSkirtHeight);g=Math.min(g,this._southSkirtHeight),g=Math.min(g,this._northSkirtHeight);let m=c?g*.5:this._westSkirtHeight,y=u?g*.5:this._southSkirtHeight,A=c?this._eastSkirtHeight:g*.5,b=u?this._northSkirtHeight:g*.5,x=this._credits;return Promise.resolve(p).then(function(T){let E=new Uint16Array(T.vertices),v=je.createTypedArray(E.length/3,T.indices),S;return l(T.encodedNormals)&&(S=new Uint8Array(T.encodedNormals)),new eb({quantizedVertices:E,indices:v,encodedNormals:S,minimumHeight:T.minimumHeight,maximumHeight:T.maximumHeight,boundingSphere:ue.clone(T.boundingSphere),orientedBoundingBox:en.clone(T.orientedBoundingBox),horizonOcclusionPoint:h.clone(T.horizonOcclusionPoint),westIndices:T.westIndices,southIndices:T.southIndices,eastIndices:T.eastIndices,northIndices:T.northIndices,westSkirtHeight:m,southSkirtHeight:y,eastSkirtHeight:A,northSkirtHeight:b,childTileMask:0,credits:x,createdByUpsampling:!0})})};var Sse=32767,iFe=new h;eb.prototype.interpolateHeight=function(e,t,n){let i=P.clamp((t-e.west)/e.width,0,1);i*=Sse;let r=P.clamp((n-e.south)/e.height,0,1);return r*=Sse,l(this._mesh)?LVt(this,i,r):FVt(this,i,r)};function rFe(e,t,n,i,r,o,s,a){let c=Math.min(n,r,s),u=Math.max(n,r,s),f=Math.min(i,o,a),d=Math.max(i,o,a);return e>=c&&e<=u&&t>=f&&t<=d}var OVt=new U,MVt=new U,NVt=new U;function LVt(e,t,n){let i=e._mesh,r=i.vertices,o=i.encoding,s=i.indices;for(let a=0,c=s.length;a<c;a+=3){let u=s[a],f=s[a+1],d=s[a+2],p=o.decodeTextureCoordinates(r,u,OVt),g=o.decodeTextureCoordinates(r,f,MVt),m=o.decodeTextureCoordinates(r,d,NVt);if(rFe(t,n,p.x,p.y,g.x,g.y,m.x,m.y)){let y=y0.computeBarycentricCoordinates(t,n,p.x,p.y,g.x,g.y,m.x,m.y,iFe);if(y.x>=-1e-15&&y.y>=-1e-15&&y.z>=-1e-15){let A=o.decodeHeight(r,u),b=o.decodeHeight(r,f),x=o.decodeHeight(r,d);return y.x*A+y.y*b+y.z*x}}}}function FVt(e,t,n){let i=e._uValues,r=e._vValues,o=e._heightValues,s=e._indices;for(let a=0,c=s.length;a<c;a+=3){let u=s[a],f=s[a+1],d=s[a+2],p=i[u],g=i[f],m=i[d],y=r[u],A=r[f],b=r[d];if(rFe(t,n,p,y,g,A,m,b)){let x=y0.computeBarycentricCoordinates(t,n,p,y,g,A,m,b,iFe);if(x.x>=-1e-15&&x.y>=-1e-15&&x.z>=-1e-15){let T=x.x*o[u]+x.y*o[f]+x.z*o[d];return P.lerp(e._minimumHeight,e._maximumHeight,T/Sse)}}}}eb.prototype.isChildAvailable=function(e,t,n,i){let r=2;return n!==e*2&&++r,i!==t*2&&(r-=2),(this._childTileMask&1<<r)!==0};eb.prototype.wasCreatedByUpsampling=function(){return this._createdByUpsampling};var mI=eb;function BVt(e){this.resource=e.resource,this.version=e.version,this.isHeightmap=e.isHeightmap,this.tileUrlTemplates=e.tileUrlTemplates,this.availability=e.availability,this.hasVertexNormals=e.hasVertexNormals,this.hasWaterMask=e.hasWaterMask,this.hasMetadata=e.hasMetadata,this.availabilityLevels=e.availabilityLevels,this.availabilityTilesLoaded=e.availabilityTilesLoaded,this.littleEndianExtensionSize=e.littleEndianExtensionSize,this.availabilityPromiseCache={}}function sFe(e){this.requestVertexNormals=e.requestVertexNormals??!1,this.requestWaterMask=e.requestWaterMask??!1,this.requestMetadata=e.requestMetadata??!0,this.ellipsoid=e.ellipsoid??ee.default,this.heightmapWidth=65,this.heightmapStructure=void 0,this.hasWaterMask=!1,this.hasMetadata=!1,this.hasVertexNormals=!1,this.scheme=void 0,this.lastResource=void 0,this.layerJsonResource=void 0,this.previousError=void 0,this.availability=void 0,this.tilingScheme=void 0,this.levelZeroMaximumGeometricError=void 0,this.heightmapStructure=void 0,this.layers=[],this.attribution="",this.overallAvailability=[],this.overallMaxZoom=0,this.tileCredits=[]}sFe.prototype.build=function(e){e._heightmapWidth=this.heightmapWidth,e._scheme=this.scheme;let t=l(this.lastResource.credits)?this.lastResource.credits:[];e._tileCredits=t.concat(this.tileCredits),e._availability=this.availability,e._tilingScheme=this.tilingScheme,e._requestWaterMask=this.requestWaterMask,e._levelZeroMaximumGeometricError=this.levelZeroMaximumGeometricError,e._heightmapStructure=this.heightmapStructure,e._layers=this.layers,e._hasWaterMask=this.hasWaterMask,e._hasVertexNormals=this.hasVertexNormals,e._hasMetadata=this.hasMetadata};async function aFe(e,t,n){if(!t.format){let y="The tile format is not specified in the layer.json file.";throw e.previousError=no.reportError(e.previousError,n,l(n)?n._errorEvent:void 0,y),new oe(y)}if(!t.tiles||t.tiles.length===0){let y="The layer.json file does not specify any tile URL templates.";throw e.previousError=no.reportError(e.previousError,n,l(n)?n._errorEvent:void 0,y),new oe(y)}let i=!1,r=!1,o=!1,s=!0,a=!1;if(t.format==="heightmap-1.0")a=!0,l(e.heightmapStructure)||(e.heightmapStructure={heightScale:1/5,heightOffset:-1e3,elementsPerHeight:1,stride:1,elementMultiplier:256,isBigEndian:!1,lowestEncodedHeight:0,highestEncodedHeight:256*256-1}),r=!0,e.requestWaterMask=!0;else if(t.format.indexOf("quantized-mesh-1.")!==0){let y=`The tile format "${t.format}" is invalid or not supported.`;throw e.previousError=no.reportError(e.previousError,n,l(n)?n._errorEvent:void 0,y),new oe(y)}let c=t.tiles,u=t.maxzoom;if(e.overallMaxZoom=Math.max(e.overallMaxZoom,u),!t.projection||t.projection==="EPSG:4326")e.tilingScheme=new ir({numberOfLevelZeroTilesX:2,numberOfLevelZeroTilesY:1,ellipsoid:e.ellipsoid});else if(t.projection==="EPSG:3857")e.tilingScheme=new Uo({numberOfLevelZeroTilesX:1,numberOfLevelZeroTilesY:1,ellipsoid:e.ellipsoid});else{let y=`The projection "${t.projection}" is invalid or not supported.`;throw e.previousError=no.reportError(e.previousError,n,l(n)?n._errorEvent:void 0,y),new oe(y)}if(e.levelZeroMaximumGeometricError=Xr.getEstimatedLevelZeroGeometricErrorForAHeightmap(e.tilingScheme.ellipsoid,e.heightmapWidth,e.tilingScheme.getNumberOfXTilesAtLevel(0)),!t.scheme||t.scheme==="tms"||t.scheme==="slippyMap")e.scheme=t.scheme;else{let y=`The scheme "${t.scheme}" is invalid or not supported.`;throw e.previousError=no.reportError(e.previousError,n,l(n)?n._errorEvent:void 0,y),new oe(y)}let f;l(t.extensions)&&t.extensions.indexOf("octvertexnormals")!==-1?i=!0:l(t.extensions)&&t.extensions.indexOf("vertexnormals")!==-1&&(i=!0,s=!1),l(t.extensions)&&t.extensions.indexOf("watermask")!==-1&&(r=!0),l(t.extensions)&&t.extensions.indexOf("metadata")!==-1&&(o=!0);let d=t.metadataAvailability,p=t.available,g;if(l(p)&&!l(d)){g=new _0(e.tilingScheme,p.length);for(let y=0;y<p.length;++y){let A=p[y],b=e.tilingScheme.getNumberOfYTilesAtLevel(y);l(e.overallAvailability[y])||(e.overallAvailability[y]=[]);for(let x=0;x<A.length;++x){let T=A[x],E=b-T.endY-1,v=b-T.startY-1;e.overallAvailability[y].push([T.startX,E,T.endX,v]),g.addAvailableTileRange(y,T.startX,E,T.endX,v)}}}else l(d)&&(f=new _0(e.tilingScheme,u),g=new _0(e.tilingScheme,u),e.overallAvailability[0]=[[0,0,1,0]],g.addAvailableTileRange(0,0,0,1,0));e.hasWaterMask=e.hasWaterMask||r,e.hasVertexNormals=e.hasVertexNormals||i,e.hasMetadata=e.hasMetadata||o,l(t.attribution)&&(e.attribution.length>0&&(e.attribution+=" "),e.attribution+=t.attribution),e.layers.push(new BVt({resource:e.lastResource,version:t.version,isHeightmap:a,tileUrlTemplates:c,availability:g,hasVertexNormals:i,hasWaterMask:r,hasMetadata:o,availabilityLevels:d,availabilityTilesLoaded:f,littleEndianExtensionSize:s}));let m=t.parentUrl;return l(m)?l(g)?(e.lastResource=e.lastResource.getDerivedResource({url:m}),e.lastResource.appendForwardSlash(),e.layerJsonResource=e.lastResource.getDerivedResource({url:"layer.json"}),await Pse(e),!0):(console.log("A layer.json can't have a parentUrl if it does't have an available array."),!0):!0}function kVt(e,t,n){let i=`An error occurred while accessing ${e.layerJsonResource.url}.`;if(l(t)&&(i+=` +${t.message}`),e.previousError=no.reportError(e.previousError,n,l(n)?n._errorEvent:void 0,i),e.previousError.retry)return Pse(e,n);throw new oe(i)}async function UVt(e,t,n){await aFe(e,t,n);let i=e.overallAvailability.length;if(i>0){let r=e.availability=new _0(e.tilingScheme,e.overallMaxZoom);for(let o=0;o<i;++o){let s=e.overallAvailability[o];for(let a=0;a<s.length;++a){let c=s[a];r.addAvailableTileRange(o,c[0],c[1],c[2],c[3])}}}if(e.attribution.length>0){let r=new It(e.attribution);e.tileCredits.push(r)}return!0}async function Pse(e,t){try{let n=await e.layerJsonResource.fetchJson();return UVt(e,n,t)}catch(n){return l(n)&&n.statusCode===404?(await aFe(e,{tilejson:"2.1.0",format:"heightmap-1.0",version:"1.0.0",scheme:"tms",tiles:["{z}/{x}/{y}.terrain?v={version}"]},t),!0):kVt(e,n,t)}}function vm(e){e=e??H.EMPTY_OBJECT,this._heightmapWidth=void 0,this._heightmapStructure=void 0,this._hasWaterMask=!1,this._hasVertexNormals=!1,this._hasMetadata=!1,this._scheme=void 0,this._ellipsoid=e.ellipsoid,this._requestVertexNormals=e.requestVertexNormals??!1,this._requestWaterMask=e.requestWaterMask??!1,this._requestMetadata=e.requestMetadata??!0,this._errorEvent=new be;let t=e.credit;typeof t=="string"&&(t=new It(t)),this._credit=t,this._availability=void 0,this._tilingScheme=void 0,this._levelZeroMaximumGeometricError=void 0,this._layers=void 0,this._tileCredits=void 0}var wse={OCT_VERTEX_NORMALS:1,WATER_MASK:2,METADATA:4};function oFe(e){return!l(e)||e.length===0?{Accept:"application/vnd.quantized-mesh,application/octet-stream;q=0.9,*/*;q=0.01"}:{Accept:`application/vnd.quantized-mesh;extensions=${e.join("-")},application/octet-stream;q=0.9,*/*;q=0.01`}}function zVt(e,t,n,i,r){let o=new Uint16Array(t,0,e._heightmapWidth*e._heightmapWidth);return new sl({buffer:o,childTileMask:new Uint8Array(t,o.byteLength,1)[0],waterMask:new Uint8Array(t,o.byteLength+1,t.byteLength-o.byteLength-1),width:e._heightmapWidth,height:e._heightmapWidth,structure:e._heightmapStructure,credits:e._tileCredits})}function VVt(e,t,n,i,r,o){let s=o.littleEndianExtensionSize,a=0,c=3,u=c+1,f=Float64Array.BYTES_PER_ELEMENT*c,d=Float64Array.BYTES_PER_ELEMENT*u,g=Uint16Array.BYTES_PER_ELEMENT*3,m=3,y=Uint16Array.BYTES_PER_ELEMENT,A=y*m,b=new DataView(t),x=new h(b.getFloat64(a,!0),b.getFloat64(a+8,!0),b.getFloat64(a+16,!0));a+=f;let T=b.getFloat32(a,!0);a+=Float32Array.BYTES_PER_ELEMENT;let E=b.getFloat32(a,!0);a+=Float32Array.BYTES_PER_ELEMENT;let v=new ue(new h(b.getFloat64(a,!0),b.getFloat64(a+8,!0),b.getFloat64(a+16,!0)),b.getFloat64(a+f,!0));a+=d;let S=new h(b.getFloat64(a,!0),b.getFloat64(a+8,!0),b.getFloat64(a+16,!0));a+=f;let I=b.getUint32(a,!0);a+=Uint32Array.BYTES_PER_ELEMENT;let R=new Uint16Array(t,a,I*3);a+=I*g,I>64*1024&&(y=Uint32Array.BYTES_PER_ELEMENT,A=y*m);let O=R.subarray(0,I),L=R.subarray(I,2*I),_=R.subarray(I*2,3*I);cn.zigZagDeltaDecode(O,L,_),a%y!==0&&(a+=y-a%y);let C=b.getUint32(a,!0);a+=Uint32Array.BYTES_PER_ELEMENT;let w=je.createTypedArrayFromArrayBuffer(I,t,a,C*m);a+=C*A;let D=0,N=w.length;for(let fe=0;fe<N;++fe){let xe=w[fe];w[fe]=D-xe,xe===0&&++D}let F=b.getUint32(a,!0);a+=Uint32Array.BYTES_PER_ELEMENT;let V=je.createTypedArrayFromArrayBuffer(I,t,a,F);a+=F*y;let B=b.getUint32(a,!0);a+=Uint32Array.BYTES_PER_ELEMENT;let j=je.createTypedArrayFromArrayBuffer(I,t,a,B);a+=B*y;let k=b.getUint32(a,!0);a+=Uint32Array.BYTES_PER_ELEMENT;let G=je.createTypedArrayFromArrayBuffer(I,t,a,k);a+=k*y;let q=b.getUint32(a,!0);a+=Uint32Array.BYTES_PER_ELEMENT;let Q=je.createTypedArrayFromArrayBuffer(I,t,a,q);a+=q*y;let W,J;for(;a<b.byteLength;){let fe=b.getUint8(a,!0);a+=Uint8Array.BYTES_PER_ELEMENT;let xe=b.getUint32(a,s);if(a+=Uint32Array.BYTES_PER_ELEMENT,fe===wse.OCT_VERTEX_NORMALS&&e._requestVertexNormals)W=new Uint8Array(t,a,I*2);else if(fe===wse.WATER_MASK&&e._requestWaterMask)J=new Uint8Array(t,a,xe);else if(fe===wse.METADATA&&e._requestMetadata){let ge=b.getUint32(a,!0);if(ge>0){let ve=Fo(new Uint8Array(t),a+Uint32Array.BYTES_PER_ELEMENT,ge).available;if(l(ve))for(let Re=0;Re<ve.length;++Re){let Qe=n+Re+1,He=ve[Re],Ye=e._tilingScheme.getNumberOfYTilesAtLevel(Qe);for(let Ke=0;Ke<He.length;++Ke){let Pe=He[Ke],qe=Ye-Pe.endY-1,st=Ye-Pe.startY-1;e.availability.addAvailableTileRange(Qe,Pe.startX,qe,Pe.endX,st),o.availability.addAvailableTileRange(Qe,Pe.startX,qe,Pe.endX,st)}}}o.availabilityTilesLoaded.addAvailableTileRange(n,i,r,i,r)}a+=xe}let Z=e.getLevelMaximumGeometricError(n)*5,ae=e._tilingScheme.tileXYToRectangle(i,r,n),Ae=en.fromRectangle(ae,T,E,e._tilingScheme.ellipsoid);return new mI({center:x,minimumHeight:T,maximumHeight:E,boundingSphere:v,orientedBoundingBox:Ae,horizonOcclusionPoint:S,quantizedVertices:R,encodedNormals:W,indices:w,westIndices:V,southIndices:j,eastIndices:G,northIndices:Q,westSkirtHeight:Z,southSkirtHeight:Z,eastSkirtHeight:Z,northSkirtHeight:Z,childTileMask:e.availability.computeChildMaskForTile(n,i,r),waterMask:J,credits:e._tileCredits})}vm.prototype.requestTileGeometry=function(e,t,n,i){let r=this._layers,o,s=r.length,a=!1,c=Promise.resolve();if(s===1)o=r[0];else for(let u=0;u<s;++u){let f=r[u];if(!l(f.availability)||f.availability.isTileAvailable(n,e,t)){o=f;break}let d=Dse(this,e,t,n,f,u===0);d.result&&(a=!0,c=c.then(()=>d.promise))}return!l(o)&&a?c.then(()=>new Promise(u=>{setTimeout(()=>{let f=this.requestTileGeometry(e,t,n,i);u(f)},0)})):cFe(this,e,t,n,o,i)};function cFe(e,t,n,i,r,o){if(!l(r))return Promise.reject(new oe("Terrain tile doesn't exist"));let s=r.tileUrlTemplates;if(s.length===0)return;let a;!e._scheme||e._scheme==="tms"?a=e._tilingScheme.getNumberOfYTilesAtLevel(i)-n-1:a=n;let c=[];e._requestVertexNormals&&r.hasVertexNormals&&c.push(r.littleEndianExtensionSize?"octvertexnormals":"vertexnormals"),e._requestWaterMask&&r.hasWaterMask&&c.push("watermask"),e._requestMetadata&&r.hasMetadata&&c.push("metadata");let u,f,d=s[(t+a+i)%s.length],p=r.resource;l(p._ionEndpoint)&&!l(p._ionEndpoint.externalType)?(c.length!==0&&(f={extensions:c.join("-")}),u=oFe(void 0)):u=oFe(c);let g=p.getDerivedResource({url:d,templateValues:{version:r.version,z:i,x:t,y:a},queryParameters:f,headers:u,request:o}).fetchArrayBuffer();if(l(g))return g.then(function(m){return l(m)?l(e._heightmapStructure)?zVt(e,m,i,t,n):VVt(e,m,i,t,n,r):Promise.reject(new oe("Mesh buffer doesn't exist."))})}Object.defineProperties(vm.prototype,{errorEvent:{get:function(){return this._errorEvent}},credit:{get:function(){return this._credit}},tilingScheme:{get:function(){return this._tilingScheme}},hasWaterMask:{get:function(){return this._hasWaterMask&&this._requestWaterMask}},hasVertexNormals:{get:function(){return this._hasVertexNormals&&this._requestVertexNormals}},hasMetadata:{get:function(){return this._hasMetadata&&this._requestMetadata}},requestVertexNormals:{get:function(){return this._requestVertexNormals}},requestWaterMask:{get:function(){return this._requestWaterMask}},requestMetadata:{get:function(){return this._requestMetadata}},availability:{get:function(){return this._availability}}});vm.prototype.getLevelMaximumGeometricError=function(e){return this._levelZeroMaximumGeometricError/(1<<e)};vm.fromIonAssetId=async function(e,t){let n=await es.fromAssetId(e);return vm.fromUrl(n,t)};vm.fromUrl=async function(e,t){t=t??H.EMPTY_OBJECT,e=await Promise.resolve(e);let n=De.createIfNeeded(e);n.appendForwardSlash();let i=new sFe(t);i.lastResource=n,i.layerJsonResource=i.lastResource.getDerivedResource({url:"layer.json"}),await Pse(i);let r=new vm(t);return i.build(r),r};vm.prototype.getTileDataAvailable=function(e,t,n){if(!l(this._availability))return;if(n>this._availability._maximumLevel)return!1;if(this._availability.isTileAvailable(n,e,t))return!0;if(!this._hasMetadata)return!1;let i=this._layers,r=i.length;for(let o=0;o<r;++o)if(Dse(this,e,t,n,i[o],o===0).result)return;return!1};vm.prototype.loadTileDataAvailability=function(e,t,n){if(!l(this._availability)||n>this._availability._maximumLevel||this._availability.isTileAvailable(n,e,t)||!this._hasMetadata)return;let i=this._layers,r=i.length;for(let o=0;o<r;++o){let s=Dse(this,e,t,n,i[o],o===0);if(l(s.promise))return s.promise}};function Ise(e,t,n,i){if(i===0)return;let r=e.availabilityLevels,o=i%r===0?i-r:(i/r|0)*r,s=1<<i-o,a=t/s|0,c=n/s|0;return{level:o,x:a,y:c}}function Dse(e,t,n,i,r,o){if(!l(r.availabilityLevels))return{result:!1};let s,a=function(){delete r.availabilityPromiseCache[s]},c=r.availabilityTilesLoaded,u=r.availability,f=Ise(r,t,n,i);for(;l(f);){if(u.isTileAvailable(f.level,f.x,f.y)&&!c.isTileAvailable(f.level,f.x,f.y)){let d;if(!o&&(s=`${f.level}-${f.x}-${f.y}`,d=r.availabilityPromiseCache[s],!l(d))){let p=new Oo({throttle:!1,throttleByServer:!0,type:oa.TERRAIN});d=cFe(e,f.x,f.y,f.level,r,p),l(d)&&(r.availabilityPromiseCache[s]=d,d.then(a))}return{result:!0,promise:d}}f=Ise(r,f.x,f.y,f.level)}return{result:!1}}vm._getAvailabilityTile=Ise;var pI=vm;function p_(e){e=e??H.EMPTY_OBJECT;let t=e.radius,n={center:e.center,semiMajorAxis:t,semiMinorAxis:t,ellipsoid:e.ellipsoid,height:e.height,extrudedHeight:e.extrudedHeight,granularity:e.granularity,vertexFormat:e.vertexFormat,stRotation:e.stRotation,shadowVolume:e.shadowVolume};this._ellipseGeometry=new xu(n),this._workerName="createCircleGeometry"}p_.packedLength=xu.packedLength;p_.pack=function(e,t,n){return xu.pack(e._ellipseGeometry,t,n)};var lFe=new xu({center:new h,semiMajorAxis:1,semiMinorAxis:1}),Rc={center:new h,radius:void 0,ellipsoid:ee.clone(ee.default),height:void 0,extrudedHeight:void 0,granularity:void 0,vertexFormat:new Be,stRotation:void 0,semiMajorAxis:void 0,semiMinorAxis:void 0,shadowVolume:void 0};p_.unpack=function(e,t,n){let i=xu.unpack(e,t,lFe);return Rc.center=h.clone(i._center,Rc.center),Rc.ellipsoid=ee.clone(i._ellipsoid,Rc.ellipsoid),Rc.ellipsoid=ee.clone(i._ellipsoid,lFe._ellipsoid),Rc.height=i._height,Rc.extrudedHeight=i._extrudedHeight,Rc.granularity=i._granularity,Rc.vertexFormat=Be.clone(i._vertexFormat,Rc.vertexFormat),Rc.stRotation=i._stRotation,Rc.shadowVolume=i._shadowVolume,l(n)?(Rc.semiMajorAxis=i._semiMajorAxis,Rc.semiMinorAxis=i._semiMinorAxis,n._ellipseGeometry=new xu(Rc),n):(Rc.radius=i._semiMajorAxis,new p_(Rc))};p_.createGeometry=function(e){return xu.createGeometry(e._ellipseGeometry)};p_.createShadowVolume=function(e,t,n){let i=e._ellipseGeometry._granularity,r=e._ellipseGeometry._ellipsoid,o=t(i,r),s=n(i,r);return new p_({center:e._ellipseGeometry._center,radius:e._ellipseGeometry._semiMajorAxis,ellipsoid:r,stRotation:e._ellipseGeometry._stRotation,granularity:i,extrudedHeight:o,height:s,vertexFormat:Be.POSITION_ONLY,shadowVolume:!0})};Object.defineProperties(p_.prototype,{rectangle:{get:function(){return this._ellipseGeometry.rectangle}},textureCoordinateRotationPoints:{get:function(){return this._ellipseGeometry.textureCoordinateRotationPoints}}});var uFe=p_;function gI(e){e=e??H.EMPTY_OBJECT;let t=e.radius,n={center:e.center,semiMajorAxis:t,semiMinorAxis:t,ellipsoid:e.ellipsoid,height:e.height,extrudedHeight:e.extrudedHeight,granularity:e.granularity,numberOfVerticalLines:e.numberOfVerticalLines};this._ellipseGeometry=new gd(n),this._workerName="createCircleOutlineGeometry"}gI.packedLength=gd.packedLength;gI.pack=function(e,t,n){return gd.pack(e._ellipseGeometry,t,n)};var jVt=new gd({center:new h,semiMajorAxis:1,semiMinorAxis:1}),jf={center:new h,radius:void 0,ellipsoid:ee.clone(ee.UNIT_SPHERE),height:void 0,extrudedHeight:void 0,granularity:void 0,numberOfVerticalLines:void 0,semiMajorAxis:void 0,semiMinorAxis:void 0};gI.unpack=function(e,t,n){let i=gd.unpack(e,t,jVt);return jf.center=h.clone(i._center,jf.center),jf.ellipsoid=ee.clone(i._ellipsoid,jf.ellipsoid),jf.height=i._height,jf.extrudedHeight=i._extrudedHeight,jf.granularity=i._granularity,jf.numberOfVerticalLines=i._numberOfVerticalLines,l(n)?(jf.semiMajorAxis=i._semiMajorAxis,jf.semiMinorAxis=i._semiMinorAxis,n._ellipseGeometry=new gd(jf),n):(jf.radius=i._semiMajorAxis,new gI(jf))};gI.createGeometry=function(e){return gd.createGeometry(e._ellipseGeometry)};var fFe=gI;function HVt(e){return e=e??H.EMPTY_OBJECT,pI.fromIonAssetId(2426648,{requestVertexNormals:e.requestVertexNormals??!1})}var $9=HVt;function GVt(e){return e=e??H.EMPTY_OBJECT,pI.fromIonAssetId(1,{requestVertexNormals:e.requestVertexNormals??!1,requestWaterMask:e.requestWaterMask??!1,ellipsoid:ee.WGS84})}var _I=GVt;function yI(e){e=e??H.EMPTY_OBJECT,this._callback=e.callback,this._tilingScheme=e.tilingScheme,l(this._tilingScheme)||(this._tilingScheme=new ir({ellipsoid:e.ellipsoid??ee.default})),this._width=e.width,this._height=e.height;let t=Math.max(this._width,this._height);this._levelZeroMaximumGeometricError=Xr.getEstimatedLevelZeroGeometricErrorForAHeightmap(this._tilingScheme.ellipsoid,t,this._tilingScheme.getNumberOfXTilesAtLevel(0)),this._errorEvent=new be;let n=e.credit;typeof n=="string"&&(n=new It(n)),this._credit=n}Object.defineProperties(yI.prototype,{errorEvent:{get:function(){return this._errorEvent}},credit:{get:function(){return this._credit}},tilingScheme:{get:function(){return this._tilingScheme}},hasWaterMask:{get:function(){return!1}},hasVertexNormals:{get:function(){return!1}},availability:{get:function(){}},width:{get:function(){return this._width}},height:{get:function(){return this._height}}});yI.prototype.requestTileGeometry=function(e,t,n,i){let r=this._callback(e,t,n);if(!l(r))return;let o=this._width,s=this._height;return Promise.resolve(r).then(function(a){let c=a;return Array.isArray(c)&&(c=new Float64Array(c)),new sl({buffer:c,width:o,height:s})})};yI.prototype.getLevelMaximumGeometricError=function(e){return this._levelZeroMaximumGeometricError/(1<<e)};yI.prototype.getTileDataAvailable=function(e,t,n){};yI.prototype.loadTileDataAvailability=function(e,t,n){};var dFe=yI;var WVt=1953029805,qVt=2917034100;function Rse(e,t){if(Rse.passThroughDataForTesting)return t;let n=e.byteLength;if(n===0||n%4!==0)throw new oe("The length of key must be greater than 0 and a multiple of 4.");let i=new DataView(t),r=i.getUint32(0,!0);if(r===WVt||r===qVt)return t;let o=new DataView(e),s=0,a=t.byteLength,c=a-a%8,u=n,f,d=8;for(;s<c;)for(d=(d+8)%24,f=d;s<c&&f<u;)i.setUint32(s,i.getUint32(s,!0)^o.getUint32(f,!0),!0),i.setUint32(s+4,i.getUint32(s+4,!0)^o.getUint32(f+4,!0),!0),s+=8,f+=24;if(s<a)for(f>=u&&(d=(d+8)%24,f=d);s<a;)i.setUint8(s,i.getUint8(s)^o.getUint8(f)),s++,f++}Rse.passThroughDataForTesting=!1;var J9=Rse;function hFe(e){this.proxy=e}hFe.prototype.getURL=function(e){let t=this.proxy.indexOf("?")===-1?"?":"";return this.proxy+t+encodeURIComponent(e)};var mFe=hFe;function Z9(){pe.throwInstantiationError()}Object.defineProperties(Z9.prototype,{credit:{get:pe.throwInstantiationError}});Z9.getCreditsFromResult=function(e){if(l(e.attributions))return e.attributions.map(It.getIonCredit)};Z9.prototype.geocode=pe.throwInstantiationError;var IM=Z9;var pFe={SEARCH:0,AUTOCOMPLETE:1};Object.freeze(pFe);var nE=pFe;function gFe(){pe.throwInstantiationError()}gFe.createGeometry=function(e){pe.throwInstantiationError()};var _Fe=gFe;var ZVt=js(Ose(),1);function YVt(e,t){return(e&t)!==0}var Zl=YVt;var XVt=[1,2,4,8],yFe=15,KVt=16,$Vt=64,JVt=128;function b0(e,t,n,i,r,o){this._bits=e,this.cnodeVersion=t,this.imageryVersion=n,this.terrainVersion=i,this.imageryProvider=r,this.terrainProvider=o,this.ancestorHasTerrain=!1,this.terrainState=void 0}b0.clone=function(e,t){return l(t)?(t._bits=e._bits,t.cnodeVersion=e.cnodeVersion,t.imageryVersion=e.imageryVersion,t.terrainVersion=e.terrainVersion,t.imageryProvider=e.imageryProvider,t.terrainProvider=e.terrainProvider):t=new b0(e._bits,e.cnodeVersion,e.imageryVersion,e.terrainVersion,e.imageryProvider,e.terrainProvider),t.ancestorHasTerrain=e.ancestorHasTerrain,t.terrainState=e.terrainState,t};b0.prototype.setParent=function(e){this.ancestorHasTerrain=e.ancestorHasTerrain||this.hasTerrain()};b0.prototype.hasSubtree=function(){return Zl(this._bits,KVt)};b0.prototype.hasImagery=function(){return Zl(this._bits,$Vt)};b0.prototype.hasTerrain=function(){return Zl(this._bits,JVt)};b0.prototype.hasChildren=function(){return Zl(this._bits,yFe)};b0.prototype.hasChild=function(e){return Zl(this._bits,XVt[e])};b0.prototype.getChildBitmask=function(){return this._bits&yFe};var Q9=b0;function QVt(e){let t=e.length,n=new ArrayBuffer(t),i=new Uint8Array(n);for(let r=0;r<t;++r)i[r]=e.charCodeAt(r);return n}var e4t=QVt(`E\xF4\xBD\vy\xE2jE"\x92,\xCDq\xF8IFgQ\0B%\xC6\xE8a,f)\b\xC64\xDCjb%y +wmi\xD6\xF0\x9Ck\x93\xA1\xBDNu\xE0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xAB\xEEc\x99\xC8+S\xA0D\\q\xC6\xCCD2O<\xCA\xC0)=R\xD3aX\xA9}e\xB4\xDC\xCF\r\xF4=\xF1\b\xA9B\xDA# \xD8\xBF^PI\xF8M\xC0\xCBGLO\xF7{+\xD8\xC51\x92;\xB5o\xDCl\r\x92\x88\xD1\x9E\xDB?\xE2\xE9\xDA_\xD4\x84\xE2FaZ\xDEU\xCF\xA4\0\xBE\xFD\xCEg\xF1Ji\x97\xE6 H\xD8]\x7F~\xAEq N\xAE\xC0V\xA9\x91<\x82r\xE7v\xEC)I\xD6]-\x83\xE3\xDB6\xA9;f\x97\x87j\xD5\xB6=P^R\xB9K\xC7sWx\xC9\xF4.Y\x07\x95\x93o\xD0KW>''\xC7\`\xDB;\xED\x9ASD>?\x8D\x92mw\xA2 +\xEB?R\xA8\xC6U^1I7\x85\xF4\xC5&-\xA9\xBF\x8B'T\xDA\xC3j \xE5*x\xB0\xD6\x90pr\xAA\x8Bh\xBD\x88\xF7_H\xB1~\xC0XL?f\xF9>\xE1e\xC0p\xA7\xCF8i\xAF\xF0VldI\x9C'\xADxtO\xC2\x87\xDEV9\0\xDAw\v\xCB-\x1B\x89\xFB5O\xF5\bQ\`\xC1 +ZGM&30x\xDA\xC0\x9CFG\xE2[y\`In7gS +>\xE9\xECF9\xB2\xF14\r\xC6\x84Sun\xE1\fY\xD9\xDE)\x85{II\xA5wy\xBEIV.6\xE7\v:\xBBOb{\xD2M1\x95/\xBD8{\xA8O!\xE1\xECFpv\x95})"x\x88 +\x90\xDD\x9D\\\xDA\xDEQ\xCF\xF0\xFCYRe|3\xDF\xF3H\xDA\xBB*u\xDB\`\xB2\xD4\xFC\xED\x1B\xEC\x7F5\xA8\xFF(1\x07-\xC8\xDC\x88F|\x8A["`);function Hf(e){this.imageryPresent=!0,this.protoImagery=void 0,this.terrainPresent=!0,this.negativeAltitudeExponentBias=32,this.negativeAltitudeThreshold=P.EPSILON12,this.providers={},this.key=void 0,this._resource=void 0,this._quadPacketVersion=1,this._tileInfo={},this._subtreePromises={}}Object.defineProperties(Hf.prototype,{url:{get:function(){return this._resource.url}},proxy:{get:function(){return this._resource.proxy}},resource:{get:function(){return this._resource}}});Hf.fromUrl=async function(e){let t=e;typeof t!="string"&&!(t instanceof De)&&(t=e.url);let n=De.createIfNeeded(t);n.appendForwardSlash();let i=new Hf;i._resource=n;try{await t4t(i),await i.getQuadTreePacket("",i._quadPacketVersion)}catch(r){let o=`An error occurred while accessing ${bFe(i,"",1).url}: ${r}`;throw new oe(o)}return i};Hf.tileXYToQuadKey=function(e,t,n){let i="";for(let r=n;r>=0;--r){let o=1<<r,s=0;Zl(t,o)?Zl(e,o)&&(s|=1):(s|=2,Zl(e,o)||(s|=1)),i+=s}return i};Hf.quadKeyToTileXY=function(e){let t=0,n=0,i=e.length-1;for(let r=i;r>=0;--r){let o=1<<r,s=+e[i-r];Zl(s,2)?Zl(s,1)||(t|=o):(n|=o,Zl(s,1)&&(t|=o))}return{x:t,y:n,level:i}};Hf.prototype.isValid=function(e){let t=this.getTileInformationFromQuadKey(e);if(l(t))return t!==null;let n=!0,i=e,r;for(;i.length>1;)if(r=i.substring(i.length-1),i=i.substring(0,i.length-1),t=this.getTileInformationFromQuadKey(i),l(t)){!t.hasSubtree()&&!t.hasChild(parseInt(r))&&(n=!1);break}else if(t===null){n=!1;break}return n};var AFe=new $n("decodeGoogleEarthEnterprisePacket");Hf.prototype.getQuadTreePacket=function(e,t,n){t=t??1,e=e??"";let r=bFe(this,e,t,n).fetchArrayBuffer();if(!l(r))return;let o=this._tileInfo,s=this.key;return r.then(function(a){return AFe.scheduleTask({buffer:a,quadKey:e,type:"Metadata",key:s},[a]).then(function(u){let f,d=-1;if(e!==""){d=e.length+1;let m=u[e];f=o[e],f._bits|=m._bits,delete u[e]}let p=Object.keys(u);p.sort(function(m,y){return m.length-y.length});let g=p.length;for(let m=0;m<g;++m){let y=p[m];if(u[y]!==null){let b=Q9.clone(u[y]),x=y.length;if(x===d)b.setParent(f);else if(x>1){let T=o[y.substring(0,y.length-1)];b.setParent(T)}o[y]=b}else o[y]=null}})})};Hf.prototype.populateSubtree=function(e,t,n,i){let r=Hf.tileXYToQuadKey(e,t,n);return Lse(this,r,i)};function Lse(e,t,n){let i=e._tileInfo,r=t,o=i[r];if(l(o)&&(!o.hasSubtree()||o.hasChildren()))return o;for(;o===void 0&&r.length>1;)r=r.substring(0,r.length-1),o=i[r];let s,a=e._subtreePromises,c=a[r];if(l(c))return c.then(function(){return s=new Oo({throttle:n.throttle,throttleByServer:n.throttleByServer,type:n.type,priorityFunction:n.priorityFunction}),Lse(e,t,s)});if(!l(o)||!o.hasSubtree())return Promise.reject(new oe(`Couldn't load metadata for tile ${t}`));if(c=e.getQuadTreePacket(r,o.cnodeVersion,n),!!l(c))return a[r]=c,c.then(function(){return s=new Oo({throttle:n.throttle,throttleByServer:n.throttleByServer,type:n.type,priorityFunction:n.priorityFunction}),Lse(e,t,s)}).finally(function(){delete a[r]})}Hf.prototype.getTileInformation=function(e,t,n){let i=Hf.tileXYToQuadKey(e,t,n);return this._tileInfo[i]};Hf.prototype.getTileInformationFromQuadKey=function(e){return this._tileInfo[e]};function bFe(e,t,n,i){return e._resource.getDerivedResource({url:`flatfile?q2-0${t}-q.${n.toString()}`,request:i})}var Mse,Nse;function t4t(e){let t=e._resource.getDerivedResource({url:"dbRoot.v5",queryParameters:{output:"proto"}});if(!l(Nse)){let n=Zt("ThirdParty/google-earth-dbroot-parser.js"),i=window.cesiumGoogleEarthDbRootParser;Nse=SE(n).then(function(){Mse=window.cesiumGoogleEarthDbRootParser(ZVt),l(i)?window.cesiumGoogleEarthDbRootParser=i:delete window.cesiumGoogleEarthDbRootParser})}return Nse.then(function(){return t.fetchArrayBuffer()}).then(function(n){let i=Mse.EncryptedDbRootProto.decode(new Uint8Array(n)),r=i.encryptionData,o=r.byteOffset,s=o+r.byteLength,a=e.key=r.buffer.slice(o,s);r=i.dbrootData,o=r.byteOffset,s=o+r.byteLength;let c=r.buffer.slice(o,s);return AFe.scheduleTask({buffer:c,type:"DbRoot",key:a},[c])}).then(function(n){let i=Mse.DbRootProto.decode(new Uint8Array(n.buffer));if(e.imageryPresent=i.imageryPresent??e.imageryPresent,e.protoImagery=i.protoImagery,e.terrainPresent=i.terrainPresent??e.terrainPresent,l(i.endSnippet)&&l(i.endSnippet.model)){let a=i.endSnippet.model;e.negativeAltitudeExponentBias=a.negativeAltitudeExponentBias??e.negativeAltitudeExponentBias,e.negativeAltitudeThreshold=a.compressedNegativeAltitudeThreshold??e.negativeAltitudeThreshold}l(i.databaseVersion)&&(e._quadPacketVersion=i.databaseVersion.quadtreeVersion??e._quadPacketVersion);let r=e.providers,o=i.providerInfo??[],s=o.length;for(let a=0;a<s;++a){let c=o[a],u=c.copyrightString;l(u)&&(r[c.providerId]=new It(u.value))}}).catch(function(){console.log(`Failed to retrieve ${t.url}. Using defaults.`),e.key=e4t})}var tb=Hf;function iE(e){e=e??H.EMPTY_OBJECT,this._buffer=e.buffer,this._credits=e.credits,this._negativeAltitudeExponentBias=e.negativeAltitudeExponentBias,this._negativeElevationThreshold=e.negativeElevationThreshold;let t=e.childTileMask??15,n=t&3;n|=t&4?8:0,n|=t&8?4:0,this._childTileMask=n,this._createdByUpsampling=e.createdByUpsampling??!1,this._skirtHeight=void 0,this._bufferType=this._buffer.constructor,this._mesh=void 0,this._minimumHeight=void 0,this._maximumHeight=void 0}Object.defineProperties(iE.prototype,{credits:{get:function(){return this._credits}},waterMask:{get:function(){}}});var EFe="createVerticesFromGoogleEarthEnterpriseBuffer",n4t=new $n(EFe),i4t=new $n(EFe,wf.maximumAsynchronousTasks),xFe=new ie,e7=new ie;iE.prototype.createMesh=function(e){e=e??H.EMPTY_OBJECT;let t=e.tilingScheme,n=e.x,i=e.y,r=e.level,o=e.exaggeration??1,s=e.exaggerationRelativeHeight??0,a=e.throttle??!0,c=t.ellipsoid;t.tileXYToNativeRectangle(n,i,r,xFe),t.tileXYToRectangle(n,i,r,e7);let u=c.cartographicToCartesian(ie.center(e7)),d=40075.16/(1<<r);this._skirtHeight=Math.min(d*8,1e3);let g=(a?i4t:n4t).scheduleTask({buffer:this._buffer,nativeRectangle:xFe,rectangle:e7,relativeToCenter:u,ellipsoid:c,skirtHeight:this._skirtHeight,exaggeration:o,exaggerationRelativeHeight:s,includeWebMercatorT:!0,negativeAltitudeExponentBias:this._negativeAltitudeExponentBias,negativeElevationThreshold:this._negativeElevationThreshold});if(!l(g))return;let m=this;return g.then(function(y){return m._mesh=new Sc(u,new Float32Array(y.vertices),new Uint16Array(y.indices),y.indexCountWithoutSkirts,y.vertexCountWithoutSkirts,y.minimumHeight,y.maximumHeight,e7,ue.clone(y.boundingSphere3D),h.clone(y.occludeePointInScaledSpace),y.numberOfAttributes,en.clone(y.orientedBoundingBox),Po.clone(y.encoding),y.westIndicesSouthToNorth,y.southIndicesEastToWest,y.eastIndicesNorthToSouth,y.northIndicesWestToEast),m._minimumHeight=y.minimumHeight,m._maximumHeight=y.maximumHeight,m._buffer=void 0,m._mesh})};iE.prototype.interpolateHeight=function(e,t,n){let i=P.clamp((t-e.west)/e.width,0,1),r=P.clamp((n-e.south)/e.height,0,1);return l(this._mesh)?c4t(this,i,r):f4t(this,i,r,e)};var r4t=new $n("upsampleQuantizedTerrainMesh",wf.maximumAsynchronousTasks);iE.prototype.upsample=function(e,t,n,i,r,o,s){let a=this._mesh;if(!l(this._mesh))return;let c=t*2!==r,u=n*2===o,f=e.ellipsoid,d=e.tileXYToRectangle(r,o,s),p=r4t.scheduleTask({vertices:a.vertices,indices:a.indices,indexCountWithoutSkirts:a.indexCountWithoutSkirts,vertexCountWithoutSkirts:a.vertexCountWithoutSkirts,encoding:a.encoding,minimumHeight:this._minimumHeight,maximumHeight:this._maximumHeight,isEastChild:c,isNorthChild:u,childRectangle:d,ellipsoid:f});if(!l(p))return;let g=this;return p.then(function(m){let y=new Uint16Array(m.vertices),A=je.createTypedArray(y.length/3,m.indices),b=g._skirtHeight;return new mI({quantizedVertices:y,indices:A,minimumHeight:m.minimumHeight,maximumHeight:m.maximumHeight,boundingSphere:ue.clone(m.boundingSphere),orientedBoundingBox:en.clone(m.orientedBoundingBox),horizonOcclusionPoint:h.clone(m.horizonOcclusionPoint),westIndices:m.westIndices,southIndices:m.southIndices,eastIndices:m.eastIndices,northIndices:m.northIndices,westSkirtHeight:b,southSkirtHeight:b,eastSkirtHeight:b,northSkirtHeight:b,childTileMask:0,createdByUpsampling:!0,credits:g._credits})})};iE.prototype.isChildAvailable=function(e,t,n,i){let r=2;return n!==e*2&&++r,i!==t*2&&(r-=2),(this._childTileMask&1<<r)!==0};iE.prototype.wasCreatedByUpsampling=function(){return this._createdByUpsampling};var o4t=new U,s4t=new U,a4t=new U,CFe=new h;function c4t(e,t,n){let i=e._mesh,r=i.vertices,o=i.encoding,s=i.indices;for(let a=0,c=s.length;a<c;a+=3){let u=s[a],f=s[a+1],d=s[a+2],p=o.decodeTextureCoordinates(r,u,o4t),g=o.decodeTextureCoordinates(r,f,s4t),m=o.decodeTextureCoordinates(r,d,a4t),y=y0.computeBarycentricCoordinates(t,n,p.x,p.y,g.x,g.y,m.x,m.y,CFe);if(y.x>=-1e-15&&y.y>=-1e-15&&y.z>=-1e-15){let A=o.decodeHeight(r,u),b=o.decodeHeight(r,f),x=o.decodeHeight(r,d);return y.x*A+y.y*b+y.z*x}}}var l4t=Uint16Array.BYTES_PER_ELEMENT,TFe=Uint32Array.BYTES_PER_ELEMENT,Fse=Int32Array.BYTES_PER_ELEMENT,u4t=Float32Array.BYTES_PER_ELEMENT,Bse=Float64Array.BYTES_PER_ELEMENT;function f4t(e,t,n,i){let r=e._buffer,o=0,s=0,a=0;n>.5?(t>.5?(o=2,s=.5):o=3,a=.5):t>.5&&(o=1,s=.5);let c=new DataView(r),u=0;for(let v=0;v<o;++v)u+=c.getUint32(u,!0),u+=TFe;u+=TFe,u+=2*Bse;let f=P.toRadians(c.getFloat64(u,!0)*180);u+=Bse;let d=P.toRadians(c.getFloat64(u,!0)*180);u+=Bse;let p=i.width/f/2,g=i.height/d/2,m=c.getInt32(u,!0);u+=Fse;let y=c.getInt32(u,!0)*3;u+=Fse,u+=Fse;let A=new Array(m),b=new Array(m),x=new Array(m),T;for(T=0;T<m;++T)A[T]=s+c.getUint8(u++)*p,b[T]=a+c.getUint8(u++)*g,x[T]=c.getFloat32(u,!0)*6371010,u+=u4t;let E=new Array(y);for(T=0;T<y;++T)E[T]=c.getUint16(u,!0),u+=l4t;for(T=0;T<y;T+=3){let v=E[T],S=E[T+1],I=E[T+2],R=A[v],O=A[S],L=A[I],_=b[v],C=b[S],w=b[I],D=y0.computeBarycentricCoordinates(t,n,R,_,O,C,L,w,CFe);if(D.x>=-1e-15&&D.y>=-1e-15&&D.z>=-1e-15)return D.x*x[v]+D.y*x[S]+D.z*x[I]}}var DM=iE;var rh={UNKNOWN:0,NONE:1,SELF:2,PARENT:3},t7=new K;function n7(){this._terrainCache={},this._lastTidy=K.now()}n7.prototype.add=function(e,t){this._terrainCache[e]={buffer:t,timestamp:K.now()}};n7.prototype.get=function(e){let n=this._terrainCache[e];if(l(n))return delete this._terrainCache[e],n.buffer};n7.prototype.tidy=function(){if(K.now(t7),K.secondsDifference(t7,this._lastTidy)>10){let e=this._terrainCache,t=Object.keys(e),n=t.length;for(let i=0;i<n;++i){let r=t[i],o=e[r];K.secondsDifference(t7,o.timestamp)>10&&delete e[r]}K.clone(t7,this._lastTidy)}};function nb(e){e=e??H.EMPTY_OBJECT,this._tilingScheme=new ir({numberOfLevelZeroTilesX:2,numberOfLevelZeroTilesY:2,rectangle:new ie(-P.PI,-P.PI,P.PI,P.PI),ellipsoid:e.ellipsoid});let t=e.credit;typeof t=="string"&&(t=new It(t)),this._credit=t,this._levelZeroMaximumGeometricError=40075.16,this._terrainCache=new n7,this._terrainPromises={},this._terrainRequests={},this._errorEvent=new be}Object.defineProperties(nb.prototype,{url:{get:function(){return this._metadata.url}},proxy:{get:function(){return this._metadata.proxy}},tilingScheme:{get:function(){return this._tilingScheme}},errorEvent:{get:function(){return this._errorEvent}},credit:{get:function(){return this._credit}},hasWaterMask:{get:function(){return!1}},hasVertexNormals:{get:function(){return!1}},availability:{get:function(){}}});nb.fromMetadata=function(e,t){if(!e.terrainPresent)throw new oe(`The server ${e.url} doesn't have terrain`);let n=new nb(t);return n._metadata=e,n};var d4t=new $n("decodeGoogleEarthEnterprisePacket");function vFe(e,t,n){let i=t.getChildBitmask();if(t.terrainState===rh.PARENT){i=0;for(let r=0;r<4;++r){let o=n.getTileInformationFromQuadKey(e+r.toString());l(o)&&o.hasTerrain()&&(i|=1<<r)}}return i}nb.prototype.requestTileGeometry=function(e,t,n,i){let r=tb.tileXYToQuadKey(e,t,n),o=this._terrainCache,s=this._metadata,a=s.getTileInformationFromQuadKey(r);if(!l(a))return Promise.reject(new oe("Terrain tile doesn't exist"));let c=a.terrainState;l(c)||(c=a.terrainState=rh.UNKNOWN);let u=o.get(r);if(l(u)){let b=s.providers[a.terrainProvider];return Promise.resolve(new DM({buffer:u,childTileMask:vFe(r,a,s),credits:l(b)?[b]:void 0,negativeAltitudeExponentBias:s.negativeAltitudeExponentBias,negativeElevationThreshold:s.negativeAltitudeThreshold}))}if(o.tidy(),a.ancestorHasTerrain){if(c===rh.NONE)return Promise.reject(new oe("Terrain tile doesn't exist"))}else return Promise.resolve(new sl({buffer:new Uint8Array(256),width:16,height:16}));let f,d=r,p=-1;switch(c){case rh.SELF:p=a.terrainVersion;break;case rh.PARENT:d=d.substring(0,d.length-1),f=s.getTileInformationFromQuadKey(d),p=f.terrainVersion;break;case rh.UNKNOWN:a.hasTerrain()?p=a.terrainVersion:(d=d.substring(0,d.length-1),f=s.getTileInformationFromQuadKey(d),l(f)&&f.hasTerrain()&&(p=f.terrainVersion));break}if(p<0)return Promise.reject(new oe("Terrain tile doesn't exist"));let g=this._terrainPromises,m=this._terrainRequests,y,A;if(l(g[d]))y=g[d],A=m[d];else{A=i;let b=h4t(this,d,p,A).fetchArrayBuffer();if(!l(b))return;y=b.then(function(x){return l(x)?d4t.scheduleTask({buffer:x,type:"Terrain",key:s.key},[x]).then(function(T){let E=s.getTileInformationFromQuadKey(d);E.terrainState=rh.SELF,o.add(d,T[0]);let v=E.terrainProvider,S=T.length-1;for(let I=0;I<S;++I){let R=d+I.toString(),O=s.getTileInformationFromQuadKey(R);l(O)&&(o.add(R,T[I+1]),O.terrainState=rh.PARENT,O.terrainProvider===0&&(O.terrainProvider=v))}}):Promise.reject(new oe("Failed to load terrain."))}),g[d]=y,m[d]=A,y=y.finally(function(){delete g[d],delete m[d]})}return y.then(function(){let b=o.get(r);if(l(b)){let x=s.providers[a.terrainProvider];return new DM({buffer:b,childTileMask:vFe(r,a,s),credits:l(x)?[x]:void 0,negativeAltitudeExponentBias:s.negativeAltitudeExponentBias,negativeElevationThreshold:s.negativeAltitudeThreshold})}return Promise.reject(new oe("Failed to load terrain."))}).catch(function(b){return A.state===wi.CANCELLED?(i.state=A.state,Promise.reject(b)):(a.terrainState=rh.NONE,Promise.reject(b))})};nb.prototype.getLevelMaximumGeometricError=function(e){return this._levelZeroMaximumGeometricError/(1<<e)};nb.prototype.getTileDataAvailable=function(e,t,n){let i=this._metadata,r=tb.tileXYToQuadKey(e,t,n),o=i.getTileInformation(e,t,n);if(o===null)return!1;if(l(o)){if(!o.ancestorHasTerrain)return!0;let s=o.terrainState;if(s===rh.NONE)return!1;if((!l(s)||s===rh.UNKNOWN)&&(o.terrainState=rh.UNKNOWN,!o.hasTerrain())){r=r.substring(0,r.length-1);let a=i.getTileInformationFromQuadKey(r);if(!l(a)||!a.hasTerrain())return!1}return!0}if(i.isValid(r)){let s=new Oo({throttle:!1,throttleByServer:!0,type:oa.TERRAIN});i.populateSubtree(e,t,n,s)}return!1};nb.prototype.loadTileDataAvailability=function(e,t,n){};function h4t(e,t,n,i){return n=l(n)&&n>0?n:1,e._metadata.resource.getDerivedResource({url:`flatfile?f1c-0${t}-t.${n.toString()}`,request:i})}var SFe=nb;var m4t="https://maps.googleapis.com/maps/api/geocode/json",wFe='<img alt="Google" src="https://assets.ion.cesium.com/google-credit.png" style="vertical-align:-5px">';function kse(e){e=e??H.EMPTY_OBJECT;let t=e.key;this._resource=new De({url:m4t,queryParameters:{key:t}}),this._credit=new It(wFe,!0)}Object.defineProperties(kse.prototype,{credit:{get:function(){return this._credit}}});kse.prototype.geocode=async function(e){let n=await this._resource.getDerivedResource({queryParameters:{address:e}}).fetchJson();if(n.status==="ZERO_RESULTS")return[];if(n.status!=="OK")throw new oe(`GoogleGeocoderService got a bad response ${n.status}: ${n.error_message}`);return n.results.map(r=>{let o=r.geometry.viewport.southwest,s=r.geometry.viewport.northeast;return{displayName:r.formatted_address,destination:ie.fromDegrees(o.lng,o.lat,s.lng,s.lat),attribution:{html:wFe,collapsible:!1}}})};var IFe=kse;var Use=class{constructor(){ut(this,"type")}getRequiredDataPoints(t){pe.throwInstantiationError()}interpolateOrderZero(t,n,i,r,o){pe.throwInstantiationError()}interpolate(t,n,i,r,o,s,a){pe.throwInstantiationError()}},PFe=Use;var DFe={GOOGLE:"GOOGLE",BING:"BING",DEFAULT:"DEFAULT"};Object.freeze(DFe);var ib=DFe;function zse(e){this._url=De.createIfNeeded(e),this._url.appendForwardSlash()}Object.defineProperties(zse.prototype,{url:{get:function(){return this._url}},credit:{get:function(){}}});zse.prototype.geocode=async function(e,t){return this._url.getDerivedResource({url:t===nE.AUTOCOMPLETE?"autocomplete":"search",queryParameters:{text:e}}).fetchJson().then(function(i){return i.features.map(function(r){let o,s=r.bbox;if(l(s))o=ie.fromDegrees(s[0],s[1],s[2],s[3]);else{let a=r.geometry.coordinates[0],c=r.geometry.coordinates[1];o=h.fromDegrees(a,c)}return{displayName:r.properties.label,destination:o,attributions:i.attributions}})})};var i7=zse;function p4t(e){if(!Object.values(ib).some(t=>t===e))throw new pe(`Invalid geocodeProviderType: "${e}"`)}var RFe=Object.freeze({[ib.GOOGLE]:"google",[ib.BING]:"bing",[ib.DEFAULT]:void 0});function g4t(e){return RFe[e]}function _4t(e){return Object.entries(RFe).find(t=>t[1]===e)[0]}function Vse(e){e=e??H.EMPTY_OBJECT;let t=e.geocodeProviderType??ib.DEFAULT,n=e.accessToken??bf.defaultAccessToken,i=De.createIfNeeded(e.server??bf.defaultServer);i.appendForwardSlash();let r=bf.getDefaultTokenCredit(n);l(r)&&e.scene.frameState.creditDisplay.addStaticCredit(It.clone(r));let o=i.getDerivedResource({url:"v1/geocode"});l(n)&&o.appendQueryParameters({access_token:n}),this._accessToken=n,this._server=i,this._pelias=new i7(o),this.geocodeProviderType=t}Object.defineProperties(Vse.prototype,{credit:{get:function(){}},geocodeProviderType:{get:function(){return _4t(this._pelias.url.queryParameters.geocoder)},set:function(e){p4t(e);let t={...this._pelias.url.queryParameters,geocoder:g4t(e)};l(t.geocoder)||delete t.geocoder,this._pelias.url.setQueryParameters(t)}}});Vse.prototype.geocode=async function(e,t){return this._pelias.geocode(e,t)};var AI=Vse;var OFe={NONE:0,POINT:1,SEGMENT:2,CURVE:3,ARC:4,SURFACE:5};Object.freeze(OFe);var MFe=OFe;var NFe={NONE:0,NOT_IN_RANGE:1,IN_RANGE:2};Object.freeze(NFe);var LFe=NFe;var FFe={NEAREST:1,NEAREST_KEYPOINT:2,CENTER:8};Object.freeze(FFe);var r7=FFe;var BFe={NONE:0,WIRE:1,SHEET:2,SOLID:3,MESH:4,TEXT:5};Object.freeze(BFe);var kFe=BFe;function UFe(e){if(!(!l(e)||!l(e.longitude)||!l(e.latitude)))return h.fromDegrees(e.longitude,e.latitude,e.height??0)}function zFe(e){let t=he.fromCartesian(e);return{longitude:P.toDegrees(t.longitude),latitude:P.toDegrees(t.latitude),height:t.height}}function y4t(e){let t=[],n=new se;for(let i=0;i<4;i++)M.getRow(e,i,n),t.push([n.x,n.y,n.z,n.w]);return t}function A4t(e,t,n){return M.fromRowMajorArray([e/2,0,0,e/2,0,-t/2,0,t/2,0,0,.5,.5,0,0,0,1],n)}var b4t=new M,x4t=new M,o7=class e{constructor(t){this._assetId=t.assetId,this._resource=t.resource,this.ecefTransform=t.ecefTransform}get assetId(){return this._assetId}static async fromAssetId(t,n){n=n??H.EMPTY_OBJECT;let i=n.accessToken??bf.defaultAccessToken,r=De.createIfNeeded(n.server??bf.defaultServer);r.appendForwardSlash();let o={url:`assets/${t}/`,headers:es._addClientHeaders()};l(i)&&(o.queryParameters={access_token:i});let s=r.getDerivedResource(o),a=await s.getDerivedResource({url:"ecef"}).fetchJson();if(!l(a?.ecefTransform))throw new oe(`Cesium ion asset ${t} is not geolocated; snapping requires geolocation`);let c=M.fromRowMajorArray(a.ecefTransform.flat());return new e({assetId:t,resource:s,ecefTransform:c})}_computeWorldToView(t,n,i,r){r=r??new M;let o=A4t(n,i,b4t);return M.multiply(t.viewMatrix,this.ecefTransform,r),M.multiply(t.frustum.projectionMatrix,r,r),M.multiply(o,r,r)}async snap(t){let n=this._computeWorldToView(t.camera,t.canvasWidth,t.canvasHeight,x4t),i={testPoint:zFe(t.testPoint),closePoint:zFe(t.closePoint??t.testPoint),snapAperture:t.snapAperture??e.DEFAULT_SNAP_APERTURE,snapMode:t.snapMode??r7.NEAREST,worldToView:y4t(n)},r;try{r=await this._resource.getDerivedResource({url:`elements/${t.elementId}/snap`}).post(JSON.stringify(i),{headers:{"Content-Type":"application/json"},responseType:"json"})}catch(s){if(s?.statusCode===404||s?.statusCode===400&&typeof s.response?.message=="string"&&s.response.message.includes("No snap possible"))return;throw s}if(!l(r))return;let o={heat:r.heat,geometryType:r.geomType,parentGeometryType:r.parentGeomType,normal:r.normal,curve:r.curve};return o.snapPoint=UFe(r.snapPoint),o.hitPoint=UFe(r.hitPoint),o}};o7.DEFAULT_SNAP_APERTURE=12;var VFe=o7;var ea={};ea.ExportStatus=Object.freeze({NotStarted:"NotStarted",InProgress:"InProgress",Complete:"Complete",Invalid:"Invalid"});ea.ExportType=Object.freeze({IMODEL:"IMODEL",CESIUM:"CESIUM","3DTILES":"3DTILES"});ea.RealityDataType=Object.freeze({Cesium3DTiles:"Cesium3DTiles",PNTS:"PNTS",RealityMesh3DTiles:"RealityMesh3DTiles",Terrain3DTiles:"Terrain3DTiles",GaussianSplat3DTiles:"GS_3DT",KML:"KML",GeoJSON:"GeoJSON",Unstructured:"Unstructured"});ea.defaultAccessToken=void 0;ea.defaultShareKey=void 0;ea._getAuthorizationHeader=function(){return l(ea.defaultShareKey)?`Basic ${ea.defaultShareKey}`:`Bearer ${ea.defaultAccessToken}`};ea.apiEndpoint=new De({url:"https://api.bentley.com"});ea.getExports=async function(e,t){let n=new De({url:`${ea.apiEndpoint}mesh-export`,headers:{Authorization:ea._getAuthorizationHeader(),Accept:"application/vnd.bentley.itwin-platform.v1+json",Prefer:"return=representation"},queryParameters:{iModelId:e,exportType:ea.ExportType["3DTILES"],$top:"5",client:"CesiumJS"}});typeof CESIUM_VERSION<"u"&&n.appendQueryParameters({clientVersion:CESIUM_VERSION}),l(t)&&t!==""&&n.appendQueryParameters({changesetId:t});try{return await n.fetchJson()}catch(i){let r=JSON.parse(i.response);if(i.statusCode===401){let o=r.error.details?.[0].code??"";throw new oe(`Unauthorized, bad token, wrong scopes or headers bad. ${o}`)}else{if(i.statusCode===403)throw console.error(r.error.code,r.error.message),new oe("Not allowed, forbidden");if(i.statusCode===422)throw new oe(`Unprocessable Entity:${r.error.code} ${r.error.message}`);if(i.statusCode===429)throw new oe("Too many requests")}throw new oe(`Unknown request failure ${i.statusCode}`)}};ea.getRealityDataMetadata=async function(e,t){let n=new De({url:`${ea.apiEndpoint}reality-management/reality-data/${t}`,headers:{Authorization:ea._getAuthorizationHeader(),Accept:"application/vnd.bentley.itwin-platform.v1+json"},queryParameters:{iTwinId:e}});try{return(await n.fetchJson()).realityData}catch(i){let r=JSON.parse(i.response);if(i.statusCode===401){let o=r.error.details?.[0].code??"";throw new oe(`Unauthorized, bad token, wrong scopes or headers bad. ${o}`)}else{if(i.statusCode===403)throw console.error(r.error.code,r.error.message),new oe("Not allowed, forbidden");if(i.statusCode===404)throw new oe(`Reality data not found: ${e}, ${t}`);if(i.statusCode===422)throw new oe(`Unprocessable Entity:${r.error.code} ${r.error.message}`);if(i.statusCode===429)throw new oe("Too many requests")}throw new oe(`Unknown request failure ${i.statusCode}`)}};ea.getRealityDataURL=async function(e,t,n){let i=new De({url:`${ea.apiEndpoint}reality-management/reality-data/${t}/readaccess`,headers:{Authorization:ea._getAuthorizationHeader(),Accept:"application/vnd.bentley.itwin-platform.v1+json"},queryParameters:{iTwinId:e}});try{let o=(await i.fetchJson())._links.containerUrl.href,s=new URL(o);return s.pathname=`${s.pathname}/${n}`,s.toString()}catch(r){let o=JSON.parse(r.response);if(r.statusCode===401){let s=o.error.details?.[0].code??"";throw new oe(`Unauthorized, bad token, wrong scopes or headers bad. ${s}`)}else{if(r.statusCode===403)throw console.error(o.error.code,o.error.message),new oe("Not allowed, forbidden");if(r.statusCode===404)throw new oe(`Reality data not found: ${e}, ${t}`);if(r.statusCode===422)throw new oe(`Unprocessable Entity:${o.error.code} ${o.error.message}`);if(r.statusCode===429)throw new oe("Too many requests")}throw new oe(`Unknown request failure ${r.statusCode}`)}};var Ea=ea;var jse=class{constructor(){ut(this,"ellipsoid")}project(t,n){pe.throwInstantiationError()}unproject(t,n){pe.throwInstantiationError()}},jFe=jse;function bI(e){e=e??H.EMPTY_OBJECT;let t=e.weights,n=e.times;this._times=n,this._weights=t,this._count=t.length/n.length,this._lastTimeIndex=0}Object.defineProperties(bI.prototype,{times:{get:function(){return this._times}},weights:{get:function(){return this._weights}}});bI.prototype.findTimeInterval=Or.prototype.findTimeInterval;bI.prototype.wrapTime=Or.prototype.wrapTime;bI.prototype.clampTime=Or.prototype.clampTime;bI.prototype.evaluate=function(e,t){let n=this.weights,i=this.times,r=this._lastTimeIndex=this.findTimeInterval(e,this._lastTimeIndex),o=(e-i[r])/(i[r+1]-i[r]);l(t)||(t=new Array(this._count));for(let s=0;s<this._count;s++){let a=r*this._count+s;t[s]=n[a]*(1-o)+n[a+this._count]*o}return t};var HFe=bI;function Hse(e,t,n){e=De.createIfNeeded(e),e.appendForwardSlash(),e.setQueryParameters({key:t}),this._url=e,this._params=n??{},this._credit=new It('Geodata copyright <a href="https://www.openstreetmap.org/">OpenStreetMap</a> contributors',!1)}Object.defineProperties(Hse.prototype,{url:{get:function(){return this._url}},params:{get:function(){return this._params}},credit:{get:function(){return this._credit}}});Hse.prototype.geocode=async function(e){return this._url.getDerivedResource({url:"json",queryParameters:Mt(this._params,{q:e})}).fetchJson().then(function(n){return n.results.map(function(i){let r,o=i.bounds;if(l(o))r=ie.fromDegrees(o.southwest.lng,o.southwest.lat,o.northeast.lng,o.northeast.lat);else{let{lng:s,lat:a}=i.geometry;r=h.fromDegrees(s,a)}return{displayName:i.formatted,destination:r}})})};var GFe=Hse;var T4t={packedLength:void 0,pack:pe.throwInstantiationError,unpack:pe.throwInstantiationError},WFe=T4t;var E4t={packedInterpolationLength:void 0,convertPackedArrayForInterpolation:pe.throwInstantiationError,unpackInterpolationResult:pe.throwInstantiationError},qFe=E4t;var C4t=new h;function v4t(e,t,n,i){let r=BE(e,t,n,i,C4t);return l(r)?r.x>0&&r.y>0&&r.z>0:!1}var YFe=v4t;function XFe(){pe.throwInstantiationError()}XFe.prototype.getURL=pe.throwInstantiationError;var KFe=XFe;function S4t(e,t,n,i,r,o,s){let a=ar.numberOfPoints(e,t,r),c,u=n.red,f=n.green,d=n.blue,p=n.alpha,g=i.red,m=i.green,y=i.blue,A=i.alpha;if(z.equals(n,i)){for(c=0;c<a;c++)o[s++]=z.floatToByte(u),o[s++]=z.floatToByte(f),o[s++]=z.floatToByte(d),o[s++]=z.floatToByte(p);return s}let b=(g-u)/a,x=(m-f)/a,T=(y-d)/a,E=(A-p)/a,v=s;for(c=0;c<a;c++)o[v++]=z.floatToByte(u+c*b),o[v++]=z.floatToByte(f+c*x),o[v++]=z.floatToByte(d+c*T),o[v++]=z.floatToByte(p+c*E);return v}function RM(e){e=e??H.EMPTY_OBJECT;let t=e.positions,n=e.colors,i=e.colorsPerVertex??!1;this._positions=t,this._colors=n,this._colorsPerVertex=i,this._arcType=e.arcType??ln.GEODESIC,this._granularity=e.granularity??P.RADIANS_PER_DEGREE,this._ellipsoid=e.ellipsoid??ee.default,this._workerName="createSimplePolylineGeometry";let r=1+t.length*h.packedLength;r+=l(n)?1+n.length*z.packedLength:1,this.packedLength=r+ee.packedLength+3}RM.pack=function(e,t,n){n=n??0;let i,r=e._positions,o=r.length;for(t[n++]=o,i=0;i<o;++i,n+=h.packedLength)h.pack(r[i],t,n);let s=e._colors;for(o=l(s)?s.length:0,t[n++]=o,i=0;i<o;++i,n+=z.packedLength)z.pack(s[i],t,n);return ee.pack(e._ellipsoid,t,n),n+=ee.packedLength,t[n++]=e._colorsPerVertex?1:0,t[n++]=e._arcType,t[n]=e._granularity,t};RM.unpack=function(e,t,n){t=t??0;let i,r=e[t++],o=new Array(r);for(i=0;i<r;++i,t+=h.packedLength)o[i]=h.unpack(e,t);r=e[t++];let s=r>0?new Array(r):void 0;for(i=0;i<r;++i,t+=z.packedLength)s[i]=z.unpack(e,t);let a=ee.unpack(e,t);t+=ee.packedLength;let c=e[t++]===1,u=e[t++],f=e[t];return l(n)?(n._positions=o,n._colors=s,n._ellipsoid=a,n._colorsPerVertex=c,n._arcType=u,n._granularity=f,n):new RM({positions:o,colors:s,ellipsoid:a,colorsPerVertex:c,arcType:u,granularity:f})};var s7=new Array(2),a7=new Array(2),w4t={positions:s7,height:a7,ellipsoid:void 0,minDistance:void 0,granularity:void 0};RM.createGeometry=function(e){let t=e._positions,n=e._colors,i=e._colorsPerVertex,r=e._arcType,o=e._granularity,s=e._ellipsoid,a=P.chordLength(o,s.maximumRadius),c=l(n)&&!i,u,f=t.length,d,p,g,m,y=0;if(r===ln.GEODESIC||r===ln.RHUMB){let E,v,S;r===ln.GEODESIC?(E=P.chordLength(o,s.maximumRadius),v=ar.numberOfPoints,S=ar.generateArc):(E=o,v=ar.numberOfPointsRhumbLine,S=ar.generateRhumbArc);let I=ar.extractHeights(t,s),R=w4t;if(r===ln.GEODESIC?R.minDistance=a:R.granularity=o,R.ellipsoid=s,c){let O=0;for(u=0;u<f-1;u++)O+=v(t[u],t[u+1],E)+1;d=new Float64Array(O*3),g=new Uint8Array(O*4),R.positions=s7,R.height=a7;let L=0;for(u=0;u<f-1;++u){s7[0]=t[u],s7[1]=t[u+1],a7[0]=I[u],a7[1]=I[u+1];let _=S(R);if(l(n)){let C=_.length/3;m=n[u];for(let w=0;w<C;++w)g[L++]=z.floatToByte(m.red),g[L++]=z.floatToByte(m.green),g[L++]=z.floatToByte(m.blue),g[L++]=z.floatToByte(m.alpha)}d.set(_,y),y+=_.length}}else if(R.positions=t,R.height=I,d=new Float64Array(S(R)),l(n)){for(g=new Uint8Array(d.length/3*4),u=0;u<f-1;++u){let L=t[u],_=t[u+1],C=n[u],w=n[u+1];y=S4t(L,_,C,w,a,g,y)}let O=n[f-1];g[y++]=z.floatToByte(O.red),g[y++]=z.floatToByte(O.green),g[y++]=z.floatToByte(O.blue),g[y]=z.floatToByte(O.alpha)}}else{p=c?f*2-2:f,d=new Float64Array(p*3),g=l(n)?new Uint8Array(p*4):void 0;let E=0,v=0;for(u=0;u<f;++u){let S=t[u];if(c&&u>0&&(h.pack(S,d,E),E+=3,m=n[u-1],g[v++]=z.floatToByte(m.red),g[v++]=z.floatToByte(m.green),g[v++]=z.floatToByte(m.blue),g[v++]=z.floatToByte(m.alpha)),c&&u===f-1)break;h.pack(S,d,E),E+=3,l(n)&&(m=n[u],g[v++]=z.floatToByte(m.red),g[v++]=z.floatToByte(m.green),g[v++]=z.floatToByte(m.blue),g[v++]=z.floatToByte(m.alpha))}}let A=new En;A.position=new Ne({componentDatatype:Y.DOUBLE,componentsPerAttribute:3,values:d}),l(n)&&(A.color=new Ne({componentDatatype:Y.UNSIGNED_BYTE,componentsPerAttribute:4,values:g,normalize:!0})),p=d.length/3;let b=(p-1)*2,x=je.createTypedArray(p,b),T=0;for(u=0;u<p-1;++u)x[T++]=u,x[T++]=u+1;return new wt({attributes:A,indices:x,primitiveType:Oe.LINES,boundingSphere:ue.fromPoints(t)})};var $Fe=RM;var c7=class{constructor(){pe.throwInstantiationError()}async snap(t){pe.throwInstantiationError()}};c7.DEFAULT_SNAP_APERTURE=void 0;var JFe=c7;function xI(e){let t=e.radius??1,i={radii:new h(t,t,t),stackPartitions:e.stackPartitions,slicePartitions:e.slicePartitions,vertexFormat:e.vertexFormat};this._ellipsoidGeometry=new Qa(i),this._workerName="createSphereGeometry"}xI.packedLength=Qa.packedLength;xI.pack=function(e,t,n){return Qa.pack(e._ellipsoidGeometry,t,n)};var I4t=new Qa,rb={radius:void 0,radii:new h,vertexFormat:new Be,stackPartitions:void 0,slicePartitions:void 0};xI.unpack=function(e,t,n){let i=Qa.unpack(e,t,I4t);return rb.vertexFormat=Be.clone(i._vertexFormat,rb.vertexFormat),rb.stackPartitions=i._stackPartitions,rb.slicePartitions=i._slicePartitions,l(n)?(h.clone(i._radii,rb.radii),n._ellipsoidGeometry=new Qa(rb),n):(rb.radius=i._radii.x,new xI(rb))};xI.createGeometry=function(e){return Qa.createGeometry(e._ellipsoidGeometry)};var l7=xI;function P4t(e){return e<=.04045?e*.07739938080495357:Math.pow((e+.055)*.9478672985781991,2.4)}var TI=P4t;var Gse=class{constructor(t){ut(this,"ellipsoid");ut(this,"rectangle");ut(this,"projection")}getNumberOfXTilesAtLevel(t){pe.throwInstantiationError()}getNumberOfYTilesAtLevel(t){pe.throwInstantiationError()}rectangleToNativeRectangle(t,n){pe.throwInstantiationError()}tileXYToNativeRectangle(t,n,i,r){pe.throwInstantiationError()}tileXYToRectangle(t,n,i,r){pe.throwInstantiationError()}positionToTileXY(t,n,i){pe.throwInstantiationError()}},ZFe=Gse;function rE(e){e=e??H.EMPTY_OBJECT,this._clock=void 0,this._element=void 0,this._clockSubscription=void 0,this._seekFunction=void 0,this._lastPlaybackRate=void 0,this.clock=e.clock,this.element=e.element,this.epoch=e.epoch??it.MINIMUM_VALUE,this.tolerance=e.tolerance??1,this._seeking=!1,this._seekFunction=void 0,this._firstTickAfterSeek=!1}Object.defineProperties(rE.prototype,{clock:{get:function(){return this._clock},set:function(e){let t=this._clock;t!==e&&(l(t)&&(this._clockSubscription(),this._clockSubscription=void 0),l(e)&&(this._clockSubscription=e.onTick.addEventListener(rE.prototype._onTick,this)),this._clock=e)}},element:{get:function(){return this._element},set:function(e){let t=this._element;t!==e&&(l(t)&&t.removeEventListener("seeked",this._seekFunction,!1),l(e)&&(this._seeking=!1,this._seekFunction=D4t(this),e.addEventListener("seeked",this._seekFunction,!1)),this._element=e,this._seeking=!1,this._firstTickAfterSeek=!1)}}});rE.prototype.destroy=function(){return this.element=void 0,this.clock=void 0,le(this)};rE.prototype.isDestroyed=function(){return!1};rE.prototype._trySetPlaybackRate=function(e){if(this._lastPlaybackRate===e.multiplier)return;let t=this._element;try{t.playbackRate=e.multiplier}catch{t.playbackRate=0}this._lastPlaybackRate=e.multiplier};rE.prototype._onTick=function(e){let t=this._element;if(!l(t)||t.readyState<2)return;let n=t.paused,i=e.shouldAnimate;if(i===n&&(i?t.play():t.pause()),this._seeking||this._firstTickAfterSeek){this._firstTickAfterSeek=!1;return}this._trySetPlaybackRate(e);let r=e.currentTime,o=this.epoch??it.MINIMUM_VALUE,s=K.secondsDifference(r,o),a=t.duration,c,u=t.currentTime;t.loop?(s=s%a,s<0&&(s=a-s),c=s):s>a?c=a:s<0?c=0:c=s;let f=i?this.tolerance??1:.001;Math.abs(c-u)>f&&(this._seeking=!0,t.currentTime=c)};function D4t(e){return function(){e._seeking=!1,e._firstTickAfterSeek=!0}}var QFe=rE;function R4t(e,t){this.rectangle=e,this.maxLevel=t}function eBe(e){this.ellipsoid=e.ellipsoid??ee.default,this.tilingScheme=void 0,this.heightmapWidth=void 0,this.heightmapHeight=void 0,this.levelZeroMaximumGeometricError=void 0,this.rectangles=[]}eBe.prototype.build=function(e){e._tilingScheme=this.tilingScheme,e._heightmapWidth=this.heightmapWidth,e._heightmapHeight=this.heightmapHeight,e._levelZeroMaximumGeometricError=this.levelZeroMaximumGeometricError,e._rectangles=this.rectangles};function O4t(e,t){let n=t.getElementsByTagName("SRS")[0].textContent;if(n==="EPSG:4326")e.tilingScheme=new ir({ellipsoid:e.ellipsoid});else throw new oe(`SRS ${n} is not supported`);let i=t.getElementsByTagName("TileFormat")[0];e.heightmapWidth=parseInt(i.getAttribute("width"),10),e.heightmapHeight=parseInt(i.getAttribute("height"),10),e.levelZeroMaximumGeometricError=Xr.getEstimatedLevelZeroGeometricErrorForAHeightmap(e.ellipsoid,Math.min(e.heightmapWidth,e.heightmapHeight),e.tilingScheme.getNumberOfXTilesAtLevel(0));let r=t.getElementsByTagName("DataExtent");for(let o=0;o<r.length;++o){let s=r[o],a=P.toRadians(parseFloat(s.getAttribute("minx"))),c=P.toRadians(parseFloat(s.getAttribute("miny"))),u=P.toRadians(parseFloat(s.getAttribute("maxx"))),f=P.toRadians(parseFloat(s.getAttribute("maxy"))),d=parseInt(s.getAttribute("maxlevel"),10);e.rectangles.push(new R4t(new ie(a,c,u,f),d))}}function M4t(e,t,n){let i=`An error occurred while accessing ${e.url}`;throw l(t)&&l(t.message)&&(i=`${i}: ${t.message}`),no.reportError(void 0,n,l(n)?n._errorEvent:void 0,i),new oe(i)}async function N4t(e,t,n){try{let i=await t.fetchXML();O4t(e,i)}catch(i){M4t(t,i,n)}}function ob(e){e=e??H.EMPTY_OBJECT,this._errorEvent=new be,this._terrainDataStructure={heightScale:1/1e3,heightOffset:-1e3,elementsPerHeight:3,stride:4,elementMultiplier:256,isBigEndian:!0,lowestEncodedHeight:0,highestEncodedHeight:256*256*256-1};let t=e.credit;typeof t=="string"&&(t=new It(t)),this._credit=t,this._tilingScheme=void 0,this._rectangles=[]}Object.defineProperties(ob.prototype,{errorEvent:{get:function(){return this._errorEvent}},credit:{get:function(){return this._credit}},tilingScheme:{get:function(){return this._tilingScheme}},hasWaterMask:{get:function(){return!1}},hasVertexNormals:{get:function(){return!1}},availability:{get:function(){}}});ob.fromUrl=async function(e,t){t=t??H.EMPTY_OBJECT;let n=new eBe(t),i=De.createIfNeeded(e);await N4t(n,i);let r=new ob(t);return n.build(r),r._resource=i,r};ob.prototype.requestTileGeometry=function(e,t,n,i){let r=this._tilingScheme.getNumberOfYTilesAtLevel(n),s=this._resource.getDerivedResource({url:`${n}/${e}/${r-t-1}.tif`,queryParameters:{cesium:!0},request:i}).fetchImage({preferImageBitmap:!0});if(!l(s))return;let a=this;return Promise.resolve(s).then(function(c){return new sl({buffer:Bm(c),width:a._heightmapWidth,height:a._heightmapHeight,childTileMask:L4t(a,e,t,n),structure:a._terrainDataStructure})})};ob.prototype.getLevelMaximumGeometricError=function(e){return this._levelZeroMaximumGeometricError/(1<<e)};var tBe=new ie;function L4t(e,t,n,i){let r=e._tilingScheme,o=e._rectangles,s=r.tileXYToRectangle(t,n,i),a=0;for(let c=0;c<o.length&&a!==15;++c){let u=o[c];if(u.maxLevel<=i)continue;let f=u.rectangle,d=ie.intersection(f,s,tBe);l(d)&&(u7(r,f,t*2,n*2,i+1)&&(a|=4),u7(r,f,t*2+1,n*2,i+1)&&(a|=8),u7(r,f,t*2,n*2+1,i+1)&&(a|=1),u7(r,f,t*2+1,n*2+1,i+1)&&(a|=2))}return a}function u7(e,t,n,i,r){let o=e.tileXYToRectangle(n,i,r);return l(ie.intersection(o,t,tBe))}ob.prototype.getTileDataAvailable=function(e,t,n){};ob.prototype.loadTileDataAvailability=function(e,t,n){};var nBe=ob;var iBe={VK_FORMAT_UNDEFINED:0,VK_FORMAT_R4G4_UNORM_PACK8:1,VK_FORMAT_R4G4B4A4_UNORM_PACK16:2,VK_FORMAT_B4G4R4A4_UNORM_PACK16:3,VK_FORMAT_R5G6B5_UNORM_PACK16:4,VK_FORMAT_B5G6R5_UNORM_PACK16:5,VK_FORMAT_R5G5B5A1_UNORM_PACK16:6,VK_FORMAT_B5G5R5A1_UNORM_PACK16:7,VK_FORMAT_A1R5G5B5_UNORM_PACK16:8,VK_FORMAT_R8_UNORM:9,VK_FORMAT_R8_SNORM:10,VK_FORMAT_R8_USCALED:11,VK_FORMAT_R8_SSCALED:12,VK_FORMAT_R8_UINT:13,VK_FORMAT_R8_SINT:14,VK_FORMAT_R8_SRGB:15,VK_FORMAT_R8G8_UNORM:16,VK_FORMAT_R8G8_SNORM:17,VK_FORMAT_R8G8_USCALED:18,VK_FORMAT_R8G8_SSCALED:19,VK_FORMAT_R8G8_UINT:20,VK_FORMAT_R8G8_SINT:21,VK_FORMAT_R8G8_SRGB:22,VK_FORMAT_R8G8B8_UNORM:23,VK_FORMAT_R8G8B8_SNORM:24,VK_FORMAT_R8G8B8_USCALED:25,VK_FORMAT_R8G8B8_SSCALED:26,VK_FORMAT_R8G8B8_UINT:27,VK_FORMAT_R8G8B8_SINT:28,VK_FORMAT_R8G8B8_SRGB:29,VK_FORMAT_B8G8R8_UNORM:30,VK_FORMAT_B8G8R8_SNORM:31,VK_FORMAT_B8G8R8_USCALED:32,VK_FORMAT_B8G8R8_SSCALED:33,VK_FORMAT_B8G8R8_UINT:34,VK_FORMAT_B8G8R8_SINT:35,VK_FORMAT_B8G8R8_SRGB:36,VK_FORMAT_R8G8B8A8_UNORM:37,VK_FORMAT_R8G8B8A8_SNORM:38,VK_FORMAT_R8G8B8A8_USCALED:39,VK_FORMAT_R8G8B8A8_SSCALED:40,VK_FORMAT_R8G8B8A8_UINT:41,VK_FORMAT_R8G8B8A8_SINT:42,VK_FORMAT_R8G8B8A8_SRGB:43,VK_FORMAT_B8G8R8A8_UNORM:44,VK_FORMAT_B8G8R8A8_SNORM:45,VK_FORMAT_B8G8R8A8_USCALED:46,VK_FORMAT_B8G8R8A8_SSCALED:47,VK_FORMAT_B8G8R8A8_UINT:48,VK_FORMAT_B8G8R8A8_SINT:49,VK_FORMAT_B8G8R8A8_SRGB:50,VK_FORMAT_A8B8G8R8_UNORM_PACK32:51,VK_FORMAT_A8B8G8R8_SNORM_PACK32:52,VK_FORMAT_A8B8G8R8_USCALED_PACK32:53,VK_FORMAT_A8B8G8R8_SSCALED_PACK32:54,VK_FORMAT_A8B8G8R8_UINT_PACK32:55,VK_FORMAT_A8B8G8R8_SINT_PACK32:56,VK_FORMAT_A8B8G8R8_SRGB_PACK32:57,VK_FORMAT_A2R10G10B10_UNORM_PACK32:58,VK_FORMAT_A2R10G10B10_SNORM_PACK32:59,VK_FORMAT_A2R10G10B10_USCALED_PACK32:60,VK_FORMAT_A2R10G10B10_SSCALED_PACK32:61,VK_FORMAT_A2R10G10B10_UINT_PACK32:62,VK_FORMAT_A2R10G10B10_SINT_PACK32:63,VK_FORMAT_A2B10G10R10_UNORM_PACK32:64,VK_FORMAT_A2B10G10R10_SNORM_PACK32:65,VK_FORMAT_A2B10G10R10_USCALED_PACK32:66,VK_FORMAT_A2B10G10R10_SSCALED_PACK32:67,VK_FORMAT_A2B10G10R10_UINT_PACK32:68,VK_FORMAT_A2B10G10R10_SINT_PACK32:69,VK_FORMAT_R16_UNORM:70,VK_FORMAT_R16_SNORM:71,VK_FORMAT_R16_USCALED:72,VK_FORMAT_R16_SSCALED:73,VK_FORMAT_R16_UINT:74,VK_FORMAT_R16_SINT:75,VK_FORMAT_R16_SFLOAT:76,VK_FORMAT_R16G16_UNORM:77,VK_FORMAT_R16G16_SNORM:78,VK_FORMAT_R16G16_USCALED:79,VK_FORMAT_R16G16_SSCALED:80,VK_FORMAT_R16G16_UINT:81,VK_FORMAT_R16G16_SINT:82,VK_FORMAT_R16G16_SFLOAT:83,VK_FORMAT_R16G16B16_UNORM:84,VK_FORMAT_R16G16B16_SNORM:85,VK_FORMAT_R16G16B16_USCALED:86,VK_FORMAT_R16G16B16_SSCALED:87,VK_FORMAT_R16G16B16_UINT:88,VK_FORMAT_R16G16B16_SINT:89,VK_FORMAT_R16G16B16_SFLOAT:90,VK_FORMAT_R16G16B16A16_UNORM:91,VK_FORMAT_R16G16B16A16_SNORM:92,VK_FORMAT_R16G16B16A16_USCALED:93,VK_FORMAT_R16G16B16A16_SSCALED:94,VK_FORMAT_R16G16B16A16_UINT:95,VK_FORMAT_R16G16B16A16_SINT:96,VK_FORMAT_R16G16B16A16_SFLOAT:97,VK_FORMAT_R32_UINT:98,VK_FORMAT_R32_SINT:99,VK_FORMAT_R32_SFLOAT:100,VK_FORMAT_R32G32_UINT:101,VK_FORMAT_R32G32_SINT:102,VK_FORMAT_R32G32_SFLOAT:103,VK_FORMAT_R32G32B32_UINT:104,VK_FORMAT_R32G32B32_SINT:105,VK_FORMAT_R32G32B32_SFLOAT:106,VK_FORMAT_R32G32B32A32_UINT:107,VK_FORMAT_R32G32B32A32_SINT:108,VK_FORMAT_R32G32B32A32_SFLOAT:109,VK_FORMAT_R64_UINT:110,VK_FORMAT_R64_SINT:111,VK_FORMAT_R64_SFLOAT:112,VK_FORMAT_R64G64_UINT:113,VK_FORMAT_R64G64_SINT:114,VK_FORMAT_R64G64_SFLOAT:115,VK_FORMAT_R64G64B64_UINT:116,VK_FORMAT_R64G64B64_SINT:117,VK_FORMAT_R64G64B64_SFLOAT:118,VK_FORMAT_R64G64B64A64_UINT:119,VK_FORMAT_R64G64B64A64_SINT:120,VK_FORMAT_R64G64B64A64_SFLOAT:121,VK_FORMAT_B10G11R11_UFLOAT_PACK32:122,VK_FORMAT_E5B9G9R9_UFLOAT_PACK32:123,VK_FORMAT_D16_UNORM:124,VK_FORMAT_X8_D24_UNORM_PACK32:125,VK_FORMAT_D32_SFLOAT:126,VK_FORMAT_S8_UINT:127,VK_FORMAT_D16_UNORM_S8_UINT:128,VK_FORMAT_D24_UNORM_S8_UINT:129,VK_FORMAT_D32_SFLOAT_S8_UINT:130,VK_FORMAT_BC1_RGB_UNORM_BLOCK:131,VK_FORMAT_BC1_RGB_SRGB_BLOCK:132,VK_FORMAT_BC1_RGBA_UNORM_BLOCK:133,VK_FORMAT_BC1_RGBA_SRGB_BLOCK:134,VK_FORMAT_BC2_UNORM_BLOCK:135,VK_FORMAT_BC2_SRGB_BLOCK:136,VK_FORMAT_BC3_UNORM_BLOCK:137,VK_FORMAT_BC3_SRGB_BLOCK:138,VK_FORMAT_BC4_UNORM_BLOCK:139,VK_FORMAT_BC4_SNORM_BLOCK:140,VK_FORMAT_BC5_UNORM_BLOCK:141,VK_FORMAT_BC5_SNORM_BLOCK:142,VK_FORMAT_BC6H_UFLOAT_BLOCK:143,VK_FORMAT_BC6H_SFLOAT_BLOCK:144,VK_FORMAT_BC7_UNORM_BLOCK:145,VK_FORMAT_BC7_SRGB_BLOCK:146,VK_FORMAT_ETC2_R8G8B8_UNORM_BLOCK:147,VK_FORMAT_ETC2_R8G8B8_SRGB_BLOCK:148,VK_FORMAT_ETC2_R8G8B8A1_UNORM_BLOCK:149,VK_FORMAT_ETC2_R8G8B8A1_SRGB_BLOCK:150,VK_FORMAT_ETC2_R8G8B8A8_UNORM_BLOCK:151,VK_FORMAT_ETC2_R8G8B8A8_SRGB_BLOCK:152,VK_FORMAT_EAC_R11_UNORM_BLOCK:153,VK_FORMAT_EAC_R11_SNORM_BLOCK:154,VK_FORMAT_EAC_R11G11_UNORM_BLOCK:155,VK_FORMAT_EAC_R11G11_SNORM_BLOCK:156,VK_FORMAT_ASTC_4x4_UNORM_BLOCK:157,VK_FORMAT_ASTC_4x4_SRGB_BLOCK:158,VK_FORMAT_ASTC_5x4_UNORM_BLOCK:159,VK_FORMAT_ASTC_5x4_SRGB_BLOCK:160,VK_FORMAT_ASTC_5x5_UNORM_BLOCK:161,VK_FORMAT_ASTC_5x5_SRGB_BLOCK:162,VK_FORMAT_ASTC_6x5_UNORM_BLOCK:163,VK_FORMAT_ASTC_6x5_SRGB_BLOCK:164,VK_FORMAT_ASTC_6x6_UNORM_BLOCK:165,VK_FORMAT_ASTC_6x6_SRGB_BLOCK:166,VK_FORMAT_ASTC_8x5_UNORM_BLOCK:167,VK_FORMAT_ASTC_8x5_SRGB_BLOCK:168,VK_FORMAT_ASTC_8x6_UNORM_BLOCK:169,VK_FORMAT_ASTC_8x6_SRGB_BLOCK:170,VK_FORMAT_ASTC_8x8_UNORM_BLOCK:171,VK_FORMAT_ASTC_8x8_SRGB_BLOCK:172,VK_FORMAT_ASTC_10x5_UNORM_BLOCK:173,VK_FORMAT_ASTC_10x5_SRGB_BLOCK:174,VK_FORMAT_ASTC_10x6_UNORM_BLOCK:175,VK_FORMAT_ASTC_10x6_SRGB_BLOCK:176,VK_FORMAT_ASTC_10x8_UNORM_BLOCK:177,VK_FORMAT_ASTC_10x8_SRGB_BLOCK:178,VK_FORMAT_ASTC_10x10_UNORM_BLOCK:179,VK_FORMAT_ASTC_10x10_SRGB_BLOCK:180,VK_FORMAT_ASTC_12x10_UNORM_BLOCK:181,VK_FORMAT_ASTC_12x10_SRGB_BLOCK:182,VK_FORMAT_ASTC_12x12_UNORM_BLOCK:183,VK_FORMAT_ASTC_12x12_SRGB_BLOCK:184,VK_FORMAT_G8B8G8R8_422_UNORM:1000156e3,VK_FORMAT_B8G8R8G8_422_UNORM:1000156001,VK_FORMAT_G8_B8_R8_3PLANE_420_UNORM:1000156002,VK_FORMAT_G8_B8R8_2PLANE_420_UNORM:1000156003,VK_FORMAT_G8_B8_R8_3PLANE_422_UNORM:1000156004,VK_FORMAT_G8_B8R8_2PLANE_422_UNORM:1000156005,VK_FORMAT_G8_B8_R8_3PLANE_444_UNORM:1000156006,VK_FORMAT_R10X6_UNORM_PACK16:1000156007,VK_FORMAT_R10X6G10X6_UNORM_2PACK16:1000156008,VK_FORMAT_R10X6G10X6B10X6A10X6_UNORM_4PACK16:1000156009,VK_FORMAT_G10X6B10X6G10X6R10X6_422_UNORM_4PACK16:1000156010,VK_FORMAT_B10X6G10X6R10X6G10X6_422_UNORM_4PACK16:1000156011,VK_FORMAT_G10X6_B10X6_R10X6_3PLANE_420_UNORM_3PACK16:1000156012,VK_FORMAT_G10X6_B10X6R10X6_2PLANE_420_UNORM_3PACK16:1000156013,VK_FORMAT_G10X6_B10X6_R10X6_3PLANE_422_UNORM_3PACK16:1000156014,VK_FORMAT_G10X6_B10X6R10X6_2PLANE_422_UNORM_3PACK16:1000156015,VK_FORMAT_G10X6_B10X6_R10X6_3PLANE_444_UNORM_3PACK16:1000156016,VK_FORMAT_R12X4_UNORM_PACK16:1000156017,VK_FORMAT_R12X4G12X4_UNORM_2PACK16:1000156018,VK_FORMAT_R12X4G12X4B12X4A12X4_UNORM_4PACK16:1000156019,VK_FORMAT_G12X4B12X4G12X4R12X4_422_UNORM_4PACK16:1000156020,VK_FORMAT_B12X4G12X4R12X4G12X4_422_UNORM_4PACK16:1000156021,VK_FORMAT_G12X4_B12X4_R12X4_3PLANE_420_UNORM_3PACK16:1000156022,VK_FORMAT_G12X4_B12X4R12X4_2PLANE_420_UNORM_3PACK16:1000156023,VK_FORMAT_G12X4_B12X4_R12X4_3PLANE_422_UNORM_3PACK16:1000156024,VK_FORMAT_G12X4_B12X4R12X4_2PLANE_422_UNORM_3PACK16:1000156025,VK_FORMAT_G12X4_B12X4_R12X4_3PLANE_444_UNORM_3PACK16:1000156026,VK_FORMAT_G16B16G16R16_422_UNORM:1000156027,VK_FORMAT_B16G16R16G16_422_UNORM:1000156028,VK_FORMAT_G16_B16_R16_3PLANE_420_UNORM:1000156029,VK_FORMAT_G16_B16R16_2PLANE_420_UNORM:1000156030,VK_FORMAT_G16_B16_R16_3PLANE_422_UNORM:1000156031,VK_FORMAT_G16_B16R16_2PLANE_422_UNORM:1000156032,VK_FORMAT_G16_B16_R16_3PLANE_444_UNORM:1000156033,VK_FORMAT_PVRTC1_2BPP_UNORM_BLOCK_IMG:1000054e3,VK_FORMAT_PVRTC1_4BPP_UNORM_BLOCK_IMG:1000054001,VK_FORMAT_PVRTC2_2BPP_UNORM_BLOCK_IMG:1000054002,VK_FORMAT_PVRTC2_4BPP_UNORM_BLOCK_IMG:1000054003,VK_FORMAT_PVRTC1_2BPP_SRGB_BLOCK_IMG:1000054004,VK_FORMAT_PVRTC1_4BPP_SRGB_BLOCK_IMG:1000054005,VK_FORMAT_PVRTC2_2BPP_SRGB_BLOCK_IMG:1000054006,VK_FORMAT_PVRTC2_4BPP_SRGB_BLOCK_IMG:1000054007,VK_FORMAT_ASTC_4x4_SFLOAT_BLOCK_EXT:1000066e3,VK_FORMAT_ASTC_5x4_SFLOAT_BLOCK_EXT:1000066001,VK_FORMAT_ASTC_5x5_SFLOAT_BLOCK_EXT:1000066002,VK_FORMAT_ASTC_6x5_SFLOAT_BLOCK_EXT:1000066003,VK_FORMAT_ASTC_6x6_SFLOAT_BLOCK_EXT:1000066004,VK_FORMAT_ASTC_8x5_SFLOAT_BLOCK_EXT:1000066005,VK_FORMAT_ASTC_8x6_SFLOAT_BLOCK_EXT:1000066006,VK_FORMAT_ASTC_8x8_SFLOAT_BLOCK_EXT:1000066007,VK_FORMAT_ASTC_10x5_SFLOAT_BLOCK_EXT:1000066008,VK_FORMAT_ASTC_10x6_SFLOAT_BLOCK_EXT:1000066009,VK_FORMAT_ASTC_10x8_SFLOAT_BLOCK_EXT:1000066010,VK_FORMAT_ASTC_10x10_SFLOAT_BLOCK_EXT:1000066011,VK_FORMAT_ASTC_12x10_SFLOAT_BLOCK_EXT:1000066012,VK_FORMAT_ASTC_12x12_SFLOAT_BLOCK_EXT:1000066013,VK_FORMAT_G8B8G8R8_422_UNORM_KHR:1000156e3,VK_FORMAT_B8G8R8G8_422_UNORM_KHR:1000156001,VK_FORMAT_G8_B8_R8_3PLANE_420_UNORM_KHR:1000156002,VK_FORMAT_G8_B8R8_2PLANE_420_UNORM_KHR:1000156003,VK_FORMAT_G8_B8_R8_3PLANE_422_UNORM_KHR:1000156004,VK_FORMAT_G8_B8R8_2PLANE_422_UNORM_KHR:1000156005,VK_FORMAT_G8_B8_R8_3PLANE_444_UNORM_KHR:1000156006,VK_FORMAT_R10X6_UNORM_PACK16_KHR:1000156007,VK_FORMAT_R10X6G10X6_UNORM_2PACK16_KHR:1000156008,VK_FORMAT_R10X6G10X6B10X6A10X6_UNORM_4PACK16_KHR:1000156009,VK_FORMAT_G10X6B10X6G10X6R10X6_422_UNORM_4PACK16_KHR:1000156010,VK_FORMAT_B10X6G10X6R10X6G10X6_422_UNORM_4PACK16_KHR:1000156011,VK_FORMAT_G10X6_B10X6_R10X6_3PLANE_420_UNORM_3PACK16_KHR:1000156012,VK_FORMAT_G10X6_B10X6R10X6_2PLANE_420_UNORM_3PACK16_KHR:1000156013,VK_FORMAT_G10X6_B10X6_R10X6_3PLANE_422_UNORM_3PACK16_KHR:1000156014,VK_FORMAT_G10X6_B10X6R10X6_2PLANE_422_UNORM_3PACK16_KHR:1000156015,VK_FORMAT_G10X6_B10X6_R10X6_3PLANE_444_UNORM_3PACK16_KHR:1000156016,VK_FORMAT_R12X4_UNORM_PACK16_KHR:1000156017,VK_FORMAT_R12X4G12X4_UNORM_2PACK16_KHR:1000156018,VK_FORMAT_R12X4G12X4B12X4A12X4_UNORM_4PACK16_KHR:1000156019,VK_FORMAT_G12X4B12X4G12X4R12X4_422_UNORM_4PACK16_KHR:1000156020,VK_FORMAT_B12X4G12X4R12X4G12X4_422_UNORM_4PACK16_KHR:1000156021,VK_FORMAT_G12X4_B12X4_R12X4_3PLANE_420_UNORM_3PACK16_KHR:1000156022,VK_FORMAT_G12X4_B12X4R12X4_2PLANE_420_UNORM_3PACK16_KHR:1000156023,VK_FORMAT_G12X4_B12X4_R12X4_3PLANE_422_UNORM_3PACK16_KHR:1000156024,VK_FORMAT_G12X4_B12X4R12X4_2PLANE_422_UNORM_3PACK16_KHR:1000156025,VK_FORMAT_G12X4_B12X4_R12X4_3PLANE_444_UNORM_3PACK16_KHR:1000156026,VK_FORMAT_G16B16G16R16_422_UNORM_KHR:1000156027,VK_FORMAT_B16G16R16G16_422_UNORM_KHR:1000156028,VK_FORMAT_G16_B16_R16_3PLANE_420_UNORM_KHR:1000156029,VK_FORMAT_G16_B16R16_2PLANE_420_UNORM_KHR:1000156030,VK_FORMAT_G16_B16_R16_3PLANE_422_UNORM_KHR:1000156031,VK_FORMAT_G16_B16R16_2PLANE_422_UNORM_KHR:1000156032,VK_FORMAT_G16_B16_R16_3PLANE_444_UNORM_KHR:1000156033};Object.freeze(iBe);var rBe=iBe;function F4t(e){switch(e){case te.FLOAT:return"float";case te.FLOAT_VEC2:return"vec2";case te.FLOAT_VEC3:return"vec3";case te.FLOAT_VEC4:return"vec4";case te.FLOAT_MAT2:return"mat2";case te.FLOAT_MAT3:return"mat3";case te.FLOAT_MAT4:return"mat4";case te.SAMPLER_2D:return"sampler2D";case te.BOOL:return"bool"}}var oBe=F4t;function B4t(e,t,n){return function(){n.apply(e,arguments),t.apply(e,arguments)}}var f7=B4t;var k4t=new h(1,1,1);function Wse(e){e=e??k4t,this._dimensions=h.clone(e)}Object.defineProperties(Wse.prototype,{dimensions:{get:function(){return this._dimensions},set:function(e){h.clone(e,this._dimensions)}}});var U4t=new h;Wse.prototype.emit=function(e){let t=this._dimensions,n=h.multiplyByScalar(t,.5,U4t),i=P.randomBetween(-n.x,n.x),r=P.randomBetween(-n.y,n.y),o=P.randomBetween(-n.z,n.z);e.position=h.fromElements(i,r,o,e.position),e.velocity=h.normalize(e.position,e.velocity)};var sBe=Wse;var qse=0,aBe=new h,d7=new h,z4t=new Uo;function V4t(e,t,n){let i=t.tileX,r=t.tileY,o=t.tileZ,s=n?.featureIdProperty,a=z4t.tileXYToRectangle(i,r,o),c=ie.center(a),u=h.fromRadians(c.longitude,c.latitude,0),f=4294967295,d=f,p=f,g=new Map,m=new Map,y=[],A=[],b=[],x=0;function T(){let B=(4-x%4)%4;B>0&&(b.push(new Uint8Array(B)),x+=B)}function E(B,j){T();let k=x;b.push(new Uint8Array(B.buffer,B.byteOffset,B.byteLength)),x+=B.byteLength;let G=y.length;return y.push({buffer:0,byteOffset:k,byteLength:B.byteLength,target:j}),G}function v(B,j){let k=E(B,j.target),G=bt.getComponentCount(j.type),q={bufferView:k,byteOffset:0,componentType:j.componentType,count:B.length/G,type:j.type};l(j.min)&&(q.min=j.min),l(j.max)&&(q.max=j.max);let Q=A.length;return A.push(q),Q}function S(B){let j=Number.POSITIVE_INFINITY,k=Number.POSITIVE_INFINITY,G=Number.POSITIVE_INFINITY,q=Number.NEGATIVE_INFINITY,Q=Number.NEGATIVE_INFINITY,W=Number.NEGATIVE_INFINITY;for(let J=0;J<B.length;J+=3){let Z=B[J],ae=B[J+1],Ae=B[J+2];Z<j&&(j=Z),ae<k&&(k=ae),Ae<G&&(G=Ae),Z>q&&(q=Z),ae>Q&&(Q=ae),Ae>W&&(W=Ae)}return{min:[j,k,G],max:[q,Q,W]}}function I(B,j,k){if(k.length===0)return;let G=new Uint32Array(k),q=v(G,{type:"SCALAR",componentType:Y.UNSIGNED_INT,target:te.ARRAY_BUFFER});B._FEATURE_ID_0=q;let Q={featureCount:g.size,nullFeatureId:d,attribute:0};m.size>0&&(Q.propertyTable=0),j.EXT_mesh_features={featureIds:[Q]}}function R(B,j){j=j??4;let k=(j-x%j)%j;k>0&&(b.push(new Uint8Array(k)),x+=k);let G=x;b.push(B),x+=B.byteLength;let q=y.length;return y.push({buffer:0,byteOffset:G,byteLength:B.byteLength}),q}function O(){if(m.size===0)return;let B=new Map;for(let q of m.values())for(let[Q,W]of Object.entries(q)){if(!l(W))continue;let J=typeof W,Z;J==="string"?Z="STRING":J==="number"?Z="SCALAR":J==="boolean"?Z="BOOLEAN":Z="STRING";let ae=B.get(Q);l(ae)?ae!==Z&&B.set(Q,"STRING"):B.set(Q,Z)}if(B.size===0)return;let j={};for(let[q,Q]of B)Q==="SCALAR"?j[q]={type:"SCALAR",componentType:"FLOAT64"}:Q==="BOOLEAN"?j[q]={type:"BOOLEAN"}:j[q]={type:"STRING"};let k={},G=g.size;for(let[q,Q]of B)if(Q==="SCALAR"){let W=new Float64Array(G);for(let Z=0;Z<G;Z++){let Ae=m.get(Z)?.[q];W[Z]=typeof Ae=="number"&&Number.isFinite(Ae)?Ae:NaN}let J=R(new Uint8Array(W.buffer,W.byteOffset,W.byteLength),8);k[q]={values:J}}else if(Q==="BOOLEAN"){let W=Math.ceil(G/8),J=new Uint8Array(W);for(let ae=0;ae<G;ae++)m.get(ae)?.[q]&&(J[ae>>3]|=1<<(ae&7));let Z=R(J);k[q]={values:Z}}else{let W=new TextEncoder,J=[],Z=new Uint32Array(G+1),ae=0;for(let we=0;we<G;we++){Z[we]=ae;let Re=m.get(we)?.[q],Qe;Re==null?Qe="":typeof Re=="string"?Qe=Re:Qe=String(Re);let He=W.encode(Qe);J.push(He),ae+=He.byteLength}Z[G]=ae;let Ae=new Uint8Array(ae),fe=0;for(let we of J)Ae.set(we,fe),fe+=we.byteLength;let xe=R(Ae),ge=R(new Uint8Array(Z.buffer,Z.byteOffset,Z.byteLength));k[q]={values:xe,stringOffsets:ge,stringOffsetType:"UINT32"}}return{schema:{classes:{mvt_feature:{properties:j}}},propertyTables:[{class:"mvt_feature",count:G,properties:k}]}}let L=[],_=[],C=[u.x,u.y,u.z];for(let B of e.layers){let j=B.extent,k=[],G=[],q=[],Q=[],W=[],J=0,Z=[],ae=[],Ae=[],fe=[],xe=[],ge=[],we=[],ve=0;for(let He of B.features){let Ye=l(s)?H4t(He,s,g)??d:j4t(He,g);if(Ye!==d&&!m.has(Ye)){let Ke=Object.assign({},He.properties);Ke._layer=B.name??"",m.set(Ye,Ke)}if(He.type==="Point"){let Ke=He.geometry;for(let Pe of Ke)Yse(Pe,i,r,o,j,qse,u,k),G.push(Ye);continue}if(He.type==="LineString"){let Ke=He.geometry;for(let Pe of Ke){let qe=q.length/3;for(let st of Pe)Yse(st,i,r,o,j,qse,u,q),Q.push(Ye);for(let st=0;st<Pe.length;st++)W.push(qe+st);W.push(p),J++}continue}if(He.type==="Polygon"){let Ke=He.geometry,Pe=G4t(Ke);for(let qe of Pe){let st=[qe.outerRing,...qe.holes],vt=[],jt=[],lt=[],mt=0;for(let ht=0;ht<st.length;ht++){let Li=st[ht];ht>0&<.push(mt);for(let Yn of Li)vt.push(new U(Yn.x,Yn.y)),Yse(Yn,i,r,o,j,qse,u,jt),mt++}if(vt.length<3)continue;let ft=mi.triangulate(vt,lt.length>0?lt:void 0);if(!l(ft)||ft.length===0){yt("buildVectorGltfFromMVT-triangulation-failed","Polygon triangulation failed; skipping polygon.");continue}let Yt=Z.length/3,rt=Ae.length;fe.push(Yt),xe.push(rt),ge.push(lt.length);for(let ht=0;ht<lt.length;ht++)we.push(Yt+lt[ht]);for(let ht=0;ht<jt.length;ht++)Z.push(jt[ht]);for(let ht=0;ht<jt.length/3;ht++)ae.push(Ye);for(let ht=0;ht<ft.length;ht++)Ae.push(ft[ht]+Yt);ve++}}}if(k.length===0&&q.length===0&&Z.length===0)continue;W.length>0&&W[W.length-1]===p&&W.pop();let Re=[];if(k.length>0){let He=new Float32Array(k),Ye=S(He),Pe={POSITION:v(He,{type:"VEC3",componentType:Y.FLOAT,target:te.ARRAY_BUFFER,min:Ye.min,max:Ye.max})},qe={CESIUM_mesh_vector:{vector:!0,count:He.length/3}};I(Pe,qe,G),Re.push({mode:Oe.POINTS,attributes:Pe,extensions:qe})}if(q.length>0&&W.length>1){let He=new Float32Array(q),Ye=new Uint32Array(W),Ke=S(He),Pe=v(He,{type:"VEC3",componentType:Y.FLOAT,target:te.ARRAY_BUFFER,min:Ke.min,max:Ke.max}),qe=v(Ye,{type:"SCALAR",componentType:Y.UNSIGNED_INT,target:te.ELEMENT_ARRAY_BUFFER}),st={POSITION:Pe},vt={CESIUM_mesh_vector:{vector:!0,count:J}};I(st,vt,Q),Re.push({mode:Oe.LINE_STRIP,indices:qe,attributes:st,extensions:vt})}if(Z.length>0&&Ae.length>=3){let He=new Float32Array(Z),Ye=new Uint32Array(Ae),Ke=new Uint32Array(fe),Pe=new Uint32Array(xe),qe=we.length>0,st=qe?new Uint32Array(ge):void 0,vt=qe?new Uint32Array(we):void 0,jt=S(He),lt=v(He,{type:"VEC3",componentType:Y.FLOAT,target:te.ARRAY_BUFFER,min:jt.min,max:jt.max}),mt=v(Ye,{type:"SCALAR",componentType:Y.UNSIGNED_INT,target:te.ELEMENT_ARRAY_BUFFER}),ft=v(Ke,{type:"SCALAR",componentType:Y.UNSIGNED_INT,target:te.ARRAY_BUFFER}),Yt=v(Pe,{type:"SCALAR",componentType:Y.UNSIGNED_INT,target:te.ARRAY_BUFFER}),rt=l(st)?v(st,{type:"SCALAR",componentType:Y.UNSIGNED_INT,target:te.ARRAY_BUFFER}):void 0,ht=l(vt)?v(vt,{type:"SCALAR",componentType:Y.UNSIGNED_INT,target:te.ARRAY_BUFFER}):void 0,Li={POSITION:lt},Yn={CESIUM_mesh_vector:{vector:!0,count:ve,polygonAttributeOffsets:ft,polygonIndicesOffsets:Yt}};qe&&(Yn.CESIUM_mesh_vector.polygonHoleCounts=rt,Yn.CESIUM_mesh_vector.polygonHoleOffsets=ht),I(Li,Yn,ae),Re.push({mode:Oe.TRIANGLES,indices:mt,attributes:Li,extensions:Yn})}if(Re.length===0)continue;let Qe=L.length;L.push({primitives:Re}),_.push({name:B.name,mesh:Qe,translation:C})}if(_.length===0)return;let w=O(),D=X4t(b,x),N=["CESIUM_mesh_vector"];g.size>0&&N.push("EXT_mesh_features"),l(w)&&N.push("EXT_structural_metadata");let F=_.map((B,j)=>j),V={asset:{version:"2.0"},extensionsUsed:N,scene:0,scenes:[{nodes:F}],nodes:_,meshes:L,accessors:A,bufferViews:y,buffers:[{byteLength:D.byteLength}],extensions:void 0};return l(w)&&(V.extensions={EXT_structural_metadata:w}),Y4t(V,D)}function j4t(e,t){let n=t.get(e);return l(n)||(n=t.size,t.set(e,n)),n}function H4t(e,t,n){let i=e.properties;if(!l(i))return;let r=i[t];if(!l(r)||typeof r!="string"&&typeof r!="number"&&typeof r!="boolean"||typeof r=="number"&&!Number.isFinite(r))return;let o=`${typeof r}:${r}`,s=n.get(o);return l(s)||(s=n.size,n.set(o,s)),s}function G4t(e){let t=[];for(let n of e){let i=q4t(n);if(i.length<3)continue;W4t(i)<=0?t.push({outerRing:i,holes:[]}):t.length>0&&t[t.length-1].holes.push(i)}return t}function W4t(e){let t=0;for(let n=0,i=e.length-1;n<e.length;i=n++)t+=(e[i].x+e[n].x)*(e[i].y-e[n].y);return t/2}function q4t(e){return e.length>1&&e[0].x===e[e.length-1].x&&e[0].y===e[e.length-1].y?e.slice(0,e.length-1):e}function Yse(e,t,n,i,r,o,s,a){let c=1<<i,u=(t+e.x/r)/c,f=(n+e.y/r)/c,d=u*2*Math.PI-Math.PI,p=Math.atan(Math.sinh(Math.PI*(1-2*f)));h.fromRadians(d,p,o,void 0,aBe),h.subtract(aBe,s,d7),a.push(d7.x,d7.y,d7.z)}function Y4t(e,t){let s=new TextEncoder().encode(JSON.stringify(e)),a=Math.ceil(s.length/4)*4,c=new Uint8Array(a);c.fill(32),c.set(s);let u=Math.ceil(t.byteLength/4)*4,f=new Uint8Array(u);f.set(t);let d=20+a+8+u,p=new Uint8Array(d),g=new DataView(p.buffer),m=0;return g.setUint32(m,1179937895,!0),m+=4,g.setUint32(m,2,!0),m+=4,g.setUint32(m,d,!0),m+=4,g.setUint32(m,a,!0),m+=4,g.setUint32(m,1313821514,!0),m+=4,p.set(c,m),m+=a,g.setUint32(m,u,!0),m+=4,g.setUint32(m,5130562,!0),m+=4,p.set(f,m),p}function X4t(e,t){let n=new Uint8Array(t),i=0;for(let r of e)n.set(r,i),i+=r.byteLength;return n}var h7=V4t;var Xse=class{constructor(){ut(this,"featuresLength");ut(this,"pointsLength");ut(this,"trianglesLength");ut(this,"geometryByteLength");ut(this,"texturesByteLength");ut(this,"batchTableByteLength");ut(this,"innerContents");ut(this,"ready");ut(this,"tileset");ut(this,"tile");ut(this,"url");ut(this,"batchTable");ut(this,"metadata");ut(this,"group");this.featurePropertiesDirty=!1}hasProperty(t,n){pe.throwInstantiationError()}getFeature(t){pe.throwInstantiationError()}applyDebugSettings(t,n){pe.throwInstantiationError()}applyStyle(t){pe.throwInstantiationError()}update(t,n){pe.throwInstantiationError()}pick(t,n,i){pe.throwInstantiationError()}isDestroyed(){pe.throwInstantiationError()}destroy(){pe.throwInstantiationError()}},cBe=Xse;function OM(e){e=e??H.EMPTY_OBJECT,this._maximumSubtreeCount=e.maximumSubtreeCount??0,this._subtreeRequestCounter=0,this._queue=new SA({comparator:OM.comparator})}OM.prototype.addSubtree=function(e){let t=new K4t(e,this._subtreeRequestCounter);this._subtreeRequestCounter++,this._queue.insert(t);let n=e.implicitCoordinates;if(n.level>0){let i=n.getParentSubtreeCoordinates(),r=this.find(i)}if(this._maximumSubtreeCount>0)for(;this._queue.length>this._maximumSubtreeCount&&this._queue.getMinimum()!==t;)this._queue.removeMinimum()};OM.prototype.find=function(e){let t=this._queue,n=t.internalArray,i=t.length;for(let r=0;r<i;r++){let o=n[r],a=o.subtree.implicitCoordinates;if(e.isEqual(a))return o.subtree}};OM.comparator=function(e,t){let n=e.subtree.implicitCoordinates,i=t.subtree.implicitCoordinates;return n.isAncestor(i)?1:i.isAncestor(n)?-1:e.stamp-t.stamp};function K4t(e,t){this.subtree=e,this.stamp=t}var m7=OM;function MM(e){e=e??H.EMPTY_OBJECT;let{className:t,names:n,types:i,componentTypes:r,shape:o,dimensions:s,paddingBefore:a=h.ZERO.clone(),paddingAfter:c=h.ZERO.clone(),globalTransform:u=M.IDENTITY.clone(),shapeTransform:f=M.IDENTITY.clone(),minBounds:d,maxBounds:p,minimumValues:g,maximumValues:m,maximumTileCount:y}=e;this._shapeTransform=f,this._globalTransform=u,this._shape=o,this._minBounds=d,this._maxBounds=p,this._dimensions=s,this._paddingBefore=a,this._paddingAfter=c,this._className=t,this._names=n,this._types=i,this._componentTypes=r,this._metadataOrder=o===Ic.ELLIPSOID?Jg.Z_UP:Jg.Y_UP,this._minimumValues=g,this._maximumValues=m,this._maximumTileCount=y,this._availableLevels=void 0,this._implicitTileset=void 0,this._subtreeCache=new m7}Object.defineProperties(MM.prototype,{globalTransform:{get:function(){return this._globalTransform}},shapeTransform:{get:function(){return this._shapeTransform}},shape:{get:function(){return this._shape}},minBounds:{get:function(){return this._minBounds}},maxBounds:{get:function(){return this._maxBounds}},dimensions:{get:function(){return this._dimensions}},paddingBefore:{get:function(){return this._paddingBefore}},paddingAfter:{get:function(){return this._paddingAfter}},className:{get:function(){return this._className}},names:{get:function(){return this._names}},types:{get:function(){return this._types}},componentTypes:{get:function(){return this._componentTypes}},metadataOrder:{get:function(){return this._metadataOrder}},minimumValues:{get:function(){return this._minimumValues}},maximumValues:{get:function(){return this._maximumValues}},maximumTileCount:{get:function(){return this._maximumTileCount}},availableLevels:{get:function(){return this._availableLevels}}});MM.fromUrl=async function(e){let t=De.createIfNeeded(e),n=await t.fetchJson();J4t(n);let i=r8t(n,t);await i.load();let{root:r}=n,o=lr(n,"3DTILES_metadata")?n.extensions["3DTILES_metadata"]:n,s=new MS({metadataJson:o,schema:i.schema}),a=r.content.extensions["3DTILES_content_voxels"],c=a.class,u=o8t(s,c);Object.assign(u,Z4t(r)),l(r.transform)?u.globalTransform=M.unpack(r.transform):u.globalTransform=M.clone(M.IDENTITY),u.dimensions=h.unpack(a.dimensions),u.maximumTileCount=$4t(s),l(a.padding)&&(u.paddingBefore=h.unpack(a.padding.before),u.paddingAfter=h.unpack(a.padding.after));let f=new MM(u),d=new Og(t,r,i.schema);return f._implicitTileset=d,f._availableLevels=d.availableLevels,ki.unload(i),f};function $4t(e){if(l(e.tileset))return e.tileset.getPropertyBySemantic(Xh.TILESET_TILE_COUNT)}function J4t(e){let t=e.root;if(!l(t.content))throw new oe("Root must have content");if(!lr(t.content,"3DTILES_content_voxels"))throw new oe("Root tile content must have 3DTILES_content_voxels extension");if(!lr(t,"3DTILES_implicit_tiling")&&!l(t.implicitTiling))throw new oe("Root tile must have implicit tiling");if(!l(e.schema)&&!l(e.schemaUri)&&!lr(e,"3DTILES_metadata"))throw new oe("Tileset must have a metadata schema")}function Z4t(e){let t=e.boundingVolume;if(l(t.box))return n8t(t.box);if(l(t.region))return Q4t(t.region);if(lr(t,"3DTILES_bounding_volume_cylinder"))return i8t(t.extensions["3DTILES_bounding_volume_cylinder"]);throw new oe("Only box, region and 3DTILES_bounding_volume_cylinder are supported in Cesium3DTilesVoxelProvider")}function Q4t(e){let t=e[0],n=e[1],i=e[2],r=e[3],o=e[4],s=e[5],a=M.fromScale(ee.WGS84.radii),c=new h(t,n,o),u=new h(i,r,s);return{shape:Ic.ELLIPSOID,minBounds:c,maxBounds:u,shapeTransform:a}}var e8t=new h,t8t=new $;function n8t(e){let t=en.unpack(e),n=$.getScale(t.halfAxes,e8t),i=$.getRotation(t.halfAxes,t8t);return{shape:Ic.BOX,minBounds:h.negate(n,new h),maxBounds:h.clone(n),shapeTransform:M.fromRotationTranslation(i,t.center)}}function i8t(e){let{minRadius:t,maxRadius:n,height:i,minAngle:r=-P.PI,maxAngle:o=P.PI,translation:s=[0,0,0],rotation:a=[0,0,0,1]}=e,c=-.5*i+s[2],u=.5*i+s[2],f=M.fromTranslationQuaternionRotationScale(h.unpack(s),Le.unpack(a),h.ONE);return{shape:Ic.CYLINDER,minBounds:h.fromElements(t,r,c),maxBounds:h.fromElements(n,o,u),shapeTransform:f}}function r8t(e,t){let{schemaUri:n,schema:i}=e;return l(n)?ki.getSchemaLoader({resource:t.getDerivedResource({url:n})}):ki.getSchemaLoader({schema:i})}function o8t(e,t){let{schema:n,statistics:i}=e,r=i?.classes[t],o=n.classes[t].properties,s=Object.entries(o).map(([g,m])=>{let{type:y,componentType:A}=m,b=r?.properties[g].min,x=r?.properties[g].max,T=bt.getComponentCount(y),E=lBe(b,T),v=lBe(x,T);return{id:g,type:y,componentType:A,minValue:E,maxValue:v}}),a=s.map(g=>g.id),c=s.map(g=>g.type),u=s.map(g=>g.componentType),f=s.map(g=>g.minValue),d=s.map(g=>g.maxValue),p=f.some(l);return{className:t,names:a,types:c,componentTypes:u,minimumValues:p?f:void 0,maximumValues:p?d:void 0}}function lBe(e,t){if(!l(e))return;let n=Array.isArray(e)?e:[e];return Array.from({length:t},(i,r)=>n[r])}async function s8t(e,t){let n=e._implicitTileset,i=e._subtreeCache,r=i.find(t);if(l(r))return r;let o=n.subtreeUriTemplate.getDerivedResource({templateValues:t.getTemplateValues()}),s=n.baseResource.getDerivedResource({url:o.url}),a=await s.fetchArrayBuffer();if(r=i.find(t),l(r))return r;let c=Jy(a);return r=await Hy.fromSubtreeJson(s,c.jsonPayload,c.binaryPayload,n,t),i.addSubtree(r),r}MM.prototype.requestData=async function(e){e=e??H.EMPTY_OBJECT;let{tileLevel:t=0,tileX:n=0,tileY:i=0,tileZ:r=0,keyframe:o=0}=e;if(o!==0)return Promise.reject("3D Tiles currently doesn't support time-dynamic data.");let s=this._implicitTileset,a=new Mg({subdivisionScheme:s.subdivisionScheme,subtreeLevels:s.subtreeLevels,level:t,x:n,y:i,z:r}),c=a.isSubtreeRoot()&&a.level>0,u=c?a.getParentSubtreeCoordinates():a.getSubtreeCoordinates(),d=await s8t(this,u);if(!(c?d.childSubtreeIsAvailableAtCoordinates:d.tileIsAvailableAtCoordinates).call(d,a))return Promise.reject(`Tile is not available at level ${t}, x ${n}, y ${i}, z ${r}.`);let{contentUriTemplates:m,baseResource:y}=s,A=m[0].getDerivedResource({templateValues:a.getTemplateValues()}),b=y.getDerivedResource({url:A.url});return uw.fromGltf(b)};var uBe=MM;function Kse(e){e=e??1,this._radius=e??1}Object.defineProperties(Kse.prototype,{radius:{get:function(){return this._radius},set:function(e){this._radius=e}}});Kse.prototype.emit=function(e){let t=P.randomBetween(0,P.TWO_PI),n=P.randomBetween(0,this._radius),i=n*Math.cos(t),r=n*Math.sin(t),o=0;e.position=h.fromElements(i,r,o,e.position),e.velocity=h.clone(h.UNIT_Z,e.velocity)};var p7=Kse;var g7={CUMULUS:0};g7.validate=function(e){return e===g7.CUMULUS};Object.freeze(g7);var NM=g7;function Sm(e,t){if(e=e??H.EMPTY_OBJECT,this._show=e.show??!0,this._position=h.clone(e.position??h.ZERO),!l(e.scale)&&l(e.maximumSize))this._maximumSize=h.clone(e.maximumSize),this._scale=new U(this._maximumSize.x,this._maximumSize.y);else{this._scale=U.clone(e.scale??new U(20,12));let n=new h(this._scale.x,this._scale.y,Math.min(this._scale.x,this._scale.y)/1.5);this._maximumSize=h.clone(e.maximumSize??n)}this._slice=e.slice??-1,this._color=z.clone(e.color??z.WHITE),this._brightness=e.brightness??1,this._cloudCollection=t,this._index=-1}var a8t=Sm.SHOW_INDEX=0,c8t=Sm.POSITION_INDEX=1,l8t=Sm.SCALE_INDEX=2,u8t=Sm.MAXIMUM_SIZE_INDEX=3,f8t=Sm.SLICE_INDEX=4,d8t=Sm.BRIGHTNESS_INDEX=5,h8t=Sm.COLOR_INDEX=6;Sm.NUMBER_OF_PROPERTIES=7;function oE(e,t){let n=e._cloudCollection;l(n)&&(n._updateCloud(e,t),e._dirty=!0)}Object.defineProperties(Sm.prototype,{show:{get:function(){return this._show},set:function(e){this._show!==e&&(this._show=e,oE(this,a8t))}},position:{get:function(){return this._position},set:function(e){let t=this._position;h.equals(t,e)||(h.clone(e,t),oE(this,c8t))}},scale:{get:function(){return this._scale},set:function(e){let t=this._scale;U.equals(t,e)||(U.clone(e,t),oE(this,l8t))}},maximumSize:{get:function(){return this._maximumSize},set:function(e){let t=this._maximumSize;h.equals(t,e)||(h.clone(e,t),oE(this,u8t))}},color:{get:function(){return this._color},set:function(e){let t=this._color;z.equals(t,e)||(z.clone(e,t),oE(this,h8t))}},slice:{get:function(){return this._slice},set:function(e){this._slice!==e&&(this._slice=e,oE(this,f8t))}},brightness:{get:function(){return this._brightness},set:function(e){this._brightness!==e&&(this._brightness=e,oE(this,d8t))}}});Sm.prototype._destroy=function(){this._cloudCollection=void 0};var oh=Sm;var Gf,_7=new h,m8t={positionHighAndScaleX:0,positionLowAndScaleY:1,packedAttribute0:2,packedAttribute1:3,color:4},p8t={direction:0,positionHighAndScaleX:1,positionLowAndScaleY:2,packedAttribute0:3,packedAttribute1:4,color:5},g8t=oh.SHOW_INDEX,_8t=oh.POSITION_INDEX,y8t=oh.SCALE_INDEX,A8t=oh.MAXIMUM_SIZE_INDEX,b8t=oh.SLICE_INDEX,x8t=oh.BRIGHTNESS_INDEX,T8t=oh.NUMBER_OF_PROPERTIES,E8t=oh.COLOR_INDEX;function wm(e){e=e??H.EMPTY_OBJECT,this._clouds=[],this._cloudsToUpdate=[],this._cloudsToUpdateIndex=0,this._cloudsRemoved=!1,this._createVertexArray=!1,this._propertiesChanged=new Uint32Array(T8t),this._noiseTexture=void 0,this._textureSliceWidth=128,this._noiseTextureRows=4,this.noiseDetail=e.noiseDetail??16,this.noiseOffset=h.clone(e.noiseOffset??h.ZERO),this._loading=!1,this._ready=!1;let t=this;this._uniforms={u_noiseTexture:function(){return t._noiseTexture},u_noiseTextureDimensions:fBe(t),u_noiseDetail:function(){return t.noiseDetail}},this._vaNoise=void 0,this._spNoise=void 0,this._spCreated=!1,this._sp=void 0,this._rs=void 0,this.show=e.show??!0,this._colorCommands=[],this.debugBillboards=e.debugBillboards??!1,this._compiledDebugBillboards=!1,this.debugEllipsoids=e.debugEllipsoids??!1,this._compiledDebugEllipsoids=!1}function fBe(e){return function(){return _7.x=e._textureSliceWidth,_7.y=e._noiseTextureRows,_7.z=1/e._noiseTextureRows,_7}}Object.defineProperties(wm.prototype,{length:{get:function(){return Jse(this),this._clouds.length}}});function dBe(e){let t=e.length;for(let n=0;n<t;++n)e[n]&&e[n]._destroy()}wm.prototype.add=function(e){e=e??H.EMPTY_OBJECT;let t=e.cloudType??NM.CUMULUS,n;return t===NM.CUMULUS&&(n=new oh(e,this),n._index=this._clouds.length,this._clouds.push(n),this._createVertexArray=!0),n};wm.prototype.remove=function(e){return this.contains(e)?(this._clouds[e._index]=void 0,this._cloudsRemoved=!0,this._createVertexArray=!0,e._destroy(),!0):!1};wm.prototype.removeAll=function(){dBe(this._clouds),this._clouds=[],this._cloudsToUpdate=[],this._cloudsToUpdateIndex=0,this._cloudsRemoved=!1,this._createVertexArray=!0};function Jse(e){if(e._cloudsRemoved){e._cloudsRemoved=!1;let t=[],n=e._clouds,i=n.length;for(let r=0,o=0;r<i;++r){let s=n[r];l(s)&&(n._index=o++,t.push(s))}e._clouds=t}}wm.prototype._updateCloud=function(e,t){e._dirty||(this._cloudsToUpdate[this._cloudsToUpdateIndex++]=e),++this._propertiesChanged[t]};wm.prototype.contains=function(e){return l(e)&&e._cloudCollection===this};wm.prototype.get=function(e){return Jse(this),this._clouds[e]};var C8t=new Float32Array([-1,-1,1,-1,1,1,-1,1]),v8t=new Uint16Array([0,1,2,0,2,3]);function S8t(e){let t=tt.createVertexBuffer({context:e,typedArray:C8t,usage:Me.STATIC_DRAW}),n=tt.createIndexBuffer({context:e,typedArray:v8t,usage:Me.STATIC_DRAW,indexDatatype:je.UNSIGNED_SHORT}),i=[{index:0,vertexBuffer:t,componentsPerAttribute:2,componentDatatype:Y.FLOAT}];return new Vn({context:e,attributes:i,indexBuffer:n})}var Zse;function w8t(e){let n=e.cache.cloudCollection_indexBufferBatched;if(l(n))return n;let i=16384*6-6,r=new Uint16Array(i);for(let o=0,s=0;o<i;o+=6,s+=4)r[o]=s,r[o+1]=s+1,r[o+2]=s+2,r[o+3]=s,r[o+4]=s+2,r[o+5]=s+3;return n=tt.createIndexBuffer({context:e,typedArray:r,usage:Me.STATIC_DRAW,indexDatatype:je.UNSIGNED_SHORT}),n.vertexArrayDestroyable=!1,e.cache.cloudCollection_indexBufferBatched=n,n}function I8t(e){let t=e.cache.cloudCollection_indexBufferInstanced;return l(t)||(t=tt.createIndexBuffer({context:e,typedArray:new Uint16Array([0,1,2,0,2,3]),usage:Me.STATIC_DRAW,indexDatatype:je.UNSIGNED_SHORT}),t.vertexArrayDestroyable=!1,e.cache.cloudCollection_indexBufferInstanced=t),t}function P8t(e){let t=e.cache.cloudCollection_vertexBufferInstanced;return l(t)||(t=tt.createVertexBuffer({context:e,typedArray:new Float32Array([0,0,1,0,1,1,0,1]),usage:Me.STATIC_DRAW}),t.vertexArrayDestroyable=!1,e.cache.cloudCollection_vertexBufferInstanced=t),t}function D8t(e,t,n){let i=[{index:Gf.positionHighAndScaleX,componentsPerAttribute:4,componentDatatype:Y.FLOAT,usage:Me.STATIC_DRAW},{index:Gf.positionLowAndScaleY,componentsPerAttribute:4,componentDatatype:Y.FLOAT,usage:Me.STATIC_DRAW},{index:Gf.packedAttribute0,componentsPerAttribute:4,componentDatatype:Y.FLOAT,usage:Me.STATIC_DRAW},{index:Gf.packedAttribute1,componentsPerAttribute:4,componentDatatype:Y.FLOAT,usage:Me.STATIC_DRAW},{index:Gf.color,componentsPerAttribute:4,componentDatatype:Y.UNSIGNED_BYTE,normalize:!0,usage:Me.STATIC_DRAW}];n&&i.push({index:Gf.direction,componentsPerAttribute:2,componentDatatype:Y.FLOAT,vertexBuffer:P8t(e)});let r=n?t:4*t;return new k_(e,i,r,n)}var $se=new Sn;function hBe(e,t,n,i){let r,o=n[Gf.positionHighAndScaleX],s=n[Gf.positionLowAndScaleY],a=i.position;Sn.fromCartesian(a,$se);let c=i.scale,u=$se.high,f=$se.low;e._instanced?(r=i._index,o(r,u.x,u.y,u.z,c.x),s(r,f.x,f.y,f.z,c.y)):(r=i._index*4,o(r+0,u.x,u.y,u.z,c.x),o(r+1,u.x,u.y,u.z,c.x),o(r+2,u.x,u.y,u.z,c.x),o(r+3,u.x,u.y,u.z,c.x),s(r+0,f.x,f.y,f.z,c.y),s(r+1,f.x,f.y,f.z,c.y),s(r+2,f.x,f.y,f.z,c.y),s(r+3,f.x,f.y,f.z,c.y))}function mBe(e,t,n,i){let r,o=n[Gf.packedAttribute0],s=i.show,a=i.brightness;e._instanced?(r=i._index,o(r,s,a,0,0)):(r=i._index*4,o(r+0,s,a,0,0),o(r+1,s,a,1,0),o(r+2,s,a,1,1),o(r+3,s,a,0,1))}function pBe(e,t,n,i){let r,o=n[Gf.packedAttribute1],s=i.maximumSize,a=i.slice;e._instanced?(r=i._index,o(r,s.x,s.y,s.z,a)):(r=i._index*4,o(r+0,s.x,s.y,s.z,a),o(r+1,s.x,s.y,s.z,a),o(r+2,s.x,s.y,s.z,a),o(r+3,s.x,s.y,s.z,a))}function gBe(e,t,n,i){let r,o=n[Gf.color],s=i.color,a=z.floatToByte(s.red),c=z.floatToByte(s.green),u=z.floatToByte(s.blue),f=z.floatToByte(s.alpha);e._instanced?(r=i._index,o(r,a,c,u,f)):(r=i._index*4,o(r+0,a,c,u,f),o(r+1,a,c,u,f),o(r+2,a,c,u,f),o(r+3,a,c,u,f))}function R8t(e,t,n,i){hBe(e,t,n,i),mBe(e,t,n,i),pBe(e,t,n,i),gBe(e,t,n,i)}function O8t(e,t,n,i){let r=e,o=r._textureSliceWidth,s=r._noiseTextureRows,a=t.context;r._vaNoise=S8t(a),r._spNoise=Qt.fromCache({context:a,vertexShaderSource:n,fragmentShaderSource:i,attributeLocations:{position:0}});let c=r.noiseDetail,u=r.noiseOffset;r._noiseTexture=new Dt({context:a,width:o*o/s,height:o*s,pixelDatatype:ze.UNSIGNED_BYTE,pixelFormat:$e.RGBA,sampler:new Ht({wrapS:hn.REPEAT,wrapT:hn.REPEAT,minificationFilter:Wt.NEAREST,magnificationFilter:Jn.NEAREST})});let f=new $f({vertexArray:r._vaNoise,shaderProgram:r._spNoise,outputTexture:r._noiseTexture,uniformMap:{u_noiseTextureDimensions:fBe(r),u_noiseDetail:function(){return c},u_noiseOffset:function(){return u}},persists:!1,owner:e,postExecute:function(d){r._ready=!0,r._loading=!1}});t.commandList.push(f),r._loading=!0}function M8t(e,t){let n=e,i=t.context;n._createVertexArray=!1,n._vaf=n._vaf&&n._vaf.destroy();let r=e._clouds,o=r.length;if(o>0){n._vaf=D8t(i,o,n._instanced);let s=n._vaf.writers,a;for(a=0;a<o;++a){let c=r[a];R8t(e,t,s,c)}n._vaf.commit(Zse(i))}}var N8t=[];function L8t(e,t){let n=t.context,i=e,o=i._clouds.length,s=i._cloudsToUpdate,a=i._cloudsToUpdateIndex,c=i._propertiesChanged,u=N8t;u.length=0,(c[_8t]||c[y8t])&&u.push(hBe),(c[g8t]||c[x8t])&&u.push(mBe),(c[A8t]||c[b8t])&&u.push(pBe),c[E8t]&&u.push(gBe);let f=u.length,d=i._vaf.writers,p,g,m;if(a/o>.1){for(p=0;p<a;++p)for(g=s[p],g._dirty=!1,m=0;m<f;++m)u[m](e,t,d,g);i._vaf.commit(Zse(n))}else{for(p=0;p<a;++p){for(g=s[p],g._dirty=!1,m=0;m<f;++m)u[m](e,t,d,g);i._instanced?i._vaf.subCommit(g._index,1):i._vaf.subCommit(g._index*4,4)}i._vaf.endSubCommits()}i._cloudsToUpdateIndex=0}function F8t(e,t,n,i){let r=t.context,o=e,s=new Xe({defines:[],sources:[n]});o._instanced&&s.defines.push("INSTANCED");let a=new Xe({defines:[],sources:[i]});o.debugBillboards&&a.defines.push("DEBUG_BILLBOARDS"),o.debugEllipsoids&&a.defines.push("DEBUG_ELLIPSOIDS"),o._sp=Qt.replaceCache({context:r,shaderProgram:o._sp,vertexShaderSource:s,fragmentShaderSource:a,attributeLocations:Gf}),o._rs=Ge.fromCache({depthTest:{enabled:!0,func:te.LESS},depthMask:!1,blending:nn.ALPHA_BLEND}),o._spCreated=!0,o._compiledDebugBillboards=o.debugBillboards,o._compiledDebugEllipsoids=o.debugEllipsoids}function B8t(e,t){let n=e,i=t.passes,r=n._uniforms,o=t.commandList;if(i.render){let s=n._colorCommands,a=n._vaf.va,c=a.length;s.length=c;for(let u=0;u<c;u++){let f=s[u];l(f)||(f=s[u]=new at),f.pass=Ie.TRANSLUCENT,f.owner=e,f.uniformMap=r,f.count=a[u].indicesCount,f.vertexArray=a[u].va,f.shaderProgram=n._sp,f.renderState=n._rs,n._instanced&&(f.count=6,f.instanceCount=n._clouds.length),o.push(f)}}}wm.prototype.update=function(e){if(Jse(this),!this.show)return;let t=this.debugBillboards||this.debugEllipsoids;this._ready=t?!0:l(this._noiseTexture),!this._ready&&!this._loading&&!t&&O8t(this,e,v2,C2),this._instanced=e.context.instancedArrays,Gf=this._instanced?p8t:m8t,Zse=this._instanced?I8t:w8t;let i=this._clouds.length,r=this._cloudsToUpdate,o=this._cloudsToUpdateIndex;this._createVertexArray?M8t(this,e):o>0&&L8t(this,e),o>i*1.5&&(r.length=i),!(!l(this._vaf)||!l(this._vaf.va)||!this._ready&!t)&&((!this._spCreated||this.debugBillboards!==this._compiledDebugBillboards||this.debugEllipsoids!==this._compiledDebugEllipsoids)&&F8t(this,e,E2,T2),B8t(this,e))};wm.prototype.isDestroyed=function(){return!1};wm.prototype.destroy=function(){return this._noiseTexture=this._noiseTexture&&this._noiseTexture.destroy(),this._sp=this._sp&&this._sp.destroy(),this._vaf=this._vaf&&this._vaf.destroy(),dBe(this._clouds),le(this)};var _Be=wm;var k8t=P.toRadians(30);function Qse(e){this._angle=e??k8t}Object.defineProperties(Qse.prototype,{angle:{get:function(){return this._angle},set:function(e){this._angle=e}}});Qse.prototype.emit=function(e){let t=Math.tan(this._angle),n=P.randomBetween(0,P.TWO_PI),i=P.randomBetween(0,t),r=i*Math.cos(n),o=i*Math.sin(n),s=1;e.velocity=h.fromElements(r,o,s,e.velocity),h.normalize(e.velocity,e.velocity),e.position=h.clone(h.ZERO,e.position)};var yBe=Qse;var U8t=new z,z8t=new z,V8t=new z,j8t=new z,ABe=new se,LM=new Uint8Array(4);function bBe(e,t,n,i){let r=t.height===n.height?0:(e-t.height)/(n.height-t.height);return z.lerp(t.color,n.color,r,i)}function y7(e,t){return{height:e,color:z.clone(t)}}function xBe(e){return e=e.filter(function(t,n,i){let r=n>0,o=n<i.length-1,s=r?t.height===i[n-1].height:!0,a=o?t.height===i[n+1].height:!0;return!s||!a}),e=e.filter(function(t,n,i){let r=n>0,o=n<i.length-1,s=r?z.equals(t.color,i[n-1].color):!1,a=o?z.equals(t.color,i[n+1].color):!1;return!s||!a}),e=e.filter(function(t,n,i){let r=n>0,o=r?z.equals(t.color,i[n-1].color):!1,s=r?t.height===i[n-1].height:!0;return!o||!s}),e}function H8t(e){let t,n,i=[],r=e.length;for(t=0;t<r;t++){let o=e[t],s=o.entries,a=s.length,c=[];for(n=0;n<a;n++){let g=s[n],m=P.clamp(g.height,Ku._minimumHeight,Ku._maximumHeight),y=z.clone(g.color,U8t);y.red*=y.alpha,y.green*=y.alpha,y.blue*=y.alpha,c.push(y7(m,y))}let u=!0,f=!0;for(n=0;n<a-1;n++){let g=c[n+0],m=c[n+1];u=u&&g.height<=m.height,f=f&&g.height>=m.height}f?c=c.reverse():u||Vg(c,function(g,m){return P.sign(g.height-m.height)});let d=o.extendDownwards??!1,p=o.extendUpwards??!1;c.length===1&&!d&&!p&&(d=!0,p=!0),d&&c.splice(0,0,y7(Ku._minimumHeight,c[0].color)),p&&c.splice(c.length,0,y7(Ku._maximumHeight,c[c.length-1].color)),c=xBe(c),i.push(c)}return i}function G8t(e){let t=H8t(e),n=[],i,r;function o(u,f){n.push(y7(u,f))}function s(u,f,d){let p=z.multiplyByScalar(d,1-f.alpha,j8t);p=z.add(p,f,p),o(u,p)}let a=t.length;for(r=0;r<a;r++){let u=t[r],f=0,d=0;i=n,n=[];let p=u.length,g=i.length;for(;f<p||d<g;){let m=f<p?u[f]:void 0,y=f>0?u[f-1]:void 0,A=f<p-1?u[f+1]:void 0,b=d<g?i[d]:void 0,x=d>0?i[d-1]:void 0,T=d<g-1?i[d+1]:void 0;if(l(m)&&l(b)&&m.height===b.height){let E=l(T)&&b.height===T.height,v=!l(x),S=!l(T),I=l(A)&&m.height===A.height,R=!l(y),O=!l(A);E?I?(s(m.height,m.color,b.color),s(m.height,A.color,T.color)):R?(o(m.height,b.color),s(m.height,m.color,T.color)):O?(s(m.height,m.color,b.color),o(m.height,T.color)):(s(m.height,m.color,b.color),s(m.height,m.color,T.color)):v?I?(o(m.height,m.color),s(m.height,A.color,b.color)):O?(o(m.height,m.color),o(m.height,b.color)):(R||o(m.height,m.color),s(m.height,m.color,b.color)):S?I?(s(m.height,m.color,b.color),o(m.height,A.color)):R?(o(m.height,b.color),o(m.height,m.color)):O?s(m.height,m.color,b.color):(s(m.height,m.color,b.color),o(m.height,m.color)):I?(s(m.height,m.color,b.color),s(m.height,A.color,b.color)):R?(o(m.height,b.color),s(m.height,m.color,b.color)):O?(s(m.height,m.color,b.color),o(m.height,b.color)):s(m.height,m.color,b.color),f+=I?2:1,d+=E?2:1}else if(l(m)&&l(b)&&l(x)&&m.height<b.height){let E=bBe(m.height,x,b,V8t);l(y)?l(A)?s(m.height,m.color,E):(s(m.height,m.color,E),o(m.height,E)):(o(m.height,E),s(m.height,m.color,E)),f++}else if(l(b)&&l(m)&&l(y)&&b.height<m.height){let E=bBe(b.height,y,m,z8t);l(x)?l(T)?s(b.height,E,b.color):(s(b.height,E,b.color),o(b.height,E)):(o(b.height,E),s(b.height,E,b.color)),d++}else l(m)&&(!l(b)||m.height<b.height)?(l(b)&&!l(x)&&!l(A)?(o(m.height,m.color),o(m.height,Ku._emptyColor),o(b.height,Ku._emptyColor)):(!l(b)&&l(x)&&!l(y)&&(o(x.height,Ku._emptyColor),o(m.height,Ku._emptyColor)),o(m.height,m.color)),f++):l(b)&&(!l(m)||b.height<m.height)&&(o(b.height,b.color),d++)}}return xBe(n)}function Ku(e){let{scene:t,layers:n}=e??H.EMPTY_OBJECT,{context:i}=t,r=G8t(n),o=r.length,s,a,c;if(!Ku._useFloatTexture(i)){a=ze.UNSIGNED_BYTE,c=$e.RGBA,s=new Uint8Array(o*4);for(let g=0;g<o;g++)se.packFloat(r[g].height,ABe),se.pack(ABe,s,g*4)}else{a=ze.FLOAT,c=i.webgl2?$e.RED:$e.LUMINANCE,s=new Float32Array(o);for(let g=0;g<o;g++)s[g]=r[g].height}let f=Dt.create({context:i,pixelFormat:c,pixelDatatype:a,source:{arrayBufferView:s,width:o,height:1},sampler:new Ht({wrapS:hn.CLAMP_TO_EDGE,wrapT:hn.CLAMP_TO_EDGE,minificationFilter:Wt.NEAREST,magnificationFilter:Jn.NEAREST})}),d=new Uint8Array(o*4);for(let g=0;g<o;g++)r[g].color.toBytes(LM),d[g*4+0]=LM[0],d[g*4+1]=LM[1],d[g*4+2]=LM[2],d[g*4+3]=LM[3];let p=Dt.create({context:i,pixelFormat:$e.RGBA,pixelDatatype:ze.UNSIGNED_BYTE,source:{arrayBufferView:d,width:o,height:1},sampler:new Ht({wrapS:hn.CLAMP_TO_EDGE,wrapT:hn.CLAMP_TO_EDGE,minificationFilter:Wt.LINEAR,magnificationFilter:Jn.LINEAR})});return rr.fromType("ElevationBand",{heights:f,colors:p})}Ku._useFloatTexture=function(e){return e.floatingPointTexture};Ku._maximumHeight=5906376425472;Ku._minimumHeight=-5906376425472;Ku._emptyColor=new z(0,0,0,0);var TBe=Ku;async function W8t(e,t){t=t??{},t.cacheBytes=t.cacheBytes??1536*1024*1024,t.maximumCacheOverflowBytes=t.maximumCacheOverflowBytes??1024*1024*1024,t.enableCollision=t.enableCollision??!0,e=e??H.EMPTY_OBJECT,e.onlyUsingWithGoogleGeocoder||yt("google-tiles-with-google-geocoder","Only the Google geocoder can be used with Google Photorealistic 3D Tiles. Set the `geocode` property of Viewer constructor options. You can set additionalOptions.onlyUsingWithGoogleGeocoder to hide this warning once you have configured the geocoder.");let n=e.key??Ba.defaultApiKey;if(!l(n))return q8t(t);let i,r=Ba.getDefaultCredit();l(r)&&(i=[r]);let o=new De({url:`${Ba.mapTilesApiEndpoint}v1/3dtiles/root.json`,queryParameters:{key:n},credits:i});return ts.fromUrl(o,t)}var EBe={};async function q8t(e){let i=EBe[2275207];l(i)||(i=es.fromAssetId(2275207),EBe[2275207]=i);let r=await i;return ts.fromUrl(r,e)}var CBe=W8t;async function Y8t(e){let t=await ts.fromIonAssetId(96188,e);e=e??H.EMPTY_OBJECT;let n=e.style;if(!l(n)){let i=(e.defaultColor??z.WHITE).toCssColorString();n=new Ky({color:`Boolean(\${feature['cesium#color']}) ? color(\${feature['cesium#color']}) : ${i}`})}return t.style=n,t}var vBe=Y8t;function X8t(e){e=e??H.EMPTY_OBJECT;let t=[],n=e.geometry;(!l(n.attributes)||!l(n.primitiveType))&&(n=n.constructor.createGeometry(n));let i=n.attributes,r=M.clone(e.modelMatrix??M.IDENTITY),o=e.length??1e4;if(l(i.normal)&&t.push(new Bt({geometry:Wn.createLineSegmentsForVectors(n,"normal",o),attributes:{color:new Jt(1,0,0,1)},modelMatrix:r})),l(i.tangent)&&t.push(new Bt({geometry:Wn.createLineSegmentsForVectors(n,"tangent",o),attributes:{color:new Jt(0,1,0,1)},modelMatrix:r})),l(i.bitangent)&&t.push(new Bt({geometry:Wn.createLineSegmentsForVectors(n,"bitangent",o),attributes:{color:new Jt(0,0,1,1)},modelMatrix:r})),t.length>0)return new Mn({asynchronous:!1,geometryInstances:t,appearance:new An({flat:!0,translucent:!1})})}var SBe=X8t;function FM(e){e=e??H.EMPTY_OBJECT;let t=e.attributeName,n=e.perInstanceAttribute;l(n)||(n=!1);let i=e.glslDatatype??"vec3",r=`v_${t}`,o;if(t==="normal"||t==="tangent"||t==="bitangent")o=`vec4 getColor() { return vec4((${r} + vec3(1.0)) * 0.5, 1.0); } +`;else switch(t==="st"&&(i="vec2"),i){case"float":o=`vec4 getColor() { return vec4(vec3(${r}), 1.0); } +`;break;case"vec2":o=`vec4 getColor() { return vec4(${r}, 0.0, 1.0); } +`;break;case"vec3":o=`vec4 getColor() { return vec4(${r}, 1.0); } +`;break;case"vec4":o=`vec4 getColor() { return ${r}; } +`;break}let s=`in vec3 position3DHigh; +in vec3 position3DLow; +in float batchId; +${n?"":`in ${i} ${t}; +`}out ${i} ${r}; +void main() +{ +vec4 p = czm_translateRelativeToEye(position3DHigh, position3DLow); +${n?`${r} = czm_batchTable_${t}(batchId); +`:`${r} = ${t}; +`}gl_Position = czm_modelViewProjectionRelativeToEye * p; +}`,a=`in ${i} ${r}; +${o} +void main() +{ +out_FragColor = getColor(); +}`;this.material=void 0,this.translucent=e.translucent??!1,this._vertexShaderSource=e.vertexShaderSource??s,this._fragmentShaderSource=e.fragmentShaderSource??a,this._renderState=Rr.getDefaultRenderState(!1,!1,e.renderState),this._closed=e.closed??!1,this._attributeName=t,this._glslDatatype=i}Object.defineProperties(FM.prototype,{vertexShaderSource:{get:function(){return this._vertexShaderSource}},fragmentShaderSource:{get:function(){return this._fragmentShaderSource}},renderState:{get:function(){return this._renderState}},closed:{get:function(){return this._closed}},attributeName:{get:function(){return this._attributeName}},glslDatatype:{get:function(){return this._glslDatatype}}});FM.prototype.getFragmentShaderSource=Rr.prototype.getFragmentShaderSource;FM.prototype.isTranslucent=Rr.prototype.isTranslucent;FM.prototype.getRenderState=Rr.prototype.getRenderState;var wBe=FM;function A7(e){e=e??H.EMPTY_OBJECT,this.length=e.length??1e7,this._length=void 0,this.width=e.width??2,this._width=void 0,this.show=e.show??!0,this.modelMatrix=M.clone(e.modelMatrix??M.IDENTITY),this._modelMatrix=new M,this.id=e.id,this._id=void 0,this._primitive=void 0}A7.prototype.update=function(e){if(this.show){if(!l(this._primitive)||!M.equals(this._modelMatrix,this.modelMatrix)||this._length!==this.length||this._width!==this.width||this._id!==this.id){this._modelMatrix=M.clone(this.modelMatrix,this._modelMatrix),this._length=this.length,this._width=this.width,this._id=this.id,l(this._primitive)&&this._primitive.destroy(),this.modelMatrix[12]===0&&this.modelMatrix[13]===0&&this.modelMatrix[14]===0&&(this.modelMatrix[14]=.01);let t=new Bt({geometry:new uA({positions:[h.ZERO,h.UNIT_X],width:this.width,vertexFormat:qs.VERTEX_FORMAT,colors:[z.RED,z.RED],arcType:ln.NONE}),modelMatrix:M.multiplyByUniformScale(this.modelMatrix,this.length,new M),id:this.id,pickPrimitive:this}),n=new Bt({geometry:new uA({positions:[h.ZERO,h.UNIT_Y],width:this.width,vertexFormat:qs.VERTEX_FORMAT,colors:[z.GREEN,z.GREEN],arcType:ln.NONE}),modelMatrix:M.multiplyByUniformScale(this.modelMatrix,this.length,new M),id:this.id,pickPrimitive:this}),i=new Bt({geometry:new uA({positions:[h.ZERO,h.UNIT_Z],width:this.width,vertexFormat:qs.VERTEX_FORMAT,colors:[z.BLUE,z.BLUE],arcType:ln.NONE}),modelMatrix:M.multiplyByUniformScale(this.modelMatrix,this.length,new M),id:this.id,pickPrimitive:this});this._primitive=new Mn({geometryInstances:[t,n,i],appearance:new qs,asynchronous:!1})}this._primitive.update(e)}};A7.prototype.isDestroyed=function(){return!1};A7.prototype.destroy=function(){return this._primitive=this._primitive&&this._primitive.destroy(),le(this)};var b7=A7;var K8t=new TextDecoder,x7={UNKNOWN:0,POINT:1,LINESTRING:2,POLYGON:3},$8t={LAYERS:3},BM={NAME:1,FEATURES:2,KEYS:3,VALUES:4,EXTENT:5},eae={TAGS:2,TYPE:3,GEOMETRY:4},sE={STRING:1,FLOAT:2,DOUBLE:3,INT64:4,UINT64:5,SINT64:6,BOOL:7},J8t=["Unknown","Point","LineString","Polygon"];function Z8t(e){let t=new Uint8Array(e),n=[],i=0;for(;i<t.length;){let r=T7(t,i,t.length),o=r.fieldNumber,s=r.wireType;if(i=r.newPos,o===$8t.LAYERS&&s===2){let a=g_(t,i,t.length);i=a.newPos;let c=$u(i,a.value,t.length,"layer");n.push(Q8t(t,i,c)),i=c}else i=E7(t,i,s,t.length)}return{layers:n}}function Q8t(e,t,n){let i=t,r="",o=4096,s=[],a=[],c=[];for(;i<n;){let f=T7(e,i,n),d=f.fieldNumber,p=f.wireType;if(i=f.newPos,d===BM.NAME&&p===2){let g=g_(e,i,n);i=g.newPos;let m=$u(i,g.value,n,"layer name");r=nae(e,i,g.value),i=m}else if(d===BM.FEATURES&&p===2){let g=g_(e,i,n);i=g.newPos;let m=$u(i,g.value,n,"feature");c.push({start:i,end:m}),i=m}else if(d===BM.KEYS&&p===2){let g=g_(e,i,n);i=g.newPos;let m=$u(i,g.value,n,"key");s.push(nae(e,i,g.value)),i=m}else if(d===BM.VALUES&&p===2){let g=g_(e,i,n);i=g.newPos;let m=$u(i,g.value,n,"value"),y=njt(e,i,m);a.push(y),i=m}else if(d===BM.EXTENT&&p===0){let g=EI(e,i,n);o=g.value,i=g.newPos}else i=E7(e,i,p,n)}let u=c.map(({start:f,end:d})=>ejt(e,f,d,s,a));return{name:r,extent:o,features:u}}function ejt(e,t,n,i,r){let o=t,s=x7.UNKNOWN,a=[],c=[];for(;o<n;){let d=T7(e,o,n),p=d.fieldNumber,g=d.wireType;if(o=d.newPos,p===eae.TYPE&&g===0){let m=EI(e,o,n);s=m.value,o=m.newPos}else if(p===eae.TAGS&&g===2){let m=g_(e,o,n);o=m.newPos;let y=$u(o,m.value,n,"feature tags");for(;o<y;){let A=EI(e,o,y);a.push(A.value),o=A.newPos}}else if(p===eae.GEOMETRY&&g===2){let m=g_(e,o,n);o=m.newPos;let y=$u(o,m.value,n,"feature geometry");for(;o<y;){let A=EI(e,o,y);c.push(A.value),o=A.newPos}}else o=E7(e,o,g,n)}let u={};for(let d=0;d<a.length-1;d+=2){let p=i[a[d]],g=r[a[d+1]];typeof p!="string"||g===void 0||(u[p]=g)}let f=tjt(s,c);return{type:J8t[s]??"Unknown",geometry:f,properties:u}}function tjt(e,t){let n=0,i=0,r=0;if(e===x7.POINT){let o=[];for(;n<t.length;){let s=t[n++],a=s&7,c=s>>3;if(a===1)for(let u=0;u<c;u++)i+=x0(t[n++]),r+=x0(t[n++]),o.push({x:i,y:r})}return o}if(e===x7.LINESTRING){let o=[],s=null;for(;n<t.length;){let a=t[n++],c=a&7,u=a>>3;if(c===1)s!==null&&o.push(s),s=[],i+=x0(t[n++]),r+=x0(t[n++]),s.push({x:i,y:r});else if(c===2)for(let f=0;f<u;f++)i+=x0(t[n++]),r+=x0(t[n++]),s.push({x:i,y:r})}return s!==null&&o.push(s),o}if(e===x7.POLYGON){let o=[],s=null;for(;n<t.length;){let a=t[n++],c=a&7,u=a>>3;if(c===1)s!==null&&o.push(s),s=[],i+=x0(t[n++]),r+=x0(t[n++]),s.push({x:i,y:r});else if(c===2)for(let f=0;f<u;f++)i+=x0(t[n++]),r+=x0(t[n++]),s.push({x:i,y:r});else c===7&&s!==null&&s.length>0&&(s.push({x:s[0].x,y:s[0].y}),o.push(s),s=null)}return s!==null&&o.push(s),o}return[]}function njt(e,t,n){let i=t;for(;i<n;){let r=T7(e,i,n),o=r.fieldNumber,s=r.wireType;if(i=r.newPos,o===sE.STRING&&s===2){let a=g_(e,i,n);i=a.newPos;let c=$u(i,a.value,n,"string value");return nae(e,i,c-i)}else{if(o===sE.FLOAT&&s===5)return $u(i,4,n,"float value"),new DataView(e.buffer,e.byteOffset+i,4).getFloat32(0,!0);if(o===sE.DOUBLE&&s===1)return $u(i,8,n,"double value"),new DataView(e.buffer,e.byteOffset+i,8).getFloat64(0,!0);if(o===sE.INT64&&s===0){let a=CI(e,i,n);return tae(a.value)}else if(o===sE.UINT64&&s===0){let a=CI(e,i,n);return tae(a.value)}else if(o===sE.SINT64&&s===0){let a=CI(e,i,n);return tae(ijt(a.value))}else if(o===sE.BOOL&&s===0)return EI(e,i,n).value!==0}i=E7(e,i,s,n)}}function T7(e,t,n){let i=EI(e,t,n);return{fieldNumber:i.value>>>3,wireType:i.value&7,newPos:i.newPos}}function EI(e,t,n){let i=CI(e,t,n,5);if(i.value>0xffffffffn)throw new oe("Invalid MVT uint32 varint.");return{value:Number(i.value),newPos:i.newPos}}function g_(e,t,n){let i=CI(e,t,n);if(i.value>BigInt(Number.MAX_SAFE_INTEGER))throw new oe("Invalid MVT length varint.");return{value:Number(i.value),newPos:i.newPos}}function CI(e,t,n,i){let r=0n,o=0n,s=0,a=i??10;for(;;){if(t>=n||t>=e.length)throw new oe("Invalid MVT: truncated varint.");let c=e[t++];if(r|=BigInt(c&127)<<o,s++,(c&128)===0)break;if(s>=a)throw new oe("Invalid MVT: varint is too long.");o+=7n}return{value:r,newPos:t}}function nae(e,t,n){let i=$u(t,n,e.length,"string");return K8t.decode(e.subarray(t,i))}function $u(e,t,n,i){if(!Number.isFinite(t)||t<0)throw new oe(`Invalid MVT ${i}: invalid length.`);let r=e+t;if(!Number.isFinite(r)||r<e||r>n)throw new oe(`Invalid MVT ${i}: length exceeds available bytes.`);return r}function E7(e,t,n,i){if(n===0)return CI(e,t,i).newPos;if(n===1)return $u(t,8,i,"fixed64 field");if(n===2){let r=g_(e,t,i);return $u(r.newPos,r.value,i,"length-delimited field")}else if(n===5)return $u(t,4,i,"fixed32 field");throw new oe(`Unsupported protobuf wire type: ${n}`)}function x0(e){return e>>>1^-(e&1)}function ijt(e){return e>>1n^-(e&1n)}function tae(e){return e<=BigInt(Number.MAX_SAFE_INTEGER)&&e>=BigInt(Number.MIN_SAFE_INTEGER)?Number(e):e}var C7=Z8t;function rjt(e){this.direction=h.clone(e.direction),this.color=z.clone(e.color??z.WHITE),this.intensity=e.intensity??1}var IBe=rjt;function aE(e){e=e??H.EMPTY_OBJECT;let t=e.translucent??!0,n=e.aboveGround??!1;this.material=l(e.material)?e.material:rr.fromType(rr.ColorType),this.translucent=e.translucent??!0,this._vertexShaderSource=e.vertexShaderSource??z9,this._fragmentShaderSource=e.fragmentShaderSource??U9,this._renderState=Rr.getDefaultRenderState(t,!n,e.renderState),this._closed=!1,this._flat=e.flat??!1,this._faceForward=e.faceForward??n,this._aboveGround=n}Object.defineProperties(aE.prototype,{vertexShaderSource:{get:function(){return this._vertexShaderSource}},fragmentShaderSource:{get:function(){return this._fragmentShaderSource}},renderState:{get:function(){return this._renderState}},closed:{get:function(){return this._closed}},vertexFormat:{get:function(){return aE.VERTEX_FORMAT}},flat:{get:function(){return this._flat}},faceForward:{get:function(){return this._faceForward}},aboveGround:{get:function(){return this._aboveGround}}});aE.VERTEX_FORMAT=Be.POSITION_AND_ST;aE.prototype.getFragmentShaderSource=Rr.prototype.getFragmentShaderSource;aE.prototype.isTranslucent=Rr.prototype.isTranslucent;aE.prototype.getRenderState=Rr.prototype.getRenderState;var PBe=aE;var ojt=1e5;function kM(e){e=e??H.EMPTY_OBJECT;let t=e.credit;typeof t=="string"&&(t=new It(t)),this._credit=t,this._radius=l(e.radius)?e.radius:ojt,this._image=e.image,this._transform=l(e.transform)?e.transform:M.IDENTITY,this._repeatHorizontal=l(e.repeatHorizontal)?e.repeatHorizontal:1,this._repeatVertical=l(e.repeatVertical)?e.repeatVertical:1;let n=new l7({radius:this._radius,vertexFormat:Be.ALL}),i=new Bt({geometry:n,modelMatrix:this._transform}),r=new rr({fabric:{type:"Image",uniforms:{image:this._image,repeat:new U(-this._repeatHorizontal,this._repeatVertical)}}});return this._primitive=new Mn({geometryInstances:i,appearance:new Cr({material:r,closed:!0,faceForward:!1,flat:!0,translucent:!1,renderState:{cull:{enabled:!1}}}),credit:this._credit}),this}Object.defineProperties(kM.prototype,{radius:{get:function(){return this._radius}},image:{get:function(){return this._image}},transform:{get:function(){return this._transform}},credit:{get:function(){return l(this._credit)?this._credit:void 0}},show:{get:function(){return l(this._primitive)?this._primitive.show:void 0},set:function(e){l(this._primitive)&&(this._primitive.show=e)}}});kM.prototype.update=function(e){return l(this._credit)&&e.creditDisplay.addCreditToNextFrame(this._credit),this._primitive.update(e)};kM.prototype.destroy=function(){return this._primitive=this._primitive&&this._primitive.destroy(),le(this)};kM.prototype.isDestroyed=function(){return this._primitive.isDestroyed()};var DBe=kM;function Ju(e){this._scene=e.scene,this.samplingWindow=e.samplingWindow??Ju.defaultSettings.samplingWindow,this.quietPeriod=e.quietPeriod??Ju.defaultSettings.quietPeriod,this.warmupPeriod=e.warmupPeriod??Ju.defaultSettings.warmupPeriod,this.minimumFrameRateDuringWarmup=e.minimumFrameRateDuringWarmup??Ju.defaultSettings.minimumFrameRateDuringWarmup,this.minimumFrameRateAfterWarmup=e.minimumFrameRateAfterWarmup??Ju.defaultSettings.minimumFrameRateAfterWarmup,this._lowFrameRate=new be,this._nominalFrameRate=new be,this._frameTimes=[],this._needsQuietPeriod=!0,this._quietPeriodEndTime=0,this._warmupPeriodEndTime=0,this._frameRateIsLow=!1,this._lastFramesPerSecond=void 0,this._pauseCount=0;let t=this;this._preUpdateRemoveListener=this._scene.preUpdate.addEventListener(function(r,o){sjt(t,o)}),this._hiddenPropertyName=document.hidden!==void 0?"hidden":document.mozHidden!==void 0?"mozHidden":document.msHidden!==void 0?"msHidden":document.webkitHidden!==void 0?"webkitHidden":void 0;let n=document.hidden!==void 0?"visibilitychange":document.mozHidden!==void 0?"mozvisibilitychange":document.msHidden!==void 0?"msvisibilitychange":document.webkitHidden!==void 0?"webkitvisibilitychange":void 0;function i(){ajt(t)}this._visibilityChangeRemoveListener=void 0,l(n)&&(document.addEventListener(n,i,!1),this._visibilityChangeRemoveListener=function(){document.removeEventListener(n,i,!1)})}Ju.defaultSettings={samplingWindow:5,quietPeriod:2,warmupPeriod:5,minimumFrameRateDuringWarmup:4,minimumFrameRateAfterWarmup:8};Ju.fromScene=function(e){return(!l(e._frameRateMonitor)||e._frameRateMonitor.isDestroyed())&&(e._frameRateMonitor=new Ju({scene:e})),e._frameRateMonitor};Object.defineProperties(Ju.prototype,{scene:{get:function(){return this._scene}},lowFrameRate:{get:function(){return this._lowFrameRate}},nominalFrameRate:{get:function(){return this._nominalFrameRate}},lastFramesPerSecond:{get:function(){return this._lastFramesPerSecond}}});Ju.prototype.pause=function(){++this._pauseCount,this._pauseCount===1&&(this._frameTimes.length=0,this._lastFramesPerSecond=void 0)};Ju.prototype.unpause=function(){--this._pauseCount,this._pauseCount<=0&&(this._pauseCount=0,this._needsQuietPeriod=!0)};Ju.prototype.isDestroyed=function(){return!1};Ju.prototype.destroy=function(){return this._preUpdateRemoveListener(),l(this._visibilityChangeRemoveListener)&&this._visibilityChangeRemoveListener(),le(this)};function sjt(e,t){if(e._pauseCount>0)return;let n=xn();if(e._needsQuietPeriod)e._needsQuietPeriod=!1,e._frameTimes.length=0,e._quietPeriodEndTime=n+e.quietPeriod/Un.SECONDS_PER_MILLISECOND,e._warmupPeriodEndTime=e._quietPeriodEndTime+(e.warmupPeriod+e.samplingWindow)/Un.SECONDS_PER_MILLISECOND;else if(n>=e._quietPeriodEndTime){e._frameTimes.push(n);let i=n-e.samplingWindow/Un.SECONDS_PER_MILLISECOND;if(e._frameTimes.length>=2&&e._frameTimes[0]<=i){for(;e._frameTimes.length>=2&&e._frameTimes[1]<i;)e._frameTimes.shift();let r=(n-e._frameTimes[0])/(e._frameTimes.length-1);e._lastFramesPerSecond=1e3/r;let o=1e3/(n>e._warmupPeriodEndTime?e.minimumFrameRateAfterWarmup:e.minimumFrameRateDuringWarmup);r>o?e._frameRateIsLow||(e._frameRateIsLow=!0,e._needsQuietPeriod=!0,e.lowFrameRate.raiseEvent(e.scene,e._lastFramesPerSecond)):e._frameRateIsLow&&(e._frameRateIsLow=!1,e._needsQuietPeriod=!0,e.nominalFrameRate.raiseEvent(e.scene,e._lastFramesPerSecond))}}}function ajt(e){document[e._hiddenPropertyName]?e.pause():e.unpause()}var v7=Ju;var rae=class e{constructor(t){t=t??H.EMPTY_OBJECT;let n=cjt(t.geoJson),i=t.allowPicking??!0,r=t.ellipsoid??ee.default,o=new Float64Array(0);function s(g){return o.length<g&&(o=new Float64Array(g)),o}this.show=t.show??!0,this._url=t.url,this._ids=n.ids,this._properties=n.properties,this._featureCount=n.ids.length,this._pickObjectFactory=t.pickObjectFactory,this._points=void 0,this._polylines=void 0,this._polygons=void 0,this._heightReference=t.heightReference??We.NONE,this._scene=t.scene;let a=this._heightReference,c=this._scene;n.pointCount>0&&(this._points=new vf({primitiveCountMax:n.pointCount,allowPicking:i})),n.polylineCount>0&&(this._polylines=new Hl({primitiveCountMax:n.polylineCount,vertexCountMax:n.polylineVertexCount,allowPicking:i,heightReference:a})),n.polygonCount>0&&(this._polygons=new tc({primitiveCountMax:n.polygonCount,vertexCountMax:n.polygonVertexCount,holeCountMax:n.polygonHoleCount,triangleCountMax:n.polygonTriangleCount,allowPicking:i,heightReference:a}));let u=new h,f=0,d=0,p=0;for(let g=0;g<n.features.length;g++){let m=n.features[g],y=m.featureId,A=this._properties[y];for(let b=0;b<m.points.length;b++){let x=f++;this._points.add({featureId:y,position:FBe(m.points[b],r,u),pickObject:i?iae(this,x,this._points,il,A):void 0})}for(let b=0;b<m.polylines.length;b++){let x=d++;this._polylines.add({featureId:y,positions:RBe(m.polylines[b],r,s),pickObject:i?iae(this,x,this._polylines,Oa,A):void 0})}for(let b=0;b<m.polygons.length;b++){let x=m.polygons[b],T=p++;this._polygons.add({featureId:y,positions:RBe(x.positions,r,s),holes:x.holes,triangles:x.triangles,pickObject:i?iae(this,T,this._polygons,Lo,A):void 0})}}}get url(){let t=this._url;if(l(t))return t instanceof De?t.getUrlComponent(!0):t}get featureCount(){return this._featureCount}get ids(){return this._ids}get properties(){return this._properties}get points(){return this._points}get polylines(){return this._polylines}get polygons(){return this._polygons}static async fromUrl(t,n){let i=De.createIfNeeded(t),r=await i.fetchJson();if(!l(r))throw new oe(`Failed to load GeoJSON from ${i.getUrlComponent(!0)}.`);return e.fromGeoJson(r,{...n,url:i})}static fromGeoJson(t,n){return new e({...n,geoJson:t})}getId(t){return this._ids[t]}getProperties(t){return this._properties[t]}update(t){if(!this.show)return;let n=this._points,i=this._polylines,r=this._polygons,o=t.frameNumber,s=this._heightReference,a=fs(s)?this._scene.vectorProvider:null;l(n)&&n.update(t),l(i)&&(l(a)?a.markForFrame(i,o,s):i.update(t)),l(r)&&(l(a)?a.markForFrame(r,o,s):r.update(t))}destroy(){let t=fs(this._heightReference)?this._scene.vectorProvider:null;return this._points&&(this._points.destroy(),this._points=void 0),this._polylines&&(l(t)&&t.remove(this._polylines),this._polylines.destroy(),this._polylines=void 0),this._polygons&&(l(t)&&t.remove(this._polygons),this._polygons.destroy(),this._polygons=void 0),le(this)}isDestroyed(){return!1}};function iae(e,t,n,i,r){return l(e._pickObjectFactory)?e._pickObjectFactory(t,n,r):{index:t,collection:n,get primitive(){return n.get(t,new i)},parentPrimitive:e,properties:r}}function cjt(e){let t=ljt(e),n=[],i=[],r=[],o=0,s=0,a=0,c=0,u=0,f=0,d=0;for(let p=0;p<t.length;p++){let g=t[p],m={points:[],polylines:[],polygons:[]};if(OBe(g.geometry,m),m.points.length===0&&m.polylines.length===0&&m.polygons.length===0)continue;let y=i.length;i.push(g.id),r.push(bjt(g.properties)?g.properties:H.EMPTY_OBJECT);for(let A=0;A<m.polygons.length;A++){let b=m.polygons[A];f+=b.holes.length,d+=b.triangles.length/3,u+=b.positions.length}for(let A=0;A<m.polylines.length;A++)a+=m.polylines[A].length;o+=m.points.length,s+=m.polylines.length,c+=m.polygons.length,n.push({featureId:y,points:m.points,polylines:m.polylines,polygons:m.polygons})}return{features:n,ids:i,properties:r,pointCount:o,polylineCount:s,polylineVertexCount:a,polygonCount:c,polygonVertexCount:u,polygonHoleCount:f,polygonTriangleCount:d}}function ljt(e){if(!l(e)||!l(e.type))throw new oe("GeoJSON object must define 'type'.");switch(e.type){case"FeatureCollection":return e.features;case"Feature":return[e];default:if(yjt(e.type))return[{type:"Feature",geometry:e,properties:H.EMPTY_OBJECT,id:void 0}];throw new oe(`Unsupported GeoJSON type: ${e.type}`)}}function OBe(e,t){if(!(!l(e)||!l(e.type)))switch(e.type){case"Point":MBe(e.coordinates,t.points);return;case"MultiPoint":fjt(e.coordinates,t.points);return;case"LineString":NBe(e.coordinates,t.polylines);return;case"MultiLineString":djt(e.coordinates,t.polylines);return;case"Polygon":LBe(e.coordinates,t.polygons);return;case"MultiPolygon":hjt(e.coordinates,t.polygons);return;case"GeometryCollection":ujt(e.geometries,t);return;default:return}}function ujt(e,t){if(Array.isArray(e))for(let n=0;n<e.length;n++)OBe(e[n],t)}function MBe(e,t){let n=oae(e);l(n)&&t.push(n)}function fjt(e,t){for(let n=0;n<e.length;n++)MBe(e[n],t)}function NBe(e,t){let n=mjt(e);l(n)&&n.length>=2&&t.push(n)}function djt(e,t){for(let n=0;n<e.length;n++)NBe(e[n],t)}function LBe(e,t){let n=pjt(e);l(n)&&t.push(n)}function hjt(e,t){for(let n=0;n<e.length;n++)LBe(e[n],t)}function mjt(e){if(!Array.isArray(e))return;let t=[];for(let n=0;n<e.length;n++){let i=oae(e[n]);l(i)&&t.push(i)}return t.length>=2?t:void 0}function pjt(e){if(!Array.isArray(e)||e.length===0)return;let t=[];for(let a=0;a<e.length;a++){let c=gjt(e[a]);l(c)&&t.push(c)}if(t.length===0||t[0].length<3)return;let i=[],r=[],o=[];for(let a=0;a<t.length;a++){let c=t[a];if(!(c.length<3)){a>0&&o.push(r.length);for(let u=0;u<c.length;u++){let f=c[u];r.push(f),i.push(new U(f[0],f[1]))}}}if(r.length<3)return;let s=mi.triangulate(i,o);if(!(!l(s)||s.length<3))return{positions:r,holes:new Uint32Array(o),triangles:new Uint32Array(s)}}function gjt(e){if(!Array.isArray(e))return;let t=[];for(let n=0;n<e.length;n++){let i=oae(e[n]);l(i)&&t.push(i)}if(!(t.length<3))return t.length>1&&_jt(t[0],t[t.length-1])&&t.pop(),t.length>=3?t:void 0}function oae(e){if(!Array.isArray(e)||e.length<2)return;let t=e[0],n=e[1],i=e[2]??0;if(!(!Number.isFinite(t)||!Number.isFinite(n)||!Number.isFinite(i)))return[t,n,i]}function _jt(e,t){return e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]}function yjt(e){return e==="Point"||e==="MultiPoint"||e==="LineString"||e==="MultiLineString"||e==="Polygon"||e==="MultiPolygon"||e==="GeometryCollection"}function FBe(e,t,n){return h.fromDegrees(e[0],e[1],e[2]??0,t,n)}var Ajt=new h;function RBe(e,t,n){let i=e.length*3,r=n(i);for(let o=0;o<e.length;o++){let s=FBe(e[o],t,Ajt);r[o*3]=s.x,r[o*3+1]=s.y,r[o*3+2]=s.z}return r.subarray(0,i)}function bjt(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}var BBe=rae;var kBe=js(Ose(),1);function sae(){this._image=new Image}sae.prototype.isReady=function(){return!0};sae.prototype.shouldDiscardImage=function(e){return e===this._image};function cE(e){e=e??H.EMPTY_OBJECT,this._defaultAlpha=void 0,this._defaultNightAlpha=void 0,this._defaultDayAlpha=void 0,this._defaultBrightness=void 0,this._defaultContrast=void 0,this._defaultHue=void 0,this._defaultSaturation=void 0,this._defaultGamma=void 0,this._defaultMinificationFilter=void 0,this._defaultMagnificationFilter=void 0,this._tileDiscardPolicy=e.tileDiscardPolicy,this._tilingScheme=new ir({numberOfLevelZeroTilesX:2,numberOfLevelZeroTilesY:2,rectangle:new ie(-P.PI,-P.PI,P.PI,P.PI),ellipsoid:e.ellipsoid});let t=e.credit;typeof t=="string"&&(t=new It(t)),this._credit=t,this._tileWidth=256,this._tileHeight=256,this._maximumLevel=23,l(this._tileDiscardPolicy)||(this._tileDiscardPolicy=new sae),this._errorEvent=new be}Object.defineProperties(cE.prototype,{url:{get:function(){return this._metadata.url}},proxy:{get:function(){return this._metadata.proxy}},tileWidth:{get:function(){return this._tileWidth}},tileHeight:{get:function(){return this._tileHeight}},maximumLevel:{get:function(){return this._maximumLevel}},minimumLevel:{get:function(){return 0}},tilingScheme:{get:function(){return this._tilingScheme}},rectangle:{get:function(){return this._tilingScheme.rectangle}},tileDiscardPolicy:{get:function(){return this._tileDiscardPolicy}},errorEvent:{get:function(){return this._errorEvent}},credit:{get:function(){return this._credit}},hasAlphaChannel:{get:function(){return!1}}});cE.fromMetadata=function(e,t){if(!e.imageryPresent)throw new oe(`The server ${e.url} doesn't have imagery`);let n=new cE(t);return n._metadata=e,n};cE.prototype.getTileCredits=function(e,t,n){let i=this._metadata,r=i.getTileInformation(e,t,n);if(l(r)){let o=i.providers[r.imageryProvider];if(l(o))return[o]}};cE.prototype.requestImage=function(e,t,n,i){let r=this._tileDiscardPolicy._image,o=this._metadata,s=tb.tileXYToQuadKey(e,t,n),a=o.getTileInformation(e,t,n);if(!l(a)){if(o.isValid(s)){let u=new Oo({throttle:i.throttle,throttleByServer:i.throttleByServer,type:i.type,priorityFunction:i.priorityFunction});o.populateSubtree(e,t,n,u);return}return Promise.resolve(r)}if(!a.hasImagery())return Promise.resolve(r);let c=xjt(this,a,e,t,n,i).fetchArrayBuffer();if(l(c))return c.then(function(u){J9(o.key,u);let f=new Uint8Array(u),d,p=o.protoImagery;if((!l(p)||!p)&&(d=Tjt(f)),!l(d)&&(!l(p)||p)){let g=Ejt(f);d=g.imageType,f=g.imageData}return!l(d)||!l(f)?r:Cy({uint8Array:f,format:d,flipY:!0})})};cE.prototype.pickFeatures=function(e,t,n,i,r){};function xjt(e,t,n,i,r,o){let s=tb.tileXYToQuadKey(n,i,r),a=t.imageryVersion;return a=l(a)&&a>0?a:1,e._metadata.resource.getDerivedResource({url:`flatfile?f1-0${s}-i.${a.toString()}`,request:o})}function Tjt(e){let t="JFIF";if(e[6]===t.charCodeAt(0)&&e[7]===t.charCodeAt(1)&&e[8]===t.charCodeAt(2)&&e[9]===t.charCodeAt(3))return"image/jpeg";let n="PNG";if(e[1]===n.charCodeAt(0)&&e[2]===n.charCodeAt(1)&&e[3]===n.charCodeAt(2))return"image/png"}function Ejt(e){let t=kBe.Reader.create(e),n=t.len,i={};for(;t.pos<n;){let s=t.uint32(),a;switch(s>>>3){case 1:i.imageType=t.uint32();break;case 2:i.imageData=t.bytes();break;case 3:i.alphaType=t.uint32();break;case 4:i.imageAlpha=t.bytes();break;case 5:if(a=i.copyrightIds,l(a)||(a=i.copyrightIds=[]),(s&7)===2){let c=t.uint32()+t.pos;for(;t.pos<c;)a.push(t.uint32())}else a.push(t.uint32());break;default:t.skipType(s&7);break}}let r=i.imageType;if(l(r))switch(r){case 0:i.imageType="image/jpeg";break;case 4:i.imageType="image/png";break;default:throw new oe("GoogleEarthEnterpriseImageryProvider: Unsupported image type.")}let o=i.alphaType;return l(o)&&o!==0&&(console.log("GoogleEarthEnterpriseImageryProvider: External alpha not supported."),delete i.alphaType,delete i.imageAlpha),i}var UBe=cE;var Cjt=600;function T0(e){e=e??H.EMPTY_OBJECT,this._key=l(e.key)?e.key:Ba.defaultApiKey,this._baseResource=De.createIfNeeded(e.url??Ba.streetViewStaticApiEndpoint),this._metadataResource=this._baseResource.getDerivedResource({url:"streetview/metadata"}),this._tileSize=e.tileSize??Cjt}Object.defineProperties(T0.prototype,{});T0.prototype.loadPanorama=async function(e){let t=e.cartographic,n=e.tileSize??this._tileSize,i=`${n}x${n}`,r=e.signature,{panoId:o}=e;l(o)||(o=(await this.getNearestPanoId(t)).panoId);let s=Ba.getDefaultCredit(),a=h.fromDegrees(P.toDegrees(t.longitude),P.toDegrees(t.latitude),0),c=[this._loadFaceImage({heading:0,pitch:0,tileSizeString:i,panoId:o,signature:r}),this._loadFaceImage({heading:180,pitch:0,tileSizeString:i,panoId:o,signature:r}),this._loadFaceImage({heading:-90,pitch:-90,tileSizeString:i,panoId:o,signature:r}),this._loadFaceImage({heading:-90,pitch:90,tileSizeString:i,panoId:o,signature:r}),this._loadFaceImage({heading:270,pitch:0,tileSizeString:i,panoId:o,signature:r}),this._loadFaceImage({heading:90,pitch:0,tileSizeString:i,panoId:o,signature:r})],[u,f,d,p,g,m]=await Promise.all(c),y=At.localFrameToFixedFrameGenerator("north","down"),A=M.getMatrix3(y(a,ee.default),new $);return new pw({sources:{positiveX:u,negativeX:f,positiveY:d,negativeY:p,positiveZ:g,negativeZ:m},transform:A,credit:s})};T0.prototype.getNearestPanoId=async function(e,t){let i=[P.toDegrees(e.latitude),P.toDegrees(e.longitude)].join(","),o=await this._metadataResource.getDerivedResource({queryParameters:{key:this._key,location:i,radius:t??50}}).fetchJson();if(o.status!=="OK")throw new pe(`GoogleStreetViewCubeMapPanoramaProvider metadata error: ${o.status}`);return{panoId:o.pano_id,latitude:o.location.lat,longitude:o.location.lng}};T0.prototype.getPanoIdMetadata=async function(e){let n=await this._metadataResource.getDerivedResource({queryParameters:{key:this._key,pano:e}}).fetchJson();if(n.status!=="OK")throw new pe(`GoogleStreetViewCubeMapPanoramaProvider metadata error: ${n.status}`);return n};T0.prototype._loadFaceImage=async function(e){let t=this._buildFaceUrl(e);try{return await De.fetchImage({url:t,preferImageBitmap:!0,flipY:!0})}catch{throw new pe(`Failed to load Street View face image: ${t}`)}};T0.prototype._buildFaceUrl=function(e){let{heading:t,pitch:n,tileSizeString:i,panoId:r,signature:o}=e;return this._baseResource.getDerivedResource({queryParameters:{size:i,pano:r,heading:t,pitch:n,key:this._key,...l(o)&&{signature:o}}}).url};T0.fromUrl=async function(e){if(e=e??{},e.key=e.key??Ba.defaultStreetViewStaticApiKey??Ba.defaultApiKey,!l(e.key)&&!l(Ba.defaultStreetViewStaticApiKey)&&!l(Ba.defaultApiKey))throw new pe("options.key, GoogleMaps.defaultStreetViewStaticApiKey or GoogleMaps.defaultApiKey is required.");return new T0({...e})};T0._parseMetadata=function(e){return{cartographic:he.fromDegrees(e.location.lng,e.location.lat,0)}};var zBe=T0;var vjt=new z(1,1,1,.4),Sjt=new z(0,1,0,.05),wjt=new z(0,.5,0,.2);function lE(e){e=e??H.EMPTY_OBJECT,this._defaultAlpha=void 0,this._defaultNightAlpha=void 0,this._defaultDayAlpha=void 0,this._defaultBrightness=void 0,this._defaultContrast=void 0,this._defaultHue=void 0,this._defaultSaturation=void 0,this._defaultGamma=void 0,this._defaultMinificationFilter=void 0,this._defaultMagnificationFilter=void 0,this._tilingScheme=l(e.tilingScheme)?e.tilingScheme:new ir({ellipsoid:e.ellipsoid}),this._cells=e.cells??8,this._color=e.color??vjt,this._glowColor=e.glowColor??Sjt,this._glowWidth=e.glowWidth??6,this._backgroundColor=e.backgroundColor??wjt,this._errorEvent=new be,this._tileWidth=e.tileWidth??256,this._tileHeight=e.tileHeight??256,this._canvasSize=e.canvasSize??256,this._canvas=this._createGridCanvas()}Object.defineProperties(lE.prototype,{proxy:{get:function(){}},tileWidth:{get:function(){return this._tileWidth}},tileHeight:{get:function(){return this._tileHeight}},maximumLevel:{get:function(){}},minimumLevel:{get:function(){}},tilingScheme:{get:function(){return this._tilingScheme}},rectangle:{get:function(){return this._tilingScheme.rectangle}},tileDiscardPolicy:{get:function(){}},errorEvent:{get:function(){return this._errorEvent}},credit:{get:function(){}},hasAlphaChannel:{get:function(){return!0}}});lE.prototype._drawGrid=function(e){let n=this._canvasSize;for(let i=0;i<=this._cells;++i){let o=1+i/this._cells*(n-1);e.moveTo(o,0),e.lineTo(o,n),e.moveTo(0,o),e.lineTo(n,o)}e.stroke()};lE.prototype._createGridCanvas=function(){let e=document.createElement("canvas");e.width=this._canvasSize,e.height=this._canvasSize;let t=0,n=this._canvasSize,i=e.getContext("2d"),r=this._backgroundColor.toCssColorString();i.fillStyle=r,i.fillRect(t,t,n,n);let o=this._glowColor.toCssColorString();i.strokeStyle=o,i.lineWidth=this._glowWidth,i.strokeRect(t,t,n,n),this._drawGrid(i),i.lineWidth=this._glowWidth*.5,i.strokeRect(t,t,n,n),this._drawGrid(i);let s=this._color.toCssColorString();return i.strokeStyle=s,i.lineWidth=2,i.strokeRect(t,t,n,n),i.lineWidth=1,this._drawGrid(i),e};lE.prototype.getTileCredits=function(e,t,n){};lE.prototype.requestImage=function(e,t,n,i){return Promise.resolve(this._canvas)};lE.prototype.pickFeatures=function(e,t,n,i,r){};var VBe=lE;function Im(){}Im._maxDecodingConcurrency=Math.max(dn.hardwareConcurrency-1,1);Im._decodeTaskProcessor=new $n("decodeI3S",Im._maxDecodingConcurrency);Im._promise=void 0;async function Ijt(){if(await Im._decodeTaskProcessor.initWebAssemblyModule({wasmBinaryFile:"ThirdParty/draco_decoder.wasm"}))return Im._decodeTaskProcessor;throw new oe("I3S decoder could not be initialized.")}Im.decode=async function(e,t,n,i,r){return l(Im._promise)||(Im._promise=Ijt()),Im._promise.then(function(o){let s=n._parent._data,a=n._parent._inverseRotationMatrix,c=0,u=0,f=0;l(s.obb)?(c=s.obb.center[0],u=s.obb.center[1],f=s.obb.center[2]):l(s.mbs)&&(c=s.mbs[0],u=s.mbs[1],f=s.mbs[2]);let d=$.fromRotationX(-P.PI_OVER_TWO),p=new $;$.multiply(d,a,p);let g=he.fromDegrees(c,u,f),m=ee.WGS84.cartographicToCartesian(g),y={binaryData:n._data,featureData:l(i)&&l(i[0])?i[0].data:void 0,schema:t,bufferInfo:n._geometryBufferInfo,ellipsoidRadiiSquare:ee.WGS84.radiiSquared,url:e,geoidDataList:n._dataProvider._geoidDataList,cartographicCenter:g,cartesianCenter:m,parentRotation:p,enableFeatures:n._dataProvider.showFeatures,splitGeometryByColorTransparency:n._dataProvider.adjustMaterialAlphaMode,symbologyData:r,calculateNormals:n._dataProvider.calculateNormals};return o.scheduleTask(y)})};var S7=Im;function aae(e,t){this._parent=e,this._dataProvider=e._dataProvider,this._layer=e._layer,l(this._parent._nodeIndex)?this._resource=this._parent._layer.resource.getDerivedResource({url:`nodes/${this._parent._data.mesh.attribute.resource}/${t}`}):this._resource=this._parent.resource.getDerivedResource({url:t})}Object.defineProperties(aae.prototype,{resource:{get:function(){return this._resource}},data:{get:function(){return this._data}}});aae.prototype.load=async function(){return this._data=await E0.loadJson(this._resource),this._data};var w7=aae;function __(e,t){this._storageInfo=t,this._parent=e,this._dataProvider=e._dataProvider,this._loadPromise=void 0;let n=`attributes/${t.key}/0`;l(this._parent._nodeIndex)?this._resource=this._parent._layer.resource.getDerivedResource({url:`nodes/${this._parent._data.mesh.attribute.resource}/${n}`}):this._resource=this._parent.resource.getDerivedResource({url:n})}Object.defineProperties(__.prototype,{resource:{get:function(){return this._resource}},header:{get:function(){return this._header}},values:{get:function(){if(l(this._values)){if(l(this._values.attributeValues))return this._values.attributeValues;if(l(this._values.objectIds))return this._values.objectIds}return[]}},name:{get:function(){return this._storageInfo.name}}});function I7(e){return e==="UInt8"||e==="Int8"?1:e==="UInt16"||e==="Int16"?2:e==="UInt32"||e==="Int32"||e==="Oid32"||e==="Float32"?4:e==="UInt64"||e==="Int64"||e==="Float64"?8:0}function Pjt(e){return e==="String"?1:I7(e)}async function Djt(e){let t=await e._dataProvider._loadBinary(e._resource),n=new DataView(t);e._data=t,e._validateHeader(n);let i=e._parseHeader(n),r=e._getBodyOffset(i);e._validateBody(n,r),e._parseBody(n,r)}__.prototype.load=function(){return l(this._loadPromise)?this._loadPromise:(this._loadPromise=Djt(this).catch(function(e){console.error(e)}),this._loadPromise)};__.prototype._parseValue=function(e,t,n){let i;if(t==="UInt8")i=e.getUint8(n),n+=1;else if(t==="Int8")i=e.getInt8(n),n+=1;else if(t==="UInt16")i=e.getUint16(n,!0),n+=2;else if(t==="Int16")i=e.getInt16(n,!0),n+=2;else if(t==="UInt32")i=e.getUint32(n,!0),n+=4;else if(t==="Oid32")i=e.getUint32(n,!0),n+=4;else if(t==="Int32")i=e.getInt32(n,!0),n+=4;else if(t==="UInt64"){let r=e.getUint32(n,!0),o=e.getUint32(n+4,!0);i=r+Math.pow(2,32)*o,n+=8}else if(t==="Int64"){let r=e.getUint32(n,!0),o=e.getUint32(n+4,!0);o<Math.pow(2,31)?i=r+Math.pow(2,32)*o:i=r+Math.pow(2,32)*(o-Math.pow(2,32)),n+=8}else t==="Float32"?(i=e.getFloat32(n,!0),n+=4):t==="Float64"?(i=e.getFloat64(n,!0),n+=8):t==="String"&&(i=String.fromCharCode(e.getUint8(n)),n+=1);return{value:i,offset:n}};__.prototype._parseHeader=function(e){let t=0;this._header={};for(let n=0;n<this._storageInfo.header.length;n++){let i=this._storageInfo.header[n],r=this._parseValue(e,i.valueType,t);this._header[i.property]=r.value,t=r.offset}return t};__.prototype._parseBody=function(e,t){this._values={};for(let n=0;n<this._storageInfo.ordering.length;n++){let i=this._storageInfo.ordering[n],r=i==="ObjectIds"?"objectIds":i,o=this._storageInfo[r];if(l(o)){this._values[r]=[];for(let s=0;s<this._header.count;++s)if(o.valueType!=="String"){let a=this._parseValue(e,o.valueType,t);this._values[r].push(a.value),t=a.offset}else{let a=this._values.attributeByteCounts[s],c="";for(let u=0;u<a;++u){let f=this._parseValue(e,o.valueType,t);f.value.charCodeAt(0)!==0&&(c+=f.value),t=f.offset}this._values[r].push(c)}}}};__.prototype._getBodyOffset=function(e){let t=0;return l(this._storageInfo.attributeValues)?t=I7(this._storageInfo.attributeValues.valueType):l(this._storageInfo.objectIds)&&(t=I7(this._storageInfo.objectIds.valueType)),t>0?Math.ceil(e/t)*t:e};__.prototype._validateHeader=function(e){let t=0;for(let n=0;n<this._storageInfo.header.length;n++){let i=this._storageInfo.header[n];t+=Pjt(i.valueType)}if(e.byteLength<t)throw new oe(`Invalid attribute buffer size (field: ${this.name}, header: ${t}, actual: ${e.byteLength})`)};__.prototype._validateBody=function(e,t){if(!l(this._header.count))throw new oe(`Invalid attribute buffer (field: ${this.name}, count is missing)`);let n;for(let i=0;i<this._storageInfo.ordering.length&&t<e.byteLength;i++){let r=this._storageInfo.ordering[i],o=r==="ObjectIds"?"objectIds":r,s=this._storageInfo[o];if(l(s))if(s.valueType!=="String"){o==="attributeByteCounts"&&(n=t);let a=I7(s.valueType);t+=a*this._header.count}else{if(!l(n))throw new oe(`Invalid attribute buffer (field: ${this.name}, attributeByteCounts is missing)`);for(let a=0;a<this._header.count&&t<e.byteLength;++a){let c=this._parseValue(e,this._storageInfo.attributeByteCounts.valueType,n);t+=c.value,n=c.offset}}else throw new oe(`Invalid attribute buffer (field: ${this.name}, ${o} is missing)`)}if(e.byteLength<t)throw new oe(`Invalid attribute buffer size (field: ${this.name}, expected: ${t}, actual: ${e.byteLength})`)};var P7=__;function UM(e,t){let n=e._dataProvider,i=e._layer,r;l(e._nodeIndex)?r=i.resource.getDerivedResource({url:`nodes/${e._data.mesh.geometry.resource}/${t}`}):r=e.resource.getDerivedResource({url:t}),this._parent=e,this._dataProvider=n,this._layer=i,this._resource=r,this._customAttributes=void 0}Object.defineProperties(UM.prototype,{resource:{get:function(){return this._resource}},data:{get:function(){return this._data}},customAttributes:{get:function(){return this._customAttributes}}});UM.prototype.load=function(){let e=this;return this._dataProvider._loadBinary(this._resource).then(function(t){return e._data=t,t})};var Rjt=new h,Ojt=new h,Mjt=new h,Njt=new h,Ljt=new h;function cae(e,t,n,i){let r=h.subtract(i,n,Rjt),o=h.cross(r,h.subtract(e,n,Ojt),Njt),s=h.cross(r,h.subtract(t,n,Mjt),Ljt);return h.dot(o,s)>=0}var Fjt=new h,Bjt=new h,kjt=new h,Ujt=new h,zjt=new h,Vjt=new h,jjt=new h,Hjt=new h,Gjt=new h,Wjt=new h;UM.prototype.getClosestPointIndexOnTriangle=function(e,t,n){if(l(this._customAttributes)&&l(this._customAttributes.positions)){let i=new h(e,t,n);i.x-=this._customAttributes.cartesianCenter.x,i.y-=this._customAttributes.cartesianCenter.y,i.z-=this._customAttributes.cartesianCenter.z,$.multiplyByVector(this._customAttributes.parentRotation,i,i);let r=Number.MAX_VALUE,o,s,a,c,u=this._customAttributes.positions,f=this._customAttributes.indices,d;l(f)?d=f.length:d=u.length/3;for(let p=0;p<d;p++){let g,m,y;l(f)?(g=f[p],m=f[p+1],y=f[p+2]):(g=p*3,m=p*3+1,y=p*3+2);let A=h.fromElements(u[g*3],u[g*3+1],u[g*3+2],Fjt),b=h.fromElements(u[m*3],u[m*3+1],u[m*3+2],Bjt),x=new h(u[y*3],u[y*3+1],u[y*3+2],kjt);if(!cae(i,A,b,x)||!cae(i,b,A,x)||!cae(i,x,A,b))continue;let T=h.subtract(b,A,Ujt),E=h.subtract(x,A,zjt),v=h.cross(T,E,Vjt);if(h.magnitude(v)===0)continue;let S=h.normalize(v,jjt),I=h.subtract(i,A,Hjt),R=Math.abs(h.dot(I,S));if(R<r){r=R,o=p;let O=h.magnitudeSquared(h.subtract(i,A,I)),L=h.magnitudeSquared(h.subtract(i,b,Gjt)),_=h.magnitudeSquared(h.subtract(i,x,Wjt));O<L&&O<_?(a=g,c=A,s=O):L<_?(a=m,c=b,s=L):(a=y,c=x,s=_)}}if(l(o))return{index:a,distanceSquared:s,distance:Math.sqrt(s),queriedPosition:i,closestPosition:h.clone(c)}}return{index:-1,distanceSquared:Number.Infinity,distance:Number.Infinity}};function jBe(e){let t=[],n=e.length;for(let i=0;i<n;i++)i<3?t.push(TI(e[i])):t.push(e[i]);return t}UM.prototype._generateGltf=function(e,t,n,i,r,o,s,a){let c={pbrMetallicRoughness:{metallicFactor:0},doubleSided:!0,name:"Material"},u=!1,f,d="";if(l(this._parent._data.mesh)&&l(this._layer._data.materialDefinitions)){let T=this._parent._data.mesh.material.definition;if(T>=0&&T<this._layer._data.materialDefinitions.length){if(f=this._layer._data.materialDefinitions[T],c=f,l(c.pbrMetallicRoughness)&&l(c.pbrMetallicRoughness.baseColorTexture)){u=!0,c.pbrMetallicRoughness.baseColorTexture.index=0;let E="0";if(l(this._layer._data.textureSetDefinitions))for(let v=0;v<this._layer._data.textureSetDefinitions.length;v++){let S=this._layer._data.textureSetDefinitions[v];for(let I=0;I<S.formats.length;I++){let R=S.formats[I];if(R.format==="jpg"){E=R.name;break}}}l(this._parent._data.mesh)&&this._parent._data.mesh.material.resource>=0&&(d=this._layer.resource.getDerivedResource({url:`nodes/${this._parent._data.mesh.material.resource}/textures/${E}`}).url)}l(c.pbrMetallicRoughness)&&l(c.pbrMetallicRoughness.baseColorFactor)&&(c.pbrMetallicRoughness.baseColorFactor=jBe(c.pbrMetallicRoughness.baseColorFactor)),l(c.emissiveFactor)&&(c.emissiveFactor=jBe(c.emissiveFactor))}}else l(this._parent._data.textureData)&&(u=!0,d=this._parent.resource.getDerivedResource({url:`${this._parent._data.textureData[0].href}`}).url,c.pbrMetallicRoughness.baseColorTexture={index:0});l(c.alphaMode)&&(c.alphaMode=c.alphaMode.toUpperCase());let p=[],g=[],m=[];u&&(p=[{sampler:0,source:0}],g=[{uri:d}],m=[{magFilter:9729,minFilter:9986,wrapS:10497,wrapT:10497}]);let y=[],A=n.length;for(let x=0;x<A;x++){let T=n[x].primitives,E=T.length;for(let v=0;v<E;v++){let S=T[v];if(l(S.material)){for(;S.material>=y.length;){let R=Ze(c,!0);y.push(R)}let I=y[S.material];l(S.extra)&&S.extra.isTransparent?l(I.alphaMode)||(I.alphaMode="BLEND"):I.alphaMode==="BLEND"&&(I.alphaMode="OPAQUE")}}}return{scene:0,scenes:[{nodes:e}],nodes:t,meshes:n,buffers:i,bufferViews:r,accessors:o,materials:y,textures:p,images:g,samplers:m,asset:{version:"2.0"},extensions:s,extensionsUsed:a}};var zM=UM;function pl(e,t,n){let i,r,o,s;n?(i=0,r=e):(i=e._level+1,r=e._layer),typeof t=="number"?o=t:s=e.resource.getDerivedResource({url:`${t}/`}),this._parent=e,this._dataProvider=e._dataProvider,this._isRoot=n,this._level=i,this._layer=r,this._nodeIndex=o,this._resource=s,this._isLoading=!1,this._tile=void 0,this._data=void 0,this._geometryData=[],this._featureData=[],this._fields={},this._children=[],this._childrenReadyPromise=void 0,this._globalTransform=void 0,this._inverseGlobalTransform=void 0,this._inverseRotationMatrix=void 0,this._symbologyData=void 0}Object.defineProperties(pl.prototype,{resource:{get:function(){return this._resource}},layer:{get:function(){return this._layer}},parent:{get:function(){return this._parent}},children:{get:function(){return this._children}},geometryData:{get:function(){return this._geometryData}},featureData:{get:function(){return this._featureData}},fields:{get:function(){return this._fields}},tile:{get:function(){return this._tile}},data:{get:function(){return this._data}}});pl.prototype.load=async function(){let e=this;function t(){if(!e._isRoot){let r=e._create3DTileDefinition();e._tile=new nm(e._layer._tileset,e._dataProvider.resource,r,e._parent._tile),e._tile._i3sNode=e}}if(!l(this._nodeIndex)){let r=await E0.loadJson(this._resource);e._data=r,t();return}let n=await this._layer._getNodeInNodePages(this._nodeIndex);e._data=n;let i;e._isRoot?i="nodes/root/":l(n.mesh)&&(i=`../${n.mesh.geometry.resource}/`),l(i)&&l(e._parent.resource)&&(e._resource=e._parent.resource.getDerivedResource({url:i})),t()};function HBe(e,t){let n=new P7(e,t);return e._fields[t.name]=n,n.load()}pl.prototype.loadFields=function(){let e=this._layer._data.attributeStorageInfo,t=[];if(l(e))for(let n=0;n<e.length;n++){let i=e[n],r=this._fields[i.name];l(r)?t.push(r.load()):t.push(HBe(this,i))}return Promise.all(t)};pl.prototype.loadField=function(e){let t=this._fields[e];if(l(t))return t.load();let n=this._layer._data.attributeStorageInfo;if(l(n))for(let i=0;i<n.length;i++){let r=n[i];if(r.name===e)return HBe(this,r)}return Promise.resolve()};pl.prototype.getFieldsForPickedPosition=function(e){let t=this.geometryData[0];if(!l(t.customAttributes.featureIndex))return{};let n=t.getClosestPointIndexOnTriangle(e.x,e.y,e.z);if(n.index===-1||n.index>t.customAttributes.featureIndex.length)return{};let i=t.customAttributes.featureIndex[n.index];return this.getFieldsForFeature(i)};pl.prototype.getFieldsForFeature=function(e){let t={};for(let n in this.fields)if(this.fields.hasOwnProperty(n)){let i=this.fields[n];e>=0&&e<i.values.length&&(t[i.name]=i.values[e])}return t};pl.prototype._loadChildren=function(){let e=this;if(l(this._childrenReadyPromise))return this._childrenReadyPromise;let t=[];if(l(e._data.children))for(let n=0;n<e._data.children.length;n++){let i=e._data.children[n],r=new pl(e,i.href??i,!1);e._children.push(r),t.push(r.load())}return this._childrenReadyPromise=Promise.all(t).then(function(){for(let n=0;n<e._children.length;n++)e._tile.children.push(e._children[n]._tile)}),this._childrenReadyPromise};pl.prototype._loadGeometryData=function(){let e=[];if(l(this._data.geometryData))for(let t=0;t<this._data.geometryData.length;t++){let n=new zM(this,this._data.geometryData[t].href);this._geometryData.push(n),e.push(n.load())}else if(l(this._data.mesh)){let t=this._layer._findBestGeometryBuffers(this._data.mesh.geometry.definition,["position","uv0"]),n=`./geometries/${t.bufferIndex}/`,i=new zM(this,n);i._geometryDefinitions=t.definition,i._geometryBufferInfo=t.geometryBufferInfo,this._geometryData.push(i),e.push(i.load())}return Promise.all(e)};pl.prototype._loadFeatureData=function(){let e=[];if(l(this._data.featureData))for(let t=0;t<this._data.featureData.length;t++){let n=new w7(this,this._data.featureData[t].href);this._featureData.push(n),e.push(n.load())}return Promise.all(e)};pl.prototype._clearGeometryData=function(){this._geometryData=[]};pl.prototype._create3DTileDefinition=function(){let e=this._data.obb,t=this._data.mbs;if(!l(e)&&!l(t)){console.error("Failed to load I3S node. Bounding volume is required.");return}let n;if(l(e)?n=he.fromDegrees(e.center[0],e.center[1],e.center[2]):n=he.fromDegrees(t[0],t[1],t[2]),l(this._dataProvider._geoidDataList)&&l(n))for(let b=0;b<this._dataProvider._geoidDataList.length;b++){let x=this._dataProvider._geoidDataList[b],T=x.projection.project(n);if(T.x>x.nativeExtent.west&&T.x<x.nativeExtent.east&&T.y>x.nativeExtent.south&&T.y<x.nativeExtent.north){n.height+=Kjt(T.x,T.y,x);break}}let i,r,o;l(e)?(i={box:[0,0,0,e.halfSize[0],0,0,0,e.halfSize[1],0,0,0,e.halfSize[2]]},o=Math.max(Math.max(this._data.obb.halfSize[0],this._data.obb.halfSize[1]),this._data.obb.halfSize[2]),r=ee.WGS84.cartographicToCartesian(n)):(i={sphere:[0,0,0,t[3]]},r=ee.WGS84.cartographicToCartesian(n),o=this._data.mbs[3]),o*=2;let s=1/0;if(l(this._data.lodThreshold))if(this._layer._data.nodePages.lodSelectionMetricType==="maxScreenThresholdSQ"){let b=Math.sqrt(this._data.lodThreshold/(Math.PI*.25));s=o/b}else if(this._layer._data.nodePages.lodSelectionMetricType==="maxScreenThreshold"){let b=this._data.lodThreshold;s=o/b}else console.error("Invalid lodSelectionMetricType in Layer");else if(l(this._data.lodSelection))for(let b=0;b<this._data.lodSelection.length;b++)this._data.lodSelection[b].metricType==="maxScreenThreshold"&&(s=o/this._data.lodSelection[b].maxError);s===1/0&&(s=1e5);let a=s*16,c=new kc(0,0,0),u=At.headingPitchRollQuaternion(r,c);l(this._data.obb)&&(u=new Le(this._data.obb.quaternion[0],this._data.obb.quaternion[1],this._data.obb.quaternion[2],this._data.obb.quaternion[3]));let f=$.fromQuaternion(u),d=$.inverse(f,new $),p=new M(f[0],f[1],f[2],0,f[3],f[4],f[5],0,f[6],f[7],f[8],0,r.x,r.y,r.z,1),g=M.inverse(p,new M),m=M.clone(p);l(this._parent._globalTransform)&&M.multiply(p,this._parent._inverseGlobalTransform,m),this._globalTransform=p,this._inverseGlobalTransform=g,this._inverseRotationMatrix=d;let y=[];for(let b=0;b<this._children.length;b++)y.push(this._children[b]._create3DTileDefinition());return{children:y,refine:"REPLACE",boundingVolume:i,transform:[m[0],m[4],m[8],m[12],m[1],m[5],m[9],m[13],m[2],m[6],m[10],m[14],m[3],m[7],m[11],m[15]],content:{uri:l(this._resource)?this._resource.url:void 0},geometricError:a}};pl.prototype._loadSymbology=async function(){!l(this._symbologyData)&&l(this._layer._symbology)&&(this._symbologyData=await this._layer._symbology._getSymbology(this))};pl.prototype._createContentURL=async function(){let e={scene:0,scenes:[{nodes:[0]}],nodes:[{name:"singleNode"}],meshes:[],buffers:[],bufferViews:[],accessors:[],materials:[],textures:[],images:[],samplers:[],asset:{version:"2.0"}},t=[this._loadGeometryData()];if(this._dataProvider.legacyVersion16&&t.push(this._loadFeatureData()),await Promise.all(t),l(this._geometryData)&&this._geometryData.length>0){this._dataProvider._applySymbology&&await this._loadSymbology();let r=this._geometryData[0].resource.url,o=this._layer._data.store.defaultGeometrySchema,s=this._geometryData[0],a=await S7.decode(r,o,s,this._featureData[0],this._symbologyData);if(!l(a))return;e=s._generateGltf(a.meshData.nodesInScene,a.meshData.nodes,a.meshData.meshes,a.meshData.buffers,a.meshData.bufferViews,a.meshData.accessors,a.meshData.rootExtensions,a.meshData.extensionsUsed),this._geometryData[0]._customAttributes=a.meshData._customAttributes}let n=this._dataProvider._binarizeGltf(e),i=new Blob([n],{type:"application/binary"});return URL.createObjectURL(i)};async function qjt(e){let t=e._layer._filters,n=[];for(let i=0;i<t.length;i++){let r=e.loadField(t[i].name);n.push(r)}return await Promise.all(n),t}function Yjt(e,t,n){if(!l(n.values)||n.values.length===0)return!1;let i=l(t)?t.values:[],r;e<i.length&&(r=i[e]);let o=!1;for(let s=0;s<n.values.length;s++)if(n.values[s]===r){o=!0;break}return o}async function GBe(e,t){let n=e._tile.content.batchTable;if(l(n)&&n.featuresLength>0){n.setAllShow(!0);let i=await qjt(e);if(i.length>0)for(let r=0;r<n.featuresLength;r++)for(let o=0;o<i.length;o++){let s=i[o];if(!Yjt(r,e._fields[s.name],s)){n.setShow(r,!1);break}}}t.show=!0}pl.prototype._filterFeatures=function(){let e=[];for(let n=0;n<this._children.length;n++){let i=this._children[n]._filterFeatures();e.push(i)}let t=this._tile?.content?._model;if(l(this._geometryData)&&this._geometryData.length>0&&l(t)&&t.ready){t.show=!1;let n=GBe(this,t);e.push(n)}return Promise.all(e)};nm.prototype._hookedRequestContent=nm.prototype.requestContent;nm.prototype.requestContent=function(){if(!this.tileset._isI3STileSet)return this._hookedRequestContent();if(!this._isLoading){this._isLoading=!0;let e=this;return this._i3sNode._createContentURL().then(t=>{if(!l(t)){e._isLoading=!1;return}return e._contentResource=new De({url:t}),e._hookedRequestContent()}).then(t=>{let n=t?._model;return l(e._i3sNode._geometryData)&&e._i3sNode._geometryData.length>0&&l(n)&&(n.show=!1,n.readyEvent.addEventListener(()=>{GBe(e._i3sNode,n)})),e._isLoading=!1,t})}};function Xjt(e,t,n,i,r,o){let s=n*(1-e)+i*e,a=r*(1-e)+o*e;return s*(1-t)+a*t}function D7(e,t,n,i){let r=e+t*n;return i[r]}function Kjt(e,t,n){let i=n.nativeExtent,r=(e-i.west)/(i.east-i.west)*(n.width-1),o=(t-i.south)/(i.north-i.south)*(n.height-1),s=Math.floor(r),a=Math.floor(o);r-=s,o-=a;let c=s<n.width?s+1:s,u=a<n.height?a+1:a;a=n.height-1-a,u=n.height-1-u;let f=D7(s,a,n.width,n.buffer),d=D7(c,a,n.width,n.buffer),p=D7(s,u,n.width,n.buffer),g=D7(c,u,n.width,n.buffer),m=Xjt(r,o,f,d,p,g);return m=m*n.scale+n.offset,m}Object.defineProperties(nm.prototype,{i3sNode:{get:function(){return this._i3sNode}}});var VM=pl;function R7(e){this._layer=e,this._defaultSymbology=void 0,this._valueFields=[],this._uniqueValueHash=void 0,this._classBreaksHash=void 0,this._parseLayerSymbology()}Object.defineProperties(R7.prototype,{defaultSymbology:{get:function(){return this._defaultSymbology}}});function lae(e,t){let n=[];for(let i=0;i<e.length;i++){let r=z.byteToFloat(e[i]);i<3?n.push(TI(r)):n.push(r)}return n.length===3&&(l(t)?n.push(1-t/100):n.push(1)),n}function vI(e,t){let n={edges:void 0,material:void 0};if(l(e)&&l(e.symbolLayers))for(let i=0;i<e.symbolLayers.length;i++){let r=e.symbolLayers[i];if(r.type==="Fill"){let o=r.edges,s=r.outline;if(l(o)?(n.edges={},l(o.color)&&(n.edges.color=lae(o.color,o.transparency))):l(s)&&(n.edges={},l(s.color)&&(n.edges.color=lae(s.color,s.transparency))),!t){let a=r.material;l(a)&&(n.material={colorMixMode:a.colorMixMode},l(a.color)&&(n.material.color=lae(a.color,a.transparency)))}break}}return n}function $jt(e,t){if(l(e.uniqueValueGroups)){let n={};for(let i=0;i<e.uniqueValueGroups.length;i++){let r=e.uniqueValueGroups[i].classes;if(l(r))for(let o=0;o<r.length;o++){let s=vI(r[o].symbol,t),a=r[o].values;for(let c=0;c<a.length;c++){let u=a[c],f=n;for(let d=0;d<u.length;d++){let p=u[d];d===u.length-1?f[p]=s:(l(f[p])||(f[p]={}),f=f[p])}}}}return n}if(l(e.uniqueValueInfos)){let n={};for(let i=0;i<e.uniqueValueInfos.length;i++){let r=e.uniqueValueInfos[i];n[r.value]=vI(r.symbol,t)}return n}}function Jjt(e,t){if(l(e.classBreakInfos)){let n=[...e.classBreakInfos];n.sort(function(r,o){let s=r.classMaxValue??r.classMinValue,a=o.classMaxValue??o.classMinValue;return s-a});let i={ranges:[],symbols:[]};l(e.minValue)&&(i.ranges.push(e.minValue),i.symbols.push(void 0));for(let r=0;r<n.length;r++){let o=n[r];l(o.classMinValue)&&(i.ranges.length===0||o.classMinValue>i.ranges[i.ranges.length-1])&&(i.ranges.push(o.classMinValue),i.symbols.push(void 0)),l(o.classMaxValue)&&(i.ranges.length===0||o.classMaxValue>i.ranges[i.ranges.length-1])&&(i.ranges.push(o.classMaxValue),i.symbols.push(vI(o.symbol,t)))}return i.symbols.push(void 0),i}}R7.prototype._parseLayerSymbology=function(){let e=this._layer.data.drawingInfo;if(l(e)&&l(e.renderer)){let t=this._layer.data.cachedDrawingInfo,n=l(t)&&t.color===!0,i=e.renderer;i.type==="simple"?this._defaultSymbology=vI(i.symbol,n):i.type==="uniqueValue"?(this._defaultSymbology=vI(i.defaultSymbol,n),this._valueFields.push(i.field1),l(i.field2)&&this._valueFields.push(i.field2),l(i.field3)&&this._valueFields.push(i.field3),this._uniqueValueHash=$jt(i,n)):i.type==="classBreaks"&&(this._defaultSymbology=vI(i.defaultSymbol,n),this._valueFields.push(i.field),this._classBreaksHash=Jjt(i,n))}};function WBe(e,t,n,i){let r=t[n];if(i<r.length){let o=r[i],s=e[o];return l(s)&&++n<t.length?WBe(s,t,n,i):s}}function Zjt(e,t){let n=0,i=e.length;if(n<i)do{let r=n+i>>>1;e[r]<t?n=r+1:i=r}while(n<i);return n}function Qjt(e,t,n){let i=t[n],r=Zjt(e.ranges,i);return e.symbols[r]}R7.prototype._getSymbology=async function(e){let t={default:this._defaultSymbology};if(this._valueFields.length>0){let n=[];for(let o=0;o<this._valueFields.length;o++)n.push(e.loadField(this._valueFields[o]));await Promise.all(n);let i=[];for(let o=0;o<this._valueFields.length;o++)i.push(e.fields[this._valueFields[o]].values);let r;if(l(this._uniqueValueHash)?r=o=>WBe(this._uniqueValueHash,i,0,o):l(this._classBreaksHash)&&(r=o=>Qjt(this._classBreaksHash,i[0],o)),l(r)){let o=i[0];for(let s=0;s<o.length;s++){let a=r(s);l(a)&&(t[s]=a)}}}return t};var O7=R7;function Zu(e,t,n){this._dataProvider=e,this._parent=n,!l(t.href)&&l(t.id)&&(t.href=`layers/${t.id}`);let i=this._parent.resource.getUrlComponent(),r;i.match(/layers\/\d/)?r=`${i}`.replace(/\/+$/,""):r=`${i}`.replace(/\/?$/,"/").concat(`${t.href}`),this._version=t.store.version;let o=this._version.split(".");this._majorVersion=parseInt(o[0]),this._minorVersion=o.length>1?parseInt(o[1]):0,this._resource=new De({url:r}),this._resource.setQueryParameters(this._dataProvider.resource.queryParameters),this._resource.appendForwardSlash(),this._data=t,this._rootNode=void 0,this._nodePages={},this._nodePageFetches={},this._extent=void 0,this._tileset=void 0,this._geometryDefinitions=void 0,this._filters=[],this._symbology=void 0,this._computeGeometryDefinitions(!0),this._computeExtent()}Object.defineProperties(Zu.prototype,{resource:{get:function(){return this._resource}},rootNode:{get:function(){return this._rootNode}},tileset:{get:function(){return this._tileset}},data:{get:function(){return this._data}},version:{get:function(){return this._version}},majorVersion:{get:function(){return this._majorVersion}},minorVersion:{get:function(){return this._minorVersion}},legacyVersion16:{get:function(){if(l(this.version))return this.majorVersion<1||this.majorVersion===1&&this.minorVersion<=6}}});Zu.prototype.load=async function(e){if(this._data.spatialReference.wkid!==4326)throw new oe(`Unsupported spatial reference: ${this._data.spatialReference.wkid}`);if(this._dataProvider.applySymbology&&(this._symbology=new O7(this)),await this._dataProvider.loadGeoidData(),await this._loadRootNode(e),await this._create3DTileset(e),this._rootNode._tile=this._tileset._root,this._tileset._root._i3sNode=this._rootNode,this.legacyVersion16)return this._rootNode._loadChildren()};Zu.prototype._computeGeometryDefinitions=function(e){if(this._geometryDefinitions=[],l(this._data.geometryDefinitions))for(let t=0;t<this._data.geometryDefinitions.length;t++){let n=[],i=this._data.geometryDefinitions[t].geometryBuffers;for(let r=0;r<i.length;r++){let o=i[r],s=[],a=!1;if(l(o.compressedAttributes)&&e){a=!0;let c=o.compressedAttributes.attributes;for(let u=0;u<c.length;u++)s.push(c[u])}else for(let c in o)c!=="offset"&&s.push(c);n.push({compressed:a,attributes:s,index:i.indexOf(o)})}n.sort(function(r,o){return r.compressed&&!o.compressed?-1:!r.compressed&&o.compressed?1:r.attributes.length-o.attributes.length}),this._geometryDefinitions.push(n)}};Zu.prototype._findBestGeometryBuffers=function(e,t){let n=this._geometryDefinitions[e];if(l(n)){for(let i=0;i<n.length;++i){let r=n[i],o=!1,s=r.attributes;for(let a=0;a<t.length;a++)if(!s.includes(t[a])){o=!0;break}if(!o)return{bufferIndex:r.index,definition:n,geometryBufferInfo:r}}if(l(n[0]))return{bufferIndex:0,definition:n,geometryBufferInfo:n[0]}}};Zu.prototype._loadRootNode=function(e){if(l(this._data.nodePages)){let t=0;l(this._data.nodePages.rootIndex)&&(t=this._data.nodePages.rootIndex),this._rootNode=new VM(this,t,!0)}else this._rootNode=new VM(this,this._data.store.rootNode,!0);return this._rootNode.load(e)};Zu.prototype._getNodeInNodePages=function(e){let t=Math.floor(e/this._data.nodePages.nodesPerPage),n=e%this._data.nodePages.nodesPerPage;return this._loadNodePage(t).then(function(i){return i.nodes[n]})};Zu._fetchJson=function(e){return e.fetchJson()};Zu.prototype._loadNodePage=function(e){let t=this;if(!l(this._nodePageFetches[e])){let n=this.resource.getDerivedResource({url:`nodepages/${e}/`}),i=Zu._fetchJson(n).then(function(r){return l(r.error)&&r.error.code!==200?Promise.reject(r.error):(t._nodePages[e]=r.nodes,r)});this._nodePageFetches[e]=i}return this._nodePageFetches[e]};Zu.prototype._computeExtent=function(){l(this._data.fullExtent)?this._extent=ie.fromDegrees(this._data.fullExtent.xmin,this._data.fullExtent.ymin,this._data.fullExtent.xmax,this._data.fullExtent.ymax):l(this._data.store.extent)&&(this._extent=ie.fromDegrees(this._data.store.extent[0],this._data.store.extent[1],this._data.store.extent[2],this._data.store.extent[3]))};Zu.prototype._create3DTileset=async function(e){let t={asset:{version:"1.0"},geometricError:Number.MAX_VALUE,root:this._rootNode._create3DTileDefinition()},n=new Blob([JSON.stringify(t)],{type:"application/json"}),i=URL.createObjectURL(n),r=this._symbology?.defaultSymbology?.edges?.color;l(r)&&!l(e?.outlineColor)&&(e=l(e)?Ze(e):{},e.outlineColor=z.fromCartesian4(se.fromArray(r))),this._tileset=await ts.fromUrl(i,e),this._tileset.show=this._parent.show,this._tileset._isI3STileSet=!0,this._tileset.tileUnload.addEventListener(function(o){o._i3sNode._clearGeometryData(),URL.revokeObjectURL(o._contentResource._url),o._contentResource=o._i3sNode.resource}),this._tileset.tileVisible.addEventListener(function(o){l(o._i3sNode)&&o._i3sNode._loadChildren()})};Zu.prototype._updateVisibility=function(){l(this._tileset)&&(this._tileset.show=this._parent.show)};Zu.prototype.filterByAttributes=function(e){this._filters=l(e)?Ze(e,!0):[];let t=this._rootNode;return l(t)?t._filterFeatures():Promise.resolve()};var SI=Zu;function M7(e,t){this._dataProvider=e,this._resource=new De({url:t}),this._resource.setQueryParameters(e.resource.queryParameters),this._resource.appendForwardSlash()}Object.defineProperties(M7.prototype,{resource:{get:function(){return this._resource}},data:{get:function(){return this._data}},names:{get:function(){let e=[],t=this._data.summary;if(l(t))for(let n=0;n<t.length;++n)e.push(t[n].fieldName);return e}}});M7.prototype.load=async function(){return this._data=await E0.loadJson(this._resource),this._data};M7.prototype._getValues=function(e){let t=this._data.summary;if(l(t))for(let n=0;n<t.length;++n){let i=t[n];if(i.fieldName===e)return l(i.mostFrequentValues)?[...i.mostFrequentValues]:[]}};var N7=M7;function jM(e,t,n){this._dataProvider=e,this._parent=t,this._data=n,this._name=n.name,this._modelName=n.modelName,this._visibility=n.visibility??!0,this._resource=void 0,this._sublayers=[],this._i3sLayers=[]}Object.defineProperties(jM.prototype,{resource:{get:function(){return this._resource}},data:{get:function(){return this._data}},name:{get:function(){return this._name}},modelName:{get:function(){return this._modelName}},sublayers:{get:function(){return this._sublayers}},visibility:{get:function(){return this._visibility},set:function(e){if(this._visibility!==e){this._visibility=e;for(let t=0;t<this._i3sLayers.length;t++)this._i3sLayers[t]._updateVisibility()}}},show:{get:function(){return this._visibility&&this._parent.show}}});jM._fromData=async function(e,t,n,i){let r=new jM(e,i,n);if(r._data.layerType==="group"){let o=r._data.sublayers;if(l(o)){let s=[];for(let c=0;c<o.length;c++){let u=jM._fromData(e,t,o[c],r);s.push(u)}let a=await Promise.all(s);for(let c=0;c<a.length;c++){let u=a[c];r._sublayers.push(u),r._i3sLayers.push(...u._i3sLayers)}}}else if(r._data.layerType==="3DObject"){let o=t.concat(`/sublayers/${r._data.id}`),s=new De({url:o});s.setQueryParameters(e.resource.queryParameters),s.appendForwardSlash(),r._resource=s;let a=await E0.loadJson(r._resource),c=new SI(e,a,r);r._i3sLayers.push(c)}else console.log(`${r._data.layerType} layer ${r._data.name} is skipped as not supported.`);return r};var L7=jM;var XBe=js(qBe(),1);function ta(e){e=e??H.EMPTY_OBJECT,this._name=e.name,this._show=e.show??!0,this._geoidTiledTerrainProvider=e.geoidTiledTerrainProvider,this._showFeatures=e.showFeatures??!1,this._adjustMaterialAlphaMode=e.adjustMaterialAlphaMode??!1,this._applySymbology=e.applySymbology??!1,this._calculateNormals=e.calculateNormals??!1,this._cesium3dTilesetOptions=e.cesium3dTilesetOptions??H.EMPTY_OBJECT,this._layers=[],this._sublayers=[],this._data=void 0,this._extent=void 0,this._geoidDataPromise=void 0,this._geoidDataList=void 0,this._decoderTaskProcessor=void 0,this._taskProcessorReadyPromise=void 0,this._attributeStatistics=[],this._layersExtent=[]}Object.defineProperties(ta.prototype,{name:{get:function(){return this._name}},show:{get:function(){return this._show},set:function(e){if(this._show!==e){this._show=e;for(let t=0;t<this._layers.length;t++)this._layers[t]._updateVisibility()}}},geoidTiledTerrainProvider:{get:function(){return this._geoidTiledTerrainProvider}},layers:{get:function(){return this._layers}},sublayers:{get:function(){return this._sublayers}},data:{get:function(){return this._data}},extent:{get:function(){return this._extent}},resource:{get:function(){return this._resource}},showFeatures:{get:function(){return this._showFeatures}},adjustMaterialAlphaMode:{get:function(){return this._adjustMaterialAlphaMode}},applySymbology:{get:function(){return this._applySymbology}},calculateNormals:{get:function(){return this._calculateNormals}}});ta.prototype.destroy=function(){for(let e=0;e<this._layers.length;e++)l(this._layers[e]._tileset)&&this._layers[e]._tileset.destroy();return le(this)};ta.prototype.isDestroyed=function(){return!1};ta.prototype.update=function(e){for(let t=0;t<this._layers.length;t++)l(this._layers[t]._tileset)&&this._layers[t]._tileset.update(e)};ta.prototype.prePassesUpdate=function(e){for(let t=0;t<this._layers.length;t++)l(this._layers[t]._tileset)&&this._layers[t]._tileset.prePassesUpdate(e)};ta.prototype.postPassesUpdate=function(e){for(let t=0;t<this._layers.length;t++)l(this._layers[t]._tileset)&&this._layers[t]._tileset.postPassesUpdate(e)};ta.prototype.updateForPass=function(e,t){for(let n=0;n<this._layers.length;n++)l(this._layers[n]._tileset)&&this._layers[n]._tileset.updateForPass(e,t)};function e6t(e,t){let n=e.resource.getUrlComponent(),i;return n.match(/layers\/\d/)?i=`${n}`.replace(/\/+$/,""):i=`${n}`.replace(/\/?$/,"/").concat(`layers/${t}`),i}async function YBe(e,t,n){if(t.layerType==="Building"){l(n.showFeatures)||(e._showFeatures=!0),l(n.adjustMaterialAlphaMode)||(e._adjustMaterialAlphaMode=!0),l(n.applySymbology)||(e._applySymbology=!0),l(n.calculateNormals)||(e._calculateNormals=!0);let i=e6t(e,t.id);if(l(t.sublayers)){let r=[];for(let s=0;s<t.sublayers.length;s++){let a=L7._fromData(e,i,t.sublayers[s],e);r.push(a)}let o=await Promise.all(r);for(let s=0;s<o.length;s++){let a=o[s];e._sublayers.push(a),e._layers.push(...a._i3sLayers)}}if(l(t.statisticsHRef)){let r=i.concat(`/${t.statisticsHRef}`),o=new N7(e,r);await o.load(),e._attributeStatistics.push(o)}if(l(t.fullExtent)){let r=ie.fromDegrees(t.fullExtent.xmin,t.fullExtent.ymin,t.fullExtent.xmax,t.fullExtent.ymax);e._layersExtent.push(r)}}else if(t.layerType==="3DObject"||t.layerType==="IntegratedMesh"){!l(n.calculateNormals)&&!l(t.textureSetDefinitions)&&(e._calculateNormals=!0);let i=new SI(e,t,e);e._layers.push(i),l(i._extent)&&e._layersExtent.push(i._extent)}else console.log(`${t.layerType} layer ${t.name} is skipped as not supported.`)}ta.fromUrl=async function(e,t){t=t??H.EMPTY_OBJECT;let n=De.createIfNeeded(e);n.setQueryParameters({f:"pjson"},!0);let i=await ta.loadJson(n),r=new ta(t);if(r._resource=n,r._data=i,l(i.layers)){let s=[];for(let a=0;a<i.layers.length;a++){let c=YBe(r,i.layers[a],t);s.push(c)}await Promise.all(s)}else await YBe(r,i,t);r._computeExtent();let o=[];for(let s=0;s<r._layers.length;s++)o.push(r._layers[s].load(t.cesium3dTilesetOptions));return await Promise.all(o),r};ta._fetchJson=function(e){return e.fetchJson()};ta.loadJson=async function(e){let t=await ta._fetchJson(e);if(l(t.error)){if(console.error("Failed to fetch I3S ",e.url),l(t.error.message)&&console.error(t.error.message),l(t.error.details))for(let n=0;n<t.error.details.length;n++)console.log(t.error.details[n]);throw new oe(t.error)}return t};ta.prototype._loadBinary=async function(e){let t=await e.fetchArrayBuffer();if(t.byteLength>0&&new Uint8Array(t)[0]===123&&new TextDecoder().decode(t).includes("404"))throw new oe(`Failed to load binary: ${e.url}`);return t};ta.prototype._binarizeGltf=function(e){let n=new TextEncoder().encode(JSON.stringify(e)),i=new Uint8Array(n.byteLength+20),r={magic:new Uint8Array(i.buffer,0,4),version:new Uint32Array(i.buffer,4,1),length:new Uint32Array(i.buffer,8,1),chunkLength:new Uint32Array(i.buffer,12,1),chunkType:new Uint32Array(i.buffer,16,1),chunkData:new Uint8Array(i.buffer,20,n.byteLength)};return r.magic[0]=103,r.magic[1]=108,r.magic[2]=84,r.magic[3]=70,r.version[0]=2,r.length[0]=i.byteLength,r.chunkLength[0]=n.byteLength,r.chunkType[0]=1313821514,r.chunkData.set(n),i};var t6t=new U;function n6t(e,t){let n=e.tilingScheme,i=[],r={},o=e._lodCount,s=he.fromRadians(t.west,t.north),a=he.fromRadians(t.east,t.south),c=n.positionToTileXY(s,o),u=n.positionToTileXY(a,o);for(let d=c.x;d<=u.x;d++)for(let p=c.y;p<=u.y;p++){let g=U.fromElements(d,p,t6t),m=g.toString();if(!r.hasOwnProperty(m)){let y={x:g.x,y:g.y,level:o,tilingScheme:n,terrainProvider:e,positions:[]};r[m]=y,i.push(y)}}let f=[];for(let d=0;d<i.length;++d){let p=i[d],g=p.terrainProvider.requestTileGeometry(p.x,p.y,p.level);f.push(g)}return Promise.all(f).then(function(d){let p=[];for(let g=0;g<d.length;g++){let m={tilingScheme:n,x:i[g].x,y:i[g].y,level:i[g].level},y=d[g],A="Geographic";n._projection instanceof Ti&&(A="WebMercator");let b={projectionType:A,projection:n._projection,nativeExtent:n.tileXYToNativeRectangle(m.x,m.y,m.level),height:y._height,width:y._width,scale:y._structure.heightScale,offset:y._structure.heightOffset};if(y._encoding===om.LERC){let x=XBe.default.decode(y._buffer);b.buffer=x.pixels[0]}else b.buffer=y._buffer;p.push(b)}return p})}async function i6t(e){let t=e._geoidTiledTerrainProvider;if(l(t))try{let n=await n6t(t,e._extent);e._geoidDataList=n}catch{console.log("Error retrieving Geoid Terrain tiles - no geoid conversion will be performed.")}}ta.prototype.loadGeoidData=async function(){return l(this._geoidDataPromise)?this._geoidDataPromise:(this._geoidDataPromise=i6t(this),this._geoidDataPromise)};ta.prototype._computeExtent=function(){let e;for(let t=0;t<this._layersExtent.length;t++){let n=this._layersExtent[t];l(e)?ie.union(e,n,e):e=ie.clone(n)}this._extent=e};ta.prototype.getAttributeNames=function(){let e=[];for(let t=0;t<this._attributeStatistics.length;++t)e.push(...this._attributeStatistics[t].names);return e};ta.prototype.getAttributeValues=function(e){for(let t=0;t<this._attributeStatistics.length;++t){let n=this._attributeStatistics[t]._getValues(e);if(l(n))return n}return[]};ta.prototype.filterByAttributes=function(e){let t=[];for(let n=0;n<this._layers.length;n++){let i=this._layers[n].filterByAttributes(e);t.push(i)}return Promise.all(t)};var E0=ta;var HM={};HM.createTilesetFromIModelId=async function({iModelId:e,changesetId:t,tilesetOptions:n}){let{exports:i}=await Ea.getExports(e,t);if(i.length>0&&i.every(c=>c.status===Ea.ExportStatus.Invalid))throw new oe(`All exports for this iModel are Invalid: ${e}`);let r=i.find(c=>c.status===Ea.ExportStatus.Complete);if(!l(r))return;let o=new URL(r._links.mesh.href);o.pathname=`${o.pathname}/tileset.json`;let s=o.toString(),a=new De({url:s});return ts.fromUrl(a,n)};HM.createTilesetForRealityDataId=async function({iTwinId:e,realityDataId:t,type:n,rootDocument:i,tilesetOptions:r}){if(!l(n)||!l(i)){let c=await Ea.getRealityDataMetadata(e,t);i=c.rootDocument,n=c.type}if(![Ea.RealityDataType.Cesium3DTiles,Ea.RealityDataType.PNTS,Ea.RealityDataType.RealityMesh3DTiles,Ea.RealityDataType.Terrain3DTiles,Ea.RealityDataType.GaussianSplat3DTiles].includes(n))throw new oe(`Reality data type is not a mesh type: ${n}`);let s=await Ea.getRealityDataURL(e,t,i),a={maximumScreenSpaceError:4,...r};return ts.fromUrl(s,a)};HM.createDataSourceForRealityDataId=async function({iTwinId:e,realityDataId:t,type:n,rootDocument:i}){if(!l(n)||!l(i)){let s=await Ea.getRealityDataMetadata(e,t);i=s.rootDocument,n=s.type}if(![Ea.RealityDataType.KML,Ea.RealityDataType.GeoJSON].includes(n))throw new oe(`Reality data type is not a data source type: ${n}`);let o=await Ea.getRealityDataURL(e,t,i);return n===Ea.RealityDataType.GeoJSON?JT.load(o):lI.load(o)};HM.loadGeospatialFeatures=async function({iTwinId:e,collectionId:t,limit:n}){let i=n??1e4,r=`${Ea.apiEndpoint}geospatial-features/itwins/${e}/ogc/collections/${t}/items`,o=new De({url:r,headers:{Authorization:Ea._getAuthorizationHeader(),Accept:"application/vnd.bentley.itwin-platform.v1+json"},queryParameters:{limit:i,client:"CesiumJS"}});return JT.load(o)};var KBe=HM;function $Be(){}Object.defineProperties($Be.prototype,{color:{get:pe.throwInstantiationError},intensity:{get:pe.throwInstantiationError}});var JBe=$Be;var r6t=/\/$/,ZBe=new It('© <a href="https://www.mapbox.com/about/maps/">Mapbox</a> © <a href="http://www.openstreetmap.org/copyright">OpenStreetMap</a> <strong><a href="https://www.mapbox.com/map-feedback/">Improve this map</a></strong>');function wI(e){e=e??H.EMPTY_OBJECT;let t=e.styleId,n=e.accessToken;this._defaultAlpha=void 0,this._defaultNightAlpha=void 0,this._defaultDayAlpha=void 0,this._defaultBrightness=void 0,this._defaultContrast=void 0,this._defaultHue=void 0,this._defaultSaturation=void 0,this._defaultGamma=void 0,this._defaultMinificationFilter=void 0,this._defaultMagnificationFilter=void 0;let i=De.createIfNeeded(e.url??"https://api.mapbox.com/styles/v1/");this._styleId=t,this._accessToken=n;let r=e.tilesize??512;this._tilesize=r;let o=e.username??"mapbox";this._username=o;let s=l(e.scaleFactor)?"@2x":"",a=i.getUrlComponent();r6t.test(a)||(a+="/"),a+=`${this._username}/${t}/tiles/${this._tilesize}/{z}/{x}/{y}${s}`,i.url=a,i.setQueryParameters({access_token:n});let c;l(e.credit)?(c=e.credit,typeof c=="string"&&(c=new It(c))):c=ZBe,this._resource=i,this._imageryProvider=new Os({url:i,credit:c,ellipsoid:e.ellipsoid,minimumLevel:e.minimumLevel,maximumLevel:e.maximumLevel,rectangle:e.rectangle})}Object.defineProperties(wI.prototype,{url:{get:function(){return this._imageryProvider.url}},rectangle:{get:function(){return this._imageryProvider.rectangle}},tileWidth:{get:function(){return this._imageryProvider.tileWidth}},tileHeight:{get:function(){return this._imageryProvider.tileHeight}},maximumLevel:{get:function(){return this._imageryProvider.maximumLevel}},minimumLevel:{get:function(){return this._imageryProvider.minimumLevel}},tilingScheme:{get:function(){return this._imageryProvider.tilingScheme}},tileDiscardPolicy:{get:function(){return this._imageryProvider.tileDiscardPolicy}},errorEvent:{get:function(){return this._imageryProvider.errorEvent}},credit:{get:function(){return this._imageryProvider.credit}},proxy:{get:function(){return this._imageryProvider.proxy}},hasAlphaChannel:{get:function(){return this._imageryProvider.hasAlphaChannel}}});wI.prototype.getTileCredits=function(e,t,n){};wI.prototype.requestImage=function(e,t,n,i){return this._imageryProvider.requestImage(e,t,n,i)};wI.prototype.pickFeatures=function(e,t,n,i,r){return this._imageryProvider.pickFeatures(e,t,n,i,r)};wI._defaultCredit=ZBe;var QBe=wI;var o6t=0,s6t=14,a6t=-1e3,c6t=1e4,l6t=2*Math.PI*ee.WGS84.maximumRadius,u6t=256,f6t=new ie,d6t=new ie,uae=class{constructor(t,n){n=n??{},this._resource=De.createIfNeeded(t),this._urlTemplate=this._resource.url,this._extent=ie.clone(n.extent),this._minZoom=n.minZoom??o6t,this._maxZoom=n.maxZoom??s6t,this._featureIdProperty=n.featureIdProperty,this._heightReference=n.heightReference,this._scene=n.scene,this._show=!0,this._tileset=void 0,this._tilesetJsonUrl=void 0}static async fromUrl(t,n){let i=new this(t,n);return await i._initializeTileset(),i}get urlTemplate(){return this._urlTemplate}get resource(){return this._resource}get extent(){return this._extent}get tileset(){return this._tileset}get show(){return this._show}set show(t){this._show=t,l(this._tileset)&&(this._tileset.show=t)}_createRuntimeTilesetOptions(){return{minZoom:this._minZoom,maxZoom:this._maxZoom,extent:this._extent}}_createTilesetLoadOptions(){return{heightReference:this._heightReference,scene:this._scene}}_configureTileset(t){}_createCodec(){}async _initializeTileset(){let t=h6t(this._resource,this._createRuntimeTilesetOptions()),n=new Blob([JSON.stringify(t)],{type:"application/json"}),i=URL.createObjectURL(n);this._tilesetJsonUrl=i;try{this._tileset=await ts.fromUrl(i,this._createTilesetLoadOptions())}catch(r){throw URL.revokeObjectURL(i),this._tilesetJsonUrl=void 0,r}URL.revokeObjectURL(i),this._tilesetJsonUrl=void 0,this._configureTileset(this._tileset),this._tileset._runtimeContentCodec=this._createCodec(),this._tileset.show=this._show}update(t){l(this._tileset)&&this._tileset.update(t)}prePassesUpdate(t){l(this._tileset)&&this._tileset.prePassesUpdate(t)}postPassesUpdate(t){l(this._tileset)&&this._tileset.postPassesUpdate(t)}updateForPass(t,n){l(this._tileset)&&this._tileset.updateForPass(t,n)}isDestroyed(){return!1}destroy(){return l(this._tileset)&&(this._tileset.destroy(),this._tileset=void 0),l(this._tilesetJsonUrl)&&(URL.revokeObjectURL(this._tilesetJsonUrl),this._tilesetJsonUrl=void 0),this._resource=void 0,this._extent=void 0,this._featureIdProperty=void 0,le(this)}};function h6t(e,t){let n=new Uo,i=l(t.extent)?ie.clone(t.extent):ie.clone(n.rectangle),r=p6t(n,i,t.minZoom),o={boundingVolume:{region:n2e(i)},geometricError:t2e(0),refine:"REPLACE",children:[]};for(let s=r.minY;s<=r.maxY;s++)for(let a=r.minX;a<=r.maxX;a++){let c=e2e(n,e,i,t.minZoom,t.maxZoom,a,s);l(c)&&o.children.push(c)}return o.children.length===0&&(o.geometricError=0),{asset:{version:"1.1"},geometricError:o.geometricError,root:o}}function e2e(e,t,n,i,r,o,s){if(!g6t(e,i,o,s,n,f6t,d6t))return;let a=e.tileXYToRectangle(o,s,i,new ie),c={boundingVolume:{region:n2e(a)},geometricError:i<r?t2e(i):0,refine:"REPLACE",content:{uri:m6t(t,i,o,s)}};if(i>=r)return c;let u=i+1,f=[];for(let d=s*2;d<=s*2+1;d++)for(let p=o*2;p<=o*2+1;p++){let g=e2e(e,t,n,u,r,p,d);l(g)&&f.push(g)}return f.length>0?c.children=f:c.geometricError=0,c}function m6t(e,t,n,i){let o=e.url.replace(/\{z\}/gi,`${t}`).replace(/\{x\}/gi,`${n}`).replace(/\{y\}/gi,`${i}`);return fh(o)}function t2e(e){return l6t/((1<<e)*u6t)}function n2e(e){return[e.west,e.south,e.east,e.north,a6t,c6t]}function p6t(e,t,n){let i=(1<<n)-1,r=he.fromRadians(t.west,t.north),o=he.fromRadians(t.east,t.south),s=e.positionToTileXY(r,n),a=e.positionToTileXY(o,n);return!l(s)||!l(a)||t.west>t.east?{minX:0,maxX:i,minY:0,maxY:i}:{minX:P.clamp(Math.min(s.x,a.x),0,i),maxX:P.clamp(Math.max(s.x,a.x),0,i),minY:P.clamp(Math.min(s.y,a.y),0,i),maxY:P.clamp(Math.max(s.y,a.y),0,i)}}function g6t(e,t,n,i,r,o,s){let a=e.tileXYToRectangle(n,i,t,o);return l(ie.intersection(a,r,s))}var B7=uae;var k7=class extends B7{static async fromUrl(t,n){return super.fromUrl(t,n)}_createTilesetLoadOptions(){return{...super._createTilesetLoadOptions(),skipLevelOfDetail:!1,enablePick:!0,featureIdLabel:"featureId_0",instanceFeatureIdLabel:"instanceFeatureId_0"}}_configureTileset(t){t._modelUpAxis=qi.Z,t._modelForwardAxis=qi.X}_createCodec(){let t=this._featureIdProperty;return{contentType:"mvt",missingTilePolicy:{statusCodes:[404,204]},createContent:async(n,i,r,o)=>{let s=C7(o),a=i2e(r.getUrlComponent(!0)),c=h7(s,a,{featureIdProperty:t});if(!l(c)){if(!_6t(s))return new wg(n,i);throw new oe("Decoded MVT tile did not produce vector glTF content.")}return Ux.fromGltf(n,i,r,c)}}}};function i2e(e){let t=e.match(/\/(\d+)\/(\d+)\/(\d+)(?:\.[^/?#]+)?(?:[?#]|$)/i);return t?{tileZ:parseInt(t[1],10),tileX:parseInt(t[2],10),tileY:parseInt(t[3],10)}:(yt("MVTDataProvider.parseTileCoordinates",`MVT tile URL did not match /{z}/{x}/{y} pattern. Falling back to z/x/y = 0/0/0. URL: ${e}`),{tileZ:0,tileX:0,tileY:0})}function _6t(e){let t=e.layers;for(let n=0;n<t.length;n++)if(t[n].features.length>0)return!0;return!1}k7._parseTileCoordinates=i2e;var r2e=k7;function fae(e){}fae.prototype.isReady=function(){return!0};fae.prototype.shouldDiscardImage=function(e){return!1};var o2e=fae;var y6t=new It("MapQuest, Open Street Map and contributors, CC-BY-SA");function U7(e){e=e??H.EMPTY_OBJECT;let t=De.createIfNeeded(e.url??"https://tile.openstreetmap.org/");t.appendForwardSlash(),t.url+=`{z}/{x}/{y}${e.retinaTiles?"@2x":""}.${e.fileExtension??"png"}`;let n=new Uo({ellipsoid:e.ellipsoid}),i=256,r=256,o=e.minimumLevel??0,s=e.maximumLevel,a=e.rectangle??n.rectangle,c=n.positionToTileXY(ie.southwest(a),o),u=n.positionToTileXY(ie.northeast(a),o),f=(Math.abs(u.x-c.x)+1)*(Math.abs(u.y-c.y)+1),d=e.credit??y6t;typeof d=="string"&&(d=new It(d)),Os.call(this,{url:t,credit:d,tilingScheme:n,tileWidth:i,tileHeight:r,minimumLevel:o,maximumLevel:s,rectangle:a})}l(Object.create)&&(U7.prototype=Object.create(Os.prototype),U7.prototype.constructor=U7);var sb=U7;function s2e(){pe.throwInstantiationError()}Object.defineProperties(s2e.prototype,{show:{get:pe.throwInstantiationError,set:pe.throwInstantiationError},transform:{get:pe.throwInstantiationError},credit:{get:pe.throwInstantiationError}});var a2e=s2e;function z7(){pe.throwInstantiationError()}Object.defineProperties(z7.prototype,{});z7.fromUrl=function(e){pe.throwInstantiationError()};z7.prototype.loadPanorama=function(e){pe.throwInstantiationError()};var c2e=z7;var A6t=new U(1,1);function dae(e){e=e??H.EMPTY_OBJECT,this.mass=e.mass??1,this.position=h.clone(e.position??h.ZERO),this.velocity=h.clone(e.velocity??h.ZERO),this.life=e.life??Number.MAX_VALUE,this.image=e.image,this.startColor=z.clone(e.startColor??z.WHITE),this.endColor=z.clone(e.endColor??z.WHITE),this.startScale=e.startScale??1,this.endScale=e.endScale??1,this.imageSize=U.clone(e.imageSize??A6t),this._age=0,this._normalizedAge=0,this._billboard=void 0}Object.defineProperties(dae.prototype,{age:{get:function(){return this._age}},normalizedAge:{get:function(){return this._normalizedAge}}});var l2e=new h;dae.prototype.update=function(e,t){return h.multiplyByScalar(this.velocity,e,l2e),h.add(this.position,l2e,this.position),l(t)&&t(this,e),this._age+=e,this.life===Number.MAX_VALUE?this._normalizedAge=0:this._normalizedAge=this._age/this.life,this._age<=this.life};var GM=dae;function u2e(e){e=e??H.EMPTY_OBJECT,this.time=e.time??0,this.minimum=e.minimum??0,this.maximum=e.maximum??50,this._complete=!1}Object.defineProperties(u2e.prototype,{complete:{get:function(){return this._complete}}});var f2e=u2e;function d2e(e){}d2e.prototype.emit=function(e){pe.throwInstantiationError()};var h2e=d2e;var m2e=new U(1,1);function WM(e){e=e??H.EMPTY_OBJECT,this.show=e.show??!0,this.updateCallback=e.updateCallback,this.loop=e.loop??!0,this.image=e.image??void 0;let t=e.emitter;l(t)||(t=new p7(.5)),this._emitter=t,this._bursts=e.bursts,this._modelMatrix=M.clone(e.modelMatrix??M.IDENTITY),this._emitterModelMatrix=M.clone(e.emitterModelMatrix??M.IDENTITY),this._matrixDirty=!0,this._combinedMatrix=new M,this._startColor=z.clone(e.color??e.startColor??z.WHITE),this._endColor=z.clone(e.color??e.endColor??z.WHITE),this._startScale=e.scale??e.startScale??1,this._endScale=e.scale??e.endScale??1,this._emissionRate=e.emissionRate??5,this._minimumSpeed=e.speed??e.minimumSpeed??1,this._maximumSpeed=e.speed??e.maximumSpeed??1,this._minimumParticleLife=e.particleLife??e.minimumParticleLife??5,this._maximumParticleLife=e.particleLife??e.maximumParticleLife??5,this._minimumMass=e.mass??e.minimumMass??1,this._maximumMass=e.mass??e.maximumMass??1,this._minimumImageSize=U.clone(e.imageSize??e.minimumImageSize??m2e),this._maximumImageSize=U.clone(e.imageSize??e.maximumImageSize??m2e),this._sizeInMeters=e.sizeInMeters??!1,this._lifetime=e.lifetime??Number.MAX_VALUE,this._billboardCollection=void 0,this._particles=[],this._particlePool=[],this._previousTime=void 0,this._currentTime=0,this._carryOver=0,this._complete=new be,this._isComplete=!1,this._updateParticlePool=!0,this._particleEstimate=0}Object.defineProperties(WM.prototype,{emitter:{get:function(){return this._emitter},set:function(e){this._emitter=e}},bursts:{get:function(){return this._bursts},set:function(e){this._bursts=e,this._updateParticlePool=!0}},modelMatrix:{get:function(){return this._modelMatrix},set:function(e){this._matrixDirty=this._matrixDirty||!M.equals(this._modelMatrix,e),M.clone(e,this._modelMatrix)}},emitterModelMatrix:{get:function(){return this._emitterModelMatrix},set:function(e){this._matrixDirty=this._matrixDirty||!M.equals(this._emitterModelMatrix,e),M.clone(e,this._emitterModelMatrix)}},startColor:{get:function(){return this._startColor},set:function(e){z.clone(e,this._startColor)}},endColor:{get:function(){return this._endColor},set:function(e){z.clone(e,this._endColor)}},startScale:{get:function(){return this._startScale},set:function(e){this._startScale=e}},endScale:{get:function(){return this._endScale},set:function(e){this._endScale=e}},emissionRate:{get:function(){return this._emissionRate},set:function(e){this._emissionRate=e,this._updateParticlePool=!0}},minimumSpeed:{get:function(){return this._minimumSpeed},set:function(e){this._minimumSpeed=e}},maximumSpeed:{get:function(){return this._maximumSpeed},set:function(e){this._maximumSpeed=e}},minimumParticleLife:{get:function(){return this._minimumParticleLife},set:function(e){this._minimumParticleLife=e}},maximumParticleLife:{get:function(){return this._maximumParticleLife},set:function(e){this._maximumParticleLife=e,this._updateParticlePool=!0}},minimumMass:{get:function(){return this._minimumMass},set:function(e){this._minimumMass=e}},maximumMass:{get:function(){return this._maximumMass},set:function(e){this._maximumMass=e}},minimumImageSize:{get:function(){return this._minimumImageSize},set:function(e){this._minimumImageSize=e}},maximumImageSize:{get:function(){return this._maximumImageSize},set:function(e){this._maximumImageSize=e}},sizeInMeters:{get:function(){return this._sizeInMeters},set:function(e){this._sizeInMeters=e}},lifetime:{get:function(){return this._lifetime},set:function(e){this._lifetime=e}},complete:{get:function(){return this._complete}},isComplete:{get:function(){return this._isComplete}}});function b6t(e){let t=e._emissionRate,n=e._maximumParticleLife,i=0,r=e._bursts;if(l(r)){let d=r.length;for(let p=0;p<d;++p)i+=r[p].maximum}let o=e._billboardCollection,s=e.image,a=Math.ceil(t*n+i),c=e._particles,u=e._particlePool,f=Math.max(a-c.length-u.length,0);for(let d=0;d<f;++d){let p=new GM;p._billboard=o.add({image:s,show:!1}),u.push(p)}e._particleEstimate=a}function x6t(e){let t=e._particlePool.pop();return l(t)||(t=new GM),t}function T6t(e,t){e._particlePool.push(t)}function E6t(e){let t=e._particles,n=e._particlePool,i=e._billboardCollection,r=t.length,o=n.length,s=e._particleEstimate,a=o-Math.max(s-r-o,0);for(let c=a;c<o;++c){let u=n[c];i.remove(u._billboard)}n.length=a}function C6t(e){l(e._billboard)&&(e._billboard.show=!1)}function p2e(e,t){let n=t._billboard;l(n)||(n=t._billboard=e._billboardCollection.add({image:t.image})),n.width=t.imageSize.x,n.height=t.imageSize.y,n.position=t.position,n.sizeInMeters=e.sizeInMeters,n.show=!0;let i=P.lerp(t.startColor.red,t.endColor.red,t.normalizedAge),r=P.lerp(t.startColor.green,t.endColor.green,t.normalizedAge),o=P.lerp(t.startColor.blue,t.endColor.blue,t.normalizedAge),s=P.lerp(t.startColor.alpha,t.endColor.alpha,t.normalizedAge);n.color=new z(i,r,o,s),n.scale=P.lerp(t.startScale,t.endScale,t.normalizedAge)}function v6t(e,t){t.startColor=z.clone(e._startColor,t.startColor),t.endColor=z.clone(e._endColor,t.endColor),t.startScale=e._startScale,t.endScale=e._endScale,t.image=e.image,t.life=P.randomBetween(e._minimumParticleLife,e._maximumParticleLife),t.mass=P.randomBetween(e._minimumMass,e._maximumMass),t.imageSize.x=P.randomBetween(e._minimumImageSize.x,e._maximumImageSize.x),t.imageSize.y=P.randomBetween(e._minimumImageSize.y,e._maximumImageSize.y),t._normalizedAge=0,t._age=0;let n=P.randomBetween(e._minimumSpeed,e._maximumSpeed);h.multiplyByScalar(t.velocity,n,t.velocity),e._particles.push(t)}function S6t(e,t){if(e._isComplete)return 0;t=P.mod(t,e._lifetime);let n=t*e._emissionRate,i=Math.floor(n);if(e._carryOver+=n-i,e._carryOver>1&&(i++,e._carryOver-=1),l(e.bursts)){let r=e.bursts.length;for(let o=0;o<r;o++){let s=e.bursts[o],a=e._currentTime;l(s)&&!s._complete&&a>s.time&&(i+=P.randomBetween(s.minimum,s.maximum),s._complete=!0)}}return i}var V7=new h;WM.prototype.update=function(e){if(!this.show)return;l(this._billboardCollection)||(this._billboardCollection=new ud),this._updateParticlePool&&(b6t(this),this._updateParticlePool=!1);let t=0;this._previousTime&&(t=K.secondsDifference(e.time,this._previousTime)),t<0&&(t=0);let n=this._particles,i=this._emitter,r=this.updateCallback,o,s,a=n.length;for(o=0;o<a;++o)s=n[o],s.update(t,r)?p2e(this,s):(C6t(s),T6t(this,s),n[o]=n[a-1],--o,--a);n.length=a;let c=S6t(this,t);if(c>0&&l(i)){this._matrixDirty&&(this._combinedMatrix=M.multiply(this.modelMatrix,this.emitterModelMatrix,this._combinedMatrix),this._matrixDirty=!1);let u=this._combinedMatrix;for(o=0;o<c;o++)s=x6t(this),this._emitter.emit(s),h.add(s.position,s.velocity,V7),M.multiplyByPoint(u,V7,V7),s.position=M.multiplyByPoint(u,s.position,s.position),h.subtract(V7,s.position,s.velocity),h.normalize(s.velocity,s.velocity),v6t(this,s),p2e(this,s)}if(this._billboardCollection.update(e),this._previousTime=K.clone(e.time,this._previousTime),this._currentTime+=t,this._lifetime!==Number.MAX_VALUE&&this._currentTime>this._lifetime)if(this.loop){if(this._currentTime=P.mod(this._currentTime,this._lifetime),this.bursts){let u=this.bursts.length;for(o=0;o<u;o++)this.bursts[o]._complete=!1}}else this._isComplete=!0,this._complete.raiseEvent(this);e.frameNumber%120===0&&E6t(this)};WM.prototype.isDestroyed=function(){return!1};WM.prototype.destroy=function(){return this._billboardCollection=this._billboardCollection&&this._billboardCollection.destroy(),le(this)};var g2e=WM;var hae=class{constructor(){ut(this,"quadtree");ut(this,"tilingScheme");ut(this,"errorEvent");pe.throwInstantiationError()}static computeDefaultLevelZeroMaximumGeometricError(t){return t.ellipsoid.maximumRadius*2*Math.PI*.25/(65*t.getNumberOfXTilesAtLevel(0))}update(t,n){pe.throwInstantiationError()}beginUpdate(t,n,i){pe.throwInstantiationError()}endUpdate(t,n,i){pe.throwInstantiationError()}getLevelMaximumGeometricError(t){pe.throwInstantiationError()}loadTile(t,n,i){pe.throwInstantiationError()}computeTileVisibility(t,n,i){pe.throwInstantiationError()}showTileThisFrame(t,n,i,r){pe.throwInstantiationError()}computeDistanceToTile(t,n){pe.throwInstantiationError()}isDestroyed(){pe.throwInstantiationError()}destroy(){pe.throwInstantiationError()}},_2e=hae;function mae(e){e=e??1,this._radius=e??1}Object.defineProperties(mae.prototype,{radius:{get:function(){return this._radius},set:function(e){this._radius=e}}});mae.prototype.emit=function(e){let t=P.randomBetween(0,P.TWO_PI),n=P.randomBetween(0,P.PI),i=P.randomBetween(0,this._radius),r=i*Math.cos(t)*Math.sin(n),o=i*Math.sin(t)*Math.sin(n),s=i*Math.cos(n);e.position=h.fromElements(r,o,s,e.position),e.velocity=h.normalize(e.position,e.velocity)};var y2e=mae;function qM(){}qM.prototype.evaluate=function(e,t){pe.throwInstantiationError()};qM.prototype.evaluateColor=function(e,t){pe.throwInstantiationError()};qM.prototype.getShaderFunction=function(e,t,n,i){pe.throwInstantiationError()};qM.prototype.getVariables=function(){pe.throwInstantiationError()};var A2e=qM;function II(e){this._ready=!1,this._provider=void 0,this._errorEvent=new be,this._readyEvent=new be,I6t(this,e)}Object.defineProperties(II.prototype,{errorEvent:{get:function(){return this._errorEvent}},readyEvent:{get:function(){return this._readyEvent}},ready:{get:function(){return this._ready}},provider:{get:function(){return this._provider}}});II.fromWorldTerrain=function(e){return new II(_I(e))};II.fromWorldBathymetry=function(e){return new II($9(e))};function w6t(e,t){e.numberOfListeners>0?e.raiseEvent(t):console.error(t)}async function I6t(e,t){let n;try{n=await Promise.resolve(t),e._provider=n,e._ready=!0,e._readyEvent.raiseEvent(n)}catch(i){w6t(e._errorEvent,i)}}var j7=II;function PI(){}PI.prototype.boundingVolume=void 0;PI.prototype.boundingSphere=void 0;PI.prototype.distanceToCamera=function(e){pe.throwInstantiationError()};PI.prototype.intersectPlane=function(e){pe.throwInstantiationError()};PI.prototype.createDebugVolume=function(e){pe.throwInstantiationError()};var b2e=PI;function YM(e){e=e??H.EMPTY_OBJECT,this._tilingScheme=l(e.tilingScheme)?e.tilingScheme:new ir({ellipsoid:e.ellipsoid}),this._color=e.color??z.YELLOW,this._errorEvent=new be,this._tileWidth=e.tileWidth??256,this._tileHeight=e.tileHeight??256,this._defaultAlpha=void 0,this._defaultNightAlpha=void 0,this._defaultDayAlpha=void 0,this._defaultBrightness=void 0,this._defaultContrast=void 0,this._defaultHue=void 0,this._defaultSaturation=void 0,this._defaultGamma=void 0,this._defaultMinificationFilter=void 0,this._defaultMagnificationFilter=void 0}Object.defineProperties(YM.prototype,{proxy:{get:function(){}},tileWidth:{get:function(){return this._tileWidth}},tileHeight:{get:function(){return this._tileHeight}},maximumLevel:{get:function(){}},minimumLevel:{get:function(){}},tilingScheme:{get:function(){return this._tilingScheme}},rectangle:{get:function(){return this._tilingScheme.rectangle}},tileDiscardPolicy:{get:function(){}},errorEvent:{get:function(){return this._errorEvent}},credit:{get:function(){}},hasAlphaChannel:{get:function(){return!0}}});YM.prototype.getTileCredits=function(e,t,n){};YM.prototype.requestImage=function(e,t,n,i){let r=document.createElement("canvas");r.width=256,r.height=256;let o=r.getContext("2d"),s=this._color.toCssColorString();return o.strokeStyle=s,o.lineWidth=2,o.strokeRect(1,1,255,255),o.font="bold 25px Arial",o.textAlign="center",o.fillStyle=s,o.fillText(`L: ${n}`,124,86),o.fillText(`X: ${e}`,124,136),o.fillText(`Y: ${t}`,124,186),Promise.resolve(r)};YM.prototype.pickFeatures=function(e,t,n,i,r){};var H7=YM;function pae(e){pe.throwInstantiationError()}pae.prototype.isReady=pe.throwInstantiationError;pae.prototype.shouldDiscardImage=pe.throwInstantiationError;var x2e=pae;var T2e={START:0,LOADING:1,READY:2,UPSAMPLED_ONLY:3};Object.freeze(T2e);var E2e=T2e;function G7(e,t){this.show=!0,l(e)||(e=new et),this.rectangle=et.clone(e),l(t)||(t=rr.fromType(rr.ColorType,{color:new z(1,1,1,1)})),this.material=t,this._material=void 0,this._overlayCommand=void 0,this._rs=void 0}G7.prototype.update=function(e){if(!this.show)return;let t=this._rs;if((!l(t)||!et.equals(t.viewport,this.rectangle))&&(this._rs=Ge.fromCache({blending:nn.ALPHA_BLEND,viewport:this.rectangle})),e.passes.render){let i=e.context;if(this._material!==this.material||!l(this._overlayCommand)){this._material=this.material,l(this._overlayCommand)&&this._overlayCommand.shaderProgram.destroy();let r=new Xe({sources:[this._material.shaderSource,ok]});this._overlayCommand=i.createViewportQuadCommand(r,{renderState:this._rs,uniformMap:this._material._uniforms,owner:this}),this._overlayCommand.pass=Ie.OVERLAY}this._material.update(i),this._overlayCommand.renderState=this._rs,this._overlayCommand.uniformMap=this._material._uniforms,e.commandList.push(this._overlayCommand)}};G7.prototype.isDestroyed=function(){return!1};G7.prototype.destroy=function(){return l(this._overlayCommand)&&(this._overlayCommand.shaderProgram=this._overlayCommand.shaderProgram&&this._overlayCommand.shaderProgram.destroy()),le(this)};var C2e=G7;var gae=class{constructor(){ut(this,"globalTransform");ut(this,"shapeTransform");ut(this,"shape");ut(this,"minBounds");ut(this,"maxBounds");ut(this,"dimensions");ut(this,"paddingBefore");ut(this,"paddingAfter");ut(this,"names");ut(this,"types");ut(this,"componentTypes");ut(this,"minimumValues");ut(this,"maximumValues");ut(this,"maximumTileCount");ut(this,"availableLevels");ut(this,"keyframeCount");ut(this,"timeIntervalCollection");pe.throwInstantiationError()}requestData(t){pe.throwInstantiationError()}},v2e=gae;function y_(){pe.throwInstantiationError()}Object.defineProperties(y_.prototype,{orientedBoundingBox:{get:pe.throwInstantiationError},boundingSphere:{get:pe.throwInstantiationError},boundTransform:{get:pe.throwInstantiationError},shapeTransform:{get:pe.throwInstantiationError},shaderUniforms:{get:pe.throwInstantiationError},shaderDefines:{get:pe.throwInstantiationError},shaderMaximumIntersectionsLength:{get:pe.throwInstantiationError}});y_.prototype.update=pe.throwInstantiationError;y_.prototype.updateViewTransforms=pe.throwInstantiationError;y_.prototype.convertLocalToShapeUvSpace=pe.throwInstantiationError;y_.prototype.computeOrientedBoundingBoxForTile=pe.throwInstantiationError;y_.prototype.computeOrientedBoundingBoxForSample=pe.throwInstantiationError;y_.DefaultMinBounds=pe.throwInstantiationError;y_.DefaultMaxBounds=pe.throwInstantiationError;var S2e=y_;var _ae=class{get enabled(){return pe.throwInstantiationError()}set enabled(t){pe.throwInstantiationError()}connectedCallback(t){pe.throwInstantiationError()}disconnectedCallback(t){pe.throwInstantiationError()}update(t,n){pe.throwInstantiationError()}firstUpdate(t,n){pe.throwInstantiationError()}},w2e=_ae;var I2e=new h,P6t=new sn(h.UNIT_X,0),D6t=new gn,R6t=new U(1,1,1);function C0(e,t,n,i=R6t){let{camera:r,ellipsoid:o}=e,s=o.scaleToGeodeticSurface(r.positionWC,I2e);if(!l(s))return;let a=h.magnitude(r.positionWC),c=h.magnitude(s),u=a<=c,f=o.geodeticSurfaceNormal(r.positionWC,I2e),d=h.dot(f,r.directionWC),p=d>0;if(u||p){let g=sn.fromPointNormal(r.positionWC,f,P6t),{clientHeight:m}=e.canvas,y=i.y*m/(2*Math.tan(r.frustum.fovy*.5));g.distance-=d*y;let A=r.getPickRay(t,D6t);return xi.rayPlane(A,g,n)}return r.pickEllipsoid(t,o,n)}var P2e={LEFT:0,MIDDLE:1,RIGHT:2};Object.freeze(P2e);var hc=P2e;function O6t(e){if(e===hc.LEFT)return fn.LEFT_DOWN;if(e===hc.MIDDLE)return fn.MIDDLE_DOWN;if(e===hc.RIGHT)return fn.RIGHT_DOWN}function M6t(e){if(e===hc.LEFT)return fn.LEFT_UP;if(e===hc.MIDDLE)return fn.MIDDLE_UP;if(e===hc.RIGHT)return fn.RIGHT_UP}var yae=class{static registerDragInputBindings(t,n,i){let r=new Set,o={isDragging:!1};for(let s of n){o.isDragging=!1;let a=O6t(s.button),c=M6t(s.button);l(a)&&t.setInputAction((...u)=>{o.isDragging=!0,l(i.start)&&i.start(...u)},a,s.modifier),l(c)&&(t.setInputAction((...u)=>{o.isDragging&&(o.isDragging=!1,l(i.end)&&i.end(...u))},c,s.modifier),t.setInputAction((...u)=>{o.isDragging&&(o.isDragging=!1,l(i.end)&&i.end(...u))},c)),r.add(s.modifier)}for(let s of r)t.setInputAction((...a)=>{o.isDragging&&l(i.change)&&i.change(...a)},fn.MOUSE_MOVE,s);return o}},v0=yae;var Aae=class e{static _getDefaultDragInputs(){return[Object.freeze({button:hc.LEFT})]}constructor(t=H.EMPTY_OBJECT){this._enabled=!0,this._handler=void 0,this._lastUpdateTime=void 0,this.dragInputs=t.dragInputs??e._getDefaultDragInputs(),this._dragInputState=void 0,this._panDelta=new U,this._panPosition=new U,this.pickWorldPosition=C0,this._ellipsoidNormal=new h,this._ellipsoidSurfacePosition=new h,this._panDirectionX=new h,this._panDirectionY=new h,this._pixelSize=new U,this._panVelocity=new U,this.panSpeed=1,this.inertiaEnabled=!0,this.inertialDecay=6,this.maximumMovementRatio=.1}get enabled(){return this._enabled}set enabled(t){this._enabled=t,t?(this._lastUpdateTime=xn(),this._panDelta.x=0,this._panDelta.y=0):l(this._dragInputState)&&(this._dragInputState.isDragging=!1)}get isDragging(){return l(this._dragInputState)&&this._dragInputState.isDragging}connectedCallback(t){let n=new xa(t);this._handler=n,this._dragInputState=v0.registerDragInputBindings(n,this.dragInputs,{start:this._handleStartPan.bind(this),change:this._handlePan.bind(this)})}disconnectedCallback(t){let n=this._handler;l(n)&&!n.isDestroyed()&&n.destroy()}firstUpdate(){this._lastUpdateTime=xn(),this._panDelta.x=0,this._panDelta.y=0}update(t){let n=(xn()-this._lastUpdateTime)*Un.SECONDS_PER_MILLISECOND,{camera:i,ellipsoid:r,canvas:o}=t,s=-this._panDelta.x,a=this._panDelta.y;if(this.inertiaEnabled&&!this.isDragging){let E=Math.exp(-this.inertialDecay*n);this._panVelocity.x*=E,this._panVelocity.y*=E,s=this._panVelocity.x*n,a=this._panVelocity.y*n}let{clientWidth:c,clientHeight:u}=o;if(n===0||c===0||u===0||Math.abs(s)<=P.EPSILON3&&Math.abs(a)<=P.EPSILON3){this._lastUpdateTime=xn(),this._panDelta.x=0,this._panDelta.y=0;return}let f=this._panPosition,d=this.pickWorldPosition(t,f,this._ellipsoidSurfacePosition);l(d)||(d=r.scaleToGeodeticSurface(i.positionWC,this._ellipsoidSurfacePosition));let p=h.clone(i.rightWC,this._panDirectionX);p=h.normalize(p,this._panDirectionX);let g=h.normalize(d,this._panDirectionY),m=h.distance(i.positionWC,d),{drawingBufferWidth:y,drawingBufferHeight:A,pixelRatio:b}=t,x=i.frustum.getPixelDimensions(y,A,m,b,this._pixelSize),T=this.maximumMovementRatio*Math.max(c,u);s=P.clamp(s,-T,T),this._panVelocity.x=s/n,s*=this.panSpeed*x.x,a=P.clamp(a,-T,T),this._panVelocity.y=a/n,a*=this.panSpeed*x.y,i.move(p,s),i.move(g,a),this._lastUpdateTime=xn(),this._panDelta.x=0,this._panDelta.y=0}_handleStartPan(){this.enabled&&(this._panDelta.x=0,this._panDelta.y=0)}_handlePan(t){this._panDelta.x+=t.endPosition.x-t.startPosition.x,this._panDelta.y+=t.endPosition.y-t.startPosition.y,this._panPosition.x=t.endPosition.x,this._panPosition.y=t.endPosition.y}},W7=Aae;var bae=class e{static _getDefaultDragInputs(){return[Object.freeze({button:hc.LEFT})]}constructor(t=H.EMPTY_OBJECT){this._enabled=!0,this._handler=void 0,this._lastUpdateTime=void 0,this.dragInputs=t.dragInputs??e._getDefaultDragInputs(),this._dragInputState=void 0,this._panDelta=new U,this._panPosition=new U,this.pickWorldPosition=C0,this._ellipsoidNormal=new h,this._ellipsoidSurfacePosition=new h,this._panDirectionX=new h,this._panDirectionY=new h,this._pixelSize=new U,this._panVelocity=new U,this.panSpeed=1,this.inertiaEnabled=!0,this.inertialDecay=6,this.maximumMovementRatio=.1}get enabled(){return this._enabled}set enabled(t){this._enabled=t,t?(this._panDelta.x=0,this._panDelta.y=0):l(this._dragInputState)&&(this._dragInputState.isDragging=!1)}get isDragging(){return l(this._dragInputState)&&this._dragInputState.isDragging}connectedCallback(t){let n=new xa(t);this._handler=n,this._dragInputState=v0.registerDragInputBindings(n,this.dragInputs,{start:this._handleStartPan.bind(this),change:this._handlePan.bind(this)})}disconnectedCallback(t){let n=this._handler;l(n)&&!n.isDestroyed()&&n.destroy()}firstUpdate(){this._lastUpdateTime=xn(),this._panDelta.x=0,this._panDelta.y=0}update(t){let n=(xn()-this._lastUpdateTime)*Un.SECONDS_PER_MILLISECOND,i=-this._panDelta.x,r=this._panDelta.y;if(this.inertiaEnabled&&!this.isDragging){let S=Math.exp(-this.inertialDecay*n);this._panVelocity.x*=S,this._panVelocity.y*=S,i=this._panVelocity.x*n,r=this._panVelocity.y*n}let{camera:o,ellipsoid:s,canvas:a}=t,{clientWidth:c,clientHeight:u}=a;if(n===0||c===0||u===0||Math.abs(i)<=P.EPSILON3&&Math.abs(r)<=P.EPSILON3){this._lastUpdateTime=xn(),this._panDelta.x=0,this._panDelta.y=0;return}let f=this._panPosition,d=this.pickWorldPosition(t,f,this._ellipsoidSurfacePosition);l(d)||(d=s.scaleToGeodeticSurface(o.positionWC,this._ellipsoidSurfacePosition));let p=s.geodeticSurfaceNormal(d,this._ellipsoidNormal),g=h.clone(o.rightWC,this._panDirectionX);g=h.normalize(g,this._panDirectionX);let m=h.clone(o.upWC,this._panDirectionY),y=Math.abs(h.dot(p,o.directionWC));P.lessThan(y,1,P.EPSILON6)&&(m=h.cross(p,g,this._panDirectionY)),m=h.normalize(m,this._panDirectionY);let A=h.distance(o.positionWC,d),{drawingBufferWidth:b,drawingBufferHeight:x,pixelRatio:T}=t,E=o.frustum.getPixelDimensions(b,x,A,T,this._pixelSize),v=this.maximumMovementRatio*Math.max(c,u);i=P.clamp(i,-v,v),this._panVelocity.x=i/n,i*=this.panSpeed*E.x,r=P.clamp(r,-v,v),this._panVelocity.y=r/n,r*=this.panSpeed*E.y,o.move(g,i),o.move(m,r),this._lastUpdateTime=xn(),this._panDelta.x=0,this._panDelta.y=0}_handleStartPan(t){this.enabled&&(this._panDelta.x=0,this._panDelta.y=0)}_handlePan(t){this._panDelta.x+=t.endPosition.x-t.startPosition.x,this._panDelta.y+=t.endPosition.y-t.startPosition.y,this._panPosition.x=t.endPosition.x,this._panPosition.y=t.endPosition.y}},q7=bae;var xae=class{constructor(){this._elevatorController=new W7,this._mapController=new q7,this._enabled=!0,this._ellipsoidNormal=new h,this.angleThreshold=P.toRadians(125)}get enabled(){return this._enabled}set enabled(t){this._enabled=t}get elevatorController(){return this._elevatorController}get mapController(){return this._mapController}connectedCallback(t){this._elevatorController.connectedCallback(t),this._mapController.connectedCallback(t)}disconnectedCallback(t){this._elevatorController.disconnectedCallback(t),this._mapController.disconnectedCallback(t)}firstUpdate(){this._elevatorController.firstUpdate(),this._mapController.firstUpdate()}update(t){let n=t.camera,i=t.ellipsoid.geodeticSurfaceNormal(n.positionWC,this._ellipsoidNormal),r=Math.abs(h.angleBetween(i,n.directionWC));(r<this.angleThreshold&&r>Math.PI-this.angleThreshold?this._elevatorController:this._mapController).update(t)}},D2e=xae;var Tae=class e{static _getDefaultDragInputs(){return[Object.freeze({button:hc.LEFT,modifier:oo.CTRL}),Object.freeze({button:hc.RIGHT})]}constructor(t=H.EMPTY_OBJECT){this._enabled=!0,this._handler=void 0,this._lastUpdateTime=void 0,this.tiltEnabled=!0,this.orbitEnabled=!0,this.useDragPosition=!1,this.dragInputs=t.dragInputs??e._getDefaultDragInputs(),this._dragInputState=void 0,this._dragDelta=new U,this._screenSpaceDragPosition=new U,this._screenSpaceOrigin=new U,this.pickWorldPosition=C0,this._hasTarget=!1,this._target=new h,this._axis=new h,this.tiltMagnitude=2,this.dampingEnabled=!0,this.tiltAnimationDuration=.0045,this.maximumTiltVelocity=P.PI,this.minimumTiltVelocity=P.EPSILON20,this.orbitMagnitude=2,this.orbitAnimationDuration=.0045,this.maximumOrbitVelocity=P.TWO_PI,this.minimumOrbitVelocity=P.EPSILON20,this._tiltAxis=new h,this._tiltQuaternion=new Le,this._tiltOffset=new h,this._tiltOrigin=new h,this._tiltDampenedResults={velocity:0,value:0},this._orbitTargetEnu=new M,this._orbitTargetEast=new h,this._orbitQuaternion=new Le,this._orbitOffset=new h,this._orbitLookOffset=new h,this._orbitOrigin=new h,this._orbitDampenedResults={velocity:0,value:0},this.maximumMovementRatio=.1}get enabled(){return this._enabled}set enabled(t){this._enabled=t,t?(this._lastUpdateTime=xn(),this._dragDelta.x=0,this._dragDelta.y=0):l(this._dragInputState)&&(this._dragInputState.isDragging=!1)}get isDragging(){return l(this._dragInputState)&&this._dragInputState.isDragging}connectedCallback(t){let n=new xa(t);this._handler=n,this._dragInputState=v0.registerDragInputBindings(n,this.dragInputs,{start:this._handleStartDrag.bind(this),change:this._handleDrag.bind(this)})}disconnectedCallback(t){let n=this._handler;l(n)&&!n.isDestroyed()&&n.destroy()}firstUpdate(){this._lastUpdateTime=xn(),this._dragDelta.x=0,this._dragDelta.y=0}_handleStartDrag(t){this.enabled&&(this._hasTarget=!1,this._screenSpaceDragPosition.x=t.position.x,this._screenSpaceDragPosition.y=t.position.y,this._dragDelta.x=0,this._dragDelta.y=0)}_handleDrag(t){this._dragDelta.x+=t.endPosition.x-t.startPosition.x,this._dragDelta.y+=t.endPosition.y-t.startPosition.y}get tiltAngle(){return this._tiltDampenedResults.value}get tiltVelocity(){return this._tiltDampenedResults.velocity}set tiltVelocity(t){this._tiltDampenedResults.velocity=t}get orbitAngle(){return this._orbitDampenedResults.value}get orbitVelocity(){return this._orbitDampenedResults.velocity}set orbitVelocity(t){this._orbitDampenedResults.velocity=t}orbit(t,n,i,r,o,s=ee.default){let a=At.eastNorthUpToFixedFrame(n,s,this._orbitTargetEnu),c=M.multiplyByPointAsVector(a,h.UNIT_X,this._orbitTargetEast),u=h.angleBetween(t.directionWC,c);if(Math.abs(this.orbitVelocity)<this.minimumOrbitVelocity&&(this.orbitVelocity=0),!this.isDragging&&this.dampingEnabled&&(r+=this.orbitVelocity*o),r===0)return;let f=u+r,d=this.dampingEnabled?this.maximumOrbitVelocity*this.orbitMagnitude:void 0,p=this.dampingEnabled?this.orbitAnimationDuration:void 0;this._orbitDampenedResults=P.smoothDamp(u,f,this.orbitVelocity,o,d,p,this._orbitDampenedResults);let g=this.orbitAngle-u,m=$.fromQuaternion(Le.fromAxisAngle(i,-g,this._orbitQuaternion)),y=h.subtract(t.positionWC,n,this._orbitOffset),A=h.dot(y,t.directionWC),b=h.multiplyByScalar(t.directionWC,A,this._orbitLookOffset),x=h.subtract(y,b,this._orbitLookOffset),T=$.multiplyByVector(m,y,this._orbitOffset),E=$.multiplyByVector(m,x,this._orbitLookOffset);h.add(n,T,t.position);let v=h.add(n,E,this._orbitOrigin);t.lookAtWorldPosition(v,s)}tilt(t,n,i,r,o,s=ee.default){if(Math.abs(this.tiltVelocity)<this.minimumTiltVelocity&&(this.tiltVelocity=0),!this.isDragging&&this.dampingEnabled&&(r+=this.tiltVelocity*o),r===0)return;let a=h.angleBetween(t.direction,i);(a<P.PI_OVER_TWO&&r>0||a>P.PI_OVER_TWO&&r<0)&&(r*=Math.abs(Math.sin(a)));let c=a+r,u=this.dampingEnabled?this.maximumTiltVelocity*this.tiltMagnitude:void 0,f=this.dampingEnabled?this.tiltAnimationDuration:void 0;P.smoothDamp(a,c,this.tiltVelocity,o,u,f,this._tiltDampenedResults);let d=this.tiltAngle-a,p=$.fromQuaternion(Le.fromAxisAngle(t.rightWC,-d,this._tiltQuaternion)),g=h.subtract(t.position,n,this._tiltOffset),m=h.dot(g,t.directionWC),y=h.multiplyByScalar(t.directionWC,m,this._tiltOffset),A=h.subtract(t.position,y,this._tiltOrigin),b=$.multiplyByVector(p,y,this._tiltOffset);h.add(A,b,t.position),t.lookAtWorldPosition(A,s)}update(t){let n=(xn()-this._lastUpdateTime)*Un.SECONDS_PER_MILLISECOND,{canvas:i}=t,{clientWidth:r,clientHeight:o}=i;if(n===0||r===0||o===0){this._lastUpdateTime=xn(),this._dragDelta.x=0,this._dragDelta.y=0;return}let s=this._target;if(this.isDragging&&!this._hasTarget){let a=this._screenSpaceDragPosition;this.useDragPosition||(a=this._screenSpaceOrigin,a.x=r/2,a.y=o/2);let c=this.pickWorldPosition(t,a,this._target),u=l(c);this._hasTarget=u,s=c}if(this._hasTarget){let{camera:a,ellipsoid:c}=t,u=c.geodeticSurfaceNormal(s,this._axis),f=h.negate(u,this._axis);if(this.orbitEnabled){let d=this._dragDelta.x/r;d=P.clamp(d,-this.maximumMovementRatio,this.maximumMovementRatio),d*=this.orbitMagnitude*P.TWO_PI,this.orbit(a,s,f,d,n,c)}if(this.tiltEnabled){let d=this._dragDelta.y/o;d=P.clamp(d,-this.maximumMovementRatio,this.maximumMovementRatio),d*=this.tiltMagnitude*P.PI,this.tilt(a,s,f,d,n,c)}}this._lastUpdateTime=xn(),this._dragDelta.x=0,this._dragDelta.y=0}},R2e=Tae;var Eae=class e{static _getDefaultDragInputs(){return[Object.freeze({button:hc.MIDDLE})]}static _getDefaultScrollInputs(){return[fn.WHEEL]}constructor(t=H.EMPTY_OBJECT){this._enabled=!0,this._handler=void 0,this._lastUpdateTime=void 0,this.usePointerPosition=!1,this.dragInputs=t.dragInputs??e._getDefaultDragInputs(),this.scrollInputs=t.scrollInputs??e._getDefaultScrollInputs(),this._dragInputState=void 0,this._dragDelta=new U,this._scrollDelta=0,this._zoomInputVelocity=0,this._screenSpaceScrollPosition=new U,this._screenSpaceDragPosition=new U,this._screenSpaceOrigin=new U,this.zoomSensitivity=.2,this.pickWorldPosition=C0,this.zoomDistanceRatio=.4,this.inertiaEnabled=!1,this.inertialDecay=6,this.minimumZoomDistance=0,this.maximumZoomDistance=1e5,this.minimumZoomVelocity=P.EPSILON20,this.maximumZoomVelocity=1,this.dampingEnabled=!0,this.zoomAnimationDuration=.45,this._target=new h,this._zoomDirection=new h,this._zoomDampenedResults={velocity:0,value:0}}get enabled(){return this._enabled}set enabled(t){this._enabled=t,t?(this._lastUpdateTime=xn(),this._scrollDelta=0,this._dragDelta.x=0,this._dragDelta.y=0):l(this._dragInputState)&&(this._dragInputState.isDragging=!1)}get isDragging(){return l(this._dragInputState)&&this._dragInputState.isDragging}connectedCallback(t){let n=new xa(t);this._handler=n;for(let i of this.scrollInputs)n.setInputAction(this._handleZoom.bind(this),i);n.setInputAction(this._handleZoomPosition.bind(this),fn.MOUSE_MOVE),this._dragInputState=v0.registerDragInputBindings(n,this.dragInputs,{start:this._handleStartDrag.bind(this),change:this._handleDrag.bind(this)})}disconnectedCallback(t){let n=this._handler;l(n)&&!n.isDestroyed()&&n.destroy()}firstUpdate(){this._lastUpdateTime=xn(),this._scrollDelta=0,this._dragDelta.x=0,this._dragDelta.y=0}get zoomDistance(){return this._zoomDampenedResults.value}get zoomVelocity(){return this._zoomDampenedResults.velocity}set zoomVelocity(t){this._zoomDampenedResults.velocity=t}update(t){let i=(xn()-this._lastUpdateTime)*Un.SECONDS_PER_MILLISECOND,{canvas:r}=t,{clientWidth:o,clientHeight:s}=r;if(i===0||o===0||s===0){this._lastUpdateTime=xn(),this._scrollDelta=0,this._dragDelta.x=0,this._dragDelta.y=0;return}let a=this._scrollDelta+this._dragDelta.y;if(a===0&&this.inertiaEnabled){let A=Math.exp(-this.inertialDecay*i);this._zoomInputVelocity*=A,a=this._zoomInputVelocity*i}if(Math.abs(this.zoomVelocity)<this.minimumZoomVelocity&&a<=P.EPSILON3&&a>=-P.EPSILON3&&this.zoomVelocity<=P.EPSILON3){this._lastUpdateTime=xn(),this._scrollDelta=0,this._dragDelta.x=0,this._dragDelta.y=0,this.zoomVelocity=0;return}this._zoomInputVelocity=P.clamp(a/i,-this.maximumZoomVelocity,this.maximumZoomVelocity);let{camera:c,ellipsoid:u}=t,f=c.direction,d=h.magnitude(c.positionWC)-u.maximumRadius,p=this.isDragging?this._screenSpaceDragPosition:this._screenSpaceScrollPosition;this.useDragPosition||(p=this._screenSpaceOrigin,p.x=o/2,p.y=s/2);let g=this.pickWorldPosition(t,p,this._target);l(g)&&(f=h.subtract(g,c.positionWC,this._zoomDirection),f=h.normalize(f,this._zoomDirection),d=h.distance(g,c.positionWC)),d=P.clamp(d,d>0?this.minimumZoomDistance:-this.maximumZoomDistance,d>0?this.maximumZoomDistance:-this.minimumZoomDistance);let m=a*d*this.zoomDistanceRatio,y=this.dampingEnabled?this.zoomAnimationDuration:void 0;this._zoomDampenedResults=P.smoothDamp(0,m,this.zoomVelocity,i,void 0,y,this._zoomDampenedResults),c.move(f,this.zoomDistance),this._lastUpdateTime=xn(),this._scrollDelta=0,this._dragDelta.x=0,this._dragDelta.y=0}_handleZoom(t){this._scrollDelta+=t*this.zoomSensitivity}_handleZoomPosition(t){this._screenSpaceScrollPosition.x=t.endPosition.x,this._screenSpaceScrollPosition.y=t.endPosition.y}_handleStartDrag(t){this.enabled&&(this._screenSpaceDragPosition.x=t.position.x,this._screenSpaceDragPosition.y=t.position.y,this._dragDelta.x=0,this._dragDelta.y=0)}_handleDrag(t){this._dragDelta.x+=t.endPosition.x-t.startPosition.x,this._dragDelta.y+=t.endPosition.y-t.startPosition.y}},O2e=Eae;var M2e={FLOAT:"float",VEC2:"vec2",VEC3:"vec3",VEC4:"vec4",MAT2:"mat2",MAT3:"mat3",MAT4:"mat4"};Object.freeze(M2e);var N2e=M2e;var L2e={SIGX:"SIGX",SIGY:"SIGY",SIGZ:"SIGZ",VARX:"VARX",VARY:"VARY",VARZ:"VARZ",SIGR:"VARZ"};Object.freeze(L2e);var F2e=L2e;function N6t(e){async function t({data:i}){let r=[],o={id:i.id,result:void 0,error:void 0};self.CESIUM_BASE_URL=i.baseUrl;try{let s=await e(i.parameters,r);o.result=s}catch(s){s instanceof Error?o.error={name:s.name,message:s.message,stack:s.stack}:o.error=s}i.canTransferArrayBuffer||(r.length=0);try{postMessage(o,r)}catch(s){o.result=void 0,o.error=`postMessage failed with error: ${z0(s)} + with responseMessage: ${JSON.stringify(o)}`,postMessage(o)}}function n(i){postMessage({id:i.data?.id,error:`postMessage failed with error: ${JSON.stringify(i)}`})}return self.onmessage=t,self.onmessageerror=n,self}var B2e=N6t;globalThis.CESIUM_VERSION="1.145.0";var XM;typeof ko<"u"&&(XM=ko);(function(){/*! * Knockout JavaScript library v3.5.1 * (c) The Knockout.js team - http://knockoutjs.com/ * License: MIT (http://www.opensource.org/licenses/mit-license.php) @@ -12739,16 +12739,23 @@ out_FragColor = vec4(mix(vec3(0.0), vec3(1.0), scale), 1.0); |/(?:\\\\.|[^/])+/w*|[^\\s:,/][^,"'\`{}()/:[\\]]*[^\\s,"'\`{}()/:[\\]]|[^\\s]`,"g"),N=/[\])"'A-Za-z0-9_$]+$/,F={in:1,return:1,typeof:1},V={};return{Ra:[],wa:V,ac:_,vb:function(B,j){function k(Z,ae){var Ae;if(!W){var fe=m.getBindingHandler(Z);if(fe&&fe.preprocess&&!(ae=fe.preprocess(ae,Z,k)))return;(fe=V[Z])&&(Ae=ae,0<=m.a.A(C,Ae)?Ae=!1:(fe=Ae.match(w),Ae=fe===null?!1:fe[1]?"Object("+fe[1]+")"+fe[2]:Ae),fe=Ae),fe&&q.push("'"+(typeof V[Z]=="string"?V[Z]:Z)+"':function(_z){"+Ae+"=_z}")}Q&&(ae="function(){return "+ae+" }"),G.push("'"+Z+"':"+ae)}j=j||{};var G=[],q=[],Q=j.valueAccessors,W=j.bindingParams,J=typeof B=="string"?_(B):B;return m.a.D(J,function(Z){k(Z.key||Z.unknown,Z.value)}),q.length&&k("_ko_property_writers","{"+q.join(",")+" }"),G.join(",")},Id:function(B,j){for(var k=0;k<B.length;k++)if(B[k].key==j)return!0;return!1},eb:function(B,j,k,G,q){B&&m.O(B)?!m.Za(B)||q&&B.v()===G||B(G):(B=j.get("_ko_property_writers"))&&B[k]&&B[k](G)}}})(),m.b("expressionRewriting",m.m),m.b("expressionRewriting.bindingRewriteValidators",m.m.Ra),m.b("expressionRewriting.parseObjectLiteral",m.m.ac),m.b("expressionRewriting.preProcessBindings",m.m.vb),m.b("expressionRewriting._twoWayBindings",m.m.wa),m.b("jsonExpressionRewriting",m.m),m.b("jsonExpressionRewriting.insertPropertyAccessorsIntoJson",m.m.vb),(function(){function _(k){return k.nodeType==8&&F.test(N?k.text:k.nodeValue)}function C(k){return k.nodeType==8&&V.test(N?k.text:k.nodeValue)}function w(k,G){for(var q=k,Q=1,W=[];q=q.nextSibling;){if(C(q)&&(m.a.g.set(q,j,!0),Q--,Q===0))return W;W.push(q),_(q)&&Q++}if(!G)throw Error("Cannot find closing comment tag to match: "+k.nodeValue);return null}function D(k,G){var q=w(k,G);return q?0<q.length?q[q.length-1].nextSibling:k.nextSibling:null}var N=n&&n.createComment("test").text==="<!--test-->",F=N?/^\x3c!--\s*ko(?:\s+([\s\S]+))?\s*--\x3e$/:/^\s*ko(?:\s+([\s\S]+))?\s*$/,V=N?/^\x3c!--\s*\/ko\s*--\x3e$/:/^\s*\/ko\s*$/,B={ul:!0,ol:!0},j="__ko_matchedEndComment__";m.h={ea:{},childNodes:function(k){return _(k)?w(k):k.childNodes},Ea:function(k){if(_(k)){k=m.h.childNodes(k);for(var G=0,q=k.length;G<q;G++)m.removeNode(k[G])}else m.a.Tb(k)},va:function(k,G){if(_(k)){m.h.Ea(k);for(var q=k.nextSibling,Q=0,W=G.length;Q<W;Q++)q.parentNode.insertBefore(G[Q],q)}else m.a.va(k,G)},Vc:function(k,G){var q;_(k)?(q=k.nextSibling,k=k.parentNode):q=k.firstChild,q?G!==q&&k.insertBefore(G,q):k.appendChild(G)},Wb:function(k,G,q){q?(q=q.nextSibling,_(k)&&(k=k.parentNode),q?G!==q&&k.insertBefore(G,q):k.appendChild(G)):m.h.Vc(k,G)},firstChild:function(k){if(_(k))return!k.nextSibling||C(k.nextSibling)?null:k.nextSibling;if(k.firstChild&&C(k.firstChild))throw Error("Found invalid end comment, as the first child of "+k);return k.firstChild},nextSibling:function(k){if(_(k)&&(k=D(k)),k.nextSibling&&C(k.nextSibling)){var G=k.nextSibling;if(C(G)&&!m.a.g.get(G,j))throw Error("Found end comment without a matching opening comment, as child of "+k);return null}return k.nextSibling},Cd:_,Vd:function(k){return(k=(N?k.text:k.nodeValue).match(F))?k[1]:null},Sc:function(k){if(B[m.a.R(k)]){var G=k.firstChild;if(G)do if(G.nodeType===1){var q;q=G.firstChild;var Q=null;if(q)do if(Q)Q.push(q);else if(_(q)){var W=D(q,!0);W?q=W:Q=[q]}else C(q)&&(Q=[q]);while(q=q.nextSibling);if(q=Q)for(Q=G.nextSibling,W=0;W<q.length;W++)Q?k.insertBefore(q[W],Q):k.appendChild(q[W])}while(G=G.nextSibling)}}}})(),m.b("virtualElements",m.h),m.b("virtualElements.allowedBindings",m.h.ea),m.b("virtualElements.emptyNode",m.h.Ea),m.b("virtualElements.insertAfter",m.h.Wb),m.b("virtualElements.prepend",m.h.Vc),m.b("virtualElements.setDomNodeChildren",m.h.va),(function(){m.ga=function(){this.nd={}},m.a.extend(m.ga.prototype,{nodeHasBindings:function(_){switch(_.nodeType){case 1:return _.getAttribute("data-bind")!=null||m.j.getComponentNameForNode(_);case 8:return m.h.Cd(_);default:return!1}},getBindings:function(_,C){var w=this.getBindingsString(_,C),w=w?this.parseBindingsString(w,C,_):null;return m.j.tc(w,_,C,!1)},getBindingAccessors:function(_,C){var w=this.getBindingsString(_,C),w=w?this.parseBindingsString(w,C,_,{valueAccessors:!0}):null;return m.j.tc(w,_,C,!0)},getBindingsString:function(_){switch(_.nodeType){case 1:return _.getAttribute("data-bind");case 8:return m.h.Vd(_);default:return null}},parseBindingsString:function(_,C,w,D){try{var N=this.nd,F=_+(D&&D.valueAccessors||""),V;if(!(V=N[F])){var B,j="with($context){with($data||{}){return{"+m.m.vb(_,D)+"}}}";B=new Function("$context","$element",j),V=N[F]=B}return V(C,w)}catch(k){throw k.message=`Unable to parse bindings. Bindings value: `+_+` Message: `+k.message,k}}}),m.ga.instance=new m.ga})(),m.b("bindingProvider",m.ga),(function(){function _(fe){var xe=(fe=m.a.g.get(fe,Ae))&&fe.N;xe&&(fe.N=null,xe.Tc())}function C(fe,xe,ge){this.node=fe,this.yc=xe,this.kb=[],this.H=!1,xe.N||m.a.K.za(fe,_),ge&&ge.N&&(ge.N.kb.push(fe),this.Kb=ge)}function w(fe){return function(){return fe}}function D(fe){return fe()}function N(fe){return m.a.Ga(m.u.G(fe),function(xe,ge){return function(){return fe()[ge]}})}function F(fe,xe,ge){return typeof fe=="function"?N(fe.bind(null,xe,ge)):m.a.Ga(fe,w)}function V(fe,xe){return N(this.getBindings.bind(this,fe,xe))}function B(fe,xe){var ge=m.h.firstChild(xe);if(ge){var we,ve=m.ga.instance,Re=ve.preprocessNode;if(Re){for(;we=ge;)ge=m.h.nextSibling(we),Re.call(ve,we);ge=m.h.firstChild(xe)}for(;we=ge;)ge=m.h.nextSibling(we),j(fe,we)}m.i.ma(xe,m.i.H)}function j(fe,xe){var ge=fe,we=xe.nodeType===1;we&&m.h.Sc(xe),(we||m.ga.instance.nodeHasBindings(xe))&&(ge=G(xe,null,fe).bindingContextForDescendants),ge&&!Z[m.a.R(xe)]&&B(ge,xe)}function k(fe){var xe=[],ge={},we=[];return m.a.P(fe,function ve(Re){if(!ge[Re]){var Qe=m.getBindingHandler(Re);Qe&&(Qe.after&&(we.push(Re),m.a.D(Qe.after,function(He){if(fe[He]){if(m.a.A(we,He)!==-1)throw Error("Cannot combine the following bindings, because they have a cyclic dependency: "+we.join(", "));ve(He)}}),we.length--),xe.push({key:Re,Mc:Qe})),ge[Re]=!0}}),xe}function G(fe,xe,ge){var we=m.a.g.Ub(fe,Ae,{}),ve=we.hd;if(!xe){if(ve)throw Error("You cannot apply bindings multiple times to the same element.");we.hd=!0}ve||(we.context=ge),we.Zb||(we.Zb={});var Re;if(xe&&typeof xe!="function")Re=xe;else{var Qe=m.ga.instance,He=Qe.getBindingAccessors||V,Ye=m.$(function(){return(Re=xe?xe(ge,fe):He.call(Qe,fe,ge))&&(ge[Q]&&ge[Q](),ge[J]&&ge[J]()),Re},null,{l:fe});Re&&Ye.ja()||(Ye=null)}var Ke=ge,Pe;if(Re){var qe=function(){return m.a.Ga(Ye?Ye():Re,D)},st=Ye?function(vt){return function(){return D(Ye()[vt])}}:function(vt){return Re[vt]};qe.get=function(vt){return Re[vt]&&D(st(vt))},qe.has=function(vt){return vt in Re},m.i.H in Re&&m.i.subscribe(fe,m.i.H,function(){var vt=(0,Re[m.i.H])();if(vt){var jt=m.h.childNodes(fe);jt.length&&vt(jt,m.Ec(jt[0]))}}),m.i.pa in Re&&(Ke=m.i.Cb(fe,ge),m.i.subscribe(fe,m.i.pa,function(){var vt=(0,Re[m.i.pa])();vt&&m.h.firstChild(fe)&&vt(fe)})),we=k(Re),m.a.D(we,function(vt){var jt=vt.Mc.init,lt=vt.Mc.update,mt=vt.key;if(fe.nodeType===8&&!m.h.ea[mt])throw Error("The binding '"+mt+"' cannot be used with virtual elements");try{typeof jt=="function"&&m.u.G(function(){var ft=jt(fe,st(mt),qe,Ke.$data,Ke);if(ft&&ft.controlsDescendantBindings){if(Pe!==e)throw Error("Multiple bindings ("+Pe+" and "+mt+") are trying to control descendant bindings of the same element. You cannot use these bindings together on the same element.");Pe=mt}}),typeof lt=="function"&&m.$(function(){lt(fe,st(mt),qe,Ke.$data,Ke)},null,{l:fe})}catch(ft){throw ft.message='Unable to process binding "'+mt+": "+Re[mt]+`" -Message: `+ft.message,ft}})}return we=Pe===e,{shouldBindDescendants:we,bindingContextForDescendants:we&&Ke}}function q(fe,xe){return fe&&fe instanceof m.fa?fe:new m.fa(fe,e,e,xe)}var Q=m.a.Da("_subscribable"),W=m.a.Da("_ancestorBindingInfo"),J=m.a.Da("_dataDependency");m.c={};var Z={script:!0,textarea:!0,template:!0};m.getBindingHandler=function(fe){return m.c[fe]};var ae={};m.fa=function(fe,xe,ge,we,ve){function Re(){var st=Ke?Ye():Ye,vt=m.a.f(st);return xe?(m.a.extend(Qe,xe),W in xe&&(Qe[W]=xe[W])):(Qe.$parents=[],Qe.$root=vt,Qe.ko=m),Qe[Q]=Pe,He?vt=Qe.$data:(Qe.$rawData=st,Qe.$data=vt),ge&&(Qe[ge]=vt),we&&we(Qe,xe,vt),xe&&xe[Q]&&!m.S.o().Vb(xe[Q])&&xe[Q](),qe&&(Qe[J]=qe),Qe.$data}var Qe=this,He=fe===ae,Ye=He?e:fe,Ke=typeof Ye=="function"&&!m.O(Ye),Pe,qe=ve&&ve.dataDependency;ve&&ve.exportDependencies?Re():(Pe=m.xb(Re),Pe.v(),Pe.ja()?Pe.equalityComparer=null:Qe[Q]=e)},m.fa.prototype.createChildContext=function(fe,xe,ge,we){if(!we&&xe&&typeof xe=="object"&&(we=xe,xe=we.as,ge=we.extend),xe&&we&&we.noChildContext){var ve=typeof fe=="function"&&!m.O(fe);return new m.fa(ae,this,null,function(Re){ge&&ge(Re),Re[xe]=ve?fe():fe},we)}return new m.fa(fe,this,xe,function(Re,Qe){Re.$parentContext=Qe,Re.$parent=Qe.$data,Re.$parents=(Qe.$parents||[]).slice(0),Re.$parents.unshift(Re.$parent),ge&&ge(Re)},we)},m.fa.prototype.extend=function(fe,xe){return new m.fa(ae,this,null,function(ge){m.a.extend(ge,typeof fe=="function"?fe(ge):fe)},xe)};var Ae=m.a.g.Z();C.prototype.Tc=function(){this.Kb&&this.Kb.N&&this.Kb.N.sd(this.node)},C.prototype.sd=function(fe){m.a.Pa(this.kb,fe),!this.kb.length&&this.H&&this.Cc()},C.prototype.Cc=function(){this.H=!0,this.yc.N&&!this.kb.length&&(this.yc.N=null,m.a.K.yb(this.node,_),m.i.ma(this.node,m.i.pa),this.Tc())},m.i={H:"childrenComplete",pa:"descendantsComplete",subscribe:function(fe,xe,ge,we,ve){var Re=m.a.g.Ub(fe,Ae,{});return Re.Fa||(Re.Fa=new m.T),ve&&ve.notifyImmediately&&Re.Zb[xe]&&m.u.G(ge,we,[fe]),Re.Fa.subscribe(ge,we,xe)},ma:function(fe,xe){var ge=m.a.g.get(fe,Ae);if(ge&&(ge.Zb[xe]=!0,ge.Fa&&ge.Fa.notifySubscribers(fe,xe),xe==m.i.H)){if(ge.N)ge.N.Cc();else if(ge.N===e&&ge.Fa&&ge.Fa.Wa(m.i.pa))throw Error("descendantsComplete event not supported for bindings on this node")}},Cb:function(fe,xe){var ge=m.a.g.Ub(fe,Ae,{});return ge.N||(ge.N=new C(fe,ge,xe[W])),xe[W]==ge?xe:xe.extend(function(we){we[W]=ge})}},m.Td=function(fe){return(fe=m.a.g.get(fe,Ae))&&fe.context},m.ib=function(fe,xe,ge){return fe.nodeType===1&&m.h.Sc(fe),G(fe,xe,q(ge))},m.ld=function(fe,xe,ge){return ge=q(ge),m.ib(fe,F(xe,ge,fe),ge)},m.Oa=function(fe,xe){xe.nodeType!==1&&xe.nodeType!==8||B(q(fe),xe)},m.vc=function(fe,xe,ge){if(!r&&t.jQuery&&(r=t.jQuery),2>arguments.length){if(xe=n.body,!xe)throw Error("ko.applyBindings: could not find document.body; has the document been loaded?")}else if(!xe||xe.nodeType!==1&&xe.nodeType!==8)throw Error("ko.applyBindings: first parameter should be your view model; second parameter should be a DOM node");j(q(fe,ge),xe)},m.Dc=function(fe){return!fe||fe.nodeType!==1&&fe.nodeType!==8?e:m.Td(fe)},m.Ec=function(fe){return(fe=m.Dc(fe))?fe.$data:e},m.b("bindingHandlers",m.c),m.b("bindingEvent",m.i),m.b("bindingEvent.subscribe",m.i.subscribe),m.b("bindingEvent.startPossiblyAsyncContentBinding",m.i.Cb),m.b("applyBindings",m.vc),m.b("applyBindingsToDescendants",m.Oa),m.b("applyBindingAccessorsToNode",m.ib),m.b("applyBindingsToNode",m.ld),m.b("contextFor",m.Dc),m.b("dataFor",m.Ec)})(),(function(_){function C(V,B){var j=Object.prototype.hasOwnProperty.call(N,V)?N[V]:_,k;j?j.subscribe(B):(j=N[V]=new m.T,j.subscribe(B),w(V,function(G,q){var Q=!(!q||!q.synchronous);F[V]={definition:G,Gd:Q},delete N[V],k||Q?j.notifySubscribers(G):m.na.zb(function(){j.notifySubscribers(G)})}),k=!0)}function w(V,B){D("getConfig",[V],function(j){j?D("loadComponent",[V,j],function(k){B(k,j)}):B(null,null)})}function D(V,B,j,k){k||(k=m.j.loaders.slice(0));var G=k.shift();if(G){var q=G[V];if(q){var Q=!1;if(q.apply(G,B.concat(function(W){Q?j(null):W!==null?j(W):D(V,B,j,k)}))!==_&&(Q=!0,!G.suppressLoaderExceptions))throw Error("Component loaders must supply values by invoking the callback, not by returning values synchronously.")}else D(V,B,j,k)}else j(null)}var N={},F={};m.j={get:function(V,B){var j=Object.prototype.hasOwnProperty.call(F,V)?F[V]:_;j?j.Gd?m.u.G(function(){B(j.definition)}):m.na.zb(function(){B(j.definition)}):C(V,B)},Bc:function(V){delete F[V]},oc:D},m.j.loaders=[],m.b("components",m.j),m.b("components.get",m.j.get),m.b("components.clearCachedDefinition",m.j.Bc)})(),(function(){function _(j,k,G,q){function Q(){--J===0&&q(W)}var W={},J=2,Z=G.template;G=G.viewModel,Z?N(k,Z,function(ae){m.j.oc("loadTemplate",[j,ae],function(Ae){W.template=Ae,Q()})}):Q(),G?N(k,G,function(ae){m.j.oc("loadViewModel",[j,ae],function(Ae){W[B]=Ae,Q()})}):Q()}function C(j,k,G){if(typeof k=="function")G(function(Q){return new k(Q)});else if(typeof k[B]=="function")G(k[B]);else if("instance"in k){var q=k.instance;G(function(){return q})}else"viewModel"in k?C(j,k.viewModel,G):j("Unknown viewModel value: "+k)}function w(j){switch(m.a.R(j)){case"script":return m.a.ua(j.text);case"textarea":return m.a.ua(j.value);case"template":if(D(j.content))return m.a.Ca(j.content.childNodes)}return m.a.Ca(j.childNodes)}function D(j){return t.DocumentFragment?j instanceof DocumentFragment:j&&j.nodeType===11}function N(j,k,G){typeof k.require=="string"?a||t.require?(a||t.require)([k.require],function(q){q&&typeof q=="object"&&q.Xd&&q.default&&(q=q.default),G(q)}):j("Uses require, but no AMD loader is present"):G(k)}function F(j){return function(k){throw Error("Component '"+j+"': "+k)}}var V={};m.j.register=function(j,k){if(!k)throw Error("Invalid configuration for "+j);if(m.j.tb(j))throw Error("Component "+j+" is already registered");V[j]=k},m.j.tb=function(j){return Object.prototype.hasOwnProperty.call(V,j)},m.j.unregister=function(j){delete V[j],m.j.Bc(j)},m.j.Fc={getConfig:function(j,k){k(m.j.tb(j)?V[j]:null)},loadComponent:function(j,k,G){var q=F(j);N(q,k,function(Q){_(j,q,Q,G)})},loadTemplate:function(j,k,G){if(j=F(j),typeof k=="string")G(m.a.ua(k));else if(k instanceof Array)G(k);else if(D(k))G(m.a.la(k.childNodes));else if(k.element)if(k=k.element,t.HTMLElement?k instanceof HTMLElement:k&&k.tagName&&k.nodeType===1)G(w(k));else if(typeof k=="string"){var q=n.getElementById(k);q?G(w(q)):j("Cannot find element with ID "+k)}else j("Unknown element type: "+k);else j("Unknown template value: "+k)},loadViewModel:function(j,k,G){C(F(j),k,G)}};var B="createViewModel";m.b("components.register",m.j.register),m.b("components.isRegistered",m.j.tb),m.b("components.unregister",m.j.unregister),m.b("components.defaultLoader",m.j.Fc),m.j.loaders.push(m.j.Fc),m.j.dd=V})(),(function(){function _(w,D){var N=w.getAttribute("params");if(N){var N=C.parseBindingsString(N,D,w,{valueAccessors:!0,bindingParams:!0}),N=m.a.Ga(N,function(B){return m.o(B,null,{l:w})}),F=m.a.Ga(N,function(B){var j=B.v();return B.ja()?m.o({read:function(){return m.a.f(B())},write:m.Za(j)&&function(k){B()(k)},l:w}):j});return Object.prototype.hasOwnProperty.call(F,"$raw")||(F.$raw=N),F}return{$raw:{}}}m.j.getComponentNameForNode=function(w){var D=m.a.R(w);if(m.j.tb(D)&&(D.indexOf("-")!=-1||""+w=="[object HTMLUnknownElement]"||8>=m.a.W&&w.tagName===D))return D},m.j.tc=function(w,D,N,F){if(D.nodeType===1){var V=m.j.getComponentNameForNode(D);if(V){if(w=w||{},w.component)throw Error('Cannot use the "component" binding on a custom element matching a component');var B={name:V,params:_(D,N)};w.component=F?function(){return B}:B}}return w};var C=new m.ga;9>m.a.W&&(m.j.register=(function(w){return function(D){return w.apply(this,arguments)}})(m.j.register),n.createDocumentFragment=(function(w){return function(){var D=w(),N=m.j.dd,F;for(F in N);return D}})(n.createDocumentFragment))})(),(function(){function _(D,N,F){if(N=N.template,!N)throw Error("Component '"+D+"' has no template");D=m.a.Ca(N),m.h.va(F,D)}function C(D,N,F){var V=D.createViewModel;return V?V.call(D,N,F):N}var w=0;m.c.component={init:function(D,N,F,V,B){function j(){var W=k&&k.dispose;typeof W=="function"&&W.call(k),q&&q.s(),G=k=q=null}var k,G,q,Q=m.a.la(m.h.childNodes(D));return m.h.Ea(D),m.a.K.za(D,j),m.o(function(){var W=m.a.f(N()),J,Z;if(typeof W=="string"?J=W:(J=m.a.f(W.name),Z=m.a.f(W.params)),!J)throw Error("No component name specified");var ae=m.i.Cb(D,B),Ae=G=++w;m.j.get(J,function(fe){if(G===Ae){if(j(),!fe)throw Error("Unknown component '"+J+"'");_(J,fe,D);var xe=C(fe,Z,{element:D,templateNodes:Q});fe=ae.createChildContext(xe,{extend:function(ge){ge.$component=xe,ge.$componentTemplateNodes=Q}}),xe&&xe.koDescendantsComplete&&(q=m.i.subscribe(D,m.i.pa,xe.koDescendantsComplete,xe)),k=xe,m.Oa(fe,D)}})},null,{l:D}),{controlsDescendantBindings:!0}}},m.h.ea.component=!0})();var O={class:"className",for:"htmlFor"};m.c.attr={update:function(_,C){var w=m.a.f(C())||{};m.a.P(w,function(D,N){N=m.a.f(N);var F=D.indexOf(":"),F="lookupNamespaceURI"in _&&0<F&&_.lookupNamespaceURI(D.substr(0,F)),V=N===!1||N===null||N===e;V?F?_.removeAttributeNS(F,D):_.removeAttribute(D):N=N.toString(),8>=m.a.W&&D in O?(D=O[D],V?_.removeAttribute(D):_[D]=N):V||(F?_.setAttributeNS(F,D,N):_.setAttribute(D,N)),D==="name"&&m.a.Yc(_,V?"":N)})}},(function(){m.c.checked={after:["value","attr"],init:function(_,C,w){function D(){var W=_.checked,J=F();if(!m.S.Ya()&&(W||!B&&!m.S.qa())){var Z=m.u.G(C);if(k){var ae=G?Z.v():Z,Ae=Q;Q=J,Ae!==J?W&&(m.a.Na(ae,J,!0),m.a.Na(ae,Ae,!1)):m.a.Na(ae,J,W),G&&m.Za(Z)&&Z(ae)}else V&&(J===e?J=W:W||(J=e)),m.m.eb(Z,w,"checked",J,!0)}}function N(){var W=m.a.f(C()),J=F();k?(_.checked=0<=m.a.A(W,J),Q=J):_.checked=V&&J===e?!!W:F()===W}var F=m.xb(function(){if(w.has("checkedValue"))return m.a.f(w.get("checkedValue"));if(q)return w.has("value")?m.a.f(w.get("value")):_.value}),V=_.type=="checkbox",B=_.type=="radio";if(V||B){var j=C(),k=V&&m.a.f(j)instanceof Array,G=!(k&&j.push&&j.splice),q=B||k,Q=k?F():e;B&&!_.name&&m.c.uniqueName.init(_,function(){return!0}),m.o(D,null,{l:_}),m.a.B(_,"click",D),m.o(N,null,{l:_}),j=e}}},m.m.wa.checked=!0,m.c.checkedValue={update:function(_,C){_.value=m.a.f(C())}}})(),m.c.class={update:function(_,C){var w=m.a.Db(m.a.f(C()));m.a.Eb(_,_.__ko__cssValue,!1),_.__ko__cssValue=w,m.a.Eb(_,w,!0)}},m.c.css={update:function(_,C){var w=m.a.f(C());w!==null&&typeof w=="object"?m.a.P(w,function(D,N){N=m.a.f(N),m.a.Eb(_,D,N)}):m.c.class.update(_,C)}},m.c.enable={update:function(_,C){var w=m.a.f(C());w&&_.disabled?_.removeAttribute("disabled"):w||_.disabled||(_.disabled=!0)}},m.c.disable={update:function(_,C){m.c.enable.update(_,function(){return!m.a.f(C())})}},m.c.event={init:function(_,C,w,D,N){var F=C()||{};m.a.P(F,function(V){typeof V=="string"&&m.a.B(_,V,function(B){var j,k=C()[V];if(k){try{var G=m.a.la(arguments);D=N.$data,G.unshift(D),j=k.apply(D,G)}finally{j!==!0&&(B.preventDefault?B.preventDefault():B.returnValue=!1)}w.get(V+"Bubble")===!1&&(B.cancelBubble=!0,B.stopPropagation&&B.stopPropagation())}})})}},m.c.foreach={Rc:function(_){return function(){var C=_(),w=m.a.bc(C);return!w||typeof w.length=="number"?{foreach:C,templateEngine:m.ba.Ma}:(m.a.f(C),{foreach:w.data,as:w.as,noChildContext:w.noChildContext,includeDestroyed:w.includeDestroyed,afterAdd:w.afterAdd,beforeRemove:w.beforeRemove,afterRender:w.afterRender,beforeMove:w.beforeMove,afterMove:w.afterMove,templateEngine:m.ba.Ma})}},init:function(_,C){return m.c.template.init(_,m.c.foreach.Rc(C))},update:function(_,C,w,D,N){return m.c.template.update(_,m.c.foreach.Rc(C),w,D,N)}},m.m.Ra.foreach=!1,m.h.ea.foreach=!0,m.c.hasfocus={init:function(_,C,w){function D(V){_.__ko_hasfocusUpdating=!0;var B=_.ownerDocument;if("activeElement"in B){var j;try{j=B.activeElement}catch{j=B.body}V=j===_}B=C(),m.m.eb(B,w,"hasfocus",V,!0),_.__ko_hasfocusLastValue=V,_.__ko_hasfocusUpdating=!1}var N=D.bind(null,!0),F=D.bind(null,!1);m.a.B(_,"focus",N),m.a.B(_,"focusin",N),m.a.B(_,"blur",F),m.a.B(_,"focusout",F),_.__ko_hasfocusLastValue=!1},update:function(_,C){var w=!!m.a.f(C());_.__ko_hasfocusUpdating||_.__ko_hasfocusLastValue===w||(w?_.focus():_.blur(),!w&&_.__ko_hasfocusLastValue&&_.ownerDocument.body.focus(),m.u.G(m.a.Fb,null,[_,w?"focusin":"focusout"]))}},m.m.wa.hasfocus=!0,m.c.hasFocus=m.c.hasfocus,m.m.wa.hasFocus="hasfocus",m.c.html={init:function(){return{controlsDescendantBindings:!0}},update:function(_,C){m.a.fc(_,C())}},(function(){function _(C,w,D){m.c[C]={init:function(N,F,V,B,j){var k,G,q={},Q,W,J;if(w){B=V.get("as");var Z=V.get("noChildContext");J=!(B&&Z),q={as:B,noChildContext:Z,exportDependencies:J}}return W=(Q=V.get("completeOn")=="render")||V.has(m.i.pa),m.o(function(){var ae=m.a.f(F()),Ae=!D!=!ae,fe=!G,xe;(J||Ae!==k)&&(W&&(j=m.i.Cb(N,j)),Ae&&((!w||J)&&(q.dataDependency=m.S.o()),xe=w?j.createChildContext(typeof ae=="function"?ae:F,q):m.S.qa()?j.extend(null,q):j),fe&&m.S.qa()&&(G=m.a.Ca(m.h.childNodes(N),!0)),Ae?(fe||m.h.va(N,m.a.Ca(G)),m.Oa(xe,N)):(m.h.Ea(N),Q||m.i.ma(N,m.i.H)),k=Ae)},null,{l:N}),{controlsDescendantBindings:!0}}},m.m.Ra[C]=!1,m.h.ea[C]=!0}_("if"),_("ifnot",!1,!0),_("with",!0)})(),m.c.let={init:function(_,C,w,D,N){return C=N.extend(C),m.Oa(C,_),{controlsDescendantBindings:!0}}},m.h.ea.let=!0;var L={};m.c.options={init:function(_){if(m.a.R(_)!=="select")throw Error("options binding applies only to SELECT elements");for(;0<_.length;)_.remove(0);return{controlsDescendantBindings:!0}},update:function(_,C,w){function D(){return m.a.jb(_.options,function(Z){return Z.selected})}function N(Z,ae,Ae){var fe=typeof ae;return fe=="function"?ae(Z):fe=="string"?Z[ae]:Ae}function F(Z,ae){if(W&&k)m.i.ma(_,m.i.H);else if(Q.length){var Ae=0<=m.a.A(Q,m.w.M(ae[0]));m.a.Zc(ae[0],Ae),W&&!Ae&&m.u.G(m.a.Fb,null,[_,"change"])}}var V=_.multiple,B=_.length!=0&&V?_.scrollTop:null,j=m.a.f(C()),k=w.get("valueAllowUnset")&&w.has("value"),G=w.get("optionsIncludeDestroyed");C={};var q,Q=[];k||(V?Q=m.a.Mb(D(),m.w.M):0<=_.selectedIndex&&Q.push(m.w.M(_.options[_.selectedIndex]))),j&&(typeof j.length>"u"&&(j=[j]),q=m.a.jb(j,function(Z){return G||Z===e||Z===null||!m.a.f(Z._destroy)}),w.has("optionsCaption")&&(j=m.a.f(w.get("optionsCaption")),j!==null&&j!==e&&q.unshift(L)));var W=!1;if(C.beforeRemove=function(Z){_.removeChild(Z)},j=F,w.has("optionsAfterRender")&&typeof w.get("optionsAfterRender")=="function"&&(j=function(Z,ae){F(0,ae),m.u.G(w.get("optionsAfterRender"),null,[ae[0],Z!==L?Z:e])}),m.a.ec(_,q,function(Z,ae,Ae){return Ae.length&&(Q=!k&&Ae[0].selected?[m.w.M(Ae[0])]:[],W=!0),ae=_.ownerDocument.createElement("option"),Z===L?(m.a.Bb(ae,w.get("optionsCaption")),m.w.cb(ae,e)):(Ae=N(Z,w.get("optionsValue"),Z),m.w.cb(ae,m.a.f(Ae)),Z=N(Z,w.get("optionsText"),Ae),m.a.Bb(ae,Z)),[ae]},C,j),!k){var J;V?J=Q.length&&D().length<Q.length:J=Q.length&&0<=_.selectedIndex?m.w.M(_.options[_.selectedIndex])!==Q[0]:Q.length||0<=_.selectedIndex,J&&m.u.G(m.a.Fb,null,[_,"change"])}(k||m.S.Ya())&&m.i.ma(_,m.i.H),m.a.wd(_),B&&20<Math.abs(B-_.scrollTop)&&(_.scrollTop=B)}},m.c.options.$b=m.a.g.Z(),m.c.selectedOptions={init:function(_,C,w){function D(){var V=C(),B=[];m.a.D(_.getElementsByTagName("option"),function(j){j.selected&&B.push(m.w.M(j))}),m.m.eb(V,w,"selectedOptions",B)}function N(){var V=m.a.f(C()),B=_.scrollTop;V&&typeof V.length=="number"&&m.a.D(_.getElementsByTagName("option"),function(j){var k=0<=m.a.A(V,m.w.M(j));j.selected!=k&&m.a.Zc(j,k)}),_.scrollTop=B}if(m.a.R(_)!="select")throw Error("selectedOptions binding applies only to SELECT elements");var F;m.i.subscribe(_,m.i.H,function(){F?D():(m.a.B(_,"change",D),F=m.o(N,null,{l:_}))},null,{notifyImmediately:!0})},update:function(){}},m.m.wa.selectedOptions=!0,m.c.style={update:function(_,C){var w=m.a.f(C()||{});m.a.P(w,function(D,N){if(N=m.a.f(N),(N===null||N===e||N===!1)&&(N=""),r)r(_).css(D,N);else if(/^--/.test(D))_.style.setProperty(D,N);else{D=D.replace(/-(\w)/g,function(V,B){return B.toUpperCase()});var F=_.style[D];_.style[D]=N,N===F||_.style[D]!=F||isNaN(N)||(_.style[D]=N+"px")}})}},m.c.submit={init:function(_,C,w,D,N){if(typeof C()!="function")throw Error("The value for a submit binding must be a function");m.a.B(_,"submit",function(F){var V,B=C();try{V=B.call(N.$data,_)}finally{V!==!0&&(F.preventDefault?F.preventDefault():F.returnValue=!1)}})}},m.c.text={init:function(){return{controlsDescendantBindings:!0}},update:function(_,C){m.a.Bb(_,C())}},m.h.ea.text=!0,(function(){if(t&&t.navigator){var _=function(q){if(q)return parseFloat(q[1])},C=t.navigator.userAgent,w,D,N,F,V;(w=t.opera&&t.opera.version&&parseInt(t.opera.version()))||(V=_(C.match(/Edge\/([^ ]+)$/)))||_(C.match(/Chrome\/([^ ]+)/))||(D=_(C.match(/Version\/([^ ]+) Safari/)))||(N=_(C.match(/Firefox\/([^ ]+)/)))||(F=m.a.W||_(C.match(/MSIE ([^ ]+)/)))||(F=_(C.match(/rv:([^ )]+)/)))}if(8<=F&&10>F)var B=m.a.g.Z(),j=m.a.g.Z(),k=function(q){var Q=this.activeElement;(Q=Q&&m.a.g.get(Q,j))&&Q(q)},G=function(q,Q){var W=q.ownerDocument;m.a.g.get(W,B)||(m.a.g.set(W,B,!0),m.a.B(W,"selectionchange",k)),m.a.g.set(q,j,Q)};m.c.textInput={init:function(q,Q,W){function J(Re,Qe){m.a.B(q,Re,Qe)}function Z(){var Re=m.a.f(Q());(Re===null||Re===e)&&(Re=""),ge!==e&&Re===ge?m.a.setTimeout(Z,4):q.value!==Re&&(ve=!0,q.value=Re,ve=!1,fe=q.value)}function ae(){xe||(ge=q.value,xe=m.a.setTimeout(Ae,4))}function Ae(){clearTimeout(xe),ge=xe=e;var Re=q.value;fe!==Re&&(fe=Re,m.m.eb(Q(),W,"textInput",Re))}var fe=q.value,xe,ge,we=m.a.W==9?ae:Ae,ve=!1;F&&J("keypress",Ae),11>F&&J("propertychange",function(Re){ve||Re.propertyName!=="value"||we(Re)}),F==8&&(J("keyup",Ae),J("keydown",Ae)),G&&(G(q,we),J("dragend",ae)),(!F||9<=F)&&J("input",we),5>D&&m.a.R(q)==="textarea"?(J("keydown",ae),J("paste",ae),J("cut",ae)):11>w?J("keydown",ae):4>N?(J("DOMAutoComplete",Ae),J("dragdrop",Ae),J("drop",Ae)):V&&q.type==="number"&&J("keydown",ae),J("change",Ae),J("blur",Ae),m.o(Z,null,{l:q})}},m.m.wa.textInput=!0,m.c.textinput={preprocess:function(q,Q,W){W("textInput",q)}}})(),m.c.uniqueName={init:function(_,C){if(C()){var w="ko_unique_"+ ++m.c.uniqueName.rd;m.a.Yc(_,w)}}},m.c.uniqueName.rd=0,m.c.using={init:function(_,C,w,D,N){var F;return w.has("as")&&(F={as:w.get("as"),noChildContext:w.get("noChildContext")}),C=N.createChildContext(C,F),m.Oa(C,_),{controlsDescendantBindings:!0}}},m.h.ea.using=!0,m.c.value={init:function(_,C,w){var D=m.a.R(_),N=D=="input";if(!N||_.type!="checkbox"&&_.type!="radio"){var F=[],V=w.get("valueUpdate"),B=!1,j=null;V&&(typeof V=="string"?F=[V]:F=m.a.wc(V),m.a.Pa(F,"change"));var k=function(){j=null,B=!1;var Q=C(),W=m.w.M(_);m.m.eb(Q,w,"value",W)};!m.a.W||!N||_.type!="text"||_.autocomplete=="off"||_.form&&_.form.autocomplete=="off"||m.a.A(F,"propertychange")!=-1||(m.a.B(_,"propertychange",function(){B=!0}),m.a.B(_,"focus",function(){B=!1}),m.a.B(_,"blur",function(){B&&k()})),m.a.D(F,function(Q){var W=k;m.a.Ud(Q,"after")&&(W=function(){j=m.w.M(_),m.a.setTimeout(k,0)},Q=Q.substring(5)),m.a.B(_,Q,W)});var G;if(G=N&&_.type=="file"?function(){var Q=m.a.f(C());Q===null||Q===e||Q===""?_.value="":m.u.G(k)}:function(){var Q=m.a.f(C()),W=m.w.M(_);j!==null&&Q===j?m.a.setTimeout(G,0):(Q!==W||W===e)&&(D==="select"?(W=w.get("valueAllowUnset"),m.w.cb(_,Q,W),W||Q===m.w.M(_)||m.u.G(k)):m.w.cb(_,Q))},D==="select"){var q;m.i.subscribe(_,m.i.H,function(){q?w.get("valueAllowUnset")?G():k():(m.a.B(_,"change",k),q=m.o(G,null,{l:_}))},null,{notifyImmediately:!0})}else m.a.B(_,"change",k),m.o(G,null,{l:_})}else m.ib(_,{checkedValue:C})},update:function(){}},m.m.wa.value=!0,m.c.visible={update:function(_,C){var w=m.a.f(C()),D=_.style.display!="none";w&&!D?_.style.display="":!w&&D&&(_.style.display="none")}},m.c.hidden={update:function(_,C){m.c.visible.update(_,function(){return!m.a.f(C())})}},(function(_){m.c[_]={init:function(C,w,D,N,F){return m.c.event.init.call(this,C,function(){var V={};return V[_]=w(),V},D,N,F)}}})("click"),m.ca=function(){},m.ca.prototype.renderTemplateSource=function(){throw Error("Override renderTemplateSource")},m.ca.prototype.createJavaScriptEvaluatorBlock=function(){throw Error("Override createJavaScriptEvaluatorBlock")},m.ca.prototype.makeTemplateSource=function(_,C){if(typeof _=="string"){C=C||n;var w=C.getElementById(_);if(!w)throw Error("Cannot find template with ID "+_);return new m.C.F(w)}if(_.nodeType==1||_.nodeType==8)return new m.C.ia(_);throw Error("Unknown template type: "+_)},m.ca.prototype.renderTemplate=function(_,C,w,D){return _=this.makeTemplateSource(_,D),this.renderTemplateSource(_,C,w,D)},m.ca.prototype.isTemplateRewritten=function(_,C){return this.allowTemplateRewriting===!1?!0:this.makeTemplateSource(_,C).data("isRewritten")},m.ca.prototype.rewriteTemplate=function(_,C,w){_=this.makeTemplateSource(_,w),C=C(_.text()),_.text(C),_.data("isRewritten",!0)},m.b("templateEngine",m.ca),m.kc=(function(){function _(D,N,F,V){D=m.m.ac(D);for(var B=m.m.Ra,j=0;j<D.length;j++){var k=D[j].key;if(Object.prototype.hasOwnProperty.call(B,k)){var G=B[k];if(typeof G=="function"){if(k=G(D[j].value))throw Error(k)}else if(!G)throw Error("This template engine does not support the '"+k+"' binding within its templates")}}return F="ko.__tr_ambtns(function($context,$element){return(function(){return{ "+m.m.vb(D,{valueAccessors:!0})+" } })()},'"+F.toLowerCase()+"')",V.createJavaScriptEvaluatorBlock(F)+N}var C=/(<([a-z]+\d*)(?:\s+(?!data-bind\s*=\s*)[a-z0-9\-]+(?:=(?:\"[^\"]*\"|\'[^\']*\'|[^>]*))?)*\s+)data-bind\s*=\s*(["'])([\s\S]*?)\3/gi,w=/\x3c!--\s*ko\b\s*([\s\S]*?)\s*--\x3e/g;return{xd:function(D,N,F){N.isTemplateRewritten(D,F)||N.rewriteTemplate(D,function(V){return m.kc.Ld(V,N)},F)},Ld:function(D,N){return D.replace(C,function(F,V,B,j,k){return _(k,V,B,N)}).replace(w,function(F,V){return _(V,"<!-- ko -->","#comment",N)})},md:function(D,N){return m.aa.Xb(function(F,V){var B=F.nextSibling;B&&B.nodeName.toLowerCase()===N&&m.ib(B,D,V)})}}})(),m.b("__tr_ambtns",m.kc.md),(function(){m.C={},m.C.F=function(w){if(this.F=w){var D=m.a.R(w);this.ab=D==="script"?1:D==="textarea"?2:D=="template"&&w.content&&w.content.nodeType===11?3:4}},m.C.F.prototype.text=function(){var w=this.ab===1?"text":this.ab===2?"value":"innerHTML";if(arguments.length==0)return this.F[w];var D=arguments[0];w==="innerHTML"?m.a.fc(this.F,D):this.F[w]=D};var _=m.a.g.Z()+"_";m.C.F.prototype.data=function(w){if(arguments.length===1)return m.a.g.get(this.F,_+w);m.a.g.set(this.F,_+w,arguments[1])};var C=m.a.g.Z();m.C.F.prototype.nodes=function(){var w=this.F;if(arguments.length==0){var D=m.a.g.get(w,C)||{},N=D.lb||(this.ab===3?w.content:this.ab===4?w:e);if(!N||D.jd){var F=this.text();F&&F!==D.bb&&(N=m.a.Md(F,w.ownerDocument),m.a.g.set(w,C,{lb:N,bb:F,jd:!0}))}return N}D=arguments[0],this.ab!==e&&this.text(""),m.a.g.set(w,C,{lb:D})},m.C.ia=function(w){this.F=w},m.C.ia.prototype=new m.C.F,m.C.ia.prototype.constructor=m.C.ia,m.C.ia.prototype.text=function(){if(arguments.length==0){var w=m.a.g.get(this.F,C)||{};return w.bb===e&&w.lb&&(w.bb=w.lb.innerHTML),w.bb}m.a.g.set(this.F,C,{bb:arguments[0]})},m.b("templateSources",m.C),m.b("templateSources.domElement",m.C.F),m.b("templateSources.anonymousTemplate",m.C.ia)})(),(function(){function _(j,k,G){var q;for(k=m.h.nextSibling(k);j&&(q=j)!==k;)j=m.h.nextSibling(q),G(q,j)}function C(j,k){if(j.length){var G=j[0],q=j[j.length-1],Q=G.parentNode,W=m.ga.instance,J=W.preprocessNode;if(J){if(_(G,q,function(Z,ae){var Ae=Z.previousSibling,fe=J.call(W,Z);fe&&(Z===G&&(G=fe[0]||ae),Z===q&&(q=fe[fe.length-1]||Ae))}),j.length=0,!G)return;G===q?j.push(G):(j.push(G,q),m.a.Ua(j,Q))}_(G,q,function(Z){Z.nodeType!==1&&Z.nodeType!==8||m.vc(k,Z)}),_(G,q,function(Z){Z.nodeType!==1&&Z.nodeType!==8||m.aa.cd(Z,[k])}),m.a.Ua(j,Q)}}function w(j){return j.nodeType?j:0<j.length?j[0]:null}function D(j,k,G,q,Q){Q=Q||{};var W=(j&&w(j)||G||{}).ownerDocument,J=Q.templateEngine||F;if(m.kc.xd(G,J,W),G=J.renderTemplate(G,q,Q,W),typeof G.length!="number"||0<G.length&&typeof G[0].nodeType!="number")throw Error("Template engine must return an array of DOM nodes");switch(W=!1,k){case"replaceChildren":m.h.va(j,G),W=!0;break;case"replaceNode":m.a.Xc(j,G),W=!0;break;case"ignoreTargetNode":break;default:throw Error("Unknown renderMode: "+k)}return W&&(C(G,q),Q.afterRender&&m.u.G(Q.afterRender,null,[G,q[Q.as||"$data"]]),k=="replaceChildren"&&m.i.ma(j,m.i.H)),G}function N(j,k,G){return m.O(j)?j():typeof j=="function"?j(k,G):j}var F;m.gc=function(j){if(j!=e&&!(j instanceof m.ca))throw Error("templateEngine must inherit from ko.templateEngine");F=j},m.dc=function(j,k,G,q,Q){if(G=G||{},(G.templateEngine||F)==e)throw Error("Set a template engine before calling renderTemplate");if(Q=Q||"replaceChildren",q){var W=w(q);return m.$(function(){var Z=k&&k instanceof m.fa?k:new m.fa(k,null,null,null,{exportDependencies:!0}),J=N(j,Z.$data,Z),Z=D(q,Q,J,Z,G);Q=="replaceNode"&&(q=Z,W=w(q))},null,{Sa:function(){return!W||!m.a.Sb(W)},l:W&&Q=="replaceNode"?W.parentNode:W})}return m.aa.Xb(function(J){m.dc(j,k,G,J,"replaceNode")})},m.Qd=function(j,k,G,q,Q){function W(ge,we){m.u.G(m.a.ec,null,[q,ge,Z,G,J,we]),m.i.ma(q,m.i.H)}function J(ge,we){C(we,ae),G.afterRender&&G.afterRender(we,ge),ae=null}function Z(ge,we){ae=Q.createChildContext(ge,{as:Ae,noChildContext:G.noChildContext,extend:function(Re){Re.$index=we,Ae&&(Re[Ae+"Index"]=we)}});var ve=N(j,ge,ae);return D(q,"ignoreTargetNode",ve,ae,G)}var ae,Ae=G.as,fe=G.includeDestroyed===!1||m.options.foreachHidesDestroyed&&!G.includeDestroyed;if(fe||G.beforeRemove||!m.Pc(k))return m.$(function(){var ge=m.a.f(k)||[];typeof ge.length>"u"&&(ge=[ge]),fe&&(ge=m.a.jb(ge,function(we){return we===e||we===null||!m.a.f(we._destroy)})),W(ge)},null,{l:q});W(k.v());var xe=k.subscribe(function(ge){W(k(),ge)},null,"arrayChange");return xe.l(q),xe};var V=m.a.g.Z(),B=m.a.g.Z();m.c.template={init:function(j,k){var G=m.a.f(k());if(typeof G=="string"||"name"in G)m.h.Ea(j);else if("nodes"in G){if(G=G.nodes||[],m.O(G))throw Error('The "nodes" option must be a plain, non-observable array.');var q=G[0]&&G[0].parentNode;q&&m.a.g.get(q,B)||(q=m.a.Yb(G),m.a.g.set(q,B,!0)),new m.C.ia(j).nodes(q)}else if(G=m.h.childNodes(j),0<G.length)q=m.a.Yb(G),new m.C.ia(j).nodes(q);else throw Error("Anonymous template defined, but no template content was provided");return{controlsDescendantBindings:!0}},update:function(j,k,G,q,Q){var W=k();k=m.a.f(W),G=!0,q=null,typeof k=="string"?k={}:(W="name"in k?k.name:j,"if"in k&&(G=m.a.f(k.if)),G&&"ifnot"in k&&(G=!m.a.f(k.ifnot)),G&&!W&&(G=!1)),"foreach"in k?q=m.Qd(W,G&&k.foreach||[],k,j,Q):G?(G=Q,"data"in k&&(G=Q.createChildContext(k.data,{as:k.as,noChildContext:k.noChildContext,exportDependencies:!0})),q=m.dc(W,G,k,j)):m.h.Ea(j),Q=q,(k=m.a.g.get(j,V))&&typeof k.s=="function"&&k.s(),m.a.g.set(j,V,!Q||Q.ja&&!Q.ja()?e:Q)}},m.m.Ra.template=function(j){return j=m.m.ac(j),j.length==1&&j[0].unknown||m.m.Id(j,"name")?null:"This template engine does not support anonymous templates nested within its templates"},m.h.ea.template=!0})(),m.b("setTemplateEngine",m.gc),m.b("renderTemplate",m.dc),m.a.Kc=function(_,C,w){if(_.length&&C.length){var D,N,F,V,B;for(D=N=0;(!w||D<w)&&(V=_[N]);++N){for(F=0;B=C[F];++F)if(V.value===B.value){V.moved=B.index,B.moved=V.index,C.splice(F,1),D=F=0;break}D+=F}}},m.a.Pb=(function(){function _(C,w,D,N,F){var V=Math.min,B=Math.max,j=[],k,G=C.length,q,Q=w.length,W=Q-G||1,J=G+Q+1,Z,ae,Ae;for(k=0;k<=G;k++)for(ae=Z,j.push(Z=[]),Ae=V(Q,k+W),q=B(0,k-1);q<=Ae;q++)Z[q]=q?k?C[k-1]===w[q-1]?ae[q-1]:V(ae[q]||J,Z[q-1]||J)+1:q+1:k+1;for(V=[],B=[],W=[],k=G,q=Q;k||q;)Q=j[k][q]-1,q&&Q===j[k][q-1]?B.push(V[V.length]={status:D,value:w[--q],index:q}):k&&Q===j[k-1][q]?W.push(V[V.length]={status:N,value:C[--k],index:k}):(--q,--k,F.sparse||V.push({status:"retained",value:w[q]}));return m.a.Kc(W,B,!F.dontLimitMoves&&10*G),V.reverse()}return function(C,w,D){return D=typeof D=="boolean"?{dontLimitMoves:D}:D||{},C=C||[],w=w||[],C.length<w.length?_(C,w,"added","deleted",D):_(w,C,"deleted","added",D)}})(),m.b("utils.compareArrays",m.a.Pb),(function(){function _(D,N,F,V,B){var j=[],k=m.$(function(){var G=N(F,B,m.a.Ua(j,D))||[];0<j.length&&(m.a.Xc(j,G),V&&m.u.G(V,null,[F,G,B])),j.length=0,m.a.Nb(j,G)},null,{l:D,Sa:function(){return!m.a.kd(j)}});return{Y:j,$:k.ja()?k:e}}var C=m.a.g.Z(),w=m.a.g.Z();m.a.ec=function(D,N,F,V,B,j){function k(vt){ve={Aa:vt,pb:m.ta(ae++)},J.push(ve),W||we.push(ve)}function G(vt){ve=Q[vt],ae!==ve.pb.v()&&ge.push(ve),ve.pb(ae++),m.a.Ua(ve.Y,D),J.push(ve)}function q(vt,jt){if(vt)for(var lt=0,mt=jt.length;lt<mt;lt++)m.a.D(jt[lt].Y,function(ft){vt(ft,lt,jt[lt].Aa)})}N=N||[],typeof N.length>"u"&&(N=[N]),V=V||{};var Q=m.a.g.get(D,C),W=!Q,J=[],Z=0,ae=0,Ae=[],fe=[],xe=[],ge=[],we=[],ve,Re=0;if(W)m.a.D(N,k);else{if(!j||Q&&Q._countWaitingForRemove){var Qe=m.a.Mb(Q,function(vt){return vt.Aa});j=m.a.Pb(Qe,N,{dontLimitMoves:V.dontLimitMoves,sparse:!0})}for(var Qe=0,He,Ye,Ke;He=j[Qe];Qe++)switch(Ye=He.moved,Ke=He.index,He.status){case"deleted":for(;Z<Ke;)G(Z++);Ye===e&&(ve=Q[Z],ve.$&&(ve.$.s(),ve.$=e),m.a.Ua(ve.Y,D).length&&(V.beforeRemove&&(J.push(ve),Re++,ve.Aa===w?ve=null:xe.push(ve)),ve&&Ae.push.apply(Ae,ve.Y))),Z++;break;case"added":for(;ae<Ke;)G(Z++);Ye!==e?(fe.push(J.length),G(Ye)):k(He.value)}for(;ae<N.length;)G(Z++);J._countWaitingForRemove=Re}m.a.g.set(D,C,J),q(V.beforeMove,ge),m.a.D(Ae,V.beforeRemove?m.oa:m.removeNode);var Pe,qe,st;try{st=D.ownerDocument.activeElement}catch{}if(fe.length)for(;(Qe=fe.shift())!=e;){for(ve=J[Qe],Pe=e;Qe;)if((qe=J[--Qe].Y)&&qe.length){Pe=qe[qe.length-1];break}for(N=0;Z=ve.Y[N];Pe=Z,N++)m.h.Wb(D,Z,Pe)}for(Qe=0;ve=J[Qe];Qe++){for(ve.Y||m.a.extend(ve,_(D,F,ve.Aa,B,ve.pb)),N=0;Z=ve.Y[N];Pe=Z,N++)m.h.Wb(D,Z,Pe);!ve.Ed&&B&&(B(ve.Aa,ve.Y,ve.pb),ve.Ed=!0,Pe=ve.Y[ve.Y.length-1])}for(st&&D.ownerDocument.activeElement!=st&&st.focus(),q(V.beforeRemove,xe),Qe=0;Qe<xe.length;++Qe)xe[Qe].Aa=w;q(V.afterMove,ge),q(V.afterAdd,we)}})(),m.b("utils.setDomNodeChildrenFromArrayMapping",m.a.ec),m.ba=function(){this.allowTemplateRewriting=!1},m.ba.prototype=new m.ca,m.ba.prototype.constructor=m.ba,m.ba.prototype.renderTemplateSource=function(_,C,w,D){return(C=!(9>m.a.W)&&_.nodes?_.nodes():null)?m.a.la(C.cloneNode(!0).childNodes):(_=_.text(),m.a.ua(_,D))},m.ba.Ma=new m.ba,m.gc(m.ba.Ma),m.b("nativeTemplateEngine",m.ba),(function(){m.$a=function(){var C=this.Hd=(function(){if(!r||!r.tmpl)return 0;try{if(0<=r.tmpl.tag.tmpl.open.toString().indexOf("__"))return 2}catch{}return 1})();this.renderTemplateSource=function(w,D,N,F){if(F=F||n,N=N||{},2>C)throw Error("Your version of jQuery.tmpl is too old. Please upgrade to jQuery.tmpl 1.0.0pre or later.");var V=w.data("precompiled");return V||(V=w.text()||"",V=r.template(null,"{{ko_with $item.koBindingContext}}"+V+"{{/ko_with}}"),w.data("precompiled",V)),w=[D.$data],D=r.extend({koBindingContext:D},N.templateOptions),D=r.tmpl(V,w,D),D.appendTo(F.createElement("div")),r.fragments={},D},this.createJavaScriptEvaluatorBlock=function(w){return"{{ko_code ((function() { return "+w+" })()) }}"},this.addTemplate=function(w,D){n.write("<script type='text/html' id='"+w+"'>"+D+"<\/script>")},0<C&&(r.tmpl.tag.ko_code={open:"__.push($1 || '');"},r.tmpl.tag.ko_with={open:"with($1) {",close:"} "})},m.$a.prototype=new m.ca,m.$a.prototype.constructor=m.$a;var _=new m.$a;0<_.Hd&&m.gc(_),m.b("jqueryTmplTemplateEngine",m.$a)})()})})()})()})();var N6t=ko;typeof window<"u"?(ko=window.ko,typeof XM<"u"?window.ko=XM:delete window.ko):(ko=global.ko,typeof XM<"u"?global.ko=XM:delete global.ko);var DI=N6t;/** +Message: `+ft.message,ft}})}return we=Pe===e,{shouldBindDescendants:we,bindingContextForDescendants:we&&Ke}}function q(fe,xe){return fe&&fe instanceof m.fa?fe:new m.fa(fe,e,e,xe)}var Q=m.a.Da("_subscribable"),W=m.a.Da("_ancestorBindingInfo"),J=m.a.Da("_dataDependency");m.c={};var Z={script:!0,textarea:!0,template:!0};m.getBindingHandler=function(fe){return m.c[fe]};var ae={};m.fa=function(fe,xe,ge,we,ve){function Re(){var st=Ke?Ye():Ye,vt=m.a.f(st);return xe?(m.a.extend(Qe,xe),W in xe&&(Qe[W]=xe[W])):(Qe.$parents=[],Qe.$root=vt,Qe.ko=m),Qe[Q]=Pe,He?vt=Qe.$data:(Qe.$rawData=st,Qe.$data=vt),ge&&(Qe[ge]=vt),we&&we(Qe,xe,vt),xe&&xe[Q]&&!m.S.o().Vb(xe[Q])&&xe[Q](),qe&&(Qe[J]=qe),Qe.$data}var Qe=this,He=fe===ae,Ye=He?e:fe,Ke=typeof Ye=="function"&&!m.O(Ye),Pe,qe=ve&&ve.dataDependency;ve&&ve.exportDependencies?Re():(Pe=m.xb(Re),Pe.v(),Pe.ja()?Pe.equalityComparer=null:Qe[Q]=e)},m.fa.prototype.createChildContext=function(fe,xe,ge,we){if(!we&&xe&&typeof xe=="object"&&(we=xe,xe=we.as,ge=we.extend),xe&&we&&we.noChildContext){var ve=typeof fe=="function"&&!m.O(fe);return new m.fa(ae,this,null,function(Re){ge&&ge(Re),Re[xe]=ve?fe():fe},we)}return new m.fa(fe,this,xe,function(Re,Qe){Re.$parentContext=Qe,Re.$parent=Qe.$data,Re.$parents=(Qe.$parents||[]).slice(0),Re.$parents.unshift(Re.$parent),ge&&ge(Re)},we)},m.fa.prototype.extend=function(fe,xe){return new m.fa(ae,this,null,function(ge){m.a.extend(ge,typeof fe=="function"?fe(ge):fe)},xe)};var Ae=m.a.g.Z();C.prototype.Tc=function(){this.Kb&&this.Kb.N&&this.Kb.N.sd(this.node)},C.prototype.sd=function(fe){m.a.Pa(this.kb,fe),!this.kb.length&&this.H&&this.Cc()},C.prototype.Cc=function(){this.H=!0,this.yc.N&&!this.kb.length&&(this.yc.N=null,m.a.K.yb(this.node,_),m.i.ma(this.node,m.i.pa),this.Tc())},m.i={H:"childrenComplete",pa:"descendantsComplete",subscribe:function(fe,xe,ge,we,ve){var Re=m.a.g.Ub(fe,Ae,{});return Re.Fa||(Re.Fa=new m.T),ve&&ve.notifyImmediately&&Re.Zb[xe]&&m.u.G(ge,we,[fe]),Re.Fa.subscribe(ge,we,xe)},ma:function(fe,xe){var ge=m.a.g.get(fe,Ae);if(ge&&(ge.Zb[xe]=!0,ge.Fa&&ge.Fa.notifySubscribers(fe,xe),xe==m.i.H)){if(ge.N)ge.N.Cc();else if(ge.N===e&&ge.Fa&&ge.Fa.Wa(m.i.pa))throw Error("descendantsComplete event not supported for bindings on this node")}},Cb:function(fe,xe){var ge=m.a.g.Ub(fe,Ae,{});return ge.N||(ge.N=new C(fe,ge,xe[W])),xe[W]==ge?xe:xe.extend(function(we){we[W]=ge})}},m.Td=function(fe){return(fe=m.a.g.get(fe,Ae))&&fe.context},m.ib=function(fe,xe,ge){return fe.nodeType===1&&m.h.Sc(fe),G(fe,xe,q(ge))},m.ld=function(fe,xe,ge){return ge=q(ge),m.ib(fe,F(xe,ge,fe),ge)},m.Oa=function(fe,xe){xe.nodeType!==1&&xe.nodeType!==8||B(q(fe),xe)},m.vc=function(fe,xe,ge){if(!r&&t.jQuery&&(r=t.jQuery),2>arguments.length){if(xe=n.body,!xe)throw Error("ko.applyBindings: could not find document.body; has the document been loaded?")}else if(!xe||xe.nodeType!==1&&xe.nodeType!==8)throw Error("ko.applyBindings: first parameter should be your view model; second parameter should be a DOM node");j(q(fe,ge),xe)},m.Dc=function(fe){return!fe||fe.nodeType!==1&&fe.nodeType!==8?e:m.Td(fe)},m.Ec=function(fe){return(fe=m.Dc(fe))?fe.$data:e},m.b("bindingHandlers",m.c),m.b("bindingEvent",m.i),m.b("bindingEvent.subscribe",m.i.subscribe),m.b("bindingEvent.startPossiblyAsyncContentBinding",m.i.Cb),m.b("applyBindings",m.vc),m.b("applyBindingsToDescendants",m.Oa),m.b("applyBindingAccessorsToNode",m.ib),m.b("applyBindingsToNode",m.ld),m.b("contextFor",m.Dc),m.b("dataFor",m.Ec)})(),(function(_){function C(V,B){var j=Object.prototype.hasOwnProperty.call(N,V)?N[V]:_,k;j?j.subscribe(B):(j=N[V]=new m.T,j.subscribe(B),w(V,function(G,q){var Q=!(!q||!q.synchronous);F[V]={definition:G,Gd:Q},delete N[V],k||Q?j.notifySubscribers(G):m.na.zb(function(){j.notifySubscribers(G)})}),k=!0)}function w(V,B){D("getConfig",[V],function(j){j?D("loadComponent",[V,j],function(k){B(k,j)}):B(null,null)})}function D(V,B,j,k){k||(k=m.j.loaders.slice(0));var G=k.shift();if(G){var q=G[V];if(q){var Q=!1;if(q.apply(G,B.concat(function(W){Q?j(null):W!==null?j(W):D(V,B,j,k)}))!==_&&(Q=!0,!G.suppressLoaderExceptions))throw Error("Component loaders must supply values by invoking the callback, not by returning values synchronously.")}else D(V,B,j,k)}else j(null)}var N={},F={};m.j={get:function(V,B){var j=Object.prototype.hasOwnProperty.call(F,V)?F[V]:_;j?j.Gd?m.u.G(function(){B(j.definition)}):m.na.zb(function(){B(j.definition)}):C(V,B)},Bc:function(V){delete F[V]},oc:D},m.j.loaders=[],m.b("components",m.j),m.b("components.get",m.j.get),m.b("components.clearCachedDefinition",m.j.Bc)})(),(function(){function _(j,k,G,q){function Q(){--J===0&&q(W)}var W={},J=2,Z=G.template;G=G.viewModel,Z?N(k,Z,function(ae){m.j.oc("loadTemplate",[j,ae],function(Ae){W.template=Ae,Q()})}):Q(),G?N(k,G,function(ae){m.j.oc("loadViewModel",[j,ae],function(Ae){W[B]=Ae,Q()})}):Q()}function C(j,k,G){if(typeof k=="function")G(function(Q){return new k(Q)});else if(typeof k[B]=="function")G(k[B]);else if("instance"in k){var q=k.instance;G(function(){return q})}else"viewModel"in k?C(j,k.viewModel,G):j("Unknown viewModel value: "+k)}function w(j){switch(m.a.R(j)){case"script":return m.a.ua(j.text);case"textarea":return m.a.ua(j.value);case"template":if(D(j.content))return m.a.Ca(j.content.childNodes)}return m.a.Ca(j.childNodes)}function D(j){return t.DocumentFragment?j instanceof DocumentFragment:j&&j.nodeType===11}function N(j,k,G){typeof k.require=="string"?a||t.require?(a||t.require)([k.require],function(q){q&&typeof q=="object"&&q.Xd&&q.default&&(q=q.default),G(q)}):j("Uses require, but no AMD loader is present"):G(k)}function F(j){return function(k){throw Error("Component '"+j+"': "+k)}}var V={};m.j.register=function(j,k){if(!k)throw Error("Invalid configuration for "+j);if(m.j.tb(j))throw Error("Component "+j+" is already registered");V[j]=k},m.j.tb=function(j){return Object.prototype.hasOwnProperty.call(V,j)},m.j.unregister=function(j){delete V[j],m.j.Bc(j)},m.j.Fc={getConfig:function(j,k){k(m.j.tb(j)?V[j]:null)},loadComponent:function(j,k,G){var q=F(j);N(q,k,function(Q){_(j,q,Q,G)})},loadTemplate:function(j,k,G){if(j=F(j),typeof k=="string")G(m.a.ua(k));else if(k instanceof Array)G(k);else if(D(k))G(m.a.la(k.childNodes));else if(k.element)if(k=k.element,t.HTMLElement?k instanceof HTMLElement:k&&k.tagName&&k.nodeType===1)G(w(k));else if(typeof k=="string"){var q=n.getElementById(k);q?G(w(q)):j("Cannot find element with ID "+k)}else j("Unknown element type: "+k);else j("Unknown template value: "+k)},loadViewModel:function(j,k,G){C(F(j),k,G)}};var B="createViewModel";m.b("components.register",m.j.register),m.b("components.isRegistered",m.j.tb),m.b("components.unregister",m.j.unregister),m.b("components.defaultLoader",m.j.Fc),m.j.loaders.push(m.j.Fc),m.j.dd=V})(),(function(){function _(w,D){var N=w.getAttribute("params");if(N){var N=C.parseBindingsString(N,D,w,{valueAccessors:!0,bindingParams:!0}),N=m.a.Ga(N,function(B){return m.o(B,null,{l:w})}),F=m.a.Ga(N,function(B){var j=B.v();return B.ja()?m.o({read:function(){return m.a.f(B())},write:m.Za(j)&&function(k){B()(k)},l:w}):j});return Object.prototype.hasOwnProperty.call(F,"$raw")||(F.$raw=N),F}return{$raw:{}}}m.j.getComponentNameForNode=function(w){var D=m.a.R(w);if(m.j.tb(D)&&(D.indexOf("-")!=-1||""+w=="[object HTMLUnknownElement]"||8>=m.a.W&&w.tagName===D))return D},m.j.tc=function(w,D,N,F){if(D.nodeType===1){var V=m.j.getComponentNameForNode(D);if(V){if(w=w||{},w.component)throw Error('Cannot use the "component" binding on a custom element matching a component');var B={name:V,params:_(D,N)};w.component=F?function(){return B}:B}}return w};var C=new m.ga;9>m.a.W&&(m.j.register=(function(w){return function(D){return w.apply(this,arguments)}})(m.j.register),n.createDocumentFragment=(function(w){return function(){var D=w(),N=m.j.dd,F;for(F in N);return D}})(n.createDocumentFragment))})(),(function(){function _(D,N,F){if(N=N.template,!N)throw Error("Component '"+D+"' has no template");D=m.a.Ca(N),m.h.va(F,D)}function C(D,N,F){var V=D.createViewModel;return V?V.call(D,N,F):N}var w=0;m.c.component={init:function(D,N,F,V,B){function j(){var W=k&&k.dispose;typeof W=="function"&&W.call(k),q&&q.s(),G=k=q=null}var k,G,q,Q=m.a.la(m.h.childNodes(D));return m.h.Ea(D),m.a.K.za(D,j),m.o(function(){var W=m.a.f(N()),J,Z;if(typeof W=="string"?J=W:(J=m.a.f(W.name),Z=m.a.f(W.params)),!J)throw Error("No component name specified");var ae=m.i.Cb(D,B),Ae=G=++w;m.j.get(J,function(fe){if(G===Ae){if(j(),!fe)throw Error("Unknown component '"+J+"'");_(J,fe,D);var xe=C(fe,Z,{element:D,templateNodes:Q});fe=ae.createChildContext(xe,{extend:function(ge){ge.$component=xe,ge.$componentTemplateNodes=Q}}),xe&&xe.koDescendantsComplete&&(q=m.i.subscribe(D,m.i.pa,xe.koDescendantsComplete,xe)),k=xe,m.Oa(fe,D)}})},null,{l:D}),{controlsDescendantBindings:!0}}},m.h.ea.component=!0})();var O={class:"className",for:"htmlFor"};m.c.attr={update:function(_,C){var w=m.a.f(C())||{};m.a.P(w,function(D,N){N=m.a.f(N);var F=D.indexOf(":"),F="lookupNamespaceURI"in _&&0<F&&_.lookupNamespaceURI(D.substr(0,F)),V=N===!1||N===null||N===e;V?F?_.removeAttributeNS(F,D):_.removeAttribute(D):N=N.toString(),8>=m.a.W&&D in O?(D=O[D],V?_.removeAttribute(D):_[D]=N):V||(F?_.setAttributeNS(F,D,N):_.setAttribute(D,N)),D==="name"&&m.a.Yc(_,V?"":N)})}},(function(){m.c.checked={after:["value","attr"],init:function(_,C,w){function D(){var W=_.checked,J=F();if(!m.S.Ya()&&(W||!B&&!m.S.qa())){var Z=m.u.G(C);if(k){var ae=G?Z.v():Z,Ae=Q;Q=J,Ae!==J?W&&(m.a.Na(ae,J,!0),m.a.Na(ae,Ae,!1)):m.a.Na(ae,J,W),G&&m.Za(Z)&&Z(ae)}else V&&(J===e?J=W:W||(J=e)),m.m.eb(Z,w,"checked",J,!0)}}function N(){var W=m.a.f(C()),J=F();k?(_.checked=0<=m.a.A(W,J),Q=J):_.checked=V&&J===e?!!W:F()===W}var F=m.xb(function(){if(w.has("checkedValue"))return m.a.f(w.get("checkedValue"));if(q)return w.has("value")?m.a.f(w.get("value")):_.value}),V=_.type=="checkbox",B=_.type=="radio";if(V||B){var j=C(),k=V&&m.a.f(j)instanceof Array,G=!(k&&j.push&&j.splice),q=B||k,Q=k?F():e;B&&!_.name&&m.c.uniqueName.init(_,function(){return!0}),m.o(D,null,{l:_}),m.a.B(_,"click",D),m.o(N,null,{l:_}),j=e}}},m.m.wa.checked=!0,m.c.checkedValue={update:function(_,C){_.value=m.a.f(C())}}})(),m.c.class={update:function(_,C){var w=m.a.Db(m.a.f(C()));m.a.Eb(_,_.__ko__cssValue,!1),_.__ko__cssValue=w,m.a.Eb(_,w,!0)}},m.c.css={update:function(_,C){var w=m.a.f(C());w!==null&&typeof w=="object"?m.a.P(w,function(D,N){N=m.a.f(N),m.a.Eb(_,D,N)}):m.c.class.update(_,C)}},m.c.enable={update:function(_,C){var w=m.a.f(C());w&&_.disabled?_.removeAttribute("disabled"):w||_.disabled||(_.disabled=!0)}},m.c.disable={update:function(_,C){m.c.enable.update(_,function(){return!m.a.f(C())})}},m.c.event={init:function(_,C,w,D,N){var F=C()||{};m.a.P(F,function(V){typeof V=="string"&&m.a.B(_,V,function(B){var j,k=C()[V];if(k){try{var G=m.a.la(arguments);D=N.$data,G.unshift(D),j=k.apply(D,G)}finally{j!==!0&&(B.preventDefault?B.preventDefault():B.returnValue=!1)}w.get(V+"Bubble")===!1&&(B.cancelBubble=!0,B.stopPropagation&&B.stopPropagation())}})})}},m.c.foreach={Rc:function(_){return function(){var C=_(),w=m.a.bc(C);return!w||typeof w.length=="number"?{foreach:C,templateEngine:m.ba.Ma}:(m.a.f(C),{foreach:w.data,as:w.as,noChildContext:w.noChildContext,includeDestroyed:w.includeDestroyed,afterAdd:w.afterAdd,beforeRemove:w.beforeRemove,afterRender:w.afterRender,beforeMove:w.beforeMove,afterMove:w.afterMove,templateEngine:m.ba.Ma})}},init:function(_,C){return m.c.template.init(_,m.c.foreach.Rc(C))},update:function(_,C,w,D,N){return m.c.template.update(_,m.c.foreach.Rc(C),w,D,N)}},m.m.Ra.foreach=!1,m.h.ea.foreach=!0,m.c.hasfocus={init:function(_,C,w){function D(V){_.__ko_hasfocusUpdating=!0;var B=_.ownerDocument;if("activeElement"in B){var j;try{j=B.activeElement}catch{j=B.body}V=j===_}B=C(),m.m.eb(B,w,"hasfocus",V,!0),_.__ko_hasfocusLastValue=V,_.__ko_hasfocusUpdating=!1}var N=D.bind(null,!0),F=D.bind(null,!1);m.a.B(_,"focus",N),m.a.B(_,"focusin",N),m.a.B(_,"blur",F),m.a.B(_,"focusout",F),_.__ko_hasfocusLastValue=!1},update:function(_,C){var w=!!m.a.f(C());_.__ko_hasfocusUpdating||_.__ko_hasfocusLastValue===w||(w?_.focus():_.blur(),!w&&_.__ko_hasfocusLastValue&&_.ownerDocument.body.focus(),m.u.G(m.a.Fb,null,[_,w?"focusin":"focusout"]))}},m.m.wa.hasfocus=!0,m.c.hasFocus=m.c.hasfocus,m.m.wa.hasFocus="hasfocus",m.c.html={init:function(){return{controlsDescendantBindings:!0}},update:function(_,C){m.a.fc(_,C())}},(function(){function _(C,w,D){m.c[C]={init:function(N,F,V,B,j){var k,G,q={},Q,W,J;if(w){B=V.get("as");var Z=V.get("noChildContext");J=!(B&&Z),q={as:B,noChildContext:Z,exportDependencies:J}}return W=(Q=V.get("completeOn")=="render")||V.has(m.i.pa),m.o(function(){var ae=m.a.f(F()),Ae=!D!=!ae,fe=!G,xe;(J||Ae!==k)&&(W&&(j=m.i.Cb(N,j)),Ae&&((!w||J)&&(q.dataDependency=m.S.o()),xe=w?j.createChildContext(typeof ae=="function"?ae:F,q):m.S.qa()?j.extend(null,q):j),fe&&m.S.qa()&&(G=m.a.Ca(m.h.childNodes(N),!0)),Ae?(fe||m.h.va(N,m.a.Ca(G)),m.Oa(xe,N)):(m.h.Ea(N),Q||m.i.ma(N,m.i.H)),k=Ae)},null,{l:N}),{controlsDescendantBindings:!0}}},m.m.Ra[C]=!1,m.h.ea[C]=!0}_("if"),_("ifnot",!1,!0),_("with",!0)})(),m.c.let={init:function(_,C,w,D,N){return C=N.extend(C),m.Oa(C,_),{controlsDescendantBindings:!0}}},m.h.ea.let=!0;var L={};m.c.options={init:function(_){if(m.a.R(_)!=="select")throw Error("options binding applies only to SELECT elements");for(;0<_.length;)_.remove(0);return{controlsDescendantBindings:!0}},update:function(_,C,w){function D(){return m.a.jb(_.options,function(Z){return Z.selected})}function N(Z,ae,Ae){var fe=typeof ae;return fe=="function"?ae(Z):fe=="string"?Z[ae]:Ae}function F(Z,ae){if(W&&k)m.i.ma(_,m.i.H);else if(Q.length){var Ae=0<=m.a.A(Q,m.w.M(ae[0]));m.a.Zc(ae[0],Ae),W&&!Ae&&m.u.G(m.a.Fb,null,[_,"change"])}}var V=_.multiple,B=_.length!=0&&V?_.scrollTop:null,j=m.a.f(C()),k=w.get("valueAllowUnset")&&w.has("value"),G=w.get("optionsIncludeDestroyed");C={};var q,Q=[];k||(V?Q=m.a.Mb(D(),m.w.M):0<=_.selectedIndex&&Q.push(m.w.M(_.options[_.selectedIndex]))),j&&(typeof j.length>"u"&&(j=[j]),q=m.a.jb(j,function(Z){return G||Z===e||Z===null||!m.a.f(Z._destroy)}),w.has("optionsCaption")&&(j=m.a.f(w.get("optionsCaption")),j!==null&&j!==e&&q.unshift(L)));var W=!1;if(C.beforeRemove=function(Z){_.removeChild(Z)},j=F,w.has("optionsAfterRender")&&typeof w.get("optionsAfterRender")=="function"&&(j=function(Z,ae){F(0,ae),m.u.G(w.get("optionsAfterRender"),null,[ae[0],Z!==L?Z:e])}),m.a.ec(_,q,function(Z,ae,Ae){return Ae.length&&(Q=!k&&Ae[0].selected?[m.w.M(Ae[0])]:[],W=!0),ae=_.ownerDocument.createElement("option"),Z===L?(m.a.Bb(ae,w.get("optionsCaption")),m.w.cb(ae,e)):(Ae=N(Z,w.get("optionsValue"),Z),m.w.cb(ae,m.a.f(Ae)),Z=N(Z,w.get("optionsText"),Ae),m.a.Bb(ae,Z)),[ae]},C,j),!k){var J;V?J=Q.length&&D().length<Q.length:J=Q.length&&0<=_.selectedIndex?m.w.M(_.options[_.selectedIndex])!==Q[0]:Q.length||0<=_.selectedIndex,J&&m.u.G(m.a.Fb,null,[_,"change"])}(k||m.S.Ya())&&m.i.ma(_,m.i.H),m.a.wd(_),B&&20<Math.abs(B-_.scrollTop)&&(_.scrollTop=B)}},m.c.options.$b=m.a.g.Z(),m.c.selectedOptions={init:function(_,C,w){function D(){var V=C(),B=[];m.a.D(_.getElementsByTagName("option"),function(j){j.selected&&B.push(m.w.M(j))}),m.m.eb(V,w,"selectedOptions",B)}function N(){var V=m.a.f(C()),B=_.scrollTop;V&&typeof V.length=="number"&&m.a.D(_.getElementsByTagName("option"),function(j){var k=0<=m.a.A(V,m.w.M(j));j.selected!=k&&m.a.Zc(j,k)}),_.scrollTop=B}if(m.a.R(_)!="select")throw Error("selectedOptions binding applies only to SELECT elements");var F;m.i.subscribe(_,m.i.H,function(){F?D():(m.a.B(_,"change",D),F=m.o(N,null,{l:_}))},null,{notifyImmediately:!0})},update:function(){}},m.m.wa.selectedOptions=!0,m.c.style={update:function(_,C){var w=m.a.f(C()||{});m.a.P(w,function(D,N){if(N=m.a.f(N),(N===null||N===e||N===!1)&&(N=""),r)r(_).css(D,N);else if(/^--/.test(D))_.style.setProperty(D,N);else{D=D.replace(/-(\w)/g,function(V,B){return B.toUpperCase()});var F=_.style[D];_.style[D]=N,N===F||_.style[D]!=F||isNaN(N)||(_.style[D]=N+"px")}})}},m.c.submit={init:function(_,C,w,D,N){if(typeof C()!="function")throw Error("The value for a submit binding must be a function");m.a.B(_,"submit",function(F){var V,B=C();try{V=B.call(N.$data,_)}finally{V!==!0&&(F.preventDefault?F.preventDefault():F.returnValue=!1)}})}},m.c.text={init:function(){return{controlsDescendantBindings:!0}},update:function(_,C){m.a.Bb(_,C())}},m.h.ea.text=!0,(function(){if(t&&t.navigator){var _=function(q){if(q)return parseFloat(q[1])},C=t.navigator.userAgent,w,D,N,F,V;(w=t.opera&&t.opera.version&&parseInt(t.opera.version()))||(V=_(C.match(/Edge\/([^ ]+)$/)))||_(C.match(/Chrome\/([^ ]+)/))||(D=_(C.match(/Version\/([^ ]+) Safari/)))||(N=_(C.match(/Firefox\/([^ ]+)/)))||(F=m.a.W||_(C.match(/MSIE ([^ ]+)/)))||(F=_(C.match(/rv:([^ )]+)/)))}if(8<=F&&10>F)var B=m.a.g.Z(),j=m.a.g.Z(),k=function(q){var Q=this.activeElement;(Q=Q&&m.a.g.get(Q,j))&&Q(q)},G=function(q,Q){var W=q.ownerDocument;m.a.g.get(W,B)||(m.a.g.set(W,B,!0),m.a.B(W,"selectionchange",k)),m.a.g.set(q,j,Q)};m.c.textInput={init:function(q,Q,W){function J(Re,Qe){m.a.B(q,Re,Qe)}function Z(){var Re=m.a.f(Q());(Re===null||Re===e)&&(Re=""),ge!==e&&Re===ge?m.a.setTimeout(Z,4):q.value!==Re&&(ve=!0,q.value=Re,ve=!1,fe=q.value)}function ae(){xe||(ge=q.value,xe=m.a.setTimeout(Ae,4))}function Ae(){clearTimeout(xe),ge=xe=e;var Re=q.value;fe!==Re&&(fe=Re,m.m.eb(Q(),W,"textInput",Re))}var fe=q.value,xe,ge,we=m.a.W==9?ae:Ae,ve=!1;F&&J("keypress",Ae),11>F&&J("propertychange",function(Re){ve||Re.propertyName!=="value"||we(Re)}),F==8&&(J("keyup",Ae),J("keydown",Ae)),G&&(G(q,we),J("dragend",ae)),(!F||9<=F)&&J("input",we),5>D&&m.a.R(q)==="textarea"?(J("keydown",ae),J("paste",ae),J("cut",ae)):11>w?J("keydown",ae):4>N?(J("DOMAutoComplete",Ae),J("dragdrop",Ae),J("drop",Ae)):V&&q.type==="number"&&J("keydown",ae),J("change",Ae),J("blur",Ae),m.o(Z,null,{l:q})}},m.m.wa.textInput=!0,m.c.textinput={preprocess:function(q,Q,W){W("textInput",q)}}})(),m.c.uniqueName={init:function(_,C){if(C()){var w="ko_unique_"+ ++m.c.uniqueName.rd;m.a.Yc(_,w)}}},m.c.uniqueName.rd=0,m.c.using={init:function(_,C,w,D,N){var F;return w.has("as")&&(F={as:w.get("as"),noChildContext:w.get("noChildContext")}),C=N.createChildContext(C,F),m.Oa(C,_),{controlsDescendantBindings:!0}}},m.h.ea.using=!0,m.c.value={init:function(_,C,w){var D=m.a.R(_),N=D=="input";if(!N||_.type!="checkbox"&&_.type!="radio"){var F=[],V=w.get("valueUpdate"),B=!1,j=null;V&&(typeof V=="string"?F=[V]:F=m.a.wc(V),m.a.Pa(F,"change"));var k=function(){j=null,B=!1;var Q=C(),W=m.w.M(_);m.m.eb(Q,w,"value",W)};!m.a.W||!N||_.type!="text"||_.autocomplete=="off"||_.form&&_.form.autocomplete=="off"||m.a.A(F,"propertychange")!=-1||(m.a.B(_,"propertychange",function(){B=!0}),m.a.B(_,"focus",function(){B=!1}),m.a.B(_,"blur",function(){B&&k()})),m.a.D(F,function(Q){var W=k;m.a.Ud(Q,"after")&&(W=function(){j=m.w.M(_),m.a.setTimeout(k,0)},Q=Q.substring(5)),m.a.B(_,Q,W)});var G;if(G=N&&_.type=="file"?function(){var Q=m.a.f(C());Q===null||Q===e||Q===""?_.value="":m.u.G(k)}:function(){var Q=m.a.f(C()),W=m.w.M(_);j!==null&&Q===j?m.a.setTimeout(G,0):(Q!==W||W===e)&&(D==="select"?(W=w.get("valueAllowUnset"),m.w.cb(_,Q,W),W||Q===m.w.M(_)||m.u.G(k)):m.w.cb(_,Q))},D==="select"){var q;m.i.subscribe(_,m.i.H,function(){q?w.get("valueAllowUnset")?G():k():(m.a.B(_,"change",k),q=m.o(G,null,{l:_}))},null,{notifyImmediately:!0})}else m.a.B(_,"change",k),m.o(G,null,{l:_})}else m.ib(_,{checkedValue:C})},update:function(){}},m.m.wa.value=!0,m.c.visible={update:function(_,C){var w=m.a.f(C()),D=_.style.display!="none";w&&!D?_.style.display="":!w&&D&&(_.style.display="none")}},m.c.hidden={update:function(_,C){m.c.visible.update(_,function(){return!m.a.f(C())})}},(function(_){m.c[_]={init:function(C,w,D,N,F){return m.c.event.init.call(this,C,function(){var V={};return V[_]=w(),V},D,N,F)}}})("click"),m.ca=function(){},m.ca.prototype.renderTemplateSource=function(){throw Error("Override renderTemplateSource")},m.ca.prototype.createJavaScriptEvaluatorBlock=function(){throw Error("Override createJavaScriptEvaluatorBlock")},m.ca.prototype.makeTemplateSource=function(_,C){if(typeof _=="string"){C=C||n;var w=C.getElementById(_);if(!w)throw Error("Cannot find template with ID "+_);return new m.C.F(w)}if(_.nodeType==1||_.nodeType==8)return new m.C.ia(_);throw Error("Unknown template type: "+_)},m.ca.prototype.renderTemplate=function(_,C,w,D){return _=this.makeTemplateSource(_,D),this.renderTemplateSource(_,C,w,D)},m.ca.prototype.isTemplateRewritten=function(_,C){return this.allowTemplateRewriting===!1?!0:this.makeTemplateSource(_,C).data("isRewritten")},m.ca.prototype.rewriteTemplate=function(_,C,w){_=this.makeTemplateSource(_,w),C=C(_.text()),_.text(C),_.data("isRewritten",!0)},m.b("templateEngine",m.ca),m.kc=(function(){function _(D,N,F,V){D=m.m.ac(D);for(var B=m.m.Ra,j=0;j<D.length;j++){var k=D[j].key;if(Object.prototype.hasOwnProperty.call(B,k)){var G=B[k];if(typeof G=="function"){if(k=G(D[j].value))throw Error(k)}else if(!G)throw Error("This template engine does not support the '"+k+"' binding within its templates")}}return F="ko.__tr_ambtns(function($context,$element){return(function(){return{ "+m.m.vb(D,{valueAccessors:!0})+" } })()},'"+F.toLowerCase()+"')",V.createJavaScriptEvaluatorBlock(F)+N}var C=/(<([a-z]+\d*)(?:\s+(?!data-bind\s*=\s*)[a-z0-9\-]+(?:=(?:\"[^\"]*\"|\'[^\']*\'|[^>]*))?)*\s+)data-bind\s*=\s*(["'])([\s\S]*?)\3/gi,w=/\x3c!--\s*ko\b\s*([\s\S]*?)\s*--\x3e/g;return{xd:function(D,N,F){N.isTemplateRewritten(D,F)||N.rewriteTemplate(D,function(V){return m.kc.Ld(V,N)},F)},Ld:function(D,N){return D.replace(C,function(F,V,B,j,k){return _(k,V,B,N)}).replace(w,function(F,V){return _(V,"<!-- ko -->","#comment",N)})},md:function(D,N){return m.aa.Xb(function(F,V){var B=F.nextSibling;B&&B.nodeName.toLowerCase()===N&&m.ib(B,D,V)})}}})(),m.b("__tr_ambtns",m.kc.md),(function(){m.C={},m.C.F=function(w){if(this.F=w){var D=m.a.R(w);this.ab=D==="script"?1:D==="textarea"?2:D=="template"&&w.content&&w.content.nodeType===11?3:4}},m.C.F.prototype.text=function(){var w=this.ab===1?"text":this.ab===2?"value":"innerHTML";if(arguments.length==0)return this.F[w];var D=arguments[0];w==="innerHTML"?m.a.fc(this.F,D):this.F[w]=D};var _=m.a.g.Z()+"_";m.C.F.prototype.data=function(w){if(arguments.length===1)return m.a.g.get(this.F,_+w);m.a.g.set(this.F,_+w,arguments[1])};var C=m.a.g.Z();m.C.F.prototype.nodes=function(){var w=this.F;if(arguments.length==0){var D=m.a.g.get(w,C)||{},N=D.lb||(this.ab===3?w.content:this.ab===4?w:e);if(!N||D.jd){var F=this.text();F&&F!==D.bb&&(N=m.a.Md(F,w.ownerDocument),m.a.g.set(w,C,{lb:N,bb:F,jd:!0}))}return N}D=arguments[0],this.ab!==e&&this.text(""),m.a.g.set(w,C,{lb:D})},m.C.ia=function(w){this.F=w},m.C.ia.prototype=new m.C.F,m.C.ia.prototype.constructor=m.C.ia,m.C.ia.prototype.text=function(){if(arguments.length==0){var w=m.a.g.get(this.F,C)||{};return w.bb===e&&w.lb&&(w.bb=w.lb.innerHTML),w.bb}m.a.g.set(this.F,C,{bb:arguments[0]})},m.b("templateSources",m.C),m.b("templateSources.domElement",m.C.F),m.b("templateSources.anonymousTemplate",m.C.ia)})(),(function(){function _(j,k,G){var q;for(k=m.h.nextSibling(k);j&&(q=j)!==k;)j=m.h.nextSibling(q),G(q,j)}function C(j,k){if(j.length){var G=j[0],q=j[j.length-1],Q=G.parentNode,W=m.ga.instance,J=W.preprocessNode;if(J){if(_(G,q,function(Z,ae){var Ae=Z.previousSibling,fe=J.call(W,Z);fe&&(Z===G&&(G=fe[0]||ae),Z===q&&(q=fe[fe.length-1]||Ae))}),j.length=0,!G)return;G===q?j.push(G):(j.push(G,q),m.a.Ua(j,Q))}_(G,q,function(Z){Z.nodeType!==1&&Z.nodeType!==8||m.vc(k,Z)}),_(G,q,function(Z){Z.nodeType!==1&&Z.nodeType!==8||m.aa.cd(Z,[k])}),m.a.Ua(j,Q)}}function w(j){return j.nodeType?j:0<j.length?j[0]:null}function D(j,k,G,q,Q){Q=Q||{};var W=(j&&w(j)||G||{}).ownerDocument,J=Q.templateEngine||F;if(m.kc.xd(G,J,W),G=J.renderTemplate(G,q,Q,W),typeof G.length!="number"||0<G.length&&typeof G[0].nodeType!="number")throw Error("Template engine must return an array of DOM nodes");switch(W=!1,k){case"replaceChildren":m.h.va(j,G),W=!0;break;case"replaceNode":m.a.Xc(j,G),W=!0;break;case"ignoreTargetNode":break;default:throw Error("Unknown renderMode: "+k)}return W&&(C(G,q),Q.afterRender&&m.u.G(Q.afterRender,null,[G,q[Q.as||"$data"]]),k=="replaceChildren"&&m.i.ma(j,m.i.H)),G}function N(j,k,G){return m.O(j)?j():typeof j=="function"?j(k,G):j}var F;m.gc=function(j){if(j!=e&&!(j instanceof m.ca))throw Error("templateEngine must inherit from ko.templateEngine");F=j},m.dc=function(j,k,G,q,Q){if(G=G||{},(G.templateEngine||F)==e)throw Error("Set a template engine before calling renderTemplate");if(Q=Q||"replaceChildren",q){var W=w(q);return m.$(function(){var Z=k&&k instanceof m.fa?k:new m.fa(k,null,null,null,{exportDependencies:!0}),J=N(j,Z.$data,Z),Z=D(q,Q,J,Z,G);Q=="replaceNode"&&(q=Z,W=w(q))},null,{Sa:function(){return!W||!m.a.Sb(W)},l:W&&Q=="replaceNode"?W.parentNode:W})}return m.aa.Xb(function(J){m.dc(j,k,G,J,"replaceNode")})},m.Qd=function(j,k,G,q,Q){function W(ge,we){m.u.G(m.a.ec,null,[q,ge,Z,G,J,we]),m.i.ma(q,m.i.H)}function J(ge,we){C(we,ae),G.afterRender&&G.afterRender(we,ge),ae=null}function Z(ge,we){ae=Q.createChildContext(ge,{as:Ae,noChildContext:G.noChildContext,extend:function(Re){Re.$index=we,Ae&&(Re[Ae+"Index"]=we)}});var ve=N(j,ge,ae);return D(q,"ignoreTargetNode",ve,ae,G)}var ae,Ae=G.as,fe=G.includeDestroyed===!1||m.options.foreachHidesDestroyed&&!G.includeDestroyed;if(fe||G.beforeRemove||!m.Pc(k))return m.$(function(){var ge=m.a.f(k)||[];typeof ge.length>"u"&&(ge=[ge]),fe&&(ge=m.a.jb(ge,function(we){return we===e||we===null||!m.a.f(we._destroy)})),W(ge)},null,{l:q});W(k.v());var xe=k.subscribe(function(ge){W(k(),ge)},null,"arrayChange");return xe.l(q),xe};var V=m.a.g.Z(),B=m.a.g.Z();m.c.template={init:function(j,k){var G=m.a.f(k());if(typeof G=="string"||"name"in G)m.h.Ea(j);else if("nodes"in G){if(G=G.nodes||[],m.O(G))throw Error('The "nodes" option must be a plain, non-observable array.');var q=G[0]&&G[0].parentNode;q&&m.a.g.get(q,B)||(q=m.a.Yb(G),m.a.g.set(q,B,!0)),new m.C.ia(j).nodes(q)}else if(G=m.h.childNodes(j),0<G.length)q=m.a.Yb(G),new m.C.ia(j).nodes(q);else throw Error("Anonymous template defined, but no template content was provided");return{controlsDescendantBindings:!0}},update:function(j,k,G,q,Q){var W=k();k=m.a.f(W),G=!0,q=null,typeof k=="string"?k={}:(W="name"in k?k.name:j,"if"in k&&(G=m.a.f(k.if)),G&&"ifnot"in k&&(G=!m.a.f(k.ifnot)),G&&!W&&(G=!1)),"foreach"in k?q=m.Qd(W,G&&k.foreach||[],k,j,Q):G?(G=Q,"data"in k&&(G=Q.createChildContext(k.data,{as:k.as,noChildContext:k.noChildContext,exportDependencies:!0})),q=m.dc(W,G,k,j)):m.h.Ea(j),Q=q,(k=m.a.g.get(j,V))&&typeof k.s=="function"&&k.s(),m.a.g.set(j,V,!Q||Q.ja&&!Q.ja()?e:Q)}},m.m.Ra.template=function(j){return j=m.m.ac(j),j.length==1&&j[0].unknown||m.m.Id(j,"name")?null:"This template engine does not support anonymous templates nested within its templates"},m.h.ea.template=!0})(),m.b("setTemplateEngine",m.gc),m.b("renderTemplate",m.dc),m.a.Kc=function(_,C,w){if(_.length&&C.length){var D,N,F,V,B;for(D=N=0;(!w||D<w)&&(V=_[N]);++N){for(F=0;B=C[F];++F)if(V.value===B.value){V.moved=B.index,B.moved=V.index,C.splice(F,1),D=F=0;break}D+=F}}},m.a.Pb=(function(){function _(C,w,D,N,F){var V=Math.min,B=Math.max,j=[],k,G=C.length,q,Q=w.length,W=Q-G||1,J=G+Q+1,Z,ae,Ae;for(k=0;k<=G;k++)for(ae=Z,j.push(Z=[]),Ae=V(Q,k+W),q=B(0,k-1);q<=Ae;q++)Z[q]=q?k?C[k-1]===w[q-1]?ae[q-1]:V(ae[q]||J,Z[q-1]||J)+1:q+1:k+1;for(V=[],B=[],W=[],k=G,q=Q;k||q;)Q=j[k][q]-1,q&&Q===j[k][q-1]?B.push(V[V.length]={status:D,value:w[--q],index:q}):k&&Q===j[k-1][q]?W.push(V[V.length]={status:N,value:C[--k],index:k}):(--q,--k,F.sparse||V.push({status:"retained",value:w[q]}));return m.a.Kc(W,B,!F.dontLimitMoves&&10*G),V.reverse()}return function(C,w,D){return D=typeof D=="boolean"?{dontLimitMoves:D}:D||{},C=C||[],w=w||[],C.length<w.length?_(C,w,"added","deleted",D):_(w,C,"deleted","added",D)}})(),m.b("utils.compareArrays",m.a.Pb),(function(){function _(D,N,F,V,B){var j=[],k=m.$(function(){var G=N(F,B,m.a.Ua(j,D))||[];0<j.length&&(m.a.Xc(j,G),V&&m.u.G(V,null,[F,G,B])),j.length=0,m.a.Nb(j,G)},null,{l:D,Sa:function(){return!m.a.kd(j)}});return{Y:j,$:k.ja()?k:e}}var C=m.a.g.Z(),w=m.a.g.Z();m.a.ec=function(D,N,F,V,B,j){function k(vt){ve={Aa:vt,pb:m.ta(ae++)},J.push(ve),W||we.push(ve)}function G(vt){ve=Q[vt],ae!==ve.pb.v()&&ge.push(ve),ve.pb(ae++),m.a.Ua(ve.Y,D),J.push(ve)}function q(vt,jt){if(vt)for(var lt=0,mt=jt.length;lt<mt;lt++)m.a.D(jt[lt].Y,function(ft){vt(ft,lt,jt[lt].Aa)})}N=N||[],typeof N.length>"u"&&(N=[N]),V=V||{};var Q=m.a.g.get(D,C),W=!Q,J=[],Z=0,ae=0,Ae=[],fe=[],xe=[],ge=[],we=[],ve,Re=0;if(W)m.a.D(N,k);else{if(!j||Q&&Q._countWaitingForRemove){var Qe=m.a.Mb(Q,function(vt){return vt.Aa});j=m.a.Pb(Qe,N,{dontLimitMoves:V.dontLimitMoves,sparse:!0})}for(var Qe=0,He,Ye,Ke;He=j[Qe];Qe++)switch(Ye=He.moved,Ke=He.index,He.status){case"deleted":for(;Z<Ke;)G(Z++);Ye===e&&(ve=Q[Z],ve.$&&(ve.$.s(),ve.$=e),m.a.Ua(ve.Y,D).length&&(V.beforeRemove&&(J.push(ve),Re++,ve.Aa===w?ve=null:xe.push(ve)),ve&&Ae.push.apply(Ae,ve.Y))),Z++;break;case"added":for(;ae<Ke;)G(Z++);Ye!==e?(fe.push(J.length),G(Ye)):k(He.value)}for(;ae<N.length;)G(Z++);J._countWaitingForRemove=Re}m.a.g.set(D,C,J),q(V.beforeMove,ge),m.a.D(Ae,V.beforeRemove?m.oa:m.removeNode);var Pe,qe,st;try{st=D.ownerDocument.activeElement}catch{}if(fe.length)for(;(Qe=fe.shift())!=e;){for(ve=J[Qe],Pe=e;Qe;)if((qe=J[--Qe].Y)&&qe.length){Pe=qe[qe.length-1];break}for(N=0;Z=ve.Y[N];Pe=Z,N++)m.h.Wb(D,Z,Pe)}for(Qe=0;ve=J[Qe];Qe++){for(ve.Y||m.a.extend(ve,_(D,F,ve.Aa,B,ve.pb)),N=0;Z=ve.Y[N];Pe=Z,N++)m.h.Wb(D,Z,Pe);!ve.Ed&&B&&(B(ve.Aa,ve.Y,ve.pb),ve.Ed=!0,Pe=ve.Y[ve.Y.length-1])}for(st&&D.ownerDocument.activeElement!=st&&st.focus(),q(V.beforeRemove,xe),Qe=0;Qe<xe.length;++Qe)xe[Qe].Aa=w;q(V.afterMove,ge),q(V.afterAdd,we)}})(),m.b("utils.setDomNodeChildrenFromArrayMapping",m.a.ec),m.ba=function(){this.allowTemplateRewriting=!1},m.ba.prototype=new m.ca,m.ba.prototype.constructor=m.ba,m.ba.prototype.renderTemplateSource=function(_,C,w,D){return(C=!(9>m.a.W)&&_.nodes?_.nodes():null)?m.a.la(C.cloneNode(!0).childNodes):(_=_.text(),m.a.ua(_,D))},m.ba.Ma=new m.ba,m.gc(m.ba.Ma),m.b("nativeTemplateEngine",m.ba),(function(){m.$a=function(){var C=this.Hd=(function(){if(!r||!r.tmpl)return 0;try{if(0<=r.tmpl.tag.tmpl.open.toString().indexOf("__"))return 2}catch{}return 1})();this.renderTemplateSource=function(w,D,N,F){if(F=F||n,N=N||{},2>C)throw Error("Your version of jQuery.tmpl is too old. Please upgrade to jQuery.tmpl 1.0.0pre or later.");var V=w.data("precompiled");return V||(V=w.text()||"",V=r.template(null,"{{ko_with $item.koBindingContext}}"+V+"{{/ko_with}}"),w.data("precompiled",V)),w=[D.$data],D=r.extend({koBindingContext:D},N.templateOptions),D=r.tmpl(V,w,D),D.appendTo(F.createElement("div")),r.fragments={},D},this.createJavaScriptEvaluatorBlock=function(w){return"{{ko_code ((function() { return "+w+" })()) }}"},this.addTemplate=function(w,D){n.write("<script type='text/html' id='"+w+"'>"+D+"<\/script>")},0<C&&(r.tmpl.tag.ko_code={open:"__.push($1 || '');"},r.tmpl.tag.ko_with={open:"with($1) {",close:"} "})},m.$a.prototype=new m.ca,m.$a.prototype.constructor=m.$a;var _=new m.$a;0<_.Hd&&m.gc(_),m.b("jqueryTmplTemplateEngine",m.$a)})()})})()})()})();var L6t=ko;typeof window<"u"?(ko=window.ko,typeof XM<"u"?window.ko=XM:delete window.ko):(ko=global.ko,typeof XM<"u"?global.ko=XM:delete global.ko);var DI=L6t;/** * @license * Knockout ES5 plugin - https://github.com/SteveSanderson/knockout-es5 * Copyright (c) Steve Sanderson * MIT license - */var Cae="__knockoutObservables",vae="__knockoutSubscribable";function B2e(e,t){if(!e)throw new Error("When calling ko.track, you must pass an object as the first parameter.");var n=this,i=k2e(e,!0);return t=t||Object.getOwnPropertyNames(e),t.forEach(function(r){if(!(r===Cae||r===vae)&&!(r in i)){var o=e[r],s=o instanceof Array,a=n.isObservable(o)?o:s?n.observableArray(o):n.observable(o);Object.defineProperty(e,r,{configurable:!0,enumerable:!0,get:a,set:n.isWriteableObservable(a)?a:void 0}),i[r]=a,s&&F6t(n,a)}}),e}function k2e(e,t){var n=e[Cae];return!n&&t&&(n={},Object.defineProperty(e,Cae,{value:n})),n}function L6t(e,t,n){var i=this,r={owner:e,deferEvaluation:!0};if(typeof n=="function")r.read=n;else{if("value"in n)throw new Error('For ko.defineProperty, you must not specify a "value" for the property. You must provide a "get" function.');if(typeof n.get!="function")throw new Error('For ko.defineProperty, the third parameter must be either an evaluator function, or an options object containing a function called "get".');r.read=n.get,r.write=n.set}return e[t]=i.computed(r),B2e.call(i,e,[t]),e}function F6t(e,t){var n=null;e.computed(function(){n&&(n.dispose(),n=null);var i=t();i instanceof Array&&(n=B6t(e,t,i))})}function B6t(e,t,n){var i=k6t(e,n);return i.subscribe(t)}function k6t(e,t){var n=t[vae];if(!n){n=new e.subscribable,Object.defineProperty(t,vae,{value:n});var i={};U6t(t,n,i),z6t(e,t,n,i)}return n}function U6t(e,t,n){["pop","push","reverse","shift","sort","splice","unshift"].forEach(function(i){var r=e[i];e[i]=function(){var o=r.apply(this,arguments);return n.pause!==!0&&t.notifySubscribers(this),o}})}function z6t(e,t,n,i){["remove","removeAll","destroy","destroyAll","replace"].forEach(function(r){Object.defineProperty(t,r,{enumerable:!1,value:function(){var o;i.pause=!0;try{o=e.observableArray.fn[r].apply(e.observableArray(t),arguments)}finally{i.pause=!1}return n.notifySubscribers(t),o}})})}function U2e(e,t){if(!e)return null;var n=k2e(e,!1);return n&&n[t]||null}function V6t(e,t){var n=U2e(e,t);n&&n.valueHasMutated()}function j6t(e){e.track=B2e,e.getObservable=U2e,e.valueHasMutated=V6t,e.defineProperty=L6t}var Y7={attachToKo:j6t};var z2e="http://www.w3.org/2000/svg",V2e="cesium-svgPath-svg",H6t={register:function(e){e.bindingHandlers.cesiumSvgPath={init:function(t,n){let i=document.createElementNS(z2e,"svg:svg");i.setAttribute("class",V2e);let r=document.createElementNS(z2e,"path");return i.appendChild(r),e.virtualElements.setDomNodeChildren(t,[i]),e.computed({read:function(){let o=e.unwrap(n());r.setAttribute("d",e.unwrap(o.path));let s=e.unwrap(o.width),a=e.unwrap(o.height);i.setAttribute("width",s),i.setAttribute("height",a),i.setAttribute("viewBox",`0 0 ${s} ${a}`),o.css&&i.setAttribute("class",`${V2e} ${e.unwrap(o.css)}`)},disposeWhenNodeIsRemoved:t}),{controlsDescendantBindings:!0}}},e.virtualElements.allowedBindings.cesiumSvgPath=!0}},X7=H6t;Y7.attachToKo(DI);X7.register(DI);var Se=DI;function KM(e){l(e)||(e=new Mp),this._clock=e,this._eventHelper=new Qo,this._eventHelper.add(e.onTick,this.synchronize,this),this.systemTime=Se.observable(K.now()),this.systemTime.equalityComparer=K.equals,this.startTime=Se.observable(e.startTime),this.startTime.equalityComparer=K.equals,this.startTime.subscribe(function(t){e.startTime=t,this.synchronize()},this),this.stopTime=Se.observable(e.stopTime),this.stopTime.equalityComparer=K.equals,this.stopTime.subscribe(function(t){e.stopTime=t,this.synchronize()},this),this.currentTime=Se.observable(e.currentTime),this.currentTime.equalityComparer=K.equals,this.currentTime.subscribe(function(t){e.currentTime=t,this.synchronize()},this),this.multiplier=Se.observable(e.multiplier),this.multiplier.subscribe(function(t){e.multiplier=t,this.synchronize()},this),this.clockStep=Se.observable(e.clockStep),this.clockStep.subscribe(function(t){e.clockStep=t,this.synchronize()},this),this.clockRange=Se.observable(e.clockRange),this.clockRange.subscribe(function(t){e.clockRange=t,this.synchronize()},this),this.canAnimate=Se.observable(e.canAnimate),this.canAnimate.subscribe(function(t){e.canAnimate=t,this.synchronize()},this),this.shouldAnimate=Se.observable(e.shouldAnimate),this.shouldAnimate.subscribe(function(t){e.shouldAnimate=t,this.synchronize()},this),Se.track(this,["systemTime","startTime","stopTime","currentTime","multiplier","clockStep","clockRange","canAnimate","shouldAnimate"])}Object.defineProperties(KM.prototype,{clock:{get:function(){return this._clock}}});KM.prototype.synchronize=function(){let e=this._clock;this.systemTime=K.now(),this.startTime=e.startTime,this.stopTime=e.stopTime,this.currentTime=e.currentTime,this.multiplier=e.multiplier,this.clockStep=e.clockStep,this.clockRange=e.clockRange,this.canAnimate=e.canAnimate,this.shouldAnimate=e.shouldAnimate};KM.prototype.isDestroyed=function(){return!1};KM.prototype.destroy=function(){this._eventHelper.removeAll(),le(this)};var K7=KM;function G6t(){this.canExecute=void 0,this.beforeExecute=void 0,this.afterExecute=void 0,pe.throwInstantiationError()}var j2e=G6t;function W6t(e,t){t=t??!0;let n=new be,i=new be;function r(){let o={args:arguments,cancel:!1},s;return n.raiseEvent(o),o.cancel||(s=e.apply(null,arguments),i.raiseEvent(s)),s}return r.canExecute=t,Se.track(r,["canExecute"]),Object.defineProperties(r,{beforeExecute:{value:n},afterExecute:{value:i}}),r}var On=W6t;var RI={};RI.createCheckbox=function(e,t,n){let i=document.createElement("div"),r=document.createElement("label"),o=document.createElement("input");o.type="checkbox";let s=`checked: ${t}`;return l(n)&&(s+=`, enable: ${n}`),o.setAttribute("data-bind",s),r.appendChild(o),r.appendChild(document.createTextNode(e)),i.appendChild(r),i};RI.createSection=function(e,t,n,i){let r=document.createElement("div");r.className="cesium-cesiumInspector-section",r.setAttribute("data-bind",`css: { "cesium-cesiumInspector-section-collapsed": !${n} }`),e.appendChild(r);let o=document.createElement("h3");o.className="cesium-cesiumInspector-sectionHeader",o.appendChild(document.createTextNode(t)),o.setAttribute("data-bind",`click: ${i}`),r.appendChild(o);let s=document.createElement("div");return s.className="cesium-cesiumInspector-sectionContent",r.appendChild(s),s};RI.createRangeInput=function(e,t,n,i,r,o){o=o??t;let s=document.createElement("input");s.setAttribute("data-bind",`value: ${o}`),s.type="number";let a=document.createElement("input");a.type="range",a.min=n,a.max=i,a.step=r??"any",a.setAttribute("data-bind",`valueUpdate: "input", value: ${t}`);let c=document.createElement("div");c.appendChild(a);let u=document.createElement("div");return u.className="cesium-cesiumInspector-slider",u.appendChild(document.createTextNode(e)),u.appendChild(s),u.appendChild(c),u};RI.createRangeInputWithDynamicMinMax=function(e,t,n,i){i=i??t;let r=document.createElement("input");r.setAttribute("data-bind",`value: ${i}`),r.type="number";let o=document.createElement("input");o.type="range",o.step=n??"any",o.setAttribute("data-bind",`valueUpdate: "input", value: ${t}, attr: { min: ${t}Min, max: ${t}Max }`);let s=document.createElement("div");s.appendChild(o);let a=document.createElement("div");return a.className="cesium-cesiumInspector-slider",a.appendChild(document.createTextNode(e)),a.appendChild(r),a.appendChild(s),a};RI.createButton=function(e,t,n){let i=document.createElement("button");i.type="button",i.textContent=e,i.className="cesium-cesiumInspector-pickButton";let r=`click: ${t}`;return l(n)&&(r+=`, css: {"cesium-cesiumInspector-pickButtonHighlight" : ${n}}`),i.setAttribute("data-bind",r),i};var qf=RI;function q6t(e,t,n,i,r){return n.call(i,e[t]),Se.getObservable(e,t).subscribe(n,i,r)}var Oc=q6t;function H2e(e,t){this._command=e,t=t??H.EMPTY_OBJECT,this.toggled=t.toggled??!1,this.tooltip=t.tooltip??"",Se.track(this,["toggled","tooltip"])}Object.defineProperties(H2e.prototype,{command:{get:function(){return this._command}}});var uE=H2e;var gl="http://www.w3.org/2000/svg",Y2e="http://www.w3.org/1999/xlink",$7,$M=z.fromCssColorString("rgba(247,250,255,0.384)"),J7=z.fromCssColorString("rgba(143,191,255,0.216)"),Sae=z.fromCssColorString("rgba(153,197,255,0.098)"),Z7=z.fromCssColorString("rgba(255,255,255,0.086)"),Y6t=z.fromCssColorString("rgba(255,255,255,0.267)"),X6t=z.fromCssColorString("rgba(255,255,255,0)"),G2e=z.fromCssColorString("rgba(66,67,68,0.3)"),W2e=z.fromCssColorString("rgba(0,0,0,0.5)");function ab(e){return z.fromCssColorString(window.getComputedStyle(e).getPropertyValue("color"))}var JM={animation_pathReset:{tagName:"path",transform:"translate(16,16) scale(0.85) translate(-16,-16)",d:"M24.316,5.318,9.833,13.682,9.833,5.5,5.5,5.5,5.5,25.5,9.833,25.5,9.833,17.318,24.316,25.682z"},animation_pathPause:{tagName:"path",transform:"translate(16,16) scale(0.85) translate(-16,-16)",d:"M13,5.5,7.5,5.5,7.5,25.5,13,25.5zM24.5,5.5,19,5.5,19,25.5,24.5,25.5z"},animation_pathPlay:{tagName:"path",transform:"translate(16,16) scale(0.85) translate(-16,-16)",d:"M6.684,25.682L24.316,15.5L6.684,5.318V25.682z"},animation_pathPlayReverse:{tagName:"path",transform:"translate(16,16) scale(-0.85,0.85) translate(-16,-16)",d:"M6.684,25.682L24.316,15.5L6.684,5.318V25.682z"},animation_pathLoop:{tagName:"path",transform:"translate(16,16) scale(0.85) translate(-16,-16)",d:"M24.249,15.499c-0.009,4.832-3.918,8.741-8.75,8.75c-2.515,0-4.768-1.064-6.365-2.763l2.068-1.442l-7.901-3.703l0.744,8.694l2.193-1.529c2.244,2.594,5.562,4.242,9.26,4.242c6.767,0,12.249-5.482,12.249-12.249H24.249zM15.499,6.75c2.516,0,4.769,1.065,6.367,2.764l-2.068,1.443l7.901,3.701l-0.746-8.693l-2.192,1.529c-2.245-2.594-5.562-4.245-9.262-4.245C8.734,3.25,3.25,8.734,3.249,15.499H6.75C6.758,10.668,10.668,6.758,15.499,6.75z"},animation_pathClock:{tagName:"path",transform:"translate(16,16) scale(0.85) translate(-16,-15.5)",d:"M15.5,2.374C8.251,2.375,2.376,8.251,2.374,15.5C2.376,22.748,8.251,28.623,15.5,28.627c7.249-0.004,13.124-5.879,13.125-13.127C28.624,8.251,22.749,2.375,15.5,2.374zM15.5,25.623C9.909,25.615,5.385,21.09,5.375,15.5C5.385,9.909,9.909,5.384,15.5,5.374c5.59,0.01,10.115,4.535,10.124,10.125C25.615,21.09,21.091,25.615,15.5,25.623zM8.625,15.5c-0.001-0.552-0.448-0.999-1.001-1c-0.553,0-1,0.448-1,1c0,0.553,0.449,1,1,1C8.176,16.5,8.624,16.053,8.625,15.5zM8.179,18.572c-0.478,0.277-0.642,0.889-0.365,1.367c0.275,0.479,0.889,0.641,1.365,0.365c0.479-0.275,0.643-0.887,0.367-1.367C9.27,18.461,8.658,18.297,8.179,18.572zM9.18,10.696c-0.479-0.276-1.09-0.112-1.366,0.366s-0.111,1.09,0.365,1.366c0.479,0.276,1.09,0.113,1.367-0.366C9.821,11.584,9.657,10.973,9.18,10.696zM22.822,12.428c0.478-0.275,0.643-0.888,0.366-1.366c-0.275-0.478-0.89-0.642-1.366-0.366c-0.479,0.278-0.642,0.89-0.366,1.367C21.732,12.54,22.344,12.705,22.822,12.428zM12.062,21.455c-0.478-0.275-1.089-0.111-1.366,0.367c-0.275,0.479-0.111,1.09,0.366,1.365c0.478,0.277,1.091,0.111,1.365-0.365C12.704,22.344,12.54,21.732,12.062,21.455zM12.062,9.545c0.479-0.276,0.642-0.888,0.366-1.366c-0.276-0.478-0.888-0.642-1.366-0.366s-0.642,0.888-0.366,1.366C10.973,9.658,11.584,9.822,12.062,9.545zM22.823,18.572c-0.48-0.275-1.092-0.111-1.367,0.365c-0.275,0.479-0.112,1.092,0.367,1.367c0.477,0.275,1.089,0.113,1.365-0.365C23.464,19.461,23.3,18.848,22.823,18.572zM19.938,7.813c-0.477-0.276-1.091-0.111-1.365,0.366c-0.275,0.48-0.111,1.091,0.366,1.367s1.089,0.112,1.366-0.366C20.581,8.702,20.418,8.089,19.938,7.813zM23.378,14.5c-0.554,0.002-1.001,0.45-1.001,1c0.001,0.552,0.448,1,1.001,1c0.551,0,1-0.447,1-1C24.378,14.949,23.929,14.5,23.378,14.5zM15.501,6.624c-0.552,0-1,0.448-1,1l-0.466,7.343l-3.004,1.96c-0.478,0.277-0.642,0.889-0.365,1.365c0.275,0.479,0.889,0.643,1.365,0.367l3.305-1.676C15.39,16.99,15.444,17,15.501,17c0.828,0,1.5-0.671,1.5-1.5l-0.5-7.876C16.501,7.072,16.053,6.624,15.501,6.624zM15.501,22.377c-0.552,0-1,0.447-1,1s0.448,1,1,1s1-0.447,1-1S16.053,22.377,15.501,22.377zM18.939,21.455c-0.479,0.277-0.643,0.889-0.366,1.367c0.275,0.477,0.888,0.643,1.366,0.365c0.478-0.275,0.642-0.889,0.366-1.365C20.028,21.344,19.417,21.18,18.939,21.455z"},animation_pathWingButton:{tagName:"path",d:"m 4.5,0.5 c -2.216,0 -4,1.784 -4,4 l 0,24 c 0,2.216 1.784,4 4,4 l 13.71875,0 C 22.478584,27.272785 27.273681,22.511272 32.5,18.25 l 0,-13.75 c 0,-2.216 -1.784,-4 -4,-4 l -24,0 z"},animation_pathPointer:{tagName:"path",d:"M-15,-65,-15,-55,15,-55,15,-65,0,-95z"},animation_pathSwooshFX:{tagName:"path",d:"m 85,0 c 0,16.617 -4.813944,35.356 -13.131081,48.4508 h 6.099803 c 8.317138,-13.0948 13.13322,-28.5955 13.13322,-45.2124 0,-46.94483 -38.402714,-85.00262 -85.7743869,-85.00262 -1.0218522,0 -2.0373001,0.0241 -3.0506131,0.0589 45.958443,1.59437 82.723058,35.77285 82.723058,81.70532 z"}};function Pm(e){let t=document.createElementNS(gl,e.tagName);for(let n in e)if(e.hasOwnProperty(n)&&n!=="tagName")if(n==="children"){let i=e.children.length;for(let r=0;r<i;++r)t.appendChild(Pm(e.children[r]))}else n.indexOf("xlink:")===0?t.setAttributeNS(Y2e,n.substring(6),e[n]):n==="textContent"?t.textContent=e[n]:t.setAttribute(n,e[n]);return t}function Iae(e,t,n){let i=document.createElementNS(gl,"text");i.setAttribute("x",e),i.setAttribute("y",t),i.setAttribute("class","cesium-animation-svgText");let r=document.createElementNS(gl,"tspan");return r.textContent=n,i.appendChild(r),i}function K6t(e,t){let n=Iae(e,t,"");n.removeChild(n.firstChild);let i={},r=[],o=["month","day","year"];for(let a=0;a<o.length;++a){if(a>0){let f=document.createElementNS(gl,"tspan");f.textContent=" ",r.push(f),n.appendChild(f)}let c=o[a],u=document.createElementNS(gl,"tspan");u.setAttribute("class",`cesium-animation-dateField cesium-animation-dateField-${c}`),u.setAttribute("aria-label",`Adjust ${c} with mouse wheel`),i[c]=u,n.appendChild(u)}let s=document.createElementNS(gl,"tspan");return n.appendChild(s),{element:n,fallback:s,parts:i,separators:r}}function $6t(e,t){let n=/^(\S+)\s+(\d{1,2})\s+(\d{1,4})$/.exec(t),i=e.parts,r=e.separators;if(n===null){i.month.textContent="",i.day.textContent="",i.year.textContent="",r[0].textContent="",r[1].textContent="",e.fallback.textContent=t;return}i.month.textContent=n[1],i.day.textContent=n[2],i.year.textContent=n[3],r[0].textContent=" ",r[1].textContent=" ",e.fallback.textContent=""}function J6t(e,t){let n=Iae(e,t,"");n.removeChild(n.firstChild);let i={},r=[],o=["hour","minute","second"];for(let f=0;f<o.length;++f){if(f>0){let g=document.createElementNS(gl,"tspan");g.textContent=":",r.push(g),n.appendChild(g)}let d=o[f],p=document.createElementNS(gl,"tspan");p.setAttribute("class",`cesium-animation-timeField cesium-animation-timeField-${d}`),p.setAttribute("aria-label",`Adjust ${d} with mouse wheel`),i[d]=p,n.appendChild(p)}let s=document.createElementNS(gl,"tspan");n.appendChild(s);let a=document.createElementNS(gl,"tspan");a.setAttribute("class","cesium-animation-timeField cesium-animation-timeField-millisecond"),a.setAttribute("aria-label","Adjust millisecond with mouse wheel"),i.millisecond=a,n.appendChild(a);let c=document.createElementNS(gl,"tspan");n.appendChild(c);let u=document.createElementNS(gl,"tspan");return n.appendChild(u),{decimalPoint:s,element:n,fallback:u,parts:i,separators:r,suffix:c}}function Z6t(e,t){let n=/^(\d{2}):(\d{2}):(\d{2})(?:\.(\d{3})| UTC)$/.exec(t),i=e.parts,r=e.separators;if(n===null){i.hour.textContent="",i.minute.textContent="",i.second.textContent="",i.millisecond.textContent="",r[0].textContent="",r[1].textContent="",e.decimalPoint.textContent="",e.suffix.textContent="",e.fallback.textContent=t;return}i.hour.textContent=n[1],i.minute.textContent=n[2],i.second.textContent=n[3],r[0].textContent=":",r[1].textContent=":",e.decimalPoint.textContent=l(n[4])?".":"",i.millisecond.textContent=n[4]??"",e.suffix.textContent=l(n[4])?"":" UTC",e.fallback.textContent=""}function q2e(e,t,n){let i=Object.keys(t);for(let r=0;r<i.length;++r){let o=i[r],s=t[o],a=function(c){c.deltaY!==0&&(n(o,c.deltaY<0?1:-1),c.preventDefault(),c.stopPropagation())};s.addEventListener("wheel",a,!1),e._fieldWheelListeners.push({element:s,listener:a})}}function Q6t(e,t,n){e.setAttribute("transform",`translate(100,100) rotate(${n})`),t.setAttribute("transform",`rotate(${n})`)}var Q7=new z;function Us(e,t){let n=t.alpha,i=1-n;return Q7.red=e.red*i+t.red*n,Q7.green=e.green*i+t.green*n,Q7.blue=e.blue*i+t.blue*n,Q7.toCssColorString()}function wae(e,t,n){let i=JM[n],r={tagName:"g",class:"cesium-animation-rectButton",transform:`translate(${e},${t})`,children:[{tagName:"rect",class:"cesium-animation-buttonGlow",width:32,height:32,rx:2,ry:2},{tagName:"rect",class:"cesium-animation-buttonMain",width:32,height:32,rx:4,ry:4},{class:"cesium-animation-buttonPath",id:n,tagName:i.tagName,transform:i.transform,d:i.d},{tagName:"title",textContent:""}]};return Pm(r)}function eHt(e,t,n){let i=JM[n],r=JM.animation_pathWingButton,o={tagName:"g",class:"cesium-animation-rectButton",transform:`translate(${e},${t})`,children:[{class:"cesium-animation-buttonGlow",id:"animation_pathWingButton",tagName:r.tagName,d:r.d},{class:"cesium-animation-buttonMain",id:"animation_pathWingButton",tagName:r.tagName,d:r.d},{class:"cesium-animation-buttonPath",id:n,tagName:i.tagName,transform:i.transform,d:i.d},{tagName:"title",textContent:""}]};return Pm(o)}function tHt(e,t){let n=e._viewModel,i=n.shuttleRingDragging;if(!(i&&$7!==e))if(t.type==="mousedown"||i&&t.type==="mousemove"||t.type==="touchstart"&&t.touches.length===1||i&&t.type==="touchmove"&&t.touches.length===1){let r=e._centerX,o=e._centerY,a=e._svgNode.getBoundingClientRect(),c,u;if(t.type==="touchstart"||t.type==="touchmove"?(c=t.touches[0].clientX,u=t.touches[0].clientY):(c=t.clientX,u=t.clientY),!i&&(c>a.right||c<a.left||u<a.top||u>a.bottom))return;let f=e._shuttleRingPointer.getBoundingClientRect(),d=c-r-a.left,p=u-o-a.top,g=Math.atan2(p,d)*180/Math.PI+90;g>180&&(g-=360);let m=n.shuttleRingAngle;i||c<f.right&&c>f.left&&u>f.top&&u<f.bottom?($7=e,n.shuttleRingDragging=!0,n.shuttleRingAngle=g):g<m?n.slower():g>m&&n.faster(),t.preventDefault()}else e===$7&&($7=void 0),n.shuttleRingDragging=!1}function A_(e,t){this._viewModel=t,this.svgElement=e,this._enabled=void 0,this._toggled=void 0;let n=this;this._clickFunction=function(){let i=n._viewModel.command;i.canExecute&&i()},e.addEventListener("click",this._clickFunction,!0),this._subscriptions=[Oc(t,"toggled",this.setToggled,this),Oc(t,"tooltip",this.setTooltip,this),Oc(t.command,"canExecute",this.setEnabled,this)]}A_.prototype.destroy=function(){this.svgElement.removeEventListener("click",this._clickFunction,!0);let e=this._subscriptions;for(let t=0,n=e.length;t<n;t++)e[t].dispose();le(this)};A_.prototype.isDestroyed=function(){return!1};A_.prototype.setEnabled=function(e){if(this._enabled!==e){if(this._enabled=e,!e){this.svgElement.setAttribute("class","cesium-animation-buttonDisabled");return}if(this._toggled){this.svgElement.setAttribute("class","cesium-animation-rectButton cesium-animation-buttonToggled");return}this.svgElement.setAttribute("class","cesium-animation-rectButton")}};A_.prototype.setToggled=function(e){this._toggled!==e&&(this._toggled=e,this._enabled&&(e?this.svgElement.setAttribute("class","cesium-animation-rectButton cesium-animation-buttonToggled"):this.svgElement.setAttribute("class","cesium-animation-rectButton")))};A_.prototype.setTooltip=function(e){this.svgElement.getElementsByTagName("title")[0].textContent=e};function OI(e,t){e=kn(e),this._viewModel=t,this._container=e,this._centerX=0,this._centerY=0,this._defsElement=void 0,this._svgNode=void 0,this._topG=void 0,this._lastHeight=void 0,this._lastWidth=void 0;let n=e.ownerDocument,i=document.createElement("style");i.textContent=".cesium-animation-rectButton .cesium-animation-buttonGlow { filter: url(#animation_blurred); }.cesium-animation-rectButton .cesium-animation-buttonMain { fill: url(#animation_buttonNormal); }.cesium-animation-buttonToggled .cesium-animation-buttonMain { fill: url(#animation_buttonToggled); }.cesium-animation-rectButton:hover .cesium-animation-buttonMain { fill: url(#animation_buttonHovered); }.cesium-animation-buttonDisabled .cesium-animation-buttonMain { fill: url(#animation_buttonDisabled); }.cesium-animation-shuttleRingG .cesium-animation-shuttleRingSwoosh { fill: url(#animation_shuttleRingSwooshGradient); }.cesium-animation-shuttleRingG:hover .cesium-animation-shuttleRingSwoosh { fill: url(#animation_shuttleRingSwooshHovered); }.cesium-animation-shuttleRingPointer { fill: url(#animation_shuttleRingPointerGradient); }.cesium-animation-shuttleRingPausePointer { fill: url(#animation_shuttleRingPointerPaused); }.cesium-animation-knobOuter { fill: url(#animation_knobOuter); }.cesium-animation-knobInner { fill: url(#animation_knobInner); }",n.head.insertBefore(i,n.head.childNodes[0]);let r=document.createElement("div");r.className="cesium-animation-theme",r.innerHTML='<div class="cesium-animation-themeNormal"></div><div class="cesium-animation-themeHover"></div><div class="cesium-animation-themeSelect"></div><div class="cesium-animation-themeDisabled"></div><div class="cesium-animation-themeKnob"></div><div class="cesium-animation-themePointer"></div><div class="cesium-animation-themeSwoosh"></div><div class="cesium-animation-themeSwooshHover"></div>',this._theme=r,this._themeNormal=r.childNodes[0],this._themeHover=r.childNodes[1],this._themeSelect=r.childNodes[2],this._themeDisabled=r.childNodes[3],this._themeKnob=r.childNodes[4],this._themePointer=r.childNodes[5],this._themeSwoosh=r.childNodes[6],this._themeSwooshHover=r.childNodes[7];let o=document.createElementNS(gl,"svg:svg");this._svgNode=o,o.setAttributeNS("http://www.w3.org/2000/xmlns/","xmlns:xlink",Y2e);let s=document.createElementNS(gl,"g");this._topG=s,this._realtimeSVG=new A_(eHt(3,4,"animation_pathClock"),t.playRealtimeViewModel),this._playReverseSVG=new A_(wae(44,99,"animation_pathPlayReverse"),t.playReverseViewModel),this._playForwardSVG=new A_(wae(124,99,"animation_pathPlay"),t.playForwardViewModel),this._pauseSVG=new A_(wae(84,99,"animation_pathPause"),t.pauseViewModel);let a=document.createElementNS(gl,"g");a.appendChild(this._realtimeSVG.svgElement),a.appendChild(this._playReverseSVG.svgElement),a.appendChild(this._playForwardSVG.svgElement),a.appendChild(this._pauseSVG.svgElement);let c=Pm({tagName:"circle",class:"cesium-animation-shuttleRingBack",cx:100,cy:100,r:99});this._shuttleRingBackPanel=c;let u=JM.animation_pathSwooshFX,f=JM.animation_pathPointer,d=Pm({tagName:"g",class:"cesium-animation-shuttleRingSwoosh",children:[{tagName:u.tagName,transform:"translate(100,97) scale(-1,1)",id:"animation_pathSwooshFX",d:u.d},{tagName:u.tagName,transform:"translate(100,97)",id:"animation_pathSwooshFX",d:u.d},{tagName:"line",x1:100,y1:8,x2:100,y2:22}]});this._shuttleRingSwooshG=d,this._shuttleRingPointer=Pm({class:"cesium-animation-shuttleRingPointer",id:"animation_pathPointer",tagName:f.tagName,d:f.d});let p=Pm({tagName:"g",transform:"translate(100,100)"});this._knobOuter=Pm({tagName:"circle",class:"cesium-animation-knobOuter",cx:0,cy:0,r:71});let g=61,m=Pm({tagName:"circle",class:"cesium-animation-knobInner",cx:0,cy:0,r:g}),y=K6t(0,-24);this._knobDate=y.element;let A=J6t(0,-7);this._knobTime=A.element,this._knobStatus=Iae(0,-41,"");let b=Pm({tagName:"circle",class:"cesium-animation-blank",cx:0,cy:0,r:g}),x=document.createElementNS(gl,"g");x.setAttribute("class","cesium-animation-shuttleRingG"),e.appendChild(r),s.appendChild(x),s.appendChild(p),s.appendChild(a),x.appendChild(c),x.appendChild(d),x.appendChild(this._shuttleRingPointer),p.appendChild(this._knobOuter),p.appendChild(m),p.appendChild(this._knobStatus),p.appendChild(b),p.appendChild(this._knobDate),p.appendChild(this._knobTime),o.appendChild(s),e.appendChild(o);let T=this;function E(I){tHt(T,I)}this._mouseCallback=E,c.addEventListener("mousedown",E,!0),c.addEventListener("touchstart",E,!0),d.addEventListener("mousedown",E,!0),d.addEventListener("touchstart",E,!0),n.addEventListener("mousemove",E,!0),n.addEventListener("touchmove",E,!0),n.addEventListener("mouseup",E,!0),n.addEventListener("touchend",E,!0),n.addEventListener("touchcancel",E,!0),this._shuttleRingPointer.addEventListener("mousedown",E,!0),this._shuttleRingPointer.addEventListener("touchstart",E,!0),this._knobOuter.addEventListener("mousedown",E,!0),this._knobOuter.addEventListener("touchstart",E,!0);let v=this._knobStatus.childNodes[0];this._fieldWheelListeners=[],q2e(this,y.parts,function(I,R){t.adjustDate(I,R)}),q2e(this,A.parts,function(I,R){t.adjustTime(I,R)});let S;this._subscriptions=[Oc(t.pauseViewModel,"toggled",function(I){S!==I&&(S=I,S?T._shuttleRingPointer.setAttribute("class","cesium-animation-shuttleRingPausePointer"):T._shuttleRingPointer.setAttribute("class","cesium-animation-shuttleRingPointer"))}),Oc(t,"shuttleRingAngle",function(I){Q6t(T._shuttleRingPointer,T._knobOuter,I)}),Oc(t,"dateLabel",function(I){T._knobDate.textContent!==I&&$6t(y,I)}),Oc(t,"timeLabel",function(I){T._knobTime.textContent!==I&&Z6t(A,I)}),Oc(t,"multiplierLabel",function(I){v.textContent!==I&&(v.textContent=I)})],this.applyThemeChanges(),this.resize()}Object.defineProperties(OI.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}}});OI.prototype.isDestroyed=function(){return!1};OI.prototype.destroy=function(){l(this._observer)&&(this._observer.disconnect(),this._observer=void 0);let e=this._container.ownerDocument,t=this._mouseCallback;this._shuttleRingBackPanel.removeEventListener("mousedown",t,!0),this._shuttleRingBackPanel.removeEventListener("touchstart",t,!0),this._shuttleRingSwooshG.removeEventListener("mousedown",t,!0),this._shuttleRingSwooshG.removeEventListener("touchstart",t,!0),e.removeEventListener("mousemove",t,!0),e.removeEventListener("touchmove",t,!0),e.removeEventListener("mouseup",t,!0),e.removeEventListener("touchend",t,!0),e.removeEventListener("touchcancel",t,!0),this._shuttleRingPointer.removeEventListener("mousedown",t,!0),this._shuttleRingPointer.removeEventListener("touchstart",t,!0),this._knobOuter.removeEventListener("mousedown",t,!0),this._knobOuter.removeEventListener("touchstart",t,!0);let n=this._fieldWheelListeners;for(let r=0;r<n.length;++r){let o=n[r];o.element.removeEventListener("wheel",o.listener,!1)}this._container.removeChild(this._svgNode),this._container.removeChild(this._theme),this._realtimeSVG.destroy(),this._playReverseSVG.destroy(),this._playForwardSVG.destroy(),this._pauseSVG.destroy();let i=this._subscriptions;for(let r=0,o=i.length;r<o;r++)i[r].dispose();return le(this)};OI.prototype.resize=function(){let e=this._container.clientWidth,t=this._container.clientHeight;if(e===this._lastWidth&&t===this._lastHeight)return;let n=this._svgNode,i=200,r=132,o=e,s=t;e===0&&t===0?(o=i,s=r):e===0?(s=t,o=i*(t/r)):t===0&&(o=e,s=r*(e/i));let a=o/i,c=s/r;n.style.cssText=`width: ${o}px; height: ${s}px; position: absolute; bottom: 0; left: 0; overflow: hidden;`,n.setAttribute("width",o),n.setAttribute("height",s),n.setAttribute("viewBox",`0 0 ${o} ${s}`),this._topG.setAttribute("transform",`scale(${a},${c})`),this._centerX=Math.max(1,100*a),this._centerY=Math.max(1,100*c),this._lastHeight=e,this._lastWidth=t};OI.prototype.applyThemeChanges=function(){let e=this._container.ownerDocument;if(!e.body.contains(this._container)){if(l(this._observer))return;let f=this;f._observer=new MutationObserver(function(){e.body.contains(f._container)&&(f._observer.disconnect(),f._observer=void 0,f.applyThemeChanges())}),f._observer.observe(e,{childList:!0,subtree:!0});return}let t=ab(this._themeNormal),n=ab(this._themeHover),i=ab(this._themeSelect),r=ab(this._themeDisabled),o=ab(this._themeKnob),s=ab(this._themePointer),a=ab(this._themeSwoosh),c=ab(this._themeSwooshHover),u=Pm({tagName:"defs",children:[{id:"animation_buttonNormal",tagName:"linearGradient",x1:"50%",y1:"0%",x2:"50%",y2:"100%",children:[{tagName:"stop",offset:"0%","stop-color":Us(t,$M)},{tagName:"stop",offset:"12%","stop-color":Us(t,J7)},{tagName:"stop",offset:"46%","stop-color":Us(t,Sae)},{tagName:"stop",offset:"81%","stop-color":Us(t,Z7)}]},{id:"animation_buttonHovered",tagName:"linearGradient",x1:"50%",y1:"0%",x2:"50%",y2:"100%",children:[{tagName:"stop",offset:"0%","stop-color":Us(n,$M)},{tagName:"stop",offset:"12%","stop-color":Us(n,J7)},{tagName:"stop",offset:"46%","stop-color":Us(n,Sae)},{tagName:"stop",offset:"81%","stop-color":Us(n,Z7)}]},{id:"animation_buttonToggled",tagName:"linearGradient",x1:"50%",y1:"0%",x2:"50%",y2:"100%",children:[{tagName:"stop",offset:"0%","stop-color":Us(i,$M)},{tagName:"stop",offset:"12%","stop-color":Us(i,J7)},{tagName:"stop",offset:"46%","stop-color":Us(i,Sae)},{tagName:"stop",offset:"81%","stop-color":Us(i,Z7)}]},{id:"animation_buttonDisabled",tagName:"linearGradient",x1:"50%",y1:"0%",x2:"50%",y2:"100%",children:[{tagName:"stop",offset:"0%","stop-color":Us(r,Y6t)},{tagName:"stop",offset:"75%","stop-color":Us(r,X6t)}]},{id:"animation_blurred",tagName:"filter",width:"200%",height:"200%",x:"-50%",y:"-50%",children:[{tagName:"feGaussianBlur",stdDeviation:4,in:"SourceGraphic"}]},{id:"animation_shuttleRingSwooshGradient",tagName:"linearGradient",x1:"50%",y1:"0%",x2:"50%",y2:"100%",children:[{tagName:"stop",offset:"0%","stop-opacity":.2,"stop-color":a.toCssColorString()},{tagName:"stop",offset:"85%","stop-opacity":.85,"stop-color":a.toCssColorString()},{tagName:"stop",offset:"95%","stop-opacity":.05,"stop-color":a.toCssColorString()}]},{id:"animation_shuttleRingSwooshHovered",tagName:"linearGradient",x1:"50%",y1:"0%",x2:"50%",y2:"100%",children:[{tagName:"stop",offset:"0%","stop-opacity":.2,"stop-color":c.toCssColorString()},{tagName:"stop",offset:"85%","stop-opacity":.85,"stop-color":c.toCssColorString()},{tagName:"stop",offset:"95%","stop-opacity":.05,"stop-color":c.toCssColorString()}]},{id:"animation_shuttleRingPointerGradient",tagName:"linearGradient",x1:"0%",y1:"50%",x2:"100%",y2:"50%",children:[{tagName:"stop",offset:"0%","stop-color":s.toCssColorString()},{tagName:"stop",offset:"40%","stop-color":s.toCssColorString()},{tagName:"stop",offset:"60%","stop-color":Us(s,W2e)},{tagName:"stop",offset:"100%","stop-color":Us(s,W2e)}]},{id:"animation_shuttleRingPointerPaused",tagName:"linearGradient",x1:"0%",y1:"50%",x2:"100%",y2:"50%",children:[{tagName:"stop",offset:"0%","stop-color":"#CCC"},{tagName:"stop",offset:"40%","stop-color":"#CCC"},{tagName:"stop",offset:"60%","stop-color":"#555"},{tagName:"stop",offset:"100%","stop-color":"#555"}]},{id:"animation_knobOuter",tagName:"linearGradient",x1:"20%",y1:"0%",x2:"90%",y2:"100%",children:[{tagName:"stop",offset:"5%","stop-color":Us(o,$M)},{tagName:"stop",offset:"60%","stop-color":Us(o,G2e)},{tagName:"stop",offset:"85%","stop-color":Us(o,J7)}]},{id:"animation_knobInner",tagName:"linearGradient",x1:"20%",y1:"0%",x2:"90%",y2:"100%",children:[{tagName:"stop",offset:"5%","stop-color":Us(o,G2e)},{tagName:"stop",offset:"60%","stop-color":Us(o,$M)},{tagName:"stop",offset:"85%","stop-color":Us(o,Z7)}]}]});l(this._defsElement)?this._svgNode.replaceChild(u,this._defsElement):this._svgNode.appendChild(u),this._defsElement=u};var eW=OI;var nHt=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],cb=15,MI=105,iHt=[31,28,31,30,31,30,31,31,30,31,30,31];function rHt(e,t){return t===2&&ou(e)?29:iHt[t-1]}function X2e(e,t,n){return K.fromGregorianDate(new Fm(t,n,Math.min(e.day,rHt(t,n)),e.hour,e.minute,e.second,e.millisecond,e.isLeapSecond))}function K2e(e,t){return e-t}function Pae(e,t){let n=Pr(t,e,K2e);return n<0?~n:n}function oHt(e,t){if(Math.abs(e)<=cb)return e/cb;let n=cb,i=MI,r,o=0,s;return e>0?(r=Math.log(t[t.length-1]),s=(r-o)/(i-n),Math.exp(o+s*(e-n))):(r=Math.log(-t[0]),s=(r-o)/(i-n),-Math.exp(o+s*(Math.abs(e)-n)))}function sHt(e,t,n){if(n.clockStep===Hr.SYSTEM_CLOCK)return cb;if(Math.abs(e)<=1)return e*cb;let i=t[t.length-1];e>i?e=i:e<-i&&(e=-i);let r=cb,o=MI,s,a=0,c;return e>0?(s=Math.log(i),c=(s-a)/(o-r),(Math.log(e)-a)/c+r):(s=Math.log(-t[0]),c=(s-a)/(o-r),-((Math.log(Math.abs(e))-a)/c+r))}function Qu(e){let t=this;this._clockViewModel=e,this._allShuttleRingTicks=[],this._dateFormatter=Qu.defaultDateFormatter,this._timeFormatter=Qu.defaultTimeFormatter,this.shuttleRingDragging=!1,this.snapToTicks=!1,Se.track(this,["_allShuttleRingTicks","_dateFormatter","_timeFormatter","shuttleRingDragging","snapToTicks"]),this._sortedFilteredPositiveTicks=[],this.setShuttleRingTicks(Qu.defaultTicks),this.timeLabel=void 0,Se.defineProperty(this,"timeLabel",function(){return t._timeFormatter(t._clockViewModel.currentTime,t)}),this.dateLabel=void 0,Se.defineProperty(this,"dateLabel",function(){return t._dateFormatter(t._clockViewModel.currentTime,t)}),this.multiplierLabel=void 0,Se.defineProperty(this,"multiplierLabel",function(){let s=t._clockViewModel;if(s.clockStep===Hr.SYSTEM_CLOCK)return"Today";let a=s.multiplier;return a%1===0?`${a.toFixed(0)}x`:`${a.toFixed(3).replace(/0{0,3}$/,"")}x`}),this.shuttleRingAngle=void 0,Se.defineProperty(this,"shuttleRingAngle",{get:function(){return sHt(e.multiplier,t._allShuttleRingTicks,e)},set:function(s){s=Math.max(Math.min(s,MI),-MI);let a=t._allShuttleRingTicks,c=t._clockViewModel;if(c.clockStep=Hr.SYSTEM_CLOCK_MULTIPLIER,Math.abs(s)===MI){c.multiplier=s>0?a[a.length-1]:a[0];return}let u=oHt(s,a);if(t.snapToTicks)u=a[Pae(u,a)];else if(u!==0){let f=Math.abs(u);if(f>100){let d=f.toFixed(0).length-2,p=Math.pow(10,d);u=Math.round(u/p)*p|0}else f>cb?u=Math.round(u):f>1?u=+u.toFixed(1):f>0&&(u=+u.toFixed(2))}c.multiplier=u}}),this._canAnimate=void 0,Se.defineProperty(this,"_canAnimate",function(){let s=t._clockViewModel,a=s.clockRange;if(t.shuttleRingDragging||a===Bs.UNBOUNDED)return!0;let c=s.multiplier,u=s.currentTime,f=s.startTime,d;if(a===Bs.LOOP_STOP)d=K.greaterThan(u,f)||u.equals(f)&&c>0;else{let p=s.stopTime;d=K.greaterThan(u,f)&&K.lessThan(u,p)||u.equals(f)&&c>0||u.equals(p)&&c<0}return d||(s.shouldAnimate=!1),d}),this._isSystemTimeAvailable=void 0,Se.defineProperty(this,"_isSystemTimeAvailable",function(){let s=t._clockViewModel;if(s.clockRange===Bs.UNBOUNDED)return!0;let c=s.systemTime;return K.greaterThanOrEquals(c,s.startTime)&&K.lessThanOrEquals(c,s.stopTime)}),this._isAnimating=void 0,Se.defineProperty(this,"_isAnimating",function(){return t._clockViewModel.shouldAnimate&&(t._canAnimate||t.shuttleRingDragging)});let n=On(function(){let s=t._clockViewModel;s.shouldAnimate?s.shouldAnimate=!1:t._canAnimate&&(s.shouldAnimate=!0)});this._pauseViewModel=new uE(n,{toggled:Se.computed(function(){return!t._isAnimating}),tooltip:"Pause"});let i=On(function(){let s=t._clockViewModel,a=s.multiplier;a>0&&(s.multiplier=-a),s.shouldAnimate=!0});this._playReverseViewModel=new uE(i,{toggled:Se.computed(function(){return t._isAnimating&&e.multiplier<0}),tooltip:"Play Reverse"});let r=On(function(){let s=t._clockViewModel,a=s.multiplier;a<0&&(s.multiplier=-a),s.shouldAnimate=!0});this._playForwardViewModel=new uE(r,{toggled:Se.computed(function(){return t._isAnimating&&e.multiplier>0&&e.clockStep!==Hr.SYSTEM_CLOCK}),tooltip:"Play Forward"});let o=On(function(){t._clockViewModel.clockStep=Hr.SYSTEM_CLOCK},Se.getObservable(this,"_isSystemTimeAvailable"));this._playRealtimeViewModel=new uE(o,{toggled:Se.computed(function(){return e.clockStep===Hr.SYSTEM_CLOCK}),tooltip:Se.computed(function(){return t._isSystemTimeAvailable?"Today (real-time)":"Current time not in range"})}),this._slower=On(function(){let s=t._clockViewModel,a=t._allShuttleRingTicks,c=s.multiplier,u=Pae(c,a)-1;u>=0&&(s.multiplier=a[u])}),this._faster=On(function(){let s=t._clockViewModel,a=t._allShuttleRingTicks,c=s.multiplier,u=Pae(c,a)+1;u<a.length&&(s.multiplier=a[u])})}Qu.defaultDateFormatter=function(e,t){let n=K.toGregorianDate(e);return`${nHt[n.month-1]} ${n.day} ${n.year}`};Qu.defaultTicks=[.001,.002,.005,.01,.02,.05,.1,.25,.5,1,2,5,10,15,30,60,120,300,600,900,1800,3600,7200,14400,21600,43200,86400,172800,345600,604800];Qu.defaultTimeFormatter=function(e,t){let n=K.toGregorianDate(e),i=Math.round(n.millisecond);return Math.abs(t._clockViewModel.multiplier)<1?`${n.hour.toString().padStart(2,"0")}:${n.minute.toString().padStart(2,"0")}:${n.second.toString().padStart(2,"0")}.${i.toString().padStart(3,"0")}`:`${n.hour.toString().padStart(2,"0")}:${n.minute.toString().padStart(2,"0")}:${n.second.toString().padStart(2,"0")} UTC`};Qu.prototype.getShuttleRingTicks=function(){return this._sortedFilteredPositiveTicks.slice(0)};Qu.prototype.setShuttleRingTicks=function(e){let t,n,i,r={},o=this._sortedFilteredPositiveTicks;for(o.length=0,t=0,n=e.length;t<n;++t)i=e[t],r.hasOwnProperty(i)||(r[i]=!0,o.push(i));o.sort(K2e);let s=[];for(n=o.length,t=n-1;t>=0;--t)i=o[t],i!==0&&s.push(-i);Zn(s,o),this._allShuttleRingTicks=s};Qu.prototype.adjustDate=function(e,t){if(t===0)return;let n=this._clockViewModel,i=n.currentTime,r=K.toGregorianDate(i),o;if(e==="day"){o=K.addDays(i,t,new K);let s=K.toGregorianDate(o);if(s.year<1||s.year>9999)return}else if(e==="month"){let a=Math.min(Math.max((r.year-1)*12+r.month-1+t,0),119987),c=Math.floor(a/12)+1,u=a%12+1;o=X2e(r,c,u)}else{let s=Math.min(Math.max(r.year+t,1),9999);o=X2e(r,s,r.month)}K.equals(i,o)||(n.shouldAnimate=!1,n.currentTime=o)};Qu.prototype.adjustTime=function(e,t){if(t===0)return;let n=this._clockViewModel,i=n.currentTime,r;if(e==="hour")r=K.addHours(i,t,new K);else if(e==="minute")r=K.addMinutes(i,t,new K);else{let s=e==="second"?t:t/1e3;r=K.addSeconds(i,s,new K)}let o=K.toGregorianDate(r);o.year<1||o.year>9999||(n.shouldAnimate=!1,n.currentTime=r)};Object.defineProperties(Qu.prototype,{slower:{get:function(){return this._slower}},faster:{get:function(){return this._faster}},clockViewModel:{get:function(){return this._clockViewModel}},pauseViewModel:{get:function(){return this._pauseViewModel}},playReverseViewModel:{get:function(){return this._playReverseViewModel}},playForwardViewModel:{get:function(){return this._playForwardViewModel}},playRealtimeViewModel:{get:function(){return this._playRealtimeViewModel}},dateFormatter:{get:function(){return this._dateFormatter},set:function(e){this._dateFormatter=e}},timeFormatter:{get:function(){return this._timeFormatter},set:function(e){this._timeFormatter=e}}});Qu._maxShuttleRingAngle=MI;Qu._realtimeShuttleRingAngle=cb;var tW=Qu;function $2e(e){e=e??H.EMPTY_OBJECT;let t=e.globe,n=e.imageryProviderViewModels??H.EMPTY_ARRAY,i=e.terrainProviderViewModels??H.EMPTY_ARRAY;this._globe=t,this.imageryProviderViewModels=n.slice(0),this.terrainProviderViewModels=i.slice(0),this.dropDownVisible=!1,Se.track(this,["imageryProviderViewModels","terrainProviderViewModels","dropDownVisible"]);let r=Se.getObservable(this,"imageryProviderViewModels"),o=Se.pureComputed(function(){let d=r(),p={},g;for(g=0;g<d.length;g++){let A=d[g],b=A.category;l(p[b])?p[b].push(A):p[b]=[A]}let m=Object.keys(p),y=[];for(g=0;g<m.length;g++){let A=m[g];y.push({name:A,providers:p[A]})}return y});this._imageryProviders=o;let s=Se.getObservable(this,"terrainProviderViewModels"),a=Se.pureComputed(function(){let d=s(),p={},g;for(g=0;g<d.length;g++){let A=d[g],b=A.category;l(p[b])?p[b].push(A):p[b]=[A]}let m=Object.keys(p),y=[];for(g=0;g<m.length;g++){let A=m[g];y.push({name:A,providers:p[A]})}return y});this._terrainProviders=a,this.buttonTooltip=void 0,Se.defineProperty(this,"buttonTooltip",function(){let d=this.selectedImagery,p=this.selectedTerrain,g=l(d)?d.name:void 0,m=l(p)?p.name:void 0;return l(g)&&l(m)?`${g} -${m}`:l(g)?g:m}),this.buttonImageUrl=void 0,Se.defineProperty(this,"buttonImageUrl",function(){let d=this.selectedImagery;if(l(d))return d.iconUrl}),this.selectedImagery=void 0;let c=Se.observable();this._currentImageryLayers=[],Se.defineProperty(this,"selectedImagery",{get:function(){return c()},set:function(d){if(c()===d){this.dropDownVisible=!1;return}let p,g=this._currentImageryLayers,m=g.length,y=this._globe.imageryLayers,A=!1;for(p=0;p<m;p++){let b=y.length;for(let x=0;x<b;x++){let T=y.get(x);if(T===g[p]){y.remove(T),A=!0;break}}}if(l(d)){let b=d.creationCommand();if(Array.isArray(b)){let x=b.length;for(this._currentImageryLayers=[],p=x-1;p>=0;p--){let T=Ms.fromProviderAsync(b[p]);y.add(T,0),this._currentImageryLayers.push(T)}}else{this._currentImageryLayers=[];let x=Ms.fromProviderAsync(b);if(x.name=d.name,A)y.add(x,0);else{let T=y.get(0);l(T)&&y.remove(T),y.add(x,0)}this._currentImageryLayers.push(x)}}c(d),this.dropDownVisible=!1}}),this.selectedTerrain=void 0;let u=Se.observable();Se.defineProperty(this,"selectedTerrain",{get:function(){return u()},set:function(d){if(u()===d){this.dropDownVisible=!1;return}let p;if(l(d)&&(p=d.creationCommand()),l(p)&&!l(p.then))this._globe.depthTestAgainstTerrain=!(p instanceof Qg),this._globe.terrainProvider=p;else if(l(p)){let g=!1,m=this._globe.terrainProviderChanged.addEventListener(()=>{g=!0,m()}),A=new j7(p).readyEvent.addEventListener(b=>{g||(this._globe.depthTestAgainstTerrain=!(b instanceof Qg),this._globe.terrainProvider=b,A())})}u(d),this.dropDownVisible=!1}});let f=this;this._toggleDropDown=On(function(){f.dropDownVisible=!f.dropDownVisible}),this.selectedImagery=e.selectedImageryProviderViewModel??n[0],this.selectedTerrain=e.selectedTerrainProviderViewModel}Object.defineProperties($2e.prototype,{toggleDropDown:{get:function(){return this._toggleDropDown}},globe:{get:function(){return this._globe}}});var nW=$2e;function iW(e,t){e=kn(e);let n=new nW(t),i=document.createElement("button");i.type="button",i.className="cesium-button cesium-toolbar-button",i.setAttribute("data-bind","attr: { title: buttonTooltip },click: toggleDropDown"),e.appendChild(i);let r=document.createElement("img");r.setAttribute("draggable","false"),r.className="cesium-baseLayerPicker-selected",r.setAttribute("data-bind","attr: { src: buttonImageUrl }, visible: !!buttonImageUrl"),i.appendChild(r);let o=document.createElement("div");o.className="cesium-baseLayerPicker-dropDown",o.setAttribute("data-bind",'css: { "cesium-baseLayerPicker-dropDown-visible" : dropDownVisible }'),e.appendChild(o);let s=document.createElement("div");s.className="cesium-baseLayerPicker-sectionTitle",s.setAttribute("data-bind","visible: imageryProviderViewModels.length > 0"),s.innerHTML="Imagery",o.appendChild(s);let a=document.createElement("div");a.className="cesium-baseLayerPicker-section",a.setAttribute("data-bind","foreach: _imageryProviders"),o.appendChild(a);let c=document.createElement("div");c.className="cesium-baseLayerPicker-category",a.appendChild(c);let u=document.createElement("div");u.className="cesium-baseLayerPicker-categoryTitle",u.setAttribute("data-bind","text: name"),c.appendChild(u);let f=document.createElement("div");f.className="cesium-baseLayerPicker-choices",f.setAttribute("data-bind","foreach: providers"),c.appendChild(f);let d=document.createElement("div");d.className="cesium-baseLayerPicker-item",d.setAttribute("data-bind",'css: { "cesium-baseLayerPicker-selectedItem" : $data === $parents[1].selectedImagery },attr: { title: tooltip },visible: creationCommand.canExecute,click: function($data) { $parents[1].selectedImagery = $data; }'),f.appendChild(d);let p=document.createElement("img");p.className="cesium-baseLayerPicker-itemIcon",p.setAttribute("data-bind","attr: { src: iconUrl }"),p.setAttribute("draggable","false"),d.appendChild(p);let g=document.createElement("div");g.className="cesium-baseLayerPicker-itemLabel",g.setAttribute("data-bind","text: name"),d.appendChild(g);let m=document.createElement("div");m.className="cesium-baseLayerPicker-sectionTitle",m.setAttribute("data-bind","visible: terrainProviderViewModels.length > 0"),m.innerHTML="Terrain",o.appendChild(m);let y=document.createElement("div");y.className="cesium-baseLayerPicker-section",y.setAttribute("data-bind","foreach: _terrainProviders"),o.appendChild(y);let A=document.createElement("div");A.className="cesium-baseLayerPicker-category",y.appendChild(A);let b=document.createElement("div");b.className="cesium-baseLayerPicker-categoryTitle",b.setAttribute("data-bind","text: name"),A.appendChild(b);let x=document.createElement("div");x.className="cesium-baseLayerPicker-choices",x.setAttribute("data-bind","foreach: providers"),A.appendChild(x);let T=document.createElement("div");T.className="cesium-baseLayerPicker-item",T.setAttribute("data-bind",'css: { "cesium-baseLayerPicker-selectedItem" : $data === $parents[1].selectedTerrain },attr: { title: tooltip },visible: creationCommand.canExecute,click: function($data) { $parents[1].selectedTerrain = $data; }'),x.appendChild(T);let E=document.createElement("img");E.className="cesium-baseLayerPicker-itemIcon",E.setAttribute("data-bind","attr: { src: iconUrl }"),E.setAttribute("draggable","false"),T.appendChild(E);let v=document.createElement("div");v.className="cesium-baseLayerPicker-itemLabel",v.setAttribute("data-bind","text: name"),T.appendChild(v),Se.applyBindings(n,i),Se.applyBindings(n,o),this._viewModel=n,this._container=e,this._element=i,this._dropPanel=o,this._closeDropDown=function(S){i.contains(S.target)||o.contains(S.target)||(n.dropDownVisible=!1)},dn.supportsPointerEvents()?document.addEventListener("pointerdown",this._closeDropDown,!0):(document.addEventListener("mousedown",this._closeDropDown,!0),document.addEventListener("touchstart",this._closeDropDown,!0))}Object.defineProperties(iW.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}}});iW.prototype.isDestroyed=function(){return!1};iW.prototype.destroy=function(){return dn.supportsPointerEvents()?document.removeEventListener("pointerdown",this._closeDropDown,!0):(document.removeEventListener("mousedown",this._closeDropDown,!0),document.removeEventListener("touchstart",this._closeDropDown,!0)),Se.cleanNode(this._element),Se.cleanNode(this._dropPanel),this._container.removeChild(this._element),this._container.removeChild(this._dropPanel),le(this)};var rW=iW;function J2e(e){let t=e.creationFunction;l(t.canExecute)||(t=On(t)),this._creationCommand=t,this.name=e.name,this.tooltip=e.tooltip,this.iconUrl=e.iconUrl,this._category=e.category??"",Se.track(this,["name","tooltip","iconUrl"])}Object.defineProperties(J2e.prototype,{creationCommand:{get:function(){return this._creationCommand}},category:{get:function(){return this._category}}});var yo=J2e;function aHt(){let e=[],t=devicePixelRatio>=2;return e.push(new yo({name:"Bing Maps Aerial",iconUrl:Zt("Widgets/Images/ImageryProviders/bingAerial.png"),tooltip:"Bing Maps aerial imagery, provided by Cesium ion",category:"Cesium ion",creationFunction:function(){return Ry({style:Dy.AERIAL})}})),e.push(new yo({name:"Bing Maps Aerial with Labels",iconUrl:Zt("Widgets/Images/ImageryProviders/bingAerialLabels.png"),tooltip:"Bing Maps aerial imagery with labels, provided by Cesium ion",category:"Cesium ion",creationFunction:function(){return Ry({style:Dy.AERIAL_WITH_LABELS})}})),e.push(new yo({name:"Bing Maps Roads",iconUrl:Zt("Widgets/Images/ImageryProviders/bingRoads.png"),tooltip:"Bing Maps standard road maps, provided by Cesium ion",category:"Cesium ion",creationFunction:function(){return Ry({style:Dy.ROAD})}})),e.push(new yo({name:"ArcGIS World Imagery",iconUrl:Zt("Widgets/Images/ImageryProviders/ArcGisMapServiceWorldImagery.png"),tooltip:`ArcGIS World Imagery provides one meter or better satellite and aerial imagery in many parts of the world and lower resolution satellite imagery worldwide. The map includes 15m TerraColor imagery at small and mid-scales (~1:591M down to ~1:288k) for the world. The map features Maxar imagery at 0.3m resolution for select metropolitan areas around the world, 0.5m resolution across the United States and parts of Western Europe, and 1m resolution imagery across the rest of the world. In addition to commercial sources, the World Imagery map features high-resolution aerial photography contributed by the GIS User Community. This imagery ranges from 0.3m to 0.03m resolution (down to ~1:280 nin select communities). For more information on this map, including the terms of use, visit us online at -https://www.arcgis.com/home/item.html?id=10df2279f9684e4a9f6a7f08febac2a9`,category:"Other",creationFunction:function(){return Py.fromBasemapType(Ap.SATELLITE,{enablePickFeatures:!1})}})),e.push(new yo({name:"ArcGIS World Hillshade",iconUrl:Zt("Widgets/Images/ImageryProviders/ArcGisMapServiceWorldHillshade.png"),tooltip:`ArcGIS World Hillshade map portrays elevation as an artistic hillshade. This map is designed to be used as a backdrop for topographical, soil, hydro, landcover or other outdoor recreational maps. The map was compiled from a variety of sources from several data providers. The basemap has global coverage down to a scale of ~1:72k. In select areas of the United States and Europe, coverage is available down to ~1:9k. For more information on this map, including the terms of use, visit us online at -https://www.arcgis.com/home/item.html?id=1b243539f4514b6ba35e7d995890db1d`,category:"Other",creationFunction:function(){return Py.fromBasemapType(Ap.HILLSHADE,{enablePickFeatures:!1})}})),e.push(new yo({name:"Esri World Ocean",iconUrl:Zt("Widgets/Images/ImageryProviders/ArcGisMapServiceWorldOcean.png"),tooltip:`ArcGIS World Ocean map is designed to be used as a base map by marine GIS professionals and as a reference map by anyone interested in ocean data. The base map features marine bathymetry. Land features include inland waters and roads overlaid on land cover and shaded relief imagery. The map was compiled from a variety of best available sources from several data providers, including General Bathymetric Chart of the Oceans GEBCO_08 Grid, National Oceanic and Atmospheric Administration (NOAA), and National Geographic, Garmin, HERE, Geonames.org, and Esri, and various other contributors. The base map currently provides coverage for the world down to a scale of ~1:577k, and coverage down to 1:72k in US coastal areas, and various other areas. Coverage down to ~ 1:9k is available limited areas based on regional hydrographic survey data. The base map was designed and developed by Esri. For more information on this map, including our terms of use, visit us online at -https://www.arcgis.com/home/item.html?id=1e126e7520f9466c9ca28b8f28b5e500`,category:"Other",creationFunction:function(){return Py.fromBasemapType(Ap.OCEANS,{enablePickFeatures:!1})}})),e.push(new yo({name:"Open\xADStreet\xADMap",iconUrl:Zt("Widgets/Images/ImageryProviders/openStreetMap.png"),tooltip:`OpenStreetMap (OSM) is a collaborative project to create a free editable map of the world. + */var Cae="__knockoutObservables",vae="__knockoutSubscribable";function k2e(e,t){if(!e)throw new Error("When calling ko.track, you must pass an object as the first parameter.");var n=this,i=U2e(e,!0);return t=t||Object.getOwnPropertyNames(e),t.forEach(function(r){if(!(r===Cae||r===vae)&&!(r in i)){var o=e[r],s=o instanceof Array,a=n.isObservable(o)?o:s?n.observableArray(o):n.observable(o);Object.defineProperty(e,r,{configurable:!0,enumerable:!0,get:a,set:n.isWriteableObservable(a)?a:void 0}),i[r]=a,s&&B6t(n,a)}}),e}function U2e(e,t){var n=e[Cae];return!n&&t&&(n={},Object.defineProperty(e,Cae,{value:n})),n}function F6t(e,t,n){var i=this,r={owner:e,deferEvaluation:!0};if(typeof n=="function")r.read=n;else{if("value"in n)throw new Error('For ko.defineProperty, you must not specify a "value" for the property. You must provide a "get" function.');if(typeof n.get!="function")throw new Error('For ko.defineProperty, the third parameter must be either an evaluator function, or an options object containing a function called "get".');r.read=n.get,r.write=n.set}return e[t]=i.computed(r),k2e.call(i,e,[t]),e}function B6t(e,t){var n=null;e.computed(function(){n&&(n.dispose(),n=null);var i=t();i instanceof Array&&(n=k6t(e,t,i))})}function k6t(e,t,n){var i=U6t(e,n);return i.subscribe(t)}function U6t(e,t){var n=t[vae];if(!n){n=new e.subscribable,Object.defineProperty(t,vae,{value:n});var i={};z6t(t,n,i),V6t(e,t,n,i)}return n}function z6t(e,t,n){["pop","push","reverse","shift","sort","splice","unshift"].forEach(function(i){var r=e[i];e[i]=function(){var o=r.apply(this,arguments);return n.pause!==!0&&t.notifySubscribers(this),o}})}function V6t(e,t,n,i){["remove","removeAll","destroy","destroyAll","replace"].forEach(function(r){Object.defineProperty(t,r,{enumerable:!1,value:function(){var o;i.pause=!0;try{o=e.observableArray.fn[r].apply(e.observableArray(t),arguments)}finally{i.pause=!1}return n.notifySubscribers(t),o}})})}function z2e(e,t){if(!e)return null;var n=U2e(e,!1);return n&&n[t]||null}function j6t(e,t){var n=z2e(e,t);n&&n.valueHasMutated()}function H6t(e){e.track=k2e,e.getObservable=z2e,e.valueHasMutated=j6t,e.defineProperty=F6t}var Y7={attachToKo:H6t};var V2e="http://www.w3.org/2000/svg",j2e="cesium-svgPath-svg",G6t={register:function(e){e.bindingHandlers.cesiumSvgPath={init:function(t,n){let i=document.createElementNS(V2e,"svg:svg");i.setAttribute("class",j2e);let r=document.createElementNS(V2e,"path");return i.appendChild(r),e.virtualElements.setDomNodeChildren(t,[i]),e.computed({read:function(){let o=e.unwrap(n());r.setAttribute("d",e.unwrap(o.path));let s=e.unwrap(o.width),a=e.unwrap(o.height);i.setAttribute("width",s),i.setAttribute("height",a),i.setAttribute("viewBox",`0 0 ${s} ${a}`),o.css&&i.setAttribute("class",`${j2e} ${e.unwrap(o.css)}`)},disposeWhenNodeIsRemoved:t}),{controlsDescendantBindings:!0}}},e.virtualElements.allowedBindings.cesiumSvgPath=!0}},X7=G6t;Y7.attachToKo(DI);X7.register(DI);var Se=DI;function KM(e){l(e)||(e=new Km),this._clock=e,this._eventHelper=new Wo,this._eventHelper.add(e.onTick,this.synchronize,this),this.systemTime=Se.observable(K.now()),this.systemTime.equalityComparer=K.equals,this.startTime=Se.observable(e.startTime),this.startTime.equalityComparer=K.equals,this.startTime.subscribe(function(t){e.startTime=t,this.synchronize()},this),this.stopTime=Se.observable(e.stopTime),this.stopTime.equalityComparer=K.equals,this.stopTime.subscribe(function(t){e.stopTime=t,this.synchronize()},this),this.currentTime=Se.observable(e.currentTime),this.currentTime.equalityComparer=K.equals,this.currentTime.subscribe(function(t){e.currentTime=t,this.synchronize()},this),this.multiplier=Se.observable(e.multiplier),this.multiplier.subscribe(function(t){e.multiplier=t,this.synchronize()},this),this.clockStep=Se.observable(e.clockStep),this.clockStep.subscribe(function(t){e.clockStep=t,this.synchronize()},this),this.clockRange=Se.observable(e.clockRange),this.clockRange.subscribe(function(t){e.clockRange=t,this.synchronize()},this),this.canAnimate=Se.observable(e.canAnimate),this.canAnimate.subscribe(function(t){e.canAnimate=t,this.synchronize()},this),this.shouldAnimate=Se.observable(e.shouldAnimate),this.shouldAnimate.subscribe(function(t){e.shouldAnimate=t,this.synchronize()},this),Se.track(this,["systemTime","startTime","stopTime","currentTime","multiplier","clockStep","clockRange","canAnimate","shouldAnimate"])}Object.defineProperties(KM.prototype,{clock:{get:function(){return this._clock}}});KM.prototype.synchronize=function(){let e=this._clock;this.systemTime=K.now(),this.startTime=e.startTime,this.stopTime=e.stopTime,this.currentTime=e.currentTime,this.multiplier=e.multiplier,this.clockStep=e.clockStep,this.clockRange=e.clockRange,this.canAnimate=e.canAnimate,this.shouldAnimate=e.shouldAnimate};KM.prototype.isDestroyed=function(){return!1};KM.prototype.destroy=function(){this._eventHelper.removeAll(),le(this)};var K7=KM;function W6t(){this.canExecute=void 0,this.beforeExecute=void 0,this.afterExecute=void 0,pe.throwInstantiationError()}var H2e=W6t;function q6t(e,t){t=t??!0;let n=new be,i=new be;function r(){let o={args:arguments,cancel:!1},s;return n.raiseEvent(o),o.cancel||(s=e.apply(null,arguments),i.raiseEvent(s)),s}return r.canExecute=t,Se.track(r,["canExecute"]),Object.defineProperties(r,{beforeExecute:{value:n},afterExecute:{value:i}}),r}var On=q6t;var RI={};RI.createCheckbox=function(e,t,n){let i=document.createElement("div"),r=document.createElement("label"),o=document.createElement("input");o.type="checkbox";let s=`checked: ${t}`;return l(n)&&(s+=`, enable: ${n}`),o.setAttribute("data-bind",s),r.appendChild(o),r.appendChild(document.createTextNode(e)),i.appendChild(r),i};RI.createSection=function(e,t,n,i){let r=document.createElement("div");r.className="cesium-cesiumInspector-section",r.setAttribute("data-bind",`css: { "cesium-cesiumInspector-section-collapsed": !${n} }`),e.appendChild(r);let o=document.createElement("h3");o.className="cesium-cesiumInspector-sectionHeader",o.appendChild(document.createTextNode(t)),o.setAttribute("data-bind",`click: ${i}`),r.appendChild(o);let s=document.createElement("div");return s.className="cesium-cesiumInspector-sectionContent",r.appendChild(s),s};RI.createRangeInput=function(e,t,n,i,r,o){o=o??t;let s=document.createElement("input");s.setAttribute("data-bind",`value: ${o}`),s.type="number";let a=document.createElement("input");a.type="range",a.min=n,a.max=i,a.step=r??"any",a.setAttribute("data-bind",`valueUpdate: "input", value: ${t}`);let c=document.createElement("div");c.appendChild(a);let u=document.createElement("div");return u.className="cesium-cesiumInspector-slider",u.appendChild(document.createTextNode(e)),u.appendChild(s),u.appendChild(c),u};RI.createRangeInputWithDynamicMinMax=function(e,t,n,i){i=i??t;let r=document.createElement("input");r.setAttribute("data-bind",`value: ${i}`),r.type="number";let o=document.createElement("input");o.type="range",o.step=n??"any",o.setAttribute("data-bind",`valueUpdate: "input", value: ${t}, attr: { min: ${t}Min, max: ${t}Max }`);let s=document.createElement("div");s.appendChild(o);let a=document.createElement("div");return a.className="cesium-cesiumInspector-slider",a.appendChild(document.createTextNode(e)),a.appendChild(r),a.appendChild(s),a};RI.createButton=function(e,t,n){let i=document.createElement("button");i.type="button",i.textContent=e,i.className="cesium-cesiumInspector-pickButton";let r=`click: ${t}`;return l(n)&&(r+=`, css: {"cesium-cesiumInspector-pickButtonHighlight" : ${n}}`),i.setAttribute("data-bind",r),i};var Wf=RI;function Y6t(e,t,n,i,r){return n.call(i,e[t]),Se.getObservable(e,t).subscribe(n,i,r)}var Oc=Y6t;function G2e(e,t){this._command=e,t=t??H.EMPTY_OBJECT,this.toggled=t.toggled??!1,this.tooltip=t.tooltip??"",Se.track(this,["toggled","tooltip"])}Object.defineProperties(G2e.prototype,{command:{get:function(){return this._command}}});var uE=G2e;var gl="http://www.w3.org/2000/svg",X2e="http://www.w3.org/1999/xlink",$7,$M=z.fromCssColorString("rgba(247,250,255,0.384)"),J7=z.fromCssColorString("rgba(143,191,255,0.216)"),Sae=z.fromCssColorString("rgba(153,197,255,0.098)"),Z7=z.fromCssColorString("rgba(255,255,255,0.086)"),X6t=z.fromCssColorString("rgba(255,255,255,0.267)"),K6t=z.fromCssColorString("rgba(255,255,255,0)"),W2e=z.fromCssColorString("rgba(66,67,68,0.3)"),q2e=z.fromCssColorString("rgba(0,0,0,0.5)");function ab(e){return z.fromCssColorString(window.getComputedStyle(e).getPropertyValue("color"))}var JM={animation_pathReset:{tagName:"path",transform:"translate(16,16) scale(0.85) translate(-16,-16)",d:"M24.316,5.318,9.833,13.682,9.833,5.5,5.5,5.5,5.5,25.5,9.833,25.5,9.833,17.318,24.316,25.682z"},animation_pathPause:{tagName:"path",transform:"translate(16,16) scale(0.85) translate(-16,-16)",d:"M13,5.5,7.5,5.5,7.5,25.5,13,25.5zM24.5,5.5,19,5.5,19,25.5,24.5,25.5z"},animation_pathPlay:{tagName:"path",transform:"translate(16,16) scale(0.85) translate(-16,-16)",d:"M6.684,25.682L24.316,15.5L6.684,5.318V25.682z"},animation_pathPlayReverse:{tagName:"path",transform:"translate(16,16) scale(-0.85,0.85) translate(-16,-16)",d:"M6.684,25.682L24.316,15.5L6.684,5.318V25.682z"},animation_pathLoop:{tagName:"path",transform:"translate(16,16) scale(0.85) translate(-16,-16)",d:"M24.249,15.499c-0.009,4.832-3.918,8.741-8.75,8.75c-2.515,0-4.768-1.064-6.365-2.763l2.068-1.442l-7.901-3.703l0.744,8.694l2.193-1.529c2.244,2.594,5.562,4.242,9.26,4.242c6.767,0,12.249-5.482,12.249-12.249H24.249zM15.499,6.75c2.516,0,4.769,1.065,6.367,2.764l-2.068,1.443l7.901,3.701l-0.746-8.693l-2.192,1.529c-2.245-2.594-5.562-4.245-9.262-4.245C8.734,3.25,3.25,8.734,3.249,15.499H6.75C6.758,10.668,10.668,6.758,15.499,6.75z"},animation_pathClock:{tagName:"path",transform:"translate(16,16) scale(0.85) translate(-16,-15.5)",d:"M15.5,2.374C8.251,2.375,2.376,8.251,2.374,15.5C2.376,22.748,8.251,28.623,15.5,28.627c7.249-0.004,13.124-5.879,13.125-13.127C28.624,8.251,22.749,2.375,15.5,2.374zM15.5,25.623C9.909,25.615,5.385,21.09,5.375,15.5C5.385,9.909,9.909,5.384,15.5,5.374c5.59,0.01,10.115,4.535,10.124,10.125C25.615,21.09,21.091,25.615,15.5,25.623zM8.625,15.5c-0.001-0.552-0.448-0.999-1.001-1c-0.553,0-1,0.448-1,1c0,0.553,0.449,1,1,1C8.176,16.5,8.624,16.053,8.625,15.5zM8.179,18.572c-0.478,0.277-0.642,0.889-0.365,1.367c0.275,0.479,0.889,0.641,1.365,0.365c0.479-0.275,0.643-0.887,0.367-1.367C9.27,18.461,8.658,18.297,8.179,18.572zM9.18,10.696c-0.479-0.276-1.09-0.112-1.366,0.366s-0.111,1.09,0.365,1.366c0.479,0.276,1.09,0.113,1.367-0.366C9.821,11.584,9.657,10.973,9.18,10.696zM22.822,12.428c0.478-0.275,0.643-0.888,0.366-1.366c-0.275-0.478-0.89-0.642-1.366-0.366c-0.479,0.278-0.642,0.89-0.366,1.367C21.732,12.54,22.344,12.705,22.822,12.428zM12.062,21.455c-0.478-0.275-1.089-0.111-1.366,0.367c-0.275,0.479-0.111,1.09,0.366,1.365c0.478,0.277,1.091,0.111,1.365-0.365C12.704,22.344,12.54,21.732,12.062,21.455zM12.062,9.545c0.479-0.276,0.642-0.888,0.366-1.366c-0.276-0.478-0.888-0.642-1.366-0.366s-0.642,0.888-0.366,1.366C10.973,9.658,11.584,9.822,12.062,9.545zM22.823,18.572c-0.48-0.275-1.092-0.111-1.367,0.365c-0.275,0.479-0.112,1.092,0.367,1.367c0.477,0.275,1.089,0.113,1.365-0.365C23.464,19.461,23.3,18.848,22.823,18.572zM19.938,7.813c-0.477-0.276-1.091-0.111-1.365,0.366c-0.275,0.48-0.111,1.091,0.366,1.367s1.089,0.112,1.366-0.366C20.581,8.702,20.418,8.089,19.938,7.813zM23.378,14.5c-0.554,0.002-1.001,0.45-1.001,1c0.001,0.552,0.448,1,1.001,1c0.551,0,1-0.447,1-1C24.378,14.949,23.929,14.5,23.378,14.5zM15.501,6.624c-0.552,0-1,0.448-1,1l-0.466,7.343l-3.004,1.96c-0.478,0.277-0.642,0.889-0.365,1.365c0.275,0.479,0.889,0.643,1.365,0.367l3.305-1.676C15.39,16.99,15.444,17,15.501,17c0.828,0,1.5-0.671,1.5-1.5l-0.5-7.876C16.501,7.072,16.053,6.624,15.501,6.624zM15.501,22.377c-0.552,0-1,0.447-1,1s0.448,1,1,1s1-0.447,1-1S16.053,22.377,15.501,22.377zM18.939,21.455c-0.479,0.277-0.643,0.889-0.366,1.367c0.275,0.477,0.888,0.643,1.366,0.365c0.478-0.275,0.642-0.889,0.366-1.365C20.028,21.344,19.417,21.18,18.939,21.455z"},animation_pathWingButton:{tagName:"path",d:"m 4.5,0.5 c -2.216,0 -4,1.784 -4,4 l 0,24 c 0,2.216 1.784,4 4,4 l 13.71875,0 C 22.478584,27.272785 27.273681,22.511272 32.5,18.25 l 0,-13.75 c 0,-2.216 -1.784,-4 -4,-4 l -24,0 z"},animation_pathPointer:{tagName:"path",d:"M-15,-65,-15,-55,15,-55,15,-65,0,-95z"},animation_pathSwooshFX:{tagName:"path",d:"m 85,0 c 0,16.617 -4.813944,35.356 -13.131081,48.4508 h 6.099803 c 8.317138,-13.0948 13.13322,-28.5955 13.13322,-45.2124 0,-46.94483 -38.402714,-85.00262 -85.7743869,-85.00262 -1.0218522,0 -2.0373001,0.0241 -3.0506131,0.0589 45.958443,1.59437 82.723058,35.77285 82.723058,81.70532 z"}};function Pm(e){let t=document.createElementNS(gl,e.tagName);for(let n in e)if(e.hasOwnProperty(n)&&n!=="tagName")if(n==="children"){let i=e.children.length;for(let r=0;r<i;++r)t.appendChild(Pm(e.children[r]))}else n.indexOf("xlink:")===0?t.setAttributeNS(X2e,n.substring(6),e[n]):n==="textContent"?t.textContent=e[n]:t.setAttribute(n,e[n]);return t}function Iae(e,t,n){let i=document.createElementNS(gl,"text");i.setAttribute("x",e),i.setAttribute("y",t),i.setAttribute("class","cesium-animation-svgText");let r=document.createElementNS(gl,"tspan");return r.textContent=n,i.appendChild(r),i}function $6t(e,t){let n=Iae(e,t,"");n.removeChild(n.firstChild);let i={},r=[],o=["month","day","year"];for(let a=0;a<o.length;++a){if(a>0){let f=document.createElementNS(gl,"tspan");f.textContent=" ",r.push(f),n.appendChild(f)}let c=o[a],u=document.createElementNS(gl,"tspan");u.setAttribute("class",`cesium-animation-dateField cesium-animation-dateField-${c}`),u.setAttribute("aria-label",`Adjust ${c} with mouse wheel`),i[c]=u,n.appendChild(u)}let s=document.createElementNS(gl,"tspan");return n.appendChild(s),{element:n,fallback:s,parts:i,separators:r}}function J6t(e,t){let n=/^(\S+)\s+(\d{1,2})\s+(\d{1,4})$/.exec(t),i=e.parts,r=e.separators;if(n===null){i.month.textContent="",i.day.textContent="",i.year.textContent="",r[0].textContent="",r[1].textContent="",e.fallback.textContent=t;return}i.month.textContent=n[1],i.day.textContent=n[2],i.year.textContent=n[3],r[0].textContent=" ",r[1].textContent=" ",e.fallback.textContent=""}function Z6t(e,t){let n=Iae(e,t,"");n.removeChild(n.firstChild);let i={},r=[],o=["hour","minute","second"];for(let f=0;f<o.length;++f){if(f>0){let g=document.createElementNS(gl,"tspan");g.textContent=":",r.push(g),n.appendChild(g)}let d=o[f],p=document.createElementNS(gl,"tspan");p.setAttribute("class",`cesium-animation-timeField cesium-animation-timeField-${d}`),p.setAttribute("aria-label",`Adjust ${d} with mouse wheel`),i[d]=p,n.appendChild(p)}let s=document.createElementNS(gl,"tspan");n.appendChild(s);let a=document.createElementNS(gl,"tspan");a.setAttribute("class","cesium-animation-timeField cesium-animation-timeField-millisecond"),a.setAttribute("aria-label","Adjust millisecond with mouse wheel"),i.millisecond=a,n.appendChild(a);let c=document.createElementNS(gl,"tspan");n.appendChild(c);let u=document.createElementNS(gl,"tspan");return n.appendChild(u),{decimalPoint:s,element:n,fallback:u,parts:i,separators:r,suffix:c}}function Q6t(e,t){let n=/^(\d{2}):(\d{2}):(\d{2})(?:\.(\d{3})| UTC)$/.exec(t),i=e.parts,r=e.separators;if(n===null){i.hour.textContent="",i.minute.textContent="",i.second.textContent="",i.millisecond.textContent="",r[0].textContent="",r[1].textContent="",e.decimalPoint.textContent="",e.suffix.textContent="",e.fallback.textContent=t;return}i.hour.textContent=n[1],i.minute.textContent=n[2],i.second.textContent=n[3],r[0].textContent=":",r[1].textContent=":",e.decimalPoint.textContent=l(n[4])?".":"",i.millisecond.textContent=n[4]??"",e.suffix.textContent=l(n[4])?"":" UTC",e.fallback.textContent=""}function Y2e(e,t,n){let i=Object.keys(t);for(let r=0;r<i.length;++r){let o=i[r],s=t[o],a=function(c){c.deltaY!==0&&(n(o,c.deltaY<0?1:-1),c.preventDefault(),c.stopPropagation())};s.addEventListener("wheel",a,!1),e._fieldWheelListeners.push({element:s,listener:a})}}function eHt(e,t,n){e.setAttribute("transform",`translate(100,100) rotate(${n})`),t.setAttribute("transform",`rotate(${n})`)}var Q7=new z;function Us(e,t){let n=t.alpha,i=1-n;return Q7.red=e.red*i+t.red*n,Q7.green=e.green*i+t.green*n,Q7.blue=e.blue*i+t.blue*n,Q7.toCssColorString()}function wae(e,t,n){let i=JM[n],r={tagName:"g",class:"cesium-animation-rectButton",transform:`translate(${e},${t})`,children:[{tagName:"rect",class:"cesium-animation-buttonGlow",width:32,height:32,rx:2,ry:2},{tagName:"rect",class:"cesium-animation-buttonMain",width:32,height:32,rx:4,ry:4},{class:"cesium-animation-buttonPath",id:n,tagName:i.tagName,transform:i.transform,d:i.d},{tagName:"title",textContent:""}]};return Pm(r)}function tHt(e,t,n){let i=JM[n],r=JM.animation_pathWingButton,o={tagName:"g",class:"cesium-animation-rectButton",transform:`translate(${e},${t})`,children:[{class:"cesium-animation-buttonGlow",id:"animation_pathWingButton",tagName:r.tagName,d:r.d},{class:"cesium-animation-buttonMain",id:"animation_pathWingButton",tagName:r.tagName,d:r.d},{class:"cesium-animation-buttonPath",id:n,tagName:i.tagName,transform:i.transform,d:i.d},{tagName:"title",textContent:""}]};return Pm(o)}function nHt(e,t){let n=e._viewModel,i=n.shuttleRingDragging;if(!(i&&$7!==e))if(t.type==="mousedown"||i&&t.type==="mousemove"||t.type==="touchstart"&&t.touches.length===1||i&&t.type==="touchmove"&&t.touches.length===1){let r=e._centerX,o=e._centerY,a=e._svgNode.getBoundingClientRect(),c,u;if(t.type==="touchstart"||t.type==="touchmove"?(c=t.touches[0].clientX,u=t.touches[0].clientY):(c=t.clientX,u=t.clientY),!i&&(c>a.right||c<a.left||u<a.top||u>a.bottom))return;let f=e._shuttleRingPointer.getBoundingClientRect(),d=c-r-a.left,p=u-o-a.top,g=Math.atan2(p,d)*180/Math.PI+90;g>180&&(g-=360);let m=n.shuttleRingAngle;i||c<f.right&&c>f.left&&u>f.top&&u<f.bottom?($7=e,n.shuttleRingDragging=!0,n.shuttleRingAngle=g):g<m?n.slower():g>m&&n.faster(),t.preventDefault()}else e===$7&&($7=void 0),n.shuttleRingDragging=!1}function A_(e,t){this._viewModel=t,this.svgElement=e,this._enabled=void 0,this._toggled=void 0;let n=this;this._clickFunction=function(){let i=n._viewModel.command;i.canExecute&&i()},e.addEventListener("click",this._clickFunction,!0),this._subscriptions=[Oc(t,"toggled",this.setToggled,this),Oc(t,"tooltip",this.setTooltip,this),Oc(t.command,"canExecute",this.setEnabled,this)]}A_.prototype.destroy=function(){this.svgElement.removeEventListener("click",this._clickFunction,!0);let e=this._subscriptions;for(let t=0,n=e.length;t<n;t++)e[t].dispose();le(this)};A_.prototype.isDestroyed=function(){return!1};A_.prototype.setEnabled=function(e){if(this._enabled!==e){if(this._enabled=e,!e){this.svgElement.setAttribute("class","cesium-animation-buttonDisabled");return}if(this._toggled){this.svgElement.setAttribute("class","cesium-animation-rectButton cesium-animation-buttonToggled");return}this.svgElement.setAttribute("class","cesium-animation-rectButton")}};A_.prototype.setToggled=function(e){this._toggled!==e&&(this._toggled=e,this._enabled&&(e?this.svgElement.setAttribute("class","cesium-animation-rectButton cesium-animation-buttonToggled"):this.svgElement.setAttribute("class","cesium-animation-rectButton")))};A_.prototype.setTooltip=function(e){this.svgElement.getElementsByTagName("title")[0].textContent=e};function OI(e,t){e=kn(e),this._viewModel=t,this._container=e,this._centerX=0,this._centerY=0,this._defsElement=void 0,this._svgNode=void 0,this._topG=void 0,this._lastHeight=void 0,this._lastWidth=void 0;let n=e.ownerDocument,i=document.createElement("style");i.textContent=".cesium-animation-rectButton .cesium-animation-buttonGlow { filter: url(#animation_blurred); }.cesium-animation-rectButton .cesium-animation-buttonMain { fill: url(#animation_buttonNormal); }.cesium-animation-buttonToggled .cesium-animation-buttonMain { fill: url(#animation_buttonToggled); }.cesium-animation-rectButton:hover .cesium-animation-buttonMain { fill: url(#animation_buttonHovered); }.cesium-animation-buttonDisabled .cesium-animation-buttonMain { fill: url(#animation_buttonDisabled); }.cesium-animation-shuttleRingG .cesium-animation-shuttleRingSwoosh { fill: url(#animation_shuttleRingSwooshGradient); }.cesium-animation-shuttleRingG:hover .cesium-animation-shuttleRingSwoosh { fill: url(#animation_shuttleRingSwooshHovered); }.cesium-animation-shuttleRingPointer { fill: url(#animation_shuttleRingPointerGradient); }.cesium-animation-shuttleRingPausePointer { fill: url(#animation_shuttleRingPointerPaused); }.cesium-animation-knobOuter { fill: url(#animation_knobOuter); }.cesium-animation-knobInner { fill: url(#animation_knobInner); }",n.head.insertBefore(i,n.head.childNodes[0]);let r=document.createElement("div");r.className="cesium-animation-theme",r.innerHTML='<div class="cesium-animation-themeNormal"></div><div class="cesium-animation-themeHover"></div><div class="cesium-animation-themeSelect"></div><div class="cesium-animation-themeDisabled"></div><div class="cesium-animation-themeKnob"></div><div class="cesium-animation-themePointer"></div><div class="cesium-animation-themeSwoosh"></div><div class="cesium-animation-themeSwooshHover"></div>',this._theme=r,this._themeNormal=r.childNodes[0],this._themeHover=r.childNodes[1],this._themeSelect=r.childNodes[2],this._themeDisabled=r.childNodes[3],this._themeKnob=r.childNodes[4],this._themePointer=r.childNodes[5],this._themeSwoosh=r.childNodes[6],this._themeSwooshHover=r.childNodes[7];let o=document.createElementNS(gl,"svg:svg");this._svgNode=o,o.setAttributeNS("http://www.w3.org/2000/xmlns/","xmlns:xlink",X2e);let s=document.createElementNS(gl,"g");this._topG=s,this._realtimeSVG=new A_(tHt(3,4,"animation_pathClock"),t.playRealtimeViewModel),this._playReverseSVG=new A_(wae(44,99,"animation_pathPlayReverse"),t.playReverseViewModel),this._playForwardSVG=new A_(wae(124,99,"animation_pathPlay"),t.playForwardViewModel),this._pauseSVG=new A_(wae(84,99,"animation_pathPause"),t.pauseViewModel);let a=document.createElementNS(gl,"g");a.appendChild(this._realtimeSVG.svgElement),a.appendChild(this._playReverseSVG.svgElement),a.appendChild(this._playForwardSVG.svgElement),a.appendChild(this._pauseSVG.svgElement);let c=Pm({tagName:"circle",class:"cesium-animation-shuttleRingBack",cx:100,cy:100,r:99});this._shuttleRingBackPanel=c;let u=JM.animation_pathSwooshFX,f=JM.animation_pathPointer,d=Pm({tagName:"g",class:"cesium-animation-shuttleRingSwoosh",children:[{tagName:u.tagName,transform:"translate(100,97) scale(-1,1)",id:"animation_pathSwooshFX",d:u.d},{tagName:u.tagName,transform:"translate(100,97)",id:"animation_pathSwooshFX",d:u.d},{tagName:"line",x1:100,y1:8,x2:100,y2:22}]});this._shuttleRingSwooshG=d,this._shuttleRingPointer=Pm({class:"cesium-animation-shuttleRingPointer",id:"animation_pathPointer",tagName:f.tagName,d:f.d});let p=Pm({tagName:"g",transform:"translate(100,100)"});this._knobOuter=Pm({tagName:"circle",class:"cesium-animation-knobOuter",cx:0,cy:0,r:71});let g=61,m=Pm({tagName:"circle",class:"cesium-animation-knobInner",cx:0,cy:0,r:g}),y=$6t(0,-24);this._knobDate=y.element;let A=Z6t(0,-7);this._knobTime=A.element,this._knobStatus=Iae(0,-41,"");let b=Pm({tagName:"circle",class:"cesium-animation-blank",cx:0,cy:0,r:g}),x=document.createElementNS(gl,"g");x.setAttribute("class","cesium-animation-shuttleRingG"),e.appendChild(r),s.appendChild(x),s.appendChild(p),s.appendChild(a),x.appendChild(c),x.appendChild(d),x.appendChild(this._shuttleRingPointer),p.appendChild(this._knobOuter),p.appendChild(m),p.appendChild(this._knobStatus),p.appendChild(b),p.appendChild(this._knobDate),p.appendChild(this._knobTime),o.appendChild(s),e.appendChild(o);let T=this;function E(I){nHt(T,I)}this._mouseCallback=E,c.addEventListener("mousedown",E,!0),c.addEventListener("touchstart",E,!0),d.addEventListener("mousedown",E,!0),d.addEventListener("touchstart",E,!0),n.addEventListener("mousemove",E,!0),n.addEventListener("touchmove",E,!0),n.addEventListener("mouseup",E,!0),n.addEventListener("touchend",E,!0),n.addEventListener("touchcancel",E,!0),this._shuttleRingPointer.addEventListener("mousedown",E,!0),this._shuttleRingPointer.addEventListener("touchstart",E,!0),this._knobOuter.addEventListener("mousedown",E,!0),this._knobOuter.addEventListener("touchstart",E,!0);let v=this._knobStatus.childNodes[0];this._fieldWheelListeners=[],Y2e(this,y.parts,function(I,R){t.adjustDate(I,R)}),Y2e(this,A.parts,function(I,R){t.adjustTime(I,R)});let S;this._subscriptions=[Oc(t.pauseViewModel,"toggled",function(I){S!==I&&(S=I,S?T._shuttleRingPointer.setAttribute("class","cesium-animation-shuttleRingPausePointer"):T._shuttleRingPointer.setAttribute("class","cesium-animation-shuttleRingPointer"))}),Oc(t,"shuttleRingAngle",function(I){eHt(T._shuttleRingPointer,T._knobOuter,I)}),Oc(t,"dateLabel",function(I){T._knobDate.textContent!==I&&J6t(y,I)}),Oc(t,"timeLabel",function(I){T._knobTime.textContent!==I&&Q6t(A,I)}),Oc(t,"multiplierLabel",function(I){v.textContent!==I&&(v.textContent=I)})],this.applyThemeChanges(),this.resize()}Object.defineProperties(OI.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}}});OI.prototype.isDestroyed=function(){return!1};OI.prototype.destroy=function(){l(this._observer)&&(this._observer.disconnect(),this._observer=void 0);let e=this._container.ownerDocument,t=this._mouseCallback;this._shuttleRingBackPanel.removeEventListener("mousedown",t,!0),this._shuttleRingBackPanel.removeEventListener("touchstart",t,!0),this._shuttleRingSwooshG.removeEventListener("mousedown",t,!0),this._shuttleRingSwooshG.removeEventListener("touchstart",t,!0),e.removeEventListener("mousemove",t,!0),e.removeEventListener("touchmove",t,!0),e.removeEventListener("mouseup",t,!0),e.removeEventListener("touchend",t,!0),e.removeEventListener("touchcancel",t,!0),this._shuttleRingPointer.removeEventListener("mousedown",t,!0),this._shuttleRingPointer.removeEventListener("touchstart",t,!0),this._knobOuter.removeEventListener("mousedown",t,!0),this._knobOuter.removeEventListener("touchstart",t,!0);let n=this._fieldWheelListeners;for(let r=0;r<n.length;++r){let o=n[r];o.element.removeEventListener("wheel",o.listener,!1)}this._container.removeChild(this._svgNode),this._container.removeChild(this._theme),this._realtimeSVG.destroy(),this._playReverseSVG.destroy(),this._playForwardSVG.destroy(),this._pauseSVG.destroy();let i=this._subscriptions;for(let r=0,o=i.length;r<o;r++)i[r].dispose();return le(this)};OI.prototype.resize=function(){let e=this._container.clientWidth,t=this._container.clientHeight;if(e===this._lastWidth&&t===this._lastHeight)return;let n=this._svgNode,i=200,r=132,o=e,s=t;e===0&&t===0?(o=i,s=r):e===0?(s=t,o=i*(t/r)):t===0&&(o=e,s=r*(e/i));let a=o/i,c=s/r;n.style.cssText=`width: ${o}px; height: ${s}px; position: absolute; bottom: 0; left: 0; overflow: hidden;`,n.setAttribute("width",o),n.setAttribute("height",s),n.setAttribute("viewBox",`0 0 ${o} ${s}`),this._topG.setAttribute("transform",`scale(${a},${c})`),this._centerX=Math.max(1,100*a),this._centerY=Math.max(1,100*c),this._lastHeight=e,this._lastWidth=t};OI.prototype.applyThemeChanges=function(){let e=this._container.ownerDocument;if(!e.body.contains(this._container)){if(l(this._observer))return;let f=this;f._observer=new MutationObserver(function(){e.body.contains(f._container)&&(f._observer.disconnect(),f._observer=void 0,f.applyThemeChanges())}),f._observer.observe(e,{childList:!0,subtree:!0});return}let t=ab(this._themeNormal),n=ab(this._themeHover),i=ab(this._themeSelect),r=ab(this._themeDisabled),o=ab(this._themeKnob),s=ab(this._themePointer),a=ab(this._themeSwoosh),c=ab(this._themeSwooshHover),u=Pm({tagName:"defs",children:[{id:"animation_buttonNormal",tagName:"linearGradient",x1:"50%",y1:"0%",x2:"50%",y2:"100%",children:[{tagName:"stop",offset:"0%","stop-color":Us(t,$M)},{tagName:"stop",offset:"12%","stop-color":Us(t,J7)},{tagName:"stop",offset:"46%","stop-color":Us(t,Sae)},{tagName:"stop",offset:"81%","stop-color":Us(t,Z7)}]},{id:"animation_buttonHovered",tagName:"linearGradient",x1:"50%",y1:"0%",x2:"50%",y2:"100%",children:[{tagName:"stop",offset:"0%","stop-color":Us(n,$M)},{tagName:"stop",offset:"12%","stop-color":Us(n,J7)},{tagName:"stop",offset:"46%","stop-color":Us(n,Sae)},{tagName:"stop",offset:"81%","stop-color":Us(n,Z7)}]},{id:"animation_buttonToggled",tagName:"linearGradient",x1:"50%",y1:"0%",x2:"50%",y2:"100%",children:[{tagName:"stop",offset:"0%","stop-color":Us(i,$M)},{tagName:"stop",offset:"12%","stop-color":Us(i,J7)},{tagName:"stop",offset:"46%","stop-color":Us(i,Sae)},{tagName:"stop",offset:"81%","stop-color":Us(i,Z7)}]},{id:"animation_buttonDisabled",tagName:"linearGradient",x1:"50%",y1:"0%",x2:"50%",y2:"100%",children:[{tagName:"stop",offset:"0%","stop-color":Us(r,X6t)},{tagName:"stop",offset:"75%","stop-color":Us(r,K6t)}]},{id:"animation_blurred",tagName:"filter",width:"200%",height:"200%",x:"-50%",y:"-50%",children:[{tagName:"feGaussianBlur",stdDeviation:4,in:"SourceGraphic"}]},{id:"animation_shuttleRingSwooshGradient",tagName:"linearGradient",x1:"50%",y1:"0%",x2:"50%",y2:"100%",children:[{tagName:"stop",offset:"0%","stop-opacity":.2,"stop-color":a.toCssColorString()},{tagName:"stop",offset:"85%","stop-opacity":.85,"stop-color":a.toCssColorString()},{tagName:"stop",offset:"95%","stop-opacity":.05,"stop-color":a.toCssColorString()}]},{id:"animation_shuttleRingSwooshHovered",tagName:"linearGradient",x1:"50%",y1:"0%",x2:"50%",y2:"100%",children:[{tagName:"stop",offset:"0%","stop-opacity":.2,"stop-color":c.toCssColorString()},{tagName:"stop",offset:"85%","stop-opacity":.85,"stop-color":c.toCssColorString()},{tagName:"stop",offset:"95%","stop-opacity":.05,"stop-color":c.toCssColorString()}]},{id:"animation_shuttleRingPointerGradient",tagName:"linearGradient",x1:"0%",y1:"50%",x2:"100%",y2:"50%",children:[{tagName:"stop",offset:"0%","stop-color":s.toCssColorString()},{tagName:"stop",offset:"40%","stop-color":s.toCssColorString()},{tagName:"stop",offset:"60%","stop-color":Us(s,q2e)},{tagName:"stop",offset:"100%","stop-color":Us(s,q2e)}]},{id:"animation_shuttleRingPointerPaused",tagName:"linearGradient",x1:"0%",y1:"50%",x2:"100%",y2:"50%",children:[{tagName:"stop",offset:"0%","stop-color":"#CCC"},{tagName:"stop",offset:"40%","stop-color":"#CCC"},{tagName:"stop",offset:"60%","stop-color":"#555"},{tagName:"stop",offset:"100%","stop-color":"#555"}]},{id:"animation_knobOuter",tagName:"linearGradient",x1:"20%",y1:"0%",x2:"90%",y2:"100%",children:[{tagName:"stop",offset:"5%","stop-color":Us(o,$M)},{tagName:"stop",offset:"60%","stop-color":Us(o,W2e)},{tagName:"stop",offset:"85%","stop-color":Us(o,J7)}]},{id:"animation_knobInner",tagName:"linearGradient",x1:"20%",y1:"0%",x2:"90%",y2:"100%",children:[{tagName:"stop",offset:"5%","stop-color":Us(o,W2e)},{tagName:"stop",offset:"60%","stop-color":Us(o,$M)},{tagName:"stop",offset:"85%","stop-color":Us(o,Z7)}]}]});l(this._defsElement)?this._svgNode.replaceChild(u,this._defsElement):this._svgNode.appendChild(u),this._defsElement=u};var eW=OI;var iHt=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],cb=15,MI=105,rHt=[31,28,31,30,31,30,31,31,30,31,30,31];function oHt(e,t){return t===2&&ou(e)?29:rHt[t-1]}function K2e(e,t,n){return K.fromGregorianDate(new Fm(t,n,Math.min(e.day,oHt(t,n)),e.hour,e.minute,e.second,e.millisecond,e.isLeapSecond))}function $2e(e,t){return e-t}function Pae(e,t){let n=Pr(t,e,$2e);return n<0?~n:n}function sHt(e,t){if(Math.abs(e)<=cb)return e/cb;let n=cb,i=MI,r,o=0,s;return e>0?(r=Math.log(t[t.length-1]),s=(r-o)/(i-n),Math.exp(o+s*(e-n))):(r=Math.log(-t[0]),s=(r-o)/(i-n),-Math.exp(o+s*(Math.abs(e)-n)))}function aHt(e,t,n){if(n.clockStep===jr.SYSTEM_CLOCK)return cb;if(Math.abs(e)<=1)return e*cb;let i=t[t.length-1];e>i?e=i:e<-i&&(e=-i);let r=cb,o=MI,s,a=0,c;return e>0?(s=Math.log(i),c=(s-a)/(o-r),(Math.log(e)-a)/c+r):(s=Math.log(-t[0]),c=(s-a)/(o-r),-((Math.log(Math.abs(e))-a)/c+r))}function Qu(e){let t=this;this._clockViewModel=e,this._allShuttleRingTicks=[],this._dateFormatter=Qu.defaultDateFormatter,this._timeFormatter=Qu.defaultTimeFormatter,this.shuttleRingDragging=!1,this.snapToTicks=!1,Se.track(this,["_allShuttleRingTicks","_dateFormatter","_timeFormatter","shuttleRingDragging","snapToTicks"]),this._sortedFilteredPositiveTicks=[],this.setShuttleRingTicks(Qu.defaultTicks),this.timeLabel=void 0,Se.defineProperty(this,"timeLabel",function(){return t._timeFormatter(t._clockViewModel.currentTime,t)}),this.dateLabel=void 0,Se.defineProperty(this,"dateLabel",function(){return t._dateFormatter(t._clockViewModel.currentTime,t)}),this.multiplierLabel=void 0,Se.defineProperty(this,"multiplierLabel",function(){let s=t._clockViewModel;if(s.clockStep===jr.SYSTEM_CLOCK)return"Today";let a=s.multiplier;return a%1===0?`${a.toFixed(0)}x`:`${a.toFixed(3).replace(/0{0,3}$/,"")}x`}),this.shuttleRingAngle=void 0,Se.defineProperty(this,"shuttleRingAngle",{get:function(){return aHt(e.multiplier,t._allShuttleRingTicks,e)},set:function(s){s=Math.max(Math.min(s,MI),-MI);let a=t._allShuttleRingTicks,c=t._clockViewModel;if(c.clockStep=jr.SYSTEM_CLOCK_MULTIPLIER,Math.abs(s)===MI){c.multiplier=s>0?a[a.length-1]:a[0];return}let u=sHt(s,a);if(t.snapToTicks)u=a[Pae(u,a)];else if(u!==0){let f=Math.abs(u);if(f>100){let d=f.toFixed(0).length-2,p=Math.pow(10,d);u=Math.round(u/p)*p|0}else f>cb?u=Math.round(u):f>1?u=+u.toFixed(1):f>0&&(u=+u.toFixed(2))}c.multiplier=u}}),this._canAnimate=void 0,Se.defineProperty(this,"_canAnimate",function(){let s=t._clockViewModel,a=s.clockRange;if(t.shuttleRingDragging||a===ws.UNBOUNDED)return!0;let c=s.multiplier,u=s.currentTime,f=s.startTime,d;if(a===ws.LOOP_STOP)d=K.greaterThan(u,f)||u.equals(f)&&c>0;else{let p=s.stopTime;d=K.greaterThan(u,f)&&K.lessThan(u,p)||u.equals(f)&&c>0||u.equals(p)&&c<0}return d||(s.shouldAnimate=!1),d}),this._isSystemTimeAvailable=void 0,Se.defineProperty(this,"_isSystemTimeAvailable",function(){let s=t._clockViewModel;if(s.clockRange===ws.UNBOUNDED)return!0;let c=s.systemTime;return K.greaterThanOrEquals(c,s.startTime)&&K.lessThanOrEquals(c,s.stopTime)}),this._isAnimating=void 0,Se.defineProperty(this,"_isAnimating",function(){return t._clockViewModel.shouldAnimate&&(t._canAnimate||t.shuttleRingDragging)});let n=On(function(){let s=t._clockViewModel;s.shouldAnimate?s.shouldAnimate=!1:t._canAnimate&&(s.shouldAnimate=!0)});this._pauseViewModel=new uE(n,{toggled:Se.computed(function(){return!t._isAnimating}),tooltip:"Pause"});let i=On(function(){let s=t._clockViewModel,a=s.multiplier;a>0&&(s.multiplier=-a),s.shouldAnimate=!0});this._playReverseViewModel=new uE(i,{toggled:Se.computed(function(){return t._isAnimating&&e.multiplier<0}),tooltip:"Play Reverse"});let r=On(function(){let s=t._clockViewModel,a=s.multiplier;a<0&&(s.multiplier=-a),s.shouldAnimate=!0});this._playForwardViewModel=new uE(r,{toggled:Se.computed(function(){return t._isAnimating&&e.multiplier>0&&e.clockStep!==jr.SYSTEM_CLOCK}),tooltip:"Play Forward"});let o=On(function(){t._clockViewModel.clockStep=jr.SYSTEM_CLOCK},Se.getObservable(this,"_isSystemTimeAvailable"));this._playRealtimeViewModel=new uE(o,{toggled:Se.computed(function(){return e.clockStep===jr.SYSTEM_CLOCK}),tooltip:Se.computed(function(){return t._isSystemTimeAvailable?"Today (real-time)":"Current time not in range"})}),this._slower=On(function(){let s=t._clockViewModel,a=t._allShuttleRingTicks,c=s.multiplier,u=Pae(c,a)-1;u>=0&&(s.multiplier=a[u])}),this._faster=On(function(){let s=t._clockViewModel,a=t._allShuttleRingTicks,c=s.multiplier,u=Pae(c,a)+1;u<a.length&&(s.multiplier=a[u])})}Qu.defaultDateFormatter=function(e,t){let n=K.toGregorianDate(e);return`${iHt[n.month-1]} ${n.day} ${n.year}`};Qu.defaultTicks=[.001,.002,.005,.01,.02,.05,.1,.25,.5,1,2,5,10,15,30,60,120,300,600,900,1800,3600,7200,14400,21600,43200,86400,172800,345600,604800];Qu.defaultTimeFormatter=function(e,t){let n=K.toGregorianDate(e),i=Math.round(n.millisecond);return Math.abs(t._clockViewModel.multiplier)<1?`${n.hour.toString().padStart(2,"0")}:${n.minute.toString().padStart(2,"0")}:${n.second.toString().padStart(2,"0")}.${i.toString().padStart(3,"0")}`:`${n.hour.toString().padStart(2,"0")}:${n.minute.toString().padStart(2,"0")}:${n.second.toString().padStart(2,"0")} UTC`};Qu.prototype.getShuttleRingTicks=function(){return this._sortedFilteredPositiveTicks.slice(0)};Qu.prototype.setShuttleRingTicks=function(e){let t,n,i,r={},o=this._sortedFilteredPositiveTicks;for(o.length=0,t=0,n=e.length;t<n;++t)i=e[t],r.hasOwnProperty(i)||(r[i]=!0,o.push(i));o.sort($2e);let s=[];for(n=o.length,t=n-1;t>=0;--t)i=o[t],i!==0&&s.push(-i);Zn(s,o),this._allShuttleRingTicks=s};Qu.prototype.adjustDate=function(e,t){if(t===0)return;let n=this._clockViewModel,i=n.currentTime,r=K.toGregorianDate(i),o;if(e==="day"){o=K.addDays(i,t,new K);let s=K.toGregorianDate(o);if(s.year<1||s.year>9999)return}else if(e==="month"){let a=Math.min(Math.max((r.year-1)*12+r.month-1+t,0),119987),c=Math.floor(a/12)+1,u=a%12+1;o=K2e(r,c,u)}else{let s=Math.min(Math.max(r.year+t,1),9999);o=K2e(r,s,r.month)}K.equals(i,o)||(n.shouldAnimate=!1,n.currentTime=o)};Qu.prototype.adjustTime=function(e,t){if(t===0)return;let n=this._clockViewModel,i=n.currentTime,r;if(e==="hour")r=K.addHours(i,t,new K);else if(e==="minute")r=K.addMinutes(i,t,new K);else{let s=e==="second"?t:t/1e3;r=K.addSeconds(i,s,new K)}let o=K.toGregorianDate(r);o.year<1||o.year>9999||(n.shouldAnimate=!1,n.currentTime=r)};Object.defineProperties(Qu.prototype,{slower:{get:function(){return this._slower}},faster:{get:function(){return this._faster}},clockViewModel:{get:function(){return this._clockViewModel}},pauseViewModel:{get:function(){return this._pauseViewModel}},playReverseViewModel:{get:function(){return this._playReverseViewModel}},playForwardViewModel:{get:function(){return this._playForwardViewModel}},playRealtimeViewModel:{get:function(){return this._playRealtimeViewModel}},dateFormatter:{get:function(){return this._dateFormatter},set:function(e){this._dateFormatter=e}},timeFormatter:{get:function(){return this._timeFormatter},set:function(e){this._timeFormatter=e}}});Qu._maxShuttleRingAngle=MI;Qu._realtimeShuttleRingAngle=cb;var tW=Qu;function cHt(e){return function(t){let n=e._scene.pick(t.position);l(n)&&n.primitive instanceof ts&&(e.tileset=n.primitive),e.pickActive=!1}}function Z2e(e,t){t?e._eventHandler.setInputAction(function(n){let i=e._scene.pick(n.endPosition);l(i)&&i.primitive instanceof ts&&(e.tileset=i.primitive)},fn.MOUSE_MOVE):(e._eventHandler.removeInputAction(fn.MOUSE_MOVE),e.picking=e.picking)}var lHt={maximumFractionDigits:3};function ZM(e){let t=e/1048576;return t<1?t.toLocaleString(void 0,lHt):Math.round(t).toLocaleString()}function QM(e,t){if(!l(e))return"";let n=t?e._statisticsPerPass[po.PICK]:e._statisticsPerPass[po.RENDER],i='<ul class="cesium-cesiumInspector-statistics">';return i+=`<li><strong>Visited: </strong>${n.visited.toLocaleString()}</li><li><strong>Selected: </strong>${n.selected.toLocaleString()}</li><li><strong>Commands: </strong>${n.numberOfCommands.toLocaleString()}</li>`,i+="</ul>",t||(i+='<ul class="cesium-cesiumInspector-statistics">',i+=`<li><strong>Requests: </strong>${n.numberOfPendingRequests.toLocaleString()}</li><li><strong>Attempted: </strong>${n.numberOfAttemptedRequests.toLocaleString()}</li><li><strong>Processing: </strong>${n.numberOfTilesProcessing.toLocaleString()}</li><li><strong>Content Ready: </strong>${n.numberOfTilesWithContentReady.toLocaleString()}</li><li><strong>Total: </strong>${n.numberOfTilesTotal.toLocaleString()}</li>`,i+="</ul>",i+='<ul class="cesium-cesiumInspector-statistics">',i+=`<li><strong>Features Selected: </strong>${n.numberOfFeaturesSelected.toLocaleString()}</li><li><strong>Features Loaded: </strong>${n.numberOfFeaturesLoaded.toLocaleString()}</li><li><strong>Points Selected: </strong>${n.numberOfPointsSelected.toLocaleString()}</li><li><strong>Points Loaded: </strong>${n.numberOfPointsLoaded.toLocaleString()}</li><li><strong>Triangles Selected: </strong>${n.numberOfTrianglesSelected.toLocaleString()}</li>`,i+="</ul>",i+='<ul class="cesium-cesiumInspector-statistics">',i+=`<li><strong>Tiles styled: </strong>${n.numberOfTilesStyled.toLocaleString()}</li><li><strong>Features styled: </strong>${n.numberOfFeaturesStyled.toLocaleString()}</li>`,i+="</ul>",i+='<ul class="cesium-cesiumInspector-statistics">',i+=`<li><strong>Children Union Culled: </strong>${n.numberOfTilesCulledWithChildrenUnion.toLocaleString()}</li>`,i+="</ul>",i+='<ul class="cesium-cesiumInspector-statistics">',i+=`<li><strong>Geometry Memory (MB): </strong>${ZM(n.geometryByteLength)}</li><li><strong>Texture Memory (MB): </strong>${ZM(n.texturesByteLength)}</li><li><strong>Batch Table Memory (MB): </strong>${ZM(n.batchTableByteLength)}</li>`,i+="</ul>"),i}function Q2e(){let e=ki.statistics;return` + <ul class="cesium-cesiumInspector-statistics"> + <li><strong>Geometry Memory (MB): </strong>${ZM(e.geometryByteLength)}</li> + <li><strong>Texture Memory (MB): </strong>${ZM(e.texturesByteLength)}</li> + </ul> + `}var uHt=[{text:"Highlight",value:yf.HIGHLIGHT},{text:"Replace",value:yf.REPLACE},{text:"Mix",value:yf.MIX}],J2e=new z(1,1,0,.4),fHt=new z,nW=new z;function mc(e,t){let n=this,i=e.canvas;this._eventHandler=new xa(i),this._scene=e,this._performanceContainer=t,this._canvas=i,this._performanceDisplay=new _A({container:t}),this._statisticsText="",this._pickStatisticsText="",this._resourceCacheStatisticsText="",this._editorError="",this.performance=!1,this.showStatistics=!0,this.showPickStatistics=!0,this.showResourceCacheStatistics=!1,this.inspectorVisible=!0,this.tilesetVisible=!1,this.displayVisible=!1,this.updateVisible=!1,this.loggingVisible=!1,this.styleVisible=!1,this.tileDebugLabelsVisible=!1,this.optimizationVisible=!1,this.styleString="{}",this.hasEnabledWireframe=!1,this._tileset=void 0,this._feature=void 0,this._tile=void 0,Se.track(this,["performance","inspectorVisible","_statisticsText","_pickStatisticsText","_resourceCacheStatisticsText","_editorError","showPickStatistics","showStatistics","showResourceCacheStatistics","tilesetVisible","displayVisible","updateVisible","loggingVisible","styleVisible","optimizationVisible","tileDebugLabelsVisible","styleString","_feature","_tile","_tileset","hasEnabledWireframe"]),this._properties=Se.observable({}),this.properties=[],Se.defineProperty(this,"properties",function(){let k=[],G=n._properties();for(let q in G)G.hasOwnProperty(q)&&k.push(q);return k});let r=Se.observable();Se.defineProperty(this,"dynamicScreenSpaceError",{get:function(){return r()},set:function(k){r(k),l(n._tileset)&&(n._tileset.dynamicScreenSpaceError=k)}}),this.dynamicScreenSpaceError=!1;let o=Se.observable();Se.defineProperty(this,"colorBlendMode",{get:function(){return o()},set:function(k){o(k),l(n._tileset)&&(n._tileset.colorBlendMode=k,n._scene.requestRender())}}),this.colorBlendMode=yf.HIGHLIGHT;let s=Se.observable(),a=Se.observable();Se.defineProperty(this,"picking",{get:function(){return a()},set:function(k){a(k),k?n._eventHandler.setInputAction(function(G){let q=e.pick(G.endPosition);if(q instanceof ma?(n.feature=q,n.tile=q.content.tile):l(q)&&l(q.content)?(n.feature=void 0,n.tile=q.content.tile):(n.feature=void 0,n.tile=void 0),!!l(n._tileset)){if(s&&l(q)&&l(q.content)){let Q;e.pickPositionSupported&&(Q=e.pickPosition(G.endPosition),l(Q)&&(n._tileset.debugPickPosition=Q)),n._tileset.debugPickedTile=q.content.tile}else n._tileset.debugPickedTile=void 0;n._scene.requestRender()}},fn.MOUSE_MOVE):(n.feature=void 0,n.tile=void 0,n._eventHandler.removeInputAction(fn.MOUSE_MOVE))}}),this.picking=!0;let c=Se.observable();Se.defineProperty(this,"colorize",{get:function(){return c()},set:function(k){c(k),l(n._tileset)&&(n._tileset.debugColorizeTiles=k,n._scene.requestRender())}}),this.colorize=!1;let u=Se.observable();Se.defineProperty(this,"wireframe",{get:function(){return u()},set:function(k){u(k),l(n._tileset)&&(n._tileset.debugWireframe=k,n._scene.requestRender())}}),this.wireframe=!1;let f=Se.observable();Se.defineProperty(this,"showBoundingVolumes",{get:function(){return f()},set:function(k){f(k),l(n._tileset)&&(n._tileset.debugShowBoundingVolume=k,n._scene.requestRender())}}),this.showBoundingVolumes=!1;let d=Se.observable();Se.defineProperty(this,"showContentBoundingVolumes",{get:function(){return d()},set:function(k){d(k),l(n._tileset)&&(n._tileset.debugShowContentBoundingVolume=k,n._scene.requestRender())}}),this.showContentBoundingVolumes=!1;let p=Se.observable();Se.defineProperty(this,"showRequestVolumes",{get:function(){return p()},set:function(k){p(k),l(n._tileset)&&(n._tileset.debugShowViewerRequestVolume=k,n._scene.requestRender())}}),this.showRequestVolumes=!1;let g=Se.observable();Se.defineProperty(this,"freezeFrame",{get:function(){return g()},set:function(k){g(k),l(n._tileset)&&(n._tileset.debugFreezeFrame=k,n._scene.debugShowFrustumPlanes=k,n._scene.requestRender())}}),this.freezeFrame=!1,Se.defineProperty(this,"showOnlyPickedTileDebugLabel",{get:function(){return s()},set:function(k){s(k),l(n._tileset)&&(n._tileset.debugPickedTileLabelOnly=k,n._scene.requestRender())}}),this.showOnlyPickedTileDebugLabel=!1;let m=Se.observable();Se.defineProperty(this,"showGeometricError",{get:function(){return m()},set:function(k){m(k),l(n._tileset)&&(n._tileset.debugShowGeometricError=k,n._scene.requestRender())}}),this.showGeometricError=!1;let y=Se.observable();Se.defineProperty(this,"showRenderingStatistics",{get:function(){return y()},set:function(k){y(k),l(n._tileset)&&(n._tileset.debugShowRenderingStatistics=k,n._scene.requestRender())}}),this.showRenderingStatistics=!1;let A=Se.observable();Se.defineProperty(this,"showMemoryUsage",{get:function(){return A()},set:function(k){A(k),l(n._tileset)&&(n._tileset.debugShowMemoryUsage=k,n._scene.requestRender())}}),this.showMemoryUsage=!1;let b=Se.observable();Se.defineProperty(this,"showUrl",{get:function(){return b()},set:function(k){b(k),l(n._tileset)&&(n._tileset.debugShowUrl=k,n._scene.requestRender())}}),this.showUrl=!1;let x=Se.observable();Se.defineProperty(this,"maximumScreenSpaceError",{get:function(){return x()},set:function(k){k=Number(k),isNaN(k)||(x(k),l(n._tileset)&&(n._tileset.maximumScreenSpaceError=k))}}),this.maximumScreenSpaceError=16;let T=Se.observable();Se.defineProperty(this,"dynamicScreenSpaceErrorDensity",{get:function(){return T()},set:function(k){k=Number(k),isNaN(k)||(T(k),l(n._tileset)&&(n._tileset.dynamicScreenSpaceErrorDensity=k))}}),this.dynamicScreenSpaceErrorDensity=2e-4,this.dynamicScreenSpaceErrorDensitySliderValue=void 0,Se.defineProperty(this,"dynamicScreenSpaceErrorDensitySliderValue",{get:function(){return Math.pow(T(),1/6)},set:function(k){let G=Math.pow(k,6);T(G),l(n._tileset)&&(n._tileset.dynamicScreenSpaceErrorDensity=G)}});let E=Se.observable();Se.defineProperty(this,"dynamicScreenSpaceErrorFactor",{get:function(){return E()},set:function(k){k=Number(k),isNaN(k)||(E(k),l(n._tileset)&&(n._tileset.dynamicScreenSpaceErrorFactor=k))}}),this.dynamicScreenSpaceErrorFactor=24;let v=cHt(this),S=Se.observable();Se.defineProperty(this,"pickActive",{get:function(){return S()},set:function(k){S(k),k?n._eventHandler.setInputAction(v,fn.LEFT_CLICK):n._eventHandler.removeInputAction(fn.LEFT_CLICK)}});let I=Se.observable();Se.defineProperty(this,"pointCloudShading",{get:function(){return I()},set:function(k){I(k),l(n._tileset)&&(n._tileset.pointCloudShading.attenuation=k)}}),this.pointCloudShading=!1;let R=Se.observable();Se.defineProperty(this,"geometricErrorScale",{get:function(){return R()},set:function(k){k=Number(k),isNaN(k)||(R(k),l(n._tileset)&&(n._tileset.pointCloudShading.geometricErrorScale=k))}}),this.geometricErrorScale=1;let O=Se.observable();Se.defineProperty(this,"maximumAttenuation",{get:function(){return O()},set:function(k){k=Number(k),isNaN(k)||(O(k),l(n._tileset)&&(n._tileset.pointCloudShading.maximumAttenuation=k===0?void 0:k))}}),this.maximumAttenuation=0;let L=Se.observable();Se.defineProperty(this,"baseResolution",{get:function(){return L()},set:function(k){k=Number(k),isNaN(k)||(L(k),l(n._tileset)&&(n._tileset.pointCloudShading.baseResolution=k===0?void 0:k))}}),this.baseResolution=0;let _=Se.observable();Se.defineProperty(this,"eyeDomeLighting",{get:function(){return _()},set:function(k){_(k),l(n._tileset)&&(n._tileset.pointCloudShading.eyeDomeLighting=k)}}),this.eyeDomeLighting=!1;let C=Se.observable();Se.defineProperty(this,"eyeDomeLightingStrength",{get:function(){return C()},set:function(k){k=Number(k),isNaN(k)||(C(k),l(n._tileset)&&(n._tileset.pointCloudShading.eyeDomeLightingStrength=k))}}),this.eyeDomeLightingStrength=1;let w=Se.observable();Se.defineProperty(this,"eyeDomeLightingRadius",{get:function(){return w()},set:function(k){k=Number(k),isNaN(k)||(w(k),l(n._tileset)&&(n._tileset.pointCloudShading.eyeDomeLightingRadius=k))}}),this.eyeDomeLightingRadius=1,this.pickActive=!1;let D=Se.observable();Se.defineProperty(this,"skipLevelOfDetail",{get:function(){return D()},set:function(k){D(k),l(n._tileset)&&(n._tileset.skipLevelOfDetail=k)}}),this.skipLevelOfDetail=!0;let N=Se.observable();Se.defineProperty(this,"skipScreenSpaceErrorFactor",{get:function(){return N()},set:function(k){k=Number(k),isNaN(k)||(N(k),l(n._tileset)&&(n._tileset.skipScreenSpaceErrorFactor=k))}}),this.skipScreenSpaceErrorFactor=16;let F=Se.observable();Se.defineProperty(this,"baseScreenSpaceError",{get:function(){return F()},set:function(k){k=Number(k),isNaN(k)||(F(k),l(n._tileset)&&(n._tileset.baseScreenSpaceError=k))}}),this.baseScreenSpaceError=1024;let V=Se.observable();Se.defineProperty(this,"skipLevels",{get:function(){return V()},set:function(k){k=Number(k),isNaN(k)||(V(k),l(n._tileset)&&(n._tileset.skipLevels=k))}}),this.skipLevels=1;let B=Se.observable();Se.defineProperty(this,"immediatelyLoadDesiredLevelOfDetail",{get:function(){return B()},set:function(k){B(k),l(n._tileset)&&(n._tileset.immediatelyLoadDesiredLevelOfDetail=k)}}),this.immediatelyLoadDesiredLevelOfDetail=!1;let j=Se.observable();Se.defineProperty(this,"loadSiblings",{get:function(){return j()},set:function(k){j(k),l(n._tileset)&&(n._tileset.loadSiblings=k)}}),this.loadSiblings=!1,this._style=void 0,this._shouldStyle=!1,this._definedProperties=["properties","dynamicScreenSpaceError","colorBlendMode","picking","colorize","wireframe","showBoundingVolumes","showContentBoundingVolumes","showRequestVolumes","freezeFrame","maximumScreenSpaceError","dynamicScreenSpaceErrorDensity","baseScreenSpaceError","skipScreenSpaceErrorFactor","skipLevelOfDetail","skipLevels","immediatelyLoadDesiredLevelOfDetail","loadSiblings","dynamicScreenSpaceErrorDensitySliderValue","dynamicScreenSpaceErrorFactor","pickActive","showOnlyPickedTileDebugLabel","showGeometricError","showRenderingStatistics","showMemoryUsage","showUrl","pointCloudShading","geometricErrorScale","maximumAttenuation","baseResolution","eyeDomeLighting","eyeDomeLightingStrength","eyeDomeLightingRadius"],this._removePostRenderEvent=e.postRender.addEventListener(function(){n._update()}),l(this._tileset)||Z2e(this,!0)}Object.defineProperties(mc.prototype,{scene:{get:function(){return this._scene}},performanceContainer:{get:function(){return this._performanceContainer}},statisticsText:{get:function(){return this._statisticsText}},pickStatisticsText:{get:function(){return this._pickStatisticsText}},resourceCacheStatisticsText:{get:function(){return this._resourceCacheStatisticsText}},colorBlendModes:{get:function(){return uHt}},editorError:{get:function(){return this._editorError}},tileset:{get:function(){return this._tileset},set:function(e){if(this._tileset=e,this._style=void 0,this.styleString="{}",this.feature=void 0,this.tile=void 0,l(e)){this._properties(e.properties);let t=["colorize","wireframe","showBoundingVolumes","showContentBoundingVolumes","showRequestVolumes","freezeFrame","showOnlyPickedTileDebugLabel","showGeometricError","showRenderingStatistics","showMemoryUsage","showUrl"],n=t.length;for(let r=0;r<n;++r){let o=t[r];this[o]=this[o]}this.maximumScreenSpaceError=e.maximumScreenSpaceError,this.dynamicScreenSpaceError=e.dynamicScreenSpaceError,this.dynamicScreenSpaceErrorDensity=e.dynamicScreenSpaceErrorDensity,this.dynamicScreenSpaceErrorFactor=e.dynamicScreenSpaceErrorFactor,this.colorBlendMode=e.colorBlendMode,this.skipLevelOfDetail=e.skipLevelOfDetail,this.skipScreenSpaceErrorFactor=e.skipScreenSpaceErrorFactor,this.baseScreenSpaceError=e.baseScreenSpaceError,this.skipLevels=e.skipLevels,this.immediatelyLoadDesiredLevelOfDetail=e.immediatelyLoadDesiredLevelOfDetail,this.loadSiblings=e.loadSiblings,this.hasEnabledWireframe=e._enableDebugWireframe;let i=e.pointCloudShading;this.pointCloudShading=i.attenuation,this.geometricErrorScale=i.geometricErrorScale,this.maximumAttenuation=i.maximumAttenuation?i.maximumAttenuation:0,this.baseResolution=i.baseResolution?i.baseResolution:0,this.eyeDomeLighting=i.eyeDomeLighting,this.eyeDomeLightingStrength=i.eyeDomeLightingStrength,this.eyeDomeLightingRadius=i.eyeDomeLightingRadius,this._scene.requestRender()}else this._properties({});this._statisticsText=QM(e,!1),this._pickStatisticsText=QM(e,!0),this._resourceCacheStatisticsText=Q2e(),Z2e(this,!1)}},feature:{get:function(){return this._feature},set:function(e){if(this._feature===e)return;let t=this._feature;l(t)&&!t.content.isDestroyed()&&(!this.colorize&&l(this._style)?t.color=l(this._style.color)?this._style.color.evaluateColor(t,fHt):z.WHITE:t.color=nW,this._scene.requestRender()),l(e)&&(z.clone(e.color,nW),e.color=J2e,this._scene.requestRender()),this._feature=e}},tile:{get:function(){return this._tile},set:function(e){if(this._tile===e)return;let t=this._tile;l(t)&&!t.isDestroyed()&&!Dae(t.content)&&(t.color=nW,this._scene.requestRender()),l(e)&&!Dae(e.content)&&(z.clone(e.color,nW),e.color=J2e,this._scene.requestRender()),this._tile=e}}});function Dae(e){if(!l(e))return!1;if(e.featuresLength>0)return!0;let t=e.innerContents;if(l(t)){let n=t.length;for(let i=0;i<n;++i)if(!Dae(t[i]))return!1;return!0}return!1}mc.prototype.togglePickTileset=function(){this.pickActive=!this.pickActive};mc.prototype.toggleInspector=function(){this.inspectorVisible=!this.inspectorVisible};mc.prototype.toggleTileset=function(){this.tilesetVisible=!this.tilesetVisible};mc.prototype.toggleDisplay=function(){this.displayVisible=!this.displayVisible};mc.prototype.toggleUpdate=function(){this.updateVisible=!this.updateVisible};mc.prototype.toggleLogging=function(){this.loggingVisible=!this.loggingVisible};mc.prototype.toggleStyle=function(){this.styleVisible=!this.styleVisible};mc.prototype.toggleTileDebugLabels=function(){this.tileDebugLabelsVisible=!this.tileDebugLabelsVisible};mc.prototype.toggleOptimization=function(){this.optimizationVisible=!this.optimizationVisible};mc.prototype.trimTilesCache=function(){l(this._tileset)&&this._tileset.trimLoadedTiles()};mc.prototype.compileStyle=function(){let e=this._tileset;if(!(!l(e)||this.styleString===JSON.stringify(e.style))){this._editorError="";try{this.styleString.length===0&&(this.styleString="{}"),this._style=new Ky(JSON.parse(this.styleString)),this._shouldStyle=!0,this._scene.requestRender()}catch(t){this._editorError=t.toString()}this.feature=this._feature,this.tile=this._tile}};mc.prototype.styleEditorKeyPress=function(e,t){if(t.keyCode===9){t.preventDefault();let n=t.target,i=n.selectionStart,r=n.selectionEnd,o=r,a=n.value.slice(i,r).split(` +`),c=a.length,u;if(t.shiftKey)for(u=0;u<c;++u)a[u][0]===" "&&(a[u][1]===" "?(a[u]=a[u].substr(2),o-=2):(a[u]=a[u].substr(1),o-=1));else for(u=0;u<c;++u)a[u]=` ${a[u]}`,o+=2;let f=a.join(` +`);n.value=n.value.slice(0,i)+f+n.value.slice(r),n.selectionStart=i!==r?i:o,n.selectionEnd=o}else t.ctrlKey&&(t.keyCode===10||t.keyCode===13)&&this.compileStyle();return!0};mc.prototype._update=function(){let e=this._tileset;if(this.performance&&this._performanceDisplay.update(),l(e)){if(e.isDestroyed()){this.tile=void 0,this.feature=void 0,this.tileset=void 0;return}let t=e.style;this._style!==e.style&&(this._shouldStyle?(e.style=this._style,this._shouldStyle=!1):(this._style=t,this.styleString=JSON.stringify(t.style,null," ")))}this.showStatistics&&(this._statisticsText=QM(e,!1),this._pickStatisticsText=QM(e,!0),this._resourceCacheStatisticsText=Q2e())};mc.prototype.isDestroyed=function(){return!1};mc.prototype.destroy=function(){this._eventHandler.destroy(),this._removePostRenderEvent();let e=this;return this._definedProperties.forEach(function(t){Se.getObservable(e,t).dispose()}),le(this)};mc.getStatistics=QM;var iW=mc;function rW(e,t){e=kn(e);let n=document.createElement("div"),i=document.createElement("div");i.setAttribute("data-bind","visible: performance");let r=new iW(t,i);this._viewModel=r,this._container=e,this._element=n;let o=document.createElement("div");o.textContent="3D Tiles Inspector",o.className="cesium-cesiumInspector-button",o.setAttribute("data-bind","click: toggleInspector"),n.appendChild(o),n.className="cesium-cesiumInspector cesium-3DTilesInspector",n.setAttribute("data-bind",'css: { "cesium-cesiumInspector-visible" : inspectorVisible, "cesium-cesiumInspector-hidden" : !inspectorVisible}'),e.appendChild(n);let s=document.createElement("div");s.className="cesium-cesiumInspector-dropDown",n.appendChild(s);let a=Wf.createSection,c=Wf.createCheckbox,u=Wf.createRangeInput,f=Wf.createButton,d=a(s,"Tileset","tilesetVisible","toggleTileset"),p=a(s,"Display","displayVisible","toggleDisplay"),g=a(s,"Update","updateVisible","toggleUpdate"),m=a(s,"Logging","loggingVisible","toggleLogging"),y=a(s,"Tile Debug Labels","tileDebugLabelsVisible","toggleTileDebugLabels"),A=a(s,"Style","styleVisible","toggleStyle"),b=a(s,"Optimization","optimizationVisible","toggleOptimization"),x=document.createElement("div");x.className="field-group";let T=document.createElement("label");T.className="field-label",T.appendChild(document.createTextNode("Properties: "));let E=document.createElement("div");E.setAttribute("data-bind","text: properties"),x.appendChild(T),x.appendChild(E),d.appendChild(x),d.appendChild(f("Pick Tileset","togglePickTileset","pickActive")),d.appendChild(f("Trim Tiles Cache","trimTilesCache")),d.appendChild(c("Enable Picking","picking")),p.appendChild(c("Colorize","colorize"));let v=p.appendChild(c("Wireframe","wireframe","_tileset === undefined || hasEnabledWireframe")),S=document.createElement("p");S.setAttribute("data-bind","visible: _tileset !== undefined && !hasEnabledWireframe"),S.setAttribute("class","cesium-3DTilesInspector-disabledElementsInfo"),S.innerText="Set enableDebugWireframe to true in the tileset constructor to enable this option.",v.appendChild(S),p.appendChild(c("Bounding Volumes","showBoundingVolumes")),p.appendChild(c("Content Volumes","showContentBoundingVolumes")),p.appendChild(c("Request Volumes","showRequestVolumes")),p.appendChild(c("Point Cloud Shading","pointCloudShading"));let I=document.createElement("div");I.setAttribute("data-bind","visible: pointCloudShading"),I.appendChild(u("Geometric Error Scale","geometricErrorScale",0,2,.01)),I.appendChild(u("Maximum Attenuation","maximumAttenuation",0,32,1)),I.appendChild(u("Base Resolution","baseResolution",0,1,.01)),I.appendChild(c("Eye Dome Lighting (EDL)","eyeDomeLighting")),p.appendChild(I);let R=document.createElement("div");R.setAttribute("data-bind","visible: eyeDomeLighting"),R.appendChild(u("EDL Strength","eyeDomeLightingStrength",0,2,.1)),R.appendChild(u("EDL Radius","eyeDomeLightingRadius",0,4,.1)),I.appendChild(R),g.appendChild(c("Freeze Frame","freezeFrame")),g.appendChild(c("Dynamic Screen Space Error","dynamicScreenSpaceError"));let O=document.createElement("div");O.appendChild(u("Maximum Screen Space Error","maximumScreenSpaceError",0,128,1)),g.appendChild(O);let L=document.createElement("div");L.setAttribute("data-bind","visible: dynamicScreenSpaceError"),L.appendChild(u("Screen Space Error Density","dynamicScreenSpaceErrorDensitySliderValue",0,1,.005,"dynamicScreenSpaceErrorDensity")),L.appendChild(u("Screen Space Error Factor","dynamicScreenSpaceErrorFactor",1,32,.1)),g.appendChild(L),m.appendChild(c("Performance","performance")),m.appendChild(i),m.appendChild(c("Statistics","showStatistics"));let _=document.createElement("div");_.className="cesium-3dTilesInspector-statistics",_.setAttribute("data-bind","html: statisticsText, visible: showStatistics"),m.appendChild(_),m.appendChild(c("Pick Statistics","showPickStatistics"));let C=document.createElement("div");C.className="cesium-3dTilesInspector-statistics",C.setAttribute("data-bind","html: pickStatisticsText, visible: showPickStatistics"),m.appendChild(C),m.appendChild(c("Resource Cache Statistics","showResourceCacheStatistics"));let w=document.createElement("div");w.className="cesium-3dTilesInspector-statistics",w.setAttribute("data-bind","html: resourceCacheStatisticsText, visible: showResourceCacheStatistics"),m.appendChild(w);let D=document.createElement("div");A.appendChild(D),D.appendChild(document.createTextNode("Color Blend Mode: "));let N=document.createElement("select");N.setAttribute("data-bind",'options: colorBlendModes, optionsText: "text", optionsValue: "value", value: colorBlendMode'),D.appendChild(N);let F=document.createElement("textarea");F.setAttribute("data-bind","textInput: styleString, event: { keydown: styleEditorKeyPress }"),D.className="cesium-cesiumInspector-styleEditor",D.appendChild(F);let V=f("Compile (Ctrl+Enter)","compileStyle");D.appendChild(V);let B=document.createElement("div");B.className="cesium-cesiumInspector-error",B.setAttribute("data-bind","text: editorError"),D.appendChild(B),y.appendChild(c("Show Picked Only","showOnlyPickedTileDebugLabel")),y.appendChild(c("Geometric Error","showGeometricError")),y.appendChild(c("Rendering Statistics","showRenderingStatistics")),y.appendChild(c("Memory Usage (MB)","showMemoryUsage")),y.appendChild(c("Url","showUrl")),b.appendChild(c("Skip Tile LODs","skipLevelOfDetail"));let j=document.createElement("div");j.appendChild(u("Skip SSE Factor","skipScreenSpaceErrorFactor",1,50,1)),b.appendChild(j);let k=document.createElement("div");k.appendChild(u("SSE before skipping LOD","baseScreenSpaceError",0,4096,1)),b.appendChild(k);let G=document.createElement("div");G.appendChild(u("Min. levels to skip","skipLevels",0,10,1)),b.appendChild(G),b.appendChild(c("Load only tiles that meet the max SSE.","immediatelyLoadDesiredLevelOfDetail")),b.appendChild(c("Load siblings of visible tiles","loadSiblings")),Se.applyBindings(r,n)}Object.defineProperties(rW.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}}});rW.prototype.isDestroyed=function(){return!1};rW.prototype.destroy=function(){return Se.cleanNode(this._element),this._container.removeChild(this._element),this.viewModel.destroy(),le(this)};var oW=rW;function dHt(e){let t;if(l(e)){t="Command Statistics";let n=e.commandsInFrustums;for(let i in n)if(n.hasOwnProperty(i)){let r=parseInt(i,10),o;if(r===7)o="1, 2 and 3";else{let s=[];for(let a=2;a>=0;a--){let c=Math.pow(2,a);r>=c&&(s.push(a+1),r-=c)}o=s.reverse().join(" and ")}t+=`<br>    ${n[i]} in frustum ${o}`}t+=`<br>Total: ${e.totalCommands}`}return t}function Rae(e,t,n){let i=Math.min(n,t);return i=Math.max(i,e),i}var hHt=new gn,mHt=new h;function eN(e,t){let n=this,i=e.canvas,r=new xa(i);this._eventHandler=r,this._scene=e,this._canvas=i,this._primitive=void 0,this._tile=void 0,this._modelMatrixPrimitive=void 0,this._performanceDisplay=void 0,this._performanceContainer=t;let o=this._scene.globe;o.depthTestAgainstTerrain=!0,this.frustums=!1,this.frustumPlanes=!1,this.performance=!1,this.shaderCacheText="",this.primitiveBoundingSphere=!1,this.primitiveReferenceFrame=!1,this.filterPrimitive=!1,this.tileBoundingSphere=!1,this.filterTile=!1,this.wireframe=!1,this.depthFrustum=1,this._numberOfFrustums=1,this.suspendUpdates=!1,this.tileCoordinates=!1,this.frustumStatisticText=!1,this.tileText="",this.hasPickedPrimitive=!1,this.hasPickedTile=!1,this.pickPrimitiveActive=!1,this.pickTileActive=!1,this.dropDownVisible=!0,this.generalVisible=!0,this.primitivesVisible=!1,this.terrainVisible=!1,this.depthFrustumText="",Se.track(this,["frustums","frustumPlanes","performance","shaderCacheText","primitiveBoundingSphere","primitiveReferenceFrame","filterPrimitive","tileBoundingSphere","filterTile","wireframe","depthFrustum","suspendUpdates","tileCoordinates","frustumStatisticText","tileText","hasPickedPrimitive","hasPickedTile","pickPrimitiveActive","pickTileActive","dropDownVisible","generalVisible","primitivesVisible","terrainVisible","depthFrustumText"]),this._toggleDropDown=On(function(){n.dropDownVisible=!n.dropDownVisible}),this._toggleGeneral=On(function(){n.generalVisible=!n.generalVisible}),this._togglePrimitives=On(function(){n.primitivesVisible=!n.primitivesVisible}),this._toggleTerrain=On(function(){n.terrainVisible=!n.terrainVisible}),this._frustumsSubscription=Se.getObservable(this,"frustums").subscribe(function(u){n._scene.debugShowFrustums=u,n._scene.requestRender()}),this._frustumPlanesSubscription=Se.getObservable(this,"frustumPlanes").subscribe(function(u){n._scene.debugShowFrustumPlanes=u,n._scene.requestRender()}),this._performanceSubscription=Se.getObservable(this,"performance").subscribe(function(u){u?n._performanceDisplay=new _A({container:n._performanceContainer}):n._performanceContainer.innerHTML=""}),this._showPrimitiveBoundingSphere=On(function(){return n._primitive.debugShowBoundingVolume=n.primitiveBoundingSphere,n._scene.requestRender(),!0}),this._primitiveBoundingSphereSubscription=Se.getObservable(this,"primitiveBoundingSphere").subscribe(function(){n._showPrimitiveBoundingSphere()}),this._showPrimitiveReferenceFrame=On(function(){if(n.primitiveReferenceFrame){let u=n._primitive.modelMatrix;n._modelMatrixPrimitive=new b7({modelMatrix:u}),n._scene.primitives.add(n._modelMatrixPrimitive)}else l(n._modelMatrixPrimitive)&&(n._scene.primitives.remove(n._modelMatrixPrimitive),n._modelMatrixPrimitive=void 0);return n._scene.requestRender(),!0}),this._primitiveReferenceFrameSubscription=Se.getObservable(this,"primitiveReferenceFrame").subscribe(function(){n._showPrimitiveReferenceFrame()}),this._doFilterPrimitive=On(function(){return n.filterPrimitive?n._scene.debugCommandFilter=function(u){return l(n._modelMatrixPrimitive)&&u.owner===n._modelMatrixPrimitive._primitive?!0:l(n._primitive)?u.owner===n._primitive||u.owner===n._primitive._billboardCollection||u.owner.primitive===n._primitive:!1}:n._scene.debugCommandFilter=void 0,!0}),this._filterPrimitiveSubscription=Se.getObservable(this,"filterPrimitive").subscribe(function(){n._doFilterPrimitive(),n._scene.requestRender()}),this._wireframeSubscription=Se.getObservable(this,"wireframe").subscribe(function(u){o._surface.tileProvider._debug.wireframe=u,n._scene.requestRender()}),this._depthFrustumSubscription=Se.getObservable(this,"depthFrustum").subscribe(function(u){n._scene.debugShowDepthFrustum=u,n._scene.requestRender()}),this._incrementDepthFrustum=On(function(){let u=n.depthFrustum+1;return n.depthFrustum=Rae(1,n._numberOfFrustums,u),n._scene.requestRender(),!0}),this._decrementDepthFrustum=On(function(){let u=n.depthFrustum-1;return n.depthFrustum=Rae(1,n._numberOfFrustums,u),n._scene.requestRender(),!0}),this._suspendUpdatesSubscription=Se.getObservable(this,"suspendUpdates").subscribe(function(u){o._surface._debug.suspendLodUpdate=u,u||(n.filterTile=!1)});let s;this._showTileCoordinates=On(function(){return n.tileCoordinates&&!l(s)?s=e.imageryLayers.addImageryProvider(new H7({tilingScheme:e.terrainProvider.tilingScheme})):!n.tileCoordinates&&l(s)&&(e.imageryLayers.remove(s),s=void 0),!0}),this._tileCoordinatesSubscription=Se.getObservable(this,"tileCoordinates").subscribe(function(){n._showTileCoordinates(),n._scene.requestRender()}),this._tileBoundingSphereSubscription=Se.getObservable(this,"tileBoundingSphere").subscribe(function(){n._showTileBoundingSphere(),n._scene.requestRender()}),this._showTileBoundingSphere=On(function(){return n.tileBoundingSphere?o._surface.tileProvider._debug.boundingSphereTile=n._tile:o._surface.tileProvider._debug.boundingSphereTile=void 0,n._scene.requestRender(),!0}),this._doFilterTile=On(function(){return n.filterTile?(n.suspendUpdates=!0,o._surface._tilesToRender=[],l(n._tile)&&n._tile.renderable&&o._surface._tilesToRender.push(n._tile)):n.suspendUpdates=!1,!0}),this._filterTileSubscription=Se.getObservable(this,"filterTile").subscribe(function(){n.doFilterTile(),n._scene.requestRender()});function a(u){let f=n._scene.pick({x:u.position.x,y:u.position.y});l(f)&&(n.primitive=l(f.collection)?f.collection:f.primitive),n._scene.requestRender(),n.pickPrimitiveActive=!1}this._pickPrimitive=On(function(){n.pickPrimitiveActive=!n.pickPrimitiveActive}),this._pickPrimitiveActiveSubscription=Se.getObservable(this,"pickPrimitiveActive").subscribe(function(u){u?r.setInputAction(a,fn.LEFT_CLICK):r.removeInputAction(fn.LEFT_CLICK)});function c(u){let f,d=o.ellipsoid,p=n._scene.camera.getPickRay(u.position,hHt),g=o.pick(p,n._scene,mHt);if(l(g)){let m=d.cartesianToCartographic(g),y=o._surface.tileProvider._tilesToRenderByTextureCount;for(let A=0;!f&&A<y.length;++A){let b=y[A];if(l(b))for(let x=0;!f&&x<b.length;++x){let T=b[x];ie.contains(T.rectangle,m)&&(f=T)}}}n.tile=f,n.pickTileActive=!1}this._pickTile=On(function(){n.pickTileActive=!n.pickTileActive}),this._pickTileActiveSubscription=Se.getObservable(this,"pickTileActive").subscribe(function(u){u?r.setInputAction(c,fn.LEFT_CLICK):r.removeInputAction(fn.LEFT_CLICK)}),this._removePostRenderEvent=e.postRender.addEventListener(function(){n._update()})}Object.defineProperties(eN.prototype,{scene:{get:function(){return this._scene}},performanceContainer:{get:function(){return this._performanceContainer}},toggleDropDown:{get:function(){return this._toggleDropDown}},showPrimitiveBoundingSphere:{get:function(){return this._showPrimitiveBoundingSphere}},showPrimitiveReferenceFrame:{get:function(){return this._showPrimitiveReferenceFrame}},doFilterPrimitive:{get:function(){return this._doFilterPrimitive}},incrementDepthFrustum:{get:function(){return this._incrementDepthFrustum}},decrementDepthFrustum:{get:function(){return this._decrementDepthFrustum}},showTileCoordinates:{get:function(){return this._showTileCoordinates}},showTileBoundingSphere:{get:function(){return this._showTileBoundingSphere}},doFilterTile:{get:function(){return this._doFilterTile}},toggleGeneral:{get:function(){return this._toggleGeneral}},togglePrimitives:{get:function(){return this._togglePrimitives}},toggleTerrain:{get:function(){return this._toggleTerrain}},pickPrimitive:{get:function(){return this._pickPrimitive}},pickTile:{get:function(){return this._pickTile}},selectParent:{get:function(){let e=this;return On(function(){e.tile=e.tile.parent})}},selectNW:{get:function(){let e=this;return On(function(){e.tile=e.tile.northwestChild})}},selectNE:{get:function(){let e=this;return On(function(){e.tile=e.tile.northeastChild})}},selectSW:{get:function(){let e=this;return On(function(){e.tile=e.tile.southwestChild})}},selectSE:{get:function(){let e=this;return On(function(){e.tile=e.tile.southeastChild})}},primitive:{get:function(){return this._primitive},set:function(e){let t=this._primitive;e!==t&&(this.hasPickedPrimitive=!0,l(t)&&(t.debugShowBoundingVolume=!1),this._scene.debugCommandFilter=void 0,l(this._modelMatrixPrimitive)&&(this._scene.primitives.remove(this._modelMatrixPrimitive),this._modelMatrixPrimitive=void 0),this._primitive=e,e.show=!1,setTimeout(function(){e.show=!0},50),this.showPrimitiveBoundingSphere(),this.showPrimitiveReferenceFrame(),this.doFilterPrimitive())}},tile:{get:function(){return this._tile},set:function(e){if(l(e)){this.hasPickedTile=!0;let t=this._tile;if(e!==t){this.tileText=`L: ${e.level} X: ${e.x} Y: ${e.y}`,this.tileText+=`<br>SW corner: ${e.rectangle.west}, ${e.rectangle.south}`,this.tileText+=`<br>NE corner: ${e.rectangle.east}, ${e.rectangle.north}`;let n=e.data;l(n)&&l(n.tileBoundingRegion)?this.tileText+=`<br>Min: ${n.tileBoundingRegion.minimumHeight} Max: ${n.tileBoundingRegion.maximumHeight}`:this.tileText+="<br>(Tile is not loaded)"}this._tile=e,this.showTileBoundingSphere(),this.doFilterTile()}else this.hasPickedTile=!1,this._tile=void 0}}});eN.prototype._update=function(){this.frustums&&(this.frustumStatisticText=dHt(this._scene.debugFrustumStatistics));let e=this._scene.numberOfFrustums;this._numberOfFrustums=e,this.depthFrustum=Rae(1,e,this.depthFrustum),this.depthFrustumText=`${this.depthFrustum} of ${e}`,this.performance&&this._performanceDisplay.update(),this.primitiveReferenceFrame&&(this._modelMatrixPrimitive.modelMatrix=this._primitive.modelMatrix),this.shaderCacheText=`Cached shaders: ${this._scene.context.shaderCache.numberOfShaders}`};eN.prototype.isDestroyed=function(){return!1};eN.prototype.destroy=function(){return this._eventHandler.destroy(),this._removePostRenderEvent(),this._frustumsSubscription.dispose(),this._frustumPlanesSubscription.dispose(),this._performanceSubscription.dispose(),this._primitiveBoundingSphereSubscription.dispose(),this._primitiveReferenceFrameSubscription.dispose(),this._filterPrimitiveSubscription.dispose(),this._wireframeSubscription.dispose(),this._depthFrustumSubscription.dispose(),this._suspendUpdatesSubscription.dispose(),this._tileCoordinatesSubscription.dispose(),this._tileBoundingSphereSubscription.dispose(),this._filterTileSubscription.dispose(),this._pickPrimitiveActiveSubscription.dispose(),this._pickTileActiveSubscription.dispose(),le(this)};var sW=eN;function aW(e,t){e=kn(e);let n=document.createElement("div"),i=new sW(t,n);this._viewModel=i,this._container=e;let r=document.createElement("div");this._element=r;let o=document.createElement("div");o.textContent="Cesium Inspector",o.className="cesium-cesiumInspector-button",o.setAttribute("data-bind","click: toggleDropDown"),r.appendChild(o),r.className="cesium-cesiumInspector",r.setAttribute("data-bind",'css: { "cesium-cesiumInspector-visible" : dropDownVisible, "cesium-cesiumInspector-hidden" : !dropDownVisible }'),e.appendChild(this._element);let s=document.createElement("div");s.className="cesium-cesiumInspector-dropDown",r.appendChild(s);let a=Wf.createSection,c=Wf.createCheckbox,u=a(s,"General","generalVisible","toggleGeneral"),f=c("Show Frustums","frustums"),d=document.createElement("div");d.className="cesium-cesiumInspector-frustumStatistics",d.setAttribute("data-bind","visible: frustums, html: frustumStatisticText"),f.appendChild(d),u.appendChild(f),u.appendChild(c("Show Frustum Planes","frustumPlanes")),u.appendChild(c("Performance Display","performance")),n.className="cesium-cesiumInspector-performanceDisplay",u.appendChild(n);let p=document.createElement("div");p.className="cesium-cesiumInspector-shaderCache",p.setAttribute("data-bind","html: shaderCacheText"),u.appendChild(p);let g=document.createElement("div");u.appendChild(g);let m=document.createElement("span");m.setAttribute("data-bind",'html: "     Frustum:"'),g.appendChild(m);let y=document.createElement("span");y.setAttribute("data-bind","text: depthFrustumText"),g.appendChild(y);let A=document.createElement("input");A.type="button",A.value="-",A.className="cesium-cesiumInspector-pickButton",A.setAttribute("data-bind","click: decrementDepthFrustum"),g.appendChild(A);let b=document.createElement("input");b.type="button",b.value="+",b.className="cesium-cesiumInspector-pickButton",b.setAttribute("data-bind","click: incrementDepthFrustum"),g.appendChild(b);let x=a(s,"Primitives","primitivesVisible","togglePrimitives"),T=document.createElement("div");T.className="cesium-cesiumInspector-pickSection",x.appendChild(T);let E=document.createElement("input");E.type="button",E.value="Pick a primitive",E.className="cesium-cesiumInspector-pickButton",E.setAttribute("data-bind",'css: {"cesium-cesiumInspector-pickButtonHighlight" : pickPrimitiveActive}, click: pickPrimitive');let v=document.createElement("div");v.className="cesium-cesiumInspector-center",v.appendChild(E),T.appendChild(v),T.appendChild(c("Show bounding sphere","primitiveBoundingSphere","hasPickedPrimitive")),T.appendChild(c("Show reference frame","primitiveReferenceFrame","hasPickedPrimitive")),this._primitiveOnly=c("Show only selected","filterPrimitive","hasPickedPrimitive"),T.appendChild(this._primitiveOnly);let S=a(s,"Terrain","terrainVisible","toggleTerrain"),I=document.createElement("div");I.className="cesium-cesiumInspector-pickSection",S.appendChild(I);let R=document.createElement("input");R.type="button",R.value="Pick a tile",R.className="cesium-cesiumInspector-pickButton",R.setAttribute("data-bind",'css: {"cesium-cesiumInspector-pickButtonHighlight" : pickTileActive}, click: pickTile'),v=document.createElement("div"),v.appendChild(R),v.className="cesium-cesiumInspector-center",I.appendChild(v);let O=document.createElement("div");I.appendChild(O);let L=document.createElement("input");L.type="button",L.value="Parent",L.className="cesium-cesiumInspector-pickButton",L.setAttribute("data-bind","click: selectParent");let _=document.createElement("input");_.type="button",_.value="NW",_.className="cesium-cesiumInspector-pickButton",_.setAttribute("data-bind","click: selectNW");let C=document.createElement("input");C.type="button",C.value="NE",C.className="cesium-cesiumInspector-pickButton",C.setAttribute("data-bind","click: selectNE");let w=document.createElement("input");w.type="button",w.value="SW",w.className="cesium-cesiumInspector-pickButton",w.setAttribute("data-bind","click: selectSW");let D=document.createElement("input");D.type="button",D.value="SE",D.className="cesium-cesiumInspector-pickButton",D.setAttribute("data-bind","click: selectSE");let N=document.createElement("div");N.className="cesium-cesiumInspector-tileText",O.className="cesium-cesiumInspector-frustumStatistics",O.appendChild(N),O.setAttribute("data-bind","visible: hasPickedTile"),N.setAttribute("data-bind","html: tileText");let F=document.createElement("div");F.className="cesium-cesiumInspector-relativeText",F.textContent="Select relative:",O.appendChild(F);let V=document.createElement("table"),B=document.createElement("tr"),j=document.createElement("tr"),k=document.createElement("td");k.appendChild(L);let G=document.createElement("td");G.appendChild(_);let q=document.createElement("td");q.appendChild(C),B.appendChild(k),B.appendChild(G),B.appendChild(q);let Q=document.createElement("td"),W=document.createElement("td");W.appendChild(w);let J=document.createElement("td");J.appendChild(D),j.appendChild(Q),j.appendChild(W),j.appendChild(J),V.appendChild(B),V.appendChild(j),O.appendChild(V),I.appendChild(c("Show bounding volume","tileBoundingSphere","hasPickedTile")),I.appendChild(c("Show only selected","filterTile","hasPickedTile")),S.appendChild(c("Wireframe","wireframe")),S.appendChild(c("Suspend LOD update","suspendUpdates")),S.appendChild(c("Show tile coordinates","tileCoordinates")),Se.applyBindings(i,this._element)}Object.defineProperties(aW.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}}});aW.prototype.isDestroyed=function(){return!1};aW.prototype.destroy=function(){return Se.cleanNode(this._element),this._container.removeChild(this._element),this.viewModel.destroy(),le(this)};var cW=aW;function eke(e){e=e??H.EMPTY_OBJECT;let t=e.globe,n=e.imageryProviderViewModels??H.EMPTY_ARRAY,i=e.terrainProviderViewModels??H.EMPTY_ARRAY;this._globe=t,this.imageryProviderViewModels=n.slice(0),this.terrainProviderViewModels=i.slice(0),this.dropDownVisible=!1,Se.track(this,["imageryProviderViewModels","terrainProviderViewModels","dropDownVisible"]);let r=Se.getObservable(this,"imageryProviderViewModels"),o=Se.pureComputed(function(){let d=r(),p={},g;for(g=0;g<d.length;g++){let A=d[g],b=A.category;l(p[b])?p[b].push(A):p[b]=[A]}let m=Object.keys(p),y=[];for(g=0;g<m.length;g++){let A=m[g];y.push({name:A,providers:p[A]})}return y});this._imageryProviders=o;let s=Se.getObservable(this,"terrainProviderViewModels"),a=Se.pureComputed(function(){let d=s(),p={},g;for(g=0;g<d.length;g++){let A=d[g],b=A.category;l(p[b])?p[b].push(A):p[b]=[A]}let m=Object.keys(p),y=[];for(g=0;g<m.length;g++){let A=m[g];y.push({name:A,providers:p[A]})}return y});this._terrainProviders=a,this.buttonTooltip=void 0,Se.defineProperty(this,"buttonTooltip",function(){let d=this.selectedImagery,p=this.selectedTerrain,g=l(d)?d.name:void 0,m=l(p)?p.name:void 0;return l(g)&&l(m)?`${g} +${m}`:l(g)?g:m}),this.buttonImageUrl=void 0,Se.defineProperty(this,"buttonImageUrl",function(){let d=this.selectedImagery;if(l(d))return d.iconUrl}),this.selectedImagery=void 0;let c=Se.observable();this._currentImageryLayers=[],Se.defineProperty(this,"selectedImagery",{get:function(){return c()},set:function(d){if(c()===d){this.dropDownVisible=!1;return}let p,g=this._currentImageryLayers,m=g.length,y=this._globe.imageryLayers,A=!1;for(p=0;p<m;p++){let b=y.length;for(let x=0;x<b;x++){let T=y.get(x);if(T===g[p]){y.remove(T),A=!0;break}}}if(l(d)){let b=d.creationCommand();if(Array.isArray(b)){let x=b.length;for(this._currentImageryLayers=[],p=x-1;p>=0;p--){let T=Ns.fromProviderAsync(b[p]);y.add(T,0),this._currentImageryLayers.push(T)}}else{this._currentImageryLayers=[];let x=Ns.fromProviderAsync(b);if(x.name=d.name,A)y.add(x,0);else{let T=y.get(0);l(T)&&y.remove(T),y.add(x,0)}this._currentImageryLayers.push(x)}}c(d),this.dropDownVisible=!1}}),this.selectedTerrain=void 0;let u=Se.observable();Se.defineProperty(this,"selectedTerrain",{get:function(){return u()},set:function(d){if(u()===d){this.dropDownVisible=!1;return}let p;if(l(d)&&(p=d.creationCommand()),l(p)&&!l(p.then))this._globe.depthTestAgainstTerrain=!(p instanceof Ug),this._globe.terrainProvider=p;else if(l(p)){let g=!1,m=this._globe.terrainProviderChanged.addEventListener(()=>{g=!0,m()}),A=new j7(p).readyEvent.addEventListener(b=>{g||(this._globe.depthTestAgainstTerrain=!(b instanceof Ug),this._globe.terrainProvider=b,A())})}u(d),this.dropDownVisible=!1}});let f=this;this._toggleDropDown=On(function(){f.dropDownVisible=!f.dropDownVisible}),this.selectedImagery=e.selectedImageryProviderViewModel??n[0],this.selectedTerrain=e.selectedTerrainProviderViewModel}Object.defineProperties(eke.prototype,{toggleDropDown:{get:function(){return this._toggleDropDown}},globe:{get:function(){return this._globe}}});var lW=eke;function uW(e,t){e=kn(e);let n=new lW(t),i=document.createElement("button");i.type="button",i.className="cesium-button cesium-toolbar-button",i.setAttribute("data-bind","attr: { title: buttonTooltip },click: toggleDropDown"),e.appendChild(i);let r=document.createElement("img");r.setAttribute("draggable","false"),r.className="cesium-baseLayerPicker-selected",r.setAttribute("data-bind","attr: { src: buttonImageUrl }, visible: !!buttonImageUrl"),i.appendChild(r);let o=document.createElement("div");o.className="cesium-baseLayerPicker-dropDown",o.setAttribute("data-bind",'css: { "cesium-baseLayerPicker-dropDown-visible" : dropDownVisible }'),e.appendChild(o);let s=document.createElement("div");s.className="cesium-baseLayerPicker-sectionTitle",s.setAttribute("data-bind","visible: imageryProviderViewModels.length > 0"),s.innerHTML="Imagery",o.appendChild(s);let a=document.createElement("div");a.className="cesium-baseLayerPicker-section",a.setAttribute("data-bind","foreach: _imageryProviders"),o.appendChild(a);let c=document.createElement("div");c.className="cesium-baseLayerPicker-category",a.appendChild(c);let u=document.createElement("div");u.className="cesium-baseLayerPicker-categoryTitle",u.setAttribute("data-bind","text: name"),c.appendChild(u);let f=document.createElement("div");f.className="cesium-baseLayerPicker-choices",f.setAttribute("data-bind","foreach: providers"),c.appendChild(f);let d=document.createElement("div");d.className="cesium-baseLayerPicker-item",d.setAttribute("data-bind",'css: { "cesium-baseLayerPicker-selectedItem" : $data === $parents[1].selectedImagery },attr: { title: tooltip },visible: creationCommand.canExecute,click: function($data) { $parents[1].selectedImagery = $data; }'),f.appendChild(d);let p=document.createElement("img");p.className="cesium-baseLayerPicker-itemIcon",p.setAttribute("data-bind","attr: { src: iconUrl }"),p.setAttribute("draggable","false"),d.appendChild(p);let g=document.createElement("div");g.className="cesium-baseLayerPicker-itemLabel",g.setAttribute("data-bind","text: name"),d.appendChild(g);let m=document.createElement("div");m.className="cesium-baseLayerPicker-sectionTitle",m.setAttribute("data-bind","visible: terrainProviderViewModels.length > 0"),m.innerHTML="Terrain",o.appendChild(m);let y=document.createElement("div");y.className="cesium-baseLayerPicker-section",y.setAttribute("data-bind","foreach: _terrainProviders"),o.appendChild(y);let A=document.createElement("div");A.className="cesium-baseLayerPicker-category",y.appendChild(A);let b=document.createElement("div");b.className="cesium-baseLayerPicker-categoryTitle",b.setAttribute("data-bind","text: name"),A.appendChild(b);let x=document.createElement("div");x.className="cesium-baseLayerPicker-choices",x.setAttribute("data-bind","foreach: providers"),A.appendChild(x);let T=document.createElement("div");T.className="cesium-baseLayerPicker-item",T.setAttribute("data-bind",'css: { "cesium-baseLayerPicker-selectedItem" : $data === $parents[1].selectedTerrain },attr: { title: tooltip },visible: creationCommand.canExecute,click: function($data) { $parents[1].selectedTerrain = $data; }'),x.appendChild(T);let E=document.createElement("img");E.className="cesium-baseLayerPicker-itemIcon",E.setAttribute("data-bind","attr: { src: iconUrl }"),E.setAttribute("draggable","false"),T.appendChild(E);let v=document.createElement("div");v.className="cesium-baseLayerPicker-itemLabel",v.setAttribute("data-bind","text: name"),T.appendChild(v),Se.applyBindings(n,i),Se.applyBindings(n,o),this._viewModel=n,this._container=e,this._element=i,this._dropPanel=o,this._closeDropDown=function(S){i.contains(S.target)||o.contains(S.target)||(n.dropDownVisible=!1)},dn.supportsPointerEvents()?document.addEventListener("pointerdown",this._closeDropDown,!0):(document.addEventListener("mousedown",this._closeDropDown,!0),document.addEventListener("touchstart",this._closeDropDown,!0))}Object.defineProperties(uW.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}}});uW.prototype.isDestroyed=function(){return!1};uW.prototype.destroy=function(){return dn.supportsPointerEvents()?document.removeEventListener("pointerdown",this._closeDropDown,!0):(document.removeEventListener("mousedown",this._closeDropDown,!0),document.removeEventListener("touchstart",this._closeDropDown,!0)),Se.cleanNode(this._element),Se.cleanNode(this._dropPanel),this._container.removeChild(this._element),this._container.removeChild(this._dropPanel),le(this)};var fW=uW;function tke(e){let t=e.creationFunction;l(t.canExecute)||(t=On(t)),this._creationCommand=t,this.name=e.name,this.tooltip=e.tooltip,this.iconUrl=e.iconUrl,this._category=e.category??"",Se.track(this,["name","tooltip","iconUrl"])}Object.defineProperties(tke.prototype,{creationCommand:{get:function(){return this._creationCommand}},category:{get:function(){return this._category}}});var yo=tke;function pHt(){let e=[],t=devicePixelRatio>=2;return e.push(new yo({name:"Bing Maps Aerial",iconUrl:Zt("Widgets/Images/ImageryProviders/bingAerial.png"),tooltip:"Bing Maps aerial imagery, provided by Cesium ion",category:"Cesium ion",creationFunction:function(){return Oy({style:Ry.AERIAL})}})),e.push(new yo({name:"Bing Maps Aerial with Labels",iconUrl:Zt("Widgets/Images/ImageryProviders/bingAerialLabels.png"),tooltip:"Bing Maps aerial imagery with labels, provided by Cesium ion",category:"Cesium ion",creationFunction:function(){return Oy({style:Ry.AERIAL_WITH_LABELS})}})),e.push(new yo({name:"Bing Maps Roads",iconUrl:Zt("Widgets/Images/ImageryProviders/bingRoads.png"),tooltip:"Bing Maps standard road maps, provided by Cesium ion",category:"Cesium ion",creationFunction:function(){return Oy({style:Ry.ROAD})}})),e.push(new yo({name:"ArcGIS World Imagery",iconUrl:Zt("Widgets/Images/ImageryProviders/ArcGisMapServiceWorldImagery.png"),tooltip:`ArcGIS World Imagery provides one meter or better satellite and aerial imagery in many parts of the world and lower resolution satellite imagery worldwide. The map includes 15m TerraColor imagery at small and mid-scales (~1:591M down to ~1:288k) for the world. The map features Maxar imagery at 0.3m resolution for select metropolitan areas around the world, 0.5m resolution across the United States and parts of Western Europe, and 1m resolution imagery across the rest of the world. In addition to commercial sources, the World Imagery map features high-resolution aerial photography contributed by the GIS User Community. This imagery ranges from 0.3m to 0.03m resolution (down to ~1:280 nin select communities). For more information on this map, including the terms of use, visit us online at +https://www.arcgis.com/home/item.html?id=10df2279f9684e4a9f6a7f08febac2a9`,category:"Other",creationFunction:function(){return Dy.fromBasemapType(Pp.SATELLITE,{enablePickFeatures:!1})}})),e.push(new yo({name:"ArcGIS World Hillshade",iconUrl:Zt("Widgets/Images/ImageryProviders/ArcGisMapServiceWorldHillshade.png"),tooltip:`ArcGIS World Hillshade map portrays elevation as an artistic hillshade. This map is designed to be used as a backdrop for topographical, soil, hydro, landcover or other outdoor recreational maps. The map was compiled from a variety of sources from several data providers. The basemap has global coverage down to a scale of ~1:72k. In select areas of the United States and Europe, coverage is available down to ~1:9k. For more information on this map, including the terms of use, visit us online at +https://www.arcgis.com/home/item.html?id=1b243539f4514b6ba35e7d995890db1d`,category:"Other",creationFunction:function(){return Dy.fromBasemapType(Pp.HILLSHADE,{enablePickFeatures:!1})}})),e.push(new yo({name:"Esri World Ocean",iconUrl:Zt("Widgets/Images/ImageryProviders/ArcGisMapServiceWorldOcean.png"),tooltip:`ArcGIS World Ocean map is designed to be used as a base map by marine GIS professionals and as a reference map by anyone interested in ocean data. The base map features marine bathymetry. Land features include inland waters and roads overlaid on land cover and shaded relief imagery. The map was compiled from a variety of best available sources from several data providers, including General Bathymetric Chart of the Oceans GEBCO_08 Grid, National Oceanic and Atmospheric Administration (NOAA), and National Geographic, Garmin, HERE, Geonames.org, and Esri, and various other contributors. The base map currently provides coverage for the world down to a scale of ~1:577k, and coverage down to 1:72k in US coastal areas, and various other areas. Coverage down to ~ 1:9k is available limited areas based on regional hydrographic survey data. The base map was designed and developed by Esri. For more information on this map, including our terms of use, visit us online at +https://www.arcgis.com/home/item.html?id=1e126e7520f9466c9ca28b8f28b5e500`,category:"Other",creationFunction:function(){return Dy.fromBasemapType(Pp.OCEANS,{enablePickFeatures:!1})}})),e.push(new yo({name:"Open\xADStreet\xADMap",iconUrl:Zt("Widgets/Images/ImageryProviders/openStreetMap.png"),tooltip:`OpenStreetMap (OSM) is a collaborative project to create a free editable map of the world. http://www.openstreetmap.org`,category:"Other",creationFunction:function(){return new sb({url:"https://tile.openstreetmap.org/"})}})),e.push(new yo({name:"Stadia x Stamen Watercolor",iconUrl:Zt("Widgets/Images/ImageryProviders/stamenWatercolor.png"),tooltip:`Based on the original basemaps created for the Knight Foundation and reminiscent of hand drawn maps, the watercolor maps from Stamen Design apply raster effect area washes and organic edges over a paper texture to add warm pop to any map. https://docs.stadiamaps.com/map-styles/stamen-watercolor/`,category:"Other",creationFunction:function(){return new sb({url:"https://tiles.stadiamaps.com/tiles/stamen_watercolor/",fileExtension:"jpg",credit:`© <a href="https://stamen.com/" target="_blank">Stamen Design</a> © <a href="https://www.stadiamaps.com/" target="_blank">Stadia Maps</a> @@ -12763,15 +12770,8 @@ https://docs.stadiamaps.com/map-styles/alidade-smooth/`,category:"Other",creatio © <a href="https://www.openstreetmap.org/about/" target="_blank">OpenStreetMap contributors</a>`})}})),e.push(new yo({name:"Stadia Alidade Smooth Dark",iconUrl:Zt("Widgets/Images/ImageryProviders/stadiaAlidadeSmoothDark.png"),tooltip:`Stadia Alidade Smooth Dark, like its lighter cousin, is also designed to stay out of the way. It just flips the dark mode switch on the color scheme. With the lights out, your data can now literally shine. https://docs.stadiamaps.com/map-styles/alidade-smooth-dark/`,category:"Other",creationFunction:function(){return new sb({url:"https://tiles.stadiamaps.com/tiles/alidade_smooth_dark/",retinaTiles:t,credit:`© <a href="https://www.stadiamaps.com/" target="_blank">Stadia Maps</a> © <a href="https://openmaptiles.org/" target="_blank">OpenMapTiles</a> - © <a href="https://www.openstreetmap.org/about/" target="_blank">OpenStreetMap contributors</a>`})}})),e.push(new yo({name:"Sentinel-2",iconUrl:Zt("Widgets/Images/ImageryProviders/sentinel-2.png"),tooltip:"Sentinel-2 cloudless by EOX IT Services GmbH (Contains modified Copernicus Sentinel data 2016 and 2017).",category:"Cesium ion",creationFunction:function(){return Du.fromAssetId(3954)}})),e.push(new yo({name:"Blue Marble",iconUrl:Zt("Widgets/Images/ImageryProviders/blueMarble.png"),tooltip:"Blue Marble Next Generation July, 2004 imagery from NASA.",category:"Cesium ion",creationFunction:function(){return Du.fromAssetId(3845)}})),e.push(new yo({name:"Earth at night",iconUrl:Zt("Widgets/Images/ImageryProviders/earthAtNight.png"),tooltip:"The Earth at night, also known as The Black Marble, is a 500 meter resolution global composite imagery layer released by NASA.",category:"Cesium ion",creationFunction:function(){return Du.fromAssetId(3812)}})),e.push(new yo({name:"Natural Earth\xA0II",iconUrl:Zt("Widgets/Images/ImageryProviders/naturalEarthII.png"),tooltip:`Natural Earth II, darkened for contrast. -http://www.naturalearthdata.com/`,category:"Cesium ion",creationFunction:function(){return gx.fromUrl(Zt("Assets/Textures/NaturalEarthII"))}})),e.push(new yo({name:"Google Maps Satellite",iconUrl:Zt("Widgets/Images/ImageryProviders/googleSatellite.png"),tooltip:"Imagery from Google Maps",category:"Cesium ion",creationFunction:function(){return Du.fromAssetId(3830182)}})),e.push(new yo({name:"Google Maps Satellite with Labels",iconUrl:Zt("Widgets/Images/ImageryProviders/googleSatelliteLabels.png"),tooltip:"Imagery with place labels from Google Maps",category:"Cesium ion",creationFunction:function(){return Du.fromAssetId(3830183)}})),e.push(new yo({name:"Google Maps Roadmap",iconUrl:Zt("Widgets/Images/ImageryProviders/googleRoadmap.png"),tooltip:"Labeled roads and other features on a base landscape from Google Maps",category:"Cesium ion",creationFunction:function(){return Du.fromAssetId(3830184)}})),e.push(new yo({name:"Google Maps Contour",iconUrl:Zt("Widgets/Images/ImageryProviders/googleContour.png"),tooltip:"Hillshade mapping, contour lines, natural features (roadmap features hidden) from Google Maps",category:"Cesium ion",creationFunction:function(){return Du.fromAssetId(3830186)}})),e.push(new yo({name:"Azure Maps Aerial",iconUrl:Zt("Widgets/Images/ImageryProviders/azureAerial.png"),tooltip:"Imagery from Azure Maps",category:"Cesium ion",creationFunction:function(){return Du.fromAssetId(3891168)}})),e.push(new yo({name:"Azure Maps Roads",iconUrl:Zt("Widgets/Images/ImageryProviders/azureRoads.png"),tooltip:"Labeled roads and other features on a base landscape from Azure Maps",category:"Cesium ion",creationFunction:function(){return Du.fromAssetId(3891169)}})),e}var oW=aHt;function cHt(){let e=[];return e.push(new yo({name:"WGS84 Ellipsoid",iconUrl:Zt("Widgets/Images/TerrainProviders/Ellipsoid.png"),tooltip:"WGS84 standard ellipsoid, also known as EPSG:4326",category:"Cesium ion",creationFunction:function(){return new Qg({ellipsoid:ee.WGS84})}})),e.push(new yo({name:"Cesium World Terrain",iconUrl:Zt("Widgets/Images/TerrainProviders/CesiumWorldTerrain.png"),tooltip:"High-resolution global terrain tileset curated from several datasources and hosted by Cesium ion",category:"Cesium ion",creationFunction:function(){return _I({requestWaterMask:!0,requestVertexNormals:!0})}})),e}var sW=cHt;function lHt(e){let t;if(l(e)){t="Command Statistics";let n=e.commandsInFrustums;for(let i in n)if(n.hasOwnProperty(i)){let r=parseInt(i,10),o;if(r===7)o="1, 2 and 3";else{let s=[];for(let a=2;a>=0;a--){let c=Math.pow(2,a);r>=c&&(s.push(a+1),r-=c)}o=s.reverse().join(" and ")}t+=`<br>    ${n[i]} in frustum ${o}`}t+=`<br>Total: ${e.totalCommands}`}return t}function Dae(e,t,n){let i=Math.min(n,t);return i=Math.max(i,e),i}var uHt=new gn,fHt=new h;function ZM(e,t){let n=this,i=e.canvas,r=new Ta(i);this._eventHandler=r,this._scene=e,this._canvas=i,this._primitive=void 0,this._tile=void 0,this._modelMatrixPrimitive=void 0,this._performanceDisplay=void 0,this._performanceContainer=t;let o=this._scene.globe;o.depthTestAgainstTerrain=!0,this.frustums=!1,this.frustumPlanes=!1,this.performance=!1,this.shaderCacheText="",this.primitiveBoundingSphere=!1,this.primitiveReferenceFrame=!1,this.filterPrimitive=!1,this.tileBoundingSphere=!1,this.filterTile=!1,this.wireframe=!1,this.depthFrustum=1,this._numberOfFrustums=1,this.suspendUpdates=!1,this.tileCoordinates=!1,this.frustumStatisticText=!1,this.tileText="",this.hasPickedPrimitive=!1,this.hasPickedTile=!1,this.pickPrimitiveActive=!1,this.pickTileActive=!1,this.dropDownVisible=!0,this.generalVisible=!0,this.primitivesVisible=!1,this.terrainVisible=!1,this.depthFrustumText="",Se.track(this,["frustums","frustumPlanes","performance","shaderCacheText","primitiveBoundingSphere","primitiveReferenceFrame","filterPrimitive","tileBoundingSphere","filterTile","wireframe","depthFrustum","suspendUpdates","tileCoordinates","frustumStatisticText","tileText","hasPickedPrimitive","hasPickedTile","pickPrimitiveActive","pickTileActive","dropDownVisible","generalVisible","primitivesVisible","terrainVisible","depthFrustumText"]),this._toggleDropDown=On(function(){n.dropDownVisible=!n.dropDownVisible}),this._toggleGeneral=On(function(){n.generalVisible=!n.generalVisible}),this._togglePrimitives=On(function(){n.primitivesVisible=!n.primitivesVisible}),this._toggleTerrain=On(function(){n.terrainVisible=!n.terrainVisible}),this._frustumsSubscription=Se.getObservable(this,"frustums").subscribe(function(u){n._scene.debugShowFrustums=u,n._scene.requestRender()}),this._frustumPlanesSubscription=Se.getObservable(this,"frustumPlanes").subscribe(function(u){n._scene.debugShowFrustumPlanes=u,n._scene.requestRender()}),this._performanceSubscription=Se.getObservable(this,"performance").subscribe(function(u){u?n._performanceDisplay=new zA({container:n._performanceContainer}):n._performanceContainer.innerHTML=""}),this._showPrimitiveBoundingSphere=On(function(){return n._primitive.debugShowBoundingVolume=n.primitiveBoundingSphere,n._scene.requestRender(),!0}),this._primitiveBoundingSphereSubscription=Se.getObservable(this,"primitiveBoundingSphere").subscribe(function(){n._showPrimitiveBoundingSphere()}),this._showPrimitiveReferenceFrame=On(function(){if(n.primitiveReferenceFrame){let u=n._primitive.modelMatrix;n._modelMatrixPrimitive=new y7({modelMatrix:u}),n._scene.primitives.add(n._modelMatrixPrimitive)}else l(n._modelMatrixPrimitive)&&(n._scene.primitives.remove(n._modelMatrixPrimitive),n._modelMatrixPrimitive=void 0);return n._scene.requestRender(),!0}),this._primitiveReferenceFrameSubscription=Se.getObservable(this,"primitiveReferenceFrame").subscribe(function(){n._showPrimitiveReferenceFrame()}),this._doFilterPrimitive=On(function(){return n.filterPrimitive?n._scene.debugCommandFilter=function(u){return l(n._modelMatrixPrimitive)&&u.owner===n._modelMatrixPrimitive._primitive?!0:l(n._primitive)?u.owner===n._primitive||u.owner===n._primitive._billboardCollection||u.owner.primitive===n._primitive:!1}:n._scene.debugCommandFilter=void 0,!0}),this._filterPrimitiveSubscription=Se.getObservable(this,"filterPrimitive").subscribe(function(){n._doFilterPrimitive(),n._scene.requestRender()}),this._wireframeSubscription=Se.getObservable(this,"wireframe").subscribe(function(u){o._surface.tileProvider._debug.wireframe=u,n._scene.requestRender()}),this._depthFrustumSubscription=Se.getObservable(this,"depthFrustum").subscribe(function(u){n._scene.debugShowDepthFrustum=u,n._scene.requestRender()}),this._incrementDepthFrustum=On(function(){let u=n.depthFrustum+1;return n.depthFrustum=Dae(1,n._numberOfFrustums,u),n._scene.requestRender(),!0}),this._decrementDepthFrustum=On(function(){let u=n.depthFrustum-1;return n.depthFrustum=Dae(1,n._numberOfFrustums,u),n._scene.requestRender(),!0}),this._suspendUpdatesSubscription=Se.getObservable(this,"suspendUpdates").subscribe(function(u){o._surface._debug.suspendLodUpdate=u,u||(n.filterTile=!1)});let s;this._showTileCoordinates=On(function(){return n.tileCoordinates&&!l(s)?s=e.imageryLayers.addImageryProvider(new H7({tilingScheme:e.terrainProvider.tilingScheme})):!n.tileCoordinates&&l(s)&&(e.imageryLayers.remove(s),s=void 0),!0}),this._tileCoordinatesSubscription=Se.getObservable(this,"tileCoordinates").subscribe(function(){n._showTileCoordinates(),n._scene.requestRender()}),this._tileBoundingSphereSubscription=Se.getObservable(this,"tileBoundingSphere").subscribe(function(){n._showTileBoundingSphere(),n._scene.requestRender()}),this._showTileBoundingSphere=On(function(){return n.tileBoundingSphere?o._surface.tileProvider._debug.boundingSphereTile=n._tile:o._surface.tileProvider._debug.boundingSphereTile=void 0,n._scene.requestRender(),!0}),this._doFilterTile=On(function(){return n.filterTile?(n.suspendUpdates=!0,o._surface._tilesToRender=[],l(n._tile)&&n._tile.renderable&&o._surface._tilesToRender.push(n._tile)):n.suspendUpdates=!1,!0}),this._filterTileSubscription=Se.getObservable(this,"filterTile").subscribe(function(){n.doFilterTile(),n._scene.requestRender()});function a(u){let f=n._scene.pick({x:u.position.x,y:u.position.y});l(f)&&(n.primitive=l(f.collection)?f.collection:f.primitive),n._scene.requestRender(),n.pickPrimitiveActive=!1}this._pickPrimitive=On(function(){n.pickPrimitiveActive=!n.pickPrimitiveActive}),this._pickPrimitiveActiveSubscription=Se.getObservable(this,"pickPrimitiveActive").subscribe(function(u){u?r.setInputAction(a,fn.LEFT_CLICK):r.removeInputAction(fn.LEFT_CLICK)});function c(u){let f,d=o.ellipsoid,p=n._scene.camera.getPickRay(u.position,uHt),g=o.pick(p,n._scene,fHt);if(l(g)){let m=d.cartesianToCartographic(g),y=o._surface.tileProvider._tilesToRenderByTextureCount;for(let A=0;!f&&A<y.length;++A){let b=y[A];if(l(b))for(let x=0;!f&&x<b.length;++x){let T=b[x];ie.contains(T.rectangle,m)&&(f=T)}}}n.tile=f,n.pickTileActive=!1}this._pickTile=On(function(){n.pickTileActive=!n.pickTileActive}),this._pickTileActiveSubscription=Se.getObservable(this,"pickTileActive").subscribe(function(u){u?r.setInputAction(c,fn.LEFT_CLICK):r.removeInputAction(fn.LEFT_CLICK)}),this._removePostRenderEvent=e.postRender.addEventListener(function(){n._update()})}Object.defineProperties(ZM.prototype,{scene:{get:function(){return this._scene}},performanceContainer:{get:function(){return this._performanceContainer}},toggleDropDown:{get:function(){return this._toggleDropDown}},showPrimitiveBoundingSphere:{get:function(){return this._showPrimitiveBoundingSphere}},showPrimitiveReferenceFrame:{get:function(){return this._showPrimitiveReferenceFrame}},doFilterPrimitive:{get:function(){return this._doFilterPrimitive}},incrementDepthFrustum:{get:function(){return this._incrementDepthFrustum}},decrementDepthFrustum:{get:function(){return this._decrementDepthFrustum}},showTileCoordinates:{get:function(){return this._showTileCoordinates}},showTileBoundingSphere:{get:function(){return this._showTileBoundingSphere}},doFilterTile:{get:function(){return this._doFilterTile}},toggleGeneral:{get:function(){return this._toggleGeneral}},togglePrimitives:{get:function(){return this._togglePrimitives}},toggleTerrain:{get:function(){return this._toggleTerrain}},pickPrimitive:{get:function(){return this._pickPrimitive}},pickTile:{get:function(){return this._pickTile}},selectParent:{get:function(){let e=this;return On(function(){e.tile=e.tile.parent})}},selectNW:{get:function(){let e=this;return On(function(){e.tile=e.tile.northwestChild})}},selectNE:{get:function(){let e=this;return On(function(){e.tile=e.tile.northeastChild})}},selectSW:{get:function(){let e=this;return On(function(){e.tile=e.tile.southwestChild})}},selectSE:{get:function(){let e=this;return On(function(){e.tile=e.tile.southeastChild})}},primitive:{get:function(){return this._primitive},set:function(e){let t=this._primitive;e!==t&&(this.hasPickedPrimitive=!0,l(t)&&(t.debugShowBoundingVolume=!1),this._scene.debugCommandFilter=void 0,l(this._modelMatrixPrimitive)&&(this._scene.primitives.remove(this._modelMatrixPrimitive),this._modelMatrixPrimitive=void 0),this._primitive=e,e.show=!1,setTimeout(function(){e.show=!0},50),this.showPrimitiveBoundingSphere(),this.showPrimitiveReferenceFrame(),this.doFilterPrimitive())}},tile:{get:function(){return this._tile},set:function(e){if(l(e)){this.hasPickedTile=!0;let t=this._tile;if(e!==t){this.tileText=`L: ${e.level} X: ${e.x} Y: ${e.y}`,this.tileText+=`<br>SW corner: ${e.rectangle.west}, ${e.rectangle.south}`,this.tileText+=`<br>NE corner: ${e.rectangle.east}, ${e.rectangle.north}`;let n=e.data;l(n)&&l(n.tileBoundingRegion)?this.tileText+=`<br>Min: ${n.tileBoundingRegion.minimumHeight} Max: ${n.tileBoundingRegion.maximumHeight}`:this.tileText+="<br>(Tile is not loaded)"}this._tile=e,this.showTileBoundingSphere(),this.doFilterTile()}else this.hasPickedTile=!1,this._tile=void 0}}});ZM.prototype._update=function(){this.frustums&&(this.frustumStatisticText=lHt(this._scene.debugFrustumStatistics));let e=this._scene.numberOfFrustums;this._numberOfFrustums=e,this.depthFrustum=Dae(1,e,this.depthFrustum),this.depthFrustumText=`${this.depthFrustum} of ${e}`,this.performance&&this._performanceDisplay.update(),this.primitiveReferenceFrame&&(this._modelMatrixPrimitive.modelMatrix=this._primitive.modelMatrix),this.shaderCacheText=`Cached shaders: ${this._scene.context.shaderCache.numberOfShaders}`};ZM.prototype.isDestroyed=function(){return!1};ZM.prototype.destroy=function(){return this._eventHandler.destroy(),this._removePostRenderEvent(),this._frustumsSubscription.dispose(),this._frustumPlanesSubscription.dispose(),this._performanceSubscription.dispose(),this._primitiveBoundingSphereSubscription.dispose(),this._primitiveReferenceFrameSubscription.dispose(),this._filterPrimitiveSubscription.dispose(),this._wireframeSubscription.dispose(),this._depthFrustumSubscription.dispose(),this._suspendUpdatesSubscription.dispose(),this._tileCoordinatesSubscription.dispose(),this._tileBoundingSphereSubscription.dispose(),this._filterTileSubscription.dispose(),this._pickPrimitiveActiveSubscription.dispose(),this._pickTileActiveSubscription.dispose(),le(this)};var aW=ZM;function cW(e,t){e=kn(e);let n=document.createElement("div"),i=new aW(t,n);this._viewModel=i,this._container=e;let r=document.createElement("div");this._element=r;let o=document.createElement("div");o.textContent="Cesium Inspector",o.className="cesium-cesiumInspector-button",o.setAttribute("data-bind","click: toggleDropDown"),r.appendChild(o),r.className="cesium-cesiumInspector",r.setAttribute("data-bind",'css: { "cesium-cesiumInspector-visible" : dropDownVisible, "cesium-cesiumInspector-hidden" : !dropDownVisible }'),e.appendChild(this._element);let s=document.createElement("div");s.className="cesium-cesiumInspector-dropDown",r.appendChild(s);let a=qf.createSection,c=qf.createCheckbox,u=a(s,"General","generalVisible","toggleGeneral"),f=c("Show Frustums","frustums"),d=document.createElement("div");d.className="cesium-cesiumInspector-frustumStatistics",d.setAttribute("data-bind","visible: frustums, html: frustumStatisticText"),f.appendChild(d),u.appendChild(f),u.appendChild(c("Show Frustum Planes","frustumPlanes")),u.appendChild(c("Performance Display","performance")),n.className="cesium-cesiumInspector-performanceDisplay",u.appendChild(n);let p=document.createElement("div");p.className="cesium-cesiumInspector-shaderCache",p.setAttribute("data-bind","html: shaderCacheText"),u.appendChild(p);let g=document.createElement("div");u.appendChild(g);let m=document.createElement("span");m.setAttribute("data-bind",'html: "     Frustum:"'),g.appendChild(m);let y=document.createElement("span");y.setAttribute("data-bind","text: depthFrustumText"),g.appendChild(y);let A=document.createElement("input");A.type="button",A.value="-",A.className="cesium-cesiumInspector-pickButton",A.setAttribute("data-bind","click: decrementDepthFrustum"),g.appendChild(A);let b=document.createElement("input");b.type="button",b.value="+",b.className="cesium-cesiumInspector-pickButton",b.setAttribute("data-bind","click: incrementDepthFrustum"),g.appendChild(b);let x=a(s,"Primitives","primitivesVisible","togglePrimitives"),T=document.createElement("div");T.className="cesium-cesiumInspector-pickSection",x.appendChild(T);let E=document.createElement("input");E.type="button",E.value="Pick a primitive",E.className="cesium-cesiumInspector-pickButton",E.setAttribute("data-bind",'css: {"cesium-cesiumInspector-pickButtonHighlight" : pickPrimitiveActive}, click: pickPrimitive');let v=document.createElement("div");v.className="cesium-cesiumInspector-center",v.appendChild(E),T.appendChild(v),T.appendChild(c("Show bounding sphere","primitiveBoundingSphere","hasPickedPrimitive")),T.appendChild(c("Show reference frame","primitiveReferenceFrame","hasPickedPrimitive")),this._primitiveOnly=c("Show only selected","filterPrimitive","hasPickedPrimitive"),T.appendChild(this._primitiveOnly);let S=a(s,"Terrain","terrainVisible","toggleTerrain"),I=document.createElement("div");I.className="cesium-cesiumInspector-pickSection",S.appendChild(I);let R=document.createElement("input");R.type="button",R.value="Pick a tile",R.className="cesium-cesiumInspector-pickButton",R.setAttribute("data-bind",'css: {"cesium-cesiumInspector-pickButtonHighlight" : pickTileActive}, click: pickTile'),v=document.createElement("div"),v.appendChild(R),v.className="cesium-cesiumInspector-center",I.appendChild(v);let O=document.createElement("div");I.appendChild(O);let L=document.createElement("input");L.type="button",L.value="Parent",L.className="cesium-cesiumInspector-pickButton",L.setAttribute("data-bind","click: selectParent");let _=document.createElement("input");_.type="button",_.value="NW",_.className="cesium-cesiumInspector-pickButton",_.setAttribute("data-bind","click: selectNW");let C=document.createElement("input");C.type="button",C.value="NE",C.className="cesium-cesiumInspector-pickButton",C.setAttribute("data-bind","click: selectNE");let w=document.createElement("input");w.type="button",w.value="SW",w.className="cesium-cesiumInspector-pickButton",w.setAttribute("data-bind","click: selectSW");let D=document.createElement("input");D.type="button",D.value="SE",D.className="cesium-cesiumInspector-pickButton",D.setAttribute("data-bind","click: selectSE");let N=document.createElement("div");N.className="cesium-cesiumInspector-tileText",O.className="cesium-cesiumInspector-frustumStatistics",O.appendChild(N),O.setAttribute("data-bind","visible: hasPickedTile"),N.setAttribute("data-bind","html: tileText");let F=document.createElement("div");F.className="cesium-cesiumInspector-relativeText",F.textContent="Select relative:",O.appendChild(F);let V=document.createElement("table"),B=document.createElement("tr"),j=document.createElement("tr"),k=document.createElement("td");k.appendChild(L);let G=document.createElement("td");G.appendChild(_);let q=document.createElement("td");q.appendChild(C),B.appendChild(k),B.appendChild(G),B.appendChild(q);let Q=document.createElement("td"),W=document.createElement("td");W.appendChild(w);let J=document.createElement("td");J.appendChild(D),j.appendChild(Q),j.appendChild(W),j.appendChild(J),V.appendChild(B),V.appendChild(j),O.appendChild(V),I.appendChild(c("Show bounding volume","tileBoundingSphere","hasPickedTile")),I.appendChild(c("Show only selected","filterTile","hasPickedTile")),S.appendChild(c("Wireframe","wireframe")),S.appendChild(c("Suspend LOD update","suspendUpdates")),S.appendChild(c("Show tile coordinates","tileCoordinates")),Se.applyBindings(i,this._element)}Object.defineProperties(cW.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}}});cW.prototype.isDestroyed=function(){return!1};cW.prototype.destroy=function(){return Se.cleanNode(this._element),this._container.removeChild(this._element),this.viewModel.destroy(),le(this)};var lW=cW;function uW(e,t){l(t)||(t=document.body),t=kn(t);let n=this,i=Se.observable(ss.fullscreen),r=Se.observable(ss.enabled),o=t.ownerDocument;this.isFullscreen=void 0,Se.defineProperty(this,"isFullscreen",{get:function(){return i()}}),this.isFullscreenEnabled=void 0,Se.defineProperty(this,"isFullscreenEnabled",{get:function(){return r()},set:function(s){r(s&&ss.enabled)}}),this.tooltip=void 0,Se.defineProperty(this,"tooltip",function(){return this.isFullscreenEnabled?i()?"Exit full screen":"Full screen":"Full screen unavailable"}),this._command=On(function(){ss.fullscreen?ss.exitFullscreen():ss.requestFullscreen(n._fullscreenElement)},Se.getObservable(this,"isFullscreenEnabled")),this._fullscreenElement=kn(e)??o.body,this._callback=function(){i(ss.fullscreen)},o.addEventListener(ss.changeEventName,this._callback)}Object.defineProperties(uW.prototype,{fullscreenElement:{get:function(){return this._fullscreenElement},set:function(e){this._fullscreenElement=e}},command:{get:function(){return this._command}}});uW.prototype.isDestroyed=function(){return!1};uW.prototype.destroy=function(){document.removeEventListener(ss.changeEventName,this._callback),le(this)};var fW=uW;var dHt="M 83.96875 17.5625 L 83.96875 17.59375 L 76.65625 24.875 L 97.09375 24.96875 L 76.09375 45.96875 L 81.9375 51.8125 L 102.78125 30.9375 L 102.875 51.15625 L 110.15625 43.875 L 110.1875 17.59375 L 83.96875 17.5625 z M 44.125 17.59375 L 17.90625 17.625 L 17.9375 43.90625 L 25.21875 51.1875 L 25.3125 30.96875 L 46.15625 51.8125 L 52 45.96875 L 31 25 L 51.4375 24.90625 L 44.125 17.59375 z M 46.0625 76.03125 L 25.1875 96.875 L 25.09375 76.65625 L 17.8125 83.9375 L 17.8125 110.21875 L 44 110.25 L 51.3125 102.9375 L 30.90625 102.84375 L 51.875 81.875 L 46.0625 76.03125 z M 82 76.15625 L 76.15625 82 L 97.15625 103 L 76.71875 103.0625 L 84.03125 110.375 L 110.25 110.34375 L 110.21875 84.0625 L 102.9375 76.8125 L 102.84375 97 L 82 76.15625 z",hHt="M 104.34375 17.5625 L 83.5 38.4375 L 83.40625 18.21875 L 76.125 25.5 L 76.09375 51.78125 L 102.3125 51.8125 L 102.3125 51.78125 L 109.625 44.5 L 89.1875 44.40625 L 110.1875 23.40625 L 104.34375 17.5625 z M 23.75 17.59375 L 17.90625 23.4375 L 38.90625 44.4375 L 18.5 44.53125 L 25.78125 51.8125 L 52 51.78125 L 51.96875 25.53125 L 44.6875 18.25 L 44.625 38.46875 L 23.75 17.59375 z M 25.6875 76.03125 L 18.375 83.3125 L 38.78125 83.40625 L 17.8125 104.40625 L 23.625 110.25 L 44.5 89.375 L 44.59375 109.59375 L 51.875 102.3125 L 51.875 76.0625 L 25.6875 76.03125 z M 102.375 76.15625 L 76.15625 76.1875 L 76.1875 102.4375 L 83.46875 109.71875 L 83.5625 89.53125 L 104.40625 110.375 L 110.25 104.53125 L 89.25 83.53125 L 109.6875 83.46875 L 102.375 76.15625 z";function dW(e,t){e=kn(e);let n=new fW(t,e);n._exitFullScreenPath=hHt,n._enterFullScreenPath=dHt;let i=document.createElement("button");i.type="button",i.className="cesium-button cesium-fullscreenButton",i.setAttribute("data-bind","attr: { title: tooltip },click: command,enable: isFullscreenEnabled,cesiumSvgPath: { path: isFullscreen ? _exitFullScreenPath : _enterFullScreenPath, width: 128, height: 128 }"),e.appendChild(i),Se.applyBindings(n,i),this._container=e,this._viewModel=n,this._element=i}Object.defineProperties(dW.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}}});dW.prototype.isDestroyed=function(){return!1};dW.prototype.destroy=function(){return this._viewModel.destroy(),Se.cleanNode(this._element),this._container.removeChild(this._element),le(this)};var hW=dW;function Z2e(e,t){this._scene=e,this._duration=t;let n=this;this._command=On(function(){n._scene.camera.flyHome(n._duration)}),this.tooltip="View Home",Se.track(this,["tooltip"])}Object.defineProperties(Z2e.prototype,{scene:{get:function(){return this._scene}},command:{get:function(){return this._command}},duration:{get:function(){return this._duration},set:function(e){this._duration=e}}});var mW=Z2e;function pW(e,t,n){e=kn(e);let i=new mW(t,n);i._svgPath="M14,4l-10,8.75h20l-4.25-3.7188v-4.6562h-2.812v2.1875l-2.938-2.5625zm-7.0938,9.906v10.094h14.094v-10.094h-14.094zm2.1876,2.313h3.3122v4.25h-3.3122v-4.25zm5.8442,1.281h3.406v6.438h-3.406v-6.438z";let r=document.createElement("button");r.type="button",r.className="cesium-button cesium-toolbar-button cesium-home-button",r.setAttribute("data-bind","attr: { title: tooltip },click: command,cesiumSvgPath: { path: _svgPath, width: 28, height: 28 }"),e.appendChild(r),Se.applyBindings(i,r),this._container=e,this._viewModel=i,this._element=r}Object.defineProperties(pW.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}}});pW.prototype.isDestroyed=function(){return!1};pW.prototype.destroy=function(){return Se.cleanNode(this._element),this._container.removeChild(this._element),le(this)};var gW=pW;function mHt(e){return function(t){let n=e._scene.pick(t.position);l(n)&&n.primitive instanceof Zo&&(e.tileset=n.primitive),e.pickActive=!1}}function eke(e,t){t?e._eventHandler.setInputAction(function(n){let i=e._scene.pick(n.endPosition);l(i)&&i.primitive instanceof Zo&&(e.tileset=i.primitive)},fn.MOUSE_MOVE):(e._eventHandler.removeInputAction(fn.MOUSE_MOVE),e.picking=e.picking)}var pHt={maximumFractionDigits:3};function QM(e){let t=e/1048576;return t<1?t.toLocaleString(void 0,pHt):Math.round(t).toLocaleString()}function eN(e,t){if(!l(e))return"";let n=t?e._statisticsPerPass[po.PICK]:e._statisticsPerPass[po.RENDER],i='<ul class="cesium-cesiumInspector-statistics">';return i+=`<li><strong>Visited: </strong>${n.visited.toLocaleString()}</li><li><strong>Selected: </strong>${n.selected.toLocaleString()}</li><li><strong>Commands: </strong>${n.numberOfCommands.toLocaleString()}</li>`,i+="</ul>",t||(i+='<ul class="cesium-cesiumInspector-statistics">',i+=`<li><strong>Requests: </strong>${n.numberOfPendingRequests.toLocaleString()}</li><li><strong>Attempted: </strong>${n.numberOfAttemptedRequests.toLocaleString()}</li><li><strong>Processing: </strong>${n.numberOfTilesProcessing.toLocaleString()}</li><li><strong>Content Ready: </strong>${n.numberOfTilesWithContentReady.toLocaleString()}</li><li><strong>Total: </strong>${n.numberOfTilesTotal.toLocaleString()}</li>`,i+="</ul>",i+='<ul class="cesium-cesiumInspector-statistics">',i+=`<li><strong>Features Selected: </strong>${n.numberOfFeaturesSelected.toLocaleString()}</li><li><strong>Features Loaded: </strong>${n.numberOfFeaturesLoaded.toLocaleString()}</li><li><strong>Points Selected: </strong>${n.numberOfPointsSelected.toLocaleString()}</li><li><strong>Points Loaded: </strong>${n.numberOfPointsLoaded.toLocaleString()}</li><li><strong>Triangles Selected: </strong>${n.numberOfTrianglesSelected.toLocaleString()}</li>`,i+="</ul>",i+='<ul class="cesium-cesiumInspector-statistics">',i+=`<li><strong>Tiles styled: </strong>${n.numberOfTilesStyled.toLocaleString()}</li><li><strong>Features styled: </strong>${n.numberOfFeaturesStyled.toLocaleString()}</li>`,i+="</ul>",i+='<ul class="cesium-cesiumInspector-statistics">',i+=`<li><strong>Children Union Culled: </strong>${n.numberOfTilesCulledWithChildrenUnion.toLocaleString()}</li>`,i+="</ul>",i+='<ul class="cesium-cesiumInspector-statistics">',i+=`<li><strong>Geometry Memory (MB): </strong>${QM(n.geometryByteLength)}</li><li><strong>Texture Memory (MB): </strong>${QM(n.texturesByteLength)}</li><li><strong>Batch Table Memory (MB): </strong>${QM(n.batchTableByteLength)}</li>`,i+="</ul>"),i}function tke(){let e=Bi.statistics;return` - <ul class="cesium-cesiumInspector-statistics"> - <li><strong>Geometry Memory (MB): </strong>${QM(e.geometryByteLength)}</li> - <li><strong>Texture Memory (MB): </strong>${QM(e.texturesByteLength)}</li> - </ul> - `}var gHt=[{text:"Highlight",value:df.HIGHLIGHT},{text:"Replace",value:df.REPLACE},{text:"Mix",value:df.MIX}],Q2e=new z(1,1,0,.4),_Ht=new z,_W=new z;function mc(e,t){let n=this,i=e.canvas;this._eventHandler=new Ta(i),this._scene=e,this._performanceContainer=t,this._canvas=i,this._performanceDisplay=new zA({container:t}),this._statisticsText="",this._pickStatisticsText="",this._resourceCacheStatisticsText="",this._editorError="",this.performance=!1,this.showStatistics=!0,this.showPickStatistics=!0,this.showResourceCacheStatistics=!1,this.inspectorVisible=!0,this.tilesetVisible=!1,this.displayVisible=!1,this.updateVisible=!1,this.loggingVisible=!1,this.styleVisible=!1,this.tileDebugLabelsVisible=!1,this.optimizationVisible=!1,this.styleString="{}",this.hasEnabledWireframe=!1,this._tileset=void 0,this._feature=void 0,this._tile=void 0,Se.track(this,["performance","inspectorVisible","_statisticsText","_pickStatisticsText","_resourceCacheStatisticsText","_editorError","showPickStatistics","showStatistics","showResourceCacheStatistics","tilesetVisible","displayVisible","updateVisible","loggingVisible","styleVisible","optimizationVisible","tileDebugLabelsVisible","styleString","_feature","_tile","_tileset","hasEnabledWireframe"]),this._properties=Se.observable({}),this.properties=[],Se.defineProperty(this,"properties",function(){let k=[],G=n._properties();for(let q in G)G.hasOwnProperty(q)&&k.push(q);return k});let r=Se.observable();Se.defineProperty(this,"dynamicScreenSpaceError",{get:function(){return r()},set:function(k){r(k),l(n._tileset)&&(n._tileset.dynamicScreenSpaceError=k)}}),this.dynamicScreenSpaceError=!1;let o=Se.observable();Se.defineProperty(this,"colorBlendMode",{get:function(){return o()},set:function(k){o(k),l(n._tileset)&&(n._tileset.colorBlendMode=k,n._scene.requestRender())}}),this.colorBlendMode=df.HIGHLIGHT;let s=Se.observable(),a=Se.observable();Se.defineProperty(this,"picking",{get:function(){return a()},set:function(k){a(k),k?n._eventHandler.setInputAction(function(G){let q=e.pick(G.endPosition);if(q instanceof ua?(n.feature=q,n.tile=q.content.tile):l(q)&&l(q.content)?(n.feature=void 0,n.tile=q.content.tile):(n.feature=void 0,n.tile=void 0),!!l(n._tileset)){if(s&&l(q)&&l(q.content)){let Q;e.pickPositionSupported&&(Q=e.pickPosition(G.endPosition),l(Q)&&(n._tileset.debugPickPosition=Q)),n._tileset.debugPickedTile=q.content.tile}else n._tileset.debugPickedTile=void 0;n._scene.requestRender()}},fn.MOUSE_MOVE):(n.feature=void 0,n.tile=void 0,n._eventHandler.removeInputAction(fn.MOUSE_MOVE))}}),this.picking=!0;let c=Se.observable();Se.defineProperty(this,"colorize",{get:function(){return c()},set:function(k){c(k),l(n._tileset)&&(n._tileset.debugColorizeTiles=k,n._scene.requestRender())}}),this.colorize=!1;let u=Se.observable();Se.defineProperty(this,"wireframe",{get:function(){return u()},set:function(k){u(k),l(n._tileset)&&(n._tileset.debugWireframe=k,n._scene.requestRender())}}),this.wireframe=!1;let f=Se.observable();Se.defineProperty(this,"showBoundingVolumes",{get:function(){return f()},set:function(k){f(k),l(n._tileset)&&(n._tileset.debugShowBoundingVolume=k,n._scene.requestRender())}}),this.showBoundingVolumes=!1;let d=Se.observable();Se.defineProperty(this,"showContentBoundingVolumes",{get:function(){return d()},set:function(k){d(k),l(n._tileset)&&(n._tileset.debugShowContentBoundingVolume=k,n._scene.requestRender())}}),this.showContentBoundingVolumes=!1;let p=Se.observable();Se.defineProperty(this,"showRequestVolumes",{get:function(){return p()},set:function(k){p(k),l(n._tileset)&&(n._tileset.debugShowViewerRequestVolume=k,n._scene.requestRender())}}),this.showRequestVolumes=!1;let g=Se.observable();Se.defineProperty(this,"freezeFrame",{get:function(){return g()},set:function(k){g(k),l(n._tileset)&&(n._tileset.debugFreezeFrame=k,n._scene.debugShowFrustumPlanes=k,n._scene.requestRender())}}),this.freezeFrame=!1,Se.defineProperty(this,"showOnlyPickedTileDebugLabel",{get:function(){return s()},set:function(k){s(k),l(n._tileset)&&(n._tileset.debugPickedTileLabelOnly=k,n._scene.requestRender())}}),this.showOnlyPickedTileDebugLabel=!1;let m=Se.observable();Se.defineProperty(this,"showGeometricError",{get:function(){return m()},set:function(k){m(k),l(n._tileset)&&(n._tileset.debugShowGeometricError=k,n._scene.requestRender())}}),this.showGeometricError=!1;let y=Se.observable();Se.defineProperty(this,"showRenderingStatistics",{get:function(){return y()},set:function(k){y(k),l(n._tileset)&&(n._tileset.debugShowRenderingStatistics=k,n._scene.requestRender())}}),this.showRenderingStatistics=!1;let A=Se.observable();Se.defineProperty(this,"showMemoryUsage",{get:function(){return A()},set:function(k){A(k),l(n._tileset)&&(n._tileset.debugShowMemoryUsage=k,n._scene.requestRender())}}),this.showMemoryUsage=!1;let b=Se.observable();Se.defineProperty(this,"showUrl",{get:function(){return b()},set:function(k){b(k),l(n._tileset)&&(n._tileset.debugShowUrl=k,n._scene.requestRender())}}),this.showUrl=!1;let x=Se.observable();Se.defineProperty(this,"maximumScreenSpaceError",{get:function(){return x()},set:function(k){k=Number(k),isNaN(k)||(x(k),l(n._tileset)&&(n._tileset.maximumScreenSpaceError=k))}}),this.maximumScreenSpaceError=16;let T=Se.observable();Se.defineProperty(this,"dynamicScreenSpaceErrorDensity",{get:function(){return T()},set:function(k){k=Number(k),isNaN(k)||(T(k),l(n._tileset)&&(n._tileset.dynamicScreenSpaceErrorDensity=k))}}),this.dynamicScreenSpaceErrorDensity=2e-4,this.dynamicScreenSpaceErrorDensitySliderValue=void 0,Se.defineProperty(this,"dynamicScreenSpaceErrorDensitySliderValue",{get:function(){return Math.pow(T(),1/6)},set:function(k){let G=Math.pow(k,6);T(G),l(n._tileset)&&(n._tileset.dynamicScreenSpaceErrorDensity=G)}});let E=Se.observable();Se.defineProperty(this,"dynamicScreenSpaceErrorFactor",{get:function(){return E()},set:function(k){k=Number(k),isNaN(k)||(E(k),l(n._tileset)&&(n._tileset.dynamicScreenSpaceErrorFactor=k))}}),this.dynamicScreenSpaceErrorFactor=24;let v=mHt(this),S=Se.observable();Se.defineProperty(this,"pickActive",{get:function(){return S()},set:function(k){S(k),k?n._eventHandler.setInputAction(v,fn.LEFT_CLICK):n._eventHandler.removeInputAction(fn.LEFT_CLICK)}});let I=Se.observable();Se.defineProperty(this,"pointCloudShading",{get:function(){return I()},set:function(k){I(k),l(n._tileset)&&(n._tileset.pointCloudShading.attenuation=k)}}),this.pointCloudShading=!1;let R=Se.observable();Se.defineProperty(this,"geometricErrorScale",{get:function(){return R()},set:function(k){k=Number(k),isNaN(k)||(R(k),l(n._tileset)&&(n._tileset.pointCloudShading.geometricErrorScale=k))}}),this.geometricErrorScale=1;let O=Se.observable();Se.defineProperty(this,"maximumAttenuation",{get:function(){return O()},set:function(k){k=Number(k),isNaN(k)||(O(k),l(n._tileset)&&(n._tileset.pointCloudShading.maximumAttenuation=k===0?void 0:k))}}),this.maximumAttenuation=0;let L=Se.observable();Se.defineProperty(this,"baseResolution",{get:function(){return L()},set:function(k){k=Number(k),isNaN(k)||(L(k),l(n._tileset)&&(n._tileset.pointCloudShading.baseResolution=k===0?void 0:k))}}),this.baseResolution=0;let _=Se.observable();Se.defineProperty(this,"eyeDomeLighting",{get:function(){return _()},set:function(k){_(k),l(n._tileset)&&(n._tileset.pointCloudShading.eyeDomeLighting=k)}}),this.eyeDomeLighting=!1;let C=Se.observable();Se.defineProperty(this,"eyeDomeLightingStrength",{get:function(){return C()},set:function(k){k=Number(k),isNaN(k)||(C(k),l(n._tileset)&&(n._tileset.pointCloudShading.eyeDomeLightingStrength=k))}}),this.eyeDomeLightingStrength=1;let w=Se.observable();Se.defineProperty(this,"eyeDomeLightingRadius",{get:function(){return w()},set:function(k){k=Number(k),isNaN(k)||(w(k),l(n._tileset)&&(n._tileset.pointCloudShading.eyeDomeLightingRadius=k))}}),this.eyeDomeLightingRadius=1,this.pickActive=!1;let D=Se.observable();Se.defineProperty(this,"skipLevelOfDetail",{get:function(){return D()},set:function(k){D(k),l(n._tileset)&&(n._tileset.skipLevelOfDetail=k)}}),this.skipLevelOfDetail=!0;let N=Se.observable();Se.defineProperty(this,"skipScreenSpaceErrorFactor",{get:function(){return N()},set:function(k){k=Number(k),isNaN(k)||(N(k),l(n._tileset)&&(n._tileset.skipScreenSpaceErrorFactor=k))}}),this.skipScreenSpaceErrorFactor=16;let F=Se.observable();Se.defineProperty(this,"baseScreenSpaceError",{get:function(){return F()},set:function(k){k=Number(k),isNaN(k)||(F(k),l(n._tileset)&&(n._tileset.baseScreenSpaceError=k))}}),this.baseScreenSpaceError=1024;let V=Se.observable();Se.defineProperty(this,"skipLevels",{get:function(){return V()},set:function(k){k=Number(k),isNaN(k)||(V(k),l(n._tileset)&&(n._tileset.skipLevels=k))}}),this.skipLevels=1;let B=Se.observable();Se.defineProperty(this,"immediatelyLoadDesiredLevelOfDetail",{get:function(){return B()},set:function(k){B(k),l(n._tileset)&&(n._tileset.immediatelyLoadDesiredLevelOfDetail=k)}}),this.immediatelyLoadDesiredLevelOfDetail=!1;let j=Se.observable();Se.defineProperty(this,"loadSiblings",{get:function(){return j()},set:function(k){j(k),l(n._tileset)&&(n._tileset.loadSiblings=k)}}),this.loadSiblings=!1,this._style=void 0,this._shouldStyle=!1,this._definedProperties=["properties","dynamicScreenSpaceError","colorBlendMode","picking","colorize","wireframe","showBoundingVolumes","showContentBoundingVolumes","showRequestVolumes","freezeFrame","maximumScreenSpaceError","dynamicScreenSpaceErrorDensity","baseScreenSpaceError","skipScreenSpaceErrorFactor","skipLevelOfDetail","skipLevels","immediatelyLoadDesiredLevelOfDetail","loadSiblings","dynamicScreenSpaceErrorDensitySliderValue","dynamicScreenSpaceErrorFactor","pickActive","showOnlyPickedTileDebugLabel","showGeometricError","showRenderingStatistics","showMemoryUsage","showUrl","pointCloudShading","geometricErrorScale","maximumAttenuation","baseResolution","eyeDomeLighting","eyeDomeLightingStrength","eyeDomeLightingRadius"],this._removePostRenderEvent=e.postRender.addEventListener(function(){n._update()}),l(this._tileset)||eke(this,!0)}Object.defineProperties(mc.prototype,{scene:{get:function(){return this._scene}},performanceContainer:{get:function(){return this._performanceContainer}},statisticsText:{get:function(){return this._statisticsText}},pickStatisticsText:{get:function(){return this._pickStatisticsText}},resourceCacheStatisticsText:{get:function(){return this._resourceCacheStatisticsText}},colorBlendModes:{get:function(){return gHt}},editorError:{get:function(){return this._editorError}},tileset:{get:function(){return this._tileset},set:function(e){if(this._tileset=e,this._style=void 0,this.styleString="{}",this.feature=void 0,this.tile=void 0,l(e)){this._properties(e.properties);let t=["colorize","wireframe","showBoundingVolumes","showContentBoundingVolumes","showRequestVolumes","freezeFrame","showOnlyPickedTileDebugLabel","showGeometricError","showRenderingStatistics","showMemoryUsage","showUrl"],n=t.length;for(let r=0;r<n;++r){let o=t[r];this[o]=this[o]}this.maximumScreenSpaceError=e.maximumScreenSpaceError,this.dynamicScreenSpaceError=e.dynamicScreenSpaceError,this.dynamicScreenSpaceErrorDensity=e.dynamicScreenSpaceErrorDensity,this.dynamicScreenSpaceErrorFactor=e.dynamicScreenSpaceErrorFactor,this.colorBlendMode=e.colorBlendMode,this.skipLevelOfDetail=e.skipLevelOfDetail,this.skipScreenSpaceErrorFactor=e.skipScreenSpaceErrorFactor,this.baseScreenSpaceError=e.baseScreenSpaceError,this.skipLevels=e.skipLevels,this.immediatelyLoadDesiredLevelOfDetail=e.immediatelyLoadDesiredLevelOfDetail,this.loadSiblings=e.loadSiblings,this.hasEnabledWireframe=e._enableDebugWireframe;let i=e.pointCloudShading;this.pointCloudShading=i.attenuation,this.geometricErrorScale=i.geometricErrorScale,this.maximumAttenuation=i.maximumAttenuation?i.maximumAttenuation:0,this.baseResolution=i.baseResolution?i.baseResolution:0,this.eyeDomeLighting=i.eyeDomeLighting,this.eyeDomeLightingStrength=i.eyeDomeLightingStrength,this.eyeDomeLightingRadius=i.eyeDomeLightingRadius,this._scene.requestRender()}else this._properties({});this._statisticsText=eN(e,!1),this._pickStatisticsText=eN(e,!0),this._resourceCacheStatisticsText=tke(),eke(this,!1)}},feature:{get:function(){return this._feature},set:function(e){if(this._feature===e)return;let t=this._feature;l(t)&&!t.content.isDestroyed()&&(!this.colorize&&l(this._style)?t.color=l(this._style.color)?this._style.color.evaluateColor(t,_Ht):z.WHITE:t.color=_W,this._scene.requestRender()),l(e)&&(z.clone(e.color,_W),e.color=Q2e,this._scene.requestRender()),this._feature=e}},tile:{get:function(){return this._tile},set:function(e){if(this._tile===e)return;let t=this._tile;l(t)&&!t.isDestroyed()&&!Rae(t.content)&&(t.color=_W,this._scene.requestRender()),l(e)&&!Rae(e.content)&&(z.clone(e.color,_W),e.color=Q2e,this._scene.requestRender()),this._tile=e}}});function Rae(e){if(!l(e))return!1;if(e.featuresLength>0)return!0;let t=e.innerContents;if(l(t)){let n=t.length;for(let i=0;i<n;++i)if(!Rae(t[i]))return!1;return!0}return!1}mc.prototype.togglePickTileset=function(){this.pickActive=!this.pickActive};mc.prototype.toggleInspector=function(){this.inspectorVisible=!this.inspectorVisible};mc.prototype.toggleTileset=function(){this.tilesetVisible=!this.tilesetVisible};mc.prototype.toggleDisplay=function(){this.displayVisible=!this.displayVisible};mc.prototype.toggleUpdate=function(){this.updateVisible=!this.updateVisible};mc.prototype.toggleLogging=function(){this.loggingVisible=!this.loggingVisible};mc.prototype.toggleStyle=function(){this.styleVisible=!this.styleVisible};mc.prototype.toggleTileDebugLabels=function(){this.tileDebugLabelsVisible=!this.tileDebugLabelsVisible};mc.prototype.toggleOptimization=function(){this.optimizationVisible=!this.optimizationVisible};mc.prototype.trimTilesCache=function(){l(this._tileset)&&this._tileset.trimLoadedTiles()};mc.prototype.compileStyle=function(){let e=this._tileset;if(!(!l(e)||this.styleString===JSON.stringify(e.style))){this._editorError="";try{this.styleString.length===0&&(this.styleString="{}"),this._style=new Vy(JSON.parse(this.styleString)),this._shouldStyle=!0,this._scene.requestRender()}catch(t){this._editorError=t.toString()}this.feature=this._feature,this.tile=this._tile}};mc.prototype.styleEditorKeyPress=function(e,t){if(t.keyCode===9){t.preventDefault();let n=t.target,i=n.selectionStart,r=n.selectionEnd,o=r,a=n.value.slice(i,r).split(` -`),c=a.length,u;if(t.shiftKey)for(u=0;u<c;++u)a[u][0]===" "&&(a[u][1]===" "?(a[u]=a[u].substr(2),o-=2):(a[u]=a[u].substr(1),o-=1));else for(u=0;u<c;++u)a[u]=` ${a[u]}`,o+=2;let f=a.join(` -`);n.value=n.value.slice(0,i)+f+n.value.slice(r),n.selectionStart=i!==r?i:o,n.selectionEnd=o}else t.ctrlKey&&(t.keyCode===10||t.keyCode===13)&&this.compileStyle();return!0};mc.prototype._update=function(){let e=this._tileset;if(this.performance&&this._performanceDisplay.update(),l(e)){if(e.isDestroyed()){this.tile=void 0,this.feature=void 0,this.tileset=void 0;return}let t=e.style;this._style!==e.style&&(this._shouldStyle?(e.style=this._style,this._shouldStyle=!1):(this._style=t,this.styleString=JSON.stringify(t.style,null," ")))}this.showStatistics&&(this._statisticsText=eN(e,!1),this._pickStatisticsText=eN(e,!0),this._resourceCacheStatisticsText=tke())};mc.prototype.isDestroyed=function(){return!1};mc.prototype.destroy=function(){this._eventHandler.destroy(),this._removePostRenderEvent();let e=this;return this._definedProperties.forEach(function(t){Se.getObservable(e,t).dispose()}),le(this)};mc.getStatistics=eN;var yW=mc;function AW(e,t){e=kn(e);let n=document.createElement("div"),i=document.createElement("div");i.setAttribute("data-bind","visible: performance");let r=new yW(t,i);this._viewModel=r,this._container=e,this._element=n;let o=document.createElement("div");o.textContent="3D Tiles Inspector",o.className="cesium-cesiumInspector-button",o.setAttribute("data-bind","click: toggleInspector"),n.appendChild(o),n.className="cesium-cesiumInspector cesium-3DTilesInspector",n.setAttribute("data-bind",'css: { "cesium-cesiumInspector-visible" : inspectorVisible, "cesium-cesiumInspector-hidden" : !inspectorVisible}'),e.appendChild(n);let s=document.createElement("div");s.className="cesium-cesiumInspector-dropDown",n.appendChild(s);let a=qf.createSection,c=qf.createCheckbox,u=qf.createRangeInput,f=qf.createButton,d=a(s,"Tileset","tilesetVisible","toggleTileset"),p=a(s,"Display","displayVisible","toggleDisplay"),g=a(s,"Update","updateVisible","toggleUpdate"),m=a(s,"Logging","loggingVisible","toggleLogging"),y=a(s,"Tile Debug Labels","tileDebugLabelsVisible","toggleTileDebugLabels"),A=a(s,"Style","styleVisible","toggleStyle"),b=a(s,"Optimization","optimizationVisible","toggleOptimization"),x=document.createElement("div");x.className="field-group";let T=document.createElement("label");T.className="field-label",T.appendChild(document.createTextNode("Properties: "));let E=document.createElement("div");E.setAttribute("data-bind","text: properties"),x.appendChild(T),x.appendChild(E),d.appendChild(x),d.appendChild(f("Pick Tileset","togglePickTileset","pickActive")),d.appendChild(f("Trim Tiles Cache","trimTilesCache")),d.appendChild(c("Enable Picking","picking")),p.appendChild(c("Colorize","colorize"));let v=p.appendChild(c("Wireframe","wireframe","_tileset === undefined || hasEnabledWireframe")),S=document.createElement("p");S.setAttribute("data-bind","visible: _tileset !== undefined && !hasEnabledWireframe"),S.setAttribute("class","cesium-3DTilesInspector-disabledElementsInfo"),S.innerText="Set enableDebugWireframe to true in the tileset constructor to enable this option.",v.appendChild(S),p.appendChild(c("Bounding Volumes","showBoundingVolumes")),p.appendChild(c("Content Volumes","showContentBoundingVolumes")),p.appendChild(c("Request Volumes","showRequestVolumes")),p.appendChild(c("Point Cloud Shading","pointCloudShading"));let I=document.createElement("div");I.setAttribute("data-bind","visible: pointCloudShading"),I.appendChild(u("Geometric Error Scale","geometricErrorScale",0,2,.01)),I.appendChild(u("Maximum Attenuation","maximumAttenuation",0,32,1)),I.appendChild(u("Base Resolution","baseResolution",0,1,.01)),I.appendChild(c("Eye Dome Lighting (EDL)","eyeDomeLighting")),p.appendChild(I);let R=document.createElement("div");R.setAttribute("data-bind","visible: eyeDomeLighting"),R.appendChild(u("EDL Strength","eyeDomeLightingStrength",0,2,.1)),R.appendChild(u("EDL Radius","eyeDomeLightingRadius",0,4,.1)),I.appendChild(R),g.appendChild(c("Freeze Frame","freezeFrame")),g.appendChild(c("Dynamic Screen Space Error","dynamicScreenSpaceError"));let O=document.createElement("div");O.appendChild(u("Maximum Screen Space Error","maximumScreenSpaceError",0,128,1)),g.appendChild(O);let L=document.createElement("div");L.setAttribute("data-bind","visible: dynamicScreenSpaceError"),L.appendChild(u("Screen Space Error Density","dynamicScreenSpaceErrorDensitySliderValue",0,1,.005,"dynamicScreenSpaceErrorDensity")),L.appendChild(u("Screen Space Error Factor","dynamicScreenSpaceErrorFactor",1,32,.1)),g.appendChild(L),m.appendChild(c("Performance","performance")),m.appendChild(i),m.appendChild(c("Statistics","showStatistics"));let _=document.createElement("div");_.className="cesium-3dTilesInspector-statistics",_.setAttribute("data-bind","html: statisticsText, visible: showStatistics"),m.appendChild(_),m.appendChild(c("Pick Statistics","showPickStatistics"));let C=document.createElement("div");C.className="cesium-3dTilesInspector-statistics",C.setAttribute("data-bind","html: pickStatisticsText, visible: showPickStatistics"),m.appendChild(C),m.appendChild(c("Resource Cache Statistics","showResourceCacheStatistics"));let w=document.createElement("div");w.className="cesium-3dTilesInspector-statistics",w.setAttribute("data-bind","html: resourceCacheStatisticsText, visible: showResourceCacheStatistics"),m.appendChild(w);let D=document.createElement("div");A.appendChild(D),D.appendChild(document.createTextNode("Color Blend Mode: "));let N=document.createElement("select");N.setAttribute("data-bind",'options: colorBlendModes, optionsText: "text", optionsValue: "value", value: colorBlendMode'),D.appendChild(N);let F=document.createElement("textarea");F.setAttribute("data-bind","textInput: styleString, event: { keydown: styleEditorKeyPress }"),D.className="cesium-cesiumInspector-styleEditor",D.appendChild(F);let V=f("Compile (Ctrl+Enter)","compileStyle");D.appendChild(V);let B=document.createElement("div");B.className="cesium-cesiumInspector-error",B.setAttribute("data-bind","text: editorError"),D.appendChild(B),y.appendChild(c("Show Picked Only","showOnlyPickedTileDebugLabel")),y.appendChild(c("Geometric Error","showGeometricError")),y.appendChild(c("Rendering Statistics","showRenderingStatistics")),y.appendChild(c("Memory Usage (MB)","showMemoryUsage")),y.appendChild(c("Url","showUrl")),b.appendChild(c("Skip Tile LODs","skipLevelOfDetail"));let j=document.createElement("div");j.appendChild(u("Skip SSE Factor","skipScreenSpaceErrorFactor",1,50,1)),b.appendChild(j);let k=document.createElement("div");k.appendChild(u("SSE before skipping LOD","baseScreenSpaceError",0,4096,1)),b.appendChild(k);let G=document.createElement("div");G.appendChild(u("Min. levels to skip","skipLevels",0,10,1)),b.appendChild(G),b.appendChild(c("Load only tiles that meet the max SSE.","immediatelyLoadDesiredLevelOfDetail")),b.appendChild(c("Load siblings of visible tiles","loadSiblings")),Se.applyBindings(r,n)}Object.defineProperties(AW.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}}});AW.prototype.isDestroyed=function(){return!1};AW.prototype.destroy=function(){return Se.cleanNode(this._element),this._container.removeChild(this._element),this.viewModel.destroy(),le(this)};var bW=AW;function yHt(e,t){t.currentTarget.parentElement.parentElement.querySelector(`#${e.name}-expander`).classList.toggle("active"),t.currentTarget.textContent=t.currentTarget.textContent==="+"?"-":"+"}function ike(e,t){Se.track(e);for(let n=0;n<e.sublayers.length;n++)ike(e.sublayers[n],t)}function xW(e){return e.modelName==="FullModel"}function rke(e){return e.modelName==="Overview"}function oke(e){return rke(e)||xW(e)}function nke(e,t){if(oke(e)){e.visibility=!1;for(let i=0;i<e.sublayers.length;i++)e.sublayers[i].visibility=!0;let n={name:e.name,modelName:e.modelName,disable:Se.observable(!1),index:t.sublayers.length};return t.topLayers.push(n),t.sublayers.push(e),n}}function AHt(e,t){if(oke(e)){t.sublayers.forEach(i=>i.visibility=!1),t.sublayers[e.index].visibility=!0;let n=document.getElementById("bsl-wrapper");xW(e)?(t.currentLevel=t.selectedLevel,n.style.display="block"):(t.selectedLevel=t.currentLevel,t.currentLevel="All",n.style.display="none")}}async function bHt(e,t){try{let n=e.getAttributeNames();for(let i=0;i<n.length;i++)if(n[i]==="BldgLevel"){let r=e.getAttributeValues(n[i]);for(let o=0;o<r.length;o++)t.push(r[o])}t.sort((i,r)=>i-r),t.unshift("All")}catch(n){console.log(`There was an error getting attributes: ${n}`)}}function xHt(e){let t=this;this.levels=[],this.viewModel={sublayers:[],levels:this.levels,currentLevel:Se.observable(),selectedLevel:"All",topLayers:[{name:"Select a layer to explore...",disable:Se.observable(!0),index:-1}],currentLayer:Se.observable(),expandClickHandler:yHt,setOptionDisable:function(i,r){Se.applyBindingsToNode(i,{disable:r.disable},r)},defaultLayer:void 0},this.viewModel.currentLayer.subscribe(function(i){AHt(i,t.viewModel)});let n=e.sublayers;for(let i=0;i<n.length;i++){ike(n[i],this.viewModel);let r=nke(n[i],this.viewModel);l(r)&&(rke(r)||!l(this.viewModel.defaultLayer)&&xW(r))&&(this.viewModel.defaultLayer=r)}if(this.viewModel.topLayers.length===1&&n.length>0){e.show=!1;let i={name:"Full Model",modelName:"FullModel",visibility:e.show,sublayers:e.sublayers};this.viewModel.defaultLayer=nke(i,this.viewModel),this.viewModel.currentLayer.subscribe(function(r){e.show=xW(r)})}else this.viewModel.topLayers.length===1&&(this.viewModel.topLayers[0].name="Building layers not found");return bHt(e,this.levels),this.viewModel.currentLevel.subscribe(function(i){i!=="All"?e.filterByAttributes([{name:"BldgLevel",values:[i]}]):e.filterByAttributes()}),this.viewModel}var TW=xHt;function THt(e,t){let n=document.getElementById(e),i=document.createElement("div");i.classList.add("cesium-viewer-i3s-explorer"),i.innerHTML=` + © <a href="https://www.openstreetmap.org/about/" target="_blank">OpenStreetMap contributors</a>`})}})),e.push(new yo({name:"Sentinel-2",iconUrl:Zt("Widgets/Images/ImageryProviders/sentinel-2.png"),tooltip:"Sentinel-2 cloudless by EOX IT Services GmbH (Contains modified Copernicus Sentinel data 2016 and 2017).",category:"Cesium ion",creationFunction:function(){return Ou.fromAssetId(3954)}})),e.push(new yo({name:"Blue Marble",iconUrl:Zt("Widgets/Images/ImageryProviders/blueMarble.png"),tooltip:"Blue Marble Next Generation July, 2004 imagery from NASA.",category:"Cesium ion",creationFunction:function(){return Ou.fromAssetId(3845)}})),e.push(new yo({name:"Earth at night",iconUrl:Zt("Widgets/Images/ImageryProviders/earthAtNight.png"),tooltip:"The Earth at night, also known as The Black Marble, is a 500 meter resolution global composite imagery layer released by NASA.",category:"Cesium ion",creationFunction:function(){return Ou.fromAssetId(3812)}})),e.push(new yo({name:"Natural Earth\xA0II",iconUrl:Zt("Widgets/Images/ImageryProviders/naturalEarthII.png"),tooltip:`Natural Earth II, darkened for contrast. +http://www.naturalearthdata.com/`,category:"Cesium ion",creationFunction:function(){return Ix.fromUrl(Zt("Assets/Textures/NaturalEarthII"))}})),e.push(new yo({name:"Google Maps Satellite",iconUrl:Zt("Widgets/Images/ImageryProviders/googleSatellite.png"),tooltip:"Imagery from Google Maps",category:"Cesium ion",creationFunction:function(){return Ou.fromAssetId(3830182)}})),e.push(new yo({name:"Google Maps Satellite with Labels",iconUrl:Zt("Widgets/Images/ImageryProviders/googleSatelliteLabels.png"),tooltip:"Imagery with place labels from Google Maps",category:"Cesium ion",creationFunction:function(){return Ou.fromAssetId(3830183)}})),e.push(new yo({name:"Google Maps Roadmap",iconUrl:Zt("Widgets/Images/ImageryProviders/googleRoadmap.png"),tooltip:"Labeled roads and other features on a base landscape from Google Maps",category:"Cesium ion",creationFunction:function(){return Ou.fromAssetId(3830184)}})),e.push(new yo({name:"Google Maps Contour",iconUrl:Zt("Widgets/Images/ImageryProviders/googleContour.png"),tooltip:"Hillshade mapping, contour lines, natural features (roadmap features hidden) from Google Maps",category:"Cesium ion",creationFunction:function(){return Ou.fromAssetId(3830186)}})),e.push(new yo({name:"Azure Maps Aerial",iconUrl:Zt("Widgets/Images/ImageryProviders/azureAerial.png"),tooltip:"Imagery from Azure Maps",category:"Cesium ion",creationFunction:function(){return Ou.fromAssetId(3891168)}})),e.push(new yo({name:"Azure Maps Roads",iconUrl:Zt("Widgets/Images/ImageryProviders/azureRoads.png"),tooltip:"Labeled roads and other features on a base landscape from Azure Maps",category:"Cesium ion",creationFunction:function(){return Ou.fromAssetId(3891169)}})),e}var dW=pHt;function gHt(){let e=[];return e.push(new yo({name:"WGS84 Ellipsoid",iconUrl:Zt("Widgets/Images/TerrainProviders/Ellipsoid.png"),tooltip:"WGS84 standard ellipsoid, also known as EPSG:4326",category:"Cesium ion",creationFunction:function(){return new Ug({ellipsoid:ee.WGS84})}})),e.push(new yo({name:"Cesium World Terrain",iconUrl:Zt("Widgets/Images/TerrainProviders/CesiumWorldTerrain.png"),tooltip:"High-resolution global terrain tileset curated from several datasources and hosted by Cesium ion",category:"Cesium ion",creationFunction:function(){return _I({requestWaterMask:!0,requestVertexNormals:!0})}})),e}var hW=gHt;var nke=1e3;function Dm(e){l(e.geocoderServices)?this._geocoderServices=e.geocoderServices:this._geocoderServices=[new AI({scene:e.scene})],this._viewContainer=e.container,this._scene=e.scene,this._flightDuration=e.flightDuration,this._searchText="",this._isSearchInProgress=!1,this._wasGeocodeCancelled=!1,this._previousCredits=[],this._complete=new be,this._suggestions=[],this._selectedSuggestion=void 0,this._showSuggestions=!0,this._handleArrowDown=rke,this._handleArrowUp=ike;let t=this;this._suggestionsVisible=Se.pureComputed(function(){let r=Se.getObservable(t,"_suggestions")().length>0,o=Se.getObservable(t,"_showSuggestions")();return r&&o}),this._searchCommand=On(function(i){if(i=i??nE.SEARCH,t._focusTextbox=!1,l(t._selectedSuggestion))return t.activateSuggestion(t._selectedSuggestion),!1;if(t.hideSuggestions(),t.isSearchInProgress)THt(t);else return bHt(t,t._geocoderServices,i)}),this.deselectSuggestion=function(){t._selectedSuggestion=void 0},this.handleKeyDown=function(i,r){let o=r.key==="ArrowDown"||r.key==="Down"||r.keyCode===40,s=r.key==="ArrowUp"||r.key==="Up"||r.keyCode===38;return(o||s)&&r.preventDefault(),!0},this.handleKeyUp=function(i,r){let o=r.key==="ArrowDown"||r.key==="Down"||r.keyCode===40,s=r.key==="ArrowUp"||r.key==="Up"||r.keyCode===38,a=r.key==="Enter"||r.keyCode===13;return s?ike(t):o?rke(t):a&&t._searchCommand(),!0},this.activateSuggestion=function(i){t.hideSuggestions(),t._searchText=i.displayName;let r=i.destination;ake(t),t.destinationFound(t,r)},this.hideSuggestions=function(){t._showSuggestions=!1,t._selectedSuggestion=void 0},this.showSuggestions=function(){t._showSuggestions=!0},this.handleMouseover=function(i,r){i!==t._selectedSuggestion&&(t._selectedSuggestion=i)},this.keepExpanded=!1,this.autoComplete=e.autocomplete??!0,this.destinationFound=e.destinationFound??Dm.flyToDestination,this._focusTextbox=!1,Se.track(this,["_searchText","_isSearchInProgress","keepExpanded","_suggestions","_selectedSuggestion","_showSuggestions","_focusTextbox"]);let n=Se.getObservable(this,"_searchText");n.extend({rateLimit:{timeout:500}}),this._suggestionSubscription=n.subscribe(function(){Dm._updateSearchSuggestions(t)}),this.isSearchInProgress=void 0,Se.defineProperty(this,"isSearchInProgress",{get:function(){return this._isSearchInProgress}}),this.searchText=void 0,Se.defineProperty(this,"searchText",{get:function(){return this.isSearchInProgress?"Searching...":this._searchText},set:function(i){this._searchText=i}}),this.flightDuration=void 0,Se.defineProperty(this,"flightDuration",{get:function(){return this._flightDuration},set:function(i){this._flightDuration=i}})}Object.defineProperties(Dm.prototype,{complete:{get:function(){return this._complete}},scene:{get:function(){return this._scene}},search:{get:function(){return this._searchCommand}},selectedSuggestion:{get:function(){return this._selectedSuggestion}},suggestions:{get:function(){return this._suggestions}}});function ike(e){if(e._suggestions.length===0)return;let t=e._suggestions.indexOf(e._selectedSuggestion);if(t===-1||t===0){e._selectedSuggestion=void 0;return}let n=t-1;e._selectedSuggestion=e._suggestions[n],Dm._adjustSuggestionsScroll(e,n)}function rke(e){if(e._suggestions.length===0)return;let t=e._suggestions.length,i=(e._suggestions.indexOf(e._selectedSuggestion)+1)%t;e._selectedSuggestion=e._suggestions[i],Dm._adjustSuggestionsScroll(e,i)}function _Ht(e,t){let n=l(t)?t.availability:void 0;return l(n)?VS(t,[e]).then(function(i){return e=i[0],e.height+=nke,e}):(e.height+=nke,Promise.resolve(e))}function yHt(e,t){let n=e._scene,i=n.ellipsoid,r=n.camera,o=n.terrainProvider,s=t,a;return t instanceof ie?P.equalsEpsilon(t.south,t.north,P.EPSILON7)&&P.equalsEpsilon(t.east,t.west,P.EPSILON7)?t=ie.center(t):a=jS(t,n):t=i.cartesianToCartographic(t),l(a)||(a=_Ht(t,o)),a.then(function(c){s=i.cartographicToCartesian(c)}).finally(function(){r.flyTo({destination:s,complete:function(){e._complete.raiseEvent()},duration:e._flightDuration,endTransform:M.IDENTITY})})}async function AHt(e,t,n){try{return{state:"fulfilled",value:await e.geocode(t,n),credits:e.credit}}catch(i){return{state:"rejected",reason:i}}}async function bHt(e,t,n){let i=e._searchText;if(ske(i)){e.showSuggestions();return}e._isSearchInProgress=!0,e._wasGeocodeCancelled=!1;let r,o;for(r=0;r<t.length;r++){if(e._wasGeocodeCancelled)return;if(o=await AHt(t[r],i,n),l(o)&&o.state==="fulfilled"&&o.value.length>0)break}if(e._wasGeocodeCancelled)return;e._isSearchInProgress=!1,Mae(e);let s=o.value;if(o.state==="fulfilled"&&l(s)&&s.length>0){e._searchText=s[0].displayName,e.destinationFound(e,s[0].destination);let a=oke(e,IM.getCreditsFromResult(s[0]));l(a)||Oae(e,t[r].credit);return}e._searchText=`${i} (not found)`}function Oae(e,t){l(t)&&!e._scene.isDestroyed()&&!e._scene.frameState.creditDisplay.isDestroyed()&&(e._scene.frameState.creditDisplay.addStaticCredit(t),e._previousCredits.push(t))}function oke(e,t){return l(t)&&t.forEach(n=>Oae(e,n)),t}function Mae(e){!e._scene.isDestroyed()&&!e._scene.frameState.creditDisplay.isDestroyed()&&e._previousCredits.forEach(t=>{e._scene.frameState.creditDisplay.removeStaticCredit(t)}),e._previousCredits.length=0}function xHt(e,t){let n=kn(e._viewContainer),i=n.getElementsByClassName("search-results")[0],o=n.getElementsByTagName("li")[t];if(t===0){i.scrollTop=0;return}let s=o.offsetTop;s+o.clientHeight>i.clientHeight?i.scrollTop=s+o.clientHeight:s<i.scrollTop&&(i.scrollTop=s)}function THt(e){e._isSearchInProgress&&(e._isSearchInProgress=!1,e._wasGeocodeCancelled=!0)}function ske(e){return/^\s*$/.test(e)}function ake(e){Se.getObservable(e,"_suggestions").removeAll()}async function EHt(e){if(!e.autoComplete)return;let t=e._searchText;if(ake(e),Mae(e),!ske(t))for(let n of e._geocoderServices){let i=await n.geocode(t,nE.AUTOCOMPLETE);if(e._suggestions=e._suggestions.concat(i),i.length>0){let r=!0;i.forEach(o=>{let s=IM.getCreditsFromResult(o);r=r&&!l(s),oke(e,s)}),r&&Oae(e,n.credit)}if(e._suggestions.length>=5)return}}Dm.flyToDestination=yHt;Dm._updateSearchSuggestions=EHt;Dm._adjustSuggestionsScroll=xHt;Dm.prototype.isDestroyed=function(){return!1};Dm.prototype.destroy=function(){return this._suggestionSubscription.dispose(),Mae(this),le(this)};var mW=Dm;var CHt="M29.772,26.433l-7.126-7.126c0.96-1.583,1.523-3.435,1.524-5.421C24.169,8.093,19.478,3.401,13.688,3.399C7.897,3.401,3.204,8.093,3.204,13.885c0,5.789,4.693,10.481,10.484,10.481c1.987,0,3.839-0.563,5.422-1.523l7.128,7.127L29.772,26.433zM7.203,13.885c0.006-3.582,2.903-6.478,6.484-6.486c3.579,0.008,6.478,2.904,6.484,6.486c-0.007,3.58-2.905,6.476-6.484,6.484C10.106,20.361,7.209,17.465,7.203,13.885z",vHt="M24.778,21.419 19.276,15.917 24.777,10.415 21.949,7.585 16.447,13.087 10.945,7.585 8.117,10.415 13.618,15.917 8.116,21.419 10.946,24.248 16.447,18.746 21.948,24.248z";function pW(e){let t=kn(e.container),n=new mW(e);n._startSearchPath=CHt,n._stopSearchPath=vHt;let i=document.createElement("form");i.setAttribute("data-bind","submit: search");let r=document.createElement("input");r.type="search",r.className="cesium-geocoder-input",r.setAttribute("placeholder","Enter an address or landmark..."),r.setAttribute("data-bind",'textInput: searchText,disable: isSearchInProgress,event: { keyup: handleKeyUp, keydown: handleKeyDown, mouseover: deselectSuggestion },css: { "cesium-geocoder-input-wide" : keepExpanded || searchText.length > 0 },hasFocus: _focusTextbox'),this._onTextBoxFocus=function(){setTimeout(function(){r.select()},0)},r.addEventListener("focus",this._onTextBoxFocus,!1),i.appendChild(r),this._textBox=r;let o=document.createElement("span");o.className="cesium-geocoder-searchButton",o.setAttribute("data-bind","click: search,cesiumSvgPath: { path: isSearchInProgress ? _stopSearchPath : _startSearchPath, width: 32, height: 32 }"),i.appendChild(o),t.appendChild(i);let s=document.createElement("div");s.className="search-results",s.setAttribute("data-bind","visible: _suggestionsVisible");let a=document.createElement("ul");a.setAttribute("data-bind","foreach: _suggestions");let c=document.createElement("li");a.appendChild(c),c.setAttribute("data-bind","text: $data.displayName, click: $parent.activateSuggestion, event: { mouseover: $parent.handleMouseover}, css: { active: $data === $parent._selectedSuggestion }"),s.appendChild(a),t.appendChild(s),Se.applyBindings(n,i),Se.applyBindings(n,s),this._container=t,this._searchSuggestionsContainer=s,this._viewModel=n,this._form=i,this._onInputBegin=function(u){let f=u.target;typeof u.composedPath=="function"&&(f=u.composedPath()[0]),t.contains(f)||(n._focusTextbox=!1,n.hideSuggestions())},this._onInputEnd=function(u){n._focusTextbox=!0,n.showSuggestions()},dn.supportsPointerEvents()?(document.addEventListener("pointerdown",this._onInputBegin,!0),t.addEventListener("pointerup",this._onInputEnd,!0),t.addEventListener("pointercancel",this._onInputEnd,!0)):(document.addEventListener("mousedown",this._onInputBegin,!0),t.addEventListener("mouseup",this._onInputEnd,!0),document.addEventListener("touchstart",this._onInputBegin,!0),t.addEventListener("touchend",this._onInputEnd,!0),t.addEventListener("touchcancel",this._onInputEnd,!0))}Object.defineProperties(pW.prototype,{container:{get:function(){return this._container}},searchSuggestionsContainer:{get:function(){return this._searchSuggestionsContainer}},viewModel:{get:function(){return this._viewModel}}});pW.prototype.isDestroyed=function(){return!1};pW.prototype.destroy=function(){let e=this._container;return dn.supportsPointerEvents()?(document.removeEventListener("pointerdown",this._onInputBegin,!0),e.removeEventListener("pointerup",this._onInputEnd,!0)):(document.removeEventListener("mousedown",this._onInputBegin,!0),e.removeEventListener("mouseup",this._onInputEnd,!0),document.removeEventListener("touchstart",this._onInputBegin,!0),e.removeEventListener("touchend",this._onInputEnd,!0)),this._viewModel.destroy(),Se.cleanNode(this._form),Se.cleanNode(this._searchSuggestionsContainer),e.removeChild(this._form),e.removeChild(this._searchSuggestionsContainer),this._textBox.removeEventListener("focus",this._onTextBoxFocus,!1),le(this)};var gW=pW;function cke(e,t){this._scene=e,this._duration=t;let n=this;this._command=On(function(){n._scene.camera.flyHome(n._duration)}),this.tooltip="View Home",Se.track(this,["tooltip"])}Object.defineProperties(cke.prototype,{scene:{get:function(){return this._scene}},command:{get:function(){return this._command}},duration:{get:function(){return this._duration},set:function(e){this._duration=e}}});var _W=cke;function yW(e,t,n){e=kn(e);let i=new _W(t,n);i._svgPath="M14,4l-10,8.75h20l-4.25-3.7188v-4.6562h-2.812v2.1875l-2.938-2.5625zm-7.0938,9.906v10.094h14.094v-10.094h-14.094zm2.1876,2.313h3.3122v4.25h-3.3122v-4.25zm5.8442,1.281h3.406v6.438h-3.406v-6.438z";let r=document.createElement("button");r.type="button",r.className="cesium-button cesium-toolbar-button cesium-home-button",r.setAttribute("data-bind","attr: { title: tooltip },click: command,cesiumSvgPath: { path: _svgPath, width: 28, height: 28 }"),e.appendChild(r),Se.applyBindings(i,r),this._container=e,this._viewModel=i,this._element=r}Object.defineProperties(yW.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}}});yW.prototype.isDestroyed=function(){return!1};yW.prototype.destroy=function(){return Se.cleanNode(this._element),this._container.removeChild(this._element),le(this)};var AW=yW;function bW(e,t){l(t)||(t=document.body),t=kn(t);let n=this,i=Se.observable(ss.fullscreen),r=Se.observable(ss.enabled),o=t.ownerDocument;this.isFullscreen=void 0,Se.defineProperty(this,"isFullscreen",{get:function(){return i()}}),this.isFullscreenEnabled=void 0,Se.defineProperty(this,"isFullscreenEnabled",{get:function(){return r()},set:function(s){r(s&&ss.enabled)}}),this.tooltip=void 0,Se.defineProperty(this,"tooltip",function(){return this.isFullscreenEnabled?i()?"Exit full screen":"Full screen":"Full screen unavailable"}),this._command=On(function(){ss.fullscreen?ss.exitFullscreen():ss.requestFullscreen(n._fullscreenElement)},Se.getObservable(this,"isFullscreenEnabled")),this._fullscreenElement=kn(e)??o.body,this._callback=function(){i(ss.fullscreen)},o.addEventListener(ss.changeEventName,this._callback)}Object.defineProperties(bW.prototype,{fullscreenElement:{get:function(){return this._fullscreenElement},set:function(e){this._fullscreenElement=e}},command:{get:function(){return this._command}}});bW.prototype.isDestroyed=function(){return!1};bW.prototype.destroy=function(){document.removeEventListener(ss.changeEventName,this._callback),le(this)};var xW=bW;var SHt="M 83.96875 17.5625 L 83.96875 17.59375 L 76.65625 24.875 L 97.09375 24.96875 L 76.09375 45.96875 L 81.9375 51.8125 L 102.78125 30.9375 L 102.875 51.15625 L 110.15625 43.875 L 110.1875 17.59375 L 83.96875 17.5625 z M 44.125 17.59375 L 17.90625 17.625 L 17.9375 43.90625 L 25.21875 51.1875 L 25.3125 30.96875 L 46.15625 51.8125 L 52 45.96875 L 31 25 L 51.4375 24.90625 L 44.125 17.59375 z M 46.0625 76.03125 L 25.1875 96.875 L 25.09375 76.65625 L 17.8125 83.9375 L 17.8125 110.21875 L 44 110.25 L 51.3125 102.9375 L 30.90625 102.84375 L 51.875 81.875 L 46.0625 76.03125 z M 82 76.15625 L 76.15625 82 L 97.15625 103 L 76.71875 103.0625 L 84.03125 110.375 L 110.25 110.34375 L 110.21875 84.0625 L 102.9375 76.8125 L 102.84375 97 L 82 76.15625 z",wHt="M 104.34375 17.5625 L 83.5 38.4375 L 83.40625 18.21875 L 76.125 25.5 L 76.09375 51.78125 L 102.3125 51.8125 L 102.3125 51.78125 L 109.625 44.5 L 89.1875 44.40625 L 110.1875 23.40625 L 104.34375 17.5625 z M 23.75 17.59375 L 17.90625 23.4375 L 38.90625 44.4375 L 18.5 44.53125 L 25.78125 51.8125 L 52 51.78125 L 51.96875 25.53125 L 44.6875 18.25 L 44.625 38.46875 L 23.75 17.59375 z M 25.6875 76.03125 L 18.375 83.3125 L 38.78125 83.40625 L 17.8125 104.40625 L 23.625 110.25 L 44.5 89.375 L 44.59375 109.59375 L 51.875 102.3125 L 51.875 76.0625 L 25.6875 76.03125 z M 102.375 76.15625 L 76.15625 76.1875 L 76.1875 102.4375 L 83.46875 109.71875 L 83.5625 89.53125 L 104.40625 110.375 L 110.25 104.53125 L 89.25 83.53125 L 109.6875 83.46875 L 102.375 76.15625 z";function TW(e,t){e=kn(e);let n=new xW(t,e);n._exitFullScreenPath=wHt,n._enterFullScreenPath=SHt;let i=document.createElement("button");i.type="button",i.className="cesium-button cesium-fullscreenButton",i.setAttribute("data-bind","attr: { title: tooltip },click: command,enable: isFullscreenEnabled,cesiumSvgPath: { path: isFullscreen ? _exitFullScreenPath : _enterFullScreenPath, width: 128, height: 128 }"),e.appendChild(i),Se.applyBindings(n,i),this._container=e,this._viewModel=n,this._element=i}Object.defineProperties(TW.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}}});TW.prototype.isDestroyed=function(){return!1};TW.prototype.destroy=function(){return this._viewModel.destroy(),Se.cleanNode(this._element),this._container.removeChild(this._element),le(this)};var EW=TW;function IHt(e,t){t.currentTarget.parentElement.parentElement.querySelector(`#${e.name}-expander`).classList.toggle("active"),t.currentTarget.textContent=t.currentTarget.textContent==="+"?"-":"+"}function uke(e,t){Se.track(e);for(let n=0;n<e.sublayers.length;n++)uke(e.sublayers[n],t)}function CW(e){return e.modelName==="FullModel"}function fke(e){return e.modelName==="Overview"}function dke(e){return fke(e)||CW(e)}function lke(e,t){if(dke(e)){e.visibility=!1;for(let i=0;i<e.sublayers.length;i++)e.sublayers[i].visibility=!0;let n={name:e.name,modelName:e.modelName,disable:Se.observable(!1),index:t.sublayers.length};return t.topLayers.push(n),t.sublayers.push(e),n}}function PHt(e,t){if(dke(e)){t.sublayers.forEach(i=>i.visibility=!1),t.sublayers[e.index].visibility=!0;let n=document.getElementById("bsl-wrapper");CW(e)?(t.currentLevel=t.selectedLevel,n.style.display="block"):(t.selectedLevel=t.currentLevel,t.currentLevel="All",n.style.display="none")}}async function DHt(e,t){try{let n=e.getAttributeNames();for(let i=0;i<n.length;i++)if(n[i]==="BldgLevel"){let r=e.getAttributeValues(n[i]);for(let o=0;o<r.length;o++)t.push(r[o])}t.sort((i,r)=>i-r),t.unshift("All")}catch(n){console.log(`There was an error getting attributes: ${n}`)}}function RHt(e){let t=this;this.levels=[],this.viewModel={sublayers:[],levels:this.levels,currentLevel:Se.observable(),selectedLevel:"All",topLayers:[{name:"Select a layer to explore...",disable:Se.observable(!0),index:-1}],currentLayer:Se.observable(),expandClickHandler:IHt,setOptionDisable:function(i,r){Se.applyBindingsToNode(i,{disable:r.disable},r)},defaultLayer:void 0},this.viewModel.currentLayer.subscribe(function(i){PHt(i,t.viewModel)});let n=e.sublayers;for(let i=0;i<n.length;i++){uke(n[i],this.viewModel);let r=lke(n[i],this.viewModel);l(r)&&(fke(r)||!l(this.viewModel.defaultLayer)&&CW(r))&&(this.viewModel.defaultLayer=r)}if(this.viewModel.topLayers.length===1&&n.length>0){e.show=!1;let i={name:"Full Model",modelName:"FullModel",visibility:e.show,sublayers:e.sublayers};this.viewModel.defaultLayer=lke(i,this.viewModel),this.viewModel.currentLayer.subscribe(function(r){e.show=CW(r)})}else this.viewModel.topLayers.length===1&&(this.viewModel.topLayers[0].name="Building layers not found");return DHt(e,this.levels),this.viewModel.currentLevel.subscribe(function(i){i!=="All"?e.filterByAttributes([{name:"BldgLevel",values:[i]}]):e.filterByAttributes()}),this.viewModel}var vW=RHt;function OHt(e,t){let n=document.getElementById(e),i=document.createElement("div");i.classList.add("cesium-viewer-i3s-explorer"),i.innerHTML=` <h3>Building explorer</h3> <select data-bind="options: topLayers, optionsText: 'name', optionsAfterRender: setOptionDisable, value: currentLayer" @@ -12813,9 +12813,9 @@ http://www.naturalearthdata.com/`,category:"Cesium ion",creationFunction:functio </li> </ul> </ul> - </div>`,n.appendChild(i);let r=new TW(t);Se.track(r),Se.applyBindings(r,n),l(r.defaultLayer)&&(r.currentLayer=r.defaultLayer)}var ske=THt;function ake(){this.showInstructions=!1;let e=this;this._command=On(function(){e.showInstructions=!e.showInstructions}),this._showClick=On(function(){e._touch=!1}),this._showTouch=On(function(){e._touch=!0}),this._touch=!1,this.tooltip="Navigation Instructions",Se.track(this,["tooltip","showInstructions","_touch"])}Object.defineProperties(ake.prototype,{command:{get:function(){return this._command}},showClick:{get:function(){return this._showClick}},showTouch:{get:function(){return this._showTouch}}});var EW=ake;function CW(e){let t=kn(e.container),n=new EW,i=e.instructionsInitiallyVisible??!1;n.showInstructions=i,n._svgPath="M16,1.466C7.973,1.466,1.466,7.973,1.466,16c0,8.027,6.507,14.534,14.534,14.534c8.027,0,14.534-6.507,14.534-14.534C30.534,7.973,24.027,1.466,16,1.466z M17.328,24.371h-2.707v-2.596h2.707V24.371zM17.328,19.003v0.858h-2.707v-1.057c0-3.19,3.63-3.696,3.63-5.963c0-1.034-0.924-1.826-2.134-1.826c-1.254,0-2.354,0.924-2.354,0.924l-1.541-1.915c0,0,1.519-1.584,4.137-1.584c2.487,0,4.796,1.54,4.796,4.136C21.156,16.208,17.328,16.627,17.328,19.003z";let r=document.createElement("span");r.className="cesium-navigationHelpButton-wrapper",t.appendChild(r);let o=document.createElement("button");o.type="button",o.className="cesium-button cesium-toolbar-button cesium-navigation-help-button",o.setAttribute("data-bind","attr: { title: tooltip },click: command,cesiumSvgPath: { path: _svgPath, width: 32, height: 32 }"),r.appendChild(o);let s=document.createElement("div");s.className="cesium-navigation-help",s.setAttribute("data-bind",'css: { "cesium-navigation-help-visible" : showInstructions}'),r.appendChild(s);let a=document.createElement("button");a.type="button",a.className="cesium-navigation-button cesium-navigation-button-left",a.setAttribute("data-bind",'click: showClick, css: {"cesium-navigation-button-selected": !_touch, "cesium-navigation-button-unselected": _touch}');let c=document.createElement("img");c.src=Zt("Widgets/Images/NavigationHelp/Mouse.svg"),c.className="cesium-navigation-button-icon",c.style.width="25px",c.style.height="25px",a.appendChild(c),a.appendChild(document.createTextNode("Mouse"));let u=document.createElement("button");u.type="button",u.className="cesium-navigation-button cesium-navigation-button-right",u.setAttribute("data-bind",'click: showTouch, css: {"cesium-navigation-button-selected": _touch, "cesium-navigation-button-unselected": !_touch}');let f=document.createElement("img");f.src=Zt("Widgets/Images/NavigationHelp/Touch.svg"),f.className="cesium-navigation-button-icon",f.style.width="25px",f.style.height="25px",u.appendChild(f),u.appendChild(document.createTextNode("Touch")),s.appendChild(a),s.appendChild(u);let d=document.createElement("div");d.className="cesium-click-navigation-help cesium-navigation-help-instructions",d.setAttribute("data-bind",'css: { "cesium-click-navigation-help-visible" : !_touch}'),d.innerHTML=` <table> <tr> <td><img src="${Zt("Widgets/Images/NavigationHelp/MouseLeft.svg")}" width="48" height="48" /></td> <td> <div class="cesium-navigation-help-pan">Pan view</div> <div class="cesium-navigation-help-details">Left click + drag</div> </td> </tr> <tr> <td><img src="${Zt("Widgets/Images/NavigationHelp/MouseRight.svg")}" width="48" height="48" /></td> <td> <div class="cesium-navigation-help-zoom">Zoom view</div> <div class="cesium-navigation-help-details">Right click + drag, or</div> <div class="cesium-navigation-help-details">Mouse wheel scroll</div> </td> </tr> <tr> <td><img src="${Zt("Widgets/Images/NavigationHelp/MouseMiddle.svg")}" width="48" height="48" /></td> <td> <div class="cesium-navigation-help-rotate">Rotate view</div> <div class="cesium-navigation-help-details">Middle click + drag, or</div> <div class="cesium-navigation-help-details">CTRL + Left/Right click + drag</div> </td> </tr> </table>`,s.appendChild(d);let p=document.createElement("div");p.className="cesium-touch-navigation-help cesium-navigation-help-instructions",p.setAttribute("data-bind",'css: { "cesium-touch-navigation-help-visible" : _touch}'),p.innerHTML=` <table> <tr> <td><img src="${Zt("Widgets/Images/NavigationHelp/TouchDrag.svg")}" width="70" height="48" /></td> <td> <div class="cesium-navigation-help-pan">Pan view</div> <div class="cesium-navigation-help-details">One finger drag</div> </td> </tr> <tr> <td><img src="${Zt("Widgets/Images/NavigationHelp/TouchZoom.svg")}" width="70" height="48" /></td> <td> <div class="cesium-navigation-help-zoom">Zoom view</div> <div class="cesium-navigation-help-details">Two finger pinch</div> </td> </tr> <tr> <td><img src="${Zt("Widgets/Images/NavigationHelp/TouchTilt.svg")}" width="70" height="48" /></td> <td> <div class="cesium-navigation-help-rotate">Tilt view</div> <div class="cesium-navigation-help-details">Two finger drag, same direction</div> </td> </tr> <tr> <td><img src="${Zt("Widgets/Images/NavigationHelp/TouchRotate.svg")}" width="70" height="48" /></td> <td> <div class="cesium-navigation-help-tilt">Rotate view</div> <div class="cesium-navigation-help-details">Two finger drag, opposite direction</div> </td> </tr> </table>`,s.appendChild(p),Se.applyBindings(n,r),this._container=t,this._viewModel=n,this._wrapper=r,this._closeInstructions=function(g){r.contains(g.target)||(n.showInstructions=!1)},dn.supportsPointerEvents()?document.addEventListener("pointerdown",this._closeInstructions,!0):(document.addEventListener("mousedown",this._closeInstructions,!0),document.addEventListener("touchstart",this._closeInstructions,!0))}Object.defineProperties(CW.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}}});CW.prototype.isDestroyed=function(){return!1};CW.prototype.destroy=function(){return dn.supportsPointerEvents()?document.removeEventListener("pointerdown",this._closeInstructions,!0):(document.removeEventListener("mousedown",this._closeInstructions,!0),document.removeEventListener("touchstart",this._closeInstructions,!0)),Se.cleanNode(this._wrapper),this._container.removeChild(this._wrapper),le(this)};var vW=CW;var EHt="M 13.84375 7.03125 C 11.412798 7.03125 9.46875 8.975298 9.46875 11.40625 L 9.46875 11.59375 L 2.53125 7.21875 L 2.53125 24.0625 L 9.46875 19.6875 C 9.4853444 22.104033 11.423165 24.0625 13.84375 24.0625 L 25.875 24.0625 C 28.305952 24.0625 30.28125 22.087202 30.28125 19.65625 L 30.28125 11.40625 C 30.28125 8.975298 28.305952 7.03125 25.875 7.03125 L 13.84375 7.03125 z",CHt="M 27.34375 1.65625 L 5.28125 27.9375 L 8.09375 30.3125 L 30.15625 4.03125 L 27.34375 1.65625 z M 13.84375 7.03125 C 11.412798 7.03125 9.46875 8.975298 9.46875 11.40625 L 9.46875 11.59375 L 2.53125 7.21875 L 2.53125 24.0625 L 9.46875 19.6875 C 9.4724893 20.232036 9.5676108 20.7379 9.75 21.21875 L 21.65625 7.03125 L 13.84375 7.03125 z M 28.21875 7.71875 L 14.53125 24.0625 L 25.875 24.0625 C 28.305952 24.0625 30.28125 22.087202 30.28125 19.65625 L 30.28125 11.40625 C 30.28125 9.8371439 29.456025 8.4902779 28.21875 7.71875 z";function Oae(){this._cameraClicked=new be,this._closeClicked=new be,this.maxHeight=500,this.enableCamera=!1,this.isCameraTracking=!1,this.showInfo=!1,this.titleText="",this.description="",Se.track(this,["showInfo","titleText","description","maxHeight","enableCamera","isCameraTracking"]),this._loadingIndicatorHtml='<div class="cesium-infoBox-loadingContainer"><span class="cesium-infoBox-loading"></span></div>',this.cameraIconPath=void 0,Se.defineProperty(this,"cameraIconPath",{get:function(){return!this.enableCamera||this.isCameraTracking?CHt:EHt}}),Se.defineProperty(this,"_bodyless",{get:function(){return!l(this.description)||this.description.length===0}})}Oae.prototype.maxHeightOffset=function(e){return`${this.maxHeight-e}px`};Object.defineProperties(Oae.prototype,{cameraClicked:{get:function(){return this._cameraClicked}},closeClicked:{get:function(){return this._closeClicked}}});var SW=Oae;function wW(e){e=kn(e);let t=document.createElement("div");t.className="cesium-infoBox",t.setAttribute("data-bind",'css: { "cesium-infoBox-visible" : showInfo, "cesium-infoBox-bodyless" : _bodyless }'),e.appendChild(t);let n=document.createElement("div");n.className="cesium-infoBox-title",n.setAttribute("data-bind","text: titleText"),t.appendChild(n);let i=t.ownerDocument,r,o,s,a,c;function u(b){!l(r)||l(b)&&b.pointerId!==r||(r=void 0,t.classList.remove("cesium-infoBox-dragging"))}function f(b){if(!(b.button!==0||b.isPrimary===!1)){r=b.pointerId,o=b.clientX,s=b.clientY,a=t.offsetLeft,c=t.offsetTop,t.style.left=`${a}px`,t.style.top=`${c}px`,t.style.right="auto",t.classList.add("cesium-infoBox-dragging");try{n.setPointerCapture(b.pointerId)}catch{}b.preventDefault()}}function d(b){!l(r)||b.pointerId!==r||(t.style.left=`${a+b.clientX-o}px`,t.style.top=`${c+b.clientY-s}px`,b.preventDefault())}n.addEventListener("pointerdown",f),i.addEventListener("pointermove",d),i.addEventListener("pointerup",u),i.addEventListener("pointercancel",u);let p=document.createElement("button");p.type="button",p.className="cesium-button cesium-infoBox-camera",p.setAttribute("data-bind",'attr: { title: "Focus camera on object" },click: function () { cameraClicked.raiseEvent(this); },enable: enableCamera,cesiumSvgPath: { path: cameraIconPath, width: 32, height: 32 }'),t.appendChild(p);let g=document.createElement("button");g.type="button",g.className="cesium-infoBox-close",g.setAttribute("data-bind","click: function () { closeClicked.raiseEvent(this); }"),g.innerHTML="×",t.appendChild(g);let m=document.createElement("iframe");m.className="cesium-infoBox-iframe",m.setAttribute("sandbox","allow-same-origin allow-popups allow-forms"),m.setAttribute("data-bind","style : { maxHeight : maxHeightOffset(40) }"),m.setAttribute("allowfullscreen",!0),t.appendChild(m);let y=new SW;Se.applyBindings(y,t),this._container=e,this._element=t,this._frame=m,this._viewModel=y,this._descriptionSubscription=void 0,this._titleElement=n,this._ownerDocument=i,this._handlePointerDown=f,this._handlePointerMove=d,this._stopDragging=u;let A=this;m.addEventListener("load",function(){let b=m.contentDocument,x=b.createElement("link");x.href=Zt("Widgets/InfoBox/InfoBoxDescription.css"),x.rel="stylesheet",x.type="text/css";let T=b.createElement("div");T.className="cesium-infoBox-description",b.head.appendChild(x),b.body.appendChild(T),A._descriptionSubscription=Oc(y,"description",function(E){m.style.height="5px",T.innerHTML=E;let v=null,S=T.firstElementChild;if(S!==null&&T.childNodes.length===1){let R=window.getComputedStyle(S);if(R!==null){let O=R["background-color"],L=z.fromCssColorString(O);l(L)&&L.alpha!==0&&(v=R["background-color"])}}t.style["background-color"]=v;let I=T.getBoundingClientRect().height;m.style.height=`${I}px`})}),m.setAttribute("src","about:blank")}Object.defineProperties(wW.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}},frame:{get:function(){return this._frame}}});wW.prototype.isDestroyed=function(){return!1};wW.prototype.destroy=function(){let e=this._container,t=this._ownerDocument;return this._titleElement.removeEventListener("pointerdown",this._handlePointerDown),t.removeEventListener("pointermove",this._handlePointerMove),t.removeEventListener("pointerup",this._stopDragging),t.removeEventListener("pointercancel",this._stopDragging),Se.cleanNode(this._element),e.removeChild(this._element),l(this._descriptionSubscription)&&this._descriptionSubscription.dispose(),le(this)};var IW=wW;function Mae(e){this._scene=e.scene,this.lowFrameRateMessage=e.lowFrameRateMessage??"This application appears to be performing poorly on your system. Please try using a different web browser or updating your video drivers.",this.lowFrameRateMessageDismissed=!1,this.showingLowFrameRateMessage=!1,Se.track(this,["lowFrameRateMessage","lowFrameRateMessageDismissed","showingLowFrameRateMessage"]);let t=this;this._dismissMessage=On(function(){t.showingLowFrameRateMessage=!1,t.lowFrameRateMessageDismissed=!0});let n=v7.fromScene(e.scene);this._unsubscribeLowFrameRate=n.lowFrameRate.addEventListener(function(){t.lowFrameRateMessageDismissed||(t.showingLowFrameRateMessage=!0)}),this._unsubscribeNominalFrameRate=n.nominalFrameRate.addEventListener(function(){t.showingLowFrameRateMessage=!1})}Object.defineProperties(Mae.prototype,{scene:{get:function(){return this._scene}},dismissMessage:{get:function(){return this._dismissMessage}}});Mae.prototype.destroy=function(){return this._unsubscribeLowFrameRate(),this._unsubscribeNominalFrameRate(),le(this)};var PW=Mae;function DW(e){let t=kn(e.container),n=new PW(e),i=document.createElement("div");i.className="cesium-performance-watchdog-message-area",i.setAttribute("data-bind","visible: showingLowFrameRateMessage");let r=document.createElement("button");r.setAttribute("type","button"),r.className="cesium-performance-watchdog-message-dismiss",r.innerHTML="×",r.setAttribute("data-bind","click: dismissMessage"),i.appendChild(r);let o=document.createElement("div");o.className="cesium-performance-watchdog-message",o.setAttribute("data-bind","html: lowFrameRateMessage"),i.appendChild(o),t.appendChild(i),Se.applyBindings(n,i),this._container=t,this._viewModel=n,this._element=i}Object.defineProperties(DW.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}}});DW.prototype.isDestroyed=function(){return!1};DW.prototype.destroy=function(){return this._viewModel.destroy(),Se.cleanNode(this._element),this._container.removeChild(this._element),le(this)};var RW=DW;function OW(e){this._scene=e,this._orthographic=e.camera.frustum instanceof _n,this._flightInProgress=!1,this.dropDownVisible=!1,this.tooltipPerspective="Perspective Projection",this.tooltipOrthographic="Orthographic Projection",this.selectedTooltip=void 0,this.sceneMode=e.mode,Se.track(this,["_orthographic","_flightInProgress","sceneMode","dropDownVisible","tooltipPerspective","tooltipOrthographic"]);let t=this;Se.defineProperty(this,"selectedTooltip",function(){return t._orthographic?t.tooltipOrthographic:t.tooltipPerspective}),this._toggleDropDown=On(function(){t.sceneMode===re.SCENE2D||t._flightInProgress||(t.dropDownVisible=!t.dropDownVisible)}),this._eventHelper=new Qo,this._eventHelper.add(e.morphComplete,function(n,i,r,o){t.sceneMode=r,t._orthographic=r===re.SCENE2D||t._scene.camera.frustum instanceof _n}),this._eventHelper.add(e.preRender,function(){t._flightInProgress=l(e.camera._currentFlight)}),this._switchToPerspective=On(function(){t.sceneMode!==re.SCENE2D&&(t._scene.camera.switchToPerspectiveFrustum(),t._orthographic=!1,t.dropDownVisible=!1)}),this._switchToOrthographic=On(function(){t.sceneMode!==re.SCENE2D&&(t._scene.camera.switchToOrthographicFrustum(),t._orthographic=!0,t.dropDownVisible=!1)}),this._sceneMode=re}Object.defineProperties(OW.prototype,{scene:{get:function(){return this._scene}},toggleDropDown:{get:function(){return this._toggleDropDown}},switchToPerspective:{get:function(){return this._switchToPerspective}},switchToOrthographic:{get:function(){return this._switchToOrthographic}},isOrthographicProjection:{get:function(){return this._orthographic}}});OW.prototype.isDestroyed=function(){return!1};OW.prototype.destroy=function(){this._eventHelper.removeAll(),le(this)};var MW=OW;var vHt="M 28.15625,10.4375 9.125,13.21875 13.75,43.25 41.75,55.09375 50.8125,37 54.5,11.9375 z m 0.125,3 19.976451,0.394265 L 43.03125,16.875 22.6875,14.28125 z M 50.971746,15.705477 47.90625,36.03125 42.53125,46 44.84375,19.3125 z M 12.625,16.03125 l 29.15625,3.6875 -2.65625,31 L 16.4375,41.125 z",SHt="m 31.560594,6.5254438 -20.75,12.4687502 0.1875,24.5625 22.28125,11.8125 19.5,-12 0.65625,-0.375 0,-0.75 0.0312,-23.21875 z m 0.0625,3.125 16.65625,9.5000002 -16.125,10.28125 -17.34375,-9.71875 z m 18.96875,11.1875002 0.15625,20.65625 -17.46875,10.59375 0.15625,-20.28125 z m -37.0625,1.25 17.21875,9.625 -0.15625,19.21875 -16.9375,-9 z";function NW(e,t){e=kn(e);let n=new MW(t);n._perspectivePath=vHt,n._orthographicPath=SHt;let i=document.createElement("span");i.className="cesium-projectionPicker-wrapper cesium-toolbar-button",e.appendChild(i);let r=document.createElement("button");r.type="button",r.className="cesium-button cesium-toolbar-button",r.setAttribute("data-bind",'css: { "cesium-projectionPicker-buttonPerspective": !_orthographic, "cesium-projectionPicker-buttonOrthographic": _orthographic, "cesium-button-disabled" : sceneMode === _sceneMode.SCENE2D || _flightInProgress, "cesium-projectionPicker-selected": dropDownVisible },attr: { title: selectedTooltip },click: toggleDropDown'),r.innerHTML='<!-- ko cesiumSvgPath: { path: _perspectivePath, width: 64, height: 64, css: "cesium-projectionPicker-iconPerspective" } --><!-- /ko --><!-- ko cesiumSvgPath: { path: _orthographicPath, width: 64, height: 64, css: "cesium-projectionPicker-iconOrthographic" } --><!-- /ko -->',i.appendChild(r);let o=document.createElement("button");o.type="button",o.className="cesium-button cesium-toolbar-button cesium-projectionPicker-dropDown-icon",o.setAttribute("data-bind",'css: { "cesium-projectionPicker-visible" : (dropDownVisible && _orthographic), "cesium-projectionPicker-none" : !_orthographic, "cesium-projectionPicker-hidden" : !dropDownVisible },attr: { title: tooltipPerspective },click: switchToPerspective,cesiumSvgPath: { path: _perspectivePath, width: 64, height: 64 }'),i.appendChild(o);let s=document.createElement("button");s.type="button",s.className="cesium-button cesium-toolbar-button cesium-projectionPicker-dropDown-icon",s.setAttribute("data-bind",'css: { "cesium-projectionPicker-visible" : (dropDownVisible && !_orthographic), "cesium-projectionPicker-none" : _orthographic, "cesium-projectionPicker-hidden" : !dropDownVisible},attr: { title: tooltipOrthographic },click: switchToOrthographic,cesiumSvgPath: { path: _orthographicPath, width: 64, height: 64 }'),i.appendChild(s),Se.applyBindings(n,i),this._viewModel=n,this._container=e,this._wrapper=i,this._closeDropDown=function(a){i.contains(a.target)||(n.dropDownVisible=!1)},dn.supportsPointerEvents()?document.addEventListener("pointerdown",this._closeDropDown,!0):(document.addEventListener("mousedown",this._closeDropDown,!0),document.addEventListener("touchstart",this._closeDropDown,!0))}Object.defineProperties(NW.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}}});NW.prototype.isDestroyed=function(){return!1};NW.prototype.destroy=function(){return this._viewModel.destroy(),dn.supportsPointerEvents()?document.removeEventListener("pointerdown",this._closeDropDown,!0):(document.removeEventListener("mousedown",this._closeDropDown,!0),document.removeEventListener("touchstart",this._closeDropDown,!0)),Se.cleanNode(this._wrapper),this._container.removeChild(this._wrapper),le(this)};var LW=NW;function FW(e,t){this._scene=e;let n=this,i=function(r,o,s,a){n.sceneMode=s,n.dropDownVisible=!1};this._eventHelper=new Qo,this._eventHelper.add(e.morphStart,i),this._duration=t??2,this.sceneMode=e.mode,this.dropDownVisible=!1,this.tooltip2D="2D",this.tooltip3D="3D",this.tooltipColumbusView="Columbus View",Se.track(this,["sceneMode","dropDownVisible","tooltip2D","tooltip3D","tooltipColumbusView"]),this.selectedTooltip=void 0,Se.defineProperty(this,"selectedTooltip",function(){let r=n.sceneMode;return r===re.SCENE2D?n.tooltip2D:r===re.SCENE3D?n.tooltip3D:n.tooltipColumbusView}),this._toggleDropDown=On(function(){n.dropDownVisible=!n.dropDownVisible}),this._morphTo2D=On(function(){e.morphTo2D(n._duration)}),this._morphTo3D=On(function(){e.morphTo3D(n._duration)}),this._morphToColumbusView=On(function(){e.morphToColumbusView(n._duration)}),this._sceneMode=re}Object.defineProperties(FW.prototype,{scene:{get:function(){return this._scene}},duration:{get:function(){return this._duration},set:function(e){this._duration=e}},toggleDropDown:{get:function(){return this._toggleDropDown}},morphTo2D:{get:function(){return this._morphTo2D}},morphTo3D:{get:function(){return this._morphTo3D}},morphToColumbusView:{get:function(){return this._morphToColumbusView}}});FW.prototype.isDestroyed=function(){return!1};FW.prototype.destroy=function(){this._eventHelper.removeAll(),le(this)};var BW=FW;var wHt="m 32.401392,4.9330437 c -7.087603,0 -14.096095,2.884602 -19.10793,7.8946843 -5.0118352,5.010083 -7.9296167,11.987468 -7.9296167,19.072999 0,7.085531 2.9177815,14.097848 7.9296167,19.107931 4.837653,4.835961 11.541408,7.631372 18.374354,7.82482 0.05712,0.01231 0.454119,0.139729 0.454119,0.139729 l 0.03493,-0.104797 c 0.08246,7.84e-4 0.162033,0.03493 0.244525,0.03493 0.08304,0 0.161515,-0.03414 0.244526,-0.03493 l 0.03493,0.104797 c 0,0 0.309474,-0.129487 0.349323,-0.139729 6.867765,-0.168094 13.582903,-2.965206 18.444218,-7.82482 2.558195,-2.5573 4.551081,-5.638134 5.903547,-8.977584 1.297191,-3.202966 2.02607,-6.661489 2.02607,-10.130347 0,-6.237309 -2.366261,-12.31219 -6.322734,-17.116794 -0.0034,-0.02316 0.0049,-0.04488 0,-0.06986 -0.01733,-0.08745 -0.104529,-0.278855 -0.104797,-0.279458 -5.31e-4,-0.0012 -0.522988,-0.628147 -0.523984,-0.62878 -3.47e-4,-2.2e-4 -0.133444,-0.03532 -0.244525,-0.06987 C 51.944299,13.447603 51.751076,13.104317 51.474391,12.827728 46.462556,7.8176457 39.488996,4.9330437 32.401392,4.9330437 z m -2.130866,3.5281554 0.104797,9.6762289 c -4.111695,-0.08361 -7.109829,-0.423664 -9.257041,-0.943171 1.198093,-2.269271 2.524531,-4.124404 3.91241,-5.414496 2.167498,-2.0147811 3.950145,-2.8540169 5.239834,-3.3185619 z m 2.794579,0 c 1.280302,0.4754953 3.022186,1.3285948 5.065173,3.2486979 1.424667,1.338973 2.788862,3.303645 3.982275,5.728886 -2.29082,0.403367 -5.381258,0.621049 -8.942651,0.698645 L 33.065105,8.4611991 z m 5.728886,0.2445256 c 4.004072,1.1230822 7.793098,3.1481363 10.724195,6.0782083 0.03468,0.03466 0.07033,0.06991 0.104797,0.104797 -0.45375,0.313891 -0.923054,0.663002 -1.956205,1.082899 -0.647388,0.263114 -1.906242,0.477396 -2.829511,0.733577 -1.382296,-2.988132 -3.027146,-5.368585 -4.785716,-7.0213781 -0.422866,-0.397432 -0.835818,-0.6453247 -1.25756,-0.9781032 z m -15.33525,0.7685092 c -0.106753,0.09503 -0.207753,0.145402 -0.31439,0.244526 -1.684973,1.5662541 -3.298068,3.8232211 -4.680919,6.5672591 -0.343797,-0.14942 -1.035052,-0.273198 -1.292493,-0.419186 -0.956528,-0.542427 -1.362964,-1.022024 -1.537018,-1.292493 -0.0241,-0.03745 -0.01868,-0.0401 -0.03493,-0.06986 2.250095,-2.163342 4.948824,-3.869984 7.859752,-5.0302421 z m -9.641296,7.0912431 c 0.464973,0.571618 0.937729,1.169056 1.956205,1.746612 0.349907,0.198425 1.107143,0.335404 1.537018,0.523983 -1.20166,3.172984 -1.998037,7.051901 -2.165798,11.772162 C 14.256557,30.361384 12.934823,30.161483 12.280427,29.90959 10.644437,29.279855 9.6888882,28.674891 9.1714586,28.267775 8.6540289,27.860658 8.6474751,27.778724 8.6474751,27.778724 l -0.069864,0.03493 C 9.3100294,23.691285 11.163248,19.798527 13.817445,16.565477 z m 37.552149,0.523984 c 2.548924,3.289983 4.265057,7.202594 4.890513,11.318043 -0.650428,0.410896 -1.756876,1.001936 -3.563088,1.606882 -1.171552,0.392383 -3.163859,0.759153 -4.960377,1.117832 -0.04367,-4.752703 -0.784809,-8.591423 -1.88634,-11.807094 0.917574,-0.263678 2.170552,-0.486495 2.864443,-0.76851 1.274693,-0.518066 2.003942,-1.001558 2.654849,-1.467153 z m -31.439008,2.619917 c 2.487341,0.672766 5.775813,1.137775 10.479669,1.222628 l 0.104797,10.689263 0,0.03493 0,0.733577 c -5.435005,-0.09059 -9.512219,-0.519044 -12.610536,-1.117831 0.106127,-4.776683 0.879334,-8.55791 2.02607,-11.562569 z m 23.264866,0.31439 c 1.073459,3.067541 1.833795,6.821314 1.816476,11.702298 -3.054474,0.423245 -7.062018,0.648559 -11.702298,0.698644 l 0,-0.838373 -0.104796,-10.654331 c 4.082416,-0.0864 7.404468,-0.403886 9.990618,-0.908238 z M 8.2632205,30.922625 c 0.7558676,0.510548 1.5529563,1.013339 3.0041715,1.57195 0.937518,0.360875 2.612202,0.647642 3.91241,0.978102 0.112814,3.85566 0.703989,7.107756 1.606883,9.920754 -1.147172,-0.324262 -2.644553,-0.640648 -3.423359,-0.978102 -1.516688,-0.657177 -2.386627,-1.287332 -2.864443,-1.71168 -0.477816,-0.424347 -0.489051,-0.489051 -0.489051,-0.489051 L 9.8002387,40.319395 C 8.791691,37.621767 8.1584238,34.769583 8.1584238,31.900727 c 0,-0.330153 0.090589,-0.648169 0.1047967,-0.978102 z m 48.2763445,0.419186 c 0.0047,0.188973 0.06986,0.36991 0.06986,0.558916 0,2.938869 -0.620228,5.873558 -1.676747,8.628261 -0.07435,0.07583 -0.06552,0.07411 -0.454119,0.349323 -0.606965,0.429857 -1.631665,1.042044 -3.318562,1.676747 -1.208528,0.454713 -3.204964,0.850894 -5.135038,1.25756 0.84593,-2.765726 1.41808,-6.005357 1.606883,-9.815957 2.232369,-0.413371 4.483758,-0.840201 5.938479,-1.327425 1.410632,-0.472457 2.153108,-0.89469 2.96924,-1.327425 z m -38.530252,2.864443 c 3.208141,0.56697 7.372279,0.898588 12.575603,0.978103 l 0.174662,9.885821 c -4.392517,-0.06139 -8.106722,-0.320566 -10.863925,-0.803441 -1.051954,-2.664695 -1.692909,-6.043794 -1.88634,-10.060483 z m 26.793022,0.31439 c -0.246298,3.923551 -0.877762,7.263679 -1.816476,9.885822 -2.561957,0.361954 -5.766249,0.560708 -9.431703,0.62878 l -0.174661,-9.815957 c 4.491734,-0.04969 8.334769,-0.293032 11.42284,-0.698645 z M 12.035901,44.860585 c 0.09977,0.04523 0.105535,0.09465 0.209594,0.139729 1.337656,0.579602 3.441099,1.058072 5.589157,1.537018 1.545042,3.399208 3.548524,5.969402 5.589157,7.789888 -3.034411,-1.215537 -5.871615,-3.007978 -8.174142,-5.309699 -1.245911,-1.245475 -2.271794,-2.662961 -3.213766,-4.156936 z m 40.69605,0 c -0.941972,1.493975 -1.967855,2.911461 -3.213765,4.156936 -2.74253,2.741571 -6.244106,4.696717 -9.955686,5.868615 0.261347,-0.241079 0.507495,-0.394491 0.768509,-0.663713 1.674841,-1.727516 3.320792,-4.181056 4.645987,-7.265904 2.962447,-0.503021 5.408965,-1.122293 7.161107,-1.781544 0.284034,-0.106865 0.337297,-0.207323 0.593848,-0.31439 z m -31.404076,2.305527 c 2.645807,0.376448 5.701178,0.649995 9.466635,0.698645 l 0.139729,7.789888 c -1.38739,-0.480844 -3.316218,-1.29837 -5.659022,-3.388427 -1.388822,-1.238993 -2.743668,-3.0113 -3.947342,-5.100106 z m 20.365491,0.104797 c -1.04872,2.041937 -2.174337,3.779068 -3.353494,4.995309 -1.853177,1.911459 -3.425515,2.82679 -4.611055,3.353494 l -0.139729,-7.789887 c 3.13091,-0.05714 5.728238,-0.278725 8.104278,-0.558916 z",IHt="m 2.9825053,17.550598 0,1.368113 0,26.267766 0,1.368113 1.36811,0 54.9981397,0 1.36811,0 0,-1.368113 0,-26.267766 0,-1.368113 -1.36811,0 -54.9981397,0 -1.36811,0 z m 2.73623,2.736226 10.3292497,0 0,10.466063 -10.3292497,0 0,-10.466063 z m 13.0654697,0 11.69737,0 0,10.466063 -11.69737,0 0,-10.466063 z m 14.43359,0 11.69737,0 0,10.466063 -11.69737,0 0,-10.466063 z m 14.43359,0 10.32926,0 0,10.466063 -10.32926,0 0,-10.466063 z m -41.9326497,13.202288 10.3292497,0 0,10.329252 -10.3292497,0 0,-10.329252 z m 13.0654697,0 11.69737,0 0,10.329252 -11.69737,0 0,-10.329252 z m 14.43359,0 11.69737,0 0,10.329252 -11.69737,0 0,-10.329252 z m 14.43359,0 10.32926,0 0,10.329252 -10.32926,0 0,-10.329252 z",PHt="m 14.723969,17.675598 -0.340489,0.817175 -11.1680536,26.183638 -0.817175,1.872692 2.076986,0 54.7506996,0 2.07698,0 -0.81717,-1.872692 -11.16805,-26.183638 -0.34049,-0.817175 -0.91933,0 -32.414586,0 -0.919322,0 z m 1.838643,2.723916 6.196908,0 -2.928209,10.418977 -7.729111,0 4.460412,-10.418977 z m 9.02297,0 4.903049,0 0,10.418977 -7.831258,0 2.928209,-10.418977 z m 7.626964,0 5.584031,0 2.62176,10.418977 -8.205791,0 0,-10.418977 z m 8.410081,0 5.51593,0 4.46042,10.418977 -7.38863,0 -2.58772,-10.418977 z m -30.678091,13.142892 8.103649,0 -2.89416,10.282782 -9.6018026,0 4.3923136,-10.282782 z m 10.929711,0 8.614384,0 0,10.282782 -11.508544,0 2.89416,-10.282782 z m 11.338299,0 8.852721,0 2.58772,10.282782 -11.440441,0 0,-10.282782 z m 11.678781,0 7.86531,0 4.39231,10.282782 -9.6699,0 -2.58772,-10.282782 z";function kW(e,t,n){e=kn(e);let i=new BW(t,n);i._globePath=wHt,i._flatMapPath=IHt,i._columbusViewPath=PHt;let r=document.createElement("span");r.className="cesium-sceneModePicker-wrapper cesium-toolbar-button",e.appendChild(r);let o=document.createElement("button");o.type="button",o.className="cesium-button cesium-toolbar-button",o.setAttribute("data-bind",'css: { "cesium-sceneModePicker-button2D": sceneMode === _sceneMode.SCENE2D, "cesium-sceneModePicker-button3D": sceneMode === _sceneMode.SCENE3D, "cesium-sceneModePicker-buttonColumbusView": sceneMode === _sceneMode.COLUMBUS_VIEW, "cesium-sceneModePicker-selected": dropDownVisible },attr: { title: selectedTooltip },click: toggleDropDown'),o.innerHTML='<!-- ko cesiumSvgPath: { path: _globePath, width: 64, height: 64, css: "cesium-sceneModePicker-slide-svg cesium-sceneModePicker-icon3D" } --><!-- /ko --><!-- ko cesiumSvgPath: { path: _flatMapPath, width: 64, height: 64, css: "cesium-sceneModePicker-slide-svg cesium-sceneModePicker-icon2D" } --><!-- /ko --><!-- ko cesiumSvgPath: { path: _columbusViewPath, width: 64, height: 64, css: "cesium-sceneModePicker-slide-svg cesium-sceneModePicker-iconColumbusView" } --><!-- /ko -->',r.appendChild(o);let s=document.createElement("button");s.type="button",s.className="cesium-button cesium-toolbar-button cesium-sceneModePicker-dropDown-icon",s.setAttribute("data-bind",'css: { "cesium-sceneModePicker-visible" : (dropDownVisible && (sceneMode !== _sceneMode.SCENE3D)) || (!dropDownVisible && (sceneMode === _sceneMode.SCENE3D)), "cesium-sceneModePicker-none" : sceneMode === _sceneMode.SCENE3D, "cesium-sceneModePicker-hidden" : !dropDownVisible },attr: { title: tooltip3D },click: morphTo3D,cesiumSvgPath: { path: _globePath, width: 64, height: 64 }'),r.appendChild(s);let a=document.createElement("button");a.type="button",a.className="cesium-button cesium-toolbar-button cesium-sceneModePicker-dropDown-icon",a.setAttribute("data-bind",'css: { "cesium-sceneModePicker-visible" : (dropDownVisible && (sceneMode !== _sceneMode.SCENE2D)), "cesium-sceneModePicker-none" : sceneMode === _sceneMode.SCENE2D, "cesium-sceneModePicker-hidden" : !dropDownVisible },attr: { title: tooltip2D },click: morphTo2D,cesiumSvgPath: { path: _flatMapPath, width: 64, height: 64 }'),r.appendChild(a);let c=document.createElement("button");c.type="button",c.className="cesium-button cesium-toolbar-button cesium-sceneModePicker-dropDown-icon",c.setAttribute("data-bind",'css: { "cesium-sceneModePicker-visible" : (dropDownVisible && (sceneMode !== _sceneMode.COLUMBUS_VIEW)) || (!dropDownVisible && (sceneMode === _sceneMode.COLUMBUS_VIEW)), "cesium-sceneModePicker-none" : sceneMode === _sceneMode.COLUMBUS_VIEW, "cesium-sceneModePicker-hidden" : !dropDownVisible},attr: { title: tooltipColumbusView },click: morphToColumbusView,cesiumSvgPath: { path: _columbusViewPath, width: 64, height: 64 }'),r.appendChild(c),Se.applyBindings(i,r),this._viewModel=i,this._container=e,this._wrapper=r,this._closeDropDown=function(u){r.contains(u.target)||(i.dropDownVisible=!1)},dn.supportsPointerEvents()?document.addEventListener("pointerdown",this._closeDropDown,!0):(document.addEventListener("mousedown",this._closeDropDown,!0),document.addEventListener("touchstart",this._closeDropDown,!0))}Object.defineProperties(kW.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}}});kW.prototype.isDestroyed=function(){return!1};kW.prototype.destroy=function(){return this._viewModel.destroy(),dn.supportsPointerEvents()?document.removeEventListener("pointerdown",this._closeDropDown,!0):(document.removeEventListener("mousedown",this._closeDropDown,!0),document.removeEventListener("touchstart",this._closeDropDown,!0)),Se.cleanNode(this._wrapper),this._container.removeChild(this._wrapper),le(this)};var UW=kW;var DHt=new U,zW="-1000px";function tN(e,t,n){this._scene=e,this._screenPositionX=zW,this._screenPositionY=zW,this._tweens=e.tweens,this._container=n??document.body,this._selectionIndicatorElement=t,this._scale=1,this.position=void 0,this.showSelection=!1,Se.track(this,["position","_screenPositionX","_screenPositionY","_scale","showSelection"]),this.isVisible=void 0,Se.defineProperty(this,"isVisible",{get:function(){return this.showSelection&&l(this.position)}}),Se.defineProperty(this,"_transform",{get:function(){return`scale(${this._scale})`}}),this.computeScreenSpacePosition=function(i,r){return pr.worldToWindowCoordinates(e,i,r)}}tN.prototype.update=function(){if(this.showSelection&&l(this.position)){let e=this.computeScreenSpacePosition(this.position,DHt);if(!l(e))this._screenPositionX=zW,this._screenPositionY=zW;else{let t=this._container,n=t.parentNode.clientWidth,i=t.parentNode.clientHeight,r=this._selectionIndicatorElement.clientWidth,o=r*.5;e.x=Math.min(Math.max(e.x,-r),n+r)-o,e.y=Math.min(Math.max(e.y,-r),i+r)-o,this._screenPositionX=`${Math.floor(e.x+.25)}px`,this._screenPositionY=`${Math.floor(e.y+.25)}px`}}};tN.prototype.animateAppear=function(){this._tweens.addProperty({object:this,property:"_scale",startValue:2,stopValue:1,duration:.8,easingFunction:ks.EXPONENTIAL_OUT})};tN.prototype.animateDepart=function(){this._tweens.addProperty({object:this,property:"_scale",startValue:this._scale,stopValue:1.5,duration:.8,easingFunction:ks.EXPONENTIAL_OUT})};Object.defineProperties(tN.prototype,{container:{get:function(){return this._container}},selectionIndicatorElement:{get:function(){return this._selectionIndicatorElement}},scene:{get:function(){return this._scene}}});var VW=tN;function jW(e,t){e=kn(e),this._container=e;let n=document.createElement("div");n.className="cesium-selection-wrapper",n.setAttribute("data-bind",'style: { "top" : _screenPositionY, "left" : _screenPositionX },css: { "cesium-selection-wrapper-visible" : isVisible }'),e.appendChild(n),this._element=n;let i="http://www.w3.org/2000/svg",r="M -34 -34 L -34 -11.25 L -30 -15.25 L -30 -30 L -15.25 -30 L -11.25 -34 L -34 -34 z M 11.25 -34 L 15.25 -30 L 30 -30 L 30 -15.25 L 34 -11.25 L 34 -34 L 11.25 -34 z M -34 11.25 L -34 34 L -11.25 34 L -15.25 30 L -30 30 L -30 15.25 L -34 11.25 z M 34 11.25 L 30 15.25 L 30 30 L 15.25 30 L 11.25 34 L 34 34 L 34 11.25 z",o=document.createElementNS(i,"svg:svg");o.setAttribute("width",160),o.setAttribute("height",160),o.setAttribute("viewBox","0 0 160 160");let s=document.createElementNS(i,"g");s.setAttribute("transform","translate(80,80)"),o.appendChild(s);let a=document.createElementNS(i,"path");a.setAttribute("data-bind","attr: { transform: _transform }"),a.setAttribute("d",r),s.appendChild(a),n.appendChild(o);let c=new VW(t,this._element,this._container);this._viewModel=c,Se.applyBindings(this._viewModel,this._element)}Object.defineProperties(jW.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}}});jW.prototype.isDestroyed=function(){return!1};jW.prototype.destroy=function(){let e=this._container;return Se.cleanNode(this._element),e.removeChild(this._element),le(this)};var HW=jW;function fE(e,t,n){this._color=e,this._height=t,this._base=n??0}fE.prototype.getHeight=function(){return this._height};fE.prototype.getBase=function(){return this._base};fE.prototype.getStartTime=function(){return this._start};fE.prototype.getStopTime=function(){return this._stop};fE.prototype.setRange=function(e,t){this._start=e,this._stop=t};fE.prototype.render=function(e){let t="";if(this._start&&this._stop&&this._color){let n=K.secondsDifference(this._start,e.epochJulian),i=Math.round(e.timeBarWidth*e.getAlpha(n)),r=K.secondsDifference(this._stop,e.epochJulian),o=Math.round(e.timeBarWidth*e.getAlpha(r))-i;i<0&&(o+=i,i=0),i+o>e.timeBarWidth&&(o=e.timeBarWidth-i),o>0&&(t=`<span class="cesium-timeline-highlight" style="left: ${i.toString()}px; width: ${o.toString()}px; bottom: ${this._base.toString()}px; height: ${this._height}px; background-color: ${this._color};"></span>`)}return t};var GW=fE;function cke(e,t,n,i){this.interval=e,this.height=t,this.color=n||new z(.5,.5,.5,1),this.backgroundColor=i||new z(0,0,0,0)}cke.prototype.render=function(e,t){let n=this.interval.start,i=this.interval.stop,r=t.startJulian,o=K.addSeconds(t.startJulian,t.duration,new K);if(K.lessThan(n,r)&&K.greaterThan(i,o))e.fillStyle=this.color.toCssColorString(),e.fillRect(0,t.y,t.timeBarWidth,this.height);else if(K.lessThanOrEquals(n,o)&&K.greaterThanOrEquals(i,r)){let s,a,c;for(s=0;s<t.timeBarWidth;++s){let u=K.addSeconds(t.startJulian,s/t.timeBarWidth*t.duration,new K);!l(a)&&K.greaterThanOrEquals(u,n)?a=s:!l(c)&&K.greaterThanOrEquals(u,i)&&(c=s)}e.fillStyle=this.backgroundColor.toCssColorString(),e.fillRect(0,t.y,t.timeBarWidth,this.height),l(a)&&(l(c)||(c=t.timeBarWidth),e.fillStyle=this.color.toCssColorString(),e.fillRect(a,t.y,Math.max(c-a,1),this.height))}};var WW=cke;var Nae=1e12,sh={none:0,scrub:1,slide:2,zoom:3,touchOnly:4},Ql={none:0,scrub:1,slideZoom:2,singleTap:3,ignore:4},lb=[.001,.002,.005,.01,.02,.05,.1,.25,.5,1,2,5,10,15,30,60,120,300,600,900,1800,3600,7200,14400,21600,43200,86400,172800,345600,604800,1296e3,2592e3,5184e3,7776e3,15552e3,31536e3,63072e3,126144e3,15768e4,31536e4,63072e4,126144e4,15768e5,31536e5,63072e5,126144e5,15768e6,31536e6],RHt=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function eu(e,t){e=kn(e);let n=e.ownerDocument;this.container=e;let i=n.createElement("div");i.className="cesium-timeline-main",e.appendChild(i),this._topDiv=i,this._endJulian=void 0,this._epochJulian=void 0,this._lastXPos=void 0,this._scrubElement=void 0,this._startJulian=void 0,this._timeBarSecondsSpan=void 0,this._clock=t,this._scrubJulian=t.currentTime,this._mainTicSpan=-1,this._mouseMode=sh.none,this._touchMode=Ql.none,this._touchState={centerX:0,spanX:0},this._mouseX=0,this._timelineDrag=0,this._timelineDragLocation=void 0,this._lastHeight=void 0,this._lastWidth=void 0,this._topDiv.innerHTML='<div class="cesium-timeline-bar"></div><div class="cesium-timeline-trackContainer"><canvas class="cesium-timeline-tracks" width="10" height="1"></canvas></div><div class="cesium-timeline-needle"></div><span class="cesium-timeline-ruler"></span>',this._timeBarEle=this._topDiv.childNodes[0],this._trackContainer=this._topDiv.childNodes[1],this._trackListEle=this._topDiv.childNodes[1].childNodes[0],this._needleEle=this._topDiv.childNodes[2],this._rulerEle=this._topDiv.childNodes[3],this._context=this._trackListEle.getContext("2d"),this._trackList=[],this._highlightRanges=[],this.zoomTo(t.startTime,t.stopTime),this._onMouseDown=OHt(this),this._onMouseUp=MHt(this),this._onMouseMove=NHt(this),this._onMouseWheel=LHt(this),this._onTouchStart=FHt(this),this._onTouchMove=kHt(this),this._onTouchEnd=BHt(this);let r=this._timeBarEle;n.addEventListener("mouseup",this._onMouseUp,!1),n.addEventListener("mousemove",this._onMouseMove,!1),r.addEventListener("mousedown",this._onMouseDown,!1),r.addEventListener("DOMMouseScroll",this._onMouseWheel,!1),r.addEventListener("mousewheel",this._onMouseWheel,!1),r.addEventListener("touchstart",this._onTouchStart,!1),r.addEventListener("touchmove",this._onTouchMove,!1),r.addEventListener("touchend",this._onTouchEnd,!1),r.addEventListener("touchcancel",this._onTouchEnd,!1),this._topDiv.oncontextmenu=function(){return!1},t.onTick.addEventListener(this.updateFromClock,this),this.updateFromClock()}eu.prototype.addEventListener=function(e,t,n){this._topDiv.addEventListener(e,t,n)};eu.prototype.removeEventListener=function(e,t,n){this._topDiv.removeEventListener(e,t,n)};eu.prototype.isDestroyed=function(){return!1};eu.prototype.destroy=function(){this._clock.onTick.removeEventListener(this.updateFromClock,this);let e=this.container.ownerDocument;e.removeEventListener("mouseup",this._onMouseUp,!1),e.removeEventListener("mousemove",this._onMouseMove,!1);let t=this._timeBarEle;t.removeEventListener("mousedown",this._onMouseDown,!1),t.removeEventListener("DOMMouseScroll",this._onMouseWheel,!1),t.removeEventListener("mousewheel",this._onMouseWheel,!1),t.removeEventListener("touchstart",this._onTouchStart,!1),t.removeEventListener("touchmove",this._onTouchMove,!1),t.removeEventListener("touchend",this._onTouchEnd,!1),t.removeEventListener("touchcancel",this._onTouchEnd,!1),this.container.removeChild(this._topDiv),le(this)};eu.prototype.addHighlightRange=function(e,t,n){let i=new GW(e,t,n);return this._highlightRanges.push(i),this.resize(),i};eu.prototype.addTrack=function(e,t,n,i){let r=new WW(e,t,n,i);return this._trackList.push(r),this._lastHeight=void 0,this.resize(),r};eu.prototype.zoomTo=function(e,t){if(this._startJulian=e,this._endJulian=t,this._timeBarSecondsSpan=K.secondsDifference(t,e),this._clock&&this._clock.clockRange!==Bs.UNBOUNDED){let i=this._clock.startTime,r=this._clock.stopTime,o=K.secondsDifference(r,i),s=K.secondsDifference(i,this._startJulian),a=K.secondsDifference(r,this._endJulian);this._timeBarSecondsSpan>=o?(this._timeBarSecondsSpan=o,this._startJulian=this._clock.startTime,this._endJulian=this._clock.stopTime):s>0?(this._endJulian=K.addSeconds(this._endJulian,s,new K),this._startJulian=i,this._timeBarSecondsSpan=K.secondsDifference(this._endJulian,this._startJulian)):a<0&&(this._startJulian=K.addSeconds(this._startJulian,a,new K),this._endJulian=r,this._timeBarSecondsSpan=K.secondsDifference(this._endJulian,this._startJulian))}this._makeTics();let n=document.createEvent("Event");n.initEvent("setzoom",!0,!0),n.startJulian=this._startJulian,n.endJulian=this._endJulian,n.epochJulian=this._epochJulian,n.totalSpan=this._timeBarSecondsSpan,n.mainTicSpan=this._mainTicSpan,this._topDiv.dispatchEvent(n)};eu.prototype.zoomFrom=function(e){let t=K.secondsDifference(this._scrubJulian,this._startJulian);e>1||t<0||t>this._timeBarSecondsSpan?t=this._timeBarSecondsSpan*.5:t+=t-this._timeBarSecondsSpan*.5;let n=this._timeBarSecondsSpan-t;this.zoomTo(K.addSeconds(this._startJulian,t-t*e,new K),K.addSeconds(this._endJulian,n*e-n,new K))};function Lae(e){return e<10?`0${e.toString()}`:e.toString()}eu.prototype.makeLabel=function(e){let t=K.toGregorianDate(e),n=t.millisecond,i=" UTC";if(n>0&&this._timeBarSecondsSpan<3600){for(i=Math.floor(n).toString();i.length<3;)i=`0${i}`;i=`.${i}`}return`${RHt[t.month-1]} ${t.day} ${t.year} ${Lae(t.hour)}:${Lae(t.minute)}:${Lae(t.second)}${i}`};eu.prototype.smallestTicInPixels=7;eu.prototype._makeTics=function(){let e=this._timeBarEle,t=K.secondsDifference(this._scrubJulian,this._startJulian),n=Math.round(t*this._topDiv.clientWidth/this._timeBarSecondsSpan),i=n-8,r,o=this;this._needleEle.style.left=`${n.toString()}px`;let s="",a=.01,c=31536e6,u=1e-10,f=0,d=this._timeBarSecondsSpan;d<a?(d=a,this._timeBarSecondsSpan=a,this._endJulian=K.addSeconds(this._startJulian,a,new K)):d>c&&(d=c,this._timeBarSecondsSpan=c,this._endJulian=K.addSeconds(this._startJulian,c,new K));let p=this._timeBarEle.clientWidth;p<10&&(p=10);let g=this._startJulian,m=Math.min(d/p*1e-5,.4),y,A=K.toGregorianDate(g);d>31536e4?y=K.fromDate(new Date(Date.UTC(Math.floor(A.year/100)*100,0))):d>31536e3?y=K.fromDate(new Date(Date.UTC(Math.floor(A.year/10)*10,0))):d>86400?y=K.fromDate(new Date(Date.UTC(A.year,0))):y=K.fromDate(new Date(Date.UTC(A.year,A.month,A.day)));let b=K.secondsDifference(this._startJulian,K.addSeconds(y,m,new K)),x=b+d;this._epochJulian=y;function T(k){return Math.floor(b/k)*k}function E(k,G){return Math.ceil(k/G+.5)*G}function v(k){return(k-b)/d}function S(k,G){return k-G*Math.round(k/G)}this._rulerEle.innerHTML=this.makeLabel(K.addSeconds(this._endJulian,-a,new K));let I=this._rulerEle.offsetWidth+20;I<30&&(I=180);let R=f;f-=u;let O={startTime:b,startJulian:g,epochJulian:y,duration:d,timeBarWidth:p,getAlpha:v};this._highlightRanges.forEach(function(k){s+=k.render(O)});let L=0,_=0,C=0,w=I/p;w>1&&(w=1),w*=this._timeBarSecondsSpan;let D=-1,N=-1,F=lb.length,V;for(V=0;V<F;++V){let k=lb[V];if(++D,L=k,k>w&&k>f)break;N<0&&p*(k/this._timeBarSecondsSpan)>=this.smallestTicInPixels&&(N=D)}if(D>0){for(;D>0;)if(--D,Math.abs(S(L,lb[D]))<1e-5){lb[D]>=f&&(_=lb[D]);break}if(N>=0)for(;N<D;){if(Math.abs(S(_,lb[N]))<1e-5&&lb[N]>=f){C=lb[N];break}++N}}f=R,f>u&&C<1e-5&&Math.abs(f-L)>u&&(C=f,f<=L+u&&(_=0));let B=-999999,j;if(p*(C/this._timeBarSecondsSpan)>=3)for(r=T(C);r<=x;r=E(r,C))s+=`<span class="cesium-timeline-ticTiny" style="left: ${Math.round(p*v(r)).toString()}px;"></span>`;if(p*(_/this._timeBarSecondsSpan)>=3)for(r=T(_);r<=x;r=E(r,_))s+=`<span class="cesium-timeline-ticSub" style="left: ${Math.round(p*v(r)).toString()}px;"></span>`;if(p*(L/this._timeBarSecondsSpan)>=2){this._mainTicSpan=L,x+=L,r=T(L);let k=K.computeTaiMinusUtc(y);for(;r<=x;){let G=K.addSeconds(g,r-b,new K);if(L>2.1){let J=K.computeTaiMinusUtc(G);Math.abs(J-k)>.1&&(r+=J-k,G=K.addSeconds(g,r-b,new K))}let q=Math.round(p*v(r)),Q=this.makeLabel(G);this._rulerEle.innerHTML=Q,j=this._rulerEle.offsetWidth,j<10&&(j=I);let W=q-(j/2-1);W>B?(B=W+j+5,s+=`<span class="cesium-timeline-ticMain" style="left: ${q.toString()}px;"></span><span class="cesium-timeline-ticLabel" style="left: ${W.toString()}px;">${Q}</span>`):s+=`<span class="cesium-timeline-ticSub" style="left: ${q.toString()}px;"></span>`,r=E(r,L)}}else this._mainTicSpan=-1;s+=`<span class="cesium-timeline-icon16" style="left:${i}px;bottom:0;background-position: 0 0;"></span>`,e.innerHTML=s,this._scrubElement=e.lastChild,this._context.clearRect(0,0,this._trackListEle.width,this._trackListEle.height),O.y=0,this._trackList.forEach(function(k){k.render(o._context,O),O.y+=k.height})};eu.prototype.updateFromClock=function(){this._scrubJulian=this._clock.currentTime;let e=this._scrubElement;if(l(this._scrubElement)){let t=K.secondsDifference(this._scrubJulian,this._startJulian),n=Math.round(t*this._topDiv.clientWidth/this._timeBarSecondsSpan);this._lastXPos!==n&&(this._lastXPos=n,e.style.left=`${n-8}px`,this._needleEle.style.left=`${n}px`)}l(this._timelineDragLocation)&&(this._setTimeBarTime(this._timelineDragLocation,this._timelineDragLocation*this._timeBarSecondsSpan/this._topDiv.clientWidth),this.zoomTo(K.addSeconds(this._startJulian,this._timelineDrag,new K),K.addSeconds(this._endJulian,this._timelineDrag,new K)))};eu.prototype._setTimeBarTime=function(e,t){if(e=Math.round(e),this._scrubJulian=K.addSeconds(this._startJulian,t,new K),this._scrubElement){let i=e-8;this._scrubElement.style.left=`${i.toString()}px`,this._needleEle.style.left=`${e.toString()}px`}let n=document.createEvent("Event");n.initEvent("settime",!0,!0),n.clientX=e,n.timeSeconds=t,n.timeJulian=this._scrubJulian,n.clock=this._clock,this._topDiv.dispatchEvent(n)};function OHt(e){return function(t){e._mouseMode!==sh.touchOnly&&(t.button===0?(e._mouseMode=sh.scrub,e._scrubElement&&(e._scrubElement.style.backgroundPosition="-16px 0"),e._onMouseMove(t)):(e._mouseX=t.clientX,t.button===2?e._mouseMode=sh.zoom:e._mouseMode=sh.slide)),t.preventDefault()}}function MHt(e){return function(t){e._mouseMode=sh.none,e._scrubElement&&(e._scrubElement.style.backgroundPosition="0 0"),e._timelineDrag=0,e._timelineDragLocation=void 0}}function NHt(e){return function(t){let n;if(e._mouseMode===sh.scrub){t.preventDefault();let i=t.clientX-e._topDiv.getBoundingClientRect().left;i<0?(e._timelineDragLocation=0,e._timelineDrag=-.01*e._timeBarSecondsSpan):i>e._topDiv.clientWidth?(e._timelineDragLocation=e._topDiv.clientWidth,e._timelineDrag=.01*e._timeBarSecondsSpan):(e._timelineDragLocation=void 0,e._setTimeBarTime(i,i*e._timeBarSecondsSpan/e._topDiv.clientWidth))}else if(e._mouseMode===sh.slide){if(n=e._mouseX-t.clientX,e._mouseX=t.clientX,n!==0){let i=n*e._timeBarSecondsSpan/e._topDiv.clientWidth;e.zoomTo(K.addSeconds(e._startJulian,i,new K),K.addSeconds(e._endJulian,i,new K))}}else e._mouseMode===sh.zoom&&(n=e._mouseX-t.clientX,e._mouseX=t.clientX,n!==0&&e.zoomFrom(Math.pow(1.01,n)))}}function LHt(e){return function(t){let n=t.wheelDeltaY||t.wheelDelta||-t.detail;Nae=Math.max(Math.min(Math.abs(n),Nae),1),n/=Nae,e.zoomFrom(Math.pow(1.05,-n))}}function FHt(e){return function(t){let n=t.touches.length,i,r,o=e._topDiv.getBoundingClientRect().left;t.preventDefault(),e._mouseMode=sh.touchOnly,n===1?(i=K.secondsDifference(e._scrubJulian,e._startJulian),r=Math.round(i*e._topDiv.clientWidth/e._timeBarSecondsSpan+o),Math.abs(t.touches[0].clientX-r)<50?(e._touchMode=Ql.scrub,e._scrubElement&&(e._scrubElement.style.backgroundPosition=n===1?"-16px 0":"0 0")):(e._touchMode=Ql.singleTap,e._touchState.centerX=t.touches[0].clientX-o)):n===2?(e._touchMode=Ql.slideZoom,e._touchState.centerX=(t.touches[0].clientX+t.touches[1].clientX)*.5-o,e._touchState.spanX=Math.abs(t.touches[0].clientX-t.touches[1].clientX)):e._touchMode=Ql.ignore}}function BHt(e){return function(t){let n=t.touches.length,i=e._topDiv.getBoundingClientRect().left;e._touchMode===Ql.singleTap?(e._touchMode=Ql.scrub,e._onTouchMove(t)):e._touchMode===Ql.scrub&&e._onTouchMove(t),e._mouseMode=sh.touchOnly,n!==1?e._touchMode=n>0?Ql.ignore:Ql.none:e._touchMode===Ql.slideZoom&&(e._touchState.centerX=t.touches[0].clientX-i),e._scrubElement&&(e._scrubElement.style.backgroundPosition="0 0")}}function kHt(e){return function(t){let n,i,r,o,s,a,c=1,u=e._topDiv.getBoundingClientRect().left;e._touchMode===Ql.singleTap&&(e._touchMode=Ql.slideZoom),e._mouseMode=sh.touchOnly,e._touchMode===Ql.scrub?(t.preventDefault(),t.changedTouches.length===1&&(i=t.changedTouches[0].clientX-u,i>=0&&i<=e._topDiv.clientWidth&&e._setTimeBarTime(i,i*e._timeBarSecondsSpan/e._topDiv.clientWidth))):e._touchMode===Ql.slideZoom&&(r=t.touches.length,r===2?(o=(t.touches[0].clientX+t.touches[1].clientX)*.5-u,s=Math.abs(t.touches[0].clientX-t.touches[1].clientX)):r===1&&(o=t.touches[0].clientX-u,s=0),l(o)&&(s>0&&e._touchState.spanX>0?(c=e._touchState.spanX/s,a=K.addSeconds(e._startJulian,(e._touchState.centerX*e._timeBarSecondsSpan-o*e._timeBarSecondsSpan*c)/e._topDiv.clientWidth,new K)):(n=e._touchState.centerX-o,a=K.addSeconds(e._startJulian,n*e._timeBarSecondsSpan/e._topDiv.clientWidth,new K)),e.zoomTo(a,K.addSeconds(a,e._timeBarSecondsSpan*c,new K)),e._touchState.centerX=o,e._touchState.spanX=s))}}eu.prototype.resize=function(){let e=this.container.clientWidth,t=this.container.clientHeight;if(e===this._lastWidth&&t===this._lastHeight)return;this._trackContainer.style.height=`${t}px`;let n=1;this._trackList.forEach(function(i){n+=i.height}),this._trackListEle.style.height=`${n.toString()}px`,this._trackListEle.width=this._trackListEle.clientWidth,this._trackListEle.height=n,this._makeTics(),this._lastXPos=void 0,this._lastWidth=e,this._lastHeight=t};var qW=eu;var lke=1e3;function Dm(e){l(e.geocoderServices)?this._geocoderServices=e.geocoderServices:this._geocoderServices=[new AI({scene:e.scene})],this._viewContainer=e.container,this._scene=e.scene,this._flightDuration=e.flightDuration,this._searchText="",this._isSearchInProgress=!1,this._wasGeocodeCancelled=!1,this._previousCredits=[],this._complete=new be,this._suggestions=[],this._selectedSuggestion=void 0,this._showSuggestions=!0,this._handleArrowDown=fke,this._handleArrowUp=uke;let t=this;this._suggestionsVisible=Se.pureComputed(function(){let r=Se.getObservable(t,"_suggestions")().length>0,o=Se.getObservable(t,"_showSuggestions")();return r&&o}),this._searchCommand=On(function(i){if(i=i??nE.SEARCH,t._focusTextbox=!1,l(t._selectedSuggestion))return t.activateSuggestion(t._selectedSuggestion),!1;if(t.hideSuggestions(),t.isSearchInProgress)GHt(t);else return jHt(t,t._geocoderServices,i)}),this.deselectSuggestion=function(){t._selectedSuggestion=void 0},this.handleKeyDown=function(i,r){let o=r.key==="ArrowDown"||r.key==="Down"||r.keyCode===40,s=r.key==="ArrowUp"||r.key==="Up"||r.keyCode===38;return(o||s)&&r.preventDefault(),!0},this.handleKeyUp=function(i,r){let o=r.key==="ArrowDown"||r.key==="Down"||r.keyCode===40,s=r.key==="ArrowUp"||r.key==="Up"||r.keyCode===38,a=r.key==="Enter"||r.keyCode===13;return s?uke(t):o?fke(t):a&&t._searchCommand(),!0},this.activateSuggestion=function(i){t.hideSuggestions(),t._searchText=i.displayName;let r=i.destination;mke(t),t.destinationFound(t,r)},this.hideSuggestions=function(){t._showSuggestions=!1,t._selectedSuggestion=void 0},this.showSuggestions=function(){t._showSuggestions=!0},this.handleMouseover=function(i,r){i!==t._selectedSuggestion&&(t._selectedSuggestion=i)},this.keepExpanded=!1,this.autoComplete=e.autocomplete??!0,this.destinationFound=e.destinationFound??Dm.flyToDestination,this._focusTextbox=!1,Se.track(this,["_searchText","_isSearchInProgress","keepExpanded","_suggestions","_selectedSuggestion","_showSuggestions","_focusTextbox"]);let n=Se.getObservable(this,"_searchText");n.extend({rateLimit:{timeout:500}}),this._suggestionSubscription=n.subscribe(function(){Dm._updateSearchSuggestions(t)}),this.isSearchInProgress=void 0,Se.defineProperty(this,"isSearchInProgress",{get:function(){return this._isSearchInProgress}}),this.searchText=void 0,Se.defineProperty(this,"searchText",{get:function(){return this.isSearchInProgress?"Searching...":this._searchText},set:function(i){this._searchText=i}}),this.flightDuration=void 0,Se.defineProperty(this,"flightDuration",{get:function(){return this._flightDuration},set:function(i){this._flightDuration=i}})}Object.defineProperties(Dm.prototype,{complete:{get:function(){return this._complete}},scene:{get:function(){return this._scene}},search:{get:function(){return this._searchCommand}},selectedSuggestion:{get:function(){return this._selectedSuggestion}},suggestions:{get:function(){return this._suggestions}}});function uke(e){if(e._suggestions.length===0)return;let t=e._suggestions.indexOf(e._selectedSuggestion);if(t===-1||t===0){e._selectedSuggestion=void 0;return}let n=t-1;e._selectedSuggestion=e._suggestions[n],Dm._adjustSuggestionsScroll(e,n)}function fke(e){if(e._suggestions.length===0)return;let t=e._suggestions.length,i=(e._suggestions.indexOf(e._selectedSuggestion)+1)%t;e._selectedSuggestion=e._suggestions[i],Dm._adjustSuggestionsScroll(e,i)}function UHt(e,t){let n=l(t)?t.availability:void 0;return l(n)?Nw(t,[e]).then(function(i){return e=i[0],e.height+=lke,e}):(e.height+=lke,Promise.resolve(e))}function zHt(e,t){let n=e._scene,i=n.ellipsoid,r=n.camera,o=n.terrainProvider,s=t,a;return t instanceof ie?P.equalsEpsilon(t.south,t.north,P.EPSILON7)&&P.equalsEpsilon(t.east,t.west,P.EPSILON7)?t=ie.center(t):a=Lw(t,n):t=i.cartesianToCartographic(t),l(a)||(a=UHt(t,o)),a.then(function(c){s=i.cartographicToCartesian(c)}).finally(function(){r.flyTo({destination:s,complete:function(){e._complete.raiseEvent()},duration:e._flightDuration,endTransform:M.IDENTITY})})}async function VHt(e,t,n){try{return{state:"fulfilled",value:await e.geocode(t,n),credits:e.credit}}catch(i){return{state:"rejected",reason:i}}}async function jHt(e,t,n){let i=e._searchText;if(hke(i)){e.showSuggestions();return}e._isSearchInProgress=!0,e._wasGeocodeCancelled=!1;let r,o;for(r=0;r<t.length;r++){if(e._wasGeocodeCancelled)return;if(o=await VHt(t[r],i,n),l(o)&&o.state==="fulfilled"&&o.value.length>0)break}if(e._wasGeocodeCancelled)return;e._isSearchInProgress=!1,Bae(e);let s=o.value;if(o.state==="fulfilled"&&l(s)&&s.length>0){e._searchText=s[0].displayName,e.destinationFound(e,s[0].destination);let a=dke(e,IM.getCreditsFromResult(s[0]));l(a)||Fae(e,t[r].credit);return}e._searchText=`${i} (not found)`}function Fae(e,t){l(t)&&!e._scene.isDestroyed()&&!e._scene.frameState.creditDisplay.isDestroyed()&&(e._scene.frameState.creditDisplay.addStaticCredit(t),e._previousCredits.push(t))}function dke(e,t){return l(t)&&t.forEach(n=>Fae(e,n)),t}function Bae(e){!e._scene.isDestroyed()&&!e._scene.frameState.creditDisplay.isDestroyed()&&e._previousCredits.forEach(t=>{e._scene.frameState.creditDisplay.removeStaticCredit(t)}),e._previousCredits.length=0}function HHt(e,t){let n=kn(e._viewContainer),i=n.getElementsByClassName("search-results")[0],o=n.getElementsByTagName("li")[t];if(t===0){i.scrollTop=0;return}let s=o.offsetTop;s+o.clientHeight>i.clientHeight?i.scrollTop=s+o.clientHeight:s<i.scrollTop&&(i.scrollTop=s)}function GHt(e){e._isSearchInProgress&&(e._isSearchInProgress=!1,e._wasGeocodeCancelled=!0)}function hke(e){return/^\s*$/.test(e)}function mke(e){Se.getObservable(e,"_suggestions").removeAll()}async function WHt(e){if(!e.autoComplete)return;let t=e._searchText;if(mke(e),Bae(e),!hke(t))for(let n of e._geocoderServices){let i=await n.geocode(t,nE.AUTOCOMPLETE);if(e._suggestions=e._suggestions.concat(i),i.length>0){let r=!0;i.forEach(o=>{let s=IM.getCreditsFromResult(o);r=r&&!l(s),dke(e,s)}),r&&Fae(e,n.credit)}if(e._suggestions.length>=5)return}}Dm.flyToDestination=zHt;Dm._updateSearchSuggestions=WHt;Dm._adjustSuggestionsScroll=HHt;Dm.prototype.isDestroyed=function(){return!1};Dm.prototype.destroy=function(){return this._suggestionSubscription.dispose(),Bae(this),le(this)};var YW=Dm;var qHt="M29.772,26.433l-7.126-7.126c0.96-1.583,1.523-3.435,1.524-5.421C24.169,8.093,19.478,3.401,13.688,3.399C7.897,3.401,3.204,8.093,3.204,13.885c0,5.789,4.693,10.481,10.484,10.481c1.987,0,3.839-0.563,5.422-1.523l7.128,7.127L29.772,26.433zM7.203,13.885c0.006-3.582,2.903-6.478,6.484-6.486c3.579,0.008,6.478,2.904,6.484,6.486c-0.007,3.58-2.905,6.476-6.484,6.484C10.106,20.361,7.209,17.465,7.203,13.885z",YHt="M24.778,21.419 19.276,15.917 24.777,10.415 21.949,7.585 16.447,13.087 10.945,7.585 8.117,10.415 13.618,15.917 8.116,21.419 10.946,24.248 16.447,18.746 21.948,24.248z";function XW(e){let t=kn(e.container),n=new YW(e);n._startSearchPath=qHt,n._stopSearchPath=YHt;let i=document.createElement("form");i.setAttribute("data-bind","submit: search");let r=document.createElement("input");r.type="search",r.className="cesium-geocoder-input",r.setAttribute("placeholder","Enter an address or landmark..."),r.setAttribute("data-bind",'textInput: searchText,disable: isSearchInProgress,event: { keyup: handleKeyUp, keydown: handleKeyDown, mouseover: deselectSuggestion },css: { "cesium-geocoder-input-wide" : keepExpanded || searchText.length > 0 },hasFocus: _focusTextbox'),this._onTextBoxFocus=function(){setTimeout(function(){r.select()},0)},r.addEventListener("focus",this._onTextBoxFocus,!1),i.appendChild(r),this._textBox=r;let o=document.createElement("span");o.className="cesium-geocoder-searchButton",o.setAttribute("data-bind","click: search,cesiumSvgPath: { path: isSearchInProgress ? _stopSearchPath : _startSearchPath, width: 32, height: 32 }"),i.appendChild(o),t.appendChild(i);let s=document.createElement("div");s.className="search-results",s.setAttribute("data-bind","visible: _suggestionsVisible");let a=document.createElement("ul");a.setAttribute("data-bind","foreach: _suggestions");let c=document.createElement("li");a.appendChild(c),c.setAttribute("data-bind","text: $data.displayName, click: $parent.activateSuggestion, event: { mouseover: $parent.handleMouseover}, css: { active: $data === $parent._selectedSuggestion }"),s.appendChild(a),t.appendChild(s),Se.applyBindings(n,i),Se.applyBindings(n,s),this._container=t,this._searchSuggestionsContainer=s,this._viewModel=n,this._form=i,this._onInputBegin=function(u){let f=u.target;typeof u.composedPath=="function"&&(f=u.composedPath()[0]),t.contains(f)||(n._focusTextbox=!1,n.hideSuggestions())},this._onInputEnd=function(u){n._focusTextbox=!0,n.showSuggestions()},dn.supportsPointerEvents()?(document.addEventListener("pointerdown",this._onInputBegin,!0),t.addEventListener("pointerup",this._onInputEnd,!0),t.addEventListener("pointercancel",this._onInputEnd,!0)):(document.addEventListener("mousedown",this._onInputBegin,!0),t.addEventListener("mouseup",this._onInputEnd,!0),document.addEventListener("touchstart",this._onInputBegin,!0),t.addEventListener("touchend",this._onInputEnd,!0),t.addEventListener("touchcancel",this._onInputEnd,!0))}Object.defineProperties(XW.prototype,{container:{get:function(){return this._container}},searchSuggestionsContainer:{get:function(){return this._searchSuggestionsContainer}},viewModel:{get:function(){return this._viewModel}}});XW.prototype.isDestroyed=function(){return!1};XW.prototype.destroy=function(){let e=this._container;return dn.supportsPointerEvents()?(document.removeEventListener("pointerdown",this._onInputBegin,!0),e.removeEventListener("pointerup",this._onInputEnd,!0)):(document.removeEventListener("mousedown",this._onInputBegin,!0),e.removeEventListener("mouseup",this._onInputEnd,!0),document.removeEventListener("touchstart",this._onInputBegin,!0),e.removeEventListener("touchend",this._onInputEnd,!0)),this._viewModel.destroy(),Se.cleanNode(this._form),Se.cleanNode(this._searchSuggestionsContainer),e.removeChild(this._form),e.removeChild(this._searchSuggestionsContainer),this._textBox.removeEventListener("focus",this._onTextBoxFocus,!1),le(this)};var KW=XW;var Ake=js(yke(),1);function $Ht(e){let t=!1,n=window.screen;return l(n)&&(l(n.lockOrientation)?t=n.lockOrientation(e):l(n.mozLockOrientation)?t=n.mozLockOrientation(e):l(n.msLockOrientation)?t=n.msLockOrientation(e):l(n.orientation&&n.orientation.lock)&&(t=n.orientation.lock(e))),t}function bke(){let e=window.screen;l(e)&&(l(e.unlockOrientation)?e.unlockOrientation():l(e.mozUnlockOrientation)?e.mozUnlockOrientation():l(e.msUnlockOrientation)?e.msUnlockOrientation():l(e.orientation&&e.orientation.unlock)&&e.orientation.unlock())}function JHt(e,t,n,i){i()||(n()?(t.useWebVR=!1,e._locked&&(bke(),e._locked=!1),e._noSleep.disable(),ss.exitFullscreen(),n(!1)):(ss.fullscreen||ss.requestFullscreen(e._vrElement),e._noSleep.enable(),e._locked||(e._locked=$Ht("landscape")),t.useWebVR=!0,n(!0)))}function $W(e,t){let n=this,i=Se.observable(ss.enabled),r=Se.observable(!1);this.isVRMode=void 0,Se.defineProperty(this,"isVRMode",{get:function(){return r()}}),this.isVREnabled=void 0,Se.defineProperty(this,"isVREnabled",{get:function(){return i()},set:function(s){i(s&&ss.enabled)}}),this.tooltip=void 0,Se.defineProperty(this,"tooltip",function(){return i()?r()?"Exit VR mode":"Enter VR mode":"VR mode is unavailable"});let o=Se.observable(!1);this._isOrthographic=void 0,Se.defineProperty(this,"_isOrthographic",{get:function(){return o()}}),this._eventHelper=new Qo,this._eventHelper.add(e.preRender,function(){o(e.camera.frustum instanceof _n)}),this._locked=!1,this._noSleep=new Ake.default,this._command=On(function(){JHt(n,e,r,o)},Se.getObservable(this,"isVREnabled")),this._vrElement=kn(t)??document.body,this._callback=function(){!ss.fullscreen&&r()&&(e.useWebVR=!1,n._locked&&(bke(),n._locked=!1),n._noSleep.disable(),r(!1))},document.addEventListener(ss.changeEventName,this._callback)}Object.defineProperties($W.prototype,{vrElement:{get:function(){return this._vrElement},set:function(e){this._vrElement=e}},command:{get:function(){return this._command}}});$W.prototype.isDestroyed=function(){return!1};$W.prototype.destroy=function(){this._eventHelper.removeAll(),document.removeEventListener(ss.changeEventName,this._callback),le(this)};var JW=$W;var ZHt="M 5.3125 6.375 C 4.008126 6.375 2.96875 7.4141499 2.96875 8.71875 L 2.96875 19.5 C 2.96875 20.8043 4.008126 21.875 5.3125 21.875 L 13.65625 21.875 C 13.71832 20.0547 14.845166 18.59375 16.21875 18.59375 C 17.592088 18.59375 18.71881 20.0552 18.78125 21.875 L 27.09375 21.875 C 28.398125 21.875 29.4375 20.8043 29.4375 19.5 L 29.4375 8.71875 C 29.4375 7.4141499 28.398125 6.375 27.09375 6.375 L 5.3125 6.375 z M 9.625 10.4375 C 11.55989 10.4375 13.125 12.03385 13.125 13.96875 C 13.125 15.90365 11.55989 17.46875 9.625 17.46875 C 7.69011 17.46875 6.125 15.90365 6.125 13.96875 C 6.125 12.03385 7.69011 10.4375 9.625 10.4375 z M 22.46875 10.4375 C 24.40364 10.4375 25.96875 12.03385 25.96875 13.96875 C 25.96875 15.90365 24.40364 17.46875 22.46875 17.46875 C 20.53386 17.46875 18.96875 15.90365 18.96875 13.96875 C 18.96875 12.03385 20.53386 10.4375 22.46875 10.4375 z",QHt="M 25.770585,2.4552065 C 15.72282,13.962707 10.699956,19.704407 8.1768352,22.580207 c -1.261561,1.4379 -1.902282,2.1427 -2.21875,2.5 -0.141624,0.1599 -0.208984,0.2355 -0.25,0.2813 l 0.6875,0.75 c 10e-5,-10e-5 0.679191,0.727 0.6875,0.7187 0.01662,-0.016 0.02451,-0.024 0.03125,-0.031 0.01348,-0.014 0.04013,-0.038 0.0625,-0.062 0.04474,-0.05 0.120921,-0.1315 0.28125,-0.3126 0.320657,-0.3619 0.956139,-1.0921 2.2187499,-2.5312 2.5252219,-2.8781 7.5454589,-8.6169 17.5937499,-20.1250005 l -1.5,-1.3125 z m -20.5624998,3.9063 c -1.304375,0 -2.34375,1.0391 -2.34375,2.3437 l 0,10.8125005 c 0,1.3043 1.039375,2.375 2.34375,2.375 l 2.25,0 c 1.9518039,-2.2246 7.4710958,-8.5584 13.5624998,-15.5312005 l -15.8124998,0 z m 21.1249998,0 c -1.855467,2.1245 -2.114296,2.4005 -3.59375,4.0936995 1.767282,0.1815 3.15625,1.685301 3.15625,3.500001 0,1.9349 -1.56511,3.5 -3.5,3.5 -1.658043,0 -3.043426,-1.1411 -3.40625,-2.6875 -1.089617,1.2461 -2.647139,2.9988 -3.46875,3.9375 0.191501,-0.062 0.388502,-0.094 0.59375,-0.094 1.373338,0 2.50006,1.4614 2.5625,3.2812 l 8.3125,0 c 1.304375,0 2.34375,-1.0707 2.34375,-2.375 l 0,-10.8125005 c 0,-1.3046 -1.039375,-2.3437 -2.34375,-2.3437 l -0.65625,0 z M 9.5518351,10.423906 c 1.9348899,0 3.4999999,1.596401 3.4999999,3.531301 0,1.9349 -1.56511,3.5 -3.4999999,3.5 -1.9348899,0 -3.4999999,-1.5651 -3.4999999,-3.5 0,-1.9349 1.56511,-3.531301 3.4999999,-3.531301 z m 4.2187499,10.312601 c -0.206517,0.2356 -0.844218,0.9428 -1.03125,1.1562 l 0.8125,0 c 0.01392,-0.4081 0.107026,-0.7968 0.21875,-1.1562 z";function ZW(e,t,n){e=kn(e);let i=new JW(t,n);i._exitVRPath=QHt,i._enterVRPath=ZHt;let r=document.createElement("button");r.type="button",r.className="cesium-button cesium-vrButton",r.setAttribute("data-bind",'css: { "cesium-button-disabled" : _isOrthographic }, attr: { title: tooltip },click: command,enable: isVREnabled,cesiumSvgPath: { path: isVRMode ? _exitVRPath : _enterVRPath, width: 32, height: 32 }'),e.appendChild(r),Se.applyBindings(i,r),this._container=e,this._viewModel=i,this._element=r}Object.defineProperties(ZW.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}}});ZW.prototype.isDestroyed=function(){return!1};ZW.prototype.destroy=function(){return this._viewModel.destroy(),Se.cleanNode(this._element),this._container.removeChild(this._element),le(this)};var QW=ZW;var xke=new ue;function Cke(e){let t=e.clock;t.currentTime=e.timeJulian,t.shouldAnimate=!1}function eGt(e){let t=e.getPropertyIds(),n="";return t.forEach(function(i){let r=e.getProperty(i);l(r)&&(n+=`<tr><th>${i}</th><td>${r}</td></tr>`)}),n.length>0&&(n=`<table class="cesium-infoBox-defaultTable"><tbody>${n}</tbody></table>`),n}function tGt(e){let t,n=[],i=e.getPropertyIds();for(t=0;t<i.length;t++){let o=i[t];/^name$/i.test(o)?n[0]=e.getProperty(o):/name/i.test(o)?n[1]=e.getProperty(o):/^title$/i.test(o)?n[2]=e.getProperty(o):/^(id|identifier)$/i.test(o)?n[3]=e.getProperty(o):/element/i.test(o)?n[4]=e.getProperty(o):/(id|identifier)$/i.test(o)&&(n[5]=e.getProperty(o))}let r=n.length;for(t=0;t<r;t++){let o=n[t];if(l(o)&&o!=="")return o}return"Unnamed Feature"}function Tke(e,t){let n=e.scene.pick(t.position);if(l(n)){let i=n.id??n.primitive.id;if(i instanceof Qr)return i;if(n instanceof ua||n instanceof Bv)return new Qr({name:tGt(n),description:eGt(n),feature:n})}return oGt(e,t.position)}var nGt=new K;function Vae(e,t){if(l(t)){let n=t.clock;if(l(n)&&l(e)){let i=n.startTime,r=n.stopTime;K.equals(i,r)&&(r=K.addSeconds(i,P.EPSILON2,nGt)),e.updateFromClock(),e.zoomTo(i,r)}}}var iGt=new h;function rGt(e){let t=e.length;for(let n=0;n<t;++n){let i=e.get(n);if(i instanceof Zo)return i}}function oGt(e,t){let n=e.scene,i=n.camera.getPickRay(t);if(!l(i))return;let r=n.imageryLayers;if(!l(r)){let a=rGt(n.primitives);if(!l(a))return;r=a.imageryLayers}let o=r.pickImageryLayerFeatures(i,n);if(!l(o))return;let s=new Qr({id:"Loading...",description:"Loading feature information..."});return o.then(function(a){if(e.selectedEntity!==s)return;if(!l(a)||a.length===0){e.selectedEntity=Eke();return}let c=a[0],u=new Qr({id:c.name,description:c.description});if(l(c.position)){let f=e.scene.ellipsoid.cartographicToCartesian(c.position,iGt);u.position=new gu(f)}e.selectedEntity=u},function(){e.selectedEntity===s&&(e.selectedEntity=Eke())}),s}function Eke(){return new Qr({id:"None",description:"No features found."})}function sGt(e,t){let n=e._geocoder,i=e._homeButton,r=e._sceneModePicker,o=e._projectionPicker,s=e._baseLayerPicker,a=e._animation,c=e._timeline,u=e._fullscreenButton,f=e._infoBox,d=e._selectionIndicator,p=t?"hidden":"visible";if(l(n)&&(n.container.style.visibility=p),l(i)&&(i.container.style.visibility=p),l(r)&&(r.container.style.visibility=p),l(o)&&(o.container.style.visibility=p),l(s)&&(s.container.style.visibility=p),l(a)&&(a.container.style.visibility=p),l(c)&&(c.container.style.visibility=p),l(u)&&u.viewModel.isFullscreenEnabled&&(u.container.style.visibility=p),l(f)&&(f.container.style.visibility=p),l(d)&&(d.container.style.visibility=p),e._container){let g=t||!l(u)?0:u.container.clientWidth;e._vrButton.container.style.right=`${g}px`,e.forceResize()}}function tr(e,t){e=kn(e),t=t??H.EMPTY_OBJECT;let n=(!l(t.globe)||t.globe!==!1)&&(!l(t.baseLayerPicker)||t.baseLayerPicker!==!1),i=this,r=document.createElement("div");r.className="cesium-viewer",e.appendChild(r);let o=document.createElement("div");o.className="cesium-viewer-cesiumWidgetContainer",r.appendChild(o);let s=document.createElement("div");s.className="cesium-viewer-bottom",r.appendChild(s);let a=t.scene3DOnly??!1,c,u,f=!1;l(t.clockViewModel)?(u=t.clockViewModel,c=u.clock):(c=new Mp,u=new K7(c),f=!0);let d=new k9(o,{baseLayer:n&&l(t.selectedImageryProviderViewModel)||l(t.baseLayer)||l(t.imageryProvider)?!1:void 0,clock:c,shouldAnimate:t.shouldAnimate,skyBox:t.skyBox,skyAtmosphere:t.skyAtmosphere,sceneMode:t.sceneMode,ellipsoid:t.ellipsoid,mapProjection:t.mapProjection,globe:t.globe,orderIndependentTranslucency:t.orderIndependentTranslucency,automaticallyTrackDataSourceClocks:t.automaticallyTrackDataSourceClocks,contextOptions:t.contextOptions,useDefaultRenderLoop:t.useDefaultRenderLoop,targetFrameRate:t.targetFrameRate,showRenderLoopErrors:t.showRenderLoopErrors,useBrowserRecommendedResolution:t.useBrowserRecommendedResolution,creditContainer:l(t.creditContainer)?t.creditContainer:s,creditViewport:t.creditViewport,dataSources:t.dataSources,scene3DOnly:a,shadows:t.shadows,terrainShadows:t.terrainShadows,mapMode2D:t.mapMode2D,blurActiveElementOnCanvasFocus:t.blurActiveElementOnCanvasFocus,requestRenderMode:t.requestRenderMode,maximumRenderTimeChange:t.maximumRenderTimeChange,depthPlaneEllipsoidOffset:t.depthPlaneEllipsoidOffset,msaaSamples:t.msaaSamples}),p=d.scene,g=new Qo;g.add(c.onTick,tr.prototype._onTick,this);let m;if(!l(t.selectionIndicator)||t.selectionIndicator!==!1){let G=document.createElement("div");G.className="cesium-viewer-selectionIndicatorContainer",r.appendChild(G),m=new HW(G,p)}let y;if(!l(t.infoBox)||t.infoBox!==!1){let G=document.createElement("div");G.className="cesium-viewer-infoBoxContainer",r.appendChild(G),y=new IW(G);let q=y.viewModel;g.add(q.cameraClicked,tr.prototype._onInfoBoxCameraClicked,this),g.add(q.closeClicked,tr.prototype._onInfoBoxClockClicked,this)}let A=document.createElement("div");A.className="cesium-viewer-toolbar",r.appendChild(A);let b;if(!l(t.geocoder)||t.geocoder!==!1){let G=document.createElement("div");G.className="cesium-viewer-geocoderContainer",A.appendChild(G);let q;typeof t.geocoder=="string"?q=[new AI({scene:p,geocodeProviderType:t.geocoder})]:l(t.geocoder)&&typeof t.geocoder!="boolean"&&(q=Array.isArray(t.geocoder)?t.geocoder:[t.geocoder]),b=new KW({container:G,geocoderServices:q,scene:p}),g.add(b.viewModel.search.beforeExecute,tr.prototype._clearObjects,this)}let x;(!l(t.homeButton)||t.homeButton!==!1)&&(x=new gW(A,p),l(b)&&g.add(x.viewModel.command.afterExecute,function(){let G=b.viewModel;G.searchText="",G.isSearchInProgress&&G.search()}),g.add(x.viewModel.command.beforeExecute,tr.prototype._clearTrackedObject,this));let T;!a&&(!l(t.sceneModePicker)||t.sceneModePicker!==!1)&&(T=new UW(A,p));let E;t.projectionPicker&&(E=new LW(A,p));let v,S;if(n){let G=t.imageryProviderViewModels??oW(),q=t.terrainProviderViewModels??sW();v=new rW(A,{globe:p.globe,imageryProviderViewModels:G,selectedImageryProviderViewModel:t.selectedImageryProviderViewModel,terrainProviderViewModels:q,selectedTerrainProviderViewModel:t.selectedTerrainProviderViewModel}),S=A.getElementsByClassName("cesium-baseLayerPicker-dropDown")[0]}l(t.baseLayer)&&t.baseLayer!==!1&&(n&&(v.viewModel.selectedImagery=void 0),p.imageryLayers.removeAll(),p.imageryLayers.add(t.baseLayer)),l(t.terrainProvider)&&(n&&(v.viewModel.selectedTerrain=void 0),p.terrainProvider=t.terrainProvider),l(t.terrain)&&(n&&(p.globe.depthTestAgainstTerrain=!0),p.setTerrain(t.terrain));let I;if(!l(t.navigationHelpButton)||t.navigationHelpButton!==!1){let G=!0;try{if(l(window.localStorage)){let q=window.localStorage.getItem("cesium-hasSeenNavHelp");l(q)&&q?G=!1:window.localStorage.setItem("cesium-hasSeenNavHelp","true")}}catch{}I=new vW({container:A,instructionsInitiallyVisible:t.navigationInstructionsInitiallyVisible??G})}let R;if(!l(t.animation)||t.animation!==!1){let G=document.createElement("div");G.className="cesium-viewer-animationContainer",r.appendChild(G),R=new eW(G,new tW(u))}let O;if(!l(t.timeline)||t.timeline!==!1){let G=document.createElement("div");G.className="cesium-viewer-timelineContainer",r.appendChild(G),O=new qW(G,c),O.addEventListener("settime",Cke,!1),O.zoomTo(c.startTime,c.stopTime)}let L,_,C;(!l(t.fullscreenButton)||t.fullscreenButton!==!1)&&(C=document.createElement("div"),C.className="cesium-viewer-fullscreenContainer",r.appendChild(C),L=new hW(C,t.fullscreenElement),_=Oc(L.viewModel,"isFullscreenEnabled",function(G){C.style.display=G?"block":"none",l(O)&&(O.container.style.right=`${C.clientWidth}px`,O.resize())}));let w,D,N;if(t.vrButton){let G=document.createElement("div");G.className="cesium-viewer-vrContainer",r.appendChild(G),w=new QW(G,p,t.fullScreenElement),D=Oc(w.viewModel,"isVREnabled",function(q){G.style.display=q?"block":"none",l(L)&&(G.style.right=`${C.clientWidth}px`),l(O)&&(O.container.style.right=`${G.clientWidth}px`,O.resize())}),N=Oc(w.viewModel,"isVRMode",function(q){sGt(i,q)})}this._baseLayerPickerDropDown=S,this._fullscreenSubscription=_,this._vrSubscription=D,this._vrModeSubscription=N,this._dataSourceChangedListeners={},this._container=e,this._bottomContainer=s,this._element=r,this._cesiumWidget=d,this._selectionIndicator=m,this._infoBox=y,this._clockViewModel=u,this._destroyClockViewModel=f,this._toolbar=A,this._homeButton=x,this._sceneModePicker=T,this._projectionPicker=E,this._baseLayerPicker=v,this._navigationHelpButton=I,this._animation=R,this._timeline=O,this._fullscreenButton=L,this._vrButton=w,this._geocoder=b,this._eventHelper=g,this._lastWidth=0,this._lastHeight=0,this._enableInfoOrSelection=l(y)||l(m),this._selectedEntity=void 0,this._selectedEntityChanged=new be;let F=this._cesiumWidget.dataSources,V=this._cesiumWidget.dataSourceDisplay;g.add(F.dataSourceAdded,tr.prototype._onDataSourceAdded,this),g.add(F.dataSourceRemoved,tr.prototype._onDataSourceRemoved,this),g.add(p.postUpdate,tr.prototype.resize,this);let B=F.length;for(let G=0;G<B;G++)this._dataSourceAdded(F,F.get(G));this._dataSourceAdded(void 0,V.defaultDataSource),g.add(F.dataSourceAdded,tr.prototype._dataSourceAdded,this),g.add(F.dataSourceRemoved,tr.prototype._dataSourceRemoved,this);function j(G){let q=Tke(i,G);l(q)?X.getValueOrUndefined(q.position,i.clock.currentTime)?i.trackedEntity=q:i.zoomTo(q):l(i.trackedEntity)&&(i.trackedEntity=void 0)}function k(G){i.selectedEntity=Tke(i,G)}d.screenSpaceEventHandler.setInputAction(k,fn.LEFT_CLICK),d.screenSpaceEventHandler.setInputAction(j,fn.LEFT_DOUBLE_CLICK),d._canAnimateUpdateCallback=this._updateCanAnimate(this)}Object.defineProperties(tr.prototype,{container:{get:function(){return this._container}},creditDisplay:{get:function(){return this._cesiumWidget.creditDisplay}},bottomContainer:{get:function(){return this._bottomContainer}},cesiumWidget:{get:function(){return this._cesiumWidget}},selectionIndicator:{get:function(){return this._selectionIndicator}},infoBox:{get:function(){return this._infoBox}},geocoder:{get:function(){return this._geocoder}},homeButton:{get:function(){return this._homeButton}},sceneModePicker:{get:function(){return this._sceneModePicker}},projectionPicker:{get:function(){return this._projectionPicker}},baseLayerPicker:{get:function(){return this._baseLayerPicker}},navigationHelpButton:{get:function(){return this._navigationHelpButton}},animation:{get:function(){return this._animation}},timeline:{get:function(){return this._timeline}},fullscreenButton:{get:function(){return this._fullscreenButton}},vrButton:{get:function(){return this._vrButton}},dataSourceDisplay:{get:function(){return this._cesiumWidget.dataSourceDisplay}},entities:{get:function(){return this._cesiumWidget.entities}},dataSources:{get:function(){return this._cesiumWidget.dataSources}},canvas:{get:function(){return this._cesiumWidget.canvas}},scene:{get:function(){return this._cesiumWidget.scene}},shadows:{get:function(){return this.scene.shadowMap.enabled},set:function(e){this.scene.shadowMap.enabled=e}},terrainShadows:{get:function(){return this.scene.globe.shadows},set:function(e){this.scene.globe.shadows=e}},shadowMap:{get:function(){return this.scene.shadowMap}},imageryLayers:{get:function(){return this.scene.imageryLayers}},terrainProvider:{get:function(){return this.scene.terrainProvider},set:function(e){this.scene.terrainProvider=e}},camera:{get:function(){return this.scene.camera}},ellipsoid:{get:function(){return this.scene.ellipsoid}},postProcessStages:{get:function(){return this.scene.postProcessStages}},clock:{get:function(){return this._clockViewModel.clock}},clockViewModel:{get:function(){return this._clockViewModel}},screenSpaceEventHandler:{get:function(){return this._cesiumWidget.screenSpaceEventHandler}},targetFrameRate:{get:function(){return this._cesiumWidget.targetFrameRate},set:function(e){this._cesiumWidget.targetFrameRate=e}},useDefaultRenderLoop:{get:function(){return this._cesiumWidget.useDefaultRenderLoop},set:function(e){this._cesiumWidget.useDefaultRenderLoop=e}},resolutionScale:{get:function(){return this._cesiumWidget.resolutionScale},set:function(e){this._cesiumWidget.resolutionScale=e}},useBrowserRecommendedResolution:{get:function(){return this._cesiumWidget.useBrowserRecommendedResolution},set:function(e){this._cesiumWidget.useBrowserRecommendedResolution=e}},allowDataSourcesToSuspendAnimation:{get:function(){return this._cesiumWidget.allowDataSourcesToSuspendAnimation},set:function(e){this._cesiumWidget.allowDataSourcesToSuspendAnimation=e}},trackedEntity:{get:function(){return this._cesiumWidget.trackedEntity},set:function(e){this._cesiumWidget.trackedEntity=e}},selectedEntity:{get:function(){return this._selectedEntity},set:function(e){if(this._selectedEntity!==e){this._selectedEntity=e;let t=l(this._selectionIndicator)?this._selectionIndicator.viewModel:void 0;l(e)?l(t)&&t.animateAppear():l(t)&&t.animateDepart(),this._selectedEntityChanged.raiseEvent(e)}}},selectedEntityChanged:{get:function(){return this._selectedEntityChanged}},trackedEntityChanged:{get:function(){return this._cesiumWidget.trackedEntityChanged}},clockTrackedDataSource:{get:function(){return this._cesiumWidget.clockTrackedDataSource},set:function(e){this._cesiumWidget.clockTrackedDataSource!==e&&(this._cesiumWidget.clockTrackedDataSource=e,Vae(this._timeline,e))}}});tr.prototype.extend=function(e,t){e(this,t)};tr.prototype.resize=function(){let e=this._cesiumWidget,t=this._container,n=t.clientWidth,i=t.clientHeight,r=l(this._animation),o=l(this._timeline);if(e.resize(),n===this._lastWidth&&i===this._lastHeight)return;let s=i-125,a=this._baseLayerPickerDropDown;if(l(a)&&(a.style.maxHeight=`${s}px`),l(this._geocoder)){let m=this._geocoder.searchSuggestionsContainer;m.style.maxHeight=`${s}px`}l(this._infoBox)&&(this._infoBox.viewModel.maxHeight=s);let c=this._timeline,u,f=0,d=5,p=3,g=0;if(r&&window.getComputedStyle(this._animation.container).visibility!=="hidden"){let m=this._lastWidth;u=this._animation.container,n>900?(f=169,m<=900&&(u.style.width="169px",u.style.height="112px",this._animation.resize())):n>=600?(f=136,(m<600||m>900)&&(u.style.width="136px",u.style.height="90px",this._animation.resize())):(f=106,(m>600||m===0)&&(u.style.width="106px",u.style.height="70px",this._animation.resize())),d=f+5}if(o&&window.getComputedStyle(this._timeline.container).visibility!=="hidden"){let m=this._fullscreenButton,y=this._vrButton,A=c.container,b=A.style;p=A.clientHeight+3,b.left=`${f}px`;let x=0;l(m)&&(x+=m.container.clientWidth),l(y)&&(x+=y.container.clientWidth),b.right=`${x}px`,c.resize()}!o&&l(this._fullscreenButton)&&(g=this._fullscreenButton.container.clientWidth),this._bottomContainer.style.left=`${d}px`,this._bottomContainer.style.bottom=`${p}px`,this._bottomContainer.style.right=`${g}px`,this._lastWidth=n,this._lastHeight=i};tr.prototype.forceResize=function(){this._lastWidth=0,this.resize()};tr.prototype.render=function(){this._cesiumWidget.render()};tr.prototype.isDestroyed=function(){return!1};tr.prototype.destroy=function(){return l(this.screenSpaceEventHandler)&&!this.screenSpaceEventHandler.isDestroyed()&&(this.screenSpaceEventHandler.removeInputAction(fn.LEFT_CLICK),this.screenSpaceEventHandler.removeInputAction(fn.LEFT_DOUBLE_CLICK)),this._container.removeChild(this._element),this._element.removeChild(this._toolbar),this._eventHelper.removeAll(),l(this._geocoder)&&(this._geocoder=this._geocoder.destroy()),l(this._homeButton)&&(this._homeButton=this._homeButton.destroy()),l(this._sceneModePicker)&&(this._sceneModePicker=this._sceneModePicker.destroy()),l(this._projectionPicker)&&(this._projectionPicker=this._projectionPicker.destroy()),l(this._baseLayerPicker)&&(this._baseLayerPicker=this._baseLayerPicker.destroy()),l(this._animation)&&(this._element.removeChild(this._animation.container),this._animation=this._animation.destroy()),l(this._timeline)&&(this._timeline.removeEventListener("settime",Cke,!1),this._element.removeChild(this._timeline.container),this._timeline=this._timeline.destroy()),l(this._fullscreenButton)&&(this._fullscreenSubscription.dispose(),this._element.removeChild(this._fullscreenButton.container),this._fullscreenButton=this._fullscreenButton.destroy()),l(this._vrButton)&&(this._vrSubscription.dispose(),this._vrModeSubscription.dispose(),this._element.removeChild(this._vrButton.container),this._vrButton=this._vrButton.destroy()),l(this._infoBox)&&(this._element.removeChild(this._infoBox.container),this._infoBox=this._infoBox.destroy()),l(this._selectionIndicator)&&(this._element.removeChild(this._selectionIndicator.container),this._selectionIndicator=this._selectionIndicator.destroy()),this._destroyClockViewModel&&(this._clockViewModel=this._clockViewModel.destroy()),this._cesiumWidget=this._cesiumWidget.destroy(),le(this)};tr.prototype._dataSourceAdded=function(e,t){t.entities.collectionChanged.addEventListener(tr.prototype._onEntityCollectionChanged,this)};tr.prototype._dataSourceRemoved=function(e,t){let n=t.entities;n.collectionChanged.removeEventListener(tr.prototype._onEntityCollectionChanged,this),l(this.selectedEntity)&&n.getById(this.selectedEntity.id)===this.selectedEntity&&(this.selectedEntity=void 0)};tr.prototype._updateCanAnimate=function(e){return function(t){e._clockViewModel.canAnimate=t}};tr.prototype._onTick=function(e){let t=e.currentTime,n,i=!1,r=this.selectedEntity,o=l(r)&&this._enableInfoOrSelection;o&&r.isShowing&&r.isAvailable(t)&&(this._cesiumWidget.dataSourceDisplay.getBoundingSphere(r,!0,xke)!==Pt.FAILED?n=xke.center:l(r.position)&&(n=r.position.getValue(t,n)),i=l(n));let s=l(this._selectionIndicator)?this._selectionIndicator.viewModel:void 0;l(s)&&(s.position=h.clone(n,s.position),s.showSelection=o&&i,s.update());let a=l(this._infoBox)?this._infoBox.viewModel:void 0;l(a)&&(a.showInfo=o,a.enableCamera=i,a.isCameraTracking=this.trackedEntity===this.selectedEntity,o?(a.titleText=r.name??r.id,a.description=X.getValueOrDefault(r.description,t,"")):(a.titleText="",a.description=""))};tr.prototype._onEntityCollectionChanged=function(e,t,n){let i=n.length;for(let r=0;r<i;r++){let o=n[r];this.selectedEntity===o&&(this.selectedEntity=void 0)}};tr.prototype._onInfoBoxCameraClicked=function(e){if(e.isCameraTracking&&this.trackedEntity===this.selectedEntity)this.trackedEntity=void 0;else{let n=this.selectedEntity.position;l(n)?this.trackedEntity=this.selectedEntity:this.zoomTo(this.selectedEntity)}};tr.prototype._clearTrackedObject=function(){this.trackedEntity=void 0};tr.prototype._onInfoBoxClockClicked=function(e){this.selectedEntity=void 0};tr.prototype._clearObjects=function(){this.trackedEntity=void 0,this.selectedEntity=void 0};tr.prototype._onDataSourceChanged=function(e){this.clockTrackedDataSource===e&&Vae(this.timeline,e)};tr.prototype._onDataSourceAdded=function(e,t){this._cesiumWidget._automaticallyTrackDataSourceClocks&&t===this.clockTrackedDataSource&&Vae(this._timeline,t);let n=t.entities.id,i=this._eventHelper.add(t.changedEvent,tr.prototype._onDataSourceChanged,this);this._dataSourceChangedListeners[n]=i};tr.prototype._onDataSourceRemoved=function(e,t){let n=t.entities.id;this._dataSourceChangedListeners[n](),this._dataSourceChangedListeners[n]=void 0};tr.prototype.addController=function(e){return this._cesiumWidget.addController(e)};tr.prototype.removeController=function(e){return this._cesiumWidget.removeController(e)};tr.prototype.zoomTo=function(e,t){return this._cesiumWidget.zoomTo(e,t)};tr.prototype.flyTo=function(e,t){return this._cesiumWidget.flyTo(e,t)};var vke=tr;function aGt(e){let t=document.createElement("div");t.className="cesium-viewer-cesium3DTilesInspectorContainer",e.container.appendChild(t);let n=new bW(t,e.scene);Object.defineProperties(e,{cesium3DTilesInspector:{get:function(){return n}}})}var Ske=aGt;function cGt(e){let t=document.createElement("div");t.className="cesium-viewer-cesiumInspectorContainer",e.container.appendChild(t);let n=new lW(t,e.scene);Object.defineProperties(e,{cesiumInspector:{get:function(){return n}}})}var wke=cGt;function lGt(e,t){t=t??H.EMPTY_OBJECT;let n=!0,i=t.flyToOnDrop??!0,r=new be,o=t.clearOnDrop??!0,s=t.dropTarget??e.container,a=t.clampToGround??!0,c=t.proxy;s=kn(s),Object.defineProperties(e,{dropTarget:{get:function(){return s},set:function(f){Ike(s,u),s=f,jae(s,u)}},dropEnabled:{get:function(){return n},set:function(f){f!==n&&(f?jae(s,u):Ike(s,u),n=f)}},dropError:{get:function(){return r}},clearOnDrop:{get:function(){return o},set:function(f){o=f}},flyToOnDrop:{get:function(){return i},set:function(f){i=f}},proxy:{get:function(){return c},set:function(f){c=f}},clampToGround:{get:function(){return a},set:function(f){a=f}}});function u(f){dE(f),o&&(e.entities.removeAll(),e.dataSources.removeAll());let d=f.dataTransfer.files,p=d.length;for(let g=0;g<p;g++){let m=d[g],y=new FileReader;y.onload=uGt(e,m,c,a),y.onerror=fGt(e,m),y.readAsText(m)}}jae(s,u),e.destroy=l7(e,e.destroy,function(){e.dropEnabled=!1}),e._handleDrop=u}function dE(e){e.stopPropagation(),e.preventDefault()}function Ike(e,t){let n=e;l(n)&&(n.removeEventListener("drop",t,!1),n.removeEventListener("dragenter",dE,!1),n.removeEventListener("dragover",dE,!1),n.removeEventListener("dragexit",dE,!1))}function jae(e,t){e.addEventListener("drop",t,!1),e.addEventListener("dragenter",dE,!1),e.addEventListener("dragover",dE,!1),e.addEventListener("dragexit",dE,!1)}function uGt(e,t,n,i){let r=e.scene;return function(o){let s=t.name;try{let a;if(/\.czml$/i.test(s))a=P8.load(JSON.parse(o.target.result),{sourceUri:s});else if(/\.geojson$/i.test(s)||/\.json$/i.test(s)||/\.topojson$/i.test(s))a=ST.load(JSON.parse(o.target.result),{sourceUri:s,clampToGround:i});else if(/\.(kml|kmz)$/i.test(s))a=Mw.load(t,{sourceUri:s,proxy:n,camera:r.camera,canvas:r.canvas,clampToGround:i,screenOverlayContainer:e.container});else if(/\.gpx$/i.test(s))a=AH.load(t,{sourceUri:s,proxy:n});else{e.dropError.raiseEvent(e,s,`Unrecognized file: ${s}`);return}l(a)&&e.dataSources.add(a).then(function(c){e.flyToOnDrop&&e.flyTo(c)}).catch(function(c){e.dropError.raiseEvent(e,s,c)})}catch(a){e.dropError.raiseEvent(e,s,a)}}}function fGt(e,t){return function(n){e.dropError.raiseEvent(e,t.name,n.target.error)}}var Pke=lGt;function dGt(e,t){t=t??H.EMPTY_OBJECT;let n=new RW({scene:e.scene,container:e.bottomContainer,lowFrameRateMessage:t.lowFrameRateMessage});Object.defineProperties(e,{performanceWatchdog:{get:function(){return n}}})}var Dke=dGt;function Rke(e){let t=e.split(` + </div>`,n.appendChild(i);let r=new vW(t);Se.track(r),Se.applyBindings(r,n),l(r.defaultLayer)&&(r.currentLayer=r.defaultLayer)}var hke=OHt;var MHt="M 13.84375 7.03125 C 11.412798 7.03125 9.46875 8.975298 9.46875 11.40625 L 9.46875 11.59375 L 2.53125 7.21875 L 2.53125 24.0625 L 9.46875 19.6875 C 9.4853444 22.104033 11.423165 24.0625 13.84375 24.0625 L 25.875 24.0625 C 28.305952 24.0625 30.28125 22.087202 30.28125 19.65625 L 30.28125 11.40625 C 30.28125 8.975298 28.305952 7.03125 25.875 7.03125 L 13.84375 7.03125 z",NHt="M 27.34375 1.65625 L 5.28125 27.9375 L 8.09375 30.3125 L 30.15625 4.03125 L 27.34375 1.65625 z M 13.84375 7.03125 C 11.412798 7.03125 9.46875 8.975298 9.46875 11.40625 L 9.46875 11.59375 L 2.53125 7.21875 L 2.53125 24.0625 L 9.46875 19.6875 C 9.4724893 20.232036 9.5676108 20.7379 9.75 21.21875 L 21.65625 7.03125 L 13.84375 7.03125 z M 28.21875 7.71875 L 14.53125 24.0625 L 25.875 24.0625 C 28.305952 24.0625 30.28125 22.087202 30.28125 19.65625 L 30.28125 11.40625 C 30.28125 9.8371439 29.456025 8.4902779 28.21875 7.71875 z";function Nae(){this._cameraClicked=new be,this._closeClicked=new be,this.maxHeight=500,this.enableCamera=!1,this.isCameraTracking=!1,this.showInfo=!1,this.titleText="",this.description="",Se.track(this,["showInfo","titleText","description","maxHeight","enableCamera","isCameraTracking"]),this._loadingIndicatorHtml='<div class="cesium-infoBox-loadingContainer"><span class="cesium-infoBox-loading"></span></div>',this.cameraIconPath=void 0,Se.defineProperty(this,"cameraIconPath",{get:function(){return!this.enableCamera||this.isCameraTracking?NHt:MHt}}),Se.defineProperty(this,"_bodyless",{get:function(){return!l(this.description)||this.description.length===0}})}Nae.prototype.maxHeightOffset=function(e){return`${this.maxHeight-e}px`};Object.defineProperties(Nae.prototype,{cameraClicked:{get:function(){return this._cameraClicked}},closeClicked:{get:function(){return this._closeClicked}}});var SW=Nae;function wW(e){e=kn(e);let t=document.createElement("div");t.className="cesium-infoBox",t.setAttribute("data-bind",'css: { "cesium-infoBox-visible" : showInfo, "cesium-infoBox-bodyless" : _bodyless }'),e.appendChild(t);let n=document.createElement("div");n.className="cesium-infoBox-title",n.setAttribute("data-bind","text: titleText"),t.appendChild(n);let i=t.ownerDocument,r,o,s,a,c;function u(b){!l(r)||l(b)&&b.pointerId!==r||(r=void 0,t.classList.remove("cesium-infoBox-dragging"))}function f(b){if(!(b.button!==0||b.isPrimary===!1)){r=b.pointerId,o=b.clientX,s=b.clientY,a=t.offsetLeft,c=t.offsetTop,t.style.left=`${a}px`,t.style.top=`${c}px`,t.style.right="auto",t.classList.add("cesium-infoBox-dragging");try{n.setPointerCapture(b.pointerId)}catch{}b.preventDefault()}}function d(b){!l(r)||b.pointerId!==r||(t.style.left=`${a+b.clientX-o}px`,t.style.top=`${c+b.clientY-s}px`,b.preventDefault())}n.addEventListener("pointerdown",f),i.addEventListener("pointermove",d),i.addEventListener("pointerup",u),i.addEventListener("pointercancel",u);let p=document.createElement("button");p.type="button",p.className="cesium-button cesium-infoBox-camera",p.setAttribute("data-bind",'attr: { title: "Focus camera on object" },click: function () { cameraClicked.raiseEvent(this); },enable: enableCamera,cesiumSvgPath: { path: cameraIconPath, width: 32, height: 32 }'),t.appendChild(p);let g=document.createElement("button");g.type="button",g.className="cesium-infoBox-close",g.setAttribute("data-bind","click: function () { closeClicked.raiseEvent(this); }"),g.innerHTML="×",t.appendChild(g);let m=document.createElement("iframe");m.className="cesium-infoBox-iframe",m.setAttribute("sandbox","allow-same-origin allow-popups allow-forms"),m.setAttribute("data-bind","style : { maxHeight : maxHeightOffset(40) }"),m.setAttribute("allowfullscreen",!0),t.appendChild(m);let y=new SW;Se.applyBindings(y,t),this._container=e,this._element=t,this._frame=m,this._viewModel=y,this._descriptionSubscription=void 0,this._titleElement=n,this._ownerDocument=i,this._handlePointerDown=f,this._handlePointerMove=d,this._stopDragging=u;let A=this;m.addEventListener("load",function(){let b=m.contentDocument,x=b.createElement("link");x.href=Zt("Widgets/InfoBox/InfoBoxDescription.css"),x.rel="stylesheet",x.type="text/css";let T=b.createElement("div");T.className="cesium-infoBox-description",b.head.appendChild(x),b.body.appendChild(T),A._descriptionSubscription=Oc(y,"description",function(E){m.style.height="5px",T.innerHTML=E;let v=null,S=T.firstElementChild;if(S!==null&&T.childNodes.length===1){let R=window.getComputedStyle(S);if(R!==null){let O=R["background-color"],L=z.fromCssColorString(O);l(L)&&L.alpha!==0&&(v=R["background-color"])}}t.style["background-color"]=v;let I=T.getBoundingClientRect().height;m.style.height=`${I}px`})}),m.setAttribute("src","about:blank")}Object.defineProperties(wW.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}},frame:{get:function(){return this._frame}}});wW.prototype.isDestroyed=function(){return!1};wW.prototype.destroy=function(){let e=this._container,t=this._ownerDocument;return this._titleElement.removeEventListener("pointerdown",this._handlePointerDown),t.removeEventListener("pointermove",this._handlePointerMove),t.removeEventListener("pointerup",this._stopDragging),t.removeEventListener("pointercancel",this._stopDragging),Se.cleanNode(this._element),e.removeChild(this._element),l(this._descriptionSubscription)&&this._descriptionSubscription.dispose(),le(this)};var IW=wW;function mke(){this.showInstructions=!1;let e=this;this._command=On(function(){e.showInstructions=!e.showInstructions}),this._showClick=On(function(){e._touch=!1}),this._showTouch=On(function(){e._touch=!0}),this._touch=!1,this.tooltip="Navigation Instructions",Se.track(this,["tooltip","showInstructions","_touch"])}Object.defineProperties(mke.prototype,{command:{get:function(){return this._command}},showClick:{get:function(){return this._showClick}},showTouch:{get:function(){return this._showTouch}}});var PW=mke;function DW(e){let t=kn(e.container),n=new PW,i=e.instructionsInitiallyVisible??!1;n.showInstructions=i,n._svgPath="M16,1.466C7.973,1.466,1.466,7.973,1.466,16c0,8.027,6.507,14.534,14.534,14.534c8.027,0,14.534-6.507,14.534-14.534C30.534,7.973,24.027,1.466,16,1.466z M17.328,24.371h-2.707v-2.596h2.707V24.371zM17.328,19.003v0.858h-2.707v-1.057c0-3.19,3.63-3.696,3.63-5.963c0-1.034-0.924-1.826-2.134-1.826c-1.254,0-2.354,0.924-2.354,0.924l-1.541-1.915c0,0,1.519-1.584,4.137-1.584c2.487,0,4.796,1.54,4.796,4.136C21.156,16.208,17.328,16.627,17.328,19.003z";let r=document.createElement("span");r.className="cesium-navigationHelpButton-wrapper",t.appendChild(r);let o=document.createElement("button");o.type="button",o.className="cesium-button cesium-toolbar-button cesium-navigation-help-button",o.setAttribute("data-bind","attr: { title: tooltip },click: command,cesiumSvgPath: { path: _svgPath, width: 32, height: 32 }"),r.appendChild(o);let s=document.createElement("div");s.className="cesium-navigation-help",s.setAttribute("data-bind",'css: { "cesium-navigation-help-visible" : showInstructions}'),r.appendChild(s);let a=document.createElement("button");a.type="button",a.className="cesium-navigation-button cesium-navigation-button-left",a.setAttribute("data-bind",'click: showClick, css: {"cesium-navigation-button-selected": !_touch, "cesium-navigation-button-unselected": _touch}');let c=document.createElement("img");c.src=Zt("Widgets/Images/NavigationHelp/Mouse.svg"),c.className="cesium-navigation-button-icon",c.style.width="25px",c.style.height="25px",a.appendChild(c),a.appendChild(document.createTextNode("Mouse"));let u=document.createElement("button");u.type="button",u.className="cesium-navigation-button cesium-navigation-button-right",u.setAttribute("data-bind",'click: showTouch, css: {"cesium-navigation-button-selected": _touch, "cesium-navigation-button-unselected": !_touch}');let f=document.createElement("img");f.src=Zt("Widgets/Images/NavigationHelp/Touch.svg"),f.className="cesium-navigation-button-icon",f.style.width="25px",f.style.height="25px",u.appendChild(f),u.appendChild(document.createTextNode("Touch")),s.appendChild(a),s.appendChild(u);let d=document.createElement("div");d.className="cesium-click-navigation-help cesium-navigation-help-instructions",d.setAttribute("data-bind",'css: { "cesium-click-navigation-help-visible" : !_touch}'),d.innerHTML=` <table> <tr> <td><img src="${Zt("Widgets/Images/NavigationHelp/MouseLeft.svg")}" width="48" height="48" /></td> <td> <div class="cesium-navigation-help-pan">Pan view</div> <div class="cesium-navigation-help-details">Left click + drag</div> </td> </tr> <tr> <td><img src="${Zt("Widgets/Images/NavigationHelp/MouseRight.svg")}" width="48" height="48" /></td> <td> <div class="cesium-navigation-help-zoom">Zoom view</div> <div class="cesium-navigation-help-details">Right click + drag, or</div> <div class="cesium-navigation-help-details">Mouse wheel scroll</div> </td> </tr> <tr> <td><img src="${Zt("Widgets/Images/NavigationHelp/MouseMiddle.svg")}" width="48" height="48" /></td> <td> <div class="cesium-navigation-help-rotate">Rotate view</div> <div class="cesium-navigation-help-details">Middle click + drag, or</div> <div class="cesium-navigation-help-details">CTRL + Left/Right click + drag</div> </td> </tr> </table>`,s.appendChild(d);let p=document.createElement("div");p.className="cesium-touch-navigation-help cesium-navigation-help-instructions",p.setAttribute("data-bind",'css: { "cesium-touch-navigation-help-visible" : _touch}'),p.innerHTML=` <table> <tr> <td><img src="${Zt("Widgets/Images/NavigationHelp/TouchDrag.svg")}" width="70" height="48" /></td> <td> <div class="cesium-navigation-help-pan">Pan view</div> <div class="cesium-navigation-help-details">One finger drag</div> </td> </tr> <tr> <td><img src="${Zt("Widgets/Images/NavigationHelp/TouchZoom.svg")}" width="70" height="48" /></td> <td> <div class="cesium-navigation-help-zoom">Zoom view</div> <div class="cesium-navigation-help-details">Two finger pinch</div> </td> </tr> <tr> <td><img src="${Zt("Widgets/Images/NavigationHelp/TouchTilt.svg")}" width="70" height="48" /></td> <td> <div class="cesium-navigation-help-rotate">Tilt view</div> <div class="cesium-navigation-help-details">Two finger drag, same direction</div> </td> </tr> <tr> <td><img src="${Zt("Widgets/Images/NavigationHelp/TouchRotate.svg")}" width="70" height="48" /></td> <td> <div class="cesium-navigation-help-tilt">Rotate view</div> <div class="cesium-navigation-help-details">Two finger drag, opposite direction</div> </td> </tr> </table>`,s.appendChild(p),Se.applyBindings(n,r),this._container=t,this._viewModel=n,this._wrapper=r,this._closeInstructions=function(g){r.contains(g.target)||(n.showInstructions=!1)},dn.supportsPointerEvents()?document.addEventListener("pointerdown",this._closeInstructions,!0):(document.addEventListener("mousedown",this._closeInstructions,!0),document.addEventListener("touchstart",this._closeInstructions,!0))}Object.defineProperties(DW.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}}});DW.prototype.isDestroyed=function(){return!1};DW.prototype.destroy=function(){return dn.supportsPointerEvents()?document.removeEventListener("pointerdown",this._closeInstructions,!0):(document.removeEventListener("mousedown",this._closeInstructions,!0),document.removeEventListener("touchstart",this._closeInstructions,!0)),Se.cleanNode(this._wrapper),this._container.removeChild(this._wrapper),le(this)};var RW=DW;function Lae(e){this._scene=e.scene,this.lowFrameRateMessage=e.lowFrameRateMessage??"This application appears to be performing poorly on your system. Please try using a different web browser or updating your video drivers.",this.lowFrameRateMessageDismissed=!1,this.showingLowFrameRateMessage=!1,Se.track(this,["lowFrameRateMessage","lowFrameRateMessageDismissed","showingLowFrameRateMessage"]);let t=this;this._dismissMessage=On(function(){t.showingLowFrameRateMessage=!1,t.lowFrameRateMessageDismissed=!0});let n=v7.fromScene(e.scene);this._unsubscribeLowFrameRate=n.lowFrameRate.addEventListener(function(){t.lowFrameRateMessageDismissed||(t.showingLowFrameRateMessage=!0)}),this._unsubscribeNominalFrameRate=n.nominalFrameRate.addEventListener(function(){t.showingLowFrameRateMessage=!1})}Object.defineProperties(Lae.prototype,{scene:{get:function(){return this._scene}},dismissMessage:{get:function(){return this._dismissMessage}}});Lae.prototype.destroy=function(){return this._unsubscribeLowFrameRate(),this._unsubscribeNominalFrameRate(),le(this)};var OW=Lae;function MW(e){let t=kn(e.container),n=new OW(e),i=document.createElement("div");i.className="cesium-performance-watchdog-message-area",i.setAttribute("data-bind","visible: showingLowFrameRateMessage");let r=document.createElement("button");r.setAttribute("type","button"),r.className="cesium-performance-watchdog-message-dismiss",r.innerHTML="×",r.setAttribute("data-bind","click: dismissMessage"),i.appendChild(r);let o=document.createElement("div");o.className="cesium-performance-watchdog-message",o.setAttribute("data-bind","html: lowFrameRateMessage"),i.appendChild(o),t.appendChild(i),Se.applyBindings(n,i),this._container=t,this._viewModel=n,this._element=i}Object.defineProperties(MW.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}}});MW.prototype.isDestroyed=function(){return!1};MW.prototype.destroy=function(){return this._viewModel.destroy(),Se.cleanNode(this._element),this._container.removeChild(this._element),le(this)};var NW=MW;function LW(e){this._scene=e,this._orthographic=e.camera.frustum instanceof _n,this._flightInProgress=!1,this.dropDownVisible=!1,this.tooltipPerspective="Perspective Projection",this.tooltipOrthographic="Orthographic Projection",this.selectedTooltip=void 0,this.sceneMode=e.mode,Se.track(this,["_orthographic","_flightInProgress","sceneMode","dropDownVisible","tooltipPerspective","tooltipOrthographic"]);let t=this;Se.defineProperty(this,"selectedTooltip",function(){return t._orthographic?t.tooltipOrthographic:t.tooltipPerspective}),this._toggleDropDown=On(function(){t.sceneMode===re.SCENE2D||t._flightInProgress||(t.dropDownVisible=!t.dropDownVisible)}),this._eventHelper=new Wo,this._eventHelper.add(e.morphComplete,function(n,i,r,o){t.sceneMode=r,t._orthographic=r===re.SCENE2D||t._scene.camera.frustum instanceof _n}),this._eventHelper.add(e.preRender,function(){t._flightInProgress=l(e.camera._currentFlight)}),this._switchToPerspective=On(function(){t.sceneMode!==re.SCENE2D&&(t._scene.camera.switchToPerspectiveFrustum(),t._orthographic=!1,t.dropDownVisible=!1)}),this._switchToOrthographic=On(function(){t.sceneMode!==re.SCENE2D&&(t._scene.camera.switchToOrthographicFrustum(),t._orthographic=!0,t.dropDownVisible=!1)}),this._sceneMode=re}Object.defineProperties(LW.prototype,{scene:{get:function(){return this._scene}},toggleDropDown:{get:function(){return this._toggleDropDown}},switchToPerspective:{get:function(){return this._switchToPerspective}},switchToOrthographic:{get:function(){return this._switchToOrthographic}},isOrthographicProjection:{get:function(){return this._orthographic}}});LW.prototype.isDestroyed=function(){return!1};LW.prototype.destroy=function(){this._eventHelper.removeAll(),le(this)};var FW=LW;var LHt="M 28.15625,10.4375 9.125,13.21875 13.75,43.25 41.75,55.09375 50.8125,37 54.5,11.9375 z m 0.125,3 19.976451,0.394265 L 43.03125,16.875 22.6875,14.28125 z M 50.971746,15.705477 47.90625,36.03125 42.53125,46 44.84375,19.3125 z M 12.625,16.03125 l 29.15625,3.6875 -2.65625,31 L 16.4375,41.125 z",FHt="m 31.560594,6.5254438 -20.75,12.4687502 0.1875,24.5625 22.28125,11.8125 19.5,-12 0.65625,-0.375 0,-0.75 0.0312,-23.21875 z m 0.0625,3.125 16.65625,9.5000002 -16.125,10.28125 -17.34375,-9.71875 z m 18.96875,11.1875002 0.15625,20.65625 -17.46875,10.59375 0.15625,-20.28125 z m -37.0625,1.25 17.21875,9.625 -0.15625,19.21875 -16.9375,-9 z";function BW(e,t){e=kn(e);let n=new FW(t);n._perspectivePath=LHt,n._orthographicPath=FHt;let i=document.createElement("span");i.className="cesium-projectionPicker-wrapper cesium-toolbar-button",e.appendChild(i);let r=document.createElement("button");r.type="button",r.className="cesium-button cesium-toolbar-button",r.setAttribute("data-bind",'css: { "cesium-projectionPicker-buttonPerspective": !_orthographic, "cesium-projectionPicker-buttonOrthographic": _orthographic, "cesium-button-disabled" : sceneMode === _sceneMode.SCENE2D || _flightInProgress, "cesium-projectionPicker-selected": dropDownVisible },attr: { title: selectedTooltip },click: toggleDropDown'),r.innerHTML='<!-- ko cesiumSvgPath: { path: _perspectivePath, width: 64, height: 64, css: "cesium-projectionPicker-iconPerspective" } --><!-- /ko --><!-- ko cesiumSvgPath: { path: _orthographicPath, width: 64, height: 64, css: "cesium-projectionPicker-iconOrthographic" } --><!-- /ko -->',i.appendChild(r);let o=document.createElement("button");o.type="button",o.className="cesium-button cesium-toolbar-button cesium-projectionPicker-dropDown-icon",o.setAttribute("data-bind",'css: { "cesium-projectionPicker-visible" : (dropDownVisible && _orthographic), "cesium-projectionPicker-none" : !_orthographic, "cesium-projectionPicker-hidden" : !dropDownVisible },attr: { title: tooltipPerspective },click: switchToPerspective,cesiumSvgPath: { path: _perspectivePath, width: 64, height: 64 }'),i.appendChild(o);let s=document.createElement("button");s.type="button",s.className="cesium-button cesium-toolbar-button cesium-projectionPicker-dropDown-icon",s.setAttribute("data-bind",'css: { "cesium-projectionPicker-visible" : (dropDownVisible && !_orthographic), "cesium-projectionPicker-none" : _orthographic, "cesium-projectionPicker-hidden" : !dropDownVisible},attr: { title: tooltipOrthographic },click: switchToOrthographic,cesiumSvgPath: { path: _orthographicPath, width: 64, height: 64 }'),i.appendChild(s),Se.applyBindings(n,i),this._viewModel=n,this._container=e,this._wrapper=i,this._closeDropDown=function(a){i.contains(a.target)||(n.dropDownVisible=!1)},dn.supportsPointerEvents()?document.addEventListener("pointerdown",this._closeDropDown,!0):(document.addEventListener("mousedown",this._closeDropDown,!0),document.addEventListener("touchstart",this._closeDropDown,!0))}Object.defineProperties(BW.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}}});BW.prototype.isDestroyed=function(){return!1};BW.prototype.destroy=function(){return this._viewModel.destroy(),dn.supportsPointerEvents()?document.removeEventListener("pointerdown",this._closeDropDown,!0):(document.removeEventListener("mousedown",this._closeDropDown,!0),document.removeEventListener("touchstart",this._closeDropDown,!0)),Se.cleanNode(this._wrapper),this._container.removeChild(this._wrapper),le(this)};var kW=BW;function UW(e,t){this._scene=e;let n=this,i=function(r,o,s,a){n.sceneMode=s,n.dropDownVisible=!1};this._eventHelper=new Wo,this._eventHelper.add(e.morphStart,i),this._duration=t??2,this.sceneMode=e.mode,this.dropDownVisible=!1,this.tooltip2D="2D",this.tooltip3D="3D",this.tooltipColumbusView="Columbus View",Se.track(this,["sceneMode","dropDownVisible","tooltip2D","tooltip3D","tooltipColumbusView"]),this.selectedTooltip=void 0,Se.defineProperty(this,"selectedTooltip",function(){let r=n.sceneMode;return r===re.SCENE2D?n.tooltip2D:r===re.SCENE3D?n.tooltip3D:n.tooltipColumbusView}),this._toggleDropDown=On(function(){n.dropDownVisible=!n.dropDownVisible}),this._morphTo2D=On(function(){e.morphTo2D(n._duration)}),this._morphTo3D=On(function(){e.morphTo3D(n._duration)}),this._morphToColumbusView=On(function(){e.morphToColumbusView(n._duration)}),this._sceneMode=re}Object.defineProperties(UW.prototype,{scene:{get:function(){return this._scene}},duration:{get:function(){return this._duration},set:function(e){this._duration=e}},toggleDropDown:{get:function(){return this._toggleDropDown}},morphTo2D:{get:function(){return this._morphTo2D}},morphTo3D:{get:function(){return this._morphTo3D}},morphToColumbusView:{get:function(){return this._morphToColumbusView}}});UW.prototype.isDestroyed=function(){return!1};UW.prototype.destroy=function(){this._eventHelper.removeAll(),le(this)};var zW=UW;var BHt="m 32.401392,4.9330437 c -7.087603,0 -14.096095,2.884602 -19.10793,7.8946843 -5.0118352,5.010083 -7.9296167,11.987468 -7.9296167,19.072999 0,7.085531 2.9177815,14.097848 7.9296167,19.107931 4.837653,4.835961 11.541408,7.631372 18.374354,7.82482 0.05712,0.01231 0.454119,0.139729 0.454119,0.139729 l 0.03493,-0.104797 c 0.08246,7.84e-4 0.162033,0.03493 0.244525,0.03493 0.08304,0 0.161515,-0.03414 0.244526,-0.03493 l 0.03493,0.104797 c 0,0 0.309474,-0.129487 0.349323,-0.139729 6.867765,-0.168094 13.582903,-2.965206 18.444218,-7.82482 2.558195,-2.5573 4.551081,-5.638134 5.903547,-8.977584 1.297191,-3.202966 2.02607,-6.661489 2.02607,-10.130347 0,-6.237309 -2.366261,-12.31219 -6.322734,-17.116794 -0.0034,-0.02316 0.0049,-0.04488 0,-0.06986 -0.01733,-0.08745 -0.104529,-0.278855 -0.104797,-0.279458 -5.31e-4,-0.0012 -0.522988,-0.628147 -0.523984,-0.62878 -3.47e-4,-2.2e-4 -0.133444,-0.03532 -0.244525,-0.06987 C 51.944299,13.447603 51.751076,13.104317 51.474391,12.827728 46.462556,7.8176457 39.488996,4.9330437 32.401392,4.9330437 z m -2.130866,3.5281554 0.104797,9.6762289 c -4.111695,-0.08361 -7.109829,-0.423664 -9.257041,-0.943171 1.198093,-2.269271 2.524531,-4.124404 3.91241,-5.414496 2.167498,-2.0147811 3.950145,-2.8540169 5.239834,-3.3185619 z m 2.794579,0 c 1.280302,0.4754953 3.022186,1.3285948 5.065173,3.2486979 1.424667,1.338973 2.788862,3.303645 3.982275,5.728886 -2.29082,0.403367 -5.381258,0.621049 -8.942651,0.698645 L 33.065105,8.4611991 z m 5.728886,0.2445256 c 4.004072,1.1230822 7.793098,3.1481363 10.724195,6.0782083 0.03468,0.03466 0.07033,0.06991 0.104797,0.104797 -0.45375,0.313891 -0.923054,0.663002 -1.956205,1.082899 -0.647388,0.263114 -1.906242,0.477396 -2.829511,0.733577 -1.382296,-2.988132 -3.027146,-5.368585 -4.785716,-7.0213781 -0.422866,-0.397432 -0.835818,-0.6453247 -1.25756,-0.9781032 z m -15.33525,0.7685092 c -0.106753,0.09503 -0.207753,0.145402 -0.31439,0.244526 -1.684973,1.5662541 -3.298068,3.8232211 -4.680919,6.5672591 -0.343797,-0.14942 -1.035052,-0.273198 -1.292493,-0.419186 -0.956528,-0.542427 -1.362964,-1.022024 -1.537018,-1.292493 -0.0241,-0.03745 -0.01868,-0.0401 -0.03493,-0.06986 2.250095,-2.163342 4.948824,-3.869984 7.859752,-5.0302421 z m -9.641296,7.0912431 c 0.464973,0.571618 0.937729,1.169056 1.956205,1.746612 0.349907,0.198425 1.107143,0.335404 1.537018,0.523983 -1.20166,3.172984 -1.998037,7.051901 -2.165798,11.772162 C 14.256557,30.361384 12.934823,30.161483 12.280427,29.90959 10.644437,29.279855 9.6888882,28.674891 9.1714586,28.267775 8.6540289,27.860658 8.6474751,27.778724 8.6474751,27.778724 l -0.069864,0.03493 C 9.3100294,23.691285 11.163248,19.798527 13.817445,16.565477 z m 37.552149,0.523984 c 2.548924,3.289983 4.265057,7.202594 4.890513,11.318043 -0.650428,0.410896 -1.756876,1.001936 -3.563088,1.606882 -1.171552,0.392383 -3.163859,0.759153 -4.960377,1.117832 -0.04367,-4.752703 -0.784809,-8.591423 -1.88634,-11.807094 0.917574,-0.263678 2.170552,-0.486495 2.864443,-0.76851 1.274693,-0.518066 2.003942,-1.001558 2.654849,-1.467153 z m -31.439008,2.619917 c 2.487341,0.672766 5.775813,1.137775 10.479669,1.222628 l 0.104797,10.689263 0,0.03493 0,0.733577 c -5.435005,-0.09059 -9.512219,-0.519044 -12.610536,-1.117831 0.106127,-4.776683 0.879334,-8.55791 2.02607,-11.562569 z m 23.264866,0.31439 c 1.073459,3.067541 1.833795,6.821314 1.816476,11.702298 -3.054474,0.423245 -7.062018,0.648559 -11.702298,0.698644 l 0,-0.838373 -0.104796,-10.654331 c 4.082416,-0.0864 7.404468,-0.403886 9.990618,-0.908238 z M 8.2632205,30.922625 c 0.7558676,0.510548 1.5529563,1.013339 3.0041715,1.57195 0.937518,0.360875 2.612202,0.647642 3.91241,0.978102 0.112814,3.85566 0.703989,7.107756 1.606883,9.920754 -1.147172,-0.324262 -2.644553,-0.640648 -3.423359,-0.978102 -1.516688,-0.657177 -2.386627,-1.287332 -2.864443,-1.71168 -0.477816,-0.424347 -0.489051,-0.489051 -0.489051,-0.489051 L 9.8002387,40.319395 C 8.791691,37.621767 8.1584238,34.769583 8.1584238,31.900727 c 0,-0.330153 0.090589,-0.648169 0.1047967,-0.978102 z m 48.2763445,0.419186 c 0.0047,0.188973 0.06986,0.36991 0.06986,0.558916 0,2.938869 -0.620228,5.873558 -1.676747,8.628261 -0.07435,0.07583 -0.06552,0.07411 -0.454119,0.349323 -0.606965,0.429857 -1.631665,1.042044 -3.318562,1.676747 -1.208528,0.454713 -3.204964,0.850894 -5.135038,1.25756 0.84593,-2.765726 1.41808,-6.005357 1.606883,-9.815957 2.232369,-0.413371 4.483758,-0.840201 5.938479,-1.327425 1.410632,-0.472457 2.153108,-0.89469 2.96924,-1.327425 z m -38.530252,2.864443 c 3.208141,0.56697 7.372279,0.898588 12.575603,0.978103 l 0.174662,9.885821 c -4.392517,-0.06139 -8.106722,-0.320566 -10.863925,-0.803441 -1.051954,-2.664695 -1.692909,-6.043794 -1.88634,-10.060483 z m 26.793022,0.31439 c -0.246298,3.923551 -0.877762,7.263679 -1.816476,9.885822 -2.561957,0.361954 -5.766249,0.560708 -9.431703,0.62878 l -0.174661,-9.815957 c 4.491734,-0.04969 8.334769,-0.293032 11.42284,-0.698645 z M 12.035901,44.860585 c 0.09977,0.04523 0.105535,0.09465 0.209594,0.139729 1.337656,0.579602 3.441099,1.058072 5.589157,1.537018 1.545042,3.399208 3.548524,5.969402 5.589157,7.789888 -3.034411,-1.215537 -5.871615,-3.007978 -8.174142,-5.309699 -1.245911,-1.245475 -2.271794,-2.662961 -3.213766,-4.156936 z m 40.69605,0 c -0.941972,1.493975 -1.967855,2.911461 -3.213765,4.156936 -2.74253,2.741571 -6.244106,4.696717 -9.955686,5.868615 0.261347,-0.241079 0.507495,-0.394491 0.768509,-0.663713 1.674841,-1.727516 3.320792,-4.181056 4.645987,-7.265904 2.962447,-0.503021 5.408965,-1.122293 7.161107,-1.781544 0.284034,-0.106865 0.337297,-0.207323 0.593848,-0.31439 z m -31.404076,2.305527 c 2.645807,0.376448 5.701178,0.649995 9.466635,0.698645 l 0.139729,7.789888 c -1.38739,-0.480844 -3.316218,-1.29837 -5.659022,-3.388427 -1.388822,-1.238993 -2.743668,-3.0113 -3.947342,-5.100106 z m 20.365491,0.104797 c -1.04872,2.041937 -2.174337,3.779068 -3.353494,4.995309 -1.853177,1.911459 -3.425515,2.82679 -4.611055,3.353494 l -0.139729,-7.789887 c 3.13091,-0.05714 5.728238,-0.278725 8.104278,-0.558916 z",kHt="m 2.9825053,17.550598 0,1.368113 0,26.267766 0,1.368113 1.36811,0 54.9981397,0 1.36811,0 0,-1.368113 0,-26.267766 0,-1.368113 -1.36811,0 -54.9981397,0 -1.36811,0 z m 2.73623,2.736226 10.3292497,0 0,10.466063 -10.3292497,0 0,-10.466063 z m 13.0654697,0 11.69737,0 0,10.466063 -11.69737,0 0,-10.466063 z m 14.43359,0 11.69737,0 0,10.466063 -11.69737,0 0,-10.466063 z m 14.43359,0 10.32926,0 0,10.466063 -10.32926,0 0,-10.466063 z m -41.9326497,13.202288 10.3292497,0 0,10.329252 -10.3292497,0 0,-10.329252 z m 13.0654697,0 11.69737,0 0,10.329252 -11.69737,0 0,-10.329252 z m 14.43359,0 11.69737,0 0,10.329252 -11.69737,0 0,-10.329252 z m 14.43359,0 10.32926,0 0,10.329252 -10.32926,0 0,-10.329252 z",UHt="m 14.723969,17.675598 -0.340489,0.817175 -11.1680536,26.183638 -0.817175,1.872692 2.076986,0 54.7506996,0 2.07698,0 -0.81717,-1.872692 -11.16805,-26.183638 -0.34049,-0.817175 -0.91933,0 -32.414586,0 -0.919322,0 z m 1.838643,2.723916 6.196908,0 -2.928209,10.418977 -7.729111,0 4.460412,-10.418977 z m 9.02297,0 4.903049,0 0,10.418977 -7.831258,0 2.928209,-10.418977 z m 7.626964,0 5.584031,0 2.62176,10.418977 -8.205791,0 0,-10.418977 z m 8.410081,0 5.51593,0 4.46042,10.418977 -7.38863,0 -2.58772,-10.418977 z m -30.678091,13.142892 8.103649,0 -2.89416,10.282782 -9.6018026,0 4.3923136,-10.282782 z m 10.929711,0 8.614384,0 0,10.282782 -11.508544,0 2.89416,-10.282782 z m 11.338299,0 8.852721,0 2.58772,10.282782 -11.440441,0 0,-10.282782 z m 11.678781,0 7.86531,0 4.39231,10.282782 -9.6699,0 -2.58772,-10.282782 z";function VW(e,t,n){e=kn(e);let i=new zW(t,n);i._globePath=BHt,i._flatMapPath=kHt,i._columbusViewPath=UHt;let r=document.createElement("span");r.className="cesium-sceneModePicker-wrapper cesium-toolbar-button",e.appendChild(r);let o=document.createElement("button");o.type="button",o.className="cesium-button cesium-toolbar-button",o.setAttribute("data-bind",'css: { "cesium-sceneModePicker-button2D": sceneMode === _sceneMode.SCENE2D, "cesium-sceneModePicker-button3D": sceneMode === _sceneMode.SCENE3D, "cesium-sceneModePicker-buttonColumbusView": sceneMode === _sceneMode.COLUMBUS_VIEW, "cesium-sceneModePicker-selected": dropDownVisible },attr: { title: selectedTooltip },click: toggleDropDown'),o.innerHTML='<!-- ko cesiumSvgPath: { path: _globePath, width: 64, height: 64, css: "cesium-sceneModePicker-slide-svg cesium-sceneModePicker-icon3D" } --><!-- /ko --><!-- ko cesiumSvgPath: { path: _flatMapPath, width: 64, height: 64, css: "cesium-sceneModePicker-slide-svg cesium-sceneModePicker-icon2D" } --><!-- /ko --><!-- ko cesiumSvgPath: { path: _columbusViewPath, width: 64, height: 64, css: "cesium-sceneModePicker-slide-svg cesium-sceneModePicker-iconColumbusView" } --><!-- /ko -->',r.appendChild(o);let s=document.createElement("button");s.type="button",s.className="cesium-button cesium-toolbar-button cesium-sceneModePicker-dropDown-icon",s.setAttribute("data-bind",'css: { "cesium-sceneModePicker-visible" : (dropDownVisible && (sceneMode !== _sceneMode.SCENE3D)) || (!dropDownVisible && (sceneMode === _sceneMode.SCENE3D)), "cesium-sceneModePicker-none" : sceneMode === _sceneMode.SCENE3D, "cesium-sceneModePicker-hidden" : !dropDownVisible },attr: { title: tooltip3D },click: morphTo3D,cesiumSvgPath: { path: _globePath, width: 64, height: 64 }'),r.appendChild(s);let a=document.createElement("button");a.type="button",a.className="cesium-button cesium-toolbar-button cesium-sceneModePicker-dropDown-icon",a.setAttribute("data-bind",'css: { "cesium-sceneModePicker-visible" : (dropDownVisible && (sceneMode !== _sceneMode.SCENE2D)), "cesium-sceneModePicker-none" : sceneMode === _sceneMode.SCENE2D, "cesium-sceneModePicker-hidden" : !dropDownVisible },attr: { title: tooltip2D },click: morphTo2D,cesiumSvgPath: { path: _flatMapPath, width: 64, height: 64 }'),r.appendChild(a);let c=document.createElement("button");c.type="button",c.className="cesium-button cesium-toolbar-button cesium-sceneModePicker-dropDown-icon",c.setAttribute("data-bind",'css: { "cesium-sceneModePicker-visible" : (dropDownVisible && (sceneMode !== _sceneMode.COLUMBUS_VIEW)) || (!dropDownVisible && (sceneMode === _sceneMode.COLUMBUS_VIEW)), "cesium-sceneModePicker-none" : sceneMode === _sceneMode.COLUMBUS_VIEW, "cesium-sceneModePicker-hidden" : !dropDownVisible},attr: { title: tooltipColumbusView },click: morphToColumbusView,cesiumSvgPath: { path: _columbusViewPath, width: 64, height: 64 }'),r.appendChild(c),Se.applyBindings(i,r),this._viewModel=i,this._container=e,this._wrapper=r,this._closeDropDown=function(u){r.contains(u.target)||(i.dropDownVisible=!1)},dn.supportsPointerEvents()?document.addEventListener("pointerdown",this._closeDropDown,!0):(document.addEventListener("mousedown",this._closeDropDown,!0),document.addEventListener("touchstart",this._closeDropDown,!0))}Object.defineProperties(VW.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}}});VW.prototype.isDestroyed=function(){return!1};VW.prototype.destroy=function(){return this._viewModel.destroy(),dn.supportsPointerEvents()?document.removeEventListener("pointerdown",this._closeDropDown,!0):(document.removeEventListener("mousedown",this._closeDropDown,!0),document.removeEventListener("touchstart",this._closeDropDown,!0)),Se.cleanNode(this._wrapper),this._container.removeChild(this._wrapper),le(this)};var jW=VW;var zHt=new U,HW="-1000px";function tN(e,t,n){this._scene=e,this._screenPositionX=HW,this._screenPositionY=HW,this._tweens=e.tweens,this._container=n??document.body,this._selectionIndicatorElement=t,this._scale=1,this.position=void 0,this.showSelection=!1,Se.track(this,["position","_screenPositionX","_screenPositionY","_scale","showSelection"]),this.isVisible=void 0,Se.defineProperty(this,"isVisible",{get:function(){return this.showSelection&&l(this.position)}}),Se.defineProperty(this,"_transform",{get:function(){return`scale(${this._scale})`}}),this.computeScreenSpacePosition=function(i,r){return pr.worldToWindowCoordinates(e,i,r)}}tN.prototype.update=function(){if(this.showSelection&&l(this.position)){let e=this.computeScreenSpacePosition(this.position,zHt);if(!l(e))this._screenPositionX=HW,this._screenPositionY=HW;else{let t=this._container,n=t.parentNode.clientWidth,i=t.parentNode.clientHeight,r=this._selectionIndicatorElement.clientWidth,o=r*.5;e.x=Math.min(Math.max(e.x,-r),n+r)-o,e.y=Math.min(Math.max(e.y,-r),i+r)-o,this._screenPositionX=`${Math.floor(e.x+.25)}px`,this._screenPositionY=`${Math.floor(e.y+.25)}px`}}};tN.prototype.animateAppear=function(){this._tweens.addProperty({object:this,property:"_scale",startValue:2,stopValue:1,duration:.8,easingFunction:ks.EXPONENTIAL_OUT})};tN.prototype.animateDepart=function(){this._tweens.addProperty({object:this,property:"_scale",startValue:this._scale,stopValue:1.5,duration:.8,easingFunction:ks.EXPONENTIAL_OUT})};Object.defineProperties(tN.prototype,{container:{get:function(){return this._container}},selectionIndicatorElement:{get:function(){return this._selectionIndicatorElement}},scene:{get:function(){return this._scene}}});var GW=tN;function WW(e,t){e=kn(e),this._container=e;let n=document.createElement("div");n.className="cesium-selection-wrapper",n.setAttribute("data-bind",'style: { "top" : _screenPositionY, "left" : _screenPositionX },css: { "cesium-selection-wrapper-visible" : isVisible }'),e.appendChild(n),this._element=n;let i="http://www.w3.org/2000/svg",r="M -34 -34 L -34 -11.25 L -30 -15.25 L -30 -30 L -15.25 -30 L -11.25 -34 L -34 -34 z M 11.25 -34 L 15.25 -30 L 30 -30 L 30 -15.25 L 34 -11.25 L 34 -34 L 11.25 -34 z M -34 11.25 L -34 34 L -11.25 34 L -15.25 30 L -30 30 L -30 15.25 L -34 11.25 z M 34 11.25 L 30 15.25 L 30 30 L 15.25 30 L 11.25 34 L 34 34 L 34 11.25 z",o=document.createElementNS(i,"svg:svg");o.setAttribute("width",160),o.setAttribute("height",160),o.setAttribute("viewBox","0 0 160 160");let s=document.createElementNS(i,"g");s.setAttribute("transform","translate(80,80)"),o.appendChild(s);let a=document.createElementNS(i,"path");a.setAttribute("data-bind","attr: { transform: _transform }"),a.setAttribute("d",r),s.appendChild(a),n.appendChild(o);let c=new GW(t,this._element,this._container);this._viewModel=c,Se.applyBindings(this._viewModel,this._element)}Object.defineProperties(WW.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}}});WW.prototype.isDestroyed=function(){return!1};WW.prototype.destroy=function(){let e=this._container;return Se.cleanNode(this._element),e.removeChild(this._element),le(this)};var qW=WW;function fE(e,t,n){this._color=e,this._height=t,this._base=n??0}fE.prototype.getHeight=function(){return this._height};fE.prototype.getBase=function(){return this._base};fE.prototype.getStartTime=function(){return this._start};fE.prototype.getStopTime=function(){return this._stop};fE.prototype.setRange=function(e,t){this._start=e,this._stop=t};fE.prototype.render=function(e){let t="";if(this._start&&this._stop&&this._color){let n=K.secondsDifference(this._start,e.epochJulian),i=Math.round(e.timeBarWidth*e.getAlpha(n)),r=K.secondsDifference(this._stop,e.epochJulian),o=Math.round(e.timeBarWidth*e.getAlpha(r))-i;i<0&&(o+=i,i=0),i+o>e.timeBarWidth&&(o=e.timeBarWidth-i),o>0&&(t=`<span class="cesium-timeline-highlight" style="left: ${i.toString()}px; width: ${o.toString()}px; bottom: ${this._base.toString()}px; height: ${this._height}px; background-color: ${this._color};"></span>`)}return t};var YW=fE;function pke(e,t,n,i){this.interval=e,this.height=t,this.color=n||new z(.5,.5,.5,1),this.backgroundColor=i||new z(0,0,0,0)}pke.prototype.render=function(e,t){let n=this.interval.start,i=this.interval.stop,r=t.startJulian,o=K.addSeconds(t.startJulian,t.duration,new K);if(K.lessThan(n,r)&&K.greaterThan(i,o))e.fillStyle=this.color.toCssColorString(),e.fillRect(0,t.y,t.timeBarWidth,this.height);else if(K.lessThanOrEquals(n,o)&&K.greaterThanOrEquals(i,r)){let s,a,c;for(s=0;s<t.timeBarWidth;++s){let u=K.addSeconds(t.startJulian,s/t.timeBarWidth*t.duration,new K);!l(a)&&K.greaterThanOrEquals(u,n)?a=s:!l(c)&&K.greaterThanOrEquals(u,i)&&(c=s)}e.fillStyle=this.backgroundColor.toCssColorString(),e.fillRect(0,t.y,t.timeBarWidth,this.height),l(a)&&(l(c)||(c=t.timeBarWidth),e.fillStyle=this.color.toCssColorString(),e.fillRect(a,t.y,Math.max(c-a,1),this.height))}};var XW=pke;var Fae=1e12,sh={none:0,scrub:1,slide:2,zoom:3,touchOnly:4},Ql={none:0,scrub:1,slideZoom:2,singleTap:3,ignore:4},lb=[.001,.002,.005,.01,.02,.05,.1,.25,.5,1,2,5,10,15,30,60,120,300,600,900,1800,3600,7200,14400,21600,43200,86400,172800,345600,604800,1296e3,2592e3,5184e3,7776e3,15552e3,31536e3,63072e3,126144e3,15768e4,31536e4,63072e4,126144e4,15768e5,31536e5,63072e5,126144e5,15768e6,31536e6],VHt=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function eu(e,t){e=kn(e);let n=e.ownerDocument;this.container=e;let i=n.createElement("div");i.className="cesium-timeline-main",e.appendChild(i),this._topDiv=i,this._endJulian=void 0,this._epochJulian=void 0,this._lastXPos=void 0,this._scrubElement=void 0,this._startJulian=void 0,this._timeBarSecondsSpan=void 0,this._clock=t,this._scrubJulian=t.currentTime,this._mainTicSpan=-1,this._mouseMode=sh.none,this._touchMode=Ql.none,this._touchState={centerX:0,spanX:0},this._mouseX=0,this._timelineDrag=0,this._timelineDragLocation=void 0,this._lastHeight=void 0,this._lastWidth=void 0,this._topDiv.innerHTML='<div class="cesium-timeline-bar"></div><div class="cesium-timeline-trackContainer"><canvas class="cesium-timeline-tracks" width="10" height="1"></canvas></div><div class="cesium-timeline-needle"></div><span class="cesium-timeline-ruler"></span>',this._timeBarEle=this._topDiv.childNodes[0],this._trackContainer=this._topDiv.childNodes[1],this._trackListEle=this._topDiv.childNodes[1].childNodes[0],this._needleEle=this._topDiv.childNodes[2],this._rulerEle=this._topDiv.childNodes[3],this._context=this._trackListEle.getContext("2d"),this._trackList=[],this._highlightRanges=[],this.zoomTo(t.startTime,t.stopTime),this._onMouseDown=jHt(this),this._onMouseUp=HHt(this),this._onMouseMove=GHt(this),this._onMouseWheel=WHt(this),this._onTouchStart=qHt(this),this._onTouchMove=XHt(this),this._onTouchEnd=YHt(this);let r=this._timeBarEle;n.addEventListener("mouseup",this._onMouseUp,!1),n.addEventListener("mousemove",this._onMouseMove,!1),r.addEventListener("mousedown",this._onMouseDown,!1),r.addEventListener("DOMMouseScroll",this._onMouseWheel,!1),r.addEventListener("mousewheel",this._onMouseWheel,!1),r.addEventListener("touchstart",this._onTouchStart,!1),r.addEventListener("touchmove",this._onTouchMove,!1),r.addEventListener("touchend",this._onTouchEnd,!1),r.addEventListener("touchcancel",this._onTouchEnd,!1),this._topDiv.oncontextmenu=function(){return!1},t.onTick.addEventListener(this.updateFromClock,this),this.updateFromClock()}eu.prototype.addEventListener=function(e,t,n){this._topDiv.addEventListener(e,t,n)};eu.prototype.removeEventListener=function(e,t,n){this._topDiv.removeEventListener(e,t,n)};eu.prototype.isDestroyed=function(){return!1};eu.prototype.destroy=function(){this._clock.onTick.removeEventListener(this.updateFromClock,this);let e=this.container.ownerDocument;e.removeEventListener("mouseup",this._onMouseUp,!1),e.removeEventListener("mousemove",this._onMouseMove,!1);let t=this._timeBarEle;t.removeEventListener("mousedown",this._onMouseDown,!1),t.removeEventListener("DOMMouseScroll",this._onMouseWheel,!1),t.removeEventListener("mousewheel",this._onMouseWheel,!1),t.removeEventListener("touchstart",this._onTouchStart,!1),t.removeEventListener("touchmove",this._onTouchMove,!1),t.removeEventListener("touchend",this._onTouchEnd,!1),t.removeEventListener("touchcancel",this._onTouchEnd,!1),this.container.removeChild(this._topDiv),le(this)};eu.prototype.addHighlightRange=function(e,t,n){let i=new YW(e,t,n);return this._highlightRanges.push(i),this.resize(),i};eu.prototype.addTrack=function(e,t,n,i){let r=new XW(e,t,n,i);return this._trackList.push(r),this._lastHeight=void 0,this.resize(),r};eu.prototype.zoomTo=function(e,t){if(this._startJulian=e,this._endJulian=t,this._timeBarSecondsSpan=K.secondsDifference(t,e),this._clock&&this._clock.clockRange!==ws.UNBOUNDED){let i=this._clock.startTime,r=this._clock.stopTime,o=K.secondsDifference(r,i),s=K.secondsDifference(i,this._startJulian),a=K.secondsDifference(r,this._endJulian);this._timeBarSecondsSpan>=o?(this._timeBarSecondsSpan=o,this._startJulian=this._clock.startTime,this._endJulian=this._clock.stopTime):s>0?(this._endJulian=K.addSeconds(this._endJulian,s,new K),this._startJulian=i,this._timeBarSecondsSpan=K.secondsDifference(this._endJulian,this._startJulian)):a<0&&(this._startJulian=K.addSeconds(this._startJulian,a,new K),this._endJulian=r,this._timeBarSecondsSpan=K.secondsDifference(this._endJulian,this._startJulian))}this._makeTics();let n=document.createEvent("Event");n.initEvent("setzoom",!0,!0),n.startJulian=this._startJulian,n.endJulian=this._endJulian,n.epochJulian=this._epochJulian,n.totalSpan=this._timeBarSecondsSpan,n.mainTicSpan=this._mainTicSpan,this._topDiv.dispatchEvent(n)};eu.prototype.zoomFrom=function(e){let t=K.secondsDifference(this._scrubJulian,this._startJulian);e>1||t<0||t>this._timeBarSecondsSpan?t=this._timeBarSecondsSpan*.5:t+=t-this._timeBarSecondsSpan*.5;let n=this._timeBarSecondsSpan-t;this.zoomTo(K.addSeconds(this._startJulian,t-t*e,new K),K.addSeconds(this._endJulian,n*e-n,new K))};function Bae(e){return e<10?`0${e.toString()}`:e.toString()}eu.prototype.makeLabel=function(e){let t=K.toGregorianDate(e),n=t.millisecond,i=" UTC";if(n>0&&this._timeBarSecondsSpan<3600){for(i=Math.floor(n).toString();i.length<3;)i=`0${i}`;i=`.${i}`}return`${VHt[t.month-1]} ${t.day} ${t.year} ${Bae(t.hour)}:${Bae(t.minute)}:${Bae(t.second)}${i}`};eu.prototype.smallestTicInPixels=7;eu.prototype._makeTics=function(){let e=this._timeBarEle,t=K.secondsDifference(this._scrubJulian,this._startJulian),n=Math.round(t*this._topDiv.clientWidth/this._timeBarSecondsSpan),i=n-8,r,o=this;this._needleEle.style.left=`${n.toString()}px`;let s="",a=.01,c=31536e6,u=1e-10,f=0,d=this._timeBarSecondsSpan;d<a?(d=a,this._timeBarSecondsSpan=a,this._endJulian=K.addSeconds(this._startJulian,a,new K)):d>c&&(d=c,this._timeBarSecondsSpan=c,this._endJulian=K.addSeconds(this._startJulian,c,new K));let p=this._timeBarEle.clientWidth;p<10&&(p=10);let g=this._startJulian,m=Math.min(d/p*1e-5,.4),y,A=K.toGregorianDate(g);d>31536e4?y=K.fromDate(new Date(Date.UTC(Math.floor(A.year/100)*100,0))):d>31536e3?y=K.fromDate(new Date(Date.UTC(Math.floor(A.year/10)*10,0))):d>86400?y=K.fromDate(new Date(Date.UTC(A.year,0))):y=K.fromDate(new Date(Date.UTC(A.year,A.month,A.day)));let b=K.secondsDifference(this._startJulian,K.addSeconds(y,m,new K)),x=b+d;this._epochJulian=y;function T(k){return Math.floor(b/k)*k}function E(k,G){return Math.ceil(k/G+.5)*G}function v(k){return(k-b)/d}function S(k,G){return k-G*Math.round(k/G)}this._rulerEle.innerHTML=this.makeLabel(K.addSeconds(this._endJulian,-a,new K));let I=this._rulerEle.offsetWidth+20;I<30&&(I=180);let R=f;f-=u;let O={startTime:b,startJulian:g,epochJulian:y,duration:d,timeBarWidth:p,getAlpha:v};this._highlightRanges.forEach(function(k){s+=k.render(O)});let L=0,_=0,C=0,w=I/p;w>1&&(w=1),w*=this._timeBarSecondsSpan;let D=-1,N=-1,F=lb.length,V;for(V=0;V<F;++V){let k=lb[V];if(++D,L=k,k>w&&k>f)break;N<0&&p*(k/this._timeBarSecondsSpan)>=this.smallestTicInPixels&&(N=D)}if(D>0){for(;D>0;)if(--D,Math.abs(S(L,lb[D]))<1e-5){lb[D]>=f&&(_=lb[D]);break}if(N>=0)for(;N<D;){if(Math.abs(S(_,lb[N]))<1e-5&&lb[N]>=f){C=lb[N];break}++N}}f=R,f>u&&C<1e-5&&Math.abs(f-L)>u&&(C=f,f<=L+u&&(_=0));let B=-999999,j;if(p*(C/this._timeBarSecondsSpan)>=3)for(r=T(C);r<=x;r=E(r,C))s+=`<span class="cesium-timeline-ticTiny" style="left: ${Math.round(p*v(r)).toString()}px;"></span>`;if(p*(_/this._timeBarSecondsSpan)>=3)for(r=T(_);r<=x;r=E(r,_))s+=`<span class="cesium-timeline-ticSub" style="left: ${Math.round(p*v(r)).toString()}px;"></span>`;if(p*(L/this._timeBarSecondsSpan)>=2){this._mainTicSpan=L,x+=L,r=T(L);let k=K.computeTaiMinusUtc(y);for(;r<=x;){let G=K.addSeconds(g,r-b,new K);if(L>2.1){let J=K.computeTaiMinusUtc(G);Math.abs(J-k)>.1&&(r+=J-k,G=K.addSeconds(g,r-b,new K))}let q=Math.round(p*v(r)),Q=this.makeLabel(G);this._rulerEle.innerHTML=Q,j=this._rulerEle.offsetWidth,j<10&&(j=I);let W=q-(j/2-1);W>B?(B=W+j+5,s+=`<span class="cesium-timeline-ticMain" style="left: ${q.toString()}px;"></span><span class="cesium-timeline-ticLabel" style="left: ${W.toString()}px;">${Q}</span>`):s+=`<span class="cesium-timeline-ticSub" style="left: ${q.toString()}px;"></span>`,r=E(r,L)}}else this._mainTicSpan=-1;s+=`<span class="cesium-timeline-icon16" style="left:${i}px;bottom:0;background-position: 0 0;"></span>`,e.innerHTML=s,this._scrubElement=e.lastChild,this._context.clearRect(0,0,this._trackListEle.width,this._trackListEle.height),O.y=0,this._trackList.forEach(function(k){k.render(o._context,O),O.y+=k.height})};eu.prototype.updateFromClock=function(){this._scrubJulian=this._clock.currentTime;let e=this._scrubElement;if(l(this._scrubElement)){let t=K.secondsDifference(this._scrubJulian,this._startJulian),n=Math.round(t*this._topDiv.clientWidth/this._timeBarSecondsSpan);this._lastXPos!==n&&(this._lastXPos=n,e.style.left=`${n-8}px`,this._needleEle.style.left=`${n}px`)}l(this._timelineDragLocation)&&(this._setTimeBarTime(this._timelineDragLocation,this._timelineDragLocation*this._timeBarSecondsSpan/this._topDiv.clientWidth),this.zoomTo(K.addSeconds(this._startJulian,this._timelineDrag,new K),K.addSeconds(this._endJulian,this._timelineDrag,new K)))};eu.prototype._setTimeBarTime=function(e,t){if(e=Math.round(e),this._scrubJulian=K.addSeconds(this._startJulian,t,new K),this._scrubElement){let i=e-8;this._scrubElement.style.left=`${i.toString()}px`,this._needleEle.style.left=`${e.toString()}px`}let n=document.createEvent("Event");n.initEvent("settime",!0,!0),n.clientX=e,n.timeSeconds=t,n.timeJulian=this._scrubJulian,n.clock=this._clock,this._topDiv.dispatchEvent(n)};function jHt(e){return function(t){e._mouseMode!==sh.touchOnly&&(t.button===0?(e._mouseMode=sh.scrub,e._scrubElement&&(e._scrubElement.style.backgroundPosition="-16px 0"),e._onMouseMove(t)):(e._mouseX=t.clientX,t.button===2?e._mouseMode=sh.zoom:e._mouseMode=sh.slide)),t.preventDefault()}}function HHt(e){return function(t){e._mouseMode=sh.none,e._scrubElement&&(e._scrubElement.style.backgroundPosition="0 0"),e._timelineDrag=0,e._timelineDragLocation=void 0}}function GHt(e){return function(t){let n;if(e._mouseMode===sh.scrub){t.preventDefault();let i=t.clientX-e._topDiv.getBoundingClientRect().left;i<0?(e._timelineDragLocation=0,e._timelineDrag=-.01*e._timeBarSecondsSpan):i>e._topDiv.clientWidth?(e._timelineDragLocation=e._topDiv.clientWidth,e._timelineDrag=.01*e._timeBarSecondsSpan):(e._timelineDragLocation=void 0,e._setTimeBarTime(i,i*e._timeBarSecondsSpan/e._topDiv.clientWidth))}else if(e._mouseMode===sh.slide){if(n=e._mouseX-t.clientX,e._mouseX=t.clientX,n!==0){let i=n*e._timeBarSecondsSpan/e._topDiv.clientWidth;e.zoomTo(K.addSeconds(e._startJulian,i,new K),K.addSeconds(e._endJulian,i,new K))}}else e._mouseMode===sh.zoom&&(n=e._mouseX-t.clientX,e._mouseX=t.clientX,n!==0&&e.zoomFrom(Math.pow(1.01,n)))}}function WHt(e){return function(t){let n=t.wheelDeltaY||t.wheelDelta||-t.detail;Fae=Math.max(Math.min(Math.abs(n),Fae),1),n/=Fae,e.zoomFrom(Math.pow(1.05,-n))}}function qHt(e){return function(t){let n=t.touches.length,i,r,o=e._topDiv.getBoundingClientRect().left;t.preventDefault(),e._mouseMode=sh.touchOnly,n===1?(i=K.secondsDifference(e._scrubJulian,e._startJulian),r=Math.round(i*e._topDiv.clientWidth/e._timeBarSecondsSpan+o),Math.abs(t.touches[0].clientX-r)<50?(e._touchMode=Ql.scrub,e._scrubElement&&(e._scrubElement.style.backgroundPosition=n===1?"-16px 0":"0 0")):(e._touchMode=Ql.singleTap,e._touchState.centerX=t.touches[0].clientX-o)):n===2?(e._touchMode=Ql.slideZoom,e._touchState.centerX=(t.touches[0].clientX+t.touches[1].clientX)*.5-o,e._touchState.spanX=Math.abs(t.touches[0].clientX-t.touches[1].clientX)):e._touchMode=Ql.ignore}}function YHt(e){return function(t){let n=t.touches.length,i=e._topDiv.getBoundingClientRect().left;e._touchMode===Ql.singleTap?(e._touchMode=Ql.scrub,e._onTouchMove(t)):e._touchMode===Ql.scrub&&e._onTouchMove(t),e._mouseMode=sh.touchOnly,n!==1?e._touchMode=n>0?Ql.ignore:Ql.none:e._touchMode===Ql.slideZoom&&(e._touchState.centerX=t.touches[0].clientX-i),e._scrubElement&&(e._scrubElement.style.backgroundPosition="0 0")}}function XHt(e){return function(t){let n,i,r,o,s,a,c=1,u=e._topDiv.getBoundingClientRect().left;e._touchMode===Ql.singleTap&&(e._touchMode=Ql.slideZoom),e._mouseMode=sh.touchOnly,e._touchMode===Ql.scrub?(t.preventDefault(),t.changedTouches.length===1&&(i=t.changedTouches[0].clientX-u,i>=0&&i<=e._topDiv.clientWidth&&e._setTimeBarTime(i,i*e._timeBarSecondsSpan/e._topDiv.clientWidth))):e._touchMode===Ql.slideZoom&&(r=t.touches.length,r===2?(o=(t.touches[0].clientX+t.touches[1].clientX)*.5-u,s=Math.abs(t.touches[0].clientX-t.touches[1].clientX)):r===1&&(o=t.touches[0].clientX-u,s=0),l(o)&&(s>0&&e._touchState.spanX>0?(c=e._touchState.spanX/s,a=K.addSeconds(e._startJulian,(e._touchState.centerX*e._timeBarSecondsSpan-o*e._timeBarSecondsSpan*c)/e._topDiv.clientWidth,new K)):(n=e._touchState.centerX-o,a=K.addSeconds(e._startJulian,n*e._timeBarSecondsSpan/e._topDiv.clientWidth,new K)),e.zoomTo(a,K.addSeconds(a,e._timeBarSecondsSpan*c,new K)),e._touchState.centerX=o,e._touchState.spanX=s))}}eu.prototype.resize=function(){let e=this.container.clientWidth,t=this.container.clientHeight;if(e===this._lastWidth&&t===this._lastHeight)return;this._trackContainer.style.height=`${t}px`;let n=1;this._trackList.forEach(function(i){n+=i.height}),this._trackListEle.style.height=`${n.toString()}px`,this._trackListEle.width=this._trackListEle.clientWidth,this._trackListEle.height=n,this._makeTics(),this._lastXPos=void 0,this._lastWidth=e,this._lastHeight=t};var KW=eu;var bke=js(Ake(),1);function JHt(e){let t=!1,n=window.screen;return l(n)&&(l(n.lockOrientation)?t=n.lockOrientation(e):l(n.mozLockOrientation)?t=n.mozLockOrientation(e):l(n.msLockOrientation)?t=n.msLockOrientation(e):l(n.orientation&&n.orientation.lock)&&(t=n.orientation.lock(e))),t}function xke(){let e=window.screen;l(e)&&(l(e.unlockOrientation)?e.unlockOrientation():l(e.mozUnlockOrientation)?e.mozUnlockOrientation():l(e.msUnlockOrientation)?e.msUnlockOrientation():l(e.orientation&&e.orientation.unlock)&&e.orientation.unlock())}function ZHt(e,t,n,i){i()||(n()?(t.useWebVR=!1,e._locked&&(xke(),e._locked=!1),e._noSleep.disable(),ss.exitFullscreen(),n(!1)):(ss.fullscreen||ss.requestFullscreen(e._vrElement),e._noSleep.enable(),e._locked||(e._locked=JHt("landscape")),t.useWebVR=!0,n(!0)))}function $W(e,t){let n=this,i=Se.observable(ss.enabled),r=Se.observable(!1);this.isVRMode=void 0,Se.defineProperty(this,"isVRMode",{get:function(){return r()}}),this.isVREnabled=void 0,Se.defineProperty(this,"isVREnabled",{get:function(){return i()},set:function(s){i(s&&ss.enabled)}}),this.tooltip=void 0,Se.defineProperty(this,"tooltip",function(){return i()?r()?"Exit VR mode":"Enter VR mode":"VR mode is unavailable"});let o=Se.observable(!1);this._isOrthographic=void 0,Se.defineProperty(this,"_isOrthographic",{get:function(){return o()}}),this._eventHelper=new Wo,this._eventHelper.add(e.preRender,function(){o(e.camera.frustum instanceof _n)}),this._locked=!1,this._noSleep=new bke.default,this._command=On(function(){ZHt(n,e,r,o)},Se.getObservable(this,"isVREnabled")),this._vrElement=kn(t)??document.body,this._callback=function(){!ss.fullscreen&&r()&&(e.useWebVR=!1,n._locked&&(xke(),n._locked=!1),n._noSleep.disable(),r(!1))},document.addEventListener(ss.changeEventName,this._callback)}Object.defineProperties($W.prototype,{vrElement:{get:function(){return this._vrElement},set:function(e){this._vrElement=e}},command:{get:function(){return this._command}}});$W.prototype.isDestroyed=function(){return!1};$W.prototype.destroy=function(){this._eventHelper.removeAll(),document.removeEventListener(ss.changeEventName,this._callback),le(this)};var JW=$W;var QHt="M 5.3125 6.375 C 4.008126 6.375 2.96875 7.4141499 2.96875 8.71875 L 2.96875 19.5 C 2.96875 20.8043 4.008126 21.875 5.3125 21.875 L 13.65625 21.875 C 13.71832 20.0547 14.845166 18.59375 16.21875 18.59375 C 17.592088 18.59375 18.71881 20.0552 18.78125 21.875 L 27.09375 21.875 C 28.398125 21.875 29.4375 20.8043 29.4375 19.5 L 29.4375 8.71875 C 29.4375 7.4141499 28.398125 6.375 27.09375 6.375 L 5.3125 6.375 z M 9.625 10.4375 C 11.55989 10.4375 13.125 12.03385 13.125 13.96875 C 13.125 15.90365 11.55989 17.46875 9.625 17.46875 C 7.69011 17.46875 6.125 15.90365 6.125 13.96875 C 6.125 12.03385 7.69011 10.4375 9.625 10.4375 z M 22.46875 10.4375 C 24.40364 10.4375 25.96875 12.03385 25.96875 13.96875 C 25.96875 15.90365 24.40364 17.46875 22.46875 17.46875 C 20.53386 17.46875 18.96875 15.90365 18.96875 13.96875 C 18.96875 12.03385 20.53386 10.4375 22.46875 10.4375 z",eGt="M 25.770585,2.4552065 C 15.72282,13.962707 10.699956,19.704407 8.1768352,22.580207 c -1.261561,1.4379 -1.902282,2.1427 -2.21875,2.5 -0.141624,0.1599 -0.208984,0.2355 -0.25,0.2813 l 0.6875,0.75 c 10e-5,-10e-5 0.679191,0.727 0.6875,0.7187 0.01662,-0.016 0.02451,-0.024 0.03125,-0.031 0.01348,-0.014 0.04013,-0.038 0.0625,-0.062 0.04474,-0.05 0.120921,-0.1315 0.28125,-0.3126 0.320657,-0.3619 0.956139,-1.0921 2.2187499,-2.5312 2.5252219,-2.8781 7.5454589,-8.6169 17.5937499,-20.1250005 l -1.5,-1.3125 z m -20.5624998,3.9063 c -1.304375,0 -2.34375,1.0391 -2.34375,2.3437 l 0,10.8125005 c 0,1.3043 1.039375,2.375 2.34375,2.375 l 2.25,0 c 1.9518039,-2.2246 7.4710958,-8.5584 13.5624998,-15.5312005 l -15.8124998,0 z m 21.1249998,0 c -1.855467,2.1245 -2.114296,2.4005 -3.59375,4.0936995 1.767282,0.1815 3.15625,1.685301 3.15625,3.500001 0,1.9349 -1.56511,3.5 -3.5,3.5 -1.658043,0 -3.043426,-1.1411 -3.40625,-2.6875 -1.089617,1.2461 -2.647139,2.9988 -3.46875,3.9375 0.191501,-0.062 0.388502,-0.094 0.59375,-0.094 1.373338,0 2.50006,1.4614 2.5625,3.2812 l 8.3125,0 c 1.304375,0 2.34375,-1.0707 2.34375,-2.375 l 0,-10.8125005 c 0,-1.3046 -1.039375,-2.3437 -2.34375,-2.3437 l -0.65625,0 z M 9.5518351,10.423906 c 1.9348899,0 3.4999999,1.596401 3.4999999,3.531301 0,1.9349 -1.56511,3.5 -3.4999999,3.5 -1.9348899,0 -3.4999999,-1.5651 -3.4999999,-3.5 0,-1.9349 1.56511,-3.531301 3.4999999,-3.531301 z m 4.2187499,10.312601 c -0.206517,0.2356 -0.844218,0.9428 -1.03125,1.1562 l 0.8125,0 c 0.01392,-0.4081 0.107026,-0.7968 0.21875,-1.1562 z";function ZW(e,t,n){e=kn(e);let i=new JW(t,n);i._exitVRPath=eGt,i._enterVRPath=QHt;let r=document.createElement("button");r.type="button",r.className="cesium-button cesium-vrButton",r.setAttribute("data-bind",'css: { "cesium-button-disabled" : _isOrthographic }, attr: { title: tooltip },click: command,enable: isVREnabled,cesiumSvgPath: { path: isVRMode ? _exitVRPath : _enterVRPath, width: 32, height: 32 }'),e.appendChild(r),Se.applyBindings(i,r),this._container=e,this._viewModel=i,this._element=r}Object.defineProperties(ZW.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}}});ZW.prototype.isDestroyed=function(){return!1};ZW.prototype.destroy=function(){return this._viewModel.destroy(),Se.cleanNode(this._element),this._container.removeChild(this._element),le(this)};var QW=ZW;var Tke=new ue;function vke(e){let t=e.clock;t.currentTime=e.timeJulian,t.shouldAnimate=!1}function tGt(e){let t=e.getPropertyIds(),n="";return t.forEach(function(i){let r=e.getProperty(i);l(r)&&(n+=`<tr><th>${i}</th><td>${r}</td></tr>`)}),n.length>0&&(n=`<table class="cesium-infoBox-defaultTable"><tbody>${n}</tbody></table>`),n}function nGt(e){let t,n=[],i=e.getPropertyIds();for(t=0;t<i.length;t++){let o=i[t];/^name$/i.test(o)?n[0]=e.getProperty(o):/name/i.test(o)?n[1]=e.getProperty(o):/^title$/i.test(o)?n[2]=e.getProperty(o):/^(id|identifier)$/i.test(o)?n[3]=e.getProperty(o):/element/i.test(o)?n[4]=e.getProperty(o):/(id|identifier)$/i.test(o)&&(n[5]=e.getProperty(o))}let r=n.length;for(t=0;t<r;t++){let o=n[t];if(l(o)&&o!=="")return o}return"Unnamed Feature"}function Eke(e,t){let n=e.scene.pick(t.position);if(l(n)){let i=n.id??n.primitive.id;if(i instanceof Qr)return i;if(n instanceof ma||n instanceof TS)return new Qr({name:nGt(n),description:tGt(n),feature:n})}return sGt(e,t.position)}var iGt=new K;function Vae(e,t){if(l(t)){let n=t.clock;if(l(n)&&l(e)){let i=n.startTime,r=n.stopTime;K.equals(i,r)&&(r=K.addSeconds(i,P.EPSILON2,iGt)),e.updateFromClock(),e.zoomTo(i,r)}}}var rGt=new h;function oGt(e){let t=e.length;for(let n=0;n<t;++n){let i=e.get(n);if(i instanceof ts)return i}}function sGt(e,t){let n=e.scene,i=n.camera.getPickRay(t);if(!l(i))return;let r=n.imageryLayers;if(!l(r)){let a=oGt(n.primitives);if(!l(a))return;r=a.imageryLayers}let o=r.pickImageryLayerFeatures(i,n);if(!l(o))return;let s=new Qr({id:"Loading...",description:"Loading feature information..."});return o.then(function(a){if(e.selectedEntity!==s)return;if(!l(a)||a.length===0){e.selectedEntity=Cke();return}let c=a[0],u=new Qr({id:c.name,description:c.description});if(l(c.position)){let f=e.scene.ellipsoid.cartographicToCartesian(c.position,rGt);u.position=new gu(f)}e.selectedEntity=u},function(){e.selectedEntity===s&&(e.selectedEntity=Cke())}),s}function Cke(){return new Qr({id:"None",description:"No features found."})}function aGt(e,t){let n=e._geocoder,i=e._homeButton,r=e._sceneModePicker,o=e._projectionPicker,s=e._baseLayerPicker,a=e._animation,c=e._timeline,u=e._fullscreenButton,f=e._infoBox,d=e._selectionIndicator,p=t?"hidden":"visible";if(l(n)&&(n.container.style.visibility=p),l(i)&&(i.container.style.visibility=p),l(r)&&(r.container.style.visibility=p),l(o)&&(o.container.style.visibility=p),l(s)&&(s.container.style.visibility=p),l(a)&&(a.container.style.visibility=p),l(c)&&(c.container.style.visibility=p),l(u)&&u.viewModel.isFullscreenEnabled&&(u.container.style.visibility=p),l(f)&&(f.container.style.visibility=p),l(d)&&(d.container.style.visibility=p),e._container){let g=t||!l(u)?0:u.container.clientWidth;e._vrButton.container.style.right=`${g}px`,e.forceResize()}}function tr(e,t){e=kn(e),t=t??H.EMPTY_OBJECT;let n=(!l(t.globe)||t.globe!==!1)&&(!l(t.baseLayerPicker)||t.baseLayerPicker!==!1),i=this,r=document.createElement("div");r.className="cesium-viewer",e.appendChild(r);let o=document.createElement("div");o.className="cesium-viewer-cesiumWidgetContainer",r.appendChild(o);let s=document.createElement("div");s.className="cesium-viewer-bottom",r.appendChild(s);let a=t.scene3DOnly??!1,c,u,f=!1;l(t.clockViewModel)?(u=t.clockViewModel,c=u.clock):(c=new Km,u=new K7(c),f=!0);let d=new CG(o,{baseLayer:n&&l(t.selectedImageryProviderViewModel)||l(t.baseLayer)||l(t.imageryProvider)?!1:void 0,clock:c,shouldAnimate:t.shouldAnimate,skyBox:t.skyBox,skyAtmosphere:t.skyAtmosphere,sceneMode:t.sceneMode,ellipsoid:t.ellipsoid,mapProjection:t.mapProjection,globe:t.globe,orderIndependentTranslucency:t.orderIndependentTranslucency,automaticallyTrackDataSourceClocks:t.automaticallyTrackDataSourceClocks,contextOptions:t.contextOptions,useDefaultRenderLoop:t.useDefaultRenderLoop,targetFrameRate:t.targetFrameRate,showRenderLoopErrors:t.showRenderLoopErrors,useBrowserRecommendedResolution:t.useBrowserRecommendedResolution,creditContainer:l(t.creditContainer)?t.creditContainer:s,creditViewport:t.creditViewport,dataSources:t.dataSources,scene3DOnly:a,shadows:t.shadows,terrainShadows:t.terrainShadows,mapMode2D:t.mapMode2D,blurActiveElementOnCanvasFocus:t.blurActiveElementOnCanvasFocus,requestRenderMode:t.requestRenderMode,maximumRenderTimeChange:t.maximumRenderTimeChange,depthPlaneEllipsoidOffset:t.depthPlaneEllipsoidOffset,msaaSamples:t.msaaSamples}),p=d.scene,g=new Wo;g.add(c.onTick,tr.prototype._onTick,this);let m;if(!l(t.selectionIndicator)||t.selectionIndicator!==!1){let G=document.createElement("div");G.className="cesium-viewer-selectionIndicatorContainer",r.appendChild(G),m=new qW(G,p)}let y;if(!l(t.infoBox)||t.infoBox!==!1){let G=document.createElement("div");G.className="cesium-viewer-infoBoxContainer",r.appendChild(G),y=new IW(G);let q=y.viewModel;g.add(q.cameraClicked,tr.prototype._onInfoBoxCameraClicked,this),g.add(q.closeClicked,tr.prototype._onInfoBoxClockClicked,this)}let A=document.createElement("div");A.className="cesium-viewer-toolbar",r.appendChild(A);let b;if(!l(t.geocoder)||t.geocoder!==!1){let G=document.createElement("div");G.className="cesium-viewer-geocoderContainer",A.appendChild(G);let q;typeof t.geocoder=="string"?q=[new AI({scene:p,geocodeProviderType:t.geocoder})]:l(t.geocoder)&&typeof t.geocoder!="boolean"&&(q=Array.isArray(t.geocoder)?t.geocoder:[t.geocoder]),b=new gW({container:G,geocoderServices:q,scene:p}),g.add(b.viewModel.search.beforeExecute,tr.prototype._clearObjects,this)}let x;(!l(t.homeButton)||t.homeButton!==!1)&&(x=new AW(A,p),l(b)&&g.add(x.viewModel.command.afterExecute,function(){let G=b.viewModel;G.searchText="",G.isSearchInProgress&&G.search()}),g.add(x.viewModel.command.beforeExecute,tr.prototype._clearTrackedObject,this));let T;!a&&(!l(t.sceneModePicker)||t.sceneModePicker!==!1)&&(T=new jW(A,p));let E;t.projectionPicker&&(E=new kW(A,p));let v,S;if(n){let G=t.imageryProviderViewModels??dW(),q=t.terrainProviderViewModels??hW();v=new fW(A,{globe:p.globe,imageryProviderViewModels:G,selectedImageryProviderViewModel:t.selectedImageryProviderViewModel,terrainProviderViewModels:q,selectedTerrainProviderViewModel:t.selectedTerrainProviderViewModel}),S=A.getElementsByClassName("cesium-baseLayerPicker-dropDown")[0]}l(t.baseLayer)&&t.baseLayer!==!1&&(n&&(v.viewModel.selectedImagery=void 0),p.imageryLayers.removeAll(),p.imageryLayers.add(t.baseLayer)),l(t.terrainProvider)&&(n&&(v.viewModel.selectedTerrain=void 0),p.terrainProvider=t.terrainProvider),l(t.terrain)&&(n&&(p.globe.depthTestAgainstTerrain=!0),p.setTerrain(t.terrain));let I;if(!l(t.navigationHelpButton)||t.navigationHelpButton!==!1){let G=!0;try{if(l(window.localStorage)){let q=window.localStorage.getItem("cesium-hasSeenNavHelp");l(q)&&q?G=!1:window.localStorage.setItem("cesium-hasSeenNavHelp","true")}}catch{}I=new RW({container:A,instructionsInitiallyVisible:t.navigationInstructionsInitiallyVisible??G})}let R;if(!l(t.animation)||t.animation!==!1){let G=document.createElement("div");G.className="cesium-viewer-animationContainer",r.appendChild(G),R=new eW(G,new tW(u))}let O;if(!l(t.timeline)||t.timeline!==!1){let G=document.createElement("div");G.className="cesium-viewer-timelineContainer",r.appendChild(G),O=new KW(G,c),O.addEventListener("settime",vke,!1),O.zoomTo(c.startTime,c.stopTime)}let L,_,C;(!l(t.fullscreenButton)||t.fullscreenButton!==!1)&&(C=document.createElement("div"),C.className="cesium-viewer-fullscreenContainer",r.appendChild(C),L=new EW(C,t.fullscreenElement),_=Oc(L.viewModel,"isFullscreenEnabled",function(G){C.style.display=G?"block":"none",l(O)&&(O.container.style.right=`${C.clientWidth}px`,O.resize())}));let w,D,N;if(t.vrButton){let G=document.createElement("div");G.className="cesium-viewer-vrContainer",r.appendChild(G),w=new QW(G,p,t.fullScreenElement),D=Oc(w.viewModel,"isVREnabled",function(q){G.style.display=q?"block":"none",l(L)&&(G.style.right=`${C.clientWidth}px`),l(O)&&(O.container.style.right=`${G.clientWidth}px`,O.resize())}),N=Oc(w.viewModel,"isVRMode",function(q){aGt(i,q)})}this._baseLayerPickerDropDown=S,this._fullscreenSubscription=_,this._vrSubscription=D,this._vrModeSubscription=N,this._dataSourceChangedListeners={},this._container=e,this._bottomContainer=s,this._element=r,this._cesiumWidget=d,this._selectionIndicator=m,this._infoBox=y,this._clockViewModel=u,this._destroyClockViewModel=f,this._toolbar=A,this._homeButton=x,this._sceneModePicker=T,this._projectionPicker=E,this._baseLayerPicker=v,this._navigationHelpButton=I,this._animation=R,this._timeline=O,this._fullscreenButton=L,this._vrButton=w,this._geocoder=b,this._eventHelper=g,this._lastWidth=0,this._lastHeight=0,this._enableInfoOrSelection=l(y)||l(m),this._selectedEntity=void 0,this._selectedEntityChanged=new be;let F=this._cesiumWidget.dataSources,V=this._cesiumWidget.dataSourceDisplay;g.add(F.dataSourceAdded,tr.prototype._onDataSourceAdded,this),g.add(F.dataSourceRemoved,tr.prototype._onDataSourceRemoved,this),g.add(p.postUpdate,tr.prototype.resize,this);let B=F.length;for(let G=0;G<B;G++)this._dataSourceAdded(F,F.get(G));this._dataSourceAdded(void 0,V.defaultDataSource),g.add(F.dataSourceAdded,tr.prototype._dataSourceAdded,this),g.add(F.dataSourceRemoved,tr.prototype._dataSourceRemoved,this);function j(G){let q=Eke(i,G);l(q)?X.getValueOrUndefined(q.position,i.clock.currentTime)?i.trackedEntity=q:i.zoomTo(q):l(i.trackedEntity)&&(i.trackedEntity=void 0)}function k(G){i.selectedEntity=Eke(i,G)}d.screenSpaceEventHandler.setInputAction(k,fn.LEFT_CLICK),d.screenSpaceEventHandler.setInputAction(j,fn.LEFT_DOUBLE_CLICK),d._canAnimateUpdateCallback=this._updateCanAnimate(this)}Object.defineProperties(tr.prototype,{container:{get:function(){return this._container}},creditDisplay:{get:function(){return this._cesiumWidget.creditDisplay}},bottomContainer:{get:function(){return this._bottomContainer}},cesiumWidget:{get:function(){return this._cesiumWidget}},selectionIndicator:{get:function(){return this._selectionIndicator}},infoBox:{get:function(){return this._infoBox}},geocoder:{get:function(){return this._geocoder}},homeButton:{get:function(){return this._homeButton}},sceneModePicker:{get:function(){return this._sceneModePicker}},projectionPicker:{get:function(){return this._projectionPicker}},baseLayerPicker:{get:function(){return this._baseLayerPicker}},navigationHelpButton:{get:function(){return this._navigationHelpButton}},animation:{get:function(){return this._animation}},timeline:{get:function(){return this._timeline}},fullscreenButton:{get:function(){return this._fullscreenButton}},vrButton:{get:function(){return this._vrButton}},dataSourceDisplay:{get:function(){return this._cesiumWidget.dataSourceDisplay}},entities:{get:function(){return this._cesiumWidget.entities}},dataSources:{get:function(){return this._cesiumWidget.dataSources}},canvas:{get:function(){return this._cesiumWidget.canvas}},scene:{get:function(){return this._cesiumWidget.scene}},shadows:{get:function(){return this.scene.shadowMap.enabled},set:function(e){this.scene.shadowMap.enabled=e}},terrainShadows:{get:function(){return this.scene.globe.shadows},set:function(e){this.scene.globe.shadows=e}},shadowMap:{get:function(){return this.scene.shadowMap}},imageryLayers:{get:function(){return this.scene.imageryLayers}},terrainProvider:{get:function(){return this.scene.terrainProvider},set:function(e){this.scene.terrainProvider=e}},camera:{get:function(){return this.scene.camera}},ellipsoid:{get:function(){return this.scene.ellipsoid}},postProcessStages:{get:function(){return this.scene.postProcessStages}},clock:{get:function(){return this._clockViewModel.clock}},clockViewModel:{get:function(){return this._clockViewModel}},screenSpaceEventHandler:{get:function(){return this._cesiumWidget.screenSpaceEventHandler}},targetFrameRate:{get:function(){return this._cesiumWidget.targetFrameRate},set:function(e){this._cesiumWidget.targetFrameRate=e}},useDefaultRenderLoop:{get:function(){return this._cesiumWidget.useDefaultRenderLoop},set:function(e){this._cesiumWidget.useDefaultRenderLoop=e}},resolutionScale:{get:function(){return this._cesiumWidget.resolutionScale},set:function(e){this._cesiumWidget.resolutionScale=e}},useBrowserRecommendedResolution:{get:function(){return this._cesiumWidget.useBrowserRecommendedResolution},set:function(e){this._cesiumWidget.useBrowserRecommendedResolution=e}},allowDataSourcesToSuspendAnimation:{get:function(){return this._cesiumWidget.allowDataSourcesToSuspendAnimation},set:function(e){this._cesiumWidget.allowDataSourcesToSuspendAnimation=e}},trackedEntity:{get:function(){return this._cesiumWidget.trackedEntity},set:function(e){this._cesiumWidget.trackedEntity=e}},selectedEntity:{get:function(){return this._selectedEntity},set:function(e){if(this._selectedEntity!==e){this._selectedEntity=e;let t=l(this._selectionIndicator)?this._selectionIndicator.viewModel:void 0;l(e)?l(t)&&t.animateAppear():l(t)&&t.animateDepart(),this._selectedEntityChanged.raiseEvent(e)}}},selectedEntityChanged:{get:function(){return this._selectedEntityChanged}},trackedEntityChanged:{get:function(){return this._cesiumWidget.trackedEntityChanged}},clockTrackedDataSource:{get:function(){return this._cesiumWidget.clockTrackedDataSource},set:function(e){this._cesiumWidget.clockTrackedDataSource!==e&&(this._cesiumWidget.clockTrackedDataSource=e,Vae(this._timeline,e))}}});tr.prototype.extend=function(e,t){e(this,t)};tr.prototype.resize=function(){let e=this._cesiumWidget,t=this._container,n=t.clientWidth,i=t.clientHeight,r=l(this._animation),o=l(this._timeline);if(e.resize(),n===this._lastWidth&&i===this._lastHeight)return;let s=i-125,a=this._baseLayerPickerDropDown;if(l(a)&&(a.style.maxHeight=`${s}px`),l(this._geocoder)){let m=this._geocoder.searchSuggestionsContainer;m.style.maxHeight=`${s}px`}l(this._infoBox)&&(this._infoBox.viewModel.maxHeight=s);let c=this._timeline,u,f=0,d=5,p=3,g=0;if(r&&window.getComputedStyle(this._animation.container).visibility!=="hidden"){let m=this._lastWidth;u=this._animation.container,n>900?(f=169,m<=900&&(u.style.width="169px",u.style.height="112px",this._animation.resize())):n>=600?(f=136,(m<600||m>900)&&(u.style.width="136px",u.style.height="90px",this._animation.resize())):(f=106,(m>600||m===0)&&(u.style.width="106px",u.style.height="70px",this._animation.resize())),d=f+5}if(o&&window.getComputedStyle(this._timeline.container).visibility!=="hidden"){let m=this._fullscreenButton,y=this._vrButton,A=c.container,b=A.style;p=A.clientHeight+3,b.left=`${f}px`;let x=0;l(m)&&(x+=m.container.clientWidth),l(y)&&(x+=y.container.clientWidth),b.right=`${x}px`,c.resize()}!o&&l(this._fullscreenButton)&&(g=this._fullscreenButton.container.clientWidth),this._bottomContainer.style.left=`${d}px`,this._bottomContainer.style.bottom=`${p}px`,this._bottomContainer.style.right=`${g}px`,this._lastWidth=n,this._lastHeight=i};tr.prototype.forceResize=function(){this._lastWidth=0,this.resize()};tr.prototype.render=function(){this._cesiumWidget.render()};tr.prototype.isDestroyed=function(){return!1};tr.prototype.destroy=function(){return l(this.screenSpaceEventHandler)&&!this.screenSpaceEventHandler.isDestroyed()&&(this.screenSpaceEventHandler.removeInputAction(fn.LEFT_CLICK),this.screenSpaceEventHandler.removeInputAction(fn.LEFT_DOUBLE_CLICK)),this._container.removeChild(this._element),this._element.removeChild(this._toolbar),this._eventHelper.removeAll(),l(this._geocoder)&&(this._geocoder=this._geocoder.destroy()),l(this._homeButton)&&(this._homeButton=this._homeButton.destroy()),l(this._sceneModePicker)&&(this._sceneModePicker=this._sceneModePicker.destroy()),l(this._projectionPicker)&&(this._projectionPicker=this._projectionPicker.destroy()),l(this._baseLayerPicker)&&(this._baseLayerPicker=this._baseLayerPicker.destroy()),l(this._animation)&&(this._element.removeChild(this._animation.container),this._animation=this._animation.destroy()),l(this._timeline)&&(this._timeline.removeEventListener("settime",vke,!1),this._element.removeChild(this._timeline.container),this._timeline=this._timeline.destroy()),l(this._fullscreenButton)&&(this._fullscreenSubscription.dispose(),this._element.removeChild(this._fullscreenButton.container),this._fullscreenButton=this._fullscreenButton.destroy()),l(this._vrButton)&&(this._vrSubscription.dispose(),this._vrModeSubscription.dispose(),this._element.removeChild(this._vrButton.container),this._vrButton=this._vrButton.destroy()),l(this._infoBox)&&(this._element.removeChild(this._infoBox.container),this._infoBox=this._infoBox.destroy()),l(this._selectionIndicator)&&(this._element.removeChild(this._selectionIndicator.container),this._selectionIndicator=this._selectionIndicator.destroy()),this._destroyClockViewModel&&(this._clockViewModel=this._clockViewModel.destroy()),this._cesiumWidget=this._cesiumWidget.destroy(),le(this)};tr.prototype._dataSourceAdded=function(e,t){t.entities.collectionChanged.addEventListener(tr.prototype._onEntityCollectionChanged,this)};tr.prototype._dataSourceRemoved=function(e,t){let n=t.entities;n.collectionChanged.removeEventListener(tr.prototype._onEntityCollectionChanged,this),l(this.selectedEntity)&&n.getById(this.selectedEntity.id)===this.selectedEntity&&(this.selectedEntity=void 0)};tr.prototype._updateCanAnimate=function(e){return function(t){e._clockViewModel.canAnimate=t}};tr.prototype._onTick=function(e){let t=e.currentTime,n,i=!1,r=this.selectedEntity,o=l(r)&&this._enableInfoOrSelection;o&&r.isShowing&&r.isAvailable(t)&&(this._cesiumWidget.dataSourceDisplay.getBoundingSphere(r,!0,Tke)!==Pt.FAILED?n=Tke.center:l(r.position)&&(n=r.position.getValue(t,n)),i=l(n));let s=l(this._selectionIndicator)?this._selectionIndicator.viewModel:void 0;l(s)&&(s.position=h.clone(n,s.position),s.showSelection=o&&i,s.update());let a=l(this._infoBox)?this._infoBox.viewModel:void 0;l(a)&&(a.showInfo=o,a.enableCamera=i,a.isCameraTracking=this.trackedEntity===this.selectedEntity,o?(a.titleText=r.name??r.id,a.description=X.getValueOrDefault(r.description,t,"")):(a.titleText="",a.description=""))};tr.prototype._onEntityCollectionChanged=function(e,t,n){let i=n.length;for(let r=0;r<i;r++){let o=n[r];this.selectedEntity===o&&(this.selectedEntity=void 0)}};tr.prototype._onInfoBoxCameraClicked=function(e){if(e.isCameraTracking&&this.trackedEntity===this.selectedEntity)this.trackedEntity=void 0;else{let n=this.selectedEntity.position;l(n)?this.trackedEntity=this.selectedEntity:this.zoomTo(this.selectedEntity)}};tr.prototype._clearTrackedObject=function(){this.trackedEntity=void 0};tr.prototype._onInfoBoxClockClicked=function(e){this.selectedEntity=void 0};tr.prototype._clearObjects=function(){this.trackedEntity=void 0,this.selectedEntity=void 0};tr.prototype._onDataSourceChanged=function(e){this.clockTrackedDataSource===e&&Vae(this.timeline,e)};tr.prototype._onDataSourceAdded=function(e,t){this._cesiumWidget._automaticallyTrackDataSourceClocks&&t===this.clockTrackedDataSource&&Vae(this._timeline,t);let n=t.entities.id,i=this._eventHelper.add(t.changedEvent,tr.prototype._onDataSourceChanged,this);this._dataSourceChangedListeners[n]=i};tr.prototype._onDataSourceRemoved=function(e,t){let n=t.entities.id;this._dataSourceChangedListeners[n](),this._dataSourceChangedListeners[n]=void 0};tr.prototype.addController=function(e){return this._cesiumWidget.addController(e)};tr.prototype.removeController=function(e){return this._cesiumWidget.removeController(e)};tr.prototype.zoomTo=function(e,t){return this._cesiumWidget.zoomTo(e,t)};tr.prototype.flyTo=function(e,t){return this._cesiumWidget.flyTo(e,t)};var Ske=tr;function cGt(e){let t=document.createElement("div");t.className="cesium-viewer-cesium3DTilesInspectorContainer",e.container.appendChild(t);let n=new oW(t,e.scene);Object.defineProperties(e,{cesium3DTilesInspector:{get:function(){return n}}})}var wke=cGt;function lGt(e){let t=document.createElement("div");t.className="cesium-viewer-cesiumInspectorContainer",e.container.appendChild(t);let n=new cW(t,e.scene);Object.defineProperties(e,{cesiumInspector:{get:function(){return n}}})}var Ike=lGt;function uGt(e,t){t=t??H.EMPTY_OBJECT;let n=!0,i=t.flyToOnDrop??!0,r=new be,o=t.clearOnDrop??!0,s=t.dropTarget??e.container,a=t.clampToGround??!0,c=t.proxy;s=kn(s),Object.defineProperties(e,{dropTarget:{get:function(){return s},set:function(f){Pke(s,u),s=f,jae(s,u)}},dropEnabled:{get:function(){return n},set:function(f){f!==n&&(f?jae(s,u):Pke(s,u),n=f)}},dropError:{get:function(){return r}},clearOnDrop:{get:function(){return o},set:function(f){o=f}},flyToOnDrop:{get:function(){return i},set:function(f){i=f}},proxy:{get:function(){return c},set:function(f){c=f}},clampToGround:{get:function(){return a},set:function(f){a=f}}});function u(f){dE(f),o&&(e.entities.removeAll(),e.dataSources.removeAll());let d=f.dataTransfer.files,p=d.length;for(let g=0;g<p;g++){let m=d[g],y=new FileReader;y.onload=fGt(e,m,c,a),y.onerror=dGt(e,m),y.readAsText(m)}}jae(s,u),e.destroy=f7(e,e.destroy,function(){e.dropEnabled=!1}),e._handleDrop=u}function dE(e){e.stopPropagation(),e.preventDefault()}function Pke(e,t){let n=e;l(n)&&(n.removeEventListener("drop",t,!1),n.removeEventListener("dragenter",dE,!1),n.removeEventListener("dragover",dE,!1),n.removeEventListener("dragexit",dE,!1))}function jae(e,t){e.addEventListener("drop",t,!1),e.addEventListener("dragenter",dE,!1),e.addEventListener("dragover",dE,!1),e.addEventListener("dragexit",dE,!1)}function fGt(e,t,n,i){let r=e.scene;return function(o){let s=t.name;try{let a;if(/\.czml$/i.test(s))a=LG.load(JSON.parse(o.target.result),{sourceUri:s});else if(/\.geojson$/i.test(s)||/\.json$/i.test(s)||/\.topojson$/i.test(s))a=JT.load(JSON.parse(o.target.result),{sourceUri:s,clampToGround:i});else if(/\.(kml|kmz)$/i.test(s))a=lI.load(t,{sourceUri:s,proxy:n,camera:r.camera,canvas:r.canvas,clampToGround:i,screenOverlayContainer:e.container});else if(/\.gpx$/i.test(s))a=v9.load(t,{sourceUri:s,proxy:n});else{e.dropError.raiseEvent(e,s,`Unrecognized file: ${s}`);return}l(a)&&e.dataSources.add(a).then(function(c){e.flyToOnDrop&&e.flyTo(c)}).catch(function(c){e.dropError.raiseEvent(e,s,c)})}catch(a){e.dropError.raiseEvent(e,s,a)}}}function dGt(e,t){return function(n){e.dropError.raiseEvent(e,t.name,n.target.error)}}var Dke=uGt;function hGt(e,t){t=t??H.EMPTY_OBJECT;let n=new NW({scene:e.scene,container:e.bottomContainer,lowFrameRateMessage:t.lowFrameRateMessage});Object.defineProperties(e,{performanceWatchdog:{get:function(){return n}}})}var Rke=hGt;function Oke(e){let t=e.split(` `),n;for(n=0;n<t.length&&!t[n].match(/\S/);n++);if(n===t.length)return"";let i="",r=/^\s*/,s=t[n].match(r)[0].length;for(let a=n;a<t.length;a++){let c=t[a];c.match(r)[0].length>=s&&(c=c.slice(s)),i+=`${c} -`}return i}function ah(e){this._scene=e,this._voxelPrimitive=void 0,this._customShaderCompilationRemoveCallback=void 0,this._definedProperties=[],this._getPrimitiveFunctions=[],this._modelMatrixReady=!1;let t=this;function n(r){let{name:o,initialValue:s}=r;t._definedProperties.push(o);let a=r.setPrimitiveFunction;a===!0&&(a=function(f){t._voxelPrimitive[o]=f});let c=r.getPrimitiveFunction;c===!0&&(c=function(){t[o]=t._voxelPrimitive[o]}),l(c)&&t._getPrimitiveFunctions.push(c);let u=Se.observable();return Se.defineProperty(t,o,{get:function(){return u()},set:function(f){typeof s=="number"&&typeof f=="string"&&(f=Number(f),isNaN(f)&&(f=s)),typeof s=="boolean"&&typeof f=="number"&&(f=f===1),u(f),l(a)&&l(t._voxelPrimitive)&&(a(f),e.requestRender())}}),t[o]=s,u}function i(r,o){return function(s){let a=t._voxelPrimitive[r].clone();a[o]=s,t._voxelPrimitive[r]=a}}n({name:"inspectorVisible",initialValue:!0}),n({name:"displayVisible",initialValue:!1}),n({name:"transformVisible",initialValue:!1}),n({name:"boundsVisible",initialValue:!1}),n({name:"clippingVisible",initialValue:!1}),n({name:"shaderVisible",initialValue:!1}),n({name:"shaderString",initialValue:"",getPrimitiveFunction:function(){let r=t._voxelPrimitive.customShader.fragmentShaderText;t.shaderString=Rke(r)}}),n({name:"shaderCompilationMessage",initialValue:""}),n({name:"shaderCompilationSuccess",initialValue:!0}),n({name:"depthTest",initialValue:!1,setPrimitiveFunction:!0,getPrimitiveFunction:!0}),n({name:"show",initialValue:!0,setPrimitiveFunction:!0,getPrimitiveFunction:!0}),n({name:"disableUpdate",initialValue:!1,setPrimitiveFunction:!0,getPrimitiveFunction:!0}),n({name:"debugDraw",initialValue:!1,setPrimitiveFunction:!0,getPrimitiveFunction:!0}),n({name:"jitter",initialValue:!0,setPrimitiveFunction:!0,getPrimitiveFunction:!0}),n({name:"nearestSampling",initialValue:!0,setPrimitiveFunction:!0,getPrimitiveFunction:!0}),n({name:"screenSpaceError",initialValue:4,setPrimitiveFunction:!0,getPrimitiveFunction:!0}),n({name:"stepSize",initialValue:1,setPrimitiveFunction:!0,getPrimitiveFunction:!0}),n({name:"shapeIsBox",getPrimitiveFunction:function(){let r=t._voxelPrimitive.shape;t.shapeIsBox=r===Dc.BOX}}),n({name:"shapeIsEllipsoid",getPrimitiveFunction:function(){let r=t._voxelPrimitive.shape;t.shapeIsEllipsoid=r===Dc.ELLIPSOID}}),n({name:"shapeIsCylinder",getPrimitiveFunction:function(){let r=t._voxelPrimitive.shape;t.shapeIsCylinder=r===Dc.CYLINDER}}),n({name:"clippingBoxMaxXMin",initialValue:0,getPrimitiveFunction:function(){t.clippingBoxMaxXMin=t._voxelPrimitive.minBounds.x}}),n({name:"clippingBoxMaxXMax",initialValue:1,getPrimitiveFunction:function(){t.clippingBoxMaxXMax=t._voxelPrimitive.maxBounds.x}}),n({name:"clippingBoxMaxX",initialValue:0,setPrimitiveFunction:i("maxClippingBounds","x"),getPrimitiveFunction:function(){t.clippingBoxMaxX=t._voxelPrimitive.maxClippingBounds.x}}),n({name:"clippingBoxMinXMin",initialValue:0,getPrimitiveFunction:function(){t.clippingBoxMinXMin=t._voxelPrimitive.minBounds.x}}),n({name:"clippingBoxMinXMax",initialValue:1,getPrimitiveFunction:function(){t.clippingBoxMinXMax=t._voxelPrimitive.maxBounds.x}}),n({name:"clippingBoxMinX",initialValue:0,setPrimitiveFunction:i("minClippingBounds","x"),getPrimitiveFunction:function(){t.clippingBoxMinX=t._voxelPrimitive.minClippingBounds.x}}),n({name:"clippingBoxMaxYMin",initialValue:0,getPrimitiveFunction:function(){t.clippingBoxMaxYMin=t._voxelPrimitive.minBounds.y}}),n({name:"clippingBoxMaxYMax",initialValue:1,getPrimitiveFunction:function(){t.clippingBoxMaxYMax=t._voxelPrimitive.maxBounds.y}}),n({name:"clippingBoxMaxY",initialValue:0,setPrimitiveFunction:i("maxClippingBounds","y"),getPrimitiveFunction:function(){t.clippingBoxMaxY=t._voxelPrimitive.maxClippingBounds.y}}),n({name:"clippingBoxMinYMin",initialValue:0,getPrimitiveFunction:function(){t.clippingBoxMinYMin=t._voxelPrimitive.minBounds.y}}),n({name:"clippingBoxMinYMax",initialValue:1,getPrimitiveFunction:function(){t.clippingBoxMinYMax=t._voxelPrimitive.maxBounds.y}}),n({name:"clippingBoxMinY",initialValue:0,setPrimitiveFunction:i("minClippingBounds","y"),getPrimitiveFunction:function(){t.clippingBoxMinY=t._voxelPrimitive.minClippingBounds.y}}),n({name:"clippingBoxMaxZMin",initialValue:0,getPrimitiveFunction:function(){t.clippingBoxMaxZMin=t._voxelPrimitive.minBounds.z}}),n({name:"clippingBoxMaxZMax",initialValue:1,getPrimitiveFunction:function(){t.clippingBoxMaxZMax=t._voxelPrimitive.maxBounds.z}}),n({name:"clippingBoxMaxZ",initialValue:0,setPrimitiveFunction:i("maxClippingBounds","z"),getPrimitiveFunction:function(){t.clippingBoxMaxZ=t._voxelPrimitive.maxClippingBounds.z}}),n({name:"clippingBoxMinZMin",initialValue:0,getPrimitiveFunction:function(){t.clippingBoxMinZMin=t._voxelPrimitive.minBounds.z}}),n({name:"clippingBoxMinZMax",initialValue:1,getPrimitiveFunction:function(){t.clippingBoxMinZMax=t._voxelPrimitive.maxBounds.z}}),n({name:"clippingBoxMinZ",initialValue:0,setPrimitiveFunction:i("minClippingBounds","z"),getPrimitiveFunction:function(){t.clippingBoxMinZ=t._voxelPrimitive.minClippingBounds.z}}),n({name:"clippingEllipsoidMaxLongitudeMin",initialValue:-P.PI,getPrimitiveFunction:function(){t.clippingEllipsoidMaxLongitudeMin=t._voxelPrimitive.minBounds.x}}),n({name:"clippingEllipsoidMaxLongitudeMax",initialValue:P.PI,getPrimitiveFunction:function(){t.clippingEllipsoidMaxLongitudeMax=t._voxelPrimitive.maxBounds.x}}),n({name:"clippingEllipsoidMaxLongitude",initialValue:0,setPrimitiveFunction:i("maxClippingBounds","x"),getPrimitiveFunction:function(){t.clippingEllipsoidMaxLongitude=t._voxelPrimitive.maxClippingBounds.x}}),n({name:"clippingEllipsoidMinLongitudeMin",initialValue:-P.PI,getPrimitiveFunction:function(){t.clippingEllipsoidMinLongitudeMin=t._voxelPrimitive.minBounds.x}}),n({name:"clippingEllipsoidMinLongitudeMax",initialValue:P.PI,getPrimitiveFunction:function(){t.clippingEllipsoidMinLongitudeMax=t._voxelPrimitive.maxBounds.x}}),n({name:"clippingEllipsoidMinLongitude",initialValue:0,setPrimitiveFunction:i("minClippingBounds","x"),getPrimitiveFunction:function(){t.clippingEllipsoidMinLongitude=t._voxelPrimitive.minClippingBounds.x}}),n({name:"clippingEllipsoidMaxLatitudeMin",initialValue:-P.PI_OVER_TWO,getPrimitiveFunction:function(){t.clippingEllipsoidMaxLatitudeMin=t._voxelPrimitive.minBounds.y}}),n({name:"clippingEllipsoidMaxLatitudeMax",initialValue:P.PI_OVER_TWO,getPrimitiveFunction:function(){t.clippingEllipsoidMaxLatitudeMax=t._voxelPrimitive.maxBounds.y}}),n({name:"clippingEllipsoidMaxLatitude",initialValue:0,setPrimitiveFunction:i("maxClippingBounds","y"),getPrimitiveFunction:function(){t.clippingEllipsoidMaxLatitude=t._voxelPrimitive.maxClippingBounds.y}}),n({name:"clippingEllipsoidMinLatitudeMin",initialValue:-P.PI_OVER_TWO,getPrimitiveFunction:function(){t.clippingEllipsoidMinLatitudeMin=t._voxelPrimitive.minBounds.y}}),n({name:"clippingEllipsoidMinLatitudeMax",initialValue:P.PI_OVER_TWO,getPrimitiveFunction:function(){t.clippingEllipsoidMinLatitudeMax=t._voxelPrimitive.maxBounds.y}}),n({name:"clippingEllipsoidMinLatitude",initialValue:0,setPrimitiveFunction:i("minClippingBounds","y"),getPrimitiveFunction:function(){t.clippingEllipsoidMinLatitude=t._voxelPrimitive.minClippingBounds.y}}),n({name:"clippingEllipsoidMaxHeightMin",initialValue:0,getPrimitiveFunction:function(){t.clippingEllipsoidMaxHeightMin=t._voxelPrimitive.minBounds.z}}),n({name:"clippingEllipsoidMaxHeightMax",initialValue:1e5,getPrimitiveFunction:function(){t.clippingEllipsoidMaxHeightMax=t._voxelPrimitive.maxBounds.z}}),n({name:"clippingEllipsoidMaxHeight",initialValue:0,setPrimitiveFunction:i("maxClippingBounds","z"),getPrimitiveFunction:function(){t.clippingEllipsoidMaxHeight=t._voxelPrimitive.maxClippingBounds.z}}),n({name:"clippingEllipsoidMinHeightMin",initialValue:-1e5,getPrimitiveFunction:function(){t.clippingEllipsoidMinHeightMin=t._voxelPrimitive.minBounds.z}}),n({name:"clippingEllipsoidMinHeightMax",initialValue:0,getPrimitiveFunction:function(){t.clippingEllipsoidMinHeightMax=t._voxelPrimitive.maxBounds.z}}),n({name:"clippingEllipsoidMinHeight",initialValue:0,setPrimitiveFunction:i("minClippingBounds","z"),getPrimitiveFunction:function(){t.clippingEllipsoidMinHeight=t._voxelPrimitive.minClippingBounds.z}}),n({name:"clippingCylinderMaxRadiusMin",initialValue:0,getPrimitiveFunction:function(){t.clippingCylinderMaxRadiusMin=t._voxelPrimitive.minBounds.x}}),n({name:"clippingCylinderMaxRadiusMax",initialValue:1,getPrimitiveFunction:function(){t.clippingCylinderMaxRadiusMax=t._voxelPrimitive.maxBounds.x}}),n({name:"clippingCylinderMaxRadius",initialValue:0,setPrimitiveFunction:i("maxClippingBounds","x"),getPrimitiveFunction:function(){t.clippingCylinderMaxRadius=t._voxelPrimitive.maxClippingBounds.x}}),n({name:"clippingCylinderMinRadiusMin",initialValue:0,getPrimitiveFunction:function(){t.clippingCylinderMinRadiusMin=t._voxelPrimitive.minBounds.x}}),n({name:"clippingCylinderMinRadiusMax",initialValue:1,getPrimitiveFunction:function(){t.clippingCylinderMinRadiusMax=t._voxelPrimitive.maxBounds.x}}),n({name:"clippingCylinderMinRadius",initialValue:0,setPrimitiveFunction:i("minClippingBounds","x"),getPrimitiveFunction:function(){t.clippingCylinderMinRadius=t._voxelPrimitive.minClippingBounds.x}}),n({name:"clippingCylinderMaxAngleMin",initialValue:-P.PI,getPrimitiveFunction:function(){t.clippingCylinderMaxAngleMin=t._voxelPrimitive.minBounds.y}}),n({name:"clippingCylinderMaxAngleMax",initialValue:P.PI,getPrimitiveFunction:function(){t.clippingCylinderMaxAngleMax=t._voxelPrimitive.maxBounds.y}}),n({name:"clippingCylinderMaxAngle",initialValue:0,setPrimitiveFunction:i("maxClippingBounds","y"),getPrimitiveFunction:function(){t.clippingCylinderMaxAngle=t._voxelPrimitive.maxClippingBounds.y}}),n({name:"clippingCylinderMinAngleMin",initialValue:-P.PI}),n({name:"clippingCylinderMinAngleMax",initialValue:P.PI}),n({name:"clippingCylinderMinAngle",initialValue:0,setPrimitiveFunction:i("minClippingBounds","y"),getPrimitiveFunction:function(){t.clippingCylinderMinAngle=t._voxelPrimitive.minClippingBounds.y}}),n({name:"clippingCylinderMaxHeightMin",initialValue:-1,getPrimitiveFunction:function(){t.clippingCylinderMaxHeightMin=t._voxelPrimitive.minBounds.z}}),n({name:"clippingCylinderMaxHeightMax",initialValue:1,getPrimitiveFunction:function(){t.clippingCylinderMaxHeightMax=t._voxelPrimitive.maxBounds.z}}),n({name:"clippingCylinderMaxHeight",initialValue:0,setPrimitiveFunction:i("maxClippingBounds","z"),getPrimitiveFunction:function(){t.clippingCylinderMaxHeight=t._voxelPrimitive.maxClippingBounds.z}}),n({name:"clippingCylinderMinHeightMin",initialValue:-1,getPrimitiveFunction:function(){t.clippingCylinderMinHeightMin=t._voxelPrimitive.minBounds.z}}),n({name:"clippingCylinderMinHeightMax",initialValue:1,getPrimitiveFunction:function(){t.clippingCylinderMinHeightMax=t._voxelPrimitive.maxBounds.z}}),n({name:"clippingCylinderMinHeight",initialValue:0,setPrimitiveFunction:i("minClippingBounds","z"),getPrimitiveFunction:function(){t.clippingCylinderMinHeight=t._voxelPrimitive.minClippingBounds.z}}),n({name:"translationX",initialValue:0,setPrimitiveFunction:function(){t._modelMatrixReady&&S0(t)},getPrimitiveFunction:function(){t.translationX=M.getTranslation(t._voxelPrimitive.modelMatrix,new h).x}}),n({name:"translationY",initialValue:0,setPrimitiveFunction:function(){t._modelMatrixReady&&S0(t)},getPrimitiveFunction:function(){t.translationY=M.getTranslation(t._voxelPrimitive.modelMatrix,new h).y}}),n({name:"translationZ",initialValue:0,setPrimitiveFunction:function(){t._modelMatrixReady&&S0(t)},getPrimitiveFunction:function(){t.translationZ=M.getTranslation(t._voxelPrimitive.modelMatrix,new h).z}}),n({name:"scaleX",initialValue:1,setPrimitiveFunction:function(){t._modelMatrixReady&&S0(t)},getPrimitiveFunction:function(){t.scaleX=M.getScale(t._voxelPrimitive.modelMatrix,new h).x}}),n({name:"scaleY",initialValue:1,setPrimitiveFunction:function(){t._modelMatrixReady&&S0(t)},getPrimitiveFunction:function(){t.scaleY=M.getScale(t._voxelPrimitive.modelMatrix,new h).y}}),n({name:"scaleZ",initialValue:1,setPrimitiveFunction:function(){t._modelMatrixReady&&S0(t)},getPrimitiveFunction:function(){t.scaleZ=M.getScale(t._voxelPrimitive.modelMatrix,new h).z}}),n({name:"angleX",initialValue:0,setPrimitiveFunction:function(){t._modelMatrixReady&&S0(t)}}),n({name:"angleY",initialValue:0,setPrimitiveFunction:function(){t._modelMatrixReady&&S0(t)}}),n({name:"angleZ",initialValue:0,setPrimitiveFunction:function(){t._modelMatrixReady&&S0(t)}})}var hGt=new h,mGt=new h,pGt=new kc,gGt=new $;function S0(e){let t=h.fromElements(e.translationX,e.translationY,e.translationZ,hGt),n=h.fromElements(e.scaleX,e.scaleY,e.scaleZ,mGt),i=pGt;i.heading=e.angleX,i.pitch=e.angleY,i.roll=e.angleZ;let r=$.fromHeadingPitchRoll(i,gGt),o=$.multiplyByScale(r,n,r);e._voxelPrimitive.modelMatrix=M.fromRotationTranslation(o,t,e._voxelPrimitive.modelMatrix)}Object.defineProperties(ah.prototype,{scene:{get:function(){return this._scene}},voxelPrimitive:{get:function(){return this._voxelPrimitive},set:function(e){if(l(this._customShaderCompilationRemoveCallback)&&this._customShaderCompilationRemoveCallback(),!l(e))return;this._voxelPrimitive=e;let t=this;t._customShaderCompilationRemoveCallback=t._voxelPrimitive.customShaderCompilationEvent.addEventListener(function(n){let i=t._voxelPrimitive.customShader.fragmentShaderText;t.shaderString=Rke(i),l(n)?(t.shaderCompilationMessage=n.message,t.shaderCompilationSuccess=!1):(t.shaderCompilationMessage="Shader compiled successfully!",t.shaderCompilationSuccess=!0)}),t._modelMatrixReady=!1;for(let n=0;n<t._getPrimitiveFunctions.length;n++)t._getPrimitiveFunctions[n]();t._modelMatrixReady=!0,S0(t)}}});ah.prototype.toggleInspector=function(){this.inspectorVisible=!this.inspectorVisible};ah.prototype.toggleDisplay=function(){this.displayVisible=!this.displayVisible};ah.prototype.toggleTransform=function(){this.transformVisible=!this.transformVisible};ah.prototype.toggleBounds=function(){this.boundsVisible=!this.boundsVisible};ah.prototype.toggleClipping=function(){this.clippingVisible=!this.clippingVisible};ah.prototype.toggleShader=function(){this.shaderVisible=!this.shaderVisible};ah.prototype.compileShader=function(){l(this._voxelPrimitive)&&(this._voxelPrimitive.customShader=new u_({fragmentShaderText:this.shaderString,uniforms:this._voxelPrimitive.customShader.uniforms}))};ah.prototype.shaderEditorKeyPress=function(e,t){if(t.keyCode===9){t.preventDefault();let n=t.target,i=n.selectionStart,r=n.selectionEnd,o=r,a=n.value.slice(i,r).split(` +`}return i}function ah(e){this._scene=e,this._voxelPrimitive=void 0,this._customShaderCompilationRemoveCallback=void 0,this._definedProperties=[],this._getPrimitiveFunctions=[],this._modelMatrixReady=!1;let t=this;function n(r){let{name:o,initialValue:s}=r;t._definedProperties.push(o);let a=r.setPrimitiveFunction;a===!0&&(a=function(f){t._voxelPrimitive[o]=f});let c=r.getPrimitiveFunction;c===!0&&(c=function(){t[o]=t._voxelPrimitive[o]}),l(c)&&t._getPrimitiveFunctions.push(c);let u=Se.observable();return Se.defineProperty(t,o,{get:function(){return u()},set:function(f){typeof s=="number"&&typeof f=="string"&&(f=Number(f),isNaN(f)&&(f=s)),typeof s=="boolean"&&typeof f=="number"&&(f=f===1),u(f),l(a)&&l(t._voxelPrimitive)&&(a(f),e.requestRender())}}),t[o]=s,u}function i(r,o){return function(s){let a=t._voxelPrimitive[r].clone();a[o]=s,t._voxelPrimitive[r]=a}}n({name:"inspectorVisible",initialValue:!0}),n({name:"displayVisible",initialValue:!1}),n({name:"transformVisible",initialValue:!1}),n({name:"boundsVisible",initialValue:!1}),n({name:"clippingVisible",initialValue:!1}),n({name:"shaderVisible",initialValue:!1}),n({name:"shaderString",initialValue:"",getPrimitiveFunction:function(){let r=t._voxelPrimitive.customShader.fragmentShaderText;t.shaderString=Oke(r)}}),n({name:"shaderCompilationMessage",initialValue:""}),n({name:"shaderCompilationSuccess",initialValue:!0}),n({name:"depthTest",initialValue:!1,setPrimitiveFunction:!0,getPrimitiveFunction:!0}),n({name:"show",initialValue:!0,setPrimitiveFunction:!0,getPrimitiveFunction:!0}),n({name:"disableUpdate",initialValue:!1,setPrimitiveFunction:!0,getPrimitiveFunction:!0}),n({name:"debugDraw",initialValue:!1,setPrimitiveFunction:!0,getPrimitiveFunction:!0}),n({name:"jitter",initialValue:!0,setPrimitiveFunction:!0,getPrimitiveFunction:!0}),n({name:"nearestSampling",initialValue:!0,setPrimitiveFunction:!0,getPrimitiveFunction:!0}),n({name:"screenSpaceError",initialValue:4,setPrimitiveFunction:!0,getPrimitiveFunction:!0}),n({name:"stepSize",initialValue:1,setPrimitiveFunction:!0,getPrimitiveFunction:!0}),n({name:"shapeIsBox",getPrimitiveFunction:function(){let r=t._voxelPrimitive.shape;t.shapeIsBox=r===Ic.BOX}}),n({name:"shapeIsEllipsoid",getPrimitiveFunction:function(){let r=t._voxelPrimitive.shape;t.shapeIsEllipsoid=r===Ic.ELLIPSOID}}),n({name:"shapeIsCylinder",getPrimitiveFunction:function(){let r=t._voxelPrimitive.shape;t.shapeIsCylinder=r===Ic.CYLINDER}}),n({name:"clippingBoxMaxXMin",initialValue:0,getPrimitiveFunction:function(){t.clippingBoxMaxXMin=t._voxelPrimitive.minBounds.x}}),n({name:"clippingBoxMaxXMax",initialValue:1,getPrimitiveFunction:function(){t.clippingBoxMaxXMax=t._voxelPrimitive.maxBounds.x}}),n({name:"clippingBoxMaxX",initialValue:0,setPrimitiveFunction:i("maxClippingBounds","x"),getPrimitiveFunction:function(){t.clippingBoxMaxX=t._voxelPrimitive.maxClippingBounds.x}}),n({name:"clippingBoxMinXMin",initialValue:0,getPrimitiveFunction:function(){t.clippingBoxMinXMin=t._voxelPrimitive.minBounds.x}}),n({name:"clippingBoxMinXMax",initialValue:1,getPrimitiveFunction:function(){t.clippingBoxMinXMax=t._voxelPrimitive.maxBounds.x}}),n({name:"clippingBoxMinX",initialValue:0,setPrimitiveFunction:i("minClippingBounds","x"),getPrimitiveFunction:function(){t.clippingBoxMinX=t._voxelPrimitive.minClippingBounds.x}}),n({name:"clippingBoxMaxYMin",initialValue:0,getPrimitiveFunction:function(){t.clippingBoxMaxYMin=t._voxelPrimitive.minBounds.y}}),n({name:"clippingBoxMaxYMax",initialValue:1,getPrimitiveFunction:function(){t.clippingBoxMaxYMax=t._voxelPrimitive.maxBounds.y}}),n({name:"clippingBoxMaxY",initialValue:0,setPrimitiveFunction:i("maxClippingBounds","y"),getPrimitiveFunction:function(){t.clippingBoxMaxY=t._voxelPrimitive.maxClippingBounds.y}}),n({name:"clippingBoxMinYMin",initialValue:0,getPrimitiveFunction:function(){t.clippingBoxMinYMin=t._voxelPrimitive.minBounds.y}}),n({name:"clippingBoxMinYMax",initialValue:1,getPrimitiveFunction:function(){t.clippingBoxMinYMax=t._voxelPrimitive.maxBounds.y}}),n({name:"clippingBoxMinY",initialValue:0,setPrimitiveFunction:i("minClippingBounds","y"),getPrimitiveFunction:function(){t.clippingBoxMinY=t._voxelPrimitive.minClippingBounds.y}}),n({name:"clippingBoxMaxZMin",initialValue:0,getPrimitiveFunction:function(){t.clippingBoxMaxZMin=t._voxelPrimitive.minBounds.z}}),n({name:"clippingBoxMaxZMax",initialValue:1,getPrimitiveFunction:function(){t.clippingBoxMaxZMax=t._voxelPrimitive.maxBounds.z}}),n({name:"clippingBoxMaxZ",initialValue:0,setPrimitiveFunction:i("maxClippingBounds","z"),getPrimitiveFunction:function(){t.clippingBoxMaxZ=t._voxelPrimitive.maxClippingBounds.z}}),n({name:"clippingBoxMinZMin",initialValue:0,getPrimitiveFunction:function(){t.clippingBoxMinZMin=t._voxelPrimitive.minBounds.z}}),n({name:"clippingBoxMinZMax",initialValue:1,getPrimitiveFunction:function(){t.clippingBoxMinZMax=t._voxelPrimitive.maxBounds.z}}),n({name:"clippingBoxMinZ",initialValue:0,setPrimitiveFunction:i("minClippingBounds","z"),getPrimitiveFunction:function(){t.clippingBoxMinZ=t._voxelPrimitive.minClippingBounds.z}}),n({name:"clippingEllipsoidMaxLongitudeMin",initialValue:-P.PI,getPrimitiveFunction:function(){t.clippingEllipsoidMaxLongitudeMin=t._voxelPrimitive.minBounds.x}}),n({name:"clippingEllipsoidMaxLongitudeMax",initialValue:P.PI,getPrimitiveFunction:function(){t.clippingEllipsoidMaxLongitudeMax=t._voxelPrimitive.maxBounds.x}}),n({name:"clippingEllipsoidMaxLongitude",initialValue:0,setPrimitiveFunction:i("maxClippingBounds","x"),getPrimitiveFunction:function(){t.clippingEllipsoidMaxLongitude=t._voxelPrimitive.maxClippingBounds.x}}),n({name:"clippingEllipsoidMinLongitudeMin",initialValue:-P.PI,getPrimitiveFunction:function(){t.clippingEllipsoidMinLongitudeMin=t._voxelPrimitive.minBounds.x}}),n({name:"clippingEllipsoidMinLongitudeMax",initialValue:P.PI,getPrimitiveFunction:function(){t.clippingEllipsoidMinLongitudeMax=t._voxelPrimitive.maxBounds.x}}),n({name:"clippingEllipsoidMinLongitude",initialValue:0,setPrimitiveFunction:i("minClippingBounds","x"),getPrimitiveFunction:function(){t.clippingEllipsoidMinLongitude=t._voxelPrimitive.minClippingBounds.x}}),n({name:"clippingEllipsoidMaxLatitudeMin",initialValue:-P.PI_OVER_TWO,getPrimitiveFunction:function(){t.clippingEllipsoidMaxLatitudeMin=t._voxelPrimitive.minBounds.y}}),n({name:"clippingEllipsoidMaxLatitudeMax",initialValue:P.PI_OVER_TWO,getPrimitiveFunction:function(){t.clippingEllipsoidMaxLatitudeMax=t._voxelPrimitive.maxBounds.y}}),n({name:"clippingEllipsoidMaxLatitude",initialValue:0,setPrimitiveFunction:i("maxClippingBounds","y"),getPrimitiveFunction:function(){t.clippingEllipsoidMaxLatitude=t._voxelPrimitive.maxClippingBounds.y}}),n({name:"clippingEllipsoidMinLatitudeMin",initialValue:-P.PI_OVER_TWO,getPrimitiveFunction:function(){t.clippingEllipsoidMinLatitudeMin=t._voxelPrimitive.minBounds.y}}),n({name:"clippingEllipsoidMinLatitudeMax",initialValue:P.PI_OVER_TWO,getPrimitiveFunction:function(){t.clippingEllipsoidMinLatitudeMax=t._voxelPrimitive.maxBounds.y}}),n({name:"clippingEllipsoidMinLatitude",initialValue:0,setPrimitiveFunction:i("minClippingBounds","y"),getPrimitiveFunction:function(){t.clippingEllipsoidMinLatitude=t._voxelPrimitive.minClippingBounds.y}}),n({name:"clippingEllipsoidMaxHeightMin",initialValue:0,getPrimitiveFunction:function(){t.clippingEllipsoidMaxHeightMin=t._voxelPrimitive.minBounds.z}}),n({name:"clippingEllipsoidMaxHeightMax",initialValue:1e5,getPrimitiveFunction:function(){t.clippingEllipsoidMaxHeightMax=t._voxelPrimitive.maxBounds.z}}),n({name:"clippingEllipsoidMaxHeight",initialValue:0,setPrimitiveFunction:i("maxClippingBounds","z"),getPrimitiveFunction:function(){t.clippingEllipsoidMaxHeight=t._voxelPrimitive.maxClippingBounds.z}}),n({name:"clippingEllipsoidMinHeightMin",initialValue:-1e5,getPrimitiveFunction:function(){t.clippingEllipsoidMinHeightMin=t._voxelPrimitive.minBounds.z}}),n({name:"clippingEllipsoidMinHeightMax",initialValue:0,getPrimitiveFunction:function(){t.clippingEllipsoidMinHeightMax=t._voxelPrimitive.maxBounds.z}}),n({name:"clippingEllipsoidMinHeight",initialValue:0,setPrimitiveFunction:i("minClippingBounds","z"),getPrimitiveFunction:function(){t.clippingEllipsoidMinHeight=t._voxelPrimitive.minClippingBounds.z}}),n({name:"clippingCylinderMaxRadiusMin",initialValue:0,getPrimitiveFunction:function(){t.clippingCylinderMaxRadiusMin=t._voxelPrimitive.minBounds.x}}),n({name:"clippingCylinderMaxRadiusMax",initialValue:1,getPrimitiveFunction:function(){t.clippingCylinderMaxRadiusMax=t._voxelPrimitive.maxBounds.x}}),n({name:"clippingCylinderMaxRadius",initialValue:0,setPrimitiveFunction:i("maxClippingBounds","x"),getPrimitiveFunction:function(){t.clippingCylinderMaxRadius=t._voxelPrimitive.maxClippingBounds.x}}),n({name:"clippingCylinderMinRadiusMin",initialValue:0,getPrimitiveFunction:function(){t.clippingCylinderMinRadiusMin=t._voxelPrimitive.minBounds.x}}),n({name:"clippingCylinderMinRadiusMax",initialValue:1,getPrimitiveFunction:function(){t.clippingCylinderMinRadiusMax=t._voxelPrimitive.maxBounds.x}}),n({name:"clippingCylinderMinRadius",initialValue:0,setPrimitiveFunction:i("minClippingBounds","x"),getPrimitiveFunction:function(){t.clippingCylinderMinRadius=t._voxelPrimitive.minClippingBounds.x}}),n({name:"clippingCylinderMaxAngleMin",initialValue:-P.PI,getPrimitiveFunction:function(){t.clippingCylinderMaxAngleMin=t._voxelPrimitive.minBounds.y}}),n({name:"clippingCylinderMaxAngleMax",initialValue:P.PI,getPrimitiveFunction:function(){t.clippingCylinderMaxAngleMax=t._voxelPrimitive.maxBounds.y}}),n({name:"clippingCylinderMaxAngle",initialValue:0,setPrimitiveFunction:i("maxClippingBounds","y"),getPrimitiveFunction:function(){t.clippingCylinderMaxAngle=t._voxelPrimitive.maxClippingBounds.y}}),n({name:"clippingCylinderMinAngleMin",initialValue:-P.PI}),n({name:"clippingCylinderMinAngleMax",initialValue:P.PI}),n({name:"clippingCylinderMinAngle",initialValue:0,setPrimitiveFunction:i("minClippingBounds","y"),getPrimitiveFunction:function(){t.clippingCylinderMinAngle=t._voxelPrimitive.minClippingBounds.y}}),n({name:"clippingCylinderMaxHeightMin",initialValue:-1,getPrimitiveFunction:function(){t.clippingCylinderMaxHeightMin=t._voxelPrimitive.minBounds.z}}),n({name:"clippingCylinderMaxHeightMax",initialValue:1,getPrimitiveFunction:function(){t.clippingCylinderMaxHeightMax=t._voxelPrimitive.maxBounds.z}}),n({name:"clippingCylinderMaxHeight",initialValue:0,setPrimitiveFunction:i("maxClippingBounds","z"),getPrimitiveFunction:function(){t.clippingCylinderMaxHeight=t._voxelPrimitive.maxClippingBounds.z}}),n({name:"clippingCylinderMinHeightMin",initialValue:-1,getPrimitiveFunction:function(){t.clippingCylinderMinHeightMin=t._voxelPrimitive.minBounds.z}}),n({name:"clippingCylinderMinHeightMax",initialValue:1,getPrimitiveFunction:function(){t.clippingCylinderMinHeightMax=t._voxelPrimitive.maxBounds.z}}),n({name:"clippingCylinderMinHeight",initialValue:0,setPrimitiveFunction:i("minClippingBounds","z"),getPrimitiveFunction:function(){t.clippingCylinderMinHeight=t._voxelPrimitive.minClippingBounds.z}}),n({name:"translationX",initialValue:0,setPrimitiveFunction:function(){t._modelMatrixReady&&S0(t)},getPrimitiveFunction:function(){t.translationX=M.getTranslation(t._voxelPrimitive.modelMatrix,new h).x}}),n({name:"translationY",initialValue:0,setPrimitiveFunction:function(){t._modelMatrixReady&&S0(t)},getPrimitiveFunction:function(){t.translationY=M.getTranslation(t._voxelPrimitive.modelMatrix,new h).y}}),n({name:"translationZ",initialValue:0,setPrimitiveFunction:function(){t._modelMatrixReady&&S0(t)},getPrimitiveFunction:function(){t.translationZ=M.getTranslation(t._voxelPrimitive.modelMatrix,new h).z}}),n({name:"scaleX",initialValue:1,setPrimitiveFunction:function(){t._modelMatrixReady&&S0(t)},getPrimitiveFunction:function(){t.scaleX=M.getScale(t._voxelPrimitive.modelMatrix,new h).x}}),n({name:"scaleY",initialValue:1,setPrimitiveFunction:function(){t._modelMatrixReady&&S0(t)},getPrimitiveFunction:function(){t.scaleY=M.getScale(t._voxelPrimitive.modelMatrix,new h).y}}),n({name:"scaleZ",initialValue:1,setPrimitiveFunction:function(){t._modelMatrixReady&&S0(t)},getPrimitiveFunction:function(){t.scaleZ=M.getScale(t._voxelPrimitive.modelMatrix,new h).z}}),n({name:"angleX",initialValue:0,setPrimitiveFunction:function(){t._modelMatrixReady&&S0(t)}}),n({name:"angleY",initialValue:0,setPrimitiveFunction:function(){t._modelMatrixReady&&S0(t)}}),n({name:"angleZ",initialValue:0,setPrimitiveFunction:function(){t._modelMatrixReady&&S0(t)}})}var mGt=new h,pGt=new h,gGt=new kc,_Gt=new $;function S0(e){let t=h.fromElements(e.translationX,e.translationY,e.translationZ,mGt),n=h.fromElements(e.scaleX,e.scaleY,e.scaleZ,pGt),i=gGt;i.heading=e.angleX,i.pitch=e.angleY,i.roll=e.angleZ;let r=$.fromHeadingPitchRoll(i,_Gt),o=$.multiplyByScale(r,n,r);e._voxelPrimitive.modelMatrix=M.fromRotationTranslation(o,t,e._voxelPrimitive.modelMatrix)}Object.defineProperties(ah.prototype,{scene:{get:function(){return this._scene}},voxelPrimitive:{get:function(){return this._voxelPrimitive},set:function(e){if(l(this._customShaderCompilationRemoveCallback)&&this._customShaderCompilationRemoveCallback(),!l(e))return;this._voxelPrimitive=e;let t=this;t._customShaderCompilationRemoveCallback=t._voxelPrimitive.customShaderCompilationEvent.addEventListener(function(n){let i=t._voxelPrimitive.customShader.fragmentShaderText;t.shaderString=Oke(i),l(n)?(t.shaderCompilationMessage=n.message,t.shaderCompilationSuccess=!1):(t.shaderCompilationMessage="Shader compiled successfully!",t.shaderCompilationSuccess=!0)}),t._modelMatrixReady=!1;for(let n=0;n<t._getPrimitiveFunctions.length;n++)t._getPrimitiveFunctions[n]();t._modelMatrixReady=!0,S0(t)}}});ah.prototype.toggleInspector=function(){this.inspectorVisible=!this.inspectorVisible};ah.prototype.toggleDisplay=function(){this.displayVisible=!this.displayVisible};ah.prototype.toggleTransform=function(){this.transformVisible=!this.transformVisible};ah.prototype.toggleBounds=function(){this.boundsVisible=!this.boundsVisible};ah.prototype.toggleClipping=function(){this.clippingVisible=!this.clippingVisible};ah.prototype.toggleShader=function(){this.shaderVisible=!this.shaderVisible};ah.prototype.compileShader=function(){l(this._voxelPrimitive)&&(this._voxelPrimitive.customShader=new $g({fragmentShaderText:this.shaderString,uniforms:this._voxelPrimitive.customShader.uniforms}))};ah.prototype.shaderEditorKeyPress=function(e,t){if(t.keyCode===9){t.preventDefault();let n=t.target,i=n.selectionStart,r=n.selectionEnd,o=r,a=n.value.slice(i,r).split(` `),c=a.length,u;if(t.shiftKey)for(u=0;u<c;++u)a[u][0]===" "&&(a[u][1]===" "?(a[u]=a[u].substr(2),o-=2):(a[u]=a[u].substr(1),o-=1));else for(u=0;u<c;++u)a[u]=` ${a[u]}`,o+=2;let f=a.join(` -`);n.value=n.value.slice(0,i)+f+n.value.slice(r),n.selectionStart=i!==r?i:o,n.selectionEnd=o}else t.ctrlKey&&(t.keyCode===10||t.keyCode===13)&&this.compileShader();return!0};ah.prototype.isDestroyed=function(){return!1};ah.prototype.destroy=function(){let e=this;return this._definedProperties.forEach(function(t){Se.getObservable(e,t).dispose()}),le(this)};var eq=ah;function tq(e,t){e=kn(e);let n=document.createElement("div"),i=new eq(t);this._viewModel=i,this._container=e,this._element=n;let r=document.createElement("div");r.textContent="Voxel Inspector",r.className="cesium-cesiumInspector-button",r.setAttribute("data-bind","click: toggleInspector"),n.appendChild(r),n.className="cesium-cesiumInspector cesium-VoxelInspector",n.setAttribute("data-bind",'css: { "cesium-cesiumInspector-visible" : inspectorVisible, "cesium-cesiumInspector-hidden" : !inspectorVisible}'),e.appendChild(n);let o=document.createElement("div");o.className="cesium-cesiumInspector-dropDown",n.appendChild(o);let{createSection:s,createCheckbox:a,createRangeInput:c,createButton:u}=qf,f=s(o,"Display","displayVisible","toggleDisplay"),d=s(o,"Transform","transformVisible","toggleTransform"),p=s(o,"Clipping","clippingVisible","toggleClipping"),g=s(o,"Shader","shaderVisible","toggleShader");f.appendChild(a("Depth Test","depthTest")),f.appendChild(a("Show","show")),f.appendChild(a("Disable Update","disableUpdate")),f.appendChild(a("Debug Draw","debugDraw")),f.appendChild(a("Jitter","jitter")),f.appendChild(a("Nearest Sampling","nearestSampling")),f.appendChild(c("Screen Space Error","screenSpaceError",0,128)),f.appendChild(c("Step Size","stepSize",0,2));let m=10,y=10,A=P.PI;d.appendChild(c("Translation X","translationX",-m,+m)),d.appendChild(c("Translation Y","translationY",-m,+m)),d.appendChild(c("Translation Z","translationZ",-m,+m)),d.appendChild(c("Scale X","scaleX",0,+y)),d.appendChild(c("Scale Y","scaleY",0,+y)),d.appendChild(c("Scale Z","scaleZ",0,+y)),d.appendChild(c("Heading","angleX",-A,+A)),d.appendChild(c("Pitch","angleY",-A,+A)),d.appendChild(c("Roll","angleZ",-A,+A)),Hae("Max X","Min X","Max Y","Min Y","Max Z","Min Z","clippingBoxMaxX","clippingBoxMinX","clippingBoxMaxY","clippingBoxMinY","clippingBoxMaxZ","clippingBoxMinZ","shapeIsBox",p),Hae("Max Longitude","Min Longitude","Max Latitude","Min Latitude","Max Height","Min Height","clippingEllipsoidMaxLongitude","clippingEllipsoidMinLongitude","clippingEllipsoidMaxLatitude","clippingEllipsoidMinLatitude","clippingEllipsoidMaxHeight","clippingEllipsoidMinHeight","shapeIsEllipsoid",p),Hae("Max Radius","Min Radius","Max Angle","Min Angle","Max Height","Min Height","clippingCylinderMaxRadius","clippingCylinderMinRadius","clippingCylinderMaxAngle","clippingCylinderMinAngle","clippingCylinderMaxHeight","clippingCylinderMinHeight","shapeIsCylinder",p);let b=document.createElement("div");g.appendChild(b);let x=document.createElement("textarea");x.setAttribute("data-bind","textInput: shaderString, event: { keydown: shaderEditorKeyPress }"),b.className="cesium-cesiumInspector-styleEditor",b.appendChild(x);let T=u("Compile (Ctrl+Enter)","compileShader");b.appendChild(T);let E=document.createElement("label");E.style.display="block",E.setAttribute("data-bind","text: shaderCompilationMessage, style: {color: shaderCompilationSuccess ? 'green' : 'red'}"),b.appendChild(E),Se.applyBindings(i,n)}Object.defineProperties(tq.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}}});tq.prototype.isDestroyed=function(){return!1};tq.prototype.destroy=function(){return Se.cleanNode(this._element),this._container.removeChild(this._element),this.viewModel.destroy(),le(this)};function Hae(e,t,n,i,r,o,s,a,c,u,f,d,p,g){let m=qf.createRangeInputWithDynamicMinMax,y=g.appendChild(document.createElement("div"));y.setAttribute("data-bind",`if: ${p}`),y.appendChild(m(e,s)),y.appendChild(m(t,a)),y.appendChild(m(n,c)),y.appendChild(m(i,u)),y.appendChild(m(r,f)),y.appendChild(m(o,d))}var nq=tq;function _Gt(e){let t=document.createElement("div");t.className="cesium-viewer-voxelInspectorContainer",e.container.appendChild(t);let n=new nq(t,e.scene);Object.defineProperties(e,{voxelInspector:{get:function(){return n}}})}var Oke=_Gt;globalThis.CESIUM_VERSION="1.145.0";var R9r="1.145.0";export{Q0 as AlphaMode,hz as AlphaPipelineStage,uU as AnchorPointDirect,fU as AnchorPointIndirect,eW as Animation,tW as AnimationViewModel,Rr as Appearance,Ni as ApproximateTerrainHeights,LLe as ArcGISTiledElevationTerrainProvider,Ap as ArcGisBaseMapType,Py as ArcGisMapServerImageryProvider,yd as ArcGisMapService,ln as ArcType,Ll as ArticulationStageType,zt as AssociativeArray,KC as Atmosphere,HU as AtmospherePipelineStage,cn as AttributeCompression,Vt as AttributeType,S5 as AutoExposure,T_ as AutomaticUniforms,qi as Axis,sd as AxisAlignedBoundingBox,Jz as Azure2DImageryProvider,EU as B3dmLoader,TU as B3dmParser,rW as BaseLayerPicker,nW as BaseLayerPickerViewModel,tC as BatchTable,SC as BatchTableHierarchy,xu as BatchTexture,mz as BatchTexturePipelineStage,Fr as Billboard,wd as BillboardCollection,Il as BillboardGraphics,Ks as BillboardLoadState,Ny as BillboardTexture,sk as BillboardVisualizer,BLe as BingMapsGeocoderService,kz as BingMapsImageryProvider,GD as BingMapsStyle,Vc as BlendEquation,Zr as BlendFunction,ki as BlendOption,nn as BlendingState,et as BoundingRectangle,ue as BoundingSphere,Pt as BoundingSphereState,nx as BoundingVolumeSemantics,rBe as BoxEmitter,zc as BoxGeometry,Jk as BoxGeometryUpdater,cC as BoxGraphics,Jm as BoxOutlineGeometry,AG as BrdfLutGenerator,tt as Buffer,PC as BufferLoader,tl as BufferPoint,bf as BufferPointCollection,wp as BufferPointMaterial,Lo as BufferPolygon,Za as BufferPolygonCollection,pd as BufferPolygonMaterial,Oa as BufferPolyline,Ul as BufferPolylineCollection,gd as BufferPolylineMaterial,ms as BufferPrimitive,da as BufferPrimitiveCollection,vu as BufferPrimitiveMaterial,Me as BufferUsage,yz as CPUStylingPipelineStage,Zk as CallbackPositionProperty,rp as CallbackProperty,Nr as Camera,R5 as CameraEventAggregator,mr as CameraEventType,bG as CameraFlightPath,U as Cartesian2,h as Cartesian3,se as Cartesian4,QD as CartesianRectangle,he as Cartographic,kLe as CartographicGeocoderService,zLe as CatmullRomSpline,vC as Cesium3DContentGroup,Wh as Cesium3DTile,lp as Cesium3DTileBatchTable,df as Cesium3DTileColorBlendMode,sBe as Cesium3DTileContent,Uv as Cesium3DTileContentFactory,Mr as Cesium3DTileContentState,ka as Cesium3DTileContentType,ua as Cesium3DTileFeature,pp as Cesium3DTileFeatureTable,Hh as Cesium3DTileOptimizationHint,H4 as Cesium3DTileOptimizations,po as Cesium3DTilePass,Am as Cesium3DTilePassState,Fy as Cesium3DTilePointFeature,So as Cesium3DTileRefine,Vy as Cesium3DTileStyle,X4 as Cesium3DTileStyleEngine,Bv as Cesium3DTileVectorFeature,bW as Cesium3DTilesInspector,yW as Cesium3DTilesInspectorViewModel,G9 as Cesium3DTilesTerrainData,wM as Cesium3DTilesTerrainGeometryProcessor,QLe as Cesium3DTilesTerrainProvider,cBe as Cesium3DTilesVoxelProvider,Zo as Cesium3DTileset,$4 as Cesium3DTilesetBaseTraversal,W4 as Cesium3DTilesetCache,pC as Cesium3DTilesetGraphics,Y4 as Cesium3DTilesetHeatmap,Zv as Cesium3DTilesetMetadata,K4 as Cesium3DTilesetMostDetailedTraversal,Z4 as Cesium3DTilesetSkipTraversal,Pp as Cesium3DTilesetStatistics,ic as Cesium3DTilesetTraversal,n8 as Cesium3DTilesetVisualizer,lW as CesiumInspector,aW as CesiumInspectorViewModel,pI as CesiumTerrainProvider,k9 as CesiumWidget,qr as Check,U1 as CheckerboardMaterialProperty,h7 as CircleEmitter,cFe as CircleGeometry,lFe as CircleOutlineGeometry,kV as ClassificationModelDrawCommand,pz as ClassificationPipelineStage,wP as ClassificationPrimitive,ei as ClassificationType,fi as ClearCommand,fa as ClippingPlane,Ps as ClippingPlaneCollection,SD as ClippingPolygon,Zc as ClippingPolygonCollection,Mp as Clock,Bs as ClockRange,Hr as ClockStep,K7 as ClockViewModel,pBe as CloudCollection,NM as CloudType,z as Color,Nl as ColorBlendMode,Jt as ColorGeometryInstanceAttribute,Kt as ColorMaterialProperty,j2e as Command,Y as ComponentDatatype,t3 as Composite3DTileContent,Lxe as CompositeEntityCollection,H1 as CompositeMaterialProperty,Ec as CompositePositionProperty,Vl as CompositeProperty,nL as CompressedTextureBuffer,Jf as ComputeCommand,tL as ComputeEngine,b4 as ConditionsExpression,gBe as ConeEmitter,gu as ConstantPositionProperty,hi as ConstantProperty,RU as ConstantSpline,R4 as ContentMetadata,qE as Context,Ut as ContextLimits,S2e as Controller,IG as ControllerHost,X8 as CoplanarPolygonGeometry,Gy as CoplanarPolygonGeometryLibrary,Gh as CoplanarPolygonOutlineGeometry,ur as CornerType,dU as CorrelationGroup,sS as CorridorGeometry,gr as CorridorGeometryLibrary,d8 as CorridorGeometryUpdater,uC as CorridorGraphics,f8 as CorridorOutlineGeometry,It as Credit,DG as CreditDisplay,ls as CubeMap,gL as CubeMapFace,aI as CubeMapPanorama,kE as CubicRealPolynomial,Gi as CullFace,aa as CullingVolume,oh as CumulusCloud,g8 as CustomDataSource,uFe as CustomHeightmapTerrainProvider,u_ as CustomShader,Iy as CustomShaderMode,vz as CustomShaderPipelineStage,mx as CustomShaderTranslucencyMode,_8 as CylinderGeometry,cS as CylinderGeometryLibrary,A8 as CylinderGeometryUpdater,fC as CylinderGraphics,y8 as CylinderOutlineGeometry,P8 as CzmlDataSource,Fs as DataSource,Np as DataSourceClock,R8 as DataSourceCollection,Sj as DataSourceDisplay,vBe as DebugAppearance,n_ as DebugCameraPrimitive,Y5 as DebugInspector,y7 as DebugModelMatrixPrimitive,dFe as DefaultProxy,yc as DepthFunction,LG as DepthPlane,Sz as DequantizationPipelineStage,c0 as DerivedCommand,pe as DeveloperError,BG as DeviceOrientationCameraController,SBe as DirectionalLight,qD as DiscardEmptyTileImagePolicy,Lz as DiscardMissingTileImagePolicy,Gt as DistanceDisplayCondition,Qn as DistanceDisplayConditionGeometryInstanceAttribute,KA as DoubleEndedPriorityQueue,G4 as DoublyLinkedList,uy as DracoLoader,at as DrawCommand,xy as DynamicAtmosphereLightingType,Ty as DynamicEnvironmentMapManager,bS as DynamicGeometryBatch,Ri as DynamicGeometryUpdater,kN as EarthOrientationParameters,gb as EarthOrientationParametersSample,ks as EasingFunction,Iz as EdgeDetectionPipelineStage,Rh as EdgeDisplayMode,WG as EdgeFramebuffer,Rz as EdgeVisibilityPipelineStage,Fu as EllipseGeometry,Sf as EllipseGeometryLibrary,z8 as EllipseGeometryUpdater,dC as EllipseGraphics,jd as EllipseOutlineGeometry,ee as Ellipsoid,q_ as EllipsoidGeodesic,ac as EllipsoidGeometry,V8 as EllipsoidGeometryUpdater,hC as EllipsoidGraphics,Nd as EllipsoidOutlineGeometry,fG as EllipsoidPrimitive,jc as EllipsoidRhumbLine,wBe as EllipsoidSurfaceAppearance,qs as EllipsoidTangentPlane,Qg as EllipsoidTerrainProvider,Op as EllipsoidalOccluder,yg as Empty3DTileContent,Sn as EncodedCartesian3,Qr as Entity,kd as EntityCluster,rc as EntityCollection,Pj as EntityView,IBe as EquirectangularPanorama,be as Event,Qo as EventHelper,vh as Expression,Nt as ExpressionNodeType,Lu as ExtrapolationType,dn as FeatureDetection,hx as FeatureIdPipelineStage,kG as Fog,Ue as ForEach,v7 as FrameRateMonitor,Bx as FrameState,vs as Framebuffer,ci as FramebufferManager,H as Frozen,YG as FrustumCommands,Hw as FrustumGeometry,OG as FrustumOutlineGeometry,ss as Fullscreen,hW as FullscreenButton,fW as FullscreenButtonViewModel,Dx as GaussianSplat3DTileContent,D4 as GaussianSplatPrimitive,I4 as GaussianSplatRenderResources,kv as GaussianSplatSorter,w4 as GaussianSplatTextureGenerator,ST as GeoJsonDataSource,vU as GeoJsonLoader,LBe as GeoJsonPrimitive,nE as GeocodeType,KW as Geocoder,IM as GeocoderService,YW as GeocoderViewModel,ji as GeographicProjection,rr as GeographicTilingScheme,wt as Geometry,c3 as Geometry3DTileContent,Ne as GeometryAttribute,En as GeometryAttributes,pFe as GeometryFactory,Bt as GeometryInstance,Pl as GeometryInstanceAttribute,pn as GeometryOffsetAttribute,Wn as GeometryPipeline,Nz as GeometryPipelineStage,mh as GeometryType,Oi as GeometryUpdater,FS as GeometryUpdaterSet,dj as GeometryVisualizer,xp as GetFeatureInfoFormat,sG as Globe,XG as GlobeDepth,UH as GlobeSurfaceShaderSet,gm as GlobeSurfaceTile,$H as GlobeSurfaceTileProvider,JH as GlobeTranslucency,KG as GlobeTranslucencyFramebuffer,UG as GlobeTranslucencyState,lD as GltfBufferViewLoader,uD as GltfDracoLoader,mU as GltfGpmLoader,ND as GltfGpmLocal,dD as GltfImageLoader,hD as GltfIndexBufferLoader,pD as GltfJsonLoader,_d as GltfLoader,pf as GltfLoaderUtil,yU as GltfMeshPrimitiveGpmLoader,F3 as GltfSpzLoader,sU as GltfStructuralMetadataLoader,gD as GltfTextureLoader,_D as GltfVertexBufferLoader,$z as Google2DImageryProvider,BBe as GoogleEarthEnterpriseImageryProvider,Gz as GoogleEarthEnterpriseMapsProvider,tb as GoogleEarthEnterpriseMetadata,DM as GoogleEarthEnterpriseTerrainData,CFe as GoogleEarthEnterpriseTerrainProvider,J9 as GoogleEarthEnterpriseTileInformation,SFe as GoogleGeocoderService,Fa as GoogleMaps,kBe as GoogleStreetViewCubeMapPanoramaProvider,AH as GpxDataSource,Fm as GregorianDate,UBe as GridImageryProvider,Z1 as GridMaterialProperty,oi as GroundGeometryUpdater,sC as GroundPolylineGeometry,Qm as GroundPolylinePrimitive,pu as GroundPrimitive,D1 as GroupMetadata,om as HeadingPitchRange,kc as HeadingPitchRoll,MN as Heap,We as HeightReference,pm as HeightmapEncoding,ll as HeightmapTerrainData,IO as HeightmapTessellator,b8 as HermitePolynomialApproximation,ux as HermiteSpline,iD as HilbertOrder,gW as HomeButton,mW as HomeButtonViewModel,Hi as HorizontalOrigin,P2e as HybridScreenSpacePanCameraController,ske as I3SBuildingSceneLayerExplorer,TW as I3SBuildingSceneLayerExplorerViewModel,E0 as I3SDataProvider,S7 as I3SDecoder,w7 as I3SFeature,P7 as I3SField,zM as I3SGeometry,SI as I3SLayer,VM as I3SNode,N7 as I3SStatistics,L7 as I3SSublayer,O7 as I3SSymbology,DU as I3dmLoader,wU as I3dmParser,YBe as ITwinData,Ea as ITwinPlatform,cG as Iau2000Orientation,jN as Iau2006XysData,RE as Iau2006XysSample,lG as IauOrientationAxes,aG as IauOrientationParameters,CC as ImageBasedLighting,WU as ImageBasedLightingPipelineStage,kb as ImageMaterialProperty,JD as Imagery,JV as ImageryConfiguration,e1 as ImageryCoverage,eV as ImageryFlags,nV as ImageryInput,Ms as ImageryLayer,eS as ImageryLayerCollection,yp as ImageryLayerFeatureInfo,iV as ImageryPipelineStage,Ad as ImageryProvider,jn as ImageryState,xD as Implicit3DTileContent,rD as ImplicitAvailabilityBitstream,oD as ImplicitMetadataView,Xs as ImplicitSubdivisionScheme,py as ImplicitSubtree,d7 as ImplicitSubtreeCache,f3 as ImplicitSubtreeMetadata,vg as ImplicitTileCoordinates,Cg as ImplicitTileset,je as IndexDatatype,IW as InfoBox,SW as InfoBoxViewModel,qf as InspectorShared,Fo as InstanceAttributeSemantic,lz as InstancingPipelineStage,wFe as InterpolationAlgorithm,mp as InterpolationType,$t as Intersect,xi as IntersectionTests,y0 as Intersections2D,Gs as Interval,qO as InvertClassification,uf as Ion,ib as IonGeocodeProviderType,AI as IonGeocoderService,Du as IonImageryProvider,$D as IonImageryProviderFactory,Yo as IonResource,RFe as IonSnapGeometryType,MFe as IonSnapHeat,n7 as IonSnapMode,FFe as IonSnapParentGeometryType,UFe as IonSnapService,Dy as IonWorldImageryStyle,nt as Iso8601,VG as JobScheduler,Xc as JobType,Ey as JsonMetadataTable,K as JulianDate,iL as KTX2Transcoder,oo as KeyboardEventModifier,Gr as KeyframeNode,bH as KmlCamera,Mw as KmlDataSource,xH as KmlLookAt,EH as KmlTour,vH as KmlTourFlyTo,SH as KmlTourWait,vx as Label,hg as LabelCollection,tp as LabelGraphics,Io as LabelStyle,hj as LabelVisualizer,x8 as LagrangePolynomialApproximation,yr as LeapSecond,KBe as Light,ug as LightingModel,oV as LightingPipelineStage,jx as LinearApproximation,lx as LinearSpline,n2e as MVTDataProvider,bu as ManagedArray,Yu as MapMode2D,zFe as MapProjection,Wz as MapboxImageryProvider,JBe as MapboxStyleImageryProvider,tV as MappedPositions,ir as Material,Cr as MaterialAppearance,lV as MaterialPipelineStage,Co as MaterialProperty,P as Math,$i as Matrix2,$ as Matrix3,M as Matrix4,x9 as Megatexture,_U as MeshPrimitiveGpmLocal,dp as MetadataClass,Z0 as MetadataClassProperty,Ft as MetadataComponentType,Xn as MetadataEntity,z3 as MetadataEnum,k3 as MetadataEnumValue,HG as MetadataPicking,xd as MetadataPickingPipelineStage,Mh as MetadataPipelineStage,Eu as MetadataSchema,tx as MetadataSchemaLoader,Ph as MetadataSemantic,wh as MetadataTable,h3 as MetadataTableProperty,bt as MetadataType,yh as MipmapHint,Ed as Model,Cd as Model3DTileContent,wv as ModelAlphaOptions,LU as ModelAnimation,NU as ModelAnimationChannel,BU as ModelAnimationCollection,gf as ModelAnimationLoop,gp as ModelAnimationState,XU as ModelArticulation,qU as ModelArticulationStage,JU as ModelClippingPlanesPipelineStage,ez as ModelClippingPolygonsPipelineStage,dx as ModelColorPipelineStage,vn as ModelComponents,zV as ModelDrawCommand,HV as ModelDrawCommands,kU as ModelFeature,UU as ModelFeatureTable,K_ as ModelGraphics,ZV as ModelImagery,vv as ModelImageryMapping,FV as ModelLightingOptions,uz as ModelMatrixUpdateStage,rz as ModelNode,Sv as ModelPrimitiveImagery,Na as ModelReader,wV as ModelRenderResources,dz as ModelRuntimeNode,vV as ModelRuntimePrimitive,WV as ModelSceneGraph,RV as ModelSilhouettePipelineStage,SV as ModelSkin,NV as ModelSplitterPipelineStage,qV as ModelStatistics,Jo as ModelType,xt as ModelUtility,iz as ModelVectorLookupPipelineStage,mj as ModelVisualizer,mG as Moon,fV as MorphTargetsPipelineStage,VFe as MorphWeightSpline,kx as MortonOrder,hc as MouseButton,N4 as Multiple3DTileContent,o2 as MultisampleFramebuffer,vW as NavigationHelpButton,EW as NavigationHelpButtonViewModel,qt as NearFarScalar,i2e as NeverTileDiscardPolicy,LV as NodeRenderResources,fz as NodeStatisticsPipelineStage,mC as NodeTransformationProperty,$G as OIT,yG as Occluder,Er as OffsetGeometryInstanceAttribute,jFe as OpenCageGeocoderService,sb as OpenStreetMapImageryProvider,M8 as OrderedGroundPrimitiveCollection,en as OrientedBoundingBox,_n as OrthographicFrustum,Ss as OrthographicOffCenterFrustum,HFe as Packable,GFe as PackableForInterpolation,o2e as Panorama,s2e as PanoramaProvider,GM as Particle,l2e as ParticleBurst,f2e as ParticleEmitter,m2e as ParticleSystem,Ie as Pass,gc as PassState,$_ as PathGraphics,Og as PathMode,bj as PathVisualizer,t7 as PeliasGeocoderService,An as PerInstanceColorAppearance,zA as PerformanceDisplay,RW as PerformanceWatchdog,PW as PerformanceWatchdogViewModel,er as PerspectiveFrustum,Wu as PerspectiveOffCenterFrustum,GG as PickDepth,JG as PickDepthFramebuffer,ZG as PickFramebuffer,_L as PickId,S9 as PickedMetadataInfo,a5 as Picking,dV as PickingPipelineStage,wA as PinBuilder,ze as PixelDatatype,$e as PixelFormat,qG as PlanarFillIdFramebuffer,sn as Plane,G8 as PlaneGeometry,Y8 as PlaneGeometryUpdater,$k as PlaneGraphics,q8 as PlaneOutlineGeometry,XV as PntsLoader,Pv as PntsParser,B9 as PointCloud,vy as PointCloudEyeDomeLighting,ng as PointCloudShading,mV as PointCloudStylingPipelineStage,gC as PointGraphics,za as PointPrimitive,X1 as PointPrimitiveCollection,xj as PointVisualizer,tg as PolygonGeometry,ni as PolygonGeometryLibrary,J8 as PolygonGeometryUpdater,np as PolygonGraphics,Hc as PolygonHierarchy,$8 as PolygonOutlineGeometry,mi as PolygonPipeline,kh as Polyline,Q1 as PolylineArrowMaterialProperty,Sp as PolylineCollection,Ys as PolylineColorAppearance,eR as PolylineDashMaterialProperty,yA as PolylineGeometry,Ej as PolylineGeometryUpdater,tR as PolylineGlowMaterialProperty,Rl as PolylineGraphics,Ac as PolylineMaterialAppearance,Gx as PolylineOutlineMaterialProperty,lr as PolylinePipeline,vj as PolylineVisualizer,Z8 as PolylineVolumeGeometry,Dp as PolylineVolumeGeometryLibrary,ej as PolylineVolumeGeometryUpdater,_C as PolylineVolumeGraphics,Q8 as PolylineVolumeOutlineGeometry,ep as PositionProperty,iA as PositionPropertyArray,zr as PostProcessStage,w5 as PostProcessStageCollection,kf as PostProcessStageComposite,Qd as PostProcessStageLibrary,Zd as PostProcessStageSampleMode,$w as PostProcessStageTextureCache,gU as PpeMetadata,L2e as PpeSource,pU as PpeTexture,Mn as Primitive,ql as PrimitiveCollection,ev as PrimitiveLoadPlan,QC as PrimitiveOutlineGenerator,_V as PrimitiveOutlinePipelineStage,nC as PrimitivePipeline,BV as PrimitiveRenderResources,fs as PrimitiveState,yV as PrimitiveStatisticsPipelineStage,Oe as PrimitiveType,LW as ProjectionPicker,MW as ProjectionPickerViewModel,X as Property,nR as PropertyArray,JC as PropertyAttribute,iU as PropertyAttributeProperty,yu as PropertyBag,Su as PropertyTable,Cy as PropertyTexture,nU as PropertyTextureProperty,yo as ProviderViewModel,YFe as Proxy,cu as QuadraticRealPolynomial,ZH as QuadtreeOccluders,oG as QuadtreePrimitive,eG as QuadtreeTile,uc as QuadtreeTileLoadState,p2e as QuadtreeTileProvider,mI as QuantizedMeshTerrainData,sL as QuarticRealPolynomial,Le as Quaternion,MU as QuaternionSpline,rx as Queue,gn as Ray,ie as Rectangle,VS as RectangleCollisionChecker,OS as RectangleGeometry,Ua as RectangleGeometryLibrary,tj as RectangleGeometryUpdater,ip as RectangleGraphics,Gv as RectangleOutlineGeometry,Wi as ReferenceFrame,oA as ReferenceProperty,Ge as RenderState,rd as Renderbuffer,fu as RenderbufferFormat,Oo as Request,O0 as RequestErrorEvent,El as RequestScheduler,wi as RequestState,oa as RequestType,De as Resource,Bi as ResourceCache,Cu as ResourceCacheKey,j3 as ResourceCacheStatistics,ar as ResourceLoader,Ct as ResourceLoaderState,Kh as Rotation,oe as RuntimeError,cy as S2Cell,ec as SDFSettings,Cc as SampledPositionProperty,zd as SampledProperty,Ht as Sampler,Ug as ScaledPositionProperty,D9 as Scene,qw as SceneFramebuffer,re as SceneMode,AV as SceneMode2DPipelineStage,UW as SceneModePicker,BW as SceneModePickerViewModel,pr as SceneTransforms,D5 as SceneTransitioner,V5 as ScreenSpaceCameraController,W7 as ScreenSpaceElevatorCameraController,Ta as ScreenSpaceEventHandler,fn as ScreenSpaceEventType,v0 as ScreenSpaceInputBindings,q7 as ScreenSpaceMapCameraController,D2e as ScreenSpaceTiltOrbitCameraController,R2e as ScreenSpaceZoomCameraController,px as SelectedFeatureIdPipelineStage,HW as SelectionIndicator,VW as SelectionIndicatorViewModel,oR as SensorVolumePortionToDisplay,F_ as ShaderBuilder,QB as ShaderCache,de as ShaderDestination,c2 as ShaderFunction,Qt as ShaderProgram,Xe as ShaderSource,a2 as ShaderStruct,GA as ShadowMap,f0 as ShadowMapShader,Dn as ShadowMode,cd as ShadowVolumeAppearance,u2 as SharedContext,Pn as ShowGeometryInstanceAttribute,Pb as Simon1994PlanetaryPositions,XFe as SimplePolylineGeometry,qz as SingleTileImageryProvider,xV as SkinningPipelineStage,R9 as SkyAtmosphere,O9 as SkyBox,j5 as SnapFramebuffer,KFe as SnapService,H5 as Snapping,T9 as SpatialNode,hU as Spdcf,op as SpecularEnvironmentCubeMap,g2e as SphereEmitter,a7 as SphereGeometry,qy as SphereOutlineGeometry,T8 as Spherical,Or as Spline,Wo as SplitDirection,bM as Splitter,em as StaticGeometryColorBatch,nm as StaticGeometryPerMaterialBatch,TR as StaticGroundGeometryColorBatch,fj as StaticGroundGeometryPerMaterialBatch,Cj as StaticGroundPolylinePerMaterialBatch,ER as StaticOutlineGeometryBatch,Xt as StencilConstants,ti as StencilFunction,Rt as StencilOperation,OU as SteppedSpline,Ml as Stereographic,ax as StorageType,iR as StripeMaterialProperty,Lp as StripeOrientation,Qa as StructuralMetadata,_p as StyleCommandsNeeded,_2e as StyleExpression,M9 as Sun,N_ as SunLight,q5 as SunPostProcess,lU as SupportedImageFormats,X7 as SvgPathBindingHandler,f2 as Sync,$n as TaskProcessor,j7 as Terrain,Lf as TerrainData,Ro as TerrainEncoding,RO as TerrainFillMesh,Ic as TerrainMesh,bC as TerrainOffsetProperty,BH as TerrainPicker,Xr as TerrainProvider,lc as TerrainQuantization,Ur as TerrainState,Dt as Texture,d2 as Texture3D,XE as TextureAtlas,t2 as TextureCache,Jn as TextureMagnificationFilter,Z5 as TextureManager,Wt as TextureMinificationFilter,lP as TexturePacker,Q5 as TextureUniform,hn as TextureWrap,_0 as TileAvailability,Md as TileBoundingRegion,k4 as TileBoundingS2Cell,Yy as TileBoundingSphere,y2e as TileBoundingVolume,H7 as TileCoordinatesImageryProvider,A2e as TileDiscardPolicy,In as TileEdge,ZD as TileImagery,gx as TileMapServiceImageryProvider,O4 as TileMetadata,xf as TileOrientedBoundingBox,no as TileProviderError,nG as TileReplacementQueue,gi as TileSelectionResult,x2e as TileState,t4 as Tileset3DTileContent,j4 as TilesetMetadata,zU as TilesetPipelineStage,$Fe as TilingScheme,Un as TimeConstants,xv as TimeDynamicImagery,TM as TimeDynamicPointCloud,Cn as TimeInterval,Ls as TimeIntervalCollection,aA as TimeIntervalCollectionPositionProperty,cA as TimeIntervalCollectionProperty,ai as TimeStandard,qW as Timeline,GW as TimelineHighlightRange,WW as TimelineTrack,cL as Tipsify,uE as ToggleButtonViewModel,qA as Tonemapper,W_ as TrackingReferenceFrame,At as Transforms,zb as TranslationRotationScale,e5 as TranslucentTileClassification,UD as TridiagonalSystemSolver,VI as TrustedServers,Zw as TweenCollection,i2 as UniformState,l_ as UniformType,B7 as UrlTemplate3DTilesDataProvider,Rs as UrlTemplateImageryProvider,R9r as VERSION,QW as VRButton,JW as VRButtonViewModel,eBe as VRTheWorldTerrainProvider,M2e as VaryingType,X0 as Vector3DTileBatch,h4 as Vector3DTileClampedPolylines,p4 as Vector3DTileContent,ry as Vector3DTileGeometry,f4 as Vector3DTilePoints,d4 as Vector3DTilePolygons,Lv as Vector3DTilePolylines,wC as Vector3DTilePrimitive,Ix as VectorGltf3DTileContent,Ds as VectorPipeline,jy as VectorProvider,C8 as VelocityOrientationProperty,lA as VelocityVectorProperty,Vn as VertexArray,k_ as VertexArrayFacade,ct as VertexAttributeSemantic,Be as VertexFormat,br as VerticalExaggeration,EV as VerticalExaggerationPipelineStage,qn as VerticalOrigin,JFe as VideoSynchronizer,Xw as View,vke as Viewer,T2e as ViewportQuad,ns as Visibility,p1e as Visualizer,XA as VoxelBoundsCollection,iI as VoxelBoxShape,X5 as VoxelCell,nI as VoxelContent,rI as VoxelCylinderShape,oI as VoxelEllipsoidShape,nq as VoxelInspector,eq as VoxelInspectorViewModel,f_ as VoxelMetadataOrder,XT as VoxelPrimitive,E2e as VoxelProvider,g9 as VoxelRenderResources,C2e as VoxelShape,Dc as VoxelShapeType,C9 as VoxelTraversal,nBe as VulkanConstants,ij as WallGeometry,NS as WallGeometryLibrary,oj as WallGeometryUpdater,J_ as WallGraphics,rj as WallOutlineGeometry,te as WebGLConstants,Xz as WebMapServiceImageryProvider,Kz as WebMapTileServiceImageryProvider,Ti as WebMercatorProjection,Bo as WebMercatorTilingScheme,sa as WindingOrder,t1 as WireframeIndexGenerator,CV as WireframePipelineStage,c5 as _shadersAcesTonemappingStage,G5 as _shadersAdditiveBlend,uP as _shadersAdjustTranslucentFS,ck as _shadersAllMaterialAppearanceFS,lk as _shadersAllMaterialAppearanceVS,l5 as _shadersAmbientOcclusionGenerate,u5 as _shadersAmbientOcclusionModulate,mk as _shadersAspectRampMaterial,Xm as _shadersAtmosphereCommon,VU as _shadersAtmosphereStageFS,jU as _shadersAtmosphereStageVS,uk as _shadersBasicMaterialAppearanceFS,fk as _shadersBasicMaterialAppearanceVS,h2 as _shadersBillboardCollectionFS,m2 as _shadersBillboardCollectionVS,f5 as _shadersBlackAndWhite,d5 as _shadersBloomComposite,p2 as _shadersBrdfLutGeneratorFS,W5 as _shadersBrightPass,h5 as _shadersBrightness,g2 as _shadersBufferPointMaterialFS,_2 as _shadersBufferPointMaterialVS,y2 as _shadersBufferPolygonMaterialFS,A2 as _shadersBufferPolygonMaterialVS,b2 as _shadersBufferPolylineMaterialFS,x2 as _shadersBufferPolylineMaterialVS,pk as _shadersBumpMapMaterial,_z as _shadersCPUStylingStageFS,gz as _shadersCPUStylingStageVS,gk as _shadersCheckerboardMaterial,T2 as _shadersCloudCollectionFS,E2 as _shadersCloudCollectionVS,C2 as _shadersCloudNoiseFS,v2 as _shadersCloudNoiseVS,S2 as _shadersCompareAndPackTranslucentDepth,w2 as _shadersCompositeOITFS,Yw as _shadersCompositeTranslucentClassification,I2 as _shadersComputeIrradianceFS,P2 as _shadersComputeRadianceMapFS,cV as _shadersConstantLodStageFS,aV as _shadersConstantLodStageVS,m5 as _shadersContrastBias,D2 as _shadersConvolveSpecularMapFS,R2 as _shadersConvolveSpecularMapVS,O2 as _shadersCubeMapPanoramaVS,bz as _shadersCustomShaderStageFS,Az as _shadersCustomShaderStageVS,HE as _shadersCzmBuiltins,p5 as _shadersDepthOfField,M2 as _shadersDepthPlaneFS,N2 as _shadersDepthPlaneVS,g5 as _shadersDepthView,v2e as _shadersDepthViewPacked,_k as _shadersDotMaterial,_5 as _shadersEdgeDetection,wz as _shadersEdgeDetectionStageFS,Pz as _shadersEdgeVisibilityStageFS,Dz as _shadersEdgeVisibilityStageVS,yk as _shadersElevationBandMaterial,Ak as _shadersElevationContourMaterial,bk as _shadersElevationRampMaterial,fP as _shadersEllipsoidFS,E7 as _shadersEllipsoidSurfaceAppearanceFS,C7 as _shadersEllipsoidSurfaceAppearanceVS,dP as _shadersEllipsoidVS,b5 as _shadersFXAA,L2 as _shadersFXAA3_11,xk as _shadersFadeMaterial,xz as _shadersFeatureIdStageFS,Tz as _shadersFeatureIdStageVS,y5 as _shadersFilmicTonemapping,UT as _shadersGaussianBlur1D,Oz as _shadersGeometryStageFS,Mz as _shadersGeometryStageVS,F2 as _shadersGlobeFS,B2 as _shadersGlobeVS,Tk as _shadersGridMaterial,hP as _shadersGroundAtmosphere,ZF as _shadersHSBToRGB,QF as _shadersHSLToRGB,GU as _shadersImageBasedLightingStageFS,oz as _shadersInstancingStageCommon,sz as _shadersInstancingStageVS,c9 as _shadersIntersectBox,l9 as _shadersIntersectCylinder,s9 as _shadersIntersectDepth,u9 as _shadersIntersectEllipsoid,uM as _shadersIntersectLongitude,a9 as _shadersIntersectPlane,tI as _shadersIntersection,o9 as _shadersIntersectionUtils,az as _shadersLegacyInstancingStageVS,x5 as _shadersLensFlare,rV as _shadersLightingStageFS,sV as _shadersMaterialStageFS,p9 as _shadersMegatexture,Ez as _shadersMetadataStageFS,Cz as _shadersMetadataStageVS,$U as _shadersModelClippingPlanesStageFS,ZU as _shadersModelClippingPolygonsStageFS,QU as _shadersModelClippingPolygonsStageVS,KU as _shadersModelColorStageFS,jV as _shadersModelFS,IV as _shadersModelSilhouetteStageFS,PV as _shadersModelSilhouetteStageVS,OV as _shadersModelSplitterStageFS,VV as _shadersModelVS,nz as _shadersModelVectorLookupStageFS,tz as _shadersModelVectorLookupStageVS,T5 as _shadersModifiedReinhardTonemapping,uV as _shadersMorphTargetsStageVS,E5 as _shadersNightVision,Ek as _shadersNormalMapMaterial,m9 as _shadersOctree,Bf as _shadersPassThrough,FT as _shadersPassThroughDepth,A5 as _shadersPbrNeutralTonemapping,Mk as _shadersPerInstanceColorAppearanceFS,Nk as _shadersPerInstanceColorAppearanceVS,QE as _shadersPerInstanceFlatColorAppearanceFS,Lk as _shadersPerInstanceFlatColorAppearanceVS,xU as _shadersPointCloudEyeDomeLighting,hV as _shadersPointCloudStylingStageVS,Rb as _shadersPointPrimitiveCollectionFS,k2 as _shadersPointPrimitiveCollectionVS,Ck as _shadersPolylineArrowMaterial,Xk as _shadersPolylineColorAppearanceVS,du as _shadersPolylineCommon,vk as _shadersPolylineDashMaterial,KE as _shadersPolylineFS,Sk as _shadersPolylineGlowMaterial,Kk as _shadersPolylineMaterialAppearanceVS,wk as _shadersPolylineOutlineMaterial,U2 as _shadersPolylineShadowVolumeFS,z2 as _shadersPolylineShadowVolumeMorphFS,V2 as _shadersPolylineShadowVolumeMorphVS,j2 as _shadersPolylineShadowVolumeVS,H2 as _shadersPolylineVS,G2 as _shadersPrimitiveGaussianSplatFS,W2 as _shadersPrimitiveGaussianSplatVS,gV as _shadersPrimitiveOutlineStageFS,pV as _shadersPrimitiveOutlineStageVS,vB as _shadersRGBToHSB,SB as _shadersRGBToHSL,wB as _shadersRGBToXYZ,C5 as _shadersReinhardTonemapping,q2 as _shadersReprojectWebMercatorFS,Y2 as _shadersReprojectWebMercatorVS,Ik as _shadersRimLightingMaterial,jD as _shadersSelectedFeatureIdStageCommon,mP as _shadersShadowVolumeAppearanceFS,X2 as _shadersShadowVolumeAppearanceVS,Ob as _shadersShadowVolumeFS,v5 as _shadersSilhouette,bV as _shadersSkinningStageVS,pP as _shadersSkyAtmosphereCommon,K2 as _shadersSkyAtmosphereFS,$2 as _shadersSkyAtmosphereVS,J2 as _shadersSkyBoxFS,Z2 as _shadersSkyBoxVS,Pk as _shadersSlopeRampMaterial,Dk as _shadersStripeMaterial,Q2 as _shadersSunFS,ek as _shadersSunTextureFS,tk as _shadersSunVS,dk as _shadersTexturedMaterialAppearanceFS,hk as _shadersTexturedMaterialAppearanceVS,nk as _shadersVector3DTileClampedPolylinesFS,ik as _shadersVector3DTileClampedPolylinesVS,rk as _shadersVector3DTilePolylinesVS,U_ as _shadersVectorCommon,gP as _shadersVectorTileVS,TV as _shadersVerticalExaggerationStageVS,ok as _shadersViewportQuadFS,LE as _shadersViewportQuadVS,i9 as _shadersVoxelFS,n9 as _shadersVoxelUtils,r9 as _shadersVoxelVS,Ok as _shadersWater,Rk as _shadersWaterMaskMaterial,JB as _shadersXYZToRGB,mF as _shadersacesTonemapping,pF as _shadersalphaWeight,gF as _shadersantialias,_F as _shadersapplyHSBShift,yF as _shadersapproximateSphericalCoordinates,AF as _shadersapproximateTanh,bF as _shadersbackFacing,xF as _shadersbranchFreeTernary,TF as _shaderscascadeColor,EF as _shaderscascadeDistance,CF as _shaderscascadeMatrix,vF as _shaderscascadeWeights,SF as _shaderscolumbusViewMorph,wF as _shaderscomputeAtmosphereColor,IF as _shaderscomputeGroundAtmosphereScattering,PF as _shaderscomputePosition,DF as _shaderscomputeScattering,RF as _shaderscomputeTextureTransform,f9 as _shadersconvertLocalToBoxUv,d9 as _shadersconvertLocalToCylinderUv,h9 as _shadersconvertLocalToEllipsoidUv,OF as _shaderscosineAndSine,MF as _shadersdecodeRGB8,NF as _shadersdecompressTextureCoordinates,yL as _shadersdegreesPerRadian,LF as _shadersdepthClamp,AL as _shadersdepthRange,sF as _shadersdepthRangeStruct,FF as _shaderseastNorthUpToEyeCoordinates,BF as _shadersellipsoidContainsPoint,kF as _shadersellipsoidTextureCoordinates,bL as _shadersepsilon1,xL as _shadersepsilon2,TL as _shadersepsilon3,EL as _shadersepsilon4,CL as _shadersepsilon5,vL as _shadersepsilon6,SL as _shadersepsilon7,UF as _shadersequalsEpsilon,zF as _shaderseyeOffset,VF as _shaderseyeToCartographicDelta,jF as _shaderseyeToWindowCoordinates,HF as _shadersfastApproximateAtan,GF as _shadersfog,WF as _shadersgammaCorrect,qF as _shadersgeodeticSurfaceNormal,YF as _shadersgetDefaultMaterial,XF as _shadersgetDynamicAtmosphereLightDirection,KF as _shadersgetLambertDiffuse,$F as _shadersgetSpecular,JF as _shadersgetWaterNoise,eB as _shadershue,wL as _shadersinfinity,tB as _shadersinverseGamma,nB as _shadersisEmpty,iB as _shadersisFull,rB as _shaderslatitudeToWebMercatorFraction,sB as _shaderslineDistance,oB as _shaderslinearToSrgb,aB as _shadersluminance,aF as _shadersmaterial,cF as _shadersmaterialInput,cB as _shadersmaximumComponent,lB as _shadersmetersPerPixel,lF as _shadersmodelMaterial,uB as _shadersmodelToWindowCoordinates,uF as _shadersmodelVertexOutput,fB as _shadersmultiplyWithColorBalance,dB as _shadersnearFarScalar,hB as _shadersoctDecode,IL as _shadersoneOverPi,PL as _shadersoneOverTwoPi,mB as _shaderspackDepth,DL as _shaderspassCesium3DTile,RL as _shaderspassCesium3DTileClassification,OL as _shaderspassCesium3DTileClassificationIgnoreShow,ML as _shaderspassCesium3DTileEdges,NL as _shaderspassCesium3DTileEdgesDirect,LL as _shaderspassCesium3DTilePlanarFillId,FL as _shaderspassClassification,BL as _shaderspassCompute,kL as _shaderspassEnvironment,UL as _shaderspassGaussianSplats,zL as _shaderspassGlobe,VL as _shaderspassOpaque,jL as _shaderspassOverlay,HL as _shaderspassTerrainClassification,GL as _shaderspassTranslucent,WL as _shaderspassVoxels,pB as _shaderspbrLighting,gB as _shaderspbrNeutralTonemapping,_B as _shadersphong,qL as _shaderspi,YL as _shaderspiOverFour,XL as _shaderspiOverSix,KL as _shaderspiOverThree,$L as _shaderspiOverTwo,yB as _shadersplaneDistance,AB as _shaderspointAlongRay,JL as _shadersradiansPerDegree,fF as _shadersray,bB as _shadersrayEllipsoidIntersectionInterval,dF as _shadersraySegment,xB as _shadersraySphereIntersectionInterval,TB as _shadersreadDepth,EB as _shadersreadNonPerspective,CB as _shadersreverseLogDepth,IB as _shadersround,PB as _shaderssaturation,ZL as _shaderssceneMode2D,QL as _shaderssceneMode3D,eF as _shaderssceneModeColumbusView,tF as _shaderssceneModeMorphing,DB as _shadersshadowDepthCompare,hF as _shadersshadowParameters,RB as _shadersshadowVisibility,OB as _shaderssignNotZero,nF as _shaderssolarRadius,MB as _shaderssphericalHarmonics,NB as _shaderssrgbToLinear,LB as _shaderstangentToEyeSpaceMatrix,FB as _shaderstextureCube,iF as _shadersthreePiOver2,BB as _shaderstransformPlane,kB as _shaderstranslateRelativeToEye,UB as _shaderstranslucentPhong,zB as _shaderstranspose,rF as _shaderstwoPi,VB as _shadersunpackDepth,jB as _shadersunpackFloat,HB as _shadersunpackTexture,GB as _shadersunpackUint,WB as _shadersvalueTransform,qB as _shadersvertexLogDepth,oF as _shaderswebMercatorMaxLatitude,YB as _shaderswindowToEyeCoordinates,XB as _shaderswriteDepthClamp,KB as _shaderswriteLogDepth,$B as _shaderswriteNonPerspective,Zn as addAllToArray,C3 as addBuffer,p3 as addDefaults,x3 as addExtensionsRequired,Ih as addExtensionsUsed,Qb as addPipelineExtras,Ra as addToArray,wN as appendForwardSlash,Lr as arrayRemoveDuplicates,xue as assert,BE as barycentricCoordinates,Pr as binarySearch,Zt as buildModuleUrl,f7 as buildVectorGltfFromMVT,lM as buildVoxelCustomShader,_9 as buildVoxelDrawCommands,Ze as clone,Mt as combine,Lw as computeFlyToLocationForRectangle,Dv as createBillboardPointCallback,K5 as createColorRamp,On as createCommand,oW as createDefaultImageryProviderViewModels,sW as createDefaultTerrainProviderViewModels,bBe as createElevationBandMaterial,TBe as createGooglePhotorealistic3DTileset,Kn as createGuid,fo as createMaterialPropertyDescriptor,EBe as createOsmBuildingsAsync,me as createPropertyDescriptor,_u as createRawPropertyDescriptor,CBe as createTangentSpaceDebugPrimitive,F2e as createTaskProcessorWorker,JN as createUniform,ZN as createUniformArray,E4 as createVectorTileBuffersFromModelComponents,X9 as createWorldBathymetryAsync,Ry as createWorldImageryAsync,_I as createWorldTerrainAsync,K9 as decodeGoogleEarthEnterpriseData,T7 as decodeMVT,m4 as decodeVectorPolylinePositions,C0 as defaultPickWorldPosition,tf as defer,l as defined,ZB as demodernizeShader,Yr as deprecationWarning,le as destroyObject,vPe as exportKml,OC as findAccessorMinMax,zv as findContentMetadata,Vv as findGroupMetadata,Kb as findMeshoptExtension,M4 as findTileMetadata,mD as forEachTextureInMaterial,cg as formatError,ule as freezeRenderState,fh as getAbsoluteUri,mf as getAccessorByteStride,IN as getBaseUri,Eh as getBinaryAccessor,N9 as getClipAndStyleCode,Bw as getClippingFunction,dy as getComponentReader,kn as getElement,S_ as getExtensionFromUri,nA as getFilenameFromUri,$5 as getImageFromTypedArray,Bm as getImagePixels,No as getJsonFromTypedArray,cp as getMagic,AU as getMeshPrimitives,v9 as getMetadataClassProperty,w9 as getMetadataProperty,ff as getStringFromTypedArray,xn as getTimestamp,sr as hasExtension,Z_ as heightReferenceOnEntityPropertyChanged,Zl as isBitSet,vE as isBlobUri,_b as isCrossOriginUrl,Um as isDataUri,ou as isLeapYear,Se as knockout,DI as knockout_3_5_1,Y7 as knockout_es5,SE as loadAndExecuteScript,s2 as loadCubeMap,fy as loadImageFromTypedArray,nf as loadKTX2,t_ as mergeSort,Km as mostDetailedSurfaceHeight,b3 as moveTechniqueRenderStates,T3 as moveTechniquesToExtension,ud as numberOfComponentsForType,wE as objectToQuery,yt as oneTimeWarning,Sy as parseBatchTable,oU as parseFeatureMetadataLegacy,RC as parseGlb,DN as parseResponseHeaders,rU as parseStructuralMetadata,o1 as pickModel,WFe as pointInsideTriangle,H_ as positionForSurfaceHeight,Hy as preprocess3DTileContent,t9 as processVoxelProperties,Zf as queryToObject,v3 as readAccessorPacked,MC as removeExtension,_3 as removeExtensionsRequired,DC as removeExtensionsUsed,A3 as removePipelineExtras,E3 as removeUnusedElements,_4 as renderBufferPointCollection,Q3 as renderBufferPolygonCollection,A4 as renderBufferPolylineCollection,ex as resizeImageToNextPowerOfTwo,MH as sampleTerrain,Nw as sampleTerrainMostDetailed,xE as scaleToGeodeticSurface,TI as srgbToLinear,Uk as subdivideArray,Oc as subscribeAndEvaluate,w3 as updateAccessorComponentTypes,P3 as updateVersion,Ko as usesExtension,Ske as viewerCesium3DTilesInspectorMixin,wke as viewerCesiumInspectorMixin,Pke as viewerDragDropMixin,Dke as viewerPerformanceWatchdogMixin,Oke as viewerVoxelInspectorMixin,iBe as webGLConstantToGlslType,l7 as wrapFunction,Ov as writeTextToCanvas}; +`);n.value=n.value.slice(0,i)+f+n.value.slice(r),n.selectionStart=i!==r?i:o,n.selectionEnd=o}else t.ctrlKey&&(t.keyCode===10||t.keyCode===13)&&this.compileShader();return!0};ah.prototype.isDestroyed=function(){return!1};ah.prototype.destroy=function(){let e=this;return this._definedProperties.forEach(function(t){Se.getObservable(e,t).dispose()}),le(this)};var eq=ah;function tq(e,t){e=kn(e);let n=document.createElement("div"),i=new eq(t);this._viewModel=i,this._container=e,this._element=n;let r=document.createElement("div");r.textContent="Voxel Inspector",r.className="cesium-cesiumInspector-button",r.setAttribute("data-bind","click: toggleInspector"),n.appendChild(r),n.className="cesium-cesiumInspector cesium-VoxelInspector",n.setAttribute("data-bind",'css: { "cesium-cesiumInspector-visible" : inspectorVisible, "cesium-cesiumInspector-hidden" : !inspectorVisible}'),e.appendChild(n);let o=document.createElement("div");o.className="cesium-cesiumInspector-dropDown",n.appendChild(o);let{createSection:s,createCheckbox:a,createRangeInput:c,createButton:u}=Wf,f=s(o,"Display","displayVisible","toggleDisplay"),d=s(o,"Transform","transformVisible","toggleTransform"),p=s(o,"Clipping","clippingVisible","toggleClipping"),g=s(o,"Shader","shaderVisible","toggleShader");f.appendChild(a("Depth Test","depthTest")),f.appendChild(a("Show","show")),f.appendChild(a("Disable Update","disableUpdate")),f.appendChild(a("Debug Draw","debugDraw")),f.appendChild(a("Jitter","jitter")),f.appendChild(a("Nearest Sampling","nearestSampling")),f.appendChild(c("Screen Space Error","screenSpaceError",0,128)),f.appendChild(c("Step Size","stepSize",0,2));let m=10,y=10,A=P.PI;d.appendChild(c("Translation X","translationX",-m,+m)),d.appendChild(c("Translation Y","translationY",-m,+m)),d.appendChild(c("Translation Z","translationZ",-m,+m)),d.appendChild(c("Scale X","scaleX",0,+y)),d.appendChild(c("Scale Y","scaleY",0,+y)),d.appendChild(c("Scale Z","scaleZ",0,+y)),d.appendChild(c("Heading","angleX",-A,+A)),d.appendChild(c("Pitch","angleY",-A,+A)),d.appendChild(c("Roll","angleZ",-A,+A)),Hae("Max X","Min X","Max Y","Min Y","Max Z","Min Z","clippingBoxMaxX","clippingBoxMinX","clippingBoxMaxY","clippingBoxMinY","clippingBoxMaxZ","clippingBoxMinZ","shapeIsBox",p),Hae("Max Longitude","Min Longitude","Max Latitude","Min Latitude","Max Height","Min Height","clippingEllipsoidMaxLongitude","clippingEllipsoidMinLongitude","clippingEllipsoidMaxLatitude","clippingEllipsoidMinLatitude","clippingEllipsoidMaxHeight","clippingEllipsoidMinHeight","shapeIsEllipsoid",p),Hae("Max Radius","Min Radius","Max Angle","Min Angle","Max Height","Min Height","clippingCylinderMaxRadius","clippingCylinderMinRadius","clippingCylinderMaxAngle","clippingCylinderMinAngle","clippingCylinderMaxHeight","clippingCylinderMinHeight","shapeIsCylinder",p);let b=document.createElement("div");g.appendChild(b);let x=document.createElement("textarea");x.setAttribute("data-bind","textInput: shaderString, event: { keydown: shaderEditorKeyPress }"),b.className="cesium-cesiumInspector-styleEditor",b.appendChild(x);let T=u("Compile (Ctrl+Enter)","compileShader");b.appendChild(T);let E=document.createElement("label");E.style.display="block",E.setAttribute("data-bind","text: shaderCompilationMessage, style: {color: shaderCompilationSuccess ? 'green' : 'red'}"),b.appendChild(E),Se.applyBindings(i,n)}Object.defineProperties(tq.prototype,{container:{get:function(){return this._container}},viewModel:{get:function(){return this._viewModel}}});tq.prototype.isDestroyed=function(){return!1};tq.prototype.destroy=function(){return Se.cleanNode(this._element),this._container.removeChild(this._element),this.viewModel.destroy(),le(this)};function Hae(e,t,n,i,r,o,s,a,c,u,f,d,p,g){let m=Wf.createRangeInputWithDynamicMinMax,y=g.appendChild(document.createElement("div"));y.setAttribute("data-bind",`if: ${p}`),y.appendChild(m(e,s)),y.appendChild(m(t,a)),y.appendChild(m(n,c)),y.appendChild(m(i,u)),y.appendChild(m(r,f)),y.appendChild(m(o,d))}var nq=tq;function yGt(e){let t=document.createElement("div");t.className="cesium-viewer-voxelInspectorContainer",e.container.appendChild(t);let n=new nq(t,e.scene);Object.defineProperties(e,{voxelInspector:{get:function(){return n}}})}var Mke=yGt;globalThis.CESIUM_VERSION="1.145.0";var O9r="1.145.0";export{cg as AlphaMode,cV as AlphaPipelineStage,oz as AnchorPointDirect,sz as AnchorPointIndirect,eW as Animation,tW as AnimationViewModel,Rr as Appearance,Ni as ApproximateTerrainHeights,BLe as ArcGISTiledElevationTerrainProvider,Pp as ArcGisBaseMapType,Dy as ArcGisMapServerImageryProvider,Id as ArcGisMapService,ln as ArcType,zl as ArticulationStageType,zt as AssociativeArray,Av as Atmosphere,kz as AtmospherePipelineStage,cn as AttributeCompression,Vt as AttributeType,dH as AutoExposure,T_ as AutomaticUniforms,qi as Axis,rd as AxisAlignedBoundingBox,YV as Azure2DImageryProvider,yz as B3dmLoader,_z as B3dmParser,fW as BaseLayerPicker,lW as BaseLayerPickerViewModel,eC as BatchTable,Uv as BatchTableHierarchy,Pu as BatchTexture,lV as BatchTexturePipelineStage,Fr as Billboard,ud as BillboardCollection,Ol as BillboardGraphics,Xs as BillboardLoadState,Y_ as BillboardTexture,qk as BillboardVisualizer,ULe as BingMapsGeocoderService,NV as BingMapsImageryProvider,m1 as BingMapsStyle,jc as BlendEquation,Zr as BlendFunction,Bi as BlendOption,nn as BlendingState,et as BoundingRectangle,ue as BoundingSphere,Pt as BoundingSphereState,Fx as BoundingVolumeSemantics,sBe as BoxEmitter,zc as BoxGeometry,u3 as BoxGeometryUpdater,cC as BoxGraphics,cp as BoxOutlineGeometry,o6 as BrdfLutGenerator,tt as Buffer,vv as BufferLoader,il as BufferPoint,vf as BufferPointCollection,Bp as BufferPointMaterial,Lo as BufferPolygon,tc as BufferPolygonCollection,Ed as BufferPolygonMaterial,Oa as BufferPolyline,Hl as BufferPolylineCollection,Cd as BufferPolylineMaterial,ms as BufferPrimitive,da as BufferPrimitiveCollection,Cu as BufferPrimitiveMaterial,Me as BufferUsage,hV as CPUStylingPipelineStage,nj as CallbackPositionProperty,lp as CallbackProperty,Nr as Camera,_H as CameraEventAggregator,fr as CameraEventType,s6 as CameraFlightPath,U as Cartesian2,h as Cartesian3,se as Cartesian4,E1 as CartesianRectangle,he as Cartographic,zLe as CartographicGeocoderService,jLe as CatmullRomSpline,dS as Cesium3DContentGroup,nm as Cesium3DTile,vp as Cesium3DTileBatchTable,yf as Cesium3DTileColorBlendMode,cBe as Cesium3DTileContent,CS as Cesium3DTileContentFactory,Mr as Cesium3DTileContentState,za as Cesium3DTileContentType,ma as Cesium3DTileFeature,Cp as Cesium3DTileFeatureTable,tm as Cesium3DTileOptimizationHint,j8 as Cesium3DTileOptimizations,po as Cesium3DTilePass,lm as Cesium3DTilePassState,Wy as Cesium3DTilePointFeature,Io as Cesium3DTileRefine,Ky as Cesium3DTileStyle,Y8 as Cesium3DTileStyleEngine,TS as Cesium3DTileVectorFeature,oW as Cesium3DTilesInspector,iW as Cesium3DTilesInspectorViewModel,q9 as Cesium3DTilesTerrainData,wM as Cesium3DTilesTerrainGeometryProcessor,tFe as Cesium3DTilesTerrainProvider,uBe as Cesium3DTilesVoxelProvider,ts as Cesium3DTileset,K8 as Cesium3DTilesetBaseTraversal,G8 as Cesium3DTilesetCache,pC as Cesium3DTilesetGraphics,q8 as Cesium3DTilesetHeatmap,MS as Cesium3DTilesetMetadata,X8 as Cesium3DTilesetMostDetailedTraversal,J8 as Cesium3DTilesetSkipTraversal,Up as Cesium3DTilesetStatistics,ac as Cesium3DTilesetTraversal,tj as Cesium3DTilesetVisualizer,cW as CesiumInspector,sW as CesiumInspectorViewModel,pI as CesiumTerrainProvider,CG as CesiumWidget,qr as Check,gO as CheckerboardMaterialProperty,p7 as CircleEmitter,uFe as CircleGeometry,fFe as CircleOutlineGeometry,N4 as ClassificationModelDrawCommand,uV as ClassificationPipelineStage,wP as ClassificationPrimitive,Qn as ClassificationType,fi as ClearCommand,fa as ClippingPlane,Ds as ClippingPlaneCollection,ND as ClippingPolygon,$c as ClippingPolygonCollection,Km as Clock,ws as ClockRange,jr as ClockStep,K7 as ClockViewModel,_Be as CloudCollection,NM as CloudType,z as Color,Ul as ColorBlendMode,Jt as ColorGeometryInstanceAttribute,Kt as ColorMaterialProperty,H2e as Command,Y as ComponentDatatype,Z4 as Composite3DTileContent,UDe as CompositeEntityCollection,_O as CompositeMaterialProperty,Ec as CompositePositionProperty,Wl as CompositeProperty,nL as CompressedTextureBuffer,$f as ComputeCommand,tL as ComputeEngine,T8 as ConditionsExpression,yBe as ConeEmitter,gu as ConstantPositionProperty,hi as ConstantProperty,Sz as ConstantSpline,M8 as ContentMetadata,qE as Context,Ut as ContextLimits,w2e as Controller,m6 as ControllerHost,W3 as CoplanarPolygonGeometry,ay as CoplanarPolygonGeometryLibrary,Ph as CoplanarPolygonOutlineGeometry,sr as CornerType,az as CorrelationGroup,DC as CorridorGeometry,gr as CorridorGeometryLibrary,T3 as CorridorGeometryUpdater,uC as CorridorGraphics,x3 as CorridorOutlineGeometry,It as Credit,g6 as CreditDisplay,ls as CubeMap,gL as CubeMapFace,pw as CubeMapPanorama,kE as CubicRealPolynomial,Hi as CullFace,aa as CullingVolume,oh as CumulusCloud,n3 as CustomDataSource,dFe as CustomHeightmapTerrainProvider,$g as CustomShader,Py as CustomShaderMode,bV as CustomShaderPipelineStage,Sx as CustomShaderTranslucencyMode,E3 as CylinderGeometry,OC as CylinderGeometryLibrary,v3 as CylinderGeometryUpdater,fC as CylinderGraphics,C3 as CylinderOutlineGeometry,LG as CzmlDataSource,Ps as DataSource,t0 as DataSourceClock,ak as DataSourceCollection,pj as DataSourceDisplay,wBe as DebugAppearance,jg as DebugCameraPrimitive,MH as DebugInspector,b7 as DebugModelMatrixPrimitive,mFe as DefaultProxy,Ac as DepthFunction,x6 as DepthPlane,xV as DequantizationPipelineStage,qp as DerivedCommand,pe as DeveloperError,E6 as DeviceOrientationCameraController,IBe as DirectionalLight,g1 as DiscardEmptyTileImagePolicy,RV as DiscardMissingTileImagePolicy,Gt as DistanceDisplayCondition,ti as DistanceDisplayConditionGeometryInstanceAttribute,SA as DoubleEndedPriorityQueue,H8 as DoublyLinkedList,Ey as DracoLoader,at as DrawCommand,my as DynamicAtmosphereLightingType,py as DynamicEnvironmentMapManager,AC as DynamicGeometryBatch,Oi as DynamicGeometryUpdater,kN as EarthOrientationParameters,gb as EarthOrientationParametersSample,ks as EasingFunction,EV as EdgeDetectionPipelineStage,kh as EdgeDisplayMode,R6 as EdgeFramebuffer,SV as EdgeVisibilityPipelineStage,xu as EllipseGeometry,uf as EllipseGeometryLibrary,O3 as EllipseGeometryUpdater,dC as EllipseGraphics,gd as EllipseOutlineGeometry,ee as Ellipsoid,z_ as EllipsoidGeodesic,Qa as EllipsoidGeometry,L3 as EllipsoidGeometryUpdater,hC as EllipsoidGraphics,_d as EllipsoidOutlineGeometry,Jj as EllipsoidPrimitive,Vc as EllipsoidRhumbLine,PBe as EllipsoidSurfaceAppearance,Ys as EllipsoidTangentPlane,Ug as EllipsoidTerrainProvider,tp as EllipsoidalOccluder,wg as Empty3DTileContent,Sn as EncodedCartesian3,Qr as Entity,dd as EntityCluster,Ja as EntityCollection,yj as EntityView,DBe as EquirectangularPanorama,be as Event,Wo as EventHelper,Yh as Expression,Nt as ExpressionNodeType,Bu as ExtrapolationType,dn as FeatureDetection,vx as FeatureIdPipelineStage,C6 as Fog,Ue as ForEach,v7 as FrameRateMonitor,Yx as FrameState,vs as Framebuffer,ci as FramebufferManager,H as Frozen,M6 as FrustumCommands,JS as FrustumGeometry,y6 as FrustumOutlineGeometry,ss as Fullscreen,EW as FullscreenButton,xW as FullscreenButtonViewModel,Vx as GaussianSplat3DTileContent,O8 as GaussianSplatPrimitive,D8 as GaussianSplatRenderResources,ES as GaussianSplatSorter,P8 as GaussianSplatTextureGenerator,JT as GeoJsonDataSource,bz as GeoJsonLoader,BBe as GeoJsonPrimitive,nE as GeocodeType,gW as Geocoder,IM as GeocoderService,mW as GeocoderViewModel,ji as GeographicProjection,ir as GeographicTilingScheme,wt as Geometry,o8 as Geometry3DTileContent,Ne as GeometryAttribute,En as GeometryAttributes,_Fe as GeometryFactory,Bt as GeometryInstance,Pl as GeometryInstanceAttribute,pn as GeometryOffsetAttribute,Wn as GeometryPipeline,PV as GeometryPipelineStage,mh as GeometryType,Mi as GeometryUpdater,iv as GeometryUpdaterSet,fU as GeometryVisualizer,Rp as GetFeatureInfoFormat,qj as Globe,N6 as GlobeDepth,vj as GlobeSurfaceShaderSet,sm as GlobeSurfaceTile,Fj as GlobeSurfaceTileProvider,Bj as GlobeTranslucency,L6 as GlobeTranslucencyFramebuffer,v6 as GlobeTranslucencyState,WD as GltfBufferViewLoader,qD as GltfDracoLoader,lz as GltfGpmLoader,i1 as GltfGpmLocal,XD as GltfImageLoader,KD as GltfIndexBufferLoader,JD as GltfJsonLoader,wd as GltfLoader,gf as GltfLoaderUtil,hz as GltfMeshPrimitiveGpmLoader,XU as GltfSpzLoader,tz as GltfStructuralMetadataLoader,ZD as GltfTextureLoader,QD as GltfVertexBufferLoader,qV as Google2DImageryProvider,UBe as GoogleEarthEnterpriseImageryProvider,zV as GoogleEarthEnterpriseMapsProvider,tb as GoogleEarthEnterpriseMetadata,DM as GoogleEarthEnterpriseTerrainData,SFe as GoogleEarthEnterpriseTerrainProvider,Q9 as GoogleEarthEnterpriseTileInformation,IFe as GoogleGeocoderService,Ba as GoogleMaps,zBe as GoogleStreetViewCubeMapPanoramaProvider,v9 as GpxDataSource,Fm as GregorianDate,VBe as GridImageryProvider,yO as GridMaterialProperty,oi as GroundGeometryUpdater,JE as GroundPolylineGeometry,$m as GroundPolylinePrimitive,pu as GroundPrimitive,eR as GroupMetadata,xh as HeadingPitchRange,kc as HeadingPitchRoll,MN as Heap,We as HeightReference,om as HeightmapEncoding,sl as HeightmapTerrainData,AR as HeightmapTessellator,wG as HermitePolynomialApproximation,Tx as HermiteSpline,N1 as HilbertOrder,AW as HomeButton,_W as HomeButtonViewModel,Gi as HorizontalOrigin,D2e as HybridScreenSpacePanCameraController,hke as I3SBuildingSceneLayerExplorer,vW as I3SBuildingSceneLayerExplorerViewModel,E0 as I3SDataProvider,S7 as I3SDecoder,w7 as I3SFeature,P7 as I3SField,zM as I3SGeometry,SI as I3SLayer,VM as I3SNode,N7 as I3SStatistics,L7 as I3SSublayer,O7 as I3SSymbology,vz as I3dmLoader,Tz as I3dmParser,KBe as ITwinData,Ea as ITwinPlatform,Xj as Iau2000Orientation,jN as Iau2006XysData,RE as Iau2006XysSample,Kj as IauOrientationAxes,Yj as IauOrientationParameters,Fv as ImageBasedLighting,zz as ImageBasedLightingPipelineStage,jb as ImageMaterialProperty,x1 as Imagery,Y4 as ImageryConfiguration,C1 as ImageryCoverage,$V as ImageryFlags,ZV as ImageryInput,Ns as ImageryLayer,LS as ImageryLayerCollection,Ip as ImageryLayerFeatureInfo,QV as ImageryPipelineStage,Pd as ImageryProvider,jn as ImageryState,k1 as Implicit3DTileContent,L1 as ImplicitAvailabilityBitstream,F1 as ImplicitMetadataView,$s as ImplicitSubdivisionScheme,Hy as ImplicitSubtree,m7 as ImplicitSubtreeCache,c8 as ImplicitSubtreeMetadata,Mg as ImplicitTileCoordinates,Og as ImplicitTileset,je as IndexDatatype,IW as InfoBox,SW as InfoBoxViewModel,Wf as InspectorShared,Bo as InstanceAttributeSemantic,rV as InstancingPipelineStage,PFe as InterpolationAlgorithm,_p as InterpolationType,$t as Intersect,xi as IntersectionTests,y0 as Intersections2D,Gs as Interval,kR as InvertClassification,bf as Ion,ib as IonGeocodeProviderType,AI as IonGeocoderService,Ou as IonImageryProvider,b1 as IonImageryProviderFactory,es as IonResource,MFe as IonSnapGeometryType,LFe as IonSnapHeat,r7 as IonSnapMode,kFe as IonSnapParentGeometryType,VFe as IonSnapService,Ry as IonWorldImageryStyle,it as Iso8601,w6 as JobScheduler,Zc as JobType,_y as JsonMetadataTable,K as JulianDate,iL as KTX2Transcoder,oo as KeyboardEventModifier,Gr as KeyframeNode,S9 as KmlCamera,lI as KmlDataSource,w9 as KmlLookAt,P9 as KmlTour,R9 as KmlTourFlyTo,O9 as KmlTourWait,zb as Label,K0 as LabelCollection,rp as LabelGraphics,Co as LabelStyle,dU as LabelVisualizer,IG as LagrangePolynomialApproximation,yr as LeapSecond,JBe as Light,_g as LightingModel,t4 as LightingPipelineStage,Zx as LinearApproximation,xx as LinearSpline,r2e as MVTDataProvider,Nu as ManagedArray,Vu as MapMode2D,jFe as MapProjection,VV as MapboxImageryProvider,QBe as MapboxStyleImageryProvider,JV as MappedPositions,rr as Material,Cr as MaterialAppearance,o4 as MaterialPipelineStage,So as MaterialProperty,P as Math,$i as Matrix2,$ as Matrix3,M as Matrix4,aG as Megatexture,dz as MeshPrimitiveGpmLocal,Tp as MetadataClass,lg as MetadataClassProperty,Lt as MetadataComponentType,Xn as MetadataEntity,ZU as MetadataEnum,$U as MetadataEnumValue,P6 as MetadataPicking,Rd as MetadataPickingPipelineStage,Gh as MetadataPipelineStage,Su as MetadataSchema,gx as MetadataSchemaLoader,Xh as MetadataSemantic,zh as MetadataTable,IU as MetadataTableProperty,bt as MetadataType,yh as MipmapHint,Md as Model,Nd as Model3DTileContent,lS as ModelAlphaOptions,Dz as ModelAnimation,Pz as ModelAnimationChannel,Oz as ModelAnimationCollection,Af as ModelAnimationLoop,Sp as ModelAnimationState,Hz as ModelArticulation,Vz as ModelArticulationStage,qz as ModelClippingPlanesPipelineStage,Kz as ModelClippingPolygonsPipelineStage,Cx as ModelColorPipelineStage,vn as ModelComponents,F4 as ModelDrawCommand,U4 as ModelDrawCommands,Mz as ModelFeature,Nz as ModelFeatureTable,J_ as ModelGraphics,X4 as ModelImagery,aS as ModelImageryMapping,O4 as ModelLightingOptions,oV as ModelMatrixUpdateStage,Qz as ModelNode,cS as ModelPrimitiveImagery,La as ModelReader,E4 as ModelRenderResources,aV as ModelRuntimeNode,x4 as ModelRuntimePrimitive,V4 as ModelSceneGraph,w4 as ModelSilhouettePipelineStage,T4 as ModelSkin,D4 as ModelSplitterPipelineStage,j4 as ModelStatistics,Qo as ModelType,xt as ModelUtility,Zz as ModelVectorLookupPipelineStage,J4 as ModelVisualizer,e6 as Moon,a4 as MorphTargetsPipelineStage,HFe as MorphWeightSpline,Xx as MortonOrder,hc as MouseButton,F8 as Multiple3DTileContent,o2 as MultisampleFramebuffer,RW as NavigationHelpButton,PW as NavigationHelpButtonViewModel,qt as NearFarScalar,o2e as NeverTileDiscardPolicy,R4 as NodeRenderResources,sV as NodeStatisticsPipelineStage,mC as NodeTransformationProperty,F6 as OIT,r6 as Occluder,Er as OffsetGeometryInstanceAttribute,GFe as OpenCageGeocoderService,sb as OpenStreetMapImageryProvider,Wk as OrderedGroundPrimitiveCollection,en as OrientedBoundingBox,_n as OrthographicFrustum,Ss as OrthographicOffCenterFrustum,WFe as Packable,qFe as PackableForInterpolation,a2e as Panorama,c2e as PanoramaProvider,GM as Particle,f2e as ParticleBurst,h2e as ParticleEmitter,g2e as ParticleSystem,Ie as Pass,gc as PassState,Z_ as PathGraphics,Fg as PathMode,lj as PathVisualizer,i7 as PeliasGeocoderService,An as PerInstanceColorAppearance,_A as PerformanceDisplay,NW as PerformanceWatchdog,OW as PerformanceWatchdogViewModel,Ji as PerspectiveFrustum,Uu as PerspectiveOffCenterFrustum,D6 as PickDepth,B6 as PickDepthFramebuffer,k6 as PickFramebuffer,_L as PickId,dG as PickedMetadataInfo,Y6 as Picking,c4 as PickingPipelineStage,GA as PinBuilder,ze as PixelDatatype,$e as PixelFormat,O6 as PlanarFillIdFramebuffer,sn as Plane,k3 as PlaneGeometry,V3 as PlaneGeometryUpdater,t3 as PlaneGraphics,z3 as PlaneOutlineGeometry,G4 as PntsLoader,fS as PntsParser,EG as PointCloud,vy as PointCloudEyeDomeLighting,ug as PointCloudShading,u4 as PointCloudStylingPipelineStage,gC as PointGraphics,Ia as PointPrimitive,NP as PointPrimitiveCollection,uj as PointVisualizer,og as PolygonGeometry,ni as PolygonGeometryLibrary,K3 as PolygonGeometryUpdater,op as PolygonGraphics,Wc as PolygonHierarchy,X3 as PolygonOutlineGeometry,mi as PolygonPipeline,$h as Polyline,AO as PolylineArrowMaterialProperty,Fp as PolylineCollection,qs as PolylineColorAppearance,bO as PolylineDashMaterialProperty,uA as PolylineGeometry,dj as PolylineGeometryUpdater,xO as PolylineGlowMaterialProperty,Ml as PolylineGraphics,yc as PolylineMaterialAppearance,wT as PolylineOutlineMaterialProperty,ar as PolylinePipeline,mj as PolylineVisualizer,$3 as PolylineVolumeGeometry,up as PolylineVolumeGeometryLibrary,Z3 as PolylineVolumeGeometryUpdater,_C as PolylineVolumeGraphics,J3 as PolylineVolumeOutlineGeometry,ip as PositionProperty,OA as PositionPropertyArray,Ur as PostProcessStage,hH as PostProcessStageCollection,Df as PostProcessStageComposite,Xd as PostProcessStageLibrary,Yd as PostProcessStageSampleMode,rw as PostProcessStageTextureCache,fz as PpeMetadata,F2e as PpeSource,uz as PpeTexture,Mn as Primitive,Rl as PrimitiveCollection,Nv as PrimitiveLoadPlan,Mv as PrimitiveOutlineGenerator,h4 as PrimitiveOutlinePipelineStage,tC as PrimitivePipeline,M4 as PrimitiveRenderResources,us as PrimitiveState,m4 as PrimitiveStatisticsPipelineStage,Oe as PrimitiveType,kW as ProjectionPicker,FW as ProjectionPickerViewModel,X as Property,TO as PropertyArray,Ev as PropertyAttribute,SU as PropertyAttributeProperty,yu as PropertyBag,vu as PropertyTable,by as PropertyTexture,vU as PropertyTextureProperty,yo as ProviderViewModel,KFe as Proxy,cu as QuadraticRealPolynomial,kj as QuadtreeOccluders,Wj as QuadtreePrimitive,zj as QuadtreeTile,lc as QuadtreeTileLoadState,_2e as QuadtreeTileProvider,mI as QuantizedMeshTerrainData,sL as QuarticRealPolynomial,Le as Quaternion,Iz as QuaternionSpline,Zb as Queue,gn as Ray,ie as Rectangle,cv as RectangleCollisionChecker,$C as RectangleGeometry,Da as RectangleGeometryLibrary,eU as RectangleGeometryUpdater,sp as RectangleGraphics,QC as RectangleOutlineGeometry,Wi as ReferenceFrame,oA as ReferenceProperty,Ge as RenderState,id as Renderbuffer,fu as RenderbufferFormat,Oo as Request,O0 as RequestErrorEvent,El as RequestScheduler,wi as RequestState,oa as RequestType,De as Resource,ki as ResourceCache,wu as ResourceCacheKey,ez as ResourceCacheStatistics,cr as ResourceLoader,Ct as ResourceLoaderState,pm as Rotation,oe as RuntimeError,jy as S2Cell,$a as SDFSettings,Cc as SampledPositionProperty,jd as SampledProperty,Ht as Sampler,Bg as ScaledPositionProperty,gG as Scene,ew as SceneFramebuffer,re as SceneMode,p4 as SceneMode2DPipelineStage,jW as SceneModePicker,zW as SceneModePickerViewModel,pr as SceneTransforms,gH as SceneTransitioner,wH as ScreenSpaceCameraController,W7 as ScreenSpaceElevatorCameraController,xa as ScreenSpaceEventHandler,fn as ScreenSpaceEventType,v0 as ScreenSpaceInputBindings,q7 as ScreenSpaceMapCameraController,R2e as ScreenSpaceTiltOrbitCameraController,O2e as ScreenSpaceZoomCameraController,wx as SelectedFeatureIdPipelineStage,qW as SelectionIndicator,GW as SelectionIndicatorViewModel,vO as SensorVolumePortionToDisplay,F_ as ShaderBuilder,QB as ShaderCache,de as ShaderDestination,c2 as ShaderFunction,Qt as ShaderProgram,Xe as ShaderSource,a2 as ShaderStruct,xA as ShadowMap,Kp as ShadowMapShader,Pn as ShadowMode,sd as ShadowVolumeAppearance,u2 as SharedContext,Dn as ShowGeometryInstanceAttribute,Pb as Simon1994PlanetaryPositions,$Fe as SimplePolylineGeometry,jV as SingleTileImageryProvider,_4 as SkinningPipelineStage,_G as SkyAtmosphere,yG as SkyBox,IH as SnapFramebuffer,JFe as SnapService,PH as Snapping,cG as SpatialNode,cz as Spdcf,Ep as SpecularEnvironmentCubeMap,y2e as SphereEmitter,l7 as SphereGeometry,Qy as SphereOutlineGeometry,PG as Spherical,Or as Spline,Yo as SplitDirection,dO as Splitter,Mh as StaticGeometryColorBatch,Lh as StaticGeometryPerMaterialBatch,ID as StaticGroundGeometryColorBatch,uU as StaticGroundGeometryPerMaterialBatch,hj as StaticGroundPolylinePerMaterialBatch,PD as StaticOutlineGeometryBatch,Xt as StencilConstants,ei as StencilFunction,Rt as StencilOperation,wz as SteppedSpline,kl as Stereographic,yx as StorageType,EO as StripeMaterialProperty,n0 as StripeOrientation,ic as StructuralMetadata,wp as StyleCommandsNeeded,A2e as StyleExpression,AG as Sun,N_ as SunLight,OH as SunPostProcess,rz as SupportedImageFormats,X7 as SvgPathBindingHandler,f2 as Sync,$n as TaskProcessor,j7 as Terrain,wf as TerrainData,Po as TerrainEncoding,TR as TerrainFillMesh,Sc as TerrainMesh,EC as TerrainOffsetProperty,Ej as TerrainPicker,Xr as TerrainProvider,cc as TerrainQuantization,kr as TerrainState,Dt as Texture,d2 as Texture3D,XE as TextureAtlas,t2 as TextureCache,Jn as TextureMagnificationFilter,kH as TextureManager,Wt as TextureMinificationFilter,lP as TexturePacker,UH as TextureUniform,hn as TextureWrap,_0 as TileAvailability,Ud as TileBoundingRegion,U8 as TileBoundingS2Cell,eA as TileBoundingSphere,b2e as TileBoundingVolume,H7 as TileCoordinatesImageryProvider,x2e as TileDiscardPolicy,In as TileEdge,T1 as TileImagery,Ix as TileMapServiceImageryProvider,N8 as TileMetadata,Sf as TileOrientedBoundingBox,no as TileProviderError,jj as TileReplacementQueue,gi as TileSelectionResult,E2e as TileState,u8 as Tileset3DTileContent,V8 as TilesetMetadata,Lz as TilesetPipelineStage,ZFe as TilingScheme,Un as TimeConstants,iS as TimeDynamicImagery,mO as TimeDynamicPointCloud,Cn as TimeInterval,Bs as TimeIntervalCollection,cA as TimeIntervalCollectionPositionProperty,NA as TimeIntervalCollectionProperty,ai as TimeStandard,KW as Timeline,YW as TimelineHighlightRange,XW as TimelineTrack,cL as Tipsify,uE as ToggleButtonViewModel,EA as Tonemapper,K_ as TrackingReferenceFrame,At as Transforms,Gb as TranslationRotationScale,z6 as TranslucentTileClassification,l1 as TridiagonalSystemSolver,VI as TrustedServers,sw as TweenCollection,i2 as UniformState,Kg as UniformType,B7 as UrlTemplate3DTilesDataProvider,Os as UrlTemplateImageryProvider,O9r as VERSION,QW as VRButton,JW as VRButtonViewModel,nBe as VRTheWorldTerrainProvider,N2e as VaryingType,Ag as Vector3DTileBatch,p8 as Vector3DTileClampedPolylines,_8 as Vector3DTileContent,ky as Vector3DTileGeometry,h8 as Vector3DTilePoints,m8 as Vector3DTilePolygons,bS as Vector3DTilePolylines,hS as Vector3DTilePrimitive,Ux as VectorGltf3DTileContent,Rs as VectorPipeline,$y as VectorProvider,DG as VelocityOrientationProperty,fA as VelocityVectorProperty,Vn as VertexArray,k_ as VertexArrayFacade,ct as VertexAttributeSemantic,Be as VertexFormat,br as VerticalExaggeration,A4 as VerticalExaggerationPipelineStage,qn as VerticalOrigin,QFe as VideoSynchronizer,nw as View,Ske as Viewer,C2e as ViewportQuad,ns as Visibility,OLe as Visualizer,vA as VoxelBoundsCollection,fw as VoxelBoxShape,NH as VoxelCell,uw as VoxelContent,dw as VoxelCylinderShape,hw as VoxelEllipsoidShape,nq as VoxelInspector,eq as VoxelInspectorViewModel,Jg as VoxelMetadataOrder,bT as VoxelPrimitive,v2e as VoxelProvider,nG as VoxelRenderResources,S2e as VoxelShape,Ic as VoxelShapeType,uG as VoxelTraversal,rBe as VulkanConstants,nU as WallGeometry,tv as WallGeometryLibrary,rU as WallGeometryUpdater,Q_ as WallGraphics,iU as WallOutlineGeometry,te as WebGLConstants,GV as WebMapServiceImageryProvider,WV as WebMapTileServiceImageryProvider,Ti as WebMercatorProjection,Uo as WebMercatorTilingScheme,sa as WindingOrder,v1 as WireframeIndexGenerator,b4 as WireframePipelineStage,X6 as _shadersAcesTonemappingStage,DH as _shadersAdditiveBlend,uP as _shadersAdjustTranslucentFS,i3 as _shadersAllMaterialAppearanceFS,r3 as _shadersAllMaterialAppearanceVS,K6 as _shadersAmbientOcclusionGenerate,$6 as _shadersAmbientOcclusionModulate,mk as _shadersAspectRampMaterial,Xm as _shadersAtmosphereCommon,Fz as _shadersAtmosphereStageFS,Bz as _shadersAtmosphereStageVS,o3 as _shadersBasicMaterialAppearanceFS,s3 as _shadersBasicMaterialAppearanceVS,h2 as _shadersBillboardCollectionFS,m2 as _shadersBillboardCollectionVS,J6 as _shadersBlackAndWhite,Z6 as _shadersBloomComposite,p2 as _shadersBrdfLutGeneratorFS,RH as _shadersBrightPass,Q6 as _shadersBrightness,g2 as _shadersBufferPointMaterialFS,_2 as _shadersBufferPointMaterialVS,y2 as _shadersBufferPolygonMaterialFS,A2 as _shadersBufferPolygonMaterialVS,b2 as _shadersBufferPolylineMaterialFS,x2 as _shadersBufferPolylineMaterialVS,pk as _shadersBumpMapMaterial,dV as _shadersCPUStylingStageFS,fV as _shadersCPUStylingStageVS,gk as _shadersCheckerboardMaterial,T2 as _shadersCloudCollectionFS,E2 as _shadersCloudCollectionVS,C2 as _shadersCloudNoiseFS,v2 as _shadersCloudNoiseVS,S2 as _shadersCompareAndPackTranslucentDepth,w2 as _shadersCompositeOITFS,tw as _shadersCompositeTranslucentClassification,I2 as _shadersComputeIrradianceFS,P2 as _shadersComputeRadianceMapFS,r4 as _shadersConstantLodStageFS,i4 as _shadersConstantLodStageVS,eH as _shadersContrastBias,D2 as _shadersConvolveSpecularMapFS,R2 as _shadersConvolveSpecularMapVS,O2 as _shadersCubeMapPanoramaVS,pV as _shadersCustomShaderStageFS,mV as _shadersCustomShaderStageVS,HE as _shadersCzmBuiltins,tH as _shadersDepthOfField,M2 as _shadersDepthPlaneFS,N2 as _shadersDepthPlaneVS,nH as _shadersDepthView,MLe as _shadersDepthViewPacked,_k as _shadersDotMaterial,iH as _shadersEdgeDetection,TV as _shadersEdgeDetectionStageFS,CV as _shadersEdgeVisibilityStageFS,vV as _shadersEdgeVisibilityStageVS,yk as _shadersElevationBandMaterial,Ak as _shadersElevationContourMaterial,bk as _shadersElevationRampMaterial,fP as _shadersEllipsoidFS,U9 as _shadersEllipsoidSurfaceAppearanceFS,z9 as _shadersEllipsoidSurfaceAppearanceVS,dP as _shadersEllipsoidVS,sH as _shadersFXAA,L2 as _shadersFXAA3_11,xk as _shadersFadeMaterial,gV as _shadersFeatureIdStageFS,_V as _shadersFeatureIdStageVS,rH as _shadersFilmicTonemapping,fT as _shadersGaussianBlur1D,wV as _shadersGeometryStageFS,IV as _shadersGeometryStageVS,F2 as _shadersGlobeFS,B2 as _shadersGlobeVS,Tk as _shadersGridMaterial,hP as _shadersGroundAtmosphere,ZF as _shadersHSBToRGB,QF as _shadersHSLToRGB,Uz as _shadersImageBasedLightingStageFS,eV as _shadersInstancingStageCommon,tV as _shadersInstancingStageVS,XH as _shadersIntersectBox,KH as _shadersIntersectCylinder,qH as _shadersIntersectDepth,$H as _shadersIntersectEllipsoid,nO as _shadersIntersectLongitude,YH as _shadersIntersectPlane,lw as _shadersIntersection,WH as _shadersIntersectionUtils,nV as _shadersLegacyInstancingStageVS,aH as _shadersLensFlare,e4 as _shadersLightingStageFS,n4 as _shadersMaterialStageFS,tG as _shadersMegatexture,yV as _shadersMetadataStageFS,AV as _shadersMetadataStageVS,Wz as _shadersModelClippingPlanesStageFS,Yz as _shadersModelClippingPolygonsStageFS,Xz as _shadersModelClippingPolygonsStageVS,Gz as _shadersModelColorStageFS,k4 as _shadersModelFS,C4 as _shadersModelSilhouetteStageFS,v4 as _shadersModelSilhouetteStageVS,I4 as _shadersModelSplitterStageFS,B4 as _shadersModelVS,Jz as _shadersModelVectorLookupStageFS,$z as _shadersModelVectorLookupStageVS,cH as _shadersModifiedReinhardTonemapping,s4 as _shadersMorphTargetsStageVS,lH as _shadersNightVision,Ek as _shadersNormalMapMaterial,eG as _shadersOctree,Pf as _shadersPassThrough,cT as _shadersPassThroughDepth,oH as _shadersPbrNeutralTonemapping,Uk as _shadersPerInstanceColorAppearanceFS,zk as _shadersPerInstanceColorAppearanceVS,ZE as _shadersPerInstanceFlatColorAppearanceFS,Vk as _shadersPerInstanceFlatColorAppearanceVS,gz as _shadersPointCloudEyeDomeLighting,l4 as _shadersPointCloudStylingStageVS,Rb as _shadersPointPrimitiveCollectionFS,k2 as _shadersPointPrimitiveCollectionVS,Ck as _shadersPolylineArrowMaterial,dk as _shadersPolylineColorAppearanceVS,du as _shadersPolylineCommon,vk as _shadersPolylineDashMaterial,KE as _shadersPolylineFS,Sk as _shadersPolylineGlowMaterial,hk as _shadersPolylineMaterialAppearanceVS,wk as _shadersPolylineOutlineMaterial,U2 as _shadersPolylineShadowVolumeFS,z2 as _shadersPolylineShadowVolumeMorphFS,V2 as _shadersPolylineShadowVolumeMorphVS,j2 as _shadersPolylineShadowVolumeVS,H2 as _shadersPolylineVS,G2 as _shadersPrimitiveGaussianSplatFS,W2 as _shadersPrimitiveGaussianSplatVS,d4 as _shadersPrimitiveOutlineStageFS,f4 as _shadersPrimitiveOutlineStageVS,vB as _shadersRGBToHSB,SB as _shadersRGBToHSL,wB as _shadersRGBToXYZ,uH as _shadersReinhardTonemapping,q2 as _shadersReprojectWebMercatorFS,Y2 as _shadersReprojectWebMercatorVS,Ik as _shadersRimLightingMaterial,d1 as _shadersSelectedFeatureIdStageCommon,mP as _shadersShadowVolumeAppearanceFS,X2 as _shadersShadowVolumeAppearanceVS,Ob as _shadersShadowVolumeFS,fH as _shadersSilhouette,g4 as _shadersSkinningStageVS,pP as _shadersSkyAtmosphereCommon,K2 as _shadersSkyAtmosphereFS,$2 as _shadersSkyAtmosphereVS,J2 as _shadersSkyBoxFS,Z2 as _shadersSkyBoxVS,Pk as _shadersSlopeRampMaterial,Dk as _shadersStripeMaterial,Q2 as _shadersSunFS,ek as _shadersSunTextureFS,tk as _shadersSunVS,a3 as _shadersTexturedMaterialAppearanceFS,c3 as _shadersTexturedMaterialAppearanceVS,nk as _shadersVector3DTileClampedPolylinesFS,ik as _shadersVector3DTileClampedPolylinesVS,rk as _shadersVector3DTilePolylinesVS,U_ as _shadersVectorCommon,gP as _shadersVectorTileVS,y4 as _shadersVerticalExaggerationStageVS,ok as _shadersViewportQuadFS,LE as _shadersViewportQuadVS,HH as _shadersVoxelFS,jH as _shadersVoxelUtils,GH as _shadersVoxelVS,Ok as _shadersWater,Rk as _shadersWaterMaskMaterial,JB as _shadersXYZToRGB,mF as _shadersacesTonemapping,pF as _shadersalphaWeight,gF as _shadersantialias,_F as _shadersapplyHSBShift,yF as _shadersapproximateSphericalCoordinates,AF as _shadersapproximateTanh,bF as _shadersbackFacing,xF as _shadersbranchFreeTernary,TF as _shaderscascadeColor,EF as _shaderscascadeDistance,CF as _shaderscascadeMatrix,vF as _shaderscascadeWeights,SF as _shaderscolumbusViewMorph,wF as _shaderscomputeAtmosphereColor,IF as _shaderscomputeGroundAtmosphereScattering,PF as _shaderscomputePosition,DF as _shaderscomputeScattering,RF as _shaderscomputeTextureTransform,JH as _shadersconvertLocalToBoxUv,ZH as _shadersconvertLocalToCylinderUv,QH as _shadersconvertLocalToEllipsoidUv,OF as _shaderscosineAndSine,MF as _shadersdecodeRGB8,NF as _shadersdecompressTextureCoordinates,yL as _shadersdegreesPerRadian,LF as _shadersdepthClamp,AL as _shadersdepthRange,sF as _shadersdepthRangeStruct,FF as _shaderseastNorthUpToEyeCoordinates,BF as _shadersellipsoidContainsPoint,kF as _shadersellipsoidTextureCoordinates,bL as _shadersepsilon1,xL as _shadersepsilon2,TL as _shadersepsilon3,EL as _shadersepsilon4,CL as _shadersepsilon5,vL as _shadersepsilon6,SL as _shadersepsilon7,UF as _shadersequalsEpsilon,zF as _shaderseyeOffset,VF as _shaderseyeToCartographicDelta,jF as _shaderseyeToWindowCoordinates,HF as _shadersfastApproximateAtan,GF as _shadersfog,WF as _shadersgammaCorrect,qF as _shadersgeodeticSurfaceNormal,YF as _shadersgetDefaultMaterial,XF as _shadersgetDynamicAtmosphereLightDirection,KF as _shadersgetLambertDiffuse,$F as _shadersgetSpecular,JF as _shadersgetWaterNoise,eB as _shadershue,wL as _shadersinfinity,tB as _shadersinverseGamma,nB as _shadersisEmpty,iB as _shadersisFull,rB as _shaderslatitudeToWebMercatorFraction,sB as _shaderslineDistance,oB as _shaderslinearToSrgb,aB as _shadersluminance,aF as _shadersmaterial,cF as _shadersmaterialInput,cB as _shadersmaximumComponent,lB as _shadersmetersPerPixel,lF as _shadersmodelMaterial,uB as _shadersmodelToWindowCoordinates,uF as _shadersmodelVertexOutput,fB as _shadersmultiplyWithColorBalance,dB as _shadersnearFarScalar,hB as _shadersoctDecode,IL as _shadersoneOverPi,PL as _shadersoneOverTwoPi,mB as _shaderspackDepth,DL as _shaderspassCesium3DTile,RL as _shaderspassCesium3DTileClassification,OL as _shaderspassCesium3DTileClassificationIgnoreShow,ML as _shaderspassCesium3DTileEdges,NL as _shaderspassCesium3DTileEdgesDirect,LL as _shaderspassCesium3DTilePlanarFillId,FL as _shaderspassClassification,BL as _shaderspassCompute,kL as _shaderspassEnvironment,UL as _shaderspassGaussianSplats,zL as _shaderspassGlobe,VL as _shaderspassOpaque,jL as _shaderspassOverlay,HL as _shaderspassTerrainClassification,GL as _shaderspassTranslucent,WL as _shaderspassVoxels,pB as _shaderspbrLighting,gB as _shaderspbrNeutralTonemapping,_B as _shadersphong,qL as _shaderspi,YL as _shaderspiOverFour,XL as _shaderspiOverSix,KL as _shaderspiOverThree,$L as _shaderspiOverTwo,yB as _shadersplaneDistance,AB as _shaderspointAlongRay,JL as _shadersradiansPerDegree,fF as _shadersray,bB as _shadersrayEllipsoidIntersectionInterval,dF as _shadersraySegment,xB as _shadersraySphereIntersectionInterval,TB as _shadersreadDepth,EB as _shadersreadNonPerspective,CB as _shadersreverseLogDepth,IB as _shadersround,PB as _shaderssaturation,ZL as _shaderssceneMode2D,QL as _shaderssceneMode3D,eF as _shaderssceneModeColumbusView,tF as _shaderssceneModeMorphing,DB as _shadersshadowDepthCompare,hF as _shadersshadowParameters,RB as _shadersshadowVisibility,OB as _shaderssignNotZero,nF as _shaderssolarRadius,MB as _shaderssphericalHarmonics,NB as _shaderssrgbToLinear,LB as _shaderstangentToEyeSpaceMatrix,FB as _shaderstextureCube,iF as _shadersthreePiOver2,BB as _shaderstransformPlane,kB as _shaderstranslateRelativeToEye,UB as _shaderstranslucentPhong,zB as _shaderstranspose,rF as _shaderstwoPi,VB as _shadersunpackDepth,jB as _shadersunpackFloat,HB as _shadersunpackTexture,GB as _shadersunpackUint,WB as _shadersvalueTransform,qB as _shadersvertexLogDepth,oF as _shaderswebMercatorMaxLatitude,YB as _shaderswindowToEyeCoordinates,XB as _shaderswriteDepthClamp,KB as _shaderswriteLogDepth,$B as _shaderswriteNonPerspective,Zn as addAllToArray,VU as addBuffer,OU as addDefaults,kU as addExtensionsRequired,Vh as addExtensionsUsed,mx as addPipelineExtras,Ma as addToArray,wN as appendForwardSlash,Lr as arrayRemoveDuplicates,xue as assert,BE as barycentricCoordinates,Pr as binarySearch,Zt as buildModuleUrl,h7 as buildVectorGltfFromMVT,tO as buildVoxelCustomShader,iG as buildVoxelDrawCommands,Ze as clone,Mt as combine,jS as computeFlyToLocationForRectangle,gS as createBillboardPointCallback,LH as createColorRamp,On as createCommand,dW as createDefaultImageryProviderViewModels,hW as createDefaultTerrainProviderViewModels,TBe as createElevationBandMaterial,CBe as createGooglePhotorealistic3DTileset,Kn as createGuid,fo as createMaterialPropertyDescriptor,vBe as createOsmBuildingsAsync,me as createPropertyDescriptor,_u as createRawPropertyDescriptor,SBe as createTangentSpaceDebugPrimitive,B2e as createTaskProcessorWorker,JN as createUniform,ZN as createUniformArray,v8 as createVectorTileBuffersFromModelComponents,$9 as createWorldBathymetryAsync,Oy as createWorldImageryAsync,_I as createWorldTerrainAsync,J9 as decodeGoogleEarthEnterpriseData,C7 as decodeMVT,g8 as decodeVectorPolylinePositions,C0 as defaultPickWorldPosition,tf as defer,l as defined,ZB as demodernizeShader,Yr as deprecationWarning,le as destroyObject,GMe as exportKml,Iv as findAccessorMinMax,vS as findContentMetadata,SS as findGroupMetadata,ux as findMeshoptExtension,L8 as findTileMetadata,$D as forEachTextureInMaterial,z0 as formatError,ule as freezeRenderState,fh as getAbsoluteUri,pf as getAccessorByteStride,IN as getBaseUri,Hh as getBinaryAccessor,bG as getClipAndStyleCode,GS as getClippingFunction,gy as getComponentReader,kn as getElement,S_ as getExtensionFromUri,RA as getFilenameFromUri,FH as getImageFromTypedArray,Bm as getImagePixels,Fo as getJsonFromTypedArray,yp as getMagic,mz as getMeshPrimitives,fG as getMetadataClassProperty,hG as getMetadataProperty,_f as getStringFromTypedArray,xn as getTimestamp,lr as hasExtension,ey as heightReferenceOnEntityPropertyChanged,Zl as isBitSet,vE as isBlobUri,_b as isCrossOriginUrl,Um as isDataUri,ou as isLeapYear,Se as knockout,DI as knockout_3_5_1,Y7 as knockout_es5,SE as loadAndExecuteScript,s2 as loadCubeMap,Cy as loadImageFromTypedArray,nf as loadKTX2,Vg as mergeSort,Qm as mostDetailedSurfaceHeight,BU as moveTechniqueRenderStates,UU as moveTechniquesToExtension,vd as numberOfComponentsForType,wE as objectToQuery,yt as oneTimeWarning,wy as parseBatchTable,DU as parseFeatureMetadataLegacy,wv as parseGlb,DN as parseResponseHeaders,PU as parseStructuralMetadata,P1 as pickModel,YFe as pointInsideTriangle,W_ as positionForSurfaceHeight,Jy as preprocess3DTileContent,VH as processVoxelProperties,Jf as queryToObject,jU as readAccessorPacked,Pv as removeExtension,NU as removeExtensionsRequired,Sv as removeExtensionsUsed,FU as removePipelineExtras,zU as removeUnusedElements,A8 as renderBufferPointCollection,_U as renderBufferPolygonCollection,x8 as renderBufferPolylineCollection,px as resizeImageToNextPowerOfTwo,Aj as sampleTerrain,VS as sampleTerrainMostDetailed,xE as scaleToGeodeticSurface,TI as srgbToLinear,Mk as subdivideArray,Oc as subscribeAndEvaluate,GU as updateAccessorComponentTypes,qU as updateVersion,Jo as usesExtension,wke as viewerCesium3DTilesInspectorMixin,Ike as viewerCesiumInspectorMixin,Dke as viewerDragDropMixin,Rke as viewerPerformanceWatchdogMixin,Mke as viewerVoxelInspectorMixin,oBe as webGLConstantToGlslType,f7 as wrapFunction,rC as writeTextToCanvas}; //# sourceMappingURL=index.js.map